From: Andrea Bianco Date: Thu, 16 Apr 2020 13:11:12 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.4.14 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=9409b5ac3e6747b7a603fc861dd061db972af219;p=motion2.git Built motion from commit (unavailable).|2.4.14 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index afeb116..9a1bd1f 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.4.14", "description": "Thank you for choosing xCALLY MOTION, one of the first Omni Channel solution integrated with AsteriskTM and the most innovative real time solutions available on the market.", "title": "xCALLY MOTION API", "header": { "title": "Introduction", "content": "

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

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

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

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

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

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

The API

\n

This is the documentation for the xCALLY MOTION API.

\n

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

\n

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

\n

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

\n

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

\n
GET /api/users\n
\n

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

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

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

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

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

\n

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

\n

Security and Authentication

\n

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

\n

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

\n

Basic authentication

\n

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

\n

Example:

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

OAuth access token

\n

The xCALLY API supports OAuth authorization flows.

\n

OAuth access tokens also permit client-side API requests.

\n

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

\n

Example:

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

API Key

\n

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

\n

Example:

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

Request Format

\n

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

\n

Response Format

\n

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

\n

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

\n

200 range

\n

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

\n

400 range

\n

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

\n

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

\n

500 range

\n

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

\n

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

\n

Data Types

\n

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

\n

ID integers

\n

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

\n

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

\n

Time stamps

\n

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

\n" }, "template": { "withGenerator": false, "withCompare": false, "forceLanguage": "en" }, "sampleUrl": false, "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2020-04-16T12:59:58.117Z", "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 965724b..1aa4801 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 _0x3866=['motionbar','jscripty','urlForward','browser','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT','sequelize','exports','VIRTUAL','getDataValue','action','STRING','contactManager','integration'];(function(_0x1808c3,_0x41551b){var _0x256bf4=function(_0x52fe2e){while(--_0x52fe2e){_0x1808c3['push'](_0x1808c3['shift']());}};_0x256bf4(++_0x41551b);}(_0x3866,0x184));var _0x6386=function(_0x4ed8ca,_0x4f58fe){_0x4ed8ca=_0x4ed8ca-0x0;var _0x37f902=_0x3866[_0x4ed8ca];return _0x37f902;};'use strict';var Sequelize=require(_0x6386('0x0'));module[_0x6386('0x1')]={'name':{'type':Sequelize[_0x6386('0x2')],'get':function(_0x429405){return this[_0x6386('0x3')](_0x6386('0x4'));}},'action':{'type':Sequelize[_0x6386('0x5')],'allowNull':![],'validate':{'isIn':{'args':[[_0x6386('0x6'),_0x6386('0x7'),_0x6386('0x8'),_0x6386('0x9'),_0x6386('0xa'),_0x6386('0xb'),_0x6386('0xc'),_0x6386('0xd')]],'msg':_0x6386('0xe')}},'comment':_0x6386('0xe')},'data1':{'type':Sequelize['STRING'](0x1000),'comment':_0x6386('0xf')},'data2':{'type':Sequelize[_0x6386('0x5')](0x1000),'comment':_0x6386('0x10')},'data3':{'type':Sequelize[_0x6386('0x5')](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x6386('0x5')](0x1000)},'data5':{'type':Sequelize[_0x6386('0x5')](0x1000)},'data6':{'type':Sequelize[_0x6386('0x5')]},'data7':{'type':Sequelize[_0x6386('0x11')]}}; \ No newline at end of file +var _0x8a65=['integration','jscripty','urlForward','browser','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','VIRTUAL','getDataValue','action','STRING','contactManager'];(function(_0x3e4151,_0xa837ff){var _0x5eae02=function(_0x28d741){while(--_0x28d741){_0x3e4151['push'](_0x3e4151['shift']());}};_0x5eae02(++_0xa837ff);}(_0x8a65,0x175));var _0x58a6=function(_0x4a1b3c,_0x20aa97){_0x4a1b3c=_0x4a1b3c-0x0;var _0xe314d7=_0x8a65[_0x4a1b3c];return _0xe314d7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x58a6('0x0')],'get':function(_0x2ee4fc){return this[_0x58a6('0x1')](_0x58a6('0x2'));}},'action':{'type':Sequelize[_0x58a6('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x58a6('0x4'),_0x58a6('0x5'),'motionbar',_0x58a6('0x6'),_0x58a6('0x7'),_0x58a6('0x8'),'bot',_0x58a6('0x9')]],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x58a6('0xa')},'data1':{'type':Sequelize[_0x58a6('0x3')](0x1000),'comment':'contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'},'data2':{'type':Sequelize['STRING'](0x1000),'comment':_0x58a6('0xb')},'data3':{'type':Sequelize[_0x58a6('0x3')](0x1000),'comment':_0x58a6('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0x58a6('0x3')](0x1000)},'data6':{'type':Sequelize[_0x58a6('0x3')]},'data7':{'type':Sequelize[_0x58a6('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 1a387f7..dfb713b 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 _0xa378=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','json','apply','reject','save','update','then','error','stack','name','send','body','find','params','destroy','Action','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse'];(function(_0x3ad2e5,_0x94d414){var _0xc4e565=function(_0x2c96e3){while(--_0x2c96e3){_0x3ad2e5['push'](_0x3ad2e5['shift']());}};_0xc4e565(++_0x94d414);}(_0xa378,0x114));var _0x8a37=function(_0x8fc2fa,_0x447139){_0x8fc2fa=_0x8fc2fa-0x0;var _0x19b23a=_0xa378[_0x8fc2fa];return _0x19b23a;};'use strict';var pdf=require(_0x8a37('0x0'));var emlformat=require(_0x8a37('0x1'));var rimraf=require(_0x8a37('0x2'));var zipdir=require(_0x8a37('0x3'));var jsonpatch=require(_0x8a37('0x4'));var rp=require(_0x8a37('0x5'));var moment=require(_0x8a37('0x6'));var BPromise=require(_0x8a37('0x7'));var Mustache=require(_0x8a37('0x8'));var util=require(_0x8a37('0x9'));var path=require(_0x8a37('0xa'));var sox=require('sox');var csv=require(_0x8a37('0xb'));var ejs=require(_0x8a37('0xc'));var fs=require('fs');var _=require(_0x8a37('0xd'));var squel=require(_0x8a37('0xe'));var crypto=require(_0x8a37('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8a37('0xb'));var querystring=require(_0x8a37('0x10'));var Papa=require(_0x8a37('0x11'));var Redis=require(_0x8a37('0x12'));var authService=require(_0x8a37('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x8a37('0x14'));var hardwareService=require(_0x8a37('0x15'));var logger=require(_0x8a37('0x16'))(_0x8a37('0x17'));var utils=require(_0x8a37('0x18'));var config=require(_0x8a37('0x19'));var db=require(_0x8a37('0x1a'))['db'];function respondWithStatusCode(_0x75466d,_0x24f760){_0x24f760=_0x24f760||0xcc;return function(_0x557386){if(_0x557386){return _0x75466d[_0x8a37('0x1b')](_0x24f760);}return _0x75466d[_0x8a37('0x1c')](_0x24f760)[_0x8a37('0x1d')]();};}function respondWithResult(_0x357bef,_0x322f4f){_0x322f4f=_0x322f4f||0xc8;return function(_0xe0b1b3){if(_0xe0b1b3){return _0x357bef[_0x8a37('0x1c')](_0x322f4f)['json'](_0xe0b1b3);}};}function respondWithFilteredResult(_0x4c0168,_0x5dbb7c){return function(_0x180c94){if(_0x180c94){var _0xc6a970=_0x180c94[_0x8a37('0x1e')],_0x5996cc=_0x5dbb7c['offset'],_0x3054d6=_0x5dbb7c['offset']+_0x5dbb7c[_0x8a37('0x1f')],_0x2249c1;if(_0x3054d6>=_0xc6a970){_0x3054d6=_0xc6a970;_0x2249c1=0xc8;}else{_0x2249c1=0xce;}_0x4c0168[_0x8a37('0x1c')](_0x2249c1);return _0x4c0168[_0x8a37('0x20')]('Content-Range',_0x5996cc+'-'+_0x3054d6+'/'+_0xc6a970)[_0x8a37('0x21')](_0x180c94);}return null;};}function patchUpdates(_0x5f3282){return function(_0x4674f3){try{jsonpatch[_0x8a37('0x22')](_0x4674f3,_0x5f3282,!![]);}catch(_0x2958a3){return BPromise[_0x8a37('0x23')](_0x2958a3);}return _0x4674f3[_0x8a37('0x24')]();};}function saveUpdates(_0x95279a,_0x3c3173){return function(_0x371398){if(_0x371398){return _0x371398[_0x8a37('0x25')](_0x95279a)[_0x8a37('0x26')](function(_0x2be33e){return _0x2be33e;});}return null;};}function removeEntity(_0xe61896,_0x40b697){return function(_0x41c7bc){if(_0x41c7bc){return _0x41c7bc['destroy']()['then'](function(){_0xe61896[_0x8a37('0x1c')](0xcc)[_0x8a37('0x1d')]();});}};}function handleEntityNotFound(_0x1da6de,_0x5ae414){return function(_0x2f314c){if(!_0x2f314c){_0x1da6de[_0x8a37('0x1b')](0x194);}return _0x2f314c;};}function handleError(_0x376bb2,_0x15985d){_0x15985d=_0x15985d||0x1f4;return function(_0x25c2ec){logger[_0x8a37('0x27')](_0x25c2ec[_0x8a37('0x28')]);if(_0x25c2ec[_0x8a37('0x29')]){delete _0x25c2ec['name'];}_0x376bb2['status'](_0x15985d)[_0x8a37('0x2a')](_0x25c2ec);};}exports[_0x8a37('0x25')]=function(_0x519b35,_0x24cab7){if(_0x519b35[_0x8a37('0x2b')]['id']){delete _0x519b35[_0x8a37('0x2b')]['id'];}return db['Action'][_0x8a37('0x2c')]({'where':{'id':_0x519b35[_0x8a37('0x2d')]['id']}})[_0x8a37('0x26')](handleEntityNotFound(_0x24cab7,null))[_0x8a37('0x26')](saveUpdates(_0x519b35[_0x8a37('0x2b')],null))[_0x8a37('0x26')](respondWithResult(_0x24cab7,null))['catch'](handleError(_0x24cab7,null));};exports[_0x8a37('0x2e')]=function(_0xcf7d4b,_0x523bc1){return db[_0x8a37('0x2f')][_0x8a37('0x2c')]({'where':{'id':_0xcf7d4b['params']['id']}})[_0x8a37('0x26')](handleEntityNotFound(_0x523bc1,null))[_0x8a37('0x26')](removeEntity(_0x523bc1,null))[_0x8a37('0x30')](handleError(_0x523bc1,null));}; \ No newline at end of file +var _0x3b82=['apply','reject','update','then','destroy','error','stack','name','body','Action','find','params','catch','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json'];(function(_0x55d2bc,_0x2f3f1b){var _0x30e63b=function(_0x4714fc){while(--_0x4714fc){_0x55d2bc['push'](_0x55d2bc['shift']());}};_0x30e63b(++_0x2f3f1b);}(_0x3b82,0xf3));var _0x23b8=function(_0x5f458c,_0x382344){_0x5f458c=_0x5f458c-0x0;var _0x1f000f=_0x3b82[_0x5f458c];return _0x1f000f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x23b8('0x0'));var zipdir=require(_0x23b8('0x1'));var jsonpatch=require(_0x23b8('0x2'));var rp=require(_0x23b8('0x3'));var moment=require(_0x23b8('0x4'));var BPromise=require(_0x23b8('0x5'));var Mustache=require(_0x23b8('0x6'));var util=require(_0x23b8('0x7'));var path=require(_0x23b8('0x8'));var sox=require(_0x23b8('0x9'));var csv=require(_0x23b8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x23b8('0xb'));var squel=require(_0x23b8('0xc'));var crypto=require(_0x23b8('0xd'));var jsforce=require(_0x23b8('0xe'));var deskjs=require(_0x23b8('0xf'));var toCsv=require(_0x23b8('0xa'));var querystring=require(_0x23b8('0x10'));var Papa=require(_0x23b8('0x11'));var Redis=require(_0x23b8('0x12'));var authService=require(_0x23b8('0x13'));var qs=require(_0x23b8('0x14'));var as=require(_0x23b8('0x15'));var hardwareService=require(_0x23b8('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x23b8('0x17'));var config=require(_0x23b8('0x18'));var db=require(_0x23b8('0x19'))['db'];function respondWithStatusCode(_0x141ddf,_0x11bf1e){_0x11bf1e=_0x11bf1e||0xcc;return function(_0x280c70){if(_0x280c70){return _0x141ddf[_0x23b8('0x1a')](_0x11bf1e);}return _0x141ddf[_0x23b8('0x1b')](_0x11bf1e)['end']();};}function respondWithResult(_0x2e9837,_0x431cc4){_0x431cc4=_0x431cc4||0xc8;return function(_0x394f6a){if(_0x394f6a){return _0x2e9837[_0x23b8('0x1b')](_0x431cc4)['json'](_0x394f6a);}};}function respondWithFilteredResult(_0x3c9871,_0x56035b){return function(_0xb889f4){if(_0xb889f4){var _0x2b5d89=_0xb889f4[_0x23b8('0x1c')],_0x287741=_0x56035b[_0x23b8('0x1d')],_0x30c7cb=_0x56035b['offset']+_0x56035b[_0x23b8('0x1e')],_0x312c92;if(_0x30c7cb>=_0x2b5d89){_0x30c7cb=_0x2b5d89;_0x312c92=0xc8;}else{_0x312c92=0xce;}_0x3c9871['status'](_0x312c92);return _0x3c9871[_0x23b8('0x1f')]('Content-Range',_0x287741+'-'+_0x30c7cb+'/'+_0x2b5d89)[_0x23b8('0x20')](_0xb889f4);}return null;};}function patchUpdates(_0x435d55){return function(_0xddf307){try{jsonpatch[_0x23b8('0x21')](_0xddf307,_0x435d55,!![]);}catch(_0x56a36){return BPromise[_0x23b8('0x22')](_0x56a36);}return _0xddf307['save']();};}function saveUpdates(_0x47ef94,_0x30431a){return function(_0x4a22c6){if(_0x4a22c6){return _0x4a22c6[_0x23b8('0x23')](_0x47ef94)[_0x23b8('0x24')](function(_0x54bba0){return _0x54bba0;});}return null;};}function removeEntity(_0x253558,_0xf0e246){return function(_0x446ac1){if(_0x446ac1){return _0x446ac1[_0x23b8('0x25')]()[_0x23b8('0x24')](function(){_0x253558['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2179cc,_0x4bc4f5){return function(_0x296491){if(!_0x296491){_0x2179cc['sendStatus'](0x194);}return _0x296491;};}function handleError(_0x1ee2ae,_0x14190e){_0x14190e=_0x14190e||0x1f4;return function(_0x5a0ed3){logger[_0x23b8('0x26')](_0x5a0ed3[_0x23b8('0x27')]);if(_0x5a0ed3[_0x23b8('0x28')]){delete _0x5a0ed3[_0x23b8('0x28')];}_0x1ee2ae['status'](_0x14190e)['send'](_0x5a0ed3);};}exports[_0x23b8('0x23')]=function(_0x39943f,_0x36545b){if(_0x39943f[_0x23b8('0x29')]['id']){delete _0x39943f[_0x23b8('0x29')]['id'];}return db[_0x23b8('0x2a')][_0x23b8('0x2b')]({'where':{'id':_0x39943f[_0x23b8('0x2c')]['id']}})['then'](handleEntityNotFound(_0x36545b,null))[_0x23b8('0x24')](saveUpdates(_0x39943f['body'],null))[_0x23b8('0x24')](respondWithResult(_0x36545b,null))['catch'](handleError(_0x36545b,null));};exports[_0x23b8('0x25')]=function(_0xaf0051,_0x2d528a){return db['Action']['find']({'where':{'id':_0xaf0051[_0x23b8('0x2c')]['id']}})['then'](handleEntityNotFound(_0x2d528a,null))[_0x23b8('0x24')](removeEntity(_0x2d528a,null))[_0x23b8('0x2d')](handleError(_0x2d528a,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 1ae7425..5a9824c 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 _0xf0ec=['rimraf','../../config/environment','./action.attributes','define','Action','tools_actions','lodash','../../config/logger','bluebird','request-promise','path'];(function(_0x10e315,_0x337977){var _0x5ebc47=function(_0x5eda9e){while(--_0x5eda9e){_0x10e315['push'](_0x10e315['shift']());}};_0x5ebc47(++_0x337977);}(_0xf0ec,0x17c));var _0xcf0e=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0xf0ec[_0x2e76a7];return _0x454cde;};'use strict';var _=require(_0xcf0e('0x0'));var util=require('util');var logger=require(_0xcf0e('0x1'))('api');var moment=require('moment');var BPromise=require(_0xcf0e('0x2'));var rp=require(_0xcf0e('0x3'));var fs=require('fs');var path=require(_0xcf0e('0x4'));var rimraf=require(_0xcf0e('0x5'));var config=require(_0xcf0e('0x6'));var attributes=require(_0xcf0e('0x7'));module['exports']=function(_0x340c5c,_0x38bb54){return _0x340c5c[_0xcf0e('0x8')](_0xcf0e('0x9'),attributes,{'tableName':_0xcf0e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa425=['../../config/logger','api','moment','request-promise','rimraf','./action.attributes','exports','define','Action','lodash','util'];(function(_0x443242,_0x4d9878){var _0x2c7479=function(_0xa1a7b6){while(--_0xa1a7b6){_0x443242['push'](_0x443242['shift']());}};_0x2c7479(++_0x4d9878);}(_0xa425,0x11c));var _0x5a42=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xa425[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require(_0x5a42('0x0'));var util=require(_0x5a42('0x1'));var logger=require(_0x5a42('0x2'))(_0x5a42('0x3'));var moment=require(_0x5a42('0x4'));var BPromise=require('bluebird');var rp=require(_0x5a42('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5a42('0x6'));var config=require('../../config/environment');var attributes=require(_0x5a42('0x7'));module[_0x5a42('0x8')]=function(_0x34aea9,_0x4b6652){return _0x34aea9[_0x5a42('0x9')](_0x5a42('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index c9da35f..1fe8257 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 _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x3014a4,_0x56b5aa){var _0x4ff3da=function(_0x17c093){while(--_0x17c093){_0x3014a4['push'](_0x3014a4['shift']());}};_0x4ff3da(++_0x56b5aa);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file +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(_0x4e8ef7,_0x27666f){var _0x23fafe=function(_0xd4610c){while(--_0xd4610c){_0x4e8ef7['push'](_0x4e8ef7['shift']());}};_0x23fafe(++_0x27666f);}(_0x70e0,0x17b));var _0x070e=function(_0x11d6c9,_0x423c38){_0x11d6c9=_0x11d6c9-0x0;var _0x2df44a=_0x70e0[_0x11d6c9];return _0x2df44a;};'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 1b239ca..723102e 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 _0x115e=['exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','update','destroy'];(function(_0x462882,_0x40588e){var _0x534acb=function(_0x1f1be1){while(--_0x1f1be1){_0x462882['push'](_0x462882['shift']());}};_0x534acb(++_0x40588e);}(_0x115e,0xe1));var _0xe115=function(_0x22377a,_0x3397cb){_0x22377a=_0x22377a-0x0;var _0x36f105=_0x115e[_0x22377a];return _0x36f105;};'use strict';var multer=require(_0xe115('0x0'));var util=require(_0xe115('0x1'));var path=require('path');var timeout=require(_0xe115('0x2'));var express=require('express');var router=express[_0xe115('0x3')]();var auth=require(_0xe115('0x4'));var interaction=require(_0xe115('0x5'));var config=require(_0xe115('0x6'));var controller=require(_0xe115('0x7'));router[_0xe115('0x8')](_0xe115('0x9'),auth[_0xe115('0xa')](),controller[_0xe115('0xb')]);router['delete'](_0xe115('0x9'),auth[_0xe115('0xa')](),controller[_0xe115('0xc')]);module[_0xe115('0xd')]=router; \ No newline at end of file +var _0x2c89=['Router','../../components/auth/service','put','/:id','isAuthenticated','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0xd95bc9,_0x114062){var _0x2c3b8e=function(_0x377a01){while(--_0x377a01){_0xd95bc9['push'](_0xd95bc9['shift']());}};_0x2c3b8e(++_0x114062);}(_0x2c89,0x1dd));var _0x92c8=function(_0x49959e,_0x3f6a2a){_0x49959e=_0x49959e-0x0;var _0x921016=_0x2c89[_0x49959e];return _0x921016;};'use strict';var multer=require('multer');var util=require(_0x92c8('0x0'));var path=require(_0x92c8('0x1'));var timeout=require(_0x92c8('0x2'));var express=require('express');var router=express[_0x92c8('0x3')]();var auth=require(_0x92c8('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./action.controller');router[_0x92c8('0x5')](_0x92c8('0x6'),auth[_0x92c8('0x7')](),controller[_0x92c8('0x8')]);router[_0x92c8('0x9')](_0x92c8('0x6'),auth['isAuthenticated'](),controller[_0x92c8('0xa')]);module[_0x92c8('0xb')]=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 2bdc5fb..c5b84d4 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 _0xebe3=['sequelize','exports','STRING','TEXT'];(function(_0x12064f,_0x27a851){var _0x36e5a0=function(_0xa23155){while(--_0xa23155){_0x12064f['push'](_0x12064f['shift']());}};_0x36e5a0(++_0x27a851);}(_0xebe3,0x1dc));var _0x3ebe=function(_0x3dbf2e,_0x58be9b){_0x3dbf2e=_0x3dbf2e-0x0;var _0x487a7b=_0xebe3[_0x3dbf2e];return _0x487a7b;};'use strict';var Sequelize=require(_0x3ebe('0x0'));module[_0x3ebe('0x1')]={'name':{'type':Sequelize[_0x3ebe('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x3ebe('0x2')]},'parent':{'type':Sequelize[_0x3ebe('0x2')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x3ebe('0x3')]}}; \ No newline at end of file +var _0xd736=['exports','STRING','TEXT'];(function(_0x6bc05,_0x1fbd06){var _0x451fb5=function(_0x2ba135){while(--_0x2ba135){_0x6bc05['push'](_0x6bc05['shift']());}};_0x451fb5(++_0x1fbd06);}(_0xd736,0x14a));var _0x6d73=function(_0x3a8d5d,_0x1e163c){_0x3a8d5d=_0x3a8d5d-0x0;var _0x1fc951=_0xd736[_0x3a8d5d];return _0x1fc951;};'use strict';var Sequelize=require('sequelize');module[_0x6d73('0x0')]={'name':{'type':Sequelize[_0x6d73('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x6d73('0x1')]},'conditions':{'type':Sequelize[_0x6d73('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index bee9d1a..336e1fe 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 _0xd44e=['QueryTypes','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','ROUND(%s)','IS\x20NULL','value','ValidationErrorItem','No\x20available\x20data','output','fullPath','%s-%s.%s','randomstring','generate','csv','custom','AnalyticExtractedReport','startDate','endDate','info','Run\x20Query:','../../files/reports','savename','select','run','runReport','html-pdf','rimraf','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','destroy','CustomReports','UserProfileResource','end','error','stack','name','send','index','AnalyticCustomReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','map','type','merge','options','includeAll','include','findAll','rows','show','params','find','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%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)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','%s.%s\x20=\x20%s.%s','foreignTable','conditions','clone','debug','Limited\x20Query:','toString','sequelize'];(function(_0x4b332a,_0x5ec2db){var _0x115a04=function(_0x422160){while(--_0x422160){_0x4b332a['push'](_0x4b332a['shift']());}};_0x115a04(++_0x5ec2db);}(_0xd44e,0xb9));var _0xed44=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd44e[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xed44('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xed44('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xed44('0x2'));var BPromise=require(_0xed44('0x3'));var Mustache=require(_0xed44('0x4'));var util=require(_0xed44('0x5'));var path=require(_0xed44('0x6'));var sox=require('sox');var csv=require(_0xed44('0x7'));var ejs=require(_0xed44('0x8'));var fs=require('fs');var _=require(_0xed44('0x9'));var squel=require(_0xed44('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xed44('0xb'));var toCsv=require(_0xed44('0x7'));var querystring=require(_0xed44('0xc'));var Papa=require(_0xed44('0xd'));var Redis=require(_0xed44('0xe'));var authService=require(_0xed44('0xf'));var qs=require(_0xed44('0x10'));var as=require(_0xed44('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xed44('0x12'))('api');var utils=require(_0xed44('0x13'));var config=require(_0xed44('0x14'));var db=require(_0xed44('0x15'))['db'];function respondWithStatusCode(_0x2ffdbf,_0x394aa0){_0x394aa0=_0x394aa0||0xcc;return function(_0x4562f8){if(_0x4562f8){return _0x2ffdbf[_0xed44('0x16')](_0x394aa0);}return _0x2ffdbf[_0xed44('0x17')](_0x394aa0)['end']();};}function respondWithResult(_0xac1b37,_0x389568){_0x389568=_0x389568||0xc8;return function(_0x1dd80c){if(_0x1dd80c){return _0xac1b37[_0xed44('0x17')](_0x389568)[_0xed44('0x18')](_0x1dd80c);}};}function respondWithFilteredResult(_0x366b9b,_0x4e07a6){return function(_0x4a8d56){if(_0x4a8d56){var _0x4cd993=_0x4a8d56[_0xed44('0x19')],_0x28cd62=_0x4e07a6[_0xed44('0x1a')],_0x3c47ba=_0x4e07a6[_0xed44('0x1a')]+_0x4e07a6['limit'],_0x19cd82;if(_0x3c47ba>=_0x4cd993){_0x3c47ba=_0x4cd993;_0x19cd82=0xc8;}else{_0x19cd82=0xce;}_0x366b9b[_0xed44('0x17')](_0x19cd82);return _0x366b9b[_0xed44('0x1b')]('Content-Range',_0x28cd62+'-'+_0x3c47ba+'/'+_0x4cd993)[_0xed44('0x18')](_0x4a8d56);}return null;};}function patchUpdates(_0xcf1525){return function(_0x2e6075){try{jsonpatch[_0xed44('0x1c')](_0x2e6075,_0xcf1525,!![]);}catch(_0x4b0889){return BPromise[_0xed44('0x1d')](_0x4b0889);}return _0x2e6075[_0xed44('0x1e')]();};}function saveUpdates(_0x203de8,_0x33992e){return function(_0x3ea5a3){if(_0x3ea5a3){return _0x3ea5a3[_0xed44('0x1f')](_0x203de8)[_0xed44('0x20')](function(_0x5a00de){return _0x5a00de;});}return null;};}function removeEntity(_0x3808d1,_0x11f86e){return function(_0x4db01f){if(_0x4db01f){return _0x4db01f[_0xed44('0x21')]()[_0xed44('0x20')](function(){var _0x2234bb=_0x4db01f['get']({'plain':!![]});var _0xe4238c=_0xed44('0x22');return db[_0xed44('0x23')]['destroy']({'where':{'type':_0xe4238c,'resourceId':_0x2234bb['id']}})[_0xed44('0x20')](function(){return _0x4db01f;});})['then'](function(){_0x3808d1[_0xed44('0x17')](0xcc)[_0xed44('0x24')]();});}};}function handleEntityNotFound(_0x3d5c5f,_0x5ec3bc){return function(_0x2a85d6){if(!_0x2a85d6){_0x3d5c5f['sendStatus'](0x194);}return _0x2a85d6;};}function handleError(_0x43fa6e,_0x34f712){_0x34f712=_0x34f712||0x1f4;return function(_0x541bce){logger[_0xed44('0x25')](_0x541bce[_0xed44('0x26')]);if(_0x541bce[_0xed44('0x27')]){delete _0x541bce[_0xed44('0x27')];}_0x43fa6e[_0xed44('0x17')](_0x34f712)[_0xed44('0x28')](_0x541bce);};}exports[_0xed44('0x29')]=function(_0x8288bc,_0x9ee3c0){var _0x14f27c={},_0x29b006={},_0x54ceeb={'count':0x0,'rows':[]};var _0x2bf8b7=_['map'](db[_0xed44('0x2a')][_0xed44('0x2b')],function(_0x73e760){return{'name':_0x73e760[_0xed44('0x2c')],'type':_0x73e760['type'][_0xed44('0x2d')]};});_0x29b006[_0xed44('0x2e')]=_['map'](_0x2bf8b7,_0xed44('0x27'));_0x29b006[_0xed44('0x2f')]=_[_0xed44('0x30')](_0x8288bc[_0xed44('0x2f')]);_0x29b006['filters']=_[_0xed44('0x31')](_0x29b006[_0xed44('0x2e')],_0x29b006[_0xed44('0x2f')]);_0x14f27c[_0xed44('0x32')]=_['intersection'](_0x29b006[_0xed44('0x2e')],qs[_0xed44('0x33')](_0x8288bc[_0xed44('0x2f')]['fields']));_0x14f27c[_0xed44('0x32')]=_0x14f27c[_0xed44('0x32')][_0xed44('0x34')]?_0x14f27c[_0xed44('0x32')]:_0x29b006[_0xed44('0x2e')];if(!_0x8288bc[_0xed44('0x2f')][_0xed44('0x35')](_0xed44('0x36'))){_0x14f27c[_0xed44('0x37')]=qs[_0xed44('0x37')](_0x8288bc['query'][_0xed44('0x37')]);_0x14f27c[_0xed44('0x1a')]=qs['offset'](_0x8288bc[_0xed44('0x2f')]['offset']);}_0x14f27c[_0xed44('0x38')]=qs[_0xed44('0x39')](_0x8288bc[_0xed44('0x2f')]['sort']);_0x14f27c[_0xed44('0x3a')]=qs[_0xed44('0x3b')](_[_0xed44('0x3c')](_0x8288bc[_0xed44('0x2f')],_0x29b006[_0xed44('0x3b')]));if(_0x8288bc[_0xed44('0x2f')][_0xed44('0x3d')]){_0x14f27c[_0xed44('0x3a')]=_['merge'](_0x14f27c[_0xed44('0x3a')],{'$or':_[_0xed44('0x3e')](_0x2bf8b7,function(_0x1fcff5){if(_0x1fcff5[_0xed44('0x3f')]!=='VIRTUAL'){var _0x4ee091={};_0x4ee091[_0x1fcff5[_0xed44('0x27')]]={'$like':'%'+_0x8288bc[_0xed44('0x2f')]['filter']+'%'};return _0x4ee091;}})});}_0x14f27c=_[_0xed44('0x40')]({},_0x14f27c,_0x8288bc[_0xed44('0x41')]);var _0x382a37={'where':_0x14f27c[_0xed44('0x3a')]};return db[_0xed44('0x2a')][_0xed44('0x19')](_0x382a37)[_0xed44('0x20')](function(_0x4834d7){_0x54ceeb[_0xed44('0x19')]=_0x4834d7;if(_0x8288bc[_0xed44('0x2f')][_0xed44('0x42')]){_0x14f27c[_0xed44('0x43')]=[{'all':!![]}];}return db[_0xed44('0x2a')][_0xed44('0x44')](_0x14f27c);})[_0xed44('0x20')](function(_0x16aa33){_0x54ceeb[_0xed44('0x45')]=_0x16aa33;return _0x54ceeb;})['then'](respondWithFilteredResult(_0x9ee3c0,_0x14f27c))['catch'](handleError(_0x9ee3c0,null));};exports[_0xed44('0x46')]=function(_0x5548d1,_0x3c2bf6){var _0x2e03db={'raw':![],'where':{'id':_0x5548d1[_0xed44('0x47')]['id']}},_0x3609cf={};_0x3609cf[_0xed44('0x2e')]=_[_0xed44('0x30')](db['AnalyticCustomReport'][_0xed44('0x2b')]);_0x3609cf[_0xed44('0x2f')]=_[_0xed44('0x30')](_0x5548d1[_0xed44('0x2f')]);_0x3609cf[_0xed44('0x3b')]=_[_0xed44('0x31')](_0x3609cf['model'],_0x3609cf['query']);_0x2e03db[_0xed44('0x32')]=_[_0xed44('0x31')](_0x3609cf[_0xed44('0x2e')],qs[_0xed44('0x33')](_0x5548d1[_0xed44('0x2f')][_0xed44('0x33')]));_0x2e03db['attributes']=_0x2e03db['attributes']['length']?_0x2e03db[_0xed44('0x32')]:_0x3609cf['model'];if(_0x5548d1['query']['includeAll']){_0x2e03db[_0xed44('0x43')]=[{'all':!![]}];}_0x2e03db=_[_0xed44('0x40')]({},_0x2e03db,_0x5548d1[_0xed44('0x41')]);return db[_0xed44('0x2a')][_0xed44('0x48')](_0x2e03db)[_0xed44('0x20')](handleEntityNotFound(_0x3c2bf6,null))[_0xed44('0x20')](respondWithResult(_0x3c2bf6,null))[_0xed44('0x49')](handleError(_0x3c2bf6,null));};exports['create']=function(_0x3c9007,_0x535e62){return db[_0xed44('0x2a')][_0xed44('0x4a')](_0x3c9007['body'],{})[_0xed44('0x20')](function(_0x43feb9){var _0x540672=_0x3c9007[_0xed44('0x4b')][_0xed44('0x4c')]({'plain':!![]});if(!_0x540672)throw new Error(_0xed44('0x4d'));if(_0x540672[_0xed44('0x4e')]===_0xed44('0x4b')){var _0xaeff23=_0x43feb9[_0xed44('0x4c')]({'plain':!![]});var _0x3bd928='Reports';return db['UserProfileSection'][_0xed44('0x48')]({'where':{'name':_0x3bd928,'userProfileId':_0x540672['userProfileId']},'raw':!![]})[_0xed44('0x20')](function(_0x5af1f7){if(_0x5af1f7&&_0x5af1f7['autoAssociation']===0x0){return db[_0xed44('0x23')][_0xed44('0x4a')]({'name':_0xaeff23[_0xed44('0x27')],'resourceId':_0xaeff23['id'],'type':'CustomReports','sectionId':_0x5af1f7['id']},{})['then'](function(){return _0x43feb9;});}else{return _0x43feb9;}})['catch'](function(_0x8dafa0){logger[_0xed44('0x25')](_0xed44('0x4f'),_0x8dafa0);throw _0x8dafa0;});}return _0x43feb9;})['then'](respondWithResult(_0x535e62,0xc9))[_0xed44('0x49')](handleError(_0x535e62,null));};exports['update']=function(_0x6ce37d,_0x1c9f11){if(_0x6ce37d['body']['id']){delete _0x6ce37d[_0xed44('0x50')]['id'];}return db[_0xed44('0x2a')]['find']({'where':{'id':_0x6ce37d[_0xed44('0x47')]['id']}})[_0xed44('0x20')](handleEntityNotFound(_0x1c9f11,null))[_0xed44('0x20')](saveUpdates(_0x6ce37d[_0xed44('0x50')],null))[_0xed44('0x20')](respondWithResult(_0x1c9f11,null))[_0xed44('0x49')](handleError(_0x1c9f11,null));};exports['destroy']=function(_0x27cfd0,_0x4e4927){return db[_0xed44('0x2a')][_0xed44('0x48')]({'where':{'id':_0x27cfd0[_0xed44('0x47')]['id']}})[_0xed44('0x20')](handleEntityNotFound(_0x4e4927,null))[_0xed44('0x20')](removeEntity(_0x4e4927,null))['catch'](handleError(_0x4e4927,null));};exports['preview']=function(_0x48279b,_0x16d533){var _0x4b9778=0xa;var _0x392046=[_0xed44('0x51'),_0xed44('0x52'),_0xed44('0x53'),_0xed44('0x54')];var _0x2af6ff={'SUM':_0xed44('0x55'),'COUNT':_0xed44('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xed44('0x57'),'AVG':_0xed44('0x58'),'GROUP_CONCAT':_0xed44('0x59'),'GROUP_CONCAT ASC':_0xed44('0x5a'),'GROUP_CONCAT DESC':_0xed44('0x5b')};var _0x401c35={'SEC_TO_TIME':_0xed44('0x5c'),'DATE':_0xed44('0x5d'),'HOUR':_0xed44('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xed44('0x5f')};var _0x1d208a=function(_0xfc47af){return!_[_0xed44('0x60')](['IS\x20NULL',_0xed44('0x61'),_0xed44('0x62'),_0xed44('0x63')],_0xfc47af);};var _0x16c9ce=function(_0x340eb3){if(!_0x340eb3||!_0x340eb3[_0xed44('0x64')]['length']){return'';}for(var _0x5d92b4='(',_0x3fadc5=0x0;_0x3fadc5<_0x340eb3[_0xed44('0x64')][_0xed44('0x34')];_0x3fadc5+=0x1){_0x3fadc5>0x0&&(_0x5d92b4+='\x20'+_0x340eb3[_0xed44('0x65')]+'\x20');_0x5d92b4+=_0x340eb3['rules'][_0x3fadc5][_0xed44('0x66')]?_0x16c9ce(_0x340eb3[_0xed44('0x64')][_0x3fadc5]['group']):_0x340eb3['rules'][_0x3fadc5][_0xed44('0x67')]+'\x20'+_0x340eb3[_0xed44('0x64')][_0x3fadc5][_0xed44('0x68')]+(_0x1d208a(_0x340eb3[_0xed44('0x64')][_0x3fadc5][_0xed44('0x68')])?'\x20'+_0x340eb3[_0xed44('0x64')][_0x3fadc5]['value']:'');}return _0x5d92b4+')';};var _0xafb2ca={'where':{'id':_0x48279b[_0xed44('0x47')]['id']}},_0x50cd9c,_0x292a94,_0x1bc19c,_0x5a2910,_0x7c0d08;_0xafb2ca=_[_0xed44('0x40')]({},_0xafb2ca,_0x48279b[_0xed44('0x41')]);return db['AnalyticCustomReport'][_0xed44('0x48')](_0xafb2ca)[_0xed44('0x20')](function(_0x11bfdb){if(_0x11bfdb){_0x50cd9c=_0x11bfdb;return _0x11bfdb[_0xed44('0x69')]();}return null;})['then'](function(_0x413f8d){if(_0x413f8d){if(!_0x413f8d[_0xed44('0x34')]){throw new db[(_0xed44('0x6a'))]['ValidationErrorItem'](_0xed44('0x6b'),0x193);}_0x292a94=_0x413f8d;return db[_0xed44('0x6c')][_0xed44('0x44')]({'raw':!![]});}return null;})[_0xed44('0x20')](function(_0x2a516a){if(_0x2a516a){_0x1bc19c=_[_0xed44('0x6d')](_0x2a516a,'id');var _0x5c1b53;var _0x231564=squel['select']();_0x231564[_0xed44('0x6e')](_0x50cd9c[_0xed44('0x6f')]);for(var _0x1d9560=0x0;_0x1d9560<_0x292a94['length'];_0x1d9560+=0x1){_0x5c1b53=_0x292a94[_0x1d9560][_0xed44('0x70')]?_0x1bc19c[_0x292a94[_0x1d9560]['MetricId']][_0xed44('0x71')]:_0x292a94[_0x1d9560][_0xed44('0x67')];_0x5c1b53=_0x292a94[_0x1d9560][_0xed44('0x72')]?_[_0xed44('0x73')](_0x2af6ff[_0x292a94[_0x1d9560][_0xed44('0x72')]],'%s',_0x5c1b53):_0x5c1b53;_0x5c1b53=_0x292a94[_0x1d9560][_0xed44('0x74')]?_[_0xed44('0x73')](_0x401c35[_0x292a94[_0x1d9560][_0xed44('0x74')]],'%s',_0x5c1b53):_0x5c1b53;if(_0x292a94[_0x1d9560][_0xed44('0x75')]){_0x231564['group'](_0x5c1b53);}_0x292a94[_0x1d9560][_0xed44('0x76')]&&_0x231564[_0xed44('0x38')](_0x5c1b53,_0x292a94[_0x1d9560][_0xed44('0x76')]===_0xed44('0x77')?![]:!![]);_0x231564[_0xed44('0x67')](_0x5c1b53,_0x292a94[_0x1d9560][_0xed44('0x78')]||_0x5c1b53);}if(_0x50cd9c['joins']){_0x50cd9c[_0xed44('0x79')]=JSON[_0xed44('0x7a')](_0x50cd9c[_0xed44('0x79')]);for(var _0x202b8d=0x0;_0x202b8d<_0x50cd9c[_0xed44('0x79')][_0xed44('0x34')];_0x202b8d+=0x1){if(_0x50cd9c['joins'][_0x202b8d][_0xed44('0x3f')]&&_[_0xed44('0x60')](_0x392046,_0x50cd9c[_0xed44('0x79')][_0x202b8d][_0xed44('0x3f')])&&_0x50cd9c['joins'][_0x202b8d][_0xed44('0x7b')]&&_0x50cd9c[_0xed44('0x79')][_0x202b8d]['foreignTable']&&_0x50cd9c[_0xed44('0x79')][_0x202b8d][_0xed44('0x7c')]){_0x231564[_0x50cd9c['joins'][_0x202b8d][_0xed44('0x3f')]](_0x50cd9c[_0xed44('0x79')][_0x202b8d]['foreignTable'],null,util[_0xed44('0x74')](_0xed44('0x7d'),_0x50cd9c[_0xed44('0x6f')],_0x50cd9c['joins'][_0x202b8d][_0xed44('0x7b')],_0x50cd9c[_0xed44('0x79')][_0x202b8d][_0xed44('0x7e')],_0x50cd9c[_0xed44('0x79')][_0x202b8d][_0xed44('0x7c')]));}}}if(_0x50cd9c[_0xed44('0x7f')]){_0x50cd9c[_0xed44('0x7f')]=JSON[_0xed44('0x7a')](_0x50cd9c['conditions']);_0x231564[_0xed44('0x3a')](_0x16c9ce(_0x50cd9c[_0xed44('0x7f')][_0xed44('0x66')]));}_0x7c0d08=_0x231564[_0xed44('0x80')]();_0x231564[_0xed44('0x37')](_0x4b9778);_0x231564['offset'](0x0);logger[_0xed44('0x81')](_0xed44('0x82'),_0x231564[_0xed44('0x83')]());return db['sequelize'][_0xed44('0x2f')](_0x231564[_0xed44('0x83')](),{'type':db[_0xed44('0x84')][_0xed44('0x85')][_0xed44('0x86')]});}})['then'](respondWithResult(_0x16d533,null))['catch'](handleError(_0x16d533,null));};function runReport(_0x56c7e2,_0x5d1c0f,_0x31342d){var _0x195919=_0x5d1c0f[_0xed44('0x27')];var _0x33647d=0xa;var _0x12ebf2=[_0xed44('0x51'),'left_join',_0xed44('0x53'),_0xed44('0x54')];var _0x53b964={'SUM':_0xed44('0x55'),'COUNT':_0xed44('0x56'),'COUNT DISTINCT':_0xed44('0x87'),'MAX':_0xed44('0x88'),'MIN':_0xed44('0x57'),'AVG':_0xed44('0x58'),'GROUP_CONCAT':_0xed44('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xed44('0x5b')};var _0x30346b={'SEC_TO_TIME':_0xed44('0x5c'),'DATE':_0xed44('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xed44('0x89'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x31868b=function(_0x4a68c1){return!_[_0xed44('0x60')]([_0xed44('0x8a'),_0xed44('0x61'),'IS\x20EMPTY',_0xed44('0x63')],_0x4a68c1);};var _0x136e42=function(_0x861571){if(!_0x861571||!_0x861571['rules']['length']){return'';}for(var _0x321080='(',_0x54ff4c=0x0;_0x54ff4c<_0x861571[_0xed44('0x64')][_0xed44('0x34')];_0x54ff4c+=0x1){_0x54ff4c>0x0&&(_0x321080+='\x20'+_0x861571[_0xed44('0x65')]+'\x20');_0x321080+=_0x861571[_0xed44('0x64')][_0x54ff4c][_0xed44('0x66')]?_0x136e42(_0x861571[_0xed44('0x64')][_0x54ff4c][_0xed44('0x66')]):_0x861571['rules'][_0x54ff4c][_0xed44('0x67')]+'\x20'+_0x861571[_0xed44('0x64')][_0x54ff4c][_0xed44('0x68')]+(_0x31868b(_0x861571[_0xed44('0x64')][_0x54ff4c][_0xed44('0x68')])?'\x20'+_0x861571[_0xed44('0x64')][_0x54ff4c][_0xed44('0x8b')]:'');}return _0x321080+')';};var _0x357b2e={'where':{'id':_0x56c7e2['id']}},_0x38a81a,_0x28d443,_0x3c2d9e,_0x416a19,_0x1d0327;_0x357b2e=_['merge']({},_0x357b2e,_0x31342d);return db[_0xed44('0x2a')]['find'](_0x357b2e)[_0xed44('0x20')](function(_0x2d8010){if(_0x2d8010){_0x38a81a=_0x2d8010;return _0x2d8010[_0xed44('0x69')]();}return null;})['then'](function(_0x54b2a0){if(_0x54b2a0){if(!_0x54b2a0[_0xed44('0x34')]){throw new db[(_0xed44('0x6a'))]['ValidationErrorItem'](_0xed44('0x6b'),0x193);}_0x28d443=_0x54b2a0;return db[_0xed44('0x6c')][_0xed44('0x44')]({'raw':!![]});}return null;})[_0xed44('0x20')](function(_0x3ef36b){if(_0x3ef36b){_0x3c2d9e=_[_0xed44('0x6d')](_0x3ef36b,'id');var _0x177d5c;var _0x3b3ec2=squel['select']();_0x3b3ec2['from'](_0x38a81a[_0xed44('0x6f')]);for(var _0x1e22a7=0x0;_0x1e22a7<_0x28d443[_0xed44('0x34')];_0x1e22a7+=0x1){_0x177d5c=_0x28d443[_0x1e22a7][_0xed44('0x70')]?_0x3c2d9e[_0x28d443[_0x1e22a7][_0xed44('0x70')]][_0xed44('0x71')]:_0x28d443[_0x1e22a7][_0xed44('0x67')];_0x177d5c=_0x28d443[_0x1e22a7][_0xed44('0x72')]?_['replace'](_0x53b964[_0x28d443[_0x1e22a7][_0xed44('0x72')]],'%s',_0x177d5c):_0x177d5c;_0x177d5c=_0x28d443[_0x1e22a7][_0xed44('0x74')]?_[_0xed44('0x73')](_0x30346b[_0x28d443[_0x1e22a7]['format']],'%s',_0x177d5c):_0x177d5c;if(_0x28d443[_0x1e22a7]['groupBy']){_0x3b3ec2[_0xed44('0x66')](_0x177d5c);}_0x28d443[_0x1e22a7][_0xed44('0x76')]&&_0x3b3ec2['order'](_0x177d5c,_0x28d443[_0x1e22a7][_0xed44('0x76')]===_0xed44('0x77')?![]:!![]);_0x3b3ec2[_0xed44('0x67')](_0x177d5c,_0x28d443[_0x1e22a7][_0xed44('0x78')]||_0x177d5c);}if(_0x38a81a['joins']){_0x38a81a['joins']=JSON['parse'](_0x38a81a[_0xed44('0x79')]);for(var _0x3bc25e=0x0;_0x3bc25e<_0x38a81a[_0xed44('0x79')][_0xed44('0x34')];_0x3bc25e+=0x1){if(_0x38a81a['joins'][_0x3bc25e][_0xed44('0x3f')]&&_[_0xed44('0x60')](_0x12ebf2,_0x38a81a[_0xed44('0x79')][_0x3bc25e][_0xed44('0x3f')])&&_0x38a81a['joins'][_0x3bc25e][_0xed44('0x7b')]&&_0x38a81a[_0xed44('0x79')][_0x3bc25e][_0xed44('0x7e')]&&_0x38a81a[_0xed44('0x79')][_0x3bc25e][_0xed44('0x7c')]){_0x3b3ec2[_0x38a81a[_0xed44('0x79')][_0x3bc25e]['type']](_0x38a81a[_0xed44('0x79')][_0x3bc25e][_0xed44('0x7e')],null,util['format'](_0xed44('0x7d'),_0x38a81a[_0xed44('0x6f')],_0x38a81a[_0xed44('0x79')][_0x3bc25e]['parentKey'],_0x38a81a['joins'][_0x3bc25e][_0xed44('0x7e')],_0x38a81a[_0xed44('0x79')][_0x3bc25e][_0xed44('0x7c')]));}}}if(_0x38a81a[_0xed44('0x7f')]){_0x38a81a[_0xed44('0x7f')]=JSON[_0xed44('0x7a')](_0x38a81a[_0xed44('0x7f')]);_0x3b3ec2[_0xed44('0x3a')](_0x136e42(_0x38a81a[_0xed44('0x7f')]['group']));}_0x1d0327=_0x3b3ec2[_0xed44('0x80')]();_0x3b3ec2[_0xed44('0x37')](_0x33647d);_0x3b3ec2[_0xed44('0x1a')](0x0);logger[_0xed44('0x81')](_0xed44('0x82'),_0x3b3ec2[_0xed44('0x83')]());return db[_0xed44('0x84')]['query'](_0x3b3ec2[_0xed44('0x83')](),{'type':db['sequelize'][_0xed44('0x85')][_0xed44('0x86')]});}})['then'](function(_0x38084d){if(!_0x38084d[_0xed44('0x34')]){throw new db[(_0xed44('0x6a'))][(_0xed44('0x8c'))](_0xed44('0x8d'),0xcc);}if(_0x5d1c0f[_0xed44('0x8e')]==='web'){return null;}var _0x1da98e=_[_0xed44('0x40')](_0x5d1c0f,{'name':_0x5d1c0f[_0xed44('0x8f')]||_0x5d1c0f[_0xed44('0x27')]||_0x38a81a[_0xed44('0x27')],'basename':_0x195919,'savename':util['format'](_0xed44('0x90'),_0x5d1c0f[_0xed44('0x27')]||_0x38a81a[_0xed44('0x27')],require(_0xed44('0x91'))[_0xed44('0x92')](0x4),_0x5d1c0f[_0xed44('0x8e')]||_0xed44('0x93')),'reportId':_0x38a81a['id'],'reportType':_0xed44('0x94')});return db[_0xed44('0x95')]['create'](_0x1da98e,{'raw':!![]});})[_0xed44('0x20')](function(_0x5785fe){if(_0x38a81a['table']==='cdr'){_0x1d0327['where'](_0x38a81a[_0xed44('0x6f')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5d1c0f[_0xed44('0x96')],_0x5d1c0f[_0xed44('0x97')]);}else{_0x1d0327['where'](_0x38a81a['table']+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x5d1c0f['startDate'],_0x5d1c0f['endDate']);}if(_0x5785fe){logger[_0xed44('0x98')](_0xed44('0x99'),_0x1d0327[_0xed44('0x83')]());require('child_process')['fork'](path[_0xed44('0x51')](__dirname,'../../components/export/',_0x5785fe[_0xed44('0x8e')]),[_0x5785fe['id'],_0x1d0327['toString'](),path[_0xed44('0x51')](__dirname,_0xed44('0x9a'),_0x5785fe[_0xed44('0x9b')]),_0x195919]);return _0x5785fe;}else{var _0x377feb=squel[_0xed44('0x9c')]();_0x377feb[_0xed44('0x6e')]('('+_0x1d0327[_0xed44('0x83')]()+')','countTable');_0x377feb[_0xed44('0x67')]('COUNT(*)',_0xed44('0x19'));_0x1d0327[_0xed44('0x37')](_0x5d1c0f[_0xed44('0x37')]||_0x33647d);_0x1d0327['offset'](_0x5d1c0f[_0xed44('0x1a')]||0x0);return db[_0xed44('0x84')][_0xed44('0x2f')](_0x377feb[_0xed44('0x83')](),{'type':db['sequelize'][_0xed44('0x85')][_0xed44('0x86')]})['then'](function(_0x2c51d9){if(!_0x2c51d9['length']){_0x416a19=0x0;}else{_0x416a19=_0x2c51d9[0x0][_0xed44('0x19')]||0x0;}return db[_0xed44('0x84')][_0xed44('0x2f')](_0x1d0327['toString'](),{'type':db[_0xed44('0x84')][_0xed44('0x85')]['SELECT']});})['then'](function(_0xa8fc3b){return{'rows':_0xa8fc3b||[],'count':_0x416a19};});}});}exports[_0xed44('0x9d')]=function(_0x5a8c53,_0x345639){return runReport(_0x5a8c53['params'],_0x5a8c53[_0xed44('0x2f')],_0x5a8c53[_0xed44('0x41')])['then'](respondWithResult(_0x345639,null))[_0xed44('0x49')](handleError(_0x345639,null));};exports[_0xed44('0x9e')]=runReport;exports['query']=function(_0x455e5f,_0x29f32d){var _0x54ceef=0xa;var _0x4df605=[_0xed44('0x51'),_0xed44('0x52'),_0xed44('0x53'),_0xed44('0x54')];var _0x442c98={'SUM':_0xed44('0x55'),'COUNT':_0xed44('0x56'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0xed44('0x88'),'MIN':_0xed44('0x57'),'AVG':_0xed44('0x58'),'GROUP_CONCAT':_0xed44('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xed44('0x5b')};var _0x3b3b15={'SEC_TO_TIME':_0xed44('0x5c'),'DATE':_0xed44('0x5d'),'HOUR':'HOUR(%s)','ROUND':_0xed44('0x89'),'UNIX_TIMESTAMP':_0xed44('0x5f')};var _0x500729=function(_0x1b2688){return!_['includes']([_0xed44('0x8a'),_0xed44('0x61'),_0xed44('0x62'),_0xed44('0x63')],_0x1b2688);};var _0x27bca4=function(_0x529c30){if(!_0x529c30||!_0x529c30[_0xed44('0x64')][_0xed44('0x34')]){return'';}for(var _0x853a2f='(',_0xf6adfe=0x0;_0xf6adfe<_0x529c30[_0xed44('0x64')]['length'];_0xf6adfe+=0x1){_0xf6adfe>0x0&&(_0x853a2f+='\x20'+_0x529c30['operator']+'\x20');_0x853a2f+=_0x529c30[_0xed44('0x64')][_0xf6adfe][_0xed44('0x66')]?_0x27bca4(_0x529c30[_0xed44('0x64')][_0xf6adfe][_0xed44('0x66')]):_0x529c30['rules'][_0xf6adfe][_0xed44('0x67')]+'\x20'+_0x529c30[_0xed44('0x64')][_0xf6adfe]['condition']+(_0x500729(_0x529c30[_0xed44('0x64')][_0xf6adfe]['condition'])?'\x20'+_0x529c30[_0xed44('0x64')][_0xf6adfe]['value']:'');}return _0x853a2f+')';};var _0x554594={'where':{'id':_0x455e5f[_0xed44('0x47')]['id']}},_0x299f12,_0x4c2ac7,_0x170a70,_0x2a37b8,_0xf73763;_0x554594=_['merge']({},_0x554594,_0x455e5f[_0xed44('0x41')]);return db[_0xed44('0x2a')][_0xed44('0x48')](_0x554594)[_0xed44('0x20')](function(_0x5baffe){if(_0x5baffe){_0x299f12=_0x5baffe;return _0x5baffe[_0xed44('0x69')]();}return null;})['then'](function(_0xbe06d5){if(_0xbe06d5){if(!_0xbe06d5[_0xed44('0x34')]){throw new db[(_0xed44('0x6a'))][(_0xed44('0x8c'))](_0xed44('0x6b'),0x193);}_0x4c2ac7=_0xbe06d5;return db[_0xed44('0x6c')][_0xed44('0x44')]({'raw':!![]});}return null;})[_0xed44('0x20')](function(_0x586e40){if(_0x586e40){_0x170a70=_['keyBy'](_0x586e40,'id');var _0x3f9f79;var _0x141274=squel[_0xed44('0x9c')]();_0x141274[_0xed44('0x6e')](_0x299f12[_0xed44('0x6f')]);for(var _0x1de0e6=0x0;_0x1de0e6<_0x4c2ac7['length'];_0x1de0e6+=0x1){_0x3f9f79=_0x4c2ac7[_0x1de0e6][_0xed44('0x70')]?_0x170a70[_0x4c2ac7[_0x1de0e6][_0xed44('0x70')]][_0xed44('0x71')]:_0x4c2ac7[_0x1de0e6][_0xed44('0x67')];_0x3f9f79=_0x4c2ac7[_0x1de0e6][_0xed44('0x72')]?_[_0xed44('0x73')](_0x442c98[_0x4c2ac7[_0x1de0e6][_0xed44('0x72')]],'%s',_0x3f9f79):_0x3f9f79;_0x3f9f79=_0x4c2ac7[_0x1de0e6][_0xed44('0x74')]?_[_0xed44('0x73')](_0x3b3b15[_0x4c2ac7[_0x1de0e6][_0xed44('0x74')]],'%s',_0x3f9f79):_0x3f9f79;if(_0x4c2ac7[_0x1de0e6][_0xed44('0x75')]){_0x141274[_0xed44('0x66')](_0x3f9f79);}_0x4c2ac7[_0x1de0e6][_0xed44('0x76')]&&_0x141274[_0xed44('0x38')](_0x3f9f79,_0x4c2ac7[_0x1de0e6][_0xed44('0x76')]===_0xed44('0x77')?![]:!![]);_0x141274[_0xed44('0x67')](_0x3f9f79,_0x4c2ac7[_0x1de0e6][_0xed44('0x78')]||_0x3f9f79);}if(_0x299f12[_0xed44('0x79')]){_0x299f12[_0xed44('0x79')]=JSON[_0xed44('0x7a')](_0x299f12[_0xed44('0x79')]);for(var _0x35411f=0x0;_0x35411f<_0x299f12['joins'][_0xed44('0x34')];_0x35411f+=0x1){if(_0x299f12['joins'][_0x35411f][_0xed44('0x3f')]&&_['includes'](_0x4df605,_0x299f12[_0xed44('0x79')][_0x35411f][_0xed44('0x3f')])&&_0x299f12[_0xed44('0x79')][_0x35411f]['parentKey']&&_0x299f12[_0xed44('0x79')][_0x35411f][_0xed44('0x7e')]&&_0x299f12[_0xed44('0x79')][_0x35411f][_0xed44('0x7c')]){_0x141274[_0x299f12['joins'][_0x35411f]['type']](_0x299f12['joins'][_0x35411f][_0xed44('0x7e')],null,util[_0xed44('0x74')](_0xed44('0x7d'),_0x299f12[_0xed44('0x6f')],_0x299f12['joins'][_0x35411f][_0xed44('0x7b')],_0x299f12[_0xed44('0x79')][_0x35411f][_0xed44('0x7e')],_0x299f12['joins'][_0x35411f][_0xed44('0x7c')]));}}}if(_0x299f12[_0xed44('0x7f')]){_0x299f12[_0xed44('0x7f')]=JSON['parse'](_0x299f12[_0xed44('0x7f')]);_0x141274['where'](_0x27bca4(_0x299f12[_0xed44('0x7f')]['group']));}_0xf73763=_0x141274[_0xed44('0x80')]();_0x141274[_0xed44('0x37')](_0x54ceef);_0x141274['offset'](0x0);logger[_0xed44('0x81')](_0xed44('0x82'),_0x141274[_0xed44('0x83')]());return db['sequelize'][_0xed44('0x2f')](_0x141274['toString'](),{'type':db[_0xed44('0x84')][_0xed44('0x85')][_0xed44('0x86')]});}})[_0xed44('0x20')](function(){return{'sql':_0xf73763['toString']()};})['then'](respondWithResult(_0x29f32d,null))['catch'](handleError(_0x29f32d,null));}; \ No newline at end of file +var _0x9ebc=['where','merge','options','includeAll','include','findAll','rows','catch','keys','length','find','create','body','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','CustomReports','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','from','MetricId','metric','function','format','replace','group','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','table','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','join','MIN(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','UNIX_TIMESTAMP(%s)','operator','groupBy','%s.%s\x20=\x20%s.%s','debug','No\x20available\x20data','web','%s-%s.%s','generate','output','csv','custom','AnalyticExtractedReport','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','SELECT','run','runReport','COUNT(%s)','IS\x20NULL','IS\x20EMPTY','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','end','json','count','status','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','stack','name','map','AnalyticCustomReport','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','limit','offset','order','sort'];(function(_0x4710df,_0x3455a5){var _0x3c1be8=function(_0x55d22e){while(--_0x55d22e){_0x4710df['push'](_0x4710df['shift']());}};_0x3c1be8(++_0x3455a5);}(_0x9ebc,0x1a2));var _0xc9eb=function(_0x175729,_0x5f533){_0x175729=_0x175729-0x0;var _0x4c209e=_0x9ebc[_0x175729];return _0x4c209e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc9eb('0x0'));var rimraf=require(_0xc9eb('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc9eb('0x2'));var rp=require(_0xc9eb('0x3'));var moment=require(_0xc9eb('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xc9eb('0x5'));var util=require(_0xc9eb('0x6'));var path=require('path');var sox=require(_0xc9eb('0x7'));var csv=require(_0xc9eb('0x8'));var ejs=require(_0xc9eb('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc9eb('0xa'));var crypto=require(_0xc9eb('0xb'));var jsforce=require(_0xc9eb('0xc'));var deskjs=require(_0xc9eb('0xd'));var toCsv=require(_0xc9eb('0x8'));var querystring=require(_0xc9eb('0xe'));var Papa=require(_0xc9eb('0xf'));var Redis=require(_0xc9eb('0x10'));var authService=require(_0xc9eb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc9eb('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc9eb('0x13'));var utils=require(_0xc9eb('0x14'));var config=require('../../config/environment');var db=require(_0xc9eb('0x15'))['db'];function respondWithStatusCode(_0x350a37,_0x57aea3){_0x57aea3=_0x57aea3||0xcc;return function(_0x4c2b71){if(_0x4c2b71){return _0x350a37['sendStatus'](_0x57aea3);}return _0x350a37['status'](_0x57aea3)[_0xc9eb('0x16')]();};}function respondWithResult(_0x4584f1,_0x57ea3e){_0x57ea3e=_0x57ea3e||0xc8;return function(_0x50b6fa){if(_0x50b6fa){return _0x4584f1['status'](_0x57ea3e)[_0xc9eb('0x17')](_0x50b6fa);}};}function respondWithFilteredResult(_0x2ee12b,_0x5d770e){return function(_0xdce57d){if(_0xdce57d){var _0xf2ebf2=_0xdce57d[_0xc9eb('0x18')],_0x18c009=_0x5d770e['offset'],_0x48fa79=_0x5d770e['offset']+_0x5d770e['limit'],_0x1bcc34;if(_0x48fa79>=_0xf2ebf2){_0x48fa79=_0xf2ebf2;_0x1bcc34=0xc8;}else{_0x1bcc34=0xce;}_0x2ee12b[_0xc9eb('0x19')](_0x1bcc34);return _0x2ee12b[_0xc9eb('0x1a')](_0xc9eb('0x1b'),_0x18c009+'-'+_0x48fa79+'/'+_0xf2ebf2)[_0xc9eb('0x17')](_0xdce57d);}return null;};}function patchUpdates(_0x2f3563){return function(_0x4d2086){try{jsonpatch[_0xc9eb('0x1c')](_0x4d2086,_0x2f3563,!![]);}catch(_0x111f01){return BPromise[_0xc9eb('0x1d')](_0x111f01);}return _0x4d2086['save']();};}function saveUpdates(_0x4af352,_0x30ff70){return function(_0x555b47){if(_0x555b47){return _0x555b47[_0xc9eb('0x1e')](_0x4af352)[_0xc9eb('0x1f')](function(_0x29a24d){return _0x29a24d;});}return null;};}function removeEntity(_0x51cbf4,_0x43cf23){return function(_0x7e5f9d){if(_0x7e5f9d){return _0x7e5f9d[_0xc9eb('0x20')]()[_0xc9eb('0x1f')](function(){var _0x20e216=_0x7e5f9d[_0xc9eb('0x21')]({'plain':!![]});var _0x49b38e='CustomReports';return db[_0xc9eb('0x22')][_0xc9eb('0x20')]({'where':{'type':_0x49b38e,'resourceId':_0x20e216['id']}})[_0xc9eb('0x1f')](function(){return _0x7e5f9d;});})['then'](function(){_0x51cbf4[_0xc9eb('0x19')](0xcc)[_0xc9eb('0x16')]();});}};}function handleEntityNotFound(_0x461c7c,_0x4b316c){return function(_0x351dc9){if(!_0x351dc9){_0x461c7c['sendStatus'](0x194);}return _0x351dc9;};}function handleError(_0x45f79f,_0xf9c6a8){_0xf9c6a8=_0xf9c6a8||0x1f4;return function(_0x3d1e14){logger['error'](_0x3d1e14[_0xc9eb('0x23')]);if(_0x3d1e14[_0xc9eb('0x24')]){delete _0x3d1e14[_0xc9eb('0x24')];}_0x45f79f[_0xc9eb('0x19')](_0xf9c6a8)['send'](_0x3d1e14);};}exports['index']=function(_0x1b09cb,_0x584d7c){var _0x3516d6={},_0x153652={},_0x2c0145={'count':0x0,'rows':[]};var _0xedd610=_[_0xc9eb('0x25')](db[_0xc9eb('0x26')]['rawAttributes'],function(_0x249efb){return{'name':_0x249efb[_0xc9eb('0x27')],'type':_0x249efb[_0xc9eb('0x28')][_0xc9eb('0x29')]};});_0x153652[_0xc9eb('0x2a')]=_[_0xc9eb('0x25')](_0xedd610,_0xc9eb('0x24'));_0x153652[_0xc9eb('0x2b')]=_['keys'](_0x1b09cb['query']);_0x153652[_0xc9eb('0x2c')]=_[_0xc9eb('0x2d')](_0x153652['model'],_0x153652['query']);_0x3516d6['attributes']=_['intersection'](_0x153652[_0xc9eb('0x2a')],qs['fields'](_0x1b09cb[_0xc9eb('0x2b')][_0xc9eb('0x2e')]));_0x3516d6[_0xc9eb('0x2f')]=_0x3516d6[_0xc9eb('0x2f')]['length']?_0x3516d6[_0xc9eb('0x2f')]:_0x153652[_0xc9eb('0x2a')];if(!_0x1b09cb[_0xc9eb('0x2b')][_0xc9eb('0x30')]('nolimit')){_0x3516d6['limit']=qs[_0xc9eb('0x31')](_0x1b09cb['query']['limit']);_0x3516d6['offset']=qs[_0xc9eb('0x32')](_0x1b09cb['query'][_0xc9eb('0x32')]);}_0x3516d6[_0xc9eb('0x33')]=qs[_0xc9eb('0x34')](_0x1b09cb[_0xc9eb('0x2b')][_0xc9eb('0x34')]);_0x3516d6['where']=qs[_0xc9eb('0x2c')](_['pick'](_0x1b09cb['query'],_0x153652['filters']));if(_0x1b09cb[_0xc9eb('0x2b')]['filter']){_0x3516d6[_0xc9eb('0x35')]=_['merge'](_0x3516d6[_0xc9eb('0x35')],{'$or':_[_0xc9eb('0x25')](_0xedd610,function(_0x5ea59c){if(_0x5ea59c['type']!=='VIRTUAL'){var _0x2821aa={};_0x2821aa[_0x5ea59c[_0xc9eb('0x24')]]={'$like':'%'+_0x1b09cb[_0xc9eb('0x2b')]['filter']+'%'};return _0x2821aa;}})});}_0x3516d6=_[_0xc9eb('0x36')]({},_0x3516d6,_0x1b09cb[_0xc9eb('0x37')]);var _0x4e359d={'where':_0x3516d6[_0xc9eb('0x35')]};return db[_0xc9eb('0x26')][_0xc9eb('0x18')](_0x4e359d)[_0xc9eb('0x1f')](function(_0x4baf82){_0x2c0145[_0xc9eb('0x18')]=_0x4baf82;if(_0x1b09cb['query'][_0xc9eb('0x38')]){_0x3516d6[_0xc9eb('0x39')]=[{'all':!![]}];}return db[_0xc9eb('0x26')][_0xc9eb('0x3a')](_0x3516d6);})['then'](function(_0x566f31){_0x2c0145[_0xc9eb('0x3b')]=_0x566f31;return _0x2c0145;})[_0xc9eb('0x1f')](respondWithFilteredResult(_0x584d7c,_0x3516d6))[_0xc9eb('0x3c')](handleError(_0x584d7c,null));};exports['show']=function(_0xba5413,_0x40898e){var _0x3be456={'raw':![],'where':{'id':_0xba5413['params']['id']}},_0x4be12a={};_0x4be12a[_0xc9eb('0x2a')]=_[_0xc9eb('0x3d')](db[_0xc9eb('0x26')]['rawAttributes']);_0x4be12a[_0xc9eb('0x2b')]=_[_0xc9eb('0x3d')](_0xba5413['query']);_0x4be12a[_0xc9eb('0x2c')]=_['intersection'](_0x4be12a[_0xc9eb('0x2a')],_0x4be12a[_0xc9eb('0x2b')]);_0x3be456[_0xc9eb('0x2f')]=_[_0xc9eb('0x2d')](_0x4be12a[_0xc9eb('0x2a')],qs[_0xc9eb('0x2e')](_0xba5413[_0xc9eb('0x2b')][_0xc9eb('0x2e')]));_0x3be456[_0xc9eb('0x2f')]=_0x3be456[_0xc9eb('0x2f')][_0xc9eb('0x3e')]?_0x3be456[_0xc9eb('0x2f')]:_0x4be12a['model'];if(_0xba5413[_0xc9eb('0x2b')][_0xc9eb('0x38')]){_0x3be456[_0xc9eb('0x39')]=[{'all':!![]}];}_0x3be456=_[_0xc9eb('0x36')]({},_0x3be456,_0xba5413[_0xc9eb('0x37')]);return db[_0xc9eb('0x26')][_0xc9eb('0x3f')](_0x3be456)[_0xc9eb('0x1f')](handleEntityNotFound(_0x40898e,null))['then'](respondWithResult(_0x40898e,null))['catch'](handleError(_0x40898e,null));};exports[_0xc9eb('0x40')]=function(_0x4c947d,_0x5ac44b){return db[_0xc9eb('0x26')][_0xc9eb('0x40')](_0x4c947d[_0xc9eb('0x41')],{})['then'](function(_0x3cd00a){var _0x449b69=_0x4c947d['user']['get']({'plain':!![]});if(!_0x449b69)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x449b69[_0xc9eb('0x42')]===_0xc9eb('0x43')){var _0x4caf5e=_0x3cd00a[_0xc9eb('0x21')]({'plain':!![]});var _0x243925=_0xc9eb('0x44');return db[_0xc9eb('0x45')]['find']({'where':{'name':_0x243925,'userProfileId':_0x449b69[_0xc9eb('0x46')]},'raw':!![]})[_0xc9eb('0x1f')](function(_0x52d1f3){if(_0x52d1f3&&_0x52d1f3[_0xc9eb('0x47')]===0x0){return db['UserProfileResource'][_0xc9eb('0x40')]({'name':_0x4caf5e[_0xc9eb('0x24')],'resourceId':_0x4caf5e['id'],'type':_0xc9eb('0x48'),'sectionId':_0x52d1f3['id']},{})[_0xc9eb('0x1f')](function(){return _0x3cd00a;});}else{return _0x3cd00a;}})['catch'](function(_0x5719b8){logger[_0xc9eb('0x49')](_0xc9eb('0x4a'),_0x5719b8);throw _0x5719b8;});}return _0x3cd00a;})[_0xc9eb('0x1f')](respondWithResult(_0x5ac44b,0xc9))['catch'](handleError(_0x5ac44b,null));};exports[_0xc9eb('0x1e')]=function(_0x4978c4,_0x3c3fb9){if(_0x4978c4[_0xc9eb('0x41')]['id']){delete _0x4978c4[_0xc9eb('0x41')]['id'];}return db['AnalyticCustomReport'][_0xc9eb('0x3f')]({'where':{'id':_0x4978c4[_0xc9eb('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3c3fb9,null))[_0xc9eb('0x1f')](saveUpdates(_0x4978c4[_0xc9eb('0x41')],null))[_0xc9eb('0x1f')](respondWithResult(_0x3c3fb9,null))[_0xc9eb('0x3c')](handleError(_0x3c3fb9,null));};exports['destroy']=function(_0x2847f9,_0xab22bd){return db['AnalyticCustomReport']['find']({'where':{'id':_0x2847f9[_0xc9eb('0x4b')]['id']}})[_0xc9eb('0x1f')](handleEntityNotFound(_0xab22bd,null))[_0xc9eb('0x1f')](removeEntity(_0xab22bd,null))[_0xc9eb('0x3c')](handleError(_0xab22bd,null));};exports[_0xc9eb('0x4c')]=function(_0x5c6ade,_0xfb65a4){var _0x1d8dec=0xa;var _0x3dabb5=['join',_0xc9eb('0x4d'),_0xc9eb('0x4e'),_0xc9eb('0x4f')];var _0x28899a={'SUM':_0xc9eb('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc9eb('0x51'),'MAX':_0xc9eb('0x52'),'MIN':'MIN(%s)','AVG':_0xc9eb('0x53'),'GROUP_CONCAT':_0xc9eb('0x54'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xc9eb('0x55')};var _0x14ce0c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc9eb('0x56'),'HOUR':_0xc9eb('0x57'),'ROUND':_0xc9eb('0x58'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x1e7c7d=function(_0x2205f6){return!_[_0xc9eb('0x59')](['IS\x20NULL',_0xc9eb('0x5a'),'IS\x20EMPTY',_0xc9eb('0x5b')],_0x2205f6);};var _0xc55f02=function(_0x220828){if(!_0x220828||!_0x220828[_0xc9eb('0x5c')][_0xc9eb('0x3e')]){return'';}for(var _0x1e1a62='(',_0x3d0f08=0x0;_0x3d0f08<_0x220828[_0xc9eb('0x5c')][_0xc9eb('0x3e')];_0x3d0f08+=0x1){_0x3d0f08>0x0&&(_0x1e1a62+='\x20'+_0x220828['operator']+'\x20');_0x1e1a62+=_0x220828[_0xc9eb('0x5c')][_0x3d0f08]['group']?_0xc55f02(_0x220828['rules'][_0x3d0f08]['group']):_0x220828[_0xc9eb('0x5c')][_0x3d0f08][_0xc9eb('0x5d')]+'\x20'+_0x220828[_0xc9eb('0x5c')][_0x3d0f08]['condition']+(_0x1e7c7d(_0x220828[_0xc9eb('0x5c')][_0x3d0f08][_0xc9eb('0x5e')])?'\x20'+_0x220828[_0xc9eb('0x5c')][_0x3d0f08][_0xc9eb('0x5f')]:'');}return _0x1e1a62+')';};var _0x27dd80={'where':{'id':_0x5c6ade[_0xc9eb('0x4b')]['id']}},_0xc2ff78,_0x329871,_0x3a9e17,_0x448830,_0x69464f;_0x27dd80=_[_0xc9eb('0x36')]({},_0x27dd80,_0x5c6ade[_0xc9eb('0x37')]);return db[_0xc9eb('0x26')][_0xc9eb('0x3f')](_0x27dd80)[_0xc9eb('0x1f')](function(_0xd61e06){if(_0xd61e06){_0xc2ff78=_0xd61e06;return _0xd61e06[_0xc9eb('0x60')]();}return null;})[_0xc9eb('0x1f')](function(_0x5c14a1){if(_0x5c14a1){if(!_0x5c14a1[_0xc9eb('0x3e')]){throw new db[(_0xc9eb('0x61'))][(_0xc9eb('0x62'))](_0xc9eb('0x63'),0x193);}_0x329871=_0x5c14a1;return db[_0xc9eb('0x64')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x4a3187){if(_0x4a3187){_0x3a9e17=_[_0xc9eb('0x65')](_0x4a3187,'id');var _0x5a6d8b;var _0x57267f=squel[_0xc9eb('0x66')]();_0x57267f[_0xc9eb('0x67')](_0xc2ff78['table']);for(var _0xbe8e0f=0x0;_0xbe8e0f<_0x329871[_0xc9eb('0x3e')];_0xbe8e0f+=0x1){_0x5a6d8b=_0x329871[_0xbe8e0f][_0xc9eb('0x68')]?_0x3a9e17[_0x329871[_0xbe8e0f][_0xc9eb('0x68')]][_0xc9eb('0x69')]:_0x329871[_0xbe8e0f][_0xc9eb('0x5d')];_0x5a6d8b=_0x329871[_0xbe8e0f][_0xc9eb('0x6a')]?_['replace'](_0x28899a[_0x329871[_0xbe8e0f][_0xc9eb('0x6a')]],'%s',_0x5a6d8b):_0x5a6d8b;_0x5a6d8b=_0x329871[_0xbe8e0f][_0xc9eb('0x6b')]?_[_0xc9eb('0x6c')](_0x14ce0c[_0x329871[_0xbe8e0f][_0xc9eb('0x6b')]],'%s',_0x5a6d8b):_0x5a6d8b;if(_0x329871[_0xbe8e0f]['groupBy']){_0x57267f[_0xc9eb('0x6d')](_0x5a6d8b);}_0x329871[_0xbe8e0f][_0xc9eb('0x6e')]&&_0x57267f[_0xc9eb('0x33')](_0x5a6d8b,_0x329871[_0xbe8e0f][_0xc9eb('0x6e')]===_0xc9eb('0x6f')?![]:!![]);_0x57267f['field'](_0x5a6d8b,_0x329871[_0xbe8e0f][_0xc9eb('0x70')]||_0x5a6d8b);}if(_0xc2ff78[_0xc9eb('0x71')]){_0xc2ff78['joins']=JSON[_0xc9eb('0x72')](_0xc2ff78[_0xc9eb('0x71')]);for(var _0x15eedd=0x0;_0x15eedd<_0xc2ff78['joins'][_0xc9eb('0x3e')];_0x15eedd+=0x1){if(_0xc2ff78[_0xc9eb('0x71')][_0x15eedd][_0xc9eb('0x28')]&&_[_0xc9eb('0x59')](_0x3dabb5,_0xc2ff78[_0xc9eb('0x71')][_0x15eedd][_0xc9eb('0x28')])&&_0xc2ff78['joins'][_0x15eedd][_0xc9eb('0x73')]&&_0xc2ff78[_0xc9eb('0x71')][_0x15eedd]['foreignTable']&&_0xc2ff78[_0xc9eb('0x71')][_0x15eedd][_0xc9eb('0x74')]){_0x57267f[_0xc2ff78[_0xc9eb('0x71')][_0x15eedd]['type']](_0xc2ff78[_0xc9eb('0x71')][_0x15eedd][_0xc9eb('0x75')],null,util[_0xc9eb('0x6b')]('%s.%s\x20=\x20%s.%s',_0xc2ff78[_0xc9eb('0x76')],_0xc2ff78['joins'][_0x15eedd][_0xc9eb('0x73')],_0xc2ff78['joins'][_0x15eedd]['foreignTable'],_0xc2ff78[_0xc9eb('0x71')][_0x15eedd]['foreignKey']));}}}if(_0xc2ff78['conditions']){_0xc2ff78['conditions']=JSON['parse'](_0xc2ff78[_0xc9eb('0x77')]);_0x57267f[_0xc9eb('0x35')](_0xc55f02(_0xc2ff78[_0xc9eb('0x77')]['group']));}_0x69464f=_0x57267f[_0xc9eb('0x78')]();_0x57267f[_0xc9eb('0x31')](_0x1d8dec);_0x57267f[_0xc9eb('0x32')](0x0);logger['debug'](_0xc9eb('0x79'),_0x57267f[_0xc9eb('0x7a')]());return db[_0xc9eb('0x7b')][_0xc9eb('0x2b')](_0x57267f[_0xc9eb('0x7a')](),{'type':db['sequelize'][_0xc9eb('0x7c')]['SELECT']});}})[_0xc9eb('0x1f')](respondWithResult(_0xfb65a4,null))['catch'](handleError(_0xfb65a4,null));};function runReport(_0x14b963,_0x1cd07d,_0x3d1875){var _0x2dae7a=_0x1cd07d['name'];var _0x379b44=0xa;var _0x263cc1=[_0xc9eb('0x7d'),'left_join','right_join',_0xc9eb('0x4f')];var _0x576b92={'SUM':_0xc9eb('0x50'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xc9eb('0x51'),'MAX':_0xc9eb('0x52'),'MIN':_0xc9eb('0x7e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc9eb('0x54'),'GROUP_CONCAT ASC':_0xc9eb('0x7f'),'GROUP_CONCAT DESC':_0xc9eb('0x55')};var _0x3d88a4={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc9eb('0x56'),'HOUR':_0xc9eb('0x57'),'ROUND':_0xc9eb('0x58'),'UNIX_TIMESTAMP':_0xc9eb('0x80')};var _0x22b115=function(_0x4d9058){return!_[_0xc9eb('0x59')](['IS\x20NULL',_0xc9eb('0x5a'),'IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x4d9058);};var _0x1d4746=function(_0x1103ab){if(!_0x1103ab||!_0x1103ab[_0xc9eb('0x5c')][_0xc9eb('0x3e')]){return'';}for(var _0x21863e='(',_0x4378b6=0x0;_0x4378b6<_0x1103ab[_0xc9eb('0x5c')][_0xc9eb('0x3e')];_0x4378b6+=0x1){_0x4378b6>0x0&&(_0x21863e+='\x20'+_0x1103ab[_0xc9eb('0x81')]+'\x20');_0x21863e+=_0x1103ab[_0xc9eb('0x5c')][_0x4378b6][_0xc9eb('0x6d')]?_0x1d4746(_0x1103ab[_0xc9eb('0x5c')][_0x4378b6][_0xc9eb('0x6d')]):_0x1103ab[_0xc9eb('0x5c')][_0x4378b6][_0xc9eb('0x5d')]+'\x20'+_0x1103ab[_0xc9eb('0x5c')][_0x4378b6][_0xc9eb('0x5e')]+(_0x22b115(_0x1103ab[_0xc9eb('0x5c')][_0x4378b6][_0xc9eb('0x5e')])?'\x20'+_0x1103ab[_0xc9eb('0x5c')][_0x4378b6][_0xc9eb('0x5f')]:'');}return _0x21863e+')';};var _0x764212={'where':{'id':_0x14b963['id']}},_0x295b5d,_0x433bf7,_0xb8670f,_0x14fa39,_0x14b2ed;_0x764212=_[_0xc9eb('0x36')]({},_0x764212,_0x3d1875);return db[_0xc9eb('0x26')]['find'](_0x764212)[_0xc9eb('0x1f')](function(_0x5d7975){if(_0x5d7975){_0x295b5d=_0x5d7975;return _0x5d7975[_0xc9eb('0x60')]();}return null;})['then'](function(_0x374d67){if(_0x374d67){if(!_0x374d67[_0xc9eb('0x3e')]){throw new db['Sequelize'][(_0xc9eb('0x62'))](_0xc9eb('0x63'),0x193);}_0x433bf7=_0x374d67;return db[_0xc9eb('0x64')][_0xc9eb('0x3a')]({'raw':!![]});}return null;})['then'](function(_0xe86167){if(_0xe86167){_0xb8670f=_[_0xc9eb('0x65')](_0xe86167,'id');var _0x46cb38;var _0x3bc71a=squel[_0xc9eb('0x66')]();_0x3bc71a[_0xc9eb('0x67')](_0x295b5d[_0xc9eb('0x76')]);for(var _0x175d1f=0x0;_0x175d1f<_0x433bf7['length'];_0x175d1f+=0x1){_0x46cb38=_0x433bf7[_0x175d1f]['MetricId']?_0xb8670f[_0x433bf7[_0x175d1f][_0xc9eb('0x68')]]['metric']:_0x433bf7[_0x175d1f][_0xc9eb('0x5d')];_0x46cb38=_0x433bf7[_0x175d1f][_0xc9eb('0x6a')]?_[_0xc9eb('0x6c')](_0x576b92[_0x433bf7[_0x175d1f][_0xc9eb('0x6a')]],'%s',_0x46cb38):_0x46cb38;_0x46cb38=_0x433bf7[_0x175d1f][_0xc9eb('0x6b')]?_[_0xc9eb('0x6c')](_0x3d88a4[_0x433bf7[_0x175d1f][_0xc9eb('0x6b')]],'%s',_0x46cb38):_0x46cb38;if(_0x433bf7[_0x175d1f][_0xc9eb('0x82')]){_0x3bc71a[_0xc9eb('0x6d')](_0x46cb38);}_0x433bf7[_0x175d1f][_0xc9eb('0x6e')]&&_0x3bc71a['order'](_0x46cb38,_0x433bf7[_0x175d1f]['orderBy']==='DESC'?![]:!![]);_0x3bc71a[_0xc9eb('0x5d')](_0x46cb38,_0x433bf7[_0x175d1f][_0xc9eb('0x70')]||_0x46cb38);}if(_0x295b5d[_0xc9eb('0x71')]){_0x295b5d[_0xc9eb('0x71')]=JSON[_0xc9eb('0x72')](_0x295b5d['joins']);for(var _0x23380c=0x0;_0x23380c<_0x295b5d['joins']['length'];_0x23380c+=0x1){if(_0x295b5d[_0xc9eb('0x71')][_0x23380c][_0xc9eb('0x28')]&&_[_0xc9eb('0x59')](_0x263cc1,_0x295b5d['joins'][_0x23380c]['type'])&&_0x295b5d[_0xc9eb('0x71')][_0x23380c][_0xc9eb('0x73')]&&_0x295b5d['joins'][_0x23380c][_0xc9eb('0x75')]&&_0x295b5d['joins'][_0x23380c][_0xc9eb('0x74')]){_0x3bc71a[_0x295b5d['joins'][_0x23380c]['type']](_0x295b5d[_0xc9eb('0x71')][_0x23380c][_0xc9eb('0x75')],null,util[_0xc9eb('0x6b')](_0xc9eb('0x83'),_0x295b5d[_0xc9eb('0x76')],_0x295b5d['joins'][_0x23380c][_0xc9eb('0x73')],_0x295b5d[_0xc9eb('0x71')][_0x23380c][_0xc9eb('0x75')],_0x295b5d[_0xc9eb('0x71')][_0x23380c][_0xc9eb('0x74')]));}}}if(_0x295b5d['conditions']){_0x295b5d[_0xc9eb('0x77')]=JSON['parse'](_0x295b5d[_0xc9eb('0x77')]);_0x3bc71a['where'](_0x1d4746(_0x295b5d[_0xc9eb('0x77')]['group']));}_0x14b2ed=_0x3bc71a[_0xc9eb('0x78')]();_0x3bc71a['limit'](_0x379b44);_0x3bc71a[_0xc9eb('0x32')](0x0);logger[_0xc9eb('0x84')](_0xc9eb('0x79'),_0x3bc71a['toString']());return db[_0xc9eb('0x7b')]['query'](_0x3bc71a[_0xc9eb('0x7a')](),{'type':db[_0xc9eb('0x7b')][_0xc9eb('0x7c')]['SELECT']});}})[_0xc9eb('0x1f')](function(_0x2d054b){if(!_0x2d054b[_0xc9eb('0x3e')]){throw new db[(_0xc9eb('0x61'))][(_0xc9eb('0x62'))](_0xc9eb('0x85'),0xcc);}if(_0x1cd07d['output']===_0xc9eb('0x86')){return null;}var _0x3f1ae9=_[_0xc9eb('0x36')](_0x1cd07d,{'name':_0x1cd07d['fullPath']||_0x1cd07d[_0xc9eb('0x24')]||_0x295b5d[_0xc9eb('0x24')],'basename':_0x2dae7a,'savename':util[_0xc9eb('0x6b')](_0xc9eb('0x87'),_0x1cd07d[_0xc9eb('0x24')]||_0x295b5d[_0xc9eb('0x24')],require('randomstring')[_0xc9eb('0x88')](0x4),_0x1cd07d[_0xc9eb('0x89')]||_0xc9eb('0x8a')),'reportId':_0x295b5d['id'],'reportType':_0xc9eb('0x8b')});return db[_0xc9eb('0x8c')][_0xc9eb('0x40')](_0x3f1ae9,{'raw':!![]});})[_0xc9eb('0x1f')](function(_0x3866c5){if(_0x295b5d[_0xc9eb('0x76')]==='cdr'){_0x14b2ed[_0xc9eb('0x35')](_0x295b5d['table']+_0xc9eb('0x8d'),_0x1cd07d[_0xc9eb('0x8e')],_0x1cd07d['endDate']);}else{_0x14b2ed['where'](_0x295b5d[_0xc9eb('0x76')]+_0xc9eb('0x8f'),_0x1cd07d[_0xc9eb('0x8e')],_0x1cd07d[_0xc9eb('0x90')]);}if(_0x3866c5){logger['info'](_0xc9eb('0x91'),_0x14b2ed['toString']());require(_0xc9eb('0x92'))[_0xc9eb('0x93')](path['join'](__dirname,'../../components/export/',_0x3866c5[_0xc9eb('0x89')]),[_0x3866c5['id'],_0x14b2ed[_0xc9eb('0x7a')](),path[_0xc9eb('0x7d')](__dirname,_0xc9eb('0x94'),_0x3866c5[_0xc9eb('0x95')]),_0x2dae7a]);return _0x3866c5;}else{var _0xa6a6d3=squel[_0xc9eb('0x66')]();_0xa6a6d3[_0xc9eb('0x67')]('('+_0x14b2ed[_0xc9eb('0x7a')]()+')',_0xc9eb('0x96'));_0xa6a6d3[_0xc9eb('0x5d')]('COUNT(*)',_0xc9eb('0x18'));_0x14b2ed[_0xc9eb('0x31')](_0x1cd07d['limit']||_0x379b44);_0x14b2ed[_0xc9eb('0x32')](_0x1cd07d['offset']||0x0);return db['sequelize']['query'](_0xa6a6d3[_0xc9eb('0x7a')](),{'type':db['sequelize'][_0xc9eb('0x7c')][_0xc9eb('0x97')]})[_0xc9eb('0x1f')](function(_0xaedbf9){if(!_0xaedbf9[_0xc9eb('0x3e')]){_0x14fa39=0x0;}else{_0x14fa39=_0xaedbf9[0x0][_0xc9eb('0x18')]||0x0;}return db[_0xc9eb('0x7b')]['query'](_0x14b2ed[_0xc9eb('0x7a')](),{'type':db['sequelize'][_0xc9eb('0x7c')][_0xc9eb('0x97')]});})[_0xc9eb('0x1f')](function(_0x171869){return{'rows':_0x171869||[],'count':_0x14fa39};});}});}exports[_0xc9eb('0x98')]=function(_0x4c4f92,_0x3bed60){return runReport(_0x4c4f92[_0xc9eb('0x4b')],_0x4c4f92[_0xc9eb('0x2b')],_0x4c4f92['options'])['then'](respondWithResult(_0x3bed60,null))[_0xc9eb('0x3c')](handleError(_0x3bed60,null));};exports[_0xc9eb('0x99')]=runReport;exports[_0xc9eb('0x2b')]=function(_0x50431d,_0x444c3e){var _0x43d453=0xa;var _0x51decc=[_0xc9eb('0x7d'),'left_join',_0xc9eb('0x4e'),_0xc9eb('0x4f')];var _0x793dc={'SUM':_0xc9eb('0x50'),'COUNT':_0xc9eb('0x9a'),'COUNT DISTINCT':_0xc9eb('0x51'),'MAX':'MAX(%s)','MIN':_0xc9eb('0x7e'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xc9eb('0x54'),'GROUP_CONCAT ASC':_0xc9eb('0x7f'),'GROUP_CONCAT DESC':_0xc9eb('0x55')};var _0x4523a8={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xc9eb('0x56'),'HOUR':_0xc9eb('0x57'),'ROUND':_0xc9eb('0x58'),'UNIX_TIMESTAMP':_0xc9eb('0x80')};var _0x3dd14b=function(_0x7219f4){return!_['includes']([_0xc9eb('0x9b'),_0xc9eb('0x5a'),_0xc9eb('0x9c'),_0xc9eb('0x5b')],_0x7219f4);};var _0x5cb43b=function(_0x19195d){if(!_0x19195d||!_0x19195d[_0xc9eb('0x5c')][_0xc9eb('0x3e')]){return'';}for(var _0x34ac12='(',_0x3391e0=0x0;_0x3391e0<_0x19195d['rules'][_0xc9eb('0x3e')];_0x3391e0+=0x1){_0x3391e0>0x0&&(_0x34ac12+='\x20'+_0x19195d['operator']+'\x20');_0x34ac12+=_0x19195d[_0xc9eb('0x5c')][_0x3391e0][_0xc9eb('0x6d')]?_0x5cb43b(_0x19195d[_0xc9eb('0x5c')][_0x3391e0][_0xc9eb('0x6d')]):_0x19195d['rules'][_0x3391e0][_0xc9eb('0x5d')]+'\x20'+_0x19195d[_0xc9eb('0x5c')][_0x3391e0][_0xc9eb('0x5e')]+(_0x3dd14b(_0x19195d[_0xc9eb('0x5c')][_0x3391e0][_0xc9eb('0x5e')])?'\x20'+_0x19195d[_0xc9eb('0x5c')][_0x3391e0][_0xc9eb('0x5f')]:'');}return _0x34ac12+')';};var _0x4d20d5={'where':{'id':_0x50431d['params']['id']}},_0x356f79,_0x8d02dc,_0x26473f,_0x418439,_0x2a0c87;_0x4d20d5=_[_0xc9eb('0x36')]({},_0x4d20d5,_0x50431d[_0xc9eb('0x37')]);return db[_0xc9eb('0x26')]['find'](_0x4d20d5)[_0xc9eb('0x1f')](function(_0x23b805){if(_0x23b805){_0x356f79=_0x23b805;return _0x23b805[_0xc9eb('0x60')]();}return null;})[_0xc9eb('0x1f')](function(_0x513bdc){if(_0x513bdc){if(!_0x513bdc[_0xc9eb('0x3e')]){throw new db[(_0xc9eb('0x61'))][(_0xc9eb('0x62'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x8d02dc=_0x513bdc;return db[_0xc9eb('0x64')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x31f7f4){if(_0x31f7f4){_0x26473f=_[_0xc9eb('0x65')](_0x31f7f4,'id');var _0x17a507;var _0x589116=squel[_0xc9eb('0x66')]();_0x589116[_0xc9eb('0x67')](_0x356f79[_0xc9eb('0x76')]);for(var _0x4f10b6=0x0;_0x4f10b6<_0x8d02dc[_0xc9eb('0x3e')];_0x4f10b6+=0x1){_0x17a507=_0x8d02dc[_0x4f10b6][_0xc9eb('0x68')]?_0x26473f[_0x8d02dc[_0x4f10b6][_0xc9eb('0x68')]][_0xc9eb('0x69')]:_0x8d02dc[_0x4f10b6][_0xc9eb('0x5d')];_0x17a507=_0x8d02dc[_0x4f10b6][_0xc9eb('0x6a')]?_['replace'](_0x793dc[_0x8d02dc[_0x4f10b6][_0xc9eb('0x6a')]],'%s',_0x17a507):_0x17a507;_0x17a507=_0x8d02dc[_0x4f10b6][_0xc9eb('0x6b')]?_[_0xc9eb('0x6c')](_0x4523a8[_0x8d02dc[_0x4f10b6][_0xc9eb('0x6b')]],'%s',_0x17a507):_0x17a507;if(_0x8d02dc[_0x4f10b6][_0xc9eb('0x82')]){_0x589116[_0xc9eb('0x6d')](_0x17a507);}_0x8d02dc[_0x4f10b6]['orderBy']&&_0x589116[_0xc9eb('0x33')](_0x17a507,_0x8d02dc[_0x4f10b6][_0xc9eb('0x6e')]===_0xc9eb('0x6f')?![]:!![]);_0x589116[_0xc9eb('0x5d')](_0x17a507,_0x8d02dc[_0x4f10b6][_0xc9eb('0x70')]||_0x17a507);}if(_0x356f79[_0xc9eb('0x71')]){_0x356f79[_0xc9eb('0x71')]=JSON['parse'](_0x356f79[_0xc9eb('0x71')]);for(var _0x25c12d=0x0;_0x25c12d<_0x356f79[_0xc9eb('0x71')][_0xc9eb('0x3e')];_0x25c12d+=0x1){if(_0x356f79[_0xc9eb('0x71')][_0x25c12d][_0xc9eb('0x28')]&&_[_0xc9eb('0x59')](_0x51decc,_0x356f79[_0xc9eb('0x71')][_0x25c12d][_0xc9eb('0x28')])&&_0x356f79[_0xc9eb('0x71')][_0x25c12d]['parentKey']&&_0x356f79[_0xc9eb('0x71')][_0x25c12d][_0xc9eb('0x75')]&&_0x356f79[_0xc9eb('0x71')][_0x25c12d][_0xc9eb('0x74')]){_0x589116[_0x356f79['joins'][_0x25c12d][_0xc9eb('0x28')]](_0x356f79['joins'][_0x25c12d][_0xc9eb('0x75')],null,util[_0xc9eb('0x6b')](_0xc9eb('0x83'),_0x356f79['table'],_0x356f79[_0xc9eb('0x71')][_0x25c12d][_0xc9eb('0x73')],_0x356f79['joins'][_0x25c12d][_0xc9eb('0x75')],_0x356f79[_0xc9eb('0x71')][_0x25c12d][_0xc9eb('0x74')]));}}}if(_0x356f79['conditions']){_0x356f79[_0xc9eb('0x77')]=JSON['parse'](_0x356f79[_0xc9eb('0x77')]);_0x589116[_0xc9eb('0x35')](_0x5cb43b(_0x356f79[_0xc9eb('0x77')]['group']));}_0x2a0c87=_0x589116[_0xc9eb('0x78')]();_0x589116[_0xc9eb('0x31')](_0x43d453);_0x589116[_0xc9eb('0x32')](0x0);logger['debug'](_0xc9eb('0x79'),_0x589116[_0xc9eb('0x7a')]());return db['sequelize'][_0xc9eb('0x2b')](_0x589116[_0xc9eb('0x7a')](),{'type':db[_0xc9eb('0x7b')][_0xc9eb('0x7c')][_0xc9eb('0x97')]});}})[_0xc9eb('0x1f')](function(){return{'sql':_0x2a0c87[_0xc9eb('0x7a')]()};})[_0xc9eb('0x1f')](respondWithResult(_0x444c3e,null))['catch'](handleError(_0x444c3e,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 41dc19d..0be3961 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 _0xb858=['../../config/logger','moment','bluebird','request-promise','path','../../config/environment','define','AnalyticCustomReport'];(function(_0x243d68,_0x2437e7){var _0x2b91a2=function(_0x35df53){while(--_0x35df53){_0x243d68['push'](_0x243d68['shift']());}};_0x2b91a2(++_0x2437e7);}(_0xb858,0x78));var _0x8b85=function(_0x3bba69,_0x5857db){_0x3bba69=_0x3bba69-0x0;var _0x400342=_0xb858[_0x3bba69];return _0x400342;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8b85('0x0'))('api');var moment=require(_0x8b85('0x1'));var BPromise=require(_0x8b85('0x2'));var rp=require(_0x8b85('0x3'));var fs=require('fs');var path=require(_0x8b85('0x4'));var rimraf=require('rimraf');var config=require(_0x8b85('0x5'));var attributes=require('./analyticCustomReport.attributes');module['exports']=function(_0x5c3a65,_0x387ecb){return _0x5c3a65[_0x8b85('0x6')](_0x8b85('0x7'),attributes,{'tableName':'analytics_custom_reports','paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa759=['analytics_custom_reports','lodash','util','../../config/logger','api','moment','../../config/environment','exports','AnalyticCustomReport'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0xa759,0xb5));var _0x9a75=function(_0x2edb9f,_0x36fad0){_0x2edb9f=_0x2edb9f-0x0;var _0x4e5979=_0xa759[_0x2edb9f];return _0x4e5979;};'use strict';var _=require(_0x9a75('0x0'));var util=require(_0x9a75('0x1'));var logger=require(_0x9a75('0x2'))(_0x9a75('0x3'));var moment=require(_0x9a75('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x9a75('0x5'));var attributes=require('./analyticCustomReport.attributes');module[_0x9a75('0x6')]=function(_0x4a549b,_0x112c02){return _0x4a549b['define'](_0x9a75('0x7'),attributes,{'tableName':_0x9a75('0x8'),'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 bbc4148..196fa3c 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 _0xba11=['client','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x4d941f,_0x4d8121){var _0x20c433=function(_0x3643e8){while(--_0x3643e8){_0x4d941f['push'](_0x4d941f['shift']());}};_0x20c433(++_0x4d8121);}(_0xba11,0x122));var _0x1ba1=function(_0x227155,_0x54b364){_0x227155=_0x227155-0x0;var _0x309627=_0xba11[_0x227155];return _0x309627;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1ba1('0x0'));var BPromise=require(_0x1ba1('0x1'));var rs=require(_0x1ba1('0x2'));var fs=require('fs');var Redis=require(_0x1ba1('0x3'));var db=require(_0x1ba1('0x4'))['db'];var utils=require(_0x1ba1('0x5'));var logger=require(_0x1ba1('0x6'))(_0x1ba1('0x7'));var config=require('../../config/environment');var jayson=require(_0x1ba1('0x8'));var client=jayson[_0x1ba1('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37eae7,_0x5f21f0,_0x14675e){return new BPromise(function(_0x529abe,_0x22c74c){return client[_0x1ba1('0xa')](_0x37eae7,_0x14675e)[_0x1ba1('0xb')](function(_0x26fc0c){logger[_0x1ba1('0xc')](_0x1ba1('0xd'),_0x5f21f0,_0x1ba1('0xe'));logger[_0x1ba1('0xf')](_0x1ba1('0x10'),_0x5f21f0,_0x1ba1('0xe'),JSON[_0x1ba1('0x11')](_0x26fc0c));if(_0x26fc0c[_0x1ba1('0x12')]){if(_0x26fc0c[_0x1ba1('0x12')][_0x1ba1('0x13')]===0x1f4){logger['error'](_0x1ba1('0xd'),_0x5f21f0,_0x26fc0c[_0x1ba1('0x12')][_0x1ba1('0x14')]);return _0x22c74c(_0x26fc0c['error'][_0x1ba1('0x14')]);}logger['error'](_0x1ba1('0xd'),_0x5f21f0,_0x26fc0c[_0x1ba1('0x12')]['message']);return _0x529abe(_0x26fc0c['error']['message']);}else{logger[_0x1ba1('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5f21f0,_0x1ba1('0xe'));_0x529abe(_0x26fc0c[_0x1ba1('0x15')][_0x1ba1('0x14')]);}})[_0x1ba1('0x16')](function(_0x319bfa){logger[_0x1ba1('0x12')](_0x1ba1('0xd'),_0x5f21f0,_0x319bfa);_0x22c74c(_0x319bfa);});});} \ No newline at end of file +var _0x6abc=['AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info'];(function(_0x1a45e3,_0x385589){var _0x3615f8=function(_0x40ce0a){while(--_0x40ce0a){_0x1a45e3['push'](_0x1a45e3['shift']());}};_0x3615f8(++_0x385589);}(_0x6abc,0x1eb));var _0xc6ab=function(_0x15a26e,_0x334582){_0x15a26e=_0x15a26e-0x0;var _0x25bef6=_0x6abc[_0x15a26e];return _0x25bef6;};'use strict';var _=require(_0xc6ab('0x0'));var util=require(_0xc6ab('0x1'));var moment=require(_0xc6ab('0x2'));var BPromise=require(_0xc6ab('0x3'));var rs=require(_0xc6ab('0x4'));var fs=require('fs');var Redis=require(_0xc6ab('0x5'));var db=require(_0xc6ab('0x6'))['db'];var utils=require(_0xc6ab('0x7'));var logger=require(_0xc6ab('0x8'))(_0xc6ab('0x9'));var config=require('../../config/environment');var jayson=require(_0xc6ab('0xa'));var client=jayson['client'][_0xc6ab('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a7fe8,_0x369504,_0x48ec53){return new BPromise(function(_0x134ac6,_0x3031f0){return client[_0xc6ab('0xc')](_0x3a7fe8,_0x48ec53)[_0xc6ab('0xd')](function(_0x3ddfb0){logger[_0xc6ab('0xe')](_0xc6ab('0xf'),_0x369504,'request\x20sent');logger[_0xc6ab('0x10')](_0xc6ab('0x11'),_0x369504,_0xc6ab('0x12'),JSON[_0xc6ab('0x13')](_0x3ddfb0));if(_0x3ddfb0[_0xc6ab('0x14')]){if(_0x3ddfb0[_0xc6ab('0x14')]['code']===0x1f4){logger[_0xc6ab('0x14')](_0xc6ab('0xf'),_0x369504,_0x3ddfb0[_0xc6ab('0x14')]['message']);return _0x3031f0(_0x3ddfb0['error'][_0xc6ab('0x15')]);}logger['error'](_0xc6ab('0xf'),_0x369504,_0x3ddfb0['error']['message']);return _0x134ac6(_0x3ddfb0[_0xc6ab('0x14')][_0xc6ab('0x15')]);}else{logger['info'](_0xc6ab('0xf'),_0x369504,_0xc6ab('0x12'));_0x134ac6(_0x3ddfb0['result'][_0xc6ab('0x15')]);}})[_0xc6ab('0x16')](function(_0x11dd54){logger[_0xc6ab('0x14')](_0xc6ab('0xf'),_0x369504,_0x11dd54);_0x3031f0(_0x11dd54);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index f425b0b..7dcfac7 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 _0xe4ac=['update','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','/:id/preview','preview','/:id/run','run','query','post','put'];(function(_0x304b67,_0x31cb39){var _0x493afb=function(_0x21dce3){while(--_0x21dce3){_0x304b67['push'](_0x304b67['shift']());}};_0x493afb(++_0x31cb39);}(_0xe4ac,0x1a6));var _0xce4a=function(_0x358e3b,_0x72233f){_0x358e3b=_0x358e3b-0x0;var _0x4906c0=_0xe4ac[_0x358e3b];return _0x4906c0;};'use strict';var multer=require('multer');var util=require(_0xce4a('0x0'));var path=require(_0xce4a('0x1'));var timeout=require('connect-timeout');var express=require(_0xce4a('0x2'));var router=express[_0xce4a('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xce4a('0x4'));var config=require(_0xce4a('0x5'));var controller=require(_0xce4a('0x6'));router[_0xce4a('0x7')]('/',auth[_0xce4a('0x8')](),controller[_0xce4a('0x9')]);router[_0xce4a('0x7')](_0xce4a('0xa'),auth['isAuthenticated'](),controller['show']);router['get'](_0xce4a('0xb'),auth[_0xce4a('0x8')](),controller[_0xce4a('0xc')]);router[_0xce4a('0x7')](_0xce4a('0xd'),auth[_0xce4a('0x8')](),controller[_0xce4a('0xe')]);router['get']('/:id/query',auth[_0xce4a('0x8')](),controller[_0xce4a('0xf')]);router[_0xce4a('0x10')]('/',auth[_0xce4a('0x8')](),controller['create']);router[_0xce4a('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xce4a('0x12')]);router[_0xce4a('0x13')](_0xce4a('0xa'),auth[_0xce4a('0x8')](),controller[_0xce4a('0x14')]);module[_0xce4a('0x15')]=router; \ No newline at end of file +var _0xed40=['create','put','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticCustomReport.controller','get','isAuthenticated','index','/:id','show','/:id/preview','preview','run','query'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xed40,0x12a));var _0x0ed4=function(_0x3fd3aa,_0x3a7354){_0x3fd3aa=_0x3fd3aa-0x0;var _0x27bfca=_0xed40[_0x3fd3aa];return _0x27bfca;};'use strict';var multer=require(_0x0ed4('0x0'));var util=require(_0x0ed4('0x1'));var path=require(_0x0ed4('0x2'));var timeout=require(_0x0ed4('0x3'));var express=require(_0x0ed4('0x4'));var router=express['Router']();var auth=require(_0x0ed4('0x5'));var interaction=require(_0x0ed4('0x6'));var config=require('../../config/environment');var controller=require(_0x0ed4('0x7'));router[_0x0ed4('0x8')]('/',auth[_0x0ed4('0x9')](),controller[_0x0ed4('0xa')]);router['get'](_0x0ed4('0xb'),auth[_0x0ed4('0x9')](),controller[_0x0ed4('0xc')]);router[_0x0ed4('0x8')](_0x0ed4('0xd'),auth[_0x0ed4('0x9')](),controller[_0x0ed4('0xe')]);router['get']('/:id/run',auth[_0x0ed4('0x9')](),controller[_0x0ed4('0xf')]);router[_0x0ed4('0x8')]('/:id/query',auth['isAuthenticated'](),controller[_0x0ed4('0x10')]);router['post']('/',auth[_0x0ed4('0x9')](),controller[_0x0ed4('0x11')]);router[_0x0ed4('0x12')](_0x0ed4('0xb'),auth[_0x0ed4('0x9')](),controller['update']);router[_0x0ed4('0x13')](_0x0ed4('0xb'),auth[_0x0ed4('0x9')](),controller[_0x0ed4('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index 917692e..ef48af0 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 _0xbe80=['exports','STRING','TEXT','sequelize'];(function(_0x4009db,_0x40376e){var _0x57e02a=function(_0x5e39a1){while(--_0x5e39a1){_0x4009db['push'](_0x4009db['shift']());}};_0x57e02a(++_0x40376e);}(_0xbe80,0xf3));var _0x0be8=function(_0x1166d4,_0x529d18){_0x1166d4=_0x1166d4-0x0;var _0x365676=_0xbe80[_0x1166d4];return _0x365676;};'use strict';var Sequelize=require(_0x0be8('0x0'));module[_0x0be8('0x1')]={'name':{'type':Sequelize[_0x0be8('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x0be8('0x2')]},'table':{'type':Sequelize[_0x0be8('0x2')]},'conditions':{'type':Sequelize[_0x0be8('0x3')]},'joins':{'type':Sequelize[_0x0be8('0x3')]}}; \ No newline at end of file +var _0xcd69=['STRING','TEXT','sequelize'];(function(_0x3e44fa,_0x75ed2a){var _0x2a0aba=function(_0x1db6a7){while(--_0x1db6a7){_0x3e44fa['push'](_0x3e44fa['shift']());}};_0x2a0aba(++_0x75ed2a);}(_0xcd69,0xda));var _0x9cd6=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xcd69[_0x1a72f3];return _0x57ef47;};'use strict';var Sequelize=require(_0x9cd6('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9cd6('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0x9cd6('0x1')]},'conditions':{'type':Sequelize[_0x9cd6('0x2')]},'joins':{'type':Sequelize[_0x9cd6('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 2ad00b3..86f35cd 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 _0xdc9e=['length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','include','findAll','show','params','includeAll','options','find','create','user','Reports','UserProfileSection','userProfileId','autoAssociation','catch','body','join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','SEC_TO_TIME(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','ValidationErrorItem','keyBy','select','table','MetricId','function','replace','format','groupBy','orderBy','DESC','field','alias','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','left_join','MIN(%s)','AVG(%s)','DATE(%s)','getFields','Sequelize','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','metric','debug','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','child_process','fork','../../files/reports','savename','from','countTable','COUNT(*)','run','UNIX_TIMESTAMP(%s)','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','key','query','keys','filters','model','attributes','intersection','fields'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc9e,0x6e));var _0xedc9=function(_0x401649,_0xa4b0e8){_0x401649=_0x401649-0x0;var _0x2a71b4=_0xdc9e[_0x401649];return _0x2a71b4;};'use strict';var pdf=require(_0xedc9('0x0'));var emlformat=require(_0xedc9('0x1'));var rimraf=require(_0xedc9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xedc9('0x3'));var moment=require(_0xedc9('0x4'));var BPromise=require(_0xedc9('0x5'));var Mustache=require(_0xedc9('0x6'));var util=require('util');var path=require('path');var sox=require(_0xedc9('0x7'));var csv=require(_0xedc9('0x8'));var ejs=require(_0xedc9('0x9'));var fs=require('fs');var _=require(_0xedc9('0xa'));var squel=require('squel');var crypto=require(_0xedc9('0xb'));var jsforce=require(_0xedc9('0xc'));var deskjs=require(_0xedc9('0xd'));var toCsv=require('to-csv');var querystring=require(_0xedc9('0xe'));var Papa=require(_0xedc9('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xedc9('0x10'));var as=require(_0xedc9('0x11'));var hardwareService=require(_0xedc9('0x12'));var logger=require(_0xedc9('0x13'))('api');var utils=require(_0xedc9('0x14'));var config=require(_0xedc9('0x15'));var db=require(_0xedc9('0x16'))['db'];function respondWithStatusCode(_0x21df67,_0x5587b2){_0x5587b2=_0x5587b2||0xcc;return function(_0x18b771){if(_0x18b771){return _0x21df67[_0xedc9('0x17')](_0x5587b2);}return _0x21df67[_0xedc9('0x18')](_0x5587b2)[_0xedc9('0x19')]();};}function respondWithResult(_0x3ce92a,_0x26d83d){_0x26d83d=_0x26d83d||0xc8;return function(_0xd1c40e){if(_0xd1c40e){return _0x3ce92a[_0xedc9('0x18')](_0x26d83d)['json'](_0xd1c40e);}};}function respondWithFilteredResult(_0x5cae6c,_0x390869){return function(_0x1a63c6){if(_0x1a63c6){var _0x39c478=_0x1a63c6[_0xedc9('0x1a')],_0x26be72=_0x390869[_0xedc9('0x1b')],_0x290026=_0x390869[_0xedc9('0x1b')]+_0x390869['limit'],_0xada620;if(_0x290026>=_0x39c478){_0x290026=_0x39c478;_0xada620=0xc8;}else{_0xada620=0xce;}_0x5cae6c['status'](_0xada620);return _0x5cae6c[_0xedc9('0x1c')](_0xedc9('0x1d'),_0x26be72+'-'+_0x290026+'/'+_0x39c478)[_0xedc9('0x1e')](_0x1a63c6);}return null;};}function patchUpdates(_0x3124e7){return function(_0x3a7f28){try{jsonpatch['apply'](_0x3a7f28,_0x3124e7,!![]);}catch(_0x456e7c){return BPromise[_0xedc9('0x1f')](_0x456e7c);}return _0x3a7f28[_0xedc9('0x20')]();};}function saveUpdates(_0x25f9dd,_0x10bebd){return function(_0x4854dd){if(_0x4854dd){return _0x4854dd[_0xedc9('0x21')](_0x25f9dd)[_0xedc9('0x22')](function(_0x3c8f4b){return _0x3c8f4b;});}return null;};}function removeEntity(_0x345c3c,_0x3909c6){return function(_0x25009b){if(_0x25009b){return _0x25009b[_0xedc9('0x23')]()[_0xedc9('0x22')](function(){var _0x59467b=_0x25009b[_0xedc9('0x24')]({'plain':!![]});var _0x1001c9=_0xedc9('0x25');return db[_0xedc9('0x26')]['destroy']({'where':{'type':_0x1001c9,'resourceId':_0x59467b['id']}})[_0xedc9('0x22')](function(){return _0x25009b;});})['then'](function(){_0x345c3c[_0xedc9('0x18')](0xcc)[_0xedc9('0x19')]();});}};}function handleEntityNotFound(_0x173a62,_0x178c7b){return function(_0x3d65af){if(!_0x3d65af){_0x173a62[_0xedc9('0x17')](0x194);}return _0x3d65af;};}function handleError(_0x581437,_0x34341a){_0x34341a=_0x34341a||0x1f4;return function(_0x468d5e){logger[_0xedc9('0x27')](_0x468d5e[_0xedc9('0x28')]);if(_0x468d5e[_0xedc9('0x29')]){delete _0x468d5e[_0xedc9('0x29')];}_0x581437[_0xedc9('0x18')](_0x34341a)[_0xedc9('0x2a')](_0x468d5e);};}exports[_0xedc9('0x2b')]=function(_0x4077e3,_0x20386d){var _0x51896a={},_0x517aa5={},_0x51b014={'count':0x0,'rows':[]};var _0x1b5d03=_[_0xedc9('0x2c')](db[_0xedc9('0x2d')][_0xedc9('0x2e')],function(_0x46372d){return{'name':_0x46372d[_0xedc9('0x2f')],'type':_0x46372d['type'][_0xedc9('0x30')]};});_0x517aa5['model']=_['map'](_0x1b5d03,_0xedc9('0x29'));_0x517aa5[_0xedc9('0x31')]=_[_0xedc9('0x32')](_0x4077e3[_0xedc9('0x31')]);_0x517aa5[_0xedc9('0x33')]=_['intersection'](_0x517aa5[_0xedc9('0x34')],_0x517aa5['query']);_0x51896a[_0xedc9('0x35')]=_[_0xedc9('0x36')](_0x517aa5['model'],qs[_0xedc9('0x37')](_0x4077e3['query'][_0xedc9('0x37')]));_0x51896a[_0xedc9('0x35')]=_0x51896a['attributes'][_0xedc9('0x38')]?_0x51896a[_0xedc9('0x35')]:_0x517aa5['model'];if(!_0x4077e3[_0xedc9('0x31')][_0xedc9('0x39')](_0xedc9('0x3a'))){_0x51896a[_0xedc9('0x3b')]=qs['limit'](_0x4077e3['query'][_0xedc9('0x3b')]);_0x51896a[_0xedc9('0x1b')]=qs[_0xedc9('0x1b')](_0x4077e3['query'][_0xedc9('0x1b')]);}_0x51896a[_0xedc9('0x3c')]=qs[_0xedc9('0x3d')](_0x4077e3[_0xedc9('0x31')][_0xedc9('0x3d')]);_0x51896a[_0xedc9('0x3e')]=qs[_0xedc9('0x33')](_[_0xedc9('0x3f')](_0x4077e3[_0xedc9('0x31')],_0x517aa5['filters']));if(_0x4077e3['query'][_0xedc9('0x40')]){_0x51896a[_0xedc9('0x3e')]=_['merge'](_0x51896a[_0xedc9('0x3e')],{'$or':_[_0xedc9('0x2c')](_0x1b5d03,function(_0x300f9c){if(_0x300f9c[_0xedc9('0x41')]!==_0xedc9('0x42')){var _0xdbdf6a={};_0xdbdf6a[_0x300f9c[_0xedc9('0x29')]]={'$like':'%'+_0x4077e3[_0xedc9('0x31')][_0xedc9('0x40')]+'%'};return _0xdbdf6a;}})});}_0x51896a=_[_0xedc9('0x43')]({},_0x51896a,_0x4077e3['options']);var _0x37a188={'where':_0x51896a[_0xedc9('0x3e')]};return db['AnalyticDefaultReport'][_0xedc9('0x1a')](_0x37a188)[_0xedc9('0x22')](function(_0x4bc4dd){_0x51b014[_0xedc9('0x1a')]=_0x4bc4dd;if(_0x4077e3[_0xedc9('0x31')]['includeAll']){_0x51896a[_0xedc9('0x44')]=[{'all':!![]}];}return db[_0xedc9('0x2d')][_0xedc9('0x45')](_0x51896a);})[_0xedc9('0x22')](function(_0x12764b){_0x51b014['rows']=_0x12764b;return _0x51b014;})[_0xedc9('0x22')](respondWithFilteredResult(_0x20386d,_0x51896a))['catch'](handleError(_0x20386d,null));};exports[_0xedc9('0x46')]=function(_0x200520,_0x4cbd7b){var _0x3b3433={'raw':!![],'where':{'id':_0x200520[_0xedc9('0x47')]['id']}},_0x14ced3={};_0x14ced3['model']=_[_0xedc9('0x32')](db[_0xedc9('0x2d')][_0xedc9('0x2e')]);_0x14ced3[_0xedc9('0x31')]=_[_0xedc9('0x32')](_0x200520['query']);_0x14ced3['filters']=_[_0xedc9('0x36')](_0x14ced3[_0xedc9('0x34')],_0x14ced3[_0xedc9('0x31')]);_0x3b3433['attributes']=_[_0xedc9('0x36')](_0x14ced3[_0xedc9('0x34')],qs[_0xedc9('0x37')](_0x200520[_0xedc9('0x31')][_0xedc9('0x37')]));_0x3b3433[_0xedc9('0x35')]=_0x3b3433[_0xedc9('0x35')]['length']?_0x3b3433[_0xedc9('0x35')]:_0x14ced3[_0xedc9('0x34')];if(_0x200520['query'][_0xedc9('0x48')]){_0x3b3433[_0xedc9('0x44')]=[{'all':!![]}];}_0x3b3433=_['merge']({},_0x3b3433,_0x200520[_0xedc9('0x49')]);return db[_0xedc9('0x2d')][_0xedc9('0x4a')](_0x3b3433)[_0xedc9('0x22')](handleEntityNotFound(_0x4cbd7b,null))['then'](respondWithResult(_0x4cbd7b,null))['catch'](handleError(_0x4cbd7b,null));};exports[_0xedc9('0x4b')]=function(_0x549a15,_0x558c0b){return db[_0xedc9('0x2d')][_0xedc9('0x4b')](_0x549a15['body'],{})['then'](function(_0x24e290){var _0x54e244=_0x549a15[_0xedc9('0x4c')]['get']({'plain':!![]});if(!_0x54e244)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x54e244['role']==='user'){var _0x8816e0=_0x24e290[_0xedc9('0x24')]({'plain':!![]});var _0x2bdd9e=_0xedc9('0x4d');return db[_0xedc9('0x4e')]['find']({'where':{'name':_0x2bdd9e,'userProfileId':_0x54e244[_0xedc9('0x4f')]},'raw':!![]})['then'](function(_0xb41bf5){if(_0xb41bf5&&_0xb41bf5[_0xedc9('0x50')]===0x0){return db[_0xedc9('0x26')]['create']({'name':_0x8816e0[_0xedc9('0x29')],'resourceId':_0x8816e0['id'],'type':'DefaultReports','sectionId':_0xb41bf5['id']},{})[_0xedc9('0x22')](function(){return _0x24e290;});}else{return _0x24e290;}})[_0xedc9('0x51')](function(_0x481cda){logger[_0xedc9('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x481cda);throw _0x481cda;});}return _0x24e290;})[_0xedc9('0x22')](respondWithResult(_0x558c0b,0xc9))[_0xedc9('0x51')](handleError(_0x558c0b,null));};exports[_0xedc9('0x21')]=function(_0x33ea4f,_0x316014){if(_0x33ea4f[_0xedc9('0x52')]['id']){delete _0x33ea4f['body']['id'];}return db[_0xedc9('0x2d')][_0xedc9('0x4a')]({'where':{'id':_0x33ea4f[_0xedc9('0x47')]['id']}})[_0xedc9('0x22')](handleEntityNotFound(_0x316014,null))[_0xedc9('0x22')](saveUpdates(_0x33ea4f[_0xedc9('0x52')],null))[_0xedc9('0x22')](respondWithResult(_0x316014,null))[_0xedc9('0x51')](handleError(_0x316014,null));};exports[_0xedc9('0x23')]=function(_0x3ee153,_0xfe252b){return db['AnalyticDefaultReport'][_0xedc9('0x4a')]({'where':{'id':_0x3ee153[_0xedc9('0x47')]['id']}})['then'](handleEntityNotFound(_0xfe252b,null))[_0xedc9('0x22')](removeEntity(_0xfe252b,null))[_0xedc9('0x51')](handleError(_0xfe252b,null));};exports['preview']=function(_0x34f3a5,_0x13a512){var _0x231441=0xa;var _0x225c35=[_0xedc9('0x53'),'left_join',_0xedc9('0x54'),_0xedc9('0x55')];var _0x369b2c={'SUM':_0xedc9('0x56'),'COUNT':_0xedc9('0x57'),'COUNT DISTINCT':_0xedc9('0x58'),'MAX':_0xedc9('0x59'),'MIN':'MIN(%s)','AVG':'AVG(%s)','GROUP_CONCAT':_0xedc9('0x5a'),'GROUP_CONCAT ASC':_0xedc9('0x5b'),'GROUP_CONCAT DESC':_0xedc9('0x5c')};var _0x3d7d22={'SEC_TO_TIME':_0xedc9('0x5d'),'DATE':'DATE(%s)','HOUR':_0xedc9('0x5e'),'ROUND':_0xedc9('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x36b587=function(_0x37564a){return!_[_0xedc9('0x60')]([_0xedc9('0x61'),_0xedc9('0x62'),_0xedc9('0x63'),_0xedc9('0x64')],_0x37564a);};var _0x93d3ea=function(_0x1ac0c8){if(!_0x1ac0c8||!_0x1ac0c8[_0xedc9('0x65')]['length']){return'';}for(var _0x1dc955='(',_0x200393=0x0;_0x200393<_0x1ac0c8[_0xedc9('0x65')][_0xedc9('0x38')];_0x200393+=0x1){_0x200393>0x0&&(_0x1dc955+='\x20'+_0x1ac0c8[_0xedc9('0x66')]+'\x20');_0x1dc955+=_0x1ac0c8[_0xedc9('0x65')][_0x200393][_0xedc9('0x67')]?_0x93d3ea(_0x1ac0c8[_0xedc9('0x65')][_0x200393]['group']):_0x1ac0c8[_0xedc9('0x65')][_0x200393]['field']+'\x20'+_0x1ac0c8[_0xedc9('0x65')][_0x200393]['condition']+(_0x36b587(_0x1ac0c8['rules'][_0x200393][_0xedc9('0x68')])?'\x20'+_0x1ac0c8[_0xedc9('0x65')][_0x200393][_0xedc9('0x69')]:'');}return _0x1dc955+')';};var _0x59ffbe={'where':{'id':_0x34f3a5['params']['id']}},_0x5033dd,_0x292048,_0x2684c6,_0x46506c,_0x16fc21;_0x59ffbe=_[_0xedc9('0x43')]({},_0x59ffbe,_0x34f3a5[_0xedc9('0x49')]);return db[_0xedc9('0x2d')]['find'](_0x59ffbe)[_0xedc9('0x22')](function(_0x33466e){if(_0x33466e){_0x5033dd=_0x33466e;return _0x33466e['getFields']();}return null;})[_0xedc9('0x22')](function(_0x346d52){if(_0x346d52){if(!_0x346d52[_0xedc9('0x38')]){throw new db['Sequelize'][(_0xedc9('0x6a'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x292048=_0x346d52;return db['AnalyticMetric'][_0xedc9('0x45')]({'raw':!![]});}return null;})[_0xedc9('0x22')](function(_0x2b8c35){if(_0x2b8c35){_0x2684c6=_[_0xedc9('0x6b')](_0x2b8c35,'id');var _0x33d30d;var _0x111e21=squel[_0xedc9('0x6c')]();_0x111e21['from'](_0x5033dd[_0xedc9('0x6d')]);for(var _0x159781=0x0;_0x159781<_0x292048[_0xedc9('0x38')];_0x159781+=0x1){_0x33d30d=_0x292048[_0x159781][_0xedc9('0x6e')]?_0x2684c6[_0x292048[_0x159781][_0xedc9('0x6e')]]['metric']:_0x292048[_0x159781]['field'];_0x33d30d=_0x292048[_0x159781][_0xedc9('0x6f')]?_[_0xedc9('0x70')](_0x369b2c[_0x292048[_0x159781][_0xedc9('0x6f')]],'%s',_0x33d30d):_0x33d30d;_0x33d30d=_0x292048[_0x159781][_0xedc9('0x71')]?_[_0xedc9('0x70')](_0x3d7d22[_0x292048[_0x159781][_0xedc9('0x71')]],'%s',_0x33d30d):_0x33d30d;if(_0x292048[_0x159781][_0xedc9('0x72')]){_0x111e21[_0xedc9('0x67')](_0x33d30d);}_0x292048[_0x159781][_0xedc9('0x73')]&&_0x111e21[_0xedc9('0x3c')](_0x33d30d,_0x292048[_0x159781]['orderBy']===_0xedc9('0x74')?![]:!![]);_0x111e21[_0xedc9('0x75')](_0x33d30d,_0x292048[_0x159781][_0xedc9('0x76')]||_0x33d30d);}if(_0x5033dd[_0xedc9('0x77')]){_0x5033dd['joins']=JSON[_0xedc9('0x78')](_0x5033dd[_0xedc9('0x77')]);for(var _0x383601=0x0;_0x383601<_0x5033dd[_0xedc9('0x77')][_0xedc9('0x38')];_0x383601+=0x1){if(_0x5033dd['joins'][_0x383601]['type']&&_[_0xedc9('0x60')](_0x225c35,_0x5033dd['joins'][_0x383601][_0xedc9('0x41')])&&_0x5033dd[_0xedc9('0x77')][_0x383601][_0xedc9('0x79')]&&_0x5033dd[_0xedc9('0x77')][_0x383601][_0xedc9('0x7a')]&&_0x5033dd[_0xedc9('0x77')][_0x383601][_0xedc9('0x7b')]){_0x111e21[_0x5033dd[_0xedc9('0x77')][_0x383601]['type']](_0x5033dd[_0xedc9('0x77')][_0x383601][_0xedc9('0x7a')],null,util['format'](_0xedc9('0x7c'),_0x5033dd[_0xedc9('0x6d')],_0x5033dd[_0xedc9('0x77')][_0x383601][_0xedc9('0x79')],_0x5033dd[_0xedc9('0x77')][_0x383601]['foreignTable'],_0x5033dd[_0xedc9('0x77')][_0x383601][_0xedc9('0x7b')]));}}}if(_0x5033dd[_0xedc9('0x7d')]){_0x5033dd['conditions']=JSON[_0xedc9('0x78')](_0x5033dd[_0xedc9('0x7d')]);_0x111e21[_0xedc9('0x3e')](_0x93d3ea(_0x5033dd['conditions'][_0xedc9('0x67')]));}_0x16fc21=_0x111e21[_0xedc9('0x7e')]();_0x111e21[_0xedc9('0x3b')](_0x231441);_0x111e21[_0xedc9('0x1b')](0x0);logger['debug'](_0xedc9('0x7f'),_0x111e21['toString']());return db[_0xedc9('0x80')]['query'](_0x111e21[_0xedc9('0x81')](),{'type':db[_0xedc9('0x80')][_0xedc9('0x82')][_0xedc9('0x83')]});}})[_0xedc9('0x22')](respondWithResult(_0x13a512,null))[_0xedc9('0x51')](handleError(_0x13a512,null));};function runReport(_0x1711ef,_0x387b9b,_0x1875d5){var _0x4e2c53=_0x387b9b['name'];var _0x844763=0xa;var _0x3c9532=[_0xedc9('0x53'),_0xedc9('0x84'),_0xedc9('0x54'),_0xedc9('0x55')];var _0x33ad4e={'SUM':'SUM(%s)','COUNT':_0xedc9('0x57'),'COUNT DISTINCT':_0xedc9('0x58'),'MAX':_0xedc9('0x59'),'MIN':_0xedc9('0x85'),'AVG':_0xedc9('0x86'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0xedc9('0x5b'),'GROUP_CONCAT DESC':_0xedc9('0x5c')};var _0x1e3a3d={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xedc9('0x87'),'HOUR':_0xedc9('0x5e'),'ROUND':_0xedc9('0x5f'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x28e0ee=function(_0x580cf5){return!_[_0xedc9('0x60')]([_0xedc9('0x61'),'IS\x20NOT\x20NULL',_0xedc9('0x63'),_0xedc9('0x64')],_0x580cf5);};var _0x5723a1=function(_0x2cc6c2){if(!_0x2cc6c2||!_0x2cc6c2[_0xedc9('0x65')][_0xedc9('0x38')]){return'';}for(var _0x549b58='(',_0x3025ca=0x0;_0x3025ca<_0x2cc6c2[_0xedc9('0x65')][_0xedc9('0x38')];_0x3025ca+=0x1){_0x3025ca>0x0&&(_0x549b58+='\x20'+_0x2cc6c2[_0xedc9('0x66')]+'\x20');_0x549b58+=_0x2cc6c2[_0xedc9('0x65')][_0x3025ca]['group']?_0x5723a1(_0x2cc6c2[_0xedc9('0x65')][_0x3025ca][_0xedc9('0x67')]):_0x2cc6c2[_0xedc9('0x65')][_0x3025ca][_0xedc9('0x75')]+'\x20'+_0x2cc6c2['rules'][_0x3025ca][_0xedc9('0x68')]+(_0x28e0ee(_0x2cc6c2['rules'][_0x3025ca][_0xedc9('0x68')])?'\x20'+_0x2cc6c2[_0xedc9('0x65')][_0x3025ca][_0xedc9('0x69')]:'');}return _0x549b58+')';};var _0x4927ee={'where':{'id':_0x1711ef['id']}},_0x31d909,_0x1b5828,_0x1e5cfe,_0x5f1357,_0x214bc7;_0x4927ee=_[_0xedc9('0x43')]({},_0x4927ee,_0x1875d5);return db['AnalyticDefaultReport']['find'](_0x4927ee)[_0xedc9('0x22')](function(_0x511928){if(_0x511928){_0x31d909=_0x511928;return _0x511928[_0xedc9('0x88')]();}return null;})[_0xedc9('0x22')](function(_0x286238){if(_0x286238){if(!_0x286238[_0xedc9('0x38')]){throw new db[(_0xedc9('0x89'))][(_0xedc9('0x6a'))](_0xedc9('0x8a'),0x193);}_0x1b5828=_0x286238;return db[_0xedc9('0x8b')]['findAll']({'raw':!![]});}return null;})[_0xedc9('0x22')](function(_0x58628e){if(_0x58628e){_0x1e5cfe=_[_0xedc9('0x6b')](_0x58628e,'id');var _0x1912b2;var _0x2efdf2=squel[_0xedc9('0x6c')]();_0x2efdf2['from'](_0x31d909[_0xedc9('0x6d')]);for(var _0x268e3a=0x0;_0x268e3a<_0x1b5828['length'];_0x268e3a+=0x1){_0x1912b2=_0x1b5828[_0x268e3a]['MetricId']?_0x1e5cfe[_0x1b5828[_0x268e3a][_0xedc9('0x6e')]][_0xedc9('0x8c')]:_0x1b5828[_0x268e3a][_0xedc9('0x75')];_0x1912b2=_0x1b5828[_0x268e3a][_0xedc9('0x6f')]?_['replace'](_0x33ad4e[_0x1b5828[_0x268e3a]['function']],'%s',_0x1912b2):_0x1912b2;_0x1912b2=_0x1b5828[_0x268e3a][_0xedc9('0x71')]?_[_0xedc9('0x70')](_0x1e3a3d[_0x1b5828[_0x268e3a][_0xedc9('0x71')]],'%s',_0x1912b2):_0x1912b2;if(_0x1b5828[_0x268e3a]['groupBy']){_0x2efdf2[_0xedc9('0x67')](_0x1912b2);}_0x1b5828[_0x268e3a][_0xedc9('0x73')]&&_0x2efdf2[_0xedc9('0x3c')](_0x1912b2,_0x1b5828[_0x268e3a][_0xedc9('0x73')]===_0xedc9('0x74')?![]:!![]);_0x2efdf2[_0xedc9('0x75')](_0x1912b2,_0x1b5828[_0x268e3a][_0xedc9('0x76')]||_0x1912b2);}if(_0x31d909[_0xedc9('0x77')]){_0x31d909[_0xedc9('0x77')]=JSON['parse'](_0x31d909[_0xedc9('0x77')]);for(var _0x570e10=0x0;_0x570e10<_0x31d909[_0xedc9('0x77')][_0xedc9('0x38')];_0x570e10+=0x1){if(_0x31d909[_0xedc9('0x77')][_0x570e10][_0xedc9('0x41')]&&_['includes'](_0x3c9532,_0x31d909['joins'][_0x570e10][_0xedc9('0x41')])&&_0x31d909[_0xedc9('0x77')][_0x570e10][_0xedc9('0x79')]&&_0x31d909[_0xedc9('0x77')][_0x570e10]['foreignTable']&&_0x31d909['joins'][_0x570e10][_0xedc9('0x7b')]){_0x2efdf2[_0x31d909[_0xedc9('0x77')][_0x570e10][_0xedc9('0x41')]](_0x31d909[_0xedc9('0x77')][_0x570e10][_0xedc9('0x7a')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x31d909[_0xedc9('0x6d')],_0x31d909[_0xedc9('0x77')][_0x570e10][_0xedc9('0x79')],_0x31d909[_0xedc9('0x77')][_0x570e10][_0xedc9('0x7a')],_0x31d909[_0xedc9('0x77')][_0x570e10][_0xedc9('0x7b')]));}}}if(_0x31d909[_0xedc9('0x7d')]){_0x31d909['conditions']=JSON[_0xedc9('0x78')](_0x31d909['conditions']);_0x2efdf2[_0xedc9('0x3e')](_0x5723a1(_0x31d909[_0xedc9('0x7d')][_0xedc9('0x67')]));}_0x214bc7=_0x2efdf2[_0xedc9('0x7e')]();_0x2efdf2[_0xedc9('0x3b')](_0x844763);_0x2efdf2[_0xedc9('0x1b')](0x0);logger[_0xedc9('0x8d')](_0xedc9('0x7f'),_0x2efdf2[_0xedc9('0x81')]());return db[_0xedc9('0x80')]['query'](_0x2efdf2[_0xedc9('0x81')](),{'type':db[_0xedc9('0x80')][_0xedc9('0x82')]['SELECT']});}})[_0xedc9('0x22')](function(_0x342e0a){if(!_0x342e0a['length']){throw new db[(_0xedc9('0x89'))][(_0xedc9('0x6a'))](_0xedc9('0x8e'),0xcc);}if(_0x387b9b[_0xedc9('0x8f')]===_0xedc9('0x90')){return null;}var _0x36835d=_[_0xedc9('0x43')](_0x387b9b,{'name':_0x387b9b[_0xedc9('0x91')]||_0x387b9b[_0xedc9('0x29')]||_0x31d909['name'],'basename':_0x4e2c53,'savename':util[_0xedc9('0x71')](_0xedc9('0x92'),_0x387b9b['name']||_0x31d909['name'],require(_0xedc9('0x93'))[_0xedc9('0x94')](0x4),_0x387b9b['output']||_0xedc9('0x95')),'reportId':_0x31d909['id'],'reportType':_0xedc9('0x96')});return db[_0xedc9('0x97')][_0xedc9('0x4b')](_0x36835d,{'raw':!![]});})['then'](function(_0x626620){if(_0x31d909[_0xedc9('0x6d')]===_0xedc9('0x98')){_0x214bc7['where'](_0x31d909['table']+_0xedc9('0x99'),_0x387b9b[_0xedc9('0x9a')],_0x387b9b['endDate']);}else{_0x214bc7[_0xedc9('0x3e')](_0x31d909[_0xedc9('0x6d')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x387b9b[_0xedc9('0x9a')],_0x387b9b[_0xedc9('0x9b')]);}if(_0x626620){logger[_0xedc9('0x9c')]('Run\x20Query:',_0x214bc7['toString']());require(_0xedc9('0x9d'))[_0xedc9('0x9e')](path[_0xedc9('0x53')](__dirname,'../../components/export/',_0x626620[_0xedc9('0x8f')]),[_0x626620['id'],_0x214bc7['toString'](),path[_0xedc9('0x53')](__dirname,_0xedc9('0x9f'),_0x626620[_0xedc9('0xa0')]),_0x4e2c53]);return _0x626620;}else{var _0x5bf7d2=squel[_0xedc9('0x6c')]();_0x5bf7d2[_0xedc9('0xa1')]('('+_0x214bc7[_0xedc9('0x81')]()+')',_0xedc9('0xa2'));_0x5bf7d2[_0xedc9('0x75')](_0xedc9('0xa3'),_0xedc9('0x1a'));_0x214bc7['limit'](_0x387b9b['limit']||_0x844763);_0x214bc7['offset'](_0x387b9b['offset']||0x0);return db[_0xedc9('0x80')][_0xedc9('0x31')](_0x5bf7d2[_0xedc9('0x81')](),{'type':db[_0xedc9('0x80')][_0xedc9('0x82')]['SELECT']})[_0xedc9('0x22')](function(_0x261f15){if(!_0x261f15['length']){_0x5f1357=0x0;}else{_0x5f1357=_0x261f15[0x0]['count']||0x0;}return db[_0xedc9('0x80')][_0xedc9('0x31')](_0x214bc7[_0xedc9('0x81')](),{'type':db[_0xedc9('0x80')][_0xedc9('0x82')]['SELECT']});})[_0xedc9('0x22')](function(_0x2ca714){return{'rows':_0x2ca714||[],'count':_0x5f1357};});}});}exports[_0xedc9('0xa4')]=function(_0x485132,_0x1daf2b){return runReport(_0x485132[_0xedc9('0x47')],_0x485132['query'],_0x485132[_0xedc9('0x49')])[_0xedc9('0x22')](respondWithResult(_0x1daf2b,null))[_0xedc9('0x51')](handleError(_0x1daf2b,null));};exports['runReport']=runReport;exports[_0xedc9('0x31')]=function(_0x12ff88,_0xc61147){var _0x2d9ae5=0xa;var _0x325981=[_0xedc9('0x53'),_0xedc9('0x84'),'right_join','cross_join'];var _0x56f032={'SUM':_0xedc9('0x56'),'COUNT':_0xedc9('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xedc9('0x85'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xedc9('0x5a'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xfcf038={'SEC_TO_TIME':_0xedc9('0x5d'),'DATE':'DATE(%s)','HOUR':_0xedc9('0x5e'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0xedc9('0xa5')};var _0x3e9608=function(_0x26785a){return!_[_0xedc9('0x60')]([_0xedc9('0x61'),'IS\x20NOT\x20NULL',_0xedc9('0x63'),'IS\x20NOT\x20EMPTY'],_0x26785a);};var _0x3bc7f8=function(_0x1a12c5){if(!_0x1a12c5||!_0x1a12c5[_0xedc9('0x65')][_0xedc9('0x38')]){return'';}for(var _0x361572='(',_0x2d23df=0x0;_0x2d23df<_0x1a12c5['rules']['length'];_0x2d23df+=0x1){_0x2d23df>0x0&&(_0x361572+='\x20'+_0x1a12c5[_0xedc9('0x66')]+'\x20');_0x361572+=_0x1a12c5['rules'][_0x2d23df][_0xedc9('0x67')]?_0x3bc7f8(_0x1a12c5[_0xedc9('0x65')][_0x2d23df][_0xedc9('0x67')]):_0x1a12c5[_0xedc9('0x65')][_0x2d23df][_0xedc9('0x75')]+'\x20'+_0x1a12c5[_0xedc9('0x65')][_0x2d23df]['condition']+(_0x3e9608(_0x1a12c5[_0xedc9('0x65')][_0x2d23df]['condition'])?'\x20'+_0x1a12c5[_0xedc9('0x65')][_0x2d23df][_0xedc9('0x69')]:'');}return _0x361572+')';};var _0x38cbfc={'where':{'id':_0x12ff88[_0xedc9('0x47')]['id']}},_0xb2bb9a,_0x586f6,_0x474516,_0x1612ee,_0x50fa9e;_0x38cbfc=_[_0xedc9('0x43')]({},_0x38cbfc,_0x12ff88['options']);return db[_0xedc9('0x2d')]['find'](_0x38cbfc)['then'](function(_0xd2815a){if(_0xd2815a){_0xb2bb9a=_0xd2815a;return _0xd2815a[_0xedc9('0x88')]();}return null;})['then'](function(_0x3d4d49){if(_0x3d4d49){if(!_0x3d4d49[_0xedc9('0x38')]){throw new db['Sequelize']['ValidationErrorItem'](_0xedc9('0x8a'),0x193);}_0x586f6=_0x3d4d49;return db['AnalyticMetric'][_0xedc9('0x45')]({'raw':!![]});}return null;})[_0xedc9('0x22')](function(_0x12d51c){if(_0x12d51c){_0x474516=_[_0xedc9('0x6b')](_0x12d51c,'id');var _0xfe7f0c;var _0x22a7cc=squel[_0xedc9('0x6c')]();_0x22a7cc[_0xedc9('0xa1')](_0xb2bb9a['table']);for(var _0x494f2d=0x0;_0x494f2d<_0x586f6[_0xedc9('0x38')];_0x494f2d+=0x1){_0xfe7f0c=_0x586f6[_0x494f2d]['MetricId']?_0x474516[_0x586f6[_0x494f2d][_0xedc9('0x6e')]][_0xedc9('0x8c')]:_0x586f6[_0x494f2d][_0xedc9('0x75')];_0xfe7f0c=_0x586f6[_0x494f2d]['function']?_[_0xedc9('0x70')](_0x56f032[_0x586f6[_0x494f2d][_0xedc9('0x6f')]],'%s',_0xfe7f0c):_0xfe7f0c;_0xfe7f0c=_0x586f6[_0x494f2d][_0xedc9('0x71')]?_[_0xedc9('0x70')](_0xfcf038[_0x586f6[_0x494f2d][_0xedc9('0x71')]],'%s',_0xfe7f0c):_0xfe7f0c;if(_0x586f6[_0x494f2d][_0xedc9('0x72')]){_0x22a7cc[_0xedc9('0x67')](_0xfe7f0c);}_0x586f6[_0x494f2d][_0xedc9('0x73')]&&_0x22a7cc['order'](_0xfe7f0c,_0x586f6[_0x494f2d][_0xedc9('0x73')]===_0xedc9('0x74')?![]:!![]);_0x22a7cc[_0xedc9('0x75')](_0xfe7f0c,_0x586f6[_0x494f2d][_0xedc9('0x76')]||_0xfe7f0c);}if(_0xb2bb9a['joins']){_0xb2bb9a['joins']=JSON['parse'](_0xb2bb9a['joins']);for(var _0x86d18d=0x0;_0x86d18d<_0xb2bb9a[_0xedc9('0x77')][_0xedc9('0x38')];_0x86d18d+=0x1){if(_0xb2bb9a[_0xedc9('0x77')][_0x86d18d][_0xedc9('0x41')]&&_[_0xedc9('0x60')](_0x325981,_0xb2bb9a['joins'][_0x86d18d][_0xedc9('0x41')])&&_0xb2bb9a[_0xedc9('0x77')][_0x86d18d][_0xedc9('0x79')]&&_0xb2bb9a['joins'][_0x86d18d][_0xedc9('0x7a')]&&_0xb2bb9a[_0xedc9('0x77')][_0x86d18d][_0xedc9('0x7b')]){_0x22a7cc[_0xb2bb9a[_0xedc9('0x77')][_0x86d18d][_0xedc9('0x41')]](_0xb2bb9a[_0xedc9('0x77')][_0x86d18d][_0xedc9('0x7a')],null,util[_0xedc9('0x71')](_0xedc9('0x7c'),_0xb2bb9a[_0xedc9('0x6d')],_0xb2bb9a['joins'][_0x86d18d][_0xedc9('0x79')],_0xb2bb9a['joins'][_0x86d18d][_0xedc9('0x7a')],_0xb2bb9a[_0xedc9('0x77')][_0x86d18d][_0xedc9('0x7b')]));}}}if(_0xb2bb9a[_0xedc9('0x7d')]){_0xb2bb9a[_0xedc9('0x7d')]=JSON[_0xedc9('0x78')](_0xb2bb9a[_0xedc9('0x7d')]);_0x22a7cc['where'](_0x3bc7f8(_0xb2bb9a[_0xedc9('0x7d')][_0xedc9('0x67')]));}_0x50fa9e=_0x22a7cc['clone']();_0x22a7cc[_0xedc9('0x3b')](_0x2d9ae5);_0x22a7cc['offset'](0x0);logger[_0xedc9('0x8d')](_0xedc9('0x7f'),_0x22a7cc[_0xedc9('0x81')]());return db[_0xedc9('0x80')]['query'](_0x22a7cc[_0xedc9('0x81')](),{'type':db[_0xedc9('0x80')][_0xedc9('0x82')]['SELECT']});}})[_0xedc9('0x22')](function(){return{'sql':_0x50fa9e['toString']()};})[_0xedc9('0x22')](respondWithResult(_0xc61147,null))[_0xedc9('0x51')](handleError(_0xc61147,null));}; \ No newline at end of file +var _0xac3c=['conditions','parse','clone','debug','toString','sequelize','SELECT','right_join','cross_join','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','IS\x20EMPTY','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','groupBy','table','Limited\x20Query:','QueryTypes','No\x20available\x20data','output','fullPath','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','Run\x20Query:','child_process','fork','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','DefaultReports','UserProfileResource','sendStatus','stack','name','send','index','AnalyticDefaultReport','rawAttributes','type','key','map','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','user','role','Reports','userProfileId','preview','join','left_join','SUM(%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)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','keyBy','select','from','MetricId','metric','function','replace','format','orderBy','DESC','alias','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey'];(function(_0x2adb6b,_0x336bfd){var _0x363413=function(_0x1f7a3d){while(--_0x1f7a3d){_0x2adb6b['push'](_0x2adb6b['shift']());}};_0x363413(++_0x336bfd);}(_0xac3c,0xce));var _0xcac3=function(_0x227064,_0x276055){_0x227064=_0x227064-0x0;var _0x49baf8=_0xac3c[_0x227064];return _0x49baf8;};'use strict';var pdf=require(_0xcac3('0x0'));var emlformat=require(_0xcac3('0x1'));var rimraf=require(_0xcac3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcac3('0x3'));var rp=require('request-promise');var moment=require(_0xcac3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcac3('0x5'));var util=require('util');var path=require(_0xcac3('0x6'));var sox=require(_0xcac3('0x7'));var csv=require(_0xcac3('0x8'));var ejs=require(_0xcac3('0x9'));var fs=require('fs');var _=require(_0xcac3('0xa'));var squel=require(_0xcac3('0xb'));var crypto=require(_0xcac3('0xc'));var jsforce=require(_0xcac3('0xd'));var deskjs=require(_0xcac3('0xe'));var toCsv=require(_0xcac3('0x8'));var querystring=require(_0xcac3('0xf'));var Papa=require(_0xcac3('0x10'));var Redis=require(_0xcac3('0x11'));var authService=require(_0xcac3('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xcac3('0x13'));var hardwareService=require(_0xcac3('0x14'));var logger=require('../../config/logger')(_0xcac3('0x15'));var utils=require(_0xcac3('0x16'));var config=require('../../config/environment');var db=require(_0xcac3('0x17'))['db'];function respondWithStatusCode(_0x49fbce,_0xd93bbb){_0xd93bbb=_0xd93bbb||0xcc;return function(_0x40f48a){if(_0x40f48a){return _0x49fbce['sendStatus'](_0xd93bbb);}return _0x49fbce[_0xcac3('0x18')](_0xd93bbb)[_0xcac3('0x19')]();};}function respondWithResult(_0x195a98,_0x466d63){_0x466d63=_0x466d63||0xc8;return function(_0x21d89f){if(_0x21d89f){return _0x195a98[_0xcac3('0x18')](_0x466d63)[_0xcac3('0x1a')](_0x21d89f);}};}function respondWithFilteredResult(_0x2bbf21,_0x1a58b6){return function(_0xdb107a){if(_0xdb107a){var _0x15963b=_0xdb107a[_0xcac3('0x1b')],_0x3815a5=_0x1a58b6[_0xcac3('0x1c')],_0x87922e=_0x1a58b6[_0xcac3('0x1c')]+_0x1a58b6[_0xcac3('0x1d')],_0x4c1747;if(_0x87922e>=_0x15963b){_0x87922e=_0x15963b;_0x4c1747=0xc8;}else{_0x4c1747=0xce;}_0x2bbf21[_0xcac3('0x18')](_0x4c1747);return _0x2bbf21[_0xcac3('0x1e')](_0xcac3('0x1f'),_0x3815a5+'-'+_0x87922e+'/'+_0x15963b)['json'](_0xdb107a);}return null;};}function patchUpdates(_0x12b6f0){return function(_0x3c4f97){try{jsonpatch[_0xcac3('0x20')](_0x3c4f97,_0x12b6f0,!![]);}catch(_0x4aaa95){return BPromise['reject'](_0x4aaa95);}return _0x3c4f97['save']();};}function saveUpdates(_0x4bf4f2,_0x2f2b7a){return function(_0x574e87){if(_0x574e87){return _0x574e87[_0xcac3('0x21')](_0x4bf4f2)[_0xcac3('0x22')](function(_0x233f4a){return _0x233f4a;});}return null;};}function removeEntity(_0x1e50b5,_0x296e2f){return function(_0x18a4c4){if(_0x18a4c4){return _0x18a4c4[_0xcac3('0x23')]()[_0xcac3('0x22')](function(){var _0xd27004=_0x18a4c4[_0xcac3('0x24')]({'plain':!![]});var _0x18e406=_0xcac3('0x25');return db[_0xcac3('0x26')][_0xcac3('0x23')]({'where':{'type':_0x18e406,'resourceId':_0xd27004['id']}})[_0xcac3('0x22')](function(){return _0x18a4c4;});})[_0xcac3('0x22')](function(){_0x1e50b5[_0xcac3('0x18')](0xcc)[_0xcac3('0x19')]();});}};}function handleEntityNotFound(_0x141765,_0x1deb7b){return function(_0x435944){if(!_0x435944){_0x141765[_0xcac3('0x27')](0x194);}return _0x435944;};}function handleError(_0x3c445a,_0x17b591){_0x17b591=_0x17b591||0x1f4;return function(_0x20aabe){logger['error'](_0x20aabe[_0xcac3('0x28')]);if(_0x20aabe[_0xcac3('0x29')]){delete _0x20aabe[_0xcac3('0x29')];}_0x3c445a[_0xcac3('0x18')](_0x17b591)[_0xcac3('0x2a')](_0x20aabe);};}exports[_0xcac3('0x2b')]=function(_0x1f79d5,_0x39a66a){var _0x263831={},_0x1e9d95={},_0x2b7591={'count':0x0,'rows':[]};var _0x291d84=_['map'](db[_0xcac3('0x2c')][_0xcac3('0x2d')],function(_0x544980){return{'name':_0x544980['fieldName'],'type':_0x544980[_0xcac3('0x2e')][_0xcac3('0x2f')]};});_0x1e9d95['model']=_[_0xcac3('0x30')](_0x291d84,'name');_0x1e9d95[_0xcac3('0x31')]=_[_0xcac3('0x32')](_0x1f79d5[_0xcac3('0x31')]);_0x1e9d95['filters']=_[_0xcac3('0x33')](_0x1e9d95[_0xcac3('0x34')],_0x1e9d95[_0xcac3('0x31')]);_0x263831[_0xcac3('0x35')]=_[_0xcac3('0x33')](_0x1e9d95[_0xcac3('0x34')],qs['fields'](_0x1f79d5['query'][_0xcac3('0x36')]));_0x263831[_0xcac3('0x35')]=_0x263831[_0xcac3('0x35')][_0xcac3('0x37')]?_0x263831['attributes']:_0x1e9d95['model'];if(!_0x1f79d5[_0xcac3('0x31')][_0xcac3('0x38')](_0xcac3('0x39'))){_0x263831[_0xcac3('0x1d')]=qs[_0xcac3('0x1d')](_0x1f79d5[_0xcac3('0x31')][_0xcac3('0x1d')]);_0x263831[_0xcac3('0x1c')]=qs[_0xcac3('0x1c')](_0x1f79d5[_0xcac3('0x31')][_0xcac3('0x1c')]);}_0x263831[_0xcac3('0x3a')]=qs[_0xcac3('0x3b')](_0x1f79d5[_0xcac3('0x31')][_0xcac3('0x3b')]);_0x263831['where']=qs[_0xcac3('0x3c')](_[_0xcac3('0x3d')](_0x1f79d5[_0xcac3('0x31')],_0x1e9d95['filters']));if(_0x1f79d5['query'][_0xcac3('0x3e')]){_0x263831[_0xcac3('0x3f')]=_[_0xcac3('0x40')](_0x263831[_0xcac3('0x3f')],{'$or':_[_0xcac3('0x30')](_0x291d84,function(_0x3e6ff7){if(_0x3e6ff7[_0xcac3('0x2e')]!=='VIRTUAL'){var _0x27bdbb={};_0x27bdbb[_0x3e6ff7[_0xcac3('0x29')]]={'$like':'%'+_0x1f79d5[_0xcac3('0x31')][_0xcac3('0x3e')]+'%'};return _0x27bdbb;}})});}_0x263831=_[_0xcac3('0x40')]({},_0x263831,_0x1f79d5[_0xcac3('0x41')]);var _0x455bb7={'where':_0x263831[_0xcac3('0x3f')]};return db['AnalyticDefaultReport'][_0xcac3('0x1b')](_0x455bb7)['then'](function(_0x30ac50){_0x2b7591[_0xcac3('0x1b')]=_0x30ac50;if(_0x1f79d5[_0xcac3('0x31')][_0xcac3('0x42')]){_0x263831[_0xcac3('0x43')]=[{'all':!![]}];}return db['AnalyticDefaultReport'][_0xcac3('0x44')](_0x263831);})[_0xcac3('0x22')](function(_0x4118e4){_0x2b7591['rows']=_0x4118e4;return _0x2b7591;})[_0xcac3('0x22')](respondWithFilteredResult(_0x39a66a,_0x263831))[_0xcac3('0x45')](handleError(_0x39a66a,null));};exports[_0xcac3('0x46')]=function(_0x544f09,_0x2f680d){var _0x4926c3={'raw':!![],'where':{'id':_0x544f09[_0xcac3('0x47')]['id']}},_0x4c636f={};_0x4c636f[_0xcac3('0x34')]=_[_0xcac3('0x32')](db['AnalyticDefaultReport'][_0xcac3('0x2d')]);_0x4c636f[_0xcac3('0x31')]=_[_0xcac3('0x32')](_0x544f09[_0xcac3('0x31')]);_0x4c636f[_0xcac3('0x3c')]=_[_0xcac3('0x33')](_0x4c636f[_0xcac3('0x34')],_0x4c636f[_0xcac3('0x31')]);_0x4926c3[_0xcac3('0x35')]=_[_0xcac3('0x33')](_0x4c636f[_0xcac3('0x34')],qs['fields'](_0x544f09[_0xcac3('0x31')]['fields']));_0x4926c3[_0xcac3('0x35')]=_0x4926c3[_0xcac3('0x35')]['length']?_0x4926c3[_0xcac3('0x35')]:_0x4c636f['model'];if(_0x544f09[_0xcac3('0x31')]['includeAll']){_0x4926c3[_0xcac3('0x43')]=[{'all':!![]}];}_0x4926c3=_['merge']({},_0x4926c3,_0x544f09[_0xcac3('0x41')]);return db['AnalyticDefaultReport'][_0xcac3('0x48')](_0x4926c3)[_0xcac3('0x22')](handleEntityNotFound(_0x2f680d,null))[_0xcac3('0x22')](respondWithResult(_0x2f680d,null))['catch'](handleError(_0x2f680d,null));};exports[_0xcac3('0x49')]=function(_0x26515e,_0x45850b){return db[_0xcac3('0x2c')][_0xcac3('0x49')](_0x26515e[_0xcac3('0x4a')],{})[_0xcac3('0x22')](function(_0x528498){var _0x7e38dc=_0x26515e[_0xcac3('0x4b')][_0xcac3('0x24')]({'plain':!![]});if(!_0x7e38dc)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x7e38dc[_0xcac3('0x4c')]===_0xcac3('0x4b')){var _0x3a7afc=_0x528498[_0xcac3('0x24')]({'plain':!![]});var _0x5587ae=_0xcac3('0x4d');return db['UserProfileSection'][_0xcac3('0x48')]({'where':{'name':_0x5587ae,'userProfileId':_0x7e38dc[_0xcac3('0x4e')]},'raw':!![]})['then'](function(_0x3b9a33){if(_0x3b9a33&&_0x3b9a33['autoAssociation']===0x0){return db[_0xcac3('0x26')]['create']({'name':_0x3a7afc[_0xcac3('0x29')],'resourceId':_0x3a7afc['id'],'type':_0xcac3('0x25'),'sectionId':_0x3b9a33['id']},{})['then'](function(){return _0x528498;});}else{return _0x528498;}})['catch'](function(_0x4bfa72){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4bfa72);throw _0x4bfa72;});}return _0x528498;})['then'](respondWithResult(_0x45850b,0xc9))[_0xcac3('0x45')](handleError(_0x45850b,null));};exports['update']=function(_0x2fd4a4,_0x443d5a){if(_0x2fd4a4[_0xcac3('0x4a')]['id']){delete _0x2fd4a4['body']['id'];}return db[_0xcac3('0x2c')][_0xcac3('0x48')]({'where':{'id':_0x2fd4a4[_0xcac3('0x47')]['id']}})['then'](handleEntityNotFound(_0x443d5a,null))[_0xcac3('0x22')](saveUpdates(_0x2fd4a4['body'],null))['then'](respondWithResult(_0x443d5a,null))[_0xcac3('0x45')](handleError(_0x443d5a,null));};exports['destroy']=function(_0x5974ad,_0x38accc){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x5974ad['params']['id']}})[_0xcac3('0x22')](handleEntityNotFound(_0x38accc,null))['then'](removeEntity(_0x38accc,null))[_0xcac3('0x45')](handleError(_0x38accc,null));};exports[_0xcac3('0x4f')]=function(_0x319be7,_0x592a01){var _0x51fc5c=0xa;var _0x803db8=[_0xcac3('0x50'),_0xcac3('0x51'),'right_join','cross_join'];var _0x2a16a0={'SUM':_0xcac3('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xcac3('0x53'),'AVG':_0xcac3('0x54'),'GROUP_CONCAT':_0xcac3('0x55'),'GROUP_CONCAT ASC':_0xcac3('0x56'),'GROUP_CONCAT DESC':_0xcac3('0x57')};var _0x4e320b={'SEC_TO_TIME':_0xcac3('0x58'),'DATE':_0xcac3('0x59'),'HOUR':'HOUR(%s)','ROUND':_0xcac3('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4c5c7e=function(_0x1ffcf7){return!_[_0xcac3('0x5b')]([_0xcac3('0x5c'),_0xcac3('0x5d'),'IS\x20EMPTY',_0xcac3('0x5e')],_0x1ffcf7);};var _0x51ef2c=function(_0x45b4ce){if(!_0x45b4ce||!_0x45b4ce[_0xcac3('0x5f')][_0xcac3('0x37')]){return'';}for(var _0x4f5557='(',_0x114150=0x0;_0x114150<_0x45b4ce[_0xcac3('0x5f')]['length'];_0x114150+=0x1){_0x114150>0x0&&(_0x4f5557+='\x20'+_0x45b4ce[_0xcac3('0x60')]+'\x20');_0x4f5557+=_0x45b4ce[_0xcac3('0x5f')][_0x114150][_0xcac3('0x61')]?_0x51ef2c(_0x45b4ce[_0xcac3('0x5f')][_0x114150]['group']):_0x45b4ce[_0xcac3('0x5f')][_0x114150][_0xcac3('0x62')]+'\x20'+_0x45b4ce[_0xcac3('0x5f')][_0x114150]['condition']+(_0x4c5c7e(_0x45b4ce[_0xcac3('0x5f')][_0x114150][_0xcac3('0x63')])?'\x20'+_0x45b4ce[_0xcac3('0x5f')][_0x114150][_0xcac3('0x64')]:'');}return _0x4f5557+')';};var _0x25b6ef={'where':{'id':_0x319be7[_0xcac3('0x47')]['id']}},_0x4ec02c,_0x5530c3,_0x2af365,_0x4726a5,_0x1dfc22;_0x25b6ef=_[_0xcac3('0x40')]({},_0x25b6ef,_0x319be7[_0xcac3('0x41')]);return db[_0xcac3('0x2c')][_0xcac3('0x48')](_0x25b6ef)[_0xcac3('0x22')](function(_0xed7cb8){if(_0xed7cb8){_0x4ec02c=_0xed7cb8;return _0xed7cb8[_0xcac3('0x65')]();}return null;})[_0xcac3('0x22')](function(_0x116bf9){if(_0x116bf9){if(!_0x116bf9[_0xcac3('0x37')]){throw new db[(_0xcac3('0x66'))][(_0xcac3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x5530c3=_0x116bf9;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xcac3('0x22')](function(_0x430e0c){if(_0x430e0c){_0x2af365=_[_0xcac3('0x68')](_0x430e0c,'id');var _0x10de0d;var _0x3caa84=squel[_0xcac3('0x69')]();_0x3caa84[_0xcac3('0x6a')](_0x4ec02c['table']);for(var _0x1fd42e=0x0;_0x1fd42e<_0x5530c3[_0xcac3('0x37')];_0x1fd42e+=0x1){_0x10de0d=_0x5530c3[_0x1fd42e][_0xcac3('0x6b')]?_0x2af365[_0x5530c3[_0x1fd42e]['MetricId']][_0xcac3('0x6c')]:_0x5530c3[_0x1fd42e]['field'];_0x10de0d=_0x5530c3[_0x1fd42e][_0xcac3('0x6d')]?_[_0xcac3('0x6e')](_0x2a16a0[_0x5530c3[_0x1fd42e][_0xcac3('0x6d')]],'%s',_0x10de0d):_0x10de0d;_0x10de0d=_0x5530c3[_0x1fd42e][_0xcac3('0x6f')]?_[_0xcac3('0x6e')](_0x4e320b[_0x5530c3[_0x1fd42e]['format']],'%s',_0x10de0d):_0x10de0d;if(_0x5530c3[_0x1fd42e]['groupBy']){_0x3caa84[_0xcac3('0x61')](_0x10de0d);}_0x5530c3[_0x1fd42e][_0xcac3('0x70')]&&_0x3caa84[_0xcac3('0x3a')](_0x10de0d,_0x5530c3[_0x1fd42e][_0xcac3('0x70')]===_0xcac3('0x71')?![]:!![]);_0x3caa84[_0xcac3('0x62')](_0x10de0d,_0x5530c3[_0x1fd42e][_0xcac3('0x72')]||_0x10de0d);}if(_0x4ec02c[_0xcac3('0x73')]){_0x4ec02c['joins']=JSON['parse'](_0x4ec02c[_0xcac3('0x73')]);for(var _0x46c667=0x0;_0x46c667<_0x4ec02c['joins'][_0xcac3('0x37')];_0x46c667+=0x1){if(_0x4ec02c['joins'][_0x46c667]['type']&&_['includes'](_0x803db8,_0x4ec02c[_0xcac3('0x73')][_0x46c667][_0xcac3('0x2e')])&&_0x4ec02c[_0xcac3('0x73')][_0x46c667]['parentKey']&&_0x4ec02c['joins'][_0x46c667][_0xcac3('0x74')]&&_0x4ec02c[_0xcac3('0x73')][_0x46c667][_0xcac3('0x75')]){_0x3caa84[_0x4ec02c[_0xcac3('0x73')][_0x46c667][_0xcac3('0x2e')]](_0x4ec02c[_0xcac3('0x73')][_0x46c667]['foreignTable'],null,util[_0xcac3('0x6f')](_0xcac3('0x76'),_0x4ec02c['table'],_0x4ec02c[_0xcac3('0x73')][_0x46c667][_0xcac3('0x77')],_0x4ec02c[_0xcac3('0x73')][_0x46c667][_0xcac3('0x74')],_0x4ec02c['joins'][_0x46c667]['foreignKey']));}}}if(_0x4ec02c['conditions']){_0x4ec02c[_0xcac3('0x78')]=JSON[_0xcac3('0x79')](_0x4ec02c[_0xcac3('0x78')]);_0x3caa84[_0xcac3('0x3f')](_0x51ef2c(_0x4ec02c[_0xcac3('0x78')]['group']));}_0x1dfc22=_0x3caa84[_0xcac3('0x7a')]();_0x3caa84['limit'](_0x51fc5c);_0x3caa84[_0xcac3('0x1c')](0x0);logger[_0xcac3('0x7b')]('Limited\x20Query:',_0x3caa84[_0xcac3('0x7c')]());return db[_0xcac3('0x7d')][_0xcac3('0x31')](_0x3caa84[_0xcac3('0x7c')](),{'type':db[_0xcac3('0x7d')]['QueryTypes'][_0xcac3('0x7e')]});}})[_0xcac3('0x22')](respondWithResult(_0x592a01,null))[_0xcac3('0x45')](handleError(_0x592a01,null));};function runReport(_0x54f1bb,_0x1b6686,_0x5e4212){var _0x37bde0=_0x1b6686[_0xcac3('0x29')];var _0x95f06=0xa;var _0x107b51=[_0xcac3('0x50'),_0xcac3('0x51'),_0xcac3('0x7f'),_0xcac3('0x80')];var _0x1e994d={'SUM':_0xcac3('0x52'),'COUNT':_0xcac3('0x81'),'COUNT DISTINCT':_0xcac3('0x82'),'MAX':_0xcac3('0x83'),'MIN':_0xcac3('0x53'),'AVG':_0xcac3('0x54'),'GROUP_CONCAT':_0xcac3('0x55'),'GROUP_CONCAT ASC':_0xcac3('0x56'),'GROUP_CONCAT DESC':_0xcac3('0x57')};var _0x5bd65b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcac3('0x59'),'HOUR':_0xcac3('0x84'),'ROUND':_0xcac3('0x5a'),'UNIX_TIMESTAMP':_0xcac3('0x85')};var _0x2eefa4=function(_0x197f1c){return!_[_0xcac3('0x5b')]([_0xcac3('0x5c'),_0xcac3('0x5d'),_0xcac3('0x86'),_0xcac3('0x5e')],_0x197f1c);};var _0x3a009f=function(_0x321eae){if(!_0x321eae||!_0x321eae[_0xcac3('0x5f')][_0xcac3('0x37')]){return'';}for(var _0x21b474='(',_0x10293b=0x0;_0x10293b<_0x321eae[_0xcac3('0x5f')][_0xcac3('0x37')];_0x10293b+=0x1){_0x10293b>0x0&&(_0x21b474+='\x20'+_0x321eae[_0xcac3('0x60')]+'\x20');_0x21b474+=_0x321eae[_0xcac3('0x5f')][_0x10293b]['group']?_0x3a009f(_0x321eae[_0xcac3('0x5f')][_0x10293b][_0xcac3('0x61')]):_0x321eae[_0xcac3('0x5f')][_0x10293b][_0xcac3('0x62')]+'\x20'+_0x321eae[_0xcac3('0x5f')][_0x10293b]['condition']+(_0x2eefa4(_0x321eae[_0xcac3('0x5f')][_0x10293b][_0xcac3('0x63')])?'\x20'+_0x321eae[_0xcac3('0x5f')][_0x10293b][_0xcac3('0x64')]:'');}return _0x21b474+')';};var _0x57b39c={'where':{'id':_0x54f1bb['id']}},_0xdaba59,_0x53316d,_0x115956,_0x422339,_0x2ef671;_0x57b39c=_[_0xcac3('0x40')]({},_0x57b39c,_0x5e4212);return db[_0xcac3('0x2c')]['find'](_0x57b39c)[_0xcac3('0x22')](function(_0x498973){if(_0x498973){_0xdaba59=_0x498973;return _0x498973['getFields']();}return null;})[_0xcac3('0x22')](function(_0x4f47fe){if(_0x4f47fe){if(!_0x4f47fe[_0xcac3('0x37')]){throw new db[(_0xcac3('0x66'))][(_0xcac3('0x67'))](_0xcac3('0x87'),0x193);}_0x53316d=_0x4f47fe;return db[_0xcac3('0x88')]['findAll']({'raw':!![]});}return null;})['then'](function(_0x1cffd6){if(_0x1cffd6){_0x115956=_[_0xcac3('0x68')](_0x1cffd6,'id');var _0x243c71;var _0x3766f3=squel[_0xcac3('0x69')]();_0x3766f3[_0xcac3('0x6a')](_0xdaba59['table']);for(var _0x200f66=0x0;_0x200f66<_0x53316d[_0xcac3('0x37')];_0x200f66+=0x1){_0x243c71=_0x53316d[_0x200f66][_0xcac3('0x6b')]?_0x115956[_0x53316d[_0x200f66][_0xcac3('0x6b')]][_0xcac3('0x6c')]:_0x53316d[_0x200f66]['field'];_0x243c71=_0x53316d[_0x200f66][_0xcac3('0x6d')]?_['replace'](_0x1e994d[_0x53316d[_0x200f66][_0xcac3('0x6d')]],'%s',_0x243c71):_0x243c71;_0x243c71=_0x53316d[_0x200f66]['format']?_[_0xcac3('0x6e')](_0x5bd65b[_0x53316d[_0x200f66][_0xcac3('0x6f')]],'%s',_0x243c71):_0x243c71;if(_0x53316d[_0x200f66][_0xcac3('0x89')]){_0x3766f3[_0xcac3('0x61')](_0x243c71);}_0x53316d[_0x200f66][_0xcac3('0x70')]&&_0x3766f3[_0xcac3('0x3a')](_0x243c71,_0x53316d[_0x200f66][_0xcac3('0x70')]===_0xcac3('0x71')?![]:!![]);_0x3766f3[_0xcac3('0x62')](_0x243c71,_0x53316d[_0x200f66][_0xcac3('0x72')]||_0x243c71);}if(_0xdaba59[_0xcac3('0x73')]){_0xdaba59[_0xcac3('0x73')]=JSON[_0xcac3('0x79')](_0xdaba59[_0xcac3('0x73')]);for(var _0x30a33f=0x0;_0x30a33f<_0xdaba59[_0xcac3('0x73')][_0xcac3('0x37')];_0x30a33f+=0x1){if(_0xdaba59[_0xcac3('0x73')][_0x30a33f][_0xcac3('0x2e')]&&_[_0xcac3('0x5b')](_0x107b51,_0xdaba59['joins'][_0x30a33f][_0xcac3('0x2e')])&&_0xdaba59[_0xcac3('0x73')][_0x30a33f][_0xcac3('0x77')]&&_0xdaba59[_0xcac3('0x73')][_0x30a33f][_0xcac3('0x74')]&&_0xdaba59[_0xcac3('0x73')][_0x30a33f][_0xcac3('0x75')]){_0x3766f3[_0xdaba59[_0xcac3('0x73')][_0x30a33f][_0xcac3('0x2e')]](_0xdaba59[_0xcac3('0x73')][_0x30a33f][_0xcac3('0x74')],null,util[_0xcac3('0x6f')](_0xcac3('0x76'),_0xdaba59[_0xcac3('0x8a')],_0xdaba59['joins'][_0x30a33f][_0xcac3('0x77')],_0xdaba59[_0xcac3('0x73')][_0x30a33f][_0xcac3('0x74')],_0xdaba59[_0xcac3('0x73')][_0x30a33f][_0xcac3('0x75')]));}}}if(_0xdaba59['conditions']){_0xdaba59[_0xcac3('0x78')]=JSON[_0xcac3('0x79')](_0xdaba59[_0xcac3('0x78')]);_0x3766f3[_0xcac3('0x3f')](_0x3a009f(_0xdaba59[_0xcac3('0x78')][_0xcac3('0x61')]));}_0x2ef671=_0x3766f3[_0xcac3('0x7a')]();_0x3766f3[_0xcac3('0x1d')](_0x95f06);_0x3766f3[_0xcac3('0x1c')](0x0);logger[_0xcac3('0x7b')](_0xcac3('0x8b'),_0x3766f3['toString']());return db[_0xcac3('0x7d')]['query'](_0x3766f3[_0xcac3('0x7c')](),{'type':db[_0xcac3('0x7d')][_0xcac3('0x8c')][_0xcac3('0x7e')]});}})[_0xcac3('0x22')](function(_0x4717c7){if(!_0x4717c7[_0xcac3('0x37')]){throw new db[(_0xcac3('0x66'))][(_0xcac3('0x67'))](_0xcac3('0x8d'),0xcc);}if(_0x1b6686[_0xcac3('0x8e')]==='web'){return null;}var _0x55cac1=_[_0xcac3('0x40')](_0x1b6686,{'name':_0x1b6686[_0xcac3('0x8f')]||_0x1b6686['name']||_0xdaba59[_0xcac3('0x29')],'basename':_0x37bde0,'savename':util[_0xcac3('0x6f')]('%s-%s.%s',_0x1b6686[_0xcac3('0x29')]||_0xdaba59['name'],require(_0xcac3('0x90'))[_0xcac3('0x91')](0x4),_0x1b6686[_0xcac3('0x8e')]||_0xcac3('0x92')),'reportId':_0xdaba59['id'],'reportType':_0xcac3('0x93')});return db[_0xcac3('0x94')][_0xcac3('0x49')](_0x55cac1,{'raw':!![]});})[_0xcac3('0x22')](function(_0x665d1c){if(_0xdaba59['table']===_0xcac3('0x95')){_0x2ef671['where'](_0xdaba59[_0xcac3('0x8a')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1b6686[_0xcac3('0x96')],_0x1b6686[_0xcac3('0x97')]);}else{_0x2ef671['where'](_0xdaba59['table']+_0xcac3('0x98'),_0x1b6686['startDate'],_0x1b6686['endDate']);}if(_0x665d1c){logger['info'](_0xcac3('0x99'),_0x2ef671[_0xcac3('0x7c')]());require(_0xcac3('0x9a'))[_0xcac3('0x9b')](path['join'](__dirname,_0xcac3('0x9c'),_0x665d1c['output']),[_0x665d1c['id'],_0x2ef671[_0xcac3('0x7c')](),path[_0xcac3('0x50')](__dirname,_0xcac3('0x9d'),_0x665d1c[_0xcac3('0x9e')]),_0x37bde0]);return _0x665d1c;}else{var _0x2aca2f=squel[_0xcac3('0x69')]();_0x2aca2f[_0xcac3('0x6a')]('('+_0x2ef671[_0xcac3('0x7c')]()+')',_0xcac3('0x9f'));_0x2aca2f[_0xcac3('0x62')](_0xcac3('0xa0'),_0xcac3('0x1b'));_0x2ef671[_0xcac3('0x1d')](_0x1b6686[_0xcac3('0x1d')]||_0x95f06);_0x2ef671['offset'](_0x1b6686[_0xcac3('0x1c')]||0x0);return db[_0xcac3('0x7d')][_0xcac3('0x31')](_0x2aca2f['toString'](),{'type':db[_0xcac3('0x7d')][_0xcac3('0x8c')][_0xcac3('0x7e')]})[_0xcac3('0x22')](function(_0x38f958){if(!_0x38f958[_0xcac3('0x37')]){_0x422339=0x0;}else{_0x422339=_0x38f958[0x0][_0xcac3('0x1b')]||0x0;}return db[_0xcac3('0x7d')][_0xcac3('0x31')](_0x2ef671[_0xcac3('0x7c')](),{'type':db[_0xcac3('0x7d')][_0xcac3('0x8c')][_0xcac3('0x7e')]});})[_0xcac3('0x22')](function(_0xd2994a){return{'rows':_0xd2994a||[],'count':_0x422339};});}});}exports[_0xcac3('0xa1')]=function(_0x28421d,_0x5dd83d){return runReport(_0x28421d[_0xcac3('0x47')],_0x28421d[_0xcac3('0x31')],_0x28421d[_0xcac3('0x41')])[_0xcac3('0x22')](respondWithResult(_0x5dd83d,null))[_0xcac3('0x45')](handleError(_0x5dd83d,null));};exports[_0xcac3('0xa2')]=runReport;exports['query']=function(_0x4ec7db,_0x4aec77){var _0xfd56c5=0xa;var _0xf5f4e1=['join',_0xcac3('0x51'),'right_join','cross_join'];var _0x2243dc={'SUM':_0xcac3('0x52'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0xcac3('0x53'),'AVG':'AVG(%s)','GROUP_CONCAT':_0xcac3('0x55'),'GROUP_CONCAT ASC':_0xcac3('0x56'),'GROUP_CONCAT DESC':_0xcac3('0x57')};var _0x2dde5f={'SEC_TO_TIME':_0xcac3('0x58'),'DATE':_0xcac3('0x59'),'HOUR':_0xcac3('0x84'),'ROUND':_0xcac3('0x5a'),'UNIX_TIMESTAMP':_0xcac3('0x85')};var _0x42f718=function(_0x4488f8){return!_[_0xcac3('0x5b')]([_0xcac3('0x5c'),_0xcac3('0x5d'),_0xcac3('0x86'),'IS\x20NOT\x20EMPTY'],_0x4488f8);};var _0x5d6cec=function(_0x39f741){if(!_0x39f741||!_0x39f741[_0xcac3('0x5f')]['length']){return'';}for(var _0x3e4b23='(',_0x35feb7=0x0;_0x35feb7<_0x39f741['rules'][_0xcac3('0x37')];_0x35feb7+=0x1){_0x35feb7>0x0&&(_0x3e4b23+='\x20'+_0x39f741[_0xcac3('0x60')]+'\x20');_0x3e4b23+=_0x39f741[_0xcac3('0x5f')][_0x35feb7][_0xcac3('0x61')]?_0x5d6cec(_0x39f741[_0xcac3('0x5f')][_0x35feb7][_0xcac3('0x61')]):_0x39f741[_0xcac3('0x5f')][_0x35feb7]['field']+'\x20'+_0x39f741[_0xcac3('0x5f')][_0x35feb7][_0xcac3('0x63')]+(_0x42f718(_0x39f741[_0xcac3('0x5f')][_0x35feb7][_0xcac3('0x63')])?'\x20'+_0x39f741['rules'][_0x35feb7][_0xcac3('0x64')]:'');}return _0x3e4b23+')';};var _0x4f6e09={'where':{'id':_0x4ec7db[_0xcac3('0x47')]['id']}},_0x18ed2f,_0xe853e7,_0x2ceffd,_0x3b05e7,_0x2da062;_0x4f6e09=_[_0xcac3('0x40')]({},_0x4f6e09,_0x4ec7db[_0xcac3('0x41')]);return db[_0xcac3('0x2c')][_0xcac3('0x48')](_0x4f6e09)[_0xcac3('0x22')](function(_0x484230){if(_0x484230){_0x18ed2f=_0x484230;return _0x484230['getFields']();}return null;})[_0xcac3('0x22')](function(_0x2e7b2d){if(_0x2e7b2d){if(!_0x2e7b2d[_0xcac3('0x37')]){throw new db['Sequelize'][(_0xcac3('0x67'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xe853e7=_0x2e7b2d;return db[_0xcac3('0x88')][_0xcac3('0x44')]({'raw':!![]});}return null;})[_0xcac3('0x22')](function(_0x5ab794){if(_0x5ab794){_0x2ceffd=_[_0xcac3('0x68')](_0x5ab794,'id');var _0x259b93;var _0x33215b=squel[_0xcac3('0x69')]();_0x33215b[_0xcac3('0x6a')](_0x18ed2f[_0xcac3('0x8a')]);for(var _0x3557ea=0x0;_0x3557ea<_0xe853e7[_0xcac3('0x37')];_0x3557ea+=0x1){_0x259b93=_0xe853e7[_0x3557ea]['MetricId']?_0x2ceffd[_0xe853e7[_0x3557ea][_0xcac3('0x6b')]][_0xcac3('0x6c')]:_0xe853e7[_0x3557ea]['field'];_0x259b93=_0xe853e7[_0x3557ea][_0xcac3('0x6d')]?_[_0xcac3('0x6e')](_0x2243dc[_0xe853e7[_0x3557ea][_0xcac3('0x6d')]],'%s',_0x259b93):_0x259b93;_0x259b93=_0xe853e7[_0x3557ea][_0xcac3('0x6f')]?_['replace'](_0x2dde5f[_0xe853e7[_0x3557ea][_0xcac3('0x6f')]],'%s',_0x259b93):_0x259b93;if(_0xe853e7[_0x3557ea][_0xcac3('0x89')]){_0x33215b['group'](_0x259b93);}_0xe853e7[_0x3557ea][_0xcac3('0x70')]&&_0x33215b['order'](_0x259b93,_0xe853e7[_0x3557ea][_0xcac3('0x70')]==='DESC'?![]:!![]);_0x33215b[_0xcac3('0x62')](_0x259b93,_0xe853e7[_0x3557ea][_0xcac3('0x72')]||_0x259b93);}if(_0x18ed2f[_0xcac3('0x73')]){_0x18ed2f[_0xcac3('0x73')]=JSON[_0xcac3('0x79')](_0x18ed2f[_0xcac3('0x73')]);for(var _0x5395c0=0x0;_0x5395c0<_0x18ed2f['joins'][_0xcac3('0x37')];_0x5395c0+=0x1){if(_0x18ed2f[_0xcac3('0x73')][_0x5395c0][_0xcac3('0x2e')]&&_[_0xcac3('0x5b')](_0xf5f4e1,_0x18ed2f[_0xcac3('0x73')][_0x5395c0][_0xcac3('0x2e')])&&_0x18ed2f[_0xcac3('0x73')][_0x5395c0][_0xcac3('0x77')]&&_0x18ed2f[_0xcac3('0x73')][_0x5395c0]['foreignTable']&&_0x18ed2f['joins'][_0x5395c0][_0xcac3('0x75')]){_0x33215b[_0x18ed2f['joins'][_0x5395c0][_0xcac3('0x2e')]](_0x18ed2f[_0xcac3('0x73')][_0x5395c0]['foreignTable'],null,util['format'](_0xcac3('0x76'),_0x18ed2f[_0xcac3('0x8a')],_0x18ed2f[_0xcac3('0x73')][_0x5395c0][_0xcac3('0x77')],_0x18ed2f[_0xcac3('0x73')][_0x5395c0][_0xcac3('0x74')],_0x18ed2f[_0xcac3('0x73')][_0x5395c0][_0xcac3('0x75')]));}}}if(_0x18ed2f[_0xcac3('0x78')]){_0x18ed2f['conditions']=JSON[_0xcac3('0x79')](_0x18ed2f[_0xcac3('0x78')]);_0x33215b['where'](_0x5d6cec(_0x18ed2f[_0xcac3('0x78')]['group']));}_0x2da062=_0x33215b[_0xcac3('0x7a')]();_0x33215b['limit'](_0xfd56c5);_0x33215b[_0xcac3('0x1c')](0x0);logger[_0xcac3('0x7b')](_0xcac3('0x8b'),_0x33215b[_0xcac3('0x7c')]());return db[_0xcac3('0x7d')]['query'](_0x33215b['toString'](),{'type':db[_0xcac3('0x7d')]['QueryTypes'][_0xcac3('0x7e')]});}})['then'](function(){return{'sql':_0x2da062[_0xcac3('0x7c')]()};})[_0xcac3('0x22')](respondWithResult(_0x4aec77,null))['catch'](handleError(_0x4aec77,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 08cd789..eabdb6f 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 _0x341a=['../../config/environment','./analyticDefaultReport.attributes','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5bdf7f,_0x49a2f4){var _0x1a0b5d=function(_0x55599d){while(--_0x55599d){_0x5bdf7f['push'](_0x5bdf7f['shift']());}};_0x1a0b5d(++_0x49a2f4);}(_0x341a,0xa0));var _0xa341=function(_0x489815,_0x5ccdb1){_0x489815=_0x489815-0x0;var _0x444c8e=_0x341a[_0x489815];return _0x444c8e;};'use strict';var _=require(_0xa341('0x0'));var util=require(_0xa341('0x1'));var logger=require(_0xa341('0x2'))(_0xa341('0x3'));var moment=require(_0xa341('0x4'));var BPromise=require(_0xa341('0x5'));var rp=require(_0xa341('0x6'));var fs=require('fs');var path=require(_0xa341('0x7'));var rimraf=require(_0xa341('0x8'));var config=require(_0xa341('0x9'));var attributes=require(_0xa341('0xa'));module['exports']=function(_0x190f02,_0x37a16a){return _0x190f02['define'](_0xa341('0xb'),attributes,{'tableName':_0xa341('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9831=['../../config/environment','exports','define','AnalyticDefaultReport','analytics_default_reports','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x2ae2ad,_0xac5b0c){var _0x26dbd7=function(_0x5e685b){while(--_0x5e685b){_0x2ae2ad['push'](_0x2ae2ad['shift']());}};_0x26dbd7(++_0xac5b0c);}(_0x9831,0xfc));var _0x1983=function(_0xc34d7,_0x3cbef6){_0xc34d7=_0xc34d7-0x0;var _0x28150b=_0x9831[_0xc34d7];return _0x28150b;};'use strict';var _=require(_0x1983('0x0'));var util=require(_0x1983('0x1'));var logger=require(_0x1983('0x2'))(_0x1983('0x3'));var moment=require(_0x1983('0x4'));var BPromise=require('bluebird');var rp=require(_0x1983('0x5'));var fs=require('fs');var path=require(_0x1983('0x6'));var rimraf=require(_0x1983('0x7'));var config=require(_0x1983('0x8'));var attributes=require('./analyticDefaultReport.attributes');module[_0x1983('0x9')]=function(_0x4771ac,_0xf07948){return _0x4771ac[_0x1983('0xa')](_0x1983('0xb'),attributes,{'tableName':_0x1983('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js b/server/api/analyticDefaultReport/analyticDefaultReport.rpc.js index 2c9ff0b..bb82693 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 _0x135b=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x3af5f6,_0x57b854){var _0x1934eb=function(_0x4b214d){while(--_0x4b214d){_0x3af5f6['push'](_0x3af5f6['shift']());}};_0x1934eb(++_0x57b854);}(_0x135b,0xaf));var _0xb135=function(_0x589c08,_0x264b33){_0x589c08=_0x589c08-0x0;var _0xc21d72=_0x135b[_0x589c08];return _0xc21d72;};'use strict';var _=require(_0xb135('0x0'));var util=require(_0xb135('0x1'));var moment=require(_0xb135('0x2'));var BPromise=require(_0xb135('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb135('0x4'));var db=require(_0xb135('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb135('0x6'))(_0xb135('0x7'));var config=require(_0xb135('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x11780d,_0x2c061e,_0x2b57dd){return new BPromise(function(_0xdc547c,_0x4e0148){return client[_0xb135('0x9')](_0x11780d,_0x2b57dd)[_0xb135('0xa')](function(_0xe5ab67){logger[_0xb135('0xb')](_0xb135('0xc'),_0x2c061e,_0xb135('0xd'));logger[_0xb135('0xe')](_0xb135('0xf'),_0x2c061e,_0xb135('0xd'),JSON[_0xb135('0x10')](_0xe5ab67));if(_0xe5ab67[_0xb135('0x11')]){if(_0xe5ab67[_0xb135('0x11')][_0xb135('0x12')]===0x1f4){logger[_0xb135('0x11')](_0xb135('0xc'),_0x2c061e,_0xe5ab67[_0xb135('0x11')][_0xb135('0x13')]);return _0x4e0148(_0xe5ab67[_0xb135('0x11')][_0xb135('0x13')]);}logger['error'](_0xb135('0xc'),_0x2c061e,_0xe5ab67['error'][_0xb135('0x13')]);return _0xdc547c(_0xe5ab67[_0xb135('0x11')][_0xb135('0x13')]);}else{logger[_0xb135('0xb')](_0xb135('0xc'),_0x2c061e,_0xb135('0xd'));_0xdc547c(_0xe5ab67[_0xb135('0x14')][_0xb135('0x13')]);}})[_0xb135('0x15')](function(_0x4ff564){logger[_0xb135('0x11')](_0xb135('0xc'),_0x2c061e,_0x4ff564);_0x4e0148(_0x4ff564);});});} \ No newline at end of file +var _0xee5b=['../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','ioredis'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xee5b,0x1f4));var _0xbee5=function(_0x5cd4fb,_0x5df52c){_0x5cd4fb=_0x5cd4fb-0x0;var _0x121457=_0xee5b[_0x5cd4fb];return _0x121457;};'use strict';var _=require(_0xbee5('0x0'));var util=require('util');var moment=require(_0xbee5('0x1'));var BPromise=require(_0xbee5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbee5('0x3'));var db=require(_0xbee5('0x4'))['db'];var utils=require(_0xbee5('0x5'));var logger=require(_0xbee5('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbee5('0x7'));var client=jayson[_0xbee5('0x8')][_0xbee5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x804ab8,_0x4f5065,_0x5505e3){return new BPromise(function(_0x53d5b9,_0x5baf5c){return client['request'](_0x804ab8,_0x5505e3)[_0xbee5('0xa')](function(_0x7dda04){logger[_0xbee5('0xb')](_0xbee5('0xc'),_0x4f5065,'request\x20sent');logger[_0xbee5('0xd')](_0xbee5('0xe'),_0x4f5065,_0xbee5('0xf'),JSON[_0xbee5('0x10')](_0x7dda04));if(_0x7dda04[_0xbee5('0x11')]){if(_0x7dda04[_0xbee5('0x11')][_0xbee5('0x12')]===0x1f4){logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error'][_0xbee5('0x13')]);return _0x5baf5c(_0x7dda04['error'][_0xbee5('0x13')]);}logger[_0xbee5('0x11')](_0xbee5('0xc'),_0x4f5065,_0x7dda04['error']['message']);return _0x53d5b9(_0x7dda04[_0xbee5('0x11')]['message']);}else{logger[_0xbee5('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4f5065,_0xbee5('0xf'));_0x53d5b9(_0x7dda04[_0xbee5('0x14')][_0xbee5('0x13')]);}})['catch'](function(_0x27e034){logger[_0xbee5('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4f5065,_0x27e034);_0x5baf5c(_0x27e034);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 3d85c1a..d4dde91 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 _0x43bd=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/preview','/:id/run','/:id/query','post','create','put','delete','destroy'];(function(_0x4179b3,_0x2eaff2){var _0x5b5c7e=function(_0x568341){while(--_0x568341){_0x4179b3['push'](_0x4179b3['shift']());}};_0x5b5c7e(++_0x2eaff2);}(_0x43bd,0xdd));var _0xd43b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x43bd[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0xd43b('0x0'));var util=require(_0xd43b('0x1'));var path=require(_0xd43b('0x2'));var timeout=require(_0xd43b('0x3'));var express=require(_0xd43b('0x4'));var router=express[_0xd43b('0x5')]();var auth=require(_0xd43b('0x6'));var interaction=require(_0xd43b('0x7'));var config=require('../../config/environment');var controller=require('./analyticDefaultReport.controller');router[_0xd43b('0x8')]('/',auth[_0xd43b('0x9')](),controller[_0xd43b('0xa')]);router[_0xd43b('0x8')](_0xd43b('0xb'),auth['isAuthenticated'](),controller[_0xd43b('0xc')]);router['get'](_0xd43b('0xd'),auth[_0xd43b('0x9')](),controller['preview']);router[_0xd43b('0x8')](_0xd43b('0xe'),auth[_0xd43b('0x9')](),controller['run']);router[_0xd43b('0x8')](_0xd43b('0xf'),auth[_0xd43b('0x9')](),controller['query']);router[_0xd43b('0x10')]('/',auth[_0xd43b('0x9')](),controller[_0xd43b('0x11')]);router[_0xd43b('0x12')](_0xd43b('0xb'),auth[_0xd43b('0x9')](),controller['update']);router[_0xd43b('0x13')](_0xd43b('0xb'),auth['isAuthenticated'](),controller[_0xd43b('0x14')]);module[_0xd43b('0x15')]=router; \ No newline at end of file +var _0x8474=['get','/:id','/:id/preview','preview','run','/:id/query','query','post','create','put','delete','destroy','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index'];(function(_0x2f87cd,_0xcaf299){var _0x5d7eda=function(_0x37ffb0){while(--_0x37ffb0){_0x2f87cd['push'](_0x2f87cd['shift']());}};_0x5d7eda(++_0xcaf299);}(_0x8474,0x1db));var _0x4847=function(_0x1a1d4c,_0x1b5245){_0x1a1d4c=_0x1a1d4c-0x0;var _0x20e782=_0x8474[_0x1a1d4c];return _0x20e782;};'use strict';var multer=require(_0x4847('0x0'));var util=require(_0x4847('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4847('0x2'));var router=express['Router']();var auth=require(_0x4847('0x3'));var interaction=require(_0x4847('0x4'));var config=require(_0x4847('0x5'));var controller=require('./analyticDefaultReport.controller');router['get']('/',auth[_0x4847('0x6')](),controller[_0x4847('0x7')]);router[_0x4847('0x8')](_0x4847('0x9'),auth[_0x4847('0x6')](),controller['show']);router[_0x4847('0x8')](_0x4847('0xa'),auth['isAuthenticated'](),controller[_0x4847('0xb')]);router[_0x4847('0x8')]('/:id/run',auth[_0x4847('0x6')](),controller[_0x4847('0xc')]);router[_0x4847('0x8')](_0x4847('0xd'),auth[_0x4847('0x6')](),controller[_0x4847('0xe')]);router[_0x4847('0xf')]('/',auth['isAuthenticated'](),controller[_0x4847('0x10')]);router[_0x4847('0x11')]('/:id',auth[_0x4847('0x6')](),controller['update']);router[_0x4847('0x12')](_0x4847('0x9'),auth[_0x4847('0x6')](),controller[_0x4847('0x13')]);module[_0x4847('0x14')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index 339e777..4f3b4bb 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 _0xaad8=['sequelize','moment','exports','STRING','ENUM','csv','pdf','xlsx','DATE','manual','scheduled','INTEGER'];(function(_0x5bbd87,_0x4692d1){var _0xa4a83c=function(_0x2d9933){while(--_0x2d9933){_0x5bbd87['push'](_0x5bbd87['shift']());}};_0xa4a83c(++_0x4692d1);}(_0xaad8,0xb4));var _0x8aad=function(_0x5a7120,_0x4cf680){_0x5a7120=_0x5a7120-0x0;var _0x3a41cc=_0xaad8[_0x5a7120];return _0x3a41cc;};'use strict';var Sequelize=require(_0x8aad('0x0'));var moment=require(_0x8aad('0x1'));module[_0x8aad('0x2')]={'name':{'type':Sequelize[_0x8aad('0x3')],'allowNull':![]},'basename':{'type':Sequelize[_0x8aad('0x3')],'allowNull':![]},'output':{'type':Sequelize[_0x8aad('0x4')](_0x8aad('0x5'),_0x8aad('0x6'),_0x8aad('0x7')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x8aad('0x8')]},'endDate':{'type':Sequelize[_0x8aad('0x8')]},'status':{'type':Sequelize[_0x8aad('0x3')],'defaultValue':'Loading'},'type':{'type':Sequelize[_0x8aad('0x4')](_0x8aad('0x9'),_0x8aad('0xa')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x8aad('0xb')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x8aad('0x3')]}}; \ No newline at end of file +var _0x0477=['UNSIGNED','sequelize','moment','STRING','ENUM','csv','pdf','DATE','Loading','manual','scheduled','INTEGER'];(function(_0x5243de,_0x6378ad){var _0x3f5337=function(_0x43e622){while(--_0x43e622){_0x5243de['push'](_0x5243de['shift']());}};_0x3f5337(++_0x6378ad);}(_0x0477,0xd9));var _0x7047=function(_0x5ec454,_0xfcd77e){_0x5ec454=_0x5ec454-0x0;var _0x5ebf50=_0x0477[_0x5ec454];return _0x5ebf50;};'use strict';var Sequelize=require(_0x7047('0x0'));var moment=require(_0x7047('0x1'));module['exports']={'name':{'type':Sequelize[_0x7047('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x7047('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x7047('0x3')](_0x7047('0x4'),_0x7047('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x7047('0x4')},'savename':{'type':Sequelize[_0x7047('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0x7047('0x6')]},'endDate':{'type':Sequelize[_0x7047('0x6')]},'status':{'type':Sequelize[_0x7047('0x2')],'defaultValue':_0x7047('0x7')},'type':{'type':Sequelize[_0x7047('0x3')](_0x7047('0x8'),_0x7047('0x9')),'allowNull':![],'defaultValue':_0x7047('0x8')},'reportId':{'type':Sequelize[_0x7047('0xa')](0xb)[_0x7047('0xb')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 12826e0..939d928 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 _0xe329=['userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','download','basename','savename','output','root','server/files/reports','Sequelize','ValidationError','exists','join','format','%s.%s','toLowerCase','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','limit','reject','update','then','ExtractedReports','UserProfileResource','stack','name','send','index','map','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','AnalyticExtractedReport','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x1348d5,_0x11d4a1){var _0x2705b4=function(_0x1ecd57){while(--_0x1ecd57){_0x1348d5['push'](_0x1348d5['shift']());}};_0x2705b4(++_0x11d4a1);}(_0xe329,0x71));var _0x9e32=function(_0x36e659,_0xed68b0){_0x36e659=_0x36e659-0x0;var _0x2cbbaa=_0xe329[_0x36e659];return _0x2cbbaa;};'use strict';var pdf=require(_0x9e32('0x0'));var emlformat=require(_0x9e32('0x1'));var rimraf=require(_0x9e32('0x2'));var zipdir=require(_0x9e32('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9e32('0x4'));var moment=require('moment');var BPromise=require(_0x9e32('0x5'));var Mustache=require(_0x9e32('0x6'));var util=require('util');var path=require(_0x9e32('0x7'));var sox=require(_0x9e32('0x8'));var csv=require(_0x9e32('0x9'));var ejs=require(_0x9e32('0xa'));var fs=require('fs');var _=require(_0x9e32('0xb'));var squel=require(_0x9e32('0xc'));var crypto=require('crypto');var jsforce=require(_0x9e32('0xd'));var deskjs=require(_0x9e32('0xe'));var toCsv=require(_0x9e32('0x9'));var querystring=require(_0x9e32('0xf'));var Papa=require(_0x9e32('0x10'));var Redis=require(_0x9e32('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9e32('0x12'));var logger=require(_0x9e32('0x13'))(_0x9e32('0x14'));var utils=require(_0x9e32('0x15'));var config=require(_0x9e32('0x16'));var db=require(_0x9e32('0x17'))['db'];function respondWithStatusCode(_0x8b27e6,_0x169290){_0x169290=_0x169290||0xcc;return function(_0x4712e4){if(_0x4712e4){return _0x8b27e6[_0x9e32('0x18')](_0x169290);}return _0x8b27e6['status'](_0x169290)[_0x9e32('0x19')]();};}function respondWithResult(_0x286fb5,_0xb0642d){_0xb0642d=_0xb0642d||0xc8;return function(_0x2d89ed){if(_0x2d89ed){return _0x286fb5[_0x9e32('0x1a')](_0xb0642d)[_0x9e32('0x1b')](_0x2d89ed);}};}function respondWithFilteredResult(_0x300a23,_0x35af8a){return function(_0x3309b0){if(_0x3309b0){var _0x49ec7d=_0x3309b0['count'],_0x23679f=_0x35af8a['offset'],_0x1088d2=_0x35af8a['offset']+_0x35af8a[_0x9e32('0x1c')],_0x728229;if(_0x1088d2>=_0x49ec7d){_0x1088d2=_0x49ec7d;_0x728229=0xc8;}else{_0x728229=0xce;}_0x300a23[_0x9e32('0x1a')](_0x728229);return _0x300a23['set']('Content-Range',_0x23679f+'-'+_0x1088d2+'/'+_0x49ec7d)[_0x9e32('0x1b')](_0x3309b0);}return null;};}function patchUpdates(_0x454b3e){return function(_0x56ff85){try{jsonpatch['apply'](_0x56ff85,_0x454b3e,!![]);}catch(_0x79e364){return BPromise[_0x9e32('0x1d')](_0x79e364);}return _0x56ff85['save']();};}function saveUpdates(_0xc4ae07,_0x21a5ad){return function(_0x41c51b){if(_0x41c51b){return _0x41c51b[_0x9e32('0x1e')](_0xc4ae07)[_0x9e32('0x1f')](function(_0x31ed84){return _0x31ed84;});}return null;};}function removeEntity(_0x2c4d5b,_0x3a68a0){return function(_0x3463f4){if(_0x3463f4){return _0x3463f4['destroy']()[_0x9e32('0x1f')](function(){var _0x34eb7a=_0x3463f4['get']({'plain':!![]});var _0x5c5926=_0x9e32('0x20');return db[_0x9e32('0x21')]['destroy']({'where':{'type':_0x5c5926,'resourceId':_0x34eb7a['id']}})[_0x9e32('0x1f')](function(){return _0x3463f4;});})['then'](function(){_0x2c4d5b[_0x9e32('0x1a')](0xcc)[_0x9e32('0x19')]();});}};}function handleEntityNotFound(_0x4f1a6b,_0x2a4440){return function(_0x34de65){if(!_0x34de65){_0x4f1a6b[_0x9e32('0x18')](0x194);}return _0x34de65;};}function handleError(_0x329637,_0x5c2248){_0x5c2248=_0x5c2248||0x1f4;return function(_0x1f793b){logger['error'](_0x1f793b[_0x9e32('0x22')]);if(_0x1f793b[_0x9e32('0x23')]){delete _0x1f793b['name'];}_0x329637[_0x9e32('0x1a')](_0x5c2248)[_0x9e32('0x24')](_0x1f793b);};}exports[_0x9e32('0x25')]=function(_0x4ecf39,_0x396a57){var _0x12ddf2={},_0x2d61b8={},_0xddbaf9={'count':0x0,'rows':[]};var _0x2300e9=_[_0x9e32('0x26')](db['AnalyticExtractedReport'][_0x9e32('0x27')],function(_0x44677a){return{'name':_0x44677a[_0x9e32('0x28')],'type':_0x44677a['type']['key']};});_0x2d61b8['model']=_['map'](_0x2300e9,_0x9e32('0x23'));_0x2d61b8[_0x9e32('0x29')]=_[_0x9e32('0x2a')](_0x4ecf39['query']);_0x2d61b8[_0x9e32('0x2b')]=_[_0x9e32('0x2c')](_0x2d61b8[_0x9e32('0x2d')],_0x2d61b8[_0x9e32('0x29')]);_0x12ddf2['attributes']=_[_0x9e32('0x2c')](_0x2d61b8[_0x9e32('0x2d')],qs[_0x9e32('0x2e')](_0x4ecf39[_0x9e32('0x29')][_0x9e32('0x2e')]));_0x12ddf2[_0x9e32('0x2f')]=_0x12ddf2[_0x9e32('0x2f')][_0x9e32('0x30')]?_0x12ddf2['attributes']:_0x2d61b8[_0x9e32('0x2d')];if(!_0x4ecf39[_0x9e32('0x29')][_0x9e32('0x31')](_0x9e32('0x32'))){_0x12ddf2[_0x9e32('0x1c')]=qs[_0x9e32('0x1c')](_0x4ecf39[_0x9e32('0x29')][_0x9e32('0x1c')]);_0x12ddf2['offset']=qs[_0x9e32('0x33')](_0x4ecf39[_0x9e32('0x29')][_0x9e32('0x33')]);}_0x12ddf2[_0x9e32('0x34')]=qs[_0x9e32('0x35')](_0x4ecf39['query'][_0x9e32('0x35')]);_0x12ddf2[_0x9e32('0x36')]=qs[_0x9e32('0x2b')](_[_0x9e32('0x37')](_0x4ecf39[_0x9e32('0x29')],_0x2d61b8[_0x9e32('0x2b')]));if(_0x4ecf39[_0x9e32('0x29')][_0x9e32('0x38')]){_0x12ddf2['where']=_[_0x9e32('0x39')](_0x12ddf2[_0x9e32('0x36')],{'$or':_[_0x9e32('0x26')](_0x2300e9,function(_0x4f7ad3){if(_0x4f7ad3[_0x9e32('0x3a')]!==_0x9e32('0x3b')){var _0x3a3330={};_0x3a3330[_0x4f7ad3[_0x9e32('0x23')]]={'$like':'%'+_0x4ecf39['query']['filter']+'%'};return _0x3a3330;}})});}_0x12ddf2=_[_0x9e32('0x39')]({},_0x12ddf2,_0x4ecf39['options']);var _0x1c1844={'where':_0x12ddf2[_0x9e32('0x36')]};return db['AnalyticExtractedReport']['count'](_0x1c1844)[_0x9e32('0x1f')](function(_0x5c5ac2){_0xddbaf9['count']=_0x5c5ac2;if(_0x4ecf39[_0x9e32('0x29')][_0x9e32('0x3c')]){_0x12ddf2[_0x9e32('0x3d')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0x9e32('0x3e')](_0x12ddf2);})[_0x9e32('0x1f')](function(_0x467588){_0xddbaf9[_0x9e32('0x3f')]=_0x467588;return _0xddbaf9;})[_0x9e32('0x1f')](respondWithFilteredResult(_0x396a57,_0x12ddf2))[_0x9e32('0x40')](handleError(_0x396a57,null));};exports['show']=function(_0x38b047,_0x474b74){var _0x16d19b={'raw':!![],'where':{'id':_0x38b047[_0x9e32('0x41')]['id']}},_0x449330={};_0x449330[_0x9e32('0x2d')]=_[_0x9e32('0x2a')](db[_0x9e32('0x42')]['rawAttributes']);_0x449330['query']=_[_0x9e32('0x2a')](_0x38b047['query']);_0x449330['filters']=_['intersection'](_0x449330['model'],_0x449330[_0x9e32('0x29')]);_0x16d19b[_0x9e32('0x2f')]=_['intersection'](_0x449330['model'],qs[_0x9e32('0x2e')](_0x38b047['query'][_0x9e32('0x2e')]));_0x16d19b[_0x9e32('0x2f')]=_0x16d19b['attributes'][_0x9e32('0x30')]?_0x16d19b[_0x9e32('0x2f')]:_0x449330['model'];if(_0x38b047[_0x9e32('0x29')][_0x9e32('0x3c')]){_0x16d19b['include']=[{'all':!![]}];}_0x16d19b=_[_0x9e32('0x39')]({},_0x16d19b,_0x38b047[_0x9e32('0x43')]);return db[_0x9e32('0x42')][_0x9e32('0x44')](_0x16d19b)['then'](handleEntityNotFound(_0x474b74,null))[_0x9e32('0x1f')](respondWithResult(_0x474b74,null))[_0x9e32('0x40')](handleError(_0x474b74,null));};exports[_0x9e32('0x45')]=function(_0x5ec65e,_0x4da2f4){return db[_0x9e32('0x42')][_0x9e32('0x45')](_0x5ec65e['body'],{})[_0x9e32('0x1f')](function(_0x34322a){var _0x19392a=_0x5ec65e[_0x9e32('0x46')][_0x9e32('0x47')]({'plain':!![]});if(!_0x19392a)throw new Error(_0x9e32('0x48'));if(_0x19392a[_0x9e32('0x49')]==='user'){var _0x2a60cc=_0x34322a['get']({'plain':!![]});var _0x262e2a=_0x9e32('0x20');return db[_0x9e32('0x4a')]['find']({'where':{'name':_0x262e2a,'userProfileId':_0x19392a[_0x9e32('0x4b')]},'raw':!![]})['then'](function(_0x1dada1){if(_0x1dada1&&_0x1dada1[_0x9e32('0x4c')]===0x0){return db[_0x9e32('0x21')][_0x9e32('0x45')]({'name':_0x2a60cc['name'],'resourceId':_0x2a60cc['id'],'type':_0x1dada1[_0x9e32('0x23')],'sectionId':_0x1dada1['id']},{})[_0x9e32('0x1f')](function(){return _0x34322a;});}else{return _0x34322a;}})[_0x9e32('0x40')](function(_0x2cc3ee){logger[_0x9e32('0x4d')](_0x9e32('0x4e'),_0x2cc3ee);throw _0x2cc3ee;});}return _0x34322a;})[_0x9e32('0x1f')](respondWithResult(_0x4da2f4,0xc9))[_0x9e32('0x40')](handleError(_0x4da2f4,null));};exports['update']=function(_0x5a8bf0,_0xd5ca41){if(_0x5a8bf0['body']['id']){delete _0x5a8bf0[_0x9e32('0x4f')]['id'];}return db[_0x9e32('0x42')]['find']({'where':{'id':_0x5a8bf0['params']['id']}})['then'](handleEntityNotFound(_0xd5ca41,null))[_0x9e32('0x1f')](saveUpdates(_0x5a8bf0[_0x9e32('0x4f')],null))[_0x9e32('0x1f')](respondWithResult(_0xd5ca41,null))[_0x9e32('0x40')](handleError(_0xd5ca41,null));};exports[_0x9e32('0x50')]=function(_0x50e72e,_0x2442a9){return db['AnalyticExtractedReport'][_0x9e32('0x44')]({'where':{'id':_0x50e72e[_0x9e32('0x41')]['id']}})[_0x9e32('0x1f')](handleEntityNotFound(_0x2442a9,null))[_0x9e32('0x1f')](removeEntity(_0x2442a9,null))[_0x9e32('0x40')](handleError(_0x2442a9,null));};exports[_0x9e32('0x51')]=function(_0x4a4194,_0x3807b2,_0x87b2d){return db['AnalyticExtractedReport'][_0x9e32('0x44')]({'where':{'id':_0x4a4194[_0x9e32('0x41')]['id']},'attributes':['name',_0x9e32('0x52'),_0x9e32('0x53'),_0x9e32('0x54')],'raw':!![]})['then'](handleEntityNotFound(_0x3807b2,null))[_0x9e32('0x1f')](function(_0x44a82a){if(_0x44a82a){if(!fs['existsSync'](path['join'](config[_0x9e32('0x55')],_0x9e32('0x56'),_0x44a82a['savename']))){throw new db[(_0x9e32('0x57'))][(_0x9e32('0x58'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x4a4194[_0x9e32('0x29')][_0x9e32('0x59')]){return _0x3807b2['sendStatus'](0xc8);}return _0x3807b2['download'](path[_0x9e32('0x5a')](config[_0x9e32('0x55')],'server/files/reports',_0x44a82a['savename']),util[_0x9e32('0x5b')](_0x9e32('0x5c'),_0x44a82a[_0x9e32('0x52')]||_0x44a82a[_0x9e32('0x23')],_0x44a82a[_0x9e32('0x54')][_0x9e32('0x5d')]()));}})[_0x9e32('0x40')](handleError(_0x3807b2,null));}; \ No newline at end of file +var _0xedcf=['catch','includeAll','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','UserProfileSection','find','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','download','savename','output','existsSync','server/files/reports','Sequelize','exists','join','root','format','%s.%s','basename','toLowerCase','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','UserProfileResource','sendStatus','name','send','map','AnalyticExtractedReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','options','include','findAll','rows'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xedcf,0x7d));var _0xfedc=function(_0x104242,_0x217561){_0x104242=_0x104242-0x0;var _0xf7bc6a=_0xedcf[_0x104242];return _0xf7bc6a;};'use strict';var pdf=require(_0xfedc('0x0'));var emlformat=require(_0xfedc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfedc('0x2'));var jsonpatch=require(_0xfedc('0x3'));var rp=require(_0xfedc('0x4'));var moment=require(_0xfedc('0x5'));var BPromise=require(_0xfedc('0x6'));var Mustache=require(_0xfedc('0x7'));var util=require(_0xfedc('0x8'));var path=require('path');var sox=require(_0xfedc('0x9'));var csv=require(_0xfedc('0xa'));var ejs=require(_0xfedc('0xb'));var fs=require('fs');var _=require(_0xfedc('0xc'));var squel=require(_0xfedc('0xd'));var crypto=require(_0xfedc('0xe'));var jsforce=require(_0xfedc('0xf'));var deskjs=require(_0xfedc('0x10'));var toCsv=require(_0xfedc('0xa'));var querystring=require('querystring');var Papa=require(_0xfedc('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xfedc('0x12'));var hardwareService=require(_0xfedc('0x13'));var logger=require(_0xfedc('0x14'))(_0xfedc('0x15'));var utils=require(_0xfedc('0x16'));var config=require(_0xfedc('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x323729,_0x454c79){_0x454c79=_0x454c79||0xcc;return function(_0x2cca98){if(_0x2cca98){return _0x323729['sendStatus'](_0x454c79);}return _0x323729[_0xfedc('0x18')](_0x454c79)[_0xfedc('0x19')]();};}function respondWithResult(_0x499603,_0x4c3ea5){_0x4c3ea5=_0x4c3ea5||0xc8;return function(_0x4d0fff){if(_0x4d0fff){return _0x499603['status'](_0x4c3ea5)[_0xfedc('0x1a')](_0x4d0fff);}};}function respondWithFilteredResult(_0xbe1f9,_0x438601){return function(_0x3f2fbf){if(_0x3f2fbf){var _0x3d0eee=_0x3f2fbf[_0xfedc('0x1b')],_0x5db814=_0x438601[_0xfedc('0x1c')],_0x582150=_0x438601['offset']+_0x438601[_0xfedc('0x1d')],_0x4c38f9;if(_0x582150>=_0x3d0eee){_0x582150=_0x3d0eee;_0x4c38f9=0xc8;}else{_0x4c38f9=0xce;}_0xbe1f9[_0xfedc('0x18')](_0x4c38f9);return _0xbe1f9[_0xfedc('0x1e')](_0xfedc('0x1f'),_0x5db814+'-'+_0x582150+'/'+_0x3d0eee)[_0xfedc('0x1a')](_0x3f2fbf);}return null;};}function patchUpdates(_0x50cbce){return function(_0x4e4058){try{jsonpatch[_0xfedc('0x20')](_0x4e4058,_0x50cbce,!![]);}catch(_0x46d915){return BPromise[_0xfedc('0x21')](_0x46d915);}return _0x4e4058[_0xfedc('0x22')]();};}function saveUpdates(_0xae26ae,_0x12da6d){return function(_0x48c7c5){if(_0x48c7c5){return _0x48c7c5[_0xfedc('0x23')](_0xae26ae)[_0xfedc('0x24')](function(_0x1e4f3d){return _0x1e4f3d;});}return null;};}function removeEntity(_0x16283e,_0x205d97){return function(_0x48bf7d){if(_0x48bf7d){return _0x48bf7d[_0xfedc('0x25')]()['then'](function(){var _0x5632cb=_0x48bf7d['get']({'plain':!![]});var _0xbfac2e='ExtractedReports';return db[_0xfedc('0x26')][_0xfedc('0x25')]({'where':{'type':_0xbfac2e,'resourceId':_0x5632cb['id']}})[_0xfedc('0x24')](function(){return _0x48bf7d;});})[_0xfedc('0x24')](function(){_0x16283e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xc4d3f5,_0x38b13a){return function(_0x3ae38e){if(!_0x3ae38e){_0xc4d3f5[_0xfedc('0x27')](0x194);}return _0x3ae38e;};}function handleError(_0x513f90,_0x4355cf){_0x4355cf=_0x4355cf||0x1f4;return function(_0x39f1f0){logger['error'](_0x39f1f0['stack']);if(_0x39f1f0[_0xfedc('0x28')]){delete _0x39f1f0[_0xfedc('0x28')];}_0x513f90['status'](_0x4355cf)[_0xfedc('0x29')](_0x39f1f0);};}exports['index']=function(_0xb79979,_0x50bb8c){var _0x2f776d={},_0x3613ec={},_0x305cab={'count':0x0,'rows':[]};var _0x2170c4=_[_0xfedc('0x2a')](db[_0xfedc('0x2b')]['rawAttributes'],function(_0x3c337c){return{'name':_0x3c337c[_0xfedc('0x2c')],'type':_0x3c337c[_0xfedc('0x2d')][_0xfedc('0x2e')]};});_0x3613ec[_0xfedc('0x2f')]=_[_0xfedc('0x2a')](_0x2170c4,_0xfedc('0x28'));_0x3613ec[_0xfedc('0x30')]=_[_0xfedc('0x31')](_0xb79979[_0xfedc('0x30')]);_0x3613ec[_0xfedc('0x32')]=_[_0xfedc('0x33')](_0x3613ec[_0xfedc('0x2f')],_0x3613ec[_0xfedc('0x30')]);_0x2f776d[_0xfedc('0x34')]=_[_0xfedc('0x33')](_0x3613ec[_0xfedc('0x2f')],qs[_0xfedc('0x35')](_0xb79979[_0xfedc('0x30')][_0xfedc('0x35')]));_0x2f776d[_0xfedc('0x34')]=_0x2f776d[_0xfedc('0x34')]['length']?_0x2f776d[_0xfedc('0x34')]:_0x3613ec[_0xfedc('0x2f')];if(!_0xb79979['query'][_0xfedc('0x36')](_0xfedc('0x37'))){_0x2f776d[_0xfedc('0x1d')]=qs[_0xfedc('0x1d')](_0xb79979['query'][_0xfedc('0x1d')]);_0x2f776d[_0xfedc('0x1c')]=qs[_0xfedc('0x1c')](_0xb79979[_0xfedc('0x30')][_0xfedc('0x1c')]);}_0x2f776d[_0xfedc('0x38')]=qs[_0xfedc('0x39')](_0xb79979[_0xfedc('0x30')][_0xfedc('0x39')]);_0x2f776d['where']=qs[_0xfedc('0x32')](_[_0xfedc('0x3a')](_0xb79979[_0xfedc('0x30')],_0x3613ec[_0xfedc('0x32')]));if(_0xb79979[_0xfedc('0x30')][_0xfedc('0x3b')]){_0x2f776d['where']=_[_0xfedc('0x3c')](_0x2f776d[_0xfedc('0x3d')],{'$or':_[_0xfedc('0x2a')](_0x2170c4,function(_0x341023){if(_0x341023[_0xfedc('0x2d')]!==_0xfedc('0x3e')){var _0xa0c7cc={};_0xa0c7cc[_0x341023[_0xfedc('0x28')]]={'$like':'%'+_0xb79979[_0xfedc('0x30')]['filter']+'%'};return _0xa0c7cc;}})});}_0x2f776d=_['merge']({},_0x2f776d,_0xb79979[_0xfedc('0x3f')]);var _0x49dcc8={'where':_0x2f776d[_0xfedc('0x3d')]};return db[_0xfedc('0x2b')][_0xfedc('0x1b')](_0x49dcc8)[_0xfedc('0x24')](function(_0x1f41a9){_0x305cab[_0xfedc('0x1b')]=_0x1f41a9;if(_0xb79979[_0xfedc('0x30')]['includeAll']){_0x2f776d[_0xfedc('0x40')]=[{'all':!![]}];}return db['AnalyticExtractedReport'][_0xfedc('0x41')](_0x2f776d);})[_0xfedc('0x24')](function(_0x445960){_0x305cab[_0xfedc('0x42')]=_0x445960;return _0x305cab;})[_0xfedc('0x24')](respondWithFilteredResult(_0x50bb8c,_0x2f776d))[_0xfedc('0x43')](handleError(_0x50bb8c,null));};exports['show']=function(_0x17b44a,_0x26b8d1){var _0xc49013={'raw':!![],'where':{'id':_0x17b44a['params']['id']}},_0x2380ce={};_0x2380ce[_0xfedc('0x2f')]=_[_0xfedc('0x31')](db[_0xfedc('0x2b')]['rawAttributes']);_0x2380ce[_0xfedc('0x30')]=_['keys'](_0x17b44a['query']);_0x2380ce[_0xfedc('0x32')]=_[_0xfedc('0x33')](_0x2380ce[_0xfedc('0x2f')],_0x2380ce['query']);_0xc49013['attributes']=_['intersection'](_0x2380ce['model'],qs[_0xfedc('0x35')](_0x17b44a[_0xfedc('0x30')][_0xfedc('0x35')]));_0xc49013[_0xfedc('0x34')]=_0xc49013[_0xfedc('0x34')]['length']?_0xc49013[_0xfedc('0x34')]:_0x2380ce[_0xfedc('0x2f')];if(_0x17b44a[_0xfedc('0x30')][_0xfedc('0x44')]){_0xc49013[_0xfedc('0x40')]=[{'all':!![]}];}_0xc49013=_['merge']({},_0xc49013,_0x17b44a['options']);return db[_0xfedc('0x2b')]['find'](_0xc49013)['then'](handleEntityNotFound(_0x26b8d1,null))['then'](respondWithResult(_0x26b8d1,null))[_0xfedc('0x43')](handleError(_0x26b8d1,null));};exports[_0xfedc('0x45')]=function(_0x506cc3,_0x21410b){return db[_0xfedc('0x2b')][_0xfedc('0x45')](_0x506cc3[_0xfedc('0x46')],{})[_0xfedc('0x24')](function(_0x465bdb){var _0x7ed3d5=_0x506cc3[_0xfedc('0x47')][_0xfedc('0x48')]({'plain':!![]});if(!_0x7ed3d5)throw new Error(_0xfedc('0x49'));if(_0x7ed3d5[_0xfedc('0x4a')]===_0xfedc('0x47')){var _0xb4a8d=_0x465bdb[_0xfedc('0x48')]({'plain':!![]});var _0x34c104=_0xfedc('0x4b');return db[_0xfedc('0x4c')][_0xfedc('0x4d')]({'where':{'name':_0x34c104,'userProfileId':_0x7ed3d5[_0xfedc('0x4e')]},'raw':!![]})[_0xfedc('0x24')](function(_0x53f054){if(_0x53f054&&_0x53f054[_0xfedc('0x4f')]===0x0){return db[_0xfedc('0x26')]['create']({'name':_0xb4a8d['name'],'resourceId':_0xb4a8d['id'],'type':_0x53f054['name'],'sectionId':_0x53f054['id']},{})[_0xfedc('0x24')](function(){return _0x465bdb;});}else{return _0x465bdb;}})[_0xfedc('0x43')](function(_0xde5a2b){logger[_0xfedc('0x50')](_0xfedc('0x51'),_0xde5a2b);throw _0xde5a2b;});}return _0x465bdb;})['then'](respondWithResult(_0x21410b,0xc9))[_0xfedc('0x43')](handleError(_0x21410b,null));};exports[_0xfedc('0x23')]=function(_0x4cc9ad,_0x246541){if(_0x4cc9ad['body']['id']){delete _0x4cc9ad[_0xfedc('0x46')]['id'];}return db[_0xfedc('0x2b')][_0xfedc('0x4d')]({'where':{'id':_0x4cc9ad[_0xfedc('0x52')]['id']}})[_0xfedc('0x24')](handleEntityNotFound(_0x246541,null))[_0xfedc('0x24')](saveUpdates(_0x4cc9ad[_0xfedc('0x46')],null))[_0xfedc('0x24')](respondWithResult(_0x246541,null))[_0xfedc('0x43')](handleError(_0x246541,null));};exports['destroy']=function(_0x56353e,_0x4b4cb9){return db[_0xfedc('0x2b')]['find']({'where':{'id':_0x56353e[_0xfedc('0x52')]['id']}})['then'](handleEntityNotFound(_0x4b4cb9,null))['then'](removeEntity(_0x4b4cb9,null))[_0xfedc('0x43')](handleError(_0x4b4cb9,null));};exports[_0xfedc('0x53')]=function(_0x2d3c06,_0x433eb0,_0x4f1ea1){return db[_0xfedc('0x2b')][_0xfedc('0x4d')]({'where':{'id':_0x2d3c06['params']['id']},'attributes':['name','basename',_0xfedc('0x54'),_0xfedc('0x55')],'raw':!![]})[_0xfedc('0x24')](handleEntityNotFound(_0x433eb0,null))[_0xfedc('0x24')](function(_0x21f608){if(_0x21f608){if(!fs[_0xfedc('0x56')](path['join'](config['root'],_0xfedc('0x57'),_0x21f608[_0xfedc('0x54')]))){throw new db[(_0xfedc('0x58'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x2d3c06[_0xfedc('0x30')][_0xfedc('0x59')]){return _0x433eb0[_0xfedc('0x27')](0xc8);}return _0x433eb0['download'](path[_0xfedc('0x5a')](config[_0xfedc('0x5b')],_0xfedc('0x57'),_0x21f608[_0xfedc('0x54')]),util[_0xfedc('0x5c')](_0xfedc('0x5d'),_0x21f608[_0xfedc('0x5e')]||_0x21f608[_0xfedc('0x28')],_0x21f608[_0xfedc('0x55')][_0xfedc('0x5f')]()));}})[_0xfedc('0x43')](handleError(_0x433eb0,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 03919c3..ceaf431 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 _0x90fa=['analytics_extracted_reports','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','AnalyticExtractedReport'];(function(_0x25dabe,_0x137e9c){var _0xd87618=function(_0x29c228){while(--_0x29c228){_0x25dabe['push'](_0x25dabe['shift']());}};_0xd87618(++_0x137e9c);}(_0x90fa,0x1b1));var _0xa90f=function(_0x1e7dcb,_0x3fbe32){_0x1e7dcb=_0x1e7dcb-0x0;var _0x58835c=_0x90fa[_0x1e7dcb];return _0x58835c;};'use strict';var _=require(_0xa90f('0x0'));var util=require('util');var logger=require(_0xa90f('0x1'))(_0xa90f('0x2'));var moment=require(_0xa90f('0x3'));var BPromise=require(_0xa90f('0x4'));var rp=require(_0xa90f('0x5'));var fs=require('fs');var path=require(_0xa90f('0x6'));var rimraf=require(_0xa90f('0x7'));var config=require('../../config/environment');var attributes=require('./analyticExtractedReport.attributes');module[_0xa90f('0x8')]=function(_0x409989,_0x5a05ac){return _0x409989[_0xa90f('0x9')](_0xa90f('0xa'),attributes,{'tableName':_0xa90f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc0d4=['rimraf','../../config/environment','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc0d4,0x19e));var _0x4c0d=function(_0x2a99ea,_0x1bfb13){_0x2a99ea=_0x2a99ea-0x0;var _0x5887ae=_0xc0d4[_0x2a99ea];return _0x5887ae;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4c0d('0x0'))(_0x4c0d('0x1'));var moment=require(_0x4c0d('0x2'));var BPromise=require(_0x4c0d('0x3'));var rp=require(_0x4c0d('0x4'));var fs=require('fs');var path=require(_0x4c0d('0x5'));var rimraf=require(_0x4c0d('0x6'));var config=require(_0x4c0d('0x7'));var attributes=require(_0x4c0d('0x8'));module['exports']=function(_0x44f2e7,_0x40ff16){return _0x44f2e7[_0x4c0d('0x9')](_0x4c0d('0xa'),attributes,{'tableName':_0x4c0d('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 e249849..e78fd78 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 _0x481c=['message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x458ba0,_0x47e4d9){var _0x59efd2=function(_0x35b760){while(--_0x35b760){_0x458ba0['push'](_0x458ba0['shift']());}};_0x59efd2(++_0x47e4d9);}(_0x481c,0x154));var _0xc481=function(_0x534cce,_0x3de4d3){_0x534cce=_0x534cce-0x0;var _0x34afc7=_0x481c[_0x534cce];return _0x34afc7;};'use strict';var _=require('lodash');var util=require(_0xc481('0x0'));var moment=require(_0xc481('0x1'));var BPromise=require(_0xc481('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc481('0x3'));var db=require(_0xc481('0x4'))['db'];var utils=require(_0xc481('0x5'));var logger=require('../../config/logger')(_0xc481('0x6'));var config=require(_0xc481('0x7'));var jayson=require(_0xc481('0x8'));var client=jayson['client'][_0xc481('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x254a8d,_0x132f29,_0x3c5c34){return new BPromise(function(_0x238efd,_0x2dae51){return client[_0xc481('0xa')](_0x254a8d,_0x3c5c34)[_0xc481('0xb')](function(_0x4d24a7){logger['info'](_0xc481('0xc'),_0x132f29,_0xc481('0xd'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x132f29,_0xc481('0xd'),JSON[_0xc481('0xe')](_0x4d24a7));if(_0x4d24a7[_0xc481('0xf')]){if(_0x4d24a7['error'][_0xc481('0x10')]===0x1f4){logger['error'](_0xc481('0xc'),_0x132f29,_0x4d24a7['error'][_0xc481('0x11')]);return _0x2dae51(_0x4d24a7[_0xc481('0xf')]['message']);}logger[_0xc481('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x132f29,_0x4d24a7['error'][_0xc481('0x11')]);return _0x238efd(_0x4d24a7[_0xc481('0xf')]['message']);}else{logger[_0xc481('0x12')](_0xc481('0xc'),_0x132f29,_0xc481('0xd'));_0x238efd(_0x4d24a7[_0xc481('0x13')][_0xc481('0x11')]);}})[_0xc481('0x14')](function(_0x3b39b4){logger['error'](_0xc481('0xc'),_0x132f29,_0x3b39b4);_0x2dae51(_0x3b39b4);});});} \ No newline at end of file +var _0x8471=['result','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','error','message'];(function(_0x4ce255,_0x54cc1a){var _0x419abe=function(_0x178744){while(--_0x178744){_0x4ce255['push'](_0x4ce255['shift']());}};_0x419abe(++_0x54cc1a);}(_0x8471,0x1a2));var _0x1847=function(_0x5d6215,_0x2bfea6){_0x5d6215=_0x5d6215-0x0;var _0x1e11f7=_0x8471[_0x5d6215];return _0x1e11f7;};'use strict';var _=require(_0x1847('0x0'));var util=require('util');var moment=require(_0x1847('0x1'));var BPromise=require('bluebird');var rs=require(_0x1847('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1847('0x3'))['db'];var utils=require(_0x1847('0x4'));var logger=require('../../config/logger')(_0x1847('0x5'));var config=require(_0x1847('0x6'));var jayson=require(_0x1847('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x547cf9,_0x39abb,_0x4b47f1){return new BPromise(function(_0x1afd62,_0xb43b80){return client['request'](_0x547cf9,_0x4b47f1)[_0x1847('0x8')](function(_0x226c7b){logger[_0x1847('0x9')](_0x1847('0xa'),_0x39abb,_0x1847('0xb'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x39abb,_0x1847('0xb'),JSON['stringify'](_0x226c7b));if(_0x226c7b['error']){if(_0x226c7b[_0x1847('0xc')]['code']===0x1f4){logger[_0x1847('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x39abb,_0x226c7b[_0x1847('0xc')][_0x1847('0xd')]);return _0xb43b80(_0x226c7b['error']['message']);}logger[_0x1847('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x39abb,_0x226c7b[_0x1847('0xc')]['message']);return _0x1afd62(_0x226c7b[_0x1847('0xc')]['message']);}else{logger[_0x1847('0x9')](_0x1847('0xa'),_0x39abb,_0x1847('0xb'));_0x1afd62(_0x226c7b[_0x1847('0xe')]['message']);}})[_0x1847('0xf')](function(_0x2637d5){logger[_0x1847('0xc')](_0x1847('0xa'),_0x39abb,_0x2637d5);_0xb43b80(_0x2637d5);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index e88aaff..925000b 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 _0x1809=['destroy','exports','util','path','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','show','/:id/download','download','/:id','update','delete'];(function(_0x1b9ec2,_0x39ae50){var _0x26c710=function(_0x3b9c07){while(--_0x3b9c07){_0x1b9ec2['push'](_0x1b9ec2['shift']());}};_0x26c710(++_0x39ae50);}(_0x1809,0x1cd));var _0x9180=function(_0x24098a,_0x116b5a){_0x24098a=_0x24098a-0x0;var _0x389af1=_0x1809[_0x24098a];return _0x389af1;};'use strict';var multer=require('multer');var util=require(_0x9180('0x0'));var path=require(_0x9180('0x1'));var timeout=require('connect-timeout');var express=require(_0x9180('0x2'));var router=express[_0x9180('0x3')]();var auth=require(_0x9180('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x9180('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x9180('0x6')]('/',auth[_0x9180('0x7')](),controller[_0x9180('0x8')]);router['get']('/:id',auth[_0x9180('0x7')](),controller[_0x9180('0x9')]);router[_0x9180('0x6')](_0x9180('0xa'),auth[_0x9180('0x7')](),controller[_0x9180('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x9180('0xc'),auth[_0x9180('0x7')](),controller[_0x9180('0xd')]);router[_0x9180('0xe')]('/:id',auth[_0x9180('0x7')](),controller[_0x9180('0xf')]);module[_0x9180('0x10')]=router; \ No newline at end of file +var _0x100a=['get','index','/:id','/:id/download','isAuthenticated','download','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller'];(function(_0x25cee8,_0x143d21){var _0x4cfacc=function(_0x486a4a){while(--_0x486a4a){_0x25cee8['push'](_0x25cee8['shift']());}};_0x4cfacc(++_0x143d21);}(_0x100a,0x97));var _0xa100=function(_0x38e4d3,_0x4748ee){_0x38e4d3=_0x38e4d3-0x0;var _0xae49a0=_0x100a[_0x38e4d3];return _0xae49a0;};'use strict';var multer=require(_0xa100('0x0'));var util=require('util');var path=require(_0xa100('0x1'));var timeout=require(_0xa100('0x2'));var express=require(_0xa100('0x3'));var router=express[_0xa100('0x4')]();var auth=require(_0xa100('0x5'));var interaction=require(_0xa100('0x6'));var config=require(_0xa100('0x7'));var controller=require(_0xa100('0x8'));router[_0xa100('0x9')]('/',auth['isAuthenticated'](),controller[_0xa100('0xa')]);router['get'](_0xa100('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xa100('0xc'),auth[_0xa100('0xd')](),controller[_0xa100('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xa100('0xf')](_0xa100('0xb'),auth[_0xa100('0xd')](),controller[_0xa100('0x10')]);router[_0xa100('0x11')](_0xa100('0xb'),auth[_0xa100('0xd')](),controller[_0xa100('0x12')]);module[_0xa100('0x13')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index fc46e26..0890e6e 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 _0x1261=['exports','TEXT','STRING','BOOLEAN'];(function(_0x241132,_0x20b24b){var _0x275bd3=function(_0x163c23){while(--_0x163c23){_0x241132['push'](_0x241132['shift']());}};_0x275bd3(++_0x20b24b);}(_0x1261,0x144));var _0x1126=function(_0x489b87,_0xd51c93){_0x489b87=_0x489b87-0x0;var _0x1823b6=_0x1261[_0x489b87];return _0x1823b6;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'field':{'type':Sequelize[_0x1126('0x1')]},'alias':{'type':Sequelize[_0x1126('0x2')]},'function':{'type':Sequelize[_0x1126('0x2')]},'format':{'type':Sequelize[_0x1126('0x2')]},'groupBy':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1126('0x2')]},'custom':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x5fc3=['sequelize','exports','STRING','BOOLEAN'];(function(_0x43a8e7,_0x5afb60){var _0x4f0b08=function(_0x46d10d){while(--_0x46d10d){_0x43a8e7['push'](_0x43a8e7['shift']());}};_0x4f0b08(++_0x5afb60);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e531a,_0x28a82a){_0x3e531a=_0x3e531a-0x0;var _0x3c2574=_0x5fc3[_0x3e531a];return _0x3c2574;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x35fc('0x2')]},'function':{'type':Sequelize[_0x35fc('0x2')]},'format':{'type':Sequelize[_0x35fc('0x2')]},'groupBy':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x35fc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index d14d90c..852fdbc 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 _0xc891=['AnalyticFieldReport','fieldName','type','key','map','name','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','rawAttributes','length','find','create','bulkCreate','body','destroy','bulkDestroy','ids','addFields','AnalyticCustomReport','findOne','sequelize','CustomReportId','html-pdf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','then','stack','send'];(function(_0x43e97d,_0x56a06b){var _0x424cd9=function(_0x4f574b){while(--_0x4f574b){_0x43e97d['push'](_0x43e97d['shift']());}};_0x424cd9(++_0x56a06b);}(_0xc891,0x152));var _0x1c89=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc891[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x1c89('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x1c89('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1c89('0x2'));var moment=require(_0x1c89('0x3'));var BPromise=require(_0x1c89('0x4'));var Mustache=require('mustache');var util=require(_0x1c89('0x5'));var path=require(_0x1c89('0x6'));var sox=require(_0x1c89('0x7'));var csv=require(_0x1c89('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1c89('0x9'));var squel=require(_0x1c89('0xa'));var crypto=require('crypto');var jsforce=require(_0x1c89('0xb'));var deskjs=require(_0x1c89('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1c89('0xd'));var Papa=require('papaparse');var Redis=require(_0x1c89('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x1c89('0xf'))('api');var utils=require(_0x1c89('0x10'));var config=require(_0x1c89('0x11'));var db=require(_0x1c89('0x12'))['db'];function respondWithStatusCode(_0x182205,_0x7a4a2b){_0x7a4a2b=_0x7a4a2b||0xcc;return function(_0x27e7c0){if(_0x27e7c0){return _0x182205[_0x1c89('0x13')](_0x7a4a2b);}return _0x182205[_0x1c89('0x14')](_0x7a4a2b)['end']();};}function respondWithResult(_0x45d17d,_0x514e4d){_0x514e4d=_0x514e4d||0xc8;return function(_0x46be15){if(_0x46be15){return _0x45d17d[_0x1c89('0x14')](_0x514e4d)[_0x1c89('0x15')](_0x46be15);}};}function respondWithFilteredResult(_0x4c2d09,_0x45354d){return function(_0x29602e){if(_0x29602e){var _0x2c9572=_0x29602e[_0x1c89('0x16')],_0x4af31b=_0x45354d[_0x1c89('0x17')],_0x2357a8=_0x45354d[_0x1c89('0x17')]+_0x45354d[_0x1c89('0x18')],_0x40952a;if(_0x2357a8>=_0x2c9572){_0x2357a8=_0x2c9572;_0x40952a=0xc8;}else{_0x40952a=0xce;}_0x4c2d09[_0x1c89('0x14')](_0x40952a);return _0x4c2d09[_0x1c89('0x19')](_0x1c89('0x1a'),_0x4af31b+'-'+_0x2357a8+'/'+_0x2c9572)[_0x1c89('0x15')](_0x29602e);}return null;};}function patchUpdates(_0x2d2e23){return function(_0x52ec5c){try{jsonpatch[_0x1c89('0x1b')](_0x52ec5c,_0x2d2e23,!![]);}catch(_0x3003c1){return BPromise['reject'](_0x3003c1);}return _0x52ec5c[_0x1c89('0x1c')]();};}function saveUpdates(_0x3b43a3,_0x14121c){return function(_0x43a17a){if(_0x43a17a){return _0x43a17a['update'](_0x3b43a3)['then'](function(_0x841a83){return _0x841a83;});}return null;};}function removeEntity(_0x39fb8e,_0x253e07){return function(_0x23def1){if(_0x23def1){return _0x23def1['destroy']()[_0x1c89('0x1d')](function(){_0x39fb8e[_0x1c89('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45f604,_0x26a1cc){return function(_0x1ac0cc){if(!_0x1ac0cc){_0x45f604['sendStatus'](0x194);}return _0x1ac0cc;};}function handleError(_0x130902,_0x3f8957){_0x3f8957=_0x3f8957||0x1f4;return function(_0x370e54){logger['error'](_0x370e54[_0x1c89('0x1e')]);if(_0x370e54['name']){delete _0x370e54['name'];}_0x130902[_0x1c89('0x14')](_0x3f8957)[_0x1c89('0x1f')](_0x370e54);};}exports['index']=function(_0x480d76,_0x50868f){var _0x1d40e1={},_0x5ce91f={},_0x4b37cf={'count':0x0,'rows':[]};var _0x4763a6=_['map'](db[_0x1c89('0x20')]['rawAttributes'],function(_0x4dac46){return{'name':_0x4dac46[_0x1c89('0x21')],'type':_0x4dac46[_0x1c89('0x22')][_0x1c89('0x23')]};});_0x5ce91f['model']=_[_0x1c89('0x24')](_0x4763a6,_0x1c89('0x25'));_0x5ce91f['query']=_[_0x1c89('0x26')](_0x480d76['query']);_0x5ce91f[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x5ce91f[_0x1c89('0x29')],_0x5ce91f[_0x1c89('0x2a')]);_0x1d40e1[_0x1c89('0x2b')]=_[_0x1c89('0x28')](_0x5ce91f[_0x1c89('0x29')],qs[_0x1c89('0x2c')](_0x480d76[_0x1c89('0x2a')][_0x1c89('0x2c')]));_0x1d40e1['attributes']=_0x1d40e1[_0x1c89('0x2b')]['length']?_0x1d40e1['attributes']:_0x5ce91f[_0x1c89('0x29')];if(!_0x480d76[_0x1c89('0x2a')][_0x1c89('0x2d')](_0x1c89('0x2e'))){_0x1d40e1[_0x1c89('0x18')]=qs[_0x1c89('0x18')](_0x480d76[_0x1c89('0x2a')][_0x1c89('0x18')]);_0x1d40e1[_0x1c89('0x17')]=qs[_0x1c89('0x17')](_0x480d76[_0x1c89('0x2a')]['offset']);}_0x1d40e1['order']=qs[_0x1c89('0x2f')](_0x480d76['query']['sort']);_0x1d40e1[_0x1c89('0x30')]=qs[_0x1c89('0x27')](_[_0x1c89('0x31')](_0x480d76[_0x1c89('0x2a')],_0x5ce91f[_0x1c89('0x27')]));if(_0x480d76[_0x1c89('0x2a')][_0x1c89('0x32')]){_0x1d40e1['where']=_[_0x1c89('0x33')](_0x1d40e1[_0x1c89('0x30')],{'$or':_['map'](_0x4763a6,function(_0xb0ff02){if(_0xb0ff02[_0x1c89('0x22')]!==_0x1c89('0x34')){var _0x2b0a3a={};_0x2b0a3a[_0xb0ff02[_0x1c89('0x25')]]={'$like':'%'+_0x480d76['query'][_0x1c89('0x32')]+'%'};return _0x2b0a3a;}})});}_0x1d40e1=_[_0x1c89('0x33')]({},_0x1d40e1,_0x480d76[_0x1c89('0x35')]);var _0x5324e8={'where':_0x1d40e1[_0x1c89('0x30')]};return db['AnalyticFieldReport'][_0x1c89('0x16')](_0x5324e8)['then'](function(_0x1efa48){_0x4b37cf[_0x1c89('0x16')]=_0x1efa48;if(_0x480d76[_0x1c89('0x2a')][_0x1c89('0x36')]){_0x1d40e1[_0x1c89('0x37')]=[{'all':!![]}];}return db[_0x1c89('0x20')][_0x1c89('0x38')](_0x1d40e1);})[_0x1c89('0x1d')](function(_0x468e5b){_0x4b37cf['rows']=_0x468e5b;return _0x4b37cf;})[_0x1c89('0x1d')](respondWithFilteredResult(_0x50868f,_0x1d40e1))[_0x1c89('0x39')](handleError(_0x50868f,null));};exports[_0x1c89('0x3a')]=function(_0x1dc884,_0x490b01){var _0x36e3a7={'raw':![],'where':{'id':_0x1dc884[_0x1c89('0x3b')]['id']}},_0x3269aa={};_0x3269aa['model']=_['keys'](db[_0x1c89('0x20')][_0x1c89('0x3c')]);_0x3269aa['query']=_[_0x1c89('0x26')](_0x1dc884[_0x1c89('0x2a')]);_0x3269aa[_0x1c89('0x27')]=_[_0x1c89('0x28')](_0x3269aa[_0x1c89('0x29')],_0x3269aa[_0x1c89('0x2a')]);_0x36e3a7[_0x1c89('0x2b')]=_['intersection'](_0x3269aa[_0x1c89('0x29')],qs['fields'](_0x1dc884['query'][_0x1c89('0x2c')]));_0x36e3a7[_0x1c89('0x2b')]=_0x36e3a7[_0x1c89('0x2b')][_0x1c89('0x3d')]?_0x36e3a7[_0x1c89('0x2b')]:_0x3269aa[_0x1c89('0x29')];if(_0x1dc884[_0x1c89('0x2a')][_0x1c89('0x36')]){_0x36e3a7[_0x1c89('0x37')]=[{'all':!![]}];}_0x36e3a7=_[_0x1c89('0x33')]({},_0x36e3a7,_0x1dc884[_0x1c89('0x35')]);return db[_0x1c89('0x20')][_0x1c89('0x3e')](_0x36e3a7)[_0x1c89('0x1d')](handleEntityNotFound(_0x490b01,null))[_0x1c89('0x1d')](respondWithResult(_0x490b01,null))[_0x1c89('0x39')](handleError(_0x490b01,null));};exports['create']=function(_0x6ee3bd,_0x4dbb87){return db['AnalyticFieldReport'][_0x1c89('0x3f')](_0x6ee3bd['body'],{})['then'](respondWithResult(_0x4dbb87,0xc9))[_0x1c89('0x39')](handleError(_0x4dbb87,null));};exports[_0x1c89('0x40')]=function(_0x5f102d,_0x4c8e9f){return db[_0x1c89('0x20')]['bulkCreate'](_0x5f102d[_0x1c89('0x41')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4c8e9f,0xc9))[_0x1c89('0x39')](handleError(_0x4c8e9f,null));};exports['update']=function(_0x36d5fc,_0x413f42){if(_0x36d5fc[_0x1c89('0x41')]['id']){delete _0x36d5fc['body']['id'];}return db[_0x1c89('0x20')][_0x1c89('0x3e')]({'where':{'id':_0x36d5fc['params']['id']}})['then'](handleEntityNotFound(_0x413f42,null))[_0x1c89('0x1d')](saveUpdates(_0x36d5fc[_0x1c89('0x41')],null))[_0x1c89('0x1d')](respondWithResult(_0x413f42,null))[_0x1c89('0x39')](handleError(_0x413f42,null));};exports[_0x1c89('0x42')]=function(_0x392fdb,_0x61a238){return db[_0x1c89('0x20')][_0x1c89('0x3e')]({'where':{'id':_0x392fdb[_0x1c89('0x3b')]['id']}})[_0x1c89('0x1d')](handleEntityNotFound(_0x61a238,null))[_0x1c89('0x1d')](removeEntity(_0x61a238,null))[_0x1c89('0x39')](handleError(_0x61a238,null));};exports[_0x1c89('0x43')]=function(_0x190bf6,_0x2ff174){return db[_0x1c89('0x20')][_0x1c89('0x42')]({'where':{'id':_0x190bf6[_0x1c89('0x2a')][_0x1c89('0x44')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x2ff174,0xcc))[_0x1c89('0x39')](handleError(_0x2ff174,null));};exports[_0x1c89('0x45')]=function(_0x3ef99d,_0x1e15c1,_0x2f6cf4){return db[_0x1c89('0x46')][_0x1c89('0x47')]({'where':{'id':_0x3ef99d[_0x1c89('0x3b')]['id']}})['then'](handleEntityNotFound(_0x1e15c1,null))[_0x1c89('0x1d')](function(_0x34b4d2){if(_0x34b4d2){return db[_0x1c89('0x48')]['transaction'](function(_0x152938){return db[_0x1c89('0x20')][_0x1c89('0x42')]({'where':{'CustomReportId':_0x3ef99d['params']['id']},'transaction':_0x152938})[_0x1c89('0x1d')](function(_0x3367d3){var _0x5084f9=_['map'](_0x3ef99d['body'],function(_0x395a9e){delete _0x395a9e['id'];_0x395a9e[_0x1c89('0x49')]=_0x3ef99d[_0x1c89('0x3b')]['id'];return _0x395a9e;});return db[_0x1c89('0x20')][_0x1c89('0x40')](_0x5084f9,{'transaction':_0x152938});});})[_0x1c89('0x1d')](function(){return db[_0x1c89('0x20')]['findAll']({'where':{'CustomReportId':_0x3ef99d['params']['id']}});});}})[_0x1c89('0x1d')](respondWithResult(_0x1e15c1,null))[_0x1c89('0x39')](handleError(_0x1e15c1,null));}; \ No newline at end of file +var _0xd0da=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','bulkCreate','body','find','bulkDestroy','ids','addFields','AnalyticCustomReport','sequelize','transaction','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','update','destroy','then','sendStatus','error','stack','name','send','index','map','AnalyticFieldReport','rawAttributes'];(function(_0x2d60b0,_0x170083){var _0x50d91a=function(_0xb755fa){while(--_0xb755fa){_0x2d60b0['push'](_0x2d60b0['shift']());}};_0x50d91a(++_0x170083);}(_0xd0da,0x1b1));var _0xad0d=function(_0x2d2623,_0x1aaea0){_0x2d2623=_0x2d2623-0x0;var _0x28f6c1=_0xd0da[_0x2d2623];return _0x28f6c1;};'use strict';var pdf=require(_0xad0d('0x0'));var emlformat=require(_0xad0d('0x1'));var rimraf=require(_0xad0d('0x2'));var zipdir=require(_0xad0d('0x3'));var jsonpatch=require(_0xad0d('0x4'));var rp=require('request-promise');var moment=require(_0xad0d('0x5'));var BPromise=require(_0xad0d('0x6'));var Mustache=require(_0xad0d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xad0d('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xad0d('0x9'));var squel=require(_0xad0d('0xa'));var crypto=require(_0xad0d('0xb'));var jsforce=require(_0xad0d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xad0d('0xd'));var querystring=require(_0xad0d('0xe'));var Papa=require(_0xad0d('0xf'));var Redis=require(_0xad0d('0x10'));var authService=require(_0xad0d('0x11'));var qs=require(_0xad0d('0x12'));var as=require(_0xad0d('0x13'));var hardwareService=require(_0xad0d('0x14'));var logger=require(_0xad0d('0x15'))(_0xad0d('0x16'));var utils=require(_0xad0d('0x17'));var config=require(_0xad0d('0x18'));var db=require(_0xad0d('0x19'))['db'];function respondWithStatusCode(_0x4bb586,_0x45c7ea){_0x45c7ea=_0x45c7ea||0xcc;return function(_0x3b62bf){if(_0x3b62bf){return _0x4bb586['sendStatus'](_0x45c7ea);}return _0x4bb586[_0xad0d('0x1a')](_0x45c7ea)[_0xad0d('0x1b')]();};}function respondWithResult(_0x52a121,_0x79cb76){_0x79cb76=_0x79cb76||0xc8;return function(_0xd50e3f){if(_0xd50e3f){return _0x52a121['status'](_0x79cb76)[_0xad0d('0x1c')](_0xd50e3f);}};}function respondWithFilteredResult(_0x698ee,_0x58b701){return function(_0x139e6f){if(_0x139e6f){var _0x59811c=_0x139e6f[_0xad0d('0x1d')],_0x56d253=_0x58b701['offset'],_0x3efaab=_0x58b701[_0xad0d('0x1e')]+_0x58b701[_0xad0d('0x1f')],_0x3677b5;if(_0x3efaab>=_0x59811c){_0x3efaab=_0x59811c;_0x3677b5=0xc8;}else{_0x3677b5=0xce;}_0x698ee['status'](_0x3677b5);return _0x698ee[_0xad0d('0x20')]('Content-Range',_0x56d253+'-'+_0x3efaab+'/'+_0x59811c)['json'](_0x139e6f);}return null;};}function patchUpdates(_0x3cc93e){return function(_0x539d4b){try{jsonpatch[_0xad0d('0x21')](_0x539d4b,_0x3cc93e,!![]);}catch(_0x309369){return BPromise[_0xad0d('0x22')](_0x309369);}return _0x539d4b['save']();};}function saveUpdates(_0x490bb9,_0x16b5a1){return function(_0x327fe1){if(_0x327fe1){return _0x327fe1[_0xad0d('0x23')](_0x490bb9)['then'](function(_0x4a2ac9){return _0x4a2ac9;});}return null;};}function removeEntity(_0x971569,_0x48333a){return function(_0x264f63){if(_0x264f63){return _0x264f63[_0xad0d('0x24')]()[_0xad0d('0x25')](function(){_0x971569[_0xad0d('0x1a')](0xcc)[_0xad0d('0x1b')]();});}};}function handleEntityNotFound(_0x315f9c,_0x59efec){return function(_0x171757){if(!_0x171757){_0x315f9c[_0xad0d('0x26')](0x194);}return _0x171757;};}function handleError(_0x59499a,_0x4e2657){_0x4e2657=_0x4e2657||0x1f4;return function(_0x3d0adc){logger[_0xad0d('0x27')](_0x3d0adc[_0xad0d('0x28')]);if(_0x3d0adc['name']){delete _0x3d0adc[_0xad0d('0x29')];}_0x59499a['status'](_0x4e2657)[_0xad0d('0x2a')](_0x3d0adc);};}exports[_0xad0d('0x2b')]=function(_0x4d45a9,_0x481e1a){var _0x3111fd={},_0x434221={},_0xcf3c2b={'count':0x0,'rows':[]};var _0x54a0c1=_[_0xad0d('0x2c')](db[_0xad0d('0x2d')][_0xad0d('0x2e')],function(_0x59792d){return{'name':_0x59792d[_0xad0d('0x2f')],'type':_0x59792d[_0xad0d('0x30')]['key']};});_0x434221[_0xad0d('0x31')]=_[_0xad0d('0x2c')](_0x54a0c1,_0xad0d('0x29'));_0x434221[_0xad0d('0x32')]=_[_0xad0d('0x33')](_0x4d45a9[_0xad0d('0x32')]);_0x434221[_0xad0d('0x34')]=_[_0xad0d('0x35')](_0x434221[_0xad0d('0x31')],_0x434221[_0xad0d('0x32')]);_0x3111fd[_0xad0d('0x36')]=_['intersection'](_0x434221[_0xad0d('0x31')],qs['fields'](_0x4d45a9[_0xad0d('0x32')][_0xad0d('0x37')]));_0x3111fd[_0xad0d('0x36')]=_0x3111fd[_0xad0d('0x36')]['length']?_0x3111fd[_0xad0d('0x36')]:_0x434221[_0xad0d('0x31')];if(!_0x4d45a9['query'][_0xad0d('0x38')](_0xad0d('0x39'))){_0x3111fd[_0xad0d('0x1f')]=qs[_0xad0d('0x1f')](_0x4d45a9[_0xad0d('0x32')]['limit']);_0x3111fd[_0xad0d('0x1e')]=qs[_0xad0d('0x1e')](_0x4d45a9[_0xad0d('0x32')][_0xad0d('0x1e')]);}_0x3111fd['order']=qs[_0xad0d('0x3a')](_0x4d45a9['query'][_0xad0d('0x3a')]);_0x3111fd[_0xad0d('0x3b')]=qs[_0xad0d('0x34')](_['pick'](_0x4d45a9[_0xad0d('0x32')],_0x434221[_0xad0d('0x34')]));if(_0x4d45a9[_0xad0d('0x32')][_0xad0d('0x3c')]){_0x3111fd[_0xad0d('0x3b')]=_[_0xad0d('0x3d')](_0x3111fd[_0xad0d('0x3b')],{'$or':_[_0xad0d('0x2c')](_0x54a0c1,function(_0x520ad4){if(_0x520ad4[_0xad0d('0x30')]!==_0xad0d('0x3e')){var _0x74929e={};_0x74929e[_0x520ad4[_0xad0d('0x29')]]={'$like':'%'+_0x4d45a9['query'][_0xad0d('0x3c')]+'%'};return _0x74929e;}})});}_0x3111fd=_[_0xad0d('0x3d')]({},_0x3111fd,_0x4d45a9[_0xad0d('0x3f')]);var _0x1bb3ba={'where':_0x3111fd[_0xad0d('0x3b')]};return db['AnalyticFieldReport']['count'](_0x1bb3ba)[_0xad0d('0x25')](function(_0x4a19e1){_0xcf3c2b[_0xad0d('0x1d')]=_0x4a19e1;if(_0x4d45a9[_0xad0d('0x32')][_0xad0d('0x40')]){_0x3111fd[_0xad0d('0x41')]=[{'all':!![]}];}return db[_0xad0d('0x2d')][_0xad0d('0x42')](_0x3111fd);})[_0xad0d('0x25')](function(_0x3eb601){_0xcf3c2b[_0xad0d('0x43')]=_0x3eb601;return _0xcf3c2b;})['then'](respondWithFilteredResult(_0x481e1a,_0x3111fd))[_0xad0d('0x44')](handleError(_0x481e1a,null));};exports[_0xad0d('0x45')]=function(_0x13b83b,_0x1e18ff){var _0x3a1775={'raw':![],'where':{'id':_0x13b83b[_0xad0d('0x46')]['id']}},_0x197be5={};_0x197be5[_0xad0d('0x31')]=_[_0xad0d('0x33')](db[_0xad0d('0x2d')][_0xad0d('0x2e')]);_0x197be5[_0xad0d('0x32')]=_[_0xad0d('0x33')](_0x13b83b[_0xad0d('0x32')]);_0x197be5[_0xad0d('0x34')]=_['intersection'](_0x197be5[_0xad0d('0x31')],_0x197be5[_0xad0d('0x32')]);_0x3a1775[_0xad0d('0x36')]=_[_0xad0d('0x35')](_0x197be5[_0xad0d('0x31')],qs[_0xad0d('0x37')](_0x13b83b[_0xad0d('0x32')][_0xad0d('0x37')]));_0x3a1775[_0xad0d('0x36')]=_0x3a1775[_0xad0d('0x36')]['length']?_0x3a1775[_0xad0d('0x36')]:_0x197be5[_0xad0d('0x31')];if(_0x13b83b[_0xad0d('0x32')]['includeAll']){_0x3a1775[_0xad0d('0x41')]=[{'all':!![]}];}_0x3a1775=_[_0xad0d('0x3d')]({},_0x3a1775,_0x13b83b['options']);return db[_0xad0d('0x2d')]['find'](_0x3a1775)[_0xad0d('0x25')](handleEntityNotFound(_0x1e18ff,null))['then'](respondWithResult(_0x1e18ff,null))['catch'](handleError(_0x1e18ff,null));};exports['create']=function(_0x551316,_0x3a8b00){return db['AnalyticFieldReport']['create'](_0x551316['body'],{})[_0xad0d('0x25')](respondWithResult(_0x3a8b00,0xc9))['catch'](handleError(_0x3a8b00,null));};exports['bulkCreate']=function(_0x43c8d1,_0x25855d){return db['AnalyticFieldReport'][_0xad0d('0x47')](_0x43c8d1[_0xad0d('0x48')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x25855d,0xc9))[_0xad0d('0x44')](handleError(_0x25855d,null));};exports[_0xad0d('0x23')]=function(_0x32bad5,_0x4653db){if(_0x32bad5[_0xad0d('0x48')]['id']){delete _0x32bad5['body']['id'];}return db[_0xad0d('0x2d')][_0xad0d('0x49')]({'where':{'id':_0x32bad5['params']['id']}})['then'](handleEntityNotFound(_0x4653db,null))[_0xad0d('0x25')](saveUpdates(_0x32bad5[_0xad0d('0x48')],null))[_0xad0d('0x25')](respondWithResult(_0x4653db,null))[_0xad0d('0x44')](handleError(_0x4653db,null));};exports['destroy']=function(_0x30c9e9,_0x40e9b2){return db[_0xad0d('0x2d')]['find']({'where':{'id':_0x30c9e9[_0xad0d('0x46')]['id']}})[_0xad0d('0x25')](handleEntityNotFound(_0x40e9b2,null))[_0xad0d('0x25')](removeEntity(_0x40e9b2,null))[_0xad0d('0x44')](handleError(_0x40e9b2,null));};exports[_0xad0d('0x4a')]=function(_0x456c76,_0x414133){return db[_0xad0d('0x2d')]['destroy']({'where':{'id':_0x456c76['query'][_0xad0d('0x4b')]||[]},'raw':![],'individualHooks':!![]})[_0xad0d('0x25')](respondWithResult(_0x414133,0xcc))[_0xad0d('0x44')](handleError(_0x414133,null));};exports[_0xad0d('0x4c')]=function(_0x1cfe3d,_0x13e83e,_0x10c96a){return db[_0xad0d('0x4d')]['findOne']({'where':{'id':_0x1cfe3d[_0xad0d('0x46')]['id']}})['then'](handleEntityNotFound(_0x13e83e,null))[_0xad0d('0x25')](function(_0x2ddde5){if(_0x2ddde5){return db[_0xad0d('0x4e')][_0xad0d('0x4f')](function(_0x5f4198){return db[_0xad0d('0x2d')][_0xad0d('0x24')]({'where':{'CustomReportId':_0x1cfe3d['params']['id']},'transaction':_0x5f4198})[_0xad0d('0x25')](function(_0x76545a){var _0x50cd8f=_[_0xad0d('0x2c')](_0x1cfe3d[_0xad0d('0x48')],function(_0x31df74){delete _0x31df74['id'];_0x31df74['CustomReportId']=_0x1cfe3d[_0xad0d('0x46')]['id'];return _0x31df74;});return db[_0xad0d('0x2d')]['bulkCreate'](_0x50cd8f,{'transaction':_0x5f4198});});})[_0xad0d('0x25')](function(){return db[_0xad0d('0x2d')]['findAll']({'where':{'CustomReportId':_0x1cfe3d[_0xad0d('0x46')]['id']}});});}})[_0xad0d('0x25')](respondWithResult(_0x13e83e,null))[_0xad0d('0x44')](handleError(_0x13e83e,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index fc6b44d..e6aabd8 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 _0x32d7=['rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','AnalyticFieldReport','analytics_report_fields','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x29e91f,_0x19746f){var _0x96024=function(_0xf8d562){while(--_0xf8d562){_0x29e91f['push'](_0x29e91f['shift']());}};_0x96024(++_0x19746f);}(_0x32d7,0x166));var _0x732d=function(_0x65c903,_0x41e920){_0x65c903=_0x65c903-0x0;var _0x23e1d7=_0x32d7[_0x65c903];return _0x23e1d7;};'use strict';var _=require('lodash');var util=require(_0x732d('0x0'));var logger=require(_0x732d('0x1'))('api');var moment=require(_0x732d('0x2'));var BPromise=require(_0x732d('0x3'));var rp=require(_0x732d('0x4'));var fs=require('fs');var path=require(_0x732d('0x5'));var rimraf=require(_0x732d('0x6'));var config=require(_0x732d('0x7'));var attributes=require(_0x732d('0x8'));module[_0x732d('0x9')]=function(_0x2f93ca,_0x1726dc){return _0x2f93ca[_0x732d('0xa')](_0x732d('0xb'),attributes,{'tableName':_0x732d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x50a7=['rimraf','exports','define','AnalyticFieldReport','lodash','util','moment','bluebird','request-promise','path'];(function(_0x2ed7d1,_0x363741){var _0x38ae3c=function(_0x4a1b42){while(--_0x4a1b42){_0x2ed7d1['push'](_0x2ed7d1['shift']());}};_0x38ae3c(++_0x363741);}(_0x50a7,0x19e));var _0x750a=function(_0x250514,_0x389eda){_0x250514=_0x250514-0x0;var _0x59c25b=_0x50a7[_0x250514];return _0x59c25b;};'use strict';var _=require(_0x750a('0x0'));var util=require(_0x750a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x750a('0x2'));var BPromise=require(_0x750a('0x3'));var rp=require(_0x750a('0x4'));var fs=require('fs');var path=require(_0x750a('0x5'));var rimraf=require(_0x750a('0x6'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x750a('0x7')]=function(_0x5eb0c2,_0x214961){return _0x5eb0c2[_0x750a('0x8')](_0x750a('0x9'),attributes,{'tableName':'analytics_report_fields','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.rpc.js b/server/api/analyticFieldReport/analyticFieldReport.rpc.js index 107c4b3..41bd7ed 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 _0xf2a7=['catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x293809,_0x299ed6){var _0x2b0477=function(_0x44a6bd){while(--_0x44a6bd){_0x293809['push'](_0x293809['shift']());}};_0x2b0477(++_0x299ed6);}(_0xf2a7,0x1cd));var _0x7f2a=function(_0xad843c,_0x4d6f04){_0xad843c=_0xad843c-0x0;var _0x75e64a=_0xf2a7[_0xad843c];return _0x75e64a;};'use strict';var _=require(_0x7f2a('0x0'));var util=require(_0x7f2a('0x1'));var moment=require(_0x7f2a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f2a('0x3'));var db=require(_0x7f2a('0x4'))['db'];var utils=require(_0x7f2a('0x5'));var logger=require(_0x7f2a('0x6'))(_0x7f2a('0x7'));var config=require(_0x7f2a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7f2a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x586c9b,_0x95ad64,_0x3c4b08){return new BPromise(function(_0x2626e7,_0xfce62b){return client[_0x7f2a('0xa')](_0x586c9b,_0x3c4b08)[_0x7f2a('0xb')](function(_0x426c16){logger['info'](_0x7f2a('0xc'),_0x95ad64,_0x7f2a('0xd'));logger[_0x7f2a('0xe')](_0x7f2a('0xf'),_0x95ad64,_0x7f2a('0xd'),JSON[_0x7f2a('0x10')](_0x426c16));if(_0x426c16[_0x7f2a('0x11')]){if(_0x426c16[_0x7f2a('0x11')][_0x7f2a('0x12')]===0x1f4){logger[_0x7f2a('0x11')](_0x7f2a('0xc'),_0x95ad64,_0x426c16[_0x7f2a('0x11')][_0x7f2a('0x13')]);return _0xfce62b(_0x426c16[_0x7f2a('0x11')][_0x7f2a('0x13')]);}logger['error'](_0x7f2a('0xc'),_0x95ad64,_0x426c16['error']['message']);return _0x2626e7(_0x426c16[_0x7f2a('0x11')][_0x7f2a('0x13')]);}else{logger[_0x7f2a('0x14')](_0x7f2a('0xc'),_0x95ad64,_0x7f2a('0xd'));_0x2626e7(_0x426c16[_0x7f2a('0x15')][_0x7f2a('0x13')]);}})[_0x7f2a('0x16')](function(_0x531a8f){logger[_0x7f2a('0x11')](_0x7f2a('0xc'),_0x95ad64,_0x531a8f);_0xfce62b(_0x531a8f);});});} \ No newline at end of file +var _0x9be3=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','catch'];(function(_0x42daa3,_0x34da1){var _0x316faf=function(_0x3beb85){while(--_0x3beb85){_0x42daa3['push'](_0x42daa3['shift']());}};_0x316faf(++_0x34da1);}(_0x9be3,0x1a4));var _0x39be=function(_0xf61bc2,_0x3d535e){_0xf61bc2=_0xf61bc2-0x0;var _0x1c6c56=_0x9be3[_0xf61bc2];return _0x1c6c56;};'use strict';var _=require(_0x39be('0x0'));var util=require(_0x39be('0x1'));var moment=require(_0x39be('0x2'));var BPromise=require(_0x39be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39be('0x4'));var db=require(_0x39be('0x5'))['db'];var utils=require(_0x39be('0x6'));var logger=require(_0x39be('0x7'))(_0x39be('0x8'));var config=require(_0x39be('0x9'));var jayson=require(_0x39be('0xa'));var client=jayson['client'][_0x39be('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x495255,_0x23a3cf,_0x3ef9fd){return new BPromise(function(_0x25c84d,_0x1afe0c){return client[_0x39be('0xc')](_0x495255,_0x3ef9fd)[_0x39be('0xd')](function(_0x43d9c9){logger[_0x39be('0xe')](_0x39be('0xf'),_0x23a3cf,_0x39be('0x10'));logger['debug'](_0x39be('0x11'),_0x23a3cf,_0x39be('0x10'),JSON['stringify'](_0x43d9c9));if(_0x43d9c9[_0x39be('0x12')]){if(_0x43d9c9['error']['code']===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x23a3cf,_0x43d9c9['error'][_0x39be('0x13')]);return _0x1afe0c(_0x43d9c9[_0x39be('0x12')][_0x39be('0x13')]);}logger['error'](_0x39be('0xf'),_0x23a3cf,_0x43d9c9[_0x39be('0x12')][_0x39be('0x13')]);return _0x25c84d(_0x43d9c9[_0x39be('0x12')][_0x39be('0x13')]);}else{logger['info'](_0x39be('0xf'),_0x23a3cf,_0x39be('0x10'));_0x25c84d(_0x43d9c9['result'][_0x39be('0x13')]);}})[_0x39be('0x14')](function(_0xad31e5){logger[_0x39be('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x23a3cf,_0xad31e5);_0x1afe0c(_0xad31e5);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 1a328a8..f49da89 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 _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(_0x5d07ac,_0x119581){var _0x3da334=function(_0x5b0d81){while(--_0x5b0d81){_0x5d07ac['push'](_0x5d07ac['shift']());}};_0x3da334(++_0x119581);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e21f4,_0x43d310){_0x3e21f4=_0x3e21f4-0x0;var _0x40fc49=_0x5fc3[_0x3e21f4];return _0x40fc49;};'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 +var _0x7217=['put','update','delete','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields'];(function(_0x13fd59,_0x2e05b1){var _0x2e6ce7=function(_0x519a4b){while(--_0x519a4b){_0x13fd59['push'](_0x13fd59['shift']());}};_0x2e6ce7(++_0x2e05b1);}(_0x7217,0x19e));var _0x7721=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x7217[_0x5ddb1c];return _0x354adc;};'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('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xc')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0x10'),auth[_0x7721('0x8')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x13')]);router[_0x7721('0x14')]('/destroy_many',auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 46ef2e7..83cba2f 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 _0xd87e=['STRING','TEXT','sequelize','exports','name'];(function(_0x464c6a,_0x5933a7){var _0xb32c1e=function(_0x1a99df){while(--_0x1a99df){_0x464c6a['push'](_0x464c6a['shift']());}};_0xb32c1e(++_0x5933a7);}(_0xd87e,0x1bf));var _0xed87=function(_0x60dad1,_0x44a161){_0x60dad1=_0x60dad1-0x0;var _0x512282=_0xd87e[_0x60dad1];return _0x512282;};'use strict';var Sequelize=require(_0xed87('0x0'));module[_0xed87('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xed87('0x2')},'table':{'type':Sequelize[_0xed87('0x3')]},'metric':{'type':Sequelize[_0xed87('0x4')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd844=['STRING','sequelize','exports','name'];(function(_0x4d4856,_0x182e1e){var _0x27708f=function(_0x241230){while(--_0x241230){_0x4d4856['push'](_0x4d4856['shift']());}};_0x27708f(++_0x182e1e);}(_0xd844,0x6d));var _0x4d84=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xd844[_0x4a9fb1];return _0x348672;};'use strict';var Sequelize=require(_0x4d84('0x0'));module[_0x4d84('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4d84('0x2')},'table':{'type':Sequelize[_0x4d84('0x3')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index 80d0a42..9a3e310 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 _0xd1ad=['role','Metrics','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','then','UserProfileResource','end','error','stack','name','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','AnalyticMetric','rows','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x8e26f8,_0x2f9190){var _0xc37de0=function(_0x52a51c){while(--_0x52a51c){_0x8e26f8['push'](_0x8e26f8['shift']());}};_0xc37de0(++_0x2f9190);}(_0xd1ad,0xf6));var _0xdd1a=function(_0x473ee7,_0x4dd754){_0x473ee7=_0x473ee7-0x0;var _0x30f0d4=_0xd1ad[_0x473ee7];return _0x30f0d4;};'use strict';var pdf=require(_0xdd1a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdd1a('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd1a('0x2'));var moment=require('moment');var BPromise=require(_0xdd1a('0x3'));var Mustache=require(_0xdd1a('0x4'));var util=require(_0xdd1a('0x5'));var path=require(_0xdd1a('0x6'));var sox=require('sox');var csv=require(_0xdd1a('0x7'));var ejs=require(_0xdd1a('0x8'));var fs=require('fs');var _=require(_0xdd1a('0x9'));var squel=require('squel');var crypto=require(_0xdd1a('0xa'));var jsforce=require(_0xdd1a('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdd1a('0x7'));var querystring=require(_0xdd1a('0xc'));var Papa=require(_0xdd1a('0xd'));var Redis=require('ioredis');var authService=require(_0xdd1a('0xe'));var qs=require(_0xdd1a('0xf'));var as=require(_0xdd1a('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdd1a('0x11'))(_0xdd1a('0x12'));var utils=require(_0xdd1a('0x13'));var config=require(_0xdd1a('0x14'));var db=require(_0xdd1a('0x15'))['db'];function respondWithStatusCode(_0x55e8ec,_0x3ffcdb){_0x3ffcdb=_0x3ffcdb||0xcc;return function(_0x1c1052){if(_0x1c1052){return _0x55e8ec[_0xdd1a('0x16')](_0x3ffcdb);}return _0x55e8ec[_0xdd1a('0x17')](_0x3ffcdb)['end']();};}function respondWithResult(_0x5681a5,_0x226180){_0x226180=_0x226180||0xc8;return function(_0x55e73f){if(_0x55e73f){return _0x5681a5[_0xdd1a('0x17')](_0x226180)['json'](_0x55e73f);}};}function respondWithFilteredResult(_0x3c5cb5,_0x3b2aa9){return function(_0x53cfa2){if(_0x53cfa2){var _0x20d2bc=_0x53cfa2[_0xdd1a('0x18')],_0x20798a=_0x3b2aa9['offset'],_0x10d8dd=_0x3b2aa9[_0xdd1a('0x19')]+_0x3b2aa9[_0xdd1a('0x1a')],_0x3c3a8b;if(_0x10d8dd>=_0x20d2bc){_0x10d8dd=_0x20d2bc;_0x3c3a8b=0xc8;}else{_0x3c3a8b=0xce;}_0x3c5cb5[_0xdd1a('0x17')](_0x3c3a8b);return _0x3c5cb5[_0xdd1a('0x1b')](_0xdd1a('0x1c'),_0x20798a+'-'+_0x10d8dd+'/'+_0x20d2bc)[_0xdd1a('0x1d')](_0x53cfa2);}return null;};}function patchUpdates(_0x5779c3){return function(_0x6aa3a9){try{jsonpatch['apply'](_0x6aa3a9,_0x5779c3,!![]);}catch(_0x34d602){return BPromise[_0xdd1a('0x1e')](_0x34d602);}return _0x6aa3a9[_0xdd1a('0x1f')]();};}function saveUpdates(_0x411978,_0x35ed29){return function(_0x22c5f5){if(_0x22c5f5){return _0x22c5f5[_0xdd1a('0x20')](_0x411978)['then'](function(_0x5b4253){return _0x5b4253;});}return null;};}function removeEntity(_0x73715b,_0x40cbf1){return function(_0x2e9336){if(_0x2e9336){return _0x2e9336[_0xdd1a('0x21')]()[_0xdd1a('0x22')](function(){var _0x5d3a51=_0x2e9336['get']({'plain':!![]});var _0x495aa5='Metrics';return db[_0xdd1a('0x23')][_0xdd1a('0x21')]({'where':{'type':_0x495aa5,'resourceId':_0x5d3a51['id']}})[_0xdd1a('0x22')](function(){return _0x2e9336;});})[_0xdd1a('0x22')](function(){_0x73715b['status'](0xcc)[_0xdd1a('0x24')]();});}};}function handleEntityNotFound(_0x382d1a,_0x1bf3e3){return function(_0x5262d6){if(!_0x5262d6){_0x382d1a[_0xdd1a('0x16')](0x194);}return _0x5262d6;};}function handleError(_0x10a4ab,_0x516f4f){_0x516f4f=_0x516f4f||0x1f4;return function(_0x51bbd1){logger[_0xdd1a('0x25')](_0x51bbd1[_0xdd1a('0x26')]);if(_0x51bbd1[_0xdd1a('0x27')]){delete _0x51bbd1[_0xdd1a('0x27')];}_0x10a4ab['status'](_0x516f4f)['send'](_0x51bbd1);};}exports['index']=function(_0x329120,_0x4eca8c){var _0xe1f3fe={},_0x382fff={},_0x1cc90e={'count':0x0,'rows':[]};var _0x3d5607=_[_0xdd1a('0x28')](db['AnalyticMetric']['rawAttributes'],function(_0x50f28e){return{'name':_0x50f28e[_0xdd1a('0x29')],'type':_0x50f28e[_0xdd1a('0x2a')][_0xdd1a('0x2b')]};});_0x382fff['model']=_['map'](_0x3d5607,_0xdd1a('0x27'));_0x382fff[_0xdd1a('0x2c')]=_[_0xdd1a('0x2d')](_0x329120[_0xdd1a('0x2c')]);_0x382fff[_0xdd1a('0x2e')]=_[_0xdd1a('0x2f')](_0x382fff[_0xdd1a('0x30')],_0x382fff[_0xdd1a('0x2c')]);_0xe1f3fe[_0xdd1a('0x31')]=_['intersection'](_0x382fff[_0xdd1a('0x30')],qs[_0xdd1a('0x32')](_0x329120['query'][_0xdd1a('0x32')]));_0xe1f3fe[_0xdd1a('0x31')]=_0xe1f3fe[_0xdd1a('0x31')][_0xdd1a('0x33')]?_0xe1f3fe['attributes']:_0x382fff[_0xdd1a('0x30')];if(!_0x329120[_0xdd1a('0x2c')]['hasOwnProperty'](_0xdd1a('0x34'))){_0xe1f3fe[_0xdd1a('0x1a')]=qs['limit'](_0x329120[_0xdd1a('0x2c')][_0xdd1a('0x1a')]);_0xe1f3fe[_0xdd1a('0x19')]=qs[_0xdd1a('0x19')](_0x329120[_0xdd1a('0x2c')][_0xdd1a('0x19')]);}_0xe1f3fe[_0xdd1a('0x35')]=qs[_0xdd1a('0x36')](_0x329120['query'][_0xdd1a('0x36')]);_0xe1f3fe['where']=qs['filters'](_[_0xdd1a('0x37')](_0x329120[_0xdd1a('0x2c')],_0x382fff[_0xdd1a('0x2e')]));if(_0x329120[_0xdd1a('0x2c')][_0xdd1a('0x38')]){_0xe1f3fe[_0xdd1a('0x39')]=_[_0xdd1a('0x3a')](_0xe1f3fe[_0xdd1a('0x39')],{'$or':_[_0xdd1a('0x28')](_0x3d5607,function(_0xd3e13f){if(_0xd3e13f[_0xdd1a('0x2a')]!==_0xdd1a('0x3b')){var _0x344189={};_0x344189[_0xd3e13f['name']]={'$like':'%'+_0x329120[_0xdd1a('0x2c')][_0xdd1a('0x38')]+'%'};return _0x344189;}})});}_0xe1f3fe=_[_0xdd1a('0x3a')]({},_0xe1f3fe,_0x329120['options']);var _0x537512={'where':_0xe1f3fe[_0xdd1a('0x39')]};return db['AnalyticMetric'][_0xdd1a('0x18')](_0x537512)[_0xdd1a('0x22')](function(_0x4f0540){_0x1cc90e[_0xdd1a('0x18')]=_0x4f0540;if(_0x329120['query'][_0xdd1a('0x3c')]){_0xe1f3fe[_0xdd1a('0x3d')]=[{'all':!![]}];}return db[_0xdd1a('0x3e')]['findAll'](_0xe1f3fe);})['then'](function(_0x3bb42e){_0x1cc90e[_0xdd1a('0x3f')]=_0x3bb42e;return _0x1cc90e;})[_0xdd1a('0x22')](respondWithFilteredResult(_0x4eca8c,_0xe1f3fe))[_0xdd1a('0x40')](handleError(_0x4eca8c,null));};exports[_0xdd1a('0x41')]=function(_0x4403c5,_0x33e361){var _0xdf5353={'raw':!![],'where':{'id':_0x4403c5[_0xdd1a('0x42')]['id']}},_0x306806={};_0x306806[_0xdd1a('0x30')]=_[_0xdd1a('0x2d')](db[_0xdd1a('0x3e')]['rawAttributes']);_0x306806[_0xdd1a('0x2c')]=_[_0xdd1a('0x2d')](_0x4403c5[_0xdd1a('0x2c')]);_0x306806['filters']=_[_0xdd1a('0x2f')](_0x306806[_0xdd1a('0x30')],_0x306806['query']);_0xdf5353[_0xdd1a('0x31')]=_[_0xdd1a('0x2f')](_0x306806[_0xdd1a('0x30')],qs[_0xdd1a('0x32')](_0x4403c5[_0xdd1a('0x2c')][_0xdd1a('0x32')]));_0xdf5353[_0xdd1a('0x31')]=_0xdf5353['attributes']['length']?_0xdf5353[_0xdd1a('0x31')]:_0x306806[_0xdd1a('0x30')];if(_0x4403c5[_0xdd1a('0x2c')]['includeAll']){_0xdf5353[_0xdd1a('0x3d')]=[{'all':!![]}];}_0xdf5353=_[_0xdd1a('0x3a')]({},_0xdf5353,_0x4403c5[_0xdd1a('0x43')]);return db[_0xdd1a('0x3e')][_0xdd1a('0x44')](_0xdf5353)[_0xdd1a('0x22')](handleEntityNotFound(_0x33e361,null))[_0xdd1a('0x22')](respondWithResult(_0x33e361,null))[_0xdd1a('0x40')](handleError(_0x33e361,null));};exports[_0xdd1a('0x45')]=function(_0x19bc6e,_0x1cedf7){return db['AnalyticMetric'][_0xdd1a('0x45')](_0x19bc6e[_0xdd1a('0x46')],{})[_0xdd1a('0x22')](function(_0x2fafe1){var _0x4e2f92=_0x19bc6e[_0xdd1a('0x47')][_0xdd1a('0x48')]({'plain':!![]});if(!_0x4e2f92)throw new Error(_0xdd1a('0x49'));if(_0x4e2f92[_0xdd1a('0x4a')]===_0xdd1a('0x47')){var _0x32e164=_0x2fafe1[_0xdd1a('0x48')]({'plain':!![]});var _0x50f400=_0xdd1a('0x4b');return db[_0xdd1a('0x4c')]['find']({'where':{'name':_0x50f400,'userProfileId':_0x4e2f92[_0xdd1a('0x4d')]},'raw':!![]})[_0xdd1a('0x22')](function(_0x1659e6){if(_0x1659e6&&_0x1659e6[_0xdd1a('0x4e')]===0x0){return db[_0xdd1a('0x23')]['create']({'name':_0x32e164[_0xdd1a('0x27')],'resourceId':_0x32e164['id'],'type':_0x1659e6[_0xdd1a('0x27')],'sectionId':_0x1659e6['id']},{})[_0xdd1a('0x22')](function(){return _0x2fafe1;});}else{return _0x2fafe1;}})['catch'](function(_0x586a91){logger[_0xdd1a('0x25')](_0xdd1a('0x4f'),_0x586a91);throw _0x586a91;});}return _0x2fafe1;})[_0xdd1a('0x22')](respondWithResult(_0x1cedf7,0xc9))['catch'](handleError(_0x1cedf7,null));};exports['update']=function(_0x54eda4,_0x3b4c30){if(_0x54eda4['body']['id']){delete _0x54eda4['body']['id'];}return db['AnalyticMetric'][_0xdd1a('0x44')]({'where':{'id':_0x54eda4[_0xdd1a('0x42')]['id']}})[_0xdd1a('0x22')](handleEntityNotFound(_0x3b4c30,null))[_0xdd1a('0x22')](saveUpdates(_0x54eda4[_0xdd1a('0x46')],null))[_0xdd1a('0x22')](respondWithResult(_0x3b4c30,null))[_0xdd1a('0x40')](handleError(_0x3b4c30,null));};exports['destroy']=function(_0x91e0d7,_0x59bcfa){return db[_0xdd1a('0x3e')]['find']({'where':{'id':_0x91e0d7[_0xdd1a('0x42')]['id']}})[_0xdd1a('0x22')](handleEntityNotFound(_0x59bcfa,null))[_0xdd1a('0x22')](removeEntity(_0x59bcfa,null))['catch'](handleError(_0x59bcfa,null));}; \ No newline at end of file +var _0x2c50=['rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','update','then','destroy','Metrics','UserProfileResource','name','send','index','map','AnalyticMetric','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x2c50,0x9f));var _0x02c5=function(_0xdd82b4,_0x5cd8b8){_0xdd82b4=_0xdd82b4-0x0;var _0x549bb2=_0x2c50[_0xdd82b4];return _0x549bb2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x02c5('0x0'));var rimraf=require(_0x02c5('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x02c5('0x2'));var rp=require(_0x02c5('0x3'));var moment=require(_0x02c5('0x4'));var BPromise=require(_0x02c5('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x02c5('0x6'));var sox=require(_0x02c5('0x7'));var csv=require(_0x02c5('0x8'));var ejs=require(_0x02c5('0x9'));var fs=require('fs');var _=require(_0x02c5('0xa'));var squel=require(_0x02c5('0xb'));var crypto=require(_0x02c5('0xc'));var jsforce=require(_0x02c5('0xd'));var deskjs=require(_0x02c5('0xe'));var toCsv=require(_0x02c5('0x8'));var querystring=require('querystring');var Papa=require(_0x02c5('0xf'));var Redis=require(_0x02c5('0x10'));var authService=require(_0x02c5('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x02c5('0x12'));var hardwareService=require(_0x02c5('0x13'));var logger=require(_0x02c5('0x14'))(_0x02c5('0x15'));var utils=require(_0x02c5('0x16'));var config=require(_0x02c5('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54700c,_0x2b9df3){_0x2b9df3=_0x2b9df3||0xcc;return function(_0x148576){if(_0x148576){return _0x54700c[_0x02c5('0x18')](_0x2b9df3);}return _0x54700c[_0x02c5('0x19')](_0x2b9df3)[_0x02c5('0x1a')]();};}function respondWithResult(_0x4d6a0e,_0x46410f){_0x46410f=_0x46410f||0xc8;return function(_0x42ecb7){if(_0x42ecb7){return _0x4d6a0e[_0x02c5('0x19')](_0x46410f)[_0x02c5('0x1b')](_0x42ecb7);}};}function respondWithFilteredResult(_0x23ec30,_0x3197c1){return function(_0x1013ef){if(_0x1013ef){var _0xf1d46b=_0x1013ef[_0x02c5('0x1c')],_0x5a88e0=_0x3197c1[_0x02c5('0x1d')],_0x5f2991=_0x3197c1[_0x02c5('0x1d')]+_0x3197c1['limit'],_0x55c5e0;if(_0x5f2991>=_0xf1d46b){_0x5f2991=_0xf1d46b;_0x55c5e0=0xc8;}else{_0x55c5e0=0xce;}_0x23ec30[_0x02c5('0x19')](_0x55c5e0);return _0x23ec30['set'](_0x02c5('0x1e'),_0x5a88e0+'-'+_0x5f2991+'/'+_0xf1d46b)[_0x02c5('0x1b')](_0x1013ef);}return null;};}function patchUpdates(_0x5a8d72){return function(_0x2b316c){try{jsonpatch[_0x02c5('0x1f')](_0x2b316c,_0x5a8d72,!![]);}catch(_0x41780d){return BPromise[_0x02c5('0x20')](_0x41780d);}return _0x2b316c['save']();};}function saveUpdates(_0x4753d9,_0x368cc6){return function(_0x1f9f17){if(_0x1f9f17){return _0x1f9f17[_0x02c5('0x21')](_0x4753d9)[_0x02c5('0x22')](function(_0x37e203){return _0x37e203;});}return null;};}function removeEntity(_0x28c22f,_0x3f549d){return function(_0x453c2c){if(_0x453c2c){return _0x453c2c[_0x02c5('0x23')]()[_0x02c5('0x22')](function(){var _0x49ed35=_0x453c2c['get']({'plain':!![]});var _0x4d7cc3=_0x02c5('0x24');return db[_0x02c5('0x25')]['destroy']({'where':{'type':_0x4d7cc3,'resourceId':_0x49ed35['id']}})[_0x02c5('0x22')](function(){return _0x453c2c;});})[_0x02c5('0x22')](function(){_0x28c22f['status'](0xcc)[_0x02c5('0x1a')]();});}};}function handleEntityNotFound(_0x58e414,_0x43d657){return function(_0x1e6170){if(!_0x1e6170){_0x58e414[_0x02c5('0x18')](0x194);}return _0x1e6170;};}function handleError(_0x197105,_0x17111e){_0x17111e=_0x17111e||0x1f4;return function(_0xd24953){logger['error'](_0xd24953['stack']);if(_0xd24953[_0x02c5('0x26')]){delete _0xd24953[_0x02c5('0x26')];}_0x197105[_0x02c5('0x19')](_0x17111e)[_0x02c5('0x27')](_0xd24953);};}exports[_0x02c5('0x28')]=function(_0x1dabca,_0x13c814){var _0x3c69a2={},_0x1dbdca={},_0x56b4b6={'count':0x0,'rows':[]};var _0x6369a0=_[_0x02c5('0x29')](db[_0x02c5('0x2a')]['rawAttributes'],function(_0xde57fc){return{'name':_0xde57fc[_0x02c5('0x2b')],'type':_0xde57fc[_0x02c5('0x2c')][_0x02c5('0x2d')]};});_0x1dbdca[_0x02c5('0x2e')]=_[_0x02c5('0x29')](_0x6369a0,_0x02c5('0x26'));_0x1dbdca['query']=_[_0x02c5('0x2f')](_0x1dabca[_0x02c5('0x30')]);_0x1dbdca[_0x02c5('0x31')]=_[_0x02c5('0x32')](_0x1dbdca[_0x02c5('0x2e')],_0x1dbdca[_0x02c5('0x30')]);_0x3c69a2[_0x02c5('0x33')]=_['intersection'](_0x1dbdca[_0x02c5('0x2e')],qs[_0x02c5('0x34')](_0x1dabca[_0x02c5('0x30')][_0x02c5('0x34')]));_0x3c69a2[_0x02c5('0x33')]=_0x3c69a2[_0x02c5('0x33')][_0x02c5('0x35')]?_0x3c69a2[_0x02c5('0x33')]:_0x1dbdca[_0x02c5('0x2e')];if(!_0x1dabca[_0x02c5('0x30')][_0x02c5('0x36')]('nolimit')){_0x3c69a2[_0x02c5('0x37')]=qs[_0x02c5('0x37')](_0x1dabca[_0x02c5('0x30')][_0x02c5('0x37')]);_0x3c69a2[_0x02c5('0x1d')]=qs['offset'](_0x1dabca[_0x02c5('0x30')][_0x02c5('0x1d')]);}_0x3c69a2[_0x02c5('0x38')]=qs[_0x02c5('0x39')](_0x1dabca['query']['sort']);_0x3c69a2[_0x02c5('0x3a')]=qs[_0x02c5('0x31')](_['pick'](_0x1dabca[_0x02c5('0x30')],_0x1dbdca['filters']));if(_0x1dabca[_0x02c5('0x30')][_0x02c5('0x3b')]){_0x3c69a2['where']=_[_0x02c5('0x3c')](_0x3c69a2[_0x02c5('0x3a')],{'$or':_[_0x02c5('0x29')](_0x6369a0,function(_0x692588){if(_0x692588['type']!==_0x02c5('0x3d')){var _0x35eca8={};_0x35eca8[_0x692588['name']]={'$like':'%'+_0x1dabca['query'][_0x02c5('0x3b')]+'%'};return _0x35eca8;}})});}_0x3c69a2=_[_0x02c5('0x3c')]({},_0x3c69a2,_0x1dabca[_0x02c5('0x3e')]);var _0x349e38={'where':_0x3c69a2['where']};return db[_0x02c5('0x2a')][_0x02c5('0x1c')](_0x349e38)[_0x02c5('0x22')](function(_0x181617){_0x56b4b6[_0x02c5('0x1c')]=_0x181617;if(_0x1dabca[_0x02c5('0x30')][_0x02c5('0x3f')]){_0x3c69a2['include']=[{'all':!![]}];}return db['AnalyticMetric'][_0x02c5('0x40')](_0x3c69a2);})[_0x02c5('0x22')](function(_0x257d2b){_0x56b4b6[_0x02c5('0x41')]=_0x257d2b;return _0x56b4b6;})[_0x02c5('0x22')](respondWithFilteredResult(_0x13c814,_0x3c69a2))[_0x02c5('0x42')](handleError(_0x13c814,null));};exports[_0x02c5('0x43')]=function(_0x16be40,_0x6d213e){var _0x5c0c29={'raw':!![],'where':{'id':_0x16be40[_0x02c5('0x44')]['id']}},_0x303247={};_0x303247[_0x02c5('0x2e')]=_[_0x02c5('0x2f')](db['AnalyticMetric'][_0x02c5('0x45')]);_0x303247[_0x02c5('0x30')]=_[_0x02c5('0x2f')](_0x16be40['query']);_0x303247[_0x02c5('0x31')]=_[_0x02c5('0x32')](_0x303247[_0x02c5('0x2e')],_0x303247[_0x02c5('0x30')]);_0x5c0c29[_0x02c5('0x33')]=_[_0x02c5('0x32')](_0x303247['model'],qs[_0x02c5('0x34')](_0x16be40[_0x02c5('0x30')][_0x02c5('0x34')]));_0x5c0c29[_0x02c5('0x33')]=_0x5c0c29['attributes'][_0x02c5('0x35')]?_0x5c0c29[_0x02c5('0x33')]:_0x303247[_0x02c5('0x2e')];if(_0x16be40[_0x02c5('0x30')]['includeAll']){_0x5c0c29[_0x02c5('0x46')]=[{'all':!![]}];}_0x5c0c29=_[_0x02c5('0x3c')]({},_0x5c0c29,_0x16be40['options']);return db[_0x02c5('0x2a')][_0x02c5('0x47')](_0x5c0c29)[_0x02c5('0x22')](handleEntityNotFound(_0x6d213e,null))[_0x02c5('0x22')](respondWithResult(_0x6d213e,null))[_0x02c5('0x42')](handleError(_0x6d213e,null));};exports[_0x02c5('0x48')]=function(_0x292d41,_0x506a3e){return db[_0x02c5('0x2a')][_0x02c5('0x48')](_0x292d41[_0x02c5('0x49')],{})[_0x02c5('0x22')](function(_0x2633e2){var _0x2e0260=_0x292d41[_0x02c5('0x4a')]['get']({'plain':!![]});if(!_0x2e0260)throw new Error(_0x02c5('0x4b'));if(_0x2e0260['role']==='user'){var _0x3c42f8=_0x2633e2['get']({'plain':!![]});var _0x56dd86='Metrics';return db[_0x02c5('0x4c')][_0x02c5('0x47')]({'where':{'name':_0x56dd86,'userProfileId':_0x2e0260['userProfileId']},'raw':!![]})[_0x02c5('0x22')](function(_0x4e8f7){if(_0x4e8f7&&_0x4e8f7[_0x02c5('0x4d')]===0x0){return db['UserProfileResource'][_0x02c5('0x48')]({'name':_0x3c42f8[_0x02c5('0x26')],'resourceId':_0x3c42f8['id'],'type':_0x4e8f7[_0x02c5('0x26')],'sectionId':_0x4e8f7['id']},{})[_0x02c5('0x22')](function(){return _0x2633e2;});}else{return _0x2633e2;}})[_0x02c5('0x42')](function(_0x25027b){logger[_0x02c5('0x4e')](_0x02c5('0x4f'),_0x25027b);throw _0x25027b;});}return _0x2633e2;})[_0x02c5('0x22')](respondWithResult(_0x506a3e,0xc9))['catch'](handleError(_0x506a3e,null));};exports[_0x02c5('0x21')]=function(_0x1045e5,_0x1c8503){if(_0x1045e5[_0x02c5('0x49')]['id']){delete _0x1045e5[_0x02c5('0x49')]['id'];}return db['AnalyticMetric'][_0x02c5('0x47')]({'where':{'id':_0x1045e5[_0x02c5('0x44')]['id']}})[_0x02c5('0x22')](handleEntityNotFound(_0x1c8503,null))['then'](saveUpdates(_0x1045e5[_0x02c5('0x49')],null))[_0x02c5('0x22')](respondWithResult(_0x1c8503,null))[_0x02c5('0x42')](handleError(_0x1c8503,null));};exports[_0x02c5('0x23')]=function(_0xdefecf,_0x53c2ae){return db[_0x02c5('0x2a')][_0x02c5('0x47')]({'where':{'id':_0xdefecf[_0x02c5('0x44')]['id']}})[_0x02c5('0x22')](handleEntityNotFound(_0x53c2ae,null))['then'](removeEntity(_0x53c2ae,null))[_0x02c5('0x42')](handleError(_0x53c2ae,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index bd8d547..d09a93a 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 _0x1d63=['api','bluebird','path','./analyticMetric.attributes','define','AnalyticMetric','analytics_metrics','lodash','util','../../config/logger'];(function(_0x55eb57,_0x1011e2){var _0x55ca29=function(_0xad5a1d){while(--_0xad5a1d){_0x55eb57['push'](_0x55eb57['shift']());}};_0x55ca29(++_0x1011e2);}(_0x1d63,0x183));var _0x31d6=function(_0x5d49dc,_0x264831){_0x5d49dc=_0x5d49dc-0x0;var _0x50059f=_0x1d63[_0x5d49dc];return _0x50059f;};'use strict';var _=require(_0x31d6('0x0'));var util=require(_0x31d6('0x1'));var logger=require(_0x31d6('0x2'))(_0x31d6('0x3'));var moment=require('moment');var BPromise=require(_0x31d6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x31d6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x31d6('0x6'));module['exports']=function(_0x52ca90,_0x5b7904){return _0x52ca90[_0x31d6('0x7')](_0x31d6('0x8'),attributes,{'tableName':_0x31d6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbee3=['analytics_metrics','lodash','moment','bluebird','request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xbee3,0x151));var _0x3bee=function(_0x32ac32,_0x1804d7){_0x32ac32=_0x32ac32-0x0;var _0x213e6f=_0xbee3[_0x32ac32];return _0x213e6f;};'use strict';var _=require(_0x3bee('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x3bee('0x1'));var BPromise=require(_0x3bee('0x2'));var rp=require(_0x3bee('0x3'));var fs=require('fs');var path=require(_0x3bee('0x4'));var rimraf=require(_0x3bee('0x5'));var config=require(_0x3bee('0x6'));var attributes=require(_0x3bee('0x7'));module[_0x3bee('0x8')]=function(_0x54a9d7,_0x2f6a24){return _0x54a9d7[_0x3bee('0x9')](_0x3bee('0xa'),attributes,{'tableName':_0x3bee('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.rpc.js b/server/api/analyticMetric/analyticMetric.rpc.js index d75cada..42796fd 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 _0xbb2b=['request\x20sent','stringify','error','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s'];(function(_0x8840c6,_0x4f6528){var _0x33a378=function(_0x4ef44f){while(--_0x4ef44f){_0x8840c6['push'](_0x8840c6['shift']());}};_0x33a378(++_0x4f6528);}(_0xbb2b,0x89));var _0xbbb2=function(_0x18f36e,_0x1d29a5){_0x18f36e=_0x18f36e-0x0;var _0x57abe7=_0xbb2b[_0x18f36e];return _0x57abe7;};'use strict';var _=require(_0xbbb2('0x0'));var util=require(_0xbbb2('0x1'));var moment=require('moment');var BPromise=require(_0xbbb2('0x2'));var rs=require(_0xbbb2('0x3'));var fs=require('fs');var Redis=require(_0xbbb2('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbbb2('0x5'));var logger=require(_0xbbb2('0x6'))('rpc');var config=require(_0xbbb2('0x7'));var jayson=require(_0xbbb2('0x8'));var client=jayson[_0xbbb2('0x9')][_0xbbb2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x58cec3,_0x1cf3c4,_0x18b040){return new BPromise(function(_0x193309,_0x5b07e5){return client['request'](_0x58cec3,_0x18b040)['then'](function(_0x6671ad){logger[_0xbbb2('0xb')](_0xbbb2('0xc'),_0x1cf3c4,'request\x20sent');logger[_0xbbb2('0xd')](_0xbbb2('0xe'),_0x1cf3c4,_0xbbb2('0xf'),JSON[_0xbbb2('0x10')](_0x6671ad));if(_0x6671ad['error']){if(_0x6671ad[_0xbbb2('0x11')]['code']===0x1f4){logger['error'](_0xbbb2('0xc'),_0x1cf3c4,_0x6671ad[_0xbbb2('0x11')][_0xbbb2('0x12')]);return _0x5b07e5(_0x6671ad[_0xbbb2('0x11')][_0xbbb2('0x12')]);}logger['error']('AnalyticMetric,\x20%s,\x20%s',_0x1cf3c4,_0x6671ad[_0xbbb2('0x11')][_0xbbb2('0x12')]);return _0x193309(_0x6671ad[_0xbbb2('0x11')][_0xbbb2('0x12')]);}else{logger['info'](_0xbbb2('0xc'),_0x1cf3c4,'request\x20sent');_0x193309(_0x6671ad['result'][_0xbbb2('0x12')]);}})['catch'](function(_0x444e5d){logger[_0xbbb2('0x11')](_0xbbb2('0xc'),_0x1cf3c4,_0x444e5d);_0x5b07e5(_0x444e5d);});});} \ No newline at end of file +var _0x2bcb=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0x34ee9f,_0x1e6ab5){var _0x44f071=function(_0x1be3db){while(--_0x1be3db){_0x34ee9f['push'](_0x34ee9f['shift']());}};_0x44f071(++_0x1e6ab5);}(_0x2bcb,0x14b));var _0xb2bc=function(_0x479fa8,_0x5094d7){_0x479fa8=_0x479fa8-0x0;var _0x558f97=_0x2bcb[_0x479fa8];return _0x558f97;};'use strict';var _=require(_0xb2bc('0x0'));var util=require(_0xb2bc('0x1'));var moment=require('moment');var BPromise=require(_0xb2bc('0x2'));var rs=require(_0xb2bc('0x3'));var fs=require('fs');var Redis=require(_0xb2bc('0x4'));var db=require(_0xb2bc('0x5'))['db'];var utils=require(_0xb2bc('0x6'));var logger=require(_0xb2bc('0x7'))(_0xb2bc('0x8'));var config=require(_0xb2bc('0x9'));var jayson=require(_0xb2bc('0xa'));var client=jayson[_0xb2bc('0xb')][_0xb2bc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x6f259b,_0x393435,_0x24fd73){return new BPromise(function(_0x927ba9,_0x3c160c){return client[_0xb2bc('0xd')](_0x6f259b,_0x24fd73)[_0xb2bc('0xe')](function(_0x2d4ff7){logger[_0xb2bc('0xf')](_0xb2bc('0x10'),_0x393435,_0xb2bc('0x11'));logger[_0xb2bc('0x12')](_0xb2bc('0x13'),_0x393435,_0xb2bc('0x11'),JSON['stringify'](_0x2d4ff7));if(_0x2d4ff7[_0xb2bc('0x14')]){if(_0x2d4ff7['error'][_0xb2bc('0x15')]===0x1f4){logger['error'](_0xb2bc('0x10'),_0x393435,_0x2d4ff7['error']['message']);return _0x3c160c(_0x2d4ff7[_0xb2bc('0x14')][_0xb2bc('0x16')]);}logger[_0xb2bc('0x14')](_0xb2bc('0x10'),_0x393435,_0x2d4ff7['error'][_0xb2bc('0x16')]);return _0x927ba9(_0x2d4ff7[_0xb2bc('0x14')][_0xb2bc('0x16')]);}else{logger[_0xb2bc('0xf')](_0xb2bc('0x10'),_0x393435,_0xb2bc('0x11'));_0x927ba9(_0x2d4ff7['result'][_0xb2bc('0x16')]);}})[_0xb2bc('0x17')](function(_0x1abaa4){logger['error'](_0xb2bc('0x10'),_0x393435,_0x1abaa4);_0x3c160c(_0x1abaa4);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 5f30c3b..31136f6 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 _0x53ec=['post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./analyticMetric.controller','get','index','/:id','isAuthenticated'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x53ec,0x192));var _0xc53e=function(_0x36072d,_0x24f414){_0x36072d=_0x36072d-0x0;var _0x32a52c=_0x53ec[_0x36072d];return _0x32a52c;};'use strict';var multer=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var path=require(_0xc53e('0x2'));var timeout=require(_0xc53e('0x3'));var express=require(_0xc53e('0x4'));var router=express[_0xc53e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc53e('0x6'));var config=require('../../config/environment');var controller=require(_0xc53e('0x7'));router[_0xc53e('0x8')]('/',auth['isAuthenticated'](),controller[_0xc53e('0x9')]);router['get'](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller['show']);router[_0xc53e('0xc')]('/',auth[_0xc53e('0xb')](),controller[_0xc53e('0xd')]);router[_0xc53e('0xe')](_0xc53e('0xa'),auth[_0xc53e('0xb')](),controller[_0xc53e('0xf')]);router[_0xc53e('0x10')](_0xc53e('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xc53e('0x11')]=router; \ No newline at end of file +var _0xf494=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','multer','util'];(function(_0x1ea2c0,_0x15c242){var _0x477113=function(_0xc502d9){while(--_0xc502d9){_0x1ea2c0['push'](_0x1ea2c0['shift']());}};_0x477113(++_0x15c242);}(_0xf494,0x1c6));var _0x4f49=function(_0x189cbc,_0x18aa5a){_0x189cbc=_0x189cbc-0x0;var _0x31d0db=_0xf494[_0x189cbc];return _0x31d0db;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xb')]);router[_0x4f49('0x9')](_0x4f49('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4f49('0xd')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xe')]);router[_0x4f49('0xf')](_0x4f49('0xc'),auth[_0x4f49('0xa')](),controller[_0x4f49('0x10')]);router[_0x4f49('0x11')]('/:id',auth[_0x4f49('0xa')](),controller[_0x4f49('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index cb724de..f46fc45 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 _0xa1e0=['exports','TEXT','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xa1e0,0x74));var _0x0a1e=function(_0x39cb23,_0x25dcf2){_0x39cb23=_0x39cb23-0x0;var _0x1e9812=_0xa1e0[_0x39cb23];return _0x1e9812;};'use strict';var Sequelize=require(_0x0a1e('0x0'));module[_0x0a1e('0x1')]={'tree':{'type':Sequelize[_0x0a1e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x6632=['TEXT','sequelize'];(function(_0x4a42f0,_0x2da65d){var _0x3dc532=function(_0xb60cdf){while(--_0xb60cdf){_0x4a42f0['push'](_0x4a42f0['shift']());}};_0x3dc532(++_0x2da65d);}(_0x6632,0x11d));var _0x2663=function(_0x5b9000,_0x51721a){_0x5b9000=_0x5b9000-0x0;var _0x7eebdd=_0x6632[_0x5b9000];return _0x7eebdd;};'use strict';var Sequelize=require(_0x2663('0x0'));module['exports']={'tree':{'type':Sequelize[_0x2663('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.controller.js b/server/api/analyticTreeReport/analyticTreeReport.controller.js index 2e2a2f6..48d9c0a 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 _0x7916=['merge','options','AnalyticTreeReport','includeAll','include','findAll','rows','catch','show','params','keys','length','find','create','body','update','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','to-csv','ejs','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','destroy','name','send','rawAttributes','fieldName','type','model','map','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL'];(function(_0x358806,_0x322b66){var _0x19fdcb=function(_0xe01b8d){while(--_0xe01b8d){_0x358806['push'](_0x358806['shift']());}};_0x19fdcb(++_0x322b66);}(_0x7916,0x128));var _0x6791=function(_0x537b3c,_0x12aff2){_0x537b3c=_0x537b3c-0x0;var _0x3d9d55=_0x7916[_0x537b3c];return _0x3d9d55;};'use strict';var pdf=require(_0x6791('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6791('0x1'));var zipdir=require(_0x6791('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6791('0x3'));var moment=require(_0x6791('0x4'));var BPromise=require(_0x6791('0x5'));var Mustache=require(_0x6791('0x6'));var util=require('util');var path=require(_0x6791('0x7'));var sox=require('sox');var csv=require(_0x6791('0x8'));var ejs=require(_0x6791('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6791('0xa'));var crypto=require('crypto');var jsforce=require(_0x6791('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6791('0xc'));var Papa=require(_0x6791('0xd'));var Redis=require('ioredis');var authService=require(_0x6791('0xe'));var qs=require(_0x6791('0xf'));var as=require(_0x6791('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6791('0x11'))(_0x6791('0x12'));var utils=require(_0x6791('0x13'));var config=require(_0x6791('0x14'));var db=require(_0x6791('0x15'))['db'];function respondWithStatusCode(_0x1eddd3,_0x61ac73){_0x61ac73=_0x61ac73||0xcc;return function(_0x16c62b){if(_0x16c62b){return _0x1eddd3[_0x6791('0x16')](_0x61ac73);}return _0x1eddd3[_0x6791('0x17')](_0x61ac73)[_0x6791('0x18')]();};}function respondWithResult(_0x5c51f8,_0x4b1719){_0x4b1719=_0x4b1719||0xc8;return function(_0x34b28d){if(_0x34b28d){return _0x5c51f8['status'](_0x4b1719)[_0x6791('0x19')](_0x34b28d);}};}function respondWithFilteredResult(_0x4c32a1,_0x3be9f0){return function(_0x163898){if(_0x163898){var _0x517910=_0x163898[_0x6791('0x1a')],_0x3e4792=_0x3be9f0['offset'],_0x4b80ed=_0x3be9f0[_0x6791('0x1b')]+_0x3be9f0[_0x6791('0x1c')],_0x3856ac;if(_0x4b80ed>=_0x517910){_0x4b80ed=_0x517910;_0x3856ac=0xc8;}else{_0x3856ac=0xce;}_0x4c32a1['status'](_0x3856ac);return _0x4c32a1[_0x6791('0x1d')]('Content-Range',_0x3e4792+'-'+_0x4b80ed+'/'+_0x517910)[_0x6791('0x19')](_0x163898);}return null;};}function patchUpdates(_0x126451){return function(_0x669270){try{jsonpatch[_0x6791('0x1e')](_0x669270,_0x126451,!![]);}catch(_0x25adbc){return BPromise[_0x6791('0x1f')](_0x25adbc);}return _0x669270[_0x6791('0x20')]();};}function saveUpdates(_0x581d51,_0x4a2922){return function(_0x306acb){if(_0x306acb){return _0x306acb['update'](_0x581d51)[_0x6791('0x21')](function(_0x3b57f0){return _0x3b57f0;});}return null;};}function removeEntity(_0x595cf2,_0x17f200){return function(_0x309610){if(_0x309610){return _0x309610[_0x6791('0x22')]()[_0x6791('0x21')](function(){_0x595cf2['status'](0xcc)[_0x6791('0x18')]();});}};}function handleEntityNotFound(_0x1b516d,_0x4a8717){return function(_0x53bb44){if(!_0x53bb44){_0x1b516d['sendStatus'](0x194);}return _0x53bb44;};}function handleError(_0x372dae,_0x502043){_0x502043=_0x502043||0x1f4;return function(_0x1d27c0){logger['error'](_0x1d27c0['stack']);if(_0x1d27c0['name']){delete _0x1d27c0[_0x6791('0x23')];}_0x372dae[_0x6791('0x17')](_0x502043)[_0x6791('0x24')](_0x1d27c0);};}exports['index']=function(_0x3def2e,_0x30cc17){var _0x493a59={},_0x342107={},_0x5cbb79={'count':0x0,'rows':[]};var _0x424b0e=_['map'](db['AnalyticTreeReport'][_0x6791('0x25')],function(_0x551718){return{'name':_0x551718[_0x6791('0x26')],'type':_0x551718[_0x6791('0x27')]['key']};});_0x342107[_0x6791('0x28')]=_[_0x6791('0x29')](_0x424b0e,_0x6791('0x23'));_0x342107[_0x6791('0x2a')]=_['keys'](_0x3def2e['query']);_0x342107[_0x6791('0x2b')]=_['intersection'](_0x342107[_0x6791('0x28')],_0x342107[_0x6791('0x2a')]);_0x493a59[_0x6791('0x2c')]=_[_0x6791('0x2d')](_0x342107[_0x6791('0x28')],qs[_0x6791('0x2e')](_0x3def2e[_0x6791('0x2a')][_0x6791('0x2e')]));_0x493a59[_0x6791('0x2c')]=_0x493a59[_0x6791('0x2c')]['length']?_0x493a59[_0x6791('0x2c')]:_0x342107[_0x6791('0x28')];if(!_0x3def2e[_0x6791('0x2a')][_0x6791('0x2f')](_0x6791('0x30'))){_0x493a59[_0x6791('0x1c')]=qs['limit'](_0x3def2e['query']['limit']);_0x493a59[_0x6791('0x1b')]=qs[_0x6791('0x1b')](_0x3def2e[_0x6791('0x2a')]['offset']);}_0x493a59['order']=qs[_0x6791('0x31')](_0x3def2e[_0x6791('0x2a')][_0x6791('0x31')]);_0x493a59[_0x6791('0x32')]=qs['filters'](_[_0x6791('0x33')](_0x3def2e[_0x6791('0x2a')],_0x342107[_0x6791('0x2b')]));if(_0x3def2e['query'][_0x6791('0x34')]){_0x493a59['where']=_['merge'](_0x493a59[_0x6791('0x32')],{'$or':_[_0x6791('0x29')](_0x424b0e,function(_0x530b13){if(_0x530b13[_0x6791('0x27')]!==_0x6791('0x35')){var _0x407882={};_0x407882[_0x530b13[_0x6791('0x23')]]={'$like':'%'+_0x3def2e[_0x6791('0x2a')]['filter']+'%'};return _0x407882;}})});}_0x493a59=_[_0x6791('0x36')]({},_0x493a59,_0x3def2e[_0x6791('0x37')]);var _0x2d0dd8={'where':_0x493a59['where']};return db[_0x6791('0x38')][_0x6791('0x1a')](_0x2d0dd8)[_0x6791('0x21')](function(_0x577006){_0x5cbb79[_0x6791('0x1a')]=_0x577006;if(_0x3def2e[_0x6791('0x2a')][_0x6791('0x39')]){_0x493a59[_0x6791('0x3a')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x6791('0x3b')](_0x493a59);})[_0x6791('0x21')](function(_0x3e95b6){_0x5cbb79[_0x6791('0x3c')]=_0x3e95b6;return _0x5cbb79;})[_0x6791('0x21')](respondWithFilteredResult(_0x30cc17,_0x493a59))[_0x6791('0x3d')](handleError(_0x30cc17,null));};exports[_0x6791('0x3e')]=function(_0xae0e07,_0x46c244){var _0x4e4004={'raw':!![],'where':{'id':_0xae0e07[_0x6791('0x3f')]['id']}},_0x52c03a={};_0x52c03a[_0x6791('0x28')]=_['keys'](db[_0x6791('0x38')][_0x6791('0x25')]);_0x52c03a[_0x6791('0x2a')]=_[_0x6791('0x40')](_0xae0e07[_0x6791('0x2a')]);_0x52c03a[_0x6791('0x2b')]=_[_0x6791('0x2d')](_0x52c03a['model'],_0x52c03a[_0x6791('0x2a')]);_0x4e4004['attributes']=_[_0x6791('0x2d')](_0x52c03a[_0x6791('0x28')],qs[_0x6791('0x2e')](_0xae0e07[_0x6791('0x2a')]['fields']));_0x4e4004[_0x6791('0x2c')]=_0x4e4004[_0x6791('0x2c')][_0x6791('0x41')]?_0x4e4004[_0x6791('0x2c')]:_0x52c03a[_0x6791('0x28')];if(_0xae0e07[_0x6791('0x2a')][_0x6791('0x39')]){_0x4e4004[_0x6791('0x3a')]=[{'all':!![]}];}_0x4e4004=_['merge']({},_0x4e4004,_0xae0e07[_0x6791('0x37')]);return db[_0x6791('0x38')][_0x6791('0x42')](_0x4e4004)[_0x6791('0x21')](handleEntityNotFound(_0x46c244,null))['then'](respondWithResult(_0x46c244,null))[_0x6791('0x3d')](handleError(_0x46c244,null));};exports[_0x6791('0x43')]=function(_0x540ebe,_0x1ac964){return db['AnalyticTreeReport'][_0x6791('0x43')](_0x540ebe[_0x6791('0x44')],{})[_0x6791('0x21')](respondWithResult(_0x1ac964,0xc9))[_0x6791('0x3d')](handleError(_0x1ac964,null));};exports[_0x6791('0x45')]=function(_0xb2a2,_0x4163f5){if(_0xb2a2[_0x6791('0x44')]['id']){delete _0xb2a2[_0x6791('0x44')]['id'];}return db['AnalyticTreeReport'][_0x6791('0x42')]({'where':{'id':_0xb2a2['params']['id']}})[_0x6791('0x21')](handleEntityNotFound(_0x4163f5,null))[_0x6791('0x21')](saveUpdates(_0xb2a2[_0x6791('0x44')],null))[_0x6791('0x21')](respondWithResult(_0x4163f5,null))[_0x6791('0x3d')](handleError(_0x4163f5,null));};exports['destroy']=function(_0x2bc08d,_0x35e087){return db[_0x6791('0x38')][_0x6791('0x42')]({'where':{'id':_0x2bc08d[_0x6791('0x3f')]['id']}})['then'](handleEntityNotFound(_0x35e087,null))[_0x6791('0x21')](removeEntity(_0x35e087,null))[_0x6791('0x3d')](handleError(_0x35e087,null));}; \ No newline at end of file +var _0xbdb7=['filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','end','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x365977,_0x57b7ae){var _0x843665=function(_0x345a7c){while(--_0x345a7c){_0x365977['push'](_0x365977['shift']());}};_0x843665(++_0x57b7ae);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3ddbcc,_0x54be6b){_0x3ddbcc=_0x3ddbcc-0x0;var _0x381b48=_0xbdb7[_0x3ddbcc];return _0x381b48;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3053d0,_0x25e3cb){_0x25e3cb=_0x25e3cb||0xcc;return function(_0x496613){if(_0x496613){return _0x3053d0[_0x7bdb('0x16')](_0x25e3cb);}return _0x3053d0['status'](_0x25e3cb)['end']();};}function respondWithResult(_0x2abca6,_0x46dd4a){_0x46dd4a=_0x46dd4a||0xc8;return function(_0x4fd91a){if(_0x4fd91a){return _0x2abca6['status'](_0x46dd4a)['json'](_0x4fd91a);}};}function respondWithFilteredResult(_0x4476ff,_0x195b2e){return function(_0xe9919f){if(_0xe9919f){var _0x25d417=_0xe9919f[_0x7bdb('0x17')],_0x31c909=_0x195b2e['offset'],_0xbde12a=_0x195b2e[_0x7bdb('0x18')]+_0x195b2e[_0x7bdb('0x19')],_0x3e96ac;if(_0xbde12a>=_0x25d417){_0xbde12a=_0x25d417;_0x3e96ac=0xc8;}else{_0x3e96ac=0xce;}_0x4476ff[_0x7bdb('0x1a')](_0x3e96ac);return _0x4476ff[_0x7bdb('0x1b')]('Content-Range',_0x31c909+'-'+_0xbde12a+'/'+_0x25d417)[_0x7bdb('0x1c')](_0xe9919f);}return null;};}function patchUpdates(_0x23e9eb){return function(_0x5b8481){try{jsonpatch[_0x7bdb('0x1d')](_0x5b8481,_0x23e9eb,!![]);}catch(_0x31f78e){return BPromise[_0x7bdb('0x1e')](_0x31f78e);}return _0x5b8481[_0x7bdb('0x1f')]();};}function saveUpdates(_0x112793,_0x5bfc35){return function(_0x49f353){if(_0x49f353){return _0x49f353[_0x7bdb('0x20')](_0x112793)[_0x7bdb('0x21')](function(_0x5daea4){return _0x5daea4;});}return null;};}function removeEntity(_0x341fe4,_0x118ea1){return function(_0x346c72){if(_0x346c72){return _0x346c72[_0x7bdb('0x22')]()[_0x7bdb('0x21')](function(){_0x341fe4['status'](0xcc)[_0x7bdb('0x23')]();});}};}function handleEntityNotFound(_0xdad53d,_0x40c447){return function(_0x3a456f){if(!_0x3a456f){_0xdad53d['sendStatus'](0x194);}return _0x3a456f;};}function handleError(_0x4d6e44,_0x3c423f){_0x3c423f=_0x3c423f||0x1f4;return function(_0x5eface){logger['error'](_0x5eface['stack']);if(_0x5eface[_0x7bdb('0x24')]){delete _0x5eface['name'];}_0x4d6e44[_0x7bdb('0x1a')](_0x3c423f)[_0x7bdb('0x25')](_0x5eface);};}exports[_0x7bdb('0x26')]=function(_0x7c09cf,_0x2a494e){var _0x523869={},_0x10e818={},_0x32242d={'count':0x0,'rows':[]};var _0x399b62=_[_0x7bdb('0x27')](db[_0x7bdb('0x28')][_0x7bdb('0x29')],function(_0x1e9996){return{'name':_0x1e9996[_0x7bdb('0x2a')],'type':_0x1e9996[_0x7bdb('0x2b')][_0x7bdb('0x2c')]};});_0x10e818[_0x7bdb('0x2d')]=_[_0x7bdb('0x27')](_0x399b62,'name');_0x10e818[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x7c09cf[_0x7bdb('0x2e')]);_0x10e818[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x10e818['model'],_0x10e818[_0x7bdb('0x2e')]);_0x523869[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x10e818[_0x7bdb('0x2d')],qs['fields'](_0x7c09cf['query']['fields']));_0x523869[_0x7bdb('0x32')]=_0x523869['attributes'][_0x7bdb('0x33')]?_0x523869['attributes']:_0x10e818[_0x7bdb('0x2d')];if(!_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x34')]('nolimit')){_0x523869[_0x7bdb('0x19')]=qs['limit'](_0x7c09cf['query'][_0x7bdb('0x19')]);_0x523869['offset']=qs[_0x7bdb('0x18')](_0x7c09cf['query']['offset']);}_0x523869[_0x7bdb('0x35')]=qs[_0x7bdb('0x36')](_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x36')]);_0x523869[_0x7bdb('0x37')]=qs[_0x7bdb('0x30')](_['pick'](_0x7c09cf[_0x7bdb('0x2e')],_0x10e818[_0x7bdb('0x30')]));if(_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]){_0x523869[_0x7bdb('0x37')]=_[_0x7bdb('0x39')](_0x523869[_0x7bdb('0x37')],{'$or':_[_0x7bdb('0x27')](_0x399b62,function(_0xde82a0){if(_0xde82a0['type']!=='VIRTUAL'){var _0x19c237={};_0x19c237[_0xde82a0[_0x7bdb('0x24')]]={'$like':'%'+_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]+'%'};return _0x19c237;}})});}_0x523869=_[_0x7bdb('0x39')]({},_0x523869,_0x7c09cf['options']);var _0x55f020={'where':_0x523869[_0x7bdb('0x37')]};return db['AnalyticTreeReport'][_0x7bdb('0x17')](_0x55f020)['then'](function(_0x212b50){_0x32242d['count']=_0x212b50;if(_0x7c09cf['query'][_0x7bdb('0x3a')]){_0x523869[_0x7bdb('0x3b')]=[{'all':!![]}];}return db[_0x7bdb('0x28')][_0x7bdb('0x3c')](_0x523869);})[_0x7bdb('0x21')](function(_0x2b4829){_0x32242d[_0x7bdb('0x3d')]=_0x2b4829;return _0x32242d;})['then'](respondWithFilteredResult(_0x2a494e,_0x523869))['catch'](handleError(_0x2a494e,null));};exports[_0x7bdb('0x3e')]=function(_0x206888,_0x2dbb43){var _0x3509e4={'raw':!![],'where':{'id':_0x206888[_0x7bdb('0x3f')]['id']}},_0x39fbca={};_0x39fbca[_0x7bdb('0x2d')]=_['keys'](db['AnalyticTreeReport'][_0x7bdb('0x29')]);_0x39fbca[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x206888[_0x7bdb('0x2e')]);_0x39fbca['filters']=_[_0x7bdb('0x31')](_0x39fbca['model'],_0x39fbca[_0x7bdb('0x2e')]);_0x3509e4[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x39fbca[_0x7bdb('0x2d')],qs[_0x7bdb('0x40')](_0x206888[_0x7bdb('0x2e')][_0x7bdb('0x40')]));_0x3509e4[_0x7bdb('0x32')]=_0x3509e4[_0x7bdb('0x32')]['length']?_0x3509e4[_0x7bdb('0x32')]:_0x39fbca[_0x7bdb('0x2d')];if(_0x206888['query'][_0x7bdb('0x3a')]){_0x3509e4['include']=[{'all':!![]}];}_0x3509e4=_[_0x7bdb('0x39')]({},_0x3509e4,_0x206888[_0x7bdb('0x41')]);return db[_0x7bdb('0x28')][_0x7bdb('0x42')](_0x3509e4)[_0x7bdb('0x21')](handleEntityNotFound(_0x2dbb43,null))['then'](respondWithResult(_0x2dbb43,null))[_0x7bdb('0x43')](handleError(_0x2dbb43,null));};exports[_0x7bdb('0x44')]=function(_0x12d889,_0x3eda2e){return db[_0x7bdb('0x28')]['create'](_0x12d889[_0x7bdb('0x45')],{})[_0x7bdb('0x21')](respondWithResult(_0x3eda2e,0xc9))[_0x7bdb('0x43')](handleError(_0x3eda2e,null));};exports[_0x7bdb('0x20')]=function(_0x259007,_0x25c534){if(_0x259007[_0x7bdb('0x45')]['id']){delete _0x259007[_0x7bdb('0x45')]['id'];}return db[_0x7bdb('0x28')][_0x7bdb('0x42')]({'where':{'id':_0x259007['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x25c534,null))['then'](saveUpdates(_0x259007['body'],null))[_0x7bdb('0x21')](respondWithResult(_0x25c534,null))[_0x7bdb('0x43')](handleError(_0x25c534,null));};exports['destroy']=function(_0x37780a,_0x186809){return db['AnalyticTreeReport']['find']({'where':{'id':_0x37780a['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x186809,null))[_0x7bdb('0x21')](removeEntity(_0x186809,null))[_0x7bdb('0x43')](handleError(_0x186809,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 27878d8..d2faa99 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 _0x225b=['analytics_report_trees','lodash','util','api','moment','request-promise','rimraf','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport'];(function(_0x50ca64,_0xd45ac2){var _0x22152b=function(_0x20f507){while(--_0x20f507){_0x50ca64['push'](_0x50ca64['shift']());}};_0x22152b(++_0xd45ac2);}(_0x225b,0xb1));var _0xb225=function(_0x575c2c,_0x440437){_0x575c2c=_0x575c2c-0x0;var _0x1aa9c7=_0x225b[_0x575c2c];return _0x1aa9c7;};'use strict';var _=require(_0xb225('0x0'));var util=require(_0xb225('0x1'));var logger=require('../../config/logger')(_0xb225('0x2'));var moment=require(_0xb225('0x3'));var BPromise=require('bluebird');var rp=require(_0xb225('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb225('0x5'));var config=require('../../config/environment');var attributes=require(_0xb225('0x6'));module[_0xb225('0x7')]=function(_0x3f2419,_0x4751e2){return _0x3f2419[_0xb225('0x8')](_0xb225('0x9'),attributes,{'tableName':_0xb225('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x042a=['../../config/environment','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x57645b,_0x25f73a){var _0xe82f00=function(_0x526b4){while(--_0x526b4){_0x57645b['push'](_0x57645b['shift']());}};_0xe82f00(++_0x25f73a);}(_0x042a,0x1d9));var _0xa042=function(_0x30cb27,_0x44cae6){_0x30cb27=_0x30cb27-0x0;var _0x23ca96=_0x042a[_0x30cb27];return _0x23ca96;};'use strict';var _=require(_0xa042('0x0'));var util=require('util');var logger=require(_0xa042('0x1'))(_0xa042('0x2'));var moment=require(_0xa042('0x3'));var BPromise=require('bluebird');var rp=require(_0xa042('0x4'));var fs=require('fs');var path=require(_0xa042('0x5'));var rimraf=require(_0xa042('0x6'));var config=require(_0xa042('0x7'));var attributes=require(_0xa042('0x8'));module[_0xa042('0x9')]=function(_0x622ece,_0xc35608){return _0x622ece['define'](_0xa042('0xa'),attributes,{'tableName':_0xa042('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.rpc.js b/server/api/analyticTreeReport/analyticTreeReport.rpc.js index a5cc82d..0bf8a6b 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 _0x227c=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x36847f,_0x29ae74){var _0x56e6fe=function(_0x245b7a){while(--_0x245b7a){_0x36847f['push'](_0x36847f['shift']());}};_0x56e6fe(++_0x29ae74);}(_0x227c,0xb9));var _0xc227=function(_0x23d927,_0x2102d1){_0x23d927=_0x23d927-0x0;var _0x1ba1b9=_0x227c[_0x23d927];return _0x1ba1b9;};'use strict';var _=require('lodash');var util=require(_0xc227('0x0'));var moment=require(_0xc227('0x1'));var BPromise=require(_0xc227('0x2'));var rs=require(_0xc227('0x3'));var fs=require('fs');var Redis=require(_0xc227('0x4'));var db=require(_0xc227('0x5'))['db'];var utils=require(_0xc227('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xc227('0x7'));var jayson=require(_0xc227('0x8'));var client=jayson[_0xc227('0x9')][_0xc227('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4d020e,_0x4d031a,_0x2c2110){return new BPromise(function(_0x514c3b,_0x30593c){return client[_0xc227('0xb')](_0x4d020e,_0x2c2110)[_0xc227('0xc')](function(_0xeee9db){logger['info'](_0xc227('0xd'),_0x4d031a,_0xc227('0xe'));logger['debug'](_0xc227('0xf'),_0x4d031a,_0xc227('0xe'),JSON[_0xc227('0x10')](_0xeee9db));if(_0xeee9db['error']){if(_0xeee9db[_0xc227('0x11')][_0xc227('0x12')]===0x1f4){logger[_0xc227('0x11')](_0xc227('0xd'),_0x4d031a,_0xeee9db[_0xc227('0x11')]['message']);return _0x30593c(_0xeee9db[_0xc227('0x11')]['message']);}logger[_0xc227('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4d031a,_0xeee9db[_0xc227('0x11')][_0xc227('0x13')]);return _0x514c3b(_0xeee9db[_0xc227('0x11')]['message']);}else{logger[_0xc227('0x14')](_0xc227('0xd'),_0x4d031a,_0xc227('0xe'));_0x514c3b(_0xeee9db[_0xc227('0x15')]['message']);}})[_0xc227('0x16')](function(_0x252b79){logger[_0xc227('0x11')](_0xc227('0xd'),_0x4d031a,_0x252b79);_0x30593c(_0x252b79);});});} \ No newline at end of file +var _0x96ad=['code','message','info','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5f2e3a,_0x294751){var _0x277762=function(_0xc46ee3){while(--_0xc46ee3){_0x5f2e3a['push'](_0x5f2e3a['shift']());}};_0x277762(++_0x294751);}(_0x96ad,0xab));var _0xd96a=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x96ad[_0x2543d6];return _0x55213c;};'use strict';var _=require(_0xd96a('0x0'));var util=require(_0xd96a('0x1'));var moment=require('moment');var BPromise=require(_0xd96a('0x2'));var rs=require(_0xd96a('0x3'));var fs=require('fs');var Redis=require(_0xd96a('0x4'));var db=require(_0xd96a('0x5'))['db'];var utils=require(_0xd96a('0x6'));var logger=require(_0xd96a('0x7'))(_0xd96a('0x8'));var config=require('../../config/environment');var jayson=require(_0xd96a('0x9'));var client=jayson[_0xd96a('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1c5340,_0x3b0364,_0x5bd954){return new BPromise(function(_0x2f0fde,_0x50c3db){return client[_0xd96a('0xb')](_0x1c5340,_0x5bd954)[_0xd96a('0xc')](function(_0x4065cf){logger['info'](_0xd96a('0xd'),_0x3b0364,_0xd96a('0xe'));logger['debug'](_0xd96a('0xf'),_0x3b0364,'request\x20sent',JSON[_0xd96a('0x10')](_0x4065cf));if(_0x4065cf[_0xd96a('0x11')]){if(_0x4065cf[_0xd96a('0x11')][_0xd96a('0x12')]===0x1f4){logger[_0xd96a('0x11')](_0xd96a('0xd'),_0x3b0364,_0x4065cf[_0xd96a('0x11')]['message']);return _0x50c3db(_0x4065cf[_0xd96a('0x11')][_0xd96a('0x13')]);}logger[_0xd96a('0x11')](_0xd96a('0xd'),_0x3b0364,_0x4065cf[_0xd96a('0x11')][_0xd96a('0x13')]);return _0x2f0fde(_0x4065cf[_0xd96a('0x11')][_0xd96a('0x13')]);}else{logger[_0xd96a('0x14')](_0xd96a('0xd'),_0x3b0364,_0xd96a('0xe'));_0x2f0fde(_0x4065cf['result'][_0xd96a('0x13')]);}})['catch'](function(_0x55926f){logger[_0xd96a('0x11')](_0xd96a('0xd'),_0x3b0364,_0x55926f);_0x50c3db(_0x55926f);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index f405682..9725271 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 _0x5e9e=['destroy','exports','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete'];(function(_0x17b47d,_0x3136fb){var _0x3c643e=function(_0x5e029a){while(--_0x5e029a){_0x17b47d['push'](_0x17b47d['shift']());}};_0x3c643e(++_0x3136fb);}(_0x5e9e,0x1d6));var _0xe5e9=function(_0x2de0f9,_0x86bda1){_0x2de0f9=_0x2de0f9-0x0;var _0x281529=_0x5e9e[_0x2de0f9];return _0x281529;};'use strict';var multer=require('multer');var util=require(_0xe5e9('0x0'));var path=require(_0xe5e9('0x1'));var timeout=require(_0xe5e9('0x2'));var express=require(_0xe5e9('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe5e9('0x4'));var config=require(_0xe5e9('0x5'));var controller=require(_0xe5e9('0x6'));router[_0xe5e9('0x7')]('/',auth[_0xe5e9('0x8')](),controller[_0xe5e9('0x9')]);router[_0xe5e9('0x7')](_0xe5e9('0xa'),auth[_0xe5e9('0x8')](),controller[_0xe5e9('0xb')]);router[_0xe5e9('0xc')]('/',auth[_0xe5e9('0x8')](),controller[_0xe5e9('0xd')]);router[_0xe5e9('0xe')]('/:id',auth[_0xe5e9('0x8')](),controller['update']);router[_0xe5e9('0xf')](_0xe5e9('0xa'),auth[_0xe5e9('0x8')](),controller[_0xe5e9('0x10')]);module[_0xe5e9('0x11')]=router; \ No newline at end of file +var _0x6cd0=['../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','/:id','post','isAuthenticated','create','update','delete','exports','path','express','Router'];(function(_0x1e243b,_0x6ab858){var _0x2c7e5d=function(_0x1c20ab){while(--_0x1c20ab){_0x1e243b['push'](_0x1e243b['shift']());}};_0x2c7e5d(++_0x6ab858);}(_0x6cd0,0xfc));var _0x06cd=function(_0x5cac11,_0x1b4025){_0x5cac11=_0x5cac11-0x0;var _0x3cc7b7=_0x6cd0[_0x5cac11];return _0x3cc7b7;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x06cd('0x0'));var timeout=require('connect-timeout');var express=require(_0x06cd('0x1'));var router=express[_0x06cd('0x2')]();var auth=require(_0x06cd('0x3'));var interaction=require(_0x06cd('0x4'));var config=require(_0x06cd('0x5'));var controller=require(_0x06cd('0x6'));router[_0x06cd('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x06cd('0x8'),auth['isAuthenticated'](),controller['show']);router[_0x06cd('0x9')]('/',auth[_0x06cd('0xa')](),controller[_0x06cd('0xb')]);router['put'](_0x06cd('0x8'),auth[_0x06cd('0xa')](),controller[_0x06cd('0xc')]);router[_0x06cd('0xd')](_0x06cd('0x8'),auth[_0x06cd('0xa')](),controller['destroy']);module[_0x06cd('0xe')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index f2470c1..5664a03 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 _0xb971=['exports','STRING','sequelize'];(function(_0x2df4b8,_0x554afc){var _0x59e4fc=function(_0x444184){while(--_0x444184){_0x2df4b8['push'](_0x2df4b8['shift']());}};_0x59e4fc(++_0x554afc);}(_0xb971,0x155));var _0x1b97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb971[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1b97('0x0'));module[_0x1b97('0x1')]={'name':{'type':Sequelize[_0x1b97('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x1b97('0x2')]}}; \ No newline at end of file +var _0xff41=['STRING','sequelize'];(function(_0x359661,_0x245fdb){var _0x340d2a=function(_0x409492){while(--_0x409492){_0x359661['push'](_0x359661['shift']());}};_0x340d2a(++_0x245fdb);}(_0xff41,0x17d));var _0x1ff4=function(_0x12d166,_0x3174ca){_0x12d166=_0x12d166-0x0;var _0x400a7d=_0xff41[_0x12d166];return _0x400a7d;};'use strict';var Sequelize=require(_0x1ff4('0x0'));module['exports']={'name':{'type':Sequelize[_0x1ff4('0x1')]},'basename':{'type':Sequelize[_0x1ff4('0x1')]},'type':{'type':Sequelize[_0x1ff4('0x1')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 8011873..31ada30 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 _0xabb6=['updatedAt','body','destroy','file','basename','filename','mimetype','create','download','findOne','server/files/attachments/','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','error','name','send','index','map','Attachment','rawAttributes','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','findAll','catch','show','include','find','clone','params','omit','createdAt'];(function(_0x4b980d,_0x32fc6a){var _0x5c7974=function(_0x3b7af4){while(--_0x3b7af4){_0x4b980d['push'](_0x4b980d['shift']());}};_0x5c7974(++_0x32fc6a);}(_0xabb6,0x1aa));var _0x6abb=function(_0x3b3124,_0x3ded0f){_0x3b3124=_0x3b3124-0x0;var _0xd2ce55=_0xabb6[_0x3b3124];return _0xd2ce55;};'use strict';var pdf=require(_0x6abb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6abb('0x1'));var zipdir=require(_0x6abb('0x2'));var jsonpatch=require(_0x6abb('0x3'));var rp=require(_0x6abb('0x4'));var moment=require('moment');var BPromise=require(_0x6abb('0x5'));var Mustache=require(_0x6abb('0x6'));var util=require(_0x6abb('0x7'));var path=require(_0x6abb('0x8'));var sox=require(_0x6abb('0x9'));var csv=require(_0x6abb('0xa'));var ejs=require(_0x6abb('0xb'));var fs=require('fs');var _=require(_0x6abb('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6abb('0xd'));var deskjs=require(_0x6abb('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6abb('0xf'));var Redis=require(_0x6abb('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6abb('0x11'));var as=require(_0x6abb('0x12'));var hardwareService=require(_0x6abb('0x13'));var logger=require(_0x6abb('0x14'))('api');var utils=require(_0x6abb('0x15'));var config=require('../../config/environment');var db=require(_0x6abb('0x16'))['db'];function respondWithStatusCode(_0x313a54,_0x1abda2){_0x1abda2=_0x1abda2||0xcc;return function(_0x2fc3ac){if(_0x2fc3ac){return _0x313a54[_0x6abb('0x17')](_0x1abda2);}return _0x313a54[_0x6abb('0x18')](_0x1abda2)[_0x6abb('0x19')]();};}function respondWithResult(_0x244c96,_0x233e73){_0x233e73=_0x233e73||0xc8;return function(_0x50812f){if(_0x50812f){return _0x244c96['status'](_0x233e73)[_0x6abb('0x1a')](_0x50812f);}};}function respondWithFilteredResult(_0x20bde,_0x319e9e){return function(_0x48bd3f){if(_0x48bd3f){var _0x119559=_0x48bd3f[_0x6abb('0x1b')],_0x533b27=_0x319e9e[_0x6abb('0x1c')],_0x671f6c=_0x319e9e[_0x6abb('0x1c')]+_0x319e9e['limit'],_0x2f203b;if(_0x671f6c>=_0x119559){_0x671f6c=_0x119559;_0x2f203b=0xc8;}else{_0x2f203b=0xce;}_0x20bde['status'](_0x2f203b);return _0x20bde[_0x6abb('0x1d')]('Content-Range',_0x533b27+'-'+_0x671f6c+'/'+_0x119559)[_0x6abb('0x1a')](_0x48bd3f);}return null;};}function patchUpdates(_0x3c26e8){return function(_0x29d1f0){try{jsonpatch[_0x6abb('0x1e')](_0x29d1f0,_0x3c26e8,!![]);}catch(_0x2c3de0){return BPromise[_0x6abb('0x1f')](_0x2c3de0);}return _0x29d1f0[_0x6abb('0x20')]();};}function saveUpdates(_0x5cec9e,_0x468361){return function(_0x51bf82){if(_0x51bf82){return _0x51bf82[_0x6abb('0x21')](_0x5cec9e)['then'](function(_0x1b2afd){return _0x1b2afd;});}return null;};}function removeEntity(_0x10ce3b,_0x5ddb4b){return function(_0x41bec3){if(_0x41bec3){return _0x41bec3['destroy']()[_0x6abb('0x22')](function(){_0x10ce3b[_0x6abb('0x18')](0xcc)[_0x6abb('0x19')]();});}};}function handleEntityNotFound(_0x2882ed,_0x388276){return function(_0x1a1b20){if(!_0x1a1b20){_0x2882ed['sendStatus'](0x194);}return _0x1a1b20;};}function handleError(_0x15d7c9,_0x2b9190){_0x2b9190=_0x2b9190||0x1f4;return function(_0x5706a5){logger[_0x6abb('0x23')](_0x5706a5['stack']);if(_0x5706a5[_0x6abb('0x24')]){delete _0x5706a5[_0x6abb('0x24')];}_0x15d7c9[_0x6abb('0x18')](_0x2b9190)[_0x6abb('0x25')](_0x5706a5);};}exports[_0x6abb('0x26')]=function(_0x130a4e,_0x5aa71d){var _0x170953={},_0x47ffb2={},_0x1d6e62={'count':0x0,'rows':[]};var _0x55ef14=_[_0x6abb('0x27')](db[_0x6abb('0x28')][_0x6abb('0x29')],function(_0x353d11){return{'name':_0x353d11['fieldName'],'type':_0x353d11[_0x6abb('0x2a')]['key']};});_0x47ffb2['model']=_[_0x6abb('0x27')](_0x55ef14,_0x6abb('0x24'));_0x47ffb2['query']=_[_0x6abb('0x2b')](_0x130a4e[_0x6abb('0x2c')]);_0x47ffb2[_0x6abb('0x2d')]=_[_0x6abb('0x2e')](_0x47ffb2[_0x6abb('0x2f')],_0x47ffb2[_0x6abb('0x2c')]);_0x170953[_0x6abb('0x30')]=_[_0x6abb('0x2e')](_0x47ffb2['model'],qs[_0x6abb('0x31')](_0x130a4e['query'][_0x6abb('0x31')]));_0x170953[_0x6abb('0x30')]=_0x170953[_0x6abb('0x30')][_0x6abb('0x32')]?_0x170953['attributes']:_0x47ffb2['model'];if(!_0x130a4e[_0x6abb('0x2c')][_0x6abb('0x33')](_0x6abb('0x34'))){_0x170953[_0x6abb('0x35')]=qs[_0x6abb('0x35')](_0x130a4e[_0x6abb('0x2c')][_0x6abb('0x35')]);_0x170953['offset']=qs[_0x6abb('0x1c')](_0x130a4e['query'][_0x6abb('0x1c')]);}_0x170953[_0x6abb('0x36')]=qs[_0x6abb('0x37')](_0x130a4e[_0x6abb('0x2c')][_0x6abb('0x37')]);_0x170953['where']=qs[_0x6abb('0x2d')](_[_0x6abb('0x38')](_0x130a4e[_0x6abb('0x2c')],_0x47ffb2[_0x6abb('0x2d')]));if(_0x130a4e['query'][_0x6abb('0x39')]){_0x170953['where']=_[_0x6abb('0x3a')](_0x170953[_0x6abb('0x3b')],{'$or':_[_0x6abb('0x27')](_0x55ef14,function(_0x197027){if(_0x197027['type']!==_0x6abb('0x3c')){var _0x3038f9={};_0x3038f9[_0x197027['name']]={'$like':'%'+_0x130a4e[_0x6abb('0x2c')][_0x6abb('0x39')]+'%'};return _0x3038f9;}})});}_0x170953=_[_0x6abb('0x3a')]({},_0x170953,_0x130a4e[_0x6abb('0x3d')]);var _0x29dd25={'where':_0x170953['where']};return db['Attachment']['count'](_0x29dd25)[_0x6abb('0x22')](function(_0x54109f){_0x1d6e62[_0x6abb('0x1b')]=_0x54109f;if(_0x130a4e[_0x6abb('0x2c')][_0x6abb('0x3e')]){_0x170953['include']=[{'all':!![]}];}return db[_0x6abb('0x28')][_0x6abb('0x3f')](_0x170953);})['then'](function(_0xde5973){_0x1d6e62['rows']=_0xde5973;return _0x1d6e62;})[_0x6abb('0x22')](respondWithFilteredResult(_0x5aa71d,_0x170953))[_0x6abb('0x40')](handleError(_0x5aa71d,null));};exports[_0x6abb('0x41')]=function(_0x365efe,_0x47463e){var _0x63d522={'raw':!![],'where':{'id':_0x365efe['params']['id']}},_0x5fcf99={};_0x5fcf99[_0x6abb('0x2f')]=_[_0x6abb('0x2b')](db[_0x6abb('0x28')][_0x6abb('0x29')]);_0x5fcf99[_0x6abb('0x2c')]=_['keys'](_0x365efe[_0x6abb('0x2c')]);_0x5fcf99[_0x6abb('0x2d')]=_[_0x6abb('0x2e')](_0x5fcf99['model'],_0x5fcf99[_0x6abb('0x2c')]);_0x63d522[_0x6abb('0x30')]=_[_0x6abb('0x2e')](_0x5fcf99['model'],qs[_0x6abb('0x31')](_0x365efe['query'][_0x6abb('0x31')]));_0x63d522[_0x6abb('0x30')]=_0x63d522[_0x6abb('0x30')][_0x6abb('0x32')]?_0x63d522[_0x6abb('0x30')]:_0x5fcf99[_0x6abb('0x2f')];if(_0x365efe[_0x6abb('0x2c')][_0x6abb('0x3e')]){_0x63d522[_0x6abb('0x42')]=[{'all':!![]}];}_0x63d522=_[_0x6abb('0x3a')]({},_0x63d522,_0x365efe[_0x6abb('0x3d')]);return db[_0x6abb('0x28')][_0x6abb('0x43')](_0x63d522)[_0x6abb('0x22')](handleEntityNotFound(_0x47463e,null))['then'](respondWithResult(_0x47463e,null))['catch'](handleError(_0x47463e,null));};exports[_0x6abb('0x44')]=function(_0x1749de,_0x16b569){var _0x7698ae={'where':{'id':_0x1749de[_0x6abb('0x45')]['id']}},_0x49d1d0={};_0x49d1d0['model']=_[_0x6abb('0x2b')](db['Attachment']['rawAttributes']);_0x7698ae[_0x6abb('0x30')]=_[_0x6abb('0x2e')](_0x49d1d0[_0x6abb('0x2f')],qs[_0x6abb('0x31')](_0x1749de['query'][_0x6abb('0x31')]));_0x7698ae[_0x6abb('0x30')]=_0x7698ae[_0x6abb('0x30')][_0x6abb('0x32')]?_0x7698ae[_0x6abb('0x30')]:_0x49d1d0[_0x6abb('0x2f')];if(_0x1749de[_0x6abb('0x2c')][_0x6abb('0x3e')]){_0x7698ae[_0x6abb('0x42')]=[{'all':!![]}];}_0x7698ae=_[_0x6abb('0x3a')]({},_0x7698ae,_0x1749de[_0x6abb('0x3d')]);return db[_0x6abb('0x28')]['find'](_0x7698ae)['then'](handleEntityNotFound(_0x16b569,null))[_0x6abb('0x22')](function(_0x4a442c){if(_0x4a442c){var _0x2cbfc5=_0x4a442c['get']({'plain':!![]});_0x2cbfc5=qs[_0x6abb('0x46')](_0x2cbfc5,['id',_0x6abb('0x47'),_0x6abb('0x48')]);_0x1749de[_0x6abb('0x49')]=_['omit'](_0x1749de['body'],['id',_0x6abb('0x47'),_0x6abb('0x48')]);return db[_0x6abb('0x28')]['create'](_[_0x6abb('0x3a')](_0x2cbfc5,_0x1749de['body']),{'include':_0x1749de[_0x6abb('0x2c')]['includeAll']?[{'all':!![]}]:undefined});}})[_0x6abb('0x22')](respondWithResult(_0x16b569,0xc9))['catch'](handleError(_0x16b569,null));};exports[_0x6abb('0x21')]=function(_0x3de1b2,_0x435323){if(_0x3de1b2[_0x6abb('0x49')]['id']){delete _0x3de1b2[_0x6abb('0x49')]['id'];}return db['Attachment']['find']({'where':{'id':_0x3de1b2['params']['id']}})[_0x6abb('0x22')](handleEntityNotFound(_0x435323,null))[_0x6abb('0x22')](saveUpdates(_0x3de1b2['body'],null))[_0x6abb('0x22')](respondWithResult(_0x435323,null))['catch'](handleError(_0x435323,null));};exports[_0x6abb('0x4a')]=function(_0x10ccc9,_0x355dea){return db[_0x6abb('0x28')][_0x6abb('0x43')]({'where':{'id':_0x10ccc9[_0x6abb('0x45')]['id']}})[_0x6abb('0x22')](handleEntityNotFound(_0x355dea,null))['then'](removeEntity(_0x355dea,null))['catch'](handleError(_0x355dea,null));};exports['create']=function(_0x469747,_0x32fbbe,_0x173ff2){_0x469747[_0x6abb('0x49')][_0x6abb('0x24')]=_0x469747[_0x6abb('0x4b')]['originalname'];_0x469747[_0x6abb('0x49')][_0x6abb('0x4c')]=_0x469747[_0x6abb('0x4b')][_0x6abb('0x4d')];_0x469747[_0x6abb('0x49')][_0x6abb('0x2a')]=_0x469747[_0x6abb('0x4b')][_0x6abb('0x4e')];return db[_0x6abb('0x28')][_0x6abb('0x4f')](_0x469747[_0x6abb('0x49')])[_0x6abb('0x22')](respondWithResult(_0x32fbbe,0xc9))[_0x6abb('0x40')](handleError(_0x32fbbe,null));};exports[_0x6abb('0x50')]=function(_0x1e69df,_0x3c9ca0,_0x40e767){return db['Attachment'][_0x6abb('0x51')]({'where':{'id':_0x1e69df[_0x6abb('0x45')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x3c9ca0,null))[_0x6abb('0x22')](function(_0x24bd9b){if(_0x24bd9b){return _0x3c9ca0[_0x6abb('0x50')](path['join'](config['root'],_0x6abb('0x52'),_0x24bd9b[_0x6abb('0x4c')]));}})['catch'](handleError(_0x3c9ca0,null));}; \ No newline at end of file +var _0x7104=['include','rows','catch','show','params','keys','find','clone','get','createdAt','body','updatedAt','create','file','originalname','basename','filename','mimetype','findOne','download','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','merge','VIRTUAL','options','Attachment','includeAll'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x7104,0x171));var _0x4710=function(_0x36f822,_0x49b4ca){_0x36f822=_0x36f822-0x0;var _0x5d0788=_0x7104[_0x36f822];return _0x5d0788;};'use strict';var pdf=require(_0x4710('0x0'));var emlformat=require(_0x4710('0x1'));var rimraf=require(_0x4710('0x2'));var zipdir=require(_0x4710('0x3'));var jsonpatch=require(_0x4710('0x4'));var rp=require(_0x4710('0x5'));var moment=require(_0x4710('0x6'));var BPromise=require(_0x4710('0x7'));var Mustache=require('mustache');var util=require(_0x4710('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x4710('0x9'));var ejs=require(_0x4710('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4710('0xb'));var crypto=require(_0x4710('0xc'));var jsforce=require(_0x4710('0xd'));var deskjs=require(_0x4710('0xe'));var toCsv=require(_0x4710('0x9'));var querystring=require(_0x4710('0xf'));var Papa=require(_0x4710('0x10'));var Redis=require(_0x4710('0x11'));var authService=require(_0x4710('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4710('0x13'));var logger=require(_0x4710('0x14'))(_0x4710('0x15'));var utils=require('../../config/utils');var config=require(_0x4710('0x16'));var db=require(_0x4710('0x17'))['db'];function respondWithStatusCode(_0x4e4155,_0x488db5){_0x488db5=_0x488db5||0xcc;return function(_0x4f92b2){if(_0x4f92b2){return _0x4e4155['sendStatus'](_0x488db5);}return _0x4e4155[_0x4710('0x18')](_0x488db5)[_0x4710('0x19')]();};}function respondWithResult(_0x1c7dd9,_0x493e67){_0x493e67=_0x493e67||0xc8;return function(_0x36ac20){if(_0x36ac20){return _0x1c7dd9[_0x4710('0x18')](_0x493e67)[_0x4710('0x1a')](_0x36ac20);}};}function respondWithFilteredResult(_0x14ad57,_0x1f6213){return function(_0x275ef3){if(_0x275ef3){var _0x2a2e14=_0x275ef3[_0x4710('0x1b')],_0x190c9d=_0x1f6213[_0x4710('0x1c')],_0x2cbbe1=_0x1f6213[_0x4710('0x1c')]+_0x1f6213[_0x4710('0x1d')],_0x478fbe;if(_0x2cbbe1>=_0x2a2e14){_0x2cbbe1=_0x2a2e14;_0x478fbe=0xc8;}else{_0x478fbe=0xce;}_0x14ad57[_0x4710('0x18')](_0x478fbe);return _0x14ad57[_0x4710('0x1e')]('Content-Range',_0x190c9d+'-'+_0x2cbbe1+'/'+_0x2a2e14)[_0x4710('0x1a')](_0x275ef3);}return null;};}function patchUpdates(_0x271732){return function(_0xe26cf3){try{jsonpatch[_0x4710('0x1f')](_0xe26cf3,_0x271732,!![]);}catch(_0x5d9ecb){return BPromise[_0x4710('0x20')](_0x5d9ecb);}return _0xe26cf3[_0x4710('0x21')]();};}function saveUpdates(_0xfb890e,_0x1520e9){return function(_0x708e5a){if(_0x708e5a){return _0x708e5a[_0x4710('0x22')](_0xfb890e)[_0x4710('0x23')](function(_0x239c96){return _0x239c96;});}return null;};}function removeEntity(_0x52b653,_0x1901ec){return function(_0x55f1ab){if(_0x55f1ab){return _0x55f1ab[_0x4710('0x24')]()[_0x4710('0x23')](function(){_0x52b653[_0x4710('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x138da4,_0x596abe){return function(_0x1d11ae){if(!_0x1d11ae){_0x138da4[_0x4710('0x25')](0x194);}return _0x1d11ae;};}function handleError(_0x34acf2,_0x4ec39b){_0x4ec39b=_0x4ec39b||0x1f4;return function(_0x1b4033){logger[_0x4710('0x26')](_0x1b4033[_0x4710('0x27')]);if(_0x1b4033['name']){delete _0x1b4033[_0x4710('0x28')];}_0x34acf2[_0x4710('0x18')](_0x4ec39b)[_0x4710('0x29')](_0x1b4033);};}exports[_0x4710('0x2a')]=function(_0x42ecb9,_0x426cda){var _0x4b8621={},_0x54961f={},_0x486d8d={'count':0x0,'rows':[]};var _0x3a903b=_['map'](db['Attachment'][_0x4710('0x2b')],function(_0x3a4719){return{'name':_0x3a4719[_0x4710('0x2c')],'type':_0x3a4719[_0x4710('0x2d')][_0x4710('0x2e')]};});_0x54961f[_0x4710('0x2f')]=_[_0x4710('0x30')](_0x3a903b,_0x4710('0x28'));_0x54961f['query']=_['keys'](_0x42ecb9[_0x4710('0x31')]);_0x54961f['filters']=_[_0x4710('0x32')](_0x54961f['model'],_0x54961f[_0x4710('0x31')]);_0x4b8621[_0x4710('0x33')]=_[_0x4710('0x32')](_0x54961f['model'],qs[_0x4710('0x34')](_0x42ecb9[_0x4710('0x31')][_0x4710('0x34')]));_0x4b8621[_0x4710('0x33')]=_0x4b8621[_0x4710('0x33')][_0x4710('0x35')]?_0x4b8621[_0x4710('0x33')]:_0x54961f[_0x4710('0x2f')];if(!_0x42ecb9[_0x4710('0x31')][_0x4710('0x36')](_0x4710('0x37'))){_0x4b8621['limit']=qs['limit'](_0x42ecb9[_0x4710('0x31')][_0x4710('0x1d')]);_0x4b8621[_0x4710('0x1c')]=qs['offset'](_0x42ecb9['query'][_0x4710('0x1c')]);}_0x4b8621[_0x4710('0x38')]=qs[_0x4710('0x39')](_0x42ecb9['query'][_0x4710('0x39')]);_0x4b8621['where']=qs[_0x4710('0x3a')](_[_0x4710('0x3b')](_0x42ecb9[_0x4710('0x31')],_0x54961f[_0x4710('0x3a')]));if(_0x42ecb9['query'][_0x4710('0x3c')]){_0x4b8621['where']=_[_0x4710('0x3d')](_0x4b8621['where'],{'$or':_[_0x4710('0x30')](_0x3a903b,function(_0x2b190b){if(_0x2b190b[_0x4710('0x2d')]!==_0x4710('0x3e')){var _0x4a7def={};_0x4a7def[_0x2b190b[_0x4710('0x28')]]={'$like':'%'+_0x42ecb9[_0x4710('0x31')][_0x4710('0x3c')]+'%'};return _0x4a7def;}})});}_0x4b8621=_[_0x4710('0x3d')]({},_0x4b8621,_0x42ecb9[_0x4710('0x3f')]);var _0x136759={'where':_0x4b8621['where']};return db[_0x4710('0x40')]['count'](_0x136759)[_0x4710('0x23')](function(_0x6f02ed){_0x486d8d[_0x4710('0x1b')]=_0x6f02ed;if(_0x42ecb9[_0x4710('0x31')][_0x4710('0x41')]){_0x4b8621[_0x4710('0x42')]=[{'all':!![]}];}return db[_0x4710('0x40')]['findAll'](_0x4b8621);})[_0x4710('0x23')](function(_0x40237a){_0x486d8d[_0x4710('0x43')]=_0x40237a;return _0x486d8d;})[_0x4710('0x23')](respondWithFilteredResult(_0x426cda,_0x4b8621))[_0x4710('0x44')](handleError(_0x426cda,null));};exports[_0x4710('0x45')]=function(_0x34968a,_0x472c5d){var _0x1633d9={'raw':!![],'where':{'id':_0x34968a[_0x4710('0x46')]['id']}},_0x11907f={};_0x11907f[_0x4710('0x2f')]=_[_0x4710('0x47')](db[_0x4710('0x40')][_0x4710('0x2b')]);_0x11907f[_0x4710('0x31')]=_['keys'](_0x34968a['query']);_0x11907f[_0x4710('0x3a')]=_['intersection'](_0x11907f['model'],_0x11907f[_0x4710('0x31')]);_0x1633d9[_0x4710('0x33')]=_[_0x4710('0x32')](_0x11907f['model'],qs[_0x4710('0x34')](_0x34968a['query'][_0x4710('0x34')]));_0x1633d9['attributes']=_0x1633d9['attributes'][_0x4710('0x35')]?_0x1633d9[_0x4710('0x33')]:_0x11907f[_0x4710('0x2f')];if(_0x34968a[_0x4710('0x31')][_0x4710('0x41')]){_0x1633d9[_0x4710('0x42')]=[{'all':!![]}];}_0x1633d9=_['merge']({},_0x1633d9,_0x34968a[_0x4710('0x3f')]);return db[_0x4710('0x40')][_0x4710('0x48')](_0x1633d9)[_0x4710('0x23')](handleEntityNotFound(_0x472c5d,null))[_0x4710('0x23')](respondWithResult(_0x472c5d,null))[_0x4710('0x44')](handleError(_0x472c5d,null));};exports[_0x4710('0x49')]=function(_0x3461e6,_0x4f7f18){var _0x5b8783={'where':{'id':_0x3461e6[_0x4710('0x46')]['id']}},_0x1fee4f={};_0x1fee4f[_0x4710('0x2f')]=_[_0x4710('0x47')](db[_0x4710('0x40')][_0x4710('0x2b')]);_0x5b8783['attributes']=_['intersection'](_0x1fee4f['model'],qs[_0x4710('0x34')](_0x3461e6[_0x4710('0x31')][_0x4710('0x34')]));_0x5b8783[_0x4710('0x33')]=_0x5b8783['attributes'][_0x4710('0x35')]?_0x5b8783['attributes']:_0x1fee4f[_0x4710('0x2f')];if(_0x3461e6[_0x4710('0x31')]['includeAll']){_0x5b8783[_0x4710('0x42')]=[{'all':!![]}];}_0x5b8783=_[_0x4710('0x3d')]({},_0x5b8783,_0x3461e6[_0x4710('0x3f')]);return db[_0x4710('0x40')][_0x4710('0x48')](_0x5b8783)[_0x4710('0x23')](handleEntityNotFound(_0x4f7f18,null))[_0x4710('0x23')](function(_0x226a55){if(_0x226a55){var _0x4843a1=_0x226a55[_0x4710('0x4a')]({'plain':!![]});_0x4843a1=qs['omit'](_0x4843a1,['id',_0x4710('0x4b'),'updatedAt']);_0x3461e6[_0x4710('0x4c')]=_['omit'](_0x3461e6['body'],['id','createdAt',_0x4710('0x4d')]);return db['Attachment'][_0x4710('0x4e')](_['merge'](_0x4843a1,_0x3461e6[_0x4710('0x4c')]),{'include':_0x3461e6[_0x4710('0x31')][_0x4710('0x41')]?[{'all':!![]}]:undefined});}})[_0x4710('0x23')](respondWithResult(_0x4f7f18,0xc9))['catch'](handleError(_0x4f7f18,null));};exports[_0x4710('0x22')]=function(_0x39061b,_0x4d4e1a){if(_0x39061b[_0x4710('0x4c')]['id']){delete _0x39061b[_0x4710('0x4c')]['id'];}return db[_0x4710('0x40')]['find']({'where':{'id':_0x39061b[_0x4710('0x46')]['id']}})[_0x4710('0x23')](handleEntityNotFound(_0x4d4e1a,null))[_0x4710('0x23')](saveUpdates(_0x39061b[_0x4710('0x4c')],null))[_0x4710('0x23')](respondWithResult(_0x4d4e1a,null))[_0x4710('0x44')](handleError(_0x4d4e1a,null));};exports[_0x4710('0x24')]=function(_0x3daa58,_0x45f926){return db[_0x4710('0x40')][_0x4710('0x48')]({'where':{'id':_0x3daa58[_0x4710('0x46')]['id']}})[_0x4710('0x23')](handleEntityNotFound(_0x45f926,null))['then'](removeEntity(_0x45f926,null))[_0x4710('0x44')](handleError(_0x45f926,null));};exports[_0x4710('0x4e')]=function(_0x5e48e8,_0x3eabb1,_0x4b0aa3){_0x5e48e8[_0x4710('0x4c')][_0x4710('0x28')]=_0x5e48e8[_0x4710('0x4f')][_0x4710('0x50')];_0x5e48e8[_0x4710('0x4c')][_0x4710('0x51')]=_0x5e48e8[_0x4710('0x4f')][_0x4710('0x52')];_0x5e48e8['body'][_0x4710('0x2d')]=_0x5e48e8[_0x4710('0x4f')][_0x4710('0x53')];return db[_0x4710('0x40')][_0x4710('0x4e')](_0x5e48e8[_0x4710('0x4c')])[_0x4710('0x23')](respondWithResult(_0x3eabb1,0xc9))[_0x4710('0x44')](handleError(_0x3eabb1,null));};exports['download']=function(_0x56710e,_0x27d068,_0x30300a){return db[_0x4710('0x40')][_0x4710('0x54')]({'where':{'id':_0x56710e[_0x4710('0x46')]['id']},'raw':!![]})[_0x4710('0x23')](handleEntityNotFound(_0x27d068,null))[_0x4710('0x23')](function(_0x4db3ad){if(_0x4db3ad){return _0x27d068[_0x4710('0x55')](path['join'](config['root'],_0x4710('0x56'),_0x4db3ad[_0x4710('0x51')]));}})[_0x4710('0x44')](handleError(_0x27d068,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index fd79189..30cf798 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 _0x49aa=['util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','Attachment','lodash'];(function(_0x48999d,_0x1e02cb){var _0x1ad0d1=function(_0x3f974e){while(--_0x3f974e){_0x48999d['push'](_0x48999d['shift']());}};_0x1ad0d1(++_0x1e02cb);}(_0x49aa,0x173));var _0xa49a=function(_0x1fdb83,_0x1f737f){_0x1fdb83=_0x1fdb83-0x0;var _0x15de15=_0x49aa[_0x1fdb83];return _0x15de15;};'use strict';var _=require(_0xa49a('0x0'));var util=require(_0xa49a('0x1'));var logger=require(_0xa49a('0x2'))('api');var moment=require(_0xa49a('0x3'));var BPromise=require(_0xa49a('0x4'));var rp=require(_0xa49a('0x5'));var fs=require('fs');var path=require(_0xa49a('0x6'));var rimraf=require(_0xa49a('0x7'));var config=require(_0xa49a('0x8'));var attributes=require('./attachment.attributes');module[_0xa49a('0x9')]=function(_0x3889ad,_0x3a2283){return _0x3889ad[_0xa49a('0xa')](_0xa49a('0xb'),attributes,{'tableName':'attachments','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae8e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports','define','Attachment','attachments'];(function(_0x113162,_0x4c4e50){var _0x5244e6=function(_0x1df1ea){while(--_0x1df1ea){_0x113162['push'](_0x113162['shift']());}};_0x5244e6(++_0x4c4e50);}(_0xae8e,0xc3));var _0xeae8=function(_0x4298d6,_0x43e601){_0x4298d6=_0x4298d6-0x0;var _0x1c76d2=_0xae8e[_0x4298d6];return _0x1c76d2;};'use strict';var _=require(_0xeae8('0x0'));var util=require(_0xeae8('0x1'));var logger=require(_0xeae8('0x2'))(_0xeae8('0x3'));var moment=require(_0xeae8('0x4'));var BPromise=require(_0xeae8('0x5'));var rp=require(_0xeae8('0x6'));var fs=require('fs');var path=require(_0xeae8('0x7'));var rimraf=require(_0xeae8('0x8'));var config=require(_0xeae8('0x9'));var attributes=require(_0xeae8('0xa'));module[_0xeae8('0xb')]=function(_0x23b0d7,_0x17345e){return _0x23b0d7[_0xeae8('0xc')](_0xeae8('0xd'),attributes,{'tableName':_0xeae8('0xe'),'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 0123258..149e512 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 _0x01ac=['info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','Attachment','create','body','options','raw','CreateAttachment','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x01ac,0x1a3));var _0xc01a=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x01ac[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0xc01a('0x0'));var util=require(_0xc01a('0x1'));var moment=require(_0xc01a('0x2'));var BPromise=require(_0xc01a('0x3'));var rs=require(_0xc01a('0x4'));var fs=require('fs');var Redis=require(_0xc01a('0x5'));var db=require(_0xc01a('0x6'))['db'];var utils=require(_0xc01a('0x7'));var logger=require(_0xc01a('0x8'))(_0xc01a('0x9'));var config=require(_0xc01a('0xa'));var jayson=require(_0xc01a('0xb'));var client=jayson[_0xc01a('0xc')][_0xc01a('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4ac673,_0x204994,_0x5becbf){return new BPromise(function(_0x3b0795,_0x416b25){return client['request'](_0x4ac673,_0x5becbf)[_0xc01a('0xe')](function(_0x3f5cc6){logger[_0xc01a('0xf')](_0xc01a('0x10'),_0x204994,_0xc01a('0x11'));logger[_0xc01a('0x12')](_0xc01a('0x13'),_0x204994,_0xc01a('0x11'),JSON[_0xc01a('0x14')](_0x3f5cc6));if(_0x3f5cc6[_0xc01a('0x15')]){if(_0x3f5cc6['error']['code']===0x1f4){logger[_0xc01a('0x15')](_0xc01a('0x10'),_0x204994,_0x3f5cc6[_0xc01a('0x15')][_0xc01a('0x16')]);return _0x416b25(_0x3f5cc6['error']['message']);}logger[_0xc01a('0x15')](_0xc01a('0x10'),_0x204994,_0x3f5cc6[_0xc01a('0x15')]['message']);return _0x3b0795(_0x3f5cc6[_0xc01a('0x15')][_0xc01a('0x16')]);}else{logger[_0xc01a('0xf')](_0xc01a('0x10'),_0x204994,'request\x20sent');_0x3b0795(_0x3f5cc6[_0xc01a('0x17')][_0xc01a('0x16')]);}})[_0xc01a('0x18')](function(_0x435106){logger[_0xc01a('0x15')]('Attachment,\x20%s,\x20%s',_0x204994,_0x435106);_0x416b25(_0x435106);});});}exports['CreateAttachment']=function(_0x11273a){var _0x2741ae=this;return new Promise(function(_0x5b3f97,_0xc80248){return db[_0xc01a('0x19')][_0xc01a('0x1a')](_0x11273a[_0xc01a('0x1b')],{'raw':_0x11273a[_0xc01a('0x1c')]?_0x11273a[_0xc01a('0x1c')][_0xc01a('0x1d')]===undefined?!![]:![]:!![]})[_0xc01a('0xe')](function(_0x2957b4){logger[_0xc01a('0xf')](_0xc01a('0x1e'),_0x11273a);logger[_0xc01a('0x12')](_0xc01a('0x1e'),_0x11273a,JSON[_0xc01a('0x14')](_0x2957b4));_0x5b3f97(_0x2957b4);})[_0xc01a('0x18')](function(_0x233b9f){logger[_0xc01a('0x15')]('CreateAttachment',_0x233b9f[_0xc01a('0x16')],_0x11273a);_0xc80248(_0x2741ae[_0xc01a('0x15')](0x1f4,_0x233b9f[_0xc01a('0x16')]));});});}; \ No newline at end of file +var _0xdea5=['create','body','options','raw','then','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateAttachment','Attachment'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0xdea5,0x1a9));var _0x5dea=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xdea5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5dea('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5dea('0x1'));var rs=require(_0x5dea('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5dea('0x3'))['db'];var utils=require(_0x5dea('0x4'));var logger=require(_0x5dea('0x5'))(_0x5dea('0x6'));var config=require(_0x5dea('0x7'));var jayson=require(_0x5dea('0x8'));var client=jayson[_0x5dea('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e34a7,_0x2b37db,_0x20b67b){return new BPromise(function(_0x1f2e59,_0x7f692b){return client[_0x5dea('0xa')](_0x4e34a7,_0x20b67b)['then'](function(_0x137786){logger[_0x5dea('0xb')](_0x5dea('0xc'),_0x2b37db,_0x5dea('0xd'));logger[_0x5dea('0xe')](_0x5dea('0xf'),_0x2b37db,_0x5dea('0xd'),JSON[_0x5dea('0x10')](_0x137786));if(_0x137786[_0x5dea('0x11')]){if(_0x137786[_0x5dea('0x11')]['code']===0x1f4){logger[_0x5dea('0x11')](_0x5dea('0xc'),_0x2b37db,_0x137786[_0x5dea('0x11')][_0x5dea('0x12')]);return _0x7f692b(_0x137786['error'][_0x5dea('0x12')]);}logger[_0x5dea('0x11')]('Attachment,\x20%s,\x20%s',_0x2b37db,_0x137786[_0x5dea('0x11')]['message']);return _0x1f2e59(_0x137786['error'][_0x5dea('0x12')]);}else{logger[_0x5dea('0xb')]('Attachment,\x20%s,\x20%s',_0x2b37db,'request\x20sent');_0x1f2e59(_0x137786[_0x5dea('0x13')][_0x5dea('0x12')]);}})[_0x5dea('0x14')](function(_0x280bc8){logger[_0x5dea('0x11')](_0x5dea('0xc'),_0x2b37db,_0x280bc8);_0x7f692b(_0x280bc8);});});}exports[_0x5dea('0x15')]=function(_0x2c7396){var _0x4c69c5=this;return new Promise(function(_0x183f43,_0x236bc7){return db[_0x5dea('0x16')][_0x5dea('0x17')](_0x2c7396[_0x5dea('0x18')],{'raw':_0x2c7396['options']?_0x2c7396[_0x5dea('0x19')][_0x5dea('0x1a')]===undefined?!![]:![]:!![]})[_0x5dea('0x1b')](function(_0x8c2bf9){logger[_0x5dea('0xb')](_0x5dea('0x15'),_0x2c7396);logger['debug'](_0x5dea('0x15'),_0x2c7396,JSON[_0x5dea('0x10')](_0x8c2bf9));_0x183f43(_0x8c2bf9);})[_0x5dea('0x14')](function(_0x1f8dc8){logger[_0x5dea('0x11')]('CreateAttachment',_0x1f8dc8[_0x5dea('0x12')],_0x2c7396);_0x236bc7(_0x4c69c5[_0x5dea('0x11')](0x1f4,_0x1f8dc8['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index 5732485..e5840e8 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 _0x85e6=['download','/:id/clone','clone','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','post','single','create','put','update','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/download','isAuthenticated'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x85e6,0x1a5));var _0x685e=function(_0x393a4b,_0x1479ed){_0x393a4b=_0x393a4b-0x0;var _0x40ba4d=_0x85e6[_0x393a4b];return _0x40ba4d;};'use strict';var multer=require(_0x685e('0x0'));var util=require(_0x685e('0x1'));var path=require('path');var timeout=require(_0x685e('0x2'));var express=require(_0x685e('0x3'));var router=express['Router']();var auth=require(_0x685e('0x4'));var interaction=require(_0x685e('0x5'));var config=require(_0x685e('0x6'));var controller=require('./attachment.controller');router[_0x685e('0x7')]('/',auth['isAuthenticated'](),controller[_0x685e('0x8')]);router[_0x685e('0x7')](_0x685e('0x9'),auth['isAuthenticated'](),controller[_0x685e('0xa')]);router[_0x685e('0x7')](_0x685e('0xb'),auth[_0x685e('0xc')](),controller[_0x685e('0xd')]);router['post'](_0x685e('0xe'),auth['isAuthenticated'](),controller[_0x685e('0xf')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x344cbb,_0xfc5a40,_0xf74e3b){_0xf74e3b(null,path[_0x685e('0x10')](config[_0x685e('0x11')],_0x685e('0x12')));},'filename':function(_0x200716,_0x2d28ca,_0x11401c){_0x11401c(null,util[_0x685e('0x13')](_0x685e('0x14'),Date[_0x685e('0x15')](),_0x2d28ca[_0x685e('0x16')][_0x685e('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x685e('0x18')]('/',upload[_0x685e('0x19')]('file'),controller[_0x685e('0x1a')]);router[_0x685e('0x1b')](_0x685e('0x9'),auth[_0x685e('0xc')](),controller[_0x685e('0x1c')]);router['delete'](_0x685e('0x9'),auth[_0x685e('0xc')](),controller[_0x685e('0x1d')]);module[_0x685e('0x1e')]=router; \ No newline at end of file +var _0x6216=['../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','get','isAuthenticated','index','/:id','show','/:id/download','post','/:id/clone','clone','root','server/files/attachments/','%s-%s','originalname','file','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3ba1ee,_0xca3f75){var _0x1df62b=function(_0x3f4037){while(--_0x3f4037){_0x3ba1ee['push'](_0x3ba1ee['shift']());}};_0x1df62b(++_0xca3f75);}(_0x6216,0x90));var _0x6621=function(_0x5326df,_0x4babd6){_0x5326df=_0x5326df-0x0;var _0x6a86fd=_0x6216[_0x5326df];return _0x6a86fd;};'use strict';var multer=require(_0x6621('0x0'));var util=require(_0x6621('0x1'));var path=require(_0x6621('0x2'));var timeout=require(_0x6621('0x3'));var express=require(_0x6621('0x4'));var router=express[_0x6621('0x5')]();var auth=require(_0x6621('0x6'));var interaction=require(_0x6621('0x7'));var config=require(_0x6621('0x8'));var controller=require(_0x6621('0x9'));router[_0x6621('0xa')]('/',auth[_0x6621('0xb')](),controller[_0x6621('0xc')]);router[_0x6621('0xa')](_0x6621('0xd'),auth[_0x6621('0xb')](),controller[_0x6621('0xe')]);router[_0x6621('0xa')](_0x6621('0xf'),auth[_0x6621('0xb')](),controller['download']);router[_0x6621('0x10')](_0x6621('0x11'),auth[_0x6621('0xb')](),controller[_0x6621('0x12')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5a4809,_0x1f395f,_0x4b1c47){_0x4b1c47(null,path['join'](config[_0x6621('0x13')],_0x6621('0x14')));},'filename':function(_0x4a89be,_0x2e6dc1,_0x5ec9a9){_0x5ec9a9(null,util['format'](_0x6621('0x15'),Date['now'](),_0x2e6dc1[_0x6621('0x16')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x6621('0x10')]('/',upload['single'](_0x6621('0x17')),controller[_0x6621('0x18')]);router[_0x6621('0x19')](_0x6621('0xd'),auth[_0x6621('0xb')](),controller[_0x6621('0x1a')]);router[_0x6621('0x1b')]('/:id',auth[_0x6621('0xb')](),controller[_0x6621('0x1c')]);module[_0x6621('0x1d')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index aaba179..32aaf7a 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 _0x0b6e=['Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','getLicense','catch','passport-google-oauth20','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','authenticate','google','/login','email','callback','clientID','clientSecret','secret','Setting','blockDuration','then','User','map','emails','value','user','agent','disabled','blocked','add','minutes'];(function(_0x341b35,_0xac07b){var _0x3868ce=function(_0x1a7422){while(--_0x1a7422){_0x341b35['push'](_0x341b35['shift']());}};_0x3868ce(++_0xac07b);}(_0x0b6e,0xfb));var _0xe0b6=function(_0x5299ca,_0x3ffd28){_0x5299ca=_0x5299ca-0x0;var _0x20f37b=_0x0b6e[_0x5299ca];return _0x20f37b;};'use strict';var _=require('lodash');var passport=require('passport');var GoogleStrategy=require(_0xe0b6('0x0'))[_0xe0b6('0x1')];var moment=require(_0xe0b6('0x2'));var db=require(_0xe0b6('0x3'))['db'];var config=require(_0xe0b6('0x4'));var signToken=require(_0xe0b6('0x5'))[_0xe0b6('0x6')];var utils=require('../../config/utils');exports['login']=passport[_0xe0b6('0x7')](_0xe0b6('0x8'),{'failureRedirect':_0xe0b6('0x9'),'scope':['profile',_0xe0b6('0xa')],'session':![]});exports[_0xe0b6('0xb')]=passport['authenticate'](_0xe0b6('0x8'),{'failureRedirect':_0xe0b6('0x9'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0xe0b6('0x8')]?config[_0xe0b6('0x8')][_0xe0b6('0xc')]:'id','clientSecret':config[_0xe0b6('0x8')]?config['google'][_0xe0b6('0xd')]:_0xe0b6('0xe'),'callbackURL':config[_0xe0b6('0x8')]?config[_0xe0b6('0x8')]['callbackURL']:''},function(_0x5dab3d,_0x3c626d,_0x3ac623,_0x15c355){var _0x4c713d,_0x56454b;return db[_0xe0b6('0xf')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe0b6('0x10')],'raw':!![]})[_0xe0b6('0x11')](function(_0x5e7bf){_0x4c713d=_0x5e7bf;return db[_0xe0b6('0x12')]['find']({'where':{'email':_[_0xe0b6('0x13')](_0x3ac623[_0xe0b6('0x14')],_0xe0b6('0x15')),'role':{'$or':['admin',_0xe0b6('0x16'),_0xe0b6('0x17')]}}});})[_0xe0b6('0x11')](function(_0x1d2f29){_0x56454b=_0x1d2f29;if(_0x56454b){if(_0x56454b[_0xe0b6('0x18')]){return _0x15c355('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else if(_0x4c713d[_0xe0b6('0x10')]>0x0){if(_0x56454b[_0xe0b6('0x19')]){if(moment(_0x56454b['blockedAt'])[_0xe0b6('0x1a')](_0x4c713d[_0xe0b6('0x10')],_0xe0b6('0x1b'))>moment()){return _0x15c355(_0xe0b6('0x1c'));}else{return utils['clearBlockUser'](_0x56454b,0x0,![],null)[_0xe0b6('0x11')](function(){return utils[_0xe0b6('0x1d')](_0x56454b);})[_0xe0b6('0x11')](function(){return _0x15c355(null,_0x56454b);});}}else{return utils[_0xe0b6('0x1d')](_0x56454b)['then'](function(){return _0x15c355(null,_0x56454b);});}}else{return utils[_0xe0b6('0x1d')](_0x56454b)[_0xe0b6('0x11')](function(){return _0x15c355(null,_0x56454b);});}}return _0x15c355(_0xe0b6('0x1c'));})[_0xe0b6('0x1e')](function(_0x388b73){_0x15c355(_0x388b73);});})); \ No newline at end of file +var _0x415e=['login','authenticate','google','/login','email','callback','use','clientID','clientSecret','secret','callbackURL','Setting','blockDuration','then','find','map','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','add','minutes','clearBlockUser','getLicense','catch','lodash','passport','passport-google-oauth20','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils'];(function(_0x4bf96c,_0x4d24fd){var _0x281d09=function(_0x56538e){while(--_0x56538e){_0x4bf96c['push'](_0x4bf96c['shift']());}};_0x281d09(++_0x4d24fd);}(_0x415e,0x18e));var _0xe415=function(_0x32c4dc,_0x2e5965){_0x32c4dc=_0x32c4dc-0x0;var _0x4c8f72=_0x415e[_0x32c4dc];return _0x4c8f72;};'use strict';var _=require(_0xe415('0x0'));var passport=require(_0xe415('0x1'));var GoogleStrategy=require(_0xe415('0x2'))['Strategy'];var moment=require(_0xe415('0x3'));var db=require(_0xe415('0x4'))['db'];var config=require(_0xe415('0x5'));var signToken=require(_0xe415('0x6'))[_0xe415('0x7')];var utils=require(_0xe415('0x8'));exports[_0xe415('0x9')]=passport[_0xe415('0xa')](_0xe415('0xb'),{'failureRedirect':_0xe415('0xc'),'scope':['profile',_0xe415('0xd')],'session':![]});exports[_0xe415('0xe')]=passport['authenticate'](_0xe415('0xb'),{'failureRedirect':_0xe415('0xc'),'session':![]});passport[_0xe415('0xf')](new GoogleStrategy({'clientID':config[_0xe415('0xb')]?config[_0xe415('0xb')][_0xe415('0x10')]:'id','clientSecret':config['google']?config[_0xe415('0xb')][_0xe415('0x11')]:_0xe415('0x12'),'callbackURL':config[_0xe415('0xb')]?config[_0xe415('0xb')][_0xe415('0x13')]:''},function(_0x319738,_0x2e54a1,_0xd61784,_0x9f7c70){var _0x50e632,_0x159831;return db[_0xe415('0x14')]['findOne']({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0xe415('0x15')],'raw':!![]})[_0xe415('0x16')](function(_0x24f893){_0x50e632=_0x24f893;return db['User'][_0xe415('0x17')]({'where':{'email':_[_0xe415('0x18')](_0xd61784[_0xe415('0x19')],_0xe415('0x1a')),'role':{'$or':['admin',_0xe415('0x1b'),_0xe415('0x1c')]}}});})['then'](function(_0x5b0303){_0x159831=_0x5b0303;if(_0x159831){if(_0x159831[_0xe415('0x1d')]){return _0x9f7c70(_0xe415('0x1e'));}else if(_0x50e632[_0xe415('0x15')]>0x0){if(_0x159831[_0xe415('0x1f')]){if(moment(_0x159831['blockedAt'])[_0xe415('0x20')](_0x50e632['blockDuration'],_0xe415('0x21'))>moment()){return _0x9f7c70('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0xe415('0x22')](_0x159831,0x0,![],null)[_0xe415('0x16')](function(){return utils[_0xe415('0x23')](_0x159831);})[_0xe415('0x16')](function(){return _0x9f7c70(null,_0x159831);});}}else{return utils[_0xe415('0x23')](_0x159831)[_0xe415('0x16')](function(){return _0x9f7c70(null,_0x159831);});}}else{return utils[_0xe415('0x23')](_0x159831)[_0xe415('0x16')](function(){return _0x9f7c70(null,_0x159831);});}}return _0x9f7c70(_0xe415('0x1e'));})[_0xe415('0x24')](function(_0x4aa561){_0x9f7c70(_0x4aa561);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index 5b4a360..c6c3be8 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 _0x89e8=['../user/user.controller.js','../../components/auth/service','get','login','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller'];(function(_0x21be0c,_0x1aa403){var _0x10ad47=function(_0x1725f8){while(--_0x1725f8){_0x21be0c['push'](_0x21be0c['shift']());}};_0x10ad47(++_0x1aa403);}(_0x89e8,0x74));var _0x889e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x89e8[_0x1ac595];return _0x455fff;};'use strict';var express=require(_0x889e('0x0'));var passport=require(_0x889e('0x1'));var router=express[_0x889e('0x2')]();var controller=require(_0x889e('0x3'));var userController=require(_0x889e('0x4'));var authService=require(_0x889e('0x5'));router[_0x889e('0x6')]('/',controller[_0x889e('0x7')]);router['get']('/callback',controller['callback'],authService[_0x889e('0x8')],userController[_0x889e('0x7')],authService[_0x889e('0x9')]);module['exports']=router; \ No newline at end of file +var _0x581a=['get','login','callback','setTokenCookie','exports','express','passport','./authGoogle.controller','../user/user.controller.js','../../components/auth/service'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x581a,0x127));var _0xa581=function(_0x715962,_0x45fd7c){_0x715962=_0x715962-0x0;var _0x27c5c0=_0x581a[_0x715962];return _0x27c5c0;};'use strict';var express=require(_0xa581('0x0'));var passport=require(_0xa581('0x1'));var router=express['Router']();var controller=require(_0xa581('0x2'));var userController=require(_0xa581('0x3'));var authService=require(_0xa581('0x4'));router[_0xa581('0x5')]('/',controller[_0xa581('0x6')]);router['get']('/callback',controller[_0xa581('0x7')],authService['isMiddleware'],userController[_0xa581('0x6')],authService[_0xa581('0x8')]);module[_0xa581('0x9')]=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index df3d801..8897d83 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 _0xceef=['email','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','merge','request','SendMail','error','format','message','stringify','status','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','generate','body','trim','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','add','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','Password\x20reset!','use','passport','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','client','http','Setting','findOne','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blockedAt','loginAttempts','admin','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','minutes','clearBlockUser','getLicense','catch','MailAccount'];(function(_0x136f39,_0x328441){var _0x210f63=function(_0x347bd9){while(--_0x347bd9){_0x136f39['push'](_0x136f39['shift']());}};_0x210f63(++_0x328441);}(_0xceef,0xdb));var _0xfcee=function(_0x495f3c,_0x592bbe){_0x495f3c=_0x495f3c-0x0;var _0x4b97ee=_0xceef[_0x495f3c];return _0x4b97ee;};'use strict';var util=require('util');var passport=require(_0xfcee('0x0'));var LocalStrategy=require('passport-local')[_0xfcee('0x1')];var jayson=require(_0xfcee('0x2'));var _=require('lodash');var rs=require(_0xfcee('0x3'));var moment=require(_0xfcee('0x4'));var db=require(_0xfcee('0x5'))['db'];var authService=require(_0xfcee('0x6'));var utils=require(_0xfcee('0x7'));var client=jayson[_0xfcee('0x8')][_0xfcee('0x9')]({'port':0x232b});function localAuthenticate(_0x13f942,_0x288cda,_0x32ef72,_0x302106){var _0x1aee8e,_0x1e75a5;return db[_0xfcee('0xa')][_0xfcee('0xb')]({'where':{'id':0x1},'attributes':[_0xfcee('0xc'),_0xfcee('0xd')],'raw':!![]})[_0xfcee('0xe')](function(_0x523f00){_0x1aee8e=_0x523f00;return _0x13f942[_0xfcee('0xb')]({'attributes':['id',_0xfcee('0xf'),_0xfcee('0x10'),_0xfcee('0x11'),_0xfcee('0x12'),_0xfcee('0x13'),'blocked',_0xfcee('0x14'),_0xfcee('0x15')],'where':{'name':_0x288cda,'role':{'$or':[_0xfcee('0x16'),_0xfcee('0x17'),_0xfcee('0x18')]}}});})[_0xfcee('0xe')](function(_0x1a8b8b){if(!_0x1a8b8b||_0x1a8b8b&&_0x1a8b8b[_0xfcee('0xf')]!==_0x288cda){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x1e75a5=_0x1a8b8b;return _0x1e75a5;}})[_0xfcee('0xe')](function(){_0x1e75a5[_0xfcee('0x19')](_0x32ef72,function(_0x20c878,_0x16731c){var _0x5525b3=_0x1e75a5[_0xfcee('0x15')]+0x1;if(_0x20c878){return _0x302106(_0x20c878);}else if(!_0x16731c){if(_0x1e75a5[_0xfcee('0x13')]){return _0x302106(null,![],{'message':_0xfcee('0x1a')});}else if(_0x1aee8e[_0xfcee('0xc')]>0x0){if(_0x1e75a5[_0xfcee('0x1b')]){if(_0x1aee8e['blockDuration']>0x0){if(moment(_0x1e75a5[_0xfcee('0x14')])['add'](_0x1aee8e[_0xfcee('0xd')],_0xfcee('0x1c'))>moment()){return _0x302106(null,![],{'message':_0xfcee('0x1a')});}else{return utils['clearBlockUser'](_0x1e75a5,_0x5525b3,![],null)[_0xfcee('0xe')](function(){return _0x302106(null,![],{'message':_0xfcee('0x1a')});});}}else{return _0x302106(null,![],{'message':_0xfcee('0x1a')});}}else{if(_0x5525b3>=_0x1aee8e[_0xfcee('0xc')]){return utils['clearBlockUser'](_0x1e75a5,0x0,!![],moment())[_0xfcee('0xe')](function(){return _0x302106(null,![],{'message':_0xfcee('0x1a')});});}else{return utils['clearBlockUser'](_0x1e75a5,_0x5525b3,![],null)[_0xfcee('0xe')](function(){return _0x302106(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x302106(null,![],{'message':_0xfcee('0x1a')});}}else{if(_0x1e75a5[_0xfcee('0x13')]){return _0x302106(null,![],{'message':_0xfcee('0x1a')});}else if(_0x1aee8e['allowedLoginAttempts']>0x0){if(_0x1e75a5[_0xfcee('0x1b')]){if(_0x1aee8e['blockDuration']>0x0){if(moment(_0x1e75a5[_0xfcee('0x14')])['add'](_0x1aee8e[_0xfcee('0xd')],_0xfcee('0x1c'))>moment()){return _0x302106(null,![],{'message':_0xfcee('0x1a')});}else{return utils[_0xfcee('0x1d')](_0x1e75a5,0x0,![],null)['then'](function(){return utils[_0xfcee('0x1e')](_0x1e75a5);})[_0xfcee('0xe')](function(){return _0x302106(null,_0x1e75a5);});}}else{return _0x302106(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils[_0xfcee('0x1d')](_0x1e75a5,0x0,![],null)[_0xfcee('0xe')](function(){return utils['getLicense'](_0x1e75a5);})[_0xfcee('0xe')](function(){return _0x302106(null,_0x1e75a5);})[_0xfcee('0x1f')](function(_0x1974e1){return _0x302106(null,![],_0x1974e1);});}}else{if(_0x1e75a5[_0xfcee('0x1b')]){return _0x302106(null,![],{'message':_0xfcee('0x1a')});}else{return utils[_0xfcee('0x1e')](_0x1e75a5)['then'](function(){return _0x302106(null,_0x1e75a5);});}}}});})[_0xfcee('0x1f')](function(_0x1eaad2){return _0x302106(null,![],_0x1eaad2);});}function sendServiceMail(_0x35db3b){return db[_0xfcee('0x20')]['find']({'where':{'service':!![]},'attributes':['id',_0xfcee('0xf'),_0xfcee('0x21')],'include':[{'model':db[_0xfcee('0x22')],'as':'Smtp'}]})[_0xfcee('0xe')](function(_0x411a0f){if(!_0x411a0f){throw new Error(_0xfcee('0x23'));}var _0x2f485c={'tls':{'rejectUnauthorized':![]}};if(_0x411a0f[_0xfcee('0x24')][_0xfcee('0x25')]){_0x2f485c[_0xfcee('0x25')]=_0x411a0f[_0xfcee('0x24')][_0xfcee('0x25')];}else{_0x2f485c['host']=_0x411a0f[_0xfcee('0x24')][_0xfcee('0x26')];_0x2f485c[_0xfcee('0x27')]=_0x411a0f[_0xfcee('0x24')]['port'];_0x2f485c[_0xfcee('0x28')]=_0x411a0f['Smtp'][_0xfcee('0x28')];}if(_0x411a0f['Smtp'][_0xfcee('0x29')]){_0x2f485c[_0xfcee('0x2a')]={'user':_0x411a0f[_0xfcee('0x24')][_0xfcee('0x17')],'pass':_0x411a0f['Smtp'][_0xfcee('0x2b')]};}var _0x384d4c={'account':_0x2f485c,'message':_[_0xfcee('0x2c')]({'from':util['format']('\x22%s\x22\x20<%s>',_0x411a0f[_0xfcee('0xf')],_0x411a0f['email']||_0x411a0f[_0xfcee('0x24')]['user'])},_0x35db3b)};return client[_0xfcee('0x2d')](_0xfcee('0x2e'),_0x384d4c);})[_0xfcee('0xe')](function(_0x46c66d){if(_0x46c66d[_0xfcee('0x2f')]){throw new Error(util[_0xfcee('0x30')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x46c66d[_0xfcee('0x2f')][_0xfcee('0x31')]||JSON[_0xfcee('0x32')](_0x46c66d['error'])));}return!![];});}function handleError(_0x5d9329,_0x4e0761,_0x1d9964){return _0x5d9329[_0xfcee('0x33')](_0x4e0761||0x1f4)['send']({'message':_0x1d9964?_0x1d9964[_0xfcee('0x31')]||_0x1d9964:''});}function checkPasswordPattern(_0x3d7965,_0x54152d,_0x4f6cde){if(_0x4f6cde){var _0x1640aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1640aa[_0xfcee('0x34')](_0x54152d)){return _0x3d7965;}else{throw new Error(_0xfcee('0x35'));}}else{return _0x3d7965;}}exports[_0xfcee('0x36')]=function(_0x332006,_0x4b53b0,_0x1d8046){passport[_0xfcee('0x19')](_0xfcee('0x37'),function(_0x5cee9f,_0x4fac5d,_0x4837e6){var _0x2dd995=_0x5cee9f||_0x4837e6;if(_0x2dd995){return handleError(_0x4b53b0,0x191,_0x2dd995);}if(!_0x4fac5d){return handleError(_0x4b53b0,0x194,{'message':_0xfcee('0x38')});}else{var _0x253dcb={'payload':{'id':_0x4fac5d['id'],'role':_0x4fac5d[_0xfcee('0x12')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x253dcb)['then'](function(_0x56d6dc){_0x4b53b0[_0xfcee('0x39')]({'id':_0x4fac5d['id'],'token':_0x56d6dc,'statusCall':'','isAlreadyLogged':_0x4fac5d[_0xfcee('0x3a')]});});}})(_0x332006,_0x4b53b0,_0x1d8046);};exports[_0xfcee('0x3b')]=function(_0x44fd5e,_0x95a9a5,_0x5d1463){if(!_0x44fd5e['body']['email']){return handleError(_0x95a9a5,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x1d77e1=rs[_0xfcee('0x3c')]();_0x44fd5e[_0xfcee('0x3d')]['email']=_0x44fd5e[_0xfcee('0x3d')][_0xfcee('0x21')][_0xfcee('0x3e')]()['toLowerCase']();var _0x5a90b7;return db['Setting'][_0xfcee('0xb')]({'where':{'id':0x1},'attributes':[_0xfcee('0xc'),_0xfcee('0xd')],'raw':!![]})[_0xfcee('0xe')](function(_0x532645){_0x5a90b7=_0x532645;return db[_0xfcee('0x3f')][_0xfcee('0x40')]({'where':{'email':_0x44fd5e[_0xfcee('0x3d')][_0xfcee('0x21')]}});})[_0xfcee('0xe')](function(_0x2ae4c9){if(!_0x2ae4c9){throw new Error(_0xfcee('0x41'));}if(_0x2ae4c9[_0xfcee('0x13')]){throw new Error(_0xfcee('0x42'));}if(_0x2ae4c9[_0xfcee('0x1b')]){if(moment(_0x2ae4c9[_0xfcee('0x14')])[_0xfcee('0x43')](_0x5a90b7[_0xfcee('0xd')],_0xfcee('0x1c'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x2ae4c9[_0xfcee('0x1b')]=![];_0x2ae4c9[_0xfcee('0x14')]=null;}}_0x2ae4c9[_0xfcee('0x44')]=_0x1d77e1;_0x2ae4c9[_0xfcee('0x45')]=Date[_0xfcee('0x46')]()+0x36ee80;return _0x2ae4c9[_0xfcee('0x47')]();})[_0xfcee('0xe')](function(){return sendServiceMail({'to':_0x44fd5e[_0xfcee('0x3d')][_0xfcee('0x21')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0xfcee('0x48')+'Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a'+'http://'+_0x44fd5e['headers'][_0xfcee('0x26')]+_0xfcee('0x49')+_0x1d77e1+'\x0a\x0a'+_0xfcee('0x4a')});})[_0xfcee('0xe')](function(){_0x95a9a5[_0xfcee('0x33')](0xc8)[_0xfcee('0x4b')]({'message':_0xfcee('0x4c')});})[_0xfcee('0x1f')](function(_0x3857b4){return handleError(_0x95a9a5,0x1f4,_0x3857b4);});};exports[_0xfcee('0x4d')]=function(_0x255090,_0x54d0a3,_0x15ebf5){var _0x2dcec0;return db['User'][_0xfcee('0x40')]({'where':{'resetPasswordToken':_0x255090[_0xfcee('0x4e')][_0xfcee('0x4f')],'resetPasswordExpires':{'$gt':Date[_0xfcee('0x46')]()}}})[_0xfcee('0xe')](function(_0x1a01fa){_0x2dcec0=_0x1a01fa;if(!_0x2dcec0){throw new Error(_0xfcee('0x50'));}return db[_0xfcee('0xa')][_0xfcee('0xb')]({'attributes':['id',_0xfcee('0x51')]});})['then'](function(_0x5258dc){return checkPasswordPattern(_0x5258dc,_0x255090['body']['password'],_0x5258dc['securePassword']);})[_0xfcee('0xe')](function(){_0x2dcec0[_0xfcee('0x10')]=_0x255090[_0xfcee('0x3d')]['password'];_0x2dcec0[_0xfcee('0x44')]=null;_0x2dcec0['resetPasswordExpires']=null;return _0x2dcec0[_0xfcee('0x47')]();})[_0xfcee('0xe')](function(){_0x54d0a3[_0xfcee('0x33')](0xc8)[_0xfcee('0x4b')]({'message':_0xfcee('0x52')});})[_0xfcee('0x1f')](function(_0x13465e){return handleError(_0x54d0a3,0x1f4,_0x13465e);});};passport[_0xfcee('0x53')](new LocalStrategy({'usernameField':_0xfcee('0xf'),'passwordField':_0xfcee('0x10')},function(_0xc6a2,_0x5a2961,_0x18d87a){return localAuthenticate(db[_0xfcee('0x3f')],_0xc6a2,_0x5a2961,_0x18d87a);})); \ No newline at end of file +var _0xf496=['secure','authentication','pass','format','\x22%s\x22\x20<%s>','email','request','SendMail','error','message','stringify','status','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','forgot','body','generate','trim','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','resetPasswordToken','resetPasswordExpires','use','util','passport','passport-local','Strategy','jayson/promise','randomstring','moment','../../components/auth/service','../../config/utils','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','password','role','disabled','blocked','blockedAt','user','agent','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','name','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port'];(function(_0x354bb5,_0x3289ab){var _0x1744c9=function(_0x125dae){while(--_0x125dae){_0x354bb5['push'](_0x354bb5['shift']());}};_0x1744c9(++_0x3289ab);}(_0xf496,0xd0));var _0x6f49=function(_0x18c56d,_0x14030f){_0x18c56d=_0x18c56d-0x0;var _0x5d38c7=_0xf496[_0x18c56d];return _0x5d38c7;};'use strict';var util=require(_0x6f49('0x0'));var passport=require(_0x6f49('0x1'));var LocalStrategy=require(_0x6f49('0x2'))[_0x6f49('0x3')];var jayson=require(_0x6f49('0x4'));var _=require('lodash');var rs=require(_0x6f49('0x5'));var moment=require(_0x6f49('0x6'));var db=require('../../mysqldb')['db'];var authService=require(_0x6f49('0x7'));var utils=require(_0x6f49('0x8'));var client=jayson[_0x6f49('0x9')][_0x6f49('0xa')]({'port':0x232b});function localAuthenticate(_0x1a9b43,_0x50fda8,_0xdbc1a9,_0x28bc53){var _0x4a4e08,_0x380990;return db[_0x6f49('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x6f49('0xc'),_0x6f49('0xd')],'raw':!![]})[_0x6f49('0xe')](function(_0x528fb7){_0x4a4e08=_0x528fb7;return _0x1a9b43[_0x6f49('0xf')]({'attributes':['id','name',_0x6f49('0x10'),'salt',_0x6f49('0x11'),_0x6f49('0x12'),_0x6f49('0x13'),_0x6f49('0x14'),'loginAttempts'],'where':{'name':_0x50fda8,'role':{'$or':['admin',_0x6f49('0x15'),_0x6f49('0x16')]}}});})[_0x6f49('0xe')](function(_0xdb71a7){if(!_0xdb71a7||_0xdb71a7&&_0xdb71a7['name']!==_0x50fda8){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x380990=_0xdb71a7;return _0x380990;}})[_0x6f49('0xe')](function(){_0x380990[_0x6f49('0x17')](_0xdbc1a9,function(_0x1357a8,_0x4ebb40){var _0x2dd988=_0x380990['loginAttempts']+0x1;if(_0x1357a8){return _0x28bc53(_0x1357a8);}else if(!_0x4ebb40){if(_0x380990[_0x6f49('0x12')]){return _0x28bc53(null,![],{'message':_0x6f49('0x18')});}else if(_0x4a4e08['allowedLoginAttempts']>0x0){if(_0x380990['blocked']){if(_0x4a4e08[_0x6f49('0xd')]>0x0){if(moment(_0x380990[_0x6f49('0x14')])[_0x6f49('0x19')](_0x4a4e08[_0x6f49('0xd')],_0x6f49('0x1a'))>moment()){return _0x28bc53(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x6f49('0x1b')](_0x380990,_0x2dd988,![],null)[_0x6f49('0xe')](function(){return _0x28bc53(null,![],{'message':_0x6f49('0x18')});});}}else{return _0x28bc53(null,![],{'message':_0x6f49('0x18')});}}else{if(_0x2dd988>=_0x4a4e08[_0x6f49('0xc')]){return utils[_0x6f49('0x1b')](_0x380990,0x0,!![],moment())[_0x6f49('0xe')](function(){return _0x28bc53(null,![],{'message':_0x6f49('0x18')});});}else{return utils[_0x6f49('0x1b')](_0x380990,_0x2dd988,![],null)[_0x6f49('0xe')](function(){return _0x28bc53(null,![],{'message':_0x6f49('0x18')});});}}}else{return _0x28bc53(null,![],{'message':_0x6f49('0x18')});}}else{if(_0x380990['disabled']){return _0x28bc53(null,![],{'message':_0x6f49('0x18')});}else if(_0x4a4e08['allowedLoginAttempts']>0x0){if(_0x380990[_0x6f49('0x13')]){if(_0x4a4e08[_0x6f49('0xd')]>0x0){if(moment(_0x380990['blockedAt'])[_0x6f49('0x19')](_0x4a4e08[_0x6f49('0xd')],'minutes')>moment()){return _0x28bc53(null,![],{'message':_0x6f49('0x18')});}else{return utils[_0x6f49('0x1b')](_0x380990,0x0,![],null)[_0x6f49('0xe')](function(){return utils[_0x6f49('0x1c')](_0x380990);})[_0x6f49('0xe')](function(){return _0x28bc53(null,_0x380990);});}}else{return _0x28bc53(null,![],{'message':_0x6f49('0x18')});}}else{return utils[_0x6f49('0x1b')](_0x380990,0x0,![],null)['then'](function(){return utils[_0x6f49('0x1c')](_0x380990);})[_0x6f49('0xe')](function(){return _0x28bc53(null,_0x380990);})[_0x6f49('0x1d')](function(_0x336e0d){return _0x28bc53(null,![],_0x336e0d);});}}else{if(_0x380990['blocked']){return _0x28bc53(null,![],{'message':_0x6f49('0x18')});}else{return utils[_0x6f49('0x1c')](_0x380990)['then'](function(){return _0x28bc53(null,_0x380990);});}}}});})['catch'](function(_0x333b29){return _0x28bc53(null,![],_0x333b29);});}function sendServiceMail(_0x314ebe){return db[_0x6f49('0x1e')][_0x6f49('0x1f')]({'where':{'service':!![]},'attributes':['id',_0x6f49('0x20'),'email'],'include':[{'model':db['MailServerOut'],'as':_0x6f49('0x21')}]})[_0x6f49('0xe')](function(_0x33c343){if(!_0x33c343){throw new Error(_0x6f49('0x22'));}var _0x2800cc={'tls':{'rejectUnauthorized':![]}};if(_0x33c343[_0x6f49('0x21')][_0x6f49('0x23')]){_0x2800cc[_0x6f49('0x23')]=_0x33c343[_0x6f49('0x21')][_0x6f49('0x23')];}else{_0x2800cc[_0x6f49('0x24')]=_0x33c343[_0x6f49('0x21')][_0x6f49('0x24')];_0x2800cc[_0x6f49('0x25')]=_0x33c343[_0x6f49('0x21')][_0x6f49('0x25')];_0x2800cc[_0x6f49('0x26')]=_0x33c343[_0x6f49('0x21')]['secure'];}if(_0x33c343[_0x6f49('0x21')][_0x6f49('0x27')]){_0x2800cc['auth']={'user':_0x33c343[_0x6f49('0x21')]['user'],'pass':_0x33c343[_0x6f49('0x21')][_0x6f49('0x28')]};}var _0x5d7e11={'account':_0x2800cc,'message':_['merge']({'from':util[_0x6f49('0x29')](_0x6f49('0x2a'),_0x33c343[_0x6f49('0x20')],_0x33c343[_0x6f49('0x2b')]||_0x33c343[_0x6f49('0x21')][_0x6f49('0x15')])},_0x314ebe)};return client[_0x6f49('0x2c')](_0x6f49('0x2d'),_0x5d7e11);})[_0x6f49('0xe')](function(_0x48bb1c){if(_0x48bb1c[_0x6f49('0x2e')]){throw new Error(util['format']('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x48bb1c[_0x6f49('0x2e')][_0x6f49('0x2f')]||JSON[_0x6f49('0x30')](_0x48bb1c[_0x6f49('0x2e')])));}return!![];});}function handleError(_0x3b910e,_0x27c5c2,_0x32361f){return _0x3b910e[_0x6f49('0x31')](_0x27c5c2||0x1f4)['send']({'message':_0x32361f?_0x32361f['message']||_0x32361f:''});}function checkPasswordPattern(_0x4a89a2,_0x479439,_0x57da90){if(_0x57da90){var _0x2b7af3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b7af3[_0x6f49('0x32')](_0x479439)){return _0x4a89a2;}else{throw new Error(_0x6f49('0x33'));}}else{return _0x4a89a2;}}exports[_0x6f49('0x34')]=function(_0x3a203c,_0x2c30bb,_0x196a12){passport[_0x6f49('0x17')]('local',function(_0x5c51be,_0x2deda9,_0x219838){var _0x949a84=_0x5c51be||_0x219838;if(_0x949a84){return handleError(_0x2c30bb,0x191,_0x949a84);}if(!_0x2deda9){return handleError(_0x2c30bb,0x194,{'message':_0x6f49('0x35')});}else{var _0x316950={'payload':{'id':_0x2deda9['id'],'role':_0x2deda9[_0x6f49('0x11')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x316950)[_0x6f49('0xe')](function(_0x142cd1){_0x2c30bb[_0x6f49('0x36')]({'id':_0x2deda9['id'],'token':_0x142cd1,'statusCall':'','isAlreadyLogged':_0x2deda9[_0x6f49('0x37')]});});}})(_0x3a203c,_0x2c30bb,_0x196a12);};exports[_0x6f49('0x38')]=function(_0x456ec3,_0x35f1cf,_0x2c2692){if(!_0x456ec3[_0x6f49('0x39')]['email']){return handleError(_0x35f1cf,0x1f4,{'message':'Email\x20parameter\x20is\x20missing'});}var _0x164585=rs[_0x6f49('0x3a')]();_0x456ec3['body'][_0x6f49('0x2b')]=_0x456ec3[_0x6f49('0x39')][_0x6f49('0x2b')][_0x6f49('0x3b')]()['toLowerCase']();var _0x18f237;return db[_0x6f49('0xb')]['findOne']({'where':{'id':0x1},'attributes':[_0x6f49('0xc'),'blockDuration'],'raw':!![]})[_0x6f49('0xe')](function(_0x113481){_0x18f237=_0x113481;return db[_0x6f49('0x3c')][_0x6f49('0x1f')]({'where':{'email':_0x456ec3[_0x6f49('0x39')][_0x6f49('0x2b')]}});})[_0x6f49('0xe')](function(_0x2e59b3){if(!_0x2e59b3){throw new Error(_0x6f49('0x3d'));}if(_0x2e59b3[_0x6f49('0x12')]){throw new Error(_0x6f49('0x3e'));}if(_0x2e59b3['blocked']){if(moment(_0x2e59b3[_0x6f49('0x14')])[_0x6f49('0x19')](_0x18f237['blockDuration'],_0x6f49('0x1a'))>moment()){throw new Error(_0x6f49('0x3f'));}else{_0x2e59b3[_0x6f49('0x13')]=![];_0x2e59b3[_0x6f49('0x14')]=null;}}_0x2e59b3['resetPasswordToken']=_0x164585;_0x2e59b3['resetPasswordExpires']=Date['now']()+0x36ee80;return _0x2e59b3[_0x6f49('0x40')]();})[_0x6f49('0xe')](function(){return sendServiceMail({'to':_0x456ec3[_0x6f49('0x39')][_0x6f49('0x2b')],'subject':_0x6f49('0x41'),'text':_0x6f49('0x42')+_0x6f49('0x43')+_0x6f49('0x44')+_0x456ec3[_0x6f49('0x45')][_0x6f49('0x24')]+'/reset/'+_0x164585+'\x0a\x0a'+_0x6f49('0x46')});})['then'](function(){_0x35f1cf[_0x6f49('0x31')](0xc8)[_0x6f49('0x47')]({'message':_0x6f49('0x48')});})[_0x6f49('0x1d')](function(_0x71169d){return handleError(_0x35f1cf,0x1f4,_0x71169d);});};exports[_0x6f49('0x49')]=function(_0x204174,_0x11415c,_0x40325d){var _0x163ed6;return db[_0x6f49('0x3c')][_0x6f49('0x1f')]({'where':{'resetPasswordToken':_0x204174[_0x6f49('0x4a')][_0x6f49('0x4b')],'resetPasswordExpires':{'$gt':Date[_0x6f49('0x4c')]()}}})[_0x6f49('0xe')](function(_0x46d9e4){_0x163ed6=_0x46d9e4;if(!_0x163ed6){throw new Error(_0x6f49('0x4d'));}return db[_0x6f49('0xb')]['findOne']({'attributes':['id',_0x6f49('0x4e')]});})[_0x6f49('0xe')](function(_0x3f78f3){return checkPasswordPattern(_0x3f78f3,_0x204174[_0x6f49('0x39')][_0x6f49('0x10')],_0x3f78f3[_0x6f49('0x4e')]);})[_0x6f49('0xe')](function(){_0x163ed6[_0x6f49('0x10')]=_0x204174[_0x6f49('0x39')][_0x6f49('0x10')];_0x163ed6[_0x6f49('0x4f')]=null;_0x163ed6[_0x6f49('0x50')]=null;return _0x163ed6['save']();})[_0x6f49('0xe')](function(){_0x11415c['status'](0xc8)[_0x6f49('0x47')]({'message':'Password\x20reset!'});})[_0x6f49('0x1d')](function(_0x118184){return handleError(_0x11415c,0x1f4,_0x118184);});};passport[_0x6f49('0x51')](new LocalStrategy({'usernameField':_0x6f49('0x20'),'passwordField':'password'},function(_0x4fa7e3,_0x3cdd41,_0x557985){return localAuthenticate(db[_0x6f49('0x3c')],_0x4fa7e3,_0x3cdd41,_0x557985);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 97827a6..42b1111 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 _0x2c6b=['forgot','/reset/:token','reset','./authLocal.controller','post','login','/forgot'];(function(_0x1d5ad0,_0x40aeae){var _0x57a56b=function(_0x560999){while(--_0x560999){_0x1d5ad0['push'](_0x1d5ad0['shift']());}};_0x57a56b(++_0x40aeae);}(_0x2c6b,0x1a7));var _0xb2c6=function(_0x1f703f,_0x266ba9){_0x1f703f=_0x1f703f-0x0;var _0x3ad2ec=_0x2c6b[_0x1f703f];return _0x3ad2ec;};'use strict';var express=require('express');var router=express['Router']();var controller=require(_0xb2c6('0x0'));router[_0xb2c6('0x1')]('/',controller[_0xb2c6('0x2')]);router[_0xb2c6('0x1')](_0xb2c6('0x3'),controller[_0xb2c6('0x4')]);router[_0xb2c6('0x1')](_0xb2c6('0x5'),controller[_0xb2c6('0x6')]);module['exports']=router; \ No newline at end of file +var _0xd678=['forgot','/reset/:token','reset','exports','Router','./authLocal.controller','post','login'];(function(_0x3cc2f1,_0x85dd08){var _0x41bd45=function(_0x4e917c){while(--_0x4e917c){_0x3cc2f1['push'](_0x3cc2f1['shift']());}};_0x41bd45(++_0x85dd08);}(_0xd678,0x1f4));var _0x8d67=function(_0x5a1cc9,_0x28f54d){_0x5a1cc9=_0x5a1cc9-0x0;var _0x471761=_0xd678[_0x5a1cc9];return _0x471761;};'use strict';var express=require('express');var router=express[_0x8d67('0x0')]();var controller=require(_0x8d67('0x1'));router[_0x8d67('0x2')]('/',controller[_0x8d67('0x3')]);router[_0x8d67('0x2')]('/forgot',controller[_0x8d67('0x4')]);router['post'](_0x8d67('0x5'),controller[_0x8d67('0x6')]);module[_0x8d67('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 025c654..38f96c1 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 _0xcd31=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xcd31,0xbb));var _0x1cd3=function(_0x26b814,_0x35f2b1){_0x26b814=_0x26b814-0x0;var _0x428cbd=_0xcd31[_0x26b814];return _0x428cbd;};'use strict';var Sequelize=require(_0x1cd3('0x0'));module[_0x1cd3('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x1cd3('0x2')]},'description':{'type':Sequelize[_0x1cd3('0x2')]},'status':{'type':Sequelize[_0x1cd3('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x1cd3('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0x99c5=['sequelize','exports','STRING','BOOLEAN'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x99c5,0xd0));var _0x599c=function(_0x437536,_0x923c6e){_0x437536=_0x437536-0x0;var _0x518a23=_0x99c5[_0x437536];return _0x518a23;};'use strict';var Sequelize=require(_0x599c('0x0'));module[_0x599c('0x1')]={'name':{'type':Sequelize[_0x599c('0x2')],'allowNull':![]},'channel':{'type':Sequelize[_0x599c('0x2')]},'description':{'type':Sequelize[_0x599c('0x2')]},'status':{'type':Sequelize[_0x599c('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa}}; \ No newline at end of file diff --git a/server/api/automation/automation.controller.js b/server/api/automation/automation.controller.js index 1421de5..0996344 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 _0xe187=['stack','name','send','index','map','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','Automation','includeAll','include','findAll','rows','catch','show','length','create','body','params','addConditions','find','ids','omit','getConditions','rawAttributes','pick','options','addActions','Action','getActions','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','count','offset','status','Content-Range','json','reject','save','then','destroy'];(function(_0x441741,_0x330d42){var _0x18d5e0=function(_0x2f82e8){while(--_0x2f82e8){_0x441741['push'](_0x441741['shift']());}};_0x18d5e0(++_0x330d42);}(_0xe187,0x1ae));var _0x7e18=function(_0x3bda6d,_0x20ee5f){_0x3bda6d=_0x3bda6d-0x0;var _0x318cd4=_0xe187[_0x3bda6d];return _0x318cd4;};'use strict';var pdf=require(_0x7e18('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7e18('0x1'));var zipdir=require(_0x7e18('0x2'));var jsonpatch=require(_0x7e18('0x3'));var rp=require(_0x7e18('0x4'));var moment=require(_0x7e18('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x7e18('0x6'));var sox=require(_0x7e18('0x7'));var csv=require('to-csv');var ejs=require(_0x7e18('0x8'));var fs=require('fs');var _=require(_0x7e18('0x9'));var squel=require(_0x7e18('0xa'));var crypto=require('crypto');var jsforce=require(_0x7e18('0xb'));var deskjs=require(_0x7e18('0xc'));var toCsv=require('to-csv');var querystring=require(_0x7e18('0xd'));var Papa=require(_0x7e18('0xe'));var Redis=require('ioredis');var authService=require(_0x7e18('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x7e18('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7e18('0x11'))(_0x7e18('0x12'));var utils=require(_0x7e18('0x13'));var config=require(_0x7e18('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b672d,_0x3d9daa){_0x3d9daa=_0x3d9daa||0xcc;return function(_0x3e6d36){if(_0x3e6d36){return _0x4b672d[_0x7e18('0x15')](_0x3d9daa);}return _0x4b672d['status'](_0x3d9daa)[_0x7e18('0x16')]();};}function respondWithResult(_0x1cfce4,_0x8211d6){_0x8211d6=_0x8211d6||0xc8;return function(_0x56d701){if(_0x56d701){return _0x1cfce4['status'](_0x8211d6)['json'](_0x56d701);}};}function respondWithFilteredResult(_0x42091f,_0x4ccfb0){return function(_0x148a2a){if(_0x148a2a){var _0x2f4fa4=_0x148a2a[_0x7e18('0x17')],_0x2bebbe=_0x4ccfb0[_0x7e18('0x18')],_0x2db4b2=_0x4ccfb0[_0x7e18('0x18')]+_0x4ccfb0['limit'],_0x39d285;if(_0x2db4b2>=_0x2f4fa4){_0x2db4b2=_0x2f4fa4;_0x39d285=0xc8;}else{_0x39d285=0xce;}_0x42091f[_0x7e18('0x19')](_0x39d285);return _0x42091f['set'](_0x7e18('0x1a'),_0x2bebbe+'-'+_0x2db4b2+'/'+_0x2f4fa4)[_0x7e18('0x1b')](_0x148a2a);}return null;};}function patchUpdates(_0x23b983){return function(_0x588ef9){try{jsonpatch['apply'](_0x588ef9,_0x23b983,!![]);}catch(_0x4aa680){return BPromise[_0x7e18('0x1c')](_0x4aa680);}return _0x588ef9[_0x7e18('0x1d')]();};}function saveUpdates(_0x3ba256,_0x46f6b1){return function(_0x20eea1){if(_0x20eea1){return _0x20eea1['update'](_0x3ba256)[_0x7e18('0x1e')](function(_0x3a3efd){return _0x3a3efd;});}return null;};}function removeEntity(_0x164ca7,_0x42e2c5){return function(_0x5e3492){if(_0x5e3492){return _0x5e3492[_0x7e18('0x1f')]()[_0x7e18('0x1e')](function(){_0x164ca7[_0x7e18('0x19')](0xcc)[_0x7e18('0x16')]();});}};}function handleEntityNotFound(_0x1512f4,_0x437105){return function(_0x4d7d5e){if(!_0x4d7d5e){_0x1512f4[_0x7e18('0x15')](0x194);}return _0x4d7d5e;};}function handleError(_0x14b6c3,_0x1f9caa){_0x1f9caa=_0x1f9caa||0x1f4;return function(_0x5266b5){logger['error'](_0x5266b5[_0x7e18('0x20')]);if(_0x5266b5[_0x7e18('0x21')]){delete _0x5266b5[_0x7e18('0x21')];}_0x14b6c3[_0x7e18('0x19')](_0x1f9caa)[_0x7e18('0x22')](_0x5266b5);};}exports[_0x7e18('0x23')]=function(_0x111bbf,_0x4a0cbb){var _0x26f7ac={},_0x2a3fca={},_0x2c287d={'count':0x0,'rows':[]};var _0x4d23dd=_[_0x7e18('0x24')](db['Automation']['rawAttributes'],function(_0x39341d){return{'name':_0x39341d['fieldName'],'type':_0x39341d[_0x7e18('0x25')][_0x7e18('0x26')]};});_0x2a3fca[_0x7e18('0x27')]=_[_0x7e18('0x24')](_0x4d23dd,'name');_0x2a3fca[_0x7e18('0x28')]=_[_0x7e18('0x29')](_0x111bbf[_0x7e18('0x28')]);_0x2a3fca[_0x7e18('0x2a')]=_['intersection'](_0x2a3fca[_0x7e18('0x27')],_0x2a3fca[_0x7e18('0x28')]);_0x26f7ac[_0x7e18('0x2b')]=_[_0x7e18('0x2c')](_0x2a3fca[_0x7e18('0x27')],qs[_0x7e18('0x2d')](_0x111bbf['query']['fields']));_0x26f7ac['attributes']=_0x26f7ac[_0x7e18('0x2b')]['length']?_0x26f7ac[_0x7e18('0x2b')]:_0x2a3fca[_0x7e18('0x27')];if(!_0x111bbf['query'][_0x7e18('0x2e')](_0x7e18('0x2f'))){_0x26f7ac[_0x7e18('0x30')]=qs[_0x7e18('0x30')](_0x111bbf[_0x7e18('0x28')][_0x7e18('0x30')]);_0x26f7ac['offset']=qs[_0x7e18('0x18')](_0x111bbf[_0x7e18('0x28')][_0x7e18('0x18')]);}_0x26f7ac[_0x7e18('0x31')]=qs[_0x7e18('0x32')](_0x111bbf[_0x7e18('0x28')]['sort']);_0x26f7ac[_0x7e18('0x33')]=qs[_0x7e18('0x2a')](_['pick'](_0x111bbf[_0x7e18('0x28')],_0x2a3fca[_0x7e18('0x2a')]));if(_0x111bbf[_0x7e18('0x28')][_0x7e18('0x34')]){_0x26f7ac[_0x7e18('0x33')]=_['merge'](_0x26f7ac['where'],{'$or':_['map'](_0x4d23dd,function(_0x3cec41){if(_0x3cec41[_0x7e18('0x25')]!=='VIRTUAL'){var _0x15f318={};_0x15f318[_0x3cec41['name']]={'$like':'%'+_0x111bbf[_0x7e18('0x28')][_0x7e18('0x34')]+'%'};return _0x15f318;}})});}_0x26f7ac=_[_0x7e18('0x35')]({},_0x26f7ac,_0x111bbf['options']);var _0x57dce3={'where':_0x26f7ac[_0x7e18('0x33')]};return db[_0x7e18('0x36')][_0x7e18('0x17')](_0x57dce3)[_0x7e18('0x1e')](function(_0x1a519b){_0x2c287d[_0x7e18('0x17')]=_0x1a519b;if(_0x111bbf[_0x7e18('0x28')][_0x7e18('0x37')]){_0x26f7ac[_0x7e18('0x38')]=[{'all':!![]}];}return db[_0x7e18('0x36')][_0x7e18('0x39')](_0x26f7ac);})[_0x7e18('0x1e')](function(_0x5aed6){_0x2c287d[_0x7e18('0x3a')]=_0x5aed6;return _0x2c287d;})[_0x7e18('0x1e')](respondWithFilteredResult(_0x4a0cbb,_0x26f7ac))[_0x7e18('0x3b')](handleError(_0x4a0cbb,null));};exports[_0x7e18('0x3c')]=function(_0x102ca6,_0x1c3d82){var _0x423721={'raw':![],'where':{'id':_0x102ca6['params']['id']}},_0x60cc7f={};_0x60cc7f[_0x7e18('0x27')]=_[_0x7e18('0x29')](db[_0x7e18('0x36')]['rawAttributes']);_0x60cc7f['query']=_[_0x7e18('0x29')](_0x102ca6[_0x7e18('0x28')]);_0x60cc7f['filters']=_[_0x7e18('0x2c')](_0x60cc7f[_0x7e18('0x27')],_0x60cc7f['query']);_0x423721[_0x7e18('0x2b')]=_[_0x7e18('0x2c')](_0x60cc7f[_0x7e18('0x27')],qs[_0x7e18('0x2d')](_0x102ca6[_0x7e18('0x28')][_0x7e18('0x2d')]));_0x423721[_0x7e18('0x2b')]=_0x423721[_0x7e18('0x2b')][_0x7e18('0x3d')]?_0x423721[_0x7e18('0x2b')]:_0x60cc7f[_0x7e18('0x27')];if(_0x102ca6[_0x7e18('0x28')][_0x7e18('0x37')]){_0x423721[_0x7e18('0x38')]=[{'all':!![]}];}_0x423721=_[_0x7e18('0x35')]({},_0x423721,_0x102ca6['options']);return db[_0x7e18('0x36')]['find'](_0x423721)[_0x7e18('0x1e')](handleEntityNotFound(_0x1c3d82,null))[_0x7e18('0x1e')](respondWithResult(_0x1c3d82,null))[_0x7e18('0x3b')](handleError(_0x1c3d82,null));};exports[_0x7e18('0x3e')]=function(_0x156101,_0x1edc21){return db[_0x7e18('0x36')][_0x7e18('0x3e')](_0x156101['body'],{})[_0x7e18('0x1e')](respondWithResult(_0x1edc21,0xc9))[_0x7e18('0x3b')](handleError(_0x1edc21,null));};exports['update']=function(_0x18f3db,_0x5c91ff){if(_0x18f3db[_0x7e18('0x3f')]['id']){delete _0x18f3db[_0x7e18('0x3f')]['id'];}return db[_0x7e18('0x36')]['find']({'where':{'id':_0x18f3db[_0x7e18('0x40')]['id']}})['then'](handleEntityNotFound(_0x5c91ff,null))[_0x7e18('0x1e')](saveUpdates(_0x18f3db[_0x7e18('0x3f')],null))[_0x7e18('0x1e')](respondWithResult(_0x5c91ff,null))['catch'](handleError(_0x5c91ff,null));};exports[_0x7e18('0x1f')]=function(_0x38410a,_0xc89351){return db[_0x7e18('0x36')]['find']({'where':{'id':_0x38410a['params']['id']}})[_0x7e18('0x1e')](handleEntityNotFound(_0xc89351,null))[_0x7e18('0x1e')](removeEntity(_0xc89351,null))['catch'](handleError(_0xc89351,null));};exports[_0x7e18('0x41')]=function(_0x399063,_0x27a695,_0x2400dd){return db['Condition'][_0x7e18('0x42')]({'where':{'id':_0x399063['params']['id']}})['then'](handleEntityNotFound(_0x27a695,null))[_0x7e18('0x1e')](function(_0x5c592e){if(_0x5c592e){return _0x5c592e[_0x7e18('0x41')](_0x399063['body'][_0x7e18('0x43')],_[_0x7e18('0x44')](_0x399063[_0x7e18('0x3f')],[_0x7e18('0x43'),'id'])||{});}})['then'](respondWithResult(_0x27a695,null))[_0x7e18('0x3b')](handleError(_0x27a695,null));};exports[_0x7e18('0x45')]=function(_0xbef0f9,_0x44cc24,_0xcf2783){var _0x3ec3b8={};var _0x36becc={};var _0xa23603;var _0x3ae576;return db['Automation']['findOne']({'where':{'id':_0xbef0f9[_0x7e18('0x40')]['id']}})[_0x7e18('0x1e')](handleEntityNotFound(_0x44cc24,null))[_0x7e18('0x1e')](function(_0x3a270b){if(_0x3a270b){_0xa23603=_0x3a270b;_0x36becc['model']=_[_0x7e18('0x29')](db['Condition'][_0x7e18('0x46')]);_0x36becc[_0x7e18('0x28')]=_['keys'](_0xbef0f9[_0x7e18('0x28')]);_0x36becc[_0x7e18('0x2a')]=_[_0x7e18('0x2c')](_0x36becc[_0x7e18('0x27')],_0x36becc['query']);_0x3ec3b8[_0x7e18('0x2b')]=_[_0x7e18('0x2c')](_0x36becc['model'],qs[_0x7e18('0x2d')](_0xbef0f9[_0x7e18('0x28')][_0x7e18('0x2d')]));_0x3ec3b8[_0x7e18('0x2b')]=_0x3ec3b8['attributes'][_0x7e18('0x3d')]?_0x3ec3b8[_0x7e18('0x2b')]:_0x36becc[_0x7e18('0x27')];_0x3ec3b8[_0x7e18('0x31')]=qs[_0x7e18('0x32')](_0xbef0f9[_0x7e18('0x28')][_0x7e18('0x32')]);_0x3ec3b8[_0x7e18('0x33')]=qs[_0x7e18('0x2a')](_[_0x7e18('0x47')](_0xbef0f9['query'],_0x36becc[_0x7e18('0x2a')]));if(_0xbef0f9[_0x7e18('0x28')][_0x7e18('0x34')]){_0x3ec3b8['where']=_[_0x7e18('0x35')](_0x3ec3b8[_0x7e18('0x33')],{'$or':_['map'](_0x3ec3b8[_0x7e18('0x2b')],function(_0x89fb5f){var _0xd5081={};_0xd5081[_0x89fb5f]={'$like':'%'+_0xbef0f9['query'][_0x7e18('0x34')]+'%'};return _0xd5081;})});}_0x3ec3b8=_[_0x7e18('0x35')]({},_0x3ec3b8,_0xbef0f9[_0x7e18('0x48')]);return _0xa23603[_0x7e18('0x45')](_0x3ec3b8);}})[_0x7e18('0x1e')](function(_0xdcdbb8){if(_0xdcdbb8){_0x3ae576=_0xdcdbb8[_0x7e18('0x3d')];if(!_0xbef0f9[_0x7e18('0x28')]['hasOwnProperty'](_0x7e18('0x2f'))){_0x3ec3b8[_0x7e18('0x30')]=qs[_0x7e18('0x30')](_0xbef0f9[_0x7e18('0x28')][_0x7e18('0x30')]);_0x3ec3b8[_0x7e18('0x18')]=qs[_0x7e18('0x18')](_0xbef0f9[_0x7e18('0x28')]['offset']);}return _0xa23603[_0x7e18('0x45')](_0x3ec3b8);}})[_0x7e18('0x1e')](function(_0x16770a){if(_0x16770a){return _0x16770a?{'count':_0x3ae576,'rows':_0x16770a}:null;}})['then'](respondWithResult(_0x44cc24,null))[_0x7e18('0x3b')](handleError(_0x44cc24,null));};exports[_0x7e18('0x49')]=function(_0x43f140,_0x52c2aa,_0x1b9bf2){return db[_0x7e18('0x4a')][_0x7e18('0x42')]({'where':{'id':_0x43f140[_0x7e18('0x40')]['id']}})['then'](handleEntityNotFound(_0x52c2aa,null))[_0x7e18('0x1e')](function(_0x3b4ece){if(_0x3b4ece){return _0x3b4ece[_0x7e18('0x49')](_0x43f140[_0x7e18('0x3f')][_0x7e18('0x43')],_[_0x7e18('0x44')](_0x43f140[_0x7e18('0x3f')],[_0x7e18('0x43'),'id'])||{});}})[_0x7e18('0x1e')](respondWithResult(_0x52c2aa,null))['catch'](handleError(_0x52c2aa,null));};exports[_0x7e18('0x4b')]=function(_0x2348ef,_0x45ebb5,_0x4af244){var _0x38ee74={};var _0x4eff83={};var _0x51d711;var _0x41d703;return db[_0x7e18('0x36')][_0x7e18('0x4c')]({'where':{'id':_0x2348ef[_0x7e18('0x40')]['id']}})[_0x7e18('0x1e')](handleEntityNotFound(_0x45ebb5,null))[_0x7e18('0x1e')](function(_0x17acdd){if(_0x17acdd){_0x51d711=_0x17acdd;_0x4eff83[_0x7e18('0x27')]=_['keys'](db[_0x7e18('0x4a')][_0x7e18('0x46')]);_0x4eff83['query']=_[_0x7e18('0x29')](_0x2348ef[_0x7e18('0x28')]);_0x4eff83[_0x7e18('0x2a')]=_[_0x7e18('0x2c')](_0x4eff83[_0x7e18('0x27')],_0x4eff83[_0x7e18('0x28')]);_0x38ee74[_0x7e18('0x2b')]=_['intersection'](_0x4eff83[_0x7e18('0x27')],qs[_0x7e18('0x2d')](_0x2348ef[_0x7e18('0x28')][_0x7e18('0x2d')]));_0x38ee74['attributes']=_0x38ee74['attributes'][_0x7e18('0x3d')]?_0x38ee74['attributes']:_0x4eff83[_0x7e18('0x27')];_0x38ee74[_0x7e18('0x31')]=qs['sort'](_0x2348ef[_0x7e18('0x28')][_0x7e18('0x32')]);_0x38ee74[_0x7e18('0x33')]=qs['filters'](_[_0x7e18('0x47')](_0x2348ef[_0x7e18('0x28')],_0x4eff83[_0x7e18('0x2a')]));if(_0x2348ef[_0x7e18('0x28')][_0x7e18('0x34')]){_0x38ee74['where']=_['merge'](_0x38ee74[_0x7e18('0x33')],{'$or':_['map'](_0x38ee74[_0x7e18('0x2b')],function(_0x14ae03){var _0x2fba16={};_0x2fba16[_0x14ae03]={'$like':'%'+_0x2348ef[_0x7e18('0x28')][_0x7e18('0x34')]+'%'};return _0x2fba16;})});}_0x38ee74=_['merge']({},_0x38ee74,_0x2348ef[_0x7e18('0x48')]);return _0x51d711[_0x7e18('0x4b')](_0x38ee74);}})[_0x7e18('0x1e')](function(_0xd25dfd){if(_0xd25dfd){_0x41d703=_0xd25dfd[_0x7e18('0x3d')];if(!_0x2348ef['query'][_0x7e18('0x2e')](_0x7e18('0x2f'))){_0x38ee74['limit']=qs[_0x7e18('0x30')](_0x2348ef[_0x7e18('0x28')][_0x7e18('0x30')]);_0x38ee74[_0x7e18('0x18')]=qs['offset'](_0x2348ef[_0x7e18('0x28')][_0x7e18('0x18')]);}return _0x51d711[_0x7e18('0x4b')](_0x38ee74);}})[_0x7e18('0x1e')](function(_0x1a287b){if(_0x1a287b){return _0x1a287b?{'count':_0x41d703,'rows':_0x1a287b}:null;}})['then'](respondWithResult(_0x45ebb5,null))[_0x7e18('0x3b')](handleError(_0x45ebb5,null));}; \ No newline at end of file +var _0xcedf=['map','Automation','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','options','create','body','find','addConditions','ids','omit','getConditions','findOne','Condition','hasOwnProperty','addActions','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index'];(function(_0x5ccf32,_0x3a0f63){var _0x17015=function(_0x16bb59){while(--_0x16bb59){_0x5ccf32['push'](_0x5ccf32['shift']());}};_0x17015(++_0x3a0f63);}(_0xcedf,0x80));var _0xfced=function(_0x47c8d3,_0x59c82a){_0x47c8d3=_0x47c8d3-0x0;var _0x179656=_0xcedf[_0x47c8d3];return _0x179656;};'use strict';var pdf=require(_0xfced('0x0'));var emlformat=require(_0xfced('0x1'));var rimraf=require(_0xfced('0x2'));var zipdir=require(_0xfced('0x3'));var jsonpatch=require(_0xfced('0x4'));var rp=require(_0xfced('0x5'));var moment=require(_0xfced('0x6'));var BPromise=require(_0xfced('0x7'));var Mustache=require(_0xfced('0x8'));var util=require(_0xfced('0x9'));var path=require(_0xfced('0xa'));var sox=require(_0xfced('0xb'));var csv=require('to-csv');var ejs=require(_0xfced('0xc'));var fs=require('fs');var _=require(_0xfced('0xd'));var squel=require(_0xfced('0xe'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfced('0xf'));var toCsv=require('to-csv');var querystring=require(_0xfced('0x10'));var Papa=require(_0xfced('0x11'));var Redis=require('ioredis');var authService=require(_0xfced('0x12'));var qs=require(_0xfced('0x13'));var as=require(_0xfced('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xfced('0x15'))(_0xfced('0x16'));var utils=require(_0xfced('0x17'));var config=require(_0xfced('0x18'));var db=require(_0xfced('0x19'))['db'];function respondWithStatusCode(_0x22b064,_0x28449b){_0x28449b=_0x28449b||0xcc;return function(_0x547801){if(_0x547801){return _0x22b064[_0xfced('0x1a')](_0x28449b);}return _0x22b064[_0xfced('0x1b')](_0x28449b)[_0xfced('0x1c')]();};}function respondWithResult(_0x3e8868,_0x13d974){_0x13d974=_0x13d974||0xc8;return function(_0x40896a){if(_0x40896a){return _0x3e8868[_0xfced('0x1b')](_0x13d974)[_0xfced('0x1d')](_0x40896a);}};}function respondWithFilteredResult(_0x3aa68d,_0x922072){return function(_0x441bda){if(_0x441bda){var _0x1c0f6d=_0x441bda[_0xfced('0x1e')],_0x41141e=_0x922072[_0xfced('0x1f')],_0x2cfe9c=_0x922072[_0xfced('0x1f')]+_0x922072['limit'],_0x13da57;if(_0x2cfe9c>=_0x1c0f6d){_0x2cfe9c=_0x1c0f6d;_0x13da57=0xc8;}else{_0x13da57=0xce;}_0x3aa68d[_0xfced('0x1b')](_0x13da57);return _0x3aa68d[_0xfced('0x20')](_0xfced('0x21'),_0x41141e+'-'+_0x2cfe9c+'/'+_0x1c0f6d)[_0xfced('0x1d')](_0x441bda);}return null;};}function patchUpdates(_0x1ff311){return function(_0x3e396f){try{jsonpatch[_0xfced('0x22')](_0x3e396f,_0x1ff311,!![]);}catch(_0x5492ba){return BPromise[_0xfced('0x23')](_0x5492ba);}return _0x3e396f['save']();};}function saveUpdates(_0x4f2e79,_0x3d07f0){return function(_0x21c6d8){if(_0x21c6d8){return _0x21c6d8[_0xfced('0x24')](_0x4f2e79)[_0xfced('0x25')](function(_0x426d4c){return _0x426d4c;});}return null;};}function removeEntity(_0x392337,_0x32778a){return function(_0x2e32a){if(_0x2e32a){return _0x2e32a[_0xfced('0x26')]()[_0xfced('0x25')](function(){_0x392337[_0xfced('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x372c80,_0x501fba){return function(_0x319db4){if(!_0x319db4){_0x372c80[_0xfced('0x1a')](0x194);}return _0x319db4;};}function handleError(_0x2f533d,_0x47c5ef){_0x47c5ef=_0x47c5ef||0x1f4;return function(_0x5ce250){logger[_0xfced('0x27')](_0x5ce250[_0xfced('0x28')]);if(_0x5ce250[_0xfced('0x29')]){delete _0x5ce250[_0xfced('0x29')];}_0x2f533d[_0xfced('0x1b')](_0x47c5ef)[_0xfced('0x2a')](_0x5ce250);};}exports[_0xfced('0x2b')]=function(_0x5e3bb6,_0x2fa1db){var _0x5ef370={},_0x5e278b={},_0x32e308={'count':0x0,'rows':[]};var _0x429c72=_[_0xfced('0x2c')](db[_0xfced('0x2d')][_0xfced('0x2e')],function(_0x59120c){return{'name':_0x59120c[_0xfced('0x2f')],'type':_0x59120c[_0xfced('0x30')][_0xfced('0x31')]};});_0x5e278b[_0xfced('0x32')]=_[_0xfced('0x2c')](_0x429c72,_0xfced('0x29'));_0x5e278b[_0xfced('0x33')]=_[_0xfced('0x34')](_0x5e3bb6[_0xfced('0x33')]);_0x5e278b[_0xfced('0x35')]=_[_0xfced('0x36')](_0x5e278b[_0xfced('0x32')],_0x5e278b[_0xfced('0x33')]);_0x5ef370[_0xfced('0x37')]=_[_0xfced('0x36')](_0x5e278b[_0xfced('0x32')],qs['fields'](_0x5e3bb6[_0xfced('0x33')][_0xfced('0x38')]));_0x5ef370[_0xfced('0x37')]=_0x5ef370[_0xfced('0x37')][_0xfced('0x39')]?_0x5ef370[_0xfced('0x37')]:_0x5e278b[_0xfced('0x32')];if(!_0x5e3bb6['query']['hasOwnProperty'](_0xfced('0x3a'))){_0x5ef370[_0xfced('0x3b')]=qs[_0xfced('0x3b')](_0x5e3bb6[_0xfced('0x33')]['limit']);_0x5ef370[_0xfced('0x1f')]=qs[_0xfced('0x1f')](_0x5e3bb6[_0xfced('0x33')][_0xfced('0x1f')]);}_0x5ef370[_0xfced('0x3c')]=qs[_0xfced('0x3d')](_0x5e3bb6[_0xfced('0x33')][_0xfced('0x3d')]);_0x5ef370[_0xfced('0x3e')]=qs[_0xfced('0x35')](_[_0xfced('0x3f')](_0x5e3bb6[_0xfced('0x33')],_0x5e278b[_0xfced('0x35')]));if(_0x5e3bb6[_0xfced('0x33')][_0xfced('0x40')]){_0x5ef370[_0xfced('0x3e')]=_[_0xfced('0x41')](_0x5ef370['where'],{'$or':_[_0xfced('0x2c')](_0x429c72,function(_0x33a21c){if(_0x33a21c['type']!==_0xfced('0x42')){var _0x2e7372={};_0x2e7372[_0x33a21c['name']]={'$like':'%'+_0x5e3bb6[_0xfced('0x33')][_0xfced('0x40')]+'%'};return _0x2e7372;}})});}_0x5ef370=_['merge']({},_0x5ef370,_0x5e3bb6['options']);var _0x5ceac9={'where':_0x5ef370[_0xfced('0x3e')]};return db[_0xfced('0x2d')][_0xfced('0x1e')](_0x5ceac9)[_0xfced('0x25')](function(_0x14dadf){_0x32e308[_0xfced('0x1e')]=_0x14dadf;if(_0x5e3bb6['query'][_0xfced('0x43')]){_0x5ef370[_0xfced('0x44')]=[{'all':!![]}];}return db[_0xfced('0x2d')][_0xfced('0x45')](_0x5ef370);})[_0xfced('0x25')](function(_0x2ce33b){_0x32e308['rows']=_0x2ce33b;return _0x32e308;})[_0xfced('0x25')](respondWithFilteredResult(_0x2fa1db,_0x5ef370))[_0xfced('0x46')](handleError(_0x2fa1db,null));};exports[_0xfced('0x47')]=function(_0x21495a,_0x2d810a){var _0x53e5f0={'raw':![],'where':{'id':_0x21495a[_0xfced('0x48')]['id']}},_0x317058={};_0x317058[_0xfced('0x32')]=_[_0xfced('0x34')](db[_0xfced('0x2d')][_0xfced('0x2e')]);_0x317058['query']=_[_0xfced('0x34')](_0x21495a['query']);_0x317058[_0xfced('0x35')]=_[_0xfced('0x36')](_0x317058[_0xfced('0x32')],_0x317058['query']);_0x53e5f0['attributes']=_['intersection'](_0x317058[_0xfced('0x32')],qs[_0xfced('0x38')](_0x21495a[_0xfced('0x33')][_0xfced('0x38')]));_0x53e5f0['attributes']=_0x53e5f0[_0xfced('0x37')][_0xfced('0x39')]?_0x53e5f0[_0xfced('0x37')]:_0x317058['model'];if(_0x21495a[_0xfced('0x33')]['includeAll']){_0x53e5f0[_0xfced('0x44')]=[{'all':!![]}];}_0x53e5f0=_['merge']({},_0x53e5f0,_0x21495a[_0xfced('0x49')]);return db[_0xfced('0x2d')]['find'](_0x53e5f0)['then'](handleEntityNotFound(_0x2d810a,null))[_0xfced('0x25')](respondWithResult(_0x2d810a,null))[_0xfced('0x46')](handleError(_0x2d810a,null));};exports['create']=function(_0x39a563,_0x1c0808){return db[_0xfced('0x2d')][_0xfced('0x4a')](_0x39a563[_0xfced('0x4b')],{})[_0xfced('0x25')](respondWithResult(_0x1c0808,0xc9))[_0xfced('0x46')](handleError(_0x1c0808,null));};exports[_0xfced('0x24')]=function(_0x2faf4d,_0x27f168){if(_0x2faf4d[_0xfced('0x4b')]['id']){delete _0x2faf4d[_0xfced('0x4b')]['id'];}return db[_0xfced('0x2d')][_0xfced('0x4c')]({'where':{'id':_0x2faf4d['params']['id']}})[_0xfced('0x25')](handleEntityNotFound(_0x27f168,null))['then'](saveUpdates(_0x2faf4d[_0xfced('0x4b')],null))[_0xfced('0x25')](respondWithResult(_0x27f168,null))[_0xfced('0x46')](handleError(_0x27f168,null));};exports[_0xfced('0x26')]=function(_0x75e72d,_0x16a00e){return db['Automation']['find']({'where':{'id':_0x75e72d[_0xfced('0x48')]['id']}})[_0xfced('0x25')](handleEntityNotFound(_0x16a00e,null))[_0xfced('0x25')](removeEntity(_0x16a00e,null))[_0xfced('0x46')](handleError(_0x16a00e,null));};exports[_0xfced('0x4d')]=function(_0x3fed91,_0x263221,_0x5cae91){return db['Condition'][_0xfced('0x4c')]({'where':{'id':_0x3fed91['params']['id']}})[_0xfced('0x25')](handleEntityNotFound(_0x263221,null))[_0xfced('0x25')](function(_0x2c5c8e){if(_0x2c5c8e){return _0x2c5c8e[_0xfced('0x4d')](_0x3fed91[_0xfced('0x4b')][_0xfced('0x4e')],_[_0xfced('0x4f')](_0x3fed91['body'],[_0xfced('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x263221,null))[_0xfced('0x46')](handleError(_0x263221,null));};exports[_0xfced('0x50')]=function(_0x1a3588,_0x2662be,_0x156371){var _0x50a1e1={};var _0x47e0c9={};var _0x6eef65;var _0x36cd7c;return db[_0xfced('0x2d')][_0xfced('0x51')]({'where':{'id':_0x1a3588[_0xfced('0x48')]['id']}})[_0xfced('0x25')](handleEntityNotFound(_0x2662be,null))['then'](function(_0x2b5080){if(_0x2b5080){_0x6eef65=_0x2b5080;_0x47e0c9['model']=_[_0xfced('0x34')](db[_0xfced('0x52')][_0xfced('0x2e')]);_0x47e0c9[_0xfced('0x33')]=_['keys'](_0x1a3588[_0xfced('0x33')]);_0x47e0c9[_0xfced('0x35')]=_[_0xfced('0x36')](_0x47e0c9['model'],_0x47e0c9[_0xfced('0x33')]);_0x50a1e1[_0xfced('0x37')]=_['intersection'](_0x47e0c9[_0xfced('0x32')],qs['fields'](_0x1a3588[_0xfced('0x33')][_0xfced('0x38')]));_0x50a1e1[_0xfced('0x37')]=_0x50a1e1['attributes'][_0xfced('0x39')]?_0x50a1e1[_0xfced('0x37')]:_0x47e0c9[_0xfced('0x32')];_0x50a1e1[_0xfced('0x3c')]=qs[_0xfced('0x3d')](_0x1a3588['query'][_0xfced('0x3d')]);_0x50a1e1[_0xfced('0x3e')]=qs[_0xfced('0x35')](_['pick'](_0x1a3588['query'],_0x47e0c9[_0xfced('0x35')]));if(_0x1a3588[_0xfced('0x33')][_0xfced('0x40')]){_0x50a1e1['where']=_[_0xfced('0x41')](_0x50a1e1[_0xfced('0x3e')],{'$or':_[_0xfced('0x2c')](_0x50a1e1['attributes'],function(_0x288c4b){var _0x543834={};_0x543834[_0x288c4b]={'$like':'%'+_0x1a3588[_0xfced('0x33')][_0xfced('0x40')]+'%'};return _0x543834;})});}_0x50a1e1=_[_0xfced('0x41')]({},_0x50a1e1,_0x1a3588[_0xfced('0x49')]);return _0x6eef65['getConditions'](_0x50a1e1);}})[_0xfced('0x25')](function(_0x533e9a){if(_0x533e9a){_0x36cd7c=_0x533e9a[_0xfced('0x39')];if(!_0x1a3588[_0xfced('0x33')][_0xfced('0x53')](_0xfced('0x3a'))){_0x50a1e1[_0xfced('0x3b')]=qs[_0xfced('0x3b')](_0x1a3588[_0xfced('0x33')]['limit']);_0x50a1e1[_0xfced('0x1f')]=qs[_0xfced('0x1f')](_0x1a3588[_0xfced('0x33')][_0xfced('0x1f')]);}return _0x6eef65[_0xfced('0x50')](_0x50a1e1);}})[_0xfced('0x25')](function(_0x3d2bd7){if(_0x3d2bd7){return _0x3d2bd7?{'count':_0x36cd7c,'rows':_0x3d2bd7}:null;}})[_0xfced('0x25')](respondWithResult(_0x2662be,null))[_0xfced('0x46')](handleError(_0x2662be,null));};exports[_0xfced('0x54')]=function(_0xeb273c,_0x31b2d3,_0xbb1a5e){return db['Action'][_0xfced('0x4c')]({'where':{'id':_0xeb273c[_0xfced('0x48')]['id']}})[_0xfced('0x25')](handleEntityNotFound(_0x31b2d3,null))[_0xfced('0x25')](function(_0xa0d6a0){if(_0xa0d6a0){return _0xa0d6a0[_0xfced('0x54')](_0xeb273c[_0xfced('0x4b')][_0xfced('0x4e')],_[_0xfced('0x4f')](_0xeb273c['body'],[_0xfced('0x4e'),'id'])||{});}})['then'](respondWithResult(_0x31b2d3,null))[_0xfced('0x46')](handleError(_0x31b2d3,null));};exports[_0xfced('0x55')]=function(_0x1d3ef8,_0x4085ef,_0x302bc2){var _0x181bb1={};var _0x5202e2={};var _0x52de76;var _0x4c7687;return db[_0xfced('0x2d')][_0xfced('0x51')]({'where':{'id':_0x1d3ef8[_0xfced('0x48')]['id']}})[_0xfced('0x25')](handleEntityNotFound(_0x4085ef,null))[_0xfced('0x25')](function(_0x52bc89){if(_0x52bc89){_0x52de76=_0x52bc89;_0x5202e2[_0xfced('0x32')]=_[_0xfced('0x34')](db['Action'][_0xfced('0x2e')]);_0x5202e2[_0xfced('0x33')]=_[_0xfced('0x34')](_0x1d3ef8['query']);_0x5202e2[_0xfced('0x35')]=_[_0xfced('0x36')](_0x5202e2[_0xfced('0x32')],_0x5202e2[_0xfced('0x33')]);_0x181bb1[_0xfced('0x37')]=_[_0xfced('0x36')](_0x5202e2[_0xfced('0x32')],qs[_0xfced('0x38')](_0x1d3ef8[_0xfced('0x33')][_0xfced('0x38')]));_0x181bb1['attributes']=_0x181bb1['attributes'][_0xfced('0x39')]?_0x181bb1['attributes']:_0x5202e2[_0xfced('0x32')];_0x181bb1[_0xfced('0x3c')]=qs[_0xfced('0x3d')](_0x1d3ef8[_0xfced('0x33')]['sort']);_0x181bb1[_0xfced('0x3e')]=qs[_0xfced('0x35')](_['pick'](_0x1d3ef8['query'],_0x5202e2[_0xfced('0x35')]));if(_0x1d3ef8[_0xfced('0x33')]['filter']){_0x181bb1[_0xfced('0x3e')]=_[_0xfced('0x41')](_0x181bb1['where'],{'$or':_[_0xfced('0x2c')](_0x181bb1[_0xfced('0x37')],function(_0x4d2a18){var _0x248dd9={};_0x248dd9[_0x4d2a18]={'$like':'%'+_0x1d3ef8[_0xfced('0x33')][_0xfced('0x40')]+'%'};return _0x248dd9;})});}_0x181bb1=_[_0xfced('0x41')]({},_0x181bb1,_0x1d3ef8[_0xfced('0x49')]);return _0x52de76[_0xfced('0x55')](_0x181bb1);}})['then'](function(_0x2455e9){if(_0x2455e9){_0x4c7687=_0x2455e9[_0xfced('0x39')];if(!_0x1d3ef8[_0xfced('0x33')]['hasOwnProperty'](_0xfced('0x3a'))){_0x181bb1[_0xfced('0x3b')]=qs[_0xfced('0x3b')](_0x1d3ef8[_0xfced('0x33')][_0xfced('0x3b')]);_0x181bb1['offset']=qs[_0xfced('0x1f')](_0x1d3ef8[_0xfced('0x33')][_0xfced('0x1f')]);}return _0x52de76['getActions'](_0x181bb1);}})[_0xfced('0x25')](function(_0x3e62a6){if(_0x3e62a6){return _0x3e62a6?{'count':_0x4c7687,'rows':_0x3e62a6}:null;}})['then'](respondWithResult(_0x4085ef,null))[_0xfced('0x46')](handleError(_0x4085ef,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a5694bd..03495f9 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 _0xb264=['lodash','util','api','request-promise','path','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x2244a8,_0x3be821){var _0x156bed=function(_0x297cc2){while(--_0x297cc2){_0x2244a8['push'](_0x2244a8['shift']());}};_0x156bed(++_0x3be821);}(_0xb264,0x108));var _0x4b26=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb264[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4b26('0x0'));var util=require(_0x4b26('0x1'));var logger=require('../../config/logger')(_0x4b26('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4b26('0x3'));var fs=require('fs');var path=require(_0x4b26('0x4'));var rimraf=require(_0x4b26('0x5'));var config=require(_0x4b26('0x6'));var attributes=require(_0x4b26('0x7'));module[_0x4b26('0x8')]=function(_0x1e3af6,_0x4e039d){return _0x1e3af6[_0x4b26('0x9')](_0x4b26('0xa'),attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x467e=['tools_automations','lodash','util','../../config/logger','moment','request-promise','rimraf','../../config/environment','./automation.attributes','exports','define','Automation'];(function(_0x33d416,_0xea4bfe){var _0x3b6e28=function(_0x27e267){while(--_0x27e267){_0x33d416['push'](_0x33d416['shift']());}};_0x3b6e28(++_0xea4bfe);}(_0x467e,0x121));var _0xe467=function(_0x3ffadf,_0x47c3b1){_0x3ffadf=_0x3ffadf-0x0;var _0x46223d=_0x467e[_0x3ffadf];return _0x46223d;};'use strict';var _=require(_0xe467('0x0'));var util=require(_0xe467('0x1'));var logger=require(_0xe467('0x2'))('api');var moment=require(_0xe467('0x3'));var BPromise=require('bluebird');var rp=require(_0xe467('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe467('0x5'));var config=require(_0xe467('0x6'));var attributes=require(_0xe467('0x7'));module[_0xe467('0x8')]=function(_0x4934f5,_0x531c00){return _0x4934f5[_0xe467('0x9')](_0xe467('0xa'),attributes,{'tableName':_0xe467('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index b0386e7..e0cc109 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 _0x07c9=['info','Automation,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','then'];(function(_0x69188b,_0x550923){var _0x3320f4=function(_0x27d05b){while(--_0x27d05b){_0x69188b['push'](_0x69188b['shift']());}};_0x3320f4(++_0x550923);}(_0x07c9,0x14d));var _0x907c=function(_0x5f36fa,_0x529ab2){_0x5f36fa=_0x5f36fa-0x0;var _0x3baae7=_0x07c9[_0x5f36fa];return _0x3baae7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x907c('0x0'));var BPromise=require(_0x907c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x907c('0x2'));var db=require(_0x907c('0x3'))['db'];var utils=require(_0x907c('0x4'));var logger=require(_0x907c('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x907c('0x6'));var client=jayson['client'][_0x907c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4bcc3a,_0x34efa1,_0x218c07){return new BPromise(function(_0x558f7b,_0x4478e7){return client['request'](_0x4bcc3a,_0x218c07)[_0x907c('0x8')](function(_0x17c0a7){logger[_0x907c('0x9')](_0x907c('0xa'),_0x34efa1,_0x907c('0xb'));logger[_0x907c('0xc')]('Automation,\x20%s,\x20%s,\x20%s',_0x34efa1,_0x907c('0xb'),JSON[_0x907c('0xd')](_0x17c0a7));if(_0x17c0a7[_0x907c('0xe')]){if(_0x17c0a7['error'][_0x907c('0xf')]===0x1f4){logger[_0x907c('0xe')](_0x907c('0xa'),_0x34efa1,_0x17c0a7['error']['message']);return _0x4478e7(_0x17c0a7[_0x907c('0xe')][_0x907c('0x10')]);}logger[_0x907c('0xe')]('Automation,\x20%s,\x20%s',_0x34efa1,_0x17c0a7[_0x907c('0xe')][_0x907c('0x10')]);return _0x558f7b(_0x17c0a7[_0x907c('0xe')]['message']);}else{logger[_0x907c('0x9')](_0x907c('0xa'),_0x34efa1,'request\x20sent');_0x558f7b(_0x17c0a7[_0x907c('0x11')][_0x907c('0x10')]);}})[_0x907c('0x12')](function(_0x242474){logger[_0x907c('0xe')](_0x907c('0xa'),_0x34efa1,_0x242474);_0x4478e7(_0x242474);});});} \ No newline at end of file +var _0xac1d=['catch','lodash','moment','bluebird','ioredis','../../config/utils','rpc','client','http','request','then','Automation,\x20%s,\x20%s','request\x20sent','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x5c749f,_0x4f58d3){var _0x43fecc=function(_0x3f8940){while(--_0x3f8940){_0x5c749f['push'](_0x5c749f['shift']());}};_0x43fecc(++_0x4f58d3);}(_0xac1d,0x141));var _0xdac1=function(_0xfaa620,_0x5b3c83){_0xfaa620=_0xfaa620-0x0;var _0xe15a61=_0xac1d[_0xfaa620];return _0xe15a61;};'use strict';var _=require(_0xdac1('0x0'));var util=require('util');var moment=require(_0xdac1('0x1'));var BPromise=require(_0xdac1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdac1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xdac1('0x4'));var logger=require('../../config/logger')(_0xdac1('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xdac1('0x6')][_0xdac1('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1569dc,_0x479518,_0x6be6fc){return new BPromise(function(_0x318446,_0x5966db){return client[_0xdac1('0x8')](_0x1569dc,_0x6be6fc)[_0xdac1('0x9')](function(_0x2b3f2b){logger['info'](_0xdac1('0xa'),_0x479518,_0xdac1('0xb'));logger['debug'](_0xdac1('0xc'),_0x479518,'request\x20sent',JSON[_0xdac1('0xd')](_0x2b3f2b));if(_0x2b3f2b[_0xdac1('0xe')]){if(_0x2b3f2b[_0xdac1('0xe')][_0xdac1('0xf')]===0x1f4){logger[_0xdac1('0xe')]('Automation,\x20%s,\x20%s',_0x479518,_0x2b3f2b[_0xdac1('0xe')][_0xdac1('0x10')]);return _0x5966db(_0x2b3f2b['error']['message']);}logger[_0xdac1('0xe')]('Automation,\x20%s,\x20%s',_0x479518,_0x2b3f2b[_0xdac1('0xe')]['message']);return _0x318446(_0x2b3f2b[_0xdac1('0xe')][_0xdac1('0x10')]);}else{logger[_0xdac1('0x11')](_0xdac1('0xa'),_0x479518,_0xdac1('0xb'));_0x318446(_0x2b3f2b[_0xdac1('0x12')][_0xdac1('0x10')]);}})[_0xdac1('0x13')](function(_0x1a3b09){logger[_0xdac1('0xe')](_0xdac1('0xa'),_0x479518,_0x1a3b09);_0x5966db(_0x1a3b09);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index eeb463a..480c265 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 _0x96bb=['/:id','destroy','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./automation.controller','get','isAuthenticated','index','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','put','update'];(function(_0x1530d7,_0x19c42b){var _0x5398d0=function(_0x5c760e){while(--_0x5c760e){_0x1530d7['push'](_0x1530d7['shift']());}};_0x5398d0(++_0x19c42b);}(_0x96bb,0x9c));var _0xb96b=function(_0x3349ac,_0x889beb){_0x3349ac=_0x3349ac-0x0;var _0x18d071=_0x96bb[_0x3349ac];return _0x18d071;};'use strict';var multer=require('multer');var util=require(_0xb96b('0x0'));var path=require(_0xb96b('0x1'));var timeout=require(_0xb96b('0x2'));var express=require(_0xb96b('0x3'));var router=express[_0xb96b('0x4')]();var auth=require(_0xb96b('0x5'));var interaction=require(_0xb96b('0x6'));var config=require(_0xb96b('0x7'));var controller=require(_0xb96b('0x8'));router[_0xb96b('0x9')]('/',auth[_0xb96b('0xa')](),controller[_0xb96b('0xb')]);router['get']('/:id',auth[_0xb96b('0xa')](),controller['show']);router['get'](_0xb96b('0xc'),auth[_0xb96b('0xa')](),controller[_0xb96b('0xd')]);router[_0xb96b('0x9')](_0xb96b('0xe'),auth['isAuthenticated'](),controller[_0xb96b('0xf')]);router[_0xb96b('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb96b('0x10')](_0xb96b('0xc'),auth['isAuthenticated'](),controller[_0xb96b('0x11')]);router['post'](_0xb96b('0xe'),auth['isAuthenticated'](),controller['addActions']);router[_0xb96b('0x12')]('/:id',auth[_0xb96b('0xa')](),controller[_0xb96b('0x13')]);router['delete'](_0xb96b('0x14'),auth[_0xb96b('0xa')](),controller[_0xb96b('0x15')]);module['exports']=router; \ No newline at end of file +var _0x0ade=['index','/:id','/:id/conditions','getConditions','/:id/actions','getActions','post','addConditions','addActions','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x268dce,_0xc89a2c){var _0x4bd2c6=function(_0x3e7cfd){while(--_0x3e7cfd){_0x268dce['push'](_0x268dce['shift']());}};_0x4bd2c6(++_0xc89a2c);}(_0x0ade,0x1dc));var _0xe0ad=function(_0xfa407c,_0x505d08){_0xfa407c=_0xfa407c-0x0;var _0x22a496=_0x0ade[_0xfa407c];return _0x22a496;};'use strict';var multer=require(_0xe0ad('0x0'));var util=require('util');var path=require(_0xe0ad('0x1'));var timeout=require(_0xe0ad('0x2'));var express=require('express');var router=express[_0xe0ad('0x3')]();var auth=require(_0xe0ad('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe0ad('0x5'));var controller=require('./automation.controller');router[_0xe0ad('0x6')]('/',auth[_0xe0ad('0x7')](),controller[_0xe0ad('0x8')]);router['get'](_0xe0ad('0x9'),auth['isAuthenticated'](),controller['show']);router[_0xe0ad('0x6')](_0xe0ad('0xa'),auth['isAuthenticated'](),controller[_0xe0ad('0xb')]);router[_0xe0ad('0x6')](_0xe0ad('0xc'),auth[_0xe0ad('0x7')](),controller[_0xe0ad('0xd')]);router[_0xe0ad('0xe')]('/',auth[_0xe0ad('0x7')](),controller['create']);router['post'](_0xe0ad('0xa'),auth['isAuthenticated'](),controller[_0xe0ad('0xf')]);router[_0xe0ad('0xe')](_0xe0ad('0xc'),auth['isAuthenticated'](),controller[_0xe0ad('0x10')]);router[_0xe0ad('0x11')](_0xe0ad('0x9'),auth[_0xe0ad('0x7')](),controller[_0xe0ad('0x12')]);router[_0xe0ad('0x13')]('/:id',auth['isAuthenticated'](),controller[_0xe0ad('0x14')]);module[_0xe0ad('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 0e4f59b..b2e5ec5 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 _0xa0d2=['always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','sequelize','STRING','name','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','#Busy\x20Retry\x20(min:1,\x20max:999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x85a330,_0x40509c){var _0x5145da=function(_0xff6f1a){while(--_0xff6f1a){_0x85a330['push'](_0x85a330['shift']());}};_0x5145da(++_0x40509c);}(_0xa0d2,0xbd));var _0x2a0d=function(_0x4ffde7,_0x5dfcba){_0x4ffde7=_0x4ffde7-0x0;var _0x30ff05=_0xa0d2[_0x4ffde7];return _0x30ff05;};'use strict';var Sequelize=require(_0x2a0d('0x0'));module['exports']={'name':{'type':Sequelize[_0x2a0d('0x1')],'unique':_0x2a0d('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x2a0d('0x3')](_0x2a0d('0x4')),'allowNull':![],'defaultValue':_0x2a0d('0x4')},'description':{'type':Sequelize[_0x2a0d('0x1')]},'active':{'type':Sequelize[_0x2a0d('0x5')],'defaultValue':0x0,'comment':_0x2a0d('0x6')},'limitCalls':{'type':Sequelize[_0x2a0d('0x7')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x2a0d('0x1')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x2a0d('0x7')](0x3)[_0x2a0d('0x8')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a0d('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x2a0d('0x7')](0x3)[_0x2a0d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a0d('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x2a0d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0x2a0d('0x7')](0x3)[_0x2a0d('0x8')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x2a0d('0xb')},'dialBusyRetryFrequency':{'type':Sequelize[_0x2a0d('0x7')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x2a0d('0x7')](0x3)[_0x2a0d('0x8')],'defaultValue':0x3,'comment':_0x2a0d('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x2a0d('0xd')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x2a0d('0x1')],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x2a0d('0x3')](_0x2a0d('0xe'),_0x2a0d('0xf'),_0x2a0d('0x10')),'defaultValue':_0x2a0d('0xe')},'dialAMDActive':{'type':Sequelize[_0x2a0d('0x5')],'defaultValue':0x0,'comment':_0x2a0d('0x11')},'dialAMDInitialSilence':{'type':Sequelize[_0x2a0d('0x7')](0x9)[_0x2a0d('0x8')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x2a0d('0x12')},'dialAMDGreeting':{'type':Sequelize[_0x2a0d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x2a0d('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x2a0d('0x7')](0x9)[_0x2a0d('0x8')],'defaultValue':0x320,'validate':{'min':0x0},'comment':'#AMD\x20After\x20Greeting\x20Silence'},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x2a0d('0x7')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a0d('0x14')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x2a0d('0x8')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x2a0d('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x2a0d('0x7')](0x9)[_0x2a0d('0x8')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x2a0d('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x2a0d('0x7')](0x9)[_0x2a0d('0x8')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x2a0d('0x17')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x2a0d('0x7')](0x5)[_0x2a0d('0x8')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x2a0d('0x18')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x2a0d('0x7')](0x9)[_0x2a0d('0x8')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x2a0d('0x19')},'dialOrderByScheduledAt':{'type':Sequelize[_0x2a0d('0x3')](_0x2a0d('0x1a'),_0x2a0d('0x1b')),'defaultValue':_0x2a0d('0x1a')},'dialPrefix':{'type':Sequelize[_0x2a0d('0x1')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x2a0d('0x7')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x2a0d('0x1c')},'dialCutDigit':{'type':Sequelize[_0x2a0d('0x7')](0x3)[_0x2a0d('0x8')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file +var _0x9ad8=['#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','ENUM','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','UNSIGNED','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x42179c,_0x3c8d7c){var _0x4cf536=function(_0x4dc0e3){while(--_0x4dc0e3){_0x42179c['push'](_0x42179c['shift']());}};_0x4cf536(++_0x3c8d7c);}(_0x9ad8,0xf0));var _0x89ad=function(_0x5edbac,_0xa54f78){_0x5edbac=_0x5edbac-0x0;var _0x2a5b78=_0x9ad8[_0x5edbac];return _0x2a5b78;};'use strict';var Sequelize=require(_0x89ad('0x0'));module[_0x89ad('0x1')]={'name':{'type':Sequelize[_0x89ad('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0x89ad('0x3')),'allowNull':![],'defaultValue':_0x89ad('0x3')},'description':{'type':Sequelize[_0x89ad('0x2')]},'active':{'type':Sequelize[_0x89ad('0x4')],'defaultValue':0x0,'comment':_0x89ad('0x5')},'limitCalls':{'type':Sequelize[_0x89ad('0x6')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0x89ad('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x89ad('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x89ad('0x6')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x89ad('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x89ad('0x7')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x89ad('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x89ad('0x8')},'dialBusyMaxRetry':{'type':Sequelize[_0x89ad('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x89ad('0x9')},'dialBusyRetryFrequency':{'type':Sequelize[_0x89ad('0x6')](0x5)[_0x89ad('0xa')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x89ad('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x89ad('0x6')](0x3)[_0x89ad('0xa')],'defaultValue':0x3,'comment':_0x89ad('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x89ad('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x89ad('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0x89ad('0x6')](0x3)[_0x89ad('0xa')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x89ad('0xe')},'dialTimezone':{'type':Sequelize[_0x89ad('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0x89ad('0xf')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x89ad('0x10'),_0x89ad('0x11'),_0x89ad('0x12')),'defaultValue':_0x89ad('0x10')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x89ad('0xa')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)[_0x89ad('0xa')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x89ad('0x13')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x89ad('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x89ad('0x14')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x89ad('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x89ad('0x6')](0x9)[_0x89ad('0xa')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x89ad('0x15')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x89ad('0x6')](0x9)[_0x89ad('0xa')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x89ad('0x16')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x89ad('0x6')](0x9)[_0x89ad('0xa')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x89ad('0xa')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x89ad('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x89ad('0x6')](0x9)[_0x89ad('0xa')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0x89ad('0x18')]('DESC',_0x89ad('0x19')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)[_0x89ad('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x89ad('0x1a')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x89ad('0xa')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x89ad('0x1b')}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 578dd83..2ff1ae8 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 _0x4177=['crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','get','IvrCampaigns','UserProfileResource','destroy','error','stack','name','send','index','map','Campaign','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','limit','sort','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','clone','rawAttributes','omit','createdAt','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','CmHopper','hasOwnProperty','order','CampaignId','filter','findOne','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','CmList','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','field','NOW()','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','CampaignId\x20=\x20?','onlyIfOpen','into','ListId\x20=\x20?','COALESCE(phone,\x27\x27)','push','sequelize','removeLists','addBlackLists','cm_hopper_black','all','removeBlackLists','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel'];(function(_0x50dde1,_0x1e50ad){var _0xa14984=function(_0x3b472d){while(--_0x3b472d){_0x50dde1['push'](_0x50dde1['shift']());}};_0xa14984(++_0x1e50ad);}(_0x4177,0x78));var _0x7417=function(_0x24d135,_0x795332){_0x24d135=_0x24d135-0x0;var _0x567486=_0x4177[_0x24d135];return _0x567486;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7417('0x0'));var rimraf=require(_0x7417('0x1'));var zipdir=require(_0x7417('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7417('0x3'));var moment=require(_0x7417('0x4'));var BPromise=require(_0x7417('0x5'));var Mustache=require(_0x7417('0x6'));var util=require(_0x7417('0x7'));var path=require('path');var sox=require(_0x7417('0x8'));var csv=require(_0x7417('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7417('0xa'));var squel=require(_0x7417('0xb'));var crypto=require(_0x7417('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7417('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7417('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7417('0xf'));var qs=require(_0x7417('0x10'));var as=require(_0x7417('0x11'));var hardwareService=require(_0x7417('0x12'));var logger=require('../../config/logger')(_0x7417('0x13'));var utils=require('../../config/utils');var config=require(_0x7417('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x158dc6,_0x3f10e7){_0x3f10e7=_0x3f10e7||0xcc;return function(_0x94a865){if(_0x94a865){return _0x158dc6[_0x7417('0x15')](_0x3f10e7);}return _0x158dc6[_0x7417('0x16')](_0x3f10e7)[_0x7417('0x17')]();};}function respondWithResult(_0x333c84,_0x3b2bab){_0x3b2bab=_0x3b2bab||0xc8;return function(_0x2ae732){if(_0x2ae732){return _0x333c84['status'](_0x3b2bab)['json'](_0x2ae732);}};}function respondWithFilteredResult(_0x490340,_0xcbdcfe){return function(_0x5cbac3){if(_0x5cbac3){var _0x5d9303=_0x5cbac3[_0x7417('0x18')],_0x3133b4=_0xcbdcfe['offset'],_0x46b78a=_0xcbdcfe[_0x7417('0x19')]+_0xcbdcfe['limit'],_0x2a5e31;if(_0x46b78a>=_0x5d9303){_0x46b78a=_0x5d9303;_0x2a5e31=0xc8;}else{_0x2a5e31=0xce;}_0x490340['status'](_0x2a5e31);return _0x490340[_0x7417('0x1a')](_0x7417('0x1b'),_0x3133b4+'-'+_0x46b78a+'/'+_0x5d9303)[_0x7417('0x1c')](_0x5cbac3);}return null;};}function patchUpdates(_0x3c11d5){return function(_0x4c0fa4){try{jsonpatch['apply'](_0x4c0fa4,_0x3c11d5,!![]);}catch(_0x2d9572){return BPromise[_0x7417('0x1d')](_0x2d9572);}return _0x4c0fa4['save']();};}function saveUpdates(_0x3437c4,_0x4b20bd){return function(_0x147795){if(_0x147795){return _0x147795[_0x7417('0x1e')](_0x3437c4)[_0x7417('0x1f')](function(_0x2828cc){return _0x2828cc;});}return null;};}function removeEntity(_0x581801,_0x39bbba){return function(_0x277f46){if(_0x277f46){return _0x277f46['destroy']()[_0x7417('0x1f')](function(){var _0x1e7163=_0x277f46[_0x7417('0x20')]({'plain':!![]});var _0x3b45c5=_0x7417('0x21');return db[_0x7417('0x22')][_0x7417('0x23')]({'where':{'type':_0x3b45c5,'resourceId':_0x1e7163['id']}})[_0x7417('0x1f')](function(){return _0x277f46;});})[_0x7417('0x1f')](function(){_0x581801[_0x7417('0x16')](0xcc)[_0x7417('0x17')]();});}};}function handleEntityNotFound(_0x47e6d1,_0x20ce9c){return function(_0x45d516){if(!_0x45d516){_0x47e6d1[_0x7417('0x15')](0x194);}return _0x45d516;};}function handleError(_0x19eeae,_0x4a7310){_0x4a7310=_0x4a7310||0x1f4;return function(_0x4dd4b1){logger[_0x7417('0x24')](_0x4dd4b1[_0x7417('0x25')]);if(_0x4dd4b1[_0x7417('0x26')]){delete _0x4dd4b1[_0x7417('0x26')];}_0x19eeae[_0x7417('0x16')](_0x4a7310)[_0x7417('0x27')](_0x4dd4b1);};}exports[_0x7417('0x28')]=function(_0x1ebe4f,_0x27e837){var _0x14ca07={},_0x282bc3={},_0x2a442d={'count':0x0,'rows':[]};var _0x544ff6=_[_0x7417('0x29')](db[_0x7417('0x2a')]['rawAttributes'],function(_0x5df56d){return{'name':_0x5df56d[_0x7417('0x2b')],'type':_0x5df56d[_0x7417('0x2c')]['key']};});_0x282bc3['model']=_['map'](_0x544ff6,_0x7417('0x26'));_0x282bc3[_0x7417('0x2d')]=_['keys'](_0x1ebe4f['query']);_0x282bc3[_0x7417('0x2e')]=_[_0x7417('0x2f')](_0x282bc3[_0x7417('0x30')],_0x282bc3[_0x7417('0x2d')]);_0x14ca07[_0x7417('0x31')]=_[_0x7417('0x2f')](_0x282bc3[_0x7417('0x30')],qs[_0x7417('0x32')](_0x1ebe4f[_0x7417('0x2d')]['fields']));_0x14ca07[_0x7417('0x31')]=_0x14ca07[_0x7417('0x31')][_0x7417('0x33')]?_0x14ca07[_0x7417('0x31')]:_0x282bc3[_0x7417('0x30')];if(!_0x1ebe4f[_0x7417('0x2d')]['hasOwnProperty'](_0x7417('0x34'))){_0x14ca07[_0x7417('0x35')]=qs['limit'](_0x1ebe4f[_0x7417('0x2d')][_0x7417('0x35')]);_0x14ca07[_0x7417('0x19')]=qs[_0x7417('0x19')](_0x1ebe4f[_0x7417('0x2d')][_0x7417('0x19')]);}_0x14ca07['order']=qs['sort'](_0x1ebe4f[_0x7417('0x2d')][_0x7417('0x36')]);_0x14ca07['where']=qs[_0x7417('0x2e')](_[_0x7417('0x37')](_0x1ebe4f[_0x7417('0x2d')],_0x282bc3[_0x7417('0x2e')]));if(_0x1ebe4f[_0x7417('0x2d')]['filter']){_0x14ca07[_0x7417('0x38')]=_[_0x7417('0x39')](_0x14ca07[_0x7417('0x38')],{'$or':_[_0x7417('0x29')](_0x544ff6,function(_0x5b1848){if(_0x5b1848[_0x7417('0x2c')]!==_0x7417('0x3a')){var _0x44beef={};_0x44beef[_0x5b1848[_0x7417('0x26')]]={'$like':'%'+_0x1ebe4f[_0x7417('0x2d')]['filter']+'%'};return _0x44beef;}})});}_0x14ca07=_['merge']({},_0x14ca07,_0x1ebe4f[_0x7417('0x3b')]);var _0x1babc1={'where':_0x14ca07[_0x7417('0x38')]};return db[_0x7417('0x2a')][_0x7417('0x18')](_0x1babc1)[_0x7417('0x1f')](function(_0x37acf8){_0x2a442d['count']=_0x37acf8;if(_0x1ebe4f[_0x7417('0x2d')][_0x7417('0x3c')]){_0x14ca07[_0x7417('0x3d')]=[{'all':!![]}];}return db[_0x7417('0x2a')][_0x7417('0x3e')](_0x14ca07);})[_0x7417('0x1f')](function(_0x3f4dac){_0x2a442d[_0x7417('0x3f')]=_0x3f4dac;return _0x2a442d;})[_0x7417('0x1f')](respondWithFilteredResult(_0x27e837,_0x14ca07))[_0x7417('0x40')](handleError(_0x27e837,null));};exports[_0x7417('0x41')]=function(_0xa3773,_0x12250b){var _0x51ddf2={'raw':![],'where':{'id':_0xa3773[_0x7417('0x42')]['id']}},_0x4abd25={};_0x4abd25['model']=_[_0x7417('0x43')](db[_0x7417('0x2a')]['rawAttributes']);_0x4abd25[_0x7417('0x2d')]=_['keys'](_0xa3773['query']);_0x4abd25['filters']=_[_0x7417('0x2f')](_0x4abd25[_0x7417('0x30')],_0x4abd25['query']);_0x51ddf2[_0x7417('0x31')]=_[_0x7417('0x2f')](_0x4abd25[_0x7417('0x30')],qs[_0x7417('0x32')](_0xa3773[_0x7417('0x2d')][_0x7417('0x32')]));_0x51ddf2[_0x7417('0x31')]=_0x51ddf2[_0x7417('0x31')]['length']?_0x51ddf2[_0x7417('0x31')]:_0x4abd25['model'];if(_0xa3773[_0x7417('0x2d')][_0x7417('0x3c')]){_0x51ddf2[_0x7417('0x3d')]=[{'all':!![]}];}_0x51ddf2=_['merge']({},_0x51ddf2,_0xa3773['options']);return db[_0x7417('0x2a')][_0x7417('0x44')](_0x51ddf2)[_0x7417('0x1f')](handleEntityNotFound(_0x12250b,null))['then'](respondWithResult(_0x12250b,null))['catch'](handleError(_0x12250b,null));};exports['create']=function(_0xbcafd1,_0x3fee33){return db[_0x7417('0x2a')][_0x7417('0x45')](_0xbcafd1[_0x7417('0x46')],{})[_0x7417('0x1f')](function(_0x50b26a){var _0x2ccf63=_0xbcafd1[_0x7417('0x47')][_0x7417('0x20')]({'plain':!![]});if(!_0x2ccf63)throw new Error(_0x7417('0x48'));if(_0x2ccf63[_0x7417('0x49')]===_0x7417('0x47')){var _0x463d95=_0x50b26a[_0x7417('0x20')]({'plain':!![]});var _0x48dea4=_0x7417('0x21');return db[_0x7417('0x4a')]['find']({'where':{'name':_0x48dea4,'userProfileId':_0x2ccf63[_0x7417('0x4b')]},'raw':!![]})[_0x7417('0x1f')](function(_0x5d2db7){if(_0x5d2db7&&_0x5d2db7[_0x7417('0x4c')]===0x0){return db[_0x7417('0x22')][_0x7417('0x45')]({'name':_0x463d95[_0x7417('0x26')],'resourceId':_0x463d95['id'],'type':_0x5d2db7[_0x7417('0x26')],'sectionId':_0x5d2db7['id']},{})[_0x7417('0x1f')](function(){return _0x50b26a;});}else{return _0x50b26a;}})[_0x7417('0x40')](function(_0x3c6961){logger[_0x7417('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3c6961);throw _0x3c6961;});}return _0x50b26a;})[_0x7417('0x1f')](respondWithResult(_0x3fee33,0xc9))['catch'](handleError(_0x3fee33,null));};exports[_0x7417('0x4d')]=function(_0x4aa72c,_0x55bfdf){var _0x55d06f={'where':{'id':_0x4aa72c[_0x7417('0x42')]['id']}},_0x4ee45f={};_0x4ee45f['model']=_['keys'](db[_0x7417('0x2a')][_0x7417('0x4e')]);_0x55d06f[_0x7417('0x31')]=_[_0x7417('0x2f')](_0x4ee45f['model'],qs['fields'](_0x4aa72c['query'][_0x7417('0x32')]));_0x55d06f[_0x7417('0x31')]=_0x55d06f[_0x7417('0x31')][_0x7417('0x33')]?_0x55d06f['attributes']:_0x4ee45f[_0x7417('0x30')];if(_0x4aa72c[_0x7417('0x2d')]['includeAll']){_0x55d06f['include']=[{'all':!![]}];}_0x55d06f=_[_0x7417('0x39')]({},_0x55d06f,_0x4aa72c[_0x7417('0x3b')]);return db[_0x7417('0x2a')]['find'](_0x55d06f)['then'](handleEntityNotFound(_0x55bfdf,null))[_0x7417('0x1f')](function(_0x578d74){if(_0x578d74){var _0x262f43=_0x578d74[_0x7417('0x20')]({'plain':!![]});_0x262f43=qs[_0x7417('0x4f')](_0x262f43,['id',_0x7417('0x50'),_0x7417('0x51')]);_0x4aa72c[_0x7417('0x46')]=_[_0x7417('0x4f')](_0x4aa72c[_0x7417('0x46')],['id',_0x7417('0x50'),_0x7417('0x51')]);return db[_0x7417('0x2a')][_0x7417('0x45')](_[_0x7417('0x39')](_0x262f43,_0x4aa72c[_0x7417('0x46')]),{'include':_0x4aa72c[_0x7417('0x2d')][_0x7417('0x3c')]?[{'all':!![]}]:undefined})['then'](function(_0x2b1a35){var _0x2eed26=_0x4aa72c[_0x7417('0x47')][_0x7417('0x20')]({'plain':!![]});if(!_0x2eed26)throw new Error(_0x7417('0x48'));if(_0x2eed26['role']===_0x7417('0x47')){var _0x28310a=_0x2b1a35['get']({'plain':!![]});var _0x1ba474=_0x7417('0x21');return db[_0x7417('0x4a')][_0x7417('0x44')]({'where':{'name':_0x1ba474,'userProfileId':_0x2eed26[_0x7417('0x4b')]},'raw':!![]})[_0x7417('0x1f')](function(_0x536f82){if(_0x536f82&&_0x536f82['autoAssociation']===0x0){return db[_0x7417('0x22')][_0x7417('0x45')]({'name':_0x28310a[_0x7417('0x26')],'resourceId':_0x28310a['id'],'type':_0x536f82['name'],'sectionId':_0x536f82['id']},{})[_0x7417('0x1f')](function(){return _0x2b1a35;});}else{return _0x2b1a35;}})[_0x7417('0x40')](function(_0x4f422e){logger[_0x7417('0x24')](_0x7417('0x52'),_0x4f422e);throw _0x4f422e;});}return _0x2b1a35;});}})[_0x7417('0x1f')](respondWithResult(_0x55bfdf,0xc9))[_0x7417('0x40')](handleError(_0x55bfdf,null));};exports[_0x7417('0x1e')]=function(_0x416f6f,_0x1bd66f){if(_0x416f6f['body']['id']){delete _0x416f6f['body']['id'];}return db[_0x7417('0x2a')][_0x7417('0x44')]({'where':{'id':_0x416f6f[_0x7417('0x42')]['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0x1bd66f,null))[_0x7417('0x1f')](saveUpdates(_0x416f6f[_0x7417('0x46')],null))['then'](respondWithResult(_0x1bd66f,null))[_0x7417('0x40')](handleError(_0x1bd66f,null));};exports[_0x7417('0x23')]=function(_0x43cd0c,_0x34c866){return db[_0x7417('0x2a')][_0x7417('0x44')]({'where':{'id':_0x43cd0c[_0x7417('0x42')]['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0x34c866,null))[_0x7417('0x1f')](removeEntity(_0x34c866,null))[_0x7417('0x40')](handleError(_0x34c866,null));};exports[_0x7417('0x53')]=function(_0x2f8e85,_0x59c4d7,_0x393c1e){var _0x5d7bcb={'raw':!![],'where':{}};var _0xef70bb={};var _0x47b963={'count':0x0,'rows':[]};return db[_0x7417('0x2a')]['findOne']({'where':{'id':_0x2f8e85[_0x7417('0x42')]['id']}})['then'](handleEntityNotFound(_0x59c4d7,null))[_0x7417('0x1f')](function(_0x6215c1){if(_0x6215c1){_0xef70bb[_0x7417('0x30')]=_[_0x7417('0x43')](db[_0x7417('0x54')][_0x7417('0x4e')]);_0xef70bb['query']=_[_0x7417('0x43')](_0x2f8e85[_0x7417('0x2d')]);_0xef70bb[_0x7417('0x2e')]=_[_0x7417('0x2f')](_0xef70bb[_0x7417('0x30')],_0xef70bb[_0x7417('0x2d')]);_0x5d7bcb['attributes']=_[_0x7417('0x2f')](_0xef70bb[_0x7417('0x30')],qs[_0x7417('0x32')](_0x2f8e85[_0x7417('0x2d')][_0x7417('0x32')]));_0x5d7bcb['attributes']=_0x5d7bcb[_0x7417('0x31')][_0x7417('0x33')]?_0x5d7bcb['attributes']:_0xef70bb[_0x7417('0x30')];if(!_0x2f8e85[_0x7417('0x2d')][_0x7417('0x55')](_0x7417('0x34'))){_0x5d7bcb[_0x7417('0x35')]=qs[_0x7417('0x35')](_0x2f8e85[_0x7417('0x2d')][_0x7417('0x35')]);_0x5d7bcb[_0x7417('0x19')]=qs['offset'](_0x2f8e85['query'][_0x7417('0x19')]);}_0x5d7bcb[_0x7417('0x56')]=qs[_0x7417('0x36')](_0x2f8e85['query'][_0x7417('0x36')]);_0x5d7bcb[_0x7417('0x38')]=qs['filters'](_['pick'](_0x2f8e85[_0x7417('0x2d')],_0xef70bb[_0x7417('0x2e')]));_0x5d7bcb['where'][_0x7417('0x57')]=_0x6215c1['id'];if(_0x2f8e85['query'][_0x7417('0x58')]){_0x5d7bcb[_0x7417('0x38')]=_['merge'](_0x5d7bcb[_0x7417('0x38')],{'$or':_['map'](_0x5d7bcb[_0x7417('0x31')],function(_0xe104cd){var _0x2e7f2c={};_0x2e7f2c[_0xe104cd]={'$like':'%'+_0x2f8e85[_0x7417('0x2d')][_0x7417('0x58')]+'%'};return _0x2e7f2c;})});}_0x5d7bcb=_['merge']({},_0x5d7bcb,_0x2f8e85[_0x7417('0x3b')]);return db[_0x7417('0x54')][_0x7417('0x18')]({'where':_0x5d7bcb[_0x7417('0x38')]})[_0x7417('0x1f')](function(_0xecd2f7){_0x47b963[_0x7417('0x18')]=_0xecd2f7;if(_0x2f8e85[_0x7417('0x2d')][_0x7417('0x3c')]){_0x5d7bcb['include']=[{'all':!![]}];}return db[_0x7417('0x54')][_0x7417('0x3e')](_0x5d7bcb);})[_0x7417('0x1f')](function(_0x2bf4c4){_0x47b963[_0x7417('0x3f')]=_0x2bf4c4;return _0x47b963;});}})[_0x7417('0x1f')](respondWithFilteredResult(_0x59c4d7,_0x5d7bcb))[_0x7417('0x40')](handleError(_0x59c4d7,null));};exports['getHopperHistories']=function(_0x1d2a01,_0x3d5fda,_0x5598aa){var _0xf94a1b={'raw':!![],'where':{}};var _0x49ec23={};var _0x1be3b4={'count':0x0,'rows':[]};return db[_0x7417('0x2a')][_0x7417('0x59')]({'where':{'id':_0x1d2a01[_0x7417('0x42')]['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0x3d5fda,null))[_0x7417('0x1f')](function(_0x3337a4){if(_0x3337a4){_0x49ec23['model']=_[_0x7417('0x43')](db[_0x7417('0x5a')]['rawAttributes']);_0x49ec23[_0x7417('0x2d')]=_[_0x7417('0x43')](_0x1d2a01[_0x7417('0x2d')]);_0x49ec23[_0x7417('0x2e')]=_[_0x7417('0x2f')](_0x49ec23[_0x7417('0x30')],_0x49ec23[_0x7417('0x2d')]);_0xf94a1b[_0x7417('0x31')]=_[_0x7417('0x2f')](_0x49ec23['model'],qs[_0x7417('0x32')](_0x1d2a01[_0x7417('0x2d')][_0x7417('0x32')]));_0xf94a1b['attributes']=_0xf94a1b['attributes'][_0x7417('0x33')]?_0xf94a1b[_0x7417('0x31')]:_0x49ec23['model'];if(!_0x1d2a01['query']['hasOwnProperty']('nolimit')){_0xf94a1b['limit']=qs[_0x7417('0x35')](_0x1d2a01[_0x7417('0x2d')][_0x7417('0x35')]);_0xf94a1b['offset']=qs[_0x7417('0x19')](_0x1d2a01[_0x7417('0x2d')][_0x7417('0x19')]);}_0xf94a1b[_0x7417('0x56')]=qs[_0x7417('0x36')](_0x1d2a01[_0x7417('0x2d')]['sort']);_0xf94a1b[_0x7417('0x38')]=qs[_0x7417('0x2e')](_[_0x7417('0x37')](_0x1d2a01['query'],_0x49ec23['filters']));_0xf94a1b[_0x7417('0x38')][_0x7417('0x57')]=_0x3337a4['id'];if(_0x1d2a01[_0x7417('0x2d')][_0x7417('0x58')]){_0xf94a1b[_0x7417('0x38')]=_[_0x7417('0x39')](_0xf94a1b['where'],{'$or':_[_0x7417('0x29')](_0xf94a1b['attributes'],function(_0x2ddddd){var _0x14334c={};_0x14334c[_0x2ddddd]={'$like':'%'+_0x1d2a01[_0x7417('0x2d')][_0x7417('0x58')]+'%'};return _0x14334c;})});}_0xf94a1b=_[_0x7417('0x39')]({},_0xf94a1b,_0x1d2a01['options']);return db[_0x7417('0x5a')][_0x7417('0x18')]({'where':_0xf94a1b[_0x7417('0x38')]})[_0x7417('0x1f')](function(_0xa7c42d){_0x1be3b4[_0x7417('0x18')]=_0xa7c42d;if(_0x1d2a01[_0x7417('0x2d')][_0x7417('0x3c')]){_0xf94a1b[_0x7417('0x3d')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x7417('0x3e')](_0xf94a1b);})[_0x7417('0x1f')](function(_0x13999a){_0x1be3b4['rows']=_0x13999a;return _0x1be3b4;});}})[_0x7417('0x1f')](respondWithFilteredResult(_0x3d5fda,_0xf94a1b))['catch'](handleError(_0x3d5fda,null));};exports[_0x7417('0x5b')]=function(_0x24ba7f,_0x193999,_0x35c708){var _0xbe5bc1={'raw':!![],'where':{}};var _0x12f6db={};var _0x5610d6={'count':0x0,'rows':[]};return db[_0x7417('0x2a')][_0x7417('0x59')]({'where':{'id':_0x24ba7f[_0x7417('0x42')]['id']}})['then'](handleEntityNotFound(_0x193999,null))[_0x7417('0x1f')](function(_0x40bf44){if(_0x40bf44){_0x12f6db['model']=_[_0x7417('0x43')](db[_0x7417('0x5c')][_0x7417('0x4e')]);_0x12f6db[_0x7417('0x2d')]=_[_0x7417('0x43')](_0x24ba7f['query']);_0x12f6db['filters']=_['intersection'](_0x12f6db[_0x7417('0x30')],_0x12f6db[_0x7417('0x2d')]);_0xbe5bc1['attributes']=_[_0x7417('0x2f')](_0x12f6db[_0x7417('0x30')],qs[_0x7417('0x32')](_0x24ba7f[_0x7417('0x2d')][_0x7417('0x32')]));_0xbe5bc1[_0x7417('0x31')]=_0xbe5bc1['attributes'][_0x7417('0x33')]?_0xbe5bc1[_0x7417('0x31')]:_0x12f6db[_0x7417('0x30')];if(!_0x24ba7f[_0x7417('0x2d')]['hasOwnProperty'](_0x7417('0x34'))){_0xbe5bc1[_0x7417('0x35')]=qs[_0x7417('0x35')](_0x24ba7f[_0x7417('0x2d')]['limit']);_0xbe5bc1[_0x7417('0x19')]=qs['offset'](_0x24ba7f[_0x7417('0x2d')][_0x7417('0x19')]);}_0xbe5bc1[_0x7417('0x56')]=qs[_0x7417('0x36')](_0x24ba7f[_0x7417('0x2d')][_0x7417('0x36')]);_0xbe5bc1[_0x7417('0x38')]=qs[_0x7417('0x2e')](_['pick'](_0x24ba7f[_0x7417('0x2d')],_0x12f6db[_0x7417('0x2e')]));_0xbe5bc1['where'][_0x7417('0x57')]=_0x40bf44['id'];if(_0x24ba7f[_0x7417('0x2d')][_0x7417('0x58')]){_0xbe5bc1[_0x7417('0x38')]=_[_0x7417('0x39')](_0xbe5bc1[_0x7417('0x38')],{'$or':_[_0x7417('0x29')](_0xbe5bc1[_0x7417('0x31')],function(_0x473965){var _0x34afb6={};_0x34afb6[_0x473965]={'$like':'%'+_0x24ba7f['query'][_0x7417('0x58')]+'%'};return _0x34afb6;})});}_0xbe5bc1=_[_0x7417('0x39')]({},_0xbe5bc1,_0x24ba7f[_0x7417('0x3b')]);return db['CmHopperFinal'][_0x7417('0x18')]({'where':_0xbe5bc1[_0x7417('0x38')]})[_0x7417('0x1f')](function(_0x262008){_0x5610d6['count']=_0x262008;if(_0x24ba7f[_0x7417('0x2d')][_0x7417('0x3c')]){_0xbe5bc1[_0x7417('0x3d')]=[{'all':!![]}];}return db[_0x7417('0x5c')][_0x7417('0x3e')](_0xbe5bc1);})[_0x7417('0x1f')](function(_0x40b8c6){_0x5610d6[_0x7417('0x3f')]=_0x40b8c6;return _0x5610d6;});}})[_0x7417('0x1f')](respondWithFilteredResult(_0x193999,_0xbe5bc1))['catch'](handleError(_0x193999,null));};exports[_0x7417('0x5d')]=function(_0x2c4d74,_0xe89243,_0x2745a3){var _0x13b5c3={'raw':!![],'where':{}};var _0x4ccf09={};var _0x2a5c96={'count':0x0,'rows':[]};return db[_0x7417('0x2a')][_0x7417('0x59')]({'where':{'id':_0x2c4d74[_0x7417('0x42')]['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0xe89243,null))[_0x7417('0x1f')](function(_0x41ad50){if(_0x41ad50){_0x4ccf09[_0x7417('0x30')]=_[_0x7417('0x43')](db[_0x7417('0x5e')][_0x7417('0x4e')]);_0x4ccf09[_0x7417('0x2d')]=_[_0x7417('0x43')](_0x2c4d74[_0x7417('0x2d')]);_0x4ccf09[_0x7417('0x2e')]=_[_0x7417('0x2f')](_0x4ccf09['model'],_0x4ccf09[_0x7417('0x2d')]);_0x13b5c3[_0x7417('0x31')]=_['intersection'](_0x4ccf09[_0x7417('0x30')],qs[_0x7417('0x32')](_0x2c4d74[_0x7417('0x2d')][_0x7417('0x32')]));_0x13b5c3[_0x7417('0x31')]=_0x13b5c3[_0x7417('0x31')][_0x7417('0x33')]?_0x13b5c3[_0x7417('0x31')]:_0x4ccf09['model'];if(!_0x2c4d74[_0x7417('0x2d')][_0x7417('0x55')](_0x7417('0x34'))){_0x13b5c3[_0x7417('0x35')]=qs[_0x7417('0x35')](_0x2c4d74[_0x7417('0x2d')][_0x7417('0x35')]);_0x13b5c3[_0x7417('0x19')]=qs[_0x7417('0x19')](_0x2c4d74['query'][_0x7417('0x19')]);}_0x13b5c3['order']=qs[_0x7417('0x36')](_0x2c4d74[_0x7417('0x2d')]['sort']);_0x13b5c3[_0x7417('0x38')]=qs[_0x7417('0x2e')](_['pick'](_0x2c4d74[_0x7417('0x2d')],_0x4ccf09[_0x7417('0x2e')]));_0x13b5c3['where'][_0x7417('0x57')]=_0x41ad50['id'];if(_0x2c4d74['query'][_0x7417('0x58')]){_0x13b5c3[_0x7417('0x38')]=_[_0x7417('0x39')](_0x13b5c3[_0x7417('0x38')],{'$or':_[_0x7417('0x29')](_0x13b5c3[_0x7417('0x31')],function(_0x158cfa){var _0x240667={};_0x240667[_0x158cfa]={'$like':'%'+_0x2c4d74['query'][_0x7417('0x58')]+'%'};return _0x240667;})});}_0x13b5c3=_[_0x7417('0x39')]({},_0x13b5c3,_0x2c4d74[_0x7417('0x3b')]);return db[_0x7417('0x5e')][_0x7417('0x18')]({'where':_0x13b5c3[_0x7417('0x38')]})[_0x7417('0x1f')](function(_0x1875d5){_0x2a5c96[_0x7417('0x18')]=_0x1875d5;if(_0x2c4d74[_0x7417('0x2d')][_0x7417('0x3c')]){_0x13b5c3[_0x7417('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack'][_0x7417('0x3e')](_0x13b5c3);})['then'](function(_0x5872f9){_0x2a5c96[_0x7417('0x3f')]=_0x5872f9;return _0x2a5c96;});}})[_0x7417('0x1f')](respondWithFilteredResult(_0xe89243,_0x13b5c3))['catch'](handleError(_0xe89243,null));};exports['getLists']=function(_0x1daf28,_0x31a6f0,_0x44a7be){var _0x55be3a={};var _0x3bbbb2={};var _0x354874;var _0x1951e3;return db[_0x7417('0x2a')][_0x7417('0x59')]({'where':{'id':_0x1daf28[_0x7417('0x42')]['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0x31a6f0,null))[_0x7417('0x1f')](function(_0x314c20){if(_0x314c20){_0x354874=_0x314c20;_0x3bbbb2['model']=_[_0x7417('0x43')](db[_0x7417('0x5f')][_0x7417('0x4e')]);_0x3bbbb2[_0x7417('0x2d')]=_['keys'](_0x1daf28['query']);_0x3bbbb2[_0x7417('0x2e')]=_[_0x7417('0x2f')](_0x3bbbb2[_0x7417('0x30')],_0x3bbbb2['query']);_0x55be3a['attributes']=_[_0x7417('0x2f')](_0x3bbbb2[_0x7417('0x30')],qs[_0x7417('0x32')](_0x1daf28['query'][_0x7417('0x32')]));_0x55be3a['attributes']=_0x55be3a[_0x7417('0x31')]['length']?_0x55be3a[_0x7417('0x31')]:_0x3bbbb2['model'];_0x55be3a[_0x7417('0x56')]=qs[_0x7417('0x36')](_0x1daf28[_0x7417('0x2d')]['sort']);_0x55be3a[_0x7417('0x38')]=qs[_0x7417('0x2e')](_[_0x7417('0x37')](_0x1daf28[_0x7417('0x2d')],_0x3bbbb2['filters']));if(_0x1daf28['query']['filter']){_0x55be3a['where']=_['merge'](_0x55be3a[_0x7417('0x38')],{'$or':_[_0x7417('0x29')](_0x55be3a[_0x7417('0x31')],function(_0x1543ce){var _0x5630d8={};_0x5630d8[_0x1543ce]={'$like':'%'+_0x1daf28['query']['filter']+'%'};return _0x5630d8;})});}_0x55be3a=_[_0x7417('0x39')]({},_0x55be3a,_0x1daf28[_0x7417('0x3b')]);return _0x354874[_0x7417('0x60')](_0x55be3a);}})[_0x7417('0x1f')](function(_0x1d2a5a){if(_0x1d2a5a){_0x1951e3=_0x1d2a5a[_0x7417('0x33')];if(!_0x1daf28['query'][_0x7417('0x55')]('nolimit')){_0x55be3a['limit']=qs[_0x7417('0x35')](_0x1daf28['query'][_0x7417('0x35')]);_0x55be3a[_0x7417('0x19')]=qs['offset'](_0x1daf28[_0x7417('0x2d')][_0x7417('0x19')]);}return _0x354874[_0x7417('0x60')](_0x55be3a);}})['then'](function(_0x10e20f){if(_0x10e20f){return _0x10e20f?{'count':_0x1951e3,'rows':_0x10e20f}:null;}})[_0x7417('0x1f')](respondWithResult(_0x31a6f0,null))['catch'](handleError(_0x31a6f0,null));};exports['addLists']=function(_0x420c2f,_0x5c4142,_0x24e18c){var _0x53f7ce,_0x5d858f;return db[_0x7417('0x2a')]['find']({'where':{'id':_0x420c2f[_0x7417('0x42')]['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0x5c4142,null))[_0x7417('0x1f')](function(_0x4db2ce){if(_0x4db2ce){_0x5d858f=_0x4db2ce;return _0x4db2ce[_0x7417('0x61')](_0x420c2f[_0x7417('0x46')][_0x7417('0x62')],_['omit'](_0x420c2f[_0x7417('0x46')],['ids','id'])||{});}return null;})[_0x7417('0x63')](function(_0x43bb77){var _0x2543e8;_0x53f7ce=_0x43bb77||[];var _0x459e99=[];if(_0x43bb77){for(var _0x27c3d4=0x0;_0x27c3d4<_0x43bb77[_0x7417('0x33')];_0x27c3d4+=0x1){var _0x2f3807=_0x43bb77[_0x27c3d4][_0x7417('0x20')]({'plain':!![]});_0x5d858f[_0x7417('0x64')]=_0x420c2f['body'][_0x7417('0x64')]?_0x420c2f[_0x7417('0x46')]['dialCheckDuplicateType']:_0x5d858f[_0x7417('0x64')];switch(_0x5d858f[_0x7417('0x64')]){case _0x7417('0x65'):_0x2543e8=squel[_0x7417('0x66')]()['into'](_0x7417('0x67'))[_0x7417('0x68')]([_0x7417('0x69'),_0x7417('0x6a'),_0x7417('0x6b'),_0x7417('0x6c'),_0x7417('0x57'),_0x7417('0x50'),_0x7417('0x51')],squel[_0x7417('0x6d')]()[_0x7417('0x6e')]('phone','phone')['field'](_0x7417('0x6f'),_0x7417('0x6a'))['field']('id',_0x7417('0x6b'))['field'](_0x2f3807[_0x7417('0x70')][_0x7417('0x71')](),_0x7417('0x6c'))[_0x7417('0x6e')](_0x420c2f['params']['id'][_0x7417('0x71')](),_0x7417('0x57'))[_0x7417('0x6e')](_0x7417('0x6f'),_0x7417('0x50'))[_0x7417('0x6e')](_0x7417('0x6f'),_0x7417('0x51'))[_0x7417('0x72')](_0x7417('0x73'))[_0x7417('0x38')](_0x7417('0x74'))[_0x7417('0x38')]('ListId\x20=\x20?',_0x2f3807[_0x7417('0x70')]['toString']())['where'](_0x7417('0x75'))[_0x7417('0x38')](_0x7417('0x76'),squel[_0x7417('0x6d')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0x7417('0x72')](_0x7417('0x77'))[_0x7417('0x38')](_0x7417('0x78'),_0x420c2f['params']['id'][_0x7417('0x71')]()))[_0x7417('0x38')](_0x7417('0x76'),squel['select']()[_0x7417('0x6e')]('COALESCE(phone,\x27\x27)')[_0x7417('0x72')](_0x7417('0x67'))[_0x7417('0x38')](_0x7417('0x78'),_0x420c2f[_0x7417('0x42')]['id'][_0x7417('0x71')]())))[_0x7417('0x71')]();break;case _0x7417('0x79'):_0x2543e8=squel['insert']()[_0x7417('0x7a')]('cm_hopper')[_0x7417('0x68')]([_0x7417('0x69'),'scheduledAt',_0x7417('0x6b'),_0x7417('0x6c'),_0x7417('0x57'),_0x7417('0x50'),_0x7417('0x51')],squel[_0x7417('0x6d')]()[_0x7417('0x6e')]('phone',_0x7417('0x69'))[_0x7417('0x6e')](_0x7417('0x6f'),_0x7417('0x6a'))[_0x7417('0x6e')]('id',_0x7417('0x6b'))[_0x7417('0x6e')](_0x2f3807[_0x7417('0x70')][_0x7417('0x71')](),_0x7417('0x6c'))[_0x7417('0x6e')](_0x420c2f[_0x7417('0x42')]['id'][_0x7417('0x71')](),_0x7417('0x57'))[_0x7417('0x6e')]('NOW()',_0x7417('0x50'))['field'](_0x7417('0x6f'),'updatedAt')[_0x7417('0x72')](_0x7417('0x73'))[_0x7417('0x38')]('deletedAt\x20IS\x20NULL')['where'](_0x7417('0x7b'),_0x2f3807[_0x7417('0x70')][_0x7417('0x71')]())[_0x7417('0x38')](_0x7417('0x75'))[_0x7417('0x38')]('phone\x20NOT\x20IN\x20(?)',squel[_0x7417('0x6d')]()[_0x7417('0x6e')](_0x7417('0x7c'))[_0x7417('0x72')](_0x7417('0x67'))[_0x7417('0x38')](_0x7417('0x78'),_0x420c2f[_0x7417('0x42')]['id'][_0x7417('0x71')]())))[_0x7417('0x71')]();break;default:_0x2543e8=squel[_0x7417('0x66')]()['into'](_0x7417('0x67'))[_0x7417('0x68')]([_0x7417('0x69'),_0x7417('0x6a'),_0x7417('0x6b'),_0x7417('0x6c'),_0x7417('0x57'),_0x7417('0x50'),'updatedAt'],squel[_0x7417('0x6d')]()[_0x7417('0x6e')](_0x7417('0x69'),'phone')['field'](_0x7417('0x6f'),_0x7417('0x6a'))[_0x7417('0x6e')]('id',_0x7417('0x6b'))[_0x7417('0x6e')](_0x2f3807[_0x7417('0x70')][_0x7417('0x71')](),'ListId')[_0x7417('0x6e')](_0x420c2f[_0x7417('0x42')]['id']['toString'](),_0x7417('0x57'))[_0x7417('0x6e')](_0x7417('0x6f'),_0x7417('0x50'))[_0x7417('0x6e')](_0x7417('0x6f'),'updatedAt')['from'](_0x7417('0x73'))[_0x7417('0x38')]('deletedAt\x20IS\x20NULL')[_0x7417('0x38')](_0x7417('0x7b'),_0x2f3807['CmListId'][_0x7417('0x71')]())[_0x7417('0x38')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x459e99[_0x7417('0x7d')](db[_0x7417('0x7e')][_0x7417('0x2d')](_0x2543e8));}return BPromise['all'](_0x459e99);}})[_0x7417('0x1f')](function(){return _0x53f7ce;})[_0x7417('0x1f')](respondWithResult(_0x5c4142,null))[_0x7417('0x40')](handleError(_0x5c4142,null));};exports[_0x7417('0x7f')]=function(_0x112dd3,_0x107789,_0x30732a){return db[_0x7417('0x2a')][_0x7417('0x44')]({'where':{'id':_0x112dd3[_0x7417('0x42')]['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0x107789,null))[_0x7417('0x1f')](function(_0x467046){if(_0x467046){return _0x467046[_0x7417('0x7f')](_0x112dd3[_0x7417('0x2d')]['ids']);}})[_0x7417('0x1f')](function(_0x457f0a){if(_0x457f0a){return db[_0x7417('0x54')][_0x7417('0x23')]({'where':{'ListId':_0x112dd3[_0x7417('0x2d')][_0x7417('0x62')],'CampaignId':_0x112dd3[_0x7417('0x42')]['id']}})['then'](function(){return _0x457f0a;});}})['then'](respondWithStatusCode(_0x107789,null))[_0x7417('0x40')](handleError(_0x107789,null));};exports['getBlackLists']=function(_0x15e2fc,_0x3ac205,_0x4eaa71){var _0x9fa92d={'raw':!![],'where':{}};var _0x103cb5={};var _0x508fc8={'count':0x0,'rows':[]};return db['Campaign'][_0x7417('0x59')]({'where':{'id':_0x15e2fc['params']['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0x3ac205,null))[_0x7417('0x1f')](function(_0x3b58d1){if(_0x3b58d1){_0x103cb5[_0x7417('0x30')]=_['keys'](db[_0x7417('0x5f')][_0x7417('0x4e')]);_0x103cb5[_0x7417('0x2d')]=_['keys'](_0x15e2fc[_0x7417('0x2d')]);_0x103cb5[_0x7417('0x2e')]=_[_0x7417('0x2f')](_0x103cb5[_0x7417('0x30')],_0x103cb5['query']);_0x9fa92d[_0x7417('0x31')]=_['intersection'](_0x103cb5[_0x7417('0x30')],qs['fields'](_0x15e2fc[_0x7417('0x2d')][_0x7417('0x32')]));_0x9fa92d[_0x7417('0x31')]=_0x9fa92d[_0x7417('0x31')][_0x7417('0x33')]?_0x9fa92d[_0x7417('0x31')]:_0x103cb5[_0x7417('0x30')];if(!_0x15e2fc[_0x7417('0x2d')][_0x7417('0x55')]('nolimit')){_0x9fa92d[_0x7417('0x35')]=qs[_0x7417('0x35')](_0x15e2fc[_0x7417('0x2d')]['limit']);_0x9fa92d[_0x7417('0x19')]=qs['offset'](_0x15e2fc[_0x7417('0x2d')][_0x7417('0x19')]);}_0x9fa92d['order']=qs['sort'](_0x15e2fc['query']['sort']);_0x9fa92d[_0x7417('0x38')]=qs[_0x7417('0x2e')](_[_0x7417('0x37')](_0x15e2fc['query'],_0x103cb5['filters']));_0x9fa92d[_0x7417('0x38')]['CampaignId']=_0x3b58d1['id'];if(_0x15e2fc['query'][_0x7417('0x58')]){_0x9fa92d[_0x7417('0x38')]=_[_0x7417('0x39')](_0x9fa92d['where'],{'$or':_[_0x7417('0x29')](_0x9fa92d[_0x7417('0x31')],function(_0x49effa){var _0x114809={};_0x114809[_0x49effa]={'$like':'%'+_0x15e2fc['query']['filter']+'%'};return _0x114809;})});}_0x9fa92d=_['merge']({},_0x9fa92d,_0x15e2fc[_0x7417('0x3b')]);return db[_0x7417('0x5f')][_0x7417('0x18')]({'where':_0x9fa92d[_0x7417('0x38')]})[_0x7417('0x1f')](function(_0x5b9bf7){_0x508fc8[_0x7417('0x18')]=_0x5b9bf7;if(_0x15e2fc[_0x7417('0x2d')]['includeAll']){_0x9fa92d[_0x7417('0x3d')]=[{'all':!![]}];}return db[_0x7417('0x5f')][_0x7417('0x3e')](_0x9fa92d);})[_0x7417('0x1f')](function(_0x38696d){_0x508fc8[_0x7417('0x3f')]=_0x38696d;return _0x508fc8;});}})[_0x7417('0x1f')](respondWithFilteredResult(_0x3ac205,_0x9fa92d))[_0x7417('0x40')](handleError(_0x3ac205,null));};exports[_0x7417('0x80')]=function(_0x4c920a,_0x558ea7,_0x55ad9f){var _0x50033f,_0xd5b029;return db[_0x7417('0x2a')][_0x7417('0x44')]({'where':{'id':_0x4c920a[_0x7417('0x42')]['id']}})['then'](handleEntityNotFound(_0x558ea7,null))[_0x7417('0x1f')](function(_0x967004){if(_0x967004){_0xd5b029=_0x967004;return _0x967004[_0x7417('0x80')](_0x4c920a[_0x7417('0x46')][_0x7417('0x62')],_[_0x7417('0x4f')](_0x4c920a[_0x7417('0x46')],[_0x7417('0x62'),'id'])||{});}return null;})[_0x7417('0x63')](function(_0x59fcb3){var _0x4e7c19;_0x50033f=_0x59fcb3||[];var _0x4c243e=[];if(_0x59fcb3){for(var _0x2163f6=0x0;_0x2163f6<_0x59fcb3['length'];_0x2163f6+=0x1){var _0x330ccf=_0x59fcb3[_0x2163f6][_0x7417('0x20')]({'plain':!![]});_0x4e7c19=squel[_0x7417('0x66')]()[_0x7417('0x7a')](_0x7417('0x81'))[_0x7417('0x68')]([_0x7417('0x69'),_0x7417('0x6b'),'ListId',_0x7417('0x57'),_0x7417('0x50'),_0x7417('0x51')],squel[_0x7417('0x6d')]()['field'](_0x7417('0x69'),_0x7417('0x69'))[_0x7417('0x6e')]('id',_0x7417('0x6b'))[_0x7417('0x6e')](_0x330ccf[_0x7417('0x70')][_0x7417('0x71')](),_0x7417('0x6c'))['field'](_0x4c920a[_0x7417('0x42')]['id'][_0x7417('0x71')](),_0x7417('0x57'))[_0x7417('0x6e')](_0x7417('0x6f'),_0x7417('0x50'))['field'](_0x7417('0x6f'),'updatedAt')[_0x7417('0x72')](_0x7417('0x73'))[_0x7417('0x38')](_0x7417('0x74'))[_0x7417('0x38')]('ListId\x20=\x20?',_0x330ccf[_0x7417('0x70')]['toString']())['where'](_0x7417('0x75')))[_0x7417('0x71')]();_0x4c243e[_0x7417('0x7d')](db['sequelize'][_0x7417('0x2d')](_0x4e7c19));}return BPromise[_0x7417('0x82')](_0x4c243e);}})['then'](function(){return _0x50033f;})[_0x7417('0x1f')](respondWithResult(_0x558ea7,null))['catch'](handleError(_0x558ea7,null));};exports[_0x7417('0x83')]=function(_0x12aa52,_0x4c49aa,_0x4bda3b){return db[_0x7417('0x2a')]['find']({'where':{'id':_0x12aa52[_0x7417('0x42')]['id']}})[_0x7417('0x1f')](handleEntityNotFound(_0x4c49aa,null))['then'](function(_0x4ebe97){if(_0x4ebe97){return _0x4ebe97['removeBlackLists'](_0x12aa52[_0x7417('0x2d')][_0x7417('0x62')]);}})[_0x7417('0x1f')](function(_0x525258){if(_0x525258){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x12aa52[_0x7417('0x2d')][_0x7417('0x62')],'CampaignId':_0x12aa52['params']['id']}})[_0x7417('0x1f')](function(){return _0x525258;});}})[_0x7417('0x1f')](respondWithStatusCode(_0x4c49aa,null))[_0x7417('0x40')](handleError(_0x4c49aa,null));}; \ No newline at end of file +var _0x9e5f=['autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','getHoppers','order','CampaignId','findOne','CmHopperHistory','nolimit','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','field','CmListId','toString','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','COALESCE(phone,\x27\x27)','from','cm_hopper','CampaignId\x20=\x20?','onlyIfOpen','into','push','sequelize','all','removeLists','CmHopper','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','IvrCampaigns','UserProfileResource','error','stack','name','send','index','map','Campaign','type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId'];(function(_0x1c8f4f,_0xb3f915){var _0x1b21cf=function(_0x2c2648){while(--_0x2c2648){_0x1c8f4f['push'](_0x1c8f4f['shift']());}};_0x1b21cf(++_0xb3f915);}(_0x9e5f,0x1c1));var _0xf9e5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9e5f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xf9e5('0x0'));var emlformat=require(_0xf9e5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf9e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xf9e5('0x3'));var moment=require(_0xf9e5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf9e5('0x5'));var util=require(_0xf9e5('0x6'));var path=require(_0xf9e5('0x7'));var sox=require(_0xf9e5('0x8'));var csv=require('to-csv');var ejs=require(_0xf9e5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf9e5('0xa'));var crypto=require(_0xf9e5('0xb'));var jsforce=require(_0xf9e5('0xc'));var deskjs=require(_0xf9e5('0xd'));var toCsv=require(_0xf9e5('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf9e5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf9e5('0x10'));var hardwareService=require(_0xf9e5('0x11'));var logger=require(_0xf9e5('0x12'))(_0xf9e5('0x13'));var utils=require('../../config/utils');var config=require(_0xf9e5('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5b4e2f,_0x1de394){_0x1de394=_0x1de394||0xcc;return function(_0x488fc6){if(_0x488fc6){return _0x5b4e2f[_0xf9e5('0x15')](_0x1de394);}return _0x5b4e2f['status'](_0x1de394)[_0xf9e5('0x16')]();};}function respondWithResult(_0x5c8c7e,_0xe06ff6){_0xe06ff6=_0xe06ff6||0xc8;return function(_0x29259f){if(_0x29259f){return _0x5c8c7e[_0xf9e5('0x17')](_0xe06ff6)['json'](_0x29259f);}};}function respondWithFilteredResult(_0x917eb1,_0x57fa7c){return function(_0x381595){if(_0x381595){var _0x321a83=_0x381595[_0xf9e5('0x18')],_0x5d69cf=_0x57fa7c[_0xf9e5('0x19')],_0x22a07f=_0x57fa7c[_0xf9e5('0x19')]+_0x57fa7c[_0xf9e5('0x1a')],_0x3ade1d;if(_0x22a07f>=_0x321a83){_0x22a07f=_0x321a83;_0x3ade1d=0xc8;}else{_0x3ade1d=0xce;}_0x917eb1[_0xf9e5('0x17')](_0x3ade1d);return _0x917eb1[_0xf9e5('0x1b')](_0xf9e5('0x1c'),_0x5d69cf+'-'+_0x22a07f+'/'+_0x321a83)['json'](_0x381595);}return null;};}function patchUpdates(_0x44a8f1){return function(_0xb47e54){try{jsonpatch[_0xf9e5('0x1d')](_0xb47e54,_0x44a8f1,!![]);}catch(_0x299cba){return BPromise[_0xf9e5('0x1e')](_0x299cba);}return _0xb47e54[_0xf9e5('0x1f')]();};}function saveUpdates(_0x4af8e2,_0x322cf4){return function(_0x407904){if(_0x407904){return _0x407904[_0xf9e5('0x20')](_0x4af8e2)[_0xf9e5('0x21')](function(_0x4f6ef6){return _0x4f6ef6;});}return null;};}function removeEntity(_0x506565,_0x3bf41c){return function(_0x78f5ea){if(_0x78f5ea){return _0x78f5ea[_0xf9e5('0x22')]()[_0xf9e5('0x21')](function(){var _0x2c46cf=_0x78f5ea[_0xf9e5('0x23')]({'plain':!![]});var _0x3d9af0=_0xf9e5('0x24');return db[_0xf9e5('0x25')][_0xf9e5('0x22')]({'where':{'type':_0x3d9af0,'resourceId':_0x2c46cf['id']}})[_0xf9e5('0x21')](function(){return _0x78f5ea;});})[_0xf9e5('0x21')](function(){_0x506565[_0xf9e5('0x17')](0xcc)[_0xf9e5('0x16')]();});}};}function handleEntityNotFound(_0x2e2b44,_0x183242){return function(_0x101f2f){if(!_0x101f2f){_0x2e2b44[_0xf9e5('0x15')](0x194);}return _0x101f2f;};}function handleError(_0x381df3,_0xe8733c){_0xe8733c=_0xe8733c||0x1f4;return function(_0x5206c3){logger[_0xf9e5('0x26')](_0x5206c3[_0xf9e5('0x27')]);if(_0x5206c3[_0xf9e5('0x28')]){delete _0x5206c3['name'];}_0x381df3['status'](_0xe8733c)[_0xf9e5('0x29')](_0x5206c3);};}exports[_0xf9e5('0x2a')]=function(_0x177ebd,_0xd8e8b5){var _0x189899={},_0x3cc078={},_0x46bbaf={'count':0x0,'rows':[]};var _0x3e4dd8=_[_0xf9e5('0x2b')](db[_0xf9e5('0x2c')]['rawAttributes'],function(_0x4ac786){return{'name':_0x4ac786['fieldName'],'type':_0x4ac786[_0xf9e5('0x2d')][_0xf9e5('0x2e')]};});_0x3cc078[_0xf9e5('0x2f')]=_['map'](_0x3e4dd8,_0xf9e5('0x28'));_0x3cc078['query']=_[_0xf9e5('0x30')](_0x177ebd[_0xf9e5('0x31')]);_0x3cc078[_0xf9e5('0x32')]=_['intersection'](_0x3cc078[_0xf9e5('0x2f')],_0x3cc078[_0xf9e5('0x31')]);_0x189899[_0xf9e5('0x33')]=_[_0xf9e5('0x34')](_0x3cc078[_0xf9e5('0x2f')],qs[_0xf9e5('0x35')](_0x177ebd['query'][_0xf9e5('0x35')]));_0x189899[_0xf9e5('0x33')]=_0x189899[_0xf9e5('0x33')]['length']?_0x189899['attributes']:_0x3cc078[_0xf9e5('0x2f')];if(!_0x177ebd[_0xf9e5('0x31')][_0xf9e5('0x36')]('nolimit')){_0x189899['limit']=qs[_0xf9e5('0x1a')](_0x177ebd[_0xf9e5('0x31')][_0xf9e5('0x1a')]);_0x189899[_0xf9e5('0x19')]=qs['offset'](_0x177ebd[_0xf9e5('0x31')]['offset']);}_0x189899['order']=qs[_0xf9e5('0x37')](_0x177ebd[_0xf9e5('0x31')][_0xf9e5('0x37')]);_0x189899['where']=qs['filters'](_[_0xf9e5('0x38')](_0x177ebd[_0xf9e5('0x31')],_0x3cc078[_0xf9e5('0x32')]));if(_0x177ebd[_0xf9e5('0x31')]['filter']){_0x189899[_0xf9e5('0x39')]=_[_0xf9e5('0x3a')](_0x189899[_0xf9e5('0x39')],{'$or':_[_0xf9e5('0x2b')](_0x3e4dd8,function(_0x450797){if(_0x450797[_0xf9e5('0x2d')]!==_0xf9e5('0x3b')){var _0x5594ba={};_0x5594ba[_0x450797[_0xf9e5('0x28')]]={'$like':'%'+_0x177ebd[_0xf9e5('0x31')][_0xf9e5('0x3c')]+'%'};return _0x5594ba;}})});}_0x189899=_[_0xf9e5('0x3a')]({},_0x189899,_0x177ebd[_0xf9e5('0x3d')]);var _0x49a3d1={'where':_0x189899['where']};return db[_0xf9e5('0x2c')][_0xf9e5('0x18')](_0x49a3d1)[_0xf9e5('0x21')](function(_0x5512b0){_0x46bbaf[_0xf9e5('0x18')]=_0x5512b0;if(_0x177ebd['query'][_0xf9e5('0x3e')]){_0x189899[_0xf9e5('0x3f')]=[{'all':!![]}];}return db['Campaign'][_0xf9e5('0x40')](_0x189899);})[_0xf9e5('0x21')](function(_0x1395d6){_0x46bbaf[_0xf9e5('0x41')]=_0x1395d6;return _0x46bbaf;})[_0xf9e5('0x21')](respondWithFilteredResult(_0xd8e8b5,_0x189899))[_0xf9e5('0x42')](handleError(_0xd8e8b5,null));};exports[_0xf9e5('0x43')]=function(_0x3bad5b,_0x37f46c){var _0x52bb92={'raw':![],'where':{'id':_0x3bad5b[_0xf9e5('0x44')]['id']}},_0x4ca4d4={};_0x4ca4d4[_0xf9e5('0x2f')]=_[_0xf9e5('0x30')](db[_0xf9e5('0x2c')][_0xf9e5('0x45')]);_0x4ca4d4[_0xf9e5('0x31')]=_[_0xf9e5('0x30')](_0x3bad5b['query']);_0x4ca4d4[_0xf9e5('0x32')]=_[_0xf9e5('0x34')](_0x4ca4d4[_0xf9e5('0x2f')],_0x4ca4d4[_0xf9e5('0x31')]);_0x52bb92[_0xf9e5('0x33')]=_[_0xf9e5('0x34')](_0x4ca4d4['model'],qs[_0xf9e5('0x35')](_0x3bad5b[_0xf9e5('0x31')][_0xf9e5('0x35')]));_0x52bb92[_0xf9e5('0x33')]=_0x52bb92['attributes'][_0xf9e5('0x46')]?_0x52bb92[_0xf9e5('0x33')]:_0x4ca4d4[_0xf9e5('0x2f')];if(_0x3bad5b[_0xf9e5('0x31')][_0xf9e5('0x3e')]){_0x52bb92[_0xf9e5('0x3f')]=[{'all':!![]}];}_0x52bb92=_[_0xf9e5('0x3a')]({},_0x52bb92,_0x3bad5b[_0xf9e5('0x3d')]);return db[_0xf9e5('0x2c')]['find'](_0x52bb92)[_0xf9e5('0x21')](handleEntityNotFound(_0x37f46c,null))['then'](respondWithResult(_0x37f46c,null))[_0xf9e5('0x42')](handleError(_0x37f46c,null));};exports['create']=function(_0x1929b7,_0x42c1a1){return db[_0xf9e5('0x2c')][_0xf9e5('0x47')](_0x1929b7[_0xf9e5('0x48')],{})[_0xf9e5('0x21')](function(_0x41267f){var _0x4b10ab=_0x1929b7[_0xf9e5('0x49')][_0xf9e5('0x23')]({'plain':!![]});if(!_0x4b10ab)throw new Error(_0xf9e5('0x4a'));if(_0x4b10ab[_0xf9e5('0x4b')]===_0xf9e5('0x49')){var _0x16a357=_0x41267f[_0xf9e5('0x23')]({'plain':!![]});var _0x41116b=_0xf9e5('0x24');return db[_0xf9e5('0x4c')][_0xf9e5('0x4d')]({'where':{'name':_0x41116b,'userProfileId':_0x4b10ab[_0xf9e5('0x4e')]},'raw':!![]})[_0xf9e5('0x21')](function(_0x27398c){if(_0x27398c&&_0x27398c[_0xf9e5('0x4f')]===0x0){return db[_0xf9e5('0x25')][_0xf9e5('0x47')]({'name':_0x16a357['name'],'resourceId':_0x16a357['id'],'type':_0x27398c[_0xf9e5('0x28')],'sectionId':_0x27398c['id']},{})[_0xf9e5('0x21')](function(){return _0x41267f;});}else{return _0x41267f;}})[_0xf9e5('0x42')](function(_0x193b6e){logger[_0xf9e5('0x26')](_0xf9e5('0x50'),_0x193b6e);throw _0x193b6e;});}return _0x41267f;})['then'](respondWithResult(_0x42c1a1,0xc9))[_0xf9e5('0x42')](handleError(_0x42c1a1,null));};exports['clone']=function(_0x268809,_0xfdb9a1){var _0x285cbd={'where':{'id':_0x268809['params']['id']}},_0x221afd={};_0x221afd[_0xf9e5('0x2f')]=_[_0xf9e5('0x30')](db['Campaign'][_0xf9e5('0x45')]);_0x285cbd[_0xf9e5('0x33')]=_[_0xf9e5('0x34')](_0x221afd[_0xf9e5('0x2f')],qs['fields'](_0x268809[_0xf9e5('0x31')]['fields']));_0x285cbd[_0xf9e5('0x33')]=_0x285cbd[_0xf9e5('0x33')][_0xf9e5('0x46')]?_0x285cbd[_0xf9e5('0x33')]:_0x221afd['model'];if(_0x268809[_0xf9e5('0x31')]['includeAll']){_0x285cbd[_0xf9e5('0x3f')]=[{'all':!![]}];}_0x285cbd=_[_0xf9e5('0x3a')]({},_0x285cbd,_0x268809[_0xf9e5('0x3d')]);return db['Campaign'][_0xf9e5('0x4d')](_0x285cbd)[_0xf9e5('0x21')](handleEntityNotFound(_0xfdb9a1,null))['then'](function(_0x156bc3){if(_0x156bc3){var _0x2f68a4=_0x156bc3[_0xf9e5('0x23')]({'plain':!![]});_0x2f68a4=qs[_0xf9e5('0x51')](_0x2f68a4,['id',_0xf9e5('0x52'),'updatedAt']);_0x268809[_0xf9e5('0x48')]=_['omit'](_0x268809[_0xf9e5('0x48')],['id','createdAt',_0xf9e5('0x53')]);return db[_0xf9e5('0x2c')][_0xf9e5('0x47')](_[_0xf9e5('0x3a')](_0x2f68a4,_0x268809[_0xf9e5('0x48')]),{'include':_0x268809['query'][_0xf9e5('0x3e')]?[{'all':!![]}]:undefined})[_0xf9e5('0x21')](function(_0x201147){var _0x24c1a4=_0x268809[_0xf9e5('0x49')][_0xf9e5('0x23')]({'plain':!![]});if(!_0x24c1a4)throw new Error(_0xf9e5('0x4a'));if(_0x24c1a4[_0xf9e5('0x4b')]==='user'){var _0x38608e=_0x201147[_0xf9e5('0x23')]({'plain':!![]});var _0x2f0847=_0xf9e5('0x24');return db['UserProfileSection'][_0xf9e5('0x4d')]({'where':{'name':_0x2f0847,'userProfileId':_0x24c1a4[_0xf9e5('0x4e')]},'raw':!![]})[_0xf9e5('0x21')](function(_0x3e3683){if(_0x3e3683&&_0x3e3683['autoAssociation']===0x0){return db[_0xf9e5('0x25')][_0xf9e5('0x47')]({'name':_0x38608e[_0xf9e5('0x28')],'resourceId':_0x38608e['id'],'type':_0x3e3683[_0xf9e5('0x28')],'sectionId':_0x3e3683['id']},{})[_0xf9e5('0x21')](function(){return _0x201147;});}else{return _0x201147;}})['catch'](function(_0x501610){logger[_0xf9e5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x501610);throw _0x501610;});}return _0x201147;});}})[_0xf9e5('0x21')](respondWithResult(_0xfdb9a1,0xc9))[_0xf9e5('0x42')](handleError(_0xfdb9a1,null));};exports[_0xf9e5('0x20')]=function(_0x434009,_0x4ed161){if(_0x434009[_0xf9e5('0x48')]['id']){delete _0x434009['body']['id'];}return db['Campaign'][_0xf9e5('0x4d')]({'where':{'id':_0x434009[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x4ed161,null))[_0xf9e5('0x21')](saveUpdates(_0x434009[_0xf9e5('0x48')],null))[_0xf9e5('0x21')](respondWithResult(_0x4ed161,null))['catch'](handleError(_0x4ed161,null));};exports[_0xf9e5('0x22')]=function(_0x190bbf,_0xb631a0){return db[_0xf9e5('0x2c')][_0xf9e5('0x4d')]({'where':{'id':_0x190bbf['params']['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0xb631a0,null))[_0xf9e5('0x21')](removeEntity(_0xb631a0,null))[_0xf9e5('0x42')](handleError(_0xb631a0,null));};exports[_0xf9e5('0x54')]=function(_0x26160e,_0x14e7d1,_0x1d9afe){var _0x3edb23={'raw':!![],'where':{}};var _0x39c3ac={};var _0x22d4bd={'count':0x0,'rows':[]};return db[_0xf9e5('0x2c')]['findOne']({'where':{'id':_0x26160e[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x14e7d1,null))[_0xf9e5('0x21')](function(_0x49047d){if(_0x49047d){_0x39c3ac[_0xf9e5('0x2f')]=_[_0xf9e5('0x30')](db['CmHopper']['rawAttributes']);_0x39c3ac[_0xf9e5('0x31')]=_[_0xf9e5('0x30')](_0x26160e['query']);_0x39c3ac[_0xf9e5('0x32')]=_[_0xf9e5('0x34')](_0x39c3ac['model'],_0x39c3ac['query']);_0x3edb23[_0xf9e5('0x33')]=_['intersection'](_0x39c3ac['model'],qs['fields'](_0x26160e[_0xf9e5('0x31')][_0xf9e5('0x35')]));_0x3edb23[_0xf9e5('0x33')]=_0x3edb23[_0xf9e5('0x33')][_0xf9e5('0x46')]?_0x3edb23[_0xf9e5('0x33')]:_0x39c3ac[_0xf9e5('0x2f')];if(!_0x26160e[_0xf9e5('0x31')][_0xf9e5('0x36')]('nolimit')){_0x3edb23[_0xf9e5('0x1a')]=qs[_0xf9e5('0x1a')](_0x26160e[_0xf9e5('0x31')][_0xf9e5('0x1a')]);_0x3edb23[_0xf9e5('0x19')]=qs[_0xf9e5('0x19')](_0x26160e[_0xf9e5('0x31')]['offset']);}_0x3edb23[_0xf9e5('0x55')]=qs['sort'](_0x26160e[_0xf9e5('0x31')]['sort']);_0x3edb23['where']=qs[_0xf9e5('0x32')](_['pick'](_0x26160e[_0xf9e5('0x31')],_0x39c3ac[_0xf9e5('0x32')]));_0x3edb23[_0xf9e5('0x39')][_0xf9e5('0x56')]=_0x49047d['id'];if(_0x26160e[_0xf9e5('0x31')][_0xf9e5('0x3c')]){_0x3edb23[_0xf9e5('0x39')]=_[_0xf9e5('0x3a')](_0x3edb23['where'],{'$or':_[_0xf9e5('0x2b')](_0x3edb23[_0xf9e5('0x33')],function(_0x1bbc0c){var _0x5f56c4={};_0x5f56c4[_0x1bbc0c]={'$like':'%'+_0x26160e['query']['filter']+'%'};return _0x5f56c4;})});}_0x3edb23=_[_0xf9e5('0x3a')]({},_0x3edb23,_0x26160e[_0xf9e5('0x3d')]);return db['CmHopper'][_0xf9e5('0x18')]({'where':_0x3edb23['where']})[_0xf9e5('0x21')](function(_0x5a199c){_0x22d4bd[_0xf9e5('0x18')]=_0x5a199c;if(_0x26160e[_0xf9e5('0x31')][_0xf9e5('0x3e')]){_0x3edb23['include']=[{'all':!![]}];}return db['CmHopper'][_0xf9e5('0x40')](_0x3edb23);})[_0xf9e5('0x21')](function(_0x2fdc2e){_0x22d4bd[_0xf9e5('0x41')]=_0x2fdc2e;return _0x22d4bd;});}})[_0xf9e5('0x21')](respondWithFilteredResult(_0x14e7d1,_0x3edb23))[_0xf9e5('0x42')](handleError(_0x14e7d1,null));};exports['getHopperHistories']=function(_0x167b94,_0x1e9fb,_0x570182){var _0x370ec1={'raw':!![],'where':{}};var _0xe58b09={};var _0x4edc76={'count':0x0,'rows':[]};return db[_0xf9e5('0x2c')][_0xf9e5('0x57')]({'where':{'id':_0x167b94[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x1e9fb,null))[_0xf9e5('0x21')](function(_0x213c24){if(_0x213c24){_0xe58b09[_0xf9e5('0x2f')]=_[_0xf9e5('0x30')](db[_0xf9e5('0x58')][_0xf9e5('0x45')]);_0xe58b09[_0xf9e5('0x31')]=_[_0xf9e5('0x30')](_0x167b94[_0xf9e5('0x31')]);_0xe58b09[_0xf9e5('0x32')]=_[_0xf9e5('0x34')](_0xe58b09['model'],_0xe58b09[_0xf9e5('0x31')]);_0x370ec1[_0xf9e5('0x33')]=_['intersection'](_0xe58b09[_0xf9e5('0x2f')],qs[_0xf9e5('0x35')](_0x167b94['query'][_0xf9e5('0x35')]));_0x370ec1[_0xf9e5('0x33')]=_0x370ec1[_0xf9e5('0x33')][_0xf9e5('0x46')]?_0x370ec1['attributes']:_0xe58b09[_0xf9e5('0x2f')];if(!_0x167b94[_0xf9e5('0x31')]['hasOwnProperty'](_0xf9e5('0x59'))){_0x370ec1['limit']=qs[_0xf9e5('0x1a')](_0x167b94[_0xf9e5('0x31')][_0xf9e5('0x1a')]);_0x370ec1[_0xf9e5('0x19')]=qs[_0xf9e5('0x19')](_0x167b94['query']['offset']);}_0x370ec1['order']=qs[_0xf9e5('0x37')](_0x167b94[_0xf9e5('0x31')][_0xf9e5('0x37')]);_0x370ec1[_0xf9e5('0x39')]=qs[_0xf9e5('0x32')](_[_0xf9e5('0x38')](_0x167b94[_0xf9e5('0x31')],_0xe58b09[_0xf9e5('0x32')]));_0x370ec1[_0xf9e5('0x39')][_0xf9e5('0x56')]=_0x213c24['id'];if(_0x167b94['query'][_0xf9e5('0x3c')]){_0x370ec1['where']=_[_0xf9e5('0x3a')](_0x370ec1[_0xf9e5('0x39')],{'$or':_[_0xf9e5('0x2b')](_0x370ec1[_0xf9e5('0x33')],function(_0x4a47d0){var _0x4843c4={};_0x4843c4[_0x4a47d0]={'$like':'%'+_0x167b94['query'][_0xf9e5('0x3c')]+'%'};return _0x4843c4;})});}_0x370ec1=_[_0xf9e5('0x3a')]({},_0x370ec1,_0x167b94[_0xf9e5('0x3d')]);return db[_0xf9e5('0x58')][_0xf9e5('0x18')]({'where':_0x370ec1[_0xf9e5('0x39')]})['then'](function(_0x28caa1){_0x4edc76[_0xf9e5('0x18')]=_0x28caa1;if(_0x167b94[_0xf9e5('0x31')]['includeAll']){_0x370ec1[_0xf9e5('0x3f')]=[{'all':!![]}];}return db[_0xf9e5('0x58')][_0xf9e5('0x40')](_0x370ec1);})['then'](function(_0x167880){_0x4edc76[_0xf9e5('0x41')]=_0x167880;return _0x4edc76;});}})[_0xf9e5('0x21')](respondWithFilteredResult(_0x1e9fb,_0x370ec1))[_0xf9e5('0x42')](handleError(_0x1e9fb,null));};exports[_0xf9e5('0x5a')]=function(_0x5a31a9,_0x6e3f2a,_0x1f0a2f){var _0x1a13be={'raw':!![],'where':{}};var _0x3ade7c={};var _0x358ced={'count':0x0,'rows':[]};return db[_0xf9e5('0x2c')]['findOne']({'where':{'id':_0x5a31a9[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x6e3f2a,null))[_0xf9e5('0x21')](function(_0xefc16b){if(_0xefc16b){_0x3ade7c['model']=_[_0xf9e5('0x30')](db[_0xf9e5('0x5b')][_0xf9e5('0x45')]);_0x3ade7c['query']=_['keys'](_0x5a31a9[_0xf9e5('0x31')]);_0x3ade7c['filters']=_[_0xf9e5('0x34')](_0x3ade7c[_0xf9e5('0x2f')],_0x3ade7c[_0xf9e5('0x31')]);_0x1a13be['attributes']=_['intersection'](_0x3ade7c[_0xf9e5('0x2f')],qs[_0xf9e5('0x35')](_0x5a31a9[_0xf9e5('0x31')][_0xf9e5('0x35')]));_0x1a13be[_0xf9e5('0x33')]=_0x1a13be[_0xf9e5('0x33')]['length']?_0x1a13be[_0xf9e5('0x33')]:_0x3ade7c[_0xf9e5('0x2f')];if(!_0x5a31a9[_0xf9e5('0x31')]['hasOwnProperty']('nolimit')){_0x1a13be[_0xf9e5('0x1a')]=qs[_0xf9e5('0x1a')](_0x5a31a9[_0xf9e5('0x31')][_0xf9e5('0x1a')]);_0x1a13be[_0xf9e5('0x19')]=qs[_0xf9e5('0x19')](_0x5a31a9[_0xf9e5('0x31')][_0xf9e5('0x19')]);}_0x1a13be[_0xf9e5('0x55')]=qs[_0xf9e5('0x37')](_0x5a31a9[_0xf9e5('0x31')][_0xf9e5('0x37')]);_0x1a13be['where']=qs[_0xf9e5('0x32')](_[_0xf9e5('0x38')](_0x5a31a9[_0xf9e5('0x31')],_0x3ade7c[_0xf9e5('0x32')]));_0x1a13be[_0xf9e5('0x39')][_0xf9e5('0x56')]=_0xefc16b['id'];if(_0x5a31a9[_0xf9e5('0x31')]['filter']){_0x1a13be[_0xf9e5('0x39')]=_[_0xf9e5('0x3a')](_0x1a13be[_0xf9e5('0x39')],{'$or':_[_0xf9e5('0x2b')](_0x1a13be[_0xf9e5('0x33')],function(_0x39e836){var _0x266301={};_0x266301[_0x39e836]={'$like':'%'+_0x5a31a9[_0xf9e5('0x31')][_0xf9e5('0x3c')]+'%'};return _0x266301;})});}_0x1a13be=_[_0xf9e5('0x3a')]({},_0x1a13be,_0x5a31a9[_0xf9e5('0x3d')]);return db[_0xf9e5('0x5b')][_0xf9e5('0x18')]({'where':_0x1a13be[_0xf9e5('0x39')]})[_0xf9e5('0x21')](function(_0x51ea3a){_0x358ced[_0xf9e5('0x18')]=_0x51ea3a;if(_0x5a31a9[_0xf9e5('0x31')]['includeAll']){_0x1a13be[_0xf9e5('0x3f')]=[{'all':!![]}];}return db[_0xf9e5('0x5b')][_0xf9e5('0x40')](_0x1a13be);})['then'](function(_0x4a3468){_0x358ced[_0xf9e5('0x41')]=_0x4a3468;return _0x358ced;});}})[_0xf9e5('0x21')](respondWithFilteredResult(_0x6e3f2a,_0x1a13be))[_0xf9e5('0x42')](handleError(_0x6e3f2a,null));};exports[_0xf9e5('0x5c')]=function(_0x34b3c3,_0x54e690,_0x4ca714){var _0x307b54={'raw':!![],'where':{}};var _0x5599e9={};var _0x321114={'count':0x0,'rows':[]};return db[_0xf9e5('0x2c')]['findOne']({'where':{'id':_0x34b3c3[_0xf9e5('0x44')]['id']}})['then'](handleEntityNotFound(_0x54e690,null))[_0xf9e5('0x21')](function(_0x29013f){if(_0x29013f){_0x5599e9[_0xf9e5('0x2f')]=_['keys'](db[_0xf9e5('0x5d')][_0xf9e5('0x45')]);_0x5599e9[_0xf9e5('0x31')]=_['keys'](_0x34b3c3['query']);_0x5599e9[_0xf9e5('0x32')]=_[_0xf9e5('0x34')](_0x5599e9[_0xf9e5('0x2f')],_0x5599e9[_0xf9e5('0x31')]);_0x307b54[_0xf9e5('0x33')]=_['intersection'](_0x5599e9[_0xf9e5('0x2f')],qs[_0xf9e5('0x35')](_0x34b3c3['query']['fields']));_0x307b54[_0xf9e5('0x33')]=_0x307b54[_0xf9e5('0x33')][_0xf9e5('0x46')]?_0x307b54['attributes']:_0x5599e9['model'];if(!_0x34b3c3[_0xf9e5('0x31')][_0xf9e5('0x36')]('nolimit')){_0x307b54[_0xf9e5('0x1a')]=qs[_0xf9e5('0x1a')](_0x34b3c3[_0xf9e5('0x31')][_0xf9e5('0x1a')]);_0x307b54[_0xf9e5('0x19')]=qs['offset'](_0x34b3c3[_0xf9e5('0x31')][_0xf9e5('0x19')]);}_0x307b54[_0xf9e5('0x55')]=qs[_0xf9e5('0x37')](_0x34b3c3[_0xf9e5('0x31')][_0xf9e5('0x37')]);_0x307b54[_0xf9e5('0x39')]=qs[_0xf9e5('0x32')](_[_0xf9e5('0x38')](_0x34b3c3[_0xf9e5('0x31')],_0x5599e9[_0xf9e5('0x32')]));_0x307b54[_0xf9e5('0x39')][_0xf9e5('0x56')]=_0x29013f['id'];if(_0x34b3c3[_0xf9e5('0x31')][_0xf9e5('0x3c')]){_0x307b54[_0xf9e5('0x39')]=_[_0xf9e5('0x3a')](_0x307b54[_0xf9e5('0x39')],{'$or':_[_0xf9e5('0x2b')](_0x307b54['attributes'],function(_0x1de1eb){var _0x981c86={};_0x981c86[_0x1de1eb]={'$like':'%'+_0x34b3c3[_0xf9e5('0x31')][_0xf9e5('0x3c')]+'%'};return _0x981c86;})});}_0x307b54=_[_0xf9e5('0x3a')]({},_0x307b54,_0x34b3c3[_0xf9e5('0x3d')]);return db['CmHopperBlack']['count']({'where':_0x307b54['where']})[_0xf9e5('0x21')](function(_0x343b4f){_0x321114[_0xf9e5('0x18')]=_0x343b4f;if(_0x34b3c3['query'][_0xf9e5('0x3e')]){_0x307b54[_0xf9e5('0x3f')]=[{'all':!![]}];}return db[_0xf9e5('0x5d')][_0xf9e5('0x40')](_0x307b54);})['then'](function(_0x1fa977){_0x321114[_0xf9e5('0x41')]=_0x1fa977;return _0x321114;});}})[_0xf9e5('0x21')](respondWithFilteredResult(_0x54e690,_0x307b54))[_0xf9e5('0x42')](handleError(_0x54e690,null));};exports[_0xf9e5('0x5e')]=function(_0x41e09e,_0x17deff,_0x39cd02){var _0x1f62c1={};var _0x260ed1={};var _0x466734;var _0x4f0b7e;return db[_0xf9e5('0x2c')][_0xf9e5('0x57')]({'where':{'id':_0x41e09e['params']['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x17deff,null))[_0xf9e5('0x21')](function(_0x49e539){if(_0x49e539){_0x466734=_0x49e539;_0x260ed1[_0xf9e5('0x2f')]=_['keys'](db[_0xf9e5('0x5f')]['rawAttributes']);_0x260ed1['query']=_['keys'](_0x41e09e[_0xf9e5('0x31')]);_0x260ed1[_0xf9e5('0x32')]=_['intersection'](_0x260ed1[_0xf9e5('0x2f')],_0x260ed1[_0xf9e5('0x31')]);_0x1f62c1[_0xf9e5('0x33')]=_[_0xf9e5('0x34')](_0x260ed1[_0xf9e5('0x2f')],qs[_0xf9e5('0x35')](_0x41e09e['query'][_0xf9e5('0x35')]));_0x1f62c1[_0xf9e5('0x33')]=_0x1f62c1['attributes'][_0xf9e5('0x46')]?_0x1f62c1[_0xf9e5('0x33')]:_0x260ed1[_0xf9e5('0x2f')];_0x1f62c1[_0xf9e5('0x55')]=qs['sort'](_0x41e09e[_0xf9e5('0x31')][_0xf9e5('0x37')]);_0x1f62c1['where']=qs[_0xf9e5('0x32')](_[_0xf9e5('0x38')](_0x41e09e['query'],_0x260ed1[_0xf9e5('0x32')]));if(_0x41e09e[_0xf9e5('0x31')]['filter']){_0x1f62c1[_0xf9e5('0x39')]=_[_0xf9e5('0x3a')](_0x1f62c1[_0xf9e5('0x39')],{'$or':_[_0xf9e5('0x2b')](_0x1f62c1['attributes'],function(_0x1ae5a5){var _0x366ea9={};_0x366ea9[_0x1ae5a5]={'$like':'%'+_0x41e09e['query'][_0xf9e5('0x3c')]+'%'};return _0x366ea9;})});}_0x1f62c1=_[_0xf9e5('0x3a')]({},_0x1f62c1,_0x41e09e[_0xf9e5('0x3d')]);return _0x466734['getLists'](_0x1f62c1);}})[_0xf9e5('0x21')](function(_0x33b555){if(_0x33b555){_0x4f0b7e=_0x33b555[_0xf9e5('0x46')];if(!_0x41e09e['query'][_0xf9e5('0x36')](_0xf9e5('0x59'))){_0x1f62c1['limit']=qs[_0xf9e5('0x1a')](_0x41e09e[_0xf9e5('0x31')][_0xf9e5('0x1a')]);_0x1f62c1[_0xf9e5('0x19')]=qs[_0xf9e5('0x19')](_0x41e09e[_0xf9e5('0x31')][_0xf9e5('0x19')]);}return _0x466734[_0xf9e5('0x5e')](_0x1f62c1);}})[_0xf9e5('0x21')](function(_0x5974d7){if(_0x5974d7){return _0x5974d7?{'count':_0x4f0b7e,'rows':_0x5974d7}:null;}})[_0xf9e5('0x21')](respondWithResult(_0x17deff,null))['catch'](handleError(_0x17deff,null));};exports[_0xf9e5('0x60')]=function(_0x1619d8,_0x248fb8,_0x5b967a){var _0x474345,_0x238396;return db[_0xf9e5('0x2c')][_0xf9e5('0x4d')]({'where':{'id':_0x1619d8[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x248fb8,null))[_0xf9e5('0x21')](function(_0x207ed0){if(_0x207ed0){_0x238396=_0x207ed0;return _0x207ed0[_0xf9e5('0x60')](_0x1619d8[_0xf9e5('0x48')][_0xf9e5('0x61')],_[_0xf9e5('0x51')](_0x1619d8[_0xf9e5('0x48')],[_0xf9e5('0x61'),'id'])||{});}return null;})[_0xf9e5('0x62')](function(_0x3e785c){var _0x2957ed;_0x474345=_0x3e785c||[];var _0x5c373a=[];if(_0x3e785c){for(var _0x49fdd5=0x0;_0x49fdd5<_0x3e785c[_0xf9e5('0x46')];_0x49fdd5+=0x1){var _0x42185f=_0x3e785c[_0x49fdd5][_0xf9e5('0x23')]({'plain':!![]});_0x238396['dialCheckDuplicateType']=_0x1619d8[_0xf9e5('0x48')][_0xf9e5('0x63')]?_0x1619d8[_0xf9e5('0x48')]['dialCheckDuplicateType']:_0x238396[_0xf9e5('0x63')];switch(_0x238396[_0xf9e5('0x63')]){case _0xf9e5('0x64'):_0x2957ed=squel[_0xf9e5('0x65')]()['into']('cm_hopper')[_0xf9e5('0x66')]([_0xf9e5('0x67'),_0xf9e5('0x68'),_0xf9e5('0x69'),_0xf9e5('0x6a'),_0xf9e5('0x56'),_0xf9e5('0x52'),_0xf9e5('0x53')],squel[_0xf9e5('0x6b')]()['field'](_0xf9e5('0x67'),_0xf9e5('0x67'))['field'](_0xf9e5('0x6c'),'scheduledAt')[_0xf9e5('0x6d')]('id',_0xf9e5('0x69'))[_0xf9e5('0x6d')](_0x42185f[_0xf9e5('0x6e')][_0xf9e5('0x6f')](),_0xf9e5('0x6a'))[_0xf9e5('0x6d')](_0x1619d8[_0xf9e5('0x44')]['id'][_0xf9e5('0x6f')](),_0xf9e5('0x56'))[_0xf9e5('0x6d')](_0xf9e5('0x6c'),_0xf9e5('0x52'))[_0xf9e5('0x6d')](_0xf9e5('0x6c'),_0xf9e5('0x53'))['from'](_0xf9e5('0x70'))[_0xf9e5('0x39')](_0xf9e5('0x71'))['where'](_0xf9e5('0x72'),_0x42185f[_0xf9e5('0x6e')]['toString']())[_0xf9e5('0x39')](_0xf9e5('0x73'))[_0xf9e5('0x39')](_0xf9e5('0x74'),squel[_0xf9e5('0x6b')]()['field'](_0xf9e5('0x75'))['from']('cm_hopper_final')[_0xf9e5('0x39')]('CampaignId\x20=\x20?',_0x1619d8[_0xf9e5('0x44')]['id'][_0xf9e5('0x6f')]()))[_0xf9e5('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xf9e5('0x6b')]()['field'](_0xf9e5('0x76'))[_0xf9e5('0x77')](_0xf9e5('0x78'))['where'](_0xf9e5('0x79'),_0x1619d8['params']['id'][_0xf9e5('0x6f')]())))[_0xf9e5('0x6f')]();break;case _0xf9e5('0x7a'):_0x2957ed=squel[_0xf9e5('0x65')]()['into'](_0xf9e5('0x78'))['fromQuery']([_0xf9e5('0x67'),_0xf9e5('0x68'),_0xf9e5('0x69'),_0xf9e5('0x6a'),'CampaignId',_0xf9e5('0x52'),_0xf9e5('0x53')],squel[_0xf9e5('0x6b')]()[_0xf9e5('0x6d')](_0xf9e5('0x67'),_0xf9e5('0x67'))[_0xf9e5('0x6d')](_0xf9e5('0x6c'),'scheduledAt')[_0xf9e5('0x6d')]('id',_0xf9e5('0x69'))[_0xf9e5('0x6d')](_0x42185f[_0xf9e5('0x6e')]['toString'](),_0xf9e5('0x6a'))[_0xf9e5('0x6d')](_0x1619d8[_0xf9e5('0x44')]['id'][_0xf9e5('0x6f')](),'CampaignId')[_0xf9e5('0x6d')](_0xf9e5('0x6c'),'createdAt')['field'](_0xf9e5('0x6c'),_0xf9e5('0x53'))['from']('cm_contacts')[_0xf9e5('0x39')](_0xf9e5('0x71'))[_0xf9e5('0x39')](_0xf9e5('0x72'),_0x42185f[_0xf9e5('0x6e')][_0xf9e5('0x6f')]())[_0xf9e5('0x39')](_0xf9e5('0x73'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0xf9e5('0x6b')]()['field']('COALESCE(phone,\x27\x27)')[_0xf9e5('0x77')](_0xf9e5('0x78'))[_0xf9e5('0x39')](_0xf9e5('0x79'),_0x1619d8[_0xf9e5('0x44')]['id'][_0xf9e5('0x6f')]())))['toString']();break;default:_0x2957ed=squel[_0xf9e5('0x65')]()[_0xf9e5('0x7b')](_0xf9e5('0x78'))['fromQuery']([_0xf9e5('0x67'),'scheduledAt','ContactId',_0xf9e5('0x6a'),'CampaignId',_0xf9e5('0x52'),_0xf9e5('0x53')],squel[_0xf9e5('0x6b')]()[_0xf9e5('0x6d')]('phone',_0xf9e5('0x67'))[_0xf9e5('0x6d')](_0xf9e5('0x6c'),_0xf9e5('0x68'))[_0xf9e5('0x6d')]('id',_0xf9e5('0x69'))['field'](_0x42185f[_0xf9e5('0x6e')]['toString'](),_0xf9e5('0x6a'))[_0xf9e5('0x6d')](_0x1619d8[_0xf9e5('0x44')]['id'][_0xf9e5('0x6f')](),'CampaignId')['field'](_0xf9e5('0x6c'),_0xf9e5('0x52'))[_0xf9e5('0x6d')]('NOW()',_0xf9e5('0x53'))[_0xf9e5('0x77')](_0xf9e5('0x70'))[_0xf9e5('0x39')](_0xf9e5('0x71'))[_0xf9e5('0x39')](_0xf9e5('0x72'),_0x42185f[_0xf9e5('0x6e')][_0xf9e5('0x6f')]())[_0xf9e5('0x39')](_0xf9e5('0x73')))[_0xf9e5('0x6f')]();}_0x5c373a[_0xf9e5('0x7c')](db[_0xf9e5('0x7d')]['query'](_0x2957ed));}return BPromise[_0xf9e5('0x7e')](_0x5c373a);}})['then'](function(){return _0x474345;})['then'](respondWithResult(_0x248fb8,null))['catch'](handleError(_0x248fb8,null));};exports[_0xf9e5('0x7f')]=function(_0xa495bb,_0x529e55,_0x2a24c2){return db['Campaign'][_0xf9e5('0x4d')]({'where':{'id':_0xa495bb[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x529e55,null))['then'](function(_0x322a52){if(_0x322a52){return _0x322a52['removeLists'](_0xa495bb[_0xf9e5('0x31')]['ids']);}})[_0xf9e5('0x21')](function(_0x4ed0d2){if(_0x4ed0d2){return db[_0xf9e5('0x80')]['destroy']({'where':{'ListId':_0xa495bb['query']['ids'],'CampaignId':_0xa495bb['params']['id']}})[_0xf9e5('0x21')](function(){return _0x4ed0d2;});}})[_0xf9e5('0x21')](respondWithStatusCode(_0x529e55,null))[_0xf9e5('0x42')](handleError(_0x529e55,null));};exports['getBlackLists']=function(_0x590b1f,_0x1cd302,_0x4acd72){var _0x143eda={'raw':!![],'where':{}};var _0x10f24f={};var _0x6331b1={'count':0x0,'rows':[]};return db[_0xf9e5('0x2c')][_0xf9e5('0x57')]({'where':{'id':_0x590b1f[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x1cd302,null))[_0xf9e5('0x21')](function(_0x36adc9){if(_0x36adc9){_0x10f24f['model']=_['keys'](db[_0xf9e5('0x5f')][_0xf9e5('0x45')]);_0x10f24f[_0xf9e5('0x31')]=_[_0xf9e5('0x30')](_0x590b1f[_0xf9e5('0x31')]);_0x10f24f['filters']=_[_0xf9e5('0x34')](_0x10f24f[_0xf9e5('0x2f')],_0x10f24f[_0xf9e5('0x31')]);_0x143eda[_0xf9e5('0x33')]=_[_0xf9e5('0x34')](_0x10f24f[_0xf9e5('0x2f')],qs[_0xf9e5('0x35')](_0x590b1f[_0xf9e5('0x31')][_0xf9e5('0x35')]));_0x143eda[_0xf9e5('0x33')]=_0x143eda[_0xf9e5('0x33')][_0xf9e5('0x46')]?_0x143eda[_0xf9e5('0x33')]:_0x10f24f[_0xf9e5('0x2f')];if(!_0x590b1f['query'][_0xf9e5('0x36')](_0xf9e5('0x59'))){_0x143eda[_0xf9e5('0x1a')]=qs[_0xf9e5('0x1a')](_0x590b1f['query'][_0xf9e5('0x1a')]);_0x143eda[_0xf9e5('0x19')]=qs[_0xf9e5('0x19')](_0x590b1f[_0xf9e5('0x31')][_0xf9e5('0x19')]);}_0x143eda[_0xf9e5('0x55')]=qs[_0xf9e5('0x37')](_0x590b1f['query'][_0xf9e5('0x37')]);_0x143eda[_0xf9e5('0x39')]=qs[_0xf9e5('0x32')](_[_0xf9e5('0x38')](_0x590b1f[_0xf9e5('0x31')],_0x10f24f['filters']));_0x143eda[_0xf9e5('0x39')]['CampaignId']=_0x36adc9['id'];if(_0x590b1f[_0xf9e5('0x31')][_0xf9e5('0x3c')]){_0x143eda[_0xf9e5('0x39')]=_[_0xf9e5('0x3a')](_0x143eda['where'],{'$or':_[_0xf9e5('0x2b')](_0x143eda[_0xf9e5('0x33')],function(_0x16c753){var _0x25b9a2={};_0x25b9a2[_0x16c753]={'$like':'%'+_0x590b1f[_0xf9e5('0x31')][_0xf9e5('0x3c')]+'%'};return _0x25b9a2;})});}_0x143eda=_[_0xf9e5('0x3a')]({},_0x143eda,_0x590b1f[_0xf9e5('0x3d')]);return db[_0xf9e5('0x5f')][_0xf9e5('0x18')]({'where':_0x143eda['where']})['then'](function(_0x3f51c6){_0x6331b1['count']=_0x3f51c6;if(_0x590b1f[_0xf9e5('0x31')]['includeAll']){_0x143eda['include']=[{'all':!![]}];}return db[_0xf9e5('0x5f')][_0xf9e5('0x40')](_0x143eda);})[_0xf9e5('0x21')](function(_0x3347dd){_0x6331b1[_0xf9e5('0x41')]=_0x3347dd;return _0x6331b1;});}})[_0xf9e5('0x21')](respondWithFilteredResult(_0x1cd302,_0x143eda))[_0xf9e5('0x42')](handleError(_0x1cd302,null));};exports[_0xf9e5('0x81')]=function(_0x5888da,_0x10b845,_0xef6f18){var _0xdbea0b,_0x503aa1;return db[_0xf9e5('0x2c')][_0xf9e5('0x4d')]({'where':{'id':_0x5888da[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](handleEntityNotFound(_0x10b845,null))[_0xf9e5('0x21')](function(_0x128e38){if(_0x128e38){_0x503aa1=_0x128e38;return _0x128e38['addBlackLists'](_0x5888da['body'][_0xf9e5('0x61')],_[_0xf9e5('0x51')](_0x5888da[_0xf9e5('0x48')],[_0xf9e5('0x61'),'id'])||{});}return null;})[_0xf9e5('0x62')](function(_0x256506){var _0x49e1b3;_0xdbea0b=_0x256506||[];var _0x2c6065=[];if(_0x256506){for(var _0x385fa6=0x0;_0x385fa6<_0x256506[_0xf9e5('0x46')];_0x385fa6+=0x1){var _0x2f092c=_0x256506[_0x385fa6][_0xf9e5('0x23')]({'plain':!![]});_0x49e1b3=squel[_0xf9e5('0x65')]()['into'](_0xf9e5('0x82'))['fromQuery']([_0xf9e5('0x67'),'ContactId',_0xf9e5('0x6a'),_0xf9e5('0x56'),_0xf9e5('0x52'),_0xf9e5('0x53')],squel[_0xf9e5('0x6b')]()[_0xf9e5('0x6d')](_0xf9e5('0x67'),'phone')[_0xf9e5('0x6d')]('id',_0xf9e5('0x69'))[_0xf9e5('0x6d')](_0x2f092c[_0xf9e5('0x6e')]['toString'](),_0xf9e5('0x6a'))['field'](_0x5888da[_0xf9e5('0x44')]['id'][_0xf9e5('0x6f')](),_0xf9e5('0x56'))[_0xf9e5('0x6d')](_0xf9e5('0x6c'),_0xf9e5('0x52'))['field']('NOW()',_0xf9e5('0x53'))[_0xf9e5('0x77')](_0xf9e5('0x70'))[_0xf9e5('0x39')](_0xf9e5('0x71'))[_0xf9e5('0x39')]('ListId\x20=\x20?',_0x2f092c['CmListId'][_0xf9e5('0x6f')]())[_0xf9e5('0x39')](_0xf9e5('0x73')))[_0xf9e5('0x6f')]();_0x2c6065[_0xf9e5('0x7c')](db[_0xf9e5('0x7d')][_0xf9e5('0x31')](_0x49e1b3));}return BPromise['all'](_0x2c6065);}})['then'](function(){return _0xdbea0b;})[_0xf9e5('0x21')](respondWithResult(_0x10b845,null))[_0xf9e5('0x42')](handleError(_0x10b845,null));};exports[_0xf9e5('0x83')]=function(_0x453909,_0x229b85,_0x4f126b){return db[_0xf9e5('0x2c')][_0xf9e5('0x4d')]({'where':{'id':_0x453909[_0xf9e5('0x44')]['id']}})['then'](handleEntityNotFound(_0x229b85,null))[_0xf9e5('0x21')](function(_0x237114){if(_0x237114){return _0x237114['removeBlackLists'](_0x453909['query']['ids']);}})[_0xf9e5('0x21')](function(_0x525c1b){if(_0x525c1b){return db[_0xf9e5('0x5d')][_0xf9e5('0x22')]({'where':{'ListId':_0x453909['query'][_0xf9e5('0x61')],'CampaignId':_0x453909[_0xf9e5('0x44')]['id']}})[_0xf9e5('0x21')](function(){return _0x525c1b;});}})[_0xf9e5('0x21')](respondWithStatusCode(_0x229b85,null))[_0xf9e5('0x42')](handleError(_0x229b85,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 63721ca..5c3561c 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 _0x719e=['../../config/logger','api','moment','path','rimraf','./campaign.attributes','define','lodash','util'];(function(_0x527707,_0x2ed190){var _0x9dce9f=function(_0x4bb94d){while(--_0x4bb94d){_0x527707['push'](_0x527707['shift']());}};_0x9dce9f(++_0x2ed190);}(_0x719e,0x103));var _0xe719=function(_0x19a0bc,_0x2f7125){_0x19a0bc=_0x19a0bc-0x0;var _0x4d6c30=_0x719e[_0x19a0bc];return _0x4d6c30;};'use strict';var _=require(_0xe719('0x0'));var util=require(_0xe719('0x1'));var logger=require(_0xe719('0x2'))(_0xe719('0x3'));var moment=require(_0xe719('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe719('0x5'));var rimraf=require(_0xe719('0x6'));var config=require('../../config/environment');var attributes=require(_0xe719('0x7'));module['exports']=function(_0x5460da,_0x5dafd7){return _0x5460da[_0xe719('0x8')]('Campaign',attributes,{'tableName':'campaigns','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb214=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign'];(function(_0x564454,_0x30682d){var _0xe9ab45=function(_0x17e40c){while(--_0x17e40c){_0x564454['push'](_0x564454['shift']());}};_0xe9ab45(++_0x30682d);}(_0xb214,0x1dc));var _0x4b21=function(_0x1a0a63,_0x4b736e){_0x1a0a63=_0x1a0a63-0x0;var _0x4a68dc=_0xb214[_0x1a0a63];return _0x4a68dc;};'use strict';var _=require(_0x4b21('0x0'));var util=require(_0x4b21('0x1'));var logger=require(_0x4b21('0x2'))(_0x4b21('0x3'));var moment=require(_0x4b21('0x4'));var BPromise=require(_0x4b21('0x5'));var rp=require(_0x4b21('0x6'));var fs=require('fs');var path=require(_0x4b21('0x7'));var rimraf=require(_0x4b21('0x8'));var config=require(_0x4b21('0x9'));var attributes=require(_0x4b21('0xa'));module[_0x4b21('0xb')]=function(_0x1dff4f,_0x1e304c){return _0x1dff4f[_0x4b21('0xc')](_0x4b21('0xd'),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 160932d..cedefa3 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(_0x10085d,_0x2302c0){var _0x34bb92=function(_0x3c02f3){while(--_0x3c02f3){_0x10085d['push'](_0x10085d['shift']());}};_0x34bb92(++_0x2302c0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0xa9e0[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['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 _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4a560c,_0xc4531d){var _0x384626=function(_0x4b626e){while(--_0x4b626e){_0x4a560c['push'](_0x4a560c['shift']());}};_0x384626(++_0xc4531d);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 691e78f..e538d9f 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 _0xa38c=['getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','put','/:id','update','destroy','delete','removeLists','/:id/blacklists','removeBlackLists','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists'];(function(_0x247064,_0x471718){var _0x287b72=function(_0x857a3e){while(--_0x857a3e){_0x247064['push'](_0x247064['shift']());}};_0x287b72(++_0x471718);}(_0xa38c,0x1bd));var _0xca38=function(_0x191917,_0x552ff4){_0x191917=_0x191917-0x0;var _0x52a7ec=_0xa38c[_0x191917];return _0x52a7ec;};'use strict';var multer=require(_0xca38('0x0'));var util=require(_0xca38('0x1'));var path=require('path');var timeout=require(_0xca38('0x2'));var express=require(_0xca38('0x3'));var router=express[_0xca38('0x4')]();var auth=require(_0xca38('0x5'));var interaction=require(_0xca38('0x6'));var config=require(_0xca38('0x7'));var controller=require(_0xca38('0x8'));router[_0xca38('0x9')]('/',auth[_0xca38('0xa')](),controller[_0xca38('0xb')]);router[_0xca38('0x9')]('/:id',auth[_0xca38('0xa')](),controller[_0xca38('0xc')]);router[_0xca38('0x9')](_0xca38('0xd'),auth[_0xca38('0xa')](),controller[_0xca38('0xe')]);router[_0xca38('0x9')](_0xca38('0xf'),auth['isAuthenticated'](),controller[_0xca38('0x10')]);router[_0xca38('0x9')](_0xca38('0x11'),auth['isAuthenticated'](),controller[_0xca38('0x12')]);router[_0xca38('0x9')](_0xca38('0x13'),auth['isAuthenticated'](),controller[_0xca38('0x14')]);router[_0xca38('0x9')](_0xca38('0x15'),auth[_0xca38('0xa')](),controller[_0xca38('0x16')]);router[_0xca38('0x9')]('/:id/blacklists',auth[_0xca38('0xa')](),controller[_0xca38('0x17')]);router[_0xca38('0x18')]('/',auth[_0xca38('0xa')](),controller[_0xca38('0x19')]);router[_0xca38('0x18')](_0xca38('0x1a'),auth['isAuthenticated'](),controller[_0xca38('0x1b')]);router['post'](_0xca38('0x15'),auth[_0xca38('0xa')](),controller[_0xca38('0x1c')]);router[_0xca38('0x18')]('/:id/blacklists',auth[_0xca38('0xa')](),controller[_0xca38('0x1d')]);router[_0xca38('0x1e')](_0xca38('0x1f'),auth['isAuthenticated'](),controller[_0xca38('0x20')]);router['delete'](_0xca38('0x1f'),auth[_0xca38('0xa')](),controller[_0xca38('0x21')]);router[_0xca38('0x22')](_0xca38('0x15'),auth['isAuthenticated'](),controller[_0xca38('0x23')]);router[_0xca38('0x22')](_0xca38('0x24'),auth[_0xca38('0xa')](),controller[_0xca38('0x25')]);module[_0xca38('0x26')]=router; \ No newline at end of file +var _0x7366=['removeBlackLists','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/hoppers','/:id/hopper_histories','getHopperFinals','/:id/hopper_black','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','/:id/lists','put','update','delete','destroy','removeLists'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x7366,0x9d));var _0x6736=function(_0x1b85d5,_0xd48ca0){_0x1b85d5=_0x1b85d5-0x0;var _0x1c7938=_0x7366[_0x1b85d5];return _0x1c7938;};'use strict';var multer=require(_0x6736('0x0'));var util=require(_0x6736('0x1'));var path=require(_0x6736('0x2'));var timeout=require(_0x6736('0x3'));var express=require(_0x6736('0x4'));var router=express[_0x6736('0x5')]();var auth=require(_0x6736('0x6'));var interaction=require(_0x6736('0x7'));var config=require(_0x6736('0x8'));var controller=require('./campaign.controller');router[_0x6736('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6736('0x9')](_0x6736('0xa'),auth[_0x6736('0xb')](),controller['show']);router[_0x6736('0x9')](_0x6736('0xc'),auth[_0x6736('0xb')](),controller['getHoppers']);router[_0x6736('0x9')](_0x6736('0xd'),auth[_0x6736('0xb')](),controller['getHopperHistories']);router[_0x6736('0x9')]('/:id/hopper_finals',auth[_0x6736('0xb')](),controller[_0x6736('0xe')]);router['get'](_0x6736('0xf'),auth[_0x6736('0xb')](),controller['getHopperBlacks']);router['get']('/:id/lists',auth[_0x6736('0xb')](),controller[_0x6736('0x10')]);router[_0x6736('0x9')](_0x6736('0x11'),auth[_0x6736('0xb')](),controller[_0x6736('0x12')]);router[_0x6736('0x13')]('/',auth[_0x6736('0xb')](),controller[_0x6736('0x14')]);router[_0x6736('0x13')](_0x6736('0x15'),auth[_0x6736('0xb')](),controller[_0x6736('0x16')]);router[_0x6736('0x13')](_0x6736('0x17'),auth[_0x6736('0xb')](),controller['addLists']);router[_0x6736('0x13')](_0x6736('0x11'),auth[_0x6736('0xb')](),controller['addBlackLists']);router[_0x6736('0x18')]('/:id',auth[_0x6736('0xb')](),controller[_0x6736('0x19')]);router[_0x6736('0x1a')](_0x6736('0xa'),auth[_0x6736('0xb')](),controller[_0x6736('0x1b')]);router['delete']('/:id/lists',auth[_0x6736('0xb')](),controller[_0x6736('0x1c')]);router[_0x6736('0x1a')](_0x6736('0x11'),auth[_0x6736('0xb')](),controller[_0x6736('0x1d')]);module[_0x6736('0x1e')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index ae9e0c5..f55f87e 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 _0x8a61=['STRING','TEXT','VIRTUAL','getDataValue','sequelize','exports'];(function(_0x4afac5,_0x1ab4ed){var _0x2404b3=function(_0x5c700b){while(--_0x5c700b){_0x4afac5['push'](_0x4afac5['shift']());}};_0x2404b3(++_0x1ab4ed);}(_0x8a61,0x1d8));var _0x18a6=function(_0x56f334,_0x2a355f){_0x56f334=_0x56f334-0x0;var _0xa583b0=_0x8a61[_0x56f334];return _0xa583b0;};'use strict';var Sequelize=require(_0x18a6('0x0'));module[_0x18a6('0x1')]={'key':{'type':Sequelize[_0x18a6('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x18a6('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x18a6('0x4')],'get':function(){return this[_0x18a6('0x5')]('key');}}}; \ No newline at end of file +var _0x009f=['exports','STRING','TEXT','VIRTUAL','getDataValue','sequelize'];(function(_0x21e9c8,_0x160840){var _0x273afd=function(_0x31d5ff){while(--_0x31d5ff){_0x21e9c8['push'](_0x21e9c8['shift']());}};_0x273afd(++_0x160840);}(_0x009f,0xf5));var _0xf009=function(_0x334f9a,_0x542f01){_0x334f9a=_0x334f9a-0x0;var _0x2b219d=_0x009f[_0x334f9a];return _0x2b219d;};'use strict';var Sequelize=require(_0xf009('0x0'));module[_0xf009('0x1')]={'key':{'type':Sequelize[_0xf009('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0xf009('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0xf009('0x2')]},'name':{'type':Sequelize[_0xf009('0x4')],'get':function(){return this[_0xf009('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 01c46de..d176b5b 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 _0x34e8=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','sendStatus','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x269009,_0x66face){var _0x26c217=function(_0x3ee51a){while(--_0x3ee51a){_0x269009['push'](_0x269009['shift']());}};_0x26c217(++_0x66face);}(_0x34e8,0x12c));var _0x834e=function(_0x1e0d14,_0x2f6e0b){_0x1e0d14=_0x1e0d14-0x0;var _0xfd8309=_0x34e8[_0x1e0d14];return _0xfd8309;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){var _0x34563b=_0x5c55ca['get']({'plain':!![]});var _0x25ee1d=_0x834e('0x29');return db['UserProfileResource'][_0x834e('0x2a')]({'where':{'type':_0x25ee1d,'resourceId':_0x34563b['id']}})[_0x834e('0x28')](function(){return _0x5c55ca;});})[_0x834e('0x28')](function(){_0x28d687['status'](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x3e310f[_0x834e('0x2b')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x2c')](_0x3f1b0b[_0x834e('0x2d')]);if(_0x3f1b0b[_0x834e('0x2e')]){delete _0x3f1b0b[_0x834e('0x2e')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={},_0x106d6a={},_0x5dacc1={'count':0x0,'rows':[]};var _0xb5bc06=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x4551f5){return{'name':_0x4551f5[_0x834e('0x32')],'type':_0x4551f5[_0x834e('0x33')][_0x834e('0x34')]};});_0x106d6a[_0x834e('0x35')]=_['map'](_0xb5bc06,_0x834e('0x2e'));_0x106d6a['query']=_[_0x834e('0x36')](_0x58c1d7[_0x834e('0x37')]);_0x106d6a[_0x834e('0x38')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],_0x106d6a[_0x834e('0x37')]);_0x567cea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x58c1d7['query'][_0x834e('0x3b')]));_0x567cea[_0x834e('0x3a')]=_0x567cea[_0x834e('0x3a')][_0x834e('0x3c')]?_0x567cea['attributes']:_0x106d6a[_0x834e('0x35')];if(!_0x58c1d7[_0x834e('0x37')]['hasOwnProperty']('nolimit')){_0x567cea['limit']=qs[_0x834e('0x22')](_0x58c1d7[_0x834e('0x37')][_0x834e('0x22')]);_0x567cea[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x58c1d7[_0x834e('0x37')]['offset']);}_0x567cea[_0x834e('0x3d')]=qs['sort'](_0x58c1d7[_0x834e('0x37')][_0x834e('0x3e')]);_0x567cea['where']=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x58c1d7['query'],_0x106d6a['filters']));if(_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]){_0x567cea[_0x834e('0x41')]=_[_0x834e('0x42')](_0x567cea[_0x834e('0x41')],{'$or':_['map'](_0xb5bc06,function(_0x1c5ed6){if(_0x1c5ed6['type']!=='VIRTUAL'){var _0x1b2edf={};_0x1b2edf[_0x1c5ed6['name']]={'$like':'%'+_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x1b2edf;}})});}_0x567cea=_[_0x834e('0x42')]({},_0x567cea,_0x58c1d7[_0x834e('0x43')]);var _0x2b7933={'where':_0x567cea['where']};return db[_0x834e('0x30')][_0x834e('0x20')](_0x2b7933)[_0x834e('0x28')](function(_0x58c5fb){_0x5dacc1[_0x834e('0x20')]=_0x58c5fb;if(_0x58c1d7[_0x834e('0x37')]['includeAll']){_0x567cea[_0x834e('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x834e('0x45')](_0x567cea);})[_0x834e('0x28')](function(_0x4a18bb){_0x5dacc1['rows']=_0x4a18bb;return _0x5dacc1;})[_0x834e('0x28')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x46')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x47')]=function(_0xbc1571,_0x8ad264){var _0x23feea={'raw':!![],'where':{'id':_0xbc1571['params']['id']}},_0x195204={};_0x195204[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x195204[_0x834e('0x37')]=_['keys'](_0xbc1571[_0x834e('0x37')]);_0x195204[_0x834e('0x38')]=_['intersection'](_0x195204[_0x834e('0x35')],_0x195204[_0x834e('0x37')]);_0x23feea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x195204[_0x834e('0x35')],qs[_0x834e('0x3b')](_0xbc1571[_0x834e('0x37')][_0x834e('0x3b')]));_0x23feea[_0x834e('0x3a')]=_0x23feea[_0x834e('0x3a')]['length']?_0x23feea[_0x834e('0x3a')]:_0x195204[_0x834e('0x35')];if(_0xbc1571['query'][_0x834e('0x48')]){_0x23feea[_0x834e('0x44')]=[{'all':!![]}];}_0x23feea=_[_0x834e('0x42')]({},_0x23feea,_0xbc1571[_0x834e('0x43')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x23feea)['then'](handleEntityNotFound(_0x8ad264,null))['then'](respondWithResult(_0x8ad264,null))[_0x834e('0x46')](handleError(_0x8ad264,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4a')]['id']){delete _0x30568e[_0x834e('0x4a')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x30568e[_0x834e('0x4b')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x2a')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1a3855[_0x834e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x46')](handleError(_0x3df078,null));};exports['create']=function(_0x3c00a3,_0x3b0988){var _0x55d491={'key':_0x3c00a3[_0x834e('0x4a')][_0x834e('0x34')]};if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')]){_0x55d491[_0x834e('0x4c')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')];}else if(_0x3c00a3['body'][_0x834e('0x4d')]){_0x55d491[_0x834e('0x4d')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4d')];}else if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4e')]){_0x55d491[_0x834e('0x4e')]=_0x3c00a3[_0x834e('0x4a')]['OpenchannelAccountId'];}else if(_0x3c00a3[_0x834e('0x4a')]['ChatWebsiteId']){_0x55d491[_0x834e('0x4f')]=_0x3c00a3['body'][_0x834e('0x4f')];}return db['CannedAnswer']['find']({'where':_0x55d491})[_0x834e('0x28')](function(_0x3e1bee){if(_0x3e1bee){throw new db['Sequelize']['ValidationError'](_0x834e('0x50'));}return db[_0x834e('0x30')][_0x834e('0x51')](_0x3c00a3[_0x834e('0x4a')]);})[_0x834e('0x28')](function(_0x315858){var _0x3d3f2b=_0x3c00a3[_0x834e('0x52')]['get']({'plain':!![]});if(!_0x3d3f2b)throw new Error(_0x834e('0x53'));if(_0x3d3f2b[_0x834e('0x54')]==='user'){var _0x281342=_0x315858['get']({'plain':!![]});return db[_0x834e('0x55')][_0x834e('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3d3f2b[_0x834e('0x56')]},'raw':!![]})[_0x834e('0x28')](function(_0x2de29a){if(_0x2de29a&&_0x2de29a[_0x834e('0x57')]===0x0){return db['UserProfileResource'][_0x834e('0x51')]({'name':_0x281342[_0x834e('0x2e')],'resourceId':_0x281342['id'],'type':_0x2de29a[_0x834e('0x2e')],'sectionId':_0x2de29a['id']},{})['then'](function(){return _0x315858;});}else{return _0x315858;}})[_0x834e('0x46')](function(_0x1fcae9){logger[_0x834e('0x2c')](_0x834e('0x58'),_0x1fcae9);throw _0x1fcae9;});}return _0x315858;})[_0x834e('0x28')](respondWithResult(_0x3b0988,0xc9))[_0x834e('0x46')](handleError(_0x3b0988,null));}; \ No newline at end of file +var _0x34e8=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','sendStatus','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x18b840,_0x494086){var _0x37ff9c=function(_0x4b03c2){while(--_0x4b03c2){_0x18b840['push'](_0x18b840['shift']());}};_0x37ff9c(++_0x494086);}(_0x34e8,0x12c));var _0x834e=function(_0x3fa9f6,_0x467f39){_0x3fa9f6=_0x3fa9f6-0x0;var _0x493f43=_0x34e8[_0x3fa9f6];return _0x493f43;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){var _0x34563b=_0x5c55ca['get']({'plain':!![]});var _0x25ee1d=_0x834e('0x29');return db['UserProfileResource'][_0x834e('0x2a')]({'where':{'type':_0x25ee1d,'resourceId':_0x34563b['id']}})[_0x834e('0x28')](function(){return _0x5c55ca;});})[_0x834e('0x28')](function(){_0x28d687['status'](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x3e310f[_0x834e('0x2b')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x2c')](_0x3f1b0b[_0x834e('0x2d')]);if(_0x3f1b0b[_0x834e('0x2e')]){delete _0x3f1b0b[_0x834e('0x2e')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={},_0x106d6a={},_0x5dacc1={'count':0x0,'rows':[]};var _0xb5bc06=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x4551f5){return{'name':_0x4551f5[_0x834e('0x32')],'type':_0x4551f5[_0x834e('0x33')][_0x834e('0x34')]};});_0x106d6a[_0x834e('0x35')]=_['map'](_0xb5bc06,_0x834e('0x2e'));_0x106d6a['query']=_[_0x834e('0x36')](_0x58c1d7[_0x834e('0x37')]);_0x106d6a[_0x834e('0x38')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],_0x106d6a[_0x834e('0x37')]);_0x567cea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x58c1d7['query'][_0x834e('0x3b')]));_0x567cea[_0x834e('0x3a')]=_0x567cea[_0x834e('0x3a')][_0x834e('0x3c')]?_0x567cea['attributes']:_0x106d6a[_0x834e('0x35')];if(!_0x58c1d7[_0x834e('0x37')]['hasOwnProperty']('nolimit')){_0x567cea['limit']=qs[_0x834e('0x22')](_0x58c1d7[_0x834e('0x37')][_0x834e('0x22')]);_0x567cea[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x58c1d7[_0x834e('0x37')]['offset']);}_0x567cea[_0x834e('0x3d')]=qs['sort'](_0x58c1d7[_0x834e('0x37')][_0x834e('0x3e')]);_0x567cea['where']=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x58c1d7['query'],_0x106d6a['filters']));if(_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]){_0x567cea[_0x834e('0x41')]=_[_0x834e('0x42')](_0x567cea[_0x834e('0x41')],{'$or':_['map'](_0xb5bc06,function(_0x1c5ed6){if(_0x1c5ed6['type']!=='VIRTUAL'){var _0x1b2edf={};_0x1b2edf[_0x1c5ed6['name']]={'$like':'%'+_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x1b2edf;}})});}_0x567cea=_[_0x834e('0x42')]({},_0x567cea,_0x58c1d7[_0x834e('0x43')]);var _0x2b7933={'where':_0x567cea['where']};return db[_0x834e('0x30')][_0x834e('0x20')](_0x2b7933)[_0x834e('0x28')](function(_0x58c5fb){_0x5dacc1[_0x834e('0x20')]=_0x58c5fb;if(_0x58c1d7[_0x834e('0x37')]['includeAll']){_0x567cea[_0x834e('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x834e('0x45')](_0x567cea);})[_0x834e('0x28')](function(_0x4a18bb){_0x5dacc1['rows']=_0x4a18bb;return _0x5dacc1;})[_0x834e('0x28')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x46')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x47')]=function(_0xbc1571,_0x8ad264){var _0x23feea={'raw':!![],'where':{'id':_0xbc1571['params']['id']}},_0x195204={};_0x195204[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x195204[_0x834e('0x37')]=_['keys'](_0xbc1571[_0x834e('0x37')]);_0x195204[_0x834e('0x38')]=_['intersection'](_0x195204[_0x834e('0x35')],_0x195204[_0x834e('0x37')]);_0x23feea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x195204[_0x834e('0x35')],qs[_0x834e('0x3b')](_0xbc1571[_0x834e('0x37')][_0x834e('0x3b')]));_0x23feea[_0x834e('0x3a')]=_0x23feea[_0x834e('0x3a')]['length']?_0x23feea[_0x834e('0x3a')]:_0x195204[_0x834e('0x35')];if(_0xbc1571['query'][_0x834e('0x48')]){_0x23feea[_0x834e('0x44')]=[{'all':!![]}];}_0x23feea=_[_0x834e('0x42')]({},_0x23feea,_0xbc1571[_0x834e('0x43')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x23feea)['then'](handleEntityNotFound(_0x8ad264,null))['then'](respondWithResult(_0x8ad264,null))[_0x834e('0x46')](handleError(_0x8ad264,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4a')]['id']){delete _0x30568e[_0x834e('0x4a')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x30568e[_0x834e('0x4b')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x2a')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1a3855[_0x834e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x46')](handleError(_0x3df078,null));};exports['create']=function(_0x3c00a3,_0x3b0988){var _0x55d491={'key':_0x3c00a3[_0x834e('0x4a')][_0x834e('0x34')]};if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')]){_0x55d491[_0x834e('0x4c')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')];}else if(_0x3c00a3['body'][_0x834e('0x4d')]){_0x55d491[_0x834e('0x4d')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4d')];}else if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4e')]){_0x55d491[_0x834e('0x4e')]=_0x3c00a3[_0x834e('0x4a')]['OpenchannelAccountId'];}else if(_0x3c00a3[_0x834e('0x4a')]['ChatWebsiteId']){_0x55d491[_0x834e('0x4f')]=_0x3c00a3['body'][_0x834e('0x4f')];}return db['CannedAnswer']['find']({'where':_0x55d491})[_0x834e('0x28')](function(_0x3e1bee){if(_0x3e1bee){throw new db['Sequelize']['ValidationError'](_0x834e('0x50'));}return db[_0x834e('0x30')][_0x834e('0x51')](_0x3c00a3[_0x834e('0x4a')]);})[_0x834e('0x28')](function(_0x315858){var _0x3d3f2b=_0x3c00a3[_0x834e('0x52')]['get']({'plain':!![]});if(!_0x3d3f2b)throw new Error(_0x834e('0x53'));if(_0x3d3f2b[_0x834e('0x54')]==='user'){var _0x281342=_0x315858['get']({'plain':!![]});return db[_0x834e('0x55')][_0x834e('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3d3f2b[_0x834e('0x56')]},'raw':!![]})[_0x834e('0x28')](function(_0x2de29a){if(_0x2de29a&&_0x2de29a[_0x834e('0x57')]===0x0){return db['UserProfileResource'][_0x834e('0x51')]({'name':_0x281342[_0x834e('0x2e')],'resourceId':_0x281342['id'],'type':_0x2de29a[_0x834e('0x2e')],'sectionId':_0x2de29a['id']},{})['then'](function(){return _0x315858;});}else{return _0x315858;}})[_0x834e('0x46')](function(_0x1fcae9){logger[_0x834e('0x2c')](_0x834e('0x58'),_0x1fcae9);throw _0x1fcae9;});}return _0x315858;})[_0x834e('0x28')](respondWithResult(_0x3b0988,0xc9))[_0x834e('0x46')](handleError(_0x3b0988,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index f7b5dff..b320668 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 _0x122a=['util','../../config/logger','api','moment','path','../../config/environment','./cannedAnswer.attributes','exports','tools_canned_answers','utf8mb4','lodash'];(function(_0x524d72,_0x27d8d3){var _0x1f2644=function(_0x5107d7){while(--_0x5107d7){_0x524d72['push'](_0x524d72['shift']());}};_0x1f2644(++_0x27d8d3);}(_0x122a,0xba));var _0xa122=function(_0x2c2df2,_0x3f19a5){_0x2c2df2=_0x2c2df2-0x0;var _0x3d572a=_0x122a[_0x2c2df2];return _0x3d572a;};'use strict';var _=require(_0xa122('0x0'));var util=require(_0xa122('0x1'));var logger=require(_0xa122('0x2'))(_0xa122('0x3'));var moment=require(_0xa122('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xa122('0x5'));var rimraf=require('rimraf');var config=require(_0xa122('0x6'));var attributes=require(_0xa122('0x7'));module[_0xa122('0x8')]=function(_0x3c8130,_0x526272){return _0x3c8130['define']('CannedAnswer',attributes,{'tableName':_0xa122('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa122('0xa'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x7a2c=['utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','tools_canned_answers'];(function(_0x3ac341,_0x2b1c1e){var _0x49120f=function(_0x947806){while(--_0x947806){_0x3ac341['push'](_0x3ac341['shift']());}};_0x49120f(++_0x2b1c1e);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x5bb4a9,_0x115d11){_0x5bb4a9=_0x5bb4a9-0x0;var _0x3dadfc=_0x7a2c[_0x5bb4a9];return _0x3dadfc;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./cannedAnswer.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('CannedAnswer',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xc7a2('0xb'),'collate':_0xc7a2('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index dd27468..658f6a5 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 _0x5f63=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','CannedAnswer,\x20%s,\x20%s,\x20%s'];(function(_0x3af3e8,_0x4ff50a){var _0x28c8b2=function(_0x25aa4e){while(--_0x25aa4e){_0x3af3e8['push'](_0x3af3e8['shift']());}};_0x28c8b2(++_0x4ff50a);}(_0x5f63,0x74));var _0x35f6=function(_0x10ef2c,_0x35bd6d){_0x10ef2c=_0x10ef2c-0x0;var _0x37ed40=_0x5f63[_0x10ef2c];return _0x37ed40;};'use strict';var _=require(_0x35f6('0x0'));var util=require(_0x35f6('0x1'));var moment=require(_0x35f6('0x2'));var BPromise=require(_0x35f6('0x3'));var rs=require(_0x35f6('0x4'));var fs=require('fs');var Redis=require(_0x35f6('0x5'));var db=require(_0x35f6('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x35f6('0x7'));var config=require(_0x35f6('0x8'));var jayson=require(_0x35f6('0x9'));var client=jayson[_0x35f6('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5f58b7,_0x19dc43,_0x1e27a3){return new BPromise(function(_0x49f498,_0x8f64bc){return client[_0x35f6('0xb')](_0x5f58b7,_0x1e27a3)[_0x35f6('0xc')](function(_0x4e6434){logger['info'](_0x35f6('0xd'),_0x19dc43,_0x35f6('0xe'));logger['debug'](_0x35f6('0xf'),_0x19dc43,_0x35f6('0xe'),JSON['stringify'](_0x4e6434));if(_0x4e6434[_0x35f6('0x10')]){if(_0x4e6434['error'][_0x35f6('0x11')]===0x1f4){logger[_0x35f6('0x10')](_0x35f6('0xd'),_0x19dc43,_0x4e6434[_0x35f6('0x10')][_0x35f6('0x12')]);return _0x8f64bc(_0x4e6434['error'][_0x35f6('0x12')]);}logger['error']('CannedAnswer,\x20%s,\x20%s',_0x19dc43,_0x4e6434[_0x35f6('0x10')]['message']);return _0x49f498(_0x4e6434[_0x35f6('0x10')][_0x35f6('0x12')]);}else{logger[_0x35f6('0x13')](_0x35f6('0xd'),_0x19dc43,'request\x20sent');_0x49f498(_0x4e6434[_0x35f6('0x14')]['message']);}})[_0x35f6('0x15')](function(_0xffb923){logger[_0x35f6('0x10')](_0x35f6('0xd'),_0x19dc43,_0xffb923);_0x8f64bc(_0xffb923);});});} \ No newline at end of file +var _0xd4c1=['util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','CannedAnswer,\x20%s,\x20%s','CannedAnswer,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch'];(function(_0x676667,_0x4d8df8){var _0x17d617=function(_0x4da382){while(--_0x4da382){_0x676667['push'](_0x676667['shift']());}};_0x17d617(++_0x4d8df8);}(_0xd4c1,0xc8));var _0x1d4c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4c1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x1d4c('0x0'));var moment=require(_0x1d4c('0x1'));var BPromise=require(_0x1d4c('0x2'));var rs=require(_0x1d4c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1d4c('0x4'))['db'];var utils=require(_0x1d4c('0x5'));var logger=require(_0x1d4c('0x6'))('rpc');var config=require(_0x1d4c('0x7'));var jayson=require(_0x1d4c('0x8'));var client=jayson['client'][_0x1d4c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x379afb,_0x450e93,_0x3cb886){return new BPromise(function(_0x4d4347,_0x202af8){return client['request'](_0x379afb,_0x3cb886)['then'](function(_0x14f806){logger[_0x1d4c('0xa')](_0x1d4c('0xb'),_0x450e93,'request\x20sent');logger['debug'](_0x1d4c('0xc'),_0x450e93,_0x1d4c('0xd'),JSON[_0x1d4c('0xe')](_0x14f806));if(_0x14f806['error']){if(_0x14f806['error'][_0x1d4c('0xf')]===0x1f4){logger['error'](_0x1d4c('0xb'),_0x450e93,_0x14f806[_0x1d4c('0x10')][_0x1d4c('0x11')]);return _0x202af8(_0x14f806[_0x1d4c('0x10')]['message']);}logger[_0x1d4c('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x450e93,_0x14f806['error'][_0x1d4c('0x11')]);return _0x4d4347(_0x14f806[_0x1d4c('0x10')][_0x1d4c('0x11')]);}else{logger[_0x1d4c('0xa')](_0x1d4c('0xb'),_0x450e93,'request\x20sent');_0x4d4347(_0x14f806[_0x1d4c('0x12')][_0x1d4c('0x11')]);}})[_0x1d4c('0x13')](function(_0x4716fe){logger[_0x1d4c('0x10')]('CannedAnswer,\x20%s,\x20%s',_0x450e93,_0x4716fe);_0x202af8(_0x4716fe);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index 9c908da..4532add 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 _0x2738=['util','connect-timeout','Router','../../components/auth/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','put','delete','destroy','exports','multer'];(function(_0x524f99,_0x39f8d1){var _0x35aec2=function(_0x5957eb){while(--_0x5957eb){_0x524f99['push'](_0x524f99['shift']());}};_0x35aec2(++_0x39f8d1);}(_0x2738,0x1db));var _0x8273=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2738[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0x8273('0x0'));var util=require(_0x8273('0x1'));var path=require('path');var timeout=require(_0x8273('0x2'));var express=require('express');var router=express[_0x8273('0x3')]();var auth=require(_0x8273('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x8273('0x5'));var controller=require(_0x8273('0x6'));router[_0x8273('0x7')]('/',auth[_0x8273('0x8')](),controller[_0x8273('0x9')]);router['get'](_0x8273('0xa'),auth[_0x8273('0x8')](),controller[_0x8273('0xb')]);router[_0x8273('0xc')]('/',auth[_0x8273('0x8')](),controller['create']);router[_0x8273('0xd')](_0x8273('0xa'),auth['isAuthenticated'](),controller['update']);router[_0x8273('0xe')](_0x8273('0xa'),auth[_0x8273('0x8')](),controller[_0x8273('0xf')]);module[_0x8273('0x10')]=router; \ No newline at end of file +var _0x4cc6=['Router','../../components/auth/service','../../components/interaction/service','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express'];(function(_0x1e6164,_0x332b84){var _0x77614c=function(_0x410b5f){while(--_0x410b5f){_0x1e6164['push'](_0x1e6164['shift']());}};_0x77614c(++_0x332b84);}(_0x4cc6,0x164));var _0x64cc=function(_0x355ce8,_0x5f1d0a){_0x355ce8=_0x355ce8-0x0;var _0x1db8b8=_0x4cc6[_0x355ce8];return _0x1db8b8;};'use strict';var multer=require(_0x64cc('0x0'));var util=require(_0x64cc('0x1'));var path=require(_0x64cc('0x2'));var timeout=require(_0x64cc('0x3'));var express=require(_0x64cc('0x4'));var router=express[_0x64cc('0x5')]();var auth=require(_0x64cc('0x6'));var interaction=require(_0x64cc('0x7'));var config=require('../../config/environment');var controller=require(_0x64cc('0x8'));router[_0x64cc('0x9')]('/',auth[_0x64cc('0xa')](),controller[_0x64cc('0xb')]);router[_0x64cc('0x9')](_0x64cc('0xc'),auth[_0x64cc('0xa')](),controller[_0x64cc('0xd')]);router[_0x64cc('0xe')]('/',auth[_0x64cc('0xa')](),controller[_0x64cc('0xf')]);router[_0x64cc('0x10')](_0x64cc('0xc'),auth[_0x64cc('0xa')](),controller[_0x64cc('0x11')]);router['delete'](_0x64cc('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x64cc('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 d0754a5..98538ce 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 _0xd1a0=['STRING','INTEGER','DATE','1970-01-01\x2000:00:01'];(function(_0x44da6b,_0x906c7a){var _0x445b66=function(_0x1b960e){while(--_0x1b960e){_0x44da6b['push'](_0x44da6b['shift']());}};_0x445b66(++_0x906c7a);}(_0xd1a0,0xf6));var _0x0d1a=function(_0x5ed534,_0x3418af){_0x5ed534=_0x5ed534-0x0;var _0x3d2d26=_0xd1a0[_0x5ed534];return _0x3d2d26;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize[_0x0d1a('0x0')],'allowNull':![],'defaultValue':_0x0d1a('0x1')},'clid':{'type':Sequelize[_0x0d1a('0x2')]},'src':{'type':Sequelize[_0x0d1a('0x2')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x0d1a('0x2')]},'channel':{'type':Sequelize[_0x0d1a('0x2')]},'dstchannel':{'type':Sequelize[_0x0d1a('0x2')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0x0d1a('0x2')]},'duration':{'type':Sequelize[_0x0d1a('0x3')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0x0d1a('0x3')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x0d1a('0x2')]},'amaflags':{'type':Sequelize[_0x0d1a('0x3')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x0d1a('0x2')]},'userfield':{'type':Sequelize[_0x0d1a('0x2')]},'uniqueid':{'type':Sequelize[_0x0d1a('0x2')]},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize[_0x0d1a('0x2')]},'peeraccount':{'type':Sequelize[_0x0d1a('0x2')]},'type':{'type':Sequelize[_0x0d1a('0x2')]},'tag':{'type':Sequelize[_0x0d1a('0x2')]}}; \ No newline at end of file +var _0x3e7e=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x51f900,_0x2ab840){var _0x270c3b=function(_0x3ab0ab){while(--_0x3ab0ab){_0x51f900['push'](_0x51f900['shift']());}};_0x270c3b(++_0x2ab840);}(_0x3e7e,0x102));var _0xe3e7=function(_0x1c3a57,_0x1b1837){_0x1c3a57=_0x1c3a57-0x0;var _0x3a7cee=_0x3e7e[_0x1c3a57];return _0x3a7cee;};'use strict';var Sequelize=require(_0xe3e7('0x0'));module[_0xe3e7('0x1')]={'calldate':{'type':Sequelize[_0xe3e7('0x2')],'allowNull':![],'defaultValue':_0xe3e7('0x3')},'clid':{'type':Sequelize[_0xe3e7('0x4')]},'src':{'type':Sequelize[_0xe3e7('0x4')]},'dst':{'type':Sequelize[_0xe3e7('0x4')]},'dcontext':{'type':Sequelize[_0xe3e7('0x4')]},'channel':{'type':Sequelize['STRING']},'dstchannel':{'type':Sequelize[_0xe3e7('0x4')]},'lastapp':{'type':Sequelize[_0xe3e7('0x4')]},'lastdata':{'type':Sequelize[_0xe3e7('0x4')]},'duration':{'type':Sequelize[_0xe3e7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xe3e7('0x4')]},'amaflags':{'type':Sequelize[_0xe3e7('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xe3e7('0x4')]},'userfield':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xe3e7('0x4')]},'tag':{'type':Sequelize[_0xe3e7('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index 6b9c7ea..8eff2a5 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 _0xc82d=['offset','limit','set','Content-Range','apply','then','destroy','error','stack','name','index','map','Cdr','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','where','pick','filter','options','include','findAll','rows','catch','show','keys','fields','includeAll','body','update','find','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count'];(function(_0x1c4013,_0x2a5ac9){var _0x47a12d=function(_0x5e5192){while(--_0x5e5192){_0x1c4013['push'](_0x1c4013['shift']());}};_0x47a12d(++_0x2a5ac9);}(_0xc82d,0x71));var _0xdc82=function(_0x565c49,_0x54acd0){_0x565c49=_0x565c49-0x0;var _0x20ca34=_0xc82d[_0x565c49];return _0x20ca34;};'use strict';var pdf=require(_0xdc82('0x0'));var emlformat=require(_0xdc82('0x1'));var rimraf=require(_0xdc82('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc82('0x3'));var rp=require(_0xdc82('0x4'));var moment=require(_0xdc82('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdc82('0x6'));var util=require('util');var path=require(_0xdc82('0x7'));var sox=require(_0xdc82('0x8'));var csv=require(_0xdc82('0x9'));var ejs=require(_0xdc82('0xa'));var fs=require('fs');var _=require(_0xdc82('0xb'));var squel=require('squel');var crypto=require(_0xdc82('0xc'));var jsforce=require(_0xdc82('0xd'));var deskjs=require(_0xdc82('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdc82('0xf'));var Papa=require(_0xdc82('0x10'));var Redis=require(_0xdc82('0x11'));var authService=require(_0xdc82('0x12'));var qs=require(_0xdc82('0x13'));var as=require(_0xdc82('0x14'));var hardwareService=require(_0xdc82('0x15'));var logger=require(_0xdc82('0x16'))('api');var utils=require(_0xdc82('0x17'));var config=require('../../config/environment');var db=require(_0xdc82('0x18'))['db'];function respondWithStatusCode(_0x47e9c9,_0x32d017){_0x32d017=_0x32d017||0xcc;return function(_0x911270){if(_0x911270){return _0x47e9c9['sendStatus'](_0x32d017);}return _0x47e9c9[_0xdc82('0x19')](_0x32d017)[_0xdc82('0x1a')]();};}function respondWithResult(_0x5b532c,_0x1d29a9){_0x1d29a9=_0x1d29a9||0xc8;return function(_0x2419a3){if(_0x2419a3){return _0x5b532c[_0xdc82('0x19')](_0x1d29a9)[_0xdc82('0x1b')](_0x2419a3);}};}function respondWithFilteredResult(_0xd66fbc,_0x24a892){return function(_0x3d0bdd){if(_0x3d0bdd){var _0x5c1ca4=_0x3d0bdd[_0xdc82('0x1c')],_0x465752=_0x24a892[_0xdc82('0x1d')],_0x19a07f=_0x24a892[_0xdc82('0x1d')]+_0x24a892[_0xdc82('0x1e')],_0x5f1a5f;if(_0x19a07f>=_0x5c1ca4){_0x19a07f=_0x5c1ca4;_0x5f1a5f=0xc8;}else{_0x5f1a5f=0xce;}_0xd66fbc[_0xdc82('0x19')](_0x5f1a5f);return _0xd66fbc[_0xdc82('0x1f')](_0xdc82('0x20'),_0x465752+'-'+_0x19a07f+'/'+_0x5c1ca4)[_0xdc82('0x1b')](_0x3d0bdd);}return null;};}function patchUpdates(_0x1f9508){return function(_0xb6992b){try{jsonpatch[_0xdc82('0x21')](_0xb6992b,_0x1f9508,!![]);}catch(_0x1dd7a8){return BPromise['reject'](_0x1dd7a8);}return _0xb6992b['save']();};}function saveUpdates(_0x29d04c,_0x7a9af4){return function(_0x7c125e){if(_0x7c125e){return _0x7c125e['update'](_0x29d04c)[_0xdc82('0x22')](function(_0xa38efa){return _0xa38efa;});}return null;};}function removeEntity(_0x496727,_0x121497){return function(_0x219e1f){if(_0x219e1f){return _0x219e1f[_0xdc82('0x23')]()[_0xdc82('0x22')](function(){_0x496727['status'](0xcc)[_0xdc82('0x1a')]();});}};}function handleEntityNotFound(_0x522e4d,_0x39d14b){return function(_0x1e1c59){if(!_0x1e1c59){_0x522e4d['sendStatus'](0x194);}return _0x1e1c59;};}function handleError(_0x3e2ee5,_0x38ac61){_0x38ac61=_0x38ac61||0x1f4;return function(_0x24e95a){logger[_0xdc82('0x24')](_0x24e95a[_0xdc82('0x25')]);if(_0x24e95a[_0xdc82('0x26')]){delete _0x24e95a['name'];}_0x3e2ee5['status'](_0x38ac61)['send'](_0x24e95a);};}exports[_0xdc82('0x27')]=function(_0x17f9ea,_0x17ba11){var _0x223d5e={},_0x2babea={},_0x4ba27={'count':0x0,'rows':[]};var _0x548a08=_[_0xdc82('0x28')](db[_0xdc82('0x29')][_0xdc82('0x2a')],function(_0x49af5f){return{'name':_0x49af5f[_0xdc82('0x2b')],'type':_0x49af5f[_0xdc82('0x2c')][_0xdc82('0x2d')]};});_0x2babea[_0xdc82('0x2e')]=_[_0xdc82('0x28')](_0x548a08,'name');_0x2babea[_0xdc82('0x2f')]=_['keys'](_0x17f9ea[_0xdc82('0x2f')]);_0x2babea[_0xdc82('0x30')]=_[_0xdc82('0x31')](_0x2babea[_0xdc82('0x2e')],_0x2babea['query']);_0x223d5e[_0xdc82('0x32')]=_[_0xdc82('0x31')](_0x2babea[_0xdc82('0x2e')],qs['fields'](_0x17f9ea[_0xdc82('0x2f')]['fields']));_0x223d5e[_0xdc82('0x32')]=_0x223d5e['attributes'][_0xdc82('0x33')]?_0x223d5e[_0xdc82('0x32')]:_0x2babea[_0xdc82('0x2e')];if(!_0x17f9ea['query'][_0xdc82('0x34')]('nolimit')){_0x223d5e[_0xdc82('0x1e')]=qs[_0xdc82('0x1e')](_0x17f9ea[_0xdc82('0x2f')][_0xdc82('0x1e')]);_0x223d5e[_0xdc82('0x1d')]=qs[_0xdc82('0x1d')](_0x17f9ea['query'][_0xdc82('0x1d')]);}_0x223d5e[_0xdc82('0x35')]=qs['sort'](_0x17f9ea[_0xdc82('0x2f')]['sort']);_0x223d5e[_0xdc82('0x36')]=qs[_0xdc82('0x30')](_[_0xdc82('0x37')](_0x17f9ea[_0xdc82('0x2f')],_0x2babea['filters']));if(_0x17f9ea['query'][_0xdc82('0x38')]){_0x223d5e[_0xdc82('0x36')]=_['merge'](_0x223d5e[_0xdc82('0x36')],{'$or':_[_0xdc82('0x28')](_0x548a08,function(_0x317809){if(_0x317809[_0xdc82('0x2c')]!=='VIRTUAL'){var _0x5cf98f={};_0x5cf98f[_0x317809[_0xdc82('0x26')]]={'$like':'%'+_0x17f9ea[_0xdc82('0x2f')][_0xdc82('0x38')]+'%'};return _0x5cf98f;}})});}_0x223d5e=_['merge']({},_0x223d5e,_0x17f9ea[_0xdc82('0x39')]);var _0x584dc9={'where':_0x223d5e[_0xdc82('0x36')]};return db['Cdr'][_0xdc82('0x1c')](_0x584dc9)[_0xdc82('0x22')](function(_0x1027e1){_0x4ba27['count']=_0x1027e1;if(_0x17f9ea[_0xdc82('0x2f')]['includeAll']){_0x223d5e[_0xdc82('0x3a')]=[{'all':!![]}];}return db[_0xdc82('0x29')][_0xdc82('0x3b')](_0x223d5e);})[_0xdc82('0x22')](function(_0x51a2ae){_0x4ba27[_0xdc82('0x3c')]=_0x51a2ae;return _0x4ba27;})[_0xdc82('0x22')](respondWithFilteredResult(_0x17ba11,_0x223d5e))[_0xdc82('0x3d')](handleError(_0x17ba11,null));};exports[_0xdc82('0x3e')]=function(_0x148c4a,_0x5cfaeb){var _0x354b23={'raw':!![],'where':{'id':_0x148c4a['params']['id']}},_0x2232ed={};_0x2232ed[_0xdc82('0x2e')]=_['keys'](db[_0xdc82('0x29')][_0xdc82('0x2a')]);_0x2232ed[_0xdc82('0x2f')]=_[_0xdc82('0x3f')](_0x148c4a[_0xdc82('0x2f')]);_0x2232ed[_0xdc82('0x30')]=_[_0xdc82('0x31')](_0x2232ed[_0xdc82('0x2e')],_0x2232ed[_0xdc82('0x2f')]);_0x354b23['attributes']=_['intersection'](_0x2232ed[_0xdc82('0x2e')],qs[_0xdc82('0x40')](_0x148c4a[_0xdc82('0x2f')]['fields']));_0x354b23[_0xdc82('0x32')]=_0x354b23[_0xdc82('0x32')][_0xdc82('0x33')]?_0x354b23[_0xdc82('0x32')]:_0x2232ed[_0xdc82('0x2e')];if(_0x148c4a[_0xdc82('0x2f')][_0xdc82('0x41')]){_0x354b23[_0xdc82('0x3a')]=[{'all':!![]}];}_0x354b23=_['merge']({},_0x354b23,_0x148c4a[_0xdc82('0x39')]);return db[_0xdc82('0x29')]['find'](_0x354b23)[_0xdc82('0x22')](handleEntityNotFound(_0x5cfaeb,null))[_0xdc82('0x22')](respondWithResult(_0x5cfaeb,null))[_0xdc82('0x3d')](handleError(_0x5cfaeb,null));};exports['create']=function(_0x335606,_0x2e0a05){return db['Cdr']['create'](_0x335606[_0xdc82('0x42')],{})['then'](respondWithResult(_0x2e0a05,0xc9))[_0xdc82('0x3d')](handleError(_0x2e0a05,null));};exports[_0xdc82('0x43')]=function(_0x49a970,_0x432e5b){if(_0x49a970['body']['id']){delete _0x49a970[_0xdc82('0x42')]['id'];}return db[_0xdc82('0x29')][_0xdc82('0x44')]({'where':{'id':_0x49a970[_0xdc82('0x45')]['id']}})['then'](handleEntityNotFound(_0x432e5b,null))[_0xdc82('0x22')](saveUpdates(_0x49a970[_0xdc82('0x42')],null))[_0xdc82('0x22')](respondWithResult(_0x432e5b,null))[_0xdc82('0x3d')](handleError(_0x432e5b,null));};exports[_0xdc82('0x23')]=function(_0x509f5e,_0x3cd666){return db[_0xdc82('0x29')]['find']({'where':{'id':_0x509f5e['params']['id']}})['then'](handleEntityNotFound(_0x3cd666,null))[_0xdc82('0x22')](removeEntity(_0x3cd666,null))[_0xdc82('0x3d')](handleError(_0x3cd666,null));};exports[_0xdc82('0x46')]=function(_0xc688e6,_0x57b652){return db[_0xdc82('0x29')][_0xdc82('0x46')]()['then'](respondWithResult(_0x57b652,null))[_0xdc82('0x3d')](handleError(_0x57b652,null));}; \ No newline at end of file +var _0x2e38=['Content-Range','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','options','Cdr','count','include','rows','catch','show','params','includeAll','merge','create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set'];(function(_0x499d03,_0x191c29){var _0x5081bf=function(_0x3e7b88){while(--_0x3e7b88){_0x499d03['push'](_0x499d03['shift']());}};_0x5081bf(++_0x191c29);}(_0x2e38,0x11a));var _0x82e3=function(_0x24e729,_0x45dd61){_0x24e729=_0x24e729-0x0;var _0x3ab9ce=_0x2e38[_0x24e729];return _0x3ab9ce;};'use strict';var pdf=require(_0x82e3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x82e3('0x1'));var zipdir=require(_0x82e3('0x2'));var jsonpatch=require(_0x82e3('0x3'));var rp=require(_0x82e3('0x4'));var moment=require('moment');var BPromise=require(_0x82e3('0x5'));var Mustache=require('mustache');var util=require(_0x82e3('0x6'));var path=require(_0x82e3('0x7'));var sox=require(_0x82e3('0x8'));var csv=require(_0x82e3('0x9'));var ejs=require(_0x82e3('0xa'));var fs=require('fs');var _=require(_0x82e3('0xb'));var squel=require('squel');var crypto=require(_0x82e3('0xc'));var jsforce=require(_0x82e3('0xd'));var deskjs=require(_0x82e3('0xe'));var toCsv=require(_0x82e3('0x9'));var querystring=require(_0x82e3('0xf'));var Papa=require(_0x82e3('0x10'));var Redis=require(_0x82e3('0x11'));var authService=require(_0x82e3('0x12'));var qs=require(_0x82e3('0x13'));var as=require(_0x82e3('0x14'));var hardwareService=require(_0x82e3('0x15'));var logger=require(_0x82e3('0x16'))(_0x82e3('0x17'));var utils=require(_0x82e3('0x18'));var config=require(_0x82e3('0x19'));var db=require(_0x82e3('0x1a'))['db'];function respondWithStatusCode(_0x2db6b3,_0x473c2f){_0x473c2f=_0x473c2f||0xcc;return function(_0x37f749){if(_0x37f749){return _0x2db6b3[_0x82e3('0x1b')](_0x473c2f);}return _0x2db6b3[_0x82e3('0x1c')](_0x473c2f)[_0x82e3('0x1d')]();};}function respondWithResult(_0x1bba17,_0x45161a){_0x45161a=_0x45161a||0xc8;return function(_0x5e7389){if(_0x5e7389){return _0x1bba17[_0x82e3('0x1c')](_0x45161a)[_0x82e3('0x1e')](_0x5e7389);}};}function respondWithFilteredResult(_0x4fd832,_0xf86c2f){return function(_0x143119){if(_0x143119){var _0x36ea7e=_0x143119['count'],_0x506215=_0xf86c2f[_0x82e3('0x1f')],_0xbf2c83=_0xf86c2f['offset']+_0xf86c2f[_0x82e3('0x20')],_0x2245b4;if(_0xbf2c83>=_0x36ea7e){_0xbf2c83=_0x36ea7e;_0x2245b4=0xc8;}else{_0x2245b4=0xce;}_0x4fd832[_0x82e3('0x1c')](_0x2245b4);return _0x4fd832[_0x82e3('0x21')](_0x82e3('0x22'),_0x506215+'-'+_0xbf2c83+'/'+_0x36ea7e)[_0x82e3('0x1e')](_0x143119);}return null;};}function patchUpdates(_0xf5e114){return function(_0x5cdd1d){try{jsonpatch['apply'](_0x5cdd1d,_0xf5e114,!![]);}catch(_0x27d31d){return BPromise[_0x82e3('0x23')](_0x27d31d);}return _0x5cdd1d[_0x82e3('0x24')]();};}function saveUpdates(_0x40c0f5,_0x529007){return function(_0x55a4d3){if(_0x55a4d3){return _0x55a4d3[_0x82e3('0x25')](_0x40c0f5)[_0x82e3('0x26')](function(_0x53e5da){return _0x53e5da;});}return null;};}function removeEntity(_0x2eab66,_0x462f4a){return function(_0x3e2794){if(_0x3e2794){return _0x3e2794[_0x82e3('0x27')]()[_0x82e3('0x26')](function(){_0x2eab66['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f02f1,_0x1b456b){return function(_0x34c8e3){if(!_0x34c8e3){_0x3f02f1[_0x82e3('0x1b')](0x194);}return _0x34c8e3;};}function handleError(_0x20e909,_0x59ea99){_0x59ea99=_0x59ea99||0x1f4;return function(_0x7bb180){logger[_0x82e3('0x28')](_0x7bb180[_0x82e3('0x29')]);if(_0x7bb180[_0x82e3('0x2a')]){delete _0x7bb180[_0x82e3('0x2a')];}_0x20e909['status'](_0x59ea99)[_0x82e3('0x2b')](_0x7bb180);};}exports[_0x82e3('0x2c')]=function(_0x593c50,_0x1fb249){var _0x3fb886={},_0xce3195={},_0x4b9dda={'count':0x0,'rows':[]};var _0x45acf7=_[_0x82e3('0x2d')](db['Cdr'][_0x82e3('0x2e')],function(_0x5d551c){return{'name':_0x5d551c['fieldName'],'type':_0x5d551c[_0x82e3('0x2f')][_0x82e3('0x30')]};});_0xce3195[_0x82e3('0x31')]=_[_0x82e3('0x2d')](_0x45acf7,'name');_0xce3195[_0x82e3('0x32')]=_[_0x82e3('0x33')](_0x593c50[_0x82e3('0x32')]);_0xce3195[_0x82e3('0x34')]=_['intersection'](_0xce3195[_0x82e3('0x31')],_0xce3195[_0x82e3('0x32')]);_0x3fb886[_0x82e3('0x35')]=_[_0x82e3('0x36')](_0xce3195['model'],qs[_0x82e3('0x37')](_0x593c50[_0x82e3('0x32')]['fields']));_0x3fb886[_0x82e3('0x35')]=_0x3fb886[_0x82e3('0x35')][_0x82e3('0x38')]?_0x3fb886[_0x82e3('0x35')]:_0xce3195[_0x82e3('0x31')];if(!_0x593c50[_0x82e3('0x32')][_0x82e3('0x39')](_0x82e3('0x3a'))){_0x3fb886['limit']=qs[_0x82e3('0x20')](_0x593c50[_0x82e3('0x32')][_0x82e3('0x20')]);_0x3fb886[_0x82e3('0x1f')]=qs['offset'](_0x593c50[_0x82e3('0x32')][_0x82e3('0x1f')]);}_0x3fb886[_0x82e3('0x3b')]=qs['sort'](_0x593c50['query'][_0x82e3('0x3c')]);_0x3fb886['where']=qs[_0x82e3('0x34')](_[_0x82e3('0x3d')](_0x593c50[_0x82e3('0x32')],_0xce3195[_0x82e3('0x34')]));if(_0x593c50[_0x82e3('0x32')][_0x82e3('0x3e')]){_0x3fb886[_0x82e3('0x3f')]=_['merge'](_0x3fb886['where'],{'$or':_[_0x82e3('0x2d')](_0x45acf7,function(_0x464103){if(_0x464103[_0x82e3('0x2f')]!==_0x82e3('0x40')){var _0xe85b0b={};_0xe85b0b[_0x464103[_0x82e3('0x2a')]]={'$like':'%'+_0x593c50[_0x82e3('0x32')][_0x82e3('0x3e')]+'%'};return _0xe85b0b;}})});}_0x3fb886=_['merge']({},_0x3fb886,_0x593c50[_0x82e3('0x41')]);var _0x4d9ff6={'where':_0x3fb886[_0x82e3('0x3f')]};return db[_0x82e3('0x42')][_0x82e3('0x43')](_0x4d9ff6)[_0x82e3('0x26')](function(_0x2fed29){_0x4b9dda[_0x82e3('0x43')]=_0x2fed29;if(_0x593c50['query']['includeAll']){_0x3fb886[_0x82e3('0x44')]=[{'all':!![]}];}return db[_0x82e3('0x42')]['findAll'](_0x3fb886);})['then'](function(_0x49bf92){_0x4b9dda[_0x82e3('0x45')]=_0x49bf92;return _0x4b9dda;})['then'](respondWithFilteredResult(_0x1fb249,_0x3fb886))[_0x82e3('0x46')](handleError(_0x1fb249,null));};exports[_0x82e3('0x47')]=function(_0x5b603c,_0x384f1a){var _0x199af9={'raw':!![],'where':{'id':_0x5b603c[_0x82e3('0x48')]['id']}},_0x47eb64={};_0x47eb64[_0x82e3('0x31')]=_['keys'](db['Cdr'][_0x82e3('0x2e')]);_0x47eb64[_0x82e3('0x32')]=_[_0x82e3('0x33')](_0x5b603c['query']);_0x47eb64[_0x82e3('0x34')]=_['intersection'](_0x47eb64[_0x82e3('0x31')],_0x47eb64['query']);_0x199af9[_0x82e3('0x35')]=_[_0x82e3('0x36')](_0x47eb64['model'],qs[_0x82e3('0x37')](_0x5b603c[_0x82e3('0x32')][_0x82e3('0x37')]));_0x199af9['attributes']=_0x199af9[_0x82e3('0x35')][_0x82e3('0x38')]?_0x199af9[_0x82e3('0x35')]:_0x47eb64['model'];if(_0x5b603c[_0x82e3('0x32')][_0x82e3('0x49')]){_0x199af9[_0x82e3('0x44')]=[{'all':!![]}];}_0x199af9=_[_0x82e3('0x4a')]({},_0x199af9,_0x5b603c[_0x82e3('0x41')]);return db['Cdr']['find'](_0x199af9)[_0x82e3('0x26')](handleEntityNotFound(_0x384f1a,null))[_0x82e3('0x26')](respondWithResult(_0x384f1a,null))[_0x82e3('0x46')](handleError(_0x384f1a,null));};exports[_0x82e3('0x4b')]=function(_0x380a12,_0x4802de){return db['Cdr'][_0x82e3('0x4b')](_0x380a12[_0x82e3('0x4c')],{})[_0x82e3('0x26')](respondWithResult(_0x4802de,0xc9))[_0x82e3('0x46')](handleError(_0x4802de,null));};exports['update']=function(_0x495b99,_0x22b269){if(_0x495b99[_0x82e3('0x4c')]['id']){delete _0x495b99[_0x82e3('0x4c')]['id'];}return db[_0x82e3('0x42')][_0x82e3('0x4d')]({'where':{'id':_0x495b99['params']['id']}})['then'](handleEntityNotFound(_0x22b269,null))[_0x82e3('0x26')](saveUpdates(_0x495b99[_0x82e3('0x4c')],null))[_0x82e3('0x26')](respondWithResult(_0x22b269,null))[_0x82e3('0x46')](handleError(_0x22b269,null));};exports[_0x82e3('0x27')]=function(_0x1f3b34,_0x5e53b0){return db[_0x82e3('0x42')]['find']({'where':{'id':_0x1f3b34[_0x82e3('0x48')]['id']}})[_0x82e3('0x26')](handleEntityNotFound(_0x5e53b0,null))[_0x82e3('0x26')](removeEntity(_0x5e53b0,null))['catch'](handleError(_0x5e53b0,null));};exports[_0x82e3('0x4e')]=function(_0x1fad73,_0x2c6af6){return db[_0x82e3('0x42')][_0x82e3('0x4e')]()[_0x82e3('0x26')](respondWithResult(_0x2c6af6,null))[_0x82e3('0x46')](handleError(_0x2c6af6,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index ee73279..41f7d14 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 _0x187d=['dst','src','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cdr.attributes','define','Cdr','cdr','accountcode','calldate','disposition'];(function(_0x33b059,_0x9d481d){var _0x3503bd=function(_0x50f240){while(--_0x50f240){_0x33b059['push'](_0x33b059['shift']());}};_0x3503bd(++_0x9d481d);}(_0x187d,0x93));var _0xd187=function(_0x2bf141,_0x31eac7){_0x2bf141=_0x2bf141-0x0;var _0x48277b=_0x187d[_0x2bf141];return _0x48277b;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[{'name':_0xd187('0xc'),'fields':[_0xd187('0xc')]},{'name':_0xd187('0xd'),'fields':['calldate']},{'name':_0xd187('0xe'),'fields':[_0xd187('0xe')]},{'name':_0xd187('0xf'),'fields':[_0xd187('0xf')]},{'name':_0xd187('0x10'),'fields':[_0xd187('0x10')]},{'name':'uniqueid','fields':[_0xd187('0x11')]}],'timestamps':![]});}; \ No newline at end of file +var _0xacf4=['bluebird','request-promise','path','rimraf','./cdr.attributes','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','../../config/logger','api','moment'];(function(_0x470b9c,_0x4e6cff){var _0x5b29fc=function(_0x57a919){while(--_0x57a919){_0x470b9c['push'](_0x470b9c['shift']());}};_0x5b29fc(++_0x4e6cff);}(_0xacf4,0xe7));var _0x4acf=function(_0x3c4c1b,_0x567fb1){_0x3c4c1b=_0x3c4c1b-0x0;var _0x1e0d7c=_0xacf4[_0x3c4c1b];return _0x1e0d7c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x4acf('0x0'))(_0x4acf('0x1'));var moment=require(_0x4acf('0x2'));var BPromise=require(_0x4acf('0x3'));var rp=require(_0x4acf('0x4'));var fs=require('fs');var path=require(_0x4acf('0x5'));var rimraf=require(_0x4acf('0x6'));var config=require('../../config/environment');var attributes=require(_0x4acf('0x7'));module[_0x4acf('0x8')]=function(_0x4e0c43,_0x24bf24){return _0x4e0c43[_0x4acf('0x9')](_0x4acf('0xa'),attributes,{'tableName':_0x4acf('0xb'),'paranoid':![],'indexes':[{'name':_0x4acf('0xc'),'fields':['accountcode']},{'name':'calldate','fields':[_0x4acf('0xd')]},{'name':'disposition','fields':[_0x4acf('0xe')]},{'name':_0x4acf('0xf'),'fields':[_0x4acf('0xf')]},{'name':'src','fields':[_0x4acf('0x10')]},{'name':_0x4acf('0x11'),'fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 228c4ce..7d6978c 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 _0x2be1=['Cdr,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x490a4c,_0x361116){var _0x5e1bd3=function(_0x4190bb){while(--_0x4190bb){_0x490a4c['push'](_0x490a4c['shift']());}};_0x5e1bd3(++_0x361116);}(_0x2be1,0x103));var _0x12be=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x2be1[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x12be('0x0'));var util=require(_0x12be('0x1'));var moment=require(_0x12be('0x2'));var BPromise=require(_0x12be('0x3'));var rs=require(_0x12be('0x4'));var fs=require('fs');var Redis=require(_0x12be('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x12be('0x6'));var logger=require(_0x12be('0x7'))(_0x12be('0x8'));var config=require(_0x12be('0x9'));var jayson=require(_0x12be('0xa'));var client=jayson[_0x12be('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4edcc7,_0x4278c0,_0x39313d){return new BPromise(function(_0x570b42,_0x38e7ed){return client[_0x12be('0xc')](_0x4edcc7,_0x39313d)['then'](function(_0x43c851){logger[_0x12be('0xd')](_0x12be('0xe'),_0x4278c0,_0x12be('0xf'));logger[_0x12be('0x10')](_0x12be('0x11'),_0x4278c0,_0x12be('0xf'),JSON['stringify'](_0x43c851));if(_0x43c851[_0x12be('0x12')]){if(_0x43c851[_0x12be('0x12')][_0x12be('0x13')]===0x1f4){logger['error'](_0x12be('0xe'),_0x4278c0,_0x43c851[_0x12be('0x12')][_0x12be('0x14')]);return _0x38e7ed(_0x43c851[_0x12be('0x12')][_0x12be('0x14')]);}logger[_0x12be('0x12')](_0x12be('0xe'),_0x4278c0,_0x43c851[_0x12be('0x12')][_0x12be('0x14')]);return _0x570b42(_0x43c851[_0x12be('0x12')][_0x12be('0x14')]);}else{logger[_0x12be('0xd')]('Cdr,\x20%s,\x20%s',_0x4278c0,_0x12be('0xf'));_0x570b42(_0x43c851[_0x12be('0x15')]['message']);}})[_0x12be('0x16')](function(_0x121ff6){logger[_0x12be('0x12')](_0x12be('0xe'),_0x4278c0,_0x121ff6);_0x38e7ed(_0x121ff6);});});} \ No newline at end of file +var _0x74ee=['Cdr,\x20%s,\x20%s','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x238787,_0x2a0c62){var _0x38c0df=function(_0x3a77e9){while(--_0x3a77e9){_0x238787['push'](_0x238787['shift']());}};_0x38c0df(++_0x2a0c62);}(_0x74ee,0xc0));var _0xe74e=function(_0x4ef303,_0x4112d5){_0x4ef303=_0x4ef303-0x0;var _0x2cdff4=_0x74ee[_0x4ef303];return _0x2cdff4;};'use strict';var _=require(_0xe74e('0x0'));var util=require(_0xe74e('0x1'));var moment=require(_0xe74e('0x2'));var BPromise=require('bluebird');var rs=require(_0xe74e('0x3'));var fs=require('fs');var Redis=require(_0xe74e('0x4'));var db=require(_0xe74e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe74e('0x6'))(_0xe74e('0x7'));var config=require(_0xe74e('0x8'));var jayson=require(_0xe74e('0x9'));var client=jayson[_0xe74e('0xa')][_0xe74e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x543431,_0x1e47c9,_0x20f84f){return new BPromise(function(_0x56cf3f,_0x2ba0c6){return client[_0xe74e('0xc')](_0x543431,_0x20f84f)[_0xe74e('0xd')](function(_0x2f76bb){logger[_0xe74e('0xe')](_0xe74e('0xf'),_0x1e47c9,'request\x20sent');logger['debug'](_0xe74e('0x10'),_0x1e47c9,'request\x20sent',JSON[_0xe74e('0x11')](_0x2f76bb));if(_0x2f76bb['error']){if(_0x2f76bb[_0xe74e('0x12')]['code']===0x1f4){logger[_0xe74e('0x12')](_0xe74e('0xf'),_0x1e47c9,_0x2f76bb[_0xe74e('0x12')][_0xe74e('0x13')]);return _0x2ba0c6(_0x2f76bb[_0xe74e('0x12')][_0xe74e('0x13')]);}logger['error'](_0xe74e('0xf'),_0x1e47c9,_0x2f76bb[_0xe74e('0x12')][_0xe74e('0x13')]);return _0x56cf3f(_0x2f76bb['error'][_0xe74e('0x13')]);}else{logger[_0xe74e('0xe')]('Cdr,\x20%s,\x20%s',_0x1e47c9,_0xe74e('0x14'));_0x56cf3f(_0x2f76bb[_0xe74e('0x15')][_0xe74e('0x13')]);}})[_0xe74e('0x16')](function(_0x549b54){logger[_0xe74e('0x12')](_0xe74e('0xf'),_0x1e47c9,_0x549b54);_0x2ba0c6(_0x549b54);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 41c1741..e4aa322 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 _0xd2a9=['update','delete','destroy','multer','util','connect-timeout','express','../../components/interaction/service','./cdr.controller','get','isAuthenticated','describe','/:id','post','create','put'];(function(_0x74465d,_0x2a80b4){var _0x36e280=function(_0xa61360){while(--_0xa61360){_0x74465d['push'](_0x74465d['shift']());}};_0x36e280(++_0x2a80b4);}(_0xd2a9,0x1c3));var _0x9d2a=function(_0x456520,_0x2580fa){_0x456520=_0x456520-0x0;var _0x4d26fb=_0xd2a9[_0x456520];return _0x4d26fb;};'use strict';var multer=require(_0x9d2a('0x0'));var util=require(_0x9d2a('0x1'));var path=require('path');var timeout=require(_0x9d2a('0x2'));var express=require(_0x9d2a('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x9d2a('0x4'));var config=require('../../config/environment');var controller=require(_0x9d2a('0x5'));router[_0x9d2a('0x6')]('/',auth[_0x9d2a('0x7')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x9d2a('0x8')]);router[_0x9d2a('0x6')](_0x9d2a('0x9'),auth[_0x9d2a('0x7')](),controller['show']);router[_0x9d2a('0xa')]('/',auth[_0x9d2a('0x7')](),controller[_0x9d2a('0xb')]);router[_0x9d2a('0xc')](_0x9d2a('0x9'),auth[_0x9d2a('0x7')](),controller[_0x9d2a('0xd')]);router[_0x9d2a('0xe')](_0x9d2a('0x9'),auth[_0x9d2a('0x7')](),controller[_0x9d2a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x3cdb=['./cdr.controller','get','isAuthenticated','/describe','describe','/:id','create','put','destroy','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x375e38,_0x141453){var _0x448b5c=function(_0x53184e){while(--_0x53184e){_0x375e38['push'](_0x375e38['shift']());}};_0x448b5c(++_0x141453);}(_0x3cdb,0xbd));var _0xb3cd=function(_0x16bb0e,_0x343132){_0x16bb0e=_0x16bb0e-0x0;var _0x102b8b=_0x3cdb[_0x16bb0e];return _0x102b8b;};'use strict';var multer=require(_0xb3cd('0x0'));var util=require(_0xb3cd('0x1'));var path=require('path');var timeout=require(_0xb3cd('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xb3cd('0x3'));var interaction=require(_0xb3cd('0x4'));var config=require(_0xb3cd('0x5'));var controller=require(_0xb3cd('0x6'));router[_0xb3cd('0x7')]('/',auth[_0xb3cd('0x8')](),controller['index']);router[_0xb3cd('0x7')](_0xb3cd('0x9'),auth[_0xb3cd('0x8')](),controller[_0xb3cd('0xa')]);router[_0xb3cd('0x7')](_0xb3cd('0xb'),auth[_0xb3cd('0x8')](),controller['show']);router['post']('/',auth[_0xb3cd('0x8')](),controller[_0xb3cd('0xc')]);router[_0xb3cd('0xd')](_0xb3cd('0xb'),auth[_0xb3cd('0x8')](),controller['update']);router['delete'](_0xb3cd('0xb'),auth[_0xb3cd('0x8')](),controller[_0xb3cd('0xe')]);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 e5eed09..0cc6859 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 _0x7dd2=['*,*,*,*','sequelize','STRING','noop','TEXT'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0x7dd2,0x123));var _0x27dd=function(_0x5ce3bf,_0x294c49){_0x5ce3bf=_0x5ce3bf-0x0;var _0x245246=_0x7dd2[_0x5ce3bf];return _0x245246;};'use strict';var Sequelize=require(_0x27dd('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x27dd('0x1')],'allowNull':![],'defaultValue':_0x27dd('0x2')},'appdata':{'type':Sequelize[_0x27dd('0x3')]()},'description':{'type':Sequelize[_0x27dd('0x1')]},'interval':{'type':Sequelize[_0x27dd('0x1')],'defaultValue':_0x27dd('0x4')}}; \ No newline at end of file +var _0x4e70=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x44774d,_0x27fe98){var _0x282b23=function(_0x3b05d4){while(--_0x3b05d4){_0x44774d['push'](_0x44774d['shift']());}};_0x282b23(++_0x27fe98);}(_0x4e70,0xf9));var _0x04e7=function(_0x47fd36,_0x41535d){_0x47fd36=_0x47fd36-0x0;var _0x21a0fc=_0x4e70[_0x47fd36];return _0x21a0fc;};'use strict';var Sequelize=require(_0x04e7('0x0'));module[_0x04e7('0x1')]={'priority':{'type':Sequelize[_0x04e7('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x04e7('0x3')],'allowNull':![],'defaultValue':_0x04e7('0x4')},'appdata':{'type':Sequelize[_0x04e7('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x04e7('0x3')],'defaultValue':_0x04e7('0x6')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 5fdb27c..6d632b5 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 _0xc7a4=['../../config/utils','../../config/environment','../../mysqldb','status','end','count','limit','set','json','apply','update','then','sendStatus','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','query','keys','filters','intersection','attributes','fields','length','includeAll','merge','catch','body','destroy','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../config/logger','api'];(function(_0x43fbad,_0x41d1e8){var _0x389879=function(_0x3e8504){while(--_0x3e8504){_0x43fbad['push'](_0x43fbad['shift']());}};_0x389879(++_0x41d1e8);}(_0xc7a4,0x1ab));var _0x4c7a=function(_0x408baa,_0x2cddba){_0x408baa=_0x408baa-0x0;var _0x3c3b95=_0xc7a4[_0x408baa];return _0x3c3b95;};'use strict';var pdf=require(_0x4c7a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4c7a('0x1'));var zipdir=require(_0x4c7a('0x2'));var jsonpatch=require(_0x4c7a('0x3'));var rp=require(_0x4c7a('0x4'));var moment=require('moment');var BPromise=require(_0x4c7a('0x5'));var Mustache=require(_0x4c7a('0x6'));var util=require(_0x4c7a('0x7'));var path=require(_0x4c7a('0x8'));var sox=require(_0x4c7a('0x9'));var csv=require(_0x4c7a('0xa'));var ejs=require(_0x4c7a('0xb'));var fs=require('fs');var _=require(_0x4c7a('0xc'));var squel=require(_0x4c7a('0xd'));var crypto=require(_0x4c7a('0xe'));var jsforce=require(_0x4c7a('0xf'));var deskjs=require(_0x4c7a('0x10'));var toCsv=require(_0x4c7a('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x4c7a('0x11'));var authService=require(_0x4c7a('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x4c7a('0x13'))(_0x4c7a('0x14'));var utils=require(_0x4c7a('0x15'));var config=require(_0x4c7a('0x16'));var db=require(_0x4c7a('0x17'))['db'];function respondWithStatusCode(_0xac387,_0x430abc){_0x430abc=_0x430abc||0xcc;return function(_0x2b6dc1){if(_0x2b6dc1){return _0xac387['sendStatus'](_0x430abc);}return _0xac387[_0x4c7a('0x18')](_0x430abc)[_0x4c7a('0x19')]();};}function respondWithResult(_0x45f262,_0x2d1e0d){_0x2d1e0d=_0x2d1e0d||0xc8;return function(_0x3e94ce){if(_0x3e94ce){return _0x45f262[_0x4c7a('0x18')](_0x2d1e0d)['json'](_0x3e94ce);}};}function respondWithFilteredResult(_0x176b5f,_0x328230){return function(_0x2a406b){if(_0x2a406b){var _0x3cb2af=_0x2a406b[_0x4c7a('0x1a')],_0x78e571=_0x328230['offset'],_0x4f1c50=_0x328230['offset']+_0x328230[_0x4c7a('0x1b')],_0x1e8452;if(_0x4f1c50>=_0x3cb2af){_0x4f1c50=_0x3cb2af;_0x1e8452=0xc8;}else{_0x1e8452=0xce;}_0x176b5f[_0x4c7a('0x18')](_0x1e8452);return _0x176b5f[_0x4c7a('0x1c')]('Content-Range',_0x78e571+'-'+_0x4f1c50+'/'+_0x3cb2af)[_0x4c7a('0x1d')](_0x2a406b);}return null;};}function patchUpdates(_0xd05de1){return function(_0x1d9cc3){try{jsonpatch[_0x4c7a('0x1e')](_0x1d9cc3,_0xd05de1,!![]);}catch(_0x135b25){return BPromise['reject'](_0x135b25);}return _0x1d9cc3['save']();};}function saveUpdates(_0x40c416,_0x329e46){return function(_0x3e90bb){if(_0x3e90bb){return _0x3e90bb[_0x4c7a('0x1f')](_0x40c416)[_0x4c7a('0x20')](function(_0xdc294d){return _0xdc294d;});}return null;};}function removeEntity(_0x452838,_0x12e6ab){return function(_0x26d21a){if(_0x26d21a){return _0x26d21a['destroy']()['then'](function(){_0x452838[_0x4c7a('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x14a60a,_0x14fce4){return function(_0x4fbf19){if(!_0x4fbf19){_0x14a60a[_0x4c7a('0x21')](0x194);}return _0x4fbf19;};}function handleError(_0x258b8f,_0x3863d8){_0x3863d8=_0x3863d8||0x1f4;return function(_0x38d72d){logger[_0x4c7a('0x22')](_0x38d72d[_0x4c7a('0x23')]);if(_0x38d72d['name']){delete _0x38d72d[_0x4c7a('0x24')];}_0x258b8f[_0x4c7a('0x18')](_0x3863d8)[_0x4c7a('0x25')](_0x38d72d);};}exports[_0x4c7a('0x26')]=function(_0x3e04a9,_0x578b76){var _0x3f8039={'raw':!![],'where':{'id':_0x3e04a9[_0x4c7a('0x27')]['id']}},_0x563e67={};_0x563e67[_0x4c7a('0x28')]=_['keys'](db[_0x4c7a('0x29')][_0x4c7a('0x2a')]);_0x563e67[_0x4c7a('0x2b')]=_[_0x4c7a('0x2c')](_0x3e04a9[_0x4c7a('0x2b')]);_0x563e67[_0x4c7a('0x2d')]=_[_0x4c7a('0x2e')](_0x563e67[_0x4c7a('0x28')],_0x563e67[_0x4c7a('0x2b')]);_0x3f8039[_0x4c7a('0x2f')]=_['intersection'](_0x563e67['model'],qs[_0x4c7a('0x30')](_0x3e04a9[_0x4c7a('0x2b')][_0x4c7a('0x30')]));_0x3f8039[_0x4c7a('0x2f')]=_0x3f8039[_0x4c7a('0x2f')][_0x4c7a('0x31')]?_0x3f8039['attributes']:_0x563e67[_0x4c7a('0x28')];if(_0x3e04a9[_0x4c7a('0x2b')][_0x4c7a('0x32')]){_0x3f8039['include']=[{'all':!![]}];}_0x3f8039=_[_0x4c7a('0x33')]({},_0x3f8039,_0x3e04a9['options']);return db[_0x4c7a('0x29')]['find'](_0x3f8039)['then'](handleEntityNotFound(_0x578b76,null))[_0x4c7a('0x20')](respondWithResult(_0x578b76,null))[_0x4c7a('0x34')](handleError(_0x578b76,null));};exports[_0x4c7a('0x1f')]=function(_0x25fc61,_0x427d56){if(_0x25fc61[_0x4c7a('0x35')]['id']){delete _0x25fc61[_0x4c7a('0x35')]['id'];}return db[_0x4c7a('0x29')]['find']({'where':{'id':_0x25fc61[_0x4c7a('0x27')]['id']}})[_0x4c7a('0x20')](handleEntityNotFound(_0x427d56,null))[_0x4c7a('0x20')](saveUpdates(_0x25fc61[_0x4c7a('0x35')],null))[_0x4c7a('0x20')](respondWithResult(_0x427d56,null))[_0x4c7a('0x34')](handleError(_0x427d56,null));};exports[_0x4c7a('0x36')]=function(_0x55bf74,_0x469424){return db[_0x4c7a('0x29')][_0x4c7a('0x37')]({'where':{'id':_0x55bf74[_0x4c7a('0x27')]['id']}})[_0x4c7a('0x20')](handleEntityNotFound(_0x469424,null))['then'](removeEntity(_0x469424,null))[_0x4c7a('0x34')](handleError(_0x469424,null));}; \ No newline at end of file +var _0xb5cb=['eml-format','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','error','stack','name','show','params','model','keys','ChatApplication','rawAttributes','filters','intersection','query','attributes','fields','length','include','merge','options','catch','update','body','find','html-pdf'];(function(_0x5819a8,_0x59ea8c){var _0x19f21b=function(_0x3fa9ff){while(--_0x3fa9ff){_0x5819a8['push'](_0x5819a8['shift']());}};_0x19f21b(++_0x59ea8c);}(_0xb5cb,0x167));var _0xbb5c=function(_0x55d016,_0x30fdcf){_0x55d016=_0x55d016-0x0;var _0x57cdc5=_0xb5cb[_0x55d016];return _0x57cdc5;};'use strict';var pdf=require(_0xbb5c('0x0'));var emlformat=require(_0xbb5c('0x1'));var rimraf=require(_0xbb5c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbb5c('0x3'));var rp=require('request-promise');var moment=require(_0xbb5c('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb5c('0x5'));var util=require(_0xbb5c('0x6'));var path=require(_0xbb5c('0x7'));var sox=require(_0xbb5c('0x8'));var csv=require(_0xbb5c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb5c('0xa'));var squel=require(_0xbb5c('0xb'));var crypto=require(_0xbb5c('0xc'));var jsforce=require(_0xbb5c('0xd'));var deskjs=require(_0xbb5c('0xe'));var toCsv=require(_0xbb5c('0x9'));var querystring=require(_0xbb5c('0xf'));var Papa=require(_0xbb5c('0x10'));var Redis=require(_0xbb5c('0x11'));var authService=require(_0xbb5c('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xbb5c('0x13'));var hardwareService=require(_0xbb5c('0x14'));var logger=require('../../config/logger')(_0xbb5c('0x15'));var utils=require(_0xbb5c('0x16'));var config=require('../../config/environment');var db=require(_0xbb5c('0x17'))['db'];function respondWithStatusCode(_0x2d8992,_0x4666d1){_0x4666d1=_0x4666d1||0xcc;return function(_0x1d20c1){if(_0x1d20c1){return _0x2d8992[_0xbb5c('0x18')](_0x4666d1);}return _0x2d8992[_0xbb5c('0x19')](_0x4666d1)[_0xbb5c('0x1a')]();};}function respondWithResult(_0x2964b0,_0xd25493){_0xd25493=_0xd25493||0xc8;return function(_0x328d2a){if(_0x328d2a){return _0x2964b0[_0xbb5c('0x19')](_0xd25493)[_0xbb5c('0x1b')](_0x328d2a);}};}function respondWithFilteredResult(_0x37a982,_0xf81354){return function(_0x1cb9b4){if(_0x1cb9b4){var _0x2d569d=_0x1cb9b4[_0xbb5c('0x1c')],_0x9ce337=_0xf81354[_0xbb5c('0x1d')],_0x232f0f=_0xf81354[_0xbb5c('0x1d')]+_0xf81354[_0xbb5c('0x1e')],_0x371bd9;if(_0x232f0f>=_0x2d569d){_0x232f0f=_0x2d569d;_0x371bd9=0xc8;}else{_0x371bd9=0xce;}_0x37a982['status'](_0x371bd9);return _0x37a982[_0xbb5c('0x1f')](_0xbb5c('0x20'),_0x9ce337+'-'+_0x232f0f+'/'+_0x2d569d)['json'](_0x1cb9b4);}return null;};}function patchUpdates(_0x3319cd){return function(_0x1302a6){try{jsonpatch[_0xbb5c('0x21')](_0x1302a6,_0x3319cd,!![]);}catch(_0x1a4c5c){return BPromise[_0xbb5c('0x22')](_0x1a4c5c);}return _0x1302a6[_0xbb5c('0x23')]();};}function saveUpdates(_0x1d9291,_0xa826d9){return function(_0x2ff464){if(_0x2ff464){return _0x2ff464['update'](_0x1d9291)['then'](function(_0x317568){return _0x317568;});}return null;};}function removeEntity(_0x2e73b2,_0x1a3746){return function(_0x4e9752){if(_0x4e9752){return _0x4e9752[_0xbb5c('0x24')]()[_0xbb5c('0x25')](function(){_0x2e73b2[_0xbb5c('0x19')](0xcc)[_0xbb5c('0x1a')]();});}};}function handleEntityNotFound(_0x33d9bf,_0x53a5f6){return function(_0x2bfbd4){if(!_0x2bfbd4){_0x33d9bf[_0xbb5c('0x18')](0x194);}return _0x2bfbd4;};}function handleError(_0x28a95b,_0x449e4f){_0x449e4f=_0x449e4f||0x1f4;return function(_0x6a479d){logger[_0xbb5c('0x26')](_0x6a479d[_0xbb5c('0x27')]);if(_0x6a479d[_0xbb5c('0x28')]){delete _0x6a479d[_0xbb5c('0x28')];}_0x28a95b[_0xbb5c('0x19')](_0x449e4f)['send'](_0x6a479d);};}exports[_0xbb5c('0x29')]=function(_0x1df85b,_0x108867){var _0x1feede={'raw':!![],'where':{'id':_0x1df85b[_0xbb5c('0x2a')]['id']}},_0xf94bf7={};_0xf94bf7[_0xbb5c('0x2b')]=_[_0xbb5c('0x2c')](db[_0xbb5c('0x2d')][_0xbb5c('0x2e')]);_0xf94bf7['query']=_[_0xbb5c('0x2c')](_0x1df85b['query']);_0xf94bf7[_0xbb5c('0x2f')]=_[_0xbb5c('0x30')](_0xf94bf7[_0xbb5c('0x2b')],_0xf94bf7[_0xbb5c('0x31')]);_0x1feede[_0xbb5c('0x32')]=_[_0xbb5c('0x30')](_0xf94bf7[_0xbb5c('0x2b')],qs[_0xbb5c('0x33')](_0x1df85b['query']['fields']));_0x1feede[_0xbb5c('0x32')]=_0x1feede['attributes'][_0xbb5c('0x34')]?_0x1feede[_0xbb5c('0x32')]:_0xf94bf7[_0xbb5c('0x2b')];if(_0x1df85b[_0xbb5c('0x31')]['includeAll']){_0x1feede[_0xbb5c('0x35')]=[{'all':!![]}];}_0x1feede=_[_0xbb5c('0x36')]({},_0x1feede,_0x1df85b[_0xbb5c('0x37')]);return db[_0xbb5c('0x2d')]['find'](_0x1feede)[_0xbb5c('0x25')](handleEntityNotFound(_0x108867,null))[_0xbb5c('0x25')](respondWithResult(_0x108867,null))[_0xbb5c('0x38')](handleError(_0x108867,null));};exports[_0xbb5c('0x39')]=function(_0x28f0c0,_0xce6b8e){if(_0x28f0c0[_0xbb5c('0x3a')]['id']){delete _0x28f0c0[_0xbb5c('0x3a')]['id'];}return db[_0xbb5c('0x2d')][_0xbb5c('0x3b')]({'where':{'id':_0x28f0c0['params']['id']}})[_0xbb5c('0x25')](handleEntityNotFound(_0xce6b8e,null))['then'](saveUpdates(_0x28f0c0[_0xbb5c('0x3a')],null))['then'](respondWithResult(_0xce6b8e,null))[_0xbb5c('0x38')](handleError(_0xce6b8e,null));};exports['destroy']=function(_0x4caaa3,_0x254fa3){return db[_0xbb5c('0x2d')][_0xbb5c('0x3b')]({'where':{'id':_0x4caaa3[_0xbb5c('0x2a')]['id']}})['then'](handleEntityNotFound(_0x254fa3,null))[_0xbb5c('0x25')](removeEntity(_0x254fa3,null))[_0xbb5c('0x38')](handleError(_0x254fa3,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index ebfc37b..a6c7021 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(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'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(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'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 7f25b1a..c93e945 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 _0x31b9=['../../config/environment','jayson/promise','client','http','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x393f1a,_0x381664){var _0x55f479=function(_0x5b1e2a){while(--_0x5b1e2a){_0x393f1a['push'](_0x393f1a['shift']());}};_0x55f479(++_0x381664);}(_0x31b9,0x151));var _0x931b=function(_0x53c944,_0x4b253c){_0x53c944=_0x53c944-0x0;var _0x3d946d=_0x31b9[_0x53c944];return _0x3d946d;};'use strict';var _=require(_0x931b('0x0'));var util=require(_0x931b('0x1'));var moment=require(_0x931b('0x2'));var BPromise=require(_0x931b('0x3'));var rs=require(_0x931b('0x4'));var fs=require('fs');var Redis=require(_0x931b('0x5'));var db=require(_0x931b('0x6'))['db'];var utils=require(_0x931b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x931b('0x8'));var jayson=require(_0x931b('0x9'));var client=jayson[_0x931b('0xa')][_0x931b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x50a95d,_0x35ce15,_0x51ea1f){return new BPromise(function(_0x4416ce,_0x150d67){return client[_0x931b('0xc')](_0x50a95d,_0x51ea1f)[_0x931b('0xd')](function(_0x420d97){logger[_0x931b('0xe')](_0x931b('0xf'),_0x35ce15,_0x931b('0x10'));logger[_0x931b('0x11')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x35ce15,_0x931b('0x10'),JSON['stringify'](_0x420d97));if(_0x420d97[_0x931b('0x12')]){if(_0x420d97[_0x931b('0x12')][_0x931b('0x13')]===0x1f4){logger[_0x931b('0x12')]('ChatApplication,\x20%s,\x20%s',_0x35ce15,_0x420d97[_0x931b('0x12')][_0x931b('0x14')]);return _0x150d67(_0x420d97[_0x931b('0x12')][_0x931b('0x14')]);}logger[_0x931b('0x12')](_0x931b('0xf'),_0x35ce15,_0x420d97[_0x931b('0x12')][_0x931b('0x14')]);return _0x4416ce(_0x420d97[_0x931b('0x12')]['message']);}else{logger[_0x931b('0xe')](_0x931b('0xf'),_0x35ce15,_0x931b('0x10'));_0x4416ce(_0x420d97[_0x931b('0x15')][_0x931b('0x14')]);}})[_0x931b('0x16')](function(_0xc6ff0c){logger['error'](_0x931b('0xf'),_0x35ce15,_0xc6ff0c);_0x150d67(_0xc6ff0c);});});} \ No newline at end of file +var _0xc414=['error','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s'];(function(_0x5e3496,_0x27f8d6){var _0x21b753=function(_0x1b959f){while(--_0x1b959f){_0x5e3496['push'](_0x5e3496['shift']());}};_0x21b753(++_0x27f8d6);}(_0xc414,0x1d6));var _0x4c41=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc414[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c41('0x0'));var util=require('util');var moment=require(_0x4c41('0x1'));var BPromise=require('bluebird');var rs=require(_0x4c41('0x2'));var fs=require('fs');var Redis=require(_0x4c41('0x3'));var db=require(_0x4c41('0x4'))['db'];var utils=require(_0x4c41('0x5'));var logger=require(_0x4c41('0x6'))(_0x4c41('0x7'));var config=require(_0x4c41('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x222d9b,_0x52e601,_0x39b6df){return new BPromise(function(_0x15a332,_0x19c764){return client[_0x4c41('0x9')](_0x222d9b,_0x39b6df)[_0x4c41('0xa')](function(_0x29762d){logger[_0x4c41('0xb')](_0x4c41('0xc'),_0x52e601,_0x4c41('0xd'));logger[_0x4c41('0xe')](_0x4c41('0xf'),_0x52e601,_0x4c41('0xd'),JSON['stringify'](_0x29762d));if(_0x29762d[_0x4c41('0x10')]){if(_0x29762d[_0x4c41('0x10')]['code']===0x1f4){logger[_0x4c41('0x10')](_0x4c41('0xc'),_0x52e601,_0x29762d[_0x4c41('0x10')][_0x4c41('0x11')]);return _0x19c764(_0x29762d['error'][_0x4c41('0x11')]);}logger['error'](_0x4c41('0xc'),_0x52e601,_0x29762d['error']['message']);return _0x15a332(_0x29762d[_0x4c41('0x10')]['message']);}else{logger[_0x4c41('0xb')](_0x4c41('0xc'),_0x52e601,_0x4c41('0xd'));_0x15a332(_0x29762d['result']['message']);}})['catch'](function(_0x237313){logger[_0x4c41('0x10')](_0x4c41('0xc'),_0x52e601,_0x237313);_0x19c764(_0x237313);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index f3e7da7..8970951 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 _0x3edc=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util'];(function(_0x3d9312,_0x3363fc){var _0x3a0a42=function(_0x58cad2){while(--_0x58cad2){_0x3d9312['push'](_0x3d9312['shift']());}};_0x3a0a42(++_0x3363fc);}(_0x3edc,0x1ae));var _0xc3ed=function(_0x4a9e4a,_0x585df1){_0x4a9e4a=_0x4a9e4a-0x0;var _0xaa903e=_0x3edc[_0x4a9e4a];return _0xaa903e;};'use strict';var multer=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var path=require(_0xc3ed('0x2'));var timeout=require(_0xc3ed('0x3'));var express=require(_0xc3ed('0x4'));var router=express[_0xc3ed('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xc3ed('0x6'));var config=require(_0xc3ed('0x7'));var controller=require(_0xc3ed('0x8'));router[_0xc3ed('0x9')](_0xc3ed('0xa'),auth[_0xc3ed('0xb')](),controller[_0xc3ed('0xc')]);router[_0xc3ed('0xd')]('/:id',auth['isAuthenticated'](),controller[_0xc3ed('0xe')]);router[_0xc3ed('0xf')](_0xc3ed('0xa'),auth[_0xc3ed('0xb')](),controller[_0xc3ed('0x10')]);module[_0xc3ed('0x11')]=router; \ No newline at end of file +var _0xcb6f=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','isAuthenticated','show','put','delete','/:id'];(function(_0x52a445,_0x5de583){var _0x3deea6=function(_0x5ba44e){while(--_0x5ba44e){_0x52a445['push'](_0x52a445['shift']());}};_0x3deea6(++_0x5de583);}(_0xcb6f,0xc0));var _0xfcb6=function(_0x31e846,_0x8f12a5){_0x31e846=_0x31e846-0x0;var _0x48bd1e=_0xcb6f[_0x31e846];return _0x48bd1e;};'use strict';var multer=require(_0xfcb6('0x0'));var util=require(_0xfcb6('0x1'));var path=require(_0xfcb6('0x2'));var timeout=require(_0xfcb6('0x3'));var express=require(_0xfcb6('0x4'));var router=express[_0xfcb6('0x5')]();var auth=require(_0xfcb6('0x6'));var interaction=require(_0xfcb6('0x7'));var config=require(_0xfcb6('0x8'));var controller=require(_0xfcb6('0x9'));router[_0xfcb6('0xa')]('/:id',auth[_0xfcb6('0xb')](),controller[_0xfcb6('0xc')]);router[_0xfcb6('0xd')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xfcb6('0xe')](_0xfcb6('0xf'),auth[_0xfcb6('0xb')](),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 c1889ef..07db6f3 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 _0x1f7d=['STRING','sequelize'];(function(_0x4e797d,_0x5295bc){var _0x56672a=function(_0x7f474b){while(--_0x7f474b){_0x4e797d['push'](_0x4e797d['shift']());}};_0x56672a(++_0x5295bc);}(_0x1f7d,0x107));var _0xd1f7=function(_0x31029e,_0x41333e){_0x31029e=_0x31029e-0x0;var _0x3d52af=_0x1f7d[_0x31029e];return _0x3d52af;};'use strict';var Sequelize=require(_0xd1f7('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0xd1f7('0x1')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x0baa=['STRING','BOOLEAN'];(function(_0x51af40,_0xed6bd4){var _0x2026bf=function(_0x295d67){while(--_0x295d67){_0x51af40['push'](_0x51af40['shift']());}};_0x2026bf(++_0xed6bd4);}(_0x0baa,0x1da));var _0xa0ba=function(_0x4f81a1,_0x5a2473){_0x4f81a1=_0x4f81a1-0x0;var _0x35e1b8=_0x0baa[_0x4f81a1];return _0x35e1b8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xa0ba('0x0')],'allowNull':![]},'description':{'type':Sequelize[_0xa0ba('0x0')]},'write':{'type':Sequelize[_0xa0ba('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 1502f42..5d0f593 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 _0x277b=['request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','map','merge','options','ChatGroup','includeAll','include','params','create','body','find','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','getMessages','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x1eb4b0,_0x275d66){var _0x470198=function(_0x3d1e71){while(--_0x3d1e71){_0x1eb4b0['push'](_0x1eb4b0['shift']());}};_0x470198(++_0x275d66);}(_0x277b,0xb9));var _0xb277=function(_0x11005e,_0x20c3d2){_0x11005e=_0x11005e-0x0;var _0x29338f=_0x277b[_0x11005e];return _0x29338f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb277('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb277('0x1'));var jsonpatch=require(_0xb277('0x2'));var rp=require(_0xb277('0x3'));var moment=require(_0xb277('0x4'));var BPromise=require(_0xb277('0x5'));var Mustache=require(_0xb277('0x6'));var util=require('util');var path=require(_0xb277('0x7'));var sox=require('sox');var csv=require(_0xb277('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb277('0x9'));var squel=require('squel');var crypto=require(_0xb277('0xa'));var jsforce=require(_0xb277('0xb'));var deskjs=require(_0xb277('0xc'));var toCsv=require(_0xb277('0x8'));var querystring=require(_0xb277('0xd'));var Papa=require('papaparse');var Redis=require(_0xb277('0xe'));var authService=require(_0xb277('0xf'));var qs=require(_0xb277('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb277('0x11'));var logger=require(_0xb277('0x12'))('api');var utils=require(_0xb277('0x13'));var config=require(_0xb277('0x14'));var db=require('../../mysqldb')['db'];config[_0xb277('0x15')]=_[_0xb277('0x16')](config[_0xb277('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xb277('0x17'))(new Redis(config['redis']));require(_0xb277('0x18'))[_0xb277('0x19')](socket);var jayson=require(_0xb277('0x1a'));var client=jayson[_0xb277('0x1b')][_0xb277('0x1c')]({'port':0x232a});function checkPasswordPattern(_0xd70014,_0x18dd5e,_0x5699d7){if(_0x5699d7){var _0x4be196=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4be196[_0xb277('0x1d')](_0x18dd5e)){return _0xd70014;}else{throw new db[(_0xb277('0x1e'))][(_0xb277('0x1f'))](_0xb277('0x20'));}}else{return _0xd70014;}}function respondWithRpcPromise(_0x2fc328,_0x2b2ae7,_0x3ac4d3,_0x3eaf08){return new BPromise(function(_0x1aee53,_0x2bfdb3){var _0x3e84b9=_0x3eaf08||client;return _0x3e84b9[_0xb277('0x21')](_0x2fc328,_0x3ac4d3)[_0xb277('0x22')](function(_0x9d0278){logger[_0xb277('0x23')](_0xb277('0x24'),_0x2b2ae7,_0xb277('0x25'));logger[_0xb277('0x26')](_0xb277('0x27'),_0x2b2ae7,_0xb277('0x25'),JSON[_0xb277('0x28')](_0x9d0278));if(_0x9d0278[_0xb277('0x29')]){if(_0x9d0278['error'][_0xb277('0x2a')]===0x1f4){logger[_0xb277('0x29')](_0xb277('0x24'),_0x2b2ae7,_0x9d0278[_0xb277('0x29')][_0xb277('0x2b')]);return _0x2bfdb3(_0x9d0278[_0xb277('0x29')][_0xb277('0x2b')]);}logger[_0xb277('0x29')](_0xb277('0x24'),_0x2b2ae7,_0x9d0278[_0xb277('0x29')][_0xb277('0x2b')]);return _0x1aee53(_0x9d0278[_0xb277('0x29')]['message']);}else{logger[_0xb277('0x23')](_0xb277('0x24'),_0x2b2ae7,'request\x20sent');_0x1aee53(_0x9d0278['result'][_0xb277('0x2b')]);}})[_0xb277('0x2c')](function(_0x2dcb30){logger[_0xb277('0x29')](_0xb277('0x24'),_0x2b2ae7,_0x2dcb30);_0x2bfdb3(_0x2dcb30);});});}function respondWithStatusCode(_0x346c61,_0x287ec9){_0x287ec9=_0x287ec9||0xcc;return function(_0x8538da){if(_0x8538da){return _0x346c61[_0xb277('0x2d')](_0x287ec9);}return _0x346c61[_0xb277('0x2e')](_0x287ec9)[_0xb277('0x2f')]();};}function respondWithResult(_0x104193,_0xc3460a){_0xc3460a=_0xc3460a||0xc8;return function(_0x5356ae){if(_0x5356ae){return _0x104193[_0xb277('0x2e')](_0xc3460a)[_0xb277('0x30')](_0x5356ae);}};}function respondWithFilteredResult(_0x282977,_0x515546){return function(_0x4be1c2){if(_0x4be1c2){var _0x27c808=_0x4be1c2[_0xb277('0x31')],_0x121edd=_0x515546[_0xb277('0x32')],_0x270438=_0x515546[_0xb277('0x32')]+_0x515546[_0xb277('0x33')],_0x445d40;if(_0x270438>=_0x27c808){_0x270438=_0x27c808;_0x445d40=0xc8;}else{_0x445d40=0xce;}_0x282977[_0xb277('0x2e')](_0x445d40);return _0x282977[_0xb277('0x34')](_0xb277('0x35'),_0x121edd+'-'+_0x270438+'/'+_0x27c808)[_0xb277('0x30')](_0x4be1c2);}return null;};}function patchUpdates(_0x159693){return function(_0x101300){try{jsonpatch[_0xb277('0x36')](_0x101300,_0x159693,!![]);}catch(_0x1a64a5){return BPromise[_0xb277('0x37')](_0x1a64a5);}return _0x101300[_0xb277('0x38')]();};}function saveUpdates(_0x5cb595,_0xafad65){return function(_0x29ed2e){if(_0x29ed2e){return _0x29ed2e[_0xb277('0x39')](_0x5cb595)[_0xb277('0x22')](function(_0xf15387){return _0xf15387;});}return null;};}function removeEntity(_0x248099,_0x326a41){return function(_0x4e62f7){if(_0x4e62f7){return _0x4e62f7[_0xb277('0x3a')]()[_0xb277('0x22')](function(){_0x248099[_0xb277('0x2e')](0xcc)[_0xb277('0x2f')]();});}};}function handleEntityNotFound(_0x406829,_0x25f1e4){return function(_0x5dec2d){if(!_0x5dec2d){_0x406829[_0xb277('0x2d')](0x194);}return _0x5dec2d;};}function handleError(_0x54e40c,_0x2b0985){_0x2b0985=_0x2b0985||0x1f4;return function(_0x33d0c2){logger[_0xb277('0x29')](_0x33d0c2[_0xb277('0x3b')]);if(_0x33d0c2[_0xb277('0x3c')]){delete _0x33d0c2[_0xb277('0x3c')];}_0x54e40c[_0xb277('0x2e')](_0x2b0985)[_0xb277('0x3d')](_0x33d0c2);};}exports[_0xb277('0x3e')]=function(_0x202d23,_0x153264){var _0x5b5706={},_0xdc91ba={},_0x15a0d2={'count':0x0,'rows':[]};var _0x8d209a=_['map'](db['ChatGroup'][_0xb277('0x3f')],function(_0x9c186){return{'name':_0x9c186['fieldName'],'type':_0x9c186[_0xb277('0x40')][_0xb277('0x41')]};});_0xdc91ba['model']=_['map'](_0x8d209a,'name');_0xdc91ba[_0xb277('0x42')]=_[_0xb277('0x43')](_0x202d23[_0xb277('0x42')]);_0xdc91ba['filters']=_[_0xb277('0x44')](_0xdc91ba[_0xb277('0x45')],_0xdc91ba[_0xb277('0x42')]);_0x5b5706[_0xb277('0x46')]=_[_0xb277('0x44')](_0xdc91ba[_0xb277('0x45')],qs['fields'](_0x202d23[_0xb277('0x42')][_0xb277('0x47')]));_0x5b5706[_0xb277('0x46')]=_0x5b5706['attributes'][_0xb277('0x48')]?_0x5b5706[_0xb277('0x46')]:_0xdc91ba[_0xb277('0x45')];if(!_0x202d23['query'][_0xb277('0x49')]('nolimit')){_0x5b5706[_0xb277('0x33')]=qs[_0xb277('0x33')](_0x202d23['query']['limit']);_0x5b5706['offset']=qs['offset'](_0x202d23['query'][_0xb277('0x32')]);}_0x5b5706[_0xb277('0x4a')]=qs['sort'](_0x202d23[_0xb277('0x42')][_0xb277('0x4b')]);_0x5b5706[_0xb277('0x4c')]=qs[_0xb277('0x4d')](_[_0xb277('0x4e')](_0x202d23[_0xb277('0x42')],_0xdc91ba[_0xb277('0x4d')]));if(_0x202d23['query'][_0xb277('0x4f')]){_0x5b5706[_0xb277('0x4c')]=_['merge'](_0x5b5706[_0xb277('0x4c')],{'$or':_[_0xb277('0x50')](_0x8d209a,function(_0x52fffd){if(_0x52fffd[_0xb277('0x40')]!=='VIRTUAL'){var _0x3bcdfe={};_0x3bcdfe[_0x52fffd['name']]={'$like':'%'+_0x202d23[_0xb277('0x42')]['filter']+'%'};return _0x3bcdfe;}})});}_0x5b5706=_[_0xb277('0x51')]({},_0x5b5706,_0x202d23[_0xb277('0x52')]);var _0x9dcc4a={'where':_0x5b5706[_0xb277('0x4c')]};return db[_0xb277('0x53')][_0xb277('0x31')](_0x9dcc4a)[_0xb277('0x22')](function(_0x56bc63){_0x15a0d2['count']=_0x56bc63;if(_0x202d23[_0xb277('0x42')][_0xb277('0x54')]){_0x5b5706[_0xb277('0x55')]=[{'all':!![]}];}return db[_0xb277('0x53')]['findAll'](_0x5b5706);})[_0xb277('0x22')](function(_0x3eb470){_0x15a0d2['rows']=_0x3eb470;return _0x15a0d2;})[_0xb277('0x22')](respondWithFilteredResult(_0x153264,_0x5b5706))['catch'](handleError(_0x153264,null));};exports['show']=function(_0x1578a1,_0x5ea29f){var _0x463de7={'raw':!![],'where':{'id':_0x1578a1[_0xb277('0x56')]['id']}},_0x4e9106={};_0x4e9106[_0xb277('0x45')]=_['keys'](db[_0xb277('0x53')][_0xb277('0x3f')]);_0x4e9106['query']=_[_0xb277('0x43')](_0x1578a1[_0xb277('0x42')]);_0x4e9106[_0xb277('0x4d')]=_[_0xb277('0x44')](_0x4e9106[_0xb277('0x45')],_0x4e9106[_0xb277('0x42')]);_0x463de7['attributes']=_['intersection'](_0x4e9106[_0xb277('0x45')],qs[_0xb277('0x47')](_0x1578a1[_0xb277('0x42')]['fields']));_0x463de7['attributes']=_0x463de7[_0xb277('0x46')][_0xb277('0x48')]?_0x463de7[_0xb277('0x46')]:_0x4e9106[_0xb277('0x45')];if(_0x1578a1['query'][_0xb277('0x54')]){_0x463de7[_0xb277('0x55')]=[{'all':!![]}];}_0x463de7=_[_0xb277('0x51')]({},_0x463de7,_0x1578a1[_0xb277('0x52')]);return db['ChatGroup']['find'](_0x463de7)[_0xb277('0x22')](handleEntityNotFound(_0x5ea29f,null))[_0xb277('0x22')](respondWithResult(_0x5ea29f,null))[_0xb277('0x2c')](handleError(_0x5ea29f,null));};exports[_0xb277('0x57')]=function(_0x2e98cb,_0x322c5b){return db[_0xb277('0x53')][_0xb277('0x57')](_0x2e98cb[_0xb277('0x58')],{})[_0xb277('0x22')](respondWithResult(_0x322c5b,0xc9))[_0xb277('0x2c')](handleError(_0x322c5b,null));};exports['update']=function(_0x98f567,_0x4c7af0){if(_0x98f567[_0xb277('0x58')]['id']){delete _0x98f567[_0xb277('0x58')]['id'];}return db['ChatGroup'][_0xb277('0x59')]({'where':{'id':_0x98f567['params']['id']}})[_0xb277('0x22')](handleEntityNotFound(_0x4c7af0,null))[_0xb277('0x22')](saveUpdates(_0x98f567[_0xb277('0x58')],null))['then'](respondWithResult(_0x4c7af0,null))[_0xb277('0x2c')](handleError(_0x4c7af0,null));};exports[_0xb277('0x3a')]=function(_0x592dc,_0x81ef3e){return db[_0xb277('0x53')]['find']({'where':{'id':_0x592dc['params']['id']}})[_0xb277('0x22')](handleEntityNotFound(_0x81ef3e,null))[_0xb277('0x22')](removeEntity(_0x81ef3e,null))[_0xb277('0x2c')](handleError(_0x81ef3e,null));};exports[_0xb277('0x5a')]=function(_0x111e13,_0x10576c){return db['ChatGroup'][_0xb277('0x5a')]()[_0xb277('0x22')](respondWithResult(_0x10576c,null))[_0xb277('0x2c')](handleError(_0x10576c,null));};exports[_0xb277('0x5b')]=function(_0x4cc90b,_0x1d5ac7,_0x5170fb){return db['ChatInternalMessage']['count']({'where':{'ChatGroupId':_0x4cc90b['params']['id'],'ToId':_0x4cc90b[_0xb277('0x5c')]['id'],'read':![]}})[_0xb277('0x22')](function(_0x446674){return{'id':_[_0xb277('0x5d')](_0x4cc90b[_0xb277('0x56')]['id']),'count':_0x446674};})[_0xb277('0x22')](respondWithResult(_0x1d5ac7,null))[_0xb277('0x2c')](handleError(_0x1d5ac7,null));};exports[_0xb277('0x5e')]=function(_0x5a896a,_0x163391,_0x1f1621){return db[_0xb277('0x53')][_0xb277('0x59')]({'where':{'id':_0x5a896a[_0xb277('0x56')]['id']}})[_0xb277('0x22')](handleEntityNotFound(_0x163391,null))[_0xb277('0x22')](function(_0x220d68){if(_0x220d68){return _0x220d68[_0xb277('0x5e')](_0x5a896a[_0xb277('0x58')][_0xb277('0x5f')],_[_0xb277('0x60')](_0x5a896a['body'],[_0xb277('0x5f'),'id'])||{});}})[_0xb277('0x22')](respondWithResult(_0x163391,null))[_0xb277('0x2c')](handleError(_0x163391,null));};exports[_0xb277('0x61')]=function(_0x160d89,_0x3ee81d,_0x35c920){var _0x577ea4={};var _0x241284={};var _0x1618af;var _0x57311a;return db[_0xb277('0x53')][_0xb277('0x62')]({'where':{'id':_0x160d89[_0xb277('0x56')]['id']}})[_0xb277('0x22')](handleEntityNotFound(_0x3ee81d,null))[_0xb277('0x22')](function(_0x10a1b8){if(_0x10a1b8){_0x1618af=_0x10a1b8;_0x241284[_0xb277('0x45')]=_['keys'](db[_0xb277('0x63')][_0xb277('0x3f')]);_0x241284[_0xb277('0x42')]=_[_0xb277('0x43')](_0x160d89[_0xb277('0x42')]);_0x241284[_0xb277('0x4d')]=_[_0xb277('0x44')](_0x241284[_0xb277('0x45')],_0x241284['query']);_0x577ea4[_0xb277('0x46')]=_[_0xb277('0x44')](_0x241284[_0xb277('0x45')],qs[_0xb277('0x47')](_0x160d89[_0xb277('0x42')][_0xb277('0x47')]));_0x577ea4[_0xb277('0x46')]=_0x577ea4[_0xb277('0x46')][_0xb277('0x48')]?_0x577ea4[_0xb277('0x46')]:_0x241284[_0xb277('0x45')];_0x577ea4[_0xb277('0x4a')]=qs['sort'](_0x160d89['query'][_0xb277('0x4b')]);_0x577ea4[_0xb277('0x4c')]=qs[_0xb277('0x4d')](_[_0xb277('0x4e')](_0x160d89[_0xb277('0x42')],_0x241284[_0xb277('0x4d')]));if(_0x160d89[_0xb277('0x42')][_0xb277('0x4f')]){_0x577ea4[_0xb277('0x4c')]=_[_0xb277('0x51')](_0x577ea4[_0xb277('0x4c')],{'$or':_[_0xb277('0x50')](_0x577ea4[_0xb277('0x46')],function(_0x5d1012){var _0x12cfc1={};_0x12cfc1[_0x5d1012]={'$like':'%'+_0x160d89['query']['filter']+'%'};return _0x12cfc1;})});}_0x577ea4=_[_0xb277('0x51')]({},_0x577ea4,_0x160d89[_0xb277('0x52')]);return _0x1618af[_0xb277('0x61')](_0x577ea4);}})[_0xb277('0x22')](function(_0x22b905){if(_0x22b905){_0x57311a=_0x22b905['length'];if(!_0x160d89[_0xb277('0x42')][_0xb277('0x49')](_0xb277('0x64'))){_0x577ea4[_0xb277('0x33')]=qs[_0xb277('0x33')](_0x160d89['query'][_0xb277('0x33')]);_0x577ea4['offset']=qs[_0xb277('0x32')](_0x160d89[_0xb277('0x42')][_0xb277('0x32')]);}return _0x1618af[_0xb277('0x61')](_0x577ea4);}})[_0xb277('0x22')](function(_0x531fbf){if(_0x531fbf){return _0x531fbf?{'count':_0x57311a,'rows':_0x531fbf}:null;}})[_0xb277('0x22')](respondWithResult(_0x3ee81d,null))[_0xb277('0x2c')](handleError(_0x3ee81d,null));};exports[_0xb277('0x65')]=function(_0x4293a5,_0x23ebff,_0x14702d){return db[_0xb277('0x53')][_0xb277('0x59')]({'where':{'id':_0x4293a5[_0xb277('0x56')]['id']}})[_0xb277('0x22')](handleEntityNotFound(_0x23ebff,null))[_0xb277('0x22')](function(_0x338ca9){if(_0x338ca9){return _0x338ca9[_0xb277('0x65')](_0x4293a5[_0xb277('0x42')][_0xb277('0x5f')]);}})[_0xb277('0x22')](respondWithStatusCode(_0x23ebff,null))[_0xb277('0x2c')](handleError(_0x23ebff,null));};exports[_0xb277('0x66')]=function(_0x1bb562,_0x19ff61,_0x5bff0d){if(_0x1bb562[_0xb277('0x58')]['id']){delete _0x1bb562[_0xb277('0x58')]['id'];}return db['ChatGroup'][_0xb277('0x59')]({'where':{'id':_0x1bb562[_0xb277('0x56')]['id']}})['then'](handleEntityNotFound(_0x19ff61,null))[_0xb277('0x22')](function(_0x498493){if(_0x498493){_0x1bb562[_0xb277('0x58')][_0xb277('0x67')]=_0x498493['id'];return db[_0xb277('0x68')][_0xb277('0x57')](_0x1bb562['body']);}})['then'](respondWithResult(_0x19ff61,null))[_0xb277('0x2c')](handleError(_0x19ff61,null));};exports['getMessages']=function(_0x37905e,_0x51143c,_0x1e55e7){var _0x32bc9d={};var _0x4be18e={};var _0x233b7a;var _0x373211;return db[_0xb277('0x53')][_0xb277('0x62')]({'where':{'id':_0x37905e[_0xb277('0x56')]['id']}})[_0xb277('0x22')](handleEntityNotFound(_0x51143c,null))['then'](function(_0x3e8623){if(_0x3e8623){_0x233b7a=_0x3e8623;_0x4be18e[_0xb277('0x45')]=_[_0xb277('0x43')](db['ChatInternalMessage']['rawAttributes']);_0x4be18e[_0xb277('0x42')]=_[_0xb277('0x43')](_0x37905e['query']);_0x4be18e[_0xb277('0x4d')]=_[_0xb277('0x44')](_0x4be18e[_0xb277('0x45')],_0x4be18e[_0xb277('0x42')]);_0x32bc9d['attributes']=_[_0xb277('0x44')](_0x4be18e['model'],qs['fields'](_0x37905e[_0xb277('0x42')][_0xb277('0x47')]));_0x32bc9d[_0xb277('0x46')]=_0x32bc9d['attributes'][_0xb277('0x48')]?_0x32bc9d[_0xb277('0x46')]:_0x4be18e[_0xb277('0x45')];_0x32bc9d[_0xb277('0x4a')]=qs[_0xb277('0x4b')](_0x37905e['query'][_0xb277('0x4b')]);_0x32bc9d['where']=qs[_0xb277('0x4d')](_[_0xb277('0x4e')](_0x37905e[_0xb277('0x42')],_0x4be18e[_0xb277('0x4d')]));if(_0x37905e[_0xb277('0x42')][_0xb277('0x4f')]){_0x32bc9d[_0xb277('0x4c')]=_[_0xb277('0x51')](_0x32bc9d[_0xb277('0x4c')],{'$or':_[_0xb277('0x50')](_0x32bc9d[_0xb277('0x46')],function(_0x48d419){var _0x7720dc={};_0x7720dc[_0x48d419]={'$like':'%'+_0x37905e['query'][_0xb277('0x4f')]+'%'};return _0x7720dc;})});}if(_0x37905e[_0xb277('0x42')][_0xb277('0x69')]){var _0x2f9eea=_0x37905e[_0xb277('0x42')]['$gte']['split'](',');var _0x1dd7e3={};_0x1dd7e3[_0x2f9eea[0x0]]={'$gte':moment(_0x2f9eea[0x1])[_0xb277('0x6a')](_0xb277('0x6b'))};_0x32bc9d[_0xb277('0x4c')]=_['merge'](_0x32bc9d[_0xb277('0x4c')],_0x1dd7e3);}_0x32bc9d=_[_0xb277('0x51')]({},_0x32bc9d,_0x37905e[_0xb277('0x52')]);return _0x233b7a['getMessages'](_0x32bc9d);}})[_0xb277('0x22')](function(_0x960be3){if(_0x960be3){_0x373211=_0x960be3[_0xb277('0x48')];if(!_0x37905e[_0xb277('0x42')][_0xb277('0x49')]('nolimit')){_0x32bc9d['limit']=qs[_0xb277('0x33')](_0x37905e[_0xb277('0x42')]['limit']);_0x32bc9d[_0xb277('0x32')]=qs[_0xb277('0x32')](_0x37905e[_0xb277('0x42')][_0xb277('0x32')]);}return _0x233b7a[_0xb277('0x6c')](_0x32bc9d);}})[_0xb277('0x22')](function(_0xfb6f77){if(_0xfb6f77){return _0xfb6f77?{'count':_0x373211,'rows':_0xfb6f77}:null;}})[_0xb277('0x22')](respondWithResult(_0x51143c,null))[_0xb277('0x2c')](handleError(_0x51143c,null));}; \ No newline at end of file +var _0x6de6=['Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','status','json','count','offset','set','Content-Range','apply','save','update','destroy','then','end','sendStatus','stack','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','limit','order','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','include','options','find','create','body','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','omit','findOne','sort','getMembers','nolimit','removeMembers','ids','addMessage','ChatGroupId','getMessages','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','squel','crypto','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./chatGroup.socket','register','jayson/promise','client'];(function(_0x5b7696,_0x3ebd92){var _0x42d7b9=function(_0x8afd44){while(--_0x8afd44){_0x5b7696['push'](_0x5b7696['shift']());}};_0x42d7b9(++_0x3ebd92);}(_0x6de6,0x18d));var _0x66de=function(_0x1fa274,_0x27a51f){_0x1fa274=_0x1fa274-0x0;var _0x5601e0=_0x6de6[_0x1fa274];return _0x5601e0;};'use strict';var pdf=require(_0x66de('0x0'));var emlformat=require(_0x66de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x66de('0x2'));var jsonpatch=require(_0x66de('0x3'));var rp=require(_0x66de('0x4'));var moment=require('moment');var BPromise=require(_0x66de('0x5'));var Mustache=require(_0x66de('0x6'));var util=require(_0x66de('0x7'));var path=require('path');var sox=require(_0x66de('0x8'));var csv=require(_0x66de('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x66de('0xa'));var crypto=require(_0x66de('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x66de('0xc'));var authService=require(_0x66de('0xd'));var qs=require(_0x66de('0xe'));var as=require(_0x66de('0xf'));var hardwareService=require(_0x66de('0x10'));var logger=require(_0x66de('0x11'))(_0x66de('0x12'));var utils=require('../../config/utils');var config=require(_0x66de('0x13'));var db=require(_0x66de('0x14'))['db'];config[_0x66de('0x15')]=_['defaults'](config['redis'],{'host':_0x66de('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x66de('0x15')]));require(_0x66de('0x17'))[_0x66de('0x18')](socket);var jayson=require(_0x66de('0x19'));var client=jayson[_0x66de('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x243947,_0x58553c,_0x16423c){if(_0x16423c){var _0x28218f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x28218f['test'](_0x58553c)){return _0x243947;}else{throw new db[(_0x66de('0x1b'))][(_0x66de('0x1c'))](_0x66de('0x1d'));}}else{return _0x243947;}}function respondWithRpcPromise(_0x2ad857,_0x11b2ae,_0x3163b7,_0x1f635b){return new BPromise(function(_0x4b7878,_0x2c92a7){var _0x414898=_0x1f635b||client;return _0x414898['request'](_0x2ad857,_0x3163b7)['then'](function(_0x3b53a6){logger[_0x66de('0x1e')](_0x66de('0x1f'),_0x11b2ae,_0x66de('0x20'));logger[_0x66de('0x21')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x11b2ae,_0x66de('0x20'),JSON['stringify'](_0x3b53a6));if(_0x3b53a6[_0x66de('0x22')]){if(_0x3b53a6[_0x66de('0x22')][_0x66de('0x23')]===0x1f4){logger['error']('ChatGroup,\x20%s,\x20%s',_0x11b2ae,_0x3b53a6['error'][_0x66de('0x24')]);return _0x2c92a7(_0x3b53a6['error']['message']);}logger[_0x66de('0x22')](_0x66de('0x1f'),_0x11b2ae,_0x3b53a6[_0x66de('0x22')]['message']);return _0x4b7878(_0x3b53a6['error'][_0x66de('0x24')]);}else{logger[_0x66de('0x1e')](_0x66de('0x1f'),_0x11b2ae,_0x66de('0x20'));_0x4b7878(_0x3b53a6['result'][_0x66de('0x24')]);}})[_0x66de('0x25')](function(_0xd29778){logger[_0x66de('0x22')](_0x66de('0x1f'),_0x11b2ae,_0xd29778);_0x2c92a7(_0xd29778);});});}function respondWithStatusCode(_0x3e36c8,_0x2bf4d1){_0x2bf4d1=_0x2bf4d1||0xcc;return function(_0x44c216){if(_0x44c216){return _0x3e36c8['sendStatus'](_0x2bf4d1);}return _0x3e36c8[_0x66de('0x26')](_0x2bf4d1)['end']();};}function respondWithResult(_0x1b92a7,_0x43a8a7){_0x43a8a7=_0x43a8a7||0xc8;return function(_0xfe2b00){if(_0xfe2b00){return _0x1b92a7['status'](_0x43a8a7)[_0x66de('0x27')](_0xfe2b00);}};}function respondWithFilteredResult(_0x49abfd,_0x15c4ef){return function(_0xf1f67){if(_0xf1f67){var _0x23f979=_0xf1f67[_0x66de('0x28')],_0xfb315f=_0x15c4ef[_0x66de('0x29')],_0x42d192=_0x15c4ef[_0x66de('0x29')]+_0x15c4ef['limit'],_0x5be436;if(_0x42d192>=_0x23f979){_0x42d192=_0x23f979;_0x5be436=0xc8;}else{_0x5be436=0xce;}_0x49abfd[_0x66de('0x26')](_0x5be436);return _0x49abfd[_0x66de('0x2a')](_0x66de('0x2b'),_0xfb315f+'-'+_0x42d192+'/'+_0x23f979)[_0x66de('0x27')](_0xf1f67);}return null;};}function patchUpdates(_0x744251){return function(_0x577b78){try{jsonpatch[_0x66de('0x2c')](_0x577b78,_0x744251,!![]);}catch(_0x35666b){return BPromise['reject'](_0x35666b);}return _0x577b78[_0x66de('0x2d')]();};}function saveUpdates(_0x55db17,_0x4acc25){return function(_0x3f7ae7){if(_0x3f7ae7){return _0x3f7ae7[_0x66de('0x2e')](_0x55db17)['then'](function(_0x55f090){return _0x55f090;});}return null;};}function removeEntity(_0x35f1ef,_0x4ad54b){return function(_0x476a79){if(_0x476a79){return _0x476a79[_0x66de('0x2f')]()[_0x66de('0x30')](function(){_0x35f1ef[_0x66de('0x26')](0xcc)[_0x66de('0x31')]();});}};}function handleEntityNotFound(_0x3280ce,_0x414887){return function(_0x280681){if(!_0x280681){_0x3280ce[_0x66de('0x32')](0x194);}return _0x280681;};}function handleError(_0x16b3cd,_0x4115e0){_0x4115e0=_0x4115e0||0x1f4;return function(_0x54187f){logger['error'](_0x54187f[_0x66de('0x33')]);if(_0x54187f['name']){delete _0x54187f[_0x66de('0x34')];}_0x16b3cd[_0x66de('0x26')](_0x4115e0)[_0x66de('0x35')](_0x54187f);};}exports[_0x66de('0x36')]=function(_0x33a116,_0xefbed9){var _0x20041b={},_0x595f19={},_0x62c30a={'count':0x0,'rows':[]};var _0x1e0e4b=_[_0x66de('0x37')](db[_0x66de('0x38')][_0x66de('0x39')],function(_0x276f0f){return{'name':_0x276f0f[_0x66de('0x3a')],'type':_0x276f0f[_0x66de('0x3b')][_0x66de('0x3c')]};});_0x595f19['model']=_[_0x66de('0x37')](_0x1e0e4b,_0x66de('0x34'));_0x595f19[_0x66de('0x3d')]=_[_0x66de('0x3e')](_0x33a116[_0x66de('0x3d')]);_0x595f19[_0x66de('0x3f')]=_[_0x66de('0x40')](_0x595f19['model'],_0x595f19['query']);_0x20041b['attributes']=_['intersection'](_0x595f19[_0x66de('0x41')],qs[_0x66de('0x42')](_0x33a116[_0x66de('0x3d')][_0x66de('0x42')]));_0x20041b[_0x66de('0x43')]=_0x20041b['attributes'][_0x66de('0x44')]?_0x20041b[_0x66de('0x43')]:_0x595f19[_0x66de('0x41')];if(!_0x33a116[_0x66de('0x3d')][_0x66de('0x45')]('nolimit')){_0x20041b['limit']=qs[_0x66de('0x46')](_0x33a116[_0x66de('0x3d')][_0x66de('0x46')]);_0x20041b[_0x66de('0x29')]=qs[_0x66de('0x29')](_0x33a116[_0x66de('0x3d')][_0x66de('0x29')]);}_0x20041b[_0x66de('0x47')]=qs['sort'](_0x33a116[_0x66de('0x3d')]['sort']);_0x20041b[_0x66de('0x48')]=qs['filters'](_[_0x66de('0x49')](_0x33a116[_0x66de('0x3d')],_0x595f19[_0x66de('0x3f')]));if(_0x33a116[_0x66de('0x3d')][_0x66de('0x4a')]){_0x20041b['where']=_[_0x66de('0x4b')](_0x20041b[_0x66de('0x48')],{'$or':_[_0x66de('0x37')](_0x1e0e4b,function(_0x95e249){if(_0x95e249[_0x66de('0x3b')]!==_0x66de('0x4c')){var _0x551dbd={};_0x551dbd[_0x95e249[_0x66de('0x34')]]={'$like':'%'+_0x33a116[_0x66de('0x3d')][_0x66de('0x4a')]+'%'};return _0x551dbd;}})});}_0x20041b=_[_0x66de('0x4b')]({},_0x20041b,_0x33a116['options']);var _0x32eaae={'where':_0x20041b[_0x66de('0x48')]};return db[_0x66de('0x38')][_0x66de('0x28')](_0x32eaae)[_0x66de('0x30')](function(_0x1f474c){_0x62c30a[_0x66de('0x28')]=_0x1f474c;if(_0x33a116[_0x66de('0x3d')][_0x66de('0x4d')]){_0x20041b['include']=[{'all':!![]}];}return db[_0x66de('0x38')][_0x66de('0x4e')](_0x20041b);})[_0x66de('0x30')](function(_0x3c01ef){_0x62c30a[_0x66de('0x4f')]=_0x3c01ef;return _0x62c30a;})[_0x66de('0x30')](respondWithFilteredResult(_0xefbed9,_0x20041b))[_0x66de('0x25')](handleError(_0xefbed9,null));};exports[_0x66de('0x50')]=function(_0x294471,_0x5df9c5){var _0x2a16a1={'raw':!![],'where':{'id':_0x294471[_0x66de('0x51')]['id']}},_0xd46f22={};_0xd46f22['model']=_[_0x66de('0x3e')](db[_0x66de('0x38')][_0x66de('0x39')]);_0xd46f22[_0x66de('0x3d')]=_[_0x66de('0x3e')](_0x294471[_0x66de('0x3d')]);_0xd46f22['filters']=_[_0x66de('0x40')](_0xd46f22[_0x66de('0x41')],_0xd46f22['query']);_0x2a16a1[_0x66de('0x43')]=_[_0x66de('0x40')](_0xd46f22[_0x66de('0x41')],qs[_0x66de('0x42')](_0x294471[_0x66de('0x3d')][_0x66de('0x42')]));_0x2a16a1['attributes']=_0x2a16a1['attributes'][_0x66de('0x44')]?_0x2a16a1[_0x66de('0x43')]:_0xd46f22[_0x66de('0x41')];if(_0x294471[_0x66de('0x3d')][_0x66de('0x4d')]){_0x2a16a1[_0x66de('0x52')]=[{'all':!![]}];}_0x2a16a1=_[_0x66de('0x4b')]({},_0x2a16a1,_0x294471[_0x66de('0x53')]);return db['ChatGroup'][_0x66de('0x54')](_0x2a16a1)[_0x66de('0x30')](handleEntityNotFound(_0x5df9c5,null))[_0x66de('0x30')](respondWithResult(_0x5df9c5,null))['catch'](handleError(_0x5df9c5,null));};exports[_0x66de('0x55')]=function(_0x41684c,_0x24216f){return db[_0x66de('0x38')][_0x66de('0x55')](_0x41684c[_0x66de('0x56')],{})[_0x66de('0x30')](respondWithResult(_0x24216f,0xc9))['catch'](handleError(_0x24216f,null));};exports[_0x66de('0x2e')]=function(_0x49dac6,_0x46f75f){if(_0x49dac6[_0x66de('0x56')]['id']){delete _0x49dac6[_0x66de('0x56')]['id'];}return db[_0x66de('0x38')][_0x66de('0x54')]({'where':{'id':_0x49dac6['params']['id']}})[_0x66de('0x30')](handleEntityNotFound(_0x46f75f,null))[_0x66de('0x30')](saveUpdates(_0x49dac6['body'],null))[_0x66de('0x30')](respondWithResult(_0x46f75f,null))[_0x66de('0x25')](handleError(_0x46f75f,null));};exports[_0x66de('0x2f')]=function(_0x518846,_0x557e28){return db['ChatGroup'][_0x66de('0x54')]({'where':{'id':_0x518846['params']['id']}})['then'](handleEntityNotFound(_0x557e28,null))['then'](removeEntity(_0x557e28,null))[_0x66de('0x25')](handleError(_0x557e28,null));};exports[_0x66de('0x57')]=function(_0x2ab185,_0x42d49d){return db[_0x66de('0x38')][_0x66de('0x57')]()[_0x66de('0x30')](respondWithResult(_0x42d49d,null))[_0x66de('0x25')](handleError(_0x42d49d,null));};exports[_0x66de('0x58')]=function(_0x1d9723,_0x48f235,_0xe33696){return db[_0x66de('0x59')]['count']({'where':{'ChatGroupId':_0x1d9723[_0x66de('0x51')]['id'],'ToId':_0x1d9723[_0x66de('0x5a')]['id'],'read':![]}})[_0x66de('0x30')](function(_0x26769c){return{'id':_[_0x66de('0x5b')](_0x1d9723['params']['id']),'count':_0x26769c};})[_0x66de('0x30')](respondWithResult(_0x48f235,null))[_0x66de('0x25')](handleError(_0x48f235,null));};exports['addMembers']=function(_0x4d0a7f,_0x4d8f84,_0x28f3c0){return db[_0x66de('0x38')][_0x66de('0x54')]({'where':{'id':_0x4d0a7f[_0x66de('0x51')]['id']}})[_0x66de('0x30')](handleEntityNotFound(_0x4d8f84,null))['then'](function(_0x143287){if(_0x143287){return _0x143287[_0x66de('0x5c')](_0x4d0a7f[_0x66de('0x56')]['ids'],_[_0x66de('0x5d')](_0x4d0a7f['body'],['ids','id'])||{});}})[_0x66de('0x30')](respondWithResult(_0x4d8f84,null))['catch'](handleError(_0x4d8f84,null));};exports['getMembers']=function(_0x24f444,_0x2c1725,_0x5a6d1b){var _0x528b1b={};var _0x16e319={};var _0x172e79;var _0x6197d7;return db[_0x66de('0x38')][_0x66de('0x5e')]({'where':{'id':_0x24f444[_0x66de('0x51')]['id']}})[_0x66de('0x30')](handleEntityNotFound(_0x2c1725,null))[_0x66de('0x30')](function(_0x528ab6){if(_0x528ab6){_0x172e79=_0x528ab6;_0x16e319['model']=_[_0x66de('0x3e')](db['User'][_0x66de('0x39')]);_0x16e319['query']=_[_0x66de('0x3e')](_0x24f444[_0x66de('0x3d')]);_0x16e319[_0x66de('0x3f')]=_[_0x66de('0x40')](_0x16e319[_0x66de('0x41')],_0x16e319[_0x66de('0x3d')]);_0x528b1b[_0x66de('0x43')]=_[_0x66de('0x40')](_0x16e319[_0x66de('0x41')],qs['fields'](_0x24f444[_0x66de('0x3d')]['fields']));_0x528b1b[_0x66de('0x43')]=_0x528b1b[_0x66de('0x43')][_0x66de('0x44')]?_0x528b1b['attributes']:_0x16e319[_0x66de('0x41')];_0x528b1b[_0x66de('0x47')]=qs[_0x66de('0x5f')](_0x24f444[_0x66de('0x3d')]['sort']);_0x528b1b[_0x66de('0x48')]=qs[_0x66de('0x3f')](_['pick'](_0x24f444[_0x66de('0x3d')],_0x16e319[_0x66de('0x3f')]));if(_0x24f444[_0x66de('0x3d')][_0x66de('0x4a')]){_0x528b1b[_0x66de('0x48')]=_[_0x66de('0x4b')](_0x528b1b[_0x66de('0x48')],{'$or':_['map'](_0x528b1b[_0x66de('0x43')],function(_0x259de6){var _0x452e24={};_0x452e24[_0x259de6]={'$like':'%'+_0x24f444[_0x66de('0x3d')][_0x66de('0x4a')]+'%'};return _0x452e24;})});}_0x528b1b=_[_0x66de('0x4b')]({},_0x528b1b,_0x24f444[_0x66de('0x53')]);return _0x172e79[_0x66de('0x60')](_0x528b1b);}})['then'](function(_0xe93cdf){if(_0xe93cdf){_0x6197d7=_0xe93cdf[_0x66de('0x44')];if(!_0x24f444[_0x66de('0x3d')]['hasOwnProperty'](_0x66de('0x61'))){_0x528b1b[_0x66de('0x46')]=qs[_0x66de('0x46')](_0x24f444['query'][_0x66de('0x46')]);_0x528b1b[_0x66de('0x29')]=qs[_0x66de('0x29')](_0x24f444['query'][_0x66de('0x29')]);}return _0x172e79[_0x66de('0x60')](_0x528b1b);}})[_0x66de('0x30')](function(_0x1320d4){if(_0x1320d4){return _0x1320d4?{'count':_0x6197d7,'rows':_0x1320d4}:null;}})[_0x66de('0x30')](respondWithResult(_0x2c1725,null))[_0x66de('0x25')](handleError(_0x2c1725,null));};exports[_0x66de('0x62')]=function(_0x13e651,_0x46ea46,_0x26b58a){return db['ChatGroup'][_0x66de('0x54')]({'where':{'id':_0x13e651['params']['id']}})[_0x66de('0x30')](handleEntityNotFound(_0x46ea46,null))[_0x66de('0x30')](function(_0x293099){if(_0x293099){return _0x293099[_0x66de('0x62')](_0x13e651[_0x66de('0x3d')][_0x66de('0x63')]);}})[_0x66de('0x30')](respondWithStatusCode(_0x46ea46,null))['catch'](handleError(_0x46ea46,null));};exports[_0x66de('0x64')]=function(_0x39ba36,_0x1142f1,_0x24ead4){if(_0x39ba36[_0x66de('0x56')]['id']){delete _0x39ba36[_0x66de('0x56')]['id'];}return db[_0x66de('0x38')][_0x66de('0x54')]({'where':{'id':_0x39ba36['params']['id']}})[_0x66de('0x30')](handleEntityNotFound(_0x1142f1,null))[_0x66de('0x30')](function(_0x21d4a7){if(_0x21d4a7){_0x39ba36[_0x66de('0x56')][_0x66de('0x65')]=_0x21d4a7['id'];return db['ChatInternalMessage'][_0x66de('0x55')](_0x39ba36[_0x66de('0x56')]);}})[_0x66de('0x30')](respondWithResult(_0x1142f1,null))['catch'](handleError(_0x1142f1,null));};exports[_0x66de('0x66')]=function(_0x480d50,_0xfd505a,_0x469258){var _0x84526c={};var _0x154257={};var _0x5f3297;var _0x11e81e;return db[_0x66de('0x38')][_0x66de('0x5e')]({'where':{'id':_0x480d50['params']['id']}})[_0x66de('0x30')](handleEntityNotFound(_0xfd505a,null))['then'](function(_0x2015c6){if(_0x2015c6){_0x5f3297=_0x2015c6;_0x154257[_0x66de('0x41')]=_['keys'](db[_0x66de('0x59')]['rawAttributes']);_0x154257['query']=_[_0x66de('0x3e')](_0x480d50[_0x66de('0x3d')]);_0x154257[_0x66de('0x3f')]=_[_0x66de('0x40')](_0x154257[_0x66de('0x41')],_0x154257[_0x66de('0x3d')]);_0x84526c[_0x66de('0x43')]=_[_0x66de('0x40')](_0x154257['model'],qs[_0x66de('0x42')](_0x480d50[_0x66de('0x3d')][_0x66de('0x42')]));_0x84526c[_0x66de('0x43')]=_0x84526c[_0x66de('0x43')][_0x66de('0x44')]?_0x84526c[_0x66de('0x43')]:_0x154257['model'];_0x84526c['order']=qs[_0x66de('0x5f')](_0x480d50[_0x66de('0x3d')]['sort']);_0x84526c[_0x66de('0x48')]=qs['filters'](_[_0x66de('0x49')](_0x480d50[_0x66de('0x3d')],_0x154257[_0x66de('0x3f')]));if(_0x480d50['query'][_0x66de('0x4a')]){_0x84526c[_0x66de('0x48')]=_[_0x66de('0x4b')](_0x84526c[_0x66de('0x48')],{'$or':_[_0x66de('0x37')](_0x84526c[_0x66de('0x43')],function(_0x4fef9b){var _0x166f44={};_0x166f44[_0x4fef9b]={'$like':'%'+_0x480d50[_0x66de('0x3d')][_0x66de('0x4a')]+'%'};return _0x166f44;})});}if(_0x480d50[_0x66de('0x3d')][_0x66de('0x67')]){var _0x5c8bb8=_0x480d50['query']['$gte'][_0x66de('0x68')](',');var _0x21cf32={};_0x21cf32[_0x5c8bb8[0x0]]={'$gte':moment(_0x5c8bb8[0x1])['format'](_0x66de('0x69'))};_0x84526c['where']=_['merge'](_0x84526c[_0x66de('0x48')],_0x21cf32);}_0x84526c=_['merge']({},_0x84526c,_0x480d50[_0x66de('0x53')]);return _0x5f3297['getMessages'](_0x84526c);}})[_0x66de('0x30')](function(_0x3274b0){if(_0x3274b0){_0x11e81e=_0x3274b0[_0x66de('0x44')];if(!_0x480d50['query'][_0x66de('0x45')](_0x66de('0x61'))){_0x84526c[_0x66de('0x46')]=qs[_0x66de('0x46')](_0x480d50[_0x66de('0x3d')][_0x66de('0x46')]);_0x84526c[_0x66de('0x29')]=qs[_0x66de('0x29')](_0x480d50[_0x66de('0x3d')][_0x66de('0x29')]);}return _0x5f3297['getMessages'](_0x84526c);}})[_0x66de('0x30')](function(_0x20d15a){if(_0x20d15a){return _0x20d15a?{'count':_0x11e81e,'rows':_0x20d15a}:null;}})[_0x66de('0x30')](respondWithResult(_0xfd505a,null))[_0x66de('0x25')](handleError(_0xfd505a,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 94f40fa..193ec2a 100644 --- a/server/api/chatGroup/chatGroup.events.js +++ b/server/api/chatGroup/chatGroup.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0x5e9b23,_0x3069fd){var _0x27501f=function(_0x37667c){while(--_0x37667c){_0x5e9b23['push'](_0x5e9b23['shift']());}};_0x27501f(++_0x3069fd);}(_0x2ef3,0xba));var _0x32ef=function(_0x46ac0b,_0x563c65){_0x46ac0b=_0x46ac0b-0x0;var _0x12a410=_0x2ef3[_0x46ac0b];return _0x12a410;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var ChatGroup=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){ChatGroupEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);ChatGroupEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0x0b0e=['ChatGroup','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x5c1c0f,_0x72c16){var _0x23a98c=function(_0xe10789){while(--_0xe10789){_0x5c1c0f['push'](_0x5c1c0f['shift']());}};_0x23a98c(++_0x72c16);}(_0x0b0e,0x187));var _0xe0b0=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x0b0e[_0x40a045];return _0x1a687c;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatGroupEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatGroupEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatGroup[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 779bd65..4147fcc 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 _0xae24=['../../config/logger','moment','bluebird','rimraf','./chatGroup.attributes','exports','define','ChatGroup','lodash'];(function(_0x43f045,_0x28a172){var _0xd4ca37=function(_0x1f2be8){while(--_0x1f2be8){_0x43f045['push'](_0x43f045['shift']());}};_0xd4ca37(++_0x28a172);}(_0xae24,0x182));var _0x4ae2=function(_0x56c915,_0x1a12e7){_0x56c915=_0x56c915-0x0;var _0x35f1d7=_0xae24[_0x56c915];return _0x35f1d7;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ae2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4ae2('0x5'));module[_0x4ae2('0x6')]=function(_0x20c85c,_0x3e6055){return _0x20c85c[_0x4ae2('0x7')](_0x4ae2('0x8'),attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4d1=['chat_groups','lodash','util','../../config/logger','api','moment','request-promise','rimraf','./chatGroup.attributes','define'];(function(_0x257e95,_0x54f05a){var _0x497a7b=function(_0x5b3cbd){while(--_0x5b3cbd){_0x257e95['push'](_0x257e95['shift']());}};_0x497a7b(++_0x54f05a);}(_0xd4d1,0x123));var _0x1d4d=function(_0x3f2532,_0xdc3a6d){_0x3f2532=_0x3f2532-0x0;var _0x1015e8=_0xd4d1[_0x3f2532];return _0x1015e8;};'use strict';var _=require(_0x1d4d('0x0'));var util=require(_0x1d4d('0x1'));var logger=require(_0x1d4d('0x2'))(_0x1d4d('0x3'));var moment=require(_0x1d4d('0x4'));var BPromise=require('bluebird');var rp=require(_0x1d4d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1d4d('0x6'));var config=require('../../config/environment');var attributes=require(_0x1d4d('0x7'));module['exports']=function(_0x2bc295,_0x184978){return _0x2bc295[_0x1d4d('0x8')]('ChatGroup',attributes,{'tableName':_0x1d4d('0x9'),'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 0a85fb9..a85b828 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 _0x8bd3=['request\x20sent','stringify','error','code','message','info','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','request','ChatGroup,\x20%s,\x20%s','debug','ChatGroup,\x20%s,\x20%s,\x20%s'];(function(_0x5501c9,_0x5f3cd9){var _0x9a3c5f=function(_0x4ad52a){while(--_0x4ad52a){_0x5501c9['push'](_0x5501c9['shift']());}};_0x9a3c5f(++_0x5f3cd9);}(_0x8bd3,0xc4));var _0x38bd=function(_0xf273f9,_0x486198){_0xf273f9=_0xf273f9-0x0;var _0xb4abcc=_0x8bd3[_0xf273f9];return _0xb4abcc;};'use strict';var _=require(_0x38bd('0x0'));var util=require('util');var moment=require(_0x38bd('0x1'));var BPromise=require(_0x38bd('0x2'));var rs=require(_0x38bd('0x3'));var fs=require('fs');var Redis=require(_0x38bd('0x4'));var db=require(_0x38bd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x38bd('0x6'))(_0x38bd('0x7'));var config=require(_0x38bd('0x8'));var jayson=require(_0x38bd('0x9'));var client=jayson[_0x38bd('0xa')][_0x38bd('0xb')]({'port':0x232a});config[_0x38bd('0xc')]=_['defaults'](config['redis'],{'host':_0x38bd('0xd'),'port':0x18eb});var socket=require(_0x38bd('0xe'))(new Redis(config['redis']));require(_0x38bd('0xf'))['register'](socket);function respondWithRpcPromise(_0x2ea52d,_0x4de2f2,_0x2a0849){return new BPromise(function(_0x402a2b,_0x2d7422){return client[_0x38bd('0x10')](_0x2ea52d,_0x2a0849)['then'](function(_0x538c85){logger['info'](_0x38bd('0x11'),_0x4de2f2,'request\x20sent');logger[_0x38bd('0x12')](_0x38bd('0x13'),_0x4de2f2,_0x38bd('0x14'),JSON[_0x38bd('0x15')](_0x538c85));if(_0x538c85['error']){if(_0x538c85[_0x38bd('0x16')][_0x38bd('0x17')]===0x1f4){logger[_0x38bd('0x16')](_0x38bd('0x11'),_0x4de2f2,_0x538c85[_0x38bd('0x16')][_0x38bd('0x18')]);return _0x2d7422(_0x538c85['error'][_0x38bd('0x18')]);}logger[_0x38bd('0x16')](_0x38bd('0x11'),_0x4de2f2,_0x538c85[_0x38bd('0x16')][_0x38bd('0x18')]);return _0x402a2b(_0x538c85[_0x38bd('0x16')]['message']);}else{logger[_0x38bd('0x19')](_0x38bd('0x11'),_0x4de2f2,_0x38bd('0x14'));_0x402a2b(_0x538c85['result'][_0x38bd('0x18')]);}})[_0x38bd('0x1a')](function(_0x19bcf9){logger[_0x38bd('0x16')]('ChatGroup,\x20%s,\x20%s',_0x4de2f2,_0x19bcf9);_0x2d7422(_0x19bcf9);});});} \ No newline at end of file +var _0x51df=['../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0xe2c95e,_0x3e6545){var _0x42ce6f=function(_0x218482){while(--_0x218482){_0xe2c95e['push'](_0xe2c95e['shift']());}};_0x42ce6f(++_0x3e6545);}(_0x51df,0xd9));var _0xf51d=function(_0x4e4b79,_0x16c41d){_0x4e4b79=_0x4e4b79-0x0;var _0x6a9b00=_0x51df[_0x4e4b79];return _0x6a9b00;};'use strict';var _=require(_0xf51d('0x0'));var util=require(_0xf51d('0x1'));var moment=require('moment');var BPromise=require(_0xf51d('0x2'));var rs=require(_0xf51d('0x3'));var fs=require('fs');var Redis=require(_0xf51d('0x4'));var db=require(_0xf51d('0x5'))['db'];var utils=require(_0xf51d('0x6'));var logger=require(_0xf51d('0x7'))(_0xf51d('0x8'));var config=require(_0xf51d('0x9'));var jayson=require(_0xf51d('0xa'));var client=jayson[_0xf51d('0xb')]['http']({'port':0x232a});config[_0xf51d('0xc')]=_[_0xf51d('0xd')](config[_0xf51d('0xc')],{'host':_0xf51d('0xe'),'port':0x18eb});var socket=require(_0xf51d('0xf'))(new Redis(config[_0xf51d('0xc')]));require(_0xf51d('0x10'))[_0xf51d('0x11')](socket);function respondWithRpcPromise(_0x52fb7a,_0xf8a932,_0x3c4897){return new BPromise(function(_0x5dcb5c,_0x4e631c){return client[_0xf51d('0x12')](_0x52fb7a,_0x3c4897)[_0xf51d('0x13')](function(_0x383db2){logger[_0xf51d('0x14')](_0xf51d('0x15'),_0xf8a932,_0xf51d('0x16'));logger['debug']('ChatGroup,\x20%s,\x20%s,\x20%s',_0xf8a932,_0xf51d('0x16'),JSON[_0xf51d('0x17')](_0x383db2));if(_0x383db2['error']){if(_0x383db2[_0xf51d('0x18')][_0xf51d('0x19')]===0x1f4){logger[_0xf51d('0x18')](_0xf51d('0x15'),_0xf8a932,_0x383db2['error'][_0xf51d('0x1a')]);return _0x4e631c(_0x383db2[_0xf51d('0x18')]['message']);}logger[_0xf51d('0x18')]('ChatGroup,\x20%s,\x20%s',_0xf8a932,_0x383db2[_0xf51d('0x18')][_0xf51d('0x1a')]);return _0x5dcb5c(_0x383db2['error'][_0xf51d('0x1a')]);}else{logger[_0xf51d('0x14')]('ChatGroup,\x20%s,\x20%s',_0xf8a932,_0xf51d('0x16'));_0x5dcb5c(_0x383db2['result'][_0xf51d('0x1a')]);}})[_0xf51d('0x1b')](function(_0x4b0dfe){logger[_0xf51d('0x18')](_0xf51d('0x15'),_0xf8a932,_0x4b0dfe);_0x4e631c(_0x4b0dfe);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 5b8fb6c..ee08e7f 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 _0x0653=['./chatGroup.events','save','remove','update','removeListener','register','length'];(function(_0x556bb1,_0x34830d){var _0x45455f=function(_0x13c6ba){while(--_0x13c6ba){_0x556bb1['push'](_0x556bb1['shift']());}};_0x45455f(++_0x34830d);}(_0x0653,0x69));var _0x3065=function(_0x2f96c8,_0x4b22d1){_0x2f96c8=_0x2f96c8-0x0;var _0x5e1dca=_0x0653[_0x2f96c8];return _0x5e1dca;};'use strict';var ChatGroupEvents=require(_0x3065('0x0'));var events=[_0x3065('0x1'),_0x3065('0x2'),_0x3065('0x3')];function createListener(_0x48b5c3,_0x4ebe12){return function(_0x527c76){_0x4ebe12['emit'](_0x48b5c3,_0x527c76);};}function removeListener(_0x5c43fc,_0x1b1420){return function(){ChatGroupEvents[_0x3065('0x4')](_0x5c43fc,_0x1b1420);};}exports[_0x3065('0x5')]=function(_0x1b42b1){for(var _0x4fe184=0x0,_0x555a38=events[_0x3065('0x6')];_0x4fe184<_0x555a38;_0x4fe184++){var _0x4a5aef=events[_0x4fe184];var _0x46c6bf=createListener('chatGroup:'+_0x4a5aef,_0x1b42b1);ChatGroupEvents['on'](_0x4a5aef,_0x46c6bf);}}; \ No newline at end of file +var _0x17bd=['register','length','save','remove','update','emit'];(function(_0x25c73d,_0x986f2b){var _0x4c0313=function(_0x60c73a){while(--_0x60c73a){_0x25c73d['push'](_0x25c73d['shift']());}};_0x4c0313(++_0x986f2b);}(_0x17bd,0x188));var _0xd17b=function(_0x267681,_0x1a1594){_0x267681=_0x267681-0x0;var _0x59724c=_0x17bd[_0x267681];return _0x59724c;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xd17b('0x0'),_0xd17b('0x1'),_0xd17b('0x2')];function createListener(_0x3b3480,_0x16515f){return function(_0x17d00c){_0x16515f[_0xd17b('0x3')](_0x3b3480,_0x17d00c);};}function removeListener(_0x51ca00,_0x3022a4){return function(){ChatGroupEvents['removeListener'](_0x51ca00,_0x3022a4);};}exports[_0xd17b('0x4')]=function(_0x30ef97){for(var _0x5e84d9=0x0,_0xd69e8a=events[_0xd17b('0x5')];_0x5e84d9<_0xd69e8a;_0x5e84d9++){var _0x492b7a=events[_0x5e84d9];var _0x2fadea=createListener('chatGroup:'+_0x492b7a,_0x30ef97);ChatGroupEvents['on'](_0x492b7a,_0x2fadea);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index d095ea2..e174430 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 _0x69c2=['util','connect-timeout','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','show','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','create','post','addMembers','addMessage','/:id','update','delete','destroy','exports','multer'];(function(_0x59b533,_0x59fdcc){var _0x2beced=function(_0xd3aaf3){while(--_0xd3aaf3){_0x59b533['push'](_0x59b533['shift']());}};_0x2beced(++_0x59fdcc);}(_0x69c2,0xbc));var _0x269c=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x69c2[_0x3ab51d];return _0x29a04e;};'use strict';var multer=require(_0x269c('0x0'));var util=require(_0x269c('0x1'));var path=require('path');var timeout=require(_0x269c('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x269c('0x3'));var interaction=require(_0x269c('0x4'));var config=require('../../config/environment');var controller=require(_0x269c('0x5'));router['get']('/',auth[_0x269c('0x6')](),controller[_0x269c('0x7')]);router[_0x269c('0x8')](_0x269c('0x9'),auth[_0x269c('0x6')](),controller[_0x269c('0xa')]);router[_0x269c('0x8')]('/:id',auth[_0x269c('0x6')](),controller[_0x269c('0xb')]);router[_0x269c('0x8')](_0x269c('0xc'),auth[_0x269c('0x6')](),controller[_0x269c('0xd')]);router['get'](_0x269c('0xe'),auth[_0x269c('0x6')](),controller[_0x269c('0xf')]);router[_0x269c('0x8')](_0x269c('0x10'),auth[_0x269c('0x6')](),controller[_0x269c('0x11')]);router['post']('/',auth[_0x269c('0x6')](),controller[_0x269c('0x12')]);router[_0x269c('0x13')](_0x269c('0xe'),auth[_0x269c('0x6')](),controller[_0x269c('0x14')]);router['post'](_0x269c('0x10'),auth['isAuthenticated'](),controller[_0x269c('0x15')]);router['put'](_0x269c('0x16'),auth[_0x269c('0x6')](),controller[_0x269c('0x17')]);router[_0x269c('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x269c('0x19')]);router['delete'](_0x269c('0xe'),auth['isAuthenticated'](),controller['removeMembers']);module[_0x269c('0x1a')]=router; \ No newline at end of file +var _0x22d7=['update','delete','destroy','removeMembers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','describe','/:id','show','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create','addMembers','put'];(function(_0x3070dc,_0x40cf11){var _0x431489=function(_0x49bc2a){while(--_0x49bc2a){_0x3070dc['push'](_0x3070dc['shift']());}};_0x431489(++_0x40cf11);}(_0x22d7,0x198));var _0x722d=function(_0x30c48d,_0x25e828){_0x30c48d=_0x30c48d-0x0;var _0x2c64aa=_0x22d7[_0x30c48d];return _0x2c64aa;};'use strict';var multer=require(_0x722d('0x0'));var util=require(_0x722d('0x1'));var path=require(_0x722d('0x2'));var timeout=require(_0x722d('0x3'));var express=require(_0x722d('0x4'));var router=express[_0x722d('0x5')]();var auth=require(_0x722d('0x6'));var interaction=require(_0x722d('0x7'));var config=require(_0x722d('0x8'));var controller=require(_0x722d('0x9'));router[_0x722d('0xa')]('/',auth[_0x722d('0xb')](),controller[_0x722d('0xc')]);router[_0x722d('0xa')](_0x722d('0xd'),auth[_0x722d('0xb')](),controller[_0x722d('0xe')]);router[_0x722d('0xa')](_0x722d('0xf'),auth[_0x722d('0xb')](),controller[_0x722d('0x10')]);router[_0x722d('0xa')]('/:id/unread',auth[_0x722d('0xb')](),controller[_0x722d('0x11')]);router[_0x722d('0xa')](_0x722d('0x12'),auth[_0x722d('0xb')](),controller[_0x722d('0x13')]);router[_0x722d('0xa')](_0x722d('0x14'),auth[_0x722d('0xb')](),controller[_0x722d('0x15')]);router[_0x722d('0x16')]('/',auth['isAuthenticated'](),controller[_0x722d('0x17')]);router[_0x722d('0x16')](_0x722d('0x12'),auth[_0x722d('0xb')](),controller[_0x722d('0x18')]);router['post']('/:id/messages',auth[_0x722d('0xb')](),controller['addMessage']);router[_0x722d('0x19')]('/:id',auth[_0x722d('0xb')](),controller[_0x722d('0x1a')]);router[_0x722d('0x1b')](_0x722d('0xf'),auth[_0x722d('0xb')](),controller[_0x722d('0x1c')]);router[_0x722d('0x1b')](_0x722d('0x12'),auth[_0x722d('0xb')](),controller[_0x722d('0x1d')]);module[_0x722d('0x1e')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index f7ef56d..de3ac4e 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 _0x2738=['ENUM','out','sequelize','exports','INTEGER','star','thumb','TEXT','STRING','DATE','long'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x2738,0x1db));var _0x8273=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x2738[_0x49b207];return _0x2dc8fa;};'use strict';var Sequelize=require(_0x8273('0x0'));module[_0x8273('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x8273('0x2')]},'ratingType':{'type':Sequelize['ENUM'](_0x8273('0x3'),_0x8273('0x4')),'defaultValue':'star'},'ratingMessage':{'type':Sequelize[_0x8273('0x5')]},'pathTranscript':{'type':Sequelize[_0x8273('0x5')]},'mailTranscript':{'type':Sequelize[_0x8273('0x6')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x8273('0x7')]},'disposition':{'type':Sequelize[_0x8273('0x6')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x8273('0x6')]},'browserVersion':{'type':Sequelize[_0x8273('0x6')]},'osName':{'type':Sequelize[_0x8273('0x6')]},'osVersion':{'type':Sequelize[_0x8273('0x6')]},'deviceModel':{'type':Sequelize[_0x8273('0x6')]},'deviceVendor':{'type':Sequelize['STRING']},'deviceType':{'type':Sequelize[_0x8273('0x6')]},'referer':{'type':Sequelize[_0x8273('0x5')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x8273('0x8'))},'read1stAt':{'type':Sequelize[_0x8273('0x7')]},'lastMsgAt':{'type':Sequelize[_0x8273('0x7')]},'lastMsgDirection':{'type':Sequelize[_0x8273('0x9')]('in',_0x8273('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x8273('0x6')]},'customerPort':{'type':Sequelize[_0x8273('0x6')]}}; \ No newline at end of file +var _0xb921=['star','thumb','TEXT','STRING','DATE','out','sequelize','exports','BOOLEAN','INTEGER','ENUM'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0xb921,0xd7));var _0x1b92=function(_0x49d21f,_0x6e7f5){_0x49d21f=_0x49d21f-0x0;var _0x1b93f2=_0xb921[_0x49d21f];return _0x1b93f2;};'use strict';var Sequelize=require(_0x1b92('0x0'));module[_0x1b92('0x1')]={'closed':{'type':Sequelize[_0x1b92('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x1b92('0x3')]},'ratingType':{'type':Sequelize[_0x1b92('0x4')](_0x1b92('0x5'),_0x1b92('0x6')),'defaultValue':_0x1b92('0x5')},'ratingMessage':{'type':Sequelize[_0x1b92('0x7')]},'pathTranscript':{'type':Sequelize[_0x1b92('0x7')]},'mailTranscript':{'type':Sequelize[_0x1b92('0x8')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x1b92('0x9')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x1b92('0x8')]},'browserVersion':{'type':Sequelize[_0x1b92('0x8')]},'osName':{'type':Sequelize[_0x1b92('0x8')]},'osVersion':{'type':Sequelize[_0x1b92('0x8')]},'deviceModel':{'type':Sequelize[_0x1b92('0x8')]},'deviceVendor':{'type':Sequelize[_0x1b92('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize[_0x1b92('0x7')]},'customerIp':{'type':Sequelize['STRING']},'formData':{'type':Sequelize[_0x1b92('0x7')]('long')},'read1stAt':{'type':Sequelize[_0x1b92('0x9')]},'lastMsgAt':{'type':Sequelize[_0x1b92('0x9')]},'lastMsgDirection':{'type':Sequelize[_0x1b92('0x4')]('in',_0x1b92('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x1b92('0x8')]},'customerPort':{'type':Sequelize[_0x1b92('0x8')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 6220b62..f61fc14 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 _0x0a48=['User','ChatWebsite','CmContact','Messages','%s%d','System','customer','Visitor','agentIdentifier','agentAlias','agent_alias','alias','fullname','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','getMessages','ChatInteractionId','YYYY-MM-DD\x20HH:mm:ss','rows','getMyMessages','setTags','omit','Tag','color','chatInteractionTags:save','removeTags','unix','files','tmp','attachments','Contact','lastName','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','mkdirSync','N.A.','osName','referer','customerIp','customerPort','createWriteStream','firstName','out','renderFile','server','views','downloadInteraction.html','toFile','transcript-','.pdf','err','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatInteraction.socket','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','count','json','apply','reject','save','update','destroy','name','send','map','TagIds','Tags','split','forEach','push','index','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','pick','field','from','select','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','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','find','unreadMessages','having','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','value','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','union','UserId','body','start','compact','isEmpty','where','i.ChatWebsiteId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','ChatWebsiteId','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','ChatInteraction','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','all','show','params','filters','includeAll','include','merge','options','create','describe','customUpdate','abandon','entity\x20not\x20found','Interaction\x20already\x20assigned','closed','disposition','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','Unauthorized','findOne','attachId','download','join','root','server/files/attachments/','close','server/files/chat/upload/','format','transcript-%s.txt','now','ChatMessage'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x0a48,0x16d));var _0x80a4=function(_0x497cc1,_0x190440){_0x497cc1=_0x497cc1-0x0;var _0x273212=_0x0a48[_0x497cc1];return _0x273212;};'use strict';var pdf=require(_0x80a4('0x0'));var emlformat=require(_0x80a4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x80a4('0x2'));var jsonpatch=require(_0x80a4('0x3'));var rp=require('request-promise');var moment=require(_0x80a4('0x4'));var BPromise=require(_0x80a4('0x5'));var Mustache=require(_0x80a4('0x6'));var util=require(_0x80a4('0x7'));var path=require(_0x80a4('0x8'));var sox=require(_0x80a4('0x9'));var csv=require('to-csv');var ejs=require(_0x80a4('0xa'));var fs=require('fs');var _=require(_0x80a4('0xb'));var squel=require(_0x80a4('0xc'));var crypto=require(_0x80a4('0xd'));var jsforce=require(_0x80a4('0xe'));var deskjs=require(_0x80a4('0xf'));var toCsv=require(_0x80a4('0x10'));var querystring=require(_0x80a4('0x11'));var Papa=require(_0x80a4('0x12'));var Redis=require(_0x80a4('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x80a4('0x14'));var as=require(_0x80a4('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x80a4('0x16'))('api');var utils=require(_0x80a4('0x17'));var config=require(_0x80a4('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x80a4('0x19')](config[_0x80a4('0x1a')],{'host':_0x80a4('0x1b'),'port':0x18eb});var socket=require(_0x80a4('0x1c'))(new Redis(config['redis']));require(_0x80a4('0x1d'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x80a4('0x1e')][_0x80a4('0x1f')]({'port':0x232b});var client9004=jayson[_0x80a4('0x1e')][_0x80a4('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x450e40,_0x2f0d42,_0x4c155c){if(_0x4c155c){var _0x37e544=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37e544[_0x80a4('0x20')](_0x2f0d42)){return _0x450e40;}else{throw new db[(_0x80a4('0x21'))][(_0x80a4('0x22'))](_0x80a4('0x23'));}}else{return _0x450e40;}}function respondWithRpcPromise(_0x4d16f2,_0x3ef005,_0x27bd4b,_0x132563){return new BPromise(function(_0x541ff9,_0x3bcf5f){var _0x2e4cb8=_0x132563||client;return _0x2e4cb8['request'](_0x4d16f2,_0x27bd4b)[_0x80a4('0x24')](function(_0x310102){logger[_0x80a4('0x25')](_0x80a4('0x26'),_0x3ef005,_0x80a4('0x27'));logger[_0x80a4('0x28')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3ef005,_0x80a4('0x27'),JSON[_0x80a4('0x29')](_0x310102));if(_0x310102['error']){if(_0x310102[_0x80a4('0x2a')][_0x80a4('0x2b')]===0x1f4){logger[_0x80a4('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x3ef005,_0x310102[_0x80a4('0x2a')][_0x80a4('0x2c')]);return _0x3bcf5f(_0x310102[_0x80a4('0x2a')]['message']);}logger[_0x80a4('0x2a')](_0x80a4('0x26'),_0x3ef005,_0x310102[_0x80a4('0x2a')][_0x80a4('0x2c')]);return _0x541ff9(_0x310102[_0x80a4('0x2a')][_0x80a4('0x2c')]);}else{logger['info'](_0x80a4('0x26'),_0x3ef005,'request\x20sent');_0x541ff9(_0x310102[_0x80a4('0x2d')][_0x80a4('0x2c')]);}})[_0x80a4('0x2e')](function(_0x2b3931){logger[_0x80a4('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x3ef005,_0x2b3931);_0x3bcf5f(_0x2b3931);});});}function respondWithStatusCode(_0x384d08,_0xc525a){_0xc525a=_0xc525a||0xcc;return function(_0x7901cc){if(_0x7901cc){return _0x384d08[_0x80a4('0x2f')](_0xc525a);}return _0x384d08[_0x80a4('0x30')](_0xc525a)[_0x80a4('0x31')]();};}function respondWithResult(_0x23fdf7,_0x34d79c){_0x34d79c=_0x34d79c||0xc8;return function(_0x47a5e0){if(_0x47a5e0){return _0x23fdf7[_0x80a4('0x30')](_0x34d79c)['json'](_0x47a5e0);}};}function respondWithFilteredResult(_0x3c6450,_0x2495a2){return function(_0x1859c7){if(_0x1859c7){var _0x2a6358=_0x1859c7[_0x80a4('0x32')],_0x10ef77=_0x2495a2['offset'],_0xcbe84a=_0x2495a2['offset']+_0x2495a2['limit'],_0x5e2a94;if(_0xcbe84a>=_0x2a6358){_0xcbe84a=_0x2a6358;_0x5e2a94=0xc8;}else{_0x5e2a94=0xce;}_0x3c6450['status'](_0x5e2a94);return _0x3c6450['set']('Content-Range',_0x10ef77+'-'+_0xcbe84a+'/'+_0x2a6358)[_0x80a4('0x33')](_0x1859c7);}return null;};}function patchUpdates(_0x2ec305){return function(_0x558eb6){try{jsonpatch[_0x80a4('0x34')](_0x558eb6,_0x2ec305,!![]);}catch(_0x5f01d5){return BPromise[_0x80a4('0x35')](_0x5f01d5);}return _0x558eb6[_0x80a4('0x36')]();};}function saveUpdates(_0x58c64c,_0x56ed92){return function(_0x3e52f7){if(_0x3e52f7){return _0x3e52f7[_0x80a4('0x37')](_0x58c64c)[_0x80a4('0x24')](function(_0x15b91d){return _0x15b91d;});}return null;};}function removeEntity(_0x124541,_0x558511){return function(_0x2490e2){if(_0x2490e2){return _0x2490e2[_0x80a4('0x38')]()[_0x80a4('0x24')](function(){_0x124541[_0x80a4('0x30')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a4a79,_0x5de21a){return function(_0x2867bb){if(!_0x2867bb){_0x1a4a79[_0x80a4('0x2f')](0x194);}return _0x2867bb;};}function handleError(_0x78fb4b,_0xb8031){_0xb8031=_0xb8031||0x1f4;return function(_0x154528){logger[_0x80a4('0x2a')](_0x154528['stack']);if(_0x154528[_0x80a4('0x39')]){delete _0x154528[_0x80a4('0x39')];}_0x78fb4b[_0x80a4('0x30')](_0xb8031)[_0x80a4('0x3a')](_0x154528);};}function getInteractionUsers(_0x48c6c6,_0x4744ab){return new BPromise(function(_0x35824a,_0x203136){try{if(_0x4744ab[_0x48c6c6['id']]){_0x48c6c6['Users']=_[_0x80a4('0x3b')](_0x4744ab[_0x48c6c6['id']],function(_0x38d917){return{'id':_0x38d917['id']};});}}catch(_0x1c7a63){_0x203136(_0x1c7a63);}_0x35824a(_0x48c6c6);});}function getInteractionTags(_0x24bdb8,_0x5279e2){return new BPromise(function(_0x2b746d,_0x31dd2e){try{if(_0x24bdb8[_0x80a4('0x3c')]){_0x24bdb8[_0x80a4('0x3d')]=[];_0x24bdb8[_0x80a4('0x3c')][_0x80a4('0x3e')](',')[_0x80a4('0x3f')](function(_0x3157c4){_0x24bdb8[_0x80a4('0x3d')][_0x80a4('0x40')](_0x5279e2[_0x3157c4]);});}delete _0x24bdb8['TagIds'];}catch(_0x44568a){_0x31dd2e(_0x44568a);}_0x2b746d(_0x24bdb8);});}function updateChatInteraction(_0x3bdc40,_0x20998c,_0x1161c7){return new BPromise(function(_0x384ac8,_0x4ce2e9){return getInteractionUsers(_0x3bdc40,_0x1161c7)['then'](function(_0x408cbb){return getInteractionTags(_0x408cbb,_0x20998c);})[_0x80a4('0x24')](function(_0x1ec1c2){_0x384ac8(_0x1ec1c2);})[_0x80a4('0x2e')](function(_0x178fec){_0x4ce2e9(_0x178fec);});});}exports[_0x80a4('0x41')]=function(_0x8885d,_0x7dcc62){var _0x95cfe4={},_0x12be75={},_0x315f1b={'count':0x0,'rows':[]};var _0x44a8fb=_[_0x80a4('0x3b')](db['ChatInteraction'][_0x80a4('0x42')],function(_0x284168){return{'name':_0x284168[_0x80a4('0x43')],'type':_0x284168[_0x80a4('0x44')]['key']};});_0x12be75[_0x80a4('0x45')]=_[_0x80a4('0x3b')](_0x44a8fb,_0x80a4('0x39'));_0x12be75[_0x80a4('0x46')]=_[_0x80a4('0x47')](_0x8885d[_0x80a4('0x46')]);_0x12be75['filters']=_[_0x80a4('0x48')](_0x12be75[_0x80a4('0x45')],_0x12be75[_0x80a4('0x46')]);_0x95cfe4[_0x80a4('0x49')]=_[_0x80a4('0x48')](_0x12be75['model'],qs[_0x80a4('0x4a')](_0x8885d[_0x80a4('0x46')][_0x80a4('0x4a')]));_0x95cfe4['attributes']=_0x95cfe4[_0x80a4('0x49')][_0x80a4('0x4b')]?_0x95cfe4[_0x80a4('0x49')]:_0x12be75[_0x80a4('0x45')];if(!_0x8885d[_0x80a4('0x46')][_0x80a4('0x4c')](_0x80a4('0x4d'))){_0x95cfe4['limit']=qs[_0x80a4('0x4e')](_0x8885d[_0x80a4('0x46')][_0x80a4('0x4e')]);_0x95cfe4[_0x80a4('0x4f')]=qs['offset'](_0x8885d[_0x80a4('0x46')][_0x80a4('0x4f')]);}_0x95cfe4[_0x80a4('0x50')]=qs[_0x80a4('0x51')](_0x8885d[_0x80a4('0x46')][_0x80a4('0x51')]);_0x95cfe4['where']=qs['filters'](_[_0x80a4('0x52')](_0x8885d[_0x80a4('0x46')],_0x12be75['filters']));var _0x4997bc=[];var _0x3bf595=squel['select']()['field']('id')[_0x80a4('0x53')](_0x80a4('0x39'))[_0x80a4('0x53')]('color')[_0x80a4('0x54')]('tools_tags');var _0x22df06=squel[_0x80a4('0x55')]()[_0x80a4('0x53')](_0x80a4('0x56'))['field'](_0x80a4('0x57'))['from'](_0x80a4('0x58'),'ui')[_0x80a4('0x59')](_0x80a4('0x5a'),'u','u.id\x20=\x20ui.UserId');var _0x3c101e=squel[_0x80a4('0x55')]()[_0x80a4('0x54')](_0x80a4('0x5b'),'i')['left_join'](_0x80a4('0x5c'),'c',_0x80a4('0x5d'))[_0x80a4('0x59')](_0x80a4('0x5a'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x80a4('0x5e'),'a',_0x80a4('0x5f'))[_0x80a4('0x59')](_0x80a4('0x60'),'me','me.ChatInteractionId\x20=\x20i.id')['left_join'](_0x80a4('0x61'),'it',_0x80a4('0x62'))[_0x80a4('0x59')](_0x80a4('0x63'),'t',_0x80a4('0x64'));var _0x22520a=squel[_0x80a4('0x65')]();var _0x1c8b12=[];var _0x4adc69=squel[_0x80a4('0x65')]();var _0x3d7838;if(_0x8885d['query'][_0x80a4('0x66')]){_0x3d7838=as[_0x80a4('0x67')](_0x8885d[_0x80a4('0x46')]['search']);var _0x4b28c3=_0x3d7838['sqlOperator'];for(var _0x5058c=0x0;_0x5058c<_0x3d7838['conditions'][_0x80a4('0x4b')];_0x5058c++){var _0x1a1deb=_0x3d7838['conditions'][_0x5058c];var _0x46e6fa='i';var _0x2c1f83=_[_0x80a4('0x68')](_0x44a8fb,['name',_0x1a1deb[_0x80a4('0x53')]]);if(!_0x2c1f83){switch(_0x1a1deb[_0x80a4('0x53')]){case _0x80a4('0x69'):if(_0x1a1deb['value']==0x1){_0x3c101e[_0x80a4('0x6a')]('`'+_0x1a1deb['field']+'`\x20=\x200');}else{_0x3c101e[_0x80a4('0x6a')]('`'+_0x1a1deb['field']+'`\x20>\x200');}break;case'Contact':if(_0x1a1deb[_0x80a4('0x6b')]===_0x80a4('0x6c')){if(_0x1a1deb['value']['split']('\x20')[_0x80a4('0x4b')]>0x1){_0x22520a[_0x4b28c3](_0x80a4('0x6d'),qs[_0x80a4('0x6e')](_0x1a1deb[_0x80a4('0x6f')]),null);}else{var _0x440775='%'+_0x1a1deb[_0x80a4('0x6f')]+'%';_0x22520a[_0x4b28c3](_0x80a4('0x70'),_0x440775,_0x440775,_0x440775);}}else{_0x2c1f83=_[_0x80a4('0x68')](_0x44a8fb,[_0x80a4('0x39'),_0x80a4('0x71')]);_0x1a1deb['field']='ContactId';_0x2131a6=as[_0x80a4('0x72')](_0x46e6fa,_0x2c1f83[_0x80a4('0x44')],_0x1a1deb);_0x22520a[_0x4b28c3](_0x2131a6[_0x80a4('0x73')],_0x2131a6[_0x80a4('0x6f')]['start'],_0x2131a6[_0x80a4('0x6f')]['end']);}break;case'Tag':var _0x4b759a=_0x1a1deb['value']['split'](',')[_0x80a4('0x3b')](function(_0x2afeb7){return Number(_0x2afeb7);});_0x4b759a[_0x80a4('0x3f')](function(_0x37a1ca){_0x4adc69['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x37a1ca+',%');});_0x1c8b12=_[_0x80a4('0x74')](_0x1c8b12,_0x4b759a);break;case'User':if(_0x1a1deb['operator']==='$substring'){_0x22520a[_0x4b28c3]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x1a1deb[_0x80a4('0x6f')]+'%',null);}else{_0x2c1f83=_['find'](_0x44a8fb,[_0x80a4('0x39'),_0x80a4('0x75')]);_0x1a1deb[_0x80a4('0x53')]=_0x80a4('0x75');_0x2131a6=as[_0x80a4('0x72')](_0x46e6fa,_0x2c1f83[_0x80a4('0x44')],_0x1a1deb);_0x22520a[_0x4b28c3](_0x2131a6[_0x80a4('0x73')],_0x2131a6['value']['start'],_0x2131a6['value'][_0x80a4('0x31')]);}break;case _0x80a4('0x76'):_0x2131a6=as['buildExpression']('me',null,_0x1a1deb);_0x22520a[_0x4b28c3](_0x2131a6[_0x80a4('0x73')],_0x2131a6['value'][_0x80a4('0x77')],_0x2131a6[_0x80a4('0x6f')][_0x80a4('0x31')]);break;}}else{var _0x2131a6=as[_0x80a4('0x72')](_0x46e6fa,_0x2c1f83[_0x80a4('0x44')],_0x1a1deb);_0x22520a[_0x4b28c3](_0x2131a6[_0x80a4('0x73')],_0x2131a6[_0x80a4('0x6f')][_0x80a4('0x77')],_0x2131a6[_0x80a4('0x6f')][_0x80a4('0x31')]);}}}else{var _0x31c155=_(_0x8885d[_0x80a4('0x46')])['keys']()[_0x80a4('0x3b')](function(_0x2bce48){return _['some'](_0x44a8fb,[_0x80a4('0x39'),_0x2bce48])?_0x2bce48:undefined;})[_0x80a4('0x78')]()['value']();if(!_[_0x80a4('0x79')](_0x31c155)){_0x31c155[_0x80a4('0x3f')](function(_0x56f6f4){if(_0x56f6f4==='ChatWebsiteId'){_0x3c101e[_0x80a4('0x7a')](_0x80a4('0x7b'),[][_0x80a4('0x7c')](_0x8885d[_0x80a4('0x46')][_0x56f6f4]));}else if(_0x56f6f4===_0x80a4('0x7d')){var _0x327a29=JSON[_0x80a4('0x7e')](_0x8885d[_0x80a4('0x46')][_0x56f6f4])[_0x80a4('0x7f')];var _0x1a9325=JSON[_0x80a4('0x7e')](_0x8885d[_0x80a4('0x46')][_0x56f6f4])[_0x80a4('0x80')];_0x3c101e[_0x80a4('0x7a')](_0x80a4('0x81'),_0x327a29,_0x1a9325);}else{if(_0x8885d[_0x80a4('0x46')][_0x56f6f4]==='null'){_0x3c101e[_0x80a4('0x7a')]('i.'+_0x56f6f4+_0x80a4('0x82'));}else{_0x3c101e[_0x80a4('0x7a')]('i.'+_0x56f6f4+_0x80a4('0x83'),_0x8885d[_0x80a4('0x46')][_0x56f6f4]);}}});}if(_0x8885d['query']['read']){if(_0x8885d[_0x80a4('0x46')][_0x80a4('0x84')]==0x1){_0x3c101e['having'](_0x80a4('0x85'));}else{_0x3c101e['having'](_0x80a4('0x86'));}}if(_0x8885d[_0x80a4('0x46')]['tag']){_0x1c8b12=_[_0x80a4('0x87')](_0x8885d[_0x80a4('0x46')][_0x80a4('0x88')])?_0x8885d[_0x80a4('0x46')][_0x80a4('0x88')]:new Array(_0x8885d['query'][_0x80a4('0x88')]);_0x1c8b12[_0x80a4('0x3f')](function(_0x28b465){_0x4adc69['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x28b465+',%');});}if(_0x8885d['query'][_0x80a4('0x89')]){var _0x26bd43=_0x8885d[_0x80a4('0x46')]['filter'][_0x80a4('0x8a')]('\x5c','\x5c\x5c')[_0x80a4('0x8a')]('\x27\x27',_0x80a4('0x8b'));if(qs[_0x80a4('0x8c')](_0x26bd43)){_0x22520a['or'](_0x80a4('0x8d'),_0x26bd43+'%');}else{_0x22520a['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x80a4('0x6e')](_0x26bd43))['or'](_0x80a4('0x8e'),_0x26bd43+'%');}}}_0x3c101e['where'](_0x22520a);_0x3c101e['group'](_0x80a4('0x8f'));var _0x3845ec={'type':db[_0x80a4('0x21')][_0x80a4('0x90')][_0x80a4('0x91')],'raw':!![]};var _0x3b9282=_0x3c101e[_0x80a4('0x92')]();_0x3b9282[_0x80a4('0x53')](_0x80a4('0x8f'));_0x3b9282[_0x80a4('0x53')](_0x80a4('0x93'),_0x80a4('0x69'));if(_0x95cfe4[_0x80a4('0x50')]){_0x95cfe4['order'][_0x80a4('0x3f')](function(_0x4beef3){_0x3c101e['order']('i.'+_0x4beef3[0x0],_0x4beef3[0x1]===_0x80a4('0x94')?![]:!![]);});}if(!_[_0x80a4('0x79')](_0x1c8b12)){_0x3c101e[_0x80a4('0x6a')](_0x4adc69);_0x3b9282['where'](_0x80a4('0x95'),_0x1c8b12);}BPromise[_0x80a4('0x96')]()[_0x80a4('0x24')](function(){if(!_0x3d7838&&_0x8885d['query'][_0x80a4('0x97')])return;return _0x8885d[_0x80a4('0x98')][_0x80a4('0x99')]({'attributes':['id'],'raw':!![]})[_0x80a4('0x24')](function(_0x1a599e){if(_['isEmpty'](_0x1a599e)){_0x3b9282[_0x80a4('0x7a')]('i.ChatWebsiteId\x20IS\x20NULL');_0x3c101e[_0x80a4('0x7a')](_0x80a4('0x9a'));}else{_0x3b9282[_0x80a4('0x7a')](_0x80a4('0x7b'),_[_0x80a4('0x3b')](_0x1a599e,'id'));_0x3c101e[_0x80a4('0x7a')](_0x80a4('0x7b'),_['map'](_0x1a599e,'id'));}});})[_0x80a4('0x24')](function(){db[_0x80a4('0x9b')]['query'](_0x3b9282[_0x80a4('0x9c')](),_0x3845ec)[_0x80a4('0x24')](function(_0x456072){_0x315f1b[_0x80a4('0x32')]=_0x456072['length'];if(_0x315f1b[_0x80a4('0x32')]===0x0)return[];return db[_0x80a4('0x9b')]['query'](_0x3bf595[_0x80a4('0x9c')](),_0x3845ec)[_0x80a4('0x24')](function(_0x350830){_0x4997bc=_['keyBy'](_0x350830,'id');_0x3845ec=_['merge'](_0x3845ec,{'model':db[_0x80a4('0x9d')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x3c101e[_0x80a4('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x80a4('0x69'));_0x3c101e[_0x80a4('0x53')](_0x80a4('0x9e'),_0x80a4('0x9f'));_0x3c101e[_0x80a4('0x53')](_0x80a4('0xa0'),_0x80a4('0xa1'));_0x3c101e[_0x80a4('0x53')](_0x80a4('0xa2'));_0x3c101e['field'](_0x80a4('0xa3'),_0x80a4('0xa4'));_0x3c101e[_0x80a4('0x53')]('c.lastName',_0x80a4('0xa5'));_0x3c101e['field'](_0x80a4('0xa6'),'Contact.email');_0x3c101e['field'](_0x80a4('0xa7'),_0x80a4('0xa8'));_0x3c101e[_0x80a4('0x53')](_0x80a4('0xa9'),_0x80a4('0xaa'));_0x3c101e[_0x80a4('0x53')](_0x80a4('0xab'),_0x80a4('0xac'));_0x3c101e[_0x80a4('0x53')](_0x80a4('0xad'),_0x80a4('0x3c'));_0x3c101e[_0x80a4('0x4e')](_0x95cfe4[_0x80a4('0x4e')]);_0x3c101e[_0x80a4('0x4f')](_0x95cfe4[_0x80a4('0x4f')]);return db[_0x80a4('0x9b')][_0x80a4('0x46')](_0x3c101e[_0x80a4('0x9c')](),_0x3845ec);})['then'](function(_0x36201c){_0x22df06[_0x80a4('0x7a')](_0x80a4('0xae'),_['map'](_0x36201c,'id'));return db[_0x80a4('0x9b')][_0x80a4('0x46')](_0x22df06[_0x80a4('0x9c')](),_0x3845ec)['then'](function(_0x36cc80){var _0x101d33=_[_0x80a4('0xaf')](_0x36cc80,'ChatInteractionId');var _0x4cdce4=[];_0x36201c[_0x80a4('0x3f')](function(_0x2ed463){_0x4cdce4[_0x80a4('0x40')](updateChatInteraction(_0x2ed463,_0x4997bc,_0x101d33));});return BPromise[_0x80a4('0xb0')](_0x4cdce4);});});})[_0x80a4('0x24')](function(_0x2db65c){_0x315f1b['rows']=_0x2db65c;return _0x315f1b;})['then'](respondWithFilteredResult(_0x7dcc62,_0x95cfe4));})[_0x80a4('0x2e')](handleError(_0x7dcc62,null));};exports[_0x80a4('0xb1')]=function(_0x290bb9,_0x1f7f47){var _0x530adb={'raw':![],'where':{'id':_0x290bb9[_0x80a4('0xb2')]['id']}},_0xc4b1b={};_0xc4b1b[_0x80a4('0x45')]=_[_0x80a4('0x47')](db[_0x80a4('0x9d')]['rawAttributes']);_0xc4b1b[_0x80a4('0x46')]=_['keys'](_0x290bb9['query']);_0xc4b1b[_0x80a4('0xb3')]=_[_0x80a4('0x48')](_0xc4b1b['model'],_0xc4b1b[_0x80a4('0x46')]);_0x530adb[_0x80a4('0x49')]=_[_0x80a4('0x48')](_0xc4b1b[_0x80a4('0x45')],qs[_0x80a4('0x4a')](_0x290bb9[_0x80a4('0x46')]['fields']));_0x530adb[_0x80a4('0x49')]=_0x530adb[_0x80a4('0x49')][_0x80a4('0x4b')]?_0x530adb['attributes']:_0xc4b1b['model'];if(_0x290bb9[_0x80a4('0x46')][_0x80a4('0xb4')]){_0x530adb[_0x80a4('0xb5')]=[{'all':!![]}];}_0x530adb=_[_0x80a4('0xb6')]({},_0x530adb,_0x290bb9[_0x80a4('0xb7')]);return db[_0x80a4('0x9d')]['find'](_0x530adb)[_0x80a4('0x24')](handleEntityNotFound(_0x1f7f47,null))[_0x80a4('0x24')](respondWithResult(_0x1f7f47,null))[_0x80a4('0x2e')](handleError(_0x1f7f47,null));};exports[_0x80a4('0xb8')]=function(_0x4f161a,_0x371eea){return db[_0x80a4('0x9d')][_0x80a4('0xb8')](_0x4f161a['body'],{})[_0x80a4('0x24')](respondWithResult(_0x371eea,0xc9))['catch'](handleError(_0x371eea,null));};exports[_0x80a4('0x37')]=function(_0x499d88,_0x3e80e4){if(_0x499d88[_0x80a4('0x76')]['id']){delete _0x499d88[_0x80a4('0x76')]['id'];}return db[_0x80a4('0x9d')][_0x80a4('0x68')]({'where':{'id':_0x499d88[_0x80a4('0xb2')]['id']}})[_0x80a4('0x24')](handleEntityNotFound(_0x3e80e4,null))[_0x80a4('0x24')](saveUpdates(_0x499d88[_0x80a4('0x76')],null))['then'](respondWithResult(_0x3e80e4,null))['catch'](handleError(_0x3e80e4,null));};exports['destroy']=function(_0x18a799,_0x5b39d3){return db['ChatInteraction'][_0x80a4('0x68')]({'where':{'id':_0x18a799['params']['id']}})['then'](handleEntityNotFound(_0x5b39d3,null))['then'](removeEntity(_0x5b39d3,null))['catch'](handleError(_0x5b39d3,null));};exports['describe']=function(_0x25d0e1,_0x471839){return db[_0x80a4('0x9d')][_0x80a4('0xb9')]()[_0x80a4('0x24')](respondWithResult(_0x471839,null))[_0x80a4('0x2e')](handleError(_0x471839,null));};exports[_0x80a4('0xba')]=function(_0xa22cbf,_0x2b0ab1){if(_0xa22cbf[_0x80a4('0x76')]['id']){delete _0xa22cbf[_0x80a4('0x76')]['id'];}return db['ChatInteraction'][_0x80a4('0x68')]({'where':{'id':_0xa22cbf[_0x80a4('0xb2')]['id']}})[_0x80a4('0x24')](handleEntityNotFound(_0x2b0ab1,null))[_0x80a4('0x24')](saveUpdates(_0xa22cbf[_0x80a4('0x76')],null))[_0x80a4('0x24')](respondWithResult(_0x2b0ab1,null))[_0x80a4('0x2e')](handleError(_0x2b0ab1,null));};exports[_0x80a4('0xbb')]=function(_0xae50a8,_0x191c51,_0x3c246d){if(_0xae50a8['body']['id']){delete _0xae50a8[_0x80a4('0x76')]['id'];}return db[_0x80a4('0x9d')][_0x80a4('0x68')]({'where':{'id':_0xae50a8[_0x80a4('0xb2')]['id']}})[_0x80a4('0x24')](function(_0x20faf8){if(!_0x20faf8){logger[_0x80a4('0x2a')]('abandonInteraction,\x20%s,\x20%s,\x20%s',_0x80a4('0xbb'),0x194,_0x80a4('0xbc'));_0x191c51[_0x80a4('0x2f')](0x194);}else{if(_0x20faf8[_0x80a4('0x75')]){throw new db[(_0x80a4('0x21'))]['ValidationError'](_0x80a4('0xbd'));}}return _0x20faf8;})[_0x80a4('0x24')](function(_0x357dbf){if(_0x357dbf){return _0x357dbf['update']({'closed':_0xae50a8['body'][_0x80a4('0xbe')],'disposition':_0xae50a8[_0x80a4('0x76')][_0x80a4('0xbf')]})[_0x80a4('0x24')](function(_0x365c2c){return _0x365c2c;});}})[_0x80a4('0x24')](function(_0x3e71b4){return respondWithRpcPromise('AbandonInteraction',_0x80a4('0xbb'),_0xae50a8[_0x80a4('0x76')],client9004);})['then'](respondWithResult(_0x191c51,null))[_0x80a4('0x2e')](handleError(_0x191c51,null));};exports[_0x80a4('0xc0')]=function(_0x1ad346,_0x12b27b,_0x59c71e){_0x1ad346['body'][_0x80a4('0x39')]=_0x1ad346[_0x80a4('0xc1')][_0x80a4('0xc2')];_0x1ad346[_0x80a4('0x76')][_0x80a4('0xc3')]=_0x1ad346[_0x80a4('0xc1')][_0x80a4('0xc4')];_0x1ad346[_0x80a4('0x76')][_0x80a4('0x44')]=_0x1ad346['file'][_0x80a4('0xc5')];return db[_0x80a4('0xc6')]['create'](_0x1ad346[_0x80a4('0x76')])[_0x80a4('0x24')](respondWithResult(_0x12b27b,0xc9))[_0x80a4('0x2e')](handleError(_0x12b27b,null));};exports[_0x80a4('0xc7')]=function(_0x2c02ab,_0x454125,_0x1cf696){return db[_0x80a4('0x9d')]['findOne']({'where':{'id':_0x2c02ab[_0x80a4('0xb2')]['id']},'raw':!![]})[_0x80a4('0x24')](handleEntityNotFound(_0x454125,null))[_0x80a4('0x24')](function(_0x384f84){if(_0x384f84){if(_0x384f84['closed']){return _0x454125['status'](0x193)['json']({'status':0x193,'message':_0x80a4('0xc8')});}return db[_0x80a4('0xc6')][_0x80a4('0xc9')]({'where':{'id':_0x2c02ab[_0x80a4('0x46')][_0x80a4('0xca')]},'raw':!![]})['then'](handleEntityNotFound(_0x454125,null));}})[_0x80a4('0x24')](function(_0x30652d){if(_0x30652d){return _0x454125[_0x80a4('0xcb')](path[_0x80a4('0xcc')](config[_0x80a4('0xcd')],_0x80a4('0xce'),_0x30652d[_0x80a4('0xc3')]));}})[_0x80a4('0x2e')](handleError(_0x454125,null));};exports[_0x80a4('0xcf')]=function(_0x11ff6c,_0x5981fd){var _0x596d19=null;var _0x208985=null;var _0x310803=null;var _0x22b04c=null;if(_0x11ff6c[_0x80a4('0x76')]['id']){delete _0x11ff6c['body']['id'];}if(_0x11ff6c[_0x80a4('0x76')]['mailTranscript']){_0x22b04c=path[_0x80a4('0xcc')](config[_0x80a4('0xcd')],_0x80a4('0xd0'),util[_0x80a4('0xd1')](_0x80a4('0xd2'),Date[_0x80a4('0xd3')]()));_0x11ff6c['body']['pathTranscript']=_0x22b04c;}return db[_0x80a4('0x9d')][_0x80a4('0x68')]({'where':{'id':_0x11ff6c[_0x80a4('0xb2')]['id']},'include':[{'model':db[_0x80a4('0xd4')],'as':'Messages','include':[{'model':db[_0x80a4('0xd5')],'as':_0x80a4('0xd5')}]}]})[_0x80a4('0x24')](handleEntityNotFound(_0x5981fd,null))[_0x80a4('0x24')](saveUpdates(_0x11ff6c[_0x80a4('0x76')],null))[_0x80a4('0x24')](function(_0x2dc412){if(_0x2dc412){_0x596d19=_0x2dc412;return db[_0x80a4('0xd6')]['find']({'where':{'id':_0x596d19[_0x80a4('0x97')]}});}})[_0x80a4('0x24')](function(_0x38013f){if(_0x38013f){_0x310803=_0x38013f;return db[_0x80a4('0xd7')]['find']({'where':{'id':_0x596d19[_0x80a4('0x71')]}});}})['then'](function(_0x2ccd20){if(_0x2ccd20){_0x208985=_0x2ccd20;if(_0x22b04c){var _0x32d136=null;for(var _0x12d459=0x1;_0x12d459<_0x596d19[_0x80a4('0xd8')][_0x80a4('0x4b')];++_0x12d459){_0x32d136=_0x596d19[_0x80a4('0xd8')][_0x12d459];var _0x57e6d8=_0x32d136['UserId']?util[_0x80a4('0xd1')](_0x80a4('0xd9'),_0x310803['agentAlias'],_0x32d136['UserId']):_0x80a4('0xda');var _0x4b8def=_0x11ff6c[_0x80a4('0x76')][_0x80a4('0xdb')]||util[_0x80a4('0xd1')](_0x80a4('0xd9'),_0x80a4('0xdc'),_0x32d136[_0x80a4('0x71')]);switch(_0x310803[_0x80a4('0xdd')]){case'website_alias':_0x57e6d8=_0x32d136[_0x80a4('0x75')]?util[_0x80a4('0xd1')](_0x80a4('0xd9'),_0x310803[_0x80a4('0xde')],_0x32d136[_0x80a4('0x75')]):'System';break;case _0x80a4('0xdf'):_0x57e6d8=_0x32d136[_0x80a4('0x75')]?_0x32d136['User'][_0x80a4('0xe0')]||_0x32d136[_0x80a4('0xd5')][_0x80a4('0xe1')]:_0x80a4('0xda');break;case _0x80a4('0xe2'):_0x57e6d8=_0x32d136[_0x80a4('0x75')]?_0x32d136['User'][_0x80a4('0xe1')]:_0x80a4('0xda');break;default:_0x57e6d8=_0x32d136[_0x80a4('0x75')]?util['format'](_0x80a4('0xd9'),_0x310803['agentAlias'],_0x32d136['UserId']):_0x80a4('0xda');}var _0x1d886c=util[_0x80a4('0xd1')](_0x80a4('0xe3'),moment(_0x32d136[_0x80a4('0x7d')])[_0x80a4('0xd1')](_0x80a4('0xe4')),_0x32d136[_0x80a4('0xe5')]==='in'?_0x4b8def:_0x57e6d8,_0x32d136[_0x80a4('0x76')]);if(!_0x32d136[_0x80a4('0xe6')]){fs[_0x80a4('0xe7')](_0x22b04c,_0x1d886c);}}return db['MailAccount'][_0x80a4('0xc9')]({'where':{'service':!![]},'include':[{'model':db[_0x80a4('0xe8')],'as':_0x80a4('0xe9'),'raw':!![]}]});}}})['then'](function(_0x3d9c0f){if(_0x3d9c0f&&_0x3d9c0f[_0x80a4('0xe9')]&&_0x11ff6c['body']){var _0x1a30cf={'tls':{'rejectUnauthorized':![]}};if(_0x3d9c0f[_0x80a4('0xe9')][_0x80a4('0xea')]){_0x1a30cf[_0x80a4('0xea')]=_0x3d9c0f['Smtp']['service'];}else{_0x1a30cf[_0x80a4('0xeb')]=_0x3d9c0f[_0x80a4('0xe9')][_0x80a4('0xeb')];_0x1a30cf['port']=_0x3d9c0f[_0x80a4('0xe9')][_0x80a4('0xec')];_0x1a30cf[_0x80a4('0xed')]=_0x3d9c0f['Smtp']['secure'];}if(_0x3d9c0f[_0x80a4('0xe9')][_0x80a4('0xee')]){_0x1a30cf[_0x80a4('0xef')]={'user':_0x3d9c0f[_0x80a4('0xe9')][_0x80a4('0x98')],'pass':_0x3d9c0f['Smtp'][_0x80a4('0xf0')]};}return respondWithRpcPromise('SendMail',_0x80a4('0xf1'),{'account':_0x1a30cf,'message':{'from':util[_0x80a4('0xd1')](_0x80a4('0xf2'),_0x3d9c0f[_0x80a4('0x39')],_0x3d9c0f[_0x80a4('0xf3')]||_0x3d9c0f['Smtp'][_0x80a4('0x98')]),'to':_0x11ff6c[_0x80a4('0x76')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0x80a4('0xd1')](_0x80a4('0xf4'),_0x11ff6c['body']['mailTranscript']),'attachments':[{'path':_0x22b04c}]}})[_0x80a4('0x24')](function(){return _0x596d19;})['catch'](function(_0x2c6524){console[_0x80a4('0x2a')](_0x2c6524);});}else{return _0x596d19;}})[_0x80a4('0x24')](respondWithStatusCode(_0x5981fd,0xc8))['catch'](handleError(_0x5981fd,null));};exports['addMessage']=function(_0x556742,_0x53130e,_0x4f1ee0){return db[_0x80a4('0xd4')][_0x80a4('0x68')]({'where':{'id':_0x556742[_0x80a4('0xb2')]['id']}})[_0x80a4('0x24')](handleEntityNotFound(_0x53130e,null))['then'](function(_0x10607a){if(_0x10607a){return _0x10607a[_0x80a4('0xf5')](_0x556742['body']['ids'],_['omit'](_0x556742['body'],[_0x80a4('0xf6'),'id'])||{});}})[_0x80a4('0x24')](respondWithResult(_0x53130e,null))[_0x80a4('0x2e')](handleError(_0x53130e,null));};exports[_0x80a4('0xf7')]=function(_0x780c97,_0x17648f,_0x553ea9){var _0x1f64f5={'raw':![],'where':{}};var _0xff1e4e={};var _0x4dba0f={'count':0x0,'rows':[]};return db[_0x80a4('0x9d')][_0x80a4('0xc9')]({'where':{'id':_0x780c97['params']['id']}})['then'](handleEntityNotFound(_0x17648f,null))['then'](function(_0x41b99f){if(_0x41b99f){_0xff1e4e['model']=_[_0x80a4('0x47')](db[_0x80a4('0xd4')][_0x80a4('0x42')]);_0xff1e4e[_0x80a4('0x46')]=_['keys'](_0x780c97[_0x80a4('0x46')]);_0xff1e4e[_0x80a4('0xb3')]=_['intersection'](_0xff1e4e[_0x80a4('0x45')],_0xff1e4e[_0x80a4('0x46')]);_0x1f64f5['attributes']=_[_0x80a4('0x48')](_0xff1e4e[_0x80a4('0x45')],qs[_0x80a4('0x4a')](_0x780c97['query']['fields']));_0x1f64f5[_0x80a4('0x49')]=_0x1f64f5[_0x80a4('0x49')][_0x80a4('0x4b')]?_0x1f64f5['attributes']:_0xff1e4e[_0x80a4('0x45')];if(!_0x780c97[_0x80a4('0x46')]['hasOwnProperty'](_0x80a4('0x4d'))){_0x1f64f5['limit']=qs[_0x80a4('0x4e')](_0x780c97[_0x80a4('0x46')][_0x80a4('0x4e')]);_0x1f64f5[_0x80a4('0x4f')]=qs[_0x80a4('0x4f')](_0x780c97['query'][_0x80a4('0x4f')]);}_0x1f64f5[_0x80a4('0x50')]=qs[_0x80a4('0x51')](_0x780c97[_0x80a4('0x46')]['sort']);_0x1f64f5['where']=qs['filters'](_[_0x80a4('0x52')](_0x780c97[_0x80a4('0x46')],_0xff1e4e['filters']));_0x1f64f5[_0x80a4('0x7a')][_0x80a4('0xf8')]=_0x41b99f['id'];if(_0x780c97[_0x80a4('0x46')][_0x80a4('0x89')]){_0x1f64f5['where']=_[_0x80a4('0xb6')](_0x1f64f5[_0x80a4('0x7a')],{'$or':_['map'](_0x1f64f5[_0x80a4('0x49')],function(_0x5e0c34){var _0x2355aa={};_0x2355aa[_0x5e0c34]={'$like':'%'+_0x780c97['query'][_0x80a4('0x89')]+'%'};return _0x2355aa;})});}if(_0x780c97['query'][_0x80a4('0x7f')]){var _0x2c399d=_0x780c97['query'][_0x80a4('0x7f')]['split'](',');var _0x5d76a7={};_0x5d76a7[_0x2c399d[0x0]]={'$gte':moment(_0x2c399d[0x1])['format'](_0x80a4('0xf9'))};_0x1f64f5[_0x80a4('0x7a')]=_[_0x80a4('0xb6')](_0x1f64f5['where'],_0x5d76a7);}_0x1f64f5=_[_0x80a4('0xb6')]({},_0x1f64f5,_0x780c97['options']);return db[_0x80a4('0xd4')][_0x80a4('0x32')]({'where':_0x1f64f5[_0x80a4('0x7a')]})['then'](function(_0x2e95c3){_0x4dba0f['count']=_0x2e95c3;if(_0x780c97[_0x80a4('0x46')][_0x80a4('0xb4')]){_0x1f64f5[_0x80a4('0xb5')]=[{'all':!![]}];}return db[_0x80a4('0xd4')]['findAll'](_0x1f64f5);})['then'](function(_0xf1500b){_0x4dba0f[_0x80a4('0xfa')]=_0xf1500b;return _0x4dba0f;});}})[_0x80a4('0x24')](respondWithFilteredResult(_0x17648f,_0x1f64f5))[_0x80a4('0x2e')](handleError(_0x17648f,null));};exports[_0x80a4('0xfb')]=function(_0xedb02,_0x26bc4c,_0x3c4d14){var _0x21e21c={'where':{}},_0x49e6ca={},_0x13602c={'count':0x0,'rows':[]};return db[_0x80a4('0x9d')][_0x80a4('0xc9')]({'where':{'id':_0xedb02[_0x80a4('0xb2')]['id']}})['then'](handleEntityNotFound(_0x26bc4c,null))[_0x80a4('0x24')](function(_0x454940){if(_0x454940){_0x49e6ca[_0x80a4('0x45')]=_[_0x80a4('0x47')](db['ChatMessage'][_0x80a4('0x42')]);_0x49e6ca['query']=_[_0x80a4('0x47')](_0xedb02[_0x80a4('0x46')]);_0x49e6ca[_0x80a4('0xb3')]=_[_0x80a4('0x48')](_0x49e6ca['model'],_0x49e6ca['query']);_0x21e21c[_0x80a4('0x49')]=_[_0x80a4('0x48')](_0x49e6ca['model'],qs['fields'](_0xedb02['query'][_0x80a4('0x4a')]));_0x21e21c['attributes']=_0x21e21c[_0x80a4('0x49')]['length']?_0x21e21c['attributes']:_0x49e6ca[_0x80a4('0x45')];if(!_0xedb02[_0x80a4('0x46')][_0x80a4('0x4c')](_0x80a4('0x4d'))){_0x21e21c['limit']=qs[_0x80a4('0x4e')](_0xedb02[_0x80a4('0x46')][_0x80a4('0x4e')]);_0x21e21c[_0x80a4('0x4f')]=qs[_0x80a4('0x4f')](_0xedb02[_0x80a4('0x46')][_0x80a4('0x4f')]);}_0x21e21c[_0x80a4('0x50')]=qs[_0x80a4('0x51')](_0xedb02[_0x80a4('0x46')]['sort']);_0x21e21c[_0x80a4('0x7a')]=qs['filters'](_[_0x80a4('0x52')](_0xedb02['query'],_0x49e6ca['filters']));_0x21e21c[_0x80a4('0x7a')]['ChatInteractionId']=_0x454940['id'];if(_0xedb02[_0x80a4('0x46')][_0x80a4('0x89')]){_0x21e21c['where']=_[_0x80a4('0xb6')](_0x21e21c[_0x80a4('0x7a')],{'$or':_[_0x80a4('0x3b')](_0x21e21c[_0x80a4('0x49')],function(_0x1b5457){var _0x328fe5={};_0x328fe5[_0x1b5457]={'$like':'%'+_0xedb02[_0x80a4('0x46')][_0x80a4('0x89')]+'%'};return _0x328fe5;})});}_0x21e21c[_0x80a4('0x7a')][_0x80a4('0xe6')]=![];if(_0xedb02[_0x80a4('0x46')]['id']){_0x21e21c['where']['id']={'$gt':_0xedb02['query']['id']};}_0x21e21c=_[_0x80a4('0xb6')]({},_0x21e21c,_0xedb02[_0x80a4('0xb7')]);return db[_0x80a4('0xd4')]['count']({'where':_0x21e21c[_0x80a4('0x7a')]})[_0x80a4('0x24')](function(_0x1f81ab){_0x13602c[_0x80a4('0x32')]=_0x1f81ab;_0x21e21c[_0x80a4('0xb5')]=[];if(_0xedb02['query']['includeAgent']){_0x21e21c[_0x80a4('0xb5')]['push']({'model':db[_0x80a4('0xd5')],'as':_0x80a4('0xd5'),'attributes':['id',_0x80a4('0xe1'),_0x80a4('0xe0')]});}if(_0xedb02[_0x80a4('0x46')][_0x80a4('0xb4')]){_0x21e21c[_0x80a4('0xb5')]=[{'all':!![]}];}return db[_0x80a4('0xd4')]['findAll'](_0x21e21c);})[_0x80a4('0x24')](function(_0x16d6ed){_0x13602c[_0x80a4('0xfa')]=_0x16d6ed;return _0x13602c;});}})[_0x80a4('0x24')](respondWithFilteredResult(_0x26bc4c,_0x21e21c))[_0x80a4('0x2e')](handleError(_0x26bc4c,null));};exports['addTags']=function(_0x109b07,_0x10d227,_0x484eea){return db[_0x80a4('0x9d')]['find']({'where':{'id':_0x109b07['params']['id']}})[_0x80a4('0x24')](handleEntityNotFound(_0x10d227,null))[_0x80a4('0x24')](function(_0xd38f25){if(_0xd38f25){return _0xd38f25[_0x80a4('0xfc')](_0x109b07[_0x80a4('0x76')][_0x80a4('0xf6')],_[_0x80a4('0xfd')](_0x109b07[_0x80a4('0x76')],[_0x80a4('0xf6'),'id'])||{})['spread'](function(){return db[_0x80a4('0xfe')]['findAll']({'attributes':['id',_0x80a4('0x39'),_0x80a4('0xff')],'where':{'id':_0x109b07[_0x80a4('0x76')][_0x80a4('0xf6')]}});})[_0x80a4('0x24')](function(_0x5c87b4){socket['emit'](_0x80a4('0x100'),{'id':Number(_0x109b07[_0x80a4('0xb2')]['id']),'tags':_0x5c87b4||[]});return{'id':Number(_0x109b07[_0x80a4('0xb2')]['id']),'tags':_0x5c87b4||[]};});}})[_0x80a4('0x24')](respondWithResult(_0x10d227,null))['catch'](handleError(_0x10d227,null));};exports[_0x80a4('0x101')]=function(_0x4371dd,_0x23b64f,_0x3263e1){return db[_0x80a4('0x9d')][_0x80a4('0x68')]({'where':{'id':_0x4371dd['params']['id']}})['then'](handleEntityNotFound(_0x23b64f,null))[_0x80a4('0x24')](function(_0x2d4ddf){if(_0x2d4ddf){return _0x2d4ddf[_0x80a4('0x101')](_0x4371dd['query'][_0x80a4('0xf6')]);}})[_0x80a4('0x24')](respondWithStatusCode(_0x23b64f,null))[_0x80a4('0x2e')](handleError(_0x23b64f,null));};exports[_0x80a4('0xcb')]=function(_0x15e114,_0x54882e){var _0x38b26b=moment()[_0x80a4('0x102')]()[_0x80a4('0x9c')]();var _0x15d3d3=path[_0x80a4('0xcc')](config['root'],'server',_0x80a4('0x103'),_0x80a4('0x104'));var _0x3ae5be=path['join'](config[_0x80a4('0xcd')],'server',_0x80a4('0x103'),_0x80a4('0x105'));var _0x25b6a3=path[_0x80a4('0xcc')](_0x15d3d3,_0x38b26b);var _0x78bf5d=util['format']('transcript-%d-%s.zip',_0x15e114[_0x80a4('0xb2')]['id'],_0x38b26b);var _0x32f496=path[_0x80a4('0xcc')](_0x15d3d3,_0x78bf5d);var _0x1d3e73=![];return db[_0x80a4('0x9d')][_0x80a4('0x68')]({'where':{'id':_0x15e114[_0x80a4('0xb2')]['id']},'include':[{'model':db['ChatMessage'],'as':_0x80a4('0xd8'),'attributes':['id',_0x80a4('0x76'),_0x80a4('0x7d'),'direction',_0x80a4('0xe6'),_0x80a4('0x84')],'include':[{'model':db['User'],'as':_0x80a4('0xd5'),'attributes':['id',_0x80a4('0xe1')],'raw':!![]},{'model':db['CmContact'],'as':_0x80a4('0x106'),'attributes':['id','firstName',_0x80a4('0x107')],'raw':!![]},{'model':db[_0x80a4('0xc6')],'as':_0x80a4('0xc6'),'raw':!![]}]},{'model':db['ChatWebsite'],'as':_0x80a4('0x108'),'attributes':['id',_0x80a4('0x39')]},{'model':db['User'],'as':_0x80a4('0x109'),'attributes':['id','fullname']}]})[_0x80a4('0x24')](handleEntityNotFound(_0x54882e,null))[_0x80a4('0x24')](function(_0x305e24){if(_0x305e24){var _0x55690a=_0x305e24[_0x80a4('0x10a')]({'plain':!![]});_0x1d3e73=!![];var _0xe67e86={'format':'A4','border':_0x80a4('0x10b'),'header':{'height':_0x80a4('0x10c'),'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':_0x80a4('0x10d'),'contents':{'default':util['format'](_0x80a4('0x10e'),util['format'](_0x80a4('0x10f'),'Chat',_0x55690a['id']),moment()[_0x80a4('0xd1')]('YYYY-MM-DD')[_0x80a4('0x9c')]())}}};fs[_0x80a4('0x110')](_0x25b6a3);var _0x62c213={'channel':'Chat','account':_0x55690a[_0x80a4('0x108')]['name'],'agent':_0x55690a[_0x80a4('0x109')]?_0x55690a['Owner']['fullname']:_0x80a4('0x111'),'createdAt':moment(_0x55690a[_0x80a4('0x7d')])[_0x80a4('0xd1')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'closedAt':_0x55690a['closed']?moment(_0x55690a['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x80a4('0x9c')]():'','disposition':_0x55690a[_0x80a4('0xbf')],'chatInfo':{'browser':_0x55690a['browserName'],'os':_0x55690a[_0x80a4('0x112')],'referer':_0x55690a[_0x80a4('0x113')],'customerIp':_0x55690a[_0x80a4('0x114')],'customerPort':_0x55690a[_0x80a4('0x115')]?_0x55690a[_0x80a4('0x115')]:_0x80a4('0x111')},'messages':_(_0x55690a[_0x80a4('0xd8')])['tail']()[_0x80a4('0x89')]({'secret':![]})[_0x80a4('0x3b')](function(_0x1b89ca){if(_0x1b89ca[_0x80a4('0xc6')]){var _0x2fd204=path[_0x80a4('0xcc')](_0x3ae5be,_0x1b89ca[_0x80a4('0xc6')][_0x80a4('0xc3')]);if(fs['existsSync'](_0x2fd204)){fs['createReadStream'](_0x2fd204)['pipe'](fs[_0x80a4('0x116')](path[_0x80a4('0xcc')](_0x25b6a3,_0x1b89ca[_0x80a4('0xc6')][_0x80a4('0xc3')])));}}return{'date':moment(_0x1b89ca[_0x80a4('0x7d')])['format'](_0x80a4('0xf9'))[_0x80a4('0x9c')](),'sender':_0x1b89ca[_0x80a4('0xe5')]==='out'?_0x1b89ca[_0x80a4('0xd5')]?_0x1b89ca[_0x80a4('0xd5')][_0x80a4('0xe1')]:_0x80a4('0xda'):_0x1b89ca[_0x80a4('0x106')][_0x80a4('0x117')]+(_0x1b89ca[_0x80a4('0x106')][_0x80a4('0x107')]?'\x20'+_0x1b89ca['Contact'][_0x80a4('0x107')]:''),'body':_0x1b89ca[_0x80a4('0xc6')]?_0x1b89ca[_0x80a4('0xc6')][_0x80a4('0xc3')]:_0x1b89ca[_0x80a4('0x76')],'direction':_0x1b89ca[_0x80a4('0xe5')]===_0x80a4('0x118')?'A':'C','secret':_0x1b89ca['secret'],'read':_0x1b89ca['read'],'attachment':_0x1b89ca[_0x80a4('0xc6')]};})[_0x80a4('0x6f')]()};return ejs[_0x80a4('0x119')](path[_0x80a4('0xcc')](config[_0x80a4('0xcd')],_0x80a4('0x11a'),_0x80a4('0x11b'),_0x80a4('0x11c')),{'interaction':_0x62c213})[_0x80a4('0x24')](function(_0xce22c3){return new BPromise(function(_0x316451,_0x3cbb86){pdf[_0x80a4('0xb8')](_0xce22c3,_0xe67e86)[_0x80a4('0x11d')](path['join'](_0x25b6a3,_0x80a4('0x11e')+_0x55690a['id']+'-'+_0x38b26b+_0x80a4('0x11f')),function(_0x2dba2b,_0x4d0e98){if(_0x2dba2b)return _0x3cbb86(_0x2dba2b);_0x316451(_0x4d0e98);});});});}})[_0x80a4('0x24')](function(){if(_0x1d3e73){return new BPromise(function(_0xd61ef4,_0x1ccdce){zipdir(_0x25b6a3,{'saveTo':_0x32f496},function(_0x224bbb,_0x5eeaed){if(_0x224bbb)return _0x1ccdce(_0x224bbb);return _0xd61ef4(_0x5eeaed);});})[_0x80a4('0x24')](function(){return new BPromise(function(_0x5e3bf7,_0x5e45b4){rimraf(_0x25b6a3,function(_0x32defd){if(_0x32defd)_0x5e45b4(_0x32defd);return _0x5e3bf7();});});})[_0x80a4('0x24')](function(){return _0x54882e[_0x80a4('0xcb')](_0x32f496,_0x78bf5d,function(_0x500da9){if(_0x500da9){console['log'](_0x80a4('0x120'),_0x500da9);}else{fs['unlinkSync'](_0x32f496);}});});}else{return _0x54882e['sendStatus'](0xc8);}})[_0x80a4('0x2e')](handleError(_0x54882e,null));}; \ No newline at end of file +var _0x72bf=['Account.mandatoryDisposition','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','all','show','rawAttributes','includeAll','include','options','create','params','describe','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','ValidationError','disposition','AbandonInteraction','attachmentUpload','file','originalname','filename','Attachment','attachmentDownload','findOne','closed','attachId','join','root','server/files/attachments/','basename','close','format','now','pathTranscript','ChatMessage','Messages','CmContact','%s%d','agentAlias','System','customer','Visitor','agentIdentifier','website_alias','agent_alias','alias','fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','Smtp','service','port','secure','authentication','auth','sendMail','\x22%s\x22\x20<%s>','email','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','rows','ChatInteractionId','includeAgent','findAll','addTags','setTags','spread','emit','chatInteractionTags:save','removeTags','download','unix','server','files','attachments','transcript-%d-%s.zip','firstName','lastName','ChatWebsite','Account','Owner','get','10px','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','Chat','YYYY-MM-DD','mkdirSync','customerIp','customerPort','existsSync','pipe','createWriteStream','out','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./chatInteraction.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','set','Content-Range','apply','update','destroy','name','send','Users','map','TagIds','Tags','split','forEach','index','ChatInteraction','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','user_has_chat_interactions','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.ChatWebsiteId','chat_messages','me.ChatInteractionId\x20=\x20i.id','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','UserId','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','filter','replace','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','user','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x72bf,0x199));var _0xf72b=function(_0x288371,_0x1958f1){_0x288371=_0x288371-0x0;var _0x70f8f3=_0x72bf[_0x288371];return _0x70f8f3;};'use strict';var pdf=require(_0xf72b('0x0'));var emlformat=require(_0xf72b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf72b('0x2'));var jsonpatch=require(_0xf72b('0x3'));var rp=require('request-promise');var moment=require(_0xf72b('0x4'));var BPromise=require(_0xf72b('0x5'));var Mustache=require(_0xf72b('0x6'));var util=require(_0xf72b('0x7'));var path=require(_0xf72b('0x8'));var sox=require(_0xf72b('0x9'));var csv=require('to-csv');var ejs=require(_0xf72b('0xa'));var fs=require('fs');var _=require(_0xf72b('0xb'));var squel=require('squel');var crypto=require(_0xf72b('0xc'));var jsforce=require(_0xf72b('0xd'));var deskjs=require(_0xf72b('0xe'));var toCsv=require(_0xf72b('0xf'));var querystring=require(_0xf72b('0x10'));var Papa=require(_0xf72b('0x11'));var Redis=require(_0xf72b('0x12'));var authService=require(_0xf72b('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf72b('0x14'));var hardwareService=require(_0xf72b('0x15'));var logger=require(_0xf72b('0x16'))(_0xf72b('0x17'));var utils=require(_0xf72b('0x18'));var config=require(_0xf72b('0x19'));var db=require(_0xf72b('0x1a'))['db'];config['redis']=_[_0xf72b('0x1b')](config[_0xf72b('0x1c')],{'host':_0xf72b('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf72b('0x1c')]));require(_0xf72b('0x1e'))[_0xf72b('0x1f')](socket);var jayson=require(_0xf72b('0x20'));var client=jayson[_0xf72b('0x21')][_0xf72b('0x22')]({'port':0x232b});var client9004=jayson['client']['http']({'port':0x232c});function checkPasswordPattern(_0x5237f7,_0x4b00df,_0x13d717){if(_0x13d717){var _0x3d7c90=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d7c90[_0xf72b('0x23')](_0x4b00df)){return _0x5237f7;}else{throw new db[(_0xf72b('0x24'))]['ValidationError'](_0xf72b('0x25'));}}else{return _0x5237f7;}}function respondWithRpcPromise(_0x49158c,_0x11d80e,_0x5289ee,_0x22ee12){return new BPromise(function(_0x2534ce,_0x3cd844){var _0x1c5210=_0x22ee12||client;return _0x1c5210[_0xf72b('0x26')](_0x49158c,_0x5289ee)[_0xf72b('0x27')](function(_0x1a7736){logger[_0xf72b('0x28')](_0xf72b('0x29'),_0x11d80e,_0xf72b('0x2a'));logger[_0xf72b('0x2b')](_0xf72b('0x2c'),_0x11d80e,'request\x20sent',JSON[_0xf72b('0x2d')](_0x1a7736));if(_0x1a7736[_0xf72b('0x2e')]){if(_0x1a7736['error']['code']===0x1f4){logger[_0xf72b('0x2e')](_0xf72b('0x29'),_0x11d80e,_0x1a7736['error'][_0xf72b('0x2f')]);return _0x3cd844(_0x1a7736['error'][_0xf72b('0x2f')]);}logger[_0xf72b('0x2e')](_0xf72b('0x29'),_0x11d80e,_0x1a7736[_0xf72b('0x2e')]['message']);return _0x2534ce(_0x1a7736[_0xf72b('0x2e')][_0xf72b('0x2f')]);}else{logger[_0xf72b('0x28')]('ChatInteraction,\x20%s,\x20%s',_0x11d80e,'request\x20sent');_0x2534ce(_0x1a7736[_0xf72b('0x30')][_0xf72b('0x2f')]);}})[_0xf72b('0x31')](function(_0x4c34fa){logger[_0xf72b('0x2e')](_0xf72b('0x29'),_0x11d80e,_0x4c34fa);_0x3cd844(_0x4c34fa);});});}function respondWithStatusCode(_0xd0edda,_0x47338a){_0x47338a=_0x47338a||0xcc;return function(_0x2cf3d4){if(_0x2cf3d4){return _0xd0edda[_0xf72b('0x32')](_0x47338a);}return _0xd0edda[_0xf72b('0x33')](_0x47338a)[_0xf72b('0x34')]();};}function respondWithResult(_0x25942b,_0x49c16a){_0x49c16a=_0x49c16a||0xc8;return function(_0x40ae58){if(_0x40ae58){return _0x25942b[_0xf72b('0x33')](_0x49c16a)[_0xf72b('0x35')](_0x40ae58);}};}function respondWithFilteredResult(_0x4ae727,_0x4cad11){return function(_0x266d8b){if(_0x266d8b){var _0x2d8602=_0x266d8b[_0xf72b('0x36')],_0x572e98=_0x4cad11['offset'],_0xa23a40=_0x4cad11['offset']+_0x4cad11['limit'],_0x128f09;if(_0xa23a40>=_0x2d8602){_0xa23a40=_0x2d8602;_0x128f09=0xc8;}else{_0x128f09=0xce;}_0x4ae727[_0xf72b('0x33')](_0x128f09);return _0x4ae727[_0xf72b('0x37')](_0xf72b('0x38'),_0x572e98+'-'+_0xa23a40+'/'+_0x2d8602)[_0xf72b('0x35')](_0x266d8b);}return null;};}function patchUpdates(_0x2dd3e1){return function(_0x343835){try{jsonpatch[_0xf72b('0x39')](_0x343835,_0x2dd3e1,!![]);}catch(_0x4b7787){return BPromise['reject'](_0x4b7787);}return _0x343835['save']();};}function saveUpdates(_0x5b223f,_0x15ba4e){return function(_0x575536){if(_0x575536){return _0x575536[_0xf72b('0x3a')](_0x5b223f)[_0xf72b('0x27')](function(_0x5151da){return _0x5151da;});}return null;};}function removeEntity(_0xd9b90,_0x3e7701){return function(_0x5353ca){if(_0x5353ca){return _0x5353ca[_0xf72b('0x3b')]()[_0xf72b('0x27')](function(){_0xd9b90['status'](0xcc)[_0xf72b('0x34')]();});}};}function handleEntityNotFound(_0x566aba,_0x5d8052){return function(_0x46d1bc){if(!_0x46d1bc){_0x566aba[_0xf72b('0x32')](0x194);}return _0x46d1bc;};}function handleError(_0x1a7979,_0x16bc27){_0x16bc27=_0x16bc27||0x1f4;return function(_0x174362){logger['error'](_0x174362['stack']);if(_0x174362[_0xf72b('0x3c')]){delete _0x174362[_0xf72b('0x3c')];}_0x1a7979[_0xf72b('0x33')](_0x16bc27)[_0xf72b('0x3d')](_0x174362);};}function getInteractionUsers(_0x559096,_0x3cfcc1){return new BPromise(function(_0x489e8,_0x3c66a6){try{if(_0x3cfcc1[_0x559096['id']]){_0x559096[_0xf72b('0x3e')]=_[_0xf72b('0x3f')](_0x3cfcc1[_0x559096['id']],function(_0x1a7345){return{'id':_0x1a7345['id']};});}}catch(_0x5391b0){_0x3c66a6(_0x5391b0);}_0x489e8(_0x559096);});}function getInteractionTags(_0x40780d,_0x366ef0){return new BPromise(function(_0x3d44bb,_0x422883){try{if(_0x40780d[_0xf72b('0x40')]){_0x40780d[_0xf72b('0x41')]=[];_0x40780d['TagIds'][_0xf72b('0x42')](',')[_0xf72b('0x43')](function(_0x49fe9a){_0x40780d[_0xf72b('0x41')]['push'](_0x366ef0[_0x49fe9a]);});}delete _0x40780d[_0xf72b('0x40')];}catch(_0x25c9d0){_0x422883(_0x25c9d0);}_0x3d44bb(_0x40780d);});}function updateChatInteraction(_0x10057f,_0x300842,_0x5c13b5){return new BPromise(function(_0x942914,_0xe6be0c){return getInteractionUsers(_0x10057f,_0x5c13b5)[_0xf72b('0x27')](function(_0x53ab69){return getInteractionTags(_0x53ab69,_0x300842);})[_0xf72b('0x27')](function(_0x652e7e){_0x942914(_0x652e7e);})[_0xf72b('0x31')](function(_0x2e6c17){_0xe6be0c(_0x2e6c17);});});}exports[_0xf72b('0x44')]=function(_0x16afc0,_0x13b5af){var _0xdf71e6={},_0x36d310={},_0x4568d1={'count':0x0,'rows':[]};var _0x54d43a=_[_0xf72b('0x3f')](db[_0xf72b('0x45')]['rawAttributes'],function(_0x527fa9){return{'name':_0x527fa9[_0xf72b('0x46')],'type':_0x527fa9[_0xf72b('0x47')][_0xf72b('0x48')]};});_0x36d310[_0xf72b('0x49')]=_[_0xf72b('0x3f')](_0x54d43a,_0xf72b('0x3c'));_0x36d310[_0xf72b('0x4a')]=_[_0xf72b('0x4b')](_0x16afc0['query']);_0x36d310[_0xf72b('0x4c')]=_[_0xf72b('0x4d')](_0x36d310[_0xf72b('0x49')],_0x36d310['query']);_0xdf71e6['attributes']=_[_0xf72b('0x4d')](_0x36d310['model'],qs['fields'](_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x4e')]));_0xdf71e6['attributes']=_0xdf71e6[_0xf72b('0x4f')][_0xf72b('0x50')]?_0xdf71e6[_0xf72b('0x4f')]:_0x36d310[_0xf72b('0x49')];if(!_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x51')](_0xf72b('0x52'))){_0xdf71e6[_0xf72b('0x53')]=qs[_0xf72b('0x53')](_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x53')]);_0xdf71e6[_0xf72b('0x54')]=qs[_0xf72b('0x54')](_0x16afc0['query'][_0xf72b('0x54')]);}_0xdf71e6[_0xf72b('0x55')]=qs[_0xf72b('0x56')](_0x16afc0[_0xf72b('0x4a')]['sort']);_0xdf71e6[_0xf72b('0x57')]=qs['filters'](_[_0xf72b('0x58')](_0x16afc0[_0xf72b('0x4a')],_0x36d310[_0xf72b('0x4c')]));var _0xe9e8e1=[];var _0x44fa05=squel[_0xf72b('0x59')]()[_0xf72b('0x5a')]('id')[_0xf72b('0x5a')](_0xf72b('0x3c'))['field'](_0xf72b('0x5b'))[_0xf72b('0x5c')](_0xf72b('0x5d'));var _0x4a20e4=squel[_0xf72b('0x59')]()[_0xf72b('0x5a')](_0xf72b('0x5e'))[_0xf72b('0x5a')](_0xf72b('0x5f'))[_0xf72b('0x5c')](_0xf72b('0x60'),'ui')[_0xf72b('0x61')](_0xf72b('0x62'),'u',_0xf72b('0x63'));var _0x5007a2=squel[_0xf72b('0x59')]()['from'](_0xf72b('0x64'),'i')['left_join'](_0xf72b('0x65'),'c',_0xf72b('0x66'))[_0xf72b('0x61')](_0xf72b('0x62'),'o',_0xf72b('0x67'))[_0xf72b('0x61')]('chat_websites','a',_0xf72b('0x68'))[_0xf72b('0x61')](_0xf72b('0x69'),'me',_0xf72b('0x6a'))[_0xf72b('0x61')]('chat_interaction_has_tags','it',_0xf72b('0x6b'))[_0xf72b('0x61')](_0xf72b('0x5d'),'t',_0xf72b('0x6c'));var _0x40e041=squel[_0xf72b('0x6d')]();var _0x672ebe=[];var _0x156076=squel['expr']();var _0x51c384;if(_0x16afc0[_0xf72b('0x4a')]['search']){_0x51c384=as[_0xf72b('0x6e')](_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x6f')]);var _0x26892f=_0x51c384['sqlOperator'];for(var _0x161822=0x0;_0x161822<_0x51c384[_0xf72b('0x70')][_0xf72b('0x50')];_0x161822++){var _0x2d7bff=_0x51c384['conditions'][_0x161822];var _0x67594a='i';var _0x5e2f7e=_[_0xf72b('0x71')](_0x54d43a,[_0xf72b('0x3c'),_0x2d7bff[_0xf72b('0x5a')]]);if(!_0x5e2f7e){switch(_0x2d7bff[_0xf72b('0x5a')]){case _0xf72b('0x72'):if(_0x2d7bff[_0xf72b('0x73')]==0x1){_0x5007a2[_0xf72b('0x74')]('`'+_0x2d7bff[_0xf72b('0x5a')]+_0xf72b('0x75'));}else{_0x5007a2['having']('`'+_0x2d7bff['field']+_0xf72b('0x76'));}break;case _0xf72b('0x77'):if(_0x2d7bff['operator']===_0xf72b('0x78')){if(_0x2d7bff['value']['split']('\x20')[_0xf72b('0x50')]>0x1){_0x40e041[_0x26892f](_0xf72b('0x79'),qs[_0xf72b('0x7a')](_0x2d7bff['value']),null);}else{var _0x42e476='%'+_0x2d7bff[_0xf72b('0x73')]+'%';_0x40e041[_0x26892f](_0xf72b('0x7b'),_0x42e476,_0x42e476,_0x42e476);}}else{_0x5e2f7e=_['find'](_0x54d43a,[_0xf72b('0x3c'),_0xf72b('0x7c')]);_0x2d7bff[_0xf72b('0x5a')]=_0xf72b('0x7c');_0x24f885=as[_0xf72b('0x7d')](_0x67594a,_0x5e2f7e[_0xf72b('0x47')],_0x2d7bff);_0x40e041[_0x26892f](_0x24f885[_0xf72b('0x7e')],_0x24f885[_0xf72b('0x73')][_0xf72b('0x7f')],_0x24f885[_0xf72b('0x73')]['end']);}break;case _0xf72b('0x80'):var _0x58d1ee=_0x2d7bff['value'][_0xf72b('0x42')](',')[_0xf72b('0x3f')](function(_0x15b46a){return Number(_0x15b46a);});_0x58d1ee[_0xf72b('0x43')](function(_0x306f31){_0x156076['or'](_0xf72b('0x81'),'%,'+_0x306f31+',%');});_0x672ebe=_['union'](_0x672ebe,_0x58d1ee);break;case _0xf72b('0x82'):if(_0x2d7bff[_0xf72b('0x83')]===_0xf72b('0x78')){_0x40e041[_0x26892f]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x2d7bff[_0xf72b('0x73')]+'%',null);}else{_0x5e2f7e=_[_0xf72b('0x71')](_0x54d43a,[_0xf72b('0x3c'),_0xf72b('0x84')]);_0x2d7bff['field']=_0xf72b('0x84');_0x24f885=as['buildExpression'](_0x67594a,_0x5e2f7e['type'],_0x2d7bff);_0x40e041[_0x26892f](_0x24f885[_0xf72b('0x7e')],_0x24f885[_0xf72b('0x73')][_0xf72b('0x7f')],_0x24f885['value'][_0xf72b('0x34')]);}break;case _0xf72b('0x85'):_0x24f885=as['buildExpression']('me',null,_0x2d7bff);_0x40e041[_0x26892f](_0x24f885[_0xf72b('0x7e')],_0x24f885[_0xf72b('0x73')][_0xf72b('0x7f')],_0x24f885[_0xf72b('0x73')][_0xf72b('0x34')]);break;}}else{var _0x24f885=as[_0xf72b('0x7d')](_0x67594a,_0x5e2f7e[_0xf72b('0x47')],_0x2d7bff);_0x40e041[_0x26892f](_0x24f885[_0xf72b('0x7e')],_0x24f885[_0xf72b('0x73')][_0xf72b('0x7f')],_0x24f885[_0xf72b('0x73')]['end']);}}}else{var _0x4e8c2b=_(_0x16afc0['query'])['keys']()[_0xf72b('0x3f')](function(_0x238db6){return _[_0xf72b('0x86')](_0x54d43a,['name',_0x238db6])?_0x238db6:undefined;})[_0xf72b('0x87')]()[_0xf72b('0x73')]();if(!_[_0xf72b('0x88')](_0x4e8c2b)){_0x4e8c2b['forEach'](function(_0x5b1fa4){if(_0x5b1fa4===_0xf72b('0x89')){_0x5007a2[_0xf72b('0x57')](_0xf72b('0x8a'),[][_0xf72b('0x8b')](_0x16afc0['query'][_0x5b1fa4]));}else if(_0x5b1fa4==='createdAt'){var _0x51a7f4=JSON[_0xf72b('0x8c')](_0x16afc0['query'][_0x5b1fa4])['$gte'];var _0x4cbdf5=JSON[_0xf72b('0x8c')](_0x16afc0[_0xf72b('0x4a')][_0x5b1fa4])[_0xf72b('0x8d')];_0x5007a2[_0xf72b('0x57')](_0xf72b('0x8e'),_0x51a7f4,_0x4cbdf5);}else{if(_0x16afc0[_0xf72b('0x4a')][_0x5b1fa4]===_0xf72b('0x8f')){_0x5007a2['where']('i.'+_0x5b1fa4+_0xf72b('0x90'));}else{_0x5007a2[_0xf72b('0x57')]('i.'+_0x5b1fa4+_0xf72b('0x91'),_0x16afc0[_0xf72b('0x4a')][_0x5b1fa4]);}}});}if(_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x92')]){if(_0x16afc0['query'][_0xf72b('0x92')]==0x1){_0x5007a2[_0xf72b('0x74')]('`unreadMessages`\x20=\x200');}else{_0x5007a2[_0xf72b('0x74')](_0xf72b('0x93'));}}if(_0x16afc0['query'][_0xf72b('0x94')]){_0x672ebe=_['isArray'](_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x94')])?_0x16afc0['query'][_0xf72b('0x94')]:new Array(_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x94')]);_0x672ebe[_0xf72b('0x43')](function(_0x1753aa){_0x156076['or'](_0xf72b('0x81'),'%,'+_0x1753aa+',%');});}if(_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x95')]){var _0x4fe6aa=_0x16afc0[_0xf72b('0x4a')][_0xf72b('0x95')][_0xf72b('0x96')]('\x5c','\x5c\x5c')[_0xf72b('0x96')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x4fe6aa)){_0x40e041['or'](_0xf72b('0x97'),_0x4fe6aa+'%');}else{_0x40e041['or'](_0xf72b('0x98'),qs['getFullTextValue'](_0x4fe6aa))['or'](_0xf72b('0x99'),_0x4fe6aa+'%');}}}_0x5007a2['where'](_0x40e041);_0x5007a2['group'](_0xf72b('0x9a'));var _0x241a5a={'type':db[_0xf72b('0x24')][_0xf72b('0x9b')]['SELECT'],'raw':!![]};var _0x1a2c7a=_0x5007a2[_0xf72b('0x9c')]();_0x1a2c7a['field'](_0xf72b('0x9a'));_0x1a2c7a['field'](_0xf72b('0x9d'),_0xf72b('0x72'));if(_0xdf71e6[_0xf72b('0x55')]){_0xdf71e6[_0xf72b('0x55')][_0xf72b('0x43')](function(_0x2e9db8){_0x5007a2[_0xf72b('0x55')]('i.'+_0x2e9db8[0x0],_0x2e9db8[0x1]===_0xf72b('0x9e')?![]:!![]);});}if(!_[_0xf72b('0x88')](_0x672ebe)){_0x5007a2[_0xf72b('0x74')](_0x156076);_0x1a2c7a['where'](_0xf72b('0x9f'),_0x672ebe);}BPromise[_0xf72b('0xa0')]()['then'](function(){if(!_0x51c384&&_0x16afc0['query'][_0xf72b('0x89')])return;return _0x16afc0[_0xf72b('0xa1')]['getChatWebsites']({'attributes':['id'],'raw':!![]})['then'](function(_0x2d3c69){if(_[_0xf72b('0x88')](_0x2d3c69)){_0x1a2c7a[_0xf72b('0x57')]('i.ChatWebsiteId\x20IS\x20NULL');_0x5007a2[_0xf72b('0x57')](_0xf72b('0xa2'));}else{_0x1a2c7a[_0xf72b('0x57')](_0xf72b('0x8a'),_[_0xf72b('0x3f')](_0x2d3c69,'id'));_0x5007a2[_0xf72b('0x57')]('i.ChatWebsiteId\x20IN\x20?',_[_0xf72b('0x3f')](_0x2d3c69,'id'));}});})[_0xf72b('0x27')](function(){db['sequelize'][_0xf72b('0x4a')](_0x1a2c7a['toString'](),_0x241a5a)[_0xf72b('0x27')](function(_0x3c26c3){_0x4568d1[_0xf72b('0x36')]=_0x3c26c3[_0xf72b('0x50')];if(_0x4568d1['count']===0x0)return[];return db[_0xf72b('0xa3')]['query'](_0x44fa05[_0xf72b('0xa4')](),_0x241a5a)[_0xf72b('0x27')](function(_0xf477d4){_0xe9e8e1=_[_0xf72b('0xa5')](_0xf477d4,'id');_0x241a5a=_[_0xf72b('0xa6')](_0x241a5a,{'model':db[_0xf72b('0x45')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x5007a2[_0xf72b('0x5a')](_0xf72b('0x9d'),_0xf72b('0x72'));_0x5007a2[_0xf72b('0x5a')](_0xf72b('0xa7'),'Account.key');_0x5007a2[_0xf72b('0x5a')](_0xf72b('0xa8'),_0xf72b('0xa9'));_0x5007a2[_0xf72b('0x5a')]('i.*');_0x5007a2[_0xf72b('0x5a')](_0xf72b('0xaa'),_0xf72b('0xab'));_0x5007a2['field'](_0xf72b('0xac'),'Contact.lastName');_0x5007a2[_0xf72b('0x5a')](_0xf72b('0xad'),'Contact.email');_0x5007a2[_0xf72b('0x5a')](_0xf72b('0xae'),_0xf72b('0xaf'));_0x5007a2[_0xf72b('0x5a')](_0xf72b('0xb0'),'Contact.mobile');_0x5007a2[_0xf72b('0x5a')](_0xf72b('0xb1'),_0xf72b('0xb2'));_0x5007a2[_0xf72b('0x5a')](_0xf72b('0xb3'),_0xf72b('0x40'));_0x5007a2[_0xf72b('0x53')](_0xdf71e6['limit']);_0x5007a2[_0xf72b('0x54')](_0xdf71e6['offset']);return db['sequelize'][_0xf72b('0x4a')](_0x5007a2['toString'](),_0x241a5a);})[_0xf72b('0x27')](function(_0x5cf7ba){_0x4a20e4[_0xf72b('0x57')](_0xf72b('0xb4'),_[_0xf72b('0x3f')](_0x5cf7ba,'id'));return db['sequelize']['query'](_0x4a20e4[_0xf72b('0xa4')](),_0x241a5a)[_0xf72b('0x27')](function(_0x5d07c8){var _0x9f92e3=_['groupBy'](_0x5d07c8,'ChatInteractionId');var _0x1ced56=[];_0x5cf7ba[_0xf72b('0x43')](function(_0x1a0878){_0x1ced56['push'](updateChatInteraction(_0x1a0878,_0xe9e8e1,_0x9f92e3));});return BPromise[_0xf72b('0xb5')](_0x1ced56);});});})['then'](function(_0x4d665a){_0x4568d1['rows']=_0x4d665a;return _0x4568d1;})[_0xf72b('0x27')](respondWithFilteredResult(_0x13b5af,_0xdf71e6));})['catch'](handleError(_0x13b5af,null));};exports[_0xf72b('0xb6')]=function(_0x1b241e,_0x3217e0){var _0x54f4c5={'raw':![],'where':{'id':_0x1b241e['params']['id']}},_0x22d2f1={};_0x22d2f1[_0xf72b('0x49')]=_[_0xf72b('0x4b')](db[_0xf72b('0x45')][_0xf72b('0xb7')]);_0x22d2f1[_0xf72b('0x4a')]=_['keys'](_0x1b241e[_0xf72b('0x4a')]);_0x22d2f1[_0xf72b('0x4c')]=_[_0xf72b('0x4d')](_0x22d2f1['model'],_0x22d2f1[_0xf72b('0x4a')]);_0x54f4c5[_0xf72b('0x4f')]=_['intersection'](_0x22d2f1['model'],qs[_0xf72b('0x4e')](_0x1b241e[_0xf72b('0x4a')]['fields']));_0x54f4c5['attributes']=_0x54f4c5[_0xf72b('0x4f')][_0xf72b('0x50')]?_0x54f4c5[_0xf72b('0x4f')]:_0x22d2f1[_0xf72b('0x49')];if(_0x1b241e[_0xf72b('0x4a')][_0xf72b('0xb8')]){_0x54f4c5[_0xf72b('0xb9')]=[{'all':!![]}];}_0x54f4c5=_[_0xf72b('0xa6')]({},_0x54f4c5,_0x1b241e[_0xf72b('0xba')]);return db[_0xf72b('0x45')][_0xf72b('0x71')](_0x54f4c5)[_0xf72b('0x27')](handleEntityNotFound(_0x3217e0,null))[_0xf72b('0x27')](respondWithResult(_0x3217e0,null))[_0xf72b('0x31')](handleError(_0x3217e0,null));};exports['create']=function(_0x5c725d,_0x3d772c){return db['ChatInteraction'][_0xf72b('0xbb')](_0x5c725d[_0xf72b('0x85')],{})[_0xf72b('0x27')](respondWithResult(_0x3d772c,0xc9))['catch'](handleError(_0x3d772c,null));};exports[_0xf72b('0x3a')]=function(_0x48a909,_0x3bba75){if(_0x48a909[_0xf72b('0x85')]['id']){delete _0x48a909[_0xf72b('0x85')]['id'];}return db[_0xf72b('0x45')][_0xf72b('0x71')]({'where':{'id':_0x48a909[_0xf72b('0xbc')]['id']}})['then'](handleEntityNotFound(_0x3bba75,null))['then'](saveUpdates(_0x48a909[_0xf72b('0x85')],null))['then'](respondWithResult(_0x3bba75,null))[_0xf72b('0x31')](handleError(_0x3bba75,null));};exports[_0xf72b('0x3b')]=function(_0x366ee5,_0x9502e9){return db[_0xf72b('0x45')][_0xf72b('0x71')]({'where':{'id':_0x366ee5['params']['id']}})['then'](handleEntityNotFound(_0x9502e9,null))[_0xf72b('0x27')](removeEntity(_0x9502e9,null))[_0xf72b('0x31')](handleError(_0x9502e9,null));};exports[_0xf72b('0xbd')]=function(_0x147895,_0x3373a8){return db[_0xf72b('0x45')]['describe']()[_0xf72b('0x27')](respondWithResult(_0x3373a8,null))['catch'](handleError(_0x3373a8,null));};exports['customUpdate']=function(_0x3cf9a5,_0x595905){if(_0x3cf9a5[_0xf72b('0x85')]['id']){delete _0x3cf9a5[_0xf72b('0x85')]['id'];}return db[_0xf72b('0x45')][_0xf72b('0x71')]({'where':{'id':_0x3cf9a5[_0xf72b('0xbc')]['id']}})[_0xf72b('0x27')](handleEntityNotFound(_0x595905,null))[_0xf72b('0x27')](saveUpdates(_0x3cf9a5[_0xf72b('0x85')],null))[_0xf72b('0x27')](respondWithResult(_0x595905,null))[_0xf72b('0x31')](handleError(_0x595905,null));};exports[_0xf72b('0xbe')]=function(_0x3c22fc,_0xa84234,_0x2e1bc4){if(_0x3c22fc[_0xf72b('0x85')]['id']){delete _0x3c22fc[_0xf72b('0x85')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x3c22fc[_0xf72b('0xbc')]['id']}})[_0xf72b('0x27')](function(_0x3c66c0){if(!_0x3c66c0){logger['error'](_0xf72b('0xbf'),_0xf72b('0xbe'),0x194,_0xf72b('0xc0'));_0xa84234[_0xf72b('0x32')](0x194);}else{if(_0x3c66c0[_0xf72b('0x84')]){throw new db['Sequelize'][(_0xf72b('0xc1'))]('Interaction\x20already\x20assigned');}}return _0x3c66c0;})[_0xf72b('0x27')](function(_0x22d492){if(_0x22d492){return _0x22d492[_0xf72b('0x3a')]({'closed':_0x3c22fc[_0xf72b('0x85')]['closed'],'disposition':_0x3c22fc[_0xf72b('0x85')][_0xf72b('0xc2')]})['then'](function(_0x4d5dba){return _0x4d5dba;});}})[_0xf72b('0x27')](function(_0x1b912e){return respondWithRpcPromise(_0xf72b('0xc3'),'abandon',_0x3c22fc[_0xf72b('0x85')],client9004);})[_0xf72b('0x27')](respondWithResult(_0xa84234,null))[_0xf72b('0x31')](handleError(_0xa84234,null));};exports[_0xf72b('0xc4')]=function(_0xa5a089,_0x49747b,_0x5a9e7b){_0xa5a089['body']['name']=_0xa5a089[_0xf72b('0xc5')][_0xf72b('0xc6')];_0xa5a089[_0xf72b('0x85')]['basename']=_0xa5a089[_0xf72b('0xc5')][_0xf72b('0xc7')];_0xa5a089['body'][_0xf72b('0x47')]=_0xa5a089[_0xf72b('0xc5')]['mimetype'];return db[_0xf72b('0xc8')][_0xf72b('0xbb')](_0xa5a089[_0xf72b('0x85')])['then'](respondWithResult(_0x49747b,0xc9))['catch'](handleError(_0x49747b,null));};exports[_0xf72b('0xc9')]=function(_0x41b902,_0x488cfa,_0x4614bb){return db['ChatInteraction'][_0xf72b('0xca')]({'where':{'id':_0x41b902['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x488cfa,null))[_0xf72b('0x27')](function(_0x508b73){if(_0x508b73){if(_0x508b73[_0xf72b('0xcb')]){return _0x488cfa[_0xf72b('0x33')](0x193)[_0xf72b('0x35')]({'status':0x193,'message':'Unauthorized'});}return db[_0xf72b('0xc8')][_0xf72b('0xca')]({'where':{'id':_0x41b902[_0xf72b('0x4a')][_0xf72b('0xcc')]},'raw':!![]})[_0xf72b('0x27')](handleEntityNotFound(_0x488cfa,null));}})[_0xf72b('0x27')](function(_0x4cb640){if(_0x4cb640){return _0x488cfa['download'](path[_0xf72b('0xcd')](config[_0xf72b('0xce')],_0xf72b('0xcf'),_0x4cb640[_0xf72b('0xd0')]));}})[_0xf72b('0x31')](handleError(_0x488cfa,null));};exports[_0xf72b('0xd1')]=function(_0x51403c,_0x1828e8){var _0x21c258=null;var _0x4b3113=null;var _0x5458ed=null;var _0x22df9e=null;if(_0x51403c[_0xf72b('0x85')]['id']){delete _0x51403c['body']['id'];}if(_0x51403c[_0xf72b('0x85')]['mailTranscript']){_0x22df9e=path[_0xf72b('0xcd')](config['root'],'server/files/chat/upload/',util[_0xf72b('0xd2')]('transcript-%s.txt',Date[_0xf72b('0xd3')]()));_0x51403c[_0xf72b('0x85')][_0xf72b('0xd4')]=_0x22df9e;}return db[_0xf72b('0x45')][_0xf72b('0x71')]({'where':{'id':_0x51403c[_0xf72b('0xbc')]['id']},'include':[{'model':db[_0xf72b('0xd5')],'as':_0xf72b('0xd6'),'include':[{'model':db[_0xf72b('0x82')],'as':_0xf72b('0x82')}]}]})[_0xf72b('0x27')](handleEntityNotFound(_0x1828e8,null))[_0xf72b('0x27')](saveUpdates(_0x51403c[_0xf72b('0x85')],null))[_0xf72b('0x27')](function(_0x555801){if(_0x555801){_0x21c258=_0x555801;return db['ChatWebsite']['find']({'where':{'id':_0x21c258[_0xf72b('0x89')]}});}})['then'](function(_0x182dad){if(_0x182dad){_0x5458ed=_0x182dad;return db[_0xf72b('0xd7')][_0xf72b('0x71')]({'where':{'id':_0x21c258[_0xf72b('0x7c')]}});}})['then'](function(_0x314fee){if(_0x314fee){_0x4b3113=_0x314fee;if(_0x22df9e){var _0x3aa067=null;for(var _0xf6a348=0x1;_0xf6a348<_0x21c258[_0xf72b('0xd6')][_0xf72b('0x50')];++_0xf6a348){_0x3aa067=_0x21c258[_0xf72b('0xd6')][_0xf6a348];var _0x465497=_0x3aa067[_0xf72b('0x84')]?util[_0xf72b('0xd2')](_0xf72b('0xd8'),_0x5458ed[_0xf72b('0xd9')],_0x3aa067[_0xf72b('0x84')]):_0xf72b('0xda');var _0x5eeb4a=_0x51403c[_0xf72b('0x85')][_0xf72b('0xdb')]||util[_0xf72b('0xd2')](_0xf72b('0xd8'),_0xf72b('0xdc'),_0x3aa067['ContactId']);switch(_0x5458ed[_0xf72b('0xdd')]){case _0xf72b('0xde'):_0x465497=_0x3aa067[_0xf72b('0x84')]?util['format']('%s%d',_0x5458ed['agentAlias'],_0x3aa067['UserId']):_0xf72b('0xda');break;case _0xf72b('0xdf'):_0x465497=_0x3aa067['UserId']?_0x3aa067[_0xf72b('0x82')][_0xf72b('0xe0')]||_0x3aa067['User'][_0xf72b('0xe1')]:'System';break;case'agent_fullname':_0x465497=_0x3aa067['UserId']?_0x3aa067[_0xf72b('0x82')]['fullname']:_0xf72b('0xda');break;default:_0x465497=_0x3aa067[_0xf72b('0x84')]?util['format'](_0xf72b('0xd8'),_0x5458ed[_0xf72b('0xd9')],_0x3aa067[_0xf72b('0x84')]):'System';}var _0x1ef4ba=util['format']('[%s]\x20%s:\x20%s\x0a',moment(_0x3aa067[_0xf72b('0xe2')])['format'](_0xf72b('0xe3')),_0x3aa067[_0xf72b('0xe4')]==='in'?_0x5eeb4a:_0x465497,_0x3aa067[_0xf72b('0x85')]);if(!_0x3aa067[_0xf72b('0xe5')]){fs['appendFileSync'](_0x22df9e,_0x1ef4ba);}}return db[_0xf72b('0xe6')][_0xf72b('0xca')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xf72b('0xe7'),'raw':!![]}]});}}})[_0xf72b('0x27')](function(_0x3873de){if(_0x3873de&&_0x3873de[_0xf72b('0xe7')]&&_0x51403c['body']){var _0x2573d3={'tls':{'rejectUnauthorized':![]}};if(_0x3873de[_0xf72b('0xe7')][_0xf72b('0xe8')]){_0x2573d3['service']=_0x3873de['Smtp'][_0xf72b('0xe8')];}else{_0x2573d3['host']=_0x3873de[_0xf72b('0xe7')]['host'];_0x2573d3[_0xf72b('0xe9')]=_0x3873de['Smtp'][_0xf72b('0xe9')];_0x2573d3[_0xf72b('0xea')]=_0x3873de['Smtp'][_0xf72b('0xea')];}if(_0x3873de['Smtp'][_0xf72b('0xeb')]){_0x2573d3[_0xf72b('0xec')]={'user':_0x3873de[_0xf72b('0xe7')]['user'],'pass':_0x3873de[_0xf72b('0xe7')]['pass']};}return respondWithRpcPromise('SendMail',_0xf72b('0xed'),{'account':_0x2573d3,'message':{'from':util[_0xf72b('0xd2')](_0xf72b('0xee'),_0x3873de[_0xf72b('0x3c')],_0x3873de[_0xf72b('0xef')]||_0x3873de[_0xf72b('0xe7')][_0xf72b('0xa1')]),'to':_0x51403c[_0xf72b('0x85')]['mailTranscript'],'subject':'Mail\x20Transcript','text':util[_0xf72b('0xd2')](_0xf72b('0xf0'),_0x51403c[_0xf72b('0x85')]['mailTranscript']),'attachments':[{'path':_0x22df9e}]}})[_0xf72b('0x27')](function(){return _0x21c258;})['catch'](function(_0xa58f8b){console[_0xf72b('0x2e')](_0xa58f8b);});}else{return _0x21c258;}})['then'](respondWithStatusCode(_0x1828e8,0xc8))[_0xf72b('0x31')](handleError(_0x1828e8,null));};exports[_0xf72b('0xf1')]=function(_0x5b2cd5,_0x5ad3da,_0x231656){return db['ChatMessage'][_0xf72b('0x71')]({'where':{'id':_0x5b2cd5[_0xf72b('0xbc')]['id']}})[_0xf72b('0x27')](handleEntityNotFound(_0x5ad3da,null))[_0xf72b('0x27')](function(_0x49c2d9){if(_0x49c2d9){return _0x49c2d9[_0xf72b('0xf1')](_0x5b2cd5[_0xf72b('0x85')][_0xf72b('0xf2')],_[_0xf72b('0xf3')](_0x5b2cd5[_0xf72b('0x85')],[_0xf72b('0xf2'),'id'])||{});}})[_0xf72b('0x27')](respondWithResult(_0x5ad3da,null))[_0xf72b('0x31')](handleError(_0x5ad3da,null));};exports[_0xf72b('0xf4')]=function(_0x3f2e88,_0x4294c9,_0x3a2477){var _0x1bcc5a={'raw':![],'where':{}};var _0x646142={};var _0x3cd676={'count':0x0,'rows':[]};return db[_0xf72b('0x45')]['findOne']({'where':{'id':_0x3f2e88['params']['id']}})[_0xf72b('0x27')](handleEntityNotFound(_0x4294c9,null))[_0xf72b('0x27')](function(_0x5a074e){if(_0x5a074e){_0x646142['model']=_['keys'](db['ChatMessage'][_0xf72b('0xb7')]);_0x646142[_0xf72b('0x4a')]=_[_0xf72b('0x4b')](_0x3f2e88[_0xf72b('0x4a')]);_0x646142[_0xf72b('0x4c')]=_[_0xf72b('0x4d')](_0x646142[_0xf72b('0x49')],_0x646142[_0xf72b('0x4a')]);_0x1bcc5a[_0xf72b('0x4f')]=_['intersection'](_0x646142[_0xf72b('0x49')],qs[_0xf72b('0x4e')](_0x3f2e88['query'][_0xf72b('0x4e')]));_0x1bcc5a[_0xf72b('0x4f')]=_0x1bcc5a[_0xf72b('0x4f')][_0xf72b('0x50')]?_0x1bcc5a[_0xf72b('0x4f')]:_0x646142[_0xf72b('0x49')];if(!_0x3f2e88['query'][_0xf72b('0x51')](_0xf72b('0x52'))){_0x1bcc5a[_0xf72b('0x53')]=qs[_0xf72b('0x53')](_0x3f2e88[_0xf72b('0x4a')][_0xf72b('0x53')]);_0x1bcc5a[_0xf72b('0x54')]=qs[_0xf72b('0x54')](_0x3f2e88[_0xf72b('0x4a')][_0xf72b('0x54')]);}_0x1bcc5a[_0xf72b('0x55')]=qs['sort'](_0x3f2e88[_0xf72b('0x4a')]['sort']);_0x1bcc5a[_0xf72b('0x57')]=qs[_0xf72b('0x4c')](_[_0xf72b('0x58')](_0x3f2e88['query'],_0x646142['filters']));_0x1bcc5a['where']['ChatInteractionId']=_0x5a074e['id'];if(_0x3f2e88[_0xf72b('0x4a')][_0xf72b('0x95')]){_0x1bcc5a['where']=_[_0xf72b('0xa6')](_0x1bcc5a[_0xf72b('0x57')],{'$or':_[_0xf72b('0x3f')](_0x1bcc5a[_0xf72b('0x4f')],function(_0x3fadf8){var _0x4fde49={};_0x4fde49[_0x3fadf8]={'$like':'%'+_0x3f2e88[_0xf72b('0x4a')][_0xf72b('0x95')]+'%'};return _0x4fde49;})});}if(_0x3f2e88['query']['$gte']){var _0x272ab8=_0x3f2e88['query'][_0xf72b('0xf5')][_0xf72b('0x42')](',');var _0x52bd3d={};_0x52bd3d[_0x272ab8[0x0]]={'$gte':moment(_0x272ab8[0x1])[_0xf72b('0xd2')](_0xf72b('0xf6'))};_0x1bcc5a[_0xf72b('0x57')]=_[_0xf72b('0xa6')](_0x1bcc5a[_0xf72b('0x57')],_0x52bd3d);}_0x1bcc5a=_[_0xf72b('0xa6')]({},_0x1bcc5a,_0x3f2e88[_0xf72b('0xba')]);return db[_0xf72b('0xd5')][_0xf72b('0x36')]({'where':_0x1bcc5a[_0xf72b('0x57')]})['then'](function(_0x1253f3){_0x3cd676[_0xf72b('0x36')]=_0x1253f3;if(_0x3f2e88['query'][_0xf72b('0xb8')]){_0x1bcc5a[_0xf72b('0xb9')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x1bcc5a);})['then'](function(_0x1ae48e){_0x3cd676[_0xf72b('0xf7')]=_0x1ae48e;return _0x3cd676;});}})[_0xf72b('0x27')](respondWithFilteredResult(_0x4294c9,_0x1bcc5a))[_0xf72b('0x31')](handleError(_0x4294c9,null));};exports['getMyMessages']=function(_0x36a177,_0x446292,_0x38f705){var _0x411c75={'where':{}},_0x4ea69c={},_0x592193={'count':0x0,'rows':[]};return db[_0xf72b('0x45')][_0xf72b('0xca')]({'where':{'id':_0x36a177[_0xf72b('0xbc')]['id']}})[_0xf72b('0x27')](handleEntityNotFound(_0x446292,null))[_0xf72b('0x27')](function(_0x259839){if(_0x259839){_0x4ea69c[_0xf72b('0x49')]=_[_0xf72b('0x4b')](db[_0xf72b('0xd5')]['rawAttributes']);_0x4ea69c[_0xf72b('0x4a')]=_[_0xf72b('0x4b')](_0x36a177[_0xf72b('0x4a')]);_0x4ea69c[_0xf72b('0x4c')]=_['intersection'](_0x4ea69c['model'],_0x4ea69c[_0xf72b('0x4a')]);_0x411c75[_0xf72b('0x4f')]=_[_0xf72b('0x4d')](_0x4ea69c[_0xf72b('0x49')],qs['fields'](_0x36a177[_0xf72b('0x4a')][_0xf72b('0x4e')]));_0x411c75[_0xf72b('0x4f')]=_0x411c75[_0xf72b('0x4f')][_0xf72b('0x50')]?_0x411c75[_0xf72b('0x4f')]:_0x4ea69c['model'];if(!_0x36a177[_0xf72b('0x4a')]['hasOwnProperty'](_0xf72b('0x52'))){_0x411c75['limit']=qs[_0xf72b('0x53')](_0x36a177[_0xf72b('0x4a')]['limit']);_0x411c75['offset']=qs[_0xf72b('0x54')](_0x36a177['query'][_0xf72b('0x54')]);}_0x411c75['order']=qs[_0xf72b('0x56')](_0x36a177[_0xf72b('0x4a')][_0xf72b('0x56')]);_0x411c75[_0xf72b('0x57')]=qs['filters'](_[_0xf72b('0x58')](_0x36a177[_0xf72b('0x4a')],_0x4ea69c[_0xf72b('0x4c')]));_0x411c75[_0xf72b('0x57')][_0xf72b('0xf8')]=_0x259839['id'];if(_0x36a177['query'][_0xf72b('0x95')]){_0x411c75[_0xf72b('0x57')]=_['merge'](_0x411c75['where'],{'$or':_['map'](_0x411c75[_0xf72b('0x4f')],function(_0x4b0402){var _0x1978bb={};_0x1978bb[_0x4b0402]={'$like':'%'+_0x36a177[_0xf72b('0x4a')]['filter']+'%'};return _0x1978bb;})});}_0x411c75[_0xf72b('0x57')][_0xf72b('0xe5')]=![];if(_0x36a177[_0xf72b('0x4a')]['id']){_0x411c75['where']['id']={'$gt':_0x36a177[_0xf72b('0x4a')]['id']};}_0x411c75=_[_0xf72b('0xa6')]({},_0x411c75,_0x36a177['options']);return db['ChatMessage'][_0xf72b('0x36')]({'where':_0x411c75[_0xf72b('0x57')]})[_0xf72b('0x27')](function(_0x3d877c){_0x592193['count']=_0x3d877c;_0x411c75[_0xf72b('0xb9')]=[];if(_0x36a177[_0xf72b('0x4a')][_0xf72b('0xf9')]){_0x411c75['include']['push']({'model':db[_0xf72b('0x82')],'as':_0xf72b('0x82'),'attributes':['id','fullname','alias']});}if(_0x36a177[_0xf72b('0x4a')][_0xf72b('0xb8')]){_0x411c75[_0xf72b('0xb9')]=[{'all':!![]}];}return db[_0xf72b('0xd5')][_0xf72b('0xfa')](_0x411c75);})[_0xf72b('0x27')](function(_0x362d31){_0x592193['rows']=_0x362d31;return _0x592193;});}})[_0xf72b('0x27')](respondWithFilteredResult(_0x446292,_0x411c75))[_0xf72b('0x31')](handleError(_0x446292,null));};exports[_0xf72b('0xfb')]=function(_0x3ef93c,_0x502153,_0x80e658){return db[_0xf72b('0x45')][_0xf72b('0x71')]({'where':{'id':_0x3ef93c[_0xf72b('0xbc')]['id']}})[_0xf72b('0x27')](handleEntityNotFound(_0x502153,null))['then'](function(_0x45dcab){if(_0x45dcab){return _0x45dcab[_0xf72b('0xfc')](_0x3ef93c[_0xf72b('0x85')]['ids'],_[_0xf72b('0xf3')](_0x3ef93c['body'],[_0xf72b('0xf2'),'id'])||{})[_0xf72b('0xfd')](function(){return db[_0xf72b('0x80')][_0xf72b('0xfa')]({'attributes':['id',_0xf72b('0x3c'),_0xf72b('0x5b')],'where':{'id':_0x3ef93c[_0xf72b('0x85')][_0xf72b('0xf2')]}});})[_0xf72b('0x27')](function(_0x396820){socket[_0xf72b('0xfe')](_0xf72b('0xff'),{'id':Number(_0x3ef93c[_0xf72b('0xbc')]['id']),'tags':_0x396820||[]});return{'id':Number(_0x3ef93c[_0xf72b('0xbc')]['id']),'tags':_0x396820||[]};});}})[_0xf72b('0x27')](respondWithResult(_0x502153,null))[_0xf72b('0x31')](handleError(_0x502153,null));};exports[_0xf72b('0x100')]=function(_0x41a994,_0x483f88,_0x2d0b3b){return db['ChatInteraction']['find']({'where':{'id':_0x41a994[_0xf72b('0xbc')]['id']}})['then'](handleEntityNotFound(_0x483f88,null))[_0xf72b('0x27')](function(_0xa014a1){if(_0xa014a1){return _0xa014a1[_0xf72b('0x100')](_0x41a994[_0xf72b('0x4a')][_0xf72b('0xf2')]);}})['then'](respondWithStatusCode(_0x483f88,null))[_0xf72b('0x31')](handleError(_0x483f88,null));};exports[_0xf72b('0x101')]=function(_0x4a08a4,_0x25d504){var _0x38eba8=moment()[_0xf72b('0x102')]()[_0xf72b('0xa4')]();var _0x45c861=path[_0xf72b('0xcd')](config[_0xf72b('0xce')],_0xf72b('0x103'),_0xf72b('0x104'),'tmp');var _0x2c2c95=path[_0xf72b('0xcd')](config[_0xf72b('0xce')],'server','files',_0xf72b('0x105'));var _0x2abcd6=path[_0xf72b('0xcd')](_0x45c861,_0x38eba8);var _0x5f2267=util[_0xf72b('0xd2')](_0xf72b('0x106'),_0x4a08a4['params']['id'],_0x38eba8);var _0x1f9c77=path[_0xf72b('0xcd')](_0x45c861,_0x5f2267);var _0x4a0a38=![];return db[_0xf72b('0x45')][_0xf72b('0x71')]({'where':{'id':_0x4a08a4['params']['id']},'include':[{'model':db[_0xf72b('0xd5')],'as':'Messages','attributes':['id',_0xf72b('0x85'),'createdAt','direction','secret',_0xf72b('0x92')],'include':[{'model':db[_0xf72b('0x82')],'as':_0xf72b('0x82'),'attributes':['id',_0xf72b('0xe1')],'raw':!![]},{'model':db[_0xf72b('0xd7')],'as':_0xf72b('0x77'),'attributes':['id',_0xf72b('0x107'),_0xf72b('0x108')],'raw':!![]},{'model':db['Attachment'],'as':'Attachment','raw':!![]}]},{'model':db[_0xf72b('0x109')],'as':_0xf72b('0x10a'),'attributes':['id','name']},{'model':db[_0xf72b('0x82')],'as':_0xf72b('0x10b'),'attributes':['id','fullname']}]})[_0xf72b('0x27')](handleEntityNotFound(_0x25d504,null))[_0xf72b('0x27')](function(_0x44a524){if(_0x44a524){var _0x4504fb=_0x44a524[_0xf72b('0x10c')]({'plain':!![]});_0x4a0a38=!![];var _0x1f7da7={'format':'A4','border':_0xf72b('0x10d'),'header':{'height':'40px','contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0xf72b('0x10e'),'contents':{'default':util[_0xf72b('0xd2')](_0xf72b('0x10f'),util['format']('%s\x20#%d',_0xf72b('0x110'),_0x4504fb['id']),moment()['format'](_0xf72b('0x111'))['toString']())}}};fs[_0xf72b('0x112')](_0x2abcd6);var _0xacda25={'channel':'Chat','account':_0x4504fb['Account'][_0xf72b('0x3c')],'agent':_0x4504fb[_0xf72b('0x10b')]?_0x4504fb[_0xf72b('0x10b')][_0xf72b('0xe1')]:'N.A.','createdAt':moment(_0x4504fb['createdAt'])[_0xf72b('0xd2')](_0xf72b('0xf6'))[_0xf72b('0xa4')](),'closedAt':_0x4504fb['closed']?moment(_0x4504fb['closedAt'])[_0xf72b('0xd2')](_0xf72b('0xf6'))[_0xf72b('0xa4')]():'','disposition':_0x4504fb['disposition'],'chatInfo':{'browser':_0x4504fb['browserName'],'os':_0x4504fb['osName'],'referer':_0x4504fb['referer'],'customerIp':_0x4504fb[_0xf72b('0x113')],'customerPort':_0x4504fb[_0xf72b('0x114')]?_0x4504fb['customerPort']:'N.A.'},'messages':_(_0x4504fb[_0xf72b('0xd6')])['tail']()[_0xf72b('0x95')]({'secret':![]})['map'](function(_0x555995){if(_0x555995[_0xf72b('0xc8')]){var _0x5c2dcb=path[_0xf72b('0xcd')](_0x2c2c95,_0x555995[_0xf72b('0xc8')][_0xf72b('0xd0')]);if(fs[_0xf72b('0x115')](_0x5c2dcb)){fs['createReadStream'](_0x5c2dcb)[_0xf72b('0x116')](fs[_0xf72b('0x117')](path[_0xf72b('0xcd')](_0x2abcd6,_0x555995[_0xf72b('0xc8')][_0xf72b('0xd0')])));}}return{'date':moment(_0x555995[_0xf72b('0xe2')])[_0xf72b('0xd2')](_0xf72b('0xf6'))[_0xf72b('0xa4')](),'sender':_0x555995['direction']===_0xf72b('0x118')?_0x555995[_0xf72b('0x82')]?_0x555995[_0xf72b('0x82')][_0xf72b('0xe1')]:'System':_0x555995[_0xf72b('0x77')][_0xf72b('0x107')]+(_0x555995[_0xf72b('0x77')][_0xf72b('0x108')]?'\x20'+_0x555995[_0xf72b('0x77')][_0xf72b('0x108')]:''),'body':_0x555995[_0xf72b('0xc8')]?_0x555995['Attachment']['basename']:_0x555995[_0xf72b('0x85')],'direction':_0x555995[_0xf72b('0xe4')]==='out'?'A':'C','secret':_0x555995['secret'],'read':_0x555995['read'],'attachment':_0x555995[_0xf72b('0xc8')]};})[_0xf72b('0x73')]()};return ejs['renderFile'](path['join'](config[_0xf72b('0xce')],_0xf72b('0x103'),_0xf72b('0x119'),_0xf72b('0x11a')),{'interaction':_0xacda25})[_0xf72b('0x27')](function(_0x57f432){return new BPromise(function(_0xb13460,_0xb15224){pdf[_0xf72b('0xbb')](_0x57f432,_0x1f7da7)[_0xf72b('0x11b')](path['join'](_0x2abcd6,_0xf72b('0x11c')+_0x4504fb['id']+'-'+_0x38eba8+_0xf72b('0x11d')),function(_0x118665,_0x4d2991){if(_0x118665)return _0xb15224(_0x118665);_0xb13460(_0x4d2991);});});});}})['then'](function(){if(_0x4a0a38){return new BPromise(function(_0x535a55,_0x3bed4f){zipdir(_0x2abcd6,{'saveTo':_0x1f9c77},function(_0xd47821,_0x3a3373){if(_0xd47821)return _0x3bed4f(_0xd47821);return _0x535a55(_0x3a3373);});})[_0xf72b('0x27')](function(){return new BPromise(function(_0x2c4230,_0x500ff9){rimraf(_0x2abcd6,function(_0x302ae2){if(_0x302ae2)_0x500ff9(_0x302ae2);return _0x2c4230();});});})['then'](function(){return _0x25d504[_0xf72b('0x101')](_0x1f9c77,_0x5f2267,function(_0x2e9f85){if(_0x2e9f85){console[_0xf72b('0x11e')](_0xf72b('0x11f'),_0x2e9f85);}else{fs[_0xf72b('0x120')](_0x1f9c77);}});});}else{return _0x25d504[_0xf72b('0x32')](0xc8);}})[_0xf72b('0x31')](handleError(_0x25d504,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index a78f934..95c2aa6 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 _0x9004=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','getUsers','then'];(function(_0x4ebf72,_0x19a809){var _0x24e700=function(_0x3fe82e){while(--_0x3fe82e){_0x4ebf72['push'](_0x4ebf72['shift']());}};_0x24e700(++_0x19a809);}(_0x9004,0x6a));var _0x4900=function(_0x37697f,_0x79920a){_0x37697f=_0x37697f-0x0;var _0x8d4dac=_0x9004[_0x37697f];return _0x8d4dac;};'use strict';var EventEmitter=require(_0x4900('0x0'));var ChatInteraction=require(_0x4900('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0x4900('0x1'))['db'][_0x4900('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x4900('0x3')](0x0);var events={'afterCreate':_0x4900('0x4'),'afterUpdate':_0x4900('0x5'),'afterDestroy':'remove'};function emitEvent(_0x249482){return function(_0x1dcea7,_0x4e431d,_0x26a93f){_0x1dcea7[_0x4900('0x6')]({'attributes':['id'],'raw':!![]})[_0x4900('0x7')](function(_0x4a9452){_0x1dcea7[_0x4900('0x8')](_0x4900('0x9'),_0x4a9452[_0x4900('0xa')](function(_0xccb96f){return{'id':_0xccb96f['id']};}));return ChatMessage[_0x4900('0xb')]({'where':{'ChatInteractionId':_0x1dcea7['id'],'direction':'in','read':![]},'raw':!![]});})[_0x4900('0x7')](function(_0x34a830){_0x1dcea7[_0x4900('0x8')](_0x4900('0xc'),_0x34a830[_0x4900('0xd')]);ChatInteractionEvents[_0x4900('0xe')](_0x249482+':'+_0x1dcea7['id'],_0x1dcea7);ChatInteractionEvents[_0x4900('0xe')](_0x249482,_0x1dcea7);_0x26a93f(null);})[_0x4900('0xf')](_0x26a93f(null));};}for(var e in events){if(events[_0x4900('0x10')](e)){var event=events[e];ChatInteraction[_0x4900('0x11')](e,emitEvent(event));}}module[_0x4900('0x12')]=ChatInteractionEvents; \ No newline at end of file +var _0xbb36=['save','remove','getUsers','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners'];(function(_0x35181c,_0x82694a){var _0xe14bf9=function(_0x2be9b7){while(--_0x2be9b7){_0x35181c['push'](_0x35181c['shift']());}};_0xe14bf9(++_0x82694a);}(_0xbb36,0x105));var _0x6bb3=function(_0x16089e,_0x3be1e6){_0x16089e=_0x16089e-0x0;var _0x1f209f=_0xbb36[_0x16089e];return _0x1f209f;};'use strict';var EventEmitter=require(_0x6bb3('0x0'));var ChatInteraction=require(_0x6bb3('0x1'))['db'][_0x6bb3('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0x6bb3('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x6bb3('0x4')](0x0);var events={'afterCreate':_0x6bb3('0x5'),'afterUpdate':'update','afterDestroy':_0x6bb3('0x6')};function emitEvent(_0x1b753d){return function(_0x10da1e,_0xb01805,_0x30674a){_0x10da1e[_0x6bb3('0x7')]({'attributes':['id'],'raw':!![]})[_0x6bb3('0x8')](function(_0x253166){_0x10da1e[_0x6bb3('0x9')]('Users',_0x253166[_0x6bb3('0xa')](function(_0x279e8f){return{'id':_0x279e8f['id']};}));return ChatMessage[_0x6bb3('0xb')]({'where':{'ChatInteractionId':_0x10da1e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x6bb3('0x8')](function(_0x577747){_0x10da1e[_0x6bb3('0x9')](_0x6bb3('0xc'),_0x577747[_0x6bb3('0xd')]);ChatInteractionEvents[_0x6bb3('0xe')](_0x1b753d+':'+_0x10da1e['id'],_0x10da1e);ChatInteractionEvents[_0x6bb3('0xe')](_0x1b753d,_0x10da1e);_0x30674a(null);})[_0x6bb3('0xf')](_0x30674a(null));};}for(var e in events){if(events[_0x6bb3('0x10')](e)){var event=events[e];ChatInteraction[_0x6bb3('0x11')](e,emitEvent(event));}}module[_0x6bb3('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 5887e6c..efd6cec 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 _0x6638=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','chat_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','lodash','util','api'];(function(_0x3d2e4b,_0x1f6653){var _0x509e78=function(_0x307037){while(--_0x307037){_0x3d2e4b['push'](_0x3d2e4b['shift']());}};_0x509e78(++_0x1f6653);}(_0x6638,0xa7));var _0x8663=function(_0x8610b7,_0x1afb52){_0x8610b7=_0x8610b7-0x0;var _0x3c5b34=_0x6638[_0x8610b7];return _0x3c5b34;};'use strict';var _=require(_0x8663('0x0'));var util=require(_0x8663('0x1'));var logger=require('../../config/logger')(_0x8663('0x2'));var moment=require('moment');var BPromise=require(_0x8663('0x3'));var rp=require(_0x8663('0x4'));var fs=require('fs');var path=require(_0x8663('0x5'));var rimraf=require(_0x8663('0x6'));var config=require(_0x8663('0x7'));var attributes=require(_0x8663('0x8'));module[_0x8663('0x9')]=function(_0x169ab2,_0x50e255){return _0x169ab2[_0x8663('0xa')]('ChatInteraction',attributes,{'tableName':_0x8663('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x400de6,_0x511add,_0x2e1b34){if(_0x400de6['changed'](_0x8663('0xc'))){_0x400de6[_0x8663('0xd')]=moment()[_0x8663('0xe')](_0x8663('0xf'));}_0x2e1b34(null,_0x400de6);}},'charset':_0x8663('0x10'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x40d9=['../../config/environment','exports','ChatInteraction','chat_interactions','changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path'];(function(_0x1d4f65,_0x55551c){var _0xbbd32c=function(_0x5cda4c){while(--_0x5cda4c){_0x1d4f65['push'](_0x1d4f65['shift']());}};_0xbbd32c(++_0x55551c);}(_0x40d9,0xb4));var _0x940d=function(_0x5f1cec,_0x3c542b){_0x5f1cec=_0x5f1cec-0x0;var _0x59d2d5=_0x40d9[_0x5f1cec];return _0x59d2d5;};'use strict';var _=require(_0x940d('0x0'));var util=require(_0x940d('0x1'));var logger=require(_0x940d('0x2'))(_0x940d('0x3'));var moment=require(_0x940d('0x4'));var BPromise=require(_0x940d('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x940d('0x6'));var rimraf=require('rimraf');var config=require(_0x940d('0x7'));var attributes=require('./chatInteraction.attributes');module[_0x940d('0x8')]=function(_0x3e4c1a,_0x11f253){return _0x3e4c1a['define'](_0x940d('0x9'),attributes,{'tableName':_0x940d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xe84c5b,_0xe5e37,_0x491ade){if(_0xe84c5b[_0x940d('0xb')](_0x940d('0xc'))){_0xe84c5b['closedAt']=moment()[_0x940d('0xd')](_0x940d('0xe'));}_0x491ade(null,_0xe84c5b);}},'charset':_0x940d('0xf'),'collate':_0x940d('0x10')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c80ed23..ce8c20d 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 _0xc571=['find','addTags','ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','info','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatInteraction,\x20%s,\x20%s','UpdateChatInteraction','ChatInteraction','update','body','options','raw','where','limit','then','AddTagsToChatInteraction'];(function(_0x4d847a,_0xe76dd0){var _0x2eff69=function(_0x42056f){while(--_0x42056f){_0x4d847a['push'](_0x4d847a['shift']());}};_0x2eff69(++_0xe76dd0);}(_0xc571,0xb2));var _0x1c57=function(_0x1c0f3d,_0x55a9e2){_0x1c0f3d=_0x1c0f3d-0x0;var _0x4d71a8=_0xc571[_0x1c0f3d];return _0x4d71a8;};'use strict';var _=require(_0x1c57('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1c57('0x1'));var rs=require(_0x1c57('0x2'));var fs=require('fs');var Redis=require(_0x1c57('0x3'));var db=require(_0x1c57('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c57('0x5'))('rpc');var config=require(_0x1c57('0x6'));var jayson=require(_0x1c57('0x7'));var client=jayson[_0x1c57('0x8')][_0x1c57('0x9')]({'port':0x232a});config[_0x1c57('0xa')]=_['defaults'](config[_0x1c57('0xa')],{'host':_0x1c57('0xb'),'port':0x18eb});var socket=require(_0x1c57('0xc'))(new Redis(config[_0x1c57('0xa')]));require(_0x1c57('0xd'))[_0x1c57('0xe')](socket);function respondWithRpcPromise(_0x50e56a,_0x459750,_0xdd69cc){return new BPromise(function(_0x245716,_0x2aa6db){return client[_0x1c57('0xf')](_0x50e56a,_0xdd69cc)['then'](function(_0xfb7eb){logger[_0x1c57('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x459750,_0x1c57('0x11'));logger[_0x1c57('0x12')](_0x1c57('0x13'),_0x459750,_0x1c57('0x11'),JSON[_0x1c57('0x14')](_0xfb7eb));if(_0xfb7eb['error']){if(_0xfb7eb[_0x1c57('0x15')][_0x1c57('0x16')]===0x1f4){logger[_0x1c57('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x459750,_0xfb7eb[_0x1c57('0x15')]['message']);return _0x2aa6db(_0xfb7eb[_0x1c57('0x15')][_0x1c57('0x17')]);}logger[_0x1c57('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x459750,_0xfb7eb[_0x1c57('0x15')][_0x1c57('0x17')]);return _0x245716(_0xfb7eb['error'][_0x1c57('0x17')]);}else{logger[_0x1c57('0x10')]('ChatInteraction,\x20%s,\x20%s',_0x459750,_0x1c57('0x11'));_0x245716(_0xfb7eb[_0x1c57('0x18')][_0x1c57('0x17')]);}})[_0x1c57('0x19')](function(_0x14d2a8){logger[_0x1c57('0x15')](_0x1c57('0x1a'),_0x459750,_0x14d2a8);_0x2aa6db(_0x14d2a8);});});}exports[_0x1c57('0x1b')]=function(_0x1a52ae){var _0x2c4a5b=this;return new Promise(function(_0x1d3347,_0x4158e0){return db[_0x1c57('0x1c')][_0x1c57('0x1d')](_0x1a52ae[_0x1c57('0x1e')],{'raw':_0x1a52ae[_0x1c57('0x1f')]?_0x1a52ae['options'][_0x1c57('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1a52ae[_0x1c57('0x1f')]?_0x1a52ae[_0x1c57('0x1f')][_0x1c57('0x21')]||null:null,'attributes':_0x1a52ae[_0x1c57('0x1f')]?_0x1a52ae[_0x1c57('0x1f')]['attributes']||null:null,'limit':_0x1a52ae['options']?_0x1a52ae[_0x1c57('0x1f')][_0x1c57('0x22')]||null:null})[_0x1c57('0x23')](function(_0x418445){logger['info'](_0x1c57('0x1b'),_0x1a52ae);logger[_0x1c57('0x12')](_0x1c57('0x1b'),_0x1a52ae,JSON[_0x1c57('0x14')](_0x418445));_0x1d3347(_0x418445);})['catch'](function(_0x3e7433){logger[_0x1c57('0x15')](_0x1c57('0x1b'),_0x3e7433[_0x1c57('0x17')],_0x1a52ae);_0x4158e0(_0x2c4a5b[_0x1c57('0x15')](0x1f4,_0x3e7433['message']));});});};exports[_0x1c57('0x24')]=function(_0x5e0441){return new Promise(function(_0x154880,_0x3eb3d4){return db[_0x1c57('0x1c')][_0x1c57('0x25')]({'where':_0x5e0441[_0x1c57('0x1f')]?_0x5e0441['options'][_0x1c57('0x21')]||null:null})[_0x1c57('0x23')](function(_0x189c16){if(_0x189c16){return _0x189c16[_0x1c57('0x26')](_0x5e0441[_0x1c57('0x1e')][_0x1c57('0x27')],_[_0x1c57('0x28')](_0x5e0441[_0x1c57('0x1e')],[_0x1c57('0x27'),'id'])||{});}})[_0x1c57('0x29')](function(_0x3692e7){logger[_0x1c57('0x10')](_0x1c57('0x2a'),_0x5e0441);logger[_0x1c57('0x12')](_0x1c57('0x2a'),_0x5e0441,JSON[_0x1c57('0x14')](_0x3692e7));_0x154880(_0x3692e7);})['catch'](function(_0x1b294d){logger[_0x1c57('0x15')](_0x1c57('0x2a'),_0x1b294d[_0x1c57('0x17')],_0x5e0441);_0x3eb3d4(_this['error'](0x1f4,_0x1b294d[_0x1c57('0x17')]));});});}; \ No newline at end of file +var _0x6391=['catch','UpdateChatInteraction','body','options','raw','attributes','limit','AddTagsToChatInteraction','find','where','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x6391,0x143));var _0x1639=function(_0x2f3848,_0x48564d){_0x2f3848=_0x2f3848-0x0;var _0x102668=_0x6391[_0x2f3848];return _0x102668;};'use strict';var _=require(_0x1639('0x0'));var util=require('util');var moment=require(_0x1639('0x1'));var BPromise=require(_0x1639('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1639('0x3'));var db=require(_0x1639('0x4'))['db'];var utils=require(_0x1639('0x5'));var logger=require(_0x1639('0x6'))(_0x1639('0x7'));var config=require(_0x1639('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x1639('0x9')][_0x1639('0xa')]({'port':0x232a});config[_0x1639('0xb')]=_[_0x1639('0xc')](config[_0x1639('0xb')],{'host':_0x1639('0xd'),'port':0x18eb});var socket=require(_0x1639('0xe'))(new Redis(config[_0x1639('0xb')]));require(_0x1639('0xf'))[_0x1639('0x10')](socket);function respondWithRpcPromise(_0x2042cb,_0x5f4853,_0x569370){return new BPromise(function(_0x3f9459,_0x254463){return client[_0x1639('0x11')](_0x2042cb,_0x569370)[_0x1639('0x12')](function(_0x2e1cba){logger[_0x1639('0x13')](_0x1639('0x14'),_0x5f4853,'request\x20sent');logger[_0x1639('0x15')](_0x1639('0x16'),_0x5f4853,_0x1639('0x17'),JSON[_0x1639('0x18')](_0x2e1cba));if(_0x2e1cba['error']){if(_0x2e1cba['error'][_0x1639('0x19')]===0x1f4){logger[_0x1639('0x1a')](_0x1639('0x14'),_0x5f4853,_0x2e1cba[_0x1639('0x1a')][_0x1639('0x1b')]);return _0x254463(_0x2e1cba[_0x1639('0x1a')][_0x1639('0x1b')]);}logger[_0x1639('0x1a')]('ChatInteraction,\x20%s,\x20%s',_0x5f4853,_0x2e1cba[_0x1639('0x1a')][_0x1639('0x1b')]);return _0x3f9459(_0x2e1cba[_0x1639('0x1a')][_0x1639('0x1b')]);}else{logger[_0x1639('0x13')](_0x1639('0x14'),_0x5f4853,_0x1639('0x17'));_0x3f9459(_0x2e1cba[_0x1639('0x1c')][_0x1639('0x1b')]);}})[_0x1639('0x1d')](function(_0x426748){logger[_0x1639('0x1a')](_0x1639('0x14'),_0x5f4853,_0x426748);_0x254463(_0x426748);});});}exports[_0x1639('0x1e')]=function(_0x2e483c){var _0x34a3c1=this;return new Promise(function(_0x56d30c,_0x9b7cc4){return db['ChatInteraction']['update'](_0x2e483c[_0x1639('0x1f')],{'raw':_0x2e483c[_0x1639('0x20')]?_0x2e483c[_0x1639('0x20')][_0x1639('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2e483c[_0x1639('0x20')]?_0x2e483c[_0x1639('0x20')]['where']||null:null,'attributes':_0x2e483c['options']?_0x2e483c['options'][_0x1639('0x22')]||null:null,'limit':_0x2e483c[_0x1639('0x20')]?_0x2e483c[_0x1639('0x20')][_0x1639('0x23')]||null:null})[_0x1639('0x12')](function(_0x1e3045){logger[_0x1639('0x13')](_0x1639('0x1e'),_0x2e483c);logger[_0x1639('0x15')](_0x1639('0x1e'),_0x2e483c,JSON[_0x1639('0x18')](_0x1e3045));_0x56d30c(_0x1e3045);})[_0x1639('0x1d')](function(_0xd29c57){logger[_0x1639('0x1a')](_0x1639('0x1e'),_0xd29c57['message'],_0x2e483c);_0x9b7cc4(_0x34a3c1[_0x1639('0x1a')](0x1f4,_0xd29c57[_0x1639('0x1b')]));});});};exports[_0x1639('0x24')]=function(_0x38e38d){return new Promise(function(_0x3612b1,_0x883b06){return db['ChatInteraction'][_0x1639('0x25')]({'where':_0x38e38d[_0x1639('0x20')]?_0x38e38d[_0x1639('0x20')][_0x1639('0x26')]||null:null})['then'](function(_0x552fa0){if(_0x552fa0){return _0x552fa0[_0x1639('0x27')](_0x38e38d[_0x1639('0x1f')][_0x1639('0x28')],_[_0x1639('0x29')](_0x38e38d[_0x1639('0x1f')],['ids','id'])||{});}})[_0x1639('0x2a')](function(_0x18774b){logger[_0x1639('0x13')](_0x1639('0x2b'),_0x38e38d);logger[_0x1639('0x15')]('AddTags',_0x38e38d,JSON[_0x1639('0x18')](_0x18774b));_0x3612b1(_0x18774b);})[_0x1639('0x1d')](function(_0x559d62){logger[_0x1639('0x1a')]('AddTags',_0x559d62['message'],_0x38e38d);_0x883b06(_this['error'](0x1f4,_0x559d62[_0x1639('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8c08f82..8172637 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 _0x5f5f=['update','emit','removeListener','register','./chatInteraction.events','remove'];(function(_0x433b07,_0x27d9ce){var _0x39e7c3=function(_0x9c4b8b){while(--_0x9c4b8b){_0x433b07['push'](_0x433b07['shift']());}};_0x39e7c3(++_0x27d9ce);}(_0x5f5f,0x178));var _0xf5f5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5f5f[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require(_0xf5f5('0x0'));var events=['save',_0xf5f5('0x1'),_0xf5f5('0x2')];function createListener(_0x474a10,_0x5821d2){return function(_0x1f30f6){_0x5821d2[_0xf5f5('0x3')](_0x474a10,_0x1f30f6);};}function removeListener(_0x201c08,_0x2461ee){return function(){ChatInteractionEvents[_0xf5f5('0x4')](_0x201c08,_0x2461ee);};}exports[_0xf5f5('0x5')]=function(_0x28fc98){for(var _0xb6003b=0x0,_0x13d07b=events['length'];_0xb6003b<_0x13d07b;_0xb6003b++){var _0x55f24b=events[_0xb6003b];var _0x18cff6=createListener('chatInteraction:'+_0x55f24b,_0x28fc98);ChatInteractionEvents['on'](_0x55f24b,_0x18cff6);}}; \ No newline at end of file +var _0x8423=['register','length','chatInteraction:','./chatInteraction.events','save','update','emit'];(function(_0x1372b6,_0x117fe9){var _0x32e786=function(_0x51ec1a){while(--_0x51ec1a){_0x1372b6['push'](_0x1372b6['shift']());}};_0x32e786(++_0x117fe9);}(_0x8423,0x9d));var _0x3842=function(_0x284a7c,_0x391585){_0x284a7c=_0x284a7c-0x0;var _0xc8308c=_0x8423[_0x284a7c];return _0xc8308c;};'use strict';var ChatInteractionEvents=require(_0x3842('0x0'));var events=[_0x3842('0x1'),'remove',_0x3842('0x2')];function createListener(_0x105a98,_0x109838){return function(_0x3bdfab){_0x109838[_0x3842('0x3')](_0x105a98,_0x3bdfab);};}function removeListener(_0x32f6e9,_0x1f4733){return function(){ChatInteractionEvents['removeListener'](_0x32f6e9,_0x1f4733);};}exports[_0x3842('0x4')]=function(_0x181f0c){for(var _0x2bf90f=0x0,_0x33f61e=events[_0x3842('0x5')];_0x2bf90f<_0x33f61e;_0x2bf90f++){var _0x5e9841=events[_0x2bf90f];var _0x2bfb3f=createListener(_0x3842('0x6')+_0x5e9841,_0x181f0c);ChatInteractionEvents['on'](_0x5e9841,_0x2bfb3f);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 67d7aab..f99dc12 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 _0x6d15=['/describe','isAuthenticated','describe','/:id','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','getMessages','/:id/my_messages','/:id/download','download','diskStorage','join','root','server/files/attachments/','%s-%s','now','originalname','replace','post','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','tracked','chat','put','/:id/custom_update','customUpdate','/:id/abandon','/:id/close','close','delete','removeTags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./chatInteraction.controller','get'];(function(_0x45d1fd,_0x463212){var _0xd0e542=function(_0x23ebc9){while(--_0x23ebc9){_0x45d1fd['push'](_0x45d1fd['shift']());}};_0xd0e542(++_0x463212);}(_0x6d15,0xb4));var _0x56d1=function(_0x4ce01b,_0xda4d3d){_0x4ce01b=_0x4ce01b-0x0;var _0x454e9b=_0x6d15[_0x4ce01b];return _0x454e9b;};'use strict';var multer=require(_0x56d1('0x0'));var util=require(_0x56d1('0x1'));var path=require('path');var timeout=require(_0x56d1('0x2'));var express=require(_0x56d1('0x3'));var router=express['Router']();var auth=require(_0x56d1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x56d1('0x5'));var controller=require(_0x56d1('0x6'));router[_0x56d1('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x56d1('0x7')](_0x56d1('0x8'),auth[_0x56d1('0x9')](),controller[_0x56d1('0xa')]);router[_0x56d1('0x7')](_0x56d1('0xb'),auth['isChatInteractionAuthorized'](),controller[_0x56d1('0xc')]);router[_0x56d1('0x7')](_0x56d1('0xd'),auth[_0x56d1('0xe')](),controller[_0x56d1('0xf')]);router[_0x56d1('0x7')]('/:id/messages',auth[_0x56d1('0x9')](),controller[_0x56d1('0x10')]);router[_0x56d1('0x7')](_0x56d1('0x11'),auth[_0x56d1('0xe')](),controller['getMyMessages']);router[_0x56d1('0x7')](_0x56d1('0x12'),auth[_0x56d1('0x9')](),controller[_0x56d1('0x13')]);router['post']('/',auth[_0x56d1('0x9')](),controller['create']);var upload=multer({'storage':multer[_0x56d1('0x14')]({'destination':function(_0xbf1c68,_0x13a428,_0x425e93){_0x425e93(null,path[_0x56d1('0x15')](config[_0x56d1('0x16')],_0x56d1('0x17')));},'filename':function(_0x3200f9,_0x4412b8,_0x5d008b){_0x5d008b(null,util['format'](_0x56d1('0x18'),Date[_0x56d1('0x19')](),_0x4412b8[_0x56d1('0x1a')][_0x56d1('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x56d1('0x1c')](_0x56d1('0x1d'),upload[_0x56d1('0x1e')](_0x56d1('0x1f')),controller[_0x56d1('0x20')]);router[_0x56d1('0x1c')](_0x56d1('0x21'),auth['isChatInteractionAuthorized'](),controller[_0x56d1('0x22')]);router[_0x56d1('0x1c')](_0x56d1('0x23'),auth[_0x56d1('0x9')](),interaction[_0x56d1('0x24')](_0x56d1('0x25'),'chatinteraction:addtags'),controller['addTags']);router['put']('/:id',auth[_0x56d1('0x9')](),interaction[_0x56d1('0x24')](_0x56d1('0x25'),'chatinteraction:update'),controller['update']);router[_0x56d1('0x26')](_0x56d1('0x27'),controller[_0x56d1('0x28')]);router[_0x56d1('0x26')](_0x56d1('0x29'),auth[_0x56d1('0xe')](),controller['abandon']);router[_0x56d1('0x26')](_0x56d1('0x2a'),controller[_0x56d1('0x2b')]);router[_0x56d1('0x2c')](_0x56d1('0xb'),auth['isAuthenticated'](),interaction[_0x56d1('0x24')](_0x56d1('0x25'),'chatinteraction:destroy'),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0x56d1('0x2d')]);module[_0x56d1('0x2e')]=router; \ No newline at end of file +var _0x8a6c=['/:id','update','customUpdate','/:id/abandon','abandon','/:id/close','close','tracked','chatinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','getMessages','getMyMessages','/:id/download','download','post','create','join','root','server/files/attachments/','format','%s-%s','originalname','replace','/:id/attachment_upload','single','file','attachmentUpload','/:id/messages','addMessage','/:id/tags','chat','put'];(function(_0x58910b,_0x540685){var _0xfe1259=function(_0x41e447){while(--_0x41e447){_0x58910b['push'](_0x58910b['shift']());}};_0xfe1259(++_0x540685);}(_0x8a6c,0xd8));var _0xc8a6=function(_0x539132,_0xc7ea40){_0x539132=_0x539132-0x0;var _0x4db417=_0x8a6c[_0x539132];return _0x4db417;};'use strict';var multer=require(_0xc8a6('0x0'));var util=require(_0xc8a6('0x1'));var path=require(_0xc8a6('0x2'));var timeout=require(_0xc8a6('0x3'));var express=require(_0xc8a6('0x4'));var router=express[_0xc8a6('0x5')]();var auth=require(_0xc8a6('0x6'));var interaction=require(_0xc8a6('0x7'));var config=require(_0xc8a6('0x8'));var controller=require('./chatInteraction.controller');router['get']('/',auth[_0xc8a6('0x9')](),controller['index']);router[_0xc8a6('0xa')](_0xc8a6('0xb'),auth[_0xc8a6('0x9')](),controller[_0xc8a6('0xc')]);router[_0xc8a6('0xa')]('/:id',auth[_0xc8a6('0xd')](),controller[_0xc8a6('0xe')]);router[_0xc8a6('0xa')](_0xc8a6('0xf'),auth[_0xc8a6('0xd')](),controller[_0xc8a6('0x10')]);router['get']('/:id/messages',auth[_0xc8a6('0x9')](),controller[_0xc8a6('0x11')]);router[_0xc8a6('0xa')]('/:id/my_messages',auth[_0xc8a6('0xd')](),controller[_0xc8a6('0x12')]);router['get'](_0xc8a6('0x13'),auth['isAuthenticated'](),controller[_0xc8a6('0x14')]);router[_0xc8a6('0x15')]('/',auth[_0xc8a6('0x9')](),controller[_0xc8a6('0x16')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x34dad0,_0x1c4034,_0x5b9b91){_0x5b9b91(null,path[_0xc8a6('0x17')](config[_0xc8a6('0x18')],_0xc8a6('0x19')));},'filename':function(_0x429cac,_0x2823db,_0x57fa6d){_0x57fa6d(null,util[_0xc8a6('0x1a')](_0xc8a6('0x1b'),Date['now'](),_0x2823db[_0xc8a6('0x1c')][_0xc8a6('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xc8a6('0x15')](_0xc8a6('0x1e'),upload[_0xc8a6('0x1f')](_0xc8a6('0x20')),controller[_0xc8a6('0x21')]);router[_0xc8a6('0x15')](_0xc8a6('0x22'),auth['isChatInteractionAuthorized'](),controller[_0xc8a6('0x23')]);router[_0xc8a6('0x15')](_0xc8a6('0x24'),auth[_0xc8a6('0x9')](),interaction['tracked'](_0xc8a6('0x25'),'chatinteraction:addtags'),controller['addTags']);router[_0xc8a6('0x26')](_0xc8a6('0x27'),auth['isAuthenticated'](),interaction['tracked'](_0xc8a6('0x25'),'chatinteraction:update'),controller[_0xc8a6('0x28')]);router['put']('/:id/custom_update',controller[_0xc8a6('0x29')]);router[_0xc8a6('0x26')](_0xc8a6('0x2a'),auth[_0xc8a6('0xd')](),controller[_0xc8a6('0x2b')]);router[_0xc8a6('0x26')](_0xc8a6('0x2c'),controller[_0xc8a6('0x2d')]);router['delete']('/:id',auth[_0xc8a6('0x9')](),interaction[_0xc8a6('0x2e')](_0xc8a6('0x25'),_0xc8a6('0x2f')),controller[_0xc8a6('0x30')]);router['delete'](_0xc8a6('0x24'),auth[_0xc8a6('0x9')](),controller[_0xc8a6('0x31')]);module[_0xc8a6('0x32')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index c40b72a..b7dae69 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 _0x1967=['INTEGER','exports','TEXT','medium','BOOLEAN'];(function(_0x151f8a,_0x4a7e76){var _0xdcb1e3=function(_0x156868){while(--_0x156868){_0x151f8a['push'](_0x151f8a['shift']());}};_0xdcb1e3(++_0x4a7e76);}(_0x1967,0x173));var _0x7196=function(_0x459dca,_0x1ce954){_0x459dca=_0x459dca-0x0;var _0x15a59b=_0x1967[_0x459dca];return _0x15a59b;};'use strict';var Sequelize=require('sequelize');module[_0x7196('0x0')]={'body':{'type':Sequelize[_0x7196('0x1')](_0x7196('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7196('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x7196('0x4')]}}; \ No newline at end of file +var _0x66fa=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x2c7e5e,_0x3d5748){var _0x5f1a14=function(_0x2f1ceb){while(--_0x2f1ceb){_0x2c7e5e['push'](_0x2c7e5e['shift']());}};_0x5f1a14(++_0x3d5748);}(_0x66fa,0x117));var _0xa66f=function(_0x4ace2a,_0xb0937b){_0x4ace2a=_0x4ace2a-0x0;var _0x2132e9=_0x66fa[_0x4ace2a];return _0x2132e9;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa66f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa66f('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa66f('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index bfcb8c4..d43b8d2 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 _0x25b4=['../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','count','offset','set','json','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','ChatInternalMessage','include','findAll','catch','show','length','create','body','find','params','describe','createdAt','lastMessage','lastMessageAt','YYYY-MM-DD\x20HH:mm:ss','User','admin','user','role','online','lastLoginAt','allowmessenger','sort','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','agent','push','messages','-createdAt','all','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils'];(function(_0x37eb11,_0x4949bf){var _0x46fa72=function(_0x239c09){while(--_0x239c09){_0x37eb11['push'](_0x37eb11['shift']());}};_0x46fa72(++_0x4949bf);}(_0x25b4,0x188));var _0x425b=function(_0x48b5e0,_0xb3826){_0x48b5e0=_0x48b5e0-0x0;var _0x4287ea=_0x25b4[_0x48b5e0];return _0x4287ea;};'use strict';var pdf=require(_0x425b('0x0'));var emlformat=require(_0x425b('0x1'));var rimraf=require(_0x425b('0x2'));var zipdir=require(_0x425b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x425b('0x4'));var BPromise=require(_0x425b('0x5'));var Mustache=require(_0x425b('0x6'));var util=require(_0x425b('0x7'));var path=require(_0x425b('0x8'));var sox=require(_0x425b('0x9'));var csv=require(_0x425b('0xa'));var ejs=require(_0x425b('0xb'));var fs=require('fs');var _=require(_0x425b('0xc'));var squel=require(_0x425b('0xd'));var crypto=require(_0x425b('0xe'));var jsforce=require(_0x425b('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x425b('0xa'));var querystring=require(_0x425b('0x10'));var Papa=require(_0x425b('0x11'));var Redis=require(_0x425b('0x12'));var authService=require(_0x425b('0x13'));var qs=require(_0x425b('0x14'));var as=require(_0x425b('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x425b('0x16'));var utils=require(_0x425b('0x17'));var config=require(_0x425b('0x18'));var db=require(_0x425b('0x19'))['db'];config[_0x425b('0x1a')]=_[_0x425b('0x1b')](config[_0x425b('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x425b('0x1c'))(new Redis(config[_0x425b('0x1a')]));require(_0x425b('0x1d'))[_0x425b('0x1e')](socket);function respondWithStatusCode(_0x4887be,_0x443afe){_0x443afe=_0x443afe||0xcc;return function(_0x4f12c7){if(_0x4f12c7){return _0x4887be[_0x425b('0x1f')](_0x443afe);}return _0x4887be[_0x425b('0x20')](_0x443afe)[_0x425b('0x21')]();};}function respondWithResult(_0x5a3657,_0x38884c){_0x38884c=_0x38884c||0xc8;return function(_0x4f188f){if(_0x4f188f){return _0x5a3657['status'](_0x38884c)['json'](_0x4f188f);}};}function respondWithFilteredResult(_0x28c98a,_0x44552c){return function(_0x200c2c){if(_0x200c2c){var _0x439118=_0x200c2c[_0x425b('0x22')],_0x40644e=_0x44552c['offset'],_0x3ddbdc=_0x44552c[_0x425b('0x23')]+_0x44552c['limit'],_0x1920f9;if(_0x3ddbdc>=_0x439118){_0x3ddbdc=_0x439118;_0x1920f9=0xc8;}else{_0x1920f9=0xce;}_0x28c98a['status'](_0x1920f9);return _0x28c98a[_0x425b('0x24')]('Content-Range',_0x40644e+'-'+_0x3ddbdc+'/'+_0x439118)[_0x425b('0x25')](_0x200c2c);}return null;};}function patchUpdates(_0x4d7351){return function(_0x1245fe){try{jsonpatch['apply'](_0x1245fe,_0x4d7351,!![]);}catch(_0x37b999){return BPromise[_0x425b('0x26')](_0x37b999);}return _0x1245fe[_0x425b('0x27')]();};}function saveUpdates(_0x569986,_0x20e52d){return function(_0x27dced){if(_0x27dced){return _0x27dced[_0x425b('0x28')](_0x569986)[_0x425b('0x29')](function(_0x1eed51){return _0x1eed51;});}return null;};}function removeEntity(_0x2d2c0f,_0x2a6014){return function(_0x1e4d6e){if(_0x1e4d6e){return _0x1e4d6e[_0x425b('0x2a')]()[_0x425b('0x29')](function(){_0x2d2c0f[_0x425b('0x20')](0xcc)[_0x425b('0x21')]();});}};}function handleEntityNotFound(_0x19ae3b,_0x209201){return function(_0x5582a9){if(!_0x5582a9){_0x19ae3b[_0x425b('0x1f')](0x194);}return _0x5582a9;};}function handleError(_0x3a14f3,_0x1015d6){_0x1015d6=_0x1015d6||0x1f4;return function(_0x29ac1d){logger[_0x425b('0x2b')](_0x29ac1d[_0x425b('0x2c')]);if(_0x29ac1d[_0x425b('0x2d')]){delete _0x29ac1d[_0x425b('0x2d')];}_0x3a14f3[_0x425b('0x20')](_0x1015d6)[_0x425b('0x2e')](_0x29ac1d);};}exports[_0x425b('0x2f')]=function(_0x10e34e,_0x4a9317){var _0x546aad={},_0x1ad7a7={},_0x5d899a={'count':0x0,'rows':[]};var _0x572503=_['map'](db['ChatInternalMessage'][_0x425b('0x30')],function(_0x3fae0c){return{'name':_0x3fae0c['fieldName'],'type':_0x3fae0c[_0x425b('0x31')][_0x425b('0x32')]};});_0x1ad7a7[_0x425b('0x33')]=_[_0x425b('0x34')](_0x572503,_0x425b('0x2d'));_0x1ad7a7[_0x425b('0x35')]=_[_0x425b('0x36')](_0x10e34e[_0x425b('0x35')]);_0x1ad7a7[_0x425b('0x37')]=_[_0x425b('0x38')](_0x1ad7a7[_0x425b('0x33')],_0x1ad7a7[_0x425b('0x35')]);_0x546aad[_0x425b('0x39')]=_[_0x425b('0x38')](_0x1ad7a7[_0x425b('0x33')],qs['fields'](_0x10e34e[_0x425b('0x35')]['fields']));_0x546aad[_0x425b('0x39')]=_0x546aad[_0x425b('0x39')]['length']?_0x546aad['attributes']:_0x1ad7a7['model'];if(!_0x10e34e['query']['hasOwnProperty'](_0x425b('0x3a'))){_0x546aad[_0x425b('0x3b')]=qs[_0x425b('0x3b')](_0x10e34e[_0x425b('0x35')][_0x425b('0x3b')]);_0x546aad[_0x425b('0x23')]=qs[_0x425b('0x23')](_0x10e34e['query'][_0x425b('0x23')]);}_0x546aad[_0x425b('0x3c')]=qs['sort'](_0x10e34e[_0x425b('0x35')]['sort']);_0x546aad[_0x425b('0x3d')]=qs['filters'](_[_0x425b('0x3e')](_0x10e34e[_0x425b('0x35')],_0x1ad7a7[_0x425b('0x37')]));if(_0x10e34e['query'][_0x425b('0x3f')]){_0x546aad[_0x425b('0x3d')]=_[_0x425b('0x40')](_0x546aad['where'],{'$or':_['map'](_0x572503,function(_0x5296ae){if(_0x5296ae[_0x425b('0x31')]!==_0x425b('0x41')){var _0x30979f={};_0x30979f[_0x5296ae[_0x425b('0x2d')]]={'$like':'%'+_0x10e34e[_0x425b('0x35')][_0x425b('0x3f')]+'%'};return _0x30979f;}})});}_0x546aad=_[_0x425b('0x40')]({},_0x546aad,_0x10e34e[_0x425b('0x42')]);var _0xb1b27c={'where':_0x546aad[_0x425b('0x3d')]};return db[_0x425b('0x43')][_0x425b('0x22')](_0xb1b27c)[_0x425b('0x29')](function(_0x405a9b){_0x5d899a['count']=_0x405a9b;if(_0x10e34e[_0x425b('0x35')]['includeAll']){_0x546aad[_0x425b('0x44')]=[{'all':!![]}];}return db[_0x425b('0x43')][_0x425b('0x45')](_0x546aad);})['then'](function(_0x35e1f8){_0x5d899a['rows']=_0x35e1f8;return _0x5d899a;})[_0x425b('0x29')](respondWithFilteredResult(_0x4a9317,_0x546aad))[_0x425b('0x46')](handleError(_0x4a9317,null));};exports[_0x425b('0x47')]=function(_0x5ecf7b,_0x258965){var _0x5e84b0={'raw':!![],'where':{'id':_0x5ecf7b['params']['id']}},_0xa4fbd3={};_0xa4fbd3['model']=_['keys'](db[_0x425b('0x43')][_0x425b('0x30')]);_0xa4fbd3[_0x425b('0x35')]=_[_0x425b('0x36')](_0x5ecf7b['query']);_0xa4fbd3[_0x425b('0x37')]=_[_0x425b('0x38')](_0xa4fbd3[_0x425b('0x33')],_0xa4fbd3[_0x425b('0x35')]);_0x5e84b0[_0x425b('0x39')]=_[_0x425b('0x38')](_0xa4fbd3[_0x425b('0x33')],qs['fields'](_0x5ecf7b['query']['fields']));_0x5e84b0[_0x425b('0x39')]=_0x5e84b0[_0x425b('0x39')][_0x425b('0x48')]?_0x5e84b0[_0x425b('0x39')]:_0xa4fbd3[_0x425b('0x33')];if(_0x5ecf7b['query']['includeAll']){_0x5e84b0[_0x425b('0x44')]=[{'all':!![]}];}_0x5e84b0=_[_0x425b('0x40')]({},_0x5e84b0,_0x5ecf7b[_0x425b('0x42')]);return db[_0x425b('0x43')]['find'](_0x5e84b0)[_0x425b('0x29')](handleEntityNotFound(_0x258965,null))['then'](respondWithResult(_0x258965,null))[_0x425b('0x46')](handleError(_0x258965,null));};exports[_0x425b('0x49')]=function(_0x3bd3a4,_0x5b2d47){return db[_0x425b('0x43')][_0x425b('0x49')](_0x3bd3a4[_0x425b('0x4a')],{})[_0x425b('0x29')](respondWithResult(_0x5b2d47,0xc9))['catch'](handleError(_0x5b2d47,null));};exports[_0x425b('0x28')]=function(_0x557a00,_0x1ae692){if(_0x557a00[_0x425b('0x4a')]['id']){delete _0x557a00[_0x425b('0x4a')]['id'];}return db[_0x425b('0x43')][_0x425b('0x4b')]({'where':{'id':_0x557a00[_0x425b('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1ae692,null))[_0x425b('0x29')](saveUpdates(_0x557a00[_0x425b('0x4a')],null))[_0x425b('0x29')](respondWithResult(_0x1ae692,null))['catch'](handleError(_0x1ae692,null));};exports[_0x425b('0x2a')]=function(_0x4c277d,_0x4950b5){return db[_0x425b('0x43')]['find']({'where':{'id':_0x4c277d[_0x425b('0x4c')]['id']}})[_0x425b('0x29')](handleEntityNotFound(_0x4950b5,null))[_0x425b('0x29')](removeEntity(_0x4950b5,null))[_0x425b('0x46')](handleError(_0x4950b5,null));};exports[_0x425b('0x4d')]=function(_0x43f949,_0x435238){return db[_0x425b('0x43')]['describe']()['then'](respondWithResult(_0x435238,null))['catch'](handleError(_0x435238,null));};function wrapUser(_0x89d3c0){return function(_0x59b12e){var _0x1f94a3=_0x89d3c0['get']({'plain':!![]});_0x1f94a3['messages']=[];if(_0x59b12e){_0x1f94a3['lastMessageAt']=_0x59b12e[_0x425b('0x4e')];_0x1f94a3[_0x425b('0x4f')]=_0x59b12e;}else{_0x1f94a3[_0x425b('0x50')]=moment(0x0)['format'](_0x425b('0x51'));_0x1f94a3[_0x425b('0x4f')]={};}return _0x1f94a3;};}exports['getUsers']=function(_0x5d42ef,_0x3cadc3,_0x5c2986){var _0x1a6cd8=[];return db[_0x425b('0x52')][_0x425b('0x45')]({'where':{'role':['agent',_0x425b('0x53'),_0x425b('0x54')]},'attributes':['id','fullname',_0x425b('0x2d'),_0x425b('0x55'),'userpic','internal',_0x425b('0x56'),_0x425b('0x57'),_0x425b('0x58'),'showWebBar'],'order':qs[_0x425b('0x59')](_0x425b('0x5a')),'include':[{'model':db['VoiceQueue'],'as':_0x425b('0x5b'),'attributes':['id',_0x425b('0x2d'),_0x425b('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x3ca821){if(_0x3ca821){var _0x330fab=_0x5d42ef['user'][_0x425b('0x5c')]({'plain':!![]});if(!_0x330fab)throw new Error(_0x425b('0x5d'));if(_0x330fab[_0x425b('0x55')]==='user'){return db[_0x425b('0x5e')][_0x425b('0x4b')]({'where':{'name':_0x425b('0x5f'),'userProfileId':_0x330fab[_0x425b('0x60')]},'raw':!![]})[_0x425b('0x29')](function(_0x39ac92){if(_0x39ac92){if(_0x39ac92[_0x425b('0x61')]===0x0){return db[_0x425b('0x62')]['findAll']({'where':{'sectionId':_0x39ac92['id']},'raw':!![]})[_0x425b('0x29')](function(_0x8bcddb){var _0x28efca=[];if(_['isEmpty'](_0x8bcddb)){_0x28efca=_[_0x425b('0x3f')](_0x3ca821,function(_0x5e2e05){if(_0x5e2e05[_0x425b('0x55')]!==_0x425b('0x63')){return _0x5e2e05;}});return _0x28efca;}else{for(var _0x4f2dd4=0x0;_0x4f2dd4<_0x3ca821[_0x425b('0x48')];_0x4f2dd4++){var _0x1554df=_0x3ca821[_0x4f2dd4];if(_0x1554df[_0x425b('0x55')]===_0x425b('0x63')){var _0x1245e8=_['find'](_0x8bcddb,function(_0x2faf42){return _0x2faf42['resourceId']===_0x1554df['id'];});if(_0x1245e8)_0x28efca[_0x425b('0x64')](_0x1554df);}else{_0x28efca[_0x425b('0x64')](_0x1554df);}}return _0x28efca;}});}else{return _0x3ca821;}}else{var _0x528d75=_[_0x425b('0x3f')](_0x3ca821,function(_0x45e523){if(_0x45e523[_0x425b('0x55')]!=='agent'){return _0x45e523;}});return _0x528d75;}});}else{return _0x3ca821;}}})[_0x425b('0x29')](function(_0x42bbaa){var _0x338bd8=[];if(_0x42bbaa){_0x1a6cd8=_0x42bbaa;for(var _0x2de62d=0x0;_0x2de62d<_0x42bbaa['length'];_0x2de62d+=0x1){_0x1a6cd8[_0x2de62d][_0x425b('0x65')]=[];_0x338bd8[_0x425b('0x64')](db[_0x425b('0x43')]['find']({'where':{'FromId':[_0x5d42ef[_0x425b('0x54')]['id'],_0x42bbaa[_0x2de62d]['id']],'ToId':[_0x5d42ef[_0x425b('0x54')]['id'],_0x42bbaa[_0x2de62d]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId','ToId','read',_0x425b('0x4a')],'order':qs[_0x425b('0x59')](_0x425b('0x66')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x425b('0x29')](wrapUser(_0x42bbaa[_0x2de62d])));}return BPromise[_0x425b('0x67')](_0x338bd8);}return[];})[_0x425b('0x29')](function(_0x5bbc41){return{'rows':_0x5bbc41,'count':_0x5bbc41[_0x425b('0x48')]};})[_0x425b('0x29')](respondWithResult(_0x3cadc3,null))[_0x425b('0x46')](handleError(_0x3cadc3,null));}; \ No newline at end of file +var _0xc883=['zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','pick','merge','where','VIRTUAL','options','ChatInternalMessage','findAll','rows','catch','show','rawAttributes','includeAll','find','create','body','params','describe','messages','lastMessageAt','createdAt','format','YYYY-MM-DD\x20HH:mm:ss','lastMessage','getUsers','User','agent','user','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','UserProfileResource','isEmpty','filter','resourceId','push','FromId','ToId','read','-createdAt','eml-format'];(function(_0x14fe8b,_0x51d15d){var _0x2396f3=function(_0x1d1932){while(--_0x1d1932){_0x14fe8b['push'](_0x14fe8b['shift']());}};_0x2396f3(++_0x51d15d);}(_0xc883,0x14f));var _0x3c88=function(_0x4919ee,_0x46d0b6){_0x4919ee=_0x4919ee-0x0;var _0x5ab1a0=_0xc883[_0x4919ee];return _0x5ab1a0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3c88('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3c88('0x1'));var jsonpatch=require(_0x3c88('0x2'));var rp=require(_0x3c88('0x3'));var moment=require('moment');var BPromise=require(_0x3c88('0x4'));var Mustache=require('mustache');var util=require(_0x3c88('0x5'));var path=require(_0x3c88('0x6'));var sox=require(_0x3c88('0x7'));var csv=require(_0x3c88('0x8'));var ejs=require(_0x3c88('0x9'));var fs=require('fs');var _=require(_0x3c88('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x3c88('0xb'));var deskjs=require(_0x3c88('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3c88('0xd'));var Redis=require(_0x3c88('0xe'));var authService=require(_0x3c88('0xf'));var qs=require(_0x3c88('0x10'));var as=require(_0x3c88('0x11'));var hardwareService=require(_0x3c88('0x12'));var logger=require(_0x3c88('0x13'))(_0x3c88('0x14'));var utils=require(_0x3c88('0x15'));var config=require(_0x3c88('0x16'));var db=require(_0x3c88('0x17'))['db'];config[_0x3c88('0x18')]=_[_0x3c88('0x19')](config[_0x3c88('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x3c88('0x1a'))(new Redis(config[_0x3c88('0x18')]));require(_0x3c88('0x1b'))[_0x3c88('0x1c')](socket);function respondWithStatusCode(_0x14a597,_0x4458d3){_0x4458d3=_0x4458d3||0xcc;return function(_0x3deb9b){if(_0x3deb9b){return _0x14a597[_0x3c88('0x1d')](_0x4458d3);}return _0x14a597[_0x3c88('0x1e')](_0x4458d3)['end']();};}function respondWithResult(_0x3e0842,_0x3570d1){_0x3570d1=_0x3570d1||0xc8;return function(_0x1175dd){if(_0x1175dd){return _0x3e0842[_0x3c88('0x1e')](_0x3570d1)[_0x3c88('0x1f')](_0x1175dd);}};}function respondWithFilteredResult(_0x192ff4,_0x1deb8e){return function(_0x146489){if(_0x146489){var _0x32a283=_0x146489[_0x3c88('0x20')],_0x1356f9=_0x1deb8e[_0x3c88('0x21')],_0x16afc3=_0x1deb8e['offset']+_0x1deb8e[_0x3c88('0x22')],_0x2f8bb6;if(_0x16afc3>=_0x32a283){_0x16afc3=_0x32a283;_0x2f8bb6=0xc8;}else{_0x2f8bb6=0xce;}_0x192ff4[_0x3c88('0x1e')](_0x2f8bb6);return _0x192ff4[_0x3c88('0x23')](_0x3c88('0x24'),_0x1356f9+'-'+_0x16afc3+'/'+_0x32a283)[_0x3c88('0x1f')](_0x146489);}return null;};}function patchUpdates(_0xa72e61){return function(_0x1d92f2){try{jsonpatch[_0x3c88('0x25')](_0x1d92f2,_0xa72e61,!![]);}catch(_0x30e953){return BPromise[_0x3c88('0x26')](_0x30e953);}return _0x1d92f2[_0x3c88('0x27')]();};}function saveUpdates(_0x591213,_0x3b2fed){return function(_0xd74f0){if(_0xd74f0){return _0xd74f0[_0x3c88('0x28')](_0x591213)[_0x3c88('0x29')](function(_0x1788ad){return _0x1788ad;});}return null;};}function removeEntity(_0x12eb74,_0xc271a4){return function(_0x480b53){if(_0x480b53){return _0x480b53[_0x3c88('0x2a')]()['then'](function(){_0x12eb74[_0x3c88('0x1e')](0xcc)[_0x3c88('0x2b')]();});}};}function handleEntityNotFound(_0x52f39d,_0x2caffe){return function(_0x40e395){if(!_0x40e395){_0x52f39d[_0x3c88('0x1d')](0x194);}return _0x40e395;};}function handleError(_0x35a756,_0x2f93b4){_0x2f93b4=_0x2f93b4||0x1f4;return function(_0x4f2b44){logger[_0x3c88('0x2c')](_0x4f2b44[_0x3c88('0x2d')]);if(_0x4f2b44['name']){delete _0x4f2b44[_0x3c88('0x2e')];}_0x35a756[_0x3c88('0x1e')](_0x2f93b4)[_0x3c88('0x2f')](_0x4f2b44);};}exports[_0x3c88('0x30')]=function(_0xda63bc,_0x52cb12){var _0x40bd86={},_0x2cacf4={},_0x3be7b8={'count':0x0,'rows':[]};var _0x1f7d5f=_[_0x3c88('0x31')](db['ChatInternalMessage']['rawAttributes'],function(_0x4fc693){return{'name':_0x4fc693['fieldName'],'type':_0x4fc693[_0x3c88('0x32')][_0x3c88('0x33')]};});_0x2cacf4[_0x3c88('0x34')]=_[_0x3c88('0x31')](_0x1f7d5f,_0x3c88('0x2e'));_0x2cacf4[_0x3c88('0x35')]=_[_0x3c88('0x36')](_0xda63bc[_0x3c88('0x35')]);_0x2cacf4[_0x3c88('0x37')]=_[_0x3c88('0x38')](_0x2cacf4['model'],_0x2cacf4['query']);_0x40bd86['attributes']=_['intersection'](_0x2cacf4[_0x3c88('0x34')],qs[_0x3c88('0x39')](_0xda63bc[_0x3c88('0x35')]['fields']));_0x40bd86[_0x3c88('0x3a')]=_0x40bd86[_0x3c88('0x3a')][_0x3c88('0x3b')]?_0x40bd86[_0x3c88('0x3a')]:_0x2cacf4['model'];if(!_0xda63bc['query']['hasOwnProperty'](_0x3c88('0x3c'))){_0x40bd86[_0x3c88('0x22')]=qs[_0x3c88('0x22')](_0xda63bc['query'][_0x3c88('0x22')]);_0x40bd86[_0x3c88('0x21')]=qs[_0x3c88('0x21')](_0xda63bc[_0x3c88('0x35')][_0x3c88('0x21')]);}_0x40bd86[_0x3c88('0x3d')]=qs[_0x3c88('0x3e')](_0xda63bc[_0x3c88('0x35')][_0x3c88('0x3e')]);_0x40bd86['where']=qs['filters'](_[_0x3c88('0x3f')](_0xda63bc[_0x3c88('0x35')],_0x2cacf4['filters']));if(_0xda63bc[_0x3c88('0x35')]['filter']){_0x40bd86['where']=_[_0x3c88('0x40')](_0x40bd86[_0x3c88('0x41')],{'$or':_[_0x3c88('0x31')](_0x1f7d5f,function(_0x4beeae){if(_0x4beeae[_0x3c88('0x32')]!==_0x3c88('0x42')){var _0x575623={};_0x575623[_0x4beeae['name']]={'$like':'%'+_0xda63bc[_0x3c88('0x35')]['filter']+'%'};return _0x575623;}})});}_0x40bd86=_[_0x3c88('0x40')]({},_0x40bd86,_0xda63bc[_0x3c88('0x43')]);var _0x648f={'where':_0x40bd86[_0x3c88('0x41')]};return db['ChatInternalMessage'][_0x3c88('0x20')](_0x648f)[_0x3c88('0x29')](function(_0x3036bb){_0x3be7b8[_0x3c88('0x20')]=_0x3036bb;if(_0xda63bc[_0x3c88('0x35')]['includeAll']){_0x40bd86['include']=[{'all':!![]}];}return db[_0x3c88('0x44')][_0x3c88('0x45')](_0x40bd86);})['then'](function(_0x1fa9af){_0x3be7b8[_0x3c88('0x46')]=_0x1fa9af;return _0x3be7b8;})[_0x3c88('0x29')](respondWithFilteredResult(_0x52cb12,_0x40bd86))[_0x3c88('0x47')](handleError(_0x52cb12,null));};exports[_0x3c88('0x48')]=function(_0xeceb11,_0x21b557){var _0x36f332={'raw':!![],'where':{'id':_0xeceb11['params']['id']}},_0x4355f3={};_0x4355f3[_0x3c88('0x34')]=_['keys'](db[_0x3c88('0x44')][_0x3c88('0x49')]);_0x4355f3[_0x3c88('0x35')]=_[_0x3c88('0x36')](_0xeceb11['query']);_0x4355f3[_0x3c88('0x37')]=_[_0x3c88('0x38')](_0x4355f3[_0x3c88('0x34')],_0x4355f3[_0x3c88('0x35')]);_0x36f332[_0x3c88('0x3a')]=_[_0x3c88('0x38')](_0x4355f3[_0x3c88('0x34')],qs[_0x3c88('0x39')](_0xeceb11[_0x3c88('0x35')][_0x3c88('0x39')]));_0x36f332[_0x3c88('0x3a')]=_0x36f332[_0x3c88('0x3a')]['length']?_0x36f332[_0x3c88('0x3a')]:_0x4355f3[_0x3c88('0x34')];if(_0xeceb11[_0x3c88('0x35')][_0x3c88('0x4a')]){_0x36f332['include']=[{'all':!![]}];}_0x36f332=_['merge']({},_0x36f332,_0xeceb11['options']);return db[_0x3c88('0x44')][_0x3c88('0x4b')](_0x36f332)[_0x3c88('0x29')](handleEntityNotFound(_0x21b557,null))[_0x3c88('0x29')](respondWithResult(_0x21b557,null))['catch'](handleError(_0x21b557,null));};exports[_0x3c88('0x4c')]=function(_0x313fdd,_0x23d63f){return db[_0x3c88('0x44')][_0x3c88('0x4c')](_0x313fdd[_0x3c88('0x4d')],{})[_0x3c88('0x29')](respondWithResult(_0x23d63f,0xc9))[_0x3c88('0x47')](handleError(_0x23d63f,null));};exports[_0x3c88('0x28')]=function(_0x30adda,_0x3dbae1){if(_0x30adda[_0x3c88('0x4d')]['id']){delete _0x30adda[_0x3c88('0x4d')]['id'];}return db[_0x3c88('0x44')][_0x3c88('0x4b')]({'where':{'id':_0x30adda[_0x3c88('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3dbae1,null))[_0x3c88('0x29')](saveUpdates(_0x30adda[_0x3c88('0x4d')],null))['then'](respondWithResult(_0x3dbae1,null))[_0x3c88('0x47')](handleError(_0x3dbae1,null));};exports[_0x3c88('0x2a')]=function(_0x2c5c8f,_0x55be39){return db['ChatInternalMessage']['find']({'where':{'id':_0x2c5c8f[_0x3c88('0x4e')]['id']}})[_0x3c88('0x29')](handleEntityNotFound(_0x55be39,null))[_0x3c88('0x29')](removeEntity(_0x55be39,null))[_0x3c88('0x47')](handleError(_0x55be39,null));};exports[_0x3c88('0x4f')]=function(_0x3aeb37,_0x5828d4){return db['ChatInternalMessage'][_0x3c88('0x4f')]()[_0x3c88('0x29')](respondWithResult(_0x5828d4,null))[_0x3c88('0x47')](handleError(_0x5828d4,null));};function wrapUser(_0x7e2bd8){return function(_0x4fe3ef){var _0x13d2fa=_0x7e2bd8['get']({'plain':!![]});_0x13d2fa[_0x3c88('0x50')]=[];if(_0x4fe3ef){_0x13d2fa[_0x3c88('0x51')]=_0x4fe3ef[_0x3c88('0x52')];_0x13d2fa['lastMessage']=_0x4fe3ef;}else{_0x13d2fa[_0x3c88('0x51')]=moment(0x0)[_0x3c88('0x53')](_0x3c88('0x54'));_0x13d2fa[_0x3c88('0x55')]={};}return _0x13d2fa;};}exports[_0x3c88('0x56')]=function(_0x35c717,_0x5f1873,_0x227781){var _0xc16a7=[];return db[_0x3c88('0x57')][_0x3c88('0x45')]({'where':{'role':[_0x3c88('0x58'),'admin',_0x3c88('0x59')]},'attributes':['id','fullname',_0x3c88('0x2e'),_0x3c88('0x5a'),_0x3c88('0x5b'),_0x3c88('0x5c'),_0x3c88('0x5d'),_0x3c88('0x5e'),_0x3c88('0x5f'),_0x3c88('0x60')],'order':qs[_0x3c88('0x3e')](_0x3c88('0x61')),'include':[{'model':db['VoiceQueue'],'as':_0x3c88('0x62'),'attributes':['id','name',_0x3c88('0x32')],'through':{'attributes':[]}}]})['then'](function(_0x37c611){if(_0x37c611){var _0x2ada5a=_0x35c717[_0x3c88('0x59')][_0x3c88('0x63')]({'plain':!![]});if(!_0x2ada5a)throw new Error(_0x3c88('0x64'));if(_0x2ada5a[_0x3c88('0x5a')]===_0x3c88('0x59')){return db['UserProfileSection']['find']({'where':{'name':'Agents','userProfileId':_0x2ada5a[_0x3c88('0x65')]},'raw':!![]})[_0x3c88('0x29')](function(_0x5e1362){if(_0x5e1362){if(_0x5e1362[_0x3c88('0x66')]===0x0){return db[_0x3c88('0x67')][_0x3c88('0x45')]({'where':{'sectionId':_0x5e1362['id']},'raw':!![]})[_0x3c88('0x29')](function(_0x261e8f){var _0xccec45=[];if(_[_0x3c88('0x68')](_0x261e8f)){_0xccec45=_[_0x3c88('0x69')](_0x37c611,function(_0x132d2d){if(_0x132d2d['role']!=='agent'){return _0x132d2d;}});return _0xccec45;}else{for(var _0x153f69=0x0;_0x153f69<_0x37c611[_0x3c88('0x3b')];_0x153f69++){var _0x13dbc8=_0x37c611[_0x153f69];if(_0x13dbc8[_0x3c88('0x5a')]==='agent'){var _0x21e89b=_['find'](_0x261e8f,function(_0x43c347){return _0x43c347[_0x3c88('0x6a')]===_0x13dbc8['id'];});if(_0x21e89b)_0xccec45[_0x3c88('0x6b')](_0x13dbc8);}else{_0xccec45[_0x3c88('0x6b')](_0x13dbc8);}}return _0xccec45;}});}else{return _0x37c611;}}else{var _0x3cf831=_[_0x3c88('0x69')](_0x37c611,function(_0x24befa){if(_0x24befa[_0x3c88('0x5a')]!==_0x3c88('0x58')){return _0x24befa;}});return _0x3cf831;}});}else{return _0x37c611;}}})[_0x3c88('0x29')](function(_0x18f61c){var _0x55d230=[];if(_0x18f61c){_0xc16a7=_0x18f61c;for(var _0x25cbd6=0x0;_0x25cbd6<_0x18f61c[_0x3c88('0x3b')];_0x25cbd6+=0x1){_0xc16a7[_0x25cbd6][_0x3c88('0x50')]=[];_0x55d230[_0x3c88('0x6b')](db[_0x3c88('0x44')][_0x3c88('0x4b')]({'where':{'FromId':[_0x35c717[_0x3c88('0x59')]['id'],_0x18f61c[_0x25cbd6]['id']],'ToId':[_0x35c717['user']['id'],_0x18f61c[_0x25cbd6]['id']],'ChatGroupId':null},'attributes':['id',_0x3c88('0x52'),_0x3c88('0x6c'),_0x3c88('0x6d'),_0x3c88('0x6e'),_0x3c88('0x4d')],'order':qs[_0x3c88('0x3e')](_0x3c88('0x6f')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x3c88('0x29')](wrapUser(_0x18f61c[_0x25cbd6])));}return BPromise['all'](_0x55d230);}return[];})[_0x3c88('0x29')](function(_0x101e66){return{'rows':_0x101e66,'count':_0x101e66[_0x3c88('0x3b')]};})['then'](respondWithResult(_0x5f1873,null))[_0x3c88('0x47')](handleError(_0x5f1873,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index d631e15..50d2f4e 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 _0xf2ca=['hasOwnProperty','hook','events','../../mysqldb','ChatInternalMessage','save','update','remove','emit'];(function(_0x34ca7a,_0x2eecc2){var _0x12a55c=function(_0x546375){while(--_0x546375){_0x34ca7a['push'](_0x34ca7a['shift']());}};_0x12a55c(++_0x2eecc2);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xfcdda0,_0x32479b){_0xfcdda0=_0xfcdda0-0x0;var _0x17ebe3=_0xf2ca[_0xfcdda0];return _0x17ebe3;};'use strict';var EventEmitter=require(_0xaf2c('0x0'));var ChatInternalMessage=require(_0xaf2c('0x1'))['db'][_0xaf2c('0x2')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xaf2c('0x3'),'afterUpdate':_0xaf2c('0x4'),'afterDestroy':_0xaf2c('0x5')};function emitEvent(_0x219511){return function(_0x3a724c,_0x10c910,_0x5b8c81){ChatInternalMessageEvents[_0xaf2c('0x6')](_0x219511+':'+_0x3a724c['id'],_0x3a724c);ChatInternalMessageEvents[_0xaf2c('0x6')](_0x219511,_0x3a724c);_0x5b8c81(null);};}for(var e in events){if(events[_0xaf2c('0x7')](e)){var event=events[e];ChatInternalMessage[_0xaf2c('0x8')](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x29fb=['save','update','remove','emit','hasOwnProperty','hook','exports','events','ChatInternalMessage','setMaxListeners'];(function(_0xce8f5a,_0x5a5c18){var _0xd41ea8=function(_0x2c8307){while(--_0x2c8307){_0xce8f5a['push'](_0xce8f5a['shift']());}};_0xd41ea8(++_0x5a5c18);}(_0x29fb,0x13d));var _0xb29f=function(_0x50c7e1,_0x397136){_0x50c7e1=_0x50c7e1-0x0;var _0x5464f3=_0x29fb[_0x50c7e1];return _0x5464f3;};'use strict';var EventEmitter=require(_0xb29f('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xb29f('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb29f('0x2')](0x0);var events={'afterCreate':_0xb29f('0x3'),'afterUpdate':_0xb29f('0x4'),'afterDestroy':_0xb29f('0x5')};function emitEvent(_0x5120c5){return function(_0x411960,_0x5388a1,_0x3361d2){ChatInternalMessageEvents[_0xb29f('0x6')](_0x5120c5+':'+_0x411960['id'],_0x411960);ChatInternalMessageEvents[_0xb29f('0x6')](_0x5120c5,_0x411960);_0x3361d2(null);};}for(var e in events){if(events[_0xb29f('0x7')](e)){var event=events[e];ChatInternalMessage[_0xb29f('0x8')](e,emitEvent(event));}}module[_0xb29f('0x9')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 0e73c63..c185f69 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 _0xb7e7=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x5a6716,_0x34cc82){var _0x21e961=function(_0x3cbef1){while(--_0x3cbef1){_0x5a6716['push'](_0x5a6716['shift']());}};_0x21e961(++_0x34cc82);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2a6809,_0x44edde){_0x2a6809=_0x2a6809-0x0;var _0x11c371=_0xb7e7[_0x2a6809];return _0x11c371;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});}; \ No newline at end of file +var _0xb7e7=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x514c5e,_0x8c0875){var _0x34c3e6=function(_0x3d78d2){while(--_0x3d78d2){_0x514c5e['push'](_0x514c5e['shift']());}};_0x34c3e6(++_0x8c0875);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xb7e7[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var logger=require(_0x7b7e('0x1'))('api');var moment=require(_0x7b7e('0x2'));var BPromise=require('bluebird');var rp=require(_0x7b7e('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7b7e('0x4'));var config=require(_0x7b7e('0x5'));var attributes=require(_0x7b7e('0x6'));module['exports']=function(_0x53ed64,_0x333fa4){return _0x53ed64[_0x7b7e('0x7')](_0x7b7e('0x8'),attributes,{'tableName':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index b5ab99f..19ab1ad 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 _0xe984=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xe984,0xee));var _0x4e98=function(_0x39f34f,_0x298f45){_0x39f34f=_0x39f34f-0x0;var _0x59fee1=_0xe984[_0x39f34f];return _0x59fee1;};'use strict';var _=require(_0x4e98('0x0'));var util=require(_0x4e98('0x1'));var moment=require(_0x4e98('0x2'));var BPromise=require(_0x4e98('0x3'));var rs=require(_0x4e98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4e98('0x5'))['db'];var utils=require(_0x4e98('0x6'));var logger=require('../../config/logger')(_0x4e98('0x7'));var config=require(_0x4e98('0x8'));var jayson=require(_0x4e98('0x9'));var client=jayson[_0x4e98('0xa')][_0x4e98('0xb')]({'port':0x232a});config[_0x4e98('0xc')]=_['defaults'](config['redis'],{'host':_0x4e98('0xd'),'port':0x18eb});var socket=require(_0x4e98('0xe'))(new Redis(config[_0x4e98('0xc')]));require(_0x4e98('0xf'))[_0x4e98('0x10')](socket);function respondWithRpcPromise(_0x32447f,_0xd62d3a,_0x3d97af){return new BPromise(function(_0x4e076e,_0x357cf8){return client['request'](_0x32447f,_0x3d97af)[_0x4e98('0x11')](function(_0x3aee2b){logger[_0x4e98('0x12')](_0x4e98('0x13'),_0xd62d3a,_0x4e98('0x14'));logger['debug'](_0x4e98('0x15'),_0xd62d3a,'request\x20sent',JSON['stringify'](_0x3aee2b));if(_0x3aee2b[_0x4e98('0x16')]){if(_0x3aee2b[_0x4e98('0x16')][_0x4e98('0x17')]===0x1f4){logger['error']('ChatInternalMessage,\x20%s,\x20%s',_0xd62d3a,_0x3aee2b[_0x4e98('0x16')]['message']);return _0x357cf8(_0x3aee2b['error'][_0x4e98('0x18')]);}logger[_0x4e98('0x16')](_0x4e98('0x13'),_0xd62d3a,_0x3aee2b['error'][_0x4e98('0x18')]);return _0x4e076e(_0x3aee2b[_0x4e98('0x16')][_0x4e98('0x18')]);}else{logger[_0x4e98('0x12')](_0x4e98('0x13'),_0xd62d3a,_0x4e98('0x14'));_0x4e076e(_0x3aee2b[_0x4e98('0x19')]['message']);}})[_0x4e98('0x1a')](function(_0x38b4a4){logger[_0x4e98('0x16')](_0x4e98('0x13'),_0xd62d3a,_0x38b4a4);_0x357cf8(_0x38b4a4);});});} \ No newline at end of file +var _0xf0c5=['socket.io-emitter','./chatInternalMessage.socket','register','request','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost'];(function(_0xd0b45d,_0x2bfe15){var _0x51d836=function(_0x377664){while(--_0x377664){_0xd0b45d['push'](_0xd0b45d['shift']());}};_0x51d836(++_0x2bfe15);}(_0xf0c5,0x1b3));var _0x5f0c=function(_0x1b0efe,_0x28405f){_0x1b0efe=_0x1b0efe-0x0;var _0x2fbe0b=_0xf0c5[_0x1b0efe];return _0x2fbe0b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5f0c('0x0'));var BPromise=require('bluebird');var rs=require(_0x5f0c('0x1'));var fs=require('fs');var Redis=require(_0x5f0c('0x2'));var db=require(_0x5f0c('0x3'))['db'];var utils=require(_0x5f0c('0x4'));var logger=require(_0x5f0c('0x5'))('rpc');var config=require(_0x5f0c('0x6'));var jayson=require(_0x5f0c('0x7'));var client=jayson[_0x5f0c('0x8')][_0x5f0c('0x9')]({'port':0x232a});config[_0x5f0c('0xa')]=_[_0x5f0c('0xb')](config[_0x5f0c('0xa')],{'host':_0x5f0c('0xc'),'port':0x18eb});var socket=require(_0x5f0c('0xd'))(new Redis(config[_0x5f0c('0xa')]));require(_0x5f0c('0xe'))[_0x5f0c('0xf')](socket);function respondWithRpcPromise(_0x2185af,_0x316759,_0x3425ee){return new BPromise(function(_0x3c4039,_0x127d0a){return client[_0x5f0c('0x10')](_0x2185af,_0x3425ee)[_0x5f0c('0x11')](function(_0x32f352){logger[_0x5f0c('0x12')](_0x5f0c('0x13'),_0x316759,_0x5f0c('0x14'));logger[_0x5f0c('0x15')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x316759,_0x5f0c('0x14'),JSON[_0x5f0c('0x16')](_0x32f352));if(_0x32f352['error']){if(_0x32f352[_0x5f0c('0x17')][_0x5f0c('0x18')]===0x1f4){logger[_0x5f0c('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x316759,_0x32f352['error'][_0x5f0c('0x19')]);return _0x127d0a(_0x32f352[_0x5f0c('0x17')][_0x5f0c('0x19')]);}logger[_0x5f0c('0x17')]('ChatInternalMessage,\x20%s,\x20%s',_0x316759,_0x32f352[_0x5f0c('0x17')]['message']);return _0x3c4039(_0x32f352[_0x5f0c('0x17')][_0x5f0c('0x19')]);}else{logger[_0x5f0c('0x12')](_0x5f0c('0x13'),_0x316759,_0x5f0c('0x14'));_0x3c4039(_0x32f352[_0x5f0c('0x1a')][_0x5f0c('0x19')]);}})[_0x5f0c('0x1b')](function(_0x1678d0){logger['error'](_0x5f0c('0x13'),_0x316759,_0x1678d0);_0x127d0a(_0x1678d0);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index d74332b..d58c093 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 _0x826a=['update','emit','removeListener','register','length','chatInternalMessage:','save'];(function(_0x4a8318,_0x551079){var _0x20a290=function(_0x1a5839){while(--_0x1a5839){_0x4a8318['push'](_0x4a8318['shift']());}};_0x20a290(++_0x551079);}(_0x826a,0x1aa));var _0xa826=function(_0x3f84f4,_0x1af7e2){_0x3f84f4=_0x3f84f4-0x0;var _0x18b0ee=_0x826a[_0x3f84f4];return _0x18b0ee;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0xa826('0x0'),'remove',_0xa826('0x1')];function createListener(_0x50c70e,_0x376d53){return function(_0x19ba11){_0x376d53[_0xa826('0x2')](_0x50c70e,_0x19ba11);};}function removeListener(_0x34e1ad,_0x5372ab){return function(){ChatInternalMessageEvents[_0xa826('0x3')](_0x34e1ad,_0x5372ab);};}exports[_0xa826('0x4')]=function(_0x3929d4){for(var _0x34327b=0x0,_0x45154f=events[_0xa826('0x5')];_0x34327b<_0x45154f;_0x34327b++){var _0x4339f9=events[_0x34327b];var _0x14c2ba=createListener(_0xa826('0x6')+_0x4339f9,_0x3929d4);ChatInternalMessageEvents['on'](_0x4339f9,_0x14c2ba);}}; \ No newline at end of file +var _0x4de7=['chatInternalMessage:','./chatInternalMessage.events','remove','update','removeListener','length'];(function(_0x1aacf3,_0x1186d9){var _0x25547a=function(_0x156bcb){while(--_0x156bcb){_0x1aacf3['push'](_0x1aacf3['shift']());}};_0x25547a(++_0x1186d9);}(_0x4de7,0x1f3));var _0x74de=function(_0x3a25a9,_0x29e2f6){_0x3a25a9=_0x3a25a9-0x0;var _0x465c20=_0x4de7[_0x3a25a9];return _0x465c20;};'use strict';var ChatInternalMessageEvents=require(_0x74de('0x0'));var events=['save',_0x74de('0x1'),_0x74de('0x2')];function createListener(_0x58178c,_0x4049b1){return function(_0x35b390){_0x4049b1['emit'](_0x58178c,_0x35b390);};}function removeListener(_0x394878,_0x5de5cf){return function(){ChatInternalMessageEvents[_0x74de('0x3')](_0x394878,_0x5de5cf);};}exports['register']=function(_0x1f418e){for(var _0xba55c8=0x0,_0x2133a6=events[_0x74de('0x4')];_0xba55c8<_0x2133a6;_0xba55c8++){var _0x370dcf=events[_0xba55c8];var _0x285159=createListener(_0x74de('0x5')+_0x370dcf,_0x1f418e);ChatInternalMessageEvents['on'](_0x370dcf,_0x285159);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index c68fb0a..13a84ac 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 _0xa9e0=['destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','post','delete'];(function(_0x3d1d49,_0x4629d4){var _0x4012d0=function(_0x198dfc){while(--_0x198dfc){_0x3d1d49['push'](_0x3d1d49['shift']());}};_0x4012d0(++_0x4629d4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0xa9e0[_0x13ea00];return _0x1f7347;};'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['getUsers']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',controller['update']);router[_0x0a9e('0xe')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xf')]);module[_0x0a9e('0x10')]=router; \ No newline at end of file +var _0xa9e0=['destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','post','delete'];(function(_0x1a50a6,_0x400207){var _0x9cd101=function(_0x4abe53){while(--_0x4abe53){_0x1a50a6['push'](_0x1a50a6['shift']());}};_0x9cd101(++_0x400207);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xa9e0[_0x2b4411];return _0x8e41ef;};'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['getUsers']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',controller['update']);router[_0x0a9e('0xe')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xf')]);module[_0x0a9e('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index a64bcf6..bf2ddbe 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 _0x42aa=['ENUM','out','DATE','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x447287,_0x89cac2){var _0x378c33=function(_0x439232){while(--_0x439232){_0x447287['push'](_0x447287['shift']());}};_0x378c33(++_0x89cac2);}(_0x42aa,0x18b));var _0xa42a=function(_0x414683,_0x4c629d){_0x414683=_0x414683-0x0;var _0x1b0b7e=_0x42aa[_0x414683];return _0x1b0b7e;};'use strict';var Sequelize=require(_0xa42a('0x0'));module[_0xa42a('0x1')]={'body':{'type':Sequelize[_0xa42a('0x2')](_0xa42a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa42a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xa42a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa42a('0x5')]('in',_0xa42a('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0xa42a('0x7')]}}; \ No newline at end of file +var _0xeab9=['exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xeab9,0x78));var _0x9eab=function(_0x4984a1,_0xf4c369){_0x4984a1=_0x4984a1-0x0;var _0x5f43ea=_0xeab9[_0x4984a1];return _0x5f43ea;};'use strict';var Sequelize=require('sequelize');module[_0x9eab('0x0')]={'body':{'type':Sequelize['TEXT'](_0x9eab('0x1')),'allowNull':![]},'read':{'type':Sequelize[_0x9eab('0x2')],'defaultValue':![]},'secret':{'type':Sequelize[_0x9eab('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0x9eab('0x3')]('in','out'),'defaultValue':_0x9eab('0x4'),'allowNull':![]},'readAt':{'type':Sequelize[_0x9eab('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 062cae7..5695901 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 _0x9aee=['[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','AcceptMessage','manual','interface','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','ChatInteraction','null','RejectMessage','rejectMessage','rejectmessage','html-pdf','rimraf','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','client','http','test','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','error','code','message','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filters','merge','VIRTUAL','options','include','findAll','rows','show','params','includeAll','create','body','catch','find','describe','chat-interactions','chat','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','ChatInteractionId','isNil','read1stAt','get'];(function(_0x1730b1,_0x14c00d){var _0x3688c8=function(_0x194861){while(--_0x194861){_0x1730b1['push'](_0x1730b1['shift']());}};_0x3688c8(++_0x14c00d);}(_0x9aee,0x18b));var _0xe9ae=function(_0x536ca6,_0x2a9a1d){_0x536ca6=_0x536ca6-0x0;var _0x4afae3=_0x9aee[_0x536ca6];return _0x4afae3;};'use strict';var pdf=require(_0xe9ae('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe9ae('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xe9ae('0x2'));var moment=require('moment');var BPromise=require(_0xe9ae('0x3'));var Mustache=require(_0xe9ae('0x4'));var util=require(_0xe9ae('0x5'));var path=require(_0xe9ae('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe9ae('0x7'));var fs=require('fs');var _=require(_0xe9ae('0x8'));var squel=require(_0xe9ae('0x9'));var crypto=require(_0xe9ae('0xa'));var jsforce=require(_0xe9ae('0xb'));var deskjs=require(_0xe9ae('0xc'));var toCsv=require(_0xe9ae('0xd'));var querystring=require(_0xe9ae('0xe'));var Papa=require(_0xe9ae('0xf'));var Redis=require(_0xe9ae('0x10'));var authService=require(_0xe9ae('0x11'));var qs=require(_0xe9ae('0x12'));var as=require(_0xe9ae('0x13'));var hardwareService=require(_0xe9ae('0x14'));var logger=require(_0xe9ae('0x15'))('api');var utils=require(_0xe9ae('0x16'));var config=require(_0xe9ae('0x17'));var db=require(_0xe9ae('0x18'))['db'];config[_0xe9ae('0x19')]=_[_0xe9ae('0x1a')](config[_0xe9ae('0x19')],{'host':_0xe9ae('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe9ae('0x1c'))[_0xe9ae('0x1d')](socket);var jayson=require(_0xe9ae('0x1e'));var client=jayson[_0xe9ae('0x1f')][_0xe9ae('0x20')]({'port':0x232c});var client9002=jayson[_0xe9ae('0x1f')][_0xe9ae('0x20')]({'port':0x232a});function checkPasswordPattern(_0x218a64,_0x272b6b,_0x9ec6c){if(_0x9ec6c){var _0x2b1a88=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b1a88[_0xe9ae('0x21')](_0x272b6b)){return _0x218a64;}else{throw new db['Sequelize']['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x218a64;}}function respondWithRpcPromise(_0x9320df,_0x21eb4b,_0x452386,_0x1f9a66){return new BPromise(function(_0xc70c26,_0x50f836){var _0x5ccedc=_0x1f9a66||client;return _0x5ccedc['request'](_0x9320df,_0x452386)[_0xe9ae('0x22')](function(_0x5492eb){logger[_0xe9ae('0x23')](_0xe9ae('0x24'),_0x21eb4b,_0xe9ae('0x25'));logger['debug']('ChatMessage,\x20%s,\x20%s,\x20%s',_0x21eb4b,_0xe9ae('0x25'),JSON['stringify'](_0x5492eb));if(_0x5492eb['error']){if(_0x5492eb[_0xe9ae('0x26')][_0xe9ae('0x27')]===0x1f4){logger[_0xe9ae('0x26')](_0xe9ae('0x24'),_0x21eb4b,_0x5492eb[_0xe9ae('0x26')]['message']);return _0x50f836(_0x5492eb[_0xe9ae('0x26')]['message']);}logger[_0xe9ae('0x26')](_0xe9ae('0x24'),_0x21eb4b,_0x5492eb[_0xe9ae('0x26')][_0xe9ae('0x28')]);return _0xc70c26(_0x5492eb[_0xe9ae('0x26')][_0xe9ae('0x28')]);}else{logger[_0xe9ae('0x23')](_0xe9ae('0x24'),_0x21eb4b,_0xe9ae('0x25'));_0xc70c26(_0x5492eb[_0xe9ae('0x29')][_0xe9ae('0x28')]);}})['catch'](function(_0x1e08d3){logger['error'](_0xe9ae('0x24'),_0x21eb4b,_0x1e08d3);_0x50f836(_0x1e08d3);});});}function respondWithStatusCode(_0x3d7802,_0x1df651){_0x1df651=_0x1df651||0xcc;return function(_0xb68b0f){if(_0xb68b0f){return _0x3d7802[_0xe9ae('0x2a')](_0x1df651);}return _0x3d7802[_0xe9ae('0x2b')](_0x1df651)[_0xe9ae('0x2c')]();};}function respondWithResult(_0x336f74,_0x30c52f){_0x30c52f=_0x30c52f||0xc8;return function(_0x405ddc){if(_0x405ddc){return _0x336f74['status'](_0x30c52f)[_0xe9ae('0x2d')](_0x405ddc);}};}function respondWithFilteredResult(_0x362e7f,_0x19bb32){return function(_0x25ef70){if(_0x25ef70){var _0x1cce68=_0x25ef70[_0xe9ae('0x2e')],_0x39f58b=_0x19bb32[_0xe9ae('0x2f')],_0x1a3877=_0x19bb32[_0xe9ae('0x2f')]+_0x19bb32[_0xe9ae('0x30')],_0x51dc94;if(_0x1a3877>=_0x1cce68){_0x1a3877=_0x1cce68;_0x51dc94=0xc8;}else{_0x51dc94=0xce;}_0x362e7f['status'](_0x51dc94);return _0x362e7f[_0xe9ae('0x31')](_0xe9ae('0x32'),_0x39f58b+'-'+_0x1a3877+'/'+_0x1cce68)[_0xe9ae('0x2d')](_0x25ef70);}return null;};}function patchUpdates(_0x35f01f){return function(_0x358bfc){try{jsonpatch[_0xe9ae('0x33')](_0x358bfc,_0x35f01f,!![]);}catch(_0x1a5797){return BPromise[_0xe9ae('0x34')](_0x1a5797);}return _0x358bfc[_0xe9ae('0x35')]();};}function saveUpdates(_0x5962f1,_0x5686b0){return function(_0x123e2a){if(_0x123e2a){return _0x123e2a[_0xe9ae('0x36')](_0x5962f1)['then'](function(_0x76950b){return _0x76950b;});}return null;};}function removeEntity(_0x385bb1,_0x36a4b5){return function(_0x5ecbc8){if(_0x5ecbc8){return _0x5ecbc8[_0xe9ae('0x37')]()[_0xe9ae('0x22')](function(){_0x385bb1[_0xe9ae('0x2b')](0xcc)[_0xe9ae('0x2c')]();});}};}function handleEntityNotFound(_0x596069,_0x1335ad){return function(_0x2b1fd6){if(!_0x2b1fd6){_0x596069['sendStatus'](0x194);}return _0x2b1fd6;};}function handleError(_0x35a7c8,_0x1f6359){_0x1f6359=_0x1f6359||0x1f4;return function(_0x2b862b){logger[_0xe9ae('0x26')](_0x2b862b[_0xe9ae('0x38')]);if(_0x2b862b[_0xe9ae('0x39')]){delete _0x2b862b[_0xe9ae('0x39')];}_0x35a7c8[_0xe9ae('0x2b')](_0x1f6359)[_0xe9ae('0x3a')](_0x2b862b);};}exports[_0xe9ae('0x3b')]=function(_0x50163d,_0x4afa86){var _0xf807e6={},_0x33645b={},_0x2401af={'count':0x0,'rows':[]};var _0x4d787a=_[_0xe9ae('0x3c')](db[_0xe9ae('0x3d')][_0xe9ae('0x3e')],function(_0x222f17){return{'name':_0x222f17[_0xe9ae('0x3f')],'type':_0x222f17[_0xe9ae('0x40')][_0xe9ae('0x41')]};});_0x33645b[_0xe9ae('0x42')]=_['map'](_0x4d787a,_0xe9ae('0x39'));_0x33645b[_0xe9ae('0x43')]=_[_0xe9ae('0x44')](_0x50163d[_0xe9ae('0x43')]);_0x33645b['filters']=_[_0xe9ae('0x45')](_0x33645b['model'],_0x33645b[_0xe9ae('0x43')]);_0xf807e6['attributes']=_[_0xe9ae('0x45')](_0x33645b['model'],qs[_0xe9ae('0x46')](_0x50163d[_0xe9ae('0x43')][_0xe9ae('0x46')]));_0xf807e6[_0xe9ae('0x47')]=_0xf807e6['attributes'][_0xe9ae('0x48')]?_0xf807e6[_0xe9ae('0x47')]:_0x33645b[_0xe9ae('0x42')];if(!_0x50163d['query']['hasOwnProperty'](_0xe9ae('0x49'))){_0xf807e6[_0xe9ae('0x30')]=qs[_0xe9ae('0x30')](_0x50163d[_0xe9ae('0x43')][_0xe9ae('0x30')]);_0xf807e6[_0xe9ae('0x2f')]=qs[_0xe9ae('0x2f')](_0x50163d['query'][_0xe9ae('0x2f')]);}_0xf807e6[_0xe9ae('0x4a')]=qs[_0xe9ae('0x4b')](_0x50163d['query'][_0xe9ae('0x4b')]);_0xf807e6[_0xe9ae('0x4c')]=qs['filters'](_[_0xe9ae('0x4d')](_0x50163d['query'],_0x33645b[_0xe9ae('0x4e')]));if(_0x50163d[_0xe9ae('0x43')]['filter']){_0xf807e6['where']=_[_0xe9ae('0x4f')](_0xf807e6[_0xe9ae('0x4c')],{'$or':_[_0xe9ae('0x3c')](_0x4d787a,function(_0x593d93){if(_0x593d93[_0xe9ae('0x40')]!==_0xe9ae('0x50')){var _0x546bb1={};_0x546bb1[_0x593d93['name']]={'$like':'%'+_0x50163d[_0xe9ae('0x43')]['filter']+'%'};return _0x546bb1;}})});}_0xf807e6=_[_0xe9ae('0x4f')]({},_0xf807e6,_0x50163d[_0xe9ae('0x51')]);var _0x21551a={'where':_0xf807e6[_0xe9ae('0x4c')]};return db[_0xe9ae('0x3d')]['count'](_0x21551a)[_0xe9ae('0x22')](function(_0x2b44b8){_0x2401af[_0xe9ae('0x2e')]=_0x2b44b8;if(_0x50163d[_0xe9ae('0x43')]['includeAll']){_0xf807e6[_0xe9ae('0x52')]=[{'all':!![]}];}return db[_0xe9ae('0x3d')][_0xe9ae('0x53')](_0xf807e6);})[_0xe9ae('0x22')](function(_0x4c6779){_0x2401af[_0xe9ae('0x54')]=_0x4c6779;return _0x2401af;})[_0xe9ae('0x22')](respondWithFilteredResult(_0x4afa86,_0xf807e6))['catch'](handleError(_0x4afa86,null));};exports[_0xe9ae('0x55')]=function(_0x53c4e6,_0x132188){var _0x38c486={'raw':!![],'where':{'id':_0x53c4e6[_0xe9ae('0x56')]['id']}},_0x5f38ac={};_0x5f38ac[_0xe9ae('0x42')]=_[_0xe9ae('0x44')](db[_0xe9ae('0x3d')][_0xe9ae('0x3e')]);_0x5f38ac[_0xe9ae('0x43')]=_[_0xe9ae('0x44')](_0x53c4e6['query']);_0x5f38ac[_0xe9ae('0x4e')]=_[_0xe9ae('0x45')](_0x5f38ac[_0xe9ae('0x42')],_0x5f38ac[_0xe9ae('0x43')]);_0x38c486[_0xe9ae('0x47')]=_[_0xe9ae('0x45')](_0x5f38ac['model'],qs[_0xe9ae('0x46')](_0x53c4e6[_0xe9ae('0x43')][_0xe9ae('0x46')]));_0x38c486[_0xe9ae('0x47')]=_0x38c486[_0xe9ae('0x47')]['length']?_0x38c486['attributes']:_0x5f38ac[_0xe9ae('0x42')];if(_0x53c4e6[_0xe9ae('0x43')][_0xe9ae('0x57')]){_0x38c486[_0xe9ae('0x52')]=[{'all':!![]}];}_0x38c486=_[_0xe9ae('0x4f')]({},_0x38c486,_0x53c4e6[_0xe9ae('0x51')]);return db['ChatMessage']['find'](_0x38c486)[_0xe9ae('0x22')](handleEntityNotFound(_0x132188,null))['then'](respondWithResult(_0x132188,null))['catch'](handleError(_0x132188,null));};exports[_0xe9ae('0x58')]=function(_0x1d6557,_0x2223a6){return db['ChatMessage'][_0xe9ae('0x58')](_0x1d6557['body'],{})[_0xe9ae('0x22')](respondWithResult(_0x2223a6,0xc9))['catch'](handleError(_0x2223a6,null));};exports[_0xe9ae('0x36')]=function(_0x31499f,_0x2b6ca4){if(_0x31499f[_0xe9ae('0x59')]['id']){delete _0x31499f[_0xe9ae('0x59')]['id'];}return db[_0xe9ae('0x3d')]['find']({'where':{'id':_0x31499f['params']['id']}})[_0xe9ae('0x22')](handleEntityNotFound(_0x2b6ca4,null))[_0xe9ae('0x22')](saveUpdates(_0x31499f[_0xe9ae('0x59')],null))[_0xe9ae('0x22')](respondWithResult(_0x2b6ca4,null))[_0xe9ae('0x5a')](handleError(_0x2b6ca4,null));};exports[_0xe9ae('0x37')]=function(_0xb796ae,_0x57d5b4){return db['ChatMessage'][_0xe9ae('0x5b')]({'where':{'id':_0xb796ae[_0xe9ae('0x56')]['id']}})[_0xe9ae('0x22')](handleEntityNotFound(_0x57d5b4,null))[_0xe9ae('0x22')](removeEntity(_0x57d5b4,null))[_0xe9ae('0x5a')](handleError(_0x57d5b4,null));};exports[_0xe9ae('0x5c')]=function(_0x249bae,_0x5ea1c5){return db[_0xe9ae('0x3d')]['describe']()['then'](respondWithResult(_0x5ea1c5,null))['catch'](handleError(_0x5ea1c5,null));};var interaction_log=require('../../config/logger')(_0xe9ae('0x5d'));exports['accept']=function(_0xfea2db,_0xa53777,_0x54cfd1){var _0x224e8f={'channel':_0xe9ae('0x5e')};if(_0xfea2db[_0xe9ae('0x59')]['id']){delete _0xfea2db[_0xe9ae('0x59')]['id'];}_0xfea2db[_0xe9ae('0x59')]['read']=!![];_0xfea2db[_0xe9ae('0x59')]['readAt']=moment()[_0xe9ae('0x5f')](_0xe9ae('0x60'));_0xfea2db['body']['UserId']=_0xfea2db[_0xe9ae('0x59')][_0xe9ae('0x61')]||_0xfea2db[_0xe9ae('0x62')]['id'];return db['ChatMessage'][_0xe9ae('0x5b')]({'where':{'id':_0xfea2db[_0xe9ae('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xe9ae('0x63')],'as':_0xe9ae('0x64')}]})[_0xe9ae('0x22')](handleEntityNotFound(_0xa53777,null))[_0xe9ae('0x22')](saveUpdates(_0xfea2db[_0xe9ae('0x59')],null))[_0xe9ae('0x22')](function(_0x30621e){if(_0x30621e){_0x224e8f['message']=_0x30621e['get']({'plain':!![]});return db['ChatInteraction'][_0xe9ae('0x5b')]({'where':{'id':_0x30621e[_0xe9ae('0x65')]}});}return null;})[_0xe9ae('0x22')](handleEntityNotFound(_0xa53777,null))['then'](function(_0x4d656d){if(_0x4d656d){return _0x4d656d['update']({'UserId':_0xfea2db[_0xe9ae('0x59')]['UserId'],'read1stAt':_[_0xe9ae('0x66')](_0x4d656d[_0xe9ae('0x67')])?moment()[_0xe9ae('0x5f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xe9ae('0x22')](function(_0x47f09d){if(_0x47f09d){_0x224e8f['interaction']=_0x47f09d[_0xe9ae('0x68')]({'plain':!![]});interaction_log[_0xe9ae('0x23')](_0xe9ae('0x69'),_0xfea2db[_0xe9ae('0x62')]['id'],_0xfea2db[_0xe9ae('0x62')]['name'],_0xfea2db['user'][_0xe9ae('0x6a')],_0x224e8f[_0xe9ae('0x6b')]['id'],_0xfea2db[_0xe9ae('0x59')]?JSON[_0xe9ae('0x6c')](_0xfea2db[_0xe9ae('0x59')]):'null');return respondWithRpcPromise(_0xe9ae('0x6d'),'acceptMessage',_0x224e8f);}return null;})[_0xe9ae('0x22')](function(_0x15e0b5){if(_0x15e0b5){if(_0xfea2db[_0xe9ae('0x59')][_0xe9ae('0x6e')]){_0x224e8f[_0xe9ae('0x28')][_0xe9ae('0x6f')]=util['format'](_0xe9ae('0x70'),_0xfea2db[_0xe9ae('0x62')][_0xe9ae('0x39')]);_0x224e8f['message'][_0xe9ae('0x71')]=_0x224e8f[_0xe9ae('0x71')];_0x224e8f[_0xe9ae('0x28')][_0xe9ae('0x72')]=_0xe9ae('0x73');return respondWithRpcPromise(_0xe9ae('0x74'),_0xe9ae('0x74'),{'event':_0xe9ae('0x75'),'message':_[_0xe9ae('0x4f')](_0x224e8f[_0xe9ae('0x28')],JSON[_0xe9ae('0x76')](_0x224e8f[_0xe9ae('0x6b')][_0xe9ae('0x77')]))},client9002)['then'](function(){return _0x224e8f;});}return _0x224e8f;}return null;})[_0xe9ae('0x22')](respondWithResult(_0xa53777,null))[_0xe9ae('0x5a')](handleError(_0xa53777,null));};var interaction_log=require(_0xe9ae('0x15'))(_0xe9ae('0x5d'));exports[_0xe9ae('0x34')]=function(_0xb6ae0b,_0x11aa97,_0x1507e8){var _0xefaaed={'agent':{},'channel':_0xe9ae('0x5e')};if(_0xb6ae0b[_0xe9ae('0x59')]['id']){delete _0xb6ae0b[_0xe9ae('0x59')]['id'];}_0xb6ae0b['body'][_0xe9ae('0x61')]=_0xb6ae0b[_0xe9ae('0x59')][_0xe9ae('0x61')]||_0xb6ae0b[_0xe9ae('0x62')]['id'];_0xefaaed['agent']['id']=_0xb6ae0b[_0xe9ae('0x59')][_0xe9ae('0x61')];return db['ChatMessage'][_0xe9ae('0x5b')]({'where':{'id':_0xb6ae0b[_0xe9ae('0x56')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x11aa97,null))[_0xe9ae('0x22')](function(_0x322750){if(_0x322750){_0xefaaed[_0xe9ae('0x28')]=_0x322750[_0xe9ae('0x68')]({'plain':!![]});return db[_0xe9ae('0x78')]['find']({'where':{'id':_0x322750[_0xe9ae('0x65')]}});}return null;})['then'](handleEntityNotFound(_0x11aa97,null))['then'](function(_0xa2eb2f){if(_0xa2eb2f){_0xefaaed[_0xe9ae('0x6b')]=_0xa2eb2f[_0xe9ae('0x68')]({'plain':!![]});interaction_log[_0xe9ae('0x23')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xb6ae0b[_0xe9ae('0x62')]['id'],_0xb6ae0b['user'][_0xe9ae('0x39')],_0xb6ae0b[_0xe9ae('0x62')][_0xe9ae('0x6a')],_0xefaaed[_0xe9ae('0x6b')]['id'],_0xb6ae0b[_0xe9ae('0x59')]?JSON[_0xe9ae('0x6c')](_0xb6ae0b[_0xe9ae('0x59')]):_0xe9ae('0x79'));return respondWithRpcPromise(_0xe9ae('0x7a'),_0xe9ae('0x7b'),_0xefaaed);}return null;})[_0xe9ae('0x22')](function(_0x25fa8f){if(_0x25fa8f){_0x25fa8f[_0xe9ae('0x28')][_0xe9ae('0x6f')]=util['format']('SIP/%s',_0xb6ae0b[_0xe9ae('0x62')][_0xe9ae('0x39')]);_0x25fa8f[_0xe9ae('0x28')][_0xe9ae('0x71')]=_0xefaaed['channel'];_0x25fa8f[_0xe9ae('0x28')]['event']=_0xe9ae('0x34');respondWithRpcPromise(_0xe9ae('0x74'),_0xe9ae('0x74'),{'event':_0xe9ae('0x7c'),'message':_0x25fa8f[_0xe9ae('0x28')]},client9002);return _0xefaaed;}return null;})[_0xe9ae('0x22')](respondWithResult(_0x11aa97,null))[_0xe9ae('0x5a')](handleError(_0x11aa97,null));}; \ No newline at end of file +var _0xa7a7=['chat','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','ChatInteraction','ChatInteractionId','update','isNil','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','interface','channel','accept','EventManager','acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','reject','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./chatMessage.socket','register','jayson/promise','http','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','offset','limit','set','Content-Range','apply','save','destroy','sendStatus','stack','name','send','index','map','ChatMessage','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','findAll','rows','params','find','create','body','describe','chat-interactions'];(function(_0x586205,_0x56f8ca){var _0x539adf=function(_0x1f409e){while(--_0x1f409e){_0x586205['push'](_0x586205['shift']());}};_0x539adf(++_0x56f8ca);}(_0xa7a7,0x121));var _0x7a7a=function(_0x32101e,_0x311809){_0x32101e=_0x32101e-0x0;var _0x4230fb=_0xa7a7[_0x32101e];return _0x4230fb;};'use strict';var pdf=require(_0x7a7a('0x0'));var emlformat=require(_0x7a7a('0x1'));var rimraf=require(_0x7a7a('0x2'));var zipdir=require(_0x7a7a('0x3'));var jsonpatch=require(_0x7a7a('0x4'));var rp=require('request-promise');var moment=require(_0x7a7a('0x5'));var BPromise=require(_0x7a7a('0x6'));var Mustache=require('mustache');var util=require(_0x7a7a('0x7'));var path=require(_0x7a7a('0x8'));var sox=require(_0x7a7a('0x9'));var csv=require('to-csv');var ejs=require(_0x7a7a('0xa'));var fs=require('fs');var _=require(_0x7a7a('0xb'));var squel=require(_0x7a7a('0xc'));var crypto=require('crypto');var jsforce=require(_0x7a7a('0xd'));var deskjs=require(_0x7a7a('0xe'));var toCsv=require(_0x7a7a('0xf'));var querystring=require('querystring');var Papa=require(_0x7a7a('0x10'));var Redis=require(_0x7a7a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7a7a('0x12'));var as=require(_0x7a7a('0x13'));var hardwareService=require(_0x7a7a('0x14'));var logger=require(_0x7a7a('0x15'))(_0x7a7a('0x16'));var utils=require(_0x7a7a('0x17'));var config=require(_0x7a7a('0x18'));var db=require(_0x7a7a('0x19'))['db'];config[_0x7a7a('0x1a')]=_[_0x7a7a('0x1b')](config[_0x7a7a('0x1a')],{'host':_0x7a7a('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7a7a('0x1a')]));require(_0x7a7a('0x1d'))[_0x7a7a('0x1e')](socket);var jayson=require(_0x7a7a('0x1f'));var client=jayson['client'][_0x7a7a('0x20')]({'port':0x232c});var client9002=jayson[_0x7a7a('0x21')][_0x7a7a('0x20')]({'port':0x232a});function checkPasswordPattern(_0x20c087,_0x129f78,_0x4ebabe){if(_0x4ebabe){var _0x303bbe=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x303bbe[_0x7a7a('0x22')](_0x129f78)){return _0x20c087;}else{throw new db['Sequelize'][(_0x7a7a('0x23'))](_0x7a7a('0x24'));}}else{return _0x20c087;}}function respondWithRpcPromise(_0x51cb18,_0xf13c54,_0x29fa19,_0x3f999f){return new BPromise(function(_0x3dda54,_0x5b49a1){var _0x17ebd4=_0x3f999f||client;return _0x17ebd4[_0x7a7a('0x25')](_0x51cb18,_0x29fa19)[_0x7a7a('0x26')](function(_0x58c341){logger[_0x7a7a('0x27')](_0x7a7a('0x28'),_0xf13c54,_0x7a7a('0x29'));logger[_0x7a7a('0x2a')](_0x7a7a('0x2b'),_0xf13c54,_0x7a7a('0x29'),JSON[_0x7a7a('0x2c')](_0x58c341));if(_0x58c341['error']){if(_0x58c341[_0x7a7a('0x2d')][_0x7a7a('0x2e')]===0x1f4){logger[_0x7a7a('0x2d')](_0x7a7a('0x28'),_0xf13c54,_0x58c341['error'][_0x7a7a('0x2f')]);return _0x5b49a1(_0x58c341[_0x7a7a('0x2d')][_0x7a7a('0x2f')]);}logger['error'](_0x7a7a('0x28'),_0xf13c54,_0x58c341[_0x7a7a('0x2d')][_0x7a7a('0x2f')]);return _0x3dda54(_0x58c341['error'][_0x7a7a('0x2f')]);}else{logger['info']('ChatMessage,\x20%s,\x20%s',_0xf13c54,_0x7a7a('0x29'));_0x3dda54(_0x58c341[_0x7a7a('0x30')][_0x7a7a('0x2f')]);}})[_0x7a7a('0x31')](function(_0x50edc4){logger['error'](_0x7a7a('0x28'),_0xf13c54,_0x50edc4);_0x5b49a1(_0x50edc4);});});}function respondWithStatusCode(_0xf9b223,_0x578473){_0x578473=_0x578473||0xcc;return function(_0x3060df){if(_0x3060df){return _0xf9b223['sendStatus'](_0x578473);}return _0xf9b223[_0x7a7a('0x32')](_0x578473)[_0x7a7a('0x33')]();};}function respondWithResult(_0x42d573,_0x12b22a){_0x12b22a=_0x12b22a||0xc8;return function(_0xa47b38){if(_0xa47b38){return _0x42d573['status'](_0x12b22a)[_0x7a7a('0x34')](_0xa47b38);}};}function respondWithFilteredResult(_0x35a61e,_0x23e913){return function(_0x25abab){if(_0x25abab){var _0x14b716=_0x25abab['count'],_0x40a54f=_0x23e913[_0x7a7a('0x35')],_0x8154a5=_0x23e913[_0x7a7a('0x35')]+_0x23e913[_0x7a7a('0x36')],_0x7179a8;if(_0x8154a5>=_0x14b716){_0x8154a5=_0x14b716;_0x7179a8=0xc8;}else{_0x7179a8=0xce;}_0x35a61e[_0x7a7a('0x32')](_0x7179a8);return _0x35a61e[_0x7a7a('0x37')](_0x7a7a('0x38'),_0x40a54f+'-'+_0x8154a5+'/'+_0x14b716)[_0x7a7a('0x34')](_0x25abab);}return null;};}function patchUpdates(_0x2093b4){return function(_0x2730a4){try{jsonpatch[_0x7a7a('0x39')](_0x2730a4,_0x2093b4,!![]);}catch(_0x508414){return BPromise['reject'](_0x508414);}return _0x2730a4[_0x7a7a('0x3a')]();};}function saveUpdates(_0x2866e3,_0x549f6a){return function(_0x2fd617){if(_0x2fd617){return _0x2fd617['update'](_0x2866e3)[_0x7a7a('0x26')](function(_0x58294d){return _0x58294d;});}return null;};}function removeEntity(_0x48cb36,_0x40ad7a){return function(_0x410692){if(_0x410692){return _0x410692[_0x7a7a('0x3b')]()[_0x7a7a('0x26')](function(){_0x48cb36[_0x7a7a('0x32')](0xcc)[_0x7a7a('0x33')]();});}};}function handleEntityNotFound(_0x293a35,_0x500c85){return function(_0x12639b){if(!_0x12639b){_0x293a35[_0x7a7a('0x3c')](0x194);}return _0x12639b;};}function handleError(_0x55acab,_0x1d6b61){_0x1d6b61=_0x1d6b61||0x1f4;return function(_0x2113fe){logger['error'](_0x2113fe[_0x7a7a('0x3d')]);if(_0x2113fe[_0x7a7a('0x3e')]){delete _0x2113fe[_0x7a7a('0x3e')];}_0x55acab[_0x7a7a('0x32')](_0x1d6b61)[_0x7a7a('0x3f')](_0x2113fe);};}exports[_0x7a7a('0x40')]=function(_0x10dd5c,_0x335426){var _0x1da800={},_0x4ba5ea={},_0x4ca0a4={'count':0x0,'rows':[]};var _0x4f625c=_[_0x7a7a('0x41')](db[_0x7a7a('0x42')][_0x7a7a('0x43')],function(_0x690f8a){return{'name':_0x690f8a[_0x7a7a('0x44')],'type':_0x690f8a[_0x7a7a('0x45')][_0x7a7a('0x46')]};});_0x4ba5ea[_0x7a7a('0x47')]=_[_0x7a7a('0x41')](_0x4f625c,_0x7a7a('0x3e'));_0x4ba5ea['query']=_[_0x7a7a('0x48')](_0x10dd5c[_0x7a7a('0x49')]);_0x4ba5ea[_0x7a7a('0x4a')]=_[_0x7a7a('0x4b')](_0x4ba5ea['model'],_0x4ba5ea[_0x7a7a('0x49')]);_0x1da800[_0x7a7a('0x4c')]=_['intersection'](_0x4ba5ea[_0x7a7a('0x47')],qs[_0x7a7a('0x4d')](_0x10dd5c[_0x7a7a('0x49')]['fields']));_0x1da800[_0x7a7a('0x4c')]=_0x1da800[_0x7a7a('0x4c')]['length']?_0x1da800[_0x7a7a('0x4c')]:_0x4ba5ea[_0x7a7a('0x47')];if(!_0x10dd5c[_0x7a7a('0x49')][_0x7a7a('0x4e')](_0x7a7a('0x4f'))){_0x1da800['limit']=qs[_0x7a7a('0x36')](_0x10dd5c[_0x7a7a('0x49')]['limit']);_0x1da800[_0x7a7a('0x35')]=qs[_0x7a7a('0x35')](_0x10dd5c['query']['offset']);}_0x1da800[_0x7a7a('0x50')]=qs[_0x7a7a('0x51')](_0x10dd5c['query']['sort']);_0x1da800['where']=qs[_0x7a7a('0x4a')](_[_0x7a7a('0x52')](_0x10dd5c[_0x7a7a('0x49')],_0x4ba5ea[_0x7a7a('0x4a')]));if(_0x10dd5c[_0x7a7a('0x49')][_0x7a7a('0x53')]){_0x1da800[_0x7a7a('0x54')]=_[_0x7a7a('0x55')](_0x1da800[_0x7a7a('0x54')],{'$or':_[_0x7a7a('0x41')](_0x4f625c,function(_0x5813e8){if(_0x5813e8[_0x7a7a('0x45')]!==_0x7a7a('0x56')){var _0x3954ea={};_0x3954ea[_0x5813e8['name']]={'$like':'%'+_0x10dd5c[_0x7a7a('0x49')]['filter']+'%'};return _0x3954ea;}})});}_0x1da800=_[_0x7a7a('0x55')]({},_0x1da800,_0x10dd5c[_0x7a7a('0x57')]);var _0xcc80e0={'where':_0x1da800['where']};return db[_0x7a7a('0x42')][_0x7a7a('0x58')](_0xcc80e0)[_0x7a7a('0x26')](function(_0x53fec8){_0x4ca0a4['count']=_0x53fec8;if(_0x10dd5c[_0x7a7a('0x49')][_0x7a7a('0x59')]){_0x1da800['include']=[{'all':!![]}];}return db[_0x7a7a('0x42')][_0x7a7a('0x5a')](_0x1da800);})[_0x7a7a('0x26')](function(_0x3a1b12){_0x4ca0a4[_0x7a7a('0x5b')]=_0x3a1b12;return _0x4ca0a4;})['then'](respondWithFilteredResult(_0x335426,_0x1da800))['catch'](handleError(_0x335426,null));};exports['show']=function(_0x1ce8f8,_0x528ff9){var _0x388f04={'raw':!![],'where':{'id':_0x1ce8f8[_0x7a7a('0x5c')]['id']}},_0x509aba={};_0x509aba['model']=_['keys'](db[_0x7a7a('0x42')][_0x7a7a('0x43')]);_0x509aba[_0x7a7a('0x49')]=_[_0x7a7a('0x48')](_0x1ce8f8[_0x7a7a('0x49')]);_0x509aba['filters']=_[_0x7a7a('0x4b')](_0x509aba['model'],_0x509aba[_0x7a7a('0x49')]);_0x388f04['attributes']=_[_0x7a7a('0x4b')](_0x509aba[_0x7a7a('0x47')],qs[_0x7a7a('0x4d')](_0x1ce8f8[_0x7a7a('0x49')][_0x7a7a('0x4d')]));_0x388f04[_0x7a7a('0x4c')]=_0x388f04[_0x7a7a('0x4c')]['length']?_0x388f04[_0x7a7a('0x4c')]:_0x509aba['model'];if(_0x1ce8f8[_0x7a7a('0x49')][_0x7a7a('0x59')]){_0x388f04['include']=[{'all':!![]}];}_0x388f04=_[_0x7a7a('0x55')]({},_0x388f04,_0x1ce8f8[_0x7a7a('0x57')]);return db[_0x7a7a('0x42')][_0x7a7a('0x5d')](_0x388f04)[_0x7a7a('0x26')](handleEntityNotFound(_0x528ff9,null))[_0x7a7a('0x26')](respondWithResult(_0x528ff9,null))[_0x7a7a('0x31')](handleError(_0x528ff9,null));};exports['create']=function(_0x1a86ee,_0x50f3e4){return db[_0x7a7a('0x42')][_0x7a7a('0x5e')](_0x1a86ee[_0x7a7a('0x5f')],{})[_0x7a7a('0x26')](respondWithResult(_0x50f3e4,0xc9))['catch'](handleError(_0x50f3e4,null));};exports['update']=function(_0x45b689,_0x16cefc){if(_0x45b689[_0x7a7a('0x5f')]['id']){delete _0x45b689[_0x7a7a('0x5f')]['id'];}return db['ChatMessage']['find']({'where':{'id':_0x45b689['params']['id']}})[_0x7a7a('0x26')](handleEntityNotFound(_0x16cefc,null))['then'](saveUpdates(_0x45b689[_0x7a7a('0x5f')],null))[_0x7a7a('0x26')](respondWithResult(_0x16cefc,null))[_0x7a7a('0x31')](handleError(_0x16cefc,null));};exports[_0x7a7a('0x3b')]=function(_0x348209,_0x1cf77e){return db[_0x7a7a('0x42')][_0x7a7a('0x5d')]({'where':{'id':_0x348209[_0x7a7a('0x5c')]['id']}})['then'](handleEntityNotFound(_0x1cf77e,null))[_0x7a7a('0x26')](removeEntity(_0x1cf77e,null))[_0x7a7a('0x31')](handleError(_0x1cf77e,null));};exports[_0x7a7a('0x60')]=function(_0x98331c,_0x5c7e30){return db['ChatMessage'][_0x7a7a('0x60')]()[_0x7a7a('0x26')](respondWithResult(_0x5c7e30,null))[_0x7a7a('0x31')](handleError(_0x5c7e30,null));};var interaction_log=require(_0x7a7a('0x15'))(_0x7a7a('0x61'));exports['accept']=function(_0x150983,_0x12a481,_0x143a9c){var _0x121943={'channel':_0x7a7a('0x62')};if(_0x150983[_0x7a7a('0x5f')]['id']){delete _0x150983[_0x7a7a('0x5f')]['id'];}_0x150983[_0x7a7a('0x5f')][_0x7a7a('0x63')]=!![];_0x150983[_0x7a7a('0x5f')]['readAt']=moment()[_0x7a7a('0x64')](_0x7a7a('0x65'));_0x150983['body'][_0x7a7a('0x66')]=_0x150983[_0x7a7a('0x5f')][_0x7a7a('0x66')]||_0x150983[_0x7a7a('0x67')]['id'];return db[_0x7a7a('0x42')][_0x7a7a('0x5d')]({'where':{'id':_0x150983[_0x7a7a('0x5c')]['id'],'UserId':null},'include':[{'model':db[_0x7a7a('0x68')],'as':_0x7a7a('0x69')}]})[_0x7a7a('0x26')](handleEntityNotFound(_0x12a481,null))[_0x7a7a('0x26')](saveUpdates(_0x150983[_0x7a7a('0x5f')],null))[_0x7a7a('0x26')](function(_0x23df59){if(_0x23df59){_0x121943[_0x7a7a('0x2f')]=_0x23df59[_0x7a7a('0x6a')]({'plain':!![]});return db[_0x7a7a('0x6b')][_0x7a7a('0x5d')]({'where':{'id':_0x23df59[_0x7a7a('0x6c')]}});}return null;})[_0x7a7a('0x26')](handleEntityNotFound(_0x12a481,null))[_0x7a7a('0x26')](function(_0x46b244){if(_0x46b244){return _0x46b244[_0x7a7a('0x6d')]({'UserId':_0x150983[_0x7a7a('0x5f')][_0x7a7a('0x66')],'read1stAt':_[_0x7a7a('0x6e')](_0x46b244['read1stAt'])?moment()[_0x7a7a('0x64')](_0x7a7a('0x65')):undefined});}return null;})['then'](function(_0x426600){if(_0x426600){_0x121943[_0x7a7a('0x6f')]=_0x426600[_0x7a7a('0x6a')]({'plain':!![]});interaction_log[_0x7a7a('0x27')](_0x7a7a('0x70'),_0x150983[_0x7a7a('0x67')]['id'],_0x150983[_0x7a7a('0x67')]['name'],_0x150983[_0x7a7a('0x67')]['role'],_0x121943[_0x7a7a('0x6f')]['id'],_0x150983[_0x7a7a('0x5f')]?JSON['stringify'](_0x150983[_0x7a7a('0x5f')]):_0x7a7a('0x71'));return respondWithRpcPromise(_0x7a7a('0x72'),'acceptMessage',_0x121943);}return null;})[_0x7a7a('0x26')](function(_0x103945){if(_0x103945){if(_0x150983['body']['manual']){_0x121943['message'][_0x7a7a('0x73')]=util[_0x7a7a('0x64')]('SIP/%s',_0x150983[_0x7a7a('0x67')]['name']);_0x121943['message'][_0x7a7a('0x74')]=_0x121943[_0x7a7a('0x74')];_0x121943[_0x7a7a('0x2f')]['event']=_0x7a7a('0x75');return respondWithRpcPromise(_0x7a7a('0x76'),_0x7a7a('0x76'),{'event':_0x7a7a('0x77'),'message':_[_0x7a7a('0x55')](_0x121943[_0x7a7a('0x2f')],JSON[_0x7a7a('0x78')](_0x121943[_0x7a7a('0x6f')][_0x7a7a('0x79')]))},client9002)['then'](function(){return _0x121943;});}return _0x121943;}return null;})[_0x7a7a('0x26')](respondWithResult(_0x12a481,null))[_0x7a7a('0x31')](handleError(_0x12a481,null));};var interaction_log=require(_0x7a7a('0x15'))('chat-interactions');exports['reject']=function(_0x54a2f1,_0x25d8d3,_0x48e7e0){var _0x3f99c1={'agent':{},'channel':'chat'};if(_0x54a2f1[_0x7a7a('0x5f')]['id']){delete _0x54a2f1['body']['id'];}_0x54a2f1[_0x7a7a('0x5f')]['UserId']=_0x54a2f1[_0x7a7a('0x5f')][_0x7a7a('0x66')]||_0x54a2f1[_0x7a7a('0x67')]['id'];_0x3f99c1[_0x7a7a('0x7a')]['id']=_0x54a2f1[_0x7a7a('0x5f')]['UserId'];return db[_0x7a7a('0x42')][_0x7a7a('0x5d')]({'where':{'id':_0x54a2f1[_0x7a7a('0x5c')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x25d8d3,null))['then'](function(_0x24dfbd){if(_0x24dfbd){_0x3f99c1['message']=_0x24dfbd[_0x7a7a('0x6a')]({'plain':!![]});return db[_0x7a7a('0x6b')]['find']({'where':{'id':_0x24dfbd[_0x7a7a('0x6c')]}});}return null;})[_0x7a7a('0x26')](handleEntityNotFound(_0x25d8d3,null))[_0x7a7a('0x26')](function(_0x309a79){if(_0x309a79){_0x3f99c1['interaction']=_0x309a79['get']({'plain':!![]});interaction_log[_0x7a7a('0x27')](_0x7a7a('0x7b'),_0x54a2f1[_0x7a7a('0x67')]['id'],_0x54a2f1[_0x7a7a('0x67')][_0x7a7a('0x3e')],_0x54a2f1[_0x7a7a('0x67')][_0x7a7a('0x7c')],_0x3f99c1[_0x7a7a('0x6f')]['id'],_0x54a2f1[_0x7a7a('0x5f')]?JSON[_0x7a7a('0x2c')](_0x54a2f1[_0x7a7a('0x5f')]):_0x7a7a('0x71'));return respondWithRpcPromise(_0x7a7a('0x7d'),_0x7a7a('0x7e'),_0x3f99c1);}return null;})[_0x7a7a('0x26')](function(_0x67789d){if(_0x67789d){_0x67789d[_0x7a7a('0x2f')]['interface']=util[_0x7a7a('0x64')]('SIP/%s',_0x54a2f1[_0x7a7a('0x67')][_0x7a7a('0x3e')]);_0x67789d['message'][_0x7a7a('0x74')]=_0x3f99c1[_0x7a7a('0x74')];_0x67789d[_0x7a7a('0x2f')]['event']=_0x7a7a('0x7f');respondWithRpcPromise('EventManager',_0x7a7a('0x76'),{'event':_0x7a7a('0x80'),'message':_0x67789d[_0x7a7a('0x2f')]},client9002);return _0x3f99c1;}return null;})[_0x7a7a('0x26')](respondWithResult(_0x25d8d3,null))[_0x7a7a('0x31')](handleError(_0x25d8d3,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index ef540ab..7b1839a 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 _0x8cea=['remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatMessage','update'];(function(_0x3e6401,_0x12ef0e){var _0x3b1f5a=function(_0x543cd7){while(--_0x543cd7){_0x3e6401['push'](_0x3e6401['shift']());}};_0x3b1f5a(++_0x12ef0e);}(_0x8cea,0x1cd));var _0xa8ce=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x8cea[_0x1a0ef3];return _0x2b86da;};'use strict';var EventEmitter=require('events');var ChatMessage=require(_0xa8ce('0x0'))['db'][_0xa8ce('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0xa8ce('0x2'),'afterDestroy':_0xa8ce('0x3')};function emitEvent(_0x42d3cb){return function(_0x59b66f,_0x1ee590,_0x33f9a8){ChatMessageEvents[_0xa8ce('0x4')](_0x42d3cb+':'+_0x59b66f['id'],_0x59b66f);ChatMessageEvents['emit'](_0x42d3cb,_0x59b66f);_0x33f9a8(null);};}for(var e in events){if(events[_0xa8ce('0x5')](e)){var event=events[e];ChatMessage[_0xa8ce('0x6')](e,emitEvent(event));}}module[_0xa8ce('0x7')]=ChatMessageEvents; \ No newline at end of file +var _0x5a63=['hasOwnProperty','hook','events','save','remove','emit'];(function(_0x1497fd,_0x34d210){var _0x576cdb=function(_0x2f2716){while(--_0x2f2716){_0x1497fd['push'](_0x1497fd['shift']());}};_0x576cdb(++_0x34d210);}(_0x5a63,0x68));var _0x35a6=function(_0x269748,_0x5ec7df){_0x269748=_0x269748-0x0;var _0xbfee08=_0x5a63[_0x269748];return _0xbfee08;};'use strict';var EventEmitter=require(_0x35a6('0x0'));var ChatMessage=require('../../mysqldb')['db']['ChatMessage'];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x35a6('0x1'),'afterUpdate':'update','afterDestroy':_0x35a6('0x2')};function emitEvent(_0x203555){return function(_0x40e1b5,_0x130e97,_0x5643d9){ChatMessageEvents[_0x35a6('0x3')](_0x203555+':'+_0x40e1b5['id'],_0x40e1b5);ChatMessageEvents[_0x35a6('0x3')](_0x203555,_0x40e1b5);_0x5643d9(null);};}for(var e in events){if(events[_0x35a6('0x4')](e)){var event=events[e];ChatMessage[_0x35a6('0x5')](e,emitEvent(event));}}module['exports']=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index e7399ea..a9b95cf 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 _0x7d26=['chat_messages','fti_chat_messages','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','ChatInteraction','findOne','then','update','createdAt','catch','utf8mb4','lodash','util','api','moment','bluebird','path','rimraf','./chatMessage.attributes','exports','ChatMessage'];(function(_0x1927d0,_0x3fdc9f){var _0x4b75a6=function(_0x451381){while(--_0x451381){_0x1927d0['push'](_0x1927d0['shift']());}};_0x4b75a6(++_0x3fdc9f);}(_0x7d26,0xe9));var _0x67d2=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7d26[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x67d2('0x0'));var util=require(_0x67d2('0x1'));var logger=require('../../config/logger')(_0x67d2('0x2'));var moment=require(_0x67d2('0x3'));var BPromise=require(_0x67d2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x67d2('0x5'));var rimraf=require(_0x67d2('0x6'));var config=require('../../config/environment');var attributes=require(_0x67d2('0x7'));module[_0x67d2('0x8')]=function(_0x11db8a,_0x279f34){return _0x11db8a['define'](_0x67d2('0x9'),attributes,{'tableName':_0x67d2('0xa'),'paranoid':![],'indexes':[{'name':_0x67d2('0xb'),'fields':['body'],'type':_0x67d2('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x254b45,_0x28e94f,_0x513c74){var _0x19b529=_0x11db8a[_0x67d2('0xd')];var _0x16f59d=_0x254b45['get']({'plain':!![]});if(_0x16f59d[_0x67d2('0xe')]['toLowerCase']()==='in'||_0x16f59d[_0x67d2('0xe')][_0x67d2('0xf')]()===_0x67d2('0x10')&&!_0x16f59d[_0x67d2('0x11')]&&!_[_0x67d2('0x12')](_0x16f59d[_0x67d2('0x13')])){_0x19b529[_0x67d2('0x14')][_0x67d2('0x15')]({'where':{'id':_0x16f59d['ChatInteractionId']}})[_0x67d2('0x16')](function(_0x55a8fd){if(_0x55a8fd){_0x55a8fd[_0x67d2('0x17')]({'lastMsgAt':_0x16f59d[_0x67d2('0x18')],'lastMsgDirection':_0x16f59d[_0x67d2('0xe')][_0x67d2('0xf')]()});}})[_0x67d2('0x19')](function(_0x34ed7d){console['error'](_0x34ed7d);});}_0x513c74();}},'charset':_0x67d2('0x1a'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xba89=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','ChatInteractionId','update','createdAt','catch','error','utf8mb4'];(function(_0x2c3273,_0x344653){var _0x139575=function(_0xd86348){while(--_0xd86348){_0x2c3273['push'](_0x2c3273['shift']());}};_0x139575(++_0x344653);}(_0xba89,0x1ee));var _0x9ba8=function(_0x5b733d,_0x272606){_0x5b733d=_0x5b733d-0x0;var _0x2b7995=_0xba89[_0x5b733d];return _0x2b7995;};'use strict';var _=require(_0x9ba8('0x0'));var util=require(_0x9ba8('0x1'));var logger=require(_0x9ba8('0x2'))(_0x9ba8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x9ba8('0x4'));var fs=require('fs');var path=require(_0x9ba8('0x5'));var rimraf=require('rimraf');var config=require(_0x9ba8('0x6'));var attributes=require(_0x9ba8('0x7'));module[_0x9ba8('0x8')]=function(_0x49820e,_0x3c5f62){return _0x49820e['define'](_0x9ba8('0x9'),attributes,{'tableName':_0x9ba8('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':[_0x9ba8('0xb')],'type':_0x9ba8('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d9e5e,_0x401afa,_0x3ccc40){var _0x9e0318=_0x49820e[_0x9ba8('0xd')];var _0x41d7f0=_0x5d9e5e[_0x9ba8('0xe')]({'plain':!![]});if(_0x41d7f0[_0x9ba8('0xf')][_0x9ba8('0x10')]()==='in'||_0x41d7f0[_0x9ba8('0xf')][_0x9ba8('0x10')]()===_0x9ba8('0x11')&&!_0x41d7f0[_0x9ba8('0x12')]&&!_[_0x9ba8('0x13')](_0x41d7f0[_0x9ba8('0x14')])){_0x9e0318['ChatInteraction'][_0x9ba8('0x15')]({'where':{'id':_0x41d7f0[_0x9ba8('0x16')]}})['then'](function(_0x534db4){if(_0x534db4){_0x534db4[_0x9ba8('0x17')]({'lastMsgAt':_0x41d7f0[_0x9ba8('0x18')],'lastMsgDirection':_0x41d7f0[_0x9ba8('0xf')][_0x9ba8('0x10')]()});}})[_0x9ba8('0x19')](function(_0x5c3b72){console[_0x9ba8('0x1a')](_0x5c3b72);});}_0x3ccc40();}},'charset':_0x9ba8('0x1b'),'collate':_0x9ba8('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index cd432e7..ada7a9e 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 _0xe2d3=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateChatMessage','ChatMessage','body','options','raw','lodash','util','moment','../../config/utils'];(function(_0x418627,_0x4e30ac){var _0x384d53=function(_0x4fcd61){while(--_0x4fcd61){_0x418627['push'](_0x418627['shift']());}};_0x384d53(++_0x4e30ac);}(_0xe2d3,0x125));var _0x3e2d=function(_0xefd519,_0xc62635){_0xefd519=_0xefd519-0x0;var _0x4bb882=_0xe2d3[_0xefd519];return _0x4bb882;};'use strict';var _=require(_0x3e2d('0x0'));var util=require(_0x3e2d('0x1'));var moment=require(_0x3e2d('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3e2d('0x3'));var logger=require(_0x3e2d('0x4'))(_0x3e2d('0x5'));var config=require(_0x3e2d('0x6'));var jayson=require(_0x3e2d('0x7'));var client=jayson[_0x3e2d('0x8')][_0x3e2d('0x9')]({'port':0x232a});config[_0x3e2d('0xa')]=_[_0x3e2d('0xb')](config[_0x3e2d('0xa')],{'host':_0x3e2d('0xc'),'port':0x18eb});var socket=require(_0x3e2d('0xd'))(new Redis(config[_0x3e2d('0xa')]));require(_0x3e2d('0xe'))[_0x3e2d('0xf')](socket);function respondWithRpcPromise(_0x54b6a9,_0x13ef0d,_0x38b189){return new BPromise(function(_0x300056,_0x5128e9){return client[_0x3e2d('0x10')](_0x54b6a9,_0x38b189)[_0x3e2d('0x11')](function(_0x4a581d){logger[_0x3e2d('0x12')](_0x3e2d('0x13'),_0x13ef0d,_0x3e2d('0x14'));logger[_0x3e2d('0x15')](_0x3e2d('0x16'),_0x13ef0d,_0x3e2d('0x14'),JSON[_0x3e2d('0x17')](_0x4a581d));if(_0x4a581d[_0x3e2d('0x18')]){if(_0x4a581d[_0x3e2d('0x18')]['code']===0x1f4){logger[_0x3e2d('0x18')]('ChatMessage,\x20%s,\x20%s',_0x13ef0d,_0x4a581d[_0x3e2d('0x18')][_0x3e2d('0x19')]);return _0x5128e9(_0x4a581d[_0x3e2d('0x18')][_0x3e2d('0x19')]);}logger[_0x3e2d('0x18')](_0x3e2d('0x13'),_0x13ef0d,_0x4a581d[_0x3e2d('0x18')]['message']);return _0x300056(_0x4a581d['error'][_0x3e2d('0x19')]);}else{logger[_0x3e2d('0x12')]('ChatMessage,\x20%s,\x20%s',_0x13ef0d,'request\x20sent');_0x300056(_0x4a581d[_0x3e2d('0x1a')]['message']);}})[_0x3e2d('0x1b')](function(_0x3296cc){logger[_0x3e2d('0x18')](_0x3e2d('0x13'),_0x13ef0d,_0x3296cc);_0x5128e9(_0x3296cc);});});}exports[_0x3e2d('0x1c')]=function(_0x41462b){var _0x2cd90a=this;return new Promise(function(_0x501f9b,_0x4935ed){return db[_0x3e2d('0x1d')]['create'](_0x41462b[_0x3e2d('0x1e')],{'raw':_0x41462b[_0x3e2d('0x1f')]?_0x41462b[_0x3e2d('0x1f')][_0x3e2d('0x20')]===undefined?!![]:![]:!![]})[_0x3e2d('0x11')](function(_0x102c84){logger['info']('CreateChatMessage',_0x41462b);logger['debug'](_0x3e2d('0x1c'),_0x41462b,JSON[_0x3e2d('0x17')](_0x102c84));_0x501f9b(_0x102c84);})[_0x3e2d('0x1b')](function(_0x5e82da){logger[_0x3e2d('0x18')](_0x3e2d('0x1c'),_0x5e82da[_0x3e2d('0x19')],_0x41462b);_0x4935ed(_0x2cd90a['error'](0x1f4,_0x5e82da[_0x3e2d('0x19')]));});});}; \ No newline at end of file +var _0xa614=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','defaults','redis','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','catch','CreateChatMessage','create','options','util','bluebird'];(function(_0x33048d,_0x102888){var _0x2e8618=function(_0x4ec74e){while(--_0x4ec74e){_0x33048d['push'](_0x33048d['shift']());}};_0x2e8618(++_0x102888);}(_0xa614,0x1da));var _0x4a61=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xa614[_0x2cc569];return _0x1bfc2e;};'use strict';var _=require('lodash');var util=require(_0x4a61('0x0'));var moment=require('moment');var BPromise=require(_0x4a61('0x1'));var rs=require(_0x4a61('0x2'));var fs=require('fs');var Redis=require(_0x4a61('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x4a61('0x4'));var logger=require(_0x4a61('0x5'))(_0x4a61('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4a61('0x7')]['http']({'port':0x232a});config['redis']=_[_0x4a61('0x8')](config[_0x4a61('0x9')],{'host':_0x4a61('0xa'),'port':0x18eb});var socket=require(_0x4a61('0xb'))(new Redis(config[_0x4a61('0x9')]));require('./chatMessage.socket')[_0x4a61('0xc')](socket);function respondWithRpcPromise(_0x3c7952,_0x5681c8,_0x2e7e32){return new BPromise(function(_0x2f22e9,_0x45d0c1){return client[_0x4a61('0xd')](_0x3c7952,_0x2e7e32)[_0x4a61('0xe')](function(_0xb520a0){logger[_0x4a61('0xf')](_0x4a61('0x10'),_0x5681c8,'request\x20sent');logger[_0x4a61('0x11')](_0x4a61('0x12'),_0x5681c8,'request\x20sent',JSON[_0x4a61('0x13')](_0xb520a0));if(_0xb520a0[_0x4a61('0x14')]){if(_0xb520a0['error'][_0x4a61('0x15')]===0x1f4){logger[_0x4a61('0x14')](_0x4a61('0x10'),_0x5681c8,_0xb520a0[_0x4a61('0x14')]['message']);return _0x45d0c1(_0xb520a0[_0x4a61('0x14')]['message']);}logger[_0x4a61('0x14')](_0x4a61('0x10'),_0x5681c8,_0xb520a0[_0x4a61('0x14')]['message']);return _0x2f22e9(_0xb520a0[_0x4a61('0x14')]['message']);}else{logger[_0x4a61('0xf')](_0x4a61('0x10'),_0x5681c8,'request\x20sent');_0x2f22e9(_0xb520a0[_0x4a61('0x16')][_0x4a61('0x17')]);}})[_0x4a61('0x18')](function(_0x259b37){logger[_0x4a61('0x14')]('ChatMessage,\x20%s,\x20%s',_0x5681c8,_0x259b37);_0x45d0c1(_0x259b37);});});}exports[_0x4a61('0x19')]=function(_0x53c12a){var _0x2fdd13=this;return new Promise(function(_0x5eb31e,_0x23d39e){return db['ChatMessage'][_0x4a61('0x1a')](_0x53c12a['body'],{'raw':_0x53c12a['options']?_0x53c12a[_0x4a61('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x4a61('0xe')](function(_0x3c4866){logger[_0x4a61('0xf')](_0x4a61('0x19'),_0x53c12a);logger['debug'](_0x4a61('0x19'),_0x53c12a,JSON[_0x4a61('0x13')](_0x3c4866));_0x5eb31e(_0x3c4866);})[_0x4a61('0x18')](function(_0x4e90f2){logger[_0x4a61('0x14')]('CreateChatMessage',_0x4e90f2['message'],_0x53c12a);_0x23d39e(_0x2fdd13[_0x4a61('0x14')](0x1f4,_0x4e90f2[_0x4a61('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 491e6ae..c0ca7ff 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 _0x4c60=['chatMessage:','./chatMessage.events','save','remove','update','removeListener','register','length'];(function(_0x1a11ae,_0x77dd3){var _0x36ea9d=function(_0x5255b6){while(--_0x5255b6){_0x1a11ae['push'](_0x1a11ae['shift']());}};_0x36ea9d(++_0x77dd3);}(_0x4c60,0xc1));var _0x04c6=function(_0x24adfb,_0x177f10){_0x24adfb=_0x24adfb-0x0;var _0xdc9ddf=_0x4c60[_0x24adfb];return _0xdc9ddf;};'use strict';var ChatMessageEvents=require(_0x04c6('0x0'));var events=[_0x04c6('0x1'),_0x04c6('0x2'),_0x04c6('0x3')];function createListener(_0x5ba768,_0x2a1d36){return function(_0x5d9fa3){_0x2a1d36['emit'](_0x5ba768,_0x5d9fa3);};}function removeListener(_0x4ad4f1,_0x53ca7a){return function(){ChatMessageEvents[_0x04c6('0x4')](_0x4ad4f1,_0x53ca7a);};}exports[_0x04c6('0x5')]=function(_0x2054da){for(var _0x12bd5d=0x0,_0x2b9041=events[_0x04c6('0x6')];_0x12bd5d<_0x2b9041;_0x12bd5d++){var _0x8f9b13=events[_0x12bd5d];var _0x530a48=createListener(_0x04c6('0x7')+_0x8f9b13,_0x2054da);ChatMessageEvents['on'](_0x8f9b13,_0x530a48);}}; \ No newline at end of file +var _0x2542=['chatMessage:','./chatMessage.events','save','remove','update','emit','removeListener','register','length'];(function(_0x322f57,_0x2edc00){var _0x30a911=function(_0x417cb7){while(--_0x417cb7){_0x322f57['push'](_0x322f57['shift']());}};_0x30a911(++_0x2edc00);}(_0x2542,0x169));var _0x2254=function(_0x45c230,_0x29b7df){_0x45c230=_0x45c230-0x0;var _0x522773=_0x2542[_0x45c230];return _0x522773;};'use strict';var ChatMessageEvents=require(_0x2254('0x0'));var events=[_0x2254('0x1'),_0x2254('0x2'),_0x2254('0x3')];function createListener(_0x578407,_0x105910){return function(_0x47b1da){_0x105910[_0x2254('0x4')](_0x578407,_0x47b1da);};}function removeListener(_0x3b3dcb,_0x27f5c9){return function(){ChatMessageEvents[_0x2254('0x5')](_0x3b3dcb,_0x27f5c9);};}exports[_0x2254('0x6')]=function(_0x508183){for(var _0x19ad3c=0x0,_0xe8ca50=events[_0x2254('0x7')];_0x19ad3c<_0xe8ca50;_0x19ad3c++){var _0x3c45ec=events[_0x19ad3c];var _0x1637ad=createListener(_0x2254('0x8')+_0x3c45ec,_0x508183);ChatMessageEvents['on'](_0x3c45ec,_0x1637ad);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index cfe9a69..ae71fba 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 _0x0fd6=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','post','tracked','chatmessage:create','create','put','/:id/accept','/:id/reject','reject','delete','/:id','exports','multer','util'];(function(_0x51880f,_0x2a948b){var _0x3422a9=function(_0x4b28d5){while(--_0x4b28d5){_0x51880f['push'](_0x51880f['shift']());}};_0x3422a9(++_0x2a948b);}(_0x0fd6,0x111));var _0x60fd=function(_0x28f7e1,_0x3d6924){_0x28f7e1=_0x28f7e1-0x0;var _0x495bb4=_0x0fd6[_0x28f7e1];return _0x495bb4;};'use strict';var multer=require(_0x60fd('0x0'));var util=require(_0x60fd('0x1'));var path=require(_0x60fd('0x2'));var timeout=require(_0x60fd('0x3'));var express=require(_0x60fd('0x4'));var router=express[_0x60fd('0x5')]();var auth=require(_0x60fd('0x6'));var interaction=require(_0x60fd('0x7'));var config=require(_0x60fd('0x8'));var controller=require(_0x60fd('0x9'));router[_0x60fd('0xa')]('/',auth[_0x60fd('0xb')](),controller['index']);router['get'](_0x60fd('0xc'),auth[_0x60fd('0xb')](),controller[_0x60fd('0xd')]);router['get']('/:id',auth[_0x60fd('0xb')](),controller['show']);router[_0x60fd('0xe')]('/',auth['isAuthenticated'](),interaction[_0x60fd('0xf')]('chat',_0x60fd('0x10')),controller[_0x60fd('0x11')]);router[_0x60fd('0x12')]('/:id',controller['update']);router[_0x60fd('0x12')](_0x60fd('0x13'),auth['isAuthenticated'](),controller['accept']);router['put'](_0x60fd('0x14'),auth[_0x60fd('0xb')](),controller[_0x60fd('0x15')]);router[_0x60fd('0x16')](_0x60fd('0x17'),auth[_0x60fd('0xb')](),controller['destroy']);module[_0x60fd('0x18')]=router; \ No newline at end of file +var _0x1ce5=['delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','isAuthenticated','describe','get','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject'];(function(_0x5897c0,_0x56533d){var _0x298c8e=function(_0x23a83f){while(--_0x23a83f){_0x5897c0['push'](_0x5897c0['shift']());}};_0x298c8e(++_0x56533d);}(_0x1ce5,0x99));var _0x51ce=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0x1ce5[_0x485b5a];return _0xd2b34d;};'use strict';var multer=require(_0x51ce('0x0'));var util=require('util');var path=require(_0x51ce('0x1'));var timeout=require(_0x51ce('0x2'));var express=require('express');var router=express[_0x51ce('0x3')]();var auth=require(_0x51ce('0x4'));var interaction=require(_0x51ce('0x5'));var config=require(_0x51ce('0x6'));var controller=require('./chatMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x51ce('0x7')]);router['get']('/describe',auth[_0x51ce('0x8')](),controller[_0x51ce('0x9')]);router[_0x51ce('0xa')](_0x51ce('0xb'),auth[_0x51ce('0x8')](),controller[_0x51ce('0xc')]);router[_0x51ce('0xd')]('/',auth['isAuthenticated'](),interaction[_0x51ce('0xe')](_0x51ce('0xf'),_0x51ce('0x10')),controller[_0x51ce('0x11')]);router[_0x51ce('0x12')](_0x51ce('0xb'),controller[_0x51ce('0x13')]);router[_0x51ce('0x12')]('/:id/accept',auth[_0x51ce('0x8')](),controller[_0x51ce('0x14')]);router[_0x51ce('0x12')](_0x51ce('0x15'),auth[_0x51ce('0x8')](),controller['reject']);router[_0x51ce('0x16')](_0x51ce('0xb'),auth[_0x51ce('0x8')](),controller[_0x51ce('0x17')]);module[_0x51ce('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index ccc5214..dde39f9 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 _0x4a26=['TEXT','medium','sequelize','exports'];(function(_0x4f32de,_0x5bd4a){var _0x149821=function(_0x205885){while(--_0x205885){_0x4f32de['push'](_0x4f32de['shift']());}};_0x149821(++_0x5bd4a);}(_0x4a26,0x13e));var _0x64a2=function(_0x376ab3,_0x47e7b2){_0x376ab3=_0x376ab3-0x0;var _0x11569b=_0x4a26[_0x376ab3];return _0x11569b;};'use strict';var Sequelize=require(_0x64a2('0x0'));module[_0x64a2('0x1')]={'body':{'type':Sequelize[_0x64a2('0x2')](_0x64a2('0x3')),'allowNull':![]}}; \ No newline at end of file +var _0x6955=['exports','TEXT'];(function(_0x4e33c0,_0x555fda){var _0x1f7aa3=function(_0x2b688b){while(--_0x2b688b){_0x4e33c0['push'](_0x4e33c0['shift']());}};_0x1f7aa3(++_0x555fda);}(_0x6955,0xbc));var _0x5695=function(_0x2792ef,_0x459a02){_0x2792ef=_0x2792ef-0x0;var _0x1d6d06=_0x6955[_0x2792ef];return _0x1d6d06;};'use strict';var Sequelize=require('sequelize');module[_0x5695('0x0')]={'body':{'type':Sequelize[_0x5695('0x1')]('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 0cba1f0..d929667 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 _0xd8b2=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','status','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','includeAll','include','ChatOfflineMessage','findAll','rows','catch','show','params','keys','options','find','create','body','describe','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0x1836d6,_0x234a1b){var _0x472587=function(_0x28a749){while(--_0x28a749){_0x1836d6['push'](_0x1836d6['shift']());}};_0x472587(++_0x234a1b);}(_0xd8b2,0x82));var _0x2d8b=function(_0x2af4cf,_0x1eb48c){_0x2af4cf=_0x2af4cf-0x0;var _0x1f9fd4=_0xd8b2[_0x2af4cf];return _0x1f9fd4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2d8b('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2d8b('0x1'));var jsonpatch=require(_0x2d8b('0x2'));var rp=require(_0x2d8b('0x3'));var moment=require(_0x2d8b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x2d8b('0x5'));var util=require(_0x2d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2d8b('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2d8b('0x8'));var crypto=require(_0x2d8b('0x9'));var jsforce=require(_0x2d8b('0xa'));var deskjs=require(_0x2d8b('0xb'));var toCsv=require(_0x2d8b('0xc'));var querystring=require('querystring');var Papa=require(_0x2d8b('0xd'));var Redis=require('ioredis');var authService=require(_0x2d8b('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x2d8b('0xf'));var hardwareService=require(_0x2d8b('0x10'));var logger=require('../../config/logger')(_0x2d8b('0x11'));var utils=require(_0x2d8b('0x12'));var config=require(_0x2d8b('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x334a49,_0x21ed76){_0x21ed76=_0x21ed76||0xcc;return function(_0x335ede){if(_0x335ede){return _0x334a49[_0x2d8b('0x14')](_0x21ed76);}return _0x334a49['status'](_0x21ed76)[_0x2d8b('0x15')]();};}function respondWithResult(_0xef8200,_0x59bdfe){_0x59bdfe=_0x59bdfe||0xc8;return function(_0x2521ad){if(_0x2521ad){return _0xef8200['status'](_0x59bdfe)[_0x2d8b('0x16')](_0x2521ad);}};}function respondWithFilteredResult(_0x524c1b,_0x3e3b7f){return function(_0x5cd74f){if(_0x5cd74f){var _0x1ec661=_0x5cd74f[_0x2d8b('0x17')],_0x3060c6=_0x3e3b7f[_0x2d8b('0x18')],_0x1ea8e8=_0x3e3b7f['offset']+_0x3e3b7f[_0x2d8b('0x19')],_0x39a0d6;if(_0x1ea8e8>=_0x1ec661){_0x1ea8e8=_0x1ec661;_0x39a0d6=0xc8;}else{_0x39a0d6=0xce;}_0x524c1b['status'](_0x39a0d6);return _0x524c1b['set'](_0x2d8b('0x1a'),_0x3060c6+'-'+_0x1ea8e8+'/'+_0x1ec661)[_0x2d8b('0x16')](_0x5cd74f);}return null;};}function patchUpdates(_0x4e92de){return function(_0x459eb6){try{jsonpatch[_0x2d8b('0x1b')](_0x459eb6,_0x4e92de,!![]);}catch(_0x5e4daa){return BPromise[_0x2d8b('0x1c')](_0x5e4daa);}return _0x459eb6[_0x2d8b('0x1d')]();};}function saveUpdates(_0x41625d,_0x4868de){return function(_0x218a8f){if(_0x218a8f){return _0x218a8f['update'](_0x41625d)[_0x2d8b('0x1e')](function(_0x43b2f3){return _0x43b2f3;});}return null;};}function removeEntity(_0x150891,_0x3bfd83){return function(_0x14ce0c){if(_0x14ce0c){return _0x14ce0c[_0x2d8b('0x1f')]()[_0x2d8b('0x1e')](function(){_0x150891[_0x2d8b('0x20')](0xcc)[_0x2d8b('0x15')]();});}};}function handleEntityNotFound(_0x860d29,_0x224389){return function(_0x10db4e){if(!_0x10db4e){_0x860d29[_0x2d8b('0x14')](0x194);}return _0x10db4e;};}function handleError(_0x312d14,_0x206ba1){_0x206ba1=_0x206ba1||0x1f4;return function(_0x7f9906){logger[_0x2d8b('0x21')](_0x7f9906[_0x2d8b('0x22')]);if(_0x7f9906['name']){delete _0x7f9906[_0x2d8b('0x23')];}_0x312d14[_0x2d8b('0x20')](_0x206ba1)[_0x2d8b('0x24')](_0x7f9906);};}exports[_0x2d8b('0x25')]=function(_0x19df5f,_0x390afe){var _0x55c314={},_0x60caea={},_0x4c7490={'count':0x0,'rows':[]};var _0x3bab82=_[_0x2d8b('0x26')](db['ChatOfflineMessage'][_0x2d8b('0x27')],function(_0x48fa8c){return{'name':_0x48fa8c[_0x2d8b('0x28')],'type':_0x48fa8c['type'][_0x2d8b('0x29')]};});_0x60caea[_0x2d8b('0x2a')]=_[_0x2d8b('0x26')](_0x3bab82,'name');_0x60caea['query']=_['keys'](_0x19df5f[_0x2d8b('0x2b')]);_0x60caea['filters']=_[_0x2d8b('0x2c')](_0x60caea[_0x2d8b('0x2a')],_0x60caea[_0x2d8b('0x2b')]);_0x55c314[_0x2d8b('0x2d')]=_[_0x2d8b('0x2c')](_0x60caea[_0x2d8b('0x2a')],qs[_0x2d8b('0x2e')](_0x19df5f['query'][_0x2d8b('0x2e')]));_0x55c314[_0x2d8b('0x2d')]=_0x55c314[_0x2d8b('0x2d')][_0x2d8b('0x2f')]?_0x55c314['attributes']:_0x60caea['model'];if(!_0x19df5f[_0x2d8b('0x2b')][_0x2d8b('0x30')](_0x2d8b('0x31'))){_0x55c314[_0x2d8b('0x19')]=qs[_0x2d8b('0x19')](_0x19df5f['query'][_0x2d8b('0x19')]);_0x55c314[_0x2d8b('0x18')]=qs[_0x2d8b('0x18')](_0x19df5f[_0x2d8b('0x2b')][_0x2d8b('0x18')]);}_0x55c314[_0x2d8b('0x32')]=qs[_0x2d8b('0x33')](_0x19df5f[_0x2d8b('0x2b')][_0x2d8b('0x33')]);_0x55c314[_0x2d8b('0x34')]=qs[_0x2d8b('0x35')](_[_0x2d8b('0x36')](_0x19df5f[_0x2d8b('0x2b')],_0x60caea[_0x2d8b('0x35')]));if(_0x19df5f['query']['filter']){_0x55c314['where']=_[_0x2d8b('0x37')](_0x55c314[_0x2d8b('0x34')],{'$or':_[_0x2d8b('0x26')](_0x3bab82,function(_0x17e8b3){if(_0x17e8b3['type']!==_0x2d8b('0x38')){var _0x30c701={};_0x30c701[_0x17e8b3[_0x2d8b('0x23')]]={'$like':'%'+_0x19df5f[_0x2d8b('0x2b')][_0x2d8b('0x39')]+'%'};return _0x30c701;}})});}_0x55c314=_[_0x2d8b('0x37')]({},_0x55c314,_0x19df5f['options']);var _0x3ac3ed={'where':_0x55c314['where']};return db['ChatOfflineMessage'][_0x2d8b('0x17')](_0x3ac3ed)[_0x2d8b('0x1e')](function(_0x2ca8d2){_0x4c7490['count']=_0x2ca8d2;if(_0x19df5f[_0x2d8b('0x2b')][_0x2d8b('0x3a')]){_0x55c314[_0x2d8b('0x3b')]=[{'all':!![]}];}return db[_0x2d8b('0x3c')][_0x2d8b('0x3d')](_0x55c314);})[_0x2d8b('0x1e')](function(_0x5ae5ad){_0x4c7490[_0x2d8b('0x3e')]=_0x5ae5ad;return _0x4c7490;})[_0x2d8b('0x1e')](respondWithFilteredResult(_0x390afe,_0x55c314))[_0x2d8b('0x3f')](handleError(_0x390afe,null));};exports[_0x2d8b('0x40')]=function(_0x40f30b,_0x48af74){var _0x18f91f={'raw':!![],'where':{'id':_0x40f30b[_0x2d8b('0x41')]['id']}},_0x5b9a63={};_0x5b9a63[_0x2d8b('0x2a')]=_[_0x2d8b('0x42')](db[_0x2d8b('0x3c')]['rawAttributes']);_0x5b9a63[_0x2d8b('0x2b')]=_[_0x2d8b('0x42')](_0x40f30b[_0x2d8b('0x2b')]);_0x5b9a63[_0x2d8b('0x35')]=_[_0x2d8b('0x2c')](_0x5b9a63['model'],_0x5b9a63[_0x2d8b('0x2b')]);_0x18f91f['attributes']=_['intersection'](_0x5b9a63[_0x2d8b('0x2a')],qs[_0x2d8b('0x2e')](_0x40f30b[_0x2d8b('0x2b')]['fields']));_0x18f91f[_0x2d8b('0x2d')]=_0x18f91f['attributes']['length']?_0x18f91f[_0x2d8b('0x2d')]:_0x5b9a63[_0x2d8b('0x2a')];if(_0x40f30b['query'][_0x2d8b('0x3a')]){_0x18f91f[_0x2d8b('0x3b')]=[{'all':!![]}];}_0x18f91f=_[_0x2d8b('0x37')]({},_0x18f91f,_0x40f30b[_0x2d8b('0x43')]);return db['ChatOfflineMessage'][_0x2d8b('0x44')](_0x18f91f)[_0x2d8b('0x1e')](handleEntityNotFound(_0x48af74,null))[_0x2d8b('0x1e')](respondWithResult(_0x48af74,null))['catch'](handleError(_0x48af74,null));};exports[_0x2d8b('0x45')]=function(_0x2ea1a2,_0x3229e7){return db[_0x2d8b('0x3c')]['create'](_0x2ea1a2[_0x2d8b('0x46')],{})[_0x2d8b('0x1e')](respondWithResult(_0x3229e7,0xc9))['catch'](handleError(_0x3229e7,null));};exports['update']=function(_0x5cf6a6,_0xdac1a0){if(_0x5cf6a6[_0x2d8b('0x46')]['id']){delete _0x5cf6a6[_0x2d8b('0x46')]['id'];}return db[_0x2d8b('0x3c')][_0x2d8b('0x44')]({'where':{'id':_0x5cf6a6['params']['id']}})['then'](handleEntityNotFound(_0xdac1a0,null))[_0x2d8b('0x1e')](saveUpdates(_0x5cf6a6[_0x2d8b('0x46')],null))[_0x2d8b('0x1e')](respondWithResult(_0xdac1a0,null))[_0x2d8b('0x3f')](handleError(_0xdac1a0,null));};exports[_0x2d8b('0x1f')]=function(_0x8f96f1,_0x20a0fe){return db[_0x2d8b('0x3c')][_0x2d8b('0x44')]({'where':{'id':_0x8f96f1[_0x2d8b('0x41')]['id']}})[_0x2d8b('0x1e')](handleEntityNotFound(_0x20a0fe,null))['then'](removeEntity(_0x20a0fe,null))[_0x2d8b('0x3f')](handleError(_0x20a0fe,null));};exports[_0x2d8b('0x47')]=function(_0x40682a,_0x936e36){return db[_0x2d8b('0x3c')][_0x2d8b('0x47')]()[_0x2d8b('0x1e')](respondWithResult(_0x936e36,null))[_0x2d8b('0x3f')](handleError(_0x936e36,null));}; \ No newline at end of file +var _0x8c5f=['status','error','name','index','map','rawAttributes','fieldName','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','options','ChatOfflineMessage','includeAll','findAll','catch','show','params','include','create','body','find','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x8c5f,0x188));var _0xf8c5=function(_0x3e63ea,_0x3b2856){_0x3e63ea=_0x3e63ea-0x0;var _0xca51f5=_0x8c5f[_0x3e63ea];return _0xca51f5;};'use strict';var pdf=require(_0xf8c5('0x0'));var emlformat=require(_0xf8c5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf8c5('0x2'));var jsonpatch=require(_0xf8c5('0x3'));var rp=require('request-promise');var moment=require(_0xf8c5('0x4'));var BPromise=require(_0xf8c5('0x5'));var Mustache=require(_0xf8c5('0x6'));var util=require(_0xf8c5('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xf8c5('0x8'));var ejs=require(_0xf8c5('0x9'));var fs=require('fs');var _=require(_0xf8c5('0xa'));var squel=require(_0xf8c5('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf8c5('0xc'));var toCsv=require(_0xf8c5('0x8'));var querystring=require(_0xf8c5('0xd'));var Papa=require('papaparse');var Redis=require(_0xf8c5('0xe'));var authService=require(_0xf8c5('0xf'));var qs=require(_0xf8c5('0x10'));var as=require(_0xf8c5('0x11'));var hardwareService=require(_0xf8c5('0x12'));var logger=require('../../config/logger')(_0xf8c5('0x13'));var utils=require(_0xf8c5('0x14'));var config=require(_0xf8c5('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x244f5f,_0xad49f9){_0xad49f9=_0xad49f9||0xcc;return function(_0x3be4d8){if(_0x3be4d8){return _0x244f5f[_0xf8c5('0x16')](_0xad49f9);}return _0x244f5f['status'](_0xad49f9)[_0xf8c5('0x17')]();};}function respondWithResult(_0x1eb7b3,_0x51b985){_0x51b985=_0x51b985||0xc8;return function(_0x3d3e92){if(_0x3d3e92){return _0x1eb7b3['status'](_0x51b985)[_0xf8c5('0x18')](_0x3d3e92);}};}function respondWithFilteredResult(_0x20f5d5,_0x41fbbe){return function(_0xbf8b8e){if(_0xbf8b8e){var _0x75a5a4=_0xbf8b8e[_0xf8c5('0x19')],_0x356ea2=_0x41fbbe[_0xf8c5('0x1a')],_0x3d99b0=_0x41fbbe['offset']+_0x41fbbe[_0xf8c5('0x1b')],_0x1d4ee4;if(_0x3d99b0>=_0x75a5a4){_0x3d99b0=_0x75a5a4;_0x1d4ee4=0xc8;}else{_0x1d4ee4=0xce;}_0x20f5d5['status'](_0x1d4ee4);return _0x20f5d5[_0xf8c5('0x1c')](_0xf8c5('0x1d'),_0x356ea2+'-'+_0x3d99b0+'/'+_0x75a5a4)[_0xf8c5('0x18')](_0xbf8b8e);}return null;};}function patchUpdates(_0x31121f){return function(_0x3da96a){try{jsonpatch[_0xf8c5('0x1e')](_0x3da96a,_0x31121f,!![]);}catch(_0x4654ef){return BPromise[_0xf8c5('0x1f')](_0x4654ef);}return _0x3da96a[_0xf8c5('0x20')]();};}function saveUpdates(_0x6c815a,_0xe0336){return function(_0x8361be){if(_0x8361be){return _0x8361be['update'](_0x6c815a)['then'](function(_0x209b5c){return _0x209b5c;});}return null;};}function removeEntity(_0x2c95fd,_0x4df195){return function(_0x3c2e0c){if(_0x3c2e0c){return _0x3c2e0c['destroy']()[_0xf8c5('0x21')](function(){_0x2c95fd[_0xf8c5('0x22')](0xcc)[_0xf8c5('0x17')]();});}};}function handleEntityNotFound(_0x5c60b5,_0x2e0eba){return function(_0x4cd568){if(!_0x4cd568){_0x5c60b5['sendStatus'](0x194);}return _0x4cd568;};}function handleError(_0x4ee3f5,_0x2879a2){_0x2879a2=_0x2879a2||0x1f4;return function(_0x66c40e){logger[_0xf8c5('0x23')](_0x66c40e['stack']);if(_0x66c40e['name']){delete _0x66c40e[_0xf8c5('0x24')];}_0x4ee3f5[_0xf8c5('0x22')](_0x2879a2)['send'](_0x66c40e);};}exports[_0xf8c5('0x25')]=function(_0x169020,_0x1cfa97){var _0x27cc56={},_0x53e502={},_0x39479b={'count':0x0,'rows':[]};var _0x20dd68=_[_0xf8c5('0x26')](db['ChatOfflineMessage'][_0xf8c5('0x27')],function(_0x5c661b){return{'name':_0x5c661b[_0xf8c5('0x28')],'type':_0x5c661b['type'][_0xf8c5('0x29')]};});_0x53e502['model']=_[_0xf8c5('0x26')](_0x20dd68,_0xf8c5('0x24'));_0x53e502[_0xf8c5('0x2a')]=_[_0xf8c5('0x2b')](_0x169020[_0xf8c5('0x2a')]);_0x53e502[_0xf8c5('0x2c')]=_[_0xf8c5('0x2d')](_0x53e502[_0xf8c5('0x2e')],_0x53e502[_0xf8c5('0x2a')]);_0x27cc56['attributes']=_[_0xf8c5('0x2d')](_0x53e502['model'],qs[_0xf8c5('0x2f')](_0x169020[_0xf8c5('0x2a')]['fields']));_0x27cc56[_0xf8c5('0x30')]=_0x27cc56[_0xf8c5('0x30')][_0xf8c5('0x31')]?_0x27cc56[_0xf8c5('0x30')]:_0x53e502[_0xf8c5('0x2e')];if(!_0x169020[_0xf8c5('0x2a')][_0xf8c5('0x32')](_0xf8c5('0x33'))){_0x27cc56[_0xf8c5('0x1b')]=qs[_0xf8c5('0x1b')](_0x169020[_0xf8c5('0x2a')][_0xf8c5('0x1b')]);_0x27cc56['offset']=qs[_0xf8c5('0x1a')](_0x169020[_0xf8c5('0x2a')][_0xf8c5('0x1a')]);}_0x27cc56['order']=qs[_0xf8c5('0x34')](_0x169020[_0xf8c5('0x2a')][_0xf8c5('0x34')]);_0x27cc56[_0xf8c5('0x35')]=qs[_0xf8c5('0x2c')](_[_0xf8c5('0x36')](_0x169020[_0xf8c5('0x2a')],_0x53e502[_0xf8c5('0x2c')]));if(_0x169020[_0xf8c5('0x2a')][_0xf8c5('0x37')]){_0x27cc56[_0xf8c5('0x35')]=_[_0xf8c5('0x38')](_0x27cc56[_0xf8c5('0x35')],{'$or':_[_0xf8c5('0x26')](_0x20dd68,function(_0x481d17){if(_0x481d17[_0xf8c5('0x39')]!=='VIRTUAL'){var _0x8f62ae={};_0x8f62ae[_0x481d17[_0xf8c5('0x24')]]={'$like':'%'+_0x169020[_0xf8c5('0x2a')][_0xf8c5('0x37')]+'%'};return _0x8f62ae;}})});}_0x27cc56=_[_0xf8c5('0x38')]({},_0x27cc56,_0x169020[_0xf8c5('0x3a')]);var _0x3b41ec={'where':_0x27cc56['where']};return db[_0xf8c5('0x3b')][_0xf8c5('0x19')](_0x3b41ec)[_0xf8c5('0x21')](function(_0x141654){_0x39479b[_0xf8c5('0x19')]=_0x141654;if(_0x169020[_0xf8c5('0x2a')][_0xf8c5('0x3c')]){_0x27cc56['include']=[{'all':!![]}];}return db[_0xf8c5('0x3b')][_0xf8c5('0x3d')](_0x27cc56);})[_0xf8c5('0x21')](function(_0x12feb9){_0x39479b['rows']=_0x12feb9;return _0x39479b;})[_0xf8c5('0x21')](respondWithFilteredResult(_0x1cfa97,_0x27cc56))[_0xf8c5('0x3e')](handleError(_0x1cfa97,null));};exports[_0xf8c5('0x3f')]=function(_0x3b5e62,_0x354009){var _0x1c9f35={'raw':!![],'where':{'id':_0x3b5e62[_0xf8c5('0x40')]['id']}},_0x22edf3={};_0x22edf3[_0xf8c5('0x2e')]=_['keys'](db[_0xf8c5('0x3b')][_0xf8c5('0x27')]);_0x22edf3[_0xf8c5('0x2a')]=_[_0xf8c5('0x2b')](_0x3b5e62['query']);_0x22edf3[_0xf8c5('0x2c')]=_[_0xf8c5('0x2d')](_0x22edf3[_0xf8c5('0x2e')],_0x22edf3[_0xf8c5('0x2a')]);_0x1c9f35[_0xf8c5('0x30')]=_[_0xf8c5('0x2d')](_0x22edf3['model'],qs[_0xf8c5('0x2f')](_0x3b5e62[_0xf8c5('0x2a')][_0xf8c5('0x2f')]));_0x1c9f35[_0xf8c5('0x30')]=_0x1c9f35[_0xf8c5('0x30')][_0xf8c5('0x31')]?_0x1c9f35[_0xf8c5('0x30')]:_0x22edf3['model'];if(_0x3b5e62[_0xf8c5('0x2a')][_0xf8c5('0x3c')]){_0x1c9f35[_0xf8c5('0x41')]=[{'all':!![]}];}_0x1c9f35=_[_0xf8c5('0x38')]({},_0x1c9f35,_0x3b5e62['options']);return db[_0xf8c5('0x3b')]['find'](_0x1c9f35)['then'](handleEntityNotFound(_0x354009,null))[_0xf8c5('0x21')](respondWithResult(_0x354009,null))['catch'](handleError(_0x354009,null));};exports[_0xf8c5('0x42')]=function(_0x3ec124,_0x2d409f){return db[_0xf8c5('0x3b')][_0xf8c5('0x42')](_0x3ec124[_0xf8c5('0x43')],{})[_0xf8c5('0x21')](respondWithResult(_0x2d409f,0xc9))['catch'](handleError(_0x2d409f,null));};exports['update']=function(_0x258444,_0x8e65cb){if(_0x258444[_0xf8c5('0x43')]['id']){delete _0x258444['body']['id'];}return db[_0xf8c5('0x3b')][_0xf8c5('0x44')]({'where':{'id':_0x258444['params']['id']}})['then'](handleEntityNotFound(_0x8e65cb,null))[_0xf8c5('0x21')](saveUpdates(_0x258444['body'],null))['then'](respondWithResult(_0x8e65cb,null))['catch'](handleError(_0x8e65cb,null));};exports[_0xf8c5('0x45')]=function(_0x419ac6,_0x53004d){return db['ChatOfflineMessage']['find']({'where':{'id':_0x419ac6[_0xf8c5('0x40')]['id']}})['then'](handleEntityNotFound(_0x53004d,null))[_0xf8c5('0x21')](removeEntity(_0x53004d,null))[_0xf8c5('0x3e')](handleError(_0x53004d,null));};exports[_0xf8c5('0x46')]=function(_0xae4406,_0x386ee7){return db[_0xf8c5('0x3b')]['describe']()['then'](respondWithResult(_0x386ee7,null))[_0xf8c5('0x3e')](handleError(_0x386ee7,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 130ed51..1fd8a1c 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 _0xaba6=['utf8mb4','lodash','util','request-promise','path','../../config/environment','./chatOfflineMessage.attributes','define','chat_offline_messages'];(function(_0x2cb18d,_0x1378fb){var _0x5491a5=function(_0x1d24b9){while(--_0x1d24b9){_0x2cb18d['push'](_0x2cb18d['shift']());}};_0x5491a5(++_0x1378fb);}(_0xaba6,0xe2));var _0x6aba=function(_0x13fdb3,_0x493557){_0x13fdb3=_0x13fdb3-0x0;var _0x212e46=_0xaba6[_0x13fdb3];return _0x212e46;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6aba('0x2'));var fs=require('fs');var path=require(_0x6aba('0x3'));var rimraf=require('rimraf');var config=require(_0x6aba('0x4'));var attributes=require(_0x6aba('0x5'));module['exports']=function(_0x4e929a,_0x5ae14c){return _0x4e929a[_0x6aba('0x6')]('ChatOfflineMessage',attributes,{'tableName':_0x6aba('0x7'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6aba('0x8'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0b78=['moment','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b78,0x1ad));var _0x80b7=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0b78[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var logger=require('../../config/logger')(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x80b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var attributes=require(_0x80b7('0x7'));module['exports']=function(_0x49bc7f,_0x167ddd){return _0x49bc7f['define'](_0x80b7('0x8'),attributes,{'tableName':_0x80b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80b7('0xa'),'collate':_0x80b7('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 429f389..2943872 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 _0x7010=['request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s'];(function(_0x708c83,_0xf9f8e7){var _0x280e8f=function(_0x52aba4){while(--_0x52aba4){_0x708c83['push'](_0x708c83['shift']());}};_0x280e8f(++_0xf9f8e7);}(_0x7010,0x117));var _0x0701=function(_0x1fd36d,_0x3a075d){_0x1fd36d=_0x1fd36d-0x0;var _0x26ca71=_0x7010[_0x1fd36d];return _0x26ca71;};'use strict';var _=require(_0x0701('0x0'));var util=require(_0x0701('0x1'));var moment=require(_0x0701('0x2'));var BPromise=require(_0x0701('0x3'));var rs=require(_0x0701('0x4'));var fs=require('fs');var Redis=require(_0x0701('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0701('0x6'));var logger=require(_0x0701('0x7'))(_0x0701('0x8'));var config=require(_0x0701('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0701('0xa')][_0x0701('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x44b92b,_0x176455,_0x150983){return new BPromise(function(_0x230544,_0x45edc1){return client[_0x0701('0xc')](_0x44b92b,_0x150983)['then'](function(_0x1be068){logger[_0x0701('0xd')](_0x0701('0xe'),_0x176455,_0x0701('0xf'));logger[_0x0701('0x10')](_0x0701('0x11'),_0x176455,_0x0701('0xf'),JSON[_0x0701('0x12')](_0x1be068));if(_0x1be068[_0x0701('0x13')]){if(_0x1be068[_0x0701('0x13')]['code']===0x1f4){logger[_0x0701('0x13')](_0x0701('0xe'),_0x176455,_0x1be068[_0x0701('0x13')][_0x0701('0x14')]);return _0x45edc1(_0x1be068[_0x0701('0x13')][_0x0701('0x14')]);}logger[_0x0701('0x13')](_0x0701('0xe'),_0x176455,_0x1be068[_0x0701('0x13')][_0x0701('0x14')]);return _0x230544(_0x1be068['error']['message']);}else{logger['info'](_0x0701('0xe'),_0x176455,_0x0701('0xf'));_0x230544(_0x1be068['result']['message']);}})['catch'](function(_0x4a39e9){logger[_0x0701('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x176455,_0x4a39e9);_0x45edc1(_0x4a39e9);});});} \ No newline at end of file +var _0x11f2=['result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info'];(function(_0x136cbb,_0x2a97f9){var _0x333a69=function(_0x5dc5bb){while(--_0x5dc5bb){_0x136cbb['push'](_0x136cbb['shift']());}};_0x333a69(++_0x2a97f9);}(_0x11f2,0x1cf));var _0x211f=function(_0xe74143,_0x1ea43d){_0xe74143=_0xe74143-0x0;var _0x25c6e9=_0x11f2[_0xe74143];return _0x25c6e9;};'use strict';var _=require('lodash');var util=require(_0x211f('0x0'));var moment=require(_0x211f('0x1'));var BPromise=require(_0x211f('0x2'));var rs=require(_0x211f('0x3'));var fs=require('fs');var Redis=require(_0x211f('0x4'));var db=require(_0x211f('0x5'))['db'];var utils=require(_0x211f('0x6'));var logger=require(_0x211f('0x7'))(_0x211f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x211f('0x9')][_0x211f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ed04c,_0x4054db,_0x13b99d){return new BPromise(function(_0x27d649,_0x345b57){return client['request'](_0x5ed04c,_0x13b99d)['then'](function(_0x1aec8c){logger['info'](_0x211f('0xb'),_0x4054db,_0x211f('0xc'));logger[_0x211f('0xd')](_0x211f('0xe'),_0x4054db,_0x211f('0xc'),JSON[_0x211f('0xf')](_0x1aec8c));if(_0x1aec8c[_0x211f('0x10')]){if(_0x1aec8c[_0x211f('0x10')][_0x211f('0x11')]===0x1f4){logger['error'](_0x211f('0xb'),_0x4054db,_0x1aec8c[_0x211f('0x10')][_0x211f('0x12')]);return _0x345b57(_0x1aec8c['error'][_0x211f('0x12')]);}logger[_0x211f('0x10')](_0x211f('0xb'),_0x4054db,_0x1aec8c['error']['message']);return _0x27d649(_0x1aec8c[_0x211f('0x10')][_0x211f('0x12')]);}else{logger[_0x211f('0x13')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4054db,_0x211f('0xc'));_0x27d649(_0x1aec8c[_0x211f('0x14')]['message']);}})['catch'](function(_0x2b070e){logger[_0x211f('0x10')](_0x211f('0xb'),_0x4054db,_0x2b070e);_0x345b57(_0x2b070e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 40bda11..ff9044f 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 _0xf80d=['delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0xbf6a2b,_0x687c57){var _0x1257c2=function(_0x3c5657){while(--_0x3c5657){_0xbf6a2b['push'](_0xbf6a2b['shift']());}};_0x1257c2(++_0x687c57);}(_0xf80d,0x1b3));var _0xdf80=function(_0x15a634,_0x4feb86){_0x15a634=_0x15a634-0x0;var _0xf4f7a0=_0xf80d[_0x15a634];return _0xf4f7a0;};'use strict';var multer=require(_0xdf80('0x0'));var util=require(_0xdf80('0x1'));var path=require(_0xdf80('0x2'));var timeout=require(_0xdf80('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xdf80('0x4'));var interaction=require(_0xdf80('0x5'));var config=require(_0xdf80('0x6'));var controller=require('./chatOfflineMessage.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdf80('0x7')]);router['get'](_0xdf80('0x8'),auth[_0xdf80('0x9')](),controller[_0xdf80('0xa')]);router['get'](_0xdf80('0xb'),auth['isAuthenticated'](),controller[_0xdf80('0xc')]);router['post']('/',auth[_0xdf80('0x9')](),controller['create']);router['put'](_0xdf80('0xb'),auth[_0xdf80('0x9')](),controller['update']);router[_0xdf80('0xd')](_0xdf80('0xb'),auth[_0xdf80('0x9')](),controller[_0xdf80('0xe')]);module[_0xdf80('0xf')]=router; \ No newline at end of file +var _0xd154=['show','post','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd154,0xde));var _0x4d15=function(_0x112f19,_0x2c6350){_0x112f19=_0x112f19-0x0;var _0x1a4455=_0xd154[_0x112f19];return _0x1a4455;};'use strict';var multer=require(_0x4d15('0x0'));var util=require('util');var path=require(_0x4d15('0x1'));var timeout=require('connect-timeout');var express=require(_0x4d15('0x2'));var router=express[_0x4d15('0x3')]();var auth=require(_0x4d15('0x4'));var interaction=require(_0x4d15('0x5'));var config=require(_0x4d15('0x6'));var controller=require('./chatOfflineMessage.controller');router[_0x4d15('0x7')]('/',auth[_0x4d15('0x8')](),controller[_0x4d15('0x9')]);router['get'](_0x4d15('0xa'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x4d15('0xb'),auth[_0x4d15('0x8')](),controller[_0x4d15('0xc')]);router[_0x4d15('0xd')]('/',auth[_0x4d15('0x8')](),controller['create']);router[_0x4d15('0xe')](_0x4d15('0xb'),auth['isAuthenticated'](),controller[_0x4d15('0xf')]);router[_0x4d15('0x10')]('/:id',auth[_0x4d15('0x8')](),controller[_0x4d15('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.attributes.js b/server/api/chatProactiveAction/chatProactiveAction.attributes.js index bb85f32..cc28487 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 _0x60e9=['mouseOver','timeout','INTEGER','sequelize','exports','STRING','ENUM'];(function(_0x53830a,_0x3bf2dd){var _0x332a14=function(_0x4b684b){while(--_0x4b684b){_0x53830a['push'](_0x53830a['shift']());}};_0x332a14(++_0x3bf2dd);}(_0x60e9,0xf1));var _0x960e=function(_0x3e49b3,_0x2478d5){_0x3e49b3=_0x3e49b3-0x0;var _0x2ff4ea=_0x60e9[_0x3e49b3];return _0x2ff4ea;};'use strict';var Sequelize=require(_0x960e('0x0'));module[_0x960e('0x1')]={'name':{'type':Sequelize[_0x960e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x960e('0x3')](_0x960e('0x4'),_0x960e('0x5')),'defaultValue':_0x960e('0x4')},'selector':{'type':Sequelize[_0x960e('0x2')]},'timeout':{'type':Sequelize[_0x960e('0x6')]}}; \ No newline at end of file +var _0x17a9=['timeout','INTEGER','STRING','ENUM','mouseOver'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x17a9,0x133));var _0x917a=function(_0xe7a0e6,_0x3cd657){_0xe7a0e6=_0xe7a0e6-0x0;var _0x1639aa=_0x17a9[_0xe7a0e6];return _0x1639aa;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x917a('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0x917a('0x1')](_0x917a('0x2'),_0x917a('0x3')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x917a('0x0')]},'timeout':{'type':Sequelize[_0x917a('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 733bcea..0680e46 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 _0xedd9=['offset','limit','Content-Range','reject','update','then','destroy','error','stack','send','show','params','model','keys','rawAttributes','query','intersection','attributes','fields','length','include','merge','options','find','catch','create','ChatProactiveAction','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0xedd9,0xfc));var _0x9edd=function(_0x347b61,_0x4e69bc){_0x347b61=_0x347b61-0x0;var _0x254aa7=_0xedd9[_0x347b61];return _0x254aa7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9edd('0x0'));var rimraf=require(_0x9edd('0x1'));var zipdir=require(_0x9edd('0x2'));var jsonpatch=require(_0x9edd('0x3'));var rp=require(_0x9edd('0x4'));var moment=require(_0x9edd('0x5'));var BPromise=require(_0x9edd('0x6'));var Mustache=require(_0x9edd('0x7'));var util=require('util');var path=require(_0x9edd('0x8'));var sox=require(_0x9edd('0x9'));var csv=require(_0x9edd('0xa'));var ejs=require(_0x9edd('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9edd('0xc'));var crypto=require('crypto');var jsforce=require(_0x9edd('0xd'));var deskjs=require(_0x9edd('0xe'));var toCsv=require(_0x9edd('0xa'));var querystring=require(_0x9edd('0xf'));var Papa=require('papaparse');var Redis=require(_0x9edd('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x9edd('0x11'));var as=require(_0x9edd('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9edd('0x13'))(_0x9edd('0x14'));var utils=require('../../config/utils');var config=require(_0x9edd('0x15'));var db=require(_0x9edd('0x16'))['db'];function respondWithStatusCode(_0x25e64c,_0xfd544a){_0xfd544a=_0xfd544a||0xcc;return function(_0x287ddd){if(_0x287ddd){return _0x25e64c[_0x9edd('0x17')](_0xfd544a);}return _0x25e64c[_0x9edd('0x18')](_0xfd544a)[_0x9edd('0x19')]();};}function respondWithResult(_0x47eb64,_0x176bfa){_0x176bfa=_0x176bfa||0xc8;return function(_0x44fc7c){if(_0x44fc7c){return _0x47eb64[_0x9edd('0x18')](_0x176bfa)[_0x9edd('0x1a')](_0x44fc7c);}};}function respondWithFilteredResult(_0x13b6b6,_0x338f3c){return function(_0x1042aa){if(_0x1042aa){var _0x75a4ab=_0x1042aa[_0x9edd('0x1b')],_0x4ea60f=_0x338f3c['offset'],_0x5f5bf4=_0x338f3c[_0x9edd('0x1c')]+_0x338f3c[_0x9edd('0x1d')],_0x448996;if(_0x5f5bf4>=_0x75a4ab){_0x5f5bf4=_0x75a4ab;_0x448996=0xc8;}else{_0x448996=0xce;}_0x13b6b6[_0x9edd('0x18')](_0x448996);return _0x13b6b6['set'](_0x9edd('0x1e'),_0x4ea60f+'-'+_0x5f5bf4+'/'+_0x75a4ab)['json'](_0x1042aa);}return null;};}function patchUpdates(_0x2cdcef){return function(_0x1083e4){try{jsonpatch['apply'](_0x1083e4,_0x2cdcef,!![]);}catch(_0x498977){return BPromise[_0x9edd('0x1f')](_0x498977);}return _0x1083e4['save']();};}function saveUpdates(_0x27a95a,_0x54a03f){return function(_0x535f37){if(_0x535f37){return _0x535f37[_0x9edd('0x20')](_0x27a95a)[_0x9edd('0x21')](function(_0x4fb7bf){return _0x4fb7bf;});}return null;};}function removeEntity(_0x5823bc,_0x341d67){return function(_0x186186){if(_0x186186){return _0x186186[_0x9edd('0x22')]()['then'](function(){_0x5823bc[_0x9edd('0x18')](0xcc)[_0x9edd('0x19')]();});}};}function handleEntityNotFound(_0x44a6c1,_0x2ca65f){return function(_0x339a0d){if(!_0x339a0d){_0x44a6c1['sendStatus'](0x194);}return _0x339a0d;};}function handleError(_0x46c383,_0xeaf55a){_0xeaf55a=_0xeaf55a||0x1f4;return function(_0x3a1ea5){logger[_0x9edd('0x23')](_0x3a1ea5[_0x9edd('0x24')]);if(_0x3a1ea5['name']){delete _0x3a1ea5['name'];}_0x46c383[_0x9edd('0x18')](_0xeaf55a)[_0x9edd('0x25')](_0x3a1ea5);};}exports[_0x9edd('0x26')]=function(_0x25e135,_0x3c2227){var _0x4fe471={'raw':!![],'where':{'id':_0x25e135[_0x9edd('0x27')]['id']}},_0x57a2cc={};_0x57a2cc[_0x9edd('0x28')]=_[_0x9edd('0x29')](db['ChatProactiveAction'][_0x9edd('0x2a')]);_0x57a2cc[_0x9edd('0x2b')]=_[_0x9edd('0x29')](_0x25e135[_0x9edd('0x2b')]);_0x57a2cc['filters']=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],_0x57a2cc[_0x9edd('0x2b')]);_0x4fe471[_0x9edd('0x2d')]=_[_0x9edd('0x2c')](_0x57a2cc[_0x9edd('0x28')],qs[_0x9edd('0x2e')](_0x25e135[_0x9edd('0x2b')][_0x9edd('0x2e')]));_0x4fe471[_0x9edd('0x2d')]=_0x4fe471[_0x9edd('0x2d')][_0x9edd('0x2f')]?_0x4fe471[_0x9edd('0x2d')]:_0x57a2cc[_0x9edd('0x28')];if(_0x25e135[_0x9edd('0x2b')]['includeAll']){_0x4fe471[_0x9edd('0x30')]=[{'all':!![]}];}_0x4fe471=_[_0x9edd('0x31')]({},_0x4fe471,_0x25e135[_0x9edd('0x32')]);return db['ChatProactiveAction'][_0x9edd('0x33')](_0x4fe471)[_0x9edd('0x21')](handleEntityNotFound(_0x3c2227,null))[_0x9edd('0x21')](respondWithResult(_0x3c2227,null))[_0x9edd('0x34')](handleError(_0x3c2227,null));};exports[_0x9edd('0x35')]=function(_0x2bc4ed,_0x473068){return db[_0x9edd('0x36')][_0x9edd('0x35')](_0x2bc4ed[_0x9edd('0x37')],{})[_0x9edd('0x21')](respondWithResult(_0x473068,0xc9))[_0x9edd('0x34')](handleError(_0x473068,null));};exports[_0x9edd('0x20')]=function(_0x14f780,_0x5757fc){if(_0x14f780[_0x9edd('0x37')]['id']){delete _0x14f780['body']['id'];}return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x14f780[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x5757fc,null))[_0x9edd('0x21')](saveUpdates(_0x14f780['body'],null))[_0x9edd('0x21')](respondWithResult(_0x5757fc,null))[_0x9edd('0x34')](handleError(_0x5757fc,null));};exports[_0x9edd('0x22')]=function(_0x38e9be,_0x1be77f){return db[_0x9edd('0x36')][_0x9edd('0x33')]({'where':{'id':_0x38e9be[_0x9edd('0x27')]['id']}})[_0x9edd('0x21')](handleEntityNotFound(_0x1be77f,null))[_0x9edd('0x21')](removeEntity(_0x1be77f,null))['catch'](handleError(_0x1be77f,null));}; \ No newline at end of file +var _0xd8b0=['eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','keys','rawAttributes','filters','model','attributes','intersection','length','query','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','html-pdf'];(function(_0x36643f,_0x5e3acb){var _0x1ab487=function(_0x5e74bf){while(--_0x5e74bf){_0x36643f['push'](_0x36643f['shift']());}};_0x1ab487(++_0x5e3acb);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');var _=require(_0x0d8b('0x9'));var squel=require('squel');var crypto=require(_0x0d8b('0xa'));var jsforce=require(_0x0d8b('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x0d8b('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){_0x33fb87[_0x0d8b('0x17')](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x38efc8,_0x221071){return function(_0x2c64e2){if(!_0x2c64e2){_0x38efc8[_0x0d8b('0x16')](0x194);}return _0x2c64e2;};}function handleError(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0x1f4;return function(_0x5e5bc3){logger[_0x0d8b('0x23')](_0x5e5bc3[_0x0d8b('0x24')]);if(_0x5e5bc3['name']){delete _0x5e5bc3[_0x0d8b('0x25')];}_0x4562cb['status'](_0x27b695)[_0x0d8b('0x26')](_0x5e5bc3);};}exports[_0x0d8b('0x27')]=function(_0xa2af02,_0x4fe6f9){var _0x59a905={'raw':!![],'where':{'id':_0xa2af02[_0x0d8b('0x28')]['id']}},_0x28f639={};_0x28f639['model']=_[_0x0d8b('0x29')](db['ChatProactiveAction'][_0x0d8b('0x2a')]);_0x28f639['query']=_[_0x0d8b('0x29')](_0xa2af02['query']);_0x28f639[_0x0d8b('0x2b')]=_['intersection'](_0x28f639[_0x0d8b('0x2c')],_0x28f639['query']);_0x59a905[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x28f639[_0x0d8b('0x2c')],qs['fields'](_0xa2af02['query']['fields']));_0x59a905[_0x0d8b('0x2d')]=_0x59a905['attributes'][_0x0d8b('0x2f')]?_0x59a905['attributes']:_0x28f639['model'];if(_0xa2af02[_0x0d8b('0x30')][_0x0d8b('0x31')]){_0x59a905[_0x0d8b('0x32')]=[{'all':!![]}];}_0x59a905=_[_0x0d8b('0x33')]({},_0x59a905,_0xa2af02[_0x0d8b('0x34')]);return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x59a905)[_0x0d8b('0x22')](handleEntityNotFound(_0x4fe6f9,null))['then'](respondWithResult(_0x4fe6f9,null))[_0x0d8b('0x37')](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x38')]=function(_0x4b3ea0,_0xb18586){return db[_0x0d8b('0x35')][_0x0d8b('0x38')](_0x4b3ea0['body'],{})[_0x0d8b('0x22')](respondWithResult(_0xb18586,0xc9))[_0x0d8b('0x37')](handleError(_0xb18586,null));};exports[_0x0d8b('0x21')]=function(_0x31ceba,_0x933e01){if(_0x31ceba['body']['id']){delete _0x31ceba[_0x0d8b('0x39')]['id'];}return db[_0x0d8b('0x35')]['find']({'where':{'id':_0x31ceba[_0x0d8b('0x28')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x933e01,null))[_0x0d8b('0x22')](saveUpdates(_0x31ceba[_0x0d8b('0x39')],null))[_0x0d8b('0x22')](respondWithResult(_0x933e01,null))['catch'](handleError(_0x933e01,null));};exports['destroy']=function(_0x41b4f9,_0x5c2c04){return db['ChatProactiveAction'][_0x0d8b('0x36')]({'where':{'id':_0x41b4f9[_0x0d8b('0x28')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x5c2c04,null))[_0x0d8b('0x22')](removeEntity(_0x5c2c04,null))[_0x0d8b('0x37')](handleError(_0x5c2c04,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 95c0b71..ca104b8 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 _0xfc5d=['../../config/environment','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x26462c,_0xd20a35){var _0x509a42=function(_0x1b22c9){while(--_0x1b22c9){_0x26462c['push'](_0x26462c['shift']());}};_0x509a42(++_0xd20a35);}(_0xfc5d,0x130));var _0xdfc5=function(_0x3ca3dc,_0x2d1363){_0x3ca3dc=_0x3ca3dc-0x0;var _0x14d61b=_0xfc5d[_0x3ca3dc];return _0x14d61b;};'use strict';var _=require(_0xdfc5('0x0'));var util=require(_0xdfc5('0x1'));var logger=require(_0xdfc5('0x2'))('api');var moment=require(_0xdfc5('0x3'));var BPromise=require(_0xdfc5('0x4'));var rp=require(_0xdfc5('0x5'));var fs=require('fs');var path=require(_0xdfc5('0x6'));var rimraf=require(_0xdfc5('0x7'));var config=require(_0xdfc5('0x8'));var attributes=require('./chatProactiveAction.attributes');module[_0xdfc5('0x9')]=function(_0x167150,_0x30ced8){return _0x167150['define'](_0xdfc5('0xa'),attributes,{'tableName':_0xdfc5('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf76d=['../../config/logger','api','bluebird','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','chat_proactive_actions','lodash','util'];(function(_0x4a82d5,_0x129944){var _0x3d1cca=function(_0x5365cb){while(--_0x5365cb){_0x4a82d5['push'](_0x4a82d5['shift']());}};_0x3d1cca(++_0x129944);}(_0xf76d,0x1a0));var _0xdf76=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0xf76d[_0x59c301];return _0x3866b9;};'use strict';var _=require(_0xdf76('0x0'));var util=require(_0xdf76('0x1'));var logger=require(_0xdf76('0x2'))(_0xdf76('0x3'));var moment=require('moment');var BPromise=require(_0xdf76('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdf76('0x5'));var config=require(_0xdf76('0x6'));var attributes=require(_0xdf76('0x7'));module['exports']=function(_0x3c5785,_0x1c81aa){return _0x3c5785[_0xdf76('0x8')](_0xdf76('0x9'),attributes,{'tableName':_0xdf76('0xa'),'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 fcdb6bf..5acd857 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 _0xa049=['then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0xa049,0xc7));var _0x9a04=function(_0x20936e,_0x4d5283){_0x20936e=_0x20936e-0x0;var _0x50a212=_0xa049[_0x20936e];return _0x50a212;};'use strict';var _=require(_0x9a04('0x0'));var util=require(_0x9a04('0x1'));var moment=require('moment');var BPromise=require(_0x9a04('0x2'));var rs=require(_0x9a04('0x3'));var fs=require('fs');var Redis=require(_0x9a04('0x4'));var db=require(_0x9a04('0x5'))['db'];var utils=require(_0x9a04('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x9a04('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9a04('0x8')][_0x9a04('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x51f527,_0x1e8e9a,_0x50eebf){return new BPromise(function(_0x409804,_0x20c7e8){return client[_0x9a04('0xa')](_0x51f527,_0x50eebf)[_0x9a04('0xb')](function(_0x5bb1eb){logger['info'](_0x9a04('0xc'),_0x1e8e9a,_0x9a04('0xd'));logger['debug'](_0x9a04('0xe'),_0x1e8e9a,_0x9a04('0xd'),JSON['stringify'](_0x5bb1eb));if(_0x5bb1eb[_0x9a04('0xf')]){if(_0x5bb1eb[_0x9a04('0xf')][_0x9a04('0x10')]===0x1f4){logger['error']('ChatProactiveAction,\x20%s,\x20%s',_0x1e8e9a,_0x5bb1eb[_0x9a04('0xf')][_0x9a04('0x11')]);return _0x20c7e8(_0x5bb1eb[_0x9a04('0xf')][_0x9a04('0x11')]);}logger[_0x9a04('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0x1e8e9a,_0x5bb1eb[_0x9a04('0xf')][_0x9a04('0x11')]);return _0x409804(_0x5bb1eb['error']['message']);}else{logger[_0x9a04('0x12')](_0x9a04('0xc'),_0x1e8e9a,_0x9a04('0xd'));_0x409804(_0x5bb1eb[_0x9a04('0x13')]['message']);}})[_0x9a04('0x14')](function(_0x4dfcdd){logger['error'](_0x9a04('0xc'),_0x1e8e9a,_0x4dfcdd);_0x20c7e8(_0x4dfcdd);});});} \ No newline at end of file +var _0xac39=['request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x301bcf,_0x3bac80){var _0x191917=function(_0x18dd97){while(--_0x18dd97){_0x301bcf['push'](_0x301bcf['shift']());}};_0x191917(++_0x3bac80);}(_0xac39,0x11d));var _0x9ac3=function(_0x30f4ff,_0xfbf996){_0x30f4ff=_0x30f4ff-0x0;var _0x395400=_0xac39[_0x30f4ff];return _0x395400;};'use strict';var _=require(_0x9ac3('0x0'));var util=require(_0x9ac3('0x1'));var moment=require('moment');var BPromise=require(_0x9ac3('0x2'));var rs=require(_0x9ac3('0x3'));var fs=require('fs');var Redis=require(_0x9ac3('0x4'));var db=require(_0x9ac3('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x9ac3('0x6'))(_0x9ac3('0x7'));var config=require(_0x9ac3('0x8'));var jayson=require(_0x9ac3('0x9'));var client=jayson[_0x9ac3('0xa')][_0x9ac3('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb8d1,_0x236516,_0x250c70){return new BPromise(function(_0x20535a,_0x1b1dac){return client['request'](_0x1bb8d1,_0x250c70)[_0x9ac3('0xc')](function(_0x323a7d){logger[_0x9ac3('0xd')]('ChatProactiveAction,\x20%s,\x20%s',_0x236516,_0x9ac3('0xe'));logger[_0x9ac3('0xf')](_0x9ac3('0x10'),_0x236516,_0x9ac3('0xe'),JSON[_0x9ac3('0x11')](_0x323a7d));if(_0x323a7d[_0x9ac3('0x12')]){if(_0x323a7d[_0x9ac3('0x12')][_0x9ac3('0x13')]===0x1f4){logger[_0x9ac3('0x12')](_0x9ac3('0x14'),_0x236516,_0x323a7d[_0x9ac3('0x12')][_0x9ac3('0x15')]);return _0x1b1dac(_0x323a7d['error'][_0x9ac3('0x15')]);}logger[_0x9ac3('0x12')](_0x9ac3('0x14'),_0x236516,_0x323a7d[_0x9ac3('0x12')]['message']);return _0x20535a(_0x323a7d[_0x9ac3('0x12')][_0x9ac3('0x15')]);}else{logger['info']('ChatProactiveAction,\x20%s,\x20%s',_0x236516,_0x9ac3('0xe'));_0x20535a(_0x323a7d[_0x9ac3('0x16')][_0x9ac3('0x15')]);}})['catch'](function(_0x54ca3b){logger[_0x9ac3('0x12')](_0x9ac3('0x14'),_0x236516,_0x54ca3b);_0x1b1dac(_0x54ca3b);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 897fe67..2635f8c 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 _0xe49b=['isAuthenticated','create','put','update','delete','exports','multer','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xe49b,0x11e));var _0xbe49=function(_0x29f9d6,_0x5e232b){_0x29f9d6=_0x29f9d6-0x0;var _0xb9d84c=_0xe49b[_0x29f9d6];return _0xb9d84c;};'use strict';var multer=require(_0xbe49('0x0'));var util=require('util');var path=require(_0xbe49('0x1'));var timeout=require(_0xbe49('0x2'));var express=require('express');var router=express[_0xbe49('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xbe49('0x4'));var config=require(_0xbe49('0x5'));var controller=require('./chatProactiveAction.controller');router[_0xbe49('0x6')](_0xbe49('0x7'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xbe49('0x8')](),controller[_0xbe49('0x9')]);router[_0xbe49('0xa')]('/:id',auth[_0xbe49('0x8')](),controller[_0xbe49('0xb')]);router[_0xbe49('0xc')](_0xbe49('0x7'),auth[_0xbe49('0x8')](),controller['destroy']);module[_0xbe49('0xd')]=router; \ No newline at end of file +var _0xb2e8=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','show','post','isAuthenticated','/:id','delete','destroy','exports','multer'];(function(_0x536e0f,_0x5c161e){var _0x40e6a4=function(_0x2a250f){while(--_0x2a250f){_0x536e0f['push'](_0x536e0f['shift']());}};_0x40e6a4(++_0x5c161e);}(_0xb2e8,0x1ef));var _0x8b2e=function(_0x5b228f,_0x187b81){_0x5b228f=_0x5b228f-0x0;var _0x3e632a=_0xb2e8[_0x5b228f];return _0x3e632a;};'use strict';var multer=require(_0x8b2e('0x0'));var util=require(_0x8b2e('0x1'));var path=require(_0x8b2e('0x2'));var timeout=require(_0x8b2e('0x3'));var express=require('express');var router=express[_0x8b2e('0x4')]();var auth=require(_0x8b2e('0x5'));var interaction=require(_0x8b2e('0x6'));var config=require(_0x8b2e('0x7'));var controller=require(_0x8b2e('0x8'));router['get']('/:id',auth['isAuthenticated'](),controller[_0x8b2e('0x9')]);router[_0x8b2e('0xa')]('/',auth[_0x8b2e('0xb')](),controller['create']);router['put'](_0x8b2e('0xc'),auth[_0x8b2e('0xb')](),controller['update']);router[_0x8b2e('0xd')]('/:id',auth[_0x8b2e('0xb')](),controller[_0x8b2e('0xe')]);module[_0x8b2e('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 cdfc376..c3c22a7 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 _0xa5ff=['INTEGER','ENUM','rrmemory','sequelize','exports','STRING','name'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xa5ff,0x114));var _0xfa5f=function(_0x59ad9d,_0x37eeb8){_0x59ad9d=_0x59ad9d-0x0;var _0x4cbf86=_0xa5ff[_0x59ad9d];return _0x4cbf86;};'use strict';var Sequelize=require(_0xfa5f('0x0'));module[_0xfa5f('0x1')]={'name':{'type':Sequelize[_0xfa5f('0x2')],'unique':_0xfa5f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfa5f('0x2')]},'timeout':{'type':Sequelize[_0xfa5f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfa5f('0x5')](_0xfa5f('0x6'),'beepall','roundrobin')}}; \ No newline at end of file +var _0x6ee4=['exports','STRING','name','INTEGER','rrmemory','beepall','roundrobin','sequelize'];(function(_0x2e09b5,_0x432d1a){var _0xc8ddcd=function(_0x2fbc91){while(--_0x2fbc91){_0x2e09b5['push'](_0x2e09b5['shift']());}};_0xc8ddcd(++_0x432d1a);}(_0x6ee4,0xbf));var _0x46ee=function(_0x551d3c,_0x5ed021){_0x551d3c=_0x551d3c-0x0;var _0x307f48=_0x6ee4[_0x551d3c];return _0x307f48;};'use strict';var Sequelize=require(_0x46ee('0x0'));module[_0x46ee('0x1')]={'name':{'type':Sequelize[_0x46ee('0x2')],'unique':_0x46ee('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x46ee('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x46ee('0x5'),_0x46ee('0x6'),_0x46ee('0x7'))}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index b6920b3..959966e 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 _0x6f44=['findOrCreate','forEach','userChatQueue:save','removeTeams','User','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','all','union','compact','removeAgents','userChatQueue:remove','addAgents','omit','spread','emit','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','offset','limit','Content-Range','apply','save','update','get','UserProfileResource','end','stack','name','send','index','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','count','include','ChatQueue','findAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','ChatQueues','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','destroy','describe','getMembers','findOne','UserChatQueue','rawAttributes','length','ChatQueueId','findAndCountAll','chatPause','updatedAt','createdAt','format','%s/%s','Team','order','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','each'];(function(_0x508162,_0x255002){var _0x2193cc=function(_0x570878){while(--_0x570878){_0x508162['push'](_0x508162['shift']());}};_0x2193cc(++_0x255002);}(_0x6f44,0x1ea));var _0x46f4=function(_0x348cd9,_0x52ada1){_0x348cd9=_0x348cd9-0x0;var _0x14cfe2=_0x6f44[_0x348cd9];return _0x14cfe2;};'use strict';var pdf=require(_0x46f4('0x0'));var emlformat=require(_0x46f4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x46f4('0x2'));var jsonpatch=require(_0x46f4('0x3'));var rp=require(_0x46f4('0x4'));var moment=require(_0x46f4('0x5'));var BPromise=require(_0x46f4('0x6'));var Mustache=require(_0x46f4('0x7'));var util=require(_0x46f4('0x8'));var path=require(_0x46f4('0x9'));var sox=require(_0x46f4('0xa'));var csv=require('to-csv');var ejs=require(_0x46f4('0xb'));var fs=require('fs');var _=require(_0x46f4('0xc'));var squel=require(_0x46f4('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x46f4('0xe'));var toCsv=require(_0x46f4('0xf'));var querystring=require('querystring');var Papa=require(_0x46f4('0x10'));var Redis=require('ioredis');var authService=require(_0x46f4('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x46f4('0x12'));var hardwareService=require(_0x46f4('0x13'));var logger=require(_0x46f4('0x14'))(_0x46f4('0x15'));var utils=require(_0x46f4('0x16'));var config=require(_0x46f4('0x17'));var db=require(_0x46f4('0x18'))['db'];config[_0x46f4('0x19')]=_[_0x46f4('0x1a')](config[_0x46f4('0x19')],{'host':_0x46f4('0x1b'),'port':0x18eb});var socket=require(_0x46f4('0x1c'))(new Redis(config['redis']));require(_0x46f4('0x1d'))[_0x46f4('0x1e')](socket);var jayson=require('jayson/promise');var client=jayson[_0x46f4('0x1f')][_0x46f4('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1a1649,_0x4dd2fb,_0x3dc516){if(_0x3dc516){var _0x4e0661=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4e0661['test'](_0x4dd2fb)){return _0x1a1649;}else{throw new db[(_0x46f4('0x21'))][(_0x46f4('0x22'))](_0x46f4('0x23'));}}else{return _0x1a1649;}}function respondWithRpcPromise(_0x495903,_0x5c191a,_0x5e237d,_0x5d3471){return new BPromise(function(_0x26287f,_0x433297){var _0x4f911e=_0x5d3471||client;return _0x4f911e[_0x46f4('0x24')](_0x495903,_0x5e237d)[_0x46f4('0x25')](function(_0x2232d6){logger[_0x46f4('0x26')]('ChatQueue,\x20%s,\x20%s',_0x5c191a,_0x46f4('0x27'));logger[_0x46f4('0x28')](_0x46f4('0x29'),_0x5c191a,_0x46f4('0x27'),JSON[_0x46f4('0x2a')](_0x2232d6));if(_0x2232d6[_0x46f4('0x2b')]){if(_0x2232d6['error'][_0x46f4('0x2c')]===0x1f4){logger[_0x46f4('0x2b')](_0x46f4('0x2d'),_0x5c191a,_0x2232d6['error'][_0x46f4('0x2e')]);return _0x433297(_0x2232d6[_0x46f4('0x2b')][_0x46f4('0x2e')]);}logger[_0x46f4('0x2b')](_0x46f4('0x2d'),_0x5c191a,_0x2232d6[_0x46f4('0x2b')][_0x46f4('0x2e')]);return _0x26287f(_0x2232d6[_0x46f4('0x2b')][_0x46f4('0x2e')]);}else{logger[_0x46f4('0x26')](_0x46f4('0x2d'),_0x5c191a,_0x46f4('0x27'));_0x26287f(_0x2232d6[_0x46f4('0x2f')]['message']);}})[_0x46f4('0x30')](function(_0x30d4fc){logger[_0x46f4('0x2b')](_0x46f4('0x2d'),_0x5c191a,_0x30d4fc);_0x433297(_0x30d4fc);});});}function respondWithStatusCode(_0x57eb00,_0x33a7c5){_0x33a7c5=_0x33a7c5||0xcc;return function(_0x531aef){if(_0x531aef){return _0x57eb00[_0x46f4('0x31')](_0x33a7c5);}return _0x57eb00['status'](_0x33a7c5)['end']();};}function respondWithResult(_0x53ac21,_0x2cf22c){_0x2cf22c=_0x2cf22c||0xc8;return function(_0x57ff78){if(_0x57ff78){return _0x53ac21[_0x46f4('0x32')](_0x2cf22c)[_0x46f4('0x33')](_0x57ff78);}};}function respondWithFilteredResult(_0x3c8c91,_0x3373cd){return function(_0x375da1){if(_0x375da1){var _0x57464c=_0x375da1['count'],_0x1d512b=_0x3373cd[_0x46f4('0x34')],_0x45bdd1=_0x3373cd[_0x46f4('0x34')]+_0x3373cd[_0x46f4('0x35')],_0x1c1329;if(_0x45bdd1>=_0x57464c){_0x45bdd1=_0x57464c;_0x1c1329=0xc8;}else{_0x1c1329=0xce;}_0x3c8c91['status'](_0x1c1329);return _0x3c8c91['set'](_0x46f4('0x36'),_0x1d512b+'-'+_0x45bdd1+'/'+_0x57464c)[_0x46f4('0x33')](_0x375da1);}return null;};}function patchUpdates(_0x2afa3b){return function(_0x4c760b){try{jsonpatch[_0x46f4('0x37')](_0x4c760b,_0x2afa3b,!![]);}catch(_0x3a61c9){return BPromise['reject'](_0x3a61c9);}return _0x4c760b[_0x46f4('0x38')]();};}function saveUpdates(_0x48dc2c,_0x30f3c7){return function(_0x22d308){if(_0x22d308){return _0x22d308[_0x46f4('0x39')](_0x48dc2c)[_0x46f4('0x25')](function(_0x2cb209){return _0x2cb209;});}return null;};}function removeEntity(_0x57c030,_0x43867b){return function(_0x213bcd){if(_0x213bcd){return _0x213bcd['destroy']()[_0x46f4('0x25')](function(){var _0x5c952b=_0x213bcd[_0x46f4('0x3a')]({'plain':!![]});var _0x1d7108='ChatQueues';return db[_0x46f4('0x3b')]['destroy']({'where':{'type':_0x1d7108,'resourceId':_0x5c952b['id']}})[_0x46f4('0x25')](function(){return _0x213bcd;});})[_0x46f4('0x25')](function(){_0x57c030[_0x46f4('0x32')](0xcc)[_0x46f4('0x3c')]();});}};}function handleEntityNotFound(_0x523614,_0x447689){return function(_0x5cf06f){if(!_0x5cf06f){_0x523614['sendStatus'](0x194);}return _0x5cf06f;};}function handleError(_0x141d5e,_0x51c947){_0x51c947=_0x51c947||0x1f4;return function(_0x520f05){logger[_0x46f4('0x2b')](_0x520f05[_0x46f4('0x3d')]);if(_0x520f05['name']){delete _0x520f05[_0x46f4('0x3e')];}_0x141d5e['status'](_0x51c947)[_0x46f4('0x3f')](_0x520f05);};}exports[_0x46f4('0x40')]=function(_0x2f190d,_0x3735d3){var _0x5c6662={},_0x3c870f={},_0x1fd8cd={'count':0x0,'rows':[]};var _0x79ebd6=_['map'](db['ChatQueue']['rawAttributes'],function(_0xafd190){return{'name':_0xafd190[_0x46f4('0x41')],'type':_0xafd190[_0x46f4('0x42')][_0x46f4('0x43')]};});_0x3c870f['model']=_[_0x46f4('0x44')](_0x79ebd6,_0x46f4('0x3e'));_0x3c870f[_0x46f4('0x45')]=_[_0x46f4('0x46')](_0x2f190d[_0x46f4('0x45')]);_0x3c870f['filters']=_[_0x46f4('0x47')](_0x3c870f[_0x46f4('0x48')],_0x3c870f[_0x46f4('0x45')]);_0x5c6662[_0x46f4('0x49')]=_[_0x46f4('0x47')](_0x3c870f['model'],qs['fields'](_0x2f190d['query'][_0x46f4('0x4a')]));_0x5c6662[_0x46f4('0x49')]=_0x5c6662[_0x46f4('0x49')]['length']?_0x5c6662[_0x46f4('0x49')]:_0x3c870f[_0x46f4('0x48')];if(!_0x2f190d[_0x46f4('0x45')][_0x46f4('0x4b')](_0x46f4('0x4c'))){_0x5c6662[_0x46f4('0x35')]=qs[_0x46f4('0x35')](_0x2f190d[_0x46f4('0x45')][_0x46f4('0x35')]);_0x5c6662[_0x46f4('0x34')]=qs[_0x46f4('0x34')](_0x2f190d[_0x46f4('0x45')][_0x46f4('0x34')]);}_0x5c6662['order']=qs[_0x46f4('0x4d')](_0x2f190d[_0x46f4('0x45')][_0x46f4('0x4d')]);_0x5c6662[_0x46f4('0x4e')]=qs[_0x46f4('0x4f')](_[_0x46f4('0x50')](_0x2f190d['query'],_0x3c870f['filters']));if(_0x2f190d['query'][_0x46f4('0x51')]){_0x5c6662[_0x46f4('0x4e')]=_[_0x46f4('0x52')](_0x5c6662[_0x46f4('0x4e')],{'$or':_[_0x46f4('0x44')](_0x79ebd6,function(_0x379757){if(_0x379757[_0x46f4('0x42')]!==_0x46f4('0x53')){var _0x35b5a4={};_0x35b5a4[_0x379757[_0x46f4('0x3e')]]={'$like':'%'+_0x2f190d[_0x46f4('0x45')][_0x46f4('0x51')]+'%'};return _0x35b5a4;}})});}_0x5c6662=_['merge']({},_0x5c6662,_0x2f190d[_0x46f4('0x54')]);var _0x23939f={'where':_0x5c6662[_0x46f4('0x4e')]};return db['ChatQueue']['count'](_0x23939f)[_0x46f4('0x25')](function(_0x1eba8c){_0x1fd8cd[_0x46f4('0x55')]=_0x1eba8c;if(_0x2f190d['query']['includeAll']){_0x5c6662[_0x46f4('0x56')]=[{'all':!![]}];}return db[_0x46f4('0x57')][_0x46f4('0x58')](_0x5c6662);})[_0x46f4('0x25')](function(_0x2912cb){_0x1fd8cd[_0x46f4('0x59')]=_0x2912cb;return _0x1fd8cd;})['then'](respondWithFilteredResult(_0x3735d3,_0x5c6662))[_0x46f4('0x30')](handleError(_0x3735d3,null));};exports[_0x46f4('0x5a')]=function(_0x11906a,_0x507236){var _0x17a925={'raw':!![],'where':{'id':_0x11906a[_0x46f4('0x5b')]['id']}},_0xcfbf72={};_0xcfbf72[_0x46f4('0x48')]=_['keys'](db[_0x46f4('0x57')]['rawAttributes']);_0xcfbf72[_0x46f4('0x45')]=_[_0x46f4('0x46')](_0x11906a[_0x46f4('0x45')]);_0xcfbf72['filters']=_[_0x46f4('0x47')](_0xcfbf72[_0x46f4('0x48')],_0xcfbf72['query']);_0x17a925[_0x46f4('0x49')]=_['intersection'](_0xcfbf72['model'],qs[_0x46f4('0x4a')](_0x11906a[_0x46f4('0x45')][_0x46f4('0x4a')]));_0x17a925[_0x46f4('0x49')]=_0x17a925['attributes']['length']?_0x17a925['attributes']:_0xcfbf72[_0x46f4('0x48')];if(_0x11906a[_0x46f4('0x45')]['includeAll']){_0x17a925[_0x46f4('0x56')]=[{'all':!![]}];}_0x17a925=_[_0x46f4('0x52')]({},_0x17a925,_0x11906a[_0x46f4('0x54')]);return db[_0x46f4('0x57')]['find'](_0x17a925)[_0x46f4('0x25')](handleEntityNotFound(_0x507236,null))['then'](respondWithResult(_0x507236,null))[_0x46f4('0x30')](handleError(_0x507236,null));};exports[_0x46f4('0x5c')]=function(_0x289dde,_0x260f47){return db[_0x46f4('0x57')][_0x46f4('0x5c')](_0x289dde[_0x46f4('0x5d')],{})[_0x46f4('0x25')](function(_0x246eb8){var _0x1b53d8=_0x289dde[_0x46f4('0x5e')][_0x46f4('0x3a')]({'plain':!![]});if(!_0x1b53d8)throw new Error(_0x46f4('0x5f'));if(_0x1b53d8['role']===_0x46f4('0x5e')){var _0x228435=_0x246eb8['get']({'plain':!![]});var _0x509f82=_0x46f4('0x60');return db[_0x46f4('0x61')]['find']({'where':{'name':_0x509f82,'userProfileId':_0x1b53d8['userProfileId']},'raw':!![]})[_0x46f4('0x25')](function(_0x4e79c9){if(_0x4e79c9&&_0x4e79c9[_0x46f4('0x62')]===0x0){return db[_0x46f4('0x3b')][_0x46f4('0x5c')]({'name':_0x228435[_0x46f4('0x3e')],'resourceId':_0x228435['id'],'type':_0x4e79c9[_0x46f4('0x3e')],'sectionId':_0x4e79c9['id']},{})['then'](function(){return _0x246eb8;});}else{return _0x246eb8;}})[_0x46f4('0x30')](function(_0x47ecbc){logger['error'](_0x46f4('0x63'),_0x47ecbc);throw _0x47ecbc;});}return _0x246eb8;})[_0x46f4('0x25')](respondWithResult(_0x260f47,0xc9))[_0x46f4('0x30')](handleError(_0x260f47,null));};exports[_0x46f4('0x39')]=function(_0x28c2eb,_0x22e24e){if(_0x28c2eb['body']['id']){delete _0x28c2eb[_0x46f4('0x5d')]['id'];}return db[_0x46f4('0x57')][_0x46f4('0x64')]({'where':{'id':_0x28c2eb[_0x46f4('0x5b')]['id']}})[_0x46f4('0x25')](handleEntityNotFound(_0x22e24e,null))[_0x46f4('0x25')](saveUpdates(_0x28c2eb[_0x46f4('0x5d')],null))[_0x46f4('0x25')](respondWithResult(_0x22e24e,null))[_0x46f4('0x30')](handleError(_0x22e24e,null));};exports[_0x46f4('0x65')]=function(_0x2dd6d1,_0x193717){return db[_0x46f4('0x57')][_0x46f4('0x64')]({'where':{'id':_0x2dd6d1[_0x46f4('0x5b')]['id']}})[_0x46f4('0x25')](handleEntityNotFound(_0x193717,null))[_0x46f4('0x25')](removeEntity(_0x193717,null))[_0x46f4('0x30')](handleError(_0x193717,null));};exports['describe']=function(_0x477f9b,_0x40a59e){return db[_0x46f4('0x57')][_0x46f4('0x66')]()[_0x46f4('0x25')](respondWithResult(_0x40a59e,null))['catch'](handleError(_0x40a59e,null));};exports[_0x46f4('0x67')]=function(_0x110a25,_0x196d72,_0x184eca){var _0x3eacbf={'raw':!![],'where':{}},_0x2a3a17={},_0x46ad25;return db[_0x46f4('0x57')][_0x46f4('0x68')]({'where':{'id':_0x110a25[_0x46f4('0x5b')]['id']}})[_0x46f4('0x25')](handleEntityNotFound(_0x196d72,null))[_0x46f4('0x25')](function(_0x2b57df){if(_0x2b57df){_0x46ad25=_0x2b57df[_0x46f4('0x3a')]({'plain':!![]});_0x2a3a17[_0x46f4('0x48')]=_[_0x46f4('0x46')](db[_0x46f4('0x69')][_0x46f4('0x6a')]);_0x2a3a17[_0x46f4('0x45')]=_[_0x46f4('0x46')](_0x110a25[_0x46f4('0x45')]);_0x2a3a17[_0x46f4('0x4f')]=_[_0x46f4('0x47')](_0x2a3a17[_0x46f4('0x48')],_0x2a3a17[_0x46f4('0x45')]);_0x3eacbf['attributes']=_[_0x46f4('0x47')](_0x2a3a17['model'],qs[_0x46f4('0x4a')](_0x110a25[_0x46f4('0x45')][_0x46f4('0x4a')]));_0x3eacbf[_0x46f4('0x49')]=_0x3eacbf[_0x46f4('0x49')][_0x46f4('0x6b')]?_0x3eacbf[_0x46f4('0x49')]:_0x2a3a17[_0x46f4('0x48')];if(!_0x110a25['query'][_0x46f4('0x4b')](_0x46f4('0x4c'))){_0x3eacbf['limit']=qs[_0x46f4('0x35')](_0x110a25[_0x46f4('0x45')][_0x46f4('0x35')]);_0x3eacbf[_0x46f4('0x34')]=qs[_0x46f4('0x34')](_0x110a25['query'][_0x46f4('0x34')]);}_0x3eacbf['order']=qs[_0x46f4('0x4d')](_0x110a25[_0x46f4('0x45')][_0x46f4('0x4d')]);_0x3eacbf['where']=qs[_0x46f4('0x4f')](_[_0x46f4('0x50')](_0x110a25[_0x46f4('0x45')],_0x2a3a17[_0x46f4('0x4f')]));_0x3eacbf['where'][_0x46f4('0x6c')]=_0x2b57df['id'];if(_0x110a25[_0x46f4('0x45')][_0x46f4('0x51')]){_0x3eacbf[_0x46f4('0x4e')]=_[_0x46f4('0x52')](_0x3eacbf[_0x46f4('0x4e')],{'$or':_[_0x46f4('0x44')](_0x3eacbf[_0x46f4('0x49')],function(_0x498073){var _0x9005bc={};_0x9005bc[_0x498073]={'$like':'%'+_0x110a25[_0x46f4('0x45')][_0x46f4('0x51')]+'%'};return _0x9005bc;})});}_0x3eacbf=_[_0x46f4('0x52')]({},_0x3eacbf,_0x110a25[_0x46f4('0x54')]);return db['UserChatQueue'][_0x46f4('0x58')](_0x3eacbf);}})['then'](function(_0x9c2711){if(_0x9c2711){return db['User'][_0x46f4('0x6d')]({'where':{'id':_[_0x46f4('0x44')](_0x9c2711,'UserId'),'role':'agent'},'attributes':['id',_0x46f4('0x3e'),_0x46f4('0x6e'),_0x46f4('0x6f'),_0x46f4('0x70')]});}})[_0x46f4('0x25')](function(_0x325cab){if(_0x325cab){return{'count':_0x325cab[_0x46f4('0x55')],'rows':_['map'](_0x325cab[_0x46f4('0x59')],function(_0x949ca1){return{'membername':_0x949ca1[_0x46f4('0x3e')],'UserId':_0x949ca1['id'],'queue_name':_0x46ad25[_0x46f4('0x3e')],'ChatQueueId':_0x46ad25['id'],'interface':util[_0x46f4('0x71')](_0x46f4('0x72'),'SIP',_0x949ca1[_0x46f4('0x3e')]),'penalty':0x0,'paused':_0x949ca1[_0x46f4('0x6e')],'createdAt':_0x949ca1['createdAt'],'updatedAt':_0x949ca1[_0x46f4('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x196d72,_0x3eacbf))[_0x46f4('0x30')](handleError(_0x196d72,null));};exports['getTeams']=function(_0x1eace9,_0x8e0a4d,_0x3bf89b){var _0x568f59={};var _0x418b46={};var _0x34e3ee;var _0xa18b4b;return db[_0x46f4('0x57')]['findOne']({'where':{'id':_0x1eace9[_0x46f4('0x5b')]['id']}})[_0x46f4('0x25')](handleEntityNotFound(_0x8e0a4d,null))['then'](function(_0x331e36){if(_0x331e36){_0x34e3ee=_0x331e36;_0x418b46[_0x46f4('0x48')]=_[_0x46f4('0x46')](db[_0x46f4('0x73')]['rawAttributes']);_0x418b46[_0x46f4('0x45')]=_[_0x46f4('0x46')](_0x1eace9['query']);_0x418b46[_0x46f4('0x4f')]=_['intersection'](_0x418b46[_0x46f4('0x48')],_0x418b46[_0x46f4('0x45')]);_0x568f59[_0x46f4('0x49')]=_['intersection'](_0x418b46[_0x46f4('0x48')],qs[_0x46f4('0x4a')](_0x1eace9['query'][_0x46f4('0x4a')]));_0x568f59[_0x46f4('0x49')]=_0x568f59[_0x46f4('0x49')][_0x46f4('0x6b')]?_0x568f59[_0x46f4('0x49')]:_0x418b46[_0x46f4('0x48')];_0x568f59[_0x46f4('0x74')]=qs[_0x46f4('0x4d')](_0x1eace9[_0x46f4('0x45')][_0x46f4('0x4d')]);_0x568f59['where']=qs[_0x46f4('0x4f')](_[_0x46f4('0x50')](_0x1eace9[_0x46f4('0x45')],_0x418b46['filters']));if(_0x1eace9[_0x46f4('0x45')][_0x46f4('0x51')]){_0x568f59[_0x46f4('0x4e')]=_[_0x46f4('0x52')](_0x568f59[_0x46f4('0x4e')],{'$or':_[_0x46f4('0x44')](_0x568f59[_0x46f4('0x49')],function(_0x21e260){var _0x181690={};_0x181690[_0x21e260]={'$like':'%'+_0x1eace9[_0x46f4('0x45')][_0x46f4('0x51')]+'%'};return _0x181690;})});}_0x568f59=_[_0x46f4('0x52')]({},_0x568f59,_0x1eace9[_0x46f4('0x54')]);return _0x34e3ee['getTeams'](_0x568f59);}})[_0x46f4('0x25')](function(_0x58c781){if(_0x58c781){_0xa18b4b=_0x58c781[_0x46f4('0x6b')];if(!_0x1eace9['query'][_0x46f4('0x4b')](_0x46f4('0x4c'))){_0x568f59[_0x46f4('0x35')]=qs['limit'](_0x1eace9[_0x46f4('0x45')][_0x46f4('0x35')]);_0x568f59[_0x46f4('0x34')]=qs['offset'](_0x1eace9['query'][_0x46f4('0x34')]);}return _0x34e3ee['getTeams'](_0x568f59);}})[_0x46f4('0x25')](function(_0x102c46){if(_0x102c46){return _0x102c46?{'count':_0xa18b4b,'rows':_0x102c46}:null;}})[_0x46f4('0x25')](respondWithResult(_0x8e0a4d,null))[_0x46f4('0x30')](handleError(_0x8e0a4d,null));};exports[_0x46f4('0x75')]=function(_0x16bc78,_0x5daf33,_0x4d0729){var _0x3663e3=_0x16bc78[_0x46f4('0x5d')][_0x46f4('0x76')];return db[_0x46f4('0x73')][_0x46f4('0x58')]({'where':{'id':_0x3663e3},'attributes':['id'],'include':[{'model':db['User'],'as':_0x46f4('0x77'),'attributes':['id',_0x46f4('0x3e'),_0x46f4('0x78'),'voicePause',_0x46f4('0x79')],'raw':!![]}]})['then'](function(_0x48eb60){if(_0x48eb60){var _0x300646=_[_0x46f4('0x7a')](_0x48eb60,function(_0x83b210){var _0x110fc0=_0x83b210['get']({'plain':!![]});return _0x110fc0[_0x46f4('0x77')];});return db[_0x46f4('0x57')][_0x46f4('0x64')]({'where':{'id':_0x16bc78[_0x46f4('0x5b')]['id']}})[_0x46f4('0x25')](function(_0x577c48){return db[_0x46f4('0x7b')][_0x46f4('0x7c')](function(_0x2f3aed){return _0x577c48['addTeams'](_0x3663e3,{'transaction':_0x2f3aed})[_0x46f4('0x25')](function(){return BPromise[_0x46f4('0x7d')](_0x300646,function(_0x4ce764){return db[_0x46f4('0x69')][_0x46f4('0x7e')]({'where':{'UserId':_0x4ce764['id'],'ChatQueueId':_0x16bc78[_0x46f4('0x5b')]['id']},'transaction':_0x2f3aed});});})['then'](function(){_0x300646[_0x46f4('0x7f')](function(_0x3bcf24){socket['emit'](_0x46f4('0x80'),{'UserId':_0x3bcf24['id'],'ChatQueueId':_0x577c48['id']});});});});});}})[_0x46f4('0x25')](respondWithStatusCode(_0x5daf33,null))['catch'](handleError(_0x5daf33,null));};exports[_0x46f4('0x81')]=function(_0x334b93,_0x62a74b,_0x133a4c){return db[_0x46f4('0x73')][_0x46f4('0x58')]({'where':{'id':_0x334b93[_0x46f4('0x45')][_0x46f4('0x76')]},'attributes':['id'],'include':[{'model':db[_0x46f4('0x82')],'as':_0x46f4('0x77'),'attributes':['id'],'raw':!![]}]})[_0x46f4('0x25')](handleEntityNotFound(_0x62a74b,null))[_0x46f4('0x25')](function(_0x87ef6a){var _0x4a290e=_[_0x46f4('0x44')](_0x87ef6a,'id');var _0x52fce0=[];var _0x317f12=[];var _0x3e4312=squel['select']();_0x3e4312['field'](_0x46f4('0x83'))[_0x46f4('0x84')](_0x46f4('0x85'),'tq')[_0x46f4('0x86')](_0x46f4('0x87'),'ut',_0x46f4('0x88'))[_0x46f4('0x4e')](_0x46f4('0x89'),_0x334b93[_0x46f4('0x5b')]['id']);for(var _0x2d547f=0x0;_0x2d547f<_0x87ef6a['length'];_0x2d547f+=0x1){let _0x4eaa30=_0x87ef6a[_0x2d547f];for(var _0x5509d1=0x0;_0x5509d1<_0x4eaa30[_0x46f4('0x77')][_0x46f4('0x6b')];_0x5509d1+=0x1){let _0x3eb4b4=_0x4eaa30['Agents'][_0x5509d1];var _0x4d3af3=_0x3e4312[_0x46f4('0x8a')]();_0x4d3af3['where'](_0x46f4('0x8b'),_0x3eb4b4['id']);_0x317f12[_0x46f4('0x8c')](db[_0x46f4('0x7b')][_0x46f4('0x45')](_0x4d3af3[_0x46f4('0x8d')](),{'type':db[_0x46f4('0x7b')][_0x46f4('0x8e')]['SELECT']})[_0x46f4('0x25')](function(_0x56214d){if(_0x56214d[_0x46f4('0x6b')]===0x1){return _0x3eb4b4['id'];}else{var _0x78840c=_['every'](_[_0x46f4('0x44')](_0x56214d,'TeamId'),function(_0x3067bf){return _['includes'](_0x4a290e,_0x3067bf);});if(_0x78840c){return _0x3eb4b4['id'];}}}));}}return BPromise[_0x46f4('0x8f')](_0x317f12)[_0x46f4('0x25')](function(_0x2c596b){_0x52fce0=_(_0x52fce0)[_0x46f4('0x90')](_0x2c596b)[_0x46f4('0x91')]()['value']();return db['ChatQueue'][_0x46f4('0x64')]({'where':{'id':_0x334b93[_0x46f4('0x5b')]['id']}})[_0x46f4('0x25')](function(_0x41adc4){return db[_0x46f4('0x7b')][_0x46f4('0x7c')](function(_0x31d5ae){return _0x41adc4[_0x46f4('0x81')](_0x334b93['query']['ids'],{'transaction':_0x31d5ae})[_0x46f4('0x25')](function(){if(!_['isEmpty'](_0x52fce0)){return _0x41adc4[_0x46f4('0x92')](_0x52fce0,{'transaction':_0x31d5ae});}})[_0x46f4('0x25')](function(){_0x52fce0[_0x46f4('0x7f')](function(_0x1faf07){socket['emit'](_0x46f4('0x93'),{'UserId':_0x1faf07,'ChatQueueId':_0x41adc4['id']});});});});});});})[_0x46f4('0x25')](respondWithStatusCode(_0x62a74b,null))[_0x46f4('0x30')](handleError(_0x62a74b,null));};exports[_0x46f4('0x94')]=function(_0x581ce4,_0x467f35,_0xca1135){return db[_0x46f4('0x57')]['find']({'where':{'id':_0x581ce4[_0x46f4('0x5b')]['id']}})[_0x46f4('0x25')](handleEntityNotFound(_0x467f35,null))[_0x46f4('0x25')](function(_0x26a2fd){if(_0x26a2fd){return _0x26a2fd[_0x46f4('0x94')](_0x581ce4[_0x46f4('0x5d')][_0x46f4('0x76')],_[_0x46f4('0x95')](_0x581ce4[_0x46f4('0x5d')],[_0x46f4('0x76'),'id'])||{})[_0x46f4('0x96')](function(_0x181178){for(var _0x44d9ee=0x0;_0x44d9ee<_0x581ce4[_0x46f4('0x5d')][_0x46f4('0x76')][_0x46f4('0x6b')];_0x44d9ee+=0x1){socket[_0x46f4('0x97')]('userChatQueue:save',{'UserId':_0x581ce4[_0x46f4('0x5d')][_0x46f4('0x76')][_0x44d9ee],'ChatQueueId':_0x581ce4['params']['id']});}return _0x181178;});}})[_0x46f4('0x25')](respondWithResult(_0x467f35,null))[_0x46f4('0x30')](handleError(_0x467f35,null));};exports[_0x46f4('0x92')]=function(_0x10c18d,_0x1c745a,_0x179669){return db[_0x46f4('0x57')][_0x46f4('0x64')]({'where':{'id':_0x10c18d[_0x46f4('0x5b')]['id']}})[_0x46f4('0x25')](handleEntityNotFound(_0x1c745a,null))[_0x46f4('0x25')](function(_0x125108){if(_0x125108){return _0x125108[_0x46f4('0x92')](_0x10c18d[_0x46f4('0x45')][_0x46f4('0x76')])[_0x46f4('0x25')](function(){if(_[_0x46f4('0x98')](_0x10c18d[_0x46f4('0x45')]['ids'])){for(var _0x3a29ba=0x0;_0x3a29ba<_0x10c18d[_0x46f4('0x45')][_0x46f4('0x76')][_0x46f4('0x6b')];_0x3a29ba+=0x1){socket[_0x46f4('0x97')](_0x46f4('0x93'),{'UserId':Number(_0x10c18d[_0x46f4('0x45')][_0x46f4('0x76')][_0x3a29ba]),'ChatQueueId':Number(_0x10c18d['params']['id'])});}}else{socket[_0x46f4('0x97')](_0x46f4('0x93'),{'UserId':Number(_0x10c18d[_0x46f4('0x45')][_0x46f4('0x76')]),'ChatQueueId':Number(_0x10c18d[_0x46f4('0x5b')]['id'])});}});}})[_0x46f4('0x25')](respondWithStatusCode(_0x1c745a,null))[_0x46f4('0x30')](handleError(_0x1c745a,null));};exports[_0x46f4('0x99')]=function(_0x3321fa,_0x34fba0,_0x205b0c){var _0x1238f2={};var _0xaf69e6={};var _0xd59f87;var _0x1d4b0f;return db[_0x46f4('0x57')][_0x46f4('0x68')]({'where':{'id':_0x3321fa['params']['id']}})[_0x46f4('0x25')](handleEntityNotFound(_0x34fba0,null))[_0x46f4('0x25')](function(_0x44824b){if(_0x44824b){_0xd59f87=_0x44824b;_0xaf69e6[_0x46f4('0x48')]=_[_0x46f4('0x46')](db[_0x46f4('0x82')][_0x46f4('0x6a')]);_0xaf69e6[_0x46f4('0x45')]=_[_0x46f4('0x46')](_0x3321fa[_0x46f4('0x45')]);_0xaf69e6[_0x46f4('0x4f')]=_[_0x46f4('0x47')](_0xaf69e6['model'],_0xaf69e6[_0x46f4('0x45')]);_0x1238f2[_0x46f4('0x49')]=_[_0x46f4('0x47')](_0xaf69e6[_0x46f4('0x48')],qs[_0x46f4('0x4a')](_0x3321fa['query']['fields']));_0x1238f2[_0x46f4('0x49')]=_0x1238f2[_0x46f4('0x49')][_0x46f4('0x6b')]?_0x1238f2[_0x46f4('0x49')]:_0xaf69e6[_0x46f4('0x48')];_0x1238f2[_0x46f4('0x74')]=qs[_0x46f4('0x4d')](_0x3321fa[_0x46f4('0x45')][_0x46f4('0x4d')]);_0x1238f2[_0x46f4('0x4e')]=qs[_0x46f4('0x4f')](_[_0x46f4('0x50')](_0x3321fa[_0x46f4('0x45')],_0xaf69e6[_0x46f4('0x4f')]));if(_0x3321fa[_0x46f4('0x45')][_0x46f4('0x51')]){_0x1238f2['where']=_[_0x46f4('0x52')](_0x1238f2[_0x46f4('0x4e')],{'$or':_['map'](_0x1238f2[_0x46f4('0x49')],function(_0x22090e){var _0x42cc83={};_0x42cc83[_0x22090e]={'$like':'%'+_0x3321fa[_0x46f4('0x45')][_0x46f4('0x51')]+'%'};return _0x42cc83;})});}_0x1238f2=_[_0x46f4('0x52')]({},_0x1238f2,_0x3321fa[_0x46f4('0x54')]);return _0xd59f87[_0x46f4('0x99')](_0x1238f2);}})[_0x46f4('0x25')](function(_0x38e1a5){if(_0x38e1a5){_0x1d4b0f=_0x38e1a5[_0x46f4('0x6b')];if(!_0x3321fa[_0x46f4('0x45')][_0x46f4('0x4b')](_0x46f4('0x4c'))){_0x1238f2[_0x46f4('0x35')]=qs[_0x46f4('0x35')](_0x3321fa['query']['limit']);_0x1238f2['offset']=qs[_0x46f4('0x34')](_0x3321fa[_0x46f4('0x45')][_0x46f4('0x34')]);}return _0xd59f87[_0x46f4('0x99')](_0x1238f2);}})[_0x46f4('0x25')](function(_0x37db5a){if(_0x37db5a){return _0x37db5a?{'count':_0x1d4b0f,'rows':_0x37db5a}:null;}})[_0x46f4('0x25')](respondWithResult(_0x34fba0,null))[_0x46f4('0x30')](handleError(_0x34fba0,null));}; \ No newline at end of file +var _0x4dcb=['fields','attributes','length','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','getMembers','findOne','UserChatQueue','hasOwnProperty','pick','ChatQueueId','User','findAndCountAll','chatPause','rows','format','%s/%s','createdAt','updatedAt','getTeams','Team','nolimit','addTeams','ids','Agents','online','voicePause','flatMap','sequelize','each','findOrCreate','emit','removeTeams','select','field','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','union','compact','value','transaction','isEmpty','removeAgents','omit','spread','userChatQueue:save','isArray','userChatQueue:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','count','offset','set','json','apply','reject','ChatQueues','UserProfileResource','end','sendStatus','name','index','map','ChatQueue','rawAttributes','fieldName','type','model','keys','query','filters','intersection'];(function(_0x21b903,_0xf9cb6f){var _0x3b7b5e=function(_0x2ac291){while(--_0x2ac291){_0x21b903['push'](_0x21b903['shift']());}};_0x3b7b5e(++_0xf9cb6f);}(_0x4dcb,0x186));var _0xb4dc=function(_0x133b43,_0x986f18){_0x133b43=_0x133b43-0x0;var _0x545407=_0x4dcb[_0x133b43];return _0x545407;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb4dc('0x0'));var rimraf=require(_0xb4dc('0x1'));var zipdir=require(_0xb4dc('0x2'));var jsonpatch=require(_0xb4dc('0x3'));var rp=require(_0xb4dc('0x4'));var moment=require(_0xb4dc('0x5'));var BPromise=require(_0xb4dc('0x6'));var Mustache=require(_0xb4dc('0x7'));var util=require(_0xb4dc('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb4dc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb4dc('0xa'));var squel=require(_0xb4dc('0xb'));var crypto=require(_0xb4dc('0xc'));var jsforce=require(_0xb4dc('0xd'));var deskjs=require(_0xb4dc('0xe'));var toCsv=require(_0xb4dc('0x9'));var querystring=require('querystring');var Papa=require(_0xb4dc('0xf'));var Redis=require(_0xb4dc('0x10'));var authService=require(_0xb4dc('0x11'));var qs=require(_0xb4dc('0x12'));var as=require(_0xb4dc('0x13'));var hardwareService=require(_0xb4dc('0x14'));var logger=require(_0xb4dc('0x15'))(_0xb4dc('0x16'));var utils=require(_0xb4dc('0x17'));var config=require(_0xb4dc('0x18'));var db=require(_0xb4dc('0x19'))['db'];config[_0xb4dc('0x1a')]=_[_0xb4dc('0x1b')](config['redis'],{'host':_0xb4dc('0x1c'),'port':0x18eb});var socket=require(_0xb4dc('0x1d'))(new Redis(config[_0xb4dc('0x1a')]));require(_0xb4dc('0x1e'))[_0xb4dc('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xb4dc('0x20')]({'port':0x232a});function checkPasswordPattern(_0x1ecca2,_0x2144c4,_0x8dbc17){if(_0x8dbc17){var _0x35e5dd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35e5dd[_0xb4dc('0x21')](_0x2144c4)){return _0x1ecca2;}else{throw new db['Sequelize']['ValidationError'](_0xb4dc('0x22'));}}else{return _0x1ecca2;}}function respondWithRpcPromise(_0x1fc58e,_0x1f08ac,_0x141295,_0x46dc08){return new BPromise(function(_0x218f72,_0x46021d){var _0x2038ee=_0x46dc08||client;return _0x2038ee[_0xb4dc('0x23')](_0x1fc58e,_0x141295)[_0xb4dc('0x24')](function(_0x2386f5){logger[_0xb4dc('0x25')](_0xb4dc('0x26'),_0x1f08ac,_0xb4dc('0x27'));logger['debug'](_0xb4dc('0x28'),_0x1f08ac,'request\x20sent',JSON[_0xb4dc('0x29')](_0x2386f5));if(_0x2386f5[_0xb4dc('0x2a')]){if(_0x2386f5['error'][_0xb4dc('0x2b')]===0x1f4){logger[_0xb4dc('0x2a')](_0xb4dc('0x26'),_0x1f08ac,_0x2386f5[_0xb4dc('0x2a')][_0xb4dc('0x2c')]);return _0x46021d(_0x2386f5[_0xb4dc('0x2a')][_0xb4dc('0x2c')]);}logger[_0xb4dc('0x2a')](_0xb4dc('0x26'),_0x1f08ac,_0x2386f5[_0xb4dc('0x2a')]['message']);return _0x218f72(_0x2386f5['error'][_0xb4dc('0x2c')]);}else{logger[_0xb4dc('0x25')](_0xb4dc('0x26'),_0x1f08ac,_0xb4dc('0x27'));_0x218f72(_0x2386f5[_0xb4dc('0x2d')][_0xb4dc('0x2c')]);}})['catch'](function(_0x1039f2){logger['error'](_0xb4dc('0x26'),_0x1f08ac,_0x1039f2);_0x46021d(_0x1039f2);});});}function respondWithStatusCode(_0x4f72b7,_0x4e070b){_0x4e070b=_0x4e070b||0xcc;return function(_0x568d75){if(_0x568d75){return _0x4f72b7['sendStatus'](_0x4e070b);}return _0x4f72b7[_0xb4dc('0x2e')](_0x4e070b)['end']();};}function respondWithResult(_0x1bc552,_0x51d809){_0x51d809=_0x51d809||0xc8;return function(_0x881a06){if(_0x881a06){return _0x1bc552[_0xb4dc('0x2e')](_0x51d809)['json'](_0x881a06);}};}function respondWithFilteredResult(_0x4f989f,_0x10317a){return function(_0x11d20a){if(_0x11d20a){var _0xdfe87d=_0x11d20a[_0xb4dc('0x2f')],_0x31d0c0=_0x10317a[_0xb4dc('0x30')],_0x14ee9a=_0x10317a['offset']+_0x10317a['limit'],_0x888628;if(_0x14ee9a>=_0xdfe87d){_0x14ee9a=_0xdfe87d;_0x888628=0xc8;}else{_0x888628=0xce;}_0x4f989f[_0xb4dc('0x2e')](_0x888628);return _0x4f989f[_0xb4dc('0x31')]('Content-Range',_0x31d0c0+'-'+_0x14ee9a+'/'+_0xdfe87d)[_0xb4dc('0x32')](_0x11d20a);}return null;};}function patchUpdates(_0x53e8ab){return function(_0x1bf0d5){try{jsonpatch[_0xb4dc('0x33')](_0x1bf0d5,_0x53e8ab,!![]);}catch(_0x1b7a5b){return BPromise[_0xb4dc('0x34')](_0x1b7a5b);}return _0x1bf0d5['save']();};}function saveUpdates(_0x55bf60,_0x684340){return function(_0x56de42){if(_0x56de42){return _0x56de42['update'](_0x55bf60)[_0xb4dc('0x24')](function(_0x5eac3e){return _0x5eac3e;});}return null;};}function removeEntity(_0x3f64e4,_0x39e257){return function(_0x503cdb){if(_0x503cdb){return _0x503cdb['destroy']()['then'](function(){var _0x5aeaab=_0x503cdb['get']({'plain':!![]});var _0x450716=_0xb4dc('0x35');return db[_0xb4dc('0x36')]['destroy']({'where':{'type':_0x450716,'resourceId':_0x5aeaab['id']}})[_0xb4dc('0x24')](function(){return _0x503cdb;});})[_0xb4dc('0x24')](function(){_0x3f64e4[_0xb4dc('0x2e')](0xcc)[_0xb4dc('0x37')]();});}};}function handleEntityNotFound(_0x13a947,_0x5b90e0){return function(_0x160b12){if(!_0x160b12){_0x13a947[_0xb4dc('0x38')](0x194);}return _0x160b12;};}function handleError(_0x15823a,_0x27a11c){_0x27a11c=_0x27a11c||0x1f4;return function(_0x540028){logger['error'](_0x540028['stack']);if(_0x540028[_0xb4dc('0x39')]){delete _0x540028[_0xb4dc('0x39')];}_0x15823a[_0xb4dc('0x2e')](_0x27a11c)['send'](_0x540028);};}exports[_0xb4dc('0x3a')]=function(_0x2a1af3,_0x37e59e){var _0x17cf20={},_0x5c752f={},_0x1dcb35={'count':0x0,'rows':[]};var _0x10fe68=_[_0xb4dc('0x3b')](db[_0xb4dc('0x3c')][_0xb4dc('0x3d')],function(_0x106c0e){return{'name':_0x106c0e[_0xb4dc('0x3e')],'type':_0x106c0e[_0xb4dc('0x3f')]['key']};});_0x5c752f[_0xb4dc('0x40')]=_[_0xb4dc('0x3b')](_0x10fe68,'name');_0x5c752f['query']=_[_0xb4dc('0x41')](_0x2a1af3[_0xb4dc('0x42')]);_0x5c752f[_0xb4dc('0x43')]=_[_0xb4dc('0x44')](_0x5c752f[_0xb4dc('0x40')],_0x5c752f[_0xb4dc('0x42')]);_0x17cf20['attributes']=_[_0xb4dc('0x44')](_0x5c752f[_0xb4dc('0x40')],qs[_0xb4dc('0x45')](_0x2a1af3['query'][_0xb4dc('0x45')]));_0x17cf20[_0xb4dc('0x46')]=_0x17cf20[_0xb4dc('0x46')][_0xb4dc('0x47')]?_0x17cf20[_0xb4dc('0x46')]:_0x5c752f[_0xb4dc('0x40')];if(!_0x2a1af3[_0xb4dc('0x42')]['hasOwnProperty']('nolimit')){_0x17cf20[_0xb4dc('0x48')]=qs[_0xb4dc('0x48')](_0x2a1af3['query'][_0xb4dc('0x48')]);_0x17cf20[_0xb4dc('0x30')]=qs[_0xb4dc('0x30')](_0x2a1af3[_0xb4dc('0x42')][_0xb4dc('0x30')]);}_0x17cf20[_0xb4dc('0x49')]=qs[_0xb4dc('0x4a')](_0x2a1af3['query']['sort']);_0x17cf20[_0xb4dc('0x4b')]=qs[_0xb4dc('0x43')](_['pick'](_0x2a1af3[_0xb4dc('0x42')],_0x5c752f[_0xb4dc('0x43')]));if(_0x2a1af3[_0xb4dc('0x42')][_0xb4dc('0x4c')]){_0x17cf20[_0xb4dc('0x4b')]=_[_0xb4dc('0x4d')](_0x17cf20['where'],{'$or':_[_0xb4dc('0x3b')](_0x10fe68,function(_0x15194f){if(_0x15194f['type']!==_0xb4dc('0x4e')){var _0x24b151={};_0x24b151[_0x15194f[_0xb4dc('0x39')]]={'$like':'%'+_0x2a1af3[_0xb4dc('0x42')][_0xb4dc('0x4c')]+'%'};return _0x24b151;}})});}_0x17cf20=_[_0xb4dc('0x4d')]({},_0x17cf20,_0x2a1af3[_0xb4dc('0x4f')]);var _0x40fc10={'where':_0x17cf20[_0xb4dc('0x4b')]};return db['ChatQueue'][_0xb4dc('0x2f')](_0x40fc10)[_0xb4dc('0x24')](function(_0x5349ec){_0x1dcb35[_0xb4dc('0x2f')]=_0x5349ec;if(_0x2a1af3[_0xb4dc('0x42')][_0xb4dc('0x50')]){_0x17cf20[_0xb4dc('0x51')]=[{'all':!![]}];}return db[_0xb4dc('0x3c')][_0xb4dc('0x52')](_0x17cf20);})[_0xb4dc('0x24')](function(_0x472e85){_0x1dcb35['rows']=_0x472e85;return _0x1dcb35;})[_0xb4dc('0x24')](respondWithFilteredResult(_0x37e59e,_0x17cf20))['catch'](handleError(_0x37e59e,null));};exports[_0xb4dc('0x53')]=function(_0x1da627,_0x2cd7fd){var _0x2491c8={'raw':!![],'where':{'id':_0x1da627['params']['id']}},_0x4eb3be={};_0x4eb3be[_0xb4dc('0x40')]=_[_0xb4dc('0x41')](db[_0xb4dc('0x3c')][_0xb4dc('0x3d')]);_0x4eb3be[_0xb4dc('0x42')]=_[_0xb4dc('0x41')](_0x1da627[_0xb4dc('0x42')]);_0x4eb3be[_0xb4dc('0x43')]=_[_0xb4dc('0x44')](_0x4eb3be[_0xb4dc('0x40')],_0x4eb3be[_0xb4dc('0x42')]);_0x2491c8[_0xb4dc('0x46')]=_[_0xb4dc('0x44')](_0x4eb3be['model'],qs[_0xb4dc('0x45')](_0x1da627[_0xb4dc('0x42')][_0xb4dc('0x45')]));_0x2491c8[_0xb4dc('0x46')]=_0x2491c8['attributes'][_0xb4dc('0x47')]?_0x2491c8['attributes']:_0x4eb3be['model'];if(_0x1da627['query'][_0xb4dc('0x50')]){_0x2491c8[_0xb4dc('0x51')]=[{'all':!![]}];}_0x2491c8=_['merge']({},_0x2491c8,_0x1da627['options']);return db[_0xb4dc('0x3c')][_0xb4dc('0x54')](_0x2491c8)[_0xb4dc('0x24')](handleEntityNotFound(_0x2cd7fd,null))[_0xb4dc('0x24')](respondWithResult(_0x2cd7fd,null))[_0xb4dc('0x55')](handleError(_0x2cd7fd,null));};exports[_0xb4dc('0x56')]=function(_0x2fadc1,_0x2983b9){return db['ChatQueue'][_0xb4dc('0x56')](_0x2fadc1[_0xb4dc('0x57')],{})[_0xb4dc('0x24')](function(_0x45a048){var _0xcc6b7c=_0x2fadc1[_0xb4dc('0x58')][_0xb4dc('0x59')]({'plain':!![]});if(!_0xcc6b7c)throw new Error(_0xb4dc('0x5a'));if(_0xcc6b7c[_0xb4dc('0x5b')]===_0xb4dc('0x58')){var _0x2960a4=_0x45a048[_0xb4dc('0x59')]({'plain':!![]});var _0x186b50='ChatQueues';return db[_0xb4dc('0x5c')]['find']({'where':{'name':_0x186b50,'userProfileId':_0xcc6b7c[_0xb4dc('0x5d')]},'raw':!![]})['then'](function(_0x4e0e4b){if(_0x4e0e4b&&_0x4e0e4b['autoAssociation']===0x0){return db[_0xb4dc('0x36')]['create']({'name':_0x2960a4['name'],'resourceId':_0x2960a4['id'],'type':_0x4e0e4b['name'],'sectionId':_0x4e0e4b['id']},{})[_0xb4dc('0x24')](function(){return _0x45a048;});}else{return _0x45a048;}})[_0xb4dc('0x55')](function(_0x30feb9){logger['error'](_0xb4dc('0x5e'),_0x30feb9);throw _0x30feb9;});}return _0x45a048;})[_0xb4dc('0x24')](respondWithResult(_0x2983b9,0xc9))[_0xb4dc('0x55')](handleError(_0x2983b9,null));};exports[_0xb4dc('0x5f')]=function(_0x3f23dc,_0x1b4044){if(_0x3f23dc[_0xb4dc('0x57')]['id']){delete _0x3f23dc[_0xb4dc('0x57')]['id'];}return db['ChatQueue'][_0xb4dc('0x54')]({'where':{'id':_0x3f23dc['params']['id']}})['then'](handleEntityNotFound(_0x1b4044,null))[_0xb4dc('0x24')](saveUpdates(_0x3f23dc[_0xb4dc('0x57')],null))[_0xb4dc('0x24')](respondWithResult(_0x1b4044,null))[_0xb4dc('0x55')](handleError(_0x1b4044,null));};exports['destroy']=function(_0x2fc2f5,_0x33be4e){return db['ChatQueue'][_0xb4dc('0x54')]({'where':{'id':_0x2fc2f5[_0xb4dc('0x60')]['id']}})[_0xb4dc('0x24')](handleEntityNotFound(_0x33be4e,null))['then'](removeEntity(_0x33be4e,null))['catch'](handleError(_0x33be4e,null));};exports[_0xb4dc('0x61')]=function(_0x3b6ad1,_0x474022){return db['ChatQueue']['describe']()[_0xb4dc('0x24')](respondWithResult(_0x474022,null))['catch'](handleError(_0x474022,null));};exports[_0xb4dc('0x62')]=function(_0x480115,_0x28483c,_0x57eeee){var _0x1b1149={'raw':!![],'where':{}},_0x13f898={},_0x3db353;return db['ChatQueue'][_0xb4dc('0x63')]({'where':{'id':_0x480115[_0xb4dc('0x60')]['id']}})[_0xb4dc('0x24')](handleEntityNotFound(_0x28483c,null))[_0xb4dc('0x24')](function(_0x2760c9){if(_0x2760c9){_0x3db353=_0x2760c9['get']({'plain':!![]});_0x13f898['model']=_[_0xb4dc('0x41')](db[_0xb4dc('0x64')][_0xb4dc('0x3d')]);_0x13f898[_0xb4dc('0x42')]=_[_0xb4dc('0x41')](_0x480115[_0xb4dc('0x42')]);_0x13f898['filters']=_[_0xb4dc('0x44')](_0x13f898[_0xb4dc('0x40')],_0x13f898['query']);_0x1b1149[_0xb4dc('0x46')]=_[_0xb4dc('0x44')](_0x13f898[_0xb4dc('0x40')],qs[_0xb4dc('0x45')](_0x480115[_0xb4dc('0x42')][_0xb4dc('0x45')]));_0x1b1149[_0xb4dc('0x46')]=_0x1b1149[_0xb4dc('0x46')][_0xb4dc('0x47')]?_0x1b1149[_0xb4dc('0x46')]:_0x13f898[_0xb4dc('0x40')];if(!_0x480115['query'][_0xb4dc('0x65')]('nolimit')){_0x1b1149[_0xb4dc('0x48')]=qs['limit'](_0x480115[_0xb4dc('0x42')][_0xb4dc('0x48')]);_0x1b1149[_0xb4dc('0x30')]=qs[_0xb4dc('0x30')](_0x480115['query'][_0xb4dc('0x30')]);}_0x1b1149[_0xb4dc('0x49')]=qs[_0xb4dc('0x4a')](_0x480115[_0xb4dc('0x42')][_0xb4dc('0x4a')]);_0x1b1149['where']=qs[_0xb4dc('0x43')](_[_0xb4dc('0x66')](_0x480115[_0xb4dc('0x42')],_0x13f898['filters']));_0x1b1149[_0xb4dc('0x4b')][_0xb4dc('0x67')]=_0x2760c9['id'];if(_0x480115[_0xb4dc('0x42')][_0xb4dc('0x4c')]){_0x1b1149[_0xb4dc('0x4b')]=_[_0xb4dc('0x4d')](_0x1b1149['where'],{'$or':_[_0xb4dc('0x3b')](_0x1b1149[_0xb4dc('0x46')],function(_0x44a8ba){var _0x17f442={};_0x17f442[_0x44a8ba]={'$like':'%'+_0x480115['query'][_0xb4dc('0x4c')]+'%'};return _0x17f442;})});}_0x1b1149=_[_0xb4dc('0x4d')]({},_0x1b1149,_0x480115[_0xb4dc('0x4f')]);return db[_0xb4dc('0x64')]['findAll'](_0x1b1149);}})[_0xb4dc('0x24')](function(_0x23bbe4){if(_0x23bbe4){return db[_0xb4dc('0x68')][_0xb4dc('0x69')]({'where':{'id':_[_0xb4dc('0x3b')](_0x23bbe4,'UserId'),'role':'agent'},'attributes':['id',_0xb4dc('0x39'),_0xb4dc('0x6a'),'updatedAt','createdAt']});}})[_0xb4dc('0x24')](function(_0x17ef07){if(_0x17ef07){return{'count':_0x17ef07['count'],'rows':_[_0xb4dc('0x3b')](_0x17ef07[_0xb4dc('0x6b')],function(_0x43cb3f){return{'membername':_0x43cb3f[_0xb4dc('0x39')],'UserId':_0x43cb3f['id'],'queue_name':_0x3db353['name'],'ChatQueueId':_0x3db353['id'],'interface':util[_0xb4dc('0x6c')](_0xb4dc('0x6d'),'SIP',_0x43cb3f[_0xb4dc('0x39')]),'penalty':0x0,'paused':_0x43cb3f[_0xb4dc('0x6a')],'createdAt':_0x43cb3f[_0xb4dc('0x6e')],'updatedAt':_0x43cb3f[_0xb4dc('0x6f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb4dc('0x24')](respondWithFilteredResult(_0x28483c,_0x1b1149))[_0xb4dc('0x55')](handleError(_0x28483c,null));};exports[_0xb4dc('0x70')]=function(_0x123fbf,_0xe7dc3f,_0xb80a13){var _0x1466b2={};var _0x40e509={};var _0x11b24e;var _0x17fe8e;return db[_0xb4dc('0x3c')][_0xb4dc('0x63')]({'where':{'id':_0x123fbf[_0xb4dc('0x60')]['id']}})[_0xb4dc('0x24')](handleEntityNotFound(_0xe7dc3f,null))[_0xb4dc('0x24')](function(_0x1f47da){if(_0x1f47da){_0x11b24e=_0x1f47da;_0x40e509[_0xb4dc('0x40')]=_[_0xb4dc('0x41')](db[_0xb4dc('0x71')][_0xb4dc('0x3d')]);_0x40e509[_0xb4dc('0x42')]=_[_0xb4dc('0x41')](_0x123fbf[_0xb4dc('0x42')]);_0x40e509[_0xb4dc('0x43')]=_[_0xb4dc('0x44')](_0x40e509[_0xb4dc('0x40')],_0x40e509[_0xb4dc('0x42')]);_0x1466b2[_0xb4dc('0x46')]=_[_0xb4dc('0x44')](_0x40e509[_0xb4dc('0x40')],qs[_0xb4dc('0x45')](_0x123fbf[_0xb4dc('0x42')][_0xb4dc('0x45')]));_0x1466b2[_0xb4dc('0x46')]=_0x1466b2[_0xb4dc('0x46')][_0xb4dc('0x47')]?_0x1466b2[_0xb4dc('0x46')]:_0x40e509['model'];_0x1466b2[_0xb4dc('0x49')]=qs[_0xb4dc('0x4a')](_0x123fbf[_0xb4dc('0x42')][_0xb4dc('0x4a')]);_0x1466b2[_0xb4dc('0x4b')]=qs[_0xb4dc('0x43')](_[_0xb4dc('0x66')](_0x123fbf[_0xb4dc('0x42')],_0x40e509['filters']));if(_0x123fbf['query'][_0xb4dc('0x4c')]){_0x1466b2['where']=_[_0xb4dc('0x4d')](_0x1466b2[_0xb4dc('0x4b')],{'$or':_['map'](_0x1466b2['attributes'],function(_0xfa9fcd){var _0x4d7eff={};_0x4d7eff[_0xfa9fcd]={'$like':'%'+_0x123fbf[_0xb4dc('0x42')][_0xb4dc('0x4c')]+'%'};return _0x4d7eff;})});}_0x1466b2=_['merge']({},_0x1466b2,_0x123fbf['options']);return _0x11b24e[_0xb4dc('0x70')](_0x1466b2);}})[_0xb4dc('0x24')](function(_0x64b636){if(_0x64b636){_0x17fe8e=_0x64b636['length'];if(!_0x123fbf['query'][_0xb4dc('0x65')](_0xb4dc('0x72'))){_0x1466b2['limit']=qs['limit'](_0x123fbf[_0xb4dc('0x42')][_0xb4dc('0x48')]);_0x1466b2['offset']=qs['offset'](_0x123fbf[_0xb4dc('0x42')][_0xb4dc('0x30')]);}return _0x11b24e['getTeams'](_0x1466b2);}})[_0xb4dc('0x24')](function(_0x1e5ccc){if(_0x1e5ccc){return _0x1e5ccc?{'count':_0x17fe8e,'rows':_0x1e5ccc}:null;}})[_0xb4dc('0x24')](respondWithResult(_0xe7dc3f,null))[_0xb4dc('0x55')](handleError(_0xe7dc3f,null));};exports[_0xb4dc('0x73')]=function(_0x2b4a55,_0x55e82b,_0x108930){var _0x3ffc2b=_0x2b4a55[_0xb4dc('0x57')][_0xb4dc('0x74')];return db[_0xb4dc('0x71')][_0xb4dc('0x52')]({'where':{'id':_0x3ffc2b},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb4dc('0x75'),'attributes':['id',_0xb4dc('0x39'),_0xb4dc('0x76'),_0xb4dc('0x77'),'interface'],'raw':!![]}]})[_0xb4dc('0x24')](function(_0x310136){if(_0x310136){var _0x100974=_[_0xb4dc('0x78')](_0x310136,function(_0x45e797){var _0x160ed5=_0x45e797['get']({'plain':!![]});return _0x160ed5[_0xb4dc('0x75')];});return db[_0xb4dc('0x3c')][_0xb4dc('0x54')]({'where':{'id':_0x2b4a55['params']['id']}})[_0xb4dc('0x24')](function(_0x22cabf){return db[_0xb4dc('0x79')]['transaction'](function(_0x1bc323){return _0x22cabf[_0xb4dc('0x73')](_0x3ffc2b,{'transaction':_0x1bc323})['then'](function(){return BPromise[_0xb4dc('0x7a')](_0x100974,function(_0x5d186f){return db[_0xb4dc('0x64')][_0xb4dc('0x7b')]({'where':{'UserId':_0x5d186f['id'],'ChatQueueId':_0x2b4a55['params']['id']},'transaction':_0x1bc323});});})[_0xb4dc('0x24')](function(){_0x100974['forEach'](function(_0x825c2f){socket[_0xb4dc('0x7c')]('userChatQueue:save',{'UserId':_0x825c2f['id'],'ChatQueueId':_0x22cabf['id']});});});});});}})['then'](respondWithStatusCode(_0x55e82b,null))['catch'](handleError(_0x55e82b,null));};exports[_0xb4dc('0x7d')]=function(_0x19c0b1,_0x401e6b,_0x5adc1d){return db['Team'][_0xb4dc('0x52')]({'where':{'id':_0x19c0b1[_0xb4dc('0x42')][_0xb4dc('0x74')]},'attributes':['id'],'include':[{'model':db[_0xb4dc('0x68')],'as':_0xb4dc('0x75'),'attributes':['id'],'raw':!![]}]})[_0xb4dc('0x24')](handleEntityNotFound(_0x401e6b,null))[_0xb4dc('0x24')](function(_0x21be59){var _0x4ea821=_['map'](_0x21be59,'id');var _0x91ff55=[];var _0x4781d6=[];var _0x1db7cd=squel[_0xb4dc('0x7e')]();_0x1db7cd[_0xb4dc('0x7f')]('tq.TeamId')[_0xb4dc('0x80')]('team_has_chat_queues','tq')[_0xb4dc('0x81')](_0xb4dc('0x82'),'ut',_0xb4dc('0x83'))['where'](_0xb4dc('0x84'),_0x19c0b1['params']['id']);for(var _0x36e587=0x0;_0x36e587<_0x21be59[_0xb4dc('0x47')];_0x36e587+=0x1){let _0x3d5ffb=_0x21be59[_0x36e587];for(var _0x52952c=0x0;_0x52952c<_0x3d5ffb[_0xb4dc('0x75')]['length'];_0x52952c+=0x1){let _0x45175e=_0x3d5ffb[_0xb4dc('0x75')][_0x52952c];var _0x10e109=_0x1db7cd[_0xb4dc('0x85')]();_0x10e109['where'](_0xb4dc('0x86'),_0x45175e['id']);_0x4781d6[_0xb4dc('0x87')](db['sequelize']['query'](_0x10e109[_0xb4dc('0x88')](),{'type':db[_0xb4dc('0x79')][_0xb4dc('0x89')]['SELECT']})[_0xb4dc('0x24')](function(_0x56ebc5){if(_0x56ebc5[_0xb4dc('0x47')]===0x1){return _0x45175e['id'];}else{var _0x3f6925=_[_0xb4dc('0x8a')](_[_0xb4dc('0x3b')](_0x56ebc5,_0xb4dc('0x8b')),function(_0x285ef){return _[_0xb4dc('0x8c')](_0x4ea821,_0x285ef);});if(_0x3f6925){return _0x45175e['id'];}}}));}}return BPromise['all'](_0x4781d6)[_0xb4dc('0x24')](function(_0xaa2448){_0x91ff55=_(_0x91ff55)[_0xb4dc('0x8d')](_0xaa2448)[_0xb4dc('0x8e')]()[_0xb4dc('0x8f')]();return db[_0xb4dc('0x3c')]['find']({'where':{'id':_0x19c0b1['params']['id']}})[_0xb4dc('0x24')](function(_0x4ae8e9){return db[_0xb4dc('0x79')][_0xb4dc('0x90')](function(_0x22b5b1){return _0x4ae8e9[_0xb4dc('0x7d')](_0x19c0b1[_0xb4dc('0x42')][_0xb4dc('0x74')],{'transaction':_0x22b5b1})['then'](function(){if(!_[_0xb4dc('0x91')](_0x91ff55)){return _0x4ae8e9[_0xb4dc('0x92')](_0x91ff55,{'transaction':_0x22b5b1});}})[_0xb4dc('0x24')](function(){_0x91ff55['forEach'](function(_0x589be3){socket[_0xb4dc('0x7c')]('userChatQueue:remove',{'UserId':_0x589be3,'ChatQueueId':_0x4ae8e9['id']});});});});});});})[_0xb4dc('0x24')](respondWithStatusCode(_0x401e6b,null))[_0xb4dc('0x55')](handleError(_0x401e6b,null));};exports['addAgents']=function(_0x1b492c,_0x4764d9,_0x4e1f53){return db[_0xb4dc('0x3c')]['find']({'where':{'id':_0x1b492c[_0xb4dc('0x60')]['id']}})[_0xb4dc('0x24')](handleEntityNotFound(_0x4764d9,null))[_0xb4dc('0x24')](function(_0x3c6705){if(_0x3c6705){return _0x3c6705['addAgents'](_0x1b492c['body'][_0xb4dc('0x74')],_[_0xb4dc('0x93')](_0x1b492c[_0xb4dc('0x57')],[_0xb4dc('0x74'),'id'])||{})[_0xb4dc('0x94')](function(_0x44329e){for(var _0x51b2d9=0x0;_0x51b2d9<_0x1b492c['body'][_0xb4dc('0x74')]['length'];_0x51b2d9+=0x1){socket[_0xb4dc('0x7c')](_0xb4dc('0x95'),{'UserId':_0x1b492c['body'][_0xb4dc('0x74')][_0x51b2d9],'ChatQueueId':_0x1b492c[_0xb4dc('0x60')]['id']});}return _0x44329e;});}})[_0xb4dc('0x24')](respondWithResult(_0x4764d9,null))[_0xb4dc('0x55')](handleError(_0x4764d9,null));};exports[_0xb4dc('0x92')]=function(_0x573c1d,_0x248bbb,_0x57d17b){return db['ChatQueue'][_0xb4dc('0x54')]({'where':{'id':_0x573c1d[_0xb4dc('0x60')]['id']}})['then'](handleEntityNotFound(_0x248bbb,null))[_0xb4dc('0x24')](function(_0x58ca7d){if(_0x58ca7d){return _0x58ca7d[_0xb4dc('0x92')](_0x573c1d[_0xb4dc('0x42')][_0xb4dc('0x74')])[_0xb4dc('0x24')](function(){if(_[_0xb4dc('0x96')](_0x573c1d[_0xb4dc('0x42')][_0xb4dc('0x74')])){for(var _0x17661f=0x0;_0x17661f<_0x573c1d['query']['ids']['length'];_0x17661f+=0x1){socket[_0xb4dc('0x7c')]('userChatQueue:remove',{'UserId':Number(_0x573c1d['query'][_0xb4dc('0x74')][_0x17661f]),'ChatQueueId':Number(_0x573c1d['params']['id'])});}}else{socket[_0xb4dc('0x7c')](_0xb4dc('0x97'),{'UserId':Number(_0x573c1d['query'][_0xb4dc('0x74')]),'ChatQueueId':Number(_0x573c1d[_0xb4dc('0x60')]['id'])});}});}})[_0xb4dc('0x24')](respondWithStatusCode(_0x248bbb,null))['catch'](handleError(_0x248bbb,null));};exports[_0xb4dc('0x98')]=function(_0x2794c8,_0x5c9301,_0x243077){var _0x51cf42={};var _0x247676={};var _0x3ee398;var _0x2624b9;return db['ChatQueue'][_0xb4dc('0x63')]({'where':{'id':_0x2794c8[_0xb4dc('0x60')]['id']}})[_0xb4dc('0x24')](handleEntityNotFound(_0x5c9301,null))[_0xb4dc('0x24')](function(_0x110169){if(_0x110169){_0x3ee398=_0x110169;_0x247676[_0xb4dc('0x40')]=_['keys'](db[_0xb4dc('0x68')][_0xb4dc('0x3d')]);_0x247676[_0xb4dc('0x42')]=_['keys'](_0x2794c8['query']);_0x247676['filters']=_['intersection'](_0x247676[_0xb4dc('0x40')],_0x247676[_0xb4dc('0x42')]);_0x51cf42[_0xb4dc('0x46')]=_[_0xb4dc('0x44')](_0x247676[_0xb4dc('0x40')],qs[_0xb4dc('0x45')](_0x2794c8[_0xb4dc('0x42')][_0xb4dc('0x45')]));_0x51cf42[_0xb4dc('0x46')]=_0x51cf42[_0xb4dc('0x46')][_0xb4dc('0x47')]?_0x51cf42[_0xb4dc('0x46')]:_0x247676[_0xb4dc('0x40')];_0x51cf42[_0xb4dc('0x49')]=qs[_0xb4dc('0x4a')](_0x2794c8[_0xb4dc('0x42')][_0xb4dc('0x4a')]);_0x51cf42[_0xb4dc('0x4b')]=qs[_0xb4dc('0x43')](_['pick'](_0x2794c8[_0xb4dc('0x42')],_0x247676['filters']));if(_0x2794c8[_0xb4dc('0x42')][_0xb4dc('0x4c')]){_0x51cf42[_0xb4dc('0x4b')]=_[_0xb4dc('0x4d')](_0x51cf42[_0xb4dc('0x4b')],{'$or':_[_0xb4dc('0x3b')](_0x51cf42['attributes'],function(_0xc39f30){var _0x1a007c={};_0x1a007c[_0xc39f30]={'$like':'%'+_0x2794c8[_0xb4dc('0x42')]['filter']+'%'};return _0x1a007c;})});}_0x51cf42=_['merge']({},_0x51cf42,_0x2794c8[_0xb4dc('0x4f')]);return _0x3ee398['getAgents'](_0x51cf42);}})[_0xb4dc('0x24')](function(_0x183326){if(_0x183326){_0x2624b9=_0x183326[_0xb4dc('0x47')];if(!_0x2794c8[_0xb4dc('0x42')]['hasOwnProperty'](_0xb4dc('0x72'))){_0x51cf42[_0xb4dc('0x48')]=qs[_0xb4dc('0x48')](_0x2794c8['query']['limit']);_0x51cf42[_0xb4dc('0x30')]=qs['offset'](_0x2794c8[_0xb4dc('0x42')]['offset']);}return _0x3ee398[_0xb4dc('0x98')](_0x51cf42);}})[_0xb4dc('0x24')](function(_0x2c7a04){if(_0x2c7a04){return _0x2c7a04?{'count':_0x2624b9,'rows':_0x2c7a04}:null;}})[_0xb4dc('0x24')](respondWithResult(_0x5c9301,null))[_0xb4dc('0x55')](handleError(_0x5c9301,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index 62677d1..bf6c1ab 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 _0xadb5=['update','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0xadb5,0xad));var _0x5adb=function(_0x30d3ba,_0x36ca50){_0x30d3ba=_0x30d3ba-0x0;var _0x5866ba=_0xadb5[_0x30d3ba];return _0x5866ba;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x5adb('0x0'))['db']['ChatQueue'];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x5adb('0x1')](0x0);var events={'afterCreate':_0x5adb('0x2'),'afterUpdate':_0x5adb('0x3'),'afterDestroy':'remove'};function emitEvent(_0x248dc6){return function(_0x31457,_0x2e3ef4,_0x4cb1d1){ChatQueueEvents[_0x5adb('0x4')](_0x248dc6+':'+_0x31457['id'],_0x31457);ChatQueueEvents[_0x5adb('0x4')](_0x248dc6,_0x31457);_0x4cb1d1(null);};}for(var e in events){if(events[_0x5adb('0x5')](e)){var event=events[e];ChatQueue[_0x5adb('0x6')](e,emitEvent(event));}}module[_0x5adb('0x7')]=ChatQueueEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x44eec,_0x3b05e6){var _0x50e033=function(_0x35efc9){while(--_0x35efc9){_0x44eec['push'](_0x44eec['shift']());}};_0x50e033(++_0x3b05e6);}(_0xb10b,0x12a));var _0xbb10=function(_0x1d426f,_0x37e919){_0x1d426f=_0x1d426f-0x0;var _0x17f71a=_0xb10b[_0x1d426f];return _0x17f71a;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 8a02508..45a39a0 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 _0x8933=['moment','request-promise','path','./chatQueue.attributes','util','../../config/logger','api'];(function(_0xa2585c,_0x2bb089){var _0x14b73a=function(_0x34ef2d){while(--_0x34ef2d){_0xa2585c['push'](_0xa2585c['shift']());}};_0x14b73a(++_0x2bb089);}(_0x8933,0x15b));var _0x3893=function(_0x31e59f,_0x1205dc){_0x31e59f=_0x31e59f-0x0;var _0x1a509b=_0x8933[_0x31e59f];return _0x1a509b;};'use strict';var _=require('lodash');var util=require(_0x3893('0x0'));var logger=require(_0x3893('0x1'))(_0x3893('0x2'));var moment=require(_0x3893('0x3'));var BPromise=require('bluebird');var rp=require(_0x3893('0x4'));var fs=require('fs');var path=require(_0x3893('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3893('0x6'));module['exports']=function(_0x595d62,_0x429ce1){return _0x595d62['define']('ChatQueue',attributes,{'tableName':'chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8faa=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','ChatQueue','chat_queues'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x8faa,0xaa));var _0xa8fa=function(_0x10dbf6,_0x3ff964){_0x10dbf6=_0x10dbf6-0x0;var _0x452147=_0x8faa[_0x10dbf6];return _0x452147;};'use strict';var _=require('lodash');var util=require(_0xa8fa('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xa8fa('0x1'));var BPromise=require(_0xa8fa('0x2'));var rp=require(_0xa8fa('0x3'));var fs=require('fs');var path=require(_0xa8fa('0x4'));var rimraf=require(_0xa8fa('0x5'));var config=require(_0xa8fa('0x6'));var attributes=require(_0xa8fa('0x7'));module['exports']=function(_0x123832,_0x34d2bb){return _0x123832['define'](_0xa8fa('0x8'),attributes,{'tableName':_0xa8fa('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.rpc.js b/server/api/chatQueue/chatQueue.rpc.js index 74bad9a..1040eb0 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 _0x9563=['model','map','ShowChatQueue','ChatQueue','find','where','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatQueue.socket','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetChatQueue','options','raw','attributes','limit','include'];(function(_0x248fc8,_0x121ebf){var _0x1ec5d1=function(_0x4784fc){while(--_0x4784fc){_0x248fc8['push'](_0x248fc8['shift']());}};_0x1ec5d1(++_0x121ebf);}(_0x9563,0x1e7));var _0x3956=function(_0x2d814d,_0x1054a6){_0x2d814d=_0x2d814d-0x0;var _0x4a8f5c=_0x9563[_0x2d814d];return _0x4a8f5c;};'use strict';var _=require(_0x3956('0x0'));var util=require(_0x3956('0x1'));var moment=require('moment');var BPromise=require(_0x3956('0x2'));var rs=require(_0x3956('0x3'));var fs=require('fs');var Redis=require(_0x3956('0x4'));var db=require(_0x3956('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3956('0x6'));var config=require('../../config/environment');var jayson=require(_0x3956('0x7'));var client=jayson[_0x3956('0x8')][_0x3956('0x9')]({'port':0x232a});config[_0x3956('0xa')]=_['defaults'](config[_0x3956('0xa')],{'host':_0x3956('0xb'),'port':0x18eb});var socket=require(_0x3956('0xc'))(new Redis(config[_0x3956('0xa')]));require(_0x3956('0xd'))['register'](socket);function respondWithRpcPromise(_0x4909e2,_0x3cc5cc,_0x283dfb){return new BPromise(function(_0x336973,_0xad495b){return client['request'](_0x4909e2,_0x283dfb)[_0x3956('0xe')](function(_0x19019b){logger[_0x3956('0xf')](_0x3956('0x10'),_0x3cc5cc,_0x3956('0x11'));logger[_0x3956('0x12')](_0x3956('0x13'),_0x3cc5cc,_0x3956('0x11'),JSON[_0x3956('0x14')](_0x19019b));if(_0x19019b['error']){if(_0x19019b['error']['code']===0x1f4){logger[_0x3956('0x15')](_0x3956('0x10'),_0x3cc5cc,_0x19019b['error'][_0x3956('0x16')]);return _0xad495b(_0x19019b[_0x3956('0x15')][_0x3956('0x16')]);}logger[_0x3956('0x15')](_0x3956('0x10'),_0x3cc5cc,_0x19019b[_0x3956('0x15')][_0x3956('0x16')]);return _0x336973(_0x19019b[_0x3956('0x15')][_0x3956('0x16')]);}else{logger[_0x3956('0xf')](_0x3956('0x10'),_0x3cc5cc,_0x3956('0x11'));_0x336973(_0x19019b[_0x3956('0x17')][_0x3956('0x16')]);}})[_0x3956('0x18')](function(_0x434df7){logger[_0x3956('0x15')](_0x3956('0x10'),_0x3cc5cc,_0x434df7);_0xad495b(_0x434df7);});});}exports[_0x3956('0x19')]=function(_0x3a882e){var _0x4b9acc=this;return new Promise(function(_0x3be8ab,_0x401aa2){return db['ChatQueue']['findAll']({'raw':_0x3a882e['options']?_0x3a882e[_0x3956('0x1a')][_0x3956('0x1b')]===undefined?!![]:![]:!![],'where':_0x3a882e['options']?_0x3a882e[_0x3956('0x1a')]['where']||null:null,'attributes':_0x3a882e[_0x3956('0x1a')]?_0x3a882e['options'][_0x3956('0x1c')]||null:null,'limit':_0x3a882e[_0x3956('0x1a')]?_0x3a882e[_0x3956('0x1a')][_0x3956('0x1d')]||null:null,'include':_0x3a882e[_0x3956('0x1a')]?_0x3a882e[_0x3956('0x1a')]['include']?_['map'](_0x3a882e[_0x3956('0x1a')][_0x3956('0x1e')],function(_0x52edaf){return{'model':db[_0x52edaf['model']],'as':_0x52edaf['as'],'attributes':_0x52edaf[_0x3956('0x1c')],'include':_0x52edaf[_0x3956('0x1e')]?_['map'](_0x52edaf[_0x3956('0x1e')],function(_0x34c843){return{'model':db[_0x34c843[_0x3956('0x1f')]],'as':_0x34c843['as'],'attributes':_0x34c843[_0x3956('0x1c')],'include':_0x34c843[_0x3956('0x1e')]?_[_0x3956('0x20')](_0x34c843['include'],function(_0x3fa582){return{'model':db[_0x3fa582[_0x3956('0x1f')]],'as':_0x3fa582['as'],'attributes':_0x3fa582[_0x3956('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x10bf35){logger[_0x3956('0xf')](_0x3956('0x19'),_0x3a882e);logger['debug'](_0x3956('0x19'),_0x3a882e,JSON[_0x3956('0x14')](_0x10bf35));_0x3be8ab(_0x10bf35);})[_0x3956('0x18')](function(_0x1681ba){logger[_0x3956('0x15')](_0x3956('0x19'),_0x1681ba[_0x3956('0x16')],_0x3a882e);_0x401aa2(_0x4b9acc[_0x3956('0x15')](0x1f4,_0x1681ba[_0x3956('0x16')]));});});};exports[_0x3956('0x21')]=function(_0x4cf0e0){var _0x17e769=this;return new Promise(function(_0x14a3a8,_0x501893){return db[_0x3956('0x22')][_0x3956('0x23')]({'raw':_0x4cf0e0['options']?_0x4cf0e0[_0x3956('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x4cf0e0[_0x3956('0x1a')]?_0x4cf0e0[_0x3956('0x1a')][_0x3956('0x24')]||null:null,'attributes':_0x4cf0e0['options']?_0x4cf0e0['options'][_0x3956('0x1c')]||null:null,'include':_0x4cf0e0[_0x3956('0x1a')]?_0x4cf0e0['options'][_0x3956('0x1e')]?_['map'](_0x4cf0e0[_0x3956('0x1a')][_0x3956('0x1e')],function(_0x265eb5){return{'model':db[_0x265eb5[_0x3956('0x1f')]],'as':_0x265eb5['as'],'attributes':_0x265eb5[_0x3956('0x1c')],'include':_0x265eb5[_0x3956('0x1e')]?_[_0x3956('0x20')](_0x265eb5[_0x3956('0x1e')],function(_0x5c6e67){return{'model':db[_0x5c6e67[_0x3956('0x1f')]],'as':_0x5c6e67['as'],'attributes':_0x5c6e67['attributes'],'include':_0x5c6e67[_0x3956('0x1e')]?_[_0x3956('0x20')](_0x5c6e67[_0x3956('0x1e')],function(_0x2577bf){return{'model':db[_0x2577bf[_0x3956('0x1f')]],'as':_0x2577bf['as'],'attributes':_0x2577bf[_0x3956('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x3956('0xe')](function(_0x21d6d0){logger[_0x3956('0xf')](_0x3956('0x21'),_0x4cf0e0);logger[_0x3956('0x12')](_0x3956('0x21'),_0x4cf0e0,JSON['stringify'](_0x21d6d0));_0x14a3a8(_0x21d6d0);})[_0x3956('0x18')](function(_0x1c134e){logger[_0x3956('0x15')](_0x3956('0x21'),_0x1c134e[_0x3956('0x16')],_0x4cf0e0);_0x501893(_0x17e769[_0x3956('0x15')](0x1f4,_0x1c134e[_0x3956('0x16')]));});});}; \ No newline at end of file +var _0x6df9=['error','code','message','result','catch','GetChatQueue','ChatQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','ShowChatQueue','lodash','util','bluebird','../../mysqldb','../../config/logger','../../config/environment','client','http','defaults','redis','localhost','socket.io-emitter','./chatQueue.socket','register','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x4bb66f,_0x3cd682){var _0xf2772f=function(_0x2e3698){while(--_0x2e3698){_0x4bb66f['push'](_0x4bb66f['shift']());}};_0xf2772f(++_0x3cd682);}(_0x6df9,0x84));var _0x96df=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x6df9[_0x3ab51d];return _0x29a04e;};'use strict';var _=require(_0x96df('0x0'));var util=require(_0x96df('0x1'));var moment=require('moment');var BPromise=require(_0x96df('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x96df('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x96df('0x4'))('rpc');var config=require(_0x96df('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x96df('0x6')][_0x96df('0x7')]({'port':0x232a});config['redis']=_[_0x96df('0x8')](config[_0x96df('0x9')],{'host':_0x96df('0xa'),'port':0x18eb});var socket=require(_0x96df('0xb'))(new Redis(config['redis']));require(_0x96df('0xc'))[_0x96df('0xd')](socket);function respondWithRpcPromise(_0x5b6be7,_0x3d7ec7,_0x502f41){return new BPromise(function(_0x173ecf,_0x52c01d){return client['request'](_0x5b6be7,_0x502f41)['then'](function(_0x36ab65){logger[_0x96df('0xe')](_0x96df('0xf'),_0x3d7ec7,_0x96df('0x10'));logger[_0x96df('0x11')](_0x96df('0x12'),_0x3d7ec7,'request\x20sent',JSON[_0x96df('0x13')](_0x36ab65));if(_0x36ab65[_0x96df('0x14')]){if(_0x36ab65[_0x96df('0x14')][_0x96df('0x15')]===0x1f4){logger[_0x96df('0x14')](_0x96df('0xf'),_0x3d7ec7,_0x36ab65['error']['message']);return _0x52c01d(_0x36ab65['error'][_0x96df('0x16')]);}logger[_0x96df('0x14')](_0x96df('0xf'),_0x3d7ec7,_0x36ab65[_0x96df('0x14')][_0x96df('0x16')]);return _0x173ecf(_0x36ab65[_0x96df('0x14')][_0x96df('0x16')]);}else{logger[_0x96df('0xe')](_0x96df('0xf'),_0x3d7ec7,_0x96df('0x10'));_0x173ecf(_0x36ab65[_0x96df('0x17')][_0x96df('0x16')]);}})[_0x96df('0x18')](function(_0x4a74fa){logger[_0x96df('0x14')](_0x96df('0xf'),_0x3d7ec7,_0x4a74fa);_0x52c01d(_0x4a74fa);});});}exports[_0x96df('0x19')]=function(_0x5cf0ab){var _0x26dbec=this;return new Promise(function(_0x5d2beb,_0x6960ef){return db[_0x96df('0x1a')][_0x96df('0x1b')]({'raw':_0x5cf0ab['options']?_0x5cf0ab[_0x96df('0x1c')][_0x96df('0x1d')]===undefined?!![]:![]:!![],'where':_0x5cf0ab[_0x96df('0x1c')]?_0x5cf0ab[_0x96df('0x1c')][_0x96df('0x1e')]||null:null,'attributes':_0x5cf0ab[_0x96df('0x1c')]?_0x5cf0ab['options']['attributes']||null:null,'limit':_0x5cf0ab[_0x96df('0x1c')]?_0x5cf0ab[_0x96df('0x1c')][_0x96df('0x1f')]||null:null,'include':_0x5cf0ab['options']?_0x5cf0ab[_0x96df('0x1c')][_0x96df('0x20')]?_[_0x96df('0x21')](_0x5cf0ab[_0x96df('0x1c')][_0x96df('0x20')],function(_0x2b033e){return{'model':db[_0x2b033e[_0x96df('0x22')]],'as':_0x2b033e['as'],'attributes':_0x2b033e[_0x96df('0x23')],'include':_0x2b033e[_0x96df('0x20')]?_[_0x96df('0x21')](_0x2b033e['include'],function(_0x4fb292){return{'model':db[_0x4fb292['model']],'as':_0x4fb292['as'],'attributes':_0x4fb292[_0x96df('0x23')],'include':_0x4fb292[_0x96df('0x20')]?_['map'](_0x4fb292[_0x96df('0x20')],function(_0x17af9e){return{'model':db[_0x17af9e[_0x96df('0x22')]],'as':_0x17af9e['as'],'attributes':_0x17af9e[_0x96df('0x23')]};}):[]};}):[]};}):[]:[]})[_0x96df('0x24')](function(_0x25eadf){logger[_0x96df('0xe')](_0x96df('0x19'),_0x5cf0ab);logger[_0x96df('0x11')](_0x96df('0x19'),_0x5cf0ab,JSON[_0x96df('0x13')](_0x25eadf));_0x5d2beb(_0x25eadf);})[_0x96df('0x18')](function(_0x3afb8e){logger[_0x96df('0x14')](_0x96df('0x19'),_0x3afb8e[_0x96df('0x16')],_0x5cf0ab);_0x6960ef(_0x26dbec[_0x96df('0x14')](0x1f4,_0x3afb8e[_0x96df('0x16')]));});});};exports[_0x96df('0x25')]=function(_0x2dd170){var _0x11385d=this;return new Promise(function(_0x599bc7,_0x128852){return db[_0x96df('0x1a')]['find']({'raw':_0x2dd170['options']?_0x2dd170[_0x96df('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x2dd170[_0x96df('0x1c')]?_0x2dd170[_0x96df('0x1c')][_0x96df('0x1e')]||null:null,'attributes':_0x2dd170[_0x96df('0x1c')]?_0x2dd170[_0x96df('0x1c')][_0x96df('0x23')]||null:null,'include':_0x2dd170[_0x96df('0x1c')]?_0x2dd170[_0x96df('0x1c')]['include']?_[_0x96df('0x21')](_0x2dd170[_0x96df('0x1c')][_0x96df('0x20')],function(_0x4f30c7){return{'model':db[_0x4f30c7[_0x96df('0x22')]],'as':_0x4f30c7['as'],'attributes':_0x4f30c7[_0x96df('0x23')],'include':_0x4f30c7[_0x96df('0x20')]?_[_0x96df('0x21')](_0x4f30c7[_0x96df('0x20')],function(_0x543350){return{'model':db[_0x543350[_0x96df('0x22')]],'as':_0x543350['as'],'attributes':_0x543350[_0x96df('0x23')],'include':_0x543350[_0x96df('0x20')]?_[_0x96df('0x21')](_0x543350[_0x96df('0x20')],function(_0x356d9e){return{'model':db[_0x356d9e['model']],'as':_0x356d9e['as'],'attributes':_0x356d9e[_0x96df('0x23')]};}):[]};}):[]};}):[]:[]})[_0x96df('0x24')](function(_0x3c3cc4){logger[_0x96df('0xe')](_0x96df('0x25'),_0x2dd170);logger[_0x96df('0x11')]('ShowChatQueue',_0x2dd170,JSON[_0x96df('0x13')](_0x3c3cc4));_0x599bc7(_0x3c3cc4);})['catch'](function(_0x365188){logger['error'](_0x96df('0x25'),_0x365188[_0x96df('0x16')],_0x2dd170);_0x128852(_0x11385d[_0x96df('0x14')](0x1f4,_0x365188['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 1ac1972..672f1bc 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 _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x12f59c,_0x13d956){var _0x2db43e=function(_0x1743fb){while(--_0x1743fb){_0x12f59c['push'](_0x12f59c['shift']());}};_0x2db43e(++_0x13d956);}(_0xb10b,0x12a));var _0xbb10=function(_0x32c40c,_0x5a48c1){_0x32c40c=_0x32c40c-0x0;var _0x56e979=_0xb10b[_0x32c40c];return _0x56e979;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatQueue:','./chatQueue.events','remove','update'];(function(_0x13530a,_0x44630c){var _0x587e70=function(_0x1870fb){while(--_0x1870fb){_0x13530a['push'](_0x13530a['shift']());}};_0x587e70(++_0x44630c);}(_0xb10b,0x12a));var _0xbb10=function(_0x98ac1f,_0x2effb0){_0x98ac1f=_0x98ac1f-0x0;var _0x1579d1=_0xb10b[_0x98ac1f];return _0x1579d1;};'use strict';var ChatQueueEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatQueueEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatQueueEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index ba87f38..619b2e7 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 _0x6e4e=['../../config/environment','./chatQueue.controller','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','delete','destroy','removeTeams','removeAgents','exports','path','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x348652,_0x1ab849){var _0x18a9ea=function(_0x3fd540){while(--_0x3fd540){_0x348652['push'](_0x348652['shift']());}};_0x18a9ea(++_0x1ab849);}(_0x6e4e,0x1cb));var _0xe6e4=function(_0x57aab0,_0x2432c3){_0x57aab0=_0x57aab0-0x0;var _0x2e2acb=_0x6e4e[_0x57aab0];return _0x2e2acb;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe6e4('0x0'));var timeout=require('connect-timeout');var express=require(_0xe6e4('0x1'));var router=express[_0xe6e4('0x2')]();var auth=require(_0xe6e4('0x3'));var interaction=require(_0xe6e4('0x4'));var config=require(_0xe6e4('0x5'));var controller=require(_0xe6e4('0x6'));router[_0xe6e4('0x7')]('/',auth[_0xe6e4('0x8')](),controller[_0xe6e4('0x9')]);router[_0xe6e4('0x7')]('/describe',auth[_0xe6e4('0x8')](),controller[_0xe6e4('0xa')]);router[_0xe6e4('0x7')](_0xe6e4('0xb'),auth[_0xe6e4('0x8')](),controller[_0xe6e4('0xc')]);router[_0xe6e4('0x7')](_0xe6e4('0xd'),auth[_0xe6e4('0x8')](),controller[_0xe6e4('0xe')]);router['get'](_0xe6e4('0xf'),auth[_0xe6e4('0x8')](),controller[_0xe6e4('0x10')]);router[_0xe6e4('0x7')](_0xe6e4('0x11'),auth[_0xe6e4('0x8')](),controller[_0xe6e4('0x12')]);router[_0xe6e4('0x13')]('/',auth[_0xe6e4('0x8')](),controller[_0xe6e4('0x14')]);router[_0xe6e4('0x13')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe6e4('0x15')]);router[_0xe6e4('0x13')](_0xe6e4('0x11'),auth[_0xe6e4('0x8')](),controller[_0xe6e4('0x16')]);router['put'](_0xe6e4('0xb'),auth[_0xe6e4('0x8')](),controller[_0xe6e4('0x17')]);router[_0xe6e4('0x18')]('/:id',auth[_0xe6e4('0x8')](),controller[_0xe6e4('0x19')]);router['delete'](_0xe6e4('0xf'),auth['isAuthenticated'](),controller[_0xe6e4('0x1a')]);router[_0xe6e4('0x18')](_0xe6e4('0x11'),auth[_0xe6e4('0x8')](),controller[_0xe6e4('0x1b')]);module[_0xe6e4('0x1c')]=router; \ No newline at end of file +var _0xadb7=['getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','delete','destroy','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/teams'];(function(_0x5b23f2,_0x10bf6c){var _0x41a7bd=function(_0x5e1e69){while(--_0x5e1e69){_0x5b23f2['push'](_0x5b23f2['shift']());}};_0x41a7bd(++_0x10bf6c);}(_0xadb7,0x1a2));var _0x7adb=function(_0x3c67e7,_0x505818){_0x3c67e7=_0x3c67e7-0x0;var _0x575090=_0xadb7[_0x3c67e7];return _0x575090;};'use strict';var multer=require(_0x7adb('0x0'));var util=require('util');var path=require(_0x7adb('0x1'));var timeout=require(_0x7adb('0x2'));var express=require(_0x7adb('0x3'));var router=express[_0x7adb('0x4')]();var auth=require(_0x7adb('0x5'));var interaction=require(_0x7adb('0x6'));var config=require(_0x7adb('0x7'));var controller=require(_0x7adb('0x8'));router[_0x7adb('0x9')]('/',auth[_0x7adb('0xa')](),controller[_0x7adb('0xb')]);router[_0x7adb('0x9')](_0x7adb('0xc'),auth['isAuthenticated'](),controller[_0x7adb('0xd')]);router[_0x7adb('0x9')](_0x7adb('0xe'),auth[_0x7adb('0xa')](),controller[_0x7adb('0xf')]);router[_0x7adb('0x9')]('/:id/members',auth[_0x7adb('0xa')](),controller['getMembers']);router[_0x7adb('0x9')](_0x7adb('0x10'),auth[_0x7adb('0xa')](),controller[_0x7adb('0x11')]);router[_0x7adb('0x9')](_0x7adb('0x12'),auth[_0x7adb('0xa')](),controller[_0x7adb('0x13')]);router[_0x7adb('0x14')]('/',auth[_0x7adb('0xa')](),controller[_0x7adb('0x15')]);router[_0x7adb('0x14')](_0x7adb('0x10'),auth[_0x7adb('0xa')](),controller[_0x7adb('0x16')]);router[_0x7adb('0x14')](_0x7adb('0x12'),auth[_0x7adb('0xa')](),controller[_0x7adb('0x17')]);router[_0x7adb('0x18')](_0x7adb('0xe'),auth[_0x7adb('0xa')](),controller['update']);router[_0x7adb('0x19')](_0x7adb('0xe'),auth[_0x7adb('0xa')](),controller[_0x7adb('0x1a')]);router[_0x7adb('0x19')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x7adb('0x19')](_0x7adb('0x12'),auth[_0x7adb('0xa')](),controller[_0x7adb('0x1b')]);module[_0x7adb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 80aaf46..091a9ee 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 _0x360d=['sequelize','exports','STRING','DATE','moment'];(function(_0x2d40cf,_0x547148){var _0x165b55=function(_0xe60705){while(--_0xe60705){_0x2d40cf['push'](_0x2d40cf['shift']());}};_0x165b55(++_0x547148);}(_0x360d,0xd1));var _0xd360=function(_0x35468d,_0x2a7240){_0x35468d=_0x35468d-0x0;var _0x30da52=_0x360d[_0x35468d];return _0x30da52;};'use strict';var moment=require(_0xd360('0x0'));var Sequelize=require(_0xd360('0x1'));module[_0xd360('0x2')]={'uniqueid':{'type':Sequelize[_0xd360('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xd360('0x4')]},'leaveAt':{'type':Sequelize[_0xd360('0x4')]},'acceptAt':{'type':Sequelize[_0xd360('0x4')]},'exitAt':{'type':Sequelize[_0xd360('0x4')]},'reason':{'type':Sequelize[_0xd360('0x3')]}}; \ No newline at end of file +var _0x21c8=['exports','STRING','DATE','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x21c8,0x1c7));var _0x821c=function(_0xc889e1,_0x438415){_0xc889e1=_0xc889e1-0x0;var _0x17ab9e=_0x21c8[_0xc889e1];return _0x17ab9e;};'use strict';var moment=require('moment');var Sequelize=require(_0x821c('0x0'));module[_0x821c('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x821c('0x2')]},'joinAt':{'type':Sequelize[_0x821c('0x3')]},'leaveAt':{'type':Sequelize[_0x821c('0x3')]},'acceptAt':{'type':Sequelize[_0x821c('0x3')]},'exitAt':{'type':Sequelize[_0x821c('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 176ee38..4a1bc0c 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 _0x5371=['find','create','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ChatQueueReport','rawAttributes','fieldName','type','key','model','map','keys','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show'];(function(_0x178c2a,_0x517cf4){var _0x549c06=function(_0x16dbea){while(--_0x16dbea){_0x178c2a['push'](_0x178c2a['shift']());}};_0x549c06(++_0x517cf4);}(_0x5371,0xe3));var _0x1537=function(_0x38708f,_0x2565c8){_0x38708f=_0x38708f-0x0;var _0x623f32=_0x5371[_0x38708f];return _0x623f32;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1537('0x0'));var rimraf=require(_0x1537('0x1'));var zipdir=require(_0x1537('0x2'));var jsonpatch=require(_0x1537('0x3'));var rp=require(_0x1537('0x4'));var moment=require(_0x1537('0x5'));var BPromise=require(_0x1537('0x6'));var Mustache=require(_0x1537('0x7'));var util=require(_0x1537('0x8'));var path=require('path');var sox=require(_0x1537('0x9'));var csv=require(_0x1537('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1537('0xb'));var squel=require(_0x1537('0xc'));var crypto=require(_0x1537('0xd'));var jsforce=require(_0x1537('0xe'));var deskjs=require(_0x1537('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1537('0x10'));var Papa=require(_0x1537('0x11'));var Redis=require('ioredis');var authService=require(_0x1537('0x12'));var qs=require(_0x1537('0x13'));var as=require(_0x1537('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1537('0x15'))(_0x1537('0x16'));var utils=require('../../config/utils');var config=require(_0x1537('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21d881,_0x37063b){_0x37063b=_0x37063b||0xcc;return function(_0x10a0a5){if(_0x10a0a5){return _0x21d881[_0x1537('0x18')](_0x37063b);}return _0x21d881[_0x1537('0x19')](_0x37063b)[_0x1537('0x1a')]();};}function respondWithResult(_0x56bb19,_0x164117){_0x164117=_0x164117||0xc8;return function(_0xe003dc){if(_0xe003dc){return _0x56bb19['status'](_0x164117)['json'](_0xe003dc);}};}function respondWithFilteredResult(_0x1b6fe3,_0x598273){return function(_0x8e17b6){if(_0x8e17b6){var _0xf626e1=_0x8e17b6[_0x1537('0x1b')],_0x448a0a=_0x598273[_0x1537('0x1c')],_0x5069ad=_0x598273['offset']+_0x598273[_0x1537('0x1d')],_0x1e8e97;if(_0x5069ad>=_0xf626e1){_0x5069ad=_0xf626e1;_0x1e8e97=0xc8;}else{_0x1e8e97=0xce;}_0x1b6fe3[_0x1537('0x19')](_0x1e8e97);return _0x1b6fe3[_0x1537('0x1e')](_0x1537('0x1f'),_0x448a0a+'-'+_0x5069ad+'/'+_0xf626e1)['json'](_0x8e17b6);}return null;};}function patchUpdates(_0x59f4ad){return function(_0x2d6639){try{jsonpatch[_0x1537('0x20')](_0x2d6639,_0x59f4ad,!![]);}catch(_0x2ca9d5){return BPromise[_0x1537('0x21')](_0x2ca9d5);}return _0x2d6639[_0x1537('0x22')]();};}function saveUpdates(_0x214b72,_0x2b9465){return function(_0x56b769){if(_0x56b769){return _0x56b769[_0x1537('0x23')](_0x214b72)[_0x1537('0x24')](function(_0x548e29){return _0x548e29;});}return null;};}function removeEntity(_0x4a3f6f,_0x426d0a){return function(_0x36007d){if(_0x36007d){return _0x36007d[_0x1537('0x25')]()[_0x1537('0x24')](function(){_0x4a3f6f[_0x1537('0x19')](0xcc)[_0x1537('0x1a')]();});}};}function handleEntityNotFound(_0x165993,_0x43f12b){return function(_0x4d24bd){if(!_0x4d24bd){_0x165993[_0x1537('0x18')](0x194);}return _0x4d24bd;};}function handleError(_0x44a58c,_0x4b4c6e){_0x4b4c6e=_0x4b4c6e||0x1f4;return function(_0x1b4ad6){logger[_0x1537('0x26')](_0x1b4ad6['stack']);if(_0x1b4ad6[_0x1537('0x27')]){delete _0x1b4ad6[_0x1537('0x27')];}_0x44a58c[_0x1537('0x19')](_0x4b4c6e)[_0x1537('0x28')](_0x1b4ad6);};}exports[_0x1537('0x29')]=function(_0x1ad64e,_0x1ea0fa){var _0x11348b={},_0x7af646={},_0x478e8e={'count':0x0,'rows':[]};var _0x1c2a92=_['map'](db[_0x1537('0x2a')][_0x1537('0x2b')],function(_0x179802){return{'name':_0x179802[_0x1537('0x2c')],'type':_0x179802[_0x1537('0x2d')][_0x1537('0x2e')]};});_0x7af646[_0x1537('0x2f')]=_[_0x1537('0x30')](_0x1c2a92,_0x1537('0x27'));_0x7af646['query']=_[_0x1537('0x31')](_0x1ad64e[_0x1537('0x32')]);_0x7af646['filters']=_[_0x1537('0x33')](_0x7af646[_0x1537('0x2f')],_0x7af646[_0x1537('0x32')]);_0x11348b['attributes']=_[_0x1537('0x33')](_0x7af646['model'],qs[_0x1537('0x34')](_0x1ad64e[_0x1537('0x32')][_0x1537('0x34')]));_0x11348b[_0x1537('0x35')]=_0x11348b['attributes'][_0x1537('0x36')]?_0x11348b[_0x1537('0x35')]:_0x7af646[_0x1537('0x2f')];if(!_0x1ad64e['query'][_0x1537('0x37')]('nolimit')){_0x11348b['limit']=qs[_0x1537('0x1d')](_0x1ad64e[_0x1537('0x32')][_0x1537('0x1d')]);_0x11348b[_0x1537('0x1c')]=qs['offset'](_0x1ad64e[_0x1537('0x32')][_0x1537('0x1c')]);}_0x11348b[_0x1537('0x38')]=qs['sort'](_0x1ad64e[_0x1537('0x32')][_0x1537('0x39')]);_0x11348b[_0x1537('0x3a')]=qs[_0x1537('0x3b')](_[_0x1537('0x3c')](_0x1ad64e[_0x1537('0x32')],_0x7af646['filters']));if(_0x1ad64e[_0x1537('0x32')][_0x1537('0x3d')]){_0x11348b[_0x1537('0x3a')]=_[_0x1537('0x3e')](_0x11348b['where'],{'$or':_[_0x1537('0x30')](_0x1c2a92,function(_0x363c06){if(_0x363c06[_0x1537('0x2d')]!==_0x1537('0x3f')){var _0x512a23={};_0x512a23[_0x363c06['name']]={'$like':'%'+_0x1ad64e['query'][_0x1537('0x3d')]+'%'};return _0x512a23;}})});}_0x11348b=_[_0x1537('0x3e')]({},_0x11348b,_0x1ad64e[_0x1537('0x40')]);var _0x42099d={'where':_0x11348b[_0x1537('0x3a')]};return db['ChatQueueReport'][_0x1537('0x1b')](_0x42099d)['then'](function(_0x33b19b){_0x478e8e[_0x1537('0x1b')]=_0x33b19b;if(_0x1ad64e[_0x1537('0x32')][_0x1537('0x41')]){_0x11348b[_0x1537('0x42')]=[{'all':!![]}];}return db[_0x1537('0x2a')]['findAll'](_0x11348b);})[_0x1537('0x24')](function(_0x5506ca){_0x478e8e['rows']=_0x5506ca;return _0x478e8e;})[_0x1537('0x24')](respondWithFilteredResult(_0x1ea0fa,_0x11348b))[_0x1537('0x43')](handleError(_0x1ea0fa,null));};exports[_0x1537('0x44')]=function(_0x425c2b,_0x7df0c4){var _0x4140da={'raw':!![],'where':{'id':_0x425c2b['params']['id']}},_0x127ef0={};_0x127ef0['model']=_[_0x1537('0x31')](db[_0x1537('0x2a')][_0x1537('0x2b')]);_0x127ef0[_0x1537('0x32')]=_[_0x1537('0x31')](_0x425c2b[_0x1537('0x32')]);_0x127ef0['filters']=_['intersection'](_0x127ef0['model'],_0x127ef0[_0x1537('0x32')]);_0x4140da[_0x1537('0x35')]=_[_0x1537('0x33')](_0x127ef0['model'],qs[_0x1537('0x34')](_0x425c2b[_0x1537('0x32')][_0x1537('0x34')]));_0x4140da[_0x1537('0x35')]=_0x4140da['attributes'][_0x1537('0x36')]?_0x4140da['attributes']:_0x127ef0[_0x1537('0x2f')];if(_0x425c2b[_0x1537('0x32')]['includeAll']){_0x4140da[_0x1537('0x42')]=[{'all':!![]}];}_0x4140da=_[_0x1537('0x3e')]({},_0x4140da,_0x425c2b['options']);return db[_0x1537('0x2a')][_0x1537('0x45')](_0x4140da)[_0x1537('0x24')](handleEntityNotFound(_0x7df0c4,null))[_0x1537('0x24')](respondWithResult(_0x7df0c4,null))[_0x1537('0x43')](handleError(_0x7df0c4,null));};exports[_0x1537('0x46')]=function(_0x31d230,_0x2aba91){return db['ChatQueueReport'][_0x1537('0x46')](_0x31d230[_0x1537('0x47')],{})[_0x1537('0x24')](respondWithResult(_0x2aba91,0xc9))[_0x1537('0x43')](handleError(_0x2aba91,null));};exports['update']=function(_0x4e871a,_0x41aa06){if(_0x4e871a[_0x1537('0x47')]['id']){delete _0x4e871a['body']['id'];}return db[_0x1537('0x2a')][_0x1537('0x45')]({'where':{'id':_0x4e871a[_0x1537('0x48')]['id']}})[_0x1537('0x24')](handleEntityNotFound(_0x41aa06,null))[_0x1537('0x24')](saveUpdates(_0x4e871a['body'],null))[_0x1537('0x24')](respondWithResult(_0x41aa06,null))['catch'](handleError(_0x41aa06,null));};exports[_0x1537('0x25')]=function(_0x235c7c,_0x601c5d){return db[_0x1537('0x2a')][_0x1537('0x45')]({'where':{'id':_0x235c7c[_0x1537('0x48')]['id']}})['then'](handleEntityNotFound(_0x601c5d,null))[_0x1537('0x24')](removeEntity(_0x601c5d,null))[_0x1537('0x43')](handleError(_0x601c5d,null));};exports[_0x1537('0x49')]=function(_0x3ecf40,_0x4a1915){return db[_0x1537('0x2a')][_0x1537('0x49')]()[_0x1537('0x24')](respondWithResult(_0x4a1915,null))['catch'](handleError(_0x4a1915,null));}; \ No newline at end of file +var _0x4de7=['papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','ChatQueueReport','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','length','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x5c1568,_0x5fc976){var _0xac4903=function(_0x424d76){while(--_0x424d76){_0x5c1568['push'](_0x5c1568['shift']());}};_0xac4903(++_0x5fc976);}(_0x4de7,0xd6));var _0x74de=function(_0x4c63d0,_0x3b7db8){_0x4c63d0=_0x4c63d0-0x0;var _0x3d19f1=_0x4de7[_0x4c63d0];return _0x3d19f1;};'use strict';var pdf=require(_0x74de('0x0'));var emlformat=require(_0x74de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x74de('0x2'));var jsonpatch=require(_0x74de('0x3'));var rp=require(_0x74de('0x4'));var moment=require(_0x74de('0x5'));var BPromise=require(_0x74de('0x6'));var Mustache=require(_0x74de('0x7'));var util=require(_0x74de('0x8'));var path=require('path');var sox=require(_0x74de('0x9'));var csv=require(_0x74de('0xa'));var ejs=require(_0x74de('0xb'));var fs=require('fs');var _=require(_0x74de('0xc'));var squel=require(_0x74de('0xd'));var crypto=require(_0x74de('0xe'));var jsforce=require(_0x74de('0xf'));var deskjs=require(_0x74de('0x10'));var toCsv=require(_0x74de('0xa'));var querystring=require('querystring');var Papa=require(_0x74de('0x11'));var Redis=require('ioredis');var authService=require(_0x74de('0x12'));var qs=require(_0x74de('0x13'));var as=require(_0x74de('0x14'));var hardwareService=require(_0x74de('0x15'));var logger=require(_0x74de('0x16'))(_0x74de('0x17'));var utils=require('../../config/utils');var config=require(_0x74de('0x18'));var db=require(_0x74de('0x19'))['db'];function respondWithStatusCode(_0x2b061e,_0x13c64a){_0x13c64a=_0x13c64a||0xcc;return function(_0x43e926){if(_0x43e926){return _0x2b061e[_0x74de('0x1a')](_0x13c64a);}return _0x2b061e['status'](_0x13c64a)[_0x74de('0x1b')]();};}function respondWithResult(_0x1cd668,_0x43ce67){_0x43ce67=_0x43ce67||0xc8;return function(_0x2d26c8){if(_0x2d26c8){return _0x1cd668['status'](_0x43ce67)[_0x74de('0x1c')](_0x2d26c8);}};}function respondWithFilteredResult(_0x3eaa6a,_0x2c44cd){return function(_0x1845c0){if(_0x1845c0){var _0x9a8698=_0x1845c0[_0x74de('0x1d')],_0x26fbf1=_0x2c44cd[_0x74de('0x1e')],_0x1b60eb=_0x2c44cd[_0x74de('0x1e')]+_0x2c44cd['limit'],_0x1c9b57;if(_0x1b60eb>=_0x9a8698){_0x1b60eb=_0x9a8698;_0x1c9b57=0xc8;}else{_0x1c9b57=0xce;}_0x3eaa6a[_0x74de('0x1f')](_0x1c9b57);return _0x3eaa6a[_0x74de('0x20')](_0x74de('0x21'),_0x26fbf1+'-'+_0x1b60eb+'/'+_0x9a8698)[_0x74de('0x1c')](_0x1845c0);}return null;};}function patchUpdates(_0x4352b5){return function(_0x414381){try{jsonpatch[_0x74de('0x22')](_0x414381,_0x4352b5,!![]);}catch(_0x54cd9c){return BPromise[_0x74de('0x23')](_0x54cd9c);}return _0x414381[_0x74de('0x24')]();};}function saveUpdates(_0x16be9d,_0xe3d95){return function(_0xd4f222){if(_0xd4f222){return _0xd4f222[_0x74de('0x25')](_0x16be9d)[_0x74de('0x26')](function(_0x42013c){return _0x42013c;});}return null;};}function removeEntity(_0x70e640,_0x360fdc){return function(_0x323f7f){if(_0x323f7f){return _0x323f7f[_0x74de('0x27')]()[_0x74de('0x26')](function(){_0x70e640['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d2c63,_0x26ab29){return function(_0x95711f){if(!_0x95711f){_0x5d2c63[_0x74de('0x1a')](0x194);}return _0x95711f;};}function handleError(_0x2377c9,_0x4bce76){_0x4bce76=_0x4bce76||0x1f4;return function(_0xf24ff8){logger[_0x74de('0x28')](_0xf24ff8[_0x74de('0x29')]);if(_0xf24ff8[_0x74de('0x2a')]){delete _0xf24ff8[_0x74de('0x2a')];}_0x2377c9[_0x74de('0x1f')](_0x4bce76)['send'](_0xf24ff8);};}exports[_0x74de('0x2b')]=function(_0x3a0e13,_0x902aea){var _0x5694df={},_0x5d3b6a={},_0x3181f0={'count':0x0,'rows':[]};var _0xb9a324=_['map'](db[_0x74de('0x2c')]['rawAttributes'],function(_0x36c57d){return{'name':_0x36c57d['fieldName'],'type':_0x36c57d[_0x74de('0x2d')][_0x74de('0x2e')]};});_0x5d3b6a[_0x74de('0x2f')]=_[_0x74de('0x30')](_0xb9a324,_0x74de('0x2a'));_0x5d3b6a[_0x74de('0x31')]=_[_0x74de('0x32')](_0x3a0e13['query']);_0x5d3b6a[_0x74de('0x33')]=_[_0x74de('0x34')](_0x5d3b6a['model'],_0x5d3b6a['query']);_0x5694df[_0x74de('0x35')]=_[_0x74de('0x34')](_0x5d3b6a[_0x74de('0x2f')],qs[_0x74de('0x36')](_0x3a0e13[_0x74de('0x31')][_0x74de('0x36')]));_0x5694df['attributes']=_0x5694df[_0x74de('0x35')]['length']?_0x5694df[_0x74de('0x35')]:_0x5d3b6a[_0x74de('0x2f')];if(!_0x3a0e13['query'][_0x74de('0x37')]('nolimit')){_0x5694df[_0x74de('0x38')]=qs[_0x74de('0x38')](_0x3a0e13[_0x74de('0x31')][_0x74de('0x38')]);_0x5694df[_0x74de('0x1e')]=qs['offset'](_0x3a0e13[_0x74de('0x31')][_0x74de('0x1e')]);}_0x5694df[_0x74de('0x39')]=qs[_0x74de('0x3a')](_0x3a0e13[_0x74de('0x31')]['sort']);_0x5694df['where']=qs['filters'](_[_0x74de('0x3b')](_0x3a0e13[_0x74de('0x31')],_0x5d3b6a[_0x74de('0x33')]));if(_0x3a0e13['query'][_0x74de('0x3c')]){_0x5694df[_0x74de('0x3d')]=_[_0x74de('0x3e')](_0x5694df['where'],{'$or':_['map'](_0xb9a324,function(_0x2c830e){if(_0x2c830e[_0x74de('0x2d')]!==_0x74de('0x3f')){var _0x32fdd4={};_0x32fdd4[_0x2c830e[_0x74de('0x2a')]]={'$like':'%'+_0x3a0e13['query'][_0x74de('0x3c')]+'%'};return _0x32fdd4;}})});}_0x5694df=_['merge']({},_0x5694df,_0x3a0e13[_0x74de('0x40')]);var _0x2bb4ab={'where':_0x5694df['where']};return db[_0x74de('0x2c')][_0x74de('0x1d')](_0x2bb4ab)[_0x74de('0x26')](function(_0x11d884){_0x3181f0[_0x74de('0x1d')]=_0x11d884;if(_0x3a0e13['query']['includeAll']){_0x5694df[_0x74de('0x41')]=[{'all':!![]}];}return db[_0x74de('0x2c')][_0x74de('0x42')](_0x5694df);})['then'](function(_0x2404c4){_0x3181f0[_0x74de('0x43')]=_0x2404c4;return _0x3181f0;})[_0x74de('0x26')](respondWithFilteredResult(_0x902aea,_0x5694df))[_0x74de('0x44')](handleError(_0x902aea,null));};exports[_0x74de('0x45')]=function(_0x11a7c3,_0x570a27){var _0x4fd125={'raw':!![],'where':{'id':_0x11a7c3[_0x74de('0x46')]['id']}},_0x1b10e5={};_0x1b10e5[_0x74de('0x2f')]=_[_0x74de('0x32')](db[_0x74de('0x2c')][_0x74de('0x47')]);_0x1b10e5[_0x74de('0x31')]=_[_0x74de('0x32')](_0x11a7c3[_0x74de('0x31')]);_0x1b10e5[_0x74de('0x33')]=_[_0x74de('0x34')](_0x1b10e5[_0x74de('0x2f')],_0x1b10e5[_0x74de('0x31')]);_0x4fd125[_0x74de('0x35')]=_[_0x74de('0x34')](_0x1b10e5[_0x74de('0x2f')],qs[_0x74de('0x36')](_0x11a7c3[_0x74de('0x31')][_0x74de('0x36')]));_0x4fd125[_0x74de('0x35')]=_0x4fd125[_0x74de('0x35')][_0x74de('0x48')]?_0x4fd125[_0x74de('0x35')]:_0x1b10e5[_0x74de('0x2f')];if(_0x11a7c3[_0x74de('0x31')]['includeAll']){_0x4fd125[_0x74de('0x41')]=[{'all':!![]}];}_0x4fd125=_['merge']({},_0x4fd125,_0x11a7c3[_0x74de('0x40')]);return db[_0x74de('0x2c')][_0x74de('0x49')](_0x4fd125)['then'](handleEntityNotFound(_0x570a27,null))[_0x74de('0x26')](respondWithResult(_0x570a27,null))[_0x74de('0x44')](handleError(_0x570a27,null));};exports[_0x74de('0x4a')]=function(_0x2cd10c,_0x37b978){return db[_0x74de('0x2c')]['create'](_0x2cd10c['body'],{})[_0x74de('0x26')](respondWithResult(_0x37b978,0xc9))[_0x74de('0x44')](handleError(_0x37b978,null));};exports[_0x74de('0x25')]=function(_0x5c2c33,_0x723603){if(_0x5c2c33[_0x74de('0x4b')]['id']){delete _0x5c2c33[_0x74de('0x4b')]['id'];}return db[_0x74de('0x2c')][_0x74de('0x49')]({'where':{'id':_0x5c2c33[_0x74de('0x46')]['id']}})[_0x74de('0x26')](handleEntityNotFound(_0x723603,null))[_0x74de('0x26')](saveUpdates(_0x5c2c33[_0x74de('0x4b')],null))[_0x74de('0x26')](respondWithResult(_0x723603,null))[_0x74de('0x44')](handleError(_0x723603,null));};exports['destroy']=function(_0x2b3330,_0x1b0506){return db[_0x74de('0x2c')][_0x74de('0x49')]({'where':{'id':_0x2b3330['params']['id']}})['then'](handleEntityNotFound(_0x1b0506,null))[_0x74de('0x26')](removeEntity(_0x1b0506,null))['catch'](handleError(_0x1b0506,null));};exports[_0x74de('0x4c')]=function(_0x31c5e0,_0x3e6997){return db[_0x74de('0x2c')][_0x74de('0x4c')]()[_0x74de('0x26')](respondWithResult(_0x3e6997,null))[_0x74de('0x44')](handleError(_0x3e6997,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 3251106..ac7b36c 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 _0x0a13=['lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./chatQueueReport.attributes','exports','define','ChatQueueReport','uniqueid'];(function(_0x18fd45,_0x203a72){var _0x387f13=function(_0x2eda01){while(--_0x2eda01){_0x18fd45['push'](_0x18fd45['shift']());}};_0x387f13(++_0x203a72);}(_0x0a13,0x18c));var _0x30a1=function(_0x212bf5,_0x165cbd){_0x212bf5=_0x212bf5-0x0;var _0xfcad21=_0x0a13[_0x212bf5];return _0xfcad21;};'use strict';var _=require(_0x30a1('0x0'));var util=require('util');var logger=require(_0x30a1('0x1'))(_0x30a1('0x2'));var moment=require(_0x30a1('0x3'));var BPromise=require(_0x30a1('0x4'));var rp=require(_0x30a1('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x30a1('0x6'));var config=require('../../config/environment');var attributes=require(_0x30a1('0x7'));module[_0x30a1('0x8')]=function(_0x35b3b5,_0x43cd49){return _0x35b3b5[_0x30a1('0x9')](_0x30a1('0xa'),attributes,{'tableName':'report_chat_queue','paranoid':![],'indexes':[{'name':_0x30a1('0xb'),'fields':[_0x30a1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0dff=['report_chat_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport'];(function(_0x44d6c8,_0x4dbe3e){var _0x4d63ca=function(_0x2d71b2){while(--_0x2d71b2){_0x44d6c8['push'](_0x44d6c8['shift']());}};_0x4d63ca(++_0x4dbe3e);}(_0x0dff,0x10c));var _0xf0df=function(_0x473a13,_0x57c683){_0x473a13=_0x473a13-0x0;var _0x35121f=_0x0dff[_0x473a13];return _0x35121f;};'use strict';var _=require(_0xf0df('0x0'));var util=require(_0xf0df('0x1'));var logger=require('../../config/logger')(_0xf0df('0x2'));var moment=require(_0xf0df('0x3'));var BPromise=require(_0xf0df('0x4'));var rp=require(_0xf0df('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf0df('0x6'));var config=require(_0xf0df('0x7'));var attributes=require(_0xf0df('0x8'));module[_0xf0df('0x9')]=function(_0x307796,_0x557196){return _0x307796[_0xf0df('0xa')](_0xf0df('0xb'),attributes,{'tableName':_0xf0df('0xc'),'paranoid':![],'indexes':[{'name':_0xf0df('0xd'),'fields':[_0xf0df('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index 5caf83f..18f1984 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 _0xb35b=['error','code','message','catch','CreateChatQueueReport','create','options','raw','debug','UpdateChatQueueReport','ChatQueueReport','update','body','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','ChatQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x109a54,_0x708fc7){var _0x5134dc=function(_0xa11441){while(--_0xa11441){_0x109a54['push'](_0x109a54['shift']());}};_0x5134dc(++_0x708fc7);}(_0xb35b,0x1bd));var _0xbb35=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0xb35b[_0x1c546c];return _0x2cc384;};'use strict';var _=require(_0xbb35('0x0'));var util=require('util');var moment=require(_0xbb35('0x1'));var BPromise=require(_0xbb35('0x2'));var rs=require(_0xbb35('0x3'));var fs=require('fs');var Redis=require(_0xbb35('0x4'));var db=require(_0xbb35('0x5'))['db'];var utils=require(_0xbb35('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xbb35('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbb35('0x8')][_0xbb35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x540751,_0x4a1b72,_0x2dd4f1){return new BPromise(function(_0x330771,_0x3720ca){return client[_0xbb35('0xa')](_0x540751,_0x2dd4f1)[_0xbb35('0xb')](function(_0x351d9d){logger[_0xbb35('0xc')](_0xbb35('0xd'),_0x4a1b72,'request\x20sent');logger['debug'](_0xbb35('0xe'),_0x4a1b72,_0xbb35('0xf'),JSON[_0xbb35('0x10')](_0x351d9d));if(_0x351d9d['error']){if(_0x351d9d[_0xbb35('0x11')][_0xbb35('0x12')]===0x1f4){logger[_0xbb35('0x11')](_0xbb35('0xd'),_0x4a1b72,_0x351d9d[_0xbb35('0x11')]['message']);return _0x3720ca(_0x351d9d[_0xbb35('0x11')]['message']);}logger[_0xbb35('0x11')](_0xbb35('0xd'),_0x4a1b72,_0x351d9d[_0xbb35('0x11')]['message']);return _0x330771(_0x351d9d['error'][_0xbb35('0x13')]);}else{logger[_0xbb35('0xc')](_0xbb35('0xd'),_0x4a1b72,_0xbb35('0xf'));_0x330771(_0x351d9d['result']['message']);}})[_0xbb35('0x14')](function(_0x19d848){logger[_0xbb35('0x11')](_0xbb35('0xd'),_0x4a1b72,_0x19d848);_0x3720ca(_0x19d848);});});}exports[_0xbb35('0x15')]=function(_0x26ca09){var _0x4feec7=this;return new Promise(function(_0x4a0e51,_0x7d4a13){return db['ChatQueueReport'][_0xbb35('0x16')](_0x26ca09['body'],{'raw':_0x26ca09[_0xbb35('0x17')]?_0x26ca09[_0xbb35('0x17')][_0xbb35('0x18')]===undefined?!![]:![]:!![]})[_0xbb35('0xb')](function(_0x130b76){logger['info']('CreateChatQueueReport',_0x26ca09);logger[_0xbb35('0x19')](_0xbb35('0x15'),_0x26ca09,JSON[_0xbb35('0x10')](_0x130b76));_0x4a0e51(_0x130b76);})[_0xbb35('0x14')](function(_0x2b4d5a){logger[_0xbb35('0x11')](_0xbb35('0x15'),_0x2b4d5a[_0xbb35('0x13')],_0x26ca09);_0x7d4a13(_0x4feec7[_0xbb35('0x11')](0x1f4,_0x2b4d5a[_0xbb35('0x13')]));});});};exports[_0xbb35('0x1a')]=function(_0x1d1da7){var _0x44d335=this;return new Promise(function(_0x5e1840,_0x328c6d){return db[_0xbb35('0x1b')][_0xbb35('0x1c')](_0x1d1da7[_0xbb35('0x1d')],{'raw':_0x1d1da7[_0xbb35('0x17')]?_0x1d1da7[_0xbb35('0x17')][_0xbb35('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d1da7[_0xbb35('0x17')]?_0x1d1da7['options'][_0xbb35('0x1e')]||null:null,'attributes':_0x1d1da7[_0xbb35('0x17')]?_0x1d1da7[_0xbb35('0x17')][_0xbb35('0x1f')]||null:null,'limit':_0x1d1da7[_0xbb35('0x17')]?_0x1d1da7[_0xbb35('0x17')][_0xbb35('0x20')]||null:null})[_0xbb35('0xb')](function(_0x545798){logger['info']('UpdateChatQueueReport',_0x1d1da7);logger['debug'](_0xbb35('0x1a'),_0x1d1da7,JSON['stringify'](_0x545798));_0x5e1840(_0x545798);})[_0xbb35('0x14')](function(_0x17d163){logger['error']('UpdateChatQueueReport',_0x17d163['message'],_0x1d1da7);_0x328c6d(_0x44d335['error'](0x1f4,_0x17d163[_0xbb35('0x13')]));});});}; \ No newline at end of file +var _0xd9a5=['ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','body','options','raw','then','debug','UpdateChatQueueReport','ChatQueueReport','update','where','attributes','limit','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xd9a5,0x1de));var _0x5d9a=function(_0x58a269,_0x449243){_0x58a269=_0x58a269-0x0;var _0x581f2a=_0xd9a5[_0x58a269];return _0x581f2a;};'use strict';var _=require('lodash');var util=require(_0x5d9a('0x0'));var moment=require(_0x5d9a('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d9a('0x2'));var db=require(_0x5d9a('0x3'))['db'];var utils=require(_0x5d9a('0x4'));var logger=require(_0x5d9a('0x5'))('rpc');var config=require(_0x5d9a('0x6'));var jayson=require(_0x5d9a('0x7'));var client=jayson[_0x5d9a('0x8')][_0x5d9a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xa2ed1d,_0xc03d66,_0x1df2af){return new BPromise(function(_0x494b9b,_0x3f3709){return client[_0x5d9a('0xa')](_0xa2ed1d,_0x1df2af)['then'](function(_0x5da264){logger[_0x5d9a('0xb')]('ChatQueueReport,\x20%s,\x20%s',_0xc03d66,_0x5d9a('0xc'));logger['debug'](_0x5d9a('0xd'),_0xc03d66,'request\x20sent',JSON[_0x5d9a('0xe')](_0x5da264));if(_0x5da264[_0x5d9a('0xf')]){if(_0x5da264['error'][_0x5d9a('0x10')]===0x1f4){logger['error'](_0x5d9a('0x11'),_0xc03d66,_0x5da264['error'][_0x5d9a('0x12')]);return _0x3f3709(_0x5da264[_0x5d9a('0xf')][_0x5d9a('0x12')]);}logger[_0x5d9a('0xf')](_0x5d9a('0x11'),_0xc03d66,_0x5da264[_0x5d9a('0xf')][_0x5d9a('0x12')]);return _0x494b9b(_0x5da264[_0x5d9a('0xf')]['message']);}else{logger[_0x5d9a('0xb')](_0x5d9a('0x11'),_0xc03d66,_0x5d9a('0xc'));_0x494b9b(_0x5da264[_0x5d9a('0x13')][_0x5d9a('0x12')]);}})[_0x5d9a('0x14')](function(_0x55cabd){logger['error'](_0x5d9a('0x11'),_0xc03d66,_0x55cabd);_0x3f3709(_0x55cabd);});});}exports[_0x5d9a('0x15')]=function(_0x52a895){var _0x3ea035=this;return new Promise(function(_0x5798d8,_0x1b8481){return db['ChatQueueReport']['create'](_0x52a895[_0x5d9a('0x16')],{'raw':_0x52a895[_0x5d9a('0x17')]?_0x52a895[_0x5d9a('0x17')][_0x5d9a('0x18')]===undefined?!![]:![]:!![]})[_0x5d9a('0x19')](function(_0x112932){logger[_0x5d9a('0xb')](_0x5d9a('0x15'),_0x52a895);logger[_0x5d9a('0x1a')](_0x5d9a('0x15'),_0x52a895,JSON[_0x5d9a('0xe')](_0x112932));_0x5798d8(_0x112932);})['catch'](function(_0x3138e8){logger['error'](_0x5d9a('0x15'),_0x3138e8['message'],_0x52a895);_0x1b8481(_0x3ea035['error'](0x1f4,_0x3138e8[_0x5d9a('0x12')]));});});};exports[_0x5d9a('0x1b')]=function(_0x464e74){var _0x5edb1a=this;return new Promise(function(_0x35ca71,_0x150a9c){return db[_0x5d9a('0x1c')][_0x5d9a('0x1d')](_0x464e74['body'],{'raw':_0x464e74[_0x5d9a('0x17')]?_0x464e74[_0x5d9a('0x17')][_0x5d9a('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x464e74[_0x5d9a('0x17')]?_0x464e74['options'][_0x5d9a('0x1e')]||null:null,'attributes':_0x464e74[_0x5d9a('0x17')]?_0x464e74[_0x5d9a('0x17')][_0x5d9a('0x1f')]||null:null,'limit':_0x464e74[_0x5d9a('0x17')]?_0x464e74[_0x5d9a('0x17')][_0x5d9a('0x20')]||null:null})[_0x5d9a('0x19')](function(_0x188ed8){logger[_0x5d9a('0xb')](_0x5d9a('0x1b'),_0x464e74);logger[_0x5d9a('0x1a')](_0x5d9a('0x1b'),_0x464e74,JSON['stringify'](_0x188ed8));_0x35ca71(_0x188ed8);})['catch'](function(_0x4172d6){logger[_0x5d9a('0xf')](_0x5d9a('0x1b'),_0x4172d6[_0x5d9a('0x12')],_0x464e74);_0x150a9c(_0x5edb1a['error'](0x1f4,_0x4172d6[_0x5d9a('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 8b655b1..fb4b4c5 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 _0x177f=['post','create','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatQueueReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show'];(function(_0x525073,_0x478723){var _0x3e7c79=function(_0x8d907b){while(--_0x8d907b){_0x525073['push'](_0x525073['shift']());}};_0x3e7c79(++_0x478723);}(_0x177f,0xa5));var _0xf177=function(_0x1a77fc,_0x4e8a54){_0x1a77fc=_0x1a77fc-0x0;var _0x57664d=_0x177f[_0x1a77fc];return _0x57664d;};'use strict';var multer=require(_0xf177('0x0'));var util=require(_0xf177('0x1'));var path=require(_0xf177('0x2'));var timeout=require(_0xf177('0x3'));var express=require(_0xf177('0x4'));var router=express[_0xf177('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf177('0x6'));var controller=require(_0xf177('0x7'));router[_0xf177('0x8')]('/',auth['isAuthenticated'](),controller[_0xf177('0x9')]);router[_0xf177('0x8')](_0xf177('0xa'),auth[_0xf177('0xb')](),controller[_0xf177('0xc')]);router[_0xf177('0x8')](_0xf177('0xd'),auth['isAuthenticated'](),controller[_0xf177('0xe')]);router[_0xf177('0xf')]('/',auth['isAuthenticated'](),controller[_0xf177('0x10')]);router['put'](_0xf177('0xd'),auth[_0xf177('0xb')](),controller[_0xf177('0x11')]);router[_0xf177('0x12')](_0xf177('0xd'),auth[_0xf177('0xb')](),controller['destroy']);module[_0xf177('0x13')]=router; \ No newline at end of file +var _0x643e=['connect-timeout','express','../../components/interaction/service','./chatQueueReport.controller','get','isAuthenticated','describe','/:id','show','post','create','put','update','destroy','exports','multer','util','path'];(function(_0x567b1e,_0x5c5f62){var _0x30a32d=function(_0x3ab6e9){while(--_0x3ab6e9){_0x567b1e['push'](_0x567b1e['shift']());}};_0x30a32d(++_0x5c5f62);}(_0x643e,0xc3));var _0xe643=function(_0x2848f7,_0x19ff4e){_0x2848f7=_0x2848f7-0x0;var _0x416e4b=_0x643e[_0x2848f7];return _0x416e4b;};'use strict';var multer=require(_0xe643('0x0'));var util=require(_0xe643('0x1'));var path=require(_0xe643('0x2'));var timeout=require(_0xe643('0x3'));var express=require(_0xe643('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe643('0x5'));var config=require('../../config/environment');var controller=require(_0xe643('0x6'));router[_0xe643('0x7')]('/',auth[_0xe643('0x8')](),controller['index']);router[_0xe643('0x7')]('/describe',auth[_0xe643('0x8')](),controller[_0xe643('0x9')]);router[_0xe643('0x7')](_0xe643('0xa'),auth[_0xe643('0x8')](),controller[_0xe643('0xb')]);router[_0xe643('0xc')]('/',auth[_0xe643('0x8')](),controller[_0xe643('0xd')]);router[_0xe643('0xe')](_0xe643('0xa'),auth['isAuthenticated'](),controller[_0xe643('0xf')]);router['delete']('/:id',auth[_0xe643('0x8')](),controller[_0xe643('0x10')]);module[_0xe643('0x11')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 7914684..164ba03 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 _0x5ec4=['agent','queue','DATE','NOW','moment','ENUM','account'];(function(_0x4243a3,_0x447337){var _0x1b2a33=function(_0x6a8200){while(--_0x6a8200){_0x4243a3['push'](_0x4243a3['shift']());}};_0x1b2a33(++_0x447337);}(_0x5ec4,0x170));var _0x45ec=function(_0x3fce2b,_0x528e3d){_0x3fce2b=_0x3fce2b-0x0;var _0x2be464=_0x5ec4[_0x3fce2b];return _0x2be464;};'use strict';var moment=require(_0x45ec('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x45ec('0x1')](_0x45ec('0x2'),_0x45ec('0x3'),'queue'),'allowNull':![],'defaultValue':_0x45ec('0x4')},'transferredAt':{'type':Sequelize[_0x45ec('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x45ec('0x6')]}}; \ No newline at end of file +var _0x4ad3=['account','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x10df1e,_0xf56f85){var _0x3e24fb=function(_0x5cdb59){while(--_0x5cdb59){_0x10df1e['push'](_0x10df1e['shift']());}};_0x3e24fb(++_0xf56f85);}(_0x4ad3,0xe3));var _0x34ad=function(_0x4f7576,_0x138a8f){_0x4f7576=_0x4f7576-0x0;var _0x45d522=_0x4ad3[_0x4f7576];return _0x45d522;};'use strict';var moment=require('moment');var Sequelize=require(_0x34ad('0x0'));module[_0x34ad('0x1')]={'uniqueid':{'type':Sequelize[_0x34ad('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x34ad('0x3')](_0x34ad('0x4'),'agent',_0x34ad('0x5')),'allowNull':![],'defaultValue':_0x34ad('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x34ad('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 149e40b..5f5eb11 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 _0x5352=['status','end','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','show','params','find','create','body','catch','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x4e3f9c,_0x1653da){var _0x222c2a=function(_0x3e72c4){while(--_0x3e72c4){_0x4e3f9c['push'](_0x4e3f9c['shift']());}};_0x222c2a(++_0x1653da);}(_0x5352,0x1b7));var _0x2535=function(_0x180237,_0xfd4959){_0x180237=_0x180237-0x0;var _0x56fa74=_0x5352[_0x180237];return _0x56fa74;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2535('0x0'));var rimraf=require(_0x2535('0x1'));var zipdir=require(_0x2535('0x2'));var jsonpatch=require(_0x2535('0x3'));var rp=require(_0x2535('0x4'));var moment=require(_0x2535('0x5'));var BPromise=require(_0x2535('0x6'));var Mustache=require(_0x2535('0x7'));var util=require(_0x2535('0x8'));var path=require(_0x2535('0x9'));var sox=require(_0x2535('0xa'));var csv=require(_0x2535('0xb'));var ejs=require(_0x2535('0xc'));var fs=require('fs');var _=require(_0x2535('0xd'));var squel=require(_0x2535('0xe'));var crypto=require(_0x2535('0xf'));var jsforce=require(_0x2535('0x10'));var deskjs=require(_0x2535('0x11'));var toCsv=require('to-csv');var querystring=require(_0x2535('0x12'));var Papa=require('papaparse');var Redis=require(_0x2535('0x13'));var authService=require(_0x2535('0x14'));var qs=require(_0x2535('0x15'));var as=require(_0x2535('0x16'));var hardwareService=require(_0x2535('0x17'));var logger=require('../../config/logger')(_0x2535('0x18'));var utils=require(_0x2535('0x19'));var config=require(_0x2535('0x1a'));var db=require(_0x2535('0x1b'))['db'];function respondWithStatusCode(_0x222529,_0x14332f){_0x14332f=_0x14332f||0xcc;return function(_0x1b0538){if(_0x1b0538){return _0x222529[_0x2535('0x1c')](_0x14332f);}return _0x222529[_0x2535('0x1d')](_0x14332f)[_0x2535('0x1e')]();};}function respondWithResult(_0x5c8b6a,_0x2d2efd){_0x2d2efd=_0x2d2efd||0xc8;return function(_0x10babf){if(_0x10babf){return _0x5c8b6a['status'](_0x2d2efd)['json'](_0x10babf);}};}function respondWithFilteredResult(_0x2de8d1,_0x4282e1){return function(_0x403b9f){if(_0x403b9f){var _0x44e0d3=_0x403b9f['count'],_0x542ab0=_0x4282e1[_0x2535('0x1f')],_0x47c727=_0x4282e1[_0x2535('0x1f')]+_0x4282e1['limit'],_0x57c14b;if(_0x47c727>=_0x44e0d3){_0x47c727=_0x44e0d3;_0x57c14b=0xc8;}else{_0x57c14b=0xce;}_0x2de8d1['status'](_0x57c14b);return _0x2de8d1['set'](_0x2535('0x20'),_0x542ab0+'-'+_0x47c727+'/'+_0x44e0d3)['json'](_0x403b9f);}return null;};}function patchUpdates(_0x173088){return function(_0x323d90){try{jsonpatch[_0x2535('0x21')](_0x323d90,_0x173088,!![]);}catch(_0x2fdd0b){return BPromise[_0x2535('0x22')](_0x2fdd0b);}return _0x323d90[_0x2535('0x23')]();};}function saveUpdates(_0xadcd0a,_0x53e45e){return function(_0x281a87){if(_0x281a87){return _0x281a87[_0x2535('0x24')](_0xadcd0a)[_0x2535('0x25')](function(_0x95e008){return _0x95e008;});}return null;};}function removeEntity(_0x2e9b98,_0x5357ee){return function(_0x2d435b){if(_0x2d435b){return _0x2d435b[_0x2535('0x26')]()[_0x2535('0x25')](function(){_0x2e9b98[_0x2535('0x1d')](0xcc)[_0x2535('0x1e')]();});}};}function handleEntityNotFound(_0x252e9f,_0x52ccae){return function(_0x24d6f0){if(!_0x24d6f0){_0x252e9f[_0x2535('0x1c')](0x194);}return _0x24d6f0;};}function handleError(_0x5c3059,_0x507577){_0x507577=_0x507577||0x1f4;return function(_0x537a23){logger[_0x2535('0x27')](_0x537a23[_0x2535('0x28')]);if(_0x537a23[_0x2535('0x29')]){delete _0x537a23['name'];}_0x5c3059[_0x2535('0x1d')](_0x507577)[_0x2535('0x2a')](_0x537a23);};}exports[_0x2535('0x2b')]=function(_0x2247c4,_0x54f7d9){var _0x14d811={},_0x2fed76={},_0x3e7854={'count':0x0,'rows':[]};var _0x11ea91=_[_0x2535('0x2c')](db[_0x2535('0x2d')][_0x2535('0x2e')],function(_0x15c69f){return{'name':_0x15c69f[_0x2535('0x2f')],'type':_0x15c69f[_0x2535('0x30')][_0x2535('0x31')]};});_0x2fed76[_0x2535('0x32')]=_[_0x2535('0x2c')](_0x11ea91,_0x2535('0x29'));_0x2fed76[_0x2535('0x33')]=_['keys'](_0x2247c4[_0x2535('0x33')]);_0x2fed76[_0x2535('0x34')]=_[_0x2535('0x35')](_0x2fed76[_0x2535('0x32')],_0x2fed76[_0x2535('0x33')]);_0x14d811[_0x2535('0x36')]=_[_0x2535('0x35')](_0x2fed76['model'],qs[_0x2535('0x37')](_0x2247c4[_0x2535('0x33')]['fields']));_0x14d811[_0x2535('0x36')]=_0x14d811[_0x2535('0x36')][_0x2535('0x38')]?_0x14d811[_0x2535('0x36')]:_0x2fed76[_0x2535('0x32')];if(!_0x2247c4[_0x2535('0x33')][_0x2535('0x39')](_0x2535('0x3a'))){_0x14d811[_0x2535('0x3b')]=qs[_0x2535('0x3b')](_0x2247c4['query']['limit']);_0x14d811['offset']=qs[_0x2535('0x1f')](_0x2247c4[_0x2535('0x33')][_0x2535('0x1f')]);}_0x14d811[_0x2535('0x3c')]=qs[_0x2535('0x3d')](_0x2247c4[_0x2535('0x33')][_0x2535('0x3d')]);_0x14d811[_0x2535('0x3e')]=qs[_0x2535('0x34')](_[_0x2535('0x3f')](_0x2247c4['query'],_0x2fed76[_0x2535('0x34')]));if(_0x2247c4[_0x2535('0x33')][_0x2535('0x40')]){_0x14d811['where']=_[_0x2535('0x41')](_0x14d811[_0x2535('0x3e')],{'$or':_[_0x2535('0x2c')](_0x11ea91,function(_0x3a91d9){if(_0x3a91d9[_0x2535('0x30')]!=='VIRTUAL'){var _0x20e1f7={};_0x20e1f7[_0x3a91d9[_0x2535('0x29')]]={'$like':'%'+_0x2247c4[_0x2535('0x33')][_0x2535('0x40')]+'%'};return _0x20e1f7;}})});}_0x14d811=_[_0x2535('0x41')]({},_0x14d811,_0x2247c4[_0x2535('0x42')]);var _0x3f2a98={'where':_0x14d811[_0x2535('0x3e')]};return db[_0x2535('0x2d')][_0x2535('0x43')](_0x3f2a98)[_0x2535('0x25')](function(_0x296c72){_0x3e7854[_0x2535('0x43')]=_0x296c72;if(_0x2247c4['query'][_0x2535('0x44')]){_0x14d811[_0x2535('0x45')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x14d811);})['then'](function(_0xa8e8ec){_0x3e7854[_0x2535('0x46')]=_0xa8e8ec;return _0x3e7854;})[_0x2535('0x25')](respondWithFilteredResult(_0x54f7d9,_0x14d811))['catch'](handleError(_0x54f7d9,null));};exports[_0x2535('0x47')]=function(_0x4b6914,_0x4a8128){var _0x10fba2={'raw':!![],'where':{'id':_0x4b6914[_0x2535('0x48')]['id']}},_0x5aafa1={};_0x5aafa1[_0x2535('0x32')]=_['keys'](db[_0x2535('0x2d')][_0x2535('0x2e')]);_0x5aafa1['query']=_['keys'](_0x4b6914[_0x2535('0x33')]);_0x5aafa1[_0x2535('0x34')]=_[_0x2535('0x35')](_0x5aafa1[_0x2535('0x32')],_0x5aafa1[_0x2535('0x33')]);_0x10fba2[_0x2535('0x36')]=_[_0x2535('0x35')](_0x5aafa1[_0x2535('0x32')],qs[_0x2535('0x37')](_0x4b6914[_0x2535('0x33')][_0x2535('0x37')]));_0x10fba2[_0x2535('0x36')]=_0x10fba2[_0x2535('0x36')][_0x2535('0x38')]?_0x10fba2['attributes']:_0x5aafa1['model'];if(_0x4b6914[_0x2535('0x33')][_0x2535('0x44')]){_0x10fba2['include']=[{'all':!![]}];}_0x10fba2=_[_0x2535('0x41')]({},_0x10fba2,_0x4b6914[_0x2535('0x42')]);return db['ChatTransferReport'][_0x2535('0x49')](_0x10fba2)[_0x2535('0x25')](handleEntityNotFound(_0x4a8128,null))[_0x2535('0x25')](respondWithResult(_0x4a8128,null))['catch'](handleError(_0x4a8128,null));};exports['create']=function(_0x56a697,_0x4cad29){return db[_0x2535('0x2d')][_0x2535('0x4a')](_0x56a697[_0x2535('0x4b')],{})[_0x2535('0x25')](respondWithResult(_0x4cad29,0xc9))[_0x2535('0x4c')](handleError(_0x4cad29,null));};exports[_0x2535('0x24')]=function(_0x2b2db6,_0x11b086){if(_0x2b2db6[_0x2535('0x4b')]['id']){delete _0x2b2db6[_0x2535('0x4b')]['id'];}return db['ChatTransferReport'][_0x2535('0x49')]({'where':{'id':_0x2b2db6['params']['id']}})[_0x2535('0x25')](handleEntityNotFound(_0x11b086,null))[_0x2535('0x25')](saveUpdates(_0x2b2db6[_0x2535('0x4b')],null))[_0x2535('0x25')](respondWithResult(_0x11b086,null))['catch'](handleError(_0x11b086,null));};exports[_0x2535('0x26')]=function(_0x38d5bf,_0x5de095){return db[_0x2535('0x2d')]['find']({'where':{'id':_0x38d5bf[_0x2535('0x48')]['id']}})[_0x2535('0x25')](handleEntityNotFound(_0x5de095,null))[_0x2535('0x25')](removeEntity(_0x5de095,null))[_0x2535('0x4c')](handleError(_0x5de095,null));};exports['describe']=function(_0x3d4e5e,_0x6aeb27){return db[_0x2535('0x2d')][_0x2535('0x4d')]()[_0x2535('0x25')](respondWithResult(_0x6aeb27,null))['catch'](handleError(_0x6aeb27,null));}; \ No newline at end of file +var _0x65bb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','then','error','name','send','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','rows','catch','show','keys','includeAll','create','body','find','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse'];(function(_0x65d216,_0x3054cb){var _0x3ef37c=function(_0x28b64d){while(--_0x28b64d){_0x65d216['push'](_0x65d216['shift']());}};_0x3ef37c(++_0x3054cb);}(_0x65bb,0xd9));var _0xb65b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x65bb[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb65b('0x0'));var emlformat=require(_0xb65b('0x1'));var rimraf=require(_0xb65b('0x2'));var zipdir=require(_0xb65b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb65b('0x4'));var moment=require(_0xb65b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb65b('0x6'));var util=require(_0xb65b('0x7'));var path=require(_0xb65b('0x8'));var sox=require(_0xb65b('0x9'));var csv=require('to-csv');var ejs=require(_0xb65b('0xa'));var fs=require('fs');var _=require(_0xb65b('0xb'));var squel=require(_0xb65b('0xc'));var crypto=require('crypto');var jsforce=require(_0xb65b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb65b('0xe'));var querystring=require(_0xb65b('0xf'));var Papa=require(_0xb65b('0x10'));var Redis=require(_0xb65b('0x11'));var authService=require(_0xb65b('0x12'));var qs=require(_0xb65b('0x13'));var as=require(_0xb65b('0x14'));var hardwareService=require(_0xb65b('0x15'));var logger=require(_0xb65b('0x16'))('api');var utils=require(_0xb65b('0x17'));var config=require(_0xb65b('0x18'));var db=require(_0xb65b('0x19'))['db'];function respondWithStatusCode(_0x5858f1,_0xfabaf2){_0xfabaf2=_0xfabaf2||0xcc;return function(_0x5b2fe7){if(_0x5b2fe7){return _0x5858f1[_0xb65b('0x1a')](_0xfabaf2);}return _0x5858f1[_0xb65b('0x1b')](_0xfabaf2)[_0xb65b('0x1c')]();};}function respondWithResult(_0x2ce997,_0x2d6ccb){_0x2d6ccb=_0x2d6ccb||0xc8;return function(_0x2fce5c){if(_0x2fce5c){return _0x2ce997[_0xb65b('0x1b')](_0x2d6ccb)[_0xb65b('0x1d')](_0x2fce5c);}};}function respondWithFilteredResult(_0x5e1266,_0x45778f){return function(_0x45d105){if(_0x45d105){var _0x1a9123=_0x45d105[_0xb65b('0x1e')],_0x4b426a=_0x45778f[_0xb65b('0x1f')],_0x3d04e3=_0x45778f[_0xb65b('0x1f')]+_0x45778f[_0xb65b('0x20')],_0x15ae62;if(_0x3d04e3>=_0x1a9123){_0x3d04e3=_0x1a9123;_0x15ae62=0xc8;}else{_0x15ae62=0xce;}_0x5e1266['status'](_0x15ae62);return _0x5e1266[_0xb65b('0x21')]('Content-Range',_0x4b426a+'-'+_0x3d04e3+'/'+_0x1a9123)[_0xb65b('0x1d')](_0x45d105);}return null;};}function patchUpdates(_0x5aa097){return function(_0x840a93){try{jsonpatch['apply'](_0x840a93,_0x5aa097,!![]);}catch(_0x124d11){return BPromise[_0xb65b('0x22')](_0x124d11);}return _0x840a93[_0xb65b('0x23')]();};}function saveUpdates(_0x4186e8,_0x3fc1b2){return function(_0x2de27f){if(_0x2de27f){return _0x2de27f[_0xb65b('0x24')](_0x4186e8)['then'](function(_0x1aea5a){return _0x1aea5a;});}return null;};}function removeEntity(_0x206e30,_0x1bda02){return function(_0x42e096){if(_0x42e096){return _0x42e096[_0xb65b('0x25')]()[_0xb65b('0x26')](function(){_0x206e30['status'](0xcc)[_0xb65b('0x1c')]();});}};}function handleEntityNotFound(_0x427820,_0x273319){return function(_0x5a095f){if(!_0x5a095f){_0x427820[_0xb65b('0x1a')](0x194);}return _0x5a095f;};}function handleError(_0x46c611,_0x46336a){_0x46336a=_0x46336a||0x1f4;return function(_0x2e66c9){logger[_0xb65b('0x27')](_0x2e66c9['stack']);if(_0x2e66c9[_0xb65b('0x28')]){delete _0x2e66c9[_0xb65b('0x28')];}_0x46c611[_0xb65b('0x1b')](_0x46336a)[_0xb65b('0x29')](_0x2e66c9);};}exports[_0xb65b('0x2a')]=function(_0x4c25d2,_0x258645){var _0x521988={},_0x49be96={},_0x2b7789={'count':0x0,'rows':[]};var _0x46b495=_[_0xb65b('0x2b')](db[_0xb65b('0x2c')][_0xb65b('0x2d')],function(_0x443b38){return{'name':_0x443b38[_0xb65b('0x2e')],'type':_0x443b38[_0xb65b('0x2f')][_0xb65b('0x30')]};});_0x49be96[_0xb65b('0x31')]=_[_0xb65b('0x2b')](_0x46b495,'name');_0x49be96[_0xb65b('0x32')]=_['keys'](_0x4c25d2[_0xb65b('0x32')]);_0x49be96[_0xb65b('0x33')]=_[_0xb65b('0x34')](_0x49be96[_0xb65b('0x31')],_0x49be96[_0xb65b('0x32')]);_0x521988[_0xb65b('0x35')]=_[_0xb65b('0x34')](_0x49be96['model'],qs['fields'](_0x4c25d2[_0xb65b('0x32')][_0xb65b('0x36')]));_0x521988[_0xb65b('0x35')]=_0x521988[_0xb65b('0x35')][_0xb65b('0x37')]?_0x521988[_0xb65b('0x35')]:_0x49be96[_0xb65b('0x31')];if(!_0x4c25d2['query'][_0xb65b('0x38')](_0xb65b('0x39'))){_0x521988[_0xb65b('0x20')]=qs[_0xb65b('0x20')](_0x4c25d2[_0xb65b('0x32')]['limit']);_0x521988['offset']=qs['offset'](_0x4c25d2[_0xb65b('0x32')]['offset']);}_0x521988[_0xb65b('0x3a')]=qs[_0xb65b('0x3b')](_0x4c25d2['query'][_0xb65b('0x3b')]);_0x521988[_0xb65b('0x3c')]=qs['filters'](_[_0xb65b('0x3d')](_0x4c25d2['query'],_0x49be96[_0xb65b('0x33')]));if(_0x4c25d2[_0xb65b('0x32')]['filter']){_0x521988[_0xb65b('0x3c')]=_[_0xb65b('0x3e')](_0x521988[_0xb65b('0x3c')],{'$or':_[_0xb65b('0x2b')](_0x46b495,function(_0x151b89){if(_0x151b89['type']!==_0xb65b('0x3f')){var _0x273b86={};_0x273b86[_0x151b89['name']]={'$like':'%'+_0x4c25d2[_0xb65b('0x32')][_0xb65b('0x40')]+'%'};return _0x273b86;}})});}_0x521988=_[_0xb65b('0x3e')]({},_0x521988,_0x4c25d2[_0xb65b('0x41')]);var _0x293542={'where':_0x521988['where']};return db['ChatTransferReport'][_0xb65b('0x1e')](_0x293542)[_0xb65b('0x26')](function(_0x2be36a){_0x2b7789[_0xb65b('0x1e')]=_0x2be36a;if(_0x4c25d2[_0xb65b('0x32')]['includeAll']){_0x521988[_0xb65b('0x42')]=[{'all':!![]}];}return db[_0xb65b('0x2c')][_0xb65b('0x43')](_0x521988);})[_0xb65b('0x26')](function(_0x3cfc57){_0x2b7789[_0xb65b('0x44')]=_0x3cfc57;return _0x2b7789;})['then'](respondWithFilteredResult(_0x258645,_0x521988))[_0xb65b('0x45')](handleError(_0x258645,null));};exports[_0xb65b('0x46')]=function(_0x41d6c1,_0x526d8e){var _0x45d6e2={'raw':!![],'where':{'id':_0x41d6c1['params']['id']}},_0x4a857f={};_0x4a857f[_0xb65b('0x31')]=_[_0xb65b('0x47')](db[_0xb65b('0x2c')][_0xb65b('0x2d')]);_0x4a857f[_0xb65b('0x32')]=_[_0xb65b('0x47')](_0x41d6c1['query']);_0x4a857f['filters']=_['intersection'](_0x4a857f['model'],_0x4a857f[_0xb65b('0x32')]);_0x45d6e2[_0xb65b('0x35')]=_[_0xb65b('0x34')](_0x4a857f[_0xb65b('0x31')],qs[_0xb65b('0x36')](_0x41d6c1[_0xb65b('0x32')][_0xb65b('0x36')]));_0x45d6e2[_0xb65b('0x35')]=_0x45d6e2['attributes'][_0xb65b('0x37')]?_0x45d6e2[_0xb65b('0x35')]:_0x4a857f[_0xb65b('0x31')];if(_0x41d6c1['query'][_0xb65b('0x48')]){_0x45d6e2[_0xb65b('0x42')]=[{'all':!![]}];}_0x45d6e2=_['merge']({},_0x45d6e2,_0x41d6c1['options']);return db['ChatTransferReport']['find'](_0x45d6e2)[_0xb65b('0x26')](handleEntityNotFound(_0x526d8e,null))[_0xb65b('0x26')](respondWithResult(_0x526d8e,null))[_0xb65b('0x45')](handleError(_0x526d8e,null));};exports['create']=function(_0x1b40cf,_0xcd4221){return db['ChatTransferReport'][_0xb65b('0x49')](_0x1b40cf[_0xb65b('0x4a')],{})[_0xb65b('0x26')](respondWithResult(_0xcd4221,0xc9))[_0xb65b('0x45')](handleError(_0xcd4221,null));};exports[_0xb65b('0x24')]=function(_0x3f8aa8,_0x253d60){if(_0x3f8aa8[_0xb65b('0x4a')]['id']){delete _0x3f8aa8[_0xb65b('0x4a')]['id'];}return db[_0xb65b('0x2c')][_0xb65b('0x4b')]({'where':{'id':_0x3f8aa8[_0xb65b('0x4c')]['id']}})[_0xb65b('0x26')](handleEntityNotFound(_0x253d60,null))[_0xb65b('0x26')](saveUpdates(_0x3f8aa8[_0xb65b('0x4a')],null))[_0xb65b('0x26')](respondWithResult(_0x253d60,null))[_0xb65b('0x45')](handleError(_0x253d60,null));};exports[_0xb65b('0x25')]=function(_0x3e19a0,_0x2405bf){return db[_0xb65b('0x2c')][_0xb65b('0x4b')]({'where':{'id':_0x3e19a0[_0xb65b('0x4c')]['id']}})[_0xb65b('0x26')](handleEntityNotFound(_0x2405bf,null))['then'](removeEntity(_0x2405bf,null))[_0xb65b('0x45')](handleError(_0x2405bf,null));};exports[_0xb65b('0x4d')]=function(_0x81fde9,_0x240ad2){return db[_0xb65b('0x2c')][_0xb65b('0x4d')]()[_0xb65b('0x26')](respondWithResult(_0x240ad2,null))[_0xb65b('0x45')](handleError(_0x240ad2,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 961fe63..f9c90cf 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 _0xa1c0=['util','api','moment','bluebird','path','rimraf','../../config/environment','./chatTransferReport.attributes','exports','define','report_chat_transfer','uniqueid','lodash'];(function(_0x3a0494,_0x2bf757){var _0x8c5f93=function(_0x563583){while(--_0x563583){_0x3a0494['push'](_0x3a0494['shift']());}};_0x8c5f93(++_0x2bf757);}(_0xa1c0,0x1ac));var _0x0a1c=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0xa1c0[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x0a1c('0x0'));var util=require(_0x0a1c('0x1'));var logger=require('../../config/logger')(_0x0a1c('0x2'));var moment=require(_0x0a1c('0x3'));var BPromise=require(_0x0a1c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a1c('0x5'));var rimraf=require(_0x0a1c('0x6'));var config=require(_0x0a1c('0x7'));var attributes=require(_0x0a1c('0x8'));module[_0x0a1c('0x9')]=function(_0x1de163,_0x5b8f9a){return _0x1de163[_0x0a1c('0xa')]('ChatTransferReport',attributes,{'tableName':_0x0a1c('0xb'),'paranoid':![],'indexes':[{'name':_0x0a1c('0xc'),'fields':[_0x0a1c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc95f=['lodash','util','api','moment','bluebird','request-promise','rimraf','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer','uniqueid'];(function(_0x176865,_0x465e53){var _0x2bc1e1=function(_0x185001){while(--_0x185001){_0x176865['push'](_0x176865['shift']());}};_0x2bc1e1(++_0x465e53);}(_0xc95f,0x174));var _0xfc95=function(_0x4178af,_0x388652){_0x4178af=_0x4178af-0x0;var _0x20f4b1=_0xc95f[_0x4178af];return _0x20f4b1;};'use strict';var _=require(_0xfc95('0x0'));var util=require(_0xfc95('0x1'));var logger=require('../../config/logger')(_0xfc95('0x2'));var moment=require(_0xfc95('0x3'));var BPromise=require(_0xfc95('0x4'));var rp=require(_0xfc95('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfc95('0x6'));var config=require('../../config/environment');var attributes=require(_0xfc95('0x7'));module[_0xfc95('0x8')]=function(_0xbc6d2c,_0x56128c){return _0xbc6d2c['define'](_0xfc95('0x9'),attributes,{'tableName':_0xfc95('0xa'),'paranoid':![],'indexes':[{'name':_0xfc95('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index c008702..4a6c2d7 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 _0x35d3=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','code','error','ChatTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','../../mysqldb'];(function(_0x5a4789,_0x4a1044){var _0x59f547=function(_0x34f455){while(--_0x34f455){_0x5a4789['push'](_0x5a4789['shift']());}};_0x59f547(++_0x4a1044);}(_0x35d3,0x14c));var _0x335d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35d3[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x335d('0x0'));var util=require('util');var moment=require(_0x335d('0x1'));var BPromise=require('bluebird');var rs=require(_0x335d('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x335d('0x3'))['db'];var utils=require(_0x335d('0x4'));var logger=require(_0x335d('0x5'))(_0x335d('0x6'));var config=require('../../config/environment');var jayson=require(_0x335d('0x7'));var client=jayson[_0x335d('0x8')][_0x335d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4f71f5,_0x58a19d,_0x3b00da){return new BPromise(function(_0x1b596d,_0x3a2981){return client[_0x335d('0xa')](_0x4f71f5,_0x3b00da)['then'](function(_0x19c49d){logger[_0x335d('0xb')]('ChatTransferReport,\x20%s,\x20%s',_0x58a19d,_0x335d('0xc'));logger[_0x335d('0xd')](_0x335d('0xe'),_0x58a19d,_0x335d('0xc'),JSON['stringify'](_0x19c49d));if(_0x19c49d['error']){if(_0x19c49d['error'][_0x335d('0xf')]===0x1f4){logger[_0x335d('0x10')](_0x335d('0x11'),_0x58a19d,_0x19c49d['error'][_0x335d('0x12')]);return _0x3a2981(_0x19c49d[_0x335d('0x10')]['message']);}logger[_0x335d('0x10')](_0x335d('0x11'),_0x58a19d,_0x19c49d['error'][_0x335d('0x12')]);return _0x1b596d(_0x19c49d[_0x335d('0x10')][_0x335d('0x12')]);}else{logger[_0x335d('0xb')](_0x335d('0x11'),_0x58a19d,_0x335d('0xc'));_0x1b596d(_0x19c49d[_0x335d('0x13')][_0x335d('0x12')]);}})[_0x335d('0x14')](function(_0x46f854){logger['error'](_0x335d('0x11'),_0x58a19d,_0x46f854);_0x3a2981(_0x46f854);});});} \ No newline at end of file +var _0x9d84=['client','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','../../mysqldb','../../config/utils','../../config/logger','jayson/promise'];(function(_0x3bfc4e,_0x11a7e1){var _0x1d794b=function(_0x49e7cc){while(--_0x49e7cc){_0x3bfc4e['push'](_0x3bfc4e['shift']());}};_0x1d794b(++_0x11a7e1);}(_0x9d84,0x14f));var _0x49d8=function(_0x31525c,_0x5d76a0){_0x31525c=_0x31525c-0x0;var _0x23a071=_0x9d84[_0x31525c];return _0x23a071;};'use strict';var _=require(_0x49d8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x49d8('0x1'))['db'];var utils=require(_0x49d8('0x2'));var logger=require(_0x49d8('0x3'))('rpc');var config=require('../../config/environment');var jayson=require(_0x49d8('0x4'));var client=jayson[_0x49d8('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x110a9e,_0x55b128,_0x2f7984){return new BPromise(function(_0x5071ab,_0x5d0216){return client[_0x49d8('0x6')](_0x110a9e,_0x2f7984)[_0x49d8('0x7')](function(_0x11ae1f){logger['info'](_0x49d8('0x8'),_0x55b128,_0x49d8('0x9'));logger['debug'](_0x49d8('0xa'),_0x55b128,_0x49d8('0x9'),JSON[_0x49d8('0xb')](_0x11ae1f));if(_0x11ae1f[_0x49d8('0xc')]){if(_0x11ae1f[_0x49d8('0xc')][_0x49d8('0xd')]===0x1f4){logger['error'](_0x49d8('0x8'),_0x55b128,_0x11ae1f['error'][_0x49d8('0xe')]);return _0x5d0216(_0x11ae1f[_0x49d8('0xc')]['message']);}logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x55b128,_0x11ae1f[_0x49d8('0xc')]['message']);return _0x5071ab(_0x11ae1f[_0x49d8('0xc')]['message']);}else{logger[_0x49d8('0xf')](_0x49d8('0x8'),_0x55b128,_0x49d8('0x9'));_0x5071ab(_0x11ae1f[_0x49d8('0x10')][_0x49d8('0xe')]);}})['catch'](function(_0x577d03){logger[_0x49d8('0xc')](_0x49d8('0x8'),_0x55b128,_0x577d03);_0x5d0216(_0x577d03);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 24ba021..c66d0a3 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 _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(_0x49dcb5,_0x9d3e95){var _0x1df0f4=function(_0x1d956b){while(--_0x1d956b){_0x49dcb5['push'](_0x49dcb5['shift']());}};_0x1df0f4(++_0x9d3e95);}(_0x0b0e,0x187));var _0xe0b0=function(_0xbb14db,_0x3ee8c6){_0xbb14db=_0xbb14db-0x0;var _0x36bed7=_0x0b0e[_0xbb14db];return _0x36bed7;};'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 +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(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x5f66[_0x13d07a];return _0x5ee0ee;};'use strict';var multer=require('multer');var util=require(_0x65f6('0x0'));var path=require('path');var timeout=require(_0x65f6('0x1'));var express=require(_0x65f6('0x2'));var router=express[_0x65f6('0x3')]();var auth=require(_0x65f6('0x4'));var interaction=require(_0x65f6('0x5'));var config=require('../../config/environment');var controller=require(_0x65f6('0x6'));router['get']('/',auth[_0x65f6('0x7')](),controller[_0x65f6('0x8')]);router['get']('/describe',auth[_0x65f6('0x7')](),controller[_0x65f6('0x9')]);router[_0x65f6('0xa')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller[_0x65f6('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x65f6('0xd')]);router[_0x65f6('0xe')](_0x65f6('0xb'),auth[_0x65f6('0x7')](),controller['update']);router[_0x65f6('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x65f6('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index a9347fd..f3259d6 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 _0x4b57=['All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','exports','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN','ENUM','rounded','squared','Send','Contact\x20us','TEXT','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','star','input','name','getDataValue','onlineForm','parse','setDataValue','stringify','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate'];(function(_0x3366fe,_0x21bf99){var _0x1949a5=function(_0xf46d5e){while(--_0xf46d5e){_0x3366fe['push'](_0x3366fe['shift']());}};_0x1949a5(++_0x21bf99);}(_0x4b57,0xcd));var _0x74b5=function(_0x386b69,_0x5d9360){_0x386b69=_0x386b69-0x0;var _0x476415=_0x4b57[_0x386b69];return _0x476415;};'use strict';var Sequelize=require(_0x74b5('0x0'));var rs=require('randomstring');module[_0x74b5('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x74b5('0x2')],'allowNull':![],'unique':_0x74b5('0x3')},'description':{'type':Sequelize[_0x74b5('0x2')]},'mapKey':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x4')},'mapKeyOffline':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x4')},'key':{'type':Sequelize[_0x74b5('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x5')},'customerAlias':{'type':Sequelize['STRING'],'defaultValue':'Me'},'color':{'type':Sequelize[_0x74b5('0x2')],'allowNull':![],'defaultValue':_0x74b5('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x74b5('0x2')],'allowNull':![],'defaultValue':_0x74b5('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x74b5('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x74b5('0x2')]},'animation':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x74b5('0xa')](_0x74b5('0xb'),_0x74b5('0xc')),'defaultValue':_0x74b5('0xb')},'header_online':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x74b5('0xd')},'header_offline':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0xe')},'download_transcript':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x74b5('0xf')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x74b5('0x10')},'formSubmitFailureMessage':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x11')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':_0x74b5('0x12')},'placeholderMessage':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':_0x74b5('0x14')},'closingMessageButton':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0xd')},'skipMessageButton':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x15')},'conditionAgreement':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x74b5('0xa')](_0x74b5('0x16'),'thumb'),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x74b5('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x74b5('0xf')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x74b5('0x17'),'variable':null,'config':{'placeholder':_0x74b5('0x18'),'type':'text','required':!![]},'props':{'title':'name','helpText':''}},{'type':_0x74b5('0x17'),'props':{'title':_0x74b5('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x74b5('0x4'),'type':_0x74b5('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x74b5('0x19')](_0x74b5('0x1a'))?JSON[_0x74b5('0x1b')](this['getDataValue'](_0x74b5('0x1a'))):{};},'set':function(_0x2abb57){return this[_0x74b5('0x1c')](_0x74b5('0x1a'),JSON[_0x74b5('0x1d')](_0x2abb57));}},'offlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x74b5('0x1d')]({'items':[{'type':_0x74b5('0x17'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x74b5('0x4'),'type':_0x74b5('0x4')},'variable':null},{'type':_0x74b5('0x1e'),'config':{'placeholder':_0x74b5('0x1f')},'props':{'title':_0x74b5('0x1f'),'helpText':_0x74b5('0x20')}}],'fromKey':0x0});},'get':function(){return this[_0x74b5('0x19')](_0x74b5('0x21'))?JSON[_0x74b5('0x1b')](this[_0x74b5('0x19')](_0x74b5('0x21'))):{};},'set':function(_0x4c0bec){return this[_0x74b5('0x1c')](_0x74b5('0x21'),JSON[_0x74b5('0x1d')](_0x4c0bec));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x74b5('0x22')]();}},'autoclose':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x74b5('0x2')]},'forwardOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x74b5('0x2')]},'waitingTitle':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x23')},'waitingMessage':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x25')},'offlineMessageBody':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize['STRING'],'defaultValue':'Your\x20request\x20has\x20not\x20been\x20processed.'},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x74b5('0x15')},'sendUnmanaged':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x74b5('0xf')]},'showAgentAvatar':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x74b5('0x2')]},'notificationTemplate':{'type':Sequelize[_0x74b5('0xf')],'defaultValue':function(){return _0x74b5('0x27');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x28')},'waitForTheAssignedAgent':{'type':Sequelize[_0x74b5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x29')},'verticalAlignment':{'type':Sequelize[_0x74b5('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x74b5('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x74b5('0xf')]},'showCustomerAvatar':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x74b5('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x74b5('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x74b5('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x74b5('0x2')],'defaultValue':_0x74b5('0x2c')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x74b5('0x8')],'comment':_0x74b5('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x74b5('0x9')],'defaultValue':![],'comment':_0x74b5('0x2e'),'set':function(_0x878765){if(!_0x878765)this[_0x74b5('0x1c')](_0x74b5('0x2f'),null);this['setDataValue']('mandatoryDisposition',_0x878765);}}}; \ No newline at end of file +var _0xb1a4=['getDataValue','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','parse','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','sequelize','randomstring','STRING','address','email','Agent','#9f946a','#ffffff','INTEGER','rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Skip','Feedback','ENUM','thumb','star','stringify','name','text','input','onlineForm'];(function(_0x1bccb4,_0x3766b2){var _0x264cf7=function(_0x5b3df1){while(--_0x5b3df1){_0x1bccb4['push'](_0x1bccb4['shift']());}};_0x264cf7(++_0x3766b2);}(_0xb1a4,0xd9));var _0x4b1a=function(_0x412b7a,_0x1755b5){_0x412b7a=_0x412b7a-0x0;var _0x1d7565=_0xb1a4[_0x412b7a];return _0x1d7565;};'use strict';var Sequelize=require(_0x4b1a('0x0'));var rs=require(_0x4b1a('0x1'));module['exports']={'name':{'type':Sequelize[_0x4b1a('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x4b1a('0x2')],'allowNull':![],'unique':_0x4b1a('0x3')},'description':{'type':Sequelize[_0x4b1a('0x2')]},'mapKey':{'type':Sequelize['STRING'],'defaultValue':'email'},'mapKeyOffline':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x4')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x5')},'customerAlias':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x4b1a('0x2')],'allowNull':![],'defaultValue':_0x4b1a('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x4b1a('0x2')],'allowNull':![],'defaultValue':_0x4b1a('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x4b1a('0x2')],'allowNull':![],'defaultValue':_0x4b1a('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x4b1a('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x4b1a('0x2')]},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize['ENUM'](_0x4b1a('0x9'),_0x4b1a('0xa')),'defaultValue':_0x4b1a('0x9')},'header_online':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0xb')},'start_chat_button':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0xc')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x4b1a('0xd')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':_0x4b1a('0xe')},'download_transcript':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':!![]},'timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x10')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x4b1a('0x11')]},'closingQuestion':{'type':Sequelize['STRING'],'defaultValue':_0x4b1a('0x12')},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':_0x4b1a('0x13')},'formSubmitFailureMessage':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x14')},'noteTitle':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x15')},'closingMessage':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x16')},'closingMessageButton':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x4b1a('0x17')},'conditionAgreement':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x18')},'ratingType':{'type':Sequelize[_0x4b1a('0x19')]('star',_0x4b1a('0x1a')),'defaultValue':_0x4b1a('0x1b')},'ratingStarsNumber':{'type':Sequelize[_0x4b1a('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x4b1a('0x11')],'defaultValue':function(){return JSON[_0x4b1a('0x1c')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x4b1a('0x1d'),'type':_0x4b1a('0x1e'),'required':!![]},'props':{'title':_0x4b1a('0x1d'),'helpText':''}},{'type':_0x4b1a('0x1f'),'props':{'title':_0x4b1a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4b1a('0x4'),'type':_0x4b1a('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0x4b1a('0x20'))?JSON['parse'](this[_0x4b1a('0x21')](_0x4b1a('0x20'))):{};},'set':function(_0x45cb2a){return this[_0x4b1a('0x22')](_0x4b1a('0x20'),JSON[_0x4b1a('0x1c')](_0x45cb2a));}},'offlineForm':{'type':Sequelize[_0x4b1a('0x11')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x4b1a('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x4b1a('0x4'),'type':_0x4b1a('0x4')},'variable':null},{'type':_0x4b1a('0x23'),'config':{'placeholder':_0x4b1a('0x24')},'props':{'title':_0x4b1a('0x24'),'helpText':_0x4b1a('0x25')}}],'fromKey':0x0});},'get':function(){return this[_0x4b1a('0x21')](_0x4b1a('0x26'))?JSON[_0x4b1a('0x27')](this['getDataValue'](_0x4b1a('0x26'))):{};},'set':function(_0x551993){return this[_0x4b1a('0x22')]('offlineForm',JSON['stringify'](_0x551993));}},'token':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':function(){return rs[_0x4b1a('0x28')]();}},'autoclose':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x4b1a('0x2')]},'forwardOffline':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize['STRING']},'waitingTitle':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x29')},'waitingMessage':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x2a')},'offlineMessageSubject':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x2b')},'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[_0x4b1a('0xf')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x2c')},'skipUnmanaged':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x17')},'sendUnmanaged':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x4b1a('0x11')]},'showAgentAvatar':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x4b1a('0x2')]},'notificationTemplate':{'type':Sequelize[_0x4b1a('0x11')],'defaultValue':function(){return _0x4b1a('0x2d');}},'notificationSound':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x2e')},'waitForTheAssignedAgent':{'type':Sequelize[_0x4b1a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':_0x4b1a('0x2f')},'verticalAlignment':{'type':Sequelize[_0x4b1a('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':'alternate'},'defaultTitle':{'type':Sequelize[_0x4b1a('0x2')]},'customerAvatar':{'type':Sequelize[_0x4b1a('0x11')]},'showCustomerAvatar':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x4b1a('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x4b1a('0x2')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x4b1a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x4b1a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x4b1a('0x2')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0x4b1a('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x4b1a('0xf')],'defaultValue':![],'comment':_0x4b1a('0x30'),'set':function(_0x1ae218){if(!_0x1ae218)this[_0x4b1a('0x22')](_0x4b1a('0x31'),null);this[_0x4b1a('0x22')]('mandatoryDisposition',_0x1ae218);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index 4057157..4274285 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 _0xca5a=['List','CmContact','Contacts','DESC','ChatApplication','Applications','account','list','applications','asc','contact','cf-connecting-ip','first','x-forwarded-for','split','firstName','referer','browser','version','format','%s\x20%s','unknown','device','%s\x20%s\x20%s','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','messageId','get','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','offline','CompanyId','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','secure','authentication','pass','SendMail','sendMail','offlineMessageSubject','addInteraction','omit','getInteractions','Contact','User','Owner','fullname','Tag','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','OFFLINE','No\x20timezone','inspect','Interval','Intervals','getProactiveActions','virtual','custom','License','findOne','increment','chatLicenseExceeded','all','some','x-real-ip','remoteAddress','replace','alignment','verticalAlignment','sequelize','transaction','findAndCountAll','priority','getApplications','addProactiveActions','chatProactiveAction','getFields','online','false','offlineForm','items','fromKey','getOfflineMessages','addAgents','emit','removeAgents','isArray','userChatWebsite:remove','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','ChatWebsite,\x20%s,\x20%s','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','index','Pause','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','map','VIRTUAL','options','count','includeAll','include','findAll','rows','params','mandatoryDispositionPause','find','create','body','role','user','ChatWebsites','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','rawAttributes','order','pick','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','sitepic','file','filename','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','isNil','existsSync','server/files/images/logos/','download','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','getResult','chat','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0xca5a,0x82));var _0xaca5=function(_0x3e7c7c,_0x558c8b){_0x3e7c7c=_0x3e7c7c-0x0;var _0x510350=_0xca5a[_0x3e7c7c];return _0x510350;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaca5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xaca5('0x1'));var jsonpatch=require(_0xaca5('0x2'));var rp=require(_0xaca5('0x3'));var moment=require(_0xaca5('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xaca5('0x5'));var util=require(_0xaca5('0x6'));var path=require(_0xaca5('0x7'));var sox=require('sox');var csv=require(_0xaca5('0x8'));var ejs=require(_0xaca5('0x9'));var fs=require('fs');var _=require(_0xaca5('0xa'));var squel=require(_0xaca5('0xb'));var crypto=require(_0xaca5('0xc'));var jsforce=require(_0xaca5('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaca5('0x8'));var querystring=require('querystring');var Papa=require(_0xaca5('0xe'));var Redis=require(_0xaca5('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xaca5('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xaca5('0x11'));var utils=require(_0xaca5('0x12'));var config=require(_0xaca5('0x13'));var db=require(_0xaca5('0x14'))['db'];config[_0xaca5('0x15')]=_[_0xaca5('0x16')](config[_0xaca5('0x15')],{'host':_0xaca5('0x17'),'port':0x18eb});var socket=require(_0xaca5('0x18'))(new Redis(config[_0xaca5('0x15')]));require('./chatWebsite.socket')[_0xaca5('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xaca5('0x1a')][_0xaca5('0x1b')]({'port':0x232c});var client9002=jayson[_0xaca5('0x1a')][_0xaca5('0x1b')]({'port':0x232a});var client9003=jayson[_0xaca5('0x1a')][_0xaca5('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x24fe81,_0xd11a5c,_0x2a2684){if(_0x2a2684){var _0x418cef=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x418cef[_0xaca5('0x1c')](_0xd11a5c)){return _0x24fe81;}else{throw new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))](_0xaca5('0x1f'));}}else{return _0x24fe81;}}function respondWithRpcPromise(_0x3a5767,_0x3bd0d4,_0x264214,_0x1d12e5){return new BPromise(function(_0xf4ed86,_0x364ff3){var _0xc3971b=_0x1d12e5||client;return _0xc3971b[_0xaca5('0x20')](_0x3a5767,_0x264214)[_0xaca5('0x21')](function(_0x5db7c9){logger['info'](_0xaca5('0x22'),_0x3bd0d4,'request\x20sent');logger[_0xaca5('0x23')](_0xaca5('0x24'),_0x3bd0d4,_0xaca5('0x25'),JSON[_0xaca5('0x26')](_0x5db7c9));if(_0x5db7c9[_0xaca5('0x27')]){if(_0x5db7c9[_0xaca5('0x27')][_0xaca5('0x28')]===0x1f4){logger['error'](_0xaca5('0x22'),_0x3bd0d4,_0x5db7c9[_0xaca5('0x27')][_0xaca5('0x29')]);return _0x364ff3(_0x5db7c9[_0xaca5('0x27')][_0xaca5('0x29')]);}logger[_0xaca5('0x27')]('ChatWebsite,\x20%s,\x20%s',_0x3bd0d4,_0x5db7c9[_0xaca5('0x27')][_0xaca5('0x29')]);return _0xf4ed86(_0x5db7c9[_0xaca5('0x27')][_0xaca5('0x29')]);}else{logger[_0xaca5('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x3bd0d4,_0xaca5('0x25'));_0xf4ed86(_0x5db7c9[_0xaca5('0x2b')][_0xaca5('0x29')]);}})[_0xaca5('0x2c')](function(_0x59012b){logger[_0xaca5('0x27')](_0xaca5('0x22'),_0x3bd0d4,_0x59012b);_0x364ff3(_0x59012b);});});}function respondWithStatusCode(_0x16390e,_0x1bbfdf){_0x1bbfdf=_0x1bbfdf||0xcc;return function(_0x146aca){if(_0x146aca){return _0x16390e['sendStatus'](_0x1bbfdf);}return _0x16390e[_0xaca5('0x2d')](_0x1bbfdf)[_0xaca5('0x2e')]();};}function respondWithResult(_0x3bc67e,_0xf23f99){_0xf23f99=_0xf23f99||0xc8;return function(_0x92ae55){if(_0x92ae55){return _0x3bc67e['status'](_0xf23f99)[_0xaca5('0x2f')](_0x92ae55);}};}function respondWithFilteredResult(_0x1060d3,_0x57c759){return function(_0x391cce){if(_0x391cce){var _0x2f083a=_0x391cce['count'],_0x57fa60=_0x57c759['offset'],_0x9a3a49=_0x57c759[_0xaca5('0x30')]+_0x57c759[_0xaca5('0x31')],_0x3bc29f;if(_0x9a3a49>=_0x2f083a){_0x9a3a49=_0x2f083a;_0x3bc29f=0xc8;}else{_0x3bc29f=0xce;}_0x1060d3[_0xaca5('0x2d')](_0x3bc29f);return _0x1060d3[_0xaca5('0x32')](_0xaca5('0x33'),_0x57fa60+'-'+_0x9a3a49+'/'+_0x2f083a)[_0xaca5('0x2f')](_0x391cce);}return null;};}function patchUpdates(_0x5b68a2){return function(_0x1d0109){try{jsonpatch[_0xaca5('0x34')](_0x1d0109,_0x5b68a2,!![]);}catch(_0x41503d){return BPromise[_0xaca5('0x35')](_0x41503d);}return _0x1d0109['save']();};}function saveUpdates(_0x4a088b,_0x3d1121){return function(_0xcd044b){if(_0xcd044b){return _0xcd044b[_0xaca5('0x36')](_0x4a088b)['then'](function(_0x262b3b){return _0x262b3b;});}return null;};}function removeEntity(_0x4b997b,_0x5f3c39){return function(_0xf38a34){if(_0xf38a34){return _0xf38a34[_0xaca5('0x37')]()[_0xaca5('0x21')](function(){var _0x3be1dc=_0xf38a34['get']({'plain':!![]});var _0x5c7e8a='ChatWebsites';return db['UserProfileResource'][_0xaca5('0x37')]({'where':{'type':_0x5c7e8a,'resourceId':_0x3be1dc['id']}})[_0xaca5('0x21')](function(){return _0xf38a34;});})[_0xaca5('0x21')](function(){_0x4b997b[_0xaca5('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe68002,_0x1ca142){return function(_0x3fb5f9){if(!_0x3fb5f9){_0xe68002[_0xaca5('0x38')](0x194);}return _0x3fb5f9;};}function handleError(_0x1077ba,_0x50bb36){_0x50bb36=_0x50bb36||0x1f4;return function(_0x2f0ca0){logger['error'](_0x2f0ca0[_0xaca5('0x39')]);if(_0x2f0ca0[_0xaca5('0x3a')]){delete _0x2f0ca0['name'];}_0x1077ba['status'](_0x50bb36)['send'](_0x2f0ca0);};}exports[_0xaca5('0x3b')]=function(_0x1c1ae5,_0x362b34){var _0x223e86={'include':[{'model':db[_0xaca5('0x3c')],'as':'mandatoryDispositionPause'}]},_0x2a542a={},_0xe3dbd7={'count':0x0,'rows':[]};var _0x297ae2=_['map'](db[_0xaca5('0x3d')]['rawAttributes'],function(_0x1059fb){return{'name':_0x1059fb[_0xaca5('0x3e')],'type':_0x1059fb[_0xaca5('0x3f')][_0xaca5('0x40')]};});_0x2a542a[_0xaca5('0x41')]=_['map'](_0x297ae2,_0xaca5('0x3a'));_0x2a542a[_0xaca5('0x42')]=_[_0xaca5('0x43')](_0x1c1ae5[_0xaca5('0x42')]);_0x2a542a[_0xaca5('0x44')]=_[_0xaca5('0x45')](_0x2a542a[_0xaca5('0x41')],_0x2a542a['query']);_0x223e86['attributes']=_[_0xaca5('0x45')](_0x2a542a[_0xaca5('0x41')],qs[_0xaca5('0x46')](_0x1c1ae5['query'][_0xaca5('0x46')]));_0x223e86[_0xaca5('0x47')]=_0x223e86[_0xaca5('0x47')][_0xaca5('0x48')]?_0x223e86[_0xaca5('0x47')]:_0x2a542a[_0xaca5('0x41')];if(!_0x1c1ae5[_0xaca5('0x42')][_0xaca5('0x49')](_0xaca5('0x4a'))){_0x223e86[_0xaca5('0x31')]=qs[_0xaca5('0x31')](_0x1c1ae5[_0xaca5('0x42')][_0xaca5('0x31')]);_0x223e86[_0xaca5('0x30')]=qs[_0xaca5('0x30')](_0x1c1ae5[_0xaca5('0x42')][_0xaca5('0x30')]);}_0x223e86['order']=qs[_0xaca5('0x4b')](_0x1c1ae5[_0xaca5('0x42')][_0xaca5('0x4b')]);_0x223e86[_0xaca5('0x4c')]=qs[_0xaca5('0x44')](_['pick'](_0x1c1ae5[_0xaca5('0x42')],_0x2a542a[_0xaca5('0x44')]));if(_0x1c1ae5[_0xaca5('0x42')][_0xaca5('0x4d')]){_0x223e86[_0xaca5('0x4c')]=_[_0xaca5('0x4e')](_0x223e86[_0xaca5('0x4c')],{'$or':_[_0xaca5('0x4f')](_0x297ae2,function(_0x386983){if(_0x386983[_0xaca5('0x3f')]!==_0xaca5('0x50')){var _0xd36a3e={};_0xd36a3e[_0x386983[_0xaca5('0x3a')]]={'$like':'%'+_0x1c1ae5[_0xaca5('0x42')][_0xaca5('0x4d')]+'%'};return _0xd36a3e;}})});}_0x223e86=_['merge']({},_0x223e86,_0x1c1ae5[_0xaca5('0x51')]);var _0x222acc={'where':_0x223e86[_0xaca5('0x4c')]};return db['ChatWebsite']['count'](_0x222acc)[_0xaca5('0x21')](function(_0x380678){_0xe3dbd7[_0xaca5('0x52')]=_0x380678;if(_0x1c1ae5[_0xaca5('0x42')][_0xaca5('0x53')]){_0x223e86[_0xaca5('0x54')]=[{'all':!![]}];}return db[_0xaca5('0x3d')][_0xaca5('0x55')](_0x223e86);})[_0xaca5('0x21')](function(_0x1cd524){_0xe3dbd7[_0xaca5('0x56')]=_0x1cd524;return _0xe3dbd7;})[_0xaca5('0x21')](respondWithFilteredResult(_0x362b34,_0x223e86))[_0xaca5('0x2c')](handleError(_0x362b34,null));};exports['show']=function(_0x52522c,_0x3284e4){var _0x33d9c5={'raw':![],'where':{'id':_0x52522c[_0xaca5('0x57')]['id']},'include':[{'model':db[_0xaca5('0x3c')],'as':_0xaca5('0x58')}]},_0x4e8396={};_0x4e8396['model']=_[_0xaca5('0x43')](db[_0xaca5('0x3d')]['rawAttributes']);_0x4e8396[_0xaca5('0x42')]=_[_0xaca5('0x43')](_0x52522c['query']);_0x4e8396[_0xaca5('0x44')]=_['intersection'](_0x4e8396[_0xaca5('0x41')],_0x4e8396[_0xaca5('0x42')]);_0x33d9c5[_0xaca5('0x47')]=_[_0xaca5('0x45')](_0x4e8396[_0xaca5('0x41')],qs[_0xaca5('0x46')](_0x52522c[_0xaca5('0x42')][_0xaca5('0x46')]));_0x33d9c5[_0xaca5('0x47')]=_0x33d9c5[_0xaca5('0x47')][_0xaca5('0x48')]?_0x33d9c5[_0xaca5('0x47')]:_0x4e8396[_0xaca5('0x41')];if(_0x52522c[_0xaca5('0x42')][_0xaca5('0x53')]){_0x33d9c5[_0xaca5('0x54')]=[{'all':!![]}];}_0x33d9c5=_[_0xaca5('0x4e')]({},_0x33d9c5,_0x52522c[_0xaca5('0x51')]);return db[_0xaca5('0x3d')][_0xaca5('0x59')](_0x33d9c5)['then'](handleEntityNotFound(_0x3284e4,null))['then'](respondWithResult(_0x3284e4,null))[_0xaca5('0x2c')](handleError(_0x3284e4,null));};exports['create']=function(_0x56660d,_0x30b6ce){return db[_0xaca5('0x3d')][_0xaca5('0x5a')](_0x56660d[_0xaca5('0x5b')],{})[_0xaca5('0x21')](function(_0x26b422){var _0x3fca8b=_0x56660d['user']['get']({'plain':!![]});if(!_0x3fca8b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3fca8b[_0xaca5('0x5c')]===_0xaca5('0x5d')){var _0x2a6c2e=_0x26b422['get']({'plain':!![]});var _0x2d6b36=_0xaca5('0x5e');return db[_0xaca5('0x5f')][_0xaca5('0x59')]({'where':{'name':_0x2d6b36,'userProfileId':_0x3fca8b[_0xaca5('0x60')]},'raw':!![]})[_0xaca5('0x21')](function(_0x1b191c){if(_0x1b191c&&_0x1b191c[_0xaca5('0x61')]===0x0){return db[_0xaca5('0x62')][_0xaca5('0x5a')]({'name':_0x2a6c2e[_0xaca5('0x3a')],'resourceId':_0x2a6c2e['id'],'type':_0x1b191c[_0xaca5('0x3a')],'sectionId':_0x1b191c['id']},{})[_0xaca5('0x21')](function(){return _0x26b422;});}else{return _0x26b422;}})['catch'](function(_0x3f16bb){logger[_0xaca5('0x27')](_0xaca5('0x63'),_0x3f16bb);throw _0x3f16bb;});}return _0x26b422;})[_0xaca5('0x21')](respondWithResult(_0x30b6ce,0xc9))[_0xaca5('0x2c')](handleError(_0x30b6ce,null));};exports[_0xaca5('0x36')]=function(_0x2f5b0d,_0x3ed294){if(_0x2f5b0d['body']['id']){delete _0x2f5b0d[_0xaca5('0x5b')]['id'];}return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0x2f5b0d['params']['id']},'include':[{'model':db[_0xaca5('0x3c')],'as':_0xaca5('0x58')}]})[_0xaca5('0x21')](handleEntityNotFound(_0x3ed294,null))[_0xaca5('0x21')](saveUpdates(_0x2f5b0d[_0xaca5('0x5b')],null))[_0xaca5('0x21')](respondWithResult(_0x3ed294,null))[_0xaca5('0x2c')](handleError(_0x3ed294,null));};exports[_0xaca5('0x37')]=function(_0x2a33e2,_0x119836){return db[_0xaca5('0x3d')]['find']({'where':{'id':_0x2a33e2[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x119836,null))[_0xaca5('0x21')](removeEntity(_0x119836,null))[_0xaca5('0x2c')](handleError(_0x119836,null));};exports[_0xaca5('0x64')]=function(_0x59318d,_0x37d15d){return db[_0xaca5('0x3d')]['describe']()[_0xaca5('0x21')](respondWithResult(_0x37d15d,null))['catch'](handleError(_0x37d15d,null));};exports[_0xaca5('0x65')]=function(_0xe24343,_0x544ff4,_0xf68996){if(_0xe24343['body']['id']){delete _0xe24343[_0xaca5('0x5b')]['id'];}return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0xe24343['params']['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x544ff4,null))[_0xaca5('0x21')](function(_0x4aec98){if(_0x4aec98){_0xe24343['body'][_0xaca5('0x66')]=_0x4aec98['id'];return db[_0xaca5('0x67')][_0xaca5('0x5a')](_0xe24343[_0xaca5('0x5b')]);}})[_0xaca5('0x21')](respondWithResult(_0x544ff4,null))['catch'](handleError(_0x544ff4,null));};exports[_0xaca5('0x68')]=function(_0x8d268e,_0x321d5a,_0x19e8a3){var _0x37b0a6={'raw':![],'where':{}};var _0x446b9d={};var _0x18197f={'count':0x0,'rows':[]};return db[_0xaca5('0x3d')]['findOne']({'where':{'id':_0x8d268e[_0xaca5('0x57')]['id']}})['then'](handleEntityNotFound(_0x321d5a,null))[_0xaca5('0x21')](function(_0x37a29a){if(_0x37a29a){_0x446b9d['model']=_[_0xaca5('0x43')](db[_0xaca5('0x67')][_0xaca5('0x69')]);_0x446b9d['query']=_[_0xaca5('0x43')](_0x8d268e[_0xaca5('0x42')]);_0x446b9d[_0xaca5('0x44')]=_[_0xaca5('0x45')](_0x446b9d['model'],_0x446b9d['query']);_0x37b0a6[_0xaca5('0x47')]=_[_0xaca5('0x45')](_0x446b9d['model'],qs[_0xaca5('0x46')](_0x8d268e[_0xaca5('0x42')][_0xaca5('0x46')]));_0x37b0a6['attributes']=_0x37b0a6['attributes'][_0xaca5('0x48')]?_0x37b0a6[_0xaca5('0x47')]:_0x446b9d[_0xaca5('0x41')];if(!_0x8d268e[_0xaca5('0x42')][_0xaca5('0x49')](_0xaca5('0x4a'))){_0x37b0a6[_0xaca5('0x31')]=qs[_0xaca5('0x31')](_0x8d268e['query']['limit']);_0x37b0a6['offset']=qs['offset'](_0x8d268e[_0xaca5('0x42')]['offset']);}_0x37b0a6[_0xaca5('0x6a')]=qs[_0xaca5('0x4b')](_0x8d268e[_0xaca5('0x42')][_0xaca5('0x4b')]);_0x37b0a6['where']=qs['filters'](_[_0xaca5('0x6b')](_0x8d268e['query'],_0x446b9d[_0xaca5('0x44')]));_0x37b0a6[_0xaca5('0x4c')][_0xaca5('0x66')]=_0x37a29a['id'];if(_0x8d268e[_0xaca5('0x42')][_0xaca5('0x4d')]){_0x37b0a6[_0xaca5('0x4c')]=_[_0xaca5('0x4e')](_0x37b0a6[_0xaca5('0x4c')],{'$or':_[_0xaca5('0x4f')](_0x37b0a6['attributes'],function(_0x3448a9){var _0x2b856c={};_0x2b856c[_0x3448a9]={'$like':'%'+_0x8d268e[_0xaca5('0x42')][_0xaca5('0x4d')]+'%'};return _0x2b856c;})});}_0x37b0a6=_[_0xaca5('0x4e')]({},_0x37b0a6,_0x8d268e[_0xaca5('0x51')]);return db[_0xaca5('0x67')][_0xaca5('0x52')]({'where':_0x37b0a6[_0xaca5('0x4c')]})[_0xaca5('0x21')](function(_0x4a74d2){_0x18197f[_0xaca5('0x52')]=_0x4a74d2;if(_0x8d268e['query']['includeAll']){_0x37b0a6[_0xaca5('0x54')]=[{'all':!![]}];}return db[_0xaca5('0x67')][_0xaca5('0x55')](_0x37b0a6);})[_0xaca5('0x21')](function(_0x5f2689){_0x18197f[_0xaca5('0x56')]=_0x5f2689;return _0x18197f;});}})[_0xaca5('0x21')](respondWithFilteredResult(_0x321d5a,_0x37b0a6))[_0xaca5('0x2c')](handleError(_0x321d5a,null));};exports[_0xaca5('0x6c')]=function(_0x438812,_0x349ce9,_0x26929e){return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0x438812['params']['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x349ce9,null))[_0xaca5('0x21')](function(_0xcc798d){if(_0xcc798d){return _0xcc798d[_0xaca5('0x6c')](_0x438812['query']['ids']);}})['then'](respondWithStatusCode(_0x349ce9,null))['catch'](handleError(_0x349ce9,null));};exports[_0xaca5('0x6d')]=function(_0x1d4c98,_0x2da79e,_0x5ee3ac){if(_0x1d4c98[_0xaca5('0x5b')]['id']){delete _0x1d4c98[_0xaca5('0x5b')]['id'];}return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0x1d4c98[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x2da79e,null))[_0xaca5('0x21')](function(_0x249bd8){if(_0x249bd8){_0x1d4c98[_0xaca5('0x5b')][_0xaca5('0x66')]=_0x249bd8['id'];return db[_0xaca5('0x6e')][_0xaca5('0x5a')](_0x1d4c98[_0xaca5('0x5b')]);}})[_0xaca5('0x21')](respondWithResult(_0x2da79e,null))[_0xaca5('0x2c')](handleError(_0x2da79e,null));};exports[_0xaca5('0x6f')]=function(_0x2703cd,_0x1e1880,_0x386d70){var _0x49cf58={'raw':![],'where':{}};var _0x27dc1d={};var _0x211c7f={'count':0x0,'rows':[]};return db[_0xaca5('0x3d')]['findOne']({'where':{'id':_0x2703cd[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x1e1880,null))[_0xaca5('0x21')](function(_0x2801ac){if(_0x2801ac){_0x27dc1d[_0xaca5('0x41')]=_[_0xaca5('0x43')](db[_0xaca5('0x6e')][_0xaca5('0x69')]);_0x27dc1d[_0xaca5('0x42')]=_[_0xaca5('0x43')](_0x2703cd['query']);_0x27dc1d[_0xaca5('0x44')]=_[_0xaca5('0x45')](_0x27dc1d[_0xaca5('0x41')],_0x27dc1d[_0xaca5('0x42')]);_0x49cf58[_0xaca5('0x47')]=_['intersection'](_0x27dc1d[_0xaca5('0x41')],qs[_0xaca5('0x46')](_0x2703cd['query'][_0xaca5('0x46')]));_0x49cf58[_0xaca5('0x47')]=_0x49cf58['attributes']['length']?_0x49cf58[_0xaca5('0x47')]:_0x27dc1d[_0xaca5('0x41')];if(!_0x2703cd['query'][_0xaca5('0x49')]('nolimit')){_0x49cf58[_0xaca5('0x31')]=qs[_0xaca5('0x31')](_0x2703cd[_0xaca5('0x42')][_0xaca5('0x31')]);_0x49cf58[_0xaca5('0x30')]=qs[_0xaca5('0x30')](_0x2703cd[_0xaca5('0x42')][_0xaca5('0x30')]);}_0x49cf58[_0xaca5('0x6a')]=qs[_0xaca5('0x4b')](_0x2703cd['query'][_0xaca5('0x4b')]);_0x49cf58['where']=qs[_0xaca5('0x44')](_[_0xaca5('0x6b')](_0x2703cd[_0xaca5('0x42')],_0x27dc1d[_0xaca5('0x44')]));_0x49cf58[_0xaca5('0x4c')]['ChatWebsiteId']=_0x2801ac['id'];if(_0x2703cd[_0xaca5('0x42')][_0xaca5('0x4d')]){_0x49cf58[_0xaca5('0x4c')]=_[_0xaca5('0x4e')](_0x49cf58[_0xaca5('0x4c')],{'$or':_['map'](_0x49cf58['attributes'],function(_0x55f9f1){var _0x5f48bf={};_0x5f48bf[_0x55f9f1]={'$like':'%'+_0x2703cd[_0xaca5('0x42')][_0xaca5('0x4d')]+'%'};return _0x5f48bf;})});}_0x49cf58=_[_0xaca5('0x4e')]({},_0x49cf58,_0x2703cd['options']);return db[_0xaca5('0x6e')]['count']({'where':_0x49cf58[_0xaca5('0x4c')]})[_0xaca5('0x21')](function(_0x27aadf){_0x211c7f[_0xaca5('0x52')]=_0x27aadf;if(_0x2703cd[_0xaca5('0x42')]['includeAll']){_0x49cf58['include']=[{'all':!![]}];}return db[_0xaca5('0x6e')][_0xaca5('0x55')](_0x49cf58);})[_0xaca5('0x21')](function(_0x28a180){_0x211c7f[_0xaca5('0x56')]=_0x28a180;return _0x211c7f;});}})[_0xaca5('0x21')](respondWithFilteredResult(_0x1e1880,_0x49cf58))[_0xaca5('0x2c')](handleError(_0x1e1880,null));};exports[_0xaca5('0x70')]=function(_0x54c912,_0x110709,_0x4f71c2){return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0x54c912[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x110709,null))[_0xaca5('0x21')](function(_0x144b57){if(_0x144b57){return _0x144b57[_0xaca5('0x70')](_0x54c912['query'][_0xaca5('0x71')]);}})[_0xaca5('0x21')](respondWithStatusCode(_0x110709,null))[_0xaca5('0x2c')](handleError(_0x110709,null));};exports['addLogo']=function(_0x1fa4bd,_0x10b1b5,_0x4e3545){_0x1fa4bd[_0xaca5('0x5b')][_0xaca5('0x72')]=_0x1fa4bd[_0xaca5('0x73')][_0xaca5('0x74')];return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0x1fa4bd[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x10b1b5,null))[_0xaca5('0x21')](saveUpdates(_0x1fa4bd[_0xaca5('0x5b')],null))[_0xaca5('0x21')](respondWithResult(_0x10b1b5,null))[_0xaca5('0x2c')](handleError(_0x10b1b5,null));};exports['addAvatar']=function(_0x12fbaa,_0x2d017e,_0x1cea2f){_0x12fbaa[_0xaca5('0x5b')]['agentAvatar']=_0x12fbaa[_0xaca5('0x73')][_0xaca5('0x74')];return db[_0xaca5('0x3d')]['find']({'where':{'id':_0x12fbaa[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x2d017e,null))['then'](saveUpdates(_0x12fbaa[_0xaca5('0x5b')],null))[_0xaca5('0x21')](respondWithResult(_0x2d017e,null))[_0xaca5('0x2c')](handleError(_0x2d017e,null));};exports[_0xaca5('0x75')]=function(_0xf99817,_0x1167f7,_0x521a7d){_0xf99817[_0xaca5('0x5b')][_0xaca5('0x76')]=_0xf99817[_0xaca5('0x73')][_0xaca5('0x74')];return db['ChatWebsite'][_0xaca5('0x59')]({'where':{'id':_0xf99817[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x1167f7,null))[_0xaca5('0x21')](saveUpdates(_0xf99817[_0xaca5('0x5b')],null))[_0xaca5('0x21')](respondWithResult(_0x1167f7,null))[_0xaca5('0x2c')](handleError(_0x1167f7,null));};exports[_0xaca5('0x77')]=function(_0x38e55a,_0x199c91,_0x2b0d3d){_0x38e55a[_0xaca5('0x5b')][_0xaca5('0x78')]=_0x38e55a[_0xaca5('0x73')][_0xaca5('0x74')];return db['ChatWebsite']['find']({'where':{'id':_0x38e55a['params']['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x199c91,null))[_0xaca5('0x21')](saveUpdates(_0x38e55a[_0xaca5('0x5b')],null))[_0xaca5('0x21')](respondWithResult(_0x199c91,null))[_0xaca5('0x2c')](handleError(_0x199c91,null));};exports['getLogo']=function(_0x13014b,_0xe5c75a,_0x5cdbd7){var _0x483ffb=path[_0xaca5('0x79')](config[_0xaca5('0x7a')],_0xaca5('0x7b'));var _0x505ee4={'where':{'id':_0x13014b[_0xaca5('0x57')]['id']},'attributes':['id',_0xaca5('0x72')],'raw':!![]};var _0x4d6f14=![];return require(_0xaca5('0x7c'))[_0xaca5('0x7d')]()[_0xaca5('0x21')](function(_0x57b241){if(_0x57b241){_0x4d6f14=_0x57b241['custom'];}})[_0xaca5('0x21')](function(){return db[_0xaca5('0x3d')][_0xaca5('0x59')](_0x505ee4);})['then'](handleEntityNotFound(_0xe5c75a,null))[_0xaca5('0x21')](function(_0x2d2d33){if(_0x2d2d33){if(!_[_0xaca5('0x7e')](_0x2d2d33[_0xaca5('0x72')])){if(fs[_0xaca5('0x7f')](path[_0xaca5('0x79')](config['root'],_0xaca5('0x80'),_0x2d2d33[_0xaca5('0x72')]))&&_0x4d6f14){_0x483ffb=path[_0xaca5('0x79')](config[_0xaca5('0x7a')],_0xaca5('0x80'),_0x2d2d33[_0xaca5('0x72')]);}}return _0xe5c75a[_0xaca5('0x81')](_0x483ffb);}})[_0xaca5('0x2c')](handleError(_0xe5c75a,null));};exports['getAvatar']=function(_0x1400c5,_0x1c0ae2,_0x54b110){var _0x21e1b9=path[_0xaca5('0x79')](config['root'],'server/files/images/avatars/default_avatar.png');var _0x1236dc={'where':{'id':_0x1400c5['params']['id']},'attributes':['id','agentAvatar'],'raw':!![]};return db['ChatWebsite'][_0xaca5('0x59')](_0x1236dc)[_0xaca5('0x21')](handleEntityNotFound(_0x1c0ae2,null))[_0xaca5('0x21')](function(_0x407ef5){if(_0x407ef5){if(!_[_0xaca5('0x7e')](_0x407ef5[_0xaca5('0x82')])){if(fs[_0xaca5('0x7f')](path['join'](config[_0xaca5('0x7a')],'server/files/images/avatars/',_0x407ef5[_0xaca5('0x82')]))){_0x21e1b9=path[_0xaca5('0x79')](config['root'],_0xaca5('0x83'),_0x407ef5[_0xaca5('0x82')]);}}return _0x1c0ae2['download'](_0x21e1b9);}})['catch'](handleError(_0x1c0ae2,null));};exports[_0xaca5('0x84')]=function(_0x409ac2,_0x429146,_0x3e7fae){var _0x549b5b=path[_0xaca5('0x79')](config['root'],_0xaca5('0x85'));var _0x4fca41={'where':{'id':_0x409ac2[_0xaca5('0x57')]['id']},'attributes':['id',_0xaca5('0x76'),_0xaca5('0x86')],'raw':!![]};return db[_0xaca5('0x3d')][_0xaca5('0x59')](_0x4fca41)['then'](handleEntityNotFound(_0x429146,null))[_0xaca5('0x21')](function(_0x9420e8){if(_0x9420e8){if(!_[_0xaca5('0x7e')](_0x9420e8[_0xaca5('0x76')])){if(fs[_0xaca5('0x7f')](path['join'](config['root'],_0xaca5('0x83'),_0x9420e8[_0xaca5('0x76')]))&&_0x9420e8[_0xaca5('0x86')]){_0x549b5b=path[_0xaca5('0x79')](config['root'],_0xaca5('0x83'),_0x9420e8[_0xaca5('0x76')]);}}return _0x429146[_0xaca5('0x81')](_0x549b5b);}})[_0xaca5('0x2c')](handleError(_0x429146,null));};exports[_0xaca5('0x87')]=function(_0xd53346,_0x5503da,_0x506024){var _0x109487=path[_0xaca5('0x79')](config[_0xaca5('0x7a')],_0xaca5('0x88'));var _0x5127fa={'where':{'id':_0xd53346[_0xaca5('0x57')]['id']},'attributes':['id',_0xaca5('0x78')],'raw':!![]};return db[_0xaca5('0x3d')][_0xaca5('0x59')](_0x5127fa)[_0xaca5('0x21')](handleEntityNotFound(_0x5503da,null))['then'](function(_0x66712d){if(_0x66712d){if(!_['isNil'](_0x66712d['systemAvatar'])){if(fs[_0xaca5('0x7f')](path[_0xaca5('0x79')](config[_0xaca5('0x7a')],_0xaca5('0x83'),_0x66712d['systemAvatar']))){_0x109487=path[_0xaca5('0x79')](config[_0xaca5('0x7a')],_0xaca5('0x83'),_0x66712d[_0xaca5('0x78')]);}}return _0x5503da[_0xaca5('0x81')](_0x109487);}})[_0xaca5('0x2c')](handleError(_0x5503da,null));};exports[_0xaca5('0x89')]=function(_0x58230b,_0x438588,_0x26f565){var _0x2a7d5a=require(_0xaca5('0x8a'));var _0xfa99cf=new _0x2a7d5a();var _0x277150=_0xfa99cf[_0xaca5('0x8b')](_0x58230b[_0xaca5('0x8c')]['user-agent'])[_0xaca5('0x8d')]();var _0x37365d={'body':_0x58230b[_0xaca5('0x5b')],'channel':_0xaca5('0x8e')};var _0x29b493=[];var _0x514617=[];var _0xcf035e={};var _0x5032f2=![];return db['CmContact'][_0xaca5('0x64')]()[_0xaca5('0x21')](function(_0x381747){if(!_0x381747){throw new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))](_0xaca5('0x8f'));}_0x29b493=_[_0xaca5('0x90')](_[_0xaca5('0x43')](_0x381747),[_0xaca5('0x91'),_0xaca5('0x92')]);_0x514617=_['difference'](_[_0xaca5('0x43')](_0x381747),[_0xaca5('0x91'),_0xaca5('0x92'),'CompanyId',_0xaca5('0x93')]);if(_0x58230b['body']['id']){delete _0x58230b[_0xaca5('0x5b')]['id'];}if(_[_0xaca5('0x7e')](_0x58230b[_0xaca5('0x5b')][_0xaca5('0x94')])){throw new db[(_0xaca5('0x1d'))]['ValidationError'](_0xaca5('0x95'));}if(_[_0xaca5('0x7e')](_0x58230b[_0xaca5('0x5b')]['body'])||_0x58230b[_0xaca5('0x5b')][_0xaca5('0x5b')]===''){throw new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))](_0xaca5('0x96'));}if(_[_0xaca5('0x7e')](_0x58230b[_0xaca5('0x5b')][_0xaca5('0x97')])){throw new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))](_0xaca5('0x98')+_0x514617);}if(!_[_0xaca5('0x99')](_0x514617,_0x58230b[_0xaca5('0x5b')][_0xaca5('0x97')])){throw new db['Sequelize'][(_0xaca5('0x1e'))](_0xaca5('0x9a')+_0x514617);}_0xcf035e[_0x58230b[_0xaca5('0x5b')]['mapKey']]=_0x58230b[_0xaca5('0x5b')][_0xaca5('0x94')];})['then'](function(){return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0x58230b['params']['id']},'include':[{'model':db[_0xaca5('0x9b')],'as':_0xaca5('0x9c'),'include':[{'model':db[_0xaca5('0x9d')],'as':_0xaca5('0x9e'),'where':_0xcf035e,'limit':0x1,'order':[[_0xaca5('0x92'),_0xaca5('0x9f')]]}]},{'model':db[_0xaca5('0xa0')],'as':_0xaca5('0xa1')}]});})[_0xaca5('0x21')](handleEntityNotFound(_0x438588,null))[_0xaca5('0x21')](function(_0x46d333){if(_0x46d333&&_0x46d333[_0xaca5('0x9c')]){_0x37365d[_0xaca5('0xa2')]=_0x46d333;_0x37365d['applications']=_0x46d333[_0xaca5('0xa1')];_0x37365d[_0xaca5('0xa3')]=_0x46d333[_0xaca5('0x9c')];_0x37365d[_0xaca5('0xa4')]=_['orderBy'](_0x37365d[_0xaca5('0xa4')],['priority'],[_0xaca5('0xa5')]);if(_0x37365d[_0xaca5('0xa2')]['Applications']){delete _0x37365d[_0xaca5('0xa2')][_0xaca5('0xa1')];}if(_0x37365d[_0xaca5('0xa2')][_0xaca5('0x9c')]&&_0x37365d[_0xaca5('0xa2')][_0xaca5('0x9c')]['Contacts'][_0xaca5('0x48')]){return _0x37365d[_0xaca5('0xa2')][_0xaca5('0x9c')][_0xaca5('0x9e')][0x0];}var _0x46f313=_[_0xaca5('0x16')](_0x58230b['body'],{'firstName':_0x58230b['body'][_0xaca5('0x94')],'ListId':_0x46d333['ListId']});_0x46f313[_0x58230b[_0xaca5('0x5b')][_0xaca5('0x97')]]=_0x58230b[_0xaca5('0x5b')][_0xaca5('0x94')];return db[_0xaca5('0x9d')]['create'](_0x46f313,{'fields':_0x29b493,'raw':!![]});}})[_0xaca5('0x21')](handleEntityNotFound(_0x438588,null))['then'](function(_0x29190a){_0x37365d[_0xaca5('0xa6')]=_0x29190a;var _0x11911b=_0x58230b[_0xaca5('0x5b')]['customerIp'];if(_0x58230b[_0xaca5('0x8c')]['cf-connecting-ip']){_0x11911b=_0x58230b[_0xaca5('0x8c')][_0xaca5('0xa7')];}else if(_0x58230b[_0xaca5('0x8c')]['x-forwarded-for']){_0x11911b=_[_0xaca5('0xa8')](_0x58230b[_0xaca5('0x8c')][_0xaca5('0xa9')][_0xaca5('0xaa')](','));}if(_0x29190a){var _0x1758ba={'ContactId':_0x29190a['id'],'ChatWebsiteId':_0x58230b[_0xaca5('0x57')]['id'],'from':(_0x29190a[_0xaca5('0xab')]||'')+'\x20'+(_0x29190a['lastName']||''),'customerIp':_0x11911b,'customerPort':_0x58230b['headers']['x-real-port']?_0x58230b[_0xaca5('0x8c')]['x-real-port']:null,'referer':_0x58230b[_0xaca5('0x5b')][_0xaca5('0xac')],'browserName':_0x277150[_0xaca5('0xad')]['name']&&_0x277150[_0xaca5('0xad')][_0xaca5('0xae')]?util[_0xaca5('0xaf')](_0xaca5('0xb0'),_0x277150[_0xaca5('0xad')][_0xaca5('0x3a')],_0x277150[_0xaca5('0xad')][_0xaca5('0xae')]):'unknown','browserVersion':_0x277150[_0xaca5('0xad')][_0xaca5('0xae')]||_0xaca5('0xb1'),'osName':util[_0xaca5('0xaf')]('%s\x20%s',_0x277150['os'][_0xaca5('0x3a')],_0x277150['os'][_0xaca5('0xae')]),'osVersion':_0x277150['os'][_0xaca5('0xae')],'deviceModel':_0x277150[_0xaca5('0xb2')][_0xaca5('0x41')]&&_0x277150[_0xaca5('0xb2')]['vendor']?util[_0xaca5('0xaf')](_0xaca5('0xb3'),_0x277150[_0xaca5('0xb2')]['model'],_0x277150[_0xaca5('0xb2')]['vendor'],_0x277150[_0xaca5('0xb2')][_0xaca5('0x3f')]):null,'deviceVendor':_0x277150[_0xaca5('0xb2')][_0xaca5('0xb4')],'deviceType':_0x277150[_0xaca5('0xb2')][_0xaca5('0x3f')],'formData':JSON['stringify'](_0x58230b['body'])};var _0x124c0d={'ChatWebsiteId':_0x58230b[_0xaca5('0x57')]['id'],'closed':![]};if(_0x58230b[_0xaca5('0x5b')][_0xaca5('0xb5')]){_0x124c0d['threadId']=_0x58230b['body'][_0xaca5('0xb5')];return db[_0xaca5('0xb6')]['find']({'where':_0x124c0d})['then'](function(_0x64850d){if(_0x64850d){return[_0x64850d,![]];}_0x1758ba[_0xaca5('0xb5')]=_0x58230b[_0xaca5('0x5b')][_0xaca5('0xb5')];_0x1758ba['externalUrl']=_0x58230b[_0xaca5('0x5b')][_0xaca5('0xb7')];return db['ChatInteraction'][_0xaca5('0x5a')](_0x1758ba)['then'](function(_0x486489){return[_0x486489,!![]];});});}_0x124c0d[_0xaca5('0xb8')]=_0x29190a['id'];if(_0x58230b['body']['interaction']&&_0x58230b[_0xaca5('0x5b')][_0xaca5('0xb9')]['id']){_0x124c0d['id']=_0x58230b['body'][_0xaca5('0xb9')]['id'];return db[_0xaca5('0xb6')]['find']({'where':_0x124c0d})[_0xaca5('0x21')](function(_0x1a8267){if(_0x1a8267){return[_0x1a8267,![]];}return db[_0xaca5('0xb6')]['create'](_0x1758ba)[_0xaca5('0x21')](function(_0x73278d){return[_0x73278d,!![]];});});}return db[_0xaca5('0xb6')]['create'](_0x1758ba)[_0xaca5('0x21')](function(_0x5be492){return[_0x5be492,!![]];});}})[_0xaca5('0xba')](function(_0xda3b63,_0x1abfda){if(_0xda3b63){_0x5032f2=_0x1abfda;if(!_0x1abfda){var _0x36b836={'from':(_0x37365d[_0xaca5('0xa6')][_0xaca5('0xab')]||'')+'\x20'+(_0x37365d[_0xaca5('0xa6')]['lastName']||'')};if(_0x58230b['body'][_0xaca5('0xb5')]&&_0x58230b[_0xaca5('0x5b')][_0xaca5('0xbb')]&&_0x58230b['body'][_0xaca5('0xb5')]!=_0x58230b[_0xaca5('0x5b')][_0xaca5('0xbb')]){_0x36b836[_0xaca5('0xb5')]=_0x58230b[_0xaca5('0x5b')][_0xaca5('0xbb')];}return _0xda3b63[_0xaca5('0x36')](_0x36b836);}else{return _0xda3b63;}}})['then'](function(_0x147734){_0x37365d[_0xaca5('0xb9')]=_0x147734[_0xaca5('0xbc')]({'plain':!![]});_0x37365d[_0xaca5('0xb9')]['created']=_0x5032f2;if(_0x37365d['interaction'][_0xaca5('0xbd')]){if(_0x37365d[_0xaca5('0xa2')][_0xaca5('0xbe')]){_0x37365d['applications'][_0xaca5('0xbf')]({'id':0x0,'priority':_0x37365d[_0xaca5('0xa4')]['length']+0x1,'app':'close','appdata':_0xaca5('0xc0'),'interval':'*,*,*,*'});}}return db[_0xaca5('0xc1')][_0xaca5('0x5a')]({'body':_0x58230b['body'][_0xaca5('0x5b')],'ChatWebsiteId':_0x58230b[_0xaca5('0x57')]['id'],'ChatInteractionId':_0x147734['id'],'direction':'in','ContactId':_0x37365d['contact']['id'],'AttachmentId':_0x58230b[_0xaca5('0x5b')][_0xaca5('0xc2')]});})[_0xaca5('0x21')](function(_0x48d7f8){_0x37365d['message']=_0x48d7f8;if(_0x37365d[_0xaca5('0xb9')][_0xaca5('0xc3')]){return db['User'][_0xaca5('0x59')]({'attributes':['id','name'],'where':{'id':_0x37365d[_0xaca5('0xb9')][_0xaca5('0xc3')]}})['then'](function(_0x46d380){if(_0x46d380){_0x37365d[_0xaca5('0xa4')][_0xaca5('0xc4')]({'id':0x0,'priority':0x0,'app':_0xaca5('0xc5'),'appdata':_0x46d380[_0xaca5('0x3a')]+','+(_0x37365d[_0xaca5('0xa2')][_0xaca5('0xc6')]||0xa),'interval':'*,*,*,*'});_0x37365d['forcedOwnership']=!![];}return respondWithRpcPromise(_0xaca5('0xc7'),_0xaca5('0xc8'),_0x37365d);});}return respondWithRpcPromise(_0xaca5('0xc7'),_0xaca5('0xc8'),_0x37365d);})[_0xaca5('0x21')](function(_0x2abea3){respondWithRpcPromise(_0xaca5('0xc9'),'EventManager',{'event':_0xaca5('0x89'),'message':_0x2abea3},client9002);return _0x2abea3;})[_0xaca5('0x21')](respondWithResult(_0x438588,null))[_0xaca5('0x2c')](handleError(_0x438588,null));};exports[_0xaca5('0xca')]=function(_0x2e5b4f,_0x2bbb70,_0x157b86){var _0x2edf11,_0x22e293,_0x56da35;var _0x9de942=[];var _0x3b6f21=[];var _0x51b2e6={};return db[_0xaca5('0x9d')][_0xaca5('0x64')]()[_0xaca5('0x21')](function(_0x27b34e){if(!_0x27b34e){throw new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))]('no\x20available\x20attributes');}_0x3b6f21=_[_0xaca5('0x90')](_[_0xaca5('0x43')](_0x27b34e),[_0xaca5('0x91'),_0xaca5('0x92')]);_0x9de942=_['difference'](_['keys'](_0x27b34e),['createdAt',_0xaca5('0x92'),_0xaca5('0xcb'),_0xaca5('0x93')]);if(_0x2e5b4f['body']['id']){delete _0x2e5b4f[_0xaca5('0x5b')]['id'];}if(_[_0xaca5('0x7e')](_0x2e5b4f[_0xaca5('0x5b')]['from'])){throw _0x2bbb70[_0xaca5('0x2d')](0x1f4)[_0xaca5('0xcc')](new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))](_0xaca5('0x95')));}if(_['isNil'](_0x2e5b4f['body'][_0xaca5('0x5b')])||_0x2e5b4f[_0xaca5('0x5b')]['body']===''){throw _0x2bbb70[_0xaca5('0x2d')](0x1f4)['send'](new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))](_0xaca5('0x96')));}if(_[_0xaca5('0x7e')](_0x2e5b4f['body']['mapKeyOffline'])){throw _0x2bbb70['status'](0x1f4)['send'](new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))](_0xaca5('0xcd')+_0x9de942));}if(!_['includes'](_0x9de942,_0x2e5b4f['body'][_0xaca5('0xce')])){throw _0x2bbb70[_0xaca5('0x2d')](0x1f4)['send'](new db[(_0xaca5('0x1d'))][(_0xaca5('0x1e'))](_0xaca5('0xcf')+_0x9de942));}_0x51b2e6[_0x2e5b4f[_0xaca5('0x5b')][_0xaca5('0xce')]]=_0x2e5b4f[_0xaca5('0x5b')]['from'];})['then'](function(){return db[_0xaca5('0x3d')]['find']({'where':{'id':_0x2e5b4f[_0xaca5('0x57')]['id']},'include':[{'model':db[_0xaca5('0x9b')],'as':'List'}]});})[_0xaca5('0x21')](handleEntityNotFound(_0x2bbb70,null))[_0xaca5('0x21')](function(_0xcf4228){if(_0xcf4228&&_0xcf4228[_0xaca5('0x9c')]){_0x22e293=_0xcf4228;var _0x2ea49b=_['defaults'](_0x2e5b4f[_0xaca5('0x5b')],{'firstName':_0x2e5b4f[_0xaca5('0x5b')]['from'],'phone':_0x2e5b4f['body'][_0xaca5('0x94')],'ListId':_0xcf4228[_0xaca5('0x93')]});_0x2ea49b[_0x2e5b4f[_0xaca5('0x5b')][_0xaca5('0xce')]]=_0x2e5b4f['body'][_0xaca5('0x94')];return db[_0xaca5('0x9d')][_0xaca5('0xd0')]({'where':_0x51b2e6,'defaults':_0x2ea49b});}})[_0xaca5('0xba')](function(_0x3539df){if(_0x3539df){_0x56da35=_0x3539df;var _0x3a511c=fs[_0xaca5('0xd1')](path[_0xaca5('0x79')](config[_0xaca5('0x7a')],'server/files/templates/chatOfflineMessage.ejs'),_0xaca5('0xd2'));var _0x4bb108=ejs[_0xaca5('0xd3')](_0x3a511c,{'body':_[_0xaca5('0xd4')](_0x2e5b4f[_0xaca5('0x5b')][_0xaca5('0x5b')]),'bodyTitle':_0x22e293[_0xaca5('0xd5')]});return db[_0xaca5('0xd6')][_0xaca5('0x5a')]({'body':_0x4bb108,'ContactId':_0x3539df['id'],'ChatWebsiteId':_0x22e293['id']});}})[_0xaca5('0x21')](function(_0x55211c){if(_0x55211c){_0x2edf11=_0x55211c;return db[_0xaca5('0xd7')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xaca5('0xd8')],'as':_0xaca5('0xd9'),'raw':!![]}]});}})[_0xaca5('0x21')](function(_0x5c21ef){if(_0x5c21ef&&_0x5c21ef[_0xaca5('0xd9')]&&_0x22e293[_0xaca5('0xda')]){var _0x4098f5={'tls':{'rejectUnauthorized':![]}};if(_0x5c21ef[_0xaca5('0xd9')][_0xaca5('0xdb')]){_0x4098f5[_0xaca5('0xdb')]=_0x5c21ef[_0xaca5('0xd9')][_0xaca5('0xdb')];}else{_0x4098f5['host']=_0x5c21ef[_0xaca5('0xd9')][_0xaca5('0xdc')];_0x4098f5['port']=_0x5c21ef[_0xaca5('0xd9')]['port'];_0x4098f5[_0xaca5('0xdd')]=_0x5c21ef[_0xaca5('0xd9')][_0xaca5('0xdd')];}if(_0x5c21ef['Smtp'][_0xaca5('0xde')]){_0x4098f5['auth']={'user':_0x5c21ef[_0xaca5('0xd9')][_0xaca5('0x5d')],'pass':_0x5c21ef['Smtp'][_0xaca5('0xdf')]};}return respondWithRpcPromise(_0xaca5('0xe0'),_0xaca5('0xe1'),{'account':_0x4098f5,'message':{'from':util[_0xaca5('0xaf')]('\x22%s\x22\x20<%s>',_0x5c21ef[_0xaca5('0x3a')],_0x5c21ef['email']||_0x5c21ef[_0xaca5('0xd9')][_0xaca5('0x5d')]),'to':_0x22e293[_0xaca5('0xda')],'subject':_0x22e293[_0xaca5('0xe2')],'text':_0x2edf11[_0xaca5('0x5b')]}},client9003)[_0xaca5('0x21')](function(){return _0x2edf11;})[_0xaca5('0x2c')](function(_0x63a440){console[_0xaca5('0x27')](_0x63a440);});}})[_0xaca5('0x21')](function(){if(_0x2edf11){return _0x2edf11;}})[_0xaca5('0x21')](respondWithResult(_0x2bbb70,null))['catch'](handleError(_0x2bbb70,null));};exports['addInteraction']=function(_0x50e5c5,_0x301574,_0x5b3e6e){return db[_0xaca5('0xb6')]['find']({'where':{'id':_0x50e5c5[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x301574,null))[_0xaca5('0x21')](function(_0x4b73f6){if(_0x4b73f6){return _0x4b73f6[_0xaca5('0xe3')](_0x50e5c5[_0xaca5('0x5b')]['ids'],_[_0xaca5('0xe4')](_0x50e5c5['body'],['ids','id'])||{});}})[_0xaca5('0x21')](respondWithResult(_0x301574,null))['catch'](handleError(_0x301574,null));};exports[_0xaca5('0xe5')]=function(_0x29ac16,_0x48f88d,_0x4a1883){var _0x4a7b81={'raw':![],'where':{}};var _0x48cd0={};var _0x37409e={'count':0x0,'rows':[]};return db[_0xaca5('0x3d')]['findOne']({'where':{'id':_0x29ac16['params']['id']}})['then'](handleEntityNotFound(_0x48f88d,null))['then'](function(_0x1db344){if(_0x1db344){_0x48cd0[_0xaca5('0x41')]=_[_0xaca5('0x43')](db[_0xaca5('0xb6')][_0xaca5('0x69')]);_0x48cd0['query']=_['keys'](_0x29ac16[_0xaca5('0x42')]);_0x48cd0[_0xaca5('0x44')]=_[_0xaca5('0x45')](_0x48cd0[_0xaca5('0x41')],_0x48cd0['query']);_0x4a7b81[_0xaca5('0x47')]=_[_0xaca5('0x45')](_0x48cd0['model'],qs[_0xaca5('0x46')](_0x29ac16[_0xaca5('0x42')][_0xaca5('0x46')]));_0x4a7b81['attributes']=_0x4a7b81[_0xaca5('0x47')][_0xaca5('0x48')]?_0x4a7b81['attributes']:_0x48cd0[_0xaca5('0x41')];if(!_0x29ac16['query'][_0xaca5('0x49')]('nolimit')){_0x4a7b81['limit']=qs[_0xaca5('0x31')](_0x29ac16[_0xaca5('0x42')][_0xaca5('0x31')]);_0x4a7b81[_0xaca5('0x30')]=qs['offset'](_0x29ac16['query']['offset']);}_0x4a7b81[_0xaca5('0x6a')]=qs['sort'](_0x29ac16[_0xaca5('0x42')][_0xaca5('0x4b')]);_0x4a7b81['where']=qs['filters'](_[_0xaca5('0x6b')](_0x29ac16[_0xaca5('0x42')],_0x48cd0[_0xaca5('0x44')]));_0x4a7b81[_0xaca5('0x4c')][_0xaca5('0x66')]=_0x1db344['id'];if(_0x29ac16[_0xaca5('0x42')]['filter']){_0x4a7b81[_0xaca5('0x4c')]=_[_0xaca5('0x4e')](_0x4a7b81[_0xaca5('0x4c')],{'$or':_[_0xaca5('0x4f')](_0x4a7b81[_0xaca5('0x47')],function(_0x19c875){var _0xc51a7f={};_0xc51a7f[_0x19c875]={'$like':'%'+_0x29ac16['query'][_0xaca5('0x4d')]+'%'};return _0xc51a7f;})});}_0x4a7b81=_[_0xaca5('0x4e')]({},_0x4a7b81,_0x29ac16['options']);return db[_0xaca5('0xb6')]['count']({'where':_0x4a7b81['where']})[_0xaca5('0x21')](function(_0x506360){_0x37409e[_0xaca5('0x52')]=_0x506360;if(_0x29ac16[_0xaca5('0x42')][_0xaca5('0x53')]){_0x4a7b81[_0xaca5('0x54')]=[{'model':db[_0xaca5('0x9d')],'as':_0xaca5('0xe6'),'required':![]},{'model':db[_0xaca5('0xe7')],'as':_0xaca5('0xe8'),'attributes':[_0xaca5('0x3a'),_0xaca5('0xe9'),'internal'],'required':![]},{'model':db[_0xaca5('0xea')],'as':_0xaca5('0xeb'),'attributes':['id','name',_0xaca5('0xec')],'where':_0x29ac16[_0xaca5('0x42')][_0xaca5('0xed')]?{'id':_0x29ac16[_0xaca5('0x42')][_0xaca5('0xed')]}:undefined,'required':_0x29ac16[_0xaca5('0x42')][_0xaca5('0xed')]?!![]:![]}];}return db[_0xaca5('0xb6')][_0xaca5('0x55')](_0x4a7b81);})[_0xaca5('0x21')](function(_0x23508f){_0x37409e['rows']=_0x23508f;return _0x37409e;});}})[_0xaca5('0x21')](respondWithFilteredResult(_0x48f88d,_0x4a7b81))[_0xaca5('0x2c')](handleError(_0x48f88d,null));};function iftimePromise(_0x17a048,_0x262a7a){return respondWithRpcPromise(_0xaca5('0xee'),_0xaca5('0xef'),{'command':_0x262a7a[_0xaca5('0xf0')]?util['format'](_0xaca5('0xf1'),_0x17a048[_0xaca5('0xf2')],_0x262a7a[_0xaca5('0xf0')]):util['format'](_0xaca5('0xf3'),_0x17a048[_0xaca5('0xf2')])},client9002)[_0xaca5('0x21')](function(_0x8ac2bc){var _0x57c122=_0x8ac2bc&&_0x8ac2bc[_0xaca5('0xf4')]('true')>=0x0?!![]:![];logger['info'](_0xaca5('0xf5'),_0x262a7a['id'],_0x17a048['id'],_0x17a048[_0xaca5('0xf2')],_0x57c122?_0xaca5('0xf6'):_0xaca5('0xf7'),_0x262a7a[_0xaca5('0xf0')]?_0x262a7a[_0xaca5('0xf0')]:_0xaca5('0xf8'));return _0x57c122;})[_0xaca5('0x2c')](function(_0xa46e80){logger[_0xaca5('0x27')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x262a7a['id'],_0x17a048['id'],_0x17a048[_0xaca5('0xf2')],util[_0xaca5('0xf9')](_0xa46e80,{'showHidden':![],'depth':null}),_0x262a7a['timezone']?_0x262a7a[_0xaca5('0xf0')]:_0xaca5('0xf8'));return![];});}exports['getSnippet']=function(_0x15ae8b,_0x511d0a,_0x14e262){var _0x4a0ae3=0x0;var _0x590c53=0x0;var _0x39161e=![];var _0x4b0bf9;var _0x3078f2;return db[_0xaca5('0x3d')]['find']({'where':{'id':_0x15ae8b[_0xaca5('0x57')]['id']},'include':[{'model':db[_0xaca5('0xfa')],'as':_0xaca5('0xfa'),'include':[{'model':db[_0xaca5('0xfa')],'as':_0xaca5('0xfb'),'attributes':['id',_0xaca5('0xf2')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x511d0a,null))[_0xaca5('0x21')](function(_0x3044a8){if(_0x3044a8){_0x4b0bf9=_0x3044a8;return _0x3044a8[_0xaca5('0xfc')]({'raw':!![]});}})[_0xaca5('0x21')](function(_0x15165f){if(_0x4b0bf9){if(_0x15165f){_0x3078f2=_0x15165f;}}return require(_0xaca5('0x7c'))[_0xaca5('0x7d')]();})[_0xaca5('0x21')](function(_0x2c82af){if(_0x2c82af){_0x590c53=_0x2c82af[_0xaca5('0xfd')];_0x39161e=_0x2c82af[_0xaca5('0xfe')];}})[_0xaca5('0x21')](function(){return db['ChatInteraction'][_0xaca5('0x52')]({'where':{'closed':![]}});})['then'](function(_0x48dfa9){_0x4a0ae3=_0x48dfa9;if(_0x590c53&&_0x48dfa9>_0x590c53){return db[_0xaca5('0xff')][_0xaca5('0x100')]({'where':{'id':0x1}})[_0xaca5('0x21')](function(_0x2dd64d){if(_0x2dd64d){_0x2dd64d[_0xaca5('0x101')](_0xaca5('0x102'));}});}})['then'](function(){if(_0x4b0bf9[_0xaca5('0xfa')]&&_0x4b0bf9['Interval']['Intervals']){var _0x3fd226=[];for(var _0xb7f762=0x0;_0xb7f762<_0x4b0bf9[_0xaca5('0xfa')][_0xaca5('0xfb')]['length'];_0xb7f762++){var _0x47d968=_0x4b0bf9[_0xaca5('0xfa')][_0xaca5('0xfb')][_0xb7f762]['get']({'plain':!![]});_0x3fd226[_0xaca5('0xbf')](iftimePromise(_0x47d968,_0x4b0bf9));}return BPromise[_0xaca5('0x103')](_0x3fd226)[_0xaca5('0x21')](function(_0x357cb2){return _[_0xaca5('0x104')](_0x357cb2);});}else{return!![];}})[_0xaca5('0x21')](function(_0x896efd){var _0x15cdf3=fs['readFileSync'](path[_0xaca5('0x79')](config[_0xaca5('0x7a')],'server/files/chat/iframe.js'),_0xaca5('0xd2'));var _0x37c0d4={'remote':_0x4b0bf9['remote'],'query':querystring[_0xaca5('0x26')](_[_0xaca5('0x4e')](_0x4b0bf9[_0xaca5('0xbc')]({'plain':!![]}),{'customerIp':_0x15ae8b[_0xaca5('0x8c')][_0xaca5('0xa9')]||_0x15ae8b['headers'][_0xaca5('0x105')]||_0x15ae8b['connection'][_0xaca5('0x106')]||_0x15ae8b['ip'],'referer':_0x15ae8b[_0xaca5('0x8c')]['referer'],'openedInteractions':_0x4a0ae3,'maxInteractions':_0x590c53,'virtual':_0x39161e['virtual'],'online':_0x896efd,'custom':_0x39161e}))[_0xaca5('0x107')](/'/g,'\x5c\x27')};_0x511d0a[_0xaca5('0xcc')](ejs[_0xaca5('0xd3')](Mustache[_0xaca5('0xd3')](_0x15cdf3,_0x37c0d4),{'proactiveActions':_0x3078f2,'alignment':_0x4b0bf9[_0xaca5('0x108')],'verticalAlignment':_0x4b0bf9[_0xaca5('0x109')]}));})[_0xaca5('0x2c')](handleError(_0x511d0a,null));};exports['addApplications']=function(_0x510123,_0x1d37e5,_0x50c41e){return db['ChatWebsite'][_0xaca5('0x100')]({'where':{'id':_0x510123[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x1d37e5,null))['then'](function(_0x29682e){if(_0x29682e){return db[_0xaca5('0x10a')][_0xaca5('0x10b')](function(_0x29941e){return db[_0xaca5('0xa0')]['destroy']({'where':{'ChatWebsiteId':_0x510123['params']['id']},'transaction':_0x29941e})[_0xaca5('0x21')](function(_0x1f16f1){var _0x2fa5d5=_['map'](_0x510123[_0xaca5('0x5b')],function(_0x1323f1){_0x1323f1['ChatWebsiteId']=_0x510123['params']['id'];return _0x1323f1;});return db[_0xaca5('0xa0')]['bulkCreate'](_0x2fa5d5,{'transaction':_0x29941e});});})['then'](function(){return db[_0xaca5('0xa0')][_0xaca5('0x10c')]({'where':{'ChatWebsiteId':_0x510123[_0xaca5('0x57')]['id']},'order':_0xaca5('0x10d')});});}})[_0xaca5('0x21')](respondWithResult(_0x1d37e5,null))[_0xaca5('0x2c')](handleError(_0x1d37e5,null));};exports['getApplications']=function(_0x28cf0f,_0x268ff6,_0x4d1c23){var _0x1bbccc={};var _0x44be2f={};var _0x47ccf6;var _0xbbd487;return db[_0xaca5('0x3d')]['findOne']({'where':{'id':_0x28cf0f[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x268ff6,null))[_0xaca5('0x21')](function(_0x5363b9){if(_0x5363b9){_0x47ccf6=_0x5363b9;_0x44be2f[_0xaca5('0x41')]=_['keys'](db[_0xaca5('0xa0')][_0xaca5('0x69')]);_0x44be2f[_0xaca5('0x42')]=_['keys'](_0x28cf0f[_0xaca5('0x42')]);_0x44be2f['filters']=_[_0xaca5('0x45')](_0x44be2f['model'],_0x44be2f[_0xaca5('0x42')]);_0x1bbccc[_0xaca5('0x47')]=_[_0xaca5('0x45')](_0x44be2f[_0xaca5('0x41')],qs[_0xaca5('0x46')](_0x28cf0f[_0xaca5('0x42')][_0xaca5('0x46')]));_0x1bbccc['attributes']=_0x1bbccc[_0xaca5('0x47')]['length']?_0x1bbccc[_0xaca5('0x47')]:_0x44be2f[_0xaca5('0x41')];_0x1bbccc[_0xaca5('0x6a')]=qs['sort'](_0x28cf0f['query'][_0xaca5('0x4b')]);_0x1bbccc[_0xaca5('0x4c')]=qs[_0xaca5('0x44')](_['pick'](_0x28cf0f[_0xaca5('0x42')],_0x44be2f[_0xaca5('0x44')]));if(_0x28cf0f[_0xaca5('0x42')][_0xaca5('0x4d')]){_0x1bbccc[_0xaca5('0x4c')]=_[_0xaca5('0x4e')](_0x1bbccc[_0xaca5('0x4c')],{'$or':_[_0xaca5('0x4f')](_0x1bbccc[_0xaca5('0x47')],function(_0x3ede15){var _0x58beac={};_0x58beac[_0x3ede15]={'$like':'%'+_0x28cf0f[_0xaca5('0x42')]['filter']+'%'};return _0x58beac;})});}_0x1bbccc=_[_0xaca5('0x4e')]({},_0x1bbccc,_0x28cf0f[_0xaca5('0x51')]);return _0x47ccf6[_0xaca5('0x10e')](_0x1bbccc);}})[_0xaca5('0x21')](function(_0x56d63c){if(_0x56d63c){_0xbbd487=_0x56d63c['length'];if(!_0x28cf0f['query'][_0xaca5('0x49')](_0xaca5('0x4a'))){_0x1bbccc[_0xaca5('0x31')]=qs[_0xaca5('0x31')](_0x28cf0f[_0xaca5('0x42')][_0xaca5('0x31')]);_0x1bbccc[_0xaca5('0x30')]=qs[_0xaca5('0x30')](_0x28cf0f[_0xaca5('0x42')][_0xaca5('0x30')]);}return _0x47ccf6[_0xaca5('0x10e')](_0x1bbccc);}})[_0xaca5('0x21')](function(_0x2f9efd){if(_0x2f9efd){return _0x2f9efd?{'count':_0xbbd487,'rows':_0x2f9efd}:null;}})[_0xaca5('0x21')](respondWithResult(_0x268ff6,null))[_0xaca5('0x2c')](handleError(_0x268ff6,null));};exports[_0xaca5('0x10f')]=function(_0x3e4089,_0x3391e6,_0x438d98){return db[_0xaca5('0x110')][_0xaca5('0x59')]({'where':{'id':_0x3e4089[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x3391e6,null))['then'](function(_0x5c3c9e){if(_0x5c3c9e){return _0x5c3c9e[_0xaca5('0x10f')](_0x3e4089[_0xaca5('0x5b')][_0xaca5('0x71')],_[_0xaca5('0xe4')](_0x3e4089[_0xaca5('0x5b')],['ids','id'])||{});}})['then'](respondWithResult(_0x3391e6,null))[_0xaca5('0x2c')](handleError(_0x3391e6,null));};exports['getProactiveActions']=function(_0x3306e6,_0x336183,_0x2812eb){var _0x5a2414={};var _0x4d7e01={};var _0x53e322;var _0x1ba5b3;return db[_0xaca5('0x3d')][_0xaca5('0x100')]({'where':{'id':_0x3306e6[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x336183,null))[_0xaca5('0x21')](function(_0x34d973){if(_0x34d973){_0x53e322=_0x34d973;_0x4d7e01['model']=_[_0xaca5('0x43')](db['ChatProactiveAction']['rawAttributes']);_0x4d7e01[_0xaca5('0x42')]=_[_0xaca5('0x43')](_0x3306e6[_0xaca5('0x42')]);_0x4d7e01[_0xaca5('0x44')]=_[_0xaca5('0x45')](_0x4d7e01['model'],_0x4d7e01['query']);_0x5a2414[_0xaca5('0x47')]=_[_0xaca5('0x45')](_0x4d7e01[_0xaca5('0x41')],qs[_0xaca5('0x46')](_0x3306e6[_0xaca5('0x42')][_0xaca5('0x46')]));_0x5a2414[_0xaca5('0x47')]=_0x5a2414['attributes'][_0xaca5('0x48')]?_0x5a2414[_0xaca5('0x47')]:_0x4d7e01[_0xaca5('0x41')];_0x5a2414[_0xaca5('0x6a')]=qs['sort'](_0x3306e6['query'][_0xaca5('0x4b')]);_0x5a2414[_0xaca5('0x4c')]=qs[_0xaca5('0x44')](_[_0xaca5('0x6b')](_0x3306e6['query'],_0x4d7e01[_0xaca5('0x44')]));if(_0x3306e6[_0xaca5('0x42')][_0xaca5('0x4d')]){_0x5a2414[_0xaca5('0x4c')]=_[_0xaca5('0x4e')](_0x5a2414[_0xaca5('0x4c')],{'$or':_[_0xaca5('0x4f')](_0x5a2414[_0xaca5('0x47')],function(_0x55e81a){var _0x290567={};_0x290567[_0x55e81a]={'$like':'%'+_0x3306e6['query']['filter']+'%'};return _0x290567;})});}_0x5a2414=_[_0xaca5('0x4e')]({},_0x5a2414,_0x3306e6[_0xaca5('0x51')]);return _0x53e322['getProactiveActions'](_0x5a2414);}})[_0xaca5('0x21')](function(_0x3e492e){if(_0x3e492e){_0x1ba5b3=_0x3e492e[_0xaca5('0x48')];if(!_0x3306e6[_0xaca5('0x42')]['hasOwnProperty']('nolimit')){_0x5a2414['limit']=qs[_0xaca5('0x31')](_0x3306e6['query'][_0xaca5('0x31')]);_0x5a2414[_0xaca5('0x30')]=qs[_0xaca5('0x30')](_0x3306e6[_0xaca5('0x42')][_0xaca5('0x30')]);}return _0x53e322[_0xaca5('0xfc')](_0x5a2414);}})[_0xaca5('0x21')](function(_0x5bfb9f){if(_0x5bfb9f){return _0x5bfb9f?{'count':_0x1ba5b3,'rows':_0x5bfb9f}:null;}})[_0xaca5('0x21')](respondWithResult(_0x336183,null))[_0xaca5('0x2c')](handleError(_0x336183,null));};exports[_0xaca5('0x111')]=function(_0x4e0005,_0x28b4ef,_0x19ed0f){var _0x39e000=_0x4e0005[_0xaca5('0x42')][_0xaca5('0x112')]===_0xaca5('0x113')?_0xaca5('0x114'):'onlineForm';return db[_0xaca5('0x3d')]['find']({'attributes':['id',_0x39e000],'where':{'id':_0x4e0005['params']['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x28b4ef,null))[_0xaca5('0x21')](function(_0x2426e3){if(_0x2426e3){var _0x237158=_0x2426e3[_0x39e000];var _0x265c7c=_0x237158&&_0x237158[_0xaca5('0x115')]?_0x237158['items']:[];_0x28b4ef[_0xaca5('0xcc')]({'fromKey':_[_0xaca5('0x7e')](_0x237158[_0xaca5('0x116')])?undefined:_0x237158['fromKey'],'count':_0x265c7c[_0xaca5('0x48')],'rows':_0x265c7c});}})[_0xaca5('0x2c')](handleError(_0x28b4ef,null));};exports[_0xaca5('0x117')]=function(_0x286166,_0x2d35ab,_0x5be28a){var _0xa14392={'raw':!![],'where':{}};var _0x1a81a4={};var _0x42d710={'count':0x0,'rows':[]};return db[_0xaca5('0x3d')][_0xaca5('0x100')]({'where':{'id':_0x286166['params']['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x2d35ab,null))[_0xaca5('0x21')](function(_0x1bc521){if(_0x1bc521){_0x1a81a4[_0xaca5('0x41')]=_[_0xaca5('0x43')](db[_0xaca5('0xd6')][_0xaca5('0x69')]);_0x1a81a4[_0xaca5('0x42')]=_[_0xaca5('0x43')](_0x286166[_0xaca5('0x42')]);_0x1a81a4[_0xaca5('0x44')]=_[_0xaca5('0x45')](_0x1a81a4[_0xaca5('0x41')],_0x1a81a4[_0xaca5('0x42')]);_0xa14392[_0xaca5('0x47')]=_[_0xaca5('0x45')](_0x1a81a4[_0xaca5('0x41')],qs[_0xaca5('0x46')](_0x286166['query'][_0xaca5('0x46')]));_0xa14392['attributes']=_0xa14392[_0xaca5('0x47')][_0xaca5('0x48')]?_0xa14392[_0xaca5('0x47')]:_0x1a81a4[_0xaca5('0x41')];if(!_0x286166[_0xaca5('0x42')]['hasOwnProperty']('nolimit')){_0xa14392[_0xaca5('0x31')]=qs[_0xaca5('0x31')](_0x286166[_0xaca5('0x42')][_0xaca5('0x31')]);_0xa14392[_0xaca5('0x30')]=qs[_0xaca5('0x30')](_0x286166[_0xaca5('0x42')]['offset']);}_0xa14392[_0xaca5('0x6a')]=qs['sort'](_0x286166[_0xaca5('0x42')]['sort']);_0xa14392[_0xaca5('0x4c')]=qs['filters'](_[_0xaca5('0x6b')](_0x286166[_0xaca5('0x42')],_0x1a81a4['filters']));_0xa14392['where']['ChatWebsiteId']=_0x1bc521['id'];if(_0x286166[_0xaca5('0x42')][_0xaca5('0x4d')]){_0xa14392[_0xaca5('0x4c')]=_['merge'](_0xa14392['where'],{'$or':_[_0xaca5('0x4f')](_0xa14392[_0xaca5('0x47')],function(_0x42b807){var _0x3997ce={};_0x3997ce[_0x42b807]={'$like':'%'+_0x286166[_0xaca5('0x42')][_0xaca5('0x4d')]+'%'};return _0x3997ce;})});}_0xa14392=_['merge']({},_0xa14392,_0x286166[_0xaca5('0x51')]);return db[_0xaca5('0xd6')][_0xaca5('0x52')]({'where':_0xa14392[_0xaca5('0x4c')]})[_0xaca5('0x21')](function(_0x548ff6){_0x42d710[_0xaca5('0x52')]=_0x548ff6;if(_0x286166['query'][_0xaca5('0x53')]){_0xa14392[_0xaca5('0x54')]=[{'all':!![]}];}return db[_0xaca5('0xd6')]['findAll'](_0xa14392);})[_0xaca5('0x21')](function(_0x349436){_0x42d710[_0xaca5('0x56')]=_0x349436;return _0x42d710;});}})[_0xaca5('0x21')](respondWithFilteredResult(_0x2d35ab,_0xa14392))[_0xaca5('0x2c')](handleError(_0x2d35ab,null));};exports[_0xaca5('0x118')]=function(_0x3e515d,_0x7a8f76,_0x6fd83c){return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0x3e515d[_0xaca5('0x57')]['id']}})[_0xaca5('0x21')](handleEntityNotFound(_0x7a8f76,null))[_0xaca5('0x21')](function(_0x27e5ec){if(_0x27e5ec){return _0x27e5ec[_0xaca5('0x118')](_0x3e515d['body']['ids'],_[_0xaca5('0xe4')](_0x3e515d['body'],[_0xaca5('0x71'),'id'])||{})['spread'](function(_0x2cd095){for(var _0x2d91e9=0x0;_0x2d91e9<_0x3e515d[_0xaca5('0x5b')]['ids'][_0xaca5('0x48')];_0x2d91e9+=0x1){socket[_0xaca5('0x119')]('userChatWebsite:save',{'UserId':_0x3e515d[_0xaca5('0x5b')][_0xaca5('0x71')][_0x2d91e9],'ChatWebsiteId':_0x3e515d[_0xaca5('0x57')]['id']});}return _0x2cd095;});}})[_0xaca5('0x21')](respondWithResult(_0x7a8f76,null))[_0xaca5('0x2c')](handleError(_0x7a8f76,null));};exports[_0xaca5('0x11a')]=function(_0x574e87,_0x3f8593,_0xe640d4){return db[_0xaca5('0x3d')][_0xaca5('0x59')]({'where':{'id':_0x574e87[_0xaca5('0x57')]['id']}})['then'](handleEntityNotFound(_0x3f8593,null))[_0xaca5('0x21')](function(_0x123b5e){if(_0x123b5e){return _0x123b5e[_0xaca5('0x11a')](_0x574e87['query'][_0xaca5('0x71')])['then'](function(){if(_[_0xaca5('0x11b')](_0x574e87[_0xaca5('0x42')][_0xaca5('0x71')])){for(var _0x50b840=0x0;_0x50b840<_0x574e87['query'][_0xaca5('0x71')][_0xaca5('0x48')];_0x50b840+=0x1){socket[_0xaca5('0x119')](_0xaca5('0x11c'),{'UserId':Number(_0x574e87[_0xaca5('0x42')]['ids'][_0x50b840]),'ChatWebsiteId':Number(_0x574e87[_0xaca5('0x57')]['id'])});}}else{socket[_0xaca5('0x119')](_0xaca5('0x11c'),{'UserId':Number(_0x574e87[_0xaca5('0x42')][_0xaca5('0x71')]),'ChatWebsiteId':Number(_0x574e87[_0xaca5('0x57')]['id'])});}});}})[_0xaca5('0x21')](respondWithStatusCode(_0x3f8593,null))[_0xaca5('0x2c')](handleError(_0x3f8593,null));};exports['getAgents']=function(_0x436788,_0x41119e,_0x4117c7){var _0x125260={};var _0x3837b2={};var _0x1900d7;var _0x267259;return db[_0xaca5('0x3d')]['findOne']({'where':{'id':_0x436788['params']['id']}})['then'](handleEntityNotFound(_0x41119e,null))[_0xaca5('0x21')](function(_0x53dc7a){if(_0x53dc7a){_0x1900d7=_0x53dc7a;_0x3837b2['model']=_[_0xaca5('0x43')](db['User'][_0xaca5('0x69')]);_0x3837b2[_0xaca5('0x42')]=_[_0xaca5('0x43')](_0x436788[_0xaca5('0x42')]);_0x3837b2['filters']=_[_0xaca5('0x45')](_0x3837b2[_0xaca5('0x41')],_0x3837b2[_0xaca5('0x42')]);_0x125260[_0xaca5('0x47')]=_[_0xaca5('0x45')](_0x3837b2[_0xaca5('0x41')],qs[_0xaca5('0x46')](_0x436788[_0xaca5('0x42')]['fields']));_0x125260[_0xaca5('0x47')]=_0x125260[_0xaca5('0x47')][_0xaca5('0x48')]?_0x125260[_0xaca5('0x47')]:_0x3837b2[_0xaca5('0x41')];_0x125260[_0xaca5('0x6a')]=qs[_0xaca5('0x4b')](_0x436788['query']['sort']);_0x125260[_0xaca5('0x4c')]=qs[_0xaca5('0x44')](_[_0xaca5('0x6b')](_0x436788[_0xaca5('0x42')],_0x3837b2[_0xaca5('0x44')]));if(_0x436788[_0xaca5('0x42')][_0xaca5('0x4d')]){_0x125260[_0xaca5('0x4c')]=_['merge'](_0x125260['where'],{'$or':_[_0xaca5('0x4f')](_0x125260['attributes'],function(_0x530582){var _0x36d5b6={};_0x36d5b6[_0x530582]={'$like':'%'+_0x436788[_0xaca5('0x42')][_0xaca5('0x4d')]+'%'};return _0x36d5b6;})});}_0x125260=_['merge']({},_0x125260,_0x436788[_0xaca5('0x51')]);return _0x1900d7[_0xaca5('0x11d')](_0x125260);}})[_0xaca5('0x21')](function(_0x5f0b2d){if(_0x5f0b2d){_0x267259=_0x5f0b2d['length'];if(!_0x436788['query'][_0xaca5('0x49')](_0xaca5('0x4a'))){_0x125260['limit']=qs[_0xaca5('0x31')](_0x436788[_0xaca5('0x42')]['limit']);_0x125260[_0xaca5('0x30')]=qs[_0xaca5('0x30')](_0x436788['query'][_0xaca5('0x30')]);}return _0x1900d7[_0xaca5('0x11d')](_0x125260);}})['then'](function(_0x159216){if(_0x159216){return _0x159216?{'count':_0x267259,'rows':_0x159216}:null;}})[_0xaca5('0x21')](respondWithResult(_0x41119e,null))[_0xaca5('0x2c')](handleError(_0x41119e,null));}; \ No newline at end of file +var _0x1b20=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','sitepic','file','filename','systemAvatar','getLogo','join','../../config/license/util','custom','isNil','existsSync','root','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','server/files/images/avatars/','getCustomerAvatar','server/files/images/avatars/customer_avatar.png','customerAvatar','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent','chat','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','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','account','applications','Applications','list','priority','customerIp','headers','cf-connecting-ip','x-forwarded-for','first','split','firstName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','ChatInteraction','interaction','contact','lastName','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','UserId','User','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','no\x20available\x20attributes','send','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','service','host','port','authentication','auth','pass','SendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','Contact','fullname','Tags','color','tag','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','inspect','No\x20timezone','Interval','virtual','chatLicenseExceeded','Intervals','all','some','server/files/chat/iframe.js','remote','remoteAddress','replace','render','alignment','addApplications','transaction','bulkCreate','getApplications','chatProactiveAction','getProactiveActions','ChatProactiveAction','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','emit','userChatWebsite:save','removeAgents','userChatWebsite:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatWebsite.socket','jayson/promise','http','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','ChatWebsite,\x20%s,\x20%s','catch','sendStatus','end','json','count','offset','limit','status','set','apply','save','update','ChatWebsites','destroy','stack','name','index','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','find','create','body'];(function(_0x2e31a3,_0x3cbb19){var _0x27311a=function(_0x590ce9){while(--_0x590ce9){_0x2e31a3['push'](_0x2e31a3['shift']());}};_0x27311a(++_0x3cbb19);}(_0x1b20,0x1c8));var _0x01b2=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x1b20[_0x59ee6f];return _0x4c0979;};'use strict';var pdf=require(_0x01b2('0x0'));var emlformat=require(_0x01b2('0x1'));var rimraf=require(_0x01b2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x01b2('0x3'));var moment=require(_0x01b2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x01b2('0x5'));var path=require(_0x01b2('0x6'));var sox=require(_0x01b2('0x7'));var csv=require(_0x01b2('0x8'));var ejs=require(_0x01b2('0x9'));var fs=require('fs');var _=require(_0x01b2('0xa'));var squel=require(_0x01b2('0xb'));var crypto=require(_0x01b2('0xc'));var jsforce=require(_0x01b2('0xd'));var deskjs=require(_0x01b2('0xe'));var toCsv=require(_0x01b2('0x8'));var querystring=require(_0x01b2('0xf'));var Papa=require(_0x01b2('0x10'));var Redis=require(_0x01b2('0x11'));var authService=require(_0x01b2('0x12'));var qs=require(_0x01b2('0x13'));var as=require(_0x01b2('0x14'));var hardwareService=require(_0x01b2('0x15'));var logger=require('../../config/logger')(_0x01b2('0x16'));var utils=require(_0x01b2('0x17'));var config=require(_0x01b2('0x18'));var db=require(_0x01b2('0x19'))['db'];config[_0x01b2('0x1a')]=_[_0x01b2('0x1b')](config[_0x01b2('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x01b2('0x1c'))['register'](socket);var jayson=require(_0x01b2('0x1d'));var client=jayson['client'][_0x01b2('0x1e')]({'port':0x232c});var client9002=jayson[_0x01b2('0x1f')][_0x01b2('0x1e')]({'port':0x232a});var client9003=jayson[_0x01b2('0x1f')][_0x01b2('0x1e')]({'port':0x232b});function checkPasswordPattern(_0x68f513,_0x549f39,_0x20b09b){if(_0x20b09b){var _0x33580c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33580c[_0x01b2('0x20')](_0x549f39)){return _0x68f513;}else{throw new db['Sequelize'][(_0x01b2('0x21'))](_0x01b2('0x22'));}}else{return _0x68f513;}}function respondWithRpcPromise(_0x33a1c9,_0x37624a,_0x4b8c44,_0x2330ef){return new BPromise(function(_0x5f5830,_0x274452){var _0x578c9c=_0x2330ef||client;return _0x578c9c[_0x01b2('0x23')](_0x33a1c9,_0x4b8c44)[_0x01b2('0x24')](function(_0x5d73ea){logger[_0x01b2('0x25')]('ChatWebsite,\x20%s,\x20%s',_0x37624a,'request\x20sent');logger[_0x01b2('0x26')](_0x01b2('0x27'),_0x37624a,_0x01b2('0x28'),JSON[_0x01b2('0x29')](_0x5d73ea));if(_0x5d73ea[_0x01b2('0x2a')]){if(_0x5d73ea[_0x01b2('0x2a')][_0x01b2('0x2b')]===0x1f4){logger[_0x01b2('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x37624a,_0x5d73ea['error'][_0x01b2('0x2c')]);return _0x274452(_0x5d73ea[_0x01b2('0x2a')][_0x01b2('0x2c')]);}logger[_0x01b2('0x2a')]('ChatWebsite,\x20%s,\x20%s',_0x37624a,_0x5d73ea[_0x01b2('0x2a')][_0x01b2('0x2c')]);return _0x5f5830(_0x5d73ea['error'][_0x01b2('0x2c')]);}else{logger[_0x01b2('0x25')](_0x01b2('0x2d'),_0x37624a,_0x01b2('0x28'));_0x5f5830(_0x5d73ea['result'][_0x01b2('0x2c')]);}})[_0x01b2('0x2e')](function(_0x2387cf){logger[_0x01b2('0x2a')](_0x01b2('0x2d'),_0x37624a,_0x2387cf);_0x274452(_0x2387cf);});});}function respondWithStatusCode(_0xd18f62,_0xd2dd9e){_0xd2dd9e=_0xd2dd9e||0xcc;return function(_0xa0a9a4){if(_0xa0a9a4){return _0xd18f62[_0x01b2('0x2f')](_0xd2dd9e);}return _0xd18f62['status'](_0xd2dd9e)[_0x01b2('0x30')]();};}function respondWithResult(_0x37f157,_0x408251){_0x408251=_0x408251||0xc8;return function(_0x50f0df){if(_0x50f0df){return _0x37f157['status'](_0x408251)[_0x01b2('0x31')](_0x50f0df);}};}function respondWithFilteredResult(_0x181110,_0x5de121){return function(_0x164008){if(_0x164008){var _0x4197c4=_0x164008[_0x01b2('0x32')],_0x18e4b1=_0x5de121['offset'],_0x354db7=_0x5de121[_0x01b2('0x33')]+_0x5de121[_0x01b2('0x34')],_0xb2b393;if(_0x354db7>=_0x4197c4){_0x354db7=_0x4197c4;_0xb2b393=0xc8;}else{_0xb2b393=0xce;}_0x181110[_0x01b2('0x35')](_0xb2b393);return _0x181110[_0x01b2('0x36')]('Content-Range',_0x18e4b1+'-'+_0x354db7+'/'+_0x4197c4)[_0x01b2('0x31')](_0x164008);}return null;};}function patchUpdates(_0x245141){return function(_0x3599f2){try{jsonpatch[_0x01b2('0x37')](_0x3599f2,_0x245141,!![]);}catch(_0xc01185){return BPromise['reject'](_0xc01185);}return _0x3599f2[_0x01b2('0x38')]();};}function saveUpdates(_0x31b43c,_0x27ae9f){return function(_0x4d7fa8){if(_0x4d7fa8){return _0x4d7fa8[_0x01b2('0x39')](_0x31b43c)['then'](function(_0x471826){return _0x471826;});}return null;};}function removeEntity(_0x1237d3,_0x50bb4d){return function(_0x32eb0c){if(_0x32eb0c){return _0x32eb0c['destroy']()[_0x01b2('0x24')](function(){var _0x16b028=_0x32eb0c['get']({'plain':!![]});var _0x3d08a8=_0x01b2('0x3a');return db['UserProfileResource'][_0x01b2('0x3b')]({'where':{'type':_0x3d08a8,'resourceId':_0x16b028['id']}})[_0x01b2('0x24')](function(){return _0x32eb0c;});})[_0x01b2('0x24')](function(){_0x1237d3[_0x01b2('0x35')](0xcc)[_0x01b2('0x30')]();});}};}function handleEntityNotFound(_0x2d6290,_0x27b6d5){return function(_0x3c9328){if(!_0x3c9328){_0x2d6290[_0x01b2('0x2f')](0x194);}return _0x3c9328;};}function handleError(_0x13219b,_0x4a8738){_0x4a8738=_0x4a8738||0x1f4;return function(_0x53a82b){logger[_0x01b2('0x2a')](_0x53a82b[_0x01b2('0x3c')]);if(_0x53a82b[_0x01b2('0x3d')]){delete _0x53a82b[_0x01b2('0x3d')];}_0x13219b[_0x01b2('0x35')](_0x4a8738)['send'](_0x53a82b);};}exports[_0x01b2('0x3e')]=function(_0x35300f,_0x354c2f){var _0x3eb63a={'include':[{'model':db[_0x01b2('0x3f')],'as':_0x01b2('0x40')}]},_0x272ead={},_0x54a2cd={'count':0x0,'rows':[]};var _0xa9a02e=_[_0x01b2('0x41')](db[_0x01b2('0x42')][_0x01b2('0x43')],function(_0x361e6c){return{'name':_0x361e6c['fieldName'],'type':_0x361e6c[_0x01b2('0x44')][_0x01b2('0x45')]};});_0x272ead['model']=_[_0x01b2('0x41')](_0xa9a02e,_0x01b2('0x3d'));_0x272ead[_0x01b2('0x46')]=_[_0x01b2('0x47')](_0x35300f[_0x01b2('0x46')]);_0x272ead[_0x01b2('0x48')]=_['intersection'](_0x272ead[_0x01b2('0x49')],_0x272ead[_0x01b2('0x46')]);_0x3eb63a[_0x01b2('0x4a')]=_[_0x01b2('0x4b')](_0x272ead[_0x01b2('0x49')],qs[_0x01b2('0x4c')](_0x35300f[_0x01b2('0x46')]['fields']));_0x3eb63a['attributes']=_0x3eb63a[_0x01b2('0x4a')][_0x01b2('0x4d')]?_0x3eb63a['attributes']:_0x272ead['model'];if(!_0x35300f[_0x01b2('0x46')][_0x01b2('0x4e')](_0x01b2('0x4f'))){_0x3eb63a[_0x01b2('0x34')]=qs[_0x01b2('0x34')](_0x35300f['query']['limit']);_0x3eb63a[_0x01b2('0x33')]=qs['offset'](_0x35300f['query'][_0x01b2('0x33')]);}_0x3eb63a[_0x01b2('0x50')]=qs[_0x01b2('0x51')](_0x35300f[_0x01b2('0x46')]['sort']);_0x3eb63a[_0x01b2('0x52')]=qs[_0x01b2('0x48')](_[_0x01b2('0x53')](_0x35300f[_0x01b2('0x46')],_0x272ead[_0x01b2('0x48')]));if(_0x35300f[_0x01b2('0x46')][_0x01b2('0x54')]){_0x3eb63a[_0x01b2('0x52')]=_[_0x01b2('0x55')](_0x3eb63a['where'],{'$or':_['map'](_0xa9a02e,function(_0x527009){if(_0x527009[_0x01b2('0x44')]!==_0x01b2('0x56')){var _0x1f3b1a={};_0x1f3b1a[_0x527009[_0x01b2('0x3d')]]={'$like':'%'+_0x35300f[_0x01b2('0x46')]['filter']+'%'};return _0x1f3b1a;}})});}_0x3eb63a=_[_0x01b2('0x55')]({},_0x3eb63a,_0x35300f[_0x01b2('0x57')]);var _0x30c23c={'where':_0x3eb63a['where']};return db[_0x01b2('0x42')]['count'](_0x30c23c)[_0x01b2('0x24')](function(_0x19910c){_0x54a2cd[_0x01b2('0x32')]=_0x19910c;if(_0x35300f[_0x01b2('0x46')][_0x01b2('0x58')]){_0x3eb63a[_0x01b2('0x59')]=[{'all':!![]}];}return db['ChatWebsite'][_0x01b2('0x5a')](_0x3eb63a);})[_0x01b2('0x24')](function(_0x530a81){_0x54a2cd[_0x01b2('0x5b')]=_0x530a81;return _0x54a2cd;})[_0x01b2('0x24')](respondWithFilteredResult(_0x354c2f,_0x3eb63a))['catch'](handleError(_0x354c2f,null));};exports[_0x01b2('0x5c')]=function(_0x5f564d,_0x55ec2b){var _0x32f4b5={'raw':![],'where':{'id':_0x5f564d['params']['id']},'include':[{'model':db[_0x01b2('0x3f')],'as':'mandatoryDispositionPause'}]},_0x1424e0={};_0x1424e0[_0x01b2('0x49')]=_[_0x01b2('0x47')](db[_0x01b2('0x42')][_0x01b2('0x43')]);_0x1424e0[_0x01b2('0x46')]=_['keys'](_0x5f564d[_0x01b2('0x46')]);_0x1424e0[_0x01b2('0x48')]=_[_0x01b2('0x4b')](_0x1424e0[_0x01b2('0x49')],_0x1424e0[_0x01b2('0x46')]);_0x32f4b5[_0x01b2('0x4a')]=_[_0x01b2('0x4b')](_0x1424e0['model'],qs[_0x01b2('0x4c')](_0x5f564d[_0x01b2('0x46')]['fields']));_0x32f4b5[_0x01b2('0x4a')]=_0x32f4b5[_0x01b2('0x4a')]['length']?_0x32f4b5[_0x01b2('0x4a')]:_0x1424e0[_0x01b2('0x49')];if(_0x5f564d['query'][_0x01b2('0x58')]){_0x32f4b5[_0x01b2('0x59')]=[{'all':!![]}];}_0x32f4b5=_[_0x01b2('0x55')]({},_0x32f4b5,_0x5f564d[_0x01b2('0x57')]);return db['ChatWebsite'][_0x01b2('0x5d')](_0x32f4b5)[_0x01b2('0x24')](handleEntityNotFound(_0x55ec2b,null))[_0x01b2('0x24')](respondWithResult(_0x55ec2b,null))[_0x01b2('0x2e')](handleError(_0x55ec2b,null));};exports['create']=function(_0x20edfc,_0x18ee69){return db[_0x01b2('0x42')][_0x01b2('0x5e')](_0x20edfc[_0x01b2('0x5f')],{})[_0x01b2('0x24')](function(_0x5368ef){var _0x161e96=_0x20edfc[_0x01b2('0x60')]['get']({'plain':!![]});if(!_0x161e96)throw new Error(_0x01b2('0x61'));if(_0x161e96[_0x01b2('0x62')]===_0x01b2('0x60')){var _0x17d9b7=_0x5368ef[_0x01b2('0x63')]({'plain':!![]});var _0x2a2eb=_0x01b2('0x3a');return db['UserProfileSection']['find']({'where':{'name':_0x2a2eb,'userProfileId':_0x161e96['userProfileId']},'raw':!![]})[_0x01b2('0x24')](function(_0x582c50){if(_0x582c50&&_0x582c50[_0x01b2('0x64')]===0x0){return db['UserProfileResource']['create']({'name':_0x17d9b7[_0x01b2('0x3d')],'resourceId':_0x17d9b7['id'],'type':_0x582c50[_0x01b2('0x3d')],'sectionId':_0x582c50['id']},{})[_0x01b2('0x24')](function(){return _0x5368ef;});}else{return _0x5368ef;}})['catch'](function(_0x4f6aba){logger[_0x01b2('0x2a')](_0x01b2('0x65'),_0x4f6aba);throw _0x4f6aba;});}return _0x5368ef;})['then'](respondWithResult(_0x18ee69,0xc9))['catch'](handleError(_0x18ee69,null));};exports[_0x01b2('0x39')]=function(_0x48f573,_0x3e25dc){if(_0x48f573[_0x01b2('0x5f')]['id']){delete _0x48f573[_0x01b2('0x5f')]['id'];}return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x48f573[_0x01b2('0x66')]['id']},'include':[{'model':db[_0x01b2('0x3f')],'as':_0x01b2('0x40')}]})[_0x01b2('0x24')](handleEntityNotFound(_0x3e25dc,null))['then'](saveUpdates(_0x48f573[_0x01b2('0x5f')],null))['then'](respondWithResult(_0x3e25dc,null))[_0x01b2('0x2e')](handleError(_0x3e25dc,null));};exports[_0x01b2('0x3b')]=function(_0x288990,_0x429488){return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x288990[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x429488,null))[_0x01b2('0x24')](removeEntity(_0x429488,null))[_0x01b2('0x2e')](handleError(_0x429488,null));};exports[_0x01b2('0x67')]=function(_0x45fc44,_0x5554d7){return db[_0x01b2('0x42')][_0x01b2('0x67')]()[_0x01b2('0x24')](respondWithResult(_0x5554d7,null))['catch'](handleError(_0x5554d7,null));};exports[_0x01b2('0x68')]=function(_0xaec584,_0x3019de,_0x3de5d5){if(_0xaec584[_0x01b2('0x5f')]['id']){delete _0xaec584[_0x01b2('0x5f')]['id'];}return db['ChatWebsite']['find']({'where':{'id':_0xaec584[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x3019de,null))[_0x01b2('0x24')](function(_0x1c1515){if(_0x1c1515){_0xaec584[_0x01b2('0x5f')][_0x01b2('0x69')]=_0x1c1515['id'];return db['Disposition'][_0x01b2('0x5e')](_0xaec584[_0x01b2('0x5f')]);}})[_0x01b2('0x24')](respondWithResult(_0x3019de,null))[_0x01b2('0x2e')](handleError(_0x3019de,null));};exports[_0x01b2('0x6a')]=function(_0xae61d4,_0xee3250,_0x105850){var _0x19d048={'raw':![],'where':{}};var _0x2ec11a={};var _0xa84143={'count':0x0,'rows':[]};return db[_0x01b2('0x42')][_0x01b2('0x6b')]({'where':{'id':_0xae61d4['params']['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0xee3250,null))[_0x01b2('0x24')](function(_0x338679){if(_0x338679){_0x2ec11a[_0x01b2('0x49')]=_[_0x01b2('0x47')](db['Disposition'][_0x01b2('0x43')]);_0x2ec11a[_0x01b2('0x46')]=_[_0x01b2('0x47')](_0xae61d4[_0x01b2('0x46')]);_0x2ec11a[_0x01b2('0x48')]=_[_0x01b2('0x4b')](_0x2ec11a['model'],_0x2ec11a[_0x01b2('0x46')]);_0x19d048[_0x01b2('0x4a')]=_[_0x01b2('0x4b')](_0x2ec11a[_0x01b2('0x49')],qs[_0x01b2('0x4c')](_0xae61d4[_0x01b2('0x46')][_0x01b2('0x4c')]));_0x19d048['attributes']=_0x19d048[_0x01b2('0x4a')][_0x01b2('0x4d')]?_0x19d048[_0x01b2('0x4a')]:_0x2ec11a['model'];if(!_0xae61d4[_0x01b2('0x46')][_0x01b2('0x4e')](_0x01b2('0x4f'))){_0x19d048[_0x01b2('0x34')]=qs[_0x01b2('0x34')](_0xae61d4[_0x01b2('0x46')]['limit']);_0x19d048['offset']=qs[_0x01b2('0x33')](_0xae61d4[_0x01b2('0x46')][_0x01b2('0x33')]);}_0x19d048[_0x01b2('0x50')]=qs['sort'](_0xae61d4['query'][_0x01b2('0x51')]);_0x19d048['where']=qs[_0x01b2('0x48')](_[_0x01b2('0x53')](_0xae61d4[_0x01b2('0x46')],_0x2ec11a[_0x01b2('0x48')]));_0x19d048[_0x01b2('0x52')]['ChatWebsiteId']=_0x338679['id'];if(_0xae61d4[_0x01b2('0x46')][_0x01b2('0x54')]){_0x19d048[_0x01b2('0x52')]=_['merge'](_0x19d048[_0x01b2('0x52')],{'$or':_['map'](_0x19d048[_0x01b2('0x4a')],function(_0x44f905){var _0x3883f7={};_0x3883f7[_0x44f905]={'$like':'%'+_0xae61d4[_0x01b2('0x46')][_0x01b2('0x54')]+'%'};return _0x3883f7;})});}_0x19d048=_[_0x01b2('0x55')]({},_0x19d048,_0xae61d4[_0x01b2('0x57')]);return db[_0x01b2('0x6c')][_0x01b2('0x32')]({'where':_0x19d048[_0x01b2('0x52')]})[_0x01b2('0x24')](function(_0xf263c){_0xa84143[_0x01b2('0x32')]=_0xf263c;if(_0xae61d4[_0x01b2('0x46')]['includeAll']){_0x19d048[_0x01b2('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x01b2('0x5a')](_0x19d048);})[_0x01b2('0x24')](function(_0x2f1ad2){_0xa84143[_0x01b2('0x5b')]=_0x2f1ad2;return _0xa84143;});}})[_0x01b2('0x24')](respondWithFilteredResult(_0xee3250,_0x19d048))['catch'](handleError(_0xee3250,null));};exports[_0x01b2('0x6d')]=function(_0x227894,_0x2bd207,_0x235135){return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x227894[_0x01b2('0x66')]['id']}})['then'](handleEntityNotFound(_0x2bd207,null))['then'](function(_0x1858d0){if(_0x1858d0){return _0x1858d0[_0x01b2('0x6d')](_0x227894[_0x01b2('0x46')][_0x01b2('0x6e')]);}})[_0x01b2('0x24')](respondWithStatusCode(_0x2bd207,null))[_0x01b2('0x2e')](handleError(_0x2bd207,null));};exports[_0x01b2('0x6f')]=function(_0x1405c9,_0xe6674d,_0x3eb3ce){if(_0x1405c9['body']['id']){delete _0x1405c9['body']['id'];}return db['ChatWebsite'][_0x01b2('0x5d')]({'where':{'id':_0x1405c9[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0xe6674d,null))[_0x01b2('0x24')](function(_0x4ab563){if(_0x4ab563){_0x1405c9['body'][_0x01b2('0x69')]=_0x4ab563['id'];return db[_0x01b2('0x70')][_0x01b2('0x5e')](_0x1405c9[_0x01b2('0x5f')]);}})[_0x01b2('0x24')](respondWithResult(_0xe6674d,null))['catch'](handleError(_0xe6674d,null));};exports[_0x01b2('0x71')]=function(_0x248861,_0x31025d,_0x467e8f){var _0x3b5ae4={'raw':![],'where':{}};var _0x5f02b3={};var _0x20edb6={'count':0x0,'rows':[]};return db[_0x01b2('0x42')][_0x01b2('0x6b')]({'where':{'id':_0x248861[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x31025d,null))[_0x01b2('0x24')](function(_0x3ec707){if(_0x3ec707){_0x5f02b3['model']=_[_0x01b2('0x47')](db['CannedAnswer'][_0x01b2('0x43')]);_0x5f02b3[_0x01b2('0x46')]=_['keys'](_0x248861[_0x01b2('0x46')]);_0x5f02b3[_0x01b2('0x48')]=_[_0x01b2('0x4b')](_0x5f02b3[_0x01b2('0x49')],_0x5f02b3[_0x01b2('0x46')]);_0x3b5ae4[_0x01b2('0x4a')]=_[_0x01b2('0x4b')](_0x5f02b3[_0x01b2('0x49')],qs['fields'](_0x248861[_0x01b2('0x46')][_0x01b2('0x4c')]));_0x3b5ae4[_0x01b2('0x4a')]=_0x3b5ae4['attributes'][_0x01b2('0x4d')]?_0x3b5ae4[_0x01b2('0x4a')]:_0x5f02b3[_0x01b2('0x49')];if(!_0x248861['query'][_0x01b2('0x4e')](_0x01b2('0x4f'))){_0x3b5ae4[_0x01b2('0x34')]=qs['limit'](_0x248861[_0x01b2('0x46')][_0x01b2('0x34')]);_0x3b5ae4['offset']=qs['offset'](_0x248861[_0x01b2('0x46')][_0x01b2('0x33')]);}_0x3b5ae4[_0x01b2('0x50')]=qs['sort'](_0x248861['query'][_0x01b2('0x51')]);_0x3b5ae4[_0x01b2('0x52')]=qs['filters'](_['pick'](_0x248861[_0x01b2('0x46')],_0x5f02b3[_0x01b2('0x48')]));_0x3b5ae4['where'][_0x01b2('0x69')]=_0x3ec707['id'];if(_0x248861[_0x01b2('0x46')]['filter']){_0x3b5ae4[_0x01b2('0x52')]=_['merge'](_0x3b5ae4[_0x01b2('0x52')],{'$or':_[_0x01b2('0x41')](_0x3b5ae4[_0x01b2('0x4a')],function(_0x561c8a){var _0x36fe06={};_0x36fe06[_0x561c8a]={'$like':'%'+_0x248861[_0x01b2('0x46')][_0x01b2('0x54')]+'%'};return _0x36fe06;})});}_0x3b5ae4=_[_0x01b2('0x55')]({},_0x3b5ae4,_0x248861[_0x01b2('0x57')]);return db[_0x01b2('0x70')]['count']({'where':_0x3b5ae4[_0x01b2('0x52')]})[_0x01b2('0x24')](function(_0x5e0e2e){_0x20edb6[_0x01b2('0x32')]=_0x5e0e2e;if(_0x248861[_0x01b2('0x46')][_0x01b2('0x58')]){_0x3b5ae4[_0x01b2('0x59')]=[{'all':!![]}];}return db[_0x01b2('0x70')]['findAll'](_0x3b5ae4);})['then'](function(_0x1bc25f){_0x20edb6[_0x01b2('0x5b')]=_0x1bc25f;return _0x20edb6;});}})[_0x01b2('0x24')](respondWithFilteredResult(_0x31025d,_0x3b5ae4))['catch'](handleError(_0x31025d,null));};exports[_0x01b2('0x72')]=function(_0x29ace4,_0x19ae0f,_0xca3a4e){return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x29ace4[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x19ae0f,null))[_0x01b2('0x24')](function(_0x3f90cd){if(_0x3f90cd){return _0x3f90cd[_0x01b2('0x72')](_0x29ace4['query']['ids']);}})['then'](respondWithStatusCode(_0x19ae0f,null))[_0x01b2('0x2e')](handleError(_0x19ae0f,null));};exports['addLogo']=function(_0x4faad5,_0x405b6f,_0x584f0c){_0x4faad5[_0x01b2('0x5f')][_0x01b2('0x73')]=_0x4faad5[_0x01b2('0x74')]['filename'];return db[_0x01b2('0x42')]['find']({'where':{'id':_0x4faad5[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x405b6f,null))[_0x01b2('0x24')](saveUpdates(_0x4faad5[_0x01b2('0x5f')],null))['then'](respondWithResult(_0x405b6f,null))[_0x01b2('0x2e')](handleError(_0x405b6f,null));};exports['addAvatar']=function(_0x545d3b,_0x110c85,_0x287927){_0x545d3b[_0x01b2('0x5f')]['agentAvatar']=_0x545d3b[_0x01b2('0x74')]['filename'];return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x545d3b[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x110c85,null))[_0x01b2('0x24')](saveUpdates(_0x545d3b[_0x01b2('0x5f')],null))[_0x01b2('0x24')](respondWithResult(_0x110c85,null))[_0x01b2('0x2e')](handleError(_0x110c85,null));};exports['addCustomerAvatar']=function(_0x5afb5a,_0x56bf5d,_0x39f0fd){_0x5afb5a[_0x01b2('0x5f')]['customerAvatar']=_0x5afb5a[_0x01b2('0x74')][_0x01b2('0x75')];return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x5afb5a['params']['id']}})['then'](handleEntityNotFound(_0x56bf5d,null))['then'](saveUpdates(_0x5afb5a['body'],null))[_0x01b2('0x24')](respondWithResult(_0x56bf5d,null))['catch'](handleError(_0x56bf5d,null));};exports['addSystemAvatar']=function(_0x12ed31,_0x5de94c,_0x480fe7){_0x12ed31[_0x01b2('0x5f')][_0x01b2('0x76')]=_0x12ed31[_0x01b2('0x74')][_0x01b2('0x75')];return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x12ed31['params']['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x5de94c,null))[_0x01b2('0x24')](saveUpdates(_0x12ed31[_0x01b2('0x5f')],null))[_0x01b2('0x24')](respondWithResult(_0x5de94c,null))[_0x01b2('0x2e')](handleError(_0x5de94c,null));};exports[_0x01b2('0x77')]=function(_0x48cb3b,_0x2a552c,_0x378c99){var _0x15cd45=path[_0x01b2('0x78')](config['root'],'server/files/images/logos/default_logo.png');var _0x563819={'where':{'id':_0x48cb3b['params']['id']},'attributes':['id',_0x01b2('0x73')],'raw':!![]};var _0xe6ff0=![];return require(_0x01b2('0x79'))['getLicense']()[_0x01b2('0x24')](function(_0x6ad2b){if(_0x6ad2b){_0xe6ff0=_0x6ad2b[_0x01b2('0x7a')];}})['then'](function(){return db[_0x01b2('0x42')][_0x01b2('0x5d')](_0x563819);})[_0x01b2('0x24')](handleEntityNotFound(_0x2a552c,null))[_0x01b2('0x24')](function(_0x5b4f35){if(_0x5b4f35){if(!_[_0x01b2('0x7b')](_0x5b4f35[_0x01b2('0x73')])){if(fs[_0x01b2('0x7c')](path[_0x01b2('0x78')](config[_0x01b2('0x7d')],'server/files/images/logos/',_0x5b4f35[_0x01b2('0x73')]))&&_0xe6ff0){_0x15cd45=path[_0x01b2('0x78')](config[_0x01b2('0x7d')],_0x01b2('0x7e'),_0x5b4f35['sitepic']);}}return _0x2a552c[_0x01b2('0x7f')](_0x15cd45);}})['catch'](handleError(_0x2a552c,null));};exports[_0x01b2('0x80')]=function(_0x571f4f,_0x351dff,_0x171672){var _0x3fe924=path[_0x01b2('0x78')](config[_0x01b2('0x7d')],_0x01b2('0x81'));var _0x220b98={'where':{'id':_0x571f4f[_0x01b2('0x66')]['id']},'attributes':['id',_0x01b2('0x82')],'raw':!![]};return db[_0x01b2('0x42')][_0x01b2('0x5d')](_0x220b98)[_0x01b2('0x24')](handleEntityNotFound(_0x351dff,null))['then'](function(_0x4e4a3f){if(_0x4e4a3f){if(!_[_0x01b2('0x7b')](_0x4e4a3f[_0x01b2('0x82')])){if(fs['existsSync'](path[_0x01b2('0x78')](config['root'],_0x01b2('0x83'),_0x4e4a3f[_0x01b2('0x82')]))){_0x3fe924=path[_0x01b2('0x78')](config[_0x01b2('0x7d')],_0x01b2('0x83'),_0x4e4a3f[_0x01b2('0x82')]);}}return _0x351dff['download'](_0x3fe924);}})[_0x01b2('0x2e')](handleError(_0x351dff,null));};exports[_0x01b2('0x84')]=function(_0x58b281,_0x232cd4,_0x20b3c4){var _0x317b6f=path[_0x01b2('0x78')](config['root'],_0x01b2('0x85'));var _0x5afb7d={'where':{'id':_0x58b281[_0x01b2('0x66')]['id']},'attributes':['id',_0x01b2('0x86'),_0x01b2('0x87')],'raw':!![]};return db[_0x01b2('0x42')]['find'](_0x5afb7d)[_0x01b2('0x24')](handleEntityNotFound(_0x232cd4,null))[_0x01b2('0x24')](function(_0x1accb2){if(_0x1accb2){if(!_['isNil'](_0x1accb2[_0x01b2('0x86')])){if(fs[_0x01b2('0x7c')](path['join'](config[_0x01b2('0x7d')],_0x01b2('0x83'),_0x1accb2[_0x01b2('0x86')]))&&_0x1accb2[_0x01b2('0x87')]){_0x317b6f=path['join'](config['root'],'server/files/images/avatars/',_0x1accb2[_0x01b2('0x86')]);}}return _0x232cd4['download'](_0x317b6f);}})[_0x01b2('0x2e')](handleError(_0x232cd4,null));};exports[_0x01b2('0x88')]=function(_0x35c9c6,_0xa65de3,_0x197d75){var _0x339144=path['join'](config[_0x01b2('0x7d')],_0x01b2('0x89'));var _0xdce5ed={'where':{'id':_0x35c9c6[_0x01b2('0x66')]['id']},'attributes':['id',_0x01b2('0x76')],'raw':!![]};return db['ChatWebsite'][_0x01b2('0x5d')](_0xdce5ed)['then'](handleEntityNotFound(_0xa65de3,null))[_0x01b2('0x24')](function(_0x54de3d){if(_0x54de3d){if(!_[_0x01b2('0x7b')](_0x54de3d['systemAvatar'])){if(fs[_0x01b2('0x7c')](path[_0x01b2('0x78')](config['root'],_0x01b2('0x83'),_0x54de3d['systemAvatar']))){_0x339144=path[_0x01b2('0x78')](config['root'],'server/files/images/avatars/',_0x54de3d['systemAvatar']);}}return _0xa65de3[_0x01b2('0x7f')](_0x339144);}})[_0x01b2('0x2e')](handleError(_0xa65de3,null));};exports[_0x01b2('0x8a')]=function(_0xe9835e,_0x3dea7f,_0x3d17de){var _0x26636a=require('user-agent-parser');var _0x52813b=new _0x26636a();var _0x1634c8=_0x52813b['setUA'](_0xe9835e['headers'][_0x01b2('0x8b')])['getResult']();var _0x53b160={'body':_0xe9835e[_0x01b2('0x5f')],'channel':_0x01b2('0x8c')};var _0xfd51ad=[];var _0x46a1b9=[];var _0x10eb88={};var _0x60061d=![];return db[_0x01b2('0x8d')][_0x01b2('0x67')]()[_0x01b2('0x24')](function(_0x2e3740){if(!_0x2e3740){throw new db[(_0x01b2('0x8e'))][(_0x01b2('0x21'))]('no\x20available\x20attributes');}_0xfd51ad=_[_0x01b2('0x8f')](_['keys'](_0x2e3740),[_0x01b2('0x90'),_0x01b2('0x91')]);_0x46a1b9=_['difference'](_[_0x01b2('0x47')](_0x2e3740),[_0x01b2('0x90'),_0x01b2('0x91'),_0x01b2('0x92'),_0x01b2('0x93')]);if(_0xe9835e[_0x01b2('0x5f')]['id']){delete _0xe9835e[_0x01b2('0x5f')]['id'];}if(_[_0x01b2('0x7b')](_0xe9835e['body']['from'])){throw new db['Sequelize'][(_0x01b2('0x21'))](_0x01b2('0x94'));}if(_[_0x01b2('0x7b')](_0xe9835e[_0x01b2('0x5f')][_0x01b2('0x5f')])||_0xe9835e[_0x01b2('0x5f')]['body']===''){throw new db[(_0x01b2('0x8e'))][(_0x01b2('0x21'))](_0x01b2('0x95'));}if(_[_0x01b2('0x7b')](_0xe9835e[_0x01b2('0x5f')][_0x01b2('0x96')])){throw new db[(_0x01b2('0x8e'))][(_0x01b2('0x21'))](_0x01b2('0x97')+_0x46a1b9);}if(!_[_0x01b2('0x98')](_0x46a1b9,_0xe9835e['body']['mapKey'])){throw new db[(_0x01b2('0x8e'))]['ValidationError'](_0x01b2('0x99')+_0x46a1b9);}_0x10eb88[_0xe9835e[_0x01b2('0x5f')]['mapKey']]=_0xe9835e[_0x01b2('0x5f')][_0x01b2('0x9a')];})[_0x01b2('0x24')](function(){return db[_0x01b2('0x42')]['find']({'where':{'id':_0xe9835e[_0x01b2('0x66')]['id']},'include':[{'model':db[_0x01b2('0x9b')],'as':_0x01b2('0x9c'),'include':[{'model':db['CmContact'],'as':_0x01b2('0x9d'),'where':_0x10eb88,'limit':0x1,'order':[[_0x01b2('0x91'),_0x01b2('0x9e')]]}]},{'model':db[_0x01b2('0x9f')],'as':'Applications'}]});})[_0x01b2('0x24')](handleEntityNotFound(_0x3dea7f,null))['then'](function(_0x248786){if(_0x248786&&_0x248786[_0x01b2('0x9c')]){_0x53b160[_0x01b2('0xa0')]=_0x248786;_0x53b160[_0x01b2('0xa1')]=_0x248786[_0x01b2('0xa2')];_0x53b160[_0x01b2('0xa3')]=_0x248786['List'];_0x53b160[_0x01b2('0xa1')]=_['orderBy'](_0x53b160[_0x01b2('0xa1')],[_0x01b2('0xa4')],['asc']);if(_0x53b160[_0x01b2('0xa0')][_0x01b2('0xa2')]){delete _0x53b160['account'][_0x01b2('0xa2')];}if(_0x53b160[_0x01b2('0xa0')][_0x01b2('0x9c')]&&_0x53b160[_0x01b2('0xa0')][_0x01b2('0x9c')][_0x01b2('0x9d')]['length']){return _0x53b160[_0x01b2('0xa0')][_0x01b2('0x9c')][_0x01b2('0x9d')][0x0];}var _0xebfcac=_[_0x01b2('0x1b')](_0xe9835e[_0x01b2('0x5f')],{'firstName':_0xe9835e[_0x01b2('0x5f')][_0x01b2('0x9a')],'ListId':_0x248786[_0x01b2('0x93')]});_0xebfcac[_0xe9835e['body']['mapKey']]=_0xe9835e[_0x01b2('0x5f')][_0x01b2('0x9a')];return db[_0x01b2('0x8d')][_0x01b2('0x5e')](_0xebfcac,{'fields':_0xfd51ad,'raw':!![]});}})['then'](handleEntityNotFound(_0x3dea7f,null))[_0x01b2('0x24')](function(_0x384543){_0x53b160['contact']=_0x384543;var _0x3b5933=_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xa5')];if(_0xe9835e[_0x01b2('0xa6')][_0x01b2('0xa7')]){_0x3b5933=_0xe9835e[_0x01b2('0xa6')][_0x01b2('0xa7')];}else if(_0xe9835e['headers'][_0x01b2('0xa8')]){_0x3b5933=_[_0x01b2('0xa9')](_0xe9835e[_0x01b2('0xa6')][_0x01b2('0xa8')][_0x01b2('0xaa')](','));}if(_0x384543){var _0x4a5d5e={'ContactId':_0x384543['id'],'ChatWebsiteId':_0xe9835e[_0x01b2('0x66')]['id'],'from':(_0x384543[_0x01b2('0xab')]||'')+'\x20'+(_0x384543['lastName']||''),'customerIp':_0x3b5933,'customerPort':_0xe9835e[_0x01b2('0xa6')][_0x01b2('0xac')]?_0xe9835e[_0x01b2('0xa6')][_0x01b2('0xac')]:null,'referer':_0xe9835e['body'][_0x01b2('0xad')],'browserName':_0x1634c8[_0x01b2('0xae')][_0x01b2('0x3d')]&&_0x1634c8[_0x01b2('0xae')][_0x01b2('0xaf')]?util[_0x01b2('0xb0')](_0x01b2('0xb1'),_0x1634c8[_0x01b2('0xae')][_0x01b2('0x3d')],_0x1634c8['browser'][_0x01b2('0xaf')]):_0x01b2('0xb2'),'browserVersion':_0x1634c8[_0x01b2('0xae')][_0x01b2('0xaf')]||_0x01b2('0xb2'),'osName':util['format'](_0x01b2('0xb1'),_0x1634c8['os'][_0x01b2('0x3d')],_0x1634c8['os'][_0x01b2('0xaf')]),'osVersion':_0x1634c8['os'][_0x01b2('0xaf')],'deviceModel':_0x1634c8[_0x01b2('0xb3')]['model']&&_0x1634c8['device']['vendor']?util[_0x01b2('0xb0')]('%s\x20%s\x20%s',_0x1634c8[_0x01b2('0xb3')]['model'],_0x1634c8[_0x01b2('0xb3')][_0x01b2('0xb4')],_0x1634c8[_0x01b2('0xb3')][_0x01b2('0x44')]):null,'deviceVendor':_0x1634c8[_0x01b2('0xb3')][_0x01b2('0xb4')],'deviceType':_0x1634c8[_0x01b2('0xb3')][_0x01b2('0x44')],'formData':JSON[_0x01b2('0x29')](_0xe9835e[_0x01b2('0x5f')])};var _0x380831={'ChatWebsiteId':_0xe9835e['params']['id'],'closed':![]};if(_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xb5')]){_0x380831['threadId']=_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xb5')];return db['ChatInteraction']['find']({'where':_0x380831})['then'](function(_0x28bf60){if(_0x28bf60){return[_0x28bf60,![]];}_0x4a5d5e[_0x01b2('0xb5')]=_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xb5')];_0x4a5d5e[_0x01b2('0xb6')]=_0xe9835e['body'][_0x01b2('0xb6')];return db[_0x01b2('0xb7')][_0x01b2('0x5e')](_0x4a5d5e)[_0x01b2('0x24')](function(_0x305de0){return[_0x305de0,!![]];});});}_0x380831['ContactId']=_0x384543['id'];if(_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xb8')]&&_0xe9835e[_0x01b2('0x5f')]['interaction']['id']){_0x380831['id']=_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xb8')]['id'];return db[_0x01b2('0xb7')]['find']({'where':_0x380831})[_0x01b2('0x24')](function(_0x169ecd){if(_0x169ecd){return[_0x169ecd,![]];}return db['ChatInteraction'][_0x01b2('0x5e')](_0x4a5d5e)['then'](function(_0x5a2563){return[_0x5a2563,!![]];});});}return db[_0x01b2('0xb7')][_0x01b2('0x5e')](_0x4a5d5e)[_0x01b2('0x24')](function(_0x3069db){return[_0x3069db,!![]];});}})['spread'](function(_0x3b2963,_0x3b4cd9){if(_0x3b2963){_0x60061d=_0x3b4cd9;if(!_0x3b4cd9){var _0x570b24={'from':(_0x53b160[_0x01b2('0xb9')][_0x01b2('0xab')]||'')+'\x20'+(_0x53b160['contact'][_0x01b2('0xba')]||'')};if(_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xb5')]&&_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xbb')]&&_0xe9835e[_0x01b2('0x5f')]['threadId']!=_0xe9835e['body'][_0x01b2('0xbb')]){_0x570b24[_0x01b2('0xb5')]=_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xbb')];}return _0x3b2963[_0x01b2('0x39')](_0x570b24);}else{return _0x3b2963;}}})['then'](function(_0xca5a08){_0x53b160[_0x01b2('0xb8')]=_0xca5a08[_0x01b2('0x63')]({'plain':!![]});_0x53b160[_0x01b2('0xb8')][_0x01b2('0xbc')]=_0x60061d;if(_0x53b160[_0x01b2('0xb8')][_0x01b2('0xbc')]){if(_0x53b160[_0x01b2('0xa0')]['autoclose']){_0x53b160['applications'][_0x01b2('0xbd')]({'id':0x0,'priority':_0x53b160['applications'][_0x01b2('0x4d')]+0x1,'app':_0x01b2('0xbe'),'appdata':_0x01b2('0xbf'),'interval':_0x01b2('0xc0')});}}return db[_0x01b2('0xc1')][_0x01b2('0x5e')]({'body':_0xe9835e[_0x01b2('0x5f')][_0x01b2('0x5f')],'ChatWebsiteId':_0xe9835e[_0x01b2('0x66')]['id'],'ChatInteractionId':_0xca5a08['id'],'direction':'in','ContactId':_0x53b160[_0x01b2('0xb9')]['id'],'AttachmentId':_0xe9835e[_0x01b2('0x5f')][_0x01b2('0xc2')]});})[_0x01b2('0x24')](function(_0x583b7c){_0x53b160[_0x01b2('0x2c')]=_0x583b7c;if(_0x53b160[_0x01b2('0xb8')][_0x01b2('0xc3')]){return db[_0x01b2('0xc4')][_0x01b2('0x5d')]({'attributes':['id',_0x01b2('0x3d')],'where':{'id':_0x53b160[_0x01b2('0xb8')][_0x01b2('0xc3')]}})[_0x01b2('0x24')](function(_0x4549bc){if(_0x4549bc){_0x53b160[_0x01b2('0xa1')]['unshift']({'id':0x0,'priority':0x0,'app':_0x01b2('0xc5'),'appdata':_0x4549bc[_0x01b2('0x3d')]+','+(_0x53b160['account'][_0x01b2('0xc6')]||0xa),'interval':_0x01b2('0xc0')});_0x53b160['forcedOwnership']=!![];}return respondWithRpcPromise('Start',_0x01b2('0xc7'),_0x53b160);});}return respondWithRpcPromise(_0x01b2('0xc8'),_0x01b2('0xc7'),_0x53b160);})['then'](function(_0x5dae8a){respondWithRpcPromise(_0x01b2('0xc9'),_0x01b2('0xc9'),{'event':'notify','message':_0x5dae8a},client9002);return _0x5dae8a;})[_0x01b2('0x24')](respondWithResult(_0x3dea7f,null))[_0x01b2('0x2e')](handleError(_0x3dea7f,null));};exports['offline']=function(_0x1d4a33,_0x46de95,_0x1a8b81){var _0x21e760,_0x49bb38,_0x247ac7;var _0x1c4739=[];var _0xda0510=[];var _0x3c3454={};return db['CmContact'][_0x01b2('0x67')]()[_0x01b2('0x24')](function(_0x4f778d){if(!_0x4f778d){throw new db['Sequelize'][(_0x01b2('0x21'))](_0x01b2('0xca'));}_0xda0510=_['difference'](_['keys'](_0x4f778d),[_0x01b2('0x90'),_0x01b2('0x91')]);_0x1c4739=_[_0x01b2('0x8f')](_[_0x01b2('0x47')](_0x4f778d),[_0x01b2('0x90'),_0x01b2('0x91'),'CompanyId',_0x01b2('0x93')]);if(_0x1d4a33[_0x01b2('0x5f')]['id']){delete _0x1d4a33[_0x01b2('0x5f')]['id'];}if(_[_0x01b2('0x7b')](_0x1d4a33[_0x01b2('0x5f')][_0x01b2('0x9a')])){throw _0x46de95[_0x01b2('0x35')](0x1f4)['send'](new db['Sequelize'][(_0x01b2('0x21'))](_0x01b2('0x94')));}if(_[_0x01b2('0x7b')](_0x1d4a33[_0x01b2('0x5f')]['body'])||_0x1d4a33[_0x01b2('0x5f')][_0x01b2('0x5f')]===''){throw _0x46de95[_0x01b2('0x35')](0x1f4)[_0x01b2('0xcb')](new db['Sequelize'][(_0x01b2('0x21'))]('body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0x01b2('0x7b')](_0x1d4a33['body'][_0x01b2('0xcc')])){throw _0x46de95[_0x01b2('0x35')](0x1f4)[_0x01b2('0xcb')](new db[(_0x01b2('0x8e'))]['ValidationError'](_0x01b2('0xcd')+_0x1c4739));}if(!_['includes'](_0x1c4739,_0x1d4a33[_0x01b2('0x5f')][_0x01b2('0xcc')])){throw _0x46de95['status'](0x1f4)['send'](new db['Sequelize'][(_0x01b2('0x21'))](_0x01b2('0xce')+_0x1c4739));}_0x3c3454[_0x1d4a33[_0x01b2('0x5f')][_0x01b2('0xcc')]]=_0x1d4a33['body'][_0x01b2('0x9a')];})[_0x01b2('0x24')](function(){return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x1d4a33[_0x01b2('0x66')]['id']},'include':[{'model':db[_0x01b2('0x9b')],'as':_0x01b2('0x9c')}]});})[_0x01b2('0x24')](handleEntityNotFound(_0x46de95,null))['then'](function(_0x53d418){if(_0x53d418&&_0x53d418['List']){_0x49bb38=_0x53d418;var _0x5b2229=_[_0x01b2('0x1b')](_0x1d4a33[_0x01b2('0x5f')],{'firstName':_0x1d4a33[_0x01b2('0x5f')][_0x01b2('0x9a')],'phone':_0x1d4a33[_0x01b2('0x5f')][_0x01b2('0x9a')],'ListId':_0x53d418[_0x01b2('0x93')]});_0x5b2229[_0x1d4a33['body'][_0x01b2('0xcc')]]=_0x1d4a33[_0x01b2('0x5f')][_0x01b2('0x9a')];return db[_0x01b2('0x8d')]['findOrCreate']({'where':_0x3c3454,'defaults':_0x5b2229});}})[_0x01b2('0xcf')](function(_0x55aa06){if(_0x55aa06){_0x247ac7=_0x55aa06;var _0x2b93b9=fs[_0x01b2('0xd0')](path[_0x01b2('0x78')](config[_0x01b2('0x7d')],_0x01b2('0xd1')),_0x01b2('0xd2'));var _0x526309=ejs['render'](_0x2b93b9,{'body':_[_0x01b2('0xd3')](_0x1d4a33['body'][_0x01b2('0x5f')]),'bodyTitle':_0x49bb38[_0x01b2('0xd4')]});return db[_0x01b2('0xd5')][_0x01b2('0x5e')]({'body':_0x526309,'ContactId':_0x55aa06['id'],'ChatWebsiteId':_0x49bb38['id']});}})[_0x01b2('0x24')](function(_0x5a54f2){if(_0x5a54f2){_0x21e760=_0x5a54f2;return db[_0x01b2('0xd6')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x01b2('0xd7')],'as':'Smtp','raw':!![]}]});}})[_0x01b2('0x24')](function(_0x1b3e33){if(_0x1b3e33&&_0x1b3e33[_0x01b2('0xd8')]&&_0x49bb38['forwardOfflineAddress']){var _0x4991c4={'tls':{'rejectUnauthorized':![]}};if(_0x1b3e33[_0x01b2('0xd8')][_0x01b2('0xd9')]){_0x4991c4[_0x01b2('0xd9')]=_0x1b3e33['Smtp']['service'];}else{_0x4991c4[_0x01b2('0xda')]=_0x1b3e33[_0x01b2('0xd8')]['host'];_0x4991c4[_0x01b2('0xdb')]=_0x1b3e33[_0x01b2('0xd8')][_0x01b2('0xdb')];_0x4991c4['secure']=_0x1b3e33[_0x01b2('0xd8')]['secure'];}if(_0x1b3e33['Smtp'][_0x01b2('0xdc')]){_0x4991c4[_0x01b2('0xdd')]={'user':_0x1b3e33[_0x01b2('0xd8')][_0x01b2('0x60')],'pass':_0x1b3e33[_0x01b2('0xd8')][_0x01b2('0xde')]};}return respondWithRpcPromise(_0x01b2('0xdf'),'sendMail',{'account':_0x4991c4,'message':{'from':util[_0x01b2('0xb0')](_0x01b2('0xe0'),_0x1b3e33['name'],_0x1b3e33[_0x01b2('0xe1')]||_0x1b3e33[_0x01b2('0xd8')][_0x01b2('0x60')]),'to':_0x49bb38['forwardOfflineAddress'],'subject':_0x49bb38[_0x01b2('0xe2')],'text':_0x21e760['body']}},client9003)['then'](function(){return _0x21e760;})[_0x01b2('0x2e')](function(_0xc60c8){console['error'](_0xc60c8);});}})[_0x01b2('0x24')](function(){if(_0x21e760){return _0x21e760;}})['then'](respondWithResult(_0x46de95,null))[_0x01b2('0x2e')](handleError(_0x46de95,null));};exports[_0x01b2('0xe3')]=function(_0x4b6125,_0x40bcb7,_0x2a8fa0){return db[_0x01b2('0xb7')]['find']({'where':{'id':_0x4b6125[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x40bcb7,null))['then'](function(_0x4189cf){if(_0x4189cf){return _0x4189cf[_0x01b2('0xe3')](_0x4b6125[_0x01b2('0x5f')][_0x01b2('0x6e')],_[_0x01b2('0xe4')](_0x4b6125[_0x01b2('0x5f')],['ids','id'])||{});}})[_0x01b2('0x24')](respondWithResult(_0x40bcb7,null))[_0x01b2('0x2e')](handleError(_0x40bcb7,null));};exports['getInteractions']=function(_0x32098d,_0x3d64e,_0x722d13){var _0x5ba3c9={'raw':![],'where':{}};var _0xae3220={};var _0x269c07={'count':0x0,'rows':[]};return db[_0x01b2('0x42')][_0x01b2('0x6b')]({'where':{'id':_0x32098d[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x3d64e,null))[_0x01b2('0x24')](function(_0x1df61){if(_0x1df61){_0xae3220['model']=_[_0x01b2('0x47')](db[_0x01b2('0xb7')]['rawAttributes']);_0xae3220[_0x01b2('0x46')]=_['keys'](_0x32098d[_0x01b2('0x46')]);_0xae3220[_0x01b2('0x48')]=_['intersection'](_0xae3220[_0x01b2('0x49')],_0xae3220[_0x01b2('0x46')]);_0x5ba3c9[_0x01b2('0x4a')]=_[_0x01b2('0x4b')](_0xae3220[_0x01b2('0x49')],qs['fields'](_0x32098d[_0x01b2('0x46')][_0x01b2('0x4c')]));_0x5ba3c9[_0x01b2('0x4a')]=_0x5ba3c9['attributes']['length']?_0x5ba3c9[_0x01b2('0x4a')]:_0xae3220[_0x01b2('0x49')];if(!_0x32098d[_0x01b2('0x46')][_0x01b2('0x4e')]('nolimit')){_0x5ba3c9[_0x01b2('0x34')]=qs[_0x01b2('0x34')](_0x32098d[_0x01b2('0x46')]['limit']);_0x5ba3c9[_0x01b2('0x33')]=qs['offset'](_0x32098d[_0x01b2('0x46')][_0x01b2('0x33')]);}_0x5ba3c9[_0x01b2('0x50')]=qs[_0x01b2('0x51')](_0x32098d[_0x01b2('0x46')][_0x01b2('0x51')]);_0x5ba3c9[_0x01b2('0x52')]=qs[_0x01b2('0x48')](_[_0x01b2('0x53')](_0x32098d[_0x01b2('0x46')],_0xae3220[_0x01b2('0x48')]));_0x5ba3c9[_0x01b2('0x52')][_0x01b2('0x69')]=_0x1df61['id'];if(_0x32098d[_0x01b2('0x46')][_0x01b2('0x54')]){_0x5ba3c9[_0x01b2('0x52')]=_[_0x01b2('0x55')](_0x5ba3c9['where'],{'$or':_[_0x01b2('0x41')](_0x5ba3c9[_0x01b2('0x4a')],function(_0x31bb74){var _0x1dd86d={};_0x1dd86d[_0x31bb74]={'$like':'%'+_0x32098d['query'][_0x01b2('0x54')]+'%'};return _0x1dd86d;})});}_0x5ba3c9=_[_0x01b2('0x55')]({},_0x5ba3c9,_0x32098d[_0x01b2('0x57')]);return db['ChatInteraction'][_0x01b2('0x32')]({'where':_0x5ba3c9[_0x01b2('0x52')]})['then'](function(_0x4862a1){_0x269c07['count']=_0x4862a1;if(_0x32098d[_0x01b2('0x46')][_0x01b2('0x58')]){_0x5ba3c9[_0x01b2('0x59')]=[{'model':db[_0x01b2('0x8d')],'as':_0x01b2('0xe5'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x01b2('0x3d'),_0x01b2('0xe6'),'internal'],'required':![]},{'model':db['Tag'],'as':_0x01b2('0xe7'),'attributes':['id',_0x01b2('0x3d'),_0x01b2('0xe8')],'where':_0x32098d[_0x01b2('0x46')][_0x01b2('0xe9')]?{'id':_0x32098d[_0x01b2('0x46')][_0x01b2('0xe9')]}:undefined,'required':_0x32098d['query'][_0x01b2('0xe9')]?!![]:![]}];}return db[_0x01b2('0xb7')][_0x01b2('0x5a')](_0x5ba3c9);})['then'](function(_0x4e435c){_0x269c07[_0x01b2('0x5b')]=_0x4e435c;return _0x269c07;});}})['then'](respondWithFilteredResult(_0x3d64e,_0x5ba3c9))[_0x01b2('0x2e')](handleError(_0x3d64e,null));};function iftimePromise(_0x220c52,_0x2d2f42){return respondWithRpcPromise(_0x01b2('0xea'),_0x01b2('0xeb'),{'command':_0x2d2f42[_0x01b2('0xec')]?util[_0x01b2('0xb0')](_0x01b2('0xed'),_0x220c52[_0x01b2('0xee')],_0x2d2f42[_0x01b2('0xec')]):util[_0x01b2('0xb0')](_0x01b2('0xef'),_0x220c52[_0x01b2('0xee')])},client9002)['then'](function(_0x172193){var _0x1c76f8=_0x172193&&_0x172193[_0x01b2('0xf0')](_0x01b2('0xf1'))>=0x0?!![]:![];logger[_0x01b2('0x25')](_0x01b2('0xf2'),_0x2d2f42['id'],_0x220c52['id'],_0x220c52['interval'],_0x1c76f8?'ONLINE':_0x01b2('0xf3'),_0x2d2f42[_0x01b2('0xec')]?_0x2d2f42[_0x01b2('0xec')]:'No\x20timezone');return _0x1c76f8;})[_0x01b2('0x2e')](function(_0x135d9f){logger[_0x01b2('0x2a')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x2d2f42['id'],_0x220c52['id'],_0x220c52[_0x01b2('0xee')],util[_0x01b2('0xf4')](_0x135d9f,{'showHidden':![],'depth':null}),_0x2d2f42[_0x01b2('0xec')]?_0x2d2f42['timezone']:_0x01b2('0xf5'));return![];});}exports[_0x01b2('0xeb')]=function(_0x32e4f8,_0x3ea8d1,_0x5f48a1){var _0x2ddee2=0x0;var _0x2232a8=0x0;var _0x744542=![];var _0x32315b;var _0x511736;return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x32e4f8[_0x01b2('0x66')]['id']},'include':[{'model':db[_0x01b2('0xf6')],'as':'Interval','include':[{'model':db[_0x01b2('0xf6')],'as':'Intervals','attributes':['id',_0x01b2('0xee')],'raw':!![]}]}]})[_0x01b2('0x24')](handleEntityNotFound(_0x3ea8d1,null))[_0x01b2('0x24')](function(_0x44d4d4){if(_0x44d4d4){_0x32315b=_0x44d4d4;return _0x44d4d4['getProactiveActions']({'raw':!![]});}})[_0x01b2('0x24')](function(_0x221e4a){if(_0x32315b){if(_0x221e4a){_0x511736=_0x221e4a;}}return require(_0x01b2('0x79'))['getLicense']();})[_0x01b2('0x24')](function(_0x24bff8){if(_0x24bff8){_0x2232a8=_0x24bff8[_0x01b2('0xf7')];_0x744542=_0x24bff8[_0x01b2('0x7a')];}})['then'](function(){return db[_0x01b2('0xb7')][_0x01b2('0x32')]({'where':{'closed':![]}});})[_0x01b2('0x24')](function(_0x3f2bfb){_0x2ddee2=_0x3f2bfb;if(_0x2232a8&&_0x3f2bfb>_0x2232a8){return db['License']['findOne']({'where':{'id':0x1}})[_0x01b2('0x24')](function(_0x144ffa){if(_0x144ffa){_0x144ffa['increment'](_0x01b2('0xf8'));}});}})[_0x01b2('0x24')](function(){if(_0x32315b[_0x01b2('0xf6')]&&_0x32315b[_0x01b2('0xf6')][_0x01b2('0xf9')]){var _0x1d7940=[];for(var _0x2aca1d=0x0;_0x2aca1d<_0x32315b[_0x01b2('0xf6')][_0x01b2('0xf9')][_0x01b2('0x4d')];_0x2aca1d++){var _0x29b957=_0x32315b[_0x01b2('0xf6')][_0x01b2('0xf9')][_0x2aca1d][_0x01b2('0x63')]({'plain':!![]});_0x1d7940[_0x01b2('0xbd')](iftimePromise(_0x29b957,_0x32315b));}return BPromise[_0x01b2('0xfa')](_0x1d7940)[_0x01b2('0x24')](function(_0x14dd2a){return _[_0x01b2('0xfb')](_0x14dd2a);});}else{return!![];}})[_0x01b2('0x24')](function(_0x50c5c1){var _0x1b964e=fs[_0x01b2('0xd0')](path['join'](config['root'],_0x01b2('0xfc')),_0x01b2('0xd2'));var _0x1a0e40={'remote':_0x32315b[_0x01b2('0xfd')],'query':querystring[_0x01b2('0x29')](_[_0x01b2('0x55')](_0x32315b[_0x01b2('0x63')]({'plain':!![]}),{'customerIp':_0x32e4f8['headers']['x-forwarded-for']||_0x32e4f8[_0x01b2('0xa6')]['x-real-ip']||_0x32e4f8['connection'][_0x01b2('0xfe')]||_0x32e4f8['ip'],'referer':_0x32e4f8[_0x01b2('0xa6')][_0x01b2('0xad')],'openedInteractions':_0x2ddee2,'maxInteractions':_0x2232a8,'virtual':_0x744542[_0x01b2('0xf7')],'online':_0x50c5c1,'custom':_0x744542}))[_0x01b2('0xff')](/'/g,'\x5c\x27')};_0x3ea8d1['send'](ejs['render'](Mustache[_0x01b2('0x100')](_0x1b964e,_0x1a0e40),{'proactiveActions':_0x511736,'alignment':_0x32315b[_0x01b2('0x101')],'verticalAlignment':_0x32315b['verticalAlignment']}));})[_0x01b2('0x2e')](handleError(_0x3ea8d1,null));};exports[_0x01b2('0x102')]=function(_0x574612,_0x2f19ea,_0x9d1482){return db['ChatWebsite'][_0x01b2('0x6b')]({'where':{'id':_0x574612[_0x01b2('0x66')]['id']}})['then'](handleEntityNotFound(_0x2f19ea,null))[_0x01b2('0x24')](function(_0x14c24e){if(_0x14c24e){return db['sequelize'][_0x01b2('0x103')](function(_0x26958e){return db['ChatApplication'][_0x01b2('0x3b')]({'where':{'ChatWebsiteId':_0x574612[_0x01b2('0x66')]['id']},'transaction':_0x26958e})['then'](function(_0x114c79){var _0xa9b11e=_[_0x01b2('0x41')](_0x574612['body'],function(_0x1aa479){_0x1aa479[_0x01b2('0x69')]=_0x574612['params']['id'];return _0x1aa479;});return db[_0x01b2('0x9f')][_0x01b2('0x104')](_0xa9b11e,{'transaction':_0x26958e});});})['then'](function(){return db[_0x01b2('0x9f')]['findAndCountAll']({'where':{'ChatWebsiteId':_0x574612[_0x01b2('0x66')]['id']},'order':_0x01b2('0xa4')});});}})[_0x01b2('0x24')](respondWithResult(_0x2f19ea,null))[_0x01b2('0x2e')](handleError(_0x2f19ea,null));};exports[_0x01b2('0x105')]=function(_0x515c67,_0x1b0a82,_0x1f244e){var _0x2574e6={};var _0x59c6af={};var _0x363824;var _0x3dd037;return db[_0x01b2('0x42')][_0x01b2('0x6b')]({'where':{'id':_0x515c67[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x1b0a82,null))[_0x01b2('0x24')](function(_0x3bdf8a){if(_0x3bdf8a){_0x363824=_0x3bdf8a;_0x59c6af[_0x01b2('0x49')]=_['keys'](db[_0x01b2('0x9f')][_0x01b2('0x43')]);_0x59c6af[_0x01b2('0x46')]=_[_0x01b2('0x47')](_0x515c67[_0x01b2('0x46')]);_0x59c6af['filters']=_['intersection'](_0x59c6af[_0x01b2('0x49')],_0x59c6af[_0x01b2('0x46')]);_0x2574e6[_0x01b2('0x4a')]=_[_0x01b2('0x4b')](_0x59c6af[_0x01b2('0x49')],qs['fields'](_0x515c67[_0x01b2('0x46')][_0x01b2('0x4c')]));_0x2574e6[_0x01b2('0x4a')]=_0x2574e6[_0x01b2('0x4a')][_0x01b2('0x4d')]?_0x2574e6[_0x01b2('0x4a')]:_0x59c6af[_0x01b2('0x49')];_0x2574e6[_0x01b2('0x50')]=qs['sort'](_0x515c67[_0x01b2('0x46')][_0x01b2('0x51')]);_0x2574e6[_0x01b2('0x52')]=qs['filters'](_[_0x01b2('0x53')](_0x515c67[_0x01b2('0x46')],_0x59c6af[_0x01b2('0x48')]));if(_0x515c67[_0x01b2('0x46')][_0x01b2('0x54')]){_0x2574e6['where']=_[_0x01b2('0x55')](_0x2574e6[_0x01b2('0x52')],{'$or':_[_0x01b2('0x41')](_0x2574e6[_0x01b2('0x4a')],function(_0x18d972){var _0x3d3ca7={};_0x3d3ca7[_0x18d972]={'$like':'%'+_0x515c67['query'][_0x01b2('0x54')]+'%'};return _0x3d3ca7;})});}_0x2574e6=_[_0x01b2('0x55')]({},_0x2574e6,_0x515c67['options']);return _0x363824[_0x01b2('0x105')](_0x2574e6);}})[_0x01b2('0x24')](function(_0x3db8b2){if(_0x3db8b2){_0x3dd037=_0x3db8b2[_0x01b2('0x4d')];if(!_0x515c67[_0x01b2('0x46')][_0x01b2('0x4e')](_0x01b2('0x4f'))){_0x2574e6[_0x01b2('0x34')]=qs[_0x01b2('0x34')](_0x515c67['query'][_0x01b2('0x34')]);_0x2574e6[_0x01b2('0x33')]=qs[_0x01b2('0x33')](_0x515c67[_0x01b2('0x46')][_0x01b2('0x33')]);}return _0x363824[_0x01b2('0x105')](_0x2574e6);}})['then'](function(_0x2a0ab6){if(_0x2a0ab6){return _0x2a0ab6?{'count':_0x3dd037,'rows':_0x2a0ab6}:null;}})[_0x01b2('0x24')](respondWithResult(_0x1b0a82,null))[_0x01b2('0x2e')](handleError(_0x1b0a82,null));};exports['addProactiveActions']=function(_0x59a8a2,_0x2e0de8,_0x5838a4){return db[_0x01b2('0x106')][_0x01b2('0x5d')]({'where':{'id':_0x59a8a2[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x2e0de8,null))[_0x01b2('0x24')](function(_0x2f0d50){if(_0x2f0d50){return _0x2f0d50['addProactiveActions'](_0x59a8a2[_0x01b2('0x5f')]['ids'],_[_0x01b2('0xe4')](_0x59a8a2['body'],['ids','id'])||{});}})['then'](respondWithResult(_0x2e0de8,null))[_0x01b2('0x2e')](handleError(_0x2e0de8,null));};exports[_0x01b2('0x107')]=function(_0x3f22f4,_0x4883ad,_0x1c0918){var _0x3fd927={};var _0x1d965d={};var _0x5c200d;var _0x55b3ea;return db[_0x01b2('0x42')][_0x01b2('0x6b')]({'where':{'id':_0x3f22f4[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x4883ad,null))['then'](function(_0xa66dfb){if(_0xa66dfb){_0x5c200d=_0xa66dfb;_0x1d965d[_0x01b2('0x49')]=_[_0x01b2('0x47')](db[_0x01b2('0x108')][_0x01b2('0x43')]);_0x1d965d[_0x01b2('0x46')]=_[_0x01b2('0x47')](_0x3f22f4['query']);_0x1d965d['filters']=_['intersection'](_0x1d965d[_0x01b2('0x49')],_0x1d965d['query']);_0x3fd927[_0x01b2('0x4a')]=_[_0x01b2('0x4b')](_0x1d965d[_0x01b2('0x49')],qs[_0x01b2('0x4c')](_0x3f22f4[_0x01b2('0x46')][_0x01b2('0x4c')]));_0x3fd927[_0x01b2('0x4a')]=_0x3fd927['attributes'][_0x01b2('0x4d')]?_0x3fd927['attributes']:_0x1d965d[_0x01b2('0x49')];_0x3fd927['order']=qs['sort'](_0x3f22f4[_0x01b2('0x46')][_0x01b2('0x51')]);_0x3fd927[_0x01b2('0x52')]=qs[_0x01b2('0x48')](_[_0x01b2('0x53')](_0x3f22f4['query'],_0x1d965d[_0x01b2('0x48')]));if(_0x3f22f4[_0x01b2('0x46')][_0x01b2('0x54')]){_0x3fd927['where']=_[_0x01b2('0x55')](_0x3fd927[_0x01b2('0x52')],{'$or':_[_0x01b2('0x41')](_0x3fd927[_0x01b2('0x4a')],function(_0x53b897){var _0x887909={};_0x887909[_0x53b897]={'$like':'%'+_0x3f22f4[_0x01b2('0x46')]['filter']+'%'};return _0x887909;})});}_0x3fd927=_[_0x01b2('0x55')]({},_0x3fd927,_0x3f22f4[_0x01b2('0x57')]);return _0x5c200d[_0x01b2('0x107')](_0x3fd927);}})['then'](function(_0xbf58af){if(_0xbf58af){_0x55b3ea=_0xbf58af[_0x01b2('0x4d')];if(!_0x3f22f4['query']['hasOwnProperty'](_0x01b2('0x4f'))){_0x3fd927[_0x01b2('0x34')]=qs['limit'](_0x3f22f4[_0x01b2('0x46')][_0x01b2('0x34')]);_0x3fd927[_0x01b2('0x33')]=qs['offset'](_0x3f22f4['query'][_0x01b2('0x33')]);}return _0x5c200d['getProactiveActions'](_0x3fd927);}})['then'](function(_0x50fa10){if(_0x50fa10){return _0x50fa10?{'count':_0x55b3ea,'rows':_0x50fa10}:null;}})['then'](respondWithResult(_0x4883ad,null))[_0x01b2('0x2e')](handleError(_0x4883ad,null));};exports['getFields']=function(_0x5045d8,_0x2bc791,_0x114f1d){var _0x4115cc=_0x5045d8['query']['online']===_0x01b2('0x109')?'offlineForm':_0x01b2('0x10a');return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'attributes':['id',_0x4115cc],'where':{'id':_0x5045d8[_0x01b2('0x66')]['id']}})['then'](handleEntityNotFound(_0x2bc791,null))[_0x01b2('0x24')](function(_0x3c83ed){if(_0x3c83ed){var _0x4f03c9=_0x3c83ed[_0x4115cc];var _0xab617b=_0x4f03c9&&_0x4f03c9[_0x01b2('0x10b')]?_0x4f03c9[_0x01b2('0x10b')]:[];_0x2bc791[_0x01b2('0xcb')]({'fromKey':_[_0x01b2('0x7b')](_0x4f03c9[_0x01b2('0x10c')])?undefined:_0x4f03c9['fromKey'],'count':_0xab617b[_0x01b2('0x4d')],'rows':_0xab617b});}})[_0x01b2('0x2e')](handleError(_0x2bc791,null));};exports[_0x01b2('0x10d')]=function(_0x8db936,_0x5d7304,_0x195a8d){var _0x177ed1={'raw':!![],'where':{}};var _0x306e3a={};var _0xd01eef={'count':0x0,'rows':[]};return db[_0x01b2('0x42')][_0x01b2('0x6b')]({'where':{'id':_0x8db936[_0x01b2('0x66')]['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x5d7304,null))[_0x01b2('0x24')](function(_0x247f87){if(_0x247f87){_0x306e3a[_0x01b2('0x49')]=_[_0x01b2('0x47')](db[_0x01b2('0xd5')][_0x01b2('0x43')]);_0x306e3a[_0x01b2('0x46')]=_[_0x01b2('0x47')](_0x8db936['query']);_0x306e3a[_0x01b2('0x48')]=_[_0x01b2('0x4b')](_0x306e3a[_0x01b2('0x49')],_0x306e3a['query']);_0x177ed1['attributes']=_['intersection'](_0x306e3a[_0x01b2('0x49')],qs[_0x01b2('0x4c')](_0x8db936[_0x01b2('0x46')][_0x01b2('0x4c')]));_0x177ed1[_0x01b2('0x4a')]=_0x177ed1[_0x01b2('0x4a')][_0x01b2('0x4d')]?_0x177ed1['attributes']:_0x306e3a[_0x01b2('0x49')];if(!_0x8db936[_0x01b2('0x46')][_0x01b2('0x4e')](_0x01b2('0x4f'))){_0x177ed1['limit']=qs[_0x01b2('0x34')](_0x8db936[_0x01b2('0x46')]['limit']);_0x177ed1[_0x01b2('0x33')]=qs[_0x01b2('0x33')](_0x8db936['query']['offset']);}_0x177ed1[_0x01b2('0x50')]=qs['sort'](_0x8db936[_0x01b2('0x46')][_0x01b2('0x51')]);_0x177ed1[_0x01b2('0x52')]=qs['filters'](_[_0x01b2('0x53')](_0x8db936[_0x01b2('0x46')],_0x306e3a[_0x01b2('0x48')]));_0x177ed1[_0x01b2('0x52')][_0x01b2('0x69')]=_0x247f87['id'];if(_0x8db936[_0x01b2('0x46')]['filter']){_0x177ed1[_0x01b2('0x52')]=_['merge'](_0x177ed1['where'],{'$or':_[_0x01b2('0x41')](_0x177ed1[_0x01b2('0x4a')],function(_0x23a1ab){var _0x53e7ca={};_0x53e7ca[_0x23a1ab]={'$like':'%'+_0x8db936[_0x01b2('0x46')]['filter']+'%'};return _0x53e7ca;})});}_0x177ed1=_[_0x01b2('0x55')]({},_0x177ed1,_0x8db936['options']);return db['ChatOfflineMessage'][_0x01b2('0x32')]({'where':_0x177ed1[_0x01b2('0x52')]})[_0x01b2('0x24')](function(_0x152f4c){_0xd01eef[_0x01b2('0x32')]=_0x152f4c;if(_0x8db936[_0x01b2('0x46')][_0x01b2('0x58')]){_0x177ed1['include']=[{'all':!![]}];}return db[_0x01b2('0xd5')][_0x01b2('0x5a')](_0x177ed1);})[_0x01b2('0x24')](function(_0x4bb0bf){_0xd01eef['rows']=_0x4bb0bf;return _0xd01eef;});}})[_0x01b2('0x24')](respondWithFilteredResult(_0x5d7304,_0x177ed1))[_0x01b2('0x2e')](handleError(_0x5d7304,null));};exports[_0x01b2('0x10e')]=function(_0x4f2840,_0xa1eef1,_0x1cfc70){return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x4f2840['params']['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0xa1eef1,null))[_0x01b2('0x24')](function(_0x195a46){if(_0x195a46){return _0x195a46[_0x01b2('0x10e')](_0x4f2840[_0x01b2('0x5f')][_0x01b2('0x6e')],_[_0x01b2('0xe4')](_0x4f2840['body'],[_0x01b2('0x6e'),'id'])||{})[_0x01b2('0xcf')](function(_0x4c0f51){for(var _0x135bec=0x0;_0x135bec<_0x4f2840[_0x01b2('0x5f')][_0x01b2('0x6e')][_0x01b2('0x4d')];_0x135bec+=0x1){socket[_0x01b2('0x10f')](_0x01b2('0x110'),{'UserId':_0x4f2840[_0x01b2('0x5f')][_0x01b2('0x6e')][_0x135bec],'ChatWebsiteId':_0x4f2840[_0x01b2('0x66')]['id']});}return _0x4c0f51;});}})['then'](respondWithResult(_0xa1eef1,null))['catch'](handleError(_0xa1eef1,null));};exports[_0x01b2('0x111')]=function(_0x24dc7a,_0x7d10d6,_0x138bfe){return db[_0x01b2('0x42')][_0x01b2('0x5d')]({'where':{'id':_0x24dc7a['params']['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x7d10d6,null))[_0x01b2('0x24')](function(_0x5b4c45){if(_0x5b4c45){return _0x5b4c45['removeAgents'](_0x24dc7a[_0x01b2('0x46')]['ids'])[_0x01b2('0x24')](function(){if(_['isArray'](_0x24dc7a[_0x01b2('0x46')][_0x01b2('0x6e')])){for(var _0x759655=0x0;_0x759655<_0x24dc7a['query']['ids'][_0x01b2('0x4d')];_0x759655+=0x1){socket[_0x01b2('0x10f')](_0x01b2('0x112'),{'UserId':Number(_0x24dc7a[_0x01b2('0x46')][_0x01b2('0x6e')][_0x759655]),'ChatWebsiteId':Number(_0x24dc7a[_0x01b2('0x66')]['id'])});}}else{socket[_0x01b2('0x10f')](_0x01b2('0x112'),{'UserId':Number(_0x24dc7a['query'][_0x01b2('0x6e')]),'ChatWebsiteId':Number(_0x24dc7a[_0x01b2('0x66')]['id'])});}});}})[_0x01b2('0x24')](respondWithStatusCode(_0x7d10d6,null))[_0x01b2('0x2e')](handleError(_0x7d10d6,null));};exports[_0x01b2('0x113')]=function(_0x180ffc,_0x204957,_0x32295d){var _0x32e425={};var _0x3bb628={};var _0x10d876;var _0x4a145c;return db[_0x01b2('0x42')][_0x01b2('0x6b')]({'where':{'id':_0x180ffc['params']['id']}})[_0x01b2('0x24')](handleEntityNotFound(_0x204957,null))[_0x01b2('0x24')](function(_0x3f5211){if(_0x3f5211){_0x10d876=_0x3f5211;_0x3bb628['model']=_['keys'](db[_0x01b2('0xc4')]['rawAttributes']);_0x3bb628[_0x01b2('0x46')]=_[_0x01b2('0x47')](_0x180ffc['query']);_0x3bb628['filters']=_[_0x01b2('0x4b')](_0x3bb628[_0x01b2('0x49')],_0x3bb628['query']);_0x32e425[_0x01b2('0x4a')]=_[_0x01b2('0x4b')](_0x3bb628[_0x01b2('0x49')],qs['fields'](_0x180ffc[_0x01b2('0x46')]['fields']));_0x32e425[_0x01b2('0x4a')]=_0x32e425[_0x01b2('0x4a')][_0x01b2('0x4d')]?_0x32e425[_0x01b2('0x4a')]:_0x3bb628['model'];_0x32e425[_0x01b2('0x50')]=qs[_0x01b2('0x51')](_0x180ffc[_0x01b2('0x46')][_0x01b2('0x51')]);_0x32e425[_0x01b2('0x52')]=qs['filters'](_[_0x01b2('0x53')](_0x180ffc[_0x01b2('0x46')],_0x3bb628[_0x01b2('0x48')]));if(_0x180ffc[_0x01b2('0x46')][_0x01b2('0x54')]){_0x32e425[_0x01b2('0x52')]=_['merge'](_0x32e425[_0x01b2('0x52')],{'$or':_[_0x01b2('0x41')](_0x32e425[_0x01b2('0x4a')],function(_0x36e4f8){var _0x4922e2={};_0x4922e2[_0x36e4f8]={'$like':'%'+_0x180ffc[_0x01b2('0x46')][_0x01b2('0x54')]+'%'};return _0x4922e2;})});}_0x32e425=_[_0x01b2('0x55')]({},_0x32e425,_0x180ffc[_0x01b2('0x57')]);return _0x10d876[_0x01b2('0x113')](_0x32e425);}})['then'](function(_0x39fac5){if(_0x39fac5){_0x4a145c=_0x39fac5[_0x01b2('0x4d')];if(!_0x180ffc[_0x01b2('0x46')][_0x01b2('0x4e')](_0x01b2('0x4f'))){_0x32e425['limit']=qs['limit'](_0x180ffc[_0x01b2('0x46')][_0x01b2('0x34')]);_0x32e425[_0x01b2('0x33')]=qs[_0x01b2('0x33')](_0x180ffc[_0x01b2('0x46')][_0x01b2('0x33')]);}return _0x10d876['getAgents'](_0x32e425);}})[_0x01b2('0x24')](function(_0x441d51){if(_0x441d51){return _0x441d51?{'count':_0x4a145c,'rows':_0x441d51}:null;}})[_0x01b2('0x24')](respondWithResult(_0x204957,null))[_0x01b2('0x2e')](handleError(_0x204957,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 46159c7..cde382c 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 _0xd7ff=['save','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatWebsite','setMaxListeners'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd7ff,0x100));var _0xfd7f=function(_0x599aeb,_0x53d3eb){_0x599aeb=_0x599aeb-0x0;var _0x2d60ab=_0xd7ff[_0x599aeb];return _0x2d60ab;};'use strict';var EventEmitter=require(_0xfd7f('0x0'));var ChatWebsite=require(_0xfd7f('0x1'))['db'][_0xfd7f('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xfd7f('0x3')](0x0);var events={'afterCreate':_0xfd7f('0x4'),'afterUpdate':_0xfd7f('0x5'),'afterDestroy':'remove'};function emitEvent(_0x47ad85){return function(_0x3cfe57,_0x4034f5,_0x20e038){ChatWebsiteEvents[_0xfd7f('0x6')](_0x47ad85+':'+_0x3cfe57['id'],_0x3cfe57);ChatWebsiteEvents['emit'](_0x47ad85,_0x3cfe57);_0x20e038(null);};}for(var e in events){if(events[_0xfd7f('0x7')](e)){var event=events[e];ChatWebsite[_0xfd7f('0x8')](e,emitEvent(event));}}module[_0xfd7f('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0xe799=['events','ChatWebsite','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x2b7b7f,_0x583c3a){var _0x315e88=function(_0x49b392){while(--_0x49b392){_0x2b7b7f['push'](_0x2b7b7f['shift']());}};_0x315e88(++_0x583c3a);}(_0xe799,0x170));var _0x9e79=function(_0x4a46e3,_0x37906d){_0x4a46e3=_0x4a46e3-0x0;var _0x5b553c=_0xe799[_0x4a46e3];return _0x5b553c;};'use strict';var EventEmitter=require(_0x9e79('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x9e79('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9e79('0x2'),'afterUpdate':_0x9e79('0x3'),'afterDestroy':'remove'};function emitEvent(_0x34a40e){return function(_0x3f0a4f,_0x809ffd,_0x4cfc04){ChatWebsiteEvents[_0x9e79('0x4')](_0x34a40e+':'+_0x3f0a4f['id'],_0x3f0a4f);ChatWebsiteEvents['emit'](_0x34a40e,_0x3f0a4f);_0x4cfc04(null);};}for(var e in events){if(events[_0x9e79('0x5')](e)){var event=events[e];ChatWebsite[_0x9e79('0x6')](e,emitEvent(event));}}module[_0x9e79('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index a6cf302..99da5b5 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 _0x9c00=['path','rimraf','../../config/environment','./chatWebsite.attributes','exports','define','ChatWebsite','chat_websites','lodash','util','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9c00,0x1a0));var _0x09c0=function(_0xaca348,_0x4d3993){_0xaca348=_0xaca348-0x0;var _0x560057=_0x9c00[_0xaca348];return _0x560057;};'use strict';var _=require(_0x09c0('0x0'));var util=require(_0x09c0('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x09c0('0x2'));var BPromise=require(_0x09c0('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x09c0('0x4'));var rimraf=require(_0x09c0('0x5'));var config=require(_0x09c0('0x6'));var attributes=require(_0x09c0('0x7'));module[_0x09c0('0x8')]=function(_0x5914eb,_0x4d5fc3){return _0x5914eb[_0x09c0('0x9')](_0x09c0('0xa'),attributes,{'tableName':_0x09c0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8cc8=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','exports','ChatWebsite','chat_websites','lodash','util','../../config/logger'];(function(_0x4acfe3,_0x2d433b){var _0xcd8e79=function(_0x45929b){while(--_0x45929b){_0x4acfe3['push'](_0x4acfe3['shift']());}};_0xcd8e79(++_0x2d433b);}(_0x8cc8,0x177));var _0x88cc=function(_0x45ad2b,_0x50d0b9){_0x45ad2b=_0x45ad2b-0x0;var _0x289a91=_0x8cc8[_0x45ad2b];return _0x289a91;};'use strict';var _=require(_0x88cc('0x0'));var util=require(_0x88cc('0x1'));var logger=require(_0x88cc('0x2'))(_0x88cc('0x3'));var moment=require(_0x88cc('0x4'));var BPromise=require(_0x88cc('0x5'));var rp=require(_0x88cc('0x6'));var fs=require('fs');var path=require(_0x88cc('0x7'));var rimraf=require(_0x88cc('0x8'));var config=require(_0x88cc('0x9'));var attributes=require(_0x88cc('0xa'));module[_0x88cc('0xb')]=function(_0x1683f9,_0x525362){return _0x1683f9['define'](_0x88cc('0xc'),attributes,{'tableName':_0x88cc('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 3b5a071..cb09104 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 _0x9536=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash'];(function(_0x548e64,_0x29e562){var _0x47d34e=function(_0x397256){while(--_0x397256){_0x548e64['push'](_0x548e64['shift']());}};_0x47d34e(++_0x29e562);}(_0x9536,0x179));var _0x6953=function(_0x868b7c,_0xfa438b){_0x868b7c=_0x868b7c-0x0;var _0x21683c=_0x9536[_0x868b7c];return _0x21683c;};'use strict';var _=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var moment=require(_0x6953('0x2'));var BPromise=require(_0x6953('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6953('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x6953('0x5'));var logger=require(_0x6953('0x6'))(_0x6953('0x7'));var config=require(_0x6953('0x8'));var jayson=require(_0x6953('0x9'));var client=jayson['client'][_0x6953('0xa')]({'port':0x232a});config[_0x6953('0xb')]=_[_0x6953('0xc')](config[_0x6953('0xb')],{'host':_0x6953('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6953('0xb')]));require(_0x6953('0xe'))[_0x6953('0xf')](socket);function respondWithRpcPromise(_0x4b505f,_0x41f41b,_0x465761){return new BPromise(function(_0x300c48,_0xb13f2c){return client[_0x6953('0x10')](_0x4b505f,_0x465761)[_0x6953('0x11')](function(_0x246534){logger[_0x6953('0x12')](_0x6953('0x13'),_0x41f41b,'request\x20sent');logger[_0x6953('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x41f41b,_0x6953('0x15'),JSON[_0x6953('0x16')](_0x246534));if(_0x246534[_0x6953('0x17')]){if(_0x246534[_0x6953('0x17')][_0x6953('0x18')]===0x1f4){logger[_0x6953('0x17')](_0x6953('0x13'),_0x41f41b,_0x246534[_0x6953('0x17')][_0x6953('0x19')]);return _0xb13f2c(_0x246534[_0x6953('0x17')][_0x6953('0x19')]);}logger['error']('ChatWebsite,\x20%s,\x20%s',_0x41f41b,_0x246534[_0x6953('0x17')][_0x6953('0x19')]);return _0x300c48(_0x246534[_0x6953('0x17')][_0x6953('0x19')]);}else{logger['info'](_0x6953('0x13'),_0x41f41b,_0x6953('0x15'));_0x300c48(_0x246534['result'][_0x6953('0x19')]);}})[_0x6953('0x1a')](function(_0x283cf4){logger[_0x6953('0x17')](_0x6953('0x13'),_0x41f41b,_0x283cf4);_0xb13f2c(_0x283cf4);});});} \ No newline at end of file +var _0x8952=['jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatWebsite.socket','then','info','request\x20sent','debug','stringify','code','error','message','ChatWebsite,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x45518f,_0x475a6b){var _0x198175=function(_0x40d333){while(--_0x40d333){_0x45518f['push'](_0x45518f['shift']());}};_0x198175(++_0x475a6b);}(_0x8952,0x17e));var _0x2895=function(_0x58a9d2,_0x32072e){_0x58a9d2=_0x58a9d2-0x0;var _0x4e80b2=_0x8952[_0x58a9d2];return _0x4e80b2;};'use strict';var _=require('lodash');var util=require(_0x2895('0x0'));var moment=require(_0x2895('0x1'));var BPromise=require(_0x2895('0x2'));var rs=require(_0x2895('0x3'));var fs=require('fs');var Redis=require(_0x2895('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2895('0x5'));var logger=require(_0x2895('0x6'))(_0x2895('0x7'));var config=require('../../config/environment');var jayson=require(_0x2895('0x8'));var client=jayson[_0x2895('0x9')][_0x2895('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2895('0xb')],{'host':_0x2895('0xc'),'port':0x18eb});var socket=require(_0x2895('0xd'))(new Redis(config[_0x2895('0xb')]));require(_0x2895('0xe'))['register'](socket);function respondWithRpcPromise(_0x14fb67,_0x5f2632,_0x428772){return new BPromise(function(_0x5af454,_0x5e66fc){return client['request'](_0x14fb67,_0x428772)[_0x2895('0xf')](function(_0x1829a2){logger[_0x2895('0x10')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'));logger[_0x2895('0x12')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x5f2632,_0x2895('0x11'),JSON[_0x2895('0x13')](_0x1829a2));if(_0x1829a2['error']){if(_0x1829a2['error'][_0x2895('0x14')]===0x1f4){logger[_0x2895('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5e66fc(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}logger[_0x2895('0x15')](_0x2895('0x17'),_0x5f2632,_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);return _0x5af454(_0x1829a2[_0x2895('0x15')][_0x2895('0x16')]);}else{logger[_0x2895('0x10')](_0x2895('0x17'),_0x5f2632,_0x2895('0x11'));_0x5af454(_0x1829a2[_0x2895('0x18')][_0x2895('0x16')]);}})[_0x2895('0x19')](function(_0x2fe8fe){logger[_0x2895('0x15')]('ChatWebsite,\x20%s,\x20%s',_0x5f2632,_0x2fe8fe);_0x5e66fc(_0x2fe8fe);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index dc273cf..a8bb8f7 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 _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0xecc551,_0x471cac){var _0x344658=function(_0x5ef130){while(--_0x5ef130){_0xecc551['push'](_0xecc551['shift']());}};_0x344658(++_0x471cac);}(_0xb10b,0x12a));var _0xbb10=function(_0x83f529,_0x3d55d7){_0x83f529=_0x83f529-0x0;var _0x4383b8=_0xb10b[_0x83f529];return _0x4383b8;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0xb10b,0x12a));var _0xbb10=function(_0x59e174,_0x43a286){_0x59e174=_0x59e174-0x0;var _0x2d581f=_0xb10b[_0x59e174];return _0x2d581f;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index ea0f1d5..6e2f44c 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 _0xcb11=['single','file','addLogo','server/files/images/avatars/','originalname','diskStorage','/:id/notify','notify','offline','/:id/interactions','addInteraction','/:id/proactive_actions','addProactiveActions','addAgents','put','delete','removeDispositions','/:id/users','removeAgents','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','index','get','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','/:id/avatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','getInteractions','getSnippet','/:id/applications','getApplications','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','post','create','addDisposition','addAnswer','join','root','server/files/images/logos/','format','%s-%s','now'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xcb11,0x104));var _0x1cb1=function(_0x9d39e9,_0x3aebc9){_0x9d39e9=_0x9d39e9-0x0;var _0x4ac75b=_0xcb11[_0x9d39e9];return _0x4ac75b;};'use strict';var multer=require(_0x1cb1('0x0'));var util=require(_0x1cb1('0x1'));var path=require('path');var timeout=require(_0x1cb1('0x2'));var express=require('express');var router=express[_0x1cb1('0x3')]();var auth=require(_0x1cb1('0x4'));var interaction=require(_0x1cb1('0x5'));var config=require('../../config/environment');var controller=require(_0x1cb1('0x6'));router['get']('/',auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x1cb1('0x9')](_0x1cb1('0xa'),auth[_0x1cb1('0x7')](),controller[_0x1cb1('0xb')]);router[_0x1cb1('0x9')](_0x1cb1('0xc'),auth[_0x1cb1('0x7')](),controller[_0x1cb1('0xd')]);router['get'](_0x1cb1('0xe'),auth[_0x1cb1('0x7')](),controller[_0x1cb1('0xf')]);router[_0x1cb1('0x9')](_0x1cb1('0x10'),controller['getLogo']);router['get'](_0x1cb1('0x11'),controller['getAvatar']);router[_0x1cb1('0x9')](_0x1cb1('0x12'),controller['getCustomerAvatar']);router[_0x1cb1('0x9')](_0x1cb1('0x13'),controller[_0x1cb1('0x14')]);router[_0x1cb1('0x9')]('/:id/interactions',auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x15')]);router[_0x1cb1('0x9')]('/:id/snippet',controller[_0x1cb1('0x16')]);router['get'](_0x1cb1('0x17'),auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x18')]);router[_0x1cb1('0x9')]('/:id/proactive_actions',auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x19')]);router[_0x1cb1('0x9')](_0x1cb1('0x1a'),controller[_0x1cb1('0x1b')]);router['get'](_0x1cb1('0x1c'),auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x1d')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x1cb1('0x1e')]('/',auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x1f')]);router['post'](_0x1cb1('0xc'),auth['isAuthenticated'](),controller[_0x1cb1('0x20')]);router[_0x1cb1('0x1e')]('/:id/canned_answers',auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x21')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2f6a52,_0x424ada,_0x547ea4){_0x547ea4(null,path[_0x1cb1('0x22')](config[_0x1cb1('0x23')],_0x1cb1('0x24')));},'filename':function(_0x499284,_0x13fea3,_0xe2c4a0){_0xe2c4a0(null,util[_0x1cb1('0x25')](_0x1cb1('0x26'),Date[_0x1cb1('0x27')](),_0x13fea3['originalname']));}})});router[_0x1cb1('0x1e')](_0x1cb1('0x10'),upload[_0x1cb1('0x28')](_0x1cb1('0x29')),controller[_0x1cb1('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xb68b41,_0x13c861,_0x1ed268){_0x1ed268(null,path['join'](config[_0x1cb1('0x23')],_0x1cb1('0x2b')));},'filename':function(_0x9bd842,_0x165e09,_0xdb13f1){_0xdb13f1(null,util[_0x1cb1('0x25')](_0x1cb1('0x26'),Date[_0x1cb1('0x27')](),_0x165e09[_0x1cb1('0x2c')]));}})});router[_0x1cb1('0x1e')](_0x1cb1('0x11'),upload[_0x1cb1('0x28')](_0x1cb1('0x29')),controller['addAvatar']);var upload=multer({'storage':multer[_0x1cb1('0x2d')]({'destination':function(_0x563a09,_0x3e7620,_0x56b7ee){_0x56b7ee(null,path[_0x1cb1('0x22')](config[_0x1cb1('0x23')],_0x1cb1('0x2b')));},'filename':function(_0x39a0c4,_0x28582e,_0x1527fd){_0x1527fd(null,util[_0x1cb1('0x25')]('%s-%s',Date['now'](),_0x28582e['originalname']));}})});router[_0x1cb1('0x1e')](_0x1cb1('0x12'),upload[_0x1cb1('0x28')](_0x1cb1('0x29')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5ac939,_0xfc6087,_0x1f405a){_0x1f405a(null,path[_0x1cb1('0x22')](config[_0x1cb1('0x23')],_0x1cb1('0x2b')));},'filename':function(_0x534013,_0x213b7d,_0x2164b4){_0x2164b4(null,util[_0x1cb1('0x25')](_0x1cb1('0x26'),Date['now'](),_0x213b7d['originalname']));}})});router[_0x1cb1('0x1e')](_0x1cb1('0x13'),upload[_0x1cb1('0x28')]('file'),controller['addSystemAvatar']);router[_0x1cb1('0x1e')](_0x1cb1('0x2e'),controller[_0x1cb1('0x2f')]);router[_0x1cb1('0x1e')]('/:id/offline',controller[_0x1cb1('0x30')]);router['post'](_0x1cb1('0x31'),auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x32')]);router['post'](_0x1cb1('0x17'),auth['isAuthenticated'](),controller['addApplications']);router['post'](_0x1cb1('0x33'),auth['isAuthenticated'](),controller[_0x1cb1('0x34')]);router[_0x1cb1('0x1e')]('/:id/users',auth[_0x1cb1('0x7')](),controller[_0x1cb1('0x35')]);router[_0x1cb1('0x36')](_0x1cb1('0xa'),auth[_0x1cb1('0x7')](),controller['update']);router['delete']('/:id',auth[_0x1cb1('0x7')](),controller['destroy']);router[_0x1cb1('0x37')](_0x1cb1('0xc'),auth['isAuthenticated'](),controller[_0x1cb1('0x38')]);router['delete']('/:id/canned_answers',auth[_0x1cb1('0x7')](),controller['removeAnswers']);router['delete'](_0x1cb1('0x39'),auth['isAuthenticated'](),controller[_0x1cb1('0x3a')]);module[_0x1cb1('0x3b')]=router; \ No newline at end of file +var _0x84a3=['/:id/fields','getOfflineMessages','getAgents','post','create','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addAvatar','addCustomerAvatar','addSystemAvatar','notify','/:id/offline','offline','addInteraction','addProactiveActions','/:id/users','put','destroy','removeDispositions','removeAnswers','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','index','describe','/:id','/:id/dispositions','/:id/logo','getLogo','getAvatar','/:id/customer_avatar','getCustomerAvatar','/:id/system_avatar','/:id/interactions','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions'];(function(_0xcea56e,_0x2d56b7){var _0x1e5b50=function(_0x3d04cd){while(--_0x3d04cd){_0xcea56e['push'](_0xcea56e['shift']());}};_0x1e5b50(++_0x2d56b7);}(_0x84a3,0x189));var _0x384a=function(_0x4667d1,_0x2af625){_0x4667d1=_0x4667d1-0x0;var _0x276641=_0x84a3[_0x4667d1];return _0x276641;};'use strict';var multer=require(_0x384a('0x0'));var util=require(_0x384a('0x1'));var path=require(_0x384a('0x2'));var timeout=require(_0x384a('0x3'));var express=require(_0x384a('0x4'));var router=express[_0x384a('0x5')]();var auth=require(_0x384a('0x6'));var interaction=require(_0x384a('0x7'));var config=require(_0x384a('0x8'));var controller=require(_0x384a('0x9'));router[_0x384a('0xa')]('/',auth[_0x384a('0xb')](),controller[_0x384a('0xc')]);router[_0x384a('0xa')]('/describe',auth['isAuthenticated'](),controller[_0x384a('0xd')]);router[_0x384a('0xa')](_0x384a('0xe'),auth[_0x384a('0xb')](),controller['show']);router['get'](_0x384a('0xf'),auth[_0x384a('0xb')](),controller['getDispositions']);router[_0x384a('0xa')]('/:id/canned_answers',auth[_0x384a('0xb')](),controller['getAnswers']);router[_0x384a('0xa')](_0x384a('0x10'),controller[_0x384a('0x11')]);router[_0x384a('0xa')]('/:id/avatar',controller[_0x384a('0x12')]);router['get'](_0x384a('0x13'),controller[_0x384a('0x14')]);router['get'](_0x384a('0x15'),controller['getSystemAvatar']);router[_0x384a('0xa')](_0x384a('0x16'),auth[_0x384a('0xb')](),controller['getInteractions']);router['get']('/:id/snippet',controller['getSnippet']);router[_0x384a('0xa')](_0x384a('0x17'),auth['isAuthenticated'](),controller[_0x384a('0x18')]);router[_0x384a('0xa')](_0x384a('0x19'),auth[_0x384a('0xb')](),controller[_0x384a('0x1a')]);router[_0x384a('0xa')](_0x384a('0x1b'),controller['getFields']);router['get']('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x384a('0x1c')]);router['get']('/:id/users',auth[_0x384a('0xb')](),controller[_0x384a('0x1d')]);router[_0x384a('0x1e')]('/',auth['isAuthenticated'](),controller[_0x384a('0x1f')]);router[_0x384a('0x1e')](_0x384a('0xf'),auth[_0x384a('0xb')](),controller['addDisposition']);router[_0x384a('0x1e')](_0x384a('0x20'),auth['isAuthenticated'](),controller[_0x384a('0x21')]);var upload=multer({'storage':multer[_0x384a('0x22')]({'destination':function(_0x2cf7f3,_0x48398f,_0x39651f){_0x39651f(null,path[_0x384a('0x23')](config[_0x384a('0x24')],_0x384a('0x25')));},'filename':function(_0x27b001,_0x157fb2,_0x3c79d4){_0x3c79d4(null,util[_0x384a('0x26')](_0x384a('0x27'),Date[_0x384a('0x28')](),_0x157fb2[_0x384a('0x29')]));}})});router[_0x384a('0x1e')](_0x384a('0x10'),upload[_0x384a('0x2a')]('file'),controller['addLogo']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3b08ba,_0x39893b,_0x3151f8){_0x3151f8(null,path[_0x384a('0x23')](config[_0x384a('0x24')],'server/files/images/avatars/'));},'filename':function(_0x16edd5,_0xeb9252,_0x1cf86d){_0x1cf86d(null,util[_0x384a('0x26')](_0x384a('0x27'),Date[_0x384a('0x28')](),_0xeb9252[_0x384a('0x29')]));}})});router[_0x384a('0x1e')]('/:id/avatar',upload[_0x384a('0x2a')](_0x384a('0x2b')),controller[_0x384a('0x2c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x145e48,_0x7367de,_0x1d5907){_0x1d5907(null,path[_0x384a('0x23')](config[_0x384a('0x24')],'server/files/images/avatars/'));},'filename':function(_0x4a0889,_0x5994ca,_0x596b43){_0x596b43(null,util['format'](_0x384a('0x27'),Date[_0x384a('0x28')](),_0x5994ca[_0x384a('0x29')]));}})});router[_0x384a('0x1e')](_0x384a('0x13'),upload[_0x384a('0x2a')](_0x384a('0x2b')),controller[_0x384a('0x2d')]);var upload=multer({'storage':multer[_0x384a('0x22')]({'destination':function(_0x1a5ef7,_0xfea54e,_0x517a7d){_0x517a7d(null,path[_0x384a('0x23')](config[_0x384a('0x24')],'server/files/images/avatars/'));},'filename':function(_0x4fe994,_0x37dc09,_0x169868){_0x169868(null,util[_0x384a('0x26')](_0x384a('0x27'),Date[_0x384a('0x28')](),_0x37dc09[_0x384a('0x29')]));}})});router[_0x384a('0x1e')](_0x384a('0x15'),upload[_0x384a('0x2a')]('file'),controller[_0x384a('0x2e')]);router[_0x384a('0x1e')]('/:id/notify',controller[_0x384a('0x2f')]);router['post'](_0x384a('0x30'),controller[_0x384a('0x31')]);router[_0x384a('0x1e')]('/:id/interactions',auth[_0x384a('0xb')](),controller[_0x384a('0x32')]);router[_0x384a('0x1e')]('/:id/applications',auth[_0x384a('0xb')](),controller['addApplications']);router[_0x384a('0x1e')](_0x384a('0x19'),auth[_0x384a('0xb')](),controller[_0x384a('0x33')]);router['post'](_0x384a('0x34'),auth[_0x384a('0xb')](),controller['addAgents']);router[_0x384a('0x35')](_0x384a('0xe'),auth[_0x384a('0xb')](),controller['update']);router['delete'](_0x384a('0xe'),auth[_0x384a('0xb')](),controller[_0x384a('0x36')]);router['delete'](_0x384a('0xf'),auth[_0x384a('0xb')](),controller[_0x384a('0x37')]);router['delete'](_0x384a('0x20'),auth[_0x384a('0xb')](),controller[_0x384a('0x38')]);router[_0x384a('0x39')](_0x384a('0x34'),auth[_0x384a('0xb')](),controller[_0x384a('0x3a')]);module[_0x384a('0x3b')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index bcf127f..aadb533 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 _0x6924=['STRING','name','sequelize'];(function(_0x100654,_0x4ae04b){var _0x1e9b9f=function(_0x8d69d6){while(--_0x8d69d6){_0x100654['push'](_0x100654['shift']());}};_0x1e9b9f(++_0x4ae04b);}(_0x6924,0x6e));var _0x4692=function(_0xea34da,_0x41ffbc){_0xea34da=_0xea34da-0x0;var _0x225abd=_0x6924[_0xea34da];return _0x225abd;};'use strict';var Sequelize=require(_0x4692('0x0'));module['exports']={'name':{'type':Sequelize[_0x4692('0x1')],'unique':_0x4692('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4692('0x1')]},'companyId':{'type':Sequelize[_0x4692('0x1')]},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x4692('0x1')]},'fax':{'type':Sequelize[_0x4692('0x1')]},'type':{'type':Sequelize[_0x4692('0x1')]},'street':{'type':Sequelize[_0x4692('0x1')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x4692('0x1')]},'country':{'type':Sequelize[_0x4692('0x1')]},'email':{'type':Sequelize[_0x4692('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4692('0x1')]},'sStreet':{'type':Sequelize[_0x4692('0x1')]},'sPostalCode':{'type':Sequelize[_0x4692('0x1')]},'sCity':{'type':Sequelize[_0x4692('0x1')]},'sCountry':{'type':Sequelize[_0x4692('0x1')]},'description':{'type':Sequelize[_0x4692('0x1')]}}; \ No newline at end of file +var _0xa3dc=['STRING','name','sequelize'];(function(_0x351044,_0x59bc69){var _0x331a6a=function(_0x4426f5){while(--_0x4426f5){_0x351044['push'](_0x351044['shift']());}};_0x331a6a(++_0x59bc69);}(_0xa3dc,0x1a6));var _0xca3d=function(_0x4c1db2,_0x32dc02){_0x4c1db2=_0x4c1db2-0x0;var _0x388daa=_0xa3dc[_0x4c1db2];return _0x388daa;};'use strict';var Sequelize=require(_0xca3d('0x0'));module['exports']={'name':{'type':Sequelize[_0xca3d('0x1')],'unique':_0xca3d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize['STRING']},'companyId':{'type':Sequelize[_0xca3d('0x1')]},'website':{'type':Sequelize[_0xca3d('0x1')]},'phone':{'type':Sequelize[_0xca3d('0x1')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xca3d('0x1')]},'street':{'type':Sequelize[_0xca3d('0x1')]},'postalCode':{'type':Sequelize[_0xca3d('0x1')]},'city':{'type':Sequelize[_0xca3d('0x1')]},'country':{'type':Sequelize[_0xca3d('0x1')]},'email':{'type':Sequelize[_0xca3d('0x1')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xca3d('0x1')]},'sStreet':{'type':Sequelize[_0xca3d('0x1')]},'sPostalCode':{'type':Sequelize[_0xca3d('0x1')]},'sCity':{'type':Sequelize[_0xca3d('0x1')]},'sCountry':{'type':Sequelize[_0xca3d('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 95ef05c..721c07b 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 _0xb08b=['reject','save','update','then','destroy','get','Companies','error','stack','name','send','index','CmCompany','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','options','includeAll','include','findAll','rows','params','rawAttributes','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','ids','omit','getContacts','findOne','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x1f0f99,_0x1c3622){var _0x375d69=function(_0x14fd9c){while(--_0x14fd9c){_0x1f0f99['push'](_0x1f0f99['shift']());}};_0x375d69(++_0x1c3622);}(_0xb08b,0x17f));var _0xbb08=function(_0x2356a0,_0x4620ae){_0x2356a0=_0x2356a0-0x0;var _0x1d7e6a=_0xb08b[_0x2356a0];return _0x1d7e6a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xbb08('0x0'));var jsonpatch=require(_0xbb08('0x1'));var rp=require(_0xbb08('0x2'));var moment=require(_0xbb08('0x3'));var BPromise=require(_0xbb08('0x4'));var Mustache=require(_0xbb08('0x5'));var util=require('util');var path=require(_0xbb08('0x6'));var sox=require(_0xbb08('0x7'));var csv=require(_0xbb08('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbb08('0x9'));var squel=require(_0xbb08('0xa'));var crypto=require(_0xbb08('0xb'));var jsforce=require(_0xbb08('0xc'));var deskjs=require(_0xbb08('0xd'));var toCsv=require(_0xbb08('0x8'));var querystring=require(_0xbb08('0xe'));var Papa=require(_0xbb08('0xf'));var Redis=require(_0xbb08('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xbb08('0x11'));var as=require(_0xbb08('0x12'));var hardwareService=require(_0xbb08('0x13'));var logger=require(_0xbb08('0x14'))(_0xbb08('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xbb08('0x16'))['db'];function respondWithStatusCode(_0x47d4e4,_0x530371){_0x530371=_0x530371||0xcc;return function(_0x4f3a27){if(_0x4f3a27){return _0x47d4e4[_0xbb08('0x17')](_0x530371);}return _0x47d4e4[_0xbb08('0x18')](_0x530371)[_0xbb08('0x19')]();};}function respondWithResult(_0x1ebb71,_0x2d4958){_0x2d4958=_0x2d4958||0xc8;return function(_0x31d2f4){if(_0x31d2f4){return _0x1ebb71[_0xbb08('0x18')](_0x2d4958)[_0xbb08('0x1a')](_0x31d2f4);}};}function respondWithFilteredResult(_0x10c7a4,_0x20f39f){return function(_0x393721){if(_0x393721){var _0x2fc1c2=_0x393721[_0xbb08('0x1b')],_0x280a29=_0x20f39f[_0xbb08('0x1c')],_0x5b76af=_0x20f39f['offset']+_0x20f39f[_0xbb08('0x1d')],_0x5016e6;if(_0x5b76af>=_0x2fc1c2){_0x5b76af=_0x2fc1c2;_0x5016e6=0xc8;}else{_0x5016e6=0xce;}_0x10c7a4[_0xbb08('0x18')](_0x5016e6);return _0x10c7a4[_0xbb08('0x1e')](_0xbb08('0x1f'),_0x280a29+'-'+_0x5b76af+'/'+_0x2fc1c2)[_0xbb08('0x1a')](_0x393721);}return null;};}function patchUpdates(_0x5567b2){return function(_0x4d53a2){try{jsonpatch['apply'](_0x4d53a2,_0x5567b2,!![]);}catch(_0x31582e){return BPromise[_0xbb08('0x20')](_0x31582e);}return _0x4d53a2[_0xbb08('0x21')]();};}function saveUpdates(_0xbd94a7,_0xcba88b){return function(_0x5a4db2){if(_0x5a4db2){return _0x5a4db2[_0xbb08('0x22')](_0xbd94a7)[_0xbb08('0x23')](function(_0x44b4eb){return _0x44b4eb;});}return null;};}function removeEntity(_0x4d9203,_0x107dd7){return function(_0x225265){if(_0x225265){return _0x225265[_0xbb08('0x24')]()[_0xbb08('0x23')](function(){var _0x4d341b=_0x225265[_0xbb08('0x25')]({'plain':!![]});var _0x5bb520=_0xbb08('0x26');return db['UserProfileResource'][_0xbb08('0x24')]({'where':{'type':_0x5bb520,'resourceId':_0x4d341b['id']}})[_0xbb08('0x23')](function(){return _0x225265;});})['then'](function(){_0x4d9203[_0xbb08('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eaac6,_0x6cc53c){return function(_0x1986cf){if(!_0x1986cf){_0x2eaac6['sendStatus'](0x194);}return _0x1986cf;};}function handleError(_0x24fdc1,_0xccea5){_0xccea5=_0xccea5||0x1f4;return function(_0x1e5e6f){logger[_0xbb08('0x27')](_0x1e5e6f[_0xbb08('0x28')]);if(_0x1e5e6f[_0xbb08('0x29')]){delete _0x1e5e6f[_0xbb08('0x29')];}_0x24fdc1['status'](_0xccea5)[_0xbb08('0x2a')](_0x1e5e6f);};}exports[_0xbb08('0x2b')]=function(_0x1ab745,_0x27c81f){var _0x1d2c75={},_0x10ce79={},_0x25fe50={'count':0x0,'rows':[]};return db[_0xbb08('0x2c')]['describe']()[_0xbb08('0x23')](function(_0x58c99b){_0x10ce79['model']=_[_0xbb08('0x2d')](_0x58c99b);_0x10ce79[_0xbb08('0x2e')]=_[_0xbb08('0x2d')](_0x1ab745['query']);_0x10ce79[_0xbb08('0x2f')]=_[_0xbb08('0x30')](_0x10ce79[_0xbb08('0x31')],_0x10ce79[_0xbb08('0x2e')]);_0x1d2c75['attributes']=_[_0xbb08('0x30')](_0x10ce79[_0xbb08('0x31')],qs['fields'](_0x1ab745[_0xbb08('0x2e')][_0xbb08('0x32')]));_0x1d2c75['attributes']=_0x1d2c75[_0xbb08('0x33')][_0xbb08('0x34')]?_0x1d2c75[_0xbb08('0x33')]:_0x10ce79['model'];if(!_0x1ab745[_0xbb08('0x2e')][_0xbb08('0x35')](_0xbb08('0x36'))){_0x1d2c75['limit']=qs[_0xbb08('0x1d')](_0x1ab745['query']['limit']);_0x1d2c75[_0xbb08('0x1c')]=qs['offset'](_0x1ab745[_0xbb08('0x2e')]['offset']);}_0x1d2c75[_0xbb08('0x37')]=qs[_0xbb08('0x38')](_0x1ab745[_0xbb08('0x2e')]['sort']);_0x1d2c75[_0xbb08('0x39')]=qs[_0xbb08('0x2f')](_[_0xbb08('0x3a')](_0x1ab745['query'],_0x10ce79[_0xbb08('0x2f')]));if(_0x1ab745['query'][_0xbb08('0x3b')]){_0x1d2c75[_0xbb08('0x39')]=_[_0xbb08('0x3c')](_0x1d2c75[_0xbb08('0x39')],{'$or':_[_0xbb08('0x3d')](_0x1d2c75[_0xbb08('0x33')],function(_0x3c05ce){var _0x4e8612={};_0x4e8612[_0x3c05ce]={'$like':'%'+_0x1ab745[_0xbb08('0x2e')][_0xbb08('0x3b')]+'%'};return _0x4e8612;})});}_0x1d2c75=_['merge']({},_0x1d2c75,_0x1ab745[_0xbb08('0x3e')]);var _0x248f40={'where':_0x1d2c75['where']};return db[_0xbb08('0x2c')]['count'](_0x248f40)[_0xbb08('0x23')](function(_0x54e54e){_0x25fe50['count']=_0x54e54e;if(_0x1ab745[_0xbb08('0x2e')][_0xbb08('0x3f')]){_0x1d2c75[_0xbb08('0x40')]=[{'all':!![]}];}return db[_0xbb08('0x2c')][_0xbb08('0x41')](_0x1d2c75);})[_0xbb08('0x23')](function(_0x25623a){_0x25fe50[_0xbb08('0x42')]=_0x25623a;return _0x25fe50;})[_0xbb08('0x23')](respondWithFilteredResult(_0x27c81f,_0x1d2c75))['catch'](handleError(_0x27c81f,null));});};exports['show']=function(_0x14f5c5,_0x54b2ca){var _0x148378={'raw':![],'where':{'id':_0x14f5c5[_0xbb08('0x43')]['id']}},_0x1ad55f={};_0x1ad55f[_0xbb08('0x31')]=_['keys'](db['CmCompany'][_0xbb08('0x44')]);_0x1ad55f[_0xbb08('0x2e')]=_['keys'](_0x14f5c5['query']);_0x1ad55f['filters']=_[_0xbb08('0x30')](_0x1ad55f[_0xbb08('0x31')],_0x1ad55f[_0xbb08('0x2e')]);_0x148378[_0xbb08('0x33')]=_[_0xbb08('0x30')](_0x1ad55f[_0xbb08('0x31')],qs[_0xbb08('0x32')](_0x14f5c5[_0xbb08('0x2e')]['fields']));_0x148378['attributes']=_0x148378['attributes']['length']?_0x148378[_0xbb08('0x33')]:_0x1ad55f[_0xbb08('0x31')];if(_0x14f5c5[_0xbb08('0x2e')][_0xbb08('0x3f')]){_0x148378[_0xbb08('0x40')]=[{'all':!![]}];}_0x148378=_[_0xbb08('0x3c')]({},_0x148378,_0x14f5c5[_0xbb08('0x3e')]);return db[_0xbb08('0x2c')][_0xbb08('0x45')](_0x148378)['then'](handleEntityNotFound(_0x54b2ca,null))[_0xbb08('0x23')](respondWithResult(_0x54b2ca,null))['catch'](handleError(_0x54b2ca,null));};exports[_0xbb08('0x46')]=function(_0x3decb0,_0x19c4db){return db[_0xbb08('0x2c')][_0xbb08('0x46')](_0x3decb0['body'],{})['then'](function(_0x3666a9){var _0x1acbe0=_0x3decb0['user']['get']({'plain':!![]});if(!_0x1acbe0)throw new Error(_0xbb08('0x47'));if(_0x1acbe0['role']==='user'){var _0x4f48c0=_0x3666a9[_0xbb08('0x25')]({'plain':!![]});var _0x33607a='Companies';return db[_0xbb08('0x48')][_0xbb08('0x45')]({'where':{'name':_0x33607a,'userProfileId':_0x1acbe0[_0xbb08('0x49')]},'raw':!![]})[_0xbb08('0x23')](function(_0x43b5eb){if(_0x43b5eb&&_0x43b5eb[_0xbb08('0x4a')]===0x0){return db['UserProfileResource'][_0xbb08('0x46')]({'name':_0x4f48c0['name'],'resourceId':_0x4f48c0['id'],'type':_0x43b5eb[_0xbb08('0x29')],'sectionId':_0x43b5eb['id']},{})[_0xbb08('0x23')](function(){return _0x3666a9;});}else{return _0x3666a9;}})[_0xbb08('0x4b')](function(_0x2035c9){logger['error'](_0xbb08('0x4c'),_0x2035c9);throw _0x2035c9;});}return _0x3666a9;})[_0xbb08('0x23')](respondWithResult(_0x19c4db,0xc9))[_0xbb08('0x4b')](handleError(_0x19c4db,null));};exports[_0xbb08('0x22')]=function(_0x16004a,_0x54d648){if(_0x16004a[_0xbb08('0x4d')]['id']){delete _0x16004a[_0xbb08('0x4d')]['id'];}return db[_0xbb08('0x2c')][_0xbb08('0x45')]({'where':{'id':_0x16004a[_0xbb08('0x43')]['id']}})[_0xbb08('0x23')](handleEntityNotFound(_0x54d648,null))['then'](saveUpdates(_0x16004a['body'],null))[_0xbb08('0x23')](respondWithResult(_0x54d648,null))[_0xbb08('0x4b')](handleError(_0x54d648,null));};exports[_0xbb08('0x24')]=function(_0x2e2096,_0x2bcdbd){return db[_0xbb08('0x2c')][_0xbb08('0x45')]({'where':{'id':_0x2e2096[_0xbb08('0x43')]['id']}})[_0xbb08('0x23')](handleEntityNotFound(_0x2bcdbd,null))[_0xbb08('0x23')](removeEntity(_0x2bcdbd,null))[_0xbb08('0x4b')](handleError(_0x2bcdbd,null));};exports[_0xbb08('0x4e')]=function(_0xd538d2,_0x4446a4){return db[_0xbb08('0x2c')]['describe']()[_0xbb08('0x23')](respondWithResult(_0x4446a4,null))[_0xbb08('0x4b')](handleError(_0x4446a4,null));};exports['addContacts']=function(_0x5038cf,_0x4ce75d,_0x51f2f5){return db['CmContact'][_0xbb08('0x45')]({'where':{'id':_0x5038cf[_0xbb08('0x43')]['id']}})[_0xbb08('0x23')](handleEntityNotFound(_0x4ce75d,null))['then'](function(_0x565acc){if(_0x565acc){return _0x565acc['addContacts'](_0x5038cf[_0xbb08('0x4d')][_0xbb08('0x4f')],_[_0xbb08('0x50')](_0x5038cf[_0xbb08('0x4d')],[_0xbb08('0x4f'),'id'])||{});}})[_0xbb08('0x23')](respondWithResult(_0x4ce75d,null))[_0xbb08('0x4b')](handleError(_0x4ce75d,null));};exports[_0xbb08('0x51')]=function(_0x272b7a,_0xfbdfea,_0x5eb069){var _0x529728={};var _0x447433={};var _0x2132ba;var _0x5b155e;return db[_0xbb08('0x2c')][_0xbb08('0x52')]({'where':{'id':_0x272b7a[_0xbb08('0x43')]['id']}})[_0xbb08('0x23')](handleEntityNotFound(_0xfbdfea,null))['then'](function(_0x51573b){if(_0x51573b){_0x2132ba=_0x51573b;_0x447433[_0xbb08('0x31')]=_[_0xbb08('0x2d')](db['CmContact'][_0xbb08('0x44')]);_0x447433[_0xbb08('0x2e')]=_[_0xbb08('0x2d')](_0x272b7a[_0xbb08('0x2e')]);_0x447433[_0xbb08('0x2f')]=_[_0xbb08('0x30')](_0x447433['model'],_0x447433[_0xbb08('0x2e')]);_0x529728[_0xbb08('0x33')]=_[_0xbb08('0x30')](_0x447433[_0xbb08('0x31')],qs[_0xbb08('0x32')](_0x272b7a[_0xbb08('0x2e')][_0xbb08('0x32')]));_0x529728[_0xbb08('0x33')]=_0x529728['attributes'][_0xbb08('0x34')]?_0x529728['attributes']:_0x447433[_0xbb08('0x31')];_0x529728[_0xbb08('0x37')]=qs[_0xbb08('0x38')](_0x272b7a[_0xbb08('0x2e')]['sort']);_0x529728[_0xbb08('0x39')]=qs[_0xbb08('0x2f')](_[_0xbb08('0x3a')](_0x272b7a[_0xbb08('0x2e')],_0x447433[_0xbb08('0x2f')]));if(_0x272b7a[_0xbb08('0x2e')][_0xbb08('0x3b')]){_0x529728['where']=_[_0xbb08('0x3c')](_0x529728[_0xbb08('0x39')],{'$or':_[_0xbb08('0x3d')](_0x529728[_0xbb08('0x33')],function(_0x2e2db0){var _0x59bb95={};_0x59bb95[_0x2e2db0]={'$like':'%'+_0x272b7a[_0xbb08('0x2e')][_0xbb08('0x3b')]+'%'};return _0x59bb95;})});}_0x529728=_['merge']({},_0x529728,_0x272b7a['options']);return _0x2132ba[_0xbb08('0x51')](_0x529728);}})[_0xbb08('0x23')](function(_0x3c5acf){if(_0x3c5acf){_0x5b155e=_0x3c5acf['length'];if(!_0x272b7a['query'][_0xbb08('0x35')]('nolimit')){_0x529728[_0xbb08('0x1d')]=qs[_0xbb08('0x1d')](_0x272b7a[_0xbb08('0x2e')][_0xbb08('0x1d')]);_0x529728['offset']=qs[_0xbb08('0x1c')](_0x272b7a[_0xbb08('0x2e')][_0xbb08('0x1c')]);}return _0x2132ba[_0xbb08('0x51')](_0x529728);}})[_0xbb08('0x23')](function(_0x20cde1){if(_0x20cde1){return _0x20cde1?{'count':_0x5b155e,'rows':_0x20cde1}:null;}})[_0xbb08('0x23')](respondWithResult(_0xfbdfea,null))['catch'](handleError(_0xfbdfea,null));}; \ No newline at end of file +var _0x4cb6=['limit','sort','where','pick','merge','options','includeAll','include','rows','show','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','Companies','UserProfileSection','userProfileId','autoAssociation','error','body','params','addContacts','CmContact','ids','omit','getContacts','rawAttributes','filter','map','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','json','count','offset','status','apply','save','update','then','destroy','get','UserProfileResource','name','index','CmCompany','describe','model','keys','query','filters','intersection','attributes','fields','nolimit'];(function(_0x42e25e,_0x46cfd1){var _0x1ed3a6=function(_0x3558e8){while(--_0x3558e8){_0x42e25e['push'](_0x42e25e['shift']());}};_0x1ed3a6(++_0x46cfd1);}(_0x4cb6,0x15f));var _0x64cb=function(_0xe33af7,_0x175816){_0xe33af7=_0xe33af7-0x0;var _0x5c88fc=_0x4cb6[_0xe33af7];return _0x5c88fc;};'use strict';var pdf=require(_0x64cb('0x0'));var emlformat=require(_0x64cb('0x1'));var rimraf=require(_0x64cb('0x2'));var zipdir=require(_0x64cb('0x3'));var jsonpatch=require(_0x64cb('0x4'));var rp=require(_0x64cb('0x5'));var moment=require('moment');var BPromise=require(_0x64cb('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x64cb('0x7'));var sox=require(_0x64cb('0x8'));var csv=require(_0x64cb('0x9'));var ejs=require(_0x64cb('0xa'));var fs=require('fs');var _=require(_0x64cb('0xb'));var squel=require(_0x64cb('0xc'));var crypto=require(_0x64cb('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x64cb('0xe'));var toCsv=require(_0x64cb('0x9'));var querystring=require(_0x64cb('0xf'));var Papa=require(_0x64cb('0x10'));var Redis=require(_0x64cb('0x11'));var authService=require(_0x64cb('0x12'));var qs=require(_0x64cb('0x13'));var as=require(_0x64cb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x64cb('0x15'))(_0x64cb('0x16'));var utils=require(_0x64cb('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3b3a3a,_0x3c8355){_0x3c8355=_0x3c8355||0xcc;return function(_0x19783f){if(_0x19783f){return _0x3b3a3a[_0x64cb('0x18')](_0x3c8355);}return _0x3b3a3a['status'](_0x3c8355)[_0x64cb('0x19')]();};}function respondWithResult(_0x419dee,_0x24d454){_0x24d454=_0x24d454||0xc8;return function(_0x189626){if(_0x189626){return _0x419dee['status'](_0x24d454)[_0x64cb('0x1a')](_0x189626);}};}function respondWithFilteredResult(_0x43f01e,_0x558433){return function(_0x225179){if(_0x225179){var _0x35f7df=_0x225179[_0x64cb('0x1b')],_0x81de2a=_0x558433[_0x64cb('0x1c')],_0x44e8d0=_0x558433['offset']+_0x558433['limit'],_0x33e8c7;if(_0x44e8d0>=_0x35f7df){_0x44e8d0=_0x35f7df;_0x33e8c7=0xc8;}else{_0x33e8c7=0xce;}_0x43f01e[_0x64cb('0x1d')](_0x33e8c7);return _0x43f01e['set']('Content-Range',_0x81de2a+'-'+_0x44e8d0+'/'+_0x35f7df)[_0x64cb('0x1a')](_0x225179);}return null;};}function patchUpdates(_0x2ee0b0){return function(_0x6454e4){try{jsonpatch[_0x64cb('0x1e')](_0x6454e4,_0x2ee0b0,!![]);}catch(_0x5bcd30){return BPromise['reject'](_0x5bcd30);}return _0x6454e4[_0x64cb('0x1f')]();};}function saveUpdates(_0x5a58ba,_0x42c966){return function(_0x5cb18f){if(_0x5cb18f){return _0x5cb18f[_0x64cb('0x20')](_0x5a58ba)[_0x64cb('0x21')](function(_0xe97151){return _0xe97151;});}return null;};}function removeEntity(_0x7b8715,_0x42dd60){return function(_0xfe44bf){if(_0xfe44bf){return _0xfe44bf[_0x64cb('0x22')]()[_0x64cb('0x21')](function(){var _0x174f13=_0xfe44bf[_0x64cb('0x23')]({'plain':!![]});var _0x5cdd34='Companies';return db[_0x64cb('0x24')][_0x64cb('0x22')]({'where':{'type':_0x5cdd34,'resourceId':_0x174f13['id']}})[_0x64cb('0x21')](function(){return _0xfe44bf;});})[_0x64cb('0x21')](function(){_0x7b8715['status'](0xcc)[_0x64cb('0x19')]();});}};}function handleEntityNotFound(_0x1a60ad,_0x15f5a1){return function(_0x242610){if(!_0x242610){_0x1a60ad[_0x64cb('0x18')](0x194);}return _0x242610;};}function handleError(_0x565ffb,_0x262b09){_0x262b09=_0x262b09||0x1f4;return function(_0x388c88){logger['error'](_0x388c88['stack']);if(_0x388c88[_0x64cb('0x25')]){delete _0x388c88[_0x64cb('0x25')];}_0x565ffb[_0x64cb('0x1d')](_0x262b09)['send'](_0x388c88);};}exports[_0x64cb('0x26')]=function(_0x509c4a,_0x52f7f5){var _0x254532={},_0x5c1913={},_0x37a4ac={'count':0x0,'rows':[]};return db[_0x64cb('0x27')][_0x64cb('0x28')]()['then'](function(_0x5810ab){_0x5c1913[_0x64cb('0x29')]=_[_0x64cb('0x2a')](_0x5810ab);_0x5c1913[_0x64cb('0x2b')]=_['keys'](_0x509c4a[_0x64cb('0x2b')]);_0x5c1913[_0x64cb('0x2c')]=_[_0x64cb('0x2d')](_0x5c1913[_0x64cb('0x29')],_0x5c1913[_0x64cb('0x2b')]);_0x254532[_0x64cb('0x2e')]=_[_0x64cb('0x2d')](_0x5c1913[_0x64cb('0x29')],qs['fields'](_0x509c4a[_0x64cb('0x2b')][_0x64cb('0x2f')]));_0x254532[_0x64cb('0x2e')]=_0x254532[_0x64cb('0x2e')]['length']?_0x254532[_0x64cb('0x2e')]:_0x5c1913[_0x64cb('0x29')];if(!_0x509c4a[_0x64cb('0x2b')]['hasOwnProperty'](_0x64cb('0x30'))){_0x254532[_0x64cb('0x31')]=qs[_0x64cb('0x31')](_0x509c4a[_0x64cb('0x2b')][_0x64cb('0x31')]);_0x254532[_0x64cb('0x1c')]=qs['offset'](_0x509c4a[_0x64cb('0x2b')]['offset']);}_0x254532['order']=qs[_0x64cb('0x32')](_0x509c4a['query']['sort']);_0x254532[_0x64cb('0x33')]=qs[_0x64cb('0x2c')](_[_0x64cb('0x34')](_0x509c4a[_0x64cb('0x2b')],_0x5c1913[_0x64cb('0x2c')]));if(_0x509c4a[_0x64cb('0x2b')]['filter']){_0x254532[_0x64cb('0x33')]=_['merge'](_0x254532[_0x64cb('0x33')],{'$or':_['map'](_0x254532['attributes'],function(_0x16f96d){var _0x569303={};_0x569303[_0x16f96d]={'$like':'%'+_0x509c4a[_0x64cb('0x2b')]['filter']+'%'};return _0x569303;})});}_0x254532=_[_0x64cb('0x35')]({},_0x254532,_0x509c4a[_0x64cb('0x36')]);var _0x4722e1={'where':_0x254532[_0x64cb('0x33')]};return db[_0x64cb('0x27')][_0x64cb('0x1b')](_0x4722e1)[_0x64cb('0x21')](function(_0x59820b){_0x37a4ac[_0x64cb('0x1b')]=_0x59820b;if(_0x509c4a[_0x64cb('0x2b')][_0x64cb('0x37')]){_0x254532[_0x64cb('0x38')]=[{'all':!![]}];}return db[_0x64cb('0x27')]['findAll'](_0x254532);})[_0x64cb('0x21')](function(_0x2aa004){_0x37a4ac[_0x64cb('0x39')]=_0x2aa004;return _0x37a4ac;})[_0x64cb('0x21')](respondWithFilteredResult(_0x52f7f5,_0x254532))['catch'](handleError(_0x52f7f5,null));})['catch'](handleError(_0x52f7f5,null));};exports[_0x64cb('0x3a')]=function(_0x46aef5,_0x3bfa11){var _0x428e36={'raw':![],'where':{'id':_0x46aef5['params']['id']}},_0x5b2ccd={};_0x5b2ccd['model']=_[_0x64cb('0x2a')](db['CmCompany']['rawAttributes']);_0x5b2ccd[_0x64cb('0x2b')]=_[_0x64cb('0x2a')](_0x46aef5[_0x64cb('0x2b')]);_0x5b2ccd[_0x64cb('0x2c')]=_[_0x64cb('0x2d')](_0x5b2ccd[_0x64cb('0x29')],_0x5b2ccd[_0x64cb('0x2b')]);_0x428e36[_0x64cb('0x2e')]=_[_0x64cb('0x2d')](_0x5b2ccd[_0x64cb('0x29')],qs['fields'](_0x46aef5[_0x64cb('0x2b')][_0x64cb('0x2f')]));_0x428e36[_0x64cb('0x2e')]=_0x428e36[_0x64cb('0x2e')][_0x64cb('0x3b')]?_0x428e36[_0x64cb('0x2e')]:_0x5b2ccd[_0x64cb('0x29')];if(_0x46aef5['query'][_0x64cb('0x37')]){_0x428e36[_0x64cb('0x38')]=[{'all':!![]}];}_0x428e36=_[_0x64cb('0x35')]({},_0x428e36,_0x46aef5[_0x64cb('0x36')]);return db[_0x64cb('0x27')][_0x64cb('0x3c')](_0x428e36)[_0x64cb('0x21')](handleEntityNotFound(_0x3bfa11,null))[_0x64cb('0x21')](respondWithResult(_0x3bfa11,null))[_0x64cb('0x3d')](handleError(_0x3bfa11,null));};exports[_0x64cb('0x3e')]=function(_0x3040cb,_0x434b53){return db[_0x64cb('0x27')][_0x64cb('0x3e')](_0x3040cb['body'],{})['then'](function(_0x3784c4){var _0xf07bdd=_0x3040cb[_0x64cb('0x3f')][_0x64cb('0x23')]({'plain':!![]});if(!_0xf07bdd)throw new Error(_0x64cb('0x40'));if(_0xf07bdd['role']==='user'){var _0x1dd88f=_0x3784c4['get']({'plain':!![]});var _0x2c5e61=_0x64cb('0x41');return db[_0x64cb('0x42')][_0x64cb('0x3c')]({'where':{'name':_0x2c5e61,'userProfileId':_0xf07bdd[_0x64cb('0x43')]},'raw':!![]})[_0x64cb('0x21')](function(_0x2c15e6){if(_0x2c15e6&&_0x2c15e6[_0x64cb('0x44')]===0x0){return db[_0x64cb('0x24')]['create']({'name':_0x1dd88f[_0x64cb('0x25')],'resourceId':_0x1dd88f['id'],'type':_0x2c15e6[_0x64cb('0x25')],'sectionId':_0x2c15e6['id']},{})[_0x64cb('0x21')](function(){return _0x3784c4;});}else{return _0x3784c4;}})[_0x64cb('0x3d')](function(_0x43b00c){logger[_0x64cb('0x45')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x43b00c);throw _0x43b00c;});}return _0x3784c4;})['then'](respondWithResult(_0x434b53,0xc9))[_0x64cb('0x3d')](handleError(_0x434b53,null));};exports[_0x64cb('0x20')]=function(_0x27f767,_0xcdb718){if(_0x27f767[_0x64cb('0x46')]['id']){delete _0x27f767[_0x64cb('0x46')]['id'];}return db[_0x64cb('0x27')][_0x64cb('0x3c')]({'where':{'id':_0x27f767[_0x64cb('0x47')]['id']}})[_0x64cb('0x21')](handleEntityNotFound(_0xcdb718,null))[_0x64cb('0x21')](saveUpdates(_0x27f767[_0x64cb('0x46')],null))['then'](respondWithResult(_0xcdb718,null))[_0x64cb('0x3d')](handleError(_0xcdb718,null));};exports['destroy']=function(_0x479f55,_0x25e6f8){return db['CmCompany'][_0x64cb('0x3c')]({'where':{'id':_0x479f55[_0x64cb('0x47')]['id']}})[_0x64cb('0x21')](handleEntityNotFound(_0x25e6f8,null))['then'](removeEntity(_0x25e6f8,null))['catch'](handleError(_0x25e6f8,null));};exports[_0x64cb('0x28')]=function(_0x308b9e,_0x1416aa){return db[_0x64cb('0x27')]['describe']()['then'](respondWithResult(_0x1416aa,null))['catch'](handleError(_0x1416aa,null));};exports[_0x64cb('0x48')]=function(_0x1250bb,_0x5258f5,_0x2d9355){return db[_0x64cb('0x49')][_0x64cb('0x3c')]({'where':{'id':_0x1250bb['params']['id']}})[_0x64cb('0x21')](handleEntityNotFound(_0x5258f5,null))[_0x64cb('0x21')](function(_0x526cf1){if(_0x526cf1){return _0x526cf1['addContacts'](_0x1250bb[_0x64cb('0x46')][_0x64cb('0x4a')],_[_0x64cb('0x4b')](_0x1250bb[_0x64cb('0x46')],[_0x64cb('0x4a'),'id'])||{});}})[_0x64cb('0x21')](respondWithResult(_0x5258f5,null))['catch'](handleError(_0x5258f5,null));};exports[_0x64cb('0x4c')]=function(_0x4f3fd3,_0x60d1de,_0x32a1d8){var _0x309f7d={};var _0x25d582={};var _0x37581b;var _0x14836c;return db[_0x64cb('0x27')]['findOne']({'where':{'id':_0x4f3fd3['params']['id']}})[_0x64cb('0x21')](handleEntityNotFound(_0x60d1de,null))[_0x64cb('0x21')](function(_0x2f61f7){if(_0x2f61f7){_0x37581b=_0x2f61f7;_0x25d582[_0x64cb('0x29')]=_[_0x64cb('0x2a')](db['CmContact'][_0x64cb('0x4d')]);_0x25d582['query']=_[_0x64cb('0x2a')](_0x4f3fd3['query']);_0x25d582[_0x64cb('0x2c')]=_[_0x64cb('0x2d')](_0x25d582[_0x64cb('0x29')],_0x25d582[_0x64cb('0x2b')]);_0x309f7d['attributes']=_[_0x64cb('0x2d')](_0x25d582[_0x64cb('0x29')],qs[_0x64cb('0x2f')](_0x4f3fd3['query'][_0x64cb('0x2f')]));_0x309f7d['attributes']=_0x309f7d[_0x64cb('0x2e')]['length']?_0x309f7d[_0x64cb('0x2e')]:_0x25d582[_0x64cb('0x29')];_0x309f7d['order']=qs[_0x64cb('0x32')](_0x4f3fd3[_0x64cb('0x2b')][_0x64cb('0x32')]);_0x309f7d['where']=qs[_0x64cb('0x2c')](_[_0x64cb('0x34')](_0x4f3fd3[_0x64cb('0x2b')],_0x25d582[_0x64cb('0x2c')]));if(_0x4f3fd3['query'][_0x64cb('0x4e')]){_0x309f7d[_0x64cb('0x33')]=_['merge'](_0x309f7d['where'],{'$or':_[_0x64cb('0x4f')](_0x309f7d[_0x64cb('0x2e')],function(_0x50b936){var _0x3317a4={};_0x3317a4[_0x50b936]={'$like':'%'+_0x4f3fd3['query'][_0x64cb('0x4e')]+'%'};return _0x3317a4;})});}_0x309f7d=_[_0x64cb('0x35')]({},_0x309f7d,_0x4f3fd3[_0x64cb('0x36')]);return _0x37581b[_0x64cb('0x4c')](_0x309f7d);}})[_0x64cb('0x21')](function(_0x59666a){if(_0x59666a){_0x14836c=_0x59666a[_0x64cb('0x3b')];if(!_0x4f3fd3['query']['hasOwnProperty']('nolimit')){_0x309f7d['limit']=qs[_0x64cb('0x31')](_0x4f3fd3[_0x64cb('0x2b')][_0x64cb('0x31')]);_0x309f7d['offset']=qs['offset'](_0x4f3fd3['query'][_0x64cb('0x1c')]);}return _0x37581b[_0x64cb('0x4c')](_0x309f7d);}})['then'](function(_0x1d4db5){if(_0x1d4db5){return _0x1d4db5?{'count':_0x14836c,'rows':_0x1d4db5}:null;}})['then'](respondWithResult(_0x60d1de,null))['catch'](handleError(_0x60d1de,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index acbb638..4435a63 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 _0xc23a=['exports','CmCompany','cm_companies','util','../../config/logger','api','bluebird','rimraf','./cmCompany.attributes'];(function(_0x3ce827,_0x47cde9){var _0x21b38d=function(_0x331ec7){while(--_0x331ec7){_0x3ce827['push'](_0x3ce827['shift']());}};_0x21b38d(++_0x47cde9);}(_0xc23a,0xd2));var _0xac23=function(_0xcfeda9,_0xd418ae){_0xcfeda9=_0xcfeda9-0x0;var _0x4826c7=_0xc23a[_0xcfeda9];return _0x4826c7;};'use strict';var _=require('lodash');var util=require(_0xac23('0x0'));var logger=require(_0xac23('0x1'))(_0xac23('0x2'));var moment=require('moment');var BPromise=require(_0xac23('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xac23('0x4'));var config=require('../../config/environment');var attributes=require(_0xac23('0x5'));module[_0xac23('0x6')]=function(_0xc71a6d,_0x4c1482){return _0xc71a6d['define'](_0xac23('0x7'),attributes,{'tableName':_0xac23('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7d9f=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cmCompany.attributes','define','cm_companies'];(function(_0x143784,_0xea2c40){var _0x3138e5=function(_0x1afffc){while(--_0x1afffc){_0x143784['push'](_0x143784['shift']());}};_0x3138e5(++_0xea2c40);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x290b68,_0x1f82af){_0x290b68=_0x290b68-0x0;var _0x2f23af=_0x7d9f[_0x290b68];return _0x2f23af;};'use strict';var _=require(_0xf7d9('0x0'));var util=require(_0xf7d9('0x1'));var logger=require(_0xf7d9('0x2'))(_0xf7d9('0x3'));var moment=require(_0xf7d9('0x4'));var BPromise=require('bluebird');var rp=require(_0xf7d9('0x5'));var fs=require('fs');var path=require(_0xf7d9('0x6'));var rimraf=require(_0xf7d9('0x7'));var config=require(_0xf7d9('0x8'));var attributes=require(_0xf7d9('0x9'));module['exports']=function(_0x4b50c7,_0x2eb0f1){return _0x4b50c7[_0xf7d9('0xa')]('CmCompany',attributes,{'tableName':_0xf7d9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 0503804..cd465a3 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 _0x9f2b=['info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x319eec,_0x475f1d){var _0x4fdcb7=function(_0x52be2e){while(--_0x52be2e){_0x319eec['push'](_0x319eec['shift']());}};_0x4fdcb7(++_0x475f1d);}(_0x9f2b,0x1ae));var _0xb9f2=function(_0x40a3ee,_0x34350a){_0x40a3ee=_0x40a3ee-0x0;var _0x512ce5=_0x9f2b[_0x40a3ee];return _0x512ce5;};'use strict';var _=require(_0xb9f2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb9f2('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb9f2('0x2'))['db'];var utils=require(_0xb9f2('0x3'));var logger=require(_0xb9f2('0x4'))(_0xb9f2('0x5'));var config=require('../../config/environment');var jayson=require(_0xb9f2('0x6'));var client=jayson[_0xb9f2('0x7')][_0xb9f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x590080,_0x4d6b82,_0x5db682){return new BPromise(function(_0x437518,_0x2f2e61){return client[_0xb9f2('0x9')](_0x590080,_0x5db682)[_0xb9f2('0xa')](function(_0x532374){logger[_0xb9f2('0xb')](_0xb9f2('0xc'),_0x4d6b82,_0xb9f2('0xd'));logger[_0xb9f2('0xe')](_0xb9f2('0xf'),_0x4d6b82,_0xb9f2('0xd'),JSON[_0xb9f2('0x10')](_0x532374));if(_0x532374['error']){if(_0x532374[_0xb9f2('0x11')][_0xb9f2('0x12')]===0x1f4){logger[_0xb9f2('0x11')](_0xb9f2('0xc'),_0x4d6b82,_0x532374[_0xb9f2('0x11')][_0xb9f2('0x13')]);return _0x2f2e61(_0x532374[_0xb9f2('0x11')][_0xb9f2('0x13')]);}logger[_0xb9f2('0x11')](_0xb9f2('0xc'),_0x4d6b82,_0x532374['error'][_0xb9f2('0x13')]);return _0x437518(_0x532374['error'][_0xb9f2('0x13')]);}else{logger[_0xb9f2('0xb')](_0xb9f2('0xc'),_0x4d6b82,_0xb9f2('0xd'));_0x437518(_0x532374['result']['message']);}})[_0xb9f2('0x14')](function(_0x47ce73){logger[_0xb9f2('0x11')]('CmCompany,\x20%s,\x20%s',_0x4d6b82,_0x47ce73);_0x2f2e61(_0x47ce73);});});} \ No newline at end of file +var _0x7209=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCompany,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x21444f,_0x15f33f){var _0x5f43c3=function(_0x500ce8){while(--_0x500ce8){_0x21444f['push'](_0x21444f['shift']());}};_0x5f43c3(++_0x15f33f);}(_0x7209,0xf8));var _0x9720=function(_0x46d66e,_0x1e4b1b){_0x46d66e=_0x46d66e-0x0;var _0x1dbb12=_0x7209[_0x46d66e];return _0x1dbb12;};'use strict';var _=require(_0x9720('0x0'));var util=require(_0x9720('0x1'));var moment=require(_0x9720('0x2'));var BPromise=require(_0x9720('0x3'));var rs=require(_0x9720('0x4'));var fs=require('fs');var Redis=require(_0x9720('0x5'));var db=require(_0x9720('0x6'))['db'];var utils=require(_0x9720('0x7'));var logger=require('../../config/logger')(_0x9720('0x8'));var config=require(_0x9720('0x9'));var jayson=require(_0x9720('0xa'));var client=jayson[_0x9720('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x286ffc,_0x3ba8ef,_0x22a73a){return new BPromise(function(_0x4f76e1,_0x2b4194){return client[_0x9720('0xc')](_0x286ffc,_0x22a73a)[_0x9720('0xd')](function(_0x43345d){logger[_0x9720('0xe')]('CmCompany,\x20%s,\x20%s',_0x3ba8ef,_0x9720('0xf'));logger[_0x9720('0x10')](_0x9720('0x11'),_0x3ba8ef,'request\x20sent',JSON[_0x9720('0x12')](_0x43345d));if(_0x43345d['error']){if(_0x43345d[_0x9720('0x13')][_0x9720('0x14')]===0x1f4){logger[_0x9720('0x13')](_0x9720('0x15'),_0x3ba8ef,_0x43345d[_0x9720('0x13')][_0x9720('0x16')]);return _0x2b4194(_0x43345d[_0x9720('0x13')][_0x9720('0x16')]);}logger[_0x9720('0x13')]('CmCompany,\x20%s,\x20%s',_0x3ba8ef,_0x43345d[_0x9720('0x13')]['message']);return _0x4f76e1(_0x43345d['error'][_0x9720('0x16')]);}else{logger[_0x9720('0xe')](_0x9720('0x15'),_0x3ba8ef,_0x9720('0xf'));_0x4f76e1(_0x43345d[_0x9720('0x17')]['message']);}})[_0x9720('0x18')](function(_0x460d98){logger[_0x9720('0x13')](_0x9720('0x15'),_0x3ba8ef,_0x460d98);_0x2b4194(_0x460d98);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 8e6c7bc..260d220 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 _0x430c=['Router','get','isAuthenticated','describe','/:id','show','/:id/contacts','post','put','update','delete','multer','connect-timeout','express'];(function(_0x44efc6,_0x4eb959){var _0x51bc1f=function(_0x2088f7){while(--_0x2088f7){_0x44efc6['push'](_0x44efc6['shift']());}};_0x51bc1f(++_0x4eb959);}(_0x430c,0x1a1));var _0xc430=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x430c[_0x2e0443];return _0x52d450;};'use strict';var multer=require(_0xc430('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xc430('0x1'));var express=require(_0xc430('0x2'));var router=express[_0xc430('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmCompany.controller');router[_0xc430('0x4')]('/',auth[_0xc430('0x5')](),controller['index']);router[_0xc430('0x4')]('/describe',auth[_0xc430('0x5')](),controller[_0xc430('0x6')]);router[_0xc430('0x4')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller[_0xc430('0x8')]);router[_0xc430('0x4')](_0xc430('0x9'),auth[_0xc430('0x5')](),controller['getContacts']);router[_0xc430('0xa')]('/',auth[_0xc430('0x5')](),controller['create']);router[_0xc430('0xa')]('/:id/contacts',auth[_0xc430('0x5')](),controller['addContacts']);router[_0xc430('0xb')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller[_0xc430('0xc')]);router[_0xc430('0xd')](_0xc430('0x7'),auth[_0xc430('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x955f=['get','describe','/:id','show','/:id/contacts','getContacts','post','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./cmCompany.controller','isAuthenticated','index'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x955f,0x1eb));var _0xf955=function(_0x19dbd9,_0x2793ea){_0x19dbd9=_0x19dbd9-0x0;var _0x3186a3=_0x955f[_0x19dbd9];return _0x3186a3;};'use strict';var multer=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var path=require(_0xf955('0x2'));var timeout=require(_0xf955('0x3'));var express=require(_0xf955('0x4'));var router=express['Router']();var auth=require(_0xf955('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf955('0x6'));router['get']('/',auth[_0xf955('0x7')](),controller[_0xf955('0x8')]);router[_0xf955('0x9')]('/describe',auth[_0xf955('0x7')](),controller[_0xf955('0xa')]);router['get'](_0xf955('0xb'),auth[_0xf955('0x7')](),controller[_0xf955('0xc')]);router[_0xf955('0x9')](_0xf955('0xd'),auth[_0xf955('0x7')](),controller[_0xf955('0xe')]);router['post']('/',auth[_0xf955('0x7')](),controller['create']);router[_0xf955('0xf')](_0xf955('0xd'),auth[_0xf955('0x7')](),controller['addContacts']);router[_0xf955('0x10')]('/:id',auth[_0xf955('0x7')](),controller['update']);router[_0xf955('0x11')](_0xf955('0xb'),auth[_0xf955('0x7')](),controller[_0xf955('0x12')]);module[_0xf955('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 255523b..a5648df 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 _0x3d3f=['lodash','STRING','INTEGER','DATE','NOW'];(function(_0x574d9b,_0x2063da){var _0x31d2a5=function(_0x97ce4c){while(--_0x97ce4c){_0x574d9b['push'](_0x574d9b['shift']());}};_0x31d2a5(++_0x2063da);}(_0x3d3f,0x9b));var _0xf3d3=function(_0x3c1617,_0x59cef0){_0x3c1617=_0x3c1617-0x0;var _0x2d1df9=_0x3d3f[_0x3c1617];return _0x2d1df9;};'use strict';var _=require(_0xf3d3('0x0'));var Sequelize=require('sequelize');module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xf3d3('0x1')]},'street':{'type':Sequelize[_0xf3d3('0x1')]},'postalCode':{'type':Sequelize[_0xf3d3('0x1')]},'city':{'type':Sequelize[_0xf3d3('0x1')]},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize[_0xf3d3('0x1')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xf3d3('0x1')]},'mobile':{'type':Sequelize[_0xf3d3('0x1')]},'fax':{'type':Sequelize[_0xf3d3('0x1')]},'email':{'type':Sequelize[_0xf3d3('0x1')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0xf3d3('0x1')]},'fb_data':{'type':Sequelize[_0xf3d3('0x1')]},'twitter':{'type':Sequelize[_0xf3d3('0x1')]},'skype':{'type':Sequelize[_0xf3d3('0x1')]},'teams':{'type':Sequelize[_0xf3d3('0x1')]},'viber':{'type':Sequelize[_0xf3d3('0x1')]},'line':{'type':Sequelize[_0xf3d3('0x1')]},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize['STRING']},'UserId':{'type':Sequelize[_0xf3d3('0x2')]},'priority':{'type':Sequelize[_0xf3d3('0x2')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xf3d3('0x3')],'defaultValue':Sequelize[_0xf3d3('0x4')]}}; \ No newline at end of file +var _0xc89f=['DATE','NOW','lodash','sequelize','exports','STRING','INTEGER','UNSIGNED'];(function(_0x260764,_0x2f3fc8){var _0x383e35=function(_0x2b9a60){while(--_0x2b9a60){_0x260764['push'](_0x260764['shift']());}};_0x383e35(++_0x2f3fc8);}(_0xc89f,0x1c2));var _0xfc89=function(_0x4cdcb6,_0x5aba65){_0x4cdcb6=_0x4cdcb6-0x0;var _0x3c8979=_0xc89f[_0x4cdcb6];return _0x3c8979;};'use strict';var _=require(_0xfc89('0x0'));var Sequelize=require(_0xfc89('0x1'));module[_0xfc89('0x2')]={'firstName':{'type':Sequelize[_0xfc89('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0xfc89('0x3')]},'street':{'type':Sequelize[_0xfc89('0x3')]},'postalCode':{'type':Sequelize[_0xfc89('0x3')]},'city':{'type':Sequelize[_0xfc89('0x3')]},'country':{'type':Sequelize[_0xfc89('0x3')]},'dateOfBirth':{'type':Sequelize[_0xfc89('0x3')]},'description':{'type':Sequelize['TEXT']},'phone':{'type':Sequelize[_0xfc89('0x3')]},'mobile':{'type':Sequelize[_0xfc89('0x3')]},'fax':{'type':Sequelize[_0xfc89('0x3')]},'email':{'type':Sequelize[_0xfc89('0x3')]},'url':{'type':Sequelize[_0xfc89('0x3')]},'facebook':{'type':Sequelize[_0xfc89('0x3')]},'fb_data':{'type':Sequelize[_0xfc89('0x3')]},'twitter':{'type':Sequelize[_0xfc89('0x3')]},'skype':{'type':Sequelize[_0xfc89('0x3')]},'teams':{'type':Sequelize[_0xfc89('0x3')]},'viber':{'type':Sequelize[_0xfc89('0x3')]},'line':{'type':Sequelize[_0xfc89('0x3')]},'wechat':{'type':Sequelize[_0xfc89('0x3')]},'telegram':{'type':Sequelize[_0xfc89('0x3')]},'UserId':{'type':Sequelize[_0xfc89('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xfc89('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xfc89('0x6')],'defaultValue':Sequelize[_0xfc89('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 00d1237..01e429d 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 _0x0f49=['field','color','from','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','where','c.deletedAt\x20IS\x20NULL','search','conditions','find','Tag','value','map','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','datetime','castTo','DATE','buildExpression','text','start','hasOwnProperty','filter','Contact','isEmpty','ListId','c.ListId\x20IN\x20?','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','isArray','replace','\x27\x27\x27\x27','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.id\x20LIKE\x20?','c.phone\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.id','Sequelize','QueryTypes','SELECT','clone','DESC','having','resolve','some','user','getLists','c.ListId\x20IS\x20NULL','toString','sequelize','merge','c.firstName','c.lastName','c.phone','c.fax','c.email','c.ListId','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','split','rows','catch','destroy','params','tags','columnName','findAll','displayName','custom','values','body','get','join','info','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','[CmContact][merge][destroy][CmHopperBlack],\x20%s','ChatMessage','ChatOfflineMessage','MailMessage','SmsMessage','FaxInteraction','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','JscriptySessionReport','create','bulkCreate','duplicates','$or','findOrCreate','spread','show','$and','omit','cf_%d','pickBy','setFields','id\x20=\x20?','toParam','phone','rawAttributes','options','getTags','setTags','findOne','ids','ContactId','includeAll','getHopperHistories','include','getHopperFinals','uploadCsv','No\x20ListId\x20specified','binding_keys','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','binding_values','Incorrect\x20binding\x20parameters\x20passed!','zipObject','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','filename','chmodSync','fork','../../components/import/cm/csv','CompanyId','json','File\x20uploaded\x20correctly!','pid','upload','createReadStream','file','parse','meta','import','agent','binding','child_process','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./cmContact.socket','sendStatus','status','end','count','offset','limit','reject','save','update','then','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','push','CmCustomField','all','fieldType','type','model','query','filters','intersection','attributes','fields','nolimit','order','sort','pick','select'];(function(_0x5d6a84,_0x10929c){var _0x930f0=function(_0x28af93){while(--_0x28af93){_0x5d6a84['push'](_0x5d6a84['shift']());}};_0x930f0(++_0x10929c);}(_0x0f49,0xb2));var _0x90f4=function(_0x23e859,_0x419ccc){_0x23e859=_0x23e859-0x0;var _0xe4964=_0x0f49[_0x23e859];return _0xe4964;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x90f4('0x0'));var rimraf=require(_0x90f4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x90f4('0x2'));var rp=require(_0x90f4('0x3'));var moment=require(_0x90f4('0x4'));var BPromise=require(_0x90f4('0x5'));var Mustache=require(_0x90f4('0x6'));var util=require(_0x90f4('0x7'));var path=require(_0x90f4('0x8'));var sox=require(_0x90f4('0x9'));var csv=require(_0x90f4('0xa'));var ejs=require(_0x90f4('0xb'));var fs=require('fs');var _=require(_0x90f4('0xc'));var squel=require('squel');var crypto=require(_0x90f4('0xd'));var jsforce=require(_0x90f4('0xe'));var deskjs=require(_0x90f4('0xf'));var toCsv=require(_0x90f4('0xa'));var querystring=require(_0x90f4('0x10'));var Papa=require(_0x90f4('0x11'));var Redis=require(_0x90f4('0x12'));var authService=require(_0x90f4('0x13'));var qs=require(_0x90f4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x90f4('0x15'));var logger=require(_0x90f4('0x16'))(_0x90f4('0x17'));var utils=require(_0x90f4('0x18'));var config=require(_0x90f4('0x19'));var db=require(_0x90f4('0x1a'))['db'];config[_0x90f4('0x1b')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x90f4('0x1c'))(new Redis(config[_0x90f4('0x1b')]));require(_0x90f4('0x1d'))['register'](socket);function respondWithStatusCode(_0x5c16f6,_0x1733a4){_0x1733a4=_0x1733a4||0xcc;return function(_0x11b85c){if(_0x11b85c){return _0x5c16f6[_0x90f4('0x1e')](_0x1733a4);}return _0x5c16f6[_0x90f4('0x1f')](_0x1733a4)[_0x90f4('0x20')]();};}function respondWithResult(_0x3fda0a,_0x5b6129){_0x5b6129=_0x5b6129||0xc8;return function(_0x5d1ab6){if(_0x5d1ab6){return _0x3fda0a[_0x90f4('0x1f')](_0x5b6129)['json'](_0x5d1ab6);}};}function respondWithFilteredResult(_0x23d693,_0x2944c3){return function(_0x5600c1){if(_0x5600c1){var _0x42de14=_0x5600c1[_0x90f4('0x21')],_0x5d93ca=_0x2944c3[_0x90f4('0x22')],_0x1ea7ae=_0x2944c3[_0x90f4('0x22')]+_0x2944c3[_0x90f4('0x23')],_0x5dcb76;if(_0x1ea7ae>=_0x42de14){_0x1ea7ae=_0x42de14;_0x5dcb76=0xc8;}else{_0x5dcb76=0xce;}_0x23d693['status'](_0x5dcb76);return _0x23d693['set']('Content-Range',_0x5d93ca+'-'+_0x1ea7ae+'/'+_0x42de14)['json'](_0x5600c1);}return null;};}function patchUpdates(_0x257c34){return function(_0x4594f3){try{jsonpatch['apply'](_0x4594f3,_0x257c34,!![]);}catch(_0x2722b1){return BPromise[_0x90f4('0x24')](_0x2722b1);}return _0x4594f3[_0x90f4('0x25')]();};}function saveUpdates(_0x4f15d9,_0x59672e){return function(_0x5dd028){if(_0x5dd028){return _0x5dd028[_0x90f4('0x26')](_0x4f15d9)[_0x90f4('0x27')](function(_0xb6b293){return _0xb6b293;});}return null;};}function removeEntity(_0x174105,_0x47c916){return function(_0x592e6f){if(_0x592e6f){return _0x592e6f['destroy']()[_0x90f4('0x27')](function(){_0x174105[_0x90f4('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x172a65,_0x42ee68){return function(_0xd62950){if(!_0xd62950){_0x172a65[_0x90f4('0x1e')](0x194);}return _0xd62950;};}function handleError(_0x12628b,_0x527164){_0x527164=_0x527164||0x1f4;return function(_0x3e1d6f){logger[_0x90f4('0x28')](_0x3e1d6f[_0x90f4('0x29')]);if(_0x3e1d6f[_0x90f4('0x2a')]){delete _0x3e1d6f[_0x90f4('0x2a')];}_0x12628b[_0x90f4('0x1f')](_0x527164)[_0x90f4('0x2b')](_0x3e1d6f);};}exports[_0x90f4('0x2c')]=function(_0x1d01e8,_0x12b896){var _0x45908b={},_0x5b25ab={},_0x1fc825={'count':0x0,'rows':[]};return db[_0x90f4('0x2d')][_0x90f4('0x2e')]()[_0x90f4('0x27')](function(_0x10f5df){var _0x3fd996=[];for(var _0x1aea18=0x0;_0x1aea180x1){_0xdfbff6['or'](_0x90f4('0x70'),qs[_0x90f4('0x71')](_0x17653e),null);}else{if(qs['isNumeric'](_0x17653e)){_0xdfbff6['or'](_0x90f4('0x72'),_0x17653e+'%');_0xdfbff6['or'](_0x90f4('0x73'),_0x17653e+'%');_0xdfbff6['or'](_0x90f4('0x74'),_0x17653e+'%');_0xdfbff6['or'](_0x90f4('0x75'),_0x17653e+'%');}else if(qs[_0x90f4('0x76')](_0x17653e)){_0xdfbff6['or'](_0x90f4('0x77'),_0x17653e+'%');}else{_0xdfbff6['or'](_0x90f4('0x78'),'%'+_0x17653e+'%');_0xdfbff6['or']('c.lastName\x20LIKE\x20?','%'+_0x17653e+'%');_0xdfbff6['or'](_0x90f4('0x77'),'%'+_0x17653e+'%');}}}}_0x28d917[_0x90f4('0x4e')](_0xdfbff6);_0x28d917['group'](_0x90f4('0x79'));var _0x240f8a={'type':db[_0x90f4('0x7a')][_0x90f4('0x7b')][_0x90f4('0x7c')],'raw':!![]};var _0x3d1898=_0x28d917[_0x90f4('0x7d')]()[_0x90f4('0x43')](_0x90f4('0x79'));if(_0x45908b[_0x90f4('0x3f')]){_0x45908b['order']['forEach'](function(_0x5176df){_0x28d917[_0x90f4('0x3f')]('c.'+_0x5176df[0x0],_0x5176df[0x1]===_0x90f4('0x7e')?![]:!![]);});}if(!_[_0x90f4('0x66')](_0xcf3272)){_0x28d917[_0x90f4('0x7f')](_0x3866b2);_0x3d1898[_0x90f4('0x4e')]('t.id\x20IN\x20?',_0xcf3272);}BPromise[_0x90f4('0x80')]()['then'](function(){if(!_0x23ca0e&&_0x1d01e8[_0x90f4('0x39')][_0x90f4('0x67')])return;if(_[_0x90f4('0x81')](_0x23ca0e[_0x90f4('0x51')],[_0x90f4('0x43'),_0x90f4('0x59')]))return;return _0x1d01e8[_0x90f4('0x82')][_0x90f4('0x83')]({'attributes':['id'],'raw':!![]})[_0x90f4('0x27')](function(_0x5fdeaf){if(_[_0x90f4('0x66')](_0x5fdeaf)){_0x3d1898[_0x90f4('0x4e')](_0x90f4('0x84'));_0x28d917[_0x90f4('0x4e')](_0x90f4('0x84'));}else{_0x3d1898['where'](_0x90f4('0x68'),_[_0x90f4('0x55')](_0x5fdeaf,'id'));_0x28d917[_0x90f4('0x4e')]('c.ListId\x20IN\x20?',_[_0x90f4('0x55')](_0x5fdeaf,'id'));}});})[_0x90f4('0x27')](function(){db['sequelize']['query'](_0x3d1898[_0x90f4('0x85')](),_0x240f8a)[_0x90f4('0x27')](function(_0x4100e7){_0x1fc825[_0x90f4('0x21')]=_0x4100e7[_0x90f4('0x30')];if(_0x1fc825['count']===0x0)return[];return db[_0x90f4('0x86')][_0x90f4('0x39')](_0x492ebc[_0x90f4('0x85')](),_0x240f8a);})['then'](function(_0x43191f){_0x1b66bc=_['keyBy'](_0x43191f,'id');_0x240f8a=_[_0x90f4('0x87')](_0x240f8a,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x28d917['field'](_0x90f4('0x79'));_0x28d917[_0x90f4('0x43')](_0x90f4('0x88'));_0x28d917[_0x90f4('0x43')](_0x90f4('0x89'));_0x28d917[_0x90f4('0x43')](_0x90f4('0x8a'));_0x28d917[_0x90f4('0x43')]('c.mobile');_0x28d917['field'](_0x90f4('0x8b'));_0x28d917[_0x90f4('0x43')](_0x90f4('0x8c'));_0x28d917[_0x90f4('0x43')](_0x90f4('0x8d'));_0x28d917[_0x90f4('0x43')](_0x90f4('0x8e'));_0x28d917[_0x90f4('0x43')](_0x90f4('0x8f'),_0x90f4('0x90'));if(_0x45908b[_0x90f4('0x23')])_0x28d917['limit'](_0x45908b[_0x90f4('0x23')]);if(_0x45908b['offset'])_0x28d917['offset'](_0x45908b[_0x90f4('0x22')]);return db[_0x90f4('0x86')]['query'](_0x28d917[_0x90f4('0x85')](),_0x240f8a);})[_0x90f4('0x27')](function(_0x3e6c3a){_0x3e6c3a['forEach'](function(_0x581ca7){if(_0x581ca7['TagIds']){_0x581ca7[_0x90f4('0x91')]=[];_0x581ca7['TagIds'][_0x90f4('0x92')](',')[_0x90f4('0x56')](function(_0x206570){_0x581ca7[_0x90f4('0x91')]['push'](_0x1b66bc[_0x206570]);});}delete _0x581ca7[_0x90f4('0x90')];});_0x1fc825[_0x90f4('0x93')]=_0x3e6c3a;return _0x1fc825;})[_0x90f4('0x27')](respondWithFilteredResult(_0x12b896,_0x45908b));})[_0x90f4('0x94')](handleError(_0x12b896,null));});};exports[_0x90f4('0x95')]=function(_0x45f109,_0x5bfbc2){return db['CmContact'][_0x90f4('0x52')]({'where':{'id':_0x45f109[_0x90f4('0x96')]['id']}})[_0x90f4('0x27')](handleEntityNotFound(_0x5bfbc2,null))[_0x90f4('0x27')](removeEntity(_0x5bfbc2,null))[_0x90f4('0x94')](handleError(_0x5bfbc2,null));};exports[_0x90f4('0x2e')]=function(_0x213f3a,_0xf0039e){return db[_0x90f4('0x2d')][_0x90f4('0x2e')]()[_0x90f4('0x27')](function(_0x221ce0){delete _0x221ce0[_0x90f4('0x97')];for(var _0x1b02d8=0x0;_0x1b02d8=_0x41faf3){_0x2f7457=_0x41faf3;_0x3482ac=0xc8;}else{_0x3482ac=0xce;}_0x4e1aab[_0x3889('0x1f')](_0x3482ac);return _0x4e1aab[_0x3889('0x24')](_0x3889('0x25'),_0x316a83+'-'+_0x2f7457+'/'+_0x41faf3)[_0x3889('0x21')](_0x2b4843);}return null;};}function patchUpdates(_0x698aae){return function(_0x38c0f5){try{jsonpatch[_0x3889('0x26')](_0x38c0f5,_0x698aae,!![]);}catch(_0x5229de){return BPromise['reject'](_0x5229de);}return _0x38c0f5[_0x3889('0x27')]();};}function saveUpdates(_0x504f91,_0x34e449){return function(_0x55d6b3){if(_0x55d6b3){return _0x55d6b3[_0x3889('0x28')](_0x504f91)[_0x3889('0x29')](function(_0x3feb0c){return _0x3feb0c;});}return null;};}function removeEntity(_0x7f038,_0x574224){return function(_0xf7ab32){if(_0xf7ab32){return _0xf7ab32['destroy']()[_0x3889('0x29')](function(){_0x7f038[_0x3889('0x1f')](0xcc)[_0x3889('0x20')]();});}};}function handleEntityNotFound(_0x415416,_0x3d11f8){return function(_0x9c8e71){if(!_0x9c8e71){_0x415416[_0x3889('0x1e')](0x194);}return _0x9c8e71;};}function handleError(_0x1ff969,_0x53e663){_0x53e663=_0x53e663||0x1f4;return function(_0x5dc4ab){logger[_0x3889('0x2a')](_0x5dc4ab[_0x3889('0x2b')]);if(_0x5dc4ab[_0x3889('0x2c')]){delete _0x5dc4ab['name'];}_0x1ff969['status'](_0x53e663)[_0x3889('0x2d')](_0x5dc4ab);};}exports[_0x3889('0x2e')]=function(_0x52e43f,_0x222a50){var _0x11b276={},_0xa336e5={},_0xe8f971={'count':0x0,'rows':[]};return db[_0x3889('0x2f')][_0x3889('0x30')]()[_0x3889('0x29')](function(_0x3ab1ae){var _0x3af213=[];for(var _0x37720f=0x0;_0x37720f0x1){_0x1aaa2d['or'](_0x3889('0x6f'),qs[_0x3889('0x70')](_0x5150f9),null);}else{if(qs[_0x3889('0x71')](_0x5150f9)){_0x1aaa2d['or'](_0x3889('0x72'),_0x5150f9+'%');_0x1aaa2d['or']('c.phone\x20LIKE\x20?',_0x5150f9+'%');_0x1aaa2d['or'](_0x3889('0x73'),_0x5150f9+'%');_0x1aaa2d['or'](_0x3889('0x74'),_0x5150f9+'%');}else if(qs[_0x3889('0x75')](_0x5150f9)){_0x1aaa2d['or'](_0x3889('0x76'),_0x5150f9+'%');}else{_0x1aaa2d['or'](_0x3889('0x77'),'%'+_0x5150f9+'%');_0x1aaa2d['or']('c.lastName\x20LIKE\x20?','%'+_0x5150f9+'%');_0x1aaa2d['or'](_0x3889('0x76'),'%'+_0x5150f9+'%');}}}}_0x4d273e[_0x3889('0x44')](_0x1aaa2d);_0x4d273e['group'](_0x3889('0x78'));var _0x2b36d7={'type':db[_0x3889('0x79')][_0x3889('0x7a')][_0x3889('0x7b')],'raw':!![]};var _0x8033cf=_0x4d273e[_0x3889('0x7c')]()[_0x3889('0x46')](_0x3889('0x78'));if(_0x11b276[_0x3889('0x42')]){_0x11b276[_0x3889('0x42')][_0x3889('0x57')](function(_0xce4bb7){_0x4d273e['order']('c.'+_0xce4bb7[0x0],_0xce4bb7[0x1]===_0x3889('0x7d')?![]:!![]);});}if(!_[_0x3889('0x67')](_0x4c50e5)){_0x4d273e[_0x3889('0x7e')](_0x56264d);_0x8033cf[_0x3889('0x44')](_0x3889('0x7f'),_0x4c50e5);}BPromise['resolve']()[_0x3889('0x29')](function(){if(_0x1de671&&!_[_0x3889('0x80')](_0x1de671[_0x3889('0x52')],[_0x3889('0x46'),_0x3889('0x5a')])){return _0x52e43f[_0x3889('0x81')][_0x3889('0x82')]({'attributes':['id'],'raw':!![]})[_0x3889('0x29')](function(_0x51b665){if(_[_0x3889('0x67')](_0x51b665)){_0x8033cf[_0x3889('0x44')](_0x3889('0x83'));_0x4d273e['where'](_0x3889('0x83'));}else{_0x8033cf[_0x3889('0x44')](_0x3889('0x69'),_[_0x3889('0x56')](_0x51b665,'id'));_0x4d273e[_0x3889('0x44')](_0x3889('0x69'),_['map'](_0x51b665,'id'));}});}else{return;}})[_0x3889('0x29')](function(){db[_0x3889('0x84')][_0x3889('0x39')](_0x8033cf[_0x3889('0x85')](),_0x2b36d7)[_0x3889('0x29')](function(_0x40b98e){_0xe8f971[_0x3889('0x22')]=_0x40b98e['length'];if(_0xe8f971['count']===0x0)return[];return db['sequelize'][_0x3889('0x39')](_0x1b8203[_0x3889('0x85')](),_0x2b36d7);})[_0x3889('0x29')](function(_0x23731c){_0xdbe50c=_[_0x3889('0x86')](_0x23731c,'id');_0x2b36d7=_['merge'](_0x2b36d7,{'model':db[_0x3889('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x4d273e[_0x3889('0x46')](_0x3889('0x78'));_0x4d273e['field'](_0x3889('0x87'));_0x4d273e[_0x3889('0x46')](_0x3889('0x88'));_0x4d273e[_0x3889('0x46')](_0x3889('0x89'));_0x4d273e[_0x3889('0x46')]('c.mobile');_0x4d273e['field']('c.fax');_0x4d273e['field'](_0x3889('0x8a'));_0x4d273e[_0x3889('0x46')](_0x3889('0x8b'));_0x4d273e[_0x3889('0x46')]('c.deletedAt');_0x4d273e[_0x3889('0x46')](_0x3889('0x8c'),_0x3889('0x8d'));if(_0x11b276[_0x3889('0x41')])_0x4d273e[_0x3889('0x41')](_0x11b276[_0x3889('0x41')]);if(_0x11b276[_0x3889('0x23')])_0x4d273e[_0x3889('0x23')](_0x11b276[_0x3889('0x23')]);return db['sequelize'][_0x3889('0x39')](_0x4d273e[_0x3889('0x85')](),_0x2b36d7);})[_0x3889('0x29')](function(_0xcd7e7b){_0xcd7e7b[_0x3889('0x57')](function(_0x9dbcc1){if(_0x9dbcc1[_0x3889('0x8d')]){_0x9dbcc1['Tags']=[];_0x9dbcc1[_0x3889('0x8d')][_0x3889('0x55')](',')[_0x3889('0x57')](function(_0x43e0c0){_0x9dbcc1[_0x3889('0x8e')]['push'](_0xdbe50c[_0x43e0c0]);});}delete _0x9dbcc1[_0x3889('0x8d')];});_0xe8f971[_0x3889('0x8f')]=_0xcd7e7b;return _0xe8f971;})['then'](respondWithFilteredResult(_0x222a50,_0x11b276));});})['catch'](handleError(_0x222a50,null));};exports[_0x3889('0x90')]=function(_0x2beb78,_0x2838e4){return db[_0x3889('0x2f')][_0x3889('0x53')]({'where':{'id':_0x2beb78['params']['id']}})['then'](handleEntityNotFound(_0x2838e4,null))['then'](removeEntity(_0x2838e4,null))[_0x3889('0x91')](handleError(_0x2838e4,null));};exports[_0x3889('0x30')]=function(_0x34c5ba,_0x5c0fa9){return db[_0x3889('0x2f')][_0x3889('0x30')]()[_0x3889('0x29')](function(_0x420b26){delete _0x420b26[_0x3889('0x92')];for(var _0x1b8ed1=0x0;_0x1b8ed1{}\s\\|]/g,'-');_0x517313(null,util['format']('%s-%s%s',path[_0x22eb('0x1d')](_0x36be50[_0x22eb('0x1b')],path[_0x22eb('0x1e')](_0x36be50[_0x22eb('0x1b')])),Date[_0x22eb('0x1f')](),path[_0x22eb('0x1e')](_0x36be50[_0x22eb('0x1b')])));}})});router['post'](_0x22eb('0x20'),upload[_0x22eb('0x21')](_0x22eb('0x22')),controller[_0x22eb('0x23')]);var upload=multer({'storage':multer[_0x22eb('0x17')]({'destination':function(_0x4da252,_0x12c133,_0x6f8ff3){_0x6f8ff3(null,path[_0x22eb('0x18')](config['root'],_0x22eb('0x1a')));},'filename':function(_0x259847,_0x4b409a,_0x32a4b6){_0x4b409a[_0x22eb('0x1b')]=_0x4b409a[_0x22eb('0x1b')][_0x22eb('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x32a4b6(null,util[_0x22eb('0x24')]('%s-%s%s',path['basename'](_0x4b409a[_0x22eb('0x1b')],path[_0x22eb('0x1e')](_0x4b409a[_0x22eb('0x1b')])),Date[_0x22eb('0x1f')](),path[_0x22eb('0x1e')](_0x4b409a[_0x22eb('0x1b')])));}})});router[_0x22eb('0x13')](_0x22eb('0x25'),upload[_0x22eb('0x21')](_0x22eb('0x22')),controller[_0x22eb('0x26')]);router[_0x22eb('0x13')]('/upload/:id',auth[_0x22eb('0x7')](),controller['import']);router[_0x22eb('0x27')](_0x22eb('0xc'),auth[_0x22eb('0x7')](),controller[_0x22eb('0x28')]);router[_0x22eb('0x29')](_0x22eb('0xc'),auth[_0x22eb('0x7')](),controller[_0x22eb('0x2a')]);module[_0x22eb('0x2b')]=router; \ No newline at end of file +var _0x3e74=['/:id/hopper_finals','/:id/jscripty_sessions','getJscriptySessions','merge','post','/create_many','bulkCreate','setTags','diskStorage','join','root','server/files/tmp','originalname','replace','%s-%s%s','basename','extname','now','single','file','format','/upload','upload','/upload/:id','import','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmContact.controller','get','isAuthenticated','index','describe','/:id','getTags','/:id/hopper_histories','getHopperHistories'];(function(_0x5c90f5,_0x1a00b2){var _0x58dcee=function(_0x2b233c){while(--_0x2b233c){_0x5c90f5['push'](_0x5c90f5['shift']());}};_0x58dcee(++_0x1a00b2);}(_0x3e74,0x175));var _0x43e7=function(_0x52f4f3,_0x19d6e7){_0x52f4f3=_0x52f4f3-0x0;var _0x1d07a2=_0x3e74[_0x52f4f3];return _0x1d07a2;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/tags',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0x6')]('/:id/hoppers',auth[_0x43e7('0x7')](),controller['getHoppers']);router[_0x43e7('0x6')](_0x43e7('0xc'),auth['isAuthenticated'](),controller[_0x43e7('0xd')]);router[_0x43e7('0x6')](_0x43e7('0xe'),auth[_0x43e7('0x7')](),controller['getHopperFinals']);router['get'](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['post']('/merge',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);router[_0x43e7('0x12')]('/',auth[_0x43e7('0x7')](),controller['create']);router['post'](_0x43e7('0x13'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x14')]);router['post']('/:id/tags',auth[_0x43e7('0x7')](),controller[_0x43e7('0x15')]);var upload=multer({'storage':multer[_0x43e7('0x16')]({'destination':function(_0x140657,_0x3776f5,_0x1f24fb){_0x1f24fb(null,path[_0x43e7('0x17')](config[_0x43e7('0x18')],_0x43e7('0x19')));},'filename':function(_0xab63cf,_0x191dd5,_0x177ee1){_0x191dd5['originalname']=_0x191dd5[_0x43e7('0x1a')][_0x43e7('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x177ee1(null,util['format'](_0x43e7('0x1c'),path[_0x43e7('0x1d')](_0x191dd5[_0x43e7('0x1a')],path[_0x43e7('0x1e')](_0x191dd5[_0x43e7('0x1a')])),Date[_0x43e7('0x1f')](),path['extname'](_0x191dd5[_0x43e7('0x1a')])));}})});router['post']('/csv',upload[_0x43e7('0x20')](_0x43e7('0x21')),controller['uploadCsv']);var upload=multer({'storage':multer[_0x43e7('0x16')]({'destination':function(_0x4ca5cf,_0x326dab,_0x5c5e67){_0x5c5e67(null,path[_0x43e7('0x17')](config[_0x43e7('0x18')],_0x43e7('0x19')));},'filename':function(_0x405f85,_0x51f4d7,_0x52b7b3){_0x51f4d7[_0x43e7('0x1a')]=_0x51f4d7['originalname'][_0x43e7('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x52b7b3(null,util[_0x43e7('0x22')](_0x43e7('0x1c'),path[_0x43e7('0x1d')](_0x51f4d7['originalname'],path[_0x43e7('0x1e')](_0x51f4d7[_0x43e7('0x1a')])),Date[_0x43e7('0x1f')](),path[_0x43e7('0x1e')](_0x51f4d7[_0x43e7('0x1a')])));}})});router[_0x43e7('0x12')](_0x43e7('0x23'),upload[_0x43e7('0x20')](_0x43e7('0x21')),controller[_0x43e7('0x24')]);router[_0x43e7('0x12')](_0x43e7('0x25'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x26')]);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x27')]);router[_0x43e7('0x28')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0x29')]);module[_0x43e7('0x2a')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 1fcb828..c1c4c93 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 _0x49c5=['isArray','stringify','lodash','exports','VIRTUAL','getDataValue','alias','setDataValue','TEXT','long','type','select','parse','values'];(function(_0x4c2878,_0x5ed0c4){var _0x30f394=function(_0x12ba4b){while(--_0x12ba4b){_0x4c2878['push'](_0x4c2878['shift']());}};_0x30f394(++_0x5ed0c4);}(_0x49c5,0x9c));var _0x549c=function(_0x332f25,_0x20b4e9){_0x332f25=_0x332f25-0x0;var _0x519c0c=_0x49c5[_0x332f25];return _0x519c0c;};'use strict';var Sequelize=require('sequelize');var _=require(_0x549c('0x0'));module[_0x549c('0x1')]={'name':{'type':Sequelize[_0x549c('0x2')],'get':function(_0x254cb8){return this[_0x549c('0x3')](_0x549c('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x54bb19){this[_0x549c('0x5')](_0x549c('0x4'),_0x54bb19?_0x54bb19:this[_0x549c('0x3')]('name'));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x549c('0x6')](_0x549c('0x7')),'get':function(){if(this['getDataValue'](_0x549c('0x8'))===_0x549c('0x9')){return JSON[_0x549c('0xa')](this['getDataValue'](_0x549c('0xb')));}else{return this['getDataValue']('values');}},'set':function(_0x53edfa){if(Array[_0x549c('0xc')](_0x53edfa)){this['setDataValue']('values',JSON[_0x549c('0xd')](_0x53edfa));}else{this[_0x549c('0x5')](_0x549c('0xb'),_0x53edfa);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4e51=['TEXT','type','select','parse','values','isArray','setDataValue','stringify','BOOLEAN','sequelize','exports','VIRTUAL','getDataValue','alias','name','STRING'];(function(_0x21b255,_0x2797d0){var _0x54f971=function(_0x271c38){while(--_0x271c38){_0x21b255['push'](_0x21b255['shift']());}};_0x54f971(++_0x2797d0);}(_0x4e51,0xf9));var _0x14e5=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4e51[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x14e5('0x0'));var _=require('lodash');module[_0x14e5('0x1')]={'name':{'type':Sequelize[_0x14e5('0x2')],'get':function(_0x3f6a7e){return this[_0x14e5('0x3')](_0x14e5('0x4'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0x273efc){this['setDataValue'](_0x14e5('0x4'),_0x273efc?_0x273efc:this[_0x14e5('0x3')](_0x14e5('0x5')));}},'type':{'type':Sequelize[_0x14e5('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0x14e5('0x7')]('long'),'get':function(){if(this['getDataValue'](_0x14e5('0x8'))===_0x14e5('0x9')){return JSON[_0x14e5('0xa')](this['getDataValue'](_0x14e5('0xb')));}else{return this['getDataValue'](_0x14e5('0xb'));}},'set':function(_0x32ffd2){if(Array[_0x14e5('0xc')](_0x32ffd2)){this[_0x14e5('0xd')](_0x14e5('0xb'),JSON[_0x14e5('0xe')](_0x32ffd2));}else{this[_0x14e5('0xd')](_0x14e5('0xb'),_0x32ffd2);}}},'required':{'type':Sequelize[_0x14e5('0xf')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index a2113a2..fe242a2 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 _0x4403=['destroy','sendStatus','error','stack','name','send','map','CmCustomField','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','keys','find','catch','create','transaction','body','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','request-promise','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','status','json','count','offset','reject','save','update','then'];(function(_0x1f19bc,_0xd7d775){var _0x10cd0c=function(_0x29de19){while(--_0x29de19){_0x1f19bc['push'](_0x1f19bc['shift']());}};_0x10cd0c(++_0xd7d775);}(_0x4403,0x126));var _0x3440=function(_0x35c288,_0x47810a){_0x35c288=_0x35c288-0x0;var _0x10c130=_0x4403[_0x35c288];return _0x10c130;};'use strict';var pdf=require(_0x3440('0x0'));var emlformat=require(_0x3440('0x1'));var rimraf=require(_0x3440('0x2'));var zipdir=require(_0x3440('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3440('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3440('0x5'));var path=require('path');var sox=require(_0x3440('0x6'));var csv=require(_0x3440('0x7'));var ejs=require(_0x3440('0x8'));var fs=require('fs');var _=require(_0x3440('0x9'));var squel=require(_0x3440('0xa'));var crypto=require(_0x3440('0xb'));var jsforce=require(_0x3440('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3440('0xd'));var Papa=require(_0x3440('0xe'));var Redis=require(_0x3440('0xf'));var authService=require(_0x3440('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3440('0x11'));var hardwareService=require(_0x3440('0x12'));var logger=require('../../config/logger')(_0x3440('0x13'));var utils=require('../../config/utils');var config=require(_0x3440('0x14'));var db=require(_0x3440('0x15'))['db'];function respondWithStatusCode(_0x12a6e0,_0x5962b0){_0x5962b0=_0x5962b0||0xcc;return function(_0x7a97d6){if(_0x7a97d6){return _0x12a6e0['sendStatus'](_0x5962b0);}return _0x12a6e0[_0x3440('0x16')](_0x5962b0)['end']();};}function respondWithResult(_0x7fffa1,_0x122913){_0x122913=_0x122913||0xc8;return function(_0x245077){if(_0x245077){return _0x7fffa1['status'](_0x122913)[_0x3440('0x17')](_0x245077);}};}function respondWithFilteredResult(_0x4a2bb7,_0x12914d){return function(_0x53d46c){if(_0x53d46c){var _0x25f5a8=_0x53d46c[_0x3440('0x18')],_0x144042=_0x12914d[_0x3440('0x19')],_0x661258=_0x12914d['offset']+_0x12914d['limit'],_0x3b6e4e;if(_0x661258>=_0x25f5a8){_0x661258=_0x25f5a8;_0x3b6e4e=0xc8;}else{_0x3b6e4e=0xce;}_0x4a2bb7[_0x3440('0x16')](_0x3b6e4e);return _0x4a2bb7['set']('Content-Range',_0x144042+'-'+_0x661258+'/'+_0x25f5a8)[_0x3440('0x17')](_0x53d46c);}return null;};}function patchUpdates(_0x3bfb87){return function(_0x3232cf){try{jsonpatch['apply'](_0x3232cf,_0x3bfb87,!![]);}catch(_0x3e3b8a){return BPromise[_0x3440('0x1a')](_0x3e3b8a);}return _0x3232cf[_0x3440('0x1b')]();};}function saveUpdates(_0x3b431a,_0x298568){return function(_0x48a29e){if(_0x48a29e){return _0x48a29e[_0x3440('0x1c')](_0x3b431a)[_0x3440('0x1d')](function(_0x3cd70d){return _0x3cd70d;});}return null;};}function removeEntity(_0x327833,_0x2f065a){return function(_0x177acc){if(_0x177acc){return _0x177acc[_0x3440('0x1e')]()[_0x3440('0x1d')](function(){_0x327833[_0x3440('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1df036,_0x3d7d89){return function(_0x289f9a){if(!_0x289f9a){_0x1df036[_0x3440('0x1f')](0x194);}return _0x289f9a;};}function handleError(_0x4be208,_0x1ff868){_0x1ff868=_0x1ff868||0x1f4;return function(_0x19c4ba){logger[_0x3440('0x20')](_0x19c4ba[_0x3440('0x21')]);if(_0x19c4ba[_0x3440('0x22')]){delete _0x19c4ba['name'];}_0x4be208[_0x3440('0x16')](_0x1ff868)[_0x3440('0x23')](_0x19c4ba);};}exports['index']=function(_0x32b1e8,_0x3a5783){var _0x333979={},_0x4f09ba={},_0x1287c1={'count':0x0,'rows':[]};var _0x262b15=_[_0x3440('0x24')](db[_0x3440('0x25')][_0x3440('0x26')],function(_0x156eca){return{'name':_0x156eca[_0x3440('0x27')],'type':_0x156eca[_0x3440('0x28')]['key']};});_0x4f09ba['model']=_['differenceBy'](_[_0x3440('0x24')](_0x262b15,_0x3440('0x22')),[_0x3440('0x22')]);_0x4f09ba[_0x3440('0x29')]=_['keys'](_0x32b1e8[_0x3440('0x29')]);_0x4f09ba[_0x3440('0x2a')]=_[_0x3440('0x2b')](_0x4f09ba[_0x3440('0x2c')],_0x4f09ba['query']);_0x333979[_0x3440('0x2d')]=_['intersection'](_0x4f09ba[_0x3440('0x2c')],qs[_0x3440('0x2e')](_0x32b1e8[_0x3440('0x29')][_0x3440('0x2e')]));_0x333979['attributes']=_0x333979['attributes'][_0x3440('0x2f')]?_0x333979[_0x3440('0x2d')]:_0x4f09ba[_0x3440('0x2c')];if(!_0x32b1e8['query'][_0x3440('0x30')](_0x3440('0x31'))){_0x333979['limit']=qs[_0x3440('0x32')](_0x32b1e8[_0x3440('0x29')][_0x3440('0x32')]);_0x333979['offset']=qs[_0x3440('0x19')](_0x32b1e8['query']['offset']);}_0x333979[_0x3440('0x33')]=qs[_0x3440('0x34')](_0x32b1e8[_0x3440('0x29')]['sort']);_0x333979[_0x3440('0x35')]=qs[_0x3440('0x2a')](_[_0x3440('0x36')](_0x32b1e8[_0x3440('0x29')],_0x4f09ba[_0x3440('0x2a')]));if(_0x32b1e8['query'][_0x3440('0x37')]){_0x333979['where']=_['merge'](_0x333979[_0x3440('0x35')],{'$or':_[_0x3440('0x24')](_0x262b15,function(_0x1cac3a){if(_0x1cac3a[_0x3440('0x28')]!==_0x3440('0x38')){var _0x357b51={};_0x357b51[_0x1cac3a[_0x3440('0x22')]]={'$like':'%'+_0x32b1e8[_0x3440('0x29')][_0x3440('0x37')]+'%'};return _0x357b51;}})});}_0x333979=_[_0x3440('0x39')]({},_0x333979,_0x32b1e8[_0x3440('0x3a')]);var _0x8903b8={'where':_0x333979[_0x3440('0x35')]};return db['CmCustomField'][_0x3440('0x18')](_0x8903b8)[_0x3440('0x1d')](function(_0x14ff46){_0x1287c1[_0x3440('0x18')]=_0x14ff46;if(_0x32b1e8[_0x3440('0x29')][_0x3440('0x3b')]){_0x333979[_0x3440('0x3c')]=[{'all':!![]}];}return db['CmCustomField'][_0x3440('0x3d')](_0x333979);})[_0x3440('0x1d')](function(_0x37c476){_0x1287c1[_0x3440('0x3e')]=_0x37c476;return _0x1287c1;})['then'](respondWithFilteredResult(_0x3a5783,_0x333979))['catch'](handleError(_0x3a5783,null));};exports['show']=function(_0x200170,_0x5e5e14){var _0x35fc0f={'raw':!![],'where':{'id':_0x200170[_0x3440('0x3f')]['id']}},_0xa00531={};_0xa00531['model']=_['keys'](db[_0x3440('0x25')][_0x3440('0x26')]);_0xa00531[_0x3440('0x29')]=_[_0x3440('0x40')](_0x200170[_0x3440('0x29')]);_0xa00531['filters']=_['intersection'](_0xa00531['model'],_0xa00531['query']);_0x35fc0f[_0x3440('0x2d')]=_['intersection'](_0xa00531['model'],qs[_0x3440('0x2e')](_0x200170[_0x3440('0x29')][_0x3440('0x2e')]));_0x35fc0f[_0x3440('0x2d')]=_0x35fc0f[_0x3440('0x2d')]['length']?_0x35fc0f[_0x3440('0x2d')]:_0xa00531[_0x3440('0x2c')];if(_0x200170[_0x3440('0x29')][_0x3440('0x3b')]){_0x35fc0f[_0x3440('0x3c')]=[{'all':!![]}];}_0x35fc0f=_[_0x3440('0x39')]({},_0x35fc0f,_0x200170[_0x3440('0x3a')]);return db['CmCustomField'][_0x3440('0x41')](_0x35fc0f)['then'](handleEntityNotFound(_0x5e5e14,null))[_0x3440('0x1d')](respondWithResult(_0x5e5e14,null))[_0x3440('0x42')](handleError(_0x5e5e14,null));};exports[_0x3440('0x1c')]=function(_0x1a4284,_0x3e0efc){if(_0x1a4284['body']['id']){delete _0x1a4284['body']['id'];}return db['CmCustomField']['find']({'where':{'id':_0x1a4284[_0x3440('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3e0efc,null))[_0x3440('0x1d')](saveUpdates(_0x1a4284['body'],null))['then'](respondWithResult(_0x3e0efc,null))[_0x3440('0x42')](handleError(_0x3e0efc,null));};exports[_0x3440('0x1e')]=function(_0x40243b,_0x2f2533){return db[_0x3440('0x25')][_0x3440('0x41')]({'where':{'id':_0x40243b[_0x3440('0x3f')]['id']}})[_0x3440('0x1d')](handleEntityNotFound(_0x2f2533,null))[_0x3440('0x1d')](removeEntity(_0x2f2533,null))['catch'](handleError(_0x2f2533,null));};exports[_0x3440('0x43')]=function(_0x317e86,_0x49eb04){var _0x9f9566;return db['sequelize'][_0x3440('0x44')](function(_0x5e5bcf){return db['CmCustomField'][_0x3440('0x43')](_0x317e86[_0x3440('0x45')],{'transaction':_0x5e5bcf})[_0x3440('0x1d')](function(_0x58c656){_0x9f9566=_0x58c656;var _0x1f359e={'type':db[_0x3440('0x46')][_0x3440('0x47')],'transaction':_0x5e5bcf};switch(_0x317e86['body'][_0x3440('0x28')]){case _0x3440('0x48'):_0x1f359e[_0x3440('0x28')]=db[_0x3440('0x46')][_0x3440('0x47')];break;case _0x3440('0x49'):_0x1f359e[_0x3440('0x28')]=db[_0x3440('0x46')][_0x3440('0x4a')];break;case _0x3440('0x4b'):_0x1f359e[_0x3440('0x28')]=db[_0x3440('0x46')][_0x3440('0x4c')];_0x1f359e[_0x3440('0x4d')]=![];break;default:}return db['sequelize'][_0x3440('0x4e')]['addColumn']('cm_contacts',util[_0x3440('0x4f')](_0x3440('0x50'),_0x9f9566['id']),_0x1f359e);})[_0x3440('0x1d')](function(){return _0x9f9566;});})['then'](respondWithResult(_0x49eb04,0xc9))[_0x3440('0x42')](handleError(_0x49eb04,null));}; \ No newline at end of file +var _0x91c0=['sendStatus','end','json','offset','limit','status','set','reject','save','update','then','error','stack','name','index','map','CmCustomField','fieldName','type','key','model','differenceBy','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','filter','count','includeAll','include','findAll','catch','show','rawAttributes','options','find','body','params','destroy','create','sequelize','TEXT','text','number','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x91c0,0x18f));var _0x091c=function(_0x59eef6,_0x2ab149){_0x59eef6=_0x59eef6-0x0;var _0x38976e=_0x91c0[_0x59eef6];return _0x38976e;};'use strict';var pdf=require(_0x091c('0x0'));var emlformat=require(_0x091c('0x1'));var rimraf=require(_0x091c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x091c('0x3'));var rp=require(_0x091c('0x4'));var moment=require('moment');var BPromise=require(_0x091c('0x5'));var Mustache=require(_0x091c('0x6'));var util=require(_0x091c('0x7'));var path=require(_0x091c('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x091c('0x9'));var deskjs=require(_0x091c('0xa'));var toCsv=require('to-csv');var querystring=require(_0x091c('0xb'));var Papa=require(_0x091c('0xc'));var Redis=require(_0x091c('0xd'));var authService=require(_0x091c('0xe'));var qs=require(_0x091c('0xf'));var as=require(_0x091c('0x10'));var hardwareService=require(_0x091c('0x11'));var logger=require('../../config/logger')(_0x091c('0x12'));var utils=require('../../config/utils');var config=require(_0x091c('0x13'));var db=require(_0x091c('0x14'))['db'];function respondWithStatusCode(_0x24f930,_0x4de7dd){_0x4de7dd=_0x4de7dd||0xcc;return function(_0x3198bb){if(_0x3198bb){return _0x24f930[_0x091c('0x15')](_0x4de7dd);}return _0x24f930['status'](_0x4de7dd)[_0x091c('0x16')]();};}function respondWithResult(_0x516563,_0x230aa6){_0x230aa6=_0x230aa6||0xc8;return function(_0x1699d1){if(_0x1699d1){return _0x516563['status'](_0x230aa6)[_0x091c('0x17')](_0x1699d1);}};}function respondWithFilteredResult(_0xb6e022,_0x57b1a3){return function(_0x4404c3){if(_0x4404c3){var _0xd03c97=_0x4404c3['count'],_0xccbd15=_0x57b1a3[_0x091c('0x18')],_0x11a2cb=_0x57b1a3[_0x091c('0x18')]+_0x57b1a3[_0x091c('0x19')],_0x42a1c6;if(_0x11a2cb>=_0xd03c97){_0x11a2cb=_0xd03c97;_0x42a1c6=0xc8;}else{_0x42a1c6=0xce;}_0xb6e022[_0x091c('0x1a')](_0x42a1c6);return _0xb6e022[_0x091c('0x1b')]('Content-Range',_0xccbd15+'-'+_0x11a2cb+'/'+_0xd03c97)[_0x091c('0x17')](_0x4404c3);}return null;};}function patchUpdates(_0x55e6d7){return function(_0x1b1e60){try{jsonpatch['apply'](_0x1b1e60,_0x55e6d7,!![]);}catch(_0x876a06){return BPromise[_0x091c('0x1c')](_0x876a06);}return _0x1b1e60[_0x091c('0x1d')]();};}function saveUpdates(_0x53151e,_0x5b8968){return function(_0x5103d9){if(_0x5103d9){return _0x5103d9[_0x091c('0x1e')](_0x53151e)[_0x091c('0x1f')](function(_0x5a815e){return _0x5a815e;});}return null;};}function removeEntity(_0xd66546,_0x487803){return function(_0x2a337c){if(_0x2a337c){return _0x2a337c['destroy']()[_0x091c('0x1f')](function(){_0xd66546[_0x091c('0x1a')](0xcc)[_0x091c('0x16')]();});}};}function handleEntityNotFound(_0x5dc6aa,_0x10509d){return function(_0x41cd30){if(!_0x41cd30){_0x5dc6aa[_0x091c('0x15')](0x194);}return _0x41cd30;};}function handleError(_0x16ed1d,_0x4c552c){_0x4c552c=_0x4c552c||0x1f4;return function(_0x33658c){logger[_0x091c('0x20')](_0x33658c[_0x091c('0x21')]);if(_0x33658c[_0x091c('0x22')]){delete _0x33658c[_0x091c('0x22')];}_0x16ed1d['status'](_0x4c552c)['send'](_0x33658c);};}exports[_0x091c('0x23')]=function(_0x7df28,_0xaa4038){var _0x12c375={},_0x3d8219={},_0x1e65d9={'count':0x0,'rows':[]};var _0x4ca9a3=_[_0x091c('0x24')](db[_0x091c('0x25')]['rawAttributes'],function(_0xa3bae6){return{'name':_0xa3bae6[_0x091c('0x26')],'type':_0xa3bae6[_0x091c('0x27')][_0x091c('0x28')]};});_0x3d8219[_0x091c('0x29')]=_[_0x091c('0x2a')](_[_0x091c('0x24')](_0x4ca9a3,'name'),[_0x091c('0x22')]);_0x3d8219[_0x091c('0x2b')]=_[_0x091c('0x2c')](_0x7df28[_0x091c('0x2b')]);_0x3d8219['filters']=_[_0x091c('0x2d')](_0x3d8219[_0x091c('0x29')],_0x3d8219['query']);_0x12c375[_0x091c('0x2e')]=_[_0x091c('0x2d')](_0x3d8219[_0x091c('0x29')],qs[_0x091c('0x2f')](_0x7df28[_0x091c('0x2b')][_0x091c('0x2f')]));_0x12c375['attributes']=_0x12c375[_0x091c('0x2e')][_0x091c('0x30')]?_0x12c375['attributes']:_0x3d8219[_0x091c('0x29')];if(!_0x7df28[_0x091c('0x2b')][_0x091c('0x31')](_0x091c('0x32'))){_0x12c375[_0x091c('0x19')]=qs[_0x091c('0x19')](_0x7df28[_0x091c('0x2b')]['limit']);_0x12c375['offset']=qs[_0x091c('0x18')](_0x7df28[_0x091c('0x2b')][_0x091c('0x18')]);}_0x12c375[_0x091c('0x33')]=qs['sort'](_0x7df28[_0x091c('0x2b')][_0x091c('0x34')]);_0x12c375['where']=qs['filters'](_[_0x091c('0x35')](_0x7df28[_0x091c('0x2b')],_0x3d8219[_0x091c('0x36')]));if(_0x7df28[_0x091c('0x2b')]['filter']){_0x12c375[_0x091c('0x37')]=_[_0x091c('0x38')](_0x12c375['where'],{'$or':_[_0x091c('0x24')](_0x4ca9a3,function(_0x5270c6){if(_0x5270c6['type']!==_0x091c('0x39')){var _0x3f2f50={};_0x3f2f50[_0x5270c6[_0x091c('0x22')]]={'$like':'%'+_0x7df28[_0x091c('0x2b')][_0x091c('0x3a')]+'%'};return _0x3f2f50;}})});}_0x12c375=_[_0x091c('0x38')]({},_0x12c375,_0x7df28['options']);var _0xe09869={'where':_0x12c375[_0x091c('0x37')]};return db[_0x091c('0x25')]['count'](_0xe09869)[_0x091c('0x1f')](function(_0x39d03a){_0x1e65d9[_0x091c('0x3b')]=_0x39d03a;if(_0x7df28[_0x091c('0x2b')][_0x091c('0x3c')]){_0x12c375[_0x091c('0x3d')]=[{'all':!![]}];}return db['CmCustomField'][_0x091c('0x3e')](_0x12c375);})[_0x091c('0x1f')](function(_0x192d0d){_0x1e65d9['rows']=_0x192d0d;return _0x1e65d9;})[_0x091c('0x1f')](respondWithFilteredResult(_0xaa4038,_0x12c375))[_0x091c('0x3f')](handleError(_0xaa4038,null));};exports[_0x091c('0x40')]=function(_0x5848f4,_0x1f6573){var _0x326c43={'raw':!![],'where':{'id':_0x5848f4['params']['id']}},_0x33a34e={};_0x33a34e['model']=_[_0x091c('0x2c')](db[_0x091c('0x25')][_0x091c('0x41')]);_0x33a34e['query']=_['keys'](_0x5848f4['query']);_0x33a34e[_0x091c('0x36')]=_['intersection'](_0x33a34e[_0x091c('0x29')],_0x33a34e[_0x091c('0x2b')]);_0x326c43[_0x091c('0x2e')]=_[_0x091c('0x2d')](_0x33a34e[_0x091c('0x29')],qs['fields'](_0x5848f4[_0x091c('0x2b')][_0x091c('0x2f')]));_0x326c43[_0x091c('0x2e')]=_0x326c43[_0x091c('0x2e')][_0x091c('0x30')]?_0x326c43[_0x091c('0x2e')]:_0x33a34e[_0x091c('0x29')];if(_0x5848f4[_0x091c('0x2b')][_0x091c('0x3c')]){_0x326c43['include']=[{'all':!![]}];}_0x326c43=_[_0x091c('0x38')]({},_0x326c43,_0x5848f4[_0x091c('0x42')]);return db[_0x091c('0x25')][_0x091c('0x43')](_0x326c43)[_0x091c('0x1f')](handleEntityNotFound(_0x1f6573,null))[_0x091c('0x1f')](respondWithResult(_0x1f6573,null))[_0x091c('0x3f')](handleError(_0x1f6573,null));};exports[_0x091c('0x1e')]=function(_0x1d79e5,_0x55c662){if(_0x1d79e5[_0x091c('0x44')]['id']){delete _0x1d79e5[_0x091c('0x44')]['id'];}return db['CmCustomField'][_0x091c('0x43')]({'where':{'id':_0x1d79e5[_0x091c('0x45')]['id']}})['then'](handleEntityNotFound(_0x55c662,null))[_0x091c('0x1f')](saveUpdates(_0x1d79e5['body'],null))[_0x091c('0x1f')](respondWithResult(_0x55c662,null))[_0x091c('0x3f')](handleError(_0x55c662,null));};exports[_0x091c('0x46')]=function(_0x24c2b6,_0x3a74fb){return db[_0x091c('0x25')][_0x091c('0x43')]({'where':{'id':_0x24c2b6[_0x091c('0x45')]['id']}})[_0x091c('0x1f')](handleEntityNotFound(_0x3a74fb,null))[_0x091c('0x1f')](removeEntity(_0x3a74fb,null))[_0x091c('0x3f')](handleError(_0x3a74fb,null));};exports[_0x091c('0x47')]=function(_0x3c6282,_0x293398){var _0x20c05f;return db[_0x091c('0x48')]['transaction'](function(_0x24d7d4){return db[_0x091c('0x25')]['create'](_0x3c6282[_0x091c('0x44')],{'transaction':_0x24d7d4})[_0x091c('0x1f')](function(_0x13be8e){_0x20c05f=_0x13be8e;var _0x4385f2={'type':db['Sequelize'][_0x091c('0x49')],'transaction':_0x24d7d4};switch(_0x3c6282[_0x091c('0x44')][_0x091c('0x27')]){case _0x091c('0x4a'):_0x4385f2[_0x091c('0x27')]=db['Sequelize'][_0x091c('0x49')];break;case _0x091c('0x4b'):_0x4385f2['type']=db[_0x091c('0x4c')][_0x091c('0x4d')];break;case _0x091c('0x4e'):_0x4385f2['type']=db['Sequelize'][_0x091c('0x4f')];_0x4385f2[_0x091c('0x50')]=![];break;default:}return db['sequelize']['queryInterface']['addColumn'](_0x091c('0x51'),util[_0x091c('0x52')](_0x091c('0x53'),_0x20c05f['id']),_0x4385f2);})['then'](function(){return _0x20c05f;});})['then'](respondWithResult(_0x293398,0xc9))['catch'](handleError(_0x293398,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index a1a09f1..6396b8d 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 _0x5700=['../../config/environment','./cmCustomField.attributes','CmCustomField','cm_custom_fields','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x5eb26d,_0x1f3383){var _0x2a5303=function(_0x3febff){while(--_0x3febff){_0x5eb26d['push'](_0x5eb26d['shift']());}};_0x2a5303(++_0x1f3383);}(_0x5700,0x12d));var _0x0570=function(_0x5531ca,_0x110eb4){_0x5531ca=_0x5531ca-0x0;var _0x2ec265=_0x5700[_0x5531ca];return _0x2ec265;};'use strict';var _=require('lodash');var util=require(_0x0570('0x0'));var logger=require(_0x0570('0x1'))(_0x0570('0x2'));var moment=require(_0x0570('0x3'));var BPromise=require(_0x0570('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0570('0x5'));var rimraf=require(_0x0570('0x6'));var config=require(_0x0570('0x7'));var attributes=require(_0x0570('0x8'));module['exports']=function(_0x2e7cdb,_0x554057){return _0x2e7cdb['define'](_0x0570('0x9'),attributes,{'tableName':_0x0570('0xa'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd5bc=['exports','CmCustomField','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./cmCustomField.attributes'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd5bc,0x78));var _0xcd5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd5bc[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xcd5b('0x0'));var util=require(_0xcd5b('0x1'));var logger=require(_0xcd5b('0x2'))(_0xcd5b('0x3'));var moment=require(_0xcd5b('0x4'));var BPromise=require(_0xcd5b('0x5'));var rp=require(_0xcd5b('0x6'));var fs=require('fs');var path=require(_0xcd5b('0x7'));var rimraf=require('rimraf');var config=require(_0xcd5b('0x8'));var attributes=require(_0xcd5b('0x9'));module[_0xcd5b('0xa')]=function(_0x501170,_0x15e26c){return _0x501170['define'](_0xcd5b('0xb'),attributes,{'tableName':_0xcd5b('0xc'),'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 c442899..03cc207 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 _0x5ad3=['util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','CmCustomField,\x20%s,\x20%s','request\x20sent','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash'];(function(_0x11bda4,_0x428df8){var _0x5115a2=function(_0x1e1ad9){while(--_0x1e1ad9){_0x11bda4['push'](_0x11bda4['shift']());}};_0x5115a2(++_0x428df8);}(_0x5ad3,0x1e2));var _0x35ad=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0x5ad3[_0x8c1005];return _0x175354;};'use strict';var _=require(_0x35ad('0x0'));var util=require(_0x35ad('0x1'));var moment=require(_0x35ad('0x2'));var BPromise=require(_0x35ad('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x35ad('0x4'));var db=require(_0x35ad('0x5'))['db'];var utils=require(_0x35ad('0x6'));var logger=require(_0x35ad('0x7'))(_0x35ad('0x8'));var config=require(_0x35ad('0x9'));var jayson=require(_0x35ad('0xa'));var client=jayson[_0x35ad('0xb')][_0x35ad('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x31cc6a,_0x4edc59,_0x292521){return new BPromise(function(_0x3cec3e,_0x3f1f55){return client['request'](_0x31cc6a,_0x292521)[_0x35ad('0xd')](function(_0x487107){logger['info'](_0x35ad('0xe'),_0x4edc59,_0x35ad('0xf'));logger['debug'](_0x35ad('0x10'),_0x4edc59,_0x35ad('0xf'),JSON['stringify'](_0x487107));if(_0x487107['error']){if(_0x487107[_0x35ad('0x11')][_0x35ad('0x12')]===0x1f4){logger['error'](_0x35ad('0xe'),_0x4edc59,_0x487107[_0x35ad('0x11')]['message']);return _0x3f1f55(_0x487107['error'][_0x35ad('0x13')]);}logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x487107['error'][_0x35ad('0x13')]);return _0x3cec3e(_0x487107[_0x35ad('0x11')]['message']);}else{logger[_0x35ad('0x14')]('CmCustomField,\x20%s,\x20%s',_0x4edc59,'request\x20sent');_0x3cec3e(_0x487107[_0x35ad('0x15')][_0x35ad('0x13')]);}})[_0x35ad('0x16')](function(_0x56cb8e){logger[_0x35ad('0x11')](_0x35ad('0xe'),_0x4edc59,_0x56cb8e);_0x3f1f55(_0x56cb8e);});});} \ No newline at end of file +var _0xe107=['then','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','error','code','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise'];(function(_0x2c651a,_0x1e1bef){var _0x2cf6c0=function(_0x28c732){while(--_0x28c732){_0x2c651a['push'](_0x2c651a['shift']());}};_0x2cf6c0(++_0x1e1bef);}(_0xe107,0xb3));var _0x7e10=function(_0x136b20,_0x4eb6bb){_0x136b20=_0x136b20-0x0;var _0x1b8847=_0xe107[_0x136b20];return _0x1b8847;};'use strict';var _=require(_0x7e10('0x0'));var util=require('util');var moment=require(_0x7e10('0x1'));var BPromise=require(_0x7e10('0x2'));var rs=require(_0x7e10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e10('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x7e10('0x5'));var config=require(_0x7e10('0x6'));var jayson=require(_0x7e10('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1dd3de,_0x7378b3,_0x156c56){return new BPromise(function(_0x3413f7,_0x493958){return client['request'](_0x1dd3de,_0x156c56)[_0x7e10('0x8')](function(_0x490a7a){logger['info'](_0x7e10('0x9'),_0x7378b3,_0x7e10('0xa'));logger[_0x7e10('0xb')](_0x7e10('0xc'),_0x7378b3,_0x7e10('0xa'),JSON['stringify'](_0x490a7a));if(_0x490a7a[_0x7e10('0xd')]){if(_0x490a7a['error'][_0x7e10('0xe')]===0x1f4){logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0x490a7a['error'][_0x7e10('0xf')]);return _0x493958(_0x490a7a[_0x7e10('0xd')][_0x7e10('0xf')]);}logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0x490a7a[_0x7e10('0xd')][_0x7e10('0xf')]);return _0x3413f7(_0x490a7a[_0x7e10('0xd')]['message']);}else{logger[_0x7e10('0x10')](_0x7e10('0x9'),_0x7378b3,'request\x20sent');_0x3413f7(_0x490a7a['result'][_0x7e10('0xf')]);}})['catch'](function(_0xe1abd2){logger[_0x7e10('0xd')](_0x7e10('0x9'),_0x7378b3,_0xe1abd2);_0x493958(_0xe1abd2);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 0fc8f4f..c8b251e 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 _0xf443=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3eae65,_0x3c47c8){var _0x22751f=function(_0x5cf915){while(--_0x5cf915){_0x3eae65['push'](_0x3eae65['shift']());}};_0x22751f(++_0x3c47c8);}(_0xf443,0xc5));var _0x3f44=function(_0x4ca7d3,_0x464925){_0x4ca7d3=_0x4ca7d3-0x0;var _0x11b588=_0xf443[_0x4ca7d3];return _0x11b588;};'use strict';var multer=require('multer');var util=require(_0x3f44('0x0'));var path=require(_0x3f44('0x1'));var timeout=require(_0x3f44('0x2'));var express=require(_0x3f44('0x3'));var router=express['Router']();var auth=require(_0x3f44('0x4'));var interaction=require(_0x3f44('0x5'));var config=require(_0x3f44('0x6'));var controller=require(_0x3f44('0x7'));router[_0x3f44('0x8')]('/',auth['isAuthenticated'](),controller[_0x3f44('0x9')]);router[_0x3f44('0x8')](_0x3f44('0xa'),auth[_0x3f44('0xb')](),controller[_0x3f44('0xc')]);router[_0x3f44('0xd')]('/',auth[_0x3f44('0xb')](),controller[_0x3f44('0xe')]);router[_0x3f44('0xf')](_0x3f44('0xa'),auth['isAuthenticated'](),controller[_0x3f44('0x10')]);router[_0x3f44('0x11')](_0x3f44('0xa'),auth[_0x3f44('0xb')](),controller[_0x3f44('0x12')]);module[_0x3f44('0x13')]=router; \ No newline at end of file +var _0xc30f=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x1de0b9,_0xc6f046){var _0x18edae=function(_0x2d3ad1){while(--_0x2d3ad1){_0x1de0b9['push'](_0x1de0b9['shift']());}};_0x18edae(++_0xc6f046);}(_0xc30f,0x1a1));var _0xfc30=function(_0x4d0f1c,_0x314943){_0x4d0f1c=_0x4d0f1c-0x0;var _0x33a5ec=_0xc30f[_0x4d0f1c];return _0x33a5ec;};'use strict';var multer=require(_0xfc30('0x0'));var util=require(_0xfc30('0x1'));var path=require(_0xfc30('0x2'));var timeout=require(_0xfc30('0x3'));var express=require(_0xfc30('0x4'));var router=express[_0xfc30('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xfc30('0x6'));var config=require(_0xfc30('0x7'));var controller=require('./cmCustomField.controller');router[_0xfc30('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xfc30('0x9'),auth[_0xfc30('0xa')](),controller[_0xfc30('0xb')]);router[_0xfc30('0xc')]('/',auth[_0xfc30('0xa')](),controller[_0xfc30('0xd')]);router[_0xfc30('0xe')](_0xfc30('0x9'),auth[_0xfc30('0xa')](),controller[_0xfc30('0xf')]);router[_0xfc30('0x10')]('/:id',auth['isAuthenticated'](),controller[_0xfc30('0x11')]);module[_0xfc30('0x12')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index c280a6a..eb522c9 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 _0xc688=['INTEGER','UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x12aa33,_0x2ab658){var _0x33c48f=function(_0x33052d){while(--_0x33052d){_0x12aa33['push'](_0x12aa33['shift']());}};_0x33c48f(++_0x2ab658);}(_0xc688,0xc0));var _0x8c68=function(_0x27d327,_0x2065dd){_0x27d327=_0x27d327-0x0;var _0xbe6d7e=_0xc688[_0x27d327];return _0xbe6d7e;};'use strict';var moment=require(_0x8c68('0x0'));var Sequelize=require(_0x8c68('0x1'));module['exports']={'phone':{'type':Sequelize[_0x8c68('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x8c68('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0x8c68('0x4')](_0x8c68('0x5'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x8c68('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'callback':{'type':Sequelize[_0x8c68('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize['INTEGER'](0x2)[_0x8c68('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x8c68('0x8')},'ListId':{'type':Sequelize[_0x8c68('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x8c68('0x6')]},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':_0x8c68('0x8')},'CampaignId':{'type':Sequelize[_0x8c68('0x6')]}}; \ No newline at end of file +var _0xd50d=['DATE','UNSIGNED','contactListQueue','moment','sequelize','exports','STRING','BOOLEAN','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x23aef2,_0x6ade5f){var _0x56a834=function(_0x3dca48){while(--_0x3dca48){_0x23aef2['push'](_0x23aef2['shift']());}};_0x56a834(++_0x6ade5f);}(_0xd50d,0xc9));var _0xdd50=function(_0x4d6f9e,_0x1ad1a){_0x4d6f9e=_0x4d6f9e-0x0;var _0x4dc9da=_0xd50d[_0x4d6f9e];return _0x4dc9da;};'use strict';var moment=require(_0xdd50('0x0'));var Sequelize=require(_0xdd50('0x1'));module[_0xdd50('0x2')]={'phone':{'type':Sequelize[_0xdd50('0x3')],'allowNull':![]},'active':{'type':Sequelize[_0xdd50('0x4')],'defaultValue':![]},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':moment()[_0xdd50('0x5')](_0xdd50('0x6'))},'countbusyretry':{'type':Sequelize[_0xdd50('0x7')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xdd50('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xdd50('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0xdd50('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xdd50('0x8')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xdd50('0x9')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xdd50('0x7')],'unique':_0xdd50('0xa')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0xdd50('0xa')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0xdd50('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 2a9377f..0130ecf 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 _0x1a1e=['../../config/license/hardware','../../config/logger','api','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopper','rawAttributes','fieldName','type','key','keys','query','model','filters','concat','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$notIn','$like','$notLike','$notILike','$overlap','$contains','$contained','$any','attributes','intersection','fields','length','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','VoiceQueueId','Campaign','CampaignId','omit','dataValues','createdAt','updatedAt','statedesc','deleted','campaign','user','UserId','format','calleridnum','phone','campaigntype','ivr','CmContact','lastName','isNil','calleridname','getPreview','getVoiceQueues','outbound','dialOrderByScheduledAt','transaction','direction','prev','hopperIds','priority','ASC','scheduledAt','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','isEmpty','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','Company','List','VoiceQueue','dialActive','getOpenContacts','preview','YYYY-MM-DD\x20HH:mm:ss','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x559965,_0x1aa3ae){var _0x164b40=function(_0x306386){while(--_0x306386){_0x559965['push'](_0x559965['shift']());}};_0x164b40(++_0x1aa3ae);}(_0x1a1e,0x198));var _0xe1a1=function(_0x437e08,_0x1cab6c){_0x437e08=_0x437e08-0x0;var _0xcf57f2=_0x1a1e[_0x437e08];return _0xcf57f2;};'use strict';var pdf=require(_0xe1a1('0x0'));var emlformat=require(_0xe1a1('0x1'));var rimraf=require(_0xe1a1('0x2'));var zipdir=require(_0xe1a1('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe1a1('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe1a1('0x5'));var path=require(_0xe1a1('0x6'));var sox=require(_0xe1a1('0x7'));var csv=require(_0xe1a1('0x8'));var ejs=require(_0xe1a1('0x9'));var fs=require('fs');var _=require(_0xe1a1('0xa'));var squel=require(_0xe1a1('0xb'));var crypto=require(_0xe1a1('0xc'));var jsforce=require(_0xe1a1('0xd'));var deskjs=require(_0xe1a1('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe1a1('0xf'));var Papa=require('papaparse');var Redis=require(_0xe1a1('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xe1a1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe1a1('0x12'));var logger=require(_0xe1a1('0x13'))(_0xe1a1('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c37b0,_0x1edade){_0x1edade=_0x1edade||0xcc;return function(_0x20acc9){if(_0x20acc9){return _0x1c37b0[_0xe1a1('0x15')](_0x1edade);}return _0x1c37b0[_0xe1a1('0x16')](_0x1edade)[_0xe1a1('0x17')]();};}function respondWithResult(_0x1a1a16,_0x3c0ba4){_0x3c0ba4=_0x3c0ba4||0xc8;return function(_0x1a205d){if(_0x1a205d){return _0x1a1a16[_0xe1a1('0x16')](_0x3c0ba4)[_0xe1a1('0x18')](_0x1a205d);}};}function respondWithFilteredResult(_0x539227,_0x396985){return function(_0x28526f){if(_0x28526f){var _0x46720d=_0x28526f[_0xe1a1('0x19')],_0x29e017=_0x396985[_0xe1a1('0x1a')],_0x445f8a=_0x396985['offset']+_0x396985['limit'],_0xc22289;if(_0x445f8a>=_0x46720d){_0x445f8a=_0x46720d;_0xc22289=0xc8;}else{_0xc22289=0xce;}_0x539227[_0xe1a1('0x16')](_0xc22289);return _0x539227[_0xe1a1('0x1b')](_0xe1a1('0x1c'),_0x29e017+'-'+_0x445f8a+'/'+_0x46720d)[_0xe1a1('0x18')](_0x28526f);}return null;};}function patchUpdates(_0xb2ea9e){return function(_0x17d1a5){try{jsonpatch[_0xe1a1('0x1d')](_0x17d1a5,_0xb2ea9e,!![]);}catch(_0x4e4b19){return BPromise[_0xe1a1('0x1e')](_0x4e4b19);}return _0x17d1a5[_0xe1a1('0x1f')]();};}function saveUpdates(_0x404335,_0x166c8a){return function(_0x36d540){if(_0x36d540){return _0x36d540[_0xe1a1('0x20')](_0x404335)[_0xe1a1('0x21')](function(_0x2e935e){return _0x2e935e;});}return null;};}function removeEntity(_0xc40ea1,_0x16a86e){return function(_0x17a12c){if(_0x17a12c){return _0x17a12c[_0xe1a1('0x22')]()['then'](function(){_0xc40ea1[_0xe1a1('0x16')](0xcc)[_0xe1a1('0x17')]();});}};}function handleEntityNotFound(_0x9e9849,_0x1c7b47){return function(_0x37012d){if(!_0x37012d){_0x9e9849[_0xe1a1('0x15')](0x194);}return _0x37012d;};}function handleError(_0x3a2a24,_0x54c9d8){_0x54c9d8=_0x54c9d8||0x1f4;return function(_0x5cb665){logger[_0xe1a1('0x23')](_0x5cb665[_0xe1a1('0x24')]);if(_0x5cb665[_0xe1a1('0x25')]){delete _0x5cb665[_0xe1a1('0x25')];}_0x3a2a24[_0xe1a1('0x16')](_0x54c9d8)[_0xe1a1('0x26')](_0x5cb665);};}exports[_0xe1a1('0x27')]=function(_0x1301fe,_0x1d7ca0){var _0x461a8d={},_0x3c908c={},_0x5a8e7b={'count':0x0,'rows':[]};var _0x4c407f=_[_0xe1a1('0x28')](db[_0xe1a1('0x29')][_0xe1a1('0x2a')],function(_0x4e546d){return{'name':_0x4e546d[_0xe1a1('0x2b')],'type':_0x4e546d[_0xe1a1('0x2c')][_0xe1a1('0x2d')]};});_0x3c908c['model']=_['map'](_0x4c407f,'name');_0x3c908c['query']=_[_0xe1a1('0x2e')](_0x1301fe[_0xe1a1('0x2f')]);_0x3c908c['filters']=_['intersection'](_0x3c908c[_0xe1a1('0x30')],_0x3c908c['query']);_0x3c908c[_0xe1a1('0x31')]=_[_0xe1a1('0x32')](_0x3c908c[_0xe1a1('0x31')],['$and',_0xe1a1('0x33'),_0xe1a1('0x34'),_0xe1a1('0x35'),_0xe1a1('0x36'),_0xe1a1('0x37'),_0xe1a1('0x38'),_0xe1a1('0x39'),_0xe1a1('0x3a'),_0xe1a1('0x3b'),_0xe1a1('0x3c'),'$in',_0xe1a1('0x3d'),_0xe1a1('0x3e'),_0xe1a1('0x3f'),'$iLike',_0xe1a1('0x40'),_0xe1a1('0x3e'),_0xe1a1('0x41'),_0xe1a1('0x42'),_0xe1a1('0x43'),_0xe1a1('0x44')]);_0x461a8d[_0xe1a1('0x45')]=_[_0xe1a1('0x46')](_0x3c908c[_0xe1a1('0x30')],qs['fields'](_0x1301fe['query'][_0xe1a1('0x47')]));_0x461a8d[_0xe1a1('0x45')]=_0x461a8d[_0xe1a1('0x45')][_0xe1a1('0x48')]?_0x461a8d['attributes']:_0x3c908c[_0xe1a1('0x30')];if(!_0x1301fe[_0xe1a1('0x2f')]['hasOwnProperty']('nolimit')){_0x461a8d['limit']=qs['limit'](_0x1301fe[_0xe1a1('0x2f')]['limit']);_0x461a8d[_0xe1a1('0x1a')]=qs['offset'](_0x1301fe[_0xe1a1('0x2f')]['offset']);}_0x461a8d[_0xe1a1('0x49')]=qs['sort'](_0x1301fe['query'][_0xe1a1('0x4a')]);_0x461a8d['where']=qs[_0xe1a1('0x31')](_[_0xe1a1('0x4b')](_0x1301fe[_0xe1a1('0x2f')],_0x3c908c['filters']));if(_0x1301fe['query'][_0xe1a1('0x4c')]){_0x461a8d[_0xe1a1('0x4d')]=_[_0xe1a1('0x4e')](_0x461a8d[_0xe1a1('0x4d')],{'$or':_[_0xe1a1('0x28')](_0x4c407f,function(_0x3a274d){if(_0x3a274d[_0xe1a1('0x2c')]!==_0xe1a1('0x4f')){var _0x1b1132={};_0x1b1132[_0x3a274d[_0xe1a1('0x25')]]={'$like':'%'+_0x1301fe[_0xe1a1('0x2f')][_0xe1a1('0x4c')]+'%'};return _0x1b1132;}})});}_0x461a8d=_[_0xe1a1('0x4e')]({},_0x461a8d,_0x1301fe[_0xe1a1('0x50')]);var _0x40ef5a={'where':_0x461a8d[_0xe1a1('0x4d')]};return db['CmHopper']['count'](_0x40ef5a)['then'](function(_0x32b92c){_0x5a8e7b[_0xe1a1('0x19')]=_0x32b92c;if(_0x1301fe[_0xe1a1('0x2f')][_0xe1a1('0x51')]){_0x461a8d[_0xe1a1('0x52')]=[{'all':!![]}];}return db['CmHopper'][_0xe1a1('0x53')](_0x461a8d);})[_0xe1a1('0x21')](function(_0xd55b51){_0x5a8e7b['rows']=_0xd55b51;return _0x5a8e7b;})[_0xe1a1('0x21')](respondWithFilteredResult(_0x1d7ca0,_0x461a8d))[_0xe1a1('0x54')](handleError(_0x1d7ca0,null));};exports[_0xe1a1('0x55')]=function(_0x2dc37e,_0x4500ac){var _0x1c5530={'raw':!![],'where':{'id':_0x2dc37e[_0xe1a1('0x56')]['id']}},_0x54afb5={};_0x54afb5[_0xe1a1('0x30')]=_[_0xe1a1('0x2e')](db['CmHopper']['rawAttributes']);_0x54afb5[_0xe1a1('0x2f')]=_['keys'](_0x2dc37e[_0xe1a1('0x2f')]);_0x54afb5[_0xe1a1('0x31')]=_['intersection'](_0x54afb5['model'],_0x54afb5[_0xe1a1('0x2f')]);_0x1c5530[_0xe1a1('0x45')]=_[_0xe1a1('0x46')](_0x54afb5['model'],qs[_0xe1a1('0x47')](_0x2dc37e[_0xe1a1('0x2f')][_0xe1a1('0x47')]));_0x1c5530[_0xe1a1('0x45')]=_0x1c5530['attributes']['length']?_0x1c5530['attributes']:_0x54afb5[_0xe1a1('0x30')];if(_0x2dc37e[_0xe1a1('0x2f')][_0xe1a1('0x51')]){_0x1c5530[_0xe1a1('0x52')]=[{'all':!![]}];}_0x1c5530=_['merge']({},_0x1c5530,_0x2dc37e[_0xe1a1('0x50')]);return db[_0xe1a1('0x29')][_0xe1a1('0x57')](_0x1c5530)[_0xe1a1('0x21')](handleEntityNotFound(_0x4500ac,null))[_0xe1a1('0x21')](respondWithResult(_0x4500ac,null))[_0xe1a1('0x54')](handleError(_0x4500ac,null));};exports[_0xe1a1('0x58')]=function(_0x23e9c3,_0x236fdb){return db[_0xe1a1('0x29')]['create'](_0x23e9c3[_0xe1a1('0x59')],{})[_0xe1a1('0x21')](respondWithResult(_0x236fdb,0xc9))[_0xe1a1('0x54')](handleError(_0x236fdb,null));};exports[_0xe1a1('0x20')]=function(_0x56845d,_0x2bdac9){if(_0x56845d[_0xe1a1('0x59')]['id']){delete _0x56845d[_0xe1a1('0x59')]['id'];}return db[_0xe1a1('0x29')][_0xe1a1('0x57')]({'where':{'id':_0x56845d['params']['id']}})[_0xe1a1('0x21')](handleEntityNotFound(_0x2bdac9,null))['then'](saveUpdates(_0x56845d[_0xe1a1('0x59')],null))['then'](respondWithResult(_0x2bdac9,null))[_0xe1a1('0x54')](handleError(_0x2bdac9,null));};exports['describe']=function(_0x5aa9b6,_0x1130d8){return db['CmHopper'][_0xe1a1('0x5a')]()[_0xe1a1('0x21')](respondWithResult(_0x1130d8,null))[_0xe1a1('0x54')](handleError(_0x1130d8,null));};exports[_0xe1a1('0x22')]=function(_0x293139,_0x19c831){var _0x2ba701;return db['CmHopper'][_0xe1a1('0x57')]({'where':{'id':_0x293139[_0xe1a1('0x56')]['id']}})['then'](handleEntityNotFound(_0x19c831,null))[_0xe1a1('0x21')](function(_0x1039db){if(_0x1039db){return _0x1039db['destroy']()[_0xe1a1('0x21')](function(_0x1055f2){return _0x1055f2;});}})[_0xe1a1('0x21')](function(_0x4e3762){_0x2ba701=_0x4e3762;if(_0x4e3762){if(_0x4e3762['VoiceQueueId']||_0x4e3762['CampaignId']){return db[_0x4e3762[_0xe1a1('0x5b')]?'VoiceQueue':_0xe1a1('0x5c')][_0xe1a1('0x57')]({'where':{'id':_0x4e3762['VoiceQueueId']?_0x4e3762[_0xe1a1('0x5b')]:_0x4e3762[_0xe1a1('0x5d')]},'attributes':['id','name'],'raw':!![]});}}})[_0xe1a1('0x21')](function(_0x3b24e8){var _0x56411c={};if(_0x3b24e8){_[_0xe1a1('0x4e')](_0x56411c,_[_0xe1a1('0x5e')](_0x2ba701[_0xe1a1('0x5f')],[_0xe1a1('0x60'),_0xe1a1('0x61'),'id']));_0x56411c['state']=0x15;_0x56411c[_0xe1a1('0x62')]=_0xe1a1('0x63');_0x56411c[_0xe1a1('0x64')]=_0x3b24e8[_0xe1a1('0x25')];_0x56411c['membername']=_0x293139[_0xe1a1('0x65')][_0xe1a1('0x25')];_0x56411c[_0xe1a1('0x66')]=_0x293139['user']['id'];_0x56411c['deleted']=!![];_0x56411c['deletedat']=moment()[_0xe1a1('0x67')]('YYYY-MM-DD\x20HH:mm:ss');_0x56411c[_0xe1a1('0x68')]=_0x2ba701[_0xe1a1('0x69')];_0x56411c[_0xe1a1('0x6a')]=_0x2ba701[_0xe1a1('0x5b')]?'queue':_0xe1a1('0x6b');return db[_0xe1a1('0x6c')][_0xe1a1('0x57')]({'where':{'id':_0x56411c['ContactId']},'attributes':['firstName',_0xe1a1('0x6d')]})[_0xe1a1('0x21')](function(_0x12378d){if(!_[_0xe1a1('0x6e')](_0x19c831)&&!_[_0xe1a1('0x6e')](_0x12378d['firstName'])){_0x56411c[_0xe1a1('0x6f')]=_0x12378d['firstName'];if(!_['isNil'](_0x12378d[_0xe1a1('0x6d')])){_0x56411c[_0xe1a1('0x6f')]+='\x20'+_0x12378d[_0xe1a1('0x6d')];}}})['finally'](function(){return db['CmHopperFinal'][_0xe1a1('0x58')](_0x56411c);});}})[_0xe1a1('0x21')](function(){return _0x19c831[_0xe1a1('0x16')](0xcc)['end']();})[_0xe1a1('0x54')](handleError(_0x19c831,null));};exports[_0xe1a1('0x70')]=function(_0x5efadf,_0x1fdb5e,_0x5118d8){var _0x23f59a=[];return db[_0xe1a1('0x6c')][_0xe1a1('0x5a')]()[_0xe1a1('0x21')](function(_0x4b0391){_0x23f59a=_[_0xe1a1('0x2e')](_0x4b0391);return _0x5efadf['user'][_0xe1a1('0x71')]({'where':{'type':_0xe1a1('0x72'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id',_0xe1a1('0x73')],'raw':!![]});})[_0xe1a1('0x21')](function(_0x2ff54a){if(_0x2ff54a&&_0x2ff54a[_0xe1a1('0x48')]){return db['sequelize'][_0xe1a1('0x74')](function(_0x141fc7){var _0x42277a={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')},'VoiceQueueId':{'$in':_[_0xe1a1('0x28')](_0x2ff54a,'id')},'$or':[{'UserId':null},{'UserId':_0x5efadf[_0xe1a1('0x65')]['id']}]};var _0x920fe=[];if(_0x5efadf[_0xe1a1('0x59')]['direction']&&_0x5efadf[_0xe1a1('0x59')][_0xe1a1('0x75')]===_0xe1a1('0x76')){if(!_['isEmpty'](_0x5efadf[_0xe1a1('0x59')][_0xe1a1('0x77')])){_0x42277a['id']={'$in':_0x5efadf[_0xe1a1('0x59')][_0xe1a1('0x77')]};}_0x920fe=[[_0xe1a1('0x78'),_0xe1a1('0x79')],[_0xe1a1('0x7a'),_0x2ff54a[0x0]['dialOrderByScheduledAt']===_0xe1a1('0x79')?_0xe1a1('0x7b'):_0xe1a1('0x79')],db[_0xe1a1('0x7c')][_0xe1a1('0x7d')](_0xe1a1('0x7e')),['id','DESC']];}else{if(!_[_0xe1a1('0x7f')](_0x5efadf[_0xe1a1('0x59')][_0xe1a1('0x77')])){_0x42277a['id']={'$notIn':_0x5efadf[_0xe1a1('0x59')][_0xe1a1('0x77')]};}_0x920fe=[[_0xe1a1('0x78'),_0xe1a1('0x7b')],[_0xe1a1('0x7a'),_0x2ff54a[0x0]['dialOrderByScheduledAt']],db['sequelize'][_0xe1a1('0x7d')](_0xe1a1('0x80')),['id',_0xe1a1('0x79')]];}return db[_0xe1a1('0x29')][_0xe1a1('0x81')]({'attributes':['id',_0xe1a1('0x82')],'where':_0x42277a,'order':_0x920fe,'transaction':_0x141fc7,'lock':_0x141fc7['LOCK'][_0xe1a1('0x83')],'include':[{'model':db['CmContact'],'as':'Contact','attributes':_0x23f59a,'include':[{'model':db['CmCompany'],'as':_0xe1a1('0x84'),'attributes':['id',_0xe1a1('0x25')]}]},{'model':db['CmList'],'as':_0xe1a1('0x85'),'attributes':['id','name']},{'model':db[_0xe1a1('0x86')],'as':'Queue','attributes':['id',_0xe1a1('0x25'),_0xe1a1('0x87')]}]})[_0xe1a1('0x21')](function(_0x25b8ff){if(_0x25b8ff){return _0x25b8ff[_0xe1a1('0x20')]({'UserId':_0x5efadf[_0xe1a1('0x65')]['id']},{'transaction':_0x141fc7});}});});}})[_0xe1a1('0x21')](handleEntityNotFound(_0x1fdb5e,null))[_0xe1a1('0x21')](respondWithResult(_0x1fdb5e,null))[_0xe1a1('0x54')](handleError(_0x1fdb5e,null));};exports[_0xe1a1('0x88')]=function(_0x410e0b,_0x34e953,_0x29efaa){return _0x410e0b[_0xe1a1('0x65')][_0xe1a1('0x71')]({'where':{'type':_0xe1a1('0x72'),'dialActive':!![],'dialMethod':_0xe1a1('0x89')},'attributes':['id'],'raw':!![]})[_0xe1a1('0x21')](function(_0x1d77d1){if(_0x1d77d1&&_0x1d77d1[_0xe1a1('0x48')]){return db['CmHopper'][_0xe1a1('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xe1a1('0x67')](_0xe1a1('0x8a'))},'VoiceQueueId':{'$in':_[_0xe1a1('0x28')](_0x1d77d1,'id')},'$or':[{'UserId':null},{'UserId':_0x410e0b[_0xe1a1('0x65')]['id']}]}});}return 0x0;})[_0xe1a1('0x21')](function(_0x344169){if(!_['isNil'](_0x344169)&&_[_0xe1a1('0x8b')](_0x344169)){return _0x34e953[_0xe1a1('0x16')](0xc8)[_0xe1a1('0x18')]({'contacts':_0x344169});}else{logger[_0xe1a1('0x23')](_0xe1a1('0x8c'),_0xe1a1('0x88'),0x194,_0xe1a1('0x8d'));_0x34e953[_0xe1a1('0x15')](0x194);}})['catch'](handleError(_0x34e953,null));}; \ No newline at end of file +var _0xe48a=['reject','save','update','then','destroy','sendStatus','name','send','index','map','CmHopper','rawAttributes','fieldName','key','query','keys','filters','intersection','model','$and','$or','$gt','$gte','$lte','$not','$between','$notIn','$like','$iLike','$overlap','$contains','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','type','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','VoiceQueueId','CampaignId','Campaign','omit','dataValues','createdAt','state','statedesc','membername','user','UserId','deleted','deletedat','format','calleridnum','phone','campaigntype','queue','CmContact','lastName','isNil','firstName','calleridname','getPreview','outbound','preview','dialOrderByScheduledAt','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','ASC','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','scheduledAt','sequelize','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','CmList','List','dialActive','getOpenContacts','getVoiceQueues','isNumber','error','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','eml-format','rimraf','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','end','count','offset','limit','Content-Range','json','apply'];(function(_0x1c5860,_0x49638a){var _0x33970c=function(_0x43bbf7){while(--_0x43bbf7){_0x1c5860['push'](_0x1c5860['shift']());}};_0x33970c(++_0x49638a);}(_0xe48a,0x6b));var _0xae48=function(_0x3e7bb8,_0x11f26c){_0x3e7bb8=_0x3e7bb8-0x0;var _0x160bf4=_0xe48a[_0x3e7bb8];return _0x160bf4;};'use strict';var pdf=require(_0xae48('0x0'));var emlformat=require(_0xae48('0x1'));var rimraf=require(_0xae48('0x2'));var zipdir=require(_0xae48('0x3'));var jsonpatch=require(_0xae48('0x4'));var rp=require(_0xae48('0x5'));var moment=require(_0xae48('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xae48('0x7'));var util=require(_0xae48('0x8'));var path=require('path');var sox=require(_0xae48('0x9'));var csv=require(_0xae48('0xa'));var ejs=require(_0xae48('0xb'));var fs=require('fs');var _=require(_0xae48('0xc'));var squel=require('squel');var crypto=require(_0xae48('0xd'));var jsforce=require(_0xae48('0xe'));var deskjs=require(_0xae48('0xf'));var toCsv=require(_0xae48('0xa'));var querystring=require(_0xae48('0x10'));var Papa=require(_0xae48('0x11'));var Redis=require(_0xae48('0x12'));var authService=require(_0xae48('0x13'));var qs=require(_0xae48('0x14'));var as=require(_0xae48('0x15'));var hardwareService=require(_0xae48('0x16'));var logger=require(_0xae48('0x17'))('api');var utils=require('../../config/utils');var config=require(_0xae48('0x18'));var db=require(_0xae48('0x19'))['db'];function respondWithStatusCode(_0x7708ca,_0x5a5b77){_0x5a5b77=_0x5a5b77||0xcc;return function(_0x16f225){if(_0x16f225){return _0x7708ca['sendStatus'](_0x5a5b77);}return _0x7708ca[_0xae48('0x1a')](_0x5a5b77)[_0xae48('0x1b')]();};}function respondWithResult(_0x3897a1,_0x247ba9){_0x247ba9=_0x247ba9||0xc8;return function(_0x19de6b){if(_0x19de6b){return _0x3897a1['status'](_0x247ba9)['json'](_0x19de6b);}};}function respondWithFilteredResult(_0x165f7f,_0x53e53c){return function(_0x27c10a){if(_0x27c10a){var _0x375ca7=_0x27c10a[_0xae48('0x1c')],_0x2cb4ce=_0x53e53c[_0xae48('0x1d')],_0x28caae=_0x53e53c['offset']+_0x53e53c[_0xae48('0x1e')],_0x4e4144;if(_0x28caae>=_0x375ca7){_0x28caae=_0x375ca7;_0x4e4144=0xc8;}else{_0x4e4144=0xce;}_0x165f7f[_0xae48('0x1a')](_0x4e4144);return _0x165f7f['set'](_0xae48('0x1f'),_0x2cb4ce+'-'+_0x28caae+'/'+_0x375ca7)[_0xae48('0x20')](_0x27c10a);}return null;};}function patchUpdates(_0x128ad7){return function(_0x448466){try{jsonpatch[_0xae48('0x21')](_0x448466,_0x128ad7,!![]);}catch(_0x8f35da){return BPromise[_0xae48('0x22')](_0x8f35da);}return _0x448466[_0xae48('0x23')]();};}function saveUpdates(_0x187a79,_0xaeb0b0){return function(_0x41a716){if(_0x41a716){return _0x41a716[_0xae48('0x24')](_0x187a79)[_0xae48('0x25')](function(_0x48e310){return _0x48e310;});}return null;};}function removeEntity(_0x14924f,_0x1dfcf3){return function(_0x2abfeb){if(_0x2abfeb){return _0x2abfeb[_0xae48('0x26')]()[_0xae48('0x25')](function(){_0x14924f[_0xae48('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x563cce,_0x149713){return function(_0x29c350){if(!_0x29c350){_0x563cce[_0xae48('0x27')](0x194);}return _0x29c350;};}function handleError(_0x3c06c9,_0x47a553){_0x47a553=_0x47a553||0x1f4;return function(_0x22d5b2){logger['error'](_0x22d5b2['stack']);if(_0x22d5b2[_0xae48('0x28')]){delete _0x22d5b2[_0xae48('0x28')];}_0x3c06c9[_0xae48('0x1a')](_0x47a553)[_0xae48('0x29')](_0x22d5b2);};}exports[_0xae48('0x2a')]=function(_0x1bb458,_0x54aa32){var _0x1824b5={},_0x11dfb9={},_0x25cbf5={'count':0x0,'rows':[]};var _0x2eb00a=_[_0xae48('0x2b')](db[_0xae48('0x2c')][_0xae48('0x2d')],function(_0x4cdb06){return{'name':_0x4cdb06[_0xae48('0x2e')],'type':_0x4cdb06['type'][_0xae48('0x2f')]};});_0x11dfb9['model']=_[_0xae48('0x2b')](_0x2eb00a,'name');_0x11dfb9[_0xae48('0x30')]=_[_0xae48('0x31')](_0x1bb458[_0xae48('0x30')]);_0x11dfb9[_0xae48('0x32')]=_[_0xae48('0x33')](_0x11dfb9[_0xae48('0x34')],_0x11dfb9[_0xae48('0x30')]);_0x11dfb9['filters']=_['concat'](_0x11dfb9['filters'],[_0xae48('0x35'),_0xae48('0x36'),_0xae48('0x37'),_0xae48('0x38'),'$lt',_0xae48('0x39'),'$ne','$eq',_0xae48('0x3a'),_0xae48('0x3b'),'$notBetween','$in',_0xae48('0x3c'),_0xae48('0x3d'),'$notLike',_0xae48('0x3e'),'$notILike',_0xae48('0x3d'),_0xae48('0x3f'),_0xae48('0x40'),'$contained','$any']);_0x1824b5['attributes']=_[_0xae48('0x33')](_0x11dfb9[_0xae48('0x34')],qs[_0xae48('0x41')](_0x1bb458['query'][_0xae48('0x41')]));_0x1824b5[_0xae48('0x42')]=_0x1824b5[_0xae48('0x42')][_0xae48('0x43')]?_0x1824b5[_0xae48('0x42')]:_0x11dfb9['model'];if(!_0x1bb458[_0xae48('0x30')][_0xae48('0x44')]('nolimit')){_0x1824b5[_0xae48('0x1e')]=qs[_0xae48('0x1e')](_0x1bb458[_0xae48('0x30')][_0xae48('0x1e')]);_0x1824b5[_0xae48('0x1d')]=qs['offset'](_0x1bb458[_0xae48('0x30')][_0xae48('0x1d')]);}_0x1824b5[_0xae48('0x45')]=qs[_0xae48('0x46')](_0x1bb458['query']['sort']);_0x1824b5[_0xae48('0x47')]=qs['filters'](_['pick'](_0x1bb458[_0xae48('0x30')],_0x11dfb9[_0xae48('0x32')]));if(_0x1bb458[_0xae48('0x30')][_0xae48('0x48')]){_0x1824b5[_0xae48('0x47')]=_[_0xae48('0x49')](_0x1824b5[_0xae48('0x47')],{'$or':_['map'](_0x2eb00a,function(_0x408360){if(_0x408360[_0xae48('0x4a')]!=='VIRTUAL'){var _0x5369d6={};_0x5369d6[_0x408360[_0xae48('0x28')]]={'$like':'%'+_0x1bb458[_0xae48('0x30')][_0xae48('0x48')]+'%'};return _0x5369d6;}})});}_0x1824b5=_[_0xae48('0x49')]({},_0x1824b5,_0x1bb458[_0xae48('0x4b')]);var _0x415f06={'where':_0x1824b5[_0xae48('0x47')]};return db[_0xae48('0x2c')][_0xae48('0x1c')](_0x415f06)[_0xae48('0x25')](function(_0x5f294a){_0x25cbf5['count']=_0x5f294a;if(_0x1bb458['query'][_0xae48('0x4c')]){_0x1824b5[_0xae48('0x4d')]=[{'all':!![]}];}return db[_0xae48('0x2c')][_0xae48('0x4e')](_0x1824b5);})[_0xae48('0x25')](function(_0x3eb6b4){_0x25cbf5['rows']=_0x3eb6b4;return _0x25cbf5;})[_0xae48('0x25')](respondWithFilteredResult(_0x54aa32,_0x1824b5))[_0xae48('0x4f')](handleError(_0x54aa32,null));};exports[_0xae48('0x50')]=function(_0x37ef39,_0x992466){var _0xbbe013={'raw':!![],'where':{'id':_0x37ef39[_0xae48('0x51')]['id']}},_0x194e32={};_0x194e32[_0xae48('0x34')]=_['keys'](db[_0xae48('0x2c')][_0xae48('0x2d')]);_0x194e32[_0xae48('0x30')]=_[_0xae48('0x31')](_0x37ef39[_0xae48('0x30')]);_0x194e32[_0xae48('0x32')]=_[_0xae48('0x33')](_0x194e32[_0xae48('0x34')],_0x194e32[_0xae48('0x30')]);_0xbbe013[_0xae48('0x42')]=_['intersection'](_0x194e32['model'],qs[_0xae48('0x41')](_0x37ef39['query'][_0xae48('0x41')]));_0xbbe013[_0xae48('0x42')]=_0xbbe013['attributes'][_0xae48('0x43')]?_0xbbe013[_0xae48('0x42')]:_0x194e32[_0xae48('0x34')];if(_0x37ef39[_0xae48('0x30')][_0xae48('0x4c')]){_0xbbe013[_0xae48('0x4d')]=[{'all':!![]}];}_0xbbe013=_[_0xae48('0x49')]({},_0xbbe013,_0x37ef39[_0xae48('0x4b')]);return db['CmHopper'][_0xae48('0x52')](_0xbbe013)[_0xae48('0x25')](handleEntityNotFound(_0x992466,null))[_0xae48('0x25')](respondWithResult(_0x992466,null))[_0xae48('0x4f')](handleError(_0x992466,null));};exports[_0xae48('0x53')]=function(_0x49ddfe,_0x2a7449){return db[_0xae48('0x2c')][_0xae48('0x53')](_0x49ddfe[_0xae48('0x54')],{})['then'](respondWithResult(_0x2a7449,0xc9))[_0xae48('0x4f')](handleError(_0x2a7449,null));};exports[_0xae48('0x24')]=function(_0x52c301,_0x159b91){if(_0x52c301[_0xae48('0x54')]['id']){delete _0x52c301['body']['id'];}return db[_0xae48('0x2c')][_0xae48('0x52')]({'where':{'id':_0x52c301[_0xae48('0x51')]['id']}})[_0xae48('0x25')](handleEntityNotFound(_0x159b91,null))[_0xae48('0x25')](saveUpdates(_0x52c301[_0xae48('0x54')],null))[_0xae48('0x25')](respondWithResult(_0x159b91,null))['catch'](handleError(_0x159b91,null));};exports[_0xae48('0x55')]=function(_0x154284,_0x3a4d85){return db[_0xae48('0x2c')][_0xae48('0x55')]()[_0xae48('0x25')](respondWithResult(_0x3a4d85,null))[_0xae48('0x4f')](handleError(_0x3a4d85,null));};exports[_0xae48('0x26')]=function(_0x33be7d,_0x3f51dd){var _0x5c8a16;return db[_0xae48('0x2c')][_0xae48('0x52')]({'where':{'id':_0x33be7d[_0xae48('0x51')]['id']}})['then'](handleEntityNotFound(_0x3f51dd,null))[_0xae48('0x25')](function(_0x561750){if(_0x561750){return _0x561750[_0xae48('0x26')]()[_0xae48('0x25')](function(_0x2f2e72){return _0x2f2e72;});}})[_0xae48('0x25')](function(_0x513037){_0x5c8a16=_0x513037;if(_0x513037){if(_0x513037[_0xae48('0x56')]||_0x513037[_0xae48('0x57')]){return db[_0x513037['VoiceQueueId']?'VoiceQueue':_0xae48('0x58')][_0xae48('0x52')]({'where':{'id':_0x513037[_0xae48('0x56')]?_0x513037['VoiceQueueId']:_0x513037['CampaignId']},'attributes':['id','name'],'raw':!![]});}}})['then'](function(_0x17efd8){var _0x1a8784={};if(_0x17efd8){_[_0xae48('0x49')](_0x1a8784,_[_0xae48('0x59')](_0x5c8a16[_0xae48('0x5a')],[_0xae48('0x5b'),'updatedAt','id']));_0x1a8784[_0xae48('0x5c')]=0x15;_0x1a8784[_0xae48('0x5d')]='deleted';_0x1a8784['campaign']=_0x17efd8[_0xae48('0x28')];_0x1a8784[_0xae48('0x5e')]=_0x33be7d[_0xae48('0x5f')][_0xae48('0x28')];_0x1a8784[_0xae48('0x60')]=_0x33be7d[_0xae48('0x5f')]['id'];_0x1a8784[_0xae48('0x61')]=!![];_0x1a8784[_0xae48('0x62')]=moment()[_0xae48('0x63')]('YYYY-MM-DD\x20HH:mm:ss');_0x1a8784[_0xae48('0x64')]=_0x5c8a16[_0xae48('0x65')];_0x1a8784[_0xae48('0x66')]=_0x5c8a16[_0xae48('0x56')]?_0xae48('0x67'):'ivr';return db[_0xae48('0x68')][_0xae48('0x52')]({'where':{'id':_0x1a8784['ContactId']},'attributes':['firstName',_0xae48('0x69')]})['then'](function(_0x2ad443){if(!_[_0xae48('0x6a')](_0x3f51dd)&&!_['isNil'](_0x2ad443[_0xae48('0x6b')])){_0x1a8784[_0xae48('0x6c')]=_0x2ad443[_0xae48('0x6b')];if(!_[_0xae48('0x6a')](_0x2ad443[_0xae48('0x69')])){_0x1a8784[_0xae48('0x6c')]+='\x20'+_0x2ad443[_0xae48('0x69')];}}})['finally'](function(){return db['CmHopperFinal'][_0xae48('0x53')](_0x1a8784);});}})['then'](function(){return _0x3f51dd[_0xae48('0x1a')](0xcc)['end']();})['catch'](handleError(_0x3f51dd,null));};exports[_0xae48('0x6d')]=function(_0x7b92ab,_0x1e281f,_0x31244b){var _0x322a23=[];return db['CmContact']['describe']()[_0xae48('0x25')](function(_0x493538){_0x322a23=_[_0xae48('0x31')](_0x493538);return _0x7b92ab[_0xae48('0x5f')]['getVoiceQueues']({'where':{'type':_0xae48('0x6e'),'dialActive':!![],'dialMethod':_0xae48('0x6f')},'attributes':['id',_0xae48('0x70')],'raw':!![]});})[_0xae48('0x25')](function(_0x3c441c){if(_0x3c441c&&_0x3c441c[_0xae48('0x43')]){return db['sequelize'][_0xae48('0x71')](function(_0x5035c8){var _0x5115bd={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0xae48('0x72'))},'VoiceQueueId':{'$in':_[_0xae48('0x2b')](_0x3c441c,'id')},'$or':[{'UserId':null},{'UserId':_0x7b92ab[_0xae48('0x5f')]['id']}]};var _0x171719=[];if(_0x7b92ab['body'][_0xae48('0x73')]&&_0x7b92ab[_0xae48('0x54')]['direction']===_0xae48('0x74')){if(!_[_0xae48('0x75')](_0x7b92ab[_0xae48('0x54')][_0xae48('0x76')])){_0x5115bd['id']={'$in':_0x7b92ab[_0xae48('0x54')][_0xae48('0x76')]};}_0x171719=[[_0xae48('0x77'),_0xae48('0x78')],['scheduledAt',_0x3c441c[0x0][_0xae48('0x70')]==='ASC'?'DESC':_0xae48('0x78')],db['sequelize']['literal'](_0xae48('0x79')),['id','DESC']];}else{if(!_['isEmpty'](_0x7b92ab['body']['hopperIds'])){_0x5115bd['id']={'$notIn':_0x7b92ab[_0xae48('0x54')][_0xae48('0x76')]};}_0x171719=[[_0xae48('0x77'),_0xae48('0x7a')],[_0xae48('0x7b'),_0x3c441c[0x0][_0xae48('0x70')]],db[_0xae48('0x7c')]['literal'](_0xae48('0x7d')),['id',_0xae48('0x78')]];}return db[_0xae48('0x2c')][_0xae48('0x7e')]({'attributes':['id',_0xae48('0x7f')],'where':_0x5115bd,'order':_0x171719,'transaction':_0x5035c8,'lock':_0x5035c8[_0xae48('0x80')][_0xae48('0x81')],'include':[{'model':db[_0xae48('0x68')],'as':_0xae48('0x82'),'attributes':_0x322a23,'include':[{'model':db[_0xae48('0x83')],'as':'Company','attributes':['id',_0xae48('0x28')]}]},{'model':db[_0xae48('0x84')],'as':_0xae48('0x85'),'attributes':['id',_0xae48('0x28')]},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0xae48('0x86')]}]})[_0xae48('0x25')](function(_0x1efe54){if(_0x1efe54){return _0x1efe54[_0xae48('0x24')]({'UserId':_0x7b92ab[_0xae48('0x5f')]['id']},{'transaction':_0x5035c8});}});});}})[_0xae48('0x25')](handleEntityNotFound(_0x1e281f,null))['then'](respondWithResult(_0x1e281f,null))[_0xae48('0x4f')](handleError(_0x1e281f,null));};exports[_0xae48('0x87')]=function(_0x12b4eb,_0xb855cb,_0x4b4340){return _0x12b4eb[_0xae48('0x5f')][_0xae48('0x88')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0xae48('0x6f')},'attributes':['id'],'raw':!![]})[_0xae48('0x25')](function(_0x2ec0bb){if(_0x2ec0bb&&_0x2ec0bb[_0xae48('0x43')]){return db[_0xae48('0x2c')][_0xae48('0x1c')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xae48('0x63')](_0xae48('0x72'))},'VoiceQueueId':{'$in':_[_0xae48('0x2b')](_0x2ec0bb,'id')},'$or':[{'UserId':null},{'UserId':_0x12b4eb[_0xae48('0x5f')]['id']}]}});}return 0x0;})[_0xae48('0x25')](function(_0x14b033){if(!_[_0xae48('0x6a')](_0x14b033)&&_[_0xae48('0x89')](_0x14b033)){return _0xb855cb[_0xae48('0x1a')](0xc8)[_0xae48('0x20')]({'contacts':_0x14b033});}else{logger[_0xae48('0x8a')](_0xae48('0x8b'),_0xae48('0x87'),0x194,_0xae48('0x8c'));_0xb855cb['sendStatus'](0x194);}})['catch'](handleError(_0xb855cb,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 6335421..6efb21a 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 _0x3ad3=['rimraf','../../config/environment','./cmHopper.attributes','exports','define','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x99d9ea,_0x14baff){var _0x23ae97=function(_0x4aa5c4){while(--_0x4aa5c4){_0x99d9ea['push'](_0x99d9ea['shift']());}};_0x23ae97(++_0x14baff);}(_0x3ad3,0x178));var _0x33ad=function(_0x1ee405,_0x48a186){_0x1ee405=_0x1ee405-0x0;var _0x59f4e7=_0x3ad3[_0x1ee405];return _0x59f4e7;};'use strict';var _=require(_0x33ad('0x0'));var util=require(_0x33ad('0x1'));var logger=require(_0x33ad('0x2'))(_0x33ad('0x3'));var moment=require(_0x33ad('0x4'));var BPromise=require(_0x33ad('0x5'));var rp=require(_0x33ad('0x6'));var fs=require('fs');var path=require(_0x33ad('0x7'));var rimraf=require(_0x33ad('0x8'));var config=require(_0x33ad('0x9'));var attributes=require(_0x33ad('0xa'));module[_0x33ad('0xb')]=function(_0x192681,_0x2d2968){return _0x192681[_0x33ad('0xc')]('CmHopper',attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x33ad('0xd'),'fields':['scheduledat']},{'name':_0x33ad('0xe'),'fields':[_0x33ad('0xe')]},{'name':'priority','fields':[_0x33ad('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf2b8=['api','bluebird','path','rimraf','../../config/environment','./cmHopper.attributes','exports','define','CmHopper','scheduledat','phone','priority','../../config/logger'];(function(_0x2a893c,_0x1b8839){var _0x4ff487=function(_0x431dd7){while(--_0x431dd7){_0x2a893c['push'](_0x2a893c['shift']());}};_0x4ff487(++_0x1b8839);}(_0xf2b8,0x1b9));var _0x8f2b=function(_0x20952c,_0x305005){_0x20952c=_0x20952c-0x0;var _0x50281d=_0xf2b8[_0x20952c];return _0x50281d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8f2b('0x0'))(_0x8f2b('0x1'));var moment=require('moment');var BPromise=require(_0x8f2b('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f2b('0x3'));var rimraf=require(_0x8f2b('0x4'));var config=require(_0x8f2b('0x5'));var attributes=require(_0x8f2b('0x6'));module[_0x8f2b('0x7')]=function(_0x328708,_0x554cd7){return _0x328708[_0x8f2b('0x8')](_0x8f2b('0x9'),attributes,{'tableName':'cm_hopper','paranoid':![],'indexes':[{'name':_0x8f2b('0xa'),'fields':[_0x8f2b('0xa')]},{'name':_0x8f2b('0xb'),'fields':['phone']},{'name':_0x8f2b('0xc'),'fields':[_0x8f2b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 6538590..f001956 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 _0x75ca=['debug','error','code','message','CmHopper,\x20%s,\x20%s','result','CmHopper','findAll','options','raw','where','attributes','limit','include','map','model','GetCmHopper','stringify','catch','ShowCmHopper','CreateCmHopper','create','body','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','describe','sequelize','order','LOCK','UPDATE','Contact','keys','all','MoveContactManagedDialer','CmHopperFinal','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','\x22%s\x22','format','\x20,\x201,\x20null','contactsRescheduled','CmContact','UserId','length','GetContactRecallMe','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent'];(function(_0x3b5a4a,_0x4096e5){var _0xaaec44=function(_0x30ca60){while(--_0x30ca60){_0x3b5a4a['push'](_0x3b5a4a['shift']());}};_0xaaec44(++_0x4096e5);}(_0x75ca,0xf8));var _0xa75c=function(_0x2cacef,_0xba1573){_0x2cacef=_0x2cacef-0x0;var _0x289ba6=_0x75ca[_0x2cacef];return _0x289ba6;};'use strict';var _=require('lodash');var util=require(_0xa75c('0x0'));var moment=require(_0xa75c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa75c('0x2'));var fs=require('fs');var Redis=require(_0xa75c('0x3'));var db=require(_0xa75c('0x4'))['db'];var utils=require(_0xa75c('0x5'));var logger=require(_0xa75c('0x6'))(_0xa75c('0x7'));var config=require(_0xa75c('0x8'));var jayson=require(_0xa75c('0x9'));var client=jayson[_0xa75c('0xa')][_0xa75c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x173fa0,_0x7ee691,_0x78ebaf){return new BPromise(function(_0x15c6eb,_0x537248){return client[_0xa75c('0xc')](_0x173fa0,_0x78ebaf)[_0xa75c('0xd')](function(_0x153d10){logger[_0xa75c('0xe')]('CmHopper,\x20%s,\x20%s',_0x7ee691,_0xa75c('0xf'));logger[_0xa75c('0x10')]('CmHopper,\x20%s,\x20%s,\x20%s',_0x7ee691,'request\x20sent',JSON['stringify'](_0x153d10));if(_0x153d10[_0xa75c('0x11')]){if(_0x153d10[_0xa75c('0x11')][_0xa75c('0x12')]===0x1f4){logger[_0xa75c('0x11')]('CmHopper,\x20%s,\x20%s',_0x7ee691,_0x153d10[_0xa75c('0x11')][_0xa75c('0x13')]);return _0x537248(_0x153d10[_0xa75c('0x11')][_0xa75c('0x13')]);}logger[_0xa75c('0x11')](_0xa75c('0x14'),_0x7ee691,_0x153d10[_0xa75c('0x11')]['message']);return _0x15c6eb(_0x153d10[_0xa75c('0x11')][_0xa75c('0x13')]);}else{logger['info'](_0xa75c('0x14'),_0x7ee691,_0xa75c('0xf'));_0x15c6eb(_0x153d10[_0xa75c('0x15')][_0xa75c('0x13')]);}})['catch'](function(_0x2bb2c1){logger[_0xa75c('0x11')]('CmHopper,\x20%s,\x20%s',_0x7ee691,_0x2bb2c1);_0x537248(_0x2bb2c1);});});}exports['GetCmHopper']=function(_0x24f187){var _0x4ddf05=this;return new Promise(function(_0x377b75,_0x5cbca1){return db[_0xa75c('0x16')][_0xa75c('0x17')]({'raw':_0x24f187['options']?_0x24f187[_0xa75c('0x18')][_0xa75c('0x19')]===undefined?!![]:![]:!![],'where':_0x24f187[_0xa75c('0x18')]?_0x24f187[_0xa75c('0x18')][_0xa75c('0x1a')]||null:null,'attributes':_0x24f187['options']?_0x24f187[_0xa75c('0x18')][_0xa75c('0x1b')]||null:null,'limit':_0x24f187[_0xa75c('0x18')]?_0x24f187[_0xa75c('0x18')][_0xa75c('0x1c')]||null:null,'include':_0x24f187[_0xa75c('0x18')]?_0x24f187[_0xa75c('0x18')][_0xa75c('0x1d')]?_[_0xa75c('0x1e')](_0x24f187[_0xa75c('0x18')]['include'],function(_0x553f98){return{'model':db[_0x553f98['model']],'as':_0x553f98['as'],'attributes':_0x553f98[_0xa75c('0x1b')],'include':_0x553f98[_0xa75c('0x1d')]?_[_0xa75c('0x1e')](_0x553f98[_0xa75c('0x1d')],function(_0x55c689){return{'model':db[_0x55c689[_0xa75c('0x1f')]],'as':_0x55c689['as'],'attributes':_0x55c689[_0xa75c('0x1b')],'include':_0x55c689[_0xa75c('0x1d')]?_[_0xa75c('0x1e')](_0x55c689[_0xa75c('0x1d')],function(_0x1ddc24){return{'model':db[_0x1ddc24[_0xa75c('0x1f')]],'as':_0x1ddc24['as'],'attributes':_0x1ddc24[_0xa75c('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa75c('0xd')](function(_0x345c04){logger[_0xa75c('0xe')]('GetCmHopper',_0x24f187);logger[_0xa75c('0x10')](_0xa75c('0x20'),_0x24f187,JSON[_0xa75c('0x21')](_0x345c04));_0x377b75(_0x345c04);})[_0xa75c('0x22')](function(_0x2aa661){logger['error']('GetCmHopper',_0x2aa661[_0xa75c('0x13')],_0x24f187);_0x5cbca1(_0x4ddf05[_0xa75c('0x11')](0x1f4,_0x2aa661[_0xa75c('0x13')]));});});};exports[_0xa75c('0x23')]=function(_0xfd6abd){var _0x5df8c3=this;return new Promise(function(_0x5c9026,_0x5f18ca){return db[_0xa75c('0x16')]['find']({'raw':_0xfd6abd[_0xa75c('0x18')]?_0xfd6abd[_0xa75c('0x18')][_0xa75c('0x19')]===undefined?!![]:![]:!![],'where':_0xfd6abd[_0xa75c('0x18')]?_0xfd6abd['options'][_0xa75c('0x1a')]||null:null,'attributes':_0xfd6abd[_0xa75c('0x18')]?_0xfd6abd[_0xa75c('0x18')][_0xa75c('0x1b')]||null:null,'include':_0xfd6abd[_0xa75c('0x18')]?_0xfd6abd[_0xa75c('0x18')][_0xa75c('0x1d')]?_[_0xa75c('0x1e')](_0xfd6abd[_0xa75c('0x18')][_0xa75c('0x1d')],function(_0xd2a9a3){return{'model':db[_0xd2a9a3[_0xa75c('0x1f')]],'as':_0xd2a9a3['as'],'attributes':_0xd2a9a3['attributes'],'include':_0xd2a9a3[_0xa75c('0x1d')]?_[_0xa75c('0x1e')](_0xd2a9a3[_0xa75c('0x1d')],function(_0x13eaa3){return{'model':db[_0x13eaa3['model']],'as':_0x13eaa3['as'],'attributes':_0x13eaa3[_0xa75c('0x1b')],'include':_0x13eaa3[_0xa75c('0x1d')]?_[_0xa75c('0x1e')](_0x13eaa3[_0xa75c('0x1d')],function(_0x1b4e9b){return{'model':db[_0x1b4e9b['model']],'as':_0x1b4e9b['as'],'attributes':_0x1b4e9b['attributes']};}):[]};}):[]};}):[]:[]})[_0xa75c('0xd')](function(_0x4ef0a2){logger[_0xa75c('0xe')]('ShowCmHopper',_0xfd6abd);logger[_0xa75c('0x10')]('ShowCmHopper',_0xfd6abd,JSON[_0xa75c('0x21')](_0x4ef0a2));_0x5c9026(_0x4ef0a2);})[_0xa75c('0x22')](function(_0x42fa1c){logger['error'](_0xa75c('0x23'),_0x42fa1c[_0xa75c('0x13')],_0xfd6abd);_0x5f18ca(_0x5df8c3[_0xa75c('0x11')](0x1f4,_0x42fa1c[_0xa75c('0x13')]));});});};exports[_0xa75c('0x24')]=function(_0x4589f3){var _0x36008a=this;return new Promise(function(_0x2cce20,_0x381527){return db[_0xa75c('0x16')][_0xa75c('0x25')](_0x4589f3[_0xa75c('0x26')],{'raw':_0x4589f3[_0xa75c('0x18')]?_0x4589f3['options'][_0xa75c('0x19')]===undefined?!![]:![]:!![]})[_0xa75c('0xd')](function(_0x5dcee8){logger[_0xa75c('0xe')](_0xa75c('0x24'),_0x4589f3);logger[_0xa75c('0x10')]('CreateCmHopper',_0x4589f3,JSON[_0xa75c('0x21')](_0x5dcee8));_0x2cce20(_0x5dcee8);})[_0xa75c('0x22')](function(_0x2a7d77){logger[_0xa75c('0x11')]('CreateCmHopper',_0x2a7d77[_0xa75c('0x13')],_0x4589f3);_0x381527(_0x36008a[_0xa75c('0x11')](0x1f4,_0x2a7d77['message']));});});};exports[_0xa75c('0x27')]=function(_0x4210d8){var _0x3b9b70=this;return new Promise(function(_0x2669ff,_0xbcb390){return db[_0xa75c('0x16')][_0xa75c('0x28')](_0x4210d8['body'],{'raw':_0x4210d8[_0xa75c('0x18')]?_0x4210d8[_0xa75c('0x18')][_0xa75c('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4210d8[_0xa75c('0x18')]?_0x4210d8[_0xa75c('0x18')][_0xa75c('0x1a')]||null:null,'attributes':_0x4210d8[_0xa75c('0x18')]?_0x4210d8[_0xa75c('0x18')]['attributes']||null:null,'limit':_0x4210d8[_0xa75c('0x18')]?_0x4210d8[_0xa75c('0x18')][_0xa75c('0x1c')]||null:null})[_0xa75c('0xd')](function(_0x523323){logger[_0xa75c('0xe')](_0xa75c('0x27'),_0x4210d8);logger[_0xa75c('0x10')]('UpdateCmHopper',_0x4210d8,JSON[_0xa75c('0x21')](_0x523323));_0x2669ff(_0x523323);})['catch'](function(_0x58b5ca){logger[_0xa75c('0x11')](_0xa75c('0x27'),_0x58b5ca['message'],_0x4210d8);_0xbcb390(_0x3b9b70['error'](0x1f4,_0x58b5ca[_0xa75c('0x13')]));});});};exports[_0xa75c('0x29')]=function(_0x5bd6c4){var _0xf392e9=this;return new Promise(function(_0x2c6ef0,_0x39cdea){return db[_0xa75c('0x16')][_0xa75c('0x2a')]({'where':_0x5bd6c4[_0xa75c('0x18')]?_0x5bd6c4[_0xa75c('0x18')]['where']||null:null})[_0xa75c('0xd')](function(_0x4b68a2){logger[_0xa75c('0xe')](_0xa75c('0x29'),_0x5bd6c4);logger[_0xa75c('0x10')](_0xa75c('0x29'),_0x5bd6c4,JSON[_0xa75c('0x21')](_0x4b68a2));_0x2c6ef0(_0x4b68a2);})['catch'](function(_0x236ad8){logger['error'](_0xa75c('0x29'),_0x236ad8[_0xa75c('0x13')],_0x5bd6c4);_0x39cdea(_0xf392e9[_0xa75c('0x11')](0x1f4,_0x236ad8[_0xa75c('0x13')]));});});};exports[_0xa75c('0x2b')]=function(_0x3276f7){var _0x190fbc=this;return new Promise(function(_0x5d2a2e,_0x3db1f0){return db['CmContact'][_0xa75c('0x2c')]()[_0xa75c('0xd')](function(_0x30f5a4){return db[_0xa75c('0x2d')]['transaction'](function(_0x3611ac){return db[_0xa75c('0x16')][_0xa75c('0x17')]({'where':_0x3276f7[_0xa75c('0x18')]?_0x3276f7['options'][_0xa75c('0x1a')]||null:null,'attributes':_0x3276f7['options']?_0x3276f7[_0xa75c('0x18')][_0xa75c('0x1b')]||null:null,'limit':_0x3276f7[_0xa75c('0x18')]?_0x3276f7[_0xa75c('0x18')][_0xa75c('0x1c')]||null:null,'order':_0x3276f7[_0xa75c('0x18')]?_0x3276f7[_0xa75c('0x18')][_0xa75c('0x2e')]||null:null,'transaction':_0x3611ac,'lock':_0x3611ac[_0xa75c('0x2f')][_0xa75c('0x30')],'include':[{'model':db['CmContact'],'as':_0xa75c('0x31'),'attributes':_[_0xa75c('0x32')](_0x30f5a4)}]})[_0xa75c('0xd')](function(_0x17a132){var _0x262079=[];for(var _0x5e59c0=0x0;_0x5e59c0<_0x17a132['length'];_0x5e59c0+=0x1){_0x262079['push'](_0x17a132[_0x5e59c0][_0xa75c('0x28')](_0x3276f7[_0xa75c('0x26')],{'transaction':_0x3611ac}));}return BPromise[_0xa75c('0x33')](_0x262079);});})[_0xa75c('0xd')](function(_0x146b9){logger[_0xa75c('0xe')]('GetContactDialer',_0x3276f7);logger[_0xa75c('0x10')](_0xa75c('0x2b'),_0x3276f7,JSON[_0xa75c('0x21')](_0x146b9));_0x5d2a2e(_0x146b9);})['catch'](function(_0x165139){logger[_0xa75c('0x11')]('GetContactDialer',_0x165139['message'],_0x3276f7);_0x3db1f0(_0x190fbc[_0xa75c('0x11')](0x1f4,_0x165139[_0xa75c('0x13')]));});});});};exports[_0xa75c('0x34')]=function(_0x387ea0){var _0x1bf11d=this;return new Promise(function(_0x266fb6,_0x1a3ac4){return db[_0xa75c('0x2d')]['transaction'](function(_0x2dc6af){return db[_0xa75c('0x35')][_0xa75c('0x25')](_0x387ea0[_0xa75c('0x26')],{'raw':_0x387ea0[_0xa75c('0x18')]?_0x387ea0[_0xa75c('0x18')]['raw']===undefined?!![]:![]:!![],'transaction':_0x2dc6af})['then'](function(){return db[_0xa75c('0x16')][_0xa75c('0x2a')]({'where':_0x387ea0[_0xa75c('0x18')]?_0x387ea0[_0xa75c('0x18')][_0xa75c('0x1a')]||null:null,'transaction':_0x2dc6af});});})['then'](function(_0x469fcd){logger['info'](_0xa75c('0x34'),_0x387ea0);logger[_0xa75c('0x10')](_0xa75c('0x34'),_0x387ea0,JSON[_0xa75c('0x21')](_0x469fcd));_0x266fb6(_0x469fcd);})[_0xa75c('0x22')](function(_0x23f740){logger[_0xa75c('0x11')](_0xa75c('0x34'),_0x23f740[_0xa75c('0x13')],_0x387ea0);_0x1a3ac4(_0x1bf11d[_0xa75c('0x11')](0x1f4,_0x23f740[_0xa75c('0x13')]));});});};exports[_0xa75c('0x36')]=function(_0xe0d4c9){var _0xdec01e=this;return new Promise(function(_0x4f7682,_0x5f29e6){return db[_0xa75c('0x16')][_0xa75c('0x17')]({'raw':_0xe0d4c9[_0xa75c('0x18')]?_0xe0d4c9['options']['raw']===undefined?!![]:![]:!![],'where':_0xe0d4c9['options']?_0xe0d4c9['options']['where']||null:null,'attributes':[[db[_0xa75c('0x2d')]['fn'](_0xa75c('0x37'),db[_0xa75c('0x2d')]['fn']('IF',db[_0xa75c('0x2d')][_0xa75c('0x38')](_0xa75c('0x39')+util['format'](_0xa75c('0x3a'),moment()[_0xa75c('0x3b')]('YYYY-MM-DD\x20HH:mm:ss'))+_0xa75c('0x3c')))),_0xa75c('0x3d')]]})[_0xa75c('0xd')](function(_0x5ad801){logger[_0xa75c('0xe')](_0xa75c('0x36'),_0xe0d4c9);logger[_0xa75c('0x10')](_0xa75c('0x36'),_0xe0d4c9,JSON[_0xa75c('0x21')](_0x5ad801));_0x4f7682(_0x5ad801);})[_0xa75c('0x22')](function(_0xa2f7f6){logger['error']('CountReScheduled',_0xa2f7f6[_0xa75c('0x13')],_0xe0d4c9);_0x5f29e6(_0xdec01e[_0xa75c('0x11')](0x1f4,_0xa2f7f6[_0xa75c('0x13')]));});});};exports['GetContactRecallMe']=function(_0x28ba7f){var _0x47d8c1=this;return new Promise(function(_0x4b1d50,_0x2fb0d7){return db[_0xa75c('0x3e')][_0xa75c('0x2c')]()['then'](function(_0x239e1e){return db[_0xa75c('0x2d')]['transaction'](function(_0x23e358){return db['CmHopper'][_0xa75c('0x17')]({'where':_0x28ba7f[_0xa75c('0x18')]?_0x28ba7f[_0xa75c('0x18')][_0xa75c('0x1a')]||null:null,'attributes':_0x28ba7f['options']?_0x28ba7f[_0xa75c('0x18')][_0xa75c('0x1b')]||null:null,'limit':0x1,'order':_0x28ba7f['options']?_0x28ba7f[_0xa75c('0x18')][_0xa75c('0x2e')]||null:null,'group':db[_0xa75c('0x16')][_0xa75c('0x3f')],'transaction':_0x23e358,'lock':_0x23e358[_0xa75c('0x2f')]['UPDATE'],'include':_0x28ba7f[_0xa75c('0x18')]?_0x28ba7f['options'][_0xa75c('0x1d')]?_[_0xa75c('0x1e')](_0x28ba7f[_0xa75c('0x18')][_0xa75c('0x1d')],function(_0x4c9e21){return{'model':db[_0x4c9e21[_0xa75c('0x1f')]],'as':_0x4c9e21['as'],'attributes':_0x4c9e21[_0xa75c('0x1b')],'include':_0x4c9e21['include']?_['map'](_0x4c9e21[_0xa75c('0x1d')],function(_0x2827ad){return{'model':db[_0x2827ad[_0xa75c('0x1f')]],'as':_0x2827ad['as'],'attributes':_0x2827ad[_0xa75c('0x1b')],'include':_0x2827ad[_0xa75c('0x1d')]?_[_0xa75c('0x1e')](_0x2827ad['include'],function(_0x55e216){return{'model':db[_0x55e216[_0xa75c('0x1f')]],'as':_0x55e216['as'],'attributes':_0x55e216[_0xa75c('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5e3874){var _0xc2c147=[];for(var _0xc3b6b0=0x0;_0xc3b6b0<_0x5e3874[_0xa75c('0x40')];_0xc3b6b0+=0x1){_0xc2c147['push'](_0x5e3874[_0xc3b6b0]['update'](_0x28ba7f[_0xa75c('0x26')],{'transaction':_0x23e358}));}return BPromise[_0xa75c('0x33')](_0xc2c147);});})['then'](function(_0x480faf){logger[_0xa75c('0xe')](_0xa75c('0x41'),_0x28ba7f);logger[_0xa75c('0x10')](_0xa75c('0x41'),_0x28ba7f,JSON[_0xa75c('0x21')](_0x480faf));_0x4b1d50(_0x480faf);})[_0xa75c('0x22')](function(_0x2ead42){logger[_0xa75c('0x11')](_0xa75c('0x41'),_0x2ead42['message'],_0x28ba7f);_0x2fb0d7(_0x47d8c1[_0xa75c('0x11')](0x1f4,_0x2ead42[_0xa75c('0x13')]));});});});}; \ No newline at end of file +var _0x2a3a=['info','CmHopper,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','findAll','options','attributes','limit','include','map','model','GetCmHopper','debug','CmHopper','raw','where','ShowCmHopper','CreateCmHopper','body','UpdateCmHopper','update','destroy','DestroyCmHopper','CmContact','describe','sequelize','transaction','order','Contact','keys','length','push','all','GetContactDialer','MoveContactManagedDialer','CmHopperFinal','create','COUNT','\x22%s\x22','format','YYYY-MM-DD\x20HH:mm:ss','\x20,\x201,\x20null','contactsRescheduled','CountReScheduled','UserId','LOCK','UPDATE','GetContactRecallMe','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x1ebeb8,_0x7da38){var _0x10a871=function(_0xd0d322){while(--_0xd0d322){_0x1ebeb8['push'](_0x1ebeb8['shift']());}};_0x10a871(++_0x7da38);}(_0x2a3a,0x12f));var _0xa2a3=function(_0xf03140,_0x3b4f9b){_0xf03140=_0xf03140-0x0;var _0x1f06fa=_0x2a3a[_0xf03140];return _0x1f06fa;};'use strict';var _=require(_0xa2a3('0x0'));var util=require('util');var moment=require(_0xa2a3('0x1'));var BPromise=require(_0xa2a3('0x2'));var rs=require(_0xa2a3('0x3'));var fs=require('fs');var Redis=require(_0xa2a3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa2a3('0x5'))('rpc');var config=require(_0xa2a3('0x6'));var jayson=require(_0xa2a3('0x7'));var client=jayson[_0xa2a3('0x8')][_0xa2a3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5984bc,_0x5eecc4,_0x5a196d){return new BPromise(function(_0x5dc1fa,_0xa73341){return client[_0xa2a3('0xa')](_0x5984bc,_0x5a196d)[_0xa2a3('0xb')](function(_0x1d3811){logger[_0xa2a3('0xc')](_0xa2a3('0xd'),_0x5eecc4,_0xa2a3('0xe'));logger['debug']('CmHopper,\x20%s,\x20%s,\x20%s',_0x5eecc4,_0xa2a3('0xe'),JSON[_0xa2a3('0xf')](_0x1d3811));if(_0x1d3811[_0xa2a3('0x10')]){if(_0x1d3811[_0xa2a3('0x10')]['code']===0x1f4){logger['error'](_0xa2a3('0xd'),_0x5eecc4,_0x1d3811['error'][_0xa2a3('0x11')]);return _0xa73341(_0x1d3811['error']['message']);}logger['error'](_0xa2a3('0xd'),_0x5eecc4,_0x1d3811[_0xa2a3('0x10')]['message']);return _0x5dc1fa(_0x1d3811[_0xa2a3('0x10')]['message']);}else{logger[_0xa2a3('0xc')](_0xa2a3('0xd'),_0x5eecc4,_0xa2a3('0xe'));_0x5dc1fa(_0x1d3811['result'][_0xa2a3('0x11')]);}})[_0xa2a3('0x12')](function(_0x4e3098){logger[_0xa2a3('0x10')](_0xa2a3('0xd'),_0x5eecc4,_0x4e3098);_0xa73341(_0x4e3098);});});}exports['GetCmHopper']=function(_0x4f0db6){var _0x460bf6=this;return new Promise(function(_0x4ecc4d,_0x53ba2d){return db['CmHopper'][_0xa2a3('0x13')]({'raw':_0x4f0db6[_0xa2a3('0x14')]?_0x4f0db6[_0xa2a3('0x14')]['raw']===undefined?!![]:![]:!![],'where':_0x4f0db6[_0xa2a3('0x14')]?_0x4f0db6[_0xa2a3('0x14')]['where']||null:null,'attributes':_0x4f0db6[_0xa2a3('0x14')]?_0x4f0db6['options'][_0xa2a3('0x15')]||null:null,'limit':_0x4f0db6[_0xa2a3('0x14')]?_0x4f0db6[_0xa2a3('0x14')][_0xa2a3('0x16')]||null:null,'include':_0x4f0db6[_0xa2a3('0x14')]?_0x4f0db6[_0xa2a3('0x14')][_0xa2a3('0x17')]?_[_0xa2a3('0x18')](_0x4f0db6['options']['include'],function(_0x2c48aa){return{'model':db[_0x2c48aa[_0xa2a3('0x19')]],'as':_0x2c48aa['as'],'attributes':_0x2c48aa[_0xa2a3('0x15')],'include':_0x2c48aa[_0xa2a3('0x17')]?_[_0xa2a3('0x18')](_0x2c48aa[_0xa2a3('0x17')],function(_0xebe02d){return{'model':db[_0xebe02d[_0xa2a3('0x19')]],'as':_0xebe02d['as'],'attributes':_0xebe02d['attributes'],'include':_0xebe02d['include']?_[_0xa2a3('0x18')](_0xebe02d[_0xa2a3('0x17')],function(_0x12ed77){return{'model':db[_0x12ed77[_0xa2a3('0x19')]],'as':_0x12ed77['as'],'attributes':_0x12ed77[_0xa2a3('0x15')]};}):[]};}):[]};}):[]:[]})[_0xa2a3('0xb')](function(_0x3b5e02){logger[_0xa2a3('0xc')](_0xa2a3('0x1a'),_0x4f0db6);logger[_0xa2a3('0x1b')]('GetCmHopper',_0x4f0db6,JSON[_0xa2a3('0xf')](_0x3b5e02));_0x4ecc4d(_0x3b5e02);})[_0xa2a3('0x12')](function(_0x5dd7f8){logger[_0xa2a3('0x10')](_0xa2a3('0x1a'),_0x5dd7f8['message'],_0x4f0db6);_0x53ba2d(_0x460bf6[_0xa2a3('0x10')](0x1f4,_0x5dd7f8[_0xa2a3('0x11')]));});});};exports['ShowCmHopper']=function(_0xeb679c){var _0x4f68b3=this;return new Promise(function(_0x3a2b27,_0x2c0677){return db[_0xa2a3('0x1c')]['find']({'raw':_0xeb679c[_0xa2a3('0x14')]?_0xeb679c[_0xa2a3('0x14')][_0xa2a3('0x1d')]===undefined?!![]:![]:!![],'where':_0xeb679c[_0xa2a3('0x14')]?_0xeb679c[_0xa2a3('0x14')][_0xa2a3('0x1e')]||null:null,'attributes':_0xeb679c['options']?_0xeb679c[_0xa2a3('0x14')]['attributes']||null:null,'include':_0xeb679c[_0xa2a3('0x14')]?_0xeb679c[_0xa2a3('0x14')][_0xa2a3('0x17')]?_['map'](_0xeb679c[_0xa2a3('0x14')]['include'],function(_0x5d5a56){return{'model':db[_0x5d5a56[_0xa2a3('0x19')]],'as':_0x5d5a56['as'],'attributes':_0x5d5a56['attributes'],'include':_0x5d5a56[_0xa2a3('0x17')]?_[_0xa2a3('0x18')](_0x5d5a56['include'],function(_0x4773ec){return{'model':db[_0x4773ec[_0xa2a3('0x19')]],'as':_0x4773ec['as'],'attributes':_0x4773ec[_0xa2a3('0x15')],'include':_0x4773ec[_0xa2a3('0x17')]?_[_0xa2a3('0x18')](_0x4773ec['include'],function(_0x48efaa){return{'model':db[_0x48efaa[_0xa2a3('0x19')]],'as':_0x48efaa['as'],'attributes':_0x48efaa[_0xa2a3('0x15')]};}):[]};}):[]};}):[]:[]})[_0xa2a3('0xb')](function(_0x46e741){logger['info']('ShowCmHopper',_0xeb679c);logger[_0xa2a3('0x1b')](_0xa2a3('0x1f'),_0xeb679c,JSON[_0xa2a3('0xf')](_0x46e741));_0x3a2b27(_0x46e741);})[_0xa2a3('0x12')](function(_0x426125){logger['error']('ShowCmHopper',_0x426125[_0xa2a3('0x11')],_0xeb679c);_0x2c0677(_0x4f68b3[_0xa2a3('0x10')](0x1f4,_0x426125[_0xa2a3('0x11')]));});});};exports[_0xa2a3('0x20')]=function(_0x2d9ecf){var _0x3a35fb=this;return new Promise(function(_0x18341c,_0x5a98fa){return db[_0xa2a3('0x1c')]['create'](_0x2d9ecf[_0xa2a3('0x21')],{'raw':_0x2d9ecf['options']?_0x2d9ecf[_0xa2a3('0x14')][_0xa2a3('0x1d')]===undefined?!![]:![]:!![]})['then'](function(_0x56977f){logger[_0xa2a3('0xc')](_0xa2a3('0x20'),_0x2d9ecf);logger['debug'](_0xa2a3('0x20'),_0x2d9ecf,JSON[_0xa2a3('0xf')](_0x56977f));_0x18341c(_0x56977f);})[_0xa2a3('0x12')](function(_0x557fc2){logger[_0xa2a3('0x10')](_0xa2a3('0x20'),_0x557fc2['message'],_0x2d9ecf);_0x5a98fa(_0x3a35fb[_0xa2a3('0x10')](0x1f4,_0x557fc2['message']));});});};exports[_0xa2a3('0x22')]=function(_0x3e7e0c){var _0xf0c2fb=this;return new Promise(function(_0x50c049,_0x399179){return db[_0xa2a3('0x1c')][_0xa2a3('0x23')](_0x3e7e0c['body'],{'raw':_0x3e7e0c['options']?_0x3e7e0c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3e7e0c[_0xa2a3('0x14')]?_0x3e7e0c[_0xa2a3('0x14')][_0xa2a3('0x1e')]||null:null,'attributes':_0x3e7e0c[_0xa2a3('0x14')]?_0x3e7e0c[_0xa2a3('0x14')][_0xa2a3('0x15')]||null:null,'limit':_0x3e7e0c[_0xa2a3('0x14')]?_0x3e7e0c[_0xa2a3('0x14')][_0xa2a3('0x16')]||null:null})['then'](function(_0x320b9f){logger['info'](_0xa2a3('0x22'),_0x3e7e0c);logger[_0xa2a3('0x1b')](_0xa2a3('0x22'),_0x3e7e0c,JSON[_0xa2a3('0xf')](_0x320b9f));_0x50c049(_0x320b9f);})[_0xa2a3('0x12')](function(_0x3fd421){logger[_0xa2a3('0x10')](_0xa2a3('0x22'),_0x3fd421[_0xa2a3('0x11')],_0x3e7e0c);_0x399179(_0xf0c2fb[_0xa2a3('0x10')](0x1f4,_0x3fd421['message']));});});};exports['DestroyCmHopper']=function(_0x3289d3){var _0x34439f=this;return new Promise(function(_0x57c6f2,_0x5f6b00){return db[_0xa2a3('0x1c')][_0xa2a3('0x24')]({'where':_0x3289d3[_0xa2a3('0x14')]?_0x3289d3[_0xa2a3('0x14')][_0xa2a3('0x1e')]||null:null})['then'](function(_0x4e3446){logger[_0xa2a3('0xc')](_0xa2a3('0x25'),_0x3289d3);logger['debug'](_0xa2a3('0x25'),_0x3289d3,JSON[_0xa2a3('0xf')](_0x4e3446));_0x57c6f2(_0x4e3446);})['catch'](function(_0x15320d){logger[_0xa2a3('0x10')](_0xa2a3('0x25'),_0x15320d['message'],_0x3289d3);_0x5f6b00(_0x34439f[_0xa2a3('0x10')](0x1f4,_0x15320d[_0xa2a3('0x11')]));});});};exports['GetContactDialer']=function(_0x2cc543){var _0x51c7c3=this;return new Promise(function(_0x4c3db8,_0x463233){return db[_0xa2a3('0x26')][_0xa2a3('0x27')]()[_0xa2a3('0xb')](function(_0x55d034){return db[_0xa2a3('0x28')][_0xa2a3('0x29')](function(_0x8fec58){return db[_0xa2a3('0x1c')][_0xa2a3('0x13')]({'where':_0x2cc543['options']?_0x2cc543[_0xa2a3('0x14')]['where']||null:null,'attributes':_0x2cc543['options']?_0x2cc543[_0xa2a3('0x14')][_0xa2a3('0x15')]||null:null,'limit':_0x2cc543[_0xa2a3('0x14')]?_0x2cc543[_0xa2a3('0x14')]['limit']||null:null,'order':_0x2cc543[_0xa2a3('0x14')]?_0x2cc543['options'][_0xa2a3('0x2a')]||null:null,'transaction':_0x8fec58,'lock':_0x8fec58['LOCK']['UPDATE'],'include':[{'model':db[_0xa2a3('0x26')],'as':_0xa2a3('0x2b'),'attributes':_[_0xa2a3('0x2c')](_0x55d034)}]})[_0xa2a3('0xb')](function(_0x29c1be){var _0x22b369=[];for(var _0x51ec64=0x0;_0x51ec64<_0x29c1be[_0xa2a3('0x2d')];_0x51ec64+=0x1){_0x22b369[_0xa2a3('0x2e')](_0x29c1be[_0x51ec64][_0xa2a3('0x23')](_0x2cc543['body'],{'transaction':_0x8fec58}));}return BPromise[_0xa2a3('0x2f')](_0x22b369);});})[_0xa2a3('0xb')](function(_0x3e1ad6){logger[_0xa2a3('0xc')](_0xa2a3('0x30'),_0x2cc543);logger[_0xa2a3('0x1b')](_0xa2a3('0x30'),_0x2cc543,JSON[_0xa2a3('0xf')](_0x3e1ad6));_0x4c3db8(_0x3e1ad6);})[_0xa2a3('0x12')](function(_0x33952c){logger['error'](_0xa2a3('0x30'),_0x33952c[_0xa2a3('0x11')],_0x2cc543);_0x463233(_0x51c7c3['error'](0x1f4,_0x33952c['message']));});});});};exports[_0xa2a3('0x31')]=function(_0x50a1c6){var _0x5c0c87=this;return new Promise(function(_0x15da08,_0x658079){return db[_0xa2a3('0x28')][_0xa2a3('0x29')](function(_0x17070c){return db[_0xa2a3('0x32')][_0xa2a3('0x33')](_0x50a1c6[_0xa2a3('0x21')],{'raw':_0x50a1c6['options']?_0x50a1c6[_0xa2a3('0x14')][_0xa2a3('0x1d')]===undefined?!![]:![]:!![],'transaction':_0x17070c})['then'](function(){return db[_0xa2a3('0x1c')][_0xa2a3('0x24')]({'where':_0x50a1c6[_0xa2a3('0x14')]?_0x50a1c6[_0xa2a3('0x14')][_0xa2a3('0x1e')]||null:null,'transaction':_0x17070c});});})[_0xa2a3('0xb')](function(_0x13cf57){logger[_0xa2a3('0xc')](_0xa2a3('0x31'),_0x50a1c6);logger['debug'](_0xa2a3('0x31'),_0x50a1c6,JSON[_0xa2a3('0xf')](_0x13cf57));_0x15da08(_0x13cf57);})[_0xa2a3('0x12')](function(_0x2e94d2){logger['error'](_0xa2a3('0x31'),_0x2e94d2['message'],_0x50a1c6);_0x658079(_0x5c0c87[_0xa2a3('0x10')](0x1f4,_0x2e94d2[_0xa2a3('0x11')]));});});};exports['CountReScheduled']=function(_0x4c1ac9){var _0x30fb62=this;return new Promise(function(_0x5830c3,_0x225dde){return db['CmHopper'][_0xa2a3('0x13')]({'raw':_0x4c1ac9[_0xa2a3('0x14')]?_0x4c1ac9[_0xa2a3('0x14')][_0xa2a3('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c1ac9['options']?_0x4c1ac9['options'][_0xa2a3('0x1e')]||null:null,'attributes':[[db['sequelize']['fn'](_0xa2a3('0x34'),db[_0xa2a3('0x28')]['fn']('IF',db[_0xa2a3('0x28')]['literal']('`scheduledat`\x20>=\x20'+util['format'](_0xa2a3('0x35'),moment()[_0xa2a3('0x36')](_0xa2a3('0x37')))+_0xa2a3('0x38')))),_0xa2a3('0x39')]]})[_0xa2a3('0xb')](function(_0x33b272){logger['info']('CountReScheduled',_0x4c1ac9);logger[_0xa2a3('0x1b')]('CountReScheduled',_0x4c1ac9,JSON[_0xa2a3('0xf')](_0x33b272));_0x5830c3(_0x33b272);})[_0xa2a3('0x12')](function(_0x2052fc){logger[_0xa2a3('0x10')](_0xa2a3('0x3a'),_0x2052fc[_0xa2a3('0x11')],_0x4c1ac9);_0x225dde(_0x30fb62[_0xa2a3('0x10')](0x1f4,_0x2052fc[_0xa2a3('0x11')]));});});};exports['GetContactRecallMe']=function(_0x1b6bd1){var _0x309a8d=this;return new Promise(function(_0x516294,_0x2d4239){return db[_0xa2a3('0x26')][_0xa2a3('0x27')]()[_0xa2a3('0xb')](function(_0x5160a8){return db[_0xa2a3('0x28')][_0xa2a3('0x29')](function(_0x12ad14){return db[_0xa2a3('0x1c')][_0xa2a3('0x13')]({'where':_0x1b6bd1[_0xa2a3('0x14')]?_0x1b6bd1[_0xa2a3('0x14')][_0xa2a3('0x1e')]||null:null,'attributes':_0x1b6bd1[_0xa2a3('0x14')]?_0x1b6bd1['options'][_0xa2a3('0x15')]||null:null,'limit':0x1,'order':_0x1b6bd1[_0xa2a3('0x14')]?_0x1b6bd1[_0xa2a3('0x14')][_0xa2a3('0x2a')]||null:null,'group':db['CmHopper'][_0xa2a3('0x3b')],'transaction':_0x12ad14,'lock':_0x12ad14[_0xa2a3('0x3c')][_0xa2a3('0x3d')],'include':_0x1b6bd1[_0xa2a3('0x14')]?_0x1b6bd1[_0xa2a3('0x14')][_0xa2a3('0x17')]?_[_0xa2a3('0x18')](_0x1b6bd1[_0xa2a3('0x14')][_0xa2a3('0x17')],function(_0x1a2adb){return{'model':db[_0x1a2adb[_0xa2a3('0x19')]],'as':_0x1a2adb['as'],'attributes':_0x1a2adb[_0xa2a3('0x15')],'include':_0x1a2adb[_0xa2a3('0x17')]?_['map'](_0x1a2adb[_0xa2a3('0x17')],function(_0x2fe86f){return{'model':db[_0x2fe86f['model']],'as':_0x2fe86f['as'],'attributes':_0x2fe86f['attributes'],'include':_0x2fe86f['include']?_['map'](_0x2fe86f[_0xa2a3('0x17')],function(_0x4d40f7){return{'model':db[_0x4d40f7['model']],'as':_0x4d40f7['as'],'attributes':_0x4d40f7['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ddf9f){var _0x43c104=[];for(var _0x3c7981=0x0;_0x3c7981<_0x1ddf9f[_0xa2a3('0x2d')];_0x3c7981+=0x1){_0x43c104[_0xa2a3('0x2e')](_0x1ddf9f[_0x3c7981]['update'](_0x1b6bd1[_0xa2a3('0x21')],{'transaction':_0x12ad14}));}return BPromise[_0xa2a3('0x2f')](_0x43c104);});})[_0xa2a3('0xb')](function(_0x3a3f9d){logger[_0xa2a3('0xc')](_0xa2a3('0x3e'),_0x1b6bd1);logger[_0xa2a3('0x1b')]('GetContactRecallMe',_0x1b6bd1,JSON['stringify'](_0x3a3f9d));_0x516294(_0x3a3f9d);})[_0xa2a3('0x12')](function(_0x1c9d25){logger[_0xa2a3('0x10')](_0xa2a3('0x3e'),_0x1c9d25[_0xa2a3('0x11')],_0x1b6bd1);_0x2d4239(_0x309a8d['error'](0x1f4,_0x1c9d25[_0xa2a3('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 8fd9853..2c6d155 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 _0xb3f0=['show','post','create','/preview','getPreview','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','describe','/opencontacts','getOpenContacts','/:id'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xb3f0,0x1cc));var _0x0b3f=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xb3f0[_0x3635ce];return _0x97ecd0;};'use strict';var multer=require(_0x0b3f('0x0'));var util=require(_0x0b3f('0x1'));var path=require(_0x0b3f('0x2'));var timeout=require(_0x0b3f('0x3'));var express=require(_0x0b3f('0x4'));var router=express[_0x0b3f('0x5')]();var auth=require(_0x0b3f('0x6'));var interaction=require(_0x0b3f('0x7'));var config=require('../../config/environment');var controller=require(_0x0b3f('0x8'));router[_0x0b3f('0x9')]('/',auth[_0x0b3f('0xa')](),controller['index']);router[_0x0b3f('0x9')]('/describe',auth[_0x0b3f('0xa')](),controller[_0x0b3f('0xb')]);router['get'](_0x0b3f('0xc'),auth[_0x0b3f('0xa')](),controller[_0x0b3f('0xd')]);router[_0x0b3f('0x9')](_0x0b3f('0xe'),auth[_0x0b3f('0xa')](),controller[_0x0b3f('0xf')]);router[_0x0b3f('0x10')]('/',auth[_0x0b3f('0xa')](),controller[_0x0b3f('0x11')]);router[_0x0b3f('0x10')](_0x0b3f('0x12'),auth[_0x0b3f('0xa')](),controller[_0x0b3f('0x13')]);router[_0x0b3f('0x14')](_0x0b3f('0xe'),auth['isAuthenticated'](),controller[_0x0b3f('0x15')]);router[_0x0b3f('0x16')]('/:id',auth[_0x0b3f('0xa')](),controller[_0x0b3f('0x17')]);module[_0x0b3f('0x18')]=router; \ No newline at end of file +var _0x64ca=['destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./cmHopper.controller','get','isAuthenticated','index','/describe','describe','getOpenContacts','/:id','show','post','create','/preview','getPreview','put','delete'];(function(_0x3be7ff,_0x12e714){var _0x186721=function(_0x2bc9e1){while(--_0x2bc9e1){_0x3be7ff['push'](_0x3be7ff['shift']());}};_0x186721(++_0x12e714);}(_0x64ca,0x1d0));var _0xa64c=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x64ca[_0x6c993a];return _0x27f547;};'use strict';var multer=require(_0xa64c('0x0'));var util=require('util');var path=require(_0xa64c('0x1'));var timeout=require(_0xa64c('0x2'));var express=require(_0xa64c('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa64c('0x4'));var config=require('../../config/environment');var controller=require(_0xa64c('0x5'));router[_0xa64c('0x6')]('/',auth[_0xa64c('0x7')](),controller[_0xa64c('0x8')]);router[_0xa64c('0x6')](_0xa64c('0x9'),auth[_0xa64c('0x7')](),controller[_0xa64c('0xa')]);router[_0xa64c('0x6')]('/opencontacts',auth[_0xa64c('0x7')](),controller[_0xa64c('0xb')]);router['get'](_0xa64c('0xc'),auth['isAuthenticated'](),controller[_0xa64c('0xd')]);router[_0xa64c('0xe')]('/',auth[_0xa64c('0x7')](),controller[_0xa64c('0xf')]);router['post'](_0xa64c('0x10'),auth[_0xa64c('0x7')](),controller[_0xa64c('0x11')]);router[_0xa64c('0x12')](_0xa64c('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xa64c('0x13')](_0xa64c('0xc'),auth[_0xa64c('0x7')](),controller[_0xa64c('0x14')]);module[_0xa64c('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 45afefe..075384f 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 _0x282f=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x282f,0x135));var _0xf282=function(_0x59a89b,_0x36f91f){_0x59a89b=_0x59a89b-0x0;var _0x406763=_0x282f[_0x59a89b];return _0x406763;};'use strict';var moment=require(_0xf282('0x0'));var Sequelize=require(_0xf282('0x1'));module['exports']={'phone':{'type':Sequelize[_0xf282('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xf282('0x3')],'unique':_0xf282('0x4')},'ListId':{'type':Sequelize[_0xf282('0x3')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xf282('0x3')],'unique':_0xf282('0x4')}}; \ No newline at end of file +var _0x3b3a=['sequelize','STRING','INTEGER','contactListQueue','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x3b3a,0x126));var _0xa3b3=function(_0x5171a6,_0xee6da8){_0x5171a6=_0x5171a6-0x0;var _0x4b80b5=_0x3b3a[_0x5171a6];return _0x4b80b5;};'use strict';var moment=require(_0xa3b3('0x0'));var Sequelize=require(_0xa3b3('0x1'));module['exports']={'phone':{'type':Sequelize[_0xa3b3('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize[_0xa3b3('0x3')],'unique':_0xa3b3('0x4')},'ListId':{'type':Sequelize[_0xa3b3('0x3')],'unique':_0xa3b3('0x4')},'VoiceQueueId':{'type':Sequelize[_0xa3b3('0x3')],'unique':_0xa3b3('0x4')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index e70ea62..d86d6f1 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 _0xb4f8=['../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','stack','map','CmHopperBlack','rawAttributes','fieldName','type','key','model','name','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','options','update','body','find','destroy','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x15e6d0,_0x2951b2){var _0x23405b=function(_0x39558d){while(--_0x39558d){_0x15e6d0['push'](_0x15e6d0['shift']());}};_0x23405b(++_0x2951b2);}(_0xb4f8,0x83));var _0x8b4f=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb4f8[_0x2aec52];return _0x3b8835;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8b4f('0x0'));var rimraf=require(_0x8b4f('0x1'));var zipdir=require(_0x8b4f('0x2'));var jsonpatch=require(_0x8b4f('0x3'));var rp=require(_0x8b4f('0x4'));var moment=require(_0x8b4f('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x8b4f('0x6'));var util=require('util');var path=require(_0x8b4f('0x7'));var sox=require(_0x8b4f('0x8'));var csv=require(_0x8b4f('0x9'));var ejs=require(_0x8b4f('0xa'));var fs=require('fs');var _=require(_0x8b4f('0xb'));var squel=require('squel');var crypto=require(_0x8b4f('0xc'));var jsforce=require(_0x8b4f('0xd'));var deskjs=require(_0x8b4f('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8b4f('0xf'));var Papa=require(_0x8b4f('0x10'));var Redis=require(_0x8b4f('0x11'));var authService=require(_0x8b4f('0x12'));var qs=require(_0x8b4f('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b4f('0x14'));var logger=require(_0x8b4f('0x15'))('api');var utils=require(_0x8b4f('0x16'));var config=require(_0x8b4f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x420ca5,_0x3dc824){_0x3dc824=_0x3dc824||0xcc;return function(_0x5607fb){if(_0x5607fb){return _0x420ca5[_0x8b4f('0x18')](_0x3dc824);}return _0x420ca5[_0x8b4f('0x19')](_0x3dc824)[_0x8b4f('0x1a')]();};}function respondWithResult(_0xbb3df9,_0x56a9f9){_0x56a9f9=_0x56a9f9||0xc8;return function(_0x4660b0){if(_0x4660b0){return _0xbb3df9[_0x8b4f('0x19')](_0x56a9f9)[_0x8b4f('0x1b')](_0x4660b0);}};}function respondWithFilteredResult(_0x3c42f1,_0x1664a1){return function(_0x181153){if(_0x181153){var _0x59311c=_0x181153[_0x8b4f('0x1c')],_0x201da6=_0x1664a1[_0x8b4f('0x1d')],_0x6713b4=_0x1664a1[_0x8b4f('0x1d')]+_0x1664a1[_0x8b4f('0x1e')],_0x43c99d;if(_0x6713b4>=_0x59311c){_0x6713b4=_0x59311c;_0x43c99d=0xc8;}else{_0x43c99d=0xce;}_0x3c42f1['status'](_0x43c99d);return _0x3c42f1[_0x8b4f('0x1f')](_0x8b4f('0x20'),_0x201da6+'-'+_0x6713b4+'/'+_0x59311c)[_0x8b4f('0x1b')](_0x181153);}return null;};}function patchUpdates(_0x15a219){return function(_0x4e09ab){try{jsonpatch[_0x8b4f('0x21')](_0x4e09ab,_0x15a219,!![]);}catch(_0x48aaaf){return BPromise[_0x8b4f('0x22')](_0x48aaaf);}return _0x4e09ab[_0x8b4f('0x23')]();};}function saveUpdates(_0x5dda4c,_0x3bd3e1){return function(_0x5f0a04){if(_0x5f0a04){return _0x5f0a04['update'](_0x5dda4c)['then'](function(_0x3fe29f){return _0x3fe29f;});}return null;};}function removeEntity(_0x17d4c9,_0x3cc4a7){return function(_0x2af3ef){if(_0x2af3ef){return _0x2af3ef['destroy']()[_0x8b4f('0x24')](function(){_0x17d4c9[_0x8b4f('0x19')](0xcc)[_0x8b4f('0x1a')]();});}};}function handleEntityNotFound(_0x137db8,_0x28df19){return function(_0x584aa0){if(!_0x584aa0){_0x137db8[_0x8b4f('0x18')](0x194);}return _0x584aa0;};}function handleError(_0x1de6aa,_0x1decba){_0x1decba=_0x1decba||0x1f4;return function(_0x1ae110){logger['error'](_0x1ae110[_0x8b4f('0x25')]);if(_0x1ae110['name']){delete _0x1ae110['name'];}_0x1de6aa['status'](_0x1decba)['send'](_0x1ae110);};}exports['index']=function(_0x529cb5,_0x545008){var _0x3ce625={},_0x109a51={},_0x5a1226={'count':0x0,'rows':[]};var _0x4087d4=_[_0x8b4f('0x26')](db[_0x8b4f('0x27')][_0x8b4f('0x28')],function(_0x17fd29){return{'name':_0x17fd29[_0x8b4f('0x29')],'type':_0x17fd29[_0x8b4f('0x2a')][_0x8b4f('0x2b')]};});_0x109a51[_0x8b4f('0x2c')]=_[_0x8b4f('0x26')](_0x4087d4,_0x8b4f('0x2d'));_0x109a51['query']=_[_0x8b4f('0x2e')](_0x529cb5['query']);_0x109a51['filters']=_[_0x8b4f('0x2f')](_0x109a51[_0x8b4f('0x2c')],_0x109a51[_0x8b4f('0x30')]);_0x3ce625[_0x8b4f('0x31')]=_[_0x8b4f('0x2f')](_0x109a51[_0x8b4f('0x2c')],qs['fields'](_0x529cb5[_0x8b4f('0x30')][_0x8b4f('0x32')]));_0x3ce625[_0x8b4f('0x31')]=_0x3ce625[_0x8b4f('0x31')][_0x8b4f('0x33')]?_0x3ce625[_0x8b4f('0x31')]:_0x109a51[_0x8b4f('0x2c')];if(!_0x529cb5[_0x8b4f('0x30')][_0x8b4f('0x34')](_0x8b4f('0x35'))){_0x3ce625[_0x8b4f('0x1e')]=qs[_0x8b4f('0x1e')](_0x529cb5[_0x8b4f('0x30')][_0x8b4f('0x1e')]);_0x3ce625[_0x8b4f('0x1d')]=qs[_0x8b4f('0x1d')](_0x529cb5[_0x8b4f('0x30')][_0x8b4f('0x1d')]);}_0x3ce625[_0x8b4f('0x36')]=qs[_0x8b4f('0x37')](_0x529cb5[_0x8b4f('0x30')][_0x8b4f('0x37')]);_0x3ce625['where']=qs[_0x8b4f('0x38')](_[_0x8b4f('0x39')](_0x529cb5[_0x8b4f('0x30')],_0x109a51[_0x8b4f('0x38')]));if(_0x529cb5[_0x8b4f('0x30')][_0x8b4f('0x3a')]){_0x3ce625['where']=_['merge'](_0x3ce625[_0x8b4f('0x3b')],{'$or':_['map'](_0x4087d4,function(_0xbf49d6){if(_0xbf49d6[_0x8b4f('0x2a')]!==_0x8b4f('0x3c')){var _0x29ee4f={};_0x29ee4f[_0xbf49d6['name']]={'$like':'%'+_0x529cb5['query'][_0x8b4f('0x3a')]+'%'};return _0x29ee4f;}})});}_0x3ce625=_[_0x8b4f('0x3d')]({},_0x3ce625,_0x529cb5['options']);var _0x1197d9={'where':_0x3ce625[_0x8b4f('0x3b')]};return db[_0x8b4f('0x27')][_0x8b4f('0x1c')](_0x1197d9)[_0x8b4f('0x24')](function(_0x35c457){_0x5a1226[_0x8b4f('0x1c')]=_0x35c457;if(_0x529cb5[_0x8b4f('0x30')][_0x8b4f('0x3e')]){_0x3ce625[_0x8b4f('0x3f')]=[{'all':!![]}];}return db[_0x8b4f('0x27')][_0x8b4f('0x40')](_0x3ce625);})[_0x8b4f('0x24')](function(_0x193d0c){_0x5a1226[_0x8b4f('0x41')]=_0x193d0c;return _0x5a1226;})[_0x8b4f('0x24')](respondWithFilteredResult(_0x545008,_0x3ce625))[_0x8b4f('0x42')](handleError(_0x545008,null));};exports[_0x8b4f('0x43')]=function(_0x3d1a2e,_0x142df3){var _0x54420c={'raw':!![],'where':{'id':_0x3d1a2e[_0x8b4f('0x44')]['id']}},_0x426209={};_0x426209[_0x8b4f('0x2c')]=_[_0x8b4f('0x2e')](db[_0x8b4f('0x27')][_0x8b4f('0x28')]);_0x426209[_0x8b4f('0x30')]=_['keys'](_0x3d1a2e[_0x8b4f('0x30')]);_0x426209[_0x8b4f('0x38')]=_['intersection'](_0x426209[_0x8b4f('0x2c')],_0x426209[_0x8b4f('0x30')]);_0x54420c[_0x8b4f('0x31')]=_[_0x8b4f('0x2f')](_0x426209[_0x8b4f('0x2c')],qs[_0x8b4f('0x32')](_0x3d1a2e[_0x8b4f('0x30')][_0x8b4f('0x32')]));_0x54420c[_0x8b4f('0x31')]=_0x54420c[_0x8b4f('0x31')][_0x8b4f('0x33')]?_0x54420c['attributes']:_0x426209[_0x8b4f('0x2c')];if(_0x3d1a2e[_0x8b4f('0x30')][_0x8b4f('0x3e')]){_0x54420c['include']=[{'all':!![]}];}_0x54420c=_['merge']({},_0x54420c,_0x3d1a2e[_0x8b4f('0x45')]);return db[_0x8b4f('0x27')]['find'](_0x54420c)[_0x8b4f('0x24')](handleEntityNotFound(_0x142df3,null))[_0x8b4f('0x24')](respondWithResult(_0x142df3,null))[_0x8b4f('0x42')](handleError(_0x142df3,null));};exports[_0x8b4f('0x46')]=function(_0x36f803,_0xc7e9fb){if(_0x36f803[_0x8b4f('0x47')]['id']){delete _0x36f803[_0x8b4f('0x47')]['id'];}return db[_0x8b4f('0x27')][_0x8b4f('0x48')]({'where':{'id':_0x36f803[_0x8b4f('0x44')]['id']}})[_0x8b4f('0x24')](handleEntityNotFound(_0xc7e9fb,null))[_0x8b4f('0x24')](saveUpdates(_0x36f803[_0x8b4f('0x47')],null))[_0x8b4f('0x24')](respondWithResult(_0xc7e9fb,null))[_0x8b4f('0x42')](handleError(_0xc7e9fb,null));};exports[_0x8b4f('0x49')]=function(_0x3b64af,_0x494836){return db[_0x8b4f('0x27')][_0x8b4f('0x48')]({'where':{'id':_0x3b64af['params']['id']}})['then'](handleEntityNotFound(_0x494836,null))[_0x8b4f('0x24')](removeEntity(_0x494836,null))[_0x8b4f('0x42')](handleError(_0x494836,null));};exports[_0x8b4f('0x4a')]=function(_0x371200,_0x47bedd){return db[_0x8b4f('0x27')]['describe']()[_0x8b4f('0x24')](respondWithResult(_0x47bedd,null))[_0x8b4f('0x42')](handleError(_0x47bedd,null));}; \ No newline at end of file +var _0x8861=['CmHopperBlack','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','include','find','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','set','Content-Range','json','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x197c34,_0x33fcae){var _0x4d5734=function(_0x1b1e31){while(--_0x1b1e31){_0x197c34['push'](_0x197c34['shift']());}};_0x4d5734(++_0x33fcae);}(_0x8861,0x6d));var _0x1886=function(_0x50bf2c,_0x594741){_0x50bf2c=_0x50bf2c-0x0;var _0xdac749=_0x8861[_0x50bf2c];return _0xdac749;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1886('0x0'));var zipdir=require(_0x1886('0x1'));var jsonpatch=require(_0x1886('0x2'));var rp=require(_0x1886('0x3'));var moment=require(_0x1886('0x4'));var BPromise=require(_0x1886('0x5'));var Mustache=require(_0x1886('0x6'));var util=require(_0x1886('0x7'));var path=require(_0x1886('0x8'));var sox=require(_0x1886('0x9'));var csv=require(_0x1886('0xa'));var ejs=require(_0x1886('0xb'));var fs=require('fs');var _=require(_0x1886('0xc'));var squel=require(_0x1886('0xd'));var crypto=require(_0x1886('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1886('0xf'));var toCsv=require('to-csv');var querystring=require(_0x1886('0x10'));var Papa=require('papaparse');var Redis=require(_0x1886('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1886('0x12'));var as=require(_0x1886('0x13'));var hardwareService=require(_0x1886('0x14'));var logger=require(_0x1886('0x15'))(_0x1886('0x16'));var utils=require(_0x1886('0x17'));var config=require('../../config/environment');var db=require(_0x1886('0x18'))['db'];function respondWithStatusCode(_0x3abb3c,_0x13a77f){_0x13a77f=_0x13a77f||0xcc;return function(_0x30c26a){if(_0x30c26a){return _0x3abb3c[_0x1886('0x19')](_0x13a77f);}return _0x3abb3c[_0x1886('0x1a')](_0x13a77f)['end']();};}function respondWithResult(_0x5d92b6,_0x26dcf9){_0x26dcf9=_0x26dcf9||0xc8;return function(_0x23ec3f){if(_0x23ec3f){return _0x5d92b6[_0x1886('0x1a')](_0x26dcf9)['json'](_0x23ec3f);}};}function respondWithFilteredResult(_0xb22f22,_0x43f020){return function(_0x3767ba){if(_0x3767ba){var _0x4993fe=_0x3767ba[_0x1886('0x1b')],_0x54d2ee=_0x43f020['offset'],_0x4083d5=_0x43f020[_0x1886('0x1c')]+_0x43f020['limit'],_0x5afc6b;if(_0x4083d5>=_0x4993fe){_0x4083d5=_0x4993fe;_0x5afc6b=0xc8;}else{_0x5afc6b=0xce;}_0xb22f22['status'](_0x5afc6b);return _0xb22f22[_0x1886('0x1d')](_0x1886('0x1e'),_0x54d2ee+'-'+_0x4083d5+'/'+_0x4993fe)[_0x1886('0x1f')](_0x3767ba);}return null;};}function patchUpdates(_0x3ce4ea){return function(_0x299859){try{jsonpatch[_0x1886('0x20')](_0x299859,_0x3ce4ea,!![]);}catch(_0x433507){return BPromise['reject'](_0x433507);}return _0x299859[_0x1886('0x21')]();};}function saveUpdates(_0x183579,_0x49dc6c){return function(_0x3df84f){if(_0x3df84f){return _0x3df84f[_0x1886('0x22')](_0x183579)[_0x1886('0x23')](function(_0x5dc431){return _0x5dc431;});}return null;};}function removeEntity(_0x444d3c,_0x1b4fb0){return function(_0x257831){if(_0x257831){return _0x257831[_0x1886('0x24')]()[_0x1886('0x23')](function(){_0x444d3c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f7bb1,_0x345bd7){return function(_0x2e508c){if(!_0x2e508c){_0x3f7bb1[_0x1886('0x19')](0x194);}return _0x2e508c;};}function handleError(_0x2bf330,_0x5081b0){_0x5081b0=_0x5081b0||0x1f4;return function(_0x49822a){logger[_0x1886('0x25')](_0x49822a[_0x1886('0x26')]);if(_0x49822a[_0x1886('0x27')]){delete _0x49822a['name'];}_0x2bf330[_0x1886('0x1a')](_0x5081b0)[_0x1886('0x28')](_0x49822a);};}exports[_0x1886('0x29')]=function(_0x3e1b2c,_0x41fdcc){var _0x1a9ce3={},_0xcd0ac5={},_0x148cf5={'count':0x0,'rows':[]};var _0x8bcaf7=_[_0x1886('0x2a')](db[_0x1886('0x2b')][_0x1886('0x2c')],function(_0x4edca2){return{'name':_0x4edca2[_0x1886('0x2d')],'type':_0x4edca2[_0x1886('0x2e')][_0x1886('0x2f')]};});_0xcd0ac5['model']=_[_0x1886('0x2a')](_0x8bcaf7,_0x1886('0x27'));_0xcd0ac5[_0x1886('0x30')]=_['keys'](_0x3e1b2c['query']);_0xcd0ac5['filters']=_[_0x1886('0x31')](_0xcd0ac5[_0x1886('0x32')],_0xcd0ac5[_0x1886('0x30')]);_0x1a9ce3[_0x1886('0x33')]=_[_0x1886('0x31')](_0xcd0ac5[_0x1886('0x32')],qs['fields'](_0x3e1b2c[_0x1886('0x30')][_0x1886('0x34')]));_0x1a9ce3['attributes']=_0x1a9ce3[_0x1886('0x33')]['length']?_0x1a9ce3['attributes']:_0xcd0ac5[_0x1886('0x32')];if(!_0x3e1b2c[_0x1886('0x30')][_0x1886('0x35')](_0x1886('0x36'))){_0x1a9ce3[_0x1886('0x37')]=qs[_0x1886('0x37')](_0x3e1b2c[_0x1886('0x30')][_0x1886('0x37')]);_0x1a9ce3[_0x1886('0x1c')]=qs[_0x1886('0x1c')](_0x3e1b2c['query']['offset']);}_0x1a9ce3[_0x1886('0x38')]=qs['sort'](_0x3e1b2c[_0x1886('0x30')][_0x1886('0x39')]);_0x1a9ce3[_0x1886('0x3a')]=qs[_0x1886('0x3b')](_[_0x1886('0x3c')](_0x3e1b2c[_0x1886('0x30')],_0xcd0ac5[_0x1886('0x3b')]));if(_0x3e1b2c['query'][_0x1886('0x3d')]){_0x1a9ce3[_0x1886('0x3a')]=_[_0x1886('0x3e')](_0x1a9ce3[_0x1886('0x3a')],{'$or':_[_0x1886('0x2a')](_0x8bcaf7,function(_0x3961af){if(_0x3961af[_0x1886('0x2e')]!==_0x1886('0x3f')){var _0x592bc9={};_0x592bc9[_0x3961af[_0x1886('0x27')]]={'$like':'%'+_0x3e1b2c[_0x1886('0x30')][_0x1886('0x3d')]+'%'};return _0x592bc9;}})});}_0x1a9ce3=_[_0x1886('0x3e')]({},_0x1a9ce3,_0x3e1b2c[_0x1886('0x40')]);var _0x4e50b4={'where':_0x1a9ce3[_0x1886('0x3a')]};return db['CmHopperBlack']['count'](_0x4e50b4)['then'](function(_0x113955){_0x148cf5[_0x1886('0x1b')]=_0x113955;if(_0x3e1b2c['query'][_0x1886('0x41')]){_0x1a9ce3['include']=[{'all':!![]}];}return db['CmHopperBlack'][_0x1886('0x42')](_0x1a9ce3);})[_0x1886('0x23')](function(_0x446552){_0x148cf5[_0x1886('0x43')]=_0x446552;return _0x148cf5;})[_0x1886('0x23')](respondWithFilteredResult(_0x41fdcc,_0x1a9ce3))[_0x1886('0x44')](handleError(_0x41fdcc,null));};exports[_0x1886('0x45')]=function(_0x2cfcba,_0x3ab150){var _0x298be6={'raw':!![],'where':{'id':_0x2cfcba[_0x1886('0x46')]['id']}},_0x1dd6a2={};_0x1dd6a2[_0x1886('0x32')]=_[_0x1886('0x47')](db[_0x1886('0x2b')][_0x1886('0x2c')]);_0x1dd6a2[_0x1886('0x30')]=_[_0x1886('0x47')](_0x2cfcba[_0x1886('0x30')]);_0x1dd6a2[_0x1886('0x3b')]=_[_0x1886('0x31')](_0x1dd6a2[_0x1886('0x32')],_0x1dd6a2[_0x1886('0x30')]);_0x298be6[_0x1886('0x33')]=_[_0x1886('0x31')](_0x1dd6a2['model'],qs[_0x1886('0x34')](_0x2cfcba['query'][_0x1886('0x34')]));_0x298be6['attributes']=_0x298be6[_0x1886('0x33')]['length']?_0x298be6[_0x1886('0x33')]:_0x1dd6a2['model'];if(_0x2cfcba[_0x1886('0x30')]['includeAll']){_0x298be6[_0x1886('0x48')]=[{'all':!![]}];}_0x298be6=_['merge']({},_0x298be6,_0x2cfcba[_0x1886('0x40')]);return db['CmHopperBlack'][_0x1886('0x49')](_0x298be6)['then'](handleEntityNotFound(_0x3ab150,null))[_0x1886('0x23')](respondWithResult(_0x3ab150,null))['catch'](handleError(_0x3ab150,null));};exports[_0x1886('0x22')]=function(_0x372460,_0x5c2543){if(_0x372460[_0x1886('0x4a')]['id']){delete _0x372460[_0x1886('0x4a')]['id'];}return db[_0x1886('0x2b')]['find']({'where':{'id':_0x372460[_0x1886('0x46')]['id']}})[_0x1886('0x23')](handleEntityNotFound(_0x5c2543,null))['then'](saveUpdates(_0x372460[_0x1886('0x4a')],null))[_0x1886('0x23')](respondWithResult(_0x5c2543,null))[_0x1886('0x44')](handleError(_0x5c2543,null));};exports[_0x1886('0x24')]=function(_0x1aceda,_0x4b0aad){return db[_0x1886('0x2b')]['find']({'where':{'id':_0x1aceda[_0x1886('0x46')]['id']}})['then'](handleEntityNotFound(_0x4b0aad,null))['then'](removeEntity(_0x4b0aad,null))['catch'](handleError(_0x4b0aad,null));};exports[_0x1886('0x4b')]=function(_0x2e7068,_0x50431f){return db[_0x1886('0x2b')][_0x1886('0x4b')]()[_0x1886('0x23')](respondWithResult(_0x50431f,null))[_0x1886('0x44')](handleError(_0x50431f,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index fe43b29..300bef6 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 _0x4ec6=['request-promise','path','rimraf','./cmHopperBlack.attributes','exports','define','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird'];(function(_0x5b174b,_0x404869){var _0x47ee37=function(_0x467947){while(--_0x467947){_0x5b174b['push'](_0x5b174b['shift']());}};_0x47ee37(++_0x404869);}(_0x4ec6,0x157));var _0x64ec=function(_0x528278,_0x19bd96){_0x528278=_0x528278-0x0;var _0x35ed89=_0x4ec6[_0x528278];return _0x35ed89;};'use strict';var _=require(_0x64ec('0x0'));var util=require(_0x64ec('0x1'));var logger=require(_0x64ec('0x2'))('api');var moment=require(_0x64ec('0x3'));var BPromise=require(_0x64ec('0x4'));var rp=require(_0x64ec('0x5'));var fs=require('fs');var path=require(_0x64ec('0x6'));var rimraf=require(_0x64ec('0x7'));var config=require('../../config/environment');var attributes=require(_0x64ec('0x8'));module[_0x64ec('0x9')]=function(_0x5ec1d0,_0x23876b){return _0x5ec1d0[_0x64ec('0xa')]('CmHopperBlack',attributes,{'tableName':_0x64ec('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb72a=['bluebird','path','./cmHopperBlack.attributes','exports','define','cm_hopper_black','util','../../config/logger','api','moment'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xb72a,0x1c8));var _0xab72=function(_0x10dfd7,_0x24d7e1){_0x10dfd7=_0x10dfd7-0x0;var _0x391331=_0xb72a[_0x10dfd7];return _0x391331;};'use strict';var _=require('lodash');var util=require(_0xab72('0x0'));var logger=require(_0xab72('0x1'))(_0xab72('0x2'));var moment=require(_0xab72('0x3'));var BPromise=require(_0xab72('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xab72('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xab72('0x6'));module[_0xab72('0x7')]=function(_0x5c36a5,_0x5f15c2){return _0x5c36a5[_0xab72('0x8')]('CmHopperBlack',attributes,{'tableName':_0xab72('0x9'),'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 24ca83d..f8cbaed 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 _0xd874=['result','catch','GetCmHopperBlack','CmHopperBlack','options','where','attributes','limit','include','model','UpdateCmHopperBlack','update','body','raw','DestroyCmHopperBlack','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','message','info'];(function(_0x53a7af,_0x1408a5){var _0x3cc7f6=function(_0x4bf101){while(--_0x4bf101){_0x53a7af['push'](_0x53a7af['shift']());}};_0x3cc7f6(++_0x1408a5);}(_0xd874,0x10b));var _0x4d87=function(_0x3cf7d6,_0x43f198){_0x3cf7d6=_0x3cf7d6-0x0;var _0x5a9604=_0xd874[_0x3cf7d6];return _0x5a9604;};'use strict';var _=require(_0x4d87('0x0'));var util=require(_0x4d87('0x1'));var moment=require(_0x4d87('0x2'));var BPromise=require(_0x4d87('0x3'));var rs=require(_0x4d87('0x4'));var fs=require('fs');var Redis=require(_0x4d87('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4d87('0x6'));var logger=require(_0x4d87('0x7'))('rpc');var config=require(_0x4d87('0x8'));var jayson=require(_0x4d87('0x9'));var client=jayson[_0x4d87('0xa')][_0x4d87('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8a756f,_0x28a475,_0x5aa1bd){return new BPromise(function(_0x539cb4,_0x41e915){return client[_0x4d87('0xc')](_0x8a756f,_0x5aa1bd)[_0x4d87('0xd')](function(_0x57bb77){logger['info'](_0x4d87('0xe'),_0x28a475,'request\x20sent');logger[_0x4d87('0xf')](_0x4d87('0x10'),_0x28a475,'request\x20sent',JSON[_0x4d87('0x11')](_0x57bb77));if(_0x57bb77[_0x4d87('0x12')]){if(_0x57bb77[_0x4d87('0x12')]['code']===0x1f4){logger[_0x4d87('0x12')](_0x4d87('0xe'),_0x28a475,_0x57bb77[_0x4d87('0x12')][_0x4d87('0x13')]);return _0x41e915(_0x57bb77['error'][_0x4d87('0x13')]);}logger[_0x4d87('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x28a475,_0x57bb77[_0x4d87('0x12')][_0x4d87('0x13')]);return _0x539cb4(_0x57bb77[_0x4d87('0x12')][_0x4d87('0x13')]);}else{logger[_0x4d87('0x14')]('CmHopperBlack,\x20%s,\x20%s',_0x28a475,'request\x20sent');_0x539cb4(_0x57bb77[_0x4d87('0x15')]['message']);}})[_0x4d87('0x16')](function(_0x597ec7){logger[_0x4d87('0x12')]('CmHopperBlack,\x20%s,\x20%s',_0x28a475,_0x597ec7);_0x41e915(_0x597ec7);});});}exports[_0x4d87('0x17')]=function(_0x451850){var _0x5c36c7=this;return new Promise(function(_0xcabca9,_0x106b5d){return db[_0x4d87('0x18')]['findAll']({'raw':_0x451850['options']?_0x451850['options']['raw']===undefined?!![]:![]:!![],'where':_0x451850[_0x4d87('0x19')]?_0x451850[_0x4d87('0x19')][_0x4d87('0x1a')]||null:null,'attributes':_0x451850[_0x4d87('0x19')]?_0x451850[_0x4d87('0x19')][_0x4d87('0x1b')]||null:null,'limit':_0x451850[_0x4d87('0x19')]?_0x451850[_0x4d87('0x19')][_0x4d87('0x1c')]||null:null,'include':_0x451850[_0x4d87('0x19')]?_0x451850['options'][_0x4d87('0x1d')]?_['map'](_0x451850[_0x4d87('0x19')][_0x4d87('0x1d')],function(_0x868d95){return{'model':db[_0x868d95[_0x4d87('0x1e')]],'as':_0x868d95['as'],'attributes':_0x868d95[_0x4d87('0x1b')],'include':_0x868d95['include']?_['map'](_0x868d95[_0x4d87('0x1d')],function(_0x4265ed){return{'model':db[_0x4265ed[_0x4d87('0x1e')]],'as':_0x4265ed['as'],'attributes':_0x4265ed['attributes'],'include':_0x4265ed[_0x4d87('0x1d')]?_['map'](_0x4265ed['include'],function(_0x3f4d41){return{'model':db[_0x3f4d41[_0x4d87('0x1e')]],'as':_0x3f4d41['as'],'attributes':_0x3f4d41[_0x4d87('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4d87('0xd')](function(_0x1c006a){logger['info'](_0x4d87('0x17'),_0x451850);logger[_0x4d87('0xf')](_0x4d87('0x17'),_0x451850,JSON['stringify'](_0x1c006a));_0xcabca9(_0x1c006a);})[_0x4d87('0x16')](function(_0x2d32f3){logger[_0x4d87('0x12')](_0x4d87('0x17'),_0x2d32f3[_0x4d87('0x13')],_0x451850);_0x106b5d(_0x5c36c7[_0x4d87('0x12')](0x1f4,_0x2d32f3[_0x4d87('0x13')]));});});};exports[_0x4d87('0x1f')]=function(_0x271e6c){var _0x281ccc=this;return new Promise(function(_0x5b4a73,_0x35e832){return db['CmHopperBlack'][_0x4d87('0x20')](_0x271e6c[_0x4d87('0x21')],{'raw':_0x271e6c[_0x4d87('0x19')]?_0x271e6c['options'][_0x4d87('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x271e6c['options']?_0x271e6c[_0x4d87('0x19')][_0x4d87('0x1a')]||null:null,'attributes':_0x271e6c[_0x4d87('0x19')]?_0x271e6c[_0x4d87('0x19')]['attributes']||null:null,'limit':_0x271e6c[_0x4d87('0x19')]?_0x271e6c[_0x4d87('0x19')]['limit']||null:null})[_0x4d87('0xd')](function(_0x1112bd){logger['info'](_0x4d87('0x1f'),_0x271e6c);logger[_0x4d87('0xf')](_0x4d87('0x1f'),_0x271e6c,JSON['stringify'](_0x1112bd));_0x5b4a73(_0x1112bd);})[_0x4d87('0x16')](function(_0x3da095){logger[_0x4d87('0x12')](_0x4d87('0x1f'),_0x3da095[_0x4d87('0x13')],_0x271e6c);_0x35e832(_0x281ccc[_0x4d87('0x12')](0x1f4,_0x3da095[_0x4d87('0x13')]));});});};exports['DestroyCmHopperBlack']=function(_0x475922){var _0x4c426d=this;return new Promise(function(_0x14e638,_0x43772c){return db[_0x4d87('0x18')]['destroy']({'where':_0x475922[_0x4d87('0x19')]?_0x475922['options'][_0x4d87('0x1a')]||null:null})[_0x4d87('0xd')](function(_0x49ffe9){logger[_0x4d87('0x14')](_0x4d87('0x23'),_0x475922);logger[_0x4d87('0xf')]('DestroyCmHopperBlack',_0x475922,JSON[_0x4d87('0x11')](_0x49ffe9));_0x14e638(_0x49ffe9);})[_0x4d87('0x16')](function(_0x5db60a){logger[_0x4d87('0x12')](_0x4d87('0x23'),_0x5db60a[_0x4d87('0x13')],_0x475922);_0x43772c(_0x4c426d[_0x4d87('0x12')](0x1f4,_0x5db60a[_0x4d87('0x13')]));});});}; \ No newline at end of file +var _0x6e2c=['code','message','info','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','map','include','model','UpdateCmHopperBlack','update','DestroyCmHopperBlack','destroy','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x202c61,_0x3673e0){var _0x540691=function(_0x409610){while(--_0x409610){_0x202c61['push'](_0x202c61['shift']());}};_0x540691(++_0x3673e0);}(_0x6e2c,0xa8));var _0xc6e2=function(_0x231c73,_0x5147ab){_0x231c73=_0x231c73-0x0;var _0x131bae=_0x6e2c[_0x231c73];return _0x131bae;};'use strict';var _=require(_0xc6e2('0x0'));var util=require(_0xc6e2('0x1'));var moment=require(_0xc6e2('0x2'));var BPromise=require(_0xc6e2('0x3'));var rs=require(_0xc6e2('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc6e2('0x5'))['db'];var utils=require(_0xc6e2('0x6'));var logger=require('../../config/logger')(_0xc6e2('0x7'));var config=require(_0xc6e2('0x8'));var jayson=require(_0xc6e2('0x9'));var client=jayson['client'][_0xc6e2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd9af2f,_0x22c8fe,_0x356c9d){return new BPromise(function(_0x39bc3a,_0x95f5cd){return client['request'](_0xd9af2f,_0x356c9d)[_0xc6e2('0xb')](function(_0x30be8b){logger['info'](_0xc6e2('0xc'),_0x22c8fe,_0xc6e2('0xd'));logger[_0xc6e2('0xe')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x22c8fe,_0xc6e2('0xd'),JSON[_0xc6e2('0xf')](_0x30be8b));if(_0x30be8b[_0xc6e2('0x10')]){if(_0x30be8b[_0xc6e2('0x10')][_0xc6e2('0x11')]===0x1f4){logger['error'](_0xc6e2('0xc'),_0x22c8fe,_0x30be8b[_0xc6e2('0x10')][_0xc6e2('0x12')]);return _0x95f5cd(_0x30be8b[_0xc6e2('0x10')][_0xc6e2('0x12')]);}logger[_0xc6e2('0x10')]('CmHopperBlack,\x20%s,\x20%s',_0x22c8fe,_0x30be8b[_0xc6e2('0x10')][_0xc6e2('0x12')]);return _0x39bc3a(_0x30be8b['error'][_0xc6e2('0x12')]);}else{logger[_0xc6e2('0x13')]('CmHopperBlack,\x20%s,\x20%s',_0x22c8fe,_0xc6e2('0xd'));_0x39bc3a(_0x30be8b[_0xc6e2('0x14')][_0xc6e2('0x12')]);}})[_0xc6e2('0x15')](function(_0x4af722){logger['error'](_0xc6e2('0xc'),_0x22c8fe,_0x4af722);_0x95f5cd(_0x4af722);});});}exports[_0xc6e2('0x16')]=function(_0xee5e30){var _0x41f3d3=this;return new Promise(function(_0x5a2dbf,_0x4d0bd2){return db[_0xc6e2('0x17')][_0xc6e2('0x18')]({'raw':_0xee5e30[_0xc6e2('0x19')]?_0xee5e30[_0xc6e2('0x19')][_0xc6e2('0x1a')]===undefined?!![]:![]:!![],'where':_0xee5e30[_0xc6e2('0x19')]?_0xee5e30[_0xc6e2('0x19')][_0xc6e2('0x1b')]||null:null,'attributes':_0xee5e30['options']?_0xee5e30[_0xc6e2('0x19')][_0xc6e2('0x1c')]||null:null,'limit':_0xee5e30[_0xc6e2('0x19')]?_0xee5e30[_0xc6e2('0x19')][_0xc6e2('0x1d')]||null:null,'include':_0xee5e30[_0xc6e2('0x19')]?_0xee5e30[_0xc6e2('0x19')]['include']?_[_0xc6e2('0x1e')](_0xee5e30[_0xc6e2('0x19')][_0xc6e2('0x1f')],function(_0xabd911){return{'model':db[_0xabd911[_0xc6e2('0x20')]],'as':_0xabd911['as'],'attributes':_0xabd911[_0xc6e2('0x1c')],'include':_0xabd911[_0xc6e2('0x1f')]?_[_0xc6e2('0x1e')](_0xabd911[_0xc6e2('0x1f')],function(_0x13864a){return{'model':db[_0x13864a[_0xc6e2('0x20')]],'as':_0x13864a['as'],'attributes':_0x13864a[_0xc6e2('0x1c')],'include':_0x13864a[_0xc6e2('0x1f')]?_[_0xc6e2('0x1e')](_0x13864a[_0xc6e2('0x1f')],function(_0x2c7016){return{'model':db[_0x2c7016[_0xc6e2('0x20')]],'as':_0x2c7016['as'],'attributes':_0x2c7016['attributes']};}):[]};}):[]};}):[]:[]})[_0xc6e2('0xb')](function(_0x2e059e){logger[_0xc6e2('0x13')](_0xc6e2('0x16'),_0xee5e30);logger['debug']('GetCmHopperBlack',_0xee5e30,JSON[_0xc6e2('0xf')](_0x2e059e));_0x5a2dbf(_0x2e059e);})['catch'](function(_0x142f85){logger[_0xc6e2('0x10')](_0xc6e2('0x16'),_0x142f85[_0xc6e2('0x12')],_0xee5e30);_0x4d0bd2(_0x41f3d3[_0xc6e2('0x10')](0x1f4,_0x142f85[_0xc6e2('0x12')]));});});};exports[_0xc6e2('0x21')]=function(_0xe04d4b){var _0x5cedd8=this;return new Promise(function(_0x41e81f,_0x539a7e){return db[_0xc6e2('0x17')][_0xc6e2('0x22')](_0xe04d4b['body'],{'raw':_0xe04d4b[_0xc6e2('0x19')]?_0xe04d4b[_0xc6e2('0x19')][_0xc6e2('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe04d4b[_0xc6e2('0x19')]?_0xe04d4b[_0xc6e2('0x19')][_0xc6e2('0x1b')]||null:null,'attributes':_0xe04d4b[_0xc6e2('0x19')]?_0xe04d4b[_0xc6e2('0x19')][_0xc6e2('0x1c')]||null:null,'limit':_0xe04d4b[_0xc6e2('0x19')]?_0xe04d4b[_0xc6e2('0x19')][_0xc6e2('0x1d')]||null:null})[_0xc6e2('0xb')](function(_0x917c6f){logger[_0xc6e2('0x13')](_0xc6e2('0x21'),_0xe04d4b);logger[_0xc6e2('0xe')](_0xc6e2('0x21'),_0xe04d4b,JSON[_0xc6e2('0xf')](_0x917c6f));_0x41e81f(_0x917c6f);})[_0xc6e2('0x15')](function(_0x59a8ab){logger[_0xc6e2('0x10')](_0xc6e2('0x21'),_0x59a8ab['message'],_0xe04d4b);_0x539a7e(_0x5cedd8[_0xc6e2('0x10')](0x1f4,_0x59a8ab[_0xc6e2('0x12')]));});});};exports[_0xc6e2('0x23')]=function(_0x9c871){var _0x2446e0=this;return new Promise(function(_0x5ca8c3,_0x148e50){return db['CmHopperBlack'][_0xc6e2('0x24')]({'where':_0x9c871[_0xc6e2('0x19')]?_0x9c871[_0xc6e2('0x19')][_0xc6e2('0x1b')]||null:null})['then'](function(_0x240ccc){logger['info'](_0xc6e2('0x23'),_0x9c871);logger[_0xc6e2('0xe')](_0xc6e2('0x23'),_0x9c871,JSON[_0xc6e2('0xf')](_0x240ccc));_0x5ca8c3(_0x240ccc);})['catch'](function(_0x365681){logger[_0xc6e2('0x10')](_0xc6e2('0x23'),_0x365681[_0xc6e2('0x12')],_0x9c871);_0x148e50(_0x2446e0[_0xc6e2('0x10')](0x1f4,_0x365681[_0xc6e2('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 3fe9943..c6bc636 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 _0x7bae=['index','/describe','describe','/:id','show','update','delete','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated'];(function(_0x2426a9,_0x32e536){var _0x601eba=function(_0x5aafd2){while(--_0x5aafd2){_0x2426a9['push'](_0x2426a9['shift']());}};_0x601eba(++_0x32e536);}(_0x7bae,0x13b));var _0xe7ba=function(_0x3de8a4,_0x289a5c){_0x3de8a4=_0x3de8a4-0x0;var _0x4635cf=_0x7bae[_0x3de8a4];return _0x4635cf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe7ba('0x0'));var timeout=require(_0xe7ba('0x1'));var express=require('express');var router=express[_0xe7ba('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xe7ba('0x3'));var config=require(_0xe7ba('0x4'));var controller=require(_0xe7ba('0x5'));router[_0xe7ba('0x6')]('/',auth[_0xe7ba('0x7')](),controller[_0xe7ba('0x8')]);router[_0xe7ba('0x6')](_0xe7ba('0x9'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xa')]);router[_0xe7ba('0x6')](_0xe7ba('0xb'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xc')]);router['put'](_0xe7ba('0xb'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xd')]);router[_0xe7ba('0xe')](_0xe7ba('0xb'),auth[_0xe7ba('0x7')](),controller[_0xe7ba('0xf')]);module[_0xe7ba('0x10')]=router; \ No newline at end of file +var _0x5fd1=['/:id','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe'];(function(_0x26877a,_0x32c0c1){var _0x198f23=function(_0x387e59){while(--_0x387e59){_0x26877a['push'](_0x26877a['shift']());}};_0x198f23(++_0x32c0c1);}(_0x5fd1,0x155));var _0x15fd=function(_0x36a4dc,_0x1abbef){_0x36a4dc=_0x36a4dc-0x0;var _0x16e283=_0x5fd1[_0x36a4dc];return _0x16e283;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x15fd('0x4'));var config=require(_0x15fd('0x5'));var controller=require(_0x15fd('0x6'));router['get']('/',auth[_0x15fd('0x7')](),controller[_0x15fd('0x8')]);router[_0x15fd('0x9')](_0x15fd('0xa'),auth[_0x15fd('0x7')](),controller['describe']);router[_0x15fd('0x9')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller['show']);router[_0x15fd('0xc')]('/:id',auth[_0x15fd('0x7')](),controller[_0x15fd('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xe')]);module[_0x15fd('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 6b9a39c..31dda05 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 _0xe83e=['STRING','DATE','getDataValue','endtime','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER'];(function(_0x4e1153,_0x6be2fc){var _0x569884=function(_0x326dc3){while(--_0x326dc3){_0x4e1153['push'](_0x4e1153['shift']());}};_0x569884(++_0x6be2fc);}(_0xe83e,0x7a));var _0xee83=function(_0x2ecd77,_0x1ced18){_0x2ecd77=_0x2ecd77-0x0;var _0x310bac=_0xe83e[_0x2ecd77];return _0x310bac;};'use strict';var Sequelize=require(_0xee83('0x0'));var moment=require(_0xee83('0x1'));module[_0xee83('0x2')]={'state':{'type':Sequelize[_0xee83('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xee83('0x4')]},'scheduledat':{'type':Sequelize[_0xee83('0x5')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xee83('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xee83('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xee83('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xee83('0x4')]},'originatecalleridname':{'type':Sequelize[_0xee83('0x4')]},'calleridnum':{'type':Sequelize[_0xee83('0x4')]},'calleridname':{'type':Sequelize[_0xee83('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xee83('0x5')]},'answertime':{'type':Sequelize[_0xee83('0x5')]},'droptime':{'type':Sequelize[_0xee83('0x5')]},'endtime':{'type':Sequelize[_0xee83('0x5')]},'ringtime':{'type':Sequelize[_0xee83('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xee83('0x3')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xee83('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xee83('0x4')]},'campaign':{'type':Sequelize[_0xee83('0x4')]},'campaigntype':{'type':Sequelize[_0xee83('0x4')]},'membername':{'type':Sequelize[_0xee83('0x4')]},'reason':{'type':Sequelize[_0xee83('0x4')]},'disposition':{'type':Sequelize[_0xee83('0x4')]},'dispositionat':{'type':Sequelize[_0xee83('0x5')],'set':function(_0x5b1418){var _0x5db25f=this[_0xee83('0x6')](_0xee83('0x7'));if(_0x5db25f&&_0x5b1418){this[_0xee83('0x8')](_0xee83('0x9'),moment(_0x5b1418)[_0xee83('0xa')](moment(_0x5db25f),_0xee83('0xb')));}return this[_0xee83('0x8')](_0xee83('0xc'),_0x5b1418);}},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xee83('0xd')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xee83('0xd')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xee83('0x5')]},'callback':{'type':Sequelize[_0xee83('0xd')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xee83('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xee83('0x5')]},'deleted':{'type':Sequelize[_0xee83('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xee83('0x5')]},'recallme':{'type':Sequelize[_0xee83('0xd')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xee83('0x5')]}}; \ No newline at end of file +var _0x1e6b=['getDataValue','setDataValue','followuptime','diff','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE'];(function(_0x3b56de,_0x5cc088){var _0x27c6e5=function(_0x522fe5){while(--_0x522fe5){_0x3b56de['push'](_0x3b56de['shift']());}};_0x27c6e5(++_0x5cc088);}(_0x1e6b,0x118));var _0xb1e6=function(_0x3a9026,_0x3e9a5f){_0x3a9026=_0x3a9026-0x0;var _0x421e4e=_0x1e6b[_0x3a9026];return _0x421e4e;};'use strict';var Sequelize=require(_0xb1e6('0x0'));var moment=require(_0xb1e6('0x1'));module[_0xb1e6('0x2')]={'state':{'type':Sequelize[_0xb1e6('0x3')](0x2)},'statedesc':{'type':Sequelize[_0xb1e6('0x4')]},'scheduledat':{'type':Sequelize[_0xb1e6('0x5')]},'countbusyretry':{'type':Sequelize[_0xb1e6('0x3')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb1e6('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb1e6('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xb1e6('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xb1e6('0x4')]},'originatecalleridname':{'type':Sequelize[_0xb1e6('0x4')]},'calleridnum':{'type':Sequelize[_0xb1e6('0x4')]},'calleridname':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xb1e6('0x5')]},'responsetime':{'type':Sequelize[_0xb1e6('0x5')]},'answertime':{'type':Sequelize[_0xb1e6('0x5')]},'droptime':{'type':Sequelize[_0xb1e6('0x5')]},'endtime':{'type':Sequelize[_0xb1e6('0x5')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb1e6('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xb1e6('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb1e6('0x4')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb1e6('0x4')]},'membername':{'type':Sequelize[_0xb1e6('0x4')]},'reason':{'type':Sequelize[_0xb1e6('0x4')]},'disposition':{'type':Sequelize[_0xb1e6('0x4')]},'dispositionat':{'type':Sequelize[_0xb1e6('0x5')],'set':function(_0x52c1eb){var _0xfac32d=this[_0xb1e6('0x6')]('endtime');if(_0xfac32d&&_0x52c1eb){this[_0xb1e6('0x7')](_0xb1e6('0x8'),moment(_0x52c1eb)[_0xb1e6('0x9')](moment(_0xfac32d),'seconds'));}return this['setDataValue']('dispositionat',_0x52c1eb);}},'amd':{'type':Sequelize[_0xb1e6('0xa')],'defaultValue':![]},'fax':{'type':Sequelize[_0xb1e6('0xa')],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xb1e6('0xa')],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xb1e6('0x5')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb1e6('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb1e6('0x5')]},'deleted':{'type':Sequelize[_0xb1e6('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0xb1e6('0x5')]},'recallme':{'type':Sequelize[_0xb1e6('0xa')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xb1e6('0x5')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 8513111..70add39 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 _0xe25c=['ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','type','query','filters','attributes','intersection','model','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','includeAll','include','findAll','catch','options','find','uniqueid','params','body','COUNT','sequelize','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x203,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ContactId','createdAt','updatedAt','ANY_VALUE(calleridnum)','NOW()','field','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ListId','ANY_VALUE(VoiceQueueId)','VoiceQueueId','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','select','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','fromQuery','CampaignId','CampaignId\x20=\x20?','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path'];(function(_0x19ed59,_0x5b4ac6){var _0xe73f16=function(_0x2989cc){while(--_0x2989cc){_0x19ed59['push'](_0x19ed59['shift']());}};_0xe73f16(++_0x5b4ac6);}(_0xe25c,0x75));var _0xce25=function(_0x379111,_0x13e89e){_0x379111=_0x379111-0x0;var _0x5cc2f6=_0xe25c[_0x379111];return _0x5cc2f6;};'use strict';var pdf=require(_0xce25('0x0'));var emlformat=require(_0xce25('0x1'));var rimraf=require(_0xce25('0x2'));var zipdir=require(_0xce25('0x3'));var jsonpatch=require(_0xce25('0x4'));var rp=require('request-promise');var moment=require(_0xce25('0x5'));var BPromise=require(_0xce25('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xce25('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xce25('0x8'));var fs=require('fs');var _=require(_0xce25('0x9'));var squel=require(_0xce25('0xa'));var crypto=require(_0xce25('0xb'));var jsforce=require(_0xce25('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xce25('0xd'));var querystring=require('querystring');var Papa=require(_0xce25('0xe'));var Redis=require(_0xce25('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xce25('0x10'));var as=require(_0xce25('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xce25('0x12'))(_0xce25('0x13'));var utils=require('../../config/utils');var config=require(_0xce25('0x14'));var db=require(_0xce25('0x15'))['db'];function respondWithStatusCode(_0x4eb0cd,_0x3239fd){_0x3239fd=_0x3239fd||0xcc;return function(_0x5ee98a){if(_0x5ee98a){return _0x4eb0cd[_0xce25('0x16')](_0x3239fd);}return _0x4eb0cd['status'](_0x3239fd)[_0xce25('0x17')]();};}function respondWithResult(_0x52ea29,_0x55efcd){_0x55efcd=_0x55efcd||0xc8;return function(_0x33ea11){if(_0x33ea11){return _0x52ea29['status'](_0x55efcd)['json'](_0x33ea11);}};}function respondWithFilteredResult(_0x31c01d,_0xa31a13){return function(_0x1eddbf){if(_0x1eddbf){var _0x3d1804=_0x1eddbf[_0xce25('0x18')],_0x2bbe4c=_0xa31a13['offset'],_0x3e0392=_0xa31a13[_0xce25('0x19')]+_0xa31a13[_0xce25('0x1a')],_0x4de0d0;if(_0x3e0392>=_0x3d1804){_0x3e0392=_0x3d1804;_0x4de0d0=0xc8;}else{_0x4de0d0=0xce;}_0x31c01d[_0xce25('0x1b')](_0x4de0d0);return _0x31c01d['set'](_0xce25('0x1c'),_0x2bbe4c+'-'+_0x3e0392+'/'+_0x3d1804)[_0xce25('0x1d')](_0x1eddbf);}return null;};}function patchUpdates(_0x3b2be1){return function(_0x4af16e){try{jsonpatch[_0xce25('0x1e')](_0x4af16e,_0x3b2be1,!![]);}catch(_0x138199){return BPromise[_0xce25('0x1f')](_0x138199);}return _0x4af16e[_0xce25('0x20')]();};}function saveUpdates(_0x136525,_0x2ef794){return function(_0x40ae83){if(_0x40ae83){return _0x40ae83[_0xce25('0x21')](_0x136525)[_0xce25('0x22')](function(_0x36c3e0){return _0x36c3e0;});}return null;};}function removeEntity(_0x5463f6,_0x209d19){return function(_0x4ed616){if(_0x4ed616){return _0x4ed616[_0xce25('0x23')]()[_0xce25('0x22')](function(){_0x5463f6[_0xce25('0x1b')](0xcc)[_0xce25('0x17')]();});}};}function handleEntityNotFound(_0x3f1898,_0x4fe52b){return function(_0x5aa38a){if(!_0x5aa38a){_0x3f1898[_0xce25('0x16')](0x194);}return _0x5aa38a;};}function handleError(_0x38977d,_0x3e39b5){_0x3e39b5=_0x3e39b5||0x1f4;return function(_0x38a3fa){logger[_0xce25('0x24')](_0x38a3fa[_0xce25('0x25')]);if(_0x38a3fa[_0xce25('0x26')]){delete _0x38a3fa[_0xce25('0x26')];}_0x38977d['status'](_0x3e39b5)[_0xce25('0x27')](_0x38a3fa);};}exports[_0xce25('0x28')]=function(_0x478f46,_0x12a784){var _0x270524={},_0x32d596={},_0x1404b6={'count':0x0,'rows':[]};var _0x2208f3=_[_0xce25('0x29')](db[_0xce25('0x2a')][_0xce25('0x2b')],function(_0x3aefdc){return{'name':_0x3aefdc['fieldName'],'type':_0x3aefdc[_0xce25('0x2c')]['key']};});_0x32d596['model']=_['map'](_0x2208f3,_0xce25('0x26'));_0x32d596[_0xce25('0x2d')]=_['keys'](_0x478f46[_0xce25('0x2d')]);_0x32d596[_0xce25('0x2e')]=_['intersection'](_0x32d596['model'],_0x32d596[_0xce25('0x2d')]);_0x270524[_0xce25('0x2f')]=_[_0xce25('0x30')](_0x32d596[_0xce25('0x31')],qs['fields'](_0x478f46[_0xce25('0x2d')][_0xce25('0x32')]));_0x270524['attributes']=_0x270524[_0xce25('0x2f')][_0xce25('0x33')]?_0x270524['attributes']:_0x32d596[_0xce25('0x31')];if(!_0x478f46[_0xce25('0x2d')][_0xce25('0x34')](_0xce25('0x35'))){_0x270524[_0xce25('0x1a')]=qs[_0xce25('0x1a')](_0x478f46[_0xce25('0x2d')][_0xce25('0x1a')]);_0x270524[_0xce25('0x19')]=qs[_0xce25('0x19')](_0x478f46[_0xce25('0x2d')][_0xce25('0x19')]);}_0x270524[_0xce25('0x36')]=qs[_0xce25('0x37')](_0x478f46['query']['sort']);_0x270524['where']=qs[_0xce25('0x2e')](_[_0xce25('0x38')](_0x478f46[_0xce25('0x2d')],_0x32d596['filters']));if(_0x478f46[_0xce25('0x2d')][_0xce25('0x39')]){_0x270524[_0xce25('0x3a')]=_[_0xce25('0x3b')](_0x270524[_0xce25('0x3a')],{'$or':_[_0xce25('0x29')](_0x2208f3,function(_0x25dcac){if(_0x25dcac['type']!=='VIRTUAL'){var _0x59d5bd={};_0x59d5bd[_0x25dcac[_0xce25('0x26')]]={'$like':'%'+_0x478f46[_0xce25('0x2d')][_0xce25('0x39')]+'%'};return _0x59d5bd;}})});}_0x270524=_[_0xce25('0x3b')]({},_0x270524,_0x478f46['options']);var _0x27c7bb={'where':_0x270524[_0xce25('0x3a')]};return db[_0xce25('0x2a')]['count'](_0x27c7bb)[_0xce25('0x22')](function(_0x5232b4){_0x1404b6[_0xce25('0x18')]=_0x5232b4;if(_0x478f46['query'][_0xce25('0x3c')]){_0x270524[_0xce25('0x3d')]=[{'all':!![]}];}return db[_0xce25('0x2a')][_0xce25('0x3e')](_0x270524);})[_0xce25('0x22')](function(_0x802e82){_0x1404b6['rows']=_0x802e82;return _0x1404b6;})[_0xce25('0x22')](respondWithFilteredResult(_0x12a784,_0x270524))[_0xce25('0x3f')](handleError(_0x12a784,null));};exports['show']=function(_0x31007e,_0x1a6fdd){var _0x1e94b0={'raw':!![],'where':{'id':_0x31007e['params']['id']}},_0x8b6084={};_0x8b6084['model']=_['keys'](db[_0xce25('0x2a')]['rawAttributes']);_0x8b6084['query']=_['keys'](_0x31007e['query']);_0x8b6084[_0xce25('0x2e')]=_[_0xce25('0x30')](_0x8b6084[_0xce25('0x31')],_0x8b6084[_0xce25('0x2d')]);_0x1e94b0[_0xce25('0x2f')]=_[_0xce25('0x30')](_0x8b6084[_0xce25('0x31')],qs[_0xce25('0x32')](_0x31007e[_0xce25('0x2d')]['fields']));_0x1e94b0[_0xce25('0x2f')]=_0x1e94b0[_0xce25('0x2f')]['length']?_0x1e94b0['attributes']:_0x8b6084[_0xce25('0x31')];if(_0x31007e[_0xce25('0x2d')][_0xce25('0x3c')]){_0x1e94b0[_0xce25('0x3d')]=[{'all':!![]}];}_0x1e94b0=_[_0xce25('0x3b')]({},_0x1e94b0,_0x31007e[_0xce25('0x40')]);return db[_0xce25('0x2a')][_0xce25('0x41')](_0x1e94b0)['then'](handleEntityNotFound(_0x1a6fdd,null))['then'](respondWithResult(_0x1a6fdd,null))[_0xce25('0x3f')](handleError(_0x1a6fdd,null));};exports['describe']=function(_0x285442,_0x4f935e){return db[_0xce25('0x2a')]['describe']()['then'](respondWithResult(_0x4f935e,null))['catch'](handleError(_0x4f935e,null));};exports[_0xce25('0x21')]=function(_0x2d1c67,_0x458721){if(_0x2d1c67['body'][_0xce25('0x42')]){delete _0x2d1c67['body']['uniqueid'];}return db['CmHopperFinal'][_0xce25('0x41')]({'where':{'uniqueid':_0x2d1c67[_0xce25('0x43')]['id']}})[_0xce25('0x22')](handleEntityNotFound(_0x458721,null))[_0xce25('0x22')](saveUpdates(_0x2d1c67[_0xce25('0x44')],null))['then'](respondWithResult(_0x458721,null))['catch'](handleError(_0x458721,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x1aa7a3,_0x301f13,_0x6aafe8){return db[_0xce25('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x1aa7a3[_0xce25('0x43')]['id']},'attributes':[[db['sequelize']['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db['sequelize'][_0xce25('0x47')](_0xce25('0x48')))),_0xce25('0x49')],[db[_0xce25('0x46')]['fn'](_0xce25('0x45'),db['sequelize']['fn']('IF',db[_0xce25('0x46')][_0xce25('0x47')]('`state`\x20=\x203,\x201,\x20null'))),_0xce25('0x4a')],[db['sequelize']['fn'](_0xce25('0x45'),db['sequelize']['fn']('IF',db[_0xce25('0x46')]['literal'](_0xce25('0x4b')))),_0xce25('0x4c')],[db[_0xce25('0x46')]['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db['sequelize'][_0xce25('0x47')](_0xce25('0x4d')))),_0xce25('0x4e')],[db[_0xce25('0x46')]['fn']('COUNT',db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')]['literal'](_0xce25('0x4f')))),_0xce25('0x50')],[db['sequelize']['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')][_0xce25('0x47')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0xce25('0x51')],[db[_0xce25('0x46')]['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')][_0xce25('0x47')]('`state`\x20=\x2022,\x201,\x20null'))),_0xce25('0x52')],[db['sequelize']['fn']('COUNT',db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')][_0xce25('0x47')](_0xce25('0x53')))),_0xce25('0x54')]]})[_0xce25('0x22')](handleEntityNotFound(_0x301f13,null))['then'](respondWithResult(_0x301f13,null))[_0xce25('0x3f')](handleError(_0x301f13,null));};exports[_0xce25('0x55')]=function(_0x19b70d,_0x546075,_0x5303b9){return db['CmHopperFinal'][_0xce25('0x3e')]({'raw':![],'where':{'CampaignId':_0x19b70d[_0xce25('0x43')]['id']},'attributes':[[db[_0xce25('0x46')]['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')][_0xce25('0x47')](_0xce25('0x48')))),_0xce25('0x49')],[db[_0xce25('0x46')]['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')][_0xce25('0x47')](_0xce25('0x56')))),_0xce25('0x4a')],[db[_0xce25('0x46')]['fn']('COUNT',db[_0xce25('0x46')]['fn']('IF',db['sequelize'][_0xce25('0x47')](_0xce25('0x4b')))),_0xce25('0x4c')],[db['sequelize']['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')][_0xce25('0x47')](_0xce25('0x4d')))),_0xce25('0x4e')],[db[_0xce25('0x46')]['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')]['literal'](_0xce25('0x4f')))),_0xce25('0x50')],[db[_0xce25('0x46')]['fn']('COUNT',db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')][_0xce25('0x47')](_0xce25('0x57')))),_0xce25('0x51')],[db['sequelize']['fn']('COUNT',db[_0xce25('0x46')]['fn']('IF',db[_0xce25('0x46')]['literal'](_0xce25('0x58')))),_0xce25('0x52')],[db['sequelize']['fn'](_0xce25('0x45'),db[_0xce25('0x46')]['fn']('IF',db['sequelize'][_0xce25('0x47')](_0xce25('0x53')))),'answeringMachine']]})[_0xce25('0x22')](handleEntityNotFound(_0x546075,null))['then'](respondWithResult(_0x546075,null))[_0xce25('0x3f')](handleError(_0x546075,null));};exports[_0xce25('0x59')]=function(_0x2c3fd4,_0x2a3265,_0x4170fb){return db[_0xce25('0x5a')][_0xce25('0x41')]({'where':{'id':_0x2c3fd4['params']['id']}})[_0xce25('0x22')](handleEntityNotFound(_0x2a3265,null))[_0xce25('0x22')](function(_0x4c5d0a){var _0x48492e;if(_0x4c5d0a){_0x48492e=squel[_0xce25('0x5b')]()[_0xce25('0x5c')](_0xce25('0x5d'))['fromQuery']([_0xce25('0x5e'),_0xce25('0x5f'),_0xce25('0x60'),'ListId','VoiceQueueId',_0xce25('0x61'),_0xce25('0x62')],squel['select']()['field'](_0xce25('0x63'),'phone')['field'](_0xce25('0x64'),'scheduledAt')[_0xce25('0x65')](_0xce25('0x66'),_0xce25('0x60'))['field'](_0xce25('0x67'),_0xce25('0x68'))[_0xce25('0x65')](_0xce25('0x69'),_0xce25('0x6a'))['field']('NOW()',_0xce25('0x61'))['field']('NOW()',_0xce25('0x62'))[_0xce25('0x6b')](_0xce25('0x6c'))['where'](_0xce25('0x6d'),_0x2c3fd4[_0xce25('0x43')]['id'][_0xce25('0x6e')]())[_0xce25('0x3a')](_0xce25('0x6f'),_0x2c3fd4[_0xce25('0x44')][_0xce25('0x70')]['toString']())['where'](_0xce25('0x71'))[_0xce25('0x3a')](_0xce25('0x72'),squel[_0xce25('0x73')]()[_0xce25('0x65')]('phone')[_0xce25('0x6b')](_0xce25('0x5d'))[_0xce25('0x3a')](_0xce25('0x6d'),_0x2c3fd4[_0xce25('0x43')]['id']['toString']()))[_0xce25('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel['select']()[_0xce25('0x65')](_0xce25('0x74'))['from'](_0xce25('0x6c'))[_0xce25('0x3a')](_0xce25('0x6d'),_0x2c3fd4[_0xce25('0x43')]['id'][_0xce25('0x6e')]())[_0xce25('0x3a')](_0xce25('0x75')))[_0xce25('0x76')](_0xce25('0x60')))[_0xce25('0x6e')]();return db[_0xce25('0x46')]['query'](_0x48492e);}return[];})[_0xce25('0x22')](respondWithResult(_0x2a3265,null))[_0xce25('0x3f')](handleError(_0x2a3265,null));};exports[_0xce25('0x77')]=function(_0x5721a4,_0x53bbe6,_0x4ac7f2){return db[_0xce25('0x78')]['find']({'where':{'id':_0x5721a4[_0xce25('0x43')]['id']}})[_0xce25('0x22')](handleEntityNotFound(_0x53bbe6,null))[_0xce25('0x22')](function(_0x33933d){var _0x587282;if(_0x33933d){_0x587282=squel[_0xce25('0x5b')]()[_0xce25('0x5c')](_0xce25('0x5d'))[_0xce25('0x79')](['phone','scheduledAt',_0xce25('0x60'),_0xce25('0x68'),'CampaignId','createdAt','updatedAt'],squel[_0xce25('0x73')]()[_0xce25('0x65')](_0xce25('0x63'),'phone')[_0xce25('0x65')](_0xce25('0x64'),_0xce25('0x5f'))[_0xce25('0x65')](_0xce25('0x66'),_0xce25('0x60'))[_0xce25('0x65')](_0xce25('0x67'),_0xce25('0x68'))['field']('ANY_VALUE(CampaignId)',_0xce25('0x7a'))['field'](_0xce25('0x64'),_0xce25('0x61'))[_0xce25('0x65')]('NOW()','updatedAt')['from'](_0xce25('0x6c'))[_0xce25('0x3a')](_0xce25('0x7b'),_0x5721a4['params']['id']['toString']())['where'](_0xce25('0x6f'),_0x5721a4[_0xce25('0x44')][_0xce25('0x70')]['toString']())['where'](_0xce25('0x71'))[_0xce25('0x3a')](_0xce25('0x72'),squel[_0xce25('0x73')]()[_0xce25('0x65')](_0xce25('0x5e'))[_0xce25('0x6b')](_0xce25('0x5d'))['where'](_0xce25('0x7b'),_0x5721a4[_0xce25('0x43')]['id'][_0xce25('0x6e')]()))[_0xce25('0x3a')](_0xce25('0x72'),squel[_0xce25('0x73')]()[_0xce25('0x65')](_0xce25('0x74'))[_0xce25('0x6b')]('cm_hopper_final')[_0xce25('0x3a')]('CampaignId\x20=\x20?',_0x5721a4[_0xce25('0x43')]['id']['toString']())['where'](_0xce25('0x75')))[_0xce25('0x76')](_0xce25('0x60')))[_0xce25('0x6e')]();return db[_0xce25('0x46')][_0xce25('0x2d')](_0x587282);}return[];})['then'](respondWithResult(_0x53bbe6,null))[_0xce25('0x3f')](handleError(_0x53bbe6,null));};exports['checkContactHopper']=function(_0x2986d4,_0x2ed0ef,_0x19f8f2){return db['CmHopper'][_0xce25('0x7c')]({'where':{'VoiceQueueId':_0x2986d4['body'][_0xce25('0x6a')],'CampaignId':_0x2986d4['body']['CampaignId'],'ContactId':_0x2986d4['body'][_0xce25('0x60')]}})[_0xce25('0x22')](handleEntityNotFound(_0x2ed0ef,null))[_0xce25('0x22')](function(_0x44e459){if(_0x44e459){return _0x44e459;}return null;})[_0xce25('0x22')](respondWithResult(_0x2ed0ef,null))[_0xce25('0x3f')](handleError(_0x2ed0ef,null));}; \ No newline at end of file +var _0xdb89=['body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','literal','noSuchContacts','COUNT','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','abandonedContacts','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','updatedAt','field','ANY_VALUE(calleridnum)','phone','ANY_VALUE(ContactId)','VoiceQueueId','createdAt','NOW()','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','from','select','calleridnum','cm_hopper_final','group','CampaignId','ANY_VALUE(ListId)','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x204','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','status','offset','limit','Content-Range','json','update','then','destroy','end','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','CmHopperFinal','count','includeAll','include','findAll','rows','catch','params','find','describe'];(function(_0x2345f9,_0x2280cf){var _0x3a0ab9=function(_0x4b5de9){while(--_0x4b5de9){_0x2345f9['push'](_0x2345f9['shift']());}};_0x3a0ab9(++_0x2280cf);}(_0xdb89,0x1a5));var _0x9db8=function(_0x8fc98a,_0x5a13c4){_0x8fc98a=_0x8fc98a-0x0;var _0x13f8a3=_0xdb89[_0x8fc98a];return _0x13f8a3;};'use strict';var pdf=require(_0x9db8('0x0'));var emlformat=require(_0x9db8('0x1'));var rimraf=require(_0x9db8('0x2'));var zipdir=require(_0x9db8('0x3'));var jsonpatch=require(_0x9db8('0x4'));var rp=require('request-promise');var moment=require(_0x9db8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9db8('0x6'));var util=require(_0x9db8('0x7'));var path=require(_0x9db8('0x8'));var sox=require(_0x9db8('0x9'));var csv=require(_0x9db8('0xa'));var ejs=require(_0x9db8('0xb'));var fs=require('fs');var _=require(_0x9db8('0xc'));var squel=require('squel');var crypto=require(_0x9db8('0xd'));var jsforce=require(_0x9db8('0xe'));var deskjs=require(_0x9db8('0xf'));var toCsv=require(_0x9db8('0xa'));var querystring=require(_0x9db8('0x10'));var Papa=require(_0x9db8('0x11'));var Redis=require(_0x9db8('0x12'));var authService=require(_0x9db8('0x13'));var qs=require(_0x9db8('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9db8('0x15'));var logger=require('../../config/logger')(_0x9db8('0x16'));var utils=require(_0x9db8('0x17'));var config=require(_0x9db8('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5aaf68,_0x5801f6){_0x5801f6=_0x5801f6||0xcc;return function(_0x2a2541){if(_0x2a2541){return _0x5aaf68['sendStatus'](_0x5801f6);}return _0x5aaf68['status'](_0x5801f6)['end']();};}function respondWithResult(_0x586b59,_0x31d6b6){_0x31d6b6=_0x31d6b6||0xc8;return function(_0x398455){if(_0x398455){return _0x586b59[_0x9db8('0x19')](_0x31d6b6)['json'](_0x398455);}};}function respondWithFilteredResult(_0x1ddab0,_0x570c80){return function(_0xeaff39){if(_0xeaff39){var _0x46bfd2=_0xeaff39['count'],_0x14b68a=_0x570c80[_0x9db8('0x1a')],_0x143139=_0x570c80[_0x9db8('0x1a')]+_0x570c80[_0x9db8('0x1b')],_0x3a69de;if(_0x143139>=_0x46bfd2){_0x143139=_0x46bfd2;_0x3a69de=0xc8;}else{_0x3a69de=0xce;}_0x1ddab0[_0x9db8('0x19')](_0x3a69de);return _0x1ddab0['set'](_0x9db8('0x1c'),_0x14b68a+'-'+_0x143139+'/'+_0x46bfd2)[_0x9db8('0x1d')](_0xeaff39);}return null;};}function patchUpdates(_0x47072f){return function(_0x3957d1){try{jsonpatch['apply'](_0x3957d1,_0x47072f,!![]);}catch(_0x1e0fcf){return BPromise['reject'](_0x1e0fcf);}return _0x3957d1['save']();};}function saveUpdates(_0x3aede8,_0x116b8c){return function(_0x39c3a0){if(_0x39c3a0){return _0x39c3a0[_0x9db8('0x1e')](_0x3aede8)[_0x9db8('0x1f')](function(_0x565e37){return _0x565e37;});}return null;};}function removeEntity(_0x441fd6,_0x40f64d){return function(_0x5ae3d7){if(_0x5ae3d7){return _0x5ae3d7[_0x9db8('0x20')]()[_0x9db8('0x1f')](function(){_0x441fd6[_0x9db8('0x19')](0xcc)[_0x9db8('0x21')]();});}};}function handleEntityNotFound(_0x309141,_0x22bb16){return function(_0x34ac42){if(!_0x34ac42){_0x309141['sendStatus'](0x194);}return _0x34ac42;};}function handleError(_0x42c979,_0x477fcc){_0x477fcc=_0x477fcc||0x1f4;return function(_0x4437fc){logger['error'](_0x4437fc['stack']);if(_0x4437fc[_0x9db8('0x22')]){delete _0x4437fc[_0x9db8('0x22')];}_0x42c979[_0x9db8('0x19')](_0x477fcc)[_0x9db8('0x23')](_0x4437fc);};}exports['index']=function(_0x2911d3,_0x22218a){var _0x276ebb={},_0x55cf02={},_0x1a9aa0={'count':0x0,'rows':[]};var _0x2cd206=_[_0x9db8('0x24')](db['CmHopperFinal'][_0x9db8('0x25')],function(_0x343a00){return{'name':_0x343a00['fieldName'],'type':_0x343a00[_0x9db8('0x26')][_0x9db8('0x27')]};});_0x55cf02[_0x9db8('0x28')]=_[_0x9db8('0x24')](_0x2cd206,_0x9db8('0x22'));_0x55cf02[_0x9db8('0x29')]=_[_0x9db8('0x2a')](_0x2911d3[_0x9db8('0x29')]);_0x55cf02[_0x9db8('0x2b')]=_[_0x9db8('0x2c')](_0x55cf02[_0x9db8('0x28')],_0x55cf02[_0x9db8('0x29')]);_0x276ebb[_0x9db8('0x2d')]=_[_0x9db8('0x2c')](_0x55cf02[_0x9db8('0x28')],qs[_0x9db8('0x2e')](_0x2911d3[_0x9db8('0x29')][_0x9db8('0x2e')]));_0x276ebb[_0x9db8('0x2d')]=_0x276ebb['attributes'][_0x9db8('0x2f')]?_0x276ebb['attributes']:_0x55cf02[_0x9db8('0x28')];if(!_0x2911d3[_0x9db8('0x29')][_0x9db8('0x30')](_0x9db8('0x31'))){_0x276ebb['limit']=qs['limit'](_0x2911d3[_0x9db8('0x29')]['limit']);_0x276ebb[_0x9db8('0x1a')]=qs['offset'](_0x2911d3[_0x9db8('0x29')][_0x9db8('0x1a')]);}_0x276ebb[_0x9db8('0x32')]=qs[_0x9db8('0x33')](_0x2911d3['query'][_0x9db8('0x33')]);_0x276ebb[_0x9db8('0x34')]=qs[_0x9db8('0x2b')](_['pick'](_0x2911d3[_0x9db8('0x29')],_0x55cf02[_0x9db8('0x2b')]));if(_0x2911d3[_0x9db8('0x29')][_0x9db8('0x35')]){_0x276ebb[_0x9db8('0x34')]=_['merge'](_0x276ebb['where'],{'$or':_[_0x9db8('0x24')](_0x2cd206,function(_0x59cdb5){if(_0x59cdb5[_0x9db8('0x26')]!==_0x9db8('0x36')){var _0x283355={};_0x283355[_0x59cdb5[_0x9db8('0x22')]]={'$like':'%'+_0x2911d3[_0x9db8('0x29')][_0x9db8('0x35')]+'%'};return _0x283355;}})});}_0x276ebb=_[_0x9db8('0x37')]({},_0x276ebb,_0x2911d3[_0x9db8('0x38')]);var _0x299757={'where':_0x276ebb['where']};return db[_0x9db8('0x39')]['count'](_0x299757)[_0x9db8('0x1f')](function(_0x37ec35){_0x1a9aa0[_0x9db8('0x3a')]=_0x37ec35;if(_0x2911d3[_0x9db8('0x29')][_0x9db8('0x3b')]){_0x276ebb[_0x9db8('0x3c')]=[{'all':!![]}];}return db[_0x9db8('0x39')][_0x9db8('0x3d')](_0x276ebb);})[_0x9db8('0x1f')](function(_0x4f8b19){_0x1a9aa0[_0x9db8('0x3e')]=_0x4f8b19;return _0x1a9aa0;})[_0x9db8('0x1f')](respondWithFilteredResult(_0x22218a,_0x276ebb))[_0x9db8('0x3f')](handleError(_0x22218a,null));};exports['show']=function(_0x221a8d,_0x16f2df){var _0x7ebe7c={'raw':!![],'where':{'id':_0x221a8d[_0x9db8('0x40')]['id']}},_0x8265b0={};_0x8265b0[_0x9db8('0x28')]=_[_0x9db8('0x2a')](db[_0x9db8('0x39')][_0x9db8('0x25')]);_0x8265b0['query']=_['keys'](_0x221a8d[_0x9db8('0x29')]);_0x8265b0[_0x9db8('0x2b')]=_[_0x9db8('0x2c')](_0x8265b0[_0x9db8('0x28')],_0x8265b0[_0x9db8('0x29')]);_0x7ebe7c[_0x9db8('0x2d')]=_[_0x9db8('0x2c')](_0x8265b0[_0x9db8('0x28')],qs[_0x9db8('0x2e')](_0x221a8d[_0x9db8('0x29')][_0x9db8('0x2e')]));_0x7ebe7c[_0x9db8('0x2d')]=_0x7ebe7c['attributes']['length']?_0x7ebe7c[_0x9db8('0x2d')]:_0x8265b0['model'];if(_0x221a8d[_0x9db8('0x29')][_0x9db8('0x3b')]){_0x7ebe7c['include']=[{'all':!![]}];}_0x7ebe7c=_['merge']({},_0x7ebe7c,_0x221a8d[_0x9db8('0x38')]);return db[_0x9db8('0x39')][_0x9db8('0x41')](_0x7ebe7c)[_0x9db8('0x1f')](handleEntityNotFound(_0x16f2df,null))[_0x9db8('0x1f')](respondWithResult(_0x16f2df,null))[_0x9db8('0x3f')](handleError(_0x16f2df,null));};exports[_0x9db8('0x42')]=function(_0x375bec,_0x5a6296){return db[_0x9db8('0x39')][_0x9db8('0x42')]()[_0x9db8('0x1f')](respondWithResult(_0x5a6296,null))['catch'](handleError(_0x5a6296,null));};exports['update']=function(_0x3b7bd7,_0x5d473f){if(_0x3b7bd7[_0x9db8('0x43')][_0x9db8('0x44')]){delete _0x3b7bd7[_0x9db8('0x43')]['uniqueid'];}return db['CmHopperFinal'][_0x9db8('0x41')]({'where':{'uniqueid':_0x3b7bd7[_0x9db8('0x40')]['id']}})['then'](handleEntityNotFound(_0x5d473f,null))[_0x9db8('0x1f')](saveUpdates(_0x3b7bd7[_0x9db8('0x43')],null))[_0x9db8('0x1f')](respondWithResult(_0x5d473f,null))[_0x9db8('0x3f')](handleError(_0x5d473f,null));};exports[_0x9db8('0x45')]=function(_0x204765,_0x53a637,_0x45dbf7){return db[_0x9db8('0x39')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x204765[_0x9db8('0x40')]['id']},'attributes':[[db[_0x9db8('0x46')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')]('`state`\x20=\x200,\x201,\x20null'))),_0x9db8('0x48')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db['sequelize']['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')](_0x9db8('0x4a')))),_0x9db8('0x4b')],[db[_0x9db8('0x46')]['fn']('COUNT',db[_0x9db8('0x46')]['fn']('IF',db['sequelize']['literal'](_0x9db8('0x4c')))),_0x9db8('0x4d')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db[_0x9db8('0x46')]['fn']('IF',db[_0x9db8('0x46')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x9db8('0x4e')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db[_0x9db8('0x46')]['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')](_0x9db8('0x4f')))),_0x9db8('0x50')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db['sequelize']['fn']('IF',db['sequelize'][_0x9db8('0x47')]('`state`\x20=\x2011\x20,\x201,\x20null'))),_0x9db8('0x51')],[db['sequelize']['fn'](_0x9db8('0x49'),db[_0x9db8('0x46')]['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')]('`state`\x20=\x2022,\x201,\x20null'))),_0x9db8('0x52')],[db['sequelize']['fn'](_0x9db8('0x49'),db['sequelize']['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')](_0x9db8('0x53')))),_0x9db8('0x54')]]})['then'](handleEntityNotFound(_0x53a637,null))[_0x9db8('0x1f')](respondWithResult(_0x53a637,null))['catch'](handleError(_0x53a637,null));};exports[_0x9db8('0x55')]=function(_0x57a7a3,_0x19dd02,_0x75e169){return db[_0x9db8('0x39')][_0x9db8('0x3d')]({'raw':![],'where':{'CampaignId':_0x57a7a3['params']['id']},'attributes':[[db['sequelize']['fn']('COUNT',db[_0x9db8('0x46')]['fn']('IF',db['sequelize'][_0x9db8('0x47')]('`state`\x20=\x200,\x201,\x20null'))),_0x9db8('0x48')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db['sequelize']['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')](_0x9db8('0x4a')))),'noAnswerContacts'],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db[_0x9db8('0x46')]['fn']('IF',db['sequelize'][_0x9db8('0x47')]('`state`\x20=\x205,\x201,\x20null'))),_0x9db8('0x4d')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db[_0x9db8('0x46')]['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')]('`state`\x20=\x208,\x201,\x20null'))),_0x9db8('0x4e')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db['sequelize']['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')](_0x9db8('0x4f')))),'dropContacts'],[db['sequelize']['fn'](_0x9db8('0x49'),db[_0x9db8('0x46')]['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')](_0x9db8('0x56')))),_0x9db8('0x51')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db[_0x9db8('0x46')]['fn']('IF',db['sequelize'][_0x9db8('0x47')](_0x9db8('0x57')))),_0x9db8('0x52')],[db[_0x9db8('0x46')]['fn'](_0x9db8('0x49'),db[_0x9db8('0x46')]['fn']('IF',db[_0x9db8('0x46')][_0x9db8('0x47')](_0x9db8('0x53')))),'answeringMachine']]})['then'](handleEntityNotFound(_0x19dd02,null))[_0x9db8('0x1f')](respondWithResult(_0x19dd02,null))[_0x9db8('0x3f')](handleError(_0x19dd02,null));};exports[_0x9db8('0x58')]=function(_0xc78b49,_0x46d286,_0xbf1179){return db['VoiceQueue'][_0x9db8('0x41')]({'where':{'id':_0xc78b49[_0x9db8('0x40')]['id']}})[_0x9db8('0x1f')](handleEntityNotFound(_0x46d286,null))['then'](function(_0x7e3bac){var _0xda008;if(_0x7e3bac){_0xda008=squel[_0x9db8('0x59')]()['into'](_0x9db8('0x5a'))[_0x9db8('0x5b')](['phone',_0x9db8('0x5c'),_0x9db8('0x5d'),_0x9db8('0x5e'),'VoiceQueueId','createdAt',_0x9db8('0x5f')],squel['select']()[_0x9db8('0x60')](_0x9db8('0x61'),_0x9db8('0x62'))[_0x9db8('0x60')]('NOW()','scheduledAt')['field'](_0x9db8('0x63'),'ContactId')[_0x9db8('0x60')]('ANY_VALUE(ListId)',_0x9db8('0x5e'))[_0x9db8('0x60')]('ANY_VALUE(VoiceQueueId)',_0x9db8('0x64'))[_0x9db8('0x60')]('NOW()',_0x9db8('0x65'))[_0x9db8('0x60')](_0x9db8('0x66'),_0x9db8('0x5f'))['from']('cm_hopper_final')['where'](_0x9db8('0x67'),_0xc78b49['params']['id'][_0x9db8('0x68')]())[_0x9db8('0x34')](_0x9db8('0x69'),_0xc78b49[_0x9db8('0x43')][_0x9db8('0x6a')][_0x9db8('0x68')]())['where'](_0x9db8('0x6b'))[_0x9db8('0x34')](_0x9db8('0x6c'),squel['select']()[_0x9db8('0x60')](_0x9db8('0x62'))[_0x9db8('0x6d')](_0x9db8('0x5a'))[_0x9db8('0x34')](_0x9db8('0x67'),_0xc78b49[_0x9db8('0x40')]['id'][_0x9db8('0x68')]()))[_0x9db8('0x34')](_0x9db8('0x6c'),squel[_0x9db8('0x6e')]()[_0x9db8('0x60')](_0x9db8('0x6f'))[_0x9db8('0x6d')](_0x9db8('0x70'))['where'](_0x9db8('0x67'),_0xc78b49[_0x9db8('0x40')]['id']['toString']())['where']('state\x20=\x204'))[_0x9db8('0x71')]('ContactId'))[_0x9db8('0x68')]();return db['sequelize']['query'](_0xda008);}return[];})[_0x9db8('0x1f')](respondWithResult(_0x46d286,null))[_0x9db8('0x3f')](handleError(_0x46d286,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x548944,_0x3657cb,_0x46ab8b){return db['Campaign']['find']({'where':{'id':_0x548944[_0x9db8('0x40')]['id']}})[_0x9db8('0x1f')](handleEntityNotFound(_0x3657cb,null))['then'](function(_0x601a51){var _0x4c17ec;if(_0x601a51){_0x4c17ec=squel[_0x9db8('0x59')]()['into'](_0x9db8('0x5a'))['fromQuery']([_0x9db8('0x62'),_0x9db8('0x5c'),'ContactId',_0x9db8('0x5e'),_0x9db8('0x72'),'createdAt','updatedAt'],squel[_0x9db8('0x6e')]()[_0x9db8('0x60')]('ANY_VALUE(calleridnum)',_0x9db8('0x62'))[_0x9db8('0x60')](_0x9db8('0x66'),_0x9db8('0x5c'))[_0x9db8('0x60')](_0x9db8('0x63'),_0x9db8('0x5d'))[_0x9db8('0x60')](_0x9db8('0x73'),_0x9db8('0x5e'))[_0x9db8('0x60')](_0x9db8('0x74'),'CampaignId')['field'](_0x9db8('0x66'),_0x9db8('0x65'))[_0x9db8('0x60')](_0x9db8('0x66'),_0x9db8('0x5f'))[_0x9db8('0x6d')]('cm_hopper_final')['where'](_0x9db8('0x75'),_0x548944[_0x9db8('0x40')]['id'][_0x9db8('0x68')]())[_0x9db8('0x34')](_0x9db8('0x69'),_0x548944[_0x9db8('0x43')][_0x9db8('0x6a')][_0x9db8('0x68')]())[_0x9db8('0x34')](_0x9db8('0x6b'))[_0x9db8('0x34')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x9db8('0x6e')]()[_0x9db8('0x60')](_0x9db8('0x62'))[_0x9db8('0x6d')](_0x9db8('0x5a'))[_0x9db8('0x34')]('CampaignId\x20=\x20?',_0x548944[_0x9db8('0x40')]['id']['toString']()))[_0x9db8('0x34')](_0x9db8('0x6c'),squel[_0x9db8('0x6e')]()[_0x9db8('0x60')](_0x9db8('0x6f'))[_0x9db8('0x6d')](_0x9db8('0x70'))[_0x9db8('0x34')](_0x9db8('0x75'),_0x548944[_0x9db8('0x40')]['id'][_0x9db8('0x68')]())[_0x9db8('0x34')](_0x9db8('0x76')))[_0x9db8('0x71')](_0x9db8('0x5d')))[_0x9db8('0x68')]();return db[_0x9db8('0x46')][_0x9db8('0x29')](_0x4c17ec);}return[];})[_0x9db8('0x1f')](respondWithResult(_0x3657cb,null))[_0x9db8('0x3f')](handleError(_0x3657cb,null));};exports[_0x9db8('0x77')]=function(_0x5b45b3,_0x2eb929,_0x5ae1eb){return db[_0x9db8('0x78')][_0x9db8('0x79')]({'where':{'VoiceQueueId':_0x5b45b3[_0x9db8('0x43')][_0x9db8('0x64')],'CampaignId':_0x5b45b3['body'][_0x9db8('0x72')],'ContactId':_0x5b45b3[_0x9db8('0x43')][_0x9db8('0x5d')]}})['then'](handleEntityNotFound(_0x2eb929,null))[_0x9db8('0x1f')](function(_0x130ecc){if(_0x130ecc){return _0x130ecc;}return null;})[_0x9db8('0x1f')](respondWithResult(_0x2eb929,null))[_0x9db8('0x3f')](handleError(_0x2eb929,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index ef8aea1..820b4a7 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 _0x9dbe=['rimraf','../../config/environment','./cmHopperFinal.attributes','exports','calleridnum','uniqueid','lodash','util','api','moment','request-promise'];(function(_0x5ca940,_0x540962){var _0x49a645=function(_0x55b9db){while(--_0x55b9db){_0x5ca940['push'](_0x5ca940['shift']());}};_0x49a645(++_0x540962);}(_0x9dbe,0x150));var _0xe9db=function(_0x5a17fc,_0x5ed35b){_0x5a17fc=_0x5a17fc-0x0;var _0x4e2b26=_0x9dbe[_0x5a17fc];return _0x4e2b26;};'use strict';var _=require(_0xe9db('0x0'));var util=require(_0xe9db('0x1'));var logger=require('../../config/logger')(_0xe9db('0x2'));var moment=require(_0xe9db('0x3'));var BPromise=require('bluebird');var rp=require(_0xe9db('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe9db('0x5'));var config=require(_0xe9db('0x6'));var attributes=require(_0xe9db('0x7'));module[_0xe9db('0x8')]=function(_0x36d0e0,_0x279413){return _0x36d0e0['define']('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0xe9db('0x9'),'fields':[_0xe9db('0x9')]},{'name':_0xe9db('0xa'),'fields':[_0xe9db('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xbf69=['lodash','../../config/logger','api','moment','bluebird','path','../../config/environment','./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x2caaa3,_0x58a72d){var _0x4aa79b=function(_0x294773){while(--_0x294773){_0x2caaa3['push'](_0x2caaa3['shift']());}};_0x4aa79b(++_0x58a72d);}(_0xbf69,0x1c0));var _0x9bf6=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0xbf69[_0x3203a1];return _0x24215e;};'use strict';var _=require(_0x9bf6('0x0'));var util=require('util');var logger=require(_0x9bf6('0x1'))(_0x9bf6('0x2'));var moment=require(_0x9bf6('0x3'));var BPromise=require(_0x9bf6('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9bf6('0x5'));var rimraf=require('rimraf');var config=require(_0x9bf6('0x6'));var attributes=require(_0x9bf6('0x7'));module[_0x9bf6('0x8')]=function(_0x8e6ee7,_0x52877d){return _0x8e6ee7[_0x9bf6('0x9')](_0x9bf6('0xa'),attributes,{'tableName':_0x9bf6('0xb'),'paranoid':![],'indexes':[{'name':_0x9bf6('0xc'),'fields':[_0x9bf6('0xc')]},{'name':_0x9bf6('0xd'),'fields':[_0x9bf6('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 3704258..9c3be67 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 _0x8709=['stringify','error','code','message','result','catch','CreateCmHopperFinal','body','options','raw','debug','lodash','moment','bluebird','../../config/logger','../../config/environment','client','http','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent'];(function(_0x1e6fd5,_0x1a54ed){var _0x86767d=function(_0x4ca891){while(--_0x4ca891){_0x1e6fd5['push'](_0x1e6fd5['shift']());}};_0x86767d(++_0x1a54ed);}(_0x8709,0x129));var _0x9870=function(_0x27e86e,_0x49d030){_0x27e86e=_0x27e86e-0x0;var _0x57d83e=_0x8709[_0x27e86e];return _0x57d83e;};'use strict';var _=require(_0x9870('0x0'));var util=require('util');var moment=require(_0x9870('0x1'));var BPromise=require(_0x9870('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9870('0x3'))('rpc');var config=require(_0x9870('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x9870('0x5')][_0x9870('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x487db3,_0x2fbbc9,_0x3beae8){return new BPromise(function(_0x294e86,_0x5369e6){return client['request'](_0x487db3,_0x3beae8)[_0x9870('0x7')](function(_0x51fda6){logger[_0x9870('0x8')](_0x9870('0x9'),_0x2fbbc9,_0x9870('0xa'));logger['debug']('CmHopperFinal,\x20%s,\x20%s,\x20%s',_0x2fbbc9,_0x9870('0xa'),JSON[_0x9870('0xb')](_0x51fda6));if(_0x51fda6['error']){if(_0x51fda6[_0x9870('0xc')][_0x9870('0xd')]===0x1f4){logger[_0x9870('0xc')](_0x9870('0x9'),_0x2fbbc9,_0x51fda6[_0x9870('0xc')][_0x9870('0xe')]);return _0x5369e6(_0x51fda6[_0x9870('0xc')]['message']);}logger[_0x9870('0xc')](_0x9870('0x9'),_0x2fbbc9,_0x51fda6[_0x9870('0xc')][_0x9870('0xe')]);return _0x294e86(_0x51fda6[_0x9870('0xc')][_0x9870('0xe')]);}else{logger[_0x9870('0x8')](_0x9870('0x9'),_0x2fbbc9,'request\x20sent');_0x294e86(_0x51fda6[_0x9870('0xf')][_0x9870('0xe')]);}})[_0x9870('0x10')](function(_0x37694d){logger[_0x9870('0xc')](_0x9870('0x9'),_0x2fbbc9,_0x37694d);_0x5369e6(_0x37694d);});});}exports[_0x9870('0x11')]=function(_0xdc7416){var _0x2913dc=this;return new Promise(function(_0x399104,_0x569e7c){return db['CmHopperFinal']['create'](_0xdc7416[_0x9870('0x12')],{'raw':_0xdc7416['options']?_0xdc7416[_0x9870('0x13')][_0x9870('0x14')]===undefined?!![]:![]:!![]})[_0x9870('0x7')](function(_0x127d58){logger['info'](_0x9870('0x11'),_0xdc7416);logger[_0x9870('0x15')](_0x9870('0x11'),_0xdc7416,JSON[_0x9870('0xb')](_0x127d58));_0x399104(_0x127d58);})['catch'](function(_0x350ce8){logger['error'](_0x9870('0x11'),_0x350ce8['message'],_0xdc7416);_0x569e7c(_0x2913dc[_0x9870('0xc')](0x1f4,_0x350ce8[_0x9870('0xe')]));});});}; \ No newline at end of file +var _0x95c3=['message','CreateCmHopperFinal','CmHopperFinal','create','body','options','raw','then','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','client','http','request','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x479650,_0x2bee99){var _0x26b288=function(_0x1ba49f){while(--_0x1ba49f){_0x479650['push'](_0x479650['shift']());}};_0x26b288(++_0x2bee99);}(_0x95c3,0xfb));var _0x395c=function(_0x53cf8e,_0x3d290f){_0x53cf8e=_0x53cf8e-0x0;var _0x459197=_0x95c3[_0x53cf8e];return _0x459197;};'use strict';var _=require(_0x395c('0x0'));var util=require('util');var moment=require(_0x395c('0x1'));var BPromise=require(_0x395c('0x2'));var rs=require(_0x395c('0x3'));var fs=require('fs');var Redis=require(_0x395c('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x395c('0x5'))(_0x395c('0x6'));var config=require(_0x395c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x395c('0x8')][_0x395c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b4650,_0x59d315,_0x4950ad){return new BPromise(function(_0x509ee0,_0xf993e4){return client[_0x395c('0xa')](_0x2b4650,_0x4950ad)['then'](function(_0xc55a83){logger[_0x395c('0xb')](_0x395c('0xc'),_0x59d315,'request\x20sent');logger[_0x395c('0xd')](_0x395c('0xe'),_0x59d315,_0x395c('0xf'),JSON[_0x395c('0x10')](_0xc55a83));if(_0xc55a83[_0x395c('0x11')]){if(_0xc55a83[_0x395c('0x11')][_0x395c('0x12')]===0x1f4){logger['error']('CmHopperFinal,\x20%s,\x20%s',_0x59d315,_0xc55a83[_0x395c('0x11')][_0x395c('0x13')]);return _0xf993e4(_0xc55a83['error'][_0x395c('0x13')]);}logger[_0x395c('0x11')](_0x395c('0xc'),_0x59d315,_0xc55a83['error'][_0x395c('0x13')]);return _0x509ee0(_0xc55a83[_0x395c('0x11')][_0x395c('0x13')]);}else{logger['info'](_0x395c('0xc'),_0x59d315,_0x395c('0xf'));_0x509ee0(_0xc55a83['result'][_0x395c('0x13')]);}})['catch'](function(_0x1f6f9e){logger[_0x395c('0x11')](_0x395c('0xc'),_0x59d315,_0x1f6f9e);_0xf993e4(_0x1f6f9e);});});}exports[_0x395c('0x14')]=function(_0x2ca8a2){var _0x2203a5=this;return new Promise(function(_0x2998eb,_0x32e2cd){return db[_0x395c('0x15')][_0x395c('0x16')](_0x2ca8a2[_0x395c('0x17')],{'raw':_0x2ca8a2[_0x395c('0x18')]?_0x2ca8a2[_0x395c('0x18')][_0x395c('0x19')]===undefined?!![]:![]:!![]})[_0x395c('0x1a')](function(_0x444705){logger[_0x395c('0xb')](_0x395c('0x14'),_0x2ca8a2);logger['debug'](_0x395c('0x14'),_0x2ca8a2,JSON['stringify'](_0x444705));_0x2998eb(_0x444705);})['catch'](function(_0x3405f){logger[_0x395c('0x11')](_0x395c('0x14'),_0x3405f[_0x395c('0x13')],_0x2ca8a2);_0x32e2cd(_0x2203a5['error'](0x1f4,_0x3405f[_0x395c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 57010a0..8519235 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 _0xab3c=['checkContactHopper','put','exports','multer','util','path','Router','../../components/interaction/service','./cmHopperFinal.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','moveContactsIvrCampaignHopperFinal'];(function(_0x4cd789,_0xf296a2){var _0x4514d2=function(_0x24c85b){while(--_0x24c85b){_0x4cd789['push'](_0x4cd789['shift']());}};_0x4514d2(++_0xf296a2);}(_0xab3c,0x137));var _0xcab3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab3c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xcab3('0x0'));var util=require(_0xcab3('0x1'));var path=require(_0xcab3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xcab3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xcab3('0x4'));var config=require('../../config/environment');var controller=require(_0xcab3('0x5'));router[_0xcab3('0x6')]('/',auth['isAuthenticated'](),controller[_0xcab3('0x7')]);router[_0xcab3('0x6')](_0xcab3('0x8'),auth[_0xcab3('0x9')](),controller[_0xcab3('0xa')]);router['get'](_0xcab3('0xb'),auth[_0xcab3('0x9')](),controller[_0xcab3('0xc')]);router[_0xcab3('0x6')](_0xcab3('0xd'),auth['isAuthenticated'](),controller[_0xcab3('0xe')]);router[_0xcab3('0x6')]('/campaign/countAttributes/:id',auth['isAuthenticated'](),controller['countContactsIvrCampaignHopperFinal']);router[_0xcab3('0xf')](_0xcab3('0x10'),auth[_0xcab3('0x9')](),controller[_0xcab3('0x11')]);router[_0xcab3('0xf')]('/voice/campaign/moveContacts/:id',auth[_0xcab3('0x9')](),controller[_0xcab3('0x12')]);router[_0xcab3('0xf')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0xcab3('0x13')]);router[_0xcab3('0x14')]('/:id',auth[_0xcab3('0x9')](),controller['update']);module[_0xcab3('0x15')]=router; \ No newline at end of file +var _0x1b34=['put','update','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper'];(function(_0x513559,_0x594ec5){var _0x5d24c1=function(_0x587be7){while(--_0x587be7){_0x513559['push'](_0x513559['shift']());}};_0x5d24c1(++_0x594ec5);}(_0x1b34,0x199));var _0x41b3=function(_0x27c24d,_0x2b50f1){_0x27c24d=_0x27c24d-0x0;var _0x14e722=_0x1b34[_0x27c24d];return _0x14e722;};'use strict';var multer=require('multer');var util=require(_0x41b3('0x0'));var path=require(_0x41b3('0x1'));var timeout=require(_0x41b3('0x2'));var express=require(_0x41b3('0x3'));var router=express['Router']();var auth=require(_0x41b3('0x4'));var interaction=require(_0x41b3('0x5'));var config=require(_0x41b3('0x6'));var controller=require(_0x41b3('0x7'));router[_0x41b3('0x8')]('/',auth[_0x41b3('0x9')](),controller[_0x41b3('0xa')]);router[_0x41b3('0x8')](_0x41b3('0xb'),auth[_0x41b3('0x9')](),controller[_0x41b3('0xc')]);router[_0x41b3('0x8')](_0x41b3('0xd'),auth[_0x41b3('0x9')](),controller[_0x41b3('0xe')]);router[_0x41b3('0x8')](_0x41b3('0xf'),auth[_0x41b3('0x9')](),controller[_0x41b3('0x10')]);router[_0x41b3('0x8')](_0x41b3('0x11'),auth[_0x41b3('0x9')](),controller[_0x41b3('0x12')]);router[_0x41b3('0x13')](_0x41b3('0x14'),auth[_0x41b3('0x9')](),controller[_0x41b3('0x15')]);router['post'](_0x41b3('0x16'),auth[_0x41b3('0x9')](),controller[_0x41b3('0x17')]);router['post'](_0x41b3('0x18'),auth[_0x41b3('0x9')](),controller[_0x41b3('0x19')]);router[_0x41b3('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x41b3('0x1b')]);module[_0x41b3('0x1c')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 5485028..04e4d93 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 _0xdc59=['sequelize','exports','INTEGER','DATE','STRING','BOOLEAN'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xdc59,0x126));var _0x9dc5=function(_0x2cc569,_0x4e9568){_0x2cc569=_0x2cc569-0x0;var _0x1bfc2e=_0xdc59[_0x2cc569];return _0x1bfc2e;};'use strict';var Sequelize=require(_0x9dc5('0x0'));module[_0x9dc5('0x1')]={'state':{'type':Sequelize[_0x9dc5('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x9dc5('0x3')]},'countbusyretry':{'type':Sequelize[_0x9dc5('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x9dc5('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x9dc5('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x9dc5('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x9dc5('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x9dc5('0x4')]},'originatecalleridname':{'type':Sequelize[_0x9dc5('0x4')]},'calleridnum':{'type':Sequelize[_0x9dc5('0x4')]},'calleridname':{'type':Sequelize[_0x9dc5('0x4')]},'starttime':{'type':Sequelize[_0x9dc5('0x3')]},'responsetime':{'type':Sequelize[_0x9dc5('0x3')]},'answertime':{'type':Sequelize['DATE']},'droptime':{'type':Sequelize[_0x9dc5('0x3')]},'endtime':{'type':Sequelize[_0x9dc5('0x3')]},'ringtime':{'type':Sequelize[_0x9dc5('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x9dc5('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x9dc5('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x9dc5('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x9dc5('0x4')]},'campaigntype':{'type':Sequelize[_0x9dc5('0x4')]},'membername':{'type':Sequelize[_0x9dc5('0x4')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x9dc5('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0x9dc5('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0x9dc5('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0x9dc5('0x3')]},'recallme':{'type':Sequelize[_0x9dc5('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x9dc5('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x428e=['INTEGER','DATE','STRING','BOOLEAN'];(function(_0x1c31a0,_0x31e848){var _0xf609ef=function(_0x34421d){while(--_0x34421d){_0x1c31a0['push'](_0x1c31a0['shift']());}};_0xf609ef(++_0x31e848);}(_0x428e,0x1f4));var _0xe428=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x428e[_0x382a62];return _0x490a25;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize[_0xe428('0x0')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xe428('0x1')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe428('0x0')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe428('0x0')],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe428('0x2')]},'originatecalleridnum':{'type':Sequelize[_0xe428('0x2')]},'originatecalleridname':{'type':Sequelize[_0xe428('0x2')]},'calleridnum':{'type':Sequelize[_0xe428('0x2')]},'calleridname':{'type':Sequelize[_0xe428('0x2')]},'starttime':{'type':Sequelize[_0xe428('0x1')]},'responsetime':{'type':Sequelize[_0xe428('0x1')]},'answertime':{'type':Sequelize[_0xe428('0x1')]},'droptime':{'type':Sequelize[_0xe428('0x1')]},'endtime':{'type':Sequelize[_0xe428('0x1')]},'ringtime':{'type':Sequelize[_0xe428('0x0')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe428('0x0')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xe428('0x0')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe428('0x0')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe428('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fax':{'type':Sequelize[_0xe428('0x3')],'defaultValue':![]},'callback':{'type':Sequelize[_0xe428('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe428('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe428('0x1')]},'recallme':{'type':Sequelize[_0xe428('0x3')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xe428('0x1')]},'edited':{'type':Sequelize[_0xe428('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index 96dcc15..c0f3dab 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 _0x93c4=['../../config/license/hardware','../../config/logger','api','status','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','sendStatus','error','stack','name','send','CmHopperHistory','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','include','find','create','body','uniqueid','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3635ce,_0x33a6f9){var _0x97ecd0=function(_0x123d98){while(--_0x123d98){_0x3635ce['push'](_0x3635ce['shift']());}};_0x97ecd0(++_0x33a6f9);}(_0x93c4,0x1e6));var _0x493c=function(_0x2e5515,_0x18cb03){_0x2e5515=_0x2e5515-0x0;var _0x4351d6=_0x93c4[_0x2e5515];return _0x4351d6;};'use strict';var pdf=require(_0x493c('0x0'));var emlformat=require(_0x493c('0x1'));var rimraf=require(_0x493c('0x2'));var zipdir=require(_0x493c('0x3'));var jsonpatch=require(_0x493c('0x4'));var rp=require(_0x493c('0x5'));var moment=require('moment');var BPromise=require(_0x493c('0x6'));var Mustache=require(_0x493c('0x7'));var util=require('util');var path=require('path');var sox=require(_0x493c('0x8'));var csv=require(_0x493c('0x9'));var ejs=require(_0x493c('0xa'));var fs=require('fs');var _=require(_0x493c('0xb'));var squel=require('squel');var crypto=require(_0x493c('0xc'));var jsforce=require(_0x493c('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x493c('0x9'));var querystring=require(_0x493c('0xe'));var Papa=require(_0x493c('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x493c('0x10'));var as=require(_0x493c('0x11'));var hardwareService=require(_0x493c('0x12'));var logger=require(_0x493c('0x13'))(_0x493c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x50f717,_0x5801d1){_0x5801d1=_0x5801d1||0xcc;return function(_0x222d09){if(_0x222d09){return _0x50f717['sendStatus'](_0x5801d1);}return _0x50f717['status'](_0x5801d1)['end']();};}function respondWithResult(_0x4d1685,_0x594ce8){_0x594ce8=_0x594ce8||0xc8;return function(_0x1e90e8){if(_0x1e90e8){return _0x4d1685[_0x493c('0x15')](_0x594ce8)['json'](_0x1e90e8);}};}function respondWithFilteredResult(_0x577f38,_0x4ce959){return function(_0x2aeb5c){if(_0x2aeb5c){var _0x587e3e=_0x2aeb5c[_0x493c('0x16')],_0xbbe8a=_0x4ce959[_0x493c('0x17')],_0x4b0e1d=_0x4ce959[_0x493c('0x17')]+_0x4ce959[_0x493c('0x18')],_0x5a55dd;if(_0x4b0e1d>=_0x587e3e){_0x4b0e1d=_0x587e3e;_0x5a55dd=0xc8;}else{_0x5a55dd=0xce;}_0x577f38['status'](_0x5a55dd);return _0x577f38[_0x493c('0x19')](_0x493c('0x1a'),_0xbbe8a+'-'+_0x4b0e1d+'/'+_0x587e3e)['json'](_0x2aeb5c);}return null;};}function patchUpdates(_0x4ab1fd){return function(_0x2fd81c){try{jsonpatch[_0x493c('0x1b')](_0x2fd81c,_0x4ab1fd,!![]);}catch(_0x185b14){return BPromise[_0x493c('0x1c')](_0x185b14);}return _0x2fd81c['save']();};}function saveUpdates(_0x45dbf1,_0x11dd27){return function(_0x89fa2){if(_0x89fa2){return _0x89fa2[_0x493c('0x1d')](_0x45dbf1)[_0x493c('0x1e')](function(_0x377e9c){return _0x377e9c;});}return null;};}function removeEntity(_0x18348a,_0x3a1120){return function(_0x11b489){if(_0x11b489){return _0x11b489[_0x493c('0x1f')]()[_0x493c('0x1e')](function(){_0x18348a['status'](0xcc)[_0x493c('0x20')]();});}};}function handleEntityNotFound(_0x3ba30c,_0x5817e6){return function(_0x5b6355){if(!_0x5b6355){_0x3ba30c[_0x493c('0x21')](0x194);}return _0x5b6355;};}function handleError(_0x2a8869,_0x308e00){_0x308e00=_0x308e00||0x1f4;return function(_0x375118){logger[_0x493c('0x22')](_0x375118[_0x493c('0x23')]);if(_0x375118[_0x493c('0x24')]){delete _0x375118[_0x493c('0x24')];}_0x2a8869[_0x493c('0x15')](_0x308e00)[_0x493c('0x25')](_0x375118);};}exports['index']=function(_0x12d457,_0x464b3c){var _0xc9a4cd={},_0x46bd98={},_0x15f251={'count':0x0,'rows':[]};var _0x49bec6=_['map'](db[_0x493c('0x26')][_0x493c('0x27')],function(_0x4761cc){return{'name':_0x4761cc[_0x493c('0x28')],'type':_0x4761cc[_0x493c('0x29')][_0x493c('0x2a')]};});_0x46bd98[_0x493c('0x2b')]=_['map'](_0x49bec6,_0x493c('0x24'));_0x46bd98[_0x493c('0x2c')]=_[_0x493c('0x2d')](_0x12d457[_0x493c('0x2c')]);_0x46bd98['filters']=_[_0x493c('0x2e')](_0x46bd98['model'],_0x46bd98[_0x493c('0x2c')]);_0xc9a4cd[_0x493c('0x2f')]=_[_0x493c('0x2e')](_0x46bd98[_0x493c('0x2b')],qs[_0x493c('0x30')](_0x12d457[_0x493c('0x2c')]['fields']));_0xc9a4cd['attributes']=_0xc9a4cd[_0x493c('0x2f')][_0x493c('0x31')]?_0xc9a4cd['attributes']:_0x46bd98[_0x493c('0x2b')];if(!_0x12d457[_0x493c('0x2c')][_0x493c('0x32')](_0x493c('0x33'))){_0xc9a4cd['limit']=qs[_0x493c('0x18')](_0x12d457[_0x493c('0x2c')][_0x493c('0x18')]);_0xc9a4cd[_0x493c('0x17')]=qs[_0x493c('0x17')](_0x12d457[_0x493c('0x2c')]['offset']);}_0xc9a4cd['order']=qs['sort'](_0x12d457[_0x493c('0x2c')][_0x493c('0x34')]);_0xc9a4cd[_0x493c('0x35')]=qs[_0x493c('0x36')](_[_0x493c('0x37')](_0x12d457[_0x493c('0x2c')],_0x46bd98['filters']));if(_0x12d457[_0x493c('0x2c')]['filter']){_0xc9a4cd[_0x493c('0x35')]=_[_0x493c('0x38')](_0xc9a4cd[_0x493c('0x35')],{'$or':_[_0x493c('0x39')](_0x49bec6,function(_0x157a53){if(_0x157a53[_0x493c('0x29')]!==_0x493c('0x3a')){var _0x245cd1={};_0x245cd1[_0x157a53[_0x493c('0x24')]]={'$like':'%'+_0x12d457[_0x493c('0x2c')][_0x493c('0x3b')]+'%'};return _0x245cd1;}})});}_0xc9a4cd=_[_0x493c('0x38')]({},_0xc9a4cd,_0x12d457[_0x493c('0x3c')]);var _0x2c6157={'where':_0xc9a4cd[_0x493c('0x35')]};return db[_0x493c('0x26')][_0x493c('0x16')](_0x2c6157)[_0x493c('0x1e')](function(_0xbc8c98){_0x15f251['count']=_0xbc8c98;if(_0x12d457[_0x493c('0x2c')][_0x493c('0x3d')]){_0xc9a4cd['include']=[{'all':!![]}];}return db[_0x493c('0x26')][_0x493c('0x3e')](_0xc9a4cd);})[_0x493c('0x1e')](function(_0x47205d){_0x15f251[_0x493c('0x3f')]=_0x47205d;return _0x15f251;})[_0x493c('0x1e')](respondWithFilteredResult(_0x464b3c,_0xc9a4cd))[_0x493c('0x40')](handleError(_0x464b3c,null));};exports[_0x493c('0x41')]=function(_0x47c1d3,_0x4c3421){var _0x5451b4={'raw':!![],'where':{'id':_0x47c1d3['params']['id']}},_0x31f068={};_0x31f068['model']=_[_0x493c('0x2d')](db[_0x493c('0x26')]['rawAttributes']);_0x31f068[_0x493c('0x2c')]=_[_0x493c('0x2d')](_0x47c1d3['query']);_0x31f068[_0x493c('0x36')]=_[_0x493c('0x2e')](_0x31f068[_0x493c('0x2b')],_0x31f068[_0x493c('0x2c')]);_0x5451b4['attributes']=_[_0x493c('0x2e')](_0x31f068[_0x493c('0x2b')],qs[_0x493c('0x30')](_0x47c1d3[_0x493c('0x2c')]['fields']));_0x5451b4[_0x493c('0x2f')]=_0x5451b4[_0x493c('0x2f')][_0x493c('0x31')]?_0x5451b4['attributes']:_0x31f068[_0x493c('0x2b')];if(_0x47c1d3[_0x493c('0x2c')]['includeAll']){_0x5451b4[_0x493c('0x42')]=[{'all':!![]}];}_0x5451b4=_[_0x493c('0x38')]({},_0x5451b4,_0x47c1d3[_0x493c('0x3c')]);return db['CmHopperHistory'][_0x493c('0x43')](_0x5451b4)[_0x493c('0x1e')](handleEntityNotFound(_0x4c3421,null))[_0x493c('0x1e')](respondWithResult(_0x4c3421,null))[_0x493c('0x40')](handleError(_0x4c3421,null));};exports['create']=function(_0x161cd1,_0x463db1){return db[_0x493c('0x26')][_0x493c('0x44')](_0x161cd1[_0x493c('0x45')],{})[_0x493c('0x1e')](respondWithResult(_0x463db1,0xc9))[_0x493c('0x40')](handleError(_0x463db1,null));};exports['describe']=function(_0x12bb00,_0x572893){return db[_0x493c('0x26')]['describe']()[_0x493c('0x1e')](respondWithResult(_0x572893,null))[_0x493c('0x40')](handleError(_0x572893,null));};exports['update']=function(_0x26b124,_0x47b0ea){if(_0x26b124['body'][_0x493c('0x46')]){delete _0x26b124[_0x493c('0x45')]['uniqueid'];}return db[_0x493c('0x26')][_0x493c('0x43')]({'where':{'uniqueid':_0x26b124[_0x493c('0x47')]['id']}})[_0x493c('0x1e')](handleEntityNotFound(_0x47b0ea,null))[_0x493c('0x1e')](saveUpdates(_0x26b124[_0x493c('0x45')],null))[_0x493c('0x1e')](respondWithResult(_0x47b0ea,null))[_0x493c('0x40')](handleError(_0x47b0ea,null));}; \ No newline at end of file +var _0x9818=['rows','catch','show','params','find','create','describe','body','uniqueid','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','CmHopperHistory','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include'];(function(_0x4c12f0,_0x1654ac){var _0x1ccc4d=function(_0x112d3b){while(--_0x112d3b){_0x4c12f0['push'](_0x4c12f0['shift']());}};_0x1ccc4d(++_0x1654ac);}(_0x9818,0x185));var _0x8981=function(_0x34b2a8,_0x53362a){_0x34b2a8=_0x34b2a8-0x0;var _0x2bf4f2=_0x9818[_0x34b2a8];return _0x2bf4f2;};'use strict';var pdf=require(_0x8981('0x0'));var emlformat=require(_0x8981('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8981('0x2'));var jsonpatch=require(_0x8981('0x3'));var rp=require(_0x8981('0x4'));var moment=require(_0x8981('0x5'));var BPromise=require(_0x8981('0x6'));var Mustache=require(_0x8981('0x7'));var util=require(_0x8981('0x8'));var path=require(_0x8981('0x9'));var sox=require(_0x8981('0xa'));var csv=require('to-csv');var ejs=require(_0x8981('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8981('0xc'));var crypto=require('crypto');var jsforce=require(_0x8981('0xd'));var deskjs=require(_0x8981('0xe'));var toCsv=require(_0x8981('0xf'));var querystring=require('querystring');var Papa=require(_0x8981('0x10'));var Redis=require(_0x8981('0x11'));var authService=require(_0x8981('0x12'));var qs=require(_0x8981('0x13'));var as=require(_0x8981('0x14'));var hardwareService=require(_0x8981('0x15'));var logger=require(_0x8981('0x16'))('api');var utils=require(_0x8981('0x17'));var config=require(_0x8981('0x18'));var db=require(_0x8981('0x19'))['db'];function respondWithStatusCode(_0x5f1088,_0x55e120){_0x55e120=_0x55e120||0xcc;return function(_0x59cc36){if(_0x59cc36){return _0x5f1088[_0x8981('0x1a')](_0x55e120);}return _0x5f1088['status'](_0x55e120)['end']();};}function respondWithResult(_0x17319b,_0x336b8f){_0x336b8f=_0x336b8f||0xc8;return function(_0x15a5aa){if(_0x15a5aa){return _0x17319b[_0x8981('0x1b')](_0x336b8f)[_0x8981('0x1c')](_0x15a5aa);}};}function respondWithFilteredResult(_0x4fbe02,_0x47f4ff){return function(_0x4a179c){if(_0x4a179c){var _0x34b856=_0x4a179c['count'],_0x11bfed=_0x47f4ff['offset'],_0x420a06=_0x47f4ff[_0x8981('0x1d')]+_0x47f4ff[_0x8981('0x1e')],_0x9fc1c2;if(_0x420a06>=_0x34b856){_0x420a06=_0x34b856;_0x9fc1c2=0xc8;}else{_0x9fc1c2=0xce;}_0x4fbe02[_0x8981('0x1b')](_0x9fc1c2);return _0x4fbe02[_0x8981('0x1f')]('Content-Range',_0x11bfed+'-'+_0x420a06+'/'+_0x34b856)['json'](_0x4a179c);}return null;};}function patchUpdates(_0x24cc3a){return function(_0x47bfbc){try{jsonpatch[_0x8981('0x20')](_0x47bfbc,_0x24cc3a,!![]);}catch(_0x24d685){return BPromise[_0x8981('0x21')](_0x24d685);}return _0x47bfbc[_0x8981('0x22')]();};}function saveUpdates(_0x3562bf,_0x5b5451){return function(_0x4e625b){if(_0x4e625b){return _0x4e625b[_0x8981('0x23')](_0x3562bf)[_0x8981('0x24')](function(_0x12ea20){return _0x12ea20;});}return null;};}function removeEntity(_0x25b821,_0x142b13){return function(_0x154ef6){if(_0x154ef6){return _0x154ef6[_0x8981('0x25')]()[_0x8981('0x24')](function(){_0x25b821[_0x8981('0x1b')](0xcc)[_0x8981('0x26')]();});}};}function handleEntityNotFound(_0x2a6ebf,_0x34ff24){return function(_0x5ad055){if(!_0x5ad055){_0x2a6ebf[_0x8981('0x1a')](0x194);}return _0x5ad055;};}function handleError(_0x177469,_0x52a645){_0x52a645=_0x52a645||0x1f4;return function(_0x147887){logger[_0x8981('0x27')](_0x147887[_0x8981('0x28')]);if(_0x147887[_0x8981('0x29')]){delete _0x147887['name'];}_0x177469[_0x8981('0x1b')](_0x52a645)[_0x8981('0x2a')](_0x147887);};}exports['index']=function(_0x33d561,_0x3cebc5){var _0x426759={},_0x4765ad={},_0x217184={'count':0x0,'rows':[]};var _0x9d5ed6=_['map'](db[_0x8981('0x2b')]['rawAttributes'],function(_0x3827da){return{'name':_0x3827da[_0x8981('0x2c')],'type':_0x3827da[_0x8981('0x2d')][_0x8981('0x2e')]};});_0x4765ad[_0x8981('0x2f')]=_[_0x8981('0x30')](_0x9d5ed6,_0x8981('0x29'));_0x4765ad[_0x8981('0x31')]=_[_0x8981('0x32')](_0x33d561[_0x8981('0x31')]);_0x4765ad[_0x8981('0x33')]=_[_0x8981('0x34')](_0x4765ad[_0x8981('0x2f')],_0x4765ad[_0x8981('0x31')]);_0x426759[_0x8981('0x35')]=_['intersection'](_0x4765ad[_0x8981('0x2f')],qs[_0x8981('0x36')](_0x33d561[_0x8981('0x31')][_0x8981('0x36')]));_0x426759[_0x8981('0x35')]=_0x426759['attributes'][_0x8981('0x37')]?_0x426759[_0x8981('0x35')]:_0x4765ad[_0x8981('0x2f')];if(!_0x33d561[_0x8981('0x31')][_0x8981('0x38')](_0x8981('0x39'))){_0x426759[_0x8981('0x1e')]=qs[_0x8981('0x1e')](_0x33d561['query'][_0x8981('0x1e')]);_0x426759[_0x8981('0x1d')]=qs['offset'](_0x33d561['query'][_0x8981('0x1d')]);}_0x426759['order']=qs[_0x8981('0x3a')](_0x33d561[_0x8981('0x31')][_0x8981('0x3a')]);_0x426759[_0x8981('0x3b')]=qs['filters'](_['pick'](_0x33d561[_0x8981('0x31')],_0x4765ad[_0x8981('0x33')]));if(_0x33d561[_0x8981('0x31')][_0x8981('0x3c')]){_0x426759[_0x8981('0x3b')]=_[_0x8981('0x3d')](_0x426759[_0x8981('0x3b')],{'$or':_['map'](_0x9d5ed6,function(_0x1ea531){if(_0x1ea531['type']!==_0x8981('0x3e')){var _0x9dc701={};_0x9dc701[_0x1ea531[_0x8981('0x29')]]={'$like':'%'+_0x33d561[_0x8981('0x31')][_0x8981('0x3c')]+'%'};return _0x9dc701;}})});}_0x426759=_['merge']({},_0x426759,_0x33d561[_0x8981('0x3f')]);var _0xa0620b={'where':_0x426759['where']};return db[_0x8981('0x2b')][_0x8981('0x40')](_0xa0620b)['then'](function(_0x5e4537){_0x217184[_0x8981('0x40')]=_0x5e4537;if(_0x33d561[_0x8981('0x31')][_0x8981('0x41')]){_0x426759[_0x8981('0x42')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x426759);})[_0x8981('0x24')](function(_0xc7e836){_0x217184[_0x8981('0x43')]=_0xc7e836;return _0x217184;})[_0x8981('0x24')](respondWithFilteredResult(_0x3cebc5,_0x426759))[_0x8981('0x44')](handleError(_0x3cebc5,null));};exports[_0x8981('0x45')]=function(_0x4444a6,_0x2ad2ae){var _0x593885={'raw':!![],'where':{'id':_0x4444a6[_0x8981('0x46')]['id']}},_0x217267={};_0x217267[_0x8981('0x2f')]=_[_0x8981('0x32')](db[_0x8981('0x2b')]['rawAttributes']);_0x217267[_0x8981('0x31')]=_[_0x8981('0x32')](_0x4444a6[_0x8981('0x31')]);_0x217267['filters']=_[_0x8981('0x34')](_0x217267[_0x8981('0x2f')],_0x217267[_0x8981('0x31')]);_0x593885[_0x8981('0x35')]=_['intersection'](_0x217267[_0x8981('0x2f')],qs[_0x8981('0x36')](_0x4444a6[_0x8981('0x31')][_0x8981('0x36')]));_0x593885['attributes']=_0x593885[_0x8981('0x35')][_0x8981('0x37')]?_0x593885[_0x8981('0x35')]:_0x217267[_0x8981('0x2f')];if(_0x4444a6['query'][_0x8981('0x41')]){_0x593885[_0x8981('0x42')]=[{'all':!![]}];}_0x593885=_[_0x8981('0x3d')]({},_0x593885,_0x4444a6[_0x8981('0x3f')]);return db[_0x8981('0x2b')][_0x8981('0x47')](_0x593885)[_0x8981('0x24')](handleEntityNotFound(_0x2ad2ae,null))[_0x8981('0x24')](respondWithResult(_0x2ad2ae,null))[_0x8981('0x44')](handleError(_0x2ad2ae,null));};exports[_0x8981('0x48')]=function(_0x1d8e82,_0x458305){return db[_0x8981('0x2b')]['create'](_0x1d8e82['body'],{})[_0x8981('0x24')](respondWithResult(_0x458305,0xc9))['catch'](handleError(_0x458305,null));};exports[_0x8981('0x49')]=function(_0x400461,_0x41d8ac){return db['CmHopperHistory'][_0x8981('0x49')]()['then'](respondWithResult(_0x41d8ac,null))['catch'](handleError(_0x41d8ac,null));};exports['update']=function(_0x3939cd,_0x7808e3){if(_0x3939cd[_0x8981('0x4a')]['uniqueid']){delete _0x3939cd['body'][_0x8981('0x4b')];}return db[_0x8981('0x2b')][_0x8981('0x47')]({'where':{'uniqueid':_0x3939cd[_0x8981('0x46')]['id']}})[_0x8981('0x24')](handleEntityNotFound(_0x7808e3,null))[_0x8981('0x24')](saveUpdates(_0x3939cd[_0x8981('0x4a')],null))['then'](respondWithResult(_0x7808e3,null))[_0x8981('0x44')](handleError(_0x7808e3,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 65cceec..7845c15 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 _0xb0e8=['./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x523f0c,_0x5e72be){var _0x459d18=function(_0x13f20a){while(--_0x13f20a){_0x523f0c['push'](_0x523f0c['shift']());}};_0x459d18(++_0x5e72be);}(_0xb0e8,0x150));var _0x8b0e=function(_0x52085a,_0x3717ca){_0x52085a=_0x52085a-0x0;var _0x5afc1a=_0xb0e8[_0x52085a];return _0x5afc1a;};'use strict';var _=require(_0x8b0e('0x0'));var util=require(_0x8b0e('0x1'));var logger=require(_0x8b0e('0x2'))(_0x8b0e('0x3'));var moment=require(_0x8b0e('0x4'));var BPromise=require(_0x8b0e('0x5'));var rp=require(_0x8b0e('0x6'));var fs=require('fs');var path=require(_0x8b0e('0x7'));var rimraf=require(_0x8b0e('0x8'));var config=require('../../config/environment');var attributes=require(_0x8b0e('0x9'));module[_0x8b0e('0xa')]=function(_0x14db19,_0xc4a740){return _0x14db19[_0x8b0e('0xb')](_0x8b0e('0xc'),attributes,{'tableName':_0x8b0e('0xd'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0x8b0e('0xe'),'fields':[_0x8b0e('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x32b3=['./cmHopperHistory.attributes','exports','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xf3e977,_0xfd1f2){var _0x4708a5=function(_0x53a3da){while(--_0x53a3da){_0xf3e977['push'](_0xf3e977['shift']());}};_0x4708a5(++_0xfd1f2);}(_0x32b3,0x11e));var _0x332b=function(_0x27530d,_0x46480a){_0x27530d=_0x27530d-0x0;var _0x59e561=_0x32b3[_0x27530d];return _0x59e561;};'use strict';var _=require(_0x332b('0x0'));var util=require(_0x332b('0x1'));var logger=require(_0x332b('0x2'))('api');var moment=require(_0x332b('0x3'));var BPromise=require(_0x332b('0x4'));var rp=require(_0x332b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x332b('0x6'));var config=require(_0x332b('0x7'));var attributes=require(_0x332b('0x8'));module[_0x332b('0x9')]=function(_0x1e1571,_0x183289){return _0x1e1571['define'](_0x332b('0xa'),attributes,{'tableName':_0x332b('0xb'),'paranoid':![],'indexes':[{'name':_0x332b('0xc'),'fields':[_0x332b('0xc')]},{'name':_0x332b('0xd'),'fields':[_0x332b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 2d3a550..81e4903 100644 --- a/server/api/cmHopperHistory/cmHopperHistory.rpc.js +++ b/server/api/cmHopperHistory/cmHopperHistory.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5eb8=['raw','then','CreateCmHopperHistory','stringify','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','`state`\x20=\x204,\x201,\x20null','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2016,\x201,\x20null','outboundAnswerAgiCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','error','message','catch','CmHopperHistory','create','body','options'];(function(_0x2a238a,_0x1d5054){var _0xeef802=function(_0x583637){while(--_0x583637){_0x2a238a['push'](_0x2a238a['shift']());}};_0xeef802(++_0x1d5054);}(_0x5eb8,0xb0));var _0x85eb=function(_0x269ee8,_0x477226){_0x269ee8=_0x269ee8-0x0;var _0x4d98bd=_0x5eb8[_0x269ee8];return _0x4d98bd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x85eb('0x0'));var BPromise=require(_0x85eb('0x1'));var rs=require(_0x85eb('0x2'));var fs=require('fs');var Redis=require(_0x85eb('0x3'));var db=require(_0x85eb('0x4'))['db'];var utils=require(_0x85eb('0x5'));var logger=require(_0x85eb('0x6'))(_0x85eb('0x7'));var config=require(_0x85eb('0x8'));var jayson=require(_0x85eb('0x9'));var client=jayson[_0x85eb('0xa')][_0x85eb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4a8814,_0x16d7b9,_0x3af658){return new BPromise(function(_0x448345,_0x5cd4ec){return client[_0x85eb('0xc')](_0x4a8814,_0x3af658)['then'](function(_0x1f0036){logger[_0x85eb('0xd')](_0x85eb('0xe'),_0x16d7b9,_0x85eb('0xf'));logger[_0x85eb('0x10')](_0x85eb('0x11'),_0x16d7b9,_0x85eb('0xf'),JSON['stringify'](_0x1f0036));if(_0x1f0036[_0x85eb('0x12')]){if(_0x1f0036[_0x85eb('0x12')]['code']===0x1f4){logger[_0x85eb('0x12')](_0x85eb('0xe'),_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x5cd4ec(_0x1f0036['error']['message']);}logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);return _0x448345(_0x1f0036[_0x85eb('0x12')][_0x85eb('0x13')]);}else{logger[_0x85eb('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x85eb('0xf'));_0x448345(_0x1f0036['result'][_0x85eb('0x13')]);}})[_0x85eb('0x14')](function(_0x3e23e8){logger[_0x85eb('0x12')]('CmHopperHistory,\x20%s,\x20%s',_0x16d7b9,_0x3e23e8);_0x5cd4ec(_0x3e23e8);});});}exports['CreateCmHopperHistory']=function(_0x50d2a8){var _0xe198ca=this;return new Promise(function(_0x39ca96,_0x10cf2f){return db[_0x85eb('0x15')][_0x85eb('0x16')](_0x50d2a8[_0x85eb('0x17')],{'raw':_0x50d2a8['options']?_0x50d2a8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![]})[_0x85eb('0x1a')](function(_0x4e8041){logger['info']('CreateCmHopperHistory',_0x50d2a8);logger['debug'](_0x85eb('0x1b'),_0x50d2a8,JSON[_0x85eb('0x1c')](_0x4e8041));_0x39ca96(_0x4e8041);})[_0x85eb('0x14')](function(_0x255ca7){logger[_0x85eb('0x12')](_0x85eb('0x1b'),_0x255ca7['message'],_0x50d2a8);_0x10cf2f(_0xe198ca['error'](0x1f4,_0x255ca7['message']));});});};exports[_0x85eb('0x1d')]=function(_0x1426c8){var _0x3f7a4d=this;return new Promise(function(_0x28b87d,_0x312b3e){return db[_0x85eb('0x15')]['findAll']({'raw':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x1426c8[_0x85eb('0x18')]?_0x1426c8[_0x85eb('0x18')]['where']||null:null,'attributes':[[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')][_0x85eb('0x20')]('id')),_0x85eb('0x21')],[db[_0x85eb('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x24')))),_0x85eb('0x25')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')]('`state`\x20=\x2011,\x201,\x20null'))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x27')))),_0x85eb('0x28')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x26'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x29')))),'predictiveIntervalAvgTalktime']]})['then'](function(_0x340745){logger[_0x85eb('0xd')](_0x85eb('0x1d'),_0x1426c8);logger[_0x85eb('0x10')](_0x85eb('0x1d'),_0x1426c8,JSON[_0x85eb('0x1c')](_0x340745));_0x28b87d(_0x340745);})[_0x85eb('0x14')](function(_0x35f092){logger[_0x85eb('0x12')](_0x85eb('0x1d'),_0x35f092[_0x85eb('0x13')],_0x1426c8);_0x312b3e(_0x3f7a4d[_0x85eb('0x12')](0x1f4,_0x35f092[_0x85eb('0x13')]));});});};exports[_0x85eb('0x2a')]=function(_0x4b69a7){var _0x4361e2=this;return new Promise(function(_0x3dfe74,_0x58f091){return db['CmHopperHistory'][_0x85eb('0x2b')]({'raw':_0x4b69a7[_0x85eb('0x18')]?_0x4b69a7['options'][_0x85eb('0x19')]===undefined?!![]:![]:!![],'where':_0x4b69a7['options']?_0x4b69a7[_0x85eb('0x18')]['where']||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x2d')))),'outboundNoSuchCallsDay'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize']['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x203,\x201,\x20null'))),_0x85eb('0x2e')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x85eb('0x22')))),_0x85eb('0x2f')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x30')))),_0x85eb('0x31')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x32')))),_0x85eb('0x33')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x34')))),'outboundDropCallsDayTimeout'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x35')))),'outboundDropCallsDayCallersExit'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x36')))),_0x85eb('0x37')],[db[_0x85eb('0x1e')]['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x38')))),_0x85eb('0x39')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x3a')))),_0x85eb('0x3b')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal'](_0x85eb('0x3c')))),_0x85eb('0x3d')],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x3e')))),_0x85eb('0x3f')],[db['sequelize']['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')]['literal']('`state`\x20=\x2020,\x201,\x20null'))),_0x85eb('0x3d')],[db['sequelize']['fn']('COUNT',db[_0x85eb('0x1e')]['fn']('IF',db['sequelize'][_0x85eb('0x23')](_0x85eb('0x40')))),'outboundReCallsDay']],'group':['campaign']})[_0x85eb('0x1a')](function(_0x249511){logger[_0x85eb('0xd')](_0x85eb('0x2a'),_0x4b69a7);logger[_0x85eb('0x10')]('GetVoiceQueueHopperHistory',_0x4b69a7,JSON[_0x85eb('0x1c')](_0x249511));_0x3dfe74(_0x249511);})[_0x85eb('0x14')](function(_0x270bb2){logger[_0x85eb('0x12')](_0x85eb('0x2a'),_0x270bb2['message'],_0x4b69a7);_0x58f091(_0x4361e2[_0x85eb('0x12')](0x1f4,_0x270bb2['message']));});});};exports[_0x85eb('0x41')]=function(_0x40d846){var _0x4ee529=this;return new Promise(function(_0x341ddb,_0xd04f24){return db[_0x85eb('0x15')][_0x85eb('0x2b')]({'raw':_0x40d846[_0x85eb('0x18')]?_0x40d846[_0x85eb('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x40d846[_0x85eb('0x18')]?_0x40d846['options'][_0x85eb('0x42')]||null:null,'attributes':[[_0x85eb('0x2c'),'name'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db['sequelize'][_0x85eb('0x20')]('id')),'ivrTotalCallsDays'],[db[_0x85eb('0x1e')]['fn'](_0x85eb('0x1f'),db[_0x85eb('0x1e')]['fn']('IF',db[_0x85eb('0x1e')][_0x85eb('0x23')](_0x85eb('0x22')))),'ivrAnswerCallsDay']],'group':[_0x85eb('0x2c')]})[_0x85eb('0x1a')](function(_0x1d3204){logger[_0x85eb('0xd')](_0x85eb('0x41'),_0x40d846);logger[_0x85eb('0x10')](_0x85eb('0x41'),_0x40d846,JSON[_0x85eb('0x1c')](_0x1d3204));_0x341ddb(_0x1d3204);})[_0x85eb('0x14')](function(_0x13cc2a){logger[_0x85eb('0x12')]('GetCampaignHopperHistory',_0x13cc2a[_0x85eb('0x13')],_0x40d846);_0xd04f24(_0x4ee529[_0x85eb('0x12')](0x1f4,_0x13cc2a[_0x85eb('0x13')]));});});}; \ No newline at end of file +var _0x1be1=['options','raw','AvgHandleTime','CmHopperHistory','where','COUNT','sequelize','col','predictiveIntervalTotalCalls','literal','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','findAll','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','`state`\x20=\x204,\x201,\x20null','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundCongestionCallsDay','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','CmHopperHistory,\x20%s,\x20%s','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateCmHopperHistory','body'];(function(_0x4ff7ca,_0x1aa682){var _0x2492dc=function(_0x18d209){while(--_0x18d209){_0x4ff7ca['push'](_0x4ff7ca['shift']());}};_0x2492dc(++_0x1aa682);}(_0x1be1,0x192));var _0x11be=function(_0x1e170c,_0x3ee324){_0x1e170c=_0x1e170c-0x0;var _0x108855=_0x1be1[_0x1e170c];return _0x108855;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('CmHopperHistory,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('CmHopperHistory,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});}exports[_0x11be('0x16')]=function(_0x56ab61){var _0x299f45=this;return new Promise(function(_0xc3263c,_0x23aa5f){return db['CmHopperHistory']['create'](_0x56ab61[_0x11be('0x17')],{'raw':_0x56ab61[_0x11be('0x18')]?_0x56ab61[_0x11be('0x18')][_0x11be('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x12a5bd){logger[_0x11be('0xb')](_0x11be('0x16'),_0x56ab61);logger[_0x11be('0xd')](_0x11be('0x16'),_0x56ab61,JSON[_0x11be('0x10')](_0x12a5bd));_0xc3263c(_0x12a5bd);})[_0x11be('0x15')](function(_0x17678d){logger[_0x11be('0x11')](_0x11be('0x16'),_0x17678d['message'],_0x56ab61);_0x23aa5f(_0x299f45[_0x11be('0x11')](0x1f4,_0x17678d[_0x11be('0x13')]));});});};exports[_0x11be('0x1a')]=function(_0x5d1690){var _0x4b329b=this;return new Promise(function(_0x118915,_0x10ce04){return db[_0x11be('0x1b')]['findAll']({'raw':_0x5d1690[_0x11be('0x18')]?_0x5d1690['options'][_0x11be('0x19')]===undefined?!![]:![]:!![],'where':_0x5d1690['options']?_0x5d1690[_0x11be('0x18')][_0x11be('0x1c')]||null:null,'attributes':[[db['sequelize']['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')][_0x11be('0x1f')]('id')),_0x11be('0x20')],[db[_0x11be('0x1e')]['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')]('`state`\x20=\x204,\x201,\x20null'))),_0x11be('0x22')],[db['sequelize']['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db['sequelize']['literal'](_0x11be('0x23')))),_0x11be('0x24')],[db[_0x11be('0x1e')]['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')](_0x11be('0x25')))),_0x11be('0x26')],[db['sequelize']['fn'](_0x11be('0x27'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')](_0x11be('0x28')))),_0x11be('0x29')],[db['sequelize']['fn'](_0x11be('0x27'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')](_0x11be('0x2a')))),'predictiveIntervalAvgTalktime']]})[_0x11be('0xa')](function(_0x254be5){logger[_0x11be('0xb')]('AvgHandleTime',_0x5d1690);logger[_0x11be('0xd')]('AvgHandleTime',_0x5d1690,JSON['stringify'](_0x254be5));_0x118915(_0x254be5);})['catch'](function(_0x50e601){logger[_0x11be('0x11')](_0x11be('0x1a'),_0x50e601[_0x11be('0x13')],_0x5d1690);_0x10ce04(_0x4b329b['error'](0x1f4,_0x50e601[_0x11be('0x13')]));});});};exports[_0x11be('0x2b')]=function(_0x56ecd2){var _0x370d10=this;return new Promise(function(_0x556989,_0x222f84){return db['CmHopperHistory'][_0x11be('0x2c')]({'raw':_0x56ecd2[_0x11be('0x18')]?_0x56ecd2[_0x11be('0x18')][_0x11be('0x19')]===undefined?!![]:![]:!![],'where':_0x56ecd2['options']?_0x56ecd2[_0x11be('0x18')][_0x11be('0x1c')]||null:null,'attributes':[[_0x11be('0x2d'),_0x11be('0x2e')],[db['sequelize']['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')](_0x11be('0x2f')))),_0x11be('0x30')],[db[_0x11be('0x1e')]['fn']('COUNT',db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')]['literal'](_0x11be('0x31')))),_0x11be('0x32')],[db['sequelize']['fn'](_0x11be('0x1d'),db['sequelize']['fn']('IF',db[_0x11be('0x1e')]['literal'](_0x11be('0x33')))),_0x11be('0x34')],[db['sequelize']['fn'](_0x11be('0x1d'),db['sequelize']['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')](_0x11be('0x35')))),_0x11be('0x36')],[db[_0x11be('0x1e')]['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db['sequelize'][_0x11be('0x21')](_0x11be('0x37')))),_0x11be('0x38')],[db[_0x11be('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x11be('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0x11be('0x39')],[db['sequelize']['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')](_0x11be('0x3a')))),_0x11be('0x3b')],[db[_0x11be('0x1e')]['fn']('COUNT',db[_0x11be('0x1e')]['fn']('IF',db['sequelize'][_0x11be('0x21')](_0x11be('0x3c')))),_0x11be('0x3d')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')](_0x11be('0x3e')))),_0x11be('0x3f')],[db[_0x11be('0x1e')]['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),_0x11be('0x40')],[db[_0x11be('0x1e')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x11be('0x21')]('`state`\x20=\x2016,\x201,\x20null'))),_0x11be('0x41')],[db[_0x11be('0x1e')]['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')][_0x11be('0x21')](_0x11be('0x42')))),_0x11be('0x40')],[db[_0x11be('0x1e')]['fn']('COUNT',db[_0x11be('0x1e')]['fn']('IF',db['sequelize'][_0x11be('0x21')](_0x11be('0x43')))),'outboundReCallsDay']],'group':[_0x11be('0x2d')]})[_0x11be('0xa')](function(_0x4c0e37){logger[_0x11be('0xb')](_0x11be('0x2b'),_0x56ecd2);logger['debug']('GetVoiceQueueHopperHistory',_0x56ecd2,JSON[_0x11be('0x10')](_0x4c0e37));_0x556989(_0x4c0e37);})[_0x11be('0x15')](function(_0x50eeab){logger['error'](_0x11be('0x2b'),_0x50eeab[_0x11be('0x13')],_0x56ecd2);_0x222f84(_0x370d10[_0x11be('0x11')](0x1f4,_0x50eeab['message']));});});};exports['GetCampaignHopperHistory']=function(_0x4d5d07){var _0x19233f=this;return new Promise(function(_0x6f2b62,_0x3c3bef){return db['CmHopperHistory']['findAll']({'raw':_0x4d5d07[_0x11be('0x18')]?_0x4d5d07[_0x11be('0x18')][_0x11be('0x19')]===undefined?!![]:![]:!![],'where':_0x4d5d07[_0x11be('0x18')]?_0x4d5d07['options'][_0x11be('0x1c')]||null:null,'attributes':[['campaign','name'],[db['sequelize']['fn']('COUNT',db[_0x11be('0x1e')][_0x11be('0x1f')]('id')),_0x11be('0x44')],[db[_0x11be('0x1e')]['fn'](_0x11be('0x1d'),db[_0x11be('0x1e')]['fn']('IF',db[_0x11be('0x1e')]['literal']('`state`\x20=\x204,\x201,\x20null'))),_0x11be('0x45')]],'group':[_0x11be('0x2d')]})[_0x11be('0xa')](function(_0x2b0289){logger[_0x11be('0xb')](_0x11be('0x46'),_0x4d5d07);logger[_0x11be('0xd')](_0x11be('0x46'),_0x4d5d07,JSON[_0x11be('0x10')](_0x2b0289));_0x6f2b62(_0x2b0289);})['catch'](function(_0x1aa57d){logger[_0x11be('0x11')](_0x11be('0x46'),_0x1aa57d['message'],_0x4d5d07);_0x3c3bef(_0x19233f[_0x11be('0x11')](0x1f4,_0x1aa57d[_0x11be('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 8bfb3a0..98b1c36 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 _0x5baa=['./cmHopperHistory.controller','get','isAuthenticated','describe','/:id','show','post','create','put','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x4db817,_0x10910a){var _0x3205ba=function(_0x2ce74c){while(--_0x2ce74c){_0x4db817['push'](_0x4db817['shift']());}};_0x3205ba(++_0x10910a);}(_0x5baa,0x16f));var _0xa5ba=function(_0x322758,_0x9d0be3){_0x322758=_0x322758-0x0;var _0x41792a=_0x5baa[_0x322758];return _0x41792a;};'use strict';var multer=require(_0xa5ba('0x0'));var util=require('util');var path=require(_0xa5ba('0x1'));var timeout=require(_0xa5ba('0x2'));var express=require(_0xa5ba('0x3'));var router=express[_0xa5ba('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa5ba('0x5'));var config=require(_0xa5ba('0x6'));var controller=require(_0xa5ba('0x7'));router[_0xa5ba('0x8')]('/',auth[_0xa5ba('0x9')](),controller['index']);router[_0xa5ba('0x8')]('/describe',auth[_0xa5ba('0x9')](),controller[_0xa5ba('0xa')]);router[_0xa5ba('0x8')](_0xa5ba('0xb'),auth[_0xa5ba('0x9')](),controller[_0xa5ba('0xc')]);router[_0xa5ba('0xd')]('/',auth[_0xa5ba('0x9')](),controller[_0xa5ba('0xe')]);router[_0xa5ba('0xf')](_0xa5ba('0xb'),auth[_0xa5ba('0x9')](),controller['update']);module[_0xa5ba('0x10')]=router; \ No newline at end of file +var _0x8b7a=['show','create','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id'];(function(_0x5a4b2b,_0x210f4e){var _0x290f97=function(_0x30e5e9){while(--_0x30e5e9){_0x5a4b2b['push'](_0x5a4b2b['shift']());}};_0x290f97(++_0x210f4e);}(_0x8b7a,0x1c5));var _0xa8b7=function(_0x3d33b5,_0x4f3ae9){_0x3d33b5=_0x3d33b5-0x0;var _0x764c8d=_0x8b7a[_0x3d33b5];return _0x764c8d;};'use strict';var multer=require(_0xa8b7('0x0'));var util=require(_0xa8b7('0x1'));var path=require(_0xa8b7('0x2'));var timeout=require(_0xa8b7('0x3'));var express=require(_0xa8b7('0x4'));var router=express[_0xa8b7('0x5')]();var auth=require(_0xa8b7('0x6'));var interaction=require(_0xa8b7('0x7'));var config=require('../../config/environment');var controller=require('./cmHopperHistory.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xa8b7('0x8')]('/describe',auth[_0xa8b7('0x9')](),controller[_0xa8b7('0xa')]);router[_0xa8b7('0x8')](_0xa8b7('0xb'),auth[_0xa8b7('0x9')](),controller[_0xa8b7('0xc')]);router['post']('/',auth[_0xa8b7('0x9')](),controller[_0xa8b7('0xd')]);router['put'](_0xa8b7('0xb'),auth[_0xa8b7('0x9')](),controller[_0xa8b7('0xe')]);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 c80509c..6438ba8 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 _0x355a=['name','exports','STRING'];(function(_0x1795df,_0xcb261e){var _0x3f13c0=function(_0x52c5cf){while(--_0x52c5cf){_0x1795df['push'](_0x1795df['shift']());}};_0x3f13c0(++_0xcb261e);}(_0x355a,0xc7));var _0xa355=function(_0x3331f7,_0x10fb17){_0x3331f7=_0x3331f7-0x0;var _0x174df3=_0x355a[_0x3331f7];return _0x174df3;};'use strict';var Sequelize=require('sequelize');module[_0xa355('0x0')]={'name':{'type':Sequelize[_0xa355('0x1')],'unique':_0xa355('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa355('0x1')]},'dialPrefix':{'type':Sequelize[_0xa355('0x1')]}}; \ No newline at end of file +var _0x2cf5=['STRING','sequelize'];(function(_0x60df74,_0x458e29){var _0x5ee872=function(_0x356888){while(--_0x356888){_0x60df74['push'](_0x60df74['shift']());}};_0x5ee872(++_0x458e29);}(_0x2cf5,0x143));var _0x52cf=function(_0x447b8d,_0x1f7b1a){_0x447b8d=_0x447b8d-0x0;var _0x10b656=_0x2cf5[_0x447b8d];return _0x10b656;};'use strict';var Sequelize=require(_0x52cf('0x0'));module['exports']={'name':{'type':Sequelize[_0x52cf('0x1')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x52cf('0x1')]},'dialPrefix':{'type':Sequelize[_0x52cf('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index e1026dd..158c556 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 _0x6263=['addDisposition','ListId','Disposition','getDispositions','keys','hasOwnProperty','addContacts','CmContact','tags','isArray','push','each','omit','ids','message','json','Malformed\x20request\x20syntax','getContacts','concat','format','cf_%d','raw','getContactsCsv','CmCustomField','CustomFields','pick','now','writeFileSync','setHeader','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','sequelize','transaction','Sequelize','TEXT','text','number','switch','BOOLEAN','defaultValue','queryInterface','addColumn','getCustomFields','findOne','findAndCountAll','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Lists','UserProfileResource','error','name','send','index','map','CmList','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','params','describe'];(function(_0x24e951,_0x544ac7){var _0x554280=function(_0x1c38af){while(--_0x1c38af){_0x24e951['push'](_0x24e951['shift']());}};_0x554280(++_0x544ac7);}(_0x6263,0xc7));var _0x3626=function(_0x449fb0,_0xf691a2){_0x449fb0=_0x449fb0-0x0;var _0x10bb91=_0x6263[_0x449fb0];return _0x10bb91;};'use strict';var pdf=require(_0x3626('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3626('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3626('0x2'));var moment=require(_0x3626('0x3'));var BPromise=require(_0x3626('0x4'));var Mustache=require(_0x3626('0x5'));var util=require(_0x3626('0x6'));var path=require('path');var sox=require(_0x3626('0x7'));var csv=require(_0x3626('0x8'));var ejs=require(_0x3626('0x9'));var fs=require('fs');var _=require(_0x3626('0xa'));var squel=require('squel');var crypto=require(_0x3626('0xb'));var jsforce=require(_0x3626('0xc'));var deskjs=require(_0x3626('0xd'));var toCsv=require(_0x3626('0x8'));var querystring=require(_0x3626('0xe'));var Papa=require('papaparse');var Redis=require(_0x3626('0xf'));var authService=require(_0x3626('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x3626('0x11'));var hardwareService=require(_0x3626('0x12'));var logger=require(_0x3626('0x13'))(_0x3626('0x14'));var utils=require(_0x3626('0x15'));var config=require(_0x3626('0x16'));var db=require(_0x3626('0x17'))['db'];config[_0x3626('0x18')]=_[_0x3626('0x19')](config['redis'],{'host':_0x3626('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3626('0x18')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x2d187b,_0x7a4f77){_0x7a4f77=_0x7a4f77||0xcc;return function(_0x49d658){if(_0x49d658){return _0x2d187b[_0x3626('0x1b')](_0x7a4f77);}return _0x2d187b['status'](_0x7a4f77)[_0x3626('0x1c')]();};}function respondWithResult(_0x370dca,_0x453326){_0x453326=_0x453326||0xc8;return function(_0x101a3d){if(_0x101a3d){return _0x370dca[_0x3626('0x1d')](_0x453326)['json'](_0x101a3d);}};}function respondWithFilteredResult(_0x5523a2,_0x23671b){return function(_0x361b02){if(_0x361b02){var _0x5ab085=_0x361b02[_0x3626('0x1e')],_0x1dc861=_0x23671b[_0x3626('0x1f')],_0x50d5cf=_0x23671b[_0x3626('0x1f')]+_0x23671b[_0x3626('0x20')],_0x568e5e;if(_0x50d5cf>=_0x5ab085){_0x50d5cf=_0x5ab085;_0x568e5e=0xc8;}else{_0x568e5e=0xce;}_0x5523a2[_0x3626('0x1d')](_0x568e5e);return _0x5523a2[_0x3626('0x21')](_0x3626('0x22'),_0x1dc861+'-'+_0x50d5cf+'/'+_0x5ab085)['json'](_0x361b02);}return null;};}function patchUpdates(_0x1decfc){return function(_0x397cdb){try{jsonpatch[_0x3626('0x23')](_0x397cdb,_0x1decfc,!![]);}catch(_0x16c0bf){return BPromise[_0x3626('0x24')](_0x16c0bf);}return _0x397cdb[_0x3626('0x25')]();};}function saveUpdates(_0xe02d2c,_0x4fe929){return function(_0x1a12d6){if(_0x1a12d6){return _0x1a12d6[_0x3626('0x26')](_0xe02d2c)[_0x3626('0x27')](function(_0x4f2840){return _0x4f2840;});}return null;};}function removeEntity(_0x3f906f,_0x46af08){return function(_0x7e9e9a){if(_0x7e9e9a){return _0x7e9e9a[_0x3626('0x28')]()[_0x3626('0x27')](function(){var _0x16acbe=_0x7e9e9a[_0x3626('0x29')]({'plain':!![]});var _0x541562=_0x3626('0x2a');return db[_0x3626('0x2b')][_0x3626('0x28')]({'where':{'type':_0x541562,'resourceId':_0x16acbe['id']}})[_0x3626('0x27')](function(){return _0x7e9e9a;});})[_0x3626('0x27')](function(){_0x3f906f[_0x3626('0x1d')](0xcc)[_0x3626('0x1c')]();});}};}function handleEntityNotFound(_0x128575,_0x145cf4){return function(_0x4c9880){if(!_0x4c9880){_0x128575[_0x3626('0x1b')](0x194);}return _0x4c9880;};}function handleError(_0x165a7c,_0x27a58a){_0x27a58a=_0x27a58a||0x1f4;return function(_0x2fa709){logger[_0x3626('0x2c')](_0x2fa709['stack']);if(_0x2fa709[_0x3626('0x2d')]){delete _0x2fa709[_0x3626('0x2d')];}_0x165a7c[_0x3626('0x1d')](_0x27a58a)[_0x3626('0x2e')](_0x2fa709);};}exports[_0x3626('0x2f')]=function(_0x52249f,_0x2b4b52){var _0x2d3265={},_0x5a4fe1={},_0x1aaac4={'count':0x0,'rows':[]};var _0x8b357a=_[_0x3626('0x30')](db[_0x3626('0x31')][_0x3626('0x32')],function(_0x2849c3){return{'name':_0x2849c3['fieldName'],'type':_0x2849c3[_0x3626('0x33')][_0x3626('0x34')]};});_0x5a4fe1[_0x3626('0x35')]=_[_0x3626('0x30')](_0x8b357a,'name');_0x5a4fe1[_0x3626('0x36')]=_['keys'](_0x52249f[_0x3626('0x36')]);_0x5a4fe1[_0x3626('0x37')]=_[_0x3626('0x38')](_0x5a4fe1[_0x3626('0x35')],_0x5a4fe1[_0x3626('0x36')]);_0x2d3265['attributes']=_[_0x3626('0x38')](_0x5a4fe1[_0x3626('0x35')],qs[_0x3626('0x39')](_0x52249f[_0x3626('0x36')][_0x3626('0x39')]));_0x2d3265[_0x3626('0x3a')]=_0x2d3265[_0x3626('0x3a')][_0x3626('0x3b')]?_0x2d3265[_0x3626('0x3a')]:_0x5a4fe1[_0x3626('0x35')];if(!_0x52249f[_0x3626('0x36')]['hasOwnProperty'](_0x3626('0x3c'))){_0x2d3265[_0x3626('0x20')]=qs[_0x3626('0x20')](_0x52249f[_0x3626('0x36')]['limit']);_0x2d3265[_0x3626('0x1f')]=qs['offset'](_0x52249f[_0x3626('0x36')][_0x3626('0x1f')]);}_0x2d3265[_0x3626('0x3d')]=qs['sort'](_0x52249f[_0x3626('0x36')][_0x3626('0x3e')]);_0x2d3265[_0x3626('0x3f')]=qs[_0x3626('0x37')](_['pick'](_0x52249f[_0x3626('0x36')],_0x5a4fe1[_0x3626('0x37')]));if(_0x52249f[_0x3626('0x36')]['filter']){_0x2d3265[_0x3626('0x3f')]=_[_0x3626('0x40')](_0x2d3265[_0x3626('0x3f')],{'$or':_[_0x3626('0x30')](_0x8b357a,function(_0x28d9c2){if(_0x28d9c2[_0x3626('0x33')]!==_0x3626('0x41')){var _0x52de95={};_0x52de95[_0x28d9c2[_0x3626('0x2d')]]={'$like':'%'+_0x52249f[_0x3626('0x36')][_0x3626('0x42')]+'%'};return _0x52de95;}})});}_0x2d3265=_[_0x3626('0x40')]({},_0x2d3265,_0x52249f[_0x3626('0x43')]);var _0x3613df={'where':_0x2d3265[_0x3626('0x3f')]};return db[_0x3626('0x31')][_0x3626('0x1e')](_0x3613df)[_0x3626('0x27')](function(_0x153156){_0x1aaac4[_0x3626('0x1e')]=_0x153156;if(_0x52249f['query'][_0x3626('0x44')]){_0x2d3265[_0x3626('0x45')]=[{'all':!![]}];}return db['CmList'][_0x3626('0x46')](_0x2d3265);})['then'](function(_0x12a0ba){_0x1aaac4[_0x3626('0x47')]=_0x12a0ba;return _0x1aaac4;})['then'](respondWithFilteredResult(_0x2b4b52,_0x2d3265))[_0x3626('0x48')](handleError(_0x2b4b52,null));};exports['show']=function(_0xb74e82,_0x4f4655){var _0x29bfb1={'raw':![],'where':{'id':_0xb74e82['params']['id']}},_0x32d718={};_0x32d718[_0x3626('0x35')]=_['keys'](db[_0x3626('0x31')][_0x3626('0x32')]);_0x32d718[_0x3626('0x36')]=_['keys'](_0xb74e82[_0x3626('0x36')]);_0x32d718[_0x3626('0x37')]=_[_0x3626('0x38')](_0x32d718['model'],_0x32d718[_0x3626('0x36')]);_0x29bfb1[_0x3626('0x3a')]=_[_0x3626('0x38')](_0x32d718[_0x3626('0x35')],qs[_0x3626('0x39')](_0xb74e82['query'][_0x3626('0x39')]));_0x29bfb1[_0x3626('0x3a')]=_0x29bfb1[_0x3626('0x3a')][_0x3626('0x3b')]?_0x29bfb1[_0x3626('0x3a')]:_0x32d718[_0x3626('0x35')];if(_0xb74e82[_0x3626('0x36')][_0x3626('0x44')]){_0x29bfb1[_0x3626('0x45')]=[{'all':!![]}];}_0x29bfb1=_[_0x3626('0x40')]({},_0x29bfb1,_0xb74e82[_0x3626('0x43')]);return db[_0x3626('0x31')]['find'](_0x29bfb1)['then'](handleEntityNotFound(_0x4f4655,null))[_0x3626('0x27')](respondWithResult(_0x4f4655,null))['catch'](handleError(_0x4f4655,null));};exports['create']=function(_0x29584d,_0x2d067f){return db[_0x3626('0x31')][_0x3626('0x49')](_0x29584d['body'],{})[_0x3626('0x27')](function(_0xe6547c){var _0x601b84=_0x29584d[_0x3626('0x4a')][_0x3626('0x29')]({'plain':!![]});if(!_0x601b84)throw new Error(_0x3626('0x4b'));if(_0x601b84[_0x3626('0x4c')]===_0x3626('0x4a')){var _0x4d38e5=_0xe6547c['get']({'plain':!![]});var _0x3f3443=_0x3626('0x2a');return db[_0x3626('0x4d')]['find']({'where':{'name':_0x3f3443,'userProfileId':_0x601b84[_0x3626('0x4e')]},'raw':!![]})[_0x3626('0x27')](function(_0x5bd6c8){if(_0x5bd6c8&&_0x5bd6c8[_0x3626('0x4f')]===0x0){return db['UserProfileResource'][_0x3626('0x49')]({'name':_0x4d38e5['name'],'resourceId':_0x4d38e5['id'],'type':_0x5bd6c8[_0x3626('0x2d')],'sectionId':_0x5bd6c8['id']},{})[_0x3626('0x27')](function(){return _0xe6547c;});}else{return _0xe6547c;}})[_0x3626('0x48')](function(_0x4cbdee){logger[_0x3626('0x2c')](_0x3626('0x50'),_0x4cbdee);throw _0x4cbdee;});}return _0xe6547c;})[_0x3626('0x27')](respondWithResult(_0x2d067f,0xc9))[_0x3626('0x48')](handleError(_0x2d067f,null));};exports[_0x3626('0x26')]=function(_0x41777b,_0x48a87b){if(_0x41777b[_0x3626('0x51')]['id']){delete _0x41777b[_0x3626('0x51')]['id'];}return db[_0x3626('0x31')][_0x3626('0x52')]({'where':{'id':_0x41777b[_0x3626('0x53')]['id']}})[_0x3626('0x27')](handleEntityNotFound(_0x48a87b,null))[_0x3626('0x27')](saveUpdates(_0x41777b[_0x3626('0x51')],null))[_0x3626('0x27')](respondWithResult(_0x48a87b,null))[_0x3626('0x48')](handleError(_0x48a87b,null));};exports[_0x3626('0x28')]=function(_0x5cb060,_0x364e87){return db[_0x3626('0x31')]['find']({'where':{'id':_0x5cb060[_0x3626('0x53')]['id']}})[_0x3626('0x27')](handleEntityNotFound(_0x364e87,null))[_0x3626('0x27')](removeEntity(_0x364e87,null))[_0x3626('0x48')](handleError(_0x364e87,null));};exports['describe']=function(_0x2b74ac,_0xadb1f){return db[_0x3626('0x31')][_0x3626('0x54')]()[_0x3626('0x27')](respondWithResult(_0xadb1f,null))[_0x3626('0x48')](handleError(_0xadb1f,null));};exports[_0x3626('0x55')]=function(_0x3e43aa,_0xa86480,_0x1dc7fa){if(_0x3e43aa[_0x3626('0x51')]['id']){delete _0x3e43aa[_0x3626('0x51')]['id'];}return db[_0x3626('0x31')][_0x3626('0x52')]({'where':{'id':_0x3e43aa[_0x3626('0x53')]['id']}})['then'](handleEntityNotFound(_0xa86480,null))[_0x3626('0x27')](function(_0xf6d226){if(_0xf6d226){_0x3e43aa['body'][_0x3626('0x56')]=_0xf6d226['id'];return db[_0x3626('0x57')][_0x3626('0x49')](_0x3e43aa[_0x3626('0x51')]);}})[_0x3626('0x27')](respondWithResult(_0xa86480,null))[_0x3626('0x48')](handleError(_0xa86480,null));};exports[_0x3626('0x58')]=function(_0x19e7a6,_0x35d263,_0xc1cbe6){var _0xdbf8ac={'raw':![],'where':{}};var _0xb878a1={};var _0x44c533={'count':0x0,'rows':[]};return db[_0x3626('0x31')]['findOne']({'where':{'id':_0x19e7a6['params']['id']}})['then'](handleEntityNotFound(_0x35d263,null))[_0x3626('0x27')](function(_0x13e6f4){if(_0x13e6f4){_0xb878a1[_0x3626('0x35')]=_[_0x3626('0x59')](db[_0x3626('0x57')][_0x3626('0x32')]);_0xb878a1[_0x3626('0x36')]=_['keys'](_0x19e7a6[_0x3626('0x36')]);_0xb878a1[_0x3626('0x37')]=_[_0x3626('0x38')](_0xb878a1[_0x3626('0x35')],_0xb878a1[_0x3626('0x36')]);_0xdbf8ac[_0x3626('0x3a')]=_[_0x3626('0x38')](_0xb878a1[_0x3626('0x35')],qs[_0x3626('0x39')](_0x19e7a6[_0x3626('0x36')][_0x3626('0x39')]));_0xdbf8ac[_0x3626('0x3a')]=_0xdbf8ac[_0x3626('0x3a')][_0x3626('0x3b')]?_0xdbf8ac['attributes']:_0xb878a1[_0x3626('0x35')];if(!_0x19e7a6[_0x3626('0x36')][_0x3626('0x5a')](_0x3626('0x3c'))){_0xdbf8ac[_0x3626('0x20')]=qs['limit'](_0x19e7a6[_0x3626('0x36')][_0x3626('0x20')]);_0xdbf8ac[_0x3626('0x1f')]=qs[_0x3626('0x1f')](_0x19e7a6[_0x3626('0x36')]['offset']);}_0xdbf8ac['order']=qs[_0x3626('0x3e')](_0x19e7a6[_0x3626('0x36')]['sort']);_0xdbf8ac[_0x3626('0x3f')]=qs[_0x3626('0x37')](_['pick'](_0x19e7a6['query'],_0xb878a1[_0x3626('0x37')]));_0xdbf8ac['where'][_0x3626('0x56')]=_0x13e6f4['id'];if(_0x19e7a6['query'][_0x3626('0x42')]){_0xdbf8ac[_0x3626('0x3f')]=_['merge'](_0xdbf8ac[_0x3626('0x3f')],{'$or':_[_0x3626('0x30')](_0xdbf8ac['attributes'],function(_0x50f689){var _0x2ab999={};_0x2ab999[_0x50f689]={'$like':'%'+_0x19e7a6['query']['filter']+'%'};return _0x2ab999;})});}_0xdbf8ac=_[_0x3626('0x40')]({},_0xdbf8ac,_0x19e7a6[_0x3626('0x43')]);return db['Disposition'][_0x3626('0x1e')]({'where':_0xdbf8ac[_0x3626('0x3f')]})[_0x3626('0x27')](function(_0x29c935){_0x44c533[_0x3626('0x1e')]=_0x29c935;if(_0x19e7a6[_0x3626('0x36')]['includeAll']){_0xdbf8ac[_0x3626('0x45')]=[{'all':!![]}];}return db[_0x3626('0x57')][_0x3626('0x46')](_0xdbf8ac);})['then'](function(_0x24a1ad){_0x44c533[_0x3626('0x47')]=_0x24a1ad;return _0x44c533;});}})[_0x3626('0x27')](respondWithFilteredResult(_0x35d263,_0xdbf8ac))[_0x3626('0x48')](handleError(_0x35d263,null));};exports['removeDispositions']=function(_0x15061d,_0x2f8e3b,_0x1f9461){return db['CmList'][_0x3626('0x52')]({'where':{'id':_0x15061d['params']['id']}})[_0x3626('0x27')](handleEntityNotFound(_0x2f8e3b,null))[_0x3626('0x27')](function(_0x1ee045){if(_0x1ee045){return _0x1ee045['removeDispositions'](_0x15061d[_0x3626('0x36')]['ids']);}})[_0x3626('0x27')](respondWithStatusCode(_0x2f8e3b,null))['catch'](handleError(_0x2f8e3b,null));};exports[_0x3626('0x5b')]=function(_0x2aa8a9,_0x565c45,_0x1f2927){return db['CmList'][_0x3626('0x52')]({'where':{'id':_0x2aa8a9['params']['id']}})['then'](handleEntityNotFound(_0x565c45,null))[_0x3626('0x27')](function(_0x232ef6){if(_0x232ef6){var _0xbb1e1=[];var _0x4a205c={'success':[],'errors':[]};return db[_0x3626('0x5c')][_0x3626('0x54')]()['then'](function(_0x44850c){if(_0x2aa8a9[_0x3626('0x51')][_0x3626('0x5d')]&&_['isArray'](_0x2aa8a9[_0x3626('0x51')][_0x3626('0x5d')])){if(_0x2aa8a9['body'][_0x3626('0x5d')][_0x3626('0x3b')]){_0x2aa8a9[_0x3626('0x51')][_0x3626('0x5d')]=_0x2aa8a9['body'][_0x3626('0x5d')]['join'](';')+';';}else{_0x2aa8a9['body']['tags']=null;}}else{_0x2aa8a9[_0x3626('0x51')][_0x3626('0x5d')]=null;}if(_0x2aa8a9[_0x3626('0x51')]&&_[_0x3626('0x5e')](_0x2aa8a9[_0x3626('0x51')])){for(var _0x476a95=0x0;_0x476a95<_0x2aa8a9[_0x3626('0x51')][_0x3626('0x3b')];_0x476a95+=0x1){_0x2aa8a9[_0x3626('0x51')][_0x476a95][_0x3626('0x56')]=_0x2aa8a9[_0x3626('0x53')]['id'];_0xbb1e1[_0x3626('0x5f')](_0x2aa8a9[_0x3626('0x51')][_0x476a95]);}return BPromise[_0x3626('0x60')](_0xbb1e1,function(_0x30103e){return db['CmContact'][_0x3626('0x49')](_[_0x3626('0x61')](_0x30103e,[_0x3626('0x62'),'id'])||{},{'fields':_['keys'](_0x44850c),'raw':!![]})[_0x3626('0x27')](function(_0x2f62d3){_0x4a205c['success'][_0x3626('0x5f')](_0x2f62d3['dataValues']);})[_0x3626('0x48')](function(_0x570054){_0x4a205c['errors']['push']({'data':_0x30103e,'error':_0x570054[_0x3626('0x63')]});});})[_0x3626('0x27')](function(_0x5a9f80){return _0x4a205c;})[_0x3626('0x48')](function(_0x1e897f){return _0x1e897f;});}else{_0x565c45[_0x3626('0x1d')](0x190)[_0x3626('0x64')]({'message':_0x3626('0x65')});}});}})['then'](respondWithResult(_0x565c45,null))[_0x3626('0x48')](handleError(_0x565c45,null));};exports[_0x3626('0x66')]=function(_0x127c17,_0x3ce993,_0xb76f08){var _0x4e9d68;return db[_0x3626('0x31')]['find']({'where':{'id':_0x127c17[_0x3626('0x53')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0x3626('0x27')](handleEntityNotFound(_0x3ce993,null))[_0x3626('0x27')](function(_0x326d63){if(_0x326d63){_0x4e9d68=_0x326d63;return db[_0x3626('0x5c')][_0x3626('0x32')];}})[_0x3626('0x27')](function(_0x4ff2b2){if(_0x4ff2b2){var _0x11f205={};var _0x180a5a={};_0x180a5a[_0x3626('0x35')]=_[_0x3626('0x67')](_[_0x3626('0x59')](_0x4ff2b2),_[_0x3626('0x30')](_0x4e9d68['CustomFields'],function(_0xbe353a){return util[_0x3626('0x68')](_0x3626('0x69'),_0xbe353a['id']);}));_0x180a5a[_0x3626('0x36')]=_[_0x3626('0x59')](_0x127c17['query']);_0x180a5a[_0x3626('0x37')]=_[_0x3626('0x38')](_0x180a5a['model'],_0x180a5a[_0x3626('0x36')]);_0x11f205[_0x3626('0x3a')]=_[_0x3626('0x38')](_0x180a5a[_0x3626('0x35')],qs[_0x3626('0x39')](_0x127c17[_0x3626('0x36')][_0x3626('0x39')]));_0x11f205[_0x3626('0x3a')]=_0x11f205['attributes']['length']?_0x11f205[_0x3626('0x3a')]:_0x180a5a[_0x3626('0x35')];if(!_0x127c17[_0x3626('0x36')][_0x3626('0x5a')]('nolimit')){_0x11f205['limit']=qs[_0x3626('0x20')](_0x127c17[_0x3626('0x36')][_0x3626('0x20')]);_0x11f205['offset']=qs[_0x3626('0x1f')](_0x127c17['query'][_0x3626('0x1f')]);}_0x11f205['order']=qs[_0x3626('0x3e')](_0x127c17[_0x3626('0x36')][_0x3626('0x3e')]);_0x11f205['where']=qs[_0x3626('0x37')](_['pick'](_0x127c17[_0x3626('0x36')],_0x180a5a[_0x3626('0x37')]));_0x11f205[_0x3626('0x6a')]=!![];if(_0x127c17[_0x3626('0x36')]['filter']){_0x11f205[_0x3626('0x3f')]=_[_0x3626('0x40')](_0x11f205[_0x3626('0x3f')],{'$or':_[_0x3626('0x30')](_0x11f205['attributes'],function(_0x3f86e4){var _0x377fb8={};_0x377fb8[_0x3f86e4]={'$like':'%'+_0x127c17[_0x3626('0x36')]['filter']+'%'};return _0x377fb8;})});}_0x11f205=_['merge']({},_0x11f205,_0x127c17[_0x3626('0x43')]);return _0x4e9d68[_0x3626('0x66')](_0x11f205);}})[_0x3626('0x27')](respondWithResult(_0x3ce993,null))[_0x3626('0x48')](handleError(_0x3ce993,null));};exports[_0x3626('0x6b')]=function(_0x2c2f06,_0x2542f9,_0x5800d8){var _0x29ef80;return db[_0x3626('0x31')][_0x3626('0x52')]({'where':{'id':_0x2c2f06[_0x3626('0x53')]['id']},'include':[{'model':db[_0x3626('0x6c')],'as':'CustomFields'}]})[_0x3626('0x27')](handleEntityNotFound(_0x2542f9,null))[_0x3626('0x27')](function(_0x112b3d){if(_0x112b3d){_0x29ef80=_0x112b3d;return db[_0x3626('0x5c')][_0x3626('0x32')];}})[_0x3626('0x27')](function(_0x1904a2){if(_0x1904a2){var _0x45a0fd={};var _0xb15bdc={};_0xb15bdc[_0x3626('0x35')]=_[_0x3626('0x67')](_[_0x3626('0x59')](_0x1904a2),_[_0x3626('0x30')](_0x29ef80[_0x3626('0x6d')],function(_0xe5d4d6){return util[_0x3626('0x68')](_0x3626('0x69'),_0xe5d4d6['id']);}));_0xb15bdc[_0x3626('0x36')]=_[_0x3626('0x59')](_0x2c2f06[_0x3626('0x36')]);_0xb15bdc[_0x3626('0x37')]=_[_0x3626('0x38')](_0xb15bdc[_0x3626('0x35')],_0xb15bdc[_0x3626('0x36')]);_0x45a0fd[_0x3626('0x3a')]=_[_0x3626('0x38')](_0xb15bdc['model'],qs[_0x3626('0x39')](_0x2c2f06['query']['fields']));_0x45a0fd[_0x3626('0x3a')]=_0x45a0fd[_0x3626('0x3a')]['length']?_0x45a0fd[_0x3626('0x3a')]:_0xb15bdc[_0x3626('0x35')];if(!_0x2c2f06[_0x3626('0x36')][_0x3626('0x5a')](_0x3626('0x3c'))){_0x45a0fd[_0x3626('0x20')]=qs['limit'](_0x2c2f06[_0x3626('0x36')][_0x3626('0x20')]);_0x45a0fd[_0x3626('0x1f')]=qs[_0x3626('0x1f')](_0x2c2f06[_0x3626('0x36')]['offset']);}_0x45a0fd[_0x3626('0x3d')]=qs[_0x3626('0x3e')](_0x2c2f06[_0x3626('0x36')][_0x3626('0x3e')]);_0x45a0fd[_0x3626('0x3f')]=qs[_0x3626('0x37')](_[_0x3626('0x6e')](_0x2c2f06['query'],_0xb15bdc['filters']));_0x45a0fd[_0x3626('0x6a')]=!![];if(_0x2c2f06[_0x3626('0x36')][_0x3626('0x42')]){_0x45a0fd[_0x3626('0x3f')]=_[_0x3626('0x40')](_0x45a0fd['where'],{'$or':_[_0x3626('0x30')](_0x45a0fd[_0x3626('0x3a')],function(_0x429612){var _0x56352c={};_0x56352c[_0x429612]={'$like':'%'+_0x2c2f06[_0x3626('0x36')][_0x3626('0x42')]+'%'};return _0x56352c;})});}_0x45a0fd=_[_0x3626('0x40')]({},_0x45a0fd,_0x2c2f06['options']);return _0x29ef80[_0x3626('0x66')](_0x45a0fd);}})[_0x3626('0x27')](function(_0x259d07){if(!_['isEmpty'](_0x259d07)){var _0x57f318=toCsv(_0x259d07);var _0x35d713=Date[_0x3626('0x6f')]();fs[_0x3626('0x70')](util[_0x3626('0x68')]('/tmp/list_%d_%s.csv',_0x29ef80['id'],_0x35d713),_0x57f318);_0x2542f9[_0x3626('0x71')]('Content-disposition',_0x3626('0x72')+util[_0x3626('0x68')](_0x3626('0x73'),_0x29ef80['id'],_0x35d713));_0x2542f9['setHeader'](_0x3626('0x74'),_0x3626('0x75'));return _0x2542f9[_0x3626('0x76')](util['format'](_0x3626('0x77'),_0x29ef80['id'],_0x35d713));}else{return _0x2542f9[_0x3626('0x1b')](0xcc);}})[_0x3626('0x48')](handleError(_0x2542f9,null));};exports['addCustomField']=function(_0x4c6188,_0x3aa678,_0x19560){var _0xeceaae;delete _0x4c6188['body']['id'];return db[_0x3626('0x31')]['findOne']({'where':{'id':_0x4c6188[_0x3626('0x53')]['id']}})['then'](handleEntityNotFound(_0x3aa678,null))[_0x3626('0x27')](function(_0x4cbf5d){if(_0x4cbf5d){return db[_0x3626('0x78')][_0x3626('0x79')](function(_0x21d51d){return db[_0x3626('0x6c')][_0x3626('0x49')](_0x4c6188[_0x3626('0x51')],{'transaction':_0x21d51d})[_0x3626('0x27')](function(_0x306d01){_0xeceaae=_0x306d01;return _0x4cbf5d['addCustomFields'](_0x306d01,{'transaction':_0x21d51d});})[_0x3626('0x27')](function(){var _0x22e182={'type':db[_0x3626('0x7a')][_0x3626('0x7b')],'transaction':_0x21d51d};switch(_0x4c6188[_0x3626('0x51')][_0x3626('0x33')]){case _0x3626('0x7c'):_0x22e182[_0x3626('0x33')]=db[_0x3626('0x7a')][_0x3626('0x7b')];break;case _0x3626('0x7d'):_0x22e182['type']=db[_0x3626('0x7a')]['INTEGER'];break;case _0x3626('0x7e'):_0x22e182[_0x3626('0x33')]=db['Sequelize'][_0x3626('0x7f')];_0x22e182[_0x3626('0x80')]=![];break;default:}return db[_0x3626('0x78')][_0x3626('0x81')][_0x3626('0x82')]('cm_contacts',util[_0x3626('0x68')]('cf_%s',_0xeceaae['id']),_0x22e182);})['then'](function(){return _0xeceaae;});});}})[_0x3626('0x27')](respondWithResult(_0x3aa678,null))['catch'](handleError(_0x3aa678,null));};exports[_0x3626('0x83')]=function(_0x4e91a1,_0x3511e0,_0x5ddae0){var _0x57d6eb={};var _0x47999f={};var _0x370a1b;var _0x135239;return db[_0x3626('0x31')][_0x3626('0x84')]({'where':{'id':_0x4e91a1['params']['id']}})[_0x3626('0x27')](handleEntityNotFound(_0x3511e0,null))[_0x3626('0x27')](function(_0x304934){if(_0x304934){_0x370a1b=_0x304934;_0x47999f[_0x3626('0x35')]=_[_0x3626('0x59')](db[_0x3626('0x6c')][_0x3626('0x32')]);_0x47999f[_0x3626('0x36')]=_['keys'](_0x4e91a1[_0x3626('0x36')]);_0x47999f[_0x3626('0x37')]=_['intersection'](_0x47999f[_0x3626('0x35')],_0x47999f[_0x3626('0x36')]);_0x57d6eb[_0x3626('0x3a')]=_[_0x3626('0x38')](_0x47999f[_0x3626('0x35')],qs[_0x3626('0x39')](_0x4e91a1[_0x3626('0x36')]['fields']));_0x57d6eb[_0x3626('0x3a')]=_0x57d6eb[_0x3626('0x3a')]['length']?_0x57d6eb[_0x3626('0x3a')]:_0x47999f[_0x3626('0x35')];_0x57d6eb['order']=qs[_0x3626('0x3e')](_0x4e91a1[_0x3626('0x36')][_0x3626('0x3e')]);_0x57d6eb['where']=qs['filters'](_[_0x3626('0x6e')](_0x4e91a1['query'],_0x47999f[_0x3626('0x37')]));_0x57d6eb[_0x3626('0x3f')]=_[_0x3626('0x40')](_0x57d6eb[_0x3626('0x3f')],{'$or':[{'ListId':_0x304934['id']},{'ListId':null}]});if(_0x4e91a1['query'][_0x3626('0x42')]){_0x57d6eb[_0x3626('0x3f')]=_[_0x3626('0x40')](_0x57d6eb[_0x3626('0x3f')],{'$or':_[_0x3626('0x30')](_0x57d6eb[_0x3626('0x3a')],function(_0x64f6d8){var _0x129045={};_0x129045[_0x64f6d8]={'$like':'%'+_0x4e91a1[_0x3626('0x36')][_0x3626('0x42')]+'%'};return _0x129045;})});}_0x57d6eb=_[_0x3626('0x40')]({},_0x57d6eb,_0x4e91a1[_0x3626('0x43')]);return db[_0x3626('0x6c')][_0x3626('0x85')](_0x57d6eb);}})['then'](respondWithResult(_0x3511e0,null))[_0x3626('0x48')](handleError(_0x3511e0,null));};exports[_0x3626('0x86')]=function(_0x25661b,_0x5b304e,_0xadee1b){return db[_0x3626('0x31')][_0x3626('0x52')]({'where':{'id':_0x25661b['params']['id']}})[_0x3626('0x27')](handleEntityNotFound(_0x5b304e,null))[_0x3626('0x27')](function(_0x3bfa7a){if(_0x3bfa7a){return _0x3bfa7a[_0x3626('0x86')](_0x25661b[_0x3626('0x51')][_0x3626('0x62')],_['omit'](_0x25661b['body'],[_0x3626('0x62'),'id'])||{})[_0x3626('0x87')](function(_0x158288){for(var _0x54832c=0x0;_0x54832c<_0x25661b[_0x3626('0x51')][_0x3626('0x62')][_0x3626('0x3b')];_0x54832c+=0x1){socket['emit'](_0x3626('0x88'),{'UserId':_0x25661b[_0x3626('0x51')][_0x3626('0x62')][_0x54832c],'CmListId':_0x25661b['params']['id']});}return _0x158288;});}})[_0x3626('0x27')](respondWithResult(_0x5b304e,null))[_0x3626('0x48')](handleError(_0x5b304e,null));};exports[_0x3626('0x89')]=function(_0x4dbd66,_0x414c10,_0x265bf0){return db[_0x3626('0x31')]['find']({'where':{'id':_0x4dbd66[_0x3626('0x53')]['id']}})[_0x3626('0x27')](handleEntityNotFound(_0x414c10,null))['then'](function(_0x13c5a7){if(_0x13c5a7){return _0x13c5a7['removeAgents'](_0x4dbd66['query']['ids'])[_0x3626('0x27')](function(){if(_[_0x3626('0x5e')](_0x4dbd66[_0x3626('0x36')]['ids'])){for(var _0x250ec8=0x0;_0x250ec8<_0x4dbd66['query'][_0x3626('0x62')]['length'];_0x250ec8+=0x1){socket[_0x3626('0x8a')](_0x3626('0x8b'),{'UserId':Number(_0x4dbd66[_0x3626('0x36')]['ids'][_0x250ec8]),'CmListId':Number(_0x4dbd66[_0x3626('0x53')]['id'])});}}else{socket['emit']('userCmList:remove',{'UserId':Number(_0x4dbd66[_0x3626('0x36')][_0x3626('0x62')]),'CmListId':Number(_0x4dbd66[_0x3626('0x53')]['id'])});}});}})[_0x3626('0x27')](respondWithStatusCode(_0x414c10,null))[_0x3626('0x48')](handleError(_0x414c10,null));};exports[_0x3626('0x8c')]=function(_0x227892,_0x38a241,_0x27fddb){var _0x3b669c={};var _0x19f0a8={};var _0x32c7dd;var _0x297aa5;return db[_0x3626('0x31')][_0x3626('0x84')]({'where':{'id':_0x227892['params']['id']}})[_0x3626('0x27')](handleEntityNotFound(_0x38a241,null))['then'](function(_0x321bdc){if(_0x321bdc){_0x32c7dd=_0x321bdc;_0x19f0a8['model']=_[_0x3626('0x59')](db[_0x3626('0x8d')][_0x3626('0x32')]);_0x19f0a8[_0x3626('0x36')]=_[_0x3626('0x59')](_0x227892[_0x3626('0x36')]);_0x19f0a8[_0x3626('0x37')]=_[_0x3626('0x38')](_0x19f0a8[_0x3626('0x35')],_0x19f0a8[_0x3626('0x36')]);_0x3b669c[_0x3626('0x3a')]=_[_0x3626('0x38')](_0x19f0a8[_0x3626('0x35')],qs[_0x3626('0x39')](_0x227892[_0x3626('0x36')][_0x3626('0x39')]));_0x3b669c['attributes']=_0x3b669c[_0x3626('0x3a')]['length']?_0x3b669c[_0x3626('0x3a')]:_0x19f0a8[_0x3626('0x35')];_0x3b669c[_0x3626('0x3d')]=qs[_0x3626('0x3e')](_0x227892[_0x3626('0x36')][_0x3626('0x3e')]);_0x3b669c['where']=qs['filters'](_[_0x3626('0x6e')](_0x227892['query'],_0x19f0a8[_0x3626('0x37')]));if(_0x227892[_0x3626('0x36')][_0x3626('0x42')]){_0x3b669c[_0x3626('0x3f')]=_[_0x3626('0x40')](_0x3b669c['where'],{'$or':_[_0x3626('0x30')](_0x3b669c['attributes'],function(_0x10d96a){var _0xa1ff57={};_0xa1ff57[_0x10d96a]={'$like':'%'+_0x227892[_0x3626('0x36')][_0x3626('0x42')]+'%'};return _0xa1ff57;})});}_0x3b669c=_[_0x3626('0x40')]({},_0x3b669c,_0x227892[_0x3626('0x43')]);return _0x32c7dd[_0x3626('0x8c')](_0x3b669c);}})['then'](function(_0x593224){if(_0x593224){_0x297aa5=_0x593224[_0x3626('0x3b')];if(!_0x227892[_0x3626('0x36')][_0x3626('0x5a')](_0x3626('0x3c'))){_0x3b669c[_0x3626('0x20')]=qs[_0x3626('0x20')](_0x227892[_0x3626('0x36')][_0x3626('0x20')]);_0x3b669c[_0x3626('0x1f')]=qs['offset'](_0x227892[_0x3626('0x36')][_0x3626('0x1f')]);}return _0x32c7dd[_0x3626('0x8c')](_0x3b669c);}})['then'](function(_0x19ff73){if(_0x19ff73){return _0x19ff73?{'count':_0x297aa5,'rows':_0x19ff73}:null;}})[_0x3626('0x27')](respondWithResult(_0x38a241,null))[_0x3626('0x48')](handleError(_0x38a241,null));}; \ No newline at end of file +var _0xc7ab=['then','destroy','get','Lists','error','name','send','index','CmList','rawAttributes','type','map','query','keys','filters','model','attributes','intersection','fields','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','params','describe','addDisposition','ListId','getDispositions','findOne','Disposition','hasOwnProperty','include','removeDispositions','ids','addContacts','CmContact','tags','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','getContacts','concat','format','cf_%d','CustomFields','raw','isEmpty','now','Content-disposition','attachment;\x20filename=','list_%d_%s.csv','Content-type','text/csv','download','/tmp/list_%d_%s.csv','addCustomField','sequelize','transaction','CmCustomField','Sequelize','TEXT','number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','getCustomFields','addAgents','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','./cmList.socket','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update'];(function(_0xfca4a,_0x5a0d74){var _0x4a4976=function(_0x15243e){while(--_0x15243e){_0xfca4a['push'](_0xfca4a['shift']());}};_0x4a4976(++_0x5a0d74);}(_0xc7ab,0x183));var _0xbc7a=function(_0x492931,_0x238f6f){_0x492931=_0x492931-0x0;var _0x48cb87=_0xc7ab[_0x492931];return _0x48cb87;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xbc7a('0x0'));var zipdir=require(_0xbc7a('0x1'));var jsonpatch=require(_0xbc7a('0x2'));var rp=require(_0xbc7a('0x3'));var moment=require('moment');var BPromise=require(_0xbc7a('0x4'));var Mustache=require('mustache');var util=require(_0xbc7a('0x5'));var path=require(_0xbc7a('0x6'));var sox=require(_0xbc7a('0x7'));var csv=require(_0xbc7a('0x8'));var ejs=require(_0xbc7a('0x9'));var fs=require('fs');var _=require(_0xbc7a('0xa'));var squel=require(_0xbc7a('0xb'));var crypto=require(_0xbc7a('0xc'));var jsforce=require(_0xbc7a('0xd'));var deskjs=require(_0xbc7a('0xe'));var toCsv=require(_0xbc7a('0x8'));var querystring=require(_0xbc7a('0xf'));var Papa=require(_0xbc7a('0x10'));var Redis=require(_0xbc7a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbc7a('0x12'));var as=require(_0xbc7a('0x13'));var hardwareService=require(_0xbc7a('0x14'));var logger=require(_0xbc7a('0x15'))(_0xbc7a('0x16'));var utils=require('../../config/utils');var config=require(_0xbc7a('0x17'));var db=require(_0xbc7a('0x18'))['db'];config['redis']=_[_0xbc7a('0x19')](config[_0xbc7a('0x1a')],{'host':_0xbc7a('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbc7a('0x1a')]));require(_0xbc7a('0x1c'))['register'](socket);function respondWithStatusCode(_0x10f0f1,_0x5da540){_0x5da540=_0x5da540||0xcc;return function(_0x2eda3b){if(_0x2eda3b){return _0x10f0f1[_0xbc7a('0x1d')](_0x5da540);}return _0x10f0f1[_0xbc7a('0x1e')](_0x5da540)[_0xbc7a('0x1f')]();};}function respondWithResult(_0x107526,_0x19c81e){_0x19c81e=_0x19c81e||0xc8;return function(_0x4a2fe5){if(_0x4a2fe5){return _0x107526[_0xbc7a('0x1e')](_0x19c81e)[_0xbc7a('0x20')](_0x4a2fe5);}};}function respondWithFilteredResult(_0x20e604,_0x46ece6){return function(_0x21c6bf){if(_0x21c6bf){var _0x8d7b32=_0x21c6bf['count'],_0x21a3d5=_0x46ece6[_0xbc7a('0x21')],_0x574d3a=_0x46ece6[_0xbc7a('0x21')]+_0x46ece6[_0xbc7a('0x22')],_0x54acfe;if(_0x574d3a>=_0x8d7b32){_0x574d3a=_0x8d7b32;_0x54acfe=0xc8;}else{_0x54acfe=0xce;}_0x20e604[_0xbc7a('0x1e')](_0x54acfe);return _0x20e604[_0xbc7a('0x23')](_0xbc7a('0x24'),_0x21a3d5+'-'+_0x574d3a+'/'+_0x8d7b32)[_0xbc7a('0x20')](_0x21c6bf);}return null;};}function patchUpdates(_0x51cdac){return function(_0x17dfd4){try{jsonpatch[_0xbc7a('0x25')](_0x17dfd4,_0x51cdac,!![]);}catch(_0x5f502b){return BPromise['reject'](_0x5f502b);}return _0x17dfd4['save']();};}function saveUpdates(_0x1b1bbe,_0xfa0d9b){return function(_0xae40a8){if(_0xae40a8){return _0xae40a8[_0xbc7a('0x26')](_0x1b1bbe)[_0xbc7a('0x27')](function(_0x1aee04){return _0x1aee04;});}return null;};}function removeEntity(_0x300ea6,_0x572fb0){return function(_0x1fef83){if(_0x1fef83){return _0x1fef83[_0xbc7a('0x28')]()[_0xbc7a('0x27')](function(){var _0xf4bc8c=_0x1fef83[_0xbc7a('0x29')]({'plain':!![]});var _0x2388fd=_0xbc7a('0x2a');return db['UserProfileResource'][_0xbc7a('0x28')]({'where':{'type':_0x2388fd,'resourceId':_0xf4bc8c['id']}})[_0xbc7a('0x27')](function(){return _0x1fef83;});})[_0xbc7a('0x27')](function(){_0x300ea6['status'](0xcc)[_0xbc7a('0x1f')]();});}};}function handleEntityNotFound(_0x45ae73,_0x4f4837){return function(_0x538e36){if(!_0x538e36){_0x45ae73[_0xbc7a('0x1d')](0x194);}return _0x538e36;};}function handleError(_0x52bdf9,_0x3f4eae){_0x3f4eae=_0x3f4eae||0x1f4;return function(_0x1ec4a1){logger[_0xbc7a('0x2b')](_0x1ec4a1['stack']);if(_0x1ec4a1[_0xbc7a('0x2c')]){delete _0x1ec4a1['name'];}_0x52bdf9[_0xbc7a('0x1e')](_0x3f4eae)[_0xbc7a('0x2d')](_0x1ec4a1);};}exports[_0xbc7a('0x2e')]=function(_0x447bdf,_0xaa5313){var _0x2839ab={},_0xd501f3={},_0x3d0965={'count':0x0,'rows':[]};var _0x2c2d51=_['map'](db[_0xbc7a('0x2f')][_0xbc7a('0x30')],function(_0x1523ce){return{'name':_0x1523ce['fieldName'],'type':_0x1523ce[_0xbc7a('0x31')]['key']};});_0xd501f3['model']=_[_0xbc7a('0x32')](_0x2c2d51,_0xbc7a('0x2c'));_0xd501f3[_0xbc7a('0x33')]=_[_0xbc7a('0x34')](_0x447bdf[_0xbc7a('0x33')]);_0xd501f3[_0xbc7a('0x35')]=_['intersection'](_0xd501f3[_0xbc7a('0x36')],_0xd501f3[_0xbc7a('0x33')]);_0x2839ab[_0xbc7a('0x37')]=_[_0xbc7a('0x38')](_0xd501f3[_0xbc7a('0x36')],qs['fields'](_0x447bdf[_0xbc7a('0x33')][_0xbc7a('0x39')]));_0x2839ab[_0xbc7a('0x37')]=_0x2839ab[_0xbc7a('0x37')]['length']?_0x2839ab[_0xbc7a('0x37')]:_0xd501f3[_0xbc7a('0x36')];if(!_0x447bdf[_0xbc7a('0x33')]['hasOwnProperty'](_0xbc7a('0x3a'))){_0x2839ab['limit']=qs[_0xbc7a('0x22')](_0x447bdf[_0xbc7a('0x33')]['limit']);_0x2839ab[_0xbc7a('0x21')]=qs[_0xbc7a('0x21')](_0x447bdf[_0xbc7a('0x33')][_0xbc7a('0x21')]);}_0x2839ab[_0xbc7a('0x3b')]=qs[_0xbc7a('0x3c')](_0x447bdf['query'][_0xbc7a('0x3c')]);_0x2839ab[_0xbc7a('0x3d')]=qs['filters'](_[_0xbc7a('0x3e')](_0x447bdf['query'],_0xd501f3[_0xbc7a('0x35')]));if(_0x447bdf[_0xbc7a('0x33')][_0xbc7a('0x3f')]){_0x2839ab[_0xbc7a('0x3d')]=_[_0xbc7a('0x40')](_0x2839ab[_0xbc7a('0x3d')],{'$or':_[_0xbc7a('0x32')](_0x2c2d51,function(_0x16f936){if(_0x16f936[_0xbc7a('0x31')]!==_0xbc7a('0x41')){var _0xee6fb2={};_0xee6fb2[_0x16f936[_0xbc7a('0x2c')]]={'$like':'%'+_0x447bdf[_0xbc7a('0x33')][_0xbc7a('0x3f')]+'%'};return _0xee6fb2;}})});}_0x2839ab=_[_0xbc7a('0x40')]({},_0x2839ab,_0x447bdf['options']);var _0x51b0cc={'where':_0x2839ab[_0xbc7a('0x3d')]};return db[_0xbc7a('0x2f')][_0xbc7a('0x42')](_0x51b0cc)[_0xbc7a('0x27')](function(_0x1d59f5){_0x3d0965[_0xbc7a('0x42')]=_0x1d59f5;if(_0x447bdf['query'][_0xbc7a('0x43')]){_0x2839ab['include']=[{'all':!![]}];}return db[_0xbc7a('0x2f')][_0xbc7a('0x44')](_0x2839ab);})[_0xbc7a('0x27')](function(_0x5509b3){_0x3d0965[_0xbc7a('0x45')]=_0x5509b3;return _0x3d0965;})[_0xbc7a('0x27')](respondWithFilteredResult(_0xaa5313,_0x2839ab))[_0xbc7a('0x46')](handleError(_0xaa5313,null));};exports[_0xbc7a('0x47')]=function(_0x7c21a5,_0x16f3f0){var _0x12b59b={'raw':![],'where':{'id':_0x7c21a5['params']['id']}},_0xa362={};_0xa362['model']=_[_0xbc7a('0x34')](db[_0xbc7a('0x2f')][_0xbc7a('0x30')]);_0xa362[_0xbc7a('0x33')]=_[_0xbc7a('0x34')](_0x7c21a5[_0xbc7a('0x33')]);_0xa362[_0xbc7a('0x35')]=_['intersection'](_0xa362[_0xbc7a('0x36')],_0xa362[_0xbc7a('0x33')]);_0x12b59b[_0xbc7a('0x37')]=_[_0xbc7a('0x38')](_0xa362[_0xbc7a('0x36')],qs[_0xbc7a('0x39')](_0x7c21a5['query'][_0xbc7a('0x39')]));_0x12b59b[_0xbc7a('0x37')]=_0x12b59b[_0xbc7a('0x37')][_0xbc7a('0x48')]?_0x12b59b['attributes']:_0xa362[_0xbc7a('0x36')];if(_0x7c21a5[_0xbc7a('0x33')][_0xbc7a('0x43')]){_0x12b59b['include']=[{'all':!![]}];}_0x12b59b=_['merge']({},_0x12b59b,_0x7c21a5[_0xbc7a('0x49')]);return db[_0xbc7a('0x2f')]['find'](_0x12b59b)[_0xbc7a('0x27')](handleEntityNotFound(_0x16f3f0,null))[_0xbc7a('0x27')](respondWithResult(_0x16f3f0,null))[_0xbc7a('0x46')](handleError(_0x16f3f0,null));};exports[_0xbc7a('0x4a')]=function(_0x66ecf2,_0x320d22){return db[_0xbc7a('0x2f')]['create'](_0x66ecf2[_0xbc7a('0x4b')],{})[_0xbc7a('0x27')](function(_0x1153ba){var _0x2364e1=_0x66ecf2[_0xbc7a('0x4c')][_0xbc7a('0x29')]({'plain':!![]});if(!_0x2364e1)throw new Error(_0xbc7a('0x4d'));if(_0x2364e1['role']===_0xbc7a('0x4c')){var _0x39ced9=_0x1153ba[_0xbc7a('0x29')]({'plain':!![]});var _0x2eaa48=_0xbc7a('0x2a');return db[_0xbc7a('0x4e')]['find']({'where':{'name':_0x2eaa48,'userProfileId':_0x2364e1[_0xbc7a('0x4f')]},'raw':!![]})[_0xbc7a('0x27')](function(_0x41b9a2){if(_0x41b9a2&&_0x41b9a2[_0xbc7a('0x50')]===0x0){return db[_0xbc7a('0x51')][_0xbc7a('0x4a')]({'name':_0x39ced9['name'],'resourceId':_0x39ced9['id'],'type':_0x41b9a2[_0xbc7a('0x2c')],'sectionId':_0x41b9a2['id']},{})[_0xbc7a('0x27')](function(){return _0x1153ba;});}else{return _0x1153ba;}})[_0xbc7a('0x46')](function(_0x5264c6){logger[_0xbc7a('0x2b')](_0xbc7a('0x52'),_0x5264c6);throw _0x5264c6;});}return _0x1153ba;})[_0xbc7a('0x27')](respondWithResult(_0x320d22,0xc9))[_0xbc7a('0x46')](handleError(_0x320d22,null));};exports['update']=function(_0x58e5e3,_0x48db82){if(_0x58e5e3[_0xbc7a('0x4b')]['id']){delete _0x58e5e3[_0xbc7a('0x4b')]['id'];}return db['CmList'][_0xbc7a('0x53')]({'where':{'id':_0x58e5e3[_0xbc7a('0x54')]['id']}})[_0xbc7a('0x27')](handleEntityNotFound(_0x48db82,null))[_0xbc7a('0x27')](saveUpdates(_0x58e5e3['body'],null))[_0xbc7a('0x27')](respondWithResult(_0x48db82,null))['catch'](handleError(_0x48db82,null));};exports[_0xbc7a('0x28')]=function(_0x8902f3,_0x5ef48b){return db[_0xbc7a('0x2f')][_0xbc7a('0x53')]({'where':{'id':_0x8902f3[_0xbc7a('0x54')]['id']}})['then'](handleEntityNotFound(_0x5ef48b,null))[_0xbc7a('0x27')](removeEntity(_0x5ef48b,null))[_0xbc7a('0x46')](handleError(_0x5ef48b,null));};exports[_0xbc7a('0x55')]=function(_0x512e2d,_0x4f6252){return db[_0xbc7a('0x2f')]['describe']()[_0xbc7a('0x27')](respondWithResult(_0x4f6252,null))['catch'](handleError(_0x4f6252,null));};exports[_0xbc7a('0x56')]=function(_0x5df48f,_0x4b9708,_0x591357){if(_0x5df48f[_0xbc7a('0x4b')]['id']){delete _0x5df48f[_0xbc7a('0x4b')]['id'];}return db[_0xbc7a('0x2f')][_0xbc7a('0x53')]({'where':{'id':_0x5df48f[_0xbc7a('0x54')]['id']}})[_0xbc7a('0x27')](handleEntityNotFound(_0x4b9708,null))[_0xbc7a('0x27')](function(_0x494a09){if(_0x494a09){_0x5df48f['body'][_0xbc7a('0x57')]=_0x494a09['id'];return db['Disposition'][_0xbc7a('0x4a')](_0x5df48f['body']);}})['then'](respondWithResult(_0x4b9708,null))['catch'](handleError(_0x4b9708,null));};exports[_0xbc7a('0x58')]=function(_0x1b4f76,_0x4745a7,_0x53085c){var _0x34df66={'raw':![],'where':{}};var _0x2f316a={};var _0x599c63={'count':0x0,'rows':[]};return db['CmList'][_0xbc7a('0x59')]({'where':{'id':_0x1b4f76[_0xbc7a('0x54')]['id']}})['then'](handleEntityNotFound(_0x4745a7,null))[_0xbc7a('0x27')](function(_0x3169f7){if(_0x3169f7){_0x2f316a['model']=_[_0xbc7a('0x34')](db[_0xbc7a('0x5a')][_0xbc7a('0x30')]);_0x2f316a[_0xbc7a('0x33')]=_['keys'](_0x1b4f76[_0xbc7a('0x33')]);_0x2f316a[_0xbc7a('0x35')]=_[_0xbc7a('0x38')](_0x2f316a[_0xbc7a('0x36')],_0x2f316a['query']);_0x34df66[_0xbc7a('0x37')]=_[_0xbc7a('0x38')](_0x2f316a[_0xbc7a('0x36')],qs[_0xbc7a('0x39')](_0x1b4f76[_0xbc7a('0x33')][_0xbc7a('0x39')]));_0x34df66[_0xbc7a('0x37')]=_0x34df66[_0xbc7a('0x37')][_0xbc7a('0x48')]?_0x34df66['attributes']:_0x2f316a[_0xbc7a('0x36')];if(!_0x1b4f76[_0xbc7a('0x33')][_0xbc7a('0x5b')](_0xbc7a('0x3a'))){_0x34df66[_0xbc7a('0x22')]=qs[_0xbc7a('0x22')](_0x1b4f76[_0xbc7a('0x33')][_0xbc7a('0x22')]);_0x34df66['offset']=qs[_0xbc7a('0x21')](_0x1b4f76[_0xbc7a('0x33')][_0xbc7a('0x21')]);}_0x34df66[_0xbc7a('0x3b')]=qs['sort'](_0x1b4f76[_0xbc7a('0x33')][_0xbc7a('0x3c')]);_0x34df66['where']=qs[_0xbc7a('0x35')](_[_0xbc7a('0x3e')](_0x1b4f76[_0xbc7a('0x33')],_0x2f316a['filters']));_0x34df66[_0xbc7a('0x3d')][_0xbc7a('0x57')]=_0x3169f7['id'];if(_0x1b4f76['query']['filter']){_0x34df66[_0xbc7a('0x3d')]=_[_0xbc7a('0x40')](_0x34df66[_0xbc7a('0x3d')],{'$or':_[_0xbc7a('0x32')](_0x34df66['attributes'],function(_0x2ad064){var _0x5c41c2={};_0x5c41c2[_0x2ad064]={'$like':'%'+_0x1b4f76[_0xbc7a('0x33')][_0xbc7a('0x3f')]+'%'};return _0x5c41c2;})});}_0x34df66=_[_0xbc7a('0x40')]({},_0x34df66,_0x1b4f76[_0xbc7a('0x49')]);return db[_0xbc7a('0x5a')][_0xbc7a('0x42')]({'where':_0x34df66['where']})[_0xbc7a('0x27')](function(_0x533ded){_0x599c63[_0xbc7a('0x42')]=_0x533ded;if(_0x1b4f76[_0xbc7a('0x33')]['includeAll']){_0x34df66[_0xbc7a('0x5c')]=[{'all':!![]}];}return db[_0xbc7a('0x5a')][_0xbc7a('0x44')](_0x34df66);})['then'](function(_0x8c8b03){_0x599c63[_0xbc7a('0x45')]=_0x8c8b03;return _0x599c63;});}})[_0xbc7a('0x27')](respondWithFilteredResult(_0x4745a7,_0x34df66))[_0xbc7a('0x46')](handleError(_0x4745a7,null));};exports['removeDispositions']=function(_0x2c202f,_0x335448,_0x19f6bb){return db['CmList'][_0xbc7a('0x53')]({'where':{'id':_0x2c202f[_0xbc7a('0x54')]['id']}})['then'](handleEntityNotFound(_0x335448,null))[_0xbc7a('0x27')](function(_0x5eb6af){if(_0x5eb6af){return _0x5eb6af[_0xbc7a('0x5d')](_0x2c202f[_0xbc7a('0x33')][_0xbc7a('0x5e')]);}})[_0xbc7a('0x27')](respondWithStatusCode(_0x335448,null))[_0xbc7a('0x46')](handleError(_0x335448,null));};exports[_0xbc7a('0x5f')]=function(_0x165f3c,_0x3677f5,_0x183b78){return db[_0xbc7a('0x2f')][_0xbc7a('0x53')]({'where':{'id':_0x165f3c[_0xbc7a('0x54')]['id']}})[_0xbc7a('0x27')](handleEntityNotFound(_0x3677f5,null))[_0xbc7a('0x27')](function(_0x283a51){if(_0x283a51){var _0x8e3b4=[];var _0x1ae933={'success':[],'errors':[]};return db[_0xbc7a('0x60')][_0xbc7a('0x55')]()[_0xbc7a('0x27')](function(_0x1680d8){if(_0x165f3c[_0xbc7a('0x4b')][_0xbc7a('0x61')]&&_['isArray'](_0x165f3c['body'][_0xbc7a('0x61')])){if(_0x165f3c[_0xbc7a('0x4b')][_0xbc7a('0x61')][_0xbc7a('0x48')]){_0x165f3c[_0xbc7a('0x4b')]['tags']=_0x165f3c['body'][_0xbc7a('0x61')][_0xbc7a('0x62')](';')+';';}else{_0x165f3c[_0xbc7a('0x4b')][_0xbc7a('0x61')]=null;}}else{_0x165f3c[_0xbc7a('0x4b')][_0xbc7a('0x61')]=null;}if(_0x165f3c['body']&&_['isArray'](_0x165f3c[_0xbc7a('0x4b')])){for(var _0x4ee5f2=0x0;_0x4ee5f2<_0x165f3c['body'][_0xbc7a('0x48')];_0x4ee5f2+=0x1){_0x165f3c['body'][_0x4ee5f2][_0xbc7a('0x57')]=_0x165f3c['params']['id'];_0x8e3b4[_0xbc7a('0x63')](_0x165f3c[_0xbc7a('0x4b')][_0x4ee5f2]);}return BPromise[_0xbc7a('0x64')](_0x8e3b4,function(_0x714dbd){return db[_0xbc7a('0x60')]['create'](_[_0xbc7a('0x65')](_0x714dbd,[_0xbc7a('0x5e'),'id'])||{},{'fields':_[_0xbc7a('0x34')](_0x1680d8),'raw':!![]})[_0xbc7a('0x27')](function(_0x42ae98){_0x1ae933[_0xbc7a('0x66')]['push'](_0x42ae98[_0xbc7a('0x67')]);})[_0xbc7a('0x46')](function(_0xd48ea3){_0x1ae933[_0xbc7a('0x68')][_0xbc7a('0x63')]({'data':_0x714dbd,'error':_0xd48ea3['message']});});})[_0xbc7a('0x27')](function(_0x38a620){return _0x1ae933;})['catch'](function(_0x442e41){return _0x442e41;});}else{_0x3677f5[_0xbc7a('0x1e')](0x190)[_0xbc7a('0x20')]({'message':_0xbc7a('0x69')});}});}})[_0xbc7a('0x27')](respondWithResult(_0x3677f5,null))[_0xbc7a('0x46')](handleError(_0x3677f5,null));};exports[_0xbc7a('0x6a')]=function(_0x4b950c,_0x43216d,_0x2b81ec){var _0x44bbc2;return db['CmList'][_0xbc7a('0x53')]({'where':{'id':_0x4b950c['params']['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xbc7a('0x27')](handleEntityNotFound(_0x43216d,null))[_0xbc7a('0x27')](function(_0x4b1f9a){if(_0x4b1f9a){_0x44bbc2=_0x4b1f9a;return db[_0xbc7a('0x60')][_0xbc7a('0x30')];}})[_0xbc7a('0x27')](function(_0x370dc0){if(_0x370dc0){var _0x98dbf6={};var _0x24596a={};_0x24596a[_0xbc7a('0x36')]=_[_0xbc7a('0x6b')](_[_0xbc7a('0x34')](_0x370dc0),_[_0xbc7a('0x32')](_0x44bbc2['CustomFields'],function(_0x3a261c){return util[_0xbc7a('0x6c')](_0xbc7a('0x6d'),_0x3a261c['id']);}));_0x24596a[_0xbc7a('0x33')]=_[_0xbc7a('0x34')](_0x4b950c[_0xbc7a('0x33')]);_0x24596a[_0xbc7a('0x35')]=_[_0xbc7a('0x38')](_0x24596a[_0xbc7a('0x36')],_0x24596a[_0xbc7a('0x33')]);_0x98dbf6[_0xbc7a('0x37')]=_[_0xbc7a('0x38')](_0x24596a[_0xbc7a('0x36')],qs[_0xbc7a('0x39')](_0x4b950c[_0xbc7a('0x33')]['fields']));_0x98dbf6[_0xbc7a('0x37')]=_0x98dbf6['attributes'][_0xbc7a('0x48')]?_0x98dbf6['attributes']:_0x24596a['model'];if(!_0x4b950c[_0xbc7a('0x33')]['hasOwnProperty'](_0xbc7a('0x3a'))){_0x98dbf6[_0xbc7a('0x22')]=qs[_0xbc7a('0x22')](_0x4b950c[_0xbc7a('0x33')][_0xbc7a('0x22')]);_0x98dbf6[_0xbc7a('0x21')]=qs['offset'](_0x4b950c[_0xbc7a('0x33')][_0xbc7a('0x21')]);}_0x98dbf6['order']=qs[_0xbc7a('0x3c')](_0x4b950c[_0xbc7a('0x33')][_0xbc7a('0x3c')]);_0x98dbf6[_0xbc7a('0x3d')]=qs['filters'](_[_0xbc7a('0x3e')](_0x4b950c[_0xbc7a('0x33')],_0x24596a[_0xbc7a('0x35')]));_0x98dbf6['raw']=!![];if(_0x4b950c['query'][_0xbc7a('0x3f')]){_0x98dbf6[_0xbc7a('0x3d')]=_[_0xbc7a('0x40')](_0x98dbf6[_0xbc7a('0x3d')],{'$or':_[_0xbc7a('0x32')](_0x98dbf6[_0xbc7a('0x37')],function(_0x4bd20a){var _0x113c98={};_0x113c98[_0x4bd20a]={'$like':'%'+_0x4b950c[_0xbc7a('0x33')]['filter']+'%'};return _0x113c98;})});}_0x98dbf6=_['merge']({},_0x98dbf6,_0x4b950c[_0xbc7a('0x49')]);return _0x44bbc2[_0xbc7a('0x6a')](_0x98dbf6);}})[_0xbc7a('0x27')](respondWithResult(_0x43216d,null))[_0xbc7a('0x46')](handleError(_0x43216d,null));};exports['getContactsCsv']=function(_0x558b74,_0x305bbd,_0x4de516){var _0x1ba142;return db['CmList'][_0xbc7a('0x53')]({'where':{'id':_0x558b74[_0xbc7a('0x54')]['id']},'include':[{'model':db['CmCustomField'],'as':'CustomFields'}]})[_0xbc7a('0x27')](handleEntityNotFound(_0x305bbd,null))[_0xbc7a('0x27')](function(_0x2f2c84){if(_0x2f2c84){_0x1ba142=_0x2f2c84;return db[_0xbc7a('0x60')]['rawAttributes'];}})[_0xbc7a('0x27')](function(_0x9c1a8a){if(_0x9c1a8a){var _0x5d02a1={};var _0x112fe4={};_0x112fe4[_0xbc7a('0x36')]=_[_0xbc7a('0x6b')](_[_0xbc7a('0x34')](_0x9c1a8a),_[_0xbc7a('0x32')](_0x1ba142[_0xbc7a('0x6e')],function(_0xaa8fa8){return util[_0xbc7a('0x6c')](_0xbc7a('0x6d'),_0xaa8fa8['id']);}));_0x112fe4[_0xbc7a('0x33')]=_[_0xbc7a('0x34')](_0x558b74['query']);_0x112fe4[_0xbc7a('0x35')]=_[_0xbc7a('0x38')](_0x112fe4[_0xbc7a('0x36')],_0x112fe4['query']);_0x5d02a1[_0xbc7a('0x37')]=_[_0xbc7a('0x38')](_0x112fe4[_0xbc7a('0x36')],qs['fields'](_0x558b74[_0xbc7a('0x33')][_0xbc7a('0x39')]));_0x5d02a1[_0xbc7a('0x37')]=_0x5d02a1[_0xbc7a('0x37')][_0xbc7a('0x48')]?_0x5d02a1[_0xbc7a('0x37')]:_0x112fe4['model'];if(!_0x558b74[_0xbc7a('0x33')]['hasOwnProperty'](_0xbc7a('0x3a'))){_0x5d02a1[_0xbc7a('0x22')]=qs[_0xbc7a('0x22')](_0x558b74[_0xbc7a('0x33')]['limit']);_0x5d02a1[_0xbc7a('0x21')]=qs[_0xbc7a('0x21')](_0x558b74[_0xbc7a('0x33')][_0xbc7a('0x21')]);}_0x5d02a1[_0xbc7a('0x3b')]=qs[_0xbc7a('0x3c')](_0x558b74[_0xbc7a('0x33')][_0xbc7a('0x3c')]);_0x5d02a1[_0xbc7a('0x3d')]=qs[_0xbc7a('0x35')](_[_0xbc7a('0x3e')](_0x558b74[_0xbc7a('0x33')],_0x112fe4[_0xbc7a('0x35')]));_0x5d02a1[_0xbc7a('0x6f')]=!![];if(_0x558b74[_0xbc7a('0x33')][_0xbc7a('0x3f')]){_0x5d02a1[_0xbc7a('0x3d')]=_[_0xbc7a('0x40')](_0x5d02a1[_0xbc7a('0x3d')],{'$or':_[_0xbc7a('0x32')](_0x5d02a1[_0xbc7a('0x37')],function(_0x3fb1e1){var _0x4e7779={};_0x4e7779[_0x3fb1e1]={'$like':'%'+_0x558b74['query'][_0xbc7a('0x3f')]+'%'};return _0x4e7779;})});}_0x5d02a1=_[_0xbc7a('0x40')]({},_0x5d02a1,_0x558b74[_0xbc7a('0x49')]);return _0x1ba142['getContacts'](_0x5d02a1);}})[_0xbc7a('0x27')](function(_0x414ef4){if(!_[_0xbc7a('0x70')](_0x414ef4)){var _0x549ddb=toCsv(_0x414ef4);var _0x7f2fc9=Date[_0xbc7a('0x71')]();fs['writeFileSync'](util[_0xbc7a('0x6c')]('/tmp/list_%d_%s.csv',_0x1ba142['id'],_0x7f2fc9),_0x549ddb);_0x305bbd['setHeader'](_0xbc7a('0x72'),_0xbc7a('0x73')+util[_0xbc7a('0x6c')](_0xbc7a('0x74'),_0x1ba142['id'],_0x7f2fc9));_0x305bbd['setHeader'](_0xbc7a('0x75'),_0xbc7a('0x76'));return _0x305bbd[_0xbc7a('0x77')](util[_0xbc7a('0x6c')](_0xbc7a('0x78'),_0x1ba142['id'],_0x7f2fc9));}else{return _0x305bbd[_0xbc7a('0x1d')](0xcc);}})[_0xbc7a('0x46')](handleError(_0x305bbd,null));};exports[_0xbc7a('0x79')]=function(_0x400af7,_0x3eb299,_0x35c174){var _0x311b34;delete _0x400af7[_0xbc7a('0x4b')]['id'];return db['CmList'][_0xbc7a('0x59')]({'where':{'id':_0x400af7[_0xbc7a('0x54')]['id']}})[_0xbc7a('0x27')](handleEntityNotFound(_0x3eb299,null))[_0xbc7a('0x27')](function(_0x3e4ed5){if(_0x3e4ed5){return db[_0xbc7a('0x7a')][_0xbc7a('0x7b')](function(_0x2b1826){return db[_0xbc7a('0x7c')]['create'](_0x400af7[_0xbc7a('0x4b')],{'transaction':_0x2b1826})[_0xbc7a('0x27')](function(_0x41b571){_0x311b34=_0x41b571;return _0x3e4ed5['addCustomFields'](_0x41b571,{'transaction':_0x2b1826});})[_0xbc7a('0x27')](function(){var _0x24d0af={'type':db[_0xbc7a('0x7d')]['TEXT'],'transaction':_0x2b1826};switch(_0x400af7[_0xbc7a('0x4b')][_0xbc7a('0x31')]){case'text':_0x24d0af[_0xbc7a('0x31')]=db[_0xbc7a('0x7d')][_0xbc7a('0x7e')];break;case _0xbc7a('0x7f'):_0x24d0af[_0xbc7a('0x31')]=db[_0xbc7a('0x7d')][_0xbc7a('0x80')];break;case _0xbc7a('0x81'):_0x24d0af[_0xbc7a('0x31')]=db[_0xbc7a('0x7d')][_0xbc7a('0x82')];_0x24d0af[_0xbc7a('0x83')]=![];break;default:}return db[_0xbc7a('0x7a')][_0xbc7a('0x84')][_0xbc7a('0x85')](_0xbc7a('0x86'),util[_0xbc7a('0x6c')]('cf_%s',_0x311b34['id']),_0x24d0af);})['then'](function(){return _0x311b34;});});}})[_0xbc7a('0x27')](respondWithResult(_0x3eb299,null))[_0xbc7a('0x46')](handleError(_0x3eb299,null));};exports[_0xbc7a('0x87')]=function(_0x1f67ad,_0x38126a,_0x2a5553){var _0x4cbca4={};var _0x142533={};var _0x27e566;var _0x55f139;return db['CmList']['findOne']({'where':{'id':_0x1f67ad[_0xbc7a('0x54')]['id']}})[_0xbc7a('0x27')](handleEntityNotFound(_0x38126a,null))['then'](function(_0x24eb9a){if(_0x24eb9a){_0x27e566=_0x24eb9a;_0x142533[_0xbc7a('0x36')]=_[_0xbc7a('0x34')](db['CmCustomField'][_0xbc7a('0x30')]);_0x142533['query']=_[_0xbc7a('0x34')](_0x1f67ad[_0xbc7a('0x33')]);_0x142533['filters']=_['intersection'](_0x142533[_0xbc7a('0x36')],_0x142533['query']);_0x4cbca4[_0xbc7a('0x37')]=_['intersection'](_0x142533['model'],qs['fields'](_0x1f67ad['query']['fields']));_0x4cbca4['attributes']=_0x4cbca4[_0xbc7a('0x37')][_0xbc7a('0x48')]?_0x4cbca4[_0xbc7a('0x37')]:_0x142533[_0xbc7a('0x36')];_0x4cbca4[_0xbc7a('0x3b')]=qs['sort'](_0x1f67ad[_0xbc7a('0x33')][_0xbc7a('0x3c')]);_0x4cbca4['where']=qs[_0xbc7a('0x35')](_[_0xbc7a('0x3e')](_0x1f67ad[_0xbc7a('0x33')],_0x142533[_0xbc7a('0x35')]));_0x4cbca4[_0xbc7a('0x3d')]=_[_0xbc7a('0x40')](_0x4cbca4[_0xbc7a('0x3d')],{'$or':[{'ListId':_0x24eb9a['id']},{'ListId':null}]});if(_0x1f67ad[_0xbc7a('0x33')][_0xbc7a('0x3f')]){_0x4cbca4[_0xbc7a('0x3d')]=_['merge'](_0x4cbca4[_0xbc7a('0x3d')],{'$or':_[_0xbc7a('0x32')](_0x4cbca4[_0xbc7a('0x37')],function(_0x1c7d59){var _0x51a5c9={};_0x51a5c9[_0x1c7d59]={'$like':'%'+_0x1f67ad[_0xbc7a('0x33')]['filter']+'%'};return _0x51a5c9;})});}_0x4cbca4=_['merge']({},_0x4cbca4,_0x1f67ad[_0xbc7a('0x49')]);return db[_0xbc7a('0x7c')]['findAndCountAll'](_0x4cbca4);}})[_0xbc7a('0x27')](respondWithResult(_0x38126a,null))[_0xbc7a('0x46')](handleError(_0x38126a,null));};exports[_0xbc7a('0x88')]=function(_0xf5b18c,_0x43bf4f,_0x5c6007){return db[_0xbc7a('0x2f')][_0xbc7a('0x53')]({'where':{'id':_0xf5b18c['params']['id']}})[_0xbc7a('0x27')](handleEntityNotFound(_0x43bf4f,null))['then'](function(_0x206a4a){if(_0x206a4a){return _0x206a4a[_0xbc7a('0x88')](_0xf5b18c['body'][_0xbc7a('0x5e')],_[_0xbc7a('0x65')](_0xf5b18c[_0xbc7a('0x4b')],[_0xbc7a('0x5e'),'id'])||{})['spread'](function(_0x4f28cc){for(var _0x189634=0x0;_0x189634<_0xf5b18c['body']['ids'][_0xbc7a('0x48')];_0x189634+=0x1){socket[_0xbc7a('0x89')](_0xbc7a('0x8a'),{'UserId':_0xf5b18c[_0xbc7a('0x4b')][_0xbc7a('0x5e')][_0x189634],'CmListId':_0xf5b18c[_0xbc7a('0x54')]['id']});}return _0x4f28cc;});}})[_0xbc7a('0x27')](respondWithResult(_0x43bf4f,null))[_0xbc7a('0x46')](handleError(_0x43bf4f,null));};exports[_0xbc7a('0x8b')]=function(_0x273e14,_0x4fc176,_0x48fb3c){return db[_0xbc7a('0x2f')]['find']({'where':{'id':_0x273e14[_0xbc7a('0x54')]['id']}})[_0xbc7a('0x27')](handleEntityNotFound(_0x4fc176,null))[_0xbc7a('0x27')](function(_0x1e0482){if(_0x1e0482){return _0x1e0482['removeAgents'](_0x273e14[_0xbc7a('0x33')][_0xbc7a('0x5e')])[_0xbc7a('0x27')](function(){if(_['isArray'](_0x273e14['query'][_0xbc7a('0x5e')])){for(var _0x482559=0x0;_0x482559<_0x273e14['query'][_0xbc7a('0x5e')][_0xbc7a('0x48')];_0x482559+=0x1){socket[_0xbc7a('0x89')](_0xbc7a('0x8c'),{'UserId':Number(_0x273e14[_0xbc7a('0x33')]['ids'][_0x482559]),'CmListId':Number(_0x273e14[_0xbc7a('0x54')]['id'])});}}else{socket[_0xbc7a('0x89')](_0xbc7a('0x8c'),{'UserId':Number(_0x273e14['query'][_0xbc7a('0x5e')]),'CmListId':Number(_0x273e14[_0xbc7a('0x54')]['id'])});}});}})[_0xbc7a('0x27')](respondWithStatusCode(_0x4fc176,null))['catch'](handleError(_0x4fc176,null));};exports[_0xbc7a('0x8d')]=function(_0xe9019a,_0x4cfc09,_0x52d9f9){var _0x35a4c4={};var _0x248882={};var _0x418d9b;var _0x3da6c4;return db['CmList']['findOne']({'where':{'id':_0xe9019a['params']['id']}})[_0xbc7a('0x27')](handleEntityNotFound(_0x4cfc09,null))[_0xbc7a('0x27')](function(_0x49d408){if(_0x49d408){_0x418d9b=_0x49d408;_0x248882['model']=_[_0xbc7a('0x34')](db['User']['rawAttributes']);_0x248882[_0xbc7a('0x33')]=_[_0xbc7a('0x34')](_0xe9019a[_0xbc7a('0x33')]);_0x248882[_0xbc7a('0x35')]=_[_0xbc7a('0x38')](_0x248882[_0xbc7a('0x36')],_0x248882[_0xbc7a('0x33')]);_0x35a4c4['attributes']=_[_0xbc7a('0x38')](_0x248882['model'],qs[_0xbc7a('0x39')](_0xe9019a[_0xbc7a('0x33')][_0xbc7a('0x39')]));_0x35a4c4['attributes']=_0x35a4c4['attributes']['length']?_0x35a4c4[_0xbc7a('0x37')]:_0x248882[_0xbc7a('0x36')];_0x35a4c4['order']=qs['sort'](_0xe9019a['query'][_0xbc7a('0x3c')]);_0x35a4c4[_0xbc7a('0x3d')]=qs[_0xbc7a('0x35')](_[_0xbc7a('0x3e')](_0xe9019a[_0xbc7a('0x33')],_0x248882[_0xbc7a('0x35')]));if(_0xe9019a[_0xbc7a('0x33')]['filter']){_0x35a4c4[_0xbc7a('0x3d')]=_[_0xbc7a('0x40')](_0x35a4c4['where'],{'$or':_[_0xbc7a('0x32')](_0x35a4c4[_0xbc7a('0x37')],function(_0x5ddc22){var _0x137389={};_0x137389[_0x5ddc22]={'$like':'%'+_0xe9019a['query'][_0xbc7a('0x3f')]+'%'};return _0x137389;})});}_0x35a4c4=_[_0xbc7a('0x40')]({},_0x35a4c4,_0xe9019a[_0xbc7a('0x49')]);return _0x418d9b[_0xbc7a('0x8d')](_0x35a4c4);}})[_0xbc7a('0x27')](function(_0x5f0743){if(_0x5f0743){_0x3da6c4=_0x5f0743['length'];if(!_0xe9019a[_0xbc7a('0x33')]['hasOwnProperty']('nolimit')){_0x35a4c4[_0xbc7a('0x22')]=qs['limit'](_0xe9019a[_0xbc7a('0x33')][_0xbc7a('0x22')]);_0x35a4c4[_0xbc7a('0x21')]=qs[_0xbc7a('0x21')](_0xe9019a['query'][_0xbc7a('0x21')]);}return _0x418d9b[_0xbc7a('0x8d')](_0x35a4c4);}})[_0xbc7a('0x27')](function(_0x39ec92){if(_0x39ec92){return _0x39ec92?{'count':_0x3da6c4,'rows':_0x39ec92}:null;}})[_0xbc7a('0x27')](respondWithResult(_0x4cfc09,null))[_0xbc7a('0x46')](handleError(_0x4cfc09,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 55024bd..049d106 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 _0xd981=['hasOwnProperty','hook','exports','events','../../mysqldb','CmList','save','update','remove','emit'];(function(_0x575279,_0x5b839e){var _0x160d62=function(_0x58f68b){while(--_0x58f68b){_0x575279['push'](_0x575279['shift']());}};_0x160d62(++_0x5b839e);}(_0xd981,0x175));var _0x1d98=function(_0x5e77be,_0x10aed8){_0x5e77be=_0x5e77be-0x0;var _0x1cb824=_0xd981[_0x5e77be];return _0x1cb824;};'use strict';var EventEmitter=require(_0x1d98('0x0'));var CmList=require(_0x1d98('0x1'))['db'][_0x1d98('0x2')];var CmListEvents=new EventEmitter();CmListEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1d98('0x3'),'afterUpdate':_0x1d98('0x4'),'afterDestroy':_0x1d98('0x5')};function emitEvent(_0x77df05){return function(_0x561ab5,_0x585a65,_0x70544c){CmListEvents[_0x1d98('0x6')](_0x77df05+':'+_0x561ab5['id'],_0x561ab5);CmListEvents[_0x1d98('0x6')](_0x77df05,_0x561ab5);_0x70544c(null);};}for(var e in events){if(events[_0x1d98('0x7')](e)){var event=events[e];CmList[_0x1d98('0x8')](e,emitEvent(event));}}module[_0x1d98('0x9')]=CmListEvents; \ No newline at end of file +var _0x2179=['hasOwnProperty','hook','../../mysqldb','CmList','setMaxListeners','save','update','remove','emit'];(function(_0x3948cb,_0x116a3f){var _0x2ee2b3=function(_0x5c9fd4){while(--_0x5c9fd4){_0x3948cb['push'](_0x3948cb['shift']());}};_0x2ee2b3(++_0x116a3f);}(_0x2179,0xa4));var _0x9217=function(_0x57411a,_0x59328f){_0x57411a=_0x57411a-0x0;var _0xd487ba=_0x2179[_0x57411a];return _0xd487ba;};'use strict';var EventEmitter=require('events');var CmList=require(_0x9217('0x0'))['db'][_0x9217('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0x9217('0x2')](0x0);var events={'afterCreate':_0x9217('0x3'),'afterUpdate':_0x9217('0x4'),'afterDestroy':_0x9217('0x5')};function emitEvent(_0x44f822){return function(_0xb71925,_0x126db7,_0x2f0aa6){CmListEvents[_0x9217('0x6')](_0x44f822+':'+_0xb71925['id'],_0xb71925);CmListEvents[_0x9217('0x6')](_0x44f822,_0xb71925);_0x2f0aa6(null);};}for(var e in events){if(events[_0x9217('0x7')](e)){var event=events[e];CmList[_0x9217('0x8')](e,emitEvent(event));}}module['exports']=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 3878c8d..f768be4 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 _0x5265=['define','cm_lists','lodash','util','api','moment','request-promise','path','../../config/environment','./cmList.attributes','exports'];(function(_0x7a0fa7,_0x56a160){var _0x22638d=function(_0x505459){while(--_0x505459){_0x7a0fa7['push'](_0x7a0fa7['shift']());}};_0x22638d(++_0x56a160);}(_0x5265,0x14c));var _0x5526=function(_0x5d9a83,_0x223f70){_0x5d9a83=_0x5d9a83-0x0;var _0x57efa3=_0x5265[_0x5d9a83];return _0x57efa3;};'use strict';var _=require(_0x5526('0x0'));var util=require(_0x5526('0x1'));var logger=require('../../config/logger')(_0x5526('0x2'));var moment=require(_0x5526('0x3'));var BPromise=require('bluebird');var rp=require(_0x5526('0x4'));var fs=require('fs');var path=require(_0x5526('0x5'));var rimraf=require('rimraf');var config=require(_0x5526('0x6'));var attributes=require(_0x5526('0x7'));module[_0x5526('0x8')]=function(_0xf75553,_0x6cecdf){return _0xf75553[_0x5526('0x9')]('CmList',attributes,{'tableName':_0x5526('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf740=['cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','define'];(function(_0x2d61b2,_0x142947){var _0x12df89=function(_0x31c717){while(--_0x31c717){_0x2d61b2['push'](_0x2d61b2['shift']());}};_0x12df89(++_0x142947);}(_0xf740,0x69));var _0x0f74=function(_0x4f32de,_0x5bd4a){_0x4f32de=_0x4f32de-0x0;var _0x149821=_0xf740[_0x4f32de];return _0x149821;};'use strict';var _=require(_0x0f74('0x0'));var util=require(_0x0f74('0x1'));var logger=require(_0x0f74('0x2'))(_0x0f74('0x3'));var moment=require(_0x0f74('0x4'));var BPromise=require(_0x0f74('0x5'));var rp=require(_0x0f74('0x6'));var fs=require('fs');var path=require(_0x0f74('0x7'));var rimraf=require(_0x0f74('0x8'));var config=require(_0x0f74('0x9'));var attributes=require(_0x0f74('0xa'));module['exports']=function(_0x18270,_0x242ed9){return _0x18270[_0x0f74('0xb')]('CmList',attributes,{'tableName':_0x0f74('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 a91f787..543f3db 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 _0x2beb=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./cmList.socket','register','info','request\x20sent','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x548200,_0x3241b8){var _0x1a6d74=function(_0x412f84){while(--_0x412f84){_0x548200['push'](_0x548200['shift']());}};_0x1a6d74(++_0x3241b8);}(_0x2beb,0x11c));var _0xb2be=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x2beb[_0x2c91e9];return _0x13f0ff;};'use strict';var _=require(_0xb2be('0x0'));var util=require(_0xb2be('0x1'));var moment=require(_0xb2be('0x2'));var BPromise=require(_0xb2be('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2be('0x4'));var db=require(_0xb2be('0x5'))['db'];var utils=require(_0xb2be('0x6'));var logger=require(_0xb2be('0x7'))(_0xb2be('0x8'));var config=require(_0xb2be('0x9'));var jayson=require(_0xb2be('0xa'));var client=jayson[_0xb2be('0xb')][_0xb2be('0xc')]({'port':0x232a});config['redis']=_[_0xb2be('0xd')](config['redis'],{'host':_0xb2be('0xe'),'port':0x18eb});var socket=require(_0xb2be('0xf'))(new Redis(config[_0xb2be('0x10')]));require(_0xb2be('0x11'))[_0xb2be('0x12')](socket);function respondWithRpcPromise(_0x23aaf7,_0x4b1520,_0x38919e){return new BPromise(function(_0xcaa442,_0x3f3140){return client['request'](_0x23aaf7,_0x38919e)['then'](function(_0x15fc69){logger[_0xb2be('0x13')]('CmList,\x20%s,\x20%s',_0x4b1520,_0xb2be('0x14'));logger['debug'](_0xb2be('0x15'),_0x4b1520,_0xb2be('0x14'),JSON[_0xb2be('0x16')](_0x15fc69));if(_0x15fc69[_0xb2be('0x17')]){if(_0x15fc69['error'][_0xb2be('0x18')]===0x1f4){logger[_0xb2be('0x17')](_0xb2be('0x19'),_0x4b1520,_0x15fc69['error']['message']);return _0x3f3140(_0x15fc69[_0xb2be('0x17')][_0xb2be('0x1a')]);}logger[_0xb2be('0x17')](_0xb2be('0x19'),_0x4b1520,_0x15fc69['error'][_0xb2be('0x1a')]);return _0xcaa442(_0x15fc69['error'][_0xb2be('0x1a')]);}else{logger[_0xb2be('0x13')]('CmList,\x20%s,\x20%s',_0x4b1520,_0xb2be('0x14'));_0xcaa442(_0x15fc69[_0xb2be('0x1b')][_0xb2be('0x1a')]);}})[_0xb2be('0x1c')](function(_0x410b24){logger['error'](_0xb2be('0x19'),_0x4b1520,_0x410b24);_0x3f3140(_0x410b24);});});} \ No newline at end of file +var _0x627c=['debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','code','CmList,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','request','then','info','request\x20sent'];(function(_0x24693e,_0x2ba888){var _0x53e672=function(_0x5f6cff){while(--_0x5f6cff){_0x24693e['push'](_0x24693e['shift']());}};_0x53e672(++_0x2ba888);}(_0x627c,0x153));var _0xc627=function(_0x3d7ed3,_0x4ee97c){_0x3d7ed3=_0x3d7ed3-0x0;var _0x320a67=_0x627c[_0x3d7ed3];return _0x320a67;};'use strict';var _=require(_0xc627('0x0'));var util=require(_0xc627('0x1'));var moment=require(_0xc627('0x2'));var BPromise=require(_0xc627('0x3'));var rs=require(_0xc627('0x4'));var fs=require('fs');var Redis=require(_0xc627('0x5'));var db=require(_0xc627('0x6'))['db'];var utils=require(_0xc627('0x7'));var logger=require(_0xc627('0x8'))(_0xc627('0x9'));var config=require(_0xc627('0xa'));var jayson=require(_0xc627('0xb'));var client=jayson[_0xc627('0xc')][_0xc627('0xd')]({'port':0x232a});config[_0xc627('0xe')]=_[_0xc627('0xf')](config[_0xc627('0xe')],{'host':_0xc627('0x10'),'port':0x18eb});var socket=require(_0xc627('0x11'))(new Redis(config[_0xc627('0xe')]));require(_0xc627('0x12'))[_0xc627('0x13')](socket);function respondWithRpcPromise(_0x33ff2c,_0x1df568,_0x2ef5fb){return new BPromise(function(_0x49750c,_0x2c762f){return client[_0xc627('0x14')](_0x33ff2c,_0x2ef5fb)[_0xc627('0x15')](function(_0xff8ef8){logger[_0xc627('0x16')]('CmList,\x20%s,\x20%s',_0x1df568,_0xc627('0x17'));logger[_0xc627('0x18')](_0xc627('0x19'),_0x1df568,_0xc627('0x17'),JSON[_0xc627('0x1a')](_0xff8ef8));if(_0xff8ef8[_0xc627('0x1b')]){if(_0xff8ef8[_0xc627('0x1b')][_0xc627('0x1c')]===0x1f4){logger[_0xc627('0x1b')](_0xc627('0x1d'),_0x1df568,_0xff8ef8[_0xc627('0x1b')][_0xc627('0x1e')]);return _0x2c762f(_0xff8ef8[_0xc627('0x1b')]['message']);}logger[_0xc627('0x1b')](_0xc627('0x1d'),_0x1df568,_0xff8ef8[_0xc627('0x1b')]['message']);return _0x49750c(_0xff8ef8['error'][_0xc627('0x1e')]);}else{logger[_0xc627('0x16')]('CmList,\x20%s,\x20%s',_0x1df568,'request\x20sent');_0x49750c(_0xff8ef8[_0xc627('0x1f')][_0xc627('0x1e')]);}})[_0xc627('0x20')](function(_0x1c0188){logger[_0xc627('0x1b')](_0xc627('0x1d'),_0x1df568,_0x1c0188);_0x2c762f(_0x1c0188);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 3a51606..5a741ac 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 _0x9a96=['cmList:','./cmList.events','save','remove','update','emit','removeListener','register','length'];(function(_0x4451ce,_0x26698a){var _0x2b1342=function(_0x3d0616){while(--_0x3d0616){_0x4451ce['push'](_0x4451ce['shift']());}};_0x2b1342(++_0x26698a);}(_0x9a96,0xd0));var _0x69a9=function(_0x643a2c,_0x241acd){_0x643a2c=_0x643a2c-0x0;var _0x3c84a9=_0x9a96[_0x643a2c];return _0x3c84a9;};'use strict';var CmListEvents=require(_0x69a9('0x0'));var events=[_0x69a9('0x1'),_0x69a9('0x2'),_0x69a9('0x3')];function createListener(_0x10bba3,_0x6ebe9b){return function(_0x5de2f6){_0x6ebe9b[_0x69a9('0x4')](_0x10bba3,_0x5de2f6);};}function removeListener(_0x303516,_0x2480e1){return function(){CmListEvents[_0x69a9('0x5')](_0x303516,_0x2480e1);};}exports[_0x69a9('0x6')]=function(_0x5a48bf){for(var _0x245072=0x0,_0x260fd3=events[_0x69a9('0x7')];_0x245072<_0x260fd3;_0x245072++){var _0x2306b8=events[_0x245072];var _0x49125f=createListener(_0x69a9('0x8')+_0x2306b8,_0x5a48bf);CmListEvents['on'](_0x2306b8,_0x49125f);}}; \ No newline at end of file +var _0xd13e=['removeListener','length','cmList:','./cmList.events','save','remove','update','emit'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0xd13e,0x193));var _0xed13=function(_0x2d2d23,_0x32e6e7){_0x2d2d23=_0x2d2d23-0x0;var _0x43c342=_0xd13e[_0x2d2d23];return _0x43c342;};'use strict';var CmListEvents=require(_0xed13('0x0'));var events=[_0xed13('0x1'),_0xed13('0x2'),_0xed13('0x3')];function createListener(_0x50b476,_0x1a064e){return function(_0x5cdb65){_0x1a064e[_0xed13('0x4')](_0x50b476,_0x5cdb65);};}function removeListener(_0x59d4db,_0x46158d){return function(){CmListEvents[_0xed13('0x5')](_0x59d4db,_0x46158d);};}exports['register']=function(_0x50de44){for(var _0x5142bd=0x0,_0x95ff4c=events[_0xed13('0x6')];_0x5142bd<_0x95ff4c;_0x5142bd++){var _0xab0fff=events[_0x5142bd];var _0x3b3984=createListener(_0xed13('0x7')+_0xab0fff,_0x50de44);CmListEvents['on'](_0xab0fff,_0x3b3984);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index b1b82fa..d78858d 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 _0xae54=['removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/users','getAgents','addDisposition','post','addCustomField','addAgents','put','delete','destroy','removeDispositions'];(function(_0x179e43,_0x19acf6){var _0x89f3d2=function(_0x1102b6){while(--_0x1102b6){_0x179e43['push'](_0x179e43['shift']());}};_0x89f3d2(++_0x19acf6);}(_0xae54,0x162));var _0x4ae5=function(_0x1d7300,_0x17f109){_0x1d7300=_0x1d7300-0x0;var _0x46ee98=_0xae54[_0x1d7300];return _0x46ee98;};'use strict';var multer=require(_0x4ae5('0x0'));var util=require(_0x4ae5('0x1'));var path=require(_0x4ae5('0x2'));var timeout=require(_0x4ae5('0x3'));var express=require('express');var router=express[_0x4ae5('0x4')]();var auth=require(_0x4ae5('0x5'));var interaction=require(_0x4ae5('0x6'));var config=require(_0x4ae5('0x7'));var controller=require(_0x4ae5('0x8'));router[_0x4ae5('0x9')]('/',auth[_0x4ae5('0xa')](),controller[_0x4ae5('0xb')]);router['get'](_0x4ae5('0xc'),auth[_0x4ae5('0xa')](),controller['describe']);router[_0x4ae5('0x9')]('/:id',auth[_0x4ae5('0xa')](),controller[_0x4ae5('0xd')]);router['get'](_0x4ae5('0xe'),auth[_0x4ae5('0xa')](),controller[_0x4ae5('0xf')]);router[_0x4ae5('0x9')](_0x4ae5('0x10'),auth[_0x4ae5('0xa')](),controller[_0x4ae5('0x11')]);router[_0x4ae5('0x9')](_0x4ae5('0x12'),auth[_0x4ae5('0xa')](),controller[_0x4ae5('0x13')]);router[_0x4ae5('0x9')]('/:id/fields',auth[_0x4ae5('0xa')](),controller['getCustomFields']);router[_0x4ae5('0x9')](_0x4ae5('0x14'),auth[_0x4ae5('0xa')](),controller[_0x4ae5('0x15')]);router['post']('/',auth[_0x4ae5('0xa')](),controller['create']);router['post'](_0x4ae5('0xe'),auth[_0x4ae5('0xa')](),controller[_0x4ae5('0x16')]);router[_0x4ae5('0x17')](_0x4ae5('0x10'),auth['isAuthenticated'](),controller['addContacts']);router[_0x4ae5('0x17')]('/:id/fields',auth[_0x4ae5('0xa')](),controller[_0x4ae5('0x18')]);router['post'](_0x4ae5('0x14'),auth[_0x4ae5('0xa')](),controller[_0x4ae5('0x19')]);router[_0x4ae5('0x1a')]('/:id',auth[_0x4ae5('0xa')](),controller['update']);router[_0x4ae5('0x1b')]('/:id',auth[_0x4ae5('0xa')](),controller[_0x4ae5('0x1c')]);router[_0x4ae5('0x1b')](_0x4ae5('0xe'),auth['isAuthenticated'](),controller[_0x4ae5('0x1d')]);router[_0x4ae5('0x1b')](_0x4ae5('0x14'),auth['isAuthenticated'](),controller[_0x4ae5('0x1e')]);module[_0x4ae5('0x1f')]=router; \ No newline at end of file +var _0x5f68=['/:id/contacts/csv','getContactsCsv','/:id/fields','getAgents','post','addContacts','addCustomField','/:id/users','addAgents','put','update','delete','/:id/dispositions','removeDispositions','removeAgents','multer','util','connect-timeout','../../components/auth/service','get','isAuthenticated','index','describe','/:id','getDispositions','/:id/contacts'];(function(_0x737a1f,_0x235fef){var _0x16eba1=function(_0x292aa8){while(--_0x292aa8){_0x737a1f['push'](_0x737a1f['shift']());}};_0x16eba1(++_0x235fef);}(_0x5f68,0xc5));var _0x85f6=function(_0x580256,_0x3110ed){_0x580256=_0x580256-0x0;var _0x34e885=_0x5f68[_0x580256];return _0x34e885;};'use strict';var multer=require(_0x85f6('0x0'));var util=require(_0x85f6('0x1'));var path=require('path');var timeout=require(_0x85f6('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x85f6('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./cmList.controller');router[_0x85f6('0x4')]('/',auth[_0x85f6('0x5')](),controller[_0x85f6('0x6')]);router[_0x85f6('0x4')]('/describe',auth[_0x85f6('0x5')](),controller[_0x85f6('0x7')]);router[_0x85f6('0x4')](_0x85f6('0x8'),auth[_0x85f6('0x5')](),controller['show']);router[_0x85f6('0x4')]('/:id/dispositions',auth[_0x85f6('0x5')](),controller[_0x85f6('0x9')]);router[_0x85f6('0x4')](_0x85f6('0xa'),auth['isAuthenticated'](),controller['getContacts']);router['get'](_0x85f6('0xb'),auth[_0x85f6('0x5')](),controller[_0x85f6('0xc')]);router[_0x85f6('0x4')](_0x85f6('0xd'),auth[_0x85f6('0x5')](),controller['getCustomFields']);router[_0x85f6('0x4')]('/:id/users',auth['isAuthenticated'](),controller[_0x85f6('0xe')]);router['post']('/',auth[_0x85f6('0x5')](),controller['create']);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x85f6('0xf')](_0x85f6('0xa'),auth[_0x85f6('0x5')](),controller[_0x85f6('0x10')]);router[_0x85f6('0xf')](_0x85f6('0xd'),auth[_0x85f6('0x5')](),controller[_0x85f6('0x11')]);router[_0x85f6('0xf')](_0x85f6('0x12'),auth[_0x85f6('0x5')](),controller[_0x85f6('0x13')]);router[_0x85f6('0x14')](_0x85f6('0x8'),auth[_0x85f6('0x5')](),controller[_0x85f6('0x15')]);router[_0x85f6('0x16')](_0x85f6('0x8'),auth[_0x85f6('0x5')](),controller['destroy']);router[_0x85f6('0x16')](_0x85f6('0x17'),auth[_0x85f6('0x5')](),controller[_0x85f6('0x18')]);router[_0x85f6('0x16')](_0x85f6('0x12'),auth[_0x85f6('0x5')](),controller[_0x85f6('0x19')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index adc7df8..acd1578 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 _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0xe67c54,_0x526550){var _0x68a480=function(_0x4db362){while(--_0x4db362){_0xe67c54['push'](_0xe67c54['shift']());}};_0x68a480(++_0x526550);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'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 +var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x2287a3,_0x1769a4){var _0x270773=function(_0x160fe3){while(--_0x160fe3){_0x2287a3['push'](_0x2287a3['shift']());}};_0x270773(++_0x1769a4);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index abd7104..847f7e6 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 _0xfa4d=['status','end','count','offset','limit','json','reject','update','then','destroy','error','stack','name','body','Condition','find','params','catch','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x33a0bb,_0x5c268b){var _0x229f56=function(_0x779a03){while(--_0x779a03){_0x33a0bb['push'](_0x33a0bb['shift']());}};_0x229f56(++_0x5c268b);}(_0xfa4d,0x90));var _0xdfa4=function(_0x12fb7b,_0x129857){_0x12fb7b=_0x12fb7b-0x0;var _0x586c0d=_0xfa4d[_0x12fb7b];return _0x586c0d;};'use strict';var pdf=require(_0xdfa4('0x0'));var emlformat=require(_0xdfa4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdfa4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xdfa4('0x3'));var Mustache=require(_0xdfa4('0x4'));var util=require(_0xdfa4('0x5'));var path=require(_0xdfa4('0x6'));var sox=require(_0xdfa4('0x7'));var csv=require(_0xdfa4('0x8'));var ejs=require(_0xdfa4('0x9'));var fs=require('fs');var _=require(_0xdfa4('0xa'));var squel=require(_0xdfa4('0xb'));var crypto=require(_0xdfa4('0xc'));var jsforce=require(_0xdfa4('0xd'));var deskjs=require(_0xdfa4('0xe'));var toCsv=require(_0xdfa4('0x8'));var querystring=require(_0xdfa4('0xf'));var Papa=require(_0xdfa4('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xdfa4('0x11'));var as=require(_0xdfa4('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdfa4('0x13'))('api');var utils=require(_0xdfa4('0x14'));var config=require(_0xdfa4('0x15'));var db=require(_0xdfa4('0x16'))['db'];function respondWithStatusCode(_0xfa1d4b,_0x1f45d6){_0x1f45d6=_0x1f45d6||0xcc;return function(_0x2c56ff){if(_0x2c56ff){return _0xfa1d4b[_0xdfa4('0x17')](_0x1f45d6);}return _0xfa1d4b[_0xdfa4('0x18')](_0x1f45d6)[_0xdfa4('0x19')]();};}function respondWithResult(_0x87d032,_0x3889eb){_0x3889eb=_0x3889eb||0xc8;return function(_0x101063){if(_0x101063){return _0x87d032[_0xdfa4('0x18')](_0x3889eb)['json'](_0x101063);}};}function respondWithFilteredResult(_0x464b22,_0x5d604b){return function(_0x1e0140){if(_0x1e0140){var _0x566c09=_0x1e0140[_0xdfa4('0x1a')],_0x1284de=_0x5d604b[_0xdfa4('0x1b')],_0x1163ed=_0x5d604b[_0xdfa4('0x1b')]+_0x5d604b[_0xdfa4('0x1c')],_0x4c069a;if(_0x1163ed>=_0x566c09){_0x1163ed=_0x566c09;_0x4c069a=0xc8;}else{_0x4c069a=0xce;}_0x464b22[_0xdfa4('0x18')](_0x4c069a);return _0x464b22['set']('Content-Range',_0x1284de+'-'+_0x1163ed+'/'+_0x566c09)[_0xdfa4('0x1d')](_0x1e0140);}return null;};}function patchUpdates(_0x162bfb){return function(_0x37197){try{jsonpatch['apply'](_0x37197,_0x162bfb,!![]);}catch(_0x5209e9){return BPromise[_0xdfa4('0x1e')](_0x5209e9);}return _0x37197['save']();};}function saveUpdates(_0x449a22,_0x36dd54){return function(_0x25701a){if(_0x25701a){return _0x25701a[_0xdfa4('0x1f')](_0x449a22)[_0xdfa4('0x20')](function(_0x2ca5e2){return _0x2ca5e2;});}return null;};}function removeEntity(_0x2e5a0a,_0x29d1e3){return function(_0x486c77){if(_0x486c77){return _0x486c77[_0xdfa4('0x21')]()[_0xdfa4('0x20')](function(){_0x2e5a0a['status'](0xcc)[_0xdfa4('0x19')]();});}};}function handleEntityNotFound(_0x405d50,_0x5ab8f6){return function(_0x3c77bf){if(!_0x3c77bf){_0x405d50[_0xdfa4('0x17')](0x194);}return _0x3c77bf;};}function handleError(_0x46301b,_0x4c44aa){_0x4c44aa=_0x4c44aa||0x1f4;return function(_0x3d9bfc){logger[_0xdfa4('0x22')](_0x3d9bfc[_0xdfa4('0x23')]);if(_0x3d9bfc['name']){delete _0x3d9bfc[_0xdfa4('0x24')];}_0x46301b[_0xdfa4('0x18')](_0x4c44aa)['send'](_0x3d9bfc);};}exports[_0xdfa4('0x1f')]=function(_0x1d6411,_0x733fc){if(_0x1d6411[_0xdfa4('0x25')]['id']){delete _0x1d6411[_0xdfa4('0x25')]['id'];}return db[_0xdfa4('0x26')][_0xdfa4('0x27')]({'where':{'id':_0x1d6411[_0xdfa4('0x28')]['id']}})[_0xdfa4('0x20')](handleEntityNotFound(_0x733fc,null))[_0xdfa4('0x20')](saveUpdates(_0x1d6411[_0xdfa4('0x25')],null))[_0xdfa4('0x20')](respondWithResult(_0x733fc,null))[_0xdfa4('0x29')](handleError(_0x733fc,null));};exports[_0xdfa4('0x21')]=function(_0x8e56c5,_0x574ba6){return db[_0xdfa4('0x26')][_0xdfa4('0x27')]({'where':{'id':_0x8e56c5[_0xdfa4('0x28')]['id']}})[_0xdfa4('0x20')](handleEntityNotFound(_0x574ba6,null))[_0xdfa4('0x20')](removeEntity(_0x574ba6,null))[_0xdfa4('0x29')](handleError(_0x574ba6,null));}; \ No newline at end of file +var _0x501d=['destroy','error','stack','name','send','body','Condition','find','params','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','then'];(function(_0x465ef6,_0x8adf2a){var _0x5cf599=function(_0x19d39b){while(--_0x19d39b){_0x465ef6['push'](_0x465ef6['shift']());}};_0x5cf599(++_0x8adf2a);}(_0x501d,0x94));var _0xd501=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x501d[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0xd501('0x0'));var emlformat=require(_0xd501('0x1'));var rimraf=require(_0xd501('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd501('0x3'));var rp=require(_0xd501('0x4'));var moment=require(_0xd501('0x5'));var BPromise=require(_0xd501('0x6'));var Mustache=require('mustache');var util=require(_0xd501('0x7'));var path=require(_0xd501('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd501('0x9'));var fs=require('fs');var _=require(_0xd501('0xa'));var squel=require(_0xd501('0xb'));var crypto=require(_0xd501('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd501('0xd'));var toCsv=require(_0xd501('0xe'));var querystring=require(_0xd501('0xf'));var Papa=require(_0xd501('0x10'));var Redis=require(_0xd501('0x11'));var authService=require(_0xd501('0x12'));var qs=require(_0xd501('0x13'));var as=require(_0xd501('0x14'));var hardwareService=require(_0xd501('0x15'));var logger=require(_0xd501('0x16'))(_0xd501('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x576729,_0x3900af){_0x3900af=_0x3900af||0xcc;return function(_0x5db415){if(_0x5db415){return _0x576729[_0xd501('0x18')](_0x3900af);}return _0x576729[_0xd501('0x19')](_0x3900af)[_0xd501('0x1a')]();};}function respondWithResult(_0x32c394,_0x1e0174){_0x1e0174=_0x1e0174||0xc8;return function(_0xf70165){if(_0xf70165){return _0x32c394[_0xd501('0x19')](_0x1e0174)['json'](_0xf70165);}};}function respondWithFilteredResult(_0x27af39,_0x54f5e3){return function(_0x41be04){if(_0x41be04){var _0xe2061c=_0x41be04[_0xd501('0x1b')],_0x5a7efd=_0x54f5e3['offset'],_0x304e62=_0x54f5e3[_0xd501('0x1c')]+_0x54f5e3[_0xd501('0x1d')],_0x2d97bb;if(_0x304e62>=_0xe2061c){_0x304e62=_0xe2061c;_0x2d97bb=0xc8;}else{_0x2d97bb=0xce;}_0x27af39['status'](_0x2d97bb);return _0x27af39['set'](_0xd501('0x1e'),_0x5a7efd+'-'+_0x304e62+'/'+_0xe2061c)[_0xd501('0x1f')](_0x41be04);}return null;};}function patchUpdates(_0x31efd1){return function(_0x181560){try{jsonpatch[_0xd501('0x20')](_0x181560,_0x31efd1,!![]);}catch(_0x1d0a5f){return BPromise['reject'](_0x1d0a5f);}return _0x181560[_0xd501('0x21')]();};}function saveUpdates(_0x51b091,_0x598010){return function(_0x1ff59c){if(_0x1ff59c){return _0x1ff59c[_0xd501('0x22')](_0x51b091)[_0xd501('0x23')](function(_0x1bcacf){return _0x1bcacf;});}return null;};}function removeEntity(_0x1a9cce,_0x1bd681){return function(_0x41334e){if(_0x41334e){return _0x41334e[_0xd501('0x24')]()[_0xd501('0x23')](function(){_0x1a9cce[_0xd501('0x19')](0xcc)[_0xd501('0x1a')]();});}};}function handleEntityNotFound(_0x64b297,_0x13bcab){return function(_0x24afe7){if(!_0x24afe7){_0x64b297[_0xd501('0x18')](0x194);}return _0x24afe7;};}function handleError(_0x35eb1c,_0x39279a){_0x39279a=_0x39279a||0x1f4;return function(_0x5ac1af){logger[_0xd501('0x25')](_0x5ac1af[_0xd501('0x26')]);if(_0x5ac1af[_0xd501('0x27')]){delete _0x5ac1af[_0xd501('0x27')];}_0x35eb1c[_0xd501('0x19')](_0x39279a)[_0xd501('0x28')](_0x5ac1af);};}exports['update']=function(_0x57d9c0,_0x5e0264){if(_0x57d9c0[_0xd501('0x29')]['id']){delete _0x57d9c0[_0xd501('0x29')]['id'];}return db[_0xd501('0x2a')][_0xd501('0x2b')]({'where':{'id':_0x57d9c0[_0xd501('0x2c')]['id']}})[_0xd501('0x23')](handleEntityNotFound(_0x5e0264,null))[_0xd501('0x23')](saveUpdates(_0x57d9c0[_0xd501('0x29')],null))[_0xd501('0x23')](respondWithResult(_0x5e0264,null))[_0xd501('0x2d')](handleError(_0x5e0264,null));};exports[_0xd501('0x24')]=function(_0x366f8e,_0x1ee4ca){return db[_0xd501('0x2a')][_0xd501('0x2b')]({'where':{'id':_0x366f8e[_0xd501('0x2c')]['id']}})[_0xd501('0x23')](handleEntityNotFound(_0x1ee4ca,null))[_0xd501('0x23')](removeEntity(_0x1ee4ca,null))['catch'](handleError(_0x1ee4ca,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 01f2515..5503a3c 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 _0xd698=['path','rimraf','../../config/environment','./condition.attributes','define','Condition','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5ab46e,_0x553441){var _0x4516ff=function(_0x3d4b62){while(--_0x3d4b62){_0x5ab46e['push'](_0x5ab46e['shift']());}};_0x4516ff(++_0x553441);}(_0xd698,0xf6));var _0x8d69=function(_0x30a764,_0x470f8c){_0x30a764=_0x30a764-0x0;var _0x50cdc9=_0xd698[_0x30a764];return _0x50cdc9;};'use strict';var _=require(_0x8d69('0x0'));var util=require(_0x8d69('0x1'));var logger=require(_0x8d69('0x2'))(_0x8d69('0x3'));var moment=require(_0x8d69('0x4'));var BPromise=require('bluebird');var rp=require(_0x8d69('0x5'));var fs=require('fs');var path=require(_0x8d69('0x6'));var rimraf=require(_0x8d69('0x7'));var config=require(_0x8d69('0x8'));var attributes=require(_0x8d69('0x9'));module['exports']=function(_0x2be8fa,_0x566e37){return _0x2be8fa[_0x8d69('0xa')](_0x8d69('0xb'),attributes,{'tableName':'tools_conditions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6b8a=['rimraf','./condition.attributes','exports','define','Condition','tools_conditions','util','../../config/logger','api','bluebird','request-promise'];(function(_0x4777b9,_0x2cdb45){var _0x5e0297=function(_0x5d5120){while(--_0x5d5120){_0x4777b9['push'](_0x4777b9['shift']());}};_0x5e0297(++_0x2cdb45);}(_0x6b8a,0x1b3));var _0xa6b8=function(_0x464e64,_0x4cba25){_0x464e64=_0x464e64-0x0;var _0x4e8a55=_0x6b8a[_0x464e64];return _0x4e8a55;};'use strict';var _=require('lodash');var util=require(_0xa6b8('0x0'));var logger=require(_0xa6b8('0x1'))(_0xa6b8('0x2'));var moment=require('moment');var BPromise=require(_0xa6b8('0x3'));var rp=require(_0xa6b8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa6b8('0x5'));var config=require('../../config/environment');var attributes=require(_0xa6b8('0x6'));module[_0xa6b8('0x7')]=function(_0x33bee7,_0x138133){return _0x33bee7[_0xa6b8('0x8')](_0xa6b8('0x9'),attributes,{'tableName':_0xa6b8('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index c360970..e2c104b 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 _0xac93=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','request','then','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result'];(function(_0x3c857f,_0x274013){var _0xd3fab7=function(_0x40dbef){while(--_0x40dbef){_0x3c857f['push'](_0x3c857f['shift']());}};_0xd3fab7(++_0x274013);}(_0xac93,0xc9));var _0x3ac9=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xac93[_0x199572];return _0x13cfa3;};'use strict';var _=require('lodash');var util=require(_0x3ac9('0x0'));var moment=require(_0x3ac9('0x1'));var BPromise=require(_0x3ac9('0x2'));var rs=require(_0x3ac9('0x3'));var fs=require('fs');var Redis=require(_0x3ac9('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3ac9('0x5'));var logger=require(_0x3ac9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x3ac9('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x75b15e,_0x225951,_0x36f70a){return new BPromise(function(_0x27c0e9,_0x5116c8){return client[_0x3ac9('0x8')](_0x75b15e,_0x36f70a)[_0x3ac9('0x9')](function(_0x378308){logger['info']('Condition,\x20%s,\x20%s',_0x225951,_0x3ac9('0xa'));logger[_0x3ac9('0xb')](_0x3ac9('0xc'),_0x225951,_0x3ac9('0xa'),JSON[_0x3ac9('0xd')](_0x378308));if(_0x378308[_0x3ac9('0xe')]){if(_0x378308['error'][_0x3ac9('0xf')]===0x1f4){logger[_0x3ac9('0xe')](_0x3ac9('0x10'),_0x225951,_0x378308[_0x3ac9('0xe')]['message']);return _0x5116c8(_0x378308[_0x3ac9('0xe')][_0x3ac9('0x11')]);}logger['error']('Condition,\x20%s,\x20%s',_0x225951,_0x378308[_0x3ac9('0xe')][_0x3ac9('0x11')]);return _0x27c0e9(_0x378308[_0x3ac9('0xe')][_0x3ac9('0x11')]);}else{logger['info'](_0x3ac9('0x10'),_0x225951,_0x3ac9('0xa'));_0x27c0e9(_0x378308[_0x3ac9('0x12')][_0x3ac9('0x11')]);}})[_0x3ac9('0x13')](function(_0x2955d6){logger[_0x3ac9('0xe')]('Condition,\x20%s,\x20%s',_0x225951,_0x2955d6);_0x5116c8(_0x2955d6);});});} \ No newline at end of file +var _0x42b4=['catch','util','moment','../../mysqldb','rpc','../../config/environment','client','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','error','code','message','result'];(function(_0x2ac2c4,_0x408963){var _0x31c77e=function(_0x4f740a){while(--_0x4f740a){_0x2ac2c4['push'](_0x2ac2c4['shift']());}};_0x31c77e(++_0x408963);}(_0x42b4,0x19f));var _0x442b=function(_0x20f68d,_0x1668cd){_0x20f68d=_0x20f68d-0x0;var _0x539e6d=_0x42b4[_0x20f68d];return _0x539e6d;};'use strict';var _=require('lodash');var util=require(_0x442b('0x0'));var moment=require(_0x442b('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x442b('0x2'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x442b('0x3'));var config=require(_0x442b('0x4'));var jayson=require('jayson/promise');var client=jayson[_0x442b('0x5')]['http']({'port':0x232a});function respondWithRpcPromise(_0x20f1e3,_0x3c1a3d,_0x32e33d){return new BPromise(function(_0x5c0b99,_0x16e178){return client[_0x442b('0x6')](_0x20f1e3,_0x32e33d)[_0x442b('0x7')](function(_0x5b5cfc){logger[_0x442b('0x8')](_0x442b('0x9'),_0x3c1a3d,_0x442b('0xa'));logger[_0x442b('0xb')](_0x442b('0xc'),_0x3c1a3d,'request\x20sent',JSON['stringify'](_0x5b5cfc));if(_0x5b5cfc[_0x442b('0xd')]){if(_0x5b5cfc[_0x442b('0xd')][_0x442b('0xe')]===0x1f4){logger[_0x442b('0xd')](_0x442b('0x9'),_0x3c1a3d,_0x5b5cfc['error'][_0x442b('0xf')]);return _0x16e178(_0x5b5cfc[_0x442b('0xd')][_0x442b('0xf')]);}logger[_0x442b('0xd')]('Condition,\x20%s,\x20%s',_0x3c1a3d,_0x5b5cfc['error'][_0x442b('0xf')]);return _0x5c0b99(_0x5b5cfc[_0x442b('0xd')][_0x442b('0xf')]);}else{logger['info'](_0x442b('0x9'),_0x3c1a3d,_0x442b('0xa'));_0x5c0b99(_0x5b5cfc[_0x442b('0x10')][_0x442b('0xf')]);}})[_0x442b('0x11')](function(_0x1855ba){logger['error'](_0x442b('0x9'),_0x3c1a3d,_0x1855ba);_0x16e178(_0x1855ba);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index a0f7e5f..e517e81 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 _0x0d5d=['put','/:id','isAuthenticated','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller'];(function(_0xf95873,_0x4ec761){var _0x456c6e=function(_0x599690){while(--_0x599690){_0xf95873['push'](_0xf95873['shift']());}};_0x456c6e(++_0x4ec761);}(_0x0d5d,0xca));var _0xd0d5=function(_0x4016fe,_0x2a4f1a){_0x4016fe=_0x4016fe-0x0;var _0xe1f8b7=_0x0d5d[_0x4016fe];return _0xe1f8b7;};'use strict';var multer=require(_0xd0d5('0x0'));var util=require(_0xd0d5('0x1'));var path=require(_0xd0d5('0x2'));var timeout=require(_0xd0d5('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd0d5('0x4'));var interaction=require(_0xd0d5('0x5'));var config=require(_0xd0d5('0x6'));var controller=require(_0xd0d5('0x7'));router[_0xd0d5('0x8')](_0xd0d5('0x9'),auth[_0xd0d5('0xa')](),controller[_0xd0d5('0xb')]);router[_0xd0d5('0xc')](_0xd0d5('0x9'),auth[_0xd0d5('0xa')](),controller[_0xd0d5('0xd')]);module['exports']=router; \ No newline at end of file +var _0x0a48=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','/:id','isAuthenticated','destroy','exports','multer'];(function(_0x32bbaa,_0x2bc8f3){var _0x34077b=function(_0x30e236){while(--_0x30e236){_0x32bbaa['push'](_0x32bbaa['shift']());}};_0x34077b(++_0x2bc8f3);}(_0x0a48,0x1ed));var _0x80a4=function(_0x56a2bc,_0x165f22){_0x56a2bc=_0x56a2bc-0x0;var _0x9f8a=_0x0a48[_0x56a2bc];return _0x9f8a;};'use strict';var multer=require(_0x80a4('0x0'));var util=require(_0x80a4('0x1'));var path=require(_0x80a4('0x2'));var timeout=require(_0x80a4('0x3'));var express=require(_0x80a4('0x4'));var router=express[_0x80a4('0x5')]();var auth=require(_0x80a4('0x6'));var interaction=require(_0x80a4('0x7'));var config=require(_0x80a4('0x8'));var controller=require('./condition.controller');router['put'](_0x80a4('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x80a4('0x9'),auth[_0x80a4('0xa')](),controller[_0x80a4('0xb')]);module[_0x80a4('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index 44577a4..fcb1669 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 _0xf29c=['name','exports','STRING'];(function(_0x21549c,_0x6d64d1){var _0x426cbd=function(_0x323f5b){while(--_0x323f5b){_0x21549c['push'](_0x21549c['shift']());}};_0x426cbd(++_0x6d64d1);}(_0xf29c,0xc7));var _0xcf29=function(_0x15a490,_0x2c73fe){_0x15a490=_0x15a490-0x0;var _0x2c77ea=_0xf29c[_0x15a490];return _0x2c77ea;};'use strict';var Sequelize=require('sequelize');module[_0xcf29('0x0')]={'name':{'type':Sequelize[_0xcf29('0x1')],'allowNull':![],'unique':_0xcf29('0x2')},'description':{'type':Sequelize[_0xcf29('0x1')]}}; \ No newline at end of file +var _0x7f94=['STRING','name','sequelize'];(function(_0x2f177b,_0x17ae85){var _0x37041e=function(_0x2f484f){while(--_0x2f484f){_0x2f177b['push'](_0x2f177b['shift']());}};_0x37041e(++_0x17ae85);}(_0x7f94,0x65));var _0x47f9=function(_0x5748f2,_0x1c58a9){_0x5748f2=_0x5748f2-0x0;var _0x506269=_0x7f94[_0x5748f2];return _0x506269;};'use strict';var Sequelize=require(_0x47f9('0x0'));module['exports']={'name':{'type':Sequelize[_0x47f9('0x1')],'allowNull':![],'unique':_0x47f9('0x2')},'description':{'type':Sequelize[_0x47f9('0x1')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index 60aa3f2..a330314 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 _0xdcf9=['attrHourFormat','attrTimezone','0.00','attrFontSize','counter','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','hasOwnProperty','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','desk.js','querystring','ioredis','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','status','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','CustomDashboards','UserProfileResource','end','error','stack','name','send','index','Dashboard','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','order','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','user','UserProfileSection','userProfileId','autoAssociation','clone','find','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','attrUrl','attrs','value','https://','custom','attrPath','clock'];(function(_0x5bc466,_0x373704){var _0x6e36e9=function(_0x2a0f93){while(--_0x2a0f93){_0x5bc466['push'](_0x5bc466['shift']());}};_0x6e36e9(++_0x373704);}(_0xdcf9,0x101));var _0x9dcf=function(_0x423799,_0x23e640){_0x423799=_0x423799-0x0;var _0x289602=_0xdcf9[_0x423799];return _0x289602;};'use strict';var pdf=require(_0x9dcf('0x0'));var emlformat=require(_0x9dcf('0x1'));var rimraf=require(_0x9dcf('0x2'));var zipdir=require(_0x9dcf('0x3'));var jsonpatch=require(_0x9dcf('0x4'));var rp=require(_0x9dcf('0x5'));var moment=require(_0x9dcf('0x6'));var BPromise=require(_0x9dcf('0x7'));var Mustache=require(_0x9dcf('0x8'));var util=require(_0x9dcf('0x9'));var path=require(_0x9dcf('0xa'));var sox=require(_0x9dcf('0xb'));var csv=require(_0x9dcf('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x9dcf('0xd'));var jsforce=require(_0x9dcf('0xe'));var deskjs=require(_0x9dcf('0xf'));var toCsv=require(_0x9dcf('0xc'));var querystring=require(_0x9dcf('0x10'));var Papa=require('papaparse');var Redis=require(_0x9dcf('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9dcf('0x12'));var logger=require('../../config/logger')(_0x9dcf('0x13'));var utils=require(_0x9dcf('0x14'));var config=require('../../config/environment');var db=require(_0x9dcf('0x15'))['db'];config[_0x9dcf('0x16')]=_[_0x9dcf('0x17')](config['redis'],{'host':_0x9dcf('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9dcf('0x16')]));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x5e7ee1,_0x127f63){_0x127f63=_0x127f63||0xcc;return function(_0xc46435){if(_0xc46435){return _0x5e7ee1['sendStatus'](_0x127f63);}return _0x5e7ee1[_0x9dcf('0x19')](_0x127f63)['end']();};}function respondWithResult(_0x1542aa,_0x3572fa){_0x3572fa=_0x3572fa||0xc8;return function(_0x46afbe){if(_0x46afbe){return _0x1542aa[_0x9dcf('0x19')](_0x3572fa)[_0x9dcf('0x1a')](_0x46afbe);}};}function respondWithFilteredResult(_0x35ac9f,_0x5d5f0d){return function(_0x4cbb53){if(_0x4cbb53){var _0x335f63=_0x4cbb53[_0x9dcf('0x1b')],_0xf4aced=_0x5d5f0d[_0x9dcf('0x1c')],_0x4ec571=_0x5d5f0d[_0x9dcf('0x1c')]+_0x5d5f0d[_0x9dcf('0x1d')],_0x4dfc39;if(_0x4ec571>=_0x335f63){_0x4ec571=_0x335f63;_0x4dfc39=0xc8;}else{_0x4dfc39=0xce;}_0x35ac9f[_0x9dcf('0x19')](_0x4dfc39);return _0x35ac9f[_0x9dcf('0x1e')](_0x9dcf('0x1f'),_0xf4aced+'-'+_0x4ec571+'/'+_0x335f63)[_0x9dcf('0x1a')](_0x4cbb53);}return null;};}function patchUpdates(_0x43e59b){return function(_0xe0b802){try{jsonpatch[_0x9dcf('0x20')](_0xe0b802,_0x43e59b,!![]);}catch(_0x3a848b){return BPromise['reject'](_0x3a848b);}return _0xe0b802[_0x9dcf('0x21')]();};}function saveUpdates(_0x539fd0,_0x53fd31){return function(_0x54b8cb){if(_0x54b8cb){return _0x54b8cb['update'](_0x539fd0)[_0x9dcf('0x22')](function(_0x54d8cf){return _0x54d8cf;});}return null;};}function removeEntity(_0x364a23,_0x3093ef){return function(_0x5a2842){if(_0x5a2842){return _0x5a2842[_0x9dcf('0x23')]()[_0x9dcf('0x22')](function(){var _0x563ff8=_0x5a2842[_0x9dcf('0x24')]({'plain':!![]});var _0x39b934=_0x9dcf('0x25');return db[_0x9dcf('0x26')]['destroy']({'where':{'type':_0x39b934,'resourceId':_0x563ff8['id']}})[_0x9dcf('0x22')](function(){return _0x5a2842;});})[_0x9dcf('0x22')](function(){_0x364a23[_0x9dcf('0x19')](0xcc)[_0x9dcf('0x27')]();});}};}function handleEntityNotFound(_0x104f55,_0x5a7b8e){return function(_0x5d8904){if(!_0x5d8904){_0x104f55['sendStatus'](0x194);}return _0x5d8904;};}function handleError(_0x5bc75b,_0x385aa3){_0x385aa3=_0x385aa3||0x1f4;return function(_0x22ae67){logger[_0x9dcf('0x28')](_0x22ae67[_0x9dcf('0x29')]);if(_0x22ae67[_0x9dcf('0x2a')]){delete _0x22ae67[_0x9dcf('0x2a')];}_0x5bc75b[_0x9dcf('0x19')](_0x385aa3)[_0x9dcf('0x2b')](_0x22ae67);};}exports[_0x9dcf('0x2c')]=function(_0x230bd2,_0x461135){var _0xf1784e={},_0x2a295e={},_0x1e6f16={'count':0x0,'rows':[]};var _0x3b5c55=_['map'](db[_0x9dcf('0x2d')][_0x9dcf('0x2e')],function(_0x5ad1d0){return{'name':_0x5ad1d0[_0x9dcf('0x2f')],'type':_0x5ad1d0['type']['key']};});_0x2a295e[_0x9dcf('0x30')]=_[_0x9dcf('0x31')](_0x3b5c55,_0x9dcf('0x2a'));_0x2a295e[_0x9dcf('0x32')]=_[_0x9dcf('0x33')](_0x230bd2[_0x9dcf('0x32')]);_0x2a295e[_0x9dcf('0x34')]=_['intersection'](_0x2a295e[_0x9dcf('0x30')],_0x2a295e[_0x9dcf('0x32')]);_0xf1784e[_0x9dcf('0x35')]=_[_0x9dcf('0x36')](_0x2a295e[_0x9dcf('0x30')],qs[_0x9dcf('0x37')](_0x230bd2[_0x9dcf('0x32')][_0x9dcf('0x37')]));_0xf1784e[_0x9dcf('0x35')]=_0xf1784e[_0x9dcf('0x35')]['length']?_0xf1784e[_0x9dcf('0x35')]:_0x2a295e[_0x9dcf('0x30')];if(!_0x230bd2[_0x9dcf('0x32')]['hasOwnProperty']('nolimit')){_0xf1784e[_0x9dcf('0x1d')]=qs[_0x9dcf('0x1d')](_0x230bd2[_0x9dcf('0x32')]['limit']);_0xf1784e[_0x9dcf('0x1c')]=qs[_0x9dcf('0x1c')](_0x230bd2[_0x9dcf('0x32')][_0x9dcf('0x1c')]);}_0xf1784e[_0x9dcf('0x38')]=qs['sort'](_0x230bd2[_0x9dcf('0x32')][_0x9dcf('0x39')]);_0xf1784e[_0x9dcf('0x3a')]=qs[_0x9dcf('0x34')](_[_0x9dcf('0x3b')](_0x230bd2['query'],_0x2a295e[_0x9dcf('0x34')]));if(_0x230bd2[_0x9dcf('0x32')]['filter']){_0xf1784e[_0x9dcf('0x3a')]=_['merge'](_0xf1784e[_0x9dcf('0x3a')],{'$or':_[_0x9dcf('0x31')](_0x3b5c55,function(_0x2c9d45){if(_0x2c9d45[_0x9dcf('0x3c')]!==_0x9dcf('0x3d')){var _0x4bf2ae={};_0x4bf2ae[_0x2c9d45[_0x9dcf('0x2a')]]={'$like':'%'+_0x230bd2[_0x9dcf('0x32')][_0x9dcf('0x3e')]+'%'};return _0x4bf2ae;}})});}_0xf1784e=_[_0x9dcf('0x3f')]({},_0xf1784e,_0x230bd2[_0x9dcf('0x40')]);var _0x20b7ce={'where':_0xf1784e[_0x9dcf('0x3a')]};return db[_0x9dcf('0x2d')][_0x9dcf('0x1b')](_0x20b7ce)[_0x9dcf('0x22')](function(_0x3bc45e){_0x1e6f16['count']=_0x3bc45e;if(_0x230bd2[_0x9dcf('0x32')][_0x9dcf('0x41')]){_0xf1784e[_0x9dcf('0x42')]=[{'all':!![]}];}return db[_0x9dcf('0x2d')][_0x9dcf('0x43')](_0xf1784e);})[_0x9dcf('0x22')](function(_0x1422ef){_0x1e6f16[_0x9dcf('0x44')]=_0x1422ef;return _0x1e6f16;})['then'](respondWithFilteredResult(_0x461135,_0xf1784e))[_0x9dcf('0x45')](handleError(_0x461135,null));};exports[_0x9dcf('0x46')]=function(_0x30394b,_0xc17688){var _0x15bbab={'raw':![],'where':{'id':_0x30394b[_0x9dcf('0x47')]['id']}},_0xf805ea={};_0xf805ea['model']=_['keys'](db[_0x9dcf('0x2d')]['rawAttributes']);_0xf805ea[_0x9dcf('0x32')]=_['keys'](_0x30394b['query']);_0xf805ea[_0x9dcf('0x34')]=_[_0x9dcf('0x36')](_0xf805ea[_0x9dcf('0x30')],_0xf805ea[_0x9dcf('0x32')]);_0x15bbab[_0x9dcf('0x35')]=_['intersection'](_0xf805ea[_0x9dcf('0x30')],qs['fields'](_0x30394b[_0x9dcf('0x32')][_0x9dcf('0x37')]));_0x15bbab['attributes']=_0x15bbab[_0x9dcf('0x35')][_0x9dcf('0x48')]?_0x15bbab[_0x9dcf('0x35')]:_0xf805ea['model'];if(_0x30394b[_0x9dcf('0x32')][_0x9dcf('0x41')]){_0x15bbab[_0x9dcf('0x42')]=[{'all':!![]}];}_0x15bbab=_[_0x9dcf('0x3f')]({},_0x15bbab,_0x30394b[_0x9dcf('0x40')]);return db['Dashboard']['find'](_0x15bbab)[_0x9dcf('0x22')](handleEntityNotFound(_0xc17688,null))['then'](respondWithResult(_0xc17688,null))[_0x9dcf('0x45')](handleError(_0xc17688,null));};exports['create']=function(_0x1a5afe,_0x41703d){return db[_0x9dcf('0x2d')][_0x9dcf('0x49')](_0x1a5afe[_0x9dcf('0x4a')],{})[_0x9dcf('0x22')](function(_0x932fe0){var _0x5c03a3=_0x1a5afe['user'][_0x9dcf('0x24')]({'plain':!![]});if(!_0x5c03a3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5c03a3['role']===_0x9dcf('0x4b')){var _0x2d5194=_0x932fe0[_0x9dcf('0x24')]({'plain':!![]});var _0x267389=_0x9dcf('0x25');return db[_0x9dcf('0x4c')]['find']({'where':{'name':_0x267389,'userProfileId':_0x5c03a3[_0x9dcf('0x4d')]},'raw':!![]})['then'](function(_0x503fb8){if(_0x503fb8&&_0x503fb8[_0x9dcf('0x4e')]===0x0){return db[_0x9dcf('0x26')]['create']({'name':_0x2d5194['name'],'resourceId':_0x2d5194['id'],'type':_0x503fb8[_0x9dcf('0x2a')],'sectionId':_0x503fb8['id']},{})[_0x9dcf('0x22')](function(){return _0x932fe0;});}else{return _0x932fe0;}})['catch'](function(_0x54d5d6){logger[_0x9dcf('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x54d5d6);throw _0x54d5d6;});}return _0x932fe0;})[_0x9dcf('0x22')](respondWithResult(_0x41703d,0xc9))['catch'](handleError(_0x41703d,null));};exports[_0x9dcf('0x4f')]=function(_0x105090,_0x4cfbdb){var _0x35ed1c={'where':{'id':_0x105090[_0x9dcf('0x47')]['id']}},_0x3b89bf={};_0x3b89bf[_0x9dcf('0x30')]=_[_0x9dcf('0x33')](db[_0x9dcf('0x2d')][_0x9dcf('0x2e')]);_0x35ed1c['attributes']=_[_0x9dcf('0x36')](_0x3b89bf[_0x9dcf('0x30')],qs[_0x9dcf('0x37')](_0x105090[_0x9dcf('0x32')][_0x9dcf('0x37')]));_0x35ed1c[_0x9dcf('0x35')]=_0x35ed1c[_0x9dcf('0x35')][_0x9dcf('0x48')]?_0x35ed1c[_0x9dcf('0x35')]:_0x3b89bf[_0x9dcf('0x30')];if(_0x105090[_0x9dcf('0x32')][_0x9dcf('0x41')]){_0x35ed1c[_0x9dcf('0x42')]=[{'all':!![]}];}_0x35ed1c=_[_0x9dcf('0x3f')]({},_0x35ed1c,_0x105090[_0x9dcf('0x40')]);return db['Dashboard'][_0x9dcf('0x50')](_0x35ed1c)[_0x9dcf('0x22')](handleEntityNotFound(_0x4cfbdb,null))[_0x9dcf('0x22')](function(_0x5986d2){if(_0x5986d2){var _0x14bbe3=_0x5986d2['get']({'plain':!![]});_0x14bbe3=qs[_0x9dcf('0x51')](_0x14bbe3,['id','createdAt',_0x9dcf('0x52')]);_0x105090[_0x9dcf('0x4a')]=_[_0x9dcf('0x51')](_0x105090['body'],['id',_0x9dcf('0x53'),'updatedAt']);return db['Dashboard'][_0x9dcf('0x49')](_['merge'](_0x14bbe3,_0x105090[_0x9dcf('0x4a')]),{'include':_0x105090[_0x9dcf('0x32')]['includeAll']?[{'all':!![]}]:undefined})[_0x9dcf('0x22')](function(_0x3af328){var _0x5a476f=_0x105090[_0x9dcf('0x4b')][_0x9dcf('0x24')]({'plain':!![]});if(!_0x5a476f)throw new Error(_0x9dcf('0x54'));if(_0x5a476f['role']==='user'){var _0xc1b8f1=_0x3af328['get']({'plain':!![]});var _0x5c2199=_0x9dcf('0x25');return db[_0x9dcf('0x4c')][_0x9dcf('0x50')]({'where':{'name':_0x5c2199,'userProfileId':_0x5a476f[_0x9dcf('0x4d')]},'raw':!![]})[_0x9dcf('0x22')](function(_0x7c1189){if(_0x7c1189&&_0x7c1189[_0x9dcf('0x4e')]===0x0){return db[_0x9dcf('0x26')]['create']({'name':_0xc1b8f1[_0x9dcf('0x2a')],'resourceId':_0xc1b8f1['id'],'type':_0x7c1189[_0x9dcf('0x2a')],'sectionId':_0x7c1189['id']},{})[_0x9dcf('0x22')](function(){return _0x3af328;});}else{return _0x3af328;}})[_0x9dcf('0x45')](function(_0x10fd92){logger[_0x9dcf('0x28')](_0x9dcf('0x55'),_0x10fd92);throw _0x10fd92;});}return _0x3af328;});}})['then'](respondWithResult(_0x4cfbdb,0xc9))[_0x9dcf('0x45')](handleError(_0x4cfbdb,null));};exports[_0x9dcf('0x56')]=function(_0x2712b5,_0x40fa13){if(_0x2712b5[_0x9dcf('0x4a')]['id']){delete _0x2712b5['body']['id'];}return db[_0x9dcf('0x2d')][_0x9dcf('0x50')]({'where':{'id':_0x2712b5[_0x9dcf('0x47')]['id']}})[_0x9dcf('0x22')](handleEntityNotFound(_0x40fa13,null))[_0x9dcf('0x22')](saveUpdates(_0x2712b5[_0x9dcf('0x4a')],null))[_0x9dcf('0x22')](respondWithResult(_0x40fa13,null))['catch'](handleError(_0x40fa13,null));};exports['destroy']=function(_0x1bb35b,_0x17884f){return db['Dashboard'][_0x9dcf('0x50')]({'where':{'id':_0x1bb35b['params']['id']}})[_0x9dcf('0x22')](handleEntityNotFound(_0x17884f,null))[_0x9dcf('0x22')](removeEntity(_0x17884f,null))[_0x9dcf('0x45')](handleError(_0x17884f,null));};function widgetAttributes(_0x362e6f){try{switch(_0x362e6f['type']){case'iframe':return[{'name':_0x9dcf('0x57'),'value':_0x362e6f[_0x9dcf('0x57')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f['attrs'][0x0]?_0x362e6f[_0x9dcf('0x58')][0x0][_0x9dcf('0x59')]:undefined)||_0x9dcf('0x5a')}];case _0x9dcf('0x5b'):return[{'name':_0x9dcf('0x5c'),'value':_0x362e6f[_0x9dcf('0x5c')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x0]?_0x362e6f[_0x9dcf('0x58')][0x0]['value']:undefined)||''}];case _0x9dcf('0x5d'):return[{'name':_0x9dcf('0x5e'),'value':_0x362e6f[_0x9dcf('0x5e')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x0]?_0x362e6f[_0x9dcf('0x58')][0x0][_0x9dcf('0x59')]:undefined)||'HH:mm:ss'},{'name':_0x9dcf('0x5f'),'value':_0x362e6f[_0x9dcf('0x5f')]||(_0x362e6f['attrs']&&_0x362e6f[_0x9dcf('0x58')][0x1]?_0x362e6f[_0x9dcf('0x58')][0x1][_0x9dcf('0x59')]:undefined)||_0x9dcf('0x60')},{'name':_0x9dcf('0x61'),'value':_0x362e6f[_0x9dcf('0x61')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x2]?_0x362e6f[_0x9dcf('0x58')][0x2][_0x9dcf('0x59')]:undefined)||0xc}];case _0x9dcf('0x62'):return[{'name':'attrMetric','value':_0x362e6f['attrMetric']||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f['attrs'][0x0]?_0x362e6f[_0x9dcf('0x58')][0x0][_0x9dcf('0x59')]:undefined)||_0x9dcf('0x63')},{'name':_0x9dcf('0x64'),'value':_0x362e6f[_0x9dcf('0x64')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x1]?_0x362e6f[_0x9dcf('0x58')][0x1][_0x9dcf('0x59')]:undefined)||[]},{'name':_0x9dcf('0x61'),'value':_0x362e6f[_0x9dcf('0x61')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f['attrs'][0x2]?_0x362e6f[_0x9dcf('0x58')][0x2]['value']:undefined)||0x14}];case _0x9dcf('0x65'):case _0x9dcf('0x66'):return[{'name':_0x9dcf('0x67'),'value':_0x362e6f[_0x9dcf('0x67')]||(_0x362e6f['attrs']&&_0x362e6f[_0x9dcf('0x58')][0x0]?_0x362e6f[_0x9dcf('0x58')][0x0][_0x9dcf('0x59')]:undefined)||_0x9dcf('0x63')},{'name':_0x9dcf('0x68'),'value':_0x362e6f[_0x9dcf('0x68')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x1]?_0x362e6f[_0x9dcf('0x58')][0x1][_0x9dcf('0x59')]:undefined)||null},{'name':_0x9dcf('0x69'),'value':_0x362e6f[_0x9dcf('0x69')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x2]?_0x362e6f['attrs'][0x2][_0x9dcf('0x59')]:undefined)||null},{'name':_0x9dcf('0x64'),'value':_0x362e6f[_0x9dcf('0x64')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x3]?_0x362e6f[_0x9dcf('0x58')][0x3][_0x9dcf('0x59')]:undefined)||[]}];case'web-report':return[{'name':_0x9dcf('0x6a'),'type':_0x362e6f[_0x9dcf('0x6b')]||(_0x362e6f['attrs']&&_0x362e6f[_0x9dcf('0x58')][0x0]?_0x362e6f[_0x9dcf('0x58')][0x0][_0x9dcf('0x3c')]:undefined)||null,'value':_0x362e6f[_0x9dcf('0x6a')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x0]?_0x362e6f[_0x9dcf('0x58')][0x0]['value']:undefined)||null},{'name':_0x9dcf('0x6c'),'value':_0x362e6f[_0x9dcf('0x6c')]||(_0x362e6f[_0x9dcf('0x58')]&&_0x362e6f[_0x9dcf('0x58')][0x1]?_0x362e6f[_0x9dcf('0x58')][0x1][_0x9dcf('0x59')]:undefined)||0x0}];default:return[];}}catch(_0x28d195){logger['error'](_0x9dcf('0x6d'),JSON[_0x9dcf('0x6e')](_0x28d195));return[];}}exports[_0x9dcf('0x6f')]=function(_0x49a568,_0x34e623,_0x795a9f){if(_0x49a568[_0x9dcf('0x4a')]['id']){delete _0x49a568[_0x9dcf('0x4a')]['id'];}return db[_0x9dcf('0x2d')]['find']({'where':{'id':_0x49a568[_0x9dcf('0x47')]['id']}})[_0x9dcf('0x22')](handleEntityNotFound(_0x34e623,null))[_0x9dcf('0x22')](function(_0x2a38fa){if(_0x2a38fa){_0x49a568[_0x9dcf('0x4a')][_0x9dcf('0x70')]=_0x2a38fa['id'];_0x49a568['body'][_0x9dcf('0x58')]=widgetAttributes(_0x49a568[_0x9dcf('0x4a')]);return db[_0x9dcf('0x71')][_0x9dcf('0x49')](_0x49a568[_0x9dcf('0x4a')]);}})[_0x9dcf('0x22')](respondWithResult(_0x34e623,null))[_0x9dcf('0x45')](handleError(_0x34e623,null));};exports['getItems']=function(_0x4e65a4,_0x59bcf9,_0x1b3e1a){var _0x40c4b1={};var _0x481487={};var _0x51e723;var _0x3b2a6d;return db[_0x9dcf('0x2d')][_0x9dcf('0x72')]({'where':{'id':_0x4e65a4[_0x9dcf('0x47')]['id']}})[_0x9dcf('0x22')](handleEntityNotFound(_0x59bcf9,null))[_0x9dcf('0x22')](function(_0x1d3f0f){if(_0x1d3f0f){_0x51e723=_0x1d3f0f;_0x481487[_0x9dcf('0x30')]=_[_0x9dcf('0x33')](db[_0x9dcf('0x71')]['rawAttributes']);_0x481487[_0x9dcf('0x32')]=_[_0x9dcf('0x33')](_0x4e65a4[_0x9dcf('0x32')]);_0x481487[_0x9dcf('0x34')]=_[_0x9dcf('0x36')](_0x481487[_0x9dcf('0x30')],_0x481487[_0x9dcf('0x32')]);_0x40c4b1[_0x9dcf('0x35')]=_[_0x9dcf('0x36')](_0x481487[_0x9dcf('0x30')],qs[_0x9dcf('0x37')](_0x4e65a4[_0x9dcf('0x32')][_0x9dcf('0x37')]));_0x40c4b1[_0x9dcf('0x35')]=_0x40c4b1[_0x9dcf('0x35')]['length']?_0x40c4b1[_0x9dcf('0x35')]:_0x481487[_0x9dcf('0x30')];_0x40c4b1[_0x9dcf('0x38')]=qs[_0x9dcf('0x39')](_0x4e65a4['query'][_0x9dcf('0x39')]);_0x40c4b1[_0x9dcf('0x3a')]=qs[_0x9dcf('0x34')](_['pick'](_0x4e65a4[_0x9dcf('0x32')],_0x481487[_0x9dcf('0x34')]));if(_0x4e65a4[_0x9dcf('0x32')][_0x9dcf('0x3e')]){_0x40c4b1[_0x9dcf('0x3a')]=_[_0x9dcf('0x3f')](_0x40c4b1[_0x9dcf('0x3a')],{'$or':_['map'](_0x40c4b1[_0x9dcf('0x35')],function(_0xa35ddb){var _0x4b6ece={};_0x4b6ece[_0xa35ddb]={'$like':'%'+_0x4e65a4[_0x9dcf('0x32')][_0x9dcf('0x3e')]+'%'};return _0x4b6ece;})});}_0x40c4b1=_[_0x9dcf('0x3f')]({},_0x40c4b1,_0x4e65a4['options']);return _0x51e723['getItems'](_0x40c4b1);}})[_0x9dcf('0x22')](function(_0x156d7c){if(_0x156d7c){_0x3b2a6d=_0x156d7c[_0x9dcf('0x48')];if(!_0x4e65a4['query'][_0x9dcf('0x73')](_0x9dcf('0x74'))){_0x40c4b1[_0x9dcf('0x1d')]=qs['limit'](_0x4e65a4[_0x9dcf('0x32')][_0x9dcf('0x1d')]);_0x40c4b1[_0x9dcf('0x1c')]=qs[_0x9dcf('0x1c')](_0x4e65a4[_0x9dcf('0x32')][_0x9dcf('0x1c')]);}return _0x51e723['getItems'](_0x40c4b1);}})[_0x9dcf('0x22')](function(_0x4ebe5a){if(_0x4ebe5a){return _0x4ebe5a?{'count':_0x3b2a6d,'rows':_0x4ebe5a}:null;}})[_0x9dcf('0x22')](respondWithResult(_0x59bcf9,null))[_0x9dcf('0x45')](handleError(_0x59bcf9,null));}; \ No newline at end of file +var _0xffdc=['attrSerie2','attrSerie3','reportType','attrReport','widgetAttributes:\x20%s','stringify','DashboardId','DashboardItem','findOne','order','getItems','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','name','index','map','Dashboard','type','key','keys','query','filters','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','filter','options','include','rows','catch','show','intersection','includeAll','merge','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','rawAttributes','find','createdAt','updatedAt','omit','CustomDashboards','UserProfileSection','userProfileId','autoAssociation','iframe','attrUrl','attrs','https://','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1'];(function(_0x91cf75,_0x156959){var _0x562f63=function(_0x3f1f8a){while(--_0x3f1f8a){_0x91cf75['push'](_0x91cf75['shift']());}};_0x562f63(++_0x156959);}(_0xffdc,0x7f));var _0xcffd=function(_0x1923f2,_0x39e21f){_0x1923f2=_0x1923f2-0x0;var _0x511bb2=_0xffdc[_0x1923f2];return _0x511bb2;};'use strict';var pdf=require(_0xcffd('0x0'));var emlformat=require(_0xcffd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xcffd('0x2'));var jsonpatch=require(_0xcffd('0x3'));var rp=require('request-promise');var moment=require(_0xcffd('0x4'));var BPromise=require(_0xcffd('0x5'));var Mustache=require(_0xcffd('0x6'));var util=require(_0xcffd('0x7'));var path=require(_0xcffd('0x8'));var sox=require('sox');var csv=require(_0xcffd('0x9'));var ejs=require(_0xcffd('0xa'));var fs=require('fs');var _=require(_0xcffd('0xb'));var squel=require(_0xcffd('0xc'));var crypto=require(_0xcffd('0xd'));var jsforce=require(_0xcffd('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcffd('0x9'));var querystring=require(_0xcffd('0xf'));var Papa=require('papaparse');var Redis=require(_0xcffd('0x10'));var authService=require(_0xcffd('0x11'));var qs=require(_0xcffd('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xcffd('0x13'));var logger=require(_0xcffd('0x14'))(_0xcffd('0x15'));var utils=require(_0xcffd('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xcffd('0x17')]=_[_0xcffd('0x18')](config[_0xcffd('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xcffd('0x19'))(new Redis(config['redis']));require('./dashboard.socket')[_0xcffd('0x1a')](socket);function respondWithStatusCode(_0x20e134,_0x4edde4){_0x4edde4=_0x4edde4||0xcc;return function(_0x1cda29){if(_0x1cda29){return _0x20e134[_0xcffd('0x1b')](_0x4edde4);}return _0x20e134[_0xcffd('0x1c')](_0x4edde4)[_0xcffd('0x1d')]();};}function respondWithResult(_0x4ec386,_0x4921d1){_0x4921d1=_0x4921d1||0xc8;return function(_0xb5ffdc){if(_0xb5ffdc){return _0x4ec386[_0xcffd('0x1c')](_0x4921d1)[_0xcffd('0x1e')](_0xb5ffdc);}};}function respondWithFilteredResult(_0x31afaf,_0x867e85){return function(_0x55b5db){if(_0x55b5db){var _0x4216c4=_0x55b5db[_0xcffd('0x1f')],_0x5c3701=_0x867e85[_0xcffd('0x20')],_0x18e9e1=_0x867e85[_0xcffd('0x20')]+_0x867e85[_0xcffd('0x21')],_0x33c713;if(_0x18e9e1>=_0x4216c4){_0x18e9e1=_0x4216c4;_0x33c713=0xc8;}else{_0x33c713=0xce;}_0x31afaf[_0xcffd('0x1c')](_0x33c713);return _0x31afaf[_0xcffd('0x22')]('Content-Range',_0x5c3701+'-'+_0x18e9e1+'/'+_0x4216c4)[_0xcffd('0x1e')](_0x55b5db);}return null;};}function patchUpdates(_0x1f36f4){return function(_0x3d337d){try{jsonpatch[_0xcffd('0x23')](_0x3d337d,_0x1f36f4,!![]);}catch(_0x44f32d){return BPromise[_0xcffd('0x24')](_0x44f32d);}return _0x3d337d[_0xcffd('0x25')]();};}function saveUpdates(_0x5d2d3c,_0x52fc51){return function(_0x2cc75){if(_0x2cc75){return _0x2cc75[_0xcffd('0x26')](_0x5d2d3c)[_0xcffd('0x27')](function(_0x3935ff){return _0x3935ff;});}return null;};}function removeEntity(_0x3c3839,_0x345a4d){return function(_0x2723db){if(_0x2723db){return _0x2723db[_0xcffd('0x28')]()[_0xcffd('0x27')](function(){var _0x19e0d9=_0x2723db[_0xcffd('0x29')]({'plain':!![]});var _0x1f232a='CustomDashboards';return db[_0xcffd('0x2a')][_0xcffd('0x28')]({'where':{'type':_0x1f232a,'resourceId':_0x19e0d9['id']}})[_0xcffd('0x27')](function(){return _0x2723db;});})['then'](function(){_0x3c3839[_0xcffd('0x1c')](0xcc)[_0xcffd('0x1d')]();});}};}function handleEntityNotFound(_0x21b7b7,_0x5d0859){return function(_0x4f0078){if(!_0x4f0078){_0x21b7b7[_0xcffd('0x1b')](0x194);}return _0x4f0078;};}function handleError(_0x2896a4,_0x4b1c7d){_0x4b1c7d=_0x4b1c7d||0x1f4;return function(_0x3cb0dd){logger[_0xcffd('0x2b')](_0x3cb0dd['stack']);if(_0x3cb0dd[_0xcffd('0x2c')]){delete _0x3cb0dd[_0xcffd('0x2c')];}_0x2896a4['status'](_0x4b1c7d)['send'](_0x3cb0dd);};}exports[_0xcffd('0x2d')]=function(_0x1c40fb,_0x318cdf){var _0x5eea07={},_0x2b9040={},_0x8e98b4={'count':0x0,'rows':[]};var _0x47bbba=_[_0xcffd('0x2e')](db[_0xcffd('0x2f')]['rawAttributes'],function(_0x4216e2){return{'name':_0x4216e2['fieldName'],'type':_0x4216e2[_0xcffd('0x30')][_0xcffd('0x31')]};});_0x2b9040['model']=_[_0xcffd('0x2e')](_0x47bbba,'name');_0x2b9040['query']=_[_0xcffd('0x32')](_0x1c40fb[_0xcffd('0x33')]);_0x2b9040[_0xcffd('0x34')]=_['intersection'](_0x2b9040['model'],_0x2b9040[_0xcffd('0x33')]);_0x5eea07[_0xcffd('0x35')]=_['intersection'](_0x2b9040['model'],qs[_0xcffd('0x36')](_0x1c40fb['query'][_0xcffd('0x36')]));_0x5eea07[_0xcffd('0x35')]=_0x5eea07[_0xcffd('0x35')][_0xcffd('0x37')]?_0x5eea07[_0xcffd('0x35')]:_0x2b9040[_0xcffd('0x38')];if(!_0x1c40fb['query'][_0xcffd('0x39')](_0xcffd('0x3a'))){_0x5eea07[_0xcffd('0x21')]=qs[_0xcffd('0x21')](_0x1c40fb[_0xcffd('0x33')][_0xcffd('0x21')]);_0x5eea07['offset']=qs[_0xcffd('0x20')](_0x1c40fb['query'][_0xcffd('0x20')]);}_0x5eea07['order']=qs[_0xcffd('0x3b')](_0x1c40fb[_0xcffd('0x33')][_0xcffd('0x3b')]);_0x5eea07[_0xcffd('0x3c')]=qs[_0xcffd('0x34')](_[_0xcffd('0x3d')](_0x1c40fb[_0xcffd('0x33')],_0x2b9040['filters']));if(_0x1c40fb[_0xcffd('0x33')][_0xcffd('0x3e')]){_0x5eea07[_0xcffd('0x3c')]=_['merge'](_0x5eea07[_0xcffd('0x3c')],{'$or':_[_0xcffd('0x2e')](_0x47bbba,function(_0x464d82){if(_0x464d82['type']!=='VIRTUAL'){var _0x5160e6={};_0x5160e6[_0x464d82[_0xcffd('0x2c')]]={'$like':'%'+_0x1c40fb[_0xcffd('0x33')][_0xcffd('0x3e')]+'%'};return _0x5160e6;}})});}_0x5eea07=_['merge']({},_0x5eea07,_0x1c40fb[_0xcffd('0x3f')]);var _0x35cfd9={'where':_0x5eea07[_0xcffd('0x3c')]};return db[_0xcffd('0x2f')][_0xcffd('0x1f')](_0x35cfd9)[_0xcffd('0x27')](function(_0x5ec655){_0x8e98b4[_0xcffd('0x1f')]=_0x5ec655;if(_0x1c40fb[_0xcffd('0x33')]['includeAll']){_0x5eea07[_0xcffd('0x40')]=[{'all':!![]}];}return db[_0xcffd('0x2f')]['findAll'](_0x5eea07);})[_0xcffd('0x27')](function(_0xeebe28){_0x8e98b4[_0xcffd('0x41')]=_0xeebe28;return _0x8e98b4;})[_0xcffd('0x27')](respondWithFilteredResult(_0x318cdf,_0x5eea07))[_0xcffd('0x42')](handleError(_0x318cdf,null));};exports[_0xcffd('0x43')]=function(_0x2c33a4,_0x150d5f){var _0x2bba88={'raw':![],'where':{'id':_0x2c33a4['params']['id']}},_0x2f03b2={};_0x2f03b2[_0xcffd('0x38')]=_[_0xcffd('0x32')](db['Dashboard']['rawAttributes']);_0x2f03b2[_0xcffd('0x33')]=_[_0xcffd('0x32')](_0x2c33a4[_0xcffd('0x33')]);_0x2f03b2[_0xcffd('0x34')]=_[_0xcffd('0x44')](_0x2f03b2['model'],_0x2f03b2['query']);_0x2bba88['attributes']=_[_0xcffd('0x44')](_0x2f03b2[_0xcffd('0x38')],qs[_0xcffd('0x36')](_0x2c33a4[_0xcffd('0x33')][_0xcffd('0x36')]));_0x2bba88[_0xcffd('0x35')]=_0x2bba88[_0xcffd('0x35')][_0xcffd('0x37')]?_0x2bba88[_0xcffd('0x35')]:_0x2f03b2[_0xcffd('0x38')];if(_0x2c33a4[_0xcffd('0x33')][_0xcffd('0x45')]){_0x2bba88[_0xcffd('0x40')]=[{'all':!![]}];}_0x2bba88=_[_0xcffd('0x46')]({},_0x2bba88,_0x2c33a4['options']);return db[_0xcffd('0x2f')]['find'](_0x2bba88)['then'](handleEntityNotFound(_0x150d5f,null))[_0xcffd('0x27')](respondWithResult(_0x150d5f,null))['catch'](handleError(_0x150d5f,null));};exports[_0xcffd('0x47')]=function(_0x42b396,_0x589e6c){return db[_0xcffd('0x2f')][_0xcffd('0x47')](_0x42b396[_0xcffd('0x48')],{})[_0xcffd('0x27')](function(_0x9f9bc){var _0x52e434=_0x42b396[_0xcffd('0x49')][_0xcffd('0x29')]({'plain':!![]});if(!_0x52e434)throw new Error(_0xcffd('0x4a'));if(_0x52e434[_0xcffd('0x4b')]===_0xcffd('0x49')){var _0x2cc53f=_0x9f9bc[_0xcffd('0x29')]({'plain':!![]});var _0x5bb359='CustomDashboards';return db['UserProfileSection']['find']({'where':{'name':_0x5bb359,'userProfileId':_0x52e434['userProfileId']},'raw':!![]})[_0xcffd('0x27')](function(_0x5076ca){if(_0x5076ca&&_0x5076ca['autoAssociation']===0x0){return db[_0xcffd('0x2a')][_0xcffd('0x47')]({'name':_0x2cc53f[_0xcffd('0x2c')],'resourceId':_0x2cc53f['id'],'type':_0x5076ca[_0xcffd('0x2c')],'sectionId':_0x5076ca['id']},{})[_0xcffd('0x27')](function(){return _0x9f9bc;});}else{return _0x9f9bc;}})[_0xcffd('0x42')](function(_0x441c45){logger[_0xcffd('0x2b')](_0xcffd('0x4c'),_0x441c45);throw _0x441c45;});}return _0x9f9bc;})[_0xcffd('0x27')](respondWithResult(_0x589e6c,0xc9))[_0xcffd('0x42')](handleError(_0x589e6c,null));};exports[_0xcffd('0x4d')]=function(_0x339520,_0x255fc1){var _0x177e7b={'where':{'id':_0x339520[_0xcffd('0x4e')]['id']}},_0x4a6820={};_0x4a6820[_0xcffd('0x38')]=_[_0xcffd('0x32')](db[_0xcffd('0x2f')][_0xcffd('0x4f')]);_0x177e7b[_0xcffd('0x35')]=_[_0xcffd('0x44')](_0x4a6820[_0xcffd('0x38')],qs[_0xcffd('0x36')](_0x339520[_0xcffd('0x33')][_0xcffd('0x36')]));_0x177e7b[_0xcffd('0x35')]=_0x177e7b[_0xcffd('0x35')][_0xcffd('0x37')]?_0x177e7b[_0xcffd('0x35')]:_0x4a6820[_0xcffd('0x38')];if(_0x339520[_0xcffd('0x33')]['includeAll']){_0x177e7b[_0xcffd('0x40')]=[{'all':!![]}];}_0x177e7b=_[_0xcffd('0x46')]({},_0x177e7b,_0x339520['options']);return db['Dashboard'][_0xcffd('0x50')](_0x177e7b)[_0xcffd('0x27')](handleEntityNotFound(_0x255fc1,null))['then'](function(_0x44cae9){if(_0x44cae9){var _0x3eacf1=_0x44cae9[_0xcffd('0x29')]({'plain':!![]});_0x3eacf1=qs['omit'](_0x3eacf1,['id',_0xcffd('0x51'),_0xcffd('0x52')]);_0x339520[_0xcffd('0x48')]=_[_0xcffd('0x53')](_0x339520[_0xcffd('0x48')],['id',_0xcffd('0x51'),_0xcffd('0x52')]);return db[_0xcffd('0x2f')][_0xcffd('0x47')](_[_0xcffd('0x46')](_0x3eacf1,_0x339520[_0xcffd('0x48')]),{'include':_0x339520[_0xcffd('0x33')][_0xcffd('0x45')]?[{'all':!![]}]:undefined})[_0xcffd('0x27')](function(_0x461cfa){var _0x2f4f3c=_0x339520[_0xcffd('0x49')][_0xcffd('0x29')]({'plain':!![]});if(!_0x2f4f3c)throw new Error(_0xcffd('0x4a'));if(_0x2f4f3c[_0xcffd('0x4b')]===_0xcffd('0x49')){var _0x33ed74=_0x461cfa[_0xcffd('0x29')]({'plain':!![]});var _0x31bb20=_0xcffd('0x54');return db[_0xcffd('0x55')][_0xcffd('0x50')]({'where':{'name':_0x31bb20,'userProfileId':_0x2f4f3c[_0xcffd('0x56')]},'raw':!![]})[_0xcffd('0x27')](function(_0x57bc69){if(_0x57bc69&&_0x57bc69[_0xcffd('0x57')]===0x0){return db['UserProfileResource'][_0xcffd('0x47')]({'name':_0x33ed74[_0xcffd('0x2c')],'resourceId':_0x33ed74['id'],'type':_0x57bc69[_0xcffd('0x2c')],'sectionId':_0x57bc69['id']},{})[_0xcffd('0x27')](function(){return _0x461cfa;});}else{return _0x461cfa;}})[_0xcffd('0x42')](function(_0x12d74c){logger[_0xcffd('0x2b')](_0xcffd('0x4c'),_0x12d74c);throw _0x12d74c;});}return _0x461cfa;});}})[_0xcffd('0x27')](respondWithResult(_0x255fc1,0xc9))[_0xcffd('0x42')](handleError(_0x255fc1,null));};exports[_0xcffd('0x26')]=function(_0x3f77a8,_0x57fae4){if(_0x3f77a8['body']['id']){delete _0x3f77a8[_0xcffd('0x48')]['id'];}return db[_0xcffd('0x2f')][_0xcffd('0x50')]({'where':{'id':_0x3f77a8[_0xcffd('0x4e')]['id']}})[_0xcffd('0x27')](handleEntityNotFound(_0x57fae4,null))['then'](saveUpdates(_0x3f77a8[_0xcffd('0x48')],null))['then'](respondWithResult(_0x57fae4,null))[_0xcffd('0x42')](handleError(_0x57fae4,null));};exports[_0xcffd('0x28')]=function(_0x568d4f,_0x1ee2ea){return db[_0xcffd('0x2f')][_0xcffd('0x50')]({'where':{'id':_0x568d4f[_0xcffd('0x4e')]['id']}})[_0xcffd('0x27')](handleEntityNotFound(_0x1ee2ea,null))[_0xcffd('0x27')](removeEntity(_0x1ee2ea,null))[_0xcffd('0x42')](handleError(_0x1ee2ea,null));};function widgetAttributes(_0x449468){try{switch(_0x449468['type']){case _0xcffd('0x58'):return[{'name':_0xcffd('0x59'),'value':_0x449468[_0xcffd('0x59')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x0]?_0x449468[_0xcffd('0x5a')][0x0]['value']:undefined)||_0xcffd('0x5b')}];case'custom':return[{'name':'attrPath','value':_0x449468[_0xcffd('0x5c')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x0]?_0x449468['attrs'][0x0][_0xcffd('0x5d')]:undefined)||''}];case _0xcffd('0x5e'):return[{'name':_0xcffd('0x5f'),'value':_0x449468['attrHourFormat']||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x0]?_0x449468[_0xcffd('0x5a')][0x0][_0xcffd('0x5d')]:undefined)||_0xcffd('0x60')},{'name':_0xcffd('0x61'),'value':_0x449468[_0xcffd('0x61')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x1]?_0x449468[_0xcffd('0x5a')][0x1][_0xcffd('0x5d')]:undefined)||_0xcffd('0x62')},{'name':_0xcffd('0x63'),'value':_0x449468[_0xcffd('0x63')]||(_0x449468['attrs']&&_0x449468[_0xcffd('0x5a')][0x2]?_0x449468[_0xcffd('0x5a')][0x2][_0xcffd('0x5d')]:undefined)||0xc}];case'counter':return[{'name':_0xcffd('0x64'),'value':_0x449468[_0xcffd('0x64')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x0]?_0x449468[_0xcffd('0x5a')][0x0]['value']:undefined)||_0xcffd('0x65')},{'name':_0xcffd('0x66'),'value':_0x449468[_0xcffd('0x66')]||(_0x449468['attrs']&&_0x449468[_0xcffd('0x5a')][0x1]?_0x449468[_0xcffd('0x5a')][0x1][_0xcffd('0x5d')]:undefined)||[]},{'name':'attrFontSize','value':_0x449468[_0xcffd('0x63')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x2]?_0x449468['attrs'][0x2][_0xcffd('0x5d')]:undefined)||0x14}];case'multibar-chart':case _0xcffd('0x67'):return[{'name':_0xcffd('0x68'),'value':_0x449468['attrSerie1']||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x0]?_0x449468[_0xcffd('0x5a')][0x0][_0xcffd('0x5d')]:undefined)||_0xcffd('0x65')},{'name':_0xcffd('0x69'),'value':_0x449468[_0xcffd('0x69')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x1]?_0x449468[_0xcffd('0x5a')][0x1][_0xcffd('0x5d')]:undefined)||null},{'name':_0xcffd('0x6a'),'value':_0x449468['attrSerie3']||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x2]?_0x449468[_0xcffd('0x5a')][0x2][_0xcffd('0x5d')]:undefined)||null},{'name':_0xcffd('0x66'),'value':_0x449468[_0xcffd('0x66')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x3]?_0x449468['attrs'][0x3]['value']:undefined)||[]}];case'web-report':return[{'name':'attrReport','type':_0x449468[_0xcffd('0x6b')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468['attrs'][0x0]?_0x449468['attrs'][0x0][_0xcffd('0x30')]:undefined)||null,'value':_0x449468[_0xcffd('0x6c')]||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x0]?_0x449468[_0xcffd('0x5a')][0x0][_0xcffd('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x449468['attrRefresh']||(_0x449468[_0xcffd('0x5a')]&&_0x449468[_0xcffd('0x5a')][0x1]?_0x449468['attrs'][0x1][_0xcffd('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x1b47be){logger['error'](_0xcffd('0x6d'),JSON[_0xcffd('0x6e')](_0x1b47be));return[];}}exports['addItem']=function(_0x2fd946,_0x28cfed,_0x2232bc){if(_0x2fd946[_0xcffd('0x48')]['id']){delete _0x2fd946['body']['id'];}return db[_0xcffd('0x2f')][_0xcffd('0x50')]({'where':{'id':_0x2fd946[_0xcffd('0x4e')]['id']}})[_0xcffd('0x27')](handleEntityNotFound(_0x28cfed,null))[_0xcffd('0x27')](function(_0x3a9b3a){if(_0x3a9b3a){_0x2fd946['body'][_0xcffd('0x6f')]=_0x3a9b3a['id'];_0x2fd946[_0xcffd('0x48')][_0xcffd('0x5a')]=widgetAttributes(_0x2fd946['body']);return db[_0xcffd('0x70')][_0xcffd('0x47')](_0x2fd946[_0xcffd('0x48')]);}})[_0xcffd('0x27')](respondWithResult(_0x28cfed,null))['catch'](handleError(_0x28cfed,null));};exports['getItems']=function(_0x136f66,_0x2370c4,_0x1ccdaf){var _0x52579b={};var _0x33deea={};var _0x4d2485;var _0x569dcd;return db[_0xcffd('0x2f')][_0xcffd('0x71')]({'where':{'id':_0x136f66[_0xcffd('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2370c4,null))['then'](function(_0x18d7fe){if(_0x18d7fe){_0x4d2485=_0x18d7fe;_0x33deea[_0xcffd('0x38')]=_[_0xcffd('0x32')](db[_0xcffd('0x70')][_0xcffd('0x4f')]);_0x33deea['query']=_[_0xcffd('0x32')](_0x136f66[_0xcffd('0x33')]);_0x33deea[_0xcffd('0x34')]=_[_0xcffd('0x44')](_0x33deea[_0xcffd('0x38')],_0x33deea['query']);_0x52579b[_0xcffd('0x35')]=_[_0xcffd('0x44')](_0x33deea['model'],qs[_0xcffd('0x36')](_0x136f66[_0xcffd('0x33')][_0xcffd('0x36')]));_0x52579b[_0xcffd('0x35')]=_0x52579b[_0xcffd('0x35')][_0xcffd('0x37')]?_0x52579b[_0xcffd('0x35')]:_0x33deea[_0xcffd('0x38')];_0x52579b[_0xcffd('0x72')]=qs['sort'](_0x136f66[_0xcffd('0x33')]['sort']);_0x52579b[_0xcffd('0x3c')]=qs['filters'](_[_0xcffd('0x3d')](_0x136f66[_0xcffd('0x33')],_0x33deea[_0xcffd('0x34')]));if(_0x136f66[_0xcffd('0x33')][_0xcffd('0x3e')]){_0x52579b[_0xcffd('0x3c')]=_['merge'](_0x52579b[_0xcffd('0x3c')],{'$or':_['map'](_0x52579b[_0xcffd('0x35')],function(_0x139386){var _0x3c99f={};_0x3c99f[_0x139386]={'$like':'%'+_0x136f66[_0xcffd('0x33')][_0xcffd('0x3e')]+'%'};return _0x3c99f;})});}_0x52579b=_['merge']({},_0x52579b,_0x136f66['options']);return _0x4d2485[_0xcffd('0x73')](_0x52579b);}})[_0xcffd('0x27')](function(_0x2ca93d){if(_0x2ca93d){_0x569dcd=_0x2ca93d[_0xcffd('0x37')];if(!_0x136f66[_0xcffd('0x33')][_0xcffd('0x39')](_0xcffd('0x3a'))){_0x52579b[_0xcffd('0x21')]=qs[_0xcffd('0x21')](_0x136f66[_0xcffd('0x33')][_0xcffd('0x21')]);_0x52579b[_0xcffd('0x20')]=qs[_0xcffd('0x20')](_0x136f66[_0xcffd('0x33')][_0xcffd('0x20')]);}return _0x4d2485[_0xcffd('0x73')](_0x52579b);}})[_0xcffd('0x27')](function(_0x34fcc0){if(_0x34fcc0){return _0x34fcc0?{'count':_0x569dcd,'rows':_0x34fcc0}:null;}})[_0xcffd('0x27')](respondWithResult(_0x2370c4,null))['catch'](handleError(_0x2370c4,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 9bd8b7a..c642eb3 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 _0x97ec=['../../mysqldb','save','update','emit','hook','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x97ec,0x1a4));var _0xc97e=function(_0x56beed,_0x1b88e3){_0x56beed=_0x56beed-0x0;var _0x427282=_0x97ec[_0x56beed];return _0x427282;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xc97e('0x0'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xc97e('0x1'),'afterUpdate':_0xc97e('0x2'),'afterDestroy':'remove'};function emitEvent(_0x5db206){return function(_0x252e3f,_0x38d2e3,_0x5c0923){DashboardEvents['emit'](_0x5db206+':'+_0x252e3f['id'],_0x252e3f);DashboardEvents[_0xc97e('0x3')](_0x5db206,_0x252e3f);_0x5c0923(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard[_0xc97e('0x4')](e,emitEvent(event));}}module[_0xc97e('0x5')]=DashboardEvents; \ No newline at end of file +var _0x6053=['update','remove','emit','exports','events','../../mysqldb','Dashboard','setMaxListeners','save'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0x6053,0x112));var _0x3605=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x6053[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x3605('0x0'));var Dashboard=require(_0x3605('0x1'))['db'][_0x3605('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents[_0x3605('0x3')](0x0);var events={'afterCreate':_0x3605('0x4'),'afterUpdate':_0x3605('0x5'),'afterDestroy':_0x3605('0x6')};function emitEvent(_0x52a357){return function(_0xaf7f9c,_0x6bd18b,_0x26a058){DashboardEvents[_0x3605('0x7')](_0x52a357+':'+_0xaf7f9c['id'],_0xaf7f9c);DashboardEvents['emit'](_0x52a357,_0xaf7f9c);_0x26a058(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0x3605('0x8')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 5b8a50c..0fa21c2 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 _0xa6b9=['dashboards','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./dashboard.attributes','exports','Dashboard'];(function(_0x1ebaae,_0x270f11){var _0x53b153=function(_0x138c71){while(--_0x138c71){_0x1ebaae['push'](_0x1ebaae['shift']());}};_0x53b153(++_0x270f11);}(_0xa6b9,0x12a));var _0x9a6b=function(_0x1dc754,_0x10081f){_0x1dc754=_0x1dc754-0x0;var _0x18baf0=_0xa6b9[_0x1dc754];return _0x18baf0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9a6b('0x0'))(_0x9a6b('0x1'));var moment=require(_0x9a6b('0x2'));var BPromise=require(_0x9a6b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9a6b('0x4'));var rimraf=require(_0x9a6b('0x5'));var config=require(_0x9a6b('0x6'));var attributes=require(_0x9a6b('0x7'));module[_0x9a6b('0x8')]=function(_0x3d1fb8,_0x17403f){return _0x3d1fb8['define'](_0x9a6b('0x9'),attributes,{'tableName':_0x9a6b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ead=['lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','dashboards'];(function(_0x21350d,_0x33b1ca){var _0x5c2c7b=function(_0x6c1430){while(--_0x6c1430){_0x21350d['push'](_0x21350d['shift']());}};_0x5c2c7b(++_0x33b1ca);}(_0x7ead,0xcc));var _0xd7ea=function(_0x5f2ce9,_0x4d1037){_0x5f2ce9=_0x5f2ce9-0x0;var _0x4814ba=_0x7ead[_0x5f2ce9];return _0x4814ba;};'use strict';var _=require(_0xd7ea('0x0'));var util=require(_0xd7ea('0x1'));var logger=require(_0xd7ea('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd7ea('0x3'));var fs=require('fs');var path=require(_0xd7ea('0x4'));var rimraf=require(_0xd7ea('0x5'));var config=require(_0xd7ea('0x6'));var attributes=require(_0xd7ea('0x7'));module[_0xd7ea('0x8')]=function(_0x54ed4f,_0x19ab81){return _0x54ed4f[_0xd7ea('0x9')](_0xd7ea('0xa'),attributes,{'tableName':_0xd7ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index 10e1e19..88f8aed 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 _0xf795=['request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s'];(function(_0x594091,_0x5af2a0){var _0x1e30f6=function(_0x2b488b){while(--_0x2b488b){_0x594091['push'](_0x594091['shift']());}};_0x1e30f6(++_0x5af2a0);}(_0xf795,0x166));var _0x5f79=function(_0x37be00,_0x45514d){_0x37be00=_0x37be00-0x0;var _0x12b45f=_0xf795[_0x37be00];return _0x12b45f;};'use strict';var _=require('lodash');var util=require(_0x5f79('0x0'));var moment=require(_0x5f79('0x1'));var BPromise=require(_0x5f79('0x2'));var rs=require(_0x5f79('0x3'));var fs=require('fs');var Redis=require(_0x5f79('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5f79('0x5'));var logger=require('../../config/logger')(_0x5f79('0x6'));var config=require(_0x5f79('0x7'));var jayson=require(_0x5f79('0x8'));var client=jayson['client'][_0x5f79('0x9')]({'port':0x232a});config[_0x5f79('0xa')]=_[_0x5f79('0xb')](config[_0x5f79('0xa')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5f79('0xa')]));require(_0x5f79('0xc'))['register'](socket);function respondWithRpcPromise(_0x339575,_0x3c7706,_0x3026aa){return new BPromise(function(_0x245d89,_0x3079da){return client[_0x5f79('0xd')](_0x339575,_0x3026aa)[_0x5f79('0xe')](function(_0x13afc4){logger[_0x5f79('0xf')](_0x5f79('0x10'),_0x3c7706,_0x5f79('0x11'));logger['debug'](_0x5f79('0x12'),_0x3c7706,_0x5f79('0x11'),JSON[_0x5f79('0x13')](_0x13afc4));if(_0x13afc4[_0x5f79('0x14')]){if(_0x13afc4[_0x5f79('0x14')][_0x5f79('0x15')]===0x1f4){logger[_0x5f79('0x14')](_0x5f79('0x10'),_0x3c7706,_0x13afc4[_0x5f79('0x14')][_0x5f79('0x16')]);return _0x3079da(_0x13afc4[_0x5f79('0x14')][_0x5f79('0x16')]);}logger[_0x5f79('0x14')](_0x5f79('0x10'),_0x3c7706,_0x13afc4[_0x5f79('0x14')][_0x5f79('0x16')]);return _0x245d89(_0x13afc4['error'][_0x5f79('0x16')]);}else{logger[_0x5f79('0xf')](_0x5f79('0x10'),_0x3c7706,_0x5f79('0x11'));_0x245d89(_0x13afc4[_0x5f79('0x17')]['message']);}})[_0x5f79('0x18')](function(_0x3ffd16){logger[_0x5f79('0x14')](_0x5f79('0x10'),_0x3c7706,_0x3ffd16);_0x3079da(_0x3ffd16);});});} \ No newline at end of file +var _0xc536=['../../config/logger','rpc','../../config/environment','client','http','localhost','redis','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x215afd,_0x3b674c){var _0x35ba03=function(_0x186c96){while(--_0x186c96){_0x215afd['push'](_0x215afd['shift']());}};_0x35ba03(++_0x3b674c);}(_0xc536,0x14b));var _0x6c53=function(_0x5b1c2b,_0x16eb89){_0x5b1c2b=_0x5b1c2b-0x0;var _0x5bdc59=_0xc536[_0x5b1c2b];return _0x5bdc59;};'use strict';var _=require(_0x6c53('0x0'));var util=require(_0x6c53('0x1'));var moment=require(_0x6c53('0x2'));var BPromise=require('bluebird');var rs=require(_0x6c53('0x3'));var fs=require('fs');var Redis=require(_0x6c53('0x4'));var db=require(_0x6c53('0x5'))['db'];var utils=require(_0x6c53('0x6'));var logger=require(_0x6c53('0x7'))(_0x6c53('0x8'));var config=require(_0x6c53('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x6c53('0xa')][_0x6c53('0xb')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0x6c53('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6c53('0xd')]));require(_0x6c53('0xe'))[_0x6c53('0xf')](socket);function respondWithRpcPromise(_0x2fb229,_0x1aa0a9,_0x4004b0){return new BPromise(function(_0x549db4,_0x26e6a8){return client[_0x6c53('0x10')](_0x2fb229,_0x4004b0)[_0x6c53('0x11')](function(_0x38e52c){logger[_0x6c53('0x12')](_0x6c53('0x13'),_0x1aa0a9,_0x6c53('0x14'));logger['debug']('Dashboard,\x20%s,\x20%s,\x20%s',_0x1aa0a9,_0x6c53('0x14'),JSON[_0x6c53('0x15')](_0x38e52c));if(_0x38e52c[_0x6c53('0x16')]){if(_0x38e52c[_0x6c53('0x16')][_0x6c53('0x17')]===0x1f4){logger['error'](_0x6c53('0x13'),_0x1aa0a9,_0x38e52c[_0x6c53('0x16')][_0x6c53('0x18')]);return _0x26e6a8(_0x38e52c[_0x6c53('0x16')][_0x6c53('0x18')]);}logger[_0x6c53('0x16')](_0x6c53('0x13'),_0x1aa0a9,_0x38e52c[_0x6c53('0x16')]['message']);return _0x549db4(_0x38e52c[_0x6c53('0x16')][_0x6c53('0x18')]);}else{logger[_0x6c53('0x12')](_0x6c53('0x13'),_0x1aa0a9,_0x6c53('0x14'));_0x549db4(_0x38e52c['result']['message']);}})[_0x6c53('0x19')](function(_0x2c85f9){logger['error'](_0x6c53('0x13'),_0x1aa0a9,_0x2c85f9);_0x26e6a8(_0x2c85f9);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index a2f8894..c065672 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 _0xe702=['emit','removeListener','register','length','dashboard:','./dashboard.events','save','remove','update'];(function(_0x446614,_0x6676b){var _0x4256fd=function(_0x530ae6){while(--_0x530ae6){_0x446614['push'](_0x446614['shift']());}};_0x4256fd(++_0x6676b);}(_0xe702,0x68));var _0x2e70=function(_0x24237f,_0x4cf32c){_0x24237f=_0x24237f-0x0;var _0x48298e=_0xe702[_0x24237f];return _0x48298e;};'use strict';var DashboardEvents=require(_0x2e70('0x0'));var events=[_0x2e70('0x1'),_0x2e70('0x2'),_0x2e70('0x3')];function createListener(_0x41a1b0,_0x287d4c){return function(_0x237c36){_0x287d4c[_0x2e70('0x4')](_0x41a1b0,_0x237c36);};}function removeListener(_0x470ed0,_0x242aab){return function(){DashboardEvents[_0x2e70('0x5')](_0x470ed0,_0x242aab);};}exports[_0x2e70('0x6')]=function(_0x222c32){for(var _0x4acd92=0x0,_0x172e3f=events[_0x2e70('0x7')];_0x4acd92<_0x172e3f;_0x4acd92++){var _0x4aebb5=events[_0x4acd92];var _0x4bde7d=createListener(_0x2e70('0x8')+_0x4aebb5,_0x222c32);DashboardEvents['on'](_0x4aebb5,_0x4bde7d);}}; \ No newline at end of file +var _0xe67e=['removeListener','dashboard:','./dashboard.events','save','remove','update','emit'];(function(_0xba7871,_0x72a938){var _0x30b000=function(_0x2c12a8){while(--_0x2c12a8){_0xba7871['push'](_0xba7871['shift']());}};_0x30b000(++_0x72a938);}(_0xe67e,0x160));var _0xee67=function(_0x524c1d,_0x1f4623){_0x524c1d=_0x524c1d-0x0;var _0x4e3545=_0xe67e[_0x524c1d];return _0x4e3545;};'use strict';var DashboardEvents=require(_0xee67('0x0'));var events=[_0xee67('0x1'),_0xee67('0x2'),_0xee67('0x3')];function createListener(_0x28d1a6,_0x13f8c0){return function(_0x4ee97d){_0x13f8c0[_0xee67('0x4')](_0x28d1a6,_0x4ee97d);};}function removeListener(_0x3686f7,_0x543e56){return function(){DashboardEvents[_0xee67('0x5')](_0x3686f7,_0x543e56);};}exports['register']=function(_0x48f8e9){for(var _0x3d6644=0x0,_0x537161=events['length'];_0x3d6644<_0x537161;_0x3d6644++){var _0x3702c0=events[_0x3d6644];var _0x505181=createListener(_0xee67('0x6')+_0x3702c0,_0x48f8e9);DashboardEvents['on'](_0x3702c0,_0x505181);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 001931f..8e061e2 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 _0xb7e7=['addItem','put','update','delete','multer','path','express','../../components/auth/service','../../config/environment','./dashboard.controller','get','/:id','isAuthenticated','/:id/items','getItems','post','create','/:id/clone','clone'];(function(_0x288f5e,_0x205edd){var _0x476cc9=function(_0x796f53){while(--_0x796f53){_0x288f5e['push'](_0x288f5e['shift']());}};_0x476cc9(++_0x205edd);}(_0xb7e7,0x121));var _0x7b7e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xb7e7[_0x43d11d];return _0x38cd08;};'use strict';var multer=require(_0x7b7e('0x0'));var util=require('util');var path=require(_0x7b7e('0x1'));var timeout=require('connect-timeout');var express=require(_0x7b7e('0x2'));var router=express['Router']();var auth=require(_0x7b7e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x7b7e('0x4'));var controller=require(_0x7b7e('0x5'));router[_0x7b7e('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x7b7e('0x6')](_0x7b7e('0x7'),auth[_0x7b7e('0x8')](),controller['show']);router[_0x7b7e('0x6')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xa')]);router[_0x7b7e('0xb')]('/',auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xc')]);router['post'](_0x7b7e('0xd'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xe')]);router[_0x7b7e('0xb')](_0x7b7e('0x9'),auth[_0x7b7e('0x8')](),controller[_0x7b7e('0xf')]);router[_0x7b7e('0x10')](_0x7b7e('0x7'),auth['isAuthenticated'](),controller[_0x7b7e('0x11')]);router[_0x7b7e('0x12')]('/:id',auth[_0x7b7e('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +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(_0x2d2201,_0x3cfe3d){var _0x12e6cd=function(_0x5e4cf6){while(--_0x5e4cf6){_0x2d2201['push'](_0x2d2201['shift']());}};_0x12e6cd(++_0x3cfe3d);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x509273,_0x13fc9f){_0x509273=_0x509273-0x0;var _0x38ef40=_0xcb91[_0x509273];return _0x38ef40;};'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 diff --git a/server/api/dashboardItem/dashboardItem.attributes.js b/server/api/dashboardItem/dashboardItem.attributes.js index 041460d..afbe106 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 _0xf7ec=['getDataValue','attrs','setDataValue','stringify','INTEGER','#2196f3','squel','exports','STRING','long','parse'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xf7ec,0x1c9));var _0xcf7e=function(_0x3cdcbe,_0x450f7b){_0x3cdcbe=_0x3cdcbe-0x0;var _0x5846a1=_0xf7ec[_0x3cdcbe];return _0x5846a1;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xcf7e('0x0'));var _=require('lodash');module[_0xcf7e('0x1')]={'title':{'type':Sequelize[_0xcf7e('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xcf7e('0x2')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize['TEXT'](_0xcf7e('0x3')),'get':function(){try{return JSON[_0xcf7e('0x4')](this[_0xcf7e('0x5')](_0xcf7e('0x6')));}catch(_0x197bd5){return[];}},'set':function(_0x3e8b14){try{this[_0xcf7e('0x7')](_0xcf7e('0x6'),JSON[_0xcf7e('0x8')](_0x3e8b14));}catch(_0x1719f6){this[_0xcf7e('0x7')](_0xcf7e('0x6'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xcf7e('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xcf7e('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0xcf7e('0x9')]},'background':{'type':Sequelize[_0xcf7e('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xcf7e('0x2')],'allowNull':![],'defaultValue':_0xcf7e('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xcf7e('0x2')]}}; \ No newline at end of file +var _0x254d=['exports','STRING','TEXT','long','getDataValue','attrs','stringify','setDataValue','INTEGER','#ffffff','#2196f3','squel','lodash'];(function(_0x585b12,_0x24a33a){var _0x1fe29b=function(_0x3272e){while(--_0x3272e){_0x585b12['push'](_0x585b12['shift']());}};_0x1fe29b(++_0x24a33a);}(_0x254d,0x177));var _0xd254=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0x254d[_0x421725];return _0x51b322;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xd254('0x0'));var _=require(_0xd254('0x1'));module[_0xd254('0x2')]={'title':{'type':Sequelize[_0xd254('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd254('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xd254('0x4')](_0xd254('0x5')),'get':function(){try{return JSON['parse'](this[_0xd254('0x6')](_0xd254('0x7')));}catch(_0x248dc3){return[];}},'set':function(_0x39dc7c){try{this['setDataValue'](_0xd254('0x7'),JSON[_0xd254('0x8')](_0x39dc7c));}catch(_0x440804){this[_0xd254('0x9')](_0xd254('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xd254('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xd254('0xa')]},'col':{'type':Sequelize[_0xd254('0xa')]},'background':{'type':Sequelize[_0xd254('0x3')],'allowNull':![],'defaultValue':_0xd254('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xd254('0x3')],'allowNull':![],'defaultValue':_0xd254('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0xd254('0x3')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 5605988..2e2fb7b 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 _0x26f7=['custom','attrPath','attrHourFormat','HH:mm:ss','attrTimezone','attrFontSize','counter','attrMetric','attrVoiceQueues','multibar-chart','attrSerie1','total','attrSerie2','attrSerie3','attrReport','attrRefresh','error','stringify','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','count','offset','limit','set','json','reject','update','destroy','then','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','options','find','catch','DashboardItem','type','iframe','attrUrl','attrs','value','https://'];(function(_0x2967af,_0x3a7499){var _0x5895ef=function(_0x28db5a){while(--_0x28db5a){_0x2967af['push'](_0x2967af['shift']());}};_0x5895ef(++_0x3a7499);}(_0x26f7,0x6b));var _0x726f=function(_0x4fe5fb,_0x455c01){_0x4fe5fb=_0x4fe5fb-0x0;var _0x2470c0=_0x26f7[_0x4fe5fb];return _0x2470c0;};'use strict';var pdf=require(_0x726f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x726f('0x1'));var zipdir=require(_0x726f('0x2'));var jsonpatch=require(_0x726f('0x3'));var rp=require(_0x726f('0x4'));var moment=require(_0x726f('0x5'));var BPromise=require(_0x726f('0x6'));var Mustache=require('mustache');var util=require(_0x726f('0x7'));var path=require(_0x726f('0x8'));var sox=require(_0x726f('0x9'));var csv=require(_0x726f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x726f('0xb'));var squel=require(_0x726f('0xc'));var crypto=require(_0x726f('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x726f('0xa'));var querystring=require(_0x726f('0xe'));var Papa=require(_0x726f('0xf'));var Redis=require(_0x726f('0x10'));var authService=require(_0x726f('0x11'));var qs=require(_0x726f('0x12'));var as=require(_0x726f('0x13'));var hardwareService=require(_0x726f('0x14'));var logger=require(_0x726f('0x15'))(_0x726f('0x16'));var utils=require(_0x726f('0x17'));var config=require(_0x726f('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x726f('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x726f('0x1a'))(new Redis(config[_0x726f('0x19')]));require(_0x726f('0x1b'))[_0x726f('0x1c')](socket);function respondWithStatusCode(_0x498954,_0x1c0b43){_0x1c0b43=_0x1c0b43||0xcc;return function(_0x472563){if(_0x472563){return _0x498954[_0x726f('0x1d')](_0x1c0b43);}return _0x498954[_0x726f('0x1e')](_0x1c0b43)[_0x726f('0x1f')]();};}function respondWithResult(_0x19f7bb,_0x2c3e){_0x2c3e=_0x2c3e||0xc8;return function(_0x4b6074){if(_0x4b6074){return _0x19f7bb[_0x726f('0x1e')](_0x2c3e)['json'](_0x4b6074);}};}function respondWithFilteredResult(_0x3732a0,_0x37502d){return function(_0x53bd88){if(_0x53bd88){var _0x3e640b=_0x53bd88[_0x726f('0x20')],_0x5136e2=_0x37502d[_0x726f('0x21')],_0x290f43=_0x37502d[_0x726f('0x21')]+_0x37502d[_0x726f('0x22')],_0x537dd1;if(_0x290f43>=_0x3e640b){_0x290f43=_0x3e640b;_0x537dd1=0xc8;}else{_0x537dd1=0xce;}_0x3732a0[_0x726f('0x1e')](_0x537dd1);return _0x3732a0[_0x726f('0x23')]('Content-Range',_0x5136e2+'-'+_0x290f43+'/'+_0x3e640b)[_0x726f('0x24')](_0x53bd88);}return null;};}function patchUpdates(_0x56304f){return function(_0x14c2f0){try{jsonpatch['apply'](_0x14c2f0,_0x56304f,!![]);}catch(_0x224f52){return BPromise[_0x726f('0x25')](_0x224f52);}return _0x14c2f0['save']();};}function saveUpdates(_0x37cd54,_0x4097df){return function(_0x18c3a4){if(_0x18c3a4){return _0x18c3a4[_0x726f('0x26')](_0x37cd54)['then'](function(_0x4f338b){return _0x4f338b;});}return null;};}function removeEntity(_0x2e698f,_0x41417e){return function(_0x1f12ad){if(_0x1f12ad){return _0x1f12ad[_0x726f('0x27')]()[_0x726f('0x28')](function(){_0x2e698f[_0x726f('0x1e')](0xcc)[_0x726f('0x1f')]();});}};}function handleEntityNotFound(_0x2cd880,_0x36ec77){return function(_0x23076c){if(!_0x23076c){_0x2cd880['sendStatus'](0x194);}return _0x23076c;};}function handleError(_0x166209,_0x3b9959){_0x3b9959=_0x3b9959||0x1f4;return function(_0x802ab2){logger['error'](_0x802ab2['stack']);if(_0x802ab2[_0x726f('0x29')]){delete _0x802ab2[_0x726f('0x29')];}_0x166209[_0x726f('0x1e')](_0x3b9959)[_0x726f('0x2a')](_0x802ab2);};}exports[_0x726f('0x2b')]=function(_0x135d00,_0x4dd239){var _0xb17a2={'raw':![],'where':{'id':_0x135d00[_0x726f('0x2c')]['id']}},_0x1039f8={};_0x1039f8[_0x726f('0x2d')]=_[_0x726f('0x2e')](db['DashboardItem'][_0x726f('0x2f')]);_0x1039f8[_0x726f('0x30')]=_[_0x726f('0x2e')](_0x135d00['query']);_0x1039f8[_0x726f('0x31')]=_[_0x726f('0x32')](_0x1039f8[_0x726f('0x2d')],_0x1039f8[_0x726f('0x30')]);_0xb17a2['attributes']=_[_0x726f('0x32')](_0x1039f8[_0x726f('0x2d')],qs[_0x726f('0x33')](_0x135d00[_0x726f('0x30')][_0x726f('0x33')]));_0xb17a2[_0x726f('0x34')]=_0xb17a2[_0x726f('0x34')][_0x726f('0x35')]?_0xb17a2[_0x726f('0x34')]:_0x1039f8[_0x726f('0x2d')];if(_0x135d00[_0x726f('0x30')][_0x726f('0x36')]){_0xb17a2[_0x726f('0x37')]=[{'all':!![]}];}_0xb17a2=_[_0x726f('0x38')]({},_0xb17a2,_0x135d00[_0x726f('0x39')]);return db['DashboardItem'][_0x726f('0x3a')](_0xb17a2)[_0x726f('0x28')](handleEntityNotFound(_0x4dd239,null))['then'](respondWithResult(_0x4dd239,null))[_0x726f('0x3b')](handleError(_0x4dd239,null));};exports[_0x726f('0x27')]=function(_0x4a4fb5,_0x2fd715){return db[_0x726f('0x3c')][_0x726f('0x3a')]({'where':{'id':_0x4a4fb5['params']['id']}})[_0x726f('0x28')](handleEntityNotFound(_0x2fd715,null))[_0x726f('0x28')](removeEntity(_0x2fd715,null))['catch'](handleError(_0x2fd715,null));};function widgetAttributes(_0x230d28){try{switch(_0x230d28[_0x726f('0x3d')]){case _0x726f('0x3e'):return[{'name':_0x726f('0x3f'),'value':_0x230d28[_0x726f('0x3f')]||(_0x230d28['attrs']&&_0x230d28[_0x726f('0x40')][0x0]?_0x230d28['attrs'][0x0][_0x726f('0x41')]:undefined)||_0x726f('0x42')}];case _0x726f('0x43'):return[{'name':_0x726f('0x44'),'value':_0x230d28[_0x726f('0x44')]||(_0x230d28['attrs']&&_0x230d28[_0x726f('0x40')][0x0]?_0x230d28['attrs'][0x0]['value']:undefined)||''}];case'clock':return[{'name':_0x726f('0x45'),'value':_0x230d28[_0x726f('0x45')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x0]?_0x230d28['attrs'][0x0][_0x726f('0x41')]:undefined)||_0x726f('0x46')},{'name':_0x726f('0x47'),'value':_0x230d28[_0x726f('0x47')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x1]?_0x230d28[_0x726f('0x40')][0x1][_0x726f('0x41')]:undefined)||'0.00'},{'name':_0x726f('0x48'),'value':_0x230d28[_0x726f('0x48')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28['attrs'][0x2]?_0x230d28[_0x726f('0x40')][0x2][_0x726f('0x41')]:undefined)||0xc}];case _0x726f('0x49'):return[{'name':'attrMetric','value':_0x230d28[_0x726f('0x4a')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x0]?_0x230d28[_0x726f('0x40')][0x0]['value']:undefined)||'total'},{'name':'attrVoiceQueues','value':_0x230d28[_0x726f('0x4b')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x1]?_0x230d28[_0x726f('0x40')][0x1][_0x726f('0x41')]:undefined)||[]},{'name':_0x726f('0x48'),'value':_0x230d28[_0x726f('0x48')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x2]?_0x230d28[_0x726f('0x40')][0x2][_0x726f('0x41')]:undefined)||0x14}];case _0x726f('0x4c'):case'pie-chart':return[{'name':_0x726f('0x4d'),'value':_0x230d28[_0x726f('0x4d')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x0]?_0x230d28[_0x726f('0x40')][0x0][_0x726f('0x41')]:undefined)||_0x726f('0x4e')},{'name':_0x726f('0x4f'),'value':_0x230d28[_0x726f('0x4f')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x1]?_0x230d28[_0x726f('0x40')][0x1][_0x726f('0x41')]:undefined)||null},{'name':'attrSerie3','value':_0x230d28[_0x726f('0x50')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x2]?_0x230d28[_0x726f('0x40')][0x2][_0x726f('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x230d28[_0x726f('0x4b')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28[_0x726f('0x40')][0x3]?_0x230d28['attrs'][0x3][_0x726f('0x41')]:undefined)||[]}];case'web-report':return[{'name':_0x726f('0x51'),'type':_0x230d28['reportType']||(_0x230d28['attrs']&&_0x230d28[_0x726f('0x40')][0x0]?_0x230d28[_0x726f('0x40')][0x0][_0x726f('0x3d')]:undefined)||null,'value':_0x230d28['attrReport']||(_0x230d28[_0x726f('0x40')]&&_0x230d28['attrs'][0x0]?_0x230d28[_0x726f('0x40')][0x0][_0x726f('0x41')]:undefined)||null},{'name':'attrRefresh','value':_0x230d28[_0x726f('0x52')]||(_0x230d28[_0x726f('0x40')]&&_0x230d28['attrs'][0x1]?_0x230d28['attrs'][0x1][_0x726f('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x44a701){logger[_0x726f('0x53')]('widgetAttributes:\x20%s',JSON[_0x726f('0x54')](_0x44a701));return[];}}exports[_0x726f('0x55')]=function(_0x3d8187,_0x7257a){if(_0x3d8187[_0x726f('0x56')]){_0x3d8187[_0x726f('0x56')][_0x726f('0x40')]=widgetAttributes(_0x3d8187[_0x726f('0x56')]);}return db[_0x726f('0x3c')][_0x726f('0x55')](_0x3d8187[_0x726f('0x56')],{})[_0x726f('0x28')](respondWithResult(_0x7257a,0xc9))['catch'](handleError(_0x7257a,null));};exports[_0x726f('0x26')]=function(_0xb81068,_0x34611a){if(_0xb81068[_0x726f('0x56')]['id']){delete _0xb81068[_0x726f('0x56')]['id'];}_0xb81068['body'][_0x726f('0x40')]=widgetAttributes(_0xb81068[_0x726f('0x56')]);return db[_0x726f('0x3c')]['find']({'where':{'id':_0xb81068['params']['id']}})[_0x726f('0x28')](handleEntityNotFound(_0x34611a,null))['then'](saveUpdates(_0xb81068[_0x726f('0x56')],null))['then'](respondWithResult(_0x34611a,null))[_0x726f('0x3b')](handleError(_0x34611a,null));}; \ No newline at end of file +var _0x0af4=['api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','json','count','offset','set','apply','save','update','then','send','show','DashboardItem','rawAttributes','query','keys','intersection','model','attributes','fields','length','includeAll','include','catch','destroy','params','type','attrUrl','attrs','value','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','reportType','attrReport','attrRefresh','error','widgetAttributes:\x20%s','stringify','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0af4,0x9b));var _0x40af=function(_0x4ebce9,_0x32d7bf){_0x4ebce9=_0x4ebce9-0x0;var _0x4352ed=_0x0af4[_0x4ebce9];return _0x4352ed;};'use strict';var pdf=require(_0x40af('0x0'));var emlformat=require(_0x40af('0x1'));var rimraf=require(_0x40af('0x2'));var zipdir=require(_0x40af('0x3'));var jsonpatch=require(_0x40af('0x4'));var rp=require(_0x40af('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x40af('0x6'));var util=require(_0x40af('0x7'));var path=require(_0x40af('0x8'));var sox=require(_0x40af('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x40af('0xa'));var crypto=require(_0x40af('0xb'));var jsforce=require(_0x40af('0xc'));var deskjs=require(_0x40af('0xd'));var toCsv=require(_0x40af('0xe'));var querystring=require(_0x40af('0xf'));var Papa=require(_0x40af('0x10'));var Redis=require(_0x40af('0x11'));var authService=require(_0x40af('0x12'));var qs=require(_0x40af('0x13'));var as=require(_0x40af('0x14'));var hardwareService=require(_0x40af('0x15'));var logger=require(_0x40af('0x16'))(_0x40af('0x17'));var utils=require(_0x40af('0x18'));var config=require(_0x40af('0x19'));var db=require(_0x40af('0x1a'))['db'];config[_0x40af('0x1b')]=_[_0x40af('0x1c')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x40af('0x1d'))(new Redis(config['redis']));require(_0x40af('0x1e'))[_0x40af('0x1f')](socket);function respondWithStatusCode(_0x29f742,_0x2ceb38){_0x2ceb38=_0x2ceb38||0xcc;return function(_0x579a91){if(_0x579a91){return _0x29f742[_0x40af('0x20')](_0x2ceb38);}return _0x29f742[_0x40af('0x21')](_0x2ceb38)[_0x40af('0x22')]();};}function respondWithResult(_0x322e2c,_0x46ccf3){_0x46ccf3=_0x46ccf3||0xc8;return function(_0x5cb713){if(_0x5cb713){return _0x322e2c['status'](_0x46ccf3)[_0x40af('0x23')](_0x5cb713);}};}function respondWithFilteredResult(_0x5ddd08,_0x103db5){return function(_0x27cd4b){if(_0x27cd4b){var _0x50fc34=_0x27cd4b[_0x40af('0x24')],_0x4d0abf=_0x103db5[_0x40af('0x25')],_0x3de601=_0x103db5[_0x40af('0x25')]+_0x103db5['limit'],_0x350e1e;if(_0x3de601>=_0x50fc34){_0x3de601=_0x50fc34;_0x350e1e=0xc8;}else{_0x350e1e=0xce;}_0x5ddd08[_0x40af('0x21')](_0x350e1e);return _0x5ddd08[_0x40af('0x26')]('Content-Range',_0x4d0abf+'-'+_0x3de601+'/'+_0x50fc34)[_0x40af('0x23')](_0x27cd4b);}return null;};}function patchUpdates(_0xea876c){return function(_0x5675f1){try{jsonpatch[_0x40af('0x27')](_0x5675f1,_0xea876c,!![]);}catch(_0x519c2e){return BPromise['reject'](_0x519c2e);}return _0x5675f1[_0x40af('0x28')]();};}function saveUpdates(_0xc78531,_0x4c5feb){return function(_0x5b4bd3){if(_0x5b4bd3){return _0x5b4bd3[_0x40af('0x29')](_0xc78531)[_0x40af('0x2a')](function(_0xe8740){return _0xe8740;});}return null;};}function removeEntity(_0x80eee3,_0x1e700c){return function(_0x226766){if(_0x226766){return _0x226766['destroy']()[_0x40af('0x2a')](function(){_0x80eee3[_0x40af('0x21')](0xcc)[_0x40af('0x22')]();});}};}function handleEntityNotFound(_0x274cf2,_0x5873e8){return function(_0x492d84){if(!_0x492d84){_0x274cf2['sendStatus'](0x194);}return _0x492d84;};}function handleError(_0x30f351,_0x23b243){_0x23b243=_0x23b243||0x1f4;return function(_0x32c3a6){logger['error'](_0x32c3a6['stack']);if(_0x32c3a6['name']){delete _0x32c3a6['name'];}_0x30f351[_0x40af('0x21')](_0x23b243)[_0x40af('0x2b')](_0x32c3a6);};}exports[_0x40af('0x2c')]=function(_0x1f43a6,_0x18d86c){var _0x4cc906={'raw':![],'where':{'id':_0x1f43a6['params']['id']}},_0x17dc64={};_0x17dc64['model']=_['keys'](db[_0x40af('0x2d')][_0x40af('0x2e')]);_0x17dc64[_0x40af('0x2f')]=_[_0x40af('0x30')](_0x1f43a6[_0x40af('0x2f')]);_0x17dc64['filters']=_[_0x40af('0x31')](_0x17dc64[_0x40af('0x32')],_0x17dc64[_0x40af('0x2f')]);_0x4cc906[_0x40af('0x33')]=_[_0x40af('0x31')](_0x17dc64[_0x40af('0x32')],qs[_0x40af('0x34')](_0x1f43a6[_0x40af('0x2f')]['fields']));_0x4cc906[_0x40af('0x33')]=_0x4cc906['attributes'][_0x40af('0x35')]?_0x4cc906[_0x40af('0x33')]:_0x17dc64['model'];if(_0x1f43a6['query'][_0x40af('0x36')]){_0x4cc906[_0x40af('0x37')]=[{'all':!![]}];}_0x4cc906=_['merge']({},_0x4cc906,_0x1f43a6['options']);return db[_0x40af('0x2d')]['find'](_0x4cc906)[_0x40af('0x2a')](handleEntityNotFound(_0x18d86c,null))[_0x40af('0x2a')](respondWithResult(_0x18d86c,null))[_0x40af('0x38')](handleError(_0x18d86c,null));};exports[_0x40af('0x39')]=function(_0x3ded07,_0x48828e){return db[_0x40af('0x2d')]['find']({'where':{'id':_0x3ded07[_0x40af('0x3a')]['id']}})[_0x40af('0x2a')](handleEntityNotFound(_0x48828e,null))[_0x40af('0x2a')](removeEntity(_0x48828e,null))[_0x40af('0x38')](handleError(_0x48828e,null));};function widgetAttributes(_0x480f8c){try{switch(_0x480f8c[_0x40af('0x3b')]){case'iframe':return[{'name':_0x40af('0x3c'),'value':_0x480f8c[_0x40af('0x3c')]||(_0x480f8c['attrs']&&_0x480f8c[_0x40af('0x3d')][0x0]?_0x480f8c[_0x40af('0x3d')][0x0][_0x40af('0x3e')]:undefined)||'https://'}];case'custom':return[{'name':_0x40af('0x3f'),'value':_0x480f8c[_0x40af('0x3f')]||(_0x480f8c[_0x40af('0x3d')]&&_0x480f8c['attrs'][0x0]?_0x480f8c[_0x40af('0x3d')][0x0][_0x40af('0x3e')]:undefined)||''}];case _0x40af('0x40'):return[{'name':'attrHourFormat','value':_0x480f8c[_0x40af('0x41')]||(_0x480f8c['attrs']&&_0x480f8c['attrs'][0x0]?_0x480f8c[_0x40af('0x3d')][0x0][_0x40af('0x3e')]:undefined)||_0x40af('0x42')},{'name':_0x40af('0x43'),'value':_0x480f8c[_0x40af('0x43')]||(_0x480f8c[_0x40af('0x3d')]&&_0x480f8c[_0x40af('0x3d')][0x1]?_0x480f8c[_0x40af('0x3d')][0x1][_0x40af('0x3e')]:undefined)||_0x40af('0x44')},{'name':_0x40af('0x45'),'value':_0x480f8c['attrFontSize']||(_0x480f8c[_0x40af('0x3d')]&&_0x480f8c[_0x40af('0x3d')][0x2]?_0x480f8c[_0x40af('0x3d')][0x2][_0x40af('0x3e')]:undefined)||0xc}];case _0x40af('0x46'):return[{'name':_0x40af('0x47'),'value':_0x480f8c[_0x40af('0x47')]||(_0x480f8c['attrs']&&_0x480f8c[_0x40af('0x3d')][0x0]?_0x480f8c[_0x40af('0x3d')][0x0]['value']:undefined)||_0x40af('0x48')},{'name':'attrVoiceQueues','value':_0x480f8c[_0x40af('0x49')]||(_0x480f8c['attrs']&&_0x480f8c[_0x40af('0x3d')][0x1]?_0x480f8c['attrs'][0x1][_0x40af('0x3e')]:undefined)||[]},{'name':_0x40af('0x45'),'value':_0x480f8c[_0x40af('0x45')]||(_0x480f8c['attrs']&&_0x480f8c[_0x40af('0x3d')][0x2]?_0x480f8c[_0x40af('0x3d')][0x2]['value']:undefined)||0x14}];case _0x40af('0x4a'):case _0x40af('0x4b'):return[{'name':_0x40af('0x4c'),'value':_0x480f8c[_0x40af('0x4c')]||(_0x480f8c['attrs']&&_0x480f8c[_0x40af('0x3d')][0x0]?_0x480f8c[_0x40af('0x3d')][0x0]['value']:undefined)||_0x40af('0x48')},{'name':_0x40af('0x4d'),'value':_0x480f8c['attrSerie2']||(_0x480f8c[_0x40af('0x3d')]&&_0x480f8c[_0x40af('0x3d')][0x1]?_0x480f8c[_0x40af('0x3d')][0x1][_0x40af('0x3e')]:undefined)||null},{'name':_0x40af('0x4e'),'value':_0x480f8c[_0x40af('0x4e')]||(_0x480f8c[_0x40af('0x3d')]&&_0x480f8c[_0x40af('0x3d')][0x2]?_0x480f8c[_0x40af('0x3d')][0x2][_0x40af('0x3e')]:undefined)||null},{'name':_0x40af('0x49'),'value':_0x480f8c[_0x40af('0x49')]||(_0x480f8c['attrs']&&_0x480f8c['attrs'][0x3]?_0x480f8c['attrs'][0x3][_0x40af('0x3e')]:undefined)||[]}];case _0x40af('0x4f'):return[{'name':'attrReport','type':_0x480f8c[_0x40af('0x50')]||(_0x480f8c[_0x40af('0x3d')]&&_0x480f8c[_0x40af('0x3d')][0x0]?_0x480f8c[_0x40af('0x3d')][0x0][_0x40af('0x3b')]:undefined)||null,'value':_0x480f8c[_0x40af('0x51')]||(_0x480f8c[_0x40af('0x3d')]&&_0x480f8c[_0x40af('0x3d')][0x0]?_0x480f8c[_0x40af('0x3d')][0x0]['value']:undefined)||null},{'name':_0x40af('0x52'),'value':_0x480f8c[_0x40af('0x52')]||(_0x480f8c[_0x40af('0x3d')]&&_0x480f8c[_0x40af('0x3d')][0x1]?_0x480f8c[_0x40af('0x3d')][0x1][_0x40af('0x3e')]:undefined)||0x0}];default:return[];}}catch(_0x54778a){logger[_0x40af('0x53')](_0x40af('0x54'),JSON[_0x40af('0x55')](_0x54778a));return[];}}exports[_0x40af('0x56')]=function(_0x380c50,_0x5edf09){if(_0x380c50['body']){_0x380c50['body']['attrs']=widgetAttributes(_0x380c50[_0x40af('0x57')]);}return db[_0x40af('0x2d')][_0x40af('0x56')](_0x380c50[_0x40af('0x57')],{})['then'](respondWithResult(_0x5edf09,0xc9))[_0x40af('0x38')](handleError(_0x5edf09,null));};exports[_0x40af('0x29')]=function(_0x5ea4ad,_0x39b27c){if(_0x5ea4ad[_0x40af('0x57')]['id']){delete _0x5ea4ad[_0x40af('0x57')]['id'];}_0x5ea4ad[_0x40af('0x57')][_0x40af('0x3d')]=widgetAttributes(_0x5ea4ad[_0x40af('0x57')]);return db['DashboardItem'][_0x40af('0x58')]({'where':{'id':_0x5ea4ad[_0x40af('0x3a')]['id']}})[_0x40af('0x2a')](handleEntityNotFound(_0x39b27c,null))[_0x40af('0x2a')](saveUpdates(_0x5ea4ad[_0x40af('0x57')],null))['then'](respondWithResult(_0x39b27c,null))[_0x40af('0x38')](handleError(_0x39b27c,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index ac5f036..1726436 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 _0xabe5=['hook','events','DashboardItem','setMaxListeners','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xabe5,0x1c3));var _0x5abe=function(_0x4342e1,_0x5880f1){_0x4342e1=_0x4342e1-0x0;var _0x4aaa29=_0xabe5[_0x4342e1];return _0x4aaa29;};'use strict';var EventEmitter=require(_0x5abe('0x0'));var DashboardItem=require('../../mysqldb')['db'][_0x5abe('0x1')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x5abe('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x59654e){return function(_0x48a981,_0x4ee8d7,_0x37f268){DashboardItemEvents[_0x5abe('0x3')](_0x59654e+':'+_0x48a981['id'],_0x48a981);DashboardItemEvents[_0x5abe('0x3')](_0x59654e,_0x48a981);_0x37f268(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0x5abe('0x4')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0x77ed=['hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','update','remove','emit'];(function(_0x4ee753,_0x616958){var _0xf21dd1=function(_0x4e8a52){while(--_0x4e8a52){_0x4ee753['push'](_0x4ee753['shift']());}};_0xf21dd1(++_0x616958);}(_0x77ed,0x152));var _0xd77e=function(_0xaa306d,_0x9fa7e8){_0xaa306d=_0xaa306d-0x0;var _0x11f899=_0x77ed[_0xaa306d];return _0x11f899;};'use strict';var EventEmitter=require(_0xd77e('0x0'));var DashboardItem=require(_0xd77e('0x1'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0xd77e('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd77e('0x3'),'afterDestroy':_0xd77e('0x4')};function emitEvent(_0x50a8d8){return function(_0x2e983c,_0x2b1944,_0xd010bc){DashboardItemEvents[_0xd77e('0x5')](_0x50a8d8+':'+_0x2e983c['id'],_0x2e983c);DashboardItemEvents[_0xd77e('0x5')](_0x50a8d8,_0x2e983c);_0xd010bc(null);};}for(var e in events){if(events[_0xd77e('0x6')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0xd77e('0x7')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 43d5fd4..db3d161 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 _0x437e=['exports','define','DashboardItem','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes'];(function(_0x47604d,_0x15a014){var _0x388e4c=function(_0x42a446){while(--_0x42a446){_0x47604d['push'](_0x47604d['shift']());}};_0x388e4c(++_0x15a014);}(_0x437e,0x1e3));var _0xe437=function(_0x127d9e,_0x470cd4){_0x127d9e=_0x127d9e-0x0;var _0x2d8ddb=_0x437e[_0x127d9e];return _0x2d8ddb;};'use strict';var _=require(_0xe437('0x0'));var util=require('util');var logger=require(_0xe437('0x1'))(_0xe437('0x2'));var moment=require(_0xe437('0x3'));var BPromise=require(_0xe437('0x4'));var rp=require(_0xe437('0x5'));var fs=require('fs');var path=require(_0xe437('0x6'));var rimraf=require(_0xe437('0x7'));var config=require('../../config/environment');var attributes=require(_0xe437('0x8'));module[_0xe437('0x9')]=function(_0x518b1c,_0x5040e8){return _0x518b1c[_0xe437('0xa')](_0xe437('0xb'),attributes,{'tableName':'dashboard_items','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5c31=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./dashboardItem.attributes','exports','DashboardItem','dashboard_items','lodash'];(function(_0x5a4844,_0x238d0a){var _0x483926=function(_0x2d1f81){while(--_0x2d1f81){_0x5a4844['push'](_0x5a4844['shift']());}};_0x483926(++_0x238d0a);}(_0x5c31,0x83));var _0x15c3=function(_0x45b761,_0x36032b){_0x45b761=_0x45b761-0x0;var _0x3fe875=_0x5c31[_0x45b761];return _0x3fe875;};'use strict';var _=require(_0x15c3('0x0'));var util=require('util');var logger=require(_0x15c3('0x1'))(_0x15c3('0x2'));var moment=require(_0x15c3('0x3'));var BPromise=require(_0x15c3('0x4'));var rp=require(_0x15c3('0x5'));var fs=require('fs');var path=require(_0x15c3('0x6'));var rimraf=require(_0x15c3('0x7'));var config=require('../../config/environment');var attributes=require(_0x15c3('0x8'));module[_0x15c3('0x9')]=function(_0x54e940,_0x3281f0){return _0x54e940['define'](_0x15c3('0xa'),attributes,{'tableName':_0x15c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.rpc.js b/server/api/dashboardItem/dashboardItem.rpc.js index dea8c41..d8887ac 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 _0x3770=['socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3770,0xfd));var _0x0377=function(_0x2f494d,_0xe0fe6a){_0x2f494d=_0x2f494d-0x0;var _0x24c0e2=_0x3770[_0x2f494d];return _0x24c0e2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0377('0x0'));var BPromise=require(_0x0377('0x1'));var rs=require(_0x0377('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0377('0x3'))['db'];var utils=require(_0x0377('0x4'));var logger=require(_0x0377('0x5'))(_0x0377('0x6'));var config=require(_0x0377('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x0377('0x8')][_0x0377('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0377('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x0377('0xb'))(new Redis(config[_0x0377('0xa')]));require(_0x0377('0xc'))[_0x0377('0xd')](socket);function respondWithRpcPromise(_0x1a0c0b,_0x329211,_0x30e124){return new BPromise(function(_0x31f05b,_0x56cd90){return client[_0x0377('0xe')](_0x1a0c0b,_0x30e124)[_0x0377('0xf')](function(_0x2c8380){logger[_0x0377('0x10')](_0x0377('0x11'),_0x329211,_0x0377('0x12'));logger[_0x0377('0x13')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x329211,'request\x20sent',JSON[_0x0377('0x14')](_0x2c8380));if(_0x2c8380[_0x0377('0x15')]){if(_0x2c8380[_0x0377('0x15')]['code']===0x1f4){logger[_0x0377('0x15')](_0x0377('0x11'),_0x329211,_0x2c8380[_0x0377('0x15')][_0x0377('0x16')]);return _0x56cd90(_0x2c8380[_0x0377('0x15')][_0x0377('0x16')]);}logger['error'](_0x0377('0x11'),_0x329211,_0x2c8380[_0x0377('0x15')][_0x0377('0x16')]);return _0x31f05b(_0x2c8380[_0x0377('0x15')]['message']);}else{logger[_0x0377('0x10')]('DashboardItem,\x20%s,\x20%s',_0x329211,'request\x20sent');_0x31f05b(_0x2c8380['result'][_0x0377('0x16')]);}})[_0x0377('0x17')](function(_0x277556){logger[_0x0377('0x15')](_0x0377('0x11'),_0x329211,_0x277556);_0x56cd90(_0x277556);});});} \ No newline at end of file +var _0x1d70=['client','redis','defaults','localhost','register','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','moment','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3f940e,_0x140c3b){var _0x424b2e=function(_0x3f2fb4){while(--_0x3f2fb4){_0x3f940e['push'](_0x3f940e['shift']());}};_0x424b2e(++_0x140c3b);}(_0x1d70,0xf2));var _0x01d7=function(_0x120cbe,_0x4a0981){_0x120cbe=_0x120cbe-0x0;var _0x1d2864=_0x1d70[_0x120cbe];return _0x1d2864;};'use strict';var _=require(_0x01d7('0x0'));var util=require('util');var moment=require(_0x01d7('0x1'));var BPromise=require('bluebird');var rs=require(_0x01d7('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x01d7('0x3'));var logger=require(_0x01d7('0x4'))(_0x01d7('0x5'));var config=require(_0x01d7('0x6'));var jayson=require(_0x01d7('0x7'));var client=jayson[_0x01d7('0x8')]['http']({'port':0x232a});config[_0x01d7('0x9')]=_[_0x01d7('0xa')](config[_0x01d7('0x9')],{'host':_0x01d7('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboardItem.socket')[_0x01d7('0xc')](socket);function respondWithRpcPromise(_0x3a49c7,_0x338e7f,_0x4b5d73){return new BPromise(function(_0x370f97,_0x4d2bfb){return client['request'](_0x3a49c7,_0x4b5d73)[_0x01d7('0xd')](function(_0x41fbda){logger['info'](_0x01d7('0xe'),_0x338e7f,_0x01d7('0xf'));logger[_0x01d7('0x10')](_0x01d7('0x11'),_0x338e7f,_0x01d7('0xf'),JSON[_0x01d7('0x12')](_0x41fbda));if(_0x41fbda['error']){if(_0x41fbda['error'][_0x01d7('0x13')]===0x1f4){logger[_0x01d7('0x14')](_0x01d7('0xe'),_0x338e7f,_0x41fbda[_0x01d7('0x14')][_0x01d7('0x15')]);return _0x4d2bfb(_0x41fbda[_0x01d7('0x14')]['message']);}logger[_0x01d7('0x14')](_0x01d7('0xe'),_0x338e7f,_0x41fbda[_0x01d7('0x14')][_0x01d7('0x15')]);return _0x370f97(_0x41fbda['error'][_0x01d7('0x15')]);}else{logger[_0x01d7('0x16')](_0x01d7('0xe'),_0x338e7f,_0x01d7('0xf'));_0x370f97(_0x41fbda[_0x01d7('0x17')][_0x01d7('0x15')]);}})[_0x01d7('0x18')](function(_0x496f90){logger[_0x01d7('0x14')](_0x01d7('0xe'),_0x338e7f,_0x496f90);_0x4d2bfb(_0x496f90);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index a9a309c..a07a17f 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 _0x4f49=['register','length','save','update','emit'];(function(_0x47d1dc,_0x1073e7){var _0x58f535=function(_0xcb55d6){while(--_0xcb55d6){_0x47d1dc['push'](_0x47d1dc['shift']());}};_0x58f535(++_0x1073e7);}(_0x4f49,0x174));var _0x94f4=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x4f49[_0x42cae2];return _0x5f256f;};'use strict';var DashboardItemEvents=require('./dashboardItem.events');var events=[_0x94f4('0x0'),'remove',_0x94f4('0x1')];function createListener(_0x2c35e9,_0x146204){return function(_0x2d7c22){_0x146204[_0x94f4('0x2')](_0x2c35e9,_0x2d7c22);};}function removeListener(_0x92933c,_0x16d4da){return function(){DashboardItemEvents['removeListener'](_0x92933c,_0x16d4da);};}exports[_0x94f4('0x3')]=function(_0x3a711c){for(var _0x531e4d=0x0,_0x32f0cf=events[_0x94f4('0x4')];_0x531e4d<_0x32f0cf;_0x531e4d++){var _0x278ee9=events[_0x531e4d];var _0x400723=createListener('dashboardItem:'+_0x278ee9,_0x3a711c);DashboardItemEvents['on'](_0x278ee9,_0x400723);}}; \ No newline at end of file +var _0xc055=['update','emit','removeListener','register','length','dashboardItem:','./dashboardItem.events','save','remove'];(function(_0x4ea413,_0x51ff3a){var _0x51cf25=function(_0x3c6456){while(--_0x3c6456){_0x4ea413['push'](_0x4ea413['shift']());}};_0x51cf25(++_0x51ff3a);}(_0xc055,0x8d));var _0x5c05=function(_0x3ae3aa,_0x5cbfaa){_0x3ae3aa=_0x3ae3aa-0x0;var _0x2a9dd7=_0xc055[_0x3ae3aa];return _0x2a9dd7;};'use strict';var DashboardItemEvents=require(_0x5c05('0x0'));var events=[_0x5c05('0x1'),_0x5c05('0x2'),_0x5c05('0x3')];function createListener(_0x5ee791,_0x4af04a){return function(_0x458379){_0x4af04a[_0x5c05('0x4')](_0x5ee791,_0x458379);};}function removeListener(_0x271429,_0x77b064){return function(){DashboardItemEvents[_0x5c05('0x5')](_0x271429,_0x77b064);};}exports[_0x5c05('0x6')]=function(_0x2b424f){for(var _0xa61b33=0x0,_0x336f57=events[_0x5c05('0x7')];_0xa61b33<_0x336f57;_0xa61b33++){var _0xed1380=events[_0xa61b33];var _0x41391e=createListener(_0x5c05('0x8')+_0xed1380,_0x2b424f);DashboardItemEvents['on'](_0xed1380,_0x41391e);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index df944cd..0f71158 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 _0x814b=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','post','put'];(function(_0x235219,_0x445d7e){var _0x36b248=function(_0x15814d){while(--_0x15814d){_0x235219['push'](_0x235219['shift']());}};_0x36b248(++_0x445d7e);}(_0x814b,0x1a2));var _0xb814=function(_0x5ff517,_0x3e4ee0){_0x5ff517=_0x5ff517-0x0;var _0x19a245=_0x814b[_0x5ff517];return _0x19a245;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller['show']);router[_0xb814('0xc')]('/',auth[_0xb814('0xb')](),controller['create']);router[_0xb814('0xd')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')](_0xb814('0xa'),auth[_0xb814('0xb')](),controller[_0xb814('0x10')]);module[_0xb814('0x11')]=router; \ No newline at end of file +var _0x1261=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','show','post','create','put','/:id','isAuthenticated','update','destroy'];(function(_0x1d119a,_0x3b44bb){var _0x36518f=function(_0x5479be){while(--_0x5479be){_0x1d119a['push'](_0x1d119a['shift']());}};_0x36518f(++_0x3b44bb);}(_0x1261,0x144));var _0x1126=function(_0x42bfb7,_0x25a3ec){_0x42bfb7=_0x42bfb7-0x0;var _0x5c497d=_0x1261[_0x42bfb7];return _0x5c497d;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x1126('0xa')]);router[_0x1126('0xb')]('/',auth['isAuthenticated'](),controller[_0x1126('0xc')]);router[_0x1126('0xd')](_0x1126('0xe'),auth[_0x1126('0xf')](),controller[_0x1126('0x10')]);router['delete'](_0x1126('0xe'),auth[_0x1126('0xf')](),controller[_0x1126('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index c1d70f7..5b3c784 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 _0x07bb=['STRING','sequelize','exports'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x07bb,0x8e));var _0xb07b=function(_0x334282,_0x1339fd){_0x334282=_0x334282-0x0;var _0xc94768=_0x07bb[_0x334282];return _0xc94768;};'use strict';var Sequelize=require(_0xb07b('0x0'));module[_0xb07b('0x1')]={'name':{'type':Sequelize[_0xb07b('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0xee15=['exports','STRING','sequelize'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xee15,0x6e));var _0x5ee1=function(_0x12d951,_0x249808){_0x12d951=_0x12d951-0x0;var _0x44de17=_0xee15[_0x12d951];return _0x44de17;};'use strict';var Sequelize=require(_0x5ee1('0x0'));module[_0x5ee1('0x1')]={'name':{'type':Sequelize[_0x5ee1('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 6e30728..fa0a71d 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 _0x1cb9=['intersection','attributes','fields','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','destroy','Dispositions','UserProfileResource','error','name','send','index','map','Disposition','fieldName','type','key','model','query','keys','filters'];(function(_0x1e07bf,_0x2c8eff){var _0x14e11e=function(_0x3977b0){while(--_0x3977b0){_0x1e07bf['push'](_0x1e07bf['shift']());}};_0x14e11e(++_0x2c8eff);}(_0x1cb9,0x14e));var _0x91cb=function(_0x1678be,_0x26cb76){_0x1678be=_0x1678be-0x0;var _0x40ec5e=_0x1cb9[_0x1678be];return _0x40ec5e;};'use strict';var pdf=require(_0x91cb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x91cb('0x1'));var zipdir=require(_0x91cb('0x2'));var jsonpatch=require(_0x91cb('0x3'));var rp=require(_0x91cb('0x4'));var moment=require('moment');var BPromise=require(_0x91cb('0x5'));var Mustache=require(_0x91cb('0x6'));var util=require('util');var path=require(_0x91cb('0x7'));var sox=require(_0x91cb('0x8'));var csv=require(_0x91cb('0x9'));var ejs=require(_0x91cb('0xa'));var fs=require('fs');var _=require(_0x91cb('0xb'));var squel=require(_0x91cb('0xc'));var crypto=require('crypto');var jsforce=require(_0x91cb('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x91cb('0x9'));var querystring=require('querystring');var Papa=require(_0x91cb('0xe'));var Redis=require(_0x91cb('0xf'));var authService=require(_0x91cb('0x10'));var qs=require(_0x91cb('0x11'));var as=require(_0x91cb('0x12'));var hardwareService=require(_0x91cb('0x13'));var logger=require(_0x91cb('0x14'))(_0x91cb('0x15'));var utils=require(_0x91cb('0x16'));var config=require(_0x91cb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c1f56,_0x366f09){_0x366f09=_0x366f09||0xcc;return function(_0x4ba2f2){if(_0x4ba2f2){return _0x3c1f56[_0x91cb('0x18')](_0x366f09);}return _0x3c1f56[_0x91cb('0x19')](_0x366f09)[_0x91cb('0x1a')]();};}function respondWithResult(_0x2c7d40,_0x4a7d45){_0x4a7d45=_0x4a7d45||0xc8;return function(_0x4cc6ef){if(_0x4cc6ef){return _0x2c7d40[_0x91cb('0x19')](_0x4a7d45)[_0x91cb('0x1b')](_0x4cc6ef);}};}function respondWithFilteredResult(_0x585470,_0x528f73){return function(_0x576369){if(_0x576369){var _0xc3629e=_0x576369[_0x91cb('0x1c')],_0x347980=_0x528f73['offset'],_0x5ea796=_0x528f73[_0x91cb('0x1d')]+_0x528f73[_0x91cb('0x1e')],_0x238f11;if(_0x5ea796>=_0xc3629e){_0x5ea796=_0xc3629e;_0x238f11=0xc8;}else{_0x238f11=0xce;}_0x585470[_0x91cb('0x19')](_0x238f11);return _0x585470[_0x91cb('0x1f')]('Content-Range',_0x347980+'-'+_0x5ea796+'/'+_0xc3629e)[_0x91cb('0x1b')](_0x576369);}return null;};}function patchUpdates(_0x7dcf60){return function(_0x4ca8e8){try{jsonpatch[_0x91cb('0x20')](_0x4ca8e8,_0x7dcf60,!![]);}catch(_0x4c9fb2){return BPromise['reject'](_0x4c9fb2);}return _0x4ca8e8[_0x91cb('0x21')]();};}function saveUpdates(_0x160ded,_0x56e409){return function(_0x51a1d5){if(_0x51a1d5){return _0x51a1d5['update'](_0x160ded)[_0x91cb('0x22')](function(_0x18827b){return _0x18827b;});}return null;};}function removeEntity(_0x20aff5,_0x1dbee2){return function(_0x5c6a15){if(_0x5c6a15){return _0x5c6a15[_0x91cb('0x23')]()[_0x91cb('0x22')](function(){var _0x1fa837=_0x5c6a15['get']({'plain':!![]});var _0x26f18f=_0x91cb('0x24');return db[_0x91cb('0x25')][_0x91cb('0x23')]({'where':{'type':_0x26f18f,'resourceId':_0x1fa837['id']}})[_0x91cb('0x22')](function(){return _0x5c6a15;});})[_0x91cb('0x22')](function(){_0x20aff5[_0x91cb('0x19')](0xcc)[_0x91cb('0x1a')]();});}};}function handleEntityNotFound(_0x264e9b,_0x4c8438){return function(_0x59bf3a){if(!_0x59bf3a){_0x264e9b[_0x91cb('0x18')](0x194);}return _0x59bf3a;};}function handleError(_0x554350,_0x1c67d2){_0x1c67d2=_0x1c67d2||0x1f4;return function(_0x34d372){logger[_0x91cb('0x26')](_0x34d372['stack']);if(_0x34d372[_0x91cb('0x27')]){delete _0x34d372['name'];}_0x554350[_0x91cb('0x19')](_0x1c67d2)[_0x91cb('0x28')](_0x34d372);};}exports[_0x91cb('0x29')]=function(_0x2fb473,_0x468908){var _0x504275={},_0x2f04a3={},_0x52670a={'count':0x0,'rows':[]};var _0x196385=_[_0x91cb('0x2a')](db[_0x91cb('0x2b')]['rawAttributes'],function(_0x775c25){return{'name':_0x775c25[_0x91cb('0x2c')],'type':_0x775c25[_0x91cb('0x2d')][_0x91cb('0x2e')]};});_0x2f04a3[_0x91cb('0x2f')]=_[_0x91cb('0x2a')](_0x196385,_0x91cb('0x27'));_0x2f04a3[_0x91cb('0x30')]=_[_0x91cb('0x31')](_0x2fb473['query']);_0x2f04a3[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x2f04a3[_0x91cb('0x2f')],_0x2f04a3[_0x91cb('0x30')]);_0x504275[_0x91cb('0x34')]=_['intersection'](_0x2f04a3[_0x91cb('0x2f')],qs[_0x91cb('0x35')](_0x2fb473[_0x91cb('0x30')][_0x91cb('0x35')]));_0x504275[_0x91cb('0x34')]=_0x504275['attributes'][_0x91cb('0x36')]?_0x504275['attributes']:_0x2f04a3['model'];if(!_0x2fb473['query'][_0x91cb('0x37')]('nolimit')){_0x504275[_0x91cb('0x1e')]=qs['limit'](_0x2fb473['query'][_0x91cb('0x1e')]);_0x504275[_0x91cb('0x1d')]=qs[_0x91cb('0x1d')](_0x2fb473[_0x91cb('0x30')][_0x91cb('0x1d')]);}_0x504275['order']=qs[_0x91cb('0x38')](_0x2fb473[_0x91cb('0x30')][_0x91cb('0x38')]);_0x504275[_0x91cb('0x39')]=qs['filters'](_['pick'](_0x2fb473[_0x91cb('0x30')],_0x2f04a3[_0x91cb('0x32')]));if(_0x2fb473['query'][_0x91cb('0x3a')]){_0x504275[_0x91cb('0x39')]=_['merge'](_0x504275[_0x91cb('0x39')],{'$or':_[_0x91cb('0x2a')](_0x196385,function(_0x5f456c){if(_0x5f456c[_0x91cb('0x2d')]!=='VIRTUAL'){var _0x4117db={};_0x4117db[_0x5f456c[_0x91cb('0x27')]]={'$like':'%'+_0x2fb473[_0x91cb('0x30')][_0x91cb('0x3a')]+'%'};return _0x4117db;}})});}_0x504275=_[_0x91cb('0x3b')]({},_0x504275,_0x2fb473[_0x91cb('0x3c')]);var _0x5d0e37={'where':_0x504275[_0x91cb('0x39')]};return db[_0x91cb('0x2b')]['count'](_0x5d0e37)[_0x91cb('0x22')](function(_0x4ecbd7){_0x52670a[_0x91cb('0x1c')]=_0x4ecbd7;if(_0x2fb473[_0x91cb('0x30')][_0x91cb('0x3d')]){_0x504275[_0x91cb('0x3e')]=[{'all':!![]}];}return db['Disposition'][_0x91cb('0x3f')](_0x504275);})[_0x91cb('0x22')](function(_0x2cf27e){_0x52670a[_0x91cb('0x40')]=_0x2cf27e;return _0x52670a;})[_0x91cb('0x22')](respondWithFilteredResult(_0x468908,_0x504275))[_0x91cb('0x41')](handleError(_0x468908,null));};exports[_0x91cb('0x42')]=function(_0x111cc0,_0x325dca){var _0x3cc4c1={'raw':!![],'where':{'id':_0x111cc0[_0x91cb('0x43')]['id']}},_0x49bc42={};_0x49bc42['model']=_[_0x91cb('0x31')](db['Disposition'][_0x91cb('0x44')]);_0x49bc42['query']=_[_0x91cb('0x31')](_0x111cc0[_0x91cb('0x30')]);_0x49bc42[_0x91cb('0x32')]=_[_0x91cb('0x33')](_0x49bc42['model'],_0x49bc42[_0x91cb('0x30')]);_0x3cc4c1[_0x91cb('0x34')]=_['intersection'](_0x49bc42[_0x91cb('0x2f')],qs[_0x91cb('0x35')](_0x111cc0[_0x91cb('0x30')][_0x91cb('0x35')]));_0x3cc4c1[_0x91cb('0x34')]=_0x3cc4c1[_0x91cb('0x34')][_0x91cb('0x36')]?_0x3cc4c1[_0x91cb('0x34')]:_0x49bc42[_0x91cb('0x2f')];if(_0x111cc0['query'][_0x91cb('0x3d')]){_0x3cc4c1[_0x91cb('0x3e')]=[{'all':!![]}];}_0x3cc4c1=_[_0x91cb('0x3b')]({},_0x3cc4c1,_0x111cc0[_0x91cb('0x3c')]);return db[_0x91cb('0x2b')][_0x91cb('0x45')](_0x3cc4c1)[_0x91cb('0x22')](handleEntityNotFound(_0x325dca,null))[_0x91cb('0x22')](respondWithResult(_0x325dca,null))['catch'](handleError(_0x325dca,null));};exports[_0x91cb('0x46')]=function(_0x46caf1,_0x2b8b7f){return db[_0x91cb('0x2b')]['create'](_0x46caf1[_0x91cb('0x47')],{})[_0x91cb('0x22')](function(_0x4fad1b){var _0x212473=_0x46caf1['user'][_0x91cb('0x48')]({'plain':!![]});if(!_0x212473)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x212473['role']==='user'){var _0x98245b=_0x4fad1b[_0x91cb('0x48')]({'plain':!![]});var _0x3d62c4=_0x91cb('0x24');return db[_0x91cb('0x49')]['find']({'where':{'name':_0x3d62c4,'userProfileId':_0x212473['userProfileId']},'raw':!![]})[_0x91cb('0x22')](function(_0xfe6692){if(_0xfe6692&&_0xfe6692[_0x91cb('0x4a')]===0x0){return db[_0x91cb('0x25')]['create']({'name':_0x98245b['name'],'resourceId':_0x98245b['id'],'type':_0xfe6692['name'],'sectionId':_0xfe6692['id']},{})[_0x91cb('0x22')](function(){return _0x4fad1b;});}else{return _0x4fad1b;}})['catch'](function(_0x3f22a1){logger['error'](_0x91cb('0x4b'),_0x3f22a1);throw _0x3f22a1;});}return _0x4fad1b;})[_0x91cb('0x22')](respondWithResult(_0x2b8b7f,0xc9))[_0x91cb('0x41')](handleError(_0x2b8b7f,null));};exports[_0x91cb('0x4c')]=function(_0x1884bc,_0x362532){if(_0x1884bc[_0x91cb('0x47')]['id']){delete _0x1884bc[_0x91cb('0x47')]['id'];}return db[_0x91cb('0x2b')][_0x91cb('0x45')]({'where':{'id':_0x1884bc[_0x91cb('0x43')]['id']}})['then'](handleEntityNotFound(_0x362532,null))[_0x91cb('0x22')](saveUpdates(_0x1884bc[_0x91cb('0x47')],null))['then'](respondWithResult(_0x362532,null))[_0x91cb('0x41')](handleError(_0x362532,null));};exports[_0x91cb('0x23')]=function(_0x4bab7d,_0x2f5311){return db[_0x91cb('0x2b')][_0x91cb('0x45')]({'where':{'id':_0x4bab7d[_0x91cb('0x43')]['id']}})[_0x91cb('0x22')](handleEntityNotFound(_0x2f5311,null))[_0x91cb('0x22')](removeEntity(_0x2f5311,null))[_0x91cb('0x41')](handleError(_0x2f5311,null));}; \ No newline at end of file +var _0xd67b=['util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','stack','name','send','map','Disposition','rawAttributes','fieldName','model','keys','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where','filter','type','count','includeAll','include','rows','catch','show','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','eml-format','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0xf0e904,_0x128a7f){var _0x3243c3=function(_0x1e00f6){while(--_0x1e00f6){_0xf0e904['push'](_0xf0e904['shift']());}};_0x3243c3(++_0x128a7f);}(_0xd67b,0x133));var _0xbd67=function(_0x30698b,_0x4f69ae){_0x30698b=_0x30698b-0x0;var _0x3ed0bd=_0xd67b[_0x30698b];return _0x3ed0bd;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd67('0x1'));var jsonpatch=require(_0xbd67('0x2'));var rp=require(_0xbd67('0x3'));var moment=require('moment');var BPromise=require(_0xbd67('0x4'));var Mustache=require('mustache');var util=require(_0xbd67('0x5'));var path=require('path');var sox=require(_0xbd67('0x6'));var csv=require(_0xbd67('0x7'));var ejs=require(_0xbd67('0x8'));var fs=require('fs');var _=require(_0xbd67('0x9'));var squel=require(_0xbd67('0xa'));var crypto=require(_0xbd67('0xb'));var jsforce=require(_0xbd67('0xc'));var deskjs=require(_0xbd67('0xd'));var toCsv=require(_0xbd67('0x7'));var querystring=require(_0xbd67('0xe'));var Papa=require(_0xbd67('0xf'));var Redis=require(_0xbd67('0x10'));var authService=require(_0xbd67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd67('0x12'));var logger=require('../../config/logger')(_0xbd67('0x13'));var utils=require(_0xbd67('0x14'));var config=require(_0xbd67('0x15'));var db=require(_0xbd67('0x16'))['db'];function respondWithStatusCode(_0x137b8c,_0xb05237){_0xb05237=_0xb05237||0xcc;return function(_0x3621ad){if(_0x3621ad){return _0x137b8c[_0xbd67('0x17')](_0xb05237);}return _0x137b8c[_0xbd67('0x18')](_0xb05237)[_0xbd67('0x19')]();};}function respondWithResult(_0x4c078c,_0xbe923c){_0xbe923c=_0xbe923c||0xc8;return function(_0x46d881){if(_0x46d881){return _0x4c078c[_0xbd67('0x18')](_0xbe923c)[_0xbd67('0x1a')](_0x46d881);}};}function respondWithFilteredResult(_0x84bdf1,_0x23b626){return function(_0x44c025){if(_0x44c025){var _0xbdd027=_0x44c025['count'],_0xa45c76=_0x23b626[_0xbd67('0x1b')],_0x140df9=_0x23b626[_0xbd67('0x1b')]+_0x23b626[_0xbd67('0x1c')],_0x591de9;if(_0x140df9>=_0xbdd027){_0x140df9=_0xbdd027;_0x591de9=0xc8;}else{_0x591de9=0xce;}_0x84bdf1['status'](_0x591de9);return _0x84bdf1[_0xbd67('0x1d')](_0xbd67('0x1e'),_0xa45c76+'-'+_0x140df9+'/'+_0xbdd027)[_0xbd67('0x1a')](_0x44c025);}return null;};}function patchUpdates(_0x4b764f){return function(_0x5906a2){try{jsonpatch['apply'](_0x5906a2,_0x4b764f,!![]);}catch(_0x1f9193){return BPromise[_0xbd67('0x1f')](_0x1f9193);}return _0x5906a2[_0xbd67('0x20')]();};}function saveUpdates(_0x5e42c7,_0x3c4102){return function(_0x40ec96){if(_0x40ec96){return _0x40ec96[_0xbd67('0x21')](_0x5e42c7)[_0xbd67('0x22')](function(_0x419a6a){return _0x419a6a;});}return null;};}function removeEntity(_0x4576c4,_0x5a95b6){return function(_0x3ee2f1){if(_0x3ee2f1){return _0x3ee2f1[_0xbd67('0x23')]()[_0xbd67('0x22')](function(){var _0x78fe55=_0x3ee2f1[_0xbd67('0x24')]({'plain':!![]});var _0x33fd8c=_0xbd67('0x25');return db[_0xbd67('0x26')][_0xbd67('0x23')]({'where':{'type':_0x33fd8c,'resourceId':_0x78fe55['id']}})[_0xbd67('0x22')](function(){return _0x3ee2f1;});})[_0xbd67('0x22')](function(){_0x4576c4['status'](0xcc)[_0xbd67('0x19')]();});}};}function handleEntityNotFound(_0x5a5227,_0x25bf7a){return function(_0x13b8b8){if(!_0x13b8b8){_0x5a5227[_0xbd67('0x17')](0x194);}return _0x13b8b8;};}function handleError(_0x4bbee7,_0x14f5c3){_0x14f5c3=_0x14f5c3||0x1f4;return function(_0x410baa){logger['error'](_0x410baa[_0xbd67('0x27')]);if(_0x410baa[_0xbd67('0x28')]){delete _0x410baa[_0xbd67('0x28')];}_0x4bbee7[_0xbd67('0x18')](_0x14f5c3)[_0xbd67('0x29')](_0x410baa);};}exports['index']=function(_0x5975dc,_0x41856b){var _0x310d21={},_0x4675ac={},_0x44eced={'count':0x0,'rows':[]};var _0xc89b90=_[_0xbd67('0x2a')](db[_0xbd67('0x2b')][_0xbd67('0x2c')],function(_0x3436bd){return{'name':_0x3436bd[_0xbd67('0x2d')],'type':_0x3436bd['type']['key']};});_0x4675ac[_0xbd67('0x2e')]=_[_0xbd67('0x2a')](_0xc89b90,_0xbd67('0x28'));_0x4675ac['query']=_[_0xbd67('0x2f')](_0x5975dc[_0xbd67('0x30')]);_0x4675ac[_0xbd67('0x31')]=_[_0xbd67('0x32')](_0x4675ac['model'],_0x4675ac['query']);_0x310d21['attributes']=_[_0xbd67('0x32')](_0x4675ac[_0xbd67('0x2e')],qs[_0xbd67('0x33')](_0x5975dc['query']['fields']));_0x310d21[_0xbd67('0x34')]=_0x310d21[_0xbd67('0x34')][_0xbd67('0x35')]?_0x310d21[_0xbd67('0x34')]:_0x4675ac[_0xbd67('0x2e')];if(!_0x5975dc[_0xbd67('0x30')]['hasOwnProperty'](_0xbd67('0x36'))){_0x310d21[_0xbd67('0x1c')]=qs[_0xbd67('0x1c')](_0x5975dc['query'][_0xbd67('0x1c')]);_0x310d21['offset']=qs[_0xbd67('0x1b')](_0x5975dc[_0xbd67('0x30')]['offset']);}_0x310d21[_0xbd67('0x37')]=qs[_0xbd67('0x38')](_0x5975dc[_0xbd67('0x30')][_0xbd67('0x38')]);_0x310d21[_0xbd67('0x39')]=qs[_0xbd67('0x31')](_['pick'](_0x5975dc[_0xbd67('0x30')],_0x4675ac[_0xbd67('0x31')]));if(_0x5975dc[_0xbd67('0x30')][_0xbd67('0x3a')]){_0x310d21[_0xbd67('0x39')]=_['merge'](_0x310d21['where'],{'$or':_[_0xbd67('0x2a')](_0xc89b90,function(_0x348024){if(_0x348024[_0xbd67('0x3b')]!=='VIRTUAL'){var _0x378cb3={};_0x378cb3[_0x348024[_0xbd67('0x28')]]={'$like':'%'+_0x5975dc[_0xbd67('0x30')][_0xbd67('0x3a')]+'%'};return _0x378cb3;}})});}_0x310d21=_['merge']({},_0x310d21,_0x5975dc['options']);var _0x53cbee={'where':_0x310d21['where']};return db['Disposition'][_0xbd67('0x3c')](_0x53cbee)['then'](function(_0x4d08a6){_0x44eced['count']=_0x4d08a6;if(_0x5975dc[_0xbd67('0x30')][_0xbd67('0x3d')]){_0x310d21[_0xbd67('0x3e')]=[{'all':!![]}];}return db[_0xbd67('0x2b')]['findAll'](_0x310d21);})[_0xbd67('0x22')](function(_0x43caa9){_0x44eced[_0xbd67('0x3f')]=_0x43caa9;return _0x44eced;})[_0xbd67('0x22')](respondWithFilteredResult(_0x41856b,_0x310d21))[_0xbd67('0x40')](handleError(_0x41856b,null));};exports[_0xbd67('0x41')]=function(_0x17add8,_0x532c9b){var _0x121146={'raw':!![],'where':{'id':_0x17add8[_0xbd67('0x42')]['id']}},_0x4a0849={};_0x4a0849[_0xbd67('0x2e')]=_[_0xbd67('0x2f')](db[_0xbd67('0x2b')][_0xbd67('0x2c')]);_0x4a0849[_0xbd67('0x30')]=_[_0xbd67('0x2f')](_0x17add8[_0xbd67('0x30')]);_0x4a0849['filters']=_[_0xbd67('0x32')](_0x4a0849[_0xbd67('0x2e')],_0x4a0849['query']);_0x121146[_0xbd67('0x34')]=_[_0xbd67('0x32')](_0x4a0849[_0xbd67('0x2e')],qs['fields'](_0x17add8['query'][_0xbd67('0x33')]));_0x121146[_0xbd67('0x34')]=_0x121146[_0xbd67('0x34')]['length']?_0x121146[_0xbd67('0x34')]:_0x4a0849[_0xbd67('0x2e')];if(_0x17add8['query']['includeAll']){_0x121146['include']=[{'all':!![]}];}_0x121146=_['merge']({},_0x121146,_0x17add8[_0xbd67('0x43')]);return db[_0xbd67('0x2b')][_0xbd67('0x44')](_0x121146)[_0xbd67('0x22')](handleEntityNotFound(_0x532c9b,null))[_0xbd67('0x22')](respondWithResult(_0x532c9b,null))['catch'](handleError(_0x532c9b,null));};exports[_0xbd67('0x45')]=function(_0x171d86,_0x584aa8){return db[_0xbd67('0x2b')][_0xbd67('0x45')](_0x171d86[_0xbd67('0x46')],{})[_0xbd67('0x22')](function(_0x55c991){var _0x5ea5cc=_0x171d86[_0xbd67('0x47')]['get']({'plain':!![]});if(!_0x5ea5cc)throw new Error(_0xbd67('0x48'));if(_0x5ea5cc[_0xbd67('0x49')]==='user'){var _0x1951d2=_0x55c991[_0xbd67('0x24')]({'plain':!![]});var _0x1428f3='Dispositions';return db[_0xbd67('0x4a')][_0xbd67('0x44')]({'where':{'name':_0x1428f3,'userProfileId':_0x5ea5cc[_0xbd67('0x4b')]},'raw':!![]})[_0xbd67('0x22')](function(_0x42cc5a){if(_0x42cc5a&&_0x42cc5a[_0xbd67('0x4c')]===0x0){return db[_0xbd67('0x26')]['create']({'name':_0x1951d2['name'],'resourceId':_0x1951d2['id'],'type':_0x42cc5a[_0xbd67('0x28')],'sectionId':_0x42cc5a['id']},{})[_0xbd67('0x22')](function(){return _0x55c991;});}else{return _0x55c991;}})[_0xbd67('0x40')](function(_0x30d66e){logger[_0xbd67('0x4d')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x30d66e);throw _0x30d66e;});}return _0x55c991;})['then'](respondWithResult(_0x584aa8,0xc9))[_0xbd67('0x40')](handleError(_0x584aa8,null));};exports[_0xbd67('0x21')]=function(_0x1d1ea2,_0x42d024){if(_0x1d1ea2[_0xbd67('0x46')]['id']){delete _0x1d1ea2[_0xbd67('0x46')]['id'];}return db[_0xbd67('0x2b')][_0xbd67('0x44')]({'where':{'id':_0x1d1ea2[_0xbd67('0x42')]['id']}})[_0xbd67('0x22')](handleEntityNotFound(_0x42d024,null))['then'](saveUpdates(_0x1d1ea2['body'],null))[_0xbd67('0x22')](respondWithResult(_0x42d024,null))['catch'](handleError(_0x42d024,null));};exports[_0xbd67('0x23')]=function(_0x25aff0,_0x343814){return db[_0xbd67('0x2b')]['find']({'where':{'id':_0x25aff0[_0xbd67('0x42')]['id']}})[_0xbd67('0x22')](handleEntityNotFound(_0x343814,null))[_0xbd67('0x22')](removeEntity(_0x343814,null))['catch'](handleError(_0x343814,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index c35577b..29f1724 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 _0x8a97=['name','MailAccountId','SmsAccountId','name_fax','name_openchannel','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./disposition.attributes','define','tools_dispositions','name_voice','ListId','name_chat'];(function(_0x3b60aa,_0x8625aa){var _0x3ddc4a=function(_0x77cd0d){while(--_0x77cd0d){_0x3b60aa['push'](_0x3b60aa['shift']());}};_0x3ddc4a(++_0x8625aa);}(_0x8a97,0x1b5));var _0x78a9=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x8a97[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x78a9('0x0'));var util=require(_0x78a9('0x1'));var logger=require(_0x78a9('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x78a9('0x3'));var fs=require('fs');var path=require(_0x78a9('0x4'));var rimraf=require(_0x78a9('0x5'));var config=require(_0x78a9('0x6'));var attributes=require(_0x78a9('0x7'));module['exports']=function(_0x5e9016,_0x5aa680){return _0x5e9016[_0x78a9('0x8')]('Disposition',attributes,{'tableName':_0x78a9('0x9'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x78a9('0xa'),'fields':['name',_0x78a9('0xb')]},{'unique':!![],'name':_0x78a9('0xc'),'fields':[_0x78a9('0xd'),'ChatWebsiteId']},{'unique':!![],'name':'name_mail','fields':[_0x78a9('0xd'),_0x78a9('0xe')]},{'unique':!![],'name':'name_sms','fields':['name',_0x78a9('0xf')]},{'unique':!![],'name':_0x78a9('0x10'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0x78a9('0x11'),'fields':[_0x78a9('0xd'),'OpenchannelAccountId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xbbdc=['name_openchannel','OpenchannelAccountId','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./disposition.attributes','exports','tools_dispositions','name_voice','name','name_chat','ChatWebsiteId','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId'];(function(_0x16e45d,_0x2e6fa8){var _0x4d2257=function(_0x5d8763){while(--_0x5d8763){_0x16e45d['push'](_0x16e45d['shift']());}};_0x4d2257(++_0x2e6fa8);}(_0xbbdc,0xe8));var _0xcbbd=function(_0x3f6b1b,_0x58d3d6){_0x3f6b1b=_0x3f6b1b-0x0;var _0x4a3d2b=_0xbbdc[_0x3f6b1b];return _0x4a3d2b;};'use strict';var _=require('lodash');var util=require(_0xcbbd('0x0'));var logger=require(_0xcbbd('0x1'))(_0xcbbd('0x2'));var moment=require(_0xcbbd('0x3'));var BPromise=require(_0xcbbd('0x4'));var rp=require(_0xcbbd('0x5'));var fs=require('fs');var path=require(_0xcbbd('0x6'));var rimraf=require(_0xcbbd('0x7'));var config=require(_0xcbbd('0x8'));var attributes=require(_0xcbbd('0x9'));module[_0xcbbd('0xa')]=function(_0x3958b4,_0x14b17b){return _0x3958b4['define']('Disposition',attributes,{'tableName':_0xcbbd('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xcbbd('0xc'),'fields':[_0xcbbd('0xd'),'ListId']},{'unique':!![],'name':_0xcbbd('0xe'),'fields':[_0xcbbd('0xd'),_0xcbbd('0xf')]},{'unique':!![],'name':'name_mail','fields':[_0xcbbd('0xd'),_0xcbbd('0x10')]},{'unique':!![],'name':_0xcbbd('0x11'),'fields':[_0xcbbd('0xd'),_0xcbbd('0x12')]},{'unique':!![],'name':_0xcbbd('0x13'),'fields':['name',_0xcbbd('0x14')]},{'unique':!![],'name':_0xcbbd('0x15'),'fields':['name',_0xcbbd('0x16')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index de28d82..8b567fb 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 _0xccf1=['error','code','Disposition,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x26b742,_0x2b8f5b){var _0x478055=function(_0x2149e5){while(--_0x2149e5){_0x26b742['push'](_0x26b742['shift']());}};_0x478055(++_0x2b8f5b);}(_0xccf1,0xd5));var _0x1ccf=function(_0x1ecb51,_0xa0a419){_0x1ecb51=_0x1ecb51-0x0;var _0x2fb505=_0xccf1[_0x1ecb51];return _0x2fb505;};'use strict';var _=require(_0x1ccf('0x0'));var util=require('util');var moment=require(_0x1ccf('0x1'));var BPromise=require(_0x1ccf('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1ccf('0x3'))['db'];var utils=require(_0x1ccf('0x4'));var logger=require(_0x1ccf('0x5'))(_0x1ccf('0x6'));var config=require(_0x1ccf('0x7'));var jayson=require(_0x1ccf('0x8'));var client=jayson[_0x1ccf('0x9')][_0x1ccf('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a65d5,_0x194d7d,_0xddfa88){return new BPromise(function(_0x59742e,_0x3099d5){return client[_0x1ccf('0xb')](_0x3a65d5,_0xddfa88)[_0x1ccf('0xc')](function(_0x580279){logger[_0x1ccf('0xd')]('Disposition,\x20%s,\x20%s',_0x194d7d,_0x1ccf('0xe'));logger['debug'](_0x1ccf('0xf'),_0x194d7d,_0x1ccf('0xe'),JSON[_0x1ccf('0x10')](_0x580279));if(_0x580279[_0x1ccf('0x11')]){if(_0x580279[_0x1ccf('0x11')][_0x1ccf('0x12')]===0x1f4){logger[_0x1ccf('0x11')](_0x1ccf('0x13'),_0x194d7d,_0x580279[_0x1ccf('0x11')][_0x1ccf('0x14')]);return _0x3099d5(_0x580279[_0x1ccf('0x11')][_0x1ccf('0x14')]);}logger['error']('Disposition,\x20%s,\x20%s',_0x194d7d,_0x580279[_0x1ccf('0x11')][_0x1ccf('0x14')]);return _0x59742e(_0x580279[_0x1ccf('0x11')][_0x1ccf('0x14')]);}else{logger[_0x1ccf('0xd')]('Disposition,\x20%s,\x20%s',_0x194d7d,_0x1ccf('0xe'));_0x59742e(_0x580279[_0x1ccf('0x15')][_0x1ccf('0x14')]);}})[_0x1ccf('0x16')](function(_0x2127c9){logger['error']('Disposition,\x20%s,\x20%s',_0x194d7d,_0x2127c9);_0x3099d5(_0x2127c9);});});} \ No newline at end of file +var _0xfd18=['Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x487afe,_0x17464f){var _0x24e09e=function(_0xd03bf7){while(--_0xd03bf7){_0x487afe['push'](_0x487afe['shift']());}};_0x24e09e(++_0x17464f);}(_0xfd18,0x14b));var _0x8fd1=function(_0x51bdda,_0x5666ca){_0x51bdda=_0x51bdda-0x0;var _0x998aab=_0xfd18[_0x51bdda];return _0x998aab;};'use strict';var _=require(_0x8fd1('0x0'));var util=require(_0x8fd1('0x1'));var moment=require(_0x8fd1('0x2'));var BPromise=require(_0x8fd1('0x3'));var rs=require(_0x8fd1('0x4'));var fs=require('fs');var Redis=require(_0x8fd1('0x5'));var db=require(_0x8fd1('0x6'))['db'];var utils=require(_0x8fd1('0x7'));var logger=require(_0x8fd1('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8fd1('0x9'));var client=jayson['client'][_0x8fd1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x957123,_0x113585,_0x4ad488){return new BPromise(function(_0x366209,_0x3c1ee6){return client[_0x8fd1('0xb')](_0x957123,_0x4ad488)[_0x8fd1('0xc')](function(_0x2145e6){logger[_0x8fd1('0xd')](_0x8fd1('0xe'),_0x113585,_0x8fd1('0xf'));logger[_0x8fd1('0x10')](_0x8fd1('0x11'),_0x113585,'request\x20sent',JSON[_0x8fd1('0x12')](_0x2145e6));if(_0x2145e6[_0x8fd1('0x13')]){if(_0x2145e6[_0x8fd1('0x13')][_0x8fd1('0x14')]===0x1f4){logger[_0x8fd1('0x13')](_0x8fd1('0xe'),_0x113585,_0x2145e6[_0x8fd1('0x13')][_0x8fd1('0x15')]);return _0x3c1ee6(_0x2145e6[_0x8fd1('0x13')][_0x8fd1('0x15')]);}logger[_0x8fd1('0x13')](_0x8fd1('0xe'),_0x113585,_0x2145e6[_0x8fd1('0x13')]['message']);return _0x366209(_0x2145e6['error'][_0x8fd1('0x15')]);}else{logger[_0x8fd1('0xd')](_0x8fd1('0xe'),_0x113585,'request\x20sent');_0x366209(_0x2145e6[_0x8fd1('0x16')][_0x8fd1('0x15')]);}})['catch'](function(_0x49bf3f){logger[_0x8fd1('0x13')]('Disposition,\x20%s,\x20%s',_0x113585,_0x49bf3f);_0x3c1ee6(_0x49bf3f);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 44bbe01..44c8a12 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 _0x793b=['get','isAuthenticated','index','/:id','show','post','create','put','update','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x793b,0x189));var _0xb793=function(_0x373451,_0x555c13){_0x373451=_0x373451-0x0;var _0xa74217=_0x793b[_0x373451];return _0xa74217;};'use strict';var multer=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var path=require(_0xb793('0x2'));var timeout=require(_0xb793('0x3'));var express=require(_0xb793('0x4'));var router=express['Router']();var auth=require(_0xb793('0x5'));var interaction=require(_0xb793('0x6'));var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0xb793('0x7')]('/',auth[_0xb793('0x8')](),controller[_0xb793('0x9')]);router[_0xb793('0x7')](_0xb793('0xa'),auth[_0xb793('0x8')](),controller[_0xb793('0xb')]);router[_0xb793('0xc')]('/',auth[_0xb793('0x8')](),controller[_0xb793('0xd')]);router[_0xb793('0xe')](_0xb793('0xa'),auth[_0xb793('0x8')](),controller[_0xb793('0xf')]);router['delete'](_0xb793('0xa'),auth[_0xb793('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x084b=['delete','destroy','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./disposition.controller','isAuthenticated','get','/:id','create','put','update'];(function(_0x1f808f,_0x172b10){var _0x282348=function(_0xfa8c2){while(--_0xfa8c2){_0x1f808f['push'](_0x1f808f['shift']());}};_0x282348(++_0x172b10);}(_0x084b,0xd5));var _0xb084=function(_0xfb820a,_0x5bed2c){_0xfb820a=_0xfb820a-0x0;var _0x351481=_0x084b[_0xfb820a];return _0x351481;};'use strict';var multer=require(_0xb084('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb084('0x1'));var router=express[_0xb084('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xb084('0x3'));var config=require(_0xb084('0x4'));var controller=require(_0xb084('0x5'));router['get']('/',auth[_0xb084('0x6')](),controller['index']);router[_0xb084('0x7')](_0xb084('0x8'),auth[_0xb084('0x6')](),controller['show']);router['post']('/',auth[_0xb084('0x6')](),controller[_0xb084('0x9')]);router[_0xb084('0xa')](_0xb084('0x8'),auth[_0xb084('0x6')](),controller[_0xb084('0xb')]);router[_0xb084('0xc')](_0xb084('0x8'),auth[_0xb084('0x6')](),controller[_0xb084('0xd')]);module[_0xb084('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index b30fc0d..1574327 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 _0x1d76=['2400','9600','4800','12000','14400','v17,v27,v29','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x1d76,0xc9));var _0x61d7=function(_0x5f2f38,_0x46d097){_0x5f2f38=_0x5f2f38-0x0;var _0x154c08=_0x1d76[_0x5f2f38];return _0x154c08;};'use strict';var Sequelize=require(_0x61d7('0x0'));module[_0x61d7('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x61d7('0x2')]},'ecm':{'type':Sequelize[_0x61d7('0x3')](_0x61d7('0x4'),'no'),'defaultValue':_0x61d7('0x4')},'headerinfo':{'type':Sequelize[_0x61d7('0x2')],'defaultValue':_0x61d7('0x5')},'localstationid':{'type':Sequelize['STRING'],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x61d7('0x3')](_0x61d7('0x6'),'4800','7200',_0x61d7('0x7'),'12000','14400'),'defaultValue':_0x61d7('0x8')},'maxrate':{'type':Sequelize['ENUM'](_0x61d7('0x6'),_0x61d7('0x8'),'7200',_0x61d7('0x7'),_0x61d7('0x9'),_0x61d7('0xa')),'defaultValue':_0x61d7('0xa')},'modem':{'type':Sequelize[_0x61d7('0x2')],'defaultValue':_0x61d7('0xb')},'gateway':{'type':Sequelize[_0x61d7('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x61d7('0x3')](_0x61d7('0xc'),_0x61d7('0xd'),'DADHI',_0x61d7('0xe')),'defaultValue':_0x61d7('0xc')},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x61d7('0xf')],'defaultValue':function(){return _0x61d7('0x10');}},'notificationSound':{'type':Sequelize[_0x61d7('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x61d7('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x61d7('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x61d7('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x61d7('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x61d7('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x61d7('0x12')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x61d7('0x12')],'allowNull':!![],'defaultValue':null,'comment':_0x61d7('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x61d7('0x11')],'defaultValue':![],'comment':_0x61d7('0x14'),'set':function(_0x204444){if(!_0x204444)this[_0x61d7('0x15')]('mandatoryDispositionPauseId',null);this[_0x61d7('0x15')](_0x61d7('0x16'),_0x204444);}}}; \ No newline at end of file +var _0x26a0=['exports','yes','STRING','xCALLY\x20Motion\x20Fax','localstationid','ENUM','2400','4800','7200','9600','14400','12000','v17,v27,v29','INTEGER','SIP','IAX','TEXT','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition'];(function(_0x3b2be3,_0x3e602d){var _0x511b35=function(_0x176515){while(--_0x176515){_0x3b2be3['push'](_0x3b2be3['shift']());}};_0x511b35(++_0x3e602d);}(_0x26a0,0xe7));var _0x026a=function(_0x3b3291,_0x238db4){_0x3b3291=_0x3b3291-0x0;var _0x8c3b72=_0x26a0[_0x3b3291];return _0x8c3b72;};'use strict';var Sequelize=require('sequelize');module[_0x026a('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x026a('0x1')},'headerinfo':{'type':Sequelize[_0x026a('0x2')],'defaultValue':_0x026a('0x3')},'localstationid':{'type':Sequelize[_0x026a('0x2')],'unique':_0x026a('0x4')},'minrate':{'type':Sequelize[_0x026a('0x5')](_0x026a('0x6'),_0x026a('0x7'),_0x026a('0x8'),_0x026a('0x9'),'12000',_0x026a('0xa')),'defaultValue':_0x026a('0x7')},'maxrate':{'type':Sequelize[_0x026a('0x5')](_0x026a('0x6'),_0x026a('0x7'),_0x026a('0x8'),'9600',_0x026a('0xb'),_0x026a('0xa')),'defaultValue':_0x026a('0xa')},'modem':{'type':Sequelize[_0x026a('0x2')],'defaultValue':_0x026a('0xc')},'gateway':{'type':Sequelize[_0x026a('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x026a('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x026a('0x5')](_0x026a('0xe'),_0x026a('0xf'),'DADHI','KHOMP'),'defaultValue':_0x026a('0xe')},'key':{'type':Sequelize[_0x026a('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x026a('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x026a('0x11')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x026a('0x11')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x026a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x026a('0x11')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x026a('0x11')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x026a('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x026a('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x026a('0x11')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x95bec4){if(!_0x95bec4)this[_0x026a('0x12')](_0x026a('0x13'),null);this['setDataValue'](_0x026a('0x14'),_0x95bec4);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index ace5144..2f2a04c 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 _0xda2d=['FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','exten','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','localstationid','gateway','faxdetect','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','VoiceExtension','updateAccountApplications','tech','key','createdAt','TrunkId','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','DESC','attachments','server/files/attachments','basename','CheckAfterSend','isNil','from','fax','Contacts','defaults','ListId','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','spread','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','http','ValidationError','request','then','info','FaxAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','sendStatus','status','json','offset','set','reject','save','update','destroy','get','FaxAccounts','stack','send','index','Pause','mandatoryDispositionPause','FaxAccount','rawAttributes','type','model','name','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','map','VIRTUAL','merge','count','includeAll','include','show','params','filters','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','findOne','FaxAccountId','options','Disposition','findAll','rows','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','CmContact','User','Owner','fullname','Tag','tag','addApplications','sequelize','transaction'];(function(_0x4857dd,_0x11b507){var _0x33589c=function(_0x1cabce){while(--_0x1cabce){_0x4857dd['push'](_0x4857dd['shift']());}};_0x33589c(++_0x11b507);}(_0xda2d,0x102));var _0xdda2=function(_0x13f396,_0x3ac76e){_0x13f396=_0x13f396-0x0;var _0x2074f5=_0xda2d[_0x13f396];return _0x2074f5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdda2('0x0'));var rimraf=require(_0xdda2('0x1'));var zipdir=require(_0xdda2('0x2'));var jsonpatch=require(_0xdda2('0x3'));var rp=require(_0xdda2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdda2('0x5'));var path=require(_0xdda2('0x6'));var sox=require(_0xdda2('0x7'));var csv=require(_0xdda2('0x8'));var ejs=require(_0xdda2('0x9'));var fs=require('fs');var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdda2('0x19')],{'host':_0xdda2('0x1a'),'port':0x18eb});var socket=require(_0xdda2('0x1b'))(new Redis(config[_0xdda2('0x19')]));require(_0xdda2('0x1c'))[_0xdda2('0x1d')](socket);var jayson=require(_0xdda2('0x1e'));var client=jayson['client'][_0xdda2('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0xdda2('0x1f')]({'port':0x232a});function checkPasswordPattern(_0xb6b01e,_0x3553d5,_0x457764){if(_0x457764){var _0x1922b1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1922b1['test'](_0x3553d5)){return _0xb6b01e;}else{throw new db['Sequelize'][(_0xdda2('0x20'))]('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 _0xb6b01e;}}function respondWithRpcPromise(_0x1a5192,_0x1a3b35,_0x335fb5,_0x2b6ee8){return new BPromise(function(_0x8d44b7,_0x17015f){var _0x3ca127=_0x2b6ee8||client;return _0x3ca127[_0xdda2('0x21')](_0x1a5192,_0x335fb5)[_0xdda2('0x22')](function(_0x337b0b){logger[_0xdda2('0x23')](_0xdda2('0x24'),_0x1a3b35,'request\x20sent');logger[_0xdda2('0x25')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x1a3b35,_0xdda2('0x26'),JSON[_0xdda2('0x27')](_0x337b0b));if(_0x337b0b[_0xdda2('0x28')]){if(_0x337b0b['error'][_0xdda2('0x29')]===0x1f4){logger['error'](_0xdda2('0x24'),_0x1a3b35,_0x337b0b[_0xdda2('0x28')]['message']);return _0x17015f(_0x337b0b[_0xdda2('0x28')][_0xdda2('0x2a')]);}logger[_0xdda2('0x28')](_0xdda2('0x24'),_0x1a3b35,_0x337b0b[_0xdda2('0x28')]['message']);return _0x8d44b7(_0x337b0b[_0xdda2('0x28')][_0xdda2('0x2a')]);}else{logger[_0xdda2('0x23')](_0xdda2('0x24'),_0x1a3b35,'request\x20sent');_0x8d44b7(_0x337b0b['result'][_0xdda2('0x2a')]);}})[_0xdda2('0x2b')](function(_0x2e8591){logger['error'](_0xdda2('0x24'),_0x1a3b35,_0x2e8591);_0x17015f(_0x2e8591);});});}function respondWithStatusCode(_0x5d26ae,_0x2e755b){_0x2e755b=_0x2e755b||0xcc;return function(_0xe53dee){if(_0xe53dee){return _0x5d26ae[_0xdda2('0x2c')](_0x2e755b);}return _0x5d26ae[_0xdda2('0x2d')](_0x2e755b)['end']();};}function respondWithResult(_0x24c37d,_0x255bbc){_0x255bbc=_0x255bbc||0xc8;return function(_0x53acb5){if(_0x53acb5){return _0x24c37d[_0xdda2('0x2d')](_0x255bbc)[_0xdda2('0x2e')](_0x53acb5);}};}function respondWithFilteredResult(_0x3b18b8,_0x15e511){return function(_0x5540e5){if(_0x5540e5){var _0x129eba=_0x5540e5['count'],_0x5e107f=_0x15e511[_0xdda2('0x2f')],_0x4b19b7=_0x15e511['offset']+_0x15e511['limit'],_0x1ca9f3;if(_0x4b19b7>=_0x129eba){_0x4b19b7=_0x129eba;_0x1ca9f3=0xc8;}else{_0x1ca9f3=0xce;}_0x3b18b8['status'](_0x1ca9f3);return _0x3b18b8[_0xdda2('0x30')]('Content-Range',_0x5e107f+'-'+_0x4b19b7+'/'+_0x129eba)[_0xdda2('0x2e')](_0x5540e5);}return null;};}function patchUpdates(_0x508664){return function(_0x5cba58){try{jsonpatch['apply'](_0x5cba58,_0x508664,!![]);}catch(_0x4637c1){return BPromise[_0xdda2('0x31')](_0x4637c1);}return _0x5cba58[_0xdda2('0x32')]();};}function saveUpdates(_0x2fd592,_0x12e96d){return function(_0x644a24){if(_0x644a24){return _0x644a24[_0xdda2('0x33')](_0x2fd592)[_0xdda2('0x22')](function(_0x3cddbd){return _0x3cddbd;});}return null;};}function removeEntity(_0x2bcf47,_0x4a32ea){return function(_0x461621){if(_0x461621){return _0x461621[_0xdda2('0x34')]()[_0xdda2('0x22')](function(){var _0x3d510c=_0x461621[_0xdda2('0x35')]({'plain':!![]});var _0x33c4b0=_0xdda2('0x36');return db['UserProfileResource']['destroy']({'where':{'type':_0x33c4b0,'resourceId':_0x3d510c['id']}})[_0xdda2('0x22')](function(){return _0x461621;});})[_0xdda2('0x22')](function(){_0x2bcf47[_0xdda2('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54e211,_0x871054){return function(_0x35a0f6){if(!_0x35a0f6){_0x54e211[_0xdda2('0x2c')](0x194);}return _0x35a0f6;};}function handleError(_0x11f1f6,_0x246001){_0x246001=_0x246001||0x1f4;return function(_0x5ab419){logger[_0xdda2('0x28')](_0x5ab419[_0xdda2('0x37')]);if(_0x5ab419['name']){delete _0x5ab419['name'];}_0x11f1f6[_0xdda2('0x2d')](_0x246001)[_0xdda2('0x38')](_0x5ab419);};}exports[_0xdda2('0x39')]=function(_0x2708f4,_0x20969d){var _0x585eba={'include':[{'model':db[_0xdda2('0x3a')],'as':_0xdda2('0x3b')}]},_0x2e7847={},_0x226de2={'count':0x0,'rows':[]};var _0x50c4ae=_['map'](db[_0xdda2('0x3c')][_0xdda2('0x3d')],function(_0x7a25fe){return{'name':_0x7a25fe['fieldName'],'type':_0x7a25fe[_0xdda2('0x3e')]['key']};});_0x2e7847[_0xdda2('0x3f')]=_['map'](_0x50c4ae,_0xdda2('0x40'));_0x2e7847[_0xdda2('0x41')]=_[_0xdda2('0x42')](_0x2708f4[_0xdda2('0x41')]);_0x2e7847['filters']=_[_0xdda2('0x43')](_0x2e7847['model'],_0x2e7847[_0xdda2('0x41')]);_0x585eba['attributes']=_[_0xdda2('0x43')](_0x2e7847[_0xdda2('0x3f')],qs[_0xdda2('0x44')](_0x2708f4[_0xdda2('0x41')][_0xdda2('0x44')]));_0x585eba['attributes']=_0x585eba[_0xdda2('0x45')][_0xdda2('0x46')]?_0x585eba['attributes']:_0x2e7847[_0xdda2('0x3f')];if(!_0x2708f4['query'][_0xdda2('0x47')](_0xdda2('0x48'))){_0x585eba[_0xdda2('0x49')]=qs[_0xdda2('0x49')](_0x2708f4[_0xdda2('0x41')][_0xdda2('0x49')]);_0x585eba[_0xdda2('0x2f')]=qs[_0xdda2('0x2f')](_0x2708f4[_0xdda2('0x41')][_0xdda2('0x2f')]);}_0x585eba[_0xdda2('0x4a')]=qs[_0xdda2('0x4b')](_0x2708f4[_0xdda2('0x41')]['sort']);_0x585eba['where']=qs['filters'](_[_0xdda2('0x4c')](_0x2708f4[_0xdda2('0x41')],_0x2e7847['filters']));if(_0x2708f4[_0xdda2('0x41')][_0xdda2('0x4d')]){_0x585eba[_0xdda2('0x4e')]=_['merge'](_0x585eba[_0xdda2('0x4e')],{'$or':_[_0xdda2('0x4f')](_0x50c4ae,function(_0x4eada0){if(_0x4eada0['type']!==_0xdda2('0x50')){var _0x5efd20={};_0x5efd20[_0x4eada0[_0xdda2('0x40')]]={'$like':'%'+_0x2708f4['query'][_0xdda2('0x4d')]+'%'};return _0x5efd20;}})});}_0x585eba=_[_0xdda2('0x51')]({},_0x585eba,_0x2708f4['options']);var _0x585665={'where':_0x585eba[_0xdda2('0x4e')]};return db[_0xdda2('0x3c')][_0xdda2('0x52')](_0x585665)[_0xdda2('0x22')](function(_0x578a6c){_0x226de2[_0xdda2('0x52')]=_0x578a6c;if(_0x2708f4[_0xdda2('0x41')][_0xdda2('0x53')]){_0x585eba[_0xdda2('0x54')]=[{'all':!![]}];}return db[_0xdda2('0x3c')]['findAll'](_0x585eba);})[_0xdda2('0x22')](function(_0x40b610){_0x226de2['rows']=_0x40b610;return _0x226de2;})[_0xdda2('0x22')](respondWithFilteredResult(_0x20969d,_0x585eba))[_0xdda2('0x2b')](handleError(_0x20969d,null));};exports[_0xdda2('0x55')]=function(_0x2c2a4a,_0x161d7b){var _0x265169={'raw':![],'where':{'id':_0x2c2a4a[_0xdda2('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0xdda2('0x3b')}]},_0x4b6519={};_0x4b6519['model']=_[_0xdda2('0x42')](db['FaxAccount'][_0xdda2('0x3d')]);_0x4b6519[_0xdda2('0x41')]=_[_0xdda2('0x42')](_0x2c2a4a[_0xdda2('0x41')]);_0x4b6519[_0xdda2('0x57')]=_[_0xdda2('0x43')](_0x4b6519[_0xdda2('0x3f')],_0x4b6519[_0xdda2('0x41')]);_0x265169['attributes']=_[_0xdda2('0x43')](_0x4b6519[_0xdda2('0x3f')],qs[_0xdda2('0x44')](_0x2c2a4a['query'][_0xdda2('0x44')]));_0x265169[_0xdda2('0x45')]=_0x265169['attributes'][_0xdda2('0x46')]?_0x265169['attributes']:_0x4b6519[_0xdda2('0x3f')];if(_0x2c2a4a[_0xdda2('0x41')][_0xdda2('0x53')]){_0x265169[_0xdda2('0x54')]=[{'all':!![]}];}_0x265169=_[_0xdda2('0x51')]({},_0x265169,_0x2c2a4a['options']);return db['FaxAccount']['find'](_0x265169)[_0xdda2('0x22')](handleEntityNotFound(_0x161d7b,null))[_0xdda2('0x22')](respondWithResult(_0x161d7b,null))['catch'](handleError(_0x161d7b,null));};exports[_0xdda2('0x58')]=function(_0x126977,_0x23e55b){return db['FaxAccount'][_0xdda2('0x58')](_0x126977[_0xdda2('0x59')],{})[_0xdda2('0x22')](function(_0x58ae15){var _0x2b2c1d=_0x126977[_0xdda2('0x5a')][_0xdda2('0x35')]({'plain':!![]});if(!_0x2b2c1d)throw new Error(_0xdda2('0x5b'));if(_0x2b2c1d['role']===_0xdda2('0x5a')){var _0x4c94a3=_0x58ae15['get']({'plain':!![]});var _0x58fcec=_0xdda2('0x36');return db[_0xdda2('0x5c')][_0xdda2('0x5d')]({'where':{'name':_0x58fcec,'userProfileId':_0x2b2c1d[_0xdda2('0x5e')]},'raw':!![]})[_0xdda2('0x22')](function(_0x16cc37){if(_0x16cc37&&_0x16cc37[_0xdda2('0x5f')]===0x0){return db[_0xdda2('0x60')][_0xdda2('0x58')]({'name':_0x4c94a3[_0xdda2('0x40')],'resourceId':_0x4c94a3['id'],'type':_0x16cc37[_0xdda2('0x40')],'sectionId':_0x16cc37['id']},{})['then'](function(){return _0x58ae15;});}else{return _0x58ae15;}})[_0xdda2('0x2b')](function(_0x173022){logger[_0xdda2('0x28')](_0xdda2('0x61'),_0x173022);throw _0x173022;});}return _0x58ae15;})[_0xdda2('0x22')](respondWithResult(_0x23e55b,0xc9))[_0xdda2('0x2b')](handleError(_0x23e55b,null));};exports[_0xdda2('0x33')]=function(_0x57fb41,_0x23518f){if(_0x57fb41[_0xdda2('0x59')]['id']){delete _0x57fb41[_0xdda2('0x59')]['id'];}return db[_0xdda2('0x3c')][_0xdda2('0x5d')]({'where':{'id':_0x57fb41['params']['id']},'include':[{'model':db[_0xdda2('0x3a')],'as':_0xdda2('0x3b')}]})[_0xdda2('0x22')](handleEntityNotFound(_0x23518f,null))[_0xdda2('0x22')](saveUpdates(_0x57fb41[_0xdda2('0x59')],null))['then'](respondWithResult(_0x23518f,null))[_0xdda2('0x2b')](handleError(_0x23518f,null));};exports[_0xdda2('0x34')]=function(_0x3d49e8,_0x4530b7){return db[_0xdda2('0x3c')]['find']({'where':{'id':_0x3d49e8[_0xdda2('0x56')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x4530b7,null))[_0xdda2('0x22')](removeEntity(_0x4530b7,null))['catch'](handleError(_0x4530b7,null));};exports[_0xdda2('0x62')]=function(_0x483c17,_0x3cc35c){return db[_0xdda2('0x3c')][_0xdda2('0x62')]()['then'](respondWithResult(_0x3cc35c,null))[_0xdda2('0x2b')](handleError(_0x3cc35c,null));};exports[_0xdda2('0x63')]=function(_0x511fb9,_0x13c0d9,_0x5adab5){if(_0x511fb9[_0xdda2('0x59')]['id']){delete _0x511fb9[_0xdda2('0x59')]['id'];}return db[_0xdda2('0x3c')][_0xdda2('0x5d')]({'where':{'id':_0x511fb9[_0xdda2('0x56')]['id']}})['then'](handleEntityNotFound(_0x13c0d9,null))['then'](function(_0x42fe90){if(_0x42fe90){_0x511fb9[_0xdda2('0x59')]['FaxAccountId']=_0x42fe90['id'];return db['Disposition'][_0xdda2('0x58')](_0x511fb9['body']);}})[_0xdda2('0x22')](respondWithResult(_0x13c0d9,null))[_0xdda2('0x2b')](handleError(_0x13c0d9,null));};exports['getDispositions']=function(_0x263f6d,_0x156c00,_0xdcd08c){var _0x4739c4={'raw':![],'where':{}};var _0x694386={};var _0x37f5cd={'count':0x0,'rows':[]};return db['FaxAccount'][_0xdda2('0x64')]({'where':{'id':_0x263f6d[_0xdda2('0x56')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x156c00,null))['then'](function(_0x27780e){if(_0x27780e){_0x694386[_0xdda2('0x3f')]=_['keys'](db['Disposition'][_0xdda2('0x3d')]);_0x694386[_0xdda2('0x41')]=_[_0xdda2('0x42')](_0x263f6d['query']);_0x694386['filters']=_[_0xdda2('0x43')](_0x694386['model'],_0x694386[_0xdda2('0x41')]);_0x4739c4[_0xdda2('0x45')]=_[_0xdda2('0x43')](_0x694386[_0xdda2('0x3f')],qs[_0xdda2('0x44')](_0x263f6d[_0xdda2('0x41')]['fields']));_0x4739c4['attributes']=_0x4739c4[_0xdda2('0x45')]['length']?_0x4739c4[_0xdda2('0x45')]:_0x694386[_0xdda2('0x3f')];if(!_0x263f6d[_0xdda2('0x41')][_0xdda2('0x47')](_0xdda2('0x48'))){_0x4739c4[_0xdda2('0x49')]=qs[_0xdda2('0x49')](_0x263f6d[_0xdda2('0x41')][_0xdda2('0x49')]);_0x4739c4['offset']=qs[_0xdda2('0x2f')](_0x263f6d[_0xdda2('0x41')][_0xdda2('0x2f')]);}_0x4739c4[_0xdda2('0x4a')]=qs['sort'](_0x263f6d[_0xdda2('0x41')][_0xdda2('0x4b')]);_0x4739c4[_0xdda2('0x4e')]=qs[_0xdda2('0x57')](_['pick'](_0x263f6d['query'],_0x694386[_0xdda2('0x57')]));_0x4739c4[_0xdda2('0x4e')][_0xdda2('0x65')]=_0x27780e['id'];if(_0x263f6d[_0xdda2('0x41')]['filter']){_0x4739c4[_0xdda2('0x4e')]=_[_0xdda2('0x51')](_0x4739c4[_0xdda2('0x4e')],{'$or':_[_0xdda2('0x4f')](_0x4739c4[_0xdda2('0x45')],function(_0x1f77bd){var _0x27288a={};_0x27288a[_0x1f77bd]={'$like':'%'+_0x263f6d[_0xdda2('0x41')][_0xdda2('0x4d')]+'%'};return _0x27288a;})});}_0x4739c4=_[_0xdda2('0x51')]({},_0x4739c4,_0x263f6d[_0xdda2('0x66')]);return db[_0xdda2('0x67')][_0xdda2('0x52')]({'where':_0x4739c4[_0xdda2('0x4e')]})[_0xdda2('0x22')](function(_0x4b9481){_0x37f5cd[_0xdda2('0x52')]=_0x4b9481;if(_0x263f6d[_0xdda2('0x41')]['includeAll']){_0x4739c4['include']=[{'all':!![]}];}return db[_0xdda2('0x67')][_0xdda2('0x68')](_0x4739c4);})[_0xdda2('0x22')](function(_0xdc4cdc){_0x37f5cd[_0xdda2('0x69')]=_0xdc4cdc;return _0x37f5cd;});}})[_0xdda2('0x22')](respondWithFilteredResult(_0x156c00,_0x4739c4))['catch'](handleError(_0x156c00,null));};exports[_0xdda2('0x6a')]=function(_0x1f3abe,_0x447bd2,_0x2bb4f3){return db['FaxAccount'][_0xdda2('0x5d')]({'where':{'id':_0x1f3abe['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x447bd2,null))[_0xdda2('0x22')](function(_0x4c8739){if(_0x4c8739){return _0x4c8739[_0xdda2('0x6a')](_0x1f3abe[_0xdda2('0x41')][_0xdda2('0x6b')]);}})[_0xdda2('0x22')](respondWithStatusCode(_0x447bd2,null))[_0xdda2('0x2b')](handleError(_0x447bd2,null));};exports[_0xdda2('0x6c')]=function(_0x1c6ef1,_0x460c2e,_0x3a375d){if(_0x1c6ef1[_0xdda2('0x59')]['id']){delete _0x1c6ef1[_0xdda2('0x59')]['id'];}return db['FaxAccount'][_0xdda2('0x5d')]({'where':{'id':_0x1c6ef1[_0xdda2('0x56')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x460c2e,null))[_0xdda2('0x22')](function(_0x1da214){if(_0x1da214){_0x1c6ef1['body'][_0xdda2('0x65')]=_0x1da214['id'];return db[_0xdda2('0x6d')]['create'](_0x1c6ef1[_0xdda2('0x59')]);}})[_0xdda2('0x22')](respondWithResult(_0x460c2e,null))['catch'](handleError(_0x460c2e,null));};exports['getAnswers']=function(_0x380aaa,_0x304609,_0x179b1a){var _0x22b832={'raw':![],'where':{}};var _0x14d8fa={};var _0x2478e2={'count':0x0,'rows':[]};return db['FaxAccount'][_0xdda2('0x64')]({'where':{'id':_0x380aaa[_0xdda2('0x56')]['id']}})['then'](handleEntityNotFound(_0x304609,null))[_0xdda2('0x22')](function(_0x22deb9){if(_0x22deb9){_0x14d8fa['model']=_[_0xdda2('0x42')](db[_0xdda2('0x6d')][_0xdda2('0x3d')]);_0x14d8fa['query']=_[_0xdda2('0x42')](_0x380aaa['query']);_0x14d8fa[_0xdda2('0x57')]=_[_0xdda2('0x43')](_0x14d8fa[_0xdda2('0x3f')],_0x14d8fa[_0xdda2('0x41')]);_0x22b832['attributes']=_['intersection'](_0x14d8fa[_0xdda2('0x3f')],qs[_0xdda2('0x44')](_0x380aaa['query'][_0xdda2('0x44')]));_0x22b832[_0xdda2('0x45')]=_0x22b832[_0xdda2('0x45')][_0xdda2('0x46')]?_0x22b832[_0xdda2('0x45')]:_0x14d8fa[_0xdda2('0x3f')];if(!_0x380aaa[_0xdda2('0x41')][_0xdda2('0x47')](_0xdda2('0x48'))){_0x22b832[_0xdda2('0x49')]=qs[_0xdda2('0x49')](_0x380aaa[_0xdda2('0x41')]['limit']);_0x22b832['offset']=qs['offset'](_0x380aaa[_0xdda2('0x41')]['offset']);}_0x22b832[_0xdda2('0x4a')]=qs[_0xdda2('0x4b')](_0x380aaa[_0xdda2('0x41')][_0xdda2('0x4b')]);_0x22b832['where']=qs[_0xdda2('0x57')](_[_0xdda2('0x4c')](_0x380aaa[_0xdda2('0x41')],_0x14d8fa['filters']));_0x22b832[_0xdda2('0x4e')][_0xdda2('0x65')]=_0x22deb9['id'];if(_0x380aaa[_0xdda2('0x41')]['filter']){_0x22b832['where']=_[_0xdda2('0x51')](_0x22b832[_0xdda2('0x4e')],{'$or':_[_0xdda2('0x4f')](_0x22b832['attributes'],function(_0x29a037){var _0x32a2e9={};_0x32a2e9[_0x29a037]={'$like':'%'+_0x380aaa[_0xdda2('0x41')][_0xdda2('0x4d')]+'%'};return _0x32a2e9;})});}_0x22b832=_[_0xdda2('0x51')]({},_0x22b832,_0x380aaa[_0xdda2('0x66')]);return db[_0xdda2('0x6d')]['count']({'where':_0x22b832[_0xdda2('0x4e')]})[_0xdda2('0x22')](function(_0x43e405){_0x2478e2[_0xdda2('0x52')]=_0x43e405;if(_0x380aaa['query'][_0xdda2('0x53')]){_0x22b832[_0xdda2('0x54')]=[{'all':!![]}];}return db[_0xdda2('0x6d')][_0xdda2('0x68')](_0x22b832);})['then'](function(_0x48eda2){_0x2478e2['rows']=_0x48eda2;return _0x2478e2;});}})[_0xdda2('0x22')](respondWithFilteredResult(_0x304609,_0x22b832))[_0xdda2('0x2b')](handleError(_0x304609,null));};exports[_0xdda2('0x6e')]=function(_0x429f24,_0x1cc1f4,_0x3cdef1){return db['FaxAccount'][_0xdda2('0x5d')]({'where':{'id':_0x429f24[_0xdda2('0x56')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x1cc1f4,null))[_0xdda2('0x22')](function(_0x3de27a){if(_0x3de27a){return _0x3de27a[_0xdda2('0x6e')](_0x429f24[_0xdda2('0x41')][_0xdda2('0x6b')]);}})['then'](respondWithStatusCode(_0x1cc1f4,null))[_0xdda2('0x2b')](handleError(_0x1cc1f4,null));};exports['addInteraction']=function(_0x161043,_0x58c926,_0x15066f){return db['FaxInteraction'][_0xdda2('0x5d')]({'where':{'id':_0x161043[_0xdda2('0x56')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x58c926,null))[_0xdda2('0x22')](function(_0x3ac762){if(_0x3ac762){return _0x3ac762[_0xdda2('0x6f')](_0x161043[_0xdda2('0x59')][_0xdda2('0x6b')],_[_0xdda2('0x70')](_0x161043['body'],[_0xdda2('0x6b'),'id'])||{});}})[_0xdda2('0x22')](respondWithResult(_0x58c926,null))['catch'](handleError(_0x58c926,null));};exports[_0xdda2('0x71')]=function(_0x1d71ef,_0x2f3807,_0x5600da){var _0x1702ae={'raw':![],'where':{}};var _0x21ade3={};var _0x251408={'count':0x0,'rows':[]};return db[_0xdda2('0x3c')][_0xdda2('0x64')]({'where':{'id':_0x1d71ef[_0xdda2('0x56')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x2f3807,null))[_0xdda2('0x22')](function(_0x194772){if(_0x194772){_0x21ade3[_0xdda2('0x3f')]=_['keys'](db[_0xdda2('0x72')][_0xdda2('0x3d')]);_0x21ade3[_0xdda2('0x41')]=_[_0xdda2('0x42')](_0x1d71ef[_0xdda2('0x41')]);_0x21ade3['filters']=_[_0xdda2('0x43')](_0x21ade3[_0xdda2('0x3f')],_0x21ade3[_0xdda2('0x41')]);_0x1702ae['attributes']=_[_0xdda2('0x43')](_0x21ade3[_0xdda2('0x3f')],qs[_0xdda2('0x44')](_0x1d71ef['query'][_0xdda2('0x44')]));_0x1702ae['attributes']=_0x1702ae['attributes'][_0xdda2('0x46')]?_0x1702ae[_0xdda2('0x45')]:_0x21ade3[_0xdda2('0x3f')];if(!_0x1d71ef[_0xdda2('0x41')][_0xdda2('0x47')](_0xdda2('0x48'))){_0x1702ae[_0xdda2('0x49')]=qs['limit'](_0x1d71ef['query'][_0xdda2('0x49')]);_0x1702ae[_0xdda2('0x2f')]=qs[_0xdda2('0x2f')](_0x1d71ef[_0xdda2('0x41')][_0xdda2('0x2f')]);}_0x1702ae['order']=qs[_0xdda2('0x4b')](_0x1d71ef[_0xdda2('0x41')][_0xdda2('0x4b')]);_0x1702ae[_0xdda2('0x4e')]=qs[_0xdda2('0x57')](_[_0xdda2('0x4c')](_0x1d71ef[_0xdda2('0x41')],_0x21ade3[_0xdda2('0x57')]));_0x1702ae[_0xdda2('0x4e')][_0xdda2('0x65')]=_0x194772['id'];if(_0x1d71ef[_0xdda2('0x41')][_0xdda2('0x4d')]){_0x1702ae[_0xdda2('0x4e')]=_[_0xdda2('0x51')](_0x1702ae[_0xdda2('0x4e')],{'$or':_[_0xdda2('0x4f')](_0x1702ae['attributes'],function(_0x1512aa){var _0x4c9cbb={};_0x4c9cbb[_0x1512aa]={'$like':'%'+_0x1d71ef[_0xdda2('0x41')][_0xdda2('0x4d')]+'%'};return _0x4c9cbb;})});}_0x1702ae=_[_0xdda2('0x51')]({},_0x1702ae,_0x1d71ef['options']);return db[_0xdda2('0x72')][_0xdda2('0x52')]({'where':_0x1702ae[_0xdda2('0x4e')]})['then'](function(_0x136a7c){_0x251408[_0xdda2('0x52')]=_0x136a7c;if(_0x1d71ef[_0xdda2('0x41')]['includeAll']){_0x1702ae['include']=[{'model':db[_0xdda2('0x73')],'as':'Contact','required':![]},{'model':db[_0xdda2('0x74')],'as':_0xdda2('0x75'),'attributes':[_0xdda2('0x40'),_0xdda2('0x76'),'internal'],'required':![]},{'model':db[_0xdda2('0x77')],'as':'Tags','attributes':['id','name','color'],'where':_0x1d71ef['query'][_0xdda2('0x78')]?{'id':_0x1d71ef['query'][_0xdda2('0x78')]}:undefined,'required':_0x1d71ef[_0xdda2('0x41')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0xdda2('0x68')](_0x1702ae);})[_0xdda2('0x22')](function(_0x3f6112){_0x251408[_0xdda2('0x69')]=_0x3f6112;return _0x251408;});}})['then'](respondWithFilteredResult(_0x2f3807,_0x1702ae))['catch'](handleError(_0x2f3807,null));};exports[_0xdda2('0x79')]=function(_0x19c1eb,_0xaa5d94,_0x22e01a){return db['FaxAccount'][_0xdda2('0x64')]({'where':{'id':_0x19c1eb[_0xdda2('0x56')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0xaa5d94,null))[_0xdda2('0x22')](function(_0xf08532){if(_0xf08532){return db[_0xdda2('0x7a')][_0xdda2('0x7b')](function(_0x11f435){return db[_0xdda2('0x7c')][_0xdda2('0x34')]({'where':{'FaxAccountId':_0x19c1eb[_0xdda2('0x56')]['id']},'transaction':_0x11f435})[_0xdda2('0x22')](function(_0x22f11c){var _0x20e1c4=_[_0xdda2('0x4f')](_0x19c1eb[_0xdda2('0x59')],function(_0x5c08ea){_0x5c08ea[_0xdda2('0x65')]=_0x19c1eb[_0xdda2('0x56')]['id'];return _0x5c08ea;});return db[_0xdda2('0x7c')][_0xdda2('0x7d')](_0x20e1c4,{'transaction':_0x11f435});});})[_0xdda2('0x22')](function(){return db[_0xdda2('0x7c')][_0xdda2('0x7e')]({'where':{'FaxAccountId':_0x19c1eb[_0xdda2('0x56')]['id']},'order':_0xdda2('0x7f')});});}})[_0xdda2('0x22')](respondWithResult(_0xaa5d94,null))[_0xdda2('0x2b')](handleError(_0xaa5d94,null));};exports[_0xdda2('0x80')]=function(_0x2db8df,_0x1ec02,_0x19eea4){var _0x5308f1={};var _0x17c084={};var _0xf8632f;var _0x8efda0;return db[_0xdda2('0x3c')][_0xdda2('0x64')]({'where':{'id':_0x2db8df[_0xdda2('0x56')]['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x1ec02,null))[_0xdda2('0x22')](function(_0x36c240){if(_0x36c240){_0xf8632f=_0x36c240;_0x17c084[_0xdda2('0x3f')]=_['keys'](db[_0xdda2('0x7c')]['rawAttributes']);_0x17c084['query']=_[_0xdda2('0x42')](_0x2db8df[_0xdda2('0x41')]);_0x17c084[_0xdda2('0x57')]=_[_0xdda2('0x43')](_0x17c084[_0xdda2('0x3f')],_0x17c084['query']);_0x5308f1[_0xdda2('0x45')]=_[_0xdda2('0x43')](_0x17c084[_0xdda2('0x3f')],qs[_0xdda2('0x44')](_0x2db8df[_0xdda2('0x41')][_0xdda2('0x44')]));_0x5308f1[_0xdda2('0x45')]=_0x5308f1[_0xdda2('0x45')]['length']?_0x5308f1['attributes']:_0x17c084[_0xdda2('0x3f')];_0x5308f1[_0xdda2('0x4a')]=qs[_0xdda2('0x4b')](_0x2db8df['query']['sort']);_0x5308f1['where']=qs[_0xdda2('0x57')](_[_0xdda2('0x4c')](_0x2db8df[_0xdda2('0x41')],_0x17c084[_0xdda2('0x57')]));if(_0x2db8df['query'][_0xdda2('0x4d')]){_0x5308f1['where']=_[_0xdda2('0x51')](_0x5308f1['where'],{'$or':_[_0xdda2('0x4f')](_0x5308f1[_0xdda2('0x45')],function(_0x18544c){var _0x4d0e51={};_0x4d0e51[_0x18544c]={'$like':'%'+_0x2db8df[_0xdda2('0x41')][_0xdda2('0x4d')]+'%'};return _0x4d0e51;})});}_0x5308f1=_[_0xdda2('0x51')]({},_0x5308f1,_0x2db8df['options']);return _0xf8632f[_0xdda2('0x80')](_0x5308f1);}})[_0xdda2('0x22')](function(_0x5b8160){if(_0x5b8160){_0x8efda0=_0x5b8160[_0xdda2('0x46')];if(!_0x2db8df[_0xdda2('0x41')]['hasOwnProperty']('nolimit')){_0x5308f1['limit']=qs[_0xdda2('0x49')](_0x2db8df['query']['limit']);_0x5308f1[_0xdda2('0x2f')]=qs[_0xdda2('0x2f')](_0x2db8df[_0xdda2('0x41')][_0xdda2('0x2f')]);}return _0xf8632f[_0xdda2('0x80')](_0x5308f1);}})[_0xdda2('0x22')](function(_0x5252a5){if(_0x5252a5){return _0x5252a5?{'count':_0x8efda0,'rows':_0x5252a5}:null;}})['then'](respondWithResult(_0x1ec02,null))[_0xdda2('0x2b')](handleError(_0x1ec02,null));};function Extension(_0x5e983b,_0xe1f534,_0x237683,_0xb92d35){this[_0xdda2('0x81')]=_0xdda2('0x82');this[_0xdda2('0x83')]=_0x5e983b['localstationid'];this[_0xdda2('0x84')]=_0xb92d35;this['type']=_0xdda2('0x85');this[_0xdda2('0x86')]=_0xdda2('0x87');this[_0xdda2('0x65')]=_0x5e983b['id'];this[_0xdda2('0x7f')]=_0xe1f534;this[_0xdda2('0x88')]=_0x237683;}function createExtensionsReciveFax(_0x47331c){var _0xe3742a=0x1;var _0x32a1fe=[];_0x32a1fe[_0xdda2('0x89')](new Extension(_0x47331c,_0xe3742a,'',_0xdda2('0x8a')));_0xe3742a+=0x1;_0x32a1fe[_0xdda2('0x89')](new Extension(_0x47331c,_0xe3742a,_0xdda2('0x8b'),_0xdda2('0x8c')));_0xe3742a+=0x1;for(var _0xbadb4f in _0x47331c){if(_0x47331c[_0xdda2('0x47')](_0xbadb4f)&&(_0xbadb4f==='ecm'||_0xbadb4f===_0xdda2('0x8d')||_0xbadb4f===_0xdda2('0x8e')||_0xbadb4f===_0xdda2('0x8f')||_0xbadb4f===_0xdda2('0x90')||_0xbadb4f===_0xdda2('0x91')||_0xbadb4f===_0xdda2('0x92')||_0xbadb4f===_0xdda2('0x93')||_0xbadb4f===_0xdda2('0x94'))){_0x32a1fe[_0xdda2('0x89')](new Extension(_0x47331c,_0xe3742a,_0xdda2('0x95')+_0xbadb4f+')='+_0x47331c[_0xbadb4f],'Set'));_0xe3742a+=0x1;}}_0x32a1fe['push'](new Extension(_0x47331c,_0xe3742a,'6','Wait'));_0xe3742a+=0x1;_0x32a1fe[_0xdda2('0x89')](new Extension(_0x47331c,_0xe3742a,_0xdda2('0x96'),'ReceiveFax'));_0xe3742a=0x0;return _0x32a1fe;}exports[_0xdda2('0x97')]=function(_0x241373,_0xf592ca,_0x1fa2a4){var _0x105176;return db[_0xdda2('0x7a')]['transaction'](function(_0x11d373){return db['FaxAccount'][_0xdda2('0x58')](_0x241373[_0xdda2('0x59')],{'transaction':_0x11d373})[_0xdda2('0x22')](function(_0x5032c9){_0x105176=_0x5032c9[_0xdda2('0x35')]({'plain':!![]});return db[_0xdda2('0x98')][_0xdda2('0x7d')](createExtensionsReciveFax(_0x105176),{'transaction':_0x11d373});});})[_0xdda2('0x22')](function(){return _0x105176;})['then'](respondWithResult(_0xf592ca,null))[_0xdda2('0x2b')](handleError(_0xf592ca,null));};exports[_0xdda2('0x99')]=function(_0x3c525a,_0x14c53a,_0x142d18){var _0x4895a7;return db[_0xdda2('0x7a')]['transaction'](function(_0x2378d9){return db[_0xdda2('0x3c')][_0xdda2('0x33')](_0x3c525a['body'],{'where':{'id':_0x3c525a[_0xdda2('0x59')]['id']},'transaction':_0x2378d9})[_0xdda2('0x22')](function(_0x36dbd3){return db[_0xdda2('0x98')][_0xdda2('0x34')]({'where':{'FaxAccountId':_0x3c525a[_0xdda2('0x59')]['id']},'transaction':_0x2378d9})[_0xdda2('0x22')](function(_0xb6abf6){return db[_0xdda2('0x98')][_0xdda2('0x7d')](createExtensionsReciveFax(_[_0xdda2('0x70')](_0x3c525a[_0xdda2('0x59')],[_0xdda2('0x9a'),_0xdda2('0x9b'),_0xdda2('0x9c'),'updatedAt',_0xdda2('0x9d'),'ListId'])),{'transaction':_0x2378d9});});});})[_0xdda2('0x22')](function(){return db[_0xdda2('0x3c')]['findById'](_0x3c525a[_0xdda2('0x59')]['id']);})[_0xdda2('0x22')](respondWithResult(_0x14c53a,null))[_0xdda2('0x2b')](handleError(_0x14c53a,null));};exports['getMessages']=function(_0x5c7a5e,_0x5c88b4,_0x21f617){var _0x1d1371={'raw':!![],'where':{}};var _0xdb5e19={};var _0x4a6769={'count':0x0,'rows':[]};return db[_0xdda2('0x3c')][_0xdda2('0x64')]({'where':{'id':_0x5c7a5e['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x5c88b4,null))[_0xdda2('0x22')](function(_0x259348){if(_0x259348){_0xdb5e19['model']=_[_0xdda2('0x42')](db[_0xdda2('0x9e')][_0xdda2('0x3d')]);_0xdb5e19[_0xdda2('0x41')]=_[_0xdda2('0x42')](_0x5c7a5e['query']);_0xdb5e19[_0xdda2('0x57')]=_['intersection'](_0xdb5e19[_0xdda2('0x3f')],_0xdb5e19[_0xdda2('0x41')]);_0x1d1371[_0xdda2('0x45')]=_['intersection'](_0xdb5e19['model'],qs[_0xdda2('0x44')](_0x5c7a5e[_0xdda2('0x41')][_0xdda2('0x44')]));_0x1d1371[_0xdda2('0x45')]=_0x1d1371[_0xdda2('0x45')][_0xdda2('0x46')]?_0x1d1371[_0xdda2('0x45')]:_0xdb5e19['model'];if(!_0x5c7a5e[_0xdda2('0x41')][_0xdda2('0x47')]('nolimit')){_0x1d1371[_0xdda2('0x49')]=qs[_0xdda2('0x49')](_0x5c7a5e[_0xdda2('0x41')][_0xdda2('0x49')]);_0x1d1371[_0xdda2('0x2f')]=qs['offset'](_0x5c7a5e[_0xdda2('0x41')][_0xdda2('0x2f')]);}_0x1d1371[_0xdda2('0x4a')]=qs[_0xdda2('0x4b')](_0x5c7a5e[_0xdda2('0x41')]['sort']);_0x1d1371['where']=qs[_0xdda2('0x57')](_[_0xdda2('0x4c')](_0x5c7a5e[_0xdda2('0x41')],_0xdb5e19[_0xdda2('0x57')]));_0x1d1371['where']['FaxAccountId']=_0x259348['id'];if(_0x5c7a5e[_0xdda2('0x41')][_0xdda2('0x4d')]){_0x1d1371[_0xdda2('0x4e')]=_[_0xdda2('0x51')](_0x1d1371[_0xdda2('0x4e')],{'$or':_[_0xdda2('0x4f')](_0x1d1371[_0xdda2('0x45')],function(_0x50c10d){var _0x4efd4c={};_0x4efd4c[_0x50c10d]={'$like':'%'+_0x5c7a5e[_0xdda2('0x41')][_0xdda2('0x4d')]+'%'};return _0x4efd4c;})});}if(_0x5c7a5e['query'][_0xdda2('0x9f')]){var _0x45a566=_0x5c7a5e[_0xdda2('0x41')][_0xdda2('0x9f')]['split'](',');var _0x3896bb={};_0x3896bb[_0x45a566[0x0]]={'$gte':moment(_0x45a566[0x1])[_0xdda2('0xa0')](_0xdda2('0xa1'))};_0x1d1371[_0xdda2('0x4e')]=_['merge'](_0x1d1371[_0xdda2('0x4e')],_0x3896bb);}_0x1d1371=_['merge']({},_0x1d1371,_0x5c7a5e['options']);return db['FaxMessage'][_0xdda2('0x52')]({'where':_0x1d1371[_0xdda2('0x4e')]})[_0xdda2('0x22')](function(_0x36cac3){_0x4a6769[_0xdda2('0x52')]=_0x36cac3;if(_0x5c7a5e['query'][_0xdda2('0x53')]){_0x1d1371[_0xdda2('0x54')]=[{'all':!![]}];}return db['FaxMessage'][_0xdda2('0x68')](_0x1d1371);})[_0xdda2('0x22')](function(_0x153934){_0x4a6769[_0xdda2('0x69')]=_0x153934;return _0x4a6769;});}})[_0xdda2('0x22')](respondWithFilteredResult(_0x5c88b4,_0x1d1371))[_0xdda2('0x2b')](handleError(_0x5c88b4,null));};exports[_0xdda2('0x38')]=function(_0x642b33,_0x4b7ad8,_0x4e279b){var _0x2678be,_0x3cd8a6={},_0x3a2566;if(_0x642b33[_0xdda2('0x59')]['to']){_0x3a2566=_0x642b33[_0xdda2('0x59')]['to'][0x0];}return db[_0xdda2('0x3c')][_0xdda2('0x5d')]({'where':{'id':_0x642b33[_0xdda2('0x56')]['id']},'include':[{'model':db[_0xdda2('0xa2')],'as':_0xdda2('0xa3'),'include':[{'model':db[_0xdda2('0x73')],'as':'Contacts','where':{'fax':_0x3a2566},'limit':0x1,'order':[[_0xdda2('0xa4'),_0xdda2('0xa5')]]}]}]})[_0xdda2('0x22')](handleEntityNotFound(_0x4b7ad8,null))[_0xdda2('0x22')](function(_0x228f40){_0x2678be=_0x228f40;if(_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')]&&_0x642b33['body'][_0xdda2('0xa6')][_0xdda2('0x46')]){for(var _0x38a8b6=0x0;_0x38a8b6<_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')]['length'];_0x38a8b6+=0x1){_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][_0x38a8b6]={'filename':_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][_0x38a8b6][_0xdda2('0x40')],'id':_0x642b33['body'][_0xdda2('0xa6')][_0x38a8b6]['id'],'path':path['join'](config['root'],_0xdda2('0xa7'),_0x642b33['body'][_0xdda2('0xa6')][_0x38a8b6][_0xdda2('0xa8')])};}}return respondWithRpcPromise(_0xdda2('0xa9'),_0xdda2('0xa9'),{'FaxAccountId':_[_0xdda2('0xaa')](_0x642b33[_0xdda2('0x56')]['id'])?undefined:_0x642b33[_0xdda2('0x56')]['id'],'path':_[_0xdda2('0xaa')](_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][0x0][_0xdda2('0x6')])?undefined:_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][0x0][_0xdda2('0x6')],'fax':_[_0xdda2('0xaa')](_0x642b33[_0xdda2('0x59')]['to'][0x0])?undefined:_0x642b33['body']['to'][0x0]},client9002);})['then'](function(){if(_0x2678be){if(_[_0xdda2('0xaa')](_0x642b33[_0xdda2('0x59')]['from'])){_0x642b33[_0xdda2('0x59')][_0xdda2('0xab')]=util[_0xdda2('0xa0')]('\x22%s\x22\x20<%s>',_0x2678be['name'],_0x2678be[_0xdda2('0xac')]);}if(_0x2678be[_0xdda2('0xa3')]){if(_0x2678be['List'][_0xdda2('0xad')][_0xdda2('0x46')]){return _0x2678be[_0xdda2('0xa3')][_0xdda2('0xad')][0x0];}else{return db[_0xdda2('0x73')][_0xdda2('0x58')](_[_0xdda2('0xae')](_0x642b33[_0xdda2('0x59')],{'firstName':_0x642b33[_0xdda2('0x59')]['to'][0x0],'phone':_0x642b33[_0xdda2('0x59')]['to'][0x0],'fax':_0x642b33[_0xdda2('0x59')]['to'][0x0],'ListId':_0x2678be[_0xdda2('0xaf')]}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0xdda2('0xb0'));}})['then'](function(_0x51cebf){if(_0x51cebf){return db[_0xdda2('0x72')][_0xdda2('0x5d')]({'where':{'ContactId':_0x51cebf['id'],'closed':![],'FaxAccountId':_0x2678be['id']}})[_0xdda2('0x22')](function(_0x173860){if(_0x173860){return[_0x173860,![]];}return db['FaxInteraction'][_0xdda2('0x58')]({'UserId':_0x642b33[_0xdda2('0x5a')]['id'],'ContactId':_0x51cebf['id'],'FaxAccountId':_0x2678be['id'],'fax':_0x642b33[_0xdda2('0x59')]['to'][0x0],'firstMsgDirection':_0xdda2('0xb1'),'Messages':[_['merge'](_0x642b33['body'],{'read':![],'body':_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][0x0][_0xdda2('0xb2')],'FaxAccountId':_0x2678be['id'],'UserId':_0x642b33[_0xdda2('0x5a')]['id'],'ContactId':_0x51cebf['id'],'AttachmentId':_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][0x0]['id']})]},{'include':[{'model':db[_0xdda2('0x9e')],'as':_0xdda2('0xb3')}]})[_0xdda2('0x22')](function(_0x2c9d6b){return[_0x2c9d6b,!![]];});});}else{throw new Error(_0xdda2('0xb4'));}})['spread'](function(_0x13e955,_0x4dbada){if(_0x4dbada){return _0x13e955;}return db[_0xdda2('0x9e')]['create']({'direction':_0xdda2('0xb1'),'read':![],'body':_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][0x0][_0xdda2('0xb2')],'FaxAccountId':_0x2678be['id'],'FaxInteractionId':_0x13e955['id'],'UserId':_0x642b33['user']['id'],'ContactId':_0x13e955['ContactId'],'AttachmentId':_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][0x0]['id']})[_0xdda2('0x22')](function(_0x365aa5){_0x13e955['dataValues'][_0xdda2('0xb3')]=[];_0x13e955[_0xdda2('0xb5')][_0xdda2('0xb3')][_0xdda2('0x89')](_0x365aa5[_0xdda2('0xb5')]);return _0x13e955;});})[_0xdda2('0x22')](function(_0x45360a){respondWithRpcPromise(_0xdda2('0xb6'),_0xdda2('0xb6'),{'FaxAccountId':_[_0xdda2('0xaa')](_0x642b33[_0xdda2('0x56')]['id'])?undefined:_0x642b33[_0xdda2('0x56')]['id'],'path':_[_0xdda2('0xaa')](_0x642b33[_0xdda2('0x59')]['attachments'][0x0][_0xdda2('0x6')])?undefined:_0x642b33[_0xdda2('0x59')]['attachments'][0x0][_0xdda2('0x6')],'fax':_[_0xdda2('0xaa')](_0x642b33[_0xdda2('0x59')]['to'][0x0])?undefined:_0x642b33[_0xdda2('0x59')]['to'][0x0],'AttachmentId':_0x642b33[_0xdda2('0x59')][_0xdda2('0xa6')][0x0]['id']},client9002)['then'](function(_0x1fe2d3){logger[_0xdda2('0x23')](_0xdda2('0xb7'),_0x1fe2d3);})['catch'](function(_0x31bd58){logger[_0xdda2('0x23')](_0xdda2('0xb7'),_0x31bd58);});return _0x45360a;})[_0xdda2('0x22')](respondWithResult(_0x4b7ad8,null))['catch'](handleError(_0x4b7ad8,null));};exports['addAgents']=function(_0x56bff0,_0x38bcc0,_0x1ac115){return db[_0xdda2('0x3c')][_0xdda2('0x5d')]({'where':{'id':_0x56bff0['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x38bcc0,null))[_0xdda2('0x22')](function(_0x55a319){if(_0x55a319){return _0x55a319[_0xdda2('0xb8')](_0x56bff0[_0xdda2('0x59')]['ids'],_[_0xdda2('0x70')](_0x56bff0['body'],[_0xdda2('0x6b'),'id'])||{})[_0xdda2('0xb9')](function(_0x564510){for(var _0x205c90=0x0;_0x205c90<_0x56bff0[_0xdda2('0x59')]['ids'][_0xdda2('0x46')];_0x205c90+=0x1){socket[_0xdda2('0xba')]('userFaxAccount:save',{'UserId':_0x56bff0[_0xdda2('0x59')]['ids'][_0x205c90],'FaxAccountId':_0x56bff0[_0xdda2('0x56')]['id']});}return _0x564510;});}})[_0xdda2('0x22')](respondWithResult(_0x38bcc0,null))[_0xdda2('0x2b')](handleError(_0x38bcc0,null));};exports[_0xdda2('0xbb')]=function(_0xbb7633,_0x83d76,_0x3162d1){return db[_0xdda2('0x3c')]['find']({'where':{'id':_0xbb7633['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x83d76,null))['then'](function(_0x35022c){if(_0x35022c){return _0x35022c['removeAgents'](_0xbb7633['query'][_0xdda2('0x6b')])[_0xdda2('0x22')](function(){if(_[_0xdda2('0xbc')](_0xbb7633[_0xdda2('0x41')][_0xdda2('0x6b')])){for(var _0x1f3ae7=0x0;_0x1f3ae7<_0xbb7633[_0xdda2('0x41')][_0xdda2('0x6b')]['length'];_0x1f3ae7+=0x1){socket['emit'](_0xdda2('0xbd'),{'UserId':Number(_0xbb7633[_0xdda2('0x41')][_0xdda2('0x6b')][_0x1f3ae7]),'FaxAccountId':Number(_0xbb7633[_0xdda2('0x56')]['id'])});}}else{socket[_0xdda2('0xba')](_0xdda2('0xbd'),{'UserId':Number(_0xbb7633[_0xdda2('0x41')][_0xdda2('0x6b')]),'FaxAccountId':Number(_0xbb7633[_0xdda2('0x56')]['id'])});}});}})[_0xdda2('0x22')](respondWithStatusCode(_0x83d76,null))[_0xdda2('0x2b')](handleError(_0x83d76,null));};exports[_0xdda2('0xbe')]=function(_0x68fa9d,_0x4c9502,_0xaabf31){var _0x14a6b3={};var _0x111357={};var _0xf0ce53;var _0x4551fa;return db[_0xdda2('0x3c')][_0xdda2('0x64')]({'where':{'id':_0x68fa9d['params']['id']}})[_0xdda2('0x22')](handleEntityNotFound(_0x4c9502,null))[_0xdda2('0x22')](function(_0x3ffb46){if(_0x3ffb46){_0xf0ce53=_0x3ffb46;_0x111357[_0xdda2('0x3f')]=_[_0xdda2('0x42')](db[_0xdda2('0x74')][_0xdda2('0x3d')]);_0x111357[_0xdda2('0x41')]=_['keys'](_0x68fa9d[_0xdda2('0x41')]);_0x111357['filters']=_['intersection'](_0x111357[_0xdda2('0x3f')],_0x111357[_0xdda2('0x41')]);_0x14a6b3[_0xdda2('0x45')]=_[_0xdda2('0x43')](_0x111357[_0xdda2('0x3f')],qs[_0xdda2('0x44')](_0x68fa9d[_0xdda2('0x41')][_0xdda2('0x44')]));_0x14a6b3['attributes']=_0x14a6b3[_0xdda2('0x45')]['length']?_0x14a6b3['attributes']:_0x111357[_0xdda2('0x3f')];_0x14a6b3[_0xdda2('0x4a')]=qs[_0xdda2('0x4b')](_0x68fa9d[_0xdda2('0x41')][_0xdda2('0x4b')]);_0x14a6b3['where']=qs[_0xdda2('0x57')](_[_0xdda2('0x4c')](_0x68fa9d['query'],_0x111357[_0xdda2('0x57')]));if(_0x68fa9d[_0xdda2('0x41')][_0xdda2('0x4d')]){_0x14a6b3[_0xdda2('0x4e')]=_[_0xdda2('0x51')](_0x14a6b3[_0xdda2('0x4e')],{'$or':_['map'](_0x14a6b3[_0xdda2('0x45')],function(_0x5496df){var _0x9b43d6={};_0x9b43d6[_0x5496df]={'$like':'%'+_0x68fa9d[_0xdda2('0x41')]['filter']+'%'};return _0x9b43d6;})});}_0x14a6b3=_[_0xdda2('0x51')]({},_0x14a6b3,_0x68fa9d[_0xdda2('0x66')]);return _0xf0ce53['getAgents'](_0x14a6b3);}})['then'](function(_0x35cdcd){if(_0x35cdcd){_0x4551fa=_0x35cdcd['length'];if(!_0x68fa9d['query']['hasOwnProperty'](_0xdda2('0x48'))){_0x14a6b3[_0xdda2('0x49')]=qs[_0xdda2('0x49')](_0x68fa9d[_0xdda2('0x41')][_0xdda2('0x49')]);_0x14a6b3['offset']=qs[_0xdda2('0x2f')](_0x68fa9d[_0xdda2('0x41')][_0xdda2('0x2f')]);}return _0xf0ce53[_0xdda2('0xbe')](_0x14a6b3);}})[_0xdda2('0x22')](function(_0x2b5efe){if(_0x2b5efe){return _0x2b5efe?{'count':_0x4551fa,'rows':_0x2b5efe}:null;}})[_0xdda2('0x22')](respondWithResult(_0x4c9502,null))['catch'](handleError(_0x4c9502,null));}; \ No newline at end of file +var _0x8603=['List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','isArray','userFaxAccount:remove','getAgents','eml-format','rimraf','zip-dir','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','end','status','json','count','offset','set','Content-Range','save','update','get','UserProfileResource','destroy','sendStatus','name','send','index','Pause','map','rawAttributes','fieldName','type','model','keys','filters','intersection','query','attributes','fields','length','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','options','FaxAccount','includeAll','rows','show','params','mandatoryDispositionPause','include','find','catch','create','body','user','FaxAccounts','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','Disposition','getDispositions','findOne','pick','FaxAccountId','removeDispositions','ids','CannedAnswer','getAnswers','hasOwnProperty','findAll','removeAnswers','addInteraction','FaxInteraction','omit','getInteractions','CmContact','User','fullname','Tag','Tags','color','tag','addApplications','sequelize','FaxApplication','bulkCreate','priority','getApplications','from-voip-provider','exten','app','system','description','Fax\x20Extension','appdata','push','Set','localstationid','headerinfo','maxrate','minrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','tech','key','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','from','\x22%s\x22\x20<%s>','fax'];(function(_0x8c2744,_0x47ec60){var _0x13c240=function(_0x16a303){while(--_0x16a303){_0x8c2744['push'](_0x8c2744['shift']());}};_0x13c240(++_0x47ec60);}(_0x8603,0x190));var _0x3860=function(_0x15ca87,_0x197a99){_0x15ca87=_0x15ca87-0x0;var _0x4ee1ca=_0x8603[_0x15ca87];return _0x4ee1ca;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3860('0x0'));var rimraf=require(_0x3860('0x1'));var zipdir=require(_0x3860('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3860('0x3'));var BPromise=require(_0x3860('0x4'));var Mustache=require(_0x3860('0x5'));var util=require('util');var path=require(_0x3860('0x6'));var sox=require('sox');var csv=require(_0x3860('0x7'));var ejs=require(_0x3860('0x8'));var fs=require('fs');var _=require(_0x3860('0x9'));var squel=require(_0x3860('0xa'));var crypto=require(_0x3860('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3860('0xc'));var Papa=require(_0x3860('0xd'));var Redis=require('ioredis');var authService=require(_0x3860('0xe'));var qs=require(_0x3860('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3860('0x10'));var logger=require(_0x3860('0x11'))('api');var utils=require(_0x3860('0x12'));var config=require(_0x3860('0x13'));var db=require('../../mysqldb')['db'];config[_0x3860('0x14')]=_[_0x3860('0x15')](config[_0x3860('0x14')],{'host':_0x3860('0x16'),'port':0x18eb});var socket=require(_0x3860('0x17'))(new Redis(config[_0x3860('0x14')]));require(_0x3860('0x18'))[_0x3860('0x19')](socket);var jayson=require(_0x3860('0x1a'));var client=jayson[_0x3860('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x3860('0x1b')][_0x3860('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x122e40,_0x37d9ab,_0x1055b3){if(_0x1055b3){var _0xfa0c9a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xfa0c9a[_0x3860('0x1d')](_0x37d9ab)){return _0x122e40;}else{throw new db[(_0x3860('0x1e'))][(_0x3860('0x1f'))](_0x3860('0x20'));}}else{return _0x122e40;}}function respondWithRpcPromise(_0x3e51b4,_0x45b799,_0x4b6b15,_0x4863bd){return new BPromise(function(_0x373b06,_0x41ce59){var _0x33caaf=_0x4863bd||client;return _0x33caaf['request'](_0x3e51b4,_0x4b6b15)[_0x3860('0x21')](function(_0x145b26){logger[_0x3860('0x22')](_0x3860('0x23'),_0x45b799,_0x3860('0x24'));logger[_0x3860('0x25')](_0x3860('0x26'),_0x45b799,_0x3860('0x24'),JSON[_0x3860('0x27')](_0x145b26));if(_0x145b26[_0x3860('0x28')]){if(_0x145b26[_0x3860('0x28')][_0x3860('0x29')]===0x1f4){logger[_0x3860('0x28')](_0x3860('0x23'),_0x45b799,_0x145b26[_0x3860('0x28')]['message']);return _0x41ce59(_0x145b26[_0x3860('0x28')][_0x3860('0x2a')]);}logger[_0x3860('0x28')](_0x3860('0x23'),_0x45b799,_0x145b26[_0x3860('0x28')]['message']);return _0x373b06(_0x145b26[_0x3860('0x28')]['message']);}else{logger['info'](_0x3860('0x23'),_0x45b799,_0x3860('0x24'));_0x373b06(_0x145b26['result']['message']);}})['catch'](function(_0x1b2e4d){logger[_0x3860('0x28')](_0x3860('0x23'),_0x45b799,_0x1b2e4d);_0x41ce59(_0x1b2e4d);});});}function respondWithStatusCode(_0x371f3a,_0x9332a5){_0x9332a5=_0x9332a5||0xcc;return function(_0x228d34){if(_0x228d34){return _0x371f3a['sendStatus'](_0x9332a5);}return _0x371f3a['status'](_0x9332a5)[_0x3860('0x2b')]();};}function respondWithResult(_0x1f1809,_0x5a9af2){_0x5a9af2=_0x5a9af2||0xc8;return function(_0x2551f4){if(_0x2551f4){return _0x1f1809[_0x3860('0x2c')](_0x5a9af2)[_0x3860('0x2d')](_0x2551f4);}};}function respondWithFilteredResult(_0x426e6c,_0x3628f7){return function(_0x4bbae9){if(_0x4bbae9){var _0x36ae2b=_0x4bbae9[_0x3860('0x2e')],_0xf624ba=_0x3628f7['offset'],_0x367b14=_0x3628f7[_0x3860('0x2f')]+_0x3628f7['limit'],_0x4bd90c;if(_0x367b14>=_0x36ae2b){_0x367b14=_0x36ae2b;_0x4bd90c=0xc8;}else{_0x4bd90c=0xce;}_0x426e6c[_0x3860('0x2c')](_0x4bd90c);return _0x426e6c[_0x3860('0x30')](_0x3860('0x31'),_0xf624ba+'-'+_0x367b14+'/'+_0x36ae2b)['json'](_0x4bbae9);}return null;};}function patchUpdates(_0x39c751){return function(_0x451b0c){try{jsonpatch['apply'](_0x451b0c,_0x39c751,!![]);}catch(_0x1c94cc){return BPromise['reject'](_0x1c94cc);}return _0x451b0c[_0x3860('0x32')]();};}function saveUpdates(_0x3a577a,_0x35185c){return function(_0x2fc231){if(_0x2fc231){return _0x2fc231[_0x3860('0x33')](_0x3a577a)[_0x3860('0x21')](function(_0x1d3fd0){return _0x1d3fd0;});}return null;};}function removeEntity(_0x4d30bc,_0x1a48b6){return function(_0x396ccf){if(_0x396ccf){return _0x396ccf['destroy']()[_0x3860('0x21')](function(){var _0x398525=_0x396ccf[_0x3860('0x34')]({'plain':!![]});var _0x5af661='FaxAccounts';return db[_0x3860('0x35')][_0x3860('0x36')]({'where':{'type':_0x5af661,'resourceId':_0x398525['id']}})[_0x3860('0x21')](function(){return _0x396ccf;});})[_0x3860('0x21')](function(){_0x4d30bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ad0aa,_0x40dae8){return function(_0xc715a0){if(!_0xc715a0){_0x3ad0aa[_0x3860('0x37')](0x194);}return _0xc715a0;};}function handleError(_0x42f219,_0x4df2a9){_0x4df2a9=_0x4df2a9||0x1f4;return function(_0x424424){logger[_0x3860('0x28')](_0x424424['stack']);if(_0x424424['name']){delete _0x424424[_0x3860('0x38')];}_0x42f219[_0x3860('0x2c')](_0x4df2a9)[_0x3860('0x39')](_0x424424);};}exports[_0x3860('0x3a')]=function(_0x2b35b2,_0x592311){var _0x28f04d={'include':[{'model':db[_0x3860('0x3b')],'as':'mandatoryDispositionPause'}]},_0x510aef={},_0x112600={'count':0x0,'rows':[]};var _0x36d9bd=_[_0x3860('0x3c')](db['FaxAccount'][_0x3860('0x3d')],function(_0xc7d34d){return{'name':_0xc7d34d[_0x3860('0x3e')],'type':_0xc7d34d[_0x3860('0x3f')]['key']};});_0x510aef[_0x3860('0x40')]=_[_0x3860('0x3c')](_0x36d9bd,_0x3860('0x38'));_0x510aef['query']=_[_0x3860('0x41')](_0x2b35b2['query']);_0x510aef[_0x3860('0x42')]=_[_0x3860('0x43')](_0x510aef[_0x3860('0x40')],_0x510aef[_0x3860('0x44')]);_0x28f04d[_0x3860('0x45')]=_[_0x3860('0x43')](_0x510aef['model'],qs[_0x3860('0x46')](_0x2b35b2[_0x3860('0x44')]['fields']));_0x28f04d['attributes']=_0x28f04d[_0x3860('0x45')][_0x3860('0x47')]?_0x28f04d['attributes']:_0x510aef[_0x3860('0x40')];if(!_0x2b35b2[_0x3860('0x44')]['hasOwnProperty'](_0x3860('0x48'))){_0x28f04d[_0x3860('0x49')]=qs[_0x3860('0x49')](_0x2b35b2[_0x3860('0x44')][_0x3860('0x49')]);_0x28f04d[_0x3860('0x2f')]=qs[_0x3860('0x2f')](_0x2b35b2[_0x3860('0x44')][_0x3860('0x2f')]);}_0x28f04d[_0x3860('0x4a')]=qs[_0x3860('0x4b')](_0x2b35b2[_0x3860('0x44')][_0x3860('0x4b')]);_0x28f04d['where']=qs[_0x3860('0x42')](_['pick'](_0x2b35b2[_0x3860('0x44')],_0x510aef[_0x3860('0x42')]));if(_0x2b35b2[_0x3860('0x44')][_0x3860('0x4c')]){_0x28f04d[_0x3860('0x4d')]=_[_0x3860('0x4e')](_0x28f04d[_0x3860('0x4d')],{'$or':_[_0x3860('0x3c')](_0x36d9bd,function(_0x5a91b2){if(_0x5a91b2[_0x3860('0x3f')]!==_0x3860('0x4f')){var _0x19d590={};_0x19d590[_0x5a91b2['name']]={'$like':'%'+_0x2b35b2[_0x3860('0x44')][_0x3860('0x4c')]+'%'};return _0x19d590;}})});}_0x28f04d=_[_0x3860('0x4e')]({},_0x28f04d,_0x2b35b2[_0x3860('0x50')]);var _0x5ed2db={'where':_0x28f04d['where']};return db[_0x3860('0x51')]['count'](_0x5ed2db)[_0x3860('0x21')](function(_0x4226da){_0x112600[_0x3860('0x2e')]=_0x4226da;if(_0x2b35b2['query'][_0x3860('0x52')]){_0x28f04d['include']=[{'all':!![]}];}return db[_0x3860('0x51')]['findAll'](_0x28f04d);})[_0x3860('0x21')](function(_0x25d22f){_0x112600[_0x3860('0x53')]=_0x25d22f;return _0x112600;})['then'](respondWithFilteredResult(_0x592311,_0x28f04d))['catch'](handleError(_0x592311,null));};exports[_0x3860('0x54')]=function(_0x2de249,_0x478dd9){var _0x3910f5={'raw':![],'where':{'id':_0x2de249[_0x3860('0x55')]['id']},'include':[{'model':db[_0x3860('0x3b')],'as':_0x3860('0x56')}]},_0x58237e={};_0x58237e[_0x3860('0x40')]=_[_0x3860('0x41')](db[_0x3860('0x51')][_0x3860('0x3d')]);_0x58237e['query']=_[_0x3860('0x41')](_0x2de249[_0x3860('0x44')]);_0x58237e[_0x3860('0x42')]=_[_0x3860('0x43')](_0x58237e[_0x3860('0x40')],_0x58237e[_0x3860('0x44')]);_0x3910f5['attributes']=_[_0x3860('0x43')](_0x58237e[_0x3860('0x40')],qs[_0x3860('0x46')](_0x2de249[_0x3860('0x44')][_0x3860('0x46')]));_0x3910f5[_0x3860('0x45')]=_0x3910f5[_0x3860('0x45')][_0x3860('0x47')]?_0x3910f5['attributes']:_0x58237e[_0x3860('0x40')];if(_0x2de249[_0x3860('0x44')]['includeAll']){_0x3910f5[_0x3860('0x57')]=[{'all':!![]}];}_0x3910f5=_[_0x3860('0x4e')]({},_0x3910f5,_0x2de249[_0x3860('0x50')]);return db['FaxAccount'][_0x3860('0x58')](_0x3910f5)['then'](handleEntityNotFound(_0x478dd9,null))[_0x3860('0x21')](respondWithResult(_0x478dd9,null))[_0x3860('0x59')](handleError(_0x478dd9,null));};exports[_0x3860('0x5a')]=function(_0x2cc119,_0x27a853){return db[_0x3860('0x51')][_0x3860('0x5a')](_0x2cc119[_0x3860('0x5b')],{})[_0x3860('0x21')](function(_0x151492){var _0x3ba9a1=_0x2cc119[_0x3860('0x5c')]['get']({'plain':!![]});if(!_0x3ba9a1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3ba9a1['role']===_0x3860('0x5c')){var _0x572e29=_0x151492['get']({'plain':!![]});var _0xc2bd40=_0x3860('0x5d');return db[_0x3860('0x5e')][_0x3860('0x58')]({'where':{'name':_0xc2bd40,'userProfileId':_0x3ba9a1[_0x3860('0x5f')]},'raw':!![]})[_0x3860('0x21')](function(_0x509c97){if(_0x509c97&&_0x509c97['autoAssociation']===0x0){return db['UserProfileResource'][_0x3860('0x5a')]({'name':_0x572e29[_0x3860('0x38')],'resourceId':_0x572e29['id'],'type':_0x509c97[_0x3860('0x38')],'sectionId':_0x509c97['id']},{})['then'](function(){return _0x151492;});}else{return _0x151492;}})[_0x3860('0x59')](function(_0x59a0bd){logger[_0x3860('0x28')](_0x3860('0x60'),_0x59a0bd);throw _0x59a0bd;});}return _0x151492;})['then'](respondWithResult(_0x27a853,0xc9))[_0x3860('0x59')](handleError(_0x27a853,null));};exports[_0x3860('0x33')]=function(_0xfe45d8,_0x27f817){if(_0xfe45d8['body']['id']){delete _0xfe45d8[_0x3860('0x5b')]['id'];}return db[_0x3860('0x51')][_0x3860('0x58')]({'where':{'id':_0xfe45d8['params']['id']},'include':[{'model':db['Pause'],'as':_0x3860('0x56')}]})[_0x3860('0x21')](handleEntityNotFound(_0x27f817,null))[_0x3860('0x21')](saveUpdates(_0xfe45d8[_0x3860('0x5b')],null))[_0x3860('0x21')](respondWithResult(_0x27f817,null))[_0x3860('0x59')](handleError(_0x27f817,null));};exports['destroy']=function(_0x2d916a,_0x4fe4e8){return db['FaxAccount'][_0x3860('0x58')]({'where':{'id':_0x2d916a[_0x3860('0x55')]['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x4fe4e8,null))[_0x3860('0x21')](removeEntity(_0x4fe4e8,null))[_0x3860('0x59')](handleError(_0x4fe4e8,null));};exports[_0x3860('0x61')]=function(_0x5b9a7b,_0xf8928f){return db[_0x3860('0x51')][_0x3860('0x61')]()[_0x3860('0x21')](respondWithResult(_0xf8928f,null))[_0x3860('0x59')](handleError(_0xf8928f,null));};exports[_0x3860('0x62')]=function(_0x5f2c66,_0x1ae31b,_0x81010b){if(_0x5f2c66[_0x3860('0x5b')]['id']){delete _0x5f2c66['body']['id'];}return db['FaxAccount'][_0x3860('0x58')]({'where':{'id':_0x5f2c66[_0x3860('0x55')]['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x1ae31b,null))[_0x3860('0x21')](function(_0x3fe275){if(_0x3fe275){_0x5f2c66['body']['FaxAccountId']=_0x3fe275['id'];return db[_0x3860('0x63')][_0x3860('0x5a')](_0x5f2c66['body']);}})['then'](respondWithResult(_0x1ae31b,null))[_0x3860('0x59')](handleError(_0x1ae31b,null));};exports[_0x3860('0x64')]=function(_0x4ca6de,_0x304b18,_0x4124ce){var _0x12913c={'raw':![],'where':{}};var _0x11964d={};var _0x495167={'count':0x0,'rows':[]};return db[_0x3860('0x51')][_0x3860('0x65')]({'where':{'id':_0x4ca6de['params']['id']}})['then'](handleEntityNotFound(_0x304b18,null))[_0x3860('0x21')](function(_0x3427a5){if(_0x3427a5){_0x11964d['model']=_[_0x3860('0x41')](db['Disposition'][_0x3860('0x3d')]);_0x11964d['query']=_['keys'](_0x4ca6de[_0x3860('0x44')]);_0x11964d['filters']=_[_0x3860('0x43')](_0x11964d[_0x3860('0x40')],_0x11964d[_0x3860('0x44')]);_0x12913c[_0x3860('0x45')]=_[_0x3860('0x43')](_0x11964d[_0x3860('0x40')],qs['fields'](_0x4ca6de[_0x3860('0x44')][_0x3860('0x46')]));_0x12913c[_0x3860('0x45')]=_0x12913c['attributes'][_0x3860('0x47')]?_0x12913c['attributes']:_0x11964d[_0x3860('0x40')];if(!_0x4ca6de[_0x3860('0x44')]['hasOwnProperty'](_0x3860('0x48'))){_0x12913c[_0x3860('0x49')]=qs[_0x3860('0x49')](_0x4ca6de['query']['limit']);_0x12913c['offset']=qs['offset'](_0x4ca6de[_0x3860('0x44')][_0x3860('0x2f')]);}_0x12913c[_0x3860('0x4a')]=qs[_0x3860('0x4b')](_0x4ca6de['query']['sort']);_0x12913c[_0x3860('0x4d')]=qs[_0x3860('0x42')](_[_0x3860('0x66')](_0x4ca6de[_0x3860('0x44')],_0x11964d['filters']));_0x12913c[_0x3860('0x4d')][_0x3860('0x67')]=_0x3427a5['id'];if(_0x4ca6de['query']['filter']){_0x12913c[_0x3860('0x4d')]=_[_0x3860('0x4e')](_0x12913c[_0x3860('0x4d')],{'$or':_[_0x3860('0x3c')](_0x12913c['attributes'],function(_0x516c6d){var _0x120b3b={};_0x120b3b[_0x516c6d]={'$like':'%'+_0x4ca6de['query'][_0x3860('0x4c')]+'%'};return _0x120b3b;})});}_0x12913c=_[_0x3860('0x4e')]({},_0x12913c,_0x4ca6de['options']);return db['Disposition']['count']({'where':_0x12913c[_0x3860('0x4d')]})[_0x3860('0x21')](function(_0x507480){_0x495167[_0x3860('0x2e')]=_0x507480;if(_0x4ca6de[_0x3860('0x44')][_0x3860('0x52')]){_0x12913c[_0x3860('0x57')]=[{'all':!![]}];}return db[_0x3860('0x63')]['findAll'](_0x12913c);})[_0x3860('0x21')](function(_0x31e791){_0x495167[_0x3860('0x53')]=_0x31e791;return _0x495167;});}})[_0x3860('0x21')](respondWithFilteredResult(_0x304b18,_0x12913c))[_0x3860('0x59')](handleError(_0x304b18,null));};exports['removeDispositions']=function(_0x313366,_0xf57e80,_0x2f3759){return db[_0x3860('0x51')][_0x3860('0x58')]({'where':{'id':_0x313366['params']['id']}})['then'](handleEntityNotFound(_0xf57e80,null))[_0x3860('0x21')](function(_0x2f3eb6){if(_0x2f3eb6){return _0x2f3eb6[_0x3860('0x68')](_0x313366[_0x3860('0x44')][_0x3860('0x69')]);}})[_0x3860('0x21')](respondWithStatusCode(_0xf57e80,null))[_0x3860('0x59')](handleError(_0xf57e80,null));};exports['addAnswer']=function(_0x458c1b,_0x3eb292,_0x58eddd){if(_0x458c1b[_0x3860('0x5b')]['id']){delete _0x458c1b[_0x3860('0x5b')]['id'];}return db[_0x3860('0x51')]['find']({'where':{'id':_0x458c1b[_0x3860('0x55')]['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x3eb292,null))['then'](function(_0x470818){if(_0x470818){_0x458c1b['body'][_0x3860('0x67')]=_0x470818['id'];return db[_0x3860('0x6a')]['create'](_0x458c1b[_0x3860('0x5b')]);}})[_0x3860('0x21')](respondWithResult(_0x3eb292,null))[_0x3860('0x59')](handleError(_0x3eb292,null));};exports[_0x3860('0x6b')]=function(_0x115d49,_0x5d37e4,_0x307d19){var _0x15b0b0={'raw':![],'where':{}};var _0x43aa44={};var _0x6e6513={'count':0x0,'rows':[]};return db[_0x3860('0x51')]['findOne']({'where':{'id':_0x115d49['params']['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x5d37e4,null))[_0x3860('0x21')](function(_0x50bb73){if(_0x50bb73){_0x43aa44[_0x3860('0x40')]=_[_0x3860('0x41')](db[_0x3860('0x6a')][_0x3860('0x3d')]);_0x43aa44['query']=_[_0x3860('0x41')](_0x115d49['query']);_0x43aa44[_0x3860('0x42')]=_[_0x3860('0x43')](_0x43aa44[_0x3860('0x40')],_0x43aa44[_0x3860('0x44')]);_0x15b0b0[_0x3860('0x45')]=_[_0x3860('0x43')](_0x43aa44[_0x3860('0x40')],qs['fields'](_0x115d49[_0x3860('0x44')][_0x3860('0x46')]));_0x15b0b0['attributes']=_0x15b0b0['attributes']['length']?_0x15b0b0['attributes']:_0x43aa44[_0x3860('0x40')];if(!_0x115d49[_0x3860('0x44')][_0x3860('0x6c')](_0x3860('0x48'))){_0x15b0b0[_0x3860('0x49')]=qs[_0x3860('0x49')](_0x115d49['query'][_0x3860('0x49')]);_0x15b0b0['offset']=qs[_0x3860('0x2f')](_0x115d49[_0x3860('0x44')][_0x3860('0x2f')]);}_0x15b0b0[_0x3860('0x4a')]=qs[_0x3860('0x4b')](_0x115d49[_0x3860('0x44')][_0x3860('0x4b')]);_0x15b0b0[_0x3860('0x4d')]=qs[_0x3860('0x42')](_[_0x3860('0x66')](_0x115d49[_0x3860('0x44')],_0x43aa44['filters']));_0x15b0b0[_0x3860('0x4d')][_0x3860('0x67')]=_0x50bb73['id'];if(_0x115d49[_0x3860('0x44')]['filter']){_0x15b0b0[_0x3860('0x4d')]=_[_0x3860('0x4e')](_0x15b0b0[_0x3860('0x4d')],{'$or':_[_0x3860('0x3c')](_0x15b0b0['attributes'],function(_0x16a462){var _0x19ace1={};_0x19ace1[_0x16a462]={'$like':'%'+_0x115d49[_0x3860('0x44')]['filter']+'%'};return _0x19ace1;})});}_0x15b0b0=_[_0x3860('0x4e')]({},_0x15b0b0,_0x115d49[_0x3860('0x50')]);return db[_0x3860('0x6a')]['count']({'where':_0x15b0b0[_0x3860('0x4d')]})[_0x3860('0x21')](function(_0x171400){_0x6e6513['count']=_0x171400;if(_0x115d49[_0x3860('0x44')][_0x3860('0x52')]){_0x15b0b0[_0x3860('0x57')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3860('0x6d')](_0x15b0b0);})[_0x3860('0x21')](function(_0x1b8060){_0x6e6513['rows']=_0x1b8060;return _0x6e6513;});}})[_0x3860('0x21')](respondWithFilteredResult(_0x5d37e4,_0x15b0b0))['catch'](handleError(_0x5d37e4,null));};exports[_0x3860('0x6e')]=function(_0x581e7b,_0x256156,_0x418bb1){return db[_0x3860('0x51')][_0x3860('0x58')]({'where':{'id':_0x581e7b[_0x3860('0x55')]['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x256156,null))[_0x3860('0x21')](function(_0x3c9ccc){if(_0x3c9ccc){return _0x3c9ccc[_0x3860('0x6e')](_0x581e7b[_0x3860('0x44')][_0x3860('0x69')]);}})[_0x3860('0x21')](respondWithStatusCode(_0x256156,null))[_0x3860('0x59')](handleError(_0x256156,null));};exports[_0x3860('0x6f')]=function(_0x24e374,_0x186479,_0x46661f){return db[_0x3860('0x70')]['find']({'where':{'id':_0x24e374[_0x3860('0x55')]['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x186479,null))[_0x3860('0x21')](function(_0x28cf53){if(_0x28cf53){return _0x28cf53[_0x3860('0x6f')](_0x24e374[_0x3860('0x5b')][_0x3860('0x69')],_[_0x3860('0x71')](_0x24e374[_0x3860('0x5b')],[_0x3860('0x69'),'id'])||{});}})[_0x3860('0x21')](respondWithResult(_0x186479,null))['catch'](handleError(_0x186479,null));};exports[_0x3860('0x72')]=function(_0x1746cd,_0x666daa,_0x6334ca){var _0x4a929e={'raw':![],'where':{}};var _0x1a1994={};var _0x2ece36={'count':0x0,'rows':[]};return db[_0x3860('0x51')][_0x3860('0x65')]({'where':{'id':_0x1746cd['params']['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x666daa,null))['then'](function(_0x5450e2){if(_0x5450e2){_0x1a1994[_0x3860('0x40')]=_[_0x3860('0x41')](db[_0x3860('0x70')][_0x3860('0x3d')]);_0x1a1994[_0x3860('0x44')]=_[_0x3860('0x41')](_0x1746cd[_0x3860('0x44')]);_0x1a1994[_0x3860('0x42')]=_[_0x3860('0x43')](_0x1a1994[_0x3860('0x40')],_0x1a1994[_0x3860('0x44')]);_0x4a929e[_0x3860('0x45')]=_[_0x3860('0x43')](_0x1a1994['model'],qs[_0x3860('0x46')](_0x1746cd['query'][_0x3860('0x46')]));_0x4a929e[_0x3860('0x45')]=_0x4a929e['attributes'][_0x3860('0x47')]?_0x4a929e[_0x3860('0x45')]:_0x1a1994[_0x3860('0x40')];if(!_0x1746cd[_0x3860('0x44')][_0x3860('0x6c')](_0x3860('0x48'))){_0x4a929e[_0x3860('0x49')]=qs['limit'](_0x1746cd[_0x3860('0x44')][_0x3860('0x49')]);_0x4a929e[_0x3860('0x2f')]=qs[_0x3860('0x2f')](_0x1746cd[_0x3860('0x44')]['offset']);}_0x4a929e[_0x3860('0x4a')]=qs['sort'](_0x1746cd['query']['sort']);_0x4a929e[_0x3860('0x4d')]=qs[_0x3860('0x42')](_[_0x3860('0x66')](_0x1746cd[_0x3860('0x44')],_0x1a1994[_0x3860('0x42')]));_0x4a929e[_0x3860('0x4d')][_0x3860('0x67')]=_0x5450e2['id'];if(_0x1746cd[_0x3860('0x44')]['filter']){_0x4a929e[_0x3860('0x4d')]=_[_0x3860('0x4e')](_0x4a929e['where'],{'$or':_['map'](_0x4a929e[_0x3860('0x45')],function(_0x316afa){var _0x1cf541={};_0x1cf541[_0x316afa]={'$like':'%'+_0x1746cd['query'][_0x3860('0x4c')]+'%'};return _0x1cf541;})});}_0x4a929e=_['merge']({},_0x4a929e,_0x1746cd[_0x3860('0x50')]);return db['FaxInteraction'][_0x3860('0x2e')]({'where':_0x4a929e[_0x3860('0x4d')]})['then'](function(_0x27af93){_0x2ece36[_0x3860('0x2e')]=_0x27af93;if(_0x1746cd['query'][_0x3860('0x52')]){_0x4a929e[_0x3860('0x57')]=[{'model':db[_0x3860('0x73')],'as':'Contact','required':![]},{'model':db[_0x3860('0x74')],'as':'Owner','attributes':[_0x3860('0x38'),_0x3860('0x75'),'internal'],'required':![]},{'model':db[_0x3860('0x76')],'as':_0x3860('0x77'),'attributes':['id',_0x3860('0x38'),_0x3860('0x78')],'where':_0x1746cd[_0x3860('0x44')]['tag']?{'id':_0x1746cd[_0x3860('0x44')][_0x3860('0x79')]}:undefined,'required':_0x1746cd['query']['tag']?!![]:![]}];}return db[_0x3860('0x70')]['findAll'](_0x4a929e);})[_0x3860('0x21')](function(_0xb59123){_0x2ece36['rows']=_0xb59123;return _0x2ece36;});}})[_0x3860('0x21')](respondWithFilteredResult(_0x666daa,_0x4a929e))['catch'](handleError(_0x666daa,null));};exports[_0x3860('0x7a')]=function(_0x4b8128,_0x10c82d,_0x24788d){return db[_0x3860('0x51')][_0x3860('0x65')]({'where':{'id':_0x4b8128['params']['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x10c82d,null))[_0x3860('0x21')](function(_0x20071c){if(_0x20071c){return db[_0x3860('0x7b')]['transaction'](function(_0x283449){return db[_0x3860('0x7c')]['destroy']({'where':{'FaxAccountId':_0x4b8128[_0x3860('0x55')]['id']},'transaction':_0x283449})[_0x3860('0x21')](function(_0x3a2576){var _0xe89c3d=_['map'](_0x4b8128[_0x3860('0x5b')],function(_0x2f479d){_0x2f479d[_0x3860('0x67')]=_0x4b8128[_0x3860('0x55')]['id'];return _0x2f479d;});return db['FaxApplication'][_0x3860('0x7d')](_0xe89c3d,{'transaction':_0x283449});});})['then'](function(){return db['FaxApplication']['findAndCountAll']({'where':{'FaxAccountId':_0x4b8128[_0x3860('0x55')]['id']},'order':_0x3860('0x7e')});});}})[_0x3860('0x21')](respondWithResult(_0x10c82d,null))['catch'](handleError(_0x10c82d,null));};exports[_0x3860('0x7f')]=function(_0x480ff0,_0x380a77,_0x36bb52){var _0x21c052={};var _0x3a920b={};var _0x5a49be;var _0x2fe232;return db[_0x3860('0x51')][_0x3860('0x65')]({'where':{'id':_0x480ff0['params']['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x380a77,null))[_0x3860('0x21')](function(_0x4d653a){if(_0x4d653a){_0x5a49be=_0x4d653a;_0x3a920b['model']=_['keys'](db['FaxApplication'][_0x3860('0x3d')]);_0x3a920b[_0x3860('0x44')]=_[_0x3860('0x41')](_0x480ff0[_0x3860('0x44')]);_0x3a920b[_0x3860('0x42')]=_[_0x3860('0x43')](_0x3a920b[_0x3860('0x40')],_0x3a920b['query']);_0x21c052['attributes']=_['intersection'](_0x3a920b[_0x3860('0x40')],qs[_0x3860('0x46')](_0x480ff0[_0x3860('0x44')]['fields']));_0x21c052[_0x3860('0x45')]=_0x21c052['attributes']['length']?_0x21c052['attributes']:_0x3a920b[_0x3860('0x40')];_0x21c052['order']=qs['sort'](_0x480ff0[_0x3860('0x44')][_0x3860('0x4b')]);_0x21c052[_0x3860('0x4d')]=qs[_0x3860('0x42')](_['pick'](_0x480ff0['query'],_0x3a920b['filters']));if(_0x480ff0['query'][_0x3860('0x4c')]){_0x21c052['where']=_['merge'](_0x21c052[_0x3860('0x4d')],{'$or':_[_0x3860('0x3c')](_0x21c052[_0x3860('0x45')],function(_0x14db3e){var _0x4be436={};_0x4be436[_0x14db3e]={'$like':'%'+_0x480ff0[_0x3860('0x44')][_0x3860('0x4c')]+'%'};return _0x4be436;})});}_0x21c052=_[_0x3860('0x4e')]({},_0x21c052,_0x480ff0[_0x3860('0x50')]);return _0x5a49be['getApplications'](_0x21c052);}})['then'](function(_0x20446d){if(_0x20446d){_0x2fe232=_0x20446d['length'];if(!_0x480ff0[_0x3860('0x44')]['hasOwnProperty'](_0x3860('0x48'))){_0x21c052[_0x3860('0x49')]=qs[_0x3860('0x49')](_0x480ff0[_0x3860('0x44')][_0x3860('0x49')]);_0x21c052['offset']=qs['offset'](_0x480ff0['query'][_0x3860('0x2f')]);}return _0x5a49be[_0x3860('0x7f')](_0x21c052);}})[_0x3860('0x21')](function(_0x41f2c0){if(_0x41f2c0){return _0x41f2c0?{'count':_0x2fe232,'rows':_0x41f2c0}:null;}})[_0x3860('0x21')](respondWithResult(_0x380a77,null))['catch'](handleError(_0x380a77,null));};function Extension(_0x268619,_0x19cd3e,_0x52ec1e,_0x5b3ca9){this['context']=_0x3860('0x80');this[_0x3860('0x81')]=_0x268619['localstationid'];this[_0x3860('0x82')]=_0x5b3ca9;this[_0x3860('0x3f')]=_0x3860('0x83');this[_0x3860('0x84')]=_0x3860('0x85');this[_0x3860('0x67')]=_0x268619['id'];this[_0x3860('0x7e')]=_0x19cd3e;this[_0x3860('0x86')]=_0x52ec1e;}function createExtensionsReciveFax(_0x3a3026){var _0x545e79=0x1;var _0x6173b8=[];_0x6173b8[_0x3860('0x87')](new Extension(_0x3a3026,_0x545e79,'','Answer'));_0x545e79+=0x1;_0x6173b8[_0x3860('0x87')](new Extension(_0x3a3026,_0x545e79,'CDR(type)=inbound-fax',_0x3860('0x88')));_0x545e79+=0x1;for(var _0x49475a in _0x3a3026){if(_0x3a3026[_0x3860('0x6c')](_0x49475a)&&(_0x49475a==='ecm'||_0x49475a===_0x3860('0x89')||_0x49475a==='gateway'||_0x49475a==='faxdetect'||_0x49475a===_0x3860('0x8a')||_0x49475a===_0x3860('0x8b')||_0x49475a===_0x3860('0x8c')||_0x49475a===_0x3860('0x8d')||_0x49475a===_0x3860('0x8e'))){_0x6173b8['push'](new Extension(_0x3a3026,_0x545e79,_0x3860('0x8f')+_0x49475a+')='+_0x3a3026[_0x49475a],_0x3860('0x88')));_0x545e79+=0x1;}}_0x6173b8[_0x3860('0x87')](new Extension(_0x3a3026,_0x545e79,'6',_0x3860('0x90')));_0x545e79+=0x1;_0x6173b8[_0x3860('0x87')](new Extension(_0x3a3026,_0x545e79,_0x3860('0x91'),'ReceiveFax'));_0x545e79=0x0;return _0x6173b8;}exports[_0x3860('0x92')]=function(_0x49a3ad,_0x42d1fd,_0x2a4836){var _0x118c4e;return db[_0x3860('0x7b')][_0x3860('0x93')](function(_0x24f8a6){return db['FaxAccount'][_0x3860('0x5a')](_0x49a3ad[_0x3860('0x5b')],{'transaction':_0x24f8a6})[_0x3860('0x21')](function(_0x25c452){_0x118c4e=_0x25c452['get']({'plain':!![]});return db[_0x3860('0x94')][_0x3860('0x7d')](createExtensionsReciveFax(_0x118c4e),{'transaction':_0x24f8a6});});})[_0x3860('0x21')](function(){return _0x118c4e;})[_0x3860('0x21')](respondWithResult(_0x42d1fd,null))[_0x3860('0x59')](handleError(_0x42d1fd,null));};exports[_0x3860('0x95')]=function(_0x4f1e2c,_0x39b89c,_0x28c430){var _0x1cb143;return db[_0x3860('0x7b')][_0x3860('0x93')](function(_0x2c7a5f){return db['FaxAccount']['update'](_0x4f1e2c['body'],{'where':{'id':_0x4f1e2c[_0x3860('0x5b')]['id']},'transaction':_0x2c7a5f})[_0x3860('0x21')](function(_0x5e8ef0){return db[_0x3860('0x94')][_0x3860('0x36')]({'where':{'FaxAccountId':_0x4f1e2c[_0x3860('0x5b')]['id']},'transaction':_0x2c7a5f})[_0x3860('0x21')](function(_0xb5c95a){return db[_0x3860('0x94')][_0x3860('0x7d')](createExtensionsReciveFax(_[_0x3860('0x71')](_0x4f1e2c[_0x3860('0x5b')],[_0x3860('0x96'),_0x3860('0x97'),_0x3860('0x98'),_0x3860('0x99'),_0x3860('0x9a'),_0x3860('0x9b')])),{'transaction':_0x2c7a5f});});});})['then'](function(){return db['FaxAccount'][_0x3860('0x9c')](_0x4f1e2c[_0x3860('0x5b')]['id']);})[_0x3860('0x21')](respondWithResult(_0x39b89c,null))[_0x3860('0x59')](handleError(_0x39b89c,null));};exports[_0x3860('0x9d')]=function(_0x34dbcd,_0x1290e7,_0xd8cdc7){var _0x59013c={'raw':!![],'where':{}};var _0x450ca8={};var _0x275f39={'count':0x0,'rows':[]};return db[_0x3860('0x51')]['findOne']({'where':{'id':_0x34dbcd[_0x3860('0x55')]['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x1290e7,null))[_0x3860('0x21')](function(_0x13b58d){if(_0x13b58d){_0x450ca8[_0x3860('0x40')]=_[_0x3860('0x41')](db[_0x3860('0x9e')][_0x3860('0x3d')]);_0x450ca8[_0x3860('0x44')]=_['keys'](_0x34dbcd[_0x3860('0x44')]);_0x450ca8[_0x3860('0x42')]=_['intersection'](_0x450ca8[_0x3860('0x40')],_0x450ca8[_0x3860('0x44')]);_0x59013c[_0x3860('0x45')]=_['intersection'](_0x450ca8[_0x3860('0x40')],qs[_0x3860('0x46')](_0x34dbcd[_0x3860('0x44')][_0x3860('0x46')]));_0x59013c['attributes']=_0x59013c['attributes'][_0x3860('0x47')]?_0x59013c['attributes']:_0x450ca8[_0x3860('0x40')];if(!_0x34dbcd[_0x3860('0x44')][_0x3860('0x6c')](_0x3860('0x48'))){_0x59013c[_0x3860('0x49')]=qs[_0x3860('0x49')](_0x34dbcd[_0x3860('0x44')][_0x3860('0x49')]);_0x59013c['offset']=qs[_0x3860('0x2f')](_0x34dbcd[_0x3860('0x44')]['offset']);}_0x59013c['order']=qs[_0x3860('0x4b')](_0x34dbcd['query'][_0x3860('0x4b')]);_0x59013c[_0x3860('0x4d')]=qs[_0x3860('0x42')](_[_0x3860('0x66')](_0x34dbcd[_0x3860('0x44')],_0x450ca8[_0x3860('0x42')]));_0x59013c[_0x3860('0x4d')][_0x3860('0x67')]=_0x13b58d['id'];if(_0x34dbcd['query']['filter']){_0x59013c[_0x3860('0x4d')]=_['merge'](_0x59013c[_0x3860('0x4d')],{'$or':_[_0x3860('0x3c')](_0x59013c[_0x3860('0x45')],function(_0x169750){var _0x1879c5={};_0x1879c5[_0x169750]={'$like':'%'+_0x34dbcd[_0x3860('0x44')][_0x3860('0x4c')]+'%'};return _0x1879c5;})});}if(_0x34dbcd['query']['$gte']){var _0x19f4a4=_0x34dbcd[_0x3860('0x44')][_0x3860('0x9f')]['split'](',');var _0x408d72={};_0x408d72[_0x19f4a4[0x0]]={'$gte':moment(_0x19f4a4[0x1])[_0x3860('0xa0')](_0x3860('0xa1'))};_0x59013c['where']=_[_0x3860('0x4e')](_0x59013c[_0x3860('0x4d')],_0x408d72);}_0x59013c=_['merge']({},_0x59013c,_0x34dbcd['options']);return db['FaxMessage']['count']({'where':_0x59013c['where']})[_0x3860('0x21')](function(_0x25107a){_0x275f39[_0x3860('0x2e')]=_0x25107a;if(_0x34dbcd[_0x3860('0x44')][_0x3860('0x52')]){_0x59013c['include']=[{'all':!![]}];}return db[_0x3860('0x9e')][_0x3860('0x6d')](_0x59013c);})['then'](function(_0x25874c){_0x275f39[_0x3860('0x53')]=_0x25874c;return _0x275f39;});}})[_0x3860('0x21')](respondWithFilteredResult(_0x1290e7,_0x59013c))[_0x3860('0x59')](handleError(_0x1290e7,null));};exports['send']=function(_0x4c8a10,_0x534237,_0x463892){var _0x519a72,_0x334962={},_0x280951;if(_0x4c8a10[_0x3860('0x5b')]['to']){_0x280951=_0x4c8a10[_0x3860('0x5b')]['to'][0x0];}return db[_0x3860('0x51')][_0x3860('0x58')]({'where':{'id':_0x4c8a10[_0x3860('0x55')]['id']},'include':[{'model':db[_0x3860('0xa2')],'as':_0x3860('0xa3'),'include':[{'model':db[_0x3860('0x73')],'as':_0x3860('0xa4'),'where':{'fax':_0x280951},'limit':0x1,'order':[[_0x3860('0x99'),_0x3860('0xa5')]]}]}]})[_0x3860('0x21')](handleEntityNotFound(_0x534237,null))[_0x3860('0x21')](function(_0xf1e9ab){_0x519a72=_0xf1e9ab;if(_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')]&&_0x4c8a10['body'][_0x3860('0xa6')]['length']){for(var _0x45b8a7=0x0;_0x45b8a7<_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][_0x3860('0x47')];_0x45b8a7+=0x1){_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][_0x45b8a7]={'filename':_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][_0x45b8a7][_0x3860('0x38')],'id':_0x4c8a10['body'][_0x3860('0xa6')][_0x45b8a7]['id'],'path':path[_0x3860('0xa7')](config[_0x3860('0xa8')],_0x3860('0xa9'),_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][_0x45b8a7][_0x3860('0xaa')])};}}return respondWithRpcPromise('CheckAfterSend',_0x3860('0xab'),{'FaxAccountId':_[_0x3860('0xac')](_0x4c8a10[_0x3860('0x55')]['id'])?undefined:_0x4c8a10['params']['id'],'path':_[_0x3860('0xac')](_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][0x0]['path'])?undefined:_0x4c8a10['body'][_0x3860('0xa6')][0x0][_0x3860('0x6')],'fax':_['isNil'](_0x4c8a10[_0x3860('0x5b')]['to'][0x0])?undefined:_0x4c8a10['body']['to'][0x0]},client9002);})[_0x3860('0x21')](function(){if(_0x519a72){if(_[_0x3860('0xac')](_0x4c8a10['body'][_0x3860('0xad')])){_0x4c8a10['body'][_0x3860('0xad')]=util[_0x3860('0xa0')](_0x3860('0xae'),_0x519a72[_0x3860('0x38')],_0x519a72[_0x3860('0xaf')]);}if(_0x519a72[_0x3860('0xa3')]){if(_0x519a72[_0x3860('0xa3')]['Contacts'][_0x3860('0x47')]){return _0x519a72['List'][_0x3860('0xa4')][0x0];}else{return db[_0x3860('0x73')]['create'](_['defaults'](_0x4c8a10[_0x3860('0x5b')],{'firstName':_0x4c8a10[_0x3860('0x5b')]['to'][0x0],'phone':_0x4c8a10[_0x3860('0x5b')]['to'][0x0],'fax':_0x4c8a10[_0x3860('0x5b')]['to'][0x0],'ListId':_0x519a72['ListId']}));}}else{throw new Error(_0x3860('0xb0'));}}else{throw new Error(_0x3860('0xb1'));}})[_0x3860('0x21')](function(_0x5ce5ee){if(_0x5ce5ee){return db[_0x3860('0x70')][_0x3860('0x58')]({'where':{'ContactId':_0x5ce5ee['id'],'closed':![],'FaxAccountId':_0x519a72['id']}})['then'](function(_0x1e199a){if(_0x1e199a){return[_0x1e199a,![]];}return db[_0x3860('0x70')][_0x3860('0x5a')]({'UserId':_0x4c8a10[_0x3860('0x5c')]['id'],'ContactId':_0x5ce5ee['id'],'FaxAccountId':_0x519a72['id'],'fax':_0x4c8a10[_0x3860('0x5b')]['to'][0x0],'firstMsgDirection':_0x3860('0xb2'),'Messages':[_[_0x3860('0x4e')](_0x4c8a10['body'],{'read':![],'body':_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][0x0][_0x3860('0xb3')],'FaxAccountId':_0x519a72['id'],'UserId':_0x4c8a10[_0x3860('0x5c')]['id'],'ContactId':_0x5ce5ee['id'],'AttachmentId':_0x4c8a10[_0x3860('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x3860('0x9e')],'as':_0x3860('0xb4')}]})[_0x3860('0x21')](function(_0x732d1e){return[_0x732d1e,!![]];});});}else{throw new Error(_0x3860('0xb5'));}})[_0x3860('0xb6')](function(_0x565858,_0x16457e){if(_0x16457e){return _0x565858;}return db[_0x3860('0x9e')][_0x3860('0x5a')]({'direction':_0x3860('0xb2'),'read':![],'body':_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][0x0][_0x3860('0xb3')],'FaxAccountId':_0x519a72['id'],'FaxInteractionId':_0x565858['id'],'UserId':_0x4c8a10[_0x3860('0x5c')]['id'],'ContactId':_0x565858['ContactId'],'AttachmentId':_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][0x0]['id']})[_0x3860('0x21')](function(_0x17212b){_0x565858[_0x3860('0xb7')][_0x3860('0xb4')]=[];_0x565858[_0x3860('0xb7')][_0x3860('0xb4')][_0x3860('0x87')](_0x17212b['dataValues']);return _0x565858;});})[_0x3860('0x21')](function(_0x2ca1b1){respondWithRpcPromise(_0x3860('0xb8'),_0x3860('0xb8'),{'FaxAccountId':_[_0x3860('0xac')](_0x4c8a10[_0x3860('0x55')]['id'])?undefined:_0x4c8a10[_0x3860('0x55')]['id'],'path':_[_0x3860('0xac')](_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][0x0][_0x3860('0x6')])?undefined:_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][0x0][_0x3860('0x6')],'fax':_[_0x3860('0xac')](_0x4c8a10['body']['to'][0x0])?undefined:_0x4c8a10[_0x3860('0x5b')]['to'][0x0],'AttachmentId':_0x4c8a10[_0x3860('0x5b')][_0x3860('0xa6')][0x0]['id']},client9002)[_0x3860('0x21')](function(_0x399f63){logger[_0x3860('0x22')](_0x3860('0xb9'),_0x399f63);})[_0x3860('0x59')](function(_0x46b4fc){logger[_0x3860('0x22')](_0x3860('0xb9'),_0x46b4fc);});return _0x2ca1b1;})[_0x3860('0x21')](respondWithResult(_0x534237,null))['catch'](handleError(_0x534237,null));};exports[_0x3860('0xba')]=function(_0x5c0531,_0x18f182,_0x5822f9){return db[_0x3860('0x51')]['find']({'where':{'id':_0x5c0531[_0x3860('0x55')]['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x18f182,null))['then'](function(_0x3334eb){if(_0x3334eb){return _0x3334eb[_0x3860('0xba')](_0x5c0531[_0x3860('0x5b')][_0x3860('0x69')],_[_0x3860('0x71')](_0x5c0531['body'],['ids','id'])||{})[_0x3860('0xb6')](function(_0x4309c5){for(var _0x1ecdef=0x0;_0x1ecdef<_0x5c0531[_0x3860('0x5b')][_0x3860('0x69')][_0x3860('0x47')];_0x1ecdef+=0x1){socket[_0x3860('0xbb')]('userFaxAccount:save',{'UserId':_0x5c0531[_0x3860('0x5b')]['ids'][_0x1ecdef],'FaxAccountId':_0x5c0531[_0x3860('0x55')]['id']});}return _0x4309c5;});}})[_0x3860('0x21')](respondWithResult(_0x18f182,null))[_0x3860('0x59')](handleError(_0x18f182,null));};exports[_0x3860('0xbc')]=function(_0x567675,_0x175541,_0x195359){return db['FaxAccount'][_0x3860('0x58')]({'where':{'id':_0x567675['params']['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x175541,null))[_0x3860('0x21')](function(_0x463b2a){if(_0x463b2a){return _0x463b2a[_0x3860('0xbc')](_0x567675[_0x3860('0x44')][_0x3860('0x69')])[_0x3860('0x21')](function(){if(_[_0x3860('0xbd')](_0x567675[_0x3860('0x44')]['ids'])){for(var _0x27a5a5=0x0;_0x27a5a5<_0x567675[_0x3860('0x44')][_0x3860('0x69')]['length'];_0x27a5a5+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x567675[_0x3860('0x44')][_0x3860('0x69')][_0x27a5a5]),'FaxAccountId':Number(_0x567675[_0x3860('0x55')]['id'])});}}else{socket[_0x3860('0xbb')](_0x3860('0xbe'),{'UserId':Number(_0x567675[_0x3860('0x44')][_0x3860('0x69')]),'FaxAccountId':Number(_0x567675['params']['id'])});}});}})[_0x3860('0x21')](respondWithStatusCode(_0x175541,null))[_0x3860('0x59')](handleError(_0x175541,null));};exports[_0x3860('0xbf')]=function(_0x2547c5,_0x5d89f0,_0xbc013a){var _0x5307fb={};var _0x591379={};var _0x41f833;var _0x245137;return db[_0x3860('0x51')][_0x3860('0x65')]({'where':{'id':_0x2547c5[_0x3860('0x55')]['id']}})[_0x3860('0x21')](handleEntityNotFound(_0x5d89f0,null))[_0x3860('0x21')](function(_0x1014ea){if(_0x1014ea){_0x41f833=_0x1014ea;_0x591379[_0x3860('0x40')]=_[_0x3860('0x41')](db[_0x3860('0x74')][_0x3860('0x3d')]);_0x591379['query']=_['keys'](_0x2547c5[_0x3860('0x44')]);_0x591379['filters']=_['intersection'](_0x591379[_0x3860('0x40')],_0x591379[_0x3860('0x44')]);_0x5307fb[_0x3860('0x45')]=_[_0x3860('0x43')](_0x591379[_0x3860('0x40')],qs[_0x3860('0x46')](_0x2547c5['query'][_0x3860('0x46')]));_0x5307fb[_0x3860('0x45')]=_0x5307fb['attributes'][_0x3860('0x47')]?_0x5307fb['attributes']:_0x591379['model'];_0x5307fb['order']=qs[_0x3860('0x4b')](_0x2547c5[_0x3860('0x44')][_0x3860('0x4b')]);_0x5307fb[_0x3860('0x4d')]=qs[_0x3860('0x42')](_[_0x3860('0x66')](_0x2547c5['query'],_0x591379[_0x3860('0x42')]));if(_0x2547c5[_0x3860('0x44')][_0x3860('0x4c')]){_0x5307fb['where']=_[_0x3860('0x4e')](_0x5307fb[_0x3860('0x4d')],{'$or':_[_0x3860('0x3c')](_0x5307fb['attributes'],function(_0x198422){var _0x5d2829={};_0x5d2829[_0x198422]={'$like':'%'+_0x2547c5[_0x3860('0x44')]['filter']+'%'};return _0x5d2829;})});}_0x5307fb=_[_0x3860('0x4e')]({},_0x5307fb,_0x2547c5[_0x3860('0x50')]);return _0x41f833[_0x3860('0xbf')](_0x5307fb);}})[_0x3860('0x21')](function(_0x4cc748){if(_0x4cc748){_0x245137=_0x4cc748[_0x3860('0x47')];if(!_0x2547c5['query'][_0x3860('0x6c')](_0x3860('0x48'))){_0x5307fb['limit']=qs[_0x3860('0x49')](_0x2547c5[_0x3860('0x44')]['limit']);_0x5307fb[_0x3860('0x2f')]=qs[_0x3860('0x2f')](_0x2547c5[_0x3860('0x44')][_0x3860('0x2f')]);}return _0x41f833[_0x3860('0xbf')](_0x5307fb);}})['then'](function(_0x5bbbd3){if(_0x5bbbd3){return _0x5bbbd3?{'count':_0x245137,'rows':_0x5bbbd3}:null;}})[_0x3860('0x21')](respondWithResult(_0x5d89f0,null))['catch'](handleError(_0x5d89f0,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index bec3a62..ef4544a 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 _0x4784=['save','update','remove','hasOwnProperty','hook','exports','events','FaxAccount','setMaxListeners'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x4784,0x9f));var _0x4478=function(_0x4b9f90,_0x961a33){_0x4b9f90=_0x4b9f90-0x0;var _0x4aeb41=_0x4784[_0x4b9f90];return _0x4aeb41;};'use strict';var EventEmitter=require(_0x4478('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0x4478('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x4478('0x2')](0x0);var events={'afterCreate':_0x4478('0x3'),'afterUpdate':_0x4478('0x4'),'afterDestroy':_0x4478('0x5')};function emitEvent(_0x259832){return function(_0xdd11f7,_0x9cf0b,_0x3cd855){FaxAccountEvents['emit'](_0x259832+':'+_0xdd11f7['id'],_0xdd11f7);FaxAccountEvents['emit'](_0x259832,_0xdd11f7);_0x3cd855(null);};}for(var e in events){if(events[_0x4478('0x6')](e)){var event=events[e];FaxAccount[_0x4478('0x7')](e,emitEvent(event));}}module[_0x4478('0x8')]=FaxAccountEvents; \ No newline at end of file +var _0x1e8f=['exports','events','FaxAccount','setMaxListeners','save','update','emit','hasOwnProperty','hook'];(function(_0x480e02,_0xfef8fb){var _0x2dd4a1=function(_0x50eb0a){while(--_0x50eb0a){_0x480e02['push'](_0x480e02['shift']());}};_0x2dd4a1(++_0xfef8fb);}(_0x1e8f,0x169));var _0xf1e8=function(_0x123fd2,_0x5d15aa){_0x123fd2=_0x123fd2-0x0;var _0x28bc06=_0x1e8f[_0x123fd2];return _0x28bc06;};'use strict';var EventEmitter=require(_0xf1e8('0x0'));var FaxAccount=require('../../mysqldb')['db'][_0xf1e8('0x1')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xf1e8('0x2')](0x0);var events={'afterCreate':_0xf1e8('0x3'),'afterUpdate':_0xf1e8('0x4'),'afterDestroy':'remove'};function emitEvent(_0x60c0c9){return function(_0x4d6bfb,_0x5b71da,_0x26d5b3){FaxAccountEvents[_0xf1e8('0x5')](_0x60c0c9+':'+_0x4d6bfb['id'],_0x4d6bfb);FaxAccountEvents['emit'](_0x60c0c9,_0x4d6bfb);_0x26d5b3(null);};}for(var e in events){if(events[_0xf1e8('0x6')](e)){var event=events[e];FaxAccount[_0xf1e8('0x7')](e,emitEvent(event));}}module[_0xf1e8('0x8')]=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index ab01a0e..81524f5 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 _0xf9bd=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts'];(function(_0x4d3d50,_0x50f156){var _0x175e6d=function(_0x41fc26){while(--_0x41fc26){_0x4d3d50['push'](_0x4d3d50['shift']());}};_0x175e6d(++_0x50f156);}(_0xf9bd,0xff));var _0xdf9b=function(_0x2b96f1,_0x218425){_0x2b96f1=_0x2b96f1-0x0;var _0x4f555b=_0xf9bd[_0x2b96f1];return _0x4f555b;};'use strict';var _=require(_0xdf9b('0x0'));var util=require(_0xdf9b('0x1'));var logger=require(_0xdf9b('0x2'))(_0xdf9b('0x3'));var moment=require(_0xdf9b('0x4'));var BPromise=require(_0xdf9b('0x5'));var rp=require(_0xdf9b('0x6'));var fs=require('fs');var path=require(_0xdf9b('0x7'));var rimraf=require(_0xdf9b('0x8'));var config=require(_0xdf9b('0x9'));var attributes=require(_0xdf9b('0xa'));module[_0xdf9b('0xb')]=function(_0x30533c,_0x19f6b9){return _0x30533c[_0xdf9b('0xc')](_0xdf9b('0xd'),attributes,{'tableName':_0xdf9b('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b7d=['rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x33a89d,_0xed52ed){var _0x175025=function(_0x27030f){while(--_0x27030f){_0x33a89d['push'](_0x33a89d['shift']());}};_0x175025(++_0xed52ed);}(_0x9b7d,0xf1));var _0xd9b7=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9b7d[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0xd9b7('0x0'));var util=require(_0xd9b7('0x1'));var logger=require(_0xd9b7('0x2'))(_0xd9b7('0x3'));var moment=require(_0xd9b7('0x4'));var BPromise=require(_0xd9b7('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd9b7('0x6'));var config=require(_0xd9b7('0x7'));var attributes=require(_0xd9b7('0x8'));module[_0xd9b7('0x9')]=function(_0x2b8b00,_0x578ab8){return _0x2b8b00[_0xd9b7('0xa')](_0xd9b7('0xb'),attributes,{'tableName':_0xd9b7('0xc'),'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 5ad3bd0..2112d0b 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 _0x99eb=['startRouting','lodash','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./faxAccount.socket','register','request','then','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','GetFaxAccount','findAll','raw','options','where','attributes','limit','include','model','map','body','fax','CmContact','describe','Sequelize','ValidationError','difference','keys','updatedAt','createdAt','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','FaxApplication','get','applications','Applications','list','orderBy','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','unmanaged','*,*,*,*','created','interaction','FaxMessage','AttachmentId','UserId','User','find','name','unshift','waitForTheAssignedAgent','Start'];(function(_0x420294,_0x3ce042){var _0x2856ea=function(_0x33a7cd){while(--_0x33a7cd){_0x420294['push'](_0x420294['shift']());}};_0x2856ea(++_0x3ce042);}(_0x99eb,0x1aa));var _0xb99e=function(_0x937157,_0x46df0c){_0x937157=_0x937157-0x0;var _0x9021d9=_0x99eb[_0x937157];return _0x9021d9;};'use strict';var _=require(_0xb99e('0x0'));var util=require('util');var moment=require(_0xb99e('0x1'));var BPromise=require(_0xb99e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb99e('0x3'));var logger=require(_0xb99e('0x4'))('rpc');var config=require(_0xb99e('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xb99e('0x6')][_0xb99e('0x7')]({'port':0x232c});config[_0xb99e('0x8')]=_[_0xb99e('0x9')](config[_0xb99e('0x8')],{'host':_0xb99e('0xa'),'port':0x18eb});var socket=require(_0xb99e('0xb'))(new Redis(config['redis']));require(_0xb99e('0xc'))[_0xb99e('0xd')](socket);function respondWithRpcPromise(_0x157c23,_0x201156,_0x507818){return new BPromise(function(_0x2e9e4f,_0x37ab60){return client[_0xb99e('0xe')](_0x157c23,_0x507818)[_0xb99e('0xf')](function(_0x4aa6e0){logger[_0xb99e('0x10')](_0xb99e('0x11'),_0x201156,'request\x20sent');logger[_0xb99e('0x12')](_0xb99e('0x13'),_0x201156,_0xb99e('0x14'),JSON[_0xb99e('0x15')](_0x4aa6e0));if(_0x4aa6e0[_0xb99e('0x16')]){if(_0x4aa6e0['error'][_0xb99e('0x17')]===0x1f4){logger[_0xb99e('0x16')](_0xb99e('0x11'),_0x201156,_0x4aa6e0[_0xb99e('0x16')][_0xb99e('0x18')]);return _0x37ab60(_0x4aa6e0['error'][_0xb99e('0x18')]);}logger[_0xb99e('0x16')](_0xb99e('0x11'),_0x201156,_0x4aa6e0[_0xb99e('0x16')]['message']);return _0x2e9e4f(_0x4aa6e0['error'][_0xb99e('0x18')]);}else{logger[_0xb99e('0x10')]('FaxAccount,\x20%s,\x20%s',_0x201156,_0xb99e('0x14'));_0x2e9e4f(_0x4aa6e0[_0xb99e('0x19')][_0xb99e('0x18')]);}})[_0xb99e('0x1a')](function(_0x17f262){logger[_0xb99e('0x16')](_0xb99e('0x11'),_0x201156,_0x17f262);_0x37ab60(_0x17f262);});});}exports[_0xb99e('0x1b')]=function(_0x13446e){var _0x297bd5=this;return new Promise(function(_0x1bf236,_0x10469b){return db['FaxAccount'][_0xb99e('0x1c')]({'raw':_0x13446e['options']?_0x13446e['options'][_0xb99e('0x1d')]===undefined?!![]:![]:!![],'where':_0x13446e[_0xb99e('0x1e')]?_0x13446e[_0xb99e('0x1e')][_0xb99e('0x1f')]||null:null,'attributes':_0x13446e[_0xb99e('0x1e')]?_0x13446e[_0xb99e('0x1e')][_0xb99e('0x20')]||null:null,'limit':_0x13446e[_0xb99e('0x1e')]?_0x13446e['options'][_0xb99e('0x21')]||null:null,'include':_0x13446e[_0xb99e('0x1e')]?_0x13446e[_0xb99e('0x1e')]['include']?_['map'](_0x13446e[_0xb99e('0x1e')][_0xb99e('0x22')],function(_0x4ffa37){return{'model':db[_0x4ffa37['model']],'as':_0x4ffa37['as'],'attributes':_0x4ffa37[_0xb99e('0x20')],'include':_0x4ffa37[_0xb99e('0x22')]?_['map'](_0x4ffa37['include'],function(_0x143a72){return{'model':db[_0x143a72[_0xb99e('0x23')]],'as':_0x143a72['as'],'attributes':_0x143a72[_0xb99e('0x20')],'include':_0x143a72[_0xb99e('0x22')]?_[_0xb99e('0x24')](_0x143a72[_0xb99e('0x22')],function(_0x20f1ce){return{'model':db[_0x20f1ce['model']],'as':_0x20f1ce['as'],'attributes':_0x20f1ce[_0xb99e('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x337fca){logger[_0xb99e('0x10')](_0xb99e('0x1b'),_0x13446e);logger['debug'](_0xb99e('0x1b'),_0x13446e,JSON[_0xb99e('0x15')](_0x337fca));_0x1bf236(_0x337fca);})[_0xb99e('0x1a')](function(_0xe4bbd6){logger['error'](_0xb99e('0x1b'),_0xe4bbd6[_0xb99e('0x18')],_0x13446e);_0x10469b(_0x297bd5[_0xb99e('0x16')](0x1f4,_0xe4bbd6[_0xb99e('0x18')]));});});};exports['NotifyFaxAccount']=function(_0x2c4a34,_0x7bc38c,_0x597cdc){var _0xed1a7f=this;return new Promise(function(_0x5a01c0,_0x205fc7){var _0x243fb8={'body':_0x2c4a34[_0xb99e('0x25')],'channel':_0xb99e('0x26')};var _0x4b8632=[];var _0x39041e=[];var _0x2a2e3b={};return db[_0xb99e('0x27')][_0xb99e('0x28')]()['then'](function(_0x104606){if(!_0x104606){throw new db[(_0xb99e('0x29'))][(_0xb99e('0x2a'))]('no\x20available\x20attributes');}_0x4b8632=_[_0xb99e('0x2b')](_[_0xb99e('0x2c')](_0x104606),['createdAt',_0xb99e('0x2d')]);_0x39041e=_[_0xb99e('0x2b')](_[_0xb99e('0x2c')](_0x104606),[_0xb99e('0x2e'),_0xb99e('0x2d'),'CompanyId','ListId']);if(_0x2c4a34[_0xb99e('0x25')]['id']){delete _0x2c4a34[_0xb99e('0x25')]['id'];}if(_[_0xb99e('0x2f')](_0x2c4a34[_0xb99e('0x25')][_0xb99e('0x30')])){throw new db[(_0xb99e('0x29'))][(_0xb99e('0x2a'))]('from\x20is\x20mandatory');}if(_[_0xb99e('0x2f')](_0x2c4a34[_0xb99e('0x25')][_0xb99e('0x25')])||_0x2c4a34['body']['body']===''){throw new db[(_0xb99e('0x29'))][(_0xb99e('0x2a'))](_0xb99e('0x31'));}if(_[_0xb99e('0x2f')](_0x2c4a34[_0xb99e('0x25')][_0xb99e('0x32')])){throw new db['Sequelize'][(_0xb99e('0x2a'))](_0xb99e('0x33')+_0x39041e);}if(!_['includes'](_0x39041e,_0x2c4a34['body'][_0xb99e('0x32')])){throw new db['Sequelize'][(_0xb99e('0x2a'))](_0xb99e('0x34')+_0x39041e);}_0x2a2e3b[_0x2c4a34[_0xb99e('0x25')][_0xb99e('0x32')]]=_0x2c4a34['body'][_0xb99e('0x30')];})[_0xb99e('0xf')](function(){return db['FaxAccount']['find']({'where':{'id':_0x2c4a34[_0xb99e('0x35')]['id']},'include':[{'model':db[_0xb99e('0x36')],'as':_0xb99e('0x37'),'include':[{'model':db['CmContact'],'as':_0xb99e('0x38'),'where':_0x2a2e3b,'limit':0x1,'order':[[_0xb99e('0x2d'),'DESC']]}]},{'model':db[_0xb99e('0x39')],'as':'Applications'}]});})['then'](function(_0x47116b){if(_0x47116b&&_0x47116b[_0xb99e('0x37')]){var _0x1ff583=_0x47116b[_0xb99e('0x3a')]({'plain':!![]});_0x243fb8['account']=_0x1ff583;_0x243fb8[_0xb99e('0x3b')]=_0x1ff583[_0xb99e('0x3c')];_0x243fb8[_0xb99e('0x3d')]=_0x1ff583[_0xb99e('0x37')];_0x243fb8[_0xb99e('0x3b')]=_[_0xb99e('0x3e')](_0x243fb8[_0xb99e('0x3b')],['priority'],[_0xb99e('0x3f')]);if(_0x243fb8[_0xb99e('0x35')]['Applications']){delete _0x243fb8[_0xb99e('0x35')][_0xb99e('0x3c')];}if(_0x243fb8[_0xb99e('0x35')]['List']&&_0x243fb8['account'][_0xb99e('0x37')][_0xb99e('0x38')][_0xb99e('0x40')]){return _0x243fb8[_0xb99e('0x35')][_0xb99e('0x37')][_0xb99e('0x38')][0x0];}var _0x461059=_['defaults'](_0x2c4a34[_0xb99e('0x25')],{'firstName':_0x2c4a34['body'][_0xb99e('0x30')],'ListId':_0x1ff583['ListId']});_0x461059[_0x2c4a34[_0xb99e('0x25')][_0xb99e('0x32')]]=_0x2c4a34[_0xb99e('0x25')][_0xb99e('0x30')];return db[_0xb99e('0x27')][_0xb99e('0x41')](_0x461059,{'fields':_0x4b8632,'raw':!![]});}})[_0xb99e('0xf')](function(_0x4e76f5){_0x243fb8[_0xb99e('0x42')]=_0x4e76f5;if(_0x4e76f5){var _0x356763={'ContactId':_0x4e76f5['id'],'FaxAccountId':_0x2c4a34[_0xb99e('0x35')]['id'],'fax':_0x4e76f5['fax']};return db[_0xb99e('0x43')]['find']({'where':{'ContactId':_0x4e76f5['id'],'closed':![],'FaxAccountId':_0x2c4a34['account']['id']}})[_0xb99e('0xf')](function(_0x81ea91){if(_0x81ea91){return[_0x81ea91,![]];}return db['FaxInteraction'][_0xb99e('0x41')](_0x356763)[_0xb99e('0xf')](function(_0x546e8e){return[_0x546e8e,!![]];});});}else{throw new Error(_0xb99e('0x44'));}})[_0xb99e('0x45')](function(_0x721cef,_0x4b486a){var _0x4b69ec=_0x721cef[_0xb99e('0x3a')]({'plain':!![]});if(_0x4b486a){if(_0x243fb8[_0xb99e('0x35')][_0xb99e('0x46')]){_0x243fb8['applications']['push']({'id':0x0,'priority':_0x243fb8['applications'][_0xb99e('0x40')]+0x1,'app':'close','appdata':_0xb99e('0x47'),'interval':_0xb99e('0x48')});}_0x4b69ec[_0xb99e('0x49')]=!![];}else{_0x4b69ec[_0xb99e('0x49')]=![];}_0x243fb8[_0xb99e('0x4a')]=_0x4b69ec;return db[_0xb99e('0x4b')][_0xb99e('0x41')]({'body':_0x2c4a34['body'][_0xb99e('0x25')],'FaxAccountId':_0x2c4a34[_0xb99e('0x35')]['id'],'FaxInteractionId':_0x721cef['id'],'direction':'in','ContactId':_0x721cef['ContactId'],'AttachmentId':_0x2c4a34[_0xb99e('0x25')][_0xb99e('0x4c')]});})[_0xb99e('0xf')](function(_0x48bbb3){_0x243fb8[_0xb99e('0x18')]=_0x48bbb3;if(_0x243fb8['interaction'][_0xb99e('0x4d')]){return db[_0xb99e('0x4e')][_0xb99e('0x4f')]({'attributes':['id',_0xb99e('0x50')],'where':{'id':_0x243fb8['interaction'][_0xb99e('0x4d')]}})[_0xb99e('0xf')](function(_0x34ddac){if(_0x34ddac){_0x243fb8[_0xb99e('0x3b')][_0xb99e('0x51')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x34ddac['name']+','+(_0x243fb8[_0xb99e('0x35')][_0xb99e('0x52')]||0xa),'interval':_0xb99e('0x48')});}return respondWithRpcPromise(_0xb99e('0x53'),_0xb99e('0x54'),_0x243fb8);});}return respondWithRpcPromise(_0xb99e('0x53'),'startRouting',_0x243fb8);})[_0xb99e('0xf')](function(_0xf52a90){_0x5a01c0(_0xf52a90);})[_0xb99e('0x1a')](function(_0x5a5259){_0x205fc7(_0xed1a7f['error'](0x1f4,_0x5a5259[_0xb99e('0x18')]));});});}; \ No newline at end of file +var _0x5870=['fax','CmContact','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','find','account','CmList','List','Contacts','DESC','FaxApplication','Applications','get','applications','list','orderBy','priority','length','create','contact','FaxInteraction','Contact\x20not\x20found','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','User','name','startRouting','Start','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','register','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','map','include','model','NotifyFaxAccount','body'];(function(_0x10778c,_0x461571){var _0x38d5f2=function(_0x3afba0){while(--_0x3afba0){_0x10778c['push'](_0x10778c['shift']());}};_0x38d5f2(++_0x461571);}(_0x5870,0x88));var _0x0587=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x5870[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0x0587('0x0'));var util=require(_0x0587('0x1'));var moment=require(_0x0587('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0587('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0587('0x4'));var logger=require(_0x0587('0x5'))(_0x0587('0x6'));var config=require(_0x0587('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0587('0x8')]({'port':0x232c});config[_0x0587('0x9')]=_[_0x0587('0xa')](config[_0x0587('0x9')],{'host':_0x0587('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0587('0x9')]));require('./faxAccount.socket')[_0x0587('0xc')](socket);function respondWithRpcPromise(_0x10d9f4,_0x10b397,_0x718d0){return new BPromise(function(_0x13122f,_0x354a0e){return client['request'](_0x10d9f4,_0x718d0)[_0x0587('0xd')](function(_0x3563f0){logger[_0x0587('0xe')](_0x0587('0xf'),_0x10b397,_0x0587('0x10'));logger[_0x0587('0x11')](_0x0587('0x12'),_0x10b397,'request\x20sent',JSON['stringify'](_0x3563f0));if(_0x3563f0[_0x0587('0x13')]){if(_0x3563f0[_0x0587('0x13')]['code']===0x1f4){logger[_0x0587('0x13')](_0x0587('0xf'),_0x10b397,_0x3563f0[_0x0587('0x13')]['message']);return _0x354a0e(_0x3563f0[_0x0587('0x13')]['message']);}logger[_0x0587('0x13')]('FaxAccount,\x20%s,\x20%s',_0x10b397,_0x3563f0[_0x0587('0x13')][_0x0587('0x14')]);return _0x13122f(_0x3563f0[_0x0587('0x13')][_0x0587('0x14')]);}else{logger[_0x0587('0xe')](_0x0587('0xf'),_0x10b397,_0x0587('0x10'));_0x13122f(_0x3563f0[_0x0587('0x15')]['message']);}})[_0x0587('0x16')](function(_0x11909e){logger['error'](_0x0587('0xf'),_0x10b397,_0x11909e);_0x354a0e(_0x11909e);});});}exports[_0x0587('0x17')]=function(_0x260ad4){var _0x21f409=this;return new Promise(function(_0x4dcb60,_0xcb0f0c){return db[_0x0587('0x18')][_0x0587('0x19')]({'raw':_0x260ad4[_0x0587('0x1a')]?_0x260ad4[_0x0587('0x1a')][_0x0587('0x1b')]===undefined?!![]:![]:!![],'where':_0x260ad4[_0x0587('0x1a')]?_0x260ad4[_0x0587('0x1a')][_0x0587('0x1c')]||null:null,'attributes':_0x260ad4['options']?_0x260ad4[_0x0587('0x1a')][_0x0587('0x1d')]||null:null,'limit':_0x260ad4[_0x0587('0x1a')]?_0x260ad4['options'][_0x0587('0x1e')]||null:null,'include':_0x260ad4['options']?_0x260ad4[_0x0587('0x1a')]['include']?_[_0x0587('0x1f')](_0x260ad4['options'][_0x0587('0x20')],function(_0x1dd6e7){return{'model':db[_0x1dd6e7[_0x0587('0x21')]],'as':_0x1dd6e7['as'],'attributes':_0x1dd6e7[_0x0587('0x1d')],'include':_0x1dd6e7['include']?_[_0x0587('0x1f')](_0x1dd6e7['include'],function(_0x886705){return{'model':db[_0x886705['model']],'as':_0x886705['as'],'attributes':_0x886705['attributes'],'include':_0x886705['include']?_['map'](_0x886705[_0x0587('0x20')],function(_0x346d21){return{'model':db[_0x346d21['model']],'as':_0x346d21['as'],'attributes':_0x346d21[_0x0587('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0587('0xd')](function(_0x585d7a){logger['info'](_0x0587('0x17'),_0x260ad4);logger['debug'](_0x0587('0x17'),_0x260ad4,JSON['stringify'](_0x585d7a));_0x4dcb60(_0x585d7a);})[_0x0587('0x16')](function(_0x323b9f){logger[_0x0587('0x13')](_0x0587('0x17'),_0x323b9f[_0x0587('0x14')],_0x260ad4);_0xcb0f0c(_0x21f409[_0x0587('0x13')](0x1f4,_0x323b9f['message']));});});};exports[_0x0587('0x22')]=function(_0x1d1c27,_0x4e554b,_0x18381a){var _0x52ddb5=this;return new Promise(function(_0x28b4bd,_0x558aa2){var _0x228cee={'body':_0x1d1c27[_0x0587('0x23')],'channel':_0x0587('0x24')};var _0xc2a6ba=[];var _0x2a514a=[];var _0x15f013={};return db[_0x0587('0x25')]['describe']()['then'](function(_0x1b9cec){if(!_0x1b9cec){throw new db[(_0x0587('0x26'))][(_0x0587('0x27'))](_0x0587('0x28'));}_0xc2a6ba=_[_0x0587('0x29')](_[_0x0587('0x2a')](_0x1b9cec),[_0x0587('0x2b'),_0x0587('0x2c')]);_0x2a514a=_['difference'](_[_0x0587('0x2a')](_0x1b9cec),[_0x0587('0x2b'),_0x0587('0x2c'),_0x0587('0x2d'),_0x0587('0x2e')]);if(_0x1d1c27[_0x0587('0x23')]['id']){delete _0x1d1c27[_0x0587('0x23')]['id'];}if(_[_0x0587('0x2f')](_0x1d1c27[_0x0587('0x23')][_0x0587('0x30')])){throw new db['Sequelize']['ValidationError'](_0x0587('0x31'));}if(_[_0x0587('0x2f')](_0x1d1c27[_0x0587('0x23')][_0x0587('0x23')])||_0x1d1c27[_0x0587('0x23')][_0x0587('0x23')]===''){throw new db['Sequelize']['ValidationError'](_0x0587('0x32'));}if(_[_0x0587('0x2f')](_0x1d1c27[_0x0587('0x23')]['mapKey'])){throw new db[(_0x0587('0x26'))][(_0x0587('0x27'))](_0x0587('0x33')+_0x2a514a);}if(!_[_0x0587('0x34')](_0x2a514a,_0x1d1c27[_0x0587('0x23')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x0587('0x35')+_0x2a514a);}_0x15f013[_0x1d1c27[_0x0587('0x23')][_0x0587('0x36')]]=_0x1d1c27[_0x0587('0x23')][_0x0587('0x30')];})['then'](function(){return db[_0x0587('0x18')][_0x0587('0x37')]({'where':{'id':_0x1d1c27[_0x0587('0x38')]['id']},'include':[{'model':db[_0x0587('0x39')],'as':_0x0587('0x3a'),'include':[{'model':db['CmContact'],'as':_0x0587('0x3b'),'where':_0x15f013,'limit':0x1,'order':[[_0x0587('0x2c'),_0x0587('0x3c')]]}]},{'model':db[_0x0587('0x3d')],'as':_0x0587('0x3e')}]});})[_0x0587('0xd')](function(_0x460165){if(_0x460165&&_0x460165[_0x0587('0x3a')]){var _0x335580=_0x460165[_0x0587('0x3f')]({'plain':!![]});_0x228cee[_0x0587('0x38')]=_0x335580;_0x228cee[_0x0587('0x40')]=_0x335580['Applications'];_0x228cee[_0x0587('0x41')]=_0x335580['List'];_0x228cee[_0x0587('0x40')]=_[_0x0587('0x42')](_0x228cee[_0x0587('0x40')],[_0x0587('0x43')],['asc']);if(_0x228cee[_0x0587('0x38')]['Applications']){delete _0x228cee[_0x0587('0x38')][_0x0587('0x3e')];}if(_0x228cee['account'][_0x0587('0x3a')]&&_0x228cee[_0x0587('0x38')]['List'][_0x0587('0x3b')][_0x0587('0x44')]){return _0x228cee[_0x0587('0x38')][_0x0587('0x3a')][_0x0587('0x3b')][0x0];}var _0x79ca7=_[_0x0587('0xa')](_0x1d1c27[_0x0587('0x23')],{'firstName':_0x1d1c27['body']['from'],'ListId':_0x335580[_0x0587('0x2e')]});_0x79ca7[_0x1d1c27[_0x0587('0x23')][_0x0587('0x36')]]=_0x1d1c27[_0x0587('0x23')][_0x0587('0x30')];return db[_0x0587('0x25')][_0x0587('0x45')](_0x79ca7,{'fields':_0xc2a6ba,'raw':!![]});}})[_0x0587('0xd')](function(_0x31b4cb){_0x228cee[_0x0587('0x46')]=_0x31b4cb;if(_0x31b4cb){var _0x2fee10={'ContactId':_0x31b4cb['id'],'FaxAccountId':_0x1d1c27[_0x0587('0x38')]['id'],'fax':_0x31b4cb[_0x0587('0x24')]};return db[_0x0587('0x47')][_0x0587('0x37')]({'where':{'ContactId':_0x31b4cb['id'],'closed':![],'FaxAccountId':_0x1d1c27[_0x0587('0x38')]['id']}})[_0x0587('0xd')](function(_0x4f229b){if(_0x4f229b){return[_0x4f229b,![]];}return db[_0x0587('0x47')][_0x0587('0x45')](_0x2fee10)['then'](function(_0x3f8999){return[_0x3f8999,!![]];});});}else{throw new Error(_0x0587('0x48'));}})['spread'](function(_0x47d43e,_0x1c6d0d){var _0x45898d=_0x47d43e[_0x0587('0x3f')]({'plain':!![]});if(_0x1c6d0d){if(_0x228cee[_0x0587('0x38')]['autoclose']){_0x228cee['applications']['push']({'id':0x0,'priority':_0x228cee[_0x0587('0x40')][_0x0587('0x44')]+0x1,'app':_0x0587('0x49'),'appdata':_0x0587('0x4a'),'interval':_0x0587('0x4b')});}_0x45898d[_0x0587('0x4c')]=!![];}else{_0x45898d[_0x0587('0x4c')]=![];}_0x228cee[_0x0587('0x4d')]=_0x45898d;return db[_0x0587('0x4e')][_0x0587('0x45')]({'body':_0x1d1c27[_0x0587('0x23')][_0x0587('0x23')],'FaxAccountId':_0x1d1c27[_0x0587('0x38')]['id'],'FaxInteractionId':_0x47d43e['id'],'direction':'in','ContactId':_0x47d43e[_0x0587('0x4f')],'AttachmentId':_0x1d1c27['body'][_0x0587('0x50')]});})[_0x0587('0xd')](function(_0x2b7da1){_0x228cee[_0x0587('0x14')]=_0x2b7da1;if(_0x228cee['interaction'][_0x0587('0x51')]){return db[_0x0587('0x52')][_0x0587('0x37')]({'attributes':['id',_0x0587('0x53')],'where':{'id':_0x228cee[_0x0587('0x4d')][_0x0587('0x51')]}})['then'](function(_0x58b7f9){if(_0x58b7f9){_0x228cee[_0x0587('0x40')]['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x58b7f9[_0x0587('0x53')]+','+(_0x228cee['account']['waitForTheAssignedAgent']||0xa),'interval':_0x0587('0x4b')});}return respondWithRpcPromise('Start',_0x0587('0x54'),_0x228cee);});}return respondWithRpcPromise(_0x0587('0x55'),_0x0587('0x54'),_0x228cee);})[_0x0587('0xd')](function(_0x57e6cb){_0x28b4bd(_0x57e6cb);})[_0x0587('0x16')](function(_0x52dce7){_0x558aa2(_0x52ddb5[_0x0587('0x13')](0x1f4,_0x52dce7[_0x0587('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index f6b772f..cf2bf46 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 _0xf2e3=['faxAccount:','./faxAccount.events','remove','update','emit','removeListener','length'];(function(_0x90c434,_0x42072a){var _0x10e99a=function(_0x5f39ca){while(--_0x5f39ca){_0x90c434['push'](_0x90c434['shift']());}};_0x10e99a(++_0x42072a);}(_0xf2e3,0x9b));var _0x3f2e=function(_0x22b68a,_0x2bffc3){_0x22b68a=_0x22b68a-0x0;var _0x1ac67a=_0xf2e3[_0x22b68a];return _0x1ac67a;};'use strict';var FaxAccountEvents=require(_0x3f2e('0x0'));var events=['save',_0x3f2e('0x1'),_0x3f2e('0x2')];function createListener(_0x3fba4b,_0x30f1bb){return function(_0x27d28c){_0x30f1bb[_0x3f2e('0x3')](_0x3fba4b,_0x27d28c);};}function removeListener(_0x3938e2,_0xabcf5c){return function(){FaxAccountEvents[_0x3f2e('0x4')](_0x3938e2,_0xabcf5c);};}exports['register']=function(_0x33a3b7){for(var _0xdd6b3e=0x0,_0x3c0864=events[_0x3f2e('0x5')];_0xdd6b3e<_0x3c0864;_0xdd6b3e++){var _0x12c6e7=events[_0xdd6b3e];var _0x11067d=createListener(_0x3f2e('0x6')+_0x12c6e7,_0x33a3b7);FaxAccountEvents['on'](_0x12c6e7,_0x11067d);}}; \ No newline at end of file +var _0x4975=['length','./faxAccount.events','remove','update','emit','removeListener','register'];(function(_0x15738d,_0x5a0321){var _0x2789e5=function(_0x259bdb){while(--_0x259bdb){_0x15738d['push'](_0x15738d['shift']());}};_0x2789e5(++_0x5a0321);}(_0x4975,0x86));var _0x5497=function(_0x22b23b,_0xd35726){_0x22b23b=_0x22b23b-0x0;var _0x108a1a=_0x4975[_0x22b23b];return _0x108a1a;};'use strict';var FaxAccountEvents=require(_0x5497('0x0'));var events=['save',_0x5497('0x1'),_0x5497('0x2')];function createListener(_0xfc7927,_0x349f5f){return function(_0x135f6f){_0x349f5f[_0x5497('0x3')](_0xfc7927,_0x135f6f);};}function removeListener(_0x14cecb,_0xeb31af){return function(){FaxAccountEvents[_0x5497('0x4')](_0x14cecb,_0xeb31af);};}exports[_0x5497('0x5')]=function(_0x539a27){for(var _0x37e48d=0x0,_0x4f563d=events[_0x5497('0x6')];_0x37e48d<_0x4f563d;_0x37e48d++){var _0x674a2a=events[_0x37e48d];var _0x368e8b=createListener('faxAccount:'+_0x674a2a,_0x539a27);FaxAccountEvents['on'](_0x674a2a,_0x368e8b);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 0d86df2..4e76066 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 _0x33a1=['../../config/environment','isAuthenticated','index','get','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getMessages','getAgents','post','create','addAnswer','/:id/interactions','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','/:id/users','/:id','delete','destroy','/:id/dispositions','removeAgents','exports','multer','connect-timeout','../../components/auth/service'];(function(_0x7c8210,_0xf08ee5){var _0x59e3ff=function(_0x1fb2ad){while(--_0x1fb2ad){_0x7c8210['push'](_0x7c8210['shift']());}};_0x59e3ff(++_0xf08ee5);}(_0x33a1,0xdd));var _0x133a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x33a1[_0x502c7d];return _0x30b7ed;};'use strict';var multer=require(_0x133a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x133a('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x133a('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0x133a('0x3'));var controller=require('./faxAccount.controller');router['get']('/',auth[_0x133a('0x4')](),controller[_0x133a('0x5')]);router['get']('/describe',auth[_0x133a('0x4')](),controller['describe']);router[_0x133a('0x6')]('/:id',auth[_0x133a('0x4')](),controller['show']);router[_0x133a('0x6')]('/:id/dispositions',auth[_0x133a('0x4')](),controller[_0x133a('0x7')]);router[_0x133a('0x6')](_0x133a('0x8'),auth['isAuthenticated'](),controller[_0x133a('0x9')]);router[_0x133a('0x6')]('/:id/interactions',auth[_0x133a('0x4')](),controller['getInteractions']);router[_0x133a('0x6')](_0x133a('0xa'),auth[_0x133a('0x4')](),controller[_0x133a('0xb')]);router[_0x133a('0x6')]('/:id/messages',auth[_0x133a('0x4')](),controller[_0x133a('0xc')]);router[_0x133a('0x6')]('/:id/users',auth['isAuthenticated'](),controller[_0x133a('0xd')]);router[_0x133a('0xe')]('/',auth['isAuthenticated'](),controller[_0x133a('0xf')]);router['post']('/:id/dispositions',auth[_0x133a('0x4')](),controller['addDisposition']);router[_0x133a('0xe')](_0x133a('0x8'),auth[_0x133a('0x4')](),controller[_0x133a('0x10')]);router['post'](_0x133a('0x11'),auth[_0x133a('0x4')](),controller[_0x133a('0x12')]);router[_0x133a('0xe')]('/:id/applications',auth[_0x133a('0x4')](),controller[_0x133a('0x13')]);router[_0x133a('0xe')](_0x133a('0x14'),auth[_0x133a('0x4')](),controller[_0x133a('0x15')]);router[_0x133a('0xe')](_0x133a('0x16'),auth['isAuthenticated'](),controller[_0x133a('0x17')]);router[_0x133a('0xe')](_0x133a('0x18'),auth[_0x133a('0x4')](),controller['send']);router[_0x133a('0xe')](_0x133a('0x19'),auth[_0x133a('0x4')](),controller['addAgents']);router['put'](_0x133a('0x1a'),auth[_0x133a('0x4')](),controller['update']);router[_0x133a('0x1b')](_0x133a('0x1a'),auth[_0x133a('0x4')](),controller[_0x133a('0x1c')]);router[_0x133a('0x1b')](_0x133a('0x1d'),auth[_0x133a('0x4')](),controller['removeDispositions']);router[_0x133a('0x1b')](_0x133a('0x8'),auth[_0x133a('0x4')](),controller['removeAnswers']);router[_0x133a('0x1b')](_0x133a('0x19'),auth[_0x133a('0x4')](),controller[_0x133a('0x1e')]);module[_0x133a('0x1f')]=router; \ No newline at end of file +var _0x328f=['/:id/interactions','/:id/applications','getApplications','/:id/messages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addInteraction','addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','/:id/send','addAgents','update','destroy','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./faxAccount.controller','get','isAuthenticated','/describe','/:id','/:id/dispositions','/:id/canned_answers'];(function(_0x13ed0b,_0x20dc70){var _0x59d52d=function(_0xb23116){while(--_0xb23116){_0x13ed0b['push'](_0x13ed0b['shift']());}};_0x59d52d(++_0x20dc70);}(_0x328f,0x17e));var _0xf328=function(_0xaa1b3e,_0x47d976){_0xaa1b3e=_0xaa1b3e-0x0;var _0x454d7d=_0x328f[_0xaa1b3e];return _0x454d7d;};'use strict';var multer=require(_0xf328('0x0'));var util=require(_0xf328('0x1'));var path=require(_0xf328('0x2'));var timeout=require(_0xf328('0x3'));var express=require(_0xf328('0x4'));var router=express[_0xf328('0x5')]();var auth=require(_0xf328('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf328('0x7'));router[_0xf328('0x8')]('/',auth[_0xf328('0x9')](),controller['index']);router[_0xf328('0x8')](_0xf328('0xa'),auth[_0xf328('0x9')](),controller['describe']);router[_0xf328('0x8')](_0xf328('0xb'),auth['isAuthenticated'](),controller['show']);router['get'](_0xf328('0xc'),auth['isAuthenticated'](),controller['getDispositions']);router['get'](_0xf328('0xd'),auth[_0xf328('0x9')](),controller['getAnswers']);router[_0xf328('0x8')](_0xf328('0xe'),auth[_0xf328('0x9')](),controller['getInteractions']);router['get'](_0xf328('0xf'),auth['isAuthenticated'](),controller[_0xf328('0x10')]);router['get'](_0xf328('0x11'),auth[_0xf328('0x9')](),controller['getMessages']);router[_0xf328('0x8')](_0xf328('0x12'),auth[_0xf328('0x9')](),controller[_0xf328('0x13')]);router[_0xf328('0x14')]('/',auth[_0xf328('0x9')](),controller[_0xf328('0x15')]);router[_0xf328('0x14')]('/:id/dispositions',auth[_0xf328('0x9')](),controller[_0xf328('0x16')]);router[_0xf328('0x14')]('/:id/canned_answers',auth[_0xf328('0x9')](),controller[_0xf328('0x17')]);router['post'](_0xf328('0xe'),auth[_0xf328('0x9')](),controller[_0xf328('0x18')]);router[_0xf328('0x14')](_0xf328('0xf'),auth[_0xf328('0x9')](),controller[_0xf328('0x19')]);router[_0xf328('0x14')](_0xf328('0x1a'),auth[_0xf328('0x9')](),controller[_0xf328('0x1b')]);router['post'](_0xf328('0x1c'),auth[_0xf328('0x9')](),controller['updateAccountApplications']);router[_0xf328('0x14')](_0xf328('0x1d'),auth[_0xf328('0x9')](),controller['send']);router['post'](_0xf328('0x12'),auth[_0xf328('0x9')](),controller[_0xf328('0x1e')]);router['put'](_0xf328('0xb'),auth[_0xf328('0x9')](),controller[_0xf328('0x1f')]);router['delete'](_0xf328('0xb'),auth['isAuthenticated'](),controller[_0xf328('0x20')]);router['delete'](_0xf328('0xc'),auth[_0xf328('0x9')](),controller[_0xf328('0x21')]);router['delete'](_0xf328('0xd'),auth['isAuthenticated'](),controller[_0xf328('0x22')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0xf328('0x23')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 7540ffc..bd96ed2 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 _0x2b47=['sequelize','INTEGER','STRING','noop','*,*,*,*'];(function(_0x762a87,_0x42a867){var _0xbc0e05=function(_0x437fe4){while(--_0x437fe4){_0x762a87['push'](_0x762a87['shift']());}};_0xbc0e05(++_0x42a867);}(_0x2b47,0x177));var _0x72b4=function(_0x58121a,_0x392cb1){_0x58121a=_0x58121a-0x0;var _0x116cde=_0x2b47[_0x58121a];return _0x116cde;};'use strict';var Sequelize=require(_0x72b4('0x0'));module['exports']={'priority':{'type':Sequelize[_0x72b4('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x72b4('0x2')],'allowNull':![],'defaultValue':_0x72b4('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x72b4('0x2')]},'interval':{'type':Sequelize[_0x72b4('0x2')],'defaultValue':_0x72b4('0x4')}}; \ No newline at end of file +var _0xf5c4=['INTEGER','STRING','noop','TEXT','sequelize','exports'];(function(_0x88d2f6,_0x5b1b48){var _0x41419a=function(_0x7c5c4f){while(--_0x7c5c4f){_0x88d2f6['push'](_0x88d2f6['shift']());}};_0x41419a(++_0x5b1b48);}(_0xf5c4,0x1ae));var _0x4f5c=function(_0x2a2424,_0x2c537b){_0x2a2424=_0x2a2424-0x0;var _0x3722a7=_0xf5c4[_0x2a2424];return _0x3722a7;};'use strict';var Sequelize=require(_0x4f5c('0x0'));module[_0x4f5c('0x1')]={'priority':{'type':Sequelize[_0x4f5c('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x4f5c('0x3')],'allowNull':![],'defaultValue':_0x4f5c('0x4')},'appdata':{'type':Sequelize[_0x4f5c('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x4f5c('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 07c3de7..51fea65 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 _0x9330=['../../config/license/hardware','../../config/logger','status','end','count','offset','set','Content-Range','json','apply','reject','update','then','sendStatus','stack','name','send','index','map','FaxApplication','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','destroy','html-pdf','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9330,0x14a));var _0x0933=function(_0x38cca4,_0x293c1b){_0x38cca4=_0x38cca4-0x0;var _0xc6edf1=_0x9330[_0x38cca4];return _0xc6edf1;};'use strict';var pdf=require(_0x0933('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0933('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0933('0x2'));var BPromise=require(_0x0933('0x3'));var Mustache=require(_0x0933('0x4'));var util=require(_0x0933('0x5'));var path=require(_0x0933('0x6'));var sox=require(_0x0933('0x7'));var csv=require(_0x0933('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x0933('0x9'));var squel=require(_0x0933('0xa'));var crypto=require(_0x0933('0xb'));var jsforce=require(_0x0933('0xc'));var deskjs=require(_0x0933('0xd'));var toCsv=require(_0x0933('0x8'));var querystring=require(_0x0933('0xe'));var Papa=require(_0x0933('0xf'));var Redis=require(_0x0933('0x10'));var authService=require(_0x0933('0x11'));var qs=require(_0x0933('0x12'));var as=require(_0x0933('0x13'));var hardwareService=require(_0x0933('0x14'));var logger=require(_0x0933('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ea2d3,_0x4b5927){_0x4b5927=_0x4b5927||0xcc;return function(_0x51cdc6){if(_0x51cdc6){return _0x2ea2d3['sendStatus'](_0x4b5927);}return _0x2ea2d3[_0x0933('0x16')](_0x4b5927)[_0x0933('0x17')]();};}function respondWithResult(_0x5b9fab,_0x2ec08f){_0x2ec08f=_0x2ec08f||0xc8;return function(_0x145954){if(_0x145954){return _0x5b9fab['status'](_0x2ec08f)['json'](_0x145954);}};}function respondWithFilteredResult(_0x1ab5f7,_0xb019db){return function(_0x52144e){if(_0x52144e){var _0x14b507=_0x52144e[_0x0933('0x18')],_0x15672a=_0xb019db[_0x0933('0x19')],_0x144e4c=_0xb019db['offset']+_0xb019db['limit'],_0x3485aa;if(_0x144e4c>=_0x14b507){_0x144e4c=_0x14b507;_0x3485aa=0xc8;}else{_0x3485aa=0xce;}_0x1ab5f7[_0x0933('0x16')](_0x3485aa);return _0x1ab5f7[_0x0933('0x1a')](_0x0933('0x1b'),_0x15672a+'-'+_0x144e4c+'/'+_0x14b507)[_0x0933('0x1c')](_0x52144e);}return null;};}function patchUpdates(_0x354863){return function(_0x999e3){try{jsonpatch[_0x0933('0x1d')](_0x999e3,_0x354863,!![]);}catch(_0x233f8f){return BPromise[_0x0933('0x1e')](_0x233f8f);}return _0x999e3['save']();};}function saveUpdates(_0x488996,_0x30f857){return function(_0x5a5eae){if(_0x5a5eae){return _0x5a5eae[_0x0933('0x1f')](_0x488996)[_0x0933('0x20')](function(_0x4899cc){return _0x4899cc;});}return null;};}function removeEntity(_0x1d7bf8,_0x28e7fe){return function(_0x427d39){if(_0x427d39){return _0x427d39['destroy']()[_0x0933('0x20')](function(){_0x1d7bf8[_0x0933('0x16')](0xcc)[_0x0933('0x17')]();});}};}function handleEntityNotFound(_0x59d08c,_0x4ff665){return function(_0x631379){if(!_0x631379){_0x59d08c[_0x0933('0x21')](0x194);}return _0x631379;};}function handleError(_0x3b1e89,_0x17d090){_0x17d090=_0x17d090||0x1f4;return function(_0x3fc29f){logger['error'](_0x3fc29f[_0x0933('0x22')]);if(_0x3fc29f[_0x0933('0x23')]){delete _0x3fc29f[_0x0933('0x23')];}_0x3b1e89[_0x0933('0x16')](_0x17d090)[_0x0933('0x24')](_0x3fc29f);};}exports[_0x0933('0x25')]=function(_0x54b9e4,_0x466480){var _0x1de5c6={},_0x21a04c={},_0x45cd29={'count':0x0,'rows':[]};var _0x4a5378=_[_0x0933('0x26')](db[_0x0933('0x27')]['rawAttributes'],function(_0x447310){return{'name':_0x447310[_0x0933('0x28')],'type':_0x447310[_0x0933('0x29')][_0x0933('0x2a')]};});_0x21a04c[_0x0933('0x2b')]=_[_0x0933('0x26')](_0x4a5378,'name');_0x21a04c[_0x0933('0x2c')]=_[_0x0933('0x2d')](_0x54b9e4[_0x0933('0x2c')]);_0x21a04c[_0x0933('0x2e')]=_[_0x0933('0x2f')](_0x21a04c['model'],_0x21a04c[_0x0933('0x2c')]);_0x1de5c6[_0x0933('0x30')]=_[_0x0933('0x2f')](_0x21a04c[_0x0933('0x2b')],qs['fields'](_0x54b9e4['query'][_0x0933('0x31')]));_0x1de5c6[_0x0933('0x30')]=_0x1de5c6[_0x0933('0x30')][_0x0933('0x32')]?_0x1de5c6[_0x0933('0x30')]:_0x21a04c['model'];if(!_0x54b9e4['query']['hasOwnProperty'](_0x0933('0x33'))){_0x1de5c6[_0x0933('0x34')]=qs['limit'](_0x54b9e4[_0x0933('0x2c')][_0x0933('0x34')]);_0x1de5c6[_0x0933('0x19')]=qs[_0x0933('0x19')](_0x54b9e4[_0x0933('0x2c')][_0x0933('0x19')]);}_0x1de5c6[_0x0933('0x35')]=qs[_0x0933('0x36')](_0x54b9e4['query']['sort']);_0x1de5c6['where']=qs['filters'](_[_0x0933('0x37')](_0x54b9e4[_0x0933('0x2c')],_0x21a04c[_0x0933('0x2e')]));if(_0x54b9e4[_0x0933('0x2c')][_0x0933('0x38')]){_0x1de5c6[_0x0933('0x39')]=_[_0x0933('0x3a')](_0x1de5c6[_0x0933('0x39')],{'$or':_[_0x0933('0x26')](_0x4a5378,function(_0x145680){if(_0x145680[_0x0933('0x29')]!=='VIRTUAL'){var _0x5b46db={};_0x5b46db[_0x145680[_0x0933('0x23')]]={'$like':'%'+_0x54b9e4[_0x0933('0x2c')][_0x0933('0x38')]+'%'};return _0x5b46db;}})});}_0x1de5c6=_[_0x0933('0x3a')]({},_0x1de5c6,_0x54b9e4[_0x0933('0x3b')]);var _0x182f6b={'where':_0x1de5c6[_0x0933('0x39')]};return db[_0x0933('0x27')]['count'](_0x182f6b)[_0x0933('0x20')](function(_0x5ecd22){_0x45cd29[_0x0933('0x18')]=_0x5ecd22;if(_0x54b9e4[_0x0933('0x2c')][_0x0933('0x3c')]){_0x1de5c6[_0x0933('0x3d')]=[{'all':!![]}];}return db[_0x0933('0x27')][_0x0933('0x3e')](_0x1de5c6);})[_0x0933('0x20')](function(_0x34266a){_0x45cd29['rows']=_0x34266a;return _0x45cd29;})[_0x0933('0x20')](respondWithFilteredResult(_0x466480,_0x1de5c6))[_0x0933('0x3f')](handleError(_0x466480,null));};exports[_0x0933('0x40')]=function(_0x32ce92,_0x4577b0){var _0x1e1b60={'raw':!![],'where':{'id':_0x32ce92['params']['id']}},_0xe7f5e5={};_0xe7f5e5[_0x0933('0x2b')]=_[_0x0933('0x2d')](db[_0x0933('0x27')]['rawAttributes']);_0xe7f5e5['query']=_[_0x0933('0x2d')](_0x32ce92[_0x0933('0x2c')]);_0xe7f5e5[_0x0933('0x2e')]=_['intersection'](_0xe7f5e5[_0x0933('0x2b')],_0xe7f5e5[_0x0933('0x2c')]);_0x1e1b60[_0x0933('0x30')]=_[_0x0933('0x2f')](_0xe7f5e5[_0x0933('0x2b')],qs[_0x0933('0x31')](_0x32ce92['query']['fields']));_0x1e1b60[_0x0933('0x30')]=_0x1e1b60[_0x0933('0x30')]['length']?_0x1e1b60['attributes']:_0xe7f5e5[_0x0933('0x2b')];if(_0x32ce92[_0x0933('0x2c')][_0x0933('0x3c')]){_0x1e1b60[_0x0933('0x3d')]=[{'all':!![]}];}_0x1e1b60=_[_0x0933('0x3a')]({},_0x1e1b60,_0x32ce92[_0x0933('0x3b')]);return db[_0x0933('0x27')][_0x0933('0x41')](_0x1e1b60)[_0x0933('0x20')](handleEntityNotFound(_0x4577b0,null))[_0x0933('0x20')](respondWithResult(_0x4577b0,null))['catch'](handleError(_0x4577b0,null));};exports[_0x0933('0x42')]=function(_0x1848c3,_0x54843f){return db['FaxApplication'][_0x0933('0x42')](_0x1848c3[_0x0933('0x43')],{})[_0x0933('0x20')](respondWithResult(_0x54843f,0xc9))[_0x0933('0x3f')](handleError(_0x54843f,null));};exports[_0x0933('0x1f')]=function(_0x8fbf5d,_0xb03d1a){if(_0x8fbf5d[_0x0933('0x43')]['id']){delete _0x8fbf5d['body']['id'];}return db['FaxApplication']['find']({'where':{'id':_0x8fbf5d[_0x0933('0x44')]['id']}})['then'](handleEntityNotFound(_0xb03d1a,null))[_0x0933('0x20')](saveUpdates(_0x8fbf5d[_0x0933('0x43')],null))['then'](respondWithResult(_0xb03d1a,null))[_0x0933('0x3f')](handleError(_0xb03d1a,null));};exports[_0x0933('0x45')]=function(_0x579bcb,_0x28f9c6){return db[_0x0933('0x27')][_0x0933('0x41')]({'where':{'id':_0x579bcb[_0x0933('0x44')]['id']}})[_0x0933('0x20')](handleEntityNotFound(_0x28f9c6,null))[_0x0933('0x20')](removeEntity(_0x28f9c6,null))[_0x0933('0x3f')](handleError(_0x28f9c6,null));}; \ No newline at end of file +var _0x5243=['offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','name','index','map','FaxApplication','rawAttributes','type','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','params','keys','find','create','body','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','count'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5243,0x71));var _0x3524=function(_0x2c082b,_0x50c394){_0x2c082b=_0x2c082b-0x0;var _0x169299=_0x5243[_0x2c082b];return _0x169299;};'use strict';var pdf=require(_0x3524('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3524('0x1'));var jsonpatch=require(_0x3524('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3524('0x3'));var Mustache=require(_0x3524('0x4'));var util=require('util');var path=require(_0x3524('0x5'));var sox=require('sox');var csv=require(_0x3524('0x6'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3524('0x7'));var squel=require(_0x3524('0x8'));var crypto=require(_0x3524('0x9'));var jsforce=require(_0x3524('0xa'));var deskjs=require(_0x3524('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3524('0xc'));var Redis=require(_0x3524('0xd'));var authService=require(_0x3524('0xe'));var qs=require(_0x3524('0xf'));var as=require(_0x3524('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3524('0x11'))(_0x3524('0x12'));var utils=require('../../config/utils');var config=require(_0x3524('0x13'));var db=require(_0x3524('0x14'))['db'];function respondWithStatusCode(_0x17668d,_0x5d5a60){_0x5d5a60=_0x5d5a60||0xcc;return function(_0x4f49da){if(_0x4f49da){return _0x17668d['sendStatus'](_0x5d5a60);}return _0x17668d['status'](_0x5d5a60)[_0x3524('0x15')]();};}function respondWithResult(_0x3cb575,_0x58cd29){_0x58cd29=_0x58cd29||0xc8;return function(_0x3aa2da){if(_0x3aa2da){return _0x3cb575[_0x3524('0x16')](_0x58cd29)[_0x3524('0x17')](_0x3aa2da);}};}function respondWithFilteredResult(_0x21c43e,_0xe5df67){return function(_0x235cfd){if(_0x235cfd){var _0x34d9a0=_0x235cfd[_0x3524('0x18')],_0x8440a4=_0xe5df67['offset'],_0x299449=_0xe5df67[_0x3524('0x19')]+_0xe5df67[_0x3524('0x1a')],_0x565fec;if(_0x299449>=_0x34d9a0){_0x299449=_0x34d9a0;_0x565fec=0xc8;}else{_0x565fec=0xce;}_0x21c43e[_0x3524('0x16')](_0x565fec);return _0x21c43e[_0x3524('0x1b')](_0x3524('0x1c'),_0x8440a4+'-'+_0x299449+'/'+_0x34d9a0)[_0x3524('0x17')](_0x235cfd);}return null;};}function patchUpdates(_0x50906b){return function(_0x4a57f7){try{jsonpatch[_0x3524('0x1d')](_0x4a57f7,_0x50906b,!![]);}catch(_0x5bd3f5){return BPromise[_0x3524('0x1e')](_0x5bd3f5);}return _0x4a57f7[_0x3524('0x1f')]();};}function saveUpdates(_0x29d0fc,_0xd285a3){return function(_0x1d25f8){if(_0x1d25f8){return _0x1d25f8[_0x3524('0x20')](_0x29d0fc)['then'](function(_0x3a8fff){return _0x3a8fff;});}return null;};}function removeEntity(_0x958cf6,_0x1ab2c5){return function(_0xf1b3b1){if(_0xf1b3b1){return _0xf1b3b1[_0x3524('0x21')]()['then'](function(){_0x958cf6[_0x3524('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2eb72f,_0x26c20e){return function(_0x101e9a){if(!_0x101e9a){_0x2eb72f['sendStatus'](0x194);}return _0x101e9a;};}function handleError(_0x3dadcd,_0xc17f61){_0xc17f61=_0xc17f61||0x1f4;return function(_0x337554){logger[_0x3524('0x22')](_0x337554['stack']);if(_0x337554[_0x3524('0x23')]){delete _0x337554[_0x3524('0x23')];}_0x3dadcd[_0x3524('0x16')](_0xc17f61)['send'](_0x337554);};}exports[_0x3524('0x24')]=function(_0x398e6a,_0x529f2e){var _0x143fbe={},_0x3001ea={},_0x564bf6={'count':0x0,'rows':[]};var _0x59e2f6=_[_0x3524('0x25')](db[_0x3524('0x26')][_0x3524('0x27')],function(_0x651f11){return{'name':_0x651f11['fieldName'],'type':_0x651f11[_0x3524('0x28')]['key']};});_0x3001ea[_0x3524('0x29')]=_[_0x3524('0x25')](_0x59e2f6,_0x3524('0x23'));_0x3001ea['query']=_['keys'](_0x398e6a[_0x3524('0x2a')]);_0x3001ea[_0x3524('0x2b')]=_['intersection'](_0x3001ea[_0x3524('0x29')],_0x3001ea[_0x3524('0x2a')]);_0x143fbe[_0x3524('0x2c')]=_[_0x3524('0x2d')](_0x3001ea[_0x3524('0x29')],qs['fields'](_0x398e6a[_0x3524('0x2a')][_0x3524('0x2e')]));_0x143fbe[_0x3524('0x2c')]=_0x143fbe['attributes'][_0x3524('0x2f')]?_0x143fbe[_0x3524('0x2c')]:_0x3001ea[_0x3524('0x29')];if(!_0x398e6a[_0x3524('0x2a')][_0x3524('0x30')](_0x3524('0x31'))){_0x143fbe[_0x3524('0x1a')]=qs[_0x3524('0x1a')](_0x398e6a[_0x3524('0x2a')][_0x3524('0x1a')]);_0x143fbe[_0x3524('0x19')]=qs['offset'](_0x398e6a['query']['offset']);}_0x143fbe[_0x3524('0x32')]=qs['sort'](_0x398e6a[_0x3524('0x2a')][_0x3524('0x33')]);_0x143fbe[_0x3524('0x34')]=qs['filters'](_[_0x3524('0x35')](_0x398e6a['query'],_0x3001ea[_0x3524('0x2b')]));if(_0x398e6a[_0x3524('0x2a')][_0x3524('0x36')]){_0x143fbe[_0x3524('0x34')]=_[_0x3524('0x37')](_0x143fbe['where'],{'$or':_[_0x3524('0x25')](_0x59e2f6,function(_0x1d263f){if(_0x1d263f[_0x3524('0x28')]!==_0x3524('0x38')){var _0x4aa62d={};_0x4aa62d[_0x1d263f[_0x3524('0x23')]]={'$like':'%'+_0x398e6a[_0x3524('0x2a')][_0x3524('0x36')]+'%'};return _0x4aa62d;}})});}_0x143fbe=_[_0x3524('0x37')]({},_0x143fbe,_0x398e6a[_0x3524('0x39')]);var _0x4c4166={'where':_0x143fbe['where']};return db[_0x3524('0x26')][_0x3524('0x18')](_0x4c4166)[_0x3524('0x3a')](function(_0x5be8a0){_0x564bf6[_0x3524('0x18')]=_0x5be8a0;if(_0x398e6a[_0x3524('0x2a')][_0x3524('0x3b')]){_0x143fbe[_0x3524('0x3c')]=[{'all':!![]}];}return db['FaxApplication'][_0x3524('0x3d')](_0x143fbe);})[_0x3524('0x3a')](function(_0x440538){_0x564bf6[_0x3524('0x3e')]=_0x440538;return _0x564bf6;})[_0x3524('0x3a')](respondWithFilteredResult(_0x529f2e,_0x143fbe))[_0x3524('0x3f')](handleError(_0x529f2e,null));};exports['show']=function(_0x4f4be4,_0x514efc){var _0x298940={'raw':!![],'where':{'id':_0x4f4be4[_0x3524('0x40')]['id']}},_0x2d7330={};_0x2d7330[_0x3524('0x29')]=_[_0x3524('0x41')](db['FaxApplication'][_0x3524('0x27')]);_0x2d7330[_0x3524('0x2a')]=_[_0x3524('0x41')](_0x4f4be4[_0x3524('0x2a')]);_0x2d7330[_0x3524('0x2b')]=_[_0x3524('0x2d')](_0x2d7330[_0x3524('0x29')],_0x2d7330[_0x3524('0x2a')]);_0x298940['attributes']=_['intersection'](_0x2d7330[_0x3524('0x29')],qs[_0x3524('0x2e')](_0x4f4be4['query'][_0x3524('0x2e')]));_0x298940['attributes']=_0x298940[_0x3524('0x2c')][_0x3524('0x2f')]?_0x298940[_0x3524('0x2c')]:_0x2d7330[_0x3524('0x29')];if(_0x4f4be4[_0x3524('0x2a')][_0x3524('0x3b')]){_0x298940[_0x3524('0x3c')]=[{'all':!![]}];}_0x298940=_[_0x3524('0x37')]({},_0x298940,_0x4f4be4[_0x3524('0x39')]);return db['FaxApplication'][_0x3524('0x42')](_0x298940)[_0x3524('0x3a')](handleEntityNotFound(_0x514efc,null))[_0x3524('0x3a')](respondWithResult(_0x514efc,null))['catch'](handleError(_0x514efc,null));};exports[_0x3524('0x43')]=function(_0x4a076f,_0xd5ae2c){return db[_0x3524('0x26')][_0x3524('0x43')](_0x4a076f[_0x3524('0x44')],{})[_0x3524('0x3a')](respondWithResult(_0xd5ae2c,0xc9))[_0x3524('0x3f')](handleError(_0xd5ae2c,null));};exports[_0x3524('0x20')]=function(_0x331f6f,_0x31390e){if(_0x331f6f[_0x3524('0x44')]['id']){delete _0x331f6f[_0x3524('0x44')]['id'];}return db['FaxApplication']['find']({'where':{'id':_0x331f6f[_0x3524('0x40')]['id']}})[_0x3524('0x3a')](handleEntityNotFound(_0x31390e,null))[_0x3524('0x3a')](saveUpdates(_0x331f6f[_0x3524('0x44')],null))[_0x3524('0x3a')](respondWithResult(_0x31390e,null))[_0x3524('0x3f')](handleError(_0x31390e,null));};exports[_0x3524('0x21')]=function(_0x3e67e5,_0x6264b0){return db[_0x3524('0x26')]['find']({'where':{'id':_0x3e67e5[_0x3524('0x40')]['id']}})[_0x3524('0x3a')](handleEntityNotFound(_0x6264b0,null))[_0x3524('0x3a')](removeEntity(_0x6264b0,null))[_0x3524('0x3f')](handleError(_0x6264b0,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index aa8da89..879746a 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 _0xecde=['api','request-promise','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4','lodash','util','../../config/logger'];(function(_0x4f4335,_0x2d2799){var _0x2df2c7=function(_0x486bbb){while(--_0x486bbb){_0x4f4335['push'](_0x4f4335['shift']());}};_0x2df2c7(++_0x2d2799);}(_0xecde,0x159));var _0xeecd=function(_0x220744,_0x234bb2){_0x220744=_0x220744-0x0;var _0x9f2636=_0xecde[_0x220744];return _0x9f2636;};'use strict';var _=require(_0xeecd('0x0'));var util=require(_0xeecd('0x1'));var logger=require(_0xeecd('0x2'))(_0xeecd('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeecd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeecd('0x5'));var config=require(_0xeecd('0x6'));var attributes=require(_0xeecd('0x7'));module[_0xeecd('0x8')]=function(_0x4b6414,_0x190893){return _0x4b6414['define'](_0xeecd('0x9'),attributes,{'tableName':_0xeecd('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xeecd('0xb'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x3a3b=['moment','bluebird','request-promise','path','../../config/environment','./faxApplication.attributes','define','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x4d6c72,_0xed4f4b){var _0x39ae97=function(_0x354acc){while(--_0x354acc){_0x4d6c72['push'](_0x4d6c72['shift']());}};_0x39ae97(++_0xed4f4b);}(_0x3a3b,0xc0));var _0xb3a3=function(_0x1f6e18,_0x27cf4e){_0x1f6e18=_0x1f6e18-0x0;var _0x4d34c4=_0x3a3b[_0x1f6e18];return _0x4d34c4;};'use strict';var _=require(_0xb3a3('0x0'));var util=require(_0xb3a3('0x1'));var logger=require(_0xb3a3('0x2'))(_0xb3a3('0x3'));var moment=require(_0xb3a3('0x4'));var BPromise=require(_0xb3a3('0x5'));var rp=require(_0xb3a3('0x6'));var fs=require('fs');var path=require(_0xb3a3('0x7'));var rimraf=require('rimraf');var config=require(_0xb3a3('0x8'));var attributes=require(_0xb3a3('0x9'));module['exports']=function(_0x57753d,_0x40a847){return _0x57753d[_0xb3a3('0xa')]('FaxApplication',attributes,{'tableName':_0xb3a3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb3a3('0xc'),'collate':_0xb3a3('0xd')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 28730ad..0208aa2 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 _0xb452=['then','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','FaxApplication','update','body','options','raw','where','attributes','info','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x5290dd,_0x201ea3){var _0xc0eb43=function(_0x576673){while(--_0x576673){_0x5290dd['push'](_0x5290dd['shift']());}};_0xc0eb43(++_0x201ea3);}(_0xb452,0x19a));var _0x2b45=function(_0x163f58,_0x1c8ae4){_0x163f58=_0x163f58-0x0;var _0x472ed9=_0xb452[_0x163f58];return _0x472ed9;};'use strict';var _=require('lodash');var util=require(_0x2b45('0x0'));var moment=require(_0x2b45('0x1'));var BPromise=require(_0x2b45('0x2'));var rs=require(_0x2b45('0x3'));var fs=require('fs');var Redis=require(_0x2b45('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2b45('0x5'))(_0x2b45('0x6'));var config=require(_0x2b45('0x7'));var jayson=require(_0x2b45('0x8'));var client=jayson[_0x2b45('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33557b,_0x444587,_0x455f7c){return new BPromise(function(_0x4a4456,_0x48c6b3){return client['request'](_0x33557b,_0x455f7c)[_0x2b45('0xa')](function(_0x495f71){logger['info'](_0x2b45('0xb'),_0x444587,'request\x20sent');logger[_0x2b45('0xc')](_0x2b45('0xd'),_0x444587,_0x2b45('0xe'),JSON[_0x2b45('0xf')](_0x495f71));if(_0x495f71[_0x2b45('0x10')]){if(_0x495f71[_0x2b45('0x10')][_0x2b45('0x11')]===0x1f4){logger['error'](_0x2b45('0xb'),_0x444587,_0x495f71[_0x2b45('0x10')]['message']);return _0x48c6b3(_0x495f71[_0x2b45('0x10')][_0x2b45('0x12')]);}logger['error'](_0x2b45('0xb'),_0x444587,_0x495f71['error'][_0x2b45('0x12')]);return _0x4a4456(_0x495f71[_0x2b45('0x10')][_0x2b45('0x12')]);}else{logger['info'](_0x2b45('0xb'),_0x444587,_0x2b45('0xe'));_0x4a4456(_0x495f71[_0x2b45('0x13')]['message']);}})[_0x2b45('0x14')](function(_0x49c89c){logger[_0x2b45('0x10')](_0x2b45('0xb'),_0x444587,_0x49c89c);_0x48c6b3(_0x49c89c);});});}exports[_0x2b45('0x15')]=function(_0xfaa0cd){var _0x2fe156=this;return new Promise(function(_0x1f3ce9,_0x139de2){return db[_0x2b45('0x16')][_0x2b45('0x17')](_0xfaa0cd[_0x2b45('0x18')],{'raw':_0xfaa0cd[_0x2b45('0x19')]?_0xfaa0cd[_0x2b45('0x19')][_0x2b45('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfaa0cd[_0x2b45('0x19')]?_0xfaa0cd[_0x2b45('0x19')][_0x2b45('0x1b')]||null:null,'attributes':_0xfaa0cd[_0x2b45('0x19')]?_0xfaa0cd['options'][_0x2b45('0x1c')]||null:null,'limit':_0xfaa0cd['options']?_0xfaa0cd[_0x2b45('0x19')]['limit']||null:null})[_0x2b45('0xa')](function(_0x312002){logger[_0x2b45('0x1d')](_0x2b45('0x15'),_0xfaa0cd);logger[_0x2b45('0xc')](_0x2b45('0x15'),_0xfaa0cd,JSON[_0x2b45('0xf')](_0x312002));_0x1f3ce9(_0x312002);})[_0x2b45('0x14')](function(_0x1a07ba){logger[_0x2b45('0x10')](_0x2b45('0x15'),_0x1a07ba[_0x2b45('0x12')],_0xfaa0cd);_0x139de2(_0x2fe156[_0x2b45('0x10')](0x1f4,_0x1a07ba['message']));});});}; \ No newline at end of file +var _0x8b43=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxApplication,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','UpdateFaxApplication','update','body','options','raw','where','attributes','limit','lodash'];(function(_0x5e3a0e,_0x1ae803){var _0x2884dc=function(_0x471f58){while(--_0x471f58){_0x5e3a0e['push'](_0x5e3a0e['shift']());}};_0x2884dc(++_0x1ae803);}(_0x8b43,0x17f));var _0x38b4=function(_0x1b2655,_0x88a87d){_0x1b2655=_0x1b2655-0x0;var _0x3ed622=_0x8b43[_0x1b2655];return _0x3ed622;};'use strict';var _=require(_0x38b4('0x0'));var util=require(_0x38b4('0x1'));var moment=require('moment');var BPromise=require(_0x38b4('0x2'));var rs=require(_0x38b4('0x3'));var fs=require('fs');var Redis=require(_0x38b4('0x4'));var db=require(_0x38b4('0x5'))['db'];var utils=require(_0x38b4('0x6'));var logger=require(_0x38b4('0x7'))(_0x38b4('0x8'));var config=require(_0x38b4('0x9'));var jayson=require(_0x38b4('0xa'));var client=jayson[_0x38b4('0xb')][_0x38b4('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5b2d07,_0x3d8392,_0x54f1d4){return new BPromise(function(_0x3e541e,_0x5c231a){return client[_0x38b4('0xd')](_0x5b2d07,_0x54f1d4)[_0x38b4('0xe')](function(_0x5e152b){logger[_0x38b4('0xf')](_0x38b4('0x10'),_0x3d8392,'request\x20sent');logger[_0x38b4('0x11')]('FaxApplication,\x20%s,\x20%s,\x20%s',_0x3d8392,'request\x20sent',JSON[_0x38b4('0x12')](_0x5e152b));if(_0x5e152b[_0x38b4('0x13')]){if(_0x5e152b[_0x38b4('0x13')][_0x38b4('0x14')]===0x1f4){logger[_0x38b4('0x13')](_0x38b4('0x10'),_0x3d8392,_0x5e152b[_0x38b4('0x13')][_0x38b4('0x15')]);return _0x5c231a(_0x5e152b[_0x38b4('0x13')][_0x38b4('0x15')]);}logger[_0x38b4('0x13')](_0x38b4('0x10'),_0x3d8392,_0x5e152b[_0x38b4('0x13')][_0x38b4('0x15')]);return _0x3e541e(_0x5e152b[_0x38b4('0x13')]['message']);}else{logger['info'](_0x38b4('0x10'),_0x3d8392,'request\x20sent');_0x3e541e(_0x5e152b[_0x38b4('0x16')]['message']);}})[_0x38b4('0x17')](function(_0x34d1cf){logger[_0x38b4('0x13')](_0x38b4('0x10'),_0x3d8392,_0x34d1cf);_0x5c231a(_0x34d1cf);});});}exports[_0x38b4('0x18')]=function(_0xe37a83){var _0x4cfa38=this;return new Promise(function(_0x2b2ed8,_0x1eb6e6){return db['FaxApplication'][_0x38b4('0x19')](_0xe37a83[_0x38b4('0x1a')],{'raw':_0xe37a83[_0x38b4('0x1b')]?_0xe37a83[_0x38b4('0x1b')][_0x38b4('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xe37a83['options']?_0xe37a83[_0x38b4('0x1b')][_0x38b4('0x1d')]||null:null,'attributes':_0xe37a83[_0x38b4('0x1b')]?_0xe37a83[_0x38b4('0x1b')][_0x38b4('0x1e')]||null:null,'limit':_0xe37a83[_0x38b4('0x1b')]?_0xe37a83['options'][_0x38b4('0x1f')]||null:null})[_0x38b4('0xe')](function(_0x4d2fd0){logger[_0x38b4('0xf')]('UpdateFaxApplication',_0xe37a83);logger[_0x38b4('0x11')](_0x38b4('0x18'),_0xe37a83,JSON[_0x38b4('0x12')](_0x4d2fd0));_0x2b2ed8(_0x4d2fd0);})[_0x38b4('0x17')](function(_0x2c7bcf){logger[_0x38b4('0x13')](_0x38b4('0x18'),_0x2c7bcf['message'],_0xe37a83);_0x1eb6e6(_0x4cfa38[_0x38b4('0x13')](0x1f4,_0x2c7bcf[_0x38b4('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 1915bec..9b74819 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 _0x9c5a=['isAuthenticated','get','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxApplication.controller'];(function(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x3a0059,_0x4e48d6){_0x3a0059=_0x3a0059-0x0;var _0x195d33=_0x9c5a[_0x3a0059];return _0x195d33;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa9c5('0xb')]('/',auth[_0xa9c5('0x8')](),controller['create']);router[_0xa9c5('0xc')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller[_0xa9c5('0xd')]);router[_0xa9c5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa9c5('0xf')]);module[_0xa9c5('0x10')]=router; \ No newline at end of file +var _0x24ca=['show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x4b7895,_0x3c4f5d){var _0x264180=function(_0xe0e861){while(--_0xe0e861){_0x4b7895['push'](_0x4b7895['shift']());}};_0x264180(++_0x3c4f5d);}(_0x24ca,0x1bc));var _0xa24c=function(_0x439d59,_0x11ccdf){_0x439d59=_0x439d59-0x0;var _0x3670c7=_0x24ca[_0x439d59];return _0x3670c7;};'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']('/',auth[_0xa24c('0x9')](),controller[_0xa24c('0xd')]);router[_0xa24c('0xe')]('/:id',auth[_0xa24c('0x9')](),controller[_0xa24c('0xf')]);router[_0xa24c('0x10')](_0xa24c('0xb'),auth[_0xa24c('0x9')](),controller[_0xa24c('0x11')]);module[_0xa24c('0x12')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 955ac91..fc13f3a 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 _0xbfaa=['BOOLEAN','DATE','STRING','ENUM','out','sequelize','exports'];(function(_0x37d9f1,_0x1edb1c){var _0x43fa59=function(_0x357b87){while(--_0x357b87){_0x37d9f1['push'](_0x37d9f1['shift']());}};_0x43fa59(++_0x1edb1c);}(_0xbfaa,0x17f));var _0xabfa=function(_0x308ea7,_0x329b74){_0x308ea7=_0x308ea7-0x0;var _0x244dcc=_0xbfaa[_0x308ea7];return _0x244dcc;};'use strict';var Sequelize=require(_0xabfa('0x0'));module[_0xabfa('0x1')]={'closed':{'type':Sequelize[_0xabfa('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xabfa('0x3')]},'disposition':{'type':Sequelize[_0xabfa('0x4')]},'note':{'type':Sequelize[_0xabfa('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize[_0xabfa('0x5')]('in',_0xabfa('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xabfa('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xabfa('0x5')]('in',_0xabfa('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x44d8=['sequelize','exports','BOOLEAN','STRING','DATE','out','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x44d8,0x1ea));var _0x844d=function(_0x41d6bf,_0x100b2b){_0x41d6bf=_0x41d6bf-0x0;var _0x270d1a=_0x44d8[_0x41d6bf];return _0x270d1a;};'use strict';var Sequelize=require(_0x844d('0x0'));module[_0x844d('0x1')]={'closed':{'type':Sequelize[_0x844d('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x844d('0x3')]},'read1stAt':{'type':Sequelize[_0x844d('0x4')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x844d('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x844d('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x844d('0x6')]('in',_0x844d('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 eca1318..6beffd6 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 _0x901f=['rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','select','field','color','from','tools_tags','u.id','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','split','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','compact','i.FaxAccountId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','resolve','FaxAccountId','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','toString','sequelize','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.mobile','c.fax','Contact.fax','groupBy','FaxInteractionId','all','rows','show','params','includeAll','include','merge','options','create','describe','addMessage','FaxMessage','omit','ids','getMessages','findOne','format','findAll','addTags','spread','emit','faxInteractionTags:save','removeTags','unix','join','root','server','files','tmp','interaction-%s.zip','createdAt','Attachment','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','download','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','path','sox','to-csv','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','json','count','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','map','TagIds','Tags','forEach','push','catch','index','FaxInteraction'];(function(_0x161341,_0x1c054d){var _0x5e06c3=function(_0x1d177a){while(--_0x1d177a){_0x161341['push'](_0x161341['shift']());}};_0x5e06c3(++_0x1c054d);}(_0x901f,0x98));var _0xf901=function(_0x1c3911,_0x5d79c9){_0x1c3911=_0x1c3911-0x0;var _0x5b923f=_0x901f[_0x1c3911];return _0x5b923f;};'use strict';var pdf=require(_0xf901('0x0'));var emlformat=require(_0xf901('0x1'));var rimraf=require(_0xf901('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf901('0x3'));var rp=require(_0xf901('0x4'));var moment=require(_0xf901('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf901('0x6'));var path=require(_0xf901('0x7'));var sox=require(_0xf901('0x8'));var csv=require(_0xf901('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf901('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf901('0xb'));var toCsv=require(_0xf901('0x9'));var querystring=require(_0xf901('0xc'));var Papa=require(_0xf901('0xd'));var Redis=require(_0xf901('0xe'));var authService=require(_0xf901('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xf901('0x10'));var hardwareService=require(_0xf901('0x11'));var logger=require(_0xf901('0x12'))('api');var utils=require(_0xf901('0x13'));var config=require('../../config/environment');var db=require(_0xf901('0x14'))['db'];config['redis']=_[_0xf901('0x15')](config[_0xf901('0x16')],{'host':_0xf901('0x17'),'port':0x18eb});var socket=require(_0xf901('0x18'))(new Redis(config['redis']));require(_0xf901('0x19'))[_0xf901('0x1a')](socket);function respondWithStatusCode(_0x6e5320,_0x5e4440){_0x5e4440=_0x5e4440||0xcc;return function(_0x599f18){if(_0x599f18){return _0x6e5320[_0xf901('0x1b')](_0x5e4440);}return _0x6e5320['status'](_0x5e4440)[_0xf901('0x1c')]();};}function respondWithResult(_0x2a66fc,_0x57369b){_0x57369b=_0x57369b||0xc8;return function(_0x2c0c19){if(_0x2c0c19){return _0x2a66fc[_0xf901('0x1d')](_0x57369b)[_0xf901('0x1e')](_0x2c0c19);}};}function respondWithFilteredResult(_0xc2fee6,_0x172225){return function(_0x2e8ecb){if(_0x2e8ecb){var _0x1aab23=_0x2e8ecb[_0xf901('0x1f')],_0x20e697=_0x172225['offset'],_0x358f80=_0x172225['offset']+_0x172225['limit'],_0x4b5464;if(_0x358f80>=_0x1aab23){_0x358f80=_0x1aab23;_0x4b5464=0xc8;}else{_0x4b5464=0xce;}_0xc2fee6[_0xf901('0x1d')](_0x4b5464);return _0xc2fee6[_0xf901('0x20')](_0xf901('0x21'),_0x20e697+'-'+_0x358f80+'/'+_0x1aab23)[_0xf901('0x1e')](_0x2e8ecb);}return null;};}function patchUpdates(_0x4e1096){return function(_0x4ac3d4){try{jsonpatch[_0xf901('0x22')](_0x4ac3d4,_0x4e1096,!![]);}catch(_0xa1d9c5){return BPromise[_0xf901('0x23')](_0xa1d9c5);}return _0x4ac3d4[_0xf901('0x24')]();};}function saveUpdates(_0x5b0ad4,_0xaf4c7e){return function(_0x27b5e7){if(_0x27b5e7){return _0x27b5e7[_0xf901('0x25')](_0x5b0ad4)['then'](function(_0x4f3ec7){return _0x4f3ec7;});}return null;};}function removeEntity(_0x4bfc13,_0x25c248){return function(_0xa0f6c7){if(_0xa0f6c7){return _0xa0f6c7[_0xf901('0x26')]()[_0xf901('0x27')](function(){_0x4bfc13[_0xf901('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b282,_0x437618){return function(_0x61b04f){if(!_0x61b04f){_0x59b282[_0xf901('0x1b')](0x194);}return _0x61b04f;};}function handleError(_0xeeef00,_0x5bf518){_0x5bf518=_0x5bf518||0x1f4;return function(_0x3bbb58){logger[_0xf901('0x28')](_0x3bbb58[_0xf901('0x29')]);if(_0x3bbb58[_0xf901('0x2a')]){delete _0x3bbb58['name'];}_0xeeef00['status'](_0x5bf518)['send'](_0x3bbb58);};}function getInteractionUsers(_0x1dcf58,_0x4918b4){return new BPromise(function(_0x3a1a7a,_0x1f339a){try{if(_0x4918b4[_0x1dcf58['id']]){_0x1dcf58['Users']=_[_0xf901('0x2b')](_0x4918b4[_0x1dcf58['id']],function(_0x51b2b0){return{'id':_0x51b2b0['id']};});}}catch(_0x659a20){_0x1f339a(_0x659a20);}_0x3a1a7a(_0x1dcf58);});}function getInteractionTags(_0x4dc71e,_0x3e2595){return new BPromise(function(_0x4b518a,_0x1c26f9){try{if(_0x4dc71e[_0xf901('0x2c')]){_0x4dc71e[_0xf901('0x2d')]=[];_0x4dc71e[_0xf901('0x2c')]['split'](',')[_0xf901('0x2e')](function(_0x4cfbae){_0x4dc71e[_0xf901('0x2d')][_0xf901('0x2f')](_0x3e2595[_0x4cfbae]);});}delete _0x4dc71e[_0xf901('0x2c')];}catch(_0x326a29){_0x1c26f9(_0x326a29);}_0x4b518a(_0x4dc71e);});}function updateFaxInteraction(_0x4a258f,_0x5f08ed,_0x13d76e){return new BPromise(function(_0x21fa28,_0x4ae19b){return getInteractionUsers(_0x4a258f,_0x13d76e)[_0xf901('0x27')](function(_0x5980d0){return getInteractionTags(_0x5980d0,_0x5f08ed);})[_0xf901('0x27')](function(_0x25cc84){_0x21fa28(_0x25cc84);})[_0xf901('0x30')](function(_0x3b4957){_0x4ae19b(_0x3b4957);});});}exports[_0xf901('0x31')]=function(_0x29ff1f,_0x10edb6){var _0x475e5a={},_0x4fc2e7={},_0x1f3d7f={'count':0x0,'rows':[]};var _0x52e669=_['map'](db[_0xf901('0x32')][_0xf901('0x33')],function(_0x2a5e41){return{'name':_0x2a5e41[_0xf901('0x34')],'type':_0x2a5e41[_0xf901('0x35')][_0xf901('0x36')]};});_0x4fc2e7['model']=_[_0xf901('0x2b')](_0x52e669,_0xf901('0x2a'));_0x4fc2e7[_0xf901('0x37')]=_[_0xf901('0x38')](_0x29ff1f[_0xf901('0x37')]);_0x4fc2e7[_0xf901('0x39')]=_[_0xf901('0x3a')](_0x4fc2e7[_0xf901('0x3b')],_0x4fc2e7[_0xf901('0x37')]);_0x475e5a[_0xf901('0x3c')]=_[_0xf901('0x3a')](_0x4fc2e7[_0xf901('0x3b')],qs[_0xf901('0x3d')](_0x29ff1f[_0xf901('0x37')][_0xf901('0x3d')]));_0x475e5a[_0xf901('0x3c')]=_0x475e5a[_0xf901('0x3c')][_0xf901('0x3e')]?_0x475e5a[_0xf901('0x3c')]:_0x4fc2e7['model'];if(!_0x29ff1f[_0xf901('0x37')][_0xf901('0x3f')](_0xf901('0x40'))){_0x475e5a[_0xf901('0x41')]=qs['limit'](_0x29ff1f[_0xf901('0x37')]['limit']);_0x475e5a[_0xf901('0x42')]=qs[_0xf901('0x42')](_0x29ff1f[_0xf901('0x37')][_0xf901('0x42')]);}_0x475e5a[_0xf901('0x43')]=qs['sort'](_0x29ff1f['query'][_0xf901('0x44')]);_0x475e5a[_0xf901('0x45')]=qs[_0xf901('0x39')](_['pick'](_0x29ff1f[_0xf901('0x37')],_0x4fc2e7['filters']));var _0x22750d=[];var _0x195c7c=squel[_0xf901('0x46')]()[_0xf901('0x47')]('id')[_0xf901('0x47')](_0xf901('0x2a'))[_0xf901('0x47')](_0xf901('0x48'))[_0xf901('0x49')](_0xf901('0x4a'));var _0x4fd069=squel['select']()['field'](_0xf901('0x4b'))[_0xf901('0x47')]('ui.FaxInteractionId')['from'](_0xf901('0x4c'),'ui')['left_join'](_0xf901('0x4d'),'u',_0xf901('0x4e'));var _0x344314=squel[_0xf901('0x46')]()[_0xf901('0x49')](_0xf901('0x4f'),'i')[_0xf901('0x50')](_0xf901('0x51'),'c',_0xf901('0x52'))[_0xf901('0x50')]('users','o',_0xf901('0x53'))[_0xf901('0x50')](_0xf901('0x54'),'a',_0xf901('0x55'))[_0xf901('0x50')](_0xf901('0x56'),'me',_0xf901('0x57'))[_0xf901('0x50')]('fax_interaction_has_tags','it',_0xf901('0x58'))['left_join'](_0xf901('0x4a'),'t',_0xf901('0x59'));var _0x297115=squel[_0xf901('0x5a')]();var _0x1edf1e=[];var _0x199424=squel[_0xf901('0x5a')]();var _0x2da10d;if(_0x29ff1f['query'][_0xf901('0x5b')]){_0x2da10d=as['parseSearch'](_0x29ff1f[_0xf901('0x37')]['search']);var _0x454096=_0x2da10d['sqlOperator'];for(var _0x2c3423=0x0;_0x2c3423<_0x2da10d[_0xf901('0x5c')][_0xf901('0x3e')];_0x2c3423++){var _0x581d76=_0x2da10d[_0xf901('0x5c')][_0x2c3423];var _0x28131a='i';var _0x5b35db=_[_0xf901('0x5d')](_0x52e669,[_0xf901('0x2a'),_0x581d76['field']]);if(!_0x5b35db){switch(_0x581d76[_0xf901('0x47')]){case _0xf901('0x5e'):if(_0x581d76[_0xf901('0x5f')]==0x1){_0x344314[_0xf901('0x60')]('`'+_0x581d76[_0xf901('0x47')]+'`\x20=\x200');}else{_0x344314[_0xf901('0x60')]('`'+_0x581d76['field']+_0xf901('0x61'));}break;case'Contact':if(_0x581d76[_0xf901('0x62')]==='$substring'){if(_0x581d76[_0xf901('0x5f')][_0xf901('0x63')]('\x20')[_0xf901('0x3e')]>0x1){_0x297115[_0x454096]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xf901('0x64')](_0x581d76[_0xf901('0x5f')]),null);}else{var _0x12c643='%'+_0x581d76['value']+'%';_0x297115[_0x454096](_0xf901('0x65'),_0x12c643,_0x12c643,_0x12c643);}}else{_0x5b35db=_[_0xf901('0x5d')](_0x52e669,[_0xf901('0x2a'),_0xf901('0x66')]);_0x581d76['field']=_0xf901('0x66');_0x1049cf=as[_0xf901('0x67')](_0x28131a,_0x5b35db[_0xf901('0x35')],_0x581d76);_0x297115[_0x454096](_0x1049cf[_0xf901('0x68')],_0x1049cf[_0xf901('0x5f')][_0xf901('0x69')],_0x1049cf[_0xf901('0x5f')]['end']);}break;case _0xf901('0x6a'):var _0x180a53=_0x581d76[_0xf901('0x5f')][_0xf901('0x63')](',')[_0xf901('0x2b')](function(_0x3bd7c9){return Number(_0x3bd7c9);});_0x180a53[_0xf901('0x2e')](function(_0xdb9230){_0x199424['or'](_0xf901('0x6b'),'%,'+_0xdb9230+',%');});_0x1edf1e=_[_0xf901('0x6c')](_0x1edf1e,_0x180a53);break;case'User':if(_0x581d76['operator']===_0xf901('0x6d')){_0x297115[_0x454096](_0xf901('0x6e'),'%'+_0x581d76['value']+'%',null);}else{_0x5b35db=_[_0xf901('0x5d')](_0x52e669,['name',_0xf901('0x6f')]);_0x581d76[_0xf901('0x47')]='UserId';_0x1049cf=as['buildExpression'](_0x28131a,_0x5b35db[_0xf901('0x35')],_0x581d76);_0x297115[_0x454096](_0x1049cf[_0xf901('0x68')],_0x1049cf[_0xf901('0x5f')][_0xf901('0x69')],_0x1049cf['value'][_0xf901('0x1c')]);}break;case _0xf901('0x70'):_0x1049cf=as['buildExpression']('me',null,_0x581d76);_0x297115[_0x454096](_0x1049cf['text'],_0x1049cf['value'][_0xf901('0x69')],_0x1049cf[_0xf901('0x5f')][_0xf901('0x1c')]);break;}}else{var _0x1049cf=as[_0xf901('0x67')](_0x28131a,_0x5b35db[_0xf901('0x35')],_0x581d76);_0x297115[_0x454096](_0x1049cf['text'],_0x1049cf[_0xf901('0x5f')][_0xf901('0x69')],_0x1049cf['value']['end']);}}}else{var _0x28a94f=_(_0x29ff1f['query'])[_0xf901('0x38')]()[_0xf901('0x2b')](function(_0x3d4a93){return _[_0xf901('0x71')](_0x52e669,[_0xf901('0x2a'),_0x3d4a93])?_0x3d4a93:undefined;})[_0xf901('0x72')]()[_0xf901('0x5f')]();if(!_['isEmpty'](_0x28a94f)){_0x28a94f[_0xf901('0x2e')](function(_0x32a623){if(_0x32a623==='FaxAccountId'){_0x344314[_0xf901('0x45')](_0xf901('0x73'),[][_0xf901('0x74')](_0x29ff1f['query'][_0x32a623]));}else if(_0x32a623==='createdAt'){var _0x123c59=JSON['parse'](_0x29ff1f[_0xf901('0x37')][_0x32a623])[_0xf901('0x75')];var _0x419464=JSON[_0xf901('0x76')](_0x29ff1f[_0xf901('0x37')][_0x32a623])[_0xf901('0x77')];_0x344314['where'](_0xf901('0x78'),_0x123c59,_0x419464);}else{if(_0x29ff1f[_0xf901('0x37')][_0x32a623]===_0xf901('0x79')){_0x344314[_0xf901('0x45')]('i.'+_0x32a623+'\x20IS\x20NULL');}else{_0x344314['where']('i.'+_0x32a623+'\x20=\x20?',_0x29ff1f[_0xf901('0x37')][_0x32a623]);}}});}if(_0x29ff1f[_0xf901('0x37')][_0xf901('0x7a')]){if(_0x29ff1f['query']['read']==0x1){_0x344314[_0xf901('0x60')](_0xf901('0x7b'));}else{_0x344314[_0xf901('0x60')](_0xf901('0x7c'));}}if(_0x29ff1f[_0xf901('0x37')][_0xf901('0x7d')]){_0x1edf1e=_[_0xf901('0x7e')](_0x29ff1f['query'][_0xf901('0x7d')])?_0x29ff1f[_0xf901('0x37')][_0xf901('0x7d')]:new Array(_0x29ff1f[_0xf901('0x37')][_0xf901('0x7d')]);_0x1edf1e[_0xf901('0x2e')](function(_0x6b31e5){_0x199424['or'](_0xf901('0x6b'),'%,'+_0x6b31e5+',%');});}if(_0x29ff1f[_0xf901('0x37')][_0xf901('0x7f')]){var _0x523aca=_0x29ff1f[_0xf901('0x37')]['filter']['replace']('\x5c','\x5c\x5c')[_0xf901('0x80')]('\x27\x27',_0xf901('0x81'));if(qs[_0xf901('0x82')](_0x523aca)){_0x297115['or'](_0xf901('0x83'),_0x523aca+'%')['or']('i.fax\x20LIKE\x20?',_0x523aca+'%');}_0x297115['or'](_0xf901('0x84'),_0x523aca+'%');}}_0x344314[_0xf901('0x45')](_0x297115);_0x344314['group'](_0xf901('0x85'));var _0x1d86f0={'type':db[_0xf901('0x86')]['QueryTypes'][_0xf901('0x87')],'raw':!![]};var _0x2ce7e0=_0x344314['clone']();_0x2ce7e0['field'](_0xf901('0x85'));_0x2ce7e0[_0xf901('0x47')](_0xf901('0x88'),_0xf901('0x5e'));if(_0x475e5a[_0xf901('0x43')]){_0x475e5a['order'][_0xf901('0x2e')](function(_0x1c6fa0){_0x344314[_0xf901('0x43')]('i.'+_0x1c6fa0[0x0],_0x1c6fa0[0x1]===_0xf901('0x89')?![]:!![]);});}if(!_[_0xf901('0x8a')](_0x1edf1e)){_0x344314[_0xf901('0x60')](_0x199424);_0x2ce7e0['where']('t.id\x20IN\x20?',_0x1edf1e);}BPromise[_0xf901('0x8b')]()['then'](function(){if(!_0x2da10d&&_0x29ff1f[_0xf901('0x37')][_0xf901('0x8c')])return;return _0x29ff1f[_0xf901('0x8d')][_0xf901('0x8e')]({'attributes':['id'],'raw':!![]})[_0xf901('0x27')](function(_0x514085){if(_[_0xf901('0x8a')](_0x514085)){_0x2ce7e0[_0xf901('0x45')](_0xf901('0x8f'));_0x344314[_0xf901('0x45')](_0xf901('0x8f'));}else{_0x2ce7e0[_0xf901('0x45')](_0xf901('0x73'),_[_0xf901('0x2b')](_0x514085,'id'));_0x344314[_0xf901('0x45')](_0xf901('0x73'),_[_0xf901('0x2b')](_0x514085,'id'));}});})['then'](function(){db['sequelize'][_0xf901('0x37')](_0x2ce7e0[_0xf901('0x90')](),_0x1d86f0)[_0xf901('0x27')](function(_0x4eddd0){_0x1f3d7f[_0xf901('0x1f')]=_0x4eddd0[_0xf901('0x3e')];if(_0x1f3d7f[_0xf901('0x1f')]===0x0)return[];return db[_0xf901('0x91')][_0xf901('0x37')](_0x195c7c['toString'](),_0x1d86f0)['then'](function(_0x188c9b){_0x22750d=_[_0xf901('0x92')](_0x188c9b,'id');_0x1d86f0=_['merge'](_0x1d86f0,{'model':db['FaxInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x344314[_0xf901('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x344314[_0xf901('0x47')](_0xf901('0x93'),_0xf901('0x94'));_0x344314[_0xf901('0x47')](_0xf901('0x95'),'Account.mandatoryDisposition');_0x344314[_0xf901('0x47')](_0xf901('0x96'));_0x344314[_0xf901('0x47')](_0xf901('0x97'),_0xf901('0x98'));_0x344314[_0xf901('0x47')](_0xf901('0x99'),_0xf901('0x9a'));_0x344314[_0xf901('0x47')](_0xf901('0x9b'),_0xf901('0x9c'));_0x344314[_0xf901('0x47')]('c.phone','Contact.phone');_0x344314[_0xf901('0x47')](_0xf901('0x9d'),'Contact.mobile');_0x344314[_0xf901('0x47')](_0xf901('0x9e'),_0xf901('0x9f'));_0x344314[_0xf901('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xf901('0x2c'));_0x344314[_0xf901('0x41')](_0x475e5a[_0xf901('0x41')]);_0x344314[_0xf901('0x42')](_0x475e5a[_0xf901('0x42')]);return db['sequelize'][_0xf901('0x37')](_0x344314['toString'](),_0x1d86f0);})[_0xf901('0x27')](function(_0x9b3724){_0x4fd069['where']('ui.FaxInteractionId\x20IN\x20?',_[_0xf901('0x2b')](_0x9b3724,'id'));return db[_0xf901('0x91')][_0xf901('0x37')](_0x4fd069[_0xf901('0x90')](),_0x1d86f0)[_0xf901('0x27')](function(_0x336f55){var _0xe81041=_[_0xf901('0xa0')](_0x336f55,_0xf901('0xa1'));var _0x1b1400=[];_0x9b3724[_0xf901('0x2e')](function(_0x4d7ba6){_0x1b1400[_0xf901('0x2f')](updateFaxInteraction(_0x4d7ba6,_0x22750d,_0xe81041));});return BPromise[_0xf901('0xa2')](_0x1b1400);});});})[_0xf901('0x27')](function(_0x37699a){_0x1f3d7f[_0xf901('0xa3')]=_0x37699a;return _0x1f3d7f;})[_0xf901('0x27')](respondWithFilteredResult(_0x10edb6,_0x475e5a));})[_0xf901('0x30')](handleError(_0x10edb6,null));};exports[_0xf901('0xa4')]=function(_0x41508c,_0x534d57){var _0x546e3b={'raw':![],'where':{'id':_0x41508c[_0xf901('0xa5')]['id']}},_0x31e767={};_0x31e767[_0xf901('0x3b')]=_['keys'](db[_0xf901('0x32')][_0xf901('0x33')]);_0x31e767[_0xf901('0x37')]=_['keys'](_0x41508c[_0xf901('0x37')]);_0x31e767[_0xf901('0x39')]=_[_0xf901('0x3a')](_0x31e767[_0xf901('0x3b')],_0x31e767[_0xf901('0x37')]);_0x546e3b[_0xf901('0x3c')]=_[_0xf901('0x3a')](_0x31e767[_0xf901('0x3b')],qs['fields'](_0x41508c[_0xf901('0x37')][_0xf901('0x3d')]));_0x546e3b[_0xf901('0x3c')]=_0x546e3b['attributes']['length']?_0x546e3b[_0xf901('0x3c')]:_0x31e767[_0xf901('0x3b')];if(_0x41508c['query'][_0xf901('0xa6')]){_0x546e3b[_0xf901('0xa7')]=[{'all':!![]}];}_0x546e3b=_[_0xf901('0xa8')]({},_0x546e3b,_0x41508c[_0xf901('0xa9')]);return db['FaxInteraction']['find'](_0x546e3b)['then'](handleEntityNotFound(_0x534d57,null))[_0xf901('0x27')](respondWithResult(_0x534d57,null))[_0xf901('0x30')](handleError(_0x534d57,null));};exports['create']=function(_0x44a5ad,_0x4758ce){return db[_0xf901('0x32')][_0xf901('0xaa')](_0x44a5ad['body'],{})[_0xf901('0x27')](respondWithResult(_0x4758ce,0xc9))[_0xf901('0x30')](handleError(_0x4758ce,null));};exports[_0xf901('0x25')]=function(_0x2127fa,_0xc9ea90){if(_0x2127fa[_0xf901('0x70')]['id']){delete _0x2127fa[_0xf901('0x70')]['id'];}return db[_0xf901('0x32')][_0xf901('0x5d')]({'where':{'id':_0x2127fa[_0xf901('0xa5')]['id']}})[_0xf901('0x27')](handleEntityNotFound(_0xc9ea90,null))['then'](saveUpdates(_0x2127fa[_0xf901('0x70')],null))['then'](respondWithResult(_0xc9ea90,null))[_0xf901('0x30')](handleError(_0xc9ea90,null));};exports[_0xf901('0x26')]=function(_0x4b3066,_0x13b0e3){return db['FaxInteraction']['find']({'where':{'id':_0x4b3066[_0xf901('0xa5')]['id']}})[_0xf901('0x27')](handleEntityNotFound(_0x13b0e3,null))['then'](removeEntity(_0x13b0e3,null))['catch'](handleError(_0x13b0e3,null));};exports[_0xf901('0xab')]=function(_0x5deb0d,_0x20b15d){return db[_0xf901('0x32')][_0xf901('0xab')]()[_0xf901('0x27')](respondWithResult(_0x20b15d,null))[_0xf901('0x30')](handleError(_0x20b15d,null));};exports[_0xf901('0xac')]=function(_0x205b9d,_0x5c315e,_0x4e45f9){return db[_0xf901('0xad')][_0xf901('0x5d')]({'where':{'id':_0x205b9d[_0xf901('0xa5')]['id']}})['then'](handleEntityNotFound(_0x5c315e,null))['then'](function(_0x5345d6){if(_0x5345d6){return _0x5345d6[_0xf901('0xac')](_0x205b9d[_0xf901('0x70')]['ids'],_[_0xf901('0xae')](_0x205b9d[_0xf901('0x70')],[_0xf901('0xaf'),'id'])||{});}})[_0xf901('0x27')](respondWithResult(_0x5c315e,null))[_0xf901('0x30')](handleError(_0x5c315e,null));};exports[_0xf901('0xb0')]=function(_0x49100a,_0x1fad8a,_0x466531){var _0x2563fa={'raw':![],'where':{}};var _0xf483b1={};var _0x3c8821={'count':0x0,'rows':[]};return db[_0xf901('0x32')][_0xf901('0xb1')]({'where':{'id':_0x49100a['params']['id']}})[_0xf901('0x27')](handleEntityNotFound(_0x1fad8a,null))[_0xf901('0x27')](function(_0x36b58c){if(_0x36b58c){_0xf483b1[_0xf901('0x3b')]=_['keys'](db[_0xf901('0xad')]['rawAttributes']);_0xf483b1['query']=_[_0xf901('0x38')](_0x49100a[_0xf901('0x37')]);_0xf483b1[_0xf901('0x39')]=_[_0xf901('0x3a')](_0xf483b1['model'],_0xf483b1[_0xf901('0x37')]);_0x2563fa[_0xf901('0x3c')]=_['intersection'](_0xf483b1[_0xf901('0x3b')],qs[_0xf901('0x3d')](_0x49100a[_0xf901('0x37')][_0xf901('0x3d')]));_0x2563fa['attributes']=_0x2563fa[_0xf901('0x3c')][_0xf901('0x3e')]?_0x2563fa[_0xf901('0x3c')]:_0xf483b1[_0xf901('0x3b')];if(!_0x49100a[_0xf901('0x37')][_0xf901('0x3f')]('nolimit')){_0x2563fa[_0xf901('0x41')]=qs[_0xf901('0x41')](_0x49100a[_0xf901('0x37')]['limit']);_0x2563fa[_0xf901('0x42')]=qs[_0xf901('0x42')](_0x49100a[_0xf901('0x37')][_0xf901('0x42')]);}_0x2563fa[_0xf901('0x43')]=qs[_0xf901('0x44')](_0x49100a[_0xf901('0x37')][_0xf901('0x44')]);_0x2563fa[_0xf901('0x45')]=qs[_0xf901('0x39')](_['pick'](_0x49100a[_0xf901('0x37')],_0xf483b1[_0xf901('0x39')]));_0x2563fa['where'][_0xf901('0xa1')]=_0x36b58c['id'];if(_0x49100a[_0xf901('0x37')][_0xf901('0x7f')]){_0x2563fa[_0xf901('0x45')]=_[_0xf901('0xa8')](_0x2563fa[_0xf901('0x45')],{'$or':_[_0xf901('0x2b')](_0x2563fa[_0xf901('0x3c')],function(_0x86a913){var _0x3edb88={};_0x3edb88[_0x86a913]={'$like':'%'+_0x49100a[_0xf901('0x37')][_0xf901('0x7f')]+'%'};return _0x3edb88;})});}if(_0x49100a[_0xf901('0x37')][_0xf901('0x75')]){var _0x1374a9=_0x49100a[_0xf901('0x37')][_0xf901('0x75')][_0xf901('0x63')](',');var _0x23c7cd={};_0x23c7cd[_0x1374a9[0x0]]={'$gte':moment(_0x1374a9[0x1])[_0xf901('0xb2')]('YYYY-MM-DD\x20HH:mm:ss')};_0x2563fa[_0xf901('0x45')]=_[_0xf901('0xa8')](_0x2563fa[_0xf901('0x45')],_0x23c7cd);}_0x2563fa=_['merge']({},_0x2563fa,_0x49100a['options']);return db[_0xf901('0xad')][_0xf901('0x1f')]({'where':_0x2563fa[_0xf901('0x45')]})[_0xf901('0x27')](function(_0x43c67f){_0x3c8821['count']=_0x43c67f;if(_0x49100a['query'][_0xf901('0xa6')]){_0x2563fa[_0xf901('0xa7')]=[{'all':!![]}];}return db['FaxMessage'][_0xf901('0xb3')](_0x2563fa);})[_0xf901('0x27')](function(_0x486b46){_0x3c8821[_0xf901('0xa3')]=_0x486b46;return _0x3c8821;});}})[_0xf901('0x27')](respondWithFilteredResult(_0x1fad8a,_0x2563fa))[_0xf901('0x30')](handleError(_0x1fad8a,null));};exports[_0xf901('0xb4')]=function(_0x28a7f1,_0x305e25,_0x23b85e){return db[_0xf901('0x32')][_0xf901('0x5d')]({'where':{'id':_0x28a7f1[_0xf901('0xa5')]['id']}})[_0xf901('0x27')](handleEntityNotFound(_0x305e25,null))[_0xf901('0x27')](function(_0x388ab4){if(_0x388ab4){return _0x388ab4['setTags'](_0x28a7f1['body'][_0xf901('0xaf')],_[_0xf901('0xae')](_0x28a7f1[_0xf901('0x70')],[_0xf901('0xaf'),'id'])||{})[_0xf901('0xb5')](function(){return db['Tag'][_0xf901('0xb3')]({'attributes':['id','name',_0xf901('0x48')],'where':{'id':_0x28a7f1[_0xf901('0x70')]['ids']}});})[_0xf901('0x27')](function(_0x4bfb4d){socket[_0xf901('0xb6')](_0xf901('0xb7'),{'id':Number(_0x28a7f1[_0xf901('0xa5')]['id']),'tags':_0x4bfb4d||[]});return{'id':Number(_0x28a7f1[_0xf901('0xa5')]['id']),'tags':_0x4bfb4d||[]};});}})[_0xf901('0x27')](respondWithResult(_0x305e25,null))[_0xf901('0x30')](handleError(_0x305e25,null));};exports[_0xf901('0xb8')]=function(_0x237bdf,_0xca5967,_0x3fdeef){return db[_0xf901('0x32')]['find']({'where':{'id':_0x237bdf[_0xf901('0xa5')]['id']}})[_0xf901('0x27')](handleEntityNotFound(_0xca5967,null))[_0xf901('0x27')](function(_0x49c567){if(_0x49c567){return _0x49c567[_0xf901('0xb8')](_0x237bdf[_0xf901('0x37')][_0xf901('0xaf')]);}})[_0xf901('0x27')](respondWithStatusCode(_0xca5967,null))[_0xf901('0x30')](handleError(_0xca5967,null));};exports['download']=function(_0x5a5871,_0x44cbc3){var _0x3d2e22=moment()[_0xf901('0xb9')]()['toString']();var _0x5917b7=path[_0xf901('0xba')](config[_0xf901('0xbb')],_0xf901('0xbc'),'files','attachments');var _0x4828e1=path[_0xf901('0xba')](config[_0xf901('0xbb')],_0xf901('0xbc'),_0xf901('0xbd'),_0xf901('0xbe'));var _0x5f535f=path[_0xf901('0xba')](_0x4828e1,_0x3d2e22);var _0x1a0211=util['format'](_0xf901('0xbf'),_0x3d2e22);var _0x11fb3f=path[_0xf901('0xba')](_0x4828e1,_0x1a0211);var _0x39d0e5=![];return db['FaxInteraction'][_0xf901('0x5d')]({'where':{'id':_0x5a5871[_0xf901('0xa5')]['id']}})[_0xf901('0x27')](handleEntityNotFound(_0x44cbc3,null))[_0xf901('0x27')](function(_0x116209){if(_0x116209){return _0x116209[_0xf901('0xb0')]({'attributes':['id',_0xf901('0x70'),_0xf901('0xc0')],'include':[{'model':db[_0xf901('0xc1')],'as':_0xf901('0xc1')}]});}return[];})[_0xf901('0x27')](function(_0x3ce730){_0x39d0e5=_0x3ce730['length'];if(_0x3ce730[_0xf901('0x3e')]){fs[_0xf901('0xc2')](_0x5f535f);for(var _0x99f924=0x0;_0x99f924<_0x3ce730[_0xf901('0x3e')];_0x99f924++){var _0x7d4689=_0x3ce730[_0x99f924];var _0x3a3d71=_0x7d4689[_0xf901('0xc1')];if(_0x3a3d71){var _0x1bf53f=path[_0xf901('0xba')](_0x5917b7,_0x3a3d71[_0xf901('0xc3')]);if(fs[_0xf901('0xc4')](_0x1bf53f)){fs[_0xf901('0xc5')](_0x1bf53f)[_0xf901('0xc6')](fs[_0xf901('0xc7')](path['join'](_0x5f535f,_0x3a3d71[_0xf901('0xc3')])));}}}}})[_0xf901('0x27')](function(){if(_0x39d0e5){return new BPromise(function(_0x5eef08,_0x5407cc){zipdir(_0x5f535f,{'saveTo':_0x11fb3f},function(_0x4109ca,_0x2cec69){if(_0x4109ca)return _0x5407cc(_0x4109ca);return _0x5eef08(_0x2cec69);});});}})['then'](function(){if(_0x39d0e5){return new BPromise(function(_0x4effb2,_0x61eddd){rimraf(_0x5f535f,function(_0x5b6fd5){if(_0x5b6fd5)_0x61eddd(_0x5b6fd5);return _0x4effb2();});});}})[_0xf901('0x27')](function(){if(_0x39d0e5){return _0x44cbc3[_0xf901('0xc8')](_0x11fb3f,_0x1a0211,function(_0x3bcbed){if(_0x3bcbed){console['log'](_0xf901('0xc9'),_0x3bcbed);}else{fs[_0xf901('0xca')](_0x11fb3f);}});}else{return _0x44cbc3[_0xf901('0x1b')](0xc8);}})[_0xf901('0x30')](handleError(_0x44cbc3,null));}; \ No newline at end of file +var _0xbb14=['Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','start','type','some','isEmpty','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.fax\x20LIKE\x20?','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','t.id\x20IN\x20?','resolve','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','FaxInteraction','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','FaxInteractionId','all','show','params','includeAll','include','create','body','describe','addMessage','ids','omit','getMessages','findOne','FaxMessage','pick','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','rows','addTags','setTags','spread','Tag','emit','faxInteractionTags:save','removeTags','unix','root','server','files','attachments','join','tmp','interaction-%s.zip','Attachment','mkdirSync','existsSync','createReadStream','pipe','download','log','err','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','ejs','lodash','squel','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','error','stack','name','send','Tags','TagIds','split','forEach','push','catch','index','map','rawAttributes','fieldName','key','query','keys','filters','model','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','select','field','color','from','tools_tags','ui.FaxInteractionId','users','u.id\x20=\x20ui.UserId','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20>\x200'];(function(_0x5296f8,_0x352c97){var _0x202dbb=function(_0x3e4e2c){while(--_0x3e4e2c){_0x5296f8['push'](_0x5296f8['shift']());}};_0x202dbb(++_0x352c97);}(_0xbb14,0x133));var _0x4bb1=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0xbb14[_0x6c993a];return _0x27f547;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4bb1('0x0'));var rimraf=require(_0x4bb1('0x1'));var zipdir=require(_0x4bb1('0x2'));var jsonpatch=require(_0x4bb1('0x3'));var rp=require('request-promise');var moment=require(_0x4bb1('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4bb1('0x5'));var path=require(_0x4bb1('0x6'));var sox=require(_0x4bb1('0x7'));var csv=require('to-csv');var ejs=require(_0x4bb1('0x8'));var fs=require('fs');var _=require(_0x4bb1('0x9'));var squel=require(_0x4bb1('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x4bb1('0xb'));var toCsv=require(_0x4bb1('0xc'));var querystring=require(_0x4bb1('0xd'));var Papa=require('papaparse');var Redis=require(_0x4bb1('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x4bb1('0xf'));var as=require(_0x4bb1('0x10'));var hardwareService=require(_0x4bb1('0x11'));var logger=require(_0x4bb1('0x12'))(_0x4bb1('0x13'));var utils=require('../../config/utils');var config=require(_0x4bb1('0x14'));var db=require(_0x4bb1('0x15'))['db'];config[_0x4bb1('0x16')]=_['defaults'](config[_0x4bb1('0x16')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4bb1('0x16')]));require(_0x4bb1('0x17'))[_0x4bb1('0x18')](socket);function respondWithStatusCode(_0x36be6f,_0x214173){_0x214173=_0x214173||0xcc;return function(_0x36b4b3){if(_0x36b4b3){return _0x36be6f[_0x4bb1('0x19')](_0x214173);}return _0x36be6f[_0x4bb1('0x1a')](_0x214173)[_0x4bb1('0x1b')]();};}function respondWithResult(_0x2ea95b,_0xf3caf3){_0xf3caf3=_0xf3caf3||0xc8;return function(_0x1cf359){if(_0x1cf359){return _0x2ea95b[_0x4bb1('0x1a')](_0xf3caf3)[_0x4bb1('0x1c')](_0x1cf359);}};}function respondWithFilteredResult(_0x101d9e,_0x2acf64){return function(_0x5e047c){if(_0x5e047c){var _0x5ebea9=_0x5e047c[_0x4bb1('0x1d')],_0x18c78c=_0x2acf64[_0x4bb1('0x1e')],_0x426a47=_0x2acf64[_0x4bb1('0x1e')]+_0x2acf64[_0x4bb1('0x1f')],_0x352b4f;if(_0x426a47>=_0x5ebea9){_0x426a47=_0x5ebea9;_0x352b4f=0xc8;}else{_0x352b4f=0xce;}_0x101d9e[_0x4bb1('0x1a')](_0x352b4f);return _0x101d9e['set'](_0x4bb1('0x20'),_0x18c78c+'-'+_0x426a47+'/'+_0x5ebea9)[_0x4bb1('0x1c')](_0x5e047c);}return null;};}function patchUpdates(_0x2b2f61){return function(_0xf71dcf){try{jsonpatch['apply'](_0xf71dcf,_0x2b2f61,!![]);}catch(_0x1c1ba1){return BPromise[_0x4bb1('0x21')](_0x1c1ba1);}return _0xf71dcf[_0x4bb1('0x22')]();};}function saveUpdates(_0x4cab79,_0x88cf4b){return function(_0x3dc45d){if(_0x3dc45d){return _0x3dc45d[_0x4bb1('0x23')](_0x4cab79)[_0x4bb1('0x24')](function(_0x4d8685){return _0x4d8685;});}return null;};}function removeEntity(_0x2fdcfb,_0x4ab168){return function(_0x3717d4){if(_0x3717d4){return _0x3717d4['destroy']()[_0x4bb1('0x24')](function(){_0x2fdcfb[_0x4bb1('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49cf6,_0x4e10c5){return function(_0x2a445b){if(!_0x2a445b){_0x49cf6[_0x4bb1('0x19')](0x194);}return _0x2a445b;};}function handleError(_0x23e0e7,_0x3da55e){_0x3da55e=_0x3da55e||0x1f4;return function(_0x301f2e){logger[_0x4bb1('0x25')](_0x301f2e[_0x4bb1('0x26')]);if(_0x301f2e['name']){delete _0x301f2e[_0x4bb1('0x27')];}_0x23e0e7['status'](_0x3da55e)[_0x4bb1('0x28')](_0x301f2e);};}function getInteractionUsers(_0x3e0969,_0x384f8e){return new BPromise(function(_0x116737,_0x26d244){try{if(_0x384f8e[_0x3e0969['id']]){_0x3e0969['Users']=_['map'](_0x384f8e[_0x3e0969['id']],function(_0x47143e){return{'id':_0x47143e['id']};});}}catch(_0x5e17d3){_0x26d244(_0x5e17d3);}_0x116737(_0x3e0969);});}function getInteractionTags(_0x414ecb,_0x4dedc2){return new BPromise(function(_0x16663e,_0x3f4b5f){try{if(_0x414ecb['TagIds']){_0x414ecb[_0x4bb1('0x29')]=[];_0x414ecb[_0x4bb1('0x2a')][_0x4bb1('0x2b')](',')[_0x4bb1('0x2c')](function(_0x14af50){_0x414ecb[_0x4bb1('0x29')][_0x4bb1('0x2d')](_0x4dedc2[_0x14af50]);});}delete _0x414ecb[_0x4bb1('0x2a')];}catch(_0x63ab1a){_0x3f4b5f(_0x63ab1a);}_0x16663e(_0x414ecb);});}function updateFaxInteraction(_0x5f15b3,_0x20fe44,_0x40f977){return new BPromise(function(_0xba35b2,_0x4c9ea9){return getInteractionUsers(_0x5f15b3,_0x40f977)[_0x4bb1('0x24')](function(_0x1c74c0){return getInteractionTags(_0x1c74c0,_0x20fe44);})[_0x4bb1('0x24')](function(_0x441da8){_0xba35b2(_0x441da8);})[_0x4bb1('0x2e')](function(_0x535563){_0x4c9ea9(_0x535563);});});}exports[_0x4bb1('0x2f')]=function(_0x2e4314,_0x109c0b){var _0x40f576={},_0x10469b={},_0x59f5c8={'count':0x0,'rows':[]};var _0x3c5f5b=_[_0x4bb1('0x30')](db['FaxInteraction'][_0x4bb1('0x31')],function(_0x33b1f9){return{'name':_0x33b1f9[_0x4bb1('0x32')],'type':_0x33b1f9['type'][_0x4bb1('0x33')]};});_0x10469b['model']=_[_0x4bb1('0x30')](_0x3c5f5b,_0x4bb1('0x27'));_0x10469b[_0x4bb1('0x34')]=_[_0x4bb1('0x35')](_0x2e4314[_0x4bb1('0x34')]);_0x10469b[_0x4bb1('0x36')]=_['intersection'](_0x10469b[_0x4bb1('0x37')],_0x10469b[_0x4bb1('0x34')]);_0x40f576['attributes']=_[_0x4bb1('0x38')](_0x10469b[_0x4bb1('0x37')],qs[_0x4bb1('0x39')](_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x39')]));_0x40f576[_0x4bb1('0x3a')]=_0x40f576[_0x4bb1('0x3a')]['length']?_0x40f576[_0x4bb1('0x3a')]:_0x10469b[_0x4bb1('0x37')];if(!_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x3b')](_0x4bb1('0x3c'))){_0x40f576[_0x4bb1('0x1f')]=qs['limit'](_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x1f')]);_0x40f576[_0x4bb1('0x1e')]=qs['offset'](_0x2e4314['query'][_0x4bb1('0x1e')]);}_0x40f576[_0x4bb1('0x3d')]=qs['sort'](_0x2e4314['query'][_0x4bb1('0x3e')]);_0x40f576['where']=qs[_0x4bb1('0x36')](_['pick'](_0x2e4314[_0x4bb1('0x34')],_0x10469b[_0x4bb1('0x36')]));var _0xd4c8b1=[];var _0x5e87ef=squel[_0x4bb1('0x3f')]()[_0x4bb1('0x40')]('id')['field'](_0x4bb1('0x27'))['field'](_0x4bb1('0x41'))[_0x4bb1('0x42')](_0x4bb1('0x43'));var _0x329f18=squel[_0x4bb1('0x3f')]()[_0x4bb1('0x40')]('u.id')[_0x4bb1('0x40')](_0x4bb1('0x44'))[_0x4bb1('0x42')]('user_has_fax_interactions','ui')['left_join'](_0x4bb1('0x45'),'u',_0x4bb1('0x46'));var _0x43d7bc=squel[_0x4bb1('0x3f')]()[_0x4bb1('0x42')]('fax_interactions','i')[_0x4bb1('0x47')]('cm_contacts','c',_0x4bb1('0x48'))[_0x4bb1('0x47')](_0x4bb1('0x45'),'o',_0x4bb1('0x49'))[_0x4bb1('0x47')](_0x4bb1('0x4a'),'a',_0x4bb1('0x4b'))[_0x4bb1('0x47')](_0x4bb1('0x4c'),'me',_0x4bb1('0x4d'))[_0x4bb1('0x47')](_0x4bb1('0x4e'),'it',_0x4bb1('0x4f'))['left_join'](_0x4bb1('0x43'),'t',_0x4bb1('0x50'));var _0x321e11=squel[_0x4bb1('0x51')]();var _0x265929=[];var _0x332015=squel['expr']();var _0x2eeeeb;if(_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x52')]){_0x2eeeeb=as['parseSearch'](_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x52')]);var _0x5102c7=_0x2eeeeb[_0x4bb1('0x53')];for(var _0x36df8a=0x0;_0x36df8a<_0x2eeeeb[_0x4bb1('0x54')][_0x4bb1('0x55')];_0x36df8a++){var _0x2cd82d=_0x2eeeeb['conditions'][_0x36df8a];var _0x4e8db5='i';var _0x154388=_[_0x4bb1('0x56')](_0x3c5f5b,['name',_0x2cd82d[_0x4bb1('0x40')]]);if(!_0x154388){switch(_0x2cd82d[_0x4bb1('0x40')]){case _0x4bb1('0x57'):if(_0x2cd82d[_0x4bb1('0x58')]==0x1){_0x43d7bc[_0x4bb1('0x59')]('`'+_0x2cd82d[_0x4bb1('0x40')]+'`\x20=\x200');}else{_0x43d7bc[_0x4bb1('0x59')]('`'+_0x2cd82d[_0x4bb1('0x40')]+_0x4bb1('0x5a'));}break;case _0x4bb1('0x5b'):if(_0x2cd82d[_0x4bb1('0x5c')]===_0x4bb1('0x5d')){if(_0x2cd82d[_0x4bb1('0x58')]['split']('\x20')[_0x4bb1('0x55')]>0x1){_0x321e11[_0x5102c7](_0x4bb1('0x5e'),qs[_0x4bb1('0x5f')](_0x2cd82d[_0x4bb1('0x58')]),null);}else{var _0x581134='%'+_0x2cd82d['value']+'%';_0x321e11[_0x5102c7](_0x4bb1('0x60'),_0x581134,_0x581134,_0x581134);}}else{_0x154388=_['find'](_0x3c5f5b,[_0x4bb1('0x27'),_0x4bb1('0x61')]);_0x2cd82d[_0x4bb1('0x40')]=_0x4bb1('0x61');_0x11ca60=as[_0x4bb1('0x62')](_0x4e8db5,_0x154388['type'],_0x2cd82d);_0x321e11[_0x5102c7](_0x11ca60['text'],_0x11ca60[_0x4bb1('0x58')]['start'],_0x11ca60[_0x4bb1('0x58')][_0x4bb1('0x1b')]);}break;case'Tag':var _0x3b474a=_0x2cd82d[_0x4bb1('0x58')][_0x4bb1('0x2b')](',')[_0x4bb1('0x30')](function(_0x110b91){return Number(_0x110b91);});_0x3b474a[_0x4bb1('0x2c')](function(_0x38440f){_0x332015['or'](_0x4bb1('0x63'),'%,'+_0x38440f+',%');});_0x265929=_['union'](_0x265929,_0x3b474a);break;case _0x4bb1('0x64'):if(_0x2cd82d['operator']==='$substring'){_0x321e11[_0x5102c7](_0x4bb1('0x65'),'%'+_0x2cd82d[_0x4bb1('0x58')]+'%',null);}else{_0x154388=_[_0x4bb1('0x56')](_0x3c5f5b,[_0x4bb1('0x27'),_0x4bb1('0x66')]);_0x2cd82d['field']='UserId';_0x11ca60=as['buildExpression'](_0x4e8db5,_0x154388['type'],_0x2cd82d);_0x321e11[_0x5102c7](_0x11ca60[_0x4bb1('0x67')],_0x11ca60[_0x4bb1('0x58')]['start'],_0x11ca60[_0x4bb1('0x58')][_0x4bb1('0x1b')]);}break;case'body':_0x11ca60=as[_0x4bb1('0x62')]('me',null,_0x2cd82d);_0x321e11[_0x5102c7](_0x11ca60['text'],_0x11ca60[_0x4bb1('0x58')][_0x4bb1('0x68')],_0x11ca60[_0x4bb1('0x58')]['end']);break;}}else{var _0x11ca60=as[_0x4bb1('0x62')](_0x4e8db5,_0x154388[_0x4bb1('0x69')],_0x2cd82d);_0x321e11[_0x5102c7](_0x11ca60[_0x4bb1('0x67')],_0x11ca60[_0x4bb1('0x58')]['start'],_0x11ca60[_0x4bb1('0x58')]['end']);}}}else{var _0x3a799f=_(_0x2e4314[_0x4bb1('0x34')])['keys']()[_0x4bb1('0x30')](function(_0x4f8aac){return _[_0x4bb1('0x6a')](_0x3c5f5b,['name',_0x4f8aac])?_0x4f8aac:undefined;})['compact']()[_0x4bb1('0x58')]();if(!_[_0x4bb1('0x6b')](_0x3a799f)){_0x3a799f[_0x4bb1('0x2c')](function(_0xc6be75){if(_0xc6be75===_0x4bb1('0x6c')){_0x43d7bc[_0x4bb1('0x6d')](_0x4bb1('0x6e'),[][_0x4bb1('0x6f')](_0x2e4314['query'][_0xc6be75]));}else if(_0xc6be75===_0x4bb1('0x70')){var _0x3c6cd3=JSON['parse'](_0x2e4314[_0x4bb1('0x34')][_0xc6be75])['$gte'];var _0x275d38=JSON[_0x4bb1('0x71')](_0x2e4314['query'][_0xc6be75])['$lte'];_0x43d7bc['where'](_0x4bb1('0x72'),_0x3c6cd3,_0x275d38);}else{if(_0x2e4314[_0x4bb1('0x34')][_0xc6be75]===_0x4bb1('0x73')){_0x43d7bc[_0x4bb1('0x6d')]('i.'+_0xc6be75+'\x20IS\x20NULL');}else{_0x43d7bc[_0x4bb1('0x6d')]('i.'+_0xc6be75+'\x20=\x20?',_0x2e4314[_0x4bb1('0x34')][_0xc6be75]);}}});}if(_0x2e4314[_0x4bb1('0x34')]['read']){if(_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x74')]==0x1){_0x43d7bc[_0x4bb1('0x59')](_0x4bb1('0x75'));}else{_0x43d7bc[_0x4bb1('0x59')](_0x4bb1('0x76'));}}if(_0x2e4314[_0x4bb1('0x34')]['tag']){_0x265929=_[_0x4bb1('0x77')](_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x78')])?_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x78')]:new Array(_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x78')]);_0x265929[_0x4bb1('0x2c')](function(_0x3656b8){_0x332015['or'](_0x4bb1('0x63'),'%,'+_0x3656b8+',%');});}if(_0x2e4314['query'][_0x4bb1('0x79')]){var _0x210620=_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x79')][_0x4bb1('0x7a')]('\x5c','\x5c\x5c')[_0x4bb1('0x7a')]('\x27\x27',_0x4bb1('0x7b'));if(qs[_0x4bb1('0x7c')](_0x210620)){_0x321e11['or']('i.id\x20LIKE\x20?',_0x210620+'%')['or'](_0x4bb1('0x7d'),_0x210620+'%');}_0x321e11['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x210620+'%');}}_0x43d7bc[_0x4bb1('0x6d')](_0x321e11);_0x43d7bc['group'](_0x4bb1('0x7e'));var _0x51f353={'type':db[_0x4bb1('0x7f')][_0x4bb1('0x80')][_0x4bb1('0x81')],'raw':!![]};var _0xb9ed7=_0x43d7bc[_0x4bb1('0x82')]();_0xb9ed7['field'](_0x4bb1('0x7e'));_0xb9ed7[_0x4bb1('0x40')](_0x4bb1('0x83'),_0x4bb1('0x57'));if(_0x40f576[_0x4bb1('0x3d')]){_0x40f576[_0x4bb1('0x3d')][_0x4bb1('0x2c')](function(_0x6c8a69){_0x43d7bc[_0x4bb1('0x3d')]('i.'+_0x6c8a69[0x0],_0x6c8a69[0x1]==='DESC'?![]:!![]);});}if(!_[_0x4bb1('0x6b')](_0x265929)){_0x43d7bc[_0x4bb1('0x59')](_0x332015);_0xb9ed7[_0x4bb1('0x6d')](_0x4bb1('0x84'),_0x265929);}BPromise[_0x4bb1('0x85')]()['then'](function(){if(!_0x2eeeeb&&_0x2e4314[_0x4bb1('0x34')][_0x4bb1('0x6c')])return;return _0x2e4314['user']['getFaxAccounts']({'attributes':['id'],'raw':!![]})[_0x4bb1('0x24')](function(_0x519308){if(_[_0x4bb1('0x6b')](_0x519308)){_0xb9ed7[_0x4bb1('0x6d')]('i.FaxAccountId\x20IS\x20NULL');_0x43d7bc[_0x4bb1('0x6d')](_0x4bb1('0x86'));}else{_0xb9ed7[_0x4bb1('0x6d')](_0x4bb1('0x6e'),_[_0x4bb1('0x30')](_0x519308,'id'));_0x43d7bc[_0x4bb1('0x6d')](_0x4bb1('0x6e'),_['map'](_0x519308,'id'));}});})[_0x4bb1('0x24')](function(){db[_0x4bb1('0x87')][_0x4bb1('0x34')](_0xb9ed7[_0x4bb1('0x88')](),_0x51f353)[_0x4bb1('0x24')](function(_0x521287){_0x59f5c8[_0x4bb1('0x1d')]=_0x521287['length'];if(_0x59f5c8[_0x4bb1('0x1d')]===0x0)return[];return db[_0x4bb1('0x87')][_0x4bb1('0x34')](_0x5e87ef[_0x4bb1('0x88')](),_0x51f353)[_0x4bb1('0x24')](function(_0x1a0e82){_0xd4c8b1=_[_0x4bb1('0x89')](_0x1a0e82,'id');_0x51f353=_[_0x4bb1('0x8a')](_0x51f353,{'model':db[_0x4bb1('0x8b')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x43d7bc[_0x4bb1('0x40')](_0x4bb1('0x83'),_0x4bb1('0x57'));_0x43d7bc[_0x4bb1('0x40')](_0x4bb1('0x8c'),_0x4bb1('0x8d'));_0x43d7bc['field']('a.mandatoryDisposition',_0x4bb1('0x8e'));_0x43d7bc[_0x4bb1('0x40')](_0x4bb1('0x8f'));_0x43d7bc['field'](_0x4bb1('0x90'),_0x4bb1('0x91'));_0x43d7bc[_0x4bb1('0x40')](_0x4bb1('0x92'),'Contact.lastName');_0x43d7bc['field'](_0x4bb1('0x93'),_0x4bb1('0x94'));_0x43d7bc['field'](_0x4bb1('0x95'),'Contact.phone');_0x43d7bc[_0x4bb1('0x40')](_0x4bb1('0x96'),'Contact.mobile');_0x43d7bc[_0x4bb1('0x40')](_0x4bb1('0x97'),_0x4bb1('0x98'));_0x43d7bc[_0x4bb1('0x40')](_0x4bb1('0x99'),'TagIds');_0x43d7bc[_0x4bb1('0x1f')](_0x40f576['limit']);_0x43d7bc['offset'](_0x40f576[_0x4bb1('0x1e')]);return db['sequelize']['query'](_0x43d7bc[_0x4bb1('0x88')](),_0x51f353);})[_0x4bb1('0x24')](function(_0x5e47c3){_0x329f18[_0x4bb1('0x6d')]('ui.FaxInteractionId\x20IN\x20?',_[_0x4bb1('0x30')](_0x5e47c3,'id'));return db[_0x4bb1('0x87')][_0x4bb1('0x34')](_0x329f18[_0x4bb1('0x88')](),_0x51f353)['then'](function(_0x3eceed){var _0x36ae4e=_['groupBy'](_0x3eceed,_0x4bb1('0x9a'));var _0x136035=[];_0x5e47c3[_0x4bb1('0x2c')](function(_0x48148a){_0x136035[_0x4bb1('0x2d')](updateFaxInteraction(_0x48148a,_0xd4c8b1,_0x36ae4e));});return BPromise[_0x4bb1('0x9b')](_0x136035);});});})[_0x4bb1('0x24')](function(_0x1142a8){_0x59f5c8['rows']=_0x1142a8;return _0x59f5c8;})['then'](respondWithFilteredResult(_0x109c0b,_0x40f576));})[_0x4bb1('0x2e')](handleError(_0x109c0b,null));};exports[_0x4bb1('0x9c')]=function(_0x17e3ba,_0x3f0c85){var _0x4b65a3={'raw':![],'where':{'id':_0x17e3ba[_0x4bb1('0x9d')]['id']}},_0x412cbf={};_0x412cbf[_0x4bb1('0x37')]=_[_0x4bb1('0x35')](db[_0x4bb1('0x8b')][_0x4bb1('0x31')]);_0x412cbf[_0x4bb1('0x34')]=_[_0x4bb1('0x35')](_0x17e3ba[_0x4bb1('0x34')]);_0x412cbf['filters']=_[_0x4bb1('0x38')](_0x412cbf[_0x4bb1('0x37')],_0x412cbf[_0x4bb1('0x34')]);_0x4b65a3[_0x4bb1('0x3a')]=_[_0x4bb1('0x38')](_0x412cbf[_0x4bb1('0x37')],qs[_0x4bb1('0x39')](_0x17e3ba[_0x4bb1('0x34')][_0x4bb1('0x39')]));_0x4b65a3[_0x4bb1('0x3a')]=_0x4b65a3[_0x4bb1('0x3a')]['length']?_0x4b65a3[_0x4bb1('0x3a')]:_0x412cbf[_0x4bb1('0x37')];if(_0x17e3ba[_0x4bb1('0x34')][_0x4bb1('0x9e')]){_0x4b65a3[_0x4bb1('0x9f')]=[{'all':!![]}];}_0x4b65a3=_['merge']({},_0x4b65a3,_0x17e3ba['options']);return db['FaxInteraction']['find'](_0x4b65a3)[_0x4bb1('0x24')](handleEntityNotFound(_0x3f0c85,null))[_0x4bb1('0x24')](respondWithResult(_0x3f0c85,null))[_0x4bb1('0x2e')](handleError(_0x3f0c85,null));};exports[_0x4bb1('0xa0')]=function(_0x2330ff,_0x253d54){return db[_0x4bb1('0x8b')]['create'](_0x2330ff[_0x4bb1('0xa1')],{})['then'](respondWithResult(_0x253d54,0xc9))[_0x4bb1('0x2e')](handleError(_0x253d54,null));};exports[_0x4bb1('0x23')]=function(_0x33bdb2,_0x43dc0f){if(_0x33bdb2['body']['id']){delete _0x33bdb2[_0x4bb1('0xa1')]['id'];}return db[_0x4bb1('0x8b')]['find']({'where':{'id':_0x33bdb2['params']['id']}})[_0x4bb1('0x24')](handleEntityNotFound(_0x43dc0f,null))[_0x4bb1('0x24')](saveUpdates(_0x33bdb2['body'],null))['then'](respondWithResult(_0x43dc0f,null))[_0x4bb1('0x2e')](handleError(_0x43dc0f,null));};exports['destroy']=function(_0x5c7bf4,_0xcba402){return db[_0x4bb1('0x8b')][_0x4bb1('0x56')]({'where':{'id':_0x5c7bf4['params']['id']}})[_0x4bb1('0x24')](handleEntityNotFound(_0xcba402,null))[_0x4bb1('0x24')](removeEntity(_0xcba402,null))[_0x4bb1('0x2e')](handleError(_0xcba402,null));};exports[_0x4bb1('0xa2')]=function(_0x2d74a1,_0x532e58){return db[_0x4bb1('0x8b')][_0x4bb1('0xa2')]()[_0x4bb1('0x24')](respondWithResult(_0x532e58,null))[_0x4bb1('0x2e')](handleError(_0x532e58,null));};exports[_0x4bb1('0xa3')]=function(_0x4dd916,_0x36ed5e,_0x1a63cc){return db['FaxMessage'][_0x4bb1('0x56')]({'where':{'id':_0x4dd916[_0x4bb1('0x9d')]['id']}})[_0x4bb1('0x24')](handleEntityNotFound(_0x36ed5e,null))[_0x4bb1('0x24')](function(_0x184283){if(_0x184283){return _0x184283[_0x4bb1('0xa3')](_0x4dd916[_0x4bb1('0xa1')][_0x4bb1('0xa4')],_[_0x4bb1('0xa5')](_0x4dd916['body'],[_0x4bb1('0xa4'),'id'])||{});}})[_0x4bb1('0x24')](respondWithResult(_0x36ed5e,null))[_0x4bb1('0x2e')](handleError(_0x36ed5e,null));};exports[_0x4bb1('0xa6')]=function(_0x259baa,_0x1a2dbe,_0x46ce39){var _0x1b7b94={'raw':![],'where':{}};var _0x7680f3={};var _0x2c18a6={'count':0x0,'rows':[]};return db[_0x4bb1('0x8b')][_0x4bb1('0xa7')]({'where':{'id':_0x259baa[_0x4bb1('0x9d')]['id']}})[_0x4bb1('0x24')](handleEntityNotFound(_0x1a2dbe,null))[_0x4bb1('0x24')](function(_0x5edc4f){if(_0x5edc4f){_0x7680f3[_0x4bb1('0x37')]=_['keys'](db[_0x4bb1('0xa8')][_0x4bb1('0x31')]);_0x7680f3[_0x4bb1('0x34')]=_[_0x4bb1('0x35')](_0x259baa['query']);_0x7680f3['filters']=_[_0x4bb1('0x38')](_0x7680f3[_0x4bb1('0x37')],_0x7680f3[_0x4bb1('0x34')]);_0x1b7b94['attributes']=_[_0x4bb1('0x38')](_0x7680f3[_0x4bb1('0x37')],qs[_0x4bb1('0x39')](_0x259baa[_0x4bb1('0x34')]['fields']));_0x1b7b94[_0x4bb1('0x3a')]=_0x1b7b94['attributes'][_0x4bb1('0x55')]?_0x1b7b94[_0x4bb1('0x3a')]:_0x7680f3[_0x4bb1('0x37')];if(!_0x259baa[_0x4bb1('0x34')]['hasOwnProperty'](_0x4bb1('0x3c'))){_0x1b7b94[_0x4bb1('0x1f')]=qs['limit'](_0x259baa['query'][_0x4bb1('0x1f')]);_0x1b7b94[_0x4bb1('0x1e')]=qs[_0x4bb1('0x1e')](_0x259baa[_0x4bb1('0x34')]['offset']);}_0x1b7b94[_0x4bb1('0x3d')]=qs[_0x4bb1('0x3e')](_0x259baa['query'][_0x4bb1('0x3e')]);_0x1b7b94[_0x4bb1('0x6d')]=qs[_0x4bb1('0x36')](_[_0x4bb1('0xa9')](_0x259baa['query'],_0x7680f3[_0x4bb1('0x36')]));_0x1b7b94['where']['FaxInteractionId']=_0x5edc4f['id'];if(_0x259baa[_0x4bb1('0x34')]['filter']){_0x1b7b94['where']=_[_0x4bb1('0x8a')](_0x1b7b94[_0x4bb1('0x6d')],{'$or':_[_0x4bb1('0x30')](_0x1b7b94['attributes'],function(_0x282450){var _0x30bf81={};_0x30bf81[_0x282450]={'$like':'%'+_0x259baa[_0x4bb1('0x34')][_0x4bb1('0x79')]+'%'};return _0x30bf81;})});}if(_0x259baa['query']['$gte']){var _0x55077b=_0x259baa[_0x4bb1('0x34')]['$gte'][_0x4bb1('0x2b')](',');var _0x489f2d={};_0x489f2d[_0x55077b[0x0]]={'$gte':moment(_0x55077b[0x1])[_0x4bb1('0xaa')](_0x4bb1('0xab'))};_0x1b7b94[_0x4bb1('0x6d')]=_[_0x4bb1('0x8a')](_0x1b7b94[_0x4bb1('0x6d')],_0x489f2d);}_0x1b7b94=_['merge']({},_0x1b7b94,_0x259baa[_0x4bb1('0xac')]);return db[_0x4bb1('0xa8')][_0x4bb1('0x1d')]({'where':_0x1b7b94[_0x4bb1('0x6d')]})[_0x4bb1('0x24')](function(_0x59d93f){_0x2c18a6[_0x4bb1('0x1d')]=_0x59d93f;if(_0x259baa[_0x4bb1('0x34')][_0x4bb1('0x9e')]){_0x1b7b94[_0x4bb1('0x9f')]=[{'all':!![]}];}return db[_0x4bb1('0xa8')][_0x4bb1('0xad')](_0x1b7b94);})[_0x4bb1('0x24')](function(_0x48e254){_0x2c18a6[_0x4bb1('0xae')]=_0x48e254;return _0x2c18a6;});}})[_0x4bb1('0x24')](respondWithFilteredResult(_0x1a2dbe,_0x1b7b94))['catch'](handleError(_0x1a2dbe,null));};exports[_0x4bb1('0xaf')]=function(_0x28f187,_0x3b520b,_0x52d972){return db[_0x4bb1('0x8b')][_0x4bb1('0x56')]({'where':{'id':_0x28f187['params']['id']}})['then'](handleEntityNotFound(_0x3b520b,null))[_0x4bb1('0x24')](function(_0x122f4b){if(_0x122f4b){return _0x122f4b[_0x4bb1('0xb0')](_0x28f187['body']['ids'],_[_0x4bb1('0xa5')](_0x28f187[_0x4bb1('0xa1')],[_0x4bb1('0xa4'),'id'])||{})[_0x4bb1('0xb1')](function(){return db[_0x4bb1('0xb2')]['findAll']({'attributes':['id','name',_0x4bb1('0x41')],'where':{'id':_0x28f187[_0x4bb1('0xa1')]['ids']}});})[_0x4bb1('0x24')](function(_0x51badd){socket[_0x4bb1('0xb3')](_0x4bb1('0xb4'),{'id':Number(_0x28f187['params']['id']),'tags':_0x51badd||[]});return{'id':Number(_0x28f187[_0x4bb1('0x9d')]['id']),'tags':_0x51badd||[]};});}})[_0x4bb1('0x24')](respondWithResult(_0x3b520b,null))[_0x4bb1('0x2e')](handleError(_0x3b520b,null));};exports['removeTags']=function(_0x394507,_0x31c69e,_0x5db4c0){return db[_0x4bb1('0x8b')][_0x4bb1('0x56')]({'where':{'id':_0x394507['params']['id']}})[_0x4bb1('0x24')](handleEntityNotFound(_0x31c69e,null))['then'](function(_0xd58cce){if(_0xd58cce){return _0xd58cce[_0x4bb1('0xb5')](_0x394507[_0x4bb1('0x34')][_0x4bb1('0xa4')]);}})[_0x4bb1('0x24')](respondWithStatusCode(_0x31c69e,null))[_0x4bb1('0x2e')](handleError(_0x31c69e,null));};exports['download']=function(_0x2fde9a,_0x3fbe3c){var _0x5fa18e=moment()[_0x4bb1('0xb6')]()[_0x4bb1('0x88')]();var _0x20a156=path['join'](config[_0x4bb1('0xb7')],_0x4bb1('0xb8'),_0x4bb1('0xb9'),_0x4bb1('0xba'));var _0x1716c0=path[_0x4bb1('0xbb')](config[_0x4bb1('0xb7')],_0x4bb1('0xb8'),_0x4bb1('0xb9'),_0x4bb1('0xbc'));var _0x43c150=path[_0x4bb1('0xbb')](_0x1716c0,_0x5fa18e);var _0x11eb8b=util[_0x4bb1('0xaa')](_0x4bb1('0xbd'),_0x5fa18e);var _0x4c5013=path[_0x4bb1('0xbb')](_0x1716c0,_0x11eb8b);var _0x540155=![];return db[_0x4bb1('0x8b')][_0x4bb1('0x56')]({'where':{'id':_0x2fde9a[_0x4bb1('0x9d')]['id']}})['then'](handleEntityNotFound(_0x3fbe3c,null))[_0x4bb1('0x24')](function(_0x49899f){if(_0x49899f){return _0x49899f[_0x4bb1('0xa6')]({'attributes':['id',_0x4bb1('0xa1'),'createdAt'],'include':[{'model':db[_0x4bb1('0xbe')],'as':_0x4bb1('0xbe')}]});}return[];})['then'](function(_0x39c8b0){_0x540155=_0x39c8b0[_0x4bb1('0x55')];if(_0x39c8b0[_0x4bb1('0x55')]){fs[_0x4bb1('0xbf')](_0x43c150);for(var _0x5611c6=0x0;_0x5611c6<_0x39c8b0[_0x4bb1('0x55')];_0x5611c6++){var _0x3efea1=_0x39c8b0[_0x5611c6];var _0x5ac4c3=_0x3efea1['Attachment'];if(_0x5ac4c3){var _0x1f4ce4=path[_0x4bb1('0xbb')](_0x20a156,_0x5ac4c3['basename']);if(fs[_0x4bb1('0xc0')](_0x1f4ce4)){fs[_0x4bb1('0xc1')](_0x1f4ce4)[_0x4bb1('0xc2')](fs['createWriteStream'](path[_0x4bb1('0xbb')](_0x43c150,_0x5ac4c3['basename'])));}}}}})[_0x4bb1('0x24')](function(){if(_0x540155){return new BPromise(function(_0x42c161,_0x3861a4){zipdir(_0x43c150,{'saveTo':_0x4c5013},function(_0x373949,_0x4e79f5){if(_0x373949)return _0x3861a4(_0x373949);return _0x42c161(_0x4e79f5);});});}})[_0x4bb1('0x24')](function(){if(_0x540155){return new BPromise(function(_0x3100c9,_0x19e702){rimraf(_0x43c150,function(_0x6961ac){if(_0x6961ac)_0x19e702(_0x6961ac);return _0x3100c9();});});}})[_0x4bb1('0x24')](function(){if(_0x540155){return _0x3fbe3c[_0x4bb1('0xc3')](_0x4c5013,_0x11eb8b,function(_0x29693e){if(_0x29693e){console[_0x4bb1('0xc4')](_0x4bb1('0xc5'),_0x29693e);}else{fs[_0x4bb1('0xc6')](_0x4c5013);}});}else{return _0x3fbe3c[_0x4bb1('0x19')](0xc8);}})[_0x4bb1('0x2e')](handleError(_0x3fbe3c,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 7f22061..f2500de 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 _0xc4aa=['unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','getUsers','then','setDataValue','findAll'];(function(_0x3c6ae2,_0x5c52d8){var _0x4edda=function(_0x5593eb){while(--_0x5593eb){_0x3c6ae2['push'](_0x3c6ae2['shift']());}};_0x4edda(++_0x5c52d8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0xc4aa[_0x21549c];return _0x426cbd;};'use strict';var EventEmitter=require(_0xac4a('0x0'));var FaxInteraction=require(_0xac4a('0x1'))['db'][_0xac4a('0x2')];var FaxMessage=require(_0xac4a('0x1'))['db'][_0xac4a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xac4a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f48ed){return function(_0x15b967,_0x730a38,_0x215f39){_0x15b967[_0xac4a('0x5')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x6')](function(_0x3ef77c){_0x15b967[_0xac4a('0x7')]('Users',_0x3ef77c['map'](function(_0x1aba6d){return{'id':_0x1aba6d['id']};}));return FaxMessage[_0xac4a('0x8')]({'where':{'FaxInteractionId':_0x15b967['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac4a('0x6')](function(_0x4f4146){_0x15b967[_0xac4a('0x7')](_0xac4a('0x9'),_0x4f4146[_0xac4a('0xa')]);FaxInteractionEvents['emit'](_0x2f48ed+':'+_0x15b967['id'],_0x15b967);FaxInteractionEvents[_0xac4a('0xb')](_0x2f48ed,_0x15b967);_0x215f39(null);})['catch'](_0x215f39(null));};}for(var e in events){if(events[_0xac4a('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xac4a('0xd')]=FaxInteractionEvents; \ No newline at end of file +var _0xadb5=['update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty','exports','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x31f2e4,_0x5ad5ac){var _0x44e761=function(_0x5120c3){while(--_0x5120c3){_0x31f2e4['push'](_0x31f2e4['shift']());}};_0x44e761(++_0x5ad5ac);}(_0xadb5,0xad));var _0x5adb=function(_0x500fb4,_0xa3b059){_0x500fb4=_0x500fb4-0x0;var _0x25420e=_0xadb5[_0x500fb4];return _0x25420e;};'use strict';var EventEmitter=require('events');var FaxInteraction=require(_0x5adb('0x0'))['db']['FaxInteraction'];var FaxMessage=require(_0x5adb('0x0'))['db'][_0x5adb('0x1')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x5adb('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x5adb('0x3'),'afterDestroy':_0x5adb('0x4')};function emitEvent(_0x2e3ef4){return function(_0x4cb1d1,_0x35a5d3,_0x168d89){_0x4cb1d1[_0x5adb('0x5')]({'attributes':['id'],'raw':!![]})[_0x5adb('0x6')](function(_0xdf3776){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0x8'),_0xdf3776[_0x5adb('0x9')](function(_0x41261c){return{'id':_0x41261c['id']};}));return FaxMessage[_0x5adb('0xa')]({'where':{'FaxInteractionId':_0x4cb1d1['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5adb('0x6')](function(_0x336bad){_0x4cb1d1[_0x5adb('0x7')](_0x5adb('0xb'),_0x336bad['length']);FaxInteractionEvents['emit'](_0x2e3ef4+':'+_0x4cb1d1['id'],_0x4cb1d1);FaxInteractionEvents[_0x5adb('0xc')](_0x2e3ef4,_0x4cb1d1);_0x168d89(null);})[_0x5adb('0xd')](_0x168d89(null));};}for(var e in events){if(events[_0x5adb('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x5adb('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index d24599c..8b6e131 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 _0x71f0=['YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','bluebird','request-promise','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','format'];(function(_0x295811,_0x2825f4){var _0x147146=function(_0x939636){while(--_0x939636){_0x295811['push'](_0x295811['shift']());}};_0x147146(++_0x2825f4);}(_0x71f0,0x81));var _0x071f=function(_0x565fed,_0xb85768){_0x565fed=_0x565fed-0x0;var _0x3e018f=_0x71f0[_0x565fed];return _0x3e018f;};'use strict';var _=require(_0x071f('0x0'));var util=require(_0x071f('0x1'));var logger=require(_0x071f('0x2'))(_0x071f('0x3'));var moment=require('moment');var BPromise=require(_0x071f('0x4'));var rp=require(_0x071f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x071f('0x6'));var attributes=require(_0x071f('0x7'));module[_0x071f('0x8')]=function(_0x4100cc,_0x56951a){return _0x4100cc[_0x071f('0x9')](_0x071f('0xa'),attributes,{'tableName':_0x071f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2a2b87,_0x3d3025,_0x55213a){if(_0x2a2b87[_0x071f('0xc')](_0x071f('0xd'))){_0x2a2b87['closedAt']=moment()[_0x071f('0xe')](_0x071f('0xf'));}_0x55213a(null,_0x2a2b87);}}});}; \ No newline at end of file +var _0xaab1=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format'];(function(_0x5dc455,_0x1ea6b4){var _0x107b1b=function(_0x3129ed){while(--_0x3129ed){_0x5dc455['push'](_0x5dc455['shift']());}};_0x107b1b(++_0x1ea6b4);}(_0xaab1,0x169));var _0x1aab=function(_0x4667b0,_0x3718e5){_0x4667b0=_0x4667b0-0x0;var _0x541df4=_0xaab1[_0x4667b0];return _0x541df4;};'use strict';var _=require(_0x1aab('0x0'));var util=require(_0x1aab('0x1'));var logger=require(_0x1aab('0x2'))(_0x1aab('0x3'));var moment=require(_0x1aab('0x4'));var BPromise=require(_0x1aab('0x5'));var rp=require(_0x1aab('0x6'));var fs=require('fs');var path=require(_0x1aab('0x7'));var rimraf=require(_0x1aab('0x8'));var config=require(_0x1aab('0x9'));var attributes=require(_0x1aab('0xa'));module[_0x1aab('0xb')]=function(_0x4869e4,_0x52d62d){return _0x4869e4[_0x1aab('0xc')](_0x1aab('0xd'),attributes,{'tableName':_0x1aab('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x52906a,_0xd8494b,_0x497816){if(_0x52906a[_0x1aab('0xf')](_0x1aab('0x10'))){_0x52906a[_0x1aab('0x11')]=moment()[_0x1aab('0x12')]('YYYY-MM-DD\x20HH:mm:ss');}_0x497816(null,_0x52906a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index c01aab5..78e41bc 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 _0x8b17=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','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','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','where','attributes','AddTagsToFaxInteraction','ids','omit','spread','AddTags','util'];(function(_0x212331,_0x439af9){var _0x8fc62=function(_0x14a334){while(--_0x14a334){_0x212331['push'](_0x212331['shift']());}};_0x8fc62(++_0x439af9);}(_0x8b17,0x1ad));var _0x78b1=function(_0xf1d26c,_0x1463d0){_0xf1d26c=_0xf1d26c-0x0;var _0x11c159=_0x8b17[_0xf1d26c];return _0x11c159;};'use strict';var _=require('lodash');var util=require(_0x78b1('0x0'));var moment=require(_0x78b1('0x1'));var BPromise=require(_0x78b1('0x2'));var rs=require(_0x78b1('0x3'));var fs=require('fs');var Redis=require(_0x78b1('0x4'));var db=require(_0x78b1('0x5'))['db'];var utils=require(_0x78b1('0x6'));var logger=require(_0x78b1('0x7'))('rpc');var config=require(_0x78b1('0x8'));var jayson=require(_0x78b1('0x9'));var client=jayson[_0x78b1('0xa')][_0x78b1('0xb')]({'port':0x232a});config[_0x78b1('0xc')]=_[_0x78b1('0xd')](config[_0x78b1('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x78b1('0xe'))(new Redis(config[_0x78b1('0xc')]));require(_0x78b1('0xf'))[_0x78b1('0x10')](socket);function respondWithRpcPromise(_0x5ed96c,_0x37ab42,_0x586998){return new BPromise(function(_0x3e06b8,_0x1d2ad3){return client[_0x78b1('0x11')](_0x5ed96c,_0x586998)[_0x78b1('0x12')](function(_0x527e88){logger[_0x78b1('0x13')](_0x78b1('0x14'),_0x37ab42,_0x78b1('0x15'));logger[_0x78b1('0x16')](_0x78b1('0x17'),_0x37ab42,_0x78b1('0x15'),JSON[_0x78b1('0x18')](_0x527e88));if(_0x527e88[_0x78b1('0x19')]){if(_0x527e88['error'][_0x78b1('0x1a')]===0x1f4){logger[_0x78b1('0x19')](_0x78b1('0x14'),_0x37ab42,_0x527e88[_0x78b1('0x19')][_0x78b1('0x1b')]);return _0x1d2ad3(_0x527e88[_0x78b1('0x19')][_0x78b1('0x1b')]);}logger[_0x78b1('0x19')](_0x78b1('0x14'),_0x37ab42,_0x527e88[_0x78b1('0x19')]['message']);return _0x3e06b8(_0x527e88[_0x78b1('0x19')][_0x78b1('0x1b')]);}else{logger[_0x78b1('0x13')](_0x78b1('0x14'),_0x37ab42,_0x78b1('0x15'));_0x3e06b8(_0x527e88[_0x78b1('0x1c')]['message']);}})[_0x78b1('0x1d')](function(_0x4bd727){logger[_0x78b1('0x19')]('FaxInteraction,\x20%s,\x20%s',_0x37ab42,_0x4bd727);_0x1d2ad3(_0x4bd727);});});}exports[_0x78b1('0x1e')]=function(_0x4b71c6){var _0x665095=this;return new Promise(function(_0x1607a8,_0x18a2bc){return db[_0x78b1('0x1f')][_0x78b1('0x20')](_0x4b71c6[_0x78b1('0x21')],{'raw':_0x4b71c6[_0x78b1('0x22')]?_0x4b71c6['options'][_0x78b1('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b71c6[_0x78b1('0x22')]?_0x4b71c6[_0x78b1('0x22')][_0x78b1('0x24')]||null:null,'attributes':_0x4b71c6['options']?_0x4b71c6['options'][_0x78b1('0x25')]||null:null,'limit':_0x4b71c6[_0x78b1('0x22')]?_0x4b71c6[_0x78b1('0x22')]['limit']||null:null})[_0x78b1('0x12')](function(_0x1add80){logger['info'](_0x78b1('0x1e'),_0x4b71c6);logger[_0x78b1('0x16')]('UpdateFaxInteraction',_0x4b71c6,JSON[_0x78b1('0x18')](_0x1add80));_0x1607a8(_0x1add80);})['catch'](function(_0x6fcad3){logger[_0x78b1('0x19')](_0x78b1('0x1e'),_0x6fcad3['message'],_0x4b71c6);_0x18a2bc(_0x665095[_0x78b1('0x19')](0x1f4,_0x6fcad3[_0x78b1('0x1b')]));});});};exports[_0x78b1('0x26')]=function(_0x2a545b){return new Promise(function(_0x443333,_0x3e629c){return db[_0x78b1('0x1f')]['find']({'where':_0x2a545b['options']?_0x2a545b['options'][_0x78b1('0x24')]||null:null})['then'](function(_0x1eae3f){if(_0x1eae3f){return _0x1eae3f['addTags'](_0x2a545b['body'][_0x78b1('0x27')],_[_0x78b1('0x28')](_0x2a545b[_0x78b1('0x21')],[_0x78b1('0x27'),'id'])||{});}})[_0x78b1('0x29')](function(_0x42f92e){logger['info'](_0x78b1('0x2a'),_0x2a545b);logger[_0x78b1('0x16')](_0x78b1('0x2a'),_0x2a545b,JSON[_0x78b1('0x18')](_0x42f92e));_0x443333(_0x42f92e);})[_0x78b1('0x1d')](function(_0x113ecb){logger[_0x78b1('0x19')](_0x78b1('0x2a'),_0x113ecb['message'],_0x2a545b);_0x3e629c(_this[_0x78b1('0x19')](0x1f4,_0x113ecb[_0x78b1('0x1b')]));});});}; \ No newline at end of file +var _0xbc58=['attributes','limit','AddTagsToFaxInteraction','find','ids','omit','AddTags','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','where'];(function(_0x3ab392,_0xb5e4fd){var _0x1e0a71=function(_0x183635){while(--_0x183635){_0x3ab392['push'](_0x3ab392['shift']());}};_0x1e0a71(++_0xb5e4fd);}(_0xbc58,0x14f));var _0x8bc5=function(_0xa4f0a8,_0x4846ac){_0xa4f0a8=_0xa4f0a8-0x0;var _0xc00e73=_0xbc58[_0xa4f0a8];return _0xc00e73;};'use strict';var _=require('lodash');var util=require(_0x8bc5('0x0'));var moment=require(_0x8bc5('0x1'));var BPromise=require('bluebird');var rs=require(_0x8bc5('0x2'));var fs=require('fs');var Redis=require(_0x8bc5('0x3'));var db=require(_0x8bc5('0x4'))['db'];var utils=require(_0x8bc5('0x5'));var logger=require('../../config/logger')(_0x8bc5('0x6'));var config=require(_0x8bc5('0x7'));var jayson=require(_0x8bc5('0x8'));var client=jayson[_0x8bc5('0x9')][_0x8bc5('0xa')]({'port':0x232a});config[_0x8bc5('0xb')]=_[_0x8bc5('0xc')](config['redis'],{'host':_0x8bc5('0xd'),'port':0x18eb});var socket=require(_0x8bc5('0xe'))(new Redis(config[_0x8bc5('0xb')]));require(_0x8bc5('0xf'))[_0x8bc5('0x10')](socket);function respondWithRpcPromise(_0xb58776,_0x93fe3f,_0x33e2c7){return new BPromise(function(_0x3dfdc4,_0xb2b138){return client['request'](_0xb58776,_0x33e2c7)[_0x8bc5('0x11')](function(_0x5b884b){logger[_0x8bc5('0x12')](_0x8bc5('0x13'),_0x93fe3f,_0x8bc5('0x14'));logger[_0x8bc5('0x15')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x93fe3f,_0x8bc5('0x14'),JSON[_0x8bc5('0x16')](_0x5b884b));if(_0x5b884b['error']){if(_0x5b884b[_0x8bc5('0x17')][_0x8bc5('0x18')]===0x1f4){logger[_0x8bc5('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x93fe3f,_0x5b884b[_0x8bc5('0x17')]['message']);return _0xb2b138(_0x5b884b['error'][_0x8bc5('0x19')]);}logger[_0x8bc5('0x17')](_0x8bc5('0x13'),_0x93fe3f,_0x5b884b[_0x8bc5('0x17')][_0x8bc5('0x19')]);return _0x3dfdc4(_0x5b884b[_0x8bc5('0x17')]['message']);}else{logger[_0x8bc5('0x12')](_0x8bc5('0x13'),_0x93fe3f,_0x8bc5('0x14'));_0x3dfdc4(_0x5b884b[_0x8bc5('0x1a')]['message']);}})[_0x8bc5('0x1b')](function(_0x18a39f){logger[_0x8bc5('0x17')](_0x8bc5('0x13'),_0x93fe3f,_0x18a39f);_0xb2b138(_0x18a39f);});});}exports[_0x8bc5('0x1c')]=function(_0x214ec6){var _0x18c2e7=this;return new Promise(function(_0x450784,_0x5e8a4a){return db[_0x8bc5('0x1d')][_0x8bc5('0x1e')](_0x214ec6[_0x8bc5('0x1f')],{'raw':_0x214ec6[_0x8bc5('0x20')]?_0x214ec6[_0x8bc5('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x214ec6[_0x8bc5('0x20')]?_0x214ec6[_0x8bc5('0x20')][_0x8bc5('0x21')]||null:null,'attributes':_0x214ec6[_0x8bc5('0x20')]?_0x214ec6[_0x8bc5('0x20')][_0x8bc5('0x22')]||null:null,'limit':_0x214ec6[_0x8bc5('0x20')]?_0x214ec6['options'][_0x8bc5('0x23')]||null:null})[_0x8bc5('0x11')](function(_0x3b08ae){logger[_0x8bc5('0x12')](_0x8bc5('0x1c'),_0x214ec6);logger['debug'](_0x8bc5('0x1c'),_0x214ec6,JSON[_0x8bc5('0x16')](_0x3b08ae));_0x450784(_0x3b08ae);})[_0x8bc5('0x1b')](function(_0x4dc1f5){logger[_0x8bc5('0x17')](_0x8bc5('0x1c'),_0x4dc1f5[_0x8bc5('0x19')],_0x214ec6);_0x5e8a4a(_0x18c2e7['error'](0x1f4,_0x4dc1f5[_0x8bc5('0x19')]));});});};exports[_0x8bc5('0x24')]=function(_0x5f1c03){return new Promise(function(_0x1f883e,_0x43a1fa){return db[_0x8bc5('0x1d')][_0x8bc5('0x25')]({'where':_0x5f1c03['options']?_0x5f1c03[_0x8bc5('0x20')][_0x8bc5('0x21')]||null:null})[_0x8bc5('0x11')](function(_0xc351ec){if(_0xc351ec){return _0xc351ec['addTags'](_0x5f1c03[_0x8bc5('0x1f')][_0x8bc5('0x26')],_[_0x8bc5('0x27')](_0x5f1c03[_0x8bc5('0x1f')],[_0x8bc5('0x26'),'id'])||{});}})['spread'](function(_0x4ee423){logger[_0x8bc5('0x12')](_0x8bc5('0x28'),_0x5f1c03);logger['debug']('AddTags',_0x5f1c03,JSON[_0x8bc5('0x16')](_0x4ee423));_0x1f883e(_0x4ee423);})[_0x8bc5('0x1b')](function(_0x4b0c71){logger[_0x8bc5('0x17')]('AddTags',_0x4b0c71[_0x8bc5('0x19')],_0x5f1c03);_0x43a1fa(_this[_0x8bc5('0x17')](0x1f4,_0x4b0c71[_0x8bc5('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index 9b460ed..50c42b7 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 _0xd2ce=['length','faxInteraction:','./faxInteraction.events','save','remove','update','emit','removeListener','register'];(function(_0x229d7e,_0x5bc489){var _0xa78280=function(_0x59850e){while(--_0x59850e){_0x229d7e['push'](_0x229d7e['shift']());}};_0xa78280(++_0x5bc489);}(_0xd2ce,0x13d));var _0xed2c=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0xd2ce[_0x34021d];return _0x16597b;};'use strict';var FaxInteractionEvents=require(_0xed2c('0x0'));var events=[_0xed2c('0x1'),_0xed2c('0x2'),_0xed2c('0x3')];function createListener(_0x15fdb1,_0x2c68cf){return function(_0x3465c8){_0x2c68cf[_0xed2c('0x4')](_0x15fdb1,_0x3465c8);};}function removeListener(_0x252547,_0x3a0cd8){return function(){FaxInteractionEvents[_0xed2c('0x5')](_0x252547,_0x3a0cd8);};}exports[_0xed2c('0x6')]=function(_0x211d39){for(var _0x8171cc=0x0,_0x35063b=events[_0xed2c('0x7')];_0x8171cc<_0x35063b;_0x8171cc++){var _0x125a93=events[_0x8171cc];var _0x13af25=createListener(_0xed2c('0x8')+_0x125a93,_0x211d39);FaxInteractionEvents['on'](_0x125a93,_0x13af25);}}; \ No newline at end of file +var _0xfe3d=['register','faxInteraction:','./faxInteraction.events','remove','update','removeListener'];(function(_0x4db875,_0x1b1d6c){var _0x207828=function(_0x53001c){while(--_0x53001c){_0x4db875['push'](_0x4db875['shift']());}};_0x207828(++_0x1b1d6c);}(_0xfe3d,0x14c));var _0xdfe3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xfe3d[_0x19e35c];return _0x3e1fe8;};'use strict';var FaxInteractionEvents=require(_0xdfe3('0x0'));var events=['save',_0xdfe3('0x1'),_0xdfe3('0x2')];function createListener(_0x44d5db,_0x9e06a5){return function(_0x4defe2){_0x9e06a5['emit'](_0x44d5db,_0x4defe2);};}function removeListener(_0x4c5d0f,_0xec98e4){return function(){FaxInteractionEvents[_0xdfe3('0x3')](_0x4c5d0f,_0xec98e4);};}exports[_0xdfe3('0x4')]=function(_0xa7a094){for(var _0x4c16ce=0x0,_0x196115=events['length'];_0x4c16ce<_0x196115;_0x4c16ce++){var _0xe2b7bd=events[_0x4c16ce];var _0x1cae83=createListener(_0xdfe3('0x5')+_0xe2b7bd,_0xa7a094);FaxInteractionEvents['on'](_0xe2b7bd,_0x1cae83);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 28c2824..f1ce43c 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 _0xf351=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','tracked','addTags','put','fax','faxinteraction:update','delete','faxinteraction:destroy','destroy'];(function(_0x4664d0,_0x38eefe){var _0x363ab5=function(_0x5270c6){while(--_0x5270c6){_0x4664d0['push'](_0x4664d0['shift']());}};_0x363ab5(++_0x38eefe);}(_0xf351,0x1a5));var _0x1f35=function(_0x2bcd1f,_0x4f1972){_0x2bcd1f=_0x2bcd1f-0x0;var _0x2381ca=_0xf351[_0x2bcd1f];return _0x2381ca;};'use strict';var multer=require(_0x1f35('0x0'));var util=require(_0x1f35('0x1'));var path=require(_0x1f35('0x2'));var timeout=require(_0x1f35('0x3'));var express=require(_0x1f35('0x4'));var router=express[_0x1f35('0x5')]();var auth=require(_0x1f35('0x6'));var interaction=require(_0x1f35('0x7'));var config=require(_0x1f35('0x8'));var controller=require(_0x1f35('0x9'));router[_0x1f35('0xa')]('/',auth[_0x1f35('0xb')](),controller['index']);router[_0x1f35('0xa')](_0x1f35('0xc'),auth[_0x1f35('0xb')](),controller[_0x1f35('0xd')]);router[_0x1f35('0xa')](_0x1f35('0xe'),auth[_0x1f35('0xb')](),controller['show']);router[_0x1f35('0xa')](_0x1f35('0xf'),auth[_0x1f35('0xb')](),controller[_0x1f35('0x10')]);router[_0x1f35('0xa')](_0x1f35('0x11'),auth[_0x1f35('0xb')](),controller[_0x1f35('0x12')]);router[_0x1f35('0x13')]('/',auth[_0x1f35('0xb')](),controller[_0x1f35('0x14')]);router['post'](_0x1f35('0xf'),auth[_0x1f35('0xb')](),controller['addMessage']);router['post']('/:id/tags',auth['isAuthenticated'](),interaction[_0x1f35('0x15')]('fax','faxinteraction:addtags'),controller[_0x1f35('0x16')]);router[_0x1f35('0x17')](_0x1f35('0xe'),auth[_0x1f35('0xb')](),interaction[_0x1f35('0x15')](_0x1f35('0x18'),_0x1f35('0x19')),controller['update']);router[_0x1f35('0x1a')]('/:id',auth[_0x1f35('0xb')](),interaction['tracked'](_0x1f35('0x18'),_0x1f35('0x1b')),controller[_0x1f35('0x1c')]);router[_0x1f35('0x1a')]('/:id/tags',auth[_0x1f35('0xb')](),controller['removeTags']);module[_0x1f35('0x1d')]=router; \ No newline at end of file +var _0x6a55=['path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','create','/:id/messages','/:id/tags','tracked','fax','faxinteraction:addtags','addTags','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer'];(function(_0xb6e43,_0x1568fc){var _0x47c40f=function(_0x107786){while(--_0x107786){_0xb6e43['push'](_0xb6e43['shift']());}};_0x47c40f(++_0x1568fc);}(_0x6a55,0x154));var _0x56a5=function(_0x32cce8,_0x18762f){_0x32cce8=_0x32cce8-0x0;var _0x4a732b=_0x6a55[_0x32cce8];return _0x4a732b;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require(_0x56a5('0x1'));var timeout=require(_0x56a5('0x2'));var express=require('express');var router=express[_0x56a5('0x3')]();var auth=require(_0x56a5('0x4'));var interaction=require(_0x56a5('0x5'));var config=require(_0x56a5('0x6'));var controller=require(_0x56a5('0x7'));router[_0x56a5('0x8')]('/',auth[_0x56a5('0x9')](),controller[_0x56a5('0xa')]);router[_0x56a5('0x8')](_0x56a5('0xb'),auth[_0x56a5('0x9')](),controller[_0x56a5('0xc')]);router[_0x56a5('0x8')](_0x56a5('0xd'),auth['isAuthenticated'](),controller[_0x56a5('0xe')]);router[_0x56a5('0x8')]('/:id/messages',auth[_0x56a5('0x9')](),controller['getMessages']);router['get'](_0x56a5('0xf'),auth[_0x56a5('0x9')](),controller[_0x56a5('0x10')]);router[_0x56a5('0x11')]('/',auth[_0x56a5('0x9')](),controller[_0x56a5('0x12')]);router[_0x56a5('0x11')](_0x56a5('0x13'),auth[_0x56a5('0x9')](),controller['addMessage']);router[_0x56a5('0x11')](_0x56a5('0x14'),auth['isAuthenticated'](),interaction[_0x56a5('0x15')](_0x56a5('0x16'),_0x56a5('0x17')),controller[_0x56a5('0x18')]);router['put'](_0x56a5('0xd'),auth[_0x56a5('0x9')](),interaction[_0x56a5('0x15')](_0x56a5('0x16'),_0x56a5('0x19')),controller[_0x56a5('0x1a')]);router[_0x56a5('0x1b')](_0x56a5('0xd'),auth[_0x56a5('0x9')](),interaction['tracked']('fax',_0x56a5('0x1c')),controller['destroy']);router[_0x56a5('0x1b')](_0x56a5('0x14'),auth[_0x56a5('0x9')](),controller[_0x56a5('0x1d')]);module[_0x56a5('0x1e')]=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index dcb5dc9..ed5da37 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 _0xb4f6=['exports','TEXT','BOOLEAN','ENUM','DATE','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xb4f6,0x16d));var _0x6b4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb4f6[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x6b4f('0x0'));module[_0x6b4f('0x1')]={'body':{'type':Sequelize[_0x6b4f('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x6b4f('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x6b4f('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0x6b4f('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0x6b4f('0x5')]}}; \ No newline at end of file +var _0x5cea=['out','DATE','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x139b22,_0x5f28b8){var _0x14f737=function(_0x495609){while(--_0x495609){_0x139b22['push'](_0x139b22['shift']());}};_0x14f737(++_0x5f28b8);}(_0x5cea,0x122));var _0xa5ce=function(_0x385792,_0xc861cd){_0x385792=_0x385792-0x0;var _0x40ce2e=_0x5cea[_0x385792];return _0x40ce2e;};'use strict';var Sequelize=require(_0xa5ce('0x0'));module[_0xa5ce('0x1')]={'body':{'type':Sequelize[_0xa5ce('0x2')](_0xa5ce('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xa5ce('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xa5ce('0x5')]('in','out'),'defaultValue':_0xa5ce('0x6'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xa5ce('0x2')],'defaultValue':null},'readAt':{'type':Sequelize[_0xa5ce('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index 3d29d07..54a5071 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 _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file +var _0xb10b=['read1stAt','interaction','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','manual','interface','channel','EventManager','acceptmessage','fax','agent','FaxInteractionId','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','create','Attachment','findOne','AttachmentId','SendFax','FaxAccountId','/var/opt/motion2/server/files/attachments/%s','basename','join','root','server','attachments','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','sendStatus','end','status','json','count','limit','Content-Range','apply','reject','update','stack','name','send','index','FaxMessage','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','includeAll','include','find','body','destroy','describe','fax-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','FaxInteraction','isNil'];(function(_0x5299e0,_0x5c1ef9){var _0x2c0a75=function(_0x54447b){while(--_0x54447b){_0x5299e0['push'](_0x5299e0['shift']());}};_0x2c0a75(++_0x5c1ef9);}(_0xb10b,0x12a));var _0xbb10=function(_0x3d6d80,_0x1689b7){_0x3d6d80=_0x3d6d80-0x0;var _0x30712a=_0xb10b[_0x3d6d80];return _0x30712a;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');var _=require(_0xbb10('0xb'));var squel=require('squel');var crypto=require(_0xbb10('0xc'));var jsforce=require(_0xbb10('0xd'));var deskjs=require(_0xbb10('0xe'));var toCsv=require(_0xbb10('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./faxMessage.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232c});var client9002=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x24a57b,_0x36b5e8,_0x3e26f4){if(_0x3e26f4){var _0x2b184e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2b184e['test'](_0x36b5e8)){return _0x24a57b;}else{throw new db[(_0xbb10('0x20'))][(_0xbb10('0x21'))](_0xbb10('0x22'));}}else{return _0x24a57b;}}function respondWithRpcPromise(_0x42db98,_0x378da8,_0x1682a4,_0x575cca){return new BPromise(function(_0x30efc6,_0xbf2906){var _0xe1c665=_0x575cca||client;return _0xe1c665['request'](_0x42db98,_0x1682a4)[_0xbb10('0x23')](function(_0x19f48d){logger[_0xbb10('0x24')](_0xbb10('0x25'),_0x378da8,_0xbb10('0x26'));logger[_0xbb10('0x27')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'),JSON[_0xbb10('0x28')](_0x19f48d));if(_0x19f48d['error']){if(_0x19f48d['error'][_0xbb10('0x29')]===0x1f4){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0xbf2906(_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x19f48d[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x30efc6(_0x19f48d[_0xbb10('0x2a')]['message']);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x378da8,_0xbb10('0x26'));_0x30efc6(_0x19f48d[_0xbb10('0x2c')][_0xbb10('0x2b')]);}})['catch'](function(_0x2fdde9){logger[_0xbb10('0x2a')](_0xbb10('0x25'),_0x378da8,_0x2fdde9);_0xbf2906(_0x2fdde9);});});}function respondWithStatusCode(_0x1d5e95,_0x1acce9){_0x1acce9=_0x1acce9||0xcc;return function(_0x20d946){if(_0x20d946){return _0x1d5e95[_0xbb10('0x2d')](_0x1acce9);}return _0x1d5e95['status'](_0x1acce9)[_0xbb10('0x2e')]();};}function respondWithResult(_0x21ac54,_0xfc3595){_0xfc3595=_0xfc3595||0xc8;return function(_0x2e0249){if(_0x2e0249){return _0x21ac54[_0xbb10('0x2f')](_0xfc3595)[_0xbb10('0x30')](_0x2e0249);}};}function respondWithFilteredResult(_0x5d5c80,_0x221624){return function(_0x4ee02e){if(_0x4ee02e){var _0x448d5c=_0x4ee02e[_0xbb10('0x31')],_0x56f2da=_0x221624['offset'],_0x16ad2a=_0x221624['offset']+_0x221624[_0xbb10('0x32')],_0x1dcc9c;if(_0x16ad2a>=_0x448d5c){_0x16ad2a=_0x448d5c;_0x1dcc9c=0xc8;}else{_0x1dcc9c=0xce;}_0x5d5c80[_0xbb10('0x2f')](_0x1dcc9c);return _0x5d5c80['set'](_0xbb10('0x33'),_0x56f2da+'-'+_0x16ad2a+'/'+_0x448d5c)[_0xbb10('0x30')](_0x4ee02e);}return null;};}function patchUpdates(_0x2f653f){return function(_0x1c0b57){try{jsonpatch[_0xbb10('0x34')](_0x1c0b57,_0x2f653f,!![]);}catch(_0x138bc6){return BPromise[_0xbb10('0x35')](_0x138bc6);}return _0x1c0b57['save']();};}function saveUpdates(_0x25acb3,_0x1da9c9){return function(_0x441d15){if(_0x441d15){return _0x441d15[_0xbb10('0x36')](_0x25acb3)[_0xbb10('0x23')](function(_0x9de708){return _0x9de708;});}return null;};}function removeEntity(_0x188cbd,_0x10202c){return function(_0x3c8d7d){if(_0x3c8d7d){return _0x3c8d7d['destroy']()[_0xbb10('0x23')](function(){_0x188cbd[_0xbb10('0x2f')](0xcc)[_0xbb10('0x2e')]();});}};}function handleEntityNotFound(_0x3c3c45,_0x570f5a){return function(_0x111762){if(!_0x111762){_0x3c3c45['sendStatus'](0x194);}return _0x111762;};}function handleError(_0x4e2754,_0x3eb3cc){_0x3eb3cc=_0x3eb3cc||0x1f4;return function(_0x40c164){logger[_0xbb10('0x2a')](_0x40c164[_0xbb10('0x37')]);if(_0x40c164[_0xbb10('0x38')]){delete _0x40c164[_0xbb10('0x38')];}_0x4e2754['status'](_0x3eb3cc)[_0xbb10('0x39')](_0x40c164);};}exports[_0xbb10('0x3a')]=function(_0x52de31,_0x5e3fbd){var _0x5cd55f={},_0x31bee3={},_0x2b0b45={'count':0x0,'rows':[]};var _0x2b658a=_['map'](db[_0xbb10('0x3b')][_0xbb10('0x3c')],function(_0x4345f3){return{'name':_0x4345f3['fieldName'],'type':_0x4345f3[_0xbb10('0x3d')][_0xbb10('0x3e')]};});_0x31bee3[_0xbb10('0x3f')]=_[_0xbb10('0x40')](_0x2b658a,'name');_0x31bee3[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x52de31['query']);_0x31bee3[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x31bee3[_0xbb10('0x3f')],_0x31bee3[_0xbb10('0x41')]);_0x5cd55f[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x31bee3['model'],qs[_0xbb10('0x46')](_0x52de31[_0xbb10('0x41')][_0xbb10('0x46')]));_0x5cd55f[_0xbb10('0x45')]=_0x5cd55f['attributes'][_0xbb10('0x47')]?_0x5cd55f[_0xbb10('0x45')]:_0x31bee3[_0xbb10('0x3f')];if(!_0x52de31[_0xbb10('0x41')]['hasOwnProperty'](_0xbb10('0x48'))){_0x5cd55f[_0xbb10('0x32')]=qs['limit'](_0x52de31['query'][_0xbb10('0x32')]);_0x5cd55f['offset']=qs[_0xbb10('0x49')](_0x52de31[_0xbb10('0x41')]['offset']);}_0x5cd55f[_0xbb10('0x4a')]=qs[_0xbb10('0x4b')](_0x52de31[_0xbb10('0x41')]['sort']);_0x5cd55f[_0xbb10('0x4c')]=qs[_0xbb10('0x43')](_[_0xbb10('0x4d')](_0x52de31[_0xbb10('0x41')],_0x31bee3[_0xbb10('0x43')]));if(_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]){_0x5cd55f[_0xbb10('0x4c')]=_[_0xbb10('0x4f')](_0x5cd55f[_0xbb10('0x4c')],{'$or':_[_0xbb10('0x40')](_0x2b658a,function(_0x1eadd2){if(_0x1eadd2['type']!==_0xbb10('0x50')){var _0x41bbf8={};_0x41bbf8[_0x1eadd2['name']]={'$like':'%'+_0x52de31[_0xbb10('0x41')][_0xbb10('0x4e')]+'%'};return _0x41bbf8;}})});}_0x5cd55f=_[_0xbb10('0x4f')]({},_0x5cd55f,_0x52de31[_0xbb10('0x51')]);var _0x41ea91={'where':_0x5cd55f[_0xbb10('0x4c')]};return db[_0xbb10('0x3b')]['count'](_0x41ea91)['then'](function(_0xcb3354){_0x2b0b45[_0xbb10('0x31')]=_0xcb3354;if(_0x52de31[_0xbb10('0x41')]['includeAll']){_0x5cd55f['include']=[{'all':!![]}];}return db[_0xbb10('0x3b')][_0xbb10('0x52')](_0x5cd55f);})[_0xbb10('0x23')](function(_0xf820fe){_0x2b0b45[_0xbb10('0x53')]=_0xf820fe;return _0x2b0b45;})[_0xbb10('0x23')](respondWithFilteredResult(_0x5e3fbd,_0x5cd55f))[_0xbb10('0x54')](handleError(_0x5e3fbd,null));};exports[_0xbb10('0x55')]=function(_0x2626d8,_0x3d7e7e){var _0x550111={'raw':!![],'where':{'id':_0x2626d8[_0xbb10('0x56')]['id']}},_0x5eafac={};_0x5eafac[_0xbb10('0x3f')]=_[_0xbb10('0x42')](db[_0xbb10('0x3b')][_0xbb10('0x3c')]);_0x5eafac[_0xbb10('0x41')]=_[_0xbb10('0x42')](_0x2626d8[_0xbb10('0x41')]);_0x5eafac[_0xbb10('0x43')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],_0x5eafac[_0xbb10('0x41')]);_0x550111[_0xbb10('0x45')]=_[_0xbb10('0x44')](_0x5eafac[_0xbb10('0x3f')],qs['fields'](_0x2626d8[_0xbb10('0x41')]['fields']));_0x550111[_0xbb10('0x45')]=_0x550111[_0xbb10('0x45')][_0xbb10('0x47')]?_0x550111[_0xbb10('0x45')]:_0x5eafac[_0xbb10('0x3f')];if(_0x2626d8[_0xbb10('0x41')][_0xbb10('0x57')]){_0x550111[_0xbb10('0x58')]=[{'all':!![]}];}_0x550111=_[_0xbb10('0x4f')]({},_0x550111,_0x2626d8[_0xbb10('0x51')]);return db[_0xbb10('0x3b')][_0xbb10('0x59')](_0x550111)[_0xbb10('0x23')](handleEntityNotFound(_0x3d7e7e,null))[_0xbb10('0x23')](respondWithResult(_0x3d7e7e,null))[_0xbb10('0x54')](handleError(_0x3d7e7e,null));};exports['update']=function(_0x4571b6,_0x466eb7){if(_0x4571b6[_0xbb10('0x5a')]['id']){delete _0x4571b6[_0xbb10('0x5a')]['id'];}return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x4571b6['params']['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x466eb7,null))[_0xbb10('0x23')](saveUpdates(_0x4571b6[_0xbb10('0x5a')],null))[_0xbb10('0x23')](respondWithResult(_0x466eb7,null))[_0xbb10('0x54')](handleError(_0x466eb7,null));};exports[_0xbb10('0x5b')]=function(_0x175872,_0x12ec18){return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x175872[_0xbb10('0x56')]['id']}})[_0xbb10('0x23')](handleEntityNotFound(_0x12ec18,null))[_0xbb10('0x23')](removeEntity(_0x12ec18,null))['catch'](handleError(_0x12ec18,null));};exports['describe']=function(_0x16272d,_0x3e6338){return db[_0xbb10('0x3b')][_0xbb10('0x5c')]()['then'](respondWithResult(_0x3e6338,null))['catch'](handleError(_0x3e6338,null));};var interaction_log=require(_0xbb10('0x15'))(_0xbb10('0x5d'));exports[_0xbb10('0x5e')]=function(_0x2dd150,_0x412f13,_0x3e9753){var _0x45c0dc={'channel':'fax'};if(_0x2dd150[_0xbb10('0x5a')]['id']){delete _0x2dd150[_0xbb10('0x5a')]['id'];}_0x2dd150['body']['read']=!![];_0x2dd150['body'][_0xbb10('0x5f')]=moment()[_0xbb10('0x60')](_0xbb10('0x61'));_0x2dd150['body']['UserId']=_0x2dd150['body'][_0xbb10('0x62')]||_0x2dd150[_0xbb10('0x63')]['id'];return db[_0xbb10('0x3b')]['find']({'where':{'id':_0x2dd150[_0xbb10('0x56')]['id'],'UserId':null},'include':[{'model':db[_0xbb10('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](saveUpdates(_0x2dd150[_0xbb10('0x5a')],null))[_0xbb10('0x23')](function(_0x237246){if(_0x237246){_0x45c0dc['message']=_0x237246[_0xbb10('0x65')]({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x237246['FaxInteractionId']}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0x412f13,null))[_0xbb10('0x23')](function(_0x3e3617){if(_0x3e3617){return _0x3e3617['update']({'UserId':_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x62')],'read1stAt':_[_0xbb10('0x67')](_0x3e3617[_0xbb10('0x68')])?moment()['format'](_0xbb10('0x61')):undefined});}return null;})[_0xbb10('0x23')](function(_0x108e5b){if(_0x108e5b){_0x45c0dc[_0xbb10('0x69')]=_0x108e5b['get']({'plain':!![]});interaction_log[_0xbb10('0x24')](_0xbb10('0x6a'),_0x2dd150[_0xbb10('0x63')]['id'],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')],_0x2dd150[_0xbb10('0x63')][_0xbb10('0x6b')],_0x45c0dc['interaction']['id'],_0x2dd150['body']?JSON['stringify'](_0x2dd150[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x6d'),'acceptMessage',_0x45c0dc);}return null;})['then'](function(_0x46f462){if(_0x46f462){if(_0x2dd150[_0xbb10('0x5a')][_0xbb10('0x6e')]){_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x2dd150[_0xbb10('0x63')][_0xbb10('0x38')]);_0x45c0dc[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x45c0dc[_0xbb10('0x70')];_0x45c0dc['message']['event']='accept';return respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':_0xbb10('0x72'),'message':_0x45c0dc[_0xbb10('0x2b')]},client9002)[_0xbb10('0x23')](function(){return _0x45c0dc;});}return _0x45c0dc;}return null;})[_0xbb10('0x23')](respondWithResult(_0x412f13,null))['catch'](handleError(_0x412f13,null));};var interaction_log=require(_0xbb10('0x15'))('fax-interactions');exports['reject']=function(_0x519a54,_0xdf634f,_0x13040d){var _0x23b1d5={'agent':{},'channel':_0xbb10('0x73')};if(_0x519a54['body']['id']){delete _0x519a54[_0xbb10('0x5a')]['id'];}_0x519a54['body']['UserId']=_0x519a54[_0xbb10('0x5a')][_0xbb10('0x62')]||_0x519a54[_0xbb10('0x63')]['id'];_0x23b1d5[_0xbb10('0x74')]['id']=_0x519a54[_0xbb10('0x5a')]['UserId'];return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x519a54[_0xbb10('0x56')]['id'],'UserId':null}})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x27f42f){if(_0x27f42f){_0x23b1d5[_0xbb10('0x2b')]=_0x27f42f['get']({'plain':!![]});return db[_0xbb10('0x66')][_0xbb10('0x59')]({'where':{'id':_0x27f42f[_0xbb10('0x75')]}});}return null;})[_0xbb10('0x23')](handleEntityNotFound(_0xdf634f,null))[_0xbb10('0x23')](function(_0x172be3){if(_0x172be3){_0x23b1d5[_0xbb10('0x69')]=_0x172be3[_0xbb10('0x65')]({'plain':!![]});interaction_log['info'](_0xbb10('0x76'),_0x519a54[_0xbb10('0x63')]['id'],_0x519a54[_0xbb10('0x63')]['name'],_0x519a54['user']['role'],_0x23b1d5[_0xbb10('0x69')]['id'],_0x519a54['body']?JSON['stringify'](_0x519a54[_0xbb10('0x5a')]):_0xbb10('0x6c'));return respondWithRpcPromise(_0xbb10('0x77'),_0xbb10('0x78'),_0x23b1d5);}return null;})[_0xbb10('0x23')](function(_0x24dca6){if(_0x24dca6){_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x6f')]=util[_0xbb10('0x60')]('SIP/%s',_0x519a54[_0xbb10('0x63')][_0xbb10('0x38')]);_0x24dca6[_0xbb10('0x2b')][_0xbb10('0x70')]=_0x23b1d5['channel'];_0x24dca6['message'][_0xbb10('0x79')]=_0xbb10('0x35');respondWithRpcPromise(_0xbb10('0x71'),_0xbb10('0x71'),{'event':'rejectmessage','message':_0x24dca6[_0xbb10('0x2b')]},client9002);return _0x23b1d5;}return null;})[_0xbb10('0x23')](respondWithResult(_0xdf634f,null))[_0xbb10('0x54')](handleError(_0xdf634f,null));};exports[_0xbb10('0x7a')]=function(_0x35c1e8,_0x517185){var _0x5f0691;return db[_0xbb10('0x3b')][_0xbb10('0x7a')](_0x35c1e8[_0xbb10('0x5a')],{})['then'](function(_0x256b35){_0x5f0691=_0x256b35;return db[_0xbb10('0x64')]['findOne']({'where':{'id':_0x5f0691['ContactId']}});})[_0xbb10('0x23')](function(_0x26d0dd){if(_[_0xbb10('0x67')](_0x26d0dd)){return;}else{_0x5f0691['fax']=_0x26d0dd[_0xbb10('0x73')];return db[_0xbb10('0x7b')][_0xbb10('0x7c')]({'where':{'id':_0x5f0691[_0xbb10('0x7d')]}});}})[_0xbb10('0x23')](function(_0x5de006){return respondWithRpcPromise(_0xbb10('0x7e'),_0xbb10('0x7e'),{'FaxAccountId':_[_0xbb10('0x67')](_0x35c1e8['body'])?undefined:_0x35c1e8[_0xbb10('0x5a')][_0xbb10('0x7f')],'path':_[_0xbb10('0x67')](_0x5de006)?undefined:util[_0xbb10('0x60')](_0xbb10('0x80'),_0x5de006[_0xbb10('0x81')]),'fax':_[_0xbb10('0x67')](_0x5f0691[_0xbb10('0x73')])?undefined:_0x5f0691[_0xbb10('0x73')],'AttachmentId':_0x5f0691[_0xbb10('0x7d')]},client9002);})[_0xbb10('0x23')](respondWithResult(_0x517185,0xc9))[_0xbb10('0x54')](handleError(_0x517185,null));};exports['download']=function(_0x51f106,_0xe1fc51){var _0x3fa344=path[_0xbb10('0x82')](config[_0xbb10('0x83')],_0xbb10('0x84'),'files',_0xbb10('0x85'));return db[_0xbb10('0x3b')][_0xbb10('0x59')]({'where':{'id':_0x51f106[_0xbb10('0x56')]['id']},'include':[{'model':db[_0xbb10('0x7b')],'as':_0xbb10('0x7b')}]})['then'](handleEntityNotFound(_0xe1fc51,null))[_0xbb10('0x23')](function(_0x742e10){if(_0x742e10){return _0xe1fc51['download'](path[_0xbb10('0x82')](_0x3fa344,_0x742e10['Attachment'][_0xbb10('0x81')]));}})[_0xbb10('0x54')](handleError(_0xe1fc51,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 113a3b2..4f396f2 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 _0x7217=['emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0xccf869,_0x2556a5){var _0x21a9db=function(_0xcc4835){while(--_0xcc4835){_0xccf869['push'](_0xccf869['shift']());}};_0x21a9db(++_0x2556a5);}(_0x7217,0x19e));var _0x7721=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x7217[_0x37c22c];return _0x119d79;};'use strict';var EventEmitter=require(_0x7721('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7721('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){FaxMessageEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);FaxMessageEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];FaxMessage[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=FaxMessageEvents; \ No newline at end of file +var _0x5fc3=['events','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x5fc3,0xa8));var _0x35fc=function(_0x1ae4a9,_0x4c0ed9){_0x1ae4a9=_0x1ae4a9-0x0;var _0x54d0b0=_0x5fc3[_0x1ae4a9];return _0x54d0b0;};'use strict';var EventEmitter=require(_0x35fc('0x0'));var FaxMessage=require(_0x35fc('0x1'))['db']['FaxMessage'];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x35fc('0x2')](0x0);var events={'afterCreate':_0x35fc('0x3'),'afterUpdate':_0x35fc('0x4'),'afterDestroy':_0x35fc('0x5')};function emitEvent(_0xb4f9ce){return function(_0x5e75e6,_0x2d1404,_0x1d5fec){FaxMessageEvents[_0x35fc('0x6')](_0xb4f9ce+':'+_0x5e75e6['id'],_0x5e75e6);FaxMessageEvents['emit'](_0xb4f9ce,_0x5e75e6);_0x1d5fec(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxMessage[_0x35fc('0x7')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 261f171..489ad3c 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 _0x4723=['direction','toLowerCase','out','isNil','FaxInteraction','findOne','FaxInteractionId','update','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','bluebird','path','rimraf','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','FULLTEXT','models','get'];(function(_0x11ca2d,_0x57bdb7){var _0x3e51da=function(_0x3caa53){while(--_0x3caa53){_0x11ca2d['push'](_0x11ca2d['shift']());}};_0x3e51da(++_0x57bdb7);}(_0x4723,0x1b3));var _0x3472=function(_0x40f470,_0x3a5975){_0x40f470=_0x40f470-0x0;var _0x46ce5f=_0x4723[_0x40f470];return _0x46ce5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3472('0x0'))(_0x3472('0x1'));var moment=require(_0x3472('0x2'));var BPromise=require(_0x3472('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3472('0x4'));var rimraf=require(_0x3472('0x5'));var config=require('../../config/environment');var attributes=require(_0x3472('0x6'));module[_0x3472('0x7')]=function(_0x258afa,_0xda9a95){return _0x258afa[_0x3472('0x8')](_0x3472('0x9'),attributes,{'tableName':_0x3472('0xa'),'paranoid':![],'indexes':[{'name':_0x3472('0xb'),'fields':['body'],'type':_0x3472('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5bbd0e,_0x142110,_0x445527){var _0xf16d5e=_0x258afa[_0x3472('0xd')];var _0xa83def=_0x5bbd0e[_0x3472('0xe')]({'plain':!![]});if(_0xa83def[_0x3472('0xf')][_0x3472('0x10')]()==='in'||_0xa83def[_0x3472('0xf')]['toLowerCase']()===_0x3472('0x11')&&!_0xa83def['secret']&&!_[_0x3472('0x12')](_0xa83def['UserId'])){_0xf16d5e[_0x3472('0x13')][_0x3472('0x14')]({'where':{'id':_0xa83def[_0x3472('0x15')]}})['then'](function(_0x27a741){if(_0x27a741){_0x27a741[_0x3472('0x16')]({'lastMsgAt':_0xa83def['createdAt'],'lastMsgDirection':_0xa83def[_0x3472('0xf')]['toLowerCase']()});}})['catch'](function(_0x2fa8a1){console['error'](_0x2fa8a1);});}_0x445527();}},'charset':_0x3472('0x17'),'collate':_0x3472('0x18')});}; \ No newline at end of file +var _0x36f3=['utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','get','toLowerCase','direction','out','FaxInteraction','findOne','FaxInteractionId','then','update','catch','error'];(function(_0x40251a,_0xf5722b){var _0x2baba3=function(_0x6b1c24){while(--_0x6b1c24){_0x40251a['push'](_0x40251a['shift']());}};_0x2baba3(++_0xf5722b);}(_0x36f3,0x1e8));var _0x336f=function(_0x5c5811,_0x3fccf0){_0x5c5811=_0x5c5811-0x0;var _0x4d7bde=_0x36f3[_0x5c5811];return _0x4d7bde;};'use strict';var _=require('lodash');var util=require(_0x336f('0x0'));var logger=require(_0x336f('0x1'))('api');var moment=require(_0x336f('0x2'));var BPromise=require(_0x336f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x336f('0x4'));var rimraf=require(_0x336f('0x5'));var config=require(_0x336f('0x6'));var attributes=require('./faxMessage.attributes');module[_0x336f('0x7')]=function(_0x28bc6c,_0x57117b){return _0x28bc6c[_0x336f('0x8')](_0x336f('0x9'),attributes,{'tableName':_0x336f('0xa'),'paranoid':![],'indexes':[{'name':_0x336f('0xb'),'fields':[_0x336f('0xc')],'type':_0x336f('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3328a4,_0x5d86df,_0x1b472c){var _0x1f7be4=_0x28bc6c['models'];var _0x4ebf54=_0x3328a4[_0x336f('0xe')]({'plain':!![]});if(_0x4ebf54['direction'][_0x336f('0xf')]()==='in'||_0x4ebf54[_0x336f('0x10')]['toLowerCase']()===_0x336f('0x11')&&!_0x4ebf54['secret']&&!_['isNil'](_0x4ebf54['UserId'])){_0x1f7be4[_0x336f('0x12')][_0x336f('0x13')]({'where':{'id':_0x4ebf54[_0x336f('0x14')]}})[_0x336f('0x15')](function(_0x5642b9){if(_0x5642b9){_0x5642b9[_0x336f('0x16')]({'lastMsgAt':_0x4ebf54['createdAt'],'lastMsgDirection':_0x4ebf54[_0x336f('0x10')]['toLowerCase']()});}})[_0x336f('0x17')](function(_0x7b8cb7){console[_0x336f('0x18')](_0x7b8cb7);});}_0x1b472c();}},'charset':_0x336f('0x19'),'collate':_0x336f('0x1a')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 5a7be2b..4f06099 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 _0x0472=['FaxMessage','create','body','options','raw','CreateFaxMessage','where','attributes','UpdateFaxMessage','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','redis','defaults','localhost','./faxMessage.socket','register','request','then','info','request\x20sent','debug','stringify','error','code','FaxMessage,\x20%s,\x20%s','message','result','catch'];(function(_0x1fb679,_0x50618d){var _0x1face5=function(_0x56e18f){while(--_0x56e18f){_0x1fb679['push'](_0x1fb679['shift']());}};_0x1face5(++_0x50618d);}(_0x0472,0x1ad));var _0x2047=function(_0x4d8b77,_0x5e5a6c){_0x4d8b77=_0x4d8b77-0x0;var _0x43dbcd=_0x0472[_0x4d8b77];return _0x43dbcd;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x2047('0x0'));var BPromise=require('bluebird');var rs=require(_0x2047('0x1'));var fs=require('fs');var Redis=require(_0x2047('0x2'));var db=require(_0x2047('0x3'))['db'];var utils=require(_0x2047('0x4'));var logger=require(_0x2047('0x5'))(_0x2047('0x6'));var config=require('../../config/environment');var jayson=require(_0x2047('0x7'));var client=jayson['client'][_0x2047('0x8')]({'port':0x232a});config[_0x2047('0x9')]=_[_0x2047('0xa')](config[_0x2047('0x9')],{'host':_0x2047('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x2047('0x9')]));require(_0x2047('0xc'))[_0x2047('0xd')](socket);function respondWithRpcPromise(_0x2c9fc7,_0x51d76c,_0x5be9fd){return new BPromise(function(_0x22912f,_0x478a72){return client[_0x2047('0xe')](_0x2c9fc7,_0x5be9fd)[_0x2047('0xf')](function(_0x28261b){logger[_0x2047('0x10')]('FaxMessage,\x20%s,\x20%s',_0x51d76c,_0x2047('0x11'));logger[_0x2047('0x12')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x51d76c,'request\x20sent',JSON[_0x2047('0x13')](_0x28261b));if(_0x28261b[_0x2047('0x14')]){if(_0x28261b[_0x2047('0x14')][_0x2047('0x15')]===0x1f4){logger[_0x2047('0x14')](_0x2047('0x16'),_0x51d76c,_0x28261b[_0x2047('0x14')]['message']);return _0x478a72(_0x28261b[_0x2047('0x14')][_0x2047('0x17')]);}logger[_0x2047('0x14')]('FaxMessage,\x20%s,\x20%s',_0x51d76c,_0x28261b[_0x2047('0x14')][_0x2047('0x17')]);return _0x22912f(_0x28261b['error']['message']);}else{logger['info'](_0x2047('0x16'),_0x51d76c,'request\x20sent');_0x22912f(_0x28261b[_0x2047('0x18')][_0x2047('0x17')]);}})[_0x2047('0x19')](function(_0x299043){logger[_0x2047('0x14')]('FaxMessage,\x20%s,\x20%s',_0x51d76c,_0x299043);_0x478a72(_0x299043);});});}exports['CreateFaxMessage']=function(_0x25119d){var _0x2b3690=this;return new Promise(function(_0x475864,_0x568dd1){return db[_0x2047('0x1a')][_0x2047('0x1b')](_0x25119d[_0x2047('0x1c')],{'raw':_0x25119d['options']?_0x25119d[_0x2047('0x1d')][_0x2047('0x1e')]===undefined?!![]:![]:!![]})[_0x2047('0xf')](function(_0x56a7e5){logger['info'](_0x2047('0x1f'),_0x25119d);logger['debug'](_0x2047('0x1f'),_0x25119d,JSON['stringify'](_0x56a7e5));_0x475864(_0x56a7e5);})['catch'](function(_0x5ab4bd){logger['error'](_0x2047('0x1f'),_0x5ab4bd['message'],_0x25119d);_0x568dd1(_0x2b3690[_0x2047('0x14')](0x1f4,_0x5ab4bd[_0x2047('0x17')]));});});};exports['UpdateFaxMessage']=function(_0x45eb96){var _0x49fe01=this;return new Promise(function(_0x25bebf,_0x4f6ac3){return db['FaxMessage']['update'](_0x45eb96[_0x2047('0x1c')],{'raw':_0x45eb96[_0x2047('0x1d')]?_0x45eb96[_0x2047('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x45eb96[_0x2047('0x1d')]?_0x45eb96[_0x2047('0x1d')][_0x2047('0x20')]||null:null,'attributes':_0x45eb96[_0x2047('0x1d')]?_0x45eb96[_0x2047('0x1d')][_0x2047('0x21')]||null:null,'limit':_0x45eb96[_0x2047('0x1d')]?_0x45eb96[_0x2047('0x1d')]['limit']||null:null})[_0x2047('0xf')](function(_0x190788){logger['info']('UpdateFaxMessage',_0x45eb96);logger[_0x2047('0x12')](_0x2047('0x22'),_0x45eb96,JSON[_0x2047('0x13')](_0x190788));_0x25bebf(_0x190788);})[_0x2047('0x19')](function(_0x22b457){logger[_0x2047('0x14')](_0x2047('0x22'),_0x22b457['message'],_0x45eb96);_0x4f6ac3(_0x49fe01['error'](0x1f4,_0x22b457[_0x2047('0x17')]));});});}; \ No newline at end of file +var _0x6a6e=['register','info','request\x20sent','error','code','message','FaxMessage,\x20%s,\x20%s','result','catch','create','options','then','CreateFaxMessage','debug','stringify','FaxMessage','update','body','raw','attributes','UpdateFaxMessage','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket'];(function(_0x266bf4,_0x11e8e6){var _0x420ada=function(_0x11b5e9){while(--_0x11b5e9){_0x266bf4['push'](_0x266bf4['shift']());}};_0x420ada(++_0x11e8e6);}(_0x6a6e,0xd3));var _0xe6a6=function(_0x1f2b50,_0x20b570){_0x1f2b50=_0x1f2b50-0x0;var _0x5675c1=_0x6a6e[_0x1f2b50];return _0x5675c1;};'use strict';var _=require('lodash');var util=require(_0xe6a6('0x0'));var moment=require(_0xe6a6('0x1'));var BPromise=require(_0xe6a6('0x2'));var rs=require(_0xe6a6('0x3'));var fs=require('fs');var Redis=require(_0xe6a6('0x4'));var db=require(_0xe6a6('0x5'))['db'];var utils=require(_0xe6a6('0x6'));var logger=require(_0xe6a6('0x7'))('rpc');var config=require(_0xe6a6('0x8'));var jayson=require(_0xe6a6('0x9'));var client=jayson[_0xe6a6('0xa')][_0xe6a6('0xb')]({'port':0x232a});config[_0xe6a6('0xc')]=_[_0xe6a6('0xd')](config[_0xe6a6('0xc')],{'host':_0xe6a6('0xe'),'port':0x18eb});var socket=require(_0xe6a6('0xf'))(new Redis(config[_0xe6a6('0xc')]));require(_0xe6a6('0x10'))[_0xe6a6('0x11')](socket);function respondWithRpcPromise(_0x4ba070,_0x166fae,_0xbf5948){return new BPromise(function(_0x18d80f,_0x2e3879){return client['request'](_0x4ba070,_0xbf5948)['then'](function(_0x2951f2){logger[_0xe6a6('0x12')]('FaxMessage,\x20%s,\x20%s',_0x166fae,_0xe6a6('0x13'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x166fae,'request\x20sent',JSON['stringify'](_0x2951f2));if(_0x2951f2[_0xe6a6('0x14')]){if(_0x2951f2['error'][_0xe6a6('0x15')]===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x166fae,_0x2951f2[_0xe6a6('0x14')]['message']);return _0x2e3879(_0x2951f2[_0xe6a6('0x14')][_0xe6a6('0x16')]);}logger['error'](_0xe6a6('0x17'),_0x166fae,_0x2951f2[_0xe6a6('0x14')][_0xe6a6('0x16')]);return _0x18d80f(_0x2951f2['error']['message']);}else{logger[_0xe6a6('0x12')](_0xe6a6('0x17'),_0x166fae,_0xe6a6('0x13'));_0x18d80f(_0x2951f2[_0xe6a6('0x18')][_0xe6a6('0x16')]);}})[_0xe6a6('0x19')](function(_0x66d1a7){logger['error'](_0xe6a6('0x17'),_0x166fae,_0x66d1a7);_0x2e3879(_0x66d1a7);});});}exports['CreateFaxMessage']=function(_0x3f672a){var _0x113744=this;return new Promise(function(_0x3a6b34,_0x1fa7ff){return db['FaxMessage'][_0xe6a6('0x1a')](_0x3f672a['body'],{'raw':_0x3f672a[_0xe6a6('0x1b')]?_0x3f672a['options']['raw']===undefined?!![]:![]:!![]})[_0xe6a6('0x1c')](function(_0x333e66){logger[_0xe6a6('0x12')](_0xe6a6('0x1d'),_0x3f672a);logger[_0xe6a6('0x1e')](_0xe6a6('0x1d'),_0x3f672a,JSON[_0xe6a6('0x1f')](_0x333e66));_0x3a6b34(_0x333e66);})[_0xe6a6('0x19')](function(_0x574074){logger[_0xe6a6('0x14')](_0xe6a6('0x1d'),_0x574074[_0xe6a6('0x16')],_0x3f672a);_0x1fa7ff(_0x113744[_0xe6a6('0x14')](0x1f4,_0x574074[_0xe6a6('0x16')]));});});};exports['UpdateFaxMessage']=function(_0x5f1878){var _0x5b74f9=this;return new Promise(function(_0x22855c,_0x11b169){return db[_0xe6a6('0x20')][_0xe6a6('0x21')](_0x5f1878[_0xe6a6('0x22')],{'raw':_0x5f1878[_0xe6a6('0x1b')]?_0x5f1878['options'][_0xe6a6('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f1878[_0xe6a6('0x1b')]?_0x5f1878['options']['where']||null:null,'attributes':_0x5f1878['options']?_0x5f1878['options'][_0xe6a6('0x24')]||null:null,'limit':_0x5f1878[_0xe6a6('0x1b')]?_0x5f1878[_0xe6a6('0x1b')]['limit']||null:null})[_0xe6a6('0x1c')](function(_0xf459f2){logger[_0xe6a6('0x12')]('UpdateFaxMessage',_0x5f1878);logger['debug'](_0xe6a6('0x25'),_0x5f1878,JSON['stringify'](_0xf459f2));_0x22855c(_0xf459f2);})[_0xe6a6('0x19')](function(_0x1ed155){logger[_0xe6a6('0x14')](_0xe6a6('0x25'),_0x1ed155[_0xe6a6('0x16')],_0x5f1878);_0x11b169(_0x5b74f9[_0xe6a6('0x14')](0x1f4,_0x1ed155[_0xe6a6('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index b1c4498..d09d066 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(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'use strict';var FaxMessageEvents=require(_0x0a9e('0x0'));var events=[_0x0a9e('0x1'),_0x0a9e('0x2'),'update'];function createListener(_0x550fbc,_0x18d5c9){return function(_0x4ce2f1){_0x18d5c9[_0x0a9e('0x3')](_0x550fbc,_0x4ce2f1);};}function removeListener(_0x432180,_0x2ab90b){return function(){FaxMessageEvents[_0x0a9e('0x4')](_0x432180,_0x2ab90b);};}exports[_0x0a9e('0x5')]=function(_0x57b080){for(var _0x219af0=0x0,_0x441e3a=events[_0x0a9e('0x6')];_0x219af0<_0x441e3a;_0x219af0++){var _0x5f41ea=events[_0x219af0];var _0x503809=createListener(_0x0a9e('0x7')+_0x5f41ea,_0x57b080);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 66f6103..aff8399 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 _0xf742=['/:id/reject','reject','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','fax','create','put','update','/:id/accept','accept'];(function(_0x21f336,_0x1f93a3){var _0x568ce3=function(_0x2a965c){while(--_0x2a965c){_0x21f336['push'](_0x21f336['shift']());}};_0x568ce3(++_0x1f93a3);}(_0xf742,0x75));var _0x2f74=function(_0x1d02ee,_0x38b58d){_0x1d02ee=_0x1d02ee-0x0;var _0x3eddef=_0xf742[_0x1d02ee];return _0x3eddef;};'use strict';var multer=require('multer');var util=require(_0x2f74('0x0'));var path=require(_0x2f74('0x1'));var timeout=require('connect-timeout');var express=require(_0x2f74('0x2'));var router=express[_0x2f74('0x3')]();var auth=require(_0x2f74('0x4'));var interaction=require(_0x2f74('0x5'));var config=require(_0x2f74('0x6'));var controller=require(_0x2f74('0x7'));router['get']('/',auth[_0x2f74('0x8')](),controller[_0x2f74('0x9')]);router[_0x2f74('0xa')](_0x2f74('0xb'),auth[_0x2f74('0x8')](),controller[_0x2f74('0xc')]);router[_0x2f74('0xa')](_0x2f74('0xd'),auth[_0x2f74('0x8')](),controller[_0x2f74('0xe')]);router['get']('/:id/download',auth[_0x2f74('0x8')](),controller['download']);router[_0x2f74('0xf')]('/',auth[_0x2f74('0x8')](),interaction[_0x2f74('0x10')](_0x2f74('0x11'),'faxmessage:create'),controller[_0x2f74('0x12')]);router[_0x2f74('0x13')](_0x2f74('0xd'),auth[_0x2f74('0x8')](),controller[_0x2f74('0x14')]);router[_0x2f74('0x13')](_0x2f74('0x15'),auth[_0x2f74('0x8')](),controller[_0x2f74('0x16')]);router['put'](_0x2f74('0x17'),auth['isAuthenticated'](),controller[_0x2f74('0x18')]);router[_0x2f74('0x19')](_0x2f74('0xd'),auth[_0x2f74('0x8')](),controller[_0x2f74('0x1a')]);module[_0x2f74('0x1b')]=router; \ No newline at end of file +var _0x1ff7=['put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./faxMessage.controller','get','isAuthenticated','describe','show','/:id/download','tracked','fax','create'];(function(_0x3f187b,_0x1333f9){var _0x2ba71f=function(_0x5e9124){while(--_0x5e9124){_0x3f187b['push'](_0x3f187b['shift']());}};_0x2ba71f(++_0x1333f9);}(_0x1ff7,0x189));var _0x71ff=function(_0x300921,_0x28775b){_0x300921=_0x300921-0x0;var _0x4333a1=_0x1ff7[_0x300921];return _0x4333a1;};'use strict';var multer=require(_0x71ff('0x0'));var util=require(_0x71ff('0x1'));var path=require('path');var timeout=require(_0x71ff('0x2'));var express=require(_0x71ff('0x3'));var router=express['Router']();var auth=require(_0x71ff('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x71ff('0x5'));var controller=require(_0x71ff('0x6'));router[_0x71ff('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x71ff('0x7')]('/describe',auth[_0x71ff('0x8')](),controller[_0x71ff('0x9')]);router[_0x71ff('0x7')]('/:id',auth[_0x71ff('0x8')](),controller[_0x71ff('0xa')]);router['get'](_0x71ff('0xb'),auth['isAuthenticated'](),controller['download']);router['post']('/',auth[_0x71ff('0x8')](),interaction[_0x71ff('0xc')](_0x71ff('0xd'),'faxmessage:create'),controller[_0x71ff('0xe')]);router[_0x71ff('0xf')](_0x71ff('0x10'),auth['isAuthenticated'](),controller[_0x71ff('0x11')]);router[_0x71ff('0xf')](_0x71ff('0x12'),auth[_0x71ff('0x8')](),controller['accept']);router['put'](_0x71ff('0x13'),auth['isAuthenticated'](),controller[_0x71ff('0x14')]);router[_0x71ff('0x15')](_0x71ff('0x10'),auth[_0x71ff('0x8')](),controller[_0x71ff('0x16')]);module[_0x71ff('0x17')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 0ac3f06..06a6226 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 _0x80fa=['rrmemory','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x1747aa,_0x416485){var _0x38d865=function(_0x361bc4){while(--_0x361bc4){_0x1747aa['push'](_0x1747aa['shift']());}};_0x38d865(++_0x416485);}(_0x80fa,0x18a));var _0xa80f=function(_0x199849,_0x50c17f){_0x199849=_0x199849-0x0;var _0x105e92=_0x80fa[_0x199849];return _0x105e92;};'use strict';var Sequelize=require(_0xa80f('0x0'));module[_0xa80f('0x1')]={'name':{'type':Sequelize[_0xa80f('0x2')],'unique':_0xa80f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa80f('0x2')]},'timeout':{'type':Sequelize[_0xa80f('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa80f('0x5')](_0xa80f('0x6'),'beepall',_0xa80f('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xa80f('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x05e2=['beepall','INTEGER','sequelize','exports','name','ENUM'];(function(_0x4c66d0,_0x1cefe2){var _0x4fe22f=function(_0x26d623){while(--_0x26d623){_0x4c66d0['push'](_0x4c66d0['shift']());}};_0x4fe22f(++_0x1cefe2);}(_0x05e2,0x116));var _0x205e=function(_0x167b19,_0x56081a){_0x167b19=_0x167b19-0x0;var _0x1fcca2=_0x05e2[_0x167b19];return _0x1fcca2;};'use strict';var Sequelize=require(_0x205e('0x0'));module[_0x205e('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x205e('0x2'),'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[_0x205e('0x3')]('rrmemory',_0x205e('0x4'),'roundrobin'),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x205e('0x5')],'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 9442208..d0dafd9 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 _0x1572=['socket.io-emitter','./faxQueue.socket','register','end','status','json','offset','limit','set','reject','update','then','get','FaxQueues','UserProfileResource','sendStatus','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','show','params','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','error','destroy','describe','findOne','UserFaxQueue','pick','FaxQueueId','agent','faxPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','Team','order','addTeams','ids','User','Agents','online','voicePause','sequelize','each','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.UserId\x20=\x20?','push','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost'];(function(_0x568a11,_0x2672ce){var _0x20cbe3=function(_0x4d417d){while(--_0x4d417d){_0x568a11['push'](_0x568a11['shift']());}};_0x20cbe3(++_0x2672ce);}(_0x1572,0xf5));var _0x2157=function(_0x2a5b5e,_0x2f4289){_0x2a5b5e=_0x2a5b5e-0x0;var _0x1b6dce=_0x1572[_0x2a5b5e];return _0x1b6dce;};'use strict';var pdf=require(_0x2157('0x0'));var emlformat=require(_0x2157('0x1'));var rimraf=require(_0x2157('0x2'));var zipdir=require(_0x2157('0x3'));var jsonpatch=require(_0x2157('0x4'));var rp=require(_0x2157('0x5'));var moment=require(_0x2157('0x6'));var BPromise=require(_0x2157('0x7'));var Mustache=require(_0x2157('0x8'));var util=require(_0x2157('0x9'));var path=require(_0x2157('0xa'));var sox=require(_0x2157('0xb'));var csv=require(_0x2157('0xc'));var ejs=require(_0x2157('0xd'));var fs=require('fs');var _=require(_0x2157('0xe'));var squel=require(_0x2157('0xf'));var crypto=require(_0x2157('0x10'));var jsforce=require(_0x2157('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x2157('0xc'));var querystring=require('querystring');var Papa=require(_0x2157('0x12'));var Redis=require(_0x2157('0x13'));var authService=require(_0x2157('0x14'));var qs=require(_0x2157('0x15'));var as=require(_0x2157('0x16'));var hardwareService=require(_0x2157('0x17'));var logger=require(_0x2157('0x18'))(_0x2157('0x19'));var utils=require('../../config/utils');var config=require(_0x2157('0x1a'));var db=require(_0x2157('0x1b'))['db'];config[_0x2157('0x1c')]=_[_0x2157('0x1d')](config['redis'],{'host':_0x2157('0x1e'),'port':0x18eb});var socket=require(_0x2157('0x1f'))(new Redis(config[_0x2157('0x1c')]));require(_0x2157('0x20'))[_0x2157('0x21')](socket);function respondWithStatusCode(_0xd85b14,_0x1ed7c2){_0x1ed7c2=_0x1ed7c2||0xcc;return function(_0x5e977c){if(_0x5e977c){return _0xd85b14['sendStatus'](_0x1ed7c2);}return _0xd85b14['status'](_0x1ed7c2)[_0x2157('0x22')]();};}function respondWithResult(_0x2ce8e1,_0x371461){_0x371461=_0x371461||0xc8;return function(_0x20de83){if(_0x20de83){return _0x2ce8e1[_0x2157('0x23')](_0x371461)[_0x2157('0x24')](_0x20de83);}};}function respondWithFilteredResult(_0x258ede,_0x2cf6ca){return function(_0x42e67e){if(_0x42e67e){var _0x5438a5=_0x42e67e['count'],_0x25a147=_0x2cf6ca[_0x2157('0x25')],_0x33513f=_0x2cf6ca[_0x2157('0x25')]+_0x2cf6ca[_0x2157('0x26')],_0x23aba1;if(_0x33513f>=_0x5438a5){_0x33513f=_0x5438a5;_0x23aba1=0xc8;}else{_0x23aba1=0xce;}_0x258ede[_0x2157('0x23')](_0x23aba1);return _0x258ede[_0x2157('0x27')]('Content-Range',_0x25a147+'-'+_0x33513f+'/'+_0x5438a5)['json'](_0x42e67e);}return null;};}function patchUpdates(_0x5910f8){return function(_0x963ccc){try{jsonpatch['apply'](_0x963ccc,_0x5910f8,!![]);}catch(_0x44c485){return BPromise[_0x2157('0x28')](_0x44c485);}return _0x963ccc['save']();};}function saveUpdates(_0x5b4435,_0x306bcd){return function(_0x45f14b){if(_0x45f14b){return _0x45f14b[_0x2157('0x29')](_0x5b4435)[_0x2157('0x2a')](function(_0x5244a9){return _0x5244a9;});}return null;};}function removeEntity(_0xe0bfe2,_0x4601ce){return function(_0x495598){if(_0x495598){return _0x495598['destroy']()[_0x2157('0x2a')](function(){var _0x9042d5=_0x495598[_0x2157('0x2b')]({'plain':!![]});var _0xbd5885=_0x2157('0x2c');return db[_0x2157('0x2d')]['destroy']({'where':{'type':_0xbd5885,'resourceId':_0x9042d5['id']}})[_0x2157('0x2a')](function(){return _0x495598;});})[_0x2157('0x2a')](function(){_0xe0bfe2[_0x2157('0x23')](0xcc)[_0x2157('0x22')]();});}};}function handleEntityNotFound(_0x43e222,_0x24ed3c){return function(_0x54e083){if(!_0x54e083){_0x43e222[_0x2157('0x2e')](0x194);}return _0x54e083;};}function handleError(_0x1206df,_0x6709e1){_0x6709e1=_0x6709e1||0x1f4;return function(_0x3c92dd){logger['error'](_0x3c92dd[_0x2157('0x2f')]);if(_0x3c92dd[_0x2157('0x30')]){delete _0x3c92dd[_0x2157('0x30')];}_0x1206df[_0x2157('0x23')](_0x6709e1)[_0x2157('0x31')](_0x3c92dd);};}exports[_0x2157('0x32')]=function(_0x3720bd,_0x30a8fd){var _0x17702c={},_0x23fca9={},_0x2192b0={'count':0x0,'rows':[]};var _0x2e9780=_[_0x2157('0x33')](db[_0x2157('0x34')][_0x2157('0x35')],function(_0x1af6fb){return{'name':_0x1af6fb['fieldName'],'type':_0x1af6fb[_0x2157('0x36')][_0x2157('0x37')]};});_0x23fca9[_0x2157('0x38')]=_[_0x2157('0x33')](_0x2e9780,_0x2157('0x30'));_0x23fca9[_0x2157('0x39')]=_[_0x2157('0x3a')](_0x3720bd[_0x2157('0x39')]);_0x23fca9[_0x2157('0x3b')]=_['intersection'](_0x23fca9['model'],_0x23fca9[_0x2157('0x39')]);_0x17702c[_0x2157('0x3c')]=_['intersection'](_0x23fca9[_0x2157('0x38')],qs[_0x2157('0x3d')](_0x3720bd[_0x2157('0x39')]['fields']));_0x17702c[_0x2157('0x3c')]=_0x17702c[_0x2157('0x3c')][_0x2157('0x3e')]?_0x17702c['attributes']:_0x23fca9[_0x2157('0x38')];if(!_0x3720bd['query'][_0x2157('0x3f')](_0x2157('0x40'))){_0x17702c[_0x2157('0x26')]=qs['limit'](_0x3720bd[_0x2157('0x39')][_0x2157('0x26')]);_0x17702c['offset']=qs['offset'](_0x3720bd[_0x2157('0x39')][_0x2157('0x25')]);}_0x17702c['order']=qs[_0x2157('0x41')](_0x3720bd[_0x2157('0x39')]['sort']);_0x17702c[_0x2157('0x42')]=qs['filters'](_['pick'](_0x3720bd[_0x2157('0x39')],_0x23fca9[_0x2157('0x3b')]));if(_0x3720bd['query']['filter']){_0x17702c[_0x2157('0x42')]=_[_0x2157('0x43')](_0x17702c[_0x2157('0x42')],{'$or':_[_0x2157('0x33')](_0x2e9780,function(_0x42a0b4){if(_0x42a0b4[_0x2157('0x36')]!==_0x2157('0x44')){var _0x4dce6b={};_0x4dce6b[_0x42a0b4[_0x2157('0x30')]]={'$like':'%'+_0x3720bd[_0x2157('0x39')][_0x2157('0x45')]+'%'};return _0x4dce6b;}})});}_0x17702c=_[_0x2157('0x43')]({},_0x17702c,_0x3720bd[_0x2157('0x46')]);var _0x31d755={'where':_0x17702c['where']};return db['FaxQueue']['count'](_0x31d755)[_0x2157('0x2a')](function(_0x51c1c9){_0x2192b0[_0x2157('0x47')]=_0x51c1c9;if(_0x3720bd[_0x2157('0x39')][_0x2157('0x48')]){_0x17702c[_0x2157('0x49')]=[{'all':!![]}];}return db['FaxQueue'][_0x2157('0x4a')](_0x17702c);})[_0x2157('0x2a')](function(_0xe01828){_0x2192b0[_0x2157('0x4b')]=_0xe01828;return _0x2192b0;})[_0x2157('0x2a')](respondWithFilteredResult(_0x30a8fd,_0x17702c))[_0x2157('0x4c')](handleError(_0x30a8fd,null));};exports[_0x2157('0x4d')]=function(_0x4ec818,_0x1a185e){var _0xc28840={'raw':!![],'where':{'id':_0x4ec818[_0x2157('0x4e')]['id']}},_0x4efab1={};_0x4efab1[_0x2157('0x38')]=_[_0x2157('0x3a')](db['FaxQueue'][_0x2157('0x35')]);_0x4efab1[_0x2157('0x39')]=_[_0x2157('0x3a')](_0x4ec818[_0x2157('0x39')]);_0x4efab1[_0x2157('0x3b')]=_['intersection'](_0x4efab1[_0x2157('0x38')],_0x4efab1['query']);_0xc28840[_0x2157('0x3c')]=_[_0x2157('0x4f')](_0x4efab1[_0x2157('0x38')],qs[_0x2157('0x3d')](_0x4ec818[_0x2157('0x39')][_0x2157('0x3d')]));_0xc28840['attributes']=_0xc28840[_0x2157('0x3c')][_0x2157('0x3e')]?_0xc28840[_0x2157('0x3c')]:_0x4efab1[_0x2157('0x38')];if(_0x4ec818['query'][_0x2157('0x48')]){_0xc28840[_0x2157('0x49')]=[{'all':!![]}];}_0xc28840=_['merge']({},_0xc28840,_0x4ec818[_0x2157('0x46')]);return db[_0x2157('0x34')][_0x2157('0x50')](_0xc28840)['then'](handleEntityNotFound(_0x1a185e,null))[_0x2157('0x2a')](respondWithResult(_0x1a185e,null))['catch'](handleError(_0x1a185e,null));};exports[_0x2157('0x51')]=function(_0x3075d6,_0x4bc7f2){return db[_0x2157('0x34')][_0x2157('0x51')](_0x3075d6[_0x2157('0x52')],{})[_0x2157('0x2a')](function(_0x7ed6a5){var _0x224380=_0x3075d6[_0x2157('0x53')][_0x2157('0x2b')]({'plain':!![]});if(!_0x224380)throw new Error(_0x2157('0x54'));if(_0x224380['role']===_0x2157('0x53')){var _0x243d12=_0x7ed6a5[_0x2157('0x2b')]({'plain':!![]});var _0xa4bd1=_0x2157('0x2c');return db['UserProfileSection'][_0x2157('0x50')]({'where':{'name':_0xa4bd1,'userProfileId':_0x224380['userProfileId']},'raw':!![]})['then'](function(_0x11c942){if(_0x11c942&&_0x11c942['autoAssociation']===0x0){return db[_0x2157('0x2d')][_0x2157('0x51')]({'name':_0x243d12[_0x2157('0x30')],'resourceId':_0x243d12['id'],'type':_0x11c942['name'],'sectionId':_0x11c942['id']},{})[_0x2157('0x2a')](function(){return _0x7ed6a5;});}else{return _0x7ed6a5;}})[_0x2157('0x4c')](function(_0x626139){logger[_0x2157('0x55')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x626139);throw _0x626139;});}return _0x7ed6a5;})[_0x2157('0x2a')](respondWithResult(_0x4bc7f2,0xc9))[_0x2157('0x4c')](handleError(_0x4bc7f2,null));};exports['update']=function(_0x2353fe,_0x135a1a){if(_0x2353fe[_0x2157('0x52')]['id']){delete _0x2353fe[_0x2157('0x52')]['id'];}return db[_0x2157('0x34')][_0x2157('0x50')]({'where':{'id':_0x2353fe[_0x2157('0x4e')]['id']}})[_0x2157('0x2a')](handleEntityNotFound(_0x135a1a,null))['then'](saveUpdates(_0x2353fe[_0x2157('0x52')],null))[_0x2157('0x2a')](respondWithResult(_0x135a1a,null))[_0x2157('0x4c')](handleError(_0x135a1a,null));};exports[_0x2157('0x56')]=function(_0xc00f98,_0x586af2){return db[_0x2157('0x34')][_0x2157('0x50')]({'where':{'id':_0xc00f98[_0x2157('0x4e')]['id']}})[_0x2157('0x2a')](handleEntityNotFound(_0x586af2,null))[_0x2157('0x2a')](removeEntity(_0x586af2,null))['catch'](handleError(_0x586af2,null));};exports[_0x2157('0x57')]=function(_0x4af60c,_0x1c65c7){return db[_0x2157('0x34')][_0x2157('0x57')]()[_0x2157('0x2a')](respondWithResult(_0x1c65c7,null))[_0x2157('0x4c')](handleError(_0x1c65c7,null));};exports['getMembers']=function(_0x5c7848,_0x6eac02,_0x48cba3){var _0x30e6a7={'raw':!![],'where':{}},_0x1467be={},_0xaa5013;return db[_0x2157('0x34')][_0x2157('0x58')]({'where':{'id':_0x5c7848[_0x2157('0x4e')]['id']}})[_0x2157('0x2a')](handleEntityNotFound(_0x6eac02,null))[_0x2157('0x2a')](function(_0x108ee8){if(_0x108ee8){_0xaa5013=_0x108ee8['get']({'plain':!![]});_0x1467be[_0x2157('0x38')]=_[_0x2157('0x3a')](db[_0x2157('0x59')]['rawAttributes']);_0x1467be[_0x2157('0x39')]=_['keys'](_0x5c7848[_0x2157('0x39')]);_0x1467be[_0x2157('0x3b')]=_[_0x2157('0x4f')](_0x1467be['model'],_0x1467be[_0x2157('0x39')]);_0x30e6a7[_0x2157('0x3c')]=_[_0x2157('0x4f')](_0x1467be[_0x2157('0x38')],qs[_0x2157('0x3d')](_0x5c7848[_0x2157('0x39')][_0x2157('0x3d')]));_0x30e6a7[_0x2157('0x3c')]=_0x30e6a7['attributes'][_0x2157('0x3e')]?_0x30e6a7[_0x2157('0x3c')]:_0x1467be['model'];if(!_0x5c7848['query']['hasOwnProperty'](_0x2157('0x40'))){_0x30e6a7[_0x2157('0x26')]=qs['limit'](_0x5c7848[_0x2157('0x39')][_0x2157('0x26')]);_0x30e6a7[_0x2157('0x25')]=qs[_0x2157('0x25')](_0x5c7848['query'][_0x2157('0x25')]);}_0x30e6a7['order']=qs[_0x2157('0x41')](_0x5c7848['query'][_0x2157('0x41')]);_0x30e6a7[_0x2157('0x42')]=qs['filters'](_[_0x2157('0x5a')](_0x5c7848[_0x2157('0x39')],_0x1467be[_0x2157('0x3b')]));_0x30e6a7[_0x2157('0x42')][_0x2157('0x5b')]=_0x108ee8['id'];if(_0x5c7848['query'][_0x2157('0x45')]){_0x30e6a7[_0x2157('0x42')]=_[_0x2157('0x43')](_0x30e6a7[_0x2157('0x42')],{'$or':_[_0x2157('0x33')](_0x30e6a7[_0x2157('0x3c')],function(_0x15e11a){var _0x3a479f={};_0x3a479f[_0x15e11a]={'$like':'%'+_0x5c7848['query']['filter']+'%'};return _0x3a479f;})});}_0x30e6a7=_['merge']({},_0x30e6a7,_0x5c7848[_0x2157('0x46')]);return db[_0x2157('0x59')][_0x2157('0x4a')](_0x30e6a7);}})[_0x2157('0x2a')](function(_0x504ea4){if(_0x504ea4){return db['User']['findAndCountAll']({'where':{'id':_[_0x2157('0x33')](_0x504ea4,'UserId'),'role':_0x2157('0x5c')},'attributes':['id',_0x2157('0x30'),_0x2157('0x5d'),_0x2157('0x5e'),_0x2157('0x5f')]});}})['then'](function(_0x5ce04b){if(_0x5ce04b){return{'count':_0x5ce04b[_0x2157('0x47')],'rows':_[_0x2157('0x33')](_0x5ce04b[_0x2157('0x4b')],function(_0x5201c1){return{'membername':_0x5201c1[_0x2157('0x30')],'UserId':_0x5201c1['id'],'queue_name':_0xaa5013[_0x2157('0x30')],'FaxQueueId':_0xaa5013['id'],'interface':util[_0x2157('0x60')](_0x2157('0x61'),_0x2157('0x62'),_0x5201c1[_0x2157('0x30')]),'penalty':0x0,'paused':_0x5201c1[_0x2157('0x5d')],'createdAt':_0x5201c1[_0x2157('0x5f')],'updatedAt':_0x5201c1[_0x2157('0x5e')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x2157('0x2a')](respondWithFilteredResult(_0x6eac02,_0x30e6a7))['catch'](handleError(_0x6eac02,null));};exports[_0x2157('0x63')]=function(_0x38c09d,_0x4f05f6,_0x1d0dc7){var _0x25378a={};var _0x5041b8={};var _0x413644;var _0x33dd24;return db[_0x2157('0x34')]['findOne']({'where':{'id':_0x38c09d[_0x2157('0x4e')]['id']}})[_0x2157('0x2a')](handleEntityNotFound(_0x4f05f6,null))['then'](function(_0x2a66ce){if(_0x2a66ce){_0x413644=_0x2a66ce;_0x5041b8[_0x2157('0x38')]=_[_0x2157('0x3a')](db[_0x2157('0x64')][_0x2157('0x35')]);_0x5041b8[_0x2157('0x39')]=_[_0x2157('0x3a')](_0x38c09d[_0x2157('0x39')]);_0x5041b8[_0x2157('0x3b')]=_['intersection'](_0x5041b8[_0x2157('0x38')],_0x5041b8[_0x2157('0x39')]);_0x25378a[_0x2157('0x3c')]=_['intersection'](_0x5041b8[_0x2157('0x38')],qs[_0x2157('0x3d')](_0x38c09d['query'][_0x2157('0x3d')]));_0x25378a[_0x2157('0x3c')]=_0x25378a[_0x2157('0x3c')][_0x2157('0x3e')]?_0x25378a[_0x2157('0x3c')]:_0x5041b8['model'];_0x25378a[_0x2157('0x65')]=qs[_0x2157('0x41')](_0x38c09d[_0x2157('0x39')][_0x2157('0x41')]);_0x25378a[_0x2157('0x42')]=qs[_0x2157('0x3b')](_[_0x2157('0x5a')](_0x38c09d[_0x2157('0x39')],_0x5041b8[_0x2157('0x3b')]));if(_0x38c09d[_0x2157('0x39')][_0x2157('0x45')]){_0x25378a['where']=_[_0x2157('0x43')](_0x25378a[_0x2157('0x42')],{'$or':_[_0x2157('0x33')](_0x25378a['attributes'],function(_0x171c51){var _0x5deb06={};_0x5deb06[_0x171c51]={'$like':'%'+_0x38c09d[_0x2157('0x39')]['filter']+'%'};return _0x5deb06;})});}_0x25378a=_['merge']({},_0x25378a,_0x38c09d[_0x2157('0x46')]);return _0x413644[_0x2157('0x63')](_0x25378a);}})[_0x2157('0x2a')](function(_0x208455){if(_0x208455){_0x33dd24=_0x208455[_0x2157('0x3e')];if(!_0x38c09d[_0x2157('0x39')][_0x2157('0x3f')](_0x2157('0x40'))){_0x25378a[_0x2157('0x26')]=qs[_0x2157('0x26')](_0x38c09d['query'][_0x2157('0x26')]);_0x25378a[_0x2157('0x25')]=qs[_0x2157('0x25')](_0x38c09d[_0x2157('0x39')]['offset']);}return _0x413644[_0x2157('0x63')](_0x25378a);}})[_0x2157('0x2a')](function(_0x44eba7){if(_0x44eba7){return _0x44eba7?{'count':_0x33dd24,'rows':_0x44eba7}:null;}})[_0x2157('0x2a')](respondWithResult(_0x4f05f6,null))[_0x2157('0x4c')](handleError(_0x4f05f6,null));};exports[_0x2157('0x66')]=function(_0x116ea5,_0x183652,_0x5b9015){var _0x33e753=_0x116ea5['body'][_0x2157('0x67')];return db[_0x2157('0x64')]['findAll']({'where':{'id':_0x33e753},'attributes':['id'],'include':[{'model':db[_0x2157('0x68')],'as':_0x2157('0x69'),'attributes':['id','name',_0x2157('0x6a'),_0x2157('0x6b'),'interface'],'raw':!![]}]})['then'](function(_0x18ee2c){if(_0x18ee2c){var _0x162f5f=_['flatMap'](_0x18ee2c,function(_0x6a3e5d){var _0x41de15=_0x6a3e5d[_0x2157('0x2b')]({'plain':!![]});return _0x41de15[_0x2157('0x69')];});return db[_0x2157('0x34')][_0x2157('0x50')]({'where':{'id':_0x116ea5[_0x2157('0x4e')]['id']}})[_0x2157('0x2a')](function(_0x31bda0){return db[_0x2157('0x6c')]['transaction'](function(_0x551807){return _0x31bda0[_0x2157('0x66')](_0x33e753,{'transaction':_0x551807})[_0x2157('0x2a')](function(){return BPromise[_0x2157('0x6d')](_0x162f5f,function(_0x94b78f){return db[_0x2157('0x59')][_0x2157('0x6e')]({'where':{'UserId':_0x94b78f['id'],'FaxQueueId':_0x116ea5[_0x2157('0x4e')]['id']},'transaction':_0x551807});});})[_0x2157('0x2a')](function(){_0x162f5f[_0x2157('0x6f')](function(_0x3425d3){socket[_0x2157('0x70')]('userFaxQueue:save',{'UserId':_0x3425d3['id'],'FaxQueueId':_0x31bda0['id']});});});});});}})[_0x2157('0x2a')](respondWithStatusCode(_0x183652,null))[_0x2157('0x4c')](handleError(_0x183652,null));};exports[_0x2157('0x71')]=function(_0x46c71f,_0x158020,_0x282631){return db[_0x2157('0x64')][_0x2157('0x4a')]({'where':{'id':_0x46c71f['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x2157('0x68')],'as':_0x2157('0x69'),'attributes':['id'],'raw':!![]}]})[_0x2157('0x2a')](handleEntityNotFound(_0x158020,null))[_0x2157('0x2a')](function(_0x47bc82){var _0x3cae60=_[_0x2157('0x33')](_0x47bc82,'id');var _0x1909ad=[];var _0xc17d23=[];var _0x49cbdd=squel[_0x2157('0x72')]();_0x49cbdd[_0x2157('0x73')](_0x2157('0x74'))[_0x2157('0x75')](_0x2157('0x76'),'tq')[_0x2157('0x77')](_0x2157('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('FaxQueueId\x20=\x20?',_0x46c71f[_0x2157('0x4e')]['id']);for(var _0x122b05=0x0;_0x122b05<_0x47bc82[_0x2157('0x3e')];_0x122b05+=0x1){let _0xbba9f9=_0x47bc82[_0x122b05];for(var _0x436499=0x0;_0x436499<_0xbba9f9[_0x2157('0x69')]['length'];_0x436499+=0x1){let _0xe622d6=_0xbba9f9[_0x2157('0x69')][_0x436499];var _0x3b8b12=_0x49cbdd['clone']();_0x3b8b12[_0x2157('0x42')](_0x2157('0x79'),_0xe622d6['id']);_0xc17d23[_0x2157('0x7a')](db['sequelize'][_0x2157('0x39')](_0x3b8b12['toString'](),{'type':db[_0x2157('0x6c')][_0x2157('0x7b')]['SELECT']})[_0x2157('0x2a')](function(_0x578199){if(_0x578199[_0x2157('0x3e')]===0x1){return _0xe622d6['id'];}else{var _0x516c32=_[_0x2157('0x7c')](_[_0x2157('0x33')](_0x578199,_0x2157('0x7d')),function(_0x12934a){return _[_0x2157('0x7e')](_0x3cae60,_0x12934a);});if(_0x516c32){return _0xe622d6['id'];}}}));}}return BPromise[_0x2157('0x7f')](_0xc17d23)[_0x2157('0x2a')](function(_0x5ebaf3){_0x1909ad=_(_0x1909ad)[_0x2157('0x80')](_0x5ebaf3)['compact']()[_0x2157('0x81')]();return db[_0x2157('0x34')][_0x2157('0x50')]({'where':{'id':_0x46c71f['params']['id']}})['then'](function(_0x2f93a8){return db[_0x2157('0x6c')]['transaction'](function(_0x252d2f){return _0x2f93a8[_0x2157('0x71')](_0x46c71f[_0x2157('0x39')]['ids'],{'transaction':_0x252d2f})['then'](function(){if(!_[_0x2157('0x82')](_0x1909ad)){return _0x2f93a8[_0x2157('0x83')](_0x1909ad,{'transaction':_0x252d2f});}})['then'](function(){_0x1909ad[_0x2157('0x6f')](function(_0x4bba0a){socket[_0x2157('0x70')](_0x2157('0x84'),{'UserId':_0x4bba0a,'FaxQueueId':_0x2f93a8['id']});});});});});});})[_0x2157('0x2a')](respondWithStatusCode(_0x158020,null))[_0x2157('0x4c')](handleError(_0x158020,null));};exports[_0x2157('0x85')]=function(_0x28c6cb,_0x429fb3,_0x50f967){return db[_0x2157('0x34')][_0x2157('0x50')]({'where':{'id':_0x28c6cb['params']['id']}})[_0x2157('0x2a')](handleEntityNotFound(_0x429fb3,null))['then'](function(_0x102ead){if(_0x102ead){return _0x102ead[_0x2157('0x85')](_0x28c6cb[_0x2157('0x52')]['ids'],_[_0x2157('0x86')](_0x28c6cb[_0x2157('0x52')],[_0x2157('0x67'),'id'])||{})['spread'](function(_0x2c3b69){for(var _0x27e759=0x0;_0x27e759<_0x28c6cb[_0x2157('0x52')][_0x2157('0x67')][_0x2157('0x3e')];_0x27e759+=0x1){socket['emit'](_0x2157('0x87'),{'UserId':_0x28c6cb[_0x2157('0x52')][_0x2157('0x67')][_0x27e759],'FaxQueueId':_0x28c6cb[_0x2157('0x4e')]['id']});}return _0x2c3b69;});}})[_0x2157('0x2a')](respondWithResult(_0x429fb3,null))[_0x2157('0x4c')](handleError(_0x429fb3,null));};exports['removeAgents']=function(_0x21cc06,_0x4f308c,_0x3ce3ef){return db[_0x2157('0x34')][_0x2157('0x50')]({'where':{'id':_0x21cc06[_0x2157('0x4e')]['id']}})[_0x2157('0x2a')](handleEntityNotFound(_0x4f308c,null))[_0x2157('0x2a')](function(_0x259ca7){if(_0x259ca7){return _0x259ca7['removeAgents'](_0x21cc06[_0x2157('0x39')][_0x2157('0x67')])[_0x2157('0x2a')](function(){if(_[_0x2157('0x88')](_0x21cc06[_0x2157('0x39')][_0x2157('0x67')])){for(var _0x4a8034=0x0;_0x4a8034<_0x21cc06[_0x2157('0x39')][_0x2157('0x67')][_0x2157('0x3e')];_0x4a8034+=0x1){socket[_0x2157('0x70')](_0x2157('0x84'),{'UserId':Number(_0x21cc06[_0x2157('0x39')]['ids'][_0x4a8034]),'FaxQueueId':Number(_0x21cc06['params']['id'])});}}else{socket[_0x2157('0x70')]('userFaxQueue:remove',{'UserId':Number(_0x21cc06[_0x2157('0x39')][_0x2157('0x67')]),'FaxQueueId':Number(_0x21cc06[_0x2157('0x4e')]['id'])});}});}})[_0x2157('0x2a')](respondWithStatusCode(_0x4f308c,null))[_0x2157('0x4c')](handleError(_0x4f308c,null));};exports['getAgents']=function(_0x210978,_0x48672e,_0xfa57e3){var _0x147096={};var _0x3dd2fa={};var _0x524e3e;var _0x2e5dd8;return db[_0x2157('0x34')][_0x2157('0x58')]({'where':{'id':_0x210978[_0x2157('0x4e')]['id']}})['then'](handleEntityNotFound(_0x48672e,null))[_0x2157('0x2a')](function(_0x266e01){if(_0x266e01){_0x524e3e=_0x266e01;_0x3dd2fa[_0x2157('0x38')]=_['keys'](db[_0x2157('0x68')]['rawAttributes']);_0x3dd2fa[_0x2157('0x39')]=_['keys'](_0x210978[_0x2157('0x39')]);_0x3dd2fa[_0x2157('0x3b')]=_[_0x2157('0x4f')](_0x3dd2fa[_0x2157('0x38')],_0x3dd2fa[_0x2157('0x39')]);_0x147096[_0x2157('0x3c')]=_[_0x2157('0x4f')](_0x3dd2fa[_0x2157('0x38')],qs[_0x2157('0x3d')](_0x210978[_0x2157('0x39')][_0x2157('0x3d')]));_0x147096[_0x2157('0x3c')]=_0x147096['attributes']['length']?_0x147096[_0x2157('0x3c')]:_0x3dd2fa[_0x2157('0x38')];_0x147096[_0x2157('0x65')]=qs[_0x2157('0x41')](_0x210978[_0x2157('0x39')][_0x2157('0x41')]);_0x147096[_0x2157('0x42')]=qs['filters'](_[_0x2157('0x5a')](_0x210978[_0x2157('0x39')],_0x3dd2fa[_0x2157('0x3b')]));if(_0x210978[_0x2157('0x39')][_0x2157('0x45')]){_0x147096[_0x2157('0x42')]=_[_0x2157('0x43')](_0x147096[_0x2157('0x42')],{'$or':_[_0x2157('0x33')](_0x147096[_0x2157('0x3c')],function(_0x5896f2){var _0x1e09a8={};_0x1e09a8[_0x5896f2]={'$like':'%'+_0x210978[_0x2157('0x39')][_0x2157('0x45')]+'%'};return _0x1e09a8;})});}_0x147096=_[_0x2157('0x43')]({},_0x147096,_0x210978[_0x2157('0x46')]);return _0x524e3e[_0x2157('0x89')](_0x147096);}})[_0x2157('0x2a')](function(_0x1ed13c){if(_0x1ed13c){_0x2e5dd8=_0x1ed13c[_0x2157('0x3e')];if(!_0x210978[_0x2157('0x39')][_0x2157('0x3f')](_0x2157('0x40'))){_0x147096[_0x2157('0x26')]=qs[_0x2157('0x26')](_0x210978[_0x2157('0x39')][_0x2157('0x26')]);_0x147096[_0x2157('0x25')]=qs[_0x2157('0x25')](_0x210978[_0x2157('0x39')]['offset']);}return _0x524e3e[_0x2157('0x89')](_0x147096);}})['then'](function(_0x3807ff){if(_0x3807ff){return _0x3807ff?{'count':_0x2e5dd8,'rows':_0x3807ff}:null;}})[_0x2157('0x2a')](respondWithResult(_0x48672e,null))[_0x2157('0x4c')](handleError(_0x48672e,null));}; \ No newline at end of file +var _0x74f4=['userFaxQueue:save','removeTeams','select','field','tq.TeamId','team_has_fax_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','all','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','destroy','then','get','UserProfileResource','stack','name','send','index','FaxQueue','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserFaxQueue','pick','FaxQueueId','User','UserId','agent','faxPause','updatedAt','format','%s/%s','SIP','getTeams','findOne','ids','Team','Agents','online','voicePause','interface','flatMap','addTeams','each','forEach','emit'];(function(_0x49ec70,_0x5529c1){var _0x210e8c=function(_0x17031b){while(--_0x17031b){_0x49ec70['push'](_0x49ec70['shift']());}};_0x210e8c(++_0x5529c1);}(_0x74f4,0xaa));var _0x474f=function(_0x471a63,_0x44ba66){_0x471a63=_0x471a63-0x0;var _0x2e0527=_0x74f4[_0x471a63];return _0x2e0527;};'use strict';var pdf=require(_0x474f('0x0'));var emlformat=require(_0x474f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x474f('0x2'));var jsonpatch=require(_0x474f('0x3'));var rp=require('request-promise');var moment=require(_0x474f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x474f('0x5'));var util=require(_0x474f('0x6'));var path=require(_0x474f('0x7'));var sox=require('sox');var csv=require(_0x474f('0x8'));var ejs=require(_0x474f('0x9'));var fs=require('fs');var _=require(_0x474f('0xa'));var squel=require(_0x474f('0xb'));var crypto=require(_0x474f('0xc'));var jsforce=require(_0x474f('0xd'));var deskjs=require(_0x474f('0xe'));var toCsv=require(_0x474f('0x8'));var querystring=require(_0x474f('0xf'));var Papa=require(_0x474f('0x10'));var Redis=require(_0x474f('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x474f('0x12'));var as=require(_0x474f('0x13'));var hardwareService=require(_0x474f('0x14'));var logger=require('../../config/logger')(_0x474f('0x15'));var utils=require(_0x474f('0x16'));var config=require(_0x474f('0x17'));var db=require('../../mysqldb')['db'];config[_0x474f('0x18')]=_[_0x474f('0x19')](config['redis'],{'host':_0x474f('0x1a'),'port':0x18eb});var socket=require(_0x474f('0x1b'))(new Redis(config[_0x474f('0x18')]));require('./faxQueue.socket')[_0x474f('0x1c')](socket);function respondWithStatusCode(_0x7ffcb,_0x39885e){_0x39885e=_0x39885e||0xcc;return function(_0x3caae0){if(_0x3caae0){return _0x7ffcb[_0x474f('0x1d')](_0x39885e);}return _0x7ffcb[_0x474f('0x1e')](_0x39885e)[_0x474f('0x1f')]();};}function respondWithResult(_0x591cbd,_0xe4b5d3){_0xe4b5d3=_0xe4b5d3||0xc8;return function(_0x5e1d32){if(_0x5e1d32){return _0x591cbd[_0x474f('0x1e')](_0xe4b5d3)[_0x474f('0x20')](_0x5e1d32);}};}function respondWithFilteredResult(_0x54d0e5,_0x3c5143){return function(_0x47a581){if(_0x47a581){var _0x30ac4b=_0x47a581[_0x474f('0x21')],_0x2a172f=_0x3c5143['offset'],_0x36ef8c=_0x3c5143[_0x474f('0x22')]+_0x3c5143[_0x474f('0x23')],_0x3d13e3;if(_0x36ef8c>=_0x30ac4b){_0x36ef8c=_0x30ac4b;_0x3d13e3=0xc8;}else{_0x3d13e3=0xce;}_0x54d0e5[_0x474f('0x1e')](_0x3d13e3);return _0x54d0e5[_0x474f('0x24')](_0x474f('0x25'),_0x2a172f+'-'+_0x36ef8c+'/'+_0x30ac4b)['json'](_0x47a581);}return null;};}function patchUpdates(_0x4a7df3){return function(_0x14dd1e){try{jsonpatch[_0x474f('0x26')](_0x14dd1e,_0x4a7df3,!![]);}catch(_0x5667af){return BPromise[_0x474f('0x27')](_0x5667af);}return _0x14dd1e['save']();};}function saveUpdates(_0x28dc37,_0x3f93a7){return function(_0x3988ae){if(_0x3988ae){return _0x3988ae['update'](_0x28dc37)['then'](function(_0x20a388){return _0x20a388;});}return null;};}function removeEntity(_0x202600,_0x4fccb6){return function(_0x39d825){if(_0x39d825){return _0x39d825[_0x474f('0x28')]()[_0x474f('0x29')](function(){var _0x211535=_0x39d825[_0x474f('0x2a')]({'plain':!![]});var _0x10f111='FaxQueues';return db[_0x474f('0x2b')][_0x474f('0x28')]({'where':{'type':_0x10f111,'resourceId':_0x211535['id']}})[_0x474f('0x29')](function(){return _0x39d825;});})[_0x474f('0x29')](function(){_0x202600[_0x474f('0x1e')](0xcc)[_0x474f('0x1f')]();});}};}function handleEntityNotFound(_0x5492f6,_0x2fe476){return function(_0x1ba8d6){if(!_0x1ba8d6){_0x5492f6[_0x474f('0x1d')](0x194);}return _0x1ba8d6;};}function handleError(_0x234255,_0x85adec){_0x85adec=_0x85adec||0x1f4;return function(_0x4b3b3d){logger['error'](_0x4b3b3d[_0x474f('0x2c')]);if(_0x4b3b3d[_0x474f('0x2d')]){delete _0x4b3b3d[_0x474f('0x2d')];}_0x234255[_0x474f('0x1e')](_0x85adec)[_0x474f('0x2e')](_0x4b3b3d);};}exports[_0x474f('0x2f')]=function(_0x584e25,_0x956465){var _0x2de99c={},_0x582a0a={},_0x52a45d={'count':0x0,'rows':[]};var _0xddf04d=_['map'](db[_0x474f('0x30')][_0x474f('0x31')],function(_0x476361){return{'name':_0x476361[_0x474f('0x32')],'type':_0x476361[_0x474f('0x33')][_0x474f('0x34')]};});_0x582a0a[_0x474f('0x35')]=_[_0x474f('0x36')](_0xddf04d,_0x474f('0x2d'));_0x582a0a[_0x474f('0x37')]=_[_0x474f('0x38')](_0x584e25['query']);_0x582a0a[_0x474f('0x39')]=_[_0x474f('0x3a')](_0x582a0a[_0x474f('0x35')],_0x582a0a[_0x474f('0x37')]);_0x2de99c[_0x474f('0x3b')]=_[_0x474f('0x3a')](_0x582a0a[_0x474f('0x35')],qs[_0x474f('0x3c')](_0x584e25[_0x474f('0x37')]['fields']));_0x2de99c['attributes']=_0x2de99c['attributes'][_0x474f('0x3d')]?_0x2de99c['attributes']:_0x582a0a['model'];if(!_0x584e25[_0x474f('0x37')][_0x474f('0x3e')](_0x474f('0x3f'))){_0x2de99c['limit']=qs[_0x474f('0x23')](_0x584e25['query'][_0x474f('0x23')]);_0x2de99c[_0x474f('0x22')]=qs[_0x474f('0x22')](_0x584e25[_0x474f('0x37')][_0x474f('0x22')]);}_0x2de99c[_0x474f('0x40')]=qs[_0x474f('0x41')](_0x584e25[_0x474f('0x37')][_0x474f('0x41')]);_0x2de99c['where']=qs['filters'](_['pick'](_0x584e25[_0x474f('0x37')],_0x582a0a[_0x474f('0x39')]));if(_0x584e25['query']['filter']){_0x2de99c['where']=_[_0x474f('0x42')](_0x2de99c[_0x474f('0x43')],{'$or':_[_0x474f('0x36')](_0xddf04d,function(_0x1d3db0){if(_0x1d3db0[_0x474f('0x33')]!==_0x474f('0x44')){var _0x1c2d4b={};_0x1c2d4b[_0x1d3db0[_0x474f('0x2d')]]={'$like':'%'+_0x584e25['query'][_0x474f('0x45')]+'%'};return _0x1c2d4b;}})});}_0x2de99c=_[_0x474f('0x42')]({},_0x2de99c,_0x584e25[_0x474f('0x46')]);var _0x5d960f={'where':_0x2de99c[_0x474f('0x43')]};return db[_0x474f('0x30')][_0x474f('0x21')](_0x5d960f)['then'](function(_0x422144){_0x52a45d[_0x474f('0x21')]=_0x422144;if(_0x584e25[_0x474f('0x37')][_0x474f('0x47')]){_0x2de99c[_0x474f('0x48')]=[{'all':!![]}];}return db[_0x474f('0x30')][_0x474f('0x49')](_0x2de99c);})[_0x474f('0x29')](function(_0x35d758){_0x52a45d[_0x474f('0x4a')]=_0x35d758;return _0x52a45d;})[_0x474f('0x29')](respondWithFilteredResult(_0x956465,_0x2de99c))[_0x474f('0x4b')](handleError(_0x956465,null));};exports[_0x474f('0x4c')]=function(_0x1ddcd6,_0x6a84f){var _0x26d05f={'raw':!![],'where':{'id':_0x1ddcd6['params']['id']}},_0x2ab767={};_0x2ab767[_0x474f('0x35')]=_[_0x474f('0x38')](db[_0x474f('0x30')][_0x474f('0x31')]);_0x2ab767[_0x474f('0x37')]=_[_0x474f('0x38')](_0x1ddcd6['query']);_0x2ab767[_0x474f('0x39')]=_['intersection'](_0x2ab767['model'],_0x2ab767[_0x474f('0x37')]);_0x26d05f['attributes']=_[_0x474f('0x3a')](_0x2ab767['model'],qs[_0x474f('0x3c')](_0x1ddcd6[_0x474f('0x37')][_0x474f('0x3c')]));_0x26d05f[_0x474f('0x3b')]=_0x26d05f[_0x474f('0x3b')][_0x474f('0x3d')]?_0x26d05f[_0x474f('0x3b')]:_0x2ab767[_0x474f('0x35')];if(_0x1ddcd6[_0x474f('0x37')][_0x474f('0x47')]){_0x26d05f['include']=[{'all':!![]}];}_0x26d05f=_[_0x474f('0x42')]({},_0x26d05f,_0x1ddcd6[_0x474f('0x46')]);return db['FaxQueue'][_0x474f('0x4d')](_0x26d05f)[_0x474f('0x29')](handleEntityNotFound(_0x6a84f,null))[_0x474f('0x29')](respondWithResult(_0x6a84f,null))[_0x474f('0x4b')](handleError(_0x6a84f,null));};exports[_0x474f('0x4e')]=function(_0x228b7c,_0x436ea6){return db['FaxQueue'][_0x474f('0x4e')](_0x228b7c[_0x474f('0x4f')],{})[_0x474f('0x29')](function(_0x2e63ed){var _0x3f1edc=_0x228b7c[_0x474f('0x50')][_0x474f('0x2a')]({'plain':!![]});if(!_0x3f1edc)throw new Error(_0x474f('0x51'));if(_0x3f1edc[_0x474f('0x52')]===_0x474f('0x50')){var _0x39ff0c=_0x2e63ed[_0x474f('0x2a')]({'plain':!![]});var _0x1f9be6=_0x474f('0x53');return db[_0x474f('0x54')][_0x474f('0x4d')]({'where':{'name':_0x1f9be6,'userProfileId':_0x3f1edc[_0x474f('0x55')]},'raw':!![]})[_0x474f('0x29')](function(_0x583409){if(_0x583409&&_0x583409[_0x474f('0x56')]===0x0){return db['UserProfileResource'][_0x474f('0x4e')]({'name':_0x39ff0c[_0x474f('0x2d')],'resourceId':_0x39ff0c['id'],'type':_0x583409['name'],'sectionId':_0x583409['id']},{})[_0x474f('0x29')](function(){return _0x2e63ed;});}else{return _0x2e63ed;}})[_0x474f('0x4b')](function(_0x47b137){logger[_0x474f('0x57')](_0x474f('0x58'),_0x47b137);throw _0x47b137;});}return _0x2e63ed;})[_0x474f('0x29')](respondWithResult(_0x436ea6,0xc9))[_0x474f('0x4b')](handleError(_0x436ea6,null));};exports['update']=function(_0x3a0dfa,_0x44656e){if(_0x3a0dfa[_0x474f('0x4f')]['id']){delete _0x3a0dfa['body']['id'];}return db[_0x474f('0x30')]['find']({'where':{'id':_0x3a0dfa[_0x474f('0x59')]['id']}})[_0x474f('0x29')](handleEntityNotFound(_0x44656e,null))[_0x474f('0x29')](saveUpdates(_0x3a0dfa[_0x474f('0x4f')],null))[_0x474f('0x29')](respondWithResult(_0x44656e,null))['catch'](handleError(_0x44656e,null));};exports[_0x474f('0x28')]=function(_0x46378f,_0x22e9f7){return db[_0x474f('0x30')]['find']({'where':{'id':_0x46378f[_0x474f('0x59')]['id']}})['then'](handleEntityNotFound(_0x22e9f7,null))['then'](removeEntity(_0x22e9f7,null))[_0x474f('0x4b')](handleError(_0x22e9f7,null));};exports[_0x474f('0x5a')]=function(_0x483408,_0x32093b){return db['FaxQueue'][_0x474f('0x5a')]()['then'](respondWithResult(_0x32093b,null))[_0x474f('0x4b')](handleError(_0x32093b,null));};exports[_0x474f('0x5b')]=function(_0x53eb58,_0x4c8185,_0x41ef9b){var _0x47d6f3={'raw':!![],'where':{}},_0x3e108f={},_0x1e77ff;return db[_0x474f('0x30')]['findOne']({'where':{'id':_0x53eb58[_0x474f('0x59')]['id']}})[_0x474f('0x29')](handleEntityNotFound(_0x4c8185,null))[_0x474f('0x29')](function(_0x169653){if(_0x169653){_0x1e77ff=_0x169653[_0x474f('0x2a')]({'plain':!![]});_0x3e108f[_0x474f('0x35')]=_['keys'](db[_0x474f('0x5c')][_0x474f('0x31')]);_0x3e108f[_0x474f('0x37')]=_[_0x474f('0x38')](_0x53eb58['query']);_0x3e108f[_0x474f('0x39')]=_[_0x474f('0x3a')](_0x3e108f[_0x474f('0x35')],_0x3e108f[_0x474f('0x37')]);_0x47d6f3[_0x474f('0x3b')]=_[_0x474f('0x3a')](_0x3e108f['model'],qs['fields'](_0x53eb58[_0x474f('0x37')]['fields']));_0x47d6f3[_0x474f('0x3b')]=_0x47d6f3['attributes']['length']?_0x47d6f3[_0x474f('0x3b')]:_0x3e108f['model'];if(!_0x53eb58[_0x474f('0x37')][_0x474f('0x3e')](_0x474f('0x3f'))){_0x47d6f3[_0x474f('0x23')]=qs[_0x474f('0x23')](_0x53eb58[_0x474f('0x37')][_0x474f('0x23')]);_0x47d6f3[_0x474f('0x22')]=qs[_0x474f('0x22')](_0x53eb58[_0x474f('0x37')][_0x474f('0x22')]);}_0x47d6f3['order']=qs['sort'](_0x53eb58['query'][_0x474f('0x41')]);_0x47d6f3[_0x474f('0x43')]=qs[_0x474f('0x39')](_[_0x474f('0x5d')](_0x53eb58[_0x474f('0x37')],_0x3e108f['filters']));_0x47d6f3['where'][_0x474f('0x5e')]=_0x169653['id'];if(_0x53eb58[_0x474f('0x37')][_0x474f('0x45')]){_0x47d6f3[_0x474f('0x43')]=_[_0x474f('0x42')](_0x47d6f3[_0x474f('0x43')],{'$or':_['map'](_0x47d6f3['attributes'],function(_0x31b3d9){var _0x106c25={};_0x106c25[_0x31b3d9]={'$like':'%'+_0x53eb58[_0x474f('0x37')][_0x474f('0x45')]+'%'};return _0x106c25;})});}_0x47d6f3=_[_0x474f('0x42')]({},_0x47d6f3,_0x53eb58[_0x474f('0x46')]);return db[_0x474f('0x5c')]['findAll'](_0x47d6f3);}})[_0x474f('0x29')](function(_0x9a14b8){if(_0x9a14b8){return db[_0x474f('0x5f')]['findAndCountAll']({'where':{'id':_[_0x474f('0x36')](_0x9a14b8,_0x474f('0x60')),'role':_0x474f('0x61')},'attributes':['id','name',_0x474f('0x62'),_0x474f('0x63'),'createdAt']});}})[_0x474f('0x29')](function(_0x56ece6){if(_0x56ece6){return{'count':_0x56ece6[_0x474f('0x21')],'rows':_['map'](_0x56ece6[_0x474f('0x4a')],function(_0x2b05c3){return{'membername':_0x2b05c3[_0x474f('0x2d')],'UserId':_0x2b05c3['id'],'queue_name':_0x1e77ff[_0x474f('0x2d')],'FaxQueueId':_0x1e77ff['id'],'interface':util[_0x474f('0x64')](_0x474f('0x65'),_0x474f('0x66'),_0x2b05c3['name']),'penalty':0x0,'paused':_0x2b05c3[_0x474f('0x62')],'createdAt':_0x2b05c3['createdAt'],'updatedAt':_0x2b05c3[_0x474f('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x474f('0x29')](respondWithFilteredResult(_0x4c8185,_0x47d6f3))[_0x474f('0x4b')](handleError(_0x4c8185,null));};exports[_0x474f('0x67')]=function(_0x30f121,_0x5d7258,_0x5bc7c2){var _0x1d6044={};var _0x4806f3={};var _0x233295;var _0x37f598;return db['FaxQueue'][_0x474f('0x68')]({'where':{'id':_0x30f121['params']['id']}})[_0x474f('0x29')](handleEntityNotFound(_0x5d7258,null))[_0x474f('0x29')](function(_0x40c0d0){if(_0x40c0d0){_0x233295=_0x40c0d0;_0x4806f3['model']=_[_0x474f('0x38')](db['Team'][_0x474f('0x31')]);_0x4806f3['query']=_[_0x474f('0x38')](_0x30f121[_0x474f('0x37')]);_0x4806f3['filters']=_['intersection'](_0x4806f3[_0x474f('0x35')],_0x4806f3[_0x474f('0x37')]);_0x1d6044['attributes']=_[_0x474f('0x3a')](_0x4806f3[_0x474f('0x35')],qs[_0x474f('0x3c')](_0x30f121[_0x474f('0x37')][_0x474f('0x3c')]));_0x1d6044[_0x474f('0x3b')]=_0x1d6044[_0x474f('0x3b')][_0x474f('0x3d')]?_0x1d6044[_0x474f('0x3b')]:_0x4806f3['model'];_0x1d6044[_0x474f('0x40')]=qs[_0x474f('0x41')](_0x30f121[_0x474f('0x37')][_0x474f('0x41')]);_0x1d6044[_0x474f('0x43')]=qs['filters'](_[_0x474f('0x5d')](_0x30f121[_0x474f('0x37')],_0x4806f3['filters']));if(_0x30f121[_0x474f('0x37')]['filter']){_0x1d6044[_0x474f('0x43')]=_['merge'](_0x1d6044[_0x474f('0x43')],{'$or':_[_0x474f('0x36')](_0x1d6044['attributes'],function(_0x5c15cd){var _0x43b5c5={};_0x43b5c5[_0x5c15cd]={'$like':'%'+_0x30f121['query'][_0x474f('0x45')]+'%'};return _0x43b5c5;})});}_0x1d6044=_[_0x474f('0x42')]({},_0x1d6044,_0x30f121[_0x474f('0x46')]);return _0x233295[_0x474f('0x67')](_0x1d6044);}})[_0x474f('0x29')](function(_0x257022){if(_0x257022){_0x37f598=_0x257022[_0x474f('0x3d')];if(!_0x30f121[_0x474f('0x37')][_0x474f('0x3e')](_0x474f('0x3f'))){_0x1d6044[_0x474f('0x23')]=qs[_0x474f('0x23')](_0x30f121[_0x474f('0x37')][_0x474f('0x23')]);_0x1d6044[_0x474f('0x22')]=qs[_0x474f('0x22')](_0x30f121[_0x474f('0x37')]['offset']);}return _0x233295[_0x474f('0x67')](_0x1d6044);}})['then'](function(_0x5b0377){if(_0x5b0377){return _0x5b0377?{'count':_0x37f598,'rows':_0x5b0377}:null;}})[_0x474f('0x29')](respondWithResult(_0x5d7258,null))[_0x474f('0x4b')](handleError(_0x5d7258,null));};exports['addTeams']=function(_0x2cde1e,_0x13ea99,_0x41bdc8){var _0x32ed4f=_0x2cde1e['body'][_0x474f('0x69')];return db[_0x474f('0x6a')][_0x474f('0x49')]({'where':{'id':_0x32ed4f},'attributes':['id'],'include':[{'model':db[_0x474f('0x5f')],'as':_0x474f('0x6b'),'attributes':['id','name',_0x474f('0x6c'),_0x474f('0x6d'),_0x474f('0x6e')],'raw':!![]}]})['then'](function(_0x377363){if(_0x377363){var _0x497ee=_[_0x474f('0x6f')](_0x377363,function(_0x129c2a){var _0x58ab8d=_0x129c2a[_0x474f('0x2a')]({'plain':!![]});return _0x58ab8d[_0x474f('0x6b')];});return db[_0x474f('0x30')][_0x474f('0x4d')]({'where':{'id':_0x2cde1e['params']['id']}})[_0x474f('0x29')](function(_0x19ff74){return db['sequelize']['transaction'](function(_0x4c1802){return _0x19ff74[_0x474f('0x70')](_0x32ed4f,{'transaction':_0x4c1802})['then'](function(){return BPromise[_0x474f('0x71')](_0x497ee,function(_0x275618){return db[_0x474f('0x5c')]['findOrCreate']({'where':{'UserId':_0x275618['id'],'FaxQueueId':_0x2cde1e[_0x474f('0x59')]['id']},'transaction':_0x4c1802});});})['then'](function(){_0x497ee[_0x474f('0x72')](function(_0x5831b1){socket[_0x474f('0x73')](_0x474f('0x74'),{'UserId':_0x5831b1['id'],'FaxQueueId':_0x19ff74['id']});});});});});}})[_0x474f('0x29')](respondWithStatusCode(_0x13ea99,null))['catch'](handleError(_0x13ea99,null));};exports[_0x474f('0x75')]=function(_0x365f91,_0x9fcc57,_0x4d0e4b){return db[_0x474f('0x6a')][_0x474f('0x49')]({'where':{'id':_0x365f91[_0x474f('0x37')][_0x474f('0x69')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0x474f('0x6b'),'attributes':['id'],'raw':!![]}]})[_0x474f('0x29')](handleEntityNotFound(_0x9fcc57,null))[_0x474f('0x29')](function(_0x10ff76){var _0x4d354a=_['map'](_0x10ff76,'id');var _0x4ad1d1=[];var _0x418d5b=[];var _0x23093b=squel[_0x474f('0x76')]();_0x23093b[_0x474f('0x77')](_0x474f('0x78'))['from'](_0x474f('0x79'),'tq')['join'](_0x474f('0x7a'),'ut',_0x474f('0x7b'))[_0x474f('0x43')](_0x474f('0x7c'),_0x365f91['params']['id']);for(var _0x56f914=0x0;_0x56f914<_0x10ff76[_0x474f('0x3d')];_0x56f914+=0x1){let _0x4a6448=_0x10ff76[_0x56f914];for(var _0x59bd3c=0x0;_0x59bd3c<_0x4a6448[_0x474f('0x6b')][_0x474f('0x3d')];_0x59bd3c+=0x1){let _0xb743db=_0x4a6448[_0x474f('0x6b')][_0x59bd3c];var _0x142c3a=_0x23093b['clone']();_0x142c3a[_0x474f('0x43')](_0x474f('0x7d'),_0xb743db['id']);_0x418d5b[_0x474f('0x7e')](db[_0x474f('0x7f')][_0x474f('0x37')](_0x142c3a[_0x474f('0x80')](),{'type':db[_0x474f('0x7f')][_0x474f('0x81')][_0x474f('0x82')]})[_0x474f('0x29')](function(_0x2156ba){if(_0x2156ba['length']===0x1){return _0xb743db['id'];}else{var _0x393ec8=_[_0x474f('0x83')](_[_0x474f('0x36')](_0x2156ba,_0x474f('0x84')),function(_0x122fea){return _['includes'](_0x4d354a,_0x122fea);});if(_0x393ec8){return _0xb743db['id'];}}}));}}return BPromise[_0x474f('0x85')](_0x418d5b)[_0x474f('0x29')](function(_0x590b18){_0x4ad1d1=_(_0x4ad1d1)['union'](_0x590b18)['compact']()[_0x474f('0x86')]();return db[_0x474f('0x30')][_0x474f('0x4d')]({'where':{'id':_0x365f91['params']['id']}})['then'](function(_0x32692e){return db[_0x474f('0x7f')]['transaction'](function(_0x32a96d){return _0x32692e[_0x474f('0x75')](_0x365f91[_0x474f('0x37')][_0x474f('0x69')],{'transaction':_0x32a96d})['then'](function(){if(!_[_0x474f('0x87')](_0x4ad1d1)){return _0x32692e[_0x474f('0x88')](_0x4ad1d1,{'transaction':_0x32a96d});}})[_0x474f('0x29')](function(){_0x4ad1d1[_0x474f('0x72')](function(_0x359309){socket['emit'](_0x474f('0x89'),{'UserId':_0x359309,'FaxQueueId':_0x32692e['id']});});});});});});})[_0x474f('0x29')](respondWithStatusCode(_0x9fcc57,null))[_0x474f('0x4b')](handleError(_0x9fcc57,null));};exports[_0x474f('0x8a')]=function(_0x1954f7,_0x521677,_0x5ed7c3){return db[_0x474f('0x30')][_0x474f('0x4d')]({'where':{'id':_0x1954f7['params']['id']}})[_0x474f('0x29')](handleEntityNotFound(_0x521677,null))[_0x474f('0x29')](function(_0x3cddcd){if(_0x3cddcd){return _0x3cddcd[_0x474f('0x8a')](_0x1954f7[_0x474f('0x4f')][_0x474f('0x69')],_[_0x474f('0x8b')](_0x1954f7[_0x474f('0x4f')],[_0x474f('0x69'),'id'])||{})[_0x474f('0x8c')](function(_0x4e0941){for(var _0x4f6713=0x0;_0x4f6713<_0x1954f7[_0x474f('0x4f')][_0x474f('0x69')][_0x474f('0x3d')];_0x4f6713+=0x1){socket[_0x474f('0x73')](_0x474f('0x74'),{'UserId':_0x1954f7[_0x474f('0x4f')][_0x474f('0x69')][_0x4f6713],'FaxQueueId':_0x1954f7[_0x474f('0x59')]['id']});}return _0x4e0941;});}})[_0x474f('0x29')](respondWithResult(_0x521677,null))[_0x474f('0x4b')](handleError(_0x521677,null));};exports['removeAgents']=function(_0x8e1611,_0x1e37ca,_0x20ea0c){return db[_0x474f('0x30')][_0x474f('0x4d')]({'where':{'id':_0x8e1611[_0x474f('0x59')]['id']}})[_0x474f('0x29')](handleEntityNotFound(_0x1e37ca,null))['then'](function(_0x3afcab){if(_0x3afcab){return _0x3afcab[_0x474f('0x88')](_0x8e1611[_0x474f('0x37')]['ids'])[_0x474f('0x29')](function(){if(_[_0x474f('0x8d')](_0x8e1611['query'][_0x474f('0x69')])){for(var _0x59cba2=0x0;_0x59cba2<_0x8e1611[_0x474f('0x37')][_0x474f('0x69')][_0x474f('0x3d')];_0x59cba2+=0x1){socket[_0x474f('0x73')](_0x474f('0x89'),{'UserId':Number(_0x8e1611['query'][_0x474f('0x69')][_0x59cba2]),'FaxQueueId':Number(_0x8e1611[_0x474f('0x59')]['id'])});}}else{socket[_0x474f('0x73')](_0x474f('0x89'),{'UserId':Number(_0x8e1611['query'][_0x474f('0x69')]),'FaxQueueId':Number(_0x8e1611[_0x474f('0x59')]['id'])});}});}})[_0x474f('0x29')](respondWithStatusCode(_0x1e37ca,null))['catch'](handleError(_0x1e37ca,null));};exports[_0x474f('0x8e')]=function(_0x2b0713,_0x5aaa3f,_0x5e23cb){var _0x273379={};var _0x421e67={};var _0x44e58f;var _0x58e245;return db[_0x474f('0x30')][_0x474f('0x68')]({'where':{'id':_0x2b0713[_0x474f('0x59')]['id']}})[_0x474f('0x29')](handleEntityNotFound(_0x5aaa3f,null))[_0x474f('0x29')](function(_0x3ba23d){if(_0x3ba23d){_0x44e58f=_0x3ba23d;_0x421e67[_0x474f('0x35')]=_[_0x474f('0x38')](db[_0x474f('0x5f')][_0x474f('0x31')]);_0x421e67['query']=_['keys'](_0x2b0713[_0x474f('0x37')]);_0x421e67[_0x474f('0x39')]=_[_0x474f('0x3a')](_0x421e67[_0x474f('0x35')],_0x421e67[_0x474f('0x37')]);_0x273379['attributes']=_[_0x474f('0x3a')](_0x421e67['model'],qs['fields'](_0x2b0713[_0x474f('0x37')][_0x474f('0x3c')]));_0x273379['attributes']=_0x273379[_0x474f('0x3b')][_0x474f('0x3d')]?_0x273379[_0x474f('0x3b')]:_0x421e67[_0x474f('0x35')];_0x273379[_0x474f('0x40')]=qs[_0x474f('0x41')](_0x2b0713[_0x474f('0x37')][_0x474f('0x41')]);_0x273379['where']=qs[_0x474f('0x39')](_[_0x474f('0x5d')](_0x2b0713[_0x474f('0x37')],_0x421e67[_0x474f('0x39')]));if(_0x2b0713[_0x474f('0x37')]['filter']){_0x273379['where']=_[_0x474f('0x42')](_0x273379[_0x474f('0x43')],{'$or':_['map'](_0x273379[_0x474f('0x3b')],function(_0x28b4c9){var _0x583ceb={};_0x583ceb[_0x28b4c9]={'$like':'%'+_0x2b0713[_0x474f('0x37')][_0x474f('0x45')]+'%'};return _0x583ceb;})});}_0x273379=_[_0x474f('0x42')]({},_0x273379,_0x2b0713['options']);return _0x44e58f[_0x474f('0x8e')](_0x273379);}})['then'](function(_0x45a40b){if(_0x45a40b){_0x58e245=_0x45a40b[_0x474f('0x3d')];if(!_0x2b0713[_0x474f('0x37')][_0x474f('0x3e')](_0x474f('0x3f'))){_0x273379['limit']=qs[_0x474f('0x23')](_0x2b0713[_0x474f('0x37')][_0x474f('0x23')]);_0x273379['offset']=qs[_0x474f('0x22')](_0x2b0713['query'][_0x474f('0x22')]);}return _0x44e58f[_0x474f('0x8e')](_0x273379);}})[_0x474f('0x29')](function(_0x32a143){if(_0x32a143){return _0x32a143?{'count':_0x58e245,'rows':_0x32a143}:null;}})['then'](respondWithResult(_0x5aaa3f,null))['catch'](handleError(_0x5aaa3f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 813ca6c..bc52139 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 _0xf3db=['emit','hasOwnProperty','hook','setMaxListeners','save','update','remove'];(function(_0x69c202,_0x59f36e){var _0x413774=function(_0x144e05){while(--_0x144e05){_0x69c202['push'](_0x69c202['shift']());}};_0x413774(++_0x59f36e);}(_0xf3db,0xce));var _0xbf3d=function(_0x50904c,_0x42d216){_0x50904c=_0x50904c-0x0;var _0x5e40ff=_0xf3db[_0x50904c];return _0x5e40ff;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xbf3d('0x0')](0x0);var events={'afterCreate':_0xbf3d('0x1'),'afterUpdate':_0xbf3d('0x2'),'afterDestroy':_0xbf3d('0x3')};function emitEvent(_0x7a172){return function(_0x2d24f9,_0x5e4f10,_0xe3f2ac){FaxQueueEvents[_0xbf3d('0x4')](_0x7a172+':'+_0x2d24f9['id'],_0x2d24f9);FaxQueueEvents[_0xbf3d('0x4')](_0x7a172,_0x2d24f9);_0xe3f2ac(null);};}for(var e in events){if(events[_0xbf3d('0x5')](e)){var event=events[e];FaxQueue[_0xbf3d('0x6')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0xffe9=['events','../../mysqldb','FaxQueue','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x581700,_0x2a3d1e){var _0x23c47b=function(_0xb42e1f){while(--_0xb42e1f){_0x581700['push'](_0x581700['shift']());}};_0x23c47b(++_0x2a3d1e);}(_0xffe9,0xb4));var _0x9ffe=function(_0x35e75a,_0x5ed225){_0x35e75a=_0x35e75a-0x0;var _0xb23c7f=_0xffe9[_0x35e75a];return _0xb23c7f;};'use strict';var EventEmitter=require(_0x9ffe('0x0'));var FaxQueue=require(_0x9ffe('0x1'))['db'][_0x9ffe('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x9ffe('0x3'),'afterDestroy':_0x9ffe('0x4')};function emitEvent(_0x50a3bd){return function(_0x1341f7,_0x564134,_0x105512){FaxQueueEvents[_0x9ffe('0x5')](_0x50a3bd+':'+_0x1341f7['id'],_0x1341f7);FaxQueueEvents[_0x9ffe('0x5')](_0x50a3bd,_0x1341f7);_0x105512(null);};}for(var e in events){if(events[_0x9ffe('0x6')](e)){var event=events[e];FaxQueue[_0x9ffe('0x7')](e,emitEvent(event));}}module[_0x9ffe('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 1990ce3..df81031 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 _0x7f99=['define','FaxQueue','fax_queues','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','exports'];(function(_0x2a93b7,_0x47ee93){var _0x148619=function(_0x1891e8){while(--_0x1891e8){_0x2a93b7['push'](_0x2a93b7['shift']());}};_0x148619(++_0x47ee93);}(_0x7f99,0xb9));var _0x97f9=function(_0x1bb80c,_0x26d406){_0x1bb80c=_0x1bb80c-0x0;var _0x368f16=_0x7f99[_0x1bb80c];return _0x368f16;};'use strict';var _=require(_0x97f9('0x0'));var util=require(_0x97f9('0x1'));var logger=require(_0x97f9('0x2'))(_0x97f9('0x3'));var moment=require(_0x97f9('0x4'));var BPromise=require('bluebird');var rp=require(_0x97f9('0x5'));var fs=require('fs');var path=require(_0x97f9('0x6'));var rimraf=require(_0x97f9('0x7'));var config=require(_0x97f9('0x8'));var attributes=require(_0x97f9('0x9'));module[_0x97f9('0xa')]=function(_0xcf2c0c,_0x159ea6){return _0xcf2c0c[_0x97f9('0xb')](_0x97f9('0xc'),attributes,{'tableName':_0x97f9('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8da6=['request-promise','rimraf','./faxQueue.attributes','exports','FaxQueue','fax_queues','lodash','../../config/logger','api','moment','bluebird'];(function(_0x564a3f,_0x54c8f1){var _0x568d68=function(_0x9a063b){while(--_0x9a063b){_0x564a3f['push'](_0x564a3f['shift']());}};_0x568d68(++_0x54c8f1);}(_0x8da6,0x74));var _0x68da=function(_0x3246a0,_0x5ab5da){_0x3246a0=_0x3246a0-0x0;var _0x488755=_0x8da6[_0x3246a0];return _0x488755;};'use strict';var _=require(_0x68da('0x0'));var util=require('util');var logger=require(_0x68da('0x1'))(_0x68da('0x2'));var moment=require(_0x68da('0x3'));var BPromise=require(_0x68da('0x4'));var rp=require(_0x68da('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x68da('0x6'));var config=require('../../config/environment');var attributes=require(_0x68da('0x7'));module[_0x68da('0x8')]=function(_0xc80aed,_0x5dbc16){return _0xc80aed['define'](_0x68da('0x9'),attributes,{'tableName':_0x68da('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.rpc.js b/server/api/faxQueue/faxQueue.rpc.js index e5abca9..3e6d6a3 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 _0xe622=['where','lodash','moment','bluebird','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','FaxQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','FaxQueue','findAll','options','raw','limit','include','map','model','attributes','debug','GetFaxQueue','stringify','ShowFaxQueue'];(function(_0x5e3191,_0x47fe85){var _0xc8d5e6=function(_0x478881){while(--_0x478881){_0x5e3191['push'](_0x5e3191['shift']());}};_0xc8d5e6(++_0x47fe85);}(_0xe622,0x1d5));var _0x2e62=function(_0x1a798c,_0x4b66d1){_0x1a798c=_0x1a798c-0x0;var _0x43a000=_0xe622[_0x1a798c];return _0x43a000;};'use strict';var _=require(_0x2e62('0x0'));var util=require('util');var moment=require(_0x2e62('0x1'));var BPromise=require(_0x2e62('0x2'));var rs=require(_0x2e62('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x2e62('0x4'))(_0x2e62('0x5'));var config=require(_0x2e62('0x6'));var jayson=require(_0x2e62('0x7'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x2e62('0x8')](config[_0x2e62('0x9')],{'host':_0x2e62('0xa'),'port':0x18eb});var socket=require(_0x2e62('0xb'))(new Redis(config[_0x2e62('0x9')]));require(_0x2e62('0xc'))[_0x2e62('0xd')](socket);function respondWithRpcPromise(_0x6d2a0b,_0x541504,_0x142ccd){return new BPromise(function(_0x37d660,_0x14017b){return client[_0x2e62('0xe')](_0x6d2a0b,_0x142ccd)[_0x2e62('0xf')](function(_0x128f6b){logger[_0x2e62('0x10')](_0x2e62('0x11'),_0x541504,_0x2e62('0x12'));logger['debug'](_0x2e62('0x13'),_0x541504,_0x2e62('0x12'),JSON['stringify'](_0x128f6b));if(_0x128f6b[_0x2e62('0x14')]){if(_0x128f6b['error'][_0x2e62('0x15')]===0x1f4){logger[_0x2e62('0x14')]('FaxQueue,\x20%s,\x20%s',_0x541504,_0x128f6b[_0x2e62('0x14')][_0x2e62('0x16')]);return _0x14017b(_0x128f6b[_0x2e62('0x14')][_0x2e62('0x16')]);}logger[_0x2e62('0x14')](_0x2e62('0x11'),_0x541504,_0x128f6b[_0x2e62('0x14')][_0x2e62('0x16')]);return _0x37d660(_0x128f6b[_0x2e62('0x14')]['message']);}else{logger[_0x2e62('0x10')](_0x2e62('0x11'),_0x541504,'request\x20sent');_0x37d660(_0x128f6b[_0x2e62('0x17')][_0x2e62('0x16')]);}})[_0x2e62('0x18')](function(_0x512134){logger[_0x2e62('0x14')](_0x2e62('0x11'),_0x541504,_0x512134);_0x14017b(_0x512134);});});}exports['GetFaxQueue']=function(_0x8c1375){var _0x4cf3d7=this;return new Promise(function(_0x374bcc,_0x94bc45){return db[_0x2e62('0x19')][_0x2e62('0x1a')]({'raw':_0x8c1375[_0x2e62('0x1b')]?_0x8c1375['options'][_0x2e62('0x1c')]===undefined?!![]:![]:!![],'where':_0x8c1375['options']?_0x8c1375[_0x2e62('0x1b')]['where']||null:null,'attributes':_0x8c1375[_0x2e62('0x1b')]?_0x8c1375[_0x2e62('0x1b')]['attributes']||null:null,'limit':_0x8c1375[_0x2e62('0x1b')]?_0x8c1375[_0x2e62('0x1b')][_0x2e62('0x1d')]||null:null,'include':_0x8c1375[_0x2e62('0x1b')]?_0x8c1375[_0x2e62('0x1b')][_0x2e62('0x1e')]?_[_0x2e62('0x1f')](_0x8c1375[_0x2e62('0x1b')][_0x2e62('0x1e')],function(_0x260711){return{'model':db[_0x260711[_0x2e62('0x20')]],'as':_0x260711['as'],'attributes':_0x260711[_0x2e62('0x21')],'include':_0x260711[_0x2e62('0x1e')]?_['map'](_0x260711[_0x2e62('0x1e')],function(_0x13a2c9){return{'model':db[_0x13a2c9['model']],'as':_0x13a2c9['as'],'attributes':_0x13a2c9[_0x2e62('0x21')],'include':_0x13a2c9[_0x2e62('0x1e')]?_[_0x2e62('0x1f')](_0x13a2c9[_0x2e62('0x1e')],function(_0x3d5357){return{'model':db[_0x3d5357['model']],'as':_0x3d5357['as'],'attributes':_0x3d5357['attributes']};}):[]};}):[]};}):[]:[]})[_0x2e62('0xf')](function(_0x227b3a){logger[_0x2e62('0x10')]('GetFaxQueue',_0x8c1375);logger[_0x2e62('0x22')](_0x2e62('0x23'),_0x8c1375,JSON[_0x2e62('0x24')](_0x227b3a));_0x374bcc(_0x227b3a);})[_0x2e62('0x18')](function(_0x351e25){logger[_0x2e62('0x14')](_0x2e62('0x23'),_0x351e25[_0x2e62('0x16')],_0x8c1375);_0x94bc45(_0x4cf3d7[_0x2e62('0x14')](0x1f4,_0x351e25[_0x2e62('0x16')]));});});};exports[_0x2e62('0x25')]=function(_0x392ccb){var _0x176c4f=this;return new Promise(function(_0x34825e,_0x4e85e0){return db[_0x2e62('0x19')]['find']({'raw':_0x392ccb[_0x2e62('0x1b')]?_0x392ccb[_0x2e62('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x392ccb[_0x2e62('0x1b')]?_0x392ccb[_0x2e62('0x1b')][_0x2e62('0x26')]||null:null,'attributes':_0x392ccb['options']?_0x392ccb[_0x2e62('0x1b')][_0x2e62('0x21')]||null:null,'include':_0x392ccb['options']?_0x392ccb[_0x2e62('0x1b')]['include']?_[_0x2e62('0x1f')](_0x392ccb[_0x2e62('0x1b')][_0x2e62('0x1e')],function(_0x4b1f97){return{'model':db[_0x4b1f97[_0x2e62('0x20')]],'as':_0x4b1f97['as'],'attributes':_0x4b1f97[_0x2e62('0x21')],'include':_0x4b1f97[_0x2e62('0x1e')]?_[_0x2e62('0x1f')](_0x4b1f97[_0x2e62('0x1e')],function(_0x229e03){return{'model':db[_0x229e03['model']],'as':_0x229e03['as'],'attributes':_0x229e03[_0x2e62('0x21')],'include':_0x229e03[_0x2e62('0x1e')]?_['map'](_0x229e03[_0x2e62('0x1e')],function(_0x3f8fe2){return{'model':db[_0x3f8fe2[_0x2e62('0x20')]],'as':_0x3f8fe2['as'],'attributes':_0x3f8fe2[_0x2e62('0x21')]};}):[]};}):[]};}):[]:[]})[_0x2e62('0xf')](function(_0x4a02f6){logger[_0x2e62('0x10')](_0x2e62('0x25'),_0x392ccb);logger[_0x2e62('0x22')](_0x2e62('0x25'),_0x392ccb,JSON[_0x2e62('0x24')](_0x4a02f6));_0x34825e(_0x4a02f6);})[_0x2e62('0x18')](function(_0x11e573){logger[_0x2e62('0x14')](_0x2e62('0x25'),_0x11e573['message'],_0x392ccb);_0x4e85e0(_0x176c4f[_0x2e62('0x14')](0x1f4,_0x11e573[_0x2e62('0x16')]));});});}; \ No newline at end of file +var _0x3429=['include','model','map','ShowFaxQueue','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetFaxQueue','FaxQueue','options','raw','where','attributes','limit'];(function(_0x56b138,_0x2396d6){var _0x3df878=function(_0x4b3ccc){while(--_0x4b3ccc){_0x56b138['push'](_0x56b138['shift']());}};_0x3df878(++_0x2396d6);}(_0x3429,0xa5));var _0x9342=function(_0x3a1a29,_0x48f9d3){_0x3a1a29=_0x3a1a29-0x0;var _0x9cc96d=_0x3429[_0x3a1a29];return _0x9cc96d;};'use strict';var _=require('lodash');var util=require(_0x9342('0x0'));var moment=require(_0x9342('0x1'));var BPromise=require(_0x9342('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9342('0x3'));var db=require(_0x9342('0x4'))['db'];var utils=require(_0x9342('0x5'));var logger=require(_0x9342('0x6'))(_0x9342('0x7'));var config=require(_0x9342('0x8'));var jayson=require(_0x9342('0x9'));var client=jayson[_0x9342('0xa')][_0x9342('0xb')]({'port':0x232a});config[_0x9342('0xc')]=_[_0x9342('0xd')](config[_0x9342('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x9342('0xe'))[_0x9342('0xf')](socket);function respondWithRpcPromise(_0x4ca2a0,_0x264e43,_0x1c9418){return new BPromise(function(_0x2b28ca,_0x489aa0){return client[_0x9342('0x10')](_0x4ca2a0,_0x1c9418)[_0x9342('0x11')](function(_0x40af17){logger[_0x9342('0x12')](_0x9342('0x13'),_0x264e43,_0x9342('0x14'));logger[_0x9342('0x15')](_0x9342('0x16'),_0x264e43,_0x9342('0x14'),JSON[_0x9342('0x17')](_0x40af17));if(_0x40af17['error']){if(_0x40af17[_0x9342('0x18')][_0x9342('0x19')]===0x1f4){logger[_0x9342('0x18')](_0x9342('0x13'),_0x264e43,_0x40af17[_0x9342('0x18')][_0x9342('0x1a')]);return _0x489aa0(_0x40af17[_0x9342('0x18')][_0x9342('0x1a')]);}logger[_0x9342('0x18')](_0x9342('0x13'),_0x264e43,_0x40af17[_0x9342('0x18')][_0x9342('0x1a')]);return _0x2b28ca(_0x40af17[_0x9342('0x18')][_0x9342('0x1a')]);}else{logger[_0x9342('0x12')](_0x9342('0x13'),_0x264e43,_0x9342('0x14'));_0x2b28ca(_0x40af17['result'][_0x9342('0x1a')]);}})[_0x9342('0x1b')](function(_0x395ec8){logger[_0x9342('0x18')]('FaxQueue,\x20%s,\x20%s',_0x264e43,_0x395ec8);_0x489aa0(_0x395ec8);});});}exports[_0x9342('0x1c')]=function(_0x484a69){var _0x13b2fe=this;return new Promise(function(_0x3723b3,_0x5b00d8){return db[_0x9342('0x1d')]['findAll']({'raw':_0x484a69[_0x9342('0x1e')]?_0x484a69['options'][_0x9342('0x1f')]===undefined?!![]:![]:!![],'where':_0x484a69[_0x9342('0x1e')]?_0x484a69['options'][_0x9342('0x20')]||null:null,'attributes':_0x484a69[_0x9342('0x1e')]?_0x484a69[_0x9342('0x1e')][_0x9342('0x21')]||null:null,'limit':_0x484a69[_0x9342('0x1e')]?_0x484a69[_0x9342('0x1e')][_0x9342('0x22')]||null:null,'include':_0x484a69['options']?_0x484a69[_0x9342('0x1e')]['include']?_['map'](_0x484a69[_0x9342('0x1e')][_0x9342('0x23')],function(_0x5db508){return{'model':db[_0x5db508[_0x9342('0x24')]],'as':_0x5db508['as'],'attributes':_0x5db508[_0x9342('0x21')],'include':_0x5db508[_0x9342('0x23')]?_[_0x9342('0x25')](_0x5db508['include'],function(_0x35dce1){return{'model':db[_0x35dce1['model']],'as':_0x35dce1['as'],'attributes':_0x35dce1['attributes'],'include':_0x35dce1[_0x9342('0x23')]?_[_0x9342('0x25')](_0x35dce1[_0x9342('0x23')],function(_0x1ef9a6){return{'model':db[_0x1ef9a6[_0x9342('0x24')]],'as':_0x1ef9a6['as'],'attributes':_0x1ef9a6[_0x9342('0x21')]};}):[]};}):[]};}):[]:[]})[_0x9342('0x11')](function(_0x11f68a){logger[_0x9342('0x12')](_0x9342('0x1c'),_0x484a69);logger['debug'](_0x9342('0x1c'),_0x484a69,JSON[_0x9342('0x17')](_0x11f68a));_0x3723b3(_0x11f68a);})['catch'](function(_0x4e6b68){logger[_0x9342('0x18')](_0x9342('0x1c'),_0x4e6b68[_0x9342('0x1a')],_0x484a69);_0x5b00d8(_0x13b2fe[_0x9342('0x18')](0x1f4,_0x4e6b68[_0x9342('0x1a')]));});});};exports[_0x9342('0x26')]=function(_0x3d8ef6){var _0x521760=this;return new Promise(function(_0x387f93,_0x3cfafa){return db[_0x9342('0x1d')][_0x9342('0x27')]({'raw':_0x3d8ef6[_0x9342('0x1e')]?_0x3d8ef6[_0x9342('0x1e')][_0x9342('0x1f')]===undefined?!![]:![]:!![],'where':_0x3d8ef6[_0x9342('0x1e')]?_0x3d8ef6[_0x9342('0x1e')]['where']||null:null,'attributes':_0x3d8ef6['options']?_0x3d8ef6[_0x9342('0x1e')]['attributes']||null:null,'include':_0x3d8ef6['options']?_0x3d8ef6[_0x9342('0x1e')][_0x9342('0x23')]?_[_0x9342('0x25')](_0x3d8ef6[_0x9342('0x1e')][_0x9342('0x23')],function(_0x1ea716){return{'model':db[_0x1ea716[_0x9342('0x24')]],'as':_0x1ea716['as'],'attributes':_0x1ea716[_0x9342('0x21')],'include':_0x1ea716['include']?_[_0x9342('0x25')](_0x1ea716[_0x9342('0x23')],function(_0x39cc5a){return{'model':db[_0x39cc5a[_0x9342('0x24')]],'as':_0x39cc5a['as'],'attributes':_0x39cc5a[_0x9342('0x21')],'include':_0x39cc5a['include']?_[_0x9342('0x25')](_0x39cc5a['include'],function(_0x5b0fe4){return{'model':db[_0x5b0fe4[_0x9342('0x24')]],'as':_0x5b0fe4['as'],'attributes':_0x5b0fe4[_0x9342('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd736de){logger[_0x9342('0x12')](_0x9342('0x26'),_0x3d8ef6);logger[_0x9342('0x15')](_0x9342('0x26'),_0x3d8ef6,JSON['stringify'](_0xd736de));_0x387f93(_0xd736de);})['catch'](function(_0x2f2038){logger['error'](_0x9342('0x26'),_0x2f2038[_0x9342('0x1a')],_0x3d8ef6);_0x3cfafa(_0x521760[_0x9342('0x18')](0x1f4,_0x2f2038[_0x9342('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 17c5da7..5ba56bb 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 _0x8de4=['removeListener','register','faxQueue:','./faxQueue.events','remove','update','emit'];(function(_0x45824e,_0x4d06c3){var _0x344a3d=function(_0x3b14a2){while(--_0x3b14a2){_0x45824e['push'](_0x45824e['shift']());}};_0x344a3d(++_0x4d06c3);}(_0x8de4,0x161));var _0x48de=function(_0x11939e,_0x352d73){_0x11939e=_0x11939e-0x0;var _0x21cb23=_0x8de4[_0x11939e];return _0x21cb23;};'use strict';var FaxQueueEvents=require(_0x48de('0x0'));var events=['save',_0x48de('0x1'),_0x48de('0x2')];function createListener(_0x31c7f6,_0x135a5c){return function(_0x3277d1){_0x135a5c[_0x48de('0x3')](_0x31c7f6,_0x3277d1);};}function removeListener(_0x196cfa,_0x3a04eb){return function(){FaxQueueEvents[_0x48de('0x4')](_0x196cfa,_0x3a04eb);};}exports[_0x48de('0x5')]=function(_0x1b3228){for(var _0x13ac62=0x0,_0x57e354=events['length'];_0x13ac62<_0x57e354;_0x13ac62++){var _0xa7e6d9=events[_0x13ac62];var _0xe91909=createListener(_0x48de('0x6')+_0xa7e6d9,_0x1b3228);FaxQueueEvents['on'](_0xa7e6d9,_0xe91909);}}; \ No newline at end of file +var _0x052e=['removeListener','register','length','./faxQueue.events','save','remove','update','emit'];(function(_0x3a5e22,_0x2a5256){var _0x3965e4=function(_0x5e5884){while(--_0x5e5884){_0x3a5e22['push'](_0x3a5e22['shift']());}};_0x3965e4(++_0x2a5256);}(_0x052e,0x123));var _0xe052=function(_0x237202,_0x51ea1e){_0x237202=_0x237202-0x0;var _0x539765=_0x052e[_0x237202];return _0x539765;};'use strict';var FaxQueueEvents=require(_0xe052('0x0'));var events=[_0xe052('0x1'),_0xe052('0x2'),_0xe052('0x3')];function createListener(_0x130f34,_0x33927b){return function(_0x1fecd7){_0x33927b[_0xe052('0x4')](_0x130f34,_0x1fecd7);};}function removeListener(_0xf7b056,_0x243955){return function(){FaxQueueEvents[_0xe052('0x5')](_0xf7b056,_0x243955);};}exports[_0xe052('0x6')]=function(_0x5e6715){for(var _0x45c602=0x0,_0x4b8924=events[_0xe052('0x7')];_0x45c602<_0x4b8924;_0x45c602++){var _0x108a41=events[_0x45c602];var _0x2a7d40=createListener('faxQueue:'+_0x108a41,_0x5e6715);FaxQueueEvents['on'](_0x108a41,_0x2a7d40);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index aa72cf8..4b9ee5d 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(_0x44d85d,_0x477ae2){var _0x55f365=function(_0x84b597){while(--_0x84b597){_0x44d85d['push'](_0x44d85d['shift']());}};_0x55f365(++_0x477ae2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xbaf0[_0x432682];return _0x463d05;};'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(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1e1d07,_0x299b1e){_0x1e1d07=_0x1e1d07-0x0;var _0x225dce=_0x0b0e[_0x1e1d07];return _0x225dce;};'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 9dba5cc..2434c75 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 _0xff75=['sequelize','exports','STRING','DATE','moment'];(function(_0xa1e2fd,_0x1c9305){var _0x218880=function(_0x405167){while(--_0x405167){_0xa1e2fd['push'](_0xa1e2fd['shift']());}};_0x218880(++_0x1c9305);}(_0xff75,0x1c1));var _0x5ff7=function(_0x122305,_0xc84b0d){_0x122305=_0x122305-0x0;var _0x45b310=_0xff75[_0x122305];return _0x45b310;};'use strict';var moment=require(_0x5ff7('0x0'));var Sequelize=require(_0x5ff7('0x1'));module[_0x5ff7('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0x5ff7('0x3')]},'joinAt':{'type':Sequelize[_0x5ff7('0x4')]},'leaveAt':{'type':Sequelize[_0x5ff7('0x4')]},'acceptAt':{'type':Sequelize[_0x5ff7('0x4')]},'exitAt':{'type':Sequelize[_0x5ff7('0x4')]},'reason':{'type':Sequelize[_0x5ff7('0x3')]}}; \ No newline at end of file +var _0x1bb9=['exports','STRING','DATE','moment','sequelize'];(function(_0x522d14,_0x21781e){var _0xa271eb=function(_0x7a110d){while(--_0x7a110d){_0x522d14['push'](_0x522d14['shift']());}};_0xa271eb(++_0x21781e);}(_0x1bb9,0x148));var _0x91bb=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x1bb9[_0x2c91e9];return _0x13f0ff;};'use strict';var moment=require(_0x91bb('0x0'));var Sequelize=require(_0x91bb('0x1'));module[_0x91bb('0x2')]={'uniqueid':{'type':Sequelize[_0x91bb('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x91bb('0x4')]},'leaveAt':{'type':Sequelize[_0x91bb('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x91bb('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 4508ef1..d8f6267 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 _0x940e=['body','describe','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','status','send','index','FaxQueueReport','rawAttributes','fieldName','key','map','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','merge','options','includeAll','findAll','rows','catch','show','params','include','find','create'];(function(_0x4864ad,_0x385a5a){var _0x35f28e=function(_0xa9b137){while(--_0xa9b137){_0x4864ad['push'](_0x4864ad['shift']());}};_0x35f28e(++_0x385a5a);}(_0x940e,0x174));var _0xe940=function(_0x7ad6cb,_0xffee6c){_0x7ad6cb=_0x7ad6cb-0x0;var _0x22a0ba=_0x940e[_0x7ad6cb];return _0x22a0ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe940('0x0'));var rimraf=require(_0xe940('0x1'));var zipdir=require(_0xe940('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe940('0x3'));var moment=require(_0xe940('0x4'));var BPromise=require(_0xe940('0x5'));var Mustache=require(_0xe940('0x6'));var util=require(_0xe940('0x7'));var path=require(_0xe940('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe940('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xe940('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xe940('0xb'));var toCsv=require('to-csv');var querystring=require(_0xe940('0xc'));var Papa=require(_0xe940('0xd'));var Redis=require(_0xe940('0xe'));var authService=require(_0xe940('0xf'));var qs=require(_0xe940('0x10'));var as=require(_0xe940('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe940('0x12'))(_0xe940('0x13'));var utils=require(_0xe940('0x14'));var config=require(_0xe940('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x21b0e,_0x470408){_0x470408=_0x470408||0xcc;return function(_0x3789b5){if(_0x3789b5){return _0x21b0e[_0xe940('0x16')](_0x470408);}return _0x21b0e['status'](_0x470408)[_0xe940('0x17')]();};}function respondWithResult(_0x56b5f4,_0x2d030f){_0x2d030f=_0x2d030f||0xc8;return function(_0x326727){if(_0x326727){return _0x56b5f4['status'](_0x2d030f)[_0xe940('0x18')](_0x326727);}};}function respondWithFilteredResult(_0x21dc97,_0x4cea35){return function(_0x1d97d1){if(_0x1d97d1){var _0x4c581b=_0x1d97d1[_0xe940('0x19')],_0xa8fa2b=_0x4cea35[_0xe940('0x1a')],_0x332132=_0x4cea35['offset']+_0x4cea35[_0xe940('0x1b')],_0x3d7c4e;if(_0x332132>=_0x4c581b){_0x332132=_0x4c581b;_0x3d7c4e=0xc8;}else{_0x3d7c4e=0xce;}_0x21dc97['status'](_0x3d7c4e);return _0x21dc97[_0xe940('0x1c')](_0xe940('0x1d'),_0xa8fa2b+'-'+_0x332132+'/'+_0x4c581b)[_0xe940('0x18')](_0x1d97d1);}return null;};}function patchUpdates(_0x42eaee){return function(_0x3beec1){try{jsonpatch[_0xe940('0x1e')](_0x3beec1,_0x42eaee,!![]);}catch(_0xf2212){return BPromise['reject'](_0xf2212);}return _0x3beec1[_0xe940('0x1f')]();};}function saveUpdates(_0x207052,_0x1a58bd){return function(_0x44668c){if(_0x44668c){return _0x44668c[_0xe940('0x20')](_0x207052)[_0xe940('0x21')](function(_0x5caf6c){return _0x5caf6c;});}return null;};}function removeEntity(_0x37c452,_0x2b625a){return function(_0x4871b8){if(_0x4871b8){return _0x4871b8[_0xe940('0x22')]()[_0xe940('0x21')](function(){_0x37c452['status'](0xcc)[_0xe940('0x17')]();});}};}function handleEntityNotFound(_0x27a0dd,_0x147089){return function(_0xf294b3){if(!_0xf294b3){_0x27a0dd['sendStatus'](0x194);}return _0xf294b3;};}function handleError(_0x1954b7,_0x492575){_0x492575=_0x492575||0x1f4;return function(_0x3cc773){logger['error'](_0x3cc773[_0xe940('0x23')]);if(_0x3cc773['name']){delete _0x3cc773['name'];}_0x1954b7[_0xe940('0x24')](_0x492575)[_0xe940('0x25')](_0x3cc773);};}exports[_0xe940('0x26')]=function(_0x4163fd,_0xd3a590){var _0x1cb807={},_0x3938d3={},_0x4d7fe1={'count':0x0,'rows':[]};var _0x3e4f36=_['map'](db[_0xe940('0x27')][_0xe940('0x28')],function(_0xa06bec){return{'name':_0xa06bec[_0xe940('0x29')],'type':_0xa06bec['type'][_0xe940('0x2a')]};});_0x3938d3['model']=_[_0xe940('0x2b')](_0x3e4f36,_0xe940('0x2c'));_0x3938d3[_0xe940('0x2d')]=_[_0xe940('0x2e')](_0x4163fd[_0xe940('0x2d')]);_0x3938d3[_0xe940('0x2f')]=_[_0xe940('0x30')](_0x3938d3[_0xe940('0x31')],_0x3938d3['query']);_0x1cb807[_0xe940('0x32')]=_[_0xe940('0x30')](_0x3938d3['model'],qs[_0xe940('0x33')](_0x4163fd[_0xe940('0x2d')][_0xe940('0x33')]));_0x1cb807[_0xe940('0x32')]=_0x1cb807['attributes'][_0xe940('0x34')]?_0x1cb807['attributes']:_0x3938d3[_0xe940('0x31')];if(!_0x4163fd[_0xe940('0x2d')][_0xe940('0x35')](_0xe940('0x36'))){_0x1cb807[_0xe940('0x1b')]=qs['limit'](_0x4163fd['query']['limit']);_0x1cb807['offset']=qs[_0xe940('0x1a')](_0x4163fd[_0xe940('0x2d')][_0xe940('0x1a')]);}_0x1cb807[_0xe940('0x37')]=qs['sort'](_0x4163fd[_0xe940('0x2d')][_0xe940('0x38')]);_0x1cb807['where']=qs[_0xe940('0x2f')](_[_0xe940('0x39')](_0x4163fd[_0xe940('0x2d')],_0x3938d3[_0xe940('0x2f')]));if(_0x4163fd[_0xe940('0x2d')][_0xe940('0x3a')]){_0x1cb807[_0xe940('0x3b')]=_['merge'](_0x1cb807[_0xe940('0x3b')],{'$or':_['map'](_0x3e4f36,function(_0x14daaf){if(_0x14daaf[_0xe940('0x3c')]!=='VIRTUAL'){var _0x78c751={};_0x78c751[_0x14daaf[_0xe940('0x2c')]]={'$like':'%'+_0x4163fd['query'][_0xe940('0x3a')]+'%'};return _0x78c751;}})});}_0x1cb807=_[_0xe940('0x3d')]({},_0x1cb807,_0x4163fd[_0xe940('0x3e')]);var _0x360240={'where':_0x1cb807[_0xe940('0x3b')]};return db[_0xe940('0x27')][_0xe940('0x19')](_0x360240)[_0xe940('0x21')](function(_0x259b5a){_0x4d7fe1[_0xe940('0x19')]=_0x259b5a;if(_0x4163fd[_0xe940('0x2d')][_0xe940('0x3f')]){_0x1cb807['include']=[{'all':!![]}];}return db[_0xe940('0x27')][_0xe940('0x40')](_0x1cb807);})['then'](function(_0x5e1433){_0x4d7fe1[_0xe940('0x41')]=_0x5e1433;return _0x4d7fe1;})[_0xe940('0x21')](respondWithFilteredResult(_0xd3a590,_0x1cb807))[_0xe940('0x42')](handleError(_0xd3a590,null));};exports[_0xe940('0x43')]=function(_0x11d806,_0x623ba1){var _0x26f57b={'raw':!![],'where':{'id':_0x11d806[_0xe940('0x44')]['id']}},_0x38c09e={};_0x38c09e[_0xe940('0x31')]=_['keys'](db[_0xe940('0x27')]['rawAttributes']);_0x38c09e[_0xe940('0x2d')]=_[_0xe940('0x2e')](_0x11d806['query']);_0x38c09e[_0xe940('0x2f')]=_[_0xe940('0x30')](_0x38c09e[_0xe940('0x31')],_0x38c09e[_0xe940('0x2d')]);_0x26f57b['attributes']=_[_0xe940('0x30')](_0x38c09e[_0xe940('0x31')],qs[_0xe940('0x33')](_0x11d806[_0xe940('0x2d')]['fields']));_0x26f57b[_0xe940('0x32')]=_0x26f57b[_0xe940('0x32')][_0xe940('0x34')]?_0x26f57b[_0xe940('0x32')]:_0x38c09e[_0xe940('0x31')];if(_0x11d806[_0xe940('0x2d')]['includeAll']){_0x26f57b[_0xe940('0x45')]=[{'all':!![]}];}_0x26f57b=_['merge']({},_0x26f57b,_0x11d806[_0xe940('0x3e')]);return db[_0xe940('0x27')][_0xe940('0x46')](_0x26f57b)[_0xe940('0x21')](handleEntityNotFound(_0x623ba1,null))[_0xe940('0x21')](respondWithResult(_0x623ba1,null))[_0xe940('0x42')](handleError(_0x623ba1,null));};exports[_0xe940('0x47')]=function(_0x4e47e7,_0x1dcb2c){return db['FaxQueueReport'][_0xe940('0x47')](_0x4e47e7[_0xe940('0x48')],{})[_0xe940('0x21')](respondWithResult(_0x1dcb2c,0xc9))[_0xe940('0x42')](handleError(_0x1dcb2c,null));};exports[_0xe940('0x20')]=function(_0x448fa7,_0x1f3b8b){if(_0x448fa7[_0xe940('0x48')]['id']){delete _0x448fa7['body']['id'];}return db['FaxQueueReport']['find']({'where':{'id':_0x448fa7[_0xe940('0x44')]['id']}})[_0xe940('0x21')](handleEntityNotFound(_0x1f3b8b,null))[_0xe940('0x21')](saveUpdates(_0x448fa7[_0xe940('0x48')],null))[_0xe940('0x21')](respondWithResult(_0x1f3b8b,null))[_0xe940('0x42')](handleError(_0x1f3b8b,null));};exports[_0xe940('0x22')]=function(_0x3c2c87,_0x396517){return db['FaxQueueReport']['find']({'where':{'id':_0x3c2c87[_0xe940('0x44')]['id']}})['then'](handleEntityNotFound(_0x396517,null))[_0xe940('0x21')](removeEntity(_0x396517,null))['catch'](handleError(_0x396517,null));};exports[_0xe940('0x49')]=function(_0x5dbcfc,_0x28fced){return db['FaxQueueReport'][_0xe940('0x49')]()[_0xe940('0x21')](respondWithResult(_0x28fced,null))['catch'](handleError(_0x28fced,null));}; \ No newline at end of file +var _0x9a61=['key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','length','include','catch','create','body','find','params','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','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','status','end','json','count','offset','limit','apply','reject','save','then','stack','name','index','FaxQueueReport','rawAttributes','fieldName'];(function(_0x29fdc8,_0x1b7742){var _0x2009ec=function(_0x3ef421){while(--_0x3ef421){_0x29fdc8['push'](_0x29fdc8['shift']());}};_0x2009ec(++_0x1b7742);}(_0x9a61,0x6a));var _0x19a6=function(_0x14a4e8,_0xf4be45){_0x14a4e8=_0x14a4e8-0x0;var _0x235de9=_0x9a61[_0x14a4e8];return _0x235de9;};'use strict';var pdf=require(_0x19a6('0x0'));var emlformat=require(_0x19a6('0x1'));var rimraf=require(_0x19a6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x19a6('0x3'));var rp=require('request-promise');var moment=require(_0x19a6('0x4'));var BPromise=require(_0x19a6('0x5'));var Mustache=require(_0x19a6('0x6'));var util=require('util');var path=require(_0x19a6('0x7'));var sox=require(_0x19a6('0x8'));var csv=require(_0x19a6('0x9'));var ejs=require(_0x19a6('0xa'));var fs=require('fs');var _=require(_0x19a6('0xb'));var squel=require('squel');var crypto=require(_0x19a6('0xc'));var jsforce=require(_0x19a6('0xd'));var deskjs=require(_0x19a6('0xe'));var toCsv=require('to-csv');var querystring=require(_0x19a6('0xf'));var Papa=require(_0x19a6('0x10'));var Redis=require(_0x19a6('0x11'));var authService=require(_0x19a6('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x19a6('0x13'));var logger=require(_0x19a6('0x14'))(_0x19a6('0x15'));var utils=require(_0x19a6('0x16'));var config=require(_0x19a6('0x17'));var db=require(_0x19a6('0x18'))['db'];function respondWithStatusCode(_0x23df57,_0x17b189){_0x17b189=_0x17b189||0xcc;return function(_0x5304ff){if(_0x5304ff){return _0x23df57[_0x19a6('0x19')](_0x17b189);}return _0x23df57[_0x19a6('0x1a')](_0x17b189)[_0x19a6('0x1b')]();};}function respondWithResult(_0x1c98d2,_0x3a5f50){_0x3a5f50=_0x3a5f50||0xc8;return function(_0x2ab401){if(_0x2ab401){return _0x1c98d2[_0x19a6('0x1a')](_0x3a5f50)[_0x19a6('0x1c')](_0x2ab401);}};}function respondWithFilteredResult(_0x5b7946,_0x22d3a3){return function(_0x5b0d4f){if(_0x5b0d4f){var _0x17b3d3=_0x5b0d4f[_0x19a6('0x1d')],_0x15272d=_0x22d3a3[_0x19a6('0x1e')],_0x1630a1=_0x22d3a3[_0x19a6('0x1e')]+_0x22d3a3[_0x19a6('0x1f')],_0x3eeb99;if(_0x1630a1>=_0x17b3d3){_0x1630a1=_0x17b3d3;_0x3eeb99=0xc8;}else{_0x3eeb99=0xce;}_0x5b7946['status'](_0x3eeb99);return _0x5b7946['set']('Content-Range',_0x15272d+'-'+_0x1630a1+'/'+_0x17b3d3)[_0x19a6('0x1c')](_0x5b0d4f);}return null;};}function patchUpdates(_0x389a69){return function(_0x196d38){try{jsonpatch[_0x19a6('0x20')](_0x196d38,_0x389a69,!![]);}catch(_0x143bb2){return BPromise[_0x19a6('0x21')](_0x143bb2);}return _0x196d38[_0x19a6('0x22')]();};}function saveUpdates(_0x1e46a0,_0x254924){return function(_0x5be256){if(_0x5be256){return _0x5be256['update'](_0x1e46a0)['then'](function(_0x2dec6b){return _0x2dec6b;});}return null;};}function removeEntity(_0xd3c863,_0x408e55){return function(_0x4e2848){if(_0x4e2848){return _0x4e2848['destroy']()[_0x19a6('0x23')](function(){_0xd3c863['status'](0xcc)[_0x19a6('0x1b')]();});}};}function handleEntityNotFound(_0x3436f6,_0x99e67d){return function(_0x1b6ce5){if(!_0x1b6ce5){_0x3436f6['sendStatus'](0x194);}return _0x1b6ce5;};}function handleError(_0x25c149,_0x18c1ab){_0x18c1ab=_0x18c1ab||0x1f4;return function(_0x804042){logger['error'](_0x804042[_0x19a6('0x24')]);if(_0x804042[_0x19a6('0x25')]){delete _0x804042['name'];}_0x25c149[_0x19a6('0x1a')](_0x18c1ab)['send'](_0x804042);};}exports[_0x19a6('0x26')]=function(_0x372f54,_0x227710){var _0x110163={},_0x4fa8d5={},_0x32ac0f={'count':0x0,'rows':[]};var _0x44563a=_['map'](db[_0x19a6('0x27')][_0x19a6('0x28')],function(_0x2ac36c){return{'name':_0x2ac36c[_0x19a6('0x29')],'type':_0x2ac36c['type'][_0x19a6('0x2a')]};});_0x4fa8d5[_0x19a6('0x2b')]=_['map'](_0x44563a,'name');_0x4fa8d5[_0x19a6('0x2c')]=_[_0x19a6('0x2d')](_0x372f54[_0x19a6('0x2c')]);_0x4fa8d5[_0x19a6('0x2e')]=_[_0x19a6('0x2f')](_0x4fa8d5[_0x19a6('0x2b')],_0x4fa8d5[_0x19a6('0x2c')]);_0x110163[_0x19a6('0x30')]=_['intersection'](_0x4fa8d5[_0x19a6('0x2b')],qs['fields'](_0x372f54[_0x19a6('0x2c')][_0x19a6('0x31')]));_0x110163[_0x19a6('0x30')]=_0x110163[_0x19a6('0x30')]['length']?_0x110163[_0x19a6('0x30')]:_0x4fa8d5[_0x19a6('0x2b')];if(!_0x372f54[_0x19a6('0x2c')]['hasOwnProperty'](_0x19a6('0x32'))){_0x110163[_0x19a6('0x1f')]=qs[_0x19a6('0x1f')](_0x372f54[_0x19a6('0x2c')]['limit']);_0x110163[_0x19a6('0x1e')]=qs[_0x19a6('0x1e')](_0x372f54[_0x19a6('0x2c')][_0x19a6('0x1e')]);}_0x110163[_0x19a6('0x33')]=qs[_0x19a6('0x34')](_0x372f54['query'][_0x19a6('0x34')]);_0x110163[_0x19a6('0x35')]=qs[_0x19a6('0x2e')](_[_0x19a6('0x36')](_0x372f54[_0x19a6('0x2c')],_0x4fa8d5[_0x19a6('0x2e')]));if(_0x372f54[_0x19a6('0x2c')][_0x19a6('0x37')]){_0x110163[_0x19a6('0x35')]=_['merge'](_0x110163[_0x19a6('0x35')],{'$or':_[_0x19a6('0x38')](_0x44563a,function(_0x4519cf){if(_0x4519cf[_0x19a6('0x39')]!==_0x19a6('0x3a')){var _0x5e4876={};_0x5e4876[_0x4519cf[_0x19a6('0x25')]]={'$like':'%'+_0x372f54[_0x19a6('0x2c')][_0x19a6('0x37')]+'%'};return _0x5e4876;}})});}_0x110163=_[_0x19a6('0x3b')]({},_0x110163,_0x372f54[_0x19a6('0x3c')]);var _0x5ed9c5={'where':_0x110163[_0x19a6('0x35')]};return db[_0x19a6('0x27')]['count'](_0x5ed9c5)['then'](function(_0x40b704){_0x32ac0f['count']=_0x40b704;if(_0x372f54[_0x19a6('0x2c')][_0x19a6('0x3d')]){_0x110163['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0x19a6('0x3e')](_0x110163);})[_0x19a6('0x23')](function(_0x3d7a32){_0x32ac0f[_0x19a6('0x3f')]=_0x3d7a32;return _0x32ac0f;})[_0x19a6('0x23')](respondWithFilteredResult(_0x227710,_0x110163))['catch'](handleError(_0x227710,null));};exports[_0x19a6('0x40')]=function(_0x3c26bb,_0x1b823c){var _0x1d567c={'raw':!![],'where':{'id':_0x3c26bb['params']['id']}},_0x1d376c={};_0x1d376c[_0x19a6('0x2b')]=_[_0x19a6('0x2d')](db[_0x19a6('0x27')][_0x19a6('0x28')]);_0x1d376c[_0x19a6('0x2c')]=_[_0x19a6('0x2d')](_0x3c26bb[_0x19a6('0x2c')]);_0x1d376c[_0x19a6('0x2e')]=_[_0x19a6('0x2f')](_0x1d376c[_0x19a6('0x2b')],_0x1d376c[_0x19a6('0x2c')]);_0x1d567c['attributes']=_[_0x19a6('0x2f')](_0x1d376c['model'],qs[_0x19a6('0x31')](_0x3c26bb[_0x19a6('0x2c')][_0x19a6('0x31')]));_0x1d567c[_0x19a6('0x30')]=_0x1d567c[_0x19a6('0x30')][_0x19a6('0x41')]?_0x1d567c['attributes']:_0x1d376c[_0x19a6('0x2b')];if(_0x3c26bb[_0x19a6('0x2c')][_0x19a6('0x3d')]){_0x1d567c[_0x19a6('0x42')]=[{'all':!![]}];}_0x1d567c=_[_0x19a6('0x3b')]({},_0x1d567c,_0x3c26bb[_0x19a6('0x3c')]);return db[_0x19a6('0x27')]['find'](_0x1d567c)[_0x19a6('0x23')](handleEntityNotFound(_0x1b823c,null))[_0x19a6('0x23')](respondWithResult(_0x1b823c,null))[_0x19a6('0x43')](handleError(_0x1b823c,null));};exports[_0x19a6('0x44')]=function(_0x42584b,_0x44f593){return db[_0x19a6('0x27')][_0x19a6('0x44')](_0x42584b[_0x19a6('0x45')],{})[_0x19a6('0x23')](respondWithResult(_0x44f593,0xc9))[_0x19a6('0x43')](handleError(_0x44f593,null));};exports['update']=function(_0x53a203,_0x331d06){if(_0x53a203[_0x19a6('0x45')]['id']){delete _0x53a203['body']['id'];}return db[_0x19a6('0x27')][_0x19a6('0x46')]({'where':{'id':_0x53a203[_0x19a6('0x47')]['id']}})[_0x19a6('0x23')](handleEntityNotFound(_0x331d06,null))[_0x19a6('0x23')](saveUpdates(_0x53a203[_0x19a6('0x45')],null))[_0x19a6('0x23')](respondWithResult(_0x331d06,null))[_0x19a6('0x43')](handleError(_0x331d06,null));};exports[_0x19a6('0x48')]=function(_0x53861c,_0x2ebb47){return db[_0x19a6('0x27')]['find']({'where':{'id':_0x53861c[_0x19a6('0x47')]['id']}})['then'](handleEntityNotFound(_0x2ebb47,null))[_0x19a6('0x23')](removeEntity(_0x2ebb47,null))[_0x19a6('0x43')](handleError(_0x2ebb47,null));};exports[_0x19a6('0x49')]=function(_0x453fed,_0x242f3f){return db['FaxQueueReport'][_0x19a6('0x49')]()[_0x19a6('0x23')](respondWithResult(_0x242f3f,null))['catch'](handleError(_0x242f3f,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 31ce171..3688015 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 _0x310b=['uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport'];(function(_0x44f347,_0x3be1a9){var _0x296219=function(_0x1dac7f){while(--_0x1dac7f){_0x44f347['push'](_0x44f347['shift']());}};_0x296219(++_0x3be1a9);}(_0x310b,0x97));var _0xb310=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0x310b[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xb310('0x0'));var util=require(_0xb310('0x1'));var logger=require(_0xb310('0x2'))(_0xb310('0x3'));var moment=require(_0xb310('0x4'));var BPromise=require(_0xb310('0x5'));var rp=require(_0xb310('0x6'));var fs=require('fs');var path=require(_0xb310('0x7'));var rimraf=require(_0xb310('0x8'));var config=require(_0xb310('0x9'));var attributes=require(_0xb310('0xa'));module[_0xb310('0xb')]=function(_0x46e69a,_0x5238c6){return _0x46e69a[_0xb310('0xc')](_0xb310('0xd'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xb310('0xe'),'fields':[_0xb310('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2b6f=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','define','FaxQueueReport','report_fax_queue','uniqueid'];(function(_0xed3d21,_0x42bdca){var _0x4a7ab3=function(_0x3db46b){while(--_0x3db46b){_0xed3d21['push'](_0xed3d21['shift']());}};_0x4a7ab3(++_0x42bdca);}(_0x2b6f,0x142));var _0xf2b6=function(_0x297c55,_0x34fa75){_0x297c55=_0x297c55-0x0;var _0x120389=_0x2b6f[_0x297c55];return _0x120389;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xf2b6('0x0'))(_0xf2b6('0x1'));var moment=require(_0xf2b6('0x2'));var BPromise=require(_0xf2b6('0x3'));var rp=require(_0xf2b6('0x4'));var fs=require('fs');var path=require(_0xf2b6('0x5'));var rimraf=require(_0xf2b6('0x6'));var config=require(_0xf2b6('0x7'));var attributes=require(_0xf2b6('0x8'));module[_0xf2b6('0x9')]=function(_0x4072ca,_0x1e587b){return _0x4072ca[_0xf2b6('0xa')](_0xf2b6('0xb'),attributes,{'tableName':_0xf2b6('0xc'),'paranoid':![],'indexes':[{'name':_0xf2b6('0xd'),'fields':[_0xf2b6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 2e3af44..4a43454 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 _0x73dd=['raw','CreateFaxQueueReport','catch','UpdateFaxQueueReport','where','attributes','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','then','info','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','FaxQueueReport','body','options'];(function(_0x39f18f,_0x41841a){var _0x8285b7=function(_0x196a8f){while(--_0x196a8f){_0x39f18f['push'](_0x39f18f['shift']());}};_0x8285b7(++_0x41841a);}(_0x73dd,0x67));var _0xd73d=function(_0x28c9eb,_0x254755){_0x28c9eb=_0x28c9eb-0x0;var _0x2e40d3=_0x73dd[_0x28c9eb];return _0x2e40d3;};'use strict';var _=require(_0xd73d('0x0'));var util=require(_0xd73d('0x1'));var moment=require(_0xd73d('0x2'));var BPromise=require('bluebird');var rs=require(_0xd73d('0x3'));var fs=require('fs');var Redis=require(_0xd73d('0x4'));var db=require(_0xd73d('0x5'))['db'];var utils=require(_0xd73d('0x6'));var logger=require(_0xd73d('0x7'))(_0xd73d('0x8'));var config=require('../../config/environment');var jayson=require(_0xd73d('0x9'));var client=jayson['client'][_0xd73d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x293525,_0x5ad2de,_0x23577b){return new BPromise(function(_0x1c0aea,_0xe90fa2){return client['request'](_0x293525,_0x23577b)[_0xd73d('0xb')](function(_0x497f34){logger[_0xd73d('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x5ad2de,'request\x20sent');logger[_0xd73d('0xd')](_0xd73d('0xe'),_0x5ad2de,_0xd73d('0xf'),JSON[_0xd73d('0x10')](_0x497f34));if(_0x497f34[_0xd73d('0x11')]){if(_0x497f34[_0xd73d('0x11')][_0xd73d('0x12')]===0x1f4){logger[_0xd73d('0x11')](_0xd73d('0x13'),_0x5ad2de,_0x497f34[_0xd73d('0x11')][_0xd73d('0x14')]);return _0xe90fa2(_0x497f34['error'][_0xd73d('0x14')]);}logger[_0xd73d('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x5ad2de,_0x497f34[_0xd73d('0x11')][_0xd73d('0x14')]);return _0x1c0aea(_0x497f34[_0xd73d('0x11')][_0xd73d('0x14')]);}else{logger['info'](_0xd73d('0x13'),_0x5ad2de,_0xd73d('0xf'));_0x1c0aea(_0x497f34[_0xd73d('0x15')][_0xd73d('0x14')]);}})['catch'](function(_0x2b9454){logger[_0xd73d('0x11')](_0xd73d('0x13'),_0x5ad2de,_0x2b9454);_0xe90fa2(_0x2b9454);});});}exports['CreateFaxQueueReport']=function(_0x2151e3){var _0x3785b6=this;return new Promise(function(_0x5b6fbc,_0x25840a){return db[_0xd73d('0x16')]['create'](_0x2151e3[_0xd73d('0x17')],{'raw':_0x2151e3[_0xd73d('0x18')]?_0x2151e3[_0xd73d('0x18')][_0xd73d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x20c21b){logger['info'](_0xd73d('0x1a'),_0x2151e3);logger['debug'](_0xd73d('0x1a'),_0x2151e3,JSON[_0xd73d('0x10')](_0x20c21b));_0x5b6fbc(_0x20c21b);})[_0xd73d('0x1b')](function(_0x3900e3){logger[_0xd73d('0x11')](_0xd73d('0x1a'),_0x3900e3[_0xd73d('0x14')],_0x2151e3);_0x25840a(_0x3785b6[_0xd73d('0x11')](0x1f4,_0x3900e3[_0xd73d('0x14')]));});});};exports[_0xd73d('0x1c')]=function(_0x18a021){var _0x51c73e=this;return new Promise(function(_0x5b7971,_0x43123c){return db[_0xd73d('0x16')]['update'](_0x18a021[_0xd73d('0x17')],{'raw':_0x18a021[_0xd73d('0x18')]?_0x18a021[_0xd73d('0x18')][_0xd73d('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18a021[_0xd73d('0x18')]?_0x18a021[_0xd73d('0x18')][_0xd73d('0x1d')]||null:null,'attributes':_0x18a021[_0xd73d('0x18')]?_0x18a021[_0xd73d('0x18')][_0xd73d('0x1e')]||null:null,'limit':_0x18a021[_0xd73d('0x18')]?_0x18a021['options'][_0xd73d('0x1f')]||null:null})[_0xd73d('0xb')](function(_0x57a50a){logger[_0xd73d('0xc')](_0xd73d('0x1c'),_0x18a021);logger['debug'](_0xd73d('0x1c'),_0x18a021,JSON[_0xd73d('0x10')](_0x57a50a));_0x5b7971(_0x57a50a);})[_0xd73d('0x1b')](function(_0x29cc14){logger[_0xd73d('0x11')](_0xd73d('0x1c'),_0x29cc14[_0xd73d('0x14')],_0x18a021);_0x43123c(_0x51c73e[_0xd73d('0x11')](0x1f4,_0x29cc14[_0xd73d('0x14')]));});});}; \ No newline at end of file +var _0x88c2=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','FaxQueueReport,\x20%s,\x20%s','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateFaxQueueReport','create','body','options','raw','UpdateFaxQueueReport','FaxQueueReport','where','attributes','limit','util'];(function(_0x909083,_0x4f84a8){var _0x5a4a19=function(_0x356963){while(--_0x356963){_0x909083['push'](_0x909083['shift']());}};_0x5a4a19(++_0x4f84a8);}(_0x88c2,0x83));var _0x288c=function(_0x4ca796,_0x10dc47){_0x4ca796=_0x4ca796-0x0;var _0x171f87=_0x88c2[_0x4ca796];return _0x171f87;};'use strict';var _=require('lodash');var util=require(_0x288c('0x0'));var moment=require(_0x288c('0x1'));var BPromise=require(_0x288c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x288c('0x3'));var db=require(_0x288c('0x4'))['db'];var utils=require(_0x288c('0x5'));var logger=require(_0x288c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x288c('0x7'));var client=jayson[_0x288c('0x8')][_0x288c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x13d3f2,_0x40f8ac,_0xfd086a){return new BPromise(function(_0x27f435,_0x1c5a7b){return client[_0x288c('0xa')](_0x13d3f2,_0xfd086a)[_0x288c('0xb')](function(_0x53b0f7){logger['info'](_0x288c('0xc'),_0x40f8ac,_0x288c('0xd'));logger[_0x288c('0xe')](_0x288c('0xf'),_0x40f8ac,_0x288c('0xd'),JSON[_0x288c('0x10')](_0x53b0f7));if(_0x53b0f7[_0x288c('0x11')]){if(_0x53b0f7['error'][_0x288c('0x12')]===0x1f4){logger[_0x288c('0x11')](_0x288c('0xc'),_0x40f8ac,_0x53b0f7[_0x288c('0x11')]['message']);return _0x1c5a7b(_0x53b0f7[_0x288c('0x11')][_0x288c('0x13')]);}logger['error'](_0x288c('0xc'),_0x40f8ac,_0x53b0f7[_0x288c('0x11')][_0x288c('0x13')]);return _0x27f435(_0x53b0f7[_0x288c('0x11')][_0x288c('0x13')]);}else{logger[_0x288c('0x14')](_0x288c('0xc'),_0x40f8ac,_0x288c('0xd'));_0x27f435(_0x53b0f7[_0x288c('0x15')][_0x288c('0x13')]);}})[_0x288c('0x16')](function(_0x1e8df2){logger[_0x288c('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x40f8ac,_0x1e8df2);_0x1c5a7b(_0x1e8df2);});});}exports[_0x288c('0x17')]=function(_0x459768){var _0x2b5b7c=this;return new Promise(function(_0x220db3,_0x420388){return db['FaxQueueReport'][_0x288c('0x18')](_0x459768[_0x288c('0x19')],{'raw':_0x459768[_0x288c('0x1a')]?_0x459768[_0x288c('0x1a')][_0x288c('0x1b')]===undefined?!![]:![]:!![]})[_0x288c('0xb')](function(_0x343b23){logger[_0x288c('0x14')](_0x288c('0x17'),_0x459768);logger[_0x288c('0xe')](_0x288c('0x17'),_0x459768,JSON[_0x288c('0x10')](_0x343b23));_0x220db3(_0x343b23);})['catch'](function(_0x19a54a){logger['error'](_0x288c('0x17'),_0x19a54a[_0x288c('0x13')],_0x459768);_0x420388(_0x2b5b7c[_0x288c('0x11')](0x1f4,_0x19a54a['message']));});});};exports[_0x288c('0x1c')]=function(_0x5cd17b){var _0x5df56f=this;return new Promise(function(_0xcaac40,_0x34384a){return db[_0x288c('0x1d')]['update'](_0x5cd17b[_0x288c('0x19')],{'raw':_0x5cd17b[_0x288c('0x1a')]?_0x5cd17b['options'][_0x288c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5cd17b[_0x288c('0x1a')]?_0x5cd17b[_0x288c('0x1a')][_0x288c('0x1e')]||null:null,'attributes':_0x5cd17b['options']?_0x5cd17b[_0x288c('0x1a')][_0x288c('0x1f')]||null:null,'limit':_0x5cd17b['options']?_0x5cd17b[_0x288c('0x1a')][_0x288c('0x20')]||null:null})[_0x288c('0xb')](function(_0x2d66a7){logger[_0x288c('0x14')](_0x288c('0x1c'),_0x5cd17b);logger[_0x288c('0xe')]('UpdateFaxQueueReport',_0x5cd17b,JSON[_0x288c('0x10')](_0x2d66a7));_0xcaac40(_0x2d66a7);})['catch'](function(_0x2c12cd){logger[_0x288c('0x11')](_0x288c('0x1c'),_0x2c12cd[_0x288c('0x13')],_0x5cd17b);_0x34384a(_0x5df56f[_0x288c('0x11')](0x1f4,_0x2c12cd[_0x288c('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 3e6033b..81e2f7a 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 _0x2c9f=['describe','/:id','show','post','create','put','update','delete','destroy','exports','util','connect-timeout','../../components/auth/service','../../components/interaction/service','./faxQueueReport.controller','isAuthenticated','index','get'];(function(_0x8ee77c,_0x1d1063){var _0x24f8c1=function(_0x2b99ff){while(--_0x2b99ff){_0x8ee77c['push'](_0x8ee77c['shift']());}};_0x24f8c1(++_0x1d1063);}(_0x2c9f,0xac));var _0xf2c9=function(_0x78da6c,_0x166e2e){_0x78da6c=_0x78da6c-0x0;var _0x4e54a2=_0x2c9f[_0x78da6c];return _0x4e54a2;};'use strict';var multer=require('multer');var util=require(_0xf2c9('0x0'));var path=require('path');var timeout=require(_0xf2c9('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xf2c9('0x2'));var interaction=require(_0xf2c9('0x3'));var config=require('../../config/environment');var controller=require(_0xf2c9('0x4'));router['get']('/',auth[_0xf2c9('0x5')](),controller[_0xf2c9('0x6')]);router[_0xf2c9('0x7')]('/describe',auth[_0xf2c9('0x5')](),controller[_0xf2c9('0x8')]);router[_0xf2c9('0x7')](_0xf2c9('0x9'),auth[_0xf2c9('0x5')](),controller[_0xf2c9('0xa')]);router[_0xf2c9('0xb')]('/',auth[_0xf2c9('0x5')](),controller[_0xf2c9('0xc')]);router[_0xf2c9('0xd')](_0xf2c9('0x9'),auth[_0xf2c9('0x5')](),controller[_0xf2c9('0xe')]);router[_0xf2c9('0xf')](_0xf2c9('0x9'),auth[_0xf2c9('0x5')](),controller[_0xf2c9('0x10')]);module[_0xf2c9('0x11')]=router; \ No newline at end of file +var _0xec32=['get','isAuthenticated','index','describe','/:id','show','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueueReport.controller'];(function(_0x3e6a0c,_0x5e3743){var _0x306142=function(_0x123b1a){while(--_0x123b1a){_0x3e6a0c['push'](_0x3e6a0c['shift']());}};_0x306142(++_0x5e3743);}(_0xec32,0x14b));var _0x2ec3=function(_0x17b422,_0x54f109){_0x17b422=_0x17b422-0x0;var _0x12088b=_0xec32[_0x17b422];return _0x12088b;};'use strict';var multer=require(_0x2ec3('0x0'));var util=require(_0x2ec3('0x1'));var path=require(_0x2ec3('0x2'));var timeout=require(_0x2ec3('0x3'));var express=require(_0x2ec3('0x4'));var router=express[_0x2ec3('0x5')]();var auth=require(_0x2ec3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x2ec3('0x7'));var controller=require(_0x2ec3('0x8'));router[_0x2ec3('0x9')]('/',auth[_0x2ec3('0xa')](),controller[_0x2ec3('0xb')]);router['get']('/describe',auth[_0x2ec3('0xa')](),controller[_0x2ec3('0xc')]);router[_0x2ec3('0x9')](_0x2ec3('0xd'),auth[_0x2ec3('0xa')](),controller[_0x2ec3('0xe')]);router['post']('/',auth[_0x2ec3('0xa')](),controller[_0x2ec3('0xf')]);router[_0x2ec3('0x10')](_0x2ec3('0xd'),auth['isAuthenticated'](),controller[_0x2ec3('0x11')]);router[_0x2ec3('0x12')](_0x2ec3('0xd'),auth[_0x2ec3('0xa')](),controller['destroy']);module[_0x2ec3('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 1c1252f..bfe496d 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 _0x1354=['account','agent','queue','DATE','moment','sequelize','exports','ENUM'];(function(_0x606b35,_0x43e4d5){var _0x4a9191=function(_0x5d256f){while(--_0x5d256f){_0x606b35['push'](_0x606b35['shift']());}};_0x4a9191(++_0x43e4d5);}(_0x1354,0x74));var _0x4135=function(_0x3b2244,_0x54873f){_0x3b2244=_0x3b2244-0x0;var _0x2dcc14=_0x1354[_0x3b2244];return _0x2dcc14;};'use strict';var moment=require(_0x4135('0x0'));var Sequelize=require(_0x4135('0x1'));module[_0x4135('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x4135('0x3')](_0x4135('0x4'),_0x4135('0x5'),_0x4135('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x4135('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x12bb=['moment','sequelize','exports','STRING','ENUM','account','queue'];(function(_0x3849e3,_0x705005){var _0x1e1544=function(_0x580962){while(--_0x580962){_0x3849e3['push'](_0x3849e3['shift']());}};_0x1e1544(++_0x705005);}(_0x12bb,0x111));var _0xb12b=function(_0x1a243b,_0x1300f0){_0x1a243b=_0x1a243b-0x0;var _0x188a6f=_0x12bb[_0x1a243b];return _0x188a6f;};'use strict';var moment=require(_0xb12b('0x0'));var Sequelize=require(_0xb12b('0x1'));module[_0xb12b('0x2')]={'uniqueid':{'type':Sequelize[_0xb12b('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xb12b('0x4')](_0xb12b('0x5'),'agent',_0xb12b('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 78e0d26..c26bd83 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 _0x722f=['html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','FaxTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','create','body','find','describe'];(function(_0x4ba561,_0x1d14d1){var _0x3d3b11=function(_0x443cb6){while(--_0x443cb6){_0x4ba561['push'](_0x4ba561['shift']());}};_0x3d3b11(++_0x1d14d1);}(_0x722f,0x1d4));var _0xf722=function(_0x3e9d2f,_0x4284bc){_0x3e9d2f=_0x3e9d2f-0x0;var _0x2bc18b=_0x722f[_0x3e9d2f];return _0x2bc18b;};'use strict';var pdf=require(_0xf722('0x0'));var emlformat=require(_0xf722('0x1'));var rimraf=require(_0xf722('0x2'));var zipdir=require(_0xf722('0x3'));var jsonpatch=require(_0xf722('0x4'));var rp=require(_0xf722('0x5'));var moment=require(_0xf722('0x6'));var BPromise=require(_0xf722('0x7'));var Mustache=require(_0xf722('0x8'));var util=require(_0xf722('0x9'));var path=require(_0xf722('0xa'));var sox=require('sox');var csv=require(_0xf722('0xb'));var ejs=require(_0xf722('0xc'));var fs=require('fs');var _=require(_0xf722('0xd'));var squel=require('squel');var crypto=require(_0xf722('0xe'));var jsforce=require(_0xf722('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xf722('0xb'));var querystring=require(_0xf722('0x10'));var Papa=require(_0xf722('0x11'));var Redis=require('ioredis');var authService=require(_0xf722('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf722('0x13'));var hardwareService=require(_0xf722('0x14'));var logger=require(_0xf722('0x15'))(_0xf722('0x16'));var utils=require(_0xf722('0x17'));var config=require(_0xf722('0x18'));var db=require(_0xf722('0x19'))['db'];function respondWithStatusCode(_0x530adc,_0x4c9bf1){_0x4c9bf1=_0x4c9bf1||0xcc;return function(_0x6d8d64){if(_0x6d8d64){return _0x530adc[_0xf722('0x1a')](_0x4c9bf1);}return _0x530adc[_0xf722('0x1b')](_0x4c9bf1)[_0xf722('0x1c')]();};}function respondWithResult(_0x1653ba,_0x39a75d){_0x39a75d=_0x39a75d||0xc8;return function(_0x2d5a5c){if(_0x2d5a5c){return _0x1653ba[_0xf722('0x1b')](_0x39a75d)[_0xf722('0x1d')](_0x2d5a5c);}};}function respondWithFilteredResult(_0x58b33a,_0x445a67){return function(_0x8064f6){if(_0x8064f6){var _0x16eda4=_0x8064f6[_0xf722('0x1e')],_0x5408d0=_0x445a67[_0xf722('0x1f')],_0x1a1de2=_0x445a67[_0xf722('0x1f')]+_0x445a67['limit'],_0x30e68b;if(_0x1a1de2>=_0x16eda4){_0x1a1de2=_0x16eda4;_0x30e68b=0xc8;}else{_0x30e68b=0xce;}_0x58b33a[_0xf722('0x1b')](_0x30e68b);return _0x58b33a[_0xf722('0x20')](_0xf722('0x21'),_0x5408d0+'-'+_0x1a1de2+'/'+_0x16eda4)[_0xf722('0x1d')](_0x8064f6);}return null;};}function patchUpdates(_0x4ab110){return function(_0x36fa4d){try{jsonpatch[_0xf722('0x22')](_0x36fa4d,_0x4ab110,!![]);}catch(_0x1c3d15){return BPromise[_0xf722('0x23')](_0x1c3d15);}return _0x36fa4d[_0xf722('0x24')]();};}function saveUpdates(_0x3cf1ac,_0x3ef12b){return function(_0x966216){if(_0x966216){return _0x966216[_0xf722('0x25')](_0x3cf1ac)[_0xf722('0x26')](function(_0x58e113){return _0x58e113;});}return null;};}function removeEntity(_0x4e5fda,_0x58a8ce){return function(_0x487a49){if(_0x487a49){return _0x487a49[_0xf722('0x27')]()[_0xf722('0x26')](function(){_0x4e5fda['status'](0xcc)[_0xf722('0x1c')]();});}};}function handleEntityNotFound(_0x15408f,_0x53fc28){return function(_0x2763b1){if(!_0x2763b1){_0x15408f['sendStatus'](0x194);}return _0x2763b1;};}function handleError(_0x585a6c,_0x5de769){_0x5de769=_0x5de769||0x1f4;return function(_0x474880){logger[_0xf722('0x28')](_0x474880[_0xf722('0x29')]);if(_0x474880[_0xf722('0x2a')]){delete _0x474880[_0xf722('0x2a')];}_0x585a6c[_0xf722('0x1b')](_0x5de769)[_0xf722('0x2b')](_0x474880);};}exports[_0xf722('0x2c')]=function(_0x512d22,_0x200ea5){var _0x11de0b={},_0x3bf5d8={},_0x4da77f={'count':0x0,'rows':[]};var _0xe2678b=_['map'](db[_0xf722('0x2d')][_0xf722('0x2e')],function(_0x190c7a){return{'name':_0x190c7a[_0xf722('0x2f')],'type':_0x190c7a[_0xf722('0x30')][_0xf722('0x31')]};});_0x3bf5d8[_0xf722('0x32')]=_[_0xf722('0x33')](_0xe2678b,'name');_0x3bf5d8[_0xf722('0x34')]=_[_0xf722('0x35')](_0x512d22[_0xf722('0x34')]);_0x3bf5d8[_0xf722('0x36')]=_[_0xf722('0x37')](_0x3bf5d8['model'],_0x3bf5d8[_0xf722('0x34')]);_0x11de0b['attributes']=_[_0xf722('0x37')](_0x3bf5d8['model'],qs[_0xf722('0x38')](_0x512d22['query'][_0xf722('0x38')]));_0x11de0b[_0xf722('0x39')]=_0x11de0b[_0xf722('0x39')][_0xf722('0x3a')]?_0x11de0b[_0xf722('0x39')]:_0x3bf5d8[_0xf722('0x32')];if(!_0x512d22[_0xf722('0x34')][_0xf722('0x3b')]('nolimit')){_0x11de0b[_0xf722('0x3c')]=qs[_0xf722('0x3c')](_0x512d22[_0xf722('0x34')][_0xf722('0x3c')]);_0x11de0b[_0xf722('0x1f')]=qs[_0xf722('0x1f')](_0x512d22[_0xf722('0x34')]['offset']);}_0x11de0b['order']=qs[_0xf722('0x3d')](_0x512d22[_0xf722('0x34')][_0xf722('0x3d')]);_0x11de0b['where']=qs[_0xf722('0x36')](_[_0xf722('0x3e')](_0x512d22[_0xf722('0x34')],_0x3bf5d8[_0xf722('0x36')]));if(_0x512d22[_0xf722('0x34')][_0xf722('0x3f')]){_0x11de0b['where']=_[_0xf722('0x40')](_0x11de0b[_0xf722('0x41')],{'$or':_['map'](_0xe2678b,function(_0x4472b1){if(_0x4472b1['type']!==_0xf722('0x42')){var _0x608f98={};_0x608f98[_0x4472b1['name']]={'$like':'%'+_0x512d22[_0xf722('0x34')][_0xf722('0x3f')]+'%'};return _0x608f98;}})});}_0x11de0b=_[_0xf722('0x40')]({},_0x11de0b,_0x512d22[_0xf722('0x43')]);var _0x4e5e14={'where':_0x11de0b[_0xf722('0x41')]};return db['FaxTransferReport'][_0xf722('0x1e')](_0x4e5e14)[_0xf722('0x26')](function(_0x34b593){_0x4da77f['count']=_0x34b593;if(_0x512d22['query'][_0xf722('0x44')]){_0x11de0b[_0xf722('0x45')]=[{'all':!![]}];}return db[_0xf722('0x2d')][_0xf722('0x46')](_0x11de0b);})[_0xf722('0x26')](function(_0x7f2cac){_0x4da77f[_0xf722('0x47')]=_0x7f2cac;return _0x4da77f;})[_0xf722('0x26')](respondWithFilteredResult(_0x200ea5,_0x11de0b))[_0xf722('0x48')](handleError(_0x200ea5,null));};exports['show']=function(_0x11c8e6,_0x26ae9e){var _0xf904aa={'raw':!![],'where':{'id':_0x11c8e6[_0xf722('0x49')]['id']}},_0xa2ff29={};_0xa2ff29[_0xf722('0x32')]=_['keys'](db[_0xf722('0x2d')][_0xf722('0x2e')]);_0xa2ff29[_0xf722('0x34')]=_['keys'](_0x11c8e6['query']);_0xa2ff29[_0xf722('0x36')]=_[_0xf722('0x37')](_0xa2ff29[_0xf722('0x32')],_0xa2ff29[_0xf722('0x34')]);_0xf904aa[_0xf722('0x39')]=_[_0xf722('0x37')](_0xa2ff29[_0xf722('0x32')],qs[_0xf722('0x38')](_0x11c8e6[_0xf722('0x34')]['fields']));_0xf904aa[_0xf722('0x39')]=_0xf904aa[_0xf722('0x39')]['length']?_0xf904aa[_0xf722('0x39')]:_0xa2ff29[_0xf722('0x32')];if(_0x11c8e6[_0xf722('0x34')][_0xf722('0x44')]){_0xf904aa[_0xf722('0x45')]=[{'all':!![]}];}_0xf904aa=_['merge']({},_0xf904aa,_0x11c8e6[_0xf722('0x43')]);return db[_0xf722('0x2d')]['find'](_0xf904aa)['then'](handleEntityNotFound(_0x26ae9e,null))['then'](respondWithResult(_0x26ae9e,null))[_0xf722('0x48')](handleError(_0x26ae9e,null));};exports['create']=function(_0x6375ec,_0x2dde99){return db['FaxTransferReport'][_0xf722('0x4a')](_0x6375ec[_0xf722('0x4b')],{})[_0xf722('0x26')](respondWithResult(_0x2dde99,0xc9))[_0xf722('0x48')](handleError(_0x2dde99,null));};exports[_0xf722('0x25')]=function(_0x36ecd6,_0x4bf41c){if(_0x36ecd6[_0xf722('0x4b')]['id']){delete _0x36ecd6['body']['id'];}return db[_0xf722('0x2d')][_0xf722('0x4c')]({'where':{'id':_0x36ecd6['params']['id']}})[_0xf722('0x26')](handleEntityNotFound(_0x4bf41c,null))[_0xf722('0x26')](saveUpdates(_0x36ecd6[_0xf722('0x4b')],null))[_0xf722('0x26')](respondWithResult(_0x4bf41c,null))[_0xf722('0x48')](handleError(_0x4bf41c,null));};exports['destroy']=function(_0x1194f3,_0x197a87){return db[_0xf722('0x2d')][_0xf722('0x4c')]({'where':{'id':_0x1194f3[_0xf722('0x49')]['id']}})['then'](handleEntityNotFound(_0x197a87,null))[_0xf722('0x26')](removeEntity(_0x197a87,null))[_0xf722('0x48')](handleError(_0x197a87,null));};exports[_0xf722('0x4d')]=function(_0x20f06c,_0x1bd8b8){return db['FaxTransferReport'][_0xf722('0x4d')]()['then'](respondWithResult(_0x1bd8b8,null))[_0xf722('0x48')](handleError(_0x1bd8b8,null));}; \ No newline at end of file +var _0x53a3=['catch','show','params','include','create','body','find','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','FaxTransferReport','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows'];(function(_0x6f8972,_0x343da7){var _0x5677d9=function(_0x5eb51f){while(--_0x5eb51f){_0x6f8972['push'](_0x6f8972['shift']());}};_0x5677d9(++_0x343da7);}(_0x53a3,0x9a));var _0x353a=function(_0x23eb8c,_0x5618e8){_0x23eb8c=_0x23eb8c-0x0;var _0x4978ba=_0x53a3[_0x23eb8c];return _0x4978ba;};'use strict';var pdf=require(_0x353a('0x0'));var emlformat=require(_0x353a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x353a('0x2'));var jsonpatch=require(_0x353a('0x3'));var rp=require(_0x353a('0x4'));var moment=require(_0x353a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x353a('0x6'));var util=require(_0x353a('0x7'));var path=require(_0x353a('0x8'));var sox=require(_0x353a('0x9'));var csv=require(_0x353a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x353a('0xb'));var toCsv=require(_0x353a('0xa'));var querystring=require(_0x353a('0xc'));var Papa=require(_0x353a('0xd'));var Redis=require(_0x353a('0xe'));var authService=require(_0x353a('0xf'));var qs=require(_0x353a('0x10'));var as=require(_0x353a('0x11'));var hardwareService=require(_0x353a('0x12'));var logger=require(_0x353a('0x13'))(_0x353a('0x14'));var utils=require(_0x353a('0x15'));var config=require('../../config/environment');var db=require(_0x353a('0x16'))['db'];function respondWithStatusCode(_0x51505e,_0x3daf84){_0x3daf84=_0x3daf84||0xcc;return function(_0xa3957){if(_0xa3957){return _0x51505e[_0x353a('0x17')](_0x3daf84);}return _0x51505e[_0x353a('0x18')](_0x3daf84)[_0x353a('0x19')]();};}function respondWithResult(_0x186b5b,_0x5c6669){_0x5c6669=_0x5c6669||0xc8;return function(_0x2f508f){if(_0x2f508f){return _0x186b5b[_0x353a('0x18')](_0x5c6669)[_0x353a('0x1a')](_0x2f508f);}};}function respondWithFilteredResult(_0x1ac323,_0x3c7606){return function(_0x4f46b3){if(_0x4f46b3){var _0x1a4636=_0x4f46b3[_0x353a('0x1b')],_0x426bde=_0x3c7606[_0x353a('0x1c')],_0xc0ef6a=_0x3c7606['offset']+_0x3c7606[_0x353a('0x1d')],_0x4e40b0;if(_0xc0ef6a>=_0x1a4636){_0xc0ef6a=_0x1a4636;_0x4e40b0=0xc8;}else{_0x4e40b0=0xce;}_0x1ac323[_0x353a('0x18')](_0x4e40b0);return _0x1ac323[_0x353a('0x1e')](_0x353a('0x1f'),_0x426bde+'-'+_0xc0ef6a+'/'+_0x1a4636)['json'](_0x4f46b3);}return null;};}function patchUpdates(_0x1978da){return function(_0x3538e7){try{jsonpatch['apply'](_0x3538e7,_0x1978da,!![]);}catch(_0x192c2a){return BPromise[_0x353a('0x20')](_0x192c2a);}return _0x3538e7[_0x353a('0x21')]();};}function saveUpdates(_0x380de1,_0x5e15f2){return function(_0x513a2a){if(_0x513a2a){return _0x513a2a[_0x353a('0x22')](_0x380de1)[_0x353a('0x23')](function(_0x58d263){return _0x58d263;});}return null;};}function removeEntity(_0x8bea8c,_0x1b7749){return function(_0x5b56ed){if(_0x5b56ed){return _0x5b56ed[_0x353a('0x24')]()[_0x353a('0x23')](function(){_0x8bea8c[_0x353a('0x18')](0xcc)[_0x353a('0x19')]();});}};}function handleEntityNotFound(_0x4c2f64,_0x2c405a){return function(_0x296eb1){if(!_0x296eb1){_0x4c2f64[_0x353a('0x17')](0x194);}return _0x296eb1;};}function handleError(_0x1bb0b9,_0x400686){_0x400686=_0x400686||0x1f4;return function(_0x5b58f6){logger[_0x353a('0x25')](_0x5b58f6[_0x353a('0x26')]);if(_0x5b58f6['name']){delete _0x5b58f6[_0x353a('0x27')];}_0x1bb0b9[_0x353a('0x18')](_0x400686)[_0x353a('0x28')](_0x5b58f6);};}exports['index']=function(_0x239ed1,_0x102bf4){var _0x46701e={},_0x310efb={},_0x288b4f={'count':0x0,'rows':[]};var _0xcd3d20=_['map'](db[_0x353a('0x29')][_0x353a('0x2a')],function(_0x13f55c){return{'name':_0x13f55c[_0x353a('0x2b')],'type':_0x13f55c['type'][_0x353a('0x2c')]};});_0x310efb[_0x353a('0x2d')]=_[_0x353a('0x2e')](_0xcd3d20,_0x353a('0x27'));_0x310efb[_0x353a('0x2f')]=_[_0x353a('0x30')](_0x239ed1[_0x353a('0x2f')]);_0x310efb[_0x353a('0x31')]=_['intersection'](_0x310efb[_0x353a('0x2d')],_0x310efb['query']);_0x46701e[_0x353a('0x32')]=_[_0x353a('0x33')](_0x310efb[_0x353a('0x2d')],qs[_0x353a('0x34')](_0x239ed1[_0x353a('0x2f')]['fields']));_0x46701e[_0x353a('0x32')]=_0x46701e['attributes'][_0x353a('0x35')]?_0x46701e[_0x353a('0x32')]:_0x310efb['model'];if(!_0x239ed1[_0x353a('0x2f')]['hasOwnProperty'](_0x353a('0x36'))){_0x46701e[_0x353a('0x1d')]=qs[_0x353a('0x1d')](_0x239ed1['query'][_0x353a('0x1d')]);_0x46701e[_0x353a('0x1c')]=qs[_0x353a('0x1c')](_0x239ed1[_0x353a('0x2f')][_0x353a('0x1c')]);}_0x46701e['order']=qs[_0x353a('0x37')](_0x239ed1[_0x353a('0x2f')]['sort']);_0x46701e[_0x353a('0x38')]=qs['filters'](_[_0x353a('0x39')](_0x239ed1[_0x353a('0x2f')],_0x310efb['filters']));if(_0x239ed1[_0x353a('0x2f')][_0x353a('0x3a')]){_0x46701e[_0x353a('0x38')]=_[_0x353a('0x3b')](_0x46701e[_0x353a('0x38')],{'$or':_[_0x353a('0x2e')](_0xcd3d20,function(_0x2b393f){if(_0x2b393f[_0x353a('0x3c')]!==_0x353a('0x3d')){var _0x118edf={};_0x118edf[_0x2b393f[_0x353a('0x27')]]={'$like':'%'+_0x239ed1[_0x353a('0x2f')][_0x353a('0x3a')]+'%'};return _0x118edf;}})});}_0x46701e=_[_0x353a('0x3b')]({},_0x46701e,_0x239ed1[_0x353a('0x3e')]);var _0x3671dc={'where':_0x46701e['where']};return db['FaxTransferReport'][_0x353a('0x1b')](_0x3671dc)['then'](function(_0x41dfea){_0x288b4f['count']=_0x41dfea;if(_0x239ed1[_0x353a('0x2f')][_0x353a('0x3f')]){_0x46701e['include']=[{'all':!![]}];}return db['FaxTransferReport']['findAll'](_0x46701e);})['then'](function(_0x257918){_0x288b4f[_0x353a('0x40')]=_0x257918;return _0x288b4f;})[_0x353a('0x23')](respondWithFilteredResult(_0x102bf4,_0x46701e))[_0x353a('0x41')](handleError(_0x102bf4,null));};exports[_0x353a('0x42')]=function(_0x2e3b53,_0x5900f8){var _0x3d1b44={'raw':!![],'where':{'id':_0x2e3b53[_0x353a('0x43')]['id']}},_0x241061={};_0x241061[_0x353a('0x2d')]=_[_0x353a('0x30')](db[_0x353a('0x29')][_0x353a('0x2a')]);_0x241061[_0x353a('0x2f')]=_['keys'](_0x2e3b53[_0x353a('0x2f')]);_0x241061[_0x353a('0x31')]=_['intersection'](_0x241061[_0x353a('0x2d')],_0x241061['query']);_0x3d1b44[_0x353a('0x32')]=_[_0x353a('0x33')](_0x241061[_0x353a('0x2d')],qs[_0x353a('0x34')](_0x2e3b53['query'][_0x353a('0x34')]));_0x3d1b44[_0x353a('0x32')]=_0x3d1b44['attributes']['length']?_0x3d1b44[_0x353a('0x32')]:_0x241061[_0x353a('0x2d')];if(_0x2e3b53[_0x353a('0x2f')][_0x353a('0x3f')]){_0x3d1b44[_0x353a('0x44')]=[{'all':!![]}];}_0x3d1b44=_['merge']({},_0x3d1b44,_0x2e3b53[_0x353a('0x3e')]);return db['FaxTransferReport']['find'](_0x3d1b44)['then'](handleEntityNotFound(_0x5900f8,null))[_0x353a('0x23')](respondWithResult(_0x5900f8,null))[_0x353a('0x41')](handleError(_0x5900f8,null));};exports[_0x353a('0x45')]=function(_0x5e7e0f,_0x501734){return db[_0x353a('0x29')][_0x353a('0x45')](_0x5e7e0f[_0x353a('0x46')],{})[_0x353a('0x23')](respondWithResult(_0x501734,0xc9))[_0x353a('0x41')](handleError(_0x501734,null));};exports[_0x353a('0x22')]=function(_0x577e9b,_0x5d4c49){if(_0x577e9b['body']['id']){delete _0x577e9b[_0x353a('0x46')]['id'];}return db[_0x353a('0x29')][_0x353a('0x47')]({'where':{'id':_0x577e9b['params']['id']}})[_0x353a('0x23')](handleEntityNotFound(_0x5d4c49,null))[_0x353a('0x23')](saveUpdates(_0x577e9b[_0x353a('0x46')],null))[_0x353a('0x23')](respondWithResult(_0x5d4c49,null))[_0x353a('0x41')](handleError(_0x5d4c49,null));};exports[_0x353a('0x24')]=function(_0x398d84,_0x251ecf){return db[_0x353a('0x29')][_0x353a('0x47')]({'where':{'id':_0x398d84[_0x353a('0x43')]['id']}})[_0x353a('0x23')](handleEntityNotFound(_0x251ecf,null))[_0x353a('0x23')](removeEntity(_0x251ecf,null))['catch'](handleError(_0x251ecf,null));};exports[_0x353a('0x48')]=function(_0x4d8ab8,_0x528a3f){return db[_0x353a('0x29')][_0x353a('0x48')]()['then'](respondWithResult(_0x528a3f,null))[_0x353a('0x41')](handleError(_0x528a3f,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 3e5442a..2a0e50b 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 _0xe722=['request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','bluebird'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0xe722,0x168));var _0x2e72=function(_0x491ec2,_0x540c00){_0x491ec2=_0x491ec2-0x0;var _0x1748db=_0xe722[_0x491ec2];return _0x1748db;};'use strict';var _=require(_0x2e72('0x0'));var util=require(_0x2e72('0x1'));var logger=require(_0x2e72('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2e72('0x3'));var rp=require(_0x2e72('0x4'));var fs=require('fs');var path=require(_0x2e72('0x5'));var rimraf=require(_0x2e72('0x6'));var config=require(_0x2e72('0x7'));var attributes=require(_0x2e72('0x8'));module[_0x2e72('0x9')]=function(_0x2514db,_0xa38fb7){return _0x2514db[_0x2e72('0xa')](_0x2e72('0xb'),attributes,{'tableName':_0x2e72('0xc'),'paranoid':![],'indexes':[{'name':_0x2e72('0xd'),'fields':[_0x2e72('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc058=['rimraf','../../config/environment','./faxTransferReport.attributes','FaxTransferReport','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x210ed6,_0x3dffa7){var _0x353e65=function(_0x4e5159){while(--_0x4e5159){_0x210ed6['push'](_0x210ed6['shift']());}};_0x353e65(++_0x3dffa7);}(_0xc058,0x191));var _0x8c05=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xc058[_0x4c12ec];return _0x3ae42c;};'use strict';var _=require(_0x8c05('0x0'));var util=require('util');var logger=require(_0x8c05('0x1'))(_0x8c05('0x2'));var moment=require(_0x8c05('0x3'));var BPromise=require(_0x8c05('0x4'));var rp=require(_0x8c05('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c05('0x6'));var config=require(_0x8c05('0x7'));var attributes=require(_0x8c05('0x8'));module['exports']=function(_0x41f66a,_0x450f){return _0x41f66a['define'](_0x8c05('0x9'),attributes,{'tableName':'report_fax_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x8c05('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 5b0a4c0..0dbe18f 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 _0x480a=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','error','code'];(function(_0x2afa57,_0x818693){var _0x33159b=function(_0x317b75){while(--_0x317b75){_0x2afa57['push'](_0x2afa57['shift']());}};_0x33159b(++_0x818693);}(_0x480a,0x71));var _0xa480=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x480a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa480('0x0'));var util=require(_0xa480('0x1'));var moment=require('moment');var BPromise=require(_0xa480('0x2'));var rs=require(_0xa480('0x3'));var fs=require('fs');var Redis=require(_0xa480('0x4'));var db=require(_0xa480('0x5'))['db'];var utils=require(_0xa480('0x6'));var logger=require(_0xa480('0x7'))(_0xa480('0x8'));var config=require('../../config/environment');var jayson=require(_0xa480('0x9'));var client=jayson[_0xa480('0xa')][_0xa480('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24c1f2,_0x44c2d1,_0x5a0ea3){return new BPromise(function(_0x6b1088,_0x4598a8){return client[_0xa480('0xc')](_0x24c1f2,_0x5a0ea3)['then'](function(_0x2a8f86){logger[_0xa480('0xd')](_0xa480('0xe'),_0x44c2d1,_0xa480('0xf'));logger[_0xa480('0x10')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x44c2d1,_0xa480('0xf'),JSON['stringify'](_0x2a8f86));if(_0x2a8f86[_0xa480('0x11')]){if(_0x2a8f86['error'][_0xa480('0x12')]===0x1f4){logger[_0xa480('0x11')]('FaxTransferReport,\x20%s,\x20%s',_0x44c2d1,_0x2a8f86['error'][_0xa480('0x13')]);return _0x4598a8(_0x2a8f86['error'][_0xa480('0x13')]);}logger['error'](_0xa480('0xe'),_0x44c2d1,_0x2a8f86[_0xa480('0x11')]['message']);return _0x6b1088(_0x2a8f86[_0xa480('0x11')]['message']);}else{logger[_0xa480('0xd')](_0xa480('0xe'),_0x44c2d1,_0xa480('0xf'));_0x6b1088(_0x2a8f86[_0xa480('0x14')][_0xa480('0x13')]);}})[_0xa480('0x15')](function(_0x141d63){logger[_0xa480('0x11')](_0xa480('0xe'),_0x44c2d1,_0x141d63);_0x4598a8(_0x141d63);});});} \ No newline at end of file +var _0x3d7c=['../../config/utils','../../config/logger','../../config/environment','client','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','moment','bluebird','randomstring'];(function(_0x52fa17,_0x2400ec){var _0xde02e=function(_0x4ecfd1){while(--_0x4ecfd1){_0x52fa17['push'](_0x52fa17['shift']());}};_0xde02e(++_0x2400ec);}(_0x3d7c,0x1c8));var _0xc3d7=function(_0x58b7db,_0x53561b){_0x58b7db=_0x58b7db-0x0;var _0x1d340f=_0x3d7c[_0x58b7db];return _0x1d340f;};'use strict';var _=require('lodash');var util=require(_0xc3d7('0x0'));var moment=require(_0xc3d7('0x1'));var BPromise=require(_0xc3d7('0x2'));var rs=require(_0xc3d7('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc3d7('0x4'));var logger=require(_0xc3d7('0x5'))('rpc');var config=require(_0xc3d7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc3d7('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x278f94,_0x59c2ea,_0x28de82){return new BPromise(function(_0xad7d46,_0x706a6d){return client[_0xc3d7('0x8')](_0x278f94,_0x28de82)[_0xc3d7('0x9')](function(_0x182e64){logger[_0xc3d7('0xa')](_0xc3d7('0xb'),_0x59c2ea,_0xc3d7('0xc'));logger[_0xc3d7('0xd')](_0xc3d7('0xe'),_0x59c2ea,_0xc3d7('0xc'),JSON['stringify'](_0x182e64));if(_0x182e64[_0xc3d7('0xf')]){if(_0x182e64[_0xc3d7('0xf')][_0xc3d7('0x10')]===0x1f4){logger[_0xc3d7('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x59c2ea,_0x182e64[_0xc3d7('0xf')][_0xc3d7('0x11')]);return _0x706a6d(_0x182e64[_0xc3d7('0xf')][_0xc3d7('0x11')]);}logger[_0xc3d7('0xf')](_0xc3d7('0xb'),_0x59c2ea,_0x182e64[_0xc3d7('0xf')][_0xc3d7('0x11')]);return _0xad7d46(_0x182e64[_0xc3d7('0xf')][_0xc3d7('0x11')]);}else{logger[_0xc3d7('0xa')](_0xc3d7('0xb'),_0x59c2ea,_0xc3d7('0xc'));_0xad7d46(_0x182e64[_0xc3d7('0x12')]['message']);}})[_0xc3d7('0x13')](function(_0x104d9b){logger['error']('FaxTransferReport,\x20%s,\x20%s',_0x59c2ea,_0x104d9b);_0x706a6d(_0x104d9b);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index dbbaed0..c2ce138 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 _0xa289=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','describe','show','post','put','/:id','update','delete','destroy','exports','multer','util'];(function(_0x38dab7,_0x44ee76){var _0x5999a5=function(_0x212f42){while(--_0x212f42){_0x38dab7['push'](_0x38dab7['shift']());}};_0x5999a5(++_0x44ee76);}(_0xa289,0x17a));var _0x9a28=function(_0x1c4aef,_0x1fe75d){_0x1c4aef=_0x1c4aef-0x0;var _0x12ec27=_0xa289[_0x1c4aef];return _0x12ec27;};'use strict';var multer=require(_0x9a28('0x0'));var util=require(_0x9a28('0x1'));var path=require(_0x9a28('0x2'));var timeout=require('connect-timeout');var express=require(_0x9a28('0x3'));var router=express[_0x9a28('0x4')]();var auth=require(_0x9a28('0x5'));var interaction=require(_0x9a28('0x6'));var config=require(_0x9a28('0x7'));var controller=require(_0x9a28('0x8'));router[_0x9a28('0x9')]('/',auth[_0x9a28('0xa')](),controller['index']);router[_0x9a28('0x9')]('/describe',auth[_0x9a28('0xa')](),controller[_0x9a28('0xb')]);router[_0x9a28('0x9')]('/:id',auth[_0x9a28('0xa')](),controller[_0x9a28('0xc')]);router[_0x9a28('0xd')]('/',auth[_0x9a28('0xa')](),controller['create']);router[_0x9a28('0xe')](_0x9a28('0xf'),auth[_0x9a28('0xa')](),controller[_0x9a28('0x10')]);router[_0x9a28('0x11')](_0x9a28('0xf'),auth[_0x9a28('0xa')](),controller[_0x9a28('0x12')]);module[_0x9a28('0x13')]=router; \ No newline at end of file +var _0xbebc=['../../config/environment','./faxTransferReport.controller','isAuthenticated','get','/describe','describe','show','post','create','/:id','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x380327,_0x3d2d7a){var _0x10ef94=function(_0x35af3b){while(--_0x35af3b){_0x380327['push'](_0x380327['shift']());}};_0x10ef94(++_0x3d2d7a);}(_0xbebc,0x66));var _0xcbeb=function(_0x4348e7,_0x2d4652){_0x4348e7=_0x4348e7-0x0;var _0x5c700e=_0xbebc[_0x4348e7];return _0x5c700e;};'use strict';var multer=require(_0xcbeb('0x0'));var util=require(_0xcbeb('0x1'));var path=require(_0xcbeb('0x2'));var timeout=require(_0xcbeb('0x3'));var express=require(_0xcbeb('0x4'));var router=express['Router']();var auth=require(_0xcbeb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcbeb('0x6'));var controller=require(_0xcbeb('0x7'));router['get']('/',auth[_0xcbeb('0x8')](),controller['index']);router[_0xcbeb('0x9')](_0xcbeb('0xa'),auth[_0xcbeb('0x8')](),controller[_0xcbeb('0xb')]);router[_0xcbeb('0x9')]('/:id',auth['isAuthenticated'](),controller[_0xcbeb('0xc')]);router[_0xcbeb('0xd')]('/',auth[_0xcbeb('0x8')](),controller[_0xcbeb('0xe')]);router['put'](_0xcbeb('0xf'),auth[_0xcbeb('0x8')](),controller['update']);router[_0xcbeb('0x10')](_0xcbeb('0xf'),auth['isAuthenticated'](),controller['destroy']);module[_0xcbeb('0x11')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 79679a9..dc22995 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 _0x8ce1=['update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put'];(function(_0x512c83,_0x42a67a){var _0x1f7f25=function(_0x1e656c){while(--_0x1e656c){_0x512c83['push'](_0x512c83['shift']());}};_0x1f7f25(++_0x42a67a);}(_0x8ce1,0x183));var _0x18ce=function(_0x5dfff3,_0x5b7d6f){_0x5dfff3=_0x5dfff3-0x0;var _0x14155c=_0x8ce1[_0x5dfff3];return _0x14155c;};'use strict';var multer=require(_0x18ce('0x0'));var util=require(_0x18ce('0x1'));var path=require(_0x18ce('0x2'));var timeout=require(_0x18ce('0x3'));var express=require(_0x18ce('0x4'));var router=express[_0x18ce('0x5')]();var auth=require(_0x18ce('0x6'));var interaction=require(_0x18ce('0x7'));var config=require(_0x18ce('0x8'));var controller=require(_0x18ce('0x9'));router[_0x18ce('0xa')]('/',auth[_0x18ce('0xb')](),controller[_0x18ce('0xc')]);router[_0x18ce('0xa')](_0x18ce('0xd'),auth[_0x18ce('0xb')](),controller['show']);router[_0x18ce('0xa')](_0x18ce('0xe'),auth[_0x18ce('0xb')](),controller[_0x18ce('0xf')]);router['get'](_0x18ce('0x10'),auth[_0x18ce('0xb')](),controller[_0x18ce('0x11')]);router[_0x18ce('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x18ce('0x12')](_0x18ce('0xe'),auth[_0x18ce('0xb')](),controller[_0x18ce('0x13')]);router[_0x18ce('0x14')]('/:id',auth[_0x18ce('0xb')](),controller[_0x18ce('0x15')]);router[_0x18ce('0x16')](_0x18ce('0xd'),auth[_0x18ce('0xb')](),controller['destroy']);module[_0x18ce('0x17')]=router; \ No newline at end of file +var _0x1af3=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer'];(function(_0xeced33,_0x4c447b){var _0x46867c=function(_0xc248b9){while(--_0xc248b9){_0xeced33['push'](_0xeced33['shift']());}};_0x46867c(++_0x4c447b);}(_0x1af3,0x1ca));var _0x31af=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x1af3[_0x334651];return _0x29657c;};'use strict';var multer=require(_0x31af('0x0'));var util=require(_0x31af('0x1'));var path=require(_0x31af('0x2'));var timeout=require(_0x31af('0x3'));var express=require(_0x31af('0x4'));var router=express[_0x31af('0x5')]();var auth=require(_0x31af('0x6'));var interaction=require(_0x31af('0x7'));var config=require(_0x31af('0x8'));var controller=require(_0x31af('0x9'));router['get']('/',auth[_0x31af('0xa')](),controller[_0x31af('0xb')]);router[_0x31af('0xc')](_0x31af('0xd'),auth['isAuthenticated'](),controller[_0x31af('0xe')]);router[_0x31af('0xc')](_0x31af('0xf'),auth['isAuthenticated'](),controller[_0x31af('0x10')]);router[_0x31af('0xc')](_0x31af('0x11'),auth[_0x31af('0xa')](),controller[_0x31af('0x12')]);router[_0x31af('0x13')]('/',auth[_0x31af('0xa')](),controller[_0x31af('0x14')]);router['post'](_0x31af('0xf'),auth[_0x31af('0xa')](),controller[_0x31af('0x15')]);router[_0x31af('0x16')](_0x31af('0xd'),auth['isAuthenticated'](),controller[_0x31af('0x17')]);router[_0x31af('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x31af('0x19')]);module[_0x31af('0x1a')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 559e7bc..507727a 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 _0xf248=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x1908e0,_0x952d96){var _0x1c4283=function(_0x58048c){while(--_0x58048c){_0x1908e0['push'](_0x1908e0['shift']());}};_0x1c4283(++_0x952d96);}(_0xf248,0x1b1));var _0x8f24=function(_0x11cc4e,_0x36bea1){_0x11cc4e=_0x11cc4e-0x0;var _0x5cc859=_0xf248[_0x11cc4e];return _0x5cc859;};'use strict';var Sequelize=require(_0x8f24('0x0'));module[_0x8f24('0x1')]={'name':{'type':Sequelize[_0x8f24('0x2')]},'description':{'type':Sequelize[_0x8f24('0x2')]},'username':{'type':Sequelize[_0x8f24('0x2')]},'remoteUri':{'type':Sequelize[_0x8f24('0x2')]},'authType':{'type':Sequelize[_0x8f24('0x3')](_0x8f24('0x4')),'defaultValue':_0x8f24('0x4')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x8f24('0x2')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize[_0x8f24('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x8f24('0x5'),_0x8f24('0x6')),'defaultValue':_0x8f24('0x5')}}; \ No newline at end of file +var _0x1db0=['ENUM','basic','integrationTab','newTab','sequelize','STRING'];(function(_0x166742,_0x55520c){var _0xb7814a=function(_0x18feaf){while(--_0x18feaf){_0x166742['push'](_0x166742['shift']());}};_0xb7814a(++_0x55520c);}(_0x1db0,0x19c));var _0x01db=function(_0x58e09b,_0x6ef44c){_0x58e09b=_0x58e09b-0x0;var _0x243038=_0x1db0[_0x58e09b];return _0x243038;};'use strict';var Sequelize=require(_0x01db('0x0'));module['exports']={'name':{'type':Sequelize[_0x01db('0x1')]},'description':{'type':Sequelize[_0x01db('0x1')]},'username':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x01db('0x1')]},'authType':{'type':Sequelize[_0x01db('0x2')](_0x01db('0x3')),'defaultValue':_0x01db('0x3')},'password':{'type':Sequelize[_0x01db('0x1')]},'consumerKey':{'type':Sequelize[_0x01db('0x1')]},'consumerSecret':{'type':Sequelize[_0x01db('0x1')]},'token':{'type':Sequelize[_0x01db('0x1')]},'tokenSecret':{'type':Sequelize[_0x01db('0x1')]},'serverUrl':{'type':Sequelize[_0x01db('0x1')]},'type':{'type':Sequelize[_0x01db('0x2')](_0x01db('0x4'),_0x01db('0x5')),'defaultValue':_0x01db('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 01376a0..ab0e15c 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 _0xa85f=['offset','limit','status','set','Content-Range','json','reject','save','update','destroy','end','name','send','map','DeskAccount','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','VIRTUAL','options','includeAll','findAll','rows','show','params','keys','rawAttributes','create','body','find','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','password','consumerSecret','token','substring','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','base64','concat','_embedded','entries','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','count'];(function(_0xf0bcac,_0x531755){var _0x4e4c65=function(_0x35a77a){while(--_0x35a77a){_0xf0bcac['push'](_0xf0bcac['shift']());}};_0x4e4c65(++_0x531755);}(_0xa85f,0x144));var _0xfa85=function(_0xae819a,_0x1b2cd9){_0xae819a=_0xae819a-0x0;var _0x39d121=_0xa85f[_0xae819a];return _0x39d121;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfa85('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xfa85('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xfa85('0x2'));var moment=require(_0xfa85('0x3'));var BPromise=require(_0xfa85('0x4'));var Mustache=require('mustache');var util=require(_0xfa85('0x5'));var path=require(_0xfa85('0x6'));var sox=require(_0xfa85('0x7'));var csv=require(_0xfa85('0x8'));var ejs=require(_0xfa85('0x9'));var fs=require('fs');var _=require(_0xfa85('0xa'));var squel=require(_0xfa85('0xb'));var crypto=require('crypto');var jsforce=require(_0xfa85('0xc'));var deskjs=require(_0xfa85('0xd'));var toCsv=require(_0xfa85('0x8'));var querystring=require(_0xfa85('0xe'));var Papa=require(_0xfa85('0xf'));var Redis=require(_0xfa85('0x10'));var authService=require(_0xfa85('0x11'));var qs=require(_0xfa85('0x12'));var as=require(_0xfa85('0x13'));var hardwareService=require(_0xfa85('0x14'));var logger=require(_0xfa85('0x15'))(_0xfa85('0x16'));var utils=require(_0xfa85('0x17'));var config=require('../../config/environment');var db=require(_0xfa85('0x18'))['db'];var integrations=require(_0xfa85('0x19'));var jayson=require(_0xfa85('0x1a'));var client=jayson[_0xfa85('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x590816,_0x4f786f,_0x3b23b3){if(_0x3b23b3){var _0x1062f2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1062f2[_0xfa85('0x1c')](_0x4f786f)){return _0x590816;}else{throw new db[(_0xfa85('0x1d'))][(_0xfa85('0x1e'))]('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 _0x590816;}}function respondWithRpcPromise(_0x189f49,_0x5e8813,_0x415cd8,_0x48a8c1){return new BPromise(function(_0x143c6e,_0x297571){var _0x2ea0c4=_0x48a8c1||client;return _0x2ea0c4[_0xfa85('0x1f')](_0x189f49,_0x415cd8)[_0xfa85('0x20')](function(_0x1b410f){logger[_0xfa85('0x21')](_0xfa85('0x22'),_0x5e8813,_0xfa85('0x23'));logger[_0xfa85('0x24')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x5e8813,_0xfa85('0x23'),JSON[_0xfa85('0x25')](_0x1b410f));if(_0x1b410f['error']){if(_0x1b410f[_0xfa85('0x26')][_0xfa85('0x27')]===0x1f4){logger[_0xfa85('0x26')](_0xfa85('0x22'),_0x5e8813,_0x1b410f['error']['message']);return _0x297571(_0x1b410f[_0xfa85('0x26')][_0xfa85('0x28')]);}logger[_0xfa85('0x26')]('DeskAccount,\x20%s,\x20%s',_0x5e8813,_0x1b410f[_0xfa85('0x26')][_0xfa85('0x28')]);return _0x143c6e(_0x1b410f[_0xfa85('0x26')][_0xfa85('0x28')]);}else{logger[_0xfa85('0x21')](_0xfa85('0x22'),_0x5e8813,_0xfa85('0x23'));_0x143c6e(_0x1b410f[_0xfa85('0x29')][_0xfa85('0x28')]);}})[_0xfa85('0x2a')](function(_0x5410e0){logger[_0xfa85('0x26')]('DeskAccount,\x20%s,\x20%s',_0x5e8813,_0x5410e0);_0x297571(_0x5410e0);});});}function respondWithStatusCode(_0x15ace4,_0x3ba556){_0x3ba556=_0x3ba556||0xcc;return function(_0x4537e8){if(_0x4537e8){return _0x15ace4[_0xfa85('0x2b')](_0x3ba556);}return _0x15ace4['status'](_0x3ba556)['end']();};}function respondWithResult(_0x422714,_0x2efe18){_0x2efe18=_0x2efe18||0xc8;return function(_0x57ffa4){if(_0x57ffa4){return _0x422714['status'](_0x2efe18)['json'](_0x57ffa4);}};}function respondWithFilteredResult(_0xc82cb5,_0x48b908){return function(_0x365179){if(_0x365179){var _0x42cbc5=_0x365179[_0xfa85('0x2c')],_0x16988d=_0x48b908['offset'],_0x51f8fc=_0x48b908[_0xfa85('0x2d')]+_0x48b908[_0xfa85('0x2e')],_0x3b2b68;if(_0x51f8fc>=_0x42cbc5){_0x51f8fc=_0x42cbc5;_0x3b2b68=0xc8;}else{_0x3b2b68=0xce;}_0xc82cb5[_0xfa85('0x2f')](_0x3b2b68);return _0xc82cb5[_0xfa85('0x30')](_0xfa85('0x31'),_0x16988d+'-'+_0x51f8fc+'/'+_0x42cbc5)[_0xfa85('0x32')](_0x365179);}return null;};}function patchUpdates(_0x21f73b){return function(_0x2d09aa){try{jsonpatch['apply'](_0x2d09aa,_0x21f73b,!![]);}catch(_0x8fab51){return BPromise[_0xfa85('0x33')](_0x8fab51);}return _0x2d09aa[_0xfa85('0x34')]();};}function saveUpdates(_0x20a7a9,_0x185d77){return function(_0x35ccfa){if(_0x35ccfa){return _0x35ccfa[_0xfa85('0x35')](_0x20a7a9)[_0xfa85('0x20')](function(_0x4cf882){return _0x4cf882;});}return null;};}function removeEntity(_0x4c81de,_0x5d9ca8){return function(_0x42408f){if(_0x42408f){return _0x42408f[_0xfa85('0x36')]()[_0xfa85('0x20')](function(){_0x4c81de['status'](0xcc)[_0xfa85('0x37')]();});}};}function handleEntityNotFound(_0x5bb2b7,_0x11a3d1){return function(_0x188f42){if(!_0x188f42){_0x5bb2b7[_0xfa85('0x2b')](0x194);}return _0x188f42;};}function handleError(_0x1e8a91,_0x508f53){_0x508f53=_0x508f53||0x1f4;return function(_0x3edbef){logger[_0xfa85('0x26')](_0x3edbef['stack']);if(_0x3edbef[_0xfa85('0x38')]){delete _0x3edbef['name'];}_0x1e8a91[_0xfa85('0x2f')](_0x508f53)[_0xfa85('0x39')](_0x3edbef);};}exports['index']=function(_0x4e71ba,_0x2f70bf){var _0x45ddde={},_0x1b0f74={},_0xb6f903={'count':0x0,'rows':[]};var _0x4eac4c=_[_0xfa85('0x3a')](db[_0xfa85('0x3b')]['rawAttributes'],function(_0x12e64f){return{'name':_0x12e64f['fieldName'],'type':_0x12e64f['type'][_0xfa85('0x3c')]};});_0x1b0f74[_0xfa85('0x3d')]=_[_0xfa85('0x3a')](_0x4eac4c,_0xfa85('0x38'));_0x1b0f74[_0xfa85('0x3e')]=_['keys'](_0x4e71ba[_0xfa85('0x3e')]);_0x1b0f74[_0xfa85('0x3f')]=_[_0xfa85('0x40')](_0x1b0f74[_0xfa85('0x3d')],_0x1b0f74[_0xfa85('0x3e')]);_0x45ddde[_0xfa85('0x41')]=_[_0xfa85('0x40')](_0x1b0f74[_0xfa85('0x3d')],qs[_0xfa85('0x42')](_0x4e71ba[_0xfa85('0x3e')][_0xfa85('0x42')]));_0x45ddde[_0xfa85('0x41')]=_0x45ddde[_0xfa85('0x41')][_0xfa85('0x43')]?_0x45ddde[_0xfa85('0x41')]:_0x1b0f74['model'];if(!_0x4e71ba[_0xfa85('0x3e')][_0xfa85('0x44')](_0xfa85('0x45'))){_0x45ddde[_0xfa85('0x2e')]=qs[_0xfa85('0x2e')](_0x4e71ba[_0xfa85('0x3e')][_0xfa85('0x2e')]);_0x45ddde[_0xfa85('0x2d')]=qs['offset'](_0x4e71ba['query'][_0xfa85('0x2d')]);}_0x45ddde[_0xfa85('0x46')]=qs[_0xfa85('0x47')](_0x4e71ba[_0xfa85('0x3e')][_0xfa85('0x47')]);_0x45ddde['where']=qs[_0xfa85('0x3f')](_[_0xfa85('0x48')](_0x4e71ba['query'],_0x1b0f74[_0xfa85('0x3f')]));if(_0x4e71ba['query'][_0xfa85('0x49')]){_0x45ddde[_0xfa85('0x4a')]=_[_0xfa85('0x4b')](_0x45ddde['where'],{'$or':_[_0xfa85('0x3a')](_0x4eac4c,function(_0x559551){if(_0x559551[_0xfa85('0x4c')]!==_0xfa85('0x4d')){var _0x5d049c={};_0x5d049c[_0x559551[_0xfa85('0x38')]]={'$like':'%'+_0x4e71ba[_0xfa85('0x3e')][_0xfa85('0x49')]+'%'};return _0x5d049c;}})});}_0x45ddde=_[_0xfa85('0x4b')]({},_0x45ddde,_0x4e71ba[_0xfa85('0x4e')]);var _0x3f5f79={'where':_0x45ddde[_0xfa85('0x4a')]};return db['DeskAccount']['count'](_0x3f5f79)['then'](function(_0x221920){_0xb6f903['count']=_0x221920;if(_0x4e71ba[_0xfa85('0x3e')][_0xfa85('0x4f')]){_0x45ddde['include']=[{'all':!![]}];}return db['DeskAccount'][_0xfa85('0x50')](_0x45ddde);})['then'](function(_0x1323ea){_0xb6f903[_0xfa85('0x51')]=_0x1323ea;return _0xb6f903;})[_0xfa85('0x20')](respondWithFilteredResult(_0x2f70bf,_0x45ddde))[_0xfa85('0x2a')](handleError(_0x2f70bf,null));};exports[_0xfa85('0x52')]=function(_0x5e2d1e,_0x21fdd1){var _0x241646={'raw':![],'where':{'id':_0x5e2d1e[_0xfa85('0x53')]['id']}},_0x28939d={};_0x28939d[_0xfa85('0x3d')]=_[_0xfa85('0x54')](db[_0xfa85('0x3b')][_0xfa85('0x55')]);_0x28939d[_0xfa85('0x3e')]=_[_0xfa85('0x54')](_0x5e2d1e[_0xfa85('0x3e')]);_0x28939d[_0xfa85('0x3f')]=_['intersection'](_0x28939d[_0xfa85('0x3d')],_0x28939d[_0xfa85('0x3e')]);_0x241646[_0xfa85('0x41')]=_[_0xfa85('0x40')](_0x28939d[_0xfa85('0x3d')],qs[_0xfa85('0x42')](_0x5e2d1e['query'][_0xfa85('0x42')]));_0x241646[_0xfa85('0x41')]=_0x241646['attributes']['length']?_0x241646['attributes']:_0x28939d[_0xfa85('0x3d')];if(_0x5e2d1e[_0xfa85('0x3e')][_0xfa85('0x4f')]){_0x241646['include']=[{'all':!![]}];}_0x241646=_['merge']({},_0x241646,_0x5e2d1e['options']);return db['DeskAccount']['find'](_0x241646)[_0xfa85('0x20')](handleEntityNotFound(_0x21fdd1,null))['then'](respondWithResult(_0x21fdd1,null))[_0xfa85('0x2a')](handleError(_0x21fdd1,null));};exports[_0xfa85('0x56')]=function(_0x3a4ebb,_0x463b72){return db['DeskAccount'][_0xfa85('0x56')](_0x3a4ebb[_0xfa85('0x57')],{})[_0xfa85('0x20')](respondWithResult(_0x463b72,0xc9))[_0xfa85('0x2a')](handleError(_0x463b72,null));};exports[_0xfa85('0x35')]=function(_0x1a8c17,_0x324e5b){if(_0x1a8c17[_0xfa85('0x57')]['id']){delete _0x1a8c17[_0xfa85('0x57')]['id'];}return db[_0xfa85('0x3b')][_0xfa85('0x58')]({'where':{'id':_0x1a8c17[_0xfa85('0x53')]['id']}})['then'](handleEntityNotFound(_0x324e5b,null))[_0xfa85('0x20')](saveUpdates(_0x1a8c17[_0xfa85('0x57')],null))[_0xfa85('0x20')](respondWithResult(_0x324e5b,null))[_0xfa85('0x2a')](handleError(_0x324e5b,null));};exports[_0xfa85('0x36')]=function(_0x51f553,_0x357d80){return db[_0xfa85('0x3b')][_0xfa85('0x58')]({'where':{'id':_0x51f553['params']['id']}})[_0xfa85('0x20')](handleEntityNotFound(_0x357d80,null))['then'](removeEntity(_0x357d80,null))[_0xfa85('0x2a')](handleError(_0x357d80,null));};exports[_0xfa85('0x59')]=function(_0x314cc5,_0x45eb41,_0x1f532d){var _0x43a798={};var _0x2d8857={};var _0x4473f3;var _0x3704bb;return db[_0xfa85('0x3b')][_0xfa85('0x5a')]({'where':{'id':_0x314cc5[_0xfa85('0x53')]['id']}})[_0xfa85('0x20')](handleEntityNotFound(_0x45eb41,null))[_0xfa85('0x20')](function(_0x56bd3c){if(_0x56bd3c){_0x4473f3=_0x56bd3c;_0x2d8857[_0xfa85('0x3d')]=_['keys'](db['DeskConfiguration'][_0xfa85('0x55')]);_0x2d8857[_0xfa85('0x3e')]=_[_0xfa85('0x54')](_0x314cc5[_0xfa85('0x3e')]);_0x2d8857[_0xfa85('0x3f')]=_[_0xfa85('0x40')](_0x2d8857[_0xfa85('0x3d')],_0x2d8857['query']);_0x43a798[_0xfa85('0x41')]=_[_0xfa85('0x40')](_0x2d8857[_0xfa85('0x3d')],qs[_0xfa85('0x42')](_0x314cc5['query'][_0xfa85('0x42')]));_0x43a798[_0xfa85('0x41')]=_0x43a798[_0xfa85('0x41')][_0xfa85('0x43')]?_0x43a798[_0xfa85('0x41')]:_0x2d8857[_0xfa85('0x3d')];_0x43a798[_0xfa85('0x46')]=qs[_0xfa85('0x47')](_0x314cc5[_0xfa85('0x3e')][_0xfa85('0x47')]);_0x43a798['where']=qs['filters'](_[_0xfa85('0x48')](_0x314cc5[_0xfa85('0x3e')],_0x2d8857[_0xfa85('0x3f')]));if(_0x314cc5[_0xfa85('0x3e')]['filter']){_0x43a798[_0xfa85('0x4a')]=_[_0xfa85('0x4b')](_0x43a798['where'],{'$or':_[_0xfa85('0x3a')](_0x43a798[_0xfa85('0x41')],function(_0x54eeac){var _0x249f32={};_0x249f32[_0x54eeac]={'$like':'%'+_0x314cc5['query'][_0xfa85('0x49')]+'%'};return _0x249f32;})});}_0x43a798=_[_0xfa85('0x4b')]({},_0x43a798,_0x314cc5[_0xfa85('0x4e')]);return _0x4473f3['getConfigurations'](_0x43a798);}})[_0xfa85('0x20')](function(_0x200f56){if(_0x200f56){_0x3704bb=_0x200f56[_0xfa85('0x43')];if(!_0x314cc5[_0xfa85('0x3e')][_0xfa85('0x44')](_0xfa85('0x45'))){_0x43a798[_0xfa85('0x2e')]=qs['limit'](_0x314cc5[_0xfa85('0x3e')]['limit']);_0x43a798[_0xfa85('0x2d')]=qs['offset'](_0x314cc5[_0xfa85('0x3e')][_0xfa85('0x2d')]);}return _0x4473f3[_0xfa85('0x59')](_0x43a798);}})[_0xfa85('0x20')](function(_0x47cd4c){if(_0x47cd4c){return _0x47cd4c?{'count':_0x3704bb,'rows':_0x47cd4c}:null;}})[_0xfa85('0x20')](respondWithResult(_0x45eb41,null))[_0xfa85('0x2a')](handleError(_0x45eb41,null));};exports[_0xfa85('0x5b')]=function(_0x1f77e2,_0xbb7c42,_0x5dc338){if(_0x1f77e2[_0xfa85('0x57')]['id']){delete _0x1f77e2[_0xfa85('0x57')]['id'];}return db['DeskAccount'][_0xfa85('0x5a')]({'where':{'id':_0x1f77e2['params']['id']}})[_0xfa85('0x20')](handleEntityNotFound(_0xbb7c42,null))[_0xfa85('0x20')](function(_0x1a9aff){if(_0x1a9aff){_0x1f77e2['body'][_0xfa85('0x5c')]=_0x1a9aff['id'];_0x1f77e2[_0xfa85('0x57')][_0xfa85('0x5d')]=integrations[_0xfa85('0x5e')](_0x1f77e2[_0xfa85('0x57')]['channel'],_0x1f77e2[_0xfa85('0x57')]['type']);_0x1f77e2[_0xfa85('0x57')][_0xfa85('0x5f')]=integrations[_0xfa85('0x60')](_0x1f77e2['body'][_0xfa85('0x61')],_0x1f77e2[_0xfa85('0x57')][_0xfa85('0x4c')]);return db[_0xfa85('0x62')]['create'](_0x1f77e2[_0xfa85('0x57')],{'include':[{'model':db[_0xfa85('0x63')],'as':_0xfa85('0x5d')},{'model':db['DeskField'],'as':_0xfa85('0x5f')}]});}return null;})[_0xfa85('0x20')](respondWithResult(_0xbb7c42,null))['catch'](handleError(_0xbb7c42,null));};exports[_0xfa85('0x64')]=function(_0x1ef965,_0x52fa7a,_0x4539c2){var _0x1a5bc3=[{'name':_0xfa85('0x65'),'label':_0xfa85('0x65'),'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 _0x41d22b='';return db[_0xfa85('0x3b')][_0xfa85('0x5a')]({'where':{'id':_0x1ef965[_0xfa85('0x53')]['id']},'attributes':['id',_0xfa85('0x66'),_0xfa85('0x67'),'username',_0xfa85('0x68'),'consumerKey',_0xfa85('0x69'),_0xfa85('0x6a'),'tokenSecret']})['then'](handleEntityNotFound(_0x52fa7a,null))[_0xfa85('0x20')](function(_0x5b132a){if(_0x5b132a){_0x41d22b=_0x5b132a[_0xfa85('0x66')];var _0xe1722a=_0x41d22b['slice'](-0x1);if(_0xe1722a==='/'){_0x41d22b=_0x41d22b[_0xfa85('0x6b')](0x0,_0x41d22b['lastIndexOf'](_0xe1722a));}var _0x3a165f={'method':'GET','uri':util[_0xfa85('0x6c')](_0xfa85('0x6d'),_0x41d22b),'headers':{'Content-Type':_0xfa85('0x6e'),'Accept':'application/json'},'json':!![]};if(_0x5b132a[_0xfa85('0x67')]===_0xfa85('0x6f')){_0x3a165f[_0xfa85('0x70')][_0xfa85('0x71')]=util[_0xfa85('0x6c')](_0xfa85('0x72'),new Buffer(util[_0xfa85('0x6c')]('%s:%s',_0x5b132a['username'],_0x5b132a[_0xfa85('0x68')]))['toString'](_0xfa85('0x73')));}return rp(_0x3a165f)[_0xfa85('0x20')](function(_0x236989){return _0x1a5bc3[_0xfa85('0x74')](_['map'](_0x236989[_0xfa85('0x75')][_0xfa85('0x76')],function(_0x56be45){return{'id':_0x56be45['name'],'name':_0x56be45[_0xfa85('0x38')],'type':_0x56be45['type'],'active':_0x56be45['active'],'label':_0x56be45[_0xfa85('0x77')],'custom':!![]};}));});}})[_0xfa85('0x20')](function(_0x10cb8d){return{'count':_0x10cb8d[_0xfa85('0x43')],'rows':_0x10cb8d};})[_0xfa85('0x20')](respondWithResult(_0x52fa7a,null))['catch'](function(_0x104d1b){var _0x5cac21=_0x1ef965[_0xfa85('0x3e')][_0xfa85('0x1c')]?0x1f4:_0x104d1b[_0xfa85('0x78')]||0x1f4;logger[_0xfa85('0x26')](_0xfa85('0x79'),_0xfa85('0x64'),_0x5cac21,JSON[_0xfa85('0x25')](_0x104d1b));delete _0x104d1b[_0xfa85('0x38')];if(_0x5cac21===0x191){_0x5cac21=0x190;}_0x52fa7a[_0xfa85('0x2f')](_0x5cac21)[_0xfa85('0x39')](_0x1ef965[_0xfa85('0x3e')][_0xfa85('0x1c')]?{'message':_0xfa85('0x7a'),'statusCode':_0x104d1b[_0xfa85('0x78')]}:_0x104d1b);});}; \ No newline at end of file +var _0x5bea=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','update','stack','name','send','index','map','DeskAccount','rawAttributes','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','merge','where','type','options','includeAll','include','findAll','rows','show','length','find','create','body','params','getConfigurations','findOne','DeskConfiguration','hasOwnProperty','addConfiguration','AccountId','getSubjects','Descriptions','getDescriptions','channel','Subjects','getFields','priority','remoteUri','authType','username','password','consumerSecret','token','tokenSecret','slice','substring','format','headers','Authorization','base64','concat','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','desk.js'];(function(_0x3ea2cb,_0x36eb7d){var _0x4b6dd2=function(_0x4ed78f){while(--_0x4ed78f){_0x3ea2cb['push'](_0x3ea2cb['shift']());}};_0x4b6dd2(++_0x36eb7d);}(_0x5bea,0x141));var _0xa5be=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5bea[_0x40a045];return _0x1a687c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa5be('0x0'));var rimraf=require(_0xa5be('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa5be('0x2'));var rp=require(_0xa5be('0x3'));var moment=require(_0xa5be('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xa5be('0x5'));var util=require(_0xa5be('0x6'));var path=require(_0xa5be('0x7'));var sox=require('sox');var csv=require(_0xa5be('0x8'));var ejs=require(_0xa5be('0x9'));var fs=require('fs');var _=require(_0xa5be('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa5be('0xb'));var toCsv=require(_0xa5be('0x8'));var querystring=require('querystring');var Papa=require(_0xa5be('0xc'));var Redis=require('ioredis');var authService=require(_0xa5be('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xa5be('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa5be('0xf'));var utils=require(_0xa5be('0x10'));var config=require('../../config/environment');var db=require(_0xa5be('0x11'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xa5be('0x12'));var client=jayson[_0xa5be('0x13')][_0xa5be('0x14')]({'port':0x232a});function checkPasswordPattern(_0x44f020,_0x2b077c,_0x5d6bc0){if(_0x5d6bc0){var _0x40e187=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40e187[_0xa5be('0x15')](_0x2b077c)){return _0x44f020;}else{throw new db['Sequelize']['ValidationError'](_0xa5be('0x16'));}}else{return _0x44f020;}}function respondWithRpcPromise(_0x504a86,_0x6b62d2,_0x208245,_0x5747be){return new BPromise(function(_0x3f0d1f,_0x7f5bbf){var _0x5cbf7b=_0x5747be||client;return _0x5cbf7b[_0xa5be('0x17')](_0x504a86,_0x208245)[_0xa5be('0x18')](function(_0x5693e0){logger[_0xa5be('0x19')](_0xa5be('0x1a'),_0x6b62d2,_0xa5be('0x1b'));logger[_0xa5be('0x1c')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x6b62d2,'request\x20sent',JSON[_0xa5be('0x1d')](_0x5693e0));if(_0x5693e0['error']){if(_0x5693e0[_0xa5be('0x1e')][_0xa5be('0x1f')]===0x1f4){logger['error'](_0xa5be('0x1a'),_0x6b62d2,_0x5693e0[_0xa5be('0x1e')][_0xa5be('0x20')]);return _0x7f5bbf(_0x5693e0[_0xa5be('0x1e')]['message']);}logger['error'](_0xa5be('0x1a'),_0x6b62d2,_0x5693e0[_0xa5be('0x1e')]['message']);return _0x3f0d1f(_0x5693e0[_0xa5be('0x1e')][_0xa5be('0x20')]);}else{logger[_0xa5be('0x19')](_0xa5be('0x1a'),_0x6b62d2,_0xa5be('0x1b'));_0x3f0d1f(_0x5693e0[_0xa5be('0x21')]['message']);}})[_0xa5be('0x22')](function(_0x952356){logger['error']('DeskAccount,\x20%s,\x20%s',_0x6b62d2,_0x952356);_0x7f5bbf(_0x952356);});});}function respondWithStatusCode(_0x50d8d0,_0x4a5df1){_0x4a5df1=_0x4a5df1||0xcc;return function(_0x1ffe19){if(_0x1ffe19){return _0x50d8d0[_0xa5be('0x23')](_0x4a5df1);}return _0x50d8d0[_0xa5be('0x24')](_0x4a5df1)[_0xa5be('0x25')]();};}function respondWithResult(_0x5c8e39,_0x1a91be){_0x1a91be=_0x1a91be||0xc8;return function(_0x1f2ec2){if(_0x1f2ec2){return _0x5c8e39[_0xa5be('0x24')](_0x1a91be)[_0xa5be('0x26')](_0x1f2ec2);}};}function respondWithFilteredResult(_0x4b2175,_0x27b00b){return function(_0x5b6be6){if(_0x5b6be6){var _0xab89e5=_0x5b6be6[_0xa5be('0x27')],_0x260b2a=_0x27b00b['offset'],_0xf7b26f=_0x27b00b[_0xa5be('0x28')]+_0x27b00b[_0xa5be('0x29')],_0x4be9da;if(_0xf7b26f>=_0xab89e5){_0xf7b26f=_0xab89e5;_0x4be9da=0xc8;}else{_0x4be9da=0xce;}_0x4b2175[_0xa5be('0x24')](_0x4be9da);return _0x4b2175['set'](_0xa5be('0x2a'),_0x260b2a+'-'+_0xf7b26f+'/'+_0xab89e5)[_0xa5be('0x26')](_0x5b6be6);}return null;};}function patchUpdates(_0x47e094){return function(_0x55ee8f){try{jsonpatch['apply'](_0x55ee8f,_0x47e094,!![]);}catch(_0x11b02d){return BPromise['reject'](_0x11b02d);}return _0x55ee8f['save']();};}function saveUpdates(_0x5d3ac8,_0x1f2591){return function(_0x3503dc){if(_0x3503dc){return _0x3503dc[_0xa5be('0x2b')](_0x5d3ac8)[_0xa5be('0x18')](function(_0x5bdc5a){return _0x5bdc5a;});}return null;};}function removeEntity(_0x6b1d39,_0xc3b195){return function(_0x379b3d){if(_0x379b3d){return _0x379b3d['destroy']()[_0xa5be('0x18')](function(){_0x6b1d39[_0xa5be('0x24')](0xcc)[_0xa5be('0x25')]();});}};}function handleEntityNotFound(_0x4c083c,_0x21da44){return function(_0x3489d2){if(!_0x3489d2){_0x4c083c['sendStatus'](0x194);}return _0x3489d2;};}function handleError(_0x1af13e,_0xdc24ca){_0xdc24ca=_0xdc24ca||0x1f4;return function(_0x3d0452){logger[_0xa5be('0x1e')](_0x3d0452[_0xa5be('0x2c')]);if(_0x3d0452[_0xa5be('0x2d')]){delete _0x3d0452[_0xa5be('0x2d')];}_0x1af13e[_0xa5be('0x24')](_0xdc24ca)[_0xa5be('0x2e')](_0x3d0452);};}exports[_0xa5be('0x2f')]=function(_0x9c083c,_0x5ee924){var _0x5767cd={},_0x293ea9={},_0x34bf00={'count':0x0,'rows':[]};var _0x83a5c2=_[_0xa5be('0x30')](db[_0xa5be('0x31')][_0xa5be('0x32')],function(_0x4cad79){return{'name':_0x4cad79['fieldName'],'type':_0x4cad79['type'][_0xa5be('0x33')]};});_0x293ea9[_0xa5be('0x34')]=_[_0xa5be('0x30')](_0x83a5c2,_0xa5be('0x2d'));_0x293ea9[_0xa5be('0x35')]=_[_0xa5be('0x36')](_0x9c083c[_0xa5be('0x35')]);_0x293ea9[_0xa5be('0x37')]=_[_0xa5be('0x38')](_0x293ea9[_0xa5be('0x34')],_0x293ea9[_0xa5be('0x35')]);_0x5767cd[_0xa5be('0x39')]=_[_0xa5be('0x38')](_0x293ea9[_0xa5be('0x34')],qs[_0xa5be('0x3a')](_0x9c083c[_0xa5be('0x35')]['fields']));_0x5767cd[_0xa5be('0x39')]=_0x5767cd[_0xa5be('0x39')]['length']?_0x5767cd[_0xa5be('0x39')]:_0x293ea9[_0xa5be('0x34')];if(!_0x9c083c[_0xa5be('0x35')]['hasOwnProperty'](_0xa5be('0x3b'))){_0x5767cd['limit']=qs[_0xa5be('0x29')](_0x9c083c[_0xa5be('0x35')][_0xa5be('0x29')]);_0x5767cd['offset']=qs[_0xa5be('0x28')](_0x9c083c[_0xa5be('0x35')][_0xa5be('0x28')]);}_0x5767cd[_0xa5be('0x3c')]=qs['sort'](_0x9c083c[_0xa5be('0x35')][_0xa5be('0x3d')]);_0x5767cd['where']=qs[_0xa5be('0x37')](_[_0xa5be('0x3e')](_0x9c083c[_0xa5be('0x35')],_0x293ea9[_0xa5be('0x37')]));if(_0x9c083c[_0xa5be('0x35')][_0xa5be('0x3f')]){_0x5767cd['where']=_[_0xa5be('0x40')](_0x5767cd[_0xa5be('0x41')],{'$or':_[_0xa5be('0x30')](_0x83a5c2,function(_0x3b3833){if(_0x3b3833[_0xa5be('0x42')]!=='VIRTUAL'){var _0xa4b106={};_0xa4b106[_0x3b3833[_0xa5be('0x2d')]]={'$like':'%'+_0x9c083c[_0xa5be('0x35')]['filter']+'%'};return _0xa4b106;}})});}_0x5767cd=_[_0xa5be('0x40')]({},_0x5767cd,_0x9c083c[_0xa5be('0x43')]);var _0x1a4322={'where':_0x5767cd['where']};return db[_0xa5be('0x31')][_0xa5be('0x27')](_0x1a4322)[_0xa5be('0x18')](function(_0x4ab65f){_0x34bf00[_0xa5be('0x27')]=_0x4ab65f;if(_0x9c083c[_0xa5be('0x35')][_0xa5be('0x44')]){_0x5767cd[_0xa5be('0x45')]=[{'all':!![]}];}return db[_0xa5be('0x31')][_0xa5be('0x46')](_0x5767cd);})[_0xa5be('0x18')](function(_0xba4471){_0x34bf00[_0xa5be('0x47')]=_0xba4471;return _0x34bf00;})[_0xa5be('0x18')](respondWithFilteredResult(_0x5ee924,_0x5767cd))['catch'](handleError(_0x5ee924,null));};exports[_0xa5be('0x48')]=function(_0x4bb96e,_0xec36b3){var _0x2eb3e4={'raw':![],'where':{'id':_0x4bb96e['params']['id']}},_0x79f299={};_0x79f299[_0xa5be('0x34')]=_[_0xa5be('0x36')](db[_0xa5be('0x31')]['rawAttributes']);_0x79f299[_0xa5be('0x35')]=_[_0xa5be('0x36')](_0x4bb96e[_0xa5be('0x35')]);_0x79f299[_0xa5be('0x37')]=_[_0xa5be('0x38')](_0x79f299[_0xa5be('0x34')],_0x79f299[_0xa5be('0x35')]);_0x2eb3e4[_0xa5be('0x39')]=_[_0xa5be('0x38')](_0x79f299[_0xa5be('0x34')],qs['fields'](_0x4bb96e[_0xa5be('0x35')][_0xa5be('0x3a')]));_0x2eb3e4[_0xa5be('0x39')]=_0x2eb3e4[_0xa5be('0x39')][_0xa5be('0x49')]?_0x2eb3e4[_0xa5be('0x39')]:_0x79f299['model'];if(_0x4bb96e[_0xa5be('0x35')][_0xa5be('0x44')]){_0x2eb3e4['include']=[{'all':!![]}];}_0x2eb3e4=_[_0xa5be('0x40')]({},_0x2eb3e4,_0x4bb96e[_0xa5be('0x43')]);return db[_0xa5be('0x31')][_0xa5be('0x4a')](_0x2eb3e4)[_0xa5be('0x18')](handleEntityNotFound(_0xec36b3,null))[_0xa5be('0x18')](respondWithResult(_0xec36b3,null))[_0xa5be('0x22')](handleError(_0xec36b3,null));};exports[_0xa5be('0x4b')]=function(_0x1bd257,_0x38e5ee){return db[_0xa5be('0x31')]['create'](_0x1bd257[_0xa5be('0x4c')],{})[_0xa5be('0x18')](respondWithResult(_0x38e5ee,0xc9))[_0xa5be('0x22')](handleError(_0x38e5ee,null));};exports[_0xa5be('0x2b')]=function(_0x181236,_0x1c4c5b){if(_0x181236[_0xa5be('0x4c')]['id']){delete _0x181236[_0xa5be('0x4c')]['id'];}return db[_0xa5be('0x31')][_0xa5be('0x4a')]({'where':{'id':_0x181236[_0xa5be('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1c4c5b,null))[_0xa5be('0x18')](saveUpdates(_0x181236[_0xa5be('0x4c')],null))[_0xa5be('0x18')](respondWithResult(_0x1c4c5b,null))[_0xa5be('0x22')](handleError(_0x1c4c5b,null));};exports['destroy']=function(_0xffcab5,_0x61666){return db[_0xa5be('0x31')][_0xa5be('0x4a')]({'where':{'id':_0xffcab5[_0xa5be('0x4d')]['id']}})[_0xa5be('0x18')](handleEntityNotFound(_0x61666,null))[_0xa5be('0x18')](removeEntity(_0x61666,null))[_0xa5be('0x22')](handleError(_0x61666,null));};exports[_0xa5be('0x4e')]=function(_0x4b4cee,_0x3b450e,_0x5adce2){var _0x25f694={};var _0x3b6867={};var _0x3f216f;var _0x5e001c;return db[_0xa5be('0x31')][_0xa5be('0x4f')]({'where':{'id':_0x4b4cee[_0xa5be('0x4d')]['id']}})[_0xa5be('0x18')](handleEntityNotFound(_0x3b450e,null))[_0xa5be('0x18')](function(_0xca675c){if(_0xca675c){_0x3f216f=_0xca675c;_0x3b6867[_0xa5be('0x34')]=_[_0xa5be('0x36')](db[_0xa5be('0x50')]['rawAttributes']);_0x3b6867['query']=_['keys'](_0x4b4cee[_0xa5be('0x35')]);_0x3b6867['filters']=_[_0xa5be('0x38')](_0x3b6867[_0xa5be('0x34')],_0x3b6867[_0xa5be('0x35')]);_0x25f694[_0xa5be('0x39')]=_[_0xa5be('0x38')](_0x3b6867[_0xa5be('0x34')],qs[_0xa5be('0x3a')](_0x4b4cee[_0xa5be('0x35')][_0xa5be('0x3a')]));_0x25f694['attributes']=_0x25f694[_0xa5be('0x39')][_0xa5be('0x49')]?_0x25f694[_0xa5be('0x39')]:_0x3b6867[_0xa5be('0x34')];_0x25f694[_0xa5be('0x3c')]=qs[_0xa5be('0x3d')](_0x4b4cee[_0xa5be('0x35')][_0xa5be('0x3d')]);_0x25f694[_0xa5be('0x41')]=qs[_0xa5be('0x37')](_['pick'](_0x4b4cee[_0xa5be('0x35')],_0x3b6867[_0xa5be('0x37')]));if(_0x4b4cee['query'][_0xa5be('0x3f')]){_0x25f694[_0xa5be('0x41')]=_[_0xa5be('0x40')](_0x25f694['where'],{'$or':_['map'](_0x25f694['attributes'],function(_0x2480cb){var _0x5f03d1={};_0x5f03d1[_0x2480cb]={'$like':'%'+_0x4b4cee[_0xa5be('0x35')][_0xa5be('0x3f')]+'%'};return _0x5f03d1;})});}_0x25f694=_[_0xa5be('0x40')]({},_0x25f694,_0x4b4cee[_0xa5be('0x43')]);return _0x3f216f['getConfigurations'](_0x25f694);}})['then'](function(_0x258c18){if(_0x258c18){_0x5e001c=_0x258c18[_0xa5be('0x49')];if(!_0x4b4cee[_0xa5be('0x35')][_0xa5be('0x51')]('nolimit')){_0x25f694['limit']=qs['limit'](_0x4b4cee['query'][_0xa5be('0x29')]);_0x25f694[_0xa5be('0x28')]=qs[_0xa5be('0x28')](_0x4b4cee[_0xa5be('0x35')][_0xa5be('0x28')]);}return _0x3f216f['getConfigurations'](_0x25f694);}})[_0xa5be('0x18')](function(_0xa9041c){if(_0xa9041c){return _0xa9041c?{'count':_0x5e001c,'rows':_0xa9041c}:null;}})['then'](respondWithResult(_0x3b450e,null))[_0xa5be('0x22')](handleError(_0x3b450e,null));};exports[_0xa5be('0x52')]=function(_0x22967d,_0x586ac9,_0x5eed2e){if(_0x22967d[_0xa5be('0x4c')]['id']){delete _0x22967d[_0xa5be('0x4c')]['id'];}return db['DeskAccount'][_0xa5be('0x4f')]({'where':{'id':_0x22967d[_0xa5be('0x4d')]['id']}})['then'](handleEntityNotFound(_0x586ac9,null))[_0xa5be('0x18')](function(_0x1d9ad0){if(_0x1d9ad0){_0x22967d[_0xa5be('0x4c')][_0xa5be('0x53')]=_0x1d9ad0['id'];_0x22967d[_0xa5be('0x4c')]['Subjects']=integrations[_0xa5be('0x54')](_0x22967d[_0xa5be('0x4c')]['channel'],_0x22967d[_0xa5be('0x4c')]['type']);_0x22967d[_0xa5be('0x4c')][_0xa5be('0x55')]=integrations[_0xa5be('0x56')](_0x22967d[_0xa5be('0x4c')][_0xa5be('0x57')],_0x22967d[_0xa5be('0x4c')][_0xa5be('0x42')]);return db['DeskConfiguration'][_0xa5be('0x4b')](_0x22967d[_0xa5be('0x4c')],{'include':[{'model':db['DeskField'],'as':_0xa5be('0x58')},{'model':db['DeskField'],'as':_0xa5be('0x55')}]});}return null;})[_0xa5be('0x18')](respondWithResult(_0x586ac9,null))[_0xa5be('0x22')](handleError(_0x586ac9,null));};exports[_0xa5be('0x59')]=function(_0x36b8b8,_0x351be0,_0xdbdaa2){var _0x3f23ce=[{'name':_0xa5be('0x5a'),'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 _0x25bd26='';return db[_0xa5be('0x31')]['findOne']({'where':{'id':_0x36b8b8[_0xa5be('0x4d')]['id']},'attributes':['id',_0xa5be('0x5b'),_0xa5be('0x5c'),_0xa5be('0x5d'),_0xa5be('0x5e'),'consumerKey',_0xa5be('0x5f'),_0xa5be('0x60'),_0xa5be('0x61')]})['then'](handleEntityNotFound(_0x351be0,null))[_0xa5be('0x18')](function(_0xbdbc8f){if(_0xbdbc8f){_0x25bd26=_0xbdbc8f[_0xa5be('0x5b')];var _0x11c77e=_0x25bd26[_0xa5be('0x62')](-0x1);if(_0x11c77e==='/'){_0x25bd26=_0x25bd26[_0xa5be('0x63')](0x0,_0x25bd26['lastIndexOf'](_0x11c77e));}var _0x21bf78={'method':'GET','uri':util[_0xa5be('0x64')]('%s/custom_fields',_0x25bd26),'headers':{'Content-Type':'application/json','Accept':'application/json'},'json':!![]};if(_0xbdbc8f[_0xa5be('0x5c')]==='basic'){_0x21bf78[_0xa5be('0x65')][_0xa5be('0x66')]=util[_0xa5be('0x64')]('Basic\x20%s',new Buffer(util['format']('%s:%s',_0xbdbc8f[_0xa5be('0x5d')],_0xbdbc8f[_0xa5be('0x5e')]))['toString'](_0xa5be('0x67')));}return rp(_0x21bf78)[_0xa5be('0x18')](function(_0xdf71bf){return _0x3f23ce[_0xa5be('0x68')](_[_0xa5be('0x30')](_0xdf71bf['_embedded'][_0xa5be('0x69')],function(_0x529e10){return{'id':_0x529e10['name'],'name':_0x529e10['name'],'type':_0x529e10['type'],'active':_0x529e10[_0xa5be('0x6a')],'label':_0x529e10[_0xa5be('0x6b')],'custom':!![]};}));});}})[_0xa5be('0x18')](function(_0x1bfa58){return{'count':_0x1bfa58[_0xa5be('0x49')],'rows':_0x1bfa58};})[_0xa5be('0x18')](respondWithResult(_0x351be0,null))[_0xa5be('0x22')](function(_0x57b1c3){var _0x2cb1ec=_0x36b8b8[_0xa5be('0x35')][_0xa5be('0x15')]?0x1f4:_0x57b1c3[_0xa5be('0x6c')]||0x1f4;logger[_0xa5be('0x1e')](_0xa5be('0x6d'),_0xa5be('0x59'),_0x2cb1ec,JSON[_0xa5be('0x1d')](_0x57b1c3));delete _0x57b1c3['name'];if(_0x2cb1ec===0x191){_0x2cb1ec=0x190;}_0x351be0[_0xa5be('0x24')](_0x2cb1ec)[_0xa5be('0x2e')](_0x36b8b8['query'][_0xa5be('0x15')]?{'message':_0xa5be('0x6e'),'statusCode':_0x57b1c3[_0xa5be('0x6c')]}:_0x57b1c3);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 86de6f7..bdee9e6 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 _0xe4ff=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','int_desk_accounts','util','request-promise','path','rimraf'];(function(_0x85f3ed,_0x35a3d5){var _0x5b5245=function(_0x2a9ff9){while(--_0x2a9ff9){_0x85f3ed['push'](_0x85f3ed['shift']());}};_0x5b5245(++_0x35a3d5);}(_0xe4ff,0x1dc));var _0xfe4f=function(_0x58e32c,_0x309781){_0x58e32c=_0x58e32c-0x0;var _0x481e60=_0xe4ff[_0x58e32c];return _0x481e60;};'use strict';var _=require('lodash');var util=require(_0xfe4f('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xfe4f('0x1'));var fs=require('fs');var path=require(_0xfe4f('0x2'));var rimraf=require(_0xfe4f('0x3'));var config=require('../../config/environment');var attributes=require(_0xfe4f('0x4'));var integrations=require(_0xfe4f('0x5'));module[_0xfe4f('0x6')]=function(_0x424b41,_0x2958c3){return _0x424b41['define']('DeskAccount',attributes,{'tableName':_0xfe4f('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39e1=['./intDeskAccount.attributes','../../components/integrations/configuration','exports','DeskAccount','int_desk_accounts','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf'];(function(_0x2fe809,_0x33d862){var _0x5cbde7=function(_0x2104bd){while(--_0x2104bd){_0x2fe809['push'](_0x2fe809['shift']());}};_0x5cbde7(++_0x33d862);}(_0x39e1,0x119));var _0x139e=function(_0x3bba82,_0x5463fb){_0x3bba82=_0x3bba82-0x0;var _0x3f47f0=_0x39e1[_0x3bba82];return _0x3f47f0;};'use strict';var _=require(_0x139e('0x0'));var util=require('util');var logger=require(_0x139e('0x1'))('api');var moment=require(_0x139e('0x2'));var BPromise=require(_0x139e('0x3'));var rp=require(_0x139e('0x4'));var fs=require('fs');var path=require(_0x139e('0x5'));var rimraf=require(_0x139e('0x6'));var config=require('../../config/environment');var attributes=require(_0x139e('0x7'));var integrations=require(_0x139e('0x8'));module[_0x139e('0x9')]=function(_0x177944,_0x56d5ce){return _0x177944['define'](_0x139e('0xa'),attributes,{'tableName':_0x139e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.rpc.js b/server/api/intDeskAccount/intDeskAccount.rpc.js index 7ea4a73..d6fa95c 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 _0x0925=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','DeskAccount,\x20%s,\x20%s','debug','request\x20sent','error','code','message','catch','GetDeskAccount','DeskAccount','findAll','raw','options','where','attributes','limit','include','map','model','then','ShowDeskAccount','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3f8743,_0x33973f){var _0x1f844c=function(_0x568841){while(--_0x568841){_0x3f8743['push'](_0x3f8743['shift']());}};_0x1f844c(++_0x33973f);}(_0x0925,0x65));var _0x5092=function(_0x2aa3ed,_0x21bb61){_0x2aa3ed=_0x2aa3ed-0x0;var _0x4e0881=_0x0925[_0x2aa3ed];return _0x4e0881;};'use strict';var _=require(_0x5092('0x0'));var util=require(_0x5092('0x1'));var moment=require(_0x5092('0x2'));var BPromise=require(_0x5092('0x3'));var rs=require(_0x5092('0x4'));var fs=require('fs');var Redis=require(_0x5092('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5092('0x6'));var logger=require(_0x5092('0x7'))(_0x5092('0x8'));var config=require(_0x5092('0x9'));var jayson=require(_0x5092('0xa'));var client=jayson['client'][_0x5092('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5b0eb3,_0x26d9ef,_0x439fcb){return new BPromise(function(_0x5f3744,_0x42f8cf){return client[_0x5092('0xc')](_0x5b0eb3,_0x439fcb)['then'](function(_0x2d38d4){logger[_0x5092('0xd')](_0x5092('0xe'),_0x26d9ef,'request\x20sent');logger[_0x5092('0xf')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x26d9ef,_0x5092('0x10'),JSON['stringify'](_0x2d38d4));if(_0x2d38d4[_0x5092('0x11')]){if(_0x2d38d4['error'][_0x5092('0x12')]===0x1f4){logger[_0x5092('0x11')]('DeskAccount,\x20%s,\x20%s',_0x26d9ef,_0x2d38d4[_0x5092('0x11')][_0x5092('0x13')]);return _0x42f8cf(_0x2d38d4['error'][_0x5092('0x13')]);}logger[_0x5092('0x11')](_0x5092('0xe'),_0x26d9ef,_0x2d38d4['error'][_0x5092('0x13')]);return _0x5f3744(_0x2d38d4[_0x5092('0x11')][_0x5092('0x13')]);}else{logger[_0x5092('0xd')]('DeskAccount,\x20%s,\x20%s',_0x26d9ef,_0x5092('0x10'));_0x5f3744(_0x2d38d4['result']['message']);}})[_0x5092('0x14')](function(_0x500962){logger['error'](_0x5092('0xe'),_0x26d9ef,_0x500962);_0x42f8cf(_0x500962);});});}exports[_0x5092('0x15')]=function(_0x12e011){var _0x50a4c4=this;return new Promise(function(_0x14860e,_0x3542ae){return db[_0x5092('0x16')][_0x5092('0x17')]({'raw':_0x12e011['options']?_0x12e011['options'][_0x5092('0x18')]===undefined?!![]:![]:!![],'where':_0x12e011[_0x5092('0x19')]?_0x12e011['options'][_0x5092('0x1a')]||null:null,'attributes':_0x12e011[_0x5092('0x19')]?_0x12e011[_0x5092('0x19')][_0x5092('0x1b')]||null:null,'limit':_0x12e011['options']?_0x12e011['options'][_0x5092('0x1c')]||null:null,'include':_0x12e011[_0x5092('0x19')]?_0x12e011[_0x5092('0x19')][_0x5092('0x1d')]?_[_0x5092('0x1e')](_0x12e011[_0x5092('0x19')][_0x5092('0x1d')],function(_0x295475){return{'model':db[_0x295475['model']],'as':_0x295475['as'],'attributes':_0x295475[_0x5092('0x1b')],'include':_0x295475['include']?_[_0x5092('0x1e')](_0x295475['include'],function(_0x28a260){return{'model':db[_0x28a260[_0x5092('0x1f')]],'as':_0x28a260['as'],'attributes':_0x28a260['attributes'],'include':_0x28a260[_0x5092('0x1d')]?_[_0x5092('0x1e')](_0x28a260[_0x5092('0x1d')],function(_0x3d7486){return{'model':db[_0x3d7486[_0x5092('0x1f')]],'as':_0x3d7486['as'],'attributes':_0x3d7486['attributes']};}):[]};}):[]};}):[]:[]})[_0x5092('0x20')](function(_0xb43743){logger[_0x5092('0xd')](_0x5092('0x15'),_0x12e011);logger['debug']('GetDeskAccount',_0x12e011,JSON['stringify'](_0xb43743));_0x14860e(_0xb43743);})['catch'](function(_0x2e18f3){logger[_0x5092('0x11')](_0x5092('0x15'),_0x2e18f3[_0x5092('0x13')],_0x12e011);_0x3542ae(_0x50a4c4[_0x5092('0x11')](0x1f4,_0x2e18f3[_0x5092('0x13')]));});});};exports[_0x5092('0x21')]=function(_0x5bdda1){var _0x4a1444=this;return new Promise(function(_0x22bdf5,_0x186199){return db[_0x5092('0x16')][_0x5092('0x22')]({'raw':_0x5bdda1[_0x5092('0x19')]?_0x5bdda1[_0x5092('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x5bdda1[_0x5092('0x19')]?_0x5bdda1[_0x5092('0x19')][_0x5092('0x1a')]||null:null,'attributes':_0x5bdda1['options']?_0x5bdda1[_0x5092('0x19')]['attributes']||null:null,'include':_0x5bdda1[_0x5092('0x19')]?_0x5bdda1['options'][_0x5092('0x1d')]?_[_0x5092('0x1e')](_0x5bdda1[_0x5092('0x19')]['include'],function(_0x1516b2){return{'model':db[_0x1516b2['model']],'as':_0x1516b2['as'],'attributes':_0x1516b2['attributes'],'include':_0x1516b2[_0x5092('0x1d')]?_['map'](_0x1516b2['include'],function(_0x273705){return{'model':db[_0x273705['model']],'as':_0x273705['as'],'attributes':_0x273705[_0x5092('0x1b')],'include':_0x273705[_0x5092('0x1d')]?_[_0x5092('0x1e')](_0x273705[_0x5092('0x1d')],function(_0x1925de){return{'model':db[_0x1925de[_0x5092('0x1f')]],'as':_0x1925de['as'],'attributes':_0x1925de[_0x5092('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5092('0x20')](function(_0x1ab4eb){logger['info'](_0x5092('0x21'),_0x5bdda1);logger[_0x5092('0xf')]('ShowDeskAccount',_0x5bdda1,JSON[_0x5092('0x23')](_0x1ab4eb));_0x22bdf5(_0x1ab4eb);})[_0x5092('0x14')](function(_0x2d3d78){logger[_0x5092('0x11')](_0x5092('0x21'),_0x2d3d78[_0x5092('0x13')],_0x5bdda1);_0x186199(_0x4a1444[_0x5092('0x11')](0x1f4,_0x2d3d78[_0x5092('0x13')]));});});}; \ No newline at end of file +var _0x32bf=['findAll','options','raw','limit','include','model','attributes','map','stringify','ShowDeskAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetDeskAccount','DeskAccount'];(function(_0x57db49,_0x288094){var _0xd0636f=function(_0x227787){while(--_0x227787){_0x57db49['push'](_0x57db49['shift']());}};_0xd0636f(++_0x288094);}(_0x32bf,0x123));var _0xf32b=function(_0x243642,_0x2309cb){_0x243642=_0x243642-0x0;var _0x4e2de2=_0x32bf[_0x243642];return _0x4e2de2;};'use strict';var _=require('lodash');var util=require(_0xf32b('0x0'));var moment=require(_0xf32b('0x1'));var BPromise=require(_0xf32b('0x2'));var rs=require(_0xf32b('0x3'));var fs=require('fs');var Redis=require(_0xf32b('0x4'));var db=require(_0xf32b('0x5'))['db'];var utils=require(_0xf32b('0x6'));var logger=require('../../config/logger')(_0xf32b('0x7'));var config=require(_0xf32b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf32b('0x9')][_0xf32b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x281f6b,_0x43b081,_0x1ea218){return new BPromise(function(_0x58117e,_0x541758){return client[_0xf32b('0xb')](_0x281f6b,_0x1ea218)[_0xf32b('0xc')](function(_0x30f9ae){logger[_0xf32b('0xd')](_0xf32b('0xe'),_0x43b081,_0xf32b('0xf'));logger[_0xf32b('0x10')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x43b081,'request\x20sent',JSON['stringify'](_0x30f9ae));if(_0x30f9ae[_0xf32b('0x11')]){if(_0x30f9ae[_0xf32b('0x11')][_0xf32b('0x12')]===0x1f4){logger[_0xf32b('0x11')](_0xf32b('0xe'),_0x43b081,_0x30f9ae[_0xf32b('0x11')][_0xf32b('0x13')]);return _0x541758(_0x30f9ae[_0xf32b('0x11')][_0xf32b('0x13')]);}logger[_0xf32b('0x11')](_0xf32b('0xe'),_0x43b081,_0x30f9ae[_0xf32b('0x11')][_0xf32b('0x13')]);return _0x58117e(_0x30f9ae['error'][_0xf32b('0x13')]);}else{logger[_0xf32b('0xd')](_0xf32b('0xe'),_0x43b081,_0xf32b('0xf'));_0x58117e(_0x30f9ae[_0xf32b('0x14')]['message']);}})[_0xf32b('0x15')](function(_0x4f8b2f){logger['error'](_0xf32b('0xe'),_0x43b081,_0x4f8b2f);_0x541758(_0x4f8b2f);});});}exports[_0xf32b('0x16')]=function(_0x401bdb){var _0x31e713=this;return new Promise(function(_0x50b163,_0x1d7508){return db[_0xf32b('0x17')][_0xf32b('0x18')]({'raw':_0x401bdb['options']?_0x401bdb[_0xf32b('0x19')][_0xf32b('0x1a')]===undefined?!![]:![]:!![],'where':_0x401bdb[_0xf32b('0x19')]?_0x401bdb['options']['where']||null:null,'attributes':_0x401bdb[_0xf32b('0x19')]?_0x401bdb[_0xf32b('0x19')]['attributes']||null:null,'limit':_0x401bdb[_0xf32b('0x19')]?_0x401bdb[_0xf32b('0x19')][_0xf32b('0x1b')]||null:null,'include':_0x401bdb[_0xf32b('0x19')]?_0x401bdb['options']['include']?_['map'](_0x401bdb[_0xf32b('0x19')][_0xf32b('0x1c')],function(_0xceb581){return{'model':db[_0xceb581[_0xf32b('0x1d')]],'as':_0xceb581['as'],'attributes':_0xceb581[_0xf32b('0x1e')],'include':_0xceb581[_0xf32b('0x1c')]?_[_0xf32b('0x1f')](_0xceb581[_0xf32b('0x1c')],function(_0x2c87d2){return{'model':db[_0x2c87d2[_0xf32b('0x1d')]],'as':_0x2c87d2['as'],'attributes':_0x2c87d2[_0xf32b('0x1e')],'include':_0x2c87d2['include']?_['map'](_0x2c87d2[_0xf32b('0x1c')],function(_0x1e75e3){return{'model':db[_0x1e75e3['model']],'as':_0x1e75e3['as'],'attributes':_0x1e75e3['attributes']};}):[]};}):[]};}):[]:[]})[_0xf32b('0xc')](function(_0x4a9e86){logger['info'](_0xf32b('0x16'),_0x401bdb);logger[_0xf32b('0x10')](_0xf32b('0x16'),_0x401bdb,JSON[_0xf32b('0x20')](_0x4a9e86));_0x50b163(_0x4a9e86);})[_0xf32b('0x15')](function(_0x44a863){logger[_0xf32b('0x11')](_0xf32b('0x16'),_0x44a863[_0xf32b('0x13')],_0x401bdb);_0x1d7508(_0x31e713['error'](0x1f4,_0x44a863[_0xf32b('0x13')]));});});};exports[_0xf32b('0x21')]=function(_0x2f98cc){var _0x282afa=this;return new Promise(function(_0x386bc4,_0x242f81){return db[_0xf32b('0x17')][_0xf32b('0x22')]({'raw':_0x2f98cc['options']?_0x2f98cc[_0xf32b('0x19')][_0xf32b('0x1a')]===undefined?!![]:![]:!![],'where':_0x2f98cc[_0xf32b('0x19')]?_0x2f98cc[_0xf32b('0x19')]['where']||null:null,'attributes':_0x2f98cc['options']?_0x2f98cc['options'][_0xf32b('0x1e')]||null:null,'include':_0x2f98cc['options']?_0x2f98cc[_0xf32b('0x19')][_0xf32b('0x1c')]?_[_0xf32b('0x1f')](_0x2f98cc['options'][_0xf32b('0x1c')],function(_0x3b4631){return{'model':db[_0x3b4631['model']],'as':_0x3b4631['as'],'attributes':_0x3b4631[_0xf32b('0x1e')],'include':_0x3b4631[_0xf32b('0x1c')]?_[_0xf32b('0x1f')](_0x3b4631[_0xf32b('0x1c')],function(_0x54e207){return{'model':db[_0x54e207['model']],'as':_0x54e207['as'],'attributes':_0x54e207[_0xf32b('0x1e')],'include':_0x54e207['include']?_['map'](_0x54e207[_0xf32b('0x1c')],function(_0x4f2257){return{'model':db[_0x4f2257['model']],'as':_0x4f2257['as'],'attributes':_0x4f2257[_0xf32b('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x128d15){logger[_0xf32b('0xd')](_0xf32b('0x21'),_0x2f98cc);logger[_0xf32b('0x10')]('ShowDeskAccount',_0x2f98cc,JSON[_0xf32b('0x20')](_0x128d15));_0x386bc4(_0x128d15);})[_0xf32b('0x15')](function(_0x2fe0a3){logger[_0xf32b('0x11')](_0xf32b('0x21'),_0x2fe0a3[_0xf32b('0x13')],_0x2f98cc);_0x242f81(_0x282afa[_0xf32b('0x11')](0x1f4,_0x2fe0a3[_0xf32b('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 9f9913c..b7c00a9 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 _0x3cb7=['/:id','show','getFields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','create','post','setTags','put','update','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated'];(function(_0x5de1bc,_0x434be1){var _0x19f4b8=function(_0x35f764){while(--_0x35f764){_0x5de1bc['push'](_0x5de1bc['shift']());}};_0x19f4b8(++_0x434be1);}(_0x3cb7,0xcf));var _0x73cb=function(_0x1f23b1,_0x57c83f){_0x1f23b1=_0x1f23b1-0x0;var _0x3c9197=_0x3cb7[_0x1f23b1];return _0x3c9197;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x73cb('0x0'));var timeout=require('connect-timeout');var express=require(_0x73cb('0x1'));var router=express[_0x73cb('0x2')]();var auth=require(_0x73cb('0x3'));var interaction=require(_0x73cb('0x4'));var config=require(_0x73cb('0x5'));var controller=require(_0x73cb('0x6'));router[_0x73cb('0x7')]('/',auth[_0x73cb('0x8')](),controller['index']);router[_0x73cb('0x7')](_0x73cb('0x9'),auth[_0x73cb('0x8')](),controller[_0x73cb('0xa')]);router[_0x73cb('0x7')]('/:id/fields',auth[_0x73cb('0x8')](),controller[_0x73cb('0xb')]);router[_0x73cb('0x7')](_0x73cb('0xc'),auth[_0x73cb('0x8')](),controller[_0x73cb('0xd')]);router[_0x73cb('0x7')]('/:id/descriptions',auth[_0x73cb('0x8')](),controller[_0x73cb('0xe')]);router[_0x73cb('0x7')](_0x73cb('0xf'),auth[_0x73cb('0x8')](),controller[_0x73cb('0x10')]);router['post']('/',auth[_0x73cb('0x8')](),controller[_0x73cb('0x11')]);router[_0x73cb('0x12')](_0x73cb('0xf'),auth[_0x73cb('0x8')](),controller[_0x73cb('0x13')]);router[_0x73cb('0x14')](_0x73cb('0x9'),auth[_0x73cb('0x8')](),controller[_0x73cb('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x73cb('0x16')]);module[_0x73cb('0x17')]=router; \ No newline at end of file +var _0x553a=['update','destroy','util','connect-timeout','express','Router','../../config/environment','isAuthenticated','/:id','show','/:id/fields','getFields','get','/:id/subjects','getDescriptions','getTags','post','create','/:id/tags','put'];(function(_0x129514,_0x554582){var _0x5c15af=function(_0xa2580b){while(--_0xa2580b){_0x129514['push'](_0x129514['shift']());}};_0x5c15af(++_0x554582);}(_0x553a,0x192));var _0xa553=function(_0x3eef60,_0x9eb279){_0x3eef60=_0x3eef60-0x0;var _0x569efe=_0x553a[_0x3eef60];return _0x569efe;};'use strict';var multer=require('multer');var util=require(_0xa553('0x0'));var path=require('path');var timeout=require(_0xa553('0x1'));var express=require(_0xa553('0x2'));var router=express[_0xa553('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa553('0x4'));var controller=require('./intDeskConfiguration.controller');router['get']('/',auth[_0xa553('0x5')](),controller['index']);router['get'](_0xa553('0x6'),auth[_0xa553('0x5')](),controller[_0xa553('0x7')]);router['get'](_0xa553('0x8'),auth['isAuthenticated'](),controller[_0xa553('0x9')]);router[_0xa553('0xa')](_0xa553('0xb'),auth['isAuthenticated'](),controller['getSubjects']);router[_0xa553('0xa')]('/:id/descriptions',auth[_0xa553('0x5')](),controller[_0xa553('0xc')]);router[_0xa553('0xa')]('/:id/tags',auth[_0xa553('0x5')](),controller[_0xa553('0xd')]);router[_0xa553('0xe')]('/',auth['isAuthenticated'](),controller[_0xa553('0xf')]);router[_0xa553('0xe')](_0xa553('0x10'),auth['isAuthenticated'](),controller['setTags']);router[_0xa553('0x11')](_0xa553('0x6'),auth[_0xa553('0x5')](),controller[_0xa553('0x12')]);router['delete'](_0xa553('0x6'),auth['isAuthenticated'](),controller[_0xa553('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 4ac06f5..9cd2230 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 _0x2a6e=['STRING','exports'];(function(_0x5be2e2,_0x324001){var _0x310577=function(_0x1f831e){while(--_0x1f831e){_0x5be2e2['push'](_0x5be2e2['shift']());}};_0x310577(++_0x324001);}(_0x2a6e,0x97));var _0xe2a6=function(_0xddc336,_0x216777){_0xddc336=_0xddc336-0x0;var _0x25e722=_0x2a6e[_0xddc336];return _0x25e722;};'use strict';var Sequelize=require('sequelize');module[_0xe2a6('0x0')]={'name':{'type':Sequelize[_0xe2a6('0x1')]},'description':{'type':Sequelize[_0xe2a6('0x1')]}}; \ No newline at end of file +var _0x63ba=['STRING','sequelize'];(function(_0x119c85,_0x268175){var _0x41d288=function(_0x52c0b2){while(--_0x52c0b2){_0x119c85['push'](_0x119c85['shift']());}};_0x41d288(++_0x268175);}(_0x63ba,0x1eb));var _0xa63b=function(_0x17acf0,_0x16c10a){_0x17acf0=_0x17acf0-0x0;var _0xcdfb88=_0x63ba[_0x17acf0];return _0xcdfb88;};'use strict';var Sequelize=require(_0xa63b('0x0'));module['exports']={'name':{'type':Sequelize[_0xa63b('0x1')]},'description':{'type':Sequelize[_0xa63b('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 29015f2..efd13b7 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 _0x4a21=['DeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','stack','name','send','index','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','filter','merge','VIRTUAL','includeAll','include','show','options','find','create','body','params','getFields','findOne','DeskField','order','pick','getSubjects','hasOwnProperty','getDescriptions','nolimit','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xd2f10,_0x789f02){var _0x3fc5e1=function(_0x3bdd4d){while(--_0x3bdd4d){_0xd2f10['push'](_0xd2f10['shift']());}};_0x3fc5e1(++_0x789f02);}(_0x4a21,0x1c2));var _0x14a2=function(_0x329808,_0x343255){_0x329808=_0x329808-0x0;var _0x1bbad0=_0x4a21[_0x329808];return _0x1bbad0;};'use strict';var pdf=require(_0x14a2('0x0'));var emlformat=require(_0x14a2('0x1'));var rimraf=require(_0x14a2('0x2'));var zipdir=require(_0x14a2('0x3'));var jsonpatch=require(_0x14a2('0x4'));var rp=require(_0x14a2('0x5'));var moment=require(_0x14a2('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x14a2('0x7'));var util=require('util');var path=require('path');var sox=require(_0x14a2('0x8'));var csv=require(_0x14a2('0x9'));var ejs=require(_0x14a2('0xa'));var fs=require('fs');var _=require(_0x14a2('0xb'));var squel=require(_0x14a2('0xc'));var crypto=require(_0x14a2('0xd'));var jsforce=require(_0x14a2('0xe'));var deskjs=require(_0x14a2('0xf'));var toCsv=require(_0x14a2('0x9'));var querystring=require('querystring');var Papa=require(_0x14a2('0x10'));var Redis=require(_0x14a2('0x11'));var authService=require(_0x14a2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x14a2('0x13'));var hardwareService=require(_0x14a2('0x14'));var logger=require('../../config/logger')(_0x14a2('0x15'));var utils=require(_0x14a2('0x16'));var config=require(_0x14a2('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x14a2('0x18'));var client=jayson[_0x14a2('0x19')][_0x14a2('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x496e2c,_0x3fdb1a,_0x2dbfce){if(_0x2dbfce){var _0x95d51b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x95d51b[_0x14a2('0x1b')](_0x3fdb1a)){return _0x496e2c;}else{throw new db[(_0x14a2('0x1c'))]['ValidationError'](_0x14a2('0x1d'));}}else{return _0x496e2c;}}function respondWithRpcPromise(_0x1b2f43,_0x28c666,_0x4f3f07,_0x1f4e04){return new BPromise(function(_0x5bbbcf,_0x19fc3d){var _0x44259a=_0x1f4e04||client;return _0x44259a[_0x14a2('0x1e')](_0x1b2f43,_0x4f3f07)[_0x14a2('0x1f')](function(_0x57ee04){logger['info'](_0x14a2('0x20'),_0x28c666,_0x14a2('0x21'));logger[_0x14a2('0x22')](_0x14a2('0x23'),_0x28c666,_0x14a2('0x21'),JSON['stringify'](_0x57ee04));if(_0x57ee04['error']){if(_0x57ee04['error'][_0x14a2('0x24')]===0x1f4){logger[_0x14a2('0x25')](_0x14a2('0x20'),_0x28c666,_0x57ee04[_0x14a2('0x25')]['message']);return _0x19fc3d(_0x57ee04[_0x14a2('0x25')][_0x14a2('0x26')]);}logger[_0x14a2('0x25')](_0x14a2('0x20'),_0x28c666,_0x57ee04['error'][_0x14a2('0x26')]);return _0x5bbbcf(_0x57ee04[_0x14a2('0x25')][_0x14a2('0x26')]);}else{logger[_0x14a2('0x27')](_0x14a2('0x20'),_0x28c666,'request\x20sent');_0x5bbbcf(_0x57ee04[_0x14a2('0x28')][_0x14a2('0x26')]);}})[_0x14a2('0x29')](function(_0x52e2a0){logger[_0x14a2('0x25')]('DeskConfiguration,\x20%s,\x20%s',_0x28c666,_0x52e2a0);_0x19fc3d(_0x52e2a0);});});}function respondWithStatusCode(_0x4b6554,_0x14cffd){_0x14cffd=_0x14cffd||0xcc;return function(_0x1bc2f3){if(_0x1bc2f3){return _0x4b6554[_0x14a2('0x2a')](_0x14cffd);}return _0x4b6554[_0x14a2('0x2b')](_0x14cffd)[_0x14a2('0x2c')]();};}function respondWithResult(_0x23ef8a,_0x13d3b8){_0x13d3b8=_0x13d3b8||0xc8;return function(_0x400274){if(_0x400274){return _0x23ef8a[_0x14a2('0x2b')](_0x13d3b8)[_0x14a2('0x2d')](_0x400274);}};}function respondWithFilteredResult(_0x1cde99,_0x5a3582){return function(_0x5385d3){if(_0x5385d3){var _0x2b068d=_0x5385d3[_0x14a2('0x2e')],_0x28f31e=_0x5a3582[_0x14a2('0x2f')],_0x2c5235=_0x5a3582[_0x14a2('0x2f')]+_0x5a3582[_0x14a2('0x30')],_0x115d21;if(_0x2c5235>=_0x2b068d){_0x2c5235=_0x2b068d;_0x115d21=0xc8;}else{_0x115d21=0xce;}_0x1cde99[_0x14a2('0x2b')](_0x115d21);return _0x1cde99[_0x14a2('0x31')](_0x14a2('0x32'),_0x28f31e+'-'+_0x2c5235+'/'+_0x2b068d)[_0x14a2('0x2d')](_0x5385d3);}return null;};}function patchUpdates(_0x21b65d){return function(_0x1b7204){try{jsonpatch['apply'](_0x1b7204,_0x21b65d,!![]);}catch(_0xc7a481){return BPromise[_0x14a2('0x33')](_0xc7a481);}return _0x1b7204[_0x14a2('0x34')]();};}function saveUpdates(_0x4bc19e,_0x14ab52){return function(_0x3f5ffd){if(_0x3f5ffd){return _0x3f5ffd['update'](_0x4bc19e)['then'](function(_0x5e8e5f){return _0x5e8e5f;});}return null;};}function removeEntity(_0x315285,_0x51bbe6){return function(_0x3513eb){if(_0x3513eb){return _0x3513eb[_0x14a2('0x35')]()['then'](function(){_0x315285[_0x14a2('0x2b')](0xcc)[_0x14a2('0x2c')]();});}};}function handleEntityNotFound(_0x55a1f2,_0x2e0e9f){return function(_0xd28422){if(!_0xd28422){_0x55a1f2[_0x14a2('0x2a')](0x194);}return _0xd28422;};}function handleError(_0x1756da,_0x2ca618){_0x2ca618=_0x2ca618||0x1f4;return function(_0x552d46){logger[_0x14a2('0x25')](_0x552d46[_0x14a2('0x36')]);if(_0x552d46[_0x14a2('0x37')]){delete _0x552d46[_0x14a2('0x37')];}_0x1756da[_0x14a2('0x2b')](_0x2ca618)[_0x14a2('0x38')](_0x552d46);};}exports[_0x14a2('0x39')]=function(_0x178681,_0x42eb93){var _0x1ffc58={},_0x1cd699={},_0x2c20d9={'count':0x0,'rows':[]};var _0x23adbc=_[_0x14a2('0x3a')](db[_0x14a2('0x3b')][_0x14a2('0x3c')],function(_0x9be2b0){return{'name':_0x9be2b0[_0x14a2('0x3d')],'type':_0x9be2b0[_0x14a2('0x3e')][_0x14a2('0x3f')]};});_0x1cd699[_0x14a2('0x40')]=_[_0x14a2('0x3a')](_0x23adbc,'name');_0x1cd699[_0x14a2('0x41')]=_[_0x14a2('0x42')](_0x178681[_0x14a2('0x41')]);_0x1cd699[_0x14a2('0x43')]=_[_0x14a2('0x44')](_0x1cd699[_0x14a2('0x40')],_0x1cd699[_0x14a2('0x41')]);_0x1ffc58[_0x14a2('0x45')]=_[_0x14a2('0x44')](_0x1cd699[_0x14a2('0x40')],qs[_0x14a2('0x46')](_0x178681['query'][_0x14a2('0x46')]));_0x1ffc58[_0x14a2('0x45')]=_0x1ffc58[_0x14a2('0x45')][_0x14a2('0x47')]?_0x1ffc58[_0x14a2('0x45')]:_0x1cd699['model'];if(!_0x178681[_0x14a2('0x41')]['hasOwnProperty']('nolimit')){_0x1ffc58[_0x14a2('0x30')]=qs[_0x14a2('0x30')](_0x178681[_0x14a2('0x41')][_0x14a2('0x30')]);_0x1ffc58['offset']=qs[_0x14a2('0x2f')](_0x178681[_0x14a2('0x41')][_0x14a2('0x2f')]);}_0x1ffc58['order']=qs['sort'](_0x178681[_0x14a2('0x41')][_0x14a2('0x48')]);_0x1ffc58[_0x14a2('0x49')]=qs[_0x14a2('0x43')](_['pick'](_0x178681['query'],_0x1cd699[_0x14a2('0x43')]));if(_0x178681[_0x14a2('0x41')][_0x14a2('0x4a')]){_0x1ffc58['where']=_[_0x14a2('0x4b')](_0x1ffc58[_0x14a2('0x49')],{'$or':_[_0x14a2('0x3a')](_0x23adbc,function(_0x3c4ec3){if(_0x3c4ec3['type']!==_0x14a2('0x4c')){var _0x2e2dfd={};_0x2e2dfd[_0x3c4ec3[_0x14a2('0x37')]]={'$like':'%'+_0x178681[_0x14a2('0x41')]['filter']+'%'};return _0x2e2dfd;}})});}_0x1ffc58=_[_0x14a2('0x4b')]({},_0x1ffc58,_0x178681['options']);var _0x203c17={'where':_0x1ffc58['where']};return db['DeskConfiguration'][_0x14a2('0x2e')](_0x203c17)['then'](function(_0x8932a0){_0x2c20d9[_0x14a2('0x2e')]=_0x8932a0;if(_0x178681[_0x14a2('0x41')][_0x14a2('0x4d')]){_0x1ffc58[_0x14a2('0x4e')]=[{'all':!![]}];}return db[_0x14a2('0x3b')]['findAll'](_0x1ffc58);})[_0x14a2('0x1f')](function(_0x5773d7){_0x2c20d9['rows']=_0x5773d7;return _0x2c20d9;})[_0x14a2('0x1f')](respondWithFilteredResult(_0x42eb93,_0x1ffc58))[_0x14a2('0x29')](handleError(_0x42eb93,null));};exports[_0x14a2('0x4f')]=function(_0x4ce22a,_0x450d92){var _0x2e79ca={'raw':![],'where':{'id':_0x4ce22a['params']['id']}},_0x45a38b={};_0x45a38b[_0x14a2('0x40')]=_[_0x14a2('0x42')](db[_0x14a2('0x3b')][_0x14a2('0x3c')]);_0x45a38b[_0x14a2('0x41')]=_['keys'](_0x4ce22a[_0x14a2('0x41')]);_0x45a38b[_0x14a2('0x43')]=_[_0x14a2('0x44')](_0x45a38b[_0x14a2('0x40')],_0x45a38b[_0x14a2('0x41')]);_0x2e79ca[_0x14a2('0x45')]=_[_0x14a2('0x44')](_0x45a38b[_0x14a2('0x40')],qs[_0x14a2('0x46')](_0x4ce22a[_0x14a2('0x41')][_0x14a2('0x46')]));_0x2e79ca['attributes']=_0x2e79ca[_0x14a2('0x45')][_0x14a2('0x47')]?_0x2e79ca['attributes']:_0x45a38b['model'];if(_0x4ce22a['query']['includeAll']){_0x2e79ca[_0x14a2('0x4e')]=[{'all':!![]}];}_0x2e79ca=_[_0x14a2('0x4b')]({},_0x2e79ca,_0x4ce22a[_0x14a2('0x50')]);return db['DeskConfiguration'][_0x14a2('0x51')](_0x2e79ca)[_0x14a2('0x1f')](handleEntityNotFound(_0x450d92,null))[_0x14a2('0x1f')](respondWithResult(_0x450d92,null))[_0x14a2('0x29')](handleError(_0x450d92,null));};exports[_0x14a2('0x52')]=function(_0x32bc6b,_0x225849){return db[_0x14a2('0x3b')][_0x14a2('0x52')](_0x32bc6b['body'],{})['then'](respondWithResult(_0x225849,0xc9))['catch'](handleError(_0x225849,null));};exports['update']=function(_0x15034e,_0x1b9c76){if(_0x15034e[_0x14a2('0x53')]['id']){delete _0x15034e[_0x14a2('0x53')]['id'];}return db['DeskConfiguration'][_0x14a2('0x51')]({'where':{'id':_0x15034e[_0x14a2('0x54')]['id']}})[_0x14a2('0x1f')](handleEntityNotFound(_0x1b9c76,null))[_0x14a2('0x1f')](saveUpdates(_0x15034e[_0x14a2('0x53')],null))[_0x14a2('0x1f')](respondWithResult(_0x1b9c76,null))[_0x14a2('0x29')](handleError(_0x1b9c76,null));};exports[_0x14a2('0x35')]=function(_0x169fc3,_0x41c5c5){return db[_0x14a2('0x3b')][_0x14a2('0x51')]({'where':{'id':_0x169fc3['params']['id']}})[_0x14a2('0x1f')](handleEntityNotFound(_0x41c5c5,null))[_0x14a2('0x1f')](removeEntity(_0x41c5c5,null))['catch'](handleError(_0x41c5c5,null));};exports[_0x14a2('0x55')]=function(_0x1c731c,_0x23b3f2,_0x216ad2){var _0x27bbbd={};var _0x34a715={};var _0x35c1d1;var _0x1dec15;return db['DeskConfiguration'][_0x14a2('0x56')]({'where':{'id':_0x1c731c[_0x14a2('0x54')]['id']}})[_0x14a2('0x1f')](handleEntityNotFound(_0x23b3f2,null))[_0x14a2('0x1f')](function(_0x3687d5){if(_0x3687d5){_0x35c1d1=_0x3687d5;_0x34a715[_0x14a2('0x40')]=_['keys'](db[_0x14a2('0x57')]['rawAttributes']);_0x34a715[_0x14a2('0x41')]=_[_0x14a2('0x42')](_0x1c731c[_0x14a2('0x41')]);_0x34a715['filters']=_[_0x14a2('0x44')](_0x34a715[_0x14a2('0x40')],_0x34a715[_0x14a2('0x41')]);_0x27bbbd[_0x14a2('0x45')]=_[_0x14a2('0x44')](_0x34a715[_0x14a2('0x40')],qs[_0x14a2('0x46')](_0x1c731c[_0x14a2('0x41')][_0x14a2('0x46')]));_0x27bbbd[_0x14a2('0x45')]=_0x27bbbd[_0x14a2('0x45')][_0x14a2('0x47')]?_0x27bbbd[_0x14a2('0x45')]:_0x34a715[_0x14a2('0x40')];_0x27bbbd[_0x14a2('0x58')]=qs[_0x14a2('0x48')](_0x1c731c[_0x14a2('0x41')][_0x14a2('0x48')]);_0x27bbbd[_0x14a2('0x49')]=qs[_0x14a2('0x43')](_[_0x14a2('0x59')](_0x1c731c[_0x14a2('0x41')],_0x34a715[_0x14a2('0x43')]));if(_0x1c731c[_0x14a2('0x41')][_0x14a2('0x4a')]){_0x27bbbd[_0x14a2('0x49')]=_['merge'](_0x27bbbd[_0x14a2('0x49')],{'$or':_[_0x14a2('0x3a')](_0x27bbbd[_0x14a2('0x45')],function(_0x380161){var _0x414828={};_0x414828[_0x380161]={'$like':'%'+_0x1c731c[_0x14a2('0x41')][_0x14a2('0x4a')]+'%'};return _0x414828;})});}_0x27bbbd=_[_0x14a2('0x4b')]({},_0x27bbbd,_0x1c731c[_0x14a2('0x50')]);return _0x35c1d1[_0x14a2('0x55')](_0x27bbbd);}})['then'](function(_0x250622){if(_0x250622){_0x1dec15=_0x250622[_0x14a2('0x47')];if(!_0x1c731c[_0x14a2('0x41')]['hasOwnProperty']('nolimit')){_0x27bbbd[_0x14a2('0x30')]=qs[_0x14a2('0x30')](_0x1c731c[_0x14a2('0x41')]['limit']);_0x27bbbd[_0x14a2('0x2f')]=qs[_0x14a2('0x2f')](_0x1c731c[_0x14a2('0x41')][_0x14a2('0x2f')]);}return _0x35c1d1[_0x14a2('0x55')](_0x27bbbd);}})[_0x14a2('0x1f')](function(_0x152f4d){if(_0x152f4d){return _0x152f4d?{'count':_0x1dec15,'rows':_0x152f4d}:null;}})['then'](respondWithResult(_0x23b3f2,null))[_0x14a2('0x29')](handleError(_0x23b3f2,null));};exports[_0x14a2('0x5a')]=function(_0x3ab914,_0x58bd6f,_0x1f51b7){var _0x3fab0c={};var _0x1ac4dc={};var _0x500828;var _0xe830e8;return db[_0x14a2('0x3b')]['findOne']({'where':{'id':_0x3ab914['params']['id']}})['then'](handleEntityNotFound(_0x58bd6f,null))['then'](function(_0x4481d9){if(_0x4481d9){_0x500828=_0x4481d9;_0x1ac4dc['model']=_[_0x14a2('0x42')](db[_0x14a2('0x57')][_0x14a2('0x3c')]);_0x1ac4dc[_0x14a2('0x41')]=_[_0x14a2('0x42')](_0x3ab914['query']);_0x1ac4dc[_0x14a2('0x43')]=_[_0x14a2('0x44')](_0x1ac4dc['model'],_0x1ac4dc['query']);_0x3fab0c[_0x14a2('0x45')]=_[_0x14a2('0x44')](_0x1ac4dc[_0x14a2('0x40')],qs[_0x14a2('0x46')](_0x3ab914[_0x14a2('0x41')][_0x14a2('0x46')]));_0x3fab0c[_0x14a2('0x45')]=_0x3fab0c['attributes'][_0x14a2('0x47')]?_0x3fab0c[_0x14a2('0x45')]:_0x1ac4dc['model'];_0x3fab0c['order']=qs[_0x14a2('0x48')](_0x3ab914[_0x14a2('0x41')][_0x14a2('0x48')]);_0x3fab0c['where']=qs[_0x14a2('0x43')](_['pick'](_0x3ab914[_0x14a2('0x41')],_0x1ac4dc[_0x14a2('0x43')]));if(_0x3ab914[_0x14a2('0x41')][_0x14a2('0x4a')]){_0x3fab0c[_0x14a2('0x49')]=_[_0x14a2('0x4b')](_0x3fab0c[_0x14a2('0x49')],{'$or':_['map'](_0x3fab0c[_0x14a2('0x45')],function(_0x22c7e3){var _0x11a301={};_0x11a301[_0x22c7e3]={'$like':'%'+_0x3ab914[_0x14a2('0x41')][_0x14a2('0x4a')]+'%'};return _0x11a301;})});}_0x3fab0c=_['merge']({},_0x3fab0c,_0x3ab914[_0x14a2('0x50')]);return _0x500828[_0x14a2('0x5a')](_0x3fab0c);}})[_0x14a2('0x1f')](function(_0x49ed7c){if(_0x49ed7c){_0xe830e8=_0x49ed7c[_0x14a2('0x47')];if(!_0x3ab914[_0x14a2('0x41')][_0x14a2('0x5b')]('nolimit')){_0x3fab0c['limit']=qs[_0x14a2('0x30')](_0x3ab914[_0x14a2('0x41')]['limit']);_0x3fab0c[_0x14a2('0x2f')]=qs['offset'](_0x3ab914[_0x14a2('0x41')][_0x14a2('0x2f')]);}return _0x500828['getSubjects'](_0x3fab0c);}})[_0x14a2('0x1f')](function(_0x3c98c7){if(_0x3c98c7){return _0x3c98c7?{'count':_0xe830e8,'rows':_0x3c98c7}:null;}})[_0x14a2('0x1f')](respondWithResult(_0x58bd6f,null))[_0x14a2('0x29')](handleError(_0x58bd6f,null));};exports[_0x14a2('0x5c')]=function(_0x51a0f3,_0x6cc4e0,_0x3bc2c7){var _0x3637a5={};var _0x3dc77b={};var _0x39f970;var _0x454da5;return db[_0x14a2('0x3b')][_0x14a2('0x56')]({'where':{'id':_0x51a0f3[_0x14a2('0x54')]['id']}})[_0x14a2('0x1f')](handleEntityNotFound(_0x6cc4e0,null))[_0x14a2('0x1f')](function(_0x50bdca){if(_0x50bdca){_0x39f970=_0x50bdca;_0x3dc77b[_0x14a2('0x40')]=_[_0x14a2('0x42')](db[_0x14a2('0x57')]['rawAttributes']);_0x3dc77b[_0x14a2('0x41')]=_[_0x14a2('0x42')](_0x51a0f3[_0x14a2('0x41')]);_0x3dc77b[_0x14a2('0x43')]=_[_0x14a2('0x44')](_0x3dc77b[_0x14a2('0x40')],_0x3dc77b[_0x14a2('0x41')]);_0x3637a5[_0x14a2('0x45')]=_[_0x14a2('0x44')](_0x3dc77b[_0x14a2('0x40')],qs[_0x14a2('0x46')](_0x51a0f3[_0x14a2('0x41')][_0x14a2('0x46')]));_0x3637a5['attributes']=_0x3637a5[_0x14a2('0x45')][_0x14a2('0x47')]?_0x3637a5[_0x14a2('0x45')]:_0x3dc77b[_0x14a2('0x40')];_0x3637a5[_0x14a2('0x58')]=qs[_0x14a2('0x48')](_0x51a0f3[_0x14a2('0x41')][_0x14a2('0x48')]);_0x3637a5[_0x14a2('0x49')]=qs[_0x14a2('0x43')](_[_0x14a2('0x59')](_0x51a0f3[_0x14a2('0x41')],_0x3dc77b[_0x14a2('0x43')]));if(_0x51a0f3[_0x14a2('0x41')][_0x14a2('0x4a')]){_0x3637a5['where']=_['merge'](_0x3637a5[_0x14a2('0x49')],{'$or':_[_0x14a2('0x3a')](_0x3637a5[_0x14a2('0x45')],function(_0x153128){var _0xc78522={};_0xc78522[_0x153128]={'$like':'%'+_0x51a0f3[_0x14a2('0x41')]['filter']+'%'};return _0xc78522;})});}_0x3637a5=_['merge']({},_0x3637a5,_0x51a0f3[_0x14a2('0x50')]);return _0x39f970['getDescriptions'](_0x3637a5);}})[_0x14a2('0x1f')](function(_0x2a8b87){if(_0x2a8b87){_0x454da5=_0x2a8b87[_0x14a2('0x47')];if(!_0x51a0f3['query']['hasOwnProperty'](_0x14a2('0x5d'))){_0x3637a5['limit']=qs[_0x14a2('0x30')](_0x51a0f3[_0x14a2('0x41')][_0x14a2('0x30')]);_0x3637a5['offset']=qs['offset'](_0x51a0f3[_0x14a2('0x41')][_0x14a2('0x2f')]);}return _0x39f970[_0x14a2('0x5c')](_0x3637a5);}})['then'](function(_0xa41034){if(_0xa41034){return _0xa41034?{'count':_0x454da5,'rows':_0xa41034}:null;}})[_0x14a2('0x1f')](respondWithResult(_0x6cc4e0,null))[_0x14a2('0x29')](handleError(_0x6cc4e0,null));};exports[_0x14a2('0x5e')]=function(_0x278173,_0x480d1c,_0x350efb){var _0x392da9={};var _0x5b08aa={};var _0x7a28ab;var _0x5ed42b;return db[_0x14a2('0x3b')][_0x14a2('0x56')]({'where':{'id':_0x278173[_0x14a2('0x54')]['id']}})[_0x14a2('0x1f')](handleEntityNotFound(_0x480d1c,null))[_0x14a2('0x1f')](function(_0x3e1c3d){if(_0x3e1c3d){_0x7a28ab=_0x3e1c3d;_0x5b08aa[_0x14a2('0x40')]=_[_0x14a2('0x42')](db[_0x14a2('0x5f')][_0x14a2('0x3c')]);_0x5b08aa[_0x14a2('0x41')]=_['keys'](_0x278173[_0x14a2('0x41')]);_0x5b08aa[_0x14a2('0x43')]=_[_0x14a2('0x44')](_0x5b08aa[_0x14a2('0x40')],_0x5b08aa['query']);_0x392da9[_0x14a2('0x45')]=_[_0x14a2('0x44')](_0x5b08aa[_0x14a2('0x40')],qs[_0x14a2('0x46')](_0x278173[_0x14a2('0x41')][_0x14a2('0x46')]));_0x392da9[_0x14a2('0x45')]=_0x392da9[_0x14a2('0x45')][_0x14a2('0x47')]?_0x392da9['attributes']:_0x5b08aa[_0x14a2('0x40')];_0x392da9[_0x14a2('0x58')]=qs[_0x14a2('0x48')](_0x278173[_0x14a2('0x41')][_0x14a2('0x48')]);_0x392da9['where']=qs[_0x14a2('0x43')](_[_0x14a2('0x59')](_0x278173[_0x14a2('0x41')],_0x5b08aa[_0x14a2('0x43')]));if(_0x278173[_0x14a2('0x41')][_0x14a2('0x4a')]){_0x392da9['where']=_[_0x14a2('0x4b')](_0x392da9[_0x14a2('0x49')],{'$or':_[_0x14a2('0x3a')](_0x392da9['attributes'],function(_0x92ec9b){var _0x5a4424={};_0x5a4424[_0x92ec9b]={'$like':'%'+_0x278173['query'][_0x14a2('0x4a')]+'%'};return _0x5a4424;})});}_0x392da9=_[_0x14a2('0x4b')]({},_0x392da9,_0x278173['options']);return _0x7a28ab[_0x14a2('0x5e')](_0x392da9);}})[_0x14a2('0x1f')](function(_0x51e7ce){if(_0x51e7ce){_0x5ed42b=_0x51e7ce['length'];if(!_0x278173[_0x14a2('0x41')]['hasOwnProperty'](_0x14a2('0x5d'))){_0x392da9[_0x14a2('0x30')]=qs[_0x14a2('0x30')](_0x278173[_0x14a2('0x41')][_0x14a2('0x30')]);_0x392da9[_0x14a2('0x2f')]=qs[_0x14a2('0x2f')](_0x278173[_0x14a2('0x41')]['offset']);}return _0x7a28ab[_0x14a2('0x5e')](_0x392da9);}})[_0x14a2('0x1f')](function(_0x21793e){if(_0x21793e){return _0x21793e?{'count':_0x5ed42b,'rows':_0x21793e}:null;}})[_0x14a2('0x1f')](respondWithResult(_0x480d1c,null))[_0x14a2('0x29')](handleError(_0x480d1c,null));};exports['setTags']=function(_0x23f8b4,_0xf67599,_0x58e555){if(_0x23f8b4['body']['id']){delete _0x23f8b4['body']['id'];}return db[_0x14a2('0x3b')][_0x14a2('0x56')]({'where':{'id':_0x23f8b4['params']['id']}})[_0x14a2('0x1f')](handleEntityNotFound(_0xf67599,null))[_0x14a2('0x1f')](function(_0x1843d4){if(_0x1843d4){return _0x1843d4[_0x14a2('0x60')](_0x23f8b4[_0x14a2('0x53')]['ids']||[]);}return null;})[_0x14a2('0x1f')](respondWithResult(_0xf67599,null))[_0x14a2('0x29')](handleError(_0xf67599,null));}; \ No newline at end of file +var _0x4940=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','json','count','offset','limit','set','Content-Range','reject','update','destroy','status','end','stack','name','fieldName','key','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','includeAll','include','DeskConfiguration','findAll','rows','show','rawAttributes','length','find','create','body','params','findOne','DeskField','order','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','papaparse'];(function(_0xd5160a,_0x572c4b){var _0x576cf9=function(_0xa95da6){while(--_0xa95da6){_0xd5160a['push'](_0xd5160a['shift']());}};_0x576cf9(++_0x572c4b);}(_0x4940,0x1da));var _0x0494=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4940[_0x167cc1];return _0x10bc4b;};'use strict';var pdf=require(_0x0494('0x0'));var emlformat=require(_0x0494('0x1'));var rimraf=require(_0x0494('0x2'));var zipdir=require(_0x0494('0x3'));var jsonpatch=require(_0x0494('0x4'));var rp=require('request-promise');var moment=require(_0x0494('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0494('0x6'));var util=require(_0x0494('0x7'));var path=require(_0x0494('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0494('0x9'));var fs=require('fs');var _=require(_0x0494('0xa'));var squel=require('squel');var crypto=require(_0x0494('0xb'));var jsforce=require(_0x0494('0xc'));var deskjs=require(_0x0494('0xd'));var toCsv=require(_0x0494('0xe'));var querystring=require('querystring');var Papa=require(_0x0494('0xf'));var Redis=require(_0x0494('0x10'));var authService=require(_0x0494('0x11'));var qs=require(_0x0494('0x12'));var as=require(_0x0494('0x13'));var hardwareService=require(_0x0494('0x14'));var logger=require(_0x0494('0x15'))(_0x0494('0x16'));var utils=require('../../config/utils');var config=require(_0x0494('0x17'));var db=require(_0x0494('0x18'))['db'];var jayson=require(_0x0494('0x19'));var client=jayson[_0x0494('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x2c1dcb,_0x4c2bc3,_0x4bef37){if(_0x4bef37){var _0x422aa3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x422aa3['test'](_0x4c2bc3)){return _0x2c1dcb;}else{throw new db[(_0x0494('0x1b'))][(_0x0494('0x1c'))](_0x0494('0x1d'));}}else{return _0x2c1dcb;}}function respondWithRpcPromise(_0x5cfe55,_0x104a4c,_0x230f59,_0x642b1b){return new BPromise(function(_0x64c04,_0x25c8bc){var _0x45de2d=_0x642b1b||client;return _0x45de2d['request'](_0x5cfe55,_0x230f59)[_0x0494('0x1e')](function(_0x1289d2){logger[_0x0494('0x1f')](_0x0494('0x20'),_0x104a4c,_0x0494('0x21'));logger[_0x0494('0x22')](_0x0494('0x23'),_0x104a4c,_0x0494('0x21'),JSON[_0x0494('0x24')](_0x1289d2));if(_0x1289d2['error']){if(_0x1289d2[_0x0494('0x25')][_0x0494('0x26')]===0x1f4){logger[_0x0494('0x25')]('DeskConfiguration,\x20%s,\x20%s',_0x104a4c,_0x1289d2['error'][_0x0494('0x27')]);return _0x25c8bc(_0x1289d2['error'][_0x0494('0x27')]);}logger[_0x0494('0x25')](_0x0494('0x20'),_0x104a4c,_0x1289d2[_0x0494('0x25')]['message']);return _0x64c04(_0x1289d2['error'][_0x0494('0x27')]);}else{logger[_0x0494('0x1f')](_0x0494('0x20'),_0x104a4c,_0x0494('0x21'));_0x64c04(_0x1289d2[_0x0494('0x28')]['message']);}})[_0x0494('0x29')](function(_0x7b411d){logger['error'](_0x0494('0x20'),_0x104a4c,_0x7b411d);_0x25c8bc(_0x7b411d);});});}function respondWithStatusCode(_0x21ddb1,_0x5b79e4){_0x5b79e4=_0x5b79e4||0xcc;return function(_0x190c12){if(_0x190c12){return _0x21ddb1[_0x0494('0x2a')](_0x5b79e4);}return _0x21ddb1['status'](_0x5b79e4)['end']();};}function respondWithResult(_0x3071e5,_0x46c7fb){_0x46c7fb=_0x46c7fb||0xc8;return function(_0x1ad385){if(_0x1ad385){return _0x3071e5['status'](_0x46c7fb)[_0x0494('0x2b')](_0x1ad385);}};}function respondWithFilteredResult(_0x1afc71,_0x24621b){return function(_0x73737b){if(_0x73737b){var _0x27453b=_0x73737b[_0x0494('0x2c')],_0x55c9e5=_0x24621b['offset'],_0x2fd78f=_0x24621b[_0x0494('0x2d')]+_0x24621b[_0x0494('0x2e')],_0x295610;if(_0x2fd78f>=_0x27453b){_0x2fd78f=_0x27453b;_0x295610=0xc8;}else{_0x295610=0xce;}_0x1afc71['status'](_0x295610);return _0x1afc71[_0x0494('0x2f')](_0x0494('0x30'),_0x55c9e5+'-'+_0x2fd78f+'/'+_0x27453b)[_0x0494('0x2b')](_0x73737b);}return null;};}function patchUpdates(_0x68fb3f){return function(_0x43d070){try{jsonpatch['apply'](_0x43d070,_0x68fb3f,!![]);}catch(_0x3c8570){return BPromise[_0x0494('0x31')](_0x3c8570);}return _0x43d070['save']();};}function saveUpdates(_0x1494d6,_0x1118ca){return function(_0x579b9f){if(_0x579b9f){return _0x579b9f[_0x0494('0x32')](_0x1494d6)[_0x0494('0x1e')](function(_0x2ce929){return _0x2ce929;});}return null;};}function removeEntity(_0x3a8311,_0x429f55){return function(_0x4c6ecc){if(_0x4c6ecc){return _0x4c6ecc[_0x0494('0x33')]()[_0x0494('0x1e')](function(){_0x3a8311[_0x0494('0x34')](0xcc)[_0x0494('0x35')]();});}};}function handleEntityNotFound(_0x4060b9,_0x123f5f){return function(_0x48f3dd){if(!_0x48f3dd){_0x4060b9[_0x0494('0x2a')](0x194);}return _0x48f3dd;};}function handleError(_0x2b36ab,_0x4d4117){_0x4d4117=_0x4d4117||0x1f4;return function(_0x2fa011){logger['error'](_0x2fa011[_0x0494('0x36')]);if(_0x2fa011[_0x0494('0x37')]){delete _0x2fa011[_0x0494('0x37')];}_0x2b36ab['status'](_0x4d4117)['send'](_0x2fa011);};}exports['index']=function(_0x23dc41,_0x187904){var _0x73de54={},_0x4dd7ef={},_0x3d9aae={'count':0x0,'rows':[]};var _0x14e647=_['map'](db['DeskConfiguration']['rawAttributes'],function(_0x5235bc){return{'name':_0x5235bc[_0x0494('0x38')],'type':_0x5235bc['type'][_0x0494('0x39')]};});_0x4dd7ef[_0x0494('0x3a')]=_[_0x0494('0x3b')](_0x14e647,_0x0494('0x37'));_0x4dd7ef['query']=_[_0x0494('0x3c')](_0x23dc41[_0x0494('0x3d')]);_0x4dd7ef['filters']=_[_0x0494('0x3e')](_0x4dd7ef['model'],_0x4dd7ef[_0x0494('0x3d')]);_0x73de54[_0x0494('0x3f')]=_[_0x0494('0x3e')](_0x4dd7ef[_0x0494('0x3a')],qs[_0x0494('0x40')](_0x23dc41[_0x0494('0x3d')][_0x0494('0x40')]));_0x73de54['attributes']=_0x73de54[_0x0494('0x3f')]['length']?_0x73de54['attributes']:_0x4dd7ef[_0x0494('0x3a')];if(!_0x23dc41[_0x0494('0x3d')][_0x0494('0x41')](_0x0494('0x42'))){_0x73de54[_0x0494('0x2e')]=qs[_0x0494('0x2e')](_0x23dc41['query'][_0x0494('0x2e')]);_0x73de54[_0x0494('0x2d')]=qs[_0x0494('0x2d')](_0x23dc41[_0x0494('0x3d')][_0x0494('0x2d')]);}_0x73de54['order']=qs[_0x0494('0x43')](_0x23dc41[_0x0494('0x3d')]['sort']);_0x73de54[_0x0494('0x44')]=qs[_0x0494('0x45')](_[_0x0494('0x46')](_0x23dc41[_0x0494('0x3d')],_0x4dd7ef[_0x0494('0x45')]));if(_0x23dc41['query'][_0x0494('0x47')]){_0x73de54[_0x0494('0x44')]=_[_0x0494('0x48')](_0x73de54[_0x0494('0x44')],{'$or':_[_0x0494('0x3b')](_0x14e647,function(_0x313733){if(_0x313733[_0x0494('0x49')]!==_0x0494('0x4a')){var _0x32ab8a={};_0x32ab8a[_0x313733[_0x0494('0x37')]]={'$like':'%'+_0x23dc41[_0x0494('0x3d')][_0x0494('0x47')]+'%'};return _0x32ab8a;}})});}_0x73de54=_[_0x0494('0x48')]({},_0x73de54,_0x23dc41[_0x0494('0x4b')]);var _0x2ad80e={'where':_0x73de54[_0x0494('0x44')]};return db['DeskConfiguration'][_0x0494('0x2c')](_0x2ad80e)['then'](function(_0x2fab3e){_0x3d9aae[_0x0494('0x2c')]=_0x2fab3e;if(_0x23dc41[_0x0494('0x3d')][_0x0494('0x4c')]){_0x73de54[_0x0494('0x4d')]=[{'all':!![]}];}return db[_0x0494('0x4e')][_0x0494('0x4f')](_0x73de54);})['then'](function(_0x15856d){_0x3d9aae[_0x0494('0x50')]=_0x15856d;return _0x3d9aae;})[_0x0494('0x1e')](respondWithFilteredResult(_0x187904,_0x73de54))['catch'](handleError(_0x187904,null));};exports[_0x0494('0x51')]=function(_0x270645,_0x1ad6b8){var _0x3fdeb0={'raw':![],'where':{'id':_0x270645['params']['id']}},_0x30f237={};_0x30f237[_0x0494('0x3a')]=_[_0x0494('0x3c')](db[_0x0494('0x4e')][_0x0494('0x52')]);_0x30f237[_0x0494('0x3d')]=_[_0x0494('0x3c')](_0x270645['query']);_0x30f237[_0x0494('0x45')]=_[_0x0494('0x3e')](_0x30f237[_0x0494('0x3a')],_0x30f237[_0x0494('0x3d')]);_0x3fdeb0[_0x0494('0x3f')]=_[_0x0494('0x3e')](_0x30f237[_0x0494('0x3a')],qs[_0x0494('0x40')](_0x270645['query'][_0x0494('0x40')]));_0x3fdeb0['attributes']=_0x3fdeb0[_0x0494('0x3f')][_0x0494('0x53')]?_0x3fdeb0[_0x0494('0x3f')]:_0x30f237['model'];if(_0x270645[_0x0494('0x3d')][_0x0494('0x4c')]){_0x3fdeb0[_0x0494('0x4d')]=[{'all':!![]}];}_0x3fdeb0=_['merge']({},_0x3fdeb0,_0x270645[_0x0494('0x4b')]);return db[_0x0494('0x4e')][_0x0494('0x54')](_0x3fdeb0)['then'](handleEntityNotFound(_0x1ad6b8,null))[_0x0494('0x1e')](respondWithResult(_0x1ad6b8,null))[_0x0494('0x29')](handleError(_0x1ad6b8,null));};exports[_0x0494('0x55')]=function(_0x629e41,_0x29578c){return db[_0x0494('0x4e')][_0x0494('0x55')](_0x629e41['body'],{})[_0x0494('0x1e')](respondWithResult(_0x29578c,0xc9))['catch'](handleError(_0x29578c,null));};exports['update']=function(_0x469d46,_0x46aa99){if(_0x469d46['body']['id']){delete _0x469d46[_0x0494('0x56')]['id'];}return db[_0x0494('0x4e')][_0x0494('0x54')]({'where':{'id':_0x469d46[_0x0494('0x57')]['id']}})[_0x0494('0x1e')](handleEntityNotFound(_0x46aa99,null))[_0x0494('0x1e')](saveUpdates(_0x469d46[_0x0494('0x56')],null))[_0x0494('0x1e')](respondWithResult(_0x46aa99,null))[_0x0494('0x29')](handleError(_0x46aa99,null));};exports['destroy']=function(_0x3d250e,_0x3ca064){return db[_0x0494('0x4e')][_0x0494('0x54')]({'where':{'id':_0x3d250e[_0x0494('0x57')]['id']}})[_0x0494('0x1e')](handleEntityNotFound(_0x3ca064,null))[_0x0494('0x1e')](removeEntity(_0x3ca064,null))[_0x0494('0x29')](handleError(_0x3ca064,null));};exports['getFields']=function(_0x86dd74,_0x29cac0,_0x17f31a){var _0x209688={};var _0x108e6a={};var _0x441cc1;var _0x8fdfa5;return db[_0x0494('0x4e')][_0x0494('0x58')]({'where':{'id':_0x86dd74[_0x0494('0x57')]['id']}})[_0x0494('0x1e')](handleEntityNotFound(_0x29cac0,null))[_0x0494('0x1e')](function(_0x5ebd51){if(_0x5ebd51){_0x441cc1=_0x5ebd51;_0x108e6a[_0x0494('0x3a')]=_[_0x0494('0x3c')](db[_0x0494('0x59')][_0x0494('0x52')]);_0x108e6a['query']=_[_0x0494('0x3c')](_0x86dd74['query']);_0x108e6a[_0x0494('0x45')]=_[_0x0494('0x3e')](_0x108e6a[_0x0494('0x3a')],_0x108e6a['query']);_0x209688[_0x0494('0x3f')]=_[_0x0494('0x3e')](_0x108e6a[_0x0494('0x3a')],qs[_0x0494('0x40')](_0x86dd74[_0x0494('0x3d')][_0x0494('0x40')]));_0x209688[_0x0494('0x3f')]=_0x209688[_0x0494('0x3f')][_0x0494('0x53')]?_0x209688[_0x0494('0x3f')]:_0x108e6a[_0x0494('0x3a')];_0x209688[_0x0494('0x5a')]=qs[_0x0494('0x43')](_0x86dd74[_0x0494('0x3d')][_0x0494('0x43')]);_0x209688[_0x0494('0x44')]=qs[_0x0494('0x45')](_['pick'](_0x86dd74[_0x0494('0x3d')],_0x108e6a['filters']));if(_0x86dd74['query'][_0x0494('0x47')]){_0x209688[_0x0494('0x44')]=_[_0x0494('0x48')](_0x209688['where'],{'$or':_[_0x0494('0x3b')](_0x209688[_0x0494('0x3f')],function(_0x36cb0d){var _0x15e9cb={};_0x15e9cb[_0x36cb0d]={'$like':'%'+_0x86dd74['query'][_0x0494('0x47')]+'%'};return _0x15e9cb;})});}_0x209688=_[_0x0494('0x48')]({},_0x209688,_0x86dd74[_0x0494('0x4b')]);return _0x441cc1[_0x0494('0x5b')](_0x209688);}})[_0x0494('0x1e')](function(_0x24d3b8){if(_0x24d3b8){_0x8fdfa5=_0x24d3b8[_0x0494('0x53')];if(!_0x86dd74[_0x0494('0x3d')][_0x0494('0x41')](_0x0494('0x42'))){_0x209688[_0x0494('0x2e')]=qs[_0x0494('0x2e')](_0x86dd74[_0x0494('0x3d')][_0x0494('0x2e')]);_0x209688[_0x0494('0x2d')]=qs['offset'](_0x86dd74[_0x0494('0x3d')]['offset']);}return _0x441cc1[_0x0494('0x5b')](_0x209688);}})['then'](function(_0xd5dffc){if(_0xd5dffc){return _0xd5dffc?{'count':_0x8fdfa5,'rows':_0xd5dffc}:null;}})[_0x0494('0x1e')](respondWithResult(_0x29cac0,null))['catch'](handleError(_0x29cac0,null));};exports['getSubjects']=function(_0x251734,_0x3b3b00,_0x2bdb27){var _0x5ed9ae={};var _0x478a3d={};var _0x22cc21;var _0x5ef289;return db[_0x0494('0x4e')][_0x0494('0x58')]({'where':{'id':_0x251734['params']['id']}})[_0x0494('0x1e')](handleEntityNotFound(_0x3b3b00,null))[_0x0494('0x1e')](function(_0x548563){if(_0x548563){_0x22cc21=_0x548563;_0x478a3d['model']=_[_0x0494('0x3c')](db[_0x0494('0x59')][_0x0494('0x52')]);_0x478a3d[_0x0494('0x3d')]=_[_0x0494('0x3c')](_0x251734[_0x0494('0x3d')]);_0x478a3d[_0x0494('0x45')]=_[_0x0494('0x3e')](_0x478a3d['model'],_0x478a3d[_0x0494('0x3d')]);_0x5ed9ae[_0x0494('0x3f')]=_[_0x0494('0x3e')](_0x478a3d[_0x0494('0x3a')],qs[_0x0494('0x40')](_0x251734[_0x0494('0x3d')]['fields']));_0x5ed9ae[_0x0494('0x3f')]=_0x5ed9ae[_0x0494('0x3f')][_0x0494('0x53')]?_0x5ed9ae[_0x0494('0x3f')]:_0x478a3d[_0x0494('0x3a')];_0x5ed9ae['order']=qs['sort'](_0x251734[_0x0494('0x3d')][_0x0494('0x43')]);_0x5ed9ae[_0x0494('0x44')]=qs[_0x0494('0x45')](_[_0x0494('0x46')](_0x251734[_0x0494('0x3d')],_0x478a3d[_0x0494('0x45')]));if(_0x251734[_0x0494('0x3d')][_0x0494('0x47')]){_0x5ed9ae['where']=_[_0x0494('0x48')](_0x5ed9ae[_0x0494('0x44')],{'$or':_[_0x0494('0x3b')](_0x5ed9ae[_0x0494('0x3f')],function(_0x4e1c5b){var _0xfa4262={};_0xfa4262[_0x4e1c5b]={'$like':'%'+_0x251734[_0x0494('0x3d')][_0x0494('0x47')]+'%'};return _0xfa4262;})});}_0x5ed9ae=_[_0x0494('0x48')]({},_0x5ed9ae,_0x251734['options']);return _0x22cc21[_0x0494('0x5c')](_0x5ed9ae);}})[_0x0494('0x1e')](function(_0x4e6a9a){if(_0x4e6a9a){_0x5ef289=_0x4e6a9a[_0x0494('0x53')];if(!_0x251734['query'][_0x0494('0x41')](_0x0494('0x42'))){_0x5ed9ae[_0x0494('0x2e')]=qs[_0x0494('0x2e')](_0x251734[_0x0494('0x3d')][_0x0494('0x2e')]);_0x5ed9ae[_0x0494('0x2d')]=qs[_0x0494('0x2d')](_0x251734[_0x0494('0x3d')][_0x0494('0x2d')]);}return _0x22cc21[_0x0494('0x5c')](_0x5ed9ae);}})[_0x0494('0x1e')](function(_0x35e786){if(_0x35e786){return _0x35e786?{'count':_0x5ef289,'rows':_0x35e786}:null;}})['then'](respondWithResult(_0x3b3b00,null))[_0x0494('0x29')](handleError(_0x3b3b00,null));};exports[_0x0494('0x5d')]=function(_0x122d7b,_0x440449,_0x596be3){var _0x5251c1={};var _0x1fd69e={};var _0x4314c6;var _0x4c8ea3;return db['DeskConfiguration']['findOne']({'where':{'id':_0x122d7b[_0x0494('0x57')]['id']}})['then'](handleEntityNotFound(_0x440449,null))[_0x0494('0x1e')](function(_0x329b18){if(_0x329b18){_0x4314c6=_0x329b18;_0x1fd69e['model']=_[_0x0494('0x3c')](db[_0x0494('0x59')][_0x0494('0x52')]);_0x1fd69e[_0x0494('0x3d')]=_[_0x0494('0x3c')](_0x122d7b[_0x0494('0x3d')]);_0x1fd69e[_0x0494('0x45')]=_[_0x0494('0x3e')](_0x1fd69e['model'],_0x1fd69e[_0x0494('0x3d')]);_0x5251c1[_0x0494('0x3f')]=_[_0x0494('0x3e')](_0x1fd69e[_0x0494('0x3a')],qs[_0x0494('0x40')](_0x122d7b[_0x0494('0x3d')]['fields']));_0x5251c1[_0x0494('0x3f')]=_0x5251c1[_0x0494('0x3f')]['length']?_0x5251c1[_0x0494('0x3f')]:_0x1fd69e[_0x0494('0x3a')];_0x5251c1[_0x0494('0x5a')]=qs[_0x0494('0x43')](_0x122d7b[_0x0494('0x3d')][_0x0494('0x43')]);_0x5251c1[_0x0494('0x44')]=qs[_0x0494('0x45')](_['pick'](_0x122d7b['query'],_0x1fd69e[_0x0494('0x45')]));if(_0x122d7b[_0x0494('0x3d')]['filter']){_0x5251c1[_0x0494('0x44')]=_[_0x0494('0x48')](_0x5251c1[_0x0494('0x44')],{'$or':_[_0x0494('0x3b')](_0x5251c1['attributes'],function(_0x32d136){var _0x294635={};_0x294635[_0x32d136]={'$like':'%'+_0x122d7b[_0x0494('0x3d')][_0x0494('0x47')]+'%'};return _0x294635;})});}_0x5251c1=_[_0x0494('0x48')]({},_0x5251c1,_0x122d7b[_0x0494('0x4b')]);return _0x4314c6[_0x0494('0x5d')](_0x5251c1);}})['then'](function(_0x1af201){if(_0x1af201){_0x4c8ea3=_0x1af201[_0x0494('0x53')];if(!_0x122d7b[_0x0494('0x3d')][_0x0494('0x41')]('nolimit')){_0x5251c1[_0x0494('0x2e')]=qs[_0x0494('0x2e')](_0x122d7b[_0x0494('0x3d')]['limit']);_0x5251c1['offset']=qs['offset'](_0x122d7b[_0x0494('0x3d')]['offset']);}return _0x4314c6[_0x0494('0x5d')](_0x5251c1);}})[_0x0494('0x1e')](function(_0x3d1690){if(_0x3d1690){return _0x3d1690?{'count':_0x4c8ea3,'rows':_0x3d1690}:null;}})[_0x0494('0x1e')](respondWithResult(_0x440449,null))[_0x0494('0x29')](handleError(_0x440449,null));};exports[_0x0494('0x5e')]=function(_0x2cecbb,_0x50ce24,_0x178c6e){var _0x653b5a={};var _0x235b21={};var _0x43d602;var _0x2a008c;return db[_0x0494('0x4e')][_0x0494('0x58')]({'where':{'id':_0x2cecbb['params']['id']}})[_0x0494('0x1e')](handleEntityNotFound(_0x50ce24,null))[_0x0494('0x1e')](function(_0x1c0611){if(_0x1c0611){_0x43d602=_0x1c0611;_0x235b21[_0x0494('0x3a')]=_['keys'](db[_0x0494('0x5f')][_0x0494('0x52')]);_0x235b21[_0x0494('0x3d')]=_[_0x0494('0x3c')](_0x2cecbb['query']);_0x235b21[_0x0494('0x45')]=_[_0x0494('0x3e')](_0x235b21[_0x0494('0x3a')],_0x235b21['query']);_0x653b5a[_0x0494('0x3f')]=_['intersection'](_0x235b21['model'],qs[_0x0494('0x40')](_0x2cecbb['query'][_0x0494('0x40')]));_0x653b5a[_0x0494('0x3f')]=_0x653b5a[_0x0494('0x3f')][_0x0494('0x53')]?_0x653b5a[_0x0494('0x3f')]:_0x235b21[_0x0494('0x3a')];_0x653b5a[_0x0494('0x5a')]=qs[_0x0494('0x43')](_0x2cecbb[_0x0494('0x3d')][_0x0494('0x43')]);_0x653b5a[_0x0494('0x44')]=qs['filters'](_[_0x0494('0x46')](_0x2cecbb[_0x0494('0x3d')],_0x235b21[_0x0494('0x45')]));if(_0x2cecbb['query'][_0x0494('0x47')]){_0x653b5a[_0x0494('0x44')]=_['merge'](_0x653b5a['where'],{'$or':_[_0x0494('0x3b')](_0x653b5a[_0x0494('0x3f')],function(_0x321f71){var _0x273818={};_0x273818[_0x321f71]={'$like':'%'+_0x2cecbb[_0x0494('0x3d')]['filter']+'%'};return _0x273818;})});}_0x653b5a=_[_0x0494('0x48')]({},_0x653b5a,_0x2cecbb[_0x0494('0x4b')]);return _0x43d602[_0x0494('0x5e')](_0x653b5a);}})['then'](function(_0x21f45b){if(_0x21f45b){_0x2a008c=_0x21f45b[_0x0494('0x53')];if(!_0x2cecbb['query'][_0x0494('0x41')](_0x0494('0x42'))){_0x653b5a[_0x0494('0x2e')]=qs[_0x0494('0x2e')](_0x2cecbb['query'][_0x0494('0x2e')]);_0x653b5a[_0x0494('0x2d')]=qs['offset'](_0x2cecbb[_0x0494('0x3d')]['offset']);}return _0x43d602[_0x0494('0x5e')](_0x653b5a);}})[_0x0494('0x1e')](function(_0x1e3d86){if(_0x1e3d86){return _0x1e3d86?{'count':_0x2a008c,'rows':_0x1e3d86}:null;}})['then'](respondWithResult(_0x50ce24,null))[_0x0494('0x29')](handleError(_0x50ce24,null));};exports[_0x0494('0x60')]=function(_0x6920ed,_0x5b876d,_0x4b018b){if(_0x6920ed[_0x0494('0x56')]['id']){delete _0x6920ed[_0x0494('0x56')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x6920ed[_0x0494('0x57')]['id']}})[_0x0494('0x1e')](handleEntityNotFound(_0x5b876d,null))[_0x0494('0x1e')](function(_0x25b86b){if(_0x25b86b){return _0x25b86b['setTags'](_0x6920ed[_0x0494('0x56')][_0x0494('0x61')]||[]);}return null;})[_0x0494('0x1e')](respondWithResult(_0x5b876d,null))['catch'](handleError(_0x5b876d,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index 35aba93..34283bf 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 _0xd802=['DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskConfiguration.attributes','exports','define'];(function(_0x3bab09,_0x217c29){var _0x164376=function(_0x277730){while(--_0x277730){_0x3bab09['push'](_0x3bab09['shift']());}};_0x164376(++_0x217c29);}(_0xd802,0x1b4));var _0x2d80=function(_0x5a2285,_0x3212d1){_0x5a2285=_0x5a2285-0x0;var _0x48f6ed=_0xd802[_0x5a2285];return _0x48f6ed;};'use strict';var _=require(_0x2d80('0x0'));var util=require(_0x2d80('0x1'));var logger=require(_0x2d80('0x2'))(_0x2d80('0x3'));var moment=require(_0x2d80('0x4'));var BPromise=require('bluebird');var rp=require(_0x2d80('0x5'));var fs=require('fs');var path=require(_0x2d80('0x6'));var rimraf=require(_0x2d80('0x7'));var config=require(_0x2d80('0x8'));var attributes=require(_0x2d80('0x9'));module[_0x2d80('0xa')]=function(_0x230152,_0x399691){return _0x230152[_0x2d80('0xb')](_0x2d80('0xc'),attributes,{'tableName':_0x2d80('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46ba=['../../config/environment','./intDeskConfiguration.attributes','define','int_desk_configurations','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x58de4a,_0x564dbc){var _0x178820=function(_0x3576ef){while(--_0x3576ef){_0x58de4a['push'](_0x58de4a['shift']());}};_0x178820(++_0x564dbc);}(_0x46ba,0x130));var _0xa46b=function(_0x2a6960,_0x58dc9b){_0x2a6960=_0x2a6960-0x0;var _0x1f05e0=_0x46ba[_0x2a6960];return _0x1f05e0;};'use strict';var _=require(_0xa46b('0x0'));var util=require(_0xa46b('0x1'));var logger=require(_0xa46b('0x2'))(_0xa46b('0x3'));var moment=require(_0xa46b('0x4'));var BPromise=require(_0xa46b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa46b('0x6'));var rimraf=require(_0xa46b('0x7'));var config=require(_0xa46b('0x8'));var attributes=require(_0xa46b('0x9'));module['exports']=function(_0x1f4cb2,_0x2bea80){return _0x1f4cb2[_0xa46b('0xa')]('DeskConfiguration',attributes,{'tableName':_0xa46b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js b/server/api/intDeskConfiguration/intDeskConfiguration.rpc.js index 0b70716..4ba62a7 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 _0xd110=['error','code','message','DeskConfiguration,\x20%s,\x20%s','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x1cdec2,_0xa232ef){var _0x10201a=function(_0x2c04f2){while(--_0x2c04f2){_0x1cdec2['push'](_0x1cdec2['shift']());}};_0x10201a(++_0xa232ef);}(_0xd110,0x1e8));var _0x0d11=function(_0x34688b,_0x424a2e){_0x34688b=_0x34688b-0x0;var _0x51f01a=_0xd110[_0x34688b];return _0x51f01a;};'use strict';var _=require(_0x0d11('0x0'));var util=require(_0x0d11('0x1'));var moment=require(_0x0d11('0x2'));var BPromise=require('bluebird');var rs=require(_0x0d11('0x3'));var fs=require('fs');var Redis=require(_0x0d11('0x4'));var db=require(_0x0d11('0x5'))['db'];var utils=require(_0x0d11('0x6'));var logger=require(_0x0d11('0x7'))(_0x0d11('0x8'));var config=require(_0x0d11('0x9'));var jayson=require(_0x0d11('0xa'));var client=jayson['client'][_0x0d11('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a889c,_0x33c46e,_0x4f3f3f){return new BPromise(function(_0x47a493,_0x3f9f5a){return client[_0x0d11('0xc')](_0x5a889c,_0x4f3f3f)[_0x0d11('0xd')](function(_0x4c6a59){logger[_0x0d11('0xe')]('DeskConfiguration,\x20%s,\x20%s',_0x33c46e,_0x0d11('0xf'));logger['debug'](_0x0d11('0x10'),_0x33c46e,_0x0d11('0xf'),JSON[_0x0d11('0x11')](_0x4c6a59));if(_0x4c6a59[_0x0d11('0x12')]){if(_0x4c6a59['error'][_0x0d11('0x13')]===0x1f4){logger[_0x0d11('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x33c46e,_0x4c6a59[_0x0d11('0x12')][_0x0d11('0x14')]);return _0x3f9f5a(_0x4c6a59[_0x0d11('0x12')]['message']);}logger[_0x0d11('0x12')](_0x0d11('0x15'),_0x33c46e,_0x4c6a59['error'][_0x0d11('0x14')]);return _0x47a493(_0x4c6a59[_0x0d11('0x12')][_0x0d11('0x14')]);}else{logger[_0x0d11('0xe')](_0x0d11('0x15'),_0x33c46e,'request\x20sent');_0x47a493(_0x4c6a59['result'][_0x0d11('0x14')]);}})['catch'](function(_0x46aa4f){logger[_0x0d11('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x33c46e,_0x46aa4f);_0x3f9f5a(_0x46aa4f);});});} \ No newline at end of file +var _0x89f7=['DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x1cc0c5,_0x214d99){var _0x96ec3d=function(_0x2b027e){while(--_0x2b027e){_0x1cc0c5['push'](_0x1cc0c5['shift']());}};_0x96ec3d(++_0x214d99);}(_0x89f7,0x105));var _0x789f=function(_0x2b91c5,_0x3b6db5){_0x2b91c5=_0x2b91c5-0x0;var _0xbd5531=_0x89f7[_0x2b91c5];return _0xbd5531;};'use strict';var _=require(_0x789f('0x0'));var util=require(_0x789f('0x1'));var moment=require(_0x789f('0x2'));var BPromise=require('bluebird');var rs=require(_0x789f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x789f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x789f('0x5'))(_0x789f('0x6'));var config=require(_0x789f('0x7'));var jayson=require(_0x789f('0x8'));var client=jayson['client'][_0x789f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1faaa5,_0x2e2dba,_0x1037cc){return new BPromise(function(_0x48f79b,_0x4f59aa){return client[_0x789f('0xa')](_0x1faaa5,_0x1037cc)[_0x789f('0xb')](function(_0x23f5c5){logger['info'](_0x789f('0xc'),_0x2e2dba,_0x789f('0xd'));logger[_0x789f('0xe')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2e2dba,'request\x20sent',JSON['stringify'](_0x23f5c5));if(_0x23f5c5['error']){if(_0x23f5c5[_0x789f('0xf')][_0x789f('0x10')]===0x1f4){logger[_0x789f('0xf')](_0x789f('0xc'),_0x2e2dba,_0x23f5c5[_0x789f('0xf')][_0x789f('0x11')]);return _0x4f59aa(_0x23f5c5['error'][_0x789f('0x11')]);}logger[_0x789f('0xf')](_0x789f('0xc'),_0x2e2dba,_0x23f5c5[_0x789f('0xf')]['message']);return _0x48f79b(_0x23f5c5[_0x789f('0xf')]['message']);}else{logger[_0x789f('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x2e2dba,'request\x20sent');_0x48f79b(_0x23f5c5[_0x789f('0x13')][_0x789f('0x11')]);}})[_0x789f('0x14')](function(_0x137f51){logger[_0x789f('0xf')](_0x789f('0xc'),_0x2e2dba,_0x137f51);_0x4f59aa(_0x137f51);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 859ce48..9150438 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 _0x5a8b=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskField.controller','index','/:id','isAuthenticated','show','post','put','delete','destroy','util','path','connect-timeout','express','Router'];(function(_0xf8d7aa,_0x4b003f){var _0x4d46c1=function(_0x440f1a){while(--_0x440f1a){_0xf8d7aa['push'](_0xf8d7aa['shift']());}};_0x4d46c1(++_0x4b003f);}(_0x5a8b,0x193));var _0xb5a8=function(_0x1ad7ee,_0x2d80ad){_0x1ad7ee=_0x1ad7ee-0x0;var _0x24cf0c=_0x5a8b[_0x1ad7ee];return _0x24cf0c;};'use strict';var multer=require('multer');var util=require(_0xb5a8('0x0'));var path=require(_0xb5a8('0x1'));var timeout=require(_0xb5a8('0x2'));var express=require(_0xb5a8('0x3'));var router=express[_0xb5a8('0x4')]();var auth=require(_0xb5a8('0x5'));var interaction=require(_0xb5a8('0x6'));var config=require(_0xb5a8('0x7'));var controller=require(_0xb5a8('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xb5a8('0x9')]);router['get'](_0xb5a8('0xa'),auth[_0xb5a8('0xb')](),controller[_0xb5a8('0xc')]);router[_0xb5a8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb5a8('0xe')](_0xb5a8('0xa'),auth[_0xb5a8('0xb')](),controller['update']);router[_0xb5a8('0xf')]('/:id',auth[_0xb5a8('0xb')](),controller[_0xb5a8('0x10')]);module['exports']=router; \ No newline at end of file +var _0xac39=['../../components/interaction/service','../../config/environment','./intDeskField.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x13bf05,_0x45be03){var _0x233d7f=function(_0x4550b7){while(--_0x4550b7){_0x13bf05['push'](_0x13bf05['shift']());}};_0x233d7f(++_0x45be03);}(_0xac39,0xf1));var _0x9ac3=function(_0x3b0443,_0x31990e){_0x3b0443=_0x3b0443-0x0;var _0x3d68b6=_0xac39[_0x3b0443];return _0x3d68b6;};'use strict';var multer=require(_0x9ac3('0x0'));var util=require(_0x9ac3('0x1'));var path=require(_0x9ac3('0x2'));var timeout=require(_0x9ac3('0x3'));var express=require('express');var router=express[_0x9ac3('0x4')]();var auth=require(_0x9ac3('0x5'));var interaction=require(_0x9ac3('0x6'));var config=require(_0x9ac3('0x7'));var controller=require(_0x9ac3('0x8'));router[_0x9ac3('0x9')]('/',auth[_0x9ac3('0xa')](),controller[_0x9ac3('0xb')]);router[_0x9ac3('0x9')](_0x9ac3('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x9ac3('0xd')]('/',auth[_0x9ac3('0xa')](),controller[_0x9ac3('0xe')]);router[_0x9ac3('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x9ac3('0x10')]);router[_0x9ac3('0x11')](_0x9ac3('0xc'),auth[_0x9ac3('0xa')](),controller['destroy']);module[_0x9ac3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 30ce47e..b45f720 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 _0x9fc8=['keyValue','STRING','BOOLEAN','sequelize','exports','ENUM','string','variable','customVariable'];(function(_0x39c884,_0xd4c65){var _0x40f8ff=function(_0x1f14d3){while(--_0x1f14d3){_0x39c884['push'](_0x39c884['shift']());}};_0x40f8ff(++_0xd4c65);}(_0x9fc8,0x123));var _0x89fc=function(_0x46b775,_0x3a9f49){_0x46b775=_0x46b775-0x0;var _0x524d23=_0x9fc8[_0x46b775];return _0x524d23;};'use strict';var Sequelize=require(_0x89fc('0x0'));module[_0x89fc('0x1')]={'type':{'type':Sequelize[_0x89fc('0x2')](_0x89fc('0x3'),_0x89fc('0x4'),_0x89fc('0x5'),_0x89fc('0x6')),'defaultValue':_0x89fc('0x3')},'content':{'type':Sequelize[_0x89fc('0x7')]},'key':{'type':Sequelize[_0x89fc('0x7')]},'keyType':{'type':Sequelize[_0x89fc('0x2')](_0x89fc('0x3'),_0x89fc('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x89fc('0x7')]},'idField':{'type':Sequelize[_0x89fc('0x7')]},'nameField':{'type':Sequelize[_0x89fc('0x7')]},'customField':{'type':Sequelize[_0x89fc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x89fc('0x7')]}}; \ No newline at end of file +var _0x1395=['BOOLEAN','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x4cc61d,_0x3fd027){var _0x916589=function(_0x3f8b72){while(--_0x3f8b72){_0x4cc61d['push'](_0x4cc61d['shift']());}};_0x916589(++_0x3fd027);}(_0x1395,0x1a9));var _0x5139=function(_0x2e723d,_0x209396){_0x2e723d=_0x2e723d-0x0;var _0x49d6b7=_0x1395[_0x2e723d];return _0x49d6b7;};'use strict';var Sequelize=require(_0x5139('0x0'));module[_0x5139('0x1')]={'type':{'type':Sequelize[_0x5139('0x2')](_0x5139('0x3'),_0x5139('0x4'),'customVariable',_0x5139('0x5')),'defaultValue':_0x5139('0x3')},'content':{'type':Sequelize[_0x5139('0x6')]},'key':{'type':Sequelize[_0x5139('0x6')]},'keyType':{'type':Sequelize[_0x5139('0x2')](_0x5139('0x3'),_0x5139('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x5139('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x5139('0x6')]},'customField':{'type':Sequelize[_0x5139('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5139('0x6')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index d77d614..7604609 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 _0x7217=['send','index','map','DeskField','rawAttributes','fieldName','type','model','keys','query','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filters','filter','merge','options','includeAll','include','findAll','rows','catch','show','create','body','find','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','Content-Range','apply','reject','save','update','then','error','stack','name'];(function(_0x517494,_0x17c7c5){var _0x43a156=function(_0x2b206b){while(--_0x2b206b){_0x517494['push'](_0x517494['shift']());}};_0x43a156(++_0x17c7c5);}(_0x7217,0x19e));var _0x7721=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0x7217[_0x3635ce];return _0x97ecd0;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];function respondWithStatusCode(_0x27b36b,_0x55b4ca){_0x55b4ca=_0x55b4ca||0xcc;return function(_0x2911ec){if(_0x2911ec){return _0x27b36b[_0x7721('0x1b')](_0x55b4ca);}return _0x27b36b['status'](_0x55b4ca)[_0x7721('0x1c')]();};}function respondWithResult(_0x30da54,_0x3f01c5){_0x3f01c5=_0x3f01c5||0xc8;return function(_0x2e9752){if(_0x2e9752){return _0x30da54['status'](_0x3f01c5)[_0x7721('0x1d')](_0x2e9752);}};}function respondWithFilteredResult(_0x25b1c0,_0x534f1b){return function(_0x4e199a){if(_0x4e199a){var _0x4b183e=_0x4e199a[_0x7721('0x1e')],_0x5ed54=_0x534f1b['offset'],_0x25a628=_0x534f1b[_0x7721('0x1f')]+_0x534f1b['limit'],_0x3cc909;if(_0x25a628>=_0x4b183e){_0x25a628=_0x4b183e;_0x3cc909=0xc8;}else{_0x3cc909=0xce;}_0x25b1c0[_0x7721('0x20')](_0x3cc909);return _0x25b1c0['set'](_0x7721('0x21'),_0x5ed54+'-'+_0x25a628+'/'+_0x4b183e)[_0x7721('0x1d')](_0x4e199a);}return null;};}function patchUpdates(_0x3ab5a5){return function(_0x3e140d){try{jsonpatch[_0x7721('0x22')](_0x3e140d,_0x3ab5a5,!![]);}catch(_0x40af90){return BPromise[_0x7721('0x23')](_0x40af90);}return _0x3e140d[_0x7721('0x24')]();};}function saveUpdates(_0x3b29ac,_0xaeccc4){return function(_0x4ce1db){if(_0x4ce1db){return _0x4ce1db[_0x7721('0x25')](_0x3b29ac)[_0x7721('0x26')](function(_0x3a053f){return _0x3a053f;});}return null;};}function removeEntity(_0xd8ad3c,_0x57140c){return function(_0x28f5a6){if(_0x28f5a6){return _0x28f5a6['destroy']()[_0x7721('0x26')](function(){_0xd8ad3c[_0x7721('0x20')](0xcc)[_0x7721('0x1c')]();});}};}function handleEntityNotFound(_0x1caad8,_0x121cc4){return function(_0x395b15){if(!_0x395b15){_0x1caad8[_0x7721('0x1b')](0x194);}return _0x395b15;};}function handleError(_0x5b4d74,_0x216f20){_0x216f20=_0x216f20||0x1f4;return function(_0x1abedb){logger[_0x7721('0x27')](_0x1abedb[_0x7721('0x28')]);if(_0x1abedb[_0x7721('0x29')]){delete _0x1abedb[_0x7721('0x29')];}_0x5b4d74[_0x7721('0x20')](_0x216f20)[_0x7721('0x2a')](_0x1abedb);};}exports[_0x7721('0x2b')]=function(_0x52316e,_0x258ddf){var _0x5b0551={},_0x499b87={},_0x315202={'count':0x0,'rows':[]};var _0x343c19=_[_0x7721('0x2c')](db[_0x7721('0x2d')][_0x7721('0x2e')],function(_0x37b9f0){return{'name':_0x37b9f0[_0x7721('0x2f')],'type':_0x37b9f0[_0x7721('0x30')]['key']};});_0x499b87[_0x7721('0x31')]=_[_0x7721('0x2c')](_0x343c19,'name');_0x499b87['query']=_[_0x7721('0x32')](_0x52316e[_0x7721('0x33')]);_0x499b87['filters']=_[_0x7721('0x34')](_0x499b87[_0x7721('0x31')],_0x499b87[_0x7721('0x33')]);_0x5b0551['attributes']=_[_0x7721('0x34')](_0x499b87[_0x7721('0x31')],qs[_0x7721('0x35')](_0x52316e[_0x7721('0x33')][_0x7721('0x35')]));_0x5b0551['attributes']=_0x5b0551[_0x7721('0x36')][_0x7721('0x37')]?_0x5b0551[_0x7721('0x36')]:_0x499b87['model'];if(!_0x52316e[_0x7721('0x33')][_0x7721('0x38')]('nolimit')){_0x5b0551[_0x7721('0x39')]=qs['limit'](_0x52316e[_0x7721('0x33')][_0x7721('0x39')]);_0x5b0551[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0x52316e[_0x7721('0x33')][_0x7721('0x1f')]);}_0x5b0551[_0x7721('0x3a')]=qs[_0x7721('0x3b')](_0x52316e[_0x7721('0x33')][_0x7721('0x3b')]);_0x5b0551[_0x7721('0x3c')]=qs['filters'](_[_0x7721('0x3d')](_0x52316e['query'],_0x499b87[_0x7721('0x3e')]));if(_0x52316e[_0x7721('0x33')][_0x7721('0x3f')]){_0x5b0551[_0x7721('0x3c')]=_[_0x7721('0x40')](_0x5b0551[_0x7721('0x3c')],{'$or':_['map'](_0x343c19,function(_0x557c34){if(_0x557c34['type']!=='VIRTUAL'){var _0x18001c={};_0x18001c[_0x557c34[_0x7721('0x29')]]={'$like':'%'+_0x52316e[_0x7721('0x33')][_0x7721('0x3f')]+'%'};return _0x18001c;}})});}_0x5b0551=_['merge']({},_0x5b0551,_0x52316e[_0x7721('0x41')]);var _0x4cf659={'where':_0x5b0551[_0x7721('0x3c')]};return db[_0x7721('0x2d')]['count'](_0x4cf659)[_0x7721('0x26')](function(_0x3a47c8){_0x315202['count']=_0x3a47c8;if(_0x52316e['query'][_0x7721('0x42')]){_0x5b0551[_0x7721('0x43')]=[{'all':!![]}];}return db[_0x7721('0x2d')][_0x7721('0x44')](_0x5b0551);})['then'](function(_0x2db173){_0x315202[_0x7721('0x45')]=_0x2db173;return _0x315202;})[_0x7721('0x26')](respondWithFilteredResult(_0x258ddf,_0x5b0551))[_0x7721('0x46')](handleError(_0x258ddf,null));};exports[_0x7721('0x47')]=function(_0x52ab67,_0x490d4){var _0x4a2c28={'raw':!![],'where':{'id':_0x52ab67['params']['id']}},_0xaa3216={};_0xaa3216[_0x7721('0x31')]=_[_0x7721('0x32')](db[_0x7721('0x2d')]['rawAttributes']);_0xaa3216[_0x7721('0x33')]=_[_0x7721('0x32')](_0x52ab67[_0x7721('0x33')]);_0xaa3216['filters']=_[_0x7721('0x34')](_0xaa3216[_0x7721('0x31')],_0xaa3216[_0x7721('0x33')]);_0x4a2c28[_0x7721('0x36')]=_[_0x7721('0x34')](_0xaa3216[_0x7721('0x31')],qs[_0x7721('0x35')](_0x52ab67['query']['fields']));_0x4a2c28[_0x7721('0x36')]=_0x4a2c28[_0x7721('0x36')][_0x7721('0x37')]?_0x4a2c28[_0x7721('0x36')]:_0xaa3216[_0x7721('0x31')];if(_0x52ab67[_0x7721('0x33')][_0x7721('0x42')]){_0x4a2c28[_0x7721('0x43')]=[{'all':!![]}];}_0x4a2c28=_[_0x7721('0x40')]({},_0x4a2c28,_0x52ab67[_0x7721('0x41')]);return db['DeskField']['find'](_0x4a2c28)[_0x7721('0x26')](handleEntityNotFound(_0x490d4,null))[_0x7721('0x26')](respondWithResult(_0x490d4,null))[_0x7721('0x46')](handleError(_0x490d4,null));};exports[_0x7721('0x48')]=function(_0x589e95,_0x30107e){return db[_0x7721('0x2d')]['create'](_0x589e95[_0x7721('0x49')],{})['then'](respondWithResult(_0x30107e,0xc9))[_0x7721('0x46')](handleError(_0x30107e,null));};exports['update']=function(_0x334f23,_0x196be4){if(_0x334f23[_0x7721('0x49')]['id']){delete _0x334f23['body']['id'];}return db[_0x7721('0x2d')][_0x7721('0x4a')]({'where':{'id':_0x334f23['params']['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x196be4,null))[_0x7721('0x26')](saveUpdates(_0x334f23[_0x7721('0x49')],null))['then'](respondWithResult(_0x196be4,null))[_0x7721('0x46')](handleError(_0x196be4,null));};exports['destroy']=function(_0xdb1ca8,_0x310549){return db[_0x7721('0x2d')][_0x7721('0x4a')]({'where':{'id':_0xdb1ca8[_0x7721('0x4b')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x310549,null))[_0x7721('0x26')](removeEntity(_0x310549,null))[_0x7721('0x46')](handleError(_0x310549,null));}; \ No newline at end of file +var _0x2d17=['includeAll','include','findAll','then','rows','catch','show','keys','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','map','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','DeskField','count'];(function(_0x5660d5,_0x235c27){var _0x2a144d=function(_0x54fb3f){while(--_0x54fb3f){_0x5660d5['push'](_0x5660d5['shift']());}};_0x2a144d(++_0x235c27);}(_0x2d17,0x17e));var _0x72d1=function(_0x53e8cc,_0x5236de){_0x53e8cc=_0x53e8cc-0x0;var _0x38eef3=_0x2d17[_0x53e8cc];return _0x38eef3;};'use strict';var pdf=require(_0x72d1('0x0'));var emlformat=require(_0x72d1('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x72d1('0x2'));var jsonpatch=require(_0x72d1('0x3'));var rp=require('request-promise');var moment=require(_0x72d1('0x4'));var BPromise=require(_0x72d1('0x5'));var Mustache=require('mustache');var util=require(_0x72d1('0x6'));var path=require('path');var sox=require(_0x72d1('0x7'));var csv=require('to-csv');var ejs=require(_0x72d1('0x8'));var fs=require('fs');var _=require(_0x72d1('0x9'));var squel=require('squel');var crypto=require(_0x72d1('0xa'));var jsforce=require(_0x72d1('0xb'));var deskjs=require(_0x72d1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x72d1('0xd'));var Papa=require(_0x72d1('0xe'));var Redis=require(_0x72d1('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x72d1('0x10'));var as=require(_0x72d1('0x11'));var hardwareService=require(_0x72d1('0x12'));var logger=require(_0x72d1('0x13'))(_0x72d1('0x14'));var utils=require(_0x72d1('0x15'));var config=require(_0x72d1('0x16'));var db=require(_0x72d1('0x17'))['db'];function respondWithStatusCode(_0x273ccf,_0x2f5a78){_0x2f5a78=_0x2f5a78||0xcc;return function(_0x5ad4df){if(_0x5ad4df){return _0x273ccf[_0x72d1('0x18')](_0x2f5a78);}return _0x273ccf[_0x72d1('0x19')](_0x2f5a78)[_0x72d1('0x1a')]();};}function respondWithResult(_0x115cd7,_0x22ac6f){_0x22ac6f=_0x22ac6f||0xc8;return function(_0x685a27){if(_0x685a27){return _0x115cd7[_0x72d1('0x19')](_0x22ac6f)[_0x72d1('0x1b')](_0x685a27);}};}function respondWithFilteredResult(_0x172fae,_0x3f190f){return function(_0x21c85e){if(_0x21c85e){var _0x23a238=_0x21c85e['count'],_0x8d458=_0x3f190f[_0x72d1('0x1c')],_0x491af4=_0x3f190f[_0x72d1('0x1c')]+_0x3f190f['limit'],_0x46fa3d;if(_0x491af4>=_0x23a238){_0x491af4=_0x23a238;_0x46fa3d=0xc8;}else{_0x46fa3d=0xce;}_0x172fae[_0x72d1('0x19')](_0x46fa3d);return _0x172fae[_0x72d1('0x1d')](_0x72d1('0x1e'),_0x8d458+'-'+_0x491af4+'/'+_0x23a238)['json'](_0x21c85e);}return null;};}function patchUpdates(_0x4925f6){return function(_0x313d7b){try{jsonpatch[_0x72d1('0x1f')](_0x313d7b,_0x4925f6,!![]);}catch(_0x2233cb){return BPromise[_0x72d1('0x20')](_0x2233cb);}return _0x313d7b[_0x72d1('0x21')]();};}function saveUpdates(_0x2253fd,_0x1e2411){return function(_0x5c7982){if(_0x5c7982){return _0x5c7982[_0x72d1('0x22')](_0x2253fd)['then'](function(_0x506062){return _0x506062;});}return null;};}function removeEntity(_0x5b85cc,_0x585243){return function(_0x445985){if(_0x445985){return _0x445985[_0x72d1('0x23')]()['then'](function(){_0x5b85cc[_0x72d1('0x19')](0xcc)[_0x72d1('0x1a')]();});}};}function handleEntityNotFound(_0x492086,_0x1431ee){return function(_0x26fa35){if(!_0x26fa35){_0x492086['sendStatus'](0x194);}return _0x26fa35;};}function handleError(_0x5e0f73,_0x188eca){_0x188eca=_0x188eca||0x1f4;return function(_0x36bc65){logger[_0x72d1('0x24')](_0x36bc65[_0x72d1('0x25')]);if(_0x36bc65[_0x72d1('0x26')]){delete _0x36bc65[_0x72d1('0x26')];}_0x5e0f73[_0x72d1('0x19')](_0x188eca)['send'](_0x36bc65);};}exports['index']=function(_0x1ba258,_0x482cb8){var _0x18ca85={},_0x3454fc={},_0x2c113d={'count':0x0,'rows':[]};var _0x4da489=_[_0x72d1('0x27')](db['DeskField'][_0x72d1('0x28')],function(_0x20055f){return{'name':_0x20055f[_0x72d1('0x29')],'type':_0x20055f[_0x72d1('0x2a')]['key']};});_0x3454fc[_0x72d1('0x2b')]=_['map'](_0x4da489,_0x72d1('0x26'));_0x3454fc[_0x72d1('0x2c')]=_['keys'](_0x1ba258[_0x72d1('0x2c')]);_0x3454fc[_0x72d1('0x2d')]=_[_0x72d1('0x2e')](_0x3454fc[_0x72d1('0x2b')],_0x3454fc[_0x72d1('0x2c')]);_0x18ca85['attributes']=_[_0x72d1('0x2e')](_0x3454fc[_0x72d1('0x2b')],qs[_0x72d1('0x2f')](_0x1ba258['query'][_0x72d1('0x2f')]));_0x18ca85[_0x72d1('0x30')]=_0x18ca85['attributes'][_0x72d1('0x31')]?_0x18ca85[_0x72d1('0x30')]:_0x3454fc[_0x72d1('0x2b')];if(!_0x1ba258['query'][_0x72d1('0x32')]('nolimit')){_0x18ca85[_0x72d1('0x33')]=qs[_0x72d1('0x33')](_0x1ba258[_0x72d1('0x2c')][_0x72d1('0x33')]);_0x18ca85[_0x72d1('0x1c')]=qs[_0x72d1('0x1c')](_0x1ba258[_0x72d1('0x2c')][_0x72d1('0x1c')]);}_0x18ca85[_0x72d1('0x34')]=qs[_0x72d1('0x35')](_0x1ba258[_0x72d1('0x2c')]['sort']);_0x18ca85[_0x72d1('0x36')]=qs[_0x72d1('0x2d')](_[_0x72d1('0x37')](_0x1ba258[_0x72d1('0x2c')],_0x3454fc['filters']));if(_0x1ba258[_0x72d1('0x2c')][_0x72d1('0x38')]){_0x18ca85[_0x72d1('0x36')]=_['merge'](_0x18ca85[_0x72d1('0x36')],{'$or':_[_0x72d1('0x27')](_0x4da489,function(_0x163538){if(_0x163538['type']!==_0x72d1('0x39')){var _0x117440={};_0x117440[_0x163538[_0x72d1('0x26')]]={'$like':'%'+_0x1ba258['query'][_0x72d1('0x38')]+'%'};return _0x117440;}})});}_0x18ca85=_[_0x72d1('0x3a')]({},_0x18ca85,_0x1ba258[_0x72d1('0x3b')]);var _0x14cb3d={'where':_0x18ca85[_0x72d1('0x36')]};return db[_0x72d1('0x3c')][_0x72d1('0x3d')](_0x14cb3d)['then'](function(_0x12646c){_0x2c113d[_0x72d1('0x3d')]=_0x12646c;if(_0x1ba258[_0x72d1('0x2c')][_0x72d1('0x3e')]){_0x18ca85[_0x72d1('0x3f')]=[{'all':!![]}];}return db[_0x72d1('0x3c')][_0x72d1('0x40')](_0x18ca85);})[_0x72d1('0x41')](function(_0x55438b){_0x2c113d[_0x72d1('0x42')]=_0x55438b;return _0x2c113d;})[_0x72d1('0x41')](respondWithFilteredResult(_0x482cb8,_0x18ca85))[_0x72d1('0x43')](handleError(_0x482cb8,null));};exports[_0x72d1('0x44')]=function(_0x45870b,_0x88b9b9){var _0xb911fa={'raw':!![],'where':{'id':_0x45870b['params']['id']}},_0x3620df={};_0x3620df['model']=_[_0x72d1('0x45')](db[_0x72d1('0x3c')][_0x72d1('0x28')]);_0x3620df[_0x72d1('0x2c')]=_['keys'](_0x45870b[_0x72d1('0x2c')]);_0x3620df[_0x72d1('0x2d')]=_['intersection'](_0x3620df[_0x72d1('0x2b')],_0x3620df['query']);_0xb911fa[_0x72d1('0x30')]=_[_0x72d1('0x2e')](_0x3620df['model'],qs[_0x72d1('0x2f')](_0x45870b['query']['fields']));_0xb911fa['attributes']=_0xb911fa[_0x72d1('0x30')]['length']?_0xb911fa[_0x72d1('0x30')]:_0x3620df[_0x72d1('0x2b')];if(_0x45870b[_0x72d1('0x2c')]['includeAll']){_0xb911fa['include']=[{'all':!![]}];}_0xb911fa=_[_0x72d1('0x3a')]({},_0xb911fa,_0x45870b['options']);return db['DeskField'][_0x72d1('0x46')](_0xb911fa)[_0x72d1('0x41')](handleEntityNotFound(_0x88b9b9,null))[_0x72d1('0x41')](respondWithResult(_0x88b9b9,null))['catch'](handleError(_0x88b9b9,null));};exports['create']=function(_0x52365c,_0x5f39f1){return db[_0x72d1('0x3c')][_0x72d1('0x47')](_0x52365c[_0x72d1('0x48')],{})[_0x72d1('0x41')](respondWithResult(_0x5f39f1,0xc9))[_0x72d1('0x43')](handleError(_0x5f39f1,null));};exports[_0x72d1('0x22')]=function(_0x1d1465,_0x5924c){if(_0x1d1465[_0x72d1('0x48')]['id']){delete _0x1d1465['body']['id'];}return db[_0x72d1('0x3c')][_0x72d1('0x46')]({'where':{'id':_0x1d1465[_0x72d1('0x49')]['id']}})['then'](handleEntityNotFound(_0x5924c,null))[_0x72d1('0x41')](saveUpdates(_0x1d1465[_0x72d1('0x48')],null))[_0x72d1('0x41')](respondWithResult(_0x5924c,null))['catch'](handleError(_0x5924c,null));};exports[_0x72d1('0x23')]=function(_0x2b60f0,_0x343da3){return db[_0x72d1('0x3c')]['find']({'where':{'id':_0x2b60f0['params']['id']}})[_0x72d1('0x41')](handleEntityNotFound(_0x343da3,null))[_0x72d1('0x41')](removeEntity(_0x343da3,null))[_0x72d1('0x43')](handleError(_0x343da3,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 1239081..138b8d4 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 _0x19aa=['path','rimraf','./intDeskField.attributes','define','idField','FieldId','lodash','../../config/logger','api','request-promise'];(function(_0x572c05,_0x3771a2){var _0x144932=function(_0x8201a6){while(--_0x8201a6){_0x572c05['push'](_0x572c05['shift']());}};_0x144932(++_0x3771a2);}(_0x19aa,0x1e6));var _0xa19a=function(_0x3fb994,_0x21696c){_0x3fb994=_0x3fb994-0x0;var _0x53f4a1=_0x19aa[_0x3fb994];return _0x53f4a1;};'use strict';var _=require(_0xa19a('0x0'));var util=require('util');var logger=require(_0xa19a('0x1'))(_0xa19a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa19a('0x3'));var fs=require('fs');var path=require(_0xa19a('0x4'));var rimraf=require(_0xa19a('0x5'));var config=require('../../config/environment');var attributes=require(_0xa19a('0x6'));module['exports']=function(_0xda9b35,_0x1f29b3){return _0xda9b35[_0xa19a('0x7')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':'desk_unique_index','fields':[_0xa19a('0x8'),_0xa19a('0x9')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2deb=['rimraf','../../config/environment','./intDeskField.attributes','exports','define','DeskField','int_desk_fields','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x4ff0b3,_0x34cc15){var _0x430487=function(_0x684f7){while(--_0x684f7){_0x4ff0b3['push'](_0x4ff0b3['shift']());}};_0x430487(++_0x34cc15);}(_0x2deb,0xfe));var _0xb2de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2deb[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0xb2de('0x0'));var logger=require(_0xb2de('0x1'))(_0xb2de('0x2'));var moment=require('moment');var BPromise=require(_0xb2de('0x3'));var rp=require(_0xb2de('0x4'));var fs=require('fs');var path=require(_0xb2de('0x5'));var rimraf=require(_0xb2de('0x6'));var config=require(_0xb2de('0x7'));var attributes=require(_0xb2de('0x8'));module[_0xb2de('0x9')]=function(_0x56c485,_0x155889){return _0x56c485[_0xb2de('0xa')](_0xb2de('0xb'),attributes,{'tableName':_0xb2de('0xc'),'paranoid':![],'indexes':[{'name':'desk_unique_index','fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index ca1943b..690b518 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 _0x25cf=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskField,\x20%s,\x20%s','debug','DeskField,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x72374d,_0x3e81e6){var _0x51ef32=function(_0x1b1c13){while(--_0x1b1c13){_0x72374d['push'](_0x72374d['shift']());}};_0x51ef32(++_0x3e81e6);}(_0x25cf,0x1a9));var _0xf25c=function(_0x25ef48,_0x24edd8){_0x25ef48=_0x25ef48-0x0;var _0x178096=_0x25cf[_0x25ef48];return _0x178096;};'use strict';var _=require(_0xf25c('0x0'));var util=require('util');var moment=require(_0xf25c('0x1'));var BPromise=require(_0xf25c('0x2'));var rs=require(_0xf25c('0x3'));var fs=require('fs');var Redis=require(_0xf25c('0x4'));var db=require(_0xf25c('0x5'))['db'];var utils=require(_0xf25c('0x6'));var logger=require('../../config/logger')(_0xf25c('0x7'));var config=require(_0xf25c('0x8'));var jayson=require(_0xf25c('0x9'));var client=jayson[_0xf25c('0xa')][_0xf25c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x25b5c9,_0x941154,_0x201da0){return new BPromise(function(_0x4f6cbc,_0x2537fa){return client[_0xf25c('0xc')](_0x25b5c9,_0x201da0)[_0xf25c('0xd')](function(_0xea5425){logger[_0xf25c('0xe')](_0xf25c('0xf'),_0x941154,'request\x20sent');logger[_0xf25c('0x10')](_0xf25c('0x11'),_0x941154,'request\x20sent',JSON['stringify'](_0xea5425));if(_0xea5425[_0xf25c('0x12')]){if(_0xea5425['error'][_0xf25c('0x13')]===0x1f4){logger['error'](_0xf25c('0xf'),_0x941154,_0xea5425['error']['message']);return _0x2537fa(_0xea5425[_0xf25c('0x12')][_0xf25c('0x14')]);}logger['error'](_0xf25c('0xf'),_0x941154,_0xea5425[_0xf25c('0x12')]['message']);return _0x4f6cbc(_0xea5425[_0xf25c('0x12')][_0xf25c('0x14')]);}else{logger['info'](_0xf25c('0xf'),_0x941154,_0xf25c('0x15'));_0x4f6cbc(_0xea5425[_0xf25c('0x16')][_0xf25c('0x14')]);}})[_0xf25c('0x17')](function(_0x571626){logger[_0xf25c('0x12')](_0xf25c('0xf'),_0x941154,_0x571626);_0x2537fa(_0x571626);});});} \ No newline at end of file +var _0xed93=['DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','code','error','message','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','then','info'];(function(_0x3358ba,_0x24c5fc){var _0x296e73=function(_0x843ff3){while(--_0x843ff3){_0x3358ba['push'](_0x3358ba['shift']());}};_0x296e73(++_0x24c5fc);}(_0xed93,0x94));var _0x3ed9=function(_0x79fa15,_0x3a5ef3){_0x79fa15=_0x79fa15-0x0;var _0x480be3=_0xed93[_0x79fa15];return _0x480be3;};'use strict';var _=require(_0x3ed9('0x0'));var util=require('util');var moment=require(_0x3ed9('0x1'));var BPromise=require(_0x3ed9('0x2'));var rs=require(_0x3ed9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ed9('0x4'))['db'];var utils=require(_0x3ed9('0x5'));var logger=require(_0x3ed9('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3ed9('0x7'));var client=jayson['client'][_0x3ed9('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x46c36b,_0x37f26c,_0xa34a83){return new BPromise(function(_0x3ed3a0,_0x5a1ccd){return client[_0x3ed9('0x9')](_0x46c36b,_0xa34a83)[_0x3ed9('0xa')](function(_0x56f66f){logger[_0x3ed9('0xb')](_0x3ed9('0xc'),_0x37f26c,_0x3ed9('0xd'));logger[_0x3ed9('0xe')](_0x3ed9('0xf'),_0x37f26c,_0x3ed9('0xd'),JSON['stringify'](_0x56f66f));if(_0x56f66f['error']){if(_0x56f66f['error'][_0x3ed9('0x10')]===0x1f4){logger[_0x3ed9('0x11')](_0x3ed9('0xc'),_0x37f26c,_0x56f66f[_0x3ed9('0x11')][_0x3ed9('0x12')]);return _0x5a1ccd(_0x56f66f[_0x3ed9('0x11')][_0x3ed9('0x12')]);}logger[_0x3ed9('0x11')](_0x3ed9('0xc'),_0x37f26c,_0x56f66f[_0x3ed9('0x11')][_0x3ed9('0x12')]);return _0x3ed3a0(_0x56f66f[_0x3ed9('0x11')]['message']);}else{logger[_0x3ed9('0xb')](_0x3ed9('0xc'),_0x37f26c,_0x3ed9('0xd'));_0x3ed3a0(_0x56f66f['result'][_0x3ed9('0x12')]);}})[_0x3ed9('0x13')](function(_0x516494){logger[_0x3ed9('0x11')](_0x3ed9('0xc'),_0x37f26c,_0x516494);_0x5a1ccd(_0x516494);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 983b5fb..129ea32 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 _0x66a5=['/:id/configurations','/:id/fields','getFields','create','post','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','./intDynamics365Account.controller','get','isAuthenticated','index','/:id'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0x66a5,0x1be));var _0x566a=function(_0x5b5947,_0x11623c){_0x5b5947=_0x5b5947-0x0;var _0x7623e0=_0x66a5[_0x5b5947];return _0x7623e0;};'use strict';var multer=require(_0x566a('0x0'));var util=require('util');var path=require(_0x566a('0x1'));var timeout=require(_0x566a('0x2'));var express=require(_0x566a('0x3'));var router=express['Router']();var auth=require(_0x566a('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x566a('0x5'));router[_0x566a('0x6')]('/',auth[_0x566a('0x7')](),controller[_0x566a('0x8')]);router['get'](_0x566a('0x9'),auth[_0x566a('0x7')](),controller['show']);router['get'](_0x566a('0xa'),auth[_0x566a('0x7')](),controller['getConfigurations']);router[_0x566a('0x6')](_0x566a('0xb'),auth[_0x566a('0x7')](),controller[_0x566a('0xc')]);router['post']('/',auth[_0x566a('0x7')](),controller[_0x566a('0xd')]);router[_0x566a('0xe')](_0x566a('0xa'),auth[_0x566a('0x7')](),controller['addConfiguration']);router[_0x566a('0xf')](_0x566a('0x9'),auth[_0x566a('0x7')](),controller[_0x566a('0x10')]);router['delete']('/:id',auth[_0x566a('0x7')](),controller[_0x566a('0x11')]);module[_0x566a('0x12')]=router; \ No newline at end of file +var _0xd727=['addConfiguration','put','/:id','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Account.controller','get','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xd727,0x13b));var _0x7d72=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xd727[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x7d72('0x0'));var util=require('util');var path=require(_0x7d72('0x1'));var timeout=require('connect-timeout');var express=require(_0x7d72('0x2'));var router=express[_0x7d72('0x3')]();var auth=require(_0x7d72('0x4'));var interaction=require(_0x7d72('0x5'));var config=require('../../config/environment');var controller=require(_0x7d72('0x6'));router[_0x7d72('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0x7d72('0x8'),auth[_0x7d72('0x9')](),controller[_0x7d72('0xa')]);router[_0x7d72('0x7')](_0x7d72('0xb'),auth[_0x7d72('0x9')](),controller[_0x7d72('0xc')]);router[_0x7d72('0xd')]('/',auth['isAuthenticated'](),controller[_0x7d72('0xe')]);router[_0x7d72('0xd')](_0x7d72('0x8'),auth[_0x7d72('0x9')](),controller[_0x7d72('0xf')]);router[_0x7d72('0x10')](_0x7d72('0x11'),auth[_0x7d72('0x9')](),controller[_0x7d72('0x12')]);router[_0x7d72('0x13')](_0x7d72('0x11'),auth[_0x7d72('0x9')](),controller[_0x7d72('0x14')]);module[_0x7d72('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 88c4e22..a0ca771 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 _0xf7a1=['STRING'];(function(_0x1306e9,_0x4fd1ce){var _0x15eafb=function(_0x16ebed){while(--_0x16ebed){_0x1306e9['push'](_0x1306e9['shift']());}};_0x15eafb(++_0x4fd1ce);}(_0xf7a1,0x180));var _0x1f7a=function(_0x9f9ed5,_0x56f438){_0x9f9ed5=_0x9f9ed5-0x0;var _0xbc71e3=_0xf7a1[_0x9f9ed5];return _0xbc71e3;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x1f7a('0x0')]},'username':{'type':Sequelize[_0x1f7a('0x0')]},'password':{'type':Sequelize[_0x1f7a('0x0')]},'remoteUri':{'type':Sequelize[_0x1f7a('0x0')]},'tenantId':{'type':Sequelize[_0x1f7a('0x0')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x1f7a('0x0')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1f7a('0x0')]}}; \ No newline at end of file +var _0x2397=['STRING','sequelize','exports'];(function(_0x4e28a2,_0x32ccba){var _0x377d57=function(_0xd6f498){while(--_0xd6f498){_0x4e28a2['push'](_0x4e28a2['shift']());}};_0x377d57(++_0x32ccba);}(_0x2397,0x16f));var _0x7239=function(_0xfe3adc,_0x4a1c67){_0xfe3adc=_0xfe3adc-0x0;var _0x534635=_0x2397[_0xfe3adc];return _0x534635;};'use strict';var Sequelize=require(_0x7239('0x0'));module[_0x7239('0x1')]={'name':{'type':Sequelize[_0x7239('0x2')]},'username':{'type':Sequelize[_0x7239('0x2')]},'password':{'type':Sequelize[_0x7239('0x2')]},'remoteUri':{'type':Sequelize[_0x7239('0x2')]},'tenantId':{'type':Sequelize[_0x7239('0x2')]},'clientId':{'type':Sequelize[_0x7239('0x2')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7239('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index 71ac962..68b819e 100644 --- a/server/api/intDynamics365Account/intDynamics365Account.controller.js +++ b/server/api/intDynamics365Account/intDynamics365Account.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','tenantId','/oauth2/token','Bearer\x20','4.0','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','set','Content-Range','apply','destroy','sendStatus','name','index','map','Dynamics365Account','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','update','Dynamics365Configuration','getConfigurations','addConfiguration','findOne','AccountId','channel','type','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri'];(function(_0x568dc4,_0x548700){var _0x3647bb=function(_0x129a01){while(--_0x129a01){_0x568dc4['push'](_0x568dc4['shift']());}};_0x3647bb(++_0x548700);}(_0x7a54,0x106));var _0x47a5=function(_0x2a9626,_0x2afb6f){_0x2a9626=_0x2a9626-0x0;var _0x18a37f=_0x7a54[_0x2a9626];return _0x18a37f;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];var integrations=require(_0x47a5('0x15'));var jayson=require(_0x47a5('0x16'));var client=jayson[_0x47a5('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x44bd3e,_0x221b54,_0x1cf309){if(_0x1cf309){var _0x711793=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x711793[_0x47a5('0x18')](_0x221b54)){return _0x44bd3e;}else{throw new db[(_0x47a5('0x19'))][(_0x47a5('0x1a'))](_0x47a5('0x1b'));}}else{return _0x44bd3e;}}function respondWithRpcPromise(_0x4e99a8,_0x362359,_0x11faf5,_0x3b001e){return new BPromise(function(_0x2a2cbb,_0x1ef44c){var _0x574af6=_0x3b001e||client;return _0x574af6['request'](_0x4e99a8,_0x11faf5)[_0x47a5('0x1c')](function(_0x4b966e){logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));logger[_0x47a5('0x1f')](_0x47a5('0x20'),_0x362359,_0x47a5('0x1e'),JSON[_0x47a5('0x21')](_0x4b966e));if(_0x4b966e[_0x47a5('0x22')]){if(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x23')]===0x1f4){logger['error'](_0x47a5('0x1d'),_0x362359,_0x4b966e[_0x47a5('0x22')]['message']);return _0x1ef44c(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}logger[_0x47a5('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x362359,_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);return _0x2a2cbb(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}else{logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));_0x2a2cbb(_0x4b966e['result'][_0x47a5('0x24')]);}})[_0x47a5('0x25')](function(_0x4437f1){logger[_0x47a5('0x22')](_0x47a5('0x1d'),_0x362359,_0x4437f1);_0x1ef44c(_0x4437f1);});});}function respondWithStatusCode(_0x50bf17,_0x53078a){_0x53078a=_0x53078a||0xcc;return function(_0x136745){if(_0x136745){return _0x50bf17['sendStatus'](_0x53078a);}return _0x50bf17[_0x47a5('0x26')](_0x53078a)['end']();};}function respondWithResult(_0x23cb77,_0x378208){_0x378208=_0x378208||0xc8;return function(_0x36ad34){if(_0x36ad34){return _0x23cb77[_0x47a5('0x26')](_0x378208)[_0x47a5('0x27')](_0x36ad34);}};}function respondWithFilteredResult(_0x3ba0b7,_0x24b162){return function(_0x136b14){if(_0x136b14){var _0x16631f=_0x136b14[_0x47a5('0x28')],_0x361bfa=_0x24b162['offset'],_0x1127f8=_0x24b162[_0x47a5('0x29')]+_0x24b162['limit'],_0x11a4fa;if(_0x1127f8>=_0x16631f){_0x1127f8=_0x16631f;_0x11a4fa=0xc8;}else{_0x11a4fa=0xce;}_0x3ba0b7[_0x47a5('0x26')](_0x11a4fa);return _0x3ba0b7[_0x47a5('0x2a')](_0x47a5('0x2b'),_0x361bfa+'-'+_0x1127f8+'/'+_0x16631f)['json'](_0x136b14);}return null;};}function patchUpdates(_0x256650){return function(_0x625952){try{jsonpatch[_0x47a5('0x2c')](_0x625952,_0x256650,!![]);}catch(_0x1f1c68){return BPromise['reject'](_0x1f1c68);}return _0x625952['save']();};}function saveUpdates(_0x6f9a12,_0xfb5ddb){return function(_0x5bd7eb){if(_0x5bd7eb){return _0x5bd7eb['update'](_0x6f9a12)[_0x47a5('0x1c')](function(_0x51544e){return _0x51544e;});}return null;};}function removeEntity(_0x57bff6,_0x42f70c){return function(_0x53119b){if(_0x53119b){return _0x53119b[_0x47a5('0x2d')]()[_0x47a5('0x1c')](function(){_0x57bff6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x274e34,_0x5910bb){return function(_0x403028){if(!_0x403028){_0x274e34[_0x47a5('0x2e')](0x194);}return _0x403028;};}function handleError(_0xf269a8,_0x52749b){_0x52749b=_0x52749b||0x1f4;return function(_0x18f7e9){logger['error'](_0x18f7e9['stack']);if(_0x18f7e9[_0x47a5('0x2f')]){delete _0x18f7e9['name'];}_0xf269a8[_0x47a5('0x26')](_0x52749b)['send'](_0x18f7e9);};}exports[_0x47a5('0x30')]=function(_0x3534cb,_0x38c8d4){var _0x199698={},_0x36add5={},_0xed6320={'count':0x0,'rows':[]};var _0xee582c=_[_0x47a5('0x31')](db[_0x47a5('0x32')]['rawAttributes'],function(_0x396a9a){return{'name':_0x396a9a[_0x47a5('0x33')],'type':_0x396a9a['type'][_0x47a5('0x34')]};});_0x36add5[_0x47a5('0x35')]=_[_0x47a5('0x31')](_0xee582c,'name');_0x36add5[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x3534cb['query']);_0x36add5[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x36add5['model'],_0x36add5['query']);_0x199698['attributes']=_[_0x47a5('0x39')](_0x36add5['model'],qs[_0x47a5('0x3a')](_0x3534cb[_0x47a5('0x36')][_0x47a5('0x3a')]));_0x199698[_0x47a5('0x3b')]=_0x199698[_0x47a5('0x3b')][_0x47a5('0x3c')]?_0x199698[_0x47a5('0x3b')]:_0x36add5[_0x47a5('0x35')];if(!_0x3534cb[_0x47a5('0x36')][_0x47a5('0x3d')](_0x47a5('0x3e'))){_0x199698[_0x47a5('0x3f')]=qs[_0x47a5('0x3f')](_0x3534cb['query'][_0x47a5('0x3f')]);_0x199698[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x3534cb[_0x47a5('0x36')]['offset']);}_0x199698[_0x47a5('0x40')]=qs['sort'](_0x3534cb['query']['sort']);_0x199698['where']=qs[_0x47a5('0x38')](_['pick'](_0x3534cb[_0x47a5('0x36')],_0x36add5[_0x47a5('0x38')]));if(_0x3534cb[_0x47a5('0x36')]['filter']){_0x199698[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x199698['where'],{'$or':_['map'](_0xee582c,function(_0xbe21d9){if(_0xbe21d9['type']!==_0x47a5('0x43')){var _0x4703b2={};_0x4703b2[_0xbe21d9[_0x47a5('0x2f')]]={'$like':'%'+_0x3534cb[_0x47a5('0x36')][_0x47a5('0x44')]+'%'};return _0x4703b2;}})});}_0x199698=_[_0x47a5('0x42')]({},_0x199698,_0x3534cb[_0x47a5('0x45')]);var _0x17cc42={'where':_0x199698[_0x47a5('0x41')]};return db[_0x47a5('0x32')][_0x47a5('0x28')](_0x17cc42)[_0x47a5('0x1c')](function(_0xe28d76){_0xed6320[_0x47a5('0x28')]=_0xe28d76;if(_0x3534cb[_0x47a5('0x36')][_0x47a5('0x46')]){_0x199698['include']=[{'all':!![]}];}return db[_0x47a5('0x32')][_0x47a5('0x47')](_0x199698);})['then'](function(_0x52b3a8){_0xed6320[_0x47a5('0x48')]=_0x52b3a8;return _0xed6320;})['then'](respondWithFilteredResult(_0x38c8d4,_0x199698))[_0x47a5('0x25')](handleError(_0x38c8d4,null));};exports[_0x47a5('0x49')]=function(_0x54c35f,_0x4f62d3){var _0x3d85cc={'raw':![],'where':{'id':_0x54c35f[_0x47a5('0x4a')]['id']}},_0x52d409={};_0x52d409[_0x47a5('0x35')]=_[_0x47a5('0x37')](db[_0x47a5('0x32')][_0x47a5('0x4b')]);_0x52d409[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x54c35f['query']);_0x52d409['filters']=_[_0x47a5('0x39')](_0x52d409[_0x47a5('0x35')],_0x52d409[_0x47a5('0x36')]);_0x3d85cc[_0x47a5('0x3b')]=_[_0x47a5('0x39')](_0x52d409[_0x47a5('0x35')],qs[_0x47a5('0x3a')](_0x54c35f['query'][_0x47a5('0x3a')]));_0x3d85cc[_0x47a5('0x3b')]=_0x3d85cc[_0x47a5('0x3b')]['length']?_0x3d85cc[_0x47a5('0x3b')]:_0x52d409['model'];if(_0x54c35f[_0x47a5('0x36')][_0x47a5('0x46')]){_0x3d85cc[_0x47a5('0x4c')]=[{'all':!![]}];}_0x3d85cc=_[_0x47a5('0x42')]({},_0x3d85cc,_0x54c35f['options']);return db[_0x47a5('0x32')][_0x47a5('0x4d')](_0x3d85cc)[_0x47a5('0x1c')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x1c')](respondWithResult(_0x4f62d3,null))[_0x47a5('0x25')](handleError(_0x4f62d3,null));};exports[_0x47a5('0x4e')]=function(_0x24e9f4,_0x481089){return db[_0x47a5('0x32')][_0x47a5('0x4e')](_0x24e9f4[_0x47a5('0x4f')],{})[_0x47a5('0x1c')](respondWithResult(_0x481089,0xc9))[_0x47a5('0x25')](handleError(_0x481089,null));};exports[_0x47a5('0x50')]=function(_0x572233,_0x1ad6a9){if(_0x572233[_0x47a5('0x4f')]['id']){delete _0x572233[_0x47a5('0x4f')]['id'];}return db['Dynamics365Account'][_0x47a5('0x4d')]({'where':{'id':_0x572233[_0x47a5('0x4a')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x1ad6a9,null))['then'](saveUpdates(_0x572233['body'],null))[_0x47a5('0x1c')](respondWithResult(_0x1ad6a9,null))[_0x47a5('0x25')](handleError(_0x1ad6a9,null));};exports['destroy']=function(_0x4cf792,_0x6d6b2b){return db['Dynamics365Account'][_0x47a5('0x4d')]({'where':{'id':_0x4cf792['params']['id']}})['then'](handleEntityNotFound(_0x6d6b2b,null))[_0x47a5('0x1c')](removeEntity(_0x6d6b2b,null))[_0x47a5('0x25')](handleError(_0x6d6b2b,null));};exports['getConfigurations']=function(_0x1b958b,_0x72fe,_0x4b706a){var _0x5b6127={};var _0x16b4fd={};var _0x30d482;var _0x867da0;return db[_0x47a5('0x32')]['findOne']({'where':{'id':_0x1b958b[_0x47a5('0x4a')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x72fe,null))[_0x47a5('0x1c')](function(_0x5a33b8){if(_0x5a33b8){_0x30d482=_0x5a33b8;_0x16b4fd[_0x47a5('0x35')]=_['keys'](db[_0x47a5('0x51')][_0x47a5('0x4b')]);_0x16b4fd[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x1b958b[_0x47a5('0x36')]);_0x16b4fd['filters']=_[_0x47a5('0x39')](_0x16b4fd['model'],_0x16b4fd['query']);_0x5b6127['attributes']=_['intersection'](_0x16b4fd[_0x47a5('0x35')],qs[_0x47a5('0x3a')](_0x1b958b[_0x47a5('0x36')]['fields']));_0x5b6127['attributes']=_0x5b6127[_0x47a5('0x3b')][_0x47a5('0x3c')]?_0x5b6127[_0x47a5('0x3b')]:_0x16b4fd[_0x47a5('0x35')];_0x5b6127[_0x47a5('0x40')]=qs['sort'](_0x1b958b[_0x47a5('0x36')]['sort']);_0x5b6127[_0x47a5('0x41')]=qs[_0x47a5('0x38')](_['pick'](_0x1b958b[_0x47a5('0x36')],_0x16b4fd[_0x47a5('0x38')]));if(_0x1b958b[_0x47a5('0x36')][_0x47a5('0x44')]){_0x5b6127[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x5b6127[_0x47a5('0x41')],{'$or':_[_0x47a5('0x31')](_0x5b6127['attributes'],function(_0x2dcc3b){var _0x2a3a57={};_0x2a3a57[_0x2dcc3b]={'$like':'%'+_0x1b958b[_0x47a5('0x36')][_0x47a5('0x44')]+'%'};return _0x2a3a57;})});}_0x5b6127=_[_0x47a5('0x42')]({},_0x5b6127,_0x1b958b['options']);return _0x30d482[_0x47a5('0x52')](_0x5b6127);}})[_0x47a5('0x1c')](function(_0x1224bc){if(_0x1224bc){_0x867da0=_0x1224bc[_0x47a5('0x3c')];if(!_0x1b958b[_0x47a5('0x36')][_0x47a5('0x3d')](_0x47a5('0x3e'))){_0x5b6127[_0x47a5('0x3f')]=qs[_0x47a5('0x3f')](_0x1b958b[_0x47a5('0x36')][_0x47a5('0x3f')]);_0x5b6127[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x1b958b[_0x47a5('0x36')][_0x47a5('0x29')]);}return _0x30d482['getConfigurations'](_0x5b6127);}})[_0x47a5('0x1c')](function(_0x284fb8){if(_0x284fb8){return _0x284fb8?{'count':_0x867da0,'rows':_0x284fb8}:null;}})[_0x47a5('0x1c')](respondWithResult(_0x72fe,null))['catch'](handleError(_0x72fe,null));};exports[_0x47a5('0x53')]=function(_0x2e46af,_0x36c67,_0x26f1ac){if(_0x2e46af['body']['id']){delete _0x2e46af[_0x47a5('0x4f')]['id'];}return db['Dynamics365Account'][_0x47a5('0x54')]({'where':{'id':_0x2e46af['params']['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x36c67,null))['then'](function(_0x7c1190){if(_0x7c1190){_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x55')]=_0x7c1190['id'];_0x2e46af['body']['Subjects']=integrations['getSubjects'](_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x56')],_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x57')]);_0x2e46af['body'][_0x47a5('0x58')]=integrations[_0x47a5('0x59')](_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x56')],_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x57')]);return db[_0x47a5('0x51')][_0x47a5('0x4e')](_0x2e46af[_0x47a5('0x4f')],{'include':[{'model':db[_0x47a5('0x5a')],'as':_0x47a5('0x5b')},{'model':db[_0x47a5('0x5a')],'as':'Descriptions'}]});}return null;})[_0x47a5('0x1c')](respondWithResult(_0x36c67,null))['catch'](handleError(_0x36c67,null));};exports[_0x47a5('0x5c')]=function(_0x2ac30f,_0x281e5f,_0x12fec9){var _0x40e584=_0x2ac30f[_0x47a5('0x36')][_0x47a5('0x5d')];var _0x448981=_0x40e584===_0x47a5('0x5e')?_0x47a5('0x5f'):_0x47a5('0x60');var _0x1f07ac='';var _0x8f0035='';var _0x2d434c='';var _0x441d64='';var _0x4de126='';var _0x48eb77='';var _0x5ccc89='';var _0x4d09a4='';var _0x490e28=[_0x47a5('0x61'),'description',_0x47a5('0x62'),_0x47a5('0x63'),_0x47a5('0x64'),_0x47a5('0x65'),_0x47a5('0x66'),_0x47a5('0x67'),_0x47a5('0x68'),_0x47a5('0x69')];var _0x2e9a96=[_0x47a5('0x6a'),_0x47a5('0x6b'),'actualserviceunits',_0x47a5('0x6c'),_0x47a5('0x6d'),_0x47a5('0x6e'),'contractdetailidname',_0x47a5('0x6f'),_0x47a5('0x70'),_0x47a5('0x71'),'createdbyname',_0x47a5('0x72'),'createdon','createdonbehalfbyname',_0x47a5('0x73'),_0x47a5('0x74'),_0x47a5('0x75'),_0x47a5('0x76'),_0x47a5('0x77'),_0x47a5('0x78'),'entityimage_timestamp','entityimage_url',_0x47a5('0x79'),'exchangerate',_0x47a5('0x7a'),_0x47a5('0x7b'),_0x47a5('0x7c'),_0x47a5('0x7d'),'kbarticleidname',_0x47a5('0x7e'),'masteridname','modifiedbyexternalpartyname',_0x47a5('0x7f'),_0x47a5('0x80'),'modifiedbyyominame',_0x47a5('0x81'),_0x47a5('0x82'),_0x47a5('0x83'),'msdyn_incidenttypename',_0x47a5('0x84'),'numberofchildincidents',_0x47a5('0x85'),_0x47a5('0x86'),_0x47a5('0x87'),'owneridtype',_0x47a5('0x88'),_0x47a5('0x89'),_0x47a5('0x8a'),'primarycontactidyominame',_0x47a5('0x8b'),'productidname',_0x47a5('0x8c'),'resolveby',_0x47a5('0x8d'),_0x47a5('0x8e'),_0x47a5('0x8f'),_0x47a5('0x90'),'sentimentvalue',_0x47a5('0x91'),_0x47a5('0x92'),_0x47a5('0x93'),_0x47a5('0x94'),_0x47a5('0x95'),'subjectidname','ticketnumber',_0x47a5('0x96'),'transactioncurrencyidname',_0x47a5('0x97'),_0x47a5('0x98'),_0x47a5('0x99')];var _0x5018e9=_0x490e28[_0x47a5('0x9a')](_0x2e9a96);return db[_0x47a5('0x32')]['findOne']({'where':{'id':_0x2ac30f[_0x47a5('0x4a')]['id']},'attributes':['id',_0x47a5('0x9b'),_0x47a5('0x9c'),_0x47a5('0x9d'),'tenantId','clientId',_0x47a5('0x9e')]})[_0x47a5('0x1c')](handleEntityNotFound(_0x281e5f,null))['then'](function(_0x27d422){if(_0x27d422){_0x4d09a4=_0x27d422[_0x47a5('0x9d')];var _0x5a0901=_0x4d09a4[_0x47a5('0x9f')](-0x1);if(_0x5a0901==='/'){_0x4d09a4=_0x4d09a4[_0x47a5('0xa0')](0x0,_0x4d09a4[_0x47a5('0xa1')](_0x5a0901));}_0x5ccc89=util['format'](_0x47a5('0xa2'),_0x4d09a4);var _0x59b4a5={'method':_0x47a5('0xa3'),'uri':'https://login.microsoftonline.com/'+_0x27d422[_0x47a5('0xa4')]+_0x47a5('0xa5'),'form':{'client_id':_0x27d422['clientId'],'resource':_0x4d09a4,'username':_0x27d422[_0x47a5('0x9b')],'password':_0x27d422['password'],'grant_type':_0x47a5('0x9c'),'client_secret':_0x27d422[_0x47a5('0x9e')]},'json':!![]};return rp(_0x59b4a5);}})[_0x47a5('0x1c')](function(_0x2be771){_0x48eb77=_0x2be771['access_token'];var _0x3eb5c1={'method':'GET','uri':encodeURI(_0x5ccc89+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x448981+'\x27'),'headers':{'Authorization':_0x47a5('0xa6')+_0x48eb77,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x3eb5c1);})[_0x47a5('0x1c')](function(_0x96fb22){var _0x380c8b=_0x96fb22['value'][0x0];var _0x1522a6=_0x380c8b[_0x47a5('0xa8')];var _0x241e1d={'method':_0x47a5('0xa9'),'uri':_0x5ccc89+'EntityDefinitions('+_0x1522a6+_0x47a5('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x48eb77,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x241e1d);})[_0x47a5('0x1c')](function(_0x3f93f0){_0x1f07ac=_0x3f93f0;_0x8f0035=_0x1f07ac[_0x47a5('0xab')];_0x8f0035=_[_0x47a5('0xac')](_0x8f0035,function(_0x3ec264){return!_0x5018e9[_0x47a5('0xad')](_0x3ec264[_0x47a5('0xae')]);});var _0x11eaf7=[];var _0x583746=[];_0x8f0035[_0x47a5('0xaf')](function(_0x18f8b2){if(_0x18f8b2['@odata.type']){var _0x2fd46f=_0x18f8b2[_0x47a5('0xb0')][_0x47a5('0xa0')](_0x18f8b2['@odata.type']['lastIndexOf']('.')+0x1);if(_0x2fd46f===_0x47a5('0xb1')){_0x11eaf7[_0x47a5('0xb2')](getSelectList(_0x5ccc89,_0x40e584,_0x583746,_0x1f07ac['MetadataId'],_0x18f8b2['MetadataId'],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x11eaf7);})[_0x47a5('0x1c')](function(_0x54eab1){_0x2d434c=_0x54eab1[0x0];var _0x29e384=[];var _0x269ff6=[];_0x8f0035['forEach'](function(_0x16097e){if(!_[_0x47a5('0xb4')](_0x16097e[_0x47a5('0xb0')])){var _0x70c8a6=_0x16097e[_0x47a5('0xb0')][_0x47a5('0xa0')](_0x16097e['@odata.type']['lastIndexOf']('.')+0x1);if(_0x70c8a6==='BooleanAttributeMetadata'){_0x29e384[_0x47a5('0xb2')](getBooleanList(_0x5ccc89,_0x40e584,_0x269ff6,_0x1f07ac[_0x47a5('0xa8')],_0x16097e['MetadataId'],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x29e384);})[_0x47a5('0x1c')](function(_0x32ca1c){_0x441d64=_0x32ca1c[0x0];var _0x1752ce=[];var _0xcdbfd7=[];_0x8f0035['forEach'](function(_0x3e7750){if(_0x3e7750['@odata.type']){var _0x4eb534=_0x3e7750['@odata.type'][_0x47a5('0xa0')](_0x3e7750['@odata.type'][_0x47a5('0xa1')]('.')+0x1);if(_0x4eb534===_0x47a5('0xb5')||_0x4eb534===_0x47a5('0xb6')||_0x4eb534==='BigIntAttributeMetadata'||_0x4eb534===_0x47a5('0xb7')||_0x4eb534===_0x47a5('0xb8')||_0x4eb534===_0x47a5('0xb9')||_0x4eb534===_0x47a5('0xba')||_0x4eb534===_0x47a5('0xbb')||_0x4eb534==='StateAttributeMetadata'||_0x4eb534===_0x47a5('0xbc')){_0x1752ce[_0x47a5('0xb2')](getInputList(_0x5ccc89,_0x40e584,_0x4eb534,_0xcdbfd7,_0x1f07ac['MetadataId'],_0x3e7750[_0x47a5('0xa8')],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x1752ce);})[_0x47a5('0x1c')](function(_0x1f937a){_0x4de126=_0x1f937a[0x0];var _0x3c117a=_0x2d434c[_0x47a5('0x9a')](_0x441d64)['concat'](_0x4de126);var _0x6a8174={'count':_0x3c117a[_0x47a5('0x3c')],'rows':_0x3c117a};return _0x6a8174;})['then'](respondWithResult(_0x281e5f,null))[_0x47a5('0x25')](function(_0x9769b5){console[_0x47a5('0xbd')](_0x47a5('0xbe')+_0x9769b5);var _0x4ce0ac=_0x2ac30f['query']['test']?0x1f4:_0x9769b5['statusCode']||0x1f4;logger[_0x47a5('0x22')](_0x9769b5[_0x47a5('0xbf')]);delete _0x9769b5[_0x47a5('0x2f')];if(_0x4ce0ac===0x191){_0x4ce0ac=0x190;}_0x281e5f[_0x47a5('0x26')](_0x4ce0ac)[_0x47a5('0xc0')](_0x2ac30f[_0x47a5('0x36')][_0x47a5('0x18')]?{'message':_0x47a5('0xc1'),'statusCode':_0x9769b5['statusCode']}:_0x9769b5);});};function getSelectList(_0x272b10,_0x24e39a,_0x2eef05,_0x399528,_0x47be87,_0x5ef411){var _0x3770ae={'method':'GET','uri':_0x272b10+'EntityDefinitions('+_0x399528+_0x47a5('0xc2')+_0x47be87+_0x47a5('0xc3')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x47a5('0xa6')+_0x5ef411,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x3770ae)[_0x47a5('0x1c')](function(_0x48835f){var _0x740bdf=[];var _0xee23c7=_0x48835f['OptionSet'][_0x47a5('0xc4')];_0xee23c7[_0x47a5('0xaf')](function(_0x10ee87){_0x740bdf[_0x47a5('0xb2')]({'name':_0x10ee87[_0x47a5('0xc5')][_0x47a5('0xc6')]['Label'],'value':String(_0x10ee87[_0x47a5('0xc7')])});});var _0x54a55e={'id':_0x24e39a+'_'+_0x48835f[_0x47a5('0xae')],'name':_0x48835f[_0x47a5('0xc8')][_0x47a5('0xc6')][_0x47a5('0xc5')],'custom':![],'options':_0x740bdf};_0x2eef05['push'](_0x54a55e);return _0x2eef05;});}function getBooleanList(_0x3d93ad,_0x281674,_0x151540,_0x27baad,_0x34b7c9,_0x30df79){var _0x31b8b1={'method':_0x47a5('0xa9'),'uri':_0x3d93ad+_0x47a5('0xc9')+_0x27baad+_0x47a5('0xc2')+_0x34b7c9+_0x47a5('0xca'),'headers':{'Authorization':_0x47a5('0xa6')+_0x30df79,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31b8b1)[_0x47a5('0x1c')](function(_0x3ec683){var _0x591bde=[];_0x591bde[_0x47a5('0xb2')]({'name':_0x3ec683[_0x47a5('0xcb')][_0x47a5('0xcc')][_0x47a5('0xc5')][_0x47a5('0xc6')]['Label'],'value':_0x47a5('0xcd')},{'name':_0x3ec683[_0x47a5('0xcb')][_0x47a5('0xce')][_0x47a5('0xc5')][_0x47a5('0xc6')][_0x47a5('0xc5')],'value':_0x47a5('0xcf')});var _0x5e4387={'id':_0x281674+'_'+_0x3ec683['LogicalName'],'name':_0x3ec683[_0x47a5('0xc8')]['UserLocalizedLabel'][_0x47a5('0xc5')],'custom':![],'options':_0x591bde};_0x151540['push'](_0x5e4387);return _0x151540;});}function getInputList(_0x12572f,_0x8b4354,_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b){var _0xaca12c={'method':'GET','uri':_0x12572f+'EntityDefinitions('+_0x49cb8c+_0x47a5('0xc2')+_0x220557+_0x47a5('0xd0')+_0x134c1a+_0x47a5('0xd1'),'headers':{'Authorization':_0x47a5('0xa6')+_0x11f07b,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0xaca12c)[_0x47a5('0x1c')](function(_0x1c0323){var _0xe662d7={'id':_0x8b4354+'_'+_0x1c0323['LogicalName'],'name':_0x1c0323[_0x47a5('0xc8')]['UserLocalizedLabel']?_0x1c0323[_0x47a5('0xc8')][_0x47a5('0xc6')]['Label']:_0x1c0323['LogicalName'],'custom':![],'options':[]};_0x2bc7ae[_0x47a5('0xb2')](_0xe662d7);return _0x2bc7ae;});} \ No newline at end of file +var _0x7a54=['clientSecret','slice','substring','lastIndexOf','%s/api/data/v9.0/','POST','tenantId','/oauth2/token','Bearer\x20','4.0','MetadataId','GET',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','remove','includes','LogicalName','forEach','@odata.type','PicklistAttributeMetadata','push','all','isNil','StringAttributeMetadata','DoubleAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','DecimalAttributeMetadata','log','Dynamics365\x20error:\x20','stack','send','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Options','Label','UserLocalizedLabel','Value','DisplayName','EntityDefinitions(',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','json','count','offset','set','Content-Range','apply','destroy','sendStatus','name','index','map','Dynamics365Account','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','show','params','rawAttributes','include','find','create','body','update','Dynamics365Configuration','getConfigurations','addConfiguration','findOne','AccountId','channel','type','Descriptions','getDescriptions','Dynamics365Field','Subjects','getFields','ticketType','incident','Incident','PhoneCall','title','customerid','ownerid','caseorigincode','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','billedserviceunits','contactidname','contactidyominame','contractidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entitlementidname','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyyominame','modifiedbyname','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','prioritycodename','productserialnumber','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','timezoneruleversionnumber','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri'];(function(_0x4f0c12,_0x4fa0c2){var _0x44f8a5=function(_0x23ee70){while(--_0x23ee70){_0x4f0c12['push'](_0x4f0c12['shift']());}};_0x44f8a5(++_0x4fa0c2);}(_0x7a54,0x106));var _0x47a5=function(_0x3842e2,_0x3df0bd){_0x3842e2=_0x3842e2-0x0;var _0x5372ff=_0x7a54[_0x3842e2];return _0x5372ff;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];var integrations=require(_0x47a5('0x15'));var jayson=require(_0x47a5('0x16'));var client=jayson[_0x47a5('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x44bd3e,_0x221b54,_0x1cf309){if(_0x1cf309){var _0x711793=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x711793[_0x47a5('0x18')](_0x221b54)){return _0x44bd3e;}else{throw new db[(_0x47a5('0x19'))][(_0x47a5('0x1a'))](_0x47a5('0x1b'));}}else{return _0x44bd3e;}}function respondWithRpcPromise(_0x4e99a8,_0x362359,_0x11faf5,_0x3b001e){return new BPromise(function(_0x2a2cbb,_0x1ef44c){var _0x574af6=_0x3b001e||client;return _0x574af6['request'](_0x4e99a8,_0x11faf5)[_0x47a5('0x1c')](function(_0x4b966e){logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));logger[_0x47a5('0x1f')](_0x47a5('0x20'),_0x362359,_0x47a5('0x1e'),JSON[_0x47a5('0x21')](_0x4b966e));if(_0x4b966e[_0x47a5('0x22')]){if(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x23')]===0x1f4){logger['error'](_0x47a5('0x1d'),_0x362359,_0x4b966e[_0x47a5('0x22')]['message']);return _0x1ef44c(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}logger[_0x47a5('0x22')]('Dynamics365Account,\x20%s,\x20%s',_0x362359,_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);return _0x2a2cbb(_0x4b966e[_0x47a5('0x22')][_0x47a5('0x24')]);}else{logger['info'](_0x47a5('0x1d'),_0x362359,_0x47a5('0x1e'));_0x2a2cbb(_0x4b966e['result'][_0x47a5('0x24')]);}})[_0x47a5('0x25')](function(_0x4437f1){logger[_0x47a5('0x22')](_0x47a5('0x1d'),_0x362359,_0x4437f1);_0x1ef44c(_0x4437f1);});});}function respondWithStatusCode(_0x50bf17,_0x53078a){_0x53078a=_0x53078a||0xcc;return function(_0x136745){if(_0x136745){return _0x50bf17['sendStatus'](_0x53078a);}return _0x50bf17[_0x47a5('0x26')](_0x53078a)['end']();};}function respondWithResult(_0x23cb77,_0x378208){_0x378208=_0x378208||0xc8;return function(_0x36ad34){if(_0x36ad34){return _0x23cb77[_0x47a5('0x26')](_0x378208)[_0x47a5('0x27')](_0x36ad34);}};}function respondWithFilteredResult(_0x3ba0b7,_0x24b162){return function(_0x136b14){if(_0x136b14){var _0x16631f=_0x136b14[_0x47a5('0x28')],_0x361bfa=_0x24b162['offset'],_0x1127f8=_0x24b162[_0x47a5('0x29')]+_0x24b162['limit'],_0x11a4fa;if(_0x1127f8>=_0x16631f){_0x1127f8=_0x16631f;_0x11a4fa=0xc8;}else{_0x11a4fa=0xce;}_0x3ba0b7[_0x47a5('0x26')](_0x11a4fa);return _0x3ba0b7[_0x47a5('0x2a')](_0x47a5('0x2b'),_0x361bfa+'-'+_0x1127f8+'/'+_0x16631f)['json'](_0x136b14);}return null;};}function patchUpdates(_0x256650){return function(_0x625952){try{jsonpatch[_0x47a5('0x2c')](_0x625952,_0x256650,!![]);}catch(_0x1f1c68){return BPromise['reject'](_0x1f1c68);}return _0x625952['save']();};}function saveUpdates(_0x6f9a12,_0xfb5ddb){return function(_0x5bd7eb){if(_0x5bd7eb){return _0x5bd7eb['update'](_0x6f9a12)[_0x47a5('0x1c')](function(_0x51544e){return _0x51544e;});}return null;};}function removeEntity(_0x57bff6,_0x42f70c){return function(_0x53119b){if(_0x53119b){return _0x53119b[_0x47a5('0x2d')]()[_0x47a5('0x1c')](function(){_0x57bff6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x274e34,_0x5910bb){return function(_0x403028){if(!_0x403028){_0x274e34[_0x47a5('0x2e')](0x194);}return _0x403028;};}function handleError(_0xf269a8,_0x52749b){_0x52749b=_0x52749b||0x1f4;return function(_0x18f7e9){logger['error'](_0x18f7e9['stack']);if(_0x18f7e9[_0x47a5('0x2f')]){delete _0x18f7e9['name'];}_0xf269a8[_0x47a5('0x26')](_0x52749b)['send'](_0x18f7e9);};}exports[_0x47a5('0x30')]=function(_0x3534cb,_0x38c8d4){var _0x199698={},_0x36add5={},_0xed6320={'count':0x0,'rows':[]};var _0xee582c=_[_0x47a5('0x31')](db[_0x47a5('0x32')]['rawAttributes'],function(_0x396a9a){return{'name':_0x396a9a[_0x47a5('0x33')],'type':_0x396a9a['type'][_0x47a5('0x34')]};});_0x36add5[_0x47a5('0x35')]=_[_0x47a5('0x31')](_0xee582c,'name');_0x36add5[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x3534cb['query']);_0x36add5[_0x47a5('0x38')]=_[_0x47a5('0x39')](_0x36add5['model'],_0x36add5['query']);_0x199698['attributes']=_[_0x47a5('0x39')](_0x36add5['model'],qs[_0x47a5('0x3a')](_0x3534cb[_0x47a5('0x36')][_0x47a5('0x3a')]));_0x199698[_0x47a5('0x3b')]=_0x199698[_0x47a5('0x3b')][_0x47a5('0x3c')]?_0x199698[_0x47a5('0x3b')]:_0x36add5[_0x47a5('0x35')];if(!_0x3534cb[_0x47a5('0x36')][_0x47a5('0x3d')](_0x47a5('0x3e'))){_0x199698[_0x47a5('0x3f')]=qs[_0x47a5('0x3f')](_0x3534cb['query'][_0x47a5('0x3f')]);_0x199698[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x3534cb[_0x47a5('0x36')]['offset']);}_0x199698[_0x47a5('0x40')]=qs['sort'](_0x3534cb['query']['sort']);_0x199698['where']=qs[_0x47a5('0x38')](_['pick'](_0x3534cb[_0x47a5('0x36')],_0x36add5[_0x47a5('0x38')]));if(_0x3534cb[_0x47a5('0x36')]['filter']){_0x199698[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x199698['where'],{'$or':_['map'](_0xee582c,function(_0xbe21d9){if(_0xbe21d9['type']!==_0x47a5('0x43')){var _0x4703b2={};_0x4703b2[_0xbe21d9[_0x47a5('0x2f')]]={'$like':'%'+_0x3534cb[_0x47a5('0x36')][_0x47a5('0x44')]+'%'};return _0x4703b2;}})});}_0x199698=_[_0x47a5('0x42')]({},_0x199698,_0x3534cb[_0x47a5('0x45')]);var _0x17cc42={'where':_0x199698[_0x47a5('0x41')]};return db[_0x47a5('0x32')][_0x47a5('0x28')](_0x17cc42)[_0x47a5('0x1c')](function(_0xe28d76){_0xed6320[_0x47a5('0x28')]=_0xe28d76;if(_0x3534cb[_0x47a5('0x36')][_0x47a5('0x46')]){_0x199698['include']=[{'all':!![]}];}return db[_0x47a5('0x32')][_0x47a5('0x47')](_0x199698);})['then'](function(_0x52b3a8){_0xed6320[_0x47a5('0x48')]=_0x52b3a8;return _0xed6320;})['then'](respondWithFilteredResult(_0x38c8d4,_0x199698))[_0x47a5('0x25')](handleError(_0x38c8d4,null));};exports[_0x47a5('0x49')]=function(_0x54c35f,_0x4f62d3){var _0x3d85cc={'raw':![],'where':{'id':_0x54c35f[_0x47a5('0x4a')]['id']}},_0x52d409={};_0x52d409[_0x47a5('0x35')]=_[_0x47a5('0x37')](db[_0x47a5('0x32')][_0x47a5('0x4b')]);_0x52d409[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x54c35f['query']);_0x52d409['filters']=_[_0x47a5('0x39')](_0x52d409[_0x47a5('0x35')],_0x52d409[_0x47a5('0x36')]);_0x3d85cc[_0x47a5('0x3b')]=_[_0x47a5('0x39')](_0x52d409[_0x47a5('0x35')],qs[_0x47a5('0x3a')](_0x54c35f['query'][_0x47a5('0x3a')]));_0x3d85cc[_0x47a5('0x3b')]=_0x3d85cc[_0x47a5('0x3b')]['length']?_0x3d85cc[_0x47a5('0x3b')]:_0x52d409['model'];if(_0x54c35f[_0x47a5('0x36')][_0x47a5('0x46')]){_0x3d85cc[_0x47a5('0x4c')]=[{'all':!![]}];}_0x3d85cc=_[_0x47a5('0x42')]({},_0x3d85cc,_0x54c35f['options']);return db[_0x47a5('0x32')][_0x47a5('0x4d')](_0x3d85cc)[_0x47a5('0x1c')](handleEntityNotFound(_0x4f62d3,null))[_0x47a5('0x1c')](respondWithResult(_0x4f62d3,null))[_0x47a5('0x25')](handleError(_0x4f62d3,null));};exports[_0x47a5('0x4e')]=function(_0x24e9f4,_0x481089){return db[_0x47a5('0x32')][_0x47a5('0x4e')](_0x24e9f4[_0x47a5('0x4f')],{})[_0x47a5('0x1c')](respondWithResult(_0x481089,0xc9))[_0x47a5('0x25')](handleError(_0x481089,null));};exports[_0x47a5('0x50')]=function(_0x572233,_0x1ad6a9){if(_0x572233[_0x47a5('0x4f')]['id']){delete _0x572233[_0x47a5('0x4f')]['id'];}return db['Dynamics365Account'][_0x47a5('0x4d')]({'where':{'id':_0x572233[_0x47a5('0x4a')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x1ad6a9,null))['then'](saveUpdates(_0x572233['body'],null))[_0x47a5('0x1c')](respondWithResult(_0x1ad6a9,null))[_0x47a5('0x25')](handleError(_0x1ad6a9,null));};exports['destroy']=function(_0x4cf792,_0x6d6b2b){return db['Dynamics365Account'][_0x47a5('0x4d')]({'where':{'id':_0x4cf792['params']['id']}})['then'](handleEntityNotFound(_0x6d6b2b,null))[_0x47a5('0x1c')](removeEntity(_0x6d6b2b,null))[_0x47a5('0x25')](handleError(_0x6d6b2b,null));};exports['getConfigurations']=function(_0x1b958b,_0x72fe,_0x4b706a){var _0x5b6127={};var _0x16b4fd={};var _0x30d482;var _0x867da0;return db[_0x47a5('0x32')]['findOne']({'where':{'id':_0x1b958b[_0x47a5('0x4a')]['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x72fe,null))[_0x47a5('0x1c')](function(_0x5a33b8){if(_0x5a33b8){_0x30d482=_0x5a33b8;_0x16b4fd[_0x47a5('0x35')]=_['keys'](db[_0x47a5('0x51')][_0x47a5('0x4b')]);_0x16b4fd[_0x47a5('0x36')]=_[_0x47a5('0x37')](_0x1b958b[_0x47a5('0x36')]);_0x16b4fd['filters']=_[_0x47a5('0x39')](_0x16b4fd['model'],_0x16b4fd['query']);_0x5b6127['attributes']=_['intersection'](_0x16b4fd[_0x47a5('0x35')],qs[_0x47a5('0x3a')](_0x1b958b[_0x47a5('0x36')]['fields']));_0x5b6127['attributes']=_0x5b6127[_0x47a5('0x3b')][_0x47a5('0x3c')]?_0x5b6127[_0x47a5('0x3b')]:_0x16b4fd[_0x47a5('0x35')];_0x5b6127[_0x47a5('0x40')]=qs['sort'](_0x1b958b[_0x47a5('0x36')]['sort']);_0x5b6127[_0x47a5('0x41')]=qs[_0x47a5('0x38')](_['pick'](_0x1b958b[_0x47a5('0x36')],_0x16b4fd[_0x47a5('0x38')]));if(_0x1b958b[_0x47a5('0x36')][_0x47a5('0x44')]){_0x5b6127[_0x47a5('0x41')]=_[_0x47a5('0x42')](_0x5b6127[_0x47a5('0x41')],{'$or':_[_0x47a5('0x31')](_0x5b6127['attributes'],function(_0x2dcc3b){var _0x2a3a57={};_0x2a3a57[_0x2dcc3b]={'$like':'%'+_0x1b958b[_0x47a5('0x36')][_0x47a5('0x44')]+'%'};return _0x2a3a57;})});}_0x5b6127=_[_0x47a5('0x42')]({},_0x5b6127,_0x1b958b['options']);return _0x30d482[_0x47a5('0x52')](_0x5b6127);}})[_0x47a5('0x1c')](function(_0x1224bc){if(_0x1224bc){_0x867da0=_0x1224bc[_0x47a5('0x3c')];if(!_0x1b958b[_0x47a5('0x36')][_0x47a5('0x3d')](_0x47a5('0x3e'))){_0x5b6127[_0x47a5('0x3f')]=qs[_0x47a5('0x3f')](_0x1b958b[_0x47a5('0x36')][_0x47a5('0x3f')]);_0x5b6127[_0x47a5('0x29')]=qs[_0x47a5('0x29')](_0x1b958b[_0x47a5('0x36')][_0x47a5('0x29')]);}return _0x30d482['getConfigurations'](_0x5b6127);}})[_0x47a5('0x1c')](function(_0x284fb8){if(_0x284fb8){return _0x284fb8?{'count':_0x867da0,'rows':_0x284fb8}:null;}})[_0x47a5('0x1c')](respondWithResult(_0x72fe,null))['catch'](handleError(_0x72fe,null));};exports[_0x47a5('0x53')]=function(_0x2e46af,_0x36c67,_0x26f1ac){if(_0x2e46af['body']['id']){delete _0x2e46af[_0x47a5('0x4f')]['id'];}return db['Dynamics365Account'][_0x47a5('0x54')]({'where':{'id':_0x2e46af['params']['id']}})[_0x47a5('0x1c')](handleEntityNotFound(_0x36c67,null))['then'](function(_0x7c1190){if(_0x7c1190){_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x55')]=_0x7c1190['id'];_0x2e46af['body']['Subjects']=integrations['getSubjects'](_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x56')],_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x57')]);_0x2e46af['body'][_0x47a5('0x58')]=integrations[_0x47a5('0x59')](_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x56')],_0x2e46af[_0x47a5('0x4f')][_0x47a5('0x57')]);return db[_0x47a5('0x51')][_0x47a5('0x4e')](_0x2e46af[_0x47a5('0x4f')],{'include':[{'model':db[_0x47a5('0x5a')],'as':_0x47a5('0x5b')},{'model':db[_0x47a5('0x5a')],'as':'Descriptions'}]});}return null;})[_0x47a5('0x1c')](respondWithResult(_0x36c67,null))['catch'](handleError(_0x36c67,null));};exports[_0x47a5('0x5c')]=function(_0x2ac30f,_0x281e5f,_0x12fec9){var _0x40e584=_0x2ac30f[_0x47a5('0x36')][_0x47a5('0x5d')];var _0x448981=_0x40e584===_0x47a5('0x5e')?_0x47a5('0x5f'):_0x47a5('0x60');var _0x1f07ac='';var _0x8f0035='';var _0x2d434c='';var _0x441d64='';var _0x4de126='';var _0x48eb77='';var _0x5ccc89='';var _0x4d09a4='';var _0x490e28=[_0x47a5('0x61'),'description',_0x47a5('0x62'),_0x47a5('0x63'),_0x47a5('0x64'),_0x47a5('0x65'),_0x47a5('0x66'),_0x47a5('0x67'),_0x47a5('0x68'),_0x47a5('0x69')];var _0x2e9a96=[_0x47a5('0x6a'),_0x47a5('0x6b'),'actualserviceunits',_0x47a5('0x6c'),_0x47a5('0x6d'),_0x47a5('0x6e'),'contractdetailidname',_0x47a5('0x6f'),_0x47a5('0x70'),_0x47a5('0x71'),'createdbyname',_0x47a5('0x72'),'createdon','createdonbehalfbyname',_0x47a5('0x73'),_0x47a5('0x74'),_0x47a5('0x75'),_0x47a5('0x76'),_0x47a5('0x77'),_0x47a5('0x78'),'entityimage_timestamp','entityimage_url',_0x47a5('0x79'),'exchangerate',_0x47a5('0x7a'),_0x47a5('0x7b'),_0x47a5('0x7c'),_0x47a5('0x7d'),'kbarticleidname',_0x47a5('0x7e'),'masteridname','modifiedbyexternalpartyname',_0x47a5('0x7f'),_0x47a5('0x80'),'modifiedbyyominame',_0x47a5('0x81'),_0x47a5('0x82'),_0x47a5('0x83'),'msdyn_incidenttypename',_0x47a5('0x84'),'numberofchildincidents',_0x47a5('0x85'),_0x47a5('0x86'),_0x47a5('0x87'),'owneridtype',_0x47a5('0x88'),_0x47a5('0x89'),_0x47a5('0x8a'),'primarycontactidyominame',_0x47a5('0x8b'),'productidname',_0x47a5('0x8c'),'resolveby',_0x47a5('0x8d'),_0x47a5('0x8e'),_0x47a5('0x8f'),_0x47a5('0x90'),'sentimentvalue',_0x47a5('0x91'),_0x47a5('0x92'),_0x47a5('0x93'),_0x47a5('0x94'),_0x47a5('0x95'),'subjectidname','ticketnumber',_0x47a5('0x96'),'transactioncurrencyidname',_0x47a5('0x97'),_0x47a5('0x98'),_0x47a5('0x99')];var _0x5018e9=_0x490e28[_0x47a5('0x9a')](_0x2e9a96);return db[_0x47a5('0x32')]['findOne']({'where':{'id':_0x2ac30f[_0x47a5('0x4a')]['id']},'attributes':['id',_0x47a5('0x9b'),_0x47a5('0x9c'),_0x47a5('0x9d'),'tenantId','clientId',_0x47a5('0x9e')]})[_0x47a5('0x1c')](handleEntityNotFound(_0x281e5f,null))['then'](function(_0x27d422){if(_0x27d422){_0x4d09a4=_0x27d422[_0x47a5('0x9d')];var _0x5a0901=_0x4d09a4[_0x47a5('0x9f')](-0x1);if(_0x5a0901==='/'){_0x4d09a4=_0x4d09a4[_0x47a5('0xa0')](0x0,_0x4d09a4[_0x47a5('0xa1')](_0x5a0901));}_0x5ccc89=util['format'](_0x47a5('0xa2'),_0x4d09a4);var _0x59b4a5={'method':_0x47a5('0xa3'),'uri':'https://login.microsoftonline.com/'+_0x27d422[_0x47a5('0xa4')]+_0x47a5('0xa5'),'form':{'client_id':_0x27d422['clientId'],'resource':_0x4d09a4,'username':_0x27d422[_0x47a5('0x9b')],'password':_0x27d422['password'],'grant_type':_0x47a5('0x9c'),'client_secret':_0x27d422[_0x47a5('0x9e')]},'json':!![]};return rp(_0x59b4a5);}})[_0x47a5('0x1c')](function(_0x2be771){_0x48eb77=_0x2be771['access_token'];var _0x3eb5c1={'method':'GET','uri':encodeURI(_0x5ccc89+'EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27'+_0x448981+'\x27'),'headers':{'Authorization':_0x47a5('0xa6')+_0x48eb77,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x3eb5c1);})[_0x47a5('0x1c')](function(_0x96fb22){var _0x380c8b=_0x96fb22['value'][0x0];var _0x1522a6=_0x380c8b[_0x47a5('0xa8')];var _0x241e1d={'method':_0x47a5('0xa9'),'uri':_0x5ccc89+'EntityDefinitions('+_0x1522a6+_0x47a5('0xaa'),'headers':{'Authorization':'Bearer\x20'+_0x48eb77,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x241e1d);})[_0x47a5('0x1c')](function(_0x3f93f0){_0x1f07ac=_0x3f93f0;_0x8f0035=_0x1f07ac[_0x47a5('0xab')];_0x8f0035=_[_0x47a5('0xac')](_0x8f0035,function(_0x3ec264){return!_0x5018e9[_0x47a5('0xad')](_0x3ec264[_0x47a5('0xae')]);});var _0x11eaf7=[];var _0x583746=[];_0x8f0035[_0x47a5('0xaf')](function(_0x18f8b2){if(_0x18f8b2['@odata.type']){var _0x2fd46f=_0x18f8b2[_0x47a5('0xb0')][_0x47a5('0xa0')](_0x18f8b2['@odata.type']['lastIndexOf']('.')+0x1);if(_0x2fd46f===_0x47a5('0xb1')){_0x11eaf7[_0x47a5('0xb2')](getSelectList(_0x5ccc89,_0x40e584,_0x583746,_0x1f07ac['MetadataId'],_0x18f8b2['MetadataId'],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x11eaf7);})[_0x47a5('0x1c')](function(_0x54eab1){_0x2d434c=_0x54eab1[0x0];var _0x29e384=[];var _0x269ff6=[];_0x8f0035['forEach'](function(_0x16097e){if(!_[_0x47a5('0xb4')](_0x16097e[_0x47a5('0xb0')])){var _0x70c8a6=_0x16097e[_0x47a5('0xb0')][_0x47a5('0xa0')](_0x16097e['@odata.type']['lastIndexOf']('.')+0x1);if(_0x70c8a6==='BooleanAttributeMetadata'){_0x29e384[_0x47a5('0xb2')](getBooleanList(_0x5ccc89,_0x40e584,_0x269ff6,_0x1f07ac[_0x47a5('0xa8')],_0x16097e['MetadataId'],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x29e384);})[_0x47a5('0x1c')](function(_0x32ca1c){_0x441d64=_0x32ca1c[0x0];var _0x1752ce=[];var _0xcdbfd7=[];_0x8f0035['forEach'](function(_0x3e7750){if(_0x3e7750['@odata.type']){var _0x4eb534=_0x3e7750['@odata.type'][_0x47a5('0xa0')](_0x3e7750['@odata.type'][_0x47a5('0xa1')]('.')+0x1);if(_0x4eb534===_0x47a5('0xb5')||_0x4eb534===_0x47a5('0xb6')||_0x4eb534==='BigIntAttributeMetadata'||_0x4eb534===_0x47a5('0xb7')||_0x4eb534===_0x47a5('0xb8')||_0x4eb534===_0x47a5('0xb9')||_0x4eb534===_0x47a5('0xba')||_0x4eb534===_0x47a5('0xbb')||_0x4eb534==='StateAttributeMetadata'||_0x4eb534===_0x47a5('0xbc')){_0x1752ce[_0x47a5('0xb2')](getInputList(_0x5ccc89,_0x40e584,_0x4eb534,_0xcdbfd7,_0x1f07ac['MetadataId'],_0x3e7750[_0x47a5('0xa8')],_0x48eb77));}}});return Promise[_0x47a5('0xb3')](_0x1752ce);})[_0x47a5('0x1c')](function(_0x1f937a){_0x4de126=_0x1f937a[0x0];var _0x3c117a=_0x2d434c[_0x47a5('0x9a')](_0x441d64)['concat'](_0x4de126);var _0x6a8174={'count':_0x3c117a[_0x47a5('0x3c')],'rows':_0x3c117a};return _0x6a8174;})['then'](respondWithResult(_0x281e5f,null))[_0x47a5('0x25')](function(_0x9769b5){console[_0x47a5('0xbd')](_0x47a5('0xbe')+_0x9769b5);var _0x4ce0ac=_0x2ac30f['query']['test']?0x1f4:_0x9769b5['statusCode']||0x1f4;logger[_0x47a5('0x22')](_0x9769b5[_0x47a5('0xbf')]);delete _0x9769b5[_0x47a5('0x2f')];if(_0x4ce0ac===0x191){_0x4ce0ac=0x190;}_0x281e5f[_0x47a5('0x26')](_0x4ce0ac)[_0x47a5('0xc0')](_0x2ac30f[_0x47a5('0x36')][_0x47a5('0x18')]?{'message':_0x47a5('0xc1'),'statusCode':_0x9769b5['statusCode']}:_0x9769b5);});};function getSelectList(_0x272b10,_0x24e39a,_0x2eef05,_0x399528,_0x47be87,_0x5ef411){var _0x3770ae={'method':'GET','uri':_0x272b10+'EntityDefinitions('+_0x399528+_0x47a5('0xc2')+_0x47be87+_0x47a5('0xc3')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0x47a5('0xa6')+_0x5ef411,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0x3770ae)[_0x47a5('0x1c')](function(_0x48835f){var _0x740bdf=[];var _0xee23c7=_0x48835f['OptionSet'][_0x47a5('0xc4')];_0xee23c7[_0x47a5('0xaf')](function(_0x10ee87){_0x740bdf[_0x47a5('0xb2')]({'name':_0x10ee87[_0x47a5('0xc5')][_0x47a5('0xc6')]['Label'],'value':String(_0x10ee87[_0x47a5('0xc7')])});});var _0x54a55e={'id':_0x24e39a+'_'+_0x48835f[_0x47a5('0xae')],'name':_0x48835f[_0x47a5('0xc8')][_0x47a5('0xc6')][_0x47a5('0xc5')],'custom':![],'options':_0x740bdf};_0x2eef05['push'](_0x54a55e);return _0x2eef05;});}function getBooleanList(_0x3d93ad,_0x281674,_0x151540,_0x27baad,_0x34b7c9,_0x30df79){var _0x31b8b1={'method':_0x47a5('0xa9'),'uri':_0x3d93ad+_0x47a5('0xc9')+_0x27baad+_0x47a5('0xc2')+_0x34b7c9+_0x47a5('0xca'),'headers':{'Authorization':_0x47a5('0xa6')+_0x30df79,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x31b8b1)[_0x47a5('0x1c')](function(_0x3ec683){var _0x591bde=[];_0x591bde[_0x47a5('0xb2')]({'name':_0x3ec683[_0x47a5('0xcb')][_0x47a5('0xcc')][_0x47a5('0xc5')][_0x47a5('0xc6')]['Label'],'value':_0x47a5('0xcd')},{'name':_0x3ec683[_0x47a5('0xcb')][_0x47a5('0xce')][_0x47a5('0xc5')][_0x47a5('0xc6')][_0x47a5('0xc5')],'value':_0x47a5('0xcf')});var _0x5e4387={'id':_0x281674+'_'+_0x3ec683['LogicalName'],'name':_0x3ec683[_0x47a5('0xc8')]['UserLocalizedLabel'][_0x47a5('0xc5')],'custom':![],'options':_0x591bde};_0x151540['push'](_0x5e4387);return _0x151540;});}function getInputList(_0x12572f,_0x8b4354,_0x134c1a,_0x2bc7ae,_0x49cb8c,_0x220557,_0x11f07b){var _0xaca12c={'method':'GET','uri':_0x12572f+'EntityDefinitions('+_0x49cb8c+_0x47a5('0xc2')+_0x220557+_0x47a5('0xd0')+_0x134c1a+_0x47a5('0xd1'),'headers':{'Authorization':_0x47a5('0xa6')+_0x11f07b,'If-None-Match':null,'OData-Version':_0x47a5('0xa7')},'json':!![]};return rp(_0xaca12c)[_0x47a5('0x1c')](function(_0x1c0323){var _0xe662d7={'id':_0x8b4354+'_'+_0x1c0323['LogicalName'],'name':_0x1c0323[_0x47a5('0xc8')]['UserLocalizedLabel']?_0x1c0323[_0x47a5('0xc8')][_0x47a5('0xc6')]['Label']:_0x1c0323['LogicalName'],'custom':![],'options':[]};_0x2bc7ae[_0x47a5('0xb2')](_0xe662d7);return _0x2bc7ae;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 6fc9ac8..cc4329e 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 _0xe2c9=['../../components/integrations/configuration','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes'];(function(_0x19e6c9,_0x50a713){var _0x46e636=function(_0x3d36f5){while(--_0x3d36f5){_0x19e6c9['push'](_0x19e6c9['shift']());}};_0x46e636(++_0x50a713);}(_0xe2c9,0x1d6));var _0x9e2c=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xe2c9[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0x9e2c('0x0'));var util=require(_0x9e2c('0x1'));var logger=require(_0x9e2c('0x2'))('api');var moment=require(_0x9e2c('0x3'));var BPromise=require(_0x9e2c('0x4'));var rp=require(_0x9e2c('0x5'));var fs=require('fs');var path=require(_0x9e2c('0x6'));var rimraf=require(_0x9e2c('0x7'));var config=require(_0x9e2c('0x8'));var attributes=require(_0x9e2c('0x9'));var integrations=require(_0x9e2c('0xa'));module[_0x9e2c('0xb')]=function(_0x5efbb3,_0x12b8d6){return _0x5efbb3[_0x9e2c('0xc')](_0x9e2c('0xd'),attributes,{'tableName':_0x9e2c('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x03c1=['lodash','util','../../config/logger','moment','rimraf','exports','define','Dynamics365Account','int_dynamics365_accounts'];(function(_0x235c80,_0x599342){var _0x4c5425=function(_0x3334f0){while(--_0x3334f0){_0x235c80['push'](_0x235c80['shift']());}};_0x4c5425(++_0x599342);}(_0x03c1,0xd8));var _0x103c=function(_0xd4636c,_0x34dbf6){_0xd4636c=_0xd4636c-0x0;var _0x5ee17d=_0x03c1[_0xd4636c];return _0x5ee17d;};'use strict';var _=require(_0x103c('0x0'));var util=require(_0x103c('0x1'));var logger=require(_0x103c('0x2'))('api');var moment=require(_0x103c('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x103c('0x4'));var config=require('../../config/environment');var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module[_0x103c('0x5')]=function(_0x2fc69c,_0x4d1b79){return _0x2fc69c[_0x103c('0x6')](_0x103c('0x7'),attributes,{'tableName':_0x103c('0x8'),'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 e6f2f37..f5f930d 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 _0x36f3=['ShowDynamics365Account','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','Dynamics365Account','findAll','options','raw','where','limit','include','map','model','attributes','GetDynamics365Account'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x36f3,0xe6));var _0x336f=function(_0x1fe607,_0x3c3b7d){_0x1fe607=_0x1fe607-0x0;var _0x201b0e=_0x36f3[_0x1fe607];return _0x201b0e;};'use strict';var _=require('lodash');var util=require(_0x336f('0x0'));var moment=require(_0x336f('0x1'));var BPromise=require(_0x336f('0x2'));var rs=require(_0x336f('0x3'));var fs=require('fs');var Redis=require(_0x336f('0x4'));var db=require(_0x336f('0x5'))['db'];var utils=require(_0x336f('0x6'));var logger=require(_0x336f('0x7'))(_0x336f('0x8'));var config=require('../../config/environment');var jayson=require(_0x336f('0x9'));var client=jayson[_0x336f('0xa')][_0x336f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4ef72f,_0x56100c,_0x3963d1){return new BPromise(function(_0x3aab62,_0x3218df){return client[_0x336f('0xc')](_0x4ef72f,_0x3963d1)[_0x336f('0xd')](function(_0x176178){logger[_0x336f('0xe')](_0x336f('0xf'),_0x56100c,'request\x20sent');logger[_0x336f('0x10')](_0x336f('0x11'),_0x56100c,_0x336f('0x12'),JSON[_0x336f('0x13')](_0x176178));if(_0x176178['error']){if(_0x176178['error'][_0x336f('0x14')]===0x1f4){logger['error'](_0x336f('0xf'),_0x56100c,_0x176178[_0x336f('0x15')]['message']);return _0x3218df(_0x176178[_0x336f('0x15')][_0x336f('0x16')]);}logger[_0x336f('0x15')](_0x336f('0xf'),_0x56100c,_0x176178[_0x336f('0x15')][_0x336f('0x16')]);return _0x3aab62(_0x176178[_0x336f('0x15')]['message']);}else{logger[_0x336f('0xe')](_0x336f('0xf'),_0x56100c,_0x336f('0x12'));_0x3aab62(_0x176178[_0x336f('0x17')]['message']);}})[_0x336f('0x18')](function(_0x67953f){logger[_0x336f('0x15')](_0x336f('0xf'),_0x56100c,_0x67953f);_0x3218df(_0x67953f);});});}exports['GetDynamics365Account']=function(_0xbbe464){var _0x2d89d5=this;return new Promise(function(_0x5d1eec,_0x2a856b){return db[_0x336f('0x19')][_0x336f('0x1a')]({'raw':_0xbbe464['options']?_0xbbe464[_0x336f('0x1b')][_0x336f('0x1c')]===undefined?!![]:![]:!![],'where':_0xbbe464['options']?_0xbbe464[_0x336f('0x1b')][_0x336f('0x1d')]||null:null,'attributes':_0xbbe464[_0x336f('0x1b')]?_0xbbe464[_0x336f('0x1b')]['attributes']||null:null,'limit':_0xbbe464[_0x336f('0x1b')]?_0xbbe464[_0x336f('0x1b')][_0x336f('0x1e')]||null:null,'include':_0xbbe464[_0x336f('0x1b')]?_0xbbe464[_0x336f('0x1b')][_0x336f('0x1f')]?_[_0x336f('0x20')](_0xbbe464[_0x336f('0x1b')][_0x336f('0x1f')],function(_0x149fc){return{'model':db[_0x149fc[_0x336f('0x21')]],'as':_0x149fc['as'],'attributes':_0x149fc[_0x336f('0x22')],'include':_0x149fc[_0x336f('0x1f')]?_['map'](_0x149fc['include'],function(_0x386d6f){return{'model':db[_0x386d6f[_0x336f('0x21')]],'as':_0x386d6f['as'],'attributes':_0x386d6f[_0x336f('0x22')],'include':_0x386d6f[_0x336f('0x1f')]?_['map'](_0x386d6f[_0x336f('0x1f')],function(_0x282e07){return{'model':db[_0x282e07[_0x336f('0x21')]],'as':_0x282e07['as'],'attributes':_0x282e07['attributes']};}):[]};}):[]};}):[]:[]})[_0x336f('0xd')](function(_0x456e25){logger[_0x336f('0xe')]('GetDynamics365Account',_0xbbe464);logger[_0x336f('0x10')](_0x336f('0x23'),_0xbbe464,JSON[_0x336f('0x13')](_0x456e25));_0x5d1eec(_0x456e25);})[_0x336f('0x18')](function(_0x19e727){logger[_0x336f('0x15')]('GetDynamics365Account',_0x19e727['message'],_0xbbe464);_0x2a856b(_0x2d89d5[_0x336f('0x15')](0x1f4,_0x19e727[_0x336f('0x16')]));});});};exports[_0x336f('0x24')]=function(_0xec0b50){var _0x30b5b3=this;return new Promise(function(_0x1099af,_0x355c41){return db['Dynamics365Account'][_0x336f('0x25')]({'raw':_0xec0b50[_0x336f('0x1b')]?_0xec0b50[_0x336f('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0xec0b50['options']?_0xec0b50[_0x336f('0x1b')][_0x336f('0x1d')]||null:null,'attributes':_0xec0b50['options']?_0xec0b50[_0x336f('0x1b')][_0x336f('0x22')]||null:null,'include':_0xec0b50['options']?_0xec0b50[_0x336f('0x1b')][_0x336f('0x1f')]?_[_0x336f('0x20')](_0xec0b50[_0x336f('0x1b')][_0x336f('0x1f')],function(_0x38fa63){return{'model':db[_0x38fa63['model']],'as':_0x38fa63['as'],'attributes':_0x38fa63['attributes'],'include':_0x38fa63['include']?_[_0x336f('0x20')](_0x38fa63['include'],function(_0x8b48b2){return{'model':db[_0x8b48b2[_0x336f('0x21')]],'as':_0x8b48b2['as'],'attributes':_0x8b48b2['attributes'],'include':_0x8b48b2[_0x336f('0x1f')]?_[_0x336f('0x20')](_0x8b48b2[_0x336f('0x1f')],function(_0x42f108){return{'model':db[_0x42f108['model']],'as':_0x42f108['as'],'attributes':_0x42f108['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x1ce2e2){logger['info'](_0x336f('0x24'),_0xec0b50);logger['debug'](_0x336f('0x24'),_0xec0b50,JSON[_0x336f('0x13')](_0x1ce2e2));_0x1099af(_0x1ce2e2);})['catch'](function(_0xd9c5a0){logger['error']('ShowDynamics365Account',_0xd9c5a0[_0x336f('0x16')],_0xec0b50);_0x355c41(_0x30b5b3[_0x336f('0x15')](0x1f4,_0xd9c5a0[_0x336f('0x16')]));});});}; \ No newline at end of file +var _0xcd05=['ShowDynamics365Account','Dynamics365Account','find','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','findAll','options','raw','where','attributes','limit','map','include','model','GetDynamics365Account','catch'];(function(_0x30e25c,_0x355276){var _0x47959b=function(_0x2f9417){while(--_0x2f9417){_0x30e25c['push'](_0x30e25c['shift']());}};_0x47959b(++_0x355276);}(_0xcd05,0x163));var _0x5cd0=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0xcd05[_0x4e5552];return _0x60a338;};'use strict';var _=require(_0x5cd0('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5cd0('0x1'));var fs=require('fs');var Redis=require(_0x5cd0('0x2'));var db=require(_0x5cd0('0x3'))['db'];var utils=require(_0x5cd0('0x4'));var logger=require('../../config/logger')(_0x5cd0('0x5'));var config=require(_0x5cd0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10fd06,_0x3cfb51,_0x3f609e){return new BPromise(function(_0x2a95a6,_0x3c0593){return client[_0x5cd0('0x7')](_0x10fd06,_0x3f609e)[_0x5cd0('0x8')](function(_0x5b5682){logger[_0x5cd0('0x9')](_0x5cd0('0xa'),_0x3cfb51,_0x5cd0('0xb'));logger[_0x5cd0('0xc')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x3cfb51,_0x5cd0('0xb'),JSON[_0x5cd0('0xd')](_0x5b5682));if(_0x5b5682[_0x5cd0('0xe')]){if(_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0xf')]===0x1f4){logger[_0x5cd0('0xe')](_0x5cd0('0xa'),_0x3cfb51,_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0x10')]);return _0x3c0593(_0x5b5682[_0x5cd0('0xe')]['message']);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x3cfb51,_0x5b5682[_0x5cd0('0xe')][_0x5cd0('0x10')]);return _0x2a95a6(_0x5b5682['error'][_0x5cd0('0x10')]);}else{logger['info'](_0x5cd0('0xa'),_0x3cfb51,_0x5cd0('0xb'));_0x2a95a6(_0x5b5682[_0x5cd0('0x11')]['message']);}})['catch'](function(_0x489f62){logger[_0x5cd0('0xe')](_0x5cd0('0xa'),_0x3cfb51,_0x489f62);_0x3c0593(_0x489f62);});});}exports['GetDynamics365Account']=function(_0x57d81d){var _0x4b7dac=this;return new Promise(function(_0x1847dd,_0x106c1e){return db['Dynamics365Account'][_0x5cd0('0x12')]({'raw':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x14')]===undefined?!![]:![]:!![],'where':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x15')]||null:null,'attributes':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x16')]||null:null,'limit':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d[_0x5cd0('0x13')][_0x5cd0('0x17')]||null:null,'include':_0x57d81d[_0x5cd0('0x13')]?_0x57d81d['options']['include']?_[_0x5cd0('0x18')](_0x57d81d['options'][_0x5cd0('0x19')],function(_0x2e01b6){return{'model':db[_0x2e01b6[_0x5cd0('0x1a')]],'as':_0x2e01b6['as'],'attributes':_0x2e01b6[_0x5cd0('0x16')],'include':_0x2e01b6[_0x5cd0('0x19')]?_[_0x5cd0('0x18')](_0x2e01b6[_0x5cd0('0x19')],function(_0x5385db){return{'model':db[_0x5385db['model']],'as':_0x5385db['as'],'attributes':_0x5385db[_0x5cd0('0x16')],'include':_0x5385db[_0x5cd0('0x19')]?_[_0x5cd0('0x18')](_0x5385db[_0x5cd0('0x19')],function(_0x5bff8a){return{'model':db[_0x5bff8a[_0x5cd0('0x1a')]],'as':_0x5bff8a['as'],'attributes':_0x5bff8a[_0x5cd0('0x16')]};}):[]};}):[]};}):[]:[]})[_0x5cd0('0x8')](function(_0x53a6cf){logger['info'](_0x5cd0('0x1b'),_0x57d81d);logger[_0x5cd0('0xc')]('GetDynamics365Account',_0x57d81d,JSON[_0x5cd0('0xd')](_0x53a6cf));_0x1847dd(_0x53a6cf);})[_0x5cd0('0x1c')](function(_0x2dfb5d){logger[_0x5cd0('0xe')](_0x5cd0('0x1b'),_0x2dfb5d[_0x5cd0('0x10')],_0x57d81d);_0x106c1e(_0x4b7dac[_0x5cd0('0xe')](0x1f4,_0x2dfb5d['message']));});});};exports[_0x5cd0('0x1d')]=function(_0x1621f9){var _0x1b88ac=this;return new Promise(function(_0x3a4b2f,_0x400148){return db[_0x5cd0('0x1e')][_0x5cd0('0x1f')]({'raw':_0x1621f9[_0x5cd0('0x13')]?_0x1621f9[_0x5cd0('0x13')][_0x5cd0('0x14')]===undefined?!![]:![]:!![],'where':_0x1621f9['options']?_0x1621f9[_0x5cd0('0x13')][_0x5cd0('0x15')]||null:null,'attributes':_0x1621f9['options']?_0x1621f9[_0x5cd0('0x13')]['attributes']||null:null,'include':_0x1621f9[_0x5cd0('0x13')]?_0x1621f9[_0x5cd0('0x13')]['include']?_[_0x5cd0('0x18')](_0x1621f9['options'][_0x5cd0('0x19')],function(_0x28a69f){return{'model':db[_0x28a69f[_0x5cd0('0x1a')]],'as':_0x28a69f['as'],'attributes':_0x28a69f['attributes'],'include':_0x28a69f[_0x5cd0('0x19')]?_['map'](_0x28a69f[_0x5cd0('0x19')],function(_0x1a4855){return{'model':db[_0x1a4855['model']],'as':_0x1a4855['as'],'attributes':_0x1a4855[_0x5cd0('0x16')],'include':_0x1a4855[_0x5cd0('0x19')]?_[_0x5cd0('0x18')](_0x1a4855[_0x5cd0('0x19')],function(_0x39a12f){return{'model':db[_0x39a12f['model']],'as':_0x39a12f['as'],'attributes':_0x39a12f['attributes']};}):[]};}):[]};}):[]:[]})[_0x5cd0('0x8')](function(_0x445a08){logger['info'](_0x5cd0('0x1d'),_0x1621f9);logger[_0x5cd0('0xc')](_0x5cd0('0x1d'),_0x1621f9,JSON[_0x5cd0('0xd')](_0x445a08));_0x3a4b2f(_0x445a08);})[_0x5cd0('0x1c')](function(_0x5f4d6b){logger[_0x5cd0('0xe')](_0x5cd0('0x1d'),_0x5f4d6b[_0x5cd0('0x10')],_0x1621f9);_0x400148(_0x1b88ac[_0x5cd0('0xe')](0x1f4,_0x5f4d6b[_0x5cd0('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index df8859b..fecf39f 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 _0x0681=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x475f08,_0x139e35){var _0x328e80=function(_0x4e21ba){while(--_0x4e21ba){_0x475f08['push'](_0x475f08['shift']());}};_0x328e80(++_0x139e35);}(_0x0681,0x110));var _0x1068=function(_0x5c2cfc,_0x225457){_0x5c2cfc=_0x5c2cfc-0x0;var _0x39ef01=_0x0681[_0x5c2cfc];return _0x39ef01;};'use strict';var multer=require(_0x1068('0x0'));var util=require(_0x1068('0x1'));var path=require(_0x1068('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x1068('0x3')]();var auth=require(_0x1068('0x4'));var interaction=require(_0x1068('0x5'));var config=require(_0x1068('0x6'));var controller=require('./intDynamics365Configuration.controller');router[_0x1068('0x7')]('/',auth['isAuthenticated'](),controller[_0x1068('0x8')]);router[_0x1068('0x7')](_0x1068('0x9'),auth['isAuthenticated'](),controller[_0x1068('0xa')]);router[_0x1068('0x7')](_0x1068('0xb'),auth[_0x1068('0xc')](),controller[_0x1068('0xd')]);router['get'](_0x1068('0xe'),auth[_0x1068('0xc')](),controller[_0x1068('0xf')]);router['get'](_0x1068('0x10'),auth[_0x1068('0xc')](),controller[_0x1068('0x11')]);router[_0x1068('0x12')]('/',auth['isAuthenticated'](),controller[_0x1068('0x13')]);router[_0x1068('0x14')](_0x1068('0x9'),auth[_0x1068('0xc')](),controller[_0x1068('0x15')]);router[_0x1068('0x16')](_0x1068('0x9'),auth['isAuthenticated'](),controller[_0x1068('0x17')]);module[_0x1068('0x18')]=router; \ No newline at end of file +var _0x7872=['index','get','/:id','show','getFields','getSubjects','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intDynamics365Configuration.controller','isAuthenticated'];(function(_0x3a86ae,_0x2a64e9){var _0x2043f6=function(_0x377f5e){while(--_0x377f5e){_0x3a86ae['push'](_0x3a86ae['shift']());}};_0x2043f6(++_0x2a64e9);}(_0x7872,0x69));var _0x2787=function(_0x193394,_0x77e174){_0x193394=_0x193394-0x0;var _0x576e1b=_0x7872[_0x193394];return _0x576e1b;};'use strict';var multer=require(_0x2787('0x0'));var util=require(_0x2787('0x1'));var path=require(_0x2787('0x2'));var timeout=require(_0x2787('0x3'));var express=require(_0x2787('0x4'));var router=express[_0x2787('0x5')]();var auth=require(_0x2787('0x6'));var interaction=require(_0x2787('0x7'));var config=require('../../config/environment');var controller=require(_0x2787('0x8'));router['get']('/',auth[_0x2787('0x9')](),controller[_0x2787('0xa')]);router[_0x2787('0xb')](_0x2787('0xc'),auth[_0x2787('0x9')](),controller[_0x2787('0xd')]);router[_0x2787('0xb')]('/:id/fields',auth[_0x2787('0x9')](),controller[_0x2787('0xe')]);router[_0x2787('0xb')]('/:id/subjects',auth[_0x2787('0x9')](),controller[_0x2787('0xf')]);router['get']('/:id/descriptions',auth[_0x2787('0x9')](),controller['getDescriptions']);router[_0x2787('0x10')]('/',auth[_0x2787('0x9')](),controller[_0x2787('0x11')]);router[_0x2787('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x2787('0x13')]);router[_0x2787('0x14')](_0x2787('0xc'),auth[_0x2787('0x9')](),controller[_0x2787('0x15')]);module[_0x2787('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index febd771..2cc6831 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 _0x5a88=['ENUM','incident','sequelize','exports','STRING'];(function(_0x5e9e51,_0x61a52b){var _0x48458e=function(_0x2ae78e){while(--_0x2ae78e){_0x5e9e51['push'](_0x5e9e51['shift']());}};_0x48458e(++_0x61a52b);}(_0x5a88,0x192));var _0x85a8=function(_0x2059b2,_0x297359){_0x2059b2=_0x2059b2-0x0;var _0x31a4f7=_0x5a88[_0x2059b2];return _0x31a4f7;};'use strict';var Sequelize=require(_0x85a8('0x0'));module[_0x85a8('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x85a8('0x2')]},'ticketType':{'type':Sequelize[_0x85a8('0x3')](_0x85a8('0x4'),'phonecall'),'defaultValue':_0x85a8('0x4')}}; \ No newline at end of file +var _0xae0b=['sequelize','exports','STRING','ENUM','incident'];(function(_0x381bb8,_0x4186b6){var _0x2ba57e=function(_0x4fbb32){while(--_0x4fbb32){_0x381bb8['push'](_0x381bb8['shift']());}};_0x2ba57e(++_0x4186b6);}(_0xae0b,0x177));var _0xbae0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xae0b[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xbae0('0x0'));module[_0xbae0('0x1')]={'name':{'type':Sequelize[_0xbae0('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize[_0xbae0('0x3')](_0xbae0('0x4'),'phonecall'),'defaultValue':_0xbae0('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index 1ff5201..a2eca74 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 _0x16e7=['keys','filters','attributes','fields','length','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','Dynamics365Configuration','includeAll','findAll','rows','show','params','intersection','options','create','body','find','findOne','Dynamics365Field','getFields','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','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','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','index','map','rawAttributes','key','model','query'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x16e7,0x1ec));var _0x716e=function(_0x278cc6,_0x1f52fb){_0x278cc6=_0x278cc6-0x0;var _0xcab5d5=_0x16e7[_0x278cc6];return _0xcab5d5;};'use strict';var pdf=require(_0x716e('0x0'));var emlformat=require(_0x716e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x716e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x716e('0x3'));var moment=require('moment');var BPromise=require(_0x716e('0x4'));var Mustache=require(_0x716e('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x716e('0x6'));var ejs=require(_0x716e('0x7'));var fs=require('fs');var _=require(_0x716e('0x8'));var squel=require(_0x716e('0x9'));var crypto=require(_0x716e('0xa'));var jsforce=require(_0x716e('0xb'));var deskjs=require(_0x716e('0xc'));var toCsv=require('to-csv');var querystring=require(_0x716e('0xd'));var Papa=require(_0x716e('0xe'));var Redis=require(_0x716e('0xf'));var authService=require(_0x716e('0x10'));var qs=require(_0x716e('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x716e('0x12'));var logger=require(_0x716e('0x13'))(_0x716e('0x14'));var utils=require(_0x716e('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x716e('0x16'));var client=jayson[_0x716e('0x17')][_0x716e('0x18')]({'port':0x232a});function checkPasswordPattern(_0x545b7d,_0x461527,_0x5ca19e){if(_0x5ca19e){var _0x360dca=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x360dca[_0x716e('0x19')](_0x461527)){return _0x545b7d;}else{throw new db['Sequelize'][(_0x716e('0x1a'))](_0x716e('0x1b'));}}else{return _0x545b7d;}}function respondWithRpcPromise(_0x27ca40,_0xb2a53e,_0x313b4b,_0x54ca9e){return new BPromise(function(_0x29a21b,_0x375795){var _0x4b0ebb=_0x54ca9e||client;return _0x4b0ebb[_0x716e('0x1c')](_0x27ca40,_0x313b4b)[_0x716e('0x1d')](function(_0xce46b4){logger['info'](_0x716e('0x1e'),_0xb2a53e,'request\x20sent');logger[_0x716e('0x1f')](_0x716e('0x20'),_0xb2a53e,_0x716e('0x21'),JSON[_0x716e('0x22')](_0xce46b4));if(_0xce46b4[_0x716e('0x23')]){if(_0xce46b4[_0x716e('0x23')]['code']===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0xb2a53e,_0xce46b4[_0x716e('0x23')][_0x716e('0x24')]);return _0x375795(_0xce46b4[_0x716e('0x23')][_0x716e('0x24')]);}logger[_0x716e('0x23')](_0x716e('0x1e'),_0xb2a53e,_0xce46b4[_0x716e('0x23')][_0x716e('0x24')]);return _0x29a21b(_0xce46b4['error'][_0x716e('0x24')]);}else{logger[_0x716e('0x25')](_0x716e('0x1e'),_0xb2a53e,_0x716e('0x21'));_0x29a21b(_0xce46b4[_0x716e('0x26')][_0x716e('0x24')]);}})[_0x716e('0x27')](function(_0x908c8d){logger[_0x716e('0x23')]('Dynamics365Configuration,\x20%s,\x20%s',_0xb2a53e,_0x908c8d);_0x375795(_0x908c8d);});});}function respondWithStatusCode(_0xaefd63,_0x566c97){_0x566c97=_0x566c97||0xcc;return function(_0x3a39a6){if(_0x3a39a6){return _0xaefd63[_0x716e('0x28')](_0x566c97);}return _0xaefd63[_0x716e('0x29')](_0x566c97)[_0x716e('0x2a')]();};}function respondWithResult(_0x22c451,_0x35f9c9){_0x35f9c9=_0x35f9c9||0xc8;return function(_0x35a3a8){if(_0x35a3a8){return _0x22c451[_0x716e('0x29')](_0x35f9c9)[_0x716e('0x2b')](_0x35a3a8);}};}function respondWithFilteredResult(_0x4a932a,_0x5043cf){return function(_0x18f329){if(_0x18f329){var _0x45d846=_0x18f329[_0x716e('0x2c')],_0x4a485c=_0x5043cf[_0x716e('0x2d')],_0x572432=_0x5043cf['offset']+_0x5043cf['limit'],_0x5c9bb1;if(_0x572432>=_0x45d846){_0x572432=_0x45d846;_0x5c9bb1=0xc8;}else{_0x5c9bb1=0xce;}_0x4a932a[_0x716e('0x29')](_0x5c9bb1);return _0x4a932a[_0x716e('0x2e')](_0x716e('0x2f'),_0x4a485c+'-'+_0x572432+'/'+_0x45d846)[_0x716e('0x2b')](_0x18f329);}return null;};}function patchUpdates(_0x2b47b5){return function(_0x481094){try{jsonpatch[_0x716e('0x30')](_0x481094,_0x2b47b5,!![]);}catch(_0x5a1fb0){return BPromise[_0x716e('0x31')](_0x5a1fb0);}return _0x481094[_0x716e('0x32')]();};}function saveUpdates(_0x33f2e9,_0x2190d4){return function(_0x4cedc3){if(_0x4cedc3){return _0x4cedc3[_0x716e('0x33')](_0x33f2e9)[_0x716e('0x1d')](function(_0x30850f){return _0x30850f;});}return null;};}function removeEntity(_0x3b4852,_0x16be18){return function(_0x330188){if(_0x330188){return _0x330188[_0x716e('0x34')]()[_0x716e('0x1d')](function(){_0x3b4852[_0x716e('0x29')](0xcc)[_0x716e('0x2a')]();});}};}function handleEntityNotFound(_0x337179,_0x5243a0){return function(_0x1a5f90){if(!_0x1a5f90){_0x337179['sendStatus'](0x194);}return _0x1a5f90;};}function handleError(_0xffbdc4,_0x52616d){_0x52616d=_0x52616d||0x1f4;return function(_0x5a98e5){logger[_0x716e('0x23')](_0x5a98e5['stack']);if(_0x5a98e5[_0x716e('0x35')]){delete _0x5a98e5[_0x716e('0x35')];}_0xffbdc4[_0x716e('0x29')](_0x52616d)['send'](_0x5a98e5);};}exports[_0x716e('0x36')]=function(_0x334ef5,_0x4e428f){var _0x11a278={},_0xbaf311={},_0x1e6515={'count':0x0,'rows':[]};var _0x29d250=_[_0x716e('0x37')](db['Dynamics365Configuration'][_0x716e('0x38')],function(_0x250358){return{'name':_0x250358['fieldName'],'type':_0x250358['type'][_0x716e('0x39')]};});_0xbaf311[_0x716e('0x3a')]=_[_0x716e('0x37')](_0x29d250,'name');_0xbaf311[_0x716e('0x3b')]=_[_0x716e('0x3c')](_0x334ef5[_0x716e('0x3b')]);_0xbaf311[_0x716e('0x3d')]=_['intersection'](_0xbaf311['model'],_0xbaf311[_0x716e('0x3b')]);_0x11a278[_0x716e('0x3e')]=_['intersection'](_0xbaf311[_0x716e('0x3a')],qs['fields'](_0x334ef5[_0x716e('0x3b')][_0x716e('0x3f')]));_0x11a278['attributes']=_0x11a278['attributes'][_0x716e('0x40')]?_0x11a278[_0x716e('0x3e')]:_0xbaf311[_0x716e('0x3a')];if(!_0x334ef5['query']['hasOwnProperty'](_0x716e('0x41'))){_0x11a278[_0x716e('0x42')]=qs[_0x716e('0x42')](_0x334ef5[_0x716e('0x3b')]['limit']);_0x11a278[_0x716e('0x2d')]=qs['offset'](_0x334ef5[_0x716e('0x3b')]['offset']);}_0x11a278[_0x716e('0x43')]=qs[_0x716e('0x44')](_0x334ef5[_0x716e('0x3b')]['sort']);_0x11a278[_0x716e('0x45')]=qs[_0x716e('0x3d')](_[_0x716e('0x46')](_0x334ef5[_0x716e('0x3b')],_0xbaf311['filters']));if(_0x334ef5[_0x716e('0x3b')][_0x716e('0x47')]){_0x11a278['where']=_[_0x716e('0x48')](_0x11a278[_0x716e('0x45')],{'$or':_[_0x716e('0x37')](_0x29d250,function(_0x9aa7de){if(_0x9aa7de[_0x716e('0x49')]!==_0x716e('0x4a')){var _0x128451={};_0x128451[_0x9aa7de[_0x716e('0x35')]]={'$like':'%'+_0x334ef5[_0x716e('0x3b')]['filter']+'%'};return _0x128451;}})});}_0x11a278=_[_0x716e('0x48')]({},_0x11a278,_0x334ef5['options']);var _0x48ec1b={'where':_0x11a278[_0x716e('0x45')]};return db[_0x716e('0x4b')][_0x716e('0x2c')](_0x48ec1b)[_0x716e('0x1d')](function(_0x421a6e){_0x1e6515[_0x716e('0x2c')]=_0x421a6e;if(_0x334ef5[_0x716e('0x3b')][_0x716e('0x4c')]){_0x11a278['include']=[{'all':!![]}];}return db['Dynamics365Configuration'][_0x716e('0x4d')](_0x11a278);})[_0x716e('0x1d')](function(_0x476056){_0x1e6515[_0x716e('0x4e')]=_0x476056;return _0x1e6515;})['then'](respondWithFilteredResult(_0x4e428f,_0x11a278))[_0x716e('0x27')](handleError(_0x4e428f,null));};exports[_0x716e('0x4f')]=function(_0x23a46,_0x427f04){var _0x24699e={'raw':![],'where':{'id':_0x23a46[_0x716e('0x50')]['id']}},_0x4bc720={};_0x4bc720[_0x716e('0x3a')]=_['keys'](db[_0x716e('0x4b')][_0x716e('0x38')]);_0x4bc720[_0x716e('0x3b')]=_[_0x716e('0x3c')](_0x23a46['query']);_0x4bc720[_0x716e('0x3d')]=_[_0x716e('0x51')](_0x4bc720[_0x716e('0x3a')],_0x4bc720[_0x716e('0x3b')]);_0x24699e['attributes']=_[_0x716e('0x51')](_0x4bc720[_0x716e('0x3a')],qs[_0x716e('0x3f')](_0x23a46[_0x716e('0x3b')][_0x716e('0x3f')]));_0x24699e[_0x716e('0x3e')]=_0x24699e[_0x716e('0x3e')]['length']?_0x24699e[_0x716e('0x3e')]:_0x4bc720['model'];if(_0x23a46['query'][_0x716e('0x4c')]){_0x24699e['include']=[{'all':!![]}];}_0x24699e=_[_0x716e('0x48')]({},_0x24699e,_0x23a46[_0x716e('0x52')]);return db[_0x716e('0x4b')]['find'](_0x24699e)[_0x716e('0x1d')](handleEntityNotFound(_0x427f04,null))[_0x716e('0x1d')](respondWithResult(_0x427f04,null))['catch'](handleError(_0x427f04,null));};exports[_0x716e('0x53')]=function(_0x1eef54,_0x201b51){return db[_0x716e('0x4b')][_0x716e('0x53')](_0x1eef54[_0x716e('0x54')],{})[_0x716e('0x1d')](respondWithResult(_0x201b51,0xc9))[_0x716e('0x27')](handleError(_0x201b51,null));};exports['update']=function(_0x26b5de,_0x49f1a8){if(_0x26b5de['body']['id']){delete _0x26b5de[_0x716e('0x54')]['id'];}return db['Dynamics365Configuration'][_0x716e('0x55')]({'where':{'id':_0x26b5de[_0x716e('0x50')]['id']}})[_0x716e('0x1d')](handleEntityNotFound(_0x49f1a8,null))['then'](saveUpdates(_0x26b5de[_0x716e('0x54')],null))[_0x716e('0x1d')](respondWithResult(_0x49f1a8,null))[_0x716e('0x27')](handleError(_0x49f1a8,null));};exports['destroy']=function(_0x50e6b9,_0x9fa912){return db[_0x716e('0x4b')][_0x716e('0x55')]({'where':{'id':_0x50e6b9[_0x716e('0x50')]['id']}})[_0x716e('0x1d')](handleEntityNotFound(_0x9fa912,null))[_0x716e('0x1d')](removeEntity(_0x9fa912,null))[_0x716e('0x27')](handleError(_0x9fa912,null));};exports['getFields']=function(_0x32276a,_0x54f4ab,_0x133a79){var _0x27447f={};var _0x259f58={};var _0x4034a5;var _0xb84edf;return db[_0x716e('0x4b')][_0x716e('0x56')]({'where':{'id':_0x32276a['params']['id']}})[_0x716e('0x1d')](handleEntityNotFound(_0x54f4ab,null))[_0x716e('0x1d')](function(_0x387199){if(_0x387199){_0x4034a5=_0x387199;_0x259f58[_0x716e('0x3a')]=_[_0x716e('0x3c')](db[_0x716e('0x57')]['rawAttributes']);_0x259f58['query']=_[_0x716e('0x3c')](_0x32276a['query']);_0x259f58['filters']=_[_0x716e('0x51')](_0x259f58[_0x716e('0x3a')],_0x259f58[_0x716e('0x3b')]);_0x27447f[_0x716e('0x3e')]=_['intersection'](_0x259f58['model'],qs['fields'](_0x32276a[_0x716e('0x3b')]['fields']));_0x27447f[_0x716e('0x3e')]=_0x27447f[_0x716e('0x3e')][_0x716e('0x40')]?_0x27447f['attributes']:_0x259f58[_0x716e('0x3a')];_0x27447f[_0x716e('0x43')]=qs[_0x716e('0x44')](_0x32276a['query']['sort']);_0x27447f['where']=qs[_0x716e('0x3d')](_[_0x716e('0x46')](_0x32276a[_0x716e('0x3b')],_0x259f58[_0x716e('0x3d')]));if(_0x32276a[_0x716e('0x3b')][_0x716e('0x47')]){_0x27447f[_0x716e('0x45')]=_['merge'](_0x27447f[_0x716e('0x45')],{'$or':_[_0x716e('0x37')](_0x27447f[_0x716e('0x3e')],function(_0x30912a){var _0x3c0a22={};_0x3c0a22[_0x30912a]={'$like':'%'+_0x32276a[_0x716e('0x3b')][_0x716e('0x47')]+'%'};return _0x3c0a22;})});}_0x27447f=_[_0x716e('0x48')]({},_0x27447f,_0x32276a[_0x716e('0x52')]);return _0x4034a5[_0x716e('0x58')](_0x27447f);}})[_0x716e('0x1d')](function(_0x330fcd){if(_0x330fcd){_0xb84edf=_0x330fcd['length'];if(!_0x32276a[_0x716e('0x3b')][_0x716e('0x59')]('nolimit')){_0x27447f[_0x716e('0x42')]=qs[_0x716e('0x42')](_0x32276a[_0x716e('0x3b')][_0x716e('0x42')]);_0x27447f[_0x716e('0x2d')]=qs[_0x716e('0x2d')](_0x32276a[_0x716e('0x3b')][_0x716e('0x2d')]);}return _0x4034a5[_0x716e('0x58')](_0x27447f);}})[_0x716e('0x1d')](function(_0x2e9ffd){if(_0x2e9ffd){return _0x2e9ffd?{'count':_0xb84edf,'rows':_0x2e9ffd}:null;}})[_0x716e('0x1d')](respondWithResult(_0x54f4ab,null))[_0x716e('0x27')](handleError(_0x54f4ab,null));};exports[_0x716e('0x5a')]=function(_0x406e87,_0x2853e8,_0x1d07c8){var _0xb69e03={};var _0x1aa531={};var _0x3af163;var _0x5c0d50;return db[_0x716e('0x4b')][_0x716e('0x56')]({'where':{'id':_0x406e87['params']['id']}})['then'](handleEntityNotFound(_0x2853e8,null))[_0x716e('0x1d')](function(_0x594e5e){if(_0x594e5e){_0x3af163=_0x594e5e;_0x1aa531[_0x716e('0x3a')]=_['keys'](db[_0x716e('0x57')][_0x716e('0x38')]);_0x1aa531['query']=_['keys'](_0x406e87['query']);_0x1aa531[_0x716e('0x3d')]=_[_0x716e('0x51')](_0x1aa531[_0x716e('0x3a')],_0x1aa531[_0x716e('0x3b')]);_0xb69e03['attributes']=_[_0x716e('0x51')](_0x1aa531[_0x716e('0x3a')],qs['fields'](_0x406e87['query'][_0x716e('0x3f')]));_0xb69e03[_0x716e('0x3e')]=_0xb69e03[_0x716e('0x3e')][_0x716e('0x40')]?_0xb69e03[_0x716e('0x3e')]:_0x1aa531[_0x716e('0x3a')];_0xb69e03[_0x716e('0x43')]=qs[_0x716e('0x44')](_0x406e87[_0x716e('0x3b')]['sort']);_0xb69e03[_0x716e('0x45')]=qs[_0x716e('0x3d')](_[_0x716e('0x46')](_0x406e87[_0x716e('0x3b')],_0x1aa531[_0x716e('0x3d')]));if(_0x406e87[_0x716e('0x3b')][_0x716e('0x47')]){_0xb69e03[_0x716e('0x45')]=_[_0x716e('0x48')](_0xb69e03['where'],{'$or':_['map'](_0xb69e03[_0x716e('0x3e')],function(_0x30b7b5){var _0x39c23e={};_0x39c23e[_0x30b7b5]={'$like':'%'+_0x406e87['query']['filter']+'%'};return _0x39c23e;})});}_0xb69e03=_['merge']({},_0xb69e03,_0x406e87[_0x716e('0x52')]);return _0x3af163[_0x716e('0x5a')](_0xb69e03);}})[_0x716e('0x1d')](function(_0x52711f){if(_0x52711f){_0x5c0d50=_0x52711f[_0x716e('0x40')];if(!_0x406e87[_0x716e('0x3b')]['hasOwnProperty'](_0x716e('0x41'))){_0xb69e03[_0x716e('0x42')]=qs[_0x716e('0x42')](_0x406e87[_0x716e('0x3b')][_0x716e('0x42')]);_0xb69e03[_0x716e('0x2d')]=qs[_0x716e('0x2d')](_0x406e87[_0x716e('0x3b')][_0x716e('0x2d')]);}return _0x3af163[_0x716e('0x5a')](_0xb69e03);}})['then'](function(_0x12e496){if(_0x12e496){return _0x12e496?{'count':_0x5c0d50,'rows':_0x12e496}:null;}})[_0x716e('0x1d')](respondWithResult(_0x2853e8,null))['catch'](handleError(_0x2853e8,null));};exports[_0x716e('0x5b')]=function(_0x107338,_0x2c339b,_0x23dee6){var _0x2a01c8={};var _0x5ccc36={};var _0x386e54;var _0x24dc06;return db[_0x716e('0x4b')][_0x716e('0x56')]({'where':{'id':_0x107338['params']['id']}})[_0x716e('0x1d')](handleEntityNotFound(_0x2c339b,null))['then'](function(_0x3450db){if(_0x3450db){_0x386e54=_0x3450db;_0x5ccc36[_0x716e('0x3a')]=_[_0x716e('0x3c')](db['Dynamics365Field']['rawAttributes']);_0x5ccc36[_0x716e('0x3b')]=_['keys'](_0x107338['query']);_0x5ccc36[_0x716e('0x3d')]=_[_0x716e('0x51')](_0x5ccc36['model'],_0x5ccc36['query']);_0x2a01c8[_0x716e('0x3e')]=_[_0x716e('0x51')](_0x5ccc36[_0x716e('0x3a')],qs[_0x716e('0x3f')](_0x107338[_0x716e('0x3b')][_0x716e('0x3f')]));_0x2a01c8[_0x716e('0x3e')]=_0x2a01c8[_0x716e('0x3e')]['length']?_0x2a01c8[_0x716e('0x3e')]:_0x5ccc36[_0x716e('0x3a')];_0x2a01c8[_0x716e('0x43')]=qs[_0x716e('0x44')](_0x107338[_0x716e('0x3b')][_0x716e('0x44')]);_0x2a01c8[_0x716e('0x45')]=qs[_0x716e('0x3d')](_[_0x716e('0x46')](_0x107338[_0x716e('0x3b')],_0x5ccc36[_0x716e('0x3d')]));if(_0x107338['query'][_0x716e('0x47')]){_0x2a01c8[_0x716e('0x45')]=_['merge'](_0x2a01c8[_0x716e('0x45')],{'$or':_[_0x716e('0x37')](_0x2a01c8[_0x716e('0x3e')],function(_0x2ced89){var _0x8f77bd={};_0x8f77bd[_0x2ced89]={'$like':'%'+_0x107338[_0x716e('0x3b')][_0x716e('0x47')]+'%'};return _0x8f77bd;})});}_0x2a01c8=_[_0x716e('0x48')]({},_0x2a01c8,_0x107338[_0x716e('0x52')]);return _0x386e54[_0x716e('0x5b')](_0x2a01c8);}})[_0x716e('0x1d')](function(_0x358233){if(_0x358233){_0x24dc06=_0x358233[_0x716e('0x40')];if(!_0x107338[_0x716e('0x3b')][_0x716e('0x59')](_0x716e('0x41'))){_0x2a01c8[_0x716e('0x42')]=qs[_0x716e('0x42')](_0x107338[_0x716e('0x3b')][_0x716e('0x42')]);_0x2a01c8[_0x716e('0x2d')]=qs[_0x716e('0x2d')](_0x107338['query'][_0x716e('0x2d')]);}return _0x386e54[_0x716e('0x5b')](_0x2a01c8);}})[_0x716e('0x1d')](function(_0x16fd4b){if(_0x16fd4b){return _0x16fd4b?{'count':_0x24dc06,'rows':_0x16fd4b}:null;}})[_0x716e('0x1d')](respondWithResult(_0x2c339b,null))[_0x716e('0x27')](handleError(_0x2c339b,null));}; \ No newline at end of file +var _0x771c=['query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','VIRTUAL','options','Dynamics365Configuration','includeAll','include','findAll','catch','show','merge','find','create','body','destroy','getFields','params','Dynamics365Field','getSubjects','findOne','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','rawAttributes','fieldName','key','map','keys'];(function(_0x3551f1,_0x291833){var _0x1d890f=function(_0x1b1aea){while(--_0x1b1aea){_0x3551f1['push'](_0x3551f1['shift']());}};_0x1d890f(++_0x291833);}(_0x771c,0x81));var _0xc771=function(_0x311da3,_0x5040f3){_0x311da3=_0x311da3-0x0;var _0x3fea5a=_0x771c[_0x311da3];return _0x3fea5a;};'use strict';var pdf=require(_0xc771('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc771('0x1'));var zipdir=require(_0xc771('0x2'));var jsonpatch=require(_0xc771('0x3'));var rp=require(_0xc771('0x4'));var moment=require(_0xc771('0x5'));var BPromise=require(_0xc771('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xc771('0x7'));var sox=require(_0xc771('0x8'));var csv=require(_0xc771('0x9'));var ejs=require(_0xc771('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc771('0xb'));var crypto=require(_0xc771('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc771('0x9'));var querystring=require(_0xc771('0xd'));var Papa=require(_0xc771('0xe'));var Redis=require(_0xc771('0xf'));var authService=require(_0xc771('0x10'));var qs=require(_0xc771('0x11'));var as=require(_0xc771('0x12'));var hardwareService=require(_0xc771('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xc771('0x14'));var config=require('../../config/environment');var db=require(_0xc771('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc771('0x16')][_0xc771('0x17')]({'port':0x232a});function checkPasswordPattern(_0x2ec621,_0x522b9d,_0x4b4ac5){if(_0x4b4ac5){var _0x26d39e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26d39e[_0xc771('0x18')](_0x522b9d)){return _0x2ec621;}else{throw new db[(_0xc771('0x19'))][(_0xc771('0x1a'))](_0xc771('0x1b'));}}else{return _0x2ec621;}}function respondWithRpcPromise(_0x1d00c2,_0x2112d3,_0x10d8c3,_0x43b18e){return new BPromise(function(_0x30f276,_0x5db658){var _0x2aefba=_0x43b18e||client;return _0x2aefba[_0xc771('0x1c')](_0x1d00c2,_0x10d8c3)[_0xc771('0x1d')](function(_0x527132){logger[_0xc771('0x1e')](_0xc771('0x1f'),_0x2112d3,'request\x20sent');logger[_0xc771('0x20')](_0xc771('0x21'),_0x2112d3,'request\x20sent',JSON[_0xc771('0x22')](_0x527132));if(_0x527132[_0xc771('0x23')]){if(_0x527132[_0xc771('0x23')][_0xc771('0x24')]===0x1f4){logger[_0xc771('0x23')](_0xc771('0x1f'),_0x2112d3,_0x527132[_0xc771('0x23')][_0xc771('0x25')]);return _0x5db658(_0x527132[_0xc771('0x23')][_0xc771('0x25')]);}logger[_0xc771('0x23')](_0xc771('0x1f'),_0x2112d3,_0x527132[_0xc771('0x23')][_0xc771('0x25')]);return _0x30f276(_0x527132[_0xc771('0x23')][_0xc771('0x25')]);}else{logger['info'](_0xc771('0x1f'),_0x2112d3,_0xc771('0x26'));_0x30f276(_0x527132[_0xc771('0x27')][_0xc771('0x25')]);}})['catch'](function(_0x2231ae){logger[_0xc771('0x23')](_0xc771('0x1f'),_0x2112d3,_0x2231ae);_0x5db658(_0x2231ae);});});}function respondWithStatusCode(_0x1b06be,_0x2784fc){_0x2784fc=_0x2784fc||0xcc;return function(_0x2d9c09){if(_0x2d9c09){return _0x1b06be[_0xc771('0x28')](_0x2784fc);}return _0x1b06be['status'](_0x2784fc)[_0xc771('0x29')]();};}function respondWithResult(_0x526a44,_0xb58a4f){_0xb58a4f=_0xb58a4f||0xc8;return function(_0xf989da){if(_0xf989da){return _0x526a44[_0xc771('0x2a')](_0xb58a4f)[_0xc771('0x2b')](_0xf989da);}};}function respondWithFilteredResult(_0x1b5009,_0x44d81d){return function(_0x1e6eb2){if(_0x1e6eb2){var _0x5f3196=_0x1e6eb2[_0xc771('0x2c')],_0x37425d=_0x44d81d[_0xc771('0x2d')],_0x4cee29=_0x44d81d[_0xc771('0x2d')]+_0x44d81d[_0xc771('0x2e')],_0x118f2e;if(_0x4cee29>=_0x5f3196){_0x4cee29=_0x5f3196;_0x118f2e=0xc8;}else{_0x118f2e=0xce;}_0x1b5009[_0xc771('0x2a')](_0x118f2e);return _0x1b5009[_0xc771('0x2f')](_0xc771('0x30'),_0x37425d+'-'+_0x4cee29+'/'+_0x5f3196)[_0xc771('0x2b')](_0x1e6eb2);}return null;};}function patchUpdates(_0x511825){return function(_0x475dd8){try{jsonpatch[_0xc771('0x31')](_0x475dd8,_0x511825,!![]);}catch(_0x206278){return BPromise[_0xc771('0x32')](_0x206278);}return _0x475dd8[_0xc771('0x33')]();};}function saveUpdates(_0x245d9b,_0x2cf20e){return function(_0x5652ba){if(_0x5652ba){return _0x5652ba[_0xc771('0x34')](_0x245d9b)[_0xc771('0x1d')](function(_0x129e1c){return _0x129e1c;});}return null;};}function removeEntity(_0x498a7d,_0x55f180){return function(_0x33b8a1){if(_0x33b8a1){return _0x33b8a1['destroy']()[_0xc771('0x1d')](function(){_0x498a7d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd1d49c,_0x11f751){return function(_0x51ef20){if(!_0x51ef20){_0xd1d49c[_0xc771('0x28')](0x194);}return _0x51ef20;};}function handleError(_0x2af316,_0x25fdce){_0x25fdce=_0x25fdce||0x1f4;return function(_0x59f0d7){logger[_0xc771('0x23')](_0x59f0d7[_0xc771('0x35')]);if(_0x59f0d7[_0xc771('0x36')]){delete _0x59f0d7[_0xc771('0x36')];}_0x2af316[_0xc771('0x2a')](_0x25fdce)[_0xc771('0x37')](_0x59f0d7);};}exports['index']=function(_0x6b969d,_0x5ba286){var _0x5cd823={},_0x123ab1={},_0x2eb096={'count':0x0,'rows':[]};var _0x5bd27b=_['map'](db['Dynamics365Configuration'][_0xc771('0x38')],function(_0x5a91cf){return{'name':_0x5a91cf[_0xc771('0x39')],'type':_0x5a91cf['type'][_0xc771('0x3a')]};});_0x123ab1['model']=_[_0xc771('0x3b')](_0x5bd27b,_0xc771('0x36'));_0x123ab1['query']=_[_0xc771('0x3c')](_0x6b969d[_0xc771('0x3d')]);_0x123ab1[_0xc771('0x3e')]=_[_0xc771('0x3f')](_0x123ab1[_0xc771('0x40')],_0x123ab1['query']);_0x5cd823['attributes']=_[_0xc771('0x3f')](_0x123ab1[_0xc771('0x40')],qs[_0xc771('0x41')](_0x6b969d[_0xc771('0x3d')]['fields']));_0x5cd823['attributes']=_0x5cd823[_0xc771('0x42')][_0xc771('0x43')]?_0x5cd823[_0xc771('0x42')]:_0x123ab1[_0xc771('0x40')];if(!_0x6b969d['query'][_0xc771('0x44')](_0xc771('0x45'))){_0x5cd823[_0xc771('0x2e')]=qs['limit'](_0x6b969d[_0xc771('0x3d')][_0xc771('0x2e')]);_0x5cd823[_0xc771('0x2d')]=qs[_0xc771('0x2d')](_0x6b969d['query'][_0xc771('0x2d')]);}_0x5cd823[_0xc771('0x46')]=qs[_0xc771('0x47')](_0x6b969d['query'][_0xc771('0x47')]);_0x5cd823[_0xc771('0x48')]=qs['filters'](_[_0xc771('0x49')](_0x6b969d['query'],_0x123ab1[_0xc771('0x3e')]));if(_0x6b969d[_0xc771('0x3d')][_0xc771('0x4a')]){_0x5cd823[_0xc771('0x48')]=_['merge'](_0x5cd823['where'],{'$or':_[_0xc771('0x3b')](_0x5bd27b,function(_0x1e9947){if(_0x1e9947[_0xc771('0x4b')]!==_0xc771('0x4c')){var _0x3c5dd9={};_0x3c5dd9[_0x1e9947[_0xc771('0x36')]]={'$like':'%'+_0x6b969d[_0xc771('0x3d')][_0xc771('0x4a')]+'%'};return _0x3c5dd9;}})});}_0x5cd823=_['merge']({},_0x5cd823,_0x6b969d[_0xc771('0x4d')]);var _0x47f275={'where':_0x5cd823[_0xc771('0x48')]};return db[_0xc771('0x4e')][_0xc771('0x2c')](_0x47f275)[_0xc771('0x1d')](function(_0x4481fc){_0x2eb096[_0xc771('0x2c')]=_0x4481fc;if(_0x6b969d[_0xc771('0x3d')][_0xc771('0x4f')]){_0x5cd823[_0xc771('0x50')]=[{'all':!![]}];}return db['Dynamics365Configuration'][_0xc771('0x51')](_0x5cd823);})['then'](function(_0x2fb564){_0x2eb096['rows']=_0x2fb564;return _0x2eb096;})['then'](respondWithFilteredResult(_0x5ba286,_0x5cd823))[_0xc771('0x52')](handleError(_0x5ba286,null));};exports[_0xc771('0x53')]=function(_0x563872,_0x1b8dc1){var _0x1644da={'raw':![],'where':{'id':_0x563872['params']['id']}},_0x490d25={};_0x490d25['model']=_[_0xc771('0x3c')](db['Dynamics365Configuration'][_0xc771('0x38')]);_0x490d25[_0xc771('0x3d')]=_['keys'](_0x563872[_0xc771('0x3d')]);_0x490d25[_0xc771('0x3e')]=_[_0xc771('0x3f')](_0x490d25[_0xc771('0x40')],_0x490d25[_0xc771('0x3d')]);_0x1644da[_0xc771('0x42')]=_['intersection'](_0x490d25[_0xc771('0x40')],qs['fields'](_0x563872[_0xc771('0x3d')][_0xc771('0x41')]));_0x1644da[_0xc771('0x42')]=_0x1644da[_0xc771('0x42')][_0xc771('0x43')]?_0x1644da[_0xc771('0x42')]:_0x490d25[_0xc771('0x40')];if(_0x563872[_0xc771('0x3d')][_0xc771('0x4f')]){_0x1644da[_0xc771('0x50')]=[{'all':!![]}];}_0x1644da=_[_0xc771('0x54')]({},_0x1644da,_0x563872['options']);return db[_0xc771('0x4e')][_0xc771('0x55')](_0x1644da)['then'](handleEntityNotFound(_0x1b8dc1,null))['then'](respondWithResult(_0x1b8dc1,null))[_0xc771('0x52')](handleError(_0x1b8dc1,null));};exports['create']=function(_0x1a50bf,_0x302f67){return db[_0xc771('0x4e')][_0xc771('0x56')](_0x1a50bf[_0xc771('0x57')],{})[_0xc771('0x1d')](respondWithResult(_0x302f67,0xc9))[_0xc771('0x52')](handleError(_0x302f67,null));};exports[_0xc771('0x34')]=function(_0x3b0daa,_0x337a20){if(_0x3b0daa[_0xc771('0x57')]['id']){delete _0x3b0daa[_0xc771('0x57')]['id'];}return db[_0xc771('0x4e')][_0xc771('0x55')]({'where':{'id':_0x3b0daa['params']['id']}})[_0xc771('0x1d')](handleEntityNotFound(_0x337a20,null))[_0xc771('0x1d')](saveUpdates(_0x3b0daa[_0xc771('0x57')],null))[_0xc771('0x1d')](respondWithResult(_0x337a20,null))[_0xc771('0x52')](handleError(_0x337a20,null));};exports[_0xc771('0x58')]=function(_0x5e1848,_0x353752){return db[_0xc771('0x4e')][_0xc771('0x55')]({'where':{'id':_0x5e1848['params']['id']}})['then'](handleEntityNotFound(_0x353752,null))[_0xc771('0x1d')](removeEntity(_0x353752,null))['catch'](handleError(_0x353752,null));};exports[_0xc771('0x59')]=function(_0x5e86be,_0x205c71,_0x228dfe){var _0xb6af6={};var _0x4cd895={};var _0x52cc06;var _0x794d66;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x5e86be[_0xc771('0x5a')]['id']}})[_0xc771('0x1d')](handleEntityNotFound(_0x205c71,null))[_0xc771('0x1d')](function(_0x2f35db){if(_0x2f35db){_0x52cc06=_0x2f35db;_0x4cd895['model']=_[_0xc771('0x3c')](db[_0xc771('0x5b')][_0xc771('0x38')]);_0x4cd895[_0xc771('0x3d')]=_[_0xc771('0x3c')](_0x5e86be[_0xc771('0x3d')]);_0x4cd895[_0xc771('0x3e')]=_['intersection'](_0x4cd895[_0xc771('0x40')],_0x4cd895['query']);_0xb6af6[_0xc771('0x42')]=_[_0xc771('0x3f')](_0x4cd895[_0xc771('0x40')],qs[_0xc771('0x41')](_0x5e86be[_0xc771('0x3d')][_0xc771('0x41')]));_0xb6af6[_0xc771('0x42')]=_0xb6af6[_0xc771('0x42')]['length']?_0xb6af6['attributes']:_0x4cd895['model'];_0xb6af6[_0xc771('0x46')]=qs[_0xc771('0x47')](_0x5e86be['query'][_0xc771('0x47')]);_0xb6af6[_0xc771('0x48')]=qs['filters'](_[_0xc771('0x49')](_0x5e86be[_0xc771('0x3d')],_0x4cd895[_0xc771('0x3e')]));if(_0x5e86be['query'][_0xc771('0x4a')]){_0xb6af6[_0xc771('0x48')]=_[_0xc771('0x54')](_0xb6af6['where'],{'$or':_[_0xc771('0x3b')](_0xb6af6[_0xc771('0x42')],function(_0x2f634d){var _0x235390={};_0x235390[_0x2f634d]={'$like':'%'+_0x5e86be[_0xc771('0x3d')][_0xc771('0x4a')]+'%'};return _0x235390;})});}_0xb6af6=_[_0xc771('0x54')]({},_0xb6af6,_0x5e86be[_0xc771('0x4d')]);return _0x52cc06[_0xc771('0x59')](_0xb6af6);}})[_0xc771('0x1d')](function(_0x565bc8){if(_0x565bc8){_0x794d66=_0x565bc8['length'];if(!_0x5e86be[_0xc771('0x3d')][_0xc771('0x44')](_0xc771('0x45'))){_0xb6af6[_0xc771('0x2e')]=qs[_0xc771('0x2e')](_0x5e86be['query'][_0xc771('0x2e')]);_0xb6af6[_0xc771('0x2d')]=qs[_0xc771('0x2d')](_0x5e86be['query']['offset']);}return _0x52cc06[_0xc771('0x59')](_0xb6af6);}})[_0xc771('0x1d')](function(_0x19d755){if(_0x19d755){return _0x19d755?{'count':_0x794d66,'rows':_0x19d755}:null;}})['then'](respondWithResult(_0x205c71,null))['catch'](handleError(_0x205c71,null));};exports['getSubjects']=function(_0x1413b6,_0x339dff,_0x5c335b){var _0x1743e2={};var _0x578ffa={};var _0x23ec5f;var _0x1bafbc;return db[_0xc771('0x4e')]['findOne']({'where':{'id':_0x1413b6[_0xc771('0x5a')]['id']}})['then'](handleEntityNotFound(_0x339dff,null))['then'](function(_0x1d0e00){if(_0x1d0e00){_0x23ec5f=_0x1d0e00;_0x578ffa[_0xc771('0x40')]=_[_0xc771('0x3c')](db[_0xc771('0x5b')][_0xc771('0x38')]);_0x578ffa[_0xc771('0x3d')]=_[_0xc771('0x3c')](_0x1413b6['query']);_0x578ffa[_0xc771('0x3e')]=_[_0xc771('0x3f')](_0x578ffa[_0xc771('0x40')],_0x578ffa['query']);_0x1743e2['attributes']=_['intersection'](_0x578ffa[_0xc771('0x40')],qs[_0xc771('0x41')](_0x1413b6[_0xc771('0x3d')]['fields']));_0x1743e2['attributes']=_0x1743e2[_0xc771('0x42')][_0xc771('0x43')]?_0x1743e2['attributes']:_0x578ffa[_0xc771('0x40')];_0x1743e2['order']=qs[_0xc771('0x47')](_0x1413b6['query'][_0xc771('0x47')]);_0x1743e2[_0xc771('0x48')]=qs[_0xc771('0x3e')](_[_0xc771('0x49')](_0x1413b6['query'],_0x578ffa[_0xc771('0x3e')]));if(_0x1413b6[_0xc771('0x3d')][_0xc771('0x4a')]){_0x1743e2['where']=_[_0xc771('0x54')](_0x1743e2[_0xc771('0x48')],{'$or':_[_0xc771('0x3b')](_0x1743e2[_0xc771('0x42')],function(_0x14c5c2){var _0x23b2a1={};_0x23b2a1[_0x14c5c2]={'$like':'%'+_0x1413b6[_0xc771('0x3d')][_0xc771('0x4a')]+'%'};return _0x23b2a1;})});}_0x1743e2=_[_0xc771('0x54')]({},_0x1743e2,_0x1413b6[_0xc771('0x4d')]);return _0x23ec5f[_0xc771('0x5c')](_0x1743e2);}})['then'](function(_0x137466){if(_0x137466){_0x1bafbc=_0x137466[_0xc771('0x43')];if(!_0x1413b6[_0xc771('0x3d')][_0xc771('0x44')](_0xc771('0x45'))){_0x1743e2[_0xc771('0x2e')]=qs['limit'](_0x1413b6[_0xc771('0x3d')][_0xc771('0x2e')]);_0x1743e2[_0xc771('0x2d')]=qs[_0xc771('0x2d')](_0x1413b6[_0xc771('0x3d')][_0xc771('0x2d')]);}return _0x23ec5f[_0xc771('0x5c')](_0x1743e2);}})['then'](function(_0x43a1f5){if(_0x43a1f5){return _0x43a1f5?{'count':_0x1bafbc,'rows':_0x43a1f5}:null;}})[_0xc771('0x1d')](respondWithResult(_0x339dff,null))[_0xc771('0x52')](handleError(_0x339dff,null));};exports['getDescriptions']=function(_0x52f6b6,_0x478199,_0x759546){var _0x5f22b2={};var _0x3b10ef={};var _0x19c8c5;var _0x4e7789;return db['Dynamics365Configuration'][_0xc771('0x5d')]({'where':{'id':_0x52f6b6[_0xc771('0x5a')]['id']}})[_0xc771('0x1d')](handleEntityNotFound(_0x478199,null))[_0xc771('0x1d')](function(_0x256dac){if(_0x256dac){_0x19c8c5=_0x256dac;_0x3b10ef[_0xc771('0x40')]=_['keys'](db[_0xc771('0x5b')][_0xc771('0x38')]);_0x3b10ef['query']=_[_0xc771('0x3c')](_0x52f6b6['query']);_0x3b10ef['filters']=_[_0xc771('0x3f')](_0x3b10ef[_0xc771('0x40')],_0x3b10ef[_0xc771('0x3d')]);_0x5f22b2[_0xc771('0x42')]=_[_0xc771('0x3f')](_0x3b10ef['model'],qs[_0xc771('0x41')](_0x52f6b6[_0xc771('0x3d')]['fields']));_0x5f22b2[_0xc771('0x42')]=_0x5f22b2['attributes']['length']?_0x5f22b2[_0xc771('0x42')]:_0x3b10ef['model'];_0x5f22b2[_0xc771('0x46')]=qs[_0xc771('0x47')](_0x52f6b6[_0xc771('0x3d')][_0xc771('0x47')]);_0x5f22b2['where']=qs[_0xc771('0x3e')](_[_0xc771('0x49')](_0x52f6b6[_0xc771('0x3d')],_0x3b10ef[_0xc771('0x3e')]));if(_0x52f6b6[_0xc771('0x3d')][_0xc771('0x4a')]){_0x5f22b2[_0xc771('0x48')]=_[_0xc771('0x54')](_0x5f22b2[_0xc771('0x48')],{'$or':_[_0xc771('0x3b')](_0x5f22b2['attributes'],function(_0x48a30a){var _0x3cb7e1={};_0x3cb7e1[_0x48a30a]={'$like':'%'+_0x52f6b6['query'][_0xc771('0x4a')]+'%'};return _0x3cb7e1;})});}_0x5f22b2=_[_0xc771('0x54')]({},_0x5f22b2,_0x52f6b6['options']);return _0x19c8c5[_0xc771('0x5e')](_0x5f22b2);}})[_0xc771('0x1d')](function(_0x3295bd){if(_0x3295bd){_0x4e7789=_0x3295bd[_0xc771('0x43')];if(!_0x52f6b6['query'][_0xc771('0x44')](_0xc771('0x45'))){_0x5f22b2[_0xc771('0x2e')]=qs[_0xc771('0x2e')](_0x52f6b6[_0xc771('0x3d')][_0xc771('0x2e')]);_0x5f22b2[_0xc771('0x2d')]=qs[_0xc771('0x2d')](_0x52f6b6[_0xc771('0x3d')][_0xc771('0x2d')]);}return _0x19c8c5[_0xc771('0x5e')](_0x5f22b2);}})[_0xc771('0x1d')](function(_0x74ece1){if(_0x74ece1){return _0x74ece1?{'count':_0x4e7789,'rows':_0x74ece1}:null;}})[_0xc771('0x1d')](respondWithResult(_0x478199,null))[_0xc771('0x52')](handleError(_0x478199,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 5cb027a..60c38e6 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 _0x7c22=['lodash','util','api','moment','request-promise','path','./intDynamics365Configuration.attributes','define','Dynamics365Configuration'];(function(_0x2cbc91,_0x4406a7){var _0x195acc=function(_0xba0485){while(--_0xba0485){_0x2cbc91['push'](_0x2cbc91['shift']());}};_0x195acc(++_0x4406a7);}(_0x7c22,0x6c));var _0x27c2=function(_0x146d23,_0x27bd31){_0x146d23=_0x146d23-0x0;var _0x4986f8=_0x7c22[_0x146d23];return _0x4986f8;};'use strict';var _=require(_0x27c2('0x0'));var util=require(_0x27c2('0x1'));var logger=require('../../config/logger')(_0x27c2('0x2'));var moment=require(_0x27c2('0x3'));var BPromise=require('bluebird');var rp=require(_0x27c2('0x4'));var fs=require('fs');var path=require(_0x27c2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x27c2('0x6'));module['exports']=function(_0x28548d,_0x5006bd){return _0x28548d[_0x27c2('0x7')](_0x27c2('0x8'),attributes,{'tableName':'int_dynamics365_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6da=['exports','define','int_dynamics365_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes'];(function(_0x3c67ec,_0x3f3049){var _0x2d8ff1=function(_0x624e22){while(--_0x624e22){_0x3c67ec['push'](_0x3c67ec['shift']());}};_0x2d8ff1(++_0x3f3049);}(_0xf6da,0x65));var _0xaf6d=function(_0x4ec5f4,_0x584a14){_0x4ec5f4=_0x4ec5f4-0x0;var _0x1a4fd6=_0xf6da[_0x4ec5f4];return _0x1a4fd6;};'use strict';var _=require(_0xaf6d('0x0'));var util=require(_0xaf6d('0x1'));var logger=require(_0xaf6d('0x2'))(_0xaf6d('0x3'));var moment=require(_0xaf6d('0x4'));var BPromise=require(_0xaf6d('0x5'));var rp=require(_0xaf6d('0x6'));var fs=require('fs');var path=require(_0xaf6d('0x7'));var rimraf=require(_0xaf6d('0x8'));var config=require(_0xaf6d('0x9'));var attributes=require(_0xaf6d('0xa'));module[_0xaf6d('0xb')]=function(_0x4fafab,_0x268e28){return _0x4fafab[_0xaf6d('0xc')]('Dynamics365Configuration',attributes,{'tableName':_0xaf6d('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 80fb85e..7245877 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 _0xb4c1=['Dynamics365Configuration,\x20%s,\x20%s,\x20%s','code','error','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb4c1,0x165));var _0x1b4c=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xb4c1[_0x46698a];return _0x356db0;};'use strict';var _=require(_0x1b4c('0x0'));var util=require(_0x1b4c('0x1'));var moment=require(_0x1b4c('0x2'));var BPromise=require(_0x1b4c('0x3'));var rs=require(_0x1b4c('0x4'));var fs=require('fs');var Redis=require(_0x1b4c('0x5'));var db=require(_0x1b4c('0x6'))['db'];var utils=require(_0x1b4c('0x7'));var logger=require(_0x1b4c('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1b4c('0x9'));var client=jayson[_0x1b4c('0xa')][_0x1b4c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xca3682,_0x3e8b34,_0x4238fe){return new BPromise(function(_0x4e045e,_0x2c8297){return client['request'](_0xca3682,_0x4238fe)[_0x1b4c('0xc')](function(_0x45b152){logger[_0x1b4c('0xd')](_0x1b4c('0xe'),_0x3e8b34,_0x1b4c('0xf'));logger[_0x1b4c('0x10')](_0x1b4c('0x11'),_0x3e8b34,_0x1b4c('0xf'),JSON['stringify'](_0x45b152));if(_0x45b152['error']){if(_0x45b152['error'][_0x1b4c('0x12')]===0x1f4){logger[_0x1b4c('0x13')](_0x1b4c('0xe'),_0x3e8b34,_0x45b152[_0x1b4c('0x13')][_0x1b4c('0x14')]);return _0x2c8297(_0x45b152[_0x1b4c('0x13')][_0x1b4c('0x14')]);}logger[_0x1b4c('0x13')](_0x1b4c('0xe'),_0x3e8b34,_0x45b152[_0x1b4c('0x13')][_0x1b4c('0x14')]);return _0x4e045e(_0x45b152[_0x1b4c('0x13')][_0x1b4c('0x14')]);}else{logger[_0x1b4c('0xd')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3e8b34,'request\x20sent');_0x4e045e(_0x45b152[_0x1b4c('0x15')][_0x1b4c('0x14')]);}})['catch'](function(_0x390717){logger[_0x1b4c('0x13')](_0x1b4c('0xe'),_0x3e8b34,_0x390717);_0x2c8297(_0x390717);});});} \ No newline at end of file +var _0xcc52=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','code','error','Dynamics365Configuration,\x20%s,\x20%s','message','info','result'];(function(_0x59befa,_0x4af99b){var _0x1dd63d=function(_0x4c1df4){while(--_0x4c1df4){_0x59befa['push'](_0x59befa['shift']());}};_0x1dd63d(++_0x4af99b);}(_0xcc52,0x79));var _0x2cc5=function(_0xe19cb5,_0x225e91){_0xe19cb5=_0xe19cb5-0x0;var _0x580872=_0xcc52[_0xe19cb5];return _0x580872;};'use strict';var _=require(_0x2cc5('0x0'));var util=require(_0x2cc5('0x1'));var moment=require(_0x2cc5('0x2'));var BPromise=require(_0x2cc5('0x3'));var rs=require(_0x2cc5('0x4'));var fs=require('fs');var Redis=require(_0x2cc5('0x5'));var db=require(_0x2cc5('0x6'))['db'];var utils=require(_0x2cc5('0x7'));var logger=require(_0x2cc5('0x8'))('rpc');var config=require(_0x2cc5('0x9'));var jayson=require(_0x2cc5('0xa'));var client=jayson[_0x2cc5('0xb')][_0x2cc5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4b482b,_0x4b3e37,_0x512470){return new BPromise(function(_0x1cfbac,_0x1d1f21){return client[_0x2cc5('0xd')](_0x4b482b,_0x512470)['then'](function(_0x33cecb){logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x4b3e37,_0x2cc5('0xe'));logger[_0x2cc5('0xf')](_0x2cc5('0x10'),_0x4b3e37,_0x2cc5('0xe'),JSON['stringify'](_0x33cecb));if(_0x33cecb['error']){if(_0x33cecb['error'][_0x2cc5('0x11')]===0x1f4){logger[_0x2cc5('0x12')](_0x2cc5('0x13'),_0x4b3e37,_0x33cecb[_0x2cc5('0x12')]['message']);return _0x1d1f21(_0x33cecb['error'][_0x2cc5('0x14')]);}logger[_0x2cc5('0x12')](_0x2cc5('0x13'),_0x4b3e37,_0x33cecb[_0x2cc5('0x12')]['message']);return _0x1cfbac(_0x33cecb[_0x2cc5('0x12')]['message']);}else{logger[_0x2cc5('0x15')](_0x2cc5('0x13'),_0x4b3e37,_0x2cc5('0xe'));_0x1cfbac(_0x33cecb[_0x2cc5('0x16')][_0x2cc5('0x14')]);}})[_0x2cc5('0x17')](function(_0x1d3848){logger['error'](_0x2cc5('0x13'),_0x4b3e37,_0x1d3848);_0x1d1f21(_0x1d3848);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 43e2468..3116c27 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 _0x1d2d=['get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./intDynamics365Field.controller'];(function(_0x15f8ad,_0x5275c3){var _0xc0238a=function(_0x5550c8){while(--_0x5550c8){_0x15f8ad['push'](_0x15f8ad['shift']());}};_0xc0238a(++_0x5275c3);}(_0x1d2d,0xf0));var _0xd1d2=function(_0x1722a6,_0x40d7ee){_0x1722a6=_0x1722a6-0x0;var _0x842edb=_0x1d2d[_0x1722a6];return _0x842edb;};'use strict';var multer=require(_0xd1d2('0x0'));var util=require(_0xd1d2('0x1'));var path=require(_0xd1d2('0x2'));var timeout=require(_0xd1d2('0x3'));var express=require(_0xd1d2('0x4'));var router=express['Router']();var auth=require(_0xd1d2('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xd1d2('0x6'));router[_0xd1d2('0x7')]('/',auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x9')]);router[_0xd1d2('0x7')](_0xd1d2('0xa'),auth['isAuthenticated'](),controller[_0xd1d2('0xb')]);router[_0xd1d2('0xc')]('/',auth[_0xd1d2('0x8')](),controller[_0xd1d2('0xd')]);router[_0xd1d2('0xe')](_0xd1d2('0xa'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0xf')]);router[_0xd1d2('0x10')](_0xd1d2('0xa'),auth[_0xd1d2('0x8')](),controller[_0xd1d2('0x11')]);module[_0xd1d2('0x12')]=router; \ No newline at end of file +var _0xa699=['/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index'];(function(_0x31eec6,_0x131d6d){var _0x9cdfb7=function(_0x617308){while(--_0x617308){_0x31eec6['push'](_0x31eec6['shift']());}};_0x9cdfb7(++_0x131d6d);}(_0xa699,0x6b));var _0x9a69=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0xa699[_0x4e198a];return _0xb84bfe;};'use strict';var multer=require(_0x9a69('0x0'));var util=require(_0x9a69('0x1'));var path=require(_0x9a69('0x2'));var timeout=require(_0x9a69('0x3'));var express=require(_0x9a69('0x4'));var router=express[_0x9a69('0x5')]();var auth=require(_0x9a69('0x6'));var interaction=require(_0x9a69('0x7'));var config=require(_0x9a69('0x8'));var controller=require(_0x9a69('0x9'));router[_0x9a69('0xa')]('/',auth[_0x9a69('0xb')](),controller[_0x9a69('0xc')]);router['get'](_0x9a69('0xd'),auth[_0x9a69('0xb')](),controller[_0x9a69('0xe')]);router[_0x9a69('0xf')]('/',auth['isAuthenticated'](),controller[_0x9a69('0x10')]);router[_0x9a69('0x11')](_0x9a69('0xd'),auth[_0x9a69('0xb')](),controller[_0x9a69('0x12')]);router['delete']('/:id',auth[_0x9a69('0xb')](),controller['destroy']);module[_0x9a69('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 771b965..f31bdca 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 _0x342b=['STRING','customVariable','sequelize','ENUM','string','variable'];(function(_0x288efb,_0x161974){var _0x2e6af9=function(_0x3a2bfc){while(--_0x3a2bfc){_0x288efb['push'](_0x288efb['shift']());}};_0x2e6af9(++_0x161974);}(_0x342b,0xbc));var _0xb342=function(_0x3de06e,_0x262a15){_0x3de06e=_0x3de06e-0x0;var _0x2a763f=_0x342b[_0x3de06e];return _0x2a763f;};'use strict';var Sequelize=require(_0xb342('0x0'));module['exports']={'type':{'type':Sequelize[_0xb342('0x1')](_0xb342('0x2'),_0xb342('0x3'),'customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb342('0x4')]},'keyType':{'type':Sequelize[_0xb342('0x1')](_0xb342('0x2'),_0xb342('0x3'),_0xb342('0x5'))},'keyContent':{'type':Sequelize[_0xb342('0x4')]},'idField':{'type':Sequelize[_0xb342('0x4')]},'nameField':{'type':Sequelize[_0xb342('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9a0b=['keyValue','STRING','variable','BOOLEAN','exports','ENUM','string','customVariable'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9a0b,0x7c));var _0xb9a0=function(_0x276d82,_0x4f51dd){_0x276d82=_0x276d82-0x0;var _0x201190=_0x9a0b[_0x276d82];return _0x201190;};'use strict';var Sequelize=require('sequelize');module[_0xb9a0('0x0')]={'type':{'type':Sequelize[_0xb9a0('0x1')](_0xb9a0('0x2'),'variable',_0xb9a0('0x3'),_0xb9a0('0x4')),'defaultValue':_0xb9a0('0x2')},'content':{'type':Sequelize[_0xb9a0('0x5')]},'key':{'type':Sequelize[_0xb9a0('0x5')]},'keyType':{'type':Sequelize[_0xb9a0('0x1')]('string',_0xb9a0('0x6'),_0xb9a0('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb9a0('0x5')]},'customField':{'type':Sequelize[_0xb9a0('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb9a0('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 7d9ccb1..a1b49fb 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 _0x4137=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','catch','show','params','keys','rawAttributes','length','includeAll','include','create','body','destroy','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','update','then','end','error','name','send','index','map','Dynamics365Field','type','key','model','query','filters','intersection'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4137,0xf8));var _0x7413=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4137[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x7413('0x0'));var emlformat=require(_0x7413('0x1'));var rimraf=require(_0x7413('0x2'));var zipdir=require(_0x7413('0x3'));var jsonpatch=require(_0x7413('0x4'));var rp=require(_0x7413('0x5'));var moment=require(_0x7413('0x6'));var BPromise=require(_0x7413('0x7'));var Mustache=require(_0x7413('0x8'));var util=require(_0x7413('0x9'));var path=require(_0x7413('0xa'));var sox=require(_0x7413('0xb'));var csv=require('to-csv');var ejs=require(_0x7413('0xc'));var fs=require('fs');var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0x11'));var querystring=require('querystring');var Papa=require(_0x7413('0x12'));var Redis=require(_0x7413('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x14'));var as=require(_0x7413('0x15'));var hardwareService=require(_0x7413('0x16'));var logger=require(_0x7413('0x17'))(_0x7413('0x18'));var utils=require('../../config/utils');var config=require(_0x7413('0x19'));var db=require(_0x7413('0x1a'))['db'];function respondWithStatusCode(_0x4bf07d,_0x18a874){_0x18a874=_0x18a874||0xcc;return function(_0xa26ca4){if(_0xa26ca4){return _0x4bf07d[_0x7413('0x1b')](_0x18a874);}return _0x4bf07d['status'](_0x18a874)['end']();};}function respondWithResult(_0x55ef69,_0x2267f6){_0x2267f6=_0x2267f6||0xc8;return function(_0x336c4c){if(_0x336c4c){return _0x55ef69['status'](_0x2267f6)[_0x7413('0x1c')](_0x336c4c);}};}function respondWithFilteredResult(_0x45bef0,_0x4955d3){return function(_0x38b3d1){if(_0x38b3d1){var _0x50f301=_0x38b3d1[_0x7413('0x1d')],_0x4b9a5b=_0x4955d3['offset'],_0x26501b=_0x4955d3[_0x7413('0x1e')]+_0x4955d3[_0x7413('0x1f')],_0x568d1f;if(_0x26501b>=_0x50f301){_0x26501b=_0x50f301;_0x568d1f=0xc8;}else{_0x568d1f=0xce;}_0x45bef0[_0x7413('0x20')](_0x568d1f);return _0x45bef0[_0x7413('0x21')](_0x7413('0x22'),_0x4b9a5b+'-'+_0x26501b+'/'+_0x50f301)[_0x7413('0x1c')](_0x38b3d1);}return null;};}function patchUpdates(_0x51194e){return function(_0xecc3e){try{jsonpatch[_0x7413('0x23')](_0xecc3e,_0x51194e,!![]);}catch(_0x11f8a1){return BPromise[_0x7413('0x24')](_0x11f8a1);}return _0xecc3e['save']();};}function saveUpdates(_0x239d0e,_0x12d94d){return function(_0x206afc){if(_0x206afc){return _0x206afc[_0x7413('0x25')](_0x239d0e)[_0x7413('0x26')](function(_0x2d220f){return _0x2d220f;});}return null;};}function removeEntity(_0x4886e3,_0x4e18cb){return function(_0x56a06a){if(_0x56a06a){return _0x56a06a['destroy']()[_0x7413('0x26')](function(){_0x4886e3['status'](0xcc)[_0x7413('0x27')]();});}};}function handleEntityNotFound(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(!_0x2fc0f4){_0x372944[_0x7413('0x1b')](0x194);}return _0x2fc0f4;};}function handleError(_0x346ce8,_0x1d97fd){_0x1d97fd=_0x1d97fd||0x1f4;return function(_0x41cb5d){logger[_0x7413('0x28')](_0x41cb5d['stack']);if(_0x41cb5d['name']){delete _0x41cb5d[_0x7413('0x29')];}_0x346ce8['status'](_0x1d97fd)[_0x7413('0x2a')](_0x41cb5d);};}exports[_0x7413('0x2b')]=function(_0x463b21,_0x4c2e90){var _0x35e0fd={},_0x896552={},_0x79cab6={'count':0x0,'rows':[]};var _0x4843fd=_[_0x7413('0x2c')](db[_0x7413('0x2d')]['rawAttributes'],function(_0x24dce7){return{'name':_0x24dce7['fieldName'],'type':_0x24dce7[_0x7413('0x2e')][_0x7413('0x2f')]};});_0x896552[_0x7413('0x30')]=_[_0x7413('0x2c')](_0x4843fd,_0x7413('0x29'));_0x896552[_0x7413('0x31')]=_['keys'](_0x463b21[_0x7413('0x31')]);_0x896552[_0x7413('0x32')]=_[_0x7413('0x33')](_0x896552[_0x7413('0x30')],_0x896552[_0x7413('0x31')]);_0x35e0fd[_0x7413('0x34')]=_[_0x7413('0x33')](_0x896552['model'],qs[_0x7413('0x35')](_0x463b21[_0x7413('0x31')][_0x7413('0x35')]));_0x35e0fd[_0x7413('0x34')]=_0x35e0fd[_0x7413('0x34')]['length']?_0x35e0fd[_0x7413('0x34')]:_0x896552['model'];if(!_0x463b21[_0x7413('0x31')][_0x7413('0x36')](_0x7413('0x37'))){_0x35e0fd['limit']=qs[_0x7413('0x1f')](_0x463b21['query'][_0x7413('0x1f')]);_0x35e0fd[_0x7413('0x1e')]=qs['offset'](_0x463b21['query'][_0x7413('0x1e')]);}_0x35e0fd[_0x7413('0x38')]=qs[_0x7413('0x39')](_0x463b21['query']['sort']);_0x35e0fd[_0x7413('0x3a')]=qs['filters'](_['pick'](_0x463b21[_0x7413('0x31')],_0x896552['filters']));if(_0x463b21[_0x7413('0x31')][_0x7413('0x3b')]){_0x35e0fd[_0x7413('0x3a')]=_[_0x7413('0x3c')](_0x35e0fd[_0x7413('0x3a')],{'$or':_['map'](_0x4843fd,function(_0xa58bd2){if(_0xa58bd2[_0x7413('0x2e')]!==_0x7413('0x3d')){var _0xfa34ef={};_0xfa34ef[_0xa58bd2[_0x7413('0x29')]]={'$like':'%'+_0x463b21[_0x7413('0x31')][_0x7413('0x3b')]+'%'};return _0xfa34ef;}})});}_0x35e0fd=_[_0x7413('0x3c')]({},_0x35e0fd,_0x463b21[_0x7413('0x3e')]);var _0x26a241={'where':_0x35e0fd[_0x7413('0x3a')]};return db[_0x7413('0x2d')]['count'](_0x26a241)[_0x7413('0x26')](function(_0x4d854d){_0x79cab6['count']=_0x4d854d;if(_0x463b21['query']['includeAll']){_0x35e0fd['include']=[{'all':!![]}];}return db[_0x7413('0x2d')]['findAll'](_0x35e0fd);})['then'](function(_0x5dc077){_0x79cab6['rows']=_0x5dc077;return _0x79cab6;})['then'](respondWithFilteredResult(_0x4c2e90,_0x35e0fd))[_0x7413('0x3f')](handleError(_0x4c2e90,null));};exports[_0x7413('0x40')]=function(_0x18674c,_0x41ba22){var _0x8049c0={'raw':!![],'where':{'id':_0x18674c[_0x7413('0x41')]['id']}},_0x57cb9e={};_0x57cb9e['model']=_[_0x7413('0x42')](db[_0x7413('0x2d')][_0x7413('0x43')]);_0x57cb9e[_0x7413('0x31')]=_[_0x7413('0x42')](_0x18674c[_0x7413('0x31')]);_0x57cb9e[_0x7413('0x32')]=_[_0x7413('0x33')](_0x57cb9e[_0x7413('0x30')],_0x57cb9e[_0x7413('0x31')]);_0x8049c0[_0x7413('0x34')]=_[_0x7413('0x33')](_0x57cb9e[_0x7413('0x30')],qs['fields'](_0x18674c[_0x7413('0x31')][_0x7413('0x35')]));_0x8049c0[_0x7413('0x34')]=_0x8049c0[_0x7413('0x34')][_0x7413('0x44')]?_0x8049c0[_0x7413('0x34')]:_0x57cb9e[_0x7413('0x30')];if(_0x18674c[_0x7413('0x31')][_0x7413('0x45')]){_0x8049c0[_0x7413('0x46')]=[{'all':!![]}];}_0x8049c0=_[_0x7413('0x3c')]({},_0x8049c0,_0x18674c['options']);return db[_0x7413('0x2d')]['find'](_0x8049c0)[_0x7413('0x26')](handleEntityNotFound(_0x41ba22,null))[_0x7413('0x26')](respondWithResult(_0x41ba22,null))[_0x7413('0x3f')](handleError(_0x41ba22,null));};exports[_0x7413('0x47')]=function(_0x479049,_0x148b69){return db[_0x7413('0x2d')][_0x7413('0x47')](_0x479049[_0x7413('0x48')],{})[_0x7413('0x26')](respondWithResult(_0x148b69,0xc9))['catch'](handleError(_0x148b69,null));};exports['update']=function(_0x3c1f1a,_0x520eb6){if(_0x3c1f1a['body']['id']){delete _0x3c1f1a[_0x7413('0x48')]['id'];}return db[_0x7413('0x2d')]['find']({'where':{'id':_0x3c1f1a[_0x7413('0x41')]['id']}})['then'](handleEntityNotFound(_0x520eb6,null))['then'](saveUpdates(_0x3c1f1a[_0x7413('0x48')],null))['then'](respondWithResult(_0x520eb6,null))[_0x7413('0x3f')](handleError(_0x520eb6,null));};exports[_0x7413('0x49')]=function(_0x1a7338,_0x5fe361){return db[_0x7413('0x2d')][_0x7413('0x4a')]({'where':{'id':_0x1a7338[_0x7413('0x41')]['id']}})[_0x7413('0x26')](handleEntityNotFound(_0x5fe361,null))[_0x7413('0x26')](removeEntity(_0x5fe361,null))[_0x7413('0x3f')](handleError(_0x5fe361,null));}; \ No newline at end of file +var _0x1623=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','Dynamics365Field','includeAll','include','rows','show','params','rawAttributes','length','options','find','create','body','catch','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','update','destroy','then','error','stack','name','send','index','map','fieldName','type','key','model','keys','query','filters','intersection','attributes'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1623,0xab));var _0x3162=function(_0x2b1c99,_0x5c20c9){_0x2b1c99=_0x2b1c99-0x0;var _0x46e1d2=_0x1623[_0x2b1c99];return _0x46e1d2;};'use strict';var pdf=require(_0x3162('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x3162('0x1'));var jsonpatch=require(_0x3162('0x2'));var rp=require(_0x3162('0x3'));var moment=require(_0x3162('0x4'));var BPromise=require(_0x3162('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3162('0x6'));var sox=require('sox');var csv=require(_0x3162('0x7'));var ejs=require(_0x3162('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3162('0x9'));var crypto=require(_0x3162('0xa'));var jsforce=require(_0x3162('0xb'));var deskjs=require(_0x3162('0xc'));var toCsv=require(_0x3162('0x7'));var querystring=require(_0x3162('0xd'));var Papa=require(_0x3162('0xe'));var Redis=require(_0x3162('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3162('0x10'));var hardwareService=require(_0x3162('0x11'));var logger=require(_0x3162('0x12'))(_0x3162('0x13'));var utils=require(_0x3162('0x14'));var config=require(_0x3162('0x15'));var db=require(_0x3162('0x16'))['db'];function respondWithStatusCode(_0x38da60,_0x157ab8){_0x157ab8=_0x157ab8||0xcc;return function(_0x4c3625){if(_0x4c3625){return _0x38da60[_0x3162('0x17')](_0x157ab8);}return _0x38da60['status'](_0x157ab8)[_0x3162('0x18')]();};}function respondWithResult(_0x143c5a,_0x49d1ad){_0x49d1ad=_0x49d1ad||0xc8;return function(_0x4a393a){if(_0x4a393a){return _0x143c5a[_0x3162('0x19')](_0x49d1ad)[_0x3162('0x1a')](_0x4a393a);}};}function respondWithFilteredResult(_0x1eea65,_0x4b8a3b){return function(_0x15e348){if(_0x15e348){var _0x3d0bea=_0x15e348[_0x3162('0x1b')],_0x2705d1=_0x4b8a3b[_0x3162('0x1c')],_0x490371=_0x4b8a3b[_0x3162('0x1c')]+_0x4b8a3b[_0x3162('0x1d')],_0x78a56c;if(_0x490371>=_0x3d0bea){_0x490371=_0x3d0bea;_0x78a56c=0xc8;}else{_0x78a56c=0xce;}_0x1eea65[_0x3162('0x19')](_0x78a56c);return _0x1eea65[_0x3162('0x1e')]('Content-Range',_0x2705d1+'-'+_0x490371+'/'+_0x3d0bea)[_0x3162('0x1a')](_0x15e348);}return null;};}function patchUpdates(_0x1e3d75){return function(_0x460b7b){try{jsonpatch[_0x3162('0x1f')](_0x460b7b,_0x1e3d75,!![]);}catch(_0x491144){return BPromise[_0x3162('0x20')](_0x491144);}return _0x460b7b['save']();};}function saveUpdates(_0x4ab3e8,_0xa5c62b){return function(_0x3e4d23){if(_0x3e4d23){return _0x3e4d23[_0x3162('0x21')](_0x4ab3e8)['then'](function(_0x47eeae){return _0x47eeae;});}return null;};}function removeEntity(_0x27133e,_0x396372){return function(_0x32c051){if(_0x32c051){return _0x32c051[_0x3162('0x22')]()[_0x3162('0x23')](function(){_0x27133e[_0x3162('0x19')](0xcc)[_0x3162('0x18')]();});}};}function handleEntityNotFound(_0x1b2713,_0x5a4994){return function(_0xd283d6){if(!_0xd283d6){_0x1b2713[_0x3162('0x17')](0x194);}return _0xd283d6;};}function handleError(_0x3919e7,_0x1fd76f){_0x1fd76f=_0x1fd76f||0x1f4;return function(_0x1c9992){logger[_0x3162('0x24')](_0x1c9992[_0x3162('0x25')]);if(_0x1c9992[_0x3162('0x26')]){delete _0x1c9992[_0x3162('0x26')];}_0x3919e7[_0x3162('0x19')](_0x1fd76f)[_0x3162('0x27')](_0x1c9992);};}exports[_0x3162('0x28')]=function(_0x1c03a4,_0x48de45){var _0x4025c3={},_0x552469={},_0x37acdd={'count':0x0,'rows':[]};var _0x31f7fd=_[_0x3162('0x29')](db['Dynamics365Field']['rawAttributes'],function(_0xda0389){return{'name':_0xda0389[_0x3162('0x2a')],'type':_0xda0389[_0x3162('0x2b')][_0x3162('0x2c')]};});_0x552469[_0x3162('0x2d')]=_['map'](_0x31f7fd,_0x3162('0x26'));_0x552469['query']=_[_0x3162('0x2e')](_0x1c03a4[_0x3162('0x2f')]);_0x552469[_0x3162('0x30')]=_[_0x3162('0x31')](_0x552469[_0x3162('0x2d')],_0x552469[_0x3162('0x2f')]);_0x4025c3[_0x3162('0x32')]=_[_0x3162('0x31')](_0x552469['model'],qs[_0x3162('0x33')](_0x1c03a4[_0x3162('0x2f')]['fields']));_0x4025c3[_0x3162('0x32')]=_0x4025c3[_0x3162('0x32')]['length']?_0x4025c3['attributes']:_0x552469[_0x3162('0x2d')];if(!_0x1c03a4['query'][_0x3162('0x34')](_0x3162('0x35'))){_0x4025c3[_0x3162('0x1d')]=qs['limit'](_0x1c03a4['query'][_0x3162('0x1d')]);_0x4025c3[_0x3162('0x1c')]=qs['offset'](_0x1c03a4[_0x3162('0x2f')]['offset']);}_0x4025c3[_0x3162('0x36')]=qs[_0x3162('0x37')](_0x1c03a4[_0x3162('0x2f')][_0x3162('0x37')]);_0x4025c3[_0x3162('0x38')]=qs[_0x3162('0x30')](_[_0x3162('0x39')](_0x1c03a4[_0x3162('0x2f')],_0x552469[_0x3162('0x30')]));if(_0x1c03a4[_0x3162('0x2f')][_0x3162('0x3a')]){_0x4025c3['where']=_[_0x3162('0x3b')](_0x4025c3[_0x3162('0x38')],{'$or':_[_0x3162('0x29')](_0x31f7fd,function(_0x5396df){if(_0x5396df['type']!==_0x3162('0x3c')){var _0x124c92={};_0x124c92[_0x5396df[_0x3162('0x26')]]={'$like':'%'+_0x1c03a4[_0x3162('0x2f')]['filter']+'%'};return _0x124c92;}})});}_0x4025c3=_[_0x3162('0x3b')]({},_0x4025c3,_0x1c03a4['options']);var _0x59e049={'where':_0x4025c3['where']};return db[_0x3162('0x3d')][_0x3162('0x1b')](_0x59e049)[_0x3162('0x23')](function(_0x49829f){_0x37acdd[_0x3162('0x1b')]=_0x49829f;if(_0x1c03a4[_0x3162('0x2f')][_0x3162('0x3e')]){_0x4025c3[_0x3162('0x3f')]=[{'all':!![]}];}return db[_0x3162('0x3d')]['findAll'](_0x4025c3);})['then'](function(_0x1cd6bd){_0x37acdd[_0x3162('0x40')]=_0x1cd6bd;return _0x37acdd;})['then'](respondWithFilteredResult(_0x48de45,_0x4025c3))['catch'](handleError(_0x48de45,null));};exports[_0x3162('0x41')]=function(_0x32c960,_0x379756){var _0x4883ac={'raw':!![],'where':{'id':_0x32c960[_0x3162('0x42')]['id']}},_0x3502ba={};_0x3502ba[_0x3162('0x2d')]=_[_0x3162('0x2e')](db['Dynamics365Field'][_0x3162('0x43')]);_0x3502ba[_0x3162('0x2f')]=_['keys'](_0x32c960[_0x3162('0x2f')]);_0x3502ba[_0x3162('0x30')]=_['intersection'](_0x3502ba[_0x3162('0x2d')],_0x3502ba[_0x3162('0x2f')]);_0x4883ac['attributes']=_[_0x3162('0x31')](_0x3502ba['model'],qs[_0x3162('0x33')](_0x32c960[_0x3162('0x2f')][_0x3162('0x33')]));_0x4883ac[_0x3162('0x32')]=_0x4883ac[_0x3162('0x32')][_0x3162('0x44')]?_0x4883ac['attributes']:_0x3502ba[_0x3162('0x2d')];if(_0x32c960[_0x3162('0x2f')][_0x3162('0x3e')]){_0x4883ac['include']=[{'all':!![]}];}_0x4883ac=_[_0x3162('0x3b')]({},_0x4883ac,_0x32c960[_0x3162('0x45')]);return db['Dynamics365Field'][_0x3162('0x46')](_0x4883ac)['then'](handleEntityNotFound(_0x379756,null))['then'](respondWithResult(_0x379756,null))['catch'](handleError(_0x379756,null));};exports[_0x3162('0x47')]=function(_0x335bf3,_0x2f68a0){return db[_0x3162('0x3d')][_0x3162('0x47')](_0x335bf3[_0x3162('0x48')],{})[_0x3162('0x23')](respondWithResult(_0x2f68a0,0xc9))[_0x3162('0x49')](handleError(_0x2f68a0,null));};exports[_0x3162('0x21')]=function(_0x28865c,_0x1c81b5){if(_0x28865c[_0x3162('0x48')]['id']){delete _0x28865c[_0x3162('0x48')]['id'];}return db['Dynamics365Field'][_0x3162('0x46')]({'where':{'id':_0x28865c['params']['id']}})['then'](handleEntityNotFound(_0x1c81b5,null))[_0x3162('0x23')](saveUpdates(_0x28865c[_0x3162('0x48')],null))[_0x3162('0x23')](respondWithResult(_0x1c81b5,null))[_0x3162('0x49')](handleError(_0x1c81b5,null));};exports['destroy']=function(_0x3cf79c,_0x54941b){return db[_0x3162('0x3d')][_0x3162('0x46')]({'where':{'id':_0x3cf79c['params']['id']}})[_0x3162('0x23')](handleEntityNotFound(_0x54941b,null))['then'](removeEntity(_0x54941b,null))['catch'](handleError(_0x54941b,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 16a783d..8a23fa0 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 _0xe5f6=['api','moment','request-promise','path','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','idField','FieldId','lodash','../../config/logger'];(function(_0x3fee33,_0xd301e1){var _0x30cf11=function(_0x470faa){while(--_0x470faa){_0x3fee33['push'](_0x3fee33['shift']());}};_0x30cf11(++_0xd301e1);}(_0xe5f6,0x8a));var _0x6e5f=function(_0x3f3dd2,_0x6ac551){_0x3f3dd2=_0x3f3dd2-0x0;var _0xb25af9=_0xe5f6[_0x3f3dd2];return _0xb25af9;};'use strict';var _=require(_0x6e5f('0x0'));var util=require('util');var logger=require(_0x6e5f('0x1'))(_0x6e5f('0x2'));var moment=require(_0x6e5f('0x3'));var BPromise=require('bluebird');var rp=require(_0x6e5f('0x4'));var fs=require('fs');var path=require(_0x6e5f('0x5'));var rimraf=require('rimraf');var config=require(_0x6e5f('0x6'));var attributes=require(_0x6e5f('0x7'));module[_0x6e5f('0x8')]=function(_0x1f1a29,_0x4573a4){return _0x1f1a29[_0x6e5f('0x9')](_0x6e5f('0xa'),attributes,{'tableName':_0x6e5f('0xb'),'paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0x6e5f('0xc'),_0x6e5f('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x817a=['./intDynamics365Field.attributes','exports','define','Dynamics365Field','idField','FieldId','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x41ffdd,_0x4ced7b){var _0x1c1808=function(_0x3e172d){while(--_0x3e172d){_0x41ffdd['push'](_0x41ffdd['shift']());}};_0x1c1808(++_0x4ced7b);}(_0x817a,0x141));var _0xa817=function(_0x5706da,_0x3137b0){_0x5706da=_0x5706da-0x0;var _0xc7a355=_0x817a[_0x5706da];return _0xc7a355;};'use strict';var _=require(_0xa817('0x0'));var util=require('util');var logger=require(_0xa817('0x1'))(_0xa817('0x2'));var moment=require(_0xa817('0x3'));var BPromise=require(_0xa817('0x4'));var rp=require(_0xa817('0x5'));var fs=require('fs');var path=require(_0xa817('0x6'));var rimraf=require(_0xa817('0x7'));var config=require(_0xa817('0x8'));var attributes=require(_0xa817('0x9'));module[_0xa817('0xa')]=function(_0x2176d8,_0x4c4b1a){return _0x2176d8[_0xa817('0xb')](_0xa817('0xc'),attributes,{'tableName':'int_dynamics365_fields','paranoid':![],'indexes':[{'name':'dynamics365_unique_index','fields':[_0xa817('0xd'),_0xa817('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.rpc.js b/server/api/intDynamics365Field/intDynamics365Field.rpc.js index d7d21f0..5e2832f 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 _0x7eff=['jayson/promise','client','http','then','Dynamics365Field,\x20%s,\x20%s','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify','error','message','info','request\x20sent','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7eff,0x162));var _0xf7ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7eff[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xf7ef('0x0'));var moment=require(_0xf7ef('0x1'));var BPromise=require(_0xf7ef('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf7ef('0x3'));var db=require(_0xf7ef('0x4'))['db'];var utils=require(_0xf7ef('0x5'));var logger=require(_0xf7ef('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf7ef('0x7'));var client=jayson[_0xf7ef('0x8')][_0xf7ef('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21eb16,_0x4f08b0,_0xcf20c7){return new BPromise(function(_0x1022af,_0xd8bc8d){return client['request'](_0x21eb16,_0xcf20c7)[_0xf7ef('0xa')](function(_0x116448){logger['info'](_0xf7ef('0xb'),_0x4f08b0,'request\x20sent');logger['debug'](_0xf7ef('0xc'),_0x4f08b0,'request\x20sent',JSON[_0xf7ef('0xd')](_0x116448));if(_0x116448['error']){if(_0x116448['error']['code']===0x1f4){logger[_0xf7ef('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x4f08b0,_0x116448['error']['message']);return _0xd8bc8d(_0x116448[_0xf7ef('0xe')][_0xf7ef('0xf')]);}logger[_0xf7ef('0xe')](_0xf7ef('0xb'),_0x4f08b0,_0x116448['error'][_0xf7ef('0xf')]);return _0x1022af(_0x116448['error'][_0xf7ef('0xf')]);}else{logger[_0xf7ef('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x4f08b0,_0xf7ef('0x11'));_0x1022af(_0x116448['result'][_0xf7ef('0xf')]);}})[_0xf7ef('0x12')](function(_0x1695c1){logger[_0xf7ef('0xe')](_0xf7ef('0xb'),_0x4f08b0,_0x1695c1);_0xd8bc8d(_0x1695c1);});});} \ No newline at end of file +var _0xb511=['error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','request\x20sent','Dynamics365Field,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3f2764,_0x3d7785){var _0xf6147f=function(_0xc8d179){while(--_0xc8d179){_0x3f2764['push'](_0x3f2764['shift']());}};_0xf6147f(++_0x3d7785);}(_0xb511,0x165));var _0x1b51=function(_0x23fd61,_0x25889e){_0x23fd61=_0x23fd61-0x0;var _0x5c6b5d=_0xb511[_0x23fd61];return _0x5c6b5d;};'use strict';var _=require(_0x1b51('0x0'));var util=require(_0x1b51('0x1'));var moment=require(_0x1b51('0x2'));var BPromise=require('bluebird');var rs=require(_0x1b51('0x3'));var fs=require('fs');var Redis=require(_0x1b51('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1b51('0x5'));var logger=require(_0x1b51('0x6'))(_0x1b51('0x7'));var config=require('../../config/environment');var jayson=require(_0x1b51('0x8'));var client=jayson[_0x1b51('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x475add,_0x43c14c,_0x5e7ece){return new BPromise(function(_0xfa46a3,_0x1690c9){return client[_0x1b51('0xa')](_0x475add,_0x5e7ece)[_0x1b51('0xb')](function(_0x3ceabe){logger[_0x1b51('0xc')](_0x1b51('0xd'),_0x43c14c,_0x1b51('0xe'));logger['debug'](_0x1b51('0xf'),_0x43c14c,_0x1b51('0xe'),JSON[_0x1b51('0x10')](_0x3ceabe));if(_0x3ceabe[_0x1b51('0x11')]){if(_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x12')]===0x1f4){logger['error'](_0x1b51('0xd'),_0x43c14c,_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x13')]);return _0x1690c9(_0x3ceabe[_0x1b51('0x11')][_0x1b51('0x13')]);}logger[_0x1b51('0x11')](_0x1b51('0xd'),_0x43c14c,_0x3ceabe['error'][_0x1b51('0x13')]);return _0xfa46a3(_0x3ceabe['error']['message']);}else{logger[_0x1b51('0xc')](_0x1b51('0xd'),_0x43c14c,'request\x20sent');_0xfa46a3(_0x3ceabe[_0x1b51('0x14')][_0x1b51('0x13')]);}})[_0x1b51('0x15')](function(_0x4ea5e3){logger[_0x1b51('0x11')](_0x1b51('0xd'),_0x43c14c,_0x4ea5e3);_0x1690c9(_0x4ea5e3);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index 1b3ec29..f9782de 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 _0x2f2d=['addConfiguration','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intFreshdeskAccount.controller','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields','isAuthenticated','post','create'];(function(_0x3ff37c,_0x4d6e8f){var _0x2bd3fc=function(_0x1c19dd){while(--_0x1c19dd){_0x3ff37c['push'](_0x3ff37c['shift']());}};_0x2bd3fc(++_0x4d6e8f);}(_0x2f2d,0xf4));var _0xd2f2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x2f2d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd2f2('0x0'));var util=require(_0xd2f2('0x1'));var path=require(_0xd2f2('0x2'));var timeout=require(_0xd2f2('0x3'));var express=require('express');var router=express[_0xd2f2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd2f2('0x5'));var config=require('../../config/environment');var controller=require(_0xd2f2('0x6'));router[_0xd2f2('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xd2f2('0x8'),auth['isAuthenticated'](),controller[_0xd2f2('0x9')]);router[_0xd2f2('0x7')](_0xd2f2('0xa'),auth['isAuthenticated'](),controller[_0xd2f2('0xb')]);router[_0xd2f2('0x7')](_0xd2f2('0xc'),auth[_0xd2f2('0xd')](),controller['getFields']);router[_0xd2f2('0xe')]('/',auth[_0xd2f2('0xd')](),controller[_0xd2f2('0xf')]);router[_0xd2f2('0xe')](_0xd2f2('0xa'),auth[_0xd2f2('0xd')](),controller[_0xd2f2('0x10')]);router['put'](_0xd2f2('0x8'),auth[_0xd2f2('0xd')](),controller[_0xd2f2('0x11')]);router[_0xd2f2('0x12')](_0xd2f2('0x8'),auth[_0xd2f2('0xd')](),controller['destroy']);module[_0xd2f2('0x13')]=router; \ No newline at end of file +var _0x66d0=['/:id','show','/:id/fields','post','/:id/configurations','addConfiguration','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x331c69,_0x379f27){var _0x51069a=function(_0xb59cd9){while(--_0xb59cd9){_0x331c69['push'](_0x331c69['shift']());}};_0x51069a(++_0x379f27);}(_0x66d0,0x89));var _0x066d=function(_0x2265da,_0xfbbd2e){_0x2265da=_0x2265da-0x0;var _0x430c2b=_0x66d0[_0x2265da];return _0x430c2b;};'use strict';var multer=require(_0x066d('0x0'));var util=require('util');var path=require(_0x066d('0x1'));var timeout=require(_0x066d('0x2'));var express=require(_0x066d('0x3'));var router=express['Router']();var auth=require(_0x066d('0x4'));var interaction=require(_0x066d('0x5'));var config=require(_0x066d('0x6'));var controller=require('./intFreshdeskAccount.controller');router[_0x066d('0x7')]('/',auth[_0x066d('0x8')](),controller[_0x066d('0x9')]);router[_0x066d('0x7')](_0x066d('0xa'),auth[_0x066d('0x8')](),controller[_0x066d('0xb')]);router[_0x066d('0x7')]('/:id/configurations',auth[_0x066d('0x8')](),controller['getConfigurations']);router[_0x066d('0x7')](_0x066d('0xc'),auth['isAuthenticated'](),controller['getFields']);router['post']('/',auth[_0x066d('0x8')](),controller['create']);router[_0x066d('0xd')](_0x066d('0xe'),auth[_0x066d('0x8')](),controller[_0x066d('0xf')]);router[_0x066d('0x10')]('/:id',auth[_0x066d('0x8')](),controller[_0x066d('0x11')]);router[_0x066d('0x12')]('/:id',auth[_0x066d('0x8')](),controller[_0x066d('0x13')]);module[_0x066d('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 8906e48..40e15c7 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 _0xdf94=['remoteUri','exports','STRING','username'];(function(_0x1f2f61,_0x586f2f){var _0x10dabc=function(_0x3233b5){while(--_0x3233b5){_0x1f2f61['push'](_0x1f2f61['shift']());}};_0x10dabc(++_0x586f2f);}(_0xdf94,0xad));var _0x4df9=function(_0x32a714,_0x12e9ed){_0x32a714=_0x32a714-0x0;var _0x1180ba=_0xdf94[_0x32a714];return _0x1180ba;};'use strict';var Sequelize=require('sequelize');module[_0x4df9('0x0')]={'name':{'type':Sequelize[_0x4df9('0x1')]},'description':{'type':Sequelize[_0x4df9('0x1')]},'username':{'type':Sequelize[_0x4df9('0x1')],'unique':_0x4df9('0x2')},'apiKey':{'type':Sequelize[_0x4df9('0x1')]},'remoteUri':{'type':Sequelize[_0x4df9('0x1')],'unique':_0x4df9('0x3')},'serverUrl':{'type':Sequelize[_0x4df9('0x1')]}}; \ No newline at end of file +var _0x4ccb=['remoteUri','sequelize','exports','STRING','username'];(function(_0x5e8f53,_0x28c759){var _0x28207a=function(_0x11da48){while(--_0x11da48){_0x5e8f53['push'](_0x5e8f53['shift']());}};_0x28207a(++_0x28c759);}(_0x4ccb,0x196));var _0xb4cc=function(_0x27e832,_0x2a864c){_0x27e832=_0x27e832-0x0;var _0x580125=_0x4ccb[_0x27e832];return _0x580125;};'use strict';var Sequelize=require(_0xb4cc('0x0'));module[_0xb4cc('0x1')]={'name':{'type':Sequelize[_0xb4cc('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xb4cc('0x2')],'unique':_0xb4cc('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb4cc('0x2')],'unique':_0xb4cc('0x4')},'serverUrl':{'type':Sequelize[_0xb4cc('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index c18c3fe..0b1fe9b 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 _0xdc70=['format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','apiKey','toString','requester','subject','agent','description','group','source','ticket_type','company','remove','default','custom_text','custom_dropdown','label','choices','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','name','send','index','rawAttributes','fieldName','type','key','keys','query','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','filters','pick','filter','where','map','findAll','rows','show','params','FreshdeskAccount','includeAll','include','merge','options','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','addConfiguration','Subjects','channel','Descriptions','getDescriptions','FreshdeskField','remoteUri','slice','substring','lastIndexOf','GET'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xdc70,0x98));var _0x0dc7=function(_0x1a1c9d,_0x47a9c1){_0x1a1c9d=_0x1a1c9d-0x0;var _0x2f0080=_0xdc70[_0x1a1c9d];return _0x2f0080;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0dc7('0x0'));var rimraf=require(_0x0dc7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0dc7('0x2'));var rp=require(_0x0dc7('0x3'));var moment=require(_0x0dc7('0x4'));var BPromise=require(_0x0dc7('0x5'));var Mustache=require(_0x0dc7('0x6'));var util=require(_0x0dc7('0x7'));var path=require('path');var sox=require(_0x0dc7('0x8'));var csv=require(_0x0dc7('0x9'));var ejs=require(_0x0dc7('0xa'));var fs=require('fs');var _=require(_0x0dc7('0xb'));var squel=require('squel');var crypto=require(_0x0dc7('0xc'));var jsforce=require(_0x0dc7('0xd'));var deskjs=require(_0x0dc7('0xe'));var toCsv=require(_0x0dc7('0x9'));var querystring=require('querystring');var Papa=require(_0x0dc7('0xf'));var Redis=require(_0x0dc7('0x10'));var authService=require(_0x0dc7('0x11'));var qs=require(_0x0dc7('0x12'));var as=require(_0x0dc7('0x13'));var hardwareService=require(_0x0dc7('0x14'));var logger=require(_0x0dc7('0x15'))(_0x0dc7('0x16'));var utils=require('../../config/utils');var config=require(_0x0dc7('0x17'));var db=require(_0x0dc7('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x0dc7('0x19'));var client=jayson[_0x0dc7('0x1a')][_0x0dc7('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x2227c7,_0x5972da,_0x4468f4){if(_0x4468f4){var _0x313760=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x313760[_0x0dc7('0x1c')](_0x5972da)){return _0x2227c7;}else{throw new db[(_0x0dc7('0x1d'))][(_0x0dc7('0x1e'))](_0x0dc7('0x1f'));}}else{return _0x2227c7;}}function respondWithRpcPromise(_0x186ecc,_0x5a5a62,_0x172de6,_0x4a1f61){return new BPromise(function(_0x10a0af,_0x2e369f){var _0x2ecd9f=_0x4a1f61||client;return _0x2ecd9f['request'](_0x186ecc,_0x172de6)['then'](function(_0x3f48a6){logger[_0x0dc7('0x20')](_0x0dc7('0x21'),_0x5a5a62,_0x0dc7('0x22'));logger[_0x0dc7('0x23')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x5a5a62,_0x0dc7('0x22'),JSON[_0x0dc7('0x24')](_0x3f48a6));if(_0x3f48a6['error']){if(_0x3f48a6['error'][_0x0dc7('0x25')]===0x1f4){logger[_0x0dc7('0x26')]('FreshdeskAccount,\x20%s,\x20%s',_0x5a5a62,_0x3f48a6[_0x0dc7('0x26')][_0x0dc7('0x27')]);return _0x2e369f(_0x3f48a6[_0x0dc7('0x26')][_0x0dc7('0x27')]);}logger[_0x0dc7('0x26')](_0x0dc7('0x21'),_0x5a5a62,_0x3f48a6[_0x0dc7('0x26')][_0x0dc7('0x27')]);return _0x10a0af(_0x3f48a6[_0x0dc7('0x26')]['message']);}else{logger[_0x0dc7('0x20')](_0x0dc7('0x21'),_0x5a5a62,_0x0dc7('0x22'));_0x10a0af(_0x3f48a6[_0x0dc7('0x28')][_0x0dc7('0x27')]);}})[_0x0dc7('0x29')](function(_0x39cd22){logger[_0x0dc7('0x26')]('FreshdeskAccount,\x20%s,\x20%s',_0x5a5a62,_0x39cd22);_0x2e369f(_0x39cd22);});});}function respondWithStatusCode(_0x58f29e,_0x1b5b20){_0x1b5b20=_0x1b5b20||0xcc;return function(_0x45bcc7){if(_0x45bcc7){return _0x58f29e[_0x0dc7('0x2a')](_0x1b5b20);}return _0x58f29e[_0x0dc7('0x2b')](_0x1b5b20)[_0x0dc7('0x2c')]();};}function respondWithResult(_0x1b1f58,_0x56d97d){_0x56d97d=_0x56d97d||0xc8;return function(_0x262337){if(_0x262337){return _0x1b1f58[_0x0dc7('0x2b')](_0x56d97d)[_0x0dc7('0x2d')](_0x262337);}};}function respondWithFilteredResult(_0x156b0c,_0x30c46e){return function(_0x1f2d85){if(_0x1f2d85){var _0x518033=_0x1f2d85[_0x0dc7('0x2e')],_0xc19848=_0x30c46e[_0x0dc7('0x2f')],_0xc3fd3b=_0x30c46e['offset']+_0x30c46e[_0x0dc7('0x30')],_0x23c1f0;if(_0xc3fd3b>=_0x518033){_0xc3fd3b=_0x518033;_0x23c1f0=0xc8;}else{_0x23c1f0=0xce;}_0x156b0c[_0x0dc7('0x2b')](_0x23c1f0);return _0x156b0c[_0x0dc7('0x31')]('Content-Range',_0xc19848+'-'+_0xc3fd3b+'/'+_0x518033)[_0x0dc7('0x2d')](_0x1f2d85);}return null;};}function patchUpdates(_0x3ab8cf){return function(_0x424b91){try{jsonpatch[_0x0dc7('0x32')](_0x424b91,_0x3ab8cf,!![]);}catch(_0x2d8958){return BPromise[_0x0dc7('0x33')](_0x2d8958);}return _0x424b91[_0x0dc7('0x34')]();};}function saveUpdates(_0x59a469,_0x5cabd6){return function(_0x572de5){if(_0x572de5){return _0x572de5[_0x0dc7('0x35')](_0x59a469)[_0x0dc7('0x36')](function(_0x4b7e5c){return _0x4b7e5c;});}return null;};}function removeEntity(_0x5cbfb2,_0x254bfe){return function(_0x1d2c30){if(_0x1d2c30){return _0x1d2c30[_0x0dc7('0x37')]()['then'](function(){_0x5cbfb2[_0x0dc7('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1486cf,_0x10f63a){return function(_0x4f09b2){if(!_0x4f09b2){_0x1486cf['sendStatus'](0x194);}return _0x4f09b2;};}function handleError(_0x2371d0,_0x106f48){_0x106f48=_0x106f48||0x1f4;return function(_0x3c821d){logger[_0x0dc7('0x26')](_0x3c821d['stack']);if(_0x3c821d[_0x0dc7('0x38')]){delete _0x3c821d[_0x0dc7('0x38')];}_0x2371d0['status'](_0x106f48)[_0x0dc7('0x39')](_0x3c821d);};}exports[_0x0dc7('0x3a')]=function(_0xfce7d9,_0xce3742){var _0x29df67={},_0x257c5f={},_0x234b19={'count':0x0,'rows':[]};var _0x1f1b74=_['map'](db['FreshdeskAccount'][_0x0dc7('0x3b')],function(_0x26338e){return{'name':_0x26338e[_0x0dc7('0x3c')],'type':_0x26338e[_0x0dc7('0x3d')][_0x0dc7('0x3e')]};});_0x257c5f['model']=_['map'](_0x1f1b74,'name');_0x257c5f['query']=_[_0x0dc7('0x3f')](_0xfce7d9[_0x0dc7('0x40')]);_0x257c5f['filters']=_[_0x0dc7('0x41')](_0x257c5f[_0x0dc7('0x42')],_0x257c5f[_0x0dc7('0x40')]);_0x29df67['attributes']=_[_0x0dc7('0x41')](_0x257c5f[_0x0dc7('0x42')],qs[_0x0dc7('0x43')](_0xfce7d9['query'][_0x0dc7('0x43')]));_0x29df67[_0x0dc7('0x44')]=_0x29df67[_0x0dc7('0x44')][_0x0dc7('0x45')]?_0x29df67[_0x0dc7('0x44')]:_0x257c5f[_0x0dc7('0x42')];if(!_0xfce7d9[_0x0dc7('0x40')][_0x0dc7('0x46')]('nolimit')){_0x29df67['limit']=qs['limit'](_0xfce7d9[_0x0dc7('0x40')][_0x0dc7('0x30')]);_0x29df67[_0x0dc7('0x2f')]=qs[_0x0dc7('0x2f')](_0xfce7d9[_0x0dc7('0x40')][_0x0dc7('0x2f')]);}_0x29df67[_0x0dc7('0x47')]=qs[_0x0dc7('0x48')](_0xfce7d9[_0x0dc7('0x40')][_0x0dc7('0x48')]);_0x29df67['where']=qs[_0x0dc7('0x49')](_[_0x0dc7('0x4a')](_0xfce7d9[_0x0dc7('0x40')],_0x257c5f[_0x0dc7('0x49')]));if(_0xfce7d9[_0x0dc7('0x40')][_0x0dc7('0x4b')]){_0x29df67['where']=_['merge'](_0x29df67[_0x0dc7('0x4c')],{'$or':_[_0x0dc7('0x4d')](_0x1f1b74,function(_0x2d74ac){if(_0x2d74ac[_0x0dc7('0x3d')]!=='VIRTUAL'){var _0x5916ca={};_0x5916ca[_0x2d74ac['name']]={'$like':'%'+_0xfce7d9['query']['filter']+'%'};return _0x5916ca;}})});}_0x29df67=_['merge']({},_0x29df67,_0xfce7d9['options']);var _0x4c48a5={'where':_0x29df67[_0x0dc7('0x4c')]};return db['FreshdeskAccount']['count'](_0x4c48a5)[_0x0dc7('0x36')](function(_0x9e6ba6){_0x234b19['count']=_0x9e6ba6;if(_0xfce7d9[_0x0dc7('0x40')]['includeAll']){_0x29df67['include']=[{'all':!![]}];}return db['FreshdeskAccount'][_0x0dc7('0x4e')](_0x29df67);})['then'](function(_0x2badad){_0x234b19[_0x0dc7('0x4f')]=_0x2badad;return _0x234b19;})[_0x0dc7('0x36')](respondWithFilteredResult(_0xce3742,_0x29df67))[_0x0dc7('0x29')](handleError(_0xce3742,null));};exports[_0x0dc7('0x50')]=function(_0x785716,_0x150fee){var _0x117196={'raw':![],'where':{'id':_0x785716[_0x0dc7('0x51')]['id']}},_0x118cb4={};_0x118cb4[_0x0dc7('0x42')]=_[_0x0dc7('0x3f')](db[_0x0dc7('0x52')][_0x0dc7('0x3b')]);_0x118cb4[_0x0dc7('0x40')]=_[_0x0dc7('0x3f')](_0x785716['query']);_0x118cb4[_0x0dc7('0x49')]=_[_0x0dc7('0x41')](_0x118cb4['model'],_0x118cb4['query']);_0x117196[_0x0dc7('0x44')]=_['intersection'](_0x118cb4[_0x0dc7('0x42')],qs[_0x0dc7('0x43')](_0x785716[_0x0dc7('0x40')][_0x0dc7('0x43')]));_0x117196[_0x0dc7('0x44')]=_0x117196[_0x0dc7('0x44')][_0x0dc7('0x45')]?_0x117196[_0x0dc7('0x44')]:_0x118cb4['model'];if(_0x785716[_0x0dc7('0x40')][_0x0dc7('0x53')]){_0x117196[_0x0dc7('0x54')]=[{'all':!![]}];}_0x117196=_[_0x0dc7('0x55')]({},_0x117196,_0x785716[_0x0dc7('0x56')]);return db['FreshdeskAccount'][_0x0dc7('0x57')](_0x117196)[_0x0dc7('0x36')](handleEntityNotFound(_0x150fee,null))[_0x0dc7('0x36')](respondWithResult(_0x150fee,null))[_0x0dc7('0x29')](handleError(_0x150fee,null));};exports[_0x0dc7('0x58')]=function(_0x525212,_0x143353){return db[_0x0dc7('0x52')]['create'](_0x525212[_0x0dc7('0x59')],{})[_0x0dc7('0x36')](respondWithResult(_0x143353,0xc9))[_0x0dc7('0x29')](handleError(_0x143353,null));};exports['update']=function(_0x3c128d,_0x49548b){if(_0x3c128d[_0x0dc7('0x59')]['id']){delete _0x3c128d[_0x0dc7('0x59')]['id'];}return db[_0x0dc7('0x52')][_0x0dc7('0x57')]({'where':{'id':_0x3c128d[_0x0dc7('0x51')]['id']}})[_0x0dc7('0x36')](handleEntityNotFound(_0x49548b,null))[_0x0dc7('0x36')](saveUpdates(_0x3c128d[_0x0dc7('0x59')],null))[_0x0dc7('0x36')](respondWithResult(_0x49548b,null))['catch'](handleError(_0x49548b,null));};exports[_0x0dc7('0x37')]=function(_0x4d9f47,_0x3cab6f){return db[_0x0dc7('0x52')][_0x0dc7('0x57')]({'where':{'id':_0x4d9f47[_0x0dc7('0x51')]['id']}})['then'](handleEntityNotFound(_0x3cab6f,null))['then'](removeEntity(_0x3cab6f,null))[_0x0dc7('0x29')](handleError(_0x3cab6f,null));};exports[_0x0dc7('0x5a')]=function(_0x3b23e3,_0x28cbd7,_0x56f525){var _0x3e547a={};var _0x10efc0={};var _0x1cf200;var _0x204d35;return db[_0x0dc7('0x52')][_0x0dc7('0x5b')]({'where':{'id':_0x3b23e3['params']['id']}})['then'](handleEntityNotFound(_0x28cbd7,null))[_0x0dc7('0x36')](function(_0x2d313f){if(_0x2d313f){_0x1cf200=_0x2d313f;_0x10efc0['model']=_[_0x0dc7('0x3f')](db[_0x0dc7('0x5c')][_0x0dc7('0x3b')]);_0x10efc0['query']=_[_0x0dc7('0x3f')](_0x3b23e3[_0x0dc7('0x40')]);_0x10efc0[_0x0dc7('0x49')]=_[_0x0dc7('0x41')](_0x10efc0[_0x0dc7('0x42')],_0x10efc0[_0x0dc7('0x40')]);_0x3e547a[_0x0dc7('0x44')]=_[_0x0dc7('0x41')](_0x10efc0[_0x0dc7('0x42')],qs[_0x0dc7('0x43')](_0x3b23e3[_0x0dc7('0x40')][_0x0dc7('0x43')]));_0x3e547a['attributes']=_0x3e547a['attributes']['length']?_0x3e547a[_0x0dc7('0x44')]:_0x10efc0[_0x0dc7('0x42')];_0x3e547a[_0x0dc7('0x47')]=qs[_0x0dc7('0x48')](_0x3b23e3[_0x0dc7('0x40')][_0x0dc7('0x48')]);_0x3e547a[_0x0dc7('0x4c')]=qs[_0x0dc7('0x49')](_['pick'](_0x3b23e3[_0x0dc7('0x40')],_0x10efc0[_0x0dc7('0x49')]));if(_0x3b23e3[_0x0dc7('0x40')]['filter']){_0x3e547a['where']=_[_0x0dc7('0x55')](_0x3e547a['where'],{'$or':_[_0x0dc7('0x4d')](_0x3e547a[_0x0dc7('0x44')],function(_0x4312ba){var _0x405ea6={};_0x405ea6[_0x4312ba]={'$like':'%'+_0x3b23e3[_0x0dc7('0x40')][_0x0dc7('0x4b')]+'%'};return _0x405ea6;})});}_0x3e547a=_[_0x0dc7('0x55')]({},_0x3e547a,_0x3b23e3['options']);return _0x1cf200[_0x0dc7('0x5a')](_0x3e547a);}})[_0x0dc7('0x36')](function(_0x116f0d){if(_0x116f0d){_0x204d35=_0x116f0d[_0x0dc7('0x45')];if(!_0x3b23e3[_0x0dc7('0x40')][_0x0dc7('0x46')]('nolimit')){_0x3e547a['limit']=qs[_0x0dc7('0x30')](_0x3b23e3[_0x0dc7('0x40')][_0x0dc7('0x30')]);_0x3e547a[_0x0dc7('0x2f')]=qs[_0x0dc7('0x2f')](_0x3b23e3['query'][_0x0dc7('0x2f')]);}return _0x1cf200[_0x0dc7('0x5a')](_0x3e547a);}})['then'](function(_0xb980fe){if(_0xb980fe){return _0xb980fe?{'count':_0x204d35,'rows':_0xb980fe}:null;}})[_0x0dc7('0x36')](respondWithResult(_0x28cbd7,null))[_0x0dc7('0x29')](handleError(_0x28cbd7,null));};exports[_0x0dc7('0x5d')]=function(_0x159ba9,_0x54e0ed,_0x45f25f){if(_0x159ba9[_0x0dc7('0x59')]['id']){delete _0x159ba9[_0x0dc7('0x59')]['id'];}return db[_0x0dc7('0x52')]['findOne']({'where':{'id':_0x159ba9[_0x0dc7('0x51')]['id']}})[_0x0dc7('0x36')](handleEntityNotFound(_0x54e0ed,null))['then'](function(_0x5d4aff){if(_0x5d4aff){_0x159ba9['body']['AccountId']=_0x5d4aff['id'];_0x159ba9[_0x0dc7('0x59')][_0x0dc7('0x5e')]=integrations['getSubjects'](_0x159ba9['body'][_0x0dc7('0x5f')],_0x159ba9['body'][_0x0dc7('0x3d')]);_0x159ba9['body'][_0x0dc7('0x60')]=integrations[_0x0dc7('0x61')](_0x159ba9[_0x0dc7('0x59')][_0x0dc7('0x5f')],_0x159ba9[_0x0dc7('0x59')][_0x0dc7('0x3d')]);return db[_0x0dc7('0x5c')][_0x0dc7('0x58')](_0x159ba9[_0x0dc7('0x59')],{'include':[{'model':db[_0x0dc7('0x62')],'as':'Subjects'},{'model':db[_0x0dc7('0x62')],'as':_0x0dc7('0x60')}]});}return null;})[_0x0dc7('0x36')](respondWithResult(_0x54e0ed,null))[_0x0dc7('0x29')](handleError(_0x54e0ed,null));};exports['getFields']=function(_0x113234,_0x31c088,_0x56f2dc){var _0x32062f='';return db['FreshdeskAccount'][_0x0dc7('0x5b')]({'where':{'id':_0x113234[_0x0dc7('0x51')]['id']},'attributes':['id',_0x0dc7('0x63'),'apiKey']})[_0x0dc7('0x36')](handleEntityNotFound(_0x31c088,null))['then'](function(_0x22684e){if(_0x22684e){_0x32062f=_0x22684e['remoteUri'];var _0x299274=_0x32062f[_0x0dc7('0x64')](-0x1);if(_0x299274==='/'){_0x32062f=_0x32062f[_0x0dc7('0x65')](0x0,_0x32062f[_0x0dc7('0x66')](_0x299274));}return rp({'method':_0x0dc7('0x67'),'uri':util[_0x0dc7('0x68')](_0x0dc7('0x69'),_0x32062f,_0x0dc7('0x6a')),'headers':{'Authorization':util[_0x0dc7('0x68')](_0x0dc7('0x6b'),new Buffer(util[_0x0dc7('0x68')](_0x0dc7('0x6c'),_0x22684e[_0x0dc7('0x6d')]))[_0x0dc7('0x6e')]('base64'))},'json':!![]});}})['then'](function(_0x512a56){if(_0x512a56){var _0x57536e=[_0x0dc7('0x6f'),_0x0dc7('0x70'),_0x0dc7('0x71'),_0x0dc7('0x72'),'status','priority',_0x0dc7('0x73'),_0x0dc7('0x74'),_0x0dc7('0x75'),'group',_0x0dc7('0x76')];_[_0x0dc7('0x77')](_0x512a56,function(_0x64424e){return _0x57536e['includes'](_0x64424e[_0x0dc7('0x38')])||!_0x64424e[_0x0dc7('0x78')]&&_0x64424e[_0x0dc7('0x3d')]!==_0x0dc7('0x79')&&_0x64424e[_0x0dc7('0x3d')]!==_0x0dc7('0x7a');});return{'count':_0x512a56['length'],'rows':_[_0x0dc7('0x4d')](_0x512a56,function(_0x2d1a85){return{'id':_0x2d1a85['name'],'name':_0x2d1a85[_0x0dc7('0x7b')],'custom':!_0x2d1a85[_0x0dc7('0x78')],'options':_0x2d1a85[_0x0dc7('0x7c')]?_['map'](_0x2d1a85['choices'],function(_0xbe829){return{'name':_['capitalize'](_0xbe829),'value':_0xbe829};}):[]};})};}})[_0x0dc7('0x36')](respondWithResult(_0x31c088,null))[_0x0dc7('0x29')](function(_0x419c1a){var _0x4aec0b=_0x113234[_0x0dc7('0x40')]['test']?0x1f4:_0x419c1a['statusCode']||0x1f4;logger[_0x0dc7('0x26')](_0x0dc7('0x7d'),_0x0dc7('0x7e'),_0x4aec0b,JSON[_0x0dc7('0x24')](_0x419c1a));delete _0x419c1a['name'];if(_0x4aec0b===0x191){_0x4aec0b=0x190;}_0x31c088[_0x0dc7('0x2b')](_0x4aec0b)[_0x0dc7('0x39')](_0x113234[_0x0dc7('0x40')][_0x0dc7('0x1c')]?{'message':_0x0dc7('0x7f'),'statusCode':_0x419c1a['statusCode']}:_0x419c1a);});}; \ No newline at end of file +var _0xe7af=['merge','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','Basic\x20%s','%s:X','toString','agent','group','source','ticket_type','company','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','getFields,\x20%s,\x20%s,\x20%s','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','Content-Range','save','update','destroy','sendStatus','name','send','rawAttributes','key','model','query','keys','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','map','type','VIRTUAL','options','then','includeAll','rows','show','FreshdeskAccount','intersection','include','find','create','body','params','getConfigurations','findOne','FreshdeskConfiguration'];(function(_0x2fd0f0,_0x4b634e){var _0x57f71a=function(_0x400d6f){while(--_0x400d6f){_0x2fd0f0['push'](_0x2fd0f0['shift']());}};_0x57f71a(++_0x4b634e);}(_0xe7af,0xa3));var _0xfe7a=function(_0x2272b5,_0x362458){_0x2272b5=_0x2272b5-0x0;var _0x110156=_0xe7af[_0x2272b5];return _0x110156;};'use strict';var pdf=require(_0xfe7a('0x0'));var emlformat=require(_0xfe7a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfe7a('0x2'));var jsonpatch=require(_0xfe7a('0x3'));var rp=require('request-promise');var moment=require(_0xfe7a('0x4'));var BPromise=require(_0xfe7a('0x5'));var Mustache=require(_0xfe7a('0x6'));var util=require(_0xfe7a('0x7'));var path=require(_0xfe7a('0x8'));var sox=require(_0xfe7a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xfe7a('0xa'));var squel=require(_0xfe7a('0xb'));var crypto=require(_0xfe7a('0xc'));var jsforce=require(_0xfe7a('0xd'));var deskjs=require(_0xfe7a('0xe'));var toCsv=require(_0xfe7a('0xf'));var querystring=require(_0xfe7a('0x10'));var Papa=require('papaparse');var Redis=require(_0xfe7a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xfe7a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfe7a('0x13'));var logger=require(_0xfe7a('0x14'))('api');var utils=require(_0xfe7a('0x15'));var config=require(_0xfe7a('0x16'));var db=require(_0xfe7a('0x17'))['db'];var integrations=require(_0xfe7a('0x18'));var jayson=require('jayson/promise');var client=jayson[_0xfe7a('0x19')][_0xfe7a('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2f092a,_0x5bd238,_0x55b409){if(_0x55b409){var _0x5e2804=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e2804[_0xfe7a('0x1b')](_0x5bd238)){return _0x2f092a;}else{throw new db[(_0xfe7a('0x1c'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2f092a;}}function respondWithRpcPromise(_0x9c443d,_0x1b853c,_0x51ea1f,_0x1a8003){return new BPromise(function(_0x5f4a1f,_0x18c69a){var _0x20e8f7=_0x1a8003||client;return _0x20e8f7[_0xfe7a('0x1d')](_0x9c443d,_0x51ea1f)['then'](function(_0x576f8e){logger[_0xfe7a('0x1e')](_0xfe7a('0x1f'),_0x1b853c,_0xfe7a('0x20'));logger[_0xfe7a('0x21')](_0xfe7a('0x22'),_0x1b853c,_0xfe7a('0x20'),JSON[_0xfe7a('0x23')](_0x576f8e));if(_0x576f8e[_0xfe7a('0x24')]){if(_0x576f8e[_0xfe7a('0x24')][_0xfe7a('0x25')]===0x1f4){logger['error'](_0xfe7a('0x1f'),_0x1b853c,_0x576f8e[_0xfe7a('0x24')][_0xfe7a('0x26')]);return _0x18c69a(_0x576f8e['error'][_0xfe7a('0x26')]);}logger[_0xfe7a('0x24')]('FreshdeskAccount,\x20%s,\x20%s',_0x1b853c,_0x576f8e[_0xfe7a('0x24')]['message']);return _0x5f4a1f(_0x576f8e['error'][_0xfe7a('0x26')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x1b853c,_0xfe7a('0x20'));_0x5f4a1f(_0x576f8e[_0xfe7a('0x27')][_0xfe7a('0x26')]);}})[_0xfe7a('0x28')](function(_0x465234){logger['error'](_0xfe7a('0x1f'),_0x1b853c,_0x465234);_0x18c69a(_0x465234);});});}function respondWithStatusCode(_0x22e120,_0x3f94b2){_0x3f94b2=_0x3f94b2||0xcc;return function(_0x214687){if(_0x214687){return _0x22e120['sendStatus'](_0x3f94b2);}return _0x22e120[_0xfe7a('0x29')](_0x3f94b2)[_0xfe7a('0x2a')]();};}function respondWithResult(_0x365abb,_0x20c03f){_0x20c03f=_0x20c03f||0xc8;return function(_0x2ff484){if(_0x2ff484){return _0x365abb[_0xfe7a('0x29')](_0x20c03f)[_0xfe7a('0x2b')](_0x2ff484);}};}function respondWithFilteredResult(_0x1d1118,_0x33d023){return function(_0x20dcae){if(_0x20dcae){var _0x76d01c=_0x20dcae[_0xfe7a('0x2c')],_0xe4937a=_0x33d023[_0xfe7a('0x2d')],_0x55b642=_0x33d023[_0xfe7a('0x2d')]+_0x33d023[_0xfe7a('0x2e')],_0x1a325b;if(_0x55b642>=_0x76d01c){_0x55b642=_0x76d01c;_0x1a325b=0xc8;}else{_0x1a325b=0xce;}_0x1d1118['status'](_0x1a325b);return _0x1d1118[_0xfe7a('0x2f')](_0xfe7a('0x30'),_0xe4937a+'-'+_0x55b642+'/'+_0x76d01c)['json'](_0x20dcae);}return null;};}function patchUpdates(_0x50b26c){return function(_0x4ccfac){try{jsonpatch['apply'](_0x4ccfac,_0x50b26c,!![]);}catch(_0x2300c4){return BPromise['reject'](_0x2300c4);}return _0x4ccfac[_0xfe7a('0x31')]();};}function saveUpdates(_0x3bca5e,_0x4c98ce){return function(_0x2cfe50){if(_0x2cfe50){return _0x2cfe50[_0xfe7a('0x32')](_0x3bca5e)['then'](function(_0x31f384){return _0x31f384;});}return null;};}function removeEntity(_0x221f94,_0x3e262a){return function(_0x15af18){if(_0x15af18){return _0x15af18[_0xfe7a('0x33')]()['then'](function(){_0x221f94[_0xfe7a('0x29')](0xcc)[_0xfe7a('0x2a')]();});}};}function handleEntityNotFound(_0xc079a3,_0x3bb77d){return function(_0x225366){if(!_0x225366){_0xc079a3[_0xfe7a('0x34')](0x194);}return _0x225366;};}function handleError(_0x5d315e,_0xc2b202){_0xc2b202=_0xc2b202||0x1f4;return function(_0x3a88dd){logger[_0xfe7a('0x24')](_0x3a88dd['stack']);if(_0x3a88dd['name']){delete _0x3a88dd[_0xfe7a('0x35')];}_0x5d315e[_0xfe7a('0x29')](_0xc2b202)[_0xfe7a('0x36')](_0x3a88dd);};}exports['index']=function(_0x45fcef,_0x567443){var _0x5d121b={},_0x31f61f={},_0x163cb2={'count':0x0,'rows':[]};var _0x4401f3=_['map'](db['FreshdeskAccount'][_0xfe7a('0x37')],function(_0x41ab13){return{'name':_0x41ab13['fieldName'],'type':_0x41ab13['type'][_0xfe7a('0x38')]};});_0x31f61f[_0xfe7a('0x39')]=_['map'](_0x4401f3,'name');_0x31f61f[_0xfe7a('0x3a')]=_[_0xfe7a('0x3b')](_0x45fcef[_0xfe7a('0x3a')]);_0x31f61f['filters']=_['intersection'](_0x31f61f['model'],_0x31f61f[_0xfe7a('0x3a')]);_0x5d121b[_0xfe7a('0x3c')]=_['intersection'](_0x31f61f['model'],qs[_0xfe7a('0x3d')](_0x45fcef[_0xfe7a('0x3a')][_0xfe7a('0x3d')]));_0x5d121b[_0xfe7a('0x3c')]=_0x5d121b['attributes'][_0xfe7a('0x3e')]?_0x5d121b[_0xfe7a('0x3c')]:_0x31f61f['model'];if(!_0x45fcef[_0xfe7a('0x3a')][_0xfe7a('0x3f')](_0xfe7a('0x40'))){_0x5d121b[_0xfe7a('0x2e')]=qs[_0xfe7a('0x2e')](_0x45fcef[_0xfe7a('0x3a')]['limit']);_0x5d121b[_0xfe7a('0x2d')]=qs['offset'](_0x45fcef[_0xfe7a('0x3a')][_0xfe7a('0x2d')]);}_0x5d121b[_0xfe7a('0x41')]=qs[_0xfe7a('0x42')](_0x45fcef['query'][_0xfe7a('0x42')]);_0x5d121b['where']=qs[_0xfe7a('0x43')](_[_0xfe7a('0x44')](_0x45fcef[_0xfe7a('0x3a')],_0x31f61f['filters']));if(_0x45fcef[_0xfe7a('0x3a')][_0xfe7a('0x45')]){_0x5d121b[_0xfe7a('0x46')]=_['merge'](_0x5d121b[_0xfe7a('0x46')],{'$or':_[_0xfe7a('0x47')](_0x4401f3,function(_0xf0e0d8){if(_0xf0e0d8[_0xfe7a('0x48')]!==_0xfe7a('0x49')){var _0x37d123={};_0x37d123[_0xf0e0d8[_0xfe7a('0x35')]]={'$like':'%'+_0x45fcef[_0xfe7a('0x3a')][_0xfe7a('0x45')]+'%'};return _0x37d123;}})});}_0x5d121b=_['merge']({},_0x5d121b,_0x45fcef[_0xfe7a('0x4a')]);var _0x2dca93={'where':_0x5d121b['where']};return db['FreshdeskAccount']['count'](_0x2dca93)[_0xfe7a('0x4b')](function(_0x55f0b6){_0x163cb2['count']=_0x55f0b6;if(_0x45fcef['query'][_0xfe7a('0x4c')]){_0x5d121b['include']=[{'all':!![]}];}return db['FreshdeskAccount']['findAll'](_0x5d121b);})[_0xfe7a('0x4b')](function(_0x459a1f){_0x163cb2[_0xfe7a('0x4d')]=_0x459a1f;return _0x163cb2;})['then'](respondWithFilteredResult(_0x567443,_0x5d121b))['catch'](handleError(_0x567443,null));};exports[_0xfe7a('0x4e')]=function(_0x1b5e10,_0x23d038){var _0x1c5767={'raw':![],'where':{'id':_0x1b5e10['params']['id']}},_0x1474d2={};_0x1474d2[_0xfe7a('0x39')]=_['keys'](db[_0xfe7a('0x4f')][_0xfe7a('0x37')]);_0x1474d2[_0xfe7a('0x3a')]=_[_0xfe7a('0x3b')](_0x1b5e10[_0xfe7a('0x3a')]);_0x1474d2[_0xfe7a('0x43')]=_[_0xfe7a('0x50')](_0x1474d2[_0xfe7a('0x39')],_0x1474d2[_0xfe7a('0x3a')]);_0x1c5767[_0xfe7a('0x3c')]=_['intersection'](_0x1474d2['model'],qs[_0xfe7a('0x3d')](_0x1b5e10[_0xfe7a('0x3a')][_0xfe7a('0x3d')]));_0x1c5767[_0xfe7a('0x3c')]=_0x1c5767[_0xfe7a('0x3c')][_0xfe7a('0x3e')]?_0x1c5767['attributes']:_0x1474d2[_0xfe7a('0x39')];if(_0x1b5e10[_0xfe7a('0x3a')][_0xfe7a('0x4c')]){_0x1c5767[_0xfe7a('0x51')]=[{'all':!![]}];}_0x1c5767=_['merge']({},_0x1c5767,_0x1b5e10[_0xfe7a('0x4a')]);return db[_0xfe7a('0x4f')][_0xfe7a('0x52')](_0x1c5767)[_0xfe7a('0x4b')](handleEntityNotFound(_0x23d038,null))[_0xfe7a('0x4b')](respondWithResult(_0x23d038,null))[_0xfe7a('0x28')](handleError(_0x23d038,null));};exports[_0xfe7a('0x53')]=function(_0x519f0a,_0x17d142){return db[_0xfe7a('0x4f')][_0xfe7a('0x53')](_0x519f0a[_0xfe7a('0x54')],{})[_0xfe7a('0x4b')](respondWithResult(_0x17d142,0xc9))[_0xfe7a('0x28')](handleError(_0x17d142,null));};exports[_0xfe7a('0x32')]=function(_0x7d7600,_0x40d493){if(_0x7d7600['body']['id']){delete _0x7d7600[_0xfe7a('0x54')]['id'];}return db[_0xfe7a('0x4f')][_0xfe7a('0x52')]({'where':{'id':_0x7d7600[_0xfe7a('0x55')]['id']}})['then'](handleEntityNotFound(_0x40d493,null))[_0xfe7a('0x4b')](saveUpdates(_0x7d7600[_0xfe7a('0x54')],null))[_0xfe7a('0x4b')](respondWithResult(_0x40d493,null))[_0xfe7a('0x28')](handleError(_0x40d493,null));};exports[_0xfe7a('0x33')]=function(_0x117b8c,_0x59a46e){return db[_0xfe7a('0x4f')][_0xfe7a('0x52')]({'where':{'id':_0x117b8c[_0xfe7a('0x55')]['id']}})['then'](handleEntityNotFound(_0x59a46e,null))[_0xfe7a('0x4b')](removeEntity(_0x59a46e,null))[_0xfe7a('0x28')](handleError(_0x59a46e,null));};exports[_0xfe7a('0x56')]=function(_0x7ea364,_0x3205b7,_0x2b88d1){var _0x3621d0={};var _0x1beaa1={};var _0x23d18d;var _0x2af133;return db[_0xfe7a('0x4f')][_0xfe7a('0x57')]({'where':{'id':_0x7ea364[_0xfe7a('0x55')]['id']}})['then'](handleEntityNotFound(_0x3205b7,null))[_0xfe7a('0x4b')](function(_0x36d0c8){if(_0x36d0c8){_0x23d18d=_0x36d0c8;_0x1beaa1[_0xfe7a('0x39')]=_[_0xfe7a('0x3b')](db[_0xfe7a('0x58')]['rawAttributes']);_0x1beaa1['query']=_[_0xfe7a('0x3b')](_0x7ea364[_0xfe7a('0x3a')]);_0x1beaa1[_0xfe7a('0x43')]=_[_0xfe7a('0x50')](_0x1beaa1[_0xfe7a('0x39')],_0x1beaa1[_0xfe7a('0x3a')]);_0x3621d0[_0xfe7a('0x3c')]=_[_0xfe7a('0x50')](_0x1beaa1['model'],qs['fields'](_0x7ea364['query'][_0xfe7a('0x3d')]));_0x3621d0[_0xfe7a('0x3c')]=_0x3621d0[_0xfe7a('0x3c')][_0xfe7a('0x3e')]?_0x3621d0[_0xfe7a('0x3c')]:_0x1beaa1[_0xfe7a('0x39')];_0x3621d0[_0xfe7a('0x41')]=qs[_0xfe7a('0x42')](_0x7ea364[_0xfe7a('0x3a')]['sort']);_0x3621d0[_0xfe7a('0x46')]=qs[_0xfe7a('0x43')](_[_0xfe7a('0x44')](_0x7ea364[_0xfe7a('0x3a')],_0x1beaa1[_0xfe7a('0x43')]));if(_0x7ea364[_0xfe7a('0x3a')]['filter']){_0x3621d0[_0xfe7a('0x46')]=_['merge'](_0x3621d0['where'],{'$or':_[_0xfe7a('0x47')](_0x3621d0[_0xfe7a('0x3c')],function(_0x220995){var _0x460f94={};_0x460f94[_0x220995]={'$like':'%'+_0x7ea364[_0xfe7a('0x3a')][_0xfe7a('0x45')]+'%'};return _0x460f94;})});}_0x3621d0=_[_0xfe7a('0x59')]({},_0x3621d0,_0x7ea364[_0xfe7a('0x4a')]);return _0x23d18d[_0xfe7a('0x56')](_0x3621d0);}})['then'](function(_0x3a5241){if(_0x3a5241){_0x2af133=_0x3a5241['length'];if(!_0x7ea364[_0xfe7a('0x3a')][_0xfe7a('0x3f')](_0xfe7a('0x40'))){_0x3621d0[_0xfe7a('0x2e')]=qs[_0xfe7a('0x2e')](_0x7ea364[_0xfe7a('0x3a')][_0xfe7a('0x2e')]);_0x3621d0[_0xfe7a('0x2d')]=qs[_0xfe7a('0x2d')](_0x7ea364[_0xfe7a('0x3a')][_0xfe7a('0x2d')]);}return _0x23d18d[_0xfe7a('0x56')](_0x3621d0);}})['then'](function(_0x5df3c0){if(_0x5df3c0){return _0x5df3c0?{'count':_0x2af133,'rows':_0x5df3c0}:null;}})[_0xfe7a('0x4b')](respondWithResult(_0x3205b7,null))[_0xfe7a('0x28')](handleError(_0x3205b7,null));};exports[_0xfe7a('0x5a')]=function(_0x43360b,_0x263da0,_0x2da4f8){if(_0x43360b[_0xfe7a('0x54')]['id']){delete _0x43360b['body']['id'];}return db[_0xfe7a('0x4f')][_0xfe7a('0x57')]({'where':{'id':_0x43360b[_0xfe7a('0x55')]['id']}})[_0xfe7a('0x4b')](handleEntityNotFound(_0x263da0,null))['then'](function(_0x15cb28){if(_0x15cb28){_0x43360b['body'][_0xfe7a('0x5b')]=_0x15cb28['id'];_0x43360b['body'][_0xfe7a('0x5c')]=integrations[_0xfe7a('0x5d')](_0x43360b['body'][_0xfe7a('0x5e')],_0x43360b[_0xfe7a('0x54')]['type']);_0x43360b[_0xfe7a('0x54')][_0xfe7a('0x5f')]=integrations[_0xfe7a('0x60')](_0x43360b[_0xfe7a('0x54')][_0xfe7a('0x5e')],_0x43360b[_0xfe7a('0x54')][_0xfe7a('0x48')]);return db[_0xfe7a('0x58')][_0xfe7a('0x53')](_0x43360b['body'],{'include':[{'model':db[_0xfe7a('0x61')],'as':_0xfe7a('0x5c')},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0xfe7a('0x4b')](respondWithResult(_0x263da0,null))[_0xfe7a('0x28')](handleError(_0x263da0,null));};exports[_0xfe7a('0x62')]=function(_0x1fd3ed,_0x4b6749,_0x596d8f){var _0x4a0b7e='';return db['FreshdeskAccount']['findOne']({'where':{'id':_0x1fd3ed[_0xfe7a('0x55')]['id']},'attributes':['id',_0xfe7a('0x63'),_0xfe7a('0x64')]})[_0xfe7a('0x4b')](handleEntityNotFound(_0x4b6749,null))[_0xfe7a('0x4b')](function(_0x1fb5ca){if(_0x1fb5ca){_0x4a0b7e=_0x1fb5ca[_0xfe7a('0x63')];var _0x164a0b=_0x4a0b7e[_0xfe7a('0x65')](-0x1);if(_0x164a0b==='/'){_0x4a0b7e=_0x4a0b7e[_0xfe7a('0x66')](0x0,_0x4a0b7e[_0xfe7a('0x67')](_0x164a0b));}return rp({'method':_0xfe7a('0x68'),'uri':util[_0xfe7a('0x69')](_0xfe7a('0x6a'),_0x4a0b7e,_0xfe7a('0x6b')),'headers':{'Authorization':util[_0xfe7a('0x69')](_0xfe7a('0x6c'),new Buffer(util['format'](_0xfe7a('0x6d'),_0x1fb5ca[_0xfe7a('0x64')]))[_0xfe7a('0x6e')]('base64'))},'json':!![]});}})[_0xfe7a('0x4b')](function(_0x128a93){if(_0x128a93){var _0x2c4f52=['requester','subject',_0xfe7a('0x6f'),'description',_0xfe7a('0x29'),'priority',_0xfe7a('0x70'),_0xfe7a('0x71'),_0xfe7a('0x72'),_0xfe7a('0x70'),_0xfe7a('0x73')];_[_0xfe7a('0x74')](_0x128a93,function(_0x263f37){return _0x2c4f52[_0xfe7a('0x75')](_0x263f37[_0xfe7a('0x35')])||!_0x263f37[_0xfe7a('0x76')]&&_0x263f37['type']!==_0xfe7a('0x77')&&_0x263f37[_0xfe7a('0x48')]!==_0xfe7a('0x78');});return{'count':_0x128a93[_0xfe7a('0x3e')],'rows':_['map'](_0x128a93,function(_0x5ae5a2){return{'id':_0x5ae5a2['name'],'name':_0x5ae5a2[_0xfe7a('0x79')],'custom':!_0x5ae5a2[_0xfe7a('0x76')],'options':_0x5ae5a2[_0xfe7a('0x7a')]?_['map'](_0x5ae5a2[_0xfe7a('0x7a')],function(_0x2a3063){return{'name':_[_0xfe7a('0x7b')](_0x2a3063),'value':_0x2a3063};}):[]};})};}})[_0xfe7a('0x4b')](respondWithResult(_0x4b6749,null))[_0xfe7a('0x28')](function(_0x164904){var _0x98aa7a=_0x1fd3ed[_0xfe7a('0x3a')][_0xfe7a('0x1b')]?0x1f4:_0x164904['statusCode']||0x1f4;logger[_0xfe7a('0x24')](_0xfe7a('0x7c'),_0xfe7a('0x62'),_0x98aa7a,JSON[_0xfe7a('0x23')](_0x164904));delete _0x164904[_0xfe7a('0x35')];if(_0x98aa7a===0x191){_0x98aa7a=0x190;}_0x4b6749['status'](_0x98aa7a)[_0xfe7a('0x36')](_0x1fd3ed[_0xfe7a('0x3a')][_0xfe7a('0x1b')]?{'message':'Wrong\x20credentials','statusCode':_0x164904[_0xfe7a('0x7d')]}:_0x164904);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 41d5eea..08533d0 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 _0x90c9=['exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../components/integrations/configuration'];(function(_0x535eea,_0x505d89){var _0x1d9349=function(_0x14aa16){while(--_0x14aa16){_0x535eea['push'](_0x535eea['shift']());}};_0x1d9349(++_0x505d89);}(_0x90c9,0xd0));var _0x990c=function(_0x525284,_0x525c3e){_0x525284=_0x525284-0x0;var _0x1fbcd6=_0x90c9[_0x525284];return _0x1fbcd6;};'use strict';var _=require(_0x990c('0x0'));var util=require('util');var logger=require(_0x990c('0x1'))(_0x990c('0x2'));var moment=require(_0x990c('0x3'));var BPromise=require(_0x990c('0x4'));var rp=require(_0x990c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x990c('0x6'));var config=require('../../config/environment');var attributes=require('./intFreshdeskAccount.attributes');var integrations=require(_0x990c('0x7'));module[_0x990c('0x8')]=function(_0x14f303,_0x5974a5){return _0x14f303[_0x990c('0x9')](_0x990c('0xa'),attributes,{'tableName':_0x990c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8dc7=['request-promise','../../config/environment','./intFreshdeskAccount.attributes','FreshdeskAccount','int_freshdesk_accounts','lodash','../../config/logger','api','moment','bluebird'];(function(_0x42808c,_0x43411c){var _0x2621e0=function(_0x3f7014){while(--_0x3f7014){_0x42808c['push'](_0x42808c['shift']());}};_0x2621e0(++_0x43411c);}(_0x8dc7,0x9b));var _0x78dc=function(_0xf94f77,_0xe090a0){_0xf94f77=_0xf94f77-0x0;var _0x536768=_0x8dc7[_0xf94f77];return _0x536768;};'use strict';var _=require(_0x78dc('0x0'));var util=require('util');var logger=require(_0x78dc('0x1'))(_0x78dc('0x2'));var moment=require(_0x78dc('0x3'));var BPromise=require(_0x78dc('0x4'));var rp=require(_0x78dc('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x78dc('0x6'));var attributes=require(_0x78dc('0x7'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x31ef6d,_0x552268){return _0x31ef6d['define'](_0x78dc('0x8'),attributes,{'tableName':_0x78dc('0x9'),'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 b91127e..6610ef1 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 _0x7c88=['options','where','attributes','limit','include','model','map','ShowFreshdeskAccount','FreshdeskAccount','find','raw','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetFreshdeskAccount'];(function(_0x3be301,_0x51cb2f){var _0x331db4=function(_0x4237fc){while(--_0x4237fc){_0x3be301['push'](_0x3be301['shift']());}};_0x331db4(++_0x51cb2f);}(_0x7c88,0x1c5));var _0x87c8=function(_0x45670b,_0x40be50){_0x45670b=_0x45670b-0x0;var _0x43a2ff=_0x7c88[_0x45670b];return _0x43a2ff;};'use strict';var _=require(_0x87c8('0x0'));var util=require(_0x87c8('0x1'));var moment=require('moment');var BPromise=require(_0x87c8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x87c8('0x3'));var db=require(_0x87c8('0x4'))['db'];var utils=require(_0x87c8('0x5'));var logger=require(_0x87c8('0x6'))(_0x87c8('0x7'));var config=require(_0x87c8('0x8'));var jayson=require(_0x87c8('0x9'));var client=jayson['client'][_0x87c8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x498bb7,_0x35516f,_0xe17801){return new BPromise(function(_0x363dfb,_0x213434){return client[_0x87c8('0xb')](_0x498bb7,_0xe17801)[_0x87c8('0xc')](function(_0x5837da){logger[_0x87c8('0xd')](_0x87c8('0xe'),_0x35516f,_0x87c8('0xf'));logger[_0x87c8('0x10')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x35516f,_0x87c8('0xf'),JSON[_0x87c8('0x11')](_0x5837da));if(_0x5837da['error']){if(_0x5837da['error']['code']===0x1f4){logger[_0x87c8('0x12')]('FreshdeskAccount,\x20%s,\x20%s',_0x35516f,_0x5837da[_0x87c8('0x12')]['message']);return _0x213434(_0x5837da[_0x87c8('0x12')]['message']);}logger[_0x87c8('0x12')](_0x87c8('0xe'),_0x35516f,_0x5837da[_0x87c8('0x12')]['message']);return _0x363dfb(_0x5837da[_0x87c8('0x12')][_0x87c8('0x13')]);}else{logger[_0x87c8('0xd')](_0x87c8('0xe'),_0x35516f,_0x87c8('0xf'));_0x363dfb(_0x5837da[_0x87c8('0x14')]['message']);}})[_0x87c8('0x15')](function(_0x3f98d9){logger['error'](_0x87c8('0xe'),_0x35516f,_0x3f98d9);_0x213434(_0x3f98d9);});});}exports[_0x87c8('0x16')]=function(_0x19270b){var _0x46c940=this;return new Promise(function(_0x818fe5,_0x13d263){return db['FreshdeskAccount']['findAll']({'raw':_0x19270b['options']?_0x19270b[_0x87c8('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x19270b[_0x87c8('0x17')]?_0x19270b[_0x87c8('0x17')][_0x87c8('0x18')]||null:null,'attributes':_0x19270b[_0x87c8('0x17')]?_0x19270b[_0x87c8('0x17')][_0x87c8('0x19')]||null:null,'limit':_0x19270b[_0x87c8('0x17')]?_0x19270b[_0x87c8('0x17')][_0x87c8('0x1a')]||null:null,'include':_0x19270b[_0x87c8('0x17')]?_0x19270b['options']['include']?_['map'](_0x19270b[_0x87c8('0x17')][_0x87c8('0x1b')],function(_0x12a8a6){return{'model':db[_0x12a8a6[_0x87c8('0x1c')]],'as':_0x12a8a6['as'],'attributes':_0x12a8a6[_0x87c8('0x19')],'include':_0x12a8a6['include']?_['map'](_0x12a8a6['include'],function(_0xe27104){return{'model':db[_0xe27104[_0x87c8('0x1c')]],'as':_0xe27104['as'],'attributes':_0xe27104[_0x87c8('0x19')],'include':_0xe27104[_0x87c8('0x1b')]?_[_0x87c8('0x1d')](_0xe27104[_0x87c8('0x1b')],function(_0x5bdd91){return{'model':db[_0x5bdd91[_0x87c8('0x1c')]],'as':_0x5bdd91['as'],'attributes':_0x5bdd91[_0x87c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x87c8('0xc')](function(_0x29cbf0){logger[_0x87c8('0xd')](_0x87c8('0x16'),_0x19270b);logger[_0x87c8('0x10')](_0x87c8('0x16'),_0x19270b,JSON[_0x87c8('0x11')](_0x29cbf0));_0x818fe5(_0x29cbf0);})[_0x87c8('0x15')](function(_0x502e56){logger['error'](_0x87c8('0x16'),_0x502e56[_0x87c8('0x13')],_0x19270b);_0x13d263(_0x46c940[_0x87c8('0x12')](0x1f4,_0x502e56['message']));});});};exports[_0x87c8('0x1e')]=function(_0x1f1101){var _0x39e63c=this;return new Promise(function(_0x50893c,_0x3ecd5e){return db[_0x87c8('0x1f')][_0x87c8('0x20')]({'raw':_0x1f1101[_0x87c8('0x17')]?_0x1f1101[_0x87c8('0x17')][_0x87c8('0x21')]===undefined?!![]:![]:!![],'where':_0x1f1101[_0x87c8('0x17')]?_0x1f1101[_0x87c8('0x17')][_0x87c8('0x18')]||null:null,'attributes':_0x1f1101[_0x87c8('0x17')]?_0x1f1101['options']['attributes']||null:null,'include':_0x1f1101['options']?_0x1f1101[_0x87c8('0x17')][_0x87c8('0x1b')]?_[_0x87c8('0x1d')](_0x1f1101[_0x87c8('0x17')][_0x87c8('0x1b')],function(_0x3f06e4){return{'model':db[_0x3f06e4['model']],'as':_0x3f06e4['as'],'attributes':_0x3f06e4[_0x87c8('0x19')],'include':_0x3f06e4[_0x87c8('0x1b')]?_[_0x87c8('0x1d')](_0x3f06e4['include'],function(_0x4b78f4){return{'model':db[_0x4b78f4[_0x87c8('0x1c')]],'as':_0x4b78f4['as'],'attributes':_0x4b78f4[_0x87c8('0x19')],'include':_0x4b78f4[_0x87c8('0x1b')]?_[_0x87c8('0x1d')](_0x4b78f4[_0x87c8('0x1b')],function(_0x2c444b){return{'model':db[_0x2c444b[_0x87c8('0x1c')]],'as':_0x2c444b['as'],'attributes':_0x2c444b[_0x87c8('0x19')]};}):[]};}):[]};}):[]:[]})[_0x87c8('0xc')](function(_0x4bee70){logger[_0x87c8('0xd')](_0x87c8('0x1e'),_0x1f1101);logger[_0x87c8('0x10')](_0x87c8('0x1e'),_0x1f1101,JSON[_0x87c8('0x11')](_0x4bee70));_0x50893c(_0x4bee70);})[_0x87c8('0x15')](function(_0x500786){logger['error'](_0x87c8('0x1e'),_0x500786[_0x87c8('0x13')],_0x1f1101);_0x3ecd5e(_0x39e63c[_0x87c8('0x12')](0x1f4,_0x500786[_0x87c8('0x13')]));});});}; \ No newline at end of file +var _0xfd7c=['result','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','GetFreshdeskAccount','find','ShowFreshdeskAccount','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent'];(function(_0x104be5,_0x129c96){var _0x542dc8=function(_0x5c39e1){while(--_0x5c39e1){_0x104be5['push'](_0x104be5['shift']());}};_0x542dc8(++_0x129c96);}(_0xfd7c,0x10c));var _0xcfd7=function(_0x6fc0ad,_0x428839){_0x6fc0ad=_0x6fc0ad-0x0;var _0x3f894c=_0xfd7c[_0x6fc0ad];return _0x3f894c;};'use strict';var _=require(_0xcfd7('0x0'));var util=require(_0xcfd7('0x1'));var moment=require(_0xcfd7('0x2'));var BPromise=require(_0xcfd7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcfd7('0x4'));var db=require(_0xcfd7('0x5'))['db'];var utils=require(_0xcfd7('0x6'));var logger=require(_0xcfd7('0x7'))(_0xcfd7('0x8'));var config=require(_0xcfd7('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfd7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xc08857,_0x1d3491,_0x56d8ae){return new BPromise(function(_0x3eba17,_0x15aa6c){return client[_0xcfd7('0xb')](_0xc08857,_0x56d8ae)['then'](function(_0x772541){logger[_0xcfd7('0xc')](_0xcfd7('0xd'),_0x1d3491,'request\x20sent');logger[_0xcfd7('0xe')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x1d3491,'request\x20sent',JSON[_0xcfd7('0xf')](_0x772541));if(_0x772541['error']){if(_0x772541[_0xcfd7('0x10')][_0xcfd7('0x11')]===0x1f4){logger[_0xcfd7('0x10')](_0xcfd7('0xd'),_0x1d3491,_0x772541[_0xcfd7('0x10')][_0xcfd7('0x12')]);return _0x15aa6c(_0x772541[_0xcfd7('0x10')]['message']);}logger[_0xcfd7('0x10')](_0xcfd7('0xd'),_0x1d3491,_0x772541[_0xcfd7('0x10')][_0xcfd7('0x12')]);return _0x3eba17(_0x772541['error'][_0xcfd7('0x12')]);}else{logger['info'](_0xcfd7('0xd'),_0x1d3491,_0xcfd7('0x13'));_0x3eba17(_0x772541[_0xcfd7('0x14')][_0xcfd7('0x12')]);}})[_0xcfd7('0x15')](function(_0x448fa9){logger[_0xcfd7('0x10')](_0xcfd7('0xd'),_0x1d3491,_0x448fa9);_0x15aa6c(_0x448fa9);});});}exports['GetFreshdeskAccount']=function(_0x18879){var _0x51290c=this;return new Promise(function(_0x53bd56,_0x38beaa){return db[_0xcfd7('0x16')][_0xcfd7('0x17')]({'raw':_0x18879[_0xcfd7('0x18')]?_0x18879[_0xcfd7('0x18')][_0xcfd7('0x19')]===undefined?!![]:![]:!![],'where':_0x18879[_0xcfd7('0x18')]?_0x18879['options'][_0xcfd7('0x1a')]||null:null,'attributes':_0x18879['options']?_0x18879['options'][_0xcfd7('0x1b')]||null:null,'limit':_0x18879[_0xcfd7('0x18')]?_0x18879[_0xcfd7('0x18')][_0xcfd7('0x1c')]||null:null,'include':_0x18879[_0xcfd7('0x18')]?_0x18879[_0xcfd7('0x18')][_0xcfd7('0x1d')]?_[_0xcfd7('0x1e')](_0x18879['options']['include'],function(_0x46cbe0){return{'model':db[_0x46cbe0[_0xcfd7('0x1f')]],'as':_0x46cbe0['as'],'attributes':_0x46cbe0[_0xcfd7('0x1b')],'include':_0x46cbe0[_0xcfd7('0x1d')]?_['map'](_0x46cbe0['include'],function(_0x27a42b){return{'model':db[_0x27a42b[_0xcfd7('0x1f')]],'as':_0x27a42b['as'],'attributes':_0x27a42b[_0xcfd7('0x1b')],'include':_0x27a42b[_0xcfd7('0x1d')]?_[_0xcfd7('0x1e')](_0x27a42b[_0xcfd7('0x1d')],function(_0x338d9f){return{'model':db[_0x338d9f[_0xcfd7('0x1f')]],'as':_0x338d9f['as'],'attributes':_0x338d9f['attributes']};}):[]};}):[]};}):[]:[]})[_0xcfd7('0x20')](function(_0x302c18){logger[_0xcfd7('0xc')]('GetFreshdeskAccount',_0x18879);logger['debug'](_0xcfd7('0x21'),_0x18879,JSON['stringify'](_0x302c18));_0x53bd56(_0x302c18);})[_0xcfd7('0x15')](function(_0x49f527){logger[_0xcfd7('0x10')]('GetFreshdeskAccount',_0x49f527['message'],_0x18879);_0x38beaa(_0x51290c[_0xcfd7('0x10')](0x1f4,_0x49f527[_0xcfd7('0x12')]));});});};exports['ShowFreshdeskAccount']=function(_0x517202){var _0x203e80=this;return new Promise(function(_0x1fa497,_0x2951b2){return db[_0xcfd7('0x16')][_0xcfd7('0x22')]({'raw':_0x517202[_0xcfd7('0x18')]?_0x517202[_0xcfd7('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x517202[_0xcfd7('0x18')]?_0x517202['options'][_0xcfd7('0x1a')]||null:null,'attributes':_0x517202['options']?_0x517202[_0xcfd7('0x18')][_0xcfd7('0x1b')]||null:null,'include':_0x517202[_0xcfd7('0x18')]?_0x517202['options'][_0xcfd7('0x1d')]?_[_0xcfd7('0x1e')](_0x517202[_0xcfd7('0x18')][_0xcfd7('0x1d')],function(_0x5c8762){return{'model':db[_0x5c8762[_0xcfd7('0x1f')]],'as':_0x5c8762['as'],'attributes':_0x5c8762[_0xcfd7('0x1b')],'include':_0x5c8762[_0xcfd7('0x1d')]?_['map'](_0x5c8762['include'],function(_0x29b117){return{'model':db[_0x29b117[_0xcfd7('0x1f')]],'as':_0x29b117['as'],'attributes':_0x29b117['attributes'],'include':_0x29b117['include']?_[_0xcfd7('0x1e')](_0x29b117[_0xcfd7('0x1d')],function(_0x431046){return{'model':db[_0x431046[_0xcfd7('0x1f')]],'as':_0x431046['as'],'attributes':_0x431046['attributes']};}):[]};}):[]};}):[]:[]})[_0xcfd7('0x20')](function(_0x488c8d){logger[_0xcfd7('0xc')](_0xcfd7('0x23'),_0x517202);logger['debug'](_0xcfd7('0x23'),_0x517202,JSON[_0xcfd7('0xf')](_0x488c8d));_0x1fa497(_0x488c8d);})[_0xcfd7('0x15')](function(_0x7934d2){logger[_0xcfd7('0x10')](_0xcfd7('0x23'),_0x7934d2['message'],_0x517202);_0x2951b2(_0x203e80[_0xcfd7('0x10')](0x1f4,_0x7934d2[_0xcfd7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 84e617e..83e3f7e 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 _0x884e=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','post','create','put','update','delete'];(function(_0x468110,_0x5088d3){var _0x209a27=function(_0x772e13){while(--_0x772e13){_0x468110['push'](_0x468110['shift']());}};_0x209a27(++_0x5088d3);}(_0x884e,0x91));var _0xe884=function(_0x277427,_0x50a197){_0x277427=_0x277427-0x0;var _0x410aa2=_0x884e[_0x277427];return _0x410aa2;};'use strict';var multer=require(_0xe884('0x0'));var util=require(_0xe884('0x1'));var path=require('path');var timeout=require(_0xe884('0x2'));var express=require(_0xe884('0x3'));var router=express['Router']();var auth=require(_0xe884('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xe884('0x5'));var controller=require('./intFreshdeskConfiguration.controller');router[_0xe884('0x6')]('/',auth['isAuthenticated'](),controller[_0xe884('0x7')]);router[_0xe884('0x6')](_0xe884('0x8'),auth[_0xe884('0x9')](),controller[_0xe884('0xa')]);router[_0xe884('0x6')](_0xe884('0xb'),auth[_0xe884('0x9')](),controller[_0xe884('0xc')]);router[_0xe884('0x6')](_0xe884('0xd'),auth[_0xe884('0x9')](),controller[_0xe884('0xe')]);router['get'](_0xe884('0xf'),auth[_0xe884('0x9')](),controller[_0xe884('0x10')]);router[_0xe884('0x6')](_0xe884('0x11'),auth['isAuthenticated'](),controller['getTags']);router[_0xe884('0x12')]('/',auth[_0xe884('0x9')](),controller[_0xe884('0x13')]);router[_0xe884('0x12')](_0xe884('0x11'),auth['isAuthenticated'](),controller['setTags']);router[_0xe884('0x14')](_0xe884('0x8'),auth[_0xe884('0x9')](),controller[_0xe884('0x15')]);router[_0xe884('0x16')]('/:id',auth[_0xe884('0x9')](),controller['destroy']);module[_0xe884('0x17')]=router; \ No newline at end of file +var _0x0577=['put','update','exports','multer','util','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskConfiguration.controller','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','setTags'];(function(_0x5ad00b,_0x22c334){var _0x2aab79=function(_0x999352){while(--_0x999352){_0x5ad00b['push'](_0x5ad00b['shift']());}};_0x2aab79(++_0x22c334);}(_0x0577,0x93));var _0x7057=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x0577[_0x599f41];return _0x2e4d58;};'use strict';var multer=require(_0x7057('0x0'));var util=require(_0x7057('0x1'));var path=require(_0x7057('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x7057('0x3'));var interaction=require(_0x7057('0x4'));var config=require(_0x7057('0x5'));var controller=require(_0x7057('0x6'));router['get']('/',auth[_0x7057('0x7')](),controller[_0x7057('0x8')]);router[_0x7057('0x9')](_0x7057('0xa'),auth['isAuthenticated'](),controller[_0x7057('0xb')]);router['get']('/:id/fields',auth[_0x7057('0x7')](),controller[_0x7057('0xc')]);router[_0x7057('0x9')](_0x7057('0xd'),auth[_0x7057('0x7')](),controller['getSubjects']);router[_0x7057('0x9')](_0x7057('0xe'),auth[_0x7057('0x7')](),controller[_0x7057('0xf')]);router[_0x7057('0x9')](_0x7057('0x10'),auth[_0x7057('0x7')](),controller[_0x7057('0x11')]);router[_0x7057('0x12')]('/',auth[_0x7057('0x7')](),controller[_0x7057('0x13')]);router[_0x7057('0x12')](_0x7057('0x10'),auth['isAuthenticated'](),controller[_0x7057('0x14')]);router[_0x7057('0x15')](_0x7057('0xa'),auth[_0x7057('0x7')](),controller[_0x7057('0x16')]);router['delete']('/:id',auth[_0x7057('0x7')](),controller['destroy']);module[_0x7057('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index 065d1c0..bce3f07 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 _0xa908=['exports','STRING'];(function(_0x2b4775,_0x375f41){var _0x4655c3=function(_0x489a91){while(--_0x489a91){_0x2b4775['push'](_0x2b4775['shift']());}};_0x4655c3(++_0x375f41);}(_0xa908,0x11e));var _0x8a90=function(_0x57f6ad,_0x4795b6){_0x57f6ad=_0x57f6ad-0x0;var _0x425c09=_0xa908[_0x57f6ad];return _0x425c09;};'use strict';var Sequelize=require('sequelize');module[_0x8a90('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x8a90('0x1')]}}; \ No newline at end of file +var _0x5573=['sequelize','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5573,0xde));var _0x3557=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0x5573[_0x3fe393];return _0x534d14;};'use strict';var Sequelize=require(_0x3557('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x3557('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index bbc70aa..016b4e5 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 _0x1c4d=['fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','merge','where','type','VIRTUAL','includeAll','findAll','rows','show','params','rawAttributes','options','find','create','body','findOne','FreshdeskField','order','getFields','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','jayson/promise','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','stringify','error','code','message','FreshdeskConfiguration,\x20%s,\x20%s','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','end','stack','name','index','FreshdeskConfiguration'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1c4d,0x19f));var _0xd1c4=function(_0x5c8281,_0x414bf6){_0x5c8281=_0x5c8281-0x0;var _0x261520=_0x1c4d[_0x5c8281];return _0x261520;};'use strict';var pdf=require(_0xd1c4('0x0'));var emlformat=require(_0xd1c4('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd1c4('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd1c4('0x3'));var moment=require('moment');var BPromise=require(_0xd1c4('0x4'));var Mustache=require(_0xd1c4('0x5'));var util=require('util');var path=require(_0xd1c4('0x6'));var sox=require(_0xd1c4('0x7'));var csv=require('to-csv');var ejs=require(_0xd1c4('0x8'));var fs=require('fs');var _=require(_0xd1c4('0x9'));var squel=require(_0xd1c4('0xa'));var crypto=require(_0xd1c4('0xb'));var jsforce=require(_0xd1c4('0xc'));var deskjs=require(_0xd1c4('0xd'));var toCsv=require('to-csv');var querystring=require(_0xd1c4('0xe'));var Papa=require(_0xd1c4('0xf'));var Redis=require(_0xd1c4('0x10'));var authService=require(_0xd1c4('0x11'));var qs=require(_0xd1c4('0x12'));var as=require(_0xd1c4('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd1c4('0x14'))(_0xd1c4('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd1c4('0x16'))['db'];var jayson=require(_0xd1c4('0x17'));var client=jayson[_0xd1c4('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0xf8e2bf,_0x5919e8,_0x4b8138){if(_0x4b8138){var _0x1ebac7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ebac7[_0xd1c4('0x19')](_0x5919e8)){return _0xf8e2bf;}else{throw new db[(_0xd1c4('0x1a'))]['ValidationError'](_0xd1c4('0x1b'));}}else{return _0xf8e2bf;}}function respondWithRpcPromise(_0x1e345d,_0x396335,_0x59a4f7,_0x55cf2e){return new BPromise(function(_0x3d387d,_0x4a98b7){var _0x1b8a2f=_0x55cf2e||client;return _0x1b8a2f[_0xd1c4('0x1c')](_0x1e345d,_0x59a4f7)['then'](function(_0x2ca67a){logger[_0xd1c4('0x1d')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x396335,_0xd1c4('0x1e'));logger[_0xd1c4('0x1f')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x396335,'request\x20sent',JSON[_0xd1c4('0x20')](_0x2ca67a));if(_0x2ca67a[_0xd1c4('0x21')]){if(_0x2ca67a[_0xd1c4('0x21')][_0xd1c4('0x22')]===0x1f4){logger[_0xd1c4('0x21')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x396335,_0x2ca67a['error'][_0xd1c4('0x23')]);return _0x4a98b7(_0x2ca67a[_0xd1c4('0x21')][_0xd1c4('0x23')]);}logger[_0xd1c4('0x21')](_0xd1c4('0x24'),_0x396335,_0x2ca67a[_0xd1c4('0x21')][_0xd1c4('0x23')]);return _0x3d387d(_0x2ca67a[_0xd1c4('0x21')][_0xd1c4('0x23')]);}else{logger[_0xd1c4('0x1d')](_0xd1c4('0x24'),_0x396335,_0xd1c4('0x1e'));_0x3d387d(_0x2ca67a[_0xd1c4('0x25')][_0xd1c4('0x23')]);}})[_0xd1c4('0x26')](function(_0x28b008){logger[_0xd1c4('0x21')](_0xd1c4('0x24'),_0x396335,_0x28b008);_0x4a98b7(_0x28b008);});});}function respondWithStatusCode(_0xb7bf65,_0x2765b1){_0x2765b1=_0x2765b1||0xcc;return function(_0xaa157c){if(_0xaa157c){return _0xb7bf65[_0xd1c4('0x27')](_0x2765b1);}return _0xb7bf65['status'](_0x2765b1)['end']();};}function respondWithResult(_0x3ad863,_0x4bb56a){_0x4bb56a=_0x4bb56a||0xc8;return function(_0x5bfc01){if(_0x5bfc01){return _0x3ad863[_0xd1c4('0x28')](_0x4bb56a)[_0xd1c4('0x29')](_0x5bfc01);}};}function respondWithFilteredResult(_0x46e248,_0x1a9c7f){return function(_0x5a41f0){if(_0x5a41f0){var _0x33cdf6=_0x5a41f0[_0xd1c4('0x2a')],_0x50b5a4=_0x1a9c7f[_0xd1c4('0x2b')],_0x203f90=_0x1a9c7f[_0xd1c4('0x2b')]+_0x1a9c7f[_0xd1c4('0x2c')],_0x20cd53;if(_0x203f90>=_0x33cdf6){_0x203f90=_0x33cdf6;_0x20cd53=0xc8;}else{_0x20cd53=0xce;}_0x46e248[_0xd1c4('0x28')](_0x20cd53);return _0x46e248['set'](_0xd1c4('0x2d'),_0x50b5a4+'-'+_0x203f90+'/'+_0x33cdf6)['json'](_0x5a41f0);}return null;};}function patchUpdates(_0x352d9d){return function(_0x1287ad){try{jsonpatch[_0xd1c4('0x2e')](_0x1287ad,_0x352d9d,!![]);}catch(_0x501d1b){return BPromise['reject'](_0x501d1b);}return _0x1287ad['save']();};}function saveUpdates(_0x459448,_0xf9d2e0){return function(_0x75fac5){if(_0x75fac5){return _0x75fac5[_0xd1c4('0x2f')](_0x459448)[_0xd1c4('0x30')](function(_0x50d3ec){return _0x50d3ec;});}return null;};}function removeEntity(_0x109a3f,_0x9729b3){return function(_0x5a4936){if(_0x5a4936){return _0x5a4936[_0xd1c4('0x31')]()[_0xd1c4('0x30')](function(){_0x109a3f[_0xd1c4('0x28')](0xcc)[_0xd1c4('0x32')]();});}};}function handleEntityNotFound(_0x59e5f3,_0x11ddeb){return function(_0x31c13b){if(!_0x31c13b){_0x59e5f3[_0xd1c4('0x27')](0x194);}return _0x31c13b;};}function handleError(_0x5dbf37,_0x38ebf){_0x38ebf=_0x38ebf||0x1f4;return function(_0xe33335){logger['error'](_0xe33335[_0xd1c4('0x33')]);if(_0xe33335['name']){delete _0xe33335[_0xd1c4('0x34')];}_0x5dbf37[_0xd1c4('0x28')](_0x38ebf)['send'](_0xe33335);};}exports[_0xd1c4('0x35')]=function(_0x1a43bb,_0x483061){var _0x31c763={},_0x48bf2f={},_0x557906={'count':0x0,'rows':[]};var _0x1293a5=_['map'](db[_0xd1c4('0x36')]['rawAttributes'],function(_0xf2178e){return{'name':_0xf2178e[_0xd1c4('0x37')],'type':_0xf2178e['type']['key']};});_0x48bf2f[_0xd1c4('0x38')]=_[_0xd1c4('0x39')](_0x1293a5,_0xd1c4('0x34'));_0x48bf2f[_0xd1c4('0x3a')]=_[_0xd1c4('0x3b')](_0x1a43bb[_0xd1c4('0x3a')]);_0x48bf2f[_0xd1c4('0x3c')]=_[_0xd1c4('0x3d')](_0x48bf2f['model'],_0x48bf2f[_0xd1c4('0x3a')]);_0x31c763[_0xd1c4('0x3e')]=_[_0xd1c4('0x3d')](_0x48bf2f[_0xd1c4('0x38')],qs[_0xd1c4('0x3f')](_0x1a43bb[_0xd1c4('0x3a')]['fields']));_0x31c763[_0xd1c4('0x3e')]=_0x31c763[_0xd1c4('0x3e')][_0xd1c4('0x40')]?_0x31c763['attributes']:_0x48bf2f['model'];if(!_0x1a43bb[_0xd1c4('0x3a')][_0xd1c4('0x41')](_0xd1c4('0x42'))){_0x31c763[_0xd1c4('0x2c')]=qs[_0xd1c4('0x2c')](_0x1a43bb[_0xd1c4('0x3a')][_0xd1c4('0x2c')]);_0x31c763['offset']=qs[_0xd1c4('0x2b')](_0x1a43bb['query']['offset']);}_0x31c763['order']=qs[_0xd1c4('0x43')](_0x1a43bb[_0xd1c4('0x3a')][_0xd1c4('0x43')]);_0x31c763['where']=qs[_0xd1c4('0x3c')](_[_0xd1c4('0x44')](_0x1a43bb[_0xd1c4('0x3a')],_0x48bf2f['filters']));if(_0x1a43bb[_0xd1c4('0x3a')][_0xd1c4('0x45')]){_0x31c763['where']=_[_0xd1c4('0x46')](_0x31c763[_0xd1c4('0x47')],{'$or':_[_0xd1c4('0x39')](_0x1293a5,function(_0x4bddee){if(_0x4bddee[_0xd1c4('0x48')]!==_0xd1c4('0x49')){var _0x2e1a3d={};_0x2e1a3d[_0x4bddee[_0xd1c4('0x34')]]={'$like':'%'+_0x1a43bb[_0xd1c4('0x3a')]['filter']+'%'};return _0x2e1a3d;}})});}_0x31c763=_[_0xd1c4('0x46')]({},_0x31c763,_0x1a43bb['options']);var _0x58b118={'where':_0x31c763['where']};return db[_0xd1c4('0x36')][_0xd1c4('0x2a')](_0x58b118)[_0xd1c4('0x30')](function(_0x3d63f0){_0x557906[_0xd1c4('0x2a')]=_0x3d63f0;if(_0x1a43bb[_0xd1c4('0x3a')][_0xd1c4('0x4a')]){_0x31c763['include']=[{'all':!![]}];}return db[_0xd1c4('0x36')][_0xd1c4('0x4b')](_0x31c763);})[_0xd1c4('0x30')](function(_0x128334){_0x557906[_0xd1c4('0x4c')]=_0x128334;return _0x557906;})[_0xd1c4('0x30')](respondWithFilteredResult(_0x483061,_0x31c763))[_0xd1c4('0x26')](handleError(_0x483061,null));};exports[_0xd1c4('0x4d')]=function(_0x362b47,_0x2f8bed){var _0x3efdaa={'raw':![],'where':{'id':_0x362b47[_0xd1c4('0x4e')]['id']}},_0x2070c8={};_0x2070c8[_0xd1c4('0x38')]=_['keys'](db['FreshdeskConfiguration'][_0xd1c4('0x4f')]);_0x2070c8[_0xd1c4('0x3a')]=_[_0xd1c4('0x3b')](_0x362b47[_0xd1c4('0x3a')]);_0x2070c8[_0xd1c4('0x3c')]=_['intersection'](_0x2070c8[_0xd1c4('0x38')],_0x2070c8[_0xd1c4('0x3a')]);_0x3efdaa[_0xd1c4('0x3e')]=_[_0xd1c4('0x3d')](_0x2070c8[_0xd1c4('0x38')],qs[_0xd1c4('0x3f')](_0x362b47['query'][_0xd1c4('0x3f')]));_0x3efdaa[_0xd1c4('0x3e')]=_0x3efdaa[_0xd1c4('0x3e')][_0xd1c4('0x40')]?_0x3efdaa[_0xd1c4('0x3e')]:_0x2070c8[_0xd1c4('0x38')];if(_0x362b47[_0xd1c4('0x3a')][_0xd1c4('0x4a')]){_0x3efdaa['include']=[{'all':!![]}];}_0x3efdaa=_[_0xd1c4('0x46')]({},_0x3efdaa,_0x362b47[_0xd1c4('0x50')]);return db[_0xd1c4('0x36')][_0xd1c4('0x51')](_0x3efdaa)[_0xd1c4('0x30')](handleEntityNotFound(_0x2f8bed,null))[_0xd1c4('0x30')](respondWithResult(_0x2f8bed,null))[_0xd1c4('0x26')](handleError(_0x2f8bed,null));};exports[_0xd1c4('0x52')]=function(_0x4bb310,_0x578c9e){return db[_0xd1c4('0x36')][_0xd1c4('0x52')](_0x4bb310[_0xd1c4('0x53')],{})['then'](respondWithResult(_0x578c9e,0xc9))[_0xd1c4('0x26')](handleError(_0x578c9e,null));};exports[_0xd1c4('0x2f')]=function(_0x43363a,_0x282405){if(_0x43363a[_0xd1c4('0x53')]['id']){delete _0x43363a[_0xd1c4('0x53')]['id'];}return db[_0xd1c4('0x36')][_0xd1c4('0x51')]({'where':{'id':_0x43363a[_0xd1c4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x282405,null))[_0xd1c4('0x30')](saveUpdates(_0x43363a['body'],null))[_0xd1c4('0x30')](respondWithResult(_0x282405,null))[_0xd1c4('0x26')](handleError(_0x282405,null));};exports[_0xd1c4('0x31')]=function(_0x305c1f,_0x315c65){return db[_0xd1c4('0x36')]['find']({'where':{'id':_0x305c1f[_0xd1c4('0x4e')]['id']}})[_0xd1c4('0x30')](handleEntityNotFound(_0x315c65,null))[_0xd1c4('0x30')](removeEntity(_0x315c65,null))[_0xd1c4('0x26')](handleError(_0x315c65,null));};exports['getFields']=function(_0x1be2a9,_0x540bf0,_0xc86058){var _0x2b8aab={};var _0x5cb475={};var _0xcb2615;var _0x35532a;return db[_0xd1c4('0x36')][_0xd1c4('0x54')]({'where':{'id':_0x1be2a9['params']['id']}})['then'](handleEntityNotFound(_0x540bf0,null))[_0xd1c4('0x30')](function(_0xc6372){if(_0xc6372){_0xcb2615=_0xc6372;_0x5cb475[_0xd1c4('0x38')]=_[_0xd1c4('0x3b')](db[_0xd1c4('0x55')]['rawAttributes']);_0x5cb475['query']=_['keys'](_0x1be2a9[_0xd1c4('0x3a')]);_0x5cb475['filters']=_[_0xd1c4('0x3d')](_0x5cb475['model'],_0x5cb475[_0xd1c4('0x3a')]);_0x2b8aab[_0xd1c4('0x3e')]=_[_0xd1c4('0x3d')](_0x5cb475[_0xd1c4('0x38')],qs['fields'](_0x1be2a9['query'][_0xd1c4('0x3f')]));_0x2b8aab['attributes']=_0x2b8aab['attributes']['length']?_0x2b8aab[_0xd1c4('0x3e')]:_0x5cb475[_0xd1c4('0x38')];_0x2b8aab[_0xd1c4('0x56')]=qs[_0xd1c4('0x43')](_0x1be2a9[_0xd1c4('0x3a')][_0xd1c4('0x43')]);_0x2b8aab[_0xd1c4('0x47')]=qs[_0xd1c4('0x3c')](_[_0xd1c4('0x44')](_0x1be2a9['query'],_0x5cb475[_0xd1c4('0x3c')]));if(_0x1be2a9['query'][_0xd1c4('0x45')]){_0x2b8aab[_0xd1c4('0x47')]=_['merge'](_0x2b8aab[_0xd1c4('0x47')],{'$or':_[_0xd1c4('0x39')](_0x2b8aab['attributes'],function(_0x5617e7){var _0x4246b7={};_0x4246b7[_0x5617e7]={'$like':'%'+_0x1be2a9[_0xd1c4('0x3a')][_0xd1c4('0x45')]+'%'};return _0x4246b7;})});}_0x2b8aab=_['merge']({},_0x2b8aab,_0x1be2a9[_0xd1c4('0x50')]);return _0xcb2615[_0xd1c4('0x57')](_0x2b8aab);}})['then'](function(_0x423bab){if(_0x423bab){_0x35532a=_0x423bab[_0xd1c4('0x40')];if(!_0x1be2a9[_0xd1c4('0x3a')][_0xd1c4('0x41')](_0xd1c4('0x42'))){_0x2b8aab[_0xd1c4('0x2c')]=qs[_0xd1c4('0x2c')](_0x1be2a9[_0xd1c4('0x3a')][_0xd1c4('0x2c')]);_0x2b8aab[_0xd1c4('0x2b')]=qs[_0xd1c4('0x2b')](_0x1be2a9[_0xd1c4('0x3a')][_0xd1c4('0x2b')]);}return _0xcb2615['getFields'](_0x2b8aab);}})[_0xd1c4('0x30')](function(_0x870c26){if(_0x870c26){return _0x870c26?{'count':_0x35532a,'rows':_0x870c26}:null;}})[_0xd1c4('0x30')](respondWithResult(_0x540bf0,null))[_0xd1c4('0x26')](handleError(_0x540bf0,null));};exports[_0xd1c4('0x58')]=function(_0x389819,_0x1b2ee0,_0x380ce8){var _0xbcec13={};var _0x2cf377={};var _0x4827dc;var _0x391051;return db[_0xd1c4('0x36')][_0xd1c4('0x54')]({'where':{'id':_0x389819[_0xd1c4('0x4e')]['id']}})[_0xd1c4('0x30')](handleEntityNotFound(_0x1b2ee0,null))[_0xd1c4('0x30')](function(_0x2a7e99){if(_0x2a7e99){_0x4827dc=_0x2a7e99;_0x2cf377['model']=_['keys'](db[_0xd1c4('0x55')][_0xd1c4('0x4f')]);_0x2cf377['query']=_[_0xd1c4('0x3b')](_0x389819[_0xd1c4('0x3a')]);_0x2cf377[_0xd1c4('0x3c')]=_[_0xd1c4('0x3d')](_0x2cf377[_0xd1c4('0x38')],_0x2cf377['query']);_0xbcec13[_0xd1c4('0x3e')]=_[_0xd1c4('0x3d')](_0x2cf377['model'],qs[_0xd1c4('0x3f')](_0x389819[_0xd1c4('0x3a')][_0xd1c4('0x3f')]));_0xbcec13['attributes']=_0xbcec13[_0xd1c4('0x3e')][_0xd1c4('0x40')]?_0xbcec13[_0xd1c4('0x3e')]:_0x2cf377['model'];_0xbcec13[_0xd1c4('0x56')]=qs['sort'](_0x389819[_0xd1c4('0x3a')][_0xd1c4('0x43')]);_0xbcec13[_0xd1c4('0x47')]=qs['filters'](_[_0xd1c4('0x44')](_0x389819[_0xd1c4('0x3a')],_0x2cf377[_0xd1c4('0x3c')]));if(_0x389819[_0xd1c4('0x3a')][_0xd1c4('0x45')]){_0xbcec13[_0xd1c4('0x47')]=_[_0xd1c4('0x46')](_0xbcec13['where'],{'$or':_[_0xd1c4('0x39')](_0xbcec13[_0xd1c4('0x3e')],function(_0x376073){var _0x1dfa7f={};_0x1dfa7f[_0x376073]={'$like':'%'+_0x389819[_0xd1c4('0x3a')][_0xd1c4('0x45')]+'%'};return _0x1dfa7f;})});}_0xbcec13=_[_0xd1c4('0x46')]({},_0xbcec13,_0x389819['options']);return _0x4827dc[_0xd1c4('0x58')](_0xbcec13);}})[_0xd1c4('0x30')](function(_0x4bf82a){if(_0x4bf82a){_0x391051=_0x4bf82a['length'];if(!_0x389819[_0xd1c4('0x3a')][_0xd1c4('0x41')](_0xd1c4('0x42'))){_0xbcec13['limit']=qs[_0xd1c4('0x2c')](_0x389819[_0xd1c4('0x3a')][_0xd1c4('0x2c')]);_0xbcec13[_0xd1c4('0x2b')]=qs[_0xd1c4('0x2b')](_0x389819[_0xd1c4('0x3a')][_0xd1c4('0x2b')]);}return _0x4827dc['getSubjects'](_0xbcec13);}})['then'](function(_0x447692){if(_0x447692){return _0x447692?{'count':_0x391051,'rows':_0x447692}:null;}})[_0xd1c4('0x30')](respondWithResult(_0x1b2ee0,null))['catch'](handleError(_0x1b2ee0,null));};exports['getDescriptions']=function(_0x48f048,_0x4d66a8,_0x823911){var _0x5a0b47={};var _0x461a7f={};var _0x2fed3e;var _0xc0e5b5;return db[_0xd1c4('0x36')][_0xd1c4('0x54')]({'where':{'id':_0x48f048[_0xd1c4('0x4e')]['id']}})[_0xd1c4('0x30')](handleEntityNotFound(_0x4d66a8,null))['then'](function(_0x3d862f){if(_0x3d862f){_0x2fed3e=_0x3d862f;_0x461a7f[_0xd1c4('0x38')]=_[_0xd1c4('0x3b')](db[_0xd1c4('0x55')]['rawAttributes']);_0x461a7f[_0xd1c4('0x3a')]=_['keys'](_0x48f048[_0xd1c4('0x3a')]);_0x461a7f[_0xd1c4('0x3c')]=_['intersection'](_0x461a7f[_0xd1c4('0x38')],_0x461a7f[_0xd1c4('0x3a')]);_0x5a0b47['attributes']=_['intersection'](_0x461a7f[_0xd1c4('0x38')],qs['fields'](_0x48f048[_0xd1c4('0x3a')]['fields']));_0x5a0b47[_0xd1c4('0x3e')]=_0x5a0b47[_0xd1c4('0x3e')][_0xd1c4('0x40')]?_0x5a0b47[_0xd1c4('0x3e')]:_0x461a7f['model'];_0x5a0b47[_0xd1c4('0x56')]=qs[_0xd1c4('0x43')](_0x48f048[_0xd1c4('0x3a')][_0xd1c4('0x43')]);_0x5a0b47['where']=qs['filters'](_[_0xd1c4('0x44')](_0x48f048[_0xd1c4('0x3a')],_0x461a7f['filters']));if(_0x48f048['query'][_0xd1c4('0x45')]){_0x5a0b47[_0xd1c4('0x47')]=_['merge'](_0x5a0b47[_0xd1c4('0x47')],{'$or':_[_0xd1c4('0x39')](_0x5a0b47['attributes'],function(_0x14cbf9){var _0x37ef3b={};_0x37ef3b[_0x14cbf9]={'$like':'%'+_0x48f048['query'][_0xd1c4('0x45')]+'%'};return _0x37ef3b;})});}_0x5a0b47=_[_0xd1c4('0x46')]({},_0x5a0b47,_0x48f048[_0xd1c4('0x50')]);return _0x2fed3e[_0xd1c4('0x59')](_0x5a0b47);}})[_0xd1c4('0x30')](function(_0x62649e){if(_0x62649e){_0xc0e5b5=_0x62649e[_0xd1c4('0x40')];if(!_0x48f048[_0xd1c4('0x3a')][_0xd1c4('0x41')](_0xd1c4('0x42'))){_0x5a0b47[_0xd1c4('0x2c')]=qs[_0xd1c4('0x2c')](_0x48f048[_0xd1c4('0x3a')][_0xd1c4('0x2c')]);_0x5a0b47[_0xd1c4('0x2b')]=qs['offset'](_0x48f048[_0xd1c4('0x3a')][_0xd1c4('0x2b')]);}return _0x2fed3e[_0xd1c4('0x59')](_0x5a0b47);}})[_0xd1c4('0x30')](function(_0x3c6f2d){if(_0x3c6f2d){return _0x3c6f2d?{'count':_0xc0e5b5,'rows':_0x3c6f2d}:null;}})[_0xd1c4('0x30')](respondWithResult(_0x4d66a8,null))[_0xd1c4('0x26')](handleError(_0x4d66a8,null));};exports[_0xd1c4('0x5a')]=function(_0xe0571e,_0x2c202d,_0x36c4c3){var _0x3d0bd6={};var _0x55f05a={};var _0x2887d0;var _0x1b3844;return db['FreshdeskConfiguration'][_0xd1c4('0x54')]({'where':{'id':_0xe0571e[_0xd1c4('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2c202d,null))[_0xd1c4('0x30')](function(_0x2ea34c){if(_0x2ea34c){_0x2887d0=_0x2ea34c;_0x55f05a[_0xd1c4('0x38')]=_[_0xd1c4('0x3b')](db[_0xd1c4('0x5b')]['rawAttributes']);_0x55f05a[_0xd1c4('0x3a')]=_[_0xd1c4('0x3b')](_0xe0571e[_0xd1c4('0x3a')]);_0x55f05a['filters']=_[_0xd1c4('0x3d')](_0x55f05a['model'],_0x55f05a[_0xd1c4('0x3a')]);_0x3d0bd6['attributes']=_[_0xd1c4('0x3d')](_0x55f05a['model'],qs[_0xd1c4('0x3f')](_0xe0571e[_0xd1c4('0x3a')][_0xd1c4('0x3f')]));_0x3d0bd6[_0xd1c4('0x3e')]=_0x3d0bd6[_0xd1c4('0x3e')][_0xd1c4('0x40')]?_0x3d0bd6[_0xd1c4('0x3e')]:_0x55f05a['model'];_0x3d0bd6[_0xd1c4('0x56')]=qs[_0xd1c4('0x43')](_0xe0571e[_0xd1c4('0x3a')][_0xd1c4('0x43')]);_0x3d0bd6[_0xd1c4('0x47')]=qs[_0xd1c4('0x3c')](_['pick'](_0xe0571e[_0xd1c4('0x3a')],_0x55f05a['filters']));if(_0xe0571e[_0xd1c4('0x3a')]['filter']){_0x3d0bd6[_0xd1c4('0x47')]=_['merge'](_0x3d0bd6[_0xd1c4('0x47')],{'$or':_['map'](_0x3d0bd6[_0xd1c4('0x3e')],function(_0x5d6f93){var _0x1b658b={};_0x1b658b[_0x5d6f93]={'$like':'%'+_0xe0571e['query'][_0xd1c4('0x45')]+'%'};return _0x1b658b;})});}_0x3d0bd6=_[_0xd1c4('0x46')]({},_0x3d0bd6,_0xe0571e[_0xd1c4('0x50')]);return _0x2887d0[_0xd1c4('0x5a')](_0x3d0bd6);}})[_0xd1c4('0x30')](function(_0x148e51){if(_0x148e51){_0x1b3844=_0x148e51[_0xd1c4('0x40')];if(!_0xe0571e[_0xd1c4('0x3a')][_0xd1c4('0x41')](_0xd1c4('0x42'))){_0x3d0bd6[_0xd1c4('0x2c')]=qs[_0xd1c4('0x2c')](_0xe0571e['query'][_0xd1c4('0x2c')]);_0x3d0bd6[_0xd1c4('0x2b')]=qs['offset'](_0xe0571e[_0xd1c4('0x3a')][_0xd1c4('0x2b')]);}return _0x2887d0[_0xd1c4('0x5a')](_0x3d0bd6);}})[_0xd1c4('0x30')](function(_0x230cde){if(_0x230cde){return _0x230cde?{'count':_0x1b3844,'rows':_0x230cde}:null;}})[_0xd1c4('0x30')](respondWithResult(_0x2c202d,null))['catch'](handleError(_0x2c202d,null));};exports[_0xd1c4('0x5c')]=function(_0x349148,_0x4ccbe5,_0xc95e7a){if(_0x349148[_0xd1c4('0x53')]['id']){delete _0x349148['body']['id'];}return db['FreshdeskConfiguration'][_0xd1c4('0x54')]({'where':{'id':_0x349148[_0xd1c4('0x4e')]['id']}})[_0xd1c4('0x30')](handleEntityNotFound(_0x4ccbe5,null))['then'](function(_0x2de519){if(_0x2de519){return _0x2de519['setTags'](_0x349148[_0xd1c4('0x53')][_0xd1c4('0x5d')]||[]);}return null;})['then'](respondWithResult(_0x4ccbe5,null))[_0xd1c4('0x26')](handleError(_0x4ccbe5,null));}; \ No newline at end of file +var _0x1491=['rawAttributes','type','key','query','keys','attributes','intersection','fields','length','model','limit','order','sort','pick','where','VIRTUAL','filter','merge','options','includeAll','findAll','rows','show','params','filters','include','find','create','body','update','destroy','getFields','findOne','FreshdeskField','hasOwnProperty','nolimit','getDescriptions','getTags','Tag','setTags','ids','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','jayson/promise','http','test','ValidationError','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','stack','name','send','index','map','FreshdeskConfiguration'];(function(_0x31f7b8,_0x44168d){var _0x471a56=function(_0x18dc3c){while(--_0x18dc3c){_0x31f7b8['push'](_0x31f7b8['shift']());}};_0x471a56(++_0x44168d);}(_0x1491,0x1b1));var _0x1149=function(_0x12eb1c,_0x58b94b){_0x12eb1c=_0x12eb1c-0x0;var _0x4a1f9e=_0x1491[_0x12eb1c];return _0x4a1f9e;};'use strict';var pdf=require(_0x1149('0x0'));var emlformat=require(_0x1149('0x1'));var rimraf=require(_0x1149('0x2'));var zipdir=require(_0x1149('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1149('0x4'));var moment=require(_0x1149('0x5'));var BPromise=require(_0x1149('0x6'));var Mustache=require(_0x1149('0x7'));var util=require(_0x1149('0x8'));var path=require(_0x1149('0x9'));var sox=require(_0x1149('0xa'));var csv=require(_0x1149('0xb'));var ejs=require(_0x1149('0xc'));var fs=require('fs');var _=require(_0x1149('0xd'));var squel=require(_0x1149('0xe'));var crypto=require(_0x1149('0xf'));var jsforce=require(_0x1149('0x10'));var deskjs=require(_0x1149('0x11'));var toCsv=require(_0x1149('0xb'));var querystring=require(_0x1149('0x12'));var Papa=require(_0x1149('0x13'));var Redis=require(_0x1149('0x14'));var authService=require(_0x1149('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x1149('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x1149('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x1149('0x18'));var client=jayson['client'][_0x1149('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3531e6,_0x1f2a73,_0x3144dc){if(_0x3144dc){var _0x3ed5e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3ed5e8[_0x1149('0x1a')](_0x1f2a73)){return _0x3531e6;}else{throw new db['Sequelize'][(_0x1149('0x1b'))]('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 _0x3531e6;}}function respondWithRpcPromise(_0x4ca1c0,_0x669ae,_0xdac107,_0x552de8){return new BPromise(function(_0xdee3e5,_0x10e218){var _0x2fd083=_0x552de8||client;return _0x2fd083[_0x1149('0x1c')](_0x4ca1c0,_0xdac107)[_0x1149('0x1d')](function(_0x27f49f){logger[_0x1149('0x1e')](_0x1149('0x1f'),_0x669ae,_0x1149('0x20'));logger[_0x1149('0x21')](_0x1149('0x22'),_0x669ae,_0x1149('0x20'),JSON[_0x1149('0x23')](_0x27f49f));if(_0x27f49f['error']){if(_0x27f49f['error'][_0x1149('0x24')]===0x1f4){logger[_0x1149('0x25')](_0x1149('0x1f'),_0x669ae,_0x27f49f[_0x1149('0x25')][_0x1149('0x26')]);return _0x10e218(_0x27f49f['error'][_0x1149('0x26')]);}logger[_0x1149('0x25')](_0x1149('0x1f'),_0x669ae,_0x27f49f['error'][_0x1149('0x26')]);return _0xdee3e5(_0x27f49f[_0x1149('0x25')][_0x1149('0x26')]);}else{logger['info'](_0x1149('0x1f'),_0x669ae,_0x1149('0x20'));_0xdee3e5(_0x27f49f[_0x1149('0x27')]['message']);}})[_0x1149('0x28')](function(_0x1d0537){logger[_0x1149('0x25')](_0x1149('0x1f'),_0x669ae,_0x1d0537);_0x10e218(_0x1d0537);});});}function respondWithStatusCode(_0x1d6843,_0x397058){_0x397058=_0x397058||0xcc;return function(_0x161b18){if(_0x161b18){return _0x1d6843[_0x1149('0x29')](_0x397058);}return _0x1d6843[_0x1149('0x2a')](_0x397058)[_0x1149('0x2b')]();};}function respondWithResult(_0x51c0a4,_0x1f3174){_0x1f3174=_0x1f3174||0xc8;return function(_0x17cf9b){if(_0x17cf9b){return _0x51c0a4['status'](_0x1f3174)[_0x1149('0x2c')](_0x17cf9b);}};}function respondWithFilteredResult(_0x1f5b45,_0x4dc164){return function(_0x593df7){if(_0x593df7){var _0x1b633a=_0x593df7[_0x1149('0x2d')],_0x1c3668=_0x4dc164[_0x1149('0x2e')],_0x48371b=_0x4dc164[_0x1149('0x2e')]+_0x4dc164['limit'],_0x3be344;if(_0x48371b>=_0x1b633a){_0x48371b=_0x1b633a;_0x3be344=0xc8;}else{_0x3be344=0xce;}_0x1f5b45['status'](_0x3be344);return _0x1f5b45['set'](_0x1149('0x2f'),_0x1c3668+'-'+_0x48371b+'/'+_0x1b633a)[_0x1149('0x2c')](_0x593df7);}return null;};}function patchUpdates(_0x337569){return function(_0x482c8e){try{jsonpatch[_0x1149('0x30')](_0x482c8e,_0x337569,!![]);}catch(_0x1a8cdb){return BPromise[_0x1149('0x31')](_0x1a8cdb);}return _0x482c8e[_0x1149('0x32')]();};}function saveUpdates(_0x4bf62b,_0x1aa0b3){return function(_0x256384){if(_0x256384){return _0x256384['update'](_0x4bf62b)['then'](function(_0x16df2a){return _0x16df2a;});}return null;};}function removeEntity(_0x501535,_0x54e2d9){return function(_0x4e4dc9){if(_0x4e4dc9){return _0x4e4dc9['destroy']()[_0x1149('0x1d')](function(){_0x501535[_0x1149('0x2a')](0xcc)[_0x1149('0x2b')]();});}};}function handleEntityNotFound(_0x53bf78,_0x2c224d){return function(_0x57e7ca){if(!_0x57e7ca){_0x53bf78['sendStatus'](0x194);}return _0x57e7ca;};}function handleError(_0x2e2fa6,_0xa20656){_0xa20656=_0xa20656||0x1f4;return function(_0x433289){logger[_0x1149('0x25')](_0x433289[_0x1149('0x33')]);if(_0x433289['name']){delete _0x433289[_0x1149('0x34')];}_0x2e2fa6[_0x1149('0x2a')](_0xa20656)[_0x1149('0x35')](_0x433289);};}exports[_0x1149('0x36')]=function(_0x3faae3,_0x4b630c){var _0x2c88cf={},_0x3c8314={},_0x34b1ac={'count':0x0,'rows':[]};var _0x336417=_[_0x1149('0x37')](db[_0x1149('0x38')][_0x1149('0x39')],function(_0xc4009b){return{'name':_0xc4009b['fieldName'],'type':_0xc4009b[_0x1149('0x3a')][_0x1149('0x3b')]};});_0x3c8314['model']=_['map'](_0x336417,_0x1149('0x34'));_0x3c8314[_0x1149('0x3c')]=_[_0x1149('0x3d')](_0x3faae3[_0x1149('0x3c')]);_0x3c8314['filters']=_['intersection'](_0x3c8314['model'],_0x3c8314[_0x1149('0x3c')]);_0x2c88cf[_0x1149('0x3e')]=_[_0x1149('0x3f')](_0x3c8314['model'],qs['fields'](_0x3faae3['query'][_0x1149('0x40')]));_0x2c88cf['attributes']=_0x2c88cf['attributes'][_0x1149('0x41')]?_0x2c88cf['attributes']:_0x3c8314[_0x1149('0x42')];if(!_0x3faae3['query']['hasOwnProperty']('nolimit')){_0x2c88cf[_0x1149('0x43')]=qs['limit'](_0x3faae3['query'][_0x1149('0x43')]);_0x2c88cf[_0x1149('0x2e')]=qs['offset'](_0x3faae3['query'][_0x1149('0x2e')]);}_0x2c88cf[_0x1149('0x44')]=qs[_0x1149('0x45')](_0x3faae3[_0x1149('0x3c')][_0x1149('0x45')]);_0x2c88cf['where']=qs['filters'](_[_0x1149('0x46')](_0x3faae3[_0x1149('0x3c')],_0x3c8314['filters']));if(_0x3faae3[_0x1149('0x3c')]['filter']){_0x2c88cf[_0x1149('0x47')]=_['merge'](_0x2c88cf[_0x1149('0x47')],{'$or':_[_0x1149('0x37')](_0x336417,function(_0x10cb92){if(_0x10cb92[_0x1149('0x3a')]!==_0x1149('0x48')){var _0x505481={};_0x505481[_0x10cb92[_0x1149('0x34')]]={'$like':'%'+_0x3faae3[_0x1149('0x3c')][_0x1149('0x49')]+'%'};return _0x505481;}})});}_0x2c88cf=_[_0x1149('0x4a')]({},_0x2c88cf,_0x3faae3[_0x1149('0x4b')]);var _0x50fb46={'where':_0x2c88cf['where']};return db[_0x1149('0x38')][_0x1149('0x2d')](_0x50fb46)[_0x1149('0x1d')](function(_0x21cd9b){_0x34b1ac['count']=_0x21cd9b;if(_0x3faae3[_0x1149('0x3c')][_0x1149('0x4c')]){_0x2c88cf['include']=[{'all':!![]}];}return db[_0x1149('0x38')][_0x1149('0x4d')](_0x2c88cf);})['then'](function(_0x5350ad){_0x34b1ac[_0x1149('0x4e')]=_0x5350ad;return _0x34b1ac;})[_0x1149('0x1d')](respondWithFilteredResult(_0x4b630c,_0x2c88cf))['catch'](handleError(_0x4b630c,null));};exports[_0x1149('0x4f')]=function(_0x199fb3,_0x3af860){var _0x24bcc0={'raw':![],'where':{'id':_0x199fb3[_0x1149('0x50')]['id']}},_0x590546={};_0x590546[_0x1149('0x42')]=_[_0x1149('0x3d')](db[_0x1149('0x38')][_0x1149('0x39')]);_0x590546[_0x1149('0x3c')]=_[_0x1149('0x3d')](_0x199fb3[_0x1149('0x3c')]);_0x590546[_0x1149('0x51')]=_[_0x1149('0x3f')](_0x590546[_0x1149('0x42')],_0x590546[_0x1149('0x3c')]);_0x24bcc0[_0x1149('0x3e')]=_['intersection'](_0x590546[_0x1149('0x42')],qs[_0x1149('0x40')](_0x199fb3[_0x1149('0x3c')][_0x1149('0x40')]));_0x24bcc0[_0x1149('0x3e')]=_0x24bcc0['attributes'][_0x1149('0x41')]?_0x24bcc0[_0x1149('0x3e')]:_0x590546[_0x1149('0x42')];if(_0x199fb3[_0x1149('0x3c')][_0x1149('0x4c')]){_0x24bcc0[_0x1149('0x52')]=[{'all':!![]}];}_0x24bcc0=_[_0x1149('0x4a')]({},_0x24bcc0,_0x199fb3[_0x1149('0x4b')]);return db[_0x1149('0x38')][_0x1149('0x53')](_0x24bcc0)['then'](handleEntityNotFound(_0x3af860,null))[_0x1149('0x1d')](respondWithResult(_0x3af860,null))[_0x1149('0x28')](handleError(_0x3af860,null));};exports[_0x1149('0x54')]=function(_0x590125,_0x5a3393){return db[_0x1149('0x38')][_0x1149('0x54')](_0x590125[_0x1149('0x55')],{})['then'](respondWithResult(_0x5a3393,0xc9))['catch'](handleError(_0x5a3393,null));};exports[_0x1149('0x56')]=function(_0x3da703,_0x151f02){if(_0x3da703[_0x1149('0x55')]['id']){delete _0x3da703['body']['id'];}return db[_0x1149('0x38')]['find']({'where':{'id':_0x3da703[_0x1149('0x50')]['id']}})[_0x1149('0x1d')](handleEntityNotFound(_0x151f02,null))[_0x1149('0x1d')](saveUpdates(_0x3da703['body'],null))['then'](respondWithResult(_0x151f02,null))[_0x1149('0x28')](handleError(_0x151f02,null));};exports[_0x1149('0x57')]=function(_0x57e8c0,_0x252729){return db[_0x1149('0x38')][_0x1149('0x53')]({'where':{'id':_0x57e8c0[_0x1149('0x50')]['id']}})[_0x1149('0x1d')](handleEntityNotFound(_0x252729,null))[_0x1149('0x1d')](removeEntity(_0x252729,null))['catch'](handleError(_0x252729,null));};exports[_0x1149('0x58')]=function(_0x4b4c3b,_0x24bdd7,_0x2f25e9){var _0x18f58d={};var _0x48ea45={};var _0x5d68cf;var _0x582ff6;return db[_0x1149('0x38')][_0x1149('0x59')]({'where':{'id':_0x4b4c3b['params']['id']}})[_0x1149('0x1d')](handleEntityNotFound(_0x24bdd7,null))[_0x1149('0x1d')](function(_0x2bbd63){if(_0x2bbd63){_0x5d68cf=_0x2bbd63;_0x48ea45[_0x1149('0x42')]=_[_0x1149('0x3d')](db[_0x1149('0x5a')][_0x1149('0x39')]);_0x48ea45['query']=_[_0x1149('0x3d')](_0x4b4c3b[_0x1149('0x3c')]);_0x48ea45[_0x1149('0x51')]=_[_0x1149('0x3f')](_0x48ea45[_0x1149('0x42')],_0x48ea45[_0x1149('0x3c')]);_0x18f58d['attributes']=_[_0x1149('0x3f')](_0x48ea45[_0x1149('0x42')],qs[_0x1149('0x40')](_0x4b4c3b[_0x1149('0x3c')][_0x1149('0x40')]));_0x18f58d[_0x1149('0x3e')]=_0x18f58d[_0x1149('0x3e')]['length']?_0x18f58d[_0x1149('0x3e')]:_0x48ea45[_0x1149('0x42')];_0x18f58d[_0x1149('0x44')]=qs[_0x1149('0x45')](_0x4b4c3b['query']['sort']);_0x18f58d[_0x1149('0x47')]=qs[_0x1149('0x51')](_['pick'](_0x4b4c3b['query'],_0x48ea45[_0x1149('0x51')]));if(_0x4b4c3b['query'][_0x1149('0x49')]){_0x18f58d[_0x1149('0x47')]=_[_0x1149('0x4a')](_0x18f58d[_0x1149('0x47')],{'$or':_[_0x1149('0x37')](_0x18f58d['attributes'],function(_0x2fe91b){var _0x2bc271={};_0x2bc271[_0x2fe91b]={'$like':'%'+_0x4b4c3b[_0x1149('0x3c')][_0x1149('0x49')]+'%'};return _0x2bc271;})});}_0x18f58d=_[_0x1149('0x4a')]({},_0x18f58d,_0x4b4c3b[_0x1149('0x4b')]);return _0x5d68cf[_0x1149('0x58')](_0x18f58d);}})[_0x1149('0x1d')](function(_0x35ed40){if(_0x35ed40){_0x582ff6=_0x35ed40[_0x1149('0x41')];if(!_0x4b4c3b[_0x1149('0x3c')][_0x1149('0x5b')](_0x1149('0x5c'))){_0x18f58d['limit']=qs[_0x1149('0x43')](_0x4b4c3b[_0x1149('0x3c')][_0x1149('0x43')]);_0x18f58d[_0x1149('0x2e')]=qs[_0x1149('0x2e')](_0x4b4c3b[_0x1149('0x3c')]['offset']);}return _0x5d68cf[_0x1149('0x58')](_0x18f58d);}})[_0x1149('0x1d')](function(_0x55be85){if(_0x55be85){return _0x55be85?{'count':_0x582ff6,'rows':_0x55be85}:null;}})[_0x1149('0x1d')](respondWithResult(_0x24bdd7,null))[_0x1149('0x28')](handleError(_0x24bdd7,null));};exports['getSubjects']=function(_0x1920af,_0x3d8038,_0x4adc8e){var _0x5e9412={};var _0x2478a7={};var _0x435fde;var _0x406d00;return db[_0x1149('0x38')]['findOne']({'where':{'id':_0x1920af['params']['id']}})[_0x1149('0x1d')](handleEntityNotFound(_0x3d8038,null))[_0x1149('0x1d')](function(_0x45d055){if(_0x45d055){_0x435fde=_0x45d055;_0x2478a7[_0x1149('0x42')]=_[_0x1149('0x3d')](db[_0x1149('0x5a')][_0x1149('0x39')]);_0x2478a7[_0x1149('0x3c')]=_[_0x1149('0x3d')](_0x1920af['query']);_0x2478a7[_0x1149('0x51')]=_[_0x1149('0x3f')](_0x2478a7['model'],_0x2478a7['query']);_0x5e9412['attributes']=_[_0x1149('0x3f')](_0x2478a7[_0x1149('0x42')],qs['fields'](_0x1920af[_0x1149('0x3c')]['fields']));_0x5e9412[_0x1149('0x3e')]=_0x5e9412[_0x1149('0x3e')][_0x1149('0x41')]?_0x5e9412[_0x1149('0x3e')]:_0x2478a7[_0x1149('0x42')];_0x5e9412[_0x1149('0x44')]=qs[_0x1149('0x45')](_0x1920af[_0x1149('0x3c')][_0x1149('0x45')]);_0x5e9412[_0x1149('0x47')]=qs[_0x1149('0x51')](_[_0x1149('0x46')](_0x1920af['query'],_0x2478a7[_0x1149('0x51')]));if(_0x1920af[_0x1149('0x3c')][_0x1149('0x49')]){_0x5e9412[_0x1149('0x47')]=_[_0x1149('0x4a')](_0x5e9412[_0x1149('0x47')],{'$or':_['map'](_0x5e9412[_0x1149('0x3e')],function(_0x114eab){var _0x2ad825={};_0x2ad825[_0x114eab]={'$like':'%'+_0x1920af['query'][_0x1149('0x49')]+'%'};return _0x2ad825;})});}_0x5e9412=_[_0x1149('0x4a')]({},_0x5e9412,_0x1920af['options']);return _0x435fde['getSubjects'](_0x5e9412);}})[_0x1149('0x1d')](function(_0x3bd161){if(_0x3bd161){_0x406d00=_0x3bd161['length'];if(!_0x1920af[_0x1149('0x3c')][_0x1149('0x5b')](_0x1149('0x5c'))){_0x5e9412[_0x1149('0x43')]=qs['limit'](_0x1920af[_0x1149('0x3c')][_0x1149('0x43')]);_0x5e9412[_0x1149('0x2e')]=qs[_0x1149('0x2e')](_0x1920af['query'][_0x1149('0x2e')]);}return _0x435fde['getSubjects'](_0x5e9412);}})['then'](function(_0x134ef1){if(_0x134ef1){return _0x134ef1?{'count':_0x406d00,'rows':_0x134ef1}:null;}})[_0x1149('0x1d')](respondWithResult(_0x3d8038,null))['catch'](handleError(_0x3d8038,null));};exports['getDescriptions']=function(_0x310851,_0x18e7cf,_0x910faa){var _0x59a125={};var _0x1290f0={};var _0x5e0c09;var _0x5040ed;return db[_0x1149('0x38')]['findOne']({'where':{'id':_0x310851[_0x1149('0x50')]['id']}})[_0x1149('0x1d')](handleEntityNotFound(_0x18e7cf,null))['then'](function(_0x3e041d){if(_0x3e041d){_0x5e0c09=_0x3e041d;_0x1290f0[_0x1149('0x42')]=_['keys'](db[_0x1149('0x5a')]['rawAttributes']);_0x1290f0[_0x1149('0x3c')]=_['keys'](_0x310851['query']);_0x1290f0[_0x1149('0x51')]=_[_0x1149('0x3f')](_0x1290f0[_0x1149('0x42')],_0x1290f0[_0x1149('0x3c')]);_0x59a125[_0x1149('0x3e')]=_[_0x1149('0x3f')](_0x1290f0[_0x1149('0x42')],qs[_0x1149('0x40')](_0x310851[_0x1149('0x3c')][_0x1149('0x40')]));_0x59a125[_0x1149('0x3e')]=_0x59a125[_0x1149('0x3e')][_0x1149('0x41')]?_0x59a125['attributes']:_0x1290f0[_0x1149('0x42')];_0x59a125['order']=qs[_0x1149('0x45')](_0x310851[_0x1149('0x3c')][_0x1149('0x45')]);_0x59a125[_0x1149('0x47')]=qs[_0x1149('0x51')](_[_0x1149('0x46')](_0x310851['query'],_0x1290f0[_0x1149('0x51')]));if(_0x310851[_0x1149('0x3c')]['filter']){_0x59a125[_0x1149('0x47')]=_['merge'](_0x59a125['where'],{'$or':_[_0x1149('0x37')](_0x59a125[_0x1149('0x3e')],function(_0x302386){var _0x5bfbff={};_0x5bfbff[_0x302386]={'$like':'%'+_0x310851[_0x1149('0x3c')][_0x1149('0x49')]+'%'};return _0x5bfbff;})});}_0x59a125=_[_0x1149('0x4a')]({},_0x59a125,_0x310851[_0x1149('0x4b')]);return _0x5e0c09[_0x1149('0x5d')](_0x59a125);}})['then'](function(_0x5dfda8){if(_0x5dfda8){_0x5040ed=_0x5dfda8[_0x1149('0x41')];if(!_0x310851['query'][_0x1149('0x5b')]('nolimit')){_0x59a125['limit']=qs[_0x1149('0x43')](_0x310851[_0x1149('0x3c')]['limit']);_0x59a125[_0x1149('0x2e')]=qs['offset'](_0x310851[_0x1149('0x3c')][_0x1149('0x2e')]);}return _0x5e0c09[_0x1149('0x5d')](_0x59a125);}})[_0x1149('0x1d')](function(_0x29b0dc){if(_0x29b0dc){return _0x29b0dc?{'count':_0x5040ed,'rows':_0x29b0dc}:null;}})[_0x1149('0x1d')](respondWithResult(_0x18e7cf,null))['catch'](handleError(_0x18e7cf,null));};exports[_0x1149('0x5e')]=function(_0x4eeacd,_0x41a12c,_0x2db1ac){var _0x5a43a3={};var _0x37515c={};var _0x2c33af;var _0xc43278;return db[_0x1149('0x38')][_0x1149('0x59')]({'where':{'id':_0x4eeacd['params']['id']}})[_0x1149('0x1d')](handleEntityNotFound(_0x41a12c,null))['then'](function(_0x3e9191){if(_0x3e9191){_0x2c33af=_0x3e9191;_0x37515c[_0x1149('0x42')]=_['keys'](db[_0x1149('0x5f')][_0x1149('0x39')]);_0x37515c[_0x1149('0x3c')]=_[_0x1149('0x3d')](_0x4eeacd[_0x1149('0x3c')]);_0x37515c[_0x1149('0x51')]=_['intersection'](_0x37515c['model'],_0x37515c[_0x1149('0x3c')]);_0x5a43a3[_0x1149('0x3e')]=_[_0x1149('0x3f')](_0x37515c[_0x1149('0x42')],qs[_0x1149('0x40')](_0x4eeacd[_0x1149('0x3c')][_0x1149('0x40')]));_0x5a43a3[_0x1149('0x3e')]=_0x5a43a3[_0x1149('0x3e')][_0x1149('0x41')]?_0x5a43a3[_0x1149('0x3e')]:_0x37515c['model'];_0x5a43a3[_0x1149('0x44')]=qs[_0x1149('0x45')](_0x4eeacd[_0x1149('0x3c')][_0x1149('0x45')]);_0x5a43a3[_0x1149('0x47')]=qs[_0x1149('0x51')](_[_0x1149('0x46')](_0x4eeacd[_0x1149('0x3c')],_0x37515c[_0x1149('0x51')]));if(_0x4eeacd[_0x1149('0x3c')][_0x1149('0x49')]){_0x5a43a3['where']=_[_0x1149('0x4a')](_0x5a43a3[_0x1149('0x47')],{'$or':_['map'](_0x5a43a3[_0x1149('0x3e')],function(_0x41ae41){var _0x4a40e0={};_0x4a40e0[_0x41ae41]={'$like':'%'+_0x4eeacd[_0x1149('0x3c')][_0x1149('0x49')]+'%'};return _0x4a40e0;})});}_0x5a43a3=_['merge']({},_0x5a43a3,_0x4eeacd[_0x1149('0x4b')]);return _0x2c33af['getTags'](_0x5a43a3);}})[_0x1149('0x1d')](function(_0x49de52){if(_0x49de52){_0xc43278=_0x49de52[_0x1149('0x41')];if(!_0x4eeacd[_0x1149('0x3c')]['hasOwnProperty'](_0x1149('0x5c'))){_0x5a43a3[_0x1149('0x43')]=qs[_0x1149('0x43')](_0x4eeacd[_0x1149('0x3c')][_0x1149('0x43')]);_0x5a43a3[_0x1149('0x2e')]=qs['offset'](_0x4eeacd[_0x1149('0x3c')]['offset']);}return _0x2c33af[_0x1149('0x5e')](_0x5a43a3);}})[_0x1149('0x1d')](function(_0x1220cc){if(_0x1220cc){return _0x1220cc?{'count':_0xc43278,'rows':_0x1220cc}:null;}})[_0x1149('0x1d')](respondWithResult(_0x41a12c,null))[_0x1149('0x28')](handleError(_0x41a12c,null));};exports[_0x1149('0x60')]=function(_0x1cb17e,_0x32328b,_0x4899f0){if(_0x1cb17e[_0x1149('0x55')]['id']){delete _0x1cb17e[_0x1149('0x55')]['id'];}return db[_0x1149('0x38')][_0x1149('0x59')]({'where':{'id':_0x1cb17e[_0x1149('0x50')]['id']}})[_0x1149('0x1d')](handleEntityNotFound(_0x32328b,null))[_0x1149('0x1d')](function(_0xe627be){if(_0xe627be){return _0xe627be[_0x1149('0x60')](_0x1cb17e[_0x1149('0x55')][_0x1149('0x61')]||[]);}return null;})[_0x1149('0x1d')](respondWithResult(_0x32328b,null))[_0x1149('0x28')](handleError(_0x32328b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index 9309b36..a35f665 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 _0x59bb=['FreshdeskConfiguration','int_freshdesk_configurations','lodash','bluebird','request-promise','path','exports','define'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x59bb,0x172));var _0xb59b=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x59bb[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0xb59b('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xb59b('0x1'));var rp=require(_0xb59b('0x2'));var fs=require('fs');var path=require(_0xb59b('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intFreshdeskConfiguration.attributes');module[_0xb59b('0x4')]=function(_0x2f4d12,_0x57ee1d){return _0x2f4d12[_0xb59b('0x5')](_0xb59b('0x6'),attributes,{'tableName':_0xb59b('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1350=['path','rimraf','../../config/environment','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1350,0x6b));var _0x0135=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1350[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0135('0x0'));var util=require(_0x0135('0x1'));var logger=require(_0x0135('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0135('0x3'));var rimraf=require(_0x0135('0x4'));var config=require(_0x0135('0x5'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x0135('0x6')]=function(_0x5c407d,_0x19eee0){return _0x5c407d[_0x0135('0x7')](_0x0135('0x8'),attributes,{'tableName':_0x0135('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index b4f3ada..4113f0f 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 _0x6988=['message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dcb2e,_0x81b33f){var _0x158dcf=function(_0x5ae9e8){while(--_0x5ae9e8){_0x3dcb2e['push'](_0x3dcb2e['shift']());}};_0x158dcf(++_0x81b33f);}(_0x6988,0x6b));var _0x8698=function(_0x88da2a,_0x27a954){_0x88da2a=_0x88da2a-0x0;var _0x2e8a58=_0x6988[_0x88da2a];return _0x2e8a58;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8698('0x0'));var rs=require(_0x8698('0x1'));var fs=require('fs');var Redis=require(_0x8698('0x2'));var db=require(_0x8698('0x3'))['db'];var utils=require(_0x8698('0x4'));var logger=require('../../config/logger')(_0x8698('0x5'));var config=require(_0x8698('0x6'));var jayson=require(_0x8698('0x7'));var client=jayson[_0x8698('0x8')][_0x8698('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ad83c,_0x54b6af,_0x2a1713){return new BPromise(function(_0x32f178,_0x66288c){return client[_0x8698('0xa')](_0x4ad83c,_0x2a1713)[_0x8698('0xb')](function(_0x325e68){logger[_0x8698('0xc')](_0x8698('0xd'),_0x54b6af,_0x8698('0xe'));logger['debug'](_0x8698('0xf'),_0x54b6af,_0x8698('0xe'),JSON[_0x8698('0x10')](_0x325e68));if(_0x325e68['error']){if(_0x325e68[_0x8698('0x11')][_0x8698('0x12')]===0x1f4){logger[_0x8698('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x54b6af,_0x325e68['error'][_0x8698('0x13')]);return _0x66288c(_0x325e68[_0x8698('0x11')]['message']);}logger[_0x8698('0x11')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x54b6af,_0x325e68['error']['message']);return _0x32f178(_0x325e68[_0x8698('0x11')][_0x8698('0x13')]);}else{logger[_0x8698('0xc')](_0x8698('0xd'),_0x54b6af,_0x8698('0xe'));_0x32f178(_0x325e68['result'][_0x8698('0x13')]);}})[_0x8698('0x14')](function(_0x380cf8){logger[_0x8698('0x11')](_0x8698('0xd'),_0x54b6af,_0x380cf8);_0x66288c(_0x380cf8);});});} \ No newline at end of file +var _0x1f00=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0xbcb781,_0x576f4b){var _0x459216=function(_0x4ae49c){while(--_0x4ae49c){_0xbcb781['push'](_0xbcb781['shift']());}};_0x459216(++_0x576f4b);}(_0x1f00,0xe9));var _0x01f0=function(_0x88073,_0x4641be){_0x88073=_0x88073-0x0;var _0x272135=_0x1f00[_0x88073];return _0x272135;};'use strict';var _=require(_0x01f0('0x0'));var util=require(_0x01f0('0x1'));var moment=require(_0x01f0('0x2'));var BPromise=require(_0x01f0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x01f0('0x4'))['db'];var utils=require(_0x01f0('0x5'));var logger=require('../../config/logger')(_0x01f0('0x6'));var config=require(_0x01f0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x01f0('0x8')][_0x01f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2ed20b,_0x388649,_0x106bfa){return new BPromise(function(_0x2b48fa,_0x53934b){return client[_0x01f0('0xa')](_0x2ed20b,_0x106bfa)[_0x01f0('0xb')](function(_0x1bdf7a){logger[_0x01f0('0xc')](_0x01f0('0xd'),_0x388649,_0x01f0('0xe'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x388649,_0x01f0('0xe'),JSON[_0x01f0('0xf')](_0x1bdf7a));if(_0x1bdf7a[_0x01f0('0x10')]){if(_0x1bdf7a[_0x01f0('0x10')][_0x01f0('0x11')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x388649,_0x1bdf7a['error'][_0x01f0('0x12')]);return _0x53934b(_0x1bdf7a[_0x01f0('0x10')][_0x01f0('0x12')]);}logger[_0x01f0('0x10')](_0x01f0('0xd'),_0x388649,_0x1bdf7a['error']['message']);return _0x2b48fa(_0x1bdf7a[_0x01f0('0x10')][_0x01f0('0x12')]);}else{logger[_0x01f0('0xc')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x388649,_0x01f0('0xe'));_0x2b48fa(_0x1bdf7a[_0x01f0('0x13')][_0x01f0('0x12')]);}})[_0x01f0('0x14')](function(_0x25dc91){logger[_0x01f0('0x10')](_0x01f0('0xd'),_0x388649,_0x25dc91);_0x53934b(_0x25dc91);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index cb89e15..30ba54b 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x485b5a,_0x2b289b){var _0xd2b34d=function(_0x34dcbd){while(--_0x34dcbd){_0x485b5a['push'](_0x485b5a['shift']());}};_0xd2b34d(++_0x2b289b);}(_0x34e8,0x12c));var _0x834e=function(_0x5918f0,_0x401a67){_0x5918f0=_0x5918f0-0x0;var _0x48c1c0=_0x34e8[_0x5918f0];return _0x48c1c0;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x33c603,_0x6d0ce4){var _0xae96f4=function(_0x2679f8){while(--_0x2679f8){_0x33c603['push'](_0x33c603['shift']());}};_0xae96f4(++_0x6d0ce4);}(_0x34e8,0x12c));var _0x834e=function(_0x4a5c74,_0x45ca08){_0x4a5c74=_0x4a5c74-0x0;var _0xeceead=_0x34e8[_0x4a5c74];return _0xeceead;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index bff8909..c929920 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 _0x4a9c=['variable','customVariable','STRING','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x4a9c,0xcc));var _0xc4a9=function(_0x200ccd,_0x38366c){_0x200ccd=_0x200ccd-0x0;var _0x2b6b18=_0x4a9c[_0x200ccd];return _0x2b6b18;};'use strict';var Sequelize=require(_0xc4a9('0x0'));module[_0xc4a9('0x1')]={'type':{'type':Sequelize[_0xc4a9('0x2')](_0xc4a9('0x3'),_0xc4a9('0x4'),_0xc4a9('0x5'),'keyValue'),'defaultValue':_0xc4a9('0x3')},'content':{'type':Sequelize[_0xc4a9('0x6')]},'key':{'type':Sequelize[_0xc4a9('0x6')]},'keyType':{'type':Sequelize['ENUM']('string',_0xc4a9('0x4'),_0xc4a9('0x5'))},'keyContent':{'type':Sequelize[_0xc4a9('0x6')]},'idField':{'type':Sequelize[_0xc4a9('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xc4a9('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0560=['customVariable','BOOLEAN','sequelize','ENUM','string','STRING','variable'];(function(_0x36b9b2,_0x18e1e4){var _0x50943b=function(_0x4c23db){while(--_0x4c23db){_0x36b9b2['push'](_0x36b9b2['shift']());}};_0x50943b(++_0x18e1e4);}(_0x0560,0x95));var _0x0056=function(_0x571611,_0x4706ca){_0x571611=_0x571611-0x0;var _0x5cf498=_0x0560[_0x571611];return _0x5cf498;};'use strict';var Sequelize=require(_0x0056('0x0'));module['exports']={'type':{'type':Sequelize[_0x0056('0x1')](_0x0056('0x2'),'variable','customVariable','keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0x0056('0x3')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x0056('0x2'),_0x0056('0x4'),_0x0056('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x0056('0x3')]},'nameField':{'type':Sequelize[_0x0056('0x3')]},'customField':{'type':Sequelize[_0x0056('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0056('0x3')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 23f111d..e57a126 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 _0xffbc=['save','update','then','end','error','name','send','FreshdeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject'];(function(_0x4ea321,_0x19c067){var _0x155651=function(_0x33ff98){while(--_0x33ff98){_0x4ea321['push'](_0x4ea321['shift']());}};_0x155651(++_0x19c067);}(_0xffbc,0xb2));var _0xcffb=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0xffbc[_0x15bc81];return _0x59440e;};'use strict';var pdf=require(_0xcffb('0x0'));var emlformat=require(_0xcffb('0x1'));var rimraf=require(_0xcffb('0x2'));var zipdir=require(_0xcffb('0x3'));var jsonpatch=require(_0xcffb('0x4'));var rp=require(_0xcffb('0x5'));var moment=require(_0xcffb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xcffb('0x7'));var util=require(_0xcffb('0x8'));var path=require('path');var sox=require(_0xcffb('0x9'));var csv=require(_0xcffb('0xa'));var ejs=require(_0xcffb('0xb'));var fs=require('fs');var _=require(_0xcffb('0xc'));var squel=require(_0xcffb('0xd'));var crypto=require(_0xcffb('0xe'));var jsforce=require(_0xcffb('0xf'));var deskjs=require(_0xcffb('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xcffb('0x11'));var Redis=require('ioredis');var authService=require(_0xcffb('0x12'));var qs=require(_0xcffb('0x13'));var as=require(_0xcffb('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xcffb('0x15'));var utils=require('../../config/utils');var config=require(_0xcffb('0x16'));var db=require(_0xcffb('0x17'))['db'];function respondWithStatusCode(_0x261c05,_0x4e6993){_0x4e6993=_0x4e6993||0xcc;return function(_0x11b5a1){if(_0x11b5a1){return _0x261c05[_0xcffb('0x18')](_0x4e6993);}return _0x261c05[_0xcffb('0x19')](_0x4e6993)['end']();};}function respondWithResult(_0x1f34fd,_0x325869){_0x325869=_0x325869||0xc8;return function(_0x3da431){if(_0x3da431){return _0x1f34fd[_0xcffb('0x19')](_0x325869)[_0xcffb('0x1a')](_0x3da431);}};}function respondWithFilteredResult(_0x321ede,_0xea0d82){return function(_0x5727de){if(_0x5727de){var _0x69f924=_0x5727de['count'],_0x2c67f8=_0xea0d82[_0xcffb('0x1b')],_0xda0cfc=_0xea0d82[_0xcffb('0x1b')]+_0xea0d82[_0xcffb('0x1c')],_0x2a6f66;if(_0xda0cfc>=_0x69f924){_0xda0cfc=_0x69f924;_0x2a6f66=0xc8;}else{_0x2a6f66=0xce;}_0x321ede[_0xcffb('0x19')](_0x2a6f66);return _0x321ede['set'](_0xcffb('0x1d'),_0x2c67f8+'-'+_0xda0cfc+'/'+_0x69f924)[_0xcffb('0x1a')](_0x5727de);}return null;};}function patchUpdates(_0xdf3302){return function(_0x1efc56){try{jsonpatch[_0xcffb('0x1e')](_0x1efc56,_0xdf3302,!![]);}catch(_0x262de6){return BPromise[_0xcffb('0x1f')](_0x262de6);}return _0x1efc56[_0xcffb('0x20')]();};}function saveUpdates(_0x4fc2b7,_0x54b7cc){return function(_0x4b92a0){if(_0x4b92a0){return _0x4b92a0[_0xcffb('0x21')](_0x4fc2b7)[_0xcffb('0x22')](function(_0x3035d4){return _0x3035d4;});}return null;};}function removeEntity(_0x447ec6,_0x4edd48){return function(_0x1d929c){if(_0x1d929c){return _0x1d929c['destroy']()[_0xcffb('0x22')](function(){_0x447ec6[_0xcffb('0x19')](0xcc)[_0xcffb('0x23')]();});}};}function handleEntityNotFound(_0x1b9cdf,_0x440e27){return function(_0x4605d5){if(!_0x4605d5){_0x1b9cdf[_0xcffb('0x18')](0x194);}return _0x4605d5;};}function handleError(_0x516412,_0xf3f69c){_0xf3f69c=_0xf3f69c||0x1f4;return function(_0x1a8d33){logger[_0xcffb('0x24')](_0x1a8d33['stack']);if(_0x1a8d33[_0xcffb('0x25')]){delete _0x1a8d33[_0xcffb('0x25')];}_0x516412['status'](_0xf3f69c)[_0xcffb('0x26')](_0x1a8d33);};}exports['index']=function(_0xe16f80,_0x2c67bc){var _0x55d748={},_0x208209={},_0x3aaae3={'count':0x0,'rows':[]};var _0x550c09=_['map'](db[_0xcffb('0x27')]['rawAttributes'],function(_0x2ea96d){return{'name':_0x2ea96d[_0xcffb('0x28')],'type':_0x2ea96d[_0xcffb('0x29')][_0xcffb('0x2a')]};});_0x208209[_0xcffb('0x2b')]=_['map'](_0x550c09,_0xcffb('0x25'));_0x208209[_0xcffb('0x2c')]=_[_0xcffb('0x2d')](_0xe16f80['query']);_0x208209[_0xcffb('0x2e')]=_[_0xcffb('0x2f')](_0x208209[_0xcffb('0x2b')],_0x208209[_0xcffb('0x2c')]);_0x55d748[_0xcffb('0x30')]=_[_0xcffb('0x2f')](_0x208209[_0xcffb('0x2b')],qs[_0xcffb('0x31')](_0xe16f80[_0xcffb('0x2c')][_0xcffb('0x31')]));_0x55d748[_0xcffb('0x30')]=_0x55d748['attributes'][_0xcffb('0x32')]?_0x55d748[_0xcffb('0x30')]:_0x208209[_0xcffb('0x2b')];if(!_0xe16f80[_0xcffb('0x2c')]['hasOwnProperty']('nolimit')){_0x55d748[_0xcffb('0x1c')]=qs[_0xcffb('0x1c')](_0xe16f80[_0xcffb('0x2c')]['limit']);_0x55d748[_0xcffb('0x1b')]=qs['offset'](_0xe16f80['query'][_0xcffb('0x1b')]);}_0x55d748[_0xcffb('0x33')]=qs[_0xcffb('0x34')](_0xe16f80[_0xcffb('0x2c')][_0xcffb('0x34')]);_0x55d748[_0xcffb('0x35')]=qs[_0xcffb('0x2e')](_[_0xcffb('0x36')](_0xe16f80['query'],_0x208209[_0xcffb('0x2e')]));if(_0xe16f80[_0xcffb('0x2c')][_0xcffb('0x37')]){_0x55d748['where']=_[_0xcffb('0x38')](_0x55d748[_0xcffb('0x35')],{'$or':_['map'](_0x550c09,function(_0x508b39){if(_0x508b39[_0xcffb('0x29')]!=='VIRTUAL'){var _0x2d57d5={};_0x2d57d5[_0x508b39[_0xcffb('0x25')]]={'$like':'%'+_0xe16f80[_0xcffb('0x2c')][_0xcffb('0x37')]+'%'};return _0x2d57d5;}})});}_0x55d748=_[_0xcffb('0x38')]({},_0x55d748,_0xe16f80[_0xcffb('0x39')]);var _0x1e243c={'where':_0x55d748[_0xcffb('0x35')]};return db[_0xcffb('0x27')]['count'](_0x1e243c)['then'](function(_0x15d4c0){_0x3aaae3[_0xcffb('0x3a')]=_0x15d4c0;if(_0xe16f80[_0xcffb('0x2c')][_0xcffb('0x3b')]){_0x55d748[_0xcffb('0x3c')]=[{'all':!![]}];}return db[_0xcffb('0x27')]['findAll'](_0x55d748);})[_0xcffb('0x22')](function(_0xe50702){_0x3aaae3[_0xcffb('0x3d')]=_0xe50702;return _0x3aaae3;})[_0xcffb('0x22')](respondWithFilteredResult(_0x2c67bc,_0x55d748))[_0xcffb('0x3e')](handleError(_0x2c67bc,null));};exports[_0xcffb('0x3f')]=function(_0x296665,_0x46bdc4){var _0x838daa={'raw':!![],'where':{'id':_0x296665[_0xcffb('0x40')]['id']}},_0x5072c7={};_0x5072c7[_0xcffb('0x2b')]=_['keys'](db[_0xcffb('0x27')][_0xcffb('0x41')]);_0x5072c7['query']=_[_0xcffb('0x2d')](_0x296665[_0xcffb('0x2c')]);_0x5072c7[_0xcffb('0x2e')]=_[_0xcffb('0x2f')](_0x5072c7[_0xcffb('0x2b')],_0x5072c7[_0xcffb('0x2c')]);_0x838daa[_0xcffb('0x30')]=_['intersection'](_0x5072c7['model'],qs[_0xcffb('0x31')](_0x296665[_0xcffb('0x2c')][_0xcffb('0x31')]));_0x838daa[_0xcffb('0x30')]=_0x838daa['attributes']['length']?_0x838daa[_0xcffb('0x30')]:_0x5072c7[_0xcffb('0x2b')];if(_0x296665[_0xcffb('0x2c')][_0xcffb('0x3b')]){_0x838daa[_0xcffb('0x3c')]=[{'all':!![]}];}_0x838daa=_[_0xcffb('0x38')]({},_0x838daa,_0x296665[_0xcffb('0x39')]);return db[_0xcffb('0x27')][_0xcffb('0x42')](_0x838daa)[_0xcffb('0x22')](handleEntityNotFound(_0x46bdc4,null))[_0xcffb('0x22')](respondWithResult(_0x46bdc4,null))['catch'](handleError(_0x46bdc4,null));};exports[_0xcffb('0x43')]=function(_0x4eb3b4,_0x47813d){return db[_0xcffb('0x27')][_0xcffb('0x43')](_0x4eb3b4['body'],{})[_0xcffb('0x22')](respondWithResult(_0x47813d,0xc9))[_0xcffb('0x3e')](handleError(_0x47813d,null));};exports[_0xcffb('0x21')]=function(_0x42fb0d,_0x30b949){if(_0x42fb0d['body']['id']){delete _0x42fb0d['body']['id'];}return db[_0xcffb('0x27')]['find']({'where':{'id':_0x42fb0d[_0xcffb('0x40')]['id']}})['then'](handleEntityNotFound(_0x30b949,null))['then'](saveUpdates(_0x42fb0d[_0xcffb('0x44')],null))['then'](respondWithResult(_0x30b949,null))['catch'](handleError(_0x30b949,null));};exports[_0xcffb('0x45')]=function(_0x52ec64,_0x421ccd){return db[_0xcffb('0x27')]['find']({'where':{'id':_0x52ec64[_0xcffb('0x40')]['id']}})[_0xcffb('0x22')](handleEntityNotFound(_0x421ccd,null))[_0xcffb('0x22')](removeEntity(_0x421ccd,null))[_0xcffb('0x3e')](handleError(_0x421ccd,null));}; \ No newline at end of file +var _0x7edb=['VIRTUAL','filter','options','includeAll','include','findAll','show','params','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','map','FreshdeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge'];(function(_0x5520c9,_0x1b6f65){var _0x5307e1=function(_0x5ca3ea){while(--_0x5ca3ea){_0x5520c9['push'](_0x5520c9['shift']());}};_0x5307e1(++_0x1b6f65);}(_0x7edb,0x1ce));var _0xb7ed=function(_0x24394f,_0x5629f0){_0x24394f=_0x24394f-0x0;var _0x18af03=_0x7edb[_0x24394f];return _0x18af03;};'use strict';var pdf=require(_0xb7ed('0x0'));var emlformat=require(_0xb7ed('0x1'));var rimraf=require(_0xb7ed('0x2'));var zipdir=require(_0xb7ed('0x3'));var jsonpatch=require(_0xb7ed('0x4'));var rp=require(_0xb7ed('0x5'));var moment=require(_0xb7ed('0x6'));var BPromise=require(_0xb7ed('0x7'));var Mustache=require(_0xb7ed('0x8'));var util=require(_0xb7ed('0x9'));var path=require(_0xb7ed('0xa'));var sox=require(_0xb7ed('0xb'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb7ed('0xc'));var crypto=require(_0xb7ed('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb7ed('0xe'));var toCsv=require('to-csv');var querystring=require(_0xb7ed('0xf'));var Papa=require(_0xb7ed('0x10'));var Redis=require(_0xb7ed('0x11'));var authService=require(_0xb7ed('0x12'));var qs=require(_0xb7ed('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xb7ed('0x14'))('api');var utils=require(_0xb7ed('0x15'));var config=require(_0xb7ed('0x16'));var db=require(_0xb7ed('0x17'))['db'];function respondWithStatusCode(_0x47646c,_0xa52433){_0xa52433=_0xa52433||0xcc;return function(_0x582ca9){if(_0x582ca9){return _0x47646c[_0xb7ed('0x18')](_0xa52433);}return _0x47646c[_0xb7ed('0x19')](_0xa52433)['end']();};}function respondWithResult(_0x560f0d,_0x1a7c09){_0x1a7c09=_0x1a7c09||0xc8;return function(_0x5d21b6){if(_0x5d21b6){return _0x560f0d[_0xb7ed('0x19')](_0x1a7c09)[_0xb7ed('0x1a')](_0x5d21b6);}};}function respondWithFilteredResult(_0x2f755a,_0x33f1d0){return function(_0x322a74){if(_0x322a74){var _0x3a137b=_0x322a74[_0xb7ed('0x1b')],_0x44ab09=_0x33f1d0[_0xb7ed('0x1c')],_0x21006d=_0x33f1d0[_0xb7ed('0x1c')]+_0x33f1d0[_0xb7ed('0x1d')],_0x23fd4d;if(_0x21006d>=_0x3a137b){_0x21006d=_0x3a137b;_0x23fd4d=0xc8;}else{_0x23fd4d=0xce;}_0x2f755a[_0xb7ed('0x19')](_0x23fd4d);return _0x2f755a[_0xb7ed('0x1e')](_0xb7ed('0x1f'),_0x44ab09+'-'+_0x21006d+'/'+_0x3a137b)[_0xb7ed('0x1a')](_0x322a74);}return null;};}function patchUpdates(_0x1c61a9){return function(_0x36dd71){try{jsonpatch[_0xb7ed('0x20')](_0x36dd71,_0x1c61a9,!![]);}catch(_0x1daf2a){return BPromise[_0xb7ed('0x21')](_0x1daf2a);}return _0x36dd71[_0xb7ed('0x22')]();};}function saveUpdates(_0x5252f8,_0x28e1c2){return function(_0x44d1b7){if(_0x44d1b7){return _0x44d1b7[_0xb7ed('0x23')](_0x5252f8)[_0xb7ed('0x24')](function(_0x564525){return _0x564525;});}return null;};}function removeEntity(_0x5bba8c,_0x2bb596){return function(_0x2177ce){if(_0x2177ce){return _0x2177ce[_0xb7ed('0x25')]()['then'](function(){_0x5bba8c[_0xb7ed('0x19')](0xcc)[_0xb7ed('0x26')]();});}};}function handleEntityNotFound(_0x30d57d,_0x1a3337){return function(_0x1fcba5){if(!_0x1fcba5){_0x30d57d[_0xb7ed('0x18')](0x194);}return _0x1fcba5;};}function handleError(_0x59d81d,_0xadd2e3){_0xadd2e3=_0xadd2e3||0x1f4;return function(_0x1d4b00){logger[_0xb7ed('0x27')](_0x1d4b00[_0xb7ed('0x28')]);if(_0x1d4b00['name']){delete _0x1d4b00[_0xb7ed('0x29')];}_0x59d81d[_0xb7ed('0x19')](_0xadd2e3)['send'](_0x1d4b00);};}exports['index']=function(_0x4b9f7f,_0x419c21){var _0x579b91={},_0x4bfe75={},_0x1c8830={'count':0x0,'rows':[]};var _0x4fca62=_[_0xb7ed('0x2a')](db[_0xb7ed('0x2b')][_0xb7ed('0x2c')],function(_0x53a8f6){return{'name':_0x53a8f6[_0xb7ed('0x2d')],'type':_0x53a8f6[_0xb7ed('0x2e')][_0xb7ed('0x2f')]};});_0x4bfe75[_0xb7ed('0x30')]=_[_0xb7ed('0x2a')](_0x4fca62,_0xb7ed('0x29'));_0x4bfe75['query']=_[_0xb7ed('0x31')](_0x4b9f7f[_0xb7ed('0x32')]);_0x4bfe75[_0xb7ed('0x33')]=_[_0xb7ed('0x34')](_0x4bfe75[_0xb7ed('0x30')],_0x4bfe75[_0xb7ed('0x32')]);_0x579b91[_0xb7ed('0x35')]=_[_0xb7ed('0x34')](_0x4bfe75[_0xb7ed('0x30')],qs[_0xb7ed('0x36')](_0x4b9f7f[_0xb7ed('0x32')][_0xb7ed('0x36')]));_0x579b91['attributes']=_0x579b91[_0xb7ed('0x35')][_0xb7ed('0x37')]?_0x579b91[_0xb7ed('0x35')]:_0x4bfe75[_0xb7ed('0x30')];if(!_0x4b9f7f[_0xb7ed('0x32')][_0xb7ed('0x38')](_0xb7ed('0x39'))){_0x579b91['limit']=qs['limit'](_0x4b9f7f[_0xb7ed('0x32')][_0xb7ed('0x1d')]);_0x579b91[_0xb7ed('0x1c')]=qs[_0xb7ed('0x1c')](_0x4b9f7f[_0xb7ed('0x32')]['offset']);}_0x579b91[_0xb7ed('0x3a')]=qs[_0xb7ed('0x3b')](_0x4b9f7f[_0xb7ed('0x32')][_0xb7ed('0x3b')]);_0x579b91['where']=qs[_0xb7ed('0x33')](_[_0xb7ed('0x3c')](_0x4b9f7f[_0xb7ed('0x32')],_0x4bfe75[_0xb7ed('0x33')]));if(_0x4b9f7f[_0xb7ed('0x32')]['filter']){_0x579b91[_0xb7ed('0x3d')]=_[_0xb7ed('0x3e')](_0x579b91['where'],{'$or':_[_0xb7ed('0x2a')](_0x4fca62,function(_0x4f8b4f){if(_0x4f8b4f[_0xb7ed('0x2e')]!==_0xb7ed('0x3f')){var _0x122e47={};_0x122e47[_0x4f8b4f[_0xb7ed('0x29')]]={'$like':'%'+_0x4b9f7f[_0xb7ed('0x32')][_0xb7ed('0x40')]+'%'};return _0x122e47;}})});}_0x579b91=_[_0xb7ed('0x3e')]({},_0x579b91,_0x4b9f7f[_0xb7ed('0x41')]);var _0x17a201={'where':_0x579b91['where']};return db[_0xb7ed('0x2b')][_0xb7ed('0x1b')](_0x17a201)[_0xb7ed('0x24')](function(_0x382a73){_0x1c8830[_0xb7ed('0x1b')]=_0x382a73;if(_0x4b9f7f[_0xb7ed('0x32')][_0xb7ed('0x42')]){_0x579b91[_0xb7ed('0x43')]=[{'all':!![]}];}return db[_0xb7ed('0x2b')][_0xb7ed('0x44')](_0x579b91);})['then'](function(_0x2f07dd){_0x1c8830['rows']=_0x2f07dd;return _0x1c8830;})['then'](respondWithFilteredResult(_0x419c21,_0x579b91))['catch'](handleError(_0x419c21,null));};exports[_0xb7ed('0x45')]=function(_0xcd460c,_0x51b5f5){var _0x56e2d7={'raw':!![],'where':{'id':_0xcd460c[_0xb7ed('0x46')]['id']}},_0x23b0a8={};_0x23b0a8['model']=_['keys'](db['FreshdeskField'][_0xb7ed('0x2c')]);_0x23b0a8['query']=_[_0xb7ed('0x31')](_0xcd460c[_0xb7ed('0x32')]);_0x23b0a8['filters']=_['intersection'](_0x23b0a8[_0xb7ed('0x30')],_0x23b0a8[_0xb7ed('0x32')]);_0x56e2d7[_0xb7ed('0x35')]=_[_0xb7ed('0x34')](_0x23b0a8[_0xb7ed('0x30')],qs[_0xb7ed('0x36')](_0xcd460c['query']['fields']));_0x56e2d7['attributes']=_0x56e2d7[_0xb7ed('0x35')][_0xb7ed('0x37')]?_0x56e2d7[_0xb7ed('0x35')]:_0x23b0a8['model'];if(_0xcd460c[_0xb7ed('0x32')][_0xb7ed('0x42')]){_0x56e2d7['include']=[{'all':!![]}];}_0x56e2d7=_[_0xb7ed('0x3e')]({},_0x56e2d7,_0xcd460c[_0xb7ed('0x41')]);return db[_0xb7ed('0x2b')][_0xb7ed('0x47')](_0x56e2d7)[_0xb7ed('0x24')](handleEntityNotFound(_0x51b5f5,null))[_0xb7ed('0x24')](respondWithResult(_0x51b5f5,null))[_0xb7ed('0x48')](handleError(_0x51b5f5,null));};exports[_0xb7ed('0x49')]=function(_0x2c9deb,_0x2212b4){return db[_0xb7ed('0x2b')][_0xb7ed('0x49')](_0x2c9deb[_0xb7ed('0x4a')],{})[_0xb7ed('0x24')](respondWithResult(_0x2212b4,0xc9))[_0xb7ed('0x48')](handleError(_0x2212b4,null));};exports[_0xb7ed('0x23')]=function(_0x1a5e7b,_0x259001){if(_0x1a5e7b[_0xb7ed('0x4a')]['id']){delete _0x1a5e7b[_0xb7ed('0x4a')]['id'];}return db[_0xb7ed('0x2b')][_0xb7ed('0x47')]({'where':{'id':_0x1a5e7b[_0xb7ed('0x46')]['id']}})[_0xb7ed('0x24')](handleEntityNotFound(_0x259001,null))[_0xb7ed('0x24')](saveUpdates(_0x1a5e7b[_0xb7ed('0x4a')],null))['then'](respondWithResult(_0x259001,null))[_0xb7ed('0x48')](handleError(_0x259001,null));};exports['destroy']=function(_0x14e8b6,_0x25782b){return db[_0xb7ed('0x2b')][_0xb7ed('0x47')]({'where':{'id':_0x14e8b6[_0xb7ed('0x46')]['id']}})[_0xb7ed('0x24')](handleEntityNotFound(_0x25782b,null))[_0xb7ed('0x24')](removeEntity(_0x25782b,null))['catch'](handleError(_0x25782b,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index d605878..768083a 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 _0xbd3d=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField'];(function(_0x14c3ec,_0x14f7ce){var _0x9fe6d3=function(_0x11a7f7){while(--_0x11a7f7){_0x14c3ec['push'](_0x14c3ec['shift']());}};_0x9fe6d3(++_0x14f7ce);}(_0xbd3d,0x78));var _0xdbd3=function(_0x54b852,_0x164e55){_0x54b852=_0x54b852-0x0;var _0x3656a3=_0xbd3d[_0x54b852];return _0x3656a3;};'use strict';var _=require(_0xdbd3('0x0'));var util=require(_0xdbd3('0x1'));var logger=require(_0xdbd3('0x2'))(_0xdbd3('0x3'));var moment=require(_0xdbd3('0x4'));var BPromise=require(_0xdbd3('0x5'));var rp=require(_0xdbd3('0x6'));var fs=require('fs');var path=require(_0xdbd3('0x7'));var rimraf=require(_0xdbd3('0x8'));var config=require(_0xdbd3('0x9'));var attributes=require('./intFreshdeskField.attributes');module[_0xdbd3('0xa')]=function(_0x5490e2,_0x5a6a10){return _0x5490e2[_0xdbd3('0xb')](_0xdbd3('0xc'),attributes,{'tableName':_0xdbd3('0xd'),'paranoid':![],'indexes':[{'name':_0xdbd3('0xe'),'fields':[_0xdbd3('0xf'),_0xdbd3('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x72d7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x72d7,0xa4));var _0x772d=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x72d7[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0x772d('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x772d('0x1'));var BPromise=require(_0x772d('0x2'));var rp=require(_0x772d('0x3'));var fs=require('fs');var path=require(_0x772d('0x4'));var rimraf=require(_0x772d('0x5'));var config=require(_0x772d('0x6'));var attributes=require(_0x772d('0x7'));module[_0x772d('0x8')]=function(_0xda2367,_0x28c01e){return _0xda2367[_0x772d('0x9')](_0x772d('0xa'),attributes,{'tableName':_0x772d('0xb'),'paranoid':![],'indexes':[{'name':_0x772d('0xc'),'fields':[_0x772d('0xd'),_0x772d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 5de0200..449b646 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(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x7a54,0x106));var _0x47a5=function(_0x577860,_0x3e6940){_0x577860=_0x577860-0x0;var _0x204cc9=_0x7a54[_0x577860];return _0x204cc9;};'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(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7a54,0x106));var _0x47a5=function(_0xbbeeaf,_0xee2e44){_0xbbeeaf=_0xbbeeaf-0x0;var _0x44b28c=_0x7a54[_0xbbeeaf];return _0x44b28c;};'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 bd0a3b0..f5899bf 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 _0x227a=['delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','getConfigurations','getFields','post','create','addConfiguration','update'];(function(_0x55821d,_0x27a22e){var _0x58ea8a=function(_0x5bdd3d){while(--_0x5bdd3d){_0x55821d['push'](_0x55821d['shift']());}};_0x58ea8a(++_0x27a22e);}(_0x227a,0x1b2));var _0xa227=function(_0x23c57e,_0x39e043){_0x23c57e=_0x23c57e-0x0;var _0x191350=_0x227a[_0x23c57e];return _0x191350;};'use strict';var multer=require(_0xa227('0x0'));var util=require(_0xa227('0x1'));var path=require(_0xa227('0x2'));var timeout=require(_0xa227('0x3'));var express=require(_0xa227('0x4'));var router=express[_0xa227('0x5')]();var auth=require(_0xa227('0x6'));var interaction=require(_0xa227('0x7'));var config=require(_0xa227('0x8'));var controller=require(_0xa227('0x9'));router[_0xa227('0xa')]('/',auth['isAuthenticated'](),controller[_0xa227('0xb')]);router[_0xa227('0xa')](_0xa227('0xc'),auth['isAuthenticated'](),controller[_0xa227('0xd')]);router[_0xa227('0xa')](_0xa227('0xe'),auth[_0xa227('0xf')](),controller[_0xa227('0x10')]);router[_0xa227('0xa')]('/:id/fields',auth[_0xa227('0xf')](),controller[_0xa227('0x11')]);router[_0xa227('0x12')]('/',auth[_0xa227('0xf')](),controller[_0xa227('0x13')]);router[_0xa227('0x12')](_0xa227('0xe'),auth[_0xa227('0xf')](),controller[_0xa227('0x14')]);router['put'](_0xa227('0xc'),auth[_0xa227('0xf')](),controller[_0xa227('0x15')]);router[_0xa227('0x16')](_0xa227('0xc'),auth[_0xa227('0xf')](),controller[_0xa227('0x17')]);module['exports']=router; \ No newline at end of file +var _0xe1c3=['path','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','update','delete','destroy','exports','multer','util'];(function(_0x1591d4,_0x4ea3bd){var _0x4c46bb=function(_0x13b7e7){while(--_0x13b7e7){_0x1591d4['push'](_0x1591d4['shift']());}};_0x4c46bb(++_0x4ea3bd);}(_0xe1c3,0x1de));var _0x3e1c=function(_0x3bcc30,_0x18e368){_0x3bcc30=_0x3bcc30-0x0;var _0x55ee77=_0xe1c3[_0x3bcc30];return _0x55ee77;};'use strict';var multer=require(_0x3e1c('0x0'));var util=require(_0x3e1c('0x1'));var path=require(_0x3e1c('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x3e1c('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x3e1c('0x4'));var config=require(_0x3e1c('0x5'));var controller=require('./intSalesforceAccount.controller');router[_0x3e1c('0x6')]('/',auth[_0x3e1c('0x7')](),controller[_0x3e1c('0x8')]);router[_0x3e1c('0x6')](_0x3e1c('0x9'),auth[_0x3e1c('0x7')](),controller['show']);router[_0x3e1c('0x6')](_0x3e1c('0xa'),auth['isAuthenticated'](),controller[_0x3e1c('0xb')]);router['get'](_0x3e1c('0xc'),auth[_0x3e1c('0x7')](),controller['getFields']);router[_0x3e1c('0xd')]('/',auth[_0x3e1c('0x7')](),controller[_0x3e1c('0xe')]);router[_0x3e1c('0xd')](_0x3e1c('0xa'),auth[_0x3e1c('0x7')](),controller[_0x3e1c('0xf')]);router['put'](_0x3e1c('0x9'),auth[_0x3e1c('0x7')](),controller[_0x3e1c('0x10')]);router[_0x3e1c('0x11')](_0x3e1c('0x9'),auth[_0x3e1c('0x7')](),controller[_0x3e1c('0x12')]);module[_0x3e1c('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 84200b4..3c7eb2f 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 _0x326f=['STRING','username','ENUM','newTab','integrationTab','sequelize'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x326f,0xd1));var _0xf326=function(_0x3b1cb3,_0x20d763){_0x3b1cb3=_0x3b1cb3-0x0;var _0x235e74=_0x326f[_0x3b1cb3];return _0x235e74;};'use strict';var Sequelize=require(_0xf326('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf326('0x1')]},'username':{'type':Sequelize[_0xf326('0x1')],'unique':_0xf326('0x2')},'remoteUri':{'type':Sequelize[_0xf326('0x1')]},'password':{'type':Sequelize[_0xf326('0x1')]},'clientId':{'type':Sequelize[_0xf326('0x1')]},'clientSecret':{'type':Sequelize[_0xf326('0x1')]},'securityToken':{'type':Sequelize[_0xf326('0x1')]},'serverUrl':{'type':Sequelize[_0xf326('0x1')]},'type':{'type':Sequelize[_0xf326('0x3')]('integrationTab',_0xf326('0x4')),'defaultValue':_0xf326('0x5')}}; \ No newline at end of file +var _0x1261=['STRING','username','integrationTab','newTab','exports'];(function(_0xdf79a0,_0x5ba2ed){var _0x145390=function(_0x4da834){while(--_0x4da834){_0xdf79a0['push'](_0xdf79a0['shift']());}};_0x145390(++_0x5ba2ed);}(_0x1261,0x144));var _0x1126=function(_0x27f616,_0xf48a6d){_0x27f616=_0x27f616-0x0;var _0x5ebae0=_0x1261[_0x27f616];return _0x5ebae0;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'name':{'type':Sequelize[_0x1126('0x1')]},'description':{'type':Sequelize[_0x1126('0x1')]},'username':{'type':Sequelize[_0x1126('0x1')],'unique':_0x1126('0x2')},'remoteUri':{'type':Sequelize[_0x1126('0x1')]},'password':{'type':Sequelize[_0x1126('0x1')]},'clientId':{'type':Sequelize[_0x1126('0x1')]},'clientSecret':{'type':Sequelize[_0x1126('0x1')]},'securityToken':{'type':Sequelize[_0x1126('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1126('0x3'),_0x1126('0x4')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index de038d9..5d48feb 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 _0x2ef3=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','getConfigurations','findOne','SalesforceConfiguration','sort','AccountId','Subjects','getSubjects','getDescriptions','channel','SalesforceField','getFields','remoteUri','clientId','clientSecret','username','password','slice','substring','Connection','login','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','IsArchived','Priority','Type','Case','Origin','Status','SuppliedName','remove','custom','includes','picklistValues','label','boolean','True','False','false','statusCode','test','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SalesforceAccount,\x20%s,\x20%s','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','stack','name','send','index','map','SalesforceAccount','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','filter'];(function(_0x2995c1,_0x5da11f){var _0x24e773=function(_0x2abe49){while(--_0x2abe49){_0x2995c1['push'](_0x2995c1['shift']());}};_0x24e773(++_0x5da11f);}(_0x2ef3,0xba));var _0x32ef=function(_0x4e493d,_0x3697c7){_0x4e493d=_0x4e493d-0x0;var _0x388ee9=_0x2ef3[_0x4e493d];return _0x388ee9;};'use strict';var pdf=require(_0x32ef('0x0'));var emlformat=require(_0x32ef('0x1'));var rimraf=require(_0x32ef('0x2'));var zipdir=require(_0x32ef('0x3'));var jsonpatch=require(_0x32ef('0x4'));var rp=require(_0x32ef('0x5'));var moment=require('moment');var BPromise=require(_0x32ef('0x6'));var Mustache=require(_0x32ef('0x7'));var util=require('util');var path=require(_0x32ef('0x8'));var sox=require(_0x32ef('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x32ef('0xa'));var squel=require(_0x32ef('0xb'));var crypto=require(_0x32ef('0xc'));var jsforce=require(_0x32ef('0xd'));var deskjs=require(_0x32ef('0xe'));var toCsv=require(_0x32ef('0xf'));var querystring=require(_0x32ef('0x10'));var Papa=require(_0x32ef('0x11'));var Redis=require(_0x32ef('0x12'));var authService=require(_0x32ef('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x32ef('0x14'));var logger=require(_0x32ef('0x15'))(_0x32ef('0x16'));var utils=require(_0x32ef('0x17'));var config=require('../../config/environment');var db=require(_0x32ef('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x32ef('0x19'));var client=jayson['client'][_0x32ef('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1ef1ae,_0x5c3eb9,_0x539d18){if(_0x539d18){var _0x19ce1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x19ce1['test'](_0x5c3eb9)){return _0x1ef1ae;}else{throw new db[(_0x32ef('0x1b'))][(_0x32ef('0x1c'))](_0x32ef('0x1d'));}}else{return _0x1ef1ae;}}function respondWithRpcPromise(_0x54c7f5,_0x57aff1,_0x55bf0b,_0x531e30){return new BPromise(function(_0x13db1a,_0x3950e6){var _0xb5aed2=_0x531e30||client;return _0xb5aed2['request'](_0x54c7f5,_0x55bf0b)['then'](function(_0x1eb468){logger[_0x32ef('0x1e')](_0x32ef('0x1f'),_0x57aff1,'request\x20sent');logger[_0x32ef('0x20')](_0x32ef('0x21'),_0x57aff1,'request\x20sent',JSON[_0x32ef('0x22')](_0x1eb468));if(_0x1eb468[_0x32ef('0x23')]){if(_0x1eb468[_0x32ef('0x23')][_0x32ef('0x24')]===0x1f4){logger[_0x32ef('0x23')](_0x32ef('0x1f'),_0x57aff1,_0x1eb468['error'][_0x32ef('0x25')]);return _0x3950e6(_0x1eb468['error'][_0x32ef('0x25')]);}logger[_0x32ef('0x23')]('SalesforceAccount,\x20%s,\x20%s',_0x57aff1,_0x1eb468[_0x32ef('0x23')][_0x32ef('0x25')]);return _0x13db1a(_0x1eb468[_0x32ef('0x23')]['message']);}else{logger['info'](_0x32ef('0x1f'),_0x57aff1,_0x32ef('0x26'));_0x13db1a(_0x1eb468[_0x32ef('0x27')]['message']);}})['catch'](function(_0x19ea6){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x57aff1,_0x19ea6);_0x3950e6(_0x19ea6);});});}function respondWithStatusCode(_0x278495,_0x14d4b3){_0x14d4b3=_0x14d4b3||0xcc;return function(_0x371540){if(_0x371540){return _0x278495[_0x32ef('0x28')](_0x14d4b3);}return _0x278495[_0x32ef('0x29')](_0x14d4b3)[_0x32ef('0x2a')]();};}function respondWithResult(_0x1874ea,_0x38aed5){_0x38aed5=_0x38aed5||0xc8;return function(_0x338f19){if(_0x338f19){return _0x1874ea[_0x32ef('0x29')](_0x38aed5)[_0x32ef('0x2b')](_0x338f19);}};}function respondWithFilteredResult(_0xba4b3f,_0x5a88a5){return function(_0xd65fde){if(_0xd65fde){var _0x2f5d06=_0xd65fde[_0x32ef('0x2c')],_0x5a04cd=_0x5a88a5[_0x32ef('0x2d')],_0x12de1a=_0x5a88a5['offset']+_0x5a88a5[_0x32ef('0x2e')],_0x3c569d;if(_0x12de1a>=_0x2f5d06){_0x12de1a=_0x2f5d06;_0x3c569d=0xc8;}else{_0x3c569d=0xce;}_0xba4b3f[_0x32ef('0x29')](_0x3c569d);return _0xba4b3f[_0x32ef('0x2f')](_0x32ef('0x30'),_0x5a04cd+'-'+_0x12de1a+'/'+_0x2f5d06)[_0x32ef('0x2b')](_0xd65fde);}return null;};}function patchUpdates(_0x1a6ed2){return function(_0x1a122d){try{jsonpatch['apply'](_0x1a122d,_0x1a6ed2,!![]);}catch(_0x36ac37){return BPromise['reject'](_0x36ac37);}return _0x1a122d[_0x32ef('0x31')]();};}function saveUpdates(_0x2b6c6a,_0x5a9565){return function(_0xcc2efb){if(_0xcc2efb){return _0xcc2efb[_0x32ef('0x32')](_0x2b6c6a)[_0x32ef('0x33')](function(_0x20b467){return _0x20b467;});}return null;};}function removeEntity(_0x120f30,_0x59a4a3){return function(_0x50ecd6){if(_0x50ecd6){return _0x50ecd6[_0x32ef('0x34')]()['then'](function(){_0x120f30[_0x32ef('0x29')](0xcc)[_0x32ef('0x2a')]();});}};}function handleEntityNotFound(_0x2f1349,_0x390670){return function(_0x389583){if(!_0x389583){_0x2f1349[_0x32ef('0x28')](0x194);}return _0x389583;};}function handleError(_0x566b56,_0x482d3a){_0x482d3a=_0x482d3a||0x1f4;return function(_0x484ad7){logger[_0x32ef('0x23')](_0x484ad7[_0x32ef('0x35')]);if(_0x484ad7[_0x32ef('0x36')]){delete _0x484ad7['name'];}_0x566b56['status'](_0x482d3a)[_0x32ef('0x37')](_0x484ad7);};}exports[_0x32ef('0x38')]=function(_0x410334,_0x480348){var _0x4abbd6={},_0xcbdec8={},_0x21706f={'count':0x0,'rows':[]};var _0x3ed1b0=_[_0x32ef('0x39')](db[_0x32ef('0x3a')][_0x32ef('0x3b')],function(_0x3223d5){return{'name':_0x3223d5[_0x32ef('0x3c')],'type':_0x3223d5[_0x32ef('0x3d')]['key']};});_0xcbdec8[_0x32ef('0x3e')]=_[_0x32ef('0x39')](_0x3ed1b0,_0x32ef('0x36'));_0xcbdec8['query']=_[_0x32ef('0x3f')](_0x410334[_0x32ef('0x40')]);_0xcbdec8[_0x32ef('0x41')]=_[_0x32ef('0x42')](_0xcbdec8[_0x32ef('0x3e')],_0xcbdec8[_0x32ef('0x40')]);_0x4abbd6[_0x32ef('0x43')]=_[_0x32ef('0x42')](_0xcbdec8[_0x32ef('0x3e')],qs[_0x32ef('0x44')](_0x410334[_0x32ef('0x40')][_0x32ef('0x44')]));_0x4abbd6['attributes']=_0x4abbd6[_0x32ef('0x43')][_0x32ef('0x45')]?_0x4abbd6[_0x32ef('0x43')]:_0xcbdec8[_0x32ef('0x3e')];if(!_0x410334[_0x32ef('0x40')][_0x32ef('0x46')](_0x32ef('0x47'))){_0x4abbd6['limit']=qs['limit'](_0x410334[_0x32ef('0x40')][_0x32ef('0x2e')]);_0x4abbd6[_0x32ef('0x2d')]=qs[_0x32ef('0x2d')](_0x410334['query'][_0x32ef('0x2d')]);}_0x4abbd6[_0x32ef('0x48')]=qs['sort'](_0x410334[_0x32ef('0x40')]['sort']);_0x4abbd6[_0x32ef('0x49')]=qs[_0x32ef('0x41')](_[_0x32ef('0x4a')](_0x410334[_0x32ef('0x40')],_0xcbdec8[_0x32ef('0x41')]));if(_0x410334[_0x32ef('0x40')][_0x32ef('0x4b')]){_0x4abbd6[_0x32ef('0x49')]=_[_0x32ef('0x4c')](_0x4abbd6[_0x32ef('0x49')],{'$or':_['map'](_0x3ed1b0,function(_0x18b943){if(_0x18b943['type']!==_0x32ef('0x4d')){var _0x33c25b={};_0x33c25b[_0x18b943[_0x32ef('0x36')]]={'$like':'%'+_0x410334['query'][_0x32ef('0x4b')]+'%'};return _0x33c25b;}})});}_0x4abbd6=_[_0x32ef('0x4c')]({},_0x4abbd6,_0x410334[_0x32ef('0x4e')]);var _0x241f82={'where':_0x4abbd6[_0x32ef('0x49')]};return db[_0x32ef('0x3a')][_0x32ef('0x2c')](_0x241f82)['then'](function(_0x5cb6fc){_0x21706f[_0x32ef('0x2c')]=_0x5cb6fc;if(_0x410334[_0x32ef('0x40')][_0x32ef('0x4f')]){_0x4abbd6[_0x32ef('0x50')]=[{'all':!![]}];}return db[_0x32ef('0x3a')][_0x32ef('0x51')](_0x4abbd6);})[_0x32ef('0x33')](function(_0x115fa3){_0x21706f[_0x32ef('0x52')]=_0x115fa3;return _0x21706f;})[_0x32ef('0x33')](respondWithFilteredResult(_0x480348,_0x4abbd6))[_0x32ef('0x53')](handleError(_0x480348,null));};exports[_0x32ef('0x54')]=function(_0x36a65c,_0x4c2534){var _0x420f00={'raw':![],'where':{'id':_0x36a65c[_0x32ef('0x55')]['id']}},_0x12fbd7={};_0x12fbd7[_0x32ef('0x3e')]=_[_0x32ef('0x3f')](db[_0x32ef('0x3a')][_0x32ef('0x3b')]);_0x12fbd7[_0x32ef('0x40')]=_[_0x32ef('0x3f')](_0x36a65c[_0x32ef('0x40')]);_0x12fbd7[_0x32ef('0x41')]=_[_0x32ef('0x42')](_0x12fbd7[_0x32ef('0x3e')],_0x12fbd7[_0x32ef('0x40')]);_0x420f00[_0x32ef('0x43')]=_[_0x32ef('0x42')](_0x12fbd7[_0x32ef('0x3e')],qs[_0x32ef('0x44')](_0x36a65c['query']['fields']));_0x420f00[_0x32ef('0x43')]=_0x420f00[_0x32ef('0x43')][_0x32ef('0x45')]?_0x420f00[_0x32ef('0x43')]:_0x12fbd7[_0x32ef('0x3e')];if(_0x36a65c[_0x32ef('0x40')][_0x32ef('0x4f')]){_0x420f00[_0x32ef('0x50')]=[{'all':!![]}];}_0x420f00=_[_0x32ef('0x4c')]({},_0x420f00,_0x36a65c[_0x32ef('0x4e')]);return db[_0x32ef('0x3a')]['find'](_0x420f00)[_0x32ef('0x33')](handleEntityNotFound(_0x4c2534,null))[_0x32ef('0x33')](respondWithResult(_0x4c2534,null))[_0x32ef('0x53')](handleError(_0x4c2534,null));};exports[_0x32ef('0x56')]=function(_0x38314a,_0x387cf0){return db['SalesforceAccount'][_0x32ef('0x56')](_0x38314a[_0x32ef('0x57')],{})[_0x32ef('0x33')](respondWithResult(_0x387cf0,0xc9))['catch'](handleError(_0x387cf0,null));};exports[_0x32ef('0x32')]=function(_0x52692a,_0x2ee3dd){if(_0x52692a[_0x32ef('0x57')]['id']){delete _0x52692a['body']['id'];}return db[_0x32ef('0x3a')]['find']({'where':{'id':_0x52692a[_0x32ef('0x55')]['id']}})[_0x32ef('0x33')](handleEntityNotFound(_0x2ee3dd,null))[_0x32ef('0x33')](saveUpdates(_0x52692a[_0x32ef('0x57')],null))[_0x32ef('0x33')](respondWithResult(_0x2ee3dd,null))[_0x32ef('0x53')](handleError(_0x2ee3dd,null));};exports[_0x32ef('0x34')]=function(_0x56260f,_0x56cc75){return db[_0x32ef('0x3a')]['find']({'where':{'id':_0x56260f['params']['id']}})[_0x32ef('0x33')](handleEntityNotFound(_0x56cc75,null))[_0x32ef('0x33')](removeEntity(_0x56cc75,null))[_0x32ef('0x53')](handleError(_0x56cc75,null));};exports[_0x32ef('0x58')]=function(_0x2468e6,_0x356704,_0x316547){var _0x4249c3={};var _0x2b2cd4={};var _0x123571;var _0x4c125c;return db['SalesforceAccount'][_0x32ef('0x59')]({'where':{'id':_0x2468e6[_0x32ef('0x55')]['id']}})['then'](handleEntityNotFound(_0x356704,null))[_0x32ef('0x33')](function(_0x12e1ef){if(_0x12e1ef){_0x123571=_0x12e1ef;_0x2b2cd4[_0x32ef('0x3e')]=_['keys'](db[_0x32ef('0x5a')][_0x32ef('0x3b')]);_0x2b2cd4[_0x32ef('0x40')]=_['keys'](_0x2468e6['query']);_0x2b2cd4[_0x32ef('0x41')]=_['intersection'](_0x2b2cd4[_0x32ef('0x3e')],_0x2b2cd4['query']);_0x4249c3['attributes']=_[_0x32ef('0x42')](_0x2b2cd4[_0x32ef('0x3e')],qs[_0x32ef('0x44')](_0x2468e6['query'][_0x32ef('0x44')]));_0x4249c3[_0x32ef('0x43')]=_0x4249c3[_0x32ef('0x43')]['length']?_0x4249c3[_0x32ef('0x43')]:_0x2b2cd4[_0x32ef('0x3e')];_0x4249c3['order']=qs['sort'](_0x2468e6[_0x32ef('0x40')][_0x32ef('0x5b')]);_0x4249c3[_0x32ef('0x49')]=qs[_0x32ef('0x41')](_[_0x32ef('0x4a')](_0x2468e6[_0x32ef('0x40')],_0x2b2cd4['filters']));if(_0x2468e6[_0x32ef('0x40')][_0x32ef('0x4b')]){_0x4249c3[_0x32ef('0x49')]=_[_0x32ef('0x4c')](_0x4249c3[_0x32ef('0x49')],{'$or':_[_0x32ef('0x39')](_0x4249c3[_0x32ef('0x43')],function(_0x3ff282){var _0x229d6e={};_0x229d6e[_0x3ff282]={'$like':'%'+_0x2468e6['query'][_0x32ef('0x4b')]+'%'};return _0x229d6e;})});}_0x4249c3=_[_0x32ef('0x4c')]({},_0x4249c3,_0x2468e6[_0x32ef('0x4e')]);return _0x123571[_0x32ef('0x58')](_0x4249c3);}})[_0x32ef('0x33')](function(_0x5ad75c){if(_0x5ad75c){_0x4c125c=_0x5ad75c['length'];if(!_0x2468e6[_0x32ef('0x40')][_0x32ef('0x46')](_0x32ef('0x47'))){_0x4249c3[_0x32ef('0x2e')]=qs[_0x32ef('0x2e')](_0x2468e6['query'][_0x32ef('0x2e')]);_0x4249c3['offset']=qs[_0x32ef('0x2d')](_0x2468e6[_0x32ef('0x40')]['offset']);}return _0x123571['getConfigurations'](_0x4249c3);}})[_0x32ef('0x33')](function(_0x1538d0){if(_0x1538d0){return _0x1538d0?{'count':_0x4c125c,'rows':_0x1538d0}:null;}})[_0x32ef('0x33')](respondWithResult(_0x356704,null))['catch'](handleError(_0x356704,null));};exports['addConfiguration']=function(_0x3b4a8e,_0x5edd29,_0x7d2c3a){if(_0x3b4a8e[_0x32ef('0x57')]['id']){delete _0x3b4a8e['body']['id'];}return db[_0x32ef('0x3a')][_0x32ef('0x59')]({'where':{'id':_0x3b4a8e[_0x32ef('0x55')]['id']}})[_0x32ef('0x33')](handleEntityNotFound(_0x5edd29,null))[_0x32ef('0x33')](function(_0x268dcd){if(_0x268dcd){_0x3b4a8e[_0x32ef('0x57')][_0x32ef('0x5c')]=_0x268dcd['id'];_0x3b4a8e[_0x32ef('0x57')][_0x32ef('0x5d')]=integrations[_0x32ef('0x5e')](_0x3b4a8e[_0x32ef('0x57')]['channel'],_0x3b4a8e['body'][_0x32ef('0x3d')]);_0x3b4a8e[_0x32ef('0x57')]['Descriptions']=integrations[_0x32ef('0x5f')](_0x3b4a8e['body'][_0x32ef('0x60')],_0x3b4a8e[_0x32ef('0x57')][_0x32ef('0x3d')]);return db['SalesforceConfiguration'][_0x32ef('0x56')](_0x3b4a8e['body'],{'include':[{'model':db[_0x32ef('0x61')],'as':_0x32ef('0x5d')},{'model':db['SalesforceField'],'as':'Descriptions'}]});}return null;})[_0x32ef('0x33')](respondWithResult(_0x5edd29,null))['catch'](handleError(_0x5edd29,null));};exports[_0x32ef('0x62')]=function(_0x4ce588,_0xdbfb6f,_0x199df6){var _0x1adcb8;var _0x4f3442='';var _0x48b35e='Task';return db[_0x32ef('0x3a')]['findOne']({'where':{'id':_0x4ce588[_0x32ef('0x55')]['id']},'attributes':['id',_0x32ef('0x63'),_0x32ef('0x64'),_0x32ef('0x65'),_0x32ef('0x66'),_0x32ef('0x67'),'securityToken']})[_0x32ef('0x33')](handleEntityNotFound(_0xdbfb6f,null))['then'](function(_0x5bbabf){if(_0x5bbabf){_0x4f3442=_0x5bbabf[_0x32ef('0x63')];var _0x5c4f2a=_0x4f3442[_0x32ef('0x68')](-0x1);if(_0x5c4f2a==='/'){_0x4f3442=_0x4f3442[_0x32ef('0x69')](0x0,_0x4f3442['lastIndexOf'](_0x5c4f2a));}_0x1adcb8=new jsforce[(_0x32ef('0x6a'))]({'oauth2':{'loginUrl':_0x4f3442,'clientId':_0x5bbabf[_0x32ef('0x64')],'clientSecret':_0x5bbabf[_0x32ef('0x65')]}});return _0x1adcb8[_0x32ef('0x6b')](_0x5bbabf[_0x32ef('0x66')],_0x5bbabf[_0x32ef('0x67')]['concat'](_0x5bbabf['securityToken']));}})[_0x32ef('0x33')](function(_0x5e0b55){if(_0x5e0b55){if(!_[_0x32ef('0x6c')](_0x4ce588[_0x32ef('0x40')][_0x32ef('0x6d')])){_0x48b35e=_0x4ce588[_0x32ef('0x40')][_0x32ef('0x6d')];}return _0x1adcb8[_0x32ef('0x6e')](_0x48b35e)['describe']();}})[_0x32ef('0x33')](function(_0x146f8c){var _0x251a4f=[_0x32ef('0x6f'),_0x32ef('0x70'),'CallObject','CallType',_0x32ef('0x71'),_0x32ef('0x72'),'Status',_0x32ef('0x73')];if(!_[_0x32ef('0x6c')](_0x4ce588[_0x32ef('0x40')][_0x32ef('0x6d')])&&_0x4ce588[_0x32ef('0x40')][_0x32ef('0x6d')]===_0x32ef('0x74')){_0x251a4f=[_0x32ef('0x73'),_0x32ef('0x75'),'Reason',_0x32ef('0x76'),_0x32ef('0x72'),'IsEscalated',_0x32ef('0x77'),'SuppliedCompany'];}if(_0x146f8c){_[_0x32ef('0x78')](_0x146f8c['fields'],function(_0x43f36e){return _0x43f36e[_0x32ef('0x79')]===![]&&!_0x251a4f[_0x32ef('0x7a')](_0x43f36e[_0x32ef('0x36')]);});return{'count':_0x146f8c['fields'][_0x32ef('0x45')],'rows':_[_0x32ef('0x39')](_0x146f8c[_0x32ef('0x44')],function(_0x57ca9a){return{'id':_0x57ca9a['name'],'name':_0x57ca9a['label'],'custom':_0x57ca9a[_0x32ef('0x79')],'options':_0x57ca9a[_0x32ef('0x7b')][_0x32ef('0x45')]>0x0?_[_0x32ef('0x39')](_0x57ca9a[_0x32ef('0x7b')],function(_0x5a1696){return{'name':_0x5a1696[_0x32ef('0x7c')],'value':_0x5a1696['value']};}):_0x57ca9a[_0x32ef('0x3d')]==_0x32ef('0x7d')?[{'name':_0x32ef('0x7e'),'value':'true'},{'name':_0x32ef('0x7f'),'value':_0x32ef('0x80')}]:[]};})};}})[_0x32ef('0x33')](respondWithResult(_0xdbfb6f,null))[_0x32ef('0x53')](function(_0x28bebb){var _0x4d4b5f=_0x4ce588[_0x32ef('0x40')]['test']?0x1f4:_0x28bebb[_0x32ef('0x81')]||0x1f4;logger[_0x32ef('0x23')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x4d4b5f,JSON[_0x32ef('0x22')](_0x28bebb));delete _0x28bebb[_0x32ef('0x36')];if(_0x4d4b5f===0x191){_0x4d4b5f=0x190;}_0xdbfb6f[_0x32ef('0x29')](_0x4d4b5f)[_0x32ef('0x37')](_0x4ce588['query'][_0x32ef('0x82')]?{'message':'Wrong\x20credentials','statusCode':_0x28bebb['statusCode']}:_0x28bebb);});}; \ No newline at end of file +var _0xc4aa=['concat','isNil','ticketType','sobject','describe','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','Case','Type','Reason','Priority','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','picklistValues','label','value','True','true','False','false','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','set','Content-Range','json','save','update','destroy','name','send','index','map','rawAttributes','fieldName','key','model','query','attributes','intersection','fields','length','nolimit','limit','order','sort','where','filters','pick','type','VIRTUAL','filter','merge','options','SalesforceAccount','include','findAll','params','keys','includeAll','find','create','body','getConfigurations','findOne','SalesforceConfiguration','addConfiguration','getSubjects','getDescriptions','SalesforceField','Descriptions','Task','remoteUri','clientId','clientSecret','username','password','securityToken','slice','substring','Connection','login'];(function(_0x21aa24,_0xa28fd8){var _0x182338=function(_0x1e6585){while(--_0x1e6585){_0x21aa24['push'](_0x21aa24['shift']());}};_0x182338(++_0xa28fd8);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xc4aa[_0x5f09c5];return _0x426ad9;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];var integrations=require(_0xac4a('0x16'));var jayson=require(_0xac4a('0x17'));var client=jayson['client'][_0xac4a('0x18')]({'port':0x232a});function checkPasswordPattern(_0x68424a,_0x247b78,_0x6e00d4){if(_0x6e00d4){var _0x1b4313=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1b4313[_0xac4a('0x19')](_0x247b78)){return _0x68424a;}else{throw new db[(_0xac4a('0x1a'))][(_0xac4a('0x1b'))](_0xac4a('0x1c'));}}else{return _0x68424a;}}function respondWithRpcPromise(_0x42c7fc,_0x11e101,_0x26dbb8,_0x4a2119){return new BPromise(function(_0x402fff,_0x34d797){var _0x23eb66=_0x4a2119||client;return _0x23eb66[_0xac4a('0x1d')](_0x42c7fc,_0x26dbb8)[_0xac4a('0x1e')](function(_0x387a54){logger[_0xac4a('0x1f')](_0xac4a('0x20'),_0x11e101,'request\x20sent');logger['debug'](_0xac4a('0x21'),_0x11e101,_0xac4a('0x22'),JSON[_0xac4a('0x23')](_0x387a54));if(_0x387a54['error']){if(_0x387a54[_0xac4a('0x24')][_0xac4a('0x25')]===0x1f4){logger[_0xac4a('0x24')](_0xac4a('0x20'),_0x11e101,_0x387a54[_0xac4a('0x24')][_0xac4a('0x26')]);return _0x34d797(_0x387a54[_0xac4a('0x24')][_0xac4a('0x26')]);}logger['error'](_0xac4a('0x20'),_0x11e101,_0x387a54[_0xac4a('0x24')]['message']);return _0x402fff(_0x387a54[_0xac4a('0x24')][_0xac4a('0x26')]);}else{logger[_0xac4a('0x1f')](_0xac4a('0x20'),_0x11e101,'request\x20sent');_0x402fff(_0x387a54[_0xac4a('0x27')][_0xac4a('0x26')]);}})[_0xac4a('0x28')](function(_0x412494){logger[_0xac4a('0x24')](_0xac4a('0x20'),_0x11e101,_0x412494);_0x34d797(_0x412494);});});}function respondWithStatusCode(_0x222507,_0x36054a){_0x36054a=_0x36054a||0xcc;return function(_0x3e2c69){if(_0x3e2c69){return _0x222507[_0xac4a('0x29')](_0x36054a);}return _0x222507[_0xac4a('0x2a')](_0x36054a)[_0xac4a('0x2b')]();};}function respondWithResult(_0x14832b,_0x472c57){_0x472c57=_0x472c57||0xc8;return function(_0x1c13dc){if(_0x1c13dc){return _0x14832b[_0xac4a('0x2a')](_0x472c57)['json'](_0x1c13dc);}};}function respondWithFilteredResult(_0x23b061,_0x267a22){return function(_0x42a33c){if(_0x42a33c){var _0x2772fe=_0x42a33c[_0xac4a('0x2c')],_0x116700=_0x267a22[_0xac4a('0x2d')],_0x4a5a9e=_0x267a22[_0xac4a('0x2d')]+_0x267a22['limit'],_0x47f49c;if(_0x4a5a9e>=_0x2772fe){_0x4a5a9e=_0x2772fe;_0x47f49c=0xc8;}else{_0x47f49c=0xce;}_0x23b061['status'](_0x47f49c);return _0x23b061[_0xac4a('0x2e')](_0xac4a('0x2f'),_0x116700+'-'+_0x4a5a9e+'/'+_0x2772fe)[_0xac4a('0x30')](_0x42a33c);}return null;};}function patchUpdates(_0x432066){return function(_0x17118e){try{jsonpatch['apply'](_0x17118e,_0x432066,!![]);}catch(_0x6dcc7f){return BPromise['reject'](_0x6dcc7f);}return _0x17118e[_0xac4a('0x31')]();};}function saveUpdates(_0x57adcf,_0x17e6de){return function(_0xfbe355){if(_0xfbe355){return _0xfbe355[_0xac4a('0x32')](_0x57adcf)[_0xac4a('0x1e')](function(_0x34577f){return _0x34577f;});}return null;};}function removeEntity(_0x61e552,_0xbd4591){return function(_0x1f13f3){if(_0x1f13f3){return _0x1f13f3[_0xac4a('0x33')]()[_0xac4a('0x1e')](function(){_0x61e552[_0xac4a('0x2a')](0xcc)[_0xac4a('0x2b')]();});}};}function handleEntityNotFound(_0x1a9be2,_0x1a9d4e){return function(_0x5634e2){if(!_0x5634e2){_0x1a9be2[_0xac4a('0x29')](0x194);}return _0x5634e2;};}function handleError(_0x1c41fb,_0x5a4e2b){_0x5a4e2b=_0x5a4e2b||0x1f4;return function(_0x2a5419){logger[_0xac4a('0x24')](_0x2a5419['stack']);if(_0x2a5419['name']){delete _0x2a5419[_0xac4a('0x34')];}_0x1c41fb[_0xac4a('0x2a')](_0x5a4e2b)[_0xac4a('0x35')](_0x2a5419);};}exports[_0xac4a('0x36')]=function(_0x4f5986,_0x453d02){var _0x2e56c6={},_0x4e7630={},_0x37f2ee={'count':0x0,'rows':[]};var _0x34f55c=_[_0xac4a('0x37')](db['SalesforceAccount'][_0xac4a('0x38')],function(_0x357f06){return{'name':_0x357f06[_0xac4a('0x39')],'type':_0x357f06['type'][_0xac4a('0x3a')]};});_0x4e7630[_0xac4a('0x3b')]=_['map'](_0x34f55c,'name');_0x4e7630[_0xac4a('0x3c')]=_['keys'](_0x4f5986['query']);_0x4e7630['filters']=_['intersection'](_0x4e7630[_0xac4a('0x3b')],_0x4e7630[_0xac4a('0x3c')]);_0x2e56c6[_0xac4a('0x3d')]=_[_0xac4a('0x3e')](_0x4e7630[_0xac4a('0x3b')],qs[_0xac4a('0x3f')](_0x4f5986[_0xac4a('0x3c')][_0xac4a('0x3f')]));_0x2e56c6[_0xac4a('0x3d')]=_0x2e56c6[_0xac4a('0x3d')][_0xac4a('0x40')]?_0x2e56c6[_0xac4a('0x3d')]:_0x4e7630['model'];if(!_0x4f5986['query']['hasOwnProperty'](_0xac4a('0x41'))){_0x2e56c6[_0xac4a('0x42')]=qs[_0xac4a('0x42')](_0x4f5986[_0xac4a('0x3c')][_0xac4a('0x42')]);_0x2e56c6[_0xac4a('0x2d')]=qs[_0xac4a('0x2d')](_0x4f5986[_0xac4a('0x3c')][_0xac4a('0x2d')]);}_0x2e56c6[_0xac4a('0x43')]=qs['sort'](_0x4f5986[_0xac4a('0x3c')][_0xac4a('0x44')]);_0x2e56c6[_0xac4a('0x45')]=qs[_0xac4a('0x46')](_[_0xac4a('0x47')](_0x4f5986['query'],_0x4e7630[_0xac4a('0x46')]));if(_0x4f5986[_0xac4a('0x3c')]['filter']){_0x2e56c6[_0xac4a('0x45')]=_['merge'](_0x2e56c6[_0xac4a('0x45')],{'$or':_[_0xac4a('0x37')](_0x34f55c,function(_0xe5ee0f){if(_0xe5ee0f[_0xac4a('0x48')]!==_0xac4a('0x49')){var _0x463f01={};_0x463f01[_0xe5ee0f[_0xac4a('0x34')]]={'$like':'%'+_0x4f5986[_0xac4a('0x3c')][_0xac4a('0x4a')]+'%'};return _0x463f01;}})});}_0x2e56c6=_[_0xac4a('0x4b')]({},_0x2e56c6,_0x4f5986[_0xac4a('0x4c')]);var _0x3b68b3={'where':_0x2e56c6['where']};return db[_0xac4a('0x4d')][_0xac4a('0x2c')](_0x3b68b3)[_0xac4a('0x1e')](function(_0x58759a){_0x37f2ee[_0xac4a('0x2c')]=_0x58759a;if(_0x4f5986[_0xac4a('0x3c')]['includeAll']){_0x2e56c6[_0xac4a('0x4e')]=[{'all':!![]}];}return db['SalesforceAccount'][_0xac4a('0x4f')](_0x2e56c6);})[_0xac4a('0x1e')](function(_0x136a65){_0x37f2ee['rows']=_0x136a65;return _0x37f2ee;})['then'](respondWithFilteredResult(_0x453d02,_0x2e56c6))[_0xac4a('0x28')](handleError(_0x453d02,null));};exports['show']=function(_0x18ae96,_0x566258){var _0x3d2aaf={'raw':![],'where':{'id':_0x18ae96[_0xac4a('0x50')]['id']}},_0x530bbb={};_0x530bbb[_0xac4a('0x3b')]=_[_0xac4a('0x51')](db[_0xac4a('0x4d')]['rawAttributes']);_0x530bbb[_0xac4a('0x3c')]=_[_0xac4a('0x51')](_0x18ae96[_0xac4a('0x3c')]);_0x530bbb[_0xac4a('0x46')]=_[_0xac4a('0x3e')](_0x530bbb[_0xac4a('0x3b')],_0x530bbb[_0xac4a('0x3c')]);_0x3d2aaf['attributes']=_[_0xac4a('0x3e')](_0x530bbb[_0xac4a('0x3b')],qs['fields'](_0x18ae96[_0xac4a('0x3c')][_0xac4a('0x3f')]));_0x3d2aaf[_0xac4a('0x3d')]=_0x3d2aaf[_0xac4a('0x3d')]['length']?_0x3d2aaf[_0xac4a('0x3d')]:_0x530bbb[_0xac4a('0x3b')];if(_0x18ae96[_0xac4a('0x3c')][_0xac4a('0x52')]){_0x3d2aaf[_0xac4a('0x4e')]=[{'all':!![]}];}_0x3d2aaf=_['merge']({},_0x3d2aaf,_0x18ae96[_0xac4a('0x4c')]);return db['SalesforceAccount'][_0xac4a('0x53')](_0x3d2aaf)[_0xac4a('0x1e')](handleEntityNotFound(_0x566258,null))['then'](respondWithResult(_0x566258,null))['catch'](handleError(_0x566258,null));};exports[_0xac4a('0x54')]=function(_0x70fdc3,_0x4d448f){return db[_0xac4a('0x4d')][_0xac4a('0x54')](_0x70fdc3[_0xac4a('0x55')],{})[_0xac4a('0x1e')](respondWithResult(_0x4d448f,0xc9))['catch'](handleError(_0x4d448f,null));};exports[_0xac4a('0x32')]=function(_0x108f7c,_0xb43fdb){if(_0x108f7c[_0xac4a('0x55')]['id']){delete _0x108f7c[_0xac4a('0x55')]['id'];}return db[_0xac4a('0x4d')][_0xac4a('0x53')]({'where':{'id':_0x108f7c['params']['id']}})[_0xac4a('0x1e')](handleEntityNotFound(_0xb43fdb,null))[_0xac4a('0x1e')](saveUpdates(_0x108f7c[_0xac4a('0x55')],null))[_0xac4a('0x1e')](respondWithResult(_0xb43fdb,null))[_0xac4a('0x28')](handleError(_0xb43fdb,null));};exports[_0xac4a('0x33')]=function(_0x213df2,_0x236f57){return db[_0xac4a('0x4d')][_0xac4a('0x53')]({'where':{'id':_0x213df2[_0xac4a('0x50')]['id']}})[_0xac4a('0x1e')](handleEntityNotFound(_0x236f57,null))[_0xac4a('0x1e')](removeEntity(_0x236f57,null))[_0xac4a('0x28')](handleError(_0x236f57,null));};exports[_0xac4a('0x56')]=function(_0x11c753,_0x492aae,_0x13a577){var _0x479ebc={};var _0x2d598e={};var _0x4b7f79;var _0x2a30e8;return db['SalesforceAccount'][_0xac4a('0x57')]({'where':{'id':_0x11c753['params']['id']}})['then'](handleEntityNotFound(_0x492aae,null))[_0xac4a('0x1e')](function(_0x568ffb){if(_0x568ffb){_0x4b7f79=_0x568ffb;_0x2d598e[_0xac4a('0x3b')]=_[_0xac4a('0x51')](db[_0xac4a('0x58')][_0xac4a('0x38')]);_0x2d598e['query']=_[_0xac4a('0x51')](_0x11c753['query']);_0x2d598e[_0xac4a('0x46')]=_['intersection'](_0x2d598e[_0xac4a('0x3b')],_0x2d598e[_0xac4a('0x3c')]);_0x479ebc[_0xac4a('0x3d')]=_[_0xac4a('0x3e')](_0x2d598e[_0xac4a('0x3b')],qs[_0xac4a('0x3f')](_0x11c753[_0xac4a('0x3c')][_0xac4a('0x3f')]));_0x479ebc[_0xac4a('0x3d')]=_0x479ebc[_0xac4a('0x3d')][_0xac4a('0x40')]?_0x479ebc[_0xac4a('0x3d')]:_0x2d598e[_0xac4a('0x3b')];_0x479ebc[_0xac4a('0x43')]=qs[_0xac4a('0x44')](_0x11c753[_0xac4a('0x3c')][_0xac4a('0x44')]);_0x479ebc['where']=qs[_0xac4a('0x46')](_[_0xac4a('0x47')](_0x11c753['query'],_0x2d598e[_0xac4a('0x46')]));if(_0x11c753[_0xac4a('0x3c')][_0xac4a('0x4a')]){_0x479ebc[_0xac4a('0x45')]=_[_0xac4a('0x4b')](_0x479ebc['where'],{'$or':_['map'](_0x479ebc[_0xac4a('0x3d')],function(_0x11bb54){var _0x158223={};_0x158223[_0x11bb54]={'$like':'%'+_0x11c753[_0xac4a('0x3c')][_0xac4a('0x4a')]+'%'};return _0x158223;})});}_0x479ebc=_[_0xac4a('0x4b')]({},_0x479ebc,_0x11c753[_0xac4a('0x4c')]);return _0x4b7f79[_0xac4a('0x56')](_0x479ebc);}})[_0xac4a('0x1e')](function(_0x295f21){if(_0x295f21){_0x2a30e8=_0x295f21[_0xac4a('0x40')];if(!_0x11c753['query']['hasOwnProperty'](_0xac4a('0x41'))){_0x479ebc[_0xac4a('0x42')]=qs[_0xac4a('0x42')](_0x11c753[_0xac4a('0x3c')][_0xac4a('0x42')]);_0x479ebc[_0xac4a('0x2d')]=qs[_0xac4a('0x2d')](_0x11c753[_0xac4a('0x3c')][_0xac4a('0x2d')]);}return _0x4b7f79[_0xac4a('0x56')](_0x479ebc);}})[_0xac4a('0x1e')](function(_0xb12cc5){if(_0xb12cc5){return _0xb12cc5?{'count':_0x2a30e8,'rows':_0xb12cc5}:null;}})['then'](respondWithResult(_0x492aae,null))[_0xac4a('0x28')](handleError(_0x492aae,null));};exports[_0xac4a('0x59')]=function(_0x26bd31,_0x231932,_0x513976){if(_0x26bd31[_0xac4a('0x55')]['id']){delete _0x26bd31['body']['id'];}return db[_0xac4a('0x4d')][_0xac4a('0x57')]({'where':{'id':_0x26bd31['params']['id']}})['then'](handleEntityNotFound(_0x231932,null))[_0xac4a('0x1e')](function(_0x3b8974){if(_0x3b8974){_0x26bd31[_0xac4a('0x55')]['AccountId']=_0x3b8974['id'];_0x26bd31[_0xac4a('0x55')]['Subjects']=integrations[_0xac4a('0x5a')](_0x26bd31['body']['channel'],_0x26bd31[_0xac4a('0x55')]['type']);_0x26bd31[_0xac4a('0x55')]['Descriptions']=integrations[_0xac4a('0x5b')](_0x26bd31[_0xac4a('0x55')]['channel'],_0x26bd31[_0xac4a('0x55')]['type']);return db[_0xac4a('0x58')][_0xac4a('0x54')](_0x26bd31['body'],{'include':[{'model':db[_0xac4a('0x5c')],'as':'Subjects'},{'model':db['SalesforceField'],'as':_0xac4a('0x5d')}]});}return null;})['then'](respondWithResult(_0x231932,null))[_0xac4a('0x28')](handleError(_0x231932,null));};exports['getFields']=function(_0x4ccd67,_0x1588e2,_0x4065c0){var _0x3bec8a;var _0x54c063='';var _0x504256=_0xac4a('0x5e');return db[_0xac4a('0x4d')]['findOne']({'where':{'id':_0x4ccd67['params']['id']},'attributes':['id',_0xac4a('0x5f'),_0xac4a('0x60'),_0xac4a('0x61'),_0xac4a('0x62'),_0xac4a('0x63'),_0xac4a('0x64')]})[_0xac4a('0x1e')](handleEntityNotFound(_0x1588e2,null))[_0xac4a('0x1e')](function(_0x26bf73){if(_0x26bf73){_0x54c063=_0x26bf73['remoteUri'];var _0x1201e8=_0x54c063[_0xac4a('0x65')](-0x1);if(_0x1201e8==='/'){_0x54c063=_0x54c063[_0xac4a('0x66')](0x0,_0x54c063['lastIndexOf'](_0x1201e8));}_0x3bec8a=new jsforce[(_0xac4a('0x67'))]({'oauth2':{'loginUrl':_0x54c063,'clientId':_0x26bf73[_0xac4a('0x60')],'clientSecret':_0x26bf73[_0xac4a('0x61')]}});return _0x3bec8a[_0xac4a('0x68')](_0x26bf73[_0xac4a('0x62')],_0x26bf73['password'][_0xac4a('0x69')](_0x26bf73[_0xac4a('0x64')]));}})[_0xac4a('0x1e')](function(_0x37e519){if(_0x37e519){if(!_[_0xac4a('0x6a')](_0x4ccd67[_0xac4a('0x3c')][_0xac4a('0x6b')])){_0x504256=_0x4ccd67['query'][_0xac4a('0x6b')];}return _0x3bec8a[_0xac4a('0x6c')](_0x504256)[_0xac4a('0x6d')]();}})[_0xac4a('0x1e')](function(_0x1bb24d){var _0x171c47=['CallDisposition',_0xac4a('0x6e'),_0xac4a('0x6f'),_0xac4a('0x70'),_0xac4a('0x71'),'Priority',_0xac4a('0x72'),'Type'];if(!_[_0xac4a('0x6a')](_0x4ccd67[_0xac4a('0x3c')]['ticketType'])&&_0x4ccd67['query'][_0xac4a('0x6b')]===_0xac4a('0x73')){_0x171c47=[_0xac4a('0x74'),'Origin',_0xac4a('0x75'),'Status',_0xac4a('0x76'),_0xac4a('0x77'),_0xac4a('0x78'),_0xac4a('0x79')];}if(_0x1bb24d){_[_0xac4a('0x7a')](_0x1bb24d['fields'],function(_0x50f471){return _0x50f471[_0xac4a('0x7b')]===![]&&!_0x171c47[_0xac4a('0x7c')](_0x50f471[_0xac4a('0x34')]);});return{'count':_0x1bb24d[_0xac4a('0x3f')][_0xac4a('0x40')],'rows':_[_0xac4a('0x37')](_0x1bb24d[_0xac4a('0x3f')],function(_0x186410){return{'id':_0x186410['name'],'name':_0x186410['label'],'custom':_0x186410[_0xac4a('0x7b')],'options':_0x186410[_0xac4a('0x7d')][_0xac4a('0x40')]>0x0?_[_0xac4a('0x37')](_0x186410[_0xac4a('0x7d')],function(_0x2ea4a4){return{'name':_0x2ea4a4[_0xac4a('0x7e')],'value':_0x2ea4a4[_0xac4a('0x7f')]};}):_0x186410['type']=='boolean'?[{'name':_0xac4a('0x80'),'value':_0xac4a('0x81')},{'name':_0xac4a('0x82'),'value':_0xac4a('0x83')}]:[]};})};}})[_0xac4a('0x1e')](respondWithResult(_0x1588e2,null))[_0xac4a('0x28')](function(_0x338af3){var _0x51c3ef=_0x4ccd67[_0xac4a('0x3c')][_0xac4a('0x19')]?0x1f4:_0x338af3[_0xac4a('0x84')]||0x1f4;logger['error'](_0xac4a('0x85'),_0xac4a('0x86'),_0x51c3ef,JSON[_0xac4a('0x23')](_0x338af3));delete _0x338af3[_0xac4a('0x34')];if(_0x51c3ef===0x191){_0x51c3ef=0x190;}_0x1588e2[_0xac4a('0x2a')](_0x51c3ef)[_0xac4a('0x35')](_0x4ccd67[_0xac4a('0x3c')][_0xac4a('0x19')]?{'message':_0xac4a('0x87'),'statusCode':_0x338af3['statusCode']}:_0x338af3);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 76c63cf..035f21d 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 _0xc4b8=['./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc4b8,0x88));var _0x8c4b=function(_0x1e864c,_0x2a88da){_0x1e864c=_0x1e864c-0x0;var _0x142dbe=_0xc4b8[_0x1e864c];return _0x142dbe;};'use strict';var _=require('lodash');var util=require(_0x8c4b('0x0'));var logger=require(_0x8c4b('0x1'))(_0x8c4b('0x2'));var moment=require(_0x8c4b('0x3'));var BPromise=require('bluebird');var rp=require(_0x8c4b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c4b('0x5'));var config=require(_0x8c4b('0x6'));var attributes=require(_0x8c4b('0x7'));var integrations=require(_0x8c4b('0x8'));module[_0x8c4b('0x9')]=function(_0x568c14,_0x359c76){return _0x568c14[_0x8c4b('0xa')](_0x8c4b('0xb'),attributes,{'tableName':_0x8c4b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3882=['./intSalesforceAccount.attributes','../../components/integrations/configuration','define','SalesforceAccount','int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x57bb74,_0x4755ac){var _0x44e0eb=function(_0x19e800){while(--_0x19e800){_0x57bb74['push'](_0x57bb74['shift']());}};_0x44e0eb(++_0x4755ac);}(_0x3882,0x14f));var _0x2388=function(_0x3e0e08,_0x4e07a0){_0x3e0e08=_0x3e0e08-0x0;var _0x299988=_0x3882[_0x3e0e08];return _0x299988;};'use strict';var _=require(_0x2388('0x0'));var util=require(_0x2388('0x1'));var logger=require(_0x2388('0x2'))(_0x2388('0x3'));var moment=require(_0x2388('0x4'));var BPromise=require(_0x2388('0x5'));var rp=require(_0x2388('0x6'));var fs=require('fs');var path=require(_0x2388('0x7'));var rimraf=require(_0x2388('0x8'));var config=require(_0x2388('0x9'));var attributes=require(_0x2388('0xa'));var integrations=require(_0x2388('0xb'));module['exports']=function(_0x211495,_0x4b14ee){return _0x211495[_0x2388('0xc')](_0x2388('0xd'),attributes,{'tableName':_0x2388('0xe'),'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 ea22588..74d02d0 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 _0x0c02=['../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','error','code','message','result','catch','SalesforceAccount','findAll','options','raw','attributes','include','map','model','debug','GetSalesforceAccount','stringify','ShowSalesforceAccount','find','where','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x268838,_0x59f8a2){var _0x5d4150=function(_0x2785ca){while(--_0x2785ca){_0x268838['push'](_0x268838['shift']());}};_0x5d4150(++_0x59f8a2);}(_0x0c02,0x84));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x20c0('0x0'));var moment=require(_0x20c0('0x1'));var BPromise=require('bluebird');var rs=require(_0x20c0('0x2'));var fs=require('fs');var Redis=require(_0x20c0('0x3'));var db=require(_0x20c0('0x4'))['db'];var utils=require(_0x20c0('0x5'));var logger=require(_0x20c0('0x6'))(_0x20c0('0x7'));var config=require(_0x20c0('0x8'));var jayson=require(_0x20c0('0x9'));var client=jayson[_0x20c0('0xa')][_0x20c0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d6408,_0x4e1dac,_0x5da127){return new BPromise(function(_0x4db532,_0x1e35e2){return client[_0x20c0('0xc')](_0x5d6408,_0x5da127)[_0x20c0('0xd')](function(_0x41a4af){logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4e1dac,'request\x20sent',JSON['stringify'](_0x41a4af));if(_0x41a4af[_0x20c0('0x10')]){if(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x11')]===0x1f4){logger[_0x20c0('0x10')]('SalesforceAccount,\x20%s,\x20%s',_0x4e1dac,_0x41a4af[_0x20c0('0x10')]['message']);return _0x1e35e2(_0x41a4af['error'][_0x20c0('0x12')]);}logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);return _0x4db532(_0x41a4af[_0x20c0('0x10')][_0x20c0('0x12')]);}else{logger[_0x20c0('0xe')](_0x20c0('0xf'),_0x4e1dac,'request\x20sent');_0x4db532(_0x41a4af[_0x20c0('0x13')][_0x20c0('0x12')]);}})[_0x20c0('0x14')](function(_0x46b9e5){logger[_0x20c0('0x10')](_0x20c0('0xf'),_0x4e1dac,_0x46b9e5);_0x1e35e2(_0x46b9e5);});});}exports['GetSalesforceAccount']=function(_0x55de3b){var _0x529cad=this;return new Promise(function(_0x10a921,_0x18904f){return db[_0x20c0('0x15')][_0x20c0('0x16')]({'raw':_0x55de3b['options']?_0x55de3b[_0x20c0('0x17')][_0x20c0('0x18')]===undefined?!![]:![]:!![],'where':_0x55de3b[_0x20c0('0x17')]?_0x55de3b['options']['where']||null:null,'attributes':_0x55de3b[_0x20c0('0x17')]?_0x55de3b[_0x20c0('0x17')][_0x20c0('0x19')]||null:null,'limit':_0x55de3b[_0x20c0('0x17')]?_0x55de3b[_0x20c0('0x17')]['limit']||null:null,'include':_0x55de3b[_0x20c0('0x17')]?_0x55de3b[_0x20c0('0x17')][_0x20c0('0x1a')]?_[_0x20c0('0x1b')](_0x55de3b['options'][_0x20c0('0x1a')],function(_0x3e545c){return{'model':db[_0x3e545c[_0x20c0('0x1c')]],'as':_0x3e545c['as'],'attributes':_0x3e545c[_0x20c0('0x19')],'include':_0x3e545c[_0x20c0('0x1a')]?_[_0x20c0('0x1b')](_0x3e545c[_0x20c0('0x1a')],function(_0x55b129){return{'model':db[_0x55b129[_0x20c0('0x1c')]],'as':_0x55b129['as'],'attributes':_0x55b129[_0x20c0('0x19')],'include':_0x55b129[_0x20c0('0x1a')]?_[_0x20c0('0x1b')](_0x55b129[_0x20c0('0x1a')],function(_0x14dac3){return{'model':db[_0x14dac3['model']],'as':_0x14dac3['as'],'attributes':_0x14dac3['attributes']};}):[]};}):[]};}):[]:[]})[_0x20c0('0xd')](function(_0x198bdd){logger[_0x20c0('0xe')]('GetSalesforceAccount',_0x55de3b);logger[_0x20c0('0x1d')](_0x20c0('0x1e'),_0x55de3b,JSON[_0x20c0('0x1f')](_0x198bdd));_0x10a921(_0x198bdd);})[_0x20c0('0x14')](function(_0x4baaed){logger['error'](_0x20c0('0x1e'),_0x4baaed[_0x20c0('0x12')],_0x55de3b);_0x18904f(_0x529cad[_0x20c0('0x10')](0x1f4,_0x4baaed[_0x20c0('0x12')]));});});};exports[_0x20c0('0x20')]=function(_0x1a2a5c){var _0x3b97a5=this;return new Promise(function(_0x40c0a7,_0x3ac0a4){return db[_0x20c0('0x15')][_0x20c0('0x21')]({'raw':_0x1a2a5c[_0x20c0('0x17')]?_0x1a2a5c[_0x20c0('0x17')][_0x20c0('0x18')]===undefined?!![]:![]:!![],'where':_0x1a2a5c['options']?_0x1a2a5c[_0x20c0('0x17')][_0x20c0('0x22')]||null:null,'attributes':_0x1a2a5c[_0x20c0('0x17')]?_0x1a2a5c[_0x20c0('0x17')]['attributes']||null:null,'include':_0x1a2a5c[_0x20c0('0x17')]?_0x1a2a5c[_0x20c0('0x17')][_0x20c0('0x1a')]?_[_0x20c0('0x1b')](_0x1a2a5c[_0x20c0('0x17')]['include'],function(_0x3484ea){return{'model':db[_0x3484ea['model']],'as':_0x3484ea['as'],'attributes':_0x3484ea['attributes'],'include':_0x3484ea[_0x20c0('0x1a')]?_[_0x20c0('0x1b')](_0x3484ea[_0x20c0('0x1a')],function(_0x37714d){return{'model':db[_0x37714d[_0x20c0('0x1c')]],'as':_0x37714d['as'],'attributes':_0x37714d[_0x20c0('0x19')],'include':_0x37714d[_0x20c0('0x1a')]?_['map'](_0x37714d['include'],function(_0x4e2dba){return{'model':db[_0x4e2dba[_0x20c0('0x1c')]],'as':_0x4e2dba['as'],'attributes':_0x4e2dba[_0x20c0('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x346a04){logger[_0x20c0('0xe')]('ShowSalesforceAccount',_0x1a2a5c);logger['debug'](_0x20c0('0x20'),_0x1a2a5c,JSON[_0x20c0('0x1f')](_0x346a04));_0x40c0a7(_0x346a04);})['catch'](function(_0x44326a){logger['error'](_0x20c0('0x20'),_0x44326a[_0x20c0('0x12')],_0x1a2a5c);_0x3ac0a4(_0x3b97a5[_0x20c0('0x10')](0x1f4,_0x44326a[_0x20c0('0x12')]));});});}; \ No newline at end of file +var _0xb903=['info','result','findAll','options','raw','where','attributes','limit','map','include','model','then','GetSalesforceAccount','debug','stringify','ShowSalesforceAccount','SalesforceAccount','find','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','SalesforceAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','SalesforceAccount,\x20%s,\x20%s','message'];(function(_0x1b892b,_0x4efe48){var _0xa99e57=function(_0x3f957a){while(--_0x3f957a){_0x1b892b['push'](_0x1b892b['shift']());}};_0xa99e57(++_0x4efe48);}(_0xb903,0x185));var _0x3b90=function(_0x5563ee,_0x2b570d){_0x5563ee=_0x5563ee-0x0;var _0xd86cc0=_0xb903[_0x5563ee];return _0xd86cc0;};'use strict';var _=require(_0x3b90('0x0'));var util=require(_0x3b90('0x1'));var moment=require(_0x3b90('0x2'));var BPromise=require(_0x3b90('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b90('0x4'));var db=require(_0x3b90('0x5'))['db'];var utils=require(_0x3b90('0x6'));var logger=require(_0x3b90('0x7'))(_0x3b90('0x8'));var config=require(_0x3b90('0x9'));var jayson=require(_0x3b90('0xa'));var client=jayson['client'][_0x3b90('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5e845a,_0x55792c,_0x153283){return new BPromise(function(_0x2e4c06,_0x42efe8){return client[_0x3b90('0xc')](_0x5e845a,_0x153283)['then'](function(_0x5cda1d){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x55792c,'request\x20sent');logger['debug'](_0x3b90('0xd'),_0x55792c,_0x3b90('0xe'),JSON['stringify'](_0x5cda1d));if(_0x5cda1d[_0x3b90('0xf')]){if(_0x5cda1d[_0x3b90('0xf')]['code']===0x1f4){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x5cda1d[_0x3b90('0xf')]['message']);return _0x42efe8(_0x5cda1d['error'][_0x3b90('0x11')]);}logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x55792c,_0x5cda1d[_0x3b90('0xf')][_0x3b90('0x11')]);return _0x2e4c06(_0x5cda1d['error']['message']);}else{logger[_0x3b90('0x12')](_0x3b90('0x10'),_0x55792c,_0x3b90('0xe'));_0x2e4c06(_0x5cda1d[_0x3b90('0x13')][_0x3b90('0x11')]);}})['catch'](function(_0x494970){logger[_0x3b90('0xf')](_0x3b90('0x10'),_0x55792c,_0x494970);_0x42efe8(_0x494970);});});}exports['GetSalesforceAccount']=function(_0x269488){var _0x3cf281=this;return new Promise(function(_0x11ad7d,_0x131f3f){return db['SalesforceAccount'][_0x3b90('0x14')]({'raw':_0x269488['options']?_0x269488[_0x3b90('0x15')][_0x3b90('0x16')]===undefined?!![]:![]:!![],'where':_0x269488['options']?_0x269488[_0x3b90('0x15')][_0x3b90('0x17')]||null:null,'attributes':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')][_0x3b90('0x18')]||null:null,'limit':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')][_0x3b90('0x19')]||null:null,'include':_0x269488[_0x3b90('0x15')]?_0x269488[_0x3b90('0x15')]['include']?_[_0x3b90('0x1a')](_0x269488[_0x3b90('0x15')][_0x3b90('0x1b')],function(_0x7faee){return{'model':db[_0x7faee[_0x3b90('0x1c')]],'as':_0x7faee['as'],'attributes':_0x7faee[_0x3b90('0x18')],'include':_0x7faee['include']?_['map'](_0x7faee[_0x3b90('0x1b')],function(_0x29d472){return{'model':db[_0x29d472[_0x3b90('0x1c')]],'as':_0x29d472['as'],'attributes':_0x29d472[_0x3b90('0x18')],'include':_0x29d472['include']?_[_0x3b90('0x1a')](_0x29d472[_0x3b90('0x1b')],function(_0x1787d1){return{'model':db[_0x1787d1['model']],'as':_0x1787d1['as'],'attributes':_0x1787d1[_0x3b90('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b90('0x1d')](function(_0x17ec7f){logger[_0x3b90('0x12')](_0x3b90('0x1e'),_0x269488);logger[_0x3b90('0x1f')]('GetSalesforceAccount',_0x269488,JSON[_0x3b90('0x20')](_0x17ec7f));_0x11ad7d(_0x17ec7f);})['catch'](function(_0xaf453c){logger[_0x3b90('0xf')](_0x3b90('0x1e'),_0xaf453c[_0x3b90('0x11')],_0x269488);_0x131f3f(_0x3cf281[_0x3b90('0xf')](0x1f4,_0xaf453c[_0x3b90('0x11')]));});});};exports[_0x3b90('0x21')]=function(_0x2430ec){var _0x500ceb=this;return new Promise(function(_0x4d1f31,_0x43bd4f){return db[_0x3b90('0x22')][_0x3b90('0x23')]({'raw':_0x2430ec[_0x3b90('0x15')]?_0x2430ec['options']['raw']===undefined?!![]:![]:!![],'where':_0x2430ec[_0x3b90('0x15')]?_0x2430ec[_0x3b90('0x15')][_0x3b90('0x17')]||null:null,'attributes':_0x2430ec['options']?_0x2430ec[_0x3b90('0x15')]['attributes']||null:null,'include':_0x2430ec['options']?_0x2430ec[_0x3b90('0x15')][_0x3b90('0x1b')]?_['map'](_0x2430ec[_0x3b90('0x15')][_0x3b90('0x1b')],function(_0x3e30b8){return{'model':db[_0x3e30b8['model']],'as':_0x3e30b8['as'],'attributes':_0x3e30b8['attributes'],'include':_0x3e30b8[_0x3b90('0x1b')]?_[_0x3b90('0x1a')](_0x3e30b8[_0x3b90('0x1b')],function(_0x401dc5){return{'model':db[_0x401dc5['model']],'as':_0x401dc5['as'],'attributes':_0x401dc5['attributes'],'include':_0x401dc5[_0x3b90('0x1b')]?_[_0x3b90('0x1a')](_0x401dc5['include'],function(_0x57946d){return{'model':db[_0x57946d[_0x3b90('0x1c')]],'as':_0x57946d['as'],'attributes':_0x57946d[_0x3b90('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b90('0x1d')](function(_0x298df6){logger['info'](_0x3b90('0x21'),_0x2430ec);logger['debug'](_0x3b90('0x21'),_0x2430ec,JSON[_0x3b90('0x20')](_0x298df6));_0x4d1f31(_0x298df6);})[_0x3b90('0x24')](function(_0x20abf8){logger[_0x3b90('0xf')](_0x3b90('0x21'),_0x20abf8[_0x3b90('0x11')],_0x2430ec);_0x43bd4f(_0x500ceb['error'](0x1f4,_0x20abf8[_0x3b90('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index f3cf760..ce841c9 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 _0x4f1b=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','create','update','delete','destroy','exports','multer','util','path'];(function(_0x1de48b,_0x78c2b4){var _0x2434ad=function(_0x70cb68){while(--_0x70cb68){_0x1de48b['push'](_0x1de48b['shift']());}};_0x2434ad(++_0x78c2b4);}(_0x4f1b,0x1a1));var _0xb4f1=function(_0x1a5adc,_0x1c83b0){_0x1a5adc=_0x1a5adc-0x0;var _0x2c8071=_0x4f1b[_0x1a5adc];return _0x2c8071;};'use strict';var multer=require(_0xb4f1('0x0'));var util=require(_0xb4f1('0x1'));var path=require(_0xb4f1('0x2'));var timeout=require(_0xb4f1('0x3'));var express=require('express');var router=express[_0xb4f1('0x4')]();var auth=require(_0xb4f1('0x5'));var interaction=require(_0xb4f1('0x6'));var config=require(_0xb4f1('0x7'));var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0xb4f1('0x8')](),controller['index']);router[_0xb4f1('0x9')](_0xb4f1('0xa'),auth[_0xb4f1('0x8')](),controller['show']);router[_0xb4f1('0x9')]('/:id/fields',auth['isAuthenticated'](),controller[_0xb4f1('0xb')]);router[_0xb4f1('0x9')](_0xb4f1('0xc'),auth[_0xb4f1('0x8')](),controller[_0xb4f1('0xd')]);router[_0xb4f1('0x9')](_0xb4f1('0xe'),auth[_0xb4f1('0x8')](),controller['getDescriptions']);router['post']('/',auth[_0xb4f1('0x8')](),controller[_0xb4f1('0xf')]);router['put'](_0xb4f1('0xa'),auth['isAuthenticated'](),controller[_0xb4f1('0x10')]);router[_0xb4f1('0x11')]('/:id',auth[_0xb4f1('0x8')](),controller[_0xb4f1('0x12')]);module[_0xb4f1('0x13')]=router; \ No newline at end of file +var _0x14ef=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSalesforceConfiguration.controller','isAuthenticated','index','/:id','show','get','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','delete','destroy'];(function(_0x5e5ee1,_0x469020){var _0x1cb070=function(_0xca82b3){while(--_0xca82b3){_0x5e5ee1['push'](_0x5e5ee1['shift']());}};_0x1cb070(++_0x469020);}(_0x14ef,0xa1));var _0xf14e=function(_0x3ebb69,_0x3e612e){_0x3ebb69=_0x3ebb69-0x0;var _0x421e59=_0x14ef[_0x3ebb69];return _0x421e59;};'use strict';var multer=require(_0xf14e('0x0'));var util=require('util');var path=require(_0xf14e('0x1'));var timeout=require(_0xf14e('0x2'));var express=require(_0xf14e('0x3'));var router=express[_0xf14e('0x4')]();var auth=require(_0xf14e('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf14e('0x6'));var controller=require(_0xf14e('0x7'));router['get']('/',auth[_0xf14e('0x8')](),controller[_0xf14e('0x9')]);router['get'](_0xf14e('0xa'),auth['isAuthenticated'](),controller[_0xf14e('0xb')]);router[_0xf14e('0xc')](_0xf14e('0xd'),auth[_0xf14e('0x8')](),controller[_0xf14e('0xe')]);router['get'](_0xf14e('0xf'),auth['isAuthenticated'](),controller[_0xf14e('0x10')]);router[_0xf14e('0xc')](_0xf14e('0x11'),auth[_0xf14e('0x8')](),controller[_0xf14e('0x12')]);router[_0xf14e('0x13')]('/',auth[_0xf14e('0x8')](),controller['create']);router[_0xf14e('0x14')](_0xf14e('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xf14e('0x15')](_0xf14e('0xa'),auth[_0xf14e('0x8')](),controller[_0xf14e('0x16')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 4531e6e..4a3d61d 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 _0xb175=['lead','sequelize','STRING','ENUM','contact_lead','nothing','contact'];(function(_0x429948,_0x1a6851){var _0x35d5d1=function(_0x574853){while(--_0x574853){_0x429948['push'](_0x429948['shift']());}};_0x35d5d1(++_0x1a6851);}(_0xb175,0xda));var _0x5b17=function(_0x54ebd2,_0x5b5614){_0x54ebd2=_0x54ebd2-0x0;var _0x26f66a=_0xb175[_0x54ebd2];return _0x26f66a;};'use strict';var Sequelize=require(_0x5b17('0x0'));module['exports']={'name':{'type':Sequelize[_0x5b17('0x1')]},'description':{'type':Sequelize[_0x5b17('0x1')]},'ticketType':{'type':Sequelize[_0x5b17('0x2')]('Task','Case'),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x5b17('0x2')](_0x5b17('0x3'),'contact','lead'),'defaultValue':_0x5b17('0x3')},'moduleCreate':{'type':Sequelize['ENUM'](_0x5b17('0x4'),_0x5b17('0x5'),_0x5b17('0x6')),'defaultValue':_0x5b17('0x6')}}; \ No newline at end of file +var _0xac35=['nothing','sequelize','STRING','Task','contact_lead','contact','lead','ENUM'];(function(_0x2442b0,_0x392abf){var _0x346ec8=function(_0x4554ce){while(--_0x4554ce){_0x2442b0['push'](_0x2442b0['shift']());}};_0x346ec8(++_0x392abf);}(_0xac35,0x199));var _0x5ac3=function(_0x25ea34,_0x12c37e){_0x25ea34=_0x25ea34-0x0;var _0x5c1b04=_0xac35[_0x25ea34];return _0x5c1b04;};'use strict';var Sequelize=require(_0x5ac3('0x0'));module['exports']={'name':{'type':Sequelize[_0x5ac3('0x1')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x5ac3('0x2'),'Case'),'defaultValue':_0x5ac3('0x2')},'moduleSearch':{'type':Sequelize['ENUM'](_0x5ac3('0x3'),_0x5ac3('0x4'),_0x5ac3('0x5')),'defaultValue':_0x5ac3('0x3')},'moduleCreate':{'type':Sequelize[_0x5ac3('0x6')](_0x5ac3('0x7'),_0x5ac3('0x4'),_0x5ac3('0x5')),'defaultValue':_0x5ac3('0x5')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 44cdf4b..a7c792f 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 _0x19ef=['request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','stack','name','send','index','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','options','includeAll','rows','show','params','include','find','create','body','getFields','SalesforceField','findOne','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0x19ef,0x1bb));var _0xf19e=function(_0x5b2a7c,_0xa75601){_0x5b2a7c=_0x5b2a7c-0x0;var _0x4d7661=_0x19ef[_0x5b2a7c];return _0x4d7661;};'use strict';var pdf=require(_0xf19e('0x0'));var emlformat=require(_0xf19e('0x1'));var rimraf=require(_0xf19e('0x2'));var zipdir=require(_0xf19e('0x3'));var jsonpatch=require(_0xf19e('0x4'));var rp=require(_0xf19e('0x5'));var moment=require(_0xf19e('0x6'));var BPromise=require(_0xf19e('0x7'));var Mustache=require(_0xf19e('0x8'));var util=require(_0xf19e('0x9'));var path=require(_0xf19e('0xa'));var sox=require(_0xf19e('0xb'));var csv=require(_0xf19e('0xc'));var ejs=require(_0xf19e('0xd'));var fs=require('fs');var _=require(_0xf19e('0xe'));var squel=require(_0xf19e('0xf'));var crypto=require(_0xf19e('0x10'));var jsforce=require(_0xf19e('0x11'));var deskjs=require(_0xf19e('0x12'));var toCsv=require(_0xf19e('0xc'));var querystring=require(_0xf19e('0x13'));var Papa=require(_0xf19e('0x14'));var Redis=require(_0xf19e('0x15'));var authService=require(_0xf19e('0x16'));var qs=require(_0xf19e('0x17'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf19e('0x18'));var logger=require(_0xf19e('0x19'))('api');var utils=require(_0xf19e('0x1a'));var config=require(_0xf19e('0x1b'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf19e('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x5db35b,_0x683707,_0x113aae){if(_0x113aae){var _0x618481=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x618481[_0xf19e('0x1d')](_0x683707)){return _0x5db35b;}else{throw new db[(_0xf19e('0x1e'))]['ValidationError'](_0xf19e('0x1f'));}}else{return _0x5db35b;}}function respondWithRpcPromise(_0x536cdd,_0x3d59f2,_0x1f7300,_0x4c0941){return new BPromise(function(_0x15d5f2,_0x419510){var _0x5e3a4b=_0x4c0941||client;return _0x5e3a4b[_0xf19e('0x20')](_0x536cdd,_0x1f7300)[_0xf19e('0x21')](function(_0x132b79){logger[_0xf19e('0x22')](_0xf19e('0x23'),_0x3d59f2,_0xf19e('0x24'));logger['debug'](_0xf19e('0x25'),_0x3d59f2,_0xf19e('0x24'),JSON['stringify'](_0x132b79));if(_0x132b79[_0xf19e('0x26')]){if(_0x132b79[_0xf19e('0x26')][_0xf19e('0x27')]===0x1f4){logger[_0xf19e('0x26')](_0xf19e('0x23'),_0x3d59f2,_0x132b79['error'][_0xf19e('0x28')]);return _0x419510(_0x132b79[_0xf19e('0x26')][_0xf19e('0x28')]);}logger[_0xf19e('0x26')](_0xf19e('0x23'),_0x3d59f2,_0x132b79[_0xf19e('0x26')]['message']);return _0x15d5f2(_0x132b79[_0xf19e('0x26')]['message']);}else{logger[_0xf19e('0x22')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d59f2,_0xf19e('0x24'));_0x15d5f2(_0x132b79[_0xf19e('0x29')][_0xf19e('0x28')]);}})[_0xf19e('0x2a')](function(_0x52438a){logger[_0xf19e('0x26')]('SalesforceConfiguration,\x20%s,\x20%s',_0x3d59f2,_0x52438a);_0x419510(_0x52438a);});});}function respondWithStatusCode(_0x3e8214,_0x1756fe){_0x1756fe=_0x1756fe||0xcc;return function(_0x313b81){if(_0x313b81){return _0x3e8214[_0xf19e('0x2b')](_0x1756fe);}return _0x3e8214[_0xf19e('0x2c')](_0x1756fe)[_0xf19e('0x2d')]();};}function respondWithResult(_0xfc9fa8,_0x1302d5){_0x1302d5=_0x1302d5||0xc8;return function(_0x147d6d){if(_0x147d6d){return _0xfc9fa8['status'](_0x1302d5)[_0xf19e('0x2e')](_0x147d6d);}};}function respondWithFilteredResult(_0xe895a9,_0x385c7b){return function(_0x1bd618){if(_0x1bd618){var _0x5b522f=_0x1bd618[_0xf19e('0x2f')],_0x4e8406=_0x385c7b[_0xf19e('0x30')],_0x38e558=_0x385c7b[_0xf19e('0x30')]+_0x385c7b[_0xf19e('0x31')],_0x3a912a;if(_0x38e558>=_0x5b522f){_0x38e558=_0x5b522f;_0x3a912a=0xc8;}else{_0x3a912a=0xce;}_0xe895a9[_0xf19e('0x2c')](_0x3a912a);return _0xe895a9['set'](_0xf19e('0x32'),_0x4e8406+'-'+_0x38e558+'/'+_0x5b522f)[_0xf19e('0x2e')](_0x1bd618);}return null;};}function patchUpdates(_0x29f949){return function(_0x51e056){try{jsonpatch[_0xf19e('0x33')](_0x51e056,_0x29f949,!![]);}catch(_0x47d0b5){return BPromise[_0xf19e('0x34')](_0x47d0b5);}return _0x51e056['save']();};}function saveUpdates(_0x4a061a,_0x2c125c){return function(_0x2a7ac6){if(_0x2a7ac6){return _0x2a7ac6[_0xf19e('0x35')](_0x4a061a)[_0xf19e('0x21')](function(_0x481061){return _0x481061;});}return null;};}function removeEntity(_0x40871c,_0x1446b4){return function(_0x574891){if(_0x574891){return _0x574891[_0xf19e('0x36')]()[_0xf19e('0x21')](function(){_0x40871c[_0xf19e('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2320dc,_0xb92d93){return function(_0x3fa1e7){if(!_0x3fa1e7){_0x2320dc['sendStatus'](0x194);}return _0x3fa1e7;};}function handleError(_0x48eef6,_0xd04b27){_0xd04b27=_0xd04b27||0x1f4;return function(_0x21f372){logger['error'](_0x21f372[_0xf19e('0x37')]);if(_0x21f372[_0xf19e('0x38')]){delete _0x21f372[_0xf19e('0x38')];}_0x48eef6[_0xf19e('0x2c')](_0xd04b27)[_0xf19e('0x39')](_0x21f372);};}exports[_0xf19e('0x3a')]=function(_0x317ed3,_0x2d97b6){var _0x20a817={},_0x4f5fef={},_0x55e455={'count':0x0,'rows':[]};var _0x562568=_['map'](db[_0xf19e('0x3b')][_0xf19e('0x3c')],function(_0xc99fb1){return{'name':_0xc99fb1[_0xf19e('0x3d')],'type':_0xc99fb1[_0xf19e('0x3e')][_0xf19e('0x3f')]};});_0x4f5fef[_0xf19e('0x40')]=_[_0xf19e('0x41')](_0x562568,'name');_0x4f5fef['query']=_[_0xf19e('0x42')](_0x317ed3['query']);_0x4f5fef[_0xf19e('0x43')]=_[_0xf19e('0x44')](_0x4f5fef[_0xf19e('0x40')],_0x4f5fef[_0xf19e('0x45')]);_0x20a817['attributes']=_['intersection'](_0x4f5fef[_0xf19e('0x40')],qs[_0xf19e('0x46')](_0x317ed3[_0xf19e('0x45')][_0xf19e('0x46')]));_0x20a817[_0xf19e('0x47')]=_0x20a817['attributes'][_0xf19e('0x48')]?_0x20a817[_0xf19e('0x47')]:_0x4f5fef[_0xf19e('0x40')];if(!_0x317ed3[_0xf19e('0x45')][_0xf19e('0x49')](_0xf19e('0x4a'))){_0x20a817[_0xf19e('0x31')]=qs[_0xf19e('0x31')](_0x317ed3[_0xf19e('0x45')][_0xf19e('0x31')]);_0x20a817[_0xf19e('0x30')]=qs['offset'](_0x317ed3[_0xf19e('0x45')][_0xf19e('0x30')]);}_0x20a817[_0xf19e('0x4b')]=qs[_0xf19e('0x4c')](_0x317ed3[_0xf19e('0x45')][_0xf19e('0x4c')]);_0x20a817['where']=qs[_0xf19e('0x43')](_[_0xf19e('0x4d')](_0x317ed3[_0xf19e('0x45')],_0x4f5fef['filters']));if(_0x317ed3['query'][_0xf19e('0x4e')]){_0x20a817[_0xf19e('0x4f')]=_[_0xf19e('0x50')](_0x20a817[_0xf19e('0x4f')],{'$or':_[_0xf19e('0x41')](_0x562568,function(_0x1a5361){if(_0x1a5361[_0xf19e('0x3e')]!=='VIRTUAL'){var _0x45465e={};_0x45465e[_0x1a5361[_0xf19e('0x38')]]={'$like':'%'+_0x317ed3['query'][_0xf19e('0x4e')]+'%'};return _0x45465e;}})});}_0x20a817=_[_0xf19e('0x50')]({},_0x20a817,_0x317ed3[_0xf19e('0x51')]);var _0x10b912={'where':_0x20a817[_0xf19e('0x4f')]};return db[_0xf19e('0x3b')][_0xf19e('0x2f')](_0x10b912)[_0xf19e('0x21')](function(_0x12eb5b){_0x55e455['count']=_0x12eb5b;if(_0x317ed3['query'][_0xf19e('0x52')]){_0x20a817['include']=[{'all':!![]}];}return db[_0xf19e('0x3b')]['findAll'](_0x20a817);})[_0xf19e('0x21')](function(_0x2c1a4e){_0x55e455[_0xf19e('0x53')]=_0x2c1a4e;return _0x55e455;})[_0xf19e('0x21')](respondWithFilteredResult(_0x2d97b6,_0x20a817))[_0xf19e('0x2a')](handleError(_0x2d97b6,null));};exports[_0xf19e('0x54')]=function(_0x2bceb7,_0x1b6adb){var _0x3cf0e3={'raw':![],'where':{'id':_0x2bceb7[_0xf19e('0x55')]['id']}},_0x3953e1={};_0x3953e1[_0xf19e('0x40')]=_[_0xf19e('0x42')](db[_0xf19e('0x3b')][_0xf19e('0x3c')]);_0x3953e1['query']=_['keys'](_0x2bceb7['query']);_0x3953e1[_0xf19e('0x43')]=_['intersection'](_0x3953e1[_0xf19e('0x40')],_0x3953e1['query']);_0x3cf0e3[_0xf19e('0x47')]=_[_0xf19e('0x44')](_0x3953e1[_0xf19e('0x40')],qs['fields'](_0x2bceb7[_0xf19e('0x45')][_0xf19e('0x46')]));_0x3cf0e3[_0xf19e('0x47')]=_0x3cf0e3[_0xf19e('0x47')][_0xf19e('0x48')]?_0x3cf0e3['attributes']:_0x3953e1['model'];if(_0x2bceb7[_0xf19e('0x45')][_0xf19e('0x52')]){_0x3cf0e3[_0xf19e('0x56')]=[{'all':!![]}];}_0x3cf0e3=_['merge']({},_0x3cf0e3,_0x2bceb7['options']);return db[_0xf19e('0x3b')][_0xf19e('0x57')](_0x3cf0e3)[_0xf19e('0x21')](handleEntityNotFound(_0x1b6adb,null))[_0xf19e('0x21')](respondWithResult(_0x1b6adb,null))[_0xf19e('0x2a')](handleError(_0x1b6adb,null));};exports[_0xf19e('0x58')]=function(_0x4eaeb6,_0x5ba0b3){return db[_0xf19e('0x3b')]['create'](_0x4eaeb6[_0xf19e('0x59')],{})['then'](respondWithResult(_0x5ba0b3,0xc9))[_0xf19e('0x2a')](handleError(_0x5ba0b3,null));};exports[_0xf19e('0x35')]=function(_0xcf3826,_0x5ec3fc){if(_0xcf3826['body']['id']){delete _0xcf3826[_0xf19e('0x59')]['id'];}return db[_0xf19e('0x3b')][_0xf19e('0x57')]({'where':{'id':_0xcf3826[_0xf19e('0x55')]['id']}})[_0xf19e('0x21')](handleEntityNotFound(_0x5ec3fc,null))['then'](saveUpdates(_0xcf3826[_0xf19e('0x59')],null))[_0xf19e('0x21')](respondWithResult(_0x5ec3fc,null))[_0xf19e('0x2a')](handleError(_0x5ec3fc,null));};exports[_0xf19e('0x36')]=function(_0x2b1c7d,_0x1335a9){return db[_0xf19e('0x3b')][_0xf19e('0x57')]({'where':{'id':_0x2b1c7d[_0xf19e('0x55')]['id']}})[_0xf19e('0x21')](handleEntityNotFound(_0x1335a9,null))[_0xf19e('0x21')](removeEntity(_0x1335a9,null))[_0xf19e('0x2a')](handleError(_0x1335a9,null));};exports[_0xf19e('0x5a')]=function(_0x615f0e,_0x2bb7ca,_0x567d08){var _0x65edd1={};var _0x2b2657={};var _0x4061e0;var _0xb02938;return db['SalesforceConfiguration']['findOne']({'where':{'id':_0x615f0e[_0xf19e('0x55')]['id']}})['then'](handleEntityNotFound(_0x2bb7ca,null))['then'](function(_0x16a1cc){if(_0x16a1cc){_0x4061e0=_0x16a1cc;_0x2b2657['model']=_[_0xf19e('0x42')](db[_0xf19e('0x5b')]['rawAttributes']);_0x2b2657[_0xf19e('0x45')]=_['keys'](_0x615f0e[_0xf19e('0x45')]);_0x2b2657[_0xf19e('0x43')]=_[_0xf19e('0x44')](_0x2b2657['model'],_0x2b2657[_0xf19e('0x45')]);_0x65edd1[_0xf19e('0x47')]=_[_0xf19e('0x44')](_0x2b2657[_0xf19e('0x40')],qs[_0xf19e('0x46')](_0x615f0e[_0xf19e('0x45')][_0xf19e('0x46')]));_0x65edd1[_0xf19e('0x47')]=_0x65edd1[_0xf19e('0x47')][_0xf19e('0x48')]?_0x65edd1[_0xf19e('0x47')]:_0x2b2657['model'];_0x65edd1['order']=qs['sort'](_0x615f0e['query'][_0xf19e('0x4c')]);_0x65edd1[_0xf19e('0x4f')]=qs[_0xf19e('0x43')](_[_0xf19e('0x4d')](_0x615f0e['query'],_0x2b2657['filters']));if(_0x615f0e[_0xf19e('0x45')][_0xf19e('0x4e')]){_0x65edd1[_0xf19e('0x4f')]=_[_0xf19e('0x50')](_0x65edd1['where'],{'$or':_[_0xf19e('0x41')](_0x65edd1['attributes'],function(_0x59af20){var _0x2dbfdc={};_0x2dbfdc[_0x59af20]={'$like':'%'+_0x615f0e[_0xf19e('0x45')][_0xf19e('0x4e')]+'%'};return _0x2dbfdc;})});}_0x65edd1=_[_0xf19e('0x50')]({},_0x65edd1,_0x615f0e[_0xf19e('0x51')]);return _0x4061e0[_0xf19e('0x5a')](_0x65edd1);}})[_0xf19e('0x21')](function(_0x2b618a){if(_0x2b618a){_0xb02938=_0x2b618a[_0xf19e('0x48')];if(!_0x615f0e['query']['hasOwnProperty'](_0xf19e('0x4a'))){_0x65edd1[_0xf19e('0x31')]=qs['limit'](_0x615f0e[_0xf19e('0x45')][_0xf19e('0x31')]);_0x65edd1[_0xf19e('0x30')]=qs[_0xf19e('0x30')](_0x615f0e[_0xf19e('0x45')][_0xf19e('0x30')]);}return _0x4061e0[_0xf19e('0x5a')](_0x65edd1);}})['then'](function(_0x2b1af4){if(_0x2b1af4){return _0x2b1af4?{'count':_0xb02938,'rows':_0x2b1af4}:null;}})[_0xf19e('0x21')](respondWithResult(_0x2bb7ca,null))[_0xf19e('0x2a')](handleError(_0x2bb7ca,null));};exports['getSubjects']=function(_0xf3b54f,_0x461413,_0x373b5e){var _0x122777={};var _0x44b288={};var _0x2bca84;var _0x5900a4;return db[_0xf19e('0x3b')][_0xf19e('0x5c')]({'where':{'id':_0xf3b54f[_0xf19e('0x55')]['id']}})['then'](handleEntityNotFound(_0x461413,null))[_0xf19e('0x21')](function(_0x247ee1){if(_0x247ee1){_0x2bca84=_0x247ee1;_0x44b288[_0xf19e('0x40')]=_[_0xf19e('0x42')](db['SalesforceField'][_0xf19e('0x3c')]);_0x44b288[_0xf19e('0x45')]=_['keys'](_0xf3b54f['query']);_0x44b288[_0xf19e('0x43')]=_[_0xf19e('0x44')](_0x44b288[_0xf19e('0x40')],_0x44b288['query']);_0x122777[_0xf19e('0x47')]=_[_0xf19e('0x44')](_0x44b288[_0xf19e('0x40')],qs[_0xf19e('0x46')](_0xf3b54f['query'][_0xf19e('0x46')]));_0x122777[_0xf19e('0x47')]=_0x122777[_0xf19e('0x47')][_0xf19e('0x48')]?_0x122777[_0xf19e('0x47')]:_0x44b288[_0xf19e('0x40')];_0x122777[_0xf19e('0x4b')]=qs[_0xf19e('0x4c')](_0xf3b54f[_0xf19e('0x45')][_0xf19e('0x4c')]);_0x122777[_0xf19e('0x4f')]=qs[_0xf19e('0x43')](_[_0xf19e('0x4d')](_0xf3b54f[_0xf19e('0x45')],_0x44b288['filters']));if(_0xf3b54f['query'][_0xf19e('0x4e')]){_0x122777[_0xf19e('0x4f')]=_[_0xf19e('0x50')](_0x122777[_0xf19e('0x4f')],{'$or':_[_0xf19e('0x41')](_0x122777[_0xf19e('0x47')],function(_0x557c62){var _0x48c7ba={};_0x48c7ba[_0x557c62]={'$like':'%'+_0xf3b54f[_0xf19e('0x45')]['filter']+'%'};return _0x48c7ba;})});}_0x122777=_[_0xf19e('0x50')]({},_0x122777,_0xf3b54f[_0xf19e('0x51')]);return _0x2bca84['getSubjects'](_0x122777);}})[_0xf19e('0x21')](function(_0x3afa67){if(_0x3afa67){_0x5900a4=_0x3afa67[_0xf19e('0x48')];if(!_0xf3b54f['query'][_0xf19e('0x49')](_0xf19e('0x4a'))){_0x122777[_0xf19e('0x31')]=qs['limit'](_0xf3b54f[_0xf19e('0x45')]['limit']);_0x122777['offset']=qs[_0xf19e('0x30')](_0xf3b54f[_0xf19e('0x45')][_0xf19e('0x30')]);}return _0x2bca84[_0xf19e('0x5d')](_0x122777);}})[_0xf19e('0x21')](function(_0x12bdaf){if(_0x12bdaf){return _0x12bdaf?{'count':_0x5900a4,'rows':_0x12bdaf}:null;}})[_0xf19e('0x21')](respondWithResult(_0x461413,null))[_0xf19e('0x2a')](handleError(_0x461413,null));};exports[_0xf19e('0x5e')]=function(_0xf5019a,_0x3de7b5,_0x202e2a){var _0x346aa4={};var _0x4e72f6={};var _0x537840;var _0x1336e1;return db[_0xf19e('0x3b')][_0xf19e('0x5c')]({'where':{'id':_0xf5019a[_0xf19e('0x55')]['id']}})[_0xf19e('0x21')](handleEntityNotFound(_0x3de7b5,null))['then'](function(_0xf45777){if(_0xf45777){_0x537840=_0xf45777;_0x4e72f6['model']=_[_0xf19e('0x42')](db[_0xf19e('0x5b')][_0xf19e('0x3c')]);_0x4e72f6['query']=_[_0xf19e('0x42')](_0xf5019a[_0xf19e('0x45')]);_0x4e72f6['filters']=_[_0xf19e('0x44')](_0x4e72f6[_0xf19e('0x40')],_0x4e72f6['query']);_0x346aa4[_0xf19e('0x47')]=_[_0xf19e('0x44')](_0x4e72f6[_0xf19e('0x40')],qs[_0xf19e('0x46')](_0xf5019a[_0xf19e('0x45')][_0xf19e('0x46')]));_0x346aa4[_0xf19e('0x47')]=_0x346aa4[_0xf19e('0x47')][_0xf19e('0x48')]?_0x346aa4[_0xf19e('0x47')]:_0x4e72f6[_0xf19e('0x40')];_0x346aa4[_0xf19e('0x4b')]=qs[_0xf19e('0x4c')](_0xf5019a[_0xf19e('0x45')][_0xf19e('0x4c')]);_0x346aa4[_0xf19e('0x4f')]=qs[_0xf19e('0x43')](_[_0xf19e('0x4d')](_0xf5019a[_0xf19e('0x45')],_0x4e72f6[_0xf19e('0x43')]));if(_0xf5019a[_0xf19e('0x45')][_0xf19e('0x4e')]){_0x346aa4[_0xf19e('0x4f')]=_[_0xf19e('0x50')](_0x346aa4[_0xf19e('0x4f')],{'$or':_[_0xf19e('0x41')](_0x346aa4[_0xf19e('0x47')],function(_0x1ab073){var _0x18ec48={};_0x18ec48[_0x1ab073]={'$like':'%'+_0xf5019a[_0xf19e('0x45')][_0xf19e('0x4e')]+'%'};return _0x18ec48;})});}_0x346aa4=_[_0xf19e('0x50')]({},_0x346aa4,_0xf5019a[_0xf19e('0x51')]);return _0x537840[_0xf19e('0x5e')](_0x346aa4);}})[_0xf19e('0x21')](function(_0x5c7755){if(_0x5c7755){_0x1336e1=_0x5c7755['length'];if(!_0xf5019a[_0xf19e('0x45')][_0xf19e('0x49')]('nolimit')){_0x346aa4[_0xf19e('0x31')]=qs[_0xf19e('0x31')](_0xf5019a[_0xf19e('0x45')][_0xf19e('0x31')]);_0x346aa4[_0xf19e('0x30')]=qs[_0xf19e('0x30')](_0xf5019a[_0xf19e('0x45')][_0xf19e('0x30')]);}return _0x537840[_0xf19e('0x5e')](_0x346aa4);}})[_0xf19e('0x21')](function(_0x5ba50b){if(_0x5ba50b){return _0x5ba50b?{'count':_0x1336e1,'rows':_0x5ba50b}:null;}})[_0xf19e('0x21')](respondWithResult(_0x3de7b5,null))[_0xf19e('0x2a')](handleError(_0x3de7b5,null));}; \ No newline at end of file +var _0x1f11=['findAll','rows','show','params','fields','includeAll','merge','find','create','body','getFields','findOne','SalesforceField','pick','getSubjects','nolimit','getDescriptions','html-pdf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','ValidationError','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','name','index','map','SalesforceConfiguration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','VIRTUAL','options','include'];(function(_0x24f197,_0x521b01){var _0x156bfe=function(_0x8a16){while(--_0x8a16){_0x24f197['push'](_0x24f197['shift']());}};_0x156bfe(++_0x521b01);}(_0x1f11,0x1d3));var _0x11f1=function(_0x5cc4bc,_0x38e8d5){_0x5cc4bc=_0x5cc4bc-0x0;var _0x1632eb=_0x1f11[_0x5cc4bc];return _0x1632eb;};'use strict';var pdf=require(_0x11f1('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x11f1('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x11f1('0x2'));var moment=require(_0x11f1('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x11f1('0x4'));var util=require(_0x11f1('0x5'));var path=require(_0x11f1('0x6'));var sox=require('sox');var csv=require(_0x11f1('0x7'));var ejs=require(_0x11f1('0x8'));var fs=require('fs');var _=require(_0x11f1('0x9'));var squel=require(_0x11f1('0xa'));var crypto=require('crypto');var jsforce=require(_0x11f1('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x11f1('0x7'));var querystring=require(_0x11f1('0xc'));var Papa=require(_0x11f1('0xd'));var Redis=require(_0x11f1('0xe'));var authService=require(_0x11f1('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x11f1('0x10'));var hardwareService=require(_0x11f1('0x11'));var logger=require(_0x11f1('0x12'))(_0x11f1('0x13'));var utils=require(_0x11f1('0x14'));var config=require(_0x11f1('0x15'));var db=require('../../mysqldb')['db'];var jayson=require(_0x11f1('0x16'));var client=jayson[_0x11f1('0x17')][_0x11f1('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2dee46,_0x5e08b1,_0x254441){if(_0x254441){var _0x30aaba=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30aaba[_0x11f1('0x19')](_0x5e08b1)){return _0x2dee46;}else{throw new db['Sequelize'][(_0x11f1('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2dee46;}}function respondWithRpcPromise(_0x496bd1,_0x10eb27,_0x20bb68,_0xfed7b1){return new BPromise(function(_0x269362,_0xad5ac0){var _0x5780f1=_0xfed7b1||client;return _0x5780f1[_0x11f1('0x1b')](_0x496bd1,_0x20bb68)['then'](function(_0xea15b6){logger[_0x11f1('0x1c')](_0x11f1('0x1d'),_0x10eb27,_0x11f1('0x1e'));logger[_0x11f1('0x1f')](_0x11f1('0x20'),_0x10eb27,_0x11f1('0x1e'),JSON[_0x11f1('0x21')](_0xea15b6));if(_0xea15b6[_0x11f1('0x22')]){if(_0xea15b6[_0x11f1('0x22')]['code']===0x1f4){logger[_0x11f1('0x22')](_0x11f1('0x1d'),_0x10eb27,_0xea15b6[_0x11f1('0x22')]['message']);return _0xad5ac0(_0xea15b6[_0x11f1('0x22')][_0x11f1('0x23')]);}logger['error'](_0x11f1('0x1d'),_0x10eb27,_0xea15b6[_0x11f1('0x22')]['message']);return _0x269362(_0xea15b6['error'][_0x11f1('0x23')]);}else{logger[_0x11f1('0x1c')](_0x11f1('0x1d'),_0x10eb27,_0x11f1('0x1e'));_0x269362(_0xea15b6['result'][_0x11f1('0x23')]);}})[_0x11f1('0x24')](function(_0x5794fe){logger['error']('SalesforceConfiguration,\x20%s,\x20%s',_0x10eb27,_0x5794fe);_0xad5ac0(_0x5794fe);});});}function respondWithStatusCode(_0x3f8d89,_0x334a73){_0x334a73=_0x334a73||0xcc;return function(_0x428cbc){if(_0x428cbc){return _0x3f8d89[_0x11f1('0x25')](_0x334a73);}return _0x3f8d89[_0x11f1('0x26')](_0x334a73)[_0x11f1('0x27')]();};}function respondWithResult(_0x56b2a6,_0x12c351){_0x12c351=_0x12c351||0xc8;return function(_0x67e92b){if(_0x67e92b){return _0x56b2a6[_0x11f1('0x26')](_0x12c351)[_0x11f1('0x28')](_0x67e92b);}};}function respondWithFilteredResult(_0x1a0e0e,_0x78ed11){return function(_0x1eb621){if(_0x1eb621){var _0x3fe265=_0x1eb621[_0x11f1('0x29')],_0x332388=_0x78ed11[_0x11f1('0x2a')],_0x2e28d8=_0x78ed11[_0x11f1('0x2a')]+_0x78ed11[_0x11f1('0x2b')],_0x2a64ca;if(_0x2e28d8>=_0x3fe265){_0x2e28d8=_0x3fe265;_0x2a64ca=0xc8;}else{_0x2a64ca=0xce;}_0x1a0e0e[_0x11f1('0x26')](_0x2a64ca);return _0x1a0e0e[_0x11f1('0x2c')](_0x11f1('0x2d'),_0x332388+'-'+_0x2e28d8+'/'+_0x3fe265)[_0x11f1('0x28')](_0x1eb621);}return null;};}function patchUpdates(_0x1c18fb){return function(_0x5dac76){try{jsonpatch['apply'](_0x5dac76,_0x1c18fb,!![]);}catch(_0xabb66f){return BPromise[_0x11f1('0x2e')](_0xabb66f);}return _0x5dac76[_0x11f1('0x2f')]();};}function saveUpdates(_0x565117,_0x3f6461){return function(_0x35ee46){if(_0x35ee46){return _0x35ee46[_0x11f1('0x30')](_0x565117)[_0x11f1('0x31')](function(_0x5b221c){return _0x5b221c;});}return null;};}function removeEntity(_0x4fcb3f,_0x90578d){return function(_0x67f943){if(_0x67f943){return _0x67f943[_0x11f1('0x32')]()[_0x11f1('0x31')](function(){_0x4fcb3f[_0x11f1('0x26')](0xcc)[_0x11f1('0x27')]();});}};}function handleEntityNotFound(_0x398616,_0x4513f5){return function(_0x4abd8b){if(!_0x4abd8b){_0x398616['sendStatus'](0x194);}return _0x4abd8b;};}function handleError(_0xae8182,_0x330aff){_0x330aff=_0x330aff||0x1f4;return function(_0xe8a4ac){logger[_0x11f1('0x22')](_0xe8a4ac['stack']);if(_0xe8a4ac[_0x11f1('0x33')]){delete _0xe8a4ac[_0x11f1('0x33')];}_0xae8182['status'](_0x330aff)['send'](_0xe8a4ac);};}exports[_0x11f1('0x34')]=function(_0x678e6,_0x12252e){var _0x35fce0={},_0x486aad={},_0x59117e={'count':0x0,'rows':[]};var _0x5020be=_[_0x11f1('0x35')](db[_0x11f1('0x36')][_0x11f1('0x37')],function(_0x48520a){return{'name':_0x48520a['fieldName'],'type':_0x48520a[_0x11f1('0x38')][_0x11f1('0x39')]};});_0x486aad[_0x11f1('0x3a')]=_[_0x11f1('0x35')](_0x5020be,_0x11f1('0x33'));_0x486aad[_0x11f1('0x3b')]=_[_0x11f1('0x3c')](_0x678e6[_0x11f1('0x3b')]);_0x486aad[_0x11f1('0x3d')]=_[_0x11f1('0x3e')](_0x486aad[_0x11f1('0x3a')],_0x486aad['query']);_0x35fce0[_0x11f1('0x3f')]=_[_0x11f1('0x3e')](_0x486aad[_0x11f1('0x3a')],qs['fields'](_0x678e6[_0x11f1('0x3b')]['fields']));_0x35fce0[_0x11f1('0x3f')]=_0x35fce0[_0x11f1('0x3f')][_0x11f1('0x40')]?_0x35fce0[_0x11f1('0x3f')]:_0x486aad[_0x11f1('0x3a')];if(!_0x678e6[_0x11f1('0x3b')][_0x11f1('0x41')]('nolimit')){_0x35fce0['limit']=qs[_0x11f1('0x2b')](_0x678e6[_0x11f1('0x3b')][_0x11f1('0x2b')]);_0x35fce0[_0x11f1('0x2a')]=qs[_0x11f1('0x2a')](_0x678e6['query'][_0x11f1('0x2a')]);}_0x35fce0[_0x11f1('0x42')]=qs['sort'](_0x678e6[_0x11f1('0x3b')][_0x11f1('0x43')]);_0x35fce0[_0x11f1('0x44')]=qs[_0x11f1('0x3d')](_['pick'](_0x678e6[_0x11f1('0x3b')],_0x486aad[_0x11f1('0x3d')]));if(_0x678e6['query'][_0x11f1('0x45')]){_0x35fce0[_0x11f1('0x44')]=_['merge'](_0x35fce0[_0x11f1('0x44')],{'$or':_['map'](_0x5020be,function(_0x1d55ac){if(_0x1d55ac[_0x11f1('0x38')]!==_0x11f1('0x46')){var _0x1395dc={};_0x1395dc[_0x1d55ac['name']]={'$like':'%'+_0x678e6[_0x11f1('0x3b')][_0x11f1('0x45')]+'%'};return _0x1395dc;}})});}_0x35fce0=_['merge']({},_0x35fce0,_0x678e6[_0x11f1('0x47')]);var _0x36817c={'where':_0x35fce0['where']};return db['SalesforceConfiguration']['count'](_0x36817c)[_0x11f1('0x31')](function(_0x47df23){_0x59117e[_0x11f1('0x29')]=_0x47df23;if(_0x678e6['query']['includeAll']){_0x35fce0[_0x11f1('0x48')]=[{'all':!![]}];}return db[_0x11f1('0x36')][_0x11f1('0x49')](_0x35fce0);})[_0x11f1('0x31')](function(_0x2f2bd8){_0x59117e[_0x11f1('0x4a')]=_0x2f2bd8;return _0x59117e;})[_0x11f1('0x31')](respondWithFilteredResult(_0x12252e,_0x35fce0))[_0x11f1('0x24')](handleError(_0x12252e,null));};exports[_0x11f1('0x4b')]=function(_0x52802e,_0x4f5696){var _0x51d86d={'raw':![],'where':{'id':_0x52802e[_0x11f1('0x4c')]['id']}},_0x4a8957={};_0x4a8957[_0x11f1('0x3a')]=_['keys'](db['SalesforceConfiguration']['rawAttributes']);_0x4a8957[_0x11f1('0x3b')]=_[_0x11f1('0x3c')](_0x52802e['query']);_0x4a8957[_0x11f1('0x3d')]=_['intersection'](_0x4a8957[_0x11f1('0x3a')],_0x4a8957[_0x11f1('0x3b')]);_0x51d86d[_0x11f1('0x3f')]=_['intersection'](_0x4a8957[_0x11f1('0x3a')],qs[_0x11f1('0x4d')](_0x52802e[_0x11f1('0x3b')]['fields']));_0x51d86d[_0x11f1('0x3f')]=_0x51d86d[_0x11f1('0x3f')]['length']?_0x51d86d[_0x11f1('0x3f')]:_0x4a8957['model'];if(_0x52802e[_0x11f1('0x3b')][_0x11f1('0x4e')]){_0x51d86d[_0x11f1('0x48')]=[{'all':!![]}];}_0x51d86d=_[_0x11f1('0x4f')]({},_0x51d86d,_0x52802e['options']);return db[_0x11f1('0x36')][_0x11f1('0x50')](_0x51d86d)[_0x11f1('0x31')](handleEntityNotFound(_0x4f5696,null))['then'](respondWithResult(_0x4f5696,null))[_0x11f1('0x24')](handleError(_0x4f5696,null));};exports[_0x11f1('0x51')]=function(_0x425dff,_0x1b7bf8){return db[_0x11f1('0x36')][_0x11f1('0x51')](_0x425dff[_0x11f1('0x52')],{})[_0x11f1('0x31')](respondWithResult(_0x1b7bf8,0xc9))[_0x11f1('0x24')](handleError(_0x1b7bf8,null));};exports['update']=function(_0x474d2f,_0x49c811){if(_0x474d2f[_0x11f1('0x52')]['id']){delete _0x474d2f[_0x11f1('0x52')]['id'];}return db[_0x11f1('0x36')]['find']({'where':{'id':_0x474d2f['params']['id']}})[_0x11f1('0x31')](handleEntityNotFound(_0x49c811,null))[_0x11f1('0x31')](saveUpdates(_0x474d2f['body'],null))[_0x11f1('0x31')](respondWithResult(_0x49c811,null))[_0x11f1('0x24')](handleError(_0x49c811,null));};exports[_0x11f1('0x32')]=function(_0x24a6ee,_0x4ff829){return db[_0x11f1('0x36')]['find']({'where':{'id':_0x24a6ee[_0x11f1('0x4c')]['id']}})[_0x11f1('0x31')](handleEntityNotFound(_0x4ff829,null))[_0x11f1('0x31')](removeEntity(_0x4ff829,null))[_0x11f1('0x24')](handleError(_0x4ff829,null));};exports[_0x11f1('0x53')]=function(_0x178b55,_0xa7f286,_0x22e85b){var _0x35c755={};var _0x465cb9={};var _0x441ae9;var _0x2ce174;return db[_0x11f1('0x36')][_0x11f1('0x54')]({'where':{'id':_0x178b55[_0x11f1('0x4c')]['id']}})[_0x11f1('0x31')](handleEntityNotFound(_0xa7f286,null))[_0x11f1('0x31')](function(_0x123cdb){if(_0x123cdb){_0x441ae9=_0x123cdb;_0x465cb9[_0x11f1('0x3a')]=_['keys'](db[_0x11f1('0x55')][_0x11f1('0x37')]);_0x465cb9[_0x11f1('0x3b')]=_[_0x11f1('0x3c')](_0x178b55[_0x11f1('0x3b')]);_0x465cb9[_0x11f1('0x3d')]=_['intersection'](_0x465cb9[_0x11f1('0x3a')],_0x465cb9[_0x11f1('0x3b')]);_0x35c755[_0x11f1('0x3f')]=_[_0x11f1('0x3e')](_0x465cb9[_0x11f1('0x3a')],qs[_0x11f1('0x4d')](_0x178b55[_0x11f1('0x3b')][_0x11f1('0x4d')]));_0x35c755[_0x11f1('0x3f')]=_0x35c755[_0x11f1('0x3f')][_0x11f1('0x40')]?_0x35c755['attributes']:_0x465cb9[_0x11f1('0x3a')];_0x35c755['order']=qs[_0x11f1('0x43')](_0x178b55[_0x11f1('0x3b')][_0x11f1('0x43')]);_0x35c755[_0x11f1('0x44')]=qs['filters'](_[_0x11f1('0x56')](_0x178b55[_0x11f1('0x3b')],_0x465cb9[_0x11f1('0x3d')]));if(_0x178b55[_0x11f1('0x3b')][_0x11f1('0x45')]){_0x35c755[_0x11f1('0x44')]=_['merge'](_0x35c755[_0x11f1('0x44')],{'$or':_[_0x11f1('0x35')](_0x35c755[_0x11f1('0x3f')],function(_0x419c8e){var _0xfe79cc={};_0xfe79cc[_0x419c8e]={'$like':'%'+_0x178b55[_0x11f1('0x3b')][_0x11f1('0x45')]+'%'};return _0xfe79cc;})});}_0x35c755=_[_0x11f1('0x4f')]({},_0x35c755,_0x178b55['options']);return _0x441ae9[_0x11f1('0x53')](_0x35c755);}})[_0x11f1('0x31')](function(_0x140764){if(_0x140764){_0x2ce174=_0x140764[_0x11f1('0x40')];if(!_0x178b55['query'][_0x11f1('0x41')]('nolimit')){_0x35c755['limit']=qs['limit'](_0x178b55[_0x11f1('0x3b')][_0x11f1('0x2b')]);_0x35c755[_0x11f1('0x2a')]=qs[_0x11f1('0x2a')](_0x178b55[_0x11f1('0x3b')][_0x11f1('0x2a')]);}return _0x441ae9['getFields'](_0x35c755);}})[_0x11f1('0x31')](function(_0x11a1c5){if(_0x11a1c5){return _0x11a1c5?{'count':_0x2ce174,'rows':_0x11a1c5}:null;}})[_0x11f1('0x31')](respondWithResult(_0xa7f286,null))[_0x11f1('0x24')](handleError(_0xa7f286,null));};exports[_0x11f1('0x57')]=function(_0x19f584,_0x2b79c6,_0x36fb4f){var _0x4ddbdb={};var _0x2d8c5d={};var _0x584665;var _0x2f8edf;return db[_0x11f1('0x36')][_0x11f1('0x54')]({'where':{'id':_0x19f584[_0x11f1('0x4c')]['id']}})[_0x11f1('0x31')](handleEntityNotFound(_0x2b79c6,null))[_0x11f1('0x31')](function(_0x5abdf2){if(_0x5abdf2){_0x584665=_0x5abdf2;_0x2d8c5d['model']=_[_0x11f1('0x3c')](db[_0x11f1('0x55')][_0x11f1('0x37')]);_0x2d8c5d[_0x11f1('0x3b')]=_[_0x11f1('0x3c')](_0x19f584[_0x11f1('0x3b')]);_0x2d8c5d[_0x11f1('0x3d')]=_[_0x11f1('0x3e')](_0x2d8c5d[_0x11f1('0x3a')],_0x2d8c5d[_0x11f1('0x3b')]);_0x4ddbdb[_0x11f1('0x3f')]=_['intersection'](_0x2d8c5d[_0x11f1('0x3a')],qs[_0x11f1('0x4d')](_0x19f584[_0x11f1('0x3b')][_0x11f1('0x4d')]));_0x4ddbdb['attributes']=_0x4ddbdb['attributes'][_0x11f1('0x40')]?_0x4ddbdb[_0x11f1('0x3f')]:_0x2d8c5d[_0x11f1('0x3a')];_0x4ddbdb['order']=qs[_0x11f1('0x43')](_0x19f584['query'][_0x11f1('0x43')]);_0x4ddbdb[_0x11f1('0x44')]=qs[_0x11f1('0x3d')](_[_0x11f1('0x56')](_0x19f584[_0x11f1('0x3b')],_0x2d8c5d['filters']));if(_0x19f584[_0x11f1('0x3b')]['filter']){_0x4ddbdb['where']=_['merge'](_0x4ddbdb[_0x11f1('0x44')],{'$or':_[_0x11f1('0x35')](_0x4ddbdb[_0x11f1('0x3f')],function(_0x42f3f4){var _0x9c3409={};_0x9c3409[_0x42f3f4]={'$like':'%'+_0x19f584['query'][_0x11f1('0x45')]+'%'};return _0x9c3409;})});}_0x4ddbdb=_[_0x11f1('0x4f')]({},_0x4ddbdb,_0x19f584['options']);return _0x584665['getSubjects'](_0x4ddbdb);}})[_0x11f1('0x31')](function(_0x314eb3){if(_0x314eb3){_0x2f8edf=_0x314eb3[_0x11f1('0x40')];if(!_0x19f584[_0x11f1('0x3b')][_0x11f1('0x41')](_0x11f1('0x58'))){_0x4ddbdb[_0x11f1('0x2b')]=qs[_0x11f1('0x2b')](_0x19f584[_0x11f1('0x3b')][_0x11f1('0x2b')]);_0x4ddbdb[_0x11f1('0x2a')]=qs[_0x11f1('0x2a')](_0x19f584['query'][_0x11f1('0x2a')]);}return _0x584665['getSubjects'](_0x4ddbdb);}})[_0x11f1('0x31')](function(_0x5d796a){if(_0x5d796a){return _0x5d796a?{'count':_0x2f8edf,'rows':_0x5d796a}:null;}})['then'](respondWithResult(_0x2b79c6,null))[_0x11f1('0x24')](handleError(_0x2b79c6,null));};exports[_0x11f1('0x59')]=function(_0x37d750,_0xd26cdf,_0x3fa032){var _0x31b31d={};var _0x3ea4e4={};var _0x50fcb8;var _0x28fda9;return db[_0x11f1('0x36')]['findOne']({'where':{'id':_0x37d750['params']['id']}})[_0x11f1('0x31')](handleEntityNotFound(_0xd26cdf,null))[_0x11f1('0x31')](function(_0x54ca30){if(_0x54ca30){_0x50fcb8=_0x54ca30;_0x3ea4e4[_0x11f1('0x3a')]=_['keys'](db[_0x11f1('0x55')][_0x11f1('0x37')]);_0x3ea4e4['query']=_[_0x11f1('0x3c')](_0x37d750['query']);_0x3ea4e4[_0x11f1('0x3d')]=_[_0x11f1('0x3e')](_0x3ea4e4[_0x11f1('0x3a')],_0x3ea4e4[_0x11f1('0x3b')]);_0x31b31d['attributes']=_[_0x11f1('0x3e')](_0x3ea4e4[_0x11f1('0x3a')],qs['fields'](_0x37d750['query'][_0x11f1('0x4d')]));_0x31b31d[_0x11f1('0x3f')]=_0x31b31d[_0x11f1('0x3f')][_0x11f1('0x40')]?_0x31b31d[_0x11f1('0x3f')]:_0x3ea4e4[_0x11f1('0x3a')];_0x31b31d[_0x11f1('0x42')]=qs[_0x11f1('0x43')](_0x37d750[_0x11f1('0x3b')][_0x11f1('0x43')]);_0x31b31d[_0x11f1('0x44')]=qs['filters'](_['pick'](_0x37d750['query'],_0x3ea4e4['filters']));if(_0x37d750[_0x11f1('0x3b')][_0x11f1('0x45')]){_0x31b31d['where']=_[_0x11f1('0x4f')](_0x31b31d[_0x11f1('0x44')],{'$or':_[_0x11f1('0x35')](_0x31b31d['attributes'],function(_0x19d548){var _0x1a8078={};_0x1a8078[_0x19d548]={'$like':'%'+_0x37d750['query']['filter']+'%'};return _0x1a8078;})});}_0x31b31d=_[_0x11f1('0x4f')]({},_0x31b31d,_0x37d750[_0x11f1('0x47')]);return _0x50fcb8['getDescriptions'](_0x31b31d);}})[_0x11f1('0x31')](function(_0x6cc465){if(_0x6cc465){_0x28fda9=_0x6cc465[_0x11f1('0x40')];if(!_0x37d750['query'][_0x11f1('0x41')](_0x11f1('0x58'))){_0x31b31d[_0x11f1('0x2b')]=qs[_0x11f1('0x2b')](_0x37d750[_0x11f1('0x3b')][_0x11f1('0x2b')]);_0x31b31d[_0x11f1('0x2a')]=qs['offset'](_0x37d750[_0x11f1('0x3b')]['offset']);}return _0x50fcb8[_0x11f1('0x59')](_0x31b31d);}})[_0x11f1('0x31')](function(_0x7ec3a){if(_0x7ec3a){return _0x7ec3a?{'count':_0x28fda9,'rows':_0x7ec3a}:null;}})[_0x11f1('0x31')](respondWithResult(_0xd26cdf,null))['catch'](handleError(_0xd26cdf,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index dedd892..6bd97a9 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 _0x3759=['lodash','util','api','moment','bluebird','path','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations'];(function(_0x3287b9,_0x4ef619){var _0x67fcc9=function(_0x1d2d26){while(--_0x1d2d26){_0x3287b9['push'](_0x3287b9['shift']());}};_0x67fcc9(++_0x4ef619);}(_0x3759,0x12c));var _0x9375=function(_0x4a000d,_0x431f3f){_0x4a000d=_0x4a000d-0x0;var _0x55e308=_0x3759[_0x4a000d];return _0x55e308;};'use strict';var _=require(_0x9375('0x0'));var util=require(_0x9375('0x1'));var logger=require('../../config/logger')(_0x9375('0x2'));var moment=require(_0x9375('0x3'));var BPromise=require(_0x9375('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9375('0x5'));var rimraf=require('rimraf');var config=require(_0x9375('0x6'));var attributes=require(_0x9375('0x7'));module[_0x9375('0x8')]=function(_0x5dcb2a,_0x3792a7){return _0x5dcb2a[_0x9375('0x9')](_0x9375('0xa'),attributes,{'tableName':_0x9375('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfce0=['define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./intSalesforceConfiguration.attributes'];(function(_0x27beea,_0x3bc9f4){var _0x122645=function(_0x2c848){while(--_0x2c848){_0x27beea['push'](_0x27beea['shift']());}};_0x122645(++_0x3bc9f4);}(_0xfce0,0x121));var _0x0fce=function(_0x4d2993,_0x1c9473){_0x4d2993=_0x4d2993-0x0;var _0x427374=_0xfce0[_0x4d2993];return _0x427374;};'use strict';var _=require(_0x0fce('0x0'));var util=require(_0x0fce('0x1'));var logger=require(_0x0fce('0x2'))('api');var moment=require(_0x0fce('0x3'));var BPromise=require(_0x0fce('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0fce('0x5'));var rimraf=require(_0x0fce('0x6'));var config=require('../../config/environment');var attributes=require(_0x0fce('0x7'));module['exports']=function(_0x5eb79d,_0x5cb759){return _0x5eb79d[_0x0fce('0x8')](_0x0fce('0x9'),attributes,{'tableName':_0x0fce('0xa'),'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 2b59575..de10f2d 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 _0x0f3a=['request\x20sent','error','SalesforceConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x391635,_0x25d933){var _0x11c075=function(_0x1e377f){while(--_0x1e377f){_0x391635['push'](_0x391635['shift']());}};_0x11c075(++_0x25d933);}(_0x0f3a,0x123));var _0xa0f3=function(_0x3c24a8,_0x39442e){_0x3c24a8=_0x3c24a8-0x0;var _0x195e05=_0x0f3a[_0x3c24a8];return _0x195e05;};'use strict';var _=require(_0xa0f3('0x0'));var util=require(_0xa0f3('0x1'));var moment=require(_0xa0f3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa0f3('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0f3('0x4'))['db'];var utils=require(_0xa0f3('0x5'));var logger=require(_0xa0f3('0x6'))('rpc');var config=require(_0xa0f3('0x7'));var jayson=require(_0xa0f3('0x8'));var client=jayson['client'][_0xa0f3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a8139,_0x58cddd,_0x4c9329){return new BPromise(function(_0x248dbf,_0x1c34c8){return client[_0xa0f3('0xa')](_0x2a8139,_0x4c9329)[_0xa0f3('0xb')](function(_0x1fe1a8){logger[_0xa0f3('0xc')]('SalesforceConfiguration,\x20%s,\x20%s',_0x58cddd,_0xa0f3('0xd'));logger['debug']('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x58cddd,_0xa0f3('0xd'),JSON['stringify'](_0x1fe1a8));if(_0x1fe1a8['error']){if(_0x1fe1a8[_0xa0f3('0xe')]['code']===0x1f4){logger[_0xa0f3('0xe')](_0xa0f3('0xf'),_0x58cddd,_0x1fe1a8[_0xa0f3('0xe')][_0xa0f3('0x10')]);return _0x1c34c8(_0x1fe1a8[_0xa0f3('0xe')][_0xa0f3('0x10')]);}logger[_0xa0f3('0xe')](_0xa0f3('0xf'),_0x58cddd,_0x1fe1a8[_0xa0f3('0xe')][_0xa0f3('0x10')]);return _0x248dbf(_0x1fe1a8[_0xa0f3('0xe')][_0xa0f3('0x10')]);}else{logger[_0xa0f3('0xc')](_0xa0f3('0xf'),_0x58cddd,_0xa0f3('0xd'));_0x248dbf(_0x1fe1a8[_0xa0f3('0x11')][_0xa0f3('0x10')]);}})[_0xa0f3('0x12')](function(_0xbb3db7){logger[_0xa0f3('0xe')](_0xa0f3('0xf'),_0x58cddd,_0xbb3db7);_0x1c34c8(_0xbb3db7);});});} \ No newline at end of file +var _0x2857=['rpc','jayson/promise','http','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x39a16e,_0x5971dc){var _0x2b6fac=function(_0x4e941b){while(--_0x4e941b){_0x39a16e['push'](_0x39a16e['shift']());}};_0x2b6fac(++_0x5971dc);}(_0x2857,0xd0));var _0x7285=function(_0x587288,_0x582bac){_0x587288=_0x587288-0x0;var _0x52319e=_0x2857[_0x587288];return _0x52319e;};'use strict';var _=require(_0x7285('0x0'));var util=require(_0x7285('0x1'));var moment=require('moment');var BPromise=require(_0x7285('0x2'));var rs=require(_0x7285('0x3'));var fs=require('fs');var Redis=require(_0x7285('0x4'));var db=require(_0x7285('0x5'))['db'];var utils=require(_0x7285('0x6'));var logger=require(_0x7285('0x7'))(_0x7285('0x8'));var config=require('../../config/environment');var jayson=require(_0x7285('0x9'));var client=jayson['client'][_0x7285('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c159d,_0x2d32f5,_0x30ab13){return new BPromise(function(_0x35a620,_0xe563c4){return client[_0x7285('0xb')](_0x3c159d,_0x30ab13)[_0x7285('0xc')](function(_0x5dcea1){logger[_0x7285('0xd')](_0x7285('0xe'),_0x2d32f5,_0x7285('0xf'));logger[_0x7285('0x10')](_0x7285('0x11'),_0x2d32f5,_0x7285('0xf'),JSON[_0x7285('0x12')](_0x5dcea1));if(_0x5dcea1[_0x7285('0x13')]){if(_0x5dcea1['error'][_0x7285('0x14')]===0x1f4){logger[_0x7285('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d32f5,_0x5dcea1['error'][_0x7285('0x15')]);return _0xe563c4(_0x5dcea1[_0x7285('0x13')][_0x7285('0x15')]);}logger[_0x7285('0x13')](_0x7285('0xe'),_0x2d32f5,_0x5dcea1['error'][_0x7285('0x15')]);return _0x35a620(_0x5dcea1[_0x7285('0x13')]['message']);}else{logger[_0x7285('0xd')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d32f5,_0x7285('0xf'));_0x35a620(_0x5dcea1[_0x7285('0x16')][_0x7285('0x15')]);}})[_0x7285('0x17')](function(_0xc6b83c){logger[_0x7285('0x13')]('SalesforceConfiguration,\x20%s,\x20%s',_0x2d32f5,_0xc6b83c);_0xe563c4(_0xc6b83c);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index da09daf..26e8473 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 _0xeda8=['isAuthenticated','index','/:id','show','post','create','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceField.controller','get'];(function(_0xa76565,_0x1f8424){var _0x1b5f67=function(_0x2cd776){while(--_0x2cd776){_0xa76565['push'](_0xa76565['shift']());}};_0x1b5f67(++_0x1f8424);}(_0xeda8,0x104));var _0x8eda=function(_0x2e3a61,_0x57e9a1){_0x2e3a61=_0x2e3a61-0x0;var _0x5c6dac=_0xeda8[_0x2e3a61];return _0x5c6dac;};'use strict';var multer=require(_0x8eda('0x0'));var util=require(_0x8eda('0x1'));var path=require('path');var timeout=require(_0x8eda('0x2'));var express=require(_0x8eda('0x3'));var router=express[_0x8eda('0x4')]();var auth=require(_0x8eda('0x5'));var interaction=require(_0x8eda('0x6'));var config=require(_0x8eda('0x7'));var controller=require(_0x8eda('0x8'));router[_0x8eda('0x9')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xb')]);router[_0x8eda('0x9')](_0x8eda('0xc'),auth['isAuthenticated'](),controller[_0x8eda('0xd')]);router[_0x8eda('0xe')]('/',auth[_0x8eda('0xa')](),controller[_0x8eda('0xf')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x8eda('0x10')](_0x8eda('0xc'),auth[_0x8eda('0xa')](),controller['destroy']);module[_0x8eda('0x11')]=router; \ No newline at end of file +var _0x7bd0=['/:id','post','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intSalesforceField.controller','get','isAuthenticated','index'];(function(_0x754682,_0x568245){var _0x579e4a=function(_0x5c2dde){while(--_0x5c2dde){_0x754682['push'](_0x754682['shift']());}};_0x579e4a(++_0x568245);}(_0x7bd0,0x111));var _0x07bd=function(_0x2dd390,_0x1bc894){_0x2dd390=_0x2dd390-0x0;var _0x3afe47=_0x7bd0[_0x2dd390];return _0x3afe47;};'use strict';var multer=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var path=require(_0x07bd('0x2'));var timeout=require(_0x07bd('0x3'));var express=require(_0x07bd('0x4'));var router=express[_0x07bd('0x5')]();var auth=require(_0x07bd('0x6'));var interaction=require(_0x07bd('0x7'));var config=require('../../config/environment');var controller=require(_0x07bd('0x8'));router[_0x07bd('0x9')]('/',auth[_0x07bd('0xa')](),controller[_0x07bd('0xb')]);router[_0x07bd('0x9')](_0x07bd('0xc'),auth[_0x07bd('0xa')](),controller['show']);router[_0x07bd('0xd')]('/',auth['isAuthenticated'](),controller[_0x07bd('0xe')]);router[_0x07bd('0xf')](_0x07bd('0xc'),auth['isAuthenticated'](),controller[_0x07bd('0x10')]);router[_0x07bd('0x11')](_0x07bd('0xc'),auth[_0x07bd('0xa')](),controller['destroy']);module[_0x07bd('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 74ab9fc..23216d8 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 _0x7435=['STRING','customVariable','ENUM','string','keyValue'];(function(_0x55b808,_0x351780){var _0x10b3ef=function(_0x3850b6){while(--_0x3850b6){_0x55b808['push'](_0x55b808['shift']());}};_0x10b3ef(++_0x351780);}(_0x7435,0x115));var _0x5743=function(_0x4986d7,_0x309365){_0x4986d7=_0x4986d7-0x0;var _0x1418d3=_0x7435[_0x4986d7];return _0x1418d3;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x5743('0x0')](_0x5743('0x1'),'variable','customVariable',_0x5743('0x2')),'defaultValue':_0x5743('0x1')},'content':{'type':Sequelize[_0x5743('0x3')]},'key':{'type':Sequelize[_0x5743('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x5743('0x1'),'variable',_0x5743('0x4'))},'keyContent':{'type':Sequelize[_0x5743('0x3')]},'idField':{'type':Sequelize[_0x5743('0x3')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xf619=['variable','customVariable','keyValue','STRING','sequelize','exports','ENUM','string'];(function(_0x516689,_0x232f5e){var _0x41f8f8=function(_0x4974ee){while(--_0x4974ee){_0x516689['push'](_0x516689['shift']());}};_0x41f8f8(++_0x232f5e);}(_0xf619,0xe4));var _0x9f61=function(_0x5097ea,_0x4bd180){_0x5097ea=_0x5097ea-0x0;var _0x400e9a=_0xf619[_0x5097ea];return _0x400e9a;};'use strict';var Sequelize=require(_0x9f61('0x0'));module[_0x9f61('0x1')]={'type':{'type':Sequelize[_0x9f61('0x2')](_0x9f61('0x3'),_0x9f61('0x4'),_0x9f61('0x5'),_0x9f61('0x6')),'defaultValue':'string'},'content':{'type':Sequelize[_0x9f61('0x7')]},'key':{'type':Sequelize[_0x9f61('0x7')]},'keyType':{'type':Sequelize[_0x9f61('0x2')](_0x9f61('0x3'),_0x9f61('0x4'),_0x9f61('0x5'))},'keyContent':{'type':Sequelize[_0x9f61('0x7')]},'idField':{'type':Sequelize[_0x9f61('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 8130fa2..9e3fcf6 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xdb28=['json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status'];(function(_0xca5dcc,_0x31af8e){var _0xcb17f9=function(_0x2756d3){while(--_0x2756d3){_0xca5dcc['push'](_0xca5dcc['shift']());}};_0xcb17f9(++_0x31af8e);}(_0xdb28,0x106));var _0x8db2=function(_0x43049a,_0x548fb7){_0x43049a=_0x43049a-0x0;var _0x2ff8fe=_0xdb28[_0x43049a];return _0x2ff8fe;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];function respondWithStatusCode(_0x1349f6,_0x204f49){_0x204f49=_0x204f49||0xcc;return function(_0x37d017){if(_0x37d017){return _0x1349f6['sendStatus'](_0x204f49);}return _0x1349f6['status'](_0x204f49)[_0x8db2('0x18')]();};}function respondWithResult(_0x15e87c,_0x350d61){_0x350d61=_0x350d61||0xc8;return function(_0x1d6a15){if(_0x1d6a15){return _0x15e87c[_0x8db2('0x19')](_0x350d61)[_0x8db2('0x1a')](_0x1d6a15);}};}function respondWithFilteredResult(_0x2f177a,_0x3c96a7){return function(_0x131252){if(_0x131252){var _0x16c8c2=_0x131252['count'],_0x5489a9=_0x3c96a7[_0x8db2('0x1b')],_0x13b0f5=_0x3c96a7[_0x8db2('0x1b')]+_0x3c96a7[_0x8db2('0x1c')],_0x24da1b;if(_0x13b0f5>=_0x16c8c2){_0x13b0f5=_0x16c8c2;_0x24da1b=0xc8;}else{_0x24da1b=0xce;}_0x2f177a[_0x8db2('0x19')](_0x24da1b);return _0x2f177a[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x5489a9+'-'+_0x13b0f5+'/'+_0x16c8c2)['json'](_0x131252);}return null;};}function patchUpdates(_0x5df464){return function(_0x77789){try{jsonpatch[_0x8db2('0x1f')](_0x77789,_0x5df464,!![]);}catch(_0x1310d3){return BPromise[_0x8db2('0x20')](_0x1310d3);}return _0x77789['save']();};}function saveUpdates(_0x431d60,_0x36a9ff){return function(_0x260940){if(_0x260940){return _0x260940[_0x8db2('0x21')](_0x431d60)[_0x8db2('0x22')](function(_0x597260){return _0x597260;});}return null;};}function removeEntity(_0x124467,_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x23')]()[_0x8db2('0x22')](function(){_0x124467[_0x8db2('0x19')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x5c6614,_0x256202){return function(_0x4f6516){if(!_0x4f6516){_0x5c6614['sendStatus'](0x194);}return _0x4f6516;};}function handleError(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0x1f4;return function(_0xec8cd2){logger[_0x8db2('0x24')](_0xec8cd2[_0x8db2('0x25')]);if(_0xec8cd2[_0x8db2('0x26')]){delete _0xec8cd2[_0x8db2('0x26')];}_0x52a9ca[_0x8db2('0x19')](_0x4d923c)['send'](_0xec8cd2);};}exports[_0x8db2('0x27')]=function(_0x372311,_0x430dd5){var _0x8b7cec={},_0x483aee={},_0x2e0691={'count':0x0,'rows':[]};var _0x11f398=_[_0x8db2('0x28')](db[_0x8db2('0x29')][_0x8db2('0x2a')],function(_0x21bae5){return{'name':_0x21bae5[_0x8db2('0x2b')],'type':_0x21bae5[_0x8db2('0x2c')][_0x8db2('0x2d')]};});_0x483aee['model']=_[_0x8db2('0x28')](_0x11f398,'name');_0x483aee['query']=_[_0x8db2('0x2e')](_0x372311[_0x8db2('0x2f')]);_0x483aee[_0x8db2('0x30')]=_['intersection'](_0x483aee[_0x8db2('0x31')],_0x483aee['query']);_0x8b7cec[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x483aee[_0x8db2('0x31')],qs['fields'](_0x372311['query'][_0x8db2('0x34')]));_0x8b7cec[_0x8db2('0x32')]=_0x8b7cec['attributes']['length']?_0x8b7cec[_0x8db2('0x32')]:_0x483aee[_0x8db2('0x31')];if(!_0x372311[_0x8db2('0x2f')][_0x8db2('0x35')](_0x8db2('0x36'))){_0x8b7cec[_0x8db2('0x1c')]=qs[_0x8db2('0x1c')](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1c')]);_0x8b7cec[_0x8db2('0x1b')]=qs['offset'](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1b')]);}_0x8b7cec['order']=qs[_0x8db2('0x37')](_0x372311[_0x8db2('0x2f')]['sort']);_0x8b7cec['where']=qs[_0x8db2('0x30')](_['pick'](_0x372311[_0x8db2('0x2f')],_0x483aee[_0x8db2('0x30')]));if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]){_0x8b7cec['where']=_[_0x8db2('0x39')](_0x8b7cec['where'],{'$or':_[_0x8db2('0x28')](_0x11f398,function(_0xd550ae){if(_0xd550ae[_0x8db2('0x2c')]!==_0x8db2('0x3a')){var _0x50e88a={};_0x50e88a[_0xd550ae['name']]={'$like':'%'+_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]+'%'};return _0x50e88a;}})});}_0x8b7cec=_['merge']({},_0x8b7cec,_0x372311[_0x8db2('0x3b')]);var _0x24bcfe={'where':_0x8b7cec[_0x8db2('0x3c')]};return db['SalesforceField'][_0x8db2('0x3d')](_0x24bcfe)[_0x8db2('0x22')](function(_0x953349){_0x2e0691[_0x8db2('0x3d')]=_0x953349;if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x3e')]){_0x8b7cec[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x29')][_0x8db2('0x40')](_0x8b7cec);})[_0x8db2('0x22')](function(_0x21cf7c){_0x2e0691[_0x8db2('0x41')]=_0x21cf7c;return _0x2e0691;})[_0x8db2('0x22')](respondWithFilteredResult(_0x430dd5,_0x8b7cec))['catch'](handleError(_0x430dd5,null));};exports[_0x8db2('0x42')]=function(_0x2b2472,_0x5e0382){var _0x49a7ae={'raw':!![],'where':{'id':_0x2b2472['params']['id']}},_0x249c73={};_0x249c73[_0x8db2('0x31')]=_[_0x8db2('0x2e')](db[_0x8db2('0x29')][_0x8db2('0x2a')]);_0x249c73[_0x8db2('0x2f')]=_[_0x8db2('0x2e')](_0x2b2472[_0x8db2('0x2f')]);_0x249c73['filters']=_[_0x8db2('0x33')](_0x249c73[_0x8db2('0x31')],_0x249c73[_0x8db2('0x2f')]);_0x49a7ae[_0x8db2('0x32')]=_['intersection'](_0x249c73[_0x8db2('0x31')],qs[_0x8db2('0x34')](_0x2b2472[_0x8db2('0x2f')][_0x8db2('0x34')]));_0x49a7ae['attributes']=_0x49a7ae[_0x8db2('0x32')]['length']?_0x49a7ae[_0x8db2('0x32')]:_0x249c73[_0x8db2('0x31')];if(_0x2b2472[_0x8db2('0x2f')]['includeAll']){_0x49a7ae['include']=[{'all':!![]}];}_0x49a7ae=_[_0x8db2('0x39')]({},_0x49a7ae,_0x2b2472['options']);return db[_0x8db2('0x29')][_0x8db2('0x43')](_0x49a7ae)[_0x8db2('0x22')](handleEntityNotFound(_0x5e0382,null))[_0x8db2('0x22')](respondWithResult(_0x5e0382,null))[_0x8db2('0x44')](handleError(_0x5e0382,null));};exports[_0x8db2('0x45')]=function(_0x4355e2,_0xab6bdd){return db[_0x8db2('0x29')][_0x8db2('0x45')](_0x4355e2[_0x8db2('0x46')],{})[_0x8db2('0x22')](respondWithResult(_0xab6bdd,0xc9))['catch'](handleError(_0xab6bdd,null));};exports[_0x8db2('0x21')]=function(_0x2ada52,_0xdbba64){if(_0x2ada52[_0x8db2('0x46')]['id']){delete _0x2ada52['body']['id'];}return db['SalesforceField'][_0x8db2('0x43')]({'where':{'id':_0x2ada52[_0x8db2('0x47')]['id']}})[_0x8db2('0x22')](handleEntityNotFound(_0xdbba64,null))['then'](saveUpdates(_0x2ada52['body'],null))['then'](respondWithResult(_0xdbba64,null))[_0x8db2('0x44')](handleError(_0xdbba64,null));};exports[_0x8db2('0x23')]=function(_0x55c7dd,_0x383fa1){return db[_0x8db2('0x29')][_0x8db2('0x43')]({'where':{'id':_0x55c7dd[_0x8db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x383fa1,null))['then'](removeEntity(_0x383fa1,null))[_0x8db2('0x44')](handleError(_0x383fa1,null));}; \ No newline at end of file +var _0x5f66=['merge','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','body','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','SalesforceField','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filters'];(function(_0x5317b5,_0x4dfd6e){var _0x3b7ce2=function(_0xc146d6){while(--_0xc146d6){_0x5317b5['push'](_0x5317b5['shift']());}};_0x3b7ce2(++_0x4dfd6e);}(_0x5f66,0x1a0));var _0x65f6=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5f66[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x8'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65f6('0x13'))['db'];function respondWithStatusCode(_0x576875,_0x419819){_0x419819=_0x419819||0xcc;return function(_0x4862a5){if(_0x4862a5){return _0x576875[_0x65f6('0x14')](_0x419819);}return _0x576875[_0x65f6('0x15')](_0x419819)[_0x65f6('0x16')]();};}function respondWithResult(_0x217570,_0x369f96){_0x369f96=_0x369f96||0xc8;return function(_0x1d29fd){if(_0x1d29fd){return _0x217570[_0x65f6('0x15')](_0x369f96)[_0x65f6('0x17')](_0x1d29fd);}};}function respondWithFilteredResult(_0x46dbc6,_0x3440af){return function(_0x59154e){if(_0x59154e){var _0x19b9ff=_0x59154e[_0x65f6('0x18')],_0x49a913=_0x3440af[_0x65f6('0x19')],_0x5dd324=_0x3440af[_0x65f6('0x19')]+_0x3440af[_0x65f6('0x1a')],_0x1693e6;if(_0x5dd324>=_0x19b9ff){_0x5dd324=_0x19b9ff;_0x1693e6=0xc8;}else{_0x1693e6=0xce;}_0x46dbc6[_0x65f6('0x15')](_0x1693e6);return _0x46dbc6[_0x65f6('0x1b')](_0x65f6('0x1c'),_0x49a913+'-'+_0x5dd324+'/'+_0x19b9ff)['json'](_0x59154e);}return null;};}function patchUpdates(_0x4d79a1){return function(_0x2d538c){try{jsonpatch['apply'](_0x2d538c,_0x4d79a1,!![]);}catch(_0x4c81f3){return BPromise['reject'](_0x4c81f3);}return _0x2d538c[_0x65f6('0x1d')]();};}function saveUpdates(_0x21ea88,_0x5114a4){return function(_0x39e19f){if(_0x39e19f){return _0x39e19f[_0x65f6('0x1e')](_0x21ea88)[_0x65f6('0x1f')](function(_0x3876ed){return _0x3876ed;});}return null;};}function removeEntity(_0x219ab2,_0xc139c2){return function(_0x581374){if(_0x581374){return _0x581374[_0x65f6('0x20')]()['then'](function(){_0x219ab2['status'](0xcc)[_0x65f6('0x16')]();});}};}function handleEntityNotFound(_0xd173f4,_0x524e42){return function(_0x1eeaaa){if(!_0x1eeaaa){_0xd173f4[_0x65f6('0x14')](0x194);}return _0x1eeaaa;};}function handleError(_0x2317ce,_0x2774a1){_0x2774a1=_0x2774a1||0x1f4;return function(_0x4f5a69){logger[_0x65f6('0x21')](_0x4f5a69[_0x65f6('0x22')]);if(_0x4f5a69[_0x65f6('0x23')]){delete _0x4f5a69['name'];}_0x2317ce['status'](_0x2774a1)['send'](_0x4f5a69);};}exports[_0x65f6('0x24')]=function(_0x16cde8,_0x4b2292){var _0x296cd9={},_0x28f710={},_0x52277c={'count':0x0,'rows':[]};var _0x325cb4=_[_0x65f6('0x25')](db[_0x65f6('0x26')]['rawAttributes'],function(_0x4ac04b){return{'name':_0x4ac04b['fieldName'],'type':_0x4ac04b[_0x65f6('0x27')][_0x65f6('0x28')]};});_0x28f710[_0x65f6('0x29')]=_[_0x65f6('0x25')](_0x325cb4,_0x65f6('0x23'));_0x28f710[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x16cde8['query']);_0x28f710['filters']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],_0x28f710['query']);_0x296cd9['attributes']=_[_0x65f6('0x2c')](_0x28f710[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0x296cd9[_0x65f6('0x2e')]=_0x296cd9['attributes'][_0x65f6('0x2f')]?_0x296cd9[_0x65f6('0x2e')]:_0x28f710[_0x65f6('0x29')];if(!_0x16cde8['query'][_0x65f6('0x30')](_0x65f6('0x31'))){_0x296cd9[_0x65f6('0x1a')]=qs[_0x65f6('0x1a')](_0x16cde8[_0x65f6('0x2a')][_0x65f6('0x1a')]);_0x296cd9['offset']=qs[_0x65f6('0x19')](_0x16cde8[_0x65f6('0x2a')]['offset']);}_0x296cd9[_0x65f6('0x32')]=qs['sort'](_0x16cde8[_0x65f6('0x2a')]['sort']);_0x296cd9[_0x65f6('0x33')]=qs[_0x65f6('0x34')](_['pick'](_0x16cde8[_0x65f6('0x2a')],_0x28f710[_0x65f6('0x34')]));if(_0x16cde8[_0x65f6('0x2a')]['filter']){_0x296cd9['where']=_[_0x65f6('0x35')](_0x296cd9['where'],{'$or':_[_0x65f6('0x25')](_0x325cb4,function(_0x4e6653){if(_0x4e6653[_0x65f6('0x27')]!==_0x65f6('0x36')){var _0x5e97f1={};_0x5e97f1[_0x4e6653[_0x65f6('0x23')]]={'$like':'%'+_0x16cde8['query']['filter']+'%'};return _0x5e97f1;}})});}_0x296cd9=_[_0x65f6('0x35')]({},_0x296cd9,_0x16cde8[_0x65f6('0x37')]);var _0x413956={'where':_0x296cd9[_0x65f6('0x33')]};return db[_0x65f6('0x26')][_0x65f6('0x18')](_0x413956)[_0x65f6('0x1f')](function(_0x1153f1){_0x52277c['count']=_0x1153f1;if(_0x16cde8[_0x65f6('0x2a')]['includeAll']){_0x296cd9[_0x65f6('0x38')]=[{'all':!![]}];}return db[_0x65f6('0x26')][_0x65f6('0x39')](_0x296cd9);})[_0x65f6('0x1f')](function(_0x5ef5c2){_0x52277c[_0x65f6('0x3a')]=_0x5ef5c2;return _0x52277c;})[_0x65f6('0x1f')](respondWithFilteredResult(_0x4b2292,_0x296cd9))[_0x65f6('0x3b')](handleError(_0x4b2292,null));};exports[_0x65f6('0x3c')]=function(_0x81fd69,_0x3f6103){var _0xed4c96={'raw':!![],'where':{'id':_0x81fd69[_0x65f6('0x3d')]['id']}},_0x2acca5={};_0x2acca5['model']=_[_0x65f6('0x2b')](db[_0x65f6('0x26')][_0x65f6('0x3e')]);_0x2acca5[_0x65f6('0x2a')]=_[_0x65f6('0x2b')](_0x81fd69[_0x65f6('0x2a')]);_0x2acca5[_0x65f6('0x34')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],_0x2acca5[_0x65f6('0x2a')]);_0xed4c96[_0x65f6('0x2e')]=_[_0x65f6('0x2c')](_0x2acca5[_0x65f6('0x29')],qs[_0x65f6('0x2d')](_0x81fd69[_0x65f6('0x2a')][_0x65f6('0x2d')]));_0xed4c96['attributes']=_0xed4c96[_0x65f6('0x2e')][_0x65f6('0x2f')]?_0xed4c96[_0x65f6('0x2e')]:_0x2acca5[_0x65f6('0x29')];if(_0x81fd69['query'][_0x65f6('0x3f')]){_0xed4c96[_0x65f6('0x38')]=[{'all':!![]}];}_0xed4c96=_[_0x65f6('0x35')]({},_0xed4c96,_0x81fd69['options']);return db[_0x65f6('0x26')][_0x65f6('0x40')](_0xed4c96)[_0x65f6('0x1f')](handleEntityNotFound(_0x3f6103,null))[_0x65f6('0x1f')](respondWithResult(_0x3f6103,null))['catch'](handleError(_0x3f6103,null));};exports[_0x65f6('0x41')]=function(_0x512527,_0x3f1baa){return db[_0x65f6('0x26')]['create'](_0x512527[_0x65f6('0x42')],{})['then'](respondWithResult(_0x3f1baa,0xc9))[_0x65f6('0x3b')](handleError(_0x3f1baa,null));};exports[_0x65f6('0x1e')]=function(_0x2d1706,_0xc0db01){if(_0x2d1706[_0x65f6('0x42')]['id']){delete _0x2d1706[_0x65f6('0x42')]['id'];}return db['SalesforceField']['find']({'where':{'id':_0x2d1706[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0xc0db01,null))[_0x65f6('0x1f')](saveUpdates(_0x2d1706[_0x65f6('0x42')],null))[_0x65f6('0x1f')](respondWithResult(_0xc0db01,null))[_0x65f6('0x3b')](handleError(_0xc0db01,null));};exports[_0x65f6('0x20')]=function(_0x41690c,_0x414f49){return db['SalesforceField'][_0x65f6('0x40')]({'where':{'id':_0x41690c[_0x65f6('0x3d')]['id']}})[_0x65f6('0x1f')](handleEntityNotFound(_0x414f49,null))['then'](removeEntity(_0x414f49,null))[_0x65f6('0x3b')](handleError(_0x414f49,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index b2d85e3..333f7c8 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 _0xeba1=['path','rimraf','../../config/environment','./intSalesforceField.attributes','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','moment','request-promise'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0xeba1,0x182));var _0x1eba=function(_0x340509,_0x3d0e47){_0x340509=_0x340509-0x0;var _0x4f3131=_0xeba1[_0x340509];return _0x4f3131;};'use strict';var _=require(_0x1eba('0x0'));var util=require(_0x1eba('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1eba('0x2'));var BPromise=require('bluebird');var rp=require(_0x1eba('0x3'));var fs=require('fs');var path=require(_0x1eba('0x4'));var rimraf=require(_0x1eba('0x5'));var config=require(_0x1eba('0x6'));var attributes=require(_0x1eba('0x7'));module['exports']=function(_0x1a071a,_0xe55f2c){return _0x1a071a[_0x1eba('0x8')]('SalesforceField',attributes,{'tableName':_0x1eba('0x9'),'paranoid':![],'indexes':[{'name':_0x1eba('0xa'),'fields':[_0x1eba('0xb'),_0x1eba('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x1d99=['define','SalesforceField','int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./intSalesforceField.attributes','exports'];(function(_0x7a95cf,_0x4b3154){var _0x153ff7=function(_0x246bc2){while(--_0x246bc2){_0x7a95cf['push'](_0x7a95cf['shift']());}};_0x153ff7(++_0x4b3154);}(_0x1d99,0xaa));var _0x91d9=function(_0x5eafd3,_0x305186){_0x5eafd3=_0x5eafd3-0x0;var _0x1d5f36=_0x1d99[_0x5eafd3];return _0x1d5f36;};'use strict';var _=require(_0x91d9('0x0'));var util=require(_0x91d9('0x1'));var logger=require(_0x91d9('0x2'))('api');var moment=require(_0x91d9('0x3'));var BPromise=require(_0x91d9('0x4'));var rp=require(_0x91d9('0x5'));var fs=require('fs');var path=require(_0x91d9('0x6'));var rimraf=require(_0x91d9('0x7'));var config=require('../../config/environment');var attributes=require(_0x91d9('0x8'));module[_0x91d9('0x9')]=function(_0x10f31b,_0x57a450){return _0x10f31b[_0x91d9('0xa')](_0x91d9('0xb'),attributes,{'tableName':_0x91d9('0xc'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x91d9('0xd'),_0x91d9('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 e42e0c8..58705ae 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 _0x0bb5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x484b70,_0xabab23){var _0x1c2415=function(_0x5e5f3f){while(--_0x5e5f3f){_0x484b70['push'](_0x484b70['shift']());}};_0x1c2415(++_0xabab23);}(_0x0bb5,0x148));var _0x50bb=function(_0x5bb367,_0x51a468){_0x5bb367=_0x5bb367-0x0;var _0x1b2694=_0x0bb5[_0x5bb367];return _0x1b2694;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});} \ No newline at end of file +var _0x4483=['stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s'];(function(_0x2e86e1,_0x1c3d6d){var _0x5444cd=function(_0x15c8c6){while(--_0x15c8c6){_0x2e86e1['push'](_0x2e86e1['shift']());}};_0x5444cd(++_0x1c3d6d);}(_0x4483,0x1a3));var _0x3448=function(_0x594693,_0x256eeb){_0x594693=_0x594693-0x0;var _0x17137c=_0x4483[_0x594693];return _0x17137c;};'use strict';var _=require(_0x3448('0x0'));var util=require(_0x3448('0x1'));var moment=require(_0x3448('0x2'));var BPromise=require('bluebird');var rs=require(_0x3448('0x3'));var fs=require('fs');var Redis=require(_0x3448('0x4'));var db=require(_0x3448('0x5'))['db'];var utils=require(_0x3448('0x6'));var logger=require(_0x3448('0x7'))('rpc');var config=require(_0x3448('0x8'));var jayson=require(_0x3448('0x9'));var client=jayson[_0x3448('0xa')][_0x3448('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bb7e5,_0x2caa81,_0x3cc81d){return new BPromise(function(_0x34b926,_0x5923ee){return client['request'](_0x1bb7e5,_0x3cc81d)[_0x3448('0xc')](function(_0x25c152){logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,_0x3448('0xf'));logger[_0x3448('0x10')](_0x3448('0x11'),_0x2caa81,_0x3448('0xf'),JSON[_0x3448('0x12')](_0x25c152));if(_0x25c152[_0x3448('0x13')]){if(_0x25c152[_0x3448('0x13')]['code']===0x1f4){logger['error'](_0x3448('0xe'),_0x2caa81,_0x25c152[_0x3448('0x13')]['message']);return _0x5923ee(_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);}logger[_0x3448('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2caa81,_0x25c152[_0x3448('0x13')][_0x3448('0x14')]);return _0x34b926(_0x25c152['error'][_0x3448('0x14')]);}else{logger[_0x3448('0xd')](_0x3448('0xe'),_0x2caa81,'request\x20sent');_0x34b926(_0x25c152[_0x3448('0x15')][_0x3448('0x14')]);}})[_0x3448('0x16')](function(_0x30f8dd){logger[_0x3448('0x13')](_0x3448('0xe'),_0x2caa81,_0x30f8dd);_0x5923ee(_0x30f8dd);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 7efaf39..98bb362 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 _0xd10b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','create','post','addConfiguration','put','delete','destroy','multer','util','path'];(function(_0x56ff1a,_0x4d0055){var _0x2c506b=function(_0xf8b6fb){while(--_0xf8b6fb){_0x56ff1a['push'](_0x56ff1a['shift']());}};_0x2c506b(++_0x4d0055);}(_0xd10b,0x189));var _0xbd10=function(_0x2af7a1,_0x571196){_0x2af7a1=_0x2af7a1-0x0;var _0x5393e5=_0xd10b[_0x2af7a1];return _0x5393e5;};'use strict';var multer=require(_0xbd10('0x0'));var util=require(_0xbd10('0x1'));var path=require(_0xbd10('0x2'));var timeout=require(_0xbd10('0x3'));var express=require(_0xbd10('0x4'));var router=express[_0xbd10('0x5')]();var auth=require(_0xbd10('0x6'));var interaction=require(_0xbd10('0x7'));var config=require('../../config/environment');var controller=require('./intServicenowAccount.controller');router[_0xbd10('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbd10('0x8')](_0xbd10('0x9'),auth[_0xbd10('0xa')](),controller[_0xbd10('0xb')]);router[_0xbd10('0x8')](_0xbd10('0xc'),auth[_0xbd10('0xa')](),controller[_0xbd10('0xd')]);router[_0xbd10('0x8')](_0xbd10('0xe'),auth[_0xbd10('0xa')](),controller[_0xbd10('0xf')]);router['post']('/',auth[_0xbd10('0xa')](),controller[_0xbd10('0x10')]);router[_0xbd10('0x11')](_0xbd10('0xc'),auth[_0xbd10('0xa')](),controller[_0xbd10('0x12')]);router[_0xbd10('0x13')]('/:id',auth[_0xbd10('0xa')](),controller['update']);router[_0xbd10('0x14')](_0xbd10('0x9'),auth[_0xbd10('0xa')](),controller[_0xbd10('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1da9=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','/:id/fields','getFields','create','addConfiguration','put','update','delete','exports','multer'];(function(_0x123bab,_0x12918c){var _0x21842b=function(_0x29c5f3){while(--_0x29c5f3){_0x123bab['push'](_0x123bab['shift']());}};_0x21842b(++_0x12918c);}(_0x1da9,0x141));var _0x91da=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x1da9[_0x55f8b4];return _0x2475f9;};'use strict';var multer=require(_0x91da('0x0'));var util=require(_0x91da('0x1'));var path=require(_0x91da('0x2'));var timeout=require(_0x91da('0x3'));var express=require(_0x91da('0x4'));var router=express[_0x91da('0x5')]();var auth=require(_0x91da('0x6'));var interaction=require(_0x91da('0x7'));var config=require(_0x91da('0x8'));var controller=require(_0x91da('0x9'));router[_0x91da('0xa')]('/',auth[_0x91da('0xb')](),controller[_0x91da('0xc')]);router[_0x91da('0xa')](_0x91da('0xd'),auth['isAuthenticated'](),controller['show']);router[_0x91da('0xa')](_0x91da('0xe'),auth[_0x91da('0xb')](),controller['getConfigurations']);router[_0x91da('0xa')](_0x91da('0xf'),auth[_0x91da('0xb')](),controller[_0x91da('0x10')]);router['post']('/',auth[_0x91da('0xb')](),controller[_0x91da('0x11')]);router['post'](_0x91da('0xe'),auth[_0x91da('0xb')](),controller[_0x91da('0x12')]);router[_0x91da('0x13')](_0x91da('0xd'),auth[_0x91da('0xb')](),controller[_0x91da('0x14')]);router[_0x91da('0x15')](_0x91da('0xd'),auth[_0x91da('0xb')](),controller['destroy']);module[_0x91da('0x16')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 1ad016f..eaf5b23 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 _0x470c=['username','sequelize','exports','STRING'];(function(_0x51d467,_0x177ea5){var _0x1e5da5=function(_0x424bee){while(--_0x424bee){_0x51d467['push'](_0x51d467['shift']());}};_0x1e5da5(++_0x177ea5);}(_0x470c,0xa5));var _0xc470=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x470c[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0xc470('0x0'));module[_0xc470('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xc470('0x2')]},'username':{'type':Sequelize[_0xc470('0x2')],'unique':_0xc470('0x3')},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3d24=['sequelize','exports','STRING','username'];(function(_0x37212d,_0x3805e7){var _0x5dcc5c=function(_0x3e90b5){while(--_0x3e90b5){_0x37212d['push'](_0x37212d['shift']());}};_0x5dcc5c(++_0x3805e7);}(_0x3d24,0x1a4));var _0x43d2=function(_0x55dbb0,_0x113ca7){_0x55dbb0=_0x55dbb0-0x0;var _0xc98d95=_0x3d24[_0x55dbb0];return _0xc98d95;};'use strict';var Sequelize=require(_0x43d2('0x0'));module[_0x43d2('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x43d2('0x2')]},'username':{'type':Sequelize[_0x43d2('0x2')],'unique':_0x43d2('0x3')},'password':{'type':Sequelize[_0x43d2('0x2')]},'email':{'type':Sequelize[_0x43d2('0x2')]},'remoteUri':{'type':Sequelize[_0x43d2('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x43d2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index ec435da..9033a13 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 _0x7d96=['hasOwnProperty','findOne','AccountId','Subjects','getSubjects','Descriptions','channel','ServicenowConfiguration','ServicenowField','getFields','made_sla','knowledge','close_code','notify','incident_state','category','parent','caused_by','watch_list','upon_reject','hold_reason','approval_history','resolved_by','opened_by','user_input','sys_created_on','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','business_duration','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','business_stc','additional_assignee_list','description','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','severity','comments','sla_due','approval','due_date','sys_tags','escalation','upon_approval','correlation_id','location','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','username','GET','log','incident\x20table\x20objects','assign','remove','forEach','internalType','push','TCL:\x20_object','includes','ServiceNow\x20error:\x20','statusCode','True','true','False','false','sys_choice?sysparm_query=name=incident^element=','label','value','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','save','update','destroy','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','limit','order','sort','where','pick','filters','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','show','params','keys','length','options','find','create','body','getConfigurations'];(function(_0x119280,_0x439c3e){var _0x481797=function(_0x4265cb){while(--_0x4265cb){_0x119280['push'](_0x119280['shift']());}};_0x481797(++_0x439c3e);}(_0x7d96,0x128));var _0x67d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d96[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x67d9('0x0'));var emlformat=require(_0x67d9('0x1'));var rimraf=require(_0x67d9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x67d9('0x3'));var rp=require('request-promise');var moment=require(_0x67d9('0x4'));var BPromise=require(_0x67d9('0x5'));var Mustache=require(_0x67d9('0x6'));var util=require(_0x67d9('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x67d9('0x8'));var fs=require('fs');var _=require(_0x67d9('0x9'));var squel=require('squel');var crypto=require(_0x67d9('0xa'));var jsforce=require(_0x67d9('0xb'));var deskjs=require(_0x67d9('0xc'));var toCsv=require(_0x67d9('0xd'));var querystring=require(_0x67d9('0xe'));var Papa=require('papaparse');var Redis=require(_0x67d9('0xf'));var authService=require(_0x67d9('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x67d9('0x11'));var logger=require(_0x67d9('0x12'))(_0x67d9('0x13'));var utils=require(_0x67d9('0x14'));var config=require(_0x67d9('0x15'));var db=require('../../mysqldb')['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x67d9('0x16'));var client=jayson[_0x67d9('0x17')][_0x67d9('0x18')]({'port':0x232a});function checkPasswordPattern(_0x434c38,_0x3caf54,_0x4781dd){if(_0x4781dd){var _0x37c0df=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37c0df[_0x67d9('0x19')](_0x3caf54)){return _0x434c38;}else{throw new db[(_0x67d9('0x1a'))][(_0x67d9('0x1b'))]('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 _0x434c38;}}function respondWithRpcPromise(_0x1d5cf1,_0x3d83c4,_0x46bf78,_0x366df8){return new BPromise(function(_0x421ab6,_0x159d3a){var _0x5c42ad=_0x366df8||client;return _0x5c42ad['request'](_0x1d5cf1,_0x46bf78)[_0x67d9('0x1c')](function(_0x1153d9){logger[_0x67d9('0x1d')](_0x67d9('0x1e'),_0x3d83c4,_0x67d9('0x1f'));logger[_0x67d9('0x20')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x3d83c4,_0x67d9('0x1f'),JSON[_0x67d9('0x21')](_0x1153d9));if(_0x1153d9[_0x67d9('0x22')]){if(_0x1153d9['error'][_0x67d9('0x23')]===0x1f4){logger[_0x67d9('0x22')](_0x67d9('0x1e'),_0x3d83c4,_0x1153d9['error']['message']);return _0x159d3a(_0x1153d9[_0x67d9('0x22')][_0x67d9('0x24')]);}logger[_0x67d9('0x22')](_0x67d9('0x1e'),_0x3d83c4,_0x1153d9[_0x67d9('0x22')][_0x67d9('0x24')]);return _0x421ab6(_0x1153d9[_0x67d9('0x22')][_0x67d9('0x24')]);}else{logger[_0x67d9('0x1d')](_0x67d9('0x1e'),_0x3d83c4,_0x67d9('0x1f'));_0x421ab6(_0x1153d9[_0x67d9('0x25')][_0x67d9('0x24')]);}})[_0x67d9('0x26')](function(_0x499801){logger[_0x67d9('0x22')](_0x67d9('0x1e'),_0x3d83c4,_0x499801);_0x159d3a(_0x499801);});});}function respondWithStatusCode(_0x44763a,_0x1b220f){_0x1b220f=_0x1b220f||0xcc;return function(_0x59f1fa){if(_0x59f1fa){return _0x44763a[_0x67d9('0x27')](_0x1b220f);}return _0x44763a[_0x67d9('0x28')](_0x1b220f)[_0x67d9('0x29')]();};}function respondWithResult(_0x533b17,_0x4727c){_0x4727c=_0x4727c||0xc8;return function(_0x47701d){if(_0x47701d){return _0x533b17[_0x67d9('0x28')](_0x4727c)[_0x67d9('0x2a')](_0x47701d);}};}function respondWithFilteredResult(_0x358c21,_0x4c96c6){return function(_0x558c45){if(_0x558c45){var _0x5e0ac4=_0x558c45['count'],_0x267119=_0x4c96c6[_0x67d9('0x2b')],_0x17e330=_0x4c96c6[_0x67d9('0x2b')]+_0x4c96c6['limit'],_0x48d50f;if(_0x17e330>=_0x5e0ac4){_0x17e330=_0x5e0ac4;_0x48d50f=0xc8;}else{_0x48d50f=0xce;}_0x358c21[_0x67d9('0x28')](_0x48d50f);return _0x358c21[_0x67d9('0x2c')](_0x67d9('0x2d'),_0x267119+'-'+_0x17e330+'/'+_0x5e0ac4)[_0x67d9('0x2a')](_0x558c45);}return null;};}function patchUpdates(_0x5da457){return function(_0x5926b1){try{jsonpatch['apply'](_0x5926b1,_0x5da457,!![]);}catch(_0x447687){return BPromise['reject'](_0x447687);}return _0x5926b1[_0x67d9('0x2e')]();};}function saveUpdates(_0x137834,_0x3f0359){return function(_0x1078e2){if(_0x1078e2){return _0x1078e2[_0x67d9('0x2f')](_0x137834)['then'](function(_0x15e665){return _0x15e665;});}return null;};}function removeEntity(_0x2e8354,_0x106662){return function(_0x737dda){if(_0x737dda){return _0x737dda[_0x67d9('0x30')]()[_0x67d9('0x1c')](function(){_0x2e8354[_0x67d9('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0xeb779d,_0x5d5df3){return function(_0x191806){if(!_0x191806){_0xeb779d[_0x67d9('0x27')](0x194);}return _0x191806;};}function handleError(_0x28158d,_0x569de0){_0x569de0=_0x569de0||0x1f4;return function(_0x456d68){logger['error'](_0x456d68[_0x67d9('0x31')]);if(_0x456d68['name']){delete _0x456d68[_0x67d9('0x32')];}_0x28158d[_0x67d9('0x28')](_0x569de0)[_0x67d9('0x33')](_0x456d68);};}exports['index']=function(_0x18cdb4,_0x3881c6){var _0x2cc4d3={},_0x3d19e3={},_0x34d342={'count':0x0,'rows':[]};var _0x163f18=_[_0x67d9('0x34')](db[_0x67d9('0x35')][_0x67d9('0x36')],function(_0x4e4ff2){return{'name':_0x4e4ff2[_0x67d9('0x37')],'type':_0x4e4ff2[_0x67d9('0x38')][_0x67d9('0x39')]};});_0x3d19e3[_0x67d9('0x3a')]=_[_0x67d9('0x34')](_0x163f18,_0x67d9('0x32'));_0x3d19e3[_0x67d9('0x3b')]=_['keys'](_0x18cdb4['query']);_0x3d19e3['filters']=_[_0x67d9('0x3c')](_0x3d19e3[_0x67d9('0x3a')],_0x3d19e3['query']);_0x2cc4d3[_0x67d9('0x3d')]=_[_0x67d9('0x3c')](_0x3d19e3[_0x67d9('0x3a')],qs['fields'](_0x18cdb4[_0x67d9('0x3b')][_0x67d9('0x3e')]));_0x2cc4d3['attributes']=_0x2cc4d3[_0x67d9('0x3d')]['length']?_0x2cc4d3[_0x67d9('0x3d')]:_0x3d19e3[_0x67d9('0x3a')];if(!_0x18cdb4[_0x67d9('0x3b')]['hasOwnProperty']('nolimit')){_0x2cc4d3[_0x67d9('0x3f')]=qs[_0x67d9('0x3f')](_0x18cdb4[_0x67d9('0x3b')][_0x67d9('0x3f')]);_0x2cc4d3[_0x67d9('0x2b')]=qs[_0x67d9('0x2b')](_0x18cdb4[_0x67d9('0x3b')][_0x67d9('0x2b')]);}_0x2cc4d3[_0x67d9('0x40')]=qs['sort'](_0x18cdb4[_0x67d9('0x3b')][_0x67d9('0x41')]);_0x2cc4d3[_0x67d9('0x42')]=qs['filters'](_[_0x67d9('0x43')](_0x18cdb4[_0x67d9('0x3b')],_0x3d19e3[_0x67d9('0x44')]));if(_0x18cdb4[_0x67d9('0x3b')][_0x67d9('0x45')]){_0x2cc4d3['where']=_[_0x67d9('0x46')](_0x2cc4d3[_0x67d9('0x42')],{'$or':_[_0x67d9('0x34')](_0x163f18,function(_0x2df272){if(_0x2df272[_0x67d9('0x38')]!==_0x67d9('0x47')){var _0x1b7dce={};_0x1b7dce[_0x2df272[_0x67d9('0x32')]]={'$like':'%'+_0x18cdb4[_0x67d9('0x3b')][_0x67d9('0x45')]+'%'};return _0x1b7dce;}})});}_0x2cc4d3=_['merge']({},_0x2cc4d3,_0x18cdb4['options']);var _0x1f27e3={'where':_0x2cc4d3[_0x67d9('0x42')]};return db[_0x67d9('0x35')]['count'](_0x1f27e3)[_0x67d9('0x1c')](function(_0x2d8fbb){_0x34d342[_0x67d9('0x48')]=_0x2d8fbb;if(_0x18cdb4['query'][_0x67d9('0x49')]){_0x2cc4d3[_0x67d9('0x4a')]=[{'all':!![]}];}return db[_0x67d9('0x35')][_0x67d9('0x4b')](_0x2cc4d3);})[_0x67d9('0x1c')](function(_0x57c2fb){_0x34d342[_0x67d9('0x4c')]=_0x57c2fb;return _0x34d342;})['then'](respondWithFilteredResult(_0x3881c6,_0x2cc4d3))['catch'](handleError(_0x3881c6,null));};exports[_0x67d9('0x4d')]=function(_0x73c935,_0x196202){var _0x439880={'raw':![],'where':{'id':_0x73c935[_0x67d9('0x4e')]['id']}},_0x56bcf5={};_0x56bcf5[_0x67d9('0x3a')]=_[_0x67d9('0x4f')](db[_0x67d9('0x35')][_0x67d9('0x36')]);_0x56bcf5[_0x67d9('0x3b')]=_[_0x67d9('0x4f')](_0x73c935[_0x67d9('0x3b')]);_0x56bcf5['filters']=_['intersection'](_0x56bcf5[_0x67d9('0x3a')],_0x56bcf5[_0x67d9('0x3b')]);_0x439880['attributes']=_[_0x67d9('0x3c')](_0x56bcf5[_0x67d9('0x3a')],qs[_0x67d9('0x3e')](_0x73c935[_0x67d9('0x3b')]['fields']));_0x439880[_0x67d9('0x3d')]=_0x439880['attributes'][_0x67d9('0x50')]?_0x439880[_0x67d9('0x3d')]:_0x56bcf5[_0x67d9('0x3a')];if(_0x73c935[_0x67d9('0x3b')][_0x67d9('0x49')]){_0x439880['include']=[{'all':!![]}];}_0x439880=_[_0x67d9('0x46')]({},_0x439880,_0x73c935[_0x67d9('0x51')]);return db[_0x67d9('0x35')][_0x67d9('0x52')](_0x439880)[_0x67d9('0x1c')](handleEntityNotFound(_0x196202,null))['then'](respondWithResult(_0x196202,null))[_0x67d9('0x26')](handleError(_0x196202,null));};exports[_0x67d9('0x53')]=function(_0x16b415,_0x331987){return db[_0x67d9('0x35')]['create'](_0x16b415['body'],{})[_0x67d9('0x1c')](respondWithResult(_0x331987,0xc9))[_0x67d9('0x26')](handleError(_0x331987,null));};exports[_0x67d9('0x2f')]=function(_0xe257f4,_0x1884f3){if(_0xe257f4[_0x67d9('0x54')]['id']){delete _0xe257f4[_0x67d9('0x54')]['id'];}return db[_0x67d9('0x35')][_0x67d9('0x52')]({'where':{'id':_0xe257f4[_0x67d9('0x4e')]['id']}})[_0x67d9('0x1c')](handleEntityNotFound(_0x1884f3,null))[_0x67d9('0x1c')](saveUpdates(_0xe257f4[_0x67d9('0x54')],null))[_0x67d9('0x1c')](respondWithResult(_0x1884f3,null))[_0x67d9('0x26')](handleError(_0x1884f3,null));};exports[_0x67d9('0x30')]=function(_0x29f132,_0x2e887b){return db[_0x67d9('0x35')][_0x67d9('0x52')]({'where':{'id':_0x29f132[_0x67d9('0x4e')]['id']}})[_0x67d9('0x1c')](handleEntityNotFound(_0x2e887b,null))[_0x67d9('0x1c')](removeEntity(_0x2e887b,null))[_0x67d9('0x26')](handleError(_0x2e887b,null));};exports['getConfigurations']=function(_0x2ac8c7,_0x29a11d,_0x5ba8d5){var _0x40324a={};var _0xe3e45f={};var _0x5d1eaa;var _0x1eeb80;return db[_0x67d9('0x35')]['findOne']({'where':{'id':_0x2ac8c7[_0x67d9('0x4e')]['id']}})[_0x67d9('0x1c')](handleEntityNotFound(_0x29a11d,null))[_0x67d9('0x1c')](function(_0x55bc28){if(_0x55bc28){_0x5d1eaa=_0x55bc28;_0xe3e45f[_0x67d9('0x3a')]=_[_0x67d9('0x4f')](db['ServicenowConfiguration'][_0x67d9('0x36')]);_0xe3e45f[_0x67d9('0x3b')]=_[_0x67d9('0x4f')](_0x2ac8c7[_0x67d9('0x3b')]);_0xe3e45f['filters']=_[_0x67d9('0x3c')](_0xe3e45f[_0x67d9('0x3a')],_0xe3e45f[_0x67d9('0x3b')]);_0x40324a[_0x67d9('0x3d')]=_[_0x67d9('0x3c')](_0xe3e45f[_0x67d9('0x3a')],qs['fields'](_0x2ac8c7[_0x67d9('0x3b')][_0x67d9('0x3e')]));_0x40324a[_0x67d9('0x3d')]=_0x40324a[_0x67d9('0x3d')][_0x67d9('0x50')]?_0x40324a[_0x67d9('0x3d')]:_0xe3e45f[_0x67d9('0x3a')];_0x40324a[_0x67d9('0x40')]=qs[_0x67d9('0x41')](_0x2ac8c7['query'][_0x67d9('0x41')]);_0x40324a[_0x67d9('0x42')]=qs[_0x67d9('0x44')](_[_0x67d9('0x43')](_0x2ac8c7[_0x67d9('0x3b')],_0xe3e45f[_0x67d9('0x44')]));if(_0x2ac8c7[_0x67d9('0x3b')][_0x67d9('0x45')]){_0x40324a['where']=_['merge'](_0x40324a['where'],{'$or':_[_0x67d9('0x34')](_0x40324a[_0x67d9('0x3d')],function(_0x4b205b){var _0x284cb6={};_0x284cb6[_0x4b205b]={'$like':'%'+_0x2ac8c7['query'][_0x67d9('0x45')]+'%'};return _0x284cb6;})});}_0x40324a=_[_0x67d9('0x46')]({},_0x40324a,_0x2ac8c7[_0x67d9('0x51')]);return _0x5d1eaa[_0x67d9('0x55')](_0x40324a);}})[_0x67d9('0x1c')](function(_0x2672b6){if(_0x2672b6){_0x1eeb80=_0x2672b6[_0x67d9('0x50')];if(!_0x2ac8c7['query'][_0x67d9('0x56')]('nolimit')){_0x40324a['limit']=qs[_0x67d9('0x3f')](_0x2ac8c7[_0x67d9('0x3b')][_0x67d9('0x3f')]);_0x40324a['offset']=qs['offset'](_0x2ac8c7['query'][_0x67d9('0x2b')]);}return _0x5d1eaa[_0x67d9('0x55')](_0x40324a);}})['then'](function(_0x20633f){if(_0x20633f){return _0x20633f?{'count':_0x1eeb80,'rows':_0x20633f}:null;}})[_0x67d9('0x1c')](respondWithResult(_0x29a11d,null))[_0x67d9('0x26')](handleError(_0x29a11d,null));};exports['addConfiguration']=function(_0x241668,_0x2245c2,_0x4cb632){if(_0x241668[_0x67d9('0x54')]['id']){delete _0x241668[_0x67d9('0x54')]['id'];}return db[_0x67d9('0x35')][_0x67d9('0x57')]({'where':{'id':_0x241668[_0x67d9('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2245c2,null))['then'](function(_0x6c619d){if(_0x6c619d){_0x241668['body'][_0x67d9('0x58')]=_0x6c619d['id'];_0x241668[_0x67d9('0x54')][_0x67d9('0x59')]=integrations[_0x67d9('0x5a')](_0x241668[_0x67d9('0x54')]['channel'],_0x241668[_0x67d9('0x54')][_0x67d9('0x38')]);_0x241668[_0x67d9('0x54')][_0x67d9('0x5b')]=integrations['getDescriptions'](_0x241668[_0x67d9('0x54')][_0x67d9('0x5c')],_0x241668['body'][_0x67d9('0x38')]);return db[_0x67d9('0x5d')][_0x67d9('0x53')](_0x241668[_0x67d9('0x54')],{'include':[{'model':db[_0x67d9('0x5e')],'as':_0x67d9('0x59')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0x67d9('0x1c')](respondWithResult(_0x2245c2,null))[_0x67d9('0x26')](handleError(_0x2245c2,null));};exports[_0x67d9('0x5f')]=function(_0x19ecb0,_0x2cf78c,_0x495dc4){var _0x21b5a0=[_0x67d9('0x60'),'hold_reason',_0x67d9('0x61'),'subcategory',_0x67d9('0x62'),_0x67d9('0x63'),_0x67d9('0x64'),'severity',_0x67d9('0x65')];var _0x1f85bf=[_0x67d9('0x66'),_0x67d9('0x60'),_0x67d9('0x67'),_0x67d9('0x68'),_0x67d9('0x69'),'sys_updated_on','child_incidents',_0x67d9('0x6a'),_0x67d9('0x6b'),'number',_0x67d9('0x6c'),'sys_updated_by',_0x67d9('0x6d'),_0x67d9('0x6e'),_0x67d9('0x6f'),_0x67d9('0x70'),_0x67d9('0x71'),_0x67d9('0x72'),_0x67d9('0x61'),_0x67d9('0x40'),_0x67d9('0x73'),_0x67d9('0x74'),_0x67d9('0x75'),_0x67d9('0x76'),_0x67d9('0x77'),_0x67d9('0x78'),'work_notes_list',_0x67d9('0x79'),_0x67d9('0x7a'),_0x67d9('0x7b'),_0x67d9('0x7c'),_0x67d9('0x7d'),_0x67d9('0x7e'),_0x67d9('0x7f'),_0x67d9('0x80'),_0x67d9('0x81'),_0x67d9('0x82'),_0x67d9('0x83'),_0x67d9('0x84'),_0x67d9('0x85'),_0x67d9('0x86'),'subcategory','work_notes',_0x67d9('0x87'),_0x67d9('0x62'),_0x67d9('0x88'),_0x67d9('0x89'),'work_start','assignment_group',_0x67d9('0x8a'),_0x67d9('0x8b'),_0x67d9('0x8c'),'calendar_duration',_0x67d9('0x63'),_0x67d9('0x8d'),_0x67d9('0x8e'),_0x67d9('0x8f'),_0x67d9('0x90'),_0x67d9('0x91'),_0x67d9('0x92'),_0x67d9('0x93'),_0x67d9('0x94'),_0x67d9('0x64'),_0x67d9('0x95'),_0x67d9('0x96'),_0x67d9('0x97'),_0x67d9('0x98'),'activity_due','assigned_to',_0x67d9('0x99'),_0x67d9('0x9a'),_0x67d9('0x9b'),_0x67d9('0x9c'),'comments_and_work_notes',_0x67d9('0x9d'),'sys_mod_count','reopen_count',_0x67d9('0x9e'),_0x67d9('0x9f'),_0x67d9('0xa0'),_0x67d9('0xa1'),_0x67d9('0xa2'),_0x67d9('0x65')];var _0x297028='';var _0x22415b='';var _0x518f6b=[];var _0x3fda70='';var _0x5cb955='';var _0x16c686=[];var _0x11c6e7='';var _0x4bcb39='';var _0x489078={};var _0x326819='';return db[_0x67d9('0x35')]['findOne']({'where':{'id':_0x19ecb0[_0x67d9('0x4e')]['id']},'attributes':['id','username',_0x67d9('0xa3'),'email',_0x67d9('0xa4'),_0x67d9('0xa5')]})[_0x67d9('0x1c')](handleEntityNotFound(_0x2cf78c,null))[_0x67d9('0x1c')](function(_0x53284a){if(_0x53284a){_0x326819=_0x53284a[_0x67d9('0xa4')];var _0x321a2e=_0x326819[_0x67d9('0xa6')](-0x1);if(_0x321a2e==='/'){_0x326819=_0x326819[_0x67d9('0xa7')](0x0,_0x326819[_0x67d9('0xa8')](_0x321a2e));}_0x4bcb39=util['format']('%s/api/now/doc/table/schema/',_0x326819);_0x11c6e7=util[_0x67d9('0xa9')](_0x67d9('0xaa'),_0x326819);_0x489078={'user':_0x53284a[_0x67d9('0xab')],'pass':_0x53284a[_0x67d9('0xa3')]};var _0x57a841={'method':_0x67d9('0xac'),'uri':_0x4bcb39+'incident?sysparm_display_value=all','auth':_0x489078,'json':!![]};return rp(_0x57a841);}})[_0x67d9('0x1c')](function(_0x5d0abf){if(_0x5d0abf[_0x67d9('0x25')]['length']>0x0){_0x297028=_0x5d0abf[_0x67d9('0x25')];}console[_0x67d9('0xad')](_0x67d9('0xae'),_0x297028);_0x16c686=[];_0x22415b=Object[_0x67d9('0xaf')]([],_0x297028);_[_0x67d9('0xb0')](_0x22415b,function(_0x4bf0ff){return!_0x21b5a0['includes'](_0x4bf0ff[_0x67d9('0x32')]);});_0x22415b[_0x67d9('0xb1')](function(_0x599a13){var _0x254f9e=createFieldObject(_0x11c6e7,_0x489078,_0x599a13[_0x67d9('0xb2')],_0x599a13[_0x67d9('0x32')],_0x599a13['label'],![]);_0x16c686[_0x67d9('0xb3')](_0x254f9e);});return Promise['all'](_0x16c686);})[_0x67d9('0x1c')](function(_0x239e46){_0x518f6b=_0x239e46;_0x3fda70=Object[_0x67d9('0xaf')]([],_0x297028);console[_0x67d9('0xad')](_0x67d9('0xb4'),_0x297028);_['remove'](_0x3fda70,function(_0x5e02d6){return _0x1f85bf[_0x67d9('0xb5')](_0x5e02d6[_0x67d9('0x32')]);});console[_0x67d9('0xad')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x3fda70);_0x16c686=[];_0x3fda70['forEach'](function(_0x5ba295){var _0x5f35f6=createFieldObject(_0x11c6e7,_0x489078,_0x5ba295[_0x67d9('0xb2')],_0x5ba295['name'],_0x5ba295['label'],!![]);_0x16c686[_0x67d9('0xb3')](_0x5f35f6);});return Promise['all'](_0x16c686);})[_0x67d9('0x1c')](function(_0x2c700a){_0x5cb955=_0x2c700a;var _0x28e78a=_0x518f6b['concat'](_0x5cb955);return{'count':_0x28e78a[_0x67d9('0x50')],'rows':_0x28e78a};})['then'](respondWithResult(_0x2cf78c,null))['catch'](function(_0x26fae7){console['log'](_0x67d9('0xb6')+_0x26fae7);var _0x4c14c4=_0x19ecb0[_0x67d9('0x3b')][_0x67d9('0x19')]?0x1f4:_0x26fae7[_0x67d9('0xb7')]||0x1f4;logger[_0x67d9('0x22')](_0x26fae7[_0x67d9('0x31')]);delete _0x26fae7['name'];if(_0x4c14c4===0x191){_0x4c14c4=0x190;}_0x2cf78c[_0x67d9('0x28')](_0x4c14c4)[_0x67d9('0x33')](_0x19ecb0['query'][_0x67d9('0x19')]?{'message':'Wrong\x20credentials','statusCode':_0x26fae7['statusCode']}:_0x26fae7);});};function createFieldObject(_0x2a3308,_0x37c0e8,_0xf0d599,_0x38cf44,_0x2b9962,_0x1bff5b){return new Promise(function(_0x5e1f1a,_0x57dd5d){var _0x2804dc={'id':_0x38cf44,'name':_0x2b9962,'custom':_0x1bff5b};if(_0xf0d599==='boolean'){_0x2804dc[_0x67d9('0x51')]=[{'name':_0x67d9('0xb8'),'value':_0x67d9('0xb9')},{'name':_0x67d9('0xba'),'value':_0x67d9('0xbb')}];_0x5e1f1a(_0x2804dc);}else{var _0x309931={'method':_0x67d9('0xac'),'uri':_0x2a3308+_0x67d9('0xbc')+_0x38cf44,'auth':_0x37c0e8,'json':!![]};return rp(_0x309931)[_0x67d9('0x1c')](function(_0x2c1727){var _0x141d4=[];if(_0x2c1727['result']['length']>0x0){_0x2c1727[_0x67d9('0x25')][_0x67d9('0xb1')](function(_0x3cedac){if(_0x3cedac['inactive']===_0x67d9('0xbb')){var _0x44ecc8={'name':_0x3cedac[_0x67d9('0xbd')],'value':_0x3cedac[_0x67d9('0xbe')]};_0x141d4[_0x67d9('0xb3')](_0x44ecc8);}});}_0x2804dc[_0x67d9('0x51')]=_0x141d4;if(_0x2804dc[_0x67d9('0x51')]['length']>0x0){_0x5e1f1a(_0x2804dc);}else{if(_0x1bff5b==![]){_0x5e1f1a();}else{_0x5e1f1a(_0x2804dc);}}});}});} \ No newline at end of file +var _0xde46=['params','options','find','create','body','destroy','getConfigurations','findOne','order','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowConfiguration','ServicenowField','getFields','hold_reason','notify','severity','category','parent','made_sla','caused_by','upon_reject','sys_updated_on','child_incidents','number','sys_updated_by','user_input','sys_created_on','sys_domain','state','sys_created_by','knowledge','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','business_service','priority','rfc','time_worked','expected_start','opened_at','group_list','work_end','reopened_time','caller_id','subcategory','work_notes','short_description','correlation_display','assignment_group','additional_assignee_list','description','calendar_duration','closed_by','follow_up','parent_incident','sys_id','reopened_by','incident_state','urgency','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','slice','substring','lastIndexOf','%s/api/now/doc/table/schema/','format','%s/api/now/table/','GET','result','log','incident\x20table\x20objects','includes','forEach','internalType','label','push','all','assign','TCL:\x20_object','remove','concat','test','send','Wrong\x20credentials','statusCode','boolean','True','true','False','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','sendStatus','status','count','offset','limit','set','Content-Range','apply','save','update','then','end','stack','name','index','map','ServicenowAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','rows','catch'];(function(_0x4eec9b,_0x4aea09){var _0x2e3849=function(_0x24c06d){while(--_0x24c06d){_0x4eec9b['push'](_0x4eec9b['shift']());}};_0x2e3849(++_0x4aea09);}(_0xde46,0x73));var _0x6de4=function(_0x2a7c46,_0x5a3d28){_0x2a7c46=_0x2a7c46-0x0;var _0x527fec=_0xde46[_0x2a7c46];return _0x527fec;};'use strict';var pdf=require(_0x6de4('0x0'));var emlformat=require(_0x6de4('0x1'));var rimraf=require(_0x6de4('0x2'));var zipdir=require(_0x6de4('0x3'));var jsonpatch=require(_0x6de4('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6de4('0x5'));var Mustache=require(_0x6de4('0x6'));var util=require(_0x6de4('0x7'));var path=require(_0x6de4('0x8'));var sox=require(_0x6de4('0x9'));var csv=require(_0x6de4('0xa'));var ejs=require(_0x6de4('0xb'));var fs=require('fs');var _=require(_0x6de4('0xc'));var squel=require(_0x6de4('0xd'));var crypto=require(_0x6de4('0xe'));var jsforce=require(_0x6de4('0xf'));var deskjs=require(_0x6de4('0x10'));var toCsv=require(_0x6de4('0xa'));var querystring=require(_0x6de4('0x11'));var Papa=require(_0x6de4('0x12'));var Redis=require(_0x6de4('0x13'));var authService=require(_0x6de4('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6de4('0x15'));var hardwareService=require(_0x6de4('0x16'));var logger=require(_0x6de4('0x17'))(_0x6de4('0x18'));var utils=require(_0x6de4('0x19'));var config=require('../../config/environment');var db=require(_0x6de4('0x1a'))['db'];var integrations=require(_0x6de4('0x1b'));var jayson=require('jayson/promise');var client=jayson[_0x6de4('0x1c')][_0x6de4('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x3c8449,_0x4e5936,_0x7a139a){if(_0x7a139a){var _0x34a645=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x34a645['test'](_0x4e5936)){return _0x3c8449;}else{throw new db[(_0x6de4('0x1e'))][(_0x6de4('0x1f'))](_0x6de4('0x20'));}}else{return _0x3c8449;}}function respondWithRpcPromise(_0x5dc5d8,_0x5ba6f7,_0xb57ec9,_0x4f310a){return new BPromise(function(_0x34d26a,_0x385d96){var _0x219319=_0x4f310a||client;return _0x219319[_0x6de4('0x21')](_0x5dc5d8,_0xb57ec9)['then'](function(_0xdeeeab){logger['info'](_0x6de4('0x22'),_0x5ba6f7,'request\x20sent');logger[_0x6de4('0x23')](_0x6de4('0x24'),_0x5ba6f7,_0x6de4('0x25'),JSON['stringify'](_0xdeeeab));if(_0xdeeeab[_0x6de4('0x26')]){if(_0xdeeeab[_0x6de4('0x26')][_0x6de4('0x27')]===0x1f4){logger[_0x6de4('0x26')](_0x6de4('0x22'),_0x5ba6f7,_0xdeeeab[_0x6de4('0x26')][_0x6de4('0x28')]);return _0x385d96(_0xdeeeab[_0x6de4('0x26')]['message']);}logger[_0x6de4('0x26')](_0x6de4('0x22'),_0x5ba6f7,_0xdeeeab[_0x6de4('0x26')][_0x6de4('0x28')]);return _0x34d26a(_0xdeeeab[_0x6de4('0x26')][_0x6de4('0x28')]);}else{logger[_0x6de4('0x29')](_0x6de4('0x22'),_0x5ba6f7,'request\x20sent');_0x34d26a(_0xdeeeab['result'][_0x6de4('0x28')]);}})['catch'](function(_0x5e2e08){logger[_0x6de4('0x26')](_0x6de4('0x22'),_0x5ba6f7,_0x5e2e08);_0x385d96(_0x5e2e08);});});}function respondWithStatusCode(_0x5b9f59,_0x5bacdc){_0x5bacdc=_0x5bacdc||0xcc;return function(_0x5b7346){if(_0x5b7346){return _0x5b9f59[_0x6de4('0x2a')](_0x5bacdc);}return _0x5b9f59[_0x6de4('0x2b')](_0x5bacdc)['end']();};}function respondWithResult(_0x50eb7e,_0x20d3a6){_0x20d3a6=_0x20d3a6||0xc8;return function(_0x231d02){if(_0x231d02){return _0x50eb7e[_0x6de4('0x2b')](_0x20d3a6)['json'](_0x231d02);}};}function respondWithFilteredResult(_0x29a0c3,_0x4381d4){return function(_0x2ac1fd){if(_0x2ac1fd){var _0x3df9c4=_0x2ac1fd[_0x6de4('0x2c')],_0x33add8=_0x4381d4['offset'],_0x5a09af=_0x4381d4[_0x6de4('0x2d')]+_0x4381d4[_0x6de4('0x2e')],_0x359bff;if(_0x5a09af>=_0x3df9c4){_0x5a09af=_0x3df9c4;_0x359bff=0xc8;}else{_0x359bff=0xce;}_0x29a0c3[_0x6de4('0x2b')](_0x359bff);return _0x29a0c3[_0x6de4('0x2f')](_0x6de4('0x30'),_0x33add8+'-'+_0x5a09af+'/'+_0x3df9c4)['json'](_0x2ac1fd);}return null;};}function patchUpdates(_0x4fdf50){return function(_0x9122f){try{jsonpatch[_0x6de4('0x31')](_0x9122f,_0x4fdf50,!![]);}catch(_0x396cd6){return BPromise['reject'](_0x396cd6);}return _0x9122f[_0x6de4('0x32')]();};}function saveUpdates(_0x41a96a,_0x122208){return function(_0x3beeac){if(_0x3beeac){return _0x3beeac[_0x6de4('0x33')](_0x41a96a)[_0x6de4('0x34')](function(_0x515e32){return _0x515e32;});}return null;};}function removeEntity(_0x22858f,_0xf3bae8){return function(_0xe49fbb){if(_0xe49fbb){return _0xe49fbb['destroy']()[_0x6de4('0x34')](function(){_0x22858f['status'](0xcc)[_0x6de4('0x35')]();});}};}function handleEntityNotFound(_0x47b140,_0x2e4632){return function(_0x22c5b7){if(!_0x22c5b7){_0x47b140[_0x6de4('0x2a')](0x194);}return _0x22c5b7;};}function handleError(_0x17d4fb,_0xd7c40){_0xd7c40=_0xd7c40||0x1f4;return function(_0x4b1c65){logger[_0x6de4('0x26')](_0x4b1c65[_0x6de4('0x36')]);if(_0x4b1c65[_0x6de4('0x37')]){delete _0x4b1c65[_0x6de4('0x37')];}_0x17d4fb[_0x6de4('0x2b')](_0xd7c40)['send'](_0x4b1c65);};}exports[_0x6de4('0x38')]=function(_0x3c28b4,_0x275ad2){var _0x184a41={},_0xa3ae44={},_0x200af8={'count':0x0,'rows':[]};var _0x4f58e3=_[_0x6de4('0x39')](db[_0x6de4('0x3a')][_0x6de4('0x3b')],function(_0x3dd893){return{'name':_0x3dd893[_0x6de4('0x3c')],'type':_0x3dd893[_0x6de4('0x3d')][_0x6de4('0x3e')]};});_0xa3ae44[_0x6de4('0x3f')]=_[_0x6de4('0x39')](_0x4f58e3,_0x6de4('0x37'));_0xa3ae44[_0x6de4('0x40')]=_[_0x6de4('0x41')](_0x3c28b4['query']);_0xa3ae44[_0x6de4('0x42')]=_['intersection'](_0xa3ae44['model'],_0xa3ae44[_0x6de4('0x40')]);_0x184a41[_0x6de4('0x43')]=_[_0x6de4('0x44')](_0xa3ae44['model'],qs[_0x6de4('0x45')](_0x3c28b4[_0x6de4('0x40')][_0x6de4('0x45')]));_0x184a41[_0x6de4('0x43')]=_0x184a41['attributes'][_0x6de4('0x46')]?_0x184a41[_0x6de4('0x43')]:_0xa3ae44[_0x6de4('0x3f')];if(!_0x3c28b4[_0x6de4('0x40')][_0x6de4('0x47')](_0x6de4('0x48'))){_0x184a41[_0x6de4('0x2e')]=qs['limit'](_0x3c28b4['query']['limit']);_0x184a41[_0x6de4('0x2d')]=qs['offset'](_0x3c28b4[_0x6de4('0x40')][_0x6de4('0x2d')]);}_0x184a41['order']=qs[_0x6de4('0x49')](_0x3c28b4[_0x6de4('0x40')][_0x6de4('0x49')]);_0x184a41[_0x6de4('0x4a')]=qs[_0x6de4('0x42')](_[_0x6de4('0x4b')](_0x3c28b4[_0x6de4('0x40')],_0xa3ae44[_0x6de4('0x42')]));if(_0x3c28b4[_0x6de4('0x40')][_0x6de4('0x4c')]){_0x184a41[_0x6de4('0x4a')]=_['merge'](_0x184a41[_0x6de4('0x4a')],{'$or':_[_0x6de4('0x39')](_0x4f58e3,function(_0x519f35){if(_0x519f35[_0x6de4('0x3d')]!==_0x6de4('0x4d')){var _0x575011={};_0x575011[_0x519f35[_0x6de4('0x37')]]={'$like':'%'+_0x3c28b4[_0x6de4('0x40')][_0x6de4('0x4c')]+'%'};return _0x575011;}})});}_0x184a41=_[_0x6de4('0x4e')]({},_0x184a41,_0x3c28b4['options']);var _0x5bb4cb={'where':_0x184a41['where']};return db[_0x6de4('0x3a')][_0x6de4('0x2c')](_0x5bb4cb)[_0x6de4('0x34')](function(_0x359be3){_0x200af8[_0x6de4('0x2c')]=_0x359be3;if(_0x3c28b4[_0x6de4('0x40')][_0x6de4('0x4f')]){_0x184a41[_0x6de4('0x50')]=[{'all':!![]}];}return db[_0x6de4('0x3a')]['findAll'](_0x184a41);})[_0x6de4('0x34')](function(_0x24470a){_0x200af8[_0x6de4('0x51')]=_0x24470a;return _0x200af8;})['then'](respondWithFilteredResult(_0x275ad2,_0x184a41))[_0x6de4('0x52')](handleError(_0x275ad2,null));};exports['show']=function(_0x92b7bb,_0x132ce3){var _0x8f1393={'raw':![],'where':{'id':_0x92b7bb[_0x6de4('0x53')]['id']}},_0x1b0932={};_0x1b0932[_0x6de4('0x3f')]=_['keys'](db[_0x6de4('0x3a')][_0x6de4('0x3b')]);_0x1b0932[_0x6de4('0x40')]=_[_0x6de4('0x41')](_0x92b7bb['query']);_0x1b0932[_0x6de4('0x42')]=_[_0x6de4('0x44')](_0x1b0932[_0x6de4('0x3f')],_0x1b0932['query']);_0x8f1393[_0x6de4('0x43')]=_[_0x6de4('0x44')](_0x1b0932[_0x6de4('0x3f')],qs[_0x6de4('0x45')](_0x92b7bb[_0x6de4('0x40')][_0x6de4('0x45')]));_0x8f1393[_0x6de4('0x43')]=_0x8f1393[_0x6de4('0x43')]['length']?_0x8f1393['attributes']:_0x1b0932[_0x6de4('0x3f')];if(_0x92b7bb[_0x6de4('0x40')][_0x6de4('0x4f')]){_0x8f1393['include']=[{'all':!![]}];}_0x8f1393=_['merge']({},_0x8f1393,_0x92b7bb[_0x6de4('0x54')]);return db[_0x6de4('0x3a')][_0x6de4('0x55')](_0x8f1393)[_0x6de4('0x34')](handleEntityNotFound(_0x132ce3,null))[_0x6de4('0x34')](respondWithResult(_0x132ce3,null))[_0x6de4('0x52')](handleError(_0x132ce3,null));};exports[_0x6de4('0x56')]=function(_0xb82f53,_0x4b01f5){return db['ServicenowAccount'][_0x6de4('0x56')](_0xb82f53[_0x6de4('0x57')],{})[_0x6de4('0x34')](respondWithResult(_0x4b01f5,0xc9))['catch'](handleError(_0x4b01f5,null));};exports[_0x6de4('0x33')]=function(_0x14fb2e,_0x128311){if(_0x14fb2e['body']['id']){delete _0x14fb2e[_0x6de4('0x57')]['id'];}return db[_0x6de4('0x3a')]['find']({'where':{'id':_0x14fb2e[_0x6de4('0x53')]['id']}})[_0x6de4('0x34')](handleEntityNotFound(_0x128311,null))[_0x6de4('0x34')](saveUpdates(_0x14fb2e[_0x6de4('0x57')],null))[_0x6de4('0x34')](respondWithResult(_0x128311,null))[_0x6de4('0x52')](handleError(_0x128311,null));};exports[_0x6de4('0x58')]=function(_0x2986bc,_0xd844fd){return db['ServicenowAccount'][_0x6de4('0x55')]({'where':{'id':_0x2986bc[_0x6de4('0x53')]['id']}})['then'](handleEntityNotFound(_0xd844fd,null))[_0x6de4('0x34')](removeEntity(_0xd844fd,null))[_0x6de4('0x52')](handleError(_0xd844fd,null));};exports[_0x6de4('0x59')]=function(_0x5edd36,_0x1ceeb0,_0x193a73){var _0xe0b214={};var _0x11f06e={};var _0x43481e;var _0x41489d;return db[_0x6de4('0x3a')][_0x6de4('0x5a')]({'where':{'id':_0x5edd36[_0x6de4('0x53')]['id']}})[_0x6de4('0x34')](handleEntityNotFound(_0x1ceeb0,null))[_0x6de4('0x34')](function(_0x479540){if(_0x479540){_0x43481e=_0x479540;_0x11f06e[_0x6de4('0x3f')]=_[_0x6de4('0x41')](db['ServicenowConfiguration']['rawAttributes']);_0x11f06e[_0x6de4('0x40')]=_[_0x6de4('0x41')](_0x5edd36[_0x6de4('0x40')]);_0x11f06e[_0x6de4('0x42')]=_[_0x6de4('0x44')](_0x11f06e['model'],_0x11f06e[_0x6de4('0x40')]);_0xe0b214[_0x6de4('0x43')]=_[_0x6de4('0x44')](_0x11f06e['model'],qs[_0x6de4('0x45')](_0x5edd36['query'][_0x6de4('0x45')]));_0xe0b214[_0x6de4('0x43')]=_0xe0b214['attributes']['length']?_0xe0b214[_0x6de4('0x43')]:_0x11f06e[_0x6de4('0x3f')];_0xe0b214[_0x6de4('0x5b')]=qs[_0x6de4('0x49')](_0x5edd36[_0x6de4('0x40')]['sort']);_0xe0b214['where']=qs[_0x6de4('0x42')](_[_0x6de4('0x4b')](_0x5edd36[_0x6de4('0x40')],_0x11f06e['filters']));if(_0x5edd36[_0x6de4('0x40')][_0x6de4('0x4c')]){_0xe0b214['where']=_[_0x6de4('0x4e')](_0xe0b214[_0x6de4('0x4a')],{'$or':_[_0x6de4('0x39')](_0xe0b214[_0x6de4('0x43')],function(_0xd8305b){var _0x5032bf={};_0x5032bf[_0xd8305b]={'$like':'%'+_0x5edd36[_0x6de4('0x40')][_0x6de4('0x4c')]+'%'};return _0x5032bf;})});}_0xe0b214=_[_0x6de4('0x4e')]({},_0xe0b214,_0x5edd36[_0x6de4('0x54')]);return _0x43481e['getConfigurations'](_0xe0b214);}})[_0x6de4('0x34')](function(_0x1c47a4){if(_0x1c47a4){_0x41489d=_0x1c47a4['length'];if(!_0x5edd36[_0x6de4('0x40')][_0x6de4('0x47')]('nolimit')){_0xe0b214[_0x6de4('0x2e')]=qs[_0x6de4('0x2e')](_0x5edd36[_0x6de4('0x40')]['limit']);_0xe0b214[_0x6de4('0x2d')]=qs[_0x6de4('0x2d')](_0x5edd36[_0x6de4('0x40')][_0x6de4('0x2d')]);}return _0x43481e[_0x6de4('0x59')](_0xe0b214);}})[_0x6de4('0x34')](function(_0xc37e81){if(_0xc37e81){return _0xc37e81?{'count':_0x41489d,'rows':_0xc37e81}:null;}})[_0x6de4('0x34')](respondWithResult(_0x1ceeb0,null))['catch'](handleError(_0x1ceeb0,null));};exports[_0x6de4('0x5c')]=function(_0x1770ff,_0xcede8c,_0xf2d3c1){if(_0x1770ff[_0x6de4('0x57')]['id']){delete _0x1770ff[_0x6de4('0x57')]['id'];}return db['ServicenowAccount'][_0x6de4('0x5a')]({'where':{'id':_0x1770ff['params']['id']}})[_0x6de4('0x34')](handleEntityNotFound(_0xcede8c,null))['then'](function(_0x50b43c){if(_0x50b43c){_0x1770ff[_0x6de4('0x57')][_0x6de4('0x5d')]=_0x50b43c['id'];_0x1770ff[_0x6de4('0x57')][_0x6de4('0x5e')]=integrations[_0x6de4('0x5f')](_0x1770ff['body'][_0x6de4('0x60')],_0x1770ff[_0x6de4('0x57')]['type']);_0x1770ff[_0x6de4('0x57')][_0x6de4('0x61')]=integrations[_0x6de4('0x62')](_0x1770ff['body'][_0x6de4('0x60')],_0x1770ff[_0x6de4('0x57')][_0x6de4('0x3d')]);return db[_0x6de4('0x63')][_0x6de4('0x56')](_0x1770ff['body'],{'include':[{'model':db['ServicenowField'],'as':_0x6de4('0x5e')},{'model':db[_0x6de4('0x64')],'as':'Descriptions'}]});}return null;})[_0x6de4('0x34')](respondWithResult(_0xcede8c,null))[_0x6de4('0x52')](handleError(_0xcede8c,null));};exports[_0x6de4('0x65')]=function(_0x3c489e,_0x30bf8e,_0x556516){var _0x384898=['made_sla',_0x6de4('0x66'),'knowledge','subcategory','close_code',_0x6de4('0x67'),'incident_state',_0x6de4('0x68'),_0x6de4('0x69')];var _0x2dea45=[_0x6de4('0x6a'),_0x6de4('0x6b'),_0x6de4('0x6c'),'watch_list',_0x6de4('0x6d'),_0x6de4('0x6e'),_0x6de4('0x6f'),_0x6de4('0x66'),'approval_history',_0x6de4('0x70'),'resolved_by',_0x6de4('0x71'),'opened_by',_0x6de4('0x72'),_0x6de4('0x73'),_0x6de4('0x74'),_0x6de4('0x75'),_0x6de4('0x76'),_0x6de4('0x77'),_0x6de4('0x5b'),_0x6de4('0x78'),_0x6de4('0x79'),_0x6de4('0x7a'),_0x6de4('0x7b'),_0x6de4('0x7c'),'active','work_notes_list',_0x6de4('0x7d'),_0x6de4('0x7e'),'sys_domain_path',_0x6de4('0x7f'),_0x6de4('0x80'),_0x6de4('0x81'),_0x6de4('0x82'),'business_duration',_0x6de4('0x83'),_0x6de4('0x84'),_0x6de4('0x85'),'resolved_at',_0x6de4('0x86'),'approval_set',_0x6de4('0x87'),_0x6de4('0x88'),_0x6de4('0x89'),'close_code',_0x6de4('0x8a'),'delivery_task','work_start',_0x6de4('0x8b'),'business_stc',_0x6de4('0x8c'),_0x6de4('0x8d'),_0x6de4('0x8e'),_0x6de4('0x67'),'sys_class_name','close_notes',_0x6de4('0x8f'),_0x6de4('0x90'),_0x6de4('0x91'),_0x6de4('0x92'),'contact_type',_0x6de4('0x93'),_0x6de4('0x94'),_0x6de4('0x95'),'problem_id',_0x6de4('0x96'),_0x6de4('0x97'),_0x6de4('0x98'),'assigned_to','severity',_0x6de4('0x99'),_0x6de4('0x9a'),_0x6de4('0x9b'),_0x6de4('0x9c'),_0x6de4('0x9d'),_0x6de4('0x9e'),'reopen_count',_0x6de4('0x9f'),_0x6de4('0xa0'),_0x6de4('0xa1'),_0x6de4('0xa2'),_0x6de4('0xa3'),_0x6de4('0x69')];var _0x4bae30='';var _0x583d2a='';var _0x2a91ea=[];var _0x4e372b='';var _0x1dc5e6='';var _0x5d890c=[];var _0x44cca1='';var _0x185a60='';var _0x34d4f4={};var _0x4ce182='';return db[_0x6de4('0x3a')][_0x6de4('0x5a')]({'where':{'id':_0x3c489e[_0x6de4('0x53')]['id']},'attributes':['id',_0x6de4('0xa4'),_0x6de4('0xa5'),'email',_0x6de4('0xa6'),'serverUrl']})[_0x6de4('0x34')](handleEntityNotFound(_0x30bf8e,null))[_0x6de4('0x34')](function(_0xe38e38){if(_0xe38e38){_0x4ce182=_0xe38e38[_0x6de4('0xa6')];var _0xe7fcfa=_0x4ce182[_0x6de4('0xa7')](-0x1);if(_0xe7fcfa==='/'){_0x4ce182=_0x4ce182[_0x6de4('0xa8')](0x0,_0x4ce182[_0x6de4('0xa9')](_0xe7fcfa));}_0x185a60=util['format'](_0x6de4('0xaa'),_0x4ce182);_0x44cca1=util[_0x6de4('0xab')](_0x6de4('0xac'),_0x4ce182);_0x34d4f4={'user':_0xe38e38[_0x6de4('0xa4')],'pass':_0xe38e38['password']};var _0x436980={'method':_0x6de4('0xad'),'uri':_0x185a60+'incident?sysparm_display_value=all','auth':_0x34d4f4,'json':!![]};return rp(_0x436980);}})[_0x6de4('0x34')](function(_0x4428a4){if(_0x4428a4['result'][_0x6de4('0x46')]>0x0){_0x4bae30=_0x4428a4[_0x6de4('0xae')];}console[_0x6de4('0xaf')](_0x6de4('0xb0'),_0x4bae30);_0x5d890c=[];_0x583d2a=Object['assign']([],_0x4bae30);_['remove'](_0x583d2a,function(_0x8f64db){return!_0x384898[_0x6de4('0xb1')](_0x8f64db[_0x6de4('0x37')]);});_0x583d2a[_0x6de4('0xb2')](function(_0x153974){var _0x3594b0=createFieldObject(_0x44cca1,_0x34d4f4,_0x153974[_0x6de4('0xb3')],_0x153974[_0x6de4('0x37')],_0x153974[_0x6de4('0xb4')],![]);_0x5d890c[_0x6de4('0xb5')](_0x3594b0);});return Promise[_0x6de4('0xb6')](_0x5d890c);})['then'](function(_0x329f35){_0x2a91ea=_0x329f35;_0x4e372b=Object[_0x6de4('0xb7')]([],_0x4bae30);console[_0x6de4('0xaf')](_0x6de4('0xb8'),_0x4bae30);_[_0x6de4('0xb9')](_0x4e372b,function(_0x550189){return _0x2dea45[_0x6de4('0xb1')](_0x550189[_0x6de4('0x37')]);});console[_0x6de4('0xaf')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x4e372b);_0x5d890c=[];_0x4e372b[_0x6de4('0xb2')](function(_0x43b60d){var _0x4e809b=createFieldObject(_0x44cca1,_0x34d4f4,_0x43b60d['internalType'],_0x43b60d['name'],_0x43b60d['label'],!![]);_0x5d890c[_0x6de4('0xb5')](_0x4e809b);});return Promise[_0x6de4('0xb6')](_0x5d890c);})[_0x6de4('0x34')](function(_0x4909bd){_0x1dc5e6=_0x4909bd;var _0x2a3dc4=_0x2a91ea[_0x6de4('0xba')](_0x1dc5e6);return{'count':_0x2a3dc4[_0x6de4('0x46')],'rows':_0x2a3dc4};})[_0x6de4('0x34')](respondWithResult(_0x30bf8e,null))[_0x6de4('0x52')](function(_0x3f68b8){console[_0x6de4('0xaf')]('ServiceNow\x20error:\x20'+_0x3f68b8);var _0x118f0e=_0x3c489e[_0x6de4('0x40')][_0x6de4('0xbb')]?0x1f4:_0x3f68b8['statusCode']||0x1f4;logger[_0x6de4('0x26')](_0x3f68b8['stack']);delete _0x3f68b8[_0x6de4('0x37')];if(_0x118f0e===0x191){_0x118f0e=0x190;}_0x30bf8e[_0x6de4('0x2b')](_0x118f0e)[_0x6de4('0xbc')](_0x3c489e[_0x6de4('0x40')][_0x6de4('0xbb')]?{'message':_0x6de4('0xbd'),'statusCode':_0x3f68b8[_0x6de4('0xbe')]}:_0x3f68b8);});};function createFieldObject(_0x10ff16,_0x47a9c8,_0x57ce93,_0x38a9e6,_0x2b88b0,_0x20810c){return new Promise(function(_0x5abb99,_0xe2ae76){var _0x2c8903={'id':_0x38a9e6,'name':_0x2b88b0,'custom':_0x20810c};if(_0x57ce93===_0x6de4('0xbf')){_0x2c8903['options']=[{'name':_0x6de4('0xc0'),'value':_0x6de4('0xc1')},{'name':_0x6de4('0xc2'),'value':'false'}];_0x5abb99(_0x2c8903);}else{var _0x2d0300={'method':'GET','uri':_0x10ff16+_0x6de4('0xc3')+_0x38a9e6,'auth':_0x47a9c8,'json':!![]};return rp(_0x2d0300)[_0x6de4('0x34')](function(_0x4140dc){var _0x42aad4=[];if(_0x4140dc[_0x6de4('0xae')][_0x6de4('0x46')]>0x0){_0x4140dc[_0x6de4('0xae')][_0x6de4('0xb2')](function(_0x4f55cb){if(_0x4f55cb[_0x6de4('0xc4')]==='false'){var _0x46321a={'name':_0x4f55cb['label'],'value':_0x4f55cb[_0x6de4('0xc5')]};_0x42aad4[_0x6de4('0xb5')](_0x46321a);}});}_0x2c8903[_0x6de4('0x54')]=_0x42aad4;if(_0x2c8903['options']['length']>0x0){_0x5abb99(_0x2c8903);}else{if(_0x20810c==![]){_0x5abb99();}else{_0x5abb99(_0x2c8903);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 029f53a..d212407 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 _0xeff8=['rimraf','../../config/environment','./intServicenowAccount.attributes','exports','define','int_servicenow_accounts','lodash','util','api','moment','bluebird','path'];(function(_0x6d6a66,_0x2924af){var _0x11eb6e=function(_0x52e55a){while(--_0x52e55a){_0x6d6a66['push'](_0x6d6a66['shift']());}};_0x11eb6e(++_0x2924af);}(_0xeff8,0x186));var _0x8eff=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xeff8[_0xf71120];return _0xbe2fd3;};'use strict';var _=require(_0x8eff('0x0'));var util=require(_0x8eff('0x1'));var logger=require('../../config/logger')(_0x8eff('0x2'));var moment=require(_0x8eff('0x3'));var BPromise=require(_0x8eff('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8eff('0x5'));var rimraf=require(_0x8eff('0x6'));var config=require(_0x8eff('0x7'));var attributes=require(_0x8eff('0x8'));var integrations=require('../../components/integrations/configuration');module[_0x8eff('0x9')]=function(_0xb54063,_0x3409bc){return _0xb54063[_0x8eff('0xa')]('ServicenowAccount',attributes,{'tableName':_0x8eff('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x008c=['exports','ServicenowAccount','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration'];(function(_0x553bd6,_0x26d120){var _0x4e1148=function(_0x5f3963){while(--_0x5f3963){_0x553bd6['push'](_0x553bd6['shift']());}};_0x4e1148(++_0x26d120);}(_0x008c,0x188));var _0xc008=function(_0x217605,_0x347798){_0x217605=_0x217605-0x0;var _0x13b50e=_0x008c[_0x217605];return _0x13b50e;};'use strict';var _=require(_0xc008('0x0'));var util=require(_0xc008('0x1'));var logger=require(_0xc008('0x2'))(_0xc008('0x3'));var moment=require(_0xc008('0x4'));var BPromise=require('bluebird');var rp=require(_0xc008('0x5'));var fs=require('fs');var path=require(_0xc008('0x6'));var rimraf=require(_0xc008('0x7'));var config=require(_0xc008('0x8'));var attributes=require(_0xc008('0x9'));var integrations=require(_0xc008('0xa'));module[_0xc008('0xb')]=function(_0x39bb5e,_0x9c8cb2){return _0x39bb5e['define'](_0xc008('0xc'),attributes,{'tableName':'int_servicenow_accounts','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 5addefd..04a304b 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 _0x2279=['model','then','catch','ShowServicenowAccount','find','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','GetServicenowAccount','ServicenowAccount','options','where','attributes','include','map'];(function(_0x1a3d90,_0x1a37dd){var _0x4e4827=function(_0x6e7a04){while(--_0x6e7a04){_0x1a3d90['push'](_0x1a3d90['shift']());}};_0x4e4827(++_0x1a37dd);}(_0x2279,0x14a));var _0x9227=function(_0x1038fd,_0x2044de){_0x1038fd=_0x1038fd-0x0;var _0x50ccab=_0x2279[_0x1038fd];return _0x50ccab;};'use strict';var _=require(_0x9227('0x0'));var util=require(_0x9227('0x1'));var moment=require(_0x9227('0x2'));var BPromise=require(_0x9227('0x3'));var rs=require(_0x9227('0x4'));var fs=require('fs');var Redis=require(_0x9227('0x5'));var db=require(_0x9227('0x6'))['db'];var utils=require(_0x9227('0x7'));var logger=require(_0x9227('0x8'))(_0x9227('0x9'));var config=require(_0x9227('0xa'));var jayson=require(_0x9227('0xb'));var client=jayson[_0x9227('0xc')][_0x9227('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x207868,_0x8faf46,_0x13cf7e){return new BPromise(function(_0x2c0e2e,_0x399b11){return client[_0x9227('0xe')](_0x207868,_0x13cf7e)['then'](function(_0x2fff12){logger[_0x9227('0xf')](_0x9227('0x10'),_0x8faf46,'request\x20sent');logger[_0x9227('0x11')](_0x9227('0x12'),_0x8faf46,_0x9227('0x13'),JSON[_0x9227('0x14')](_0x2fff12));if(_0x2fff12[_0x9227('0x15')]){if(_0x2fff12[_0x9227('0x15')]['code']===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x8faf46,_0x2fff12['error'][_0x9227('0x16')]);return _0x399b11(_0x2fff12[_0x9227('0x15')]['message']);}logger['error'](_0x9227('0x10'),_0x8faf46,_0x2fff12[_0x9227('0x15')][_0x9227('0x16')]);return _0x2c0e2e(_0x2fff12[_0x9227('0x15')][_0x9227('0x16')]);}else{logger[_0x9227('0xf')](_0x9227('0x10'),_0x8faf46,_0x9227('0x13'));_0x2c0e2e(_0x2fff12['result']['message']);}})['catch'](function(_0x584d54){logger['error'](_0x9227('0x10'),_0x8faf46,_0x584d54);_0x399b11(_0x584d54);});});}exports[_0x9227('0x17')]=function(_0x2606f4){var _0x3ebcf8=this;return new Promise(function(_0x8f4706,_0x343859){return db[_0x9227('0x18')]['findAll']({'raw':_0x2606f4[_0x9227('0x19')]?_0x2606f4[_0x9227('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2606f4[_0x9227('0x19')]?_0x2606f4[_0x9227('0x19')][_0x9227('0x1a')]||null:null,'attributes':_0x2606f4[_0x9227('0x19')]?_0x2606f4[_0x9227('0x19')][_0x9227('0x1b')]||null:null,'limit':_0x2606f4['options']?_0x2606f4['options']['limit']||null:null,'include':_0x2606f4[_0x9227('0x19')]?_0x2606f4['options'][_0x9227('0x1c')]?_[_0x9227('0x1d')](_0x2606f4[_0x9227('0x19')][_0x9227('0x1c')],function(_0x5ab7b5){return{'model':db[_0x5ab7b5[_0x9227('0x1e')]],'as':_0x5ab7b5['as'],'attributes':_0x5ab7b5[_0x9227('0x1b')],'include':_0x5ab7b5[_0x9227('0x1c')]?_[_0x9227('0x1d')](_0x5ab7b5[_0x9227('0x1c')],function(_0x36d75a){return{'model':db[_0x36d75a[_0x9227('0x1e')]],'as':_0x36d75a['as'],'attributes':_0x36d75a['attributes'],'include':_0x36d75a['include']?_[_0x9227('0x1d')](_0x36d75a['include'],function(_0x3efa9c){return{'model':db[_0x3efa9c[_0x9227('0x1e')]],'as':_0x3efa9c['as'],'attributes':_0x3efa9c[_0x9227('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9227('0x1f')](function(_0x12f39f){logger[_0x9227('0xf')](_0x9227('0x17'),_0x2606f4);logger[_0x9227('0x11')](_0x9227('0x17'),_0x2606f4,JSON['stringify'](_0x12f39f));_0x8f4706(_0x12f39f);})[_0x9227('0x20')](function(_0x4e581e){logger[_0x9227('0x15')](_0x9227('0x17'),_0x4e581e[_0x9227('0x16')],_0x2606f4);_0x343859(_0x3ebcf8[_0x9227('0x15')](0x1f4,_0x4e581e[_0x9227('0x16')]));});});};exports[_0x9227('0x21')]=function(_0x1021a0){var _0x2b893b=this;return new Promise(function(_0x3d3c16,_0x3db9d1){return db[_0x9227('0x18')][_0x9227('0x22')]({'raw':_0x1021a0['options']?_0x1021a0['options'][_0x9227('0x23')]===undefined?!![]:![]:!![],'where':_0x1021a0[_0x9227('0x19')]?_0x1021a0[_0x9227('0x19')][_0x9227('0x1a')]||null:null,'attributes':_0x1021a0[_0x9227('0x19')]?_0x1021a0['options'][_0x9227('0x1b')]||null:null,'include':_0x1021a0['options']?_0x1021a0['options']['include']?_[_0x9227('0x1d')](_0x1021a0[_0x9227('0x19')][_0x9227('0x1c')],function(_0x47e313){return{'model':db[_0x47e313[_0x9227('0x1e')]],'as':_0x47e313['as'],'attributes':_0x47e313[_0x9227('0x1b')],'include':_0x47e313[_0x9227('0x1c')]?_[_0x9227('0x1d')](_0x47e313[_0x9227('0x1c')],function(_0x441bb5){return{'model':db[_0x441bb5['model']],'as':_0x441bb5['as'],'attributes':_0x441bb5['attributes'],'include':_0x441bb5[_0x9227('0x1c')]?_[_0x9227('0x1d')](_0x441bb5['include'],function(_0x8d198){return{'model':db[_0x8d198['model']],'as':_0x8d198['as'],'attributes':_0x8d198['attributes']};}):[]};}):[]};}):[]:[]})[_0x9227('0x1f')](function(_0x28bab4){logger[_0x9227('0xf')](_0x9227('0x21'),_0x1021a0);logger[_0x9227('0x11')]('ShowServicenowAccount',_0x1021a0,JSON[_0x9227('0x14')](_0x28bab4));_0x3d3c16(_0x28bab4);})['catch'](function(_0x1230d9){logger[_0x9227('0x15')](_0x9227('0x21'),_0x1230d9['message'],_0x1021a0);_0x3db9d1(_0x2b893b['error'](0x1f4,_0x1230d9['message']));});});}; \ No newline at end of file +var _0x075a=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetServicenowAccount','findAll','raw','options','where','attributes','limit','include','map','model','debug','ShowServicenowAccount','ServicenowAccount','lodash'];(function(_0x593eeb,_0x19cbde){var _0x3aa933=function(_0x107bec){while(--_0x107bec){_0x593eeb['push'](_0x593eeb['shift']());}};_0x3aa933(++_0x19cbde);}(_0x075a,0x143));var _0xa075=function(_0x40a617,_0x40de6d){_0x40a617=_0x40a617-0x0;var _0x5b1968=_0x075a[_0x40a617];return _0x5b1968;};'use strict';var _=require(_0xa075('0x0'));var util=require(_0xa075('0x1'));var moment=require('moment');var BPromise=require(_0xa075('0x2'));var rs=require(_0xa075('0x3'));var fs=require('fs');var Redis=require(_0xa075('0x4'));var db=require(_0xa075('0x5'))['db'];var utils=require(_0xa075('0x6'));var logger=require(_0xa075('0x7'))('rpc');var config=require(_0xa075('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa075('0x9')][_0xa075('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3d95d3,_0x48035f,_0x43e706){return new BPromise(function(_0x36781e,_0x53e620){return client[_0xa075('0xb')](_0x3d95d3,_0x43e706)[_0xa075('0xc')](function(_0x3bb268){logger[_0xa075('0xd')](_0xa075('0xe'),_0x48035f,_0xa075('0xf'));logger['debug'](_0xa075('0x10'),_0x48035f,_0xa075('0xf'),JSON[_0xa075('0x11')](_0x3bb268));if(_0x3bb268[_0xa075('0x12')]){if(_0x3bb268[_0xa075('0x12')][_0xa075('0x13')]===0x1f4){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x48035f,_0x3bb268[_0xa075('0x12')]['message']);return _0x53e620(_0x3bb268['error']['message']);}logger[_0xa075('0x12')](_0xa075('0xe'),_0x48035f,_0x3bb268['error'][_0xa075('0x14')]);return _0x36781e(_0x3bb268[_0xa075('0x12')][_0xa075('0x14')]);}else{logger[_0xa075('0xd')](_0xa075('0xe'),_0x48035f,_0xa075('0xf'));_0x36781e(_0x3bb268[_0xa075('0x15')][_0xa075('0x14')]);}})[_0xa075('0x16')](function(_0x238639){logger[_0xa075('0x12')](_0xa075('0xe'),_0x48035f,_0x238639);_0x53e620(_0x238639);});});}exports[_0xa075('0x17')]=function(_0x270e76){var _0x208f3f=this;return new Promise(function(_0x1d1a07,_0x4c2dff){return db['ServicenowAccount'][_0xa075('0x18')]({'raw':_0x270e76['options']?_0x270e76['options'][_0xa075('0x19')]===undefined?!![]:![]:!![],'where':_0x270e76[_0xa075('0x1a')]?_0x270e76[_0xa075('0x1a')][_0xa075('0x1b')]||null:null,'attributes':_0x270e76[_0xa075('0x1a')]?_0x270e76[_0xa075('0x1a')][_0xa075('0x1c')]||null:null,'limit':_0x270e76[_0xa075('0x1a')]?_0x270e76[_0xa075('0x1a')][_0xa075('0x1d')]||null:null,'include':_0x270e76[_0xa075('0x1a')]?_0x270e76[_0xa075('0x1a')][_0xa075('0x1e')]?_[_0xa075('0x1f')](_0x270e76[_0xa075('0x1a')]['include'],function(_0x53f7f4){return{'model':db[_0x53f7f4['model']],'as':_0x53f7f4['as'],'attributes':_0x53f7f4[_0xa075('0x1c')],'include':_0x53f7f4[_0xa075('0x1e')]?_[_0xa075('0x1f')](_0x53f7f4['include'],function(_0x544f75){return{'model':db[_0x544f75[_0xa075('0x20')]],'as':_0x544f75['as'],'attributes':_0x544f75[_0xa075('0x1c')],'include':_0x544f75[_0xa075('0x1e')]?_[_0xa075('0x1f')](_0x544f75['include'],function(_0x2c7d9e){return{'model':db[_0x2c7d9e['model']],'as':_0x2c7d9e['as'],'attributes':_0x2c7d9e[_0xa075('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa075('0xc')](function(_0x1ec45b){logger[_0xa075('0xd')](_0xa075('0x17'),_0x270e76);logger[_0xa075('0x21')](_0xa075('0x17'),_0x270e76,JSON['stringify'](_0x1ec45b));_0x1d1a07(_0x1ec45b);})[_0xa075('0x16')](function(_0x5547d8){logger['error']('GetServicenowAccount',_0x5547d8[_0xa075('0x14')],_0x270e76);_0x4c2dff(_0x208f3f[_0xa075('0x12')](0x1f4,_0x5547d8['message']));});});};exports[_0xa075('0x22')]=function(_0x5ec0db){var _0x53f733=this;return new Promise(function(_0x26d7e2,_0xbc8058){return db[_0xa075('0x23')]['find']({'raw':_0x5ec0db[_0xa075('0x1a')]?_0x5ec0db[_0xa075('0x1a')][_0xa075('0x19')]===undefined?!![]:![]:!![],'where':_0x5ec0db['options']?_0x5ec0db[_0xa075('0x1a')]['where']||null:null,'attributes':_0x5ec0db[_0xa075('0x1a')]?_0x5ec0db[_0xa075('0x1a')][_0xa075('0x1c')]||null:null,'include':_0x5ec0db[_0xa075('0x1a')]?_0x5ec0db[_0xa075('0x1a')][_0xa075('0x1e')]?_[_0xa075('0x1f')](_0x5ec0db[_0xa075('0x1a')][_0xa075('0x1e')],function(_0x570863){return{'model':db[_0x570863['model']],'as':_0x570863['as'],'attributes':_0x570863[_0xa075('0x1c')],'include':_0x570863['include']?_[_0xa075('0x1f')](_0x570863[_0xa075('0x1e')],function(_0x3f894b){return{'model':db[_0x3f894b[_0xa075('0x20')]],'as':_0x3f894b['as'],'attributes':_0x3f894b[_0xa075('0x1c')],'include':_0x3f894b['include']?_[_0xa075('0x1f')](_0x3f894b[_0xa075('0x1e')],function(_0x234532){return{'model':db[_0x234532[_0xa075('0x20')]],'as':_0x234532['as'],'attributes':_0x234532[_0xa075('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa075('0xc')](function(_0x140c3d){logger[_0xa075('0xd')](_0xa075('0x22'),_0x5ec0db);logger[_0xa075('0x21')]('ShowServicenowAccount',_0x5ec0db,JSON['stringify'](_0x140c3d));_0x26d7e2(_0x140c3d);})[_0xa075('0x16')](function(_0x555889){logger[_0xa075('0x12')](_0xa075('0x22'),_0x555889[_0xa075('0x14')],_0x5ec0db);_0xbc8058(_0x53f733[_0xa075('0x12')](0x1f4,_0x555889[_0xa075('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index a80b425..92f9b6c 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 _0x22d5=['delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update'];(function(_0x3a5017,_0x592e9c){var _0xa48b76=function(_0x1735cd){while(--_0x1735cd){_0x3a5017['push'](_0x3a5017['shift']());}};_0xa48b76(++_0x592e9c);}(_0x22d5,0x193));var _0x522d=function(_0xfac02,_0x4f3668){_0xfac02=_0xfac02-0x0;var _0x25568a=_0x22d5[_0xfac02];return _0x25568a;};'use strict';var multer=require(_0x522d('0x0'));var util=require(_0x522d('0x1'));var path=require(_0x522d('0x2'));var timeout=require(_0x522d('0x3'));var express=require('express');var router=express[_0x522d('0x4')]();var auth=require(_0x522d('0x5'));var interaction=require(_0x522d('0x6'));var config=require(_0x522d('0x7'));var controller=require(_0x522d('0x8'));router[_0x522d('0x9')]('/',auth[_0x522d('0xa')](),controller['index']);router['get'](_0x522d('0xb'),auth[_0x522d('0xa')](),controller[_0x522d('0xc')]);router[_0x522d('0x9')](_0x522d('0xd'),auth[_0x522d('0xa')](),controller[_0x522d('0xe')]);router[_0x522d('0x9')](_0x522d('0xf'),auth['isAuthenticated'](),controller[_0x522d('0x10')]);router['get'](_0x522d('0x11'),auth[_0x522d('0xa')](),controller[_0x522d('0x12')]);router['post']('/',auth[_0x522d('0xa')](),controller[_0x522d('0x13')]);router[_0x522d('0x14')](_0x522d('0xb'),auth[_0x522d('0xa')](),controller[_0x522d('0x15')]);router[_0x522d('0x16')]('/:id',auth[_0x522d('0xa')](),controller[_0x522d('0x17')]);module[_0x522d('0x18')]=router; \ No newline at end of file +var _0x3f18=['../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x373034,_0xe5ca7c){var _0x5afa72=function(_0x3973eb){while(--_0x3973eb){_0x373034['push'](_0x373034['shift']());}};_0x5afa72(++_0xe5ca7c);}(_0x3f18,0x7f));var _0x83f1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3f18[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x83f1('0x0'));var util=require('util');var path=require(_0x83f1('0x1'));var timeout=require(_0x83f1('0x2'));var express=require(_0x83f1('0x3'));var router=express['Router']();var auth=require(_0x83f1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x83f1('0x5'));var controller=require(_0x83f1('0x6'));router[_0x83f1('0x7')]('/',auth[_0x83f1('0x8')](),controller['index']);router[_0x83f1('0x7')](_0x83f1('0x9'),auth[_0x83f1('0x8')](),controller[_0x83f1('0xa')]);router['get'](_0x83f1('0xb'),auth['isAuthenticated'](),controller[_0x83f1('0xc')]);router[_0x83f1('0x7')](_0x83f1('0xd'),auth['isAuthenticated'](),controller[_0x83f1('0xe')]);router['get'](_0x83f1('0xf'),auth[_0x83f1('0x8')](),controller['getDescriptions']);router[_0x83f1('0x10')]('/',auth[_0x83f1('0x8')](),controller[_0x83f1('0x11')]);router[_0x83f1('0x12')](_0x83f1('0x9'),auth[_0x83f1('0x8')](),controller[_0x83f1('0x13')]);router[_0x83f1('0x14')](_0x83f1('0x9'),auth['isAuthenticated'](),controller[_0x83f1('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 94a621c..84f025d 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 _0xeaa5=['exports','STRING'];(function(_0x3159d5,_0x50d01b){var _0x582824=function(_0x2d8677){while(--_0x2d8677){_0x3159d5['push'](_0x3159d5['shift']());}};_0x582824(++_0x50d01b);}(_0xeaa5,0xea));var _0x5eaa=function(_0x1c9e03,_0x570efa){_0x1c9e03=_0x1c9e03-0x0;var _0x366643=_0xeaa5[_0x1c9e03];return _0x366643;};'use strict';var Sequelize=require('sequelize');module[_0x5eaa('0x0')]={'name':{'type':Sequelize[_0x5eaa('0x1')]},'description':{'type':Sequelize[_0x5eaa('0x1')]}}; \ No newline at end of file +var _0xaac6=['STRING','sequelize','exports'];(function(_0x1659f7,_0xc3ea51){var _0x3498dc=function(_0x4ec372){while(--_0x4ec372){_0x1659f7['push'](_0x1659f7['shift']());}};_0x3498dc(++_0xc3ea51);}(_0xaac6,0x1ae));var _0x6aac=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0xaac6[_0x13d07a];return _0x5ee0ee;};'use strict';var Sequelize=require(_0x6aac('0x0'));module[_0x6aac('0x1')]={'name':{'type':Sequelize[_0x6aac('0x2')]},'description':{'type':Sequelize[_0x6aac('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ff02e7b..30aa85f 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 _0xfede=['getDescriptions','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../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','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','status','count','offset','set','Content-Range','json','apply','reject','update','destroy','end','sendStatus','stack','name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','params','options','find','create','body','findOne','getFields','hasOwnProperty','nolimit','getSubjects','ServicenowField','pick'];(function(_0x219290,_0x5a834c){var _0x54aced=function(_0x3d5c11){while(--_0x3d5c11){_0x219290['push'](_0x219290['shift']());}};_0x54aced(++_0x5a834c);}(_0xfede,0x1f3));var _0xefed=function(_0x30a31e,_0x31f766){_0x30a31e=_0x30a31e-0x0;var _0x170879=_0xfede[_0x30a31e];return _0x170879;};'use strict';var pdf=require(_0xefed('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xefed('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xefed('0x2'));var rp=require('request-promise');var moment=require(_0xefed('0x3'));var BPromise=require(_0xefed('0x4'));var Mustache=require(_0xefed('0x5'));var util=require('util');var path=require('path');var sox=require(_0xefed('0x6'));var csv=require('to-csv');var ejs=require(_0xefed('0x7'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xefed('0x8'));var jsforce=require(_0xefed('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xefed('0xa'));var Papa=require(_0xefed('0xb'));var Redis=require(_0xefed('0xc'));var authService=require(_0xefed('0xd'));var qs=require(_0xefed('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xefed('0xf'));var logger=require('../../config/logger')('api');var utils=require(_0xefed('0x10'));var config=require(_0xefed('0x11'));var db=require('../../mysqldb')['db'];var jayson=require(_0xefed('0x12'));var client=jayson[_0xefed('0x13')]['http']({'port':0x232a});function checkPasswordPattern(_0x5e9873,_0x1fe95a,_0x2f1419){if(_0x2f1419){var _0x4d13f4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d13f4[_0xefed('0x14')](_0x1fe95a)){return _0x5e9873;}else{throw new db['Sequelize']['ValidationError'](_0xefed('0x15'));}}else{return _0x5e9873;}}function respondWithRpcPromise(_0x5d2817,_0x3eb586,_0x5af16f,_0x2f6d27){return new BPromise(function(_0x41f631,_0x41ba85){var _0x32f726=_0x2f6d27||client;return _0x32f726[_0xefed('0x16')](_0x5d2817,_0x5af16f)[_0xefed('0x17')](function(_0x34fee6){logger[_0xefed('0x18')](_0xefed('0x19'),_0x3eb586,_0xefed('0x1a'));logger['debug'](_0xefed('0x1b'),_0x3eb586,_0xefed('0x1a'),JSON['stringify'](_0x34fee6));if(_0x34fee6[_0xefed('0x1c')]){if(_0x34fee6[_0xefed('0x1c')][_0xefed('0x1d')]===0x1f4){logger[_0xefed('0x1c')](_0xefed('0x19'),_0x3eb586,_0x34fee6[_0xefed('0x1c')]['message']);return _0x41ba85(_0x34fee6[_0xefed('0x1c')][_0xefed('0x1e')]);}logger[_0xefed('0x1c')](_0xefed('0x19'),_0x3eb586,_0x34fee6[_0xefed('0x1c')][_0xefed('0x1e')]);return _0x41f631(_0x34fee6['error'][_0xefed('0x1e')]);}else{logger['info'](_0xefed('0x19'),_0x3eb586,'request\x20sent');_0x41f631(_0x34fee6[_0xefed('0x1f')]['message']);}})[_0xefed('0x20')](function(_0x2afcc4){logger[_0xefed('0x1c')](_0xefed('0x19'),_0x3eb586,_0x2afcc4);_0x41ba85(_0x2afcc4);});});}function respondWithStatusCode(_0x2dcb12,_0x50e354){_0x50e354=_0x50e354||0xcc;return function(_0x7cf93){if(_0x7cf93){return _0x2dcb12['sendStatus'](_0x50e354);}return _0x2dcb12[_0xefed('0x21')](_0x50e354)['end']();};}function respondWithResult(_0x1d6ca0,_0x510767){_0x510767=_0x510767||0xc8;return function(_0x19fbd9){if(_0x19fbd9){return _0x1d6ca0[_0xefed('0x21')](_0x510767)['json'](_0x19fbd9);}};}function respondWithFilteredResult(_0x4f017a,_0x4e26d9){return function(_0x147cd9){if(_0x147cd9){var _0x5b7dde=_0x147cd9[_0xefed('0x22')],_0x5283bd=_0x4e26d9[_0xefed('0x23')],_0x17062e=_0x4e26d9[_0xefed('0x23')]+_0x4e26d9['limit'],_0x393593;if(_0x17062e>=_0x5b7dde){_0x17062e=_0x5b7dde;_0x393593=0xc8;}else{_0x393593=0xce;}_0x4f017a[_0xefed('0x21')](_0x393593);return _0x4f017a[_0xefed('0x24')](_0xefed('0x25'),_0x5283bd+'-'+_0x17062e+'/'+_0x5b7dde)[_0xefed('0x26')](_0x147cd9);}return null;};}function patchUpdates(_0x80a691){return function(_0x5c3e4f){try{jsonpatch[_0xefed('0x27')](_0x5c3e4f,_0x80a691,!![]);}catch(_0x57c0f4){return BPromise[_0xefed('0x28')](_0x57c0f4);}return _0x5c3e4f['save']();};}function saveUpdates(_0x264aaa,_0x4bf07f){return function(_0x1d8daf){if(_0x1d8daf){return _0x1d8daf[_0xefed('0x29')](_0x264aaa)[_0xefed('0x17')](function(_0xe7f30){return _0xe7f30;});}return null;};}function removeEntity(_0x5c1721,_0x1b54c7){return function(_0x75da66){if(_0x75da66){return _0x75da66[_0xefed('0x2a')]()[_0xefed('0x17')](function(){_0x5c1721['status'](0xcc)[_0xefed('0x2b')]();});}};}function handleEntityNotFound(_0x5680ac,_0x28d1ec){return function(_0xec111b){if(!_0xec111b){_0x5680ac[_0xefed('0x2c')](0x194);}return _0xec111b;};}function handleError(_0x19213e,_0x248d7c){_0x248d7c=_0x248d7c||0x1f4;return function(_0x5ea62e){logger[_0xefed('0x1c')](_0x5ea62e[_0xefed('0x2d')]);if(_0x5ea62e['name']){delete _0x5ea62e[_0xefed('0x2e')];}_0x19213e['status'](_0x248d7c)['send'](_0x5ea62e);};}exports[_0xefed('0x2f')]=function(_0x720f0a,_0x12dba1){var _0x3eba3c={},_0x5dc3a0={},_0x36ebad={'count':0x0,'rows':[]};var _0x1ba8ba=_[_0xefed('0x30')](db[_0xefed('0x31')][_0xefed('0x32')],function(_0x11400f){return{'name':_0x11400f[_0xefed('0x33')],'type':_0x11400f[_0xefed('0x34')]['key']};});_0x5dc3a0['model']=_[_0xefed('0x30')](_0x1ba8ba,_0xefed('0x2e'));_0x5dc3a0[_0xefed('0x35')]=_[_0xefed('0x36')](_0x720f0a[_0xefed('0x35')]);_0x5dc3a0[_0xefed('0x37')]=_[_0xefed('0x38')](_0x5dc3a0[_0xefed('0x39')],_0x5dc3a0['query']);_0x3eba3c[_0xefed('0x3a')]=_[_0xefed('0x38')](_0x5dc3a0[_0xefed('0x39')],qs[_0xefed('0x3b')](_0x720f0a[_0xefed('0x35')]['fields']));_0x3eba3c[_0xefed('0x3a')]=_0x3eba3c[_0xefed('0x3a')][_0xefed('0x3c')]?_0x3eba3c[_0xefed('0x3a')]:_0x5dc3a0[_0xefed('0x39')];if(!_0x720f0a[_0xefed('0x35')]['hasOwnProperty']('nolimit')){_0x3eba3c['limit']=qs['limit'](_0x720f0a[_0xefed('0x35')][_0xefed('0x3d')]);_0x3eba3c[_0xefed('0x23')]=qs[_0xefed('0x23')](_0x720f0a['query'][_0xefed('0x23')]);}_0x3eba3c[_0xefed('0x3e')]=qs['sort'](_0x720f0a['query'][_0xefed('0x3f')]);_0x3eba3c[_0xefed('0x40')]=qs[_0xefed('0x37')](_['pick'](_0x720f0a[_0xefed('0x35')],_0x5dc3a0[_0xefed('0x37')]));if(_0x720f0a[_0xefed('0x35')][_0xefed('0x41')]){_0x3eba3c[_0xefed('0x40')]=_[_0xefed('0x42')](_0x3eba3c[_0xefed('0x40')],{'$or':_[_0xefed('0x30')](_0x1ba8ba,function(_0x1901b6){if(_0x1901b6[_0xefed('0x34')]!==_0xefed('0x43')){var _0xab3e05={};_0xab3e05[_0x1901b6[_0xefed('0x2e')]]={'$like':'%'+_0x720f0a['query'][_0xefed('0x41')]+'%'};return _0xab3e05;}})});}_0x3eba3c=_[_0xefed('0x42')]({},_0x3eba3c,_0x720f0a['options']);var _0x21db7b={'where':_0x3eba3c['where']};return db[_0xefed('0x31')][_0xefed('0x22')](_0x21db7b)[_0xefed('0x17')](function(_0x187125){_0x36ebad[_0xefed('0x22')]=_0x187125;if(_0x720f0a[_0xefed('0x35')][_0xefed('0x44')]){_0x3eba3c[_0xefed('0x45')]=[{'all':!![]}];}return db[_0xefed('0x31')]['findAll'](_0x3eba3c);})[_0xefed('0x17')](function(_0x34be72){_0x36ebad['rows']=_0x34be72;return _0x36ebad;})[_0xefed('0x17')](respondWithFilteredResult(_0x12dba1,_0x3eba3c))[_0xefed('0x20')](handleError(_0x12dba1,null));};exports['show']=function(_0x1e2be9,_0x3dbb5e){var _0x4f0cf4={'raw':![],'where':{'id':_0x1e2be9[_0xefed('0x46')]['id']}},_0x368295={};_0x368295[_0xefed('0x39')]=_['keys'](db[_0xefed('0x31')][_0xefed('0x32')]);_0x368295['query']=_[_0xefed('0x36')](_0x1e2be9[_0xefed('0x35')]);_0x368295['filters']=_[_0xefed('0x38')](_0x368295[_0xefed('0x39')],_0x368295[_0xefed('0x35')]);_0x4f0cf4[_0xefed('0x3a')]=_[_0xefed('0x38')](_0x368295[_0xefed('0x39')],qs[_0xefed('0x3b')](_0x1e2be9[_0xefed('0x35')]['fields']));_0x4f0cf4[_0xefed('0x3a')]=_0x4f0cf4['attributes']['length']?_0x4f0cf4['attributes']:_0x368295[_0xefed('0x39')];if(_0x1e2be9[_0xefed('0x35')][_0xefed('0x44')]){_0x4f0cf4['include']=[{'all':!![]}];}_0x4f0cf4=_[_0xefed('0x42')]({},_0x4f0cf4,_0x1e2be9[_0xefed('0x47')]);return db[_0xefed('0x31')][_0xefed('0x48')](_0x4f0cf4)[_0xefed('0x17')](handleEntityNotFound(_0x3dbb5e,null))[_0xefed('0x17')](respondWithResult(_0x3dbb5e,null))[_0xefed('0x20')](handleError(_0x3dbb5e,null));};exports['create']=function(_0x29bad2,_0x2be6ec){return db[_0xefed('0x31')][_0xefed('0x49')](_0x29bad2[_0xefed('0x4a')],{})[_0xefed('0x17')](respondWithResult(_0x2be6ec,0xc9))[_0xefed('0x20')](handleError(_0x2be6ec,null));};exports[_0xefed('0x29')]=function(_0x30ca54,_0x9c62f0){if(_0x30ca54[_0xefed('0x4a')]['id']){delete _0x30ca54['body']['id'];}return db[_0xefed('0x31')][_0xefed('0x48')]({'where':{'id':_0x30ca54[_0xefed('0x46')]['id']}})['then'](handleEntityNotFound(_0x9c62f0,null))[_0xefed('0x17')](saveUpdates(_0x30ca54[_0xefed('0x4a')],null))['then'](respondWithResult(_0x9c62f0,null))[_0xefed('0x20')](handleError(_0x9c62f0,null));};exports[_0xefed('0x2a')]=function(_0x482b97,_0x4b5273){return db[_0xefed('0x31')][_0xefed('0x48')]({'where':{'id':_0x482b97[_0xefed('0x46')]['id']}})[_0xefed('0x17')](handleEntityNotFound(_0x4b5273,null))['then'](removeEntity(_0x4b5273,null))[_0xefed('0x20')](handleError(_0x4b5273,null));};exports['getFields']=function(_0xf4fad4,_0x1283df,_0x57bac9){var _0x1aeb0c={};var _0x1afb4f={};var _0x2b48be;var _0x47f237;return db[_0xefed('0x31')][_0xefed('0x4b')]({'where':{'id':_0xf4fad4[_0xefed('0x46')]['id']}})[_0xefed('0x17')](handleEntityNotFound(_0x1283df,null))[_0xefed('0x17')](function(_0xf607de){if(_0xf607de){_0x2b48be=_0xf607de;_0x1afb4f[_0xefed('0x39')]=_[_0xefed('0x36')](db['ServicenowField']['rawAttributes']);_0x1afb4f[_0xefed('0x35')]=_[_0xefed('0x36')](_0xf4fad4[_0xefed('0x35')]);_0x1afb4f[_0xefed('0x37')]=_[_0xefed('0x38')](_0x1afb4f[_0xefed('0x39')],_0x1afb4f[_0xefed('0x35')]);_0x1aeb0c[_0xefed('0x3a')]=_[_0xefed('0x38')](_0x1afb4f[_0xefed('0x39')],qs[_0xefed('0x3b')](_0xf4fad4[_0xefed('0x35')]['fields']));_0x1aeb0c[_0xefed('0x3a')]=_0x1aeb0c['attributes'][_0xefed('0x3c')]?_0x1aeb0c[_0xefed('0x3a')]:_0x1afb4f['model'];_0x1aeb0c[_0xefed('0x3e')]=qs[_0xefed('0x3f')](_0xf4fad4[_0xefed('0x35')][_0xefed('0x3f')]);_0x1aeb0c['where']=qs[_0xefed('0x37')](_['pick'](_0xf4fad4[_0xefed('0x35')],_0x1afb4f[_0xefed('0x37')]));if(_0xf4fad4['query'][_0xefed('0x41')]){_0x1aeb0c[_0xefed('0x40')]=_[_0xefed('0x42')](_0x1aeb0c[_0xefed('0x40')],{'$or':_[_0xefed('0x30')](_0x1aeb0c[_0xefed('0x3a')],function(_0x50c8e3){var _0x400738={};_0x400738[_0x50c8e3]={'$like':'%'+_0xf4fad4[_0xefed('0x35')][_0xefed('0x41')]+'%'};return _0x400738;})});}_0x1aeb0c=_[_0xefed('0x42')]({},_0x1aeb0c,_0xf4fad4[_0xefed('0x47')]);return _0x2b48be[_0xefed('0x4c')](_0x1aeb0c);}})['then'](function(_0x49389f){if(_0x49389f){_0x47f237=_0x49389f['length'];if(!_0xf4fad4[_0xefed('0x35')][_0xefed('0x4d')](_0xefed('0x4e'))){_0x1aeb0c[_0xefed('0x3d')]=qs[_0xefed('0x3d')](_0xf4fad4['query'][_0xefed('0x3d')]);_0x1aeb0c[_0xefed('0x23')]=qs[_0xefed('0x23')](_0xf4fad4[_0xefed('0x35')][_0xefed('0x23')]);}return _0x2b48be[_0xefed('0x4c')](_0x1aeb0c);}})['then'](function(_0x43d21c){if(_0x43d21c){return _0x43d21c?{'count':_0x47f237,'rows':_0x43d21c}:null;}})['then'](respondWithResult(_0x1283df,null))[_0xefed('0x20')](handleError(_0x1283df,null));};exports[_0xefed('0x4f')]=function(_0x6b5b04,_0x47e23d,_0x593d7d){var _0x1df1a0={};var _0x4e790d={};var _0x960a3c;var _0x2dbc7c;return db[_0xefed('0x31')][_0xefed('0x4b')]({'where':{'id':_0x6b5b04[_0xefed('0x46')]['id']}})['then'](handleEntityNotFound(_0x47e23d,null))[_0xefed('0x17')](function(_0x3704fd){if(_0x3704fd){_0x960a3c=_0x3704fd;_0x4e790d['model']=_[_0xefed('0x36')](db[_0xefed('0x50')]['rawAttributes']);_0x4e790d[_0xefed('0x35')]=_[_0xefed('0x36')](_0x6b5b04[_0xefed('0x35')]);_0x4e790d[_0xefed('0x37')]=_[_0xefed('0x38')](_0x4e790d[_0xefed('0x39')],_0x4e790d[_0xefed('0x35')]);_0x1df1a0[_0xefed('0x3a')]=_[_0xefed('0x38')](_0x4e790d['model'],qs[_0xefed('0x3b')](_0x6b5b04[_0xefed('0x35')][_0xefed('0x3b')]));_0x1df1a0[_0xefed('0x3a')]=_0x1df1a0['attributes'][_0xefed('0x3c')]?_0x1df1a0['attributes']:_0x4e790d[_0xefed('0x39')];_0x1df1a0[_0xefed('0x3e')]=qs[_0xefed('0x3f')](_0x6b5b04[_0xefed('0x35')]['sort']);_0x1df1a0['where']=qs['filters'](_[_0xefed('0x51')](_0x6b5b04[_0xefed('0x35')],_0x4e790d[_0xefed('0x37')]));if(_0x6b5b04[_0xefed('0x35')][_0xefed('0x41')]){_0x1df1a0[_0xefed('0x40')]=_[_0xefed('0x42')](_0x1df1a0[_0xefed('0x40')],{'$or':_[_0xefed('0x30')](_0x1df1a0['attributes'],function(_0x2c9ba0){var _0x3c2115={};_0x3c2115[_0x2c9ba0]={'$like':'%'+_0x6b5b04[_0xefed('0x35')][_0xefed('0x41')]+'%'};return _0x3c2115;})});}_0x1df1a0=_[_0xefed('0x42')]({},_0x1df1a0,_0x6b5b04['options']);return _0x960a3c[_0xefed('0x4f')](_0x1df1a0);}})[_0xefed('0x17')](function(_0x482e99){if(_0x482e99){_0x2dbc7c=_0x482e99[_0xefed('0x3c')];if(!_0x6b5b04['query'][_0xefed('0x4d')](_0xefed('0x4e'))){_0x1df1a0[_0xefed('0x3d')]=qs[_0xefed('0x3d')](_0x6b5b04[_0xefed('0x35')][_0xefed('0x3d')]);_0x1df1a0['offset']=qs[_0xefed('0x23')](_0x6b5b04[_0xefed('0x35')]['offset']);}return _0x960a3c[_0xefed('0x4f')](_0x1df1a0);}})[_0xefed('0x17')](function(_0x23262c){if(_0x23262c){return _0x23262c?{'count':_0x2dbc7c,'rows':_0x23262c}:null;}})[_0xefed('0x17')](respondWithResult(_0x47e23d,null))[_0xefed('0x20')](handleError(_0x47e23d,null));};exports[_0xefed('0x52')]=function(_0x4caa53,_0x281eb1,_0x594150){var _0x6e8170={};var _0x2fb736={};var _0x146282;var _0x5a0399;return db[_0xefed('0x31')][_0xefed('0x4b')]({'where':{'id':_0x4caa53['params']['id']}})[_0xefed('0x17')](handleEntityNotFound(_0x281eb1,null))['then'](function(_0x16971b){if(_0x16971b){_0x146282=_0x16971b;_0x2fb736['model']=_['keys'](db[_0xefed('0x50')][_0xefed('0x32')]);_0x2fb736['query']=_[_0xefed('0x36')](_0x4caa53['query']);_0x2fb736[_0xefed('0x37')]=_[_0xefed('0x38')](_0x2fb736[_0xefed('0x39')],_0x2fb736[_0xefed('0x35')]);_0x6e8170['attributes']=_[_0xefed('0x38')](_0x2fb736[_0xefed('0x39')],qs['fields'](_0x4caa53[_0xefed('0x35')][_0xefed('0x3b')]));_0x6e8170[_0xefed('0x3a')]=_0x6e8170[_0xefed('0x3a')][_0xefed('0x3c')]?_0x6e8170['attributes']:_0x2fb736['model'];_0x6e8170[_0xefed('0x3e')]=qs[_0xefed('0x3f')](_0x4caa53[_0xefed('0x35')]['sort']);_0x6e8170[_0xefed('0x40')]=qs[_0xefed('0x37')](_[_0xefed('0x51')](_0x4caa53[_0xefed('0x35')],_0x2fb736[_0xefed('0x37')]));if(_0x4caa53[_0xefed('0x35')]['filter']){_0x6e8170[_0xefed('0x40')]=_[_0xefed('0x42')](_0x6e8170['where'],{'$or':_['map'](_0x6e8170[_0xefed('0x3a')],function(_0x4d8f38){var _0x2d9056={};_0x2d9056[_0x4d8f38]={'$like':'%'+_0x4caa53[_0xefed('0x35')][_0xefed('0x41')]+'%'};return _0x2d9056;})});}_0x6e8170=_[_0xefed('0x42')]({},_0x6e8170,_0x4caa53['options']);return _0x146282[_0xefed('0x52')](_0x6e8170);}})[_0xefed('0x17')](function(_0x3f38a1){if(_0x3f38a1){_0x5a0399=_0x3f38a1[_0xefed('0x3c')];if(!_0x4caa53['query'][_0xefed('0x4d')]('nolimit')){_0x6e8170[_0xefed('0x3d')]=qs['limit'](_0x4caa53[_0xefed('0x35')]['limit']);_0x6e8170['offset']=qs['offset'](_0x4caa53[_0xefed('0x35')][_0xefed('0x23')]);}return _0x146282[_0xefed('0x52')](_0x6e8170);}})[_0xefed('0x17')](function(_0x3d15fd){if(_0x3d15fd){return _0x3d15fd?{'count':_0x5a0399,'rows':_0x3d15fd}:null;}})[_0xefed('0x17')](respondWithResult(_0x281eb1,null))[_0xefed('0x20')](handleError(_0x281eb1,null));}; \ No newline at end of file +var _0x42f1=['where','pick','filter','merge','VIRTUAL','count','include','findAll','catch','show','params','options','create','body','find','getFields','findOne','ServicenowField','order','filters','getSubjects','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ServicenowConfiguration,\x20%s,\x20%s','message','result','end','json','limit','apply','reject','save','update','destroy','then','status','sendStatus','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','sort'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x42f1,0x73));var _0x142f=function(_0x431e18,_0x3a9958){_0x431e18=_0x431e18-0x0;var _0x135df5=_0x42f1[_0x431e18];return _0x135df5;};'use strict';var pdf=require(_0x142f('0x0'));var emlformat=require(_0x142f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x142f('0x2'));var jsonpatch=require(_0x142f('0x3'));var rp=require(_0x142f('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x142f('0x5'));var path=require('path');var sox=require(_0x142f('0x6'));var csv=require(_0x142f('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x142f('0x8'));var squel=require(_0x142f('0x9'));var crypto=require(_0x142f('0xa'));var jsforce=require(_0x142f('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x142f('0x7'));var querystring=require(_0x142f('0xc'));var Papa=require(_0x142f('0xd'));var Redis=require(_0x142f('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x142f('0xf'));var as=require(_0x142f('0x10'));var hardwareService=require(_0x142f('0x11'));var logger=require('../../config/logger')(_0x142f('0x12'));var utils=require(_0x142f('0x13'));var config=require(_0x142f('0x14'));var db=require(_0x142f('0x15'))['db'];var jayson=require(_0x142f('0x16'));var client=jayson[_0x142f('0x17')][_0x142f('0x18')]({'port':0x232a});function checkPasswordPattern(_0x10860f,_0x1bfd45,_0x28e919){if(_0x28e919){var _0x5d01f5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5d01f5['test'](_0x1bfd45)){return _0x10860f;}else{throw new db[(_0x142f('0x19'))][(_0x142f('0x1a'))](_0x142f('0x1b'));}}else{return _0x10860f;}}function respondWithRpcPromise(_0x50ab74,_0x555163,_0x1f3307,_0x108a17){return new BPromise(function(_0x2193ab,_0x257790){var _0x35cb8f=_0x108a17||client;return _0x35cb8f[_0x142f('0x1c')](_0x50ab74,_0x1f3307)['then'](function(_0x3d2a5b){logger[_0x142f('0x1d')]('ServicenowConfiguration,\x20%s,\x20%s',_0x555163,'request\x20sent');logger[_0x142f('0x1e')](_0x142f('0x1f'),_0x555163,_0x142f('0x20'),JSON[_0x142f('0x21')](_0x3d2a5b));if(_0x3d2a5b[_0x142f('0x22')]){if(_0x3d2a5b[_0x142f('0x22')][_0x142f('0x23')]===0x1f4){logger[_0x142f('0x22')](_0x142f('0x24'),_0x555163,_0x3d2a5b['error']['message']);return _0x257790(_0x3d2a5b['error'][_0x142f('0x25')]);}logger[_0x142f('0x22')](_0x142f('0x24'),_0x555163,_0x3d2a5b[_0x142f('0x22')][_0x142f('0x25')]);return _0x2193ab(_0x3d2a5b[_0x142f('0x22')][_0x142f('0x25')]);}else{logger[_0x142f('0x1d')]('ServicenowConfiguration,\x20%s,\x20%s',_0x555163,_0x142f('0x20'));_0x2193ab(_0x3d2a5b[_0x142f('0x26')][_0x142f('0x25')]);}})['catch'](function(_0x22faf3){logger['error'](_0x142f('0x24'),_0x555163,_0x22faf3);_0x257790(_0x22faf3);});});}function respondWithStatusCode(_0x374e7f,_0xfbe0d3){_0xfbe0d3=_0xfbe0d3||0xcc;return function(_0x27a001){if(_0x27a001){return _0x374e7f['sendStatus'](_0xfbe0d3);}return _0x374e7f['status'](_0xfbe0d3)[_0x142f('0x27')]();};}function respondWithResult(_0x1c6754,_0x3f856b){_0x3f856b=_0x3f856b||0xc8;return function(_0x48ddd2){if(_0x48ddd2){return _0x1c6754['status'](_0x3f856b)[_0x142f('0x28')](_0x48ddd2);}};}function respondWithFilteredResult(_0x10570b,_0x1096bf){return function(_0x474704){if(_0x474704){var _0x11b6e0=_0x474704['count'],_0x48f5f6=_0x1096bf['offset'],_0x298721=_0x1096bf['offset']+_0x1096bf[_0x142f('0x29')],_0x1a7f33;if(_0x298721>=_0x11b6e0){_0x298721=_0x11b6e0;_0x1a7f33=0xc8;}else{_0x1a7f33=0xce;}_0x10570b['status'](_0x1a7f33);return _0x10570b['set']('Content-Range',_0x48f5f6+'-'+_0x298721+'/'+_0x11b6e0)[_0x142f('0x28')](_0x474704);}return null;};}function patchUpdates(_0x52f5c9){return function(_0x13898c){try{jsonpatch[_0x142f('0x2a')](_0x13898c,_0x52f5c9,!![]);}catch(_0x47c670){return BPromise[_0x142f('0x2b')](_0x47c670);}return _0x13898c[_0x142f('0x2c')]();};}function saveUpdates(_0x3a6156,_0x2bb9b9){return function(_0x16b46d){if(_0x16b46d){return _0x16b46d[_0x142f('0x2d')](_0x3a6156)['then'](function(_0x515050){return _0x515050;});}return null;};}function removeEntity(_0x5abd55,_0x5c8173){return function(_0x2fa0a4){if(_0x2fa0a4){return _0x2fa0a4[_0x142f('0x2e')]()[_0x142f('0x2f')](function(){_0x5abd55[_0x142f('0x30')](0xcc)[_0x142f('0x27')]();});}};}function handleEntityNotFound(_0x13d383,_0xf121f3){return function(_0x55a64b){if(!_0x55a64b){_0x13d383[_0x142f('0x31')](0x194);}return _0x55a64b;};}function handleError(_0x53187c,_0x308ae5){_0x308ae5=_0x308ae5||0x1f4;return function(_0x21af9f){logger['error'](_0x21af9f[_0x142f('0x32')]);if(_0x21af9f[_0x142f('0x33')]){delete _0x21af9f['name'];}_0x53187c[_0x142f('0x30')](_0x308ae5)[_0x142f('0x34')](_0x21af9f);};}exports[_0x142f('0x35')]=function(_0x1d1be2,_0x38e270){var _0x314572={},_0x27d857={},_0x105bb3={'count':0x0,'rows':[]};var _0xa558af=_['map'](db[_0x142f('0x36')][_0x142f('0x37')],function(_0x5790d1){return{'name':_0x5790d1[_0x142f('0x38')],'type':_0x5790d1[_0x142f('0x39')][_0x142f('0x3a')]};});_0x27d857[_0x142f('0x3b')]=_[_0x142f('0x3c')](_0xa558af,_0x142f('0x33'));_0x27d857[_0x142f('0x3d')]=_[_0x142f('0x3e')](_0x1d1be2[_0x142f('0x3d')]);_0x27d857['filters']=_[_0x142f('0x3f')](_0x27d857['model'],_0x27d857[_0x142f('0x3d')]);_0x314572['attributes']=_[_0x142f('0x3f')](_0x27d857[_0x142f('0x3b')],qs[_0x142f('0x40')](_0x1d1be2['query'][_0x142f('0x40')]));_0x314572[_0x142f('0x41')]=_0x314572[_0x142f('0x41')][_0x142f('0x42')]?_0x314572[_0x142f('0x41')]:_0x27d857[_0x142f('0x3b')];if(!_0x1d1be2[_0x142f('0x3d')][_0x142f('0x43')](_0x142f('0x44'))){_0x314572[_0x142f('0x29')]=qs['limit'](_0x1d1be2[_0x142f('0x3d')][_0x142f('0x29')]);_0x314572['offset']=qs[_0x142f('0x45')](_0x1d1be2[_0x142f('0x3d')]['offset']);}_0x314572['order']=qs[_0x142f('0x46')](_0x1d1be2[_0x142f('0x3d')][_0x142f('0x46')]);_0x314572[_0x142f('0x47')]=qs['filters'](_[_0x142f('0x48')](_0x1d1be2[_0x142f('0x3d')],_0x27d857['filters']));if(_0x1d1be2['query'][_0x142f('0x49')]){_0x314572[_0x142f('0x47')]=_[_0x142f('0x4a')](_0x314572[_0x142f('0x47')],{'$or':_['map'](_0xa558af,function(_0x15f816){if(_0x15f816[_0x142f('0x39')]!==_0x142f('0x4b')){var _0x2fb881={};_0x2fb881[_0x15f816['name']]={'$like':'%'+_0x1d1be2[_0x142f('0x3d')][_0x142f('0x49')]+'%'};return _0x2fb881;}})});}_0x314572=_['merge']({},_0x314572,_0x1d1be2['options']);var _0x43c074={'where':_0x314572[_0x142f('0x47')]};return db['ServicenowConfiguration'][_0x142f('0x4c')](_0x43c074)[_0x142f('0x2f')](function(_0x5bd16e){_0x105bb3[_0x142f('0x4c')]=_0x5bd16e;if(_0x1d1be2[_0x142f('0x3d')]['includeAll']){_0x314572[_0x142f('0x4d')]=[{'all':!![]}];}return db[_0x142f('0x36')][_0x142f('0x4e')](_0x314572);})[_0x142f('0x2f')](function(_0x2e2259){_0x105bb3['rows']=_0x2e2259;return _0x105bb3;})[_0x142f('0x2f')](respondWithFilteredResult(_0x38e270,_0x314572))[_0x142f('0x4f')](handleError(_0x38e270,null));};exports[_0x142f('0x50')]=function(_0xb3a153,_0x3c2b80){var _0x103e0f={'raw':![],'where':{'id':_0xb3a153[_0x142f('0x51')]['id']}},_0x40c311={};_0x40c311[_0x142f('0x3b')]=_['keys'](db[_0x142f('0x36')][_0x142f('0x37')]);_0x40c311[_0x142f('0x3d')]=_[_0x142f('0x3e')](_0xb3a153[_0x142f('0x3d')]);_0x40c311['filters']=_[_0x142f('0x3f')](_0x40c311[_0x142f('0x3b')],_0x40c311[_0x142f('0x3d')]);_0x103e0f[_0x142f('0x41')]=_[_0x142f('0x3f')](_0x40c311[_0x142f('0x3b')],qs[_0x142f('0x40')](_0xb3a153['query']['fields']));_0x103e0f[_0x142f('0x41')]=_0x103e0f['attributes'][_0x142f('0x42')]?_0x103e0f[_0x142f('0x41')]:_0x40c311[_0x142f('0x3b')];if(_0xb3a153['query']['includeAll']){_0x103e0f['include']=[{'all':!![]}];}_0x103e0f=_[_0x142f('0x4a')]({},_0x103e0f,_0xb3a153[_0x142f('0x52')]);return db[_0x142f('0x36')]['find'](_0x103e0f)[_0x142f('0x2f')](handleEntityNotFound(_0x3c2b80,null))[_0x142f('0x2f')](respondWithResult(_0x3c2b80,null))[_0x142f('0x4f')](handleError(_0x3c2b80,null));};exports[_0x142f('0x53')]=function(_0x3d8461,_0x363fa2){return db[_0x142f('0x36')][_0x142f('0x53')](_0x3d8461[_0x142f('0x54')],{})[_0x142f('0x2f')](respondWithResult(_0x363fa2,0xc9))['catch'](handleError(_0x363fa2,null));};exports['update']=function(_0x141a74,_0x573501){if(_0x141a74['body']['id']){delete _0x141a74['body']['id'];}return db[_0x142f('0x36')][_0x142f('0x55')]({'where':{'id':_0x141a74[_0x142f('0x51')]['id']}})[_0x142f('0x2f')](handleEntityNotFound(_0x573501,null))[_0x142f('0x2f')](saveUpdates(_0x141a74[_0x142f('0x54')],null))[_0x142f('0x2f')](respondWithResult(_0x573501,null))['catch'](handleError(_0x573501,null));};exports[_0x142f('0x2e')]=function(_0x2b0c1e,_0x36b44d){return db[_0x142f('0x36')][_0x142f('0x55')]({'where':{'id':_0x2b0c1e[_0x142f('0x51')]['id']}})[_0x142f('0x2f')](handleEntityNotFound(_0x36b44d,null))[_0x142f('0x2f')](removeEntity(_0x36b44d,null))[_0x142f('0x4f')](handleError(_0x36b44d,null));};exports[_0x142f('0x56')]=function(_0x1a2ec0,_0x580433,_0x529533){var _0x390bca={};var _0x31399c={};var _0x40ebac;var _0x1e5efe;return db[_0x142f('0x36')][_0x142f('0x57')]({'where':{'id':_0x1a2ec0['params']['id']}})[_0x142f('0x2f')](handleEntityNotFound(_0x580433,null))[_0x142f('0x2f')](function(_0x1ff025){if(_0x1ff025){_0x40ebac=_0x1ff025;_0x31399c[_0x142f('0x3b')]=_[_0x142f('0x3e')](db[_0x142f('0x58')]['rawAttributes']);_0x31399c['query']=_[_0x142f('0x3e')](_0x1a2ec0[_0x142f('0x3d')]);_0x31399c['filters']=_[_0x142f('0x3f')](_0x31399c[_0x142f('0x3b')],_0x31399c[_0x142f('0x3d')]);_0x390bca[_0x142f('0x41')]=_[_0x142f('0x3f')](_0x31399c[_0x142f('0x3b')],qs[_0x142f('0x40')](_0x1a2ec0[_0x142f('0x3d')][_0x142f('0x40')]));_0x390bca[_0x142f('0x41')]=_0x390bca[_0x142f('0x41')][_0x142f('0x42')]?_0x390bca[_0x142f('0x41')]:_0x31399c['model'];_0x390bca[_0x142f('0x59')]=qs[_0x142f('0x46')](_0x1a2ec0[_0x142f('0x3d')][_0x142f('0x46')]);_0x390bca['where']=qs[_0x142f('0x5a')](_[_0x142f('0x48')](_0x1a2ec0[_0x142f('0x3d')],_0x31399c[_0x142f('0x5a')]));if(_0x1a2ec0['query'][_0x142f('0x49')]){_0x390bca['where']=_[_0x142f('0x4a')](_0x390bca[_0x142f('0x47')],{'$or':_['map'](_0x390bca['attributes'],function(_0x3e31af){var _0x17f67d={};_0x17f67d[_0x3e31af]={'$like':'%'+_0x1a2ec0[_0x142f('0x3d')][_0x142f('0x49')]+'%'};return _0x17f67d;})});}_0x390bca=_['merge']({},_0x390bca,_0x1a2ec0[_0x142f('0x52')]);return _0x40ebac[_0x142f('0x56')](_0x390bca);}})[_0x142f('0x2f')](function(_0x2ab3b1){if(_0x2ab3b1){_0x1e5efe=_0x2ab3b1[_0x142f('0x42')];if(!_0x1a2ec0[_0x142f('0x3d')][_0x142f('0x43')](_0x142f('0x44'))){_0x390bca[_0x142f('0x29')]=qs[_0x142f('0x29')](_0x1a2ec0[_0x142f('0x3d')][_0x142f('0x29')]);_0x390bca['offset']=qs[_0x142f('0x45')](_0x1a2ec0['query'][_0x142f('0x45')]);}return _0x40ebac[_0x142f('0x56')](_0x390bca);}})['then'](function(_0x42e5e4){if(_0x42e5e4){return _0x42e5e4?{'count':_0x1e5efe,'rows':_0x42e5e4}:null;}})[_0x142f('0x2f')](respondWithResult(_0x580433,null))[_0x142f('0x4f')](handleError(_0x580433,null));};exports['getSubjects']=function(_0xb1dac7,_0x28771c,_0x51fbf8){var _0x4b0ec0={};var _0x3e3478={};var _0x2b4774;var _0x47be31;return db[_0x142f('0x36')][_0x142f('0x57')]({'where':{'id':_0xb1dac7[_0x142f('0x51')]['id']}})[_0x142f('0x2f')](handleEntityNotFound(_0x28771c,null))['then'](function(_0x2aec1f){if(_0x2aec1f){_0x2b4774=_0x2aec1f;_0x3e3478[_0x142f('0x3b')]=_[_0x142f('0x3e')](db[_0x142f('0x58')]['rawAttributes']);_0x3e3478['query']=_[_0x142f('0x3e')](_0xb1dac7[_0x142f('0x3d')]);_0x3e3478[_0x142f('0x5a')]=_[_0x142f('0x3f')](_0x3e3478['model'],_0x3e3478[_0x142f('0x3d')]);_0x4b0ec0[_0x142f('0x41')]=_[_0x142f('0x3f')](_0x3e3478[_0x142f('0x3b')],qs[_0x142f('0x40')](_0xb1dac7['query'][_0x142f('0x40')]));_0x4b0ec0[_0x142f('0x41')]=_0x4b0ec0[_0x142f('0x41')]['length']?_0x4b0ec0[_0x142f('0x41')]:_0x3e3478['model'];_0x4b0ec0[_0x142f('0x59')]=qs[_0x142f('0x46')](_0xb1dac7[_0x142f('0x3d')]['sort']);_0x4b0ec0[_0x142f('0x47')]=qs[_0x142f('0x5a')](_[_0x142f('0x48')](_0xb1dac7[_0x142f('0x3d')],_0x3e3478['filters']));if(_0xb1dac7[_0x142f('0x3d')][_0x142f('0x49')]){_0x4b0ec0['where']=_[_0x142f('0x4a')](_0x4b0ec0['where'],{'$or':_[_0x142f('0x3c')](_0x4b0ec0[_0x142f('0x41')],function(_0x26c8f5){var _0x3fe0b0={};_0x3fe0b0[_0x26c8f5]={'$like':'%'+_0xb1dac7[_0x142f('0x3d')]['filter']+'%'};return _0x3fe0b0;})});}_0x4b0ec0=_[_0x142f('0x4a')]({},_0x4b0ec0,_0xb1dac7[_0x142f('0x52')]);return _0x2b4774[_0x142f('0x5b')](_0x4b0ec0);}})['then'](function(_0x3089c3){if(_0x3089c3){_0x47be31=_0x3089c3[_0x142f('0x42')];if(!_0xb1dac7[_0x142f('0x3d')]['hasOwnProperty'](_0x142f('0x44'))){_0x4b0ec0[_0x142f('0x29')]=qs[_0x142f('0x29')](_0xb1dac7['query'][_0x142f('0x29')]);_0x4b0ec0[_0x142f('0x45')]=qs[_0x142f('0x45')](_0xb1dac7[_0x142f('0x3d')]['offset']);}return _0x2b4774[_0x142f('0x5b')](_0x4b0ec0);}})['then'](function(_0x2a1746){if(_0x2a1746){return _0x2a1746?{'count':_0x47be31,'rows':_0x2a1746}:null;}})['then'](respondWithResult(_0x28771c,null))[_0x142f('0x4f')](handleError(_0x28771c,null));};exports[_0x142f('0x5c')]=function(_0x3fc978,_0xf2aca6,_0x2cf4c2){var _0x43034c={};var _0x351d2e={};var _0xa2c254;var _0x1eb9a3;return db[_0x142f('0x36')][_0x142f('0x57')]({'where':{'id':_0x3fc978[_0x142f('0x51')]['id']}})[_0x142f('0x2f')](handleEntityNotFound(_0xf2aca6,null))[_0x142f('0x2f')](function(_0x15c4a6){if(_0x15c4a6){_0xa2c254=_0x15c4a6;_0x351d2e[_0x142f('0x3b')]=_['keys'](db[_0x142f('0x58')][_0x142f('0x37')]);_0x351d2e[_0x142f('0x3d')]=_['keys'](_0x3fc978[_0x142f('0x3d')]);_0x351d2e['filters']=_['intersection'](_0x351d2e[_0x142f('0x3b')],_0x351d2e[_0x142f('0x3d')]);_0x43034c['attributes']=_['intersection'](_0x351d2e[_0x142f('0x3b')],qs[_0x142f('0x40')](_0x3fc978[_0x142f('0x3d')][_0x142f('0x40')]));_0x43034c[_0x142f('0x41')]=_0x43034c[_0x142f('0x41')][_0x142f('0x42')]?_0x43034c['attributes']:_0x351d2e[_0x142f('0x3b')];_0x43034c[_0x142f('0x59')]=qs[_0x142f('0x46')](_0x3fc978[_0x142f('0x3d')][_0x142f('0x46')]);_0x43034c[_0x142f('0x47')]=qs[_0x142f('0x5a')](_[_0x142f('0x48')](_0x3fc978['query'],_0x351d2e[_0x142f('0x5a')]));if(_0x3fc978[_0x142f('0x3d')][_0x142f('0x49')]){_0x43034c['where']=_['merge'](_0x43034c['where'],{'$or':_[_0x142f('0x3c')](_0x43034c[_0x142f('0x41')],function(_0x540fdc){var _0x5967e9={};_0x5967e9[_0x540fdc]={'$like':'%'+_0x3fc978['query']['filter']+'%'};return _0x5967e9;})});}_0x43034c=_['merge']({},_0x43034c,_0x3fc978[_0x142f('0x52')]);return _0xa2c254[_0x142f('0x5c')](_0x43034c);}})[_0x142f('0x2f')](function(_0x26e0ea){if(_0x26e0ea){_0x1eb9a3=_0x26e0ea['length'];if(!_0x3fc978[_0x142f('0x3d')]['hasOwnProperty'](_0x142f('0x44'))){_0x43034c[_0x142f('0x29')]=qs['limit'](_0x3fc978['query'][_0x142f('0x29')]);_0x43034c['offset']=qs[_0x142f('0x45')](_0x3fc978[_0x142f('0x3d')][_0x142f('0x45')]);}return _0xa2c254[_0x142f('0x5c')](_0x43034c);}})[_0x142f('0x2f')](function(_0x153112){if(_0x153112){return _0x153112?{'count':_0x1eb9a3,'rows':_0x153112}:null;}})[_0x142f('0x2f')](respondWithResult(_0xf2aca6,null))['catch'](handleError(_0xf2aca6,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index f76b023..b00cbf5 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 _0xec31=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','define','ServicenowConfiguration','int_servicenow_configurations','lodash'];(function(_0x40fbb4,_0x124359){var _0x30a97c=function(_0x5450f8){while(--_0x5450f8){_0x40fbb4['push'](_0x40fbb4['shift']());}};_0x30a97c(++_0x124359);}(_0xec31,0xa7));var _0x1ec3=function(_0x290265,_0x29b801){_0x290265=_0x290265-0x0;var _0x576bea=_0xec31[_0x290265];return _0x576bea;};'use strict';var _=require(_0x1ec3('0x0'));var util=require(_0x1ec3('0x1'));var logger=require(_0x1ec3('0x2'))(_0x1ec3('0x3'));var moment=require(_0x1ec3('0x4'));var BPromise=require(_0x1ec3('0x5'));var rp=require(_0x1ec3('0x6'));var fs=require('fs');var path=require(_0x1ec3('0x7'));var rimraf=require(_0x1ec3('0x8'));var config=require(_0x1ec3('0x9'));var attributes=require(_0x1ec3('0xa'));module['exports']=function(_0x1e9d53,_0x586f77){return _0x1e9d53[_0x1ec3('0xb')](_0x1ec3('0xc'),attributes,{'tableName':_0x1ec3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8e7d=['int_servicenow_configurations','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./intServicenowConfiguration.attributes'];(function(_0x6bf6da,_0x364069){var _0x5549a6=function(_0xdb7f9){while(--_0xdb7f9){_0x6bf6da['push'](_0x6bf6da['shift']());}};_0x5549a6(++_0x364069);}(_0x8e7d,0x71));var _0xd8e7=function(_0x3eadcb,_0x58fac6){_0x3eadcb=_0x3eadcb-0x0;var _0x367dc0=_0x8e7d[_0x3eadcb];return _0x367dc0;};'use strict';var _=require('lodash');var util=require(_0xd8e7('0x0'));var logger=require(_0xd8e7('0x1'))(_0xd8e7('0x2'));var moment=require('moment');var BPromise=require(_0xd8e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd8e7('0x4'));var config=require(_0xd8e7('0x5'));var attributes=require(_0xd8e7('0x6'));module['exports']=function(_0x233a1a,_0x5ca860){return _0x233a1a['define']('ServicenowConfiguration',attributes,{'tableName':_0xd8e7('0x7'),'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 2ae18ee..7d86b42 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 _0x5246=['stringify','error','code','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x4ab447,_0x4a775d){var _0xd56f75=function(_0x51cbb2){while(--_0x51cbb2){_0x4ab447['push'](_0x4ab447['shift']());}};_0xd56f75(++_0x4a775d);}(_0x5246,0x16b));var _0x6524=function(_0x1d0e4e,_0x24930d){_0x1d0e4e=_0x1d0e4e-0x0;var _0x1d4c1b=_0x5246[_0x1d0e4e];return _0x1d4c1b;};'use strict';var _=require('lodash');var util=require(_0x6524('0x0'));var moment=require(_0x6524('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6524('0x2'))['db'];var utils=require(_0x6524('0x3'));var logger=require(_0x6524('0x4'))(_0x6524('0x5'));var config=require(_0x6524('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6524('0x7')][_0x6524('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x430721,_0x248cea,_0x262eae){return new BPromise(function(_0x1a56b1,_0x5a5684){return client[_0x6524('0x9')](_0x430721,_0x262eae)[_0x6524('0xa')](function(_0x319c1b){logger['info'](_0x6524('0xb'),_0x248cea,_0x6524('0xc'));logger[_0x6524('0xd')](_0x6524('0xe'),_0x248cea,_0x6524('0xc'),JSON[_0x6524('0xf')](_0x319c1b));if(_0x319c1b[_0x6524('0x10')]){if(_0x319c1b[_0x6524('0x10')][_0x6524('0x11')]===0x1f4){logger[_0x6524('0x10')](_0x6524('0xb'),_0x248cea,_0x319c1b[_0x6524('0x10')][_0x6524('0x12')]);return _0x5a5684(_0x319c1b[_0x6524('0x10')][_0x6524('0x12')]);}logger[_0x6524('0x10')](_0x6524('0xb'),_0x248cea,_0x319c1b[_0x6524('0x10')][_0x6524('0x12')]);return _0x1a56b1(_0x319c1b[_0x6524('0x10')]['message']);}else{logger['info'](_0x6524('0xb'),_0x248cea,_0x6524('0xc'));_0x1a56b1(_0x319c1b[_0x6524('0x13')][_0x6524('0x12')]);}})[_0x6524('0x14')](function(_0x9f437c){logger[_0x6524('0x10')](_0x6524('0xb'),_0x248cea,_0x9f437c);_0x5a5684(_0x9f437c);});});} \ No newline at end of file +var _0x394f=['ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3afdd6,_0xf26e5b){var _0x151cc2=function(_0x450a8f){while(--_0x450a8f){_0x3afdd6['push'](_0x3afdd6['shift']());}};_0x151cc2(++_0xf26e5b);}(_0x394f,0x1e6));var _0xf394=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x394f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf394('0x0'));var util=require(_0xf394('0x1'));var moment=require(_0xf394('0x2'));var BPromise=require(_0xf394('0x3'));var rs=require(_0xf394('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf394('0x5'))['db'];var utils=require(_0xf394('0x6'));var logger=require(_0xf394('0x7'))(_0xf394('0x8'));var config=require(_0xf394('0x9'));var jayson=require(_0xf394('0xa'));var client=jayson['client'][_0xf394('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6926e8,_0x435c10,_0x72ee4d){return new BPromise(function(_0x216b2b,_0x335d46){return client[_0xf394('0xc')](_0x6926e8,_0x72ee4d)[_0xf394('0xd')](function(_0x2a8d38){logger[_0xf394('0xe')](_0xf394('0xf'),_0x435c10,_0xf394('0x10'));logger[_0xf394('0x11')](_0xf394('0x12'),_0x435c10,_0xf394('0x10'),JSON[_0xf394('0x13')](_0x2a8d38));if(_0x2a8d38[_0xf394('0x14')]){if(_0x2a8d38['error'][_0xf394('0x15')]===0x1f4){logger[_0xf394('0x14')](_0xf394('0xf'),_0x435c10,_0x2a8d38[_0xf394('0x14')][_0xf394('0x16')]);return _0x335d46(_0x2a8d38['error'][_0xf394('0x16')]);}logger[_0xf394('0x14')](_0xf394('0xf'),_0x435c10,_0x2a8d38[_0xf394('0x14')][_0xf394('0x16')]);return _0x216b2b(_0x2a8d38['error']['message']);}else{logger['info'](_0xf394('0xf'),_0x435c10,_0xf394('0x10'));_0x216b2b(_0x2a8d38[_0xf394('0x17')][_0xf394('0x16')]);}})['catch'](function(_0x321243){logger[_0xf394('0x14')](_0xf394('0xf'),_0x435c10,_0x321243);_0x335d46(_0x321243);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 85ce0d3..d88e200 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 _0x9dc0=['post','create','put','delete','destroy','multer','util','path','express','Router','./intServicenowField.controller','get','isAuthenticated','index','/:id'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x9dc0,0x122));var _0x09dc=function(_0x5c2c72,_0x22cf09){_0x5c2c72=_0x5c2c72-0x0;var _0x11c44c=_0x9dc0[_0x5c2c72];return _0x11c44c;};'use strict';var multer=require(_0x09dc('0x0'));var util=require(_0x09dc('0x1'));var path=require(_0x09dc('0x2'));var timeout=require('connect-timeout');var express=require(_0x09dc('0x3'));var router=express[_0x09dc('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x09dc('0x5'));router[_0x09dc('0x6')]('/',auth[_0x09dc('0x7')](),controller[_0x09dc('0x8')]);router[_0x09dc('0x6')](_0x09dc('0x9'),auth[_0x09dc('0x7')](),controller['show']);router[_0x09dc('0xa')]('/',auth[_0x09dc('0x7')](),controller[_0x09dc('0xb')]);router[_0x09dc('0xc')](_0x09dc('0x9'),auth[_0x09dc('0x7')](),controller['update']);router[_0x09dc('0xd')]('/:id',auth[_0x09dc('0x7')](),controller[_0x09dc('0xe')]);module['exports']=router; \ No newline at end of file +var _0x3edc=['show','post','create','put','/:id','isAuthenticated','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./intServicenowField.controller','get','index'];(function(_0x52a369,_0x9db657){var _0x4bee4d=function(_0x5bf1c4){while(--_0x5bf1c4){_0x52a369['push'](_0x52a369['shift']());}};_0x4bee4d(++_0x9db657);}(_0x3edc,0x1d2));var _0xc3ed=function(_0xc315de,_0x5dc877){_0xc315de=_0xc315de-0x0;var _0x11a627=_0x3edc[_0xc315de];return _0x11a627;};'use strict';var multer=require(_0xc3ed('0x0'));var util=require(_0xc3ed('0x1'));var path=require(_0xc3ed('0x2'));var timeout=require('connect-timeout');var express=require(_0xc3ed('0x3'));var router=express['Router']();var auth=require(_0xc3ed('0x4'));var interaction=require(_0xc3ed('0x5'));var config=require('../../config/environment');var controller=require(_0xc3ed('0x6'));router[_0xc3ed('0x7')]('/',auth['isAuthenticated'](),controller[_0xc3ed('0x8')]);router[_0xc3ed('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xc3ed('0x9')]);router[_0xc3ed('0xa')]('/',auth['isAuthenticated'](),controller[_0xc3ed('0xb')]);router[_0xc3ed('0xc')](_0xc3ed('0xd'),auth[_0xc3ed('0xe')](),controller[_0xc3ed('0xf')]);router[_0xc3ed('0x10')]('/:id',auth[_0xc3ed('0xe')](),controller[_0xc3ed('0x11')]);module[_0xc3ed('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 1b1fe88..5baa1f1 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 _0xfe52=['BOOLEAN','sequelize','exports','ENUM','variable','keyValue','string','STRING','customVariable'];(function(_0x2bec19,_0x5d0f3e){var _0x1cabd1=function(_0x38b46d){while(--_0x38b46d){_0x2bec19['push'](_0x2bec19['shift']());}};_0x1cabd1(++_0x5d0f3e);}(_0xfe52,0x1a8));var _0x2fe5=function(_0x319a5a,_0x2e8567){_0x319a5a=_0x319a5a-0x0;var _0x400fdf=_0xfe52[_0x319a5a];return _0x400fdf;};'use strict';var Sequelize=require(_0x2fe5('0x0'));module[_0x2fe5('0x1')]={'type':{'type':Sequelize[_0x2fe5('0x2')]('string',_0x2fe5('0x3'),'customVariable',_0x2fe5('0x4')),'defaultValue':_0x2fe5('0x5')},'content':{'type':Sequelize[_0x2fe5('0x6')]},'key':{'type':Sequelize[_0x2fe5('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x2fe5('0x5'),_0x2fe5('0x3'),_0x2fe5('0x7'))},'keyContent':{'type':Sequelize[_0x2fe5('0x6')]},'idField':{'type':Sequelize[_0x2fe5('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x2fe5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2fe5('0x6')]}}; \ No newline at end of file +var _0x62da=['customVariable','STRING','BOOLEAN','sequelize','ENUM','string','variable'];(function(_0x1350ce,_0x1c0668){var _0xf228a6=function(_0x5f1721){while(--_0x5f1721){_0x1350ce['push'](_0x1350ce['shift']());}};_0xf228a6(++_0x1c0668);}(_0x62da,0xc0));var _0xa62d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x62da[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xa62d('0x0'));module['exports']={'type':{'type':Sequelize[_0xa62d('0x1')](_0xa62d('0x2'),_0xa62d('0x3'),_0xa62d('0x4'),'keyValue'),'defaultValue':_0xa62d('0x2')},'content':{'type':Sequelize[_0xa62d('0x5')]},'key':{'type':Sequelize[_0xa62d('0x5')]},'keyType':{'type':Sequelize[_0xa62d('0x1')](_0xa62d('0x2'),_0xa62d('0x3'),_0xa62d('0x4'))},'keyContent':{'type':Sequelize[_0xa62d('0x5')]},'idField':{'type':Sequelize[_0xa62d('0x5')]},'nameField':{'type':Sequelize[_0xa62d('0x5')]},'customField':{'type':Sequelize[_0xa62d('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa62d('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 153d2af..0335da3 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 _0xb914=['update','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','lodash','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','destroy','then','error','name','map','ServicenowField','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','show','params','find','catch','create','body'];(function(_0x49dc9f,_0x559aa6){var _0x5db00f=function(_0x5cdb7){while(--_0x5cdb7){_0x49dc9f['push'](_0x49dc9f['shift']());}};_0x5db00f(++_0x559aa6);}(_0xb914,0x1dd));var _0x4b91=function(_0x53ce5d,_0x15efcc){_0x53ce5d=_0x53ce5d-0x0;var _0x25cefb=_0xb914[_0x53ce5d];return _0x25cefb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4b91('0x0'));var rimraf=require(_0x4b91('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4b91('0x2'));var rp=require(_0x4b91('0x3'));var moment=require(_0x4b91('0x4'));var BPromise=require(_0x4b91('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4b91('0x6'));var sox=require('sox');var csv=require(_0x4b91('0x7'));var ejs=require(_0x4b91('0x8'));var fs=require('fs');var _=require(_0x4b91('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4b91('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x4b91('0x7'));var querystring=require('querystring');var Papa=require(_0x4b91('0xb'));var Redis=require(_0x4b91('0xc'));var authService=require(_0x4b91('0xd'));var qs=require(_0x4b91('0xe'));var as=require(_0x4b91('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b91('0x10'))('api');var utils=require(_0x4b91('0x11'));var config=require('../../config/environment');var db=require(_0x4b91('0x12'))['db'];function respondWithStatusCode(_0x1a9b53,_0x47d722){_0x47d722=_0x47d722||0xcc;return function(_0x159bd1){if(_0x159bd1){return _0x1a9b53[_0x4b91('0x13')](_0x47d722);}return _0x1a9b53[_0x4b91('0x14')](_0x47d722)[_0x4b91('0x15')]();};}function respondWithResult(_0x4a9325,_0xa280b8){_0xa280b8=_0xa280b8||0xc8;return function(_0x55a573){if(_0x55a573){return _0x4a9325[_0x4b91('0x14')](_0xa280b8)[_0x4b91('0x16')](_0x55a573);}};}function respondWithFilteredResult(_0x3306f2,_0x2eaec4){return function(_0x214f85){if(_0x214f85){var _0x1d2080=_0x214f85['count'],_0xccf539=_0x2eaec4[_0x4b91('0x17')],_0x4b49c9=_0x2eaec4[_0x4b91('0x17')]+_0x2eaec4[_0x4b91('0x18')],_0x25f507;if(_0x4b49c9>=_0x1d2080){_0x4b49c9=_0x1d2080;_0x25f507=0xc8;}else{_0x25f507=0xce;}_0x3306f2['status'](_0x25f507);return _0x3306f2[_0x4b91('0x19')](_0x4b91('0x1a'),_0xccf539+'-'+_0x4b49c9+'/'+_0x1d2080)[_0x4b91('0x16')](_0x214f85);}return null;};}function patchUpdates(_0xe939b8){return function(_0x7531d5){try{jsonpatch[_0x4b91('0x1b')](_0x7531d5,_0xe939b8,!![]);}catch(_0x4fa7d4){return BPromise['reject'](_0x4fa7d4);}return _0x7531d5[_0x4b91('0x1c')]();};}function saveUpdates(_0x2b6e19,_0x2a3bf5){return function(_0x194398){if(_0x194398){return _0x194398['update'](_0x2b6e19)['then'](function(_0x16cb4a){return _0x16cb4a;});}return null;};}function removeEntity(_0x38b91b,_0x10335c){return function(_0xad7e5c){if(_0xad7e5c){return _0xad7e5c[_0x4b91('0x1d')]()[_0x4b91('0x1e')](function(){_0x38b91b[_0x4b91('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3e804c,_0x47f95d){return function(_0x3e2cc8){if(!_0x3e2cc8){_0x3e804c['sendStatus'](0x194);}return _0x3e2cc8;};}function handleError(_0x9ddfaa,_0x3dba0a){_0x3dba0a=_0x3dba0a||0x1f4;return function(_0x312b0b){logger[_0x4b91('0x1f')](_0x312b0b['stack']);if(_0x312b0b[_0x4b91('0x20')]){delete _0x312b0b[_0x4b91('0x20')];}_0x9ddfaa[_0x4b91('0x14')](_0x3dba0a)['send'](_0x312b0b);};}exports['index']=function(_0xc91ced,_0x47e9e3){var _0x268ff9={},_0x15cfb0={},_0x35a81f={'count':0x0,'rows':[]};var _0x3145aa=_[_0x4b91('0x21')](db[_0x4b91('0x22')][_0x4b91('0x23')],function(_0x2300eb){return{'name':_0x2300eb[_0x4b91('0x24')],'type':_0x2300eb[_0x4b91('0x25')][_0x4b91('0x26')]};});_0x15cfb0[_0x4b91('0x27')]=_[_0x4b91('0x21')](_0x3145aa,_0x4b91('0x20'));_0x15cfb0['query']=_[_0x4b91('0x28')](_0xc91ced['query']);_0x15cfb0['filters']=_[_0x4b91('0x29')](_0x15cfb0[_0x4b91('0x27')],_0x15cfb0[_0x4b91('0x2a')]);_0x268ff9[_0x4b91('0x2b')]=_['intersection'](_0x15cfb0[_0x4b91('0x27')],qs[_0x4b91('0x2c')](_0xc91ced[_0x4b91('0x2a')][_0x4b91('0x2c')]));_0x268ff9['attributes']=_0x268ff9[_0x4b91('0x2b')][_0x4b91('0x2d')]?_0x268ff9[_0x4b91('0x2b')]:_0x15cfb0['model'];if(!_0xc91ced['query'][_0x4b91('0x2e')](_0x4b91('0x2f'))){_0x268ff9[_0x4b91('0x18')]=qs[_0x4b91('0x18')](_0xc91ced[_0x4b91('0x2a')]['limit']);_0x268ff9[_0x4b91('0x17')]=qs[_0x4b91('0x17')](_0xc91ced[_0x4b91('0x2a')][_0x4b91('0x17')]);}_0x268ff9['order']=qs[_0x4b91('0x30')](_0xc91ced[_0x4b91('0x2a')][_0x4b91('0x30')]);_0x268ff9['where']=qs[_0x4b91('0x31')](_[_0x4b91('0x32')](_0xc91ced[_0x4b91('0x2a')],_0x15cfb0[_0x4b91('0x31')]));if(_0xc91ced['query'][_0x4b91('0x33')]){_0x268ff9['where']=_['merge'](_0x268ff9[_0x4b91('0x34')],{'$or':_[_0x4b91('0x21')](_0x3145aa,function(_0x57121a){if(_0x57121a[_0x4b91('0x25')]!==_0x4b91('0x35')){var _0x5d4337={};_0x5d4337[_0x57121a[_0x4b91('0x20')]]={'$like':'%'+_0xc91ced['query'][_0x4b91('0x33')]+'%'};return _0x5d4337;}})});}_0x268ff9=_[_0x4b91('0x36')]({},_0x268ff9,_0xc91ced[_0x4b91('0x37')]);var _0x2d3cf1={'where':_0x268ff9[_0x4b91('0x34')]};return db['ServicenowField'][_0x4b91('0x38')](_0x2d3cf1)[_0x4b91('0x1e')](function(_0x507d61){_0x35a81f[_0x4b91('0x38')]=_0x507d61;if(_0xc91ced['query'][_0x4b91('0x39')]){_0x268ff9[_0x4b91('0x3a')]=[{'all':!![]}];}return db['ServicenowField'][_0x4b91('0x3b')](_0x268ff9);})[_0x4b91('0x1e')](function(_0x45b80c){_0x35a81f[_0x4b91('0x3c')]=_0x45b80c;return _0x35a81f;})[_0x4b91('0x1e')](respondWithFilteredResult(_0x47e9e3,_0x268ff9))['catch'](handleError(_0x47e9e3,null));};exports[_0x4b91('0x3d')]=function(_0x185ab6,_0x1d34b6){var _0xd7e922={'raw':!![],'where':{'id':_0x185ab6[_0x4b91('0x3e')]['id']}},_0x307efa={};_0x307efa[_0x4b91('0x27')]=_['keys'](db['ServicenowField'][_0x4b91('0x23')]);_0x307efa[_0x4b91('0x2a')]=_['keys'](_0x185ab6[_0x4b91('0x2a')]);_0x307efa['filters']=_[_0x4b91('0x29')](_0x307efa[_0x4b91('0x27')],_0x307efa[_0x4b91('0x2a')]);_0xd7e922[_0x4b91('0x2b')]=_['intersection'](_0x307efa[_0x4b91('0x27')],qs[_0x4b91('0x2c')](_0x185ab6[_0x4b91('0x2a')][_0x4b91('0x2c')]));_0xd7e922[_0x4b91('0x2b')]=_0xd7e922['attributes'][_0x4b91('0x2d')]?_0xd7e922[_0x4b91('0x2b')]:_0x307efa[_0x4b91('0x27')];if(_0x185ab6[_0x4b91('0x2a')][_0x4b91('0x39')]){_0xd7e922['include']=[{'all':!![]}];}_0xd7e922=_['merge']({},_0xd7e922,_0x185ab6[_0x4b91('0x37')]);return db['ServicenowField'][_0x4b91('0x3f')](_0xd7e922)[_0x4b91('0x1e')](handleEntityNotFound(_0x1d34b6,null))[_0x4b91('0x1e')](respondWithResult(_0x1d34b6,null))[_0x4b91('0x40')](handleError(_0x1d34b6,null));};exports['create']=function(_0x11b9ab,_0x4d5003){return db[_0x4b91('0x22')][_0x4b91('0x41')](_0x11b9ab[_0x4b91('0x42')],{})[_0x4b91('0x1e')](respondWithResult(_0x4d5003,0xc9))[_0x4b91('0x40')](handleError(_0x4d5003,null));};exports[_0x4b91('0x43')]=function(_0x188db2,_0x505d44){if(_0x188db2['body']['id']){delete _0x188db2[_0x4b91('0x42')]['id'];}return db['ServicenowField'][_0x4b91('0x3f')]({'where':{'id':_0x188db2[_0x4b91('0x3e')]['id']}})[_0x4b91('0x1e')](handleEntityNotFound(_0x505d44,null))[_0x4b91('0x1e')](saveUpdates(_0x188db2[_0x4b91('0x42')],null))['then'](respondWithResult(_0x505d44,null))['catch'](handleError(_0x505d44,null));};exports[_0x4b91('0x1d')]=function(_0x420b45,_0x3b7b43){return db['ServicenowField'][_0x4b91('0x3f')]({'where':{'id':_0x420b45[_0x4b91('0x3e')]['id']}})[_0x4b91('0x1e')](handleEntityNotFound(_0x3b7b43,null))[_0x4b91('0x1e')](removeEntity(_0x3b7b43,null))[_0x4b91('0x40')](handleError(_0x3b7b43,null));}; \ No newline at end of file +var _0xfa76=['body','find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','save','then','destroy','sendStatus','stack','name','ServicenowField','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','findAll','rows','catch','show','params','includeAll','create'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xfa76,0x112));var _0x6fa7=function(_0x58a090,_0x387797){_0x58a090=_0x58a090-0x0;var _0xf8f0ca=_0xfa76[_0x58a090];return _0xf8f0ca;};'use strict';var pdf=require(_0x6fa7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6fa7('0x1'));var zipdir=require(_0x6fa7('0x2'));var jsonpatch=require(_0x6fa7('0x3'));var rp=require(_0x6fa7('0x4'));var moment=require('moment');var BPromise=require(_0x6fa7('0x5'));var Mustache=require(_0x6fa7('0x6'));var util=require(_0x6fa7('0x7'));var path=require(_0x6fa7('0x8'));var sox=require('sox');var csv=require(_0x6fa7('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6fa7('0xa'));var squel=require('squel');var crypto=require(_0x6fa7('0xb'));var jsforce=require(_0x6fa7('0xc'));var deskjs=require(_0x6fa7('0xd'));var toCsv=require(_0x6fa7('0x9'));var querystring=require('querystring');var Papa=require(_0x6fa7('0xe'));var Redis=require(_0x6fa7('0xf'));var authService=require(_0x6fa7('0x10'));var qs=require(_0x6fa7('0x11'));var as=require(_0x6fa7('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6fa7('0x13'))('api');var utils=require('../../config/utils');var config=require(_0x6fa7('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x30d298,_0xdc57e9){_0xdc57e9=_0xdc57e9||0xcc;return function(_0x3536d3){if(_0x3536d3){return _0x30d298['sendStatus'](_0xdc57e9);}return _0x30d298[_0x6fa7('0x15')](_0xdc57e9)[_0x6fa7('0x16')]();};}function respondWithResult(_0x30955e,_0x1a571d){_0x1a571d=_0x1a571d||0xc8;return function(_0x139f12){if(_0x139f12){return _0x30955e[_0x6fa7('0x15')](_0x1a571d)['json'](_0x139f12);}};}function respondWithFilteredResult(_0x38106f,_0x4d0e89){return function(_0xef6fc8){if(_0xef6fc8){var _0xdc270=_0xef6fc8[_0x6fa7('0x17')],_0x429d01=_0x4d0e89[_0x6fa7('0x18')],_0xb9e76a=_0x4d0e89[_0x6fa7('0x18')]+_0x4d0e89[_0x6fa7('0x19')],_0x282f8d;if(_0xb9e76a>=_0xdc270){_0xb9e76a=_0xdc270;_0x282f8d=0xc8;}else{_0x282f8d=0xce;}_0x38106f[_0x6fa7('0x15')](_0x282f8d);return _0x38106f[_0x6fa7('0x1a')](_0x6fa7('0x1b'),_0x429d01+'-'+_0xb9e76a+'/'+_0xdc270)[_0x6fa7('0x1c')](_0xef6fc8);}return null;};}function patchUpdates(_0xbca73a){return function(_0x4bf808){try{jsonpatch['apply'](_0x4bf808,_0xbca73a,!![]);}catch(_0xd29099){return BPromise['reject'](_0xd29099);}return _0x4bf808[_0x6fa7('0x1d')]();};}function saveUpdates(_0x4c56fc,_0x443031){return function(_0x30a4ee){if(_0x30a4ee){return _0x30a4ee['update'](_0x4c56fc)[_0x6fa7('0x1e')](function(_0x4b8b1b){return _0x4b8b1b;});}return null;};}function removeEntity(_0x580cff,_0xceeb17){return function(_0x9e298b){if(_0x9e298b){return _0x9e298b[_0x6fa7('0x1f')]()[_0x6fa7('0x1e')](function(){_0x580cff[_0x6fa7('0x15')](0xcc)[_0x6fa7('0x16')]();});}};}function handleEntityNotFound(_0x5cef86,_0x4a8a56){return function(_0x15b7a0){if(!_0x15b7a0){_0x5cef86[_0x6fa7('0x20')](0x194);}return _0x15b7a0;};}function handleError(_0x25e787,_0x253288){_0x253288=_0x253288||0x1f4;return function(_0x5f3aab){logger['error'](_0x5f3aab[_0x6fa7('0x21')]);if(_0x5f3aab[_0x6fa7('0x22')]){delete _0x5f3aab[_0x6fa7('0x22')];}_0x25e787[_0x6fa7('0x15')](_0x253288)['send'](_0x5f3aab);};}exports['index']=function(_0x393f3d,_0x1b4ba0){var _0x440f4b={},_0x271c5a={},_0x35ad88={'count':0x0,'rows':[]};var _0xc184fa=_['map'](db[_0x6fa7('0x23')][_0x6fa7('0x24')],function(_0x3a15f6){return{'name':_0x3a15f6[_0x6fa7('0x25')],'type':_0x3a15f6[_0x6fa7('0x26')]['key']};});_0x271c5a[_0x6fa7('0x27')]=_[_0x6fa7('0x28')](_0xc184fa,_0x6fa7('0x22'));_0x271c5a['query']=_[_0x6fa7('0x29')](_0x393f3d[_0x6fa7('0x2a')]);_0x271c5a['filters']=_[_0x6fa7('0x2b')](_0x271c5a[_0x6fa7('0x27')],_0x271c5a[_0x6fa7('0x2a')]);_0x440f4b[_0x6fa7('0x2c')]=_[_0x6fa7('0x2b')](_0x271c5a[_0x6fa7('0x27')],qs[_0x6fa7('0x2d')](_0x393f3d[_0x6fa7('0x2a')][_0x6fa7('0x2d')]));_0x440f4b['attributes']=_0x440f4b[_0x6fa7('0x2c')][_0x6fa7('0x2e')]?_0x440f4b[_0x6fa7('0x2c')]:_0x271c5a['model'];if(!_0x393f3d[_0x6fa7('0x2a')][_0x6fa7('0x2f')](_0x6fa7('0x30'))){_0x440f4b[_0x6fa7('0x19')]=qs[_0x6fa7('0x19')](_0x393f3d['query']['limit']);_0x440f4b[_0x6fa7('0x18')]=qs[_0x6fa7('0x18')](_0x393f3d[_0x6fa7('0x2a')][_0x6fa7('0x18')]);}_0x440f4b[_0x6fa7('0x31')]=qs[_0x6fa7('0x32')](_0x393f3d[_0x6fa7('0x2a')][_0x6fa7('0x32')]);_0x440f4b[_0x6fa7('0x33')]=qs[_0x6fa7('0x34')](_[_0x6fa7('0x35')](_0x393f3d[_0x6fa7('0x2a')],_0x271c5a[_0x6fa7('0x34')]));if(_0x393f3d['query'][_0x6fa7('0x36')]){_0x440f4b[_0x6fa7('0x33')]=_['merge'](_0x440f4b[_0x6fa7('0x33')],{'$or':_[_0x6fa7('0x28')](_0xc184fa,function(_0x54e1a8){if(_0x54e1a8['type']!==_0x6fa7('0x37')){var _0xa9b3d6={};_0xa9b3d6[_0x54e1a8[_0x6fa7('0x22')]]={'$like':'%'+_0x393f3d[_0x6fa7('0x2a')][_0x6fa7('0x36')]+'%'};return _0xa9b3d6;}})});}_0x440f4b=_[_0x6fa7('0x38')]({},_0x440f4b,_0x393f3d[_0x6fa7('0x39')]);var _0x3d81db={'where':_0x440f4b[_0x6fa7('0x33')]};return db['ServicenowField']['count'](_0x3d81db)['then'](function(_0x4a349d){_0x35ad88[_0x6fa7('0x17')]=_0x4a349d;if(_0x393f3d[_0x6fa7('0x2a')]['includeAll']){_0x440f4b[_0x6fa7('0x3a')]=[{'all':!![]}];}return db[_0x6fa7('0x23')][_0x6fa7('0x3b')](_0x440f4b);})['then'](function(_0x5bbb74){_0x35ad88[_0x6fa7('0x3c')]=_0x5bbb74;return _0x35ad88;})['then'](respondWithFilteredResult(_0x1b4ba0,_0x440f4b))[_0x6fa7('0x3d')](handleError(_0x1b4ba0,null));};exports[_0x6fa7('0x3e')]=function(_0x49bdaa,_0x3a77ce){var _0x36fa9b={'raw':!![],'where':{'id':_0x49bdaa[_0x6fa7('0x3f')]['id']}},_0x45b936={};_0x45b936[_0x6fa7('0x27')]=_[_0x6fa7('0x29')](db[_0x6fa7('0x23')][_0x6fa7('0x24')]);_0x45b936[_0x6fa7('0x2a')]=_[_0x6fa7('0x29')](_0x49bdaa[_0x6fa7('0x2a')]);_0x45b936[_0x6fa7('0x34')]=_['intersection'](_0x45b936[_0x6fa7('0x27')],_0x45b936[_0x6fa7('0x2a')]);_0x36fa9b[_0x6fa7('0x2c')]=_[_0x6fa7('0x2b')](_0x45b936[_0x6fa7('0x27')],qs[_0x6fa7('0x2d')](_0x49bdaa['query'][_0x6fa7('0x2d')]));_0x36fa9b[_0x6fa7('0x2c')]=_0x36fa9b[_0x6fa7('0x2c')]['length']?_0x36fa9b['attributes']:_0x45b936[_0x6fa7('0x27')];if(_0x49bdaa[_0x6fa7('0x2a')][_0x6fa7('0x40')]){_0x36fa9b[_0x6fa7('0x3a')]=[{'all':!![]}];}_0x36fa9b=_[_0x6fa7('0x38')]({},_0x36fa9b,_0x49bdaa[_0x6fa7('0x39')]);return db[_0x6fa7('0x23')]['find'](_0x36fa9b)['then'](handleEntityNotFound(_0x3a77ce,null))[_0x6fa7('0x1e')](respondWithResult(_0x3a77ce,null))[_0x6fa7('0x3d')](handleError(_0x3a77ce,null));};exports[_0x6fa7('0x41')]=function(_0x52003b,_0x4e87f9){return db[_0x6fa7('0x23')][_0x6fa7('0x41')](_0x52003b['body'],{})['then'](respondWithResult(_0x4e87f9,0xc9))['catch'](handleError(_0x4e87f9,null));};exports['update']=function(_0x364828,_0x2892a0){if(_0x364828[_0x6fa7('0x42')]['id']){delete _0x364828[_0x6fa7('0x42')]['id'];}return db[_0x6fa7('0x23')][_0x6fa7('0x43')]({'where':{'id':_0x364828[_0x6fa7('0x3f')]['id']}})[_0x6fa7('0x1e')](handleEntityNotFound(_0x2892a0,null))[_0x6fa7('0x1e')](saveUpdates(_0x364828['body'],null))[_0x6fa7('0x1e')](respondWithResult(_0x2892a0,null))[_0x6fa7('0x3d')](handleError(_0x2892a0,null));};exports['destroy']=function(_0x159557,_0x493928){return db[_0x6fa7('0x23')][_0x6fa7('0x43')]({'where':{'id':_0x159557[_0x6fa7('0x3f')]['id']}})[_0x6fa7('0x1e')](handleEntityNotFound(_0x493928,null))['then'](removeEntity(_0x493928,null))[_0x6fa7('0x3d')](handleError(_0x493928,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 36176ba..118ed13 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 _0x0a37=['moment','bluebird','request-promise','rimraf','./intServicenowField.attributes','exports','ServicenowField','idField','FieldId','util','../../config/logger','api'];(function(_0x1b9d97,_0x19159b){var _0x1d7a29=function(_0x5456d9){while(--_0x5456d9){_0x1b9d97['push'](_0x1b9d97['shift']());}};_0x1d7a29(++_0x19159b);}(_0x0a37,0x69));var _0x70a3=function(_0x3f2d02,_0x2c7deb){_0x3f2d02=_0x3f2d02-0x0;var _0x54092b=_0x0a37[_0x3f2d02];return _0x54092b;};'use strict';var _=require('lodash');var util=require(_0x70a3('0x0'));var logger=require(_0x70a3('0x1'))(_0x70a3('0x2'));var moment=require(_0x70a3('0x3'));var BPromise=require(_0x70a3('0x4'));var rp=require(_0x70a3('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x70a3('0x6'));var config=require('../../config/environment');var attributes=require(_0x70a3('0x7'));module[_0x70a3('0x8')]=function(_0x51c596,_0x4a3a89){return _0x51c596['define'](_0x70a3('0x9'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x70a3('0xa'),_0x70a3('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x437b=['idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','define','ServicenowField'];(function(_0x550c4d,_0x430798){var _0x10077b=function(_0x1576eb){while(--_0x1576eb){_0x550c4d['push'](_0x550c4d['shift']());}};_0x10077b(++_0x430798);}(_0x437b,0x1ec));var _0xb437=function(_0x32f9ca,_0x2fa8bc){_0x32f9ca=_0x32f9ca-0x0;var _0x52e083=_0x437b[_0x32f9ca];return _0x52e083;};'use strict';var _=require(_0xb437('0x0'));var util=require(_0xb437('0x1'));var logger=require(_0xb437('0x2'))('api');var moment=require(_0xb437('0x3'));var BPromise=require(_0xb437('0x4'));var rp=require(_0xb437('0x5'));var fs=require('fs');var path=require(_0xb437('0x6'));var rimraf=require(_0xb437('0x7'));var config=require(_0xb437('0x8'));var attributes=require(_0xb437('0x9'));module['exports']=function(_0x2fe1ee,_0xddff64){return _0x2fe1ee[_0xb437('0xa')](_0xb437('0xb'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0xb437('0xc'),_0xb437('0xd')],'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 ed895d5..611730a 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 _0xfa5b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowField,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x134058,_0x423995){var _0x14a1a9=function(_0x47a2c9){while(--_0x47a2c9){_0x134058['push'](_0x134058['shift']());}};_0x14a1a9(++_0x423995);}(_0xfa5b,0x1d8));var _0xbfa5=function(_0x68ee8b,_0x3cc6c5){_0x68ee8b=_0x68ee8b-0x0;var _0x5148f7=_0xfa5b[_0x68ee8b];return _0x5148f7;};'use strict';var _=require(_0xbfa5('0x0'));var util=require(_0xbfa5('0x1'));var moment=require(_0xbfa5('0x2'));var BPromise=require(_0xbfa5('0x3'));var rs=require(_0xbfa5('0x4'));var fs=require('fs');var Redis=require(_0xbfa5('0x5'));var db=require(_0xbfa5('0x6'))['db'];var utils=require(_0xbfa5('0x7'));var logger=require(_0xbfa5('0x8'))(_0xbfa5('0x9'));var config=require(_0xbfa5('0xa'));var jayson=require(_0xbfa5('0xb'));var client=jayson[_0xbfa5('0xc')][_0xbfa5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x37213f,_0x3d3d56,_0x53f6c6){return new BPromise(function(_0x2d52c2,_0x2a4619){return client['request'](_0x37213f,_0x53f6c6)[_0xbfa5('0xe')](function(_0x2906f7){logger[_0xbfa5('0xf')]('ServicenowField,\x20%s,\x20%s',_0x3d3d56,_0xbfa5('0x10'));logger['debug'](_0xbfa5('0x11'),_0x3d3d56,_0xbfa5('0x10'),JSON[_0xbfa5('0x12')](_0x2906f7));if(_0x2906f7[_0xbfa5('0x13')]){if(_0x2906f7[_0xbfa5('0x13')][_0xbfa5('0x14')]===0x1f4){logger['error']('ServicenowField,\x20%s,\x20%s',_0x3d3d56,_0x2906f7[_0xbfa5('0x13')][_0xbfa5('0x15')]);return _0x2a4619(_0x2906f7[_0xbfa5('0x13')][_0xbfa5('0x15')]);}logger[_0xbfa5('0x13')](_0xbfa5('0x16'),_0x3d3d56,_0x2906f7[_0xbfa5('0x13')]['message']);return _0x2d52c2(_0x2906f7[_0xbfa5('0x13')][_0xbfa5('0x15')]);}else{logger[_0xbfa5('0xf')](_0xbfa5('0x16'),_0x3d3d56,_0xbfa5('0x10'));_0x2d52c2(_0x2906f7[_0xbfa5('0x17')][_0xbfa5('0x15')]);}})[_0xbfa5('0x18')](function(_0x67c091){logger[_0xbfa5('0x13')]('ServicenowField,\x20%s,\x20%s',_0x3d3d56,_0x67c091);_0x2a4619(_0x67c091);});});} \ No newline at end of file +var _0x8564=['request','then','info','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x1b7794,_0x5003a7){var _0x111221=function(_0x56bb55){while(--_0x56bb55){_0x1b7794['push'](_0x1b7794['shift']());}};_0x111221(++_0x5003a7);}(_0x8564,0x12a));var _0x4856=function(_0x3e4d77,_0x26dcfa){_0x3e4d77=_0x3e4d77-0x0;var _0x2a3f80=_0x8564[_0x3e4d77];return _0x2a3f80;};'use strict';var _=require('lodash');var util=require(_0x4856('0x0'));var moment=require(_0x4856('0x1'));var BPromise=require(_0x4856('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4856('0x3'));var db=require(_0x4856('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4856('0x5'));var config=require(_0x4856('0x6'));var jayson=require(_0x4856('0x7'));var client=jayson[_0x4856('0x8')][_0x4856('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe0a501,_0x2d6521,_0x44244c){return new BPromise(function(_0x49e079,_0x57d3af){return client[_0x4856('0xa')](_0xe0a501,_0x44244c)[_0x4856('0xb')](function(_0x5356b6){logger[_0x4856('0xc')](_0x4856('0xd'),_0x2d6521,_0x4856('0xe'));logger[_0x4856('0xf')](_0x4856('0x10'),_0x2d6521,_0x4856('0xe'),JSON[_0x4856('0x11')](_0x5356b6));if(_0x5356b6[_0x4856('0x12')]){if(_0x5356b6['error'][_0x4856('0x13')]===0x1f4){logger[_0x4856('0x12')](_0x4856('0xd'),_0x2d6521,_0x5356b6[_0x4856('0x12')][_0x4856('0x14')]);return _0x57d3af(_0x5356b6[_0x4856('0x12')][_0x4856('0x14')]);}logger[_0x4856('0x12')](_0x4856('0xd'),_0x2d6521,_0x5356b6[_0x4856('0x12')]['message']);return _0x49e079(_0x5356b6[_0x4856('0x12')][_0x4856('0x14')]);}else{logger[_0x4856('0xc')](_0x4856('0xd'),_0x2d6521,_0x4856('0xe'));_0x49e079(_0x5356b6[_0x4856('0x15')][_0x4856('0x14')]);}})['catch'](function(_0x5cd07a){logger[_0x4856('0x12')](_0x4856('0xd'),_0x2d6521,_0x5cd07a);_0x57d3af(_0x5cd07a);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index c64fbcb..0ca12fc 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 _0xc297=['index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','post','create','addConfiguration','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2235bf,_0x3a06a7){var _0x4c3a64=function(_0x3b3bb6){while(--_0x3b3bb6){_0x2235bf['push'](_0x2235bf['shift']());}};_0x4c3a64(++_0x3a06a7);}(_0xc297,0x198));var _0x7c29=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xc297[_0x1b1e76];return _0x3d743a;};'use strict';var multer=require(_0x7c29('0x0'));var util=require(_0x7c29('0x1'));var path=require('path');var timeout=require(_0x7c29('0x2'));var express=require(_0x7c29('0x3'));var router=express[_0x7c29('0x4')]();var auth=require(_0x7c29('0x5'));var interaction=require(_0x7c29('0x6'));var config=require(_0x7c29('0x7'));var controller=require('./intSugarcrmAccount.controller');router[_0x7c29('0x8')]('/',auth[_0x7c29('0x9')](),controller[_0x7c29('0xa')]);router['get'](_0x7c29('0xb'),auth[_0x7c29('0x9')](),controller[_0x7c29('0xc')]);router[_0x7c29('0x8')](_0x7c29('0xd'),auth[_0x7c29('0x9')](),controller[_0x7c29('0xe')]);router[_0x7c29('0x8')](_0x7c29('0xf'),auth[_0x7c29('0x9')](),controller['getFields']);router[_0x7c29('0x10')]('/',auth[_0x7c29('0x9')](),controller[_0x7c29('0x11')]);router[_0x7c29('0x10')](_0x7c29('0xd'),auth['isAuthenticated'](),controller[_0x7c29('0x12')]);router['put'](_0x7c29('0xb'),auth[_0x7c29('0x9')](),controller['update']);router[_0x7c29('0x13')](_0x7c29('0xb'),auth[_0x7c29('0x9')](),controller[_0x7c29('0x14')]);module[_0x7c29('0x15')]=router; \ No newline at end of file +var _0x73d7=['index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated'];(function(_0x534d9a,_0x26b7cd){var _0x3a8d1d=function(_0x35ceea){while(--_0x35ceea){_0x534d9a['push'](_0x534d9a['shift']());}};_0x3a8d1d(++_0x26b7cd);}(_0x73d7,0x176));var _0x773d=function(_0x37730c,_0x3afec0){_0x37730c=_0x37730c-0x0;var _0x1c1466=_0x73d7[_0x37730c];return _0x1c1466;};'use strict';var multer=require(_0x773d('0x0'));var util=require(_0x773d('0x1'));var path=require(_0x773d('0x2'));var timeout=require(_0x773d('0x3'));var express=require('express');var router=express[_0x773d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x773d('0x5'));var config=require(_0x773d('0x6'));var controller=require(_0x773d('0x7'));router[_0x773d('0x8')]('/',auth[_0x773d('0x9')](),controller[_0x773d('0xa')]);router['get'](_0x773d('0xb'),auth[_0x773d('0x9')](),controller[_0x773d('0xc')]);router[_0x773d('0x8')]('/:id/configurations',auth[_0x773d('0x9')](),controller[_0x773d('0xd')]);router[_0x773d('0x8')](_0x773d('0xe'),auth[_0x773d('0x9')](),controller[_0x773d('0xf')]);router[_0x773d('0x10')]('/',auth['isAuthenticated'](),controller[_0x773d('0x11')]);router[_0x773d('0x10')](_0x773d('0x12'),auth[_0x773d('0x9')](),controller[_0x773d('0x13')]);router[_0x773d('0x14')](_0x773d('0xb'),auth[_0x773d('0x9')](),controller[_0x773d('0x15')]);router['delete'](_0x773d('0xb'),auth[_0x773d('0x9')](),controller[_0x773d('0x16')]);module[_0x773d('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 5243776..89be940 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 _0xdb61=['STRING','remoteUri','sequelize'];(function(_0x103116,_0x4d1a1f){var _0x3519dc=function(_0x423ff0){while(--_0x423ff0){_0x103116['push'](_0x103116['shift']());}};_0x3519dc(++_0x4d1a1f);}(_0xdb61,0xfb));var _0x1db6=function(_0x10b87c,_0x126533){_0x10b87c=_0x10b87c-0x0;var _0x1d269f=_0xdb61[_0x10b87c];return _0x1d269f;};'use strict';var Sequelize=require(_0x1db6('0x0'));module['exports']={'name':{'type':Sequelize[_0x1db6('0x1')]},'description':{'type':Sequelize[_0x1db6('0x1')]},'username':{'type':Sequelize[_0x1db6('0x1')],'unique':'username'},'password':{'type':Sequelize[_0x1db6('0x1')]},'remoteUri':{'type':Sequelize[_0x1db6('0x1')],'unique':_0x1db6('0x2')},'serverUrl':{'type':Sequelize[_0x1db6('0x1')]}}; \ No newline at end of file +var _0x1828=['username','remoteUri','STRING'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0x1828,0xb0));var _0x8182=function(_0x474983,_0x25e4b5){_0x474983=_0x474983-0x0;var _0x1f545f=_0x1828[_0x474983];return _0x1f545f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8182('0x0')]},'description':{'type':Sequelize[_0x8182('0x0')]},'username':{'type':Sequelize[_0x8182('0x0')],'unique':_0x8182('0x1')},'password':{'type':Sequelize[_0x8182('0x0')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x8182('0x2')},'serverUrl':{'type':Sequelize[_0x8182('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index def4fa6..85e53e9 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 _0x7053=['channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_type','parent_name','direction','username','password','remoteUri','slice','substring','lastIndexOf','format','/service/v4_1/rest.php','login','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','get_module_fields','Calls','module_fields','remove','includes','label','values','value','getFields,\x20%s,\x20%s,\x20%s','statusCode','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','SugarcrmAccount','rawAttributes','fieldName','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','params','intersection','length','find','create','body','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects'];(function(_0x1b48bd,_0x7e2c9f){var _0x43d4aa=function(_0xa2a3e7){while(--_0xa2a3e7){_0x1b48bd['push'](_0x1b48bd['shift']());}};_0x43d4aa(++_0x7e2c9f);}(_0x7053,0x137));var _0x3705=function(_0x1dd532,_0x36e81c){_0x1dd532=_0x1dd532-0x0;var _0x3732aa=_0x7053[_0x1dd532];return _0x3732aa;};'use strict';var pdf=require(_0x3705('0x0'));var emlformat=require(_0x3705('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3705('0x2'));var jsonpatch=require(_0x3705('0x3'));var rp=require(_0x3705('0x4'));var moment=require(_0x3705('0x5'));var BPromise=require(_0x3705('0x6'));var Mustache=require(_0x3705('0x7'));var util=require('util');var path=require(_0x3705('0x8'));var sox=require('sox');var csv=require(_0x3705('0x9'));var ejs=require(_0x3705('0xa'));var fs=require('fs');var _=require(_0x3705('0xb'));var squel=require(_0x3705('0xc'));var crypto=require(_0x3705('0xd'));var jsforce=require(_0x3705('0xe'));var deskjs=require(_0x3705('0xf'));var toCsv=require(_0x3705('0x9'));var querystring=require(_0x3705('0x10'));var Papa=require(_0x3705('0x11'));var Redis=require(_0x3705('0x12'));var authService=require(_0x3705('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3705('0x14'));var hardwareService=require(_0x3705('0x15'));var logger=require(_0x3705('0x16'))(_0x3705('0x17'));var utils=require(_0x3705('0x18'));var config=require(_0x3705('0x19'));var db=require(_0x3705('0x1a'))['db'];var integrations=require(_0x3705('0x1b'));var jayson=require(_0x3705('0x1c'));var client=jayson[_0x3705('0x1d')][_0x3705('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x39b4bf,_0xeae680,_0x13164d){if(_0x13164d){var _0x406822=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x406822[_0x3705('0x1f')](_0xeae680)){return _0x39b4bf;}else{throw new db[(_0x3705('0x20'))][(_0x3705('0x21'))](_0x3705('0x22'));}}else{return _0x39b4bf;}}function respondWithRpcPromise(_0x12703d,_0x829141,_0x5e58ed,_0x1b978b){return new BPromise(function(_0x4edd86,_0x5e706f){var _0xaaa72=_0x1b978b||client;return _0xaaa72[_0x3705('0x23')](_0x12703d,_0x5e58ed)[_0x3705('0x24')](function(_0x15b09e){logger['info'](_0x3705('0x25'),_0x829141,'request\x20sent');logger[_0x3705('0x26')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x829141,_0x3705('0x27'),JSON[_0x3705('0x28')](_0x15b09e));if(_0x15b09e[_0x3705('0x29')]){if(_0x15b09e[_0x3705('0x29')][_0x3705('0x2a')]===0x1f4){logger[_0x3705('0x29')]('SugarcrmAccount,\x20%s,\x20%s',_0x829141,_0x15b09e['error'][_0x3705('0x2b')]);return _0x5e706f(_0x15b09e[_0x3705('0x29')][_0x3705('0x2b')]);}logger[_0x3705('0x29')]('SugarcrmAccount,\x20%s,\x20%s',_0x829141,_0x15b09e[_0x3705('0x29')][_0x3705('0x2b')]);return _0x4edd86(_0x15b09e[_0x3705('0x29')][_0x3705('0x2b')]);}else{logger[_0x3705('0x2c')](_0x3705('0x25'),_0x829141,_0x3705('0x27'));_0x4edd86(_0x15b09e['result'][_0x3705('0x2b')]);}})[_0x3705('0x2d')](function(_0x3c6167){logger['error'](_0x3705('0x25'),_0x829141,_0x3c6167);_0x5e706f(_0x3c6167);});});}function respondWithStatusCode(_0x5afb55,_0x103529){_0x103529=_0x103529||0xcc;return function(_0x1e0346){if(_0x1e0346){return _0x5afb55[_0x3705('0x2e')](_0x103529);}return _0x5afb55['status'](_0x103529)[_0x3705('0x2f')]();};}function respondWithResult(_0x28f7f9,_0x161a1c){_0x161a1c=_0x161a1c||0xc8;return function(_0x994f81){if(_0x994f81){return _0x28f7f9[_0x3705('0x30')](_0x161a1c)['json'](_0x994f81);}};}function respondWithFilteredResult(_0x5c323e,_0x4eafb4){return function(_0x580636){if(_0x580636){var _0x52561c=_0x580636[_0x3705('0x31')],_0x5a0ef9=_0x4eafb4[_0x3705('0x32')],_0x4ebf6=_0x4eafb4['offset']+_0x4eafb4[_0x3705('0x33')],_0x3dbce6;if(_0x4ebf6>=_0x52561c){_0x4ebf6=_0x52561c;_0x3dbce6=0xc8;}else{_0x3dbce6=0xce;}_0x5c323e['status'](_0x3dbce6);return _0x5c323e[_0x3705('0x34')](_0x3705('0x35'),_0x5a0ef9+'-'+_0x4ebf6+'/'+_0x52561c)['json'](_0x580636);}return null;};}function patchUpdates(_0x4b0769){return function(_0x413955){try{jsonpatch[_0x3705('0x36')](_0x413955,_0x4b0769,!![]);}catch(_0x285cbe){return BPromise['reject'](_0x285cbe);}return _0x413955['save']();};}function saveUpdates(_0x5290fe,_0x3c44e9){return function(_0x10b3a9){if(_0x10b3a9){return _0x10b3a9[_0x3705('0x37')](_0x5290fe)[_0x3705('0x24')](function(_0x3fe146){return _0x3fe146;});}return null;};}function removeEntity(_0x2af146,_0x2d462f){return function(_0x3dfa1f){if(_0x3dfa1f){return _0x3dfa1f[_0x3705('0x38')]()['then'](function(){_0x2af146[_0x3705('0x30')](0xcc)[_0x3705('0x2f')]();});}};}function handleEntityNotFound(_0x2bb92b,_0xae656e){return function(_0x55f847){if(!_0x55f847){_0x2bb92b[_0x3705('0x2e')](0x194);}return _0x55f847;};}function handleError(_0x251ba6,_0x5d6587){_0x5d6587=_0x5d6587||0x1f4;return function(_0x50e3e1){logger[_0x3705('0x29')](_0x50e3e1[_0x3705('0x39')]);if(_0x50e3e1[_0x3705('0x3a')]){delete _0x50e3e1[_0x3705('0x3a')];}_0x251ba6[_0x3705('0x30')](_0x5d6587)[_0x3705('0x3b')](_0x50e3e1);};}exports[_0x3705('0x3c')]=function(_0x355a9e,_0x326577){var _0x31596a={},_0x26e2ce={},_0x1d726b={'count':0x0,'rows':[]};var _0x1de1b2=_['map'](db[_0x3705('0x3d')][_0x3705('0x3e')],function(_0xa196d3){return{'name':_0xa196d3[_0x3705('0x3f')],'type':_0xa196d3['type'][_0x3705('0x40')]};});_0x26e2ce[_0x3705('0x41')]=_[_0x3705('0x42')](_0x1de1b2,_0x3705('0x3a'));_0x26e2ce[_0x3705('0x43')]=_[_0x3705('0x44')](_0x355a9e[_0x3705('0x43')]);_0x26e2ce[_0x3705('0x45')]=_['intersection'](_0x26e2ce['model'],_0x26e2ce['query']);_0x31596a[_0x3705('0x46')]=_['intersection'](_0x26e2ce[_0x3705('0x41')],qs[_0x3705('0x47')](_0x355a9e[_0x3705('0x43')]['fields']));_0x31596a['attributes']=_0x31596a['attributes']['length']?_0x31596a[_0x3705('0x46')]:_0x26e2ce[_0x3705('0x41')];if(!_0x355a9e['query'][_0x3705('0x48')](_0x3705('0x49'))){_0x31596a[_0x3705('0x33')]=qs['limit'](_0x355a9e[_0x3705('0x43')][_0x3705('0x33')]);_0x31596a[_0x3705('0x32')]=qs[_0x3705('0x32')](_0x355a9e[_0x3705('0x43')]['offset']);}_0x31596a[_0x3705('0x4a')]=qs[_0x3705('0x4b')](_0x355a9e[_0x3705('0x43')]['sort']);_0x31596a[_0x3705('0x4c')]=qs[_0x3705('0x45')](_[_0x3705('0x4d')](_0x355a9e['query'],_0x26e2ce[_0x3705('0x45')]));if(_0x355a9e[_0x3705('0x43')]['filter']){_0x31596a[_0x3705('0x4c')]=_[_0x3705('0x4e')](_0x31596a[_0x3705('0x4c')],{'$or':_[_0x3705('0x42')](_0x1de1b2,function(_0x162b6d){if(_0x162b6d[_0x3705('0x4f')]!==_0x3705('0x50')){var _0x59022a={};_0x59022a[_0x162b6d[_0x3705('0x3a')]]={'$like':'%'+_0x355a9e[_0x3705('0x43')][_0x3705('0x51')]+'%'};return _0x59022a;}})});}_0x31596a=_['merge']({},_0x31596a,_0x355a9e[_0x3705('0x52')]);var _0x35c4e2={'where':_0x31596a[_0x3705('0x4c')]};return db[_0x3705('0x3d')]['count'](_0x35c4e2)['then'](function(_0x20beb4){_0x1d726b['count']=_0x20beb4;if(_0x355a9e['query'][_0x3705('0x53')]){_0x31596a[_0x3705('0x54')]=[{'all':!![]}];}return db[_0x3705('0x3d')][_0x3705('0x55')](_0x31596a);})['then'](function(_0x5a9593){_0x1d726b[_0x3705('0x56')]=_0x5a9593;return _0x1d726b;})['then'](respondWithFilteredResult(_0x326577,_0x31596a))[_0x3705('0x2d')](handleError(_0x326577,null));};exports['show']=function(_0x137c04,_0x487429){var _0x4f5dd6={'raw':![],'where':{'id':_0x137c04[_0x3705('0x57')]['id']}},_0x275303={};_0x275303[_0x3705('0x41')]=_['keys'](db[_0x3705('0x3d')][_0x3705('0x3e')]);_0x275303['query']=_[_0x3705('0x44')](_0x137c04[_0x3705('0x43')]);_0x275303[_0x3705('0x45')]=_['intersection'](_0x275303[_0x3705('0x41')],_0x275303[_0x3705('0x43')]);_0x4f5dd6[_0x3705('0x46')]=_[_0x3705('0x58')](_0x275303[_0x3705('0x41')],qs[_0x3705('0x47')](_0x137c04['query'][_0x3705('0x47')]));_0x4f5dd6[_0x3705('0x46')]=_0x4f5dd6[_0x3705('0x46')][_0x3705('0x59')]?_0x4f5dd6[_0x3705('0x46')]:_0x275303[_0x3705('0x41')];if(_0x137c04[_0x3705('0x43')][_0x3705('0x53')]){_0x4f5dd6[_0x3705('0x54')]=[{'all':!![]}];}_0x4f5dd6=_[_0x3705('0x4e')]({},_0x4f5dd6,_0x137c04[_0x3705('0x52')]);return db[_0x3705('0x3d')][_0x3705('0x5a')](_0x4f5dd6)['then'](handleEntityNotFound(_0x487429,null))[_0x3705('0x24')](respondWithResult(_0x487429,null))['catch'](handleError(_0x487429,null));};exports[_0x3705('0x5b')]=function(_0x28cca5,_0x19fbf2){return db[_0x3705('0x3d')]['create'](_0x28cca5[_0x3705('0x5c')],{})[_0x3705('0x24')](respondWithResult(_0x19fbf2,0xc9))[_0x3705('0x2d')](handleError(_0x19fbf2,null));};exports[_0x3705('0x37')]=function(_0x4d97f8,_0x96a86b){if(_0x4d97f8[_0x3705('0x5c')]['id']){delete _0x4d97f8[_0x3705('0x5c')]['id'];}return db['SugarcrmAccount'][_0x3705('0x5a')]({'where':{'id':_0x4d97f8[_0x3705('0x57')]['id']}})[_0x3705('0x24')](handleEntityNotFound(_0x96a86b,null))[_0x3705('0x24')](saveUpdates(_0x4d97f8['body'],null))[_0x3705('0x24')](respondWithResult(_0x96a86b,null))[_0x3705('0x2d')](handleError(_0x96a86b,null));};exports[_0x3705('0x38')]=function(_0xb47fc0,_0x3ea617){return db['SugarcrmAccount'][_0x3705('0x5a')]({'where':{'id':_0xb47fc0[_0x3705('0x57')]['id']}})[_0x3705('0x24')](handleEntityNotFound(_0x3ea617,null))[_0x3705('0x24')](removeEntity(_0x3ea617,null))[_0x3705('0x2d')](handleError(_0x3ea617,null));};exports[_0x3705('0x5d')]=function(_0xee9b34,_0x44f1e8,_0x200683){var _0x5c2c95={};var _0x5032fb={};var _0x180cb8;var _0x4d9f7b;return db[_0x3705('0x3d')][_0x3705('0x5e')]({'where':{'id':_0xee9b34[_0x3705('0x57')]['id']}})[_0x3705('0x24')](handleEntityNotFound(_0x44f1e8,null))[_0x3705('0x24')](function(_0x26cfed){if(_0x26cfed){_0x180cb8=_0x26cfed;_0x5032fb[_0x3705('0x41')]=_['keys'](db[_0x3705('0x5f')][_0x3705('0x3e')]);_0x5032fb['query']=_['keys'](_0xee9b34[_0x3705('0x43')]);_0x5032fb['filters']=_[_0x3705('0x58')](_0x5032fb[_0x3705('0x41')],_0x5032fb[_0x3705('0x43')]);_0x5c2c95[_0x3705('0x46')]=_[_0x3705('0x58')](_0x5032fb[_0x3705('0x41')],qs[_0x3705('0x47')](_0xee9b34['query'][_0x3705('0x47')]));_0x5c2c95[_0x3705('0x46')]=_0x5c2c95['attributes']['length']?_0x5c2c95[_0x3705('0x46')]:_0x5032fb[_0x3705('0x41')];_0x5c2c95[_0x3705('0x4a')]=qs[_0x3705('0x4b')](_0xee9b34[_0x3705('0x43')][_0x3705('0x4b')]);_0x5c2c95[_0x3705('0x4c')]=qs['filters'](_[_0x3705('0x4d')](_0xee9b34['query'],_0x5032fb[_0x3705('0x45')]));if(_0xee9b34[_0x3705('0x43')][_0x3705('0x51')]){_0x5c2c95['where']=_['merge'](_0x5c2c95[_0x3705('0x4c')],{'$or':_['map'](_0x5c2c95[_0x3705('0x46')],function(_0x41c63c){var _0x59fef6={};_0x59fef6[_0x41c63c]={'$like':'%'+_0xee9b34['query'][_0x3705('0x51')]+'%'};return _0x59fef6;})});}_0x5c2c95=_['merge']({},_0x5c2c95,_0xee9b34[_0x3705('0x52')]);return _0x180cb8[_0x3705('0x5d')](_0x5c2c95);}})[_0x3705('0x24')](function(_0x3bf3be){if(_0x3bf3be){_0x4d9f7b=_0x3bf3be[_0x3705('0x59')];if(!_0xee9b34[_0x3705('0x43')][_0x3705('0x48')](_0x3705('0x49'))){_0x5c2c95[_0x3705('0x33')]=qs[_0x3705('0x33')](_0xee9b34[_0x3705('0x43')][_0x3705('0x33')]);_0x5c2c95[_0x3705('0x32')]=qs[_0x3705('0x32')](_0xee9b34[_0x3705('0x43')][_0x3705('0x32')]);}return _0x180cb8[_0x3705('0x5d')](_0x5c2c95);}})[_0x3705('0x24')](function(_0x234f54){if(_0x234f54){return _0x234f54?{'count':_0x4d9f7b,'rows':_0x234f54}:null;}})[_0x3705('0x24')](respondWithResult(_0x44f1e8,null))['catch'](handleError(_0x44f1e8,null));};exports[_0x3705('0x60')]=function(_0x2219bb,_0x2677af,_0x562acb){if(_0x2219bb[_0x3705('0x5c')]['id']){delete _0x2219bb[_0x3705('0x5c')]['id'];}return db[_0x3705('0x3d')]['findOne']({'where':{'id':_0x2219bb[_0x3705('0x57')]['id']}})[_0x3705('0x24')](handleEntityNotFound(_0x2677af,null))[_0x3705('0x24')](function(_0x2de7b6){if(_0x2de7b6){_0x2219bb['body'][_0x3705('0x61')]=_0x2de7b6['id'];_0x2219bb[_0x3705('0x5c')][_0x3705('0x62')]=integrations[_0x3705('0x63')](_0x2219bb[_0x3705('0x5c')][_0x3705('0x64')],_0x2219bb['body'][_0x3705('0x4f')]);_0x2219bb['body'][_0x3705('0x65')]=integrations[_0x3705('0x66')](_0x2219bb[_0x3705('0x5c')][_0x3705('0x64')],_0x2219bb[_0x3705('0x5c')][_0x3705('0x4f')]);return db[_0x3705('0x5f')][_0x3705('0x5b')](_0x2219bb[_0x3705('0x5c')],{'include':[{'model':db[_0x3705('0x67')],'as':_0x3705('0x62')},{'model':db[_0x3705('0x67')],'as':_0x3705('0x65')}]});}return null;})['then'](respondWithResult(_0x2677af,null))[_0x3705('0x2d')](handleError(_0x2677af,null));};exports[_0x3705('0x68')]=function(_0x268934,_0x3faae1,_0x1c6a39){var _0x3c18a2='';var _0x2b9aa9=['id',_0x3705('0x3a'),_0x3705('0x69'),_0x3705('0x6a'),_0x3705('0x6b'),_0x3705('0x6c'),'duration_hours','duration_minutes','parent_id',_0x3705('0x6d'),_0x3705('0x6e'),_0x3705('0x6f')];return db[_0x3705('0x3d')][_0x3705('0x5e')]({'where':{'id':_0x268934['params']['id']},'attributes':['id',_0x3705('0x70'),_0x3705('0x71'),'remoteUri']})[_0x3705('0x24')](handleEntityNotFound(_0x3faae1,null))[_0x3705('0x24')](function(_0x4ed758){if(_0x4ed758){_0x3c18a2=_0x4ed758[_0x3705('0x72')];var _0x12e903=_0x3c18a2[_0x3705('0x73')](-0x1);if(_0x12e903==='/'){_0x3c18a2=_0x3c18a2[_0x3705('0x74')](0x0,_0x3c18a2[_0x3705('0x75')](_0x12e903));}return rp({'method':'POST','uri':util[_0x3705('0x76')]('%s%s',_0x3c18a2,_0x3705('0x77')),'json':!![],'form':{'method':_0x3705('0x78'),'input_type':_0x3705('0x79'),'response_type':_0x3705('0x79'),'rest_data':JSON[_0x3705('0x28')]({'user_auth':{'user_name':_0x4ed758[_0x3705('0x70')],'password':_0x4ed758[_0x3705('0x71')],'encryption':_0x3705('0x7a')},'application':_0x3705('0x7b')})}});}})[_0x3705('0x24')](function(_0x112e40){if(_0x112e40&&_0x112e40['name']!=='Invalid\x20Login'&&_0x112e40['name']!==_0x3705('0x7c')){return rp({'method':_0x3705('0x7d'),'uri':util[_0x3705('0x76')]('%s%s',_0x3c18a2,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x3705('0x7e'),'input_type':_0x3705('0x79'),'response_type':'JSON','rest_data':JSON[_0x3705('0x28')]({'session':_0x112e40['id'],'module_name':_0x3705('0x7f')})}})[_0x3705('0x24')](function(_0x49f024){if(_0x49f024){var _0x8b1336=_['values'](_0x49f024[_0x3705('0x80')]);_[_0x3705('0x81')](_0x8b1336,function(_0x2159b6){return _0x2b9aa9[_0x3705('0x82')](_0x2159b6[_0x3705('0x3a')]);});return{'count':_0x8b1336[_0x3705('0x59')],'rows':_[_0x3705('0x42')](_0x8b1336,function(_0x5adad1){return{'id':_0x5adad1[_0x3705('0x3a')],'name':_0x5adad1[_0x3705('0x83')],'custom':_['endsWith'](_0x5adad1[_0x3705('0x3a')],'_c')?!![]:![],'options':_0x5adad1[_0x3705('0x52')]?_[_0x3705('0x42')](_[_0x3705('0x84')](_0x5adad1[_0x3705('0x52')]),function(_0x2524f0){return{'name':_0x2524f0[_0x3705('0x85')],'value':_0x2524f0[_0x3705('0x3a')]};}):[]};})};}})[_0x3705('0x24')](respondWithResult(_0x3faae1,null))[_0x3705('0x2d')](function(_0x3fe9a1){var _0x7ef350=_0x268934[_0x3705('0x43')][_0x3705('0x1f')]?0x1f4:_0x3fe9a1['statusCode']||0x1f4;logger[_0x3705('0x29')](_0x3705('0x86'),_0x3705('0x68'),_0x7ef350,JSON[_0x3705('0x28')](_0x3fe9a1));delete _0x3fe9a1[_0x3705('0x3a')];if(_0x7ef350===0x191){_0x7ef350=0x190;}_0x3faae1[_0x3705('0x30')](_0x7ef350)[_0x3705('0x3b')](_0x268934[_0x3705('0x43')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x3fe9a1[_0x3705('0x87')]}:_0x3fe9a1);});}else{var _0x3f6290=0x1f4;_0x3faae1[_0x3705('0x30')](_0x3f6290)[_0x3705('0x3b')]({'message':_0x3705('0x88'),'statusCode':0x190});}});}; \ No newline at end of file +var _0x108b=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','then','info','SugarcrmAccount,\x20%s,\x20%s','debug','stringify','code','error','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','SugarcrmAccount','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','sort','filter','where','merge','map','type','VIRTUAL','options','includeAll','findAll','rows','show','fields','length','include','find','body','params','getConfigurations','SugarcrmConfiguration','order','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','SugarcrmField','getFields','created_by','description','date_start','duration_minutes','parent_id','parent_type','username','password','remoteUri','slice','substring','lastIndexOf','%s%s','/service/v4_1/rest.php','JSON','PLAIN','xCALLY\x20Motion\x20Integration','Password\x20Expired','POST','get_module_fields','values','module_fields','remove','includes','label','endsWith','value','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../config/license/hardware'];(function(_0x101a80,_0x176841){var _0x135050=function(_0x3c7984){while(--_0x3c7984){_0x101a80['push'](_0x101a80['shift']());}};_0x135050(++_0x176841);}(_0x108b,0xef));var _0xb108=function(_0x5d9867,_0x5e9030){_0x5d9867=_0x5d9867-0x0;var _0x7d2118=_0x108b[_0x5d9867];return _0x7d2118;};'use strict';var pdf=require(_0xb108('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xb108('0x1'));var rp=require(_0xb108('0x2'));var moment=require(_0xb108('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb108('0x4'));var util=require(_0xb108('0x5'));var path=require(_0xb108('0x6'));var sox=require(_0xb108('0x7'));var csv=require('to-csv');var ejs=require(_0xb108('0x8'));var fs=require('fs');var _=require(_0xb108('0x9'));var squel=require(_0xb108('0xa'));var crypto=require(_0xb108('0xb'));var jsforce=require(_0xb108('0xc'));var deskjs=require(_0xb108('0xd'));var toCsv=require(_0xb108('0xe'));var querystring=require(_0xb108('0xf'));var Papa=require(_0xb108('0x10'));var Redis=require('ioredis');var authService=require(_0xb108('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb108('0x12'));var logger=require(_0xb108('0x13'))(_0xb108('0x14'));var utils=require(_0xb108('0x15'));var config=require(_0xb108('0x16'));var db=require(_0xb108('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xb108('0x18'));var client=jayson[_0xb108('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x497e6c,_0x596df7,_0x27f930){if(_0x27f930){var _0x5a0f83=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a0f83[_0xb108('0x1a')](_0x596df7)){return _0x497e6c;}else{throw new db[(_0xb108('0x1b'))][(_0xb108('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x497e6c;}}function respondWithRpcPromise(_0x229210,_0x3b0e87,_0x46b210,_0x281e76){return new BPromise(function(_0x52eda0,_0x3e23c1){var _0x318d44=_0x281e76||client;return _0x318d44['request'](_0x229210,_0x46b210)[_0xb108('0x1d')](function(_0xb55d69){logger[_0xb108('0x1e')](_0xb108('0x1f'),_0x3b0e87,'request\x20sent');logger[_0xb108('0x20')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x3b0e87,'request\x20sent',JSON[_0xb108('0x21')](_0xb55d69));if(_0xb55d69['error']){if(_0xb55d69['error'][_0xb108('0x22')]===0x1f4){logger['error'](_0xb108('0x1f'),_0x3b0e87,_0xb55d69[_0xb108('0x23')][_0xb108('0x24')]);return _0x3e23c1(_0xb55d69[_0xb108('0x23')][_0xb108('0x24')]);}logger['error'](_0xb108('0x1f'),_0x3b0e87,_0xb55d69[_0xb108('0x23')]['message']);return _0x52eda0(_0xb55d69[_0xb108('0x23')][_0xb108('0x24')]);}else{logger[_0xb108('0x1e')](_0xb108('0x1f'),_0x3b0e87,_0xb108('0x25'));_0x52eda0(_0xb55d69[_0xb108('0x26')][_0xb108('0x24')]);}})[_0xb108('0x27')](function(_0x3662b7){logger[_0xb108('0x23')](_0xb108('0x1f'),_0x3b0e87,_0x3662b7);_0x3e23c1(_0x3662b7);});});}function respondWithStatusCode(_0x351697,_0x5d0b6f){_0x5d0b6f=_0x5d0b6f||0xcc;return function(_0x345f99){if(_0x345f99){return _0x351697[_0xb108('0x28')](_0x5d0b6f);}return _0x351697[_0xb108('0x29')](_0x5d0b6f)[_0xb108('0x2a')]();};}function respondWithResult(_0x5945d9,_0x25f6ab){_0x25f6ab=_0x25f6ab||0xc8;return function(_0x363343){if(_0x363343){return _0x5945d9[_0xb108('0x29')](_0x25f6ab)[_0xb108('0x2b')](_0x363343);}};}function respondWithFilteredResult(_0x58267e,_0x243d6d){return function(_0x401c34){if(_0x401c34){var _0x3cc0aa=_0x401c34[_0xb108('0x2c')],_0x472ea3=_0x243d6d[_0xb108('0x2d')],_0x41f117=_0x243d6d[_0xb108('0x2d')]+_0x243d6d[_0xb108('0x2e')],_0x197900;if(_0x41f117>=_0x3cc0aa){_0x41f117=_0x3cc0aa;_0x197900=0xc8;}else{_0x197900=0xce;}_0x58267e[_0xb108('0x29')](_0x197900);return _0x58267e[_0xb108('0x2f')](_0xb108('0x30'),_0x472ea3+'-'+_0x41f117+'/'+_0x3cc0aa)['json'](_0x401c34);}return null;};}function patchUpdates(_0x128983){return function(_0x52329a){try{jsonpatch[_0xb108('0x31')](_0x52329a,_0x128983,!![]);}catch(_0xd64d3e){return BPromise[_0xb108('0x32')](_0xd64d3e);}return _0x52329a[_0xb108('0x33')]();};}function saveUpdates(_0x1cd301,_0x109af5){return function(_0x340355){if(_0x340355){return _0x340355[_0xb108('0x34')](_0x1cd301)[_0xb108('0x1d')](function(_0x6353fc){return _0x6353fc;});}return null;};}function removeEntity(_0x1f5f7f,_0x47785c){return function(_0x5d86c7){if(_0x5d86c7){return _0x5d86c7[_0xb108('0x35')]()['then'](function(){_0x1f5f7f[_0xb108('0x29')](0xcc)[_0xb108('0x2a')]();});}};}function handleEntityNotFound(_0x3b7c67,_0x542dc0){return function(_0x414fa7){if(!_0x414fa7){_0x3b7c67[_0xb108('0x28')](0x194);}return _0x414fa7;};}function handleError(_0x17de39,_0x3487e6){_0x3487e6=_0x3487e6||0x1f4;return function(_0x5cc201){logger[_0xb108('0x23')](_0x5cc201[_0xb108('0x36')]);if(_0x5cc201['name']){delete _0x5cc201[_0xb108('0x37')];}_0x17de39[_0xb108('0x29')](_0x3487e6)[_0xb108('0x38')](_0x5cc201);};}exports['index']=function(_0x4cd6af,_0x38dfce){var _0x6872e0={},_0x2460d0={},_0x110b33={'count':0x0,'rows':[]};var _0x41c18e=_['map'](db[_0xb108('0x39')][_0xb108('0x3a')],function(_0x46c919){return{'name':_0x46c919[_0xb108('0x3b')],'type':_0x46c919['type']['key']};});_0x2460d0[_0xb108('0x3c')]=_['map'](_0x41c18e,'name');_0x2460d0[_0xb108('0x3d')]=_[_0xb108('0x3e')](_0x4cd6af['query']);_0x2460d0[_0xb108('0x3f')]=_[_0xb108('0x40')](_0x2460d0['model'],_0x2460d0[_0xb108('0x3d')]);_0x6872e0[_0xb108('0x41')]=_[_0xb108('0x40')](_0x2460d0[_0xb108('0x3c')],qs['fields'](_0x4cd6af[_0xb108('0x3d')]['fields']));_0x6872e0[_0xb108('0x41')]=_0x6872e0['attributes']['length']?_0x6872e0[_0xb108('0x41')]:_0x2460d0['model'];if(!_0x4cd6af['query'][_0xb108('0x42')](_0xb108('0x43'))){_0x6872e0[_0xb108('0x2e')]=qs[_0xb108('0x2e')](_0x4cd6af[_0xb108('0x3d')][_0xb108('0x2e')]);_0x6872e0['offset']=qs['offset'](_0x4cd6af[_0xb108('0x3d')][_0xb108('0x2d')]);}_0x6872e0['order']=qs[_0xb108('0x44')](_0x4cd6af['query'][_0xb108('0x44')]);_0x6872e0['where']=qs[_0xb108('0x3f')](_['pick'](_0x4cd6af['query'],_0x2460d0[_0xb108('0x3f')]));if(_0x4cd6af[_0xb108('0x3d')][_0xb108('0x45')]){_0x6872e0[_0xb108('0x46')]=_[_0xb108('0x47')](_0x6872e0['where'],{'$or':_[_0xb108('0x48')](_0x41c18e,function(_0x34389c){if(_0x34389c[_0xb108('0x49')]!==_0xb108('0x4a')){var _0x1bbf5c={};_0x1bbf5c[_0x34389c[_0xb108('0x37')]]={'$like':'%'+_0x4cd6af['query']['filter']+'%'};return _0x1bbf5c;}})});}_0x6872e0=_[_0xb108('0x47')]({},_0x6872e0,_0x4cd6af[_0xb108('0x4b')]);var _0x28a003={'where':_0x6872e0[_0xb108('0x46')]};return db[_0xb108('0x39')][_0xb108('0x2c')](_0x28a003)['then'](function(_0xa92b1d){_0x110b33['count']=_0xa92b1d;if(_0x4cd6af[_0xb108('0x3d')][_0xb108('0x4c')]){_0x6872e0['include']=[{'all':!![]}];}return db[_0xb108('0x39')][_0xb108('0x4d')](_0x6872e0);})['then'](function(_0x16549b){_0x110b33[_0xb108('0x4e')]=_0x16549b;return _0x110b33;})[_0xb108('0x1d')](respondWithFilteredResult(_0x38dfce,_0x6872e0))['catch'](handleError(_0x38dfce,null));};exports[_0xb108('0x4f')]=function(_0x54b64a,_0xbb91bd){var _0x1814e3={'raw':![],'where':{'id':_0x54b64a['params']['id']}},_0x45281f={};_0x45281f[_0xb108('0x3c')]=_['keys'](db['SugarcrmAccount'][_0xb108('0x3a')]);_0x45281f['query']=_[_0xb108('0x3e')](_0x54b64a[_0xb108('0x3d')]);_0x45281f['filters']=_['intersection'](_0x45281f[_0xb108('0x3c')],_0x45281f[_0xb108('0x3d')]);_0x1814e3[_0xb108('0x41')]=_[_0xb108('0x40')](_0x45281f[_0xb108('0x3c')],qs[_0xb108('0x50')](_0x54b64a['query']['fields']));_0x1814e3[_0xb108('0x41')]=_0x1814e3[_0xb108('0x41')][_0xb108('0x51')]?_0x1814e3[_0xb108('0x41')]:_0x45281f['model'];if(_0x54b64a[_0xb108('0x3d')][_0xb108('0x4c')]){_0x1814e3[_0xb108('0x52')]=[{'all':!![]}];}_0x1814e3=_[_0xb108('0x47')]({},_0x1814e3,_0x54b64a[_0xb108('0x4b')]);return db[_0xb108('0x39')][_0xb108('0x53')](_0x1814e3)[_0xb108('0x1d')](handleEntityNotFound(_0xbb91bd,null))[_0xb108('0x1d')](respondWithResult(_0xbb91bd,null))['catch'](handleError(_0xbb91bd,null));};exports['create']=function(_0x21ea45,_0x41dea8){return db[_0xb108('0x39')]['create'](_0x21ea45['body'],{})['then'](respondWithResult(_0x41dea8,0xc9))[_0xb108('0x27')](handleError(_0x41dea8,null));};exports[_0xb108('0x34')]=function(_0x4b8323,_0x488737){if(_0x4b8323[_0xb108('0x54')]['id']){delete _0x4b8323[_0xb108('0x54')]['id'];}return db[_0xb108('0x39')][_0xb108('0x53')]({'where':{'id':_0x4b8323[_0xb108('0x55')]['id']}})[_0xb108('0x1d')](handleEntityNotFound(_0x488737,null))[_0xb108('0x1d')](saveUpdates(_0x4b8323[_0xb108('0x54')],null))[_0xb108('0x1d')](respondWithResult(_0x488737,null))[_0xb108('0x27')](handleError(_0x488737,null));};exports['destroy']=function(_0x3662a5,_0x134cdc){return db[_0xb108('0x39')][_0xb108('0x53')]({'where':{'id':_0x3662a5['params']['id']}})[_0xb108('0x1d')](handleEntityNotFound(_0x134cdc,null))[_0xb108('0x1d')](removeEntity(_0x134cdc,null))[_0xb108('0x27')](handleError(_0x134cdc,null));};exports[_0xb108('0x56')]=function(_0x8f7ca2,_0x1f7d17,_0x24db73){var _0x15c67f={};var _0x1da458={};var _0x28a5f5;var _0x4d8f65;return db[_0xb108('0x39')]['findOne']({'where':{'id':_0x8f7ca2[_0xb108('0x55')]['id']}})[_0xb108('0x1d')](handleEntityNotFound(_0x1f7d17,null))[_0xb108('0x1d')](function(_0x9c7839){if(_0x9c7839){_0x28a5f5=_0x9c7839;_0x1da458[_0xb108('0x3c')]=_[_0xb108('0x3e')](db[_0xb108('0x57')][_0xb108('0x3a')]);_0x1da458['query']=_[_0xb108('0x3e')](_0x8f7ca2[_0xb108('0x3d')]);_0x1da458[_0xb108('0x3f')]=_['intersection'](_0x1da458['model'],_0x1da458[_0xb108('0x3d')]);_0x15c67f[_0xb108('0x41')]=_[_0xb108('0x40')](_0x1da458[_0xb108('0x3c')],qs[_0xb108('0x50')](_0x8f7ca2[_0xb108('0x3d')][_0xb108('0x50')]));_0x15c67f[_0xb108('0x41')]=_0x15c67f['attributes']['length']?_0x15c67f[_0xb108('0x41')]:_0x1da458[_0xb108('0x3c')];_0x15c67f[_0xb108('0x58')]=qs[_0xb108('0x44')](_0x8f7ca2[_0xb108('0x3d')][_0xb108('0x44')]);_0x15c67f[_0xb108('0x46')]=qs[_0xb108('0x3f')](_['pick'](_0x8f7ca2[_0xb108('0x3d')],_0x1da458['filters']));if(_0x8f7ca2[_0xb108('0x3d')][_0xb108('0x45')]){_0x15c67f[_0xb108('0x46')]=_[_0xb108('0x47')](_0x15c67f[_0xb108('0x46')],{'$or':_[_0xb108('0x48')](_0x15c67f['attributes'],function(_0x179929){var _0x475396={};_0x475396[_0x179929]={'$like':'%'+_0x8f7ca2[_0xb108('0x3d')][_0xb108('0x45')]+'%'};return _0x475396;})});}_0x15c67f=_[_0xb108('0x47')]({},_0x15c67f,_0x8f7ca2['options']);return _0x28a5f5['getConfigurations'](_0x15c67f);}})[_0xb108('0x1d')](function(_0x8ad689){if(_0x8ad689){_0x4d8f65=_0x8ad689['length'];if(!_0x8f7ca2[_0xb108('0x3d')][_0xb108('0x42')](_0xb108('0x43'))){_0x15c67f[_0xb108('0x2e')]=qs[_0xb108('0x2e')](_0x8f7ca2[_0xb108('0x3d')]['limit']);_0x15c67f['offset']=qs[_0xb108('0x2d')](_0x8f7ca2[_0xb108('0x3d')][_0xb108('0x2d')]);}return _0x28a5f5[_0xb108('0x56')](_0x15c67f);}})[_0xb108('0x1d')](function(_0x2011aa){if(_0x2011aa){return _0x2011aa?{'count':_0x4d8f65,'rows':_0x2011aa}:null;}})['then'](respondWithResult(_0x1f7d17,null))[_0xb108('0x27')](handleError(_0x1f7d17,null));};exports[_0xb108('0x59')]=function(_0x5ebde2,_0x5aed56,_0x5add92){if(_0x5ebde2['body']['id']){delete _0x5ebde2[_0xb108('0x54')]['id'];}return db[_0xb108('0x39')][_0xb108('0x5a')]({'where':{'id':_0x5ebde2[_0xb108('0x55')]['id']}})[_0xb108('0x1d')](handleEntityNotFound(_0x5aed56,null))['then'](function(_0x1ccdf7){if(_0x1ccdf7){_0x5ebde2[_0xb108('0x54')]['AccountId']=_0x1ccdf7['id'];_0x5ebde2['body'][_0xb108('0x5b')]=integrations[_0xb108('0x5c')](_0x5ebde2[_0xb108('0x54')][_0xb108('0x5d')],_0x5ebde2[_0xb108('0x54')]['type']);_0x5ebde2[_0xb108('0x54')][_0xb108('0x5e')]=integrations[_0xb108('0x5f')](_0x5ebde2[_0xb108('0x54')][_0xb108('0x5d')],_0x5ebde2[_0xb108('0x54')][_0xb108('0x49')]);return db[_0xb108('0x57')][_0xb108('0x60')](_0x5ebde2[_0xb108('0x54')],{'include':[{'model':db[_0xb108('0x61')],'as':_0xb108('0x5b')},{'model':db[_0xb108('0x61')],'as':_0xb108('0x5e')}]});}return null;})[_0xb108('0x1d')](respondWithResult(_0x5aed56,null))['catch'](handleError(_0x5aed56,null));};exports[_0xb108('0x62')]=function(_0x3c310e,_0x5292e3,_0x6efe67){var _0x430259='';var _0x6074a8=['id',_0xb108('0x37'),'assigned_user_id',_0xb108('0x63'),_0xb108('0x64'),_0xb108('0x65'),'duration_hours',_0xb108('0x66'),_0xb108('0x67'),_0xb108('0x68'),'parent_name','direction'];return db[_0xb108('0x39')]['findOne']({'where':{'id':_0x3c310e[_0xb108('0x55')]['id']},'attributes':['id',_0xb108('0x69'),_0xb108('0x6a'),_0xb108('0x6b')]})[_0xb108('0x1d')](handleEntityNotFound(_0x5292e3,null))['then'](function(_0x21d3d0){if(_0x21d3d0){_0x430259=_0x21d3d0['remoteUri'];var _0x4daa11=_0x430259[_0xb108('0x6c')](-0x1);if(_0x4daa11==='/'){_0x430259=_0x430259[_0xb108('0x6d')](0x0,_0x430259[_0xb108('0x6e')](_0x4daa11));}return rp({'method':'POST','uri':util['format'](_0xb108('0x6f'),_0x430259,_0xb108('0x70')),'json':!![],'form':{'method':'login','input_type':_0xb108('0x71'),'response_type':_0xb108('0x71'),'rest_data':JSON[_0xb108('0x21')]({'user_auth':{'user_name':_0x21d3d0['username'],'password':_0x21d3d0[_0xb108('0x6a')],'encryption':_0xb108('0x72')},'application':_0xb108('0x73')})}});}})['then'](function(_0x560b77){if(_0x560b77&&_0x560b77[_0xb108('0x37')]!=='Invalid\x20Login'&&_0x560b77['name']!==_0xb108('0x74')){return rp({'method':_0xb108('0x75'),'uri':util['format'](_0xb108('0x6f'),_0x430259,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xb108('0x76'),'input_type':'JSON','response_type':_0xb108('0x71'),'rest_data':JSON[_0xb108('0x21')]({'session':_0x560b77['id'],'module_name':'Calls'})}})[_0xb108('0x1d')](function(_0x3fd961){if(_0x3fd961){var _0x14d95c=_[_0xb108('0x77')](_0x3fd961[_0xb108('0x78')]);_[_0xb108('0x79')](_0x14d95c,function(_0x3a702c){return _0x6074a8[_0xb108('0x7a')](_0x3a702c['name']);});return{'count':_0x14d95c['length'],'rows':_[_0xb108('0x48')](_0x14d95c,function(_0x4ce502){return{'id':_0x4ce502[_0xb108('0x37')],'name':_0x4ce502[_0xb108('0x7b')],'custom':_[_0xb108('0x7c')](_0x4ce502[_0xb108('0x37')],'_c')?!![]:![],'options':_0x4ce502[_0xb108('0x4b')]?_[_0xb108('0x48')](_[_0xb108('0x77')](_0x4ce502[_0xb108('0x4b')]),function(_0x4e630d){return{'name':_0x4e630d[_0xb108('0x7d')],'value':_0x4e630d[_0xb108('0x37')]};}):[]};})};}})[_0xb108('0x1d')](respondWithResult(_0x5292e3,null))[_0xb108('0x27')](function(_0x464c3c){var _0x364cd6=_0x3c310e[_0xb108('0x3d')][_0xb108('0x1a')]?0x1f4:_0x464c3c[_0xb108('0x7e')]||0x1f4;logger['error'](_0xb108('0x7f'),_0xb108('0x62'),_0x364cd6,JSON['stringify'](_0x464c3c));delete _0x464c3c[_0xb108('0x37')];if(_0x364cd6===0x191){_0x364cd6=0x190;}_0x5292e3['status'](_0x364cd6)[_0xb108('0x38')](_0x3c310e[_0xb108('0x3d')]['test']?{'message':_0xb108('0x80'),'statusCode':_0x464c3c[_0xb108('0x7e')]}:_0x464c3c);});}else{var _0x32a8a7=0x1f4;_0x5292e3[_0xb108('0x29')](_0x32a8a7)[_0xb108('0x38')]({'message':_0xb108('0x80'),'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 c21520e..5093925 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 _0xaefe=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts'];(function(_0x4f8eef,_0x2ff128){var _0x196e8a=function(_0x4e8f4f){while(--_0x4e8f4f){_0x4f8eef['push'](_0x4f8eef['shift']());}};_0x196e8a(++_0x2ff128);}(_0xaefe,0xa9));var _0xeaef=function(_0x28e2cd,_0x153b42){_0x28e2cd=_0x28e2cd-0x0;var _0x11fd46=_0xaefe[_0x28e2cd];return _0x11fd46;};'use strict';var _=require('lodash');var util=require(_0xeaef('0x0'));var logger=require(_0xeaef('0x1'))(_0xeaef('0x2'));var moment=require(_0xeaef('0x3'));var BPromise=require(_0xeaef('0x4'));var rp=require(_0xeaef('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeaef('0x6'));var config=require('../../config/environment');var attributes=require(_0xeaef('0x7'));var integrations=require(_0xeaef('0x8'));module[_0xeaef('0x9')]=function(_0x62e5ae,_0x40690c){return _0x62e5ae[_0xeaef('0xa')](_0xeaef('0xb'),attributes,{'tableName':_0xeaef('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x371a=['../../config/logger','api','moment','bluebird','path','rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','int_sugarcrm_accounts','lodash'];(function(_0xb4788,_0x1efb8d){var _0xd49d21=function(_0x2b2a2b){while(--_0x2b2a2b){_0xb4788['push'](_0xb4788['shift']());}};_0xd49d21(++_0x1efb8d);}(_0x371a,0x83));var _0xa371=function(_0x352344,_0xba388b){_0x352344=_0x352344-0x0;var _0x259048=_0x371a[_0x352344];return _0x259048;};'use strict';var _=require(_0xa371('0x0'));var util=require('util');var logger=require(_0xa371('0x1'))(_0xa371('0x2'));var moment=require(_0xa371('0x3'));var BPromise=require(_0xa371('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa371('0x5'));var rimraf=require(_0xa371('0x6'));var config=require('../../config/environment');var attributes=require(_0xa371('0x7'));var integrations=require(_0xa371('0x8'));module[_0xa371('0x9')]=function(_0x1dbeef,_0x51f1c5){return _0x1dbeef['define'](_0xa371('0xa'),attributes,{'tableName':_0xa371('0xb'),'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 eba5ec1..ee2950a 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 _0xf869=['options','raw','where','attributes','limit','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','SugarcrmAccount'];(function(_0xb94e38,_0x13f4a4){var _0x1b10dd=function(_0x20d14e){while(--_0x20d14e){_0xb94e38['push'](_0xb94e38['shift']());}};_0x1b10dd(++_0x13f4a4);}(_0xf869,0xe3));var _0x9f86=function(_0x3a9815,_0x47eb16){_0x3a9815=_0x3a9815-0x0;var _0x188653=_0xf869[_0x3a9815];return _0x188653;};'use strict';var _=require(_0x9f86('0x0'));var util=require(_0x9f86('0x1'));var moment=require(_0x9f86('0x2'));var BPromise=require(_0x9f86('0x3'));var rs=require(_0x9f86('0x4'));var fs=require('fs');var Redis=require(_0x9f86('0x5'));var db=require(_0x9f86('0x6'))['db'];var utils=require(_0x9f86('0x7'));var logger=require(_0x9f86('0x8'))(_0x9f86('0x9'));var config=require(_0x9f86('0xa'));var jayson=require(_0x9f86('0xb'));var client=jayson['client'][_0x9f86('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x55ead5,_0x3962cc,_0x1dd5a0){return new BPromise(function(_0x228b9f,_0x4331eb){return client[_0x9f86('0xd')](_0x55ead5,_0x1dd5a0)[_0x9f86('0xe')](function(_0x34dee3){logger[_0x9f86('0xf')](_0x9f86('0x10'),_0x3962cc,_0x9f86('0x11'));logger[_0x9f86('0x12')](_0x9f86('0x13'),_0x3962cc,'request\x20sent',JSON[_0x9f86('0x14')](_0x34dee3));if(_0x34dee3['error']){if(_0x34dee3[_0x9f86('0x15')]['code']===0x1f4){logger[_0x9f86('0x15')](_0x9f86('0x10'),_0x3962cc,_0x34dee3[_0x9f86('0x15')][_0x9f86('0x16')]);return _0x4331eb(_0x34dee3[_0x9f86('0x15')][_0x9f86('0x16')]);}logger[_0x9f86('0x15')]('SugarcrmAccount,\x20%s,\x20%s',_0x3962cc,_0x34dee3[_0x9f86('0x15')][_0x9f86('0x16')]);return _0x228b9f(_0x34dee3['error'][_0x9f86('0x16')]);}else{logger[_0x9f86('0xf')]('SugarcrmAccount,\x20%s,\x20%s',_0x3962cc,_0x9f86('0x11'));_0x228b9f(_0x34dee3[_0x9f86('0x17')]['message']);}})['catch'](function(_0x14214a){logger[_0x9f86('0x15')](_0x9f86('0x10'),_0x3962cc,_0x14214a);_0x4331eb(_0x14214a);});});}exports['GetSugarcrmAccount']=function(_0x10645f){var _0x274b72=this;return new Promise(function(_0x4dc8b1,_0x227937){return db[_0x9f86('0x18')]['findAll']({'raw':_0x10645f['options']?_0x10645f[_0x9f86('0x19')][_0x9f86('0x1a')]===undefined?!![]:![]:!![],'where':_0x10645f[_0x9f86('0x19')]?_0x10645f[_0x9f86('0x19')][_0x9f86('0x1b')]||null:null,'attributes':_0x10645f[_0x9f86('0x19')]?_0x10645f[_0x9f86('0x19')][_0x9f86('0x1c')]||null:null,'limit':_0x10645f[_0x9f86('0x19')]?_0x10645f['options'][_0x9f86('0x1d')]||null:null,'include':_0x10645f[_0x9f86('0x19')]?_0x10645f['options'][_0x9f86('0x1e')]?_[_0x9f86('0x1f')](_0x10645f['options']['include'],function(_0x5af1d1){return{'model':db[_0x5af1d1[_0x9f86('0x20')]],'as':_0x5af1d1['as'],'attributes':_0x5af1d1[_0x9f86('0x1c')],'include':_0x5af1d1[_0x9f86('0x1e')]?_[_0x9f86('0x1f')](_0x5af1d1[_0x9f86('0x1e')],function(_0x34456b){return{'model':db[_0x34456b['model']],'as':_0x34456b['as'],'attributes':_0x34456b['attributes'],'include':_0x34456b[_0x9f86('0x1e')]?_['map'](_0x34456b[_0x9f86('0x1e')],function(_0x2d85b3){return{'model':db[_0x2d85b3[_0x9f86('0x20')]],'as':_0x2d85b3['as'],'attributes':_0x2d85b3['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0xe62a6f){logger[_0x9f86('0xf')](_0x9f86('0x21'),_0x10645f);logger['debug'](_0x9f86('0x21'),_0x10645f,JSON['stringify'](_0xe62a6f));_0x4dc8b1(_0xe62a6f);})['catch'](function(_0x36be53){logger[_0x9f86('0x15')](_0x9f86('0x21'),_0x36be53[_0x9f86('0x16')],_0x10645f);_0x227937(_0x274b72[_0x9f86('0x15')](0x1f4,_0x36be53[_0x9f86('0x16')]));});});};exports[_0x9f86('0x22')]=function(_0x2af385){var _0x1ade61=this;return new Promise(function(_0x2c7155,_0x2bd600){return db['SugarcrmAccount']['find']({'raw':_0x2af385[_0x9f86('0x19')]?_0x2af385[_0x9f86('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x2af385[_0x9f86('0x19')]?_0x2af385[_0x9f86('0x19')][_0x9f86('0x1b')]||null:null,'attributes':_0x2af385[_0x9f86('0x19')]?_0x2af385[_0x9f86('0x19')][_0x9f86('0x1c')]||null:null,'include':_0x2af385[_0x9f86('0x19')]?_0x2af385[_0x9f86('0x19')][_0x9f86('0x1e')]?_[_0x9f86('0x1f')](_0x2af385[_0x9f86('0x19')]['include'],function(_0x2584c2){return{'model':db[_0x2584c2[_0x9f86('0x20')]],'as':_0x2584c2['as'],'attributes':_0x2584c2[_0x9f86('0x1c')],'include':_0x2584c2[_0x9f86('0x1e')]?_[_0x9f86('0x1f')](_0x2584c2['include'],function(_0x4372c7){return{'model':db[_0x4372c7[_0x9f86('0x20')]],'as':_0x4372c7['as'],'attributes':_0x4372c7[_0x9f86('0x1c')],'include':_0x4372c7[_0x9f86('0x1e')]?_['map'](_0x4372c7[_0x9f86('0x1e')],function(_0x44289a){return{'model':db[_0x44289a[_0x9f86('0x20')]],'as':_0x44289a['as'],'attributes':_0x44289a[_0x9f86('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x9f86('0xe')](function(_0x489708){logger[_0x9f86('0xf')](_0x9f86('0x22'),_0x2af385);logger['debug']('ShowSugarcrmAccount',_0x2af385,JSON['stringify'](_0x489708));_0x2c7155(_0x489708);})[_0x9f86('0x23')](function(_0x559a32){logger[_0x9f86('0x15')]('ShowSugarcrmAccount',_0x559a32[_0x9f86('0x16')],_0x2af385);_0x2bd600(_0x1ade61[_0x9f86('0x15')](0x1f4,_0x559a32[_0x9f86('0x16')]));});});}; \ No newline at end of file +var _0x1f16=['info','SugarcrmAccount,\x20%s,\x20%s','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','GetSugarcrmAccount','findAll','options','raw','where','limit','map','attributes','include','model','ShowSugarcrmAccount','SugarcrmAccount','find','lodash','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','then'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1f16,0x177));var _0x61f1=function(_0x2e5d49,_0x87141a){_0x2e5d49=_0x2e5d49-0x0;var _0x37d530=_0x1f16[_0x2e5d49];return _0x37d530;};'use strict';var _=require(_0x61f1('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x61f1('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x61f1('0x2'))['db'];var utils=require(_0x61f1('0x3'));var logger=require(_0x61f1('0x4'))(_0x61f1('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x61f1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x184fc7,_0x582199,_0x25904a){return new BPromise(function(_0x493e49,_0x27724c){return client[_0x61f1('0x7')](_0x184fc7,_0x25904a)[_0x61f1('0x8')](function(_0x51db0c){logger[_0x61f1('0x9')](_0x61f1('0xa'),_0x582199,'request\x20sent');logger[_0x61f1('0xb')](_0x61f1('0xc'),_0x582199,'request\x20sent',JSON[_0x61f1('0xd')](_0x51db0c));if(_0x51db0c[_0x61f1('0xe')]){if(_0x51db0c[_0x61f1('0xe')]['code']===0x1f4){logger[_0x61f1('0xe')](_0x61f1('0xa'),_0x582199,_0x51db0c[_0x61f1('0xe')]['message']);return _0x27724c(_0x51db0c[_0x61f1('0xe')][_0x61f1('0xf')]);}logger[_0x61f1('0xe')](_0x61f1('0xa'),_0x582199,_0x51db0c[_0x61f1('0xe')][_0x61f1('0xf')]);return _0x493e49(_0x51db0c['error'][_0x61f1('0xf')]);}else{logger[_0x61f1('0x9')](_0x61f1('0xa'),_0x582199,_0x61f1('0x10'));_0x493e49(_0x51db0c[_0x61f1('0x11')][_0x61f1('0xf')]);}})[_0x61f1('0x12')](function(_0x235f72){logger[_0x61f1('0xe')](_0x61f1('0xa'),_0x582199,_0x235f72);_0x27724c(_0x235f72);});});}exports[_0x61f1('0x13')]=function(_0x2ce492){var _0xf11a73=this;return new Promise(function(_0x14eecd,_0x41d808){return db['SugarcrmAccount'][_0x61f1('0x14')]({'raw':_0x2ce492[_0x61f1('0x15')]?_0x2ce492['options'][_0x61f1('0x16')]===undefined?!![]:![]:!![],'where':_0x2ce492[_0x61f1('0x15')]?_0x2ce492[_0x61f1('0x15')][_0x61f1('0x17')]||null:null,'attributes':_0x2ce492[_0x61f1('0x15')]?_0x2ce492[_0x61f1('0x15')]['attributes']||null:null,'limit':_0x2ce492[_0x61f1('0x15')]?_0x2ce492[_0x61f1('0x15')][_0x61f1('0x18')]||null:null,'include':_0x2ce492[_0x61f1('0x15')]?_0x2ce492['options']['include']?_[_0x61f1('0x19')](_0x2ce492[_0x61f1('0x15')]['include'],function(_0x237ef0){return{'model':db[_0x237ef0['model']],'as':_0x237ef0['as'],'attributes':_0x237ef0[_0x61f1('0x1a')],'include':_0x237ef0['include']?_[_0x61f1('0x19')](_0x237ef0[_0x61f1('0x1b')],function(_0x3d9815){return{'model':db[_0x3d9815['model']],'as':_0x3d9815['as'],'attributes':_0x3d9815[_0x61f1('0x1a')],'include':_0x3d9815['include']?_['map'](_0x3d9815[_0x61f1('0x1b')],function(_0x39fb22){return{'model':db[_0x39fb22[_0x61f1('0x1c')]],'as':_0x39fb22['as'],'attributes':_0x39fb22[_0x61f1('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x13df26){logger[_0x61f1('0x9')]('GetSugarcrmAccount',_0x2ce492);logger[_0x61f1('0xb')](_0x61f1('0x13'),_0x2ce492,JSON[_0x61f1('0xd')](_0x13df26));_0x14eecd(_0x13df26);})[_0x61f1('0x12')](function(_0x59603c){logger[_0x61f1('0xe')](_0x61f1('0x13'),_0x59603c[_0x61f1('0xf')],_0x2ce492);_0x41d808(_0xf11a73[_0x61f1('0xe')](0x1f4,_0x59603c[_0x61f1('0xf')]));});});};exports[_0x61f1('0x1d')]=function(_0x5384f6){var _0x2cd277=this;return new Promise(function(_0x44a1cf,_0x3abff2){return db[_0x61f1('0x1e')][_0x61f1('0x1f')]({'raw':_0x5384f6['options']?_0x5384f6[_0x61f1('0x15')][_0x61f1('0x16')]===undefined?!![]:![]:!![],'where':_0x5384f6[_0x61f1('0x15')]?_0x5384f6[_0x61f1('0x15')][_0x61f1('0x17')]||null:null,'attributes':_0x5384f6[_0x61f1('0x15')]?_0x5384f6[_0x61f1('0x15')]['attributes']||null:null,'include':_0x5384f6[_0x61f1('0x15')]?_0x5384f6[_0x61f1('0x15')][_0x61f1('0x1b')]?_[_0x61f1('0x19')](_0x5384f6[_0x61f1('0x15')]['include'],function(_0x46b5d9){return{'model':db[_0x46b5d9[_0x61f1('0x1c')]],'as':_0x46b5d9['as'],'attributes':_0x46b5d9['attributes'],'include':_0x46b5d9[_0x61f1('0x1b')]?_[_0x61f1('0x19')](_0x46b5d9[_0x61f1('0x1b')],function(_0x46abd2){return{'model':db[_0x46abd2['model']],'as':_0x46abd2['as'],'attributes':_0x46abd2[_0x61f1('0x1a')],'include':_0x46abd2['include']?_['map'](_0x46abd2[_0x61f1('0x1b')],function(_0x3d830b){return{'model':db[_0x3d830b[_0x61f1('0x1c')]],'as':_0x3d830b['as'],'attributes':_0x3d830b['attributes']};}):[]};}):[]};}):[]:[]})[_0x61f1('0x8')](function(_0x5b147f){logger[_0x61f1('0x9')](_0x61f1('0x1d'),_0x5384f6);logger[_0x61f1('0xb')](_0x61f1('0x1d'),_0x5384f6,JSON[_0x61f1('0xd')](_0x5b147f));_0x44a1cf(_0x5b147f);})['catch'](function(_0x268f98){logger[_0x61f1('0xe')]('ShowSugarcrmAccount',_0x268f98[_0x61f1('0xf')],_0x5384f6);_0x3abff2(_0x2cd277[_0x61f1('0xe')](0x1f4,_0x268f98[_0x61f1('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index 6deb204..51eba9c 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 _0x0181=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','show','/:id/fields','getFields','/:id/subjects','isAuthenticated','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x942387,_0x2d21df){var _0x3b7f08=function(_0x3c87b2){while(--_0x3c87b2){_0x942387['push'](_0x942387['shift']());}};_0x3b7f08(++_0x2d21df);}(_0x0181,0x90));var _0x1018=function(_0x459423,_0x3416a8){_0x459423=_0x459423-0x0;var _0x42ed14=_0x0181[_0x459423];return _0x42ed14;};'use strict';var multer=require(_0x1018('0x0'));var util=require(_0x1018('0x1'));var path=require(_0x1018('0x2'));var timeout=require(_0x1018('0x3'));var express=require(_0x1018('0x4'));var router=express[_0x1018('0x5')]();var auth=require(_0x1018('0x6'));var interaction=require(_0x1018('0x7'));var config=require(_0x1018('0x8'));var controller=require('./intSugarcrmConfiguration.controller');router[_0x1018('0x9')]('/',auth['isAuthenticated'](),controller[_0x1018('0xa')]);router[_0x1018('0x9')](_0x1018('0xb'),auth['isAuthenticated'](),controller[_0x1018('0xc')]);router['get'](_0x1018('0xd'),auth['isAuthenticated'](),controller[_0x1018('0xe')]);router[_0x1018('0x9')](_0x1018('0xf'),auth[_0x1018('0x10')](),controller[_0x1018('0x11')]);router['get'](_0x1018('0x12'),auth['isAuthenticated'](),controller[_0x1018('0x13')]);router['post']('/',auth[_0x1018('0x10')](),controller[_0x1018('0x14')]);router[_0x1018('0x15')](_0x1018('0xb'),auth['isAuthenticated'](),controller[_0x1018('0x16')]);router[_0x1018('0x17')](_0x1018('0xb'),auth[_0x1018('0x10')](),controller['destroy']);module[_0x1018('0x18')]=router; \ No newline at end of file +var _0xe10b=['getDescriptions','post','create','put','update','/:id','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe10b,0x1eb));var _0xbe10=function(_0x128ac1,_0x54583e){_0x128ac1=_0x128ac1-0x0;var _0x35f35f=_0xe10b[_0x128ac1];return _0x35f35f;};'use strict';var multer=require(_0xbe10('0x0'));var util=require(_0xbe10('0x1'));var path=require(_0xbe10('0x2'));var timeout=require(_0xbe10('0x3'));var express=require('express');var router=express[_0xbe10('0x4')]();var auth=require(_0xbe10('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbe10('0x6'));var controller=require('./intSugarcrmConfiguration.controller');router[_0xbe10('0x7')]('/',auth[_0xbe10('0x8')](),controller['index']);router[_0xbe10('0x7')]('/:id',auth['isAuthenticated'](),controller[_0xbe10('0x9')]);router[_0xbe10('0x7')](_0xbe10('0xa'),auth[_0xbe10('0x8')](),controller[_0xbe10('0xb')]);router[_0xbe10('0x7')](_0xbe10('0xc'),auth['isAuthenticated'](),controller[_0xbe10('0xd')]);router[_0xbe10('0x7')](_0xbe10('0xe'),auth[_0xbe10('0x8')](),controller[_0xbe10('0xf')]);router[_0xbe10('0x10')]('/',auth['isAuthenticated'](),controller[_0xbe10('0x11')]);router[_0xbe10('0x12')]('/:id',auth[_0xbe10('0x8')](),controller[_0xbe10('0x13')]);router['delete'](_0xbe10('0x14'),auth['isAuthenticated'](),controller[_0xbe10('0x15')]);module[_0xbe10('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index 867ef67..222f602 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 _0xcacd=['sequelize','STRING'];(function(_0x2adbb0,_0x21029d){var _0x469709=function(_0xaa8a27){while(--_0xaa8a27){_0x2adbb0['push'](_0x2adbb0['shift']());}};_0x469709(++_0x21029d);}(_0xcacd,0xa2));var _0xdcac=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xcacd[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xdcac('0x0'));module['exports']={'name':{'type':Sequelize[_0xdcac('0x1')]},'description':{'type':Sequelize[_0xdcac('0x1')]}}; \ No newline at end of file +var _0xb0e7=['sequelize','exports','STRING'];(function(_0x424bdf,_0x573432){var _0x31daff=function(_0xf7039e){while(--_0xf7039e){_0x424bdf['push'](_0x424bdf['shift']());}};_0x31daff(++_0x573432);}(_0xb0e7,0x1aa));var _0x7b0e=function(_0x36d83f,_0x4f07cd){_0x36d83f=_0x36d83f-0x0;var _0x551c5e=_0xb0e7[_0x36d83f];return _0x551c5e;};'use strict';var Sequelize=require(_0x7b0e('0x0'));module[_0x7b0e('0x1')]={'name':{'type':Sequelize[_0x7b0e('0x2')]},'description':{'type':Sequelize[_0x7b0e('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index cc8ab2e..089a4e5 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 _0x48a0=['rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','stack','name','index','map','SugarcrmConfiguration','rawAttributes','type','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','length','includeAll','create','body','find','getFields','SugarcrmField','order','getSubjects','findOne','getDescriptions','html-pdf'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0x48a0,0x110));var _0x048a=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x48a0[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x048a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x048a('0x1'));var zipdir=require(_0x048a('0x2'));var jsonpatch=require(_0x048a('0x3'));var rp=require(_0x048a('0x4'));var moment=require(_0x048a('0x5'));var BPromise=require(_0x048a('0x6'));var Mustache=require('mustache');var util=require(_0x048a('0x7'));var path=require(_0x048a('0x8'));var sox=require(_0x048a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x048a('0xa'));var squel=require(_0x048a('0xb'));var crypto=require(_0x048a('0xc'));var jsforce=require(_0x048a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x048a('0xe'));var querystring=require(_0x048a('0xf'));var Papa=require(_0x048a('0x10'));var Redis=require(_0x048a('0x11'));var authService=require(_0x048a('0x12'));var qs=require(_0x048a('0x13'));var as=require(_0x048a('0x14'));var hardwareService=require(_0x048a('0x15'));var logger=require(_0x048a('0x16'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x048a('0x17'))['db'];var jayson=require(_0x048a('0x18'));var client=jayson['client'][_0x048a('0x19')]({'port':0x232a});function checkPasswordPattern(_0x88e6aa,_0xdfa634,_0xc816e3){if(_0xc816e3){var _0x406d8e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x406d8e['test'](_0xdfa634)){return _0x88e6aa;}else{throw new db[(_0x048a('0x1a'))][(_0x048a('0x1b'))](_0x048a('0x1c'));}}else{return _0x88e6aa;}}function respondWithRpcPromise(_0x949d7e,_0xc65f3d,_0x3604a6,_0x3602e0){return new BPromise(function(_0x1085c3,_0x20a21f){var _0x1e7216=_0x3602e0||client;return _0x1e7216[_0x048a('0x1d')](_0x949d7e,_0x3604a6)[_0x048a('0x1e')](function(_0x33c988){logger['info'](_0x048a('0x1f'),_0xc65f3d,_0x048a('0x20'));logger[_0x048a('0x21')](_0x048a('0x22'),_0xc65f3d,_0x048a('0x20'),JSON[_0x048a('0x23')](_0x33c988));if(_0x33c988[_0x048a('0x24')]){if(_0x33c988[_0x048a('0x24')]['code']===0x1f4){logger['error'](_0x048a('0x1f'),_0xc65f3d,_0x33c988[_0x048a('0x24')][_0x048a('0x25')]);return _0x20a21f(_0x33c988[_0x048a('0x24')][_0x048a('0x25')]);}logger['error'](_0x048a('0x1f'),_0xc65f3d,_0x33c988[_0x048a('0x24')][_0x048a('0x25')]);return _0x1085c3(_0x33c988[_0x048a('0x24')][_0x048a('0x25')]);}else{logger[_0x048a('0x26')](_0x048a('0x1f'),_0xc65f3d,'request\x20sent');_0x1085c3(_0x33c988[_0x048a('0x27')][_0x048a('0x25')]);}})['catch'](function(_0x1920b3){logger[_0x048a('0x24')](_0x048a('0x1f'),_0xc65f3d,_0x1920b3);_0x20a21f(_0x1920b3);});});}function respondWithStatusCode(_0x38c887,_0x19295d){_0x19295d=_0x19295d||0xcc;return function(_0xa6d2da){if(_0xa6d2da){return _0x38c887['sendStatus'](_0x19295d);}return _0x38c887[_0x048a('0x28')](_0x19295d)[_0x048a('0x29')]();};}function respondWithResult(_0x49e199,_0x412289){_0x412289=_0x412289||0xc8;return function(_0x337a2f){if(_0x337a2f){return _0x49e199[_0x048a('0x28')](_0x412289)[_0x048a('0x2a')](_0x337a2f);}};}function respondWithFilteredResult(_0xa90ccd,_0x5ed71b){return function(_0x3704bc){if(_0x3704bc){var _0x1d0947=_0x3704bc[_0x048a('0x2b')],_0x142b14=_0x5ed71b['offset'],_0xb2048a=_0x5ed71b[_0x048a('0x2c')]+_0x5ed71b[_0x048a('0x2d')],_0x27e077;if(_0xb2048a>=_0x1d0947){_0xb2048a=_0x1d0947;_0x27e077=0xc8;}else{_0x27e077=0xce;}_0xa90ccd[_0x048a('0x28')](_0x27e077);return _0xa90ccd['set'](_0x048a('0x2e'),_0x142b14+'-'+_0xb2048a+'/'+_0x1d0947)[_0x048a('0x2a')](_0x3704bc);}return null;};}function patchUpdates(_0x11d1e5){return function(_0x5bb8df){try{jsonpatch[_0x048a('0x2f')](_0x5bb8df,_0x11d1e5,!![]);}catch(_0x442cf3){return BPromise[_0x048a('0x30')](_0x442cf3);}return _0x5bb8df['save']();};}function saveUpdates(_0x5f372d,_0x3f7575){return function(_0x3f7a87){if(_0x3f7a87){return _0x3f7a87[_0x048a('0x31')](_0x5f372d)[_0x048a('0x1e')](function(_0x2de8b5){return _0x2de8b5;});}return null;};}function removeEntity(_0x2c0e40,_0x2385bc){return function(_0x20381b){if(_0x20381b){return _0x20381b[_0x048a('0x32')]()[_0x048a('0x1e')](function(){_0x2c0e40['status'](0xcc)[_0x048a('0x29')]();});}};}function handleEntityNotFound(_0x5e9f14,_0x1396b6){return function(_0xa05563){if(!_0xa05563){_0x5e9f14['sendStatus'](0x194);}return _0xa05563;};}function handleError(_0x4a59ad,_0x5a75ac){_0x5a75ac=_0x5a75ac||0x1f4;return function(_0x59ef15){logger[_0x048a('0x24')](_0x59ef15[_0x048a('0x33')]);if(_0x59ef15[_0x048a('0x34')]){delete _0x59ef15[_0x048a('0x34')];}_0x4a59ad[_0x048a('0x28')](_0x5a75ac)['send'](_0x59ef15);};}exports[_0x048a('0x35')]=function(_0x1ba476,_0x1dfa50){var _0x378228={},_0x25d04e={},_0x1b6e5b={'count':0x0,'rows':[]};var _0x32ef25=_[_0x048a('0x36')](db[_0x048a('0x37')][_0x048a('0x38')],function(_0xc962b){return{'name':_0xc962b['fieldName'],'type':_0xc962b[_0x048a('0x39')]['key']};});_0x25d04e[_0x048a('0x3a')]=_[_0x048a('0x36')](_0x32ef25,_0x048a('0x34'));_0x25d04e[_0x048a('0x3b')]=_['keys'](_0x1ba476[_0x048a('0x3b')]);_0x25d04e['filters']=_[_0x048a('0x3c')](_0x25d04e[_0x048a('0x3a')],_0x25d04e[_0x048a('0x3b')]);_0x378228[_0x048a('0x3d')]=_['intersection'](_0x25d04e[_0x048a('0x3a')],qs[_0x048a('0x3e')](_0x1ba476[_0x048a('0x3b')]['fields']));_0x378228[_0x048a('0x3d')]=_0x378228[_0x048a('0x3d')]['length']?_0x378228['attributes']:_0x25d04e['model'];if(!_0x1ba476[_0x048a('0x3b')][_0x048a('0x3f')](_0x048a('0x40'))){_0x378228['limit']=qs[_0x048a('0x2d')](_0x1ba476[_0x048a('0x3b')][_0x048a('0x2d')]);_0x378228[_0x048a('0x2c')]=qs[_0x048a('0x2c')](_0x1ba476[_0x048a('0x3b')][_0x048a('0x2c')]);}_0x378228['order']=qs['sort'](_0x1ba476[_0x048a('0x3b')][_0x048a('0x41')]);_0x378228['where']=qs[_0x048a('0x42')](_[_0x048a('0x43')](_0x1ba476[_0x048a('0x3b')],_0x25d04e[_0x048a('0x42')]));if(_0x1ba476['query'][_0x048a('0x44')]){_0x378228[_0x048a('0x45')]=_[_0x048a('0x46')](_0x378228[_0x048a('0x45')],{'$or':_['map'](_0x32ef25,function(_0x21cf84){if(_0x21cf84['type']!==_0x048a('0x47')){var _0x30f909={};_0x30f909[_0x21cf84[_0x048a('0x34')]]={'$like':'%'+_0x1ba476[_0x048a('0x3b')][_0x048a('0x44')]+'%'};return _0x30f909;}})});}_0x378228=_[_0x048a('0x46')]({},_0x378228,_0x1ba476[_0x048a('0x48')]);var _0x40b95f={'where':_0x378228[_0x048a('0x45')]};return db[_0x048a('0x37')][_0x048a('0x2b')](_0x40b95f)[_0x048a('0x1e')](function(_0x16df34){_0x1b6e5b[_0x048a('0x2b')]=_0x16df34;if(_0x1ba476[_0x048a('0x3b')]['includeAll']){_0x378228[_0x048a('0x49')]=[{'all':!![]}];}return db[_0x048a('0x37')][_0x048a('0x4a')](_0x378228);})[_0x048a('0x1e')](function(_0x242006){_0x1b6e5b[_0x048a('0x4b')]=_0x242006;return _0x1b6e5b;})[_0x048a('0x1e')](respondWithFilteredResult(_0x1dfa50,_0x378228))[_0x048a('0x4c')](handleError(_0x1dfa50,null));};exports[_0x048a('0x4d')]=function(_0x1bedbe,_0x2e9a2c){var _0x79c886={'raw':![],'where':{'id':_0x1bedbe[_0x048a('0x4e')]['id']}},_0xd003d3={};_0xd003d3[_0x048a('0x3a')]=_['keys'](db['SugarcrmConfiguration'][_0x048a('0x38')]);_0xd003d3[_0x048a('0x3b')]=_[_0x048a('0x4f')](_0x1bedbe[_0x048a('0x3b')]);_0xd003d3[_0x048a('0x42')]=_[_0x048a('0x3c')](_0xd003d3[_0x048a('0x3a')],_0xd003d3['query']);_0x79c886['attributes']=_[_0x048a('0x3c')](_0xd003d3[_0x048a('0x3a')],qs[_0x048a('0x3e')](_0x1bedbe[_0x048a('0x3b')][_0x048a('0x3e')]));_0x79c886['attributes']=_0x79c886['attributes'][_0x048a('0x50')]?_0x79c886[_0x048a('0x3d')]:_0xd003d3[_0x048a('0x3a')];if(_0x1bedbe['query'][_0x048a('0x51')]){_0x79c886['include']=[{'all':!![]}];}_0x79c886=_['merge']({},_0x79c886,_0x1bedbe[_0x048a('0x48')]);return db[_0x048a('0x37')]['find'](_0x79c886)[_0x048a('0x1e')](handleEntityNotFound(_0x2e9a2c,null))[_0x048a('0x1e')](respondWithResult(_0x2e9a2c,null))[_0x048a('0x4c')](handleError(_0x2e9a2c,null));};exports[_0x048a('0x52')]=function(_0x543487,_0x3c20fb){return db['SugarcrmConfiguration'][_0x048a('0x52')](_0x543487[_0x048a('0x53')],{})[_0x048a('0x1e')](respondWithResult(_0x3c20fb,0xc9))[_0x048a('0x4c')](handleError(_0x3c20fb,null));};exports[_0x048a('0x31')]=function(_0x35e90f,_0x3fffa3){if(_0x35e90f['body']['id']){delete _0x35e90f[_0x048a('0x53')]['id'];}return db['SugarcrmConfiguration'][_0x048a('0x54')]({'where':{'id':_0x35e90f[_0x048a('0x4e')]['id']}})[_0x048a('0x1e')](handleEntityNotFound(_0x3fffa3,null))['then'](saveUpdates(_0x35e90f[_0x048a('0x53')],null))['then'](respondWithResult(_0x3fffa3,null))[_0x048a('0x4c')](handleError(_0x3fffa3,null));};exports['destroy']=function(_0x10b62f,_0x1d2ae4){return db[_0x048a('0x37')]['find']({'where':{'id':_0x10b62f['params']['id']}})[_0x048a('0x1e')](handleEntityNotFound(_0x1d2ae4,null))[_0x048a('0x1e')](removeEntity(_0x1d2ae4,null))['catch'](handleError(_0x1d2ae4,null));};exports[_0x048a('0x55')]=function(_0x5eb3b0,_0x1aee29,_0x4af196){var _0x1c8d31={};var _0x555c25={};var _0x3dd2ca;var _0x44f2aa;return db[_0x048a('0x37')]['findOne']({'where':{'id':_0x5eb3b0[_0x048a('0x4e')]['id']}})[_0x048a('0x1e')](handleEntityNotFound(_0x1aee29,null))[_0x048a('0x1e')](function(_0x4e22a0){if(_0x4e22a0){_0x3dd2ca=_0x4e22a0;_0x555c25[_0x048a('0x3a')]=_['keys'](db[_0x048a('0x56')][_0x048a('0x38')]);_0x555c25['query']=_['keys'](_0x5eb3b0[_0x048a('0x3b')]);_0x555c25[_0x048a('0x42')]=_['intersection'](_0x555c25['model'],_0x555c25[_0x048a('0x3b')]);_0x1c8d31[_0x048a('0x3d')]=_[_0x048a('0x3c')](_0x555c25[_0x048a('0x3a')],qs['fields'](_0x5eb3b0[_0x048a('0x3b')][_0x048a('0x3e')]));_0x1c8d31[_0x048a('0x3d')]=_0x1c8d31[_0x048a('0x3d')][_0x048a('0x50')]?_0x1c8d31['attributes']:_0x555c25[_0x048a('0x3a')];_0x1c8d31[_0x048a('0x57')]=qs[_0x048a('0x41')](_0x5eb3b0['query'][_0x048a('0x41')]);_0x1c8d31[_0x048a('0x45')]=qs[_0x048a('0x42')](_['pick'](_0x5eb3b0[_0x048a('0x3b')],_0x555c25['filters']));if(_0x5eb3b0[_0x048a('0x3b')][_0x048a('0x44')]){_0x1c8d31[_0x048a('0x45')]=_[_0x048a('0x46')](_0x1c8d31[_0x048a('0x45')],{'$or':_[_0x048a('0x36')](_0x1c8d31['attributes'],function(_0x5687a2){var _0x217274={};_0x217274[_0x5687a2]={'$like':'%'+_0x5eb3b0['query'][_0x048a('0x44')]+'%'};return _0x217274;})});}_0x1c8d31=_[_0x048a('0x46')]({},_0x1c8d31,_0x5eb3b0[_0x048a('0x48')]);return _0x3dd2ca['getFields'](_0x1c8d31);}})[_0x048a('0x1e')](function(_0x10e3f2){if(_0x10e3f2){_0x44f2aa=_0x10e3f2[_0x048a('0x50')];if(!_0x5eb3b0[_0x048a('0x3b')]['hasOwnProperty'](_0x048a('0x40'))){_0x1c8d31[_0x048a('0x2d')]=qs[_0x048a('0x2d')](_0x5eb3b0[_0x048a('0x3b')]['limit']);_0x1c8d31[_0x048a('0x2c')]=qs[_0x048a('0x2c')](_0x5eb3b0['query'][_0x048a('0x2c')]);}return _0x3dd2ca[_0x048a('0x55')](_0x1c8d31);}})['then'](function(_0x35a22d){if(_0x35a22d){return _0x35a22d?{'count':_0x44f2aa,'rows':_0x35a22d}:null;}})[_0x048a('0x1e')](respondWithResult(_0x1aee29,null))[_0x048a('0x4c')](handleError(_0x1aee29,null));};exports[_0x048a('0x58')]=function(_0x25c779,_0x2770a0,_0x1498be){var _0x25643f={};var _0x34520={};var _0x5348ab;var _0x22aba2;return db[_0x048a('0x37')]['findOne']({'where':{'id':_0x25c779[_0x048a('0x4e')]['id']}})[_0x048a('0x1e')](handleEntityNotFound(_0x2770a0,null))[_0x048a('0x1e')](function(_0xb9ee05){if(_0xb9ee05){_0x5348ab=_0xb9ee05;_0x34520['model']=_['keys'](db['SugarcrmField']['rawAttributes']);_0x34520[_0x048a('0x3b')]=_[_0x048a('0x4f')](_0x25c779[_0x048a('0x3b')]);_0x34520[_0x048a('0x42')]=_[_0x048a('0x3c')](_0x34520['model'],_0x34520[_0x048a('0x3b')]);_0x25643f['attributes']=_[_0x048a('0x3c')](_0x34520['model'],qs[_0x048a('0x3e')](_0x25c779[_0x048a('0x3b')][_0x048a('0x3e')]));_0x25643f[_0x048a('0x3d')]=_0x25643f[_0x048a('0x3d')]['length']?_0x25643f[_0x048a('0x3d')]:_0x34520[_0x048a('0x3a')];_0x25643f[_0x048a('0x57')]=qs[_0x048a('0x41')](_0x25c779['query'][_0x048a('0x41')]);_0x25643f['where']=qs[_0x048a('0x42')](_[_0x048a('0x43')](_0x25c779['query'],_0x34520[_0x048a('0x42')]));if(_0x25c779[_0x048a('0x3b')]['filter']){_0x25643f[_0x048a('0x45')]=_[_0x048a('0x46')](_0x25643f[_0x048a('0x45')],{'$or':_[_0x048a('0x36')](_0x25643f[_0x048a('0x3d')],function(_0x210526){var _0x5b903c={};_0x5b903c[_0x210526]={'$like':'%'+_0x25c779[_0x048a('0x3b')][_0x048a('0x44')]+'%'};return _0x5b903c;})});}_0x25643f=_[_0x048a('0x46')]({},_0x25643f,_0x25c779[_0x048a('0x48')]);return _0x5348ab['getSubjects'](_0x25643f);}})[_0x048a('0x1e')](function(_0xe1972f){if(_0xe1972f){_0x22aba2=_0xe1972f[_0x048a('0x50')];if(!_0x25c779['query'][_0x048a('0x3f')](_0x048a('0x40'))){_0x25643f['limit']=qs['limit'](_0x25c779[_0x048a('0x3b')][_0x048a('0x2d')]);_0x25643f[_0x048a('0x2c')]=qs[_0x048a('0x2c')](_0x25c779[_0x048a('0x3b')][_0x048a('0x2c')]);}return _0x5348ab[_0x048a('0x58')](_0x25643f);}})['then'](function(_0x3bb97f){if(_0x3bb97f){return _0x3bb97f?{'count':_0x22aba2,'rows':_0x3bb97f}:null;}})['then'](respondWithResult(_0x2770a0,null))[_0x048a('0x4c')](handleError(_0x2770a0,null));};exports['getDescriptions']=function(_0x3b0ec1,_0x511f11,_0x2b47f2){var _0x553ef2={};var _0x22655d={};var _0x1f72c7;var _0xb9c02e;return db[_0x048a('0x37')][_0x048a('0x59')]({'where':{'id':_0x3b0ec1[_0x048a('0x4e')]['id']}})[_0x048a('0x1e')](handleEntityNotFound(_0x511f11,null))[_0x048a('0x1e')](function(_0x592176){if(_0x592176){_0x1f72c7=_0x592176;_0x22655d[_0x048a('0x3a')]=_['keys'](db[_0x048a('0x56')][_0x048a('0x38')]);_0x22655d[_0x048a('0x3b')]=_[_0x048a('0x4f')](_0x3b0ec1[_0x048a('0x3b')]);_0x22655d[_0x048a('0x42')]=_['intersection'](_0x22655d[_0x048a('0x3a')],_0x22655d[_0x048a('0x3b')]);_0x553ef2[_0x048a('0x3d')]=_[_0x048a('0x3c')](_0x22655d[_0x048a('0x3a')],qs[_0x048a('0x3e')](_0x3b0ec1['query'][_0x048a('0x3e')]));_0x553ef2[_0x048a('0x3d')]=_0x553ef2['attributes'][_0x048a('0x50')]?_0x553ef2[_0x048a('0x3d')]:_0x22655d[_0x048a('0x3a')];_0x553ef2['order']=qs[_0x048a('0x41')](_0x3b0ec1[_0x048a('0x3b')][_0x048a('0x41')]);_0x553ef2[_0x048a('0x45')]=qs[_0x048a('0x42')](_[_0x048a('0x43')](_0x3b0ec1[_0x048a('0x3b')],_0x22655d[_0x048a('0x42')]));if(_0x3b0ec1['query'][_0x048a('0x44')]){_0x553ef2[_0x048a('0x45')]=_[_0x048a('0x46')](_0x553ef2['where'],{'$or':_[_0x048a('0x36')](_0x553ef2[_0x048a('0x3d')],function(_0x57941e){var _0x5ef964={};_0x5ef964[_0x57941e]={'$like':'%'+_0x3b0ec1[_0x048a('0x3b')][_0x048a('0x44')]+'%'};return _0x5ef964;})});}_0x553ef2=_['merge']({},_0x553ef2,_0x3b0ec1[_0x048a('0x48')]);return _0x1f72c7[_0x048a('0x5a')](_0x553ef2);}})[_0x048a('0x1e')](function(_0x23c2d7){if(_0x23c2d7){_0xb9c02e=_0x23c2d7[_0x048a('0x50')];if(!_0x3b0ec1[_0x048a('0x3b')]['hasOwnProperty']('nolimit')){_0x553ef2[_0x048a('0x2d')]=qs['limit'](_0x3b0ec1['query'][_0x048a('0x2d')]);_0x553ef2['offset']=qs[_0x048a('0x2c')](_0x3b0ec1['query'][_0x048a('0x2c')]);}return _0x1f72c7[_0x048a('0x5a')](_0x553ef2);}})[_0x048a('0x1e')](function(_0x5f2c81){if(_0x5f2c81){return _0x5f2c81?{'count':_0xb9c02e,'rows':_0x5f2c81}:null;}})[_0x048a('0x1e')](respondWithResult(_0x511f11,null))['catch'](handleError(_0x511f11,null));}; \ No newline at end of file +var _0xc5ee=['create','body','params','getFields','getSubjects','SugarcrmField','findOne','getDescriptions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','SugarcrmConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','show','keys','rawAttributes','includeAll','find'];(function(_0x44dc11,_0x5efbe2){var _0x1e1c86=function(_0x272dd5){while(--_0x272dd5){_0x44dc11['push'](_0x44dc11['shift']());}};_0x1e1c86(++_0x5efbe2);}(_0xc5ee,0x18c));var _0xec5e=function(_0x5179a5,_0x419746){_0x5179a5=_0x5179a5-0x0;var _0x15c8ce=_0xc5ee[_0x5179a5];return _0x15c8ce;};'use strict';var pdf=require(_0xec5e('0x0'));var emlformat=require(_0xec5e('0x1'));var rimraf=require(_0xec5e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xec5e('0x3'));var rp=require(_0xec5e('0x4'));var moment=require(_0xec5e('0x5'));var BPromise=require(_0xec5e('0x6'));var Mustache=require(_0xec5e('0x7'));var util=require(_0xec5e('0x8'));var path=require(_0xec5e('0x9'));var sox=require(_0xec5e('0xa'));var csv=require(_0xec5e('0xb'));var ejs=require(_0xec5e('0xc'));var fs=require('fs');var _=require(_0xec5e('0xd'));var squel=require(_0xec5e('0xe'));var crypto=require(_0xec5e('0xf'));var jsforce=require(_0xec5e('0x10'));var deskjs=require(_0xec5e('0x11'));var toCsv=require(_0xec5e('0xb'));var querystring=require(_0xec5e('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xec5e('0x13'));var qs=require(_0xec5e('0x14'));var as=require(_0xec5e('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xec5e('0x16'))(_0xec5e('0x17'));var utils=require(_0xec5e('0x18'));var config=require(_0xec5e('0x19'));var db=require('../../mysqldb')['db'];var jayson=require(_0xec5e('0x1a'));var client=jayson['client'][_0xec5e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3356eb,_0xa39715,_0x4089fa){if(_0x4089fa){var _0x3e1337=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e1337[_0xec5e('0x1c')](_0xa39715)){return _0x3356eb;}else{throw new db[(_0xec5e('0x1d'))][(_0xec5e('0x1e'))](_0xec5e('0x1f'));}}else{return _0x3356eb;}}function respondWithRpcPromise(_0x56e6e8,_0x5f40d9,_0x40be1a,_0xba8058){return new BPromise(function(_0x49273a,_0x31ee69){var _0xefa7e5=_0xba8058||client;return _0xefa7e5[_0xec5e('0x20')](_0x56e6e8,_0x40be1a)['then'](function(_0x5bb58f){logger[_0xec5e('0x21')](_0xec5e('0x22'),_0x5f40d9,_0xec5e('0x23'));logger[_0xec5e('0x24')](_0xec5e('0x25'),_0x5f40d9,'request\x20sent',JSON['stringify'](_0x5bb58f));if(_0x5bb58f[_0xec5e('0x26')]){if(_0x5bb58f['error'][_0xec5e('0x27')]===0x1f4){logger[_0xec5e('0x26')](_0xec5e('0x22'),_0x5f40d9,_0x5bb58f[_0xec5e('0x26')][_0xec5e('0x28')]);return _0x31ee69(_0x5bb58f[_0xec5e('0x26')][_0xec5e('0x28')]);}logger[_0xec5e('0x26')](_0xec5e('0x22'),_0x5f40d9,_0x5bb58f[_0xec5e('0x26')][_0xec5e('0x28')]);return _0x49273a(_0x5bb58f['error'][_0xec5e('0x28')]);}else{logger[_0xec5e('0x21')](_0xec5e('0x22'),_0x5f40d9,_0xec5e('0x23'));_0x49273a(_0x5bb58f[_0xec5e('0x29')]['message']);}})[_0xec5e('0x2a')](function(_0x2853d6){logger[_0xec5e('0x26')](_0xec5e('0x22'),_0x5f40d9,_0x2853d6);_0x31ee69(_0x2853d6);});});}function respondWithStatusCode(_0x142513,_0x2574ec){_0x2574ec=_0x2574ec||0xcc;return function(_0x12b1a5){if(_0x12b1a5){return _0x142513[_0xec5e('0x2b')](_0x2574ec);}return _0x142513[_0xec5e('0x2c')](_0x2574ec)[_0xec5e('0x2d')]();};}function respondWithResult(_0x57f201,_0x248a03){_0x248a03=_0x248a03||0xc8;return function(_0x5a384d){if(_0x5a384d){return _0x57f201[_0xec5e('0x2c')](_0x248a03)[_0xec5e('0x2e')](_0x5a384d);}};}function respondWithFilteredResult(_0x40ff9b,_0x554fee){return function(_0x3ae2fa){if(_0x3ae2fa){var _0x11714a=_0x3ae2fa[_0xec5e('0x2f')],_0x35ae91=_0x554fee[_0xec5e('0x30')],_0x674282=_0x554fee[_0xec5e('0x30')]+_0x554fee[_0xec5e('0x31')],_0x185679;if(_0x674282>=_0x11714a){_0x674282=_0x11714a;_0x185679=0xc8;}else{_0x185679=0xce;}_0x40ff9b[_0xec5e('0x2c')](_0x185679);return _0x40ff9b[_0xec5e('0x32')](_0xec5e('0x33'),_0x35ae91+'-'+_0x674282+'/'+_0x11714a)[_0xec5e('0x2e')](_0x3ae2fa);}return null;};}function patchUpdates(_0x18be93){return function(_0x487a49){try{jsonpatch[_0xec5e('0x34')](_0x487a49,_0x18be93,!![]);}catch(_0x34a1e9){return BPromise[_0xec5e('0x35')](_0x34a1e9);}return _0x487a49[_0xec5e('0x36')]();};}function saveUpdates(_0x25510a,_0x3993c9){return function(_0x4822e2){if(_0x4822e2){return _0x4822e2[_0xec5e('0x37')](_0x25510a)[_0xec5e('0x38')](function(_0x2efcf5){return _0x2efcf5;});}return null;};}function removeEntity(_0x5c6137,_0x20448e){return function(_0x123276){if(_0x123276){return _0x123276[_0xec5e('0x39')]()[_0xec5e('0x38')](function(){_0x5c6137[_0xec5e('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe3f9cd,_0x490758){return function(_0x10da3d){if(!_0x10da3d){_0xe3f9cd[_0xec5e('0x2b')](0x194);}return _0x10da3d;};}function handleError(_0x54fcbb,_0x1ecb4f){_0x1ecb4f=_0x1ecb4f||0x1f4;return function(_0x584b55){logger[_0xec5e('0x26')](_0x584b55['stack']);if(_0x584b55[_0xec5e('0x3a')]){delete _0x584b55[_0xec5e('0x3a')];}_0x54fcbb[_0xec5e('0x2c')](_0x1ecb4f)['send'](_0x584b55);};}exports[_0xec5e('0x3b')]=function(_0x5d7d56,_0x43f9ed){var _0x1d9e9f={},_0x14b0c5={},_0x50ee71={'count':0x0,'rows':[]};var _0xc56ec4=_[_0xec5e('0x3c')](db[_0xec5e('0x3d')]['rawAttributes'],function(_0x500e0e){return{'name':_0x500e0e[_0xec5e('0x3e')],'type':_0x500e0e[_0xec5e('0x3f')][_0xec5e('0x40')]};});_0x14b0c5[_0xec5e('0x41')]=_[_0xec5e('0x3c')](_0xc56ec4,_0xec5e('0x3a'));_0x14b0c5[_0xec5e('0x42')]=_['keys'](_0x5d7d56[_0xec5e('0x42')]);_0x14b0c5[_0xec5e('0x43')]=_[_0xec5e('0x44')](_0x14b0c5[_0xec5e('0x41')],_0x14b0c5['query']);_0x1d9e9f[_0xec5e('0x45')]=_[_0xec5e('0x44')](_0x14b0c5[_0xec5e('0x41')],qs[_0xec5e('0x46')](_0x5d7d56[_0xec5e('0x42')][_0xec5e('0x46')]));_0x1d9e9f['attributes']=_0x1d9e9f[_0xec5e('0x45')][_0xec5e('0x47')]?_0x1d9e9f[_0xec5e('0x45')]:_0x14b0c5[_0xec5e('0x41')];if(!_0x5d7d56[_0xec5e('0x42')][_0xec5e('0x48')](_0xec5e('0x49'))){_0x1d9e9f[_0xec5e('0x31')]=qs[_0xec5e('0x31')](_0x5d7d56[_0xec5e('0x42')][_0xec5e('0x31')]);_0x1d9e9f[_0xec5e('0x30')]=qs[_0xec5e('0x30')](_0x5d7d56['query'][_0xec5e('0x30')]);}_0x1d9e9f[_0xec5e('0x4a')]=qs[_0xec5e('0x4b')](_0x5d7d56['query'][_0xec5e('0x4b')]);_0x1d9e9f[_0xec5e('0x4c')]=qs[_0xec5e('0x43')](_[_0xec5e('0x4d')](_0x5d7d56[_0xec5e('0x42')],_0x14b0c5['filters']));if(_0x5d7d56[_0xec5e('0x42')][_0xec5e('0x4e')]){_0x1d9e9f[_0xec5e('0x4c')]=_[_0xec5e('0x4f')](_0x1d9e9f[_0xec5e('0x4c')],{'$or':_[_0xec5e('0x3c')](_0xc56ec4,function(_0x2a8c66){if(_0x2a8c66[_0xec5e('0x3f')]!==_0xec5e('0x50')){var _0x2edc71={};_0x2edc71[_0x2a8c66[_0xec5e('0x3a')]]={'$like':'%'+_0x5d7d56[_0xec5e('0x42')][_0xec5e('0x4e')]+'%'};return _0x2edc71;}})});}_0x1d9e9f=_[_0xec5e('0x4f')]({},_0x1d9e9f,_0x5d7d56[_0xec5e('0x51')]);var _0x6503bb={'where':_0x1d9e9f['where']};return db[_0xec5e('0x3d')]['count'](_0x6503bb)['then'](function(_0x2febf9){_0x50ee71[_0xec5e('0x2f')]=_0x2febf9;if(_0x5d7d56['query']['includeAll']){_0x1d9e9f[_0xec5e('0x52')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0x1d9e9f);})['then'](function(_0x5d4ba2){_0x50ee71[_0xec5e('0x53')]=_0x5d4ba2;return _0x50ee71;})['then'](respondWithFilteredResult(_0x43f9ed,_0x1d9e9f))[_0xec5e('0x2a')](handleError(_0x43f9ed,null));};exports[_0xec5e('0x54')]=function(_0x2e2e41,_0x5323ed){var _0x49064c={'raw':![],'where':{'id':_0x2e2e41['params']['id']}},_0x3bf22d={};_0x3bf22d[_0xec5e('0x41')]=_[_0xec5e('0x55')](db[_0xec5e('0x3d')][_0xec5e('0x56')]);_0x3bf22d[_0xec5e('0x42')]=_[_0xec5e('0x55')](_0x2e2e41[_0xec5e('0x42')]);_0x3bf22d['filters']=_[_0xec5e('0x44')](_0x3bf22d['model'],_0x3bf22d['query']);_0x49064c[_0xec5e('0x45')]=_[_0xec5e('0x44')](_0x3bf22d['model'],qs[_0xec5e('0x46')](_0x2e2e41[_0xec5e('0x42')][_0xec5e('0x46')]));_0x49064c['attributes']=_0x49064c['attributes']['length']?_0x49064c[_0xec5e('0x45')]:_0x3bf22d[_0xec5e('0x41')];if(_0x2e2e41[_0xec5e('0x42')][_0xec5e('0x57')]){_0x49064c[_0xec5e('0x52')]=[{'all':!![]}];}_0x49064c=_[_0xec5e('0x4f')]({},_0x49064c,_0x2e2e41['options']);return db[_0xec5e('0x3d')][_0xec5e('0x58')](_0x49064c)[_0xec5e('0x38')](handleEntityNotFound(_0x5323ed,null))[_0xec5e('0x38')](respondWithResult(_0x5323ed,null))[_0xec5e('0x2a')](handleError(_0x5323ed,null));};exports[_0xec5e('0x59')]=function(_0x1af25a,_0x46ccca){return db[_0xec5e('0x3d')]['create'](_0x1af25a[_0xec5e('0x5a')],{})[_0xec5e('0x38')](respondWithResult(_0x46ccca,0xc9))[_0xec5e('0x2a')](handleError(_0x46ccca,null));};exports['update']=function(_0x36e81a,_0x1a6ad3){if(_0x36e81a[_0xec5e('0x5a')]['id']){delete _0x36e81a['body']['id'];}return db[_0xec5e('0x3d')]['find']({'where':{'id':_0x36e81a[_0xec5e('0x5b')]['id']}})[_0xec5e('0x38')](handleEntityNotFound(_0x1a6ad3,null))['then'](saveUpdates(_0x36e81a[_0xec5e('0x5a')],null))[_0xec5e('0x38')](respondWithResult(_0x1a6ad3,null))[_0xec5e('0x2a')](handleError(_0x1a6ad3,null));};exports['destroy']=function(_0x241ff0,_0x213218){return db[_0xec5e('0x3d')][_0xec5e('0x58')]({'where':{'id':_0x241ff0[_0xec5e('0x5b')]['id']}})[_0xec5e('0x38')](handleEntityNotFound(_0x213218,null))['then'](removeEntity(_0x213218,null))[_0xec5e('0x2a')](handleError(_0x213218,null));};exports[_0xec5e('0x5c')]=function(_0xf5b695,_0x530faf,_0x5993c3){var _0x40cd34={};var _0x381fac={};var _0x27bacd;var _0xbd6d46;return db[_0xec5e('0x3d')]['findOne']({'where':{'id':_0xf5b695['params']['id']}})['then'](handleEntityNotFound(_0x530faf,null))[_0xec5e('0x38')](function(_0x25f771){if(_0x25f771){_0x27bacd=_0x25f771;_0x381fac[_0xec5e('0x41')]=_[_0xec5e('0x55')](db['SugarcrmField']['rawAttributes']);_0x381fac['query']=_[_0xec5e('0x55')](_0xf5b695['query']);_0x381fac['filters']=_[_0xec5e('0x44')](_0x381fac[_0xec5e('0x41')],_0x381fac['query']);_0x40cd34[_0xec5e('0x45')]=_[_0xec5e('0x44')](_0x381fac[_0xec5e('0x41')],qs[_0xec5e('0x46')](_0xf5b695[_0xec5e('0x42')][_0xec5e('0x46')]));_0x40cd34[_0xec5e('0x45')]=_0x40cd34['attributes']['length']?_0x40cd34[_0xec5e('0x45')]:_0x381fac[_0xec5e('0x41')];_0x40cd34[_0xec5e('0x4a')]=qs['sort'](_0xf5b695['query'][_0xec5e('0x4b')]);_0x40cd34['where']=qs[_0xec5e('0x43')](_[_0xec5e('0x4d')](_0xf5b695[_0xec5e('0x42')],_0x381fac[_0xec5e('0x43')]));if(_0xf5b695[_0xec5e('0x42')][_0xec5e('0x4e')]){_0x40cd34[_0xec5e('0x4c')]=_['merge'](_0x40cd34[_0xec5e('0x4c')],{'$or':_[_0xec5e('0x3c')](_0x40cd34[_0xec5e('0x45')],function(_0x24cdb5){var _0x147d6d={};_0x147d6d[_0x24cdb5]={'$like':'%'+_0xf5b695[_0xec5e('0x42')][_0xec5e('0x4e')]+'%'};return _0x147d6d;})});}_0x40cd34=_['merge']({},_0x40cd34,_0xf5b695['options']);return _0x27bacd[_0xec5e('0x5c')](_0x40cd34);}})[_0xec5e('0x38')](function(_0x5d091e){if(_0x5d091e){_0xbd6d46=_0x5d091e[_0xec5e('0x47')];if(!_0xf5b695[_0xec5e('0x42')]['hasOwnProperty'](_0xec5e('0x49'))){_0x40cd34['limit']=qs['limit'](_0xf5b695['query'][_0xec5e('0x31')]);_0x40cd34['offset']=qs[_0xec5e('0x30')](_0xf5b695[_0xec5e('0x42')][_0xec5e('0x30')]);}return _0x27bacd[_0xec5e('0x5c')](_0x40cd34);}})[_0xec5e('0x38')](function(_0xf7a8b9){if(_0xf7a8b9){return _0xf7a8b9?{'count':_0xbd6d46,'rows':_0xf7a8b9}:null;}})[_0xec5e('0x38')](respondWithResult(_0x530faf,null))['catch'](handleError(_0x530faf,null));};exports[_0xec5e('0x5d')]=function(_0x3eefd3,_0x572aa4,_0x5e8faa){var _0x482f5d={};var _0x4ca448={};var _0x5ab46c;var _0x306ad9;return db[_0xec5e('0x3d')]['findOne']({'where':{'id':_0x3eefd3[_0xec5e('0x5b')]['id']}})[_0xec5e('0x38')](handleEntityNotFound(_0x572aa4,null))[_0xec5e('0x38')](function(_0x4e95b3){if(_0x4e95b3){_0x5ab46c=_0x4e95b3;_0x4ca448[_0xec5e('0x41')]=_[_0xec5e('0x55')](db[_0xec5e('0x5e')][_0xec5e('0x56')]);_0x4ca448[_0xec5e('0x42')]=_['keys'](_0x3eefd3['query']);_0x4ca448['filters']=_['intersection'](_0x4ca448[_0xec5e('0x41')],_0x4ca448[_0xec5e('0x42')]);_0x482f5d[_0xec5e('0x45')]=_[_0xec5e('0x44')](_0x4ca448['model'],qs[_0xec5e('0x46')](_0x3eefd3[_0xec5e('0x42')]['fields']));_0x482f5d['attributes']=_0x482f5d[_0xec5e('0x45')][_0xec5e('0x47')]?_0x482f5d[_0xec5e('0x45')]:_0x4ca448[_0xec5e('0x41')];_0x482f5d[_0xec5e('0x4a')]=qs['sort'](_0x3eefd3['query'][_0xec5e('0x4b')]);_0x482f5d[_0xec5e('0x4c')]=qs[_0xec5e('0x43')](_['pick'](_0x3eefd3[_0xec5e('0x42')],_0x4ca448[_0xec5e('0x43')]));if(_0x3eefd3[_0xec5e('0x42')][_0xec5e('0x4e')]){_0x482f5d[_0xec5e('0x4c')]=_['merge'](_0x482f5d[_0xec5e('0x4c')],{'$or':_[_0xec5e('0x3c')](_0x482f5d[_0xec5e('0x45')],function(_0x410ef6){var _0x1687a1={};_0x1687a1[_0x410ef6]={'$like':'%'+_0x3eefd3[_0xec5e('0x42')][_0xec5e('0x4e')]+'%'};return _0x1687a1;})});}_0x482f5d=_[_0xec5e('0x4f')]({},_0x482f5d,_0x3eefd3[_0xec5e('0x51')]);return _0x5ab46c[_0xec5e('0x5d')](_0x482f5d);}})[_0xec5e('0x38')](function(_0x5e4d79){if(_0x5e4d79){_0x306ad9=_0x5e4d79[_0xec5e('0x47')];if(!_0x3eefd3['query'][_0xec5e('0x48')]('nolimit')){_0x482f5d[_0xec5e('0x31')]=qs[_0xec5e('0x31')](_0x3eefd3[_0xec5e('0x42')][_0xec5e('0x31')]);_0x482f5d['offset']=qs[_0xec5e('0x30')](_0x3eefd3[_0xec5e('0x42')][_0xec5e('0x30')]);}return _0x5ab46c[_0xec5e('0x5d')](_0x482f5d);}})[_0xec5e('0x38')](function(_0x3c7e54){if(_0x3c7e54){return _0x3c7e54?{'count':_0x306ad9,'rows':_0x3c7e54}:null;}})[_0xec5e('0x38')](respondWithResult(_0x572aa4,null))[_0xec5e('0x2a')](handleError(_0x572aa4,null));};exports['getDescriptions']=function(_0x457e31,_0x148f5b,_0x56596d){var _0x25c464={};var _0x170fc2={};var _0x3566cc;var _0x287f16;return db[_0xec5e('0x3d')][_0xec5e('0x5f')]({'where':{'id':_0x457e31['params']['id']}})[_0xec5e('0x38')](handleEntityNotFound(_0x148f5b,null))[_0xec5e('0x38')](function(_0x15def6){if(_0x15def6){_0x3566cc=_0x15def6;_0x170fc2[_0xec5e('0x41')]=_['keys'](db['SugarcrmField'][_0xec5e('0x56')]);_0x170fc2['query']=_['keys'](_0x457e31[_0xec5e('0x42')]);_0x170fc2[_0xec5e('0x43')]=_[_0xec5e('0x44')](_0x170fc2['model'],_0x170fc2[_0xec5e('0x42')]);_0x25c464[_0xec5e('0x45')]=_['intersection'](_0x170fc2[_0xec5e('0x41')],qs[_0xec5e('0x46')](_0x457e31['query'][_0xec5e('0x46')]));_0x25c464[_0xec5e('0x45')]=_0x25c464[_0xec5e('0x45')]['length']?_0x25c464[_0xec5e('0x45')]:_0x170fc2[_0xec5e('0x41')];_0x25c464[_0xec5e('0x4a')]=qs[_0xec5e('0x4b')](_0x457e31[_0xec5e('0x42')][_0xec5e('0x4b')]);_0x25c464[_0xec5e('0x4c')]=qs[_0xec5e('0x43')](_[_0xec5e('0x4d')](_0x457e31[_0xec5e('0x42')],_0x170fc2['filters']));if(_0x457e31[_0xec5e('0x42')][_0xec5e('0x4e')]){_0x25c464[_0xec5e('0x4c')]=_[_0xec5e('0x4f')](_0x25c464['where'],{'$or':_['map'](_0x25c464[_0xec5e('0x45')],function(_0x5ba937){var _0x213ea5={};_0x213ea5[_0x5ba937]={'$like':'%'+_0x457e31[_0xec5e('0x42')]['filter']+'%'};return _0x213ea5;})});}_0x25c464=_['merge']({},_0x25c464,_0x457e31[_0xec5e('0x51')]);return _0x3566cc[_0xec5e('0x60')](_0x25c464);}})['then'](function(_0xe2224e){if(_0xe2224e){_0x287f16=_0xe2224e[_0xec5e('0x47')];if(!_0x457e31[_0xec5e('0x42')][_0xec5e('0x48')](_0xec5e('0x49'))){_0x25c464[_0xec5e('0x31')]=qs['limit'](_0x457e31[_0xec5e('0x42')][_0xec5e('0x31')]);_0x25c464['offset']=qs[_0xec5e('0x30')](_0x457e31[_0xec5e('0x42')][_0xec5e('0x30')]);}return _0x3566cc[_0xec5e('0x60')](_0x25c464);}})[_0xec5e('0x38')](function(_0x56fe25){if(_0x56fe25){return _0x56fe25?{'count':_0x287f16,'rows':_0x56fe25}:null;}})[_0xec5e('0x38')](respondWithResult(_0x148f5b,null))['catch'](handleError(_0x148f5b,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 0f4cb8b..6710a9b 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 _0xb046=['request-promise','path','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','int_sugarcrm_configurations','lodash','../../config/logger','moment'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xb046,0x99));var _0x6b04=function(_0x576e2b,_0x328953){_0x576e2b=_0x576e2b-0x0;var _0x46461a=_0xb046[_0x576e2b];return _0x46461a;};'use strict';var _=require(_0x6b04('0x0'));var util=require('util');var logger=require(_0x6b04('0x1'))('api');var moment=require(_0x6b04('0x2'));var BPromise=require('bluebird');var rp=require(_0x6b04('0x3'));var fs=require('fs');var path=require(_0x6b04('0x4'));var rimraf=require(_0x6b04('0x5'));var config=require(_0x6b04('0x6'));var attributes=require(_0x6b04('0x7'));module[_0x6b04('0x8')]=function(_0x335461,_0x5db509){return _0x335461[_0x6b04('0x9')](_0x6b04('0xa'),attributes,{'tableName':_0x6b04('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcda4=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x2b6600,_0x24c497){var _0x912ee2=function(_0x5d6484){while(--_0x5d6484){_0x2b6600['push'](_0x2b6600['shift']());}};_0x912ee2(++_0x24c497);}(_0xcda4,0x162));var _0x4cda=function(_0x1f32c2,_0x2add3c){_0x1f32c2=_0x1f32c2-0x0;var _0x47e9ea=_0xcda4[_0x1f32c2];return _0x47e9ea;};'use strict';var _=require('lodash');var util=require(_0x4cda('0x0'));var logger=require(_0x4cda('0x1'))(_0x4cda('0x2'));var moment=require('moment');var BPromise=require(_0x4cda('0x3'));var rp=require(_0x4cda('0x4'));var fs=require('fs');var path=require(_0x4cda('0x5'));var rimraf=require(_0x4cda('0x6'));var config=require(_0x4cda('0x7'));var attributes=require(_0x4cda('0x8'));module[_0x4cda('0x9')]=function(_0x33668e,_0x535d28){return _0x33668e[_0x4cda('0xa')](_0x4cda('0xb'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.rpc.js index 94775d5..762570d 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 _0x7282=['info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x345de7,_0x1de531){var _0x26ffc7=function(_0x5b8539){while(--_0x5b8539){_0x345de7['push'](_0x345de7['shift']());}};_0x26ffc7(++_0x1de531);}(_0x7282,0x17f));var _0x2728=function(_0x58f8d6,_0x3de6e9){_0x58f8d6=_0x58f8d6-0x0;var _0x249399=_0x7282[_0x58f8d6];return _0x249399;};'use strict';var _=require(_0x2728('0x0'));var util=require(_0x2728('0x1'));var moment=require('moment');var BPromise=require(_0x2728('0x2'));var rs=require(_0x2728('0x3'));var fs=require('fs');var Redis=require(_0x2728('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2728('0x5'));var logger=require(_0x2728('0x6'))(_0x2728('0x7'));var config=require(_0x2728('0x8'));var jayson=require(_0x2728('0x9'));var client=jayson['client'][_0x2728('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xab4aca,_0x30b446,_0x4d6101){return new BPromise(function(_0x28dbcf,_0x452210){return client[_0x2728('0xb')](_0xab4aca,_0x4d6101)[_0x2728('0xc')](function(_0x53fd0b){logger[_0x2728('0xd')](_0x2728('0xe'),_0x30b446,'request\x20sent');logger[_0x2728('0xf')](_0x2728('0x10'),_0x30b446,_0x2728('0x11'),JSON[_0x2728('0x12')](_0x53fd0b));if(_0x53fd0b[_0x2728('0x13')]){if(_0x53fd0b[_0x2728('0x13')]['code']===0x1f4){logger[_0x2728('0x13')](_0x2728('0xe'),_0x30b446,_0x53fd0b[_0x2728('0x13')][_0x2728('0x14')]);return _0x452210(_0x53fd0b['error'][_0x2728('0x14')]);}logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x30b446,_0x53fd0b[_0x2728('0x13')][_0x2728('0x14')]);return _0x28dbcf(_0x53fd0b[_0x2728('0x13')][_0x2728('0x14')]);}else{logger[_0x2728('0xd')](_0x2728('0xe'),_0x30b446,_0x2728('0x11'));_0x28dbcf(_0x53fd0b['result'][_0x2728('0x14')]);}})[_0x2728('0x15')](function(_0x2794ae){logger[_0x2728('0x13')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x30b446,_0x2794ae);_0x452210(_0x2794ae);});});} \ No newline at end of file +var _0xa186=['randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment'];(function(_0x40e765,_0x32e76){var _0x441026=function(_0x181196){while(--_0x181196){_0x40e765['push'](_0x40e765['shift']());}};_0x441026(++_0x32e76);}(_0xa186,0x18a));var _0x6a18=function(_0x590cba,_0x3f5060){_0x590cba=_0x590cba-0x0;var _0xf5d14f=_0xa186[_0x590cba];return _0xf5d14f;};'use strict';var _=require('lodash');var util=require(_0x6a18('0x0'));var moment=require(_0x6a18('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a18('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6a18('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a18('0x4'))('rpc');var config=require(_0x6a18('0x5'));var jayson=require(_0x6a18('0x6'));var client=jayson[_0x6a18('0x7')][_0x6a18('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5d43d0,_0x53c75a,_0x445693){return new BPromise(function(_0x24e567,_0x9e0c0){return client[_0x6a18('0x9')](_0x5d43d0,_0x445693)[_0x6a18('0xa')](function(_0xcce529){logger[_0x6a18('0xb')](_0x6a18('0xc'),_0x53c75a,'request\x20sent');logger[_0x6a18('0xd')](_0x6a18('0xe'),_0x53c75a,_0x6a18('0xf'),JSON[_0x6a18('0x10')](_0xcce529));if(_0xcce529[_0x6a18('0x11')]){if(_0xcce529['error'][_0x6a18('0x12')]===0x1f4){logger[_0x6a18('0x11')](_0x6a18('0xc'),_0x53c75a,_0xcce529[_0x6a18('0x11')][_0x6a18('0x13')]);return _0x9e0c0(_0xcce529['error']['message']);}logger[_0x6a18('0x11')](_0x6a18('0xc'),_0x53c75a,_0xcce529[_0x6a18('0x11')]['message']);return _0x24e567(_0xcce529[_0x6a18('0x11')]['message']);}else{logger[_0x6a18('0xb')](_0x6a18('0xc'),_0x53c75a,'request\x20sent');_0x24e567(_0xcce529[_0x6a18('0x14')][_0x6a18('0x13')]);}})[_0x6a18('0x15')](function(_0x4360c2){logger[_0x6a18('0x11')](_0x6a18('0xc'),_0x53c75a,_0x4360c2);_0x9e0c0(_0x4360c2);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index 636ff73..6798a02 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 _0x88eb=['../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','/:id','show','post','create','put','update','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x33554b,_0x48162b){var _0x256954=function(_0x185f66){while(--_0x185f66){_0x33554b['push'](_0x33554b['shift']());}};_0x256954(++_0x48162b);}(_0x88eb,0x1ba));var _0xb88e=function(_0x490b79,_0x5e0794){_0x490b79=_0x490b79-0x0;var _0x3644a6=_0x88eb[_0x490b79];return _0x3644a6;};'use strict';var multer=require('multer');var util=require(_0xb88e('0x0'));var path=require('path');var timeout=require(_0xb88e('0x1'));var express=require(_0xb88e('0x2'));var router=express[_0xb88e('0x3')]();var auth=require(_0xb88e('0x4'));var interaction=require(_0xb88e('0x5'));var config=require(_0xb88e('0x6'));var controller=require(_0xb88e('0x7'));router[_0xb88e('0x8')]('/',auth[_0xb88e('0x9')](),controller['index']);router[_0xb88e('0x8')](_0xb88e('0xa'),auth[_0xb88e('0x9')](),controller[_0xb88e('0xb')]);router[_0xb88e('0xc')]('/',auth[_0xb88e('0x9')](),controller[_0xb88e('0xd')]);router[_0xb88e('0xe')](_0xb88e('0xa'),auth['isAuthenticated'](),controller[_0xb88e('0xf')]);router['delete'](_0xb88e('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x8b4d=['express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','util','connect-timeout'];(function(_0x2b9e33,_0x266ac7){var _0x3062a6=function(_0x452db6){while(--_0x452db6){_0x2b9e33['push'](_0x2b9e33['shift']());}};_0x3062a6(++_0x266ac7);}(_0x8b4d,0x6a));var _0xd8b4=function(_0x450689,_0x3b857c){_0x450689=_0x450689-0x0;var _0x46ffb0=_0x8b4d[_0x450689];return _0x46ffb0;};'use strict';var multer=require('multer');var util=require(_0xd8b4('0x0'));var path=require('path');var timeout=require(_0xd8b4('0x1'));var express=require(_0xd8b4('0x2'));var router=express[_0xd8b4('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd8b4('0x4'));var config=require(_0xd8b4('0x5'));var controller=require(_0xd8b4('0x6'));router[_0xd8b4('0x7')]('/',auth['isAuthenticated'](),controller[_0xd8b4('0x8')]);router[_0xd8b4('0x7')](_0xd8b4('0x9'),auth[_0xd8b4('0xa')](),controller[_0xd8b4('0xb')]);router[_0xd8b4('0xc')]('/',auth[_0xd8b4('0xa')](),controller[_0xd8b4('0xd')]);router[_0xd8b4('0xe')](_0xd8b4('0x9'),auth[_0xd8b4('0xa')](),controller[_0xd8b4('0xf')]);router['delete'](_0xd8b4('0x9'),auth[_0xd8b4('0xa')](),controller[_0xd8b4('0x10')]);module[_0xd8b4('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 5cf0be1..6030f27 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 _0xa9bb=['customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xa9bb,0x1bc));var _0xba9b=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0xa9bb[_0x8c43de];return _0xa6591b;};'use strict';var Sequelize=require('sequelize');module[_0xba9b('0x0')]={'type':{'type':Sequelize[_0xba9b('0x1')](_0xba9b('0x2'),_0xba9b('0x3'),_0xba9b('0x4'),_0xba9b('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xba9b('0x6')]},'key':{'type':Sequelize[_0xba9b('0x6')]},'keyType':{'type':Sequelize[_0xba9b('0x1')](_0xba9b('0x2'),_0xba9b('0x3'),_0xba9b('0x4'))},'keyContent':{'type':Sequelize[_0xba9b('0x6')]},'idField':{'type':Sequelize[_0xba9b('0x6')]},'nameField':{'type':Sequelize[_0xba9b('0x6')]},'customField':{'type':Sequelize[_0xba9b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba9b('0x6')]}}; \ No newline at end of file +var _0x54a1=['variable','sequelize','ENUM','string','STRING'];(function(_0x361a95,_0x48aa27){var _0x4c251e=function(_0x3090e4){while(--_0x3090e4){_0x361a95['push'](_0x361a95['shift']());}};_0x4c251e(++_0x48aa27);}(_0x54a1,0xf1));var _0x154a=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0x54a1[_0x1beef3];return _0x5af964;};'use strict';var Sequelize=require(_0x154a('0x0'));module['exports']={'type':{'type':Sequelize[_0x154a('0x1')](_0x154a('0x2'),'variable','customVariable','keyValue'),'defaultValue':_0x154a('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x154a('0x3')]},'keyType':{'type':Sequelize['ENUM'](_0x154a('0x2'),_0x154a('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0x154a('0x3')]},'idField':{'type':Sequelize[_0x154a('0x3')]},'nameField':{'type':Sequelize[_0x154a('0x3')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x154a('0x3')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index c864210..923bf49 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 _0xc1af=['intersection','fields','hasOwnProperty','limit','order','sort','filters','pick','filter','where','type','VIRTUAL','options','count','include','SugarcrmField','findAll','rows','catch','show','includeAll','merge','find','create','body','update','params','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','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end','json','offset','status','Content-Range','apply','reject','save','destroy','then','error','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','attributes'];(function(_0x5c4e16,_0x113035){var _0x36044a=function(_0xde2f25){while(--_0xde2f25){_0x5c4e16['push'](_0x5c4e16['shift']());}};_0x36044a(++_0x113035);}(_0xc1af,0xb3));var _0xfc1a=function(_0x13d0fa,_0x1d3248){_0x13d0fa=_0x13d0fa-0x0;var _0x56cdba=_0xc1af[_0x13d0fa];return _0x56cdba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfc1a('0x0'));var rimraf=require(_0xfc1a('0x1'));var zipdir=require(_0xfc1a('0x2'));var jsonpatch=require(_0xfc1a('0x3'));var rp=require(_0xfc1a('0x4'));var moment=require(_0xfc1a('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfc1a('0x6'));var util=require(_0xfc1a('0x7'));var path=require(_0xfc1a('0x8'));var sox=require(_0xfc1a('0x9'));var csv=require(_0xfc1a('0xa'));var ejs=require(_0xfc1a('0xb'));var fs=require('fs');var _=require(_0xfc1a('0xc'));var squel=require(_0xfc1a('0xd'));var crypto=require(_0xfc1a('0xe'));var jsforce=require(_0xfc1a('0xf'));var deskjs=require(_0xfc1a('0x10'));var toCsv=require(_0xfc1a('0xa'));var querystring=require(_0xfc1a('0x11'));var Papa=require(_0xfc1a('0x12'));var Redis=require(_0xfc1a('0x13'));var authService=require(_0xfc1a('0x14'));var qs=require(_0xfc1a('0x15'));var as=require(_0xfc1a('0x16'));var hardwareService=require(_0xfc1a('0x17'));var logger=require(_0xfc1a('0x18'))('api');var utils=require(_0xfc1a('0x19'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5173af,_0x2d98){_0x2d98=_0x2d98||0xcc;return function(_0x24890e){if(_0x24890e){return _0x5173af[_0xfc1a('0x1a')](_0x2d98);}return _0x5173af['status'](_0x2d98)[_0xfc1a('0x1b')]();};}function respondWithResult(_0x29d65d,_0x9ca110){_0x9ca110=_0x9ca110||0xc8;return function(_0xb1e6f8){if(_0xb1e6f8){return _0x29d65d['status'](_0x9ca110)[_0xfc1a('0x1c')](_0xb1e6f8);}};}function respondWithFilteredResult(_0x4f7f66,_0x3e4b3b){return function(_0x2cfa5b){if(_0x2cfa5b){var _0x2674b5=_0x2cfa5b['count'],_0x27c85b=_0x3e4b3b[_0xfc1a('0x1d')],_0x1bf838=_0x3e4b3b[_0xfc1a('0x1d')]+_0x3e4b3b['limit'],_0x557952;if(_0x1bf838>=_0x2674b5){_0x1bf838=_0x2674b5;_0x557952=0xc8;}else{_0x557952=0xce;}_0x4f7f66[_0xfc1a('0x1e')](_0x557952);return _0x4f7f66['set'](_0xfc1a('0x1f'),_0x27c85b+'-'+_0x1bf838+'/'+_0x2674b5)[_0xfc1a('0x1c')](_0x2cfa5b);}return null;};}function patchUpdates(_0x5bc5bb){return function(_0x426066){try{jsonpatch[_0xfc1a('0x20')](_0x426066,_0x5bc5bb,!![]);}catch(_0x31fafe){return BPromise[_0xfc1a('0x21')](_0x31fafe);}return _0x426066[_0xfc1a('0x22')]();};}function saveUpdates(_0x5ab4a1,_0x5b3900){return function(_0x29ef65){if(_0x29ef65){return _0x29ef65['update'](_0x5ab4a1)['then'](function(_0x1f3052){return _0x1f3052;});}return null;};}function removeEntity(_0x184416,_0x36ef1c){return function(_0x2fd053){if(_0x2fd053){return _0x2fd053[_0xfc1a('0x23')]()[_0xfc1a('0x24')](function(){_0x184416[_0xfc1a('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x279058,_0x12ac70){return function(_0xcec083){if(!_0xcec083){_0x279058[_0xfc1a('0x1a')](0x194);}return _0xcec083;};}function handleError(_0xbf7a87,_0x3bc362){_0x3bc362=_0x3bc362||0x1f4;return function(_0x50cead){logger[_0xfc1a('0x25')](_0x50cead['stack']);if(_0x50cead[_0xfc1a('0x26')]){delete _0x50cead[_0xfc1a('0x26')];}_0xbf7a87[_0xfc1a('0x1e')](_0x3bc362)[_0xfc1a('0x27')](_0x50cead);};}exports[_0xfc1a('0x28')]=function(_0x34eef4,_0x467409){var _0x45a181={},_0x50fc7d={},_0x1de0e0={'count':0x0,'rows':[]};var _0x45ff73=_[_0xfc1a('0x29')](db['SugarcrmField'][_0xfc1a('0x2a')],function(_0x51bbda){return{'name':_0x51bbda[_0xfc1a('0x2b')],'type':_0x51bbda['type'][_0xfc1a('0x2c')]};});_0x50fc7d[_0xfc1a('0x2d')]=_['map'](_0x45ff73,'name');_0x50fc7d[_0xfc1a('0x2e')]=_[_0xfc1a('0x2f')](_0x34eef4[_0xfc1a('0x2e')]);_0x50fc7d['filters']=_['intersection'](_0x50fc7d[_0xfc1a('0x2d')],_0x50fc7d[_0xfc1a('0x2e')]);_0x45a181[_0xfc1a('0x30')]=_[_0xfc1a('0x31')](_0x50fc7d[_0xfc1a('0x2d')],qs[_0xfc1a('0x32')](_0x34eef4['query'][_0xfc1a('0x32')]));_0x45a181[_0xfc1a('0x30')]=_0x45a181[_0xfc1a('0x30')]['length']?_0x45a181[_0xfc1a('0x30')]:_0x50fc7d[_0xfc1a('0x2d')];if(!_0x34eef4[_0xfc1a('0x2e')][_0xfc1a('0x33')]('nolimit')){_0x45a181[_0xfc1a('0x34')]=qs[_0xfc1a('0x34')](_0x34eef4['query']['limit']);_0x45a181['offset']=qs[_0xfc1a('0x1d')](_0x34eef4[_0xfc1a('0x2e')][_0xfc1a('0x1d')]);}_0x45a181[_0xfc1a('0x35')]=qs[_0xfc1a('0x36')](_0x34eef4[_0xfc1a('0x2e')][_0xfc1a('0x36')]);_0x45a181['where']=qs[_0xfc1a('0x37')](_[_0xfc1a('0x38')](_0x34eef4[_0xfc1a('0x2e')],_0x50fc7d['filters']));if(_0x34eef4[_0xfc1a('0x2e')][_0xfc1a('0x39')]){_0x45a181[_0xfc1a('0x3a')]=_['merge'](_0x45a181[_0xfc1a('0x3a')],{'$or':_[_0xfc1a('0x29')](_0x45ff73,function(_0x57c400){if(_0x57c400[_0xfc1a('0x3b')]!==_0xfc1a('0x3c')){var _0x1cef3a={};_0x1cef3a[_0x57c400[_0xfc1a('0x26')]]={'$like':'%'+_0x34eef4['query']['filter']+'%'};return _0x1cef3a;}})});}_0x45a181=_['merge']({},_0x45a181,_0x34eef4[_0xfc1a('0x3d')]);var _0xa8e691={'where':_0x45a181[_0xfc1a('0x3a')]};return db['SugarcrmField'][_0xfc1a('0x3e')](_0xa8e691)[_0xfc1a('0x24')](function(_0x40fb35){_0x1de0e0[_0xfc1a('0x3e')]=_0x40fb35;if(_0x34eef4[_0xfc1a('0x2e')]['includeAll']){_0x45a181[_0xfc1a('0x3f')]=[{'all':!![]}];}return db[_0xfc1a('0x40')][_0xfc1a('0x41')](_0x45a181);})[_0xfc1a('0x24')](function(_0x3acc66){_0x1de0e0[_0xfc1a('0x42')]=_0x3acc66;return _0x1de0e0;})[_0xfc1a('0x24')](respondWithFilteredResult(_0x467409,_0x45a181))[_0xfc1a('0x43')](handleError(_0x467409,null));};exports[_0xfc1a('0x44')]=function(_0x1ebd97,_0x2a1547){var _0x562075={'raw':!![],'where':{'id':_0x1ebd97['params']['id']}},_0x5c95c2={};_0x5c95c2['model']=_[_0xfc1a('0x2f')](db['SugarcrmField'][_0xfc1a('0x2a')]);_0x5c95c2[_0xfc1a('0x2e')]=_[_0xfc1a('0x2f')](_0x1ebd97['query']);_0x5c95c2['filters']=_[_0xfc1a('0x31')](_0x5c95c2[_0xfc1a('0x2d')],_0x5c95c2[_0xfc1a('0x2e')]);_0x562075['attributes']=_[_0xfc1a('0x31')](_0x5c95c2[_0xfc1a('0x2d')],qs[_0xfc1a('0x32')](_0x1ebd97[_0xfc1a('0x2e')][_0xfc1a('0x32')]));_0x562075[_0xfc1a('0x30')]=_0x562075[_0xfc1a('0x30')]['length']?_0x562075[_0xfc1a('0x30')]:_0x5c95c2[_0xfc1a('0x2d')];if(_0x1ebd97[_0xfc1a('0x2e')][_0xfc1a('0x45')]){_0x562075[_0xfc1a('0x3f')]=[{'all':!![]}];}_0x562075=_[_0xfc1a('0x46')]({},_0x562075,_0x1ebd97[_0xfc1a('0x3d')]);return db[_0xfc1a('0x40')][_0xfc1a('0x47')](_0x562075)[_0xfc1a('0x24')](handleEntityNotFound(_0x2a1547,null))[_0xfc1a('0x24')](respondWithResult(_0x2a1547,null))['catch'](handleError(_0x2a1547,null));};exports[_0xfc1a('0x48')]=function(_0x2709b6,_0x12fd35){return db[_0xfc1a('0x40')][_0xfc1a('0x48')](_0x2709b6[_0xfc1a('0x49')],{})[_0xfc1a('0x24')](respondWithResult(_0x12fd35,0xc9))[_0xfc1a('0x43')](handleError(_0x12fd35,null));};exports[_0xfc1a('0x4a')]=function(_0x1b435e,_0x105e74){if(_0x1b435e[_0xfc1a('0x49')]['id']){delete _0x1b435e[_0xfc1a('0x49')]['id'];}return db[_0xfc1a('0x40')][_0xfc1a('0x47')]({'where':{'id':_0x1b435e[_0xfc1a('0x4b')]['id']}})[_0xfc1a('0x24')](handleEntityNotFound(_0x105e74,null))[_0xfc1a('0x24')](saveUpdates(_0x1b435e[_0xfc1a('0x49')],null))[_0xfc1a('0x24')](respondWithResult(_0x105e74,null))[_0xfc1a('0x43')](handleError(_0x105e74,null));};exports['destroy']=function(_0x4a16b0,_0x25aa1a){return db[_0xfc1a('0x40')][_0xfc1a('0x47')]({'where':{'id':_0x4a16b0[_0xfc1a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x25aa1a,null))[_0xfc1a('0x24')](removeEntity(_0x25aa1a,null))[_0xfc1a('0x43')](handleError(_0x25aa1a,null));}; \ No newline at end of file +var _0x31c4=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','name','index','map','SugarcrmField','rawAttributes','fieldName','key','model','keys','filters','intersection','query','fields','attributes','length','sort','where','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0x3c5c3c,_0x13b428){var _0x2a4714=function(_0x5d5ca3){while(--_0x5d5ca3){_0x3c5c3c['push'](_0x3c5c3c['shift']());}};_0x2a4714(++_0x13b428);}(_0x31c4,0xba));var _0x431c=function(_0x3ea24b,_0x16be28){_0x3ea24b=_0x3ea24b-0x0;var _0x37ff5c=_0x31c4[_0x3ea24b];return _0x37ff5c;};'use strict';var pdf=require(_0x431c('0x0'));var emlformat=require(_0x431c('0x1'));var rimraf=require(_0x431c('0x2'));var zipdir=require(_0x431c('0x3'));var jsonpatch=require(_0x431c('0x4'));var rp=require(_0x431c('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x431c('0x6'));var util=require(_0x431c('0x7'));var path=require(_0x431c('0x8'));var sox=require(_0x431c('0x9'));var csv=require('to-csv');var ejs=require(_0x431c('0xa'));var fs=require('fs');var _=require(_0x431c('0xb'));var squel=require(_0x431c('0xc'));var crypto=require(_0x431c('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x431c('0xe'));var toCsv=require(_0x431c('0xf'));var querystring=require('querystring');var Papa=require(_0x431c('0x10'));var Redis=require(_0x431c('0x11'));var authService=require(_0x431c('0x12'));var qs=require(_0x431c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x431c('0x14'));var logger=require(_0x431c('0x15'))(_0x431c('0x16'));var utils=require(_0x431c('0x17'));var config=require(_0x431c('0x18'));var db=require(_0x431c('0x19'))['db'];function respondWithStatusCode(_0x4c33cd,_0x677b93){_0x677b93=_0x677b93||0xcc;return function(_0x23e838){if(_0x23e838){return _0x4c33cd[_0x431c('0x1a')](_0x677b93);}return _0x4c33cd[_0x431c('0x1b')](_0x677b93)[_0x431c('0x1c')]();};}function respondWithResult(_0x36c7a7,_0xeef796){_0xeef796=_0xeef796||0xc8;return function(_0x5c29df){if(_0x5c29df){return _0x36c7a7[_0x431c('0x1b')](_0xeef796)[_0x431c('0x1d')](_0x5c29df);}};}function respondWithFilteredResult(_0x205741,_0x1a963d){return function(_0x4fed25){if(_0x4fed25){var _0x2f5b19=_0x4fed25[_0x431c('0x1e')],_0x1595cc=_0x1a963d[_0x431c('0x1f')],_0x3515d3=_0x1a963d[_0x431c('0x1f')]+_0x1a963d[_0x431c('0x20')],_0x7e1cf;if(_0x3515d3>=_0x2f5b19){_0x3515d3=_0x2f5b19;_0x7e1cf=0xc8;}else{_0x7e1cf=0xce;}_0x205741[_0x431c('0x1b')](_0x7e1cf);return _0x205741[_0x431c('0x21')](_0x431c('0x22'),_0x1595cc+'-'+_0x3515d3+'/'+_0x2f5b19)['json'](_0x4fed25);}return null;};}function patchUpdates(_0x3e2431){return function(_0x287933){try{jsonpatch[_0x431c('0x23')](_0x287933,_0x3e2431,!![]);}catch(_0x3769a2){return BPromise[_0x431c('0x24')](_0x3769a2);}return _0x287933[_0x431c('0x25')]();};}function saveUpdates(_0x5c9ccf,_0x33941a){return function(_0x4fe2a3){if(_0x4fe2a3){return _0x4fe2a3[_0x431c('0x26')](_0x5c9ccf)[_0x431c('0x27')](function(_0x1f5c9a){return _0x1f5c9a;});}return null;};}function removeEntity(_0xa14e4d,_0x1d1134){return function(_0x1feef3){if(_0x1feef3){return _0x1feef3[_0x431c('0x28')]()[_0x431c('0x27')](function(){_0xa14e4d[_0x431c('0x1b')](0xcc)[_0x431c('0x1c')]();});}};}function handleEntityNotFound(_0x2f81ad,_0x1588ad){return function(_0x27b1c9){if(!_0x27b1c9){_0x2f81ad[_0x431c('0x1a')](0x194);}return _0x27b1c9;};}function handleError(_0x53fc92,_0x3c5dd4){_0x3c5dd4=_0x3c5dd4||0x1f4;return function(_0x10ca5e){logger['error'](_0x10ca5e['stack']);if(_0x10ca5e['name']){delete _0x10ca5e[_0x431c('0x29')];}_0x53fc92[_0x431c('0x1b')](_0x3c5dd4)['send'](_0x10ca5e);};}exports[_0x431c('0x2a')]=function(_0x52e087,_0x2b3dc9){var _0x4dd008={},_0x3f2f8c={},_0x3d2be3={'count':0x0,'rows':[]};var _0x52fe16=_[_0x431c('0x2b')](db[_0x431c('0x2c')][_0x431c('0x2d')],function(_0x3dfc22){return{'name':_0x3dfc22[_0x431c('0x2e')],'type':_0x3dfc22['type'][_0x431c('0x2f')]};});_0x3f2f8c[_0x431c('0x30')]=_['map'](_0x52fe16,'name');_0x3f2f8c['query']=_[_0x431c('0x31')](_0x52e087['query']);_0x3f2f8c[_0x431c('0x32')]=_[_0x431c('0x33')](_0x3f2f8c['model'],_0x3f2f8c[_0x431c('0x34')]);_0x4dd008['attributes']=_[_0x431c('0x33')](_0x3f2f8c[_0x431c('0x30')],qs[_0x431c('0x35')](_0x52e087[_0x431c('0x34')][_0x431c('0x35')]));_0x4dd008[_0x431c('0x36')]=_0x4dd008['attributes'][_0x431c('0x37')]?_0x4dd008[_0x431c('0x36')]:_0x3f2f8c[_0x431c('0x30')];if(!_0x52e087['query']['hasOwnProperty']('nolimit')){_0x4dd008['limit']=qs[_0x431c('0x20')](_0x52e087['query'][_0x431c('0x20')]);_0x4dd008[_0x431c('0x1f')]=qs['offset'](_0x52e087[_0x431c('0x34')][_0x431c('0x1f')]);}_0x4dd008['order']=qs[_0x431c('0x38')](_0x52e087[_0x431c('0x34')][_0x431c('0x38')]);_0x4dd008[_0x431c('0x39')]=qs[_0x431c('0x32')](_['pick'](_0x52e087[_0x431c('0x34')],_0x3f2f8c['filters']));if(_0x52e087['query']['filter']){_0x4dd008['where']=_[_0x431c('0x3a')](_0x4dd008[_0x431c('0x39')],{'$or':_[_0x431c('0x2b')](_0x52fe16,function(_0x5618fa){if(_0x5618fa[_0x431c('0x3b')]!==_0x431c('0x3c')){var _0x63a75d={};_0x63a75d[_0x5618fa[_0x431c('0x29')]]={'$like':'%'+_0x52e087[_0x431c('0x34')]['filter']+'%'};return _0x63a75d;}})});}_0x4dd008=_[_0x431c('0x3a')]({},_0x4dd008,_0x52e087[_0x431c('0x3d')]);var _0x730cd4={'where':_0x4dd008['where']};return db[_0x431c('0x2c')][_0x431c('0x1e')](_0x730cd4)[_0x431c('0x27')](function(_0x5ebc39){_0x3d2be3[_0x431c('0x1e')]=_0x5ebc39;if(_0x52e087[_0x431c('0x34')][_0x431c('0x3e')]){_0x4dd008[_0x431c('0x3f')]=[{'all':!![]}];}return db[_0x431c('0x2c')][_0x431c('0x40')](_0x4dd008);})[_0x431c('0x27')](function(_0x9a1758){_0x3d2be3[_0x431c('0x41')]=_0x9a1758;return _0x3d2be3;})[_0x431c('0x27')](respondWithFilteredResult(_0x2b3dc9,_0x4dd008))[_0x431c('0x42')](handleError(_0x2b3dc9,null));};exports['show']=function(_0x2be894,_0x4f2682){var _0x59df74={'raw':!![],'where':{'id':_0x2be894['params']['id']}},_0x155ac0={};_0x155ac0[_0x431c('0x30')]=_[_0x431c('0x31')](db[_0x431c('0x2c')][_0x431c('0x2d')]);_0x155ac0[_0x431c('0x34')]=_['keys'](_0x2be894[_0x431c('0x34')]);_0x155ac0[_0x431c('0x32')]=_[_0x431c('0x33')](_0x155ac0[_0x431c('0x30')],_0x155ac0[_0x431c('0x34')]);_0x59df74['attributes']=_[_0x431c('0x33')](_0x155ac0[_0x431c('0x30')],qs[_0x431c('0x35')](_0x2be894[_0x431c('0x34')][_0x431c('0x35')]));_0x59df74[_0x431c('0x36')]=_0x59df74[_0x431c('0x36')][_0x431c('0x37')]?_0x59df74[_0x431c('0x36')]:_0x155ac0[_0x431c('0x30')];if(_0x2be894[_0x431c('0x34')][_0x431c('0x3e')]){_0x59df74[_0x431c('0x3f')]=[{'all':!![]}];}_0x59df74=_[_0x431c('0x3a')]({},_0x59df74,_0x2be894[_0x431c('0x3d')]);return db[_0x431c('0x2c')][_0x431c('0x43')](_0x59df74)[_0x431c('0x27')](handleEntityNotFound(_0x4f2682,null))[_0x431c('0x27')](respondWithResult(_0x4f2682,null))['catch'](handleError(_0x4f2682,null));};exports['create']=function(_0x4efc32,_0x57183e){return db[_0x431c('0x2c')][_0x431c('0x44')](_0x4efc32[_0x431c('0x45')],{})['then'](respondWithResult(_0x57183e,0xc9))[_0x431c('0x42')](handleError(_0x57183e,null));};exports[_0x431c('0x26')]=function(_0x3b84bd,_0x4da2d7){if(_0x3b84bd[_0x431c('0x45')]['id']){delete _0x3b84bd[_0x431c('0x45')]['id'];}return db['SugarcrmField'][_0x431c('0x43')]({'where':{'id':_0x3b84bd[_0x431c('0x46')]['id']}})[_0x431c('0x27')](handleEntityNotFound(_0x4da2d7,null))[_0x431c('0x27')](saveUpdates(_0x3b84bd[_0x431c('0x45')],null))[_0x431c('0x27')](respondWithResult(_0x4da2d7,null))['catch'](handleError(_0x4da2d7,null));};exports[_0x431c('0x28')]=function(_0x1931c3,_0x24f582){return db[_0x431c('0x2c')][_0x431c('0x43')]({'where':{'id':_0x1931c3['params']['id']}})[_0x431c('0x27')](handleEntityNotFound(_0x24f582,null))[_0x431c('0x27')](removeEntity(_0x24f582,null))['catch'](handleError(_0x24f582,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index b0ee664..1d3d19e 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 _0x519b=['idField','FieldId','lodash','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','int_sugarcrm_fields'];(function(_0x47568e,_0x5ccdaf){var _0x33815b=function(_0x56b026){while(--_0x56b026){_0x47568e['push'](_0x47568e['shift']());}};_0x33815b(++_0x5ccdaf);}(_0x519b,0x1b4));var _0xb519=function(_0x3d823b,_0x245c0d){_0x3d823b=_0x3d823b-0x0;var _0x1c23cd=_0x519b[_0x3d823b];return _0x1c23cd;};'use strict';var _=require(_0xb519('0x0'));var util=require(_0xb519('0x1'));var logger=require(_0xb519('0x2'))(_0xb519('0x3'));var moment=require(_0xb519('0x4'));var BPromise=require('bluebird');var rp=require(_0xb519('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xb519('0x6'));var config=require(_0xb519('0x7'));var attributes=require(_0xb519('0x8'));module[_0xb519('0x9')]=function(_0x51ab1a,_0x1c9012){return _0x51ab1a[_0xb519('0xa')]('SugarcrmField',attributes,{'tableName':_0xb519('0xb'),'paranoid':![],'indexes':[{'name':'sugarcrm_unique_index','fields':[_0xb519('0xc'),_0xb519('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc6d3=['SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intSugarcrmField.attributes','exports','define'];(function(_0x284f4e,_0x43af67){var _0x2fb57c=function(_0x5ea243){while(--_0x5ea243){_0x284f4e['push'](_0x284f4e['shift']());}};_0x2fb57c(++_0x43af67);}(_0xc6d3,0x131));var _0x3c6d=function(_0x51604e,_0x2cd7d6){_0x51604e=_0x51604e-0x0;var _0x379411=_0xc6d3[_0x51604e];return _0x379411;};'use strict';var _=require('lodash');var util=require(_0x3c6d('0x0'));var logger=require(_0x3c6d('0x1'))('api');var moment=require(_0x3c6d('0x2'));var BPromise=require(_0x3c6d('0x3'));var rp=require(_0x3c6d('0x4'));var fs=require('fs');var path=require(_0x3c6d('0x5'));var rimraf=require('rimraf');var config=require(_0x3c6d('0x6'));var attributes=require(_0x3c6d('0x7'));module[_0x3c6d('0x8')]=function(_0x3b0fb9,_0xe7619a){return _0x3b0fb9[_0x3c6d('0x9')](_0x3c6d('0xa'),attributes,{'tableName':_0x3c6d('0xb'),'paranoid':![],'indexes':[{'name':_0x3c6d('0xc'),'fields':[_0x3c6d('0xd'),_0x3c6d('0xe')],'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 b8d50e9..75811b5 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 _0x1a85=['../../config/logger','rpc','jayson/promise','http','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../config/utils'];(function(_0x13ede7,_0x413ab3){var _0x36f9eb=function(_0xc43b14){while(--_0xc43b14){_0x13ede7['push'](_0x13ede7['shift']());}};_0x36f9eb(++_0x413ab3);}(_0x1a85,0x178));var _0x51a8=function(_0x5ac4b6,_0x4d9360){_0x5ac4b6=_0x5ac4b6-0x0;var _0x29ced8=_0x1a85[_0x5ac4b6];return _0x29ced8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});} \ No newline at end of file +var _0x757a=['request','then','info','SugarcrmField,\x20%s,\x20%s','request\x20sent','debug','SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x19fb82,_0x45da17){var _0xa7a3da=function(_0x279452){while(--_0x279452){_0x19fb82['push'](_0x19fb82['shift']());}};_0xa7a3da(++_0x45da17);}(_0x757a,0xde));var _0xa757=function(_0x13ffbe,_0x41766c){_0x13ffbe=_0x13ffbe-0x0;var _0x56b040=_0x757a[_0x13ffbe];return _0x56b040;};'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']('SugarcrmField,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('SugarcrmField,\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);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 670b58d..69dbc3d 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 _0xa2ae=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','get','index','/:id/configurations','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update','/:id','exports','multer'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xa2ae,0x83));var _0xea2a=function(_0x88cd7b,_0x4c884c){_0x88cd7b=_0x88cd7b-0x0;var _0x56fcc8=_0xa2ae[_0x88cd7b];return _0x56fcc8;};'use strict';var multer=require(_0xea2a('0x0'));var util=require(_0xea2a('0x1'));var path=require(_0xea2a('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xea2a('0x3')]();var auth=require(_0xea2a('0x4'));var interaction=require(_0xea2a('0x5'));var config=require(_0xea2a('0x6'));var controller=require(_0xea2a('0x7'));router[_0xea2a('0x8')]('/',auth['isAuthenticated'](),controller[_0xea2a('0x9')]);router[_0xea2a('0x8')]('/:id',auth['isAuthenticated'](),controller['show']);router['get'](_0xea2a('0xa'),auth[_0xea2a('0xb')](),controller[_0xea2a('0xc')]);router[_0xea2a('0x8')](_0xea2a('0xd'),auth['isAuthenticated'](),controller[_0xea2a('0xe')]);router[_0xea2a('0xf')]('/',auth[_0xea2a('0xb')](),controller[_0xea2a('0x10')]);router[_0xea2a('0xf')](_0xea2a('0xa'),auth[_0xea2a('0xb')](),controller[_0xea2a('0x11')]);router[_0xea2a('0x12')]('/:id',auth[_0xea2a('0xb')](),controller[_0xea2a('0x13')]);router['delete'](_0xea2a('0x14'),auth[_0xea2a('0xb')](),controller['destroy']);module[_0xea2a('0x15')]=router; \ No newline at end of file +var _0xafcf=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','post','create','put','delete','destroy','exports','multer','express','Router'];(function(_0x11f5ff,_0xa0ef18){var _0x46eefb=function(_0x51872a){while(--_0x51872a){_0x11f5ff['push'](_0x11f5ff['shift']());}};_0x46eefb(++_0xa0ef18);}(_0xafcf,0x101));var _0xfafc=function(_0x1d30a8,_0x34b9d0){_0x1d30a8=_0x1d30a8-0x0;var _0x45c388=_0xafcf[_0x1d30a8];return _0x45c388;};'use strict';var multer=require(_0xfafc('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xfafc('0x1'));var router=express[_0xfafc('0x2')]();var auth=require(_0xfafc('0x3'));var interaction=require(_0xfafc('0x4'));var config=require(_0xfafc('0x5'));var controller=require('./intVtigerAccount.controller');router[_0xfafc('0x6')]('/',auth['isAuthenticated'](),controller[_0xfafc('0x7')]);router[_0xfafc('0x6')](_0xfafc('0x8'),auth[_0xfafc('0x9')](),controller[_0xfafc('0xa')]);router['get'](_0xfafc('0xb'),auth[_0xfafc('0x9')](),controller[_0xfafc('0xc')]);router['get'](_0xfafc('0xd'),auth[_0xfafc('0x9')](),controller['getFields']);router[_0xfafc('0xe')]('/',auth['isAuthenticated'](),controller[_0xfafc('0xf')]);router[_0xfafc('0xe')](_0xfafc('0xb'),auth[_0xfafc('0x9')](),controller['addConfiguration']);router[_0xfafc('0x10')](_0xfafc('0x8'),auth[_0xfafc('0x9')](),controller['update']);router[_0xfafc('0x11')](_0xfafc('0x8'),auth[_0xfafc('0x9')](),controller[_0xfafc('0x12')]);module[_0xfafc('0x13')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f89530a..6f61b64 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 _0x9f45=['sequelize','STRING','HelpDesk'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x9f45,0xa5));var _0x59f4=function(_0x37283d,_0xbe45e2){_0x37283d=_0x37283d-0x0;var _0x2b4379=_0x9f45[_0x37283d];return _0x2b4379;};'use strict';var Sequelize=require(_0x59f4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x59f4('0x1')]},'username':{'type':Sequelize[_0x59f4('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x59f4('0x2')},'remoteUri':{'type':Sequelize[_0x59f4('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x59f4('0x1')]},'accessKey':{'type':Sequelize[_0x59f4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x3367=['STRING','HelpDesk','sequelize'];(function(_0x56825b,_0x172b8d){var _0x69ce77=function(_0x348a1c){while(--_0x348a1c){_0x56825b['push'](_0x56825b['shift']());}};_0x69ce77(++_0x172b8d);}(_0x3367,0xce));var _0x7336=function(_0x4fc13e,_0x5b57b7){_0x4fc13e=_0x4fc13e-0x0;var _0x442384=_0x3367[_0x4fc13e];return _0x442384;};'use strict';var Sequelize=require(_0x7336('0x0'));module['exports']={'name':{'type':Sequelize[_0x7336('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x7336('0x1')]},'username':{'type':Sequelize[_0x7336('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x7336('0x1')],'allowNull':![],'defaultValue':_0x7336('0x2')},'remoteUri':{'type':Sequelize[_0x7336('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x7336('0x1')]},'accessKey':{'type':Sequelize[_0x7336('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 4dc2cdd..9ca7768 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 _0xeb33=['rimraf','fast-json-patch','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','sendStatus','status','end','count','offset','limit','Content-Range','reject','update','then','destroy','stack','name','send','index','VtigerAccount','rawAttributes','fieldName','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','addConfiguration','AccountId','channel','Descriptions','VtigerField','Subjects','getFields','username','description','remoteUri','serverUrl','accessKey','moduleName','lastIndexOf','%s/webservice.php','getchallenge','success','POST','login','token','GET','describe','autogenerated','reference','owner','remove','editable','false','startsWith','cf_','picklistValues','label','value','log','vTiger\x20error:\x20','getFields,\x20%s,\x20%s,\x20%s','test','Wrong\x20credentials','statusCode','html-pdf','eml-format'];(function(_0x2a6314,_0x568d58){var _0x30c37d=function(_0x46016a){while(--_0x46016a){_0x2a6314['push'](_0x2a6314['shift']());}};_0x30c37d(++_0x568d58);}(_0xeb33,0xf0));var _0x3eb3=function(_0x54d08,_0x16d92c){_0x54d08=_0x54d08-0x0;var _0x5f29f7=_0xeb33[_0x54d08];return _0x5f29f7;};'use strict';var pdf=require(_0x3eb3('0x0'));var emlformat=require(_0x3eb3('0x1'));var rimraf=require(_0x3eb3('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3eb3('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3eb3('0x4'));var util=require(_0x3eb3('0x5'));var path=require(_0x3eb3('0x6'));var sox=require(_0x3eb3('0x7'));var csv=require('to-csv');var ejs=require(_0x3eb3('0x8'));var fs=require('fs');var _=require(_0x3eb3('0x9'));var squel=require('squel');var crypto=require(_0x3eb3('0xa'));var jsforce=require(_0x3eb3('0xb'));var deskjs=require(_0x3eb3('0xc'));var toCsv=require(_0x3eb3('0xd'));var querystring=require(_0x3eb3('0xe'));var Papa=require('papaparse');var Redis=require(_0x3eb3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3eb3('0x10'));var hardwareService=require(_0x3eb3('0x11'));var logger=require(_0x3eb3('0x12'))(_0x3eb3('0x13'));var utils=require(_0x3eb3('0x14'));var config=require('../../config/environment');var db=require(_0x3eb3('0x15'))['db'];var integrations=require(_0x3eb3('0x16'));var jayson=require('jayson/promise');var client=jayson[_0x3eb3('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x9a2183,_0x565f88,_0x4b5bd9){if(_0x4b5bd9){var _0x517551=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x517551['test'](_0x565f88)){return _0x9a2183;}else{throw new db['Sequelize']['ValidationError'](_0x3eb3('0x18'));}}else{return _0x9a2183;}}function respondWithRpcPromise(_0x486c8c,_0x1e7375,_0xca4ed5,_0x12aeab){return new BPromise(function(_0x5396bf,_0xa96ea5){var _0x44362f=_0x12aeab||client;return _0x44362f['request'](_0x486c8c,_0xca4ed5)['then'](function(_0x3cc63a){logger[_0x3eb3('0x19')](_0x3eb3('0x1a'),_0x1e7375,_0x3eb3('0x1b'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x1e7375,_0x3eb3('0x1b'),JSON[_0x3eb3('0x1c')](_0x3cc63a));if(_0x3cc63a[_0x3eb3('0x1d')]){if(_0x3cc63a[_0x3eb3('0x1d')]['code']===0x1f4){logger[_0x3eb3('0x1d')](_0x3eb3('0x1a'),_0x1e7375,_0x3cc63a['error'][_0x3eb3('0x1e')]);return _0xa96ea5(_0x3cc63a[_0x3eb3('0x1d')]['message']);}logger[_0x3eb3('0x1d')](_0x3eb3('0x1a'),_0x1e7375,_0x3cc63a[_0x3eb3('0x1d')][_0x3eb3('0x1e')]);return _0x5396bf(_0x3cc63a[_0x3eb3('0x1d')][_0x3eb3('0x1e')]);}else{logger[_0x3eb3('0x19')]('VtigerAccount,\x20%s,\x20%s',_0x1e7375,_0x3eb3('0x1b'));_0x5396bf(_0x3cc63a[_0x3eb3('0x1f')][_0x3eb3('0x1e')]);}})['catch'](function(_0xf7705a){logger['error'](_0x3eb3('0x1a'),_0x1e7375,_0xf7705a);_0xa96ea5(_0xf7705a);});});}function respondWithStatusCode(_0x31df56,_0x5766e4){_0x5766e4=_0x5766e4||0xcc;return function(_0x3eead8){if(_0x3eead8){return _0x31df56[_0x3eb3('0x20')](_0x5766e4);}return _0x31df56[_0x3eb3('0x21')](_0x5766e4)[_0x3eb3('0x22')]();};}function respondWithResult(_0x1ba579,_0x1a374f){_0x1a374f=_0x1a374f||0xc8;return function(_0x1cfbb6){if(_0x1cfbb6){return _0x1ba579['status'](_0x1a374f)['json'](_0x1cfbb6);}};}function respondWithFilteredResult(_0x5a39f3,_0xf6da45){return function(_0x3c2155){if(_0x3c2155){var _0xbfdeb5=_0x3c2155[_0x3eb3('0x23')],_0x7649d=_0xf6da45[_0x3eb3('0x24')],_0x3d77fc=_0xf6da45['offset']+_0xf6da45[_0x3eb3('0x25')],_0xbbf263;if(_0x3d77fc>=_0xbfdeb5){_0x3d77fc=_0xbfdeb5;_0xbbf263=0xc8;}else{_0xbbf263=0xce;}_0x5a39f3[_0x3eb3('0x21')](_0xbbf263);return _0x5a39f3['set'](_0x3eb3('0x26'),_0x7649d+'-'+_0x3d77fc+'/'+_0xbfdeb5)['json'](_0x3c2155);}return null;};}function patchUpdates(_0x47920a){return function(_0xfc1eb1){try{jsonpatch['apply'](_0xfc1eb1,_0x47920a,!![]);}catch(_0x1cc436){return BPromise[_0x3eb3('0x27')](_0x1cc436);}return _0xfc1eb1['save']();};}function saveUpdates(_0x406144,_0x5b344a){return function(_0x278f98){if(_0x278f98){return _0x278f98[_0x3eb3('0x28')](_0x406144)[_0x3eb3('0x29')](function(_0x1c802f){return _0x1c802f;});}return null;};}function removeEntity(_0x4ecbd9,_0x457a65){return function(_0x312785){if(_0x312785){return _0x312785[_0x3eb3('0x2a')]()[_0x3eb3('0x29')](function(){_0x4ecbd9[_0x3eb3('0x21')](0xcc)[_0x3eb3('0x22')]();});}};}function handleEntityNotFound(_0x5f0126,_0x4368b1){return function(_0x2e5141){if(!_0x2e5141){_0x5f0126[_0x3eb3('0x20')](0x194);}return _0x2e5141;};}function handleError(_0x3ec346,_0x4b33a5){_0x4b33a5=_0x4b33a5||0x1f4;return function(_0x11bac1){logger[_0x3eb3('0x1d')](_0x11bac1[_0x3eb3('0x2b')]);if(_0x11bac1[_0x3eb3('0x2c')]){delete _0x11bac1[_0x3eb3('0x2c')];}_0x3ec346[_0x3eb3('0x21')](_0x4b33a5)[_0x3eb3('0x2d')](_0x11bac1);};}exports[_0x3eb3('0x2e')]=function(_0x1a63d9,_0x18818b){var _0xf7d6a1={},_0x1921db={},_0x3cf5ad={'count':0x0,'rows':[]};var _0x32c611=_['map'](db[_0x3eb3('0x2f')][_0x3eb3('0x30')],function(_0x5092d2){return{'name':_0x5092d2[_0x3eb3('0x31')],'type':_0x5092d2['type']['key']};});_0x1921db[_0x3eb3('0x32')]=_[_0x3eb3('0x33')](_0x32c611,_0x3eb3('0x2c'));_0x1921db[_0x3eb3('0x34')]=_[_0x3eb3('0x35')](_0x1a63d9[_0x3eb3('0x34')]);_0x1921db['filters']=_[_0x3eb3('0x36')](_0x1921db[_0x3eb3('0x32')],_0x1921db[_0x3eb3('0x34')]);_0xf7d6a1[_0x3eb3('0x37')]=_[_0x3eb3('0x36')](_0x1921db['model'],qs[_0x3eb3('0x38')](_0x1a63d9[_0x3eb3('0x34')][_0x3eb3('0x38')]));_0xf7d6a1['attributes']=_0xf7d6a1['attributes'][_0x3eb3('0x39')]?_0xf7d6a1[_0x3eb3('0x37')]:_0x1921db[_0x3eb3('0x32')];if(!_0x1a63d9[_0x3eb3('0x34')]['hasOwnProperty'](_0x3eb3('0x3a'))){_0xf7d6a1[_0x3eb3('0x25')]=qs[_0x3eb3('0x25')](_0x1a63d9[_0x3eb3('0x34')][_0x3eb3('0x25')]);_0xf7d6a1[_0x3eb3('0x24')]=qs['offset'](_0x1a63d9['query'][_0x3eb3('0x24')]);}_0xf7d6a1[_0x3eb3('0x3b')]=qs[_0x3eb3('0x3c')](_0x1a63d9[_0x3eb3('0x34')]['sort']);_0xf7d6a1[_0x3eb3('0x3d')]=qs[_0x3eb3('0x3e')](_[_0x3eb3('0x3f')](_0x1a63d9['query'],_0x1921db[_0x3eb3('0x3e')]));if(_0x1a63d9[_0x3eb3('0x34')][_0x3eb3('0x40')]){_0xf7d6a1[_0x3eb3('0x3d')]=_[_0x3eb3('0x41')](_0xf7d6a1[_0x3eb3('0x3d')],{'$or':_['map'](_0x32c611,function(_0x5329c1){if(_0x5329c1[_0x3eb3('0x42')]!=='VIRTUAL'){var _0x449142={};_0x449142[_0x5329c1[_0x3eb3('0x2c')]]={'$like':'%'+_0x1a63d9[_0x3eb3('0x34')][_0x3eb3('0x40')]+'%'};return _0x449142;}})});}_0xf7d6a1=_[_0x3eb3('0x41')]({},_0xf7d6a1,_0x1a63d9[_0x3eb3('0x43')]);var _0xcb8ab9={'where':_0xf7d6a1[_0x3eb3('0x3d')]};return db[_0x3eb3('0x2f')][_0x3eb3('0x23')](_0xcb8ab9)[_0x3eb3('0x29')](function(_0x271005){_0x3cf5ad[_0x3eb3('0x23')]=_0x271005;if(_0x1a63d9['query'][_0x3eb3('0x44')]){_0xf7d6a1[_0x3eb3('0x45')]=[{'all':!![]}];}return db[_0x3eb3('0x2f')][_0x3eb3('0x46')](_0xf7d6a1);})[_0x3eb3('0x29')](function(_0x4bab3d){_0x3cf5ad[_0x3eb3('0x47')]=_0x4bab3d;return _0x3cf5ad;})[_0x3eb3('0x29')](respondWithFilteredResult(_0x18818b,_0xf7d6a1))['catch'](handleError(_0x18818b,null));};exports[_0x3eb3('0x48')]=function(_0x4e1005,_0x2ba1f6){var _0x20c540={'raw':![],'where':{'id':_0x4e1005[_0x3eb3('0x49')]['id']}},_0x172188={};_0x172188[_0x3eb3('0x32')]=_[_0x3eb3('0x35')](db[_0x3eb3('0x2f')][_0x3eb3('0x30')]);_0x172188[_0x3eb3('0x34')]=_['keys'](_0x4e1005[_0x3eb3('0x34')]);_0x172188[_0x3eb3('0x3e')]=_[_0x3eb3('0x36')](_0x172188['model'],_0x172188['query']);_0x20c540['attributes']=_[_0x3eb3('0x36')](_0x172188[_0x3eb3('0x32')],qs[_0x3eb3('0x38')](_0x4e1005[_0x3eb3('0x34')][_0x3eb3('0x38')]));_0x20c540['attributes']=_0x20c540['attributes'][_0x3eb3('0x39')]?_0x20c540[_0x3eb3('0x37')]:_0x172188[_0x3eb3('0x32')];if(_0x4e1005['query']['includeAll']){_0x20c540[_0x3eb3('0x45')]=[{'all':!![]}];}_0x20c540=_[_0x3eb3('0x41')]({},_0x20c540,_0x4e1005['options']);return db[_0x3eb3('0x2f')]['find'](_0x20c540)['then'](handleEntityNotFound(_0x2ba1f6,null))[_0x3eb3('0x29')](respondWithResult(_0x2ba1f6,null))[_0x3eb3('0x4a')](handleError(_0x2ba1f6,null));};exports[_0x3eb3('0x4b')]=function(_0xd2963e,_0x88fea5){return db[_0x3eb3('0x2f')][_0x3eb3('0x4b')](_0xd2963e[_0x3eb3('0x4c')],{})[_0x3eb3('0x29')](respondWithResult(_0x88fea5,0xc9))['catch'](handleError(_0x88fea5,null));};exports[_0x3eb3('0x28')]=function(_0x942db5,_0x357f3a){if(_0x942db5[_0x3eb3('0x4c')]['id']){delete _0x942db5[_0x3eb3('0x4c')]['id'];}return db[_0x3eb3('0x2f')][_0x3eb3('0x4d')]({'where':{'id':_0x942db5[_0x3eb3('0x49')]['id']}})[_0x3eb3('0x29')](handleEntityNotFound(_0x357f3a,null))['then'](saveUpdates(_0x942db5[_0x3eb3('0x4c')],null))['then'](respondWithResult(_0x357f3a,null))[_0x3eb3('0x4a')](handleError(_0x357f3a,null));};exports[_0x3eb3('0x2a')]=function(_0x183fd6,_0xffbdba){return db[_0x3eb3('0x2f')]['find']({'where':{'id':_0x183fd6['params']['id']}})[_0x3eb3('0x29')](handleEntityNotFound(_0xffbdba,null))[_0x3eb3('0x29')](removeEntity(_0xffbdba,null))[_0x3eb3('0x4a')](handleError(_0xffbdba,null));};exports[_0x3eb3('0x4e')]=function(_0x2abe65,_0x591a53,_0x13d398){var _0x1db53e={};var _0x25d2a7={};var _0x1809c0;var _0x4c9fdd;return db[_0x3eb3('0x2f')][_0x3eb3('0x4f')]({'where':{'id':_0x2abe65[_0x3eb3('0x49')]['id']}})[_0x3eb3('0x29')](handleEntityNotFound(_0x591a53,null))[_0x3eb3('0x29')](function(_0x162b2d){if(_0x162b2d){_0x1809c0=_0x162b2d;_0x25d2a7[_0x3eb3('0x32')]=_[_0x3eb3('0x35')](db[_0x3eb3('0x50')][_0x3eb3('0x30')]);_0x25d2a7['query']=_[_0x3eb3('0x35')](_0x2abe65[_0x3eb3('0x34')]);_0x25d2a7[_0x3eb3('0x3e')]=_['intersection'](_0x25d2a7[_0x3eb3('0x32')],_0x25d2a7[_0x3eb3('0x34')]);_0x1db53e[_0x3eb3('0x37')]=_['intersection'](_0x25d2a7[_0x3eb3('0x32')],qs[_0x3eb3('0x38')](_0x2abe65['query'][_0x3eb3('0x38')]));_0x1db53e['attributes']=_0x1db53e[_0x3eb3('0x37')][_0x3eb3('0x39')]?_0x1db53e['attributes']:_0x25d2a7[_0x3eb3('0x32')];_0x1db53e[_0x3eb3('0x3b')]=qs[_0x3eb3('0x3c')](_0x2abe65[_0x3eb3('0x34')]['sort']);_0x1db53e['where']=qs[_0x3eb3('0x3e')](_[_0x3eb3('0x3f')](_0x2abe65[_0x3eb3('0x34')],_0x25d2a7['filters']));if(_0x2abe65['query'][_0x3eb3('0x40')]){_0x1db53e[_0x3eb3('0x3d')]=_[_0x3eb3('0x41')](_0x1db53e['where'],{'$or':_['map'](_0x1db53e[_0x3eb3('0x37')],function(_0x259e44){var _0x1525b0={};_0x1525b0[_0x259e44]={'$like':'%'+_0x2abe65[_0x3eb3('0x34')][_0x3eb3('0x40')]+'%'};return _0x1525b0;})});}_0x1db53e=_[_0x3eb3('0x41')]({},_0x1db53e,_0x2abe65[_0x3eb3('0x43')]);return _0x1809c0['getConfigurations'](_0x1db53e);}})[_0x3eb3('0x29')](function(_0x5b4d85){if(_0x5b4d85){_0x4c9fdd=_0x5b4d85['length'];if(!_0x2abe65[_0x3eb3('0x34')][_0x3eb3('0x51')]('nolimit')){_0x1db53e[_0x3eb3('0x25')]=qs['limit'](_0x2abe65[_0x3eb3('0x34')][_0x3eb3('0x25')]);_0x1db53e[_0x3eb3('0x24')]=qs[_0x3eb3('0x24')](_0x2abe65[_0x3eb3('0x34')][_0x3eb3('0x24')]);}return _0x1809c0['getConfigurations'](_0x1db53e);}})['then'](function(_0x233dbe){if(_0x233dbe){return _0x233dbe?{'count':_0x4c9fdd,'rows':_0x233dbe}:null;}})['then'](respondWithResult(_0x591a53,null))[_0x3eb3('0x4a')](handleError(_0x591a53,null));};exports[_0x3eb3('0x52')]=function(_0x5d5923,_0x8040e2,_0x47aa14){if(_0x5d5923[_0x3eb3('0x4c')]['id']){delete _0x5d5923[_0x3eb3('0x4c')]['id'];}return db[_0x3eb3('0x2f')]['findOne']({'where':{'id':_0x5d5923['params']['id']}})['then'](handleEntityNotFound(_0x8040e2,null))[_0x3eb3('0x29')](function(_0x4a4655){if(_0x4a4655){_0x5d5923[_0x3eb3('0x4c')][_0x3eb3('0x53')]=_0x4a4655['id'];_0x5d5923[_0x3eb3('0x4c')]['Subjects']=integrations['getSubjects'](_0x5d5923['body'][_0x3eb3('0x54')],_0x5d5923[_0x3eb3('0x4c')][_0x3eb3('0x42')]);_0x5d5923[_0x3eb3('0x4c')][_0x3eb3('0x55')]=integrations['getDescriptions'](_0x5d5923[_0x3eb3('0x4c')][_0x3eb3('0x54')],_0x5d5923[_0x3eb3('0x4c')][_0x3eb3('0x42')]);return db[_0x3eb3('0x50')][_0x3eb3('0x4b')](_0x5d5923[_0x3eb3('0x4c')],{'include':[{'model':db[_0x3eb3('0x56')],'as':_0x3eb3('0x57')},{'model':db[_0x3eb3('0x56')],'as':'Descriptions'}]});}return null;})[_0x3eb3('0x29')](respondWithResult(_0x8040e2,null))[_0x3eb3('0x4a')](handleError(_0x8040e2,null));};var md5=require('md5');exports[_0x3eb3('0x58')]=function(_0x253c2a,_0x391c8c,_0x9aef47){var _0x5bfe13=null;var _0x4a0580=null;var _0x3d7008=null;var _0x2c3b64=null;var _0x4692ed='';return db[_0x3eb3('0x2f')][_0x3eb3('0x4f')]({'where':{'id':_0x253c2a[_0x3eb3('0x49')]['id']},'attributes':['id','name',_0x3eb3('0x59'),_0x3eb3('0x5a'),'moduleName',_0x3eb3('0x5b'),_0x3eb3('0x5c'),_0x3eb3('0x5d')]})[_0x3eb3('0x29')](handleEntityNotFound(_0x391c8c,null))['then'](function(_0xc28a95){if(_0xc28a95){_0x5bfe13=_0xc28a95[_0x3eb3('0x59')];_0x4a0580=_0xc28a95['accessKey'];_0x3d7008=_0xc28a95[_0x3eb3('0x5e')];_0x4692ed=_0xc28a95[_0x3eb3('0x5b')];var _0x49f967=_0x4692ed['slice'](-0x1);if(_0x49f967==='/'){_0x4692ed=_0x4692ed['substring'](0x0,_0x4692ed[_0x3eb3('0x5f')](_0x49f967));}_0x2c3b64=util['format'](_0x3eb3('0x60'),_0x4692ed);var _0x5d8930={'method':'GET','uri':_0x2c3b64,'qs':{'operation':_0x3eb3('0x61'),'username':_0xc28a95[_0x3eb3('0x59')]},'json':!![]};return rp(_0x5d8930);}})[_0x3eb3('0x29')](function(_0xa4d660){if(_0xa4d660[_0x3eb3('0x62')]){var _0x55c898={'method':_0x3eb3('0x63'),'uri':_0x2c3b64,'form':{'operation':_0x3eb3('0x64'),'username':_0x5bfe13,'accessKey':md5(_0xa4d660['result'][_0x3eb3('0x65')]+_0x4a0580)},'json':!![]};return rp(_0x55c898);}})[_0x3eb3('0x29')](function(_0x4455cf){if(_0x4455cf[_0x3eb3('0x62')]){var _0x4c26ed={'method':_0x3eb3('0x66'),'uri':_0x2c3b64,'qs':{'operation':_0x3eb3('0x67'),'username':_0x5bfe13,'sessionName':_0x4455cf['result']['sessionName'],'elementType':_0x3d7008},'json':!![]};return rp(_0x4c26ed);}})[_0x3eb3('0x29')](function(_0x2226cb){if(_0x2226cb['success']){var _0x26d042=[_0x3eb3('0x68'),_0x3eb3('0x69'),_0x3eb3('0x6a')];_['remove'](_0x2226cb['result'][_0x3eb3('0x38')],function(_0x8a0ded){return _0x26d042['includes'](_0x8a0ded[_0x3eb3('0x42')]['name']);});_[_0x3eb3('0x6b')](_0x2226cb[_0x3eb3('0x1f')][_0x3eb3('0x38')],function(_0x26b34f){return _0x26b34f[_0x3eb3('0x6c')]===_0x3eb3('0x6d');});return{'count':_0x2226cb[_0x3eb3('0x1f')][_0x3eb3('0x38')][_0x3eb3('0x39')],'rows':_[_0x3eb3('0x33')](_0x2226cb['result'][_0x3eb3('0x38')],function(_0x102e49){return{'id':_0x102e49[_0x3eb3('0x2c')],'name':_0x102e49['label'],'custom':_[_0x3eb3('0x6e')](_0x102e49[_0x3eb3('0x2c')],_0x3eb3('0x6f'))?!![]:![],'options':_0x102e49[_0x3eb3('0x42')][_0x3eb3('0x2c')]==='picklist'&&_0x102e49[_0x3eb3('0x42')][_0x3eb3('0x70')][_0x3eb3('0x39')]>0x0?_[_0x3eb3('0x33')](_0x102e49[_0x3eb3('0x42')][_0x3eb3('0x70')],function(_0x831f92){return{'name':_0x831f92[_0x3eb3('0x71')],'value':_0x831f92[_0x3eb3('0x72')]};}):[]};})};}})['then'](respondWithResult(_0x391c8c,null))['catch'](function(_0x199a89){console[_0x3eb3('0x73')](_0x3eb3('0x74')+_0x199a89);var _0x3315f0=_0x253c2a[_0x3eb3('0x34')]['test']?0x1f4:_0x199a89['statusCode']||0x1f4;logger[_0x3eb3('0x1d')](_0x3eb3('0x75'),_0x3eb3('0x58'),_0x3315f0,JSON['stringify'](_0x199a89));delete _0x199a89[_0x3eb3('0x2c')];if(_0x3315f0===0x191){_0x3315f0=0x190;}_0x391c8c[_0x3eb3('0x21')](_0x3315f0)['send'](_0x253c2a[_0x3eb3('0x34')][_0x3eb3('0x76')]?{'message':_0x3eb3('0x77'),'statusCode':_0x199a89[_0x3eb3('0x78')]}:_0x199a89);});}; \ No newline at end of file +var _0x9ce4=['fieldName','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','includeAll','findAll','rows','params','length','find','create','body','update','getConfigurations','findOne','pick','addConfiguration','AccountId','getSubjects','channel','getDescriptions','VtigerField','Descriptions','md5','getFields','username','description','moduleName','remoteUri','serverUrl','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','getchallenge','POST','login','token','success','describe','sessionName','autogenerated','reference','owner','remove','includes','editable','false','label','startsWith','cf_','picklist','picklistValues','value','log','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','client','http','test','ValidationError','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','name','send','map','VtigerAccount','rawAttributes'];(function(_0x2a00dd,_0x10da34){var _0x54613f=function(_0x457c2f){while(--_0x457c2f){_0x2a00dd['push'](_0x2a00dd['shift']());}};_0x54613f(++_0x10da34);}(_0x9ce4,0x1d2));var _0x49ce=function(_0x3f465d,_0xbd2037){_0x3f465d=_0x3f465d-0x0;var _0x121ad1=_0x9ce4[_0x3f465d];return _0x121ad1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x49ce('0x0'));var rimraf=require(_0x49ce('0x1'));var zipdir=require(_0x49ce('0x2'));var jsonpatch=require(_0x49ce('0x3'));var rp=require(_0x49ce('0x4'));var moment=require(_0x49ce('0x5'));var BPromise=require(_0x49ce('0x6'));var Mustache=require(_0x49ce('0x7'));var util=require(_0x49ce('0x8'));var path=require('path');var sox=require(_0x49ce('0x9'));var csv=require(_0x49ce('0xa'));var ejs=require(_0x49ce('0xb'));var fs=require('fs');var _=require(_0x49ce('0xc'));var squel=require('squel');var crypto=require(_0x49ce('0xd'));var jsforce=require(_0x49ce('0xe'));var deskjs=require(_0x49ce('0xf'));var toCsv=require('to-csv');var querystring=require(_0x49ce('0x10'));var Papa=require(_0x49ce('0x11'));var Redis=require(_0x49ce('0x12'));var authService=require(_0x49ce('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x49ce('0x14'));var hardwareService=require(_0x49ce('0x15'));var logger=require(_0x49ce('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x49ce('0x17'));var db=require(_0x49ce('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0x49ce('0x19')][_0x49ce('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xc8f0c6,_0x3c0c68,_0x509384){if(_0x509384){var _0x45bd0f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45bd0f[_0x49ce('0x1b')](_0x3c0c68)){return _0xc8f0c6;}else{throw new db['Sequelize'][(_0x49ce('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xc8f0c6;}}function respondWithRpcPromise(_0x3c2e51,_0x749d53,_0x339aea,_0x140577){return new BPromise(function(_0x51f271,_0x19026c){var _0x5da4de=_0x140577||client;return _0x5da4de[_0x49ce('0x1d')](_0x3c2e51,_0x339aea)[_0x49ce('0x1e')](function(_0x22cbaa){logger[_0x49ce('0x1f')](_0x49ce('0x20'),_0x749d53,_0x49ce('0x21'));logger['debug']('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x749d53,'request\x20sent',JSON[_0x49ce('0x22')](_0x22cbaa));if(_0x22cbaa['error']){if(_0x22cbaa[_0x49ce('0x23')][_0x49ce('0x24')]===0x1f4){logger[_0x49ce('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x749d53,_0x22cbaa[_0x49ce('0x23')][_0x49ce('0x25')]);return _0x19026c(_0x22cbaa[_0x49ce('0x23')][_0x49ce('0x25')]);}logger[_0x49ce('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x749d53,_0x22cbaa[_0x49ce('0x23')][_0x49ce('0x25')]);return _0x51f271(_0x22cbaa[_0x49ce('0x23')][_0x49ce('0x25')]);}else{logger['info'](_0x49ce('0x20'),_0x749d53,_0x49ce('0x21'));_0x51f271(_0x22cbaa[_0x49ce('0x26')][_0x49ce('0x25')]);}})[_0x49ce('0x27')](function(_0x137168){logger[_0x49ce('0x23')]('VtigerAccount,\x20%s,\x20%s',_0x749d53,_0x137168);_0x19026c(_0x137168);});});}function respondWithStatusCode(_0x10d3b6,_0x4c6e3e){_0x4c6e3e=_0x4c6e3e||0xcc;return function(_0x3dd8db){if(_0x3dd8db){return _0x10d3b6[_0x49ce('0x28')](_0x4c6e3e);}return _0x10d3b6[_0x49ce('0x29')](_0x4c6e3e)[_0x49ce('0x2a')]();};}function respondWithResult(_0x4f0fdc,_0xe70a83){_0xe70a83=_0xe70a83||0xc8;return function(_0x5ddaec){if(_0x5ddaec){return _0x4f0fdc[_0x49ce('0x29')](_0xe70a83)[_0x49ce('0x2b')](_0x5ddaec);}};}function respondWithFilteredResult(_0x103565,_0x288fb7){return function(_0x137e94){if(_0x137e94){var _0x3f581f=_0x137e94[_0x49ce('0x2c')],_0x25e8b7=_0x288fb7[_0x49ce('0x2d')],_0xfe538a=_0x288fb7[_0x49ce('0x2d')]+_0x288fb7[_0x49ce('0x2e')],_0x493f71;if(_0xfe538a>=_0x3f581f){_0xfe538a=_0x3f581f;_0x493f71=0xc8;}else{_0x493f71=0xce;}_0x103565[_0x49ce('0x29')](_0x493f71);return _0x103565[_0x49ce('0x2f')](_0x49ce('0x30'),_0x25e8b7+'-'+_0xfe538a+'/'+_0x3f581f)[_0x49ce('0x2b')](_0x137e94);}return null;};}function patchUpdates(_0x526907){return function(_0x3ddccb){try{jsonpatch[_0x49ce('0x31')](_0x3ddccb,_0x526907,!![]);}catch(_0x1bb229){return BPromise[_0x49ce('0x32')](_0x1bb229);}return _0x3ddccb[_0x49ce('0x33')]();};}function saveUpdates(_0x27d5d5,_0x1ed06c){return function(_0x224397){if(_0x224397){return _0x224397['update'](_0x27d5d5)[_0x49ce('0x1e')](function(_0x1452a6){return _0x1452a6;});}return null;};}function removeEntity(_0x16cb85,_0x4e0deb){return function(_0x28f885){if(_0x28f885){return _0x28f885[_0x49ce('0x34')]()[_0x49ce('0x1e')](function(){_0x16cb85[_0x49ce('0x29')](0xcc)[_0x49ce('0x2a')]();});}};}function handleEntityNotFound(_0x52fbc7,_0x26cac5){return function(_0x543d8a){if(!_0x543d8a){_0x52fbc7[_0x49ce('0x28')](0x194);}return _0x543d8a;};}function handleError(_0x344fd0,_0x4cb37c){_0x4cb37c=_0x4cb37c||0x1f4;return function(_0x2a056e){logger[_0x49ce('0x23')](_0x2a056e['stack']);if(_0x2a056e[_0x49ce('0x35')]){delete _0x2a056e[_0x49ce('0x35')];}_0x344fd0[_0x49ce('0x29')](_0x4cb37c)[_0x49ce('0x36')](_0x2a056e);};}exports['index']=function(_0x2aff50,_0xf7abfe){var _0x36d595={},_0x166856={},_0x4e6687={'count':0x0,'rows':[]};var _0x34241c=_[_0x49ce('0x37')](db[_0x49ce('0x38')][_0x49ce('0x39')],function(_0x4bf0c1){return{'name':_0x4bf0c1[_0x49ce('0x3a')],'type':_0x4bf0c1['type']['key']};});_0x166856[_0x49ce('0x3b')]=_[_0x49ce('0x37')](_0x34241c,_0x49ce('0x35'));_0x166856[_0x49ce('0x3c')]=_[_0x49ce('0x3d')](_0x2aff50[_0x49ce('0x3c')]);_0x166856[_0x49ce('0x3e')]=_[_0x49ce('0x3f')](_0x166856[_0x49ce('0x3b')],_0x166856[_0x49ce('0x3c')]);_0x36d595[_0x49ce('0x40')]=_['intersection'](_0x166856['model'],qs[_0x49ce('0x41')](_0x2aff50[_0x49ce('0x3c')][_0x49ce('0x41')]));_0x36d595[_0x49ce('0x40')]=_0x36d595['attributes']['length']?_0x36d595[_0x49ce('0x40')]:_0x166856[_0x49ce('0x3b')];if(!_0x2aff50['query'][_0x49ce('0x42')](_0x49ce('0x43'))){_0x36d595[_0x49ce('0x2e')]=qs[_0x49ce('0x2e')](_0x2aff50[_0x49ce('0x3c')][_0x49ce('0x2e')]);_0x36d595[_0x49ce('0x2d')]=qs[_0x49ce('0x2d')](_0x2aff50[_0x49ce('0x3c')][_0x49ce('0x2d')]);}_0x36d595[_0x49ce('0x44')]=qs['sort'](_0x2aff50['query'][_0x49ce('0x45')]);_0x36d595[_0x49ce('0x46')]=qs[_0x49ce('0x3e')](_['pick'](_0x2aff50[_0x49ce('0x3c')],_0x166856['filters']));if(_0x2aff50['query'][_0x49ce('0x47')]){_0x36d595['where']=_[_0x49ce('0x48')](_0x36d595[_0x49ce('0x46')],{'$or':_[_0x49ce('0x37')](_0x34241c,function(_0x2f492b){if(_0x2f492b[_0x49ce('0x49')]!=='VIRTUAL'){var _0x5dcf71={};_0x5dcf71[_0x2f492b[_0x49ce('0x35')]]={'$like':'%'+_0x2aff50[_0x49ce('0x3c')][_0x49ce('0x47')]+'%'};return _0x5dcf71;}})});}_0x36d595=_[_0x49ce('0x48')]({},_0x36d595,_0x2aff50[_0x49ce('0x4a')]);var _0x3de4ed={'where':_0x36d595['where']};return db[_0x49ce('0x38')]['count'](_0x3de4ed)[_0x49ce('0x1e')](function(_0x537a3f){_0x4e6687[_0x49ce('0x2c')]=_0x537a3f;if(_0x2aff50['query'][_0x49ce('0x4b')]){_0x36d595['include']=[{'all':!![]}];}return db[_0x49ce('0x38')][_0x49ce('0x4c')](_0x36d595);})[_0x49ce('0x1e')](function(_0x24b78e){_0x4e6687[_0x49ce('0x4d')]=_0x24b78e;return _0x4e6687;})[_0x49ce('0x1e')](respondWithFilteredResult(_0xf7abfe,_0x36d595))[_0x49ce('0x27')](handleError(_0xf7abfe,null));};exports['show']=function(_0x442042,_0x1fb3e8){var _0x54dff9={'raw':![],'where':{'id':_0x442042[_0x49ce('0x4e')]['id']}},_0x300db1={};_0x300db1[_0x49ce('0x3b')]=_[_0x49ce('0x3d')](db['VtigerAccount'][_0x49ce('0x39')]);_0x300db1['query']=_[_0x49ce('0x3d')](_0x442042['query']);_0x300db1[_0x49ce('0x3e')]=_[_0x49ce('0x3f')](_0x300db1[_0x49ce('0x3b')],_0x300db1[_0x49ce('0x3c')]);_0x54dff9['attributes']=_[_0x49ce('0x3f')](_0x300db1[_0x49ce('0x3b')],qs['fields'](_0x442042[_0x49ce('0x3c')][_0x49ce('0x41')]));_0x54dff9[_0x49ce('0x40')]=_0x54dff9[_0x49ce('0x40')][_0x49ce('0x4f')]?_0x54dff9[_0x49ce('0x40')]:_0x300db1['model'];if(_0x442042['query'][_0x49ce('0x4b')]){_0x54dff9['include']=[{'all':!![]}];}_0x54dff9=_['merge']({},_0x54dff9,_0x442042['options']);return db[_0x49ce('0x38')][_0x49ce('0x50')](_0x54dff9)[_0x49ce('0x1e')](handleEntityNotFound(_0x1fb3e8,null))[_0x49ce('0x1e')](respondWithResult(_0x1fb3e8,null))[_0x49ce('0x27')](handleError(_0x1fb3e8,null));};exports[_0x49ce('0x51')]=function(_0x567770,_0x39d621){return db[_0x49ce('0x38')]['create'](_0x567770[_0x49ce('0x52')],{})[_0x49ce('0x1e')](respondWithResult(_0x39d621,0xc9))[_0x49ce('0x27')](handleError(_0x39d621,null));};exports[_0x49ce('0x53')]=function(_0x2b4cdc,_0x5dc422){if(_0x2b4cdc[_0x49ce('0x52')]['id']){delete _0x2b4cdc['body']['id'];}return db[_0x49ce('0x38')]['find']({'where':{'id':_0x2b4cdc['params']['id']}})[_0x49ce('0x1e')](handleEntityNotFound(_0x5dc422,null))[_0x49ce('0x1e')](saveUpdates(_0x2b4cdc[_0x49ce('0x52')],null))[_0x49ce('0x1e')](respondWithResult(_0x5dc422,null))['catch'](handleError(_0x5dc422,null));};exports[_0x49ce('0x34')]=function(_0x2c4638,_0x4d0b6d){return db[_0x49ce('0x38')][_0x49ce('0x50')]({'where':{'id':_0x2c4638[_0x49ce('0x4e')]['id']}})['then'](handleEntityNotFound(_0x4d0b6d,null))[_0x49ce('0x1e')](removeEntity(_0x4d0b6d,null))['catch'](handleError(_0x4d0b6d,null));};exports[_0x49ce('0x54')]=function(_0x1776ba,_0x3193e3,_0x2c4e66){var _0x1dd275={};var _0x604c1a={};var _0x18a1ff;var _0x36614c;return db[_0x49ce('0x38')][_0x49ce('0x55')]({'where':{'id':_0x1776ba['params']['id']}})[_0x49ce('0x1e')](handleEntityNotFound(_0x3193e3,null))[_0x49ce('0x1e')](function(_0x271282){if(_0x271282){_0x18a1ff=_0x271282;_0x604c1a[_0x49ce('0x3b')]=_[_0x49ce('0x3d')](db['VtigerConfiguration'][_0x49ce('0x39')]);_0x604c1a[_0x49ce('0x3c')]=_[_0x49ce('0x3d')](_0x1776ba[_0x49ce('0x3c')]);_0x604c1a['filters']=_['intersection'](_0x604c1a[_0x49ce('0x3b')],_0x604c1a[_0x49ce('0x3c')]);_0x1dd275[_0x49ce('0x40')]=_['intersection'](_0x604c1a['model'],qs[_0x49ce('0x41')](_0x1776ba['query'][_0x49ce('0x41')]));_0x1dd275[_0x49ce('0x40')]=_0x1dd275[_0x49ce('0x40')][_0x49ce('0x4f')]?_0x1dd275[_0x49ce('0x40')]:_0x604c1a[_0x49ce('0x3b')];_0x1dd275[_0x49ce('0x44')]=qs[_0x49ce('0x45')](_0x1776ba[_0x49ce('0x3c')][_0x49ce('0x45')]);_0x1dd275['where']=qs[_0x49ce('0x3e')](_[_0x49ce('0x56')](_0x1776ba['query'],_0x604c1a['filters']));if(_0x1776ba[_0x49ce('0x3c')][_0x49ce('0x47')]){_0x1dd275[_0x49ce('0x46')]=_['merge'](_0x1dd275[_0x49ce('0x46')],{'$or':_[_0x49ce('0x37')](_0x1dd275[_0x49ce('0x40')],function(_0x2b0502){var _0x530fd2={};_0x530fd2[_0x2b0502]={'$like':'%'+_0x1776ba[_0x49ce('0x3c')][_0x49ce('0x47')]+'%'};return _0x530fd2;})});}_0x1dd275=_[_0x49ce('0x48')]({},_0x1dd275,_0x1776ba['options']);return _0x18a1ff[_0x49ce('0x54')](_0x1dd275);}})['then'](function(_0x1c170d){if(_0x1c170d){_0x36614c=_0x1c170d[_0x49ce('0x4f')];if(!_0x1776ba['query']['hasOwnProperty']('nolimit')){_0x1dd275['limit']=qs['limit'](_0x1776ba[_0x49ce('0x3c')][_0x49ce('0x2e')]);_0x1dd275[_0x49ce('0x2d')]=qs[_0x49ce('0x2d')](_0x1776ba[_0x49ce('0x3c')][_0x49ce('0x2d')]);}return _0x18a1ff[_0x49ce('0x54')](_0x1dd275);}})[_0x49ce('0x1e')](function(_0x50f919){if(_0x50f919){return _0x50f919?{'count':_0x36614c,'rows':_0x50f919}:null;}})[_0x49ce('0x1e')](respondWithResult(_0x3193e3,null))[_0x49ce('0x27')](handleError(_0x3193e3,null));};exports[_0x49ce('0x57')]=function(_0x5c5124,_0x1b8bfe,_0xa21752){if(_0x5c5124[_0x49ce('0x52')]['id']){delete _0x5c5124['body']['id'];}return db['VtigerAccount'][_0x49ce('0x55')]({'where':{'id':_0x5c5124[_0x49ce('0x4e')]['id']}})[_0x49ce('0x1e')](handleEntityNotFound(_0x1b8bfe,null))[_0x49ce('0x1e')](function(_0xceeda4){if(_0xceeda4){_0x5c5124[_0x49ce('0x52')][_0x49ce('0x58')]=_0xceeda4['id'];_0x5c5124[_0x49ce('0x52')]['Subjects']=integrations[_0x49ce('0x59')](_0x5c5124['body'][_0x49ce('0x5a')],_0x5c5124['body'][_0x49ce('0x49')]);_0x5c5124['body']['Descriptions']=integrations[_0x49ce('0x5b')](_0x5c5124['body'][_0x49ce('0x5a')],_0x5c5124['body'][_0x49ce('0x49')]);return db['VtigerConfiguration'][_0x49ce('0x51')](_0x5c5124[_0x49ce('0x52')],{'include':[{'model':db[_0x49ce('0x5c')],'as':'Subjects'},{'model':db[_0x49ce('0x5c')],'as':_0x49ce('0x5d')}]});}return null;})[_0x49ce('0x1e')](respondWithResult(_0x1b8bfe,null))[_0x49ce('0x27')](handleError(_0x1b8bfe,null));};var md5=require(_0x49ce('0x5e'));exports[_0x49ce('0x5f')]=function(_0x113ac6,_0x3a6762,_0x2e6b68){var _0x5193cd=null;var _0x483bd3=null;var _0xf045dd=null;var _0x5eb232=null;var _0x24bd42='';return db[_0x49ce('0x38')]['findOne']({'where':{'id':_0x113ac6['params']['id']},'attributes':['id',_0x49ce('0x35'),_0x49ce('0x60'),_0x49ce('0x61'),_0x49ce('0x62'),_0x49ce('0x63'),_0x49ce('0x64'),_0x49ce('0x65')]})[_0x49ce('0x1e')](handleEntityNotFound(_0x3a6762,null))[_0x49ce('0x1e')](function(_0x5a1806){if(_0x5a1806){_0x5193cd=_0x5a1806[_0x49ce('0x60')];_0x483bd3=_0x5a1806[_0x49ce('0x65')];_0xf045dd=_0x5a1806[_0x49ce('0x62')];_0x24bd42=_0x5a1806[_0x49ce('0x63')];var _0x4bdffb=_0x24bd42[_0x49ce('0x66')](-0x1);if(_0x4bdffb==='/'){_0x24bd42=_0x24bd42[_0x49ce('0x67')](0x0,_0x24bd42[_0x49ce('0x68')](_0x4bdffb));}_0x5eb232=util[_0x49ce('0x69')](_0x49ce('0x6a'),_0x24bd42);var _0x2314a0={'method':'GET','uri':_0x5eb232,'qs':{'operation':_0x49ce('0x6b'),'username':_0x5a1806['username']},'json':!![]};return rp(_0x2314a0);}})['then'](function(_0x4fb569){if(_0x4fb569['success']){var _0x11fe70={'method':_0x49ce('0x6c'),'uri':_0x5eb232,'form':{'operation':_0x49ce('0x6d'),'username':_0x5193cd,'accessKey':md5(_0x4fb569[_0x49ce('0x26')][_0x49ce('0x6e')]+_0x483bd3)},'json':!![]};return rp(_0x11fe70);}})[_0x49ce('0x1e')](function(_0x8b7757){if(_0x8b7757[_0x49ce('0x6f')]){var _0x400ca0={'method':'GET','uri':_0x5eb232,'qs':{'operation':_0x49ce('0x70'),'username':_0x5193cd,'sessionName':_0x8b7757[_0x49ce('0x26')][_0x49ce('0x71')],'elementType':_0xf045dd},'json':!![]};return rp(_0x400ca0);}})['then'](function(_0x43326a){if(_0x43326a[_0x49ce('0x6f')]){var _0x176f17=[_0x49ce('0x72'),_0x49ce('0x73'),_0x49ce('0x74')];_[_0x49ce('0x75')](_0x43326a[_0x49ce('0x26')][_0x49ce('0x41')],function(_0x1545e4){return _0x176f17[_0x49ce('0x76')](_0x1545e4[_0x49ce('0x49')][_0x49ce('0x35')]);});_[_0x49ce('0x75')](_0x43326a[_0x49ce('0x26')]['fields'],function(_0x4becb7){return _0x4becb7[_0x49ce('0x77')]===_0x49ce('0x78');});return{'count':_0x43326a[_0x49ce('0x26')]['fields'][_0x49ce('0x4f')],'rows':_['map'](_0x43326a[_0x49ce('0x26')]['fields'],function(_0x4074bd){return{'id':_0x4074bd[_0x49ce('0x35')],'name':_0x4074bd[_0x49ce('0x79')],'custom':_[_0x49ce('0x7a')](_0x4074bd[_0x49ce('0x35')],_0x49ce('0x7b'))?!![]:![],'options':_0x4074bd[_0x49ce('0x49')][_0x49ce('0x35')]===_0x49ce('0x7c')&&_0x4074bd['type'][_0x49ce('0x7d')][_0x49ce('0x4f')]>0x0?_[_0x49ce('0x37')](_0x4074bd[_0x49ce('0x49')][_0x49ce('0x7d')],function(_0x38a21a){return{'name':_0x38a21a[_0x49ce('0x79')],'value':_0x38a21a[_0x49ce('0x7e')]};}):[]};})};}})[_0x49ce('0x1e')](respondWithResult(_0x3a6762,null))['catch'](function(_0x49cc06){console[_0x49ce('0x7f')]('vTiger\x20error:\x20'+_0x49cc06);var _0x54c601=_0x113ac6[_0x49ce('0x3c')]['test']?0x1f4:_0x49cc06['statusCode']||0x1f4;logger[_0x49ce('0x23')](_0x49ce('0x80'),_0x49ce('0x5f'),_0x54c601,JSON[_0x49ce('0x22')](_0x49cc06));delete _0x49cc06[_0x49ce('0x35')];if(_0x54c601===0x191){_0x54c601=0x190;}_0x3a6762['status'](_0x54c601)[_0x49ce('0x36')](_0x113ac6[_0x49ce('0x3c')][_0x49ce('0x1b')]?{'message':_0x49ce('0x81'),'statusCode':_0x49cc06[_0x49ce('0x82')]}:_0x49cc06);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 783057c..4fe42a6 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 _0x50b7=['exports','define','VtigerAccount','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x50b7,0x121));var _0x750b=function(_0x38dc43,_0x849dbd){_0x38dc43=_0x38dc43-0x0;var _0x7459f=_0x50b7[_0x38dc43];return _0x7459f;};'use strict';var _=require('lodash');var util=require(_0x750b('0x0'));var logger=require(_0x750b('0x1'))(_0x750b('0x2'));var moment=require(_0x750b('0x3'));var BPromise=require(_0x750b('0x4'));var rp=require(_0x750b('0x5'));var fs=require('fs');var path=require(_0x750b('0x6'));var rimraf=require('rimraf');var config=require(_0x750b('0x7'));var attributes=require(_0x750b('0x8'));var integrations=require(_0x750b('0x9'));module[_0x750b('0xa')]=function(_0x36e47d,_0x282d86){return _0x36e47d[_0x750b('0xb')](_0x750b('0xc'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x97b1=['rimraf','./intVtigerAccount.attributes','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x267651,_0x484e0b){var _0x31c798=function(_0x5edf7a){while(--_0x5edf7a){_0x267651['push'](_0x267651['shift']());}};_0x31c798(++_0x484e0b);}(_0x97b1,0x85));var _0x197b=function(_0x20845e,_0x211e78){_0x20845e=_0x20845e-0x0;var _0x28cf2b=_0x97b1[_0x20845e];return _0x28cf2b;};'use strict';var _=require('lodash');var util=require(_0x197b('0x0'));var logger=require(_0x197b('0x1'))(_0x197b('0x2'));var moment=require(_0x197b('0x3'));var BPromise=require(_0x197b('0x4'));var rp=require(_0x197b('0x5'));var fs=require('fs');var path=require(_0x197b('0x6'));var rimraf=require(_0x197b('0x7'));var config=require('../../config/environment');var attributes=require(_0x197b('0x8'));var integrations=require(_0x197b('0x9'));module[_0x197b('0xa')]=function(_0x3fbdb0,_0x48b161){return _0x3fbdb0[_0x197b('0xb')](_0x197b('0xc'),attributes,{'tableName':_0x197b('0xd'),'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 dc4919c..cf5469d 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 _0xccd1=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','VtigerAccount,\x20%s,\x20%s','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','GetVtigerAccount','VtigerAccount','findAll','options','where','attributes','include','model','map','then','catch','ShowVtigerAccount','find','raw'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xccd1,0x103));var _0x1ccd=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xccd1[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x1ccd('0x0'));var util=require(_0x1ccd('0x1'));var moment=require(_0x1ccd('0x2'));var BPromise=require(_0x1ccd('0x3'));var rs=require(_0x1ccd('0x4'));var fs=require('fs');var Redis=require(_0x1ccd('0x5'));var db=require(_0x1ccd('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ccd('0x7'))(_0x1ccd('0x8'));var config=require(_0x1ccd('0x9'));var jayson=require(_0x1ccd('0xa'));var client=jayson[_0x1ccd('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x266ebf,_0x4a1664,_0x19315){return new BPromise(function(_0xb744df,_0x5bf081){return client[_0x1ccd('0xc')](_0x266ebf,_0x19315)['then'](function(_0x3b6c80){logger[_0x1ccd('0xd')](_0x1ccd('0xe'),_0x4a1664,'request\x20sent');logger[_0x1ccd('0xf')](_0x1ccd('0x10'),_0x4a1664,_0x1ccd('0x11'),JSON[_0x1ccd('0x12')](_0x3b6c80));if(_0x3b6c80[_0x1ccd('0x13')]){if(_0x3b6c80[_0x1ccd('0x13')][_0x1ccd('0x14')]===0x1f4){logger[_0x1ccd('0x13')](_0x1ccd('0xe'),_0x4a1664,_0x3b6c80[_0x1ccd('0x13')]['message']);return _0x5bf081(_0x3b6c80[_0x1ccd('0x13')]['message']);}logger['error'](_0x1ccd('0xe'),_0x4a1664,_0x3b6c80[_0x1ccd('0x13')]['message']);return _0xb744df(_0x3b6c80[_0x1ccd('0x13')][_0x1ccd('0x15')]);}else{logger[_0x1ccd('0xd')](_0x1ccd('0xe'),_0x4a1664,_0x1ccd('0x11'));_0xb744df(_0x3b6c80[_0x1ccd('0x16')][_0x1ccd('0x15')]);}})['catch'](function(_0x42e91b){logger[_0x1ccd('0x13')](_0x1ccd('0xe'),_0x4a1664,_0x42e91b);_0x5bf081(_0x42e91b);});});}exports[_0x1ccd('0x17')]=function(_0x42a7f6){var _0xbbc429=this;return new Promise(function(_0x132f62,_0x34f89e){return db[_0x1ccd('0x18')][_0x1ccd('0x19')]({'raw':_0x42a7f6[_0x1ccd('0x1a')]?_0x42a7f6[_0x1ccd('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x42a7f6[_0x1ccd('0x1a')]?_0x42a7f6[_0x1ccd('0x1a')][_0x1ccd('0x1b')]||null:null,'attributes':_0x42a7f6[_0x1ccd('0x1a')]?_0x42a7f6['options'][_0x1ccd('0x1c')]||null:null,'limit':_0x42a7f6[_0x1ccd('0x1a')]?_0x42a7f6['options']['limit']||null:null,'include':_0x42a7f6[_0x1ccd('0x1a')]?_0x42a7f6['options'][_0x1ccd('0x1d')]?_['map'](_0x42a7f6[_0x1ccd('0x1a')][_0x1ccd('0x1d')],function(_0x50a86e){return{'model':db[_0x50a86e[_0x1ccd('0x1e')]],'as':_0x50a86e['as'],'attributes':_0x50a86e['attributes'],'include':_0x50a86e[_0x1ccd('0x1d')]?_[_0x1ccd('0x1f')](_0x50a86e[_0x1ccd('0x1d')],function(_0x2c8a1c){return{'model':db[_0x2c8a1c[_0x1ccd('0x1e')]],'as':_0x2c8a1c['as'],'attributes':_0x2c8a1c[_0x1ccd('0x1c')],'include':_0x2c8a1c[_0x1ccd('0x1d')]?_[_0x1ccd('0x1f')](_0x2c8a1c[_0x1ccd('0x1d')],function(_0x1576e2){return{'model':db[_0x1576e2[_0x1ccd('0x1e')]],'as':_0x1576e2['as'],'attributes':_0x1576e2['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ccd('0x20')](function(_0x37f021){logger[_0x1ccd('0xd')]('GetVtigerAccount',_0x42a7f6);logger['debug'](_0x1ccd('0x17'),_0x42a7f6,JSON[_0x1ccd('0x12')](_0x37f021));_0x132f62(_0x37f021);})[_0x1ccd('0x21')](function(_0x56e279){logger['error'](_0x1ccd('0x17'),_0x56e279['message'],_0x42a7f6);_0x34f89e(_0xbbc429[_0x1ccd('0x13')](0x1f4,_0x56e279[_0x1ccd('0x15')]));});});};exports[_0x1ccd('0x22')]=function(_0x1da632){var _0x13775a=this;return new Promise(function(_0x24f8f3,_0x3c0aab){return db['VtigerAccount'][_0x1ccd('0x23')]({'raw':_0x1da632[_0x1ccd('0x1a')]?_0x1da632[_0x1ccd('0x1a')][_0x1ccd('0x24')]===undefined?!![]:![]:!![],'where':_0x1da632['options']?_0x1da632[_0x1ccd('0x1a')]['where']||null:null,'attributes':_0x1da632[_0x1ccd('0x1a')]?_0x1da632[_0x1ccd('0x1a')][_0x1ccd('0x1c')]||null:null,'include':_0x1da632[_0x1ccd('0x1a')]?_0x1da632[_0x1ccd('0x1a')][_0x1ccd('0x1d')]?_[_0x1ccd('0x1f')](_0x1da632['options'][_0x1ccd('0x1d')],function(_0xee23fb){return{'model':db[_0xee23fb[_0x1ccd('0x1e')]],'as':_0xee23fb['as'],'attributes':_0xee23fb[_0x1ccd('0x1c')],'include':_0xee23fb[_0x1ccd('0x1d')]?_['map'](_0xee23fb[_0x1ccd('0x1d')],function(_0x30d13f){return{'model':db[_0x30d13f[_0x1ccd('0x1e')]],'as':_0x30d13f['as'],'attributes':_0x30d13f['attributes'],'include':_0x30d13f[_0x1ccd('0x1d')]?_['map'](_0x30d13f['include'],function(_0x3ce223){return{'model':db[_0x3ce223[_0x1ccd('0x1e')]],'as':_0x3ce223['as'],'attributes':_0x3ce223['attributes']};}):[]};}):[]};}):[]:[]})[_0x1ccd('0x20')](function(_0x542d39){logger[_0x1ccd('0xd')](_0x1ccd('0x22'),_0x1da632);logger[_0x1ccd('0xf')](_0x1ccd('0x22'),_0x1da632,JSON[_0x1ccd('0x12')](_0x542d39));_0x24f8f3(_0x542d39);})['catch'](function(_0x46a593){logger[_0x1ccd('0x13')](_0x1ccd('0x22'),_0x46a593['message'],_0x1da632);_0x3c0aab(_0x13775a[_0x1ccd('0x13')](0x1f4,_0x46a593[_0x1ccd('0x15')]));});});}; \ No newline at end of file +var _0x9bc6=['then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','VtigerAccount','options','raw','where','attributes','limit','include','map','model','GetVtigerAccount','ShowVtigerAccount','find','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','client','http','request'];(function(_0x46f73c,_0x5361b0){var _0x460aec=function(_0xafd28b){while(--_0xafd28b){_0x46f73c['push'](_0x46f73c['shift']());}};_0x460aec(++_0x5361b0);}(_0x9bc6,0xdd));var _0x69bc=function(_0x3db750,_0x5d66c2){_0x3db750=_0x3db750-0x0;var _0x5427a=_0x9bc6[_0x3db750];return _0x5427a;};'use strict';var _=require('lodash');var util=require(_0x69bc('0x0'));var moment=require(_0x69bc('0x1'));var BPromise=require(_0x69bc('0x2'));var rs=require(_0x69bc('0x3'));var fs=require('fs');var Redis=require(_0x69bc('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x69bc('0x5'));var logger=require(_0x69bc('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x69bc('0x7')][_0x69bc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4324c4,_0x260499,_0x87ae44){return new BPromise(function(_0x2eccba,_0x38685d){return client[_0x69bc('0x9')](_0x4324c4,_0x87ae44)[_0x69bc('0xa')](function(_0x42cfd6){logger[_0x69bc('0xb')](_0x69bc('0xc'),_0x260499,_0x69bc('0xd'));logger[_0x69bc('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x260499,_0x69bc('0xd'),JSON[_0x69bc('0xf')](_0x42cfd6));if(_0x42cfd6[_0x69bc('0x10')]){if(_0x42cfd6[_0x69bc('0x10')][_0x69bc('0x11')]===0x1f4){logger[_0x69bc('0x10')](_0x69bc('0xc'),_0x260499,_0x42cfd6[_0x69bc('0x10')][_0x69bc('0x12')]);return _0x38685d(_0x42cfd6[_0x69bc('0x10')][_0x69bc('0x12')]);}logger['error']('VtigerAccount,\x20%s,\x20%s',_0x260499,_0x42cfd6[_0x69bc('0x10')][_0x69bc('0x12')]);return _0x2eccba(_0x42cfd6[_0x69bc('0x10')][_0x69bc('0x12')]);}else{logger[_0x69bc('0xb')](_0x69bc('0xc'),_0x260499,'request\x20sent');_0x2eccba(_0x42cfd6[_0x69bc('0x13')][_0x69bc('0x12')]);}})[_0x69bc('0x14')](function(_0xfee63){logger[_0x69bc('0x10')](_0x69bc('0xc'),_0x260499,_0xfee63);_0x38685d(_0xfee63);});});}exports['GetVtigerAccount']=function(_0xd902c9){var _0x9ecf1f=this;return new Promise(function(_0x4726a4,_0xca0f55){return db[_0x69bc('0x15')]['findAll']({'raw':_0xd902c9[_0x69bc('0x16')]?_0xd902c9['options'][_0x69bc('0x17')]===undefined?!![]:![]:!![],'where':_0xd902c9[_0x69bc('0x16')]?_0xd902c9[_0x69bc('0x16')][_0x69bc('0x18')]||null:null,'attributes':_0xd902c9[_0x69bc('0x16')]?_0xd902c9[_0x69bc('0x16')][_0x69bc('0x19')]||null:null,'limit':_0xd902c9[_0x69bc('0x16')]?_0xd902c9['options'][_0x69bc('0x1a')]||null:null,'include':_0xd902c9['options']?_0xd902c9[_0x69bc('0x16')][_0x69bc('0x1b')]?_[_0x69bc('0x1c')](_0xd902c9[_0x69bc('0x16')]['include'],function(_0x56e797){return{'model':db[_0x56e797[_0x69bc('0x1d')]],'as':_0x56e797['as'],'attributes':_0x56e797[_0x69bc('0x19')],'include':_0x56e797[_0x69bc('0x1b')]?_['map'](_0x56e797['include'],function(_0x140341){return{'model':db[_0x140341[_0x69bc('0x1d')]],'as':_0x140341['as'],'attributes':_0x140341[_0x69bc('0x19')],'include':_0x140341[_0x69bc('0x1b')]?_[_0x69bc('0x1c')](_0x140341[_0x69bc('0x1b')],function(_0xa2078e){return{'model':db[_0xa2078e[_0x69bc('0x1d')]],'as':_0xa2078e['as'],'attributes':_0xa2078e[_0x69bc('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42fc18){logger[_0x69bc('0xb')](_0x69bc('0x1e'),_0xd902c9);logger[_0x69bc('0xe')](_0x69bc('0x1e'),_0xd902c9,JSON['stringify'](_0x42fc18));_0x4726a4(_0x42fc18);})[_0x69bc('0x14')](function(_0x39b4eb){logger[_0x69bc('0x10')](_0x69bc('0x1e'),_0x39b4eb[_0x69bc('0x12')],_0xd902c9);_0xca0f55(_0x9ecf1f['error'](0x1f4,_0x39b4eb[_0x69bc('0x12')]));});});};exports[_0x69bc('0x1f')]=function(_0x2925ff){var _0x29f241=this;return new Promise(function(_0x59e60e,_0x2d44d5){return db['VtigerAccount'][_0x69bc('0x20')]({'raw':_0x2925ff[_0x69bc('0x16')]?_0x2925ff[_0x69bc('0x16')][_0x69bc('0x17')]===undefined?!![]:![]:!![],'where':_0x2925ff[_0x69bc('0x16')]?_0x2925ff['options'][_0x69bc('0x18')]||null:null,'attributes':_0x2925ff[_0x69bc('0x16')]?_0x2925ff[_0x69bc('0x16')][_0x69bc('0x19')]||null:null,'include':_0x2925ff['options']?_0x2925ff[_0x69bc('0x16')][_0x69bc('0x1b')]?_[_0x69bc('0x1c')](_0x2925ff[_0x69bc('0x16')][_0x69bc('0x1b')],function(_0xbab90){return{'model':db[_0xbab90[_0x69bc('0x1d')]],'as':_0xbab90['as'],'attributes':_0xbab90[_0x69bc('0x19')],'include':_0xbab90['include']?_[_0x69bc('0x1c')](_0xbab90['include'],function(_0x365bc6){return{'model':db[_0x365bc6['model']],'as':_0x365bc6['as'],'attributes':_0x365bc6[_0x69bc('0x19')],'include':_0x365bc6['include']?_[_0x69bc('0x1c')](_0x365bc6[_0x69bc('0x1b')],function(_0x103c42){return{'model':db[_0x103c42[_0x69bc('0x1d')]],'as':_0x103c42['as'],'attributes':_0x103c42[_0x69bc('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b70ff){logger[_0x69bc('0xb')]('ShowVtigerAccount',_0x2925ff);logger['debug']('ShowVtigerAccount',_0x2925ff,JSON[_0x69bc('0xf')](_0x4b70ff));_0x59e60e(_0x4b70ff);})[_0x69bc('0x14')](function(_0x13ac3d){logger[_0x69bc('0x10')](_0x69bc('0x1f'),_0x13ac3d['message'],_0x2925ff);_0x2d44d5(_0x29f241[_0x69bc('0x10')](0x1f4,_0x13ac3d[_0x69bc('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 8e7b92b..f427216 100644 --- a/server/api/intVtigerConfiguration/index.js +++ b/server/api/intVtigerConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x2fbf2c,_0xb5a8f9){var _0x132005=function(_0xaa95bb){while(--_0xaa95bb){_0x2fbf2c['push'](_0x2fbf2c['shift']());}};_0x132005(++_0xb5a8f9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file +var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x1e0ca5,_0x57fd4f){var _0x410923=function(_0x5bd94d){while(--_0x5bd94d){_0x1e0ca5['push'](_0x1e0ca5['shift']());}};_0x410923(++_0x57fd4f);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0d8b('0x2')]();var auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index c165c15..94b7b3a 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 _0xbd2a=['exports','STRING','sequelize'];(function(_0x6c50de,_0x2dd26a){var _0xb66288=function(_0x14bf5f){while(--_0x14bf5f){_0x6c50de['push'](_0x6c50de['shift']());}};_0xb66288(++_0x2dd26a);}(_0xbd2a,0x19d));var _0xabd2=function(_0x37d46a,_0x29f763){_0x37d46a=_0x37d46a-0x0;var _0x2ea35b=_0xbd2a[_0x37d46a];return _0x2ea35b;};'use strict';var Sequelize=require(_0xabd2('0x0'));module[_0xabd2('0x1')]={'name':{'type':Sequelize[_0xabd2('0x2')]},'description':{'type':Sequelize[_0xabd2('0x2')]}}; \ No newline at end of file +var _0x5dad=['STRING','sequelize','exports'];(function(_0x19f175,_0x16b8f8){var _0xf54c12=function(_0x4008a8){while(--_0x4008a8){_0x19f175['push'](_0x19f175['shift']());}};_0xf54c12(++_0x16b8f8);}(_0x5dad,0x88));var _0xd5da=function(_0x50b0b0,_0x88b1cc){_0x50b0b0=_0x50b0b0-0x0;var _0x9dd557=_0x5dad[_0x50b0b0];return _0x9dd557;};'use strict';var Sequelize=require(_0xd5da('0x0'));module[_0xd5da('0x1')]={'name':{'type':Sequelize[_0xd5da('0x2')]},'description':{'type':Sequelize[_0xd5da('0x2')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index ee75db6..48c1c96 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 _0xb842=['fields','length','hasOwnProperty','order','sort','pick','where','type','VIRTUAL','options','include','show','params','VtigerConfiguration','merge','create','body','find','destroy','getFields','findOne','filter','nolimit','getSubjects','VtigerField','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','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','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','rawAttributes','key','model','query','keys','filters','intersection','attributes'];(function(_0x321c7b,_0x589c78){var _0x31e12b=function(_0x2d4ded){while(--_0x2d4ded){_0x321c7b['push'](_0x321c7b['shift']());}};_0x31e12b(++_0x589c78);}(_0xb842,0x75));var _0x2b84=function(_0x5c7a85,_0x41dd19){_0x5c7a85=_0x5c7a85-0x0;var _0x35290f=_0xb842[_0x5c7a85];return _0x35290f;};'use strict';var pdf=require(_0x2b84('0x0'));var emlformat=require(_0x2b84('0x1'));var rimraf=require(_0x2b84('0x2'));var zipdir=require(_0x2b84('0x3'));var jsonpatch=require(_0x2b84('0x4'));var rp=require(_0x2b84('0x5'));var moment=require('moment');var BPromise=require(_0x2b84('0x6'));var Mustache=require(_0x2b84('0x7'));var util=require(_0x2b84('0x8'));var path=require('path');var sox=require(_0x2b84('0x9'));var csv=require(_0x2b84('0xa'));var ejs=require(_0x2b84('0xb'));var fs=require('fs');var _=require(_0x2b84('0xc'));var squel=require('squel');var crypto=require(_0x2b84('0xd'));var jsforce=require(_0x2b84('0xe'));var deskjs=require(_0x2b84('0xf'));var toCsv=require(_0x2b84('0xa'));var querystring=require(_0x2b84('0x10'));var Papa=require(_0x2b84('0x11'));var Redis=require(_0x2b84('0x12'));var authService=require(_0x2b84('0x13'));var qs=require(_0x2b84('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2b84('0x15'));var logger=require('../../config/logger')(_0x2b84('0x16'));var utils=require(_0x2b84('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson[_0x2b84('0x18')][_0x2b84('0x19')]({'port':0x232a});function checkPasswordPattern(_0x306c7f,_0x488a86,_0x2c7116){if(_0x2c7116){var _0x11a486=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x11a486['test'](_0x488a86)){return _0x306c7f;}else{throw new db[(_0x2b84('0x1a'))][(_0x2b84('0x1b'))](_0x2b84('0x1c'));}}else{return _0x306c7f;}}function respondWithRpcPromise(_0x2550f1,_0x4ac5cd,_0x34995e,_0x4310c0){return new BPromise(function(_0x5a3684,_0x59cf12){var _0x53f2f8=_0x4310c0||client;return _0x53f2f8['request'](_0x2550f1,_0x34995e)[_0x2b84('0x1d')](function(_0x2028f2){logger[_0x2b84('0x1e')](_0x2b84('0x1f'),_0x4ac5cd,_0x2b84('0x20'));logger[_0x2b84('0x21')](_0x2b84('0x22'),_0x4ac5cd,'request\x20sent',JSON[_0x2b84('0x23')](_0x2028f2));if(_0x2028f2[_0x2b84('0x24')]){if(_0x2028f2[_0x2b84('0x24')][_0x2b84('0x25')]===0x1f4){logger[_0x2b84('0x24')](_0x2b84('0x1f'),_0x4ac5cd,_0x2028f2[_0x2b84('0x24')][_0x2b84('0x26')]);return _0x59cf12(_0x2028f2['error'][_0x2b84('0x26')]);}logger[_0x2b84('0x24')](_0x2b84('0x1f'),_0x4ac5cd,_0x2028f2[_0x2b84('0x24')][_0x2b84('0x26')]);return _0x5a3684(_0x2028f2[_0x2b84('0x24')][_0x2b84('0x26')]);}else{logger[_0x2b84('0x1e')](_0x2b84('0x1f'),_0x4ac5cd,_0x2b84('0x20'));_0x5a3684(_0x2028f2['result'][_0x2b84('0x26')]);}})[_0x2b84('0x27')](function(_0x53af14){logger[_0x2b84('0x24')](_0x2b84('0x1f'),_0x4ac5cd,_0x53af14);_0x59cf12(_0x53af14);});});}function respondWithStatusCode(_0x237257,_0x5d25cd){_0x5d25cd=_0x5d25cd||0xcc;return function(_0x1be14a){if(_0x1be14a){return _0x237257['sendStatus'](_0x5d25cd);}return _0x237257[_0x2b84('0x28')](_0x5d25cd)[_0x2b84('0x29')]();};}function respondWithResult(_0x202a09,_0x29a141){_0x29a141=_0x29a141||0xc8;return function(_0x2e81ee){if(_0x2e81ee){return _0x202a09[_0x2b84('0x28')](_0x29a141)[_0x2b84('0x2a')](_0x2e81ee);}};}function respondWithFilteredResult(_0x463575,_0x4be827){return function(_0x58c208){if(_0x58c208){var _0x529a0f=_0x58c208[_0x2b84('0x2b')],_0x350654=_0x4be827[_0x2b84('0x2c')],_0x23db5f=_0x4be827[_0x2b84('0x2c')]+_0x4be827[_0x2b84('0x2d')],_0x21fce4;if(_0x23db5f>=_0x529a0f){_0x23db5f=_0x529a0f;_0x21fce4=0xc8;}else{_0x21fce4=0xce;}_0x463575[_0x2b84('0x28')](_0x21fce4);return _0x463575[_0x2b84('0x2e')](_0x2b84('0x2f'),_0x350654+'-'+_0x23db5f+'/'+_0x529a0f)[_0x2b84('0x2a')](_0x58c208);}return null;};}function patchUpdates(_0xd8535d){return function(_0x11d025){try{jsonpatch[_0x2b84('0x30')](_0x11d025,_0xd8535d,!![]);}catch(_0x169e37){return BPromise[_0x2b84('0x31')](_0x169e37);}return _0x11d025[_0x2b84('0x32')]();};}function saveUpdates(_0x4869f5,_0x1156fb){return function(_0x5068fe){if(_0x5068fe){return _0x5068fe[_0x2b84('0x33')](_0x4869f5)[_0x2b84('0x1d')](function(_0x545a7b){return _0x545a7b;});}return null;};}function removeEntity(_0x3ca507,_0x30f266){return function(_0x102ece){if(_0x102ece){return _0x102ece['destroy']()[_0x2b84('0x1d')](function(){_0x3ca507['status'](0xcc)[_0x2b84('0x29')]();});}};}function handleEntityNotFound(_0x204acb,_0x260f42){return function(_0x2953ca){if(!_0x2953ca){_0x204acb['sendStatus'](0x194);}return _0x2953ca;};}function handleError(_0x285f3a,_0x2319fb){_0x2319fb=_0x2319fb||0x1f4;return function(_0x42f7db){logger['error'](_0x42f7db[_0x2b84('0x34')]);if(_0x42f7db[_0x2b84('0x35')]){delete _0x42f7db[_0x2b84('0x35')];}_0x285f3a[_0x2b84('0x28')](_0x2319fb)[_0x2b84('0x36')](_0x42f7db);};}exports[_0x2b84('0x37')]=function(_0x1521e9,_0x5be405){var _0x28490a={},_0x22f152={},_0xd50ab9={'count':0x0,'rows':[]};var _0x35a4f5=_[_0x2b84('0x38')](db['VtigerConfiguration'][_0x2b84('0x39')],function(_0x552855){return{'name':_0x552855['fieldName'],'type':_0x552855['type'][_0x2b84('0x3a')]};});_0x22f152[_0x2b84('0x3b')]=_[_0x2b84('0x38')](_0x35a4f5,_0x2b84('0x35'));_0x22f152[_0x2b84('0x3c')]=_[_0x2b84('0x3d')](_0x1521e9[_0x2b84('0x3c')]);_0x22f152[_0x2b84('0x3e')]=_[_0x2b84('0x3f')](_0x22f152[_0x2b84('0x3b')],_0x22f152[_0x2b84('0x3c')]);_0x28490a[_0x2b84('0x40')]=_['intersection'](_0x22f152[_0x2b84('0x3b')],qs[_0x2b84('0x41')](_0x1521e9[_0x2b84('0x3c')]['fields']));_0x28490a[_0x2b84('0x40')]=_0x28490a[_0x2b84('0x40')][_0x2b84('0x42')]?_0x28490a['attributes']:_0x22f152[_0x2b84('0x3b')];if(!_0x1521e9[_0x2b84('0x3c')][_0x2b84('0x43')]('nolimit')){_0x28490a['limit']=qs[_0x2b84('0x2d')](_0x1521e9['query'][_0x2b84('0x2d')]);_0x28490a[_0x2b84('0x2c')]=qs[_0x2b84('0x2c')](_0x1521e9[_0x2b84('0x3c')][_0x2b84('0x2c')]);}_0x28490a[_0x2b84('0x44')]=qs['sort'](_0x1521e9[_0x2b84('0x3c')][_0x2b84('0x45')]);_0x28490a['where']=qs[_0x2b84('0x3e')](_[_0x2b84('0x46')](_0x1521e9[_0x2b84('0x3c')],_0x22f152[_0x2b84('0x3e')]));if(_0x1521e9[_0x2b84('0x3c')]['filter']){_0x28490a[_0x2b84('0x47')]=_['merge'](_0x28490a[_0x2b84('0x47')],{'$or':_['map'](_0x35a4f5,function(_0x4b877f){if(_0x4b877f[_0x2b84('0x48')]!==_0x2b84('0x49')){var _0x4324d1={};_0x4324d1[_0x4b877f['name']]={'$like':'%'+_0x1521e9['query']['filter']+'%'};return _0x4324d1;}})});}_0x28490a=_['merge']({},_0x28490a,_0x1521e9[_0x2b84('0x4a')]);var _0xdf2988={'where':_0x28490a[_0x2b84('0x47')]};return db['VtigerConfiguration'][_0x2b84('0x2b')](_0xdf2988)['then'](function(_0x57822d){_0xd50ab9[_0x2b84('0x2b')]=_0x57822d;if(_0x1521e9[_0x2b84('0x3c')]['includeAll']){_0x28490a[_0x2b84('0x4b')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x28490a);})[_0x2b84('0x1d')](function(_0x2283de){_0xd50ab9['rows']=_0x2283de;return _0xd50ab9;})[_0x2b84('0x1d')](respondWithFilteredResult(_0x5be405,_0x28490a))[_0x2b84('0x27')](handleError(_0x5be405,null));};exports[_0x2b84('0x4c')]=function(_0x1fb46e,_0x3c5588){var _0x5d2e7a={'raw':![],'where':{'id':_0x1fb46e[_0x2b84('0x4d')]['id']}},_0x1e01dc={};_0x1e01dc[_0x2b84('0x3b')]=_[_0x2b84('0x3d')](db[_0x2b84('0x4e')][_0x2b84('0x39')]);_0x1e01dc[_0x2b84('0x3c')]=_['keys'](_0x1fb46e['query']);_0x1e01dc[_0x2b84('0x3e')]=_[_0x2b84('0x3f')](_0x1e01dc['model'],_0x1e01dc[_0x2b84('0x3c')]);_0x5d2e7a[_0x2b84('0x40')]=_[_0x2b84('0x3f')](_0x1e01dc[_0x2b84('0x3b')],qs[_0x2b84('0x41')](_0x1fb46e[_0x2b84('0x3c')][_0x2b84('0x41')]));_0x5d2e7a[_0x2b84('0x40')]=_0x5d2e7a['attributes'][_0x2b84('0x42')]?_0x5d2e7a[_0x2b84('0x40')]:_0x1e01dc['model'];if(_0x1fb46e['query']['includeAll']){_0x5d2e7a[_0x2b84('0x4b')]=[{'all':!![]}];}_0x5d2e7a=_[_0x2b84('0x4f')]({},_0x5d2e7a,_0x1fb46e['options']);return db['VtigerConfiguration']['find'](_0x5d2e7a)[_0x2b84('0x1d')](handleEntityNotFound(_0x3c5588,null))['then'](respondWithResult(_0x3c5588,null))[_0x2b84('0x27')](handleError(_0x3c5588,null));};exports[_0x2b84('0x50')]=function(_0x10482e,_0x5d6468){return db['VtigerConfiguration'][_0x2b84('0x50')](_0x10482e['body'],{})['then'](respondWithResult(_0x5d6468,0xc9))[_0x2b84('0x27')](handleError(_0x5d6468,null));};exports[_0x2b84('0x33')]=function(_0x5e2e39,_0x2595bd){if(_0x5e2e39[_0x2b84('0x51')]['id']){delete _0x5e2e39['body']['id'];}return db['VtigerConfiguration'][_0x2b84('0x52')]({'where':{'id':_0x5e2e39[_0x2b84('0x4d')]['id']}})['then'](handleEntityNotFound(_0x2595bd,null))['then'](saveUpdates(_0x5e2e39[_0x2b84('0x51')],null))[_0x2b84('0x1d')](respondWithResult(_0x2595bd,null))['catch'](handleError(_0x2595bd,null));};exports[_0x2b84('0x53')]=function(_0x934c1a,_0x4d766d){return db['VtigerConfiguration'][_0x2b84('0x52')]({'where':{'id':_0x934c1a['params']['id']}})['then'](handleEntityNotFound(_0x4d766d,null))[_0x2b84('0x1d')](removeEntity(_0x4d766d,null))[_0x2b84('0x27')](handleError(_0x4d766d,null));};exports[_0x2b84('0x54')]=function(_0x49840e,_0x57f278,_0x2d74b4){var _0x457f2c={};var _0x937e6={};var _0x40fdf9;var _0x5c4a46;return db['VtigerConfiguration'][_0x2b84('0x55')]({'where':{'id':_0x49840e[_0x2b84('0x4d')]['id']}})['then'](handleEntityNotFound(_0x57f278,null))[_0x2b84('0x1d')](function(_0x589580){if(_0x589580){_0x40fdf9=_0x589580;_0x937e6[_0x2b84('0x3b')]=_[_0x2b84('0x3d')](db['VtigerField'][_0x2b84('0x39')]);_0x937e6[_0x2b84('0x3c')]=_['keys'](_0x49840e[_0x2b84('0x3c')]);_0x937e6[_0x2b84('0x3e')]=_['intersection'](_0x937e6[_0x2b84('0x3b')],_0x937e6['query']);_0x457f2c[_0x2b84('0x40')]=_[_0x2b84('0x3f')](_0x937e6[_0x2b84('0x3b')],qs['fields'](_0x49840e[_0x2b84('0x3c')][_0x2b84('0x41')]));_0x457f2c[_0x2b84('0x40')]=_0x457f2c[_0x2b84('0x40')][_0x2b84('0x42')]?_0x457f2c['attributes']:_0x937e6['model'];_0x457f2c[_0x2b84('0x44')]=qs['sort'](_0x49840e[_0x2b84('0x3c')][_0x2b84('0x45')]);_0x457f2c[_0x2b84('0x47')]=qs['filters'](_[_0x2b84('0x46')](_0x49840e[_0x2b84('0x3c')],_0x937e6['filters']));if(_0x49840e[_0x2b84('0x3c')][_0x2b84('0x56')]){_0x457f2c[_0x2b84('0x47')]=_['merge'](_0x457f2c['where'],{'$or':_[_0x2b84('0x38')](_0x457f2c['attributes'],function(_0x7ae1e){var _0x58c4d8={};_0x58c4d8[_0x7ae1e]={'$like':'%'+_0x49840e[_0x2b84('0x3c')]['filter']+'%'};return _0x58c4d8;})});}_0x457f2c=_[_0x2b84('0x4f')]({},_0x457f2c,_0x49840e['options']);return _0x40fdf9[_0x2b84('0x54')](_0x457f2c);}})[_0x2b84('0x1d')](function(_0x2c7747){if(_0x2c7747){_0x5c4a46=_0x2c7747[_0x2b84('0x42')];if(!_0x49840e['query'][_0x2b84('0x43')](_0x2b84('0x57'))){_0x457f2c[_0x2b84('0x2d')]=qs[_0x2b84('0x2d')](_0x49840e[_0x2b84('0x3c')]['limit']);_0x457f2c[_0x2b84('0x2c')]=qs['offset'](_0x49840e[_0x2b84('0x3c')][_0x2b84('0x2c')]);}return _0x40fdf9[_0x2b84('0x54')](_0x457f2c);}})[_0x2b84('0x1d')](function(_0x4fdfea){if(_0x4fdfea){return _0x4fdfea?{'count':_0x5c4a46,'rows':_0x4fdfea}:null;}})[_0x2b84('0x1d')](respondWithResult(_0x57f278,null))['catch'](handleError(_0x57f278,null));};exports[_0x2b84('0x58')]=function(_0x7f9102,_0x25524a,_0x43a3da){var _0x3d3b6c={};var _0x35e5d3={};var _0x39c7ee;var _0x3df7b1;return db[_0x2b84('0x4e')][_0x2b84('0x55')]({'where':{'id':_0x7f9102[_0x2b84('0x4d')]['id']}})['then'](handleEntityNotFound(_0x25524a,null))[_0x2b84('0x1d')](function(_0x4c556c){if(_0x4c556c){_0x39c7ee=_0x4c556c;_0x35e5d3[_0x2b84('0x3b')]=_[_0x2b84('0x3d')](db[_0x2b84('0x59')][_0x2b84('0x39')]);_0x35e5d3[_0x2b84('0x3c')]=_[_0x2b84('0x3d')](_0x7f9102[_0x2b84('0x3c')]);_0x35e5d3[_0x2b84('0x3e')]=_[_0x2b84('0x3f')](_0x35e5d3[_0x2b84('0x3b')],_0x35e5d3[_0x2b84('0x3c')]);_0x3d3b6c['attributes']=_[_0x2b84('0x3f')](_0x35e5d3['model'],qs[_0x2b84('0x41')](_0x7f9102[_0x2b84('0x3c')][_0x2b84('0x41')]));_0x3d3b6c[_0x2b84('0x40')]=_0x3d3b6c[_0x2b84('0x40')][_0x2b84('0x42')]?_0x3d3b6c['attributes']:_0x35e5d3[_0x2b84('0x3b')];_0x3d3b6c[_0x2b84('0x44')]=qs[_0x2b84('0x45')](_0x7f9102[_0x2b84('0x3c')][_0x2b84('0x45')]);_0x3d3b6c['where']=qs[_0x2b84('0x3e')](_[_0x2b84('0x46')](_0x7f9102['query'],_0x35e5d3[_0x2b84('0x3e')]));if(_0x7f9102[_0x2b84('0x3c')][_0x2b84('0x56')]){_0x3d3b6c[_0x2b84('0x47')]=_['merge'](_0x3d3b6c['where'],{'$or':_['map'](_0x3d3b6c[_0x2b84('0x40')],function(_0x2f1333){var _0x3a09e3={};_0x3a09e3[_0x2f1333]={'$like':'%'+_0x7f9102[_0x2b84('0x3c')]['filter']+'%'};return _0x3a09e3;})});}_0x3d3b6c=_[_0x2b84('0x4f')]({},_0x3d3b6c,_0x7f9102[_0x2b84('0x4a')]);return _0x39c7ee['getSubjects'](_0x3d3b6c);}})[_0x2b84('0x1d')](function(_0x5057c2){if(_0x5057c2){_0x3df7b1=_0x5057c2[_0x2b84('0x42')];if(!_0x7f9102['query'][_0x2b84('0x43')]('nolimit')){_0x3d3b6c[_0x2b84('0x2d')]=qs[_0x2b84('0x2d')](_0x7f9102[_0x2b84('0x3c')][_0x2b84('0x2d')]);_0x3d3b6c['offset']=qs[_0x2b84('0x2c')](_0x7f9102['query'][_0x2b84('0x2c')]);}return _0x39c7ee[_0x2b84('0x58')](_0x3d3b6c);}})[_0x2b84('0x1d')](function(_0xebbf0c){if(_0xebbf0c){return _0xebbf0c?{'count':_0x3df7b1,'rows':_0xebbf0c}:null;}})[_0x2b84('0x1d')](respondWithResult(_0x25524a,null))[_0x2b84('0x27')](handleError(_0x25524a,null));};exports[_0x2b84('0x5a')]=function(_0x5af3fe,_0x544691,_0x2cae90){var _0x299402={};var _0x4911ce={};var _0x1a6dd3;var _0x563514;return db[_0x2b84('0x4e')][_0x2b84('0x55')]({'where':{'id':_0x5af3fe[_0x2b84('0x4d')]['id']}})['then'](handleEntityNotFound(_0x544691,null))[_0x2b84('0x1d')](function(_0x48e05e){if(_0x48e05e){_0x1a6dd3=_0x48e05e;_0x4911ce[_0x2b84('0x3b')]=_[_0x2b84('0x3d')](db[_0x2b84('0x59')][_0x2b84('0x39')]);_0x4911ce['query']=_[_0x2b84('0x3d')](_0x5af3fe[_0x2b84('0x3c')]);_0x4911ce[_0x2b84('0x3e')]=_[_0x2b84('0x3f')](_0x4911ce['model'],_0x4911ce[_0x2b84('0x3c')]);_0x299402[_0x2b84('0x40')]=_[_0x2b84('0x3f')](_0x4911ce[_0x2b84('0x3b')],qs[_0x2b84('0x41')](_0x5af3fe[_0x2b84('0x3c')][_0x2b84('0x41')]));_0x299402[_0x2b84('0x40')]=_0x299402['attributes'][_0x2b84('0x42')]?_0x299402[_0x2b84('0x40')]:_0x4911ce[_0x2b84('0x3b')];_0x299402['order']=qs[_0x2b84('0x45')](_0x5af3fe['query'][_0x2b84('0x45')]);_0x299402[_0x2b84('0x47')]=qs[_0x2b84('0x3e')](_[_0x2b84('0x46')](_0x5af3fe[_0x2b84('0x3c')],_0x4911ce['filters']));if(_0x5af3fe[_0x2b84('0x3c')]['filter']){_0x299402[_0x2b84('0x47')]=_[_0x2b84('0x4f')](_0x299402[_0x2b84('0x47')],{'$or':_['map'](_0x299402['attributes'],function(_0x2982fc){var _0x4fb717={};_0x4fb717[_0x2982fc]={'$like':'%'+_0x5af3fe[_0x2b84('0x3c')]['filter']+'%'};return _0x4fb717;})});}_0x299402=_[_0x2b84('0x4f')]({},_0x299402,_0x5af3fe[_0x2b84('0x4a')]);return _0x1a6dd3[_0x2b84('0x5a')](_0x299402);}})[_0x2b84('0x1d')](function(_0x3726b7){if(_0x3726b7){_0x563514=_0x3726b7['length'];if(!_0x5af3fe[_0x2b84('0x3c')]['hasOwnProperty'](_0x2b84('0x57'))){_0x299402['limit']=qs[_0x2b84('0x2d')](_0x5af3fe[_0x2b84('0x3c')][_0x2b84('0x2d')]);_0x299402[_0x2b84('0x2c')]=qs[_0x2b84('0x2c')](_0x5af3fe[_0x2b84('0x3c')]['offset']);}return _0x1a6dd3[_0x2b84('0x5a')](_0x299402);}})[_0x2b84('0x1d')](function(_0x1f0481){if(_0x1f0481){return _0x1f0481?{'count':_0x563514,'rows':_0x1f0481}:null;}})[_0x2b84('0x1d')](respondWithResult(_0x544691,null))['catch'](handleError(_0x544691,null));}; \ No newline at end of file +var _0x86eb=['filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','show','params','find','create','body','getFields','findOne','VtigerField','rawAttributes','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','request\x20sent','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','catch','status','end','offset','Content-Range','json','reject','update','then','destroy','sendStatus','name','send','index','map','VtigerConfiguration','fieldName','type','key','model','query','keys'];(function(_0x32dfb2,_0x20f075){var _0x3c64ec=function(_0x5049ed){while(--_0x5049ed){_0x32dfb2['push'](_0x32dfb2['shift']());}};_0x3c64ec(++_0x20f075);}(_0x86eb,0x123));var _0xb86e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x86eb[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xb86e('0x0'));var emlformat=require(_0xb86e('0x1'));var rimraf=require(_0xb86e('0x2'));var zipdir=require(_0xb86e('0x3'));var jsonpatch=require(_0xb86e('0x4'));var rp=require(_0xb86e('0x5'));var moment=require(_0xb86e('0x6'));var BPromise=require(_0xb86e('0x7'));var Mustache=require(_0xb86e('0x8'));var util=require(_0xb86e('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xb86e('0xa'));var ejs=require(_0xb86e('0xb'));var fs=require('fs');var _=require(_0xb86e('0xc'));var squel=require(_0xb86e('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb86e('0xa'));var querystring=require(_0xb86e('0xe'));var Papa=require('papaparse');var Redis=require(_0xb86e('0xf'));var authService=require(_0xb86e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb86e('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xb86e('0x12'));var config=require(_0xb86e('0x13'));var db=require(_0xb86e('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xb86e('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x2616a0,_0x4758f2,_0x42f1df){if(_0x42f1df){var _0x46dace=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x46dace[_0xb86e('0x16')](_0x4758f2)){return _0x2616a0;}else{throw new db[(_0xb86e('0x17'))][(_0xb86e('0x18'))](_0xb86e('0x19'));}}else{return _0x2616a0;}}function respondWithRpcPromise(_0x16d7ba,_0x36998f,_0xa6c1ed,_0x48abdc){return new BPromise(function(_0x3a4cca,_0x25689a){var _0xc7a28=_0x48abdc||client;return _0xc7a28[_0xb86e('0x1a')](_0x16d7ba,_0xa6c1ed)['then'](function(_0x4cdadc){logger[_0xb86e('0x1b')]('VtigerConfiguration,\x20%s,\x20%s',_0x36998f,_0xb86e('0x1c'));logger['debug']('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x36998f,'request\x20sent',JSON[_0xb86e('0x1d')](_0x4cdadc));if(_0x4cdadc[_0xb86e('0x1e')]){if(_0x4cdadc['error'][_0xb86e('0x1f')]===0x1f4){logger[_0xb86e('0x1e')](_0xb86e('0x20'),_0x36998f,_0x4cdadc[_0xb86e('0x1e')][_0xb86e('0x21')]);return _0x25689a(_0x4cdadc[_0xb86e('0x1e')][_0xb86e('0x21')]);}logger['error'](_0xb86e('0x20'),_0x36998f,_0x4cdadc[_0xb86e('0x1e')][_0xb86e('0x21')]);return _0x3a4cca(_0x4cdadc[_0xb86e('0x1e')]['message']);}else{logger['info'](_0xb86e('0x20'),_0x36998f,_0xb86e('0x1c'));_0x3a4cca(_0x4cdadc[_0xb86e('0x22')][_0xb86e('0x21')]);}})[_0xb86e('0x23')](function(_0x3d72bb){logger[_0xb86e('0x1e')](_0xb86e('0x20'),_0x36998f,_0x3d72bb);_0x25689a(_0x3d72bb);});});}function respondWithStatusCode(_0x221db0,_0x4ce385){_0x4ce385=_0x4ce385||0xcc;return function(_0x1ccbc1){if(_0x1ccbc1){return _0x221db0['sendStatus'](_0x4ce385);}return _0x221db0[_0xb86e('0x24')](_0x4ce385)[_0xb86e('0x25')]();};}function respondWithResult(_0x15561f,_0x440ed5){_0x440ed5=_0x440ed5||0xc8;return function(_0x36ed4a){if(_0x36ed4a){return _0x15561f[_0xb86e('0x24')](_0x440ed5)['json'](_0x36ed4a);}};}function respondWithFilteredResult(_0x4f66a0,_0x2ba678){return function(_0x50eb44){if(_0x50eb44){var _0x11afcb=_0x50eb44['count'],_0x18b50b=_0x2ba678[_0xb86e('0x26')],_0x2473fe=_0x2ba678[_0xb86e('0x26')]+_0x2ba678['limit'],_0x35ac3a;if(_0x2473fe>=_0x11afcb){_0x2473fe=_0x11afcb;_0x35ac3a=0xc8;}else{_0x35ac3a=0xce;}_0x4f66a0[_0xb86e('0x24')](_0x35ac3a);return _0x4f66a0['set'](_0xb86e('0x27'),_0x18b50b+'-'+_0x2473fe+'/'+_0x11afcb)[_0xb86e('0x28')](_0x50eb44);}return null;};}function patchUpdates(_0xa2820c){return function(_0x506c7c){try{jsonpatch['apply'](_0x506c7c,_0xa2820c,!![]);}catch(_0x460dca){return BPromise[_0xb86e('0x29')](_0x460dca);}return _0x506c7c['save']();};}function saveUpdates(_0x95069d,_0x19f9a2){return function(_0x1866f8){if(_0x1866f8){return _0x1866f8[_0xb86e('0x2a')](_0x95069d)[_0xb86e('0x2b')](function(_0x3a60cd){return _0x3a60cd;});}return null;};}function removeEntity(_0x2f177e,_0x3002f0){return function(_0x48d5f7){if(_0x48d5f7){return _0x48d5f7[_0xb86e('0x2c')]()[_0xb86e('0x2b')](function(){_0x2f177e['status'](0xcc)[_0xb86e('0x25')]();});}};}function handleEntityNotFound(_0x912617,_0x47629b){return function(_0x3f4e25){if(!_0x3f4e25){_0x912617[_0xb86e('0x2d')](0x194);}return _0x3f4e25;};}function handleError(_0x5302be,_0x562d4a){_0x562d4a=_0x562d4a||0x1f4;return function(_0x3c3d5f){logger['error'](_0x3c3d5f['stack']);if(_0x3c3d5f[_0xb86e('0x2e')]){delete _0x3c3d5f[_0xb86e('0x2e')];}_0x5302be[_0xb86e('0x24')](_0x562d4a)[_0xb86e('0x2f')](_0x3c3d5f);};}exports[_0xb86e('0x30')]=function(_0x3a36ed,_0x513de8){var _0x3a855b={},_0x50c442={},_0x2a74de={'count':0x0,'rows':[]};var _0x25d7e6=_[_0xb86e('0x31')](db[_0xb86e('0x32')]['rawAttributes'],function(_0x77110e){return{'name':_0x77110e[_0xb86e('0x33')],'type':_0x77110e[_0xb86e('0x34')][_0xb86e('0x35')]};});_0x50c442[_0xb86e('0x36')]=_[_0xb86e('0x31')](_0x25d7e6,_0xb86e('0x2e'));_0x50c442[_0xb86e('0x37')]=_[_0xb86e('0x38')](_0x3a36ed[_0xb86e('0x37')]);_0x50c442[_0xb86e('0x39')]=_[_0xb86e('0x3a')](_0x50c442[_0xb86e('0x36')],_0x50c442[_0xb86e('0x37')]);_0x3a855b['attributes']=_[_0xb86e('0x3a')](_0x50c442['model'],qs['fields'](_0x3a36ed[_0xb86e('0x37')][_0xb86e('0x3b')]));_0x3a855b[_0xb86e('0x3c')]=_0x3a855b[_0xb86e('0x3c')][_0xb86e('0x3d')]?_0x3a855b[_0xb86e('0x3c')]:_0x50c442[_0xb86e('0x36')];if(!_0x3a36ed[_0xb86e('0x37')]['hasOwnProperty'](_0xb86e('0x3e'))){_0x3a855b[_0xb86e('0x3f')]=qs['limit'](_0x3a36ed['query']['limit']);_0x3a855b['offset']=qs['offset'](_0x3a36ed['query']['offset']);}_0x3a855b[_0xb86e('0x40')]=qs['sort'](_0x3a36ed[_0xb86e('0x37')][_0xb86e('0x41')]);_0x3a855b[_0xb86e('0x42')]=qs[_0xb86e('0x39')](_[_0xb86e('0x43')](_0x3a36ed[_0xb86e('0x37')],_0x50c442['filters']));if(_0x3a36ed[_0xb86e('0x37')][_0xb86e('0x44')]){_0x3a855b[_0xb86e('0x42')]=_[_0xb86e('0x45')](_0x3a855b[_0xb86e('0x42')],{'$or':_[_0xb86e('0x31')](_0x25d7e6,function(_0x5b1990){if(_0x5b1990[_0xb86e('0x34')]!=='VIRTUAL'){var _0x13290c={};_0x13290c[_0x5b1990[_0xb86e('0x2e')]]={'$like':'%'+_0x3a36ed[_0xb86e('0x37')][_0xb86e('0x44')]+'%'};return _0x13290c;}})});}_0x3a855b=_['merge']({},_0x3a855b,_0x3a36ed[_0xb86e('0x46')]);var _0x4c76e2={'where':_0x3a855b[_0xb86e('0x42')]};return db[_0xb86e('0x32')][_0xb86e('0x47')](_0x4c76e2)[_0xb86e('0x2b')](function(_0x22b810){_0x2a74de['count']=_0x22b810;if(_0x3a36ed[_0xb86e('0x37')][_0xb86e('0x48')]){_0x3a855b[_0xb86e('0x49')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0xb86e('0x4a')](_0x3a855b);})['then'](function(_0x88fe0a){_0x2a74de['rows']=_0x88fe0a;return _0x2a74de;})[_0xb86e('0x2b')](respondWithFilteredResult(_0x513de8,_0x3a855b))[_0xb86e('0x23')](handleError(_0x513de8,null));};exports[_0xb86e('0x4b')]=function(_0x46cad6,_0x24aa69){var _0x397346={'raw':![],'where':{'id':_0x46cad6[_0xb86e('0x4c')]['id']}},_0x1fc997={};_0x1fc997['model']=_['keys'](db[_0xb86e('0x32')]['rawAttributes']);_0x1fc997[_0xb86e('0x37')]=_[_0xb86e('0x38')](_0x46cad6[_0xb86e('0x37')]);_0x1fc997['filters']=_[_0xb86e('0x3a')](_0x1fc997[_0xb86e('0x36')],_0x1fc997[_0xb86e('0x37')]);_0x397346['attributes']=_[_0xb86e('0x3a')](_0x1fc997[_0xb86e('0x36')],qs['fields'](_0x46cad6['query'][_0xb86e('0x3b')]));_0x397346['attributes']=_0x397346[_0xb86e('0x3c')][_0xb86e('0x3d')]?_0x397346[_0xb86e('0x3c')]:_0x1fc997[_0xb86e('0x36')];if(_0x46cad6[_0xb86e('0x37')][_0xb86e('0x48')]){_0x397346['include']=[{'all':!![]}];}_0x397346=_[_0xb86e('0x45')]({},_0x397346,_0x46cad6['options']);return db['VtigerConfiguration'][_0xb86e('0x4d')](_0x397346)[_0xb86e('0x2b')](handleEntityNotFound(_0x24aa69,null))['then'](respondWithResult(_0x24aa69,null))[_0xb86e('0x23')](handleError(_0x24aa69,null));};exports[_0xb86e('0x4e')]=function(_0x37e1c2,_0x5d303d){return db['VtigerConfiguration'][_0xb86e('0x4e')](_0x37e1c2[_0xb86e('0x4f')],{})[_0xb86e('0x2b')](respondWithResult(_0x5d303d,0xc9))[_0xb86e('0x23')](handleError(_0x5d303d,null));};exports['update']=function(_0x3ba42a,_0x11c1f7){if(_0x3ba42a[_0xb86e('0x4f')]['id']){delete _0x3ba42a[_0xb86e('0x4f')]['id'];}return db['VtigerConfiguration'][_0xb86e('0x4d')]({'where':{'id':_0x3ba42a['params']['id']}})[_0xb86e('0x2b')](handleEntityNotFound(_0x11c1f7,null))[_0xb86e('0x2b')](saveUpdates(_0x3ba42a['body'],null))[_0xb86e('0x2b')](respondWithResult(_0x11c1f7,null))[_0xb86e('0x23')](handleError(_0x11c1f7,null));};exports[_0xb86e('0x2c')]=function(_0x5b6def,_0x309c0b){return db[_0xb86e('0x32')][_0xb86e('0x4d')]({'where':{'id':_0x5b6def[_0xb86e('0x4c')]['id']}})[_0xb86e('0x2b')](handleEntityNotFound(_0x309c0b,null))[_0xb86e('0x2b')](removeEntity(_0x309c0b,null))[_0xb86e('0x23')](handleError(_0x309c0b,null));};exports[_0xb86e('0x50')]=function(_0xc89536,_0x55d2cf,_0xee53ed){var _0x30d7c3={};var _0x581a9b={};var _0x14a474;var _0x38c904;return db['VtigerConfiguration'][_0xb86e('0x51')]({'where':{'id':_0xc89536[_0xb86e('0x4c')]['id']}})[_0xb86e('0x2b')](handleEntityNotFound(_0x55d2cf,null))[_0xb86e('0x2b')](function(_0x13f120){if(_0x13f120){_0x14a474=_0x13f120;_0x581a9b['model']=_[_0xb86e('0x38')](db[_0xb86e('0x52')][_0xb86e('0x53')]);_0x581a9b[_0xb86e('0x37')]=_['keys'](_0xc89536[_0xb86e('0x37')]);_0x581a9b[_0xb86e('0x39')]=_['intersection'](_0x581a9b['model'],_0x581a9b[_0xb86e('0x37')]);_0x30d7c3[_0xb86e('0x3c')]=_[_0xb86e('0x3a')](_0x581a9b[_0xb86e('0x36')],qs[_0xb86e('0x3b')](_0xc89536[_0xb86e('0x37')][_0xb86e('0x3b')]));_0x30d7c3[_0xb86e('0x3c')]=_0x30d7c3[_0xb86e('0x3c')][_0xb86e('0x3d')]?_0x30d7c3[_0xb86e('0x3c')]:_0x581a9b[_0xb86e('0x36')];_0x30d7c3[_0xb86e('0x40')]=qs[_0xb86e('0x41')](_0xc89536[_0xb86e('0x37')][_0xb86e('0x41')]);_0x30d7c3[_0xb86e('0x42')]=qs[_0xb86e('0x39')](_[_0xb86e('0x43')](_0xc89536['query'],_0x581a9b[_0xb86e('0x39')]));if(_0xc89536[_0xb86e('0x37')][_0xb86e('0x44')]){_0x30d7c3['where']=_[_0xb86e('0x45')](_0x30d7c3['where'],{'$or':_[_0xb86e('0x31')](_0x30d7c3['attributes'],function(_0x3976f2){var _0x2f93a6={};_0x2f93a6[_0x3976f2]={'$like':'%'+_0xc89536[_0xb86e('0x37')][_0xb86e('0x44')]+'%'};return _0x2f93a6;})});}_0x30d7c3=_[_0xb86e('0x45')]({},_0x30d7c3,_0xc89536[_0xb86e('0x46')]);return _0x14a474['getFields'](_0x30d7c3);}})[_0xb86e('0x2b')](function(_0x1140da){if(_0x1140da){_0x38c904=_0x1140da[_0xb86e('0x3d')];if(!_0xc89536['query'][_0xb86e('0x54')](_0xb86e('0x3e'))){_0x30d7c3[_0xb86e('0x3f')]=qs[_0xb86e('0x3f')](_0xc89536[_0xb86e('0x37')][_0xb86e('0x3f')]);_0x30d7c3[_0xb86e('0x26')]=qs[_0xb86e('0x26')](_0xc89536[_0xb86e('0x37')][_0xb86e('0x26')]);}return _0x14a474[_0xb86e('0x50')](_0x30d7c3);}})[_0xb86e('0x2b')](function(_0x2dc7e6){if(_0x2dc7e6){return _0x2dc7e6?{'count':_0x38c904,'rows':_0x2dc7e6}:null;}})[_0xb86e('0x2b')](respondWithResult(_0x55d2cf,null))[_0xb86e('0x23')](handleError(_0x55d2cf,null));};exports[_0xb86e('0x55')]=function(_0x56a310,_0x10896c,_0x2cf2ba){var _0x7f0be5={};var _0x398790={};var _0x5182b0;var _0x2e56a4;return db[_0xb86e('0x32')][_0xb86e('0x51')]({'where':{'id':_0x56a310[_0xb86e('0x4c')]['id']}})['then'](handleEntityNotFound(_0x10896c,null))[_0xb86e('0x2b')](function(_0x2a339e){if(_0x2a339e){_0x5182b0=_0x2a339e;_0x398790[_0xb86e('0x36')]=_[_0xb86e('0x38')](db[_0xb86e('0x52')][_0xb86e('0x53')]);_0x398790[_0xb86e('0x37')]=_[_0xb86e('0x38')](_0x56a310['query']);_0x398790[_0xb86e('0x39')]=_['intersection'](_0x398790['model'],_0x398790[_0xb86e('0x37')]);_0x7f0be5[_0xb86e('0x3c')]=_[_0xb86e('0x3a')](_0x398790[_0xb86e('0x36')],qs['fields'](_0x56a310[_0xb86e('0x37')][_0xb86e('0x3b')]));_0x7f0be5[_0xb86e('0x3c')]=_0x7f0be5[_0xb86e('0x3c')][_0xb86e('0x3d')]?_0x7f0be5[_0xb86e('0x3c')]:_0x398790[_0xb86e('0x36')];_0x7f0be5[_0xb86e('0x40')]=qs[_0xb86e('0x41')](_0x56a310[_0xb86e('0x37')][_0xb86e('0x41')]);_0x7f0be5[_0xb86e('0x42')]=qs['filters'](_[_0xb86e('0x43')](_0x56a310[_0xb86e('0x37')],_0x398790[_0xb86e('0x39')]));if(_0x56a310['query'][_0xb86e('0x44')]){_0x7f0be5[_0xb86e('0x42')]=_[_0xb86e('0x45')](_0x7f0be5[_0xb86e('0x42')],{'$or':_[_0xb86e('0x31')](_0x7f0be5[_0xb86e('0x3c')],function(_0x17b09a){var _0x5a3824={};_0x5a3824[_0x17b09a]={'$like':'%'+_0x56a310[_0xb86e('0x37')][_0xb86e('0x44')]+'%'};return _0x5a3824;})});}_0x7f0be5=_['merge']({},_0x7f0be5,_0x56a310['options']);return _0x5182b0['getSubjects'](_0x7f0be5);}})[_0xb86e('0x2b')](function(_0x5aad76){if(_0x5aad76){_0x2e56a4=_0x5aad76[_0xb86e('0x3d')];if(!_0x56a310[_0xb86e('0x37')][_0xb86e('0x54')](_0xb86e('0x3e'))){_0x7f0be5['limit']=qs[_0xb86e('0x3f')](_0x56a310['query']['limit']);_0x7f0be5[_0xb86e('0x26')]=qs['offset'](_0x56a310[_0xb86e('0x37')][_0xb86e('0x26')]);}return _0x5182b0[_0xb86e('0x55')](_0x7f0be5);}})['then'](function(_0x369963){if(_0x369963){return _0x369963?{'count':_0x2e56a4,'rows':_0x369963}:null;}})[_0xb86e('0x2b')](respondWithResult(_0x10896c,null))[_0xb86e('0x23')](handleError(_0x10896c,null));};exports[_0xb86e('0x56')]=function(_0x11835d,_0x554cbb,_0x5f1e18){var _0x18c209={};var _0x1908d2={};var _0xf55a2;var _0x2ba641;return db[_0xb86e('0x32')][_0xb86e('0x51')]({'where':{'id':_0x11835d['params']['id']}})[_0xb86e('0x2b')](handleEntityNotFound(_0x554cbb,null))[_0xb86e('0x2b')](function(_0x1e40f5){if(_0x1e40f5){_0xf55a2=_0x1e40f5;_0x1908d2['model']=_[_0xb86e('0x38')](db['VtigerField']['rawAttributes']);_0x1908d2[_0xb86e('0x37')]=_[_0xb86e('0x38')](_0x11835d['query']);_0x1908d2[_0xb86e('0x39')]=_[_0xb86e('0x3a')](_0x1908d2[_0xb86e('0x36')],_0x1908d2[_0xb86e('0x37')]);_0x18c209['attributes']=_[_0xb86e('0x3a')](_0x1908d2[_0xb86e('0x36')],qs[_0xb86e('0x3b')](_0x11835d[_0xb86e('0x37')][_0xb86e('0x3b')]));_0x18c209[_0xb86e('0x3c')]=_0x18c209[_0xb86e('0x3c')][_0xb86e('0x3d')]?_0x18c209[_0xb86e('0x3c')]:_0x1908d2[_0xb86e('0x36')];_0x18c209[_0xb86e('0x40')]=qs['sort'](_0x11835d[_0xb86e('0x37')]['sort']);_0x18c209[_0xb86e('0x42')]=qs[_0xb86e('0x39')](_[_0xb86e('0x43')](_0x11835d[_0xb86e('0x37')],_0x1908d2[_0xb86e('0x39')]));if(_0x11835d['query'][_0xb86e('0x44')]){_0x18c209[_0xb86e('0x42')]=_['merge'](_0x18c209['where'],{'$or':_[_0xb86e('0x31')](_0x18c209['attributes'],function(_0x143657){var _0x4f7945={};_0x4f7945[_0x143657]={'$like':'%'+_0x11835d['query']['filter']+'%'};return _0x4f7945;})});}_0x18c209=_[_0xb86e('0x45')]({},_0x18c209,_0x11835d[_0xb86e('0x46')]);return _0xf55a2[_0xb86e('0x56')](_0x18c209);}})[_0xb86e('0x2b')](function(_0x10989f){if(_0x10989f){_0x2ba641=_0x10989f['length'];if(!_0x11835d[_0xb86e('0x37')][_0xb86e('0x54')]('nolimit')){_0x18c209[_0xb86e('0x3f')]=qs[_0xb86e('0x3f')](_0x11835d['query'][_0xb86e('0x3f')]);_0x18c209[_0xb86e('0x26')]=qs[_0xb86e('0x26')](_0x11835d[_0xb86e('0x37')][_0xb86e('0x26')]);}return _0xf55a2[_0xb86e('0x56')](_0x18c209);}})['then'](function(_0x3b421a){if(_0x3b421a){return _0x3b421a?{'count':_0x2ba641,'rows':_0x3b421a}:null;}})[_0xb86e('0x2b')](respondWithResult(_0x554cbb,null))[_0xb86e('0x23')](handleError(_0x554cbb,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 1a2eaf9..342c8ef 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 _0x9c30=['rimraf','exports','VtigerConfiguration','int_vtiger_configurations','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9c30,0x126));var _0x09c3=function(_0x278b9e,_0x293c25){_0x278b9e=_0x278b9e-0x0;var _0x5209e8=_0x9c30[_0x278b9e];return _0x5209e8;};'use strict';var _=require(_0x09c3('0x0'));var util=require('util');var logger=require(_0x09c3('0x1'))('api');var moment=require(_0x09c3('0x2'));var BPromise=require(_0x09c3('0x3'));var rp=require(_0x09c3('0x4'));var fs=require('fs');var path=require(_0x09c3('0x5'));var rimraf=require(_0x09c3('0x6'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x09c3('0x7')]=function(_0x45a190,_0x4e7f0b){return _0x45a190['define'](_0x09c3('0x8'),attributes,{'tableName':_0x09c3('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7cb2=['define','VtigerConfiguration','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intVtigerConfiguration.attributes'];(function(_0x3a2a3c,_0x37bd31){var _0x50ac9a=function(_0x494a7f){while(--_0x494a7f){_0x3a2a3c['push'](_0x3a2a3c['shift']());}};_0x50ac9a(++_0x37bd31);}(_0x7cb2,0x178));var _0x27cb=function(_0x1fe9d9,_0x14a3a3){_0x1fe9d9=_0x1fe9d9-0x0;var _0x2366b8=_0x7cb2[_0x1fe9d9];return _0x2366b8;};'use strict';var _=require('lodash');var util=require(_0x27cb('0x0'));var logger=require(_0x27cb('0x1'))(_0x27cb('0x2'));var moment=require(_0x27cb('0x3'));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['exports']=function(_0x42604a,_0x3ca9ec){return _0x42604a[_0x27cb('0x9')](_0x27cb('0xa'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.rpc.js index cc8e781..0c48265 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 _0x10ee=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','moment','randomstring'];(function(_0x54a85b,_0x474142){var _0x3df359=function(_0x48958c){while(--_0x48958c){_0x54a85b['push'](_0x54a85b['shift']());}};_0x3df359(++_0x474142);}(_0x10ee,0x1b6));var _0xe10e=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x10ee[_0x2be8c2];return _0x97f531;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe10e('0x0'));var BPromise=require('bluebird');var rs=require(_0xe10e('0x1'));var fs=require('fs');var Redis=require(_0xe10e('0x2'));var db=require(_0xe10e('0x3'))['db'];var utils=require(_0xe10e('0x4'));var logger=require(_0xe10e('0x5'))('rpc');var config=require(_0xe10e('0x6'));var jayson=require(_0xe10e('0x7'));var client=jayson['client'][_0xe10e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2feecc,_0x2adcd2,_0x267ea2){return new BPromise(function(_0x3827ef,_0xa900e1){return client[_0xe10e('0x9')](_0x2feecc,_0x267ea2)['then'](function(_0xe2f6d4){logger[_0xe10e('0xa')]('VtigerConfiguration,\x20%s,\x20%s',_0x2adcd2,_0xe10e('0xb'));logger[_0xe10e('0xc')](_0xe10e('0xd'),_0x2adcd2,'request\x20sent',JSON[_0xe10e('0xe')](_0xe2f6d4));if(_0xe2f6d4[_0xe10e('0xf')]){if(_0xe2f6d4[_0xe10e('0xf')][_0xe10e('0x10')]===0x1f4){logger[_0xe10e('0xf')](_0xe10e('0x11'),_0x2adcd2,_0xe2f6d4['error'][_0xe10e('0x12')]);return _0xa900e1(_0xe2f6d4[_0xe10e('0xf')][_0xe10e('0x12')]);}logger[_0xe10e('0xf')](_0xe10e('0x11'),_0x2adcd2,_0xe2f6d4[_0xe10e('0xf')][_0xe10e('0x12')]);return _0x3827ef(_0xe2f6d4['error'][_0xe10e('0x12')]);}else{logger['info'](_0xe10e('0x11'),_0x2adcd2,_0xe10e('0xb'));_0x3827ef(_0xe2f6d4[_0xe10e('0x13')]['message']);}})['catch'](function(_0x34ecfb){logger[_0xe10e('0xf')](_0xe10e('0x11'),_0x2adcd2,_0x34ecfb);_0xa900e1(_0x34ecfb);});});} \ No newline at end of file +var _0xa5d8=['../../config/environment','client','http','then','info','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0xbb55a,_0x4f8d7f){var _0x2240f7=function(_0x4beb3e){while(--_0x4beb3e){_0xbb55a['push'](_0xbb55a['shift']());}};_0x2240f7(++_0x4f8d7f);}(_0xa5d8,0x108));var _0x8a5d=function(_0x268db4,_0x2f9e1c){_0x268db4=_0x268db4-0x0;var _0x27a938=_0xa5d8[_0x268db4];return _0x27a938;};'use strict';var _=require(_0x8a5d('0x0'));var util=require('util');var moment=require(_0x8a5d('0x1'));var BPromise=require(_0x8a5d('0x2'));var rs=require(_0x8a5d('0x3'));var fs=require('fs');var Redis=require(_0x8a5d('0x4'));var db=require(_0x8a5d('0x5'))['db'];var utils=require(_0x8a5d('0x6'));var logger=require(_0x8a5d('0x7'))(_0x8a5d('0x8'));var config=require(_0x8a5d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8a5d('0xa')][_0x8a5d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2eacf1,_0x33d917,_0x9eff96){return new BPromise(function(_0x12c263,_0x57c6d7){return client['request'](_0x2eacf1,_0x9eff96)[_0x8a5d('0xc')](function(_0x41e463){logger[_0x8a5d('0xd')](_0x8a5d('0xe'),_0x33d917,'request\x20sent');logger['debug'](_0x8a5d('0xf'),_0x33d917,_0x8a5d('0x10'),JSON['stringify'](_0x41e463));if(_0x41e463[_0x8a5d('0x11')]){if(_0x41e463[_0x8a5d('0x11')][_0x8a5d('0x12')]===0x1f4){logger[_0x8a5d('0x11')]('VtigerConfiguration,\x20%s,\x20%s',_0x33d917,_0x41e463[_0x8a5d('0x11')][_0x8a5d('0x13')]);return _0x57c6d7(_0x41e463['error'][_0x8a5d('0x13')]);}logger[_0x8a5d('0x11')](_0x8a5d('0xe'),_0x33d917,_0x41e463['error'][_0x8a5d('0x13')]);return _0x12c263(_0x41e463[_0x8a5d('0x11')]['message']);}else{logger[_0x8a5d('0xd')](_0x8a5d('0xe'),_0x33d917,_0x8a5d('0x10'));_0x12c263(_0x41e463[_0x8a5d('0x14')]['message']);}})['catch'](function(_0x38fff2){logger[_0x8a5d('0x11')](_0x8a5d('0xe'),_0x33d917,_0x38fff2);_0x57c6d7(_0x38fff2);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 96e182f..2c1dfd8 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 _0xec0a=['isAuthenticated','index','/:id','show','post','create','update','exports','multer','connect-timeout','express','Router','../../config/environment','get'];(function(_0x204a28,_0x359c57){var _0x2d8e3d=function(_0xbfd9b6){while(--_0xbfd9b6){_0x204a28['push'](_0x204a28['shift']());}};_0x2d8e3d(++_0x359c57);}(_0xec0a,0x1c8));var _0xaec0=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xec0a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xaec0('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xaec0('0x1'));var express=require(_0xaec0('0x2'));var router=express[_0xaec0('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xaec0('0x4'));var controller=require('./intVtigerField.controller');router[_0xaec0('0x5')]('/',auth[_0xaec0('0x6')](),controller[_0xaec0('0x7')]);router['get'](_0xaec0('0x8'),auth[_0xaec0('0x6')](),controller[_0xaec0('0x9')]);router[_0xaec0('0xa')]('/',auth[_0xaec0('0x6')](),controller[_0xaec0('0xb')]);router['put'](_0xaec0('0x8'),auth[_0xaec0('0x6')](),controller[_0xaec0('0xc')]);router['delete'](_0xaec0('0x8'),auth[_0xaec0('0x6')](),controller['destroy']);module[_0xaec0('0xd')]=router; \ No newline at end of file +var _0xff3f=['/:id','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','show','create','put'];(function(_0x4783d2,_0x586a11){var _0x6608fd=function(_0x2f6f60){while(--_0x2f6f60){_0x4783d2['push'](_0x4783d2['shift']());}};_0x6608fd(++_0x586a11);}(_0xff3f,0x190));var _0xfff3=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xff3f[_0x1b4b23];return _0x2a325b;};'use strict';var multer=require(_0xfff3('0x0'));var util=require(_0xfff3('0x1'));var path=require(_0xfff3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfff3('0x3')]();var auth=require(_0xfff3('0x4'));var interaction=require(_0xfff3('0x5'));var config=require(_0xfff3('0x6'));var controller=require(_0xfff3('0x7'));router[_0xfff3('0x8')]('/',auth[_0xfff3('0x9')](),controller[_0xfff3('0xa')]);router[_0xfff3('0x8')]('/:id',auth[_0xfff3('0x9')](),controller[_0xfff3('0xb')]);router['post']('/',auth[_0xfff3('0x9')](),controller[_0xfff3('0xc')]);router[_0xfff3('0xd')](_0xfff3('0xe'),auth[_0xfff3('0x9')](),controller['update']);router[_0xfff3('0xf')]('/:id',auth[_0xfff3('0x9')](),controller[_0xfff3('0x10')]);module[_0xfff3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 55c3c1f..b900bf8 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 _0xa48b=['ENUM','customVariable','STRING','variable','sequelize','exports'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xa48b,0xc4));var _0xba48=function(_0xecbe7d,_0x34d69d){_0xecbe7d=_0xecbe7d-0x0;var _0x595385=_0xa48b[_0xecbe7d];return _0x595385;};'use strict';var Sequelize=require(_0xba48('0x0'));module[_0xba48('0x1')]={'type':{'type':Sequelize[_0xba48('0x2')]('string','variable',_0xba48('0x3'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xba48('0x4')]},'key':{'type':Sequelize[_0xba48('0x4')]},'keyType':{'type':Sequelize[_0xba48('0x2')]('string',_0xba48('0x5'),_0xba48('0x3'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xba48('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xba48('0x4')]}}; \ No newline at end of file +var _0xa4fa=['STRING','customVariable','BOOLEAN','sequelize','string','variable','keyValue'];(function(_0x5d3306,_0x6e1379){var _0x6968f7=function(_0x3f9b44){while(--_0x3f9b44){_0x5d3306['push'](_0x5d3306['shift']());}};_0x6968f7(++_0x6e1379);}(_0xa4fa,0x1ca));var _0xaa4f=function(_0x2078f9,_0x5bff83){_0x2078f9=_0x2078f9-0x0;var _0x240f4e=_0xa4fa[_0x2078f9];return _0x240f4e;};'use strict';var Sequelize=require(_0xaa4f('0x0'));module['exports']={'type':{'type':Sequelize['ENUM'](_0xaa4f('0x1'),_0xaa4f('0x2'),'customVariable',_0xaa4f('0x3')),'defaultValue':_0xaa4f('0x1')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xaa4f('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xaa4f('0x1'),_0xaa4f('0x2'),_0xaa4f('0x5'))},'keyContent':{'type':Sequelize[_0xaa4f('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xaa4f('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xaa4f('0x4')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index d0f5e92..c11d285 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 _0x7817=['stack','name','send','index','VtigerField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filter','map','merge','options','then','includeAll','include','findAll','rows','catch','show','params','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','destroy'];(function(_0xb2dc27,_0x4ffb77){var _0x2ee1e7=function(_0x58254d){while(--_0x58254d){_0xb2dc27['push'](_0xb2dc27['shift']());}};_0x2ee1e7(++_0x4ffb77);}(_0x7817,0xb4));var _0x7781=function(_0x3f3796,_0x34df0a){_0x3f3796=_0x3f3796-0x0;var _0x47a50a=_0x7817[_0x3f3796];return _0x47a50a;};'use strict';var pdf=require(_0x7781('0x0'));var emlformat=require(_0x7781('0x1'));var rimraf=require(_0x7781('0x2'));var zipdir=require(_0x7781('0x3'));var jsonpatch=require(_0x7781('0x4'));var rp=require(_0x7781('0x5'));var moment=require(_0x7781('0x6'));var BPromise=require(_0x7781('0x7'));var Mustache=require('mustache');var util=require(_0x7781('0x8'));var path=require('path');var sox=require(_0x7781('0x9'));var csv=require('to-csv');var ejs=require(_0x7781('0xa'));var fs=require('fs');var _=require(_0x7781('0xb'));var squel=require(_0x7781('0xc'));var crypto=require(_0x7781('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x7781('0xe'));var toCsv=require('to-csv');var querystring=require(_0x7781('0xf'));var Papa=require(_0x7781('0x10'));var Redis=require(_0x7781('0x11'));var authService=require(_0x7781('0x12'));var qs=require(_0x7781('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7781('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x7781('0x15'));var config=require('../../config/environment');var db=require(_0x7781('0x16'))['db'];function respondWithStatusCode(_0x17f2bd,_0xd206d6){_0xd206d6=_0xd206d6||0xcc;return function(_0x3c4f03){if(_0x3c4f03){return _0x17f2bd[_0x7781('0x17')](_0xd206d6);}return _0x17f2bd[_0x7781('0x18')](_0xd206d6)[_0x7781('0x19')]();};}function respondWithResult(_0x4693c9,_0x470d20){_0x470d20=_0x470d20||0xc8;return function(_0x560e03){if(_0x560e03){return _0x4693c9['status'](_0x470d20)[_0x7781('0x1a')](_0x560e03);}};}function respondWithFilteredResult(_0x9fe290,_0x40c531){return function(_0x3f35db){if(_0x3f35db){var _0x4d4ff8=_0x3f35db[_0x7781('0x1b')],_0x4af34e=_0x40c531[_0x7781('0x1c')],_0x4cbff4=_0x40c531[_0x7781('0x1c')]+_0x40c531[_0x7781('0x1d')],_0x55a48b;if(_0x4cbff4>=_0x4d4ff8){_0x4cbff4=_0x4d4ff8;_0x55a48b=0xc8;}else{_0x55a48b=0xce;}_0x9fe290[_0x7781('0x18')](_0x55a48b);return _0x9fe290[_0x7781('0x1e')](_0x7781('0x1f'),_0x4af34e+'-'+_0x4cbff4+'/'+_0x4d4ff8)[_0x7781('0x1a')](_0x3f35db);}return null;};}function patchUpdates(_0x2c5d2c){return function(_0xbc6ae0){try{jsonpatch['apply'](_0xbc6ae0,_0x2c5d2c,!![]);}catch(_0x506c63){return BPromise[_0x7781('0x20')](_0x506c63);}return _0xbc6ae0[_0x7781('0x21')]();};}function saveUpdates(_0x2fbeef,_0x267b8b){return function(_0x146ed2){if(_0x146ed2){return _0x146ed2[_0x7781('0x22')](_0x2fbeef)['then'](function(_0x2dbc99){return _0x2dbc99;});}return null;};}function removeEntity(_0x35149c,_0x50ae8d){return function(_0x452f36){if(_0x452f36){return _0x452f36[_0x7781('0x23')]()['then'](function(){_0x35149c[_0x7781('0x18')](0xcc)[_0x7781('0x19')]();});}};}function handleEntityNotFound(_0x161048,_0x5841f0){return function(_0x380368){if(!_0x380368){_0x161048['sendStatus'](0x194);}return _0x380368;};}function handleError(_0x57bdcb,_0x2f3f14){_0x2f3f14=_0x2f3f14||0x1f4;return function(_0x71a4ba){logger['error'](_0x71a4ba[_0x7781('0x24')]);if(_0x71a4ba[_0x7781('0x25')]){delete _0x71a4ba['name'];}_0x57bdcb[_0x7781('0x18')](_0x2f3f14)[_0x7781('0x26')](_0x71a4ba);};}exports[_0x7781('0x27')]=function(_0x4c4b7c,_0xd197d2){var _0x4b7a94={},_0x519dec={},_0x493a74={'count':0x0,'rows':[]};var _0x18991f=_['map'](db[_0x7781('0x28')][_0x7781('0x29')],function(_0x30667e){return{'name':_0x30667e[_0x7781('0x2a')],'type':_0x30667e[_0x7781('0x2b')][_0x7781('0x2c')]};});_0x519dec['model']=_['map'](_0x18991f,_0x7781('0x25'));_0x519dec[_0x7781('0x2d')]=_[_0x7781('0x2e')](_0x4c4b7c['query']);_0x519dec[_0x7781('0x2f')]=_[_0x7781('0x30')](_0x519dec[_0x7781('0x31')],_0x519dec['query']);_0x4b7a94['attributes']=_['intersection'](_0x519dec['model'],qs[_0x7781('0x32')](_0x4c4b7c[_0x7781('0x2d')]['fields']));_0x4b7a94[_0x7781('0x33')]=_0x4b7a94[_0x7781('0x33')][_0x7781('0x34')]?_0x4b7a94[_0x7781('0x33')]:_0x519dec[_0x7781('0x31')];if(!_0x4c4b7c[_0x7781('0x2d')][_0x7781('0x35')](_0x7781('0x36'))){_0x4b7a94['limit']=qs[_0x7781('0x1d')](_0x4c4b7c[_0x7781('0x2d')][_0x7781('0x1d')]);_0x4b7a94[_0x7781('0x1c')]=qs[_0x7781('0x1c')](_0x4c4b7c[_0x7781('0x2d')][_0x7781('0x1c')]);}_0x4b7a94[_0x7781('0x37')]=qs['sort'](_0x4c4b7c[_0x7781('0x2d')][_0x7781('0x38')]);_0x4b7a94['where']=qs[_0x7781('0x2f')](_['pick'](_0x4c4b7c[_0x7781('0x2d')],_0x519dec[_0x7781('0x2f')]));if(_0x4c4b7c[_0x7781('0x2d')][_0x7781('0x39')]){_0x4b7a94['where']=_['merge'](_0x4b7a94['where'],{'$or':_[_0x7781('0x3a')](_0x18991f,function(_0x4a0f34){if(_0x4a0f34[_0x7781('0x2b')]!=='VIRTUAL'){var _0x14095d={};_0x14095d[_0x4a0f34['name']]={'$like':'%'+_0x4c4b7c['query'][_0x7781('0x39')]+'%'};return _0x14095d;}})});}_0x4b7a94=_[_0x7781('0x3b')]({},_0x4b7a94,_0x4c4b7c[_0x7781('0x3c')]);var _0x325d33={'where':_0x4b7a94['where']};return db[_0x7781('0x28')]['count'](_0x325d33)[_0x7781('0x3d')](function(_0x788f9f){_0x493a74[_0x7781('0x1b')]=_0x788f9f;if(_0x4c4b7c['query'][_0x7781('0x3e')]){_0x4b7a94[_0x7781('0x3f')]=[{'all':!![]}];}return db[_0x7781('0x28')][_0x7781('0x40')](_0x4b7a94);})[_0x7781('0x3d')](function(_0x3c67d1){_0x493a74[_0x7781('0x41')]=_0x3c67d1;return _0x493a74;})['then'](respondWithFilteredResult(_0xd197d2,_0x4b7a94))[_0x7781('0x42')](handleError(_0xd197d2,null));};exports[_0x7781('0x43')]=function(_0x272c19,_0x24def2){var _0x2fd65b={'raw':!![],'where':{'id':_0x272c19[_0x7781('0x44')]['id']}},_0x290a63={};_0x290a63[_0x7781('0x31')]=_[_0x7781('0x2e')](db[_0x7781('0x28')]['rawAttributes']);_0x290a63['query']=_['keys'](_0x272c19['query']);_0x290a63[_0x7781('0x2f')]=_[_0x7781('0x30')](_0x290a63[_0x7781('0x31')],_0x290a63[_0x7781('0x2d')]);_0x2fd65b[_0x7781('0x33')]=_[_0x7781('0x30')](_0x290a63[_0x7781('0x31')],qs[_0x7781('0x32')](_0x272c19[_0x7781('0x2d')][_0x7781('0x32')]));_0x2fd65b[_0x7781('0x33')]=_0x2fd65b[_0x7781('0x33')][_0x7781('0x34')]?_0x2fd65b[_0x7781('0x33')]:_0x290a63[_0x7781('0x31')];if(_0x272c19[_0x7781('0x2d')]['includeAll']){_0x2fd65b[_0x7781('0x3f')]=[{'all':!![]}];}_0x2fd65b=_[_0x7781('0x3b')]({},_0x2fd65b,_0x272c19[_0x7781('0x3c')]);return db[_0x7781('0x28')][_0x7781('0x45')](_0x2fd65b)[_0x7781('0x3d')](handleEntityNotFound(_0x24def2,null))['then'](respondWithResult(_0x24def2,null))[_0x7781('0x42')](handleError(_0x24def2,null));};exports[_0x7781('0x46')]=function(_0x66bfe9,_0x204f87){return db[_0x7781('0x28')][_0x7781('0x46')](_0x66bfe9['body'],{})[_0x7781('0x3d')](respondWithResult(_0x204f87,0xc9))[_0x7781('0x42')](handleError(_0x204f87,null));};exports['update']=function(_0xd84169,_0x52da57){if(_0xd84169[_0x7781('0x47')]['id']){delete _0xd84169['body']['id'];}return db[_0x7781('0x28')][_0x7781('0x45')]({'where':{'id':_0xd84169[_0x7781('0x44')]['id']}})[_0x7781('0x3d')](handleEntityNotFound(_0x52da57,null))[_0x7781('0x3d')](saveUpdates(_0xd84169['body'],null))[_0x7781('0x3d')](respondWithResult(_0x52da57,null))['catch'](handleError(_0x52da57,null));};exports[_0x7781('0x23')]=function(_0x39ab63,_0x4d34e9){return db[_0x7781('0x28')][_0x7781('0x45')]({'where':{'id':_0x39ab63[_0x7781('0x44')]['id']}})['then'](handleEntityNotFound(_0x4d34e9,null))[_0x7781('0x3d')](removeEntity(_0x4d34e9,null))['catch'](handleError(_0x4d34e9,null));}; \ No newline at end of file +var _0x068a=['desk.js','to-csv','querystring','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','stack','name','VtigerField','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','include','find','create','body','catch','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','lodash','squel'];(function(_0x956c0d,_0x15d9c3){var _0x32c6eb=function(_0x341cbc){while(--_0x341cbc){_0x956c0d['push'](_0x956c0d['shift']());}};_0x32c6eb(++_0x15d9c3);}(_0x068a,0x14d));var _0xa068=function(_0x2855cf,_0x37e962){_0x2855cf=_0x2855cf-0x0;var _0xde6bef=_0x068a[_0x2855cf];return _0xde6bef;};'use strict';var pdf=require(_0xa068('0x0'));var emlformat=require(_0xa068('0x1'));var rimraf=require(_0xa068('0x2'));var zipdir=require(_0xa068('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa068('0x4'));var moment=require(_0xa068('0x5'));var BPromise=require(_0xa068('0x6'));var Mustache=require('mustache');var util=require(_0xa068('0x7'));var path=require(_0xa068('0x8'));var sox=require(_0xa068('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xa068('0xa'));var squel=require(_0xa068('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa068('0xc'));var toCsv=require(_0xa068('0xd'));var querystring=require(_0xa068('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa068('0xf'));var qs=require(_0xa068('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa068('0x11'));var logger=require(_0xa068('0x12'))(_0xa068('0x13'));var utils=require(_0xa068('0x14'));var config=require(_0xa068('0x15'));var db=require(_0xa068('0x16'))['db'];function respondWithStatusCode(_0x29c20e,_0x285aca){_0x285aca=_0x285aca||0xcc;return function(_0x141481){if(_0x141481){return _0x29c20e[_0xa068('0x17')](_0x285aca);}return _0x29c20e[_0xa068('0x18')](_0x285aca)[_0xa068('0x19')]();};}function respondWithResult(_0x5d0d54,_0x4240a2){_0x4240a2=_0x4240a2||0xc8;return function(_0x18d0d3){if(_0x18d0d3){return _0x5d0d54['status'](_0x4240a2)['json'](_0x18d0d3);}};}function respondWithFilteredResult(_0x5dc294,_0x4462a2){return function(_0x590025){if(_0x590025){var _0x274403=_0x590025[_0xa068('0x1a')],_0x29d775=_0x4462a2[_0xa068('0x1b')],_0x3a9ba9=_0x4462a2[_0xa068('0x1b')]+_0x4462a2[_0xa068('0x1c')],_0x4732fa;if(_0x3a9ba9>=_0x274403){_0x3a9ba9=_0x274403;_0x4732fa=0xc8;}else{_0x4732fa=0xce;}_0x5dc294[_0xa068('0x18')](_0x4732fa);return _0x5dc294[_0xa068('0x1d')](_0xa068('0x1e'),_0x29d775+'-'+_0x3a9ba9+'/'+_0x274403)[_0xa068('0x1f')](_0x590025);}return null;};}function patchUpdates(_0x15681e){return function(_0x1eaf45){try{jsonpatch[_0xa068('0x20')](_0x1eaf45,_0x15681e,!![]);}catch(_0xe748fa){return BPromise['reject'](_0xe748fa);}return _0x1eaf45[_0xa068('0x21')]();};}function saveUpdates(_0x4cbc25,_0xfd2026){return function(_0x1537c6){if(_0x1537c6){return _0x1537c6[_0xa068('0x22')](_0x4cbc25)[_0xa068('0x23')](function(_0x57f59c){return _0x57f59c;});}return null;};}function removeEntity(_0x4fd47d,_0x24c22a){return function(_0x414006){if(_0x414006){return _0x414006[_0xa068('0x24')]()[_0xa068('0x23')](function(){_0x4fd47d[_0xa068('0x18')](0xcc)[_0xa068('0x19')]();});}};}function handleEntityNotFound(_0x169323,_0xc98250){return function(_0x36a904){if(!_0x36a904){_0x169323[_0xa068('0x17')](0x194);}return _0x36a904;};}function handleError(_0x40508c,_0x7442be){_0x7442be=_0x7442be||0x1f4;return function(_0x5f59e0){logger['error'](_0x5f59e0[_0xa068('0x25')]);if(_0x5f59e0[_0xa068('0x26')]){delete _0x5f59e0[_0xa068('0x26')];}_0x40508c[_0xa068('0x18')](_0x7442be)['send'](_0x5f59e0);};}exports['index']=function(_0xada753,_0x187e27){var _0xf1d36={},_0x4f158c={},_0x11f4f2={'count':0x0,'rows':[]};var _0x1a61f4=_['map'](db[_0xa068('0x27')]['rawAttributes'],function(_0x3a7ef3){return{'name':_0x3a7ef3[_0xa068('0x28')],'type':_0x3a7ef3[_0xa068('0x29')][_0xa068('0x2a')]};});_0x4f158c[_0xa068('0x2b')]=_[_0xa068('0x2c')](_0x1a61f4,'name');_0x4f158c[_0xa068('0x2d')]=_[_0xa068('0x2e')](_0xada753['query']);_0x4f158c['filters']=_[_0xa068('0x2f')](_0x4f158c['model'],_0x4f158c[_0xa068('0x2d')]);_0xf1d36[_0xa068('0x30')]=_[_0xa068('0x2f')](_0x4f158c[_0xa068('0x2b')],qs['fields'](_0xada753[_0xa068('0x2d')][_0xa068('0x31')]));_0xf1d36[_0xa068('0x30')]=_0xf1d36[_0xa068('0x30')][_0xa068('0x32')]?_0xf1d36[_0xa068('0x30')]:_0x4f158c[_0xa068('0x2b')];if(!_0xada753[_0xa068('0x2d')]['hasOwnProperty']('nolimit')){_0xf1d36[_0xa068('0x1c')]=qs[_0xa068('0x1c')](_0xada753['query'][_0xa068('0x1c')]);_0xf1d36[_0xa068('0x1b')]=qs[_0xa068('0x1b')](_0xada753['query'][_0xa068('0x1b')]);}_0xf1d36['order']=qs[_0xa068('0x33')](_0xada753['query']['sort']);_0xf1d36[_0xa068('0x34')]=qs[_0xa068('0x35')](_[_0xa068('0x36')](_0xada753[_0xa068('0x2d')],_0x4f158c[_0xa068('0x35')]));if(_0xada753[_0xa068('0x2d')][_0xa068('0x37')]){_0xf1d36[_0xa068('0x34')]=_[_0xa068('0x38')](_0xf1d36[_0xa068('0x34')],{'$or':_[_0xa068('0x2c')](_0x1a61f4,function(_0x22fb69){if(_0x22fb69[_0xa068('0x29')]!==_0xa068('0x39')){var _0x351da5={};_0x351da5[_0x22fb69[_0xa068('0x26')]]={'$like':'%'+_0xada753['query'][_0xa068('0x37')]+'%'};return _0x351da5;}})});}_0xf1d36=_[_0xa068('0x38')]({},_0xf1d36,_0xada753[_0xa068('0x3a')]);var _0x20b5d7={'where':_0xf1d36[_0xa068('0x34')]};return db['VtigerField'][_0xa068('0x1a')](_0x20b5d7)[_0xa068('0x23')](function(_0x525189){_0x11f4f2[_0xa068('0x1a')]=_0x525189;if(_0xada753[_0xa068('0x2d')][_0xa068('0x3b')]){_0xf1d36['include']=[{'all':!![]}];}return db[_0xa068('0x27')][_0xa068('0x3c')](_0xf1d36);})[_0xa068('0x23')](function(_0x46c566){_0x11f4f2['rows']=_0x46c566;return _0x11f4f2;})[_0xa068('0x23')](respondWithFilteredResult(_0x187e27,_0xf1d36))['catch'](handleError(_0x187e27,null));};exports[_0xa068('0x3d')]=function(_0x54fa68,_0x15135e){var _0x5f9d6={'raw':!![],'where':{'id':_0x54fa68[_0xa068('0x3e')]['id']}},_0x121f86={};_0x121f86['model']=_[_0xa068('0x2e')](db[_0xa068('0x27')][_0xa068('0x3f')]);_0x121f86[_0xa068('0x2d')]=_['keys'](_0x54fa68[_0xa068('0x2d')]);_0x121f86[_0xa068('0x35')]=_[_0xa068('0x2f')](_0x121f86[_0xa068('0x2b')],_0x121f86[_0xa068('0x2d')]);_0x5f9d6['attributes']=_[_0xa068('0x2f')](_0x121f86['model'],qs['fields'](_0x54fa68[_0xa068('0x2d')][_0xa068('0x31')]));_0x5f9d6['attributes']=_0x5f9d6[_0xa068('0x30')][_0xa068('0x32')]?_0x5f9d6[_0xa068('0x30')]:_0x121f86[_0xa068('0x2b')];if(_0x54fa68[_0xa068('0x2d')][_0xa068('0x3b')]){_0x5f9d6[_0xa068('0x40')]=[{'all':!![]}];}_0x5f9d6=_[_0xa068('0x38')]({},_0x5f9d6,_0x54fa68[_0xa068('0x3a')]);return db[_0xa068('0x27')][_0xa068('0x41')](_0x5f9d6)['then'](handleEntityNotFound(_0x15135e,null))[_0xa068('0x23')](respondWithResult(_0x15135e,null))['catch'](handleError(_0x15135e,null));};exports['create']=function(_0x518bdd,_0x5b092c){return db[_0xa068('0x27')][_0xa068('0x42')](_0x518bdd[_0xa068('0x43')],{})[_0xa068('0x23')](respondWithResult(_0x5b092c,0xc9))[_0xa068('0x44')](handleError(_0x5b092c,null));};exports[_0xa068('0x22')]=function(_0x3fee3b,_0x2f69f5){if(_0x3fee3b['body']['id']){delete _0x3fee3b[_0xa068('0x43')]['id'];}return db[_0xa068('0x27')][_0xa068('0x41')]({'where':{'id':_0x3fee3b['params']['id']}})[_0xa068('0x23')](handleEntityNotFound(_0x2f69f5,null))[_0xa068('0x23')](saveUpdates(_0x3fee3b[_0xa068('0x43')],null))['then'](respondWithResult(_0x2f69f5,null))[_0xa068('0x44')](handleError(_0x2f69f5,null));};exports[_0xa068('0x24')]=function(_0x4e8079,_0x1c29f3){return db['VtigerField'][_0xa068('0x41')]({'where':{'id':_0x4e8079['params']['id']}})['then'](handleEntityNotFound(_0x1c29f3,null))[_0xa068('0x23')](removeEntity(_0x1c29f3,null))['catch'](handleError(_0x1c29f3,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 88f16c6..478e202 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 _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x186376,_0x5d988a){var _0x2dbdd9=function(_0x96908e){while(--_0x96908e){_0x186376['push'](_0x186376['shift']());}};_0x2dbdd9(++_0x5d988a);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var logger=require(_0x7995('0x2'))(_0x7995('0x3'));var moment=require('moment');var BPromise=require(_0x7995('0x4'));var rp=require(_0x7995('0x5'));var fs=require('fs');var path=require(_0x7995('0x6'));var rimraf=require(_0x7995('0x7'));var config=require('../../config/environment');var attributes=require(_0x7995('0x8'));module[_0x7995('0x9')]=function(_0x137b6b,_0x219534){return _0x137b6b[_0x7995('0xa')](_0x7995('0xb'),attributes,{'tableName':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9957=['rimraf','./intVtigerField.attributes','exports','define','VtigerField','vtiger_unique_index','idField','lodash','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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':'int_vtiger_fields','paranoid':![],'indexes':[{'name':_0x7995('0xc'),'fields':[_0x7995('0xd'),'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 cccdefe..70ef971 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 _0xb9a7=['request\x20sent','VtigerField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','util','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','VtigerField,\x20%s,\x20%s'];(function(_0xd21fe7,_0x225a39){var _0x14d570=function(_0x3c0674){while(--_0x3c0674){_0xd21fe7['push'](_0xd21fe7['shift']());}};_0x14d570(++_0x225a39);}(_0xb9a7,0x112));var _0x7b9a=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xb9a7[_0x2070da];return _0x4f9fe1;};'use strict';var _=require('lodash');var util=require(_0x7b9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7b9a('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x7b9a('0x2'));var logger=require(_0x7b9a('0x3'))(_0x7b9a('0x4'));var config=require(_0x7b9a('0x5'));var jayson=require(_0x7b9a('0x6'));var client=jayson[_0x7b9a('0x7')][_0x7b9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7019fd,_0x37ce81,_0x3e51f0){return new BPromise(function(_0x4d3f20,_0x43d8e2){return client[_0x7b9a('0x9')](_0x7019fd,_0x3e51f0)['then'](function(_0x511e28){logger['info'](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));logger['debug'](_0x7b9a('0xc'),_0x37ce81,'request\x20sent',JSON[_0x7b9a('0xd')](_0x511e28));if(_0x511e28['error']){if(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0xf')]===0x1f4){logger[_0x7b9a('0xe')]('VtigerField,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x43d8e2(_0x511e28['error'][_0x7b9a('0x10')]);}logger[_0x7b9a('0xe')]('VtigerField,\x20%s,\x20%s',_0x37ce81,_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);return _0x4d3f20(_0x511e28[_0x7b9a('0xe')][_0x7b9a('0x10')]);}else{logger[_0x7b9a('0x11')](_0x7b9a('0xa'),_0x37ce81,_0x7b9a('0xb'));_0x4d3f20(_0x511e28[_0x7b9a('0x12')][_0x7b9a('0x10')]);}})['catch'](function(_0x34a82d){logger['error'](_0x7b9a('0xa'),_0x37ce81,_0x34a82d);_0x43d8e2(_0x34a82d);});});} \ No newline at end of file +var _0x282b=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2f45ea,_0x15c656){var _0x485a84=function(_0x4a1fe3){while(--_0x4a1fe3){_0x2f45ea['push'](_0x2f45ea['shift']());}};_0x485a84(++_0x15c656);}(_0x282b,0xec));var _0xb282=function(_0x24492e,_0x27f5d0){_0x24492e=_0x24492e-0x0;var _0x7fbf1e=_0x282b[_0x24492e];return _0x7fbf1e;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 3b0349c..5ea6a06 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 _0x8d35=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./intZendeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','addConfiguration','put','update','delete'];(function(_0x552bd8,_0x5c188c){var _0x19f597=function(_0x511272){while(--_0x511272){_0x552bd8['push'](_0x552bd8['shift']());}};_0x19f597(++_0x5c188c);}(_0x8d35,0x13c));var _0x58d3=function(_0xbd08b4,_0x4790ed){_0xbd08b4=_0xbd08b4-0x0;var _0x314f1e=_0x8d35[_0xbd08b4];return _0x314f1e;};'use strict';var multer=require(_0x58d3('0x0'));var util=require(_0x58d3('0x1'));var path=require(_0x58d3('0x2'));var timeout=require(_0x58d3('0x3'));var express=require('express');var router=express[_0x58d3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x58d3('0x5'));var config=require('../../config/environment');var controller=require(_0x58d3('0x6'));router[_0x58d3('0x7')]('/',auth[_0x58d3('0x8')](),controller[_0x58d3('0x9')]);router['get'](_0x58d3('0xa'),auth[_0x58d3('0x8')](),controller['show']);router['get'](_0x58d3('0xb'),auth[_0x58d3('0x8')](),controller[_0x58d3('0xc')]);router[_0x58d3('0x7')](_0x58d3('0xd'),auth[_0x58d3('0x8')](),controller[_0x58d3('0xe')]);router[_0x58d3('0xf')]('/',auth[_0x58d3('0x8')](),controller['create']);router[_0x58d3('0xf')](_0x58d3('0xb'),auth['isAuthenticated'](),controller[_0x58d3('0x10')]);router[_0x58d3('0x11')](_0x58d3('0xa'),auth[_0x58d3('0x8')](),controller[_0x58d3('0x12')]);router[_0x58d3('0x13')](_0x58d3('0xa'),auth[_0x58d3('0x8')](),controller['destroy']);module[_0x58d3('0x14')]=router; \ No newline at end of file +var _0x14a0=['get','/:id','show','/:id/configurations','/:id/fields','getFields','create','post','put','update','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','isAuthenticated','index'];(function(_0x3d9eb5,_0x5b21ac){var _0x535862=function(_0xc73b5b){while(--_0xc73b5b){_0x3d9eb5['push'](_0x3d9eb5['shift']());}};_0x535862(++_0x5b21ac);}(_0x14a0,0x74));var _0x014a=function(_0x4569b0,_0x4ae266){_0x4569b0=_0x4569b0-0x0;var _0x4b4a66=_0x14a0[_0x4569b0];return _0x4b4a66;};'use strict';var multer=require('multer');var util=require(_0x014a('0x0'));var path=require('path');var timeout=require(_0x014a('0x1'));var express=require(_0x014a('0x2'));var router=express[_0x014a('0x3')]();var auth=require(_0x014a('0x4'));var interaction=require(_0x014a('0x5'));var config=require(_0x014a('0x6'));var controller=require(_0x014a('0x7'));router['get']('/',auth[_0x014a('0x8')](),controller[_0x014a('0x9')]);router[_0x014a('0xa')](_0x014a('0xb'),auth['isAuthenticated'](),controller[_0x014a('0xc')]);router[_0x014a('0xa')](_0x014a('0xd'),auth[_0x014a('0x8')](),controller['getConfigurations']);router['get'](_0x014a('0xe'),auth[_0x014a('0x8')](),controller[_0x014a('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x014a('0x10')]);router[_0x014a('0x11')](_0x014a('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x014a('0x12')](_0x014a('0xb'),auth[_0x014a('0x8')](),controller[_0x014a('0x13')]);router['delete'](_0x014a('0xb'),auth[_0x014a('0x8')](),controller['destroy']);module[_0x014a('0x14')]=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 458e2e8..79e56ee 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 _0x25fd=['STRING','ENUM','password','token','integrationTab','newTab','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x25fd,0x17e));var _0xd25f=function(_0x591f5b,_0x3d9a97){_0x591f5b=_0x591f5b-0x0;var _0x131b79=_0x25fd[_0x591f5b];return _0x131b79;};'use strict';var Sequelize=require(_0xd25f('0x0'));module[_0xd25f('0x1')]={'name':{'type':Sequelize[_0xd25f('0x2')]},'description':{'type':Sequelize[_0xd25f('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0xd25f('0x2')]},'remoteUri':{'type':Sequelize[_0xd25f('0x2')],'unique':'remoteUri'},'authType':{'type':Sequelize[_0xd25f('0x3')](_0xd25f('0x4'),_0xd25f('0x5')),'defaultValue':_0xd25f('0x4')},'serverUrl':{'type':Sequelize[_0xd25f('0x2')]},'type':{'type':Sequelize['ENUM'](_0xd25f('0x6'),_0xd25f('0x7')),'defaultValue':_0xd25f('0x6')}}; \ No newline at end of file +var _0x3473=['integrationTab','newTab','exports','STRING','username','remoteUri','password','ENUM'];(function(_0x4acb9d,_0x28894b){var _0x252ccb=function(_0x3b1709){while(--_0x3b1709){_0x4acb9d['push'](_0x4acb9d['shift']());}};_0x252ccb(++_0x28894b);}(_0x3473,0x13a));var _0x3347=function(_0x13af04,_0x34696c){_0x13af04=_0x13af04-0x0;var _0xd04e49=_0x3473[_0x13af04];return _0xd04e49;};'use strict';var Sequelize=require('sequelize');module[_0x3347('0x0')]={'name':{'type':Sequelize[_0x3347('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x3347('0x1')],'unique':_0x3347('0x2')},'password':{'type':Sequelize[_0x3347('0x1')]},'token':{'type':Sequelize[_0x3347('0x1')]},'remoteUri':{'type':Sequelize[_0x3347('0x1')],'unique':_0x3347('0x3')},'authType':{'type':Sequelize['ENUM'](_0x3347('0x4'),'token'),'defaultValue':_0x3347('0x4')},'serverUrl':{'type':Sequelize[_0x3347('0x1')]},'type':{'type':Sequelize[_0x3347('0x5')](_0x3347('0x6'),_0x3347('0x7')),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index b155aeb..24b47d9 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 _0xea46=['assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','test','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','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','offset','limit','set','Content-Range','json','save','update','destroy','stack','name','send','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','count','include','findAll','rows','show','params','keys','length','includeAll','find','create','body','getConfigurations','findOne','ZendeskConfiguration','order','map','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','username','password','authType','remoteUri','substring','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','%s:%s','toString','base64','token','%s/token:%s','description','group'];(function(_0x2be214,_0x5cc60c){var _0x27c77c=function(_0x2bc07d){while(--_0x2bc07d){_0x2be214['push'](_0x2be214['shift']());}};_0x27c77c(++_0x5cc60c);}(_0xea46,0x8d));var _0x6ea4=function(_0x3af8a3,_0x376786){_0x3af8a3=_0x3af8a3-0x0;var _0x44a47d=_0xea46[_0x3af8a3];return _0x44a47d;};'use strict';var pdf=require(_0x6ea4('0x0'));var emlformat=require(_0x6ea4('0x1'));var rimraf=require(_0x6ea4('0x2'));var zipdir=require(_0x6ea4('0x3'));var jsonpatch=require(_0x6ea4('0x4'));var rp=require(_0x6ea4('0x5'));var moment=require(_0x6ea4('0x6'));var BPromise=require(_0x6ea4('0x7'));var Mustache=require(_0x6ea4('0x8'));var util=require(_0x6ea4('0x9'));var path=require(_0x6ea4('0xa'));var sox=require(_0x6ea4('0xb'));var csv=require(_0x6ea4('0xc'));var ejs=require(_0x6ea4('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6ea4('0xe'));var crypto=require('crypto');var jsforce=require(_0x6ea4('0xf'));var deskjs=require(_0x6ea4('0x10'));var toCsv=require(_0x6ea4('0xc'));var querystring=require(_0x6ea4('0x11'));var Papa=require(_0x6ea4('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x6ea4('0x13'));var as=require(_0x6ea4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6ea4('0x15'));var utils=require(_0x6ea4('0x16'));var config=require(_0x6ea4('0x17'));var db=require(_0x6ea4('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x6ea4('0x19'));var client=jayson['client'][_0x6ea4('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x5db0f8,_0x556c24,_0x4b8a93){if(_0x4b8a93){var _0x388c33=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x388c33['test'](_0x556c24)){return _0x5db0f8;}else{throw new db[(_0x6ea4('0x1b'))][(_0x6ea4('0x1c'))](_0x6ea4('0x1d'));}}else{return _0x5db0f8;}}function respondWithRpcPromise(_0x108f29,_0x140bc7,_0x55e9d8,_0x48ad6e){return new BPromise(function(_0x4f4eb8,_0x1d928c){var _0x12f03f=_0x48ad6e||client;return _0x12f03f[_0x6ea4('0x1e')](_0x108f29,_0x55e9d8)[_0x6ea4('0x1f')](function(_0x349e8c){logger[_0x6ea4('0x20')](_0x6ea4('0x21'),_0x140bc7,_0x6ea4('0x22'));logger[_0x6ea4('0x23')]('ZendeskAccount,\x20%s,\x20%s,\x20%s',_0x140bc7,_0x6ea4('0x22'),JSON[_0x6ea4('0x24')](_0x349e8c));if(_0x349e8c[_0x6ea4('0x25')]){if(_0x349e8c['error'][_0x6ea4('0x26')]===0x1f4){logger['error'](_0x6ea4('0x21'),_0x140bc7,_0x349e8c['error'][_0x6ea4('0x27')]);return _0x1d928c(_0x349e8c[_0x6ea4('0x25')][_0x6ea4('0x27')]);}logger['error'](_0x6ea4('0x21'),_0x140bc7,_0x349e8c[_0x6ea4('0x25')][_0x6ea4('0x27')]);return _0x4f4eb8(_0x349e8c['error']['message']);}else{logger['info'](_0x6ea4('0x21'),_0x140bc7,'request\x20sent');_0x4f4eb8(_0x349e8c[_0x6ea4('0x28')]['message']);}})[_0x6ea4('0x29')](function(_0x297120){logger['error'](_0x6ea4('0x21'),_0x140bc7,_0x297120);_0x1d928c(_0x297120);});});}function respondWithStatusCode(_0x25f74c,_0x2e2bca){_0x2e2bca=_0x2e2bca||0xcc;return function(_0x4bcdbb){if(_0x4bcdbb){return _0x25f74c[_0x6ea4('0x2a')](_0x2e2bca);}return _0x25f74c[_0x6ea4('0x2b')](_0x2e2bca)[_0x6ea4('0x2c')]();};}function respondWithResult(_0x3957c8,_0x3c8d05){_0x3c8d05=_0x3c8d05||0xc8;return function(_0x2d4826){if(_0x2d4826){return _0x3957c8['status'](_0x3c8d05)['json'](_0x2d4826);}};}function respondWithFilteredResult(_0x236358,_0x176e6e){return function(_0x208c47){if(_0x208c47){var _0x45f91e=_0x208c47['count'],_0x3d2413=_0x176e6e[_0x6ea4('0x2d')],_0xc42b6d=_0x176e6e[_0x6ea4('0x2d')]+_0x176e6e[_0x6ea4('0x2e')],_0x4c8aee;if(_0xc42b6d>=_0x45f91e){_0xc42b6d=_0x45f91e;_0x4c8aee=0xc8;}else{_0x4c8aee=0xce;}_0x236358[_0x6ea4('0x2b')](_0x4c8aee);return _0x236358[_0x6ea4('0x2f')](_0x6ea4('0x30'),_0x3d2413+'-'+_0xc42b6d+'/'+_0x45f91e)[_0x6ea4('0x31')](_0x208c47);}return null;};}function patchUpdates(_0x258f50){return function(_0xe1e760){try{jsonpatch['apply'](_0xe1e760,_0x258f50,!![]);}catch(_0x50c4ee){return BPromise['reject'](_0x50c4ee);}return _0xe1e760[_0x6ea4('0x32')]();};}function saveUpdates(_0x1e1bb1,_0x15edd8){return function(_0x6b6f54){if(_0x6b6f54){return _0x6b6f54[_0x6ea4('0x33')](_0x1e1bb1)['then'](function(_0x129a80){return _0x129a80;});}return null;};}function removeEntity(_0x4ed13f,_0x4f5b2a){return function(_0x3d5410){if(_0x3d5410){return _0x3d5410[_0x6ea4('0x34')]()[_0x6ea4('0x1f')](function(){_0x4ed13f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3d06ca,_0x52c0f6){return function(_0x310e1a){if(!_0x310e1a){_0x3d06ca['sendStatus'](0x194);}return _0x310e1a;};}function handleError(_0x44f868,_0x27c6f2){_0x27c6f2=_0x27c6f2||0x1f4;return function(_0x5f56b2){logger[_0x6ea4('0x25')](_0x5f56b2[_0x6ea4('0x35')]);if(_0x5f56b2[_0x6ea4('0x36')]){delete _0x5f56b2['name'];}_0x44f868[_0x6ea4('0x2b')](_0x27c6f2)[_0x6ea4('0x37')](_0x5f56b2);};}exports['index']=function(_0x471bc4,_0x16d76c){var _0x3f454a={},_0x247cb1={},_0x40e4b6={'count':0x0,'rows':[]};var _0x4a3f98=_['map'](db[_0x6ea4('0x38')][_0x6ea4('0x39')],function(_0x215663){return{'name':_0x215663[_0x6ea4('0x3a')],'type':_0x215663[_0x6ea4('0x3b')][_0x6ea4('0x3c')]};});_0x247cb1[_0x6ea4('0x3d')]=_['map'](_0x4a3f98,_0x6ea4('0x36'));_0x247cb1[_0x6ea4('0x3e')]=_['keys'](_0x471bc4['query']);_0x247cb1[_0x6ea4('0x3f')]=_[_0x6ea4('0x40')](_0x247cb1['model'],_0x247cb1[_0x6ea4('0x3e')]);_0x3f454a[_0x6ea4('0x41')]=_[_0x6ea4('0x40')](_0x247cb1['model'],qs[_0x6ea4('0x42')](_0x471bc4['query']['fields']));_0x3f454a['attributes']=_0x3f454a['attributes']['length']?_0x3f454a[_0x6ea4('0x41')]:_0x247cb1['model'];if(!_0x471bc4[_0x6ea4('0x3e')]['hasOwnProperty'](_0x6ea4('0x43'))){_0x3f454a['limit']=qs[_0x6ea4('0x2e')](_0x471bc4[_0x6ea4('0x3e')][_0x6ea4('0x2e')]);_0x3f454a['offset']=qs[_0x6ea4('0x2d')](_0x471bc4[_0x6ea4('0x3e')][_0x6ea4('0x2d')]);}_0x3f454a['order']=qs[_0x6ea4('0x44')](_0x471bc4[_0x6ea4('0x3e')][_0x6ea4('0x44')]);_0x3f454a[_0x6ea4('0x45')]=qs[_0x6ea4('0x3f')](_[_0x6ea4('0x46')](_0x471bc4[_0x6ea4('0x3e')],_0x247cb1[_0x6ea4('0x3f')]));if(_0x471bc4[_0x6ea4('0x3e')][_0x6ea4('0x47')]){_0x3f454a['where']=_['merge'](_0x3f454a[_0x6ea4('0x45')],{'$or':_['map'](_0x4a3f98,function(_0x55f154){if(_0x55f154['type']!==_0x6ea4('0x48')){var _0x1682c3={};_0x1682c3[_0x55f154[_0x6ea4('0x36')]]={'$like':'%'+_0x471bc4[_0x6ea4('0x3e')]['filter']+'%'};return _0x1682c3;}})});}_0x3f454a=_[_0x6ea4('0x49')]({},_0x3f454a,_0x471bc4[_0x6ea4('0x4a')]);var _0x1da85a={'where':_0x3f454a[_0x6ea4('0x45')]};return db[_0x6ea4('0x38')][_0x6ea4('0x4b')](_0x1da85a)[_0x6ea4('0x1f')](function(_0x1030a1){_0x40e4b6[_0x6ea4('0x4b')]=_0x1030a1;if(_0x471bc4[_0x6ea4('0x3e')]['includeAll']){_0x3f454a[_0x6ea4('0x4c')]=[{'all':!![]}];}return db[_0x6ea4('0x38')][_0x6ea4('0x4d')](_0x3f454a);})[_0x6ea4('0x1f')](function(_0x3e67db){_0x40e4b6[_0x6ea4('0x4e')]=_0x3e67db;return _0x40e4b6;})[_0x6ea4('0x1f')](respondWithFilteredResult(_0x16d76c,_0x3f454a))[_0x6ea4('0x29')](handleError(_0x16d76c,null));};exports[_0x6ea4('0x4f')]=function(_0x36dbbf,_0x1e6202){var _0x3f544a={'raw':![],'where':{'id':_0x36dbbf[_0x6ea4('0x50')]['id']}},_0x33831a={};_0x33831a[_0x6ea4('0x3d')]=_[_0x6ea4('0x51')](db[_0x6ea4('0x38')]['rawAttributes']);_0x33831a[_0x6ea4('0x3e')]=_['keys'](_0x36dbbf[_0x6ea4('0x3e')]);_0x33831a[_0x6ea4('0x3f')]=_['intersection'](_0x33831a[_0x6ea4('0x3d')],_0x33831a[_0x6ea4('0x3e')]);_0x3f544a[_0x6ea4('0x41')]=_['intersection'](_0x33831a['model'],qs[_0x6ea4('0x42')](_0x36dbbf[_0x6ea4('0x3e')][_0x6ea4('0x42')]));_0x3f544a[_0x6ea4('0x41')]=_0x3f544a[_0x6ea4('0x41')][_0x6ea4('0x52')]?_0x3f544a[_0x6ea4('0x41')]:_0x33831a[_0x6ea4('0x3d')];if(_0x36dbbf[_0x6ea4('0x3e')][_0x6ea4('0x53')]){_0x3f544a['include']=[{'all':!![]}];}_0x3f544a=_[_0x6ea4('0x49')]({},_0x3f544a,_0x36dbbf['options']);return db[_0x6ea4('0x38')][_0x6ea4('0x54')](_0x3f544a)[_0x6ea4('0x1f')](handleEntityNotFound(_0x1e6202,null))[_0x6ea4('0x1f')](respondWithResult(_0x1e6202,null))[_0x6ea4('0x29')](handleError(_0x1e6202,null));};exports[_0x6ea4('0x55')]=function(_0x5bc726,_0x585608){return db[_0x6ea4('0x38')][_0x6ea4('0x55')](_0x5bc726[_0x6ea4('0x56')],{})[_0x6ea4('0x1f')](respondWithResult(_0x585608,0xc9))[_0x6ea4('0x29')](handleError(_0x585608,null));};exports['update']=function(_0x5e6b94,_0x23816a){if(_0x5e6b94[_0x6ea4('0x56')]['id']){delete _0x5e6b94[_0x6ea4('0x56')]['id'];}return db['ZendeskAccount'][_0x6ea4('0x54')]({'where':{'id':_0x5e6b94['params']['id']}})[_0x6ea4('0x1f')](handleEntityNotFound(_0x23816a,null))['then'](saveUpdates(_0x5e6b94[_0x6ea4('0x56')],null))[_0x6ea4('0x1f')](respondWithResult(_0x23816a,null))[_0x6ea4('0x29')](handleError(_0x23816a,null));};exports[_0x6ea4('0x34')]=function(_0x571526,_0x5bb793){return db[_0x6ea4('0x38')][_0x6ea4('0x54')]({'where':{'id':_0x571526[_0x6ea4('0x50')]['id']}})[_0x6ea4('0x1f')](handleEntityNotFound(_0x5bb793,null))[_0x6ea4('0x1f')](removeEntity(_0x5bb793,null))[_0x6ea4('0x29')](handleError(_0x5bb793,null));};exports[_0x6ea4('0x57')]=function(_0x10417e,_0x442b79,_0x5c2a95){var _0x25eae6={};var _0x2bee0b={};var _0xc6db35;var _0x2fdf7f;return db[_0x6ea4('0x38')][_0x6ea4('0x58')]({'where':{'id':_0x10417e[_0x6ea4('0x50')]['id']}})['then'](handleEntityNotFound(_0x442b79,null))['then'](function(_0x2c28d3){if(_0x2c28d3){_0xc6db35=_0x2c28d3;_0x2bee0b['model']=_[_0x6ea4('0x51')](db[_0x6ea4('0x59')]['rawAttributes']);_0x2bee0b[_0x6ea4('0x3e')]=_[_0x6ea4('0x51')](_0x10417e[_0x6ea4('0x3e')]);_0x2bee0b[_0x6ea4('0x3f')]=_['intersection'](_0x2bee0b[_0x6ea4('0x3d')],_0x2bee0b['query']);_0x25eae6[_0x6ea4('0x41')]=_['intersection'](_0x2bee0b[_0x6ea4('0x3d')],qs[_0x6ea4('0x42')](_0x10417e[_0x6ea4('0x3e')][_0x6ea4('0x42')]));_0x25eae6['attributes']=_0x25eae6[_0x6ea4('0x41')][_0x6ea4('0x52')]?_0x25eae6[_0x6ea4('0x41')]:_0x2bee0b[_0x6ea4('0x3d')];_0x25eae6[_0x6ea4('0x5a')]=qs[_0x6ea4('0x44')](_0x10417e[_0x6ea4('0x3e')]['sort']);_0x25eae6[_0x6ea4('0x45')]=qs[_0x6ea4('0x3f')](_[_0x6ea4('0x46')](_0x10417e[_0x6ea4('0x3e')],_0x2bee0b[_0x6ea4('0x3f')]));if(_0x10417e['query'][_0x6ea4('0x47')]){_0x25eae6[_0x6ea4('0x45')]=_[_0x6ea4('0x49')](_0x25eae6[_0x6ea4('0x45')],{'$or':_[_0x6ea4('0x5b')](_0x25eae6['attributes'],function(_0x288f0e){var _0x5a468d={};_0x5a468d[_0x288f0e]={'$like':'%'+_0x10417e[_0x6ea4('0x3e')][_0x6ea4('0x47')]+'%'};return _0x5a468d;})});}_0x25eae6=_[_0x6ea4('0x49')]({},_0x25eae6,_0x10417e['options']);return _0xc6db35[_0x6ea4('0x57')](_0x25eae6);}})['then'](function(_0x249f01){if(_0x249f01){_0x2fdf7f=_0x249f01[_0x6ea4('0x52')];if(!_0x10417e[_0x6ea4('0x3e')][_0x6ea4('0x5c')](_0x6ea4('0x43'))){_0x25eae6[_0x6ea4('0x2e')]=qs[_0x6ea4('0x2e')](_0x10417e[_0x6ea4('0x3e')]['limit']);_0x25eae6[_0x6ea4('0x2d')]=qs[_0x6ea4('0x2d')](_0x10417e[_0x6ea4('0x3e')]['offset']);}return _0xc6db35[_0x6ea4('0x57')](_0x25eae6);}})[_0x6ea4('0x1f')](function(_0x33751e){if(_0x33751e){return _0x33751e?{'count':_0x2fdf7f,'rows':_0x33751e}:null;}})[_0x6ea4('0x1f')](respondWithResult(_0x442b79,null))['catch'](handleError(_0x442b79,null));};exports[_0x6ea4('0x5d')]=function(_0x37d471,_0x15a66a,_0x14708b){if(_0x37d471[_0x6ea4('0x56')]['id']){delete _0x37d471[_0x6ea4('0x56')]['id'];}return db[_0x6ea4('0x38')][_0x6ea4('0x58')]({'where':{'id':_0x37d471[_0x6ea4('0x50')]['id']}})[_0x6ea4('0x1f')](handleEntityNotFound(_0x15a66a,null))['then'](function(_0x37f175){if(_0x37f175){_0x37d471[_0x6ea4('0x56')][_0x6ea4('0x5e')]=_0x37f175['id'];_0x37d471[_0x6ea4('0x56')]['Subjects']=integrations[_0x6ea4('0x5f')](_0x37d471[_0x6ea4('0x56')][_0x6ea4('0x60')],_0x37d471[_0x6ea4('0x56')][_0x6ea4('0x3b')]);_0x37d471[_0x6ea4('0x56')][_0x6ea4('0x61')]=integrations[_0x6ea4('0x62')](_0x37d471['body'][_0x6ea4('0x60')],_0x37d471['body'][_0x6ea4('0x3b')]);return db[_0x6ea4('0x59')][_0x6ea4('0x55')](_0x37d471[_0x6ea4('0x56')],{'include':[{'model':db[_0x6ea4('0x63')],'as':'Subjects'},{'model':db[_0x6ea4('0x63')],'as':_0x6ea4('0x61')}]});}return null;})[_0x6ea4('0x1f')](respondWithResult(_0x15a66a,null))['catch'](handleError(_0x15a66a,null));};exports[_0x6ea4('0x64')]=function(_0x1d2a62,_0x3eceda,_0x5d41be){var _0x2e2512='';return db[_0x6ea4('0x38')][_0x6ea4('0x58')]({'where':{'id':_0x1d2a62[_0x6ea4('0x50')]['id']},'attributes':['id',_0x6ea4('0x65'),_0x6ea4('0x66'),'token',_0x6ea4('0x67'),'remoteUri']})[_0x6ea4('0x1f')](handleEntityNotFound(_0x3eceda,null))[_0x6ea4('0x1f')](function(_0x5a581a){if(_0x5a581a){_0x2e2512=_0x5a581a[_0x6ea4('0x68')];var _0x57d42c=_0x2e2512['slice'](-0x1);if(_0x57d42c==='/'){_0x2e2512=_0x2e2512[_0x6ea4('0x69')](0x0,_0x2e2512[_0x6ea4('0x6a')](_0x57d42c));}var _0x1a7881={'method':_0x6ea4('0x6b'),'uri':util[_0x6ea4('0x6c')](_0x6ea4('0x6d'),_0x2e2512,'ticket_fields'),'json':!![]};switch(_0x5a581a[_0x6ea4('0x67')]){case _0x6ea4('0x66'):_0x1a7881[_0x6ea4('0x6e')]={'Authorization':util[_0x6ea4('0x6c')](_0x6ea4('0x6f'),new Buffer(util['format'](_0x6ea4('0x70'),_0x5a581a[_0x6ea4('0x65')],_0x5a581a[_0x6ea4('0x66')]))[_0x6ea4('0x71')](_0x6ea4('0x72')))};break;case _0x6ea4('0x73'):_0x1a7881[_0x6ea4('0x6e')]={'Authorization':util[_0x6ea4('0x6c')](_0x6ea4('0x6f'),new Buffer(util[_0x6ea4('0x6c')](_0x6ea4('0x74'),_0x5a581a[_0x6ea4('0x65')],_0x5a581a[_0x6ea4('0x73')]))[_0x6ea4('0x71')]('base64'))};break;default:throw new db[(_0x6ea4('0x1b'))][(_0x6ea4('0x1c'))]('Unknown\x20authentication\x20type');}return rp(_0x1a7881);}})['then'](function(_0x5e158c){if(_0x5e158c){var _0x81efad=['subject',_0x6ea4('0x75'),_0x6ea4('0x76'),_0x6ea4('0x77')];_[_0x6ea4('0x78')](_0x5e158c[_0x6ea4('0x79')],function(_0xbe16ab){return _0x81efad[_0x6ea4('0x7a')](_0xbe16ab[_0x6ea4('0x3b')]);});return{'count':_0x5e158c[_0x6ea4('0x79')]['length'],'rows':_[_0x6ea4('0x5b')](_0x5e158c[_0x6ea4('0x79')],function(_0x17451c){return{'id':_0x17451c['id'],'name':_0x17451c[_0x6ea4('0x7b')]>0x7?_0x17451c[_0x6ea4('0x7c')]:_0x17451c[_0x6ea4('0x3b')],'custom':_0x17451c[_0x6ea4('0x7b')]>0x7?!![]:![],'options':_0x17451c[_0x6ea4('0x7d')]?_0x17451c[_0x6ea4('0x7d')]:_0x17451c[_0x6ea4('0x7e')]?_0x17451c[_0x6ea4('0x7e')]:[]};})};}})[_0x6ea4('0x1f')](respondWithResult(_0x3eceda,null))[_0x6ea4('0x29')](function(_0x3a36c8){var _0x3630c0=_0x1d2a62[_0x6ea4('0x3e')][_0x6ea4('0x7f')]?0x1f4:_0x3a36c8['statusCode']||0x1f4;logger[_0x6ea4('0x25')](_0x6ea4('0x80'),'getFields',_0x3630c0,JSON[_0x6ea4('0x24')](_0x3a36c8));delete _0x3a36c8[_0x6ea4('0x36')];if(_0x3630c0===0x191){_0x3630c0=0x190;}_0x3eceda['status'](_0x3630c0)[_0x6ea4('0x37')](_0x1d2a62['query']['test']?{'message':_0x6ea4('0x81'),'statusCode':_0x3a36c8['statusCode']}:_0x3a36c8);});}; \ No newline at end of file +var _0xe19f=['findOne','ZendeskConfiguration','order','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZendeskField','getFields','password','token','authType','slice','substring','lastIndexOf','format','%s/%s','ticket_fields','headers','username','toString','base64','Basic\x20%s','Sequelize','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','includes','position','system_field_options','custom_field_options','statusCode','eml-format','rimraf','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','map','ZendeskAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','count','includeAll','include','findAll','rows','show','params','intersection','find','create','body','getConfigurations'];(function(_0x17d272,_0x46f53e){var _0x4bd900=function(_0x613c21){while(--_0x613c21){_0x17d272['push'](_0x17d272['shift']());}};_0x4bd900(++_0x46f53e);}(_0xe19f,0x190));var _0xfe19=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe19f[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfe19('0x0'));var rimraf=require(_0xfe19('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfe19('0x2'));var BPromise=require(_0xfe19('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xfe19('0x4'));var sox=require(_0xfe19('0x5'));var csv=require(_0xfe19('0x6'));var ejs=require(_0xfe19('0x7'));var fs=require('fs');var _=require(_0xfe19('0x8'));var squel=require(_0xfe19('0x9'));var crypto=require(_0xfe19('0xa'));var jsforce=require(_0xfe19('0xb'));var deskjs=require(_0xfe19('0xc'));var toCsv=require(_0xfe19('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xfe19('0xd'));var authService=require(_0xfe19('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xfe19('0xf'));var hardwareService=require(_0xfe19('0x10'));var logger=require('../../config/logger')(_0xfe19('0x11'));var utils=require(_0xfe19('0x12'));var config=require(_0xfe19('0x13'));var db=require(_0xfe19('0x14'))['db'];var integrations=require(_0xfe19('0x15'));var jayson=require('jayson/promise');var client=jayson[_0xfe19('0x16')][_0xfe19('0x17')]({'port':0x232a});function checkPasswordPattern(_0x550b49,_0x3faa18,_0x2a9adf){if(_0x2a9adf){var _0x180294=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x180294[_0xfe19('0x18')](_0x3faa18)){return _0x550b49;}else{throw new db['Sequelize'][(_0xfe19('0x19'))](_0xfe19('0x1a'));}}else{return _0x550b49;}}function respondWithRpcPromise(_0x4a291f,_0x30ecc3,_0x15213f,_0x2e60de){return new BPromise(function(_0x45e6f0,_0x334307){var _0x14dae2=_0x2e60de||client;return _0x14dae2[_0xfe19('0x1b')](_0x4a291f,_0x15213f)['then'](function(_0xe8b1ee){logger['info'](_0xfe19('0x1c'),_0x30ecc3,_0xfe19('0x1d'));logger['debug'](_0xfe19('0x1e'),_0x30ecc3,'request\x20sent',JSON[_0xfe19('0x1f')](_0xe8b1ee));if(_0xe8b1ee[_0xfe19('0x20')]){if(_0xe8b1ee[_0xfe19('0x20')][_0xfe19('0x21')]===0x1f4){logger['error'](_0xfe19('0x1c'),_0x30ecc3,_0xe8b1ee[_0xfe19('0x20')][_0xfe19('0x22')]);return _0x334307(_0xe8b1ee[_0xfe19('0x20')]['message']);}logger[_0xfe19('0x20')](_0xfe19('0x1c'),_0x30ecc3,_0xe8b1ee['error']['message']);return _0x45e6f0(_0xe8b1ee[_0xfe19('0x20')]['message']);}else{logger[_0xfe19('0x23')](_0xfe19('0x1c'),_0x30ecc3,_0xfe19('0x1d'));_0x45e6f0(_0xe8b1ee[_0xfe19('0x24')][_0xfe19('0x22')]);}})[_0xfe19('0x25')](function(_0xdb5a14){logger[_0xfe19('0x20')]('ZendeskAccount,\x20%s,\x20%s',_0x30ecc3,_0xdb5a14);_0x334307(_0xdb5a14);});});}function respondWithStatusCode(_0x38f055,_0x52e345){_0x52e345=_0x52e345||0xcc;return function(_0x15fbc4){if(_0x15fbc4){return _0x38f055[_0xfe19('0x26')](_0x52e345);}return _0x38f055[_0xfe19('0x27')](_0x52e345)['end']();};}function respondWithResult(_0x131c5b,_0x447a16){_0x447a16=_0x447a16||0xc8;return function(_0x528400){if(_0x528400){return _0x131c5b[_0xfe19('0x27')](_0x447a16)[_0xfe19('0x28')](_0x528400);}};}function respondWithFilteredResult(_0x1ff339,_0x583e1d){return function(_0x41d3dc){if(_0x41d3dc){var _0x125a9b=_0x41d3dc['count'],_0x10f74d=_0x583e1d[_0xfe19('0x29')],_0xd57209=_0x583e1d[_0xfe19('0x29')]+_0x583e1d[_0xfe19('0x2a')],_0x2d63f8;if(_0xd57209>=_0x125a9b){_0xd57209=_0x125a9b;_0x2d63f8=0xc8;}else{_0x2d63f8=0xce;}_0x1ff339[_0xfe19('0x27')](_0x2d63f8);return _0x1ff339[_0xfe19('0x2b')](_0xfe19('0x2c'),_0x10f74d+'-'+_0xd57209+'/'+_0x125a9b)[_0xfe19('0x28')](_0x41d3dc);}return null;};}function patchUpdates(_0x19e529){return function(_0x15860a){try{jsonpatch['apply'](_0x15860a,_0x19e529,!![]);}catch(_0x408635){return BPromise[_0xfe19('0x2d')](_0x408635);}return _0x15860a['save']();};}function saveUpdates(_0x49e1b7,_0x49f6b3){return function(_0x553422){if(_0x553422){return _0x553422[_0xfe19('0x2e')](_0x49e1b7)[_0xfe19('0x2f')](function(_0xc3e12d){return _0xc3e12d;});}return null;};}function removeEntity(_0x581732,_0xb17d58){return function(_0x1d008a){if(_0x1d008a){return _0x1d008a[_0xfe19('0x30')]()[_0xfe19('0x2f')](function(){_0x581732[_0xfe19('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23b913,_0x365b4d){return function(_0x23b8d5){if(!_0x23b8d5){_0x23b913[_0xfe19('0x26')](0x194);}return _0x23b8d5;};}function handleError(_0x3bb0a8,_0x5108fd){_0x5108fd=_0x5108fd||0x1f4;return function(_0x32cf06){logger[_0xfe19('0x20')](_0x32cf06[_0xfe19('0x31')]);if(_0x32cf06[_0xfe19('0x32')]){delete _0x32cf06[_0xfe19('0x32')];}_0x3bb0a8[_0xfe19('0x27')](_0x5108fd)[_0xfe19('0x33')](_0x32cf06);};}exports['index']=function(_0x21f811,_0x2e127a){var _0x5159a8={},_0xc458ae={},_0x386356={'count':0x0,'rows':[]};var _0x425047=_[_0xfe19('0x34')](db[_0xfe19('0x35')][_0xfe19('0x36')],function(_0x47da33){return{'name':_0x47da33[_0xfe19('0x37')],'type':_0x47da33[_0xfe19('0x38')][_0xfe19('0x39')]};});_0xc458ae['model']=_['map'](_0x425047,_0xfe19('0x32'));_0xc458ae[_0xfe19('0x3a')]=_[_0xfe19('0x3b')](_0x21f811['query']);_0xc458ae[_0xfe19('0x3c')]=_['intersection'](_0xc458ae[_0xfe19('0x3d')],_0xc458ae['query']);_0x5159a8[_0xfe19('0x3e')]=_['intersection'](_0xc458ae[_0xfe19('0x3d')],qs[_0xfe19('0x3f')](_0x21f811[_0xfe19('0x3a')][_0xfe19('0x3f')]));_0x5159a8[_0xfe19('0x3e')]=_0x5159a8['attributes'][_0xfe19('0x40')]?_0x5159a8[_0xfe19('0x3e')]:_0xc458ae[_0xfe19('0x3d')];if(!_0x21f811['query'][_0xfe19('0x41')]('nolimit')){_0x5159a8[_0xfe19('0x2a')]=qs['limit'](_0x21f811[_0xfe19('0x3a')]['limit']);_0x5159a8[_0xfe19('0x29')]=qs[_0xfe19('0x29')](_0x21f811[_0xfe19('0x3a')]['offset']);}_0x5159a8['order']=qs[_0xfe19('0x42')](_0x21f811[_0xfe19('0x3a')][_0xfe19('0x42')]);_0x5159a8['where']=qs[_0xfe19('0x3c')](_[_0xfe19('0x43')](_0x21f811[_0xfe19('0x3a')],_0xc458ae[_0xfe19('0x3c')]));if(_0x21f811['query'][_0xfe19('0x44')]){_0x5159a8[_0xfe19('0x45')]=_[_0xfe19('0x46')](_0x5159a8[_0xfe19('0x45')],{'$or':_[_0xfe19('0x34')](_0x425047,function(_0x4ebf04){if(_0x4ebf04[_0xfe19('0x38')]!=='VIRTUAL'){var _0x4f01c4={};_0x4f01c4[_0x4ebf04[_0xfe19('0x32')]]={'$like':'%'+_0x21f811['query'][_0xfe19('0x44')]+'%'};return _0x4f01c4;}})});}_0x5159a8=_[_0xfe19('0x46')]({},_0x5159a8,_0x21f811[_0xfe19('0x47')]);var _0x63fc6c={'where':_0x5159a8[_0xfe19('0x45')]};return db[_0xfe19('0x35')][_0xfe19('0x48')](_0x63fc6c)[_0xfe19('0x2f')](function(_0xda7dc1){_0x386356['count']=_0xda7dc1;if(_0x21f811[_0xfe19('0x3a')][_0xfe19('0x49')]){_0x5159a8[_0xfe19('0x4a')]=[{'all':!![]}];}return db[_0xfe19('0x35')][_0xfe19('0x4b')](_0x5159a8);})[_0xfe19('0x2f')](function(_0x56c2d0){_0x386356[_0xfe19('0x4c')]=_0x56c2d0;return _0x386356;})[_0xfe19('0x2f')](respondWithFilteredResult(_0x2e127a,_0x5159a8))[_0xfe19('0x25')](handleError(_0x2e127a,null));};exports[_0xfe19('0x4d')]=function(_0x4f67a7,_0x47bc54){var _0x13c67e={'raw':![],'where':{'id':_0x4f67a7[_0xfe19('0x4e')]['id']}},_0x1a9dbe={};_0x1a9dbe[_0xfe19('0x3d')]=_[_0xfe19('0x3b')](db[_0xfe19('0x35')][_0xfe19('0x36')]);_0x1a9dbe[_0xfe19('0x3a')]=_[_0xfe19('0x3b')](_0x4f67a7['query']);_0x1a9dbe[_0xfe19('0x3c')]=_['intersection'](_0x1a9dbe[_0xfe19('0x3d')],_0x1a9dbe[_0xfe19('0x3a')]);_0x13c67e['attributes']=_[_0xfe19('0x4f')](_0x1a9dbe[_0xfe19('0x3d')],qs[_0xfe19('0x3f')](_0x4f67a7[_0xfe19('0x3a')]['fields']));_0x13c67e[_0xfe19('0x3e')]=_0x13c67e[_0xfe19('0x3e')][_0xfe19('0x40')]?_0x13c67e['attributes']:_0x1a9dbe[_0xfe19('0x3d')];if(_0x4f67a7[_0xfe19('0x3a')]['includeAll']){_0x13c67e['include']=[{'all':!![]}];}_0x13c67e=_[_0xfe19('0x46')]({},_0x13c67e,_0x4f67a7[_0xfe19('0x47')]);return db[_0xfe19('0x35')][_0xfe19('0x50')](_0x13c67e)['then'](handleEntityNotFound(_0x47bc54,null))[_0xfe19('0x2f')](respondWithResult(_0x47bc54,null))['catch'](handleError(_0x47bc54,null));};exports[_0xfe19('0x51')]=function(_0x460c1b,_0x175f88){return db[_0xfe19('0x35')][_0xfe19('0x51')](_0x460c1b[_0xfe19('0x52')],{})[_0xfe19('0x2f')](respondWithResult(_0x175f88,0xc9))[_0xfe19('0x25')](handleError(_0x175f88,null));};exports['update']=function(_0x303338,_0x3080a1){if(_0x303338[_0xfe19('0x52')]['id']){delete _0x303338[_0xfe19('0x52')]['id'];}return db[_0xfe19('0x35')][_0xfe19('0x50')]({'where':{'id':_0x303338[_0xfe19('0x4e')]['id']}})[_0xfe19('0x2f')](handleEntityNotFound(_0x3080a1,null))[_0xfe19('0x2f')](saveUpdates(_0x303338[_0xfe19('0x52')],null))[_0xfe19('0x2f')](respondWithResult(_0x3080a1,null))[_0xfe19('0x25')](handleError(_0x3080a1,null));};exports[_0xfe19('0x30')]=function(_0x2fddef,_0x3a54a3){return db['ZendeskAccount'][_0xfe19('0x50')]({'where':{'id':_0x2fddef['params']['id']}})[_0xfe19('0x2f')](handleEntityNotFound(_0x3a54a3,null))['then'](removeEntity(_0x3a54a3,null))[_0xfe19('0x25')](handleError(_0x3a54a3,null));};exports[_0xfe19('0x53')]=function(_0x185a56,_0x1eedeb,_0x115077){var _0x27af7d={};var _0x4ba0bf={};var _0x1c801e;var _0x2cf0d4;return db[_0xfe19('0x35')][_0xfe19('0x54')]({'where':{'id':_0x185a56[_0xfe19('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1eedeb,null))[_0xfe19('0x2f')](function(_0x40a838){if(_0x40a838){_0x1c801e=_0x40a838;_0x4ba0bf[_0xfe19('0x3d')]=_[_0xfe19('0x3b')](db[_0xfe19('0x55')]['rawAttributes']);_0x4ba0bf[_0xfe19('0x3a')]=_[_0xfe19('0x3b')](_0x185a56[_0xfe19('0x3a')]);_0x4ba0bf[_0xfe19('0x3c')]=_['intersection'](_0x4ba0bf[_0xfe19('0x3d')],_0x4ba0bf[_0xfe19('0x3a')]);_0x27af7d[_0xfe19('0x3e')]=_[_0xfe19('0x4f')](_0x4ba0bf[_0xfe19('0x3d')],qs['fields'](_0x185a56[_0xfe19('0x3a')]['fields']));_0x27af7d[_0xfe19('0x3e')]=_0x27af7d[_0xfe19('0x3e')][_0xfe19('0x40')]?_0x27af7d['attributes']:_0x4ba0bf[_0xfe19('0x3d')];_0x27af7d[_0xfe19('0x56')]=qs[_0xfe19('0x42')](_0x185a56[_0xfe19('0x3a')][_0xfe19('0x42')]);_0x27af7d[_0xfe19('0x45')]=qs[_0xfe19('0x3c')](_[_0xfe19('0x43')](_0x185a56[_0xfe19('0x3a')],_0x4ba0bf[_0xfe19('0x3c')]));if(_0x185a56[_0xfe19('0x3a')][_0xfe19('0x44')]){_0x27af7d[_0xfe19('0x45')]=_[_0xfe19('0x46')](_0x27af7d[_0xfe19('0x45')],{'$or':_['map'](_0x27af7d[_0xfe19('0x3e')],function(_0x511e46){var _0x2f55a4={};_0x2f55a4[_0x511e46]={'$like':'%'+_0x185a56[_0xfe19('0x3a')][_0xfe19('0x44')]+'%'};return _0x2f55a4;})});}_0x27af7d=_[_0xfe19('0x46')]({},_0x27af7d,_0x185a56[_0xfe19('0x47')]);return _0x1c801e[_0xfe19('0x53')](_0x27af7d);}})[_0xfe19('0x2f')](function(_0x11beac){if(_0x11beac){_0x2cf0d4=_0x11beac[_0xfe19('0x40')];if(!_0x185a56[_0xfe19('0x3a')][_0xfe19('0x41')]('nolimit')){_0x27af7d[_0xfe19('0x2a')]=qs[_0xfe19('0x2a')](_0x185a56[_0xfe19('0x3a')][_0xfe19('0x2a')]);_0x27af7d[_0xfe19('0x29')]=qs[_0xfe19('0x29')](_0x185a56['query']['offset']);}return _0x1c801e['getConfigurations'](_0x27af7d);}})['then'](function(_0x15ea2f){if(_0x15ea2f){return _0x15ea2f?{'count':_0x2cf0d4,'rows':_0x15ea2f}:null;}})['then'](respondWithResult(_0x1eedeb,null))['catch'](handleError(_0x1eedeb,null));};exports[_0xfe19('0x57')]=function(_0x128177,_0xa373da,_0x161208){if(_0x128177['body']['id']){delete _0x128177[_0xfe19('0x52')]['id'];}return db['ZendeskAccount'][_0xfe19('0x54')]({'where':{'id':_0x128177['params']['id']}})[_0xfe19('0x2f')](handleEntityNotFound(_0xa373da,null))['then'](function(_0x3c0acb){if(_0x3c0acb){_0x128177['body']['AccountId']=_0x3c0acb['id'];_0x128177[_0xfe19('0x52')][_0xfe19('0x58')]=integrations[_0xfe19('0x59')](_0x128177['body'][_0xfe19('0x5a')],_0x128177[_0xfe19('0x52')][_0xfe19('0x38')]);_0x128177[_0xfe19('0x52')][_0xfe19('0x5b')]=integrations[_0xfe19('0x5c')](_0x128177['body']['channel'],_0x128177['body'][_0xfe19('0x38')]);return db['ZendeskConfiguration'][_0xfe19('0x51')](_0x128177[_0xfe19('0x52')],{'include':[{'model':db[_0xfe19('0x5d')],'as':_0xfe19('0x58')},{'model':db[_0xfe19('0x5d')],'as':'Descriptions'}]});}return null;})[_0xfe19('0x2f')](respondWithResult(_0xa373da,null))[_0xfe19('0x25')](handleError(_0xa373da,null));};exports[_0xfe19('0x5e')]=function(_0x3caa72,_0x1f6844,_0x21de8b){var _0x3f1954='';return db['ZendeskAccount']['findOne']({'where':{'id':_0x3caa72[_0xfe19('0x4e')]['id']},'attributes':['id','username',_0xfe19('0x5f'),_0xfe19('0x60'),_0xfe19('0x61'),'remoteUri']})[_0xfe19('0x2f')](handleEntityNotFound(_0x1f6844,null))[_0xfe19('0x2f')](function(_0x10f1f9){if(_0x10f1f9){_0x3f1954=_0x10f1f9['remoteUri'];var _0x5a7983=_0x3f1954[_0xfe19('0x62')](-0x1);if(_0x5a7983==='/'){_0x3f1954=_0x3f1954[_0xfe19('0x63')](0x0,_0x3f1954[_0xfe19('0x64')](_0x5a7983));}var _0x147d66={'method':'GET','uri':util[_0xfe19('0x65')](_0xfe19('0x66'),_0x3f1954,_0xfe19('0x67')),'json':!![]};switch(_0x10f1f9[_0xfe19('0x61')]){case'password':_0x147d66[_0xfe19('0x68')]={'Authorization':util[_0xfe19('0x65')]('Basic\x20%s',new Buffer(util[_0xfe19('0x65')]('%s:%s',_0x10f1f9[_0xfe19('0x69')],_0x10f1f9[_0xfe19('0x5f')]))[_0xfe19('0x6a')](_0xfe19('0x6b')))};break;case'token':_0x147d66[_0xfe19('0x68')]={'Authorization':util[_0xfe19('0x65')](_0xfe19('0x6c'),new Buffer(util[_0xfe19('0x65')]('%s/token:%s',_0x10f1f9[_0xfe19('0x69')],_0x10f1f9[_0xfe19('0x60')]))[_0xfe19('0x6a')]('base64'))};break;default:throw new db[(_0xfe19('0x6d'))][(_0xfe19('0x19'))](_0xfe19('0x6e'));}return rp(_0x147d66);}})[_0xfe19('0x2f')](function(_0x1e47b7){if(_0x1e47b7){var _0x1073f9=[_0xfe19('0x6f'),_0xfe19('0x70'),_0xfe19('0x71'),_0xfe19('0x72')];_[_0xfe19('0x73')](_0x1e47b7[_0xfe19('0x67')],function(_0x512b0d){return _0x1073f9[_0xfe19('0x74')](_0x512b0d['type']);});return{'count':_0x1e47b7['ticket_fields'][_0xfe19('0x40')],'rows':_[_0xfe19('0x34')](_0x1e47b7[_0xfe19('0x67')],function(_0x103298){return{'id':_0x103298['id'],'name':_0x103298['position']>0x7?_0x103298['title']:_0x103298[_0xfe19('0x38')],'custom':_0x103298[_0xfe19('0x75')]>0x7?!![]:![],'options':_0x103298[_0xfe19('0x76')]?_0x103298[_0xfe19('0x76')]:_0x103298[_0xfe19('0x77')]?_0x103298[_0xfe19('0x77')]:[]};})};}})['then'](respondWithResult(_0x1f6844,null))[_0xfe19('0x25')](function(_0x270254){var _0xc0f05f=_0x3caa72[_0xfe19('0x3a')][_0xfe19('0x18')]?0x1f4:_0x270254[_0xfe19('0x78')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s','getFields',_0xc0f05f,JSON[_0xfe19('0x1f')](_0x270254));delete _0x270254[_0xfe19('0x32')];if(_0xc0f05f===0x191){_0xc0f05f=0x190;}_0x1f6844['status'](_0xc0f05f)[_0xfe19('0x33')](_0x3caa72[_0xfe19('0x3a')][_0xfe19('0x18')]?{'message':'Wrong\x20credentials','statusCode':_0x270254[_0xfe19('0x78')]}:_0x270254);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 3fc3ad3..c47f8e8 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 _0xf695=['define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intZendeskAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x1e59f1,_0x495069){var _0x1c5ff2=function(_0x59ae9b){while(--_0x59ae9b){_0x1e59f1['push'](_0x1e59f1['shift']());}};_0x1c5ff2(++_0x495069);}(_0xf695,0x18b));var _0x5f69=function(_0x1a2640,_0x5ab67e){_0x1a2640=_0x1a2640-0x0;var _0x2b6d12=_0xf695[_0x1a2640];return _0x2b6d12;};'use strict';var _=require('lodash');var util=require(_0x5f69('0x0'));var logger=require(_0x5f69('0x1'))(_0x5f69('0x2'));var moment=require(_0x5f69('0x3'));var BPromise=require(_0x5f69('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5f69('0x5'));var rimraf=require(_0x5f69('0x6'));var config=require(_0x5f69('0x7'));var attributes=require(_0x5f69('0x8'));var integrations=require(_0x5f69('0x9'));module[_0x5f69('0xa')]=function(_0x5ce38e,_0x191b7c){return _0x5ce38e[_0x5f69('0xb')](_0x5f69('0xc'),attributes,{'tableName':_0x5f69('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5d9d=['./intZendeskAccount.attributes','exports','define','ZendeskAccount','int_zendesk_accounts','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x5d9d,0x171));var _0xd5d9=function(_0x4e0753,_0x1e7537){_0x4e0753=_0x4e0753-0x0;var _0x47cd21=_0x5d9d[_0x4e0753];return _0x47cd21;};'use strict';var _=require('lodash');var util=require(_0xd5d9('0x0'));var logger=require(_0xd5d9('0x1'))(_0xd5d9('0x2'));var moment=require(_0xd5d9('0x3'));var BPromise=require(_0xd5d9('0x4'));var rp=require(_0xd5d9('0x5'));var fs=require('fs');var path=require(_0xd5d9('0x6'));var rimraf=require(_0xd5d9('0x7'));var config=require('../../config/environment');var attributes=require(_0xd5d9('0x8'));var integrations=require('../../components/integrations/configuration');module[_0xd5d9('0x9')]=function(_0x2040aa,_0x308bda){return _0x2040aa[_0xd5d9('0xa')](_0xd5d9('0xb'),attributes,{'tableName':_0xd5d9('0xc'),'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 f8cc45e..5ef9dfe 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 _0xbaf0=['ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','GetZendeskAccount','ZendeskAccount','findAll','options','where','attributes','limit','include','model','map','ShowZendeskAccount','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x28bef9,_0x28e8d6){var _0x45db81=function(_0x269033){while(--_0x269033){_0x28bef9['push'](_0x28bef9['shift']());}};_0x45db81(++_0x28e8d6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require(_0x0baf('0x0'));var moment=require(_0x0baf('0x1'));var BPromise=require(_0x0baf('0x2'));var rs=require(_0x0baf('0x3'));var fs=require('fs');var Redis=require(_0x0baf('0x4'));var db=require(_0x0baf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0baf('0x6'))(_0x0baf('0x7'));var config=require(_0x0baf('0x8'));var jayson=require(_0x0baf('0x9'));var client=jayson[_0x0baf('0xa')][_0x0baf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a10b1,_0x2dcaac,_0x1d0a0d){return new BPromise(function(_0x5f5030,_0x11b947){return client['request'](_0x1a10b1,_0x1d0a0d)[_0x0baf('0xc')](function(_0x2c7442){logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,_0x0baf('0xf'));logger[_0x0baf('0x10')](_0x0baf('0x11'),_0x2dcaac,_0x0baf('0xf'),JSON[_0x0baf('0x12')](_0x2c7442));if(_0x2c7442[_0x0baf('0x13')]){if(_0x2c7442[_0x0baf('0x13')]['code']===0x1f4){logger['error'](_0x0baf('0xe'),_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x11b947(_0x2c7442[_0x0baf('0x13')]['message']);}logger[_0x0baf('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2dcaac,_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);return _0x5f5030(_0x2c7442[_0x0baf('0x13')][_0x0baf('0x14')]);}else{logger[_0x0baf('0xd')](_0x0baf('0xe'),_0x2dcaac,'request\x20sent');_0x5f5030(_0x2c7442['result'][_0x0baf('0x14')]);}})[_0x0baf('0x15')](function(_0x283408){logger[_0x0baf('0x13')](_0x0baf('0xe'),_0x2dcaac,_0x283408);_0x11b947(_0x283408);});});}exports[_0x0baf('0x16')]=function(_0x53c338){var _0x63c820=this;return new Promise(function(_0xfbecec,_0x1ef0e5){return db[_0x0baf('0x17')][_0x0baf('0x18')]({'raw':_0x53c338[_0x0baf('0x19')]?_0x53c338['options']['raw']===undefined?!![]:![]:!![],'where':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'limit':_0x53c338[_0x0baf('0x19')]?_0x53c338[_0x0baf('0x19')][_0x0baf('0x1c')]||null:null,'include':_0x53c338[_0x0baf('0x19')]?_0x53c338['options'][_0x0baf('0x1d')]?_['map'](_0x53c338[_0x0baf('0x19')]['include'],function(_0x4de74c){return{'model':db[_0x4de74c[_0x0baf('0x1e')]],'as':_0x4de74c['as'],'attributes':_0x4de74c['attributes'],'include':_0x4de74c['include']?_[_0x0baf('0x1f')](_0x4de74c[_0x0baf('0x1d')],function(_0x34e264){return{'model':db[_0x34e264[_0x0baf('0x1e')]],'as':_0x34e264['as'],'attributes':_0x34e264[_0x0baf('0x1b')],'include':_0x34e264['include']?_[_0x0baf('0x1f')](_0x34e264[_0x0baf('0x1d')],function(_0x1ca35a){return{'model':db[_0x1ca35a[_0x0baf('0x1e')]],'as':_0x1ca35a['as'],'attributes':_0x1ca35a[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x453525){logger['info'](_0x0baf('0x16'),_0x53c338);logger[_0x0baf('0x10')](_0x0baf('0x16'),_0x53c338,JSON[_0x0baf('0x12')](_0x453525));_0xfbecec(_0x453525);})['catch'](function(_0x29dbdf){logger[_0x0baf('0x13')]('GetZendeskAccount',_0x29dbdf[_0x0baf('0x14')],_0x53c338);_0x1ef0e5(_0x63c820[_0x0baf('0x13')](0x1f4,_0x29dbdf[_0x0baf('0x14')]));});});};exports[_0x0baf('0x20')]=function(_0xd14f0f){var _0x366924=this;return new Promise(function(_0x213a6a,_0x57476f){return db[_0x0baf('0x17')][_0x0baf('0x21')]({'raw':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x22')]===undefined?!![]:![]:!![],'where':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1a')]||null:null,'attributes':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1b')]||null:null,'include':_0xd14f0f[_0x0baf('0x19')]?_0xd14f0f[_0x0baf('0x19')][_0x0baf('0x1d')]?_['map'](_0xd14f0f[_0x0baf('0x19')]['include'],function(_0x1aa474){return{'model':db[_0x1aa474[_0x0baf('0x1e')]],'as':_0x1aa474['as'],'attributes':_0x1aa474[_0x0baf('0x1b')],'include':_0x1aa474[_0x0baf('0x1d')]?_['map'](_0x1aa474[_0x0baf('0x1d')],function(_0x1d6575){return{'model':db[_0x1d6575['model']],'as':_0x1d6575['as'],'attributes':_0x1d6575[_0x0baf('0x1b')],'include':_0x1d6575[_0x0baf('0x1d')]?_[_0x0baf('0x1f')](_0x1d6575[_0x0baf('0x1d')],function(_0x1f60bd){return{'model':db[_0x1f60bd[_0x0baf('0x1e')]],'as':_0x1f60bd['as'],'attributes':_0x1f60bd[_0x0baf('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0baf('0xc')](function(_0x4aa6ed){logger[_0x0baf('0xd')](_0x0baf('0x20'),_0xd14f0f);logger['debug'](_0x0baf('0x20'),_0xd14f0f,JSON['stringify'](_0x4aa6ed));_0x213a6a(_0x4aa6ed);})['catch'](function(_0x11bc49){logger[_0x0baf('0x13')]('ShowZendeskAccount',_0x11bc49['message'],_0xd14f0f);_0x57476f(_0x366924[_0x0baf('0x13')](0x1f4,_0x11bc49[_0x0baf('0x14')]));});});}; \ No newline at end of file +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(_0x54e170,_0x1c1caa){var _0x2f7a25=function(_0x802001){while(--_0x802001){_0x54e170['push'](_0x54e170['shift']());}};_0x2f7a25(++_0x1c1caa);}(_0x757a,0xde));var _0xa757=function(_0x18e580,_0x344d5c){_0x18e580=_0x18e580-0x0;var _0xced1b4=_0x757a[_0x18e580];return _0xced1b4;};'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 diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 97eaf44..e2ad1e5 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 _0x1af5=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','index','/:id','show','isAuthenticated','/:id/subjects','getSubjects','getDescriptions','/:id/tags','getTags','post','setTags','update','delete','destroy','exports','multer','util','path'];(function(_0x5d08f8,_0x50d9a5){var _0x5bfab2=function(_0x5b9ea3){while(--_0x5b9ea3){_0x5d08f8['push'](_0x5d08f8['shift']());}};_0x5bfab2(++_0x50d9a5);}(_0x1af5,0xc5));var _0x51af=function(_0x18b74b,_0x27fd51){_0x18b74b=_0x18b74b-0x0;var _0x37e0d2=_0x1af5[_0x18b74b];return _0x37e0d2;};'use strict';var multer=require(_0x51af('0x0'));var util=require(_0x51af('0x1'));var path=require(_0x51af('0x2'));var timeout=require(_0x51af('0x3'));var express=require('express');var router=express[_0x51af('0x4')]();var auth=require(_0x51af('0x5'));var interaction=require(_0x51af('0x6'));var config=require(_0x51af('0x7'));var controller=require(_0x51af('0x8'));router[_0x51af('0x9')]('/',auth['isAuthenticated'](),controller[_0x51af('0xa')]);router[_0x51af('0x9')](_0x51af('0xb'),auth['isAuthenticated'](),controller[_0x51af('0xc')]);router['get']('/:id/fields',auth[_0x51af('0xd')](),controller['getFields']);router[_0x51af('0x9')](_0x51af('0xe'),auth[_0x51af('0xd')](),controller[_0x51af('0xf')]);router[_0x51af('0x9')]('/:id/descriptions',auth[_0x51af('0xd')](),controller[_0x51af('0x10')]);router[_0x51af('0x9')](_0x51af('0x11'),auth[_0x51af('0xd')](),controller[_0x51af('0x12')]);router[_0x51af('0x13')]('/',auth['isAuthenticated'](),controller['create']);router[_0x51af('0x13')](_0x51af('0x11'),auth[_0x51af('0xd')](),controller[_0x51af('0x14')]);router['put'](_0x51af('0xb'),auth[_0x51af('0xd')](),controller[_0x51af('0x15')]);router[_0x51af('0x16')](_0x51af('0xb'),auth[_0x51af('0xd')](),controller[_0x51af('0x17')]);module[_0x51af('0x18')]=router; \ No newline at end of file +var _0x0d15=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','./intZendeskConfiguration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/tags','getTags','post','create','put','update','delete','destroy'];(function(_0x4cb36c,_0x57b3a1){var _0x264bc6=function(_0x35a85c){while(--_0x35a85c){_0x4cb36c['push'](_0x4cb36c['shift']());}};_0x264bc6(++_0x57b3a1);}(_0x0d15,0x1dc));var _0x50d1=function(_0x592917,_0x5a6f41){_0x592917=_0x592917-0x0;var _0x42775f=_0x0d15[_0x592917];return _0x42775f;};'use strict';var multer=require(_0x50d1('0x0'));var util=require(_0x50d1('0x1'));var path=require('path');var timeout=require(_0x50d1('0x2'));var express=require(_0x50d1('0x3'));var router=express[_0x50d1('0x4')]();var auth=require(_0x50d1('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x50d1('0x6'));router[_0x50d1('0x7')]('/',auth['isAuthenticated'](),controller[_0x50d1('0x8')]);router[_0x50d1('0x7')](_0x50d1('0x9'),auth[_0x50d1('0xa')](),controller[_0x50d1('0xb')]);router[_0x50d1('0x7')](_0x50d1('0xc'),auth[_0x50d1('0xa')](),controller[_0x50d1('0xd')]);router[_0x50d1('0x7')](_0x50d1('0xe'),auth['isAuthenticated'](),controller[_0x50d1('0xf')]);router[_0x50d1('0x7')]('/:id/descriptions',auth[_0x50d1('0xa')](),controller['getDescriptions']);router['get'](_0x50d1('0x10'),auth['isAuthenticated'](),controller[_0x50d1('0x11')]);router[_0x50d1('0x12')]('/',auth['isAuthenticated'](),controller[_0x50d1('0x13')]);router[_0x50d1('0x12')](_0x50d1('0x10'),auth[_0x50d1('0xa')](),controller['setTags']);router[_0x50d1('0x14')]('/:id',auth[_0x50d1('0xa')](),controller[_0x50d1('0x15')]);router[_0x50d1('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x50d1('0x17')]);module[_0x50d1('0x18')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index b684674..acae019 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 _0x61f6=['sequelize','exports','STRING'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x61f6,0x156));var _0x661f=function(_0x54aea3,_0xae7d81){_0x54aea3=_0x54aea3-0x0;var _0x21ae46=_0x61f6[_0x54aea3];return _0x21ae46;};'use strict';var Sequelize=require(_0x661f('0x0'));module[_0x661f('0x1')]={'name':{'type':Sequelize[_0x661f('0x2')]},'description':{'type':Sequelize[_0x661f('0x2')]}}; \ No newline at end of file +var _0xe2f1=['exports','STRING','sequelize'];(function(_0x1b95f1,_0x3353a9){var _0x77a05f=function(_0x41dda5){while(--_0x41dda5){_0x1b95f1['push'](_0x1b95f1['shift']());}};_0x77a05f(++_0x3353a9);}(_0xe2f1,0x86));var _0x1e2f=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0xe2f1[_0x27dba4];return _0x35ec9d;};'use strict';var Sequelize=require(_0x1e2f('0x0'));module[_0x1e2f('0x1')]={'name':{'type':Sequelize[_0x1e2f('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index f534364..9046463 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5fc3=['papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','http','test','Sequelize','request','info','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','ZendeskConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','stack','name','send','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','ZendeskConfiguration','includeAll','findAll','params','include','find','create','body','getFields','findOne','rawAttributes','pick','getSubjects','ZendeskField','getDescriptions','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x437325,_0x4360af){var _0x74df89=function(_0x434ac8){while(--_0x434ac8){_0x437325['push'](_0x437325['shift']());}};_0x74df89(++_0x4360af);}(_0x5fc3,0xa8));var _0x35fc=function(_0x2dc96f,_0x459058){_0x2dc96f=_0x2dc96f-0x0;var _0xd012da=_0x5fc3[_0x2dc96f];return _0xd012da;};'use strict';var pdf=require(_0x35fc('0x0'));var emlformat=require(_0x35fc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x35fc('0x2'));var jsonpatch=require(_0x35fc('0x3'));var rp=require(_0x35fc('0x4'));var moment=require(_0x35fc('0x5'));var BPromise=require(_0x35fc('0x6'));var Mustache=require('mustache');var util=require(_0x35fc('0x7'));var path=require(_0x35fc('0x8'));var sox=require(_0x35fc('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x35fc('0xa'));var squel=require('squel');var crypto=require(_0x35fc('0xb'));var jsforce=require(_0x35fc('0xc'));var deskjs=require(_0x35fc('0xd'));var toCsv=require(_0x35fc('0xe'));var querystring=require(_0x35fc('0xf'));var Papa=require(_0x35fc('0x10'));var Redis=require(_0x35fc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x35fc('0x12'));var as=require(_0x35fc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x35fc('0x14'))(_0x35fc('0x15'));var utils=require('../../config/utils');var config=require(_0x35fc('0x16'));var db=require(_0x35fc('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x35fc('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5d462a,_0x397738,_0x22055e){if(_0x22055e){var _0x2a6ad2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2a6ad2[_0x35fc('0x19')](_0x397738)){return _0x5d462a;}else{throw new db[(_0x35fc('0x1a'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5d462a;}}function respondWithRpcPromise(_0x5eac0f,_0x558364,_0x398b67,_0x229d56){return new BPromise(function(_0x53b898,_0x154958){var _0x227a49=_0x229d56||client;return _0x227a49[_0x35fc('0x1b')](_0x5eac0f,_0x398b67)['then'](function(_0x26ba54){logger[_0x35fc('0x1c')]('ZendeskConfiguration,\x20%s,\x20%s',_0x558364,_0x35fc('0x1d'));logger[_0x35fc('0x1e')](_0x35fc('0x1f'),_0x558364,'request\x20sent',JSON[_0x35fc('0x20')](_0x26ba54));if(_0x26ba54[_0x35fc('0x21')]){if(_0x26ba54[_0x35fc('0x21')]['code']===0x1f4){logger[_0x35fc('0x21')](_0x35fc('0x22'),_0x558364,_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);return _0x154958(_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);}logger[_0x35fc('0x21')](_0x35fc('0x22'),_0x558364,_0x26ba54[_0x35fc('0x21')][_0x35fc('0x23')]);return _0x53b898(_0x26ba54['error'][_0x35fc('0x23')]);}else{logger[_0x35fc('0x1c')](_0x35fc('0x22'),_0x558364,_0x35fc('0x1d'));_0x53b898(_0x26ba54[_0x35fc('0x24')]['message']);}})[_0x35fc('0x25')](function(_0x4c587a){logger['error'](_0x35fc('0x22'),_0x558364,_0x4c587a);_0x154958(_0x4c587a);});});}function respondWithStatusCode(_0x5a93df,_0x3d4a98){_0x3d4a98=_0x3d4a98||0xcc;return function(_0x51cfec){if(_0x51cfec){return _0x5a93df[_0x35fc('0x26')](_0x3d4a98);}return _0x5a93df['status'](_0x3d4a98)[_0x35fc('0x27')]();};}function respondWithResult(_0xdfab9f,_0x5cb986){_0x5cb986=_0x5cb986||0xc8;return function(_0x519264){if(_0x519264){return _0xdfab9f[_0x35fc('0x28')](_0x5cb986)['json'](_0x519264);}};}function respondWithFilteredResult(_0x274208,_0x1a5d92){return function(_0x57001c){if(_0x57001c){var _0x26b7cb=_0x57001c[_0x35fc('0x29')],_0x645eac=_0x1a5d92[_0x35fc('0x2a')],_0x383837=_0x1a5d92[_0x35fc('0x2a')]+_0x1a5d92[_0x35fc('0x2b')],_0x9f3c8a;if(_0x383837>=_0x26b7cb){_0x383837=_0x26b7cb;_0x9f3c8a=0xc8;}else{_0x9f3c8a=0xce;}_0x274208['status'](_0x9f3c8a);return _0x274208[_0x35fc('0x2c')](_0x35fc('0x2d'),_0x645eac+'-'+_0x383837+'/'+_0x26b7cb)[_0x35fc('0x2e')](_0x57001c);}return null;};}function patchUpdates(_0x52acc5){return function(_0xe79f52){try{jsonpatch[_0x35fc('0x2f')](_0xe79f52,_0x52acc5,!![]);}catch(_0x3822a8){return BPromise[_0x35fc('0x30')](_0x3822a8);}return _0xe79f52[_0x35fc('0x31')]();};}function saveUpdates(_0x103181,_0x222ddb){return function(_0x37b435){if(_0x37b435){return _0x37b435[_0x35fc('0x32')](_0x103181)[_0x35fc('0x33')](function(_0x57072d){return _0x57072d;});}return null;};}function removeEntity(_0x5e0313,_0x114bc1){return function(_0x4af5fe){if(_0x4af5fe){return _0x4af5fe[_0x35fc('0x34')]()[_0x35fc('0x33')](function(){_0x5e0313[_0x35fc('0x28')](0xcc)[_0x35fc('0x27')]();});}};}function handleEntityNotFound(_0x271ba9,_0x12e78f){return function(_0x4e43b4){if(!_0x4e43b4){_0x271ba9[_0x35fc('0x26')](0x194);}return _0x4e43b4;};}function handleError(_0x330a14,_0x46b9ef){_0x46b9ef=_0x46b9ef||0x1f4;return function(_0x4441d8){logger[_0x35fc('0x21')](_0x4441d8[_0x35fc('0x35')]);if(_0x4441d8['name']){delete _0x4441d8[_0x35fc('0x36')];}_0x330a14[_0x35fc('0x28')](_0x46b9ef)[_0x35fc('0x37')](_0x4441d8);};}exports['index']=function(_0x2c657d,_0x48d223){var _0x2ecb2e={},_0x33a377={},_0x266a11={'count':0x0,'rows':[]};var _0x2e00e3=_['map'](db['ZendeskConfiguration']['rawAttributes'],function(_0x20f5fe){return{'name':_0x20f5fe['fieldName'],'type':_0x20f5fe[_0x35fc('0x38')]['key']};});_0x33a377[_0x35fc('0x39')]=_[_0x35fc('0x3a')](_0x2e00e3,_0x35fc('0x36'));_0x33a377[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x2c657d[_0x35fc('0x3b')]);_0x33a377[_0x35fc('0x3d')]=_['intersection'](_0x33a377[_0x35fc('0x39')],_0x33a377[_0x35fc('0x3b')]);_0x2ecb2e['attributes']=_[_0x35fc('0x3e')](_0x33a377[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x2ecb2e[_0x35fc('0x40')]=_0x2ecb2e['attributes'][_0x35fc('0x41')]?_0x2ecb2e[_0x35fc('0x40')]:_0x33a377[_0x35fc('0x39')];if(!_0x2c657d['query'][_0x35fc('0x42')](_0x35fc('0x43'))){_0x2ecb2e['limit']=qs[_0x35fc('0x2b')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x2ecb2e[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x2a')]);}_0x2ecb2e[_0x35fc('0x44')]=qs['sort'](_0x2c657d['query'][_0x35fc('0x45')]);_0x2ecb2e[_0x35fc('0x46')]=qs['filters'](_['pick'](_0x2c657d['query'],_0x33a377[_0x35fc('0x3d')]));if(_0x2c657d[_0x35fc('0x3b')]['filter']){_0x2ecb2e[_0x35fc('0x46')]=_[_0x35fc('0x47')](_0x2ecb2e[_0x35fc('0x46')],{'$or':_[_0x35fc('0x3a')](_0x2e00e3,function(_0x5c52be){if(_0x5c52be['type']!=='VIRTUAL'){var _0x539157={};_0x539157[_0x5c52be['name']]={'$like':'%'+_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x539157;}})});}_0x2ecb2e=_['merge']({},_0x2ecb2e,_0x2c657d[_0x35fc('0x49')]);var _0x56cf1f={'where':_0x2ecb2e[_0x35fc('0x46')]};return db[_0x35fc('0x4a')][_0x35fc('0x29')](_0x56cf1f)[_0x35fc('0x33')](function(_0x16f7c8){_0x266a11['count']=_0x16f7c8;if(_0x2c657d[_0x35fc('0x3b')][_0x35fc('0x4b')]){_0x2ecb2e['include']=[{'all':!![]}];}return db[_0x35fc('0x4a')][_0x35fc('0x4c')](_0x2ecb2e);})[_0x35fc('0x33')](function(_0x211746){_0x266a11['rows']=_0x211746;return _0x266a11;})[_0x35fc('0x33')](respondWithFilteredResult(_0x48d223,_0x2ecb2e))['catch'](handleError(_0x48d223,null));};exports['show']=function(_0x1b6160,_0x9db7e8){var _0x18dc78={'raw':![],'where':{'id':_0x1b6160[_0x35fc('0x4d')]['id']}},_0xca8aef={};_0xca8aef[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x4a')]['rawAttributes']);_0xca8aef[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x1b6160[_0x35fc('0x3b')]);_0xca8aef[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0xca8aef[_0x35fc('0x39')],_0xca8aef[_0x35fc('0x3b')]);_0x18dc78[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0xca8aef[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x1b6160[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x18dc78[_0x35fc('0x40')]=_0x18dc78['attributes']['length']?_0x18dc78[_0x35fc('0x40')]:_0xca8aef[_0x35fc('0x39')];if(_0x1b6160[_0x35fc('0x3b')][_0x35fc('0x4b')]){_0x18dc78[_0x35fc('0x4e')]=[{'all':!![]}];}_0x18dc78=_[_0x35fc('0x47')]({},_0x18dc78,_0x1b6160['options']);return db['ZendeskConfiguration'][_0x35fc('0x4f')](_0x18dc78)[_0x35fc('0x33')](handleEntityNotFound(_0x9db7e8,null))[_0x35fc('0x33')](respondWithResult(_0x9db7e8,null))[_0x35fc('0x25')](handleError(_0x9db7e8,null));};exports['create']=function(_0x467980,_0x13281f){return db['ZendeskConfiguration'][_0x35fc('0x50')](_0x467980[_0x35fc('0x51')],{})['then'](respondWithResult(_0x13281f,0xc9))[_0x35fc('0x25')](handleError(_0x13281f,null));};exports[_0x35fc('0x32')]=function(_0x26118e,_0x18f18b){if(_0x26118e['body']['id']){delete _0x26118e['body']['id'];}return db['ZendeskConfiguration'][_0x35fc('0x4f')]({'where':{'id':_0x26118e[_0x35fc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x18f18b,null))[_0x35fc('0x33')](saveUpdates(_0x26118e[_0x35fc('0x51')],null))[_0x35fc('0x33')](respondWithResult(_0x18f18b,null))[_0x35fc('0x25')](handleError(_0x18f18b,null));};exports[_0x35fc('0x34')]=function(_0x538be0,_0x2d9d45){return db[_0x35fc('0x4a')][_0x35fc('0x4f')]({'where':{'id':_0x538be0['params']['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x2d9d45,null))[_0x35fc('0x33')](removeEntity(_0x2d9d45,null))['catch'](handleError(_0x2d9d45,null));};exports[_0x35fc('0x52')]=function(_0x164c7b,_0x1c46b1,_0x1c4c33){var _0x314666={};var _0x41453b={};var _0x8501d1;var _0x998fd9;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x164c7b[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x1c46b1,null))['then'](function(_0x243871){if(_0x243871){_0x8501d1=_0x243871;_0x41453b['model']=_['keys'](db['ZendeskField'][_0x35fc('0x54')]);_0x41453b[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x164c7b[_0x35fc('0x3b')]);_0x41453b[_0x35fc('0x3d')]=_['intersection'](_0x41453b['model'],_0x41453b['query']);_0x314666['attributes']=_['intersection'](_0x41453b[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x314666['attributes']=_0x314666[_0x35fc('0x40')][_0x35fc('0x41')]?_0x314666[_0x35fc('0x40')]:_0x41453b[_0x35fc('0x39')];_0x314666[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x314666[_0x35fc('0x46')]=qs['filters'](_[_0x35fc('0x55')](_0x164c7b['query'],_0x41453b[_0x35fc('0x3d')]));if(_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x314666[_0x35fc('0x46')]=_['merge'](_0x314666[_0x35fc('0x46')],{'$or':_['map'](_0x314666['attributes'],function(_0x5f1d4a){var _0x10dd1a={};_0x10dd1a[_0x5f1d4a]={'$like':'%'+_0x164c7b['query'][_0x35fc('0x48')]+'%'};return _0x10dd1a;})});}_0x314666=_['merge']({},_0x314666,_0x164c7b[_0x35fc('0x49')]);return _0x8501d1['getFields'](_0x314666);}})[_0x35fc('0x33')](function(_0x455b84){if(_0x455b84){_0x998fd9=_0x455b84[_0x35fc('0x41')];if(!_0x164c7b[_0x35fc('0x3b')]['hasOwnProperty'](_0x35fc('0x43'))){_0x314666[_0x35fc('0x2b')]=qs[_0x35fc('0x2b')](_0x164c7b['query'][_0x35fc('0x2b')]);_0x314666[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x164c7b[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x8501d1[_0x35fc('0x52')](_0x314666);}})[_0x35fc('0x33')](function(_0x4464d5){if(_0x4464d5){return _0x4464d5?{'count':_0x998fd9,'rows':_0x4464d5}:null;}})['then'](respondWithResult(_0x1c46b1,null))[_0x35fc('0x25')](handleError(_0x1c46b1,null));};exports[_0x35fc('0x56')]=function(_0x2600d2,_0x4a926d,_0x1c88d8){var _0x1b76f0={};var _0x586729={};var _0x4d09d4;var _0x3969d3;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x2600d2[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x4a926d,null))[_0x35fc('0x33')](function(_0x1932c9){if(_0x1932c9){_0x4d09d4=_0x1932c9;_0x586729[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x57')][_0x35fc('0x54')]);_0x586729[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x2600d2[_0x35fc('0x3b')]);_0x586729[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0x586729[_0x35fc('0x39')],_0x586729[_0x35fc('0x3b')]);_0x1b76f0[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x586729[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x2600d2['query'][_0x35fc('0x3f')]));_0x1b76f0['attributes']=_0x1b76f0[_0x35fc('0x40')][_0x35fc('0x41')]?_0x1b76f0[_0x35fc('0x40')]:_0x586729[_0x35fc('0x39')];_0x1b76f0[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x1b76f0[_0x35fc('0x46')]=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x2600d2['query'],_0x586729[_0x35fc('0x3d')]));if(_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x1b76f0[_0x35fc('0x46')]=_[_0x35fc('0x47')](_0x1b76f0[_0x35fc('0x46')],{'$or':_['map'](_0x1b76f0[_0x35fc('0x40')],function(_0x3353e0){var _0x277514={};_0x277514[_0x3353e0]={'$like':'%'+_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x277514;})});}_0x1b76f0=_[_0x35fc('0x47')]({},_0x1b76f0,_0x2600d2[_0x35fc('0x49')]);return _0x4d09d4[_0x35fc('0x56')](_0x1b76f0);}})[_0x35fc('0x33')](function(_0x5f23d8){if(_0x5f23d8){_0x3969d3=_0x5f23d8[_0x35fc('0x41')];if(!_0x2600d2['query'][_0x35fc('0x42')](_0x35fc('0x43'))){_0x1b76f0['limit']=qs[_0x35fc('0x2b')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x1b76f0[_0x35fc('0x2a')]=qs[_0x35fc('0x2a')](_0x2600d2[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x4d09d4[_0x35fc('0x56')](_0x1b76f0);}})[_0x35fc('0x33')](function(_0x5806bf){if(_0x5806bf){return _0x5806bf?{'count':_0x3969d3,'rows':_0x5806bf}:null;}})['then'](respondWithResult(_0x4a926d,null))['catch'](handleError(_0x4a926d,null));};exports['getDescriptions']=function(_0x160a6f,_0x23cf84,_0x8fc410){var _0x1f5cbc={};var _0x35ef53={};var _0x4f535a;var _0x226fdf;return db[_0x35fc('0x4a')][_0x35fc('0x53')]({'where':{'id':_0x160a6f[_0x35fc('0x4d')]['id']}})['then'](handleEntityNotFound(_0x23cf84,null))[_0x35fc('0x33')](function(_0x3ddd21){if(_0x3ddd21){_0x4f535a=_0x3ddd21;_0x35ef53[_0x35fc('0x39')]=_['keys'](db[_0x35fc('0x57')][_0x35fc('0x54')]);_0x35ef53[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x160a6f[_0x35fc('0x3b')]);_0x35ef53[_0x35fc('0x3d')]=_[_0x35fc('0x3e')](_0x35ef53[_0x35fc('0x39')],_0x35ef53['query']);_0x1f5cbc[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x35ef53[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x1f5cbc['attributes']=_0x1f5cbc[_0x35fc('0x40')]['length']?_0x1f5cbc['attributes']:_0x35ef53[_0x35fc('0x39')];_0x1f5cbc['order']=qs[_0x35fc('0x45')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x45')]);_0x1f5cbc['where']=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x160a6f[_0x35fc('0x3b')],_0x35ef53[_0x35fc('0x3d')]));if(_0x160a6f[_0x35fc('0x3b')]['filter']){_0x1f5cbc['where']=_['merge'](_0x1f5cbc[_0x35fc('0x46')],{'$or':_['map'](_0x1f5cbc[_0x35fc('0x40')],function(_0x1824c2){var _0x391321={};_0x391321[_0x1824c2]={'$like':'%'+_0x160a6f[_0x35fc('0x3b')]['filter']+'%'};return _0x391321;})});}_0x1f5cbc=_[_0x35fc('0x47')]({},_0x1f5cbc,_0x160a6f[_0x35fc('0x49')]);return _0x4f535a[_0x35fc('0x58')](_0x1f5cbc);}})['then'](function(_0x128286){if(_0x128286){_0x226fdf=_0x128286[_0x35fc('0x41')];if(!_0x160a6f[_0x35fc('0x3b')]['hasOwnProperty']('nolimit')){_0x1f5cbc['limit']=qs[_0x35fc('0x2b')](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x1f5cbc[_0x35fc('0x2a')]=qs['offset'](_0x160a6f[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x4f535a['getDescriptions'](_0x1f5cbc);}})['then'](function(_0x143c94){if(_0x143c94){return _0x143c94?{'count':_0x226fdf,'rows':_0x143c94}:null;}})[_0x35fc('0x33')](respondWithResult(_0x23cf84,null))[_0x35fc('0x25')](handleError(_0x23cf84,null));};exports['getTags']=function(_0x4dd05f,_0x134e60,_0x432ba4){var _0x4d5204={};var _0x3439de={};var _0x163edb;var _0x1d96c9;return db['ZendeskConfiguration'][_0x35fc('0x53')]({'where':{'id':_0x4dd05f[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x134e60,null))[_0x35fc('0x33')](function(_0x4fd676){if(_0x4fd676){_0x163edb=_0x4fd676;_0x3439de[_0x35fc('0x39')]=_[_0x35fc('0x3c')](db[_0x35fc('0x59')]['rawAttributes']);_0x3439de[_0x35fc('0x3b')]=_[_0x35fc('0x3c')](_0x4dd05f[_0x35fc('0x3b')]);_0x3439de['filters']=_[_0x35fc('0x3e')](_0x3439de[_0x35fc('0x39')],_0x3439de['query']);_0x4d5204[_0x35fc('0x40')]=_[_0x35fc('0x3e')](_0x3439de[_0x35fc('0x39')],qs[_0x35fc('0x3f')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x3f')]));_0x4d5204[_0x35fc('0x40')]=_0x4d5204[_0x35fc('0x40')][_0x35fc('0x41')]?_0x4d5204['attributes']:_0x3439de[_0x35fc('0x39')];_0x4d5204[_0x35fc('0x44')]=qs[_0x35fc('0x45')](_0x4dd05f[_0x35fc('0x3b')]['sort']);_0x4d5204[_0x35fc('0x46')]=qs[_0x35fc('0x3d')](_[_0x35fc('0x55')](_0x4dd05f[_0x35fc('0x3b')],_0x3439de[_0x35fc('0x3d')]));if(_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x48')]){_0x4d5204[_0x35fc('0x46')]=_['merge'](_0x4d5204['where'],{'$or':_[_0x35fc('0x3a')](_0x4d5204[_0x35fc('0x40')],function(_0x961ee9){var _0x4ebf4a={};_0x4ebf4a[_0x961ee9]={'$like':'%'+_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x48')]+'%'};return _0x4ebf4a;})});}_0x4d5204=_[_0x35fc('0x47')]({},_0x4d5204,_0x4dd05f[_0x35fc('0x49')]);return _0x163edb['getTags'](_0x4d5204);}})['then'](function(_0x379650){if(_0x379650){_0x1d96c9=_0x379650['length'];if(!_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x42')]('nolimit')){_0x4d5204['limit']=qs[_0x35fc('0x2b')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x2b')]);_0x4d5204['offset']=qs[_0x35fc('0x2a')](_0x4dd05f[_0x35fc('0x3b')][_0x35fc('0x2a')]);}return _0x163edb['getTags'](_0x4d5204);}})[_0x35fc('0x33')](function(_0x32cbd){if(_0x32cbd){return _0x32cbd?{'count':_0x1d96c9,'rows':_0x32cbd}:null;}})[_0x35fc('0x33')](respondWithResult(_0x134e60,null))[_0x35fc('0x25')](handleError(_0x134e60,null));};exports['setTags']=function(_0x451cb8,_0x347e06,_0x6f8054){if(_0x451cb8[_0x35fc('0x51')]['id']){delete _0x451cb8[_0x35fc('0x51')]['id'];}return db[_0x35fc('0x4a')]['findOne']({'where':{'id':_0x451cb8[_0x35fc('0x4d')]['id']}})[_0x35fc('0x33')](handleEntityNotFound(_0x347e06,null))['then'](function(_0x4c3253){if(_0x4c3253){return _0x4c3253[_0x35fc('0x5a')](_0x451cb8['body'][_0x35fc('0x5b')]||[]);}return null;})[_0x35fc('0x33')](respondWithResult(_0x347e06,null))[_0x35fc('0x25')](handleError(_0x347e06,null));}; \ No newline at end of file +var _0x326f=['VIRTUAL','filter','ZendeskConfiguration','count','includeAll','include','findAll','rows','show','params','options','find','create','body','destroy','getFields','findOne','hasOwnProperty','getSubjects','ZendeskField','getDescriptions','Tag','getTags','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','client','http','test','ValidationError','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge'];(function(_0x58c7ba,_0x220572){var _0x525ecf=function(_0x1ab9fd){while(--_0x1ab9fd){_0x58c7ba['push'](_0x58c7ba['shift']());}};_0x525ecf(++_0x220572);}(_0x326f,0xd1));var _0xf326=function(_0x3b16bf,_0x259e96){_0x3b16bf=_0x3b16bf-0x0;var _0x1f0d24=_0x326f[_0x3b16bf];return _0x1f0d24;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xf326('0x17')][_0xf326('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4b3966,_0x342fe5,_0x472632){if(_0x472632){var _0x3504eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3504eb[_0xf326('0x19')](_0x342fe5)){return _0x4b3966;}else{throw new db['Sequelize'][(_0xf326('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4b3966;}}function respondWithRpcPromise(_0x54bd1a,_0xdf21d9,_0x11f6d2,_0x1f2e5a){return new BPromise(function(_0xa63d1a,_0x292f4b){var _0x287a2a=_0x1f2e5a||client;return _0x287a2a[_0xf326('0x1b')](_0x54bd1a,_0x11f6d2)[_0xf326('0x1c')](function(_0x5a682a){logger[_0xf326('0x1d')](_0xf326('0x1e'),_0xdf21d9,_0xf326('0x1f'));logger[_0xf326('0x20')](_0xf326('0x21'),_0xdf21d9,_0xf326('0x1f'),JSON['stringify'](_0x5a682a));if(_0x5a682a['error']){if(_0x5a682a['error'][_0xf326('0x22')]===0x1f4){logger[_0xf326('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0xdf21d9,_0x5a682a['error'][_0xf326('0x24')]);return _0x292f4b(_0x5a682a['error']['message']);}logger[_0xf326('0x23')](_0xf326('0x1e'),_0xdf21d9,_0x5a682a['error']['message']);return _0xa63d1a(_0x5a682a[_0xf326('0x23')][_0xf326('0x24')]);}else{logger['info'](_0xf326('0x1e'),_0xdf21d9,_0xf326('0x1f'));_0xa63d1a(_0x5a682a[_0xf326('0x25')][_0xf326('0x24')]);}})[_0xf326('0x26')](function(_0x2049ec){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xdf21d9,_0x2049ec);_0x292f4b(_0x2049ec);});});}function respondWithStatusCode(_0x4f31f6,_0x520d85){_0x520d85=_0x520d85||0xcc;return function(_0x1a2c4e){if(_0x1a2c4e){return _0x4f31f6[_0xf326('0x27')](_0x520d85);}return _0x4f31f6[_0xf326('0x28')](_0x520d85)[_0xf326('0x29')]();};}function respondWithResult(_0x410237,_0x5217d4){_0x5217d4=_0x5217d4||0xc8;return function(_0x201d28){if(_0x201d28){return _0x410237[_0xf326('0x28')](_0x5217d4)[_0xf326('0x2a')](_0x201d28);}};}function respondWithFilteredResult(_0x581531,_0x1617d2){return function(_0x55ad0f){if(_0x55ad0f){var _0x4a9abf=_0x55ad0f['count'],_0x6a8e89=_0x1617d2[_0xf326('0x2b')],_0x1ae23a=_0x1617d2[_0xf326('0x2b')]+_0x1617d2['limit'],_0x2fa28e;if(_0x1ae23a>=_0x4a9abf){_0x1ae23a=_0x4a9abf;_0x2fa28e=0xc8;}else{_0x2fa28e=0xce;}_0x581531[_0xf326('0x28')](_0x2fa28e);return _0x581531[_0xf326('0x2c')](_0xf326('0x2d'),_0x6a8e89+'-'+_0x1ae23a+'/'+_0x4a9abf)[_0xf326('0x2a')](_0x55ad0f);}return null;};}function patchUpdates(_0xa80156){return function(_0x269be9){try{jsonpatch[_0xf326('0x2e')](_0x269be9,_0xa80156,!![]);}catch(_0x39a1e2){return BPromise[_0xf326('0x2f')](_0x39a1e2);}return _0x269be9[_0xf326('0x30')]();};}function saveUpdates(_0x4b52f2,_0x1035ed){return function(_0x424104){if(_0x424104){return _0x424104[_0xf326('0x31')](_0x4b52f2)['then'](function(_0x2c0cac){return _0x2c0cac;});}return null;};}function removeEntity(_0x1721fd,_0x303dc6){return function(_0x4df451){if(_0x4df451){return _0x4df451['destroy']()[_0xf326('0x1c')](function(){_0x1721fd[_0xf326('0x28')](0xcc)[_0xf326('0x29')]();});}};}function handleEntityNotFound(_0xf53cf3,_0x30694f){return function(_0x2e8a64){if(!_0x2e8a64){_0xf53cf3[_0xf326('0x27')](0x194);}return _0x2e8a64;};}function handleError(_0x2d5f20,_0x580374){_0x580374=_0x580374||0x1f4;return function(_0x461e93){logger[_0xf326('0x23')](_0x461e93['stack']);if(_0x461e93[_0xf326('0x32')]){delete _0x461e93['name'];}_0x2d5f20[_0xf326('0x28')](_0x580374)['send'](_0x461e93);};}exports['index']=function(_0xadb020,_0x4d8eac){var _0x40dcb4={},_0x57aa27={},_0x310dbb={'count':0x0,'rows':[]};var _0x409260=_[_0xf326('0x33')](db['ZendeskConfiguration'][_0xf326('0x34')],function(_0x4095e6){return{'name':_0x4095e6['fieldName'],'type':_0x4095e6[_0xf326('0x35')][_0xf326('0x36')]};});_0x57aa27[_0xf326('0x37')]=_[_0xf326('0x33')](_0x409260,'name');_0x57aa27[_0xf326('0x38')]=_[_0xf326('0x39')](_0xadb020[_0xf326('0x38')]);_0x57aa27[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x57aa27['model'],_0x57aa27[_0xf326('0x38')]);_0x40dcb4[_0xf326('0x3c')]=_['intersection'](_0x57aa27['model'],qs[_0xf326('0x3d')](_0xadb020['query']['fields']));_0x40dcb4[_0xf326('0x3c')]=_0x40dcb4['attributes'][_0xf326('0x3e')]?_0x40dcb4[_0xf326('0x3c')]:_0x57aa27[_0xf326('0x37')];if(!_0xadb020[_0xf326('0x38')]['hasOwnProperty'](_0xf326('0x3f'))){_0x40dcb4[_0xf326('0x40')]=qs[_0xf326('0x40')](_0xadb020[_0xf326('0x38')][_0xf326('0x40')]);_0x40dcb4[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0xadb020[_0xf326('0x38')][_0xf326('0x2b')]);}_0x40dcb4[_0xf326('0x41')]=qs[_0xf326('0x42')](_0xadb020[_0xf326('0x38')]['sort']);_0x40dcb4[_0xf326('0x43')]=qs[_0xf326('0x3a')](_[_0xf326('0x44')](_0xadb020[_0xf326('0x38')],_0x57aa27[_0xf326('0x3a')]));if(_0xadb020[_0xf326('0x38')]['filter']){_0x40dcb4[_0xf326('0x43')]=_[_0xf326('0x45')](_0x40dcb4['where'],{'$or':_[_0xf326('0x33')](_0x409260,function(_0x819bf6){if(_0x819bf6[_0xf326('0x35')]!==_0xf326('0x46')){var _0x427c34={};_0x427c34[_0x819bf6['name']]={'$like':'%'+_0xadb020['query'][_0xf326('0x47')]+'%'};return _0x427c34;}})});}_0x40dcb4=_[_0xf326('0x45')]({},_0x40dcb4,_0xadb020['options']);var _0x4bd865={'where':_0x40dcb4[_0xf326('0x43')]};return db[_0xf326('0x48')][_0xf326('0x49')](_0x4bd865)['then'](function(_0x301e65){_0x310dbb[_0xf326('0x49')]=_0x301e65;if(_0xadb020[_0xf326('0x38')][_0xf326('0x4a')]){_0x40dcb4[_0xf326('0x4b')]=[{'all':!![]}];}return db[_0xf326('0x48')][_0xf326('0x4c')](_0x40dcb4);})[_0xf326('0x1c')](function(_0x3df9a8){_0x310dbb[_0xf326('0x4d')]=_0x3df9a8;return _0x310dbb;})[_0xf326('0x1c')](respondWithFilteredResult(_0x4d8eac,_0x40dcb4))[_0xf326('0x26')](handleError(_0x4d8eac,null));};exports[_0xf326('0x4e')]=function(_0x395b1e,_0xeac1a1){var _0x59f9a7={'raw':![],'where':{'id':_0x395b1e[_0xf326('0x4f')]['id']}},_0x199f8b={};_0x199f8b[_0xf326('0x37')]=_[_0xf326('0x39')](db['ZendeskConfiguration'][_0xf326('0x34')]);_0x199f8b[_0xf326('0x38')]=_[_0xf326('0x39')](_0x395b1e[_0xf326('0x38')]);_0x199f8b['filters']=_[_0xf326('0x3b')](_0x199f8b[_0xf326('0x37')],_0x199f8b[_0xf326('0x38')]);_0x59f9a7[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x199f8b['model'],qs['fields'](_0x395b1e[_0xf326('0x38')][_0xf326('0x3d')]));_0x59f9a7[_0xf326('0x3c')]=_0x59f9a7['attributes'][_0xf326('0x3e')]?_0x59f9a7[_0xf326('0x3c')]:_0x199f8b[_0xf326('0x37')];if(_0x395b1e['query']['includeAll']){_0x59f9a7[_0xf326('0x4b')]=[{'all':!![]}];}_0x59f9a7=_['merge']({},_0x59f9a7,_0x395b1e[_0xf326('0x50')]);return db['ZendeskConfiguration'][_0xf326('0x51')](_0x59f9a7)[_0xf326('0x1c')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x1c')](respondWithResult(_0xeac1a1,null))[_0xf326('0x26')](handleError(_0xeac1a1,null));};exports[_0xf326('0x52')]=function(_0x35d3c8,_0x7f7ece){return db['ZendeskConfiguration'][_0xf326('0x52')](_0x35d3c8[_0xf326('0x53')],{})[_0xf326('0x1c')](respondWithResult(_0x7f7ece,0xc9))['catch'](handleError(_0x7f7ece,null));};exports[_0xf326('0x31')]=function(_0x3a832f,_0x3b8635){if(_0x3a832f[_0xf326('0x53')]['id']){delete _0x3a832f[_0xf326('0x53')]['id'];}return db['ZendeskConfiguration'][_0xf326('0x51')]({'where':{'id':_0x3a832f[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x3b8635,null))[_0xf326('0x1c')](saveUpdates(_0x3a832f['body'],null))[_0xf326('0x1c')](respondWithResult(_0x3b8635,null))[_0xf326('0x26')](handleError(_0x3b8635,null));};exports[_0xf326('0x54')]=function(_0x29e52e,_0x4d3b9e){return db['ZendeskConfiguration'][_0xf326('0x51')]({'where':{'id':_0x29e52e[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d3b9e,null))[_0xf326('0x1c')](removeEntity(_0x4d3b9e,null))[_0xf326('0x26')](handleError(_0x4d3b9e,null));};exports[_0xf326('0x55')]=function(_0x1258d1,_0x5765b0,_0xb1c18c){var _0x5657b7={};var _0x5dbeb9={};var _0x9d84c3;var _0x51d466;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x1258d1[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5765b0,null))['then'](function(_0x1fd9c9){if(_0x1fd9c9){_0x9d84c3=_0x1fd9c9;_0x5dbeb9[_0xf326('0x37')]=_[_0xf326('0x39')](db['ZendeskField'][_0xf326('0x34')]);_0x5dbeb9['query']=_[_0xf326('0x39')](_0x1258d1[_0xf326('0x38')]);_0x5dbeb9[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x5dbeb9[_0xf326('0x37')],_0x5dbeb9[_0xf326('0x38')]);_0x5657b7[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x5dbeb9[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x38')][_0xf326('0x3d')]));_0x5657b7[_0xf326('0x3c')]=_0x5657b7['attributes'][_0xf326('0x3e')]?_0x5657b7['attributes']:_0x5dbeb9[_0xf326('0x37')];_0x5657b7[_0xf326('0x41')]=qs['sort'](_0x1258d1[_0xf326('0x38')]['sort']);_0x5657b7[_0xf326('0x43')]=qs[_0xf326('0x3a')](_[_0xf326('0x44')](_0x1258d1[_0xf326('0x38')],_0x5dbeb9[_0xf326('0x3a')]));if(_0x1258d1['query']['filter']){_0x5657b7[_0xf326('0x43')]=_[_0xf326('0x45')](_0x5657b7[_0xf326('0x43')],{'$or':_[_0xf326('0x33')](_0x5657b7[_0xf326('0x3c')],function(_0x579d2c){var _0x28c4f2={};_0x28c4f2[_0x579d2c]={'$like':'%'+_0x1258d1[_0xf326('0x38')]['filter']+'%'};return _0x28c4f2;})});}_0x5657b7=_['merge']({},_0x5657b7,_0x1258d1['options']);return _0x9d84c3[_0xf326('0x55')](_0x5657b7);}})[_0xf326('0x1c')](function(_0x4150fa){if(_0x4150fa){_0x51d466=_0x4150fa[_0xf326('0x3e')];if(!_0x1258d1[_0xf326('0x38')][_0xf326('0x57')](_0xf326('0x3f'))){_0x5657b7['limit']=qs[_0xf326('0x40')](_0x1258d1[_0xf326('0x38')][_0xf326('0x40')]);_0x5657b7[_0xf326('0x2b')]=qs['offset'](_0x1258d1[_0xf326('0x38')]['offset']);}return _0x9d84c3['getFields'](_0x5657b7);}})[_0xf326('0x1c')](function(_0x540fa0){if(_0x540fa0){return _0x540fa0?{'count':_0x51d466,'rows':_0x540fa0}:null;}})[_0xf326('0x1c')](respondWithResult(_0x5765b0,null))[_0xf326('0x26')](handleError(_0x5765b0,null));};exports[_0xf326('0x58')]=function(_0x2ea5a2,_0x17cd36,_0x541491){var _0x4a053c={};var _0x48d84a={};var _0xeeea57;var _0x307441;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x2ea5a2[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17cd36,null))[_0xf326('0x1c')](function(_0x372dc8){if(_0x372dc8){_0xeeea57=_0x372dc8;_0x48d84a[_0xf326('0x37')]=_['keys'](db['ZendeskField'][_0xf326('0x34')]);_0x48d84a[_0xf326('0x38')]=_['keys'](_0x2ea5a2['query']);_0x48d84a[_0xf326('0x3a')]=_['intersection'](_0x48d84a[_0xf326('0x37')],_0x48d84a['query']);_0x4a053c['attributes']=_['intersection'](_0x48d84a[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x2ea5a2[_0xf326('0x38')]['fields']));_0x4a053c[_0xf326('0x3c')]=_0x4a053c[_0xf326('0x3c')][_0xf326('0x3e')]?_0x4a053c[_0xf326('0x3c')]:_0x48d84a[_0xf326('0x37')];_0x4a053c[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x2ea5a2[_0xf326('0x38')][_0xf326('0x42')]);_0x4a053c['where']=qs[_0xf326('0x3a')](_['pick'](_0x2ea5a2[_0xf326('0x38')],_0x48d84a[_0xf326('0x3a')]));if(_0x2ea5a2[_0xf326('0x38')]['filter']){_0x4a053c[_0xf326('0x43')]=_[_0xf326('0x45')](_0x4a053c[_0xf326('0x43')],{'$or':_['map'](_0x4a053c[_0xf326('0x3c')],function(_0x4057e1){var _0x3bbe4c={};_0x3bbe4c[_0x4057e1]={'$like':'%'+_0x2ea5a2[_0xf326('0x38')]['filter']+'%'};return _0x3bbe4c;})});}_0x4a053c=_[_0xf326('0x45')]({},_0x4a053c,_0x2ea5a2['options']);return _0xeeea57['getSubjects'](_0x4a053c);}})[_0xf326('0x1c')](function(_0x2c36d3){if(_0x2c36d3){_0x307441=_0x2c36d3['length'];if(!_0x2ea5a2['query']['hasOwnProperty'](_0xf326('0x3f'))){_0x4a053c['limit']=qs[_0xf326('0x40')](_0x2ea5a2[_0xf326('0x38')][_0xf326('0x40')]);_0x4a053c[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0x2ea5a2[_0xf326('0x38')]['offset']);}return _0xeeea57[_0xf326('0x58')](_0x4a053c);}})[_0xf326('0x1c')](function(_0x5f1724){if(_0x5f1724){return _0x5f1724?{'count':_0x307441,'rows':_0x5f1724}:null;}})['then'](respondWithResult(_0x17cd36,null))[_0xf326('0x26')](handleError(_0x17cd36,null));};exports['getDescriptions']=function(_0x35a7c9,_0x147d51,_0x153027){var _0x363e64={};var _0x19d676={};var _0x6e662;var _0x293600;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x35a7c9['params']['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x147d51,null))[_0xf326('0x1c')](function(_0x4ac90e){if(_0x4ac90e){_0x6e662=_0x4ac90e;_0x19d676[_0xf326('0x37')]=_['keys'](db[_0xf326('0x59')][_0xf326('0x34')]);_0x19d676[_0xf326('0x38')]=_['keys'](_0x35a7c9[_0xf326('0x38')]);_0x19d676[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x19d676[_0xf326('0x37')],_0x19d676[_0xf326('0x38')]);_0x363e64[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x19d676[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x3d')]));_0x363e64[_0xf326('0x3c')]=_0x363e64[_0xf326('0x3c')][_0xf326('0x3e')]?_0x363e64[_0xf326('0x3c')]:_0x19d676['model'];_0x363e64[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x35a7c9['query'][_0xf326('0x42')]);_0x363e64[_0xf326('0x43')]=qs['filters'](_[_0xf326('0x44')](_0x35a7c9[_0xf326('0x38')],_0x19d676[_0xf326('0x3a')]));if(_0x35a7c9[_0xf326('0x38')][_0xf326('0x47')]){_0x363e64[_0xf326('0x43')]=_[_0xf326('0x45')](_0x363e64['where'],{'$or':_[_0xf326('0x33')](_0x363e64[_0xf326('0x3c')],function(_0x323fb1){var _0x3c33d1={};_0x3c33d1[_0x323fb1]={'$like':'%'+_0x35a7c9[_0xf326('0x38')][_0xf326('0x47')]+'%'};return _0x3c33d1;})});}_0x363e64=_[_0xf326('0x45')]({},_0x363e64,_0x35a7c9[_0xf326('0x50')]);return _0x6e662['getDescriptions'](_0x363e64);}})[_0xf326('0x1c')](function(_0x2e2103){if(_0x2e2103){_0x293600=_0x2e2103['length'];if(!_0x35a7c9[_0xf326('0x38')]['hasOwnProperty'](_0xf326('0x3f'))){_0x363e64[_0xf326('0x40')]=qs[_0xf326('0x40')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x40')]);_0x363e64[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x2b')]);}return _0x6e662[_0xf326('0x5a')](_0x363e64);}})[_0xf326('0x1c')](function(_0x3face2){if(_0x3face2){return _0x3face2?{'count':_0x293600,'rows':_0x3face2}:null;}})[_0xf326('0x1c')](respondWithResult(_0x147d51,null))[_0xf326('0x26')](handleError(_0x147d51,null));};exports['getTags']=function(_0x2bb6f0,_0xdb6e40,_0x27c569){var _0x3d3bd4={};var _0xdb2ad8={};var _0x550f34;var _0x1ec128;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x2bb6f0[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0xdb6e40,null))['then'](function(_0x4b6ec0){if(_0x4b6ec0){_0x550f34=_0x4b6ec0;_0xdb2ad8[_0xf326('0x37')]=_['keys'](db[_0xf326('0x5b')][_0xf326('0x34')]);_0xdb2ad8[_0xf326('0x38')]=_['keys'](_0x2bb6f0['query']);_0xdb2ad8[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0xdb2ad8[_0xf326('0x37')],_0xdb2ad8[_0xf326('0x38')]);_0x3d3bd4[_0xf326('0x3c')]=_['intersection'](_0xdb2ad8[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x2bb6f0[_0xf326('0x38')]['fields']));_0x3d3bd4['attributes']=_0x3d3bd4['attributes'][_0xf326('0x3e')]?_0x3d3bd4[_0xf326('0x3c')]:_0xdb2ad8[_0xf326('0x37')];_0x3d3bd4[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x2bb6f0[_0xf326('0x38')][_0xf326('0x42')]);_0x3d3bd4['where']=qs['filters'](_[_0xf326('0x44')](_0x2bb6f0[_0xf326('0x38')],_0xdb2ad8[_0xf326('0x3a')]));if(_0x2bb6f0['query'][_0xf326('0x47')]){_0x3d3bd4[_0xf326('0x43')]=_[_0xf326('0x45')](_0x3d3bd4['where'],{'$or':_[_0xf326('0x33')](_0x3d3bd4[_0xf326('0x3c')],function(_0x267bae){var _0x3d728a={};_0x3d728a[_0x267bae]={'$like':'%'+_0x2bb6f0['query']['filter']+'%'};return _0x3d728a;})});}_0x3d3bd4=_['merge']({},_0x3d3bd4,_0x2bb6f0[_0xf326('0x50')]);return _0x550f34[_0xf326('0x5c')](_0x3d3bd4);}})[_0xf326('0x1c')](function(_0x5f0b45){if(_0x5f0b45){_0x1ec128=_0x5f0b45[_0xf326('0x3e')];if(!_0x2bb6f0[_0xf326('0x38')][_0xf326('0x57')]('nolimit')){_0x3d3bd4[_0xf326('0x40')]=qs[_0xf326('0x40')](_0x2bb6f0[_0xf326('0x38')][_0xf326('0x40')]);_0x3d3bd4['offset']=qs[_0xf326('0x2b')](_0x2bb6f0['query'][_0xf326('0x2b')]);}return _0x550f34[_0xf326('0x5c')](_0x3d3bd4);}})[_0xf326('0x1c')](function(_0xd45708){if(_0xd45708){return _0xd45708?{'count':_0x1ec128,'rows':_0xd45708}:null;}})['then'](respondWithResult(_0xdb6e40,null))[_0xf326('0x26')](handleError(_0xdb6e40,null));};exports['setTags']=function(_0x499316,_0x1ec34d,_0x1d6962){if(_0x499316[_0xf326('0x53')]['id']){delete _0x499316[_0xf326('0x53')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x499316[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x1ec34d,null))[_0xf326('0x1c')](function(_0xc67315){if(_0xc67315){return _0xc67315['setTags'](_0x499316[_0xf326('0x53')]['ids']||[]);}return null;})[_0xf326('0x1c')](respondWithResult(_0x1ec34d,null))[_0xf326('0x26')](handleError(_0x1ec34d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index 77f9eec..66cd910 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 _0x54a7=['request-promise','path','rimraf','../../config/environment','exports','lodash','../../config/logger','api','moment','bluebird'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x54a7,0x109));var _0x754a=function(_0x463e50,_0xd11e28){_0x463e50=_0x463e50-0x0;var _0x5371a6=_0x54a7[_0x463e50];return _0x5371a6;};'use strict';var _=require(_0x754a('0x0'));var util=require('util');var logger=require(_0x754a('0x1'))(_0x754a('0x2'));var moment=require(_0x754a('0x3'));var BPromise=require(_0x754a('0x4'));var rp=require(_0x754a('0x5'));var fs=require('fs');var path=require(_0x754a('0x6'));var rimraf=require(_0x754a('0x7'));var config=require(_0x754a('0x8'));var attributes=require('./intZendeskConfiguration.attributes');module[_0x754a('0x9')]=function(_0x174a21,_0x2892fc){return _0x174a21['define']('ZendeskConfiguration',attributes,{'tableName':'int_zendesk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x01c4=['ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','define'];(function(_0x5e0ef2,_0x4e9cc0){var _0x1caa98=function(_0x2fbe9b){while(--_0x2fbe9b){_0x5e0ef2['push'](_0x5e0ef2['shift']());}};_0x1caa98(++_0x4e9cc0);}(_0x01c4,0x176));var _0x401c=function(_0xad2972,_0x362cf7){_0xad2972=_0xad2972-0x0;var _0xd72857=_0x01c4[_0xad2972];return _0xd72857;};'use strict';var _=require(_0x401c('0x0'));var util=require(_0x401c('0x1'));var logger=require(_0x401c('0x2'))(_0x401c('0x3'));var moment=require(_0x401c('0x4'));var BPromise=require(_0x401c('0x5'));var rp=require(_0x401c('0x6'));var fs=require('fs');var path=require(_0x401c('0x7'));var rimraf=require('rimraf');var config=require(_0x401c('0x8'));var attributes=require('./intZendeskConfiguration.attributes');module['exports']=function(_0x54db5f,_0x1c0466){return _0x54db5f[_0x401c('0x9')](_0x401c('0xa'),attributes,{'tableName':_0x401c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 4868f96..c63a64a 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 _0xb6d3=['message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x398679,_0x17bc01){var _0x38d08d=function(_0x4bfb53){while(--_0x4bfb53){_0x398679['push'](_0x398679['shift']());}};_0x38d08d(++_0x17bc01);}(_0xb6d3,0x9d));var _0x3b6d=function(_0x1a9c7a,_0x3b96da){_0x1a9c7a=_0x1a9c7a-0x0;var _0x5ac305=_0xb6d3[_0x1a9c7a];return _0x5ac305;};'use strict';var _=require(_0x3b6d('0x0'));var util=require(_0x3b6d('0x1'));var moment=require(_0x3b6d('0x2'));var BPromise=require(_0x3b6d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3b6d('0x4'));var db=require(_0x3b6d('0x5'))['db'];var utils=require(_0x3b6d('0x6'));var logger=require('../../config/logger')(_0x3b6d('0x7'));var config=require(_0x3b6d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3b6d('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x339b1f,_0x5032ee,_0x1ab949){return new BPromise(function(_0x196e5d,_0x4b541b){return client[_0x3b6d('0xa')](_0x339b1f,_0x1ab949)[_0x3b6d('0xb')](function(_0x264594){logger[_0x3b6d('0xc')](_0x3b6d('0xd'),_0x5032ee,_0x3b6d('0xe'));logger[_0x3b6d('0xf')]('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5032ee,'request\x20sent',JSON[_0x3b6d('0x10')](_0x264594));if(_0x264594[_0x3b6d('0x11')]){if(_0x264594[_0x3b6d('0x11')][_0x3b6d('0x12')]===0x1f4){logger[_0x3b6d('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5032ee,_0x264594[_0x3b6d('0x11')]['message']);return _0x4b541b(_0x264594['error'][_0x3b6d('0x13')]);}logger[_0x3b6d('0x11')](_0x3b6d('0xd'),_0x5032ee,_0x264594[_0x3b6d('0x11')][_0x3b6d('0x13')]);return _0x196e5d(_0x264594[_0x3b6d('0x11')][_0x3b6d('0x13')]);}else{logger[_0x3b6d('0xc')](_0x3b6d('0xd'),_0x5032ee,'request\x20sent');_0x196e5d(_0x264594[_0x3b6d('0x14')]['message']);}})[_0x3b6d('0x15')](function(_0x4d2daa){logger[_0x3b6d('0x11')]('ZendeskConfiguration,\x20%s,\x20%s',_0x5032ee,_0x4d2daa);_0x4b541b(_0x4d2daa);});});} \ No newline at end of file +var _0x5215=['message','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','info','ZendeskConfiguration,\x20%s,\x20%s','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x74b6ae,_0x434c5f){var _0x967eb2=function(_0x6638de){while(--_0x6638de){_0x74b6ae['push'](_0x74b6ae['shift']());}};_0x967eb2(++_0x434c5f);}(_0x5215,0x169));var _0x5521=function(_0x39161c,_0x5d67fb){_0x39161c=_0x39161c-0x0;var _0x4ae4a7=_0x5215[_0x39161c];return _0x4ae4a7;};'use strict';var _=require(_0x5521('0x0'));var util=require(_0x5521('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5521('0x2'));var fs=require('fs');var Redis=require(_0x5521('0x3'));var db=require(_0x5521('0x4'))['db'];var utils=require(_0x5521('0x5'));var logger=require('../../config/logger')(_0x5521('0x6'));var config=require(_0x5521('0x7'));var jayson=require(_0x5521('0x8'));var client=jayson[_0x5521('0x9')][_0x5521('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41a1e8,_0x2b33d4,_0x424da0){return new BPromise(function(_0x1a35e8,_0x32a2c4){return client['request'](_0x41a1e8,_0x424da0)['then'](function(_0x44fb6d){logger[_0x5521('0xb')](_0x5521('0xc'),_0x2b33d4,'request\x20sent');logger['debug'](_0x5521('0xd'),_0x2b33d4,_0x5521('0xe'),JSON[_0x5521('0xf')](_0x44fb6d));if(_0x44fb6d[_0x5521('0x10')]){if(_0x44fb6d[_0x5521('0x10')]['code']===0x1f4){logger[_0x5521('0x10')](_0x5521('0xc'),_0x2b33d4,_0x44fb6d[_0x5521('0x10')][_0x5521('0x11')]);return _0x32a2c4(_0x44fb6d[_0x5521('0x10')]['message']);}logger[_0x5521('0x10')]('ZendeskConfiguration,\x20%s,\x20%s',_0x2b33d4,_0x44fb6d[_0x5521('0x10')][_0x5521('0x11')]);return _0x1a35e8(_0x44fb6d[_0x5521('0x10')][_0x5521('0x11')]);}else{logger[_0x5521('0xb')](_0x5521('0xc'),_0x2b33d4,'request\x20sent');_0x1a35e8(_0x44fb6d['result']['message']);}})['catch'](function(_0x3613f6){logger[_0x5521('0x10')](_0x5521('0xc'),_0x2b33d4,_0x3613f6);_0x32a2c4(_0x3613f6);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 1b63744..69b2b85 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 _0xa1e9=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x25abbe,_0x53b462){var _0x55c770=function(_0x164dbf){while(--_0x164dbf){_0x25abbe['push'](_0x25abbe['shift']());}};_0x55c770(++_0x53b462);}(_0xa1e9,0x1ed));var _0x9a1e=function(_0xebec55,_0x3f4f14){_0xebec55=_0xebec55-0x0;var _0x355d91=_0xa1e9[_0xebec55];return _0x355d91;};'use strict';var multer=require(_0x9a1e('0x0'));var util=require(_0x9a1e('0x1'));var path=require(_0x9a1e('0x2'));var timeout=require(_0x9a1e('0x3'));var express=require(_0x9a1e('0x4'));var router=express[_0x9a1e('0x5')]();var auth=require(_0x9a1e('0x6'));var interaction=require(_0x9a1e('0x7'));var config=require(_0x9a1e('0x8'));var controller=require(_0x9a1e('0x9'));router[_0x9a1e('0xa')]('/',auth[_0x9a1e('0xb')](),controller[_0x9a1e('0xc')]);router['get'](_0x9a1e('0xd'),auth[_0x9a1e('0xb')](),controller[_0x9a1e('0xe')]);router[_0x9a1e('0xf')]('/',auth[_0x9a1e('0xb')](),controller[_0x9a1e('0x10')]);router[_0x9a1e('0x11')](_0x9a1e('0xd'),auth[_0x9a1e('0xb')](),controller[_0x9a1e('0x12')]);router[_0x9a1e('0x13')](_0x9a1e('0xd'),auth[_0x9a1e('0xb')](),controller[_0x9a1e('0x14')]);module[_0x9a1e('0x15')]=router; \ No newline at end of file +var _0x0501=['put','update','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x5eb5fa,_0x5ed05e){var _0x199396=function(_0x132e48){while(--_0x132e48){_0x5eb5fa['push'](_0x5eb5fa['shift']());}};_0x199396(++_0x5ed05e);}(_0x0501,0xcf));var _0x1050=function(_0x575584,_0x149395){_0x575584=_0x575584-0x0;var _0x120d12=_0x0501[_0x575584];return _0x120d12;};'use strict';var multer=require(_0x1050('0x0'));var util=require(_0x1050('0x1'));var path=require('path');var timeout=require(_0x1050('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x1050('0x3'));var interaction=require(_0x1050('0x4'));var config=require(_0x1050('0x5'));var controller=require(_0x1050('0x6'));router[_0x1050('0x7')]('/',auth[_0x1050('0x8')](),controller[_0x1050('0x9')]);router['get'](_0x1050('0xa'),auth[_0x1050('0x8')](),controller[_0x1050('0xb')]);router[_0x1050('0xc')]('/',auth[_0x1050('0x8')](),controller[_0x1050('0xd')]);router[_0x1050('0xe')](_0x1050('0xa'),auth[_0x1050('0x8')](),controller[_0x1050('0xf')]);router['delete'](_0x1050('0xa'),auth[_0x1050('0x8')](),controller['destroy']);module[_0x1050('0x10')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 2637b77..face641 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 _0xae1c=['string','STRING','ENUM','variable','customVariable','keyValue'];(function(_0x23b324,_0x5fb72f){var _0x1af1ad=function(_0x3292c1){while(--_0x3292c1){_0x23b324['push'](_0x23b324['shift']());}};_0x1af1ad(++_0x5fb72f);}(_0xae1c,0xff));var _0xcae1=function(_0x4e8f8c,_0xfb9df1){_0x4e8f8c=_0x4e8f8c-0x0;var _0x474333=_0xae1c[_0x4e8f8c];return _0x474333;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xcae1('0x0'),_0xcae1('0x1'),_0xcae1('0x2')),'defaultValue':_0xcae1('0x3')},'content':{'type':Sequelize[_0xcae1('0x4')]},'key':{'type':Sequelize[_0xcae1('0x4')]},'keyType':{'type':Sequelize[_0xcae1('0x5')](_0xcae1('0x3'),_0xcae1('0x0'),_0xcae1('0x1'))},'keyContent':{'type':Sequelize[_0xcae1('0x4')]},'idField':{'type':Sequelize[_0xcae1('0x4')]},'nameField':{'type':Sequelize[_0xcae1('0x4')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc92f=['variable','customVariable','STRING','sequelize','exports','string'];(function(_0x368680,_0x2165e4){var _0x27a70b=function(_0x23ca88){while(--_0x23ca88){_0x368680['push'](_0x368680['shift']());}};_0x27a70b(++_0x2165e4);}(_0xc92f,0xf3));var _0xfc92=function(_0x349e09,_0x562b87){_0x349e09=_0x349e09-0x0;var _0x11ccff=_0xc92f[_0x349e09];return _0x11ccff;};'use strict';var Sequelize=require(_0xfc92('0x0'));module[_0xfc92('0x1')]={'type':{'type':Sequelize['ENUM'](_0xfc92('0x2'),_0xfc92('0x3'),_0xfc92('0x4'),'keyValue'),'defaultValue':_0xfc92('0x2')},'content':{'type':Sequelize[_0xfc92('0x5')]},'key':{'type':Sequelize[_0xfc92('0x5')]},'keyType':{'type':Sequelize['ENUM']('string',_0xfc92('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xfc92('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfc92('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfc92('0x5')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index 1154924..56a9ef8 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 _0x92bb=['end','count','limit','set','apply','reject','update','then','destroy','name','index','map','ZendeskField','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','order','sort','where','pick','filter','include','rows','catch','params','options','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x136ee3,_0x5d3527){var _0x1fe589=function(_0x4da603){while(--_0x4da603){_0x136ee3['push'](_0x136ee3['shift']());}};_0x1fe589(++_0x5d3527);}(_0x92bb,0x127));var _0xb92b=function(_0x329664,_0x130748){_0x329664=_0x329664-0x0;var _0x4e346e=_0x92bb[_0x329664];return _0x4e346e;};'use strict';var pdf=require(_0xb92b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb92b('0x1'));var zipdir=require(_0xb92b('0x2'));var jsonpatch=require(_0xb92b('0x3'));var rp=require(_0xb92b('0x4'));var moment=require(_0xb92b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb92b('0x6'));var util=require(_0xb92b('0x7'));var path=require('path');var sox=require(_0xb92b('0x8'));var csv=require(_0xb92b('0x9'));var ejs=require(_0xb92b('0xa'));var fs=require('fs');var _=require(_0xb92b('0xb'));var squel=require(_0xb92b('0xc'));var crypto=require(_0xb92b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb92b('0x9'));var querystring=require(_0xb92b('0xe'));var Papa=require(_0xb92b('0xf'));var Redis=require(_0xb92b('0x10'));var authService=require(_0xb92b('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb92b('0x12'));var logger=require(_0xb92b('0x13'))('api');var utils=require(_0xb92b('0x14'));var config=require(_0xb92b('0x15'));var db=require(_0xb92b('0x16'))['db'];function respondWithStatusCode(_0x59255f,_0x30df36){_0x30df36=_0x30df36||0xcc;return function(_0x386485){if(_0x386485){return _0x59255f[_0xb92b('0x17')](_0x30df36);}return _0x59255f[_0xb92b('0x18')](_0x30df36)[_0xb92b('0x19')]();};}function respondWithResult(_0x24c82b,_0x3ae539){_0x3ae539=_0x3ae539||0xc8;return function(_0x115590){if(_0x115590){return _0x24c82b[_0xb92b('0x18')](_0x3ae539)['json'](_0x115590);}};}function respondWithFilteredResult(_0xb5c438,_0x3e22bd){return function(_0xa53cf3){if(_0xa53cf3){var _0x3cd095=_0xa53cf3[_0xb92b('0x1a')],_0x12d6bf=_0x3e22bd['offset'],_0x254554=_0x3e22bd['offset']+_0x3e22bd[_0xb92b('0x1b')],_0x3c5be7;if(_0x254554>=_0x3cd095){_0x254554=_0x3cd095;_0x3c5be7=0xc8;}else{_0x3c5be7=0xce;}_0xb5c438[_0xb92b('0x18')](_0x3c5be7);return _0xb5c438[_0xb92b('0x1c')]('Content-Range',_0x12d6bf+'-'+_0x254554+'/'+_0x3cd095)['json'](_0xa53cf3);}return null;};}function patchUpdates(_0x80e2ca){return function(_0xc11cbe){try{jsonpatch[_0xb92b('0x1d')](_0xc11cbe,_0x80e2ca,!![]);}catch(_0x19e5b5){return BPromise[_0xb92b('0x1e')](_0x19e5b5);}return _0xc11cbe['save']();};}function saveUpdates(_0x11b053,_0x18df02){return function(_0x2cf325){if(_0x2cf325){return _0x2cf325[_0xb92b('0x1f')](_0x11b053)[_0xb92b('0x20')](function(_0x1796fb){return _0x1796fb;});}return null;};}function removeEntity(_0xc22c16,_0x5adecf){return function(_0x1eadce){if(_0x1eadce){return _0x1eadce[_0xb92b('0x21')]()[_0xb92b('0x20')](function(){_0xc22c16[_0xb92b('0x18')](0xcc)[_0xb92b('0x19')]();});}};}function handleEntityNotFound(_0x218be2,_0x4736da){return function(_0xded255){if(!_0xded255){_0x218be2[_0xb92b('0x17')](0x194);}return _0xded255;};}function handleError(_0x261403,_0x51f1d0){_0x51f1d0=_0x51f1d0||0x1f4;return function(_0x5e6423){logger['error'](_0x5e6423['stack']);if(_0x5e6423[_0xb92b('0x22')]){delete _0x5e6423[_0xb92b('0x22')];}_0x261403['status'](_0x51f1d0)['send'](_0x5e6423);};}exports[_0xb92b('0x23')]=function(_0x1fd1a2,_0x14b8b6){var _0x79dca1={},_0x1bae8f={},_0x150501={'count':0x0,'rows':[]};var _0x1e5bc5=_[_0xb92b('0x24')](db[_0xb92b('0x25')]['rawAttributes'],function(_0x431947){return{'name':_0x431947[_0xb92b('0x26')],'type':_0x431947[_0xb92b('0x27')][_0xb92b('0x28')]};});_0x1bae8f[_0xb92b('0x29')]=_[_0xb92b('0x24')](_0x1e5bc5,'name');_0x1bae8f[_0xb92b('0x2a')]=_[_0xb92b('0x2b')](_0x1fd1a2[_0xb92b('0x2a')]);_0x1bae8f[_0xb92b('0x2c')]=_[_0xb92b('0x2d')](_0x1bae8f[_0xb92b('0x29')],_0x1bae8f[_0xb92b('0x2a')]);_0x79dca1['attributes']=_[_0xb92b('0x2d')](_0x1bae8f[_0xb92b('0x29')],qs[_0xb92b('0x2e')](_0x1fd1a2[_0xb92b('0x2a')][_0xb92b('0x2e')]));_0x79dca1['attributes']=_0x79dca1[_0xb92b('0x2f')][_0xb92b('0x30')]?_0x79dca1[_0xb92b('0x2f')]:_0x1bae8f['model'];if(!_0x1fd1a2[_0xb92b('0x2a')]['hasOwnProperty'](_0xb92b('0x31'))){_0x79dca1[_0xb92b('0x1b')]=qs[_0xb92b('0x1b')](_0x1fd1a2['query'][_0xb92b('0x1b')]);_0x79dca1['offset']=qs[_0xb92b('0x32')](_0x1fd1a2['query']['offset']);}_0x79dca1[_0xb92b('0x33')]=qs[_0xb92b('0x34')](_0x1fd1a2[_0xb92b('0x2a')][_0xb92b('0x34')]);_0x79dca1[_0xb92b('0x35')]=qs['filters'](_[_0xb92b('0x36')](_0x1fd1a2[_0xb92b('0x2a')],_0x1bae8f[_0xb92b('0x2c')]));if(_0x1fd1a2['query'][_0xb92b('0x37')]){_0x79dca1[_0xb92b('0x35')]=_['merge'](_0x79dca1[_0xb92b('0x35')],{'$or':_[_0xb92b('0x24')](_0x1e5bc5,function(_0x360f93){if(_0x360f93['type']!=='VIRTUAL'){var _0x32434f={};_0x32434f[_0x360f93['name']]={'$like':'%'+_0x1fd1a2[_0xb92b('0x2a')]['filter']+'%'};return _0x32434f;}})});}_0x79dca1=_['merge']({},_0x79dca1,_0x1fd1a2['options']);var _0x383777={'where':_0x79dca1[_0xb92b('0x35')]};return db[_0xb92b('0x25')][_0xb92b('0x1a')](_0x383777)['then'](function(_0x2498e8){_0x150501['count']=_0x2498e8;if(_0x1fd1a2[_0xb92b('0x2a')]['includeAll']){_0x79dca1[_0xb92b('0x38')]=[{'all':!![]}];}return db[_0xb92b('0x25')]['findAll'](_0x79dca1);})[_0xb92b('0x20')](function(_0x170f30){_0x150501[_0xb92b('0x39')]=_0x170f30;return _0x150501;})[_0xb92b('0x20')](respondWithFilteredResult(_0x14b8b6,_0x79dca1))[_0xb92b('0x3a')](handleError(_0x14b8b6,null));};exports['show']=function(_0x211212,_0x439cad){var _0x8cf3ee={'raw':!![],'where':{'id':_0x211212[_0xb92b('0x3b')]['id']}},_0x24bde3={};_0x24bde3[_0xb92b('0x29')]=_[_0xb92b('0x2b')](db['ZendeskField']['rawAttributes']);_0x24bde3[_0xb92b('0x2a')]=_[_0xb92b('0x2b')](_0x211212['query']);_0x24bde3[_0xb92b('0x2c')]=_[_0xb92b('0x2d')](_0x24bde3[_0xb92b('0x29')],_0x24bde3[_0xb92b('0x2a')]);_0x8cf3ee['attributes']=_['intersection'](_0x24bde3['model'],qs[_0xb92b('0x2e')](_0x211212[_0xb92b('0x2a')]['fields']));_0x8cf3ee[_0xb92b('0x2f')]=_0x8cf3ee[_0xb92b('0x2f')][_0xb92b('0x30')]?_0x8cf3ee[_0xb92b('0x2f')]:_0x24bde3['model'];if(_0x211212[_0xb92b('0x2a')]['includeAll']){_0x8cf3ee[_0xb92b('0x38')]=[{'all':!![]}];}_0x8cf3ee=_['merge']({},_0x8cf3ee,_0x211212[_0xb92b('0x3c')]);return db['ZendeskField'][_0xb92b('0x3d')](_0x8cf3ee)[_0xb92b('0x20')](handleEntityNotFound(_0x439cad,null))[_0xb92b('0x20')](respondWithResult(_0x439cad,null))['catch'](handleError(_0x439cad,null));};exports[_0xb92b('0x3e')]=function(_0x5063d9,_0x14caf5){return db['ZendeskField'][_0xb92b('0x3e')](_0x5063d9[_0xb92b('0x3f')],{})['then'](respondWithResult(_0x14caf5,0xc9))[_0xb92b('0x3a')](handleError(_0x14caf5,null));};exports[_0xb92b('0x1f')]=function(_0x167690,_0x2c7f7a){if(_0x167690[_0xb92b('0x3f')]['id']){delete _0x167690[_0xb92b('0x3f')]['id'];}return db['ZendeskField'][_0xb92b('0x3d')]({'where':{'id':_0x167690['params']['id']}})[_0xb92b('0x20')](handleEntityNotFound(_0x2c7f7a,null))[_0xb92b('0x20')](saveUpdates(_0x167690[_0xb92b('0x3f')],null))[_0xb92b('0x20')](respondWithResult(_0x2c7f7a,null))['catch'](handleError(_0x2c7f7a,null));};exports[_0xb92b('0x21')]=function(_0x2973ea,_0x3e3e85){return db['ZendeskField'][_0xb92b('0x3d')]({'where':{'id':_0x2973ea[_0xb92b('0x3b')]['id']}})[_0xb92b('0x20')](handleEntityNotFound(_0x3e3e85,null))['then'](removeEntity(_0x3e3e85,null))[_0xb92b('0x3a')](handleError(_0x3e3e85,null));}; \ No newline at end of file +var _0x729c=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','error','name','send','index','map','rawAttributes','type','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','ZendeskField','includeAll','include','findAll','rows','catch','params','fields','merge','options','find','create','body','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','desk.js','querystring'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x729c,0x85));var _0xc729=function(_0x4c7efc,_0x8d93f3){_0x4c7efc=_0x4c7efc-0x0;var _0x253fff=_0x729c[_0x4c7efc];return _0x253fff;};'use strict';var pdf=require(_0xc729('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc729('0x1'));var jsonpatch=require(_0xc729('0x2'));var rp=require(_0xc729('0x3'));var moment=require(_0xc729('0x4'));var BPromise=require(_0xc729('0x5'));var Mustache=require(_0xc729('0x6'));var util=require(_0xc729('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc729('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc729('0x9'));var crypto=require(_0xc729('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xc729('0xb'));var toCsv=require(_0xc729('0x8'));var querystring=require(_0xc729('0xc'));var Papa=require(_0xc729('0xd'));var Redis=require(_0xc729('0xe'));var authService=require(_0xc729('0xf'));var qs=require(_0xc729('0x10'));var as=require(_0xc729('0x11'));var hardwareService=require(_0xc729('0x12'));var logger=require(_0xc729('0x13'))(_0xc729('0x14'));var utils=require(_0xc729('0x15'));var config=require(_0xc729('0x16'));var db=require(_0xc729('0x17'))['db'];function respondWithStatusCode(_0x2f5e9e,_0x39b294){_0x39b294=_0x39b294||0xcc;return function(_0x2e949e){if(_0x2e949e){return _0x2f5e9e[_0xc729('0x18')](_0x39b294);}return _0x2f5e9e[_0xc729('0x19')](_0x39b294)[_0xc729('0x1a')]();};}function respondWithResult(_0x526663,_0x2355ed){_0x2355ed=_0x2355ed||0xc8;return function(_0x4a9ce9){if(_0x4a9ce9){return _0x526663[_0xc729('0x19')](_0x2355ed)[_0xc729('0x1b')](_0x4a9ce9);}};}function respondWithFilteredResult(_0x2082f1,_0x4a70f7){return function(_0x35ecd5){if(_0x35ecd5){var _0x1f4ce9=_0x35ecd5[_0xc729('0x1c')],_0x53183e=_0x4a70f7[_0xc729('0x1d')],_0xca32c9=_0x4a70f7['offset']+_0x4a70f7['limit'],_0x3f14f0;if(_0xca32c9>=_0x1f4ce9){_0xca32c9=_0x1f4ce9;_0x3f14f0=0xc8;}else{_0x3f14f0=0xce;}_0x2082f1['status'](_0x3f14f0);return _0x2082f1[_0xc729('0x1e')]('Content-Range',_0x53183e+'-'+_0xca32c9+'/'+_0x1f4ce9)[_0xc729('0x1b')](_0x35ecd5);}return null;};}function patchUpdates(_0x726fae){return function(_0x678269){try{jsonpatch[_0xc729('0x1f')](_0x678269,_0x726fae,!![]);}catch(_0x198a8a){return BPromise[_0xc729('0x20')](_0x198a8a);}return _0x678269[_0xc729('0x21')]();};}function saveUpdates(_0x20f846,_0x1e6a3b){return function(_0x5c14f5){if(_0x5c14f5){return _0x5c14f5[_0xc729('0x22')](_0x20f846)[_0xc729('0x23')](function(_0x115660){return _0x115660;});}return null;};}function removeEntity(_0x26ccd3,_0x7adf42){return function(_0x5075c1){if(_0x5075c1){return _0x5075c1[_0xc729('0x24')]()[_0xc729('0x23')](function(){_0x26ccd3[_0xc729('0x19')](0xcc)[_0xc729('0x1a')]();});}};}function handleEntityNotFound(_0x4bf9db,_0x3e5be1){return function(_0x2944df){if(!_0x2944df){_0x4bf9db[_0xc729('0x18')](0x194);}return _0x2944df;};}function handleError(_0x4788f3,_0x15eadc){_0x15eadc=_0x15eadc||0x1f4;return function(_0x52971e){logger[_0xc729('0x25')](_0x52971e['stack']);if(_0x52971e[_0xc729('0x26')]){delete _0x52971e[_0xc729('0x26')];}_0x4788f3['status'](_0x15eadc)[_0xc729('0x27')](_0x52971e);};}exports[_0xc729('0x28')]=function(_0x277c60,_0xce42c1){var _0x16ad1a={},_0x31c221={},_0xf7930c={'count':0x0,'rows':[]};var _0x32d81a=_[_0xc729('0x29')](db['ZendeskField'][_0xc729('0x2a')],function(_0x3c3974){return{'name':_0x3c3974['fieldName'],'type':_0x3c3974[_0xc729('0x2b')]['key']};});_0x31c221[_0xc729('0x2c')]=_[_0xc729('0x29')](_0x32d81a,_0xc729('0x26'));_0x31c221[_0xc729('0x2d')]=_[_0xc729('0x2e')](_0x277c60[_0xc729('0x2d')]);_0x31c221[_0xc729('0x2f')]=_[_0xc729('0x30')](_0x31c221[_0xc729('0x2c')],_0x31c221[_0xc729('0x2d')]);_0x16ad1a[_0xc729('0x31')]=_[_0xc729('0x30')](_0x31c221['model'],qs['fields'](_0x277c60['query']['fields']));_0x16ad1a['attributes']=_0x16ad1a[_0xc729('0x31')][_0xc729('0x32')]?_0x16ad1a['attributes']:_0x31c221[_0xc729('0x2c')];if(!_0x277c60[_0xc729('0x2d')][_0xc729('0x33')](_0xc729('0x34'))){_0x16ad1a[_0xc729('0x35')]=qs[_0xc729('0x35')](_0x277c60[_0xc729('0x2d')][_0xc729('0x35')]);_0x16ad1a[_0xc729('0x1d')]=qs['offset'](_0x277c60['query'][_0xc729('0x1d')]);}_0x16ad1a[_0xc729('0x36')]=qs[_0xc729('0x37')](_0x277c60[_0xc729('0x2d')][_0xc729('0x37')]);_0x16ad1a[_0xc729('0x38')]=qs[_0xc729('0x2f')](_[_0xc729('0x39')](_0x277c60[_0xc729('0x2d')],_0x31c221[_0xc729('0x2f')]));if(_0x277c60['query'][_0xc729('0x3a')]){_0x16ad1a['where']=_['merge'](_0x16ad1a['where'],{'$or':_[_0xc729('0x29')](_0x32d81a,function(_0x32d356){if(_0x32d356[_0xc729('0x2b')]!==_0xc729('0x3b')){var _0x10c005={};_0x10c005[_0x32d356['name']]={'$like':'%'+_0x277c60['query'][_0xc729('0x3a')]+'%'};return _0x10c005;}})});}_0x16ad1a=_['merge']({},_0x16ad1a,_0x277c60['options']);var _0x2a8e26={'where':_0x16ad1a['where']};return db[_0xc729('0x3c')][_0xc729('0x1c')](_0x2a8e26)['then'](function(_0x1e1326){_0xf7930c[_0xc729('0x1c')]=_0x1e1326;if(_0x277c60[_0xc729('0x2d')][_0xc729('0x3d')]){_0x16ad1a[_0xc729('0x3e')]=[{'all':!![]}];}return db[_0xc729('0x3c')][_0xc729('0x3f')](_0x16ad1a);})[_0xc729('0x23')](function(_0x48be4f){_0xf7930c[_0xc729('0x40')]=_0x48be4f;return _0xf7930c;})['then'](respondWithFilteredResult(_0xce42c1,_0x16ad1a))[_0xc729('0x41')](handleError(_0xce42c1,null));};exports['show']=function(_0x12e06f,_0x44f49d){var _0x1f882c={'raw':!![],'where':{'id':_0x12e06f[_0xc729('0x42')]['id']}},_0x46b459={};_0x46b459[_0xc729('0x2c')]=_[_0xc729('0x2e')](db[_0xc729('0x3c')][_0xc729('0x2a')]);_0x46b459[_0xc729('0x2d')]=_[_0xc729('0x2e')](_0x12e06f[_0xc729('0x2d')]);_0x46b459['filters']=_[_0xc729('0x30')](_0x46b459[_0xc729('0x2c')],_0x46b459[_0xc729('0x2d')]);_0x1f882c[_0xc729('0x31')]=_[_0xc729('0x30')](_0x46b459[_0xc729('0x2c')],qs[_0xc729('0x43')](_0x12e06f[_0xc729('0x2d')]['fields']));_0x1f882c[_0xc729('0x31')]=_0x1f882c[_0xc729('0x31')][_0xc729('0x32')]?_0x1f882c[_0xc729('0x31')]:_0x46b459[_0xc729('0x2c')];if(_0x12e06f[_0xc729('0x2d')][_0xc729('0x3d')]){_0x1f882c[_0xc729('0x3e')]=[{'all':!![]}];}_0x1f882c=_[_0xc729('0x44')]({},_0x1f882c,_0x12e06f[_0xc729('0x45')]);return db[_0xc729('0x3c')][_0xc729('0x46')](_0x1f882c)[_0xc729('0x23')](handleEntityNotFound(_0x44f49d,null))[_0xc729('0x23')](respondWithResult(_0x44f49d,null))['catch'](handleError(_0x44f49d,null));};exports[_0xc729('0x47')]=function(_0x16a323,_0x2cb3c2){return db[_0xc729('0x3c')][_0xc729('0x47')](_0x16a323['body'],{})[_0xc729('0x23')](respondWithResult(_0x2cb3c2,0xc9))[_0xc729('0x41')](handleError(_0x2cb3c2,null));};exports['update']=function(_0x4512d0,_0x2608c1){if(_0x4512d0['body']['id']){delete _0x4512d0[_0xc729('0x48')]['id'];}return db[_0xc729('0x3c')][_0xc729('0x46')]({'where':{'id':_0x4512d0[_0xc729('0x42')]['id']}})['then'](handleEntityNotFound(_0x2608c1,null))[_0xc729('0x23')](saveUpdates(_0x4512d0[_0xc729('0x48')],null))[_0xc729('0x23')](respondWithResult(_0x2608c1,null))[_0xc729('0x41')](handleError(_0x2608c1,null));};exports[_0xc729('0x24')]=function(_0x5055d6,_0x45dd18){return db['ZendeskField'][_0xc729('0x46')]({'where':{'id':_0x5055d6['params']['id']}})['then'](handleEntityNotFound(_0x45dd18,null))[_0xc729('0x23')](removeEntity(_0x45dd18,null))[_0xc729('0x41')](handleError(_0x45dd18,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index d7f9b3b..44dad35 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 _0xc0d6=['util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','int_zendesk_fields','zendesk_unique_index','idField','FieldId'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0xc0d6,0x1ce));var _0x6c0d=function(_0x4ad39a,_0x26766b){_0x4ad39a=_0x4ad39a-0x0;var _0x270ec2=_0xc0d6[_0x4ad39a];return _0x270ec2;};'use strict';var _=require('lodash');var util=require(_0x6c0d('0x0'));var logger=require('../../config/logger')(_0x6c0d('0x1'));var moment=require(_0x6c0d('0x2'));var BPromise=require(_0x6c0d('0x3'));var rp=require(_0x6c0d('0x4'));var fs=require('fs');var path=require(_0x6c0d('0x5'));var rimraf=require(_0x6c0d('0x6'));var config=require(_0x6c0d('0x7'));var attributes=require(_0x6c0d('0x8'));module[_0x6c0d('0x9')]=function(_0x32cbb6,_0x4caa83){return _0x32cbb6['define']('ZendeskField',attributes,{'tableName':_0x6c0d('0xa'),'paranoid':![],'indexes':[{'name':_0x6c0d('0xb'),'fields':[_0x6c0d('0xc'),_0x6c0d('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x9147=['./intZendeskField.attributes','define','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x5e77ff,_0x1fe29c){var _0x115c32=function(_0x5a446b){while(--_0x5a446b){_0x5e77ff['push'](_0x5e77ff['shift']());}};_0x115c32(++_0x1fe29c);}(_0x9147,0x7b));var _0x7914=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x9147[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x7914('0x0'));var util=require(_0x7914('0x1'));var logger=require('../../config/logger')(_0x7914('0x2'));var moment=require('moment');var BPromise=require(_0x7914('0x3'));var rp=require(_0x7914('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7914('0x5'));var config=require(_0x7914('0x6'));var attributes=require(_0x7914('0x7'));module['exports']=function(_0x34c372,_0x4dd321){return _0x34c372[_0x7914('0x8')]('ZendeskField',attributes,{'tableName':_0x7914('0x9'),'paranoid':![],'indexes':[{'name':_0x7914('0xa'),'fields':[_0x7914('0xb'),_0x7914('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index cdfe006..922a4e4 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 _0xc4fe=['client','http','request','then','ZendeskField,\x20%s,\x20%s','debug','ZendeskField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x5bbcc9,_0xe326f){var _0x518d94=function(_0x653ea3){while(--_0x653ea3){_0x5bbcc9['push'](_0x5bbcc9['shift']());}};_0x518d94(++_0xe326f);}(_0xc4fe,0x176));var _0xec4f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc4fe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xec4f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xec4f('0x1'));var rs=require(_0xec4f('0x2'));var fs=require('fs');var Redis=require(_0xec4f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xec4f('0x4'));var logger=require('../../config/logger')(_0xec4f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xec4f('0x6')][_0xec4f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x212a8d,_0xbb37e0,_0x1bcf1b){return new BPromise(function(_0x396d97,_0x26d321){return client[_0xec4f('0x8')](_0x212a8d,_0x1bcf1b)[_0xec4f('0x9')](function(_0x369848){logger['info'](_0xec4f('0xa'),_0xbb37e0,'request\x20sent');logger[_0xec4f('0xb')](_0xec4f('0xc'),_0xbb37e0,_0xec4f('0xd'),JSON[_0xec4f('0xe')](_0x369848));if(_0x369848[_0xec4f('0xf')]){if(_0x369848['error'][_0xec4f('0x10')]===0x1f4){logger['error'](_0xec4f('0xa'),_0xbb37e0,_0x369848[_0xec4f('0xf')][_0xec4f('0x11')]);return _0x26d321(_0x369848['error'][_0xec4f('0x11')]);}logger[_0xec4f('0xf')](_0xec4f('0xa'),_0xbb37e0,_0x369848[_0xec4f('0xf')][_0xec4f('0x11')]);return _0x396d97(_0x369848[_0xec4f('0xf')][_0xec4f('0x11')]);}else{logger['info'](_0xec4f('0xa'),_0xbb37e0,_0xec4f('0xd'));_0x396d97(_0x369848[_0xec4f('0x12')][_0xec4f('0x11')]);}})[_0xec4f('0x13')](function(_0x1b3f86){logger[_0xec4f('0xf')](_0xec4f('0xa'),_0xbb37e0,_0x1b3f86);_0x26d321(_0x1b3f86);});});} \ No newline at end of file +var _0xe379=['catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','request\x20sent','debug','stringify','error','message','ZendeskField,\x20%s,\x20%s','result'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe379,0x13c));var _0x9e37=function(_0xe3c8c4,_0x2b687f){_0xe3c8c4=_0xe3c8c4-0x0;var _0x1240e5=_0xe379[_0xe3c8c4];return _0x1240e5;};'use strict';var _=require('lodash');var util=require(_0x9e37('0x0'));var moment=require('moment');var BPromise=require(_0x9e37('0x1'));var rs=require(_0x9e37('0x2'));var fs=require('fs');var Redis=require(_0x9e37('0x3'));var db=require(_0x9e37('0x4'))['db'];var utils=require(_0x9e37('0x5'));var logger=require(_0x9e37('0x6'))('rpc');var config=require(_0x9e37('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x9e37('0x8')][_0x9e37('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x210b69,_0x32f5db,_0x3c9307){return new BPromise(function(_0x3ba1c2,_0x47cc22){return client[_0x9e37('0xa')](_0x210b69,_0x3c9307)[_0x9e37('0xb')](function(_0x3809ec){logger[_0x9e37('0xc')]('ZendeskField,\x20%s,\x20%s',_0x32f5db,_0x9e37('0xd'));logger[_0x9e37('0xe')]('ZendeskField,\x20%s,\x20%s,\x20%s',_0x32f5db,_0x9e37('0xd'),JSON[_0x9e37('0xf')](_0x3809ec));if(_0x3809ec['error']){if(_0x3809ec[_0x9e37('0x10')]['code']===0x1f4){logger[_0x9e37('0x10')]('ZendeskField,\x20%s,\x20%s',_0x32f5db,_0x3809ec[_0x9e37('0x10')][_0x9e37('0x11')]);return _0x47cc22(_0x3809ec[_0x9e37('0x10')]['message']);}logger['error'](_0x9e37('0x12'),_0x32f5db,_0x3809ec[_0x9e37('0x10')][_0x9e37('0x11')]);return _0x3ba1c2(_0x3809ec['error'][_0x9e37('0x11')]);}else{logger[_0x9e37('0xc')]('ZendeskField,\x20%s,\x20%s',_0x32f5db,'request\x20sent');_0x3ba1c2(_0x3809ec[_0x9e37('0x13')]['message']);}})[_0x9e37('0x14')](function(_0x43c64a){logger[_0x9e37('0x10')](_0x9e37('0x12'),_0x32f5db,_0x43c64a);_0x47cc22(_0x43c64a);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index bcaf327..40b93ce 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 _0x4639=['/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','getConfigurations'];(function(_0x5ea96f,_0x4735a7){var _0x5017f6=function(_0x54881a){while(--_0x54881a){_0x5ea96f['push'](_0x5ea96f['shift']());}};_0x5017f6(++_0x4735a7);}(_0x4639,0x1aa));var _0x9463=function(_0x1abbf4,_0x2f199d){_0x1abbf4=_0x1abbf4-0x0;var _0x4c28d9=_0x4639[_0x1abbf4];return _0x4c28d9;};'use strict';var multer=require(_0x9463('0x0'));var util=require(_0x9463('0x1'));var path=require(_0x9463('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x9463('0x3')]();var auth=require(_0x9463('0x4'));var interaction=require(_0x9463('0x5'));var config=require(_0x9463('0x6'));var controller=require('./intZohoAccount.controller');router[_0x9463('0x7')]('/',auth[_0x9463('0x8')](),controller['index']);router[_0x9463('0x7')](_0x9463('0x9'),auth[_0x9463('0x8')](),controller['show']);router[_0x9463('0x7')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x9463('0xa')]);router['get'](_0x9463('0xb'),auth['isAuthenticated'](),controller[_0x9463('0xc')]);router[_0x9463('0xd')]('/',auth[_0x9463('0x8')](),controller[_0x9463('0xe')]);router[_0x9463('0xd')](_0x9463('0xf'),auth[_0x9463('0x8')](),controller[_0x9463('0x10')]);router[_0x9463('0x11')](_0x9463('0x9'),auth['isAuthenticated'](),controller[_0x9463('0x12')]);router['delete'](_0x9463('0x9'),auth[_0x9463('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x71e0=['connect-timeout','express','../../components/interaction/service','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','post','create','addConfiguration','put','delete','destroy','multer','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x71e0,0x19f));var _0x071e=function(_0x1252dc,_0x5e2e8b){_0x1252dc=_0x1252dc-0x0;var _0x3c2b26=_0x71e0[_0x1252dc];return _0x3c2b26;};'use strict';var multer=require(_0x071e('0x0'));var util=require(_0x071e('0x1'));var path=require(_0x071e('0x2'));var timeout=require(_0x071e('0x3'));var express=require(_0x071e('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x071e('0x5'));var config=require('../../config/environment');var controller=require('./intZohoAccount.controller');router[_0x071e('0x6')]('/',auth[_0x071e('0x7')](),controller[_0x071e('0x8')]);router[_0x071e('0x6')](_0x071e('0x9'),auth[_0x071e('0x7')](),controller[_0x071e('0xa')]);router['get']('/:id/configurations',auth[_0x071e('0x7')](),controller[_0x071e('0xb')]);router[_0x071e('0x6')](_0x071e('0xc'),auth[_0x071e('0x7')](),controller['getFields']);router[_0x071e('0xd')]('/',auth[_0x071e('0x7')](),controller[_0x071e('0xe')]);router[_0x071e('0xd')]('/:id/configurations',auth[_0x071e('0x7')](),controller[_0x071e('0xf')]);router[_0x071e('0x10')](_0x071e('0x9'),auth[_0x071e('0x7')](),controller['update']);router[_0x071e('0x11')](_0x071e('0x9'),auth[_0x071e('0x7')](),controller[_0x071e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index 7522872..4c20651 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 _0xac95=['sequelize','exports','STRING'];(function(_0xf88d06,_0x3dae7f){var _0xf4659a=function(_0x4c3e1c){while(--_0x4c3e1c){_0xf88d06['push'](_0xf88d06['shift']());}};_0xf4659a(++_0x3dae7f);}(_0xac95,0xa8));var _0x5ac9=function(_0x48e3f0,_0x3d3464){_0x48e3f0=_0x48e3f0-0x0;var _0x143ad2=_0xac95[_0x48e3f0];return _0x143ad2;};'use strict';var Sequelize=require(_0x5ac9('0x0'));module[_0x5ac9('0x1')]={'name':{'type':Sequelize[_0x5ac9('0x2')]},'description':{'type':Sequelize[_0x5ac9('0x2')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize[_0x5ac9('0x2')]},'clientSecret':{'type':Sequelize[_0x5ac9('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0x5ac9('0x2')]},'refreshToken':{'type':Sequelize[_0x5ac9('0x2')]}}; \ No newline at end of file +var _0xb2af=['STRING','exports'];(function(_0xd81b5b,_0x15f6a7){var _0x52ffd9=function(_0x5571ea){while(--_0x5571ea){_0xd81b5b['push'](_0xd81b5b['shift']());}};_0x52ffd9(++_0x15f6a7);}(_0xb2af,0x15f));var _0xfb2a=function(_0xe8c0c5,_0x104d6a){_0xe8c0c5=_0xe8c0c5-0x0;var _0x5c5e6b=_0xb2af[_0xe8c0c5];return _0x5c5e6b;};'use strict';var Sequelize=require('sequelize');module[_0xfb2a('0x0')]={'name':{'type':Sequelize[_0xfb2a('0x1')]},'description':{'type':Sequelize[_0xfb2a('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xfb2a('0x1')]},'clientId':{'type':Sequelize[_0xfb2a('0x1')]},'clientSecret':{'type':Sequelize[_0xfb2a('0x1')]},'serverUrl':{'type':Sequelize[_0xfb2a('0x1')]},'code':{'type':Sequelize['STRING']},'refreshToken':{'type':Sequelize[_0xfb2a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 759fd36..7cfc0b1 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 _0x0048=['com','serverUrl','slice','substring','lastIndexOf','GET','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Duration','Call_Result','Call_Start_Time','remove','includes','api_name','system_mandatory','push','display_label','custom_field','data_type','picklist','pick_list_values','statusCode','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','jsforce','desk.js','to-csv','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','offset','set','Content-Range','apply','reject','save','destroy','stack','name','index','ZohoAccount','key','model','map','query','filters','intersection','attributes','fields','limit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','keys','length','find','create','body','params','getConfigurations','findOne','ZohoConfiguration','rawAttributes','nolimit','AccountId','Subjects','getSubjects','channel','getDescriptions','ZohoField','Descriptions','zone','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','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zoho.eu'];(function(_0x3f0b30,_0x159bc8){var _0x2748a5=function(_0x3b42cc){while(--_0x3b42cc){_0x3f0b30['push'](_0x3f0b30['shift']());}};_0x2748a5(++_0x159bc8);}(_0x0048,0x129));var _0x8004=function(_0x188360,_0x3d93f8){_0x188360=_0x188360-0x0;var _0x1fbe6d=_0x0048[_0x188360];return _0x1fbe6d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8004('0x0'));var rimraf=require(_0x8004('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8004('0x2'));var rp=require(_0x8004('0x3'));var moment=require('moment');var BPromise=require(_0x8004('0x4'));var Mustache=require(_0x8004('0x5'));var util=require(_0x8004('0x6'));var path=require(_0x8004('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8004('0x8'));var fs=require('fs');var _=require(_0x8004('0x9'));var squel=require(_0x8004('0xa'));var crypto=require('crypto');var jsforce=require(_0x8004('0xb'));var deskjs=require(_0x8004('0xc'));var toCsv=require(_0x8004('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8004('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8004('0xf'));var logger=require(_0x8004('0x10'))('api');var utils=require('../../config/utils');var config=require(_0x8004('0x11'));var db=require(_0x8004('0x12'))['db'];var integrations=require(_0x8004('0x13'));var jayson=require(_0x8004('0x14'));var client=jayson[_0x8004('0x15')][_0x8004('0x16')]({'port':0x232a});function checkPasswordPattern(_0x39a752,_0x5d9972,_0x26dde8){if(_0x26dde8){var _0x3bb941=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bb941[_0x8004('0x17')](_0x5d9972)){return _0x39a752;}else{throw new db[(_0x8004('0x18'))][(_0x8004('0x19'))](_0x8004('0x1a'));}}else{return _0x39a752;}}function respondWithRpcPromise(_0x2b63fc,_0x65f71e,_0x20f2f0,_0x3cebc4){return new BPromise(function(_0x409e50,_0x3c2759){var _0x122265=_0x3cebc4||client;return _0x122265[_0x8004('0x1b')](_0x2b63fc,_0x20f2f0)[_0x8004('0x1c')](function(_0x3f3b43){logger[_0x8004('0x1d')](_0x8004('0x1e'),_0x65f71e,_0x8004('0x1f'));logger['debug'](_0x8004('0x20'),_0x65f71e,_0x8004('0x1f'),JSON['stringify'](_0x3f3b43));if(_0x3f3b43[_0x8004('0x21')]){if(_0x3f3b43[_0x8004('0x21')][_0x8004('0x22')]===0x1f4){logger[_0x8004('0x21')](_0x8004('0x1e'),_0x65f71e,_0x3f3b43[_0x8004('0x21')][_0x8004('0x23')]);return _0x3c2759(_0x3f3b43[_0x8004('0x21')][_0x8004('0x23')]);}logger[_0x8004('0x21')]('ZohoAccount,\x20%s,\x20%s',_0x65f71e,_0x3f3b43['error']['message']);return _0x409e50(_0x3f3b43[_0x8004('0x21')][_0x8004('0x23')]);}else{logger['info'](_0x8004('0x1e'),_0x65f71e,_0x8004('0x1f'));_0x409e50(_0x3f3b43[_0x8004('0x24')][_0x8004('0x23')]);}})[_0x8004('0x25')](function(_0x2d3313){logger['error'](_0x8004('0x1e'),_0x65f71e,_0x2d3313);_0x3c2759(_0x2d3313);});});}function respondWithStatusCode(_0x43b3d6,_0x599dfd){_0x599dfd=_0x599dfd||0xcc;return function(_0x3bddfc){if(_0x3bddfc){return _0x43b3d6[_0x8004('0x26')](_0x599dfd);}return _0x43b3d6[_0x8004('0x27')](_0x599dfd)[_0x8004('0x28')]();};}function respondWithResult(_0x5dc5d4,_0x5271d3){_0x5271d3=_0x5271d3||0xc8;return function(_0x431515){if(_0x431515){return _0x5dc5d4[_0x8004('0x27')](_0x5271d3)['json'](_0x431515);}};}function respondWithFilteredResult(_0x278b8c,_0x22824e){return function(_0x3be2f9){if(_0x3be2f9){var _0x2afc36=_0x3be2f9['count'],_0x78d1d2=_0x22824e[_0x8004('0x29')],_0x5d24f8=_0x22824e['offset']+_0x22824e['limit'],_0x27902e;if(_0x5d24f8>=_0x2afc36){_0x5d24f8=_0x2afc36;_0x27902e=0xc8;}else{_0x27902e=0xce;}_0x278b8c['status'](_0x27902e);return _0x278b8c[_0x8004('0x2a')](_0x8004('0x2b'),_0x78d1d2+'-'+_0x5d24f8+'/'+_0x2afc36)['json'](_0x3be2f9);}return null;};}function patchUpdates(_0xc47b5){return function(_0xd3f82e){try{jsonpatch[_0x8004('0x2c')](_0xd3f82e,_0xc47b5,!![]);}catch(_0x23e73b){return BPromise[_0x8004('0x2d')](_0x23e73b);}return _0xd3f82e[_0x8004('0x2e')]();};}function saveUpdates(_0x2eeb55,_0x3519fb){return function(_0x5546f8){if(_0x5546f8){return _0x5546f8['update'](_0x2eeb55)['then'](function(_0x4859f6){return _0x4859f6;});}return null;};}function removeEntity(_0x378394,_0x37e086){return function(_0x201c26){if(_0x201c26){return _0x201c26[_0x8004('0x2f')]()['then'](function(){_0x378394[_0x8004('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x376276,_0xfc1d1){return function(_0x2dbf14){if(!_0x2dbf14){_0x376276['sendStatus'](0x194);}return _0x2dbf14;};}function handleError(_0x46dc66,_0x10d836){_0x10d836=_0x10d836||0x1f4;return function(_0x3147ed){logger[_0x8004('0x21')](_0x3147ed[_0x8004('0x30')]);if(_0x3147ed[_0x8004('0x31')]){delete _0x3147ed[_0x8004('0x31')];}_0x46dc66[_0x8004('0x27')](_0x10d836)['send'](_0x3147ed);};}exports[_0x8004('0x32')]=function(_0x2b0568,_0x19c376){var _0x9c012d={},_0x529fb3={},_0x3847b3={'count':0x0,'rows':[]};var _0x10a69a=_['map'](db[_0x8004('0x33')]['rawAttributes'],function(_0xb0c114){return{'name':_0xb0c114['fieldName'],'type':_0xb0c114['type'][_0x8004('0x34')]};});_0x529fb3[_0x8004('0x35')]=_[_0x8004('0x36')](_0x10a69a,_0x8004('0x31'));_0x529fb3[_0x8004('0x37')]=_['keys'](_0x2b0568[_0x8004('0x37')]);_0x529fb3[_0x8004('0x38')]=_[_0x8004('0x39')](_0x529fb3[_0x8004('0x35')],_0x529fb3['query']);_0x9c012d[_0x8004('0x3a')]=_[_0x8004('0x39')](_0x529fb3['model'],qs[_0x8004('0x3b')](_0x2b0568[_0x8004('0x37')][_0x8004('0x3b')]));_0x9c012d['attributes']=_0x9c012d[_0x8004('0x3a')]['length']?_0x9c012d[_0x8004('0x3a')]:_0x529fb3[_0x8004('0x35')];if(!_0x2b0568[_0x8004('0x37')]['hasOwnProperty']('nolimit')){_0x9c012d['limit']=qs['limit'](_0x2b0568[_0x8004('0x37')][_0x8004('0x3c')]);_0x9c012d['offset']=qs[_0x8004('0x29')](_0x2b0568[_0x8004('0x37')]['offset']);}_0x9c012d[_0x8004('0x3d')]=qs[_0x8004('0x3e')](_0x2b0568[_0x8004('0x37')]['sort']);_0x9c012d[_0x8004('0x3f')]=qs['filters'](_[_0x8004('0x40')](_0x2b0568['query'],_0x529fb3[_0x8004('0x38')]));if(_0x2b0568[_0x8004('0x37')]['filter']){_0x9c012d[_0x8004('0x3f')]=_[_0x8004('0x41')](_0x9c012d[_0x8004('0x3f')],{'$or':_['map'](_0x10a69a,function(_0x5e3566){if(_0x5e3566[_0x8004('0x42')]!==_0x8004('0x43')){var _0x11158c={};_0x11158c[_0x5e3566[_0x8004('0x31')]]={'$like':'%'+_0x2b0568['query'][_0x8004('0x44')]+'%'};return _0x11158c;}})});}_0x9c012d=_[_0x8004('0x41')]({},_0x9c012d,_0x2b0568[_0x8004('0x45')]);var _0x33fe37={'where':_0x9c012d[_0x8004('0x3f')]};return db['ZohoAccount']['count'](_0x33fe37)[_0x8004('0x1c')](function(_0x177c49){_0x3847b3[_0x8004('0x46')]=_0x177c49;if(_0x2b0568[_0x8004('0x37')][_0x8004('0x47')]){_0x9c012d[_0x8004('0x48')]=[{'all':!![]}];}return db[_0x8004('0x33')][_0x8004('0x49')](_0x9c012d);})[_0x8004('0x1c')](function(_0x1b39b1){_0x3847b3[_0x8004('0x4a')]=_0x1b39b1;return _0x3847b3;})[_0x8004('0x1c')](respondWithFilteredResult(_0x19c376,_0x9c012d))[_0x8004('0x25')](handleError(_0x19c376,null));};exports['show']=function(_0x164f9d,_0x11dbbe){var _0x3d11c8={'raw':![],'where':{'id':_0x164f9d['params']['id']}},_0x379a4a={};_0x379a4a['model']=_[_0x8004('0x4b')](db[_0x8004('0x33')]['rawAttributes']);_0x379a4a[_0x8004('0x37')]=_[_0x8004('0x4b')](_0x164f9d['query']);_0x379a4a['filters']=_['intersection'](_0x379a4a[_0x8004('0x35')],_0x379a4a[_0x8004('0x37')]);_0x3d11c8[_0x8004('0x3a')]=_[_0x8004('0x39')](_0x379a4a[_0x8004('0x35')],qs[_0x8004('0x3b')](_0x164f9d[_0x8004('0x37')]['fields']));_0x3d11c8[_0x8004('0x3a')]=_0x3d11c8[_0x8004('0x3a')][_0x8004('0x4c')]?_0x3d11c8[_0x8004('0x3a')]:_0x379a4a['model'];if(_0x164f9d[_0x8004('0x37')]['includeAll']){_0x3d11c8['include']=[{'all':!![]}];}_0x3d11c8=_[_0x8004('0x41')]({},_0x3d11c8,_0x164f9d[_0x8004('0x45')]);return db[_0x8004('0x33')][_0x8004('0x4d')](_0x3d11c8)['then'](handleEntityNotFound(_0x11dbbe,null))[_0x8004('0x1c')](respondWithResult(_0x11dbbe,null))['catch'](handleError(_0x11dbbe,null));};exports[_0x8004('0x4e')]=function(_0x46793d,_0x19d68b){return db[_0x8004('0x33')][_0x8004('0x4e')](_0x46793d[_0x8004('0x4f')],{})[_0x8004('0x1c')](respondWithResult(_0x19d68b,0xc9))[_0x8004('0x25')](handleError(_0x19d68b,null));};exports['update']=function(_0x3d5818,_0x238f7c){if(_0x3d5818['body']['id']){delete _0x3d5818['body']['id'];}return db[_0x8004('0x33')][_0x8004('0x4d')]({'where':{'id':_0x3d5818[_0x8004('0x50')]['id']}})[_0x8004('0x1c')](handleEntityNotFound(_0x238f7c,null))[_0x8004('0x1c')](saveUpdates(_0x3d5818[_0x8004('0x4f')],null))[_0x8004('0x1c')](respondWithResult(_0x238f7c,null))['catch'](handleError(_0x238f7c,null));};exports[_0x8004('0x2f')]=function(_0x5c1743,_0x1133cf){return db[_0x8004('0x33')][_0x8004('0x4d')]({'where':{'id':_0x5c1743[_0x8004('0x50')]['id']}})['then'](handleEntityNotFound(_0x1133cf,null))[_0x8004('0x1c')](removeEntity(_0x1133cf,null))[_0x8004('0x25')](handleError(_0x1133cf,null));};exports[_0x8004('0x51')]=function(_0x74211e,_0x41efdf,_0x533dc4){var _0x920417={};var _0x3ab383={};var _0x114ac2;var _0x1eda84;return db[_0x8004('0x33')][_0x8004('0x52')]({'where':{'id':_0x74211e[_0x8004('0x50')]['id']}})[_0x8004('0x1c')](handleEntityNotFound(_0x41efdf,null))[_0x8004('0x1c')](function(_0x562038){if(_0x562038){_0x114ac2=_0x562038;_0x3ab383[_0x8004('0x35')]=_['keys'](db[_0x8004('0x53')][_0x8004('0x54')]);_0x3ab383['query']=_[_0x8004('0x4b')](_0x74211e[_0x8004('0x37')]);_0x3ab383[_0x8004('0x38')]=_[_0x8004('0x39')](_0x3ab383[_0x8004('0x35')],_0x3ab383[_0x8004('0x37')]);_0x920417[_0x8004('0x3a')]=_[_0x8004('0x39')](_0x3ab383[_0x8004('0x35')],qs['fields'](_0x74211e[_0x8004('0x37')][_0x8004('0x3b')]));_0x920417['attributes']=_0x920417[_0x8004('0x3a')]['length']?_0x920417[_0x8004('0x3a')]:_0x3ab383[_0x8004('0x35')];_0x920417[_0x8004('0x3d')]=qs['sort'](_0x74211e[_0x8004('0x37')][_0x8004('0x3e')]);_0x920417['where']=qs[_0x8004('0x38')](_[_0x8004('0x40')](_0x74211e[_0x8004('0x37')],_0x3ab383[_0x8004('0x38')]));if(_0x74211e[_0x8004('0x37')][_0x8004('0x44')]){_0x920417['where']=_[_0x8004('0x41')](_0x920417[_0x8004('0x3f')],{'$or':_[_0x8004('0x36')](_0x920417['attributes'],function(_0xabec65){var _0x15eb85={};_0x15eb85[_0xabec65]={'$like':'%'+_0x74211e['query'][_0x8004('0x44')]+'%'};return _0x15eb85;})});}_0x920417=_[_0x8004('0x41')]({},_0x920417,_0x74211e[_0x8004('0x45')]);return _0x114ac2['getConfigurations'](_0x920417);}})[_0x8004('0x1c')](function(_0x4a2f2c){if(_0x4a2f2c){_0x1eda84=_0x4a2f2c[_0x8004('0x4c')];if(!_0x74211e[_0x8004('0x37')]['hasOwnProperty'](_0x8004('0x55'))){_0x920417[_0x8004('0x3c')]=qs[_0x8004('0x3c')](_0x74211e[_0x8004('0x37')][_0x8004('0x3c')]);_0x920417[_0x8004('0x29')]=qs[_0x8004('0x29')](_0x74211e[_0x8004('0x37')][_0x8004('0x29')]);}return _0x114ac2[_0x8004('0x51')](_0x920417);}})[_0x8004('0x1c')](function(_0x735ab8){if(_0x735ab8){return _0x735ab8?{'count':_0x1eda84,'rows':_0x735ab8}:null;}})[_0x8004('0x1c')](respondWithResult(_0x41efdf,null))['catch'](handleError(_0x41efdf,null));};exports['addConfiguration']=function(_0x327554,_0x4aabb9,_0x4f7b94){if(_0x327554[_0x8004('0x4f')]['id']){delete _0x327554[_0x8004('0x4f')]['id'];}return db[_0x8004('0x33')][_0x8004('0x52')]({'where':{'id':_0x327554[_0x8004('0x50')]['id']}})[_0x8004('0x1c')](handleEntityNotFound(_0x4aabb9,null))[_0x8004('0x1c')](function(_0x14e4b3){if(_0x14e4b3){_0x327554[_0x8004('0x4f')][_0x8004('0x56')]=_0x14e4b3['id'];_0x327554[_0x8004('0x4f')][_0x8004('0x57')]=integrations[_0x8004('0x58')](_0x327554[_0x8004('0x4f')][_0x8004('0x59')],_0x327554[_0x8004('0x4f')][_0x8004('0x42')]);_0x327554[_0x8004('0x4f')]['Descriptions']=integrations[_0x8004('0x5a')](_0x327554[_0x8004('0x4f')][_0x8004('0x59')],_0x327554['body'][_0x8004('0x42')]);return db[_0x8004('0x53')][_0x8004('0x4e')](_0x327554[_0x8004('0x4f')],{'include':[{'model':db[_0x8004('0x5b')],'as':'Subjects'},{'model':db['ZohoField'],'as':_0x8004('0x5c')}]});}return null;})[_0x8004('0x1c')](respondWithResult(_0x4aabb9,null))[_0x8004('0x25')](handleError(_0x4aabb9,null));};function getAccessToken(_0x43b1b2){return new Promise(function(_0x55d158,_0x5f4e73){var _0x1bba0b;switch(_0x43b1b2[_0x8004('0x5d')]){case'US':_0x1bba0b=_0x8004('0x5e');break;case'AU':_0x1bba0b=_0x8004('0x5f');break;case'EU':_0x1bba0b=_0x8004('0x60');break;case'IN':_0x1bba0b=_0x8004('0x61');break;case'CN':_0x1bba0b=_0x8004('0x62');break;default:_0x1bba0b=_0x8004('0x60');break;}var _0x503f8e={'method':'POST','uri':_0x1bba0b+_0x8004('0x63'),'qs':{'refresh_token':_0x43b1b2[_0x8004('0x64')],'client_id':_0x43b1b2[_0x8004('0x65')],'client_secret':_0x43b1b2[_0x8004('0x66')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x503f8e)[_0x8004('0x1c')](function(_0x34bc38){if(_0x34bc38[_0x8004('0x67')]){_0x55d158(_0x34bc38['access_token']);}else{_0x5f4e73(_0x8004('0x68'));}})['catch'](function(_0x196703){_0x5f4e73(_0x196703);});});}exports[_0x8004('0x69')]=function(_0x103fa7,_0x534f90,_0x177e55){var _0x3e101b,_0x1e844c,_0x47be8a,_0x1b496c,_0xc84e3;return db['ZohoAccount']['findOne']({'where':{'id':_0x103fa7[_0x8004('0x50')]['id']},'attributes':['id',_0x8004('0x6a'),_0x8004('0x5d'),_0x8004('0x65'),_0x8004('0x66'),'serverUrl',_0x8004('0x22'),_0x8004('0x64')]})[_0x8004('0x1c')](handleEntityNotFound(_0x534f90,null))[_0x8004('0x1c')](function(_0x2e9873){_0xc84e3=_0x2e9873;_0x3e101b=_0xc84e3[_0x8004('0x6a')];_0x1e844c=_0x3e101b===_0x8004('0x6b')?'eu':_0x8004('0x6c');_0x47be8a=_0xc84e3[_0x8004('0x6d')];var _0x4a557f=_0x47be8a[_0x8004('0x6e')](-0x1);if(_0x4a557f==='/'||_0x4a557f==='\x5c'||_0x4a557f===':'){_0x47be8a=_0x47be8a[_0x8004('0x6f')](0x0,_0x47be8a[_0x8004('0x70')](_0x4a557f));}if(!_0xc84e3[_0x8004('0x64')]){throw new Error('Refresh\x20Token\x20not\x20available\x20for\x20the\x20account');}return getAccessToken(_0xc84e3);})[_0x8004('0x1c')](function(_0x3d3154){if(_0x3d3154){return rp({'method':_0x8004('0x71'),'uri':util['format'](_0x8004('0x72'),_0x1e844c),'qs':{'module':_0x8004('0x73')},'headers':{'Authorization':_0x8004('0x74')+_0x3d3154},'json':!![]});}})['then'](function(_0x4eb79c){if(_0x4eb79c){if(_0x4eb79c['response']&&_0x4eb79c[_0x8004('0x75')][_0x8004('0x21')]){throw new Error(_0x4eb79c[_0x8004('0x75')][_0x8004('0x21')][_0x8004('0x23')]);}var _0x2b51b3=[];var _0x361090=[];var _0x32d020=[_0x8004('0x76'),'Subject',_0x8004('0x77'),_0x8004('0x78'),_0x8004('0x79'),_0x8004('0x7a'),_0x8004('0x7b'),'Call_Type'];_0x361090=_[_0x8004('0x7c')](_0x4eb79c[_0x8004('0x3b')],function(_0x5dbcd5){return _0x32d020[_0x8004('0x7d')](_0x5dbcd5[_0x8004('0x7e')]);});for(var _0x151937=0x0;_0x151937<_0x361090[_0x8004('0x4c')];_0x151937++){if(_0x361090[_0x151937][_0x8004('0x7f')]===![]){_0x2b51b3[_0x8004('0x80')]({'id':_0x361090[_0x151937]['id'],'name':_0x361090[_0x151937][_0x8004('0x81')],'custom':_0x361090[_0x151937][_0x8004('0x82')],'options':_0x361090[_0x151937][_0x8004('0x83')]===_0x8004('0x84')&&_0x361090[_0x151937][_0x8004('0x85')][_0x8004('0x4c')]>-0x1?_[_0x8004('0x36')](_0x361090[_0x151937][_0x8004('0x85')],function(_0x65d784){return{'name':_0x65d784,'value':_0x65d784};}):[]});}}return{'count':_0x2b51b3[_0x8004('0x4c')],'rows':_0x2b51b3};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x534f90,null))[_0x8004('0x25')](function(_0x49f009){var _0x2f5325=_0x103fa7['query'][_0x8004('0x17')]?0x1f4:_0x49f009[_0x8004('0x86')]||0x1f4;logger[_0x8004('0x21')]('getFields,\x20%s,\x20%s,\x20%s',_0x8004('0x69'),_0x2f5325,JSON['stringify'](_0x49f009));delete _0x49f009['name'];if(_0x2f5325===0x191){_0x2f5325=0x190;}_0x534f90[_0x8004('0x27')](_0x2f5325)['send'](_0x103fa7[_0x8004('0x37')][_0x8004('0x17')]?{'message':'Wrong\x20credentials','statusCode':_0x49f009[_0x8004('0x86')]}:_0x49f009);});}; \ No newline at end of file +var _0x83e3=['includeAll','include','findAll','rows','show','params','keys','rawAttributes','intersection','find','create','body','ZohoConfiguration','pick','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','slice','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','Owner','Subject','Description','WhoId','Call_Duration','Call_Result','Call_Type','remove','api_name','system_mandatory','push','display_label','data_type','picklist','pick_list_values','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','stringify','error','ZohoAccount,\x20%s,\x20%s','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','stack','name','send','map','ZohoAccount','type','key','model','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count'];(function(_0x338d22,_0x1cc2ca){var _0x411eb3=function(_0x2aa47e){while(--_0x2aa47e){_0x338d22['push'](_0x338d22['shift']());}};_0x411eb3(++_0x1cc2ca);}(_0x83e3,0xc1));var _0x383e=function(_0x2eae58,_0xcbdb76){_0x2eae58=_0x2eae58-0x0;var _0x41965f=_0x83e3[_0x2eae58];return _0x41965f;};'use strict';var pdf=require(_0x383e('0x0'));var emlformat=require(_0x383e('0x1'));var rimraf=require(_0x383e('0x2'));var zipdir=require(_0x383e('0x3'));var jsonpatch=require(_0x383e('0x4'));var rp=require(_0x383e('0x5'));var moment=require(_0x383e('0x6'));var BPromise=require(_0x383e('0x7'));var Mustache=require(_0x383e('0x8'));var util=require(_0x383e('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x383e('0xa'));var ejs=require(_0x383e('0xb'));var fs=require('fs');var _=require(_0x383e('0xc'));var squel=require(_0x383e('0xd'));var crypto=require('crypto');var jsforce=require(_0x383e('0xe'));var deskjs=require(_0x383e('0xf'));var toCsv=require(_0x383e('0xa'));var querystring=require('querystring');var Papa=require(_0x383e('0x10'));var Redis=require(_0x383e('0x11'));var authService=require(_0x383e('0x12'));var qs=require(_0x383e('0x13'));var as=require(_0x383e('0x14'));var hardwareService=require(_0x383e('0x15'));var logger=require(_0x383e('0x16'))(_0x383e('0x17'));var utils=require('../../config/utils');var config=require(_0x383e('0x18'));var db=require(_0x383e('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x383e('0x1a'));var client=jayson['client'][_0x383e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3faf7c,_0x2a4a7d,_0x87c413){if(_0x87c413){var _0x3eaf4d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3eaf4d[_0x383e('0x1c')](_0x2a4a7d)){return _0x3faf7c;}else{throw new db[(_0x383e('0x1d'))]['ValidationError'](_0x383e('0x1e'));}}else{return _0x3faf7c;}}function respondWithRpcPromise(_0x93f2ff,_0x5b336e,_0x1b707e,_0xaf3351){return new BPromise(function(_0x3993d6,_0x8f39a){var _0x161259=_0xaf3351||client;return _0x161259[_0x383e('0x1f')](_0x93f2ff,_0x1b707e)[_0x383e('0x20')](function(_0x17a995){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x5b336e,_0x383e('0x21'));logger[_0x383e('0x22')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x5b336e,_0x383e('0x21'),JSON[_0x383e('0x23')](_0x17a995));if(_0x17a995[_0x383e('0x24')]){if(_0x17a995['error']['code']===0x1f4){logger[_0x383e('0x24')](_0x383e('0x25'),_0x5b336e,_0x17a995['error'][_0x383e('0x26')]);return _0x8f39a(_0x17a995['error'][_0x383e('0x26')]);}logger[_0x383e('0x24')](_0x383e('0x25'),_0x5b336e,_0x17a995['error']['message']);return _0x3993d6(_0x17a995[_0x383e('0x24')]['message']);}else{logger['info'](_0x383e('0x25'),_0x5b336e,_0x383e('0x21'));_0x3993d6(_0x17a995['result'][_0x383e('0x26')]);}})[_0x383e('0x27')](function(_0x2b6390){logger[_0x383e('0x24')]('ZohoAccount,\x20%s,\x20%s',_0x5b336e,_0x2b6390);_0x8f39a(_0x2b6390);});});}function respondWithStatusCode(_0x119ed9,_0x4acf35){_0x4acf35=_0x4acf35||0xcc;return function(_0x2e55d0){if(_0x2e55d0){return _0x119ed9[_0x383e('0x28')](_0x4acf35);}return _0x119ed9[_0x383e('0x29')](_0x4acf35)[_0x383e('0x2a')]();};}function respondWithResult(_0x2ec4a9,_0xfdb01c){_0xfdb01c=_0xfdb01c||0xc8;return function(_0x457fd9){if(_0x457fd9){return _0x2ec4a9[_0x383e('0x29')](_0xfdb01c)[_0x383e('0x2b')](_0x457fd9);}};}function respondWithFilteredResult(_0x53b906,_0x3bba31){return function(_0xbcfa21){if(_0xbcfa21){var _0x1d6801=_0xbcfa21['count'],_0x5902bf=_0x3bba31[_0x383e('0x2c')],_0x44999c=_0x3bba31[_0x383e('0x2c')]+_0x3bba31[_0x383e('0x2d')],_0x51f788;if(_0x44999c>=_0x1d6801){_0x44999c=_0x1d6801;_0x51f788=0xc8;}else{_0x51f788=0xce;}_0x53b906['status'](_0x51f788);return _0x53b906['set'](_0x383e('0x2e'),_0x5902bf+'-'+_0x44999c+'/'+_0x1d6801)[_0x383e('0x2b')](_0xbcfa21);}return null;};}function patchUpdates(_0x508814){return function(_0xc7bfbb){try{jsonpatch[_0x383e('0x2f')](_0xc7bfbb,_0x508814,!![]);}catch(_0x515fae){return BPromise['reject'](_0x515fae);}return _0xc7bfbb[_0x383e('0x30')]();};}function saveUpdates(_0x3bb731,_0x2cbacd){return function(_0x2cc79c){if(_0x2cc79c){return _0x2cc79c[_0x383e('0x31')](_0x3bb731)[_0x383e('0x20')](function(_0x3706a5){return _0x3706a5;});}return null;};}function removeEntity(_0x3b8ad1,_0x708594){return function(_0x4f34f2){if(_0x4f34f2){return _0x4f34f2[_0x383e('0x32')]()[_0x383e('0x20')](function(){_0x3b8ad1[_0x383e('0x29')](0xcc)[_0x383e('0x2a')]();});}};}function handleEntityNotFound(_0x575d8f,_0x3a1fd4){return function(_0x2f634c){if(!_0x2f634c){_0x575d8f[_0x383e('0x28')](0x194);}return _0x2f634c;};}function handleError(_0x24a03b,_0x58bbde){_0x58bbde=_0x58bbde||0x1f4;return function(_0x20fd3d){logger[_0x383e('0x24')](_0x20fd3d[_0x383e('0x33')]);if(_0x20fd3d[_0x383e('0x34')]){delete _0x20fd3d[_0x383e('0x34')];}_0x24a03b[_0x383e('0x29')](_0x58bbde)[_0x383e('0x35')](_0x20fd3d);};}exports['index']=function(_0x51bcc2,_0x345fb0){var _0x53c646={},_0x13ca9b={},_0x1f2261={'count':0x0,'rows':[]};var _0x4a9b81=_[_0x383e('0x36')](db[_0x383e('0x37')]['rawAttributes'],function(_0x502a8f){return{'name':_0x502a8f['fieldName'],'type':_0x502a8f[_0x383e('0x38')][_0x383e('0x39')]};});_0x13ca9b[_0x383e('0x3a')]=_[_0x383e('0x36')](_0x4a9b81,_0x383e('0x34'));_0x13ca9b['query']=_['keys'](_0x51bcc2[_0x383e('0x3b')]);_0x13ca9b[_0x383e('0x3c')]=_['intersection'](_0x13ca9b[_0x383e('0x3a')],_0x13ca9b['query']);_0x53c646['attributes']=_['intersection'](_0x13ca9b[_0x383e('0x3a')],qs[_0x383e('0x3d')](_0x51bcc2[_0x383e('0x3b')][_0x383e('0x3d')]));_0x53c646[_0x383e('0x3e')]=_0x53c646[_0x383e('0x3e')][_0x383e('0x3f')]?_0x53c646[_0x383e('0x3e')]:_0x13ca9b[_0x383e('0x3a')];if(!_0x51bcc2[_0x383e('0x3b')][_0x383e('0x40')](_0x383e('0x41'))){_0x53c646[_0x383e('0x2d')]=qs[_0x383e('0x2d')](_0x51bcc2[_0x383e('0x3b')][_0x383e('0x2d')]);_0x53c646[_0x383e('0x2c')]=qs[_0x383e('0x2c')](_0x51bcc2['query'][_0x383e('0x2c')]);}_0x53c646['order']=qs[_0x383e('0x42')](_0x51bcc2[_0x383e('0x3b')]['sort']);_0x53c646[_0x383e('0x43')]=qs['filters'](_['pick'](_0x51bcc2[_0x383e('0x3b')],_0x13ca9b[_0x383e('0x3c')]));if(_0x51bcc2[_0x383e('0x3b')][_0x383e('0x44')]){_0x53c646[_0x383e('0x43')]=_['merge'](_0x53c646[_0x383e('0x43')],{'$or':_[_0x383e('0x36')](_0x4a9b81,function(_0x4e6738){if(_0x4e6738['type']!==_0x383e('0x45')){var _0x4d7cad={};_0x4d7cad[_0x4e6738[_0x383e('0x34')]]={'$like':'%'+_0x51bcc2[_0x383e('0x3b')][_0x383e('0x44')]+'%'};return _0x4d7cad;}})});}_0x53c646=_[_0x383e('0x46')]({},_0x53c646,_0x51bcc2[_0x383e('0x47')]);var _0x5ef6d7={'where':_0x53c646[_0x383e('0x43')]};return db['ZohoAccount'][_0x383e('0x48')](_0x5ef6d7)['then'](function(_0x3ef315){_0x1f2261[_0x383e('0x48')]=_0x3ef315;if(_0x51bcc2['query'][_0x383e('0x49')]){_0x53c646[_0x383e('0x4a')]=[{'all':!![]}];}return db[_0x383e('0x37')][_0x383e('0x4b')](_0x53c646);})[_0x383e('0x20')](function(_0x255a6f){_0x1f2261[_0x383e('0x4c')]=_0x255a6f;return _0x1f2261;})['then'](respondWithFilteredResult(_0x345fb0,_0x53c646))[_0x383e('0x27')](handleError(_0x345fb0,null));};exports[_0x383e('0x4d')]=function(_0x1cb120,_0x1f7a22){var _0x212cfd={'raw':![],'where':{'id':_0x1cb120[_0x383e('0x4e')]['id']}},_0x43d591={};_0x43d591[_0x383e('0x3a')]=_[_0x383e('0x4f')](db[_0x383e('0x37')][_0x383e('0x50')]);_0x43d591[_0x383e('0x3b')]=_[_0x383e('0x4f')](_0x1cb120[_0x383e('0x3b')]);_0x43d591[_0x383e('0x3c')]=_[_0x383e('0x51')](_0x43d591[_0x383e('0x3a')],_0x43d591[_0x383e('0x3b')]);_0x212cfd[_0x383e('0x3e')]=_[_0x383e('0x51')](_0x43d591[_0x383e('0x3a')],qs[_0x383e('0x3d')](_0x1cb120[_0x383e('0x3b')][_0x383e('0x3d')]));_0x212cfd[_0x383e('0x3e')]=_0x212cfd[_0x383e('0x3e')][_0x383e('0x3f')]?_0x212cfd['attributes']:_0x43d591[_0x383e('0x3a')];if(_0x1cb120[_0x383e('0x3b')]['includeAll']){_0x212cfd['include']=[{'all':!![]}];}_0x212cfd=_[_0x383e('0x46')]({},_0x212cfd,_0x1cb120[_0x383e('0x47')]);return db[_0x383e('0x37')][_0x383e('0x52')](_0x212cfd)[_0x383e('0x20')](handleEntityNotFound(_0x1f7a22,null))['then'](respondWithResult(_0x1f7a22,null))[_0x383e('0x27')](handleError(_0x1f7a22,null));};exports[_0x383e('0x53')]=function(_0x1ea8ce,_0x596d7d){return db[_0x383e('0x37')][_0x383e('0x53')](_0x1ea8ce[_0x383e('0x54')],{})[_0x383e('0x20')](respondWithResult(_0x596d7d,0xc9))['catch'](handleError(_0x596d7d,null));};exports['update']=function(_0x133845,_0x3ce7b3){if(_0x133845['body']['id']){delete _0x133845[_0x383e('0x54')]['id'];}return db[_0x383e('0x37')]['find']({'where':{'id':_0x133845['params']['id']}})[_0x383e('0x20')](handleEntityNotFound(_0x3ce7b3,null))[_0x383e('0x20')](saveUpdates(_0x133845['body'],null))[_0x383e('0x20')](respondWithResult(_0x3ce7b3,null))['catch'](handleError(_0x3ce7b3,null));};exports[_0x383e('0x32')]=function(_0x4b67ba,_0x56a8b7){return db[_0x383e('0x37')][_0x383e('0x52')]({'where':{'id':_0x4b67ba['params']['id']}})[_0x383e('0x20')](handleEntityNotFound(_0x56a8b7,null))['then'](removeEntity(_0x56a8b7,null))[_0x383e('0x27')](handleError(_0x56a8b7,null));};exports['getConfigurations']=function(_0x4471cf,_0x63f0e3,_0x1f3d7d){var _0x5af5a1={};var _0x4455a4={};var _0x2063cc;var _0x53faad;return db[_0x383e('0x37')]['findOne']({'where':{'id':_0x4471cf[_0x383e('0x4e')]['id']}})['then'](handleEntityNotFound(_0x63f0e3,null))['then'](function(_0x3a68a7){if(_0x3a68a7){_0x2063cc=_0x3a68a7;_0x4455a4['model']=_[_0x383e('0x4f')](db[_0x383e('0x55')]['rawAttributes']);_0x4455a4[_0x383e('0x3b')]=_[_0x383e('0x4f')](_0x4471cf[_0x383e('0x3b')]);_0x4455a4[_0x383e('0x3c')]=_[_0x383e('0x51')](_0x4455a4[_0x383e('0x3a')],_0x4455a4[_0x383e('0x3b')]);_0x5af5a1[_0x383e('0x3e')]=_[_0x383e('0x51')](_0x4455a4[_0x383e('0x3a')],qs[_0x383e('0x3d')](_0x4471cf[_0x383e('0x3b')][_0x383e('0x3d')]));_0x5af5a1[_0x383e('0x3e')]=_0x5af5a1[_0x383e('0x3e')][_0x383e('0x3f')]?_0x5af5a1[_0x383e('0x3e')]:_0x4455a4[_0x383e('0x3a')];_0x5af5a1['order']=qs[_0x383e('0x42')](_0x4471cf[_0x383e('0x3b')]['sort']);_0x5af5a1[_0x383e('0x43')]=qs[_0x383e('0x3c')](_[_0x383e('0x56')](_0x4471cf[_0x383e('0x3b')],_0x4455a4[_0x383e('0x3c')]));if(_0x4471cf[_0x383e('0x3b')][_0x383e('0x44')]){_0x5af5a1['where']=_[_0x383e('0x46')](_0x5af5a1['where'],{'$or':_['map'](_0x5af5a1[_0x383e('0x3e')],function(_0x67039e){var _0x15b16e={};_0x15b16e[_0x67039e]={'$like':'%'+_0x4471cf['query'][_0x383e('0x44')]+'%'};return _0x15b16e;})});}_0x5af5a1=_['merge']({},_0x5af5a1,_0x4471cf[_0x383e('0x47')]);return _0x2063cc[_0x383e('0x57')](_0x5af5a1);}})[_0x383e('0x20')](function(_0x277e77){if(_0x277e77){_0x53faad=_0x277e77[_0x383e('0x3f')];if(!_0x4471cf[_0x383e('0x3b')][_0x383e('0x40')](_0x383e('0x41'))){_0x5af5a1[_0x383e('0x2d')]=qs[_0x383e('0x2d')](_0x4471cf[_0x383e('0x3b')]['limit']);_0x5af5a1[_0x383e('0x2c')]=qs[_0x383e('0x2c')](_0x4471cf[_0x383e('0x3b')][_0x383e('0x2c')]);}return _0x2063cc['getConfigurations'](_0x5af5a1);}})['then'](function(_0xcf4f7b){if(_0xcf4f7b){return _0xcf4f7b?{'count':_0x53faad,'rows':_0xcf4f7b}:null;}})[_0x383e('0x20')](respondWithResult(_0x63f0e3,null))[_0x383e('0x27')](handleError(_0x63f0e3,null));};exports['addConfiguration']=function(_0x2afccd,_0x52e741,_0x1e3ae7){if(_0x2afccd[_0x383e('0x54')]['id']){delete _0x2afccd[_0x383e('0x54')]['id'];}return db['ZohoAccount']['findOne']({'where':{'id':_0x2afccd[_0x383e('0x4e')]['id']}})[_0x383e('0x20')](handleEntityNotFound(_0x52e741,null))[_0x383e('0x20')](function(_0x337663){if(_0x337663){_0x2afccd['body'][_0x383e('0x58')]=_0x337663['id'];_0x2afccd[_0x383e('0x54')][_0x383e('0x59')]=integrations[_0x383e('0x5a')](_0x2afccd[_0x383e('0x54')][_0x383e('0x5b')],_0x2afccd[_0x383e('0x54')][_0x383e('0x38')]);_0x2afccd[_0x383e('0x54')][_0x383e('0x5c')]=integrations[_0x383e('0x5d')](_0x2afccd[_0x383e('0x54')][_0x383e('0x5b')],_0x2afccd[_0x383e('0x54')]['type']);return db[_0x383e('0x55')][_0x383e('0x53')](_0x2afccd[_0x383e('0x54')],{'include':[{'model':db[_0x383e('0x5e')],'as':_0x383e('0x59')},{'model':db[_0x383e('0x5e')],'as':_0x383e('0x5c')}]});}return null;})[_0x383e('0x20')](respondWithResult(_0x52e741,null))[_0x383e('0x27')](handleError(_0x52e741,null));};function getAccessToken(_0x420d0f){return new Promise(function(_0x318b1b,_0x342b0f){var _0x50567f;switch(_0x420d0f[_0x383e('0x5f')]){case'US':_0x50567f=_0x383e('0x60');break;case'AU':_0x50567f=_0x383e('0x61');break;case'EU':_0x50567f=_0x383e('0x62');break;case'IN':_0x50567f='https://accounts.zoho.in';break;case'CN':_0x50567f=_0x383e('0x63');break;default:_0x50567f='https://accounts.zoho.eu';break;}var _0x1eb16c={'method':_0x383e('0x64'),'uri':_0x50567f+_0x383e('0x65'),'qs':{'refresh_token':_0x420d0f[_0x383e('0x66')],'client_id':_0x420d0f[_0x383e('0x67')],'client_secret':_0x420d0f[_0x383e('0x68')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1eb16c)[_0x383e('0x20')](function(_0x4cb2fa){if(_0x4cb2fa['access_token']){_0x318b1b(_0x4cb2fa[_0x383e('0x69')]);}else{_0x342b0f(_0x383e('0x6a'));}})[_0x383e('0x27')](function(_0xe918cb){_0x342b0f(_0xe918cb);});});}exports[_0x383e('0x6b')]=function(_0x222d92,_0x41ac56,_0x1a8cad){var _0x538761,_0x1d4ab8,_0x4a0035,_0x1ea558,_0x82f8bd;return db[_0x383e('0x37')]['findOne']({'where':{'id':_0x222d92['params']['id']},'attributes':['id',_0x383e('0x6c'),'zone',_0x383e('0x67'),_0x383e('0x68'),'serverUrl','code',_0x383e('0x66')]})[_0x383e('0x20')](handleEntityNotFound(_0x41ac56,null))[_0x383e('0x20')](function(_0x19745f){_0x82f8bd=_0x19745f;_0x538761=_0x82f8bd[_0x383e('0x6c')];_0x1d4ab8=_0x538761==='zoho.eu'?'eu':'com';_0x4a0035=_0x82f8bd[_0x383e('0x6d')];var _0x4a4a12=_0x4a0035[_0x383e('0x6e')](-0x1);if(_0x4a4a12==='/'||_0x4a4a12==='\x5c'||_0x4a4a12===':'){_0x4a0035=_0x4a0035['substring'](0x0,_0x4a0035['lastIndexOf'](_0x4a4a12));}if(!_0x82f8bd['refreshToken']){throw new Error(_0x383e('0x6f'));}return getAccessToken(_0x82f8bd);})['then'](function(_0xa40a85){if(_0xa40a85){return rp({'method':_0x383e('0x70'),'uri':util[_0x383e('0x71')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x1d4ab8),'qs':{'module':'Calls'},'headers':{'Authorization':_0x383e('0x72')+_0xa40a85},'json':!![]});}})[_0x383e('0x20')](function(_0x179100){if(_0x179100){if(_0x179100[_0x383e('0x73')]&&_0x179100[_0x383e('0x73')][_0x383e('0x24')]){throw new Error(_0x179100[_0x383e('0x73')]['error']['message']);}var _0xf619d6=[];var _0xd32c86=[];var _0x2f3a50=[_0x383e('0x74'),_0x383e('0x75'),_0x383e('0x76'),_0x383e('0x77'),_0x383e('0x78'),_0x383e('0x79'),'Call_Start_Time',_0x383e('0x7a')];_0xd32c86=_[_0x383e('0x7b')](_0x179100[_0x383e('0x3d')],function(_0x90fcad){return _0x2f3a50['includes'](_0x90fcad[_0x383e('0x7c')]);});for(var _0x334080=0x0;_0x334080<_0xd32c86[_0x383e('0x3f')];_0x334080++){if(_0xd32c86[_0x334080][_0x383e('0x7d')]===![]){_0xf619d6[_0x383e('0x7e')]({'id':_0xd32c86[_0x334080]['id'],'name':_0xd32c86[_0x334080][_0x383e('0x7f')],'custom':_0xd32c86[_0x334080]['custom_field'],'options':_0xd32c86[_0x334080][_0x383e('0x80')]===_0x383e('0x81')&&_0xd32c86[_0x334080][_0x383e('0x82')]['length']>-0x1?_[_0x383e('0x36')](_0xd32c86[_0x334080][_0x383e('0x82')],function(_0xd51967){return{'name':_0xd51967,'value':_0xd51967};}):[]});}}return{'count':_0xf619d6['length'],'rows':_0xf619d6};}else{return{'count':0x0,'rows':[]};}})[_0x383e('0x20')](respondWithResult(_0x41ac56,null))[_0x383e('0x27')](function(_0x1ee478){var _0x40967a=_0x222d92['query'][_0x383e('0x1c')]?0x1f4:_0x1ee478[_0x383e('0x83')]||0x1f4;logger[_0x383e('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x383e('0x6b'),_0x40967a,JSON[_0x383e('0x23')](_0x1ee478));delete _0x1ee478[_0x383e('0x34')];if(_0x40967a===0x191){_0x40967a=0x190;}_0x41ac56[_0x383e('0x29')](_0x40967a)[_0x383e('0x35')](_0x222d92['query']['test']?{'message':_0x383e('0x84'),'statusCode':_0x1ee478[_0x383e('0x83')]}:_0x1ee478);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index c01ce10..5b5889d 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 _0x08b6=['code','slice','substring','https://accounts.zoho.com','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientId','then','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','host','lastIndexOf','https://accounts.zoho.in','application/x-www-form-urlencoded','info','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientSecret'];(function(_0x39e84d,_0x11931d){var _0x1991bc=function(_0xc81e32){while(--_0xc81e32){_0x39e84d['push'](_0x39e84d['shift']());}};_0x1991bc(++_0x11931d);}(_0x08b6,0x1d2));var _0x608b=function(_0xfee842,_0x4d2c1c){_0xfee842=_0xfee842-0x0;var _0x826af5=_0x08b6[_0xfee842];return _0x826af5;};'use strict';var _=require(_0x608b('0x0'));var util=require(_0x608b('0x1'));var logger=require(_0x608b('0x2'))('api');var moment=require(_0x608b('0x3'));var BPromise=require(_0x608b('0x4'));var rp=require(_0x608b('0x5'));var fs=require('fs');var path=require(_0x608b('0x6'));var rimraf=require(_0x608b('0x7'));var config=require(_0x608b('0x8'));var attributes=require(_0x608b('0x9'));var integrations=require(_0x608b('0xa'));module['exports']=function(_0x321000,_0x347399){return _0x321000[_0x608b('0xb')](_0x608b('0xc'),attributes,{'tableName':_0x608b('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5d0b31,_0x1f96d8,_0x1f3dd3){if(_0x5d0b31[_0x608b('0xe')](_0x608b('0xf'))||_0x5d0b31[_0x608b('0xe')](_0x608b('0x10'))||_0x5d0b31[_0x608b('0xe')]('clientId')||_0x5d0b31[_0x608b('0xe')](_0x608b('0x11'))||_0x5d0b31[_0x608b('0xe')](_0x608b('0x12'))||_0x5d0b31['changed']('host')){var _0x528664,_0x66addd;_0x528664=_0x5d0b31[_0x608b('0x10')];var _0x42dbcb=_0x528664[_0x608b('0x13')](-0x1);if(_0x42dbcb==='/'||_0x42dbcb==='\x5c'||_0x42dbcb===':'){_0x528664=_0x528664[_0x608b('0x14')](0x0,_0x528664['lastIndexOf'](_0x42dbcb));}switch(_0x5d0b31[_0x608b('0xf')]){case'US':_0x66addd=_0x608b('0x15');break;case'AU':_0x66addd='https://accounts.zoho.com.au';break;case'IN':_0x66addd='https://accounts.zoho.in';break;case'CN':_0x66addd=_0x608b('0x16');break;default:_0x66addd=_0x608b('0x17');break;}var _0x7f764={'method':_0x608b('0x18'),'uri':_0x66addd+_0x608b('0x19'),'form':{'grant_type':_0x608b('0x1a'),'client_id':_0x5d0b31[_0x608b('0x1b')],'client_secret':_0x5d0b31[_0x608b('0x11')],'redirect_uri':_0x5d0b31[_0x608b('0x10')],'code':_0x5d0b31[_0x608b('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x7f764)[_0x608b('0x1c')](function(_0x37fa84){var _0x6086a4=JSON[_0x608b('0x1d')](_0x37fa84);if(_0x6086a4[_0x608b('0x1e')]){_0x5d0b31[_0x608b('0x1f')]=_0x6086a4[_0x608b('0x1e')];logger['info'](util[_0x608b('0x20')](_0x608b('0x21'),_0x5d0b31[_0x608b('0x22')],_0x5d0b31['id']));}else{logger[_0x608b('0x23')](util['format'](_0x608b('0x24'),_0x5d0b31[_0x608b('0x22')],_0x5d0b31['id']),util[_0x608b('0x25')](_0x6086a4,{'showHidden':![],'depth':null}));}return _0x1f3dd3(null,_0x1f96d8);})[_0x608b('0x26')](function(_0x25799e){logger[_0x608b('0x23')](util[_0x608b('0x20')](_0x608b('0x24'),_0x5d0b31[_0x608b('0x22')],_0x5d0b31['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x1f3dd3(_0x25799e);});}else{return _0x1f3dd3(null,_0x1f96d8);}},'beforeUpdate':function(_0x465c79,_0x1974e2,_0x789af7){if(_0x465c79[_0x608b('0xe')]('zone')||_0x465c79[_0x608b('0xe')](_0x608b('0x10'))||_0x465c79[_0x608b('0xe')](_0x608b('0x1b'))||_0x465c79['changed'](_0x608b('0x11'))||_0x465c79[_0x608b('0xe')](_0x608b('0x12'))||_0x465c79['changed'](_0x608b('0x27'))){var _0x2c3c55,_0x103afd;_0x2c3c55=_0x465c79[_0x608b('0x10')];var _0xd3b6f6=_0x2c3c55['slice'](-0x1);if(_0xd3b6f6==='/'||_0xd3b6f6==='\x5c'||_0xd3b6f6===':'){_0x2c3c55=_0x2c3c55['substring'](0x0,_0x2c3c55[_0x608b('0x28')](_0xd3b6f6));}switch(_0x465c79[_0x608b('0xf')]){case'US':_0x103afd=_0x608b('0x15');break;case'AU':_0x103afd='https://accounts.zoho.com.au';break;case'IN':_0x103afd=_0x608b('0x29');break;case'CN':_0x103afd='https://accounts.zoho.com.cn';break;default:_0x103afd=_0x608b('0x17');break;}var _0x3f2fd9={'method':_0x608b('0x18'),'uri':_0x103afd+_0x608b('0x19'),'form':{'grant_type':_0x608b('0x1a'),'client_id':_0x465c79['clientId'],'client_secret':_0x465c79[_0x608b('0x11')],'redirect_uri':_0x465c79[_0x608b('0x10')],'code':_0x465c79['code']},'headers':{'Content-Type':_0x608b('0x2a')}};return rp(_0x3f2fd9)['then'](function(_0x3dc06f){var _0x5b5287=JSON[_0x608b('0x1d')](_0x3dc06f);if(_0x5b5287[_0x608b('0x1e')]){_0x465c79['refreshToken']=_0x5b5287[_0x608b('0x1e')];logger[_0x608b('0x2b')](util[_0x608b('0x20')](_0x608b('0x21'),_0x465c79['name'],_0x465c79['id']));}else{logger[_0x608b('0x23')](util[_0x608b('0x20')](_0x608b('0x24'),_0x465c79[_0x608b('0x22')],_0x465c79['id']),util[_0x608b('0x25')](_0x5b5287,{'showHidden':![],'depth':null}));}return _0x789af7(null,_0x1974e2);})['catch'](function(_0x13e8cf){logger[_0x608b('0x23')](util[_0x608b('0x20')](_0x608b('0x24'),_0x465c79['name'],_0x465c79['id']),util[_0x608b('0x25')](parsedResult,{'showHidden':![],'depth':null}));return _0x789af7(_0x13e8cf);});}else{return _0x789af7(null,_0x1974e2);}}}});}; \ No newline at end of file +var _0x288c=['refresh_token','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','catch','slice','https://accounts.zoho.com.cn','application/x-www-form-urlencoded','then','parse','refreshToken','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','ZohoAccount','changed','zone','serverUrl','clientId','code','host','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','clientSecret'];(function(_0x50512b,_0x1a807f){var _0x577b0a=function(_0x2c4cd){while(--_0x2c4cd){_0x50512b['push'](_0x50512b['shift']());}};_0x577b0a(++_0x1a807f);}(_0x288c,0x105));var _0xc288=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x288c[_0x5a95fa];return _0x1a61b8;};'use strict';var _=require(_0xc288('0x0'));var util=require(_0xc288('0x1'));var logger=require('../../config/logger')(_0xc288('0x2'));var moment=require(_0xc288('0x3'));var BPromise=require(_0xc288('0x4'));var rp=require(_0xc288('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc288('0x6'));var config=require(_0xc288('0x7'));var attributes=require('./intZohoAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xc288('0x8')]=function(_0x404f81,_0x1bc9b8){return _0x404f81['define'](_0xc288('0x9'),attributes,{'tableName':'int_zoho_accounts','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3860ad,_0x5cc44e,_0x19dcb8){if(_0x3860ad[_0xc288('0xa')](_0xc288('0xb'))||_0x3860ad['changed'](_0xc288('0xc'))||_0x3860ad[_0xc288('0xa')](_0xc288('0xd'))||_0x3860ad[_0xc288('0xa')]('clientSecret')||_0x3860ad[_0xc288('0xa')](_0xc288('0xe'))||_0x3860ad[_0xc288('0xa')](_0xc288('0xf'))){var _0x2d53a7,_0x4771e3;_0x2d53a7=_0x3860ad['serverUrl'];var _0x12dd08=_0x2d53a7['slice'](-0x1);if(_0x12dd08==='/'||_0x12dd08==='\x5c'||_0x12dd08===':'){_0x2d53a7=_0x2d53a7[_0xc288('0x10')](0x0,_0x2d53a7[_0xc288('0x11')](_0x12dd08));}switch(_0x3860ad[_0xc288('0xb')]){case'US':_0x4771e3=_0xc288('0x12');break;case'AU':_0x4771e3=_0xc288('0x13');break;case'IN':_0x4771e3=_0xc288('0x14');break;case'CN':_0x4771e3='https://accounts.zoho.com.cn';break;default:_0x4771e3=_0xc288('0x15');break;}var _0x7a245={'method':_0xc288('0x16'),'uri':_0x4771e3+_0xc288('0x17'),'form':{'grant_type':_0xc288('0x18'),'client_id':_0x3860ad['clientId'],'client_secret':_0x3860ad[_0xc288('0x19')],'redirect_uri':_0x3860ad[_0xc288('0xc')],'code':_0x3860ad['code']},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x7a245)['then'](function(_0xcb62ec){var _0x5267a4=JSON['parse'](_0xcb62ec);if(_0x5267a4[_0xc288('0x1a')]){_0x3860ad['refreshToken']=_0x5267a4[_0xc288('0x1a')];logger[_0xc288('0x1b')](util[_0xc288('0x1c')](_0xc288('0x1d'),_0x3860ad['name'],_0x3860ad['id']));}else{logger[_0xc288('0x1e')](util[_0xc288('0x1c')](_0xc288('0x1f'),_0x3860ad[_0xc288('0x20')],_0x3860ad['id']),util[_0xc288('0x21')](_0x5267a4,{'showHidden':![],'depth':null}));}return _0x19dcb8(null,_0x5cc44e);})[_0xc288('0x22')](function(_0x3af541){logger[_0xc288('0x1e')](util[_0xc288('0x1c')](_0xc288('0x1f'),_0x3860ad[_0xc288('0x20')],_0x3860ad['id']),util[_0xc288('0x21')](parsedResult,{'showHidden':![],'depth':null}));return _0x19dcb8(_0x3af541);});}else{return _0x19dcb8(null,_0x5cc44e);}},'beforeUpdate':function(_0x592c81,_0x148fcb,_0x7d35e4){if(_0x592c81[_0xc288('0xa')](_0xc288('0xb'))||_0x592c81[_0xc288('0xa')]('serverUrl')||_0x592c81[_0xc288('0xa')](_0xc288('0xd'))||_0x592c81[_0xc288('0xa')](_0xc288('0x19'))||_0x592c81[_0xc288('0xa')]('code')||_0x592c81['changed'](_0xc288('0xf'))){var _0x55bbc1,_0x2708b1;_0x55bbc1=_0x592c81['serverUrl'];var _0x41c090=_0x55bbc1[_0xc288('0x23')](-0x1);if(_0x41c090==='/'||_0x41c090==='\x5c'||_0x41c090===':'){_0x55bbc1=_0x55bbc1[_0xc288('0x10')](0x0,_0x55bbc1[_0xc288('0x11')](_0x41c090));}switch(_0x592c81[_0xc288('0xb')]){case'US':_0x2708b1=_0xc288('0x12');break;case'AU':_0x2708b1=_0xc288('0x13');break;case'IN':_0x2708b1=_0xc288('0x14');break;case'CN':_0x2708b1=_0xc288('0x24');break;default:_0x2708b1=_0xc288('0x15');break;}var _0x3d4077={'method':_0xc288('0x16'),'uri':_0x2708b1+_0xc288('0x17'),'form':{'grant_type':_0xc288('0x18'),'client_id':_0x592c81[_0xc288('0xd')],'client_secret':_0x592c81[_0xc288('0x19')],'redirect_uri':_0x592c81[_0xc288('0xc')],'code':_0x592c81[_0xc288('0xe')]},'headers':{'Content-Type':_0xc288('0x25')}};return rp(_0x3d4077)[_0xc288('0x26')](function(_0x257287){var _0x2f05a4=JSON[_0xc288('0x27')](_0x257287);if(_0x2f05a4[_0xc288('0x1a')]){_0x592c81[_0xc288('0x28')]=_0x2f05a4[_0xc288('0x1a')];logger[_0xc288('0x1b')](util[_0xc288('0x1c')](_0xc288('0x1d'),_0x592c81[_0xc288('0x20')],_0x592c81['id']));}else{logger[_0xc288('0x1e')](util['format'](_0xc288('0x1f'),_0x592c81[_0xc288('0x20')],_0x592c81['id']),util['inspect'](_0x2f05a4,{'showHidden':![],'depth':null}));}return _0x7d35e4(null,_0x148fcb);})[_0xc288('0x22')](function(_0x541a31){logger[_0xc288('0x1e')](util[_0xc288('0x1c')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x592c81[_0xc288('0x20')],_0x592c81['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x7d35e4(_0x541a31);});}else{return _0x7d35e4(null,_0x148fcb);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 65906e4..a50d286 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 _0x1303=['attributes','limit','include','map','model','ShowZohoAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoAccount,\x20%s,\x20%s','message','info','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where'];(function(_0x39d6d7,_0x9e0b81){var _0x424828=function(_0x5efe7a){while(--_0x5efe7a){_0x39d6d7['push'](_0x39d6d7['shift']());}};_0x424828(++_0x9e0b81);}(_0x1303,0xe4));var _0x3130=function(_0xfcbcb8,_0x35bf6b){_0xfcbcb8=_0xfcbcb8-0x0;var _0x1b1f97=_0x1303[_0xfcbcb8];return _0x1b1f97;};'use strict';var _=require(_0x3130('0x0'));var util=require(_0x3130('0x1'));var moment=require(_0x3130('0x2'));var BPromise=require(_0x3130('0x3'));var rs=require(_0x3130('0x4'));var fs=require('fs');var Redis=require(_0x3130('0x5'));var db=require(_0x3130('0x6'))['db'];var utils=require(_0x3130('0x7'));var logger=require(_0x3130('0x8'))(_0x3130('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x3130('0xa')][_0x3130('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x35bd81,_0x3b279a,_0x45b0e9){return new BPromise(function(_0x178d90,_0x20b19d){return client[_0x3130('0xc')](_0x35bd81,_0x45b0e9)[_0x3130('0xd')](function(_0x15829d){logger['info']('ZohoAccount,\x20%s,\x20%s',_0x3b279a,_0x3130('0xe'));logger[_0x3130('0xf')](_0x3130('0x10'),_0x3b279a,'request\x20sent',JSON[_0x3130('0x11')](_0x15829d));if(_0x15829d[_0x3130('0x12')]){if(_0x15829d[_0x3130('0x12')][_0x3130('0x13')]===0x1f4){logger['error'](_0x3130('0x14'),_0x3b279a,_0x15829d[_0x3130('0x12')][_0x3130('0x15')]);return _0x20b19d(_0x15829d[_0x3130('0x12')][_0x3130('0x15')]);}logger[_0x3130('0x12')](_0x3130('0x14'),_0x3b279a,_0x15829d[_0x3130('0x12')][_0x3130('0x15')]);return _0x178d90(_0x15829d[_0x3130('0x12')][_0x3130('0x15')]);}else{logger[_0x3130('0x16')]('ZohoAccount,\x20%s,\x20%s',_0x3b279a,_0x3130('0xe'));_0x178d90(_0x15829d[_0x3130('0x17')][_0x3130('0x15')]);}})[_0x3130('0x18')](function(_0x2ef747){logger[_0x3130('0x12')](_0x3130('0x14'),_0x3b279a,_0x2ef747);_0x20b19d(_0x2ef747);});});}exports[_0x3130('0x19')]=function(_0x5a8652){var _0x5acfe8=this;return new Promise(function(_0xba2524,_0x32e282){return db[_0x3130('0x1a')][_0x3130('0x1b')]({'raw':_0x5a8652[_0x3130('0x1c')]?_0x5a8652[_0x3130('0x1c')][_0x3130('0x1d')]===undefined?!![]:![]:!![],'where':_0x5a8652['options']?_0x5a8652[_0x3130('0x1c')][_0x3130('0x1e')]||null:null,'attributes':_0x5a8652[_0x3130('0x1c')]?_0x5a8652['options'][_0x3130('0x1f')]||null:null,'limit':_0x5a8652['options']?_0x5a8652['options'][_0x3130('0x20')]||null:null,'include':_0x5a8652[_0x3130('0x1c')]?_0x5a8652['options'][_0x3130('0x21')]?_[_0x3130('0x22')](_0x5a8652[_0x3130('0x1c')][_0x3130('0x21')],function(_0x5619af){return{'model':db[_0x5619af['model']],'as':_0x5619af['as'],'attributes':_0x5619af[_0x3130('0x1f')],'include':_0x5619af[_0x3130('0x21')]?_['map'](_0x5619af['include'],function(_0x250b20){return{'model':db[_0x250b20[_0x3130('0x23')]],'as':_0x250b20['as'],'attributes':_0x250b20['attributes'],'include':_0x250b20[_0x3130('0x21')]?_['map'](_0x250b20[_0x3130('0x21')],function(_0x531e4d){return{'model':db[_0x531e4d['model']],'as':_0x531e4d['as'],'attributes':_0x531e4d['attributes']};}):[]};}):[]};}):[]:[]})[_0x3130('0xd')](function(_0x411919){logger[_0x3130('0x16')](_0x3130('0x19'),_0x5a8652);logger[_0x3130('0xf')]('GetZohoAccount',_0x5a8652,JSON['stringify'](_0x411919));_0xba2524(_0x411919);})[_0x3130('0x18')](function(_0x5a7b2d){logger[_0x3130('0x12')]('GetZohoAccount',_0x5a7b2d[_0x3130('0x15')],_0x5a8652);_0x32e282(_0x5acfe8[_0x3130('0x12')](0x1f4,_0x5a7b2d[_0x3130('0x15')]));});});};exports[_0x3130('0x24')]=function(_0x3c10dd){var _0x1680e4=this;return new Promise(function(_0xd3e13c,_0x26f26b){return db[_0x3130('0x1a')]['find']({'raw':_0x3c10dd['options']?_0x3c10dd[_0x3130('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x3c10dd[_0x3130('0x1c')]?_0x3c10dd[_0x3130('0x1c')][_0x3130('0x1e')]||null:null,'attributes':_0x3c10dd[_0x3130('0x1c')]?_0x3c10dd['options'][_0x3130('0x1f')]||null:null,'include':_0x3c10dd['options']?_0x3c10dd[_0x3130('0x1c')][_0x3130('0x21')]?_[_0x3130('0x22')](_0x3c10dd[_0x3130('0x1c')]['include'],function(_0x10d744){return{'model':db[_0x10d744[_0x3130('0x23')]],'as':_0x10d744['as'],'attributes':_0x10d744[_0x3130('0x1f')],'include':_0x10d744['include']?_[_0x3130('0x22')](_0x10d744['include'],function(_0x1d64a7){return{'model':db[_0x1d64a7[_0x3130('0x23')]],'as':_0x1d64a7['as'],'attributes':_0x1d64a7[_0x3130('0x1f')],'include':_0x1d64a7[_0x3130('0x21')]?_[_0x3130('0x22')](_0x1d64a7[_0x3130('0x21')],function(_0x413f1b){return{'model':db[_0x413f1b[_0x3130('0x23')]],'as':_0x413f1b['as'],'attributes':_0x413f1b[_0x3130('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x3130('0xd')](function(_0x4620f5){logger['info'](_0x3130('0x24'),_0x3c10dd);logger[_0x3130('0xf')]('ShowZohoAccount',_0x3c10dd,JSON['stringify'](_0x4620f5));_0xd3e13c(_0x4620f5);})[_0x3130('0x18')](function(_0x362cd6){logger[_0x3130('0x12')](_0x3130('0x24'),_0x362cd6[_0x3130('0x15')],_0x3c10dd);_0x26f26b(_0x1680e4[_0x3130('0x12')](0x1f4,_0x362cd6[_0x3130('0x15')]));});});}; \ No newline at end of file +var _0x3f1f=['jayson/promise','http','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetZohoAccount','ZohoAccount','options','raw','where','attributes','include','map','model','then','stringify','ShowZohoAccount','find','lodash','util','moment','../../config/logger','rpc'];(function(_0x2077c2,_0x275ab5){var _0x312f9f=function(_0x331435){while(--_0x331435){_0x2077c2['push'](_0x2077c2['shift']());}};_0x312f9f(++_0x275ab5);}(_0x3f1f,0x109));var _0xf3f1=function(_0x164ee3,_0x3228d6){_0x164ee3=_0x164ee3-0x0;var _0x567f24=_0x3f1f[_0x164ee3];return _0x567f24;};'use strict';var _=require(_0xf3f1('0x0'));var util=require(_0xf3f1('0x1'));var moment=require(_0xf3f1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf3f1('0x3'))(_0xf3f1('0x4'));var config=require('../../config/environment');var jayson=require(_0xf3f1('0x5'));var client=jayson['client'][_0xf3f1('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5a7f38,_0x597c5c,_0x262de9){return new BPromise(function(_0x125dc0,_0x5645f4){return client[_0xf3f1('0x7')](_0x5a7f38,_0x262de9)['then'](function(_0x2fbe0e){logger[_0xf3f1('0x8')](_0xf3f1('0x9'),_0x597c5c,_0xf3f1('0xa'));logger[_0xf3f1('0xb')](_0xf3f1('0xc'),_0x597c5c,_0xf3f1('0xa'),JSON['stringify'](_0x2fbe0e));if(_0x2fbe0e['error']){if(_0x2fbe0e[_0xf3f1('0xd')]['code']===0x1f4){logger[_0xf3f1('0xd')](_0xf3f1('0x9'),_0x597c5c,_0x2fbe0e['error'][_0xf3f1('0xe')]);return _0x5645f4(_0x2fbe0e['error'][_0xf3f1('0xe')]);}logger['error'](_0xf3f1('0x9'),_0x597c5c,_0x2fbe0e[_0xf3f1('0xd')][_0xf3f1('0xe')]);return _0x125dc0(_0x2fbe0e['error'][_0xf3f1('0xe')]);}else{logger[_0xf3f1('0x8')]('ZohoAccount,\x20%s,\x20%s',_0x597c5c,_0xf3f1('0xa'));_0x125dc0(_0x2fbe0e[_0xf3f1('0xf')][_0xf3f1('0xe')]);}})[_0xf3f1('0x10')](function(_0x2ec845){logger[_0xf3f1('0xd')](_0xf3f1('0x9'),_0x597c5c,_0x2ec845);_0x5645f4(_0x2ec845);});});}exports[_0xf3f1('0x11')]=function(_0x5f3242){var _0x5517b7=this;return new Promise(function(_0x133e21,_0x2d081b){return db[_0xf3f1('0x12')]['findAll']({'raw':_0x5f3242[_0xf3f1('0x13')]?_0x5f3242['options'][_0xf3f1('0x14')]===undefined?!![]:![]:!![],'where':_0x5f3242[_0xf3f1('0x13')]?_0x5f3242[_0xf3f1('0x13')][_0xf3f1('0x15')]||null:null,'attributes':_0x5f3242[_0xf3f1('0x13')]?_0x5f3242['options'][_0xf3f1('0x16')]||null:null,'limit':_0x5f3242['options']?_0x5f3242[_0xf3f1('0x13')]['limit']||null:null,'include':_0x5f3242[_0xf3f1('0x13')]?_0x5f3242[_0xf3f1('0x13')][_0xf3f1('0x17')]?_[_0xf3f1('0x18')](_0x5f3242[_0xf3f1('0x13')][_0xf3f1('0x17')],function(_0x38c650){return{'model':db[_0x38c650[_0xf3f1('0x19')]],'as':_0x38c650['as'],'attributes':_0x38c650['attributes'],'include':_0x38c650['include']?_['map'](_0x38c650[_0xf3f1('0x17')],function(_0x5d8949){return{'model':db[_0x5d8949[_0xf3f1('0x19')]],'as':_0x5d8949['as'],'attributes':_0x5d8949[_0xf3f1('0x16')],'include':_0x5d8949[_0xf3f1('0x17')]?_[_0xf3f1('0x18')](_0x5d8949[_0xf3f1('0x17')],function(_0x3b7bd8){return{'model':db[_0x3b7bd8[_0xf3f1('0x19')]],'as':_0x3b7bd8['as'],'attributes':_0x3b7bd8[_0xf3f1('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf3f1('0x1a')](function(_0x8dc7f5){logger[_0xf3f1('0x8')]('GetZohoAccount',_0x5f3242);logger['debug'](_0xf3f1('0x11'),_0x5f3242,JSON[_0xf3f1('0x1b')](_0x8dc7f5));_0x133e21(_0x8dc7f5);})[_0xf3f1('0x10')](function(_0x415fa6){logger[_0xf3f1('0xd')](_0xf3f1('0x11'),_0x415fa6[_0xf3f1('0xe')],_0x5f3242);_0x2d081b(_0x5517b7[_0xf3f1('0xd')](0x1f4,_0x415fa6[_0xf3f1('0xe')]));});});};exports[_0xf3f1('0x1c')]=function(_0x2def79){var _0x3b9bbb=this;return new Promise(function(_0x5182ff,_0x31a2b3){return db[_0xf3f1('0x12')][_0xf3f1('0x1d')]({'raw':_0x2def79[_0xf3f1('0x13')]?_0x2def79[_0xf3f1('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x2def79[_0xf3f1('0x13')]?_0x2def79['options']['where']||null:null,'attributes':_0x2def79[_0xf3f1('0x13')]?_0x2def79[_0xf3f1('0x13')][_0xf3f1('0x16')]||null:null,'include':_0x2def79[_0xf3f1('0x13')]?_0x2def79[_0xf3f1('0x13')][_0xf3f1('0x17')]?_[_0xf3f1('0x18')](_0x2def79[_0xf3f1('0x13')]['include'],function(_0xd1bb03){return{'model':db[_0xd1bb03[_0xf3f1('0x19')]],'as':_0xd1bb03['as'],'attributes':_0xd1bb03[_0xf3f1('0x16')],'include':_0xd1bb03[_0xf3f1('0x17')]?_[_0xf3f1('0x18')](_0xd1bb03[_0xf3f1('0x17')],function(_0xcadb34){return{'model':db[_0xcadb34[_0xf3f1('0x19')]],'as':_0xcadb34['as'],'attributes':_0xcadb34[_0xf3f1('0x16')],'include':_0xcadb34[_0xf3f1('0x17')]?_[_0xf3f1('0x18')](_0xcadb34[_0xf3f1('0x17')],function(_0x1d2a2c){return{'model':db[_0x1d2a2c['model']],'as':_0x1d2a2c['as'],'attributes':_0x1d2a2c[_0xf3f1('0x16')]};}):[]};}):[]};}):[]:[]})[_0xf3f1('0x1a')](function(_0x1f9327){logger['info'](_0xf3f1('0x1c'),_0x2def79);logger[_0xf3f1('0xb')](_0xf3f1('0x1c'),_0x2def79,JSON[_0xf3f1('0x1b')](_0x1f9327));_0x5182ff(_0x1f9327);})[_0xf3f1('0x10')](function(_0x1f436d){logger[_0xf3f1('0xd')](_0xf3f1('0x1c'),_0x1f436d[_0xf3f1('0xe')],_0x2def79);_0x31a2b3(_0x3b9bbb[_0xf3f1('0xd')](0x1f4,_0x1f436d[_0xf3f1('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index 0dbf3aa..e943abc 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 _0xce68=['/:id','show','/:id/fields','getFields','getDescriptions','post','create','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0xce68,0x159));var _0x8ce6=function(_0x4cf07b,_0x3d7622){_0x4cf07b=_0x4cf07b-0x0;var _0x1c4169=_0xce68[_0x4cf07b];return _0x1c4169;};'use strict';var multer=require(_0x8ce6('0x0'));var util=require(_0x8ce6('0x1'));var path=require(_0x8ce6('0x2'));var timeout=require(_0x8ce6('0x3'));var express=require('express');var router=express[_0x8ce6('0x4')]();var auth=require(_0x8ce6('0x5'));var interaction=require(_0x8ce6('0x6'));var config=require(_0x8ce6('0x7'));var controller=require(_0x8ce6('0x8'));router[_0x8ce6('0x9')]('/',auth[_0x8ce6('0xa')](),controller[_0x8ce6('0xb')]);router[_0x8ce6('0x9')](_0x8ce6('0xc'),auth[_0x8ce6('0xa')](),controller[_0x8ce6('0xd')]);router[_0x8ce6('0x9')](_0x8ce6('0xe'),auth[_0x8ce6('0xa')](),controller[_0x8ce6('0xf')]);router['get']('/:id/subjects',auth[_0x8ce6('0xa')](),controller['getSubjects']);router[_0x8ce6('0x9')]('/:id/descriptions',auth[_0x8ce6('0xa')](),controller[_0x8ce6('0x10')]);router[_0x8ce6('0x11')]('/',auth[_0x8ce6('0xa')](),controller[_0x8ce6('0x12')]);router['put'](_0x8ce6('0xc'),auth[_0x8ce6('0xa')](),controller['update']);router[_0x8ce6('0x13')](_0x8ce6('0xc'),auth[_0x8ce6('0xa')](),controller['destroy']);module[_0x8ce6('0x14')]=router; \ No newline at end of file +var _0x579b=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','create','put','delete','destroy','path','connect-timeout','express'];(function(_0x3f0bd7,_0x16284c){var _0x1cbb2f=function(_0x4888d3){while(--_0x4888d3){_0x3f0bd7['push'](_0x3f0bd7['shift']());}};_0x1cbb2f(++_0x16284c);}(_0x579b,0x1b6));var _0xb579=function(_0x2cde0a,_0x1f9695){_0x2cde0a=_0x2cde0a-0x0;var _0x260610=_0x579b[_0x2cde0a];return _0x260610;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb579('0x0'));var timeout=require(_0xb579('0x1'));var express=require(_0xb579('0x2'));var router=express[_0xb579('0x3')]();var auth=require(_0xb579('0x4'));var interaction=require(_0xb579('0x5'));var config=require(_0xb579('0x6'));var controller=require(_0xb579('0x7'));router[_0xb579('0x8')]('/',auth[_0xb579('0x9')](),controller[_0xb579('0xa')]);router[_0xb579('0x8')](_0xb579('0xb'),auth[_0xb579('0x9')](),controller['show']);router[_0xb579('0x8')](_0xb579('0xc'),auth[_0xb579('0x9')](),controller[_0xb579('0xd')]);router['get'](_0xb579('0xe'),auth['isAuthenticated'](),controller[_0xb579('0xf')]);router[_0xb579('0x8')]('/:id/descriptions',auth[_0xb579('0x9')](),controller[_0xb579('0x10')]);router['post']('/',auth[_0xb579('0x9')](),controller[_0xb579('0x11')]);router[_0xb579('0x12')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xb579('0x13')](_0xb579('0xb'),auth[_0xb579('0x9')](),controller[_0xb579('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index 39e337c..a0e6953 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 _0x4169=['ENUM','Leads','Contacts','STRING','sequelize','exports'];(function(_0xcb9d33,_0x183884){var _0x150561=function(_0x213b18){while(--_0x213b18){_0xcb9d33['push'](_0xcb9d33['shift']());}};_0x150561(++_0x183884);}(_0x4169,0x136));var _0x9416=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x4169[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x9416('0x0'));module[_0x9416('0x1')]={'name':{'type':Sequelize['STRING']},'moduleCreate':{'type':Sequelize[_0x9416('0x2')](_0x9416('0x3'),_0x9416('0x4')),'defaultValue':_0x9416('0x3')},'description':{'type':Sequelize[_0x9416('0x5')]}}; \ No newline at end of file +var _0x280b=['exports','STRING','ENUM','Leads','Contacts','sequelize'];(function(_0x34537f,_0x213a48){var _0x4bc478=function(_0x22690e){while(--_0x22690e){_0x34537f['push'](_0x34537f['shift']());}};_0x4bc478(++_0x213a48);}(_0x280b,0x89));var _0xb280=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x280b[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0xb280('0x0'));module[_0xb280('0x1')]={'name':{'type':Sequelize[_0xb280('0x2')]},'moduleCreate':{'type':Sequelize[_0xb280('0x3')](_0xb280('0x4'),_0xb280('0x5')),'defaultValue':_0xb280('0x4')},'description':{'type':Sequelize[_0xb280('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index be05275..fa9e518 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 _0xe14b=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','map','ZohoConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then'];(function(_0x3161d2,_0x52064b){var _0x5db810=function(_0x6f4953){while(--_0x6f4953){_0x3161d2['push'](_0x3161d2['shift']());}};_0x5db810(++_0x52064b);}(_0xe14b,0x93));var _0xbe14=function(_0x5cce12,_0x17f5a2){_0x5cce12=_0x5cce12-0x0;var _0x30a1c4=_0xe14b[_0x5cce12];return _0x30a1c4;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var jayson=require(_0xbe14('0x15'));var client=jayson[_0xbe14('0x16')][_0xbe14('0x17')]({'port':0x232a});function checkPasswordPattern(_0x23a730,_0x2850cb,_0x16893f){if(_0x16893f){var _0xa2cf72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa2cf72[_0xbe14('0x18')](_0x2850cb)){return _0x23a730;}else{throw new db[(_0xbe14('0x19'))][(_0xbe14('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x23a730;}}function respondWithRpcPromise(_0x55b3a7,_0x3f58f5,_0x3dc4a9,_0xf4ac9){return new BPromise(function(_0x37ce4e,_0x4e8f34){var _0x21c789=_0xf4ac9||client;return _0x21c789[_0xbe14('0x1b')](_0x55b3a7,_0x3dc4a9)[_0xbe14('0x1c')](function(_0x123ede){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));logger['debug'](_0xbe14('0x20'),_0x3f58f5,_0xbe14('0x1f'),JSON[_0xbe14('0x21')](_0x123ede));if(_0x123ede[_0xbe14('0x22')]){if(_0x123ede[_0xbe14('0x22')][_0xbe14('0x23')]===0x1f4){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);return _0x4e8f34(_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);}logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede['error'][_0xbe14('0x24')]);return _0x37ce4e(_0x123ede['error'][_0xbe14('0x24')]);}else{logger['info'](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));_0x37ce4e(_0x123ede['result'][_0xbe14('0x24')]);}})['catch'](function(_0x4587a8){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x4587a8);_0x4e8f34(_0x4587a8);});});}function respondWithStatusCode(_0x5fa043,_0x1ee9c1){_0x1ee9c1=_0x1ee9c1||0xcc;return function(_0x39cc81){if(_0x39cc81){return _0x5fa043[_0xbe14('0x25')](_0x1ee9c1);}return _0x5fa043[_0xbe14('0x26')](_0x1ee9c1)['end']();};}function respondWithResult(_0x1822e0,_0x1ba46a){_0x1ba46a=_0x1ba46a||0xc8;return function(_0x391556){if(_0x391556){return _0x1822e0[_0xbe14('0x26')](_0x1ba46a)['json'](_0x391556);}};}function respondWithFilteredResult(_0x16f884,_0x29fc64){return function(_0x59bf34){if(_0x59bf34){var _0x3c3613=_0x59bf34[_0xbe14('0x27')],_0x3b3e84=_0x29fc64[_0xbe14('0x28')],_0x1c7cc7=_0x29fc64[_0xbe14('0x28')]+_0x29fc64[_0xbe14('0x29')],_0x19252f;if(_0x1c7cc7>=_0x3c3613){_0x1c7cc7=_0x3c3613;_0x19252f=0xc8;}else{_0x19252f=0xce;}_0x16f884[_0xbe14('0x26')](_0x19252f);return _0x16f884[_0xbe14('0x2a')](_0xbe14('0x2b'),_0x3b3e84+'-'+_0x1c7cc7+'/'+_0x3c3613)[_0xbe14('0x2c')](_0x59bf34);}return null;};}function patchUpdates(_0x39dc0a){return function(_0x10ae36){try{jsonpatch[_0xbe14('0x2d')](_0x10ae36,_0x39dc0a,!![]);}catch(_0xe6feb2){return BPromise[_0xbe14('0x2e')](_0xe6feb2);}return _0x10ae36[_0xbe14('0x2f')]();};}function saveUpdates(_0x29e76a,_0x14e7c4){return function(_0x581e86){if(_0x581e86){return _0x581e86[_0xbe14('0x30')](_0x29e76a)['then'](function(_0x58f8de){return _0x58f8de;});}return null;};}function removeEntity(_0x46c2d1,_0x4c1e7e){return function(_0x243524){if(_0x243524){return _0x243524[_0xbe14('0x31')]()['then'](function(){_0x46c2d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412ad5,_0xa3d24){return function(_0x5f27b6){if(!_0x5f27b6){_0x412ad5[_0xbe14('0x25')](0x194);}return _0x5f27b6;};}function handleError(_0x1faf3e,_0x452635){_0x452635=_0x452635||0x1f4;return function(_0x1aa849){logger[_0xbe14('0x22')](_0x1aa849['stack']);if(_0x1aa849['name']){delete _0x1aa849[_0xbe14('0x32')];}_0x1faf3e['status'](_0x452635)['send'](_0x1aa849);};}exports['index']=function(_0x163ef7,_0x393f6b){var _0x2bb45={},_0x3dbacb={},_0x172e79={'count':0x0,'rows':[]};var _0x29356f=_[_0xbe14('0x33')](db[_0xbe14('0x34')][_0xbe14('0x35')],function(_0x2dfd5a){return{'name':_0x2dfd5a[_0xbe14('0x36')],'type':_0x2dfd5a[_0xbe14('0x37')]['key']};});_0x3dbacb['model']=_[_0xbe14('0x33')](_0x29356f,_0xbe14('0x32'));_0x3dbacb[_0xbe14('0x38')]=_['keys'](_0x163ef7[_0xbe14('0x38')]);_0x3dbacb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],_0x3dbacb[_0xbe14('0x38')]);_0x2bb45[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x163ef7['query'][_0xbe14('0x3d')]));_0x2bb45[_0xbe14('0x3c')]=_0x2bb45[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x2bb45[_0xbe14('0x3c')]:_0x3dbacb[_0xbe14('0x3b')];if(!_0x163ef7['query'][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x2bb45[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x163ef7['query']['limit']);_0x2bb45[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x163ef7[_0xbe14('0x38')]['offset']);}_0x2bb45['order']=qs[_0xbe14('0x41')](_0x163ef7['query']['sort']);_0x2bb45[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x163ef7['query'],_0x3dbacb['filters']));if(_0x163ef7['query'][_0xbe14('0x44')]){_0x2bb45[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x2bb45['where'],{'$or':_[_0xbe14('0x33')](_0x29356f,function(_0xcb0680){if(_0xcb0680[_0xbe14('0x37')]!==_0xbe14('0x46')){var _0x58351f={};_0x58351f[_0xcb0680['name']]={'$like':'%'+_0x163ef7[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x58351f;}})});}_0x2bb45=_[_0xbe14('0x45')]({},_0x2bb45,_0x163ef7[_0xbe14('0x47')]);var _0x2550dc={'where':_0x2bb45['where']};return db['ZohoConfiguration'][_0xbe14('0x27')](_0x2550dc)[_0xbe14('0x1c')](function(_0x238c60){_0x172e79[_0xbe14('0x27')]=_0x238c60;if(_0x163ef7['query'][_0xbe14('0x48')]){_0x2bb45[_0xbe14('0x49')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xbe14('0x4a')](_0x2bb45);})[_0xbe14('0x1c')](function(_0x2d6ee8){_0x172e79[_0xbe14('0x4b')]=_0x2d6ee8;return _0x172e79;})['then'](respondWithFilteredResult(_0x393f6b,_0x2bb45))['catch'](handleError(_0x393f6b,null));};exports[_0xbe14('0x4c')]=function(_0x29564b,_0x4a1a37){var _0x5acf90={'raw':![],'where':{'id':_0x29564b[_0xbe14('0x4d')]['id']}},_0xca8cdb={};_0xca8cdb[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x34')][_0xbe14('0x35')]);_0xca8cdb[_0xbe14('0x38')]=_['keys'](_0x29564b[_0xbe14('0x38')]);_0xca8cdb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],_0xca8cdb[_0xbe14('0x38')]);_0x5acf90['attributes']=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x29564b[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x5acf90[_0xbe14('0x3c')]=_0x5acf90['attributes']['length']?_0x5acf90[_0xbe14('0x3c')]:_0xca8cdb[_0xbe14('0x3b')];if(_0x29564b[_0xbe14('0x38')]['includeAll']){_0x5acf90['include']=[{'all':!![]}];}_0x5acf90=_[_0xbe14('0x45')]({},_0x5acf90,_0x29564b[_0xbe14('0x47')]);return db['ZohoConfiguration'][_0xbe14('0x4f')](_0x5acf90)[_0xbe14('0x1c')](handleEntityNotFound(_0x4a1a37,null))['then'](respondWithResult(_0x4a1a37,null))[_0xbe14('0x50')](handleError(_0x4a1a37,null));};exports['create']=function(_0x41ba58,_0x410c59){return db[_0xbe14('0x34')]['create'](_0x41ba58[_0xbe14('0x51')],{})[_0xbe14('0x1c')](respondWithResult(_0x410c59,0xc9))['catch'](handleError(_0x410c59,null));};exports[_0xbe14('0x30')]=function(_0x42ca15,_0x2210cc){if(_0x42ca15[_0xbe14('0x51')]['id']){delete _0x42ca15[_0xbe14('0x51')]['id'];}return db['ZohoConfiguration'][_0xbe14('0x4f')]({'where':{'id':_0x42ca15[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x2210cc,null))[_0xbe14('0x1c')](saveUpdates(_0x42ca15[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x2210cc,null))[_0xbe14('0x50')](handleError(_0x2210cc,null));};exports['destroy']=function(_0x72c875,_0x1b47a4){return db[_0xbe14('0x34')][_0xbe14('0x4f')]({'where':{'id':_0x72c875[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x1b47a4,null))[_0xbe14('0x1c')](removeEntity(_0x1b47a4,null))[_0xbe14('0x50')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x52')]=function(_0xc61103,_0x358950,_0x4bccfc){var _0x56bcd3={};var _0x58dd79={};var _0x10c0bc;var _0x1bfcbf;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0xc61103[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x358950,null))[_0xbe14('0x1c')](function(_0x22bf69){if(_0x22bf69){_0x10c0bc=_0x22bf69;_0x58dd79[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x58dd79[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0xc61103[_0xbe14('0x38')]);_0x58dd79[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x58dd79[_0xbe14('0x3b')],_0x58dd79[_0xbe14('0x38')]);_0x56bcd3[_0xbe14('0x3c')]=_['intersection'](_0x58dd79[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x56bcd3[_0xbe14('0x3c')]=_0x56bcd3[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x56bcd3[_0xbe14('0x3c')]:_0x58dd79[_0xbe14('0x3b')];_0x56bcd3[_0xbe14('0x55')]=qs['sort'](_0xc61103[_0xbe14('0x38')][_0xbe14('0x41')]);_0x56bcd3[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0xc61103['query'],_0x58dd79[_0xbe14('0x39')]));if(_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]){_0x56bcd3[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x56bcd3['where'],{'$or':_[_0xbe14('0x33')](_0x56bcd3[_0xbe14('0x3c')],function(_0x7ea146){var _0x29bb26={};_0x29bb26[_0x7ea146]={'$like':'%'+_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x29bb26;})});}_0x56bcd3=_[_0xbe14('0x45')]({},_0x56bcd3,_0xc61103[_0xbe14('0x47')]);return _0x10c0bc['getFields'](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x33c309){if(_0x33c309){_0x1bfcbf=_0x33c309[_0xbe14('0x3e')];if(!_0xc61103[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x56bcd3[_0xbe14('0x29')]=qs['limit'](_0xc61103['query'][_0xbe14('0x29')]);_0x56bcd3[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x10c0bc[_0xbe14('0x52')](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x43511e){if(_0x43511e){return _0x43511e?{'count':_0x1bfcbf,'rows':_0x43511e}:null;}})['then'](respondWithResult(_0x358950,null))['catch'](handleError(_0x358950,null));};exports[_0xbe14('0x56')]=function(_0x1c18b6,_0x29aa52,_0x57729f){var _0x76e91e={};var _0x16bca1={};var _0x105be0;var _0x1797dd;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x1c18b6[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29aa52,null))[_0xbe14('0x1c')](function(_0x3b6ef5){if(_0x3b6ef5){_0x105be0=_0x3b6ef5;_0x16bca1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x16bca1[_0xbe14('0x38')]=_['keys'](_0x1c18b6[_0xbe14('0x38')]);_0x16bca1[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],_0x16bca1[_0xbe14('0x38')]);_0x76e91e[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],qs['fields'](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x76e91e[_0xbe14('0x3c')]=_0x76e91e[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x76e91e[_0xbe14('0x3c')]:_0x16bca1['model'];_0x76e91e[_0xbe14('0x55')]=qs[_0xbe14('0x41')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x41')]);_0x76e91e['where']=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x1c18b6[_0xbe14('0x38')],_0x16bca1[_0xbe14('0x39')]));if(_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]){_0x76e91e[_0xbe14('0x42')]=_['merge'](_0x76e91e[_0xbe14('0x42')],{'$or':_['map'](_0x76e91e[_0xbe14('0x3c')],function(_0x5d85d3){var _0x389822={};_0x389822[_0x5d85d3]={'$like':'%'+_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x389822;})});}_0x76e91e=_['merge']({},_0x76e91e,_0x1c18b6[_0xbe14('0x47')]);return _0x105be0[_0xbe14('0x56')](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x546f22){if(_0x546f22){_0x1797dd=_0x546f22[_0xbe14('0x3e')];if(!_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x76e91e['limit']=qs[_0xbe14('0x29')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x29')]);_0x76e91e[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x105be0['getSubjects'](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x123f4f){if(_0x123f4f){return _0x123f4f?{'count':_0x1797dd,'rows':_0x123f4f}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x29aa52,null))['catch'](handleError(_0x29aa52,null));};exports[_0xbe14('0x57')]=function(_0x420467,_0x1ea305,_0x5bc52b){var _0xa53262={};var _0x1205d1={};var _0x47d7bb;var _0x2be969;return db['ZohoConfiguration'][_0xbe14('0x53')]({'where':{'id':_0x420467[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ea305,null))['then'](function(_0x54045e){if(_0x54045e){_0x47d7bb=_0x54045e;_0x1205d1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db['ZohoField'][_0xbe14('0x35')]);_0x1205d1[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0x420467[_0xbe14('0x38')]);_0x1205d1['filters']=_['intersection'](_0x1205d1[_0xbe14('0x3b')],_0x1205d1[_0xbe14('0x38')]);_0xa53262[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x1205d1[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x420467[_0xbe14('0x38')]['fields']));_0xa53262[_0xbe14('0x3c')]=_0xa53262['attributes'][_0xbe14('0x3e')]?_0xa53262[_0xbe14('0x3c')]:_0x1205d1[_0xbe14('0x3b')];_0xa53262[_0xbe14('0x55')]=qs['sort'](_0x420467[_0xbe14('0x38')][_0xbe14('0x41')]);_0xa53262[_0xbe14('0x42')]=qs['filters'](_[_0xbe14('0x43')](_0x420467[_0xbe14('0x38')],_0x1205d1[_0xbe14('0x39')]));if(_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]){_0xa53262[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0xa53262[_0xbe14('0x42')],{'$or':_[_0xbe14('0x33')](_0xa53262[_0xbe14('0x3c')],function(_0x2bf94c){var _0x49497e={};_0x49497e[_0x2bf94c]={'$like':'%'+_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x49497e;})});}_0xa53262=_[_0xbe14('0x45')]({},_0xa53262,_0x420467[_0xbe14('0x47')]);return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x1679bd){if(_0x1679bd){_0x2be969=_0x1679bd[_0xbe14('0x3e')];if(!_0x420467['query'][_0xbe14('0x3f')]('nolimit')){_0xa53262[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x420467[_0xbe14('0x38')][_0xbe14('0x29')]);_0xa53262[_0xbe14('0x28')]=qs['offset'](_0x420467['query'][_0xbe14('0x28')]);}return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x42b849){if(_0x42b849){return _0x42b849?{'count':_0x2be969,'rows':_0x42b849}:null;}})['then'](respondWithResult(_0x1ea305,null))[_0xbe14('0x50')](handleError(_0x1ea305,null));}; \ No newline at end of file +var _0x9957=['result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','name','send','index','ZohoConfiguration','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','pick','filter','where','merge','type','options','includeAll','findAll','rows','show','params','find','create','body','getFields','findOne','ZohoField','sort','nolimit','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message'];(function(_0x1a1b70,_0x1f6ed2){var _0x15f9e4=function(_0x42bbde){while(--_0x42bbde){_0x1a1b70['push'](_0x1a1b70['shift']());}};_0x15f9e4(++_0x1f6ed2);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];var jayson=require(_0x7995('0x1a'));var client=jayson[_0x7995('0x1b')][_0x7995('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x281576,_0x23999f,_0x2bbe7a){if(_0x2bbe7a){var _0x4cc004=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4cc004['test'](_0x23999f)){return _0x281576;}else{throw new db[(_0x7995('0x1d'))][(_0x7995('0x1e'))](_0x7995('0x1f'));}}else{return _0x281576;}}function respondWithRpcPromise(_0x321ae8,_0x3f1d3e,_0x1a5310,_0x2202ce){return new BPromise(function(_0x41cbf0,_0x5377e5){var _0x2eeacc=_0x2202ce||client;return _0x2eeacc['request'](_0x321ae8,_0x1a5310)[_0x7995('0x20')](function(_0x37f297){logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));logger[_0x7995('0x24')]('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x3f1d3e,'request\x20sent',JSON[_0x7995('0x25')](_0x37f297));if(_0x37f297['error']){if(_0x37f297['error'][_0x7995('0x26')]===0x1f4){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x37f297[_0x7995('0x27')]['message']);return _0x5377e5(_0x37f297['error'][_0x7995('0x28')]);}logger[_0x7995('0x27')](_0x7995('0x22'),_0x3f1d3e,_0x37f297[_0x7995('0x27')][_0x7995('0x28')]);return _0x41cbf0(_0x37f297[_0x7995('0x27')]['message']);}else{logger[_0x7995('0x21')](_0x7995('0x22'),_0x3f1d3e,_0x7995('0x23'));_0x41cbf0(_0x37f297[_0x7995('0x29')][_0x7995('0x28')]);}})[_0x7995('0x2a')](function(_0x475351){logger[_0x7995('0x27')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f1d3e,_0x475351);_0x5377e5(_0x475351);});});}function respondWithStatusCode(_0x39df42,_0x34e70c){_0x34e70c=_0x34e70c||0xcc;return function(_0x401dc3){if(_0x401dc3){return _0x39df42[_0x7995('0x2b')](_0x34e70c);}return _0x39df42[_0x7995('0x2c')](_0x34e70c)[_0x7995('0x2d')]();};}function respondWithResult(_0x56691a,_0x47625f){_0x47625f=_0x47625f||0xc8;return function(_0x5911c3){if(_0x5911c3){return _0x56691a[_0x7995('0x2c')](_0x47625f)[_0x7995('0x2e')](_0x5911c3);}};}function respondWithFilteredResult(_0xf16cc2,_0x132a42){return function(_0x11c1eb){if(_0x11c1eb){var _0x4b6f99=_0x11c1eb[_0x7995('0x2f')],_0x9b2a15=_0x132a42[_0x7995('0x30')],_0x514445=_0x132a42['offset']+_0x132a42['limit'],_0x456a28;if(_0x514445>=_0x4b6f99){_0x514445=_0x4b6f99;_0x456a28=0xc8;}else{_0x456a28=0xce;}_0xf16cc2['status'](_0x456a28);return _0xf16cc2[_0x7995('0x31')](_0x7995('0x32'),_0x9b2a15+'-'+_0x514445+'/'+_0x4b6f99)[_0x7995('0x2e')](_0x11c1eb);}return null;};}function patchUpdates(_0x2b874d){return function(_0x2e3493){try{jsonpatch[_0x7995('0x33')](_0x2e3493,_0x2b874d,!![]);}catch(_0x538841){return BPromise['reject'](_0x538841);}return _0x2e3493[_0x7995('0x34')]();};}function saveUpdates(_0x5524af,_0x553671){return function(_0x3eb566){if(_0x3eb566){return _0x3eb566[_0x7995('0x35')](_0x5524af)[_0x7995('0x20')](function(_0x1f7d27){return _0x1f7d27;});}return null;};}function removeEntity(_0x510841,_0x44309d){return function(_0x33e24e){if(_0x33e24e){return _0x33e24e['destroy']()['then'](function(){_0x510841['status'](0xcc)[_0x7995('0x2d')]();});}};}function handleEntityNotFound(_0x3acfc3,_0x4a176f){return function(_0x3e7020){if(!_0x3e7020){_0x3acfc3['sendStatus'](0x194);}return _0x3e7020;};}function handleError(_0x37917b,_0x1cb058){_0x1cb058=_0x1cb058||0x1f4;return function(_0x177cb4){logger['error'](_0x177cb4['stack']);if(_0x177cb4[_0x7995('0x36')]){delete _0x177cb4['name'];}_0x37917b['status'](_0x1cb058)[_0x7995('0x37')](_0x177cb4);};}exports[_0x7995('0x38')]=function(_0x5212ff,_0x1baa15){var _0x1922b4={},_0x2b772f={},_0x18667c={'count':0x0,'rows':[]};var _0x1e3dbf=_['map'](db[_0x7995('0x39')][_0x7995('0x3a')],function(_0xf612e6){return{'name':_0xf612e6[_0x7995('0x3b')],'type':_0xf612e6['type'][_0x7995('0x3c')]};});_0x2b772f[_0x7995('0x3d')]=_[_0x7995('0x3e')](_0x1e3dbf,_0x7995('0x36'));_0x2b772f[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x5212ff['query']);_0x2b772f[_0x7995('0x41')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],_0x2b772f[_0x7995('0x3f')]);_0x1922b4[_0x7995('0x43')]=_[_0x7995('0x42')](_0x2b772f[_0x7995('0x3d')],qs[_0x7995('0x44')](_0x5212ff[_0x7995('0x3f')][_0x7995('0x44')]));_0x1922b4[_0x7995('0x43')]=_0x1922b4[_0x7995('0x43')][_0x7995('0x45')]?_0x1922b4['attributes']:_0x2b772f['model'];if(!_0x5212ff[_0x7995('0x3f')][_0x7995('0x46')]('nolimit')){_0x1922b4['limit']=qs[_0x7995('0x47')](_0x5212ff['query']['limit']);_0x1922b4[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x5212ff[_0x7995('0x3f')]['offset']);}_0x1922b4[_0x7995('0x48')]=qs['sort'](_0x5212ff[_0x7995('0x3f')]['sort']);_0x1922b4['where']=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x5212ff[_0x7995('0x3f')],_0x2b772f[_0x7995('0x41')]));if(_0x5212ff['query'][_0x7995('0x4a')]){_0x1922b4[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x1922b4[_0x7995('0x4b')],{'$or':_['map'](_0x1e3dbf,function(_0x5f28e7){if(_0x5f28e7[_0x7995('0x4d')]!=='VIRTUAL'){var _0x23c41d={};_0x23c41d[_0x5f28e7['name']]={'$like':'%'+_0x5212ff[_0x7995('0x3f')]['filter']+'%'};return _0x23c41d;}})});}_0x1922b4=_[_0x7995('0x4c')]({},_0x1922b4,_0x5212ff[_0x7995('0x4e')]);var _0x4d9245={'where':_0x1922b4[_0x7995('0x4b')]};return db[_0x7995('0x39')][_0x7995('0x2f')](_0x4d9245)[_0x7995('0x20')](function(_0x4c6837){_0x18667c[_0x7995('0x2f')]=_0x4c6837;if(_0x5212ff[_0x7995('0x3f')][_0x7995('0x4f')]){_0x1922b4['include']=[{'all':!![]}];}return db[_0x7995('0x39')][_0x7995('0x50')](_0x1922b4);})[_0x7995('0x20')](function(_0x3d8ae3){_0x18667c[_0x7995('0x51')]=_0x3d8ae3;return _0x18667c;})['then'](respondWithFilteredResult(_0x1baa15,_0x1922b4))[_0x7995('0x2a')](handleError(_0x1baa15,null));};exports[_0x7995('0x52')]=function(_0x5921b9,_0x3d1dbb){var _0x5843ba={'raw':![],'where':{'id':_0x5921b9[_0x7995('0x53')]['id']}},_0x1d87f9={};_0x1d87f9[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x39')][_0x7995('0x3a')]);_0x1d87f9[_0x7995('0x3f')]=_['keys'](_0x5921b9[_0x7995('0x3f')]);_0x1d87f9[_0x7995('0x41')]=_[_0x7995('0x42')](_0x1d87f9['model'],_0x1d87f9[_0x7995('0x3f')]);_0x5843ba[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1d87f9['model'],qs['fields'](_0x5921b9['query'][_0x7995('0x44')]));_0x5843ba[_0x7995('0x43')]=_0x5843ba['attributes'][_0x7995('0x45')]?_0x5843ba[_0x7995('0x43')]:_0x1d87f9[_0x7995('0x3d')];if(_0x5921b9[_0x7995('0x3f')][_0x7995('0x4f')]){_0x5843ba['include']=[{'all':!![]}];}_0x5843ba=_[_0x7995('0x4c')]({},_0x5843ba,_0x5921b9['options']);return db[_0x7995('0x39')][_0x7995('0x54')](_0x5843ba)[_0x7995('0x20')](handleEntityNotFound(_0x3d1dbb,null))['then'](respondWithResult(_0x3d1dbb,null))['catch'](handleError(_0x3d1dbb,null));};exports['create']=function(_0x563f8e,_0x2e13b0){return db[_0x7995('0x39')][_0x7995('0x55')](_0x563f8e[_0x7995('0x56')],{})[_0x7995('0x20')](respondWithResult(_0x2e13b0,0xc9))[_0x7995('0x2a')](handleError(_0x2e13b0,null));};exports[_0x7995('0x35')]=function(_0xda6ce8,_0x328671){if(_0xda6ce8[_0x7995('0x56')]['id']){delete _0xda6ce8[_0x7995('0x56')]['id'];}return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0xda6ce8[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x328671,null))[_0x7995('0x20')](saveUpdates(_0xda6ce8[_0x7995('0x56')],null))[_0x7995('0x20')](respondWithResult(_0x328671,null))[_0x7995('0x2a')](handleError(_0x328671,null));};exports['destroy']=function(_0x56a374,_0x630737){return db[_0x7995('0x39')][_0x7995('0x54')]({'where':{'id':_0x56a374['params']['id']}})['then'](handleEntityNotFound(_0x630737,null))[_0x7995('0x20')](removeEntity(_0x630737,null))[_0x7995('0x2a')](handleError(_0x630737,null));};exports[_0x7995('0x57')]=function(_0x332a85,_0x51c50b,_0x13cd7b){var _0x74ff38={};var _0xef5044={};var _0x33c49c;var _0x502d43;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x332a85[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x51c50b,null))[_0x7995('0x20')](function(_0x37072){if(_0x37072){_0x33c49c=_0x37072;_0xef5044[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0xef5044['query']=_[_0x7995('0x40')](_0x332a85[_0x7995('0x3f')]);_0xef5044[_0x7995('0x41')]=_[_0x7995('0x42')](_0xef5044['model'],_0xef5044['query']);_0x74ff38[_0x7995('0x43')]=_[_0x7995('0x42')](_0xef5044['model'],qs[_0x7995('0x44')](_0x332a85[_0x7995('0x3f')][_0x7995('0x44')]));_0x74ff38[_0x7995('0x43')]=_0x74ff38[_0x7995('0x43')]['length']?_0x74ff38[_0x7995('0x43')]:_0xef5044['model'];_0x74ff38[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x332a85[_0x7995('0x3f')][_0x7995('0x5a')]);_0x74ff38[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x332a85[_0x7995('0x3f')],_0xef5044[_0x7995('0x41')]));if(_0x332a85[_0x7995('0x3f')][_0x7995('0x4a')]){_0x74ff38[_0x7995('0x4b')]=_['merge'](_0x74ff38[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x74ff38[_0x7995('0x43')],function(_0xc2b660){var _0x2c6548={};_0x2c6548[_0xc2b660]={'$like':'%'+_0x332a85['query']['filter']+'%'};return _0x2c6548;})});}_0x74ff38=_[_0x7995('0x4c')]({},_0x74ff38,_0x332a85[_0x7995('0x4e')]);return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})[_0x7995('0x20')](function(_0x5aa2ec){if(_0x5aa2ec){_0x502d43=_0x5aa2ec[_0x7995('0x45')];if(!_0x332a85['query']['hasOwnProperty'](_0x7995('0x5b'))){_0x74ff38[_0x7995('0x47')]=qs[_0x7995('0x47')](_0x332a85[_0x7995('0x3f')][_0x7995('0x47')]);_0x74ff38[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x332a85[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x33c49c[_0x7995('0x57')](_0x74ff38);}})['then'](function(_0x2dc1f7){if(_0x2dc1f7){return _0x2dc1f7?{'count':_0x502d43,'rows':_0x2dc1f7}:null;}})[_0x7995('0x20')](respondWithResult(_0x51c50b,null))[_0x7995('0x2a')](handleError(_0x51c50b,null));};exports['getSubjects']=function(_0x1fe1cb,_0x1d2f9d,_0x705f0){var _0x3a7d9d={};var _0x3b0d30={};var _0x51ab1e;var _0x550a10;return db[_0x7995('0x39')][_0x7995('0x58')]({'where':{'id':_0x1fe1cb[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x1d2f9d,null))['then'](function(_0x5e8b4c){if(_0x5e8b4c){_0x51ab1e=_0x5e8b4c;_0x3b0d30[_0x7995('0x3d')]=_[_0x7995('0x40')](db[_0x7995('0x59')][_0x7995('0x3a')]);_0x3b0d30['query']=_[_0x7995('0x40')](_0x1fe1cb[_0x7995('0x3f')]);_0x3b0d30['filters']=_['intersection'](_0x3b0d30[_0x7995('0x3d')],_0x3b0d30[_0x7995('0x3f')]);_0x3a7d9d['attributes']=_[_0x7995('0x42')](_0x3b0d30['model'],qs[_0x7995('0x44')](_0x1fe1cb[_0x7995('0x3f')]['fields']));_0x3a7d9d['attributes']=_0x3a7d9d[_0x7995('0x43')]['length']?_0x3a7d9d[_0x7995('0x43')]:_0x3b0d30[_0x7995('0x3d')];_0x3a7d9d[_0x7995('0x48')]=qs[_0x7995('0x5a')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x5a')]);_0x3a7d9d[_0x7995('0x4b')]=qs[_0x7995('0x41')](_[_0x7995('0x49')](_0x1fe1cb[_0x7995('0x3f')],_0x3b0d30[_0x7995('0x41')]));if(_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]){_0x3a7d9d[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x3a7d9d[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x3a7d9d[_0x7995('0x43')],function(_0x2ff7ba){var _0xa2fc8e={};_0xa2fc8e[_0x2ff7ba]={'$like':'%'+_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x4a')]+'%'};return _0xa2fc8e;})});}_0x3a7d9d=_[_0x7995('0x4c')]({},_0x3a7d9d,_0x1fe1cb[_0x7995('0x4e')]);return _0x51ab1e[_0x7995('0x5c')](_0x3a7d9d);}})[_0x7995('0x20')](function(_0x2f7f51){if(_0x2f7f51){_0x550a10=_0x2f7f51[_0x7995('0x45')];if(!_0x1fe1cb['query'][_0x7995('0x46')](_0x7995('0x5b'))){_0x3a7d9d['limit']=qs['limit'](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x47')]);_0x3a7d9d[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x1fe1cb[_0x7995('0x3f')][_0x7995('0x30')]);}return _0x51ab1e['getSubjects'](_0x3a7d9d);}})[_0x7995('0x20')](function(_0xb68962){if(_0xb68962){return _0xb68962?{'count':_0x550a10,'rows':_0xb68962}:null;}})[_0x7995('0x20')](respondWithResult(_0x1d2f9d,null))[_0x7995('0x2a')](handleError(_0x1d2f9d,null));};exports[_0x7995('0x5d')]=function(_0x3f0bff,_0x151d99,_0xc93dcb){var _0x560095={};var _0x1c8e7d={};var _0x2b8217;var _0x5c04c9;return db['ZohoConfiguration'][_0x7995('0x58')]({'where':{'id':_0x3f0bff[_0x7995('0x53')]['id']}})[_0x7995('0x20')](handleEntityNotFound(_0x151d99,null))[_0x7995('0x20')](function(_0xe42797){if(_0xe42797){_0x2b8217=_0xe42797;_0x1c8e7d['model']=_[_0x7995('0x40')](db[_0x7995('0x59')]['rawAttributes']);_0x1c8e7d[_0x7995('0x3f')]=_[_0x7995('0x40')](_0x3f0bff['query']);_0x1c8e7d[_0x7995('0x41')]=_['intersection'](_0x1c8e7d[_0x7995('0x3d')],_0x1c8e7d[_0x7995('0x3f')]);_0x560095[_0x7995('0x43')]=_[_0x7995('0x42')](_0x1c8e7d[_0x7995('0x3d')],qs['fields'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x44')]));_0x560095[_0x7995('0x43')]=_0x560095['attributes'][_0x7995('0x45')]?_0x560095[_0x7995('0x43')]:_0x1c8e7d[_0x7995('0x3d')];_0x560095[_0x7995('0x48')]=qs['sort'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x5a')]);_0x560095[_0x7995('0x4b')]=qs['filters'](_['pick'](_0x3f0bff[_0x7995('0x3f')],_0x1c8e7d[_0x7995('0x41')]));if(_0x3f0bff['query']['filter']){_0x560095[_0x7995('0x4b')]=_[_0x7995('0x4c')](_0x560095[_0x7995('0x4b')],{'$or':_[_0x7995('0x3e')](_0x560095[_0x7995('0x43')],function(_0x551b5e){var _0x56003d={};_0x56003d[_0x551b5e]={'$like':'%'+_0x3f0bff[_0x7995('0x3f')]['filter']+'%'};return _0x56003d;})});}_0x560095=_['merge']({},_0x560095,_0x3f0bff[_0x7995('0x4e')]);return _0x2b8217[_0x7995('0x5d')](_0x560095);}})[_0x7995('0x20')](function(_0x5eb360){if(_0x5eb360){_0x5c04c9=_0x5eb360[_0x7995('0x45')];if(!_0x3f0bff[_0x7995('0x3f')][_0x7995('0x46')](_0x7995('0x5b'))){_0x560095[_0x7995('0x47')]=qs['limit'](_0x3f0bff[_0x7995('0x3f')][_0x7995('0x47')]);_0x560095[_0x7995('0x30')]=qs[_0x7995('0x30')](_0x3f0bff['query'][_0x7995('0x30')]);}return _0x2b8217[_0x7995('0x5d')](_0x560095);}})['then'](function(_0x310272){if(_0x310272){return _0x310272?{'count':_0x5c04c9,'rows':_0x310272}:null;}})[_0x7995('0x20')](respondWithResult(_0x151d99,null))['catch'](handleError(_0x151d99,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 964a76c..a612eb9 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 _0xa156=['exports','define','int_zoho_configurations','lodash','util','../../config/logger','rimraf','./intZohoConfiguration.attributes'];(function(_0x51ec33,_0x55ed9c){var _0x1a4a44=function(_0x3a5d30){while(--_0x3a5d30){_0x51ec33['push'](_0x51ec33['shift']());}};_0x1a4a44(++_0x55ed9c);}(_0xa156,0xeb));var _0x6a15=function(_0x43537d,_0x4cc8c9){_0x43537d=_0x43537d-0x0;var _0x4364a8=_0xa156[_0x43537d];return _0x4364a8;};'use strict';var _=require(_0x6a15('0x0'));var util=require(_0x6a15('0x1'));var logger=require(_0x6a15('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x6a15('0x3'));var config=require('../../config/environment');var attributes=require(_0x6a15('0x4'));module[_0x6a15('0x5')]=function(_0x432fa0,_0x46259c){return _0x432fa0[_0x6a15('0x6')]('ZohoConfiguration',attributes,{'tableName':_0x6a15('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3980=['ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','define'];(function(_0x1e3c16,_0x372caa){var _0x47a0c9=function(_0x47f81d){while(--_0x47f81d){_0x1e3c16['push'](_0x1e3c16['shift']());}};_0x47a0c9(++_0x372caa);}(_0x3980,0x161));var _0x0398=function(_0x528d10,_0xd52d64){_0x528d10=_0x528d10-0x0;var _0xf061ad=_0x3980[_0x528d10];return _0xf061ad;};'use strict';var _=require(_0x0398('0x0'));var util=require(_0x0398('0x1'));var logger=require(_0x0398('0x2'))('api');var moment=require(_0x0398('0x3'));var BPromise=require(_0x0398('0x4'));var rp=require(_0x0398('0x5'));var fs=require('fs');var path=require(_0x0398('0x6'));var rimraf=require(_0x0398('0x7'));var config=require(_0x0398('0x8'));var attributes=require(_0x0398('0x9'));module['exports']=function(_0x312bfd,_0x1e3cd6){return _0x312bfd[_0x0398('0xa')](_0x0398('0xb'),attributes,{'tableName':_0x0398('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 7e2e855..1d0ad8a 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 _0x74cc=['bluebird','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','moment'];(function(_0x4f6342,_0x1c54e5){var _0xbb2867=function(_0x39f231){while(--_0x39f231){_0x4f6342['push'](_0x4f6342['shift']());}};_0xbb2867(++_0x1c54e5);}(_0x74cc,0xc3));var _0xc74c=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x74cc[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xc74c('0x0'));var util=require(_0xc74c('0x1'));var moment=require(_0xc74c('0x2'));var BPromise=require(_0xc74c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc74c('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc74c('0x5'))('rpc');var config=require(_0xc74c('0x6'));var jayson=require(_0xc74c('0x7'));var client=jayson[_0xc74c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5c2dea,_0x1b7c10,_0x1f11ab){return new BPromise(function(_0x474ac6,_0xc097d0){return client[_0xc74c('0x9')](_0x5c2dea,_0x1f11ab)[_0xc74c('0xa')](function(_0x52cf54){logger[_0xc74c('0xb')](_0xc74c('0xc'),_0x1b7c10,_0xc74c('0xd'));logger['debug']('ZohoConfiguration,\x20%s,\x20%s,\x20%s',_0x1b7c10,_0xc74c('0xd'),JSON[_0xc74c('0xe')](_0x52cf54));if(_0x52cf54[_0xc74c('0xf')]){if(_0x52cf54['error']['code']===0x1f4){logger[_0xc74c('0xf')](_0xc74c('0xc'),_0x1b7c10,_0x52cf54[_0xc74c('0xf')]['message']);return _0xc097d0(_0x52cf54[_0xc74c('0xf')][_0xc74c('0x10')]);}logger[_0xc74c('0xf')](_0xc74c('0xc'),_0x1b7c10,_0x52cf54['error']['message']);return _0x474ac6(_0x52cf54[_0xc74c('0xf')][_0xc74c('0x10')]);}else{logger[_0xc74c('0xb')](_0xc74c('0xc'),_0x1b7c10,_0xc74c('0xd'));_0x474ac6(_0x52cf54[_0xc74c('0x11')][_0xc74c('0x10')]);}})['catch'](function(_0x53608b){logger['error'](_0xc74c('0xc'),_0x1b7c10,_0x53608b);_0xc097d0(_0x53608b);});});} \ No newline at end of file +var _0x35df=['debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x35df,0x109));var _0xf35d=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x35df[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xf35d('0x0'));var util=require('util');var moment=require(_0xf35d('0x1'));var BPromise=require('bluebird');var rs=require(_0xf35d('0x2'));var fs=require('fs');var Redis=require(_0xf35d('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf35d('0x4'));var logger=require(_0xf35d('0x5'))('rpc');var config=require(_0xf35d('0x6'));var jayson=require(_0xf35d('0x7'));var client=jayson[_0xf35d('0x8')][_0xf35d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xeff3be,_0x4f19b4,_0x1610d3){return new BPromise(function(_0x45f3e8,_0x120217){return client[_0xf35d('0xa')](_0xeff3be,_0x1610d3)[_0xf35d('0xb')](function(_0x2b2488){logger[_0xf35d('0xc')](_0xf35d('0xd'),_0x4f19b4,_0xf35d('0xe'));logger[_0xf35d('0xf')](_0xf35d('0x10'),_0x4f19b4,_0xf35d('0xe'),JSON['stringify'](_0x2b2488));if(_0x2b2488[_0xf35d('0x11')]){if(_0x2b2488[_0xf35d('0x11')]['code']===0x1f4){logger['error'](_0xf35d('0xd'),_0x4f19b4,_0x2b2488[_0xf35d('0x11')][_0xf35d('0x12')]);return _0x120217(_0x2b2488[_0xf35d('0x11')][_0xf35d('0x12')]);}logger[_0xf35d('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x4f19b4,_0x2b2488['error'][_0xf35d('0x12')]);return _0x45f3e8(_0x2b2488['error'][_0xf35d('0x12')]);}else{logger['info'](_0xf35d('0xd'),_0x4f19b4,'request\x20sent');_0x45f3e8(_0x2b2488[_0xf35d('0x13')]['message']);}})['catch'](function(_0x1c5d57){logger['error'](_0xf35d('0xd'),_0x4f19b4,_0x1c5d57);_0x120217(_0x1c5d57);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index f2f8b55..3a4888a 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 _0x627e=['show','post','create','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated'];(function(_0x2586cc,_0x2e97ca){var _0x1b0673=function(_0xca294a){while(--_0xca294a){_0x2586cc['push'](_0x2586cc['shift']());}};_0x1b0673(++_0x2e97ca);}(_0x627e,0x14a));var _0xe627=function(_0x1ad6da,_0x369f70){_0x1ad6da=_0x1ad6da-0x0;var _0x136dd1=_0x627e[_0x1ad6da];return _0x136dd1;};'use strict';var multer=require(_0xe627('0x0'));var util=require(_0xe627('0x1'));var path=require(_0xe627('0x2'));var timeout=require(_0xe627('0x3'));var express=require(_0xe627('0x4'));var router=express['Router']();var auth=require(_0xe627('0x5'));var interaction=require(_0xe627('0x6'));var config=require(_0xe627('0x7'));var controller=require('./intZohoField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xe627('0x8')]);router[_0xe627('0x9')](_0xe627('0xa'),auth[_0xe627('0xb')](),controller[_0xe627('0xc')]);router[_0xe627('0xd')]('/',auth['isAuthenticated'](),controller[_0xe627('0xe')]);router['put']('/:id',auth[_0xe627('0xb')](),controller[_0xe627('0xf')]);router['delete']('/:id',auth[_0xe627('0xb')](),controller[_0xe627('0x10')]);module[_0xe627('0x11')]=router; \ No newline at end of file +var _0xa30a=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','index','/:id','isAuthenticated','show','create','put','update','exports','multer'];(function(_0x2bb368,_0x4d133d){var _0x1a67d6=function(_0x53f85f){while(--_0x53f85f){_0x2bb368['push'](_0x2bb368['shift']());}};_0x1a67d6(++_0x4d133d);}(_0xa30a,0xd7));var _0xaa30=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa30a[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xaa30('0x0'));var util=require(_0xaa30('0x1'));var path=require(_0xaa30('0x2'));var timeout=require('connect-timeout');var express=require(_0xaa30('0x3'));var router=express[_0xaa30('0x4')]();var auth=require(_0xaa30('0x5'));var interaction=require(_0xaa30('0x6'));var config=require(_0xaa30('0x7'));var controller=require(_0xaa30('0x8'));router[_0xaa30('0x9')]('/',auth['isAuthenticated'](),controller[_0xaa30('0xa')]);router['get'](_0xaa30('0xb'),auth[_0xaa30('0xc')](),controller[_0xaa30('0xd')]);router['post']('/',auth[_0xaa30('0xc')](),controller[_0xaa30('0xe')]);router[_0xaa30('0xf')](_0xaa30('0xb'),auth[_0xaa30('0xc')](),controller[_0xaa30('0x10')]);router['delete']('/:id',auth[_0xaa30('0xc')](),controller['destroy']);module[_0xaa30('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index f4e762f..9ab8c2a 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 _0xa2ae=['customVariable','keyValue','STRING','ENUM','BOOLEAN','sequelize','exports','string','variable'];(function(_0x1fbda0,_0x3593ce){var _0xaba44f=function(_0x5d72f8){while(--_0x5d72f8){_0x1fbda0['push'](_0x1fbda0['shift']());}};_0xaba44f(++_0x3593ce);}(_0xa2ae,0x95));var _0xea2a=function(_0x366e75,_0x533d1d){_0x366e75=_0x366e75-0x0;var _0x3b167b=_0xa2ae[_0x366e75];return _0x3b167b;};'use strict';var Sequelize=require(_0xea2a('0x0'));module[_0xea2a('0x1')]={'type':{'type':Sequelize['ENUM'](_0xea2a('0x2'),_0xea2a('0x3'),_0xea2a('0x4'),_0xea2a('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0xea2a('0x6')]},'key':{'type':Sequelize[_0xea2a('0x6')]},'keyType':{'type':Sequelize[_0xea2a('0x7')](_0xea2a('0x2'),_0xea2a('0x3'),_0xea2a('0x4'))},'keyContent':{'type':Sequelize[_0xea2a('0x6')]},'idField':{'type':Sequelize[_0xea2a('0x6')]},'nameField':{'type':Sequelize[_0xea2a('0x6')]},'customField':{'type':Sequelize[_0xea2a('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xea2a('0x6')]}}; \ No newline at end of file +var _0x95f7=['exports','ENUM','string','variable','customVariable','STRING','sequelize'];(function(_0x425213,_0x5b0300){var _0x4c2ba2=function(_0x2bf696){while(--_0x2bf696){_0x425213['push'](_0x425213['shift']());}};_0x4c2ba2(++_0x5b0300);}(_0x95f7,0x68));var _0x795f=function(_0x4d03d7,_0x3d5289){_0x4d03d7=_0x4d03d7-0x0;var _0xbc1a62=_0x95f7[_0x4d03d7];return _0xbc1a62;};'use strict';var Sequelize=require(_0x795f('0x0'));module[_0x795f('0x1')]={'type':{'type':Sequelize[_0x795f('0x2')](_0x795f('0x3'),_0x795f('0x4'),_0x795f('0x5'),'keyValue'),'defaultValue':_0x795f('0x3')},'content':{'type':Sequelize[_0x795f('0x6')]},'key':{'type':Sequelize[_0x795f('0x6')]},'keyType':{'type':Sequelize[_0x795f('0x2')](_0x795f('0x3'),_0x795f('0x4'),_0x795f('0x5'))},'keyContent':{'type':Sequelize[_0x795f('0x6')]},'idField':{'type':Sequelize[_0x795f('0x6')]},'nameField':{'type':Sequelize[_0x795f('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x795f('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 8bd66d3..2448363 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 _0x9410=['count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','ZohoField','fieldName','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','merge','where','VIRTUAL','includeAll','include','catch','params','options','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x9410,0x151));var _0x0941=function(_0x46f052,_0x391626){_0x46f052=_0x46f052-0x0;var _0x4a5291=_0x9410[_0x46f052];return _0x4a5291;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0941('0x0'));var rimraf=require(_0x0941('0x1'));var zipdir=require(_0x0941('0x2'));var jsonpatch=require(_0x0941('0x3'));var rp=require('request-promise');var moment=require(_0x0941('0x4'));var BPromise=require(_0x0941('0x5'));var Mustache=require('mustache');var util=require(_0x0941('0x6'));var path=require(_0x0941('0x7'));var sox=require(_0x0941('0x8'));var csv=require(_0x0941('0x9'));var ejs=require(_0x0941('0xa'));var fs=require('fs');var _=require(_0x0941('0xb'));var squel=require(_0x0941('0xc'));var crypto=require(_0x0941('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x0941('0xe'));var toCsv=require('to-csv');var querystring=require(_0x0941('0xf'));var Papa=require(_0x0941('0x10'));var Redis=require(_0x0941('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x0941('0x12'));var as=require(_0x0941('0x13'));var hardwareService=require(_0x0941('0x14'));var logger=require(_0x0941('0x15'))(_0x0941('0x16'));var utils=require(_0x0941('0x17'));var config=require(_0x0941('0x18'));var db=require(_0x0941('0x19'))['db'];function respondWithStatusCode(_0x2d8c0f,_0x2d245b){_0x2d245b=_0x2d245b||0xcc;return function(_0x1da4bb){if(_0x1da4bb){return _0x2d8c0f[_0x0941('0x1a')](_0x2d245b);}return _0x2d8c0f[_0x0941('0x1b')](_0x2d245b)['end']();};}function respondWithResult(_0x4fa5d8,_0x41fd9c){_0x41fd9c=_0x41fd9c||0xc8;return function(_0x4ce6f5){if(_0x4ce6f5){return _0x4fa5d8[_0x0941('0x1b')](_0x41fd9c)['json'](_0x4ce6f5);}};}function respondWithFilteredResult(_0x55d70d,_0xcb8074){return function(_0x4375ec){if(_0x4375ec){var _0x3943cd=_0x4375ec[_0x0941('0x1c')],_0x23714f=_0xcb8074['offset'],_0x4e2096=_0xcb8074[_0x0941('0x1d')]+_0xcb8074[_0x0941('0x1e')],_0x105e8e;if(_0x4e2096>=_0x3943cd){_0x4e2096=_0x3943cd;_0x105e8e=0xc8;}else{_0x105e8e=0xce;}_0x55d70d[_0x0941('0x1b')](_0x105e8e);return _0x55d70d[_0x0941('0x1f')](_0x0941('0x20'),_0x23714f+'-'+_0x4e2096+'/'+_0x3943cd)[_0x0941('0x21')](_0x4375ec);}return null;};}function patchUpdates(_0x4a32db){return function(_0x406658){try{jsonpatch[_0x0941('0x22')](_0x406658,_0x4a32db,!![]);}catch(_0x5538b2){return BPromise[_0x0941('0x23')](_0x5538b2);}return _0x406658[_0x0941('0x24')]();};}function saveUpdates(_0x320e1c,_0x2ce432){return function(_0xe78336){if(_0xe78336){return _0xe78336[_0x0941('0x25')](_0x320e1c)[_0x0941('0x26')](function(_0x4abe1c){return _0x4abe1c;});}return null;};}function removeEntity(_0xd9d8fa,_0x1c0320){return function(_0x594c92){if(_0x594c92){return _0x594c92[_0x0941('0x27')]()['then'](function(){_0xd9d8fa[_0x0941('0x1b')](0xcc)[_0x0941('0x28')]();});}};}function handleEntityNotFound(_0x1ffda1,_0x2a786e){return function(_0x6b748a){if(!_0x6b748a){_0x1ffda1[_0x0941('0x1a')](0x194);}return _0x6b748a;};}function handleError(_0x134a91,_0x4eda9f){_0x4eda9f=_0x4eda9f||0x1f4;return function(_0xa06cf0){logger['error'](_0xa06cf0[_0x0941('0x29')]);if(_0xa06cf0['name']){delete _0xa06cf0[_0x0941('0x2a')];}_0x134a91['status'](_0x4eda9f)[_0x0941('0x2b')](_0xa06cf0);};}exports[_0x0941('0x2c')]=function(_0x372c71,_0x3ea43a){var _0x2ee1d1={},_0x24ebf8={},_0x3c4017={'count':0x0,'rows':[]};var _0x16ba3c=_['map'](db[_0x0941('0x2d')]['rawAttributes'],function(_0x5cb96c){return{'name':_0x5cb96c[_0x0941('0x2e')],'type':_0x5cb96c['type'][_0x0941('0x2f')]};});_0x24ebf8['model']=_[_0x0941('0x30')](_0x16ba3c,_0x0941('0x2a'));_0x24ebf8[_0x0941('0x31')]=_[_0x0941('0x32')](_0x372c71['query']);_0x24ebf8[_0x0941('0x33')]=_[_0x0941('0x34')](_0x24ebf8[_0x0941('0x35')],_0x24ebf8['query']);_0x2ee1d1[_0x0941('0x36')]=_['intersection'](_0x24ebf8['model'],qs[_0x0941('0x37')](_0x372c71[_0x0941('0x31')][_0x0941('0x37')]));_0x2ee1d1[_0x0941('0x36')]=_0x2ee1d1['attributes'][_0x0941('0x38')]?_0x2ee1d1[_0x0941('0x36')]:_0x24ebf8['model'];if(!_0x372c71['query'][_0x0941('0x39')](_0x0941('0x3a'))){_0x2ee1d1[_0x0941('0x1e')]=qs[_0x0941('0x1e')](_0x372c71[_0x0941('0x31')][_0x0941('0x1e')]);_0x2ee1d1['offset']=qs[_0x0941('0x1d')](_0x372c71[_0x0941('0x31')][_0x0941('0x1d')]);}_0x2ee1d1[_0x0941('0x3b')]=qs[_0x0941('0x3c')](_0x372c71[_0x0941('0x31')]['sort']);_0x2ee1d1['where']=qs['filters'](_[_0x0941('0x3d')](_0x372c71[_0x0941('0x31')],_0x24ebf8['filters']));if(_0x372c71[_0x0941('0x31')]['filter']){_0x2ee1d1['where']=_[_0x0941('0x3e')](_0x2ee1d1[_0x0941('0x3f')],{'$or':_[_0x0941('0x30')](_0x16ba3c,function(_0x2ec306){if(_0x2ec306['type']!==_0x0941('0x40')){var _0x325880={};_0x325880[_0x2ec306[_0x0941('0x2a')]]={'$like':'%'+_0x372c71['query']['filter']+'%'};return _0x325880;}})});}_0x2ee1d1=_[_0x0941('0x3e')]({},_0x2ee1d1,_0x372c71['options']);var _0x59b6a5={'where':_0x2ee1d1['where']};return db[_0x0941('0x2d')][_0x0941('0x1c')](_0x59b6a5)['then'](function(_0x4a9dad){_0x3c4017[_0x0941('0x1c')]=_0x4a9dad;if(_0x372c71[_0x0941('0x31')][_0x0941('0x41')]){_0x2ee1d1[_0x0941('0x42')]=[{'all':!![]}];}return db[_0x0941('0x2d')]['findAll'](_0x2ee1d1);})['then'](function(_0x131176){_0x3c4017['rows']=_0x131176;return _0x3c4017;})[_0x0941('0x26')](respondWithFilteredResult(_0x3ea43a,_0x2ee1d1))[_0x0941('0x43')](handleError(_0x3ea43a,null));};exports['show']=function(_0x194fe7,_0x59702e){var _0x360ba9={'raw':!![],'where':{'id':_0x194fe7[_0x0941('0x44')]['id']}},_0x4534bb={};_0x4534bb[_0x0941('0x35')]=_[_0x0941('0x32')](db['ZohoField']['rawAttributes']);_0x4534bb[_0x0941('0x31')]=_['keys'](_0x194fe7[_0x0941('0x31')]);_0x4534bb['filters']=_[_0x0941('0x34')](_0x4534bb['model'],_0x4534bb['query']);_0x360ba9[_0x0941('0x36')]=_['intersection'](_0x4534bb[_0x0941('0x35')],qs[_0x0941('0x37')](_0x194fe7[_0x0941('0x31')]['fields']));_0x360ba9[_0x0941('0x36')]=_0x360ba9['attributes']['length']?_0x360ba9[_0x0941('0x36')]:_0x4534bb['model'];if(_0x194fe7[_0x0941('0x31')][_0x0941('0x41')]){_0x360ba9[_0x0941('0x42')]=[{'all':!![]}];}_0x360ba9=_[_0x0941('0x3e')]({},_0x360ba9,_0x194fe7[_0x0941('0x45')]);return db[_0x0941('0x2d')]['find'](_0x360ba9)['then'](handleEntityNotFound(_0x59702e,null))['then'](respondWithResult(_0x59702e,null))[_0x0941('0x43')](handleError(_0x59702e,null));};exports[_0x0941('0x46')]=function(_0x355fb9,_0x5e8577){return db[_0x0941('0x2d')][_0x0941('0x46')](_0x355fb9[_0x0941('0x47')],{})[_0x0941('0x26')](respondWithResult(_0x5e8577,0xc9))[_0x0941('0x43')](handleError(_0x5e8577,null));};exports['update']=function(_0x442521,_0x59647a){if(_0x442521[_0x0941('0x47')]['id']){delete _0x442521['body']['id'];}return db['ZohoField'][_0x0941('0x48')]({'where':{'id':_0x442521[_0x0941('0x44')]['id']}})[_0x0941('0x26')](handleEntityNotFound(_0x59647a,null))[_0x0941('0x26')](saveUpdates(_0x442521[_0x0941('0x47')],null))['then'](respondWithResult(_0x59647a,null))[_0x0941('0x43')](handleError(_0x59647a,null));};exports[_0x0941('0x27')]=function(_0x3e2122,_0x573f0d){return db[_0x0941('0x2d')][_0x0941('0x48')]({'where':{'id':_0x3e2122['params']['id']}})[_0x0941('0x26')](handleEntityNotFound(_0x573f0d,null))[_0x0941('0x26')](removeEntity(_0x573f0d,null))['catch'](handleError(_0x573f0d,null));}; \ No newline at end of file +var _0xf429=['reject','save','update','then','destroy','error','name','send','index','ZohoField','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','merge','find','create','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range'];(function(_0x2bb53a,_0x2856a8){var _0x48ef51=function(_0x58f8be){while(--_0x58f8be){_0x2bb53a['push'](_0x2bb53a['shift']());}};_0x48ef51(++_0x2856a8);}(_0xf429,0x14a));var _0x9f42=function(_0x5a5276,_0x262d69){_0x5a5276=_0x5a5276-0x0;var _0x3e8ee2=_0xf429[_0x5a5276];return _0x3e8ee2;};'use strict';var pdf=require(_0x9f42('0x0'));var emlformat=require(_0x9f42('0x1'));var rimraf=require(_0x9f42('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9f42('0x3'));var rp=require(_0x9f42('0x4'));var moment=require('moment');var BPromise=require(_0x9f42('0x5'));var Mustache=require('mustache');var util=require(_0x9f42('0x6'));var path=require('path');var sox=require(_0x9f42('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9f42('0x8'));var squel=require(_0x9f42('0x9'));var crypto=require(_0x9f42('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x9f42('0xb'));var Papa=require(_0x9f42('0xc'));var Redis=require('ioredis');var authService=require(_0x9f42('0xd'));var qs=require(_0x9f42('0xe'));var as=require(_0x9f42('0xf'));var hardwareService=require(_0x9f42('0x10'));var logger=require('../../config/logger')(_0x9f42('0x11'));var utils=require(_0x9f42('0x12'));var config=require(_0x9f42('0x13'));var db=require(_0x9f42('0x14'))['db'];function respondWithStatusCode(_0x4d24fc,_0xdf7b00){_0xdf7b00=_0xdf7b00||0xcc;return function(_0x159d11){if(_0x159d11){return _0x4d24fc[_0x9f42('0x15')](_0xdf7b00);}return _0x4d24fc['status'](_0xdf7b00)[_0x9f42('0x16')]();};}function respondWithResult(_0xf45f20,_0x26beaf){_0x26beaf=_0x26beaf||0xc8;return function(_0x12dece){if(_0x12dece){return _0xf45f20[_0x9f42('0x17')](_0x26beaf)[_0x9f42('0x18')](_0x12dece);}};}function respondWithFilteredResult(_0x2588e0,_0x58902f){return function(_0x3c46f9){if(_0x3c46f9){var _0x17511c=_0x3c46f9[_0x9f42('0x19')],_0xc1f05e=_0x58902f[_0x9f42('0x1a')],_0x3e2e5a=_0x58902f['offset']+_0x58902f[_0x9f42('0x1b')],_0x36bb3a;if(_0x3e2e5a>=_0x17511c){_0x3e2e5a=_0x17511c;_0x36bb3a=0xc8;}else{_0x36bb3a=0xce;}_0x2588e0[_0x9f42('0x17')](_0x36bb3a);return _0x2588e0[_0x9f42('0x1c')](_0x9f42('0x1d'),_0xc1f05e+'-'+_0x3e2e5a+'/'+_0x17511c)['json'](_0x3c46f9);}return null;};}function patchUpdates(_0x14c79b){return function(_0x328ad1){try{jsonpatch['apply'](_0x328ad1,_0x14c79b,!![]);}catch(_0x493ff2){return BPromise[_0x9f42('0x1e')](_0x493ff2);}return _0x328ad1[_0x9f42('0x1f')]();};}function saveUpdates(_0x46487a,_0x1767d3){return function(_0x3a3abe){if(_0x3a3abe){return _0x3a3abe[_0x9f42('0x20')](_0x46487a)[_0x9f42('0x21')](function(_0x40db6b){return _0x40db6b;});}return null;};}function removeEntity(_0x857519,_0x4915df){return function(_0x112d99){if(_0x112d99){return _0x112d99[_0x9f42('0x22')]()[_0x9f42('0x21')](function(){_0x857519['status'](0xcc)[_0x9f42('0x16')]();});}};}function handleEntityNotFound(_0x47a33d,_0x39f19b){return function(_0x3d151c){if(!_0x3d151c){_0x47a33d[_0x9f42('0x15')](0x194);}return _0x3d151c;};}function handleError(_0x28bb7a,_0x10e1a2){_0x10e1a2=_0x10e1a2||0x1f4;return function(_0x1265c1){logger[_0x9f42('0x23')](_0x1265c1['stack']);if(_0x1265c1['name']){delete _0x1265c1[_0x9f42('0x24')];}_0x28bb7a['status'](_0x10e1a2)[_0x9f42('0x25')](_0x1265c1);};}exports[_0x9f42('0x26')]=function(_0x5b22e9,_0x491d33){var _0x3c50de={},_0x1cb81d={},_0x151216={'count':0x0,'rows':[]};var _0x7a5e01=_['map'](db[_0x9f42('0x27')][_0x9f42('0x28')],function(_0x41032e){return{'name':_0x41032e[_0x9f42('0x29')],'type':_0x41032e[_0x9f42('0x2a')]['key']};});_0x1cb81d[_0x9f42('0x2b')]=_['map'](_0x7a5e01,_0x9f42('0x24'));_0x1cb81d[_0x9f42('0x2c')]=_[_0x9f42('0x2d')](_0x5b22e9[_0x9f42('0x2c')]);_0x1cb81d[_0x9f42('0x2e')]=_[_0x9f42('0x2f')](_0x1cb81d[_0x9f42('0x2b')],_0x1cb81d[_0x9f42('0x2c')]);_0x3c50de[_0x9f42('0x30')]=_[_0x9f42('0x2f')](_0x1cb81d[_0x9f42('0x2b')],qs[_0x9f42('0x31')](_0x5b22e9['query']['fields']));_0x3c50de['attributes']=_0x3c50de[_0x9f42('0x30')][_0x9f42('0x32')]?_0x3c50de[_0x9f42('0x30')]:_0x1cb81d[_0x9f42('0x2b')];if(!_0x5b22e9[_0x9f42('0x2c')][_0x9f42('0x33')](_0x9f42('0x34'))){_0x3c50de[_0x9f42('0x1b')]=qs[_0x9f42('0x1b')](_0x5b22e9[_0x9f42('0x2c')]['limit']);_0x3c50de['offset']=qs[_0x9f42('0x1a')](_0x5b22e9['query'][_0x9f42('0x1a')]);}_0x3c50de[_0x9f42('0x35')]=qs[_0x9f42('0x36')](_0x5b22e9['query'][_0x9f42('0x36')]);_0x3c50de[_0x9f42('0x37')]=qs['filters'](_[_0x9f42('0x38')](_0x5b22e9['query'],_0x1cb81d[_0x9f42('0x2e')]));if(_0x5b22e9[_0x9f42('0x2c')][_0x9f42('0x39')]){_0x3c50de[_0x9f42('0x37')]=_['merge'](_0x3c50de[_0x9f42('0x37')],{'$or':_[_0x9f42('0x3a')](_0x7a5e01,function(_0x375e1e){if(_0x375e1e['type']!==_0x9f42('0x3b')){var _0x1d6953={};_0x1d6953[_0x375e1e['name']]={'$like':'%'+_0x5b22e9[_0x9f42('0x2c')]['filter']+'%'};return _0x1d6953;}})});}_0x3c50de=_['merge']({},_0x3c50de,_0x5b22e9[_0x9f42('0x3c')]);var _0x187e3f={'where':_0x3c50de[_0x9f42('0x37')]};return db['ZohoField'][_0x9f42('0x19')](_0x187e3f)['then'](function(_0x1cb5f1){_0x151216['count']=_0x1cb5f1;if(_0x5b22e9[_0x9f42('0x2c')][_0x9f42('0x3d')]){_0x3c50de[_0x9f42('0x3e')]=[{'all':!![]}];}return db['ZohoField'][_0x9f42('0x3f')](_0x3c50de);})['then'](function(_0x46ed8f){_0x151216[_0x9f42('0x40')]=_0x46ed8f;return _0x151216;})[_0x9f42('0x21')](respondWithFilteredResult(_0x491d33,_0x3c50de))[_0x9f42('0x41')](handleError(_0x491d33,null));};exports[_0x9f42('0x42')]=function(_0x1f6fb0,_0x507161){var _0x388619={'raw':!![],'where':{'id':_0x1f6fb0['params']['id']}},_0x591a10={};_0x591a10['model']=_[_0x9f42('0x2d')](db[_0x9f42('0x27')][_0x9f42('0x28')]);_0x591a10[_0x9f42('0x2c')]=_['keys'](_0x1f6fb0['query']);_0x591a10[_0x9f42('0x2e')]=_[_0x9f42('0x2f')](_0x591a10[_0x9f42('0x2b')],_0x591a10[_0x9f42('0x2c')]);_0x388619[_0x9f42('0x30')]=_[_0x9f42('0x2f')](_0x591a10[_0x9f42('0x2b')],qs['fields'](_0x1f6fb0['query'][_0x9f42('0x31')]));_0x388619[_0x9f42('0x30')]=_0x388619[_0x9f42('0x30')][_0x9f42('0x32')]?_0x388619[_0x9f42('0x30')]:_0x591a10[_0x9f42('0x2b')];if(_0x1f6fb0[_0x9f42('0x2c')][_0x9f42('0x3d')]){_0x388619[_0x9f42('0x3e')]=[{'all':!![]}];}_0x388619=_[_0x9f42('0x43')]({},_0x388619,_0x1f6fb0[_0x9f42('0x3c')]);return db[_0x9f42('0x27')][_0x9f42('0x44')](_0x388619)[_0x9f42('0x21')](handleEntityNotFound(_0x507161,null))[_0x9f42('0x21')](respondWithResult(_0x507161,null))[_0x9f42('0x41')](handleError(_0x507161,null));};exports['create']=function(_0x2ffdc4,_0x19c2fd){return db[_0x9f42('0x27')][_0x9f42('0x45')](_0x2ffdc4[_0x9f42('0x46')],{})[_0x9f42('0x21')](respondWithResult(_0x19c2fd,0xc9))[_0x9f42('0x41')](handleError(_0x19c2fd,null));};exports[_0x9f42('0x20')]=function(_0x50b6c8,_0x2b71e0){if(_0x50b6c8[_0x9f42('0x46')]['id']){delete _0x50b6c8[_0x9f42('0x46')]['id'];}return db['ZohoField'][_0x9f42('0x44')]({'where':{'id':_0x50b6c8[_0x9f42('0x47')]['id']}})[_0x9f42('0x21')](handleEntityNotFound(_0x2b71e0,null))[_0x9f42('0x21')](saveUpdates(_0x50b6c8[_0x9f42('0x46')],null))[_0x9f42('0x21')](respondWithResult(_0x2b71e0,null))[_0x9f42('0x41')](handleError(_0x2b71e0,null));};exports[_0x9f42('0x22')]=function(_0x4c3884,_0x5f3a1b){return db[_0x9f42('0x27')][_0x9f42('0x44')]({'where':{'id':_0x4c3884[_0x9f42('0x47')]['id']}})[_0x9f42('0x21')](handleEntityNotFound(_0x5f3a1b,null))[_0x9f42('0x21')](removeEntity(_0x5f3a1b,null))[_0x9f42('0x41')](handleError(_0x5f3a1b,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index dc44581..99583c1 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 _0x6f5b=['zoho_unique_index','idField','FieldId','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','ZohoField','int_zoho_fields'];(function(_0x5987b8,_0x2bf595){var _0x5884ed=function(_0x3c84c2){while(--_0x3c84c2){_0x5987b8['push'](_0x5987b8['shift']());}};_0x5884ed(++_0x2bf595);}(_0x6f5b,0xc6));var _0xb6f5=function(_0x29ad9f,_0x26ba4f){_0x29ad9f=_0x29ad9f-0x0;var _0xd746ee=_0x6f5b[_0x29ad9f];return _0xd746ee;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xb6f5('0x0'))(_0xb6f5('0x1'));var moment=require(_0xb6f5('0x2'));var BPromise=require(_0xb6f5('0x3'));var rp=require(_0xb6f5('0x4'));var fs=require('fs');var path=require(_0xb6f5('0x5'));var rimraf=require(_0xb6f5('0x6'));var config=require(_0xb6f5('0x7'));var attributes=require('./intZohoField.attributes');module[_0xb6f5('0x8')]=function(_0x39b2c2,_0x339fd7){return _0x39b2c2[_0xb6f5('0x9')](_0xb6f5('0xa'),attributes,{'tableName':_0xb6f5('0xb'),'paranoid':![],'indexes':[{'name':_0xb6f5('0xc'),'fields':[_0xb6f5('0xd'),_0xb6f5('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf340=['FieldId','api','moment','bluebird','request-promise','path','../../config/environment','./intZohoField.attributes','ZohoField','zoho_unique_index'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xf340,0x173));var _0x0f34=function(_0x32e235,_0x334782){_0x32e235=_0x32e235-0x0;var _0x16a687=_0xf340[_0x32e235];return _0x16a687;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0f34('0x0'));var moment=require(_0x0f34('0x1'));var BPromise=require(_0x0f34('0x2'));var rp=require(_0x0f34('0x3'));var fs=require('fs');var path=require(_0x0f34('0x4'));var rimraf=require('rimraf');var config=require(_0x0f34('0x5'));var attributes=require(_0x0f34('0x6'));module['exports']=function(_0x4c8d90,_0x4c92ba){return _0x4c8d90['define'](_0x0f34('0x7'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x0f34('0x8'),'fields':['idField',_0x0f34('0x9')],'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 f16c0a1..e5fd7ce 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 _0xbd50=['ZohoField,\x20%s,\x20%s','request\x20sent','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','request','then'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xbd50,0x196));var _0x0bd5=function(_0x542ce3,_0x4e833a){_0x542ce3=_0x542ce3-0x0;var _0x29b3f7=_0xbd50[_0x542ce3];return _0x29b3f7;};'use strict';var _=require(_0x0bd5('0x0'));var util=require(_0x0bd5('0x1'));var moment=require(_0x0bd5('0x2'));var BPromise=require('bluebird');var rs=require(_0x0bd5('0x3'));var fs=require('fs');var Redis=require(_0x0bd5('0x4'));var db=require(_0x0bd5('0x5'))['db'];var utils=require(_0x0bd5('0x6'));var logger=require(_0x0bd5('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0bd5('0x8')][_0x0bd5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc6cfa,_0x2c0db1,_0x1b99f3){return new BPromise(function(_0x5ebe64,_0x47e78d){return client[_0x0bd5('0xa')](_0xcc6cfa,_0x1b99f3)[_0x0bd5('0xb')](function(_0x259f4c){logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));logger['debug'](_0x0bd5('0xe'),_0x2c0db1,_0x0bd5('0xd'),JSON['stringify'](_0x259f4c));if(_0x259f4c[_0x0bd5('0xf')]){if(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x10')]===0x1f4){logger['error'](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);return _0x47e78d(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x259f4c[_0x0bd5('0xf')]['message']);return _0x5ebe64(_0x259f4c[_0x0bd5('0xf')][_0x0bd5('0x11')]);}else{logger['info'](_0x0bd5('0xc'),_0x2c0db1,_0x0bd5('0xd'));_0x5ebe64(_0x259f4c[_0x0bd5('0x12')][_0x0bd5('0x11')]);}})['catch'](function(_0x14f32c){logger[_0x0bd5('0xf')](_0x0bd5('0xc'),_0x2c0db1,_0x14f32c);_0x47e78d(_0x14f32c);});});} \ No newline at end of file +var _0xa630=['client','request','info','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','util','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3f2305,_0x3e7e25){var _0x5559ea=function(_0x33482f){while(--_0x33482f){_0x3f2305['push'](_0x3f2305['shift']());}};_0x5559ea(++_0x3e7e25);}(_0xa630,0xbe));var _0x0a63=function(_0x507647,_0x39eada){_0x507647=_0x507647-0x0;var _0x1e7cc6=_0xa630[_0x507647];return _0x1e7cc6;};'use strict';var _=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0a63('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a63('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x0a63('0x4'))(_0x0a63('0x5'));var config=require(_0x0a63('0x6'));var jayson=require(_0x0a63('0x7'));var client=jayson[_0x0a63('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2760b0,_0x3d5f0b,_0xc2dcd7){return new BPromise(function(_0x41d21d,_0x12a7df){return client[_0x0a63('0x9')](_0x2760b0,_0xc2dcd7)['then'](function(_0x688acd){logger[_0x0a63('0xa')](_0x0a63('0xb'),_0x3d5f0b,_0x0a63('0xc'));logger[_0x0a63('0xd')](_0x0a63('0xe'),_0x3d5f0b,_0x0a63('0xc'),JSON[_0x0a63('0xf')](_0x688acd));if(_0x688acd[_0x0a63('0x10')]){if(_0x688acd[_0x0a63('0x10')]['code']===0x1f4){logger[_0x0a63('0x10')](_0x0a63('0xb'),_0x3d5f0b,_0x688acd[_0x0a63('0x10')][_0x0a63('0x11')]);return _0x12a7df(_0x688acd['error'][_0x0a63('0x11')]);}logger['error'](_0x0a63('0xb'),_0x3d5f0b,_0x688acd[_0x0a63('0x10')][_0x0a63('0x11')]);return _0x41d21d(_0x688acd[_0x0a63('0x10')][_0x0a63('0x11')]);}else{logger[_0x0a63('0xa')](_0x0a63('0xb'),_0x3d5f0b,_0x0a63('0xc'));_0x41d21d(_0x688acd['result'][_0x0a63('0x11')]);}})['catch'](function(_0x282856){logger[_0x0a63('0x10')](_0x0a63('0xb'),_0x3d5f0b,_0x282856);_0x12a7df(_0x282856);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index 6815dbd..799efcb 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 _0x780d=['../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','../../components/auth/service'];(function(_0x1c2130,_0x2316dc){var _0x51847e=function(_0x22a85a){while(--_0x22a85a){_0x1c2130['push'](_0x1c2130['shift']());}};_0x51847e(++_0x2316dc);}(_0x780d,0xf3));var _0xd780=function(_0x510be4,_0x4aa94b){_0x510be4=_0x510be4-0x0;var _0x5cbaf5=_0x780d[_0x510be4];return _0x5cbaf5;};'use strict';var multer=require(_0xd780('0x0'));var util=require(_0xd780('0x1'));var path=require(_0xd780('0x2'));var timeout=require(_0xd780('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd780('0x4'));var interaction=require(_0xd780('0x5'));var config=require(_0xd780('0x6'));module[_0xd780('0x7')]=router; \ No newline at end of file +var _0x641d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer'];(function(_0x5743e3,_0x4a2aab){var _0x24d100=function(_0x10737c){while(--_0x10737c){_0x5743e3['push'](_0x5743e3['shift']());}};_0x24d100(++_0x4a2aab);}(_0x641d,0x182));var _0xd641=function(_0xdc1384,_0x1c8609){_0xdc1384=_0xdc1384-0x0;var _0x94183=_0x641d[_0xdc1384];return _0x94183;};'use strict';var multer=require(_0xd641('0x0'));var util=require(_0xd641('0x1'));var path=require(_0xd641('0x2'));var timeout=require(_0xd641('0x3'));var express=require(_0xd641('0x4'));var router=express[_0xd641('0x5')]();var auth=require(_0xd641('0x6'));var interaction=require(_0xd641('0x7'));var config=require(_0xd641('0x8'));module['exports']=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 8998714..4b8f6cb 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 _0x3dd9=['state','sequelize','exports','unique_name_and_version','STRING','app.js','INTEGER','BOOLEAN'];(function(_0x3d94c7,_0x1a151a){var _0x2cbc31=function(_0x2e74bc){while(--_0x2e74bc){_0x3d94c7['push'](_0x3d94c7['shift']());}};_0x2cbc31(++_0x1a151a);}(_0x3dd9,0x129));var _0x93dd=function(_0x40ee35,_0x449e20){_0x40ee35=_0x40ee35-0x0;var _0x23d3e1=_0x3dd9[_0x40ee35];return _0x23d3e1;};'use strict';var Sequelize=require(_0x93dd('0x0'));module[_0x93dd('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x93dd('0x2')},'version':{'type':Sequelize[_0x93dd('0x3')],'allowNull':![],'unique':_0x93dd('0x2')},'main':{'type':Sequelize[_0x93dd('0x3')],'defaultValue':_0x93dd('0x4')},'filename':{'type':Sequelize[_0x93dd('0x3')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x93dd('0x5')]},'active':{'type':Sequelize[_0x93dd('0x6')],'defaultValue':![]},'author':{'type':Sequelize[_0x93dd('0x3')]},'logo':{'type':Sequelize[_0x93dd('0x3')]},'state':{'type':Sequelize['STRING'],'unique':_0x93dd('0x7')},'description':{'type':Sequelize[_0x93dd('0x3')]},'title':{'type':Sequelize[_0x93dd('0x3')]},'remoteUri':{'type':Sequelize['STRING']},'link':{'type':Sequelize[_0x93dd('0x3')],'defaultValue':'#'}}; \ No newline at end of file +var _0xa1b3=['INTEGER','BOOLEAN','state','STRING','unique_name_and_version','app.js'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xa1b3,0xb1));var _0x3a1b=function(_0x426300,_0x35f393){_0x426300=_0x426300-0x0;var _0x17f5bd=_0xa1b3[_0x426300];return _0x17f5bd;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3a1b('0x0')],'allowNull':![],'unique':_0x3a1b('0x1')},'version':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x3a1b('0x1')},'main':{'type':Sequelize[_0x3a1b('0x0')],'defaultValue':_0x3a1b('0x2')},'filename':{'type':Sequelize['STRING']},'path':{'type':Sequelize[_0x3a1b('0x0')]},'type':{'type':Sequelize[_0x3a1b('0x0')]},'size':{'type':Sequelize[_0x3a1b('0x3')]},'active':{'type':Sequelize[_0x3a1b('0x4')],'defaultValue':![]},'author':{'type':Sequelize[_0x3a1b('0x0')]},'logo':{'type':Sequelize[_0x3a1b('0x0')]},'state':{'type':Sequelize['STRING'],'unique':_0x3a1b('0x5')},'description':{'type':Sequelize[_0x3a1b('0x0')]},'title':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x3a1b('0x0')]},'link':{'type':Sequelize[_0x3a1b('0x0')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 041437f..869b908 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 _0xb78a=['params','keys','includeAll','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','Integration','count','include','rows','catch','show'];(function(_0x1ab00e,_0x380733){var _0x9613d0=function(_0x3b2269){while(--_0x3b2269){_0x1ab00e['push'](_0x1ab00e['shift']());}};_0x9613d0(++_0x380733);}(_0xb78a,0xdb));var _0xab78=function(_0x63de62,_0xe5cc89){_0x63de62=_0x63de62-0x0;var _0x3daddf=_0xb78a[_0x63de62];return _0x3daddf;};'use strict';var pdf=require(_0xab78('0x0'));var emlformat=require(_0xab78('0x1'));var rimraf=require(_0xab78('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xab78('0x3'));var rp=require(_0xab78('0x4'));var moment=require('moment');var BPromise=require(_0xab78('0x5'));var Mustache=require(_0xab78('0x6'));var util=require(_0xab78('0x7'));var path=require('path');var sox=require(_0xab78('0x8'));var csv=require(_0xab78('0x9'));var ejs=require(_0xab78('0xa'));var fs=require('fs');var _=require(_0xab78('0xb'));var squel=require(_0xab78('0xc'));var crypto=require('crypto');var jsforce=require(_0xab78('0xd'));var deskjs=require(_0xab78('0xe'));var toCsv=require(_0xab78('0x9'));var querystring=require('querystring');var Papa=require(_0xab78('0xf'));var Redis=require('ioredis');var authService=require(_0xab78('0x10'));var qs=require(_0xab78('0x11'));var as=require(_0xab78('0x12'));var hardwareService=require(_0xab78('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xab78('0x14'));var config=require('../../config/environment');var db=require(_0xab78('0x15'))['db'];function respondWithStatusCode(_0x186e84,_0x5b40fd){_0x5b40fd=_0x5b40fd||0xcc;return function(_0x1f75eb){if(_0x1f75eb){return _0x186e84[_0xab78('0x16')](_0x5b40fd);}return _0x186e84[_0xab78('0x17')](_0x5b40fd)[_0xab78('0x18')]();};}function respondWithResult(_0x1cd8b4,_0x425ea1){_0x425ea1=_0x425ea1||0xc8;return function(_0x943d38){if(_0x943d38){return _0x1cd8b4['status'](_0x425ea1)['json'](_0x943d38);}};}function respondWithFilteredResult(_0x19a9ae,_0x2a16c3){return function(_0x5618fd){if(_0x5618fd){var _0x3708a5=_0x5618fd['count'],_0x56d500=_0x2a16c3[_0xab78('0x19')],_0x450d80=_0x2a16c3['offset']+_0x2a16c3[_0xab78('0x1a')],_0x2a342d;if(_0x450d80>=_0x3708a5){_0x450d80=_0x3708a5;_0x2a342d=0xc8;}else{_0x2a342d=0xce;}_0x19a9ae[_0xab78('0x17')](_0x2a342d);return _0x19a9ae[_0xab78('0x1b')](_0xab78('0x1c'),_0x56d500+'-'+_0x450d80+'/'+_0x3708a5)[_0xab78('0x1d')](_0x5618fd);}return null;};}function patchUpdates(_0x47f16b){return function(_0x1ab4fe){try{jsonpatch[_0xab78('0x1e')](_0x1ab4fe,_0x47f16b,!![]);}catch(_0x50399c){return BPromise[_0xab78('0x1f')](_0x50399c);}return _0x1ab4fe[_0xab78('0x20')]();};}function saveUpdates(_0x37c59a,_0xb2da2e){return function(_0x72aeae){if(_0x72aeae){return _0x72aeae[_0xab78('0x21')](_0x37c59a)[_0xab78('0x22')](function(_0xdd7da8){return _0xdd7da8;});}return null;};}function removeEntity(_0x4cf872,_0x5d4fda){return function(_0x20e4bc){if(_0x20e4bc){return _0x20e4bc[_0xab78('0x23')]()[_0xab78('0x22')](function(){_0x4cf872[_0xab78('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x578bd2,_0x577421){return function(_0x1d0b4b){if(!_0x1d0b4b){_0x578bd2[_0xab78('0x16')](0x194);}return _0x1d0b4b;};}function handleError(_0x46fb47,_0x2868f3){_0x2868f3=_0x2868f3||0x1f4;return function(_0x34add6){logger[_0xab78('0x24')](_0x34add6[_0xab78('0x25')]);if(_0x34add6['name']){delete _0x34add6[_0xab78('0x26')];}_0x46fb47[_0xab78('0x17')](_0x2868f3)['send'](_0x34add6);};}exports[_0xab78('0x27')]=function(_0x44b591,_0x248024){var _0x6021ee={},_0x2018df={},_0x22cd48={'count':0x0,'rows':[]};var _0x258cda=_[_0xab78('0x28')](db['Integration'][_0xab78('0x29')],function(_0x394a3){return{'name':_0x394a3['fieldName'],'type':_0x394a3['type']['key']};});_0x2018df[_0xab78('0x2a')]=_[_0xab78('0x28')](_0x258cda,'name');_0x2018df[_0xab78('0x2b')]=_['keys'](_0x44b591[_0xab78('0x2b')]);_0x2018df['filters']=_[_0xab78('0x2c')](_0x2018df[_0xab78('0x2a')],_0x2018df[_0xab78('0x2b')]);_0x6021ee[_0xab78('0x2d')]=_[_0xab78('0x2c')](_0x2018df['model'],qs[_0xab78('0x2e')](_0x44b591['query']['fields']));_0x6021ee[_0xab78('0x2d')]=_0x6021ee['attributes'][_0xab78('0x2f')]?_0x6021ee['attributes']:_0x2018df[_0xab78('0x2a')];if(!_0x44b591[_0xab78('0x2b')][_0xab78('0x30')](_0xab78('0x31'))){_0x6021ee['limit']=qs[_0xab78('0x1a')](_0x44b591[_0xab78('0x2b')][_0xab78('0x1a')]);_0x6021ee['offset']=qs[_0xab78('0x19')](_0x44b591['query'][_0xab78('0x19')]);}_0x6021ee[_0xab78('0x32')]=qs[_0xab78('0x33')](_0x44b591[_0xab78('0x2b')]['sort']);_0x6021ee[_0xab78('0x34')]=qs[_0xab78('0x35')](_[_0xab78('0x36')](_0x44b591['query'],_0x2018df['filters']));if(_0x44b591['query'][_0xab78('0x37')]){_0x6021ee[_0xab78('0x34')]=_[_0xab78('0x38')](_0x6021ee[_0xab78('0x34')],{'$or':_[_0xab78('0x28')](_0x258cda,function(_0x2db3b3){if(_0x2db3b3[_0xab78('0x39')]!=='VIRTUAL'){var _0xdccf50={};_0xdccf50[_0x2db3b3[_0xab78('0x26')]]={'$like':'%'+_0x44b591[_0xab78('0x2b')]['filter']+'%'};return _0xdccf50;}})});}_0x6021ee=_[_0xab78('0x38')]({},_0x6021ee,_0x44b591[_0xab78('0x3a')]);var _0x592a2c={'where':_0x6021ee[_0xab78('0x34')]};return db[_0xab78('0x3b')]['count'](_0x592a2c)[_0xab78('0x22')](function(_0x17fa83){_0x22cd48[_0xab78('0x3c')]=_0x17fa83;if(_0x44b591[_0xab78('0x2b')]['includeAll']){_0x6021ee[_0xab78('0x3d')]=[{'all':!![]}];}return db['Integration']['findAll'](_0x6021ee);})[_0xab78('0x22')](function(_0x3c531b){_0x22cd48[_0xab78('0x3e')]=_0x3c531b;return _0x22cd48;})[_0xab78('0x22')](respondWithFilteredResult(_0x248024,_0x6021ee))[_0xab78('0x3f')](handleError(_0x248024,null));};exports[_0xab78('0x40')]=function(_0x155f1b,_0x29ece5){var _0x2ac5eb={'raw':![],'where':{'id':_0x155f1b[_0xab78('0x41')]['id']}},_0x39555a={};_0x39555a[_0xab78('0x2a')]=_['keys'](db[_0xab78('0x3b')][_0xab78('0x29')]);_0x39555a[_0xab78('0x2b')]=_[_0xab78('0x42')](_0x155f1b[_0xab78('0x2b')]);_0x39555a[_0xab78('0x35')]=_[_0xab78('0x2c')](_0x39555a[_0xab78('0x2a')],_0x39555a[_0xab78('0x2b')]);_0x2ac5eb[_0xab78('0x2d')]=_[_0xab78('0x2c')](_0x39555a[_0xab78('0x2a')],qs[_0xab78('0x2e')](_0x155f1b[_0xab78('0x2b')][_0xab78('0x2e')]));_0x2ac5eb['attributes']=_0x2ac5eb[_0xab78('0x2d')]['length']?_0x2ac5eb[_0xab78('0x2d')]:_0x39555a[_0xab78('0x2a')];if(_0x155f1b[_0xab78('0x2b')][_0xab78('0x43')]){_0x2ac5eb[_0xab78('0x3d')]=[{'all':!![]}];}_0x2ac5eb=_[_0xab78('0x38')]({},_0x2ac5eb,_0x155f1b[_0xab78('0x3a')]);return db[_0xab78('0x3b')][_0xab78('0x44')](_0x2ac5eb)[_0xab78('0x22')](handleEntityNotFound(_0x29ece5,null))[_0xab78('0x22')](respondWithResult(_0x29ece5,null))[_0xab78('0x3f')](handleError(_0x29ece5,null));};exports[_0xab78('0x45')]=function(_0x5ce87f,_0x435cab){return db[_0xab78('0x3b')][_0xab78('0x45')](_0x5ce87f['body'],{})['then'](respondWithResult(_0x435cab,0xc9))[_0xab78('0x3f')](handleError(_0x435cab,null));};exports['update']=function(_0x5df1a0,_0x80bbeb){if(_0x5df1a0[_0xab78('0x46')]['id']){delete _0x5df1a0['body']['id'];}return db[_0xab78('0x3b')][_0xab78('0x44')]({'where':{'id':_0x5df1a0[_0xab78('0x41')]['id']}})['then'](handleEntityNotFound(_0x80bbeb,null))[_0xab78('0x22')](saveUpdates(_0x5df1a0[_0xab78('0x46')],null))['then'](respondWithResult(_0x80bbeb,null))[_0xab78('0x3f')](handleError(_0x80bbeb,null));};exports[_0xab78('0x23')]=function(_0x1b9822,_0x104cbd){return db[_0xab78('0x3b')][_0xab78('0x44')]({'where':{'id':_0x1b9822[_0xab78('0x41')]['id']}})['then'](handleEntityNotFound(_0x104cbd,null))['then'](removeEntity(_0x104cbd,null))[_0xab78('0x3f')](handleError(_0x104cbd,null));}; \ No newline at end of file +var _0x931b=['fields','length','hasOwnProperty','sort','pick','filter','where','merge','type','findAll','rows','show','params','keys','attributes','includeAll','include','options','catch','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','error','stack','name','map','Integration','rawAttributes','fieldName','key','model','query','filters','intersection'];(function(_0x2fe1e0,_0x4088da){var _0x32ef06=function(_0x57034a){while(--_0x57034a){_0x2fe1e0['push'](_0x2fe1e0['shift']());}};_0x32ef06(++_0x4088da);}(_0x931b,0x1b3));var _0xb931=function(_0x456abd,_0xf8f231){_0x456abd=_0x456abd-0x0;var _0x5357d1=_0x931b[_0x456abd];return _0x5357d1;};'use strict';var pdf=require(_0xb931('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb931('0x1'));var zipdir=require(_0xb931('0x2'));var jsonpatch=require(_0xb931('0x3'));var rp=require(_0xb931('0x4'));var moment=require(_0xb931('0x5'));var BPromise=require(_0xb931('0x6'));var Mustache=require(_0xb931('0x7'));var util=require('util');var path=require(_0xb931('0x8'));var sox=require(_0xb931('0x9'));var csv=require(_0xb931('0xa'));var ejs=require(_0xb931('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb931('0xc'));var jsforce=require(_0xb931('0xd'));var deskjs=require(_0xb931('0xe'));var toCsv=require(_0xb931('0xa'));var querystring=require('querystring');var Papa=require(_0xb931('0xf'));var Redis=require(_0xb931('0x10'));var authService=require(_0xb931('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb931('0x12'));var hardwareService=require(_0xb931('0x13'));var logger=require(_0xb931('0x14'))(_0xb931('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb931('0x16'))['db'];function respondWithStatusCode(_0x5a76a3,_0xae82ff){_0xae82ff=_0xae82ff||0xcc;return function(_0x407cb2){if(_0x407cb2){return _0x5a76a3[_0xb931('0x17')](_0xae82ff);}return _0x5a76a3[_0xb931('0x18')](_0xae82ff)[_0xb931('0x19')]();};}function respondWithResult(_0x4a3778,_0x1b528a){_0x1b528a=_0x1b528a||0xc8;return function(_0x29b9e3){if(_0x29b9e3){return _0x4a3778[_0xb931('0x18')](_0x1b528a)[_0xb931('0x1a')](_0x29b9e3);}};}function respondWithFilteredResult(_0xf2919d,_0x9ee05f){return function(_0x9dc5a0){if(_0x9dc5a0){var _0x381122=_0x9dc5a0[_0xb931('0x1b')],_0x56bad5=_0x9ee05f[_0xb931('0x1c')],_0x1df4b6=_0x9ee05f[_0xb931('0x1c')]+_0x9ee05f[_0xb931('0x1d')],_0x3bd871;if(_0x1df4b6>=_0x381122){_0x1df4b6=_0x381122;_0x3bd871=0xc8;}else{_0x3bd871=0xce;}_0xf2919d[_0xb931('0x18')](_0x3bd871);return _0xf2919d[_0xb931('0x1e')]('Content-Range',_0x56bad5+'-'+_0x1df4b6+'/'+_0x381122)[_0xb931('0x1a')](_0x9dc5a0);}return null;};}function patchUpdates(_0x29ae5e){return function(_0x1000aa){try{jsonpatch[_0xb931('0x1f')](_0x1000aa,_0x29ae5e,!![]);}catch(_0xe31039){return BPromise['reject'](_0xe31039);}return _0x1000aa[_0xb931('0x20')]();};}function saveUpdates(_0x73fa42,_0x26c99a){return function(_0x447960){if(_0x447960){return _0x447960[_0xb931('0x21')](_0x73fa42)[_0xb931('0x22')](function(_0x2dfe33){return _0x2dfe33;});}return null;};}function removeEntity(_0x1d5418,_0x285b53){return function(_0x3f69e3){if(_0x3f69e3){return _0x3f69e3[_0xb931('0x23')]()[_0xb931('0x22')](function(){_0x1d5418['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ec0ab,_0x535c7e){return function(_0x32a8ed){if(!_0x32a8ed){_0x4ec0ab[_0xb931('0x17')](0x194);}return _0x32a8ed;};}function handleError(_0x2be58b,_0x5c3d44){_0x5c3d44=_0x5c3d44||0x1f4;return function(_0x51394e){logger[_0xb931('0x24')](_0x51394e[_0xb931('0x25')]);if(_0x51394e['name']){delete _0x51394e[_0xb931('0x26')];}_0x2be58b['status'](_0x5c3d44)['send'](_0x51394e);};}exports['index']=function(_0x4ea6b6,_0x14aedc){var _0x3ab93e={},_0x3fc833={},_0x21789e={'count':0x0,'rows':[]};var _0x13743f=_[_0xb931('0x27')](db[_0xb931('0x28')][_0xb931('0x29')],function(_0x3a5ba8){return{'name':_0x3a5ba8[_0xb931('0x2a')],'type':_0x3a5ba8['type'][_0xb931('0x2b')]};});_0x3fc833[_0xb931('0x2c')]=_[_0xb931('0x27')](_0x13743f,'name');_0x3fc833[_0xb931('0x2d')]=_['keys'](_0x4ea6b6[_0xb931('0x2d')]);_0x3fc833[_0xb931('0x2e')]=_[_0xb931('0x2f')](_0x3fc833[_0xb931('0x2c')],_0x3fc833['query']);_0x3ab93e['attributes']=_[_0xb931('0x2f')](_0x3fc833[_0xb931('0x2c')],qs[_0xb931('0x30')](_0x4ea6b6[_0xb931('0x2d')][_0xb931('0x30')]));_0x3ab93e['attributes']=_0x3ab93e['attributes'][_0xb931('0x31')]?_0x3ab93e['attributes']:_0x3fc833[_0xb931('0x2c')];if(!_0x4ea6b6[_0xb931('0x2d')][_0xb931('0x32')]('nolimit')){_0x3ab93e[_0xb931('0x1d')]=qs[_0xb931('0x1d')](_0x4ea6b6['query']['limit']);_0x3ab93e[_0xb931('0x1c')]=qs['offset'](_0x4ea6b6[_0xb931('0x2d')][_0xb931('0x1c')]);}_0x3ab93e['order']=qs[_0xb931('0x33')](_0x4ea6b6[_0xb931('0x2d')][_0xb931('0x33')]);_0x3ab93e['where']=qs[_0xb931('0x2e')](_[_0xb931('0x34')](_0x4ea6b6[_0xb931('0x2d')],_0x3fc833[_0xb931('0x2e')]));if(_0x4ea6b6[_0xb931('0x2d')][_0xb931('0x35')]){_0x3ab93e[_0xb931('0x36')]=_[_0xb931('0x37')](_0x3ab93e['where'],{'$or':_[_0xb931('0x27')](_0x13743f,function(_0xfcbea8){if(_0xfcbea8[_0xb931('0x38')]!=='VIRTUAL'){var _0x345289={};_0x345289[_0xfcbea8[_0xb931('0x26')]]={'$like':'%'+_0x4ea6b6[_0xb931('0x2d')][_0xb931('0x35')]+'%'};return _0x345289;}})});}_0x3ab93e=_[_0xb931('0x37')]({},_0x3ab93e,_0x4ea6b6['options']);var _0x58da86={'where':_0x3ab93e[_0xb931('0x36')]};return db[_0xb931('0x28')][_0xb931('0x1b')](_0x58da86)[_0xb931('0x22')](function(_0x20aaed){_0x21789e[_0xb931('0x1b')]=_0x20aaed;if(_0x4ea6b6[_0xb931('0x2d')]['includeAll']){_0x3ab93e['include']=[{'all':!![]}];}return db[_0xb931('0x28')][_0xb931('0x39')](_0x3ab93e);})[_0xb931('0x22')](function(_0x29c75c){_0x21789e[_0xb931('0x3a')]=_0x29c75c;return _0x21789e;})['then'](respondWithFilteredResult(_0x14aedc,_0x3ab93e))['catch'](handleError(_0x14aedc,null));};exports[_0xb931('0x3b')]=function(_0x5d6798,_0x53a1d8){var _0x22da1f={'raw':![],'where':{'id':_0x5d6798[_0xb931('0x3c')]['id']}},_0x12e911={};_0x12e911['model']=_[_0xb931('0x3d')](db[_0xb931('0x28')][_0xb931('0x29')]);_0x12e911[_0xb931('0x2d')]=_[_0xb931('0x3d')](_0x5d6798[_0xb931('0x2d')]);_0x12e911[_0xb931('0x2e')]=_[_0xb931('0x2f')](_0x12e911['model'],_0x12e911[_0xb931('0x2d')]);_0x22da1f['attributes']=_[_0xb931('0x2f')](_0x12e911[_0xb931('0x2c')],qs['fields'](_0x5d6798['query'][_0xb931('0x30')]));_0x22da1f['attributes']=_0x22da1f[_0xb931('0x3e')][_0xb931('0x31')]?_0x22da1f[_0xb931('0x3e')]:_0x12e911[_0xb931('0x2c')];if(_0x5d6798[_0xb931('0x2d')][_0xb931('0x3f')]){_0x22da1f[_0xb931('0x40')]=[{'all':!![]}];}_0x22da1f=_['merge']({},_0x22da1f,_0x5d6798[_0xb931('0x41')]);return db[_0xb931('0x28')]['find'](_0x22da1f)[_0xb931('0x22')](handleEntityNotFound(_0x53a1d8,null))[_0xb931('0x22')](respondWithResult(_0x53a1d8,null))[_0xb931('0x42')](handleError(_0x53a1d8,null));};exports[_0xb931('0x43')]=function(_0x42e7cb,_0x10ba0d){return db[_0xb931('0x28')][_0xb931('0x43')](_0x42e7cb[_0xb931('0x44')],{})[_0xb931('0x22')](respondWithResult(_0x10ba0d,0xc9))[_0xb931('0x42')](handleError(_0x10ba0d,null));};exports[_0xb931('0x21')]=function(_0x32ee96,_0xe3dad0){if(_0x32ee96[_0xb931('0x44')]['id']){delete _0x32ee96['body']['id'];}return db[_0xb931('0x28')]['find']({'where':{'id':_0x32ee96['params']['id']}})['then'](handleEntityNotFound(_0xe3dad0,null))[_0xb931('0x22')](saveUpdates(_0x32ee96[_0xb931('0x44')],null))[_0xb931('0x22')](respondWithResult(_0xe3dad0,null))[_0xb931('0x42')](handleError(_0xe3dad0,null));};exports[_0xb931('0x23')]=function(_0x21371e,_0x30eb78){return db['Integration']['find']({'where':{'id':_0x21371e['params']['id']}})[_0xb931('0x22')](handleEntityNotFound(_0x30eb78,null))[_0xb931('0x22')](removeEntity(_0x30eb78,null))['catch'](handleError(_0x30eb78,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 89e0e8d..0476c5f 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 _0xc689=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./integration.attributes','exports','define','integrations','lodash','util'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xc689,0x112));var _0x9c68=function(_0x2bf466,_0x4929a5){_0x2bf466=_0x2bf466-0x0;var _0x856885=_0xc689[_0x2bf466];return _0x856885;};'use strict';var _=require(_0x9c68('0x0'));var util=require(_0x9c68('0x1'));var logger=require(_0x9c68('0x2'))('api');var moment=require(_0x9c68('0x3'));var BPromise=require(_0x9c68('0x4'));var rp=require(_0x9c68('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9c68('0x6'));var config=require(_0x9c68('0x7'));var attributes=require(_0x9c68('0x8'));module[_0x9c68('0x9')]=function(_0x27e28a,_0x4ef861){return _0x27e28a[_0x9c68('0xa')]('Integration',attributes,{'tableName':_0x9c68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0547=['exports','define','Integration','integrations','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x1b4b01,_0x43eb55){var _0x521446=function(_0x3767a4){while(--_0x3767a4){_0x1b4b01['push'](_0x1b4b01['shift']());}};_0x521446(++_0x43eb55);}(_0x0547,0x1c7));var _0x7054=function(_0x1b0e23,_0x591694){_0x1b0e23=_0x1b0e23-0x0;var _0x122c2c=_0x0547[_0x1b0e23];return _0x122c2c;};'use strict';var _=require('lodash');var util=require(_0x7054('0x0'));var logger=require(_0x7054('0x1'))(_0x7054('0x2'));var moment=require('moment');var BPromise=require(_0x7054('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7054('0x4'));var rimraf=require(_0x7054('0x5'));var config=require(_0x7054('0x6'));var attributes=require('./integration.attributes');module[_0x7054('0x7')]=function(_0x2ae6ab,_0x10241e){return _0x2ae6ab[_0x7054('0x8')](_0x7054('0x9'),attributes,{'tableName':_0x7054('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index f291101..cf428a3 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 _0xac31=['code','Integration,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x59f468,_0x67a096){var _0x296f40=function(_0x3660a7){while(--_0x3660a7){_0x59f468['push'](_0x59f468['shift']());}};_0x296f40(++_0x67a096);}(_0xac31,0xca));var _0x1ac3=function(_0x411076,_0x20a1eb){_0x411076=_0x411076-0x0;var _0x5f0310=_0xac31[_0x411076];return _0x5f0310;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var moment=require(_0x1ac3('0x2'));var BPromise=require(_0x1ac3('0x3'));var rs=require(_0x1ac3('0x4'));var fs=require('fs');var Redis=require(_0x1ac3('0x5'));var db=require(_0x1ac3('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x1ac3('0x7'))(_0x1ac3('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x1ac3('0x9')][_0x1ac3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bf9b1,_0x1be223,_0x157604){return new BPromise(function(_0x57893c,_0x2d17de){return client['request'](_0x2bf9b1,_0x157604)[_0x1ac3('0xb')](function(_0x40b64c){logger[_0x1ac3('0xc')]('Integration,\x20%s,\x20%s',_0x1be223,_0x1ac3('0xd'));logger[_0x1ac3('0xe')](_0x1ac3('0xf'),_0x1be223,_0x1ac3('0xd'),JSON[_0x1ac3('0x10')](_0x40b64c));if(_0x40b64c[_0x1ac3('0x11')]){if(_0x40b64c['error'][_0x1ac3('0x12')]===0x1f4){logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c[_0x1ac3('0x11')]['message']);return _0x2d17de(_0x40b64c[_0x1ac3('0x11')][_0x1ac3('0x14')]);}logger[_0x1ac3('0x11')](_0x1ac3('0x13'),_0x1be223,_0x40b64c['error'][_0x1ac3('0x14')]);return _0x57893c(_0x40b64c[_0x1ac3('0x11')]['message']);}else{logger[_0x1ac3('0xc')](_0x1ac3('0x13'),_0x1be223,_0x1ac3('0xd'));_0x57893c(_0x40b64c['result'][_0x1ac3('0x14')]);}})[_0x1ac3('0x15')](function(_0x23e6e9){logger['error'](_0x1ac3('0x13'),_0x1be223,_0x23e6e9);_0x2d17de(_0x23e6e9);});});} \ No newline at end of file +var _0x567c=['then','Integration,\x20%s,\x20%s','debug','Integration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x17da22,_0x2e7a3c){var _0x1de016=function(_0xe9da69){while(--_0xe9da69){_0x17da22['push'](_0x17da22['shift']());}};_0x1de016(++_0x2e7a3c);}(_0x567c,0x8d));var _0xc567=function(_0x31ba7f,_0x18ebdb){_0x31ba7f=_0x31ba7f-0x0;var _0x1c1afc=_0x567c[_0x31ba7f];return _0x1c1afc;};'use strict';var _=require(_0xc567('0x0'));var util=require(_0xc567('0x1'));var moment=require(_0xc567('0x2'));var BPromise=require(_0xc567('0x3'));var rs=require(_0xc567('0x4'));var fs=require('fs');var Redis=require(_0xc567('0x5'));var db=require(_0xc567('0x6'))['db'];var utils=require(_0xc567('0x7'));var logger=require(_0xc567('0x8'))(_0xc567('0x9'));var config=require(_0xc567('0xa'));var jayson=require(_0xc567('0xb'));var client=jayson[_0xc567('0xc')][_0xc567('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1622dd,_0x3467c1,_0x3e2aa9){return new BPromise(function(_0x181d6d,_0x2d5942){return client[_0xc567('0xe')](_0x1622dd,_0x3e2aa9)[_0xc567('0xf')](function(_0x3e8049){logger['info'](_0xc567('0x10'),_0x3467c1,'request\x20sent');logger[_0xc567('0x11')](_0xc567('0x12'),_0x3467c1,_0xc567('0x13'),JSON['stringify'](_0x3e8049));if(_0x3e8049[_0xc567('0x14')]){if(_0x3e8049['error'][_0xc567('0x15')]===0x1f4){logger[_0xc567('0x14')](_0xc567('0x10'),_0x3467c1,_0x3e8049[_0xc567('0x14')]['message']);return _0x2d5942(_0x3e8049[_0xc567('0x14')][_0xc567('0x16')]);}logger[_0xc567('0x14')]('Integration,\x20%s,\x20%s',_0x3467c1,_0x3e8049[_0xc567('0x14')][_0xc567('0x16')]);return _0x181d6d(_0x3e8049[_0xc567('0x14')]['message']);}else{logger[_0xc567('0x17')](_0xc567('0x10'),_0x3467c1,'request\x20sent');_0x181d6d(_0x3e8049[_0xc567('0x18')][_0xc567('0x16')]);}})[_0xc567('0x19')](function(_0x521588){logger[_0xc567('0x14')](_0xc567('0x10'),_0x3467c1,_0x521588);_0x2d5942(_0x521588);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 8e05c44..e3674c8 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 _0x0839=['put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','index','get','/describe','describe','/:id','isAuthenticated','post'];(function(_0x41688c,_0x14579d){var _0x459b18=function(_0x196344){while(--_0x196344){_0x41688c['push'](_0x41688c['shift']());}};_0x459b18(++_0x14579d);}(_0x0839,0x112));var _0x9083=function(_0x5eaed9,_0x4b01a9){_0x5eaed9=_0x5eaed9-0x0;var _0x53ff48=_0x0839[_0x5eaed9];return _0x53ff48;};'use strict';var multer=require(_0x9083('0x0'));var util=require(_0x9083('0x1'));var path=require(_0x9083('0x2'));var timeout=require(_0x9083('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9083('0x4'));var interaction=require(_0x9083('0x5'));var config=require('../../config/environment');var controller=require(_0x9083('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x9083('0x7')]);router[_0x9083('0x8')](_0x9083('0x9'),auth['isAuthenticated'](),controller[_0x9083('0xa')]);router[_0x9083('0x8')](_0x9083('0xb'),auth[_0x9083('0xc')](),controller['show']);router[_0x9083('0xd')]('/',auth[_0x9083('0xc')](),controller['create']);router[_0x9083('0xe')](_0x9083('0xb'),auth[_0x9083('0xc')](),controller[_0x9083('0xf')]);router[_0x9083('0x10')](_0x9083('0xb'),auth[_0x9083('0xc')](),controller['destroy']);module[_0x9083('0x11')]=router; \ No newline at end of file +var _0x6a45=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','create'];(function(_0x48cb33,_0x341582){var _0x1c6e88=function(_0x1dae94){while(--_0x1dae94){_0x48cb33['push'](_0x48cb33['shift']());}};_0x1c6e88(++_0x341582);}(_0x6a45,0x11e));var _0x56a4=function(_0x4a2264,_0x4d29d3){_0x4a2264=_0x4a2264-0x0;var _0x30b2c1=_0x6a45[_0x4a2264];return _0x30b2c1;};'use strict';var multer=require(_0x56a4('0x0'));var util=require(_0x56a4('0x1'));var path=require(_0x56a4('0x2'));var timeout=require(_0x56a4('0x3'));var express=require('express');var router=express[_0x56a4('0x4')]();var auth=require(_0x56a4('0x5'));var interaction=require(_0x56a4('0x6'));var config=require(_0x56a4('0x7'));var controller=require('./integrationReport.controller');router[_0x56a4('0x8')]('/',auth[_0x56a4('0x9')](),controller['index']);router[_0x56a4('0x8')]('/describe',auth[_0x56a4('0x9')](),controller['describe']);router[_0x56a4('0x8')](_0x56a4('0xa'),auth[_0x56a4('0x9')](),controller[_0x56a4('0xb')]);router[_0x56a4('0xc')]('/',auth[_0x56a4('0x9')](),controller[_0x56a4('0xd')]);router['put'](_0x56a4('0xa'),auth[_0x56a4('0x9')](),controller['update']);router['delete'](_0x56a4('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x56a4('0xe')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index a4abff2..3a69462 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 _0xd18c=['SENT','SENDING','FAILED','exports','STRING','DATE','INTEGER','BOOLEAN','TEXT','ENUM'];(function(_0x45e07a,_0x471cf8){var _0x13f675=function(_0x12ab67){while(--_0x12ab67){_0x45e07a['push'](_0x45e07a['shift']());}};_0x13f675(++_0x471cf8);}(_0xd18c,0x11b));var _0xcd18=function(_0x28ef4e,_0x202aa3){_0x28ef4e=_0x28ef4e-0x0;var _0x1aa097=_0xd18c[_0x28ef4e];return _0x1aa097;};'use strict';var Sequelize=require('sequelize');module[_0xcd18('0x0')]={'integration':{'type':Sequelize[_0xcd18('0x1')]},'eventChannel':{'type':Sequelize[_0xcd18('0x1')]},'exitStatus':{'type':Sequelize[_0xcd18('0x1')]},'ticketId':{'type':Sequelize[_0xcd18('0x1')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0xcd18('0x1')]},'uniqueid':{'type':Sequelize[_0xcd18('0x1')]},'calleridnum':{'type':Sequelize[_0xcd18('0x1')]},'calleridname':{'type':Sequelize[_0xcd18('0x1')]},'queue':{'type':Sequelize[_0xcd18('0x1')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'agentcalledAt':{'type':Sequelize[_0xcd18('0x2')]},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0xcd18('0x3')]},'agentcomplete':{'type':Sequelize[_0xcd18('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0xcd18('0x2')]},'talktime':{'type':Sequelize[_0xcd18('0x3')]},'agentacw':{'type':Sequelize[_0xcd18('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0xcd18('0x3')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize[_0xcd18('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0xcd18('0x2')]},'agentdump':{'type':Sequelize[_0xcd18('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0xcd18('0x2')]},'lastevent':{'type':Sequelize[_0xcd18('0x1')]},'channel':{'type':Sequelize[_0xcd18('0x1')]},'channelstate':{'type':Sequelize[_0xcd18('0x3')]},'channelstatedesc':{'type':Sequelize[_0xcd18('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xcd18('0x1')]},'context':{'type':Sequelize[_0xcd18('0x1')]},'exten':{'type':Sequelize[_0xcd18('0x1')]},'priority':{'type':Sequelize[_0xcd18('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize[_0xcd18('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0xcd18('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xcd18('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xcd18('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0xcd18('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xcd18('0x1')]},'destpriority':{'type':Sequelize[_0xcd18('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0xcd18('0x1')]},'inReplyTo':{'type':Sequelize['STRING']},'subject':{'type':Sequelize[_0xcd18('0x1')]},'from':{'type':Sequelize[_0xcd18('0x1')]},'to':{'type':Sequelize[_0xcd18('0x1')]},'cc':{'type':Sequelize[_0xcd18('0x1')]},'attachment':{'type':Sequelize[_0xcd18('0x5')]},'html':{'type':Sequelize[_0xcd18('0x5')]},'text':{'type':Sequelize['TEXT']},'status':{'type':Sequelize[_0xcd18('0x6')](_0xcd18('0x7'),_0xcd18('0x8'),'RECEIVED',_0xcd18('0x9'))},'url':{'type':Sequelize[_0xcd18('0x1')]},'app':{'type':Sequelize[_0xcd18('0x1')]},'appdata':{'type':Sequelize[_0xcd18('0x1')]},'projectId':{'type':Sequelize[_0xcd18('0x3')]}}; \ No newline at end of file +var _0x8bb0=['STRING','INTEGER','BOOLEAN','DATE','TEXT','SENT','sequelize','exports'];(function(_0x147f22,_0x3fb477){var _0x480aec=function(_0x42c78d){while(--_0x42c78d){_0x147f22['push'](_0x147f22['shift']());}};_0x480aec(++_0x3fb477);}(_0x8bb0,0x146));var _0x08bb=function(_0x351e06,_0x5657d4){_0x351e06=_0x351e06-0x0;var _0x1e85e4=_0x8bb0[_0x351e06];return _0x1e85e4;};'use strict';var Sequelize=require(_0x08bb('0x0'));module[_0x08bb('0x1')]={'integration':{'type':Sequelize['STRING']},'eventChannel':{'type':Sequelize[_0x08bb('0x2')]},'exitStatus':{'type':Sequelize[_0x08bb('0x2')]},'ticketId':{'type':Sequelize[_0x08bb('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x08bb('0x2')]},'uniqueid':{'type':Sequelize[_0x08bb('0x2')]},'calleridnum':{'type':Sequelize[_0x08bb('0x2')]},'calleridname':{'type':Sequelize[_0x08bb('0x2')]},'queue':{'type':Sequelize[_0x08bb('0x2')]},'interface':{'type':Sequelize[_0x08bb('0x2')]},'membername':{'type':Sequelize[_0x08bb('0x2')]},'agentcalledAt':{'type':Sequelize['DATE']},'agentconnectAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x08bb('0x3')]},'agentcomplete':{'type':Sequelize[_0x08bb('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize['DATE']},'talktime':{'type':Sequelize[_0x08bb('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x08bb('0x3')]},'reason':{'type':Sequelize[_0x08bb('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x08bb('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x08bb('0x5')]},'lastevent':{'type':Sequelize[_0x08bb('0x2')]},'channel':{'type':Sequelize[_0x08bb('0x2')]},'channelstate':{'type':Sequelize[_0x08bb('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x08bb('0x2')]},'language':{'type':Sequelize[_0x08bb('0x2')]},'accountcode':{'type':Sequelize[_0x08bb('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x08bb('0x2')]},'priority':{'type':Sequelize[_0x08bb('0x2')]},'destchannel':{'type':Sequelize[_0x08bb('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x08bb('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x08bb('0x2')]},'destlanguage':{'type':Sequelize[_0x08bb('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x08bb('0x2')]},'destuniqueid':{'type':Sequelize[_0x08bb('0x2')]},'messageId':{'type':Sequelize[_0x08bb('0x2')]},'inReplyTo':{'type':Sequelize[_0x08bb('0x2')]},'subject':{'type':Sequelize[_0x08bb('0x2')]},'from':{'type':Sequelize[_0x08bb('0x2')]},'to':{'type':Sequelize[_0x08bb('0x2')]},'cc':{'type':Sequelize[_0x08bb('0x2')]},'attachment':{'type':Sequelize[_0x08bb('0x6')]},'html':{'type':Sequelize[_0x08bb('0x6')]},'text':{'type':Sequelize[_0x08bb('0x6')]},'status':{'type':Sequelize['ENUM'](_0x08bb('0x7'),'SENDING','RECEIVED','FAILED')},'url':{'type':Sequelize[_0x08bb('0x2')]},'app':{'type':Sequelize[_0x08bb('0x2')]},'appdata':{'type':Sequelize[_0x08bb('0x2')]},'projectId':{'type':Sequelize[_0x08bb('0x3')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 32f8c3f..ea88d19 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 _0x4137=['attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','catch','show','params','keys','rawAttributes','length','includeAll','include','create','body','destroy','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','update','then','end','error','name','send','index','map','IntegrationReport','type','key','model','query','filters','intersection'];(function(_0x2a600a,_0x32d8b5){var _0x38e7fa=function(_0x1b50c5){while(--_0x1b50c5){_0x2a600a['push'](_0x2a600a['shift']());}};_0x38e7fa(++_0x32d8b5);}(_0x4137,0xf8));var _0x7413=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x4137[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require(_0x7413('0x0'));var emlformat=require(_0x7413('0x1'));var rimraf=require(_0x7413('0x2'));var zipdir=require(_0x7413('0x3'));var jsonpatch=require(_0x7413('0x4'));var rp=require(_0x7413('0x5'));var moment=require(_0x7413('0x6'));var BPromise=require(_0x7413('0x7'));var Mustache=require(_0x7413('0x8'));var util=require(_0x7413('0x9'));var path=require(_0x7413('0xa'));var sox=require(_0x7413('0xb'));var csv=require('to-csv');var ejs=require(_0x7413('0xc'));var fs=require('fs');var _=require(_0x7413('0xd'));var squel=require(_0x7413('0xe'));var crypto=require(_0x7413('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x7413('0x10'));var toCsv=require(_0x7413('0x11'));var querystring=require('querystring');var Papa=require(_0x7413('0x12'));var Redis=require(_0x7413('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x7413('0x14'));var as=require(_0x7413('0x15'));var hardwareService=require(_0x7413('0x16'));var logger=require(_0x7413('0x17'))(_0x7413('0x18'));var utils=require('../../config/utils');var config=require(_0x7413('0x19'));var db=require(_0x7413('0x1a'))['db'];function respondWithStatusCode(_0x4bf07d,_0x18a874){_0x18a874=_0x18a874||0xcc;return function(_0xa26ca4){if(_0xa26ca4){return _0x4bf07d[_0x7413('0x1b')](_0x18a874);}return _0x4bf07d['status'](_0x18a874)['end']();};}function respondWithResult(_0x55ef69,_0x2267f6){_0x2267f6=_0x2267f6||0xc8;return function(_0x336c4c){if(_0x336c4c){return _0x55ef69['status'](_0x2267f6)[_0x7413('0x1c')](_0x336c4c);}};}function respondWithFilteredResult(_0x45bef0,_0x4955d3){return function(_0x38b3d1){if(_0x38b3d1){var _0x50f301=_0x38b3d1[_0x7413('0x1d')],_0x4b9a5b=_0x4955d3['offset'],_0x26501b=_0x4955d3[_0x7413('0x1e')]+_0x4955d3[_0x7413('0x1f')],_0x568d1f;if(_0x26501b>=_0x50f301){_0x26501b=_0x50f301;_0x568d1f=0xc8;}else{_0x568d1f=0xce;}_0x45bef0[_0x7413('0x20')](_0x568d1f);return _0x45bef0[_0x7413('0x21')](_0x7413('0x22'),_0x4b9a5b+'-'+_0x26501b+'/'+_0x50f301)[_0x7413('0x1c')](_0x38b3d1);}return null;};}function patchUpdates(_0x51194e){return function(_0xecc3e){try{jsonpatch[_0x7413('0x23')](_0xecc3e,_0x51194e,!![]);}catch(_0x11f8a1){return BPromise[_0x7413('0x24')](_0x11f8a1);}return _0xecc3e['save']();};}function saveUpdates(_0x239d0e,_0x12d94d){return function(_0x206afc){if(_0x206afc){return _0x206afc[_0x7413('0x25')](_0x239d0e)[_0x7413('0x26')](function(_0x2d220f){return _0x2d220f;});}return null;};}function removeEntity(_0x4886e3,_0x4e18cb){return function(_0x56a06a){if(_0x56a06a){return _0x56a06a['destroy']()[_0x7413('0x26')](function(){_0x4886e3['status'](0xcc)[_0x7413('0x27')]();});}};}function handleEntityNotFound(_0x372944,_0x3b0c81){return function(_0x2fc0f4){if(!_0x2fc0f4){_0x372944[_0x7413('0x1b')](0x194);}return _0x2fc0f4;};}function handleError(_0x346ce8,_0x1d97fd){_0x1d97fd=_0x1d97fd||0x1f4;return function(_0x41cb5d){logger[_0x7413('0x28')](_0x41cb5d['stack']);if(_0x41cb5d['name']){delete _0x41cb5d[_0x7413('0x29')];}_0x346ce8['status'](_0x1d97fd)[_0x7413('0x2a')](_0x41cb5d);};}exports[_0x7413('0x2b')]=function(_0x463b21,_0x4c2e90){var _0x35e0fd={},_0x896552={},_0x79cab6={'count':0x0,'rows':[]};var _0x4843fd=_[_0x7413('0x2c')](db[_0x7413('0x2d')]['rawAttributes'],function(_0x24dce7){return{'name':_0x24dce7['fieldName'],'type':_0x24dce7[_0x7413('0x2e')][_0x7413('0x2f')]};});_0x896552[_0x7413('0x30')]=_[_0x7413('0x2c')](_0x4843fd,_0x7413('0x29'));_0x896552[_0x7413('0x31')]=_['keys'](_0x463b21[_0x7413('0x31')]);_0x896552[_0x7413('0x32')]=_[_0x7413('0x33')](_0x896552[_0x7413('0x30')],_0x896552[_0x7413('0x31')]);_0x35e0fd[_0x7413('0x34')]=_[_0x7413('0x33')](_0x896552['model'],qs[_0x7413('0x35')](_0x463b21[_0x7413('0x31')][_0x7413('0x35')]));_0x35e0fd[_0x7413('0x34')]=_0x35e0fd[_0x7413('0x34')]['length']?_0x35e0fd[_0x7413('0x34')]:_0x896552['model'];if(!_0x463b21[_0x7413('0x31')][_0x7413('0x36')](_0x7413('0x37'))){_0x35e0fd['limit']=qs[_0x7413('0x1f')](_0x463b21['query'][_0x7413('0x1f')]);_0x35e0fd[_0x7413('0x1e')]=qs['offset'](_0x463b21['query'][_0x7413('0x1e')]);}_0x35e0fd[_0x7413('0x38')]=qs[_0x7413('0x39')](_0x463b21['query']['sort']);_0x35e0fd[_0x7413('0x3a')]=qs['filters'](_['pick'](_0x463b21[_0x7413('0x31')],_0x896552['filters']));if(_0x463b21[_0x7413('0x31')][_0x7413('0x3b')]){_0x35e0fd[_0x7413('0x3a')]=_[_0x7413('0x3c')](_0x35e0fd[_0x7413('0x3a')],{'$or':_['map'](_0x4843fd,function(_0xa58bd2){if(_0xa58bd2[_0x7413('0x2e')]!==_0x7413('0x3d')){var _0xfa34ef={};_0xfa34ef[_0xa58bd2[_0x7413('0x29')]]={'$like':'%'+_0x463b21[_0x7413('0x31')][_0x7413('0x3b')]+'%'};return _0xfa34ef;}})});}_0x35e0fd=_[_0x7413('0x3c')]({},_0x35e0fd,_0x463b21[_0x7413('0x3e')]);var _0x26a241={'where':_0x35e0fd[_0x7413('0x3a')]};return db[_0x7413('0x2d')]['count'](_0x26a241)[_0x7413('0x26')](function(_0x4d854d){_0x79cab6['count']=_0x4d854d;if(_0x463b21['query']['includeAll']){_0x35e0fd['include']=[{'all':!![]}];}return db[_0x7413('0x2d')]['findAll'](_0x35e0fd);})['then'](function(_0x5dc077){_0x79cab6['rows']=_0x5dc077;return _0x79cab6;})['then'](respondWithFilteredResult(_0x4c2e90,_0x35e0fd))[_0x7413('0x3f')](handleError(_0x4c2e90,null));};exports[_0x7413('0x40')]=function(_0x18674c,_0x41ba22){var _0x8049c0={'raw':![],'where':{'id':_0x18674c[_0x7413('0x41')]['id']}},_0x57cb9e={};_0x57cb9e['model']=_[_0x7413('0x42')](db[_0x7413('0x2d')][_0x7413('0x43')]);_0x57cb9e[_0x7413('0x31')]=_[_0x7413('0x42')](_0x18674c[_0x7413('0x31')]);_0x57cb9e[_0x7413('0x32')]=_[_0x7413('0x33')](_0x57cb9e[_0x7413('0x30')],_0x57cb9e[_0x7413('0x31')]);_0x8049c0[_0x7413('0x34')]=_[_0x7413('0x33')](_0x57cb9e[_0x7413('0x30')],qs['fields'](_0x18674c[_0x7413('0x31')][_0x7413('0x35')]));_0x8049c0[_0x7413('0x34')]=_0x8049c0[_0x7413('0x34')][_0x7413('0x44')]?_0x8049c0[_0x7413('0x34')]:_0x57cb9e[_0x7413('0x30')];if(_0x18674c[_0x7413('0x31')][_0x7413('0x45')]){_0x8049c0[_0x7413('0x46')]=[{'all':!![]}];}_0x8049c0=_[_0x7413('0x3c')]({},_0x8049c0,_0x18674c['options']);return db[_0x7413('0x2d')]['find'](_0x8049c0)[_0x7413('0x26')](handleEntityNotFound(_0x41ba22,null))[_0x7413('0x26')](respondWithResult(_0x41ba22,null))[_0x7413('0x3f')](handleError(_0x41ba22,null));};exports[_0x7413('0x47')]=function(_0x479049,_0x148b69){return db[_0x7413('0x2d')][_0x7413('0x47')](_0x479049[_0x7413('0x48')],{})[_0x7413('0x26')](respondWithResult(_0x148b69,0xc9))['catch'](handleError(_0x148b69,null));};exports['update']=function(_0x3c1f1a,_0x520eb6){if(_0x3c1f1a['body']['id']){delete _0x3c1f1a[_0x7413('0x48')]['id'];}return db[_0x7413('0x2d')]['find']({'where':{'id':_0x3c1f1a[_0x7413('0x41')]['id']}})['then'](handleEntityNotFound(_0x520eb6,null))['then'](saveUpdates(_0x3c1f1a[_0x7413('0x48')],null))['then'](respondWithResult(_0x520eb6,null))[_0x7413('0x3f')](handleError(_0x520eb6,null));};exports[_0x7413('0x49')]=function(_0x1a7338,_0x5fe361){return db[_0x7413('0x2d')][_0x7413('0x4a')]({'where':{'id':_0x1a7338[_0x7413('0x41')]['id']}})[_0x7413('0x26')](handleEntityNotFound(_0x5fe361,null))[_0x7413('0x26')](removeEntity(_0x5fe361,null))[_0x7413('0x3f')](handleError(_0x5fe361,null));};exports['describe']=function(_0x369891,_0x501407){return db['IntegrationReport']['describe']()[_0x7413('0x26')](respondWithResult(_0x501407,null))[_0x7413('0x3f')](handleError(_0x501407,null));}; \ No newline at end of file +var _0x38b8=['papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','stack','name','send','index','fieldName','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','IntegrationReport','includeAll','findAll','rows','show','params','include','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','mustache','util','to-csv','ejs','squel','crypto','querystring'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x38b8,0x7f));var _0x838b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x38b8[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x838b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x838b('0x1'));var zipdir=require(_0x838b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x838b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x838b('0x4'));var util=require(_0x838b('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x838b('0x6'));var ejs=require(_0x838b('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x838b('0x8'));var crypto=require(_0x838b('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x838b('0x6'));var querystring=require(_0x838b('0xa'));var Papa=require(_0x838b('0xb'));var Redis=require('ioredis');var authService=require(_0x838b('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x838b('0xd'));var hardwareService=require(_0x838b('0xe'));var logger=require(_0x838b('0xf'))(_0x838b('0x10'));var utils=require(_0x838b('0x11'));var config=require(_0x838b('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3a57cf,_0x281764){_0x281764=_0x281764||0xcc;return function(_0x13fe8a){if(_0x13fe8a){return _0x3a57cf[_0x838b('0x13')](_0x281764);}return _0x3a57cf[_0x838b('0x14')](_0x281764)[_0x838b('0x15')]();};}function respondWithResult(_0xba19e4,_0x3324de){_0x3324de=_0x3324de||0xc8;return function(_0x1ddf43){if(_0x1ddf43){return _0xba19e4['status'](_0x3324de)[_0x838b('0x16')](_0x1ddf43);}};}function respondWithFilteredResult(_0x5497fd,_0x4e1085){return function(_0x584b04){if(_0x584b04){var _0x450b9b=_0x584b04[_0x838b('0x17')],_0x1da340=_0x4e1085['offset'],_0x100ee2=_0x4e1085[_0x838b('0x18')]+_0x4e1085[_0x838b('0x19')],_0x200652;if(_0x100ee2>=_0x450b9b){_0x100ee2=_0x450b9b;_0x200652=0xc8;}else{_0x200652=0xce;}_0x5497fd[_0x838b('0x14')](_0x200652);return _0x5497fd[_0x838b('0x1a')]('Content-Range',_0x1da340+'-'+_0x100ee2+'/'+_0x450b9b)[_0x838b('0x16')](_0x584b04);}return null;};}function patchUpdates(_0x2e606b){return function(_0x49f209){try{jsonpatch[_0x838b('0x1b')](_0x49f209,_0x2e606b,!![]);}catch(_0x46eedc){return BPromise['reject'](_0x46eedc);}return _0x49f209[_0x838b('0x1c')]();};}function saveUpdates(_0x268437,_0x432a75){return function(_0x4deb91){if(_0x4deb91){return _0x4deb91[_0x838b('0x1d')](_0x268437)[_0x838b('0x1e')](function(_0x119e4e){return _0x119e4e;});}return null;};}function removeEntity(_0x1a5241,_0x371082){return function(_0x3f8848){if(_0x3f8848){return _0x3f8848[_0x838b('0x1f')]()[_0x838b('0x1e')](function(){_0x1a5241[_0x838b('0x14')](0xcc)[_0x838b('0x15')]();});}};}function handleEntityNotFound(_0x2eecf9,_0xba76){return function(_0x451089){if(!_0x451089){_0x2eecf9[_0x838b('0x13')](0x194);}return _0x451089;};}function handleError(_0x485990,_0xb9b05f){_0xb9b05f=_0xb9b05f||0x1f4;return function(_0x59be76){logger['error'](_0x59be76[_0x838b('0x20')]);if(_0x59be76[_0x838b('0x21')]){delete _0x59be76[_0x838b('0x21')];}_0x485990['status'](_0xb9b05f)[_0x838b('0x22')](_0x59be76);};}exports[_0x838b('0x23')]=function(_0x47d239,_0x19fc7b){var _0x322e3f={},_0x59fa16={},_0x576bfa={'count':0x0,'rows':[]};var _0x58e739=_['map'](db['IntegrationReport']['rawAttributes'],function(_0x1e74a6){return{'name':_0x1e74a6[_0x838b('0x24')],'type':_0x1e74a6['type']['key']};});_0x59fa16[_0x838b('0x25')]=_[_0x838b('0x26')](_0x58e739,_0x838b('0x21'));_0x59fa16[_0x838b('0x27')]=_[_0x838b('0x28')](_0x47d239[_0x838b('0x27')]);_0x59fa16[_0x838b('0x29')]=_[_0x838b('0x2a')](_0x59fa16[_0x838b('0x25')],_0x59fa16['query']);_0x322e3f[_0x838b('0x2b')]=_[_0x838b('0x2a')](_0x59fa16[_0x838b('0x25')],qs[_0x838b('0x2c')](_0x47d239['query'][_0x838b('0x2c')]));_0x322e3f[_0x838b('0x2b')]=_0x322e3f[_0x838b('0x2b')][_0x838b('0x2d')]?_0x322e3f[_0x838b('0x2b')]:_0x59fa16['model'];if(!_0x47d239[_0x838b('0x27')][_0x838b('0x2e')](_0x838b('0x2f'))){_0x322e3f[_0x838b('0x19')]=qs['limit'](_0x47d239[_0x838b('0x27')][_0x838b('0x19')]);_0x322e3f['offset']=qs[_0x838b('0x18')](_0x47d239[_0x838b('0x27')][_0x838b('0x18')]);}_0x322e3f[_0x838b('0x30')]=qs[_0x838b('0x31')](_0x47d239['query'][_0x838b('0x31')]);_0x322e3f[_0x838b('0x32')]=qs['filters'](_[_0x838b('0x33')](_0x47d239['query'],_0x59fa16[_0x838b('0x29')]));if(_0x47d239['query'][_0x838b('0x34')]){_0x322e3f['where']=_[_0x838b('0x35')](_0x322e3f[_0x838b('0x32')],{'$or':_[_0x838b('0x26')](_0x58e739,function(_0x47460d){if(_0x47460d[_0x838b('0x36')]!==_0x838b('0x37')){var _0x5f62f={};_0x5f62f[_0x47460d[_0x838b('0x21')]]={'$like':'%'+_0x47d239[_0x838b('0x27')][_0x838b('0x34')]+'%'};return _0x5f62f;}})});}_0x322e3f=_['merge']({},_0x322e3f,_0x47d239[_0x838b('0x38')]);var _0x5e71d5={'where':_0x322e3f[_0x838b('0x32')]};return db[_0x838b('0x39')][_0x838b('0x17')](_0x5e71d5)[_0x838b('0x1e')](function(_0xaaa45c){_0x576bfa[_0x838b('0x17')]=_0xaaa45c;if(_0x47d239[_0x838b('0x27')][_0x838b('0x3a')]){_0x322e3f['include']=[{'all':!![]}];}return db[_0x838b('0x39')][_0x838b('0x3b')](_0x322e3f);})[_0x838b('0x1e')](function(_0x16787d){_0x576bfa[_0x838b('0x3c')]=_0x16787d;return _0x576bfa;})[_0x838b('0x1e')](respondWithFilteredResult(_0x19fc7b,_0x322e3f))['catch'](handleError(_0x19fc7b,null));};exports[_0x838b('0x3d')]=function(_0x5afe8b,_0x426ab3){var _0x3e67de={'raw':![],'where':{'id':_0x5afe8b[_0x838b('0x3e')]['id']}},_0x5639c9={};_0x5639c9[_0x838b('0x25')]=_[_0x838b('0x28')](db[_0x838b('0x39')]['rawAttributes']);_0x5639c9['query']=_[_0x838b('0x28')](_0x5afe8b[_0x838b('0x27')]);_0x5639c9['filters']=_[_0x838b('0x2a')](_0x5639c9['model'],_0x5639c9[_0x838b('0x27')]);_0x3e67de[_0x838b('0x2b')]=_[_0x838b('0x2a')](_0x5639c9[_0x838b('0x25')],qs[_0x838b('0x2c')](_0x5afe8b['query'][_0x838b('0x2c')]));_0x3e67de['attributes']=_0x3e67de[_0x838b('0x2b')]['length']?_0x3e67de[_0x838b('0x2b')]:_0x5639c9[_0x838b('0x25')];if(_0x5afe8b['query'][_0x838b('0x3a')]){_0x3e67de[_0x838b('0x3f')]=[{'all':!![]}];}_0x3e67de=_['merge']({},_0x3e67de,_0x5afe8b[_0x838b('0x38')]);return db['IntegrationReport'][_0x838b('0x40')](_0x3e67de)[_0x838b('0x1e')](handleEntityNotFound(_0x426ab3,null))['then'](respondWithResult(_0x426ab3,null))[_0x838b('0x41')](handleError(_0x426ab3,null));};exports['create']=function(_0x4d7336,_0x55f812){return db['IntegrationReport'][_0x838b('0x42')](_0x4d7336[_0x838b('0x43')],{})[_0x838b('0x1e')](respondWithResult(_0x55f812,0xc9))[_0x838b('0x41')](handleError(_0x55f812,null));};exports[_0x838b('0x1d')]=function(_0x1aaeb2,_0x5ebde7){if(_0x1aaeb2[_0x838b('0x43')]['id']){delete _0x1aaeb2['body']['id'];}return db[_0x838b('0x39')]['find']({'where':{'id':_0x1aaeb2[_0x838b('0x3e')]['id']}})[_0x838b('0x1e')](handleEntityNotFound(_0x5ebde7,null))[_0x838b('0x1e')](saveUpdates(_0x1aaeb2[_0x838b('0x43')],null))[_0x838b('0x1e')](respondWithResult(_0x5ebde7,null))['catch'](handleError(_0x5ebde7,null));};exports['destroy']=function(_0x3226a7,_0x3aa739){return db['IntegrationReport']['find']({'where':{'id':_0x3226a7[_0x838b('0x3e')]['id']}})[_0x838b('0x1e')](handleEntityNotFound(_0x3aa739,null))[_0x838b('0x1e')](removeEntity(_0x3aa739,null))[_0x838b('0x41')](handleError(_0x3aa739,null));};exports[_0x838b('0x44')]=function(_0x1a370e,_0xbef833){return db[_0x838b('0x39')][_0x838b('0x44')]()[_0x838b('0x1e')](respondWithResult(_0xbef833,null))['catch'](handleError(_0xbef833,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index a3ce6a8..c029670 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 _0xf0b0=['bluebird','path','rimraf','exports','define','IntegrationReport','lodash','../../config/logger','moment'];(function(_0x3d6785,_0x492ea3){var _0x39a624=function(_0x27d7db){while(--_0x27d7db){_0x3d6785['push'](_0x3d6785['shift']());}};_0x39a624(++_0x492ea3);}(_0xf0b0,0x189));var _0x0f0b=function(_0x4797d5,_0x263776){_0x4797d5=_0x4797d5-0x0;var _0x566217=_0xf0b0[_0x4797d5];return _0x566217;};'use strict';var _=require(_0x0f0b('0x0'));var util=require('util');var logger=require(_0x0f0b('0x1'))('api');var moment=require(_0x0f0b('0x2'));var BPromise=require(_0x0f0b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0f0b('0x4'));var rimraf=require(_0x0f0b('0x5'));var config=require('../../config/environment');var attributes=require('./integrationReport.attributes');module[_0x0f0b('0x6')]=function(_0x55c0d8,_0x199161){return _0x55c0d8[_0x0f0b('0x7')](_0x0f0b('0x8'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x46d6=['moment','rimraf','../../config/environment','exports','report_integration','lodash','api'];(function(_0x47adb8,_0x591ccc){var _0x4689a8=function(_0x2ba76f){while(--_0x2ba76f){_0x47adb8['push'](_0x47adb8['shift']());}};_0x4689a8(++_0x591ccc);}(_0x46d6,0x1b7));var _0x646d=function(_0x578615,_0x3032e6){_0x578615=_0x578615-0x0;var _0x566f83=_0x46d6[_0x578615];return _0x566f83;};'use strict';var _=require(_0x646d('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x646d('0x1'));var moment=require(_0x646d('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x646d('0x3'));var config=require(_0x646d('0x4'));var attributes=require('./integrationReport.attributes');module[_0x646d('0x5')]=function(_0x2a420c,_0x23ff71){return _0x2a420c['define']('IntegrationReport',attributes,{'tableName':_0x646d('0x6'),'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 0ff10ad..f42b585 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 _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(_0x318464,_0x3f65e3){var _0x479b68=function(_0xf3c07e){while(--_0xf3c07e){_0x318464['push'](_0x318464['shift']());}};_0x479b68(++_0x3f65e3);}(_0xb10b,0x12a));var _0xbb10=function(_0x2f1753,_0x458f6d){_0x2f1753=_0x2f1753-0x0;var _0x56a164=_0xb10b[_0x2f1753];return _0x56a164;};'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 _0xb7e7=['IntegrationReport,\x20%s,\x20%s','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x43fe10,_0x1def3e){var _0x5356c1=function(_0x142c84){while(--_0x142c84){_0x43fe10['push'](_0x43fe10['shift']());}};_0x5356c1(++_0x1def3e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0xb7e7[_0x173441];return _0x2423a8;};'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')]('IntegrationReport,\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);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index fdbe1f2..3eb422f 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 _0x3e74=['isAuthenticated','index','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./interval.controller','get'];(function(_0x3146da,_0x277a70){var _0x1070de=function(_0x43a1b1){while(--_0x43a1b1){_0x3146da['push'](_0x3146da['shift']());}};_0x1070de(++_0x277a70);}(_0x3e74,0x175));var _0x43e7=function(_0x170653,_0x5f5a0b){_0x170653=_0x170653-0x0;var _0x16e38e=_0x3e74[_0x170653];return _0x16e38e;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['getIntervals']);router[_0x43e7('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x43e7('0xb')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0xc')]);router['post'](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller['addIntervals']);router[_0x43e7('0xe')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file +var _0xedd9=['getIntervals','post','addInterval','addIntervals','put','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/sub_intervals'];(function(_0xbf62cb,_0x26a3b6){var _0x332301=function(_0x16a36c){while(--_0x16a36c){_0xbf62cb['push'](_0xbf62cb['shift']());}};_0x332301(++_0x26a3b6);}(_0xedd9,0xfc));var _0x9edd=function(_0xfa55b1,_0x54237e){_0xfa55b1=_0xfa55b1-0x0;var _0x526e8b=_0xedd9[_0xfa55b1];return _0x526e8b;};'use strict';var multer=require('multer');var util=require(_0x9edd('0x0'));var path=require(_0x9edd('0x1'));var timeout=require(_0x9edd('0x2'));var express=require(_0x9edd('0x3'));var router=express[_0x9edd('0x4')]();var auth=require(_0x9edd('0x5'));var interaction=require(_0x9edd('0x6'));var config=require(_0x9edd('0x7'));var controller=require('./interval.controller');router[_0x9edd('0x8')]('/',auth[_0x9edd('0x9')](),controller[_0x9edd('0xa')]);router[_0x9edd('0x8')]('/:id',auth[_0x9edd('0x9')](),controller['show']);router[_0x9edd('0x8')](_0x9edd('0xb'),auth[_0x9edd('0x9')](),controller[_0x9edd('0xc')]);router['post']('/',auth[_0x9edd('0x9')](),controller['create']);router[_0x9edd('0xd')](_0x9edd('0xb'),auth['isAuthenticated'](),controller[_0x9edd('0xe')]);router[_0x9edd('0xd')]('/:id/sub_intervals/create_many',auth[_0x9edd('0x9')](),controller[_0x9edd('0xf')]);router[_0x9edd('0x10')](_0x9edd('0x11'),auth[_0x9edd('0x9')](),controller[_0x9edd('0x12')]);router[_0x9edd('0x13')](_0x9edd('0x11'),auth['isAuthenticated'](),controller[_0x9edd('0x14')]);module[_0x9edd('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 e56ee9a..12973b5 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 _0xc613=['STRING','sequelize','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xc613,0xfd));var _0x3c61=function(_0x27c2f4,_0x437c7a){_0x27c2f4=_0x27c2f4-0x0;var _0x1231f8=_0xc613[_0x27c2f4];return _0x1231f8;};'use strict';var Sequelize=require(_0x3c61('0x0'));module[_0x3c61('0x1')]={'name':{'type':Sequelize[_0x3c61('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x3c61('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x02be=['exports','STRING'];(function(_0x373f26,_0x4a58fb){var _0x102aa3=function(_0x4a159e){while(--_0x4a159e){_0x373f26['push'](_0x373f26['shift']());}};_0x102aa3(++_0x4a58fb);}(_0x02be,0xfe));var _0xe02b=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x02be[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require('sequelize');module[_0xe02b('0x0')]={'name':{'type':Sequelize[_0xe02b('0x1')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xe02b('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index d245d40..f2b183b 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 _0xa9e0=['rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','pick','nolimit','addIntervals','findOne','transaction','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Intervals','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','count','include','findAll'];(function(_0x4c46b1,_0x9f9108){var _0x4b006e=function(_0x44612a){while(--_0x44612a){_0x4c46b1['push'](_0x4c46b1['shift']());}};_0x4b006e(++_0x9f9108);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];var extensions=require(_0x0a9e('0x14'));function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){var _0x30bae6=_0x3a02e1['get']({'plain':!![]});var _0xfb6e48=_0x0a9e('0x23');return db[_0x0a9e('0x24')][_0x0a9e('0x21')]({'where':{'type':_0xfb6e48,'resourceId':_0x30bae6['id']}})[_0x0a9e('0x22')](function(){return _0x3a02e1;});})[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x15')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x25')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x26')];}_0x33161b[_0x0a9e('0x17')](_0x526cf3)[_0x0a9e('0x27')](_0x384319);};}exports[_0x0a9e('0x28')]=function(_0x140511,_0x1538a4){var _0x11c3b6={},_0x14de77={},_0x5a101a={'count':0x0,'rows':[]};var _0x3652a7=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x2c')],'type':_0x5c877d[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x14de77[_0x0a9e('0x2f')]=_[_0x0a9e('0x29')](_0x3652a7,_0x0a9e('0x26'));_0x14de77[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x140511[_0x0a9e('0x30')]);_0x14de77['filters']=_[_0x0a9e('0x32')](_0x14de77['model'],_0x14de77[_0x0a9e('0x30')]);_0x11c3b6[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x14de77[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x140511['query'][_0x0a9e('0x34')]));_0x11c3b6[_0x0a9e('0x33')]=_0x11c3b6[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x11c3b6[_0x0a9e('0x33')]:_0x14de77[_0x0a9e('0x2f')];if(!_0x140511[_0x0a9e('0x30')][_0x0a9e('0x36')]('nolimit')){_0x11c3b6[_0x0a9e('0x1a')]=qs['limit'](_0x140511[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x11c3b6[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x140511['query'][_0x0a9e('0x19')]);}_0x11c3b6[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x140511[_0x0a9e('0x30')]['sort']);_0x11c3b6['where']=qs[_0x0a9e('0x39')](_['pick'](_0x140511[_0x0a9e('0x30')],_0x14de77[_0x0a9e('0x39')]));if(_0x140511[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x11c3b6['where']=_[_0x0a9e('0x3b')](_0x11c3b6[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x3652a7,function(_0x533942){if(_0x533942[_0x0a9e('0x2d')]!==_0x0a9e('0x3d')){var _0x289467={};_0x289467[_0x533942['name']]={'$like':'%'+_0x140511['query'][_0x0a9e('0x3a')]+'%'};return _0x289467;}})});}_0x11c3b6=_[_0x0a9e('0x3b')]({},_0x11c3b6,_0x140511['options']);var _0x2b814e={'where':_0x11c3b6[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x3e')](_0x2b814e)['then'](function(_0x5a594b){_0x5a101a[_0x0a9e('0x3e')]=_0x5a594b;if(_0x140511[_0x0a9e('0x30')]['includeAll']){_0x11c3b6[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x40')](_0x11c3b6);})['then'](function(_0x316c8f){_0x5a101a[_0x0a9e('0x41')]=_0x316c8f;return _0x5a101a;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x1538a4,_0x11c3b6))[_0x0a9e('0x42')](handleError(_0x1538a4,null));};exports[_0x0a9e('0x43')]=function(_0xeaa5e5,_0x2881b3){var _0x45a9b8={'raw':!![],'where':{'id':_0xeaa5e5[_0x0a9e('0x44')]['id']}},_0x23b089={};_0x23b089[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x23b089[_0x0a9e('0x30')]=_['keys'](_0xeaa5e5['query']);_0x23b089[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],_0x23b089[_0x0a9e('0x30')]);_0x45a9b8[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x45a9b8[_0x0a9e('0x33')]=_0x45a9b8[_0x0a9e('0x33')]['length']?_0x45a9b8[_0x0a9e('0x33')]:_0x23b089[_0x0a9e('0x2f')];if(_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x45a9b8[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45a9b8=_[_0x0a9e('0x3b')]({},_0x45a9b8,_0xeaa5e5[_0x0a9e('0x46')]);return db[_0x0a9e('0x2a')]['find'](_0x45a9b8)[_0x0a9e('0x22')](handleEntityNotFound(_0x2881b3,null))['then'](respondWithResult(_0x2881b3,null))[_0x0a9e('0x42')](handleError(_0x2881b3,null));};exports[_0x0a9e('0x47')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x8d6dd1[_0x0a9e('0x48')],{})[_0x0a9e('0x22')](function(_0x45c845){var _0x37be73=_0x8d6dd1[_0x0a9e('0x49')]['get']({'plain':!![]});if(!_0x37be73)throw new Error(_0x0a9e('0x4a'));if(_0x37be73[_0x0a9e('0x4b')]===_0x0a9e('0x49')){var _0x16f976=_0x45c845[_0x0a9e('0x4c')]({'plain':!![]});var _0x992c77=_0x0a9e('0x23');return db[_0x0a9e('0x4d')][_0x0a9e('0x4e')]({'where':{'name':_0x992c77,'userProfileId':_0x37be73['userProfileId']},'raw':!![]})[_0x0a9e('0x22')](function(_0x3fe430){if(_0x3fe430&&_0x3fe430['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16f976[_0x0a9e('0x26')],'resourceId':_0x16f976['id'],'type':_0x3fe430[_0x0a9e('0x26')],'sectionId':_0x3fe430['id']},{})[_0x0a9e('0x22')](function(){return _0x45c845;});}else{return _0x45c845;}})[_0x0a9e('0x42')](function(_0x61bb17){logger[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0x61bb17);throw _0x61bb17;});}return _0x45c845;})[_0x0a9e('0x22')](respondWithResult(_0x562fb4,0xc9))['catch'](handleError(_0x562fb4,null));};exports['update']=function(_0x53975a,_0x39d77d){if(_0x53975a[_0x0a9e('0x48')]['id']){delete _0x53975a[_0x0a9e('0x48')]['id'];}return db['Interval'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x48')],null))['then'](respondWithResult(_0x39d77d,null))[_0x0a9e('0x42')](handleError(_0x39d77d,null));};exports['destroy']=function(_0x2e5e62,_0x3c20b2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x2e5e62[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x3c20b2,null))['then'](removeEntity(_0x3c20b2,null))['catch'](handleError(_0x3c20b2,null));};exports[_0x0a9e('0x51')]=function(_0x3aedd0,_0x49c095,_0x145931){if(_0x3aedd0['body']['id']){delete _0x3aedd0[_0x0a9e('0x48')]['id'];}return db['Interval'][_0x0a9e('0x4e')]({'where':{'id':_0x3aedd0['params']['id']}})['then'](handleEntityNotFound(_0x49c095,null))['then'](function(_0x2da03c){if(_0x2da03c){_0x3aedd0['body'][_0x0a9e('0x52')]=_0x2da03c['id'];return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x3aedd0[_0x0a9e('0x48')]);}})[_0x0a9e('0x22')](respondWithResult(_0x49c095,null))[_0x0a9e('0x42')](handleError(_0x49c095,null));};exports[_0x0a9e('0x53')]=function(_0x28d814,_0x4e67ab,_0x1c693e){var _0x121cef={};var _0x2642bb={};var _0x30c491;var _0xb83dfd;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x28d814[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4e67ab,null))['then'](function(_0x3649cc){if(_0x3649cc){_0x30c491=_0x3649cc;_0x2642bb['model']=_[_0x0a9e('0x31')](db['Interval']['rawAttributes']);_0x2642bb['query']=_[_0x0a9e('0x31')](_0x28d814['query']);_0x2642bb[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x2642bb[_0x0a9e('0x2f')],_0x2642bb[_0x0a9e('0x30')]);_0x121cef[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x2642bb['model'],qs[_0x0a9e('0x34')](_0x28d814['query'][_0x0a9e('0x34')]));_0x121cef[_0x0a9e('0x33')]=_0x121cef[_0x0a9e('0x33')]['length']?_0x121cef[_0x0a9e('0x33')]:_0x2642bb[_0x0a9e('0x2f')];_0x121cef[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x28d814['query'][_0x0a9e('0x38')]);_0x121cef[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x54')](_0x28d814[_0x0a9e('0x30')],_0x2642bb[_0x0a9e('0x39')]));if(_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x121cef['where']=_[_0x0a9e('0x3b')](_0x121cef[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x121cef['attributes'],function(_0x3528b7){var _0x4f1e60={};_0x4f1e60[_0x3528b7]={'$like':'%'+_0x28d814['query'][_0x0a9e('0x3a')]+'%'};return _0x4f1e60;})});}_0x121cef=_[_0x0a9e('0x3b')]({},_0x121cef,_0x28d814[_0x0a9e('0x46')]);return _0x30c491[_0x0a9e('0x53')](_0x121cef);}})[_0x0a9e('0x22')](function(_0xc8c264){if(_0xc8c264){_0xb83dfd=_0xc8c264[_0x0a9e('0x35')];if(!_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x55'))){_0x121cef[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x121cef[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x19')]);}return _0x30c491['getIntervals'](_0x121cef);}})[_0x0a9e('0x22')](function(_0x295763){if(_0x295763){return _0x295763?{'count':_0xb83dfd,'rows':_0x295763}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x4e67ab,null))['catch'](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x56')]=function(_0x30944e,_0x4b341d,_0x83f0b2){return db[_0x0a9e('0x2a')][_0x0a9e('0x57')]({'where':{'id':_0x30944e[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4b341d,null))['then'](function(_0x50cdce){if(_0x50cdce){return db['sequelize'][_0x0a9e('0x58')](function(_0x18bf5d){return db[_0x0a9e('0x2a')][_0x0a9e('0x21')]({'where':{'IntervalId':_0x30944e[_0x0a9e('0x44')]['id']},'transaction':_0x18bf5d})[_0x0a9e('0x22')](function(_0xeef20){var _0x1a0677=_['map'](_0x30944e[_0x0a9e('0x48')],function(_0xcbc8b2){delete _0xcbc8b2['id'];_0xcbc8b2[_0x0a9e('0x52')]=_0x30944e['params']['id'];return _0xcbc8b2;});return db[_0x0a9e('0x2a')]['bulkCreate'](_0x1a0677,{'transaction':_0x18bf5d});});})[_0x0a9e('0x22')](function(){return db[_0x0a9e('0x2a')]['findAll']({'where':{'IntervalId':_0x30944e[_0x0a9e('0x44')]['id']}});});}})[_0x0a9e('0x22')](respondWithResult(_0x4b341d,null))[_0x0a9e('0x42')](handleError(_0x4b341d,null));}; \ No newline at end of file +var _0x008c=['query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','getIntervals','findOne','hasOwnProperty','sequelize','IntervalId','bulkCreate','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/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','count','set','Content-Range','save','destroy','then','get','UserProfileResource','sendStatus','name','send','map','fieldName','type','key','model'];(function(_0x339948,_0x1e07fe){var _0x3fe9cc=function(_0x5bfc39){while(--_0x5bfc39){_0x339948['push'](_0x339948['shift']());}};_0x3fe9cc(++_0x1e07fe);}(_0x008c,0x188));var _0xc008=function(_0x769935,_0x2311a5){_0x769935=_0x769935-0x0;var _0x24f62e=_0x008c[_0x769935];return _0x24f62e;};'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 as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var extensions=require(_0xc008('0x17'));function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=_0x5e894e[_0xc008('0x1b')],_0x11ef38=_0x5ee00b['offset'],_0x15a6ad=_0x5ee00b['offset']+_0x5ee00b['limit'],_0x3cafe3;if(_0x15a6ad>=_0x4bd0f4){_0x15a6ad=_0x4bd0f4;_0x3cafe3=0xc8;}else{_0x3cafe3=0xce;}_0x3f0ecf['status'](_0x3cafe3);return _0x3f0ecf[_0xc008('0x1c')](_0xc008('0x1d'),_0x11ef38+'-'+_0x15a6ad+'/'+_0x4bd0f4)['json'](_0x5e894e);}return null;};}function patchUpdates(_0x813397){return function(_0x5906e6){try{jsonpatch['apply'](_0x5906e6,_0x813397,!![]);}catch(_0x543e5d){return BPromise['reject'](_0x543e5d);}return _0x5906e6[_0xc008('0x1e')]();};}function saveUpdates(_0x4b9726,_0x5560b1){return function(_0x590a71){if(_0x590a71){return _0x590a71['update'](_0x4b9726)['then'](function(_0x13a263){return _0x13a263;});}return null;};}function removeEntity(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x1f')]()[_0xc008('0x20')](function(){var _0x4f43e2=_0x415af3[_0xc008('0x21')]({'plain':!![]});var _0x5c85f2='Intervals';return db[_0xc008('0x22')][_0xc008('0x1f')]({'where':{'type':_0x5c85f2,'resourceId':_0x4f43e2['id']}})[_0xc008('0x20')](function(){return _0x415af3;});})[_0xc008('0x20')](function(){_0x4777a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9,_0x3f7b07){return function(_0x15dade){if(!_0x15dade){_0x5de1e9[_0xc008('0x23')](0x194);}return _0x15dade;};}function handleError(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0x1f4;return function(_0x5e2aca){logger['error'](_0x5e2aca['stack']);if(_0x5e2aca['name']){delete _0x5e2aca[_0xc008('0x24')];}_0x2e31c2[_0xc008('0x19')](_0x5bebd9)[_0xc008('0x25')](_0x5e2aca);};}exports['index']=function(_0x24c14c,_0x32390d){var _0x209591={},_0x2a7d4f={},_0x4c5dec={'count':0x0,'rows':[]};var _0xcdb32b=_[_0xc008('0x26')](db['Interval']['rawAttributes'],function(_0x539766){return{'name':_0x539766[_0xc008('0x27')],'type':_0x539766[_0xc008('0x28')][_0xc008('0x29')]};});_0x2a7d4f[_0xc008('0x2a')]=_[_0xc008('0x26')](_0xcdb32b,_0xc008('0x24'));_0x2a7d4f[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x24c14c[_0xc008('0x2b')]);_0x2a7d4f[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2a7d4f[_0xc008('0x2a')],_0x2a7d4f['query']);_0x209591[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x2a7d4f['model'],qs[_0xc008('0x30')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x30')]));_0x209591[_0xc008('0x2f')]=_0x209591[_0xc008('0x2f')][_0xc008('0x31')]?_0x209591[_0xc008('0x2f')]:_0x2a7d4f[_0xc008('0x2a')];if(!_0x24c14c[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x209591[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x33')]);_0x209591[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x24c14c['query'][_0xc008('0x34')]);}_0x209591[_0xc008('0x35')]=qs['sort'](_0x24c14c[_0xc008('0x2b')][_0xc008('0x36')]);_0x209591['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x24c14c[_0xc008('0x2b')],_0x2a7d4f['filters']));if(_0x24c14c['query']['filter']){_0x209591[_0xc008('0x38')]=_['merge'](_0x209591[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0xcdb32b,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x28')]!==_0xc008('0x39')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x24')]]={'$like':'%'+_0x24c14c[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0xa381d1;}})});}_0x209591=_[_0xc008('0x3b')]({},_0x209591,_0x24c14c[_0xc008('0x3c')]);var _0xdfca2e={'where':_0x209591[_0xc008('0x38')]};return db[_0xc008('0x3d')]['count'](_0xdfca2e)[_0xc008('0x20')](function(_0x23c4db){_0x4c5dec[_0xc008('0x1b')]=_0x23c4db;if(_0x24c14c[_0xc008('0x2b')]['includeAll']){_0x209591[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x3d')][_0xc008('0x3f')](_0x209591);})[_0xc008('0x20')](function(_0x2d142d){_0x4c5dec['rows']=_0x2d142d;return _0x4c5dec;})[_0xc008('0x20')](respondWithFilteredResult(_0x32390d,_0x209591))[_0xc008('0x40')](handleError(_0x32390d,null));};exports[_0xc008('0x41')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':!![],'where':{'id':_0x3e9a99[_0xc008('0x42')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['Interval'][_0xc008('0x43')]);_0xf4cc4b[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x2d')]=_['intersection'](_0xf4cc4b[_0xc008('0x2a')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0xf4cc4b['model'],qs[_0xc008('0x30')](_0x3e9a99[_0xc008('0x2b')][_0xc008('0x30')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x2f')][_0xc008('0x31')]?_0x4f93a4[_0xc008('0x2f')]:_0xf4cc4b[_0xc008('0x2a')];if(_0x3e9a99[_0xc008('0x2b')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x3d')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x20')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x20')](respondWithResult(_0x7279e8,null))[_0xc008('0x40')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['Interval']['create'](_0x2cf641['body'],{})[_0xc008('0x20')](function(_0x2651cf){var _0x158eae=_0x2cf641['user'][_0xc008('0x21')]({'plain':!![]});if(!_0x158eae)throw new Error(_0xc008('0x47'));if(_0x158eae[_0xc008('0x48')]===_0xc008('0x49')){var _0x4981b4=_0x2651cf[_0xc008('0x21')]({'plain':!![]});var _0x17ec90=_0xc008('0x4a');return db[_0xc008('0x4b')][_0xc008('0x45')]({'where':{'name':_0x17ec90,'userProfileId':_0x158eae['userProfileId']},'raw':!![]})['then'](function(_0x223056){if(_0x223056&&_0x223056['autoAssociation']===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x4981b4[_0xc008('0x24')],'resourceId':_0x4981b4['id'],'type':_0x223056['name'],'sectionId':_0x223056['id']},{})[_0xc008('0x20')](function(){return _0x2651cf;});}else{return _0x2651cf;}})[_0xc008('0x40')](function(_0xee64){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0xee64);throw _0xee64;});}return _0x2651cf;})['then'](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x40')](handleError(_0x33be4f,null));};exports[_0xc008('0x4e')]=function(_0x4b4c6d,_0x24f775){if(_0x4b4c6d[_0xc008('0x4f')]['id']){delete _0x4b4c6d['body']['id'];}return db['Interval'][_0xc008('0x45')]({'where':{'id':_0x4b4c6d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x24f775,null))[_0xc008('0x20')](saveUpdates(_0x4b4c6d[_0xc008('0x4f')],null))['then'](respondWithResult(_0x24f775,null))['catch'](handleError(_0x24f775,null));};exports[_0xc008('0x1f')]=function(_0x5d815d,_0x3d7cce){return db[_0xc008('0x3d')][_0xc008('0x45')]({'where':{'id':_0x5d815d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x3d7cce,null))[_0xc008('0x20')](removeEntity(_0x3d7cce,null))['catch'](handleError(_0x3d7cce,null));};exports[_0xc008('0x50')]=function(_0xbd7422,_0x9a7abc,_0x2b350c){if(_0xbd7422[_0xc008('0x4f')]['id']){delete _0xbd7422['body']['id'];}return db[_0xc008('0x3d')]['find']({'where':{'id':_0xbd7422['params']['id']}})['then'](handleEntityNotFound(_0x9a7abc,null))[_0xc008('0x20')](function(_0x1bcbb1){if(_0x1bcbb1){_0xbd7422[_0xc008('0x4f')]['IntervalId']=_0x1bcbb1['id'];return db[_0xc008('0x3d')][_0xc008('0x46')](_0xbd7422[_0xc008('0x4f')]);}})['then'](respondWithResult(_0x9a7abc,null))[_0xc008('0x40')](handleError(_0x9a7abc,null));};exports[_0xc008('0x51')]=function(_0x12ba3f,_0x1b5a22,_0x5baff1){var _0x4022dd={};var _0x4eaa6d={};var _0x23ef33;var _0x422e1f;return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x12ba3f[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1b5a22,null))['then'](function(_0x375e71){if(_0x375e71){_0x23ef33=_0x375e71;_0x4eaa6d['model']=_['keys'](db[_0xc008('0x3d')][_0xc008('0x43')]);_0x4eaa6d['query']=_[_0xc008('0x2c')](_0x12ba3f[_0xc008('0x2b')]);_0x4eaa6d[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x4eaa6d[_0xc008('0x2a')],_0x4eaa6d[_0xc008('0x2b')]);_0x4022dd[_0xc008('0x2f')]=_['intersection'](_0x4eaa6d[_0xc008('0x2a')],qs[_0xc008('0x30')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x30')]));_0x4022dd[_0xc008('0x2f')]=_0x4022dd[_0xc008('0x2f')][_0xc008('0x31')]?_0x4022dd[_0xc008('0x2f')]:_0x4eaa6d[_0xc008('0x2a')];_0x4022dd[_0xc008('0x35')]=qs[_0xc008('0x36')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x36')]);_0x4022dd[_0xc008('0x38')]=qs['filters'](_[_0xc008('0x37')](_0x12ba3f[_0xc008('0x2b')],_0x4eaa6d[_0xc008('0x2d')]));if(_0x12ba3f['query'][_0xc008('0x3a')]){_0x4022dd[_0xc008('0x38')]=_['merge'](_0x4022dd['where'],{'$or':_[_0xc008('0x26')](_0x4022dd[_0xc008('0x2f')],function(_0x7bad14){var _0x39083c={};_0x39083c[_0x7bad14]={'$like':'%'+_0x12ba3f[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x39083c;})});}_0x4022dd=_[_0xc008('0x3b')]({},_0x4022dd,_0x12ba3f[_0xc008('0x3c')]);return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0x383325){if(_0x383325){_0x422e1f=_0x383325['length'];if(!_0x12ba3f[_0xc008('0x2b')][_0xc008('0x53')](_0xc008('0x32'))){_0x4022dd[_0xc008('0x33')]=qs['limit'](_0x12ba3f[_0xc008('0x2b')]['limit']);_0x4022dd[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x12ba3f[_0xc008('0x2b')]['offset']);}return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0xa80000){if(_0xa80000){return _0xa80000?{'count':_0x422e1f,'rows':_0xa80000}:null;}})['then'](respondWithResult(_0x1b5a22,null))[_0xc008('0x40')](handleError(_0x1b5a22,null));};exports['addIntervals']=function(_0x50ee03,_0xee7a85,_0x23012c){return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x50ee03['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0xee7a85,null))[_0xc008('0x20')](function(_0x49493b){if(_0x49493b){return db[_0xc008('0x54')]['transaction'](function(_0x278cbe){return db['Interval'][_0xc008('0x1f')]({'where':{'IntervalId':_0x50ee03['params']['id']},'transaction':_0x278cbe})[_0xc008('0x20')](function(_0x103d75){var _0x33d8e4=_[_0xc008('0x26')](_0x50ee03['body'],function(_0x57752c){delete _0x57752c['id'];_0x57752c[_0xc008('0x55')]=_0x50ee03[_0xc008('0x42')]['id'];return _0x57752c;});return db[_0xc008('0x3d')][_0xc008('0x56')](_0x33d8e4,{'transaction':_0x278cbe});});})[_0xc008('0x20')](function(){return db[_0xc008('0x3d')][_0xc008('0x3f')]({'where':{'IntervalId':_0x50ee03['params']['id']}});});}})[_0xc008('0x20')](respondWithResult(_0xee7a85,null))['catch'](handleError(_0xee7a85,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index cdf2da3..d37d37e 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 _0xd813=['path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','define','Interval','rewrite','../../config/logger','api','moment','bluebird'];(function(_0x369194,_0x4b016a){var _0xd59758=function(_0x2b6f8c){while(--_0x2b6f8c){_0x369194['push'](_0x369194['shift']());}};_0xd59758(++_0x4b016a);}(_0xd813,0x19c));var _0x3d81=function(_0x1bb2c5,_0x5a3a8f){_0x1bb2c5=_0x1bb2c5-0x0;var _0x50782b=_0xd813[_0x1bb2c5];return _0x50782b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3d81('0x0'))(_0x3d81('0x1'));var moment=require(_0x3d81('0x2'));var BPromise=require(_0x3d81('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3d81('0x4'));var rimraf=require(_0x3d81('0x5'));var config=require(_0x3d81('0x6'));var attributes=require(_0x3d81('0x7'));var extensions=require(_0x3d81('0x8'));module[_0x3d81('0x9')]=function(_0x13c64b,_0x2a94c6){return _0x13c64b[_0x3d81('0xa')](_0x3d81('0xb'),attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x14bbfd,_0x13f778){extensions[_0x3d81('0xc')](_0x13c64b,_0x14bbfd);},'afterBulkCreate':function(_0x3780d7,_0x2aaf43,_0x54856a){_0x54856a();extensions[_0x3d81('0xc')](_0x13c64b,_0x3780d7[0x0]);},'afterUpdate':function(_0x1360b6,_0x24f337){extensions[_0x3d81('0xc')](_0x13c64b,_0x1360b6);},'afterDestroy':function(_0x59d810,_0x1cfdc1){extensions['rewrite'](_0x13c64b,_0x59d810);}}});}; \ No newline at end of file +var _0xc1cd=['../../components/extensions/rewrite','exports','define','tools_intervals','rewrite','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x9b44da,_0x3ff5f9){var _0xd43c6a=function(_0x918ff8){while(--_0x918ff8){_0x9b44da['push'](_0x9b44da['shift']());}};_0xd43c6a(++_0x3ff5f9);}(_0xc1cd,0x1e6));var _0xdc1c=function(_0x12c28a,_0x102f8d){_0x12c28a=_0x12c28a-0x0;var _0x297001=_0xc1cd[_0x12c28a];return _0x297001;};'use strict';var _=require(_0xdc1c('0x0'));var util=require(_0xdc1c('0x1'));var logger=require(_0xdc1c('0x2'))(_0xdc1c('0x3'));var moment=require('moment');var BPromise=require(_0xdc1c('0x4'));var rp=require(_0xdc1c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdc1c('0x6'));var config=require(_0xdc1c('0x7'));var attributes=require('./interval.attributes');var extensions=require(_0xdc1c('0x8'));module[_0xdc1c('0x9')]=function(_0x2b3f05,_0x2d2e67){return _0x2b3f05[_0xdc1c('0xa')]('Interval',attributes,{'tableName':_0xdc1c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0xdf5a1b,_0x5b10f4){extensions[_0xdc1c('0xc')](_0x2b3f05,_0xdf5a1b);},'afterBulkCreate':function(_0x56cb1e,_0x47beb0,_0xff9c16){_0xff9c16();extensions['rewrite'](_0x2b3f05,_0x56cb1e[0x0]);},'afterUpdate':function(_0xb9e894,_0x444f50){extensions[_0xdc1c('0xc')](_0x2b3f05,_0xb9e894);},'afterDestroy':function(_0x311dd2,_0x52edca){extensions[_0xdc1c('0xc')](_0x2b3f05,_0x311dd2);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f4852cc..83967cf 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 _0x66a8=['ShowInterval','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','Interval,\x20%s,\x20%s','request\x20sent','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','raw','where','attributes','limit','include','map','model','debug','GetInterval','Interval','find'];(function(_0x5f3bff,_0x422e3b){var _0x15706b=function(_0x123211){while(--_0x123211){_0x5f3bff['push'](_0x5f3bff['shift']());}};_0x15706b(++_0x422e3b);}(_0x66a8,0x8d));var _0x866a=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0x66a8[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0x866a('0x0'));var util=require(_0x866a('0x1'));var moment=require(_0x866a('0x2'));var BPromise=require(_0x866a('0x3'));var rs=require(_0x866a('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x866a('0x5'))['db'];var utils=require(_0x866a('0x6'));var logger=require(_0x866a('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x866a('0x8'));var client=jayson[_0x866a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x598657,_0x579278,_0x4c0586){return new BPromise(function(_0x238f26,_0x3c3a56){return client[_0x866a('0xa')](_0x598657,_0x4c0586)[_0x866a('0xb')](function(_0x1aa429){logger[_0x866a('0xc')](_0x866a('0xd'),_0x579278,_0x866a('0xe'));logger['debug'](_0x866a('0xf'),_0x579278,_0x866a('0xe'),JSON[_0x866a('0x10')](_0x1aa429));if(_0x1aa429['error']){if(_0x1aa429[_0x866a('0x11')][_0x866a('0x12')]===0x1f4){logger[_0x866a('0x11')](_0x866a('0xd'),_0x579278,_0x1aa429[_0x866a('0x11')]['message']);return _0x3c3a56(_0x1aa429[_0x866a('0x11')][_0x866a('0x13')]);}logger[_0x866a('0x11')]('Interval,\x20%s,\x20%s',_0x579278,_0x1aa429[_0x866a('0x11')][_0x866a('0x13')]);return _0x238f26(_0x1aa429[_0x866a('0x11')][_0x866a('0x13')]);}else{logger[_0x866a('0xc')](_0x866a('0xd'),_0x579278,_0x866a('0xe'));_0x238f26(_0x1aa429['result']['message']);}})[_0x866a('0x14')](function(_0x3353ff){logger['error'](_0x866a('0xd'),_0x579278,_0x3353ff);_0x3c3a56(_0x3353ff);});});}exports['GetInterval']=function(_0xbeabd2){var _0x667663=this;return new Promise(function(_0x381dd9,_0x22a596){return db['Interval'][_0x866a('0x15')]({'raw':_0xbeabd2['options']?_0xbeabd2[_0x866a('0x16')][_0x866a('0x17')]===undefined?!![]:![]:!![],'where':_0xbeabd2[_0x866a('0x16')]?_0xbeabd2['options'][_0x866a('0x18')]||null:null,'attributes':_0xbeabd2[_0x866a('0x16')]?_0xbeabd2[_0x866a('0x16')][_0x866a('0x19')]||null:null,'limit':_0xbeabd2[_0x866a('0x16')]?_0xbeabd2[_0x866a('0x16')][_0x866a('0x1a')]||null:null,'include':_0xbeabd2[_0x866a('0x16')]?_0xbeabd2[_0x866a('0x16')][_0x866a('0x1b')]?_[_0x866a('0x1c')](_0xbeabd2[_0x866a('0x16')][_0x866a('0x1b')],function(_0x46d2a2){return{'model':db[_0x46d2a2[_0x866a('0x1d')]],'as':_0x46d2a2['as'],'attributes':_0x46d2a2[_0x866a('0x19')],'include':_0x46d2a2[_0x866a('0x1b')]?_['map'](_0x46d2a2[_0x866a('0x1b')],function(_0x26a9f3){return{'model':db[_0x26a9f3['model']],'as':_0x26a9f3['as'],'attributes':_0x26a9f3[_0x866a('0x19')],'include':_0x26a9f3['include']?_[_0x866a('0x1c')](_0x26a9f3[_0x866a('0x1b')],function(_0x31ba4e){return{'model':db[_0x31ba4e['model']],'as':_0x31ba4e['as'],'attributes':_0x31ba4e[_0x866a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x866a('0xb')](function(_0x5791fb){logger['info']('GetInterval',_0xbeabd2);logger[_0x866a('0x1e')](_0x866a('0x1f'),_0xbeabd2,JSON[_0x866a('0x10')](_0x5791fb));_0x381dd9(_0x5791fb);})[_0x866a('0x14')](function(_0x2787fa){logger[_0x866a('0x11')](_0x866a('0x1f'),_0x2787fa[_0x866a('0x13')],_0xbeabd2);_0x22a596(_0x667663[_0x866a('0x11')](0x1f4,_0x2787fa['message']));});});};exports['ShowInterval']=function(_0x149924){var _0x2b10fa=this;return new Promise(function(_0x2d7b25,_0x469bf4){return db[_0x866a('0x20')][_0x866a('0x21')]({'raw':_0x149924[_0x866a('0x16')]?_0x149924[_0x866a('0x16')][_0x866a('0x17')]===undefined?!![]:![]:!![],'where':_0x149924['options']?_0x149924[_0x866a('0x16')][_0x866a('0x18')]||null:null,'attributes':_0x149924['options']?_0x149924[_0x866a('0x16')]['attributes']||null:null,'include':_0x149924['options']?_0x149924[_0x866a('0x16')][_0x866a('0x1b')]?_[_0x866a('0x1c')](_0x149924[_0x866a('0x16')][_0x866a('0x1b')],function(_0x37cb9c){return{'model':db[_0x37cb9c[_0x866a('0x1d')]],'as':_0x37cb9c['as'],'attributes':_0x37cb9c[_0x866a('0x19')],'include':_0x37cb9c[_0x866a('0x1b')]?_[_0x866a('0x1c')](_0x37cb9c[_0x866a('0x1b')],function(_0x50419b){return{'model':db[_0x50419b['model']],'as':_0x50419b['as'],'attributes':_0x50419b[_0x866a('0x19')],'include':_0x50419b[_0x866a('0x1b')]?_[_0x866a('0x1c')](_0x50419b[_0x866a('0x1b')],function(_0x304555){return{'model':db[_0x304555[_0x866a('0x1d')]],'as':_0x304555['as'],'attributes':_0x304555[_0x866a('0x19')]};}):[]};}):[]};}):[]:[]})[_0x866a('0xb')](function(_0x5a3fe7){logger[_0x866a('0xc')](_0x866a('0x22'),_0x149924);logger['debug'](_0x866a('0x22'),_0x149924,JSON[_0x866a('0x10')](_0x5a3fe7));_0x2d7b25(_0x5a3fe7);})[_0x866a('0x14')](function(_0xb7817c){logger[_0x866a('0x11')](_0x866a('0x22'),_0xb7817c[_0x866a('0x13')],_0x149924);_0x469bf4(_0x2b10fa[_0x866a('0x11')](0x1f4,_0xb7817c[_0x866a('0x13')]));});});}; \ No newline at end of file +var _0xfc07=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','Interval,\x20%s,\x20%s','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Interval','findAll','options','raw','where','limit','map','include','model','attributes','then','GetInterval','ShowInterval','find','lodash','util','moment','bluebird','randomstring'];(function(_0x3598bb,_0x24befa){var _0x13c837=function(_0x3de578){while(--_0x3de578){_0x3598bb['push'](_0x3598bb['shift']());}};_0x13c837(++_0x24befa);}(_0xfc07,0x8f));var _0x7fc0=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xfc07[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x7fc0('0x0'));var util=require(_0x7fc0('0x1'));var moment=require(_0x7fc0('0x2'));var BPromise=require(_0x7fc0('0x3'));var rs=require(_0x7fc0('0x4'));var fs=require('fs');var Redis=require(_0x7fc0('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x7fc0('0x6'))(_0x7fc0('0x7'));var config=require(_0x7fc0('0x8'));var jayson=require(_0x7fc0('0x9'));var client=jayson['client'][_0x7fc0('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4831d5,_0x160a87,_0x2b509d){return new BPromise(function(_0x8c72f7,_0x2a2860){return client[_0x7fc0('0xb')](_0x4831d5,_0x2b509d)['then'](function(_0x8847b2){logger[_0x7fc0('0xc')](_0x7fc0('0xd'),_0x160a87,_0x7fc0('0xe'));logger[_0x7fc0('0xf')](_0x7fc0('0x10'),_0x160a87,'request\x20sent',JSON[_0x7fc0('0x11')](_0x8847b2));if(_0x8847b2[_0x7fc0('0x12')]){if(_0x8847b2[_0x7fc0('0x12')][_0x7fc0('0x13')]===0x1f4){logger[_0x7fc0('0x12')]('Interval,\x20%s,\x20%s',_0x160a87,_0x8847b2['error'][_0x7fc0('0x14')]);return _0x2a2860(_0x8847b2[_0x7fc0('0x12')][_0x7fc0('0x14')]);}logger[_0x7fc0('0x12')](_0x7fc0('0xd'),_0x160a87,_0x8847b2[_0x7fc0('0x12')][_0x7fc0('0x14')]);return _0x8c72f7(_0x8847b2[_0x7fc0('0x12')]['message']);}else{logger['info'](_0x7fc0('0xd'),_0x160a87,'request\x20sent');_0x8c72f7(_0x8847b2[_0x7fc0('0x15')][_0x7fc0('0x14')]);}})[_0x7fc0('0x16')](function(_0x583696){logger[_0x7fc0('0x12')]('Interval,\x20%s,\x20%s',_0x160a87,_0x583696);_0x2a2860(_0x583696);});});}exports['GetInterval']=function(_0xbe12d1){var _0x38e194=this;return new Promise(function(_0x40c26e,_0x1bb522){return db[_0x7fc0('0x17')][_0x7fc0('0x18')]({'raw':_0xbe12d1[_0x7fc0('0x19')]?_0xbe12d1[_0x7fc0('0x19')][_0x7fc0('0x1a')]===undefined?!![]:![]:!![],'where':_0xbe12d1[_0x7fc0('0x19')]?_0xbe12d1[_0x7fc0('0x19')][_0x7fc0('0x1b')]||null:null,'attributes':_0xbe12d1[_0x7fc0('0x19')]?_0xbe12d1[_0x7fc0('0x19')]['attributes']||null:null,'limit':_0xbe12d1[_0x7fc0('0x19')]?_0xbe12d1[_0x7fc0('0x19')][_0x7fc0('0x1c')]||null:null,'include':_0xbe12d1[_0x7fc0('0x19')]?_0xbe12d1[_0x7fc0('0x19')]['include']?_[_0x7fc0('0x1d')](_0xbe12d1[_0x7fc0('0x19')][_0x7fc0('0x1e')],function(_0x6f654f){return{'model':db[_0x6f654f[_0x7fc0('0x1f')]],'as':_0x6f654f['as'],'attributes':_0x6f654f[_0x7fc0('0x20')],'include':_0x6f654f[_0x7fc0('0x1e')]?_[_0x7fc0('0x1d')](_0x6f654f['include'],function(_0x8ea0b3){return{'model':db[_0x8ea0b3['model']],'as':_0x8ea0b3['as'],'attributes':_0x8ea0b3[_0x7fc0('0x20')],'include':_0x8ea0b3[_0x7fc0('0x1e')]?_[_0x7fc0('0x1d')](_0x8ea0b3['include'],function(_0x316ca3){return{'model':db[_0x316ca3[_0x7fc0('0x1f')]],'as':_0x316ca3['as'],'attributes':_0x316ca3[_0x7fc0('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7fc0('0x21')](function(_0x1a9164){logger[_0x7fc0('0xc')]('GetInterval',_0xbe12d1);logger[_0x7fc0('0xf')]('GetInterval',_0xbe12d1,JSON[_0x7fc0('0x11')](_0x1a9164));_0x40c26e(_0x1a9164);})['catch'](function(_0x59db8e){logger[_0x7fc0('0x12')](_0x7fc0('0x22'),_0x59db8e[_0x7fc0('0x14')],_0xbe12d1);_0x1bb522(_0x38e194[_0x7fc0('0x12')](0x1f4,_0x59db8e['message']));});});};exports[_0x7fc0('0x23')]=function(_0x5600c8){var _0x510eda=this;return new Promise(function(_0x359371,_0x518a47){return db[_0x7fc0('0x17')][_0x7fc0('0x24')]({'raw':_0x5600c8[_0x7fc0('0x19')]?_0x5600c8[_0x7fc0('0x19')][_0x7fc0('0x1a')]===undefined?!![]:![]:!![],'where':_0x5600c8[_0x7fc0('0x19')]?_0x5600c8[_0x7fc0('0x19')][_0x7fc0('0x1b')]||null:null,'attributes':_0x5600c8[_0x7fc0('0x19')]?_0x5600c8[_0x7fc0('0x19')][_0x7fc0('0x20')]||null:null,'include':_0x5600c8[_0x7fc0('0x19')]?_0x5600c8['options'][_0x7fc0('0x1e')]?_[_0x7fc0('0x1d')](_0x5600c8[_0x7fc0('0x19')]['include'],function(_0x546b29){return{'model':db[_0x546b29[_0x7fc0('0x1f')]],'as':_0x546b29['as'],'attributes':_0x546b29[_0x7fc0('0x20')],'include':_0x546b29[_0x7fc0('0x1e')]?_['map'](_0x546b29[_0x7fc0('0x1e')],function(_0x1f92cf){return{'model':db[_0x1f92cf[_0x7fc0('0x1f')]],'as':_0x1f92cf['as'],'attributes':_0x1f92cf['attributes'],'include':_0x1f92cf[_0x7fc0('0x1e')]?_['map'](_0x1f92cf[_0x7fc0('0x1e')],function(_0x5e5f1c){return{'model':db[_0x5e5f1c['model']],'as':_0x5e5f1c['as'],'attributes':_0x5e5f1c['attributes']};}):[]};}):[]};}):[]:[]})[_0x7fc0('0x21')](function(_0x201b81){logger[_0x7fc0('0xc')](_0x7fc0('0x23'),_0x5600c8);logger['debug'](_0x7fc0('0x23'),_0x5600c8,JSON[_0x7fc0('0x11')](_0x201b81));_0x359371(_0x201b81);})[_0x7fc0('0x16')](function(_0x108e53){logger[_0x7fc0('0x12')](_0x7fc0('0x23'),_0x108e53[_0x7fc0('0x14')],_0x5600c8);_0x518a47(_0x510eda[_0x7fc0('0x12')](0x1f4,_0x108e53['message']));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 11b59e9..6f0b456 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 _0x7bd6=['send','express','Router','../../components/auth/service','./jira.controller','post'];(function(_0x517a28,_0x19e8a5){var _0x2fa7c4=function(_0x5d538d){while(--_0x5d538d){_0x517a28['push'](_0x517a28['shift']());}};_0x2fa7c4(++_0x19e8a5);}(_0x7bd6,0x1e7));var _0x67bd=function(_0x55fe01,_0x12ed37){_0x55fe01=_0x55fe01-0x0;var _0x5b42f0=_0x7bd6[_0x55fe01];return _0x5b42f0;};'use strict';var express=require(_0x67bd('0x0'));var router=express[_0x67bd('0x1')]();var auth=require(_0x67bd('0x2'));var controller=require(_0x67bd('0x3'));router[_0x67bd('0x4')]('/',auth['isAuthenticated'](),controller[_0x67bd('0x5')]);module['exports']=router; \ No newline at end of file +var _0xe0cc=['Router','../../components/auth/service','post','isAuthenticated','send','exports','express'];(function(_0x484e36,_0x4482d8){var _0xafc85d=function(_0xaba9c8){while(--_0xaba9c8){_0x484e36['push'](_0x484e36['shift']());}};_0xafc85d(++_0x4482d8);}(_0xe0cc,0x1cd));var _0xce0c=function(_0x118aae,_0x33d926){_0x118aae=_0x118aae-0x0;var _0xcc5f4c=_0xe0cc[_0x118aae];return _0xcc5f4c;};'use strict';var express=require(_0xce0c('0x0'));var router=express[_0xce0c('0x1')]();var auth=require(_0xce0c('0x2'));var controller=require('./jira.controller');router[_0xce0c('0x3')]('/',auth[_0xce0c('0x4')](),controller[_0xce0c('0x5')]);module[_0xce0c('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 1f9b682..8285775 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 _0xb77f=['statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','headers','connection','remoteAddress','socket','bluebird','../../config/logger','api','support','key','MOTGUI','summary','Report','\x20from\x20','stringify','issuetype','fields','customfield_11500','email','customfield_11502','newToken','customfield_11503','name','customfield_11504','customfield_10102','/rest/api/2/issue','POST','application/json','toString','base64','setEncoding','utf8','data','end','status'];(function(_0x44ad6a,_0x197079){var _0x2ccdb7=function(_0x5bd9aa){while(--_0x5bd9aa){_0x44ad6a['push'](_0x44ad6a['shift']());}};_0x2ccdb7(++_0x197079);}(_0xb77f,0x8e));var _0xfb77=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb77f[_0x20a584];return _0x4b41a8;};'use strict';var BPromise=require(_0xfb77('0x0'));var https=require('https');var logger=require(_0xfb77('0x1'))(_0xfb77('0x2'));var USERNAME=_0xfb77('0x3');var PASSWORD='3eAmWpBVP0';function openIssue(_0x2aee55,_0x110974){var _0x4e6ab4={'fields':{'project':{'key':_0x2aee55[_0xfb77('0x4')]||_0xfb77('0x5')},'summary':(_0x2aee55[_0xfb77('0x6')]||_0xfb77('0x7'))+_0xfb77('0x8')+_0x2aee55['ip'],'description':_0x2aee55['description']||JSON[_0xfb77('0x9')](_0x2aee55),'issuetype':{'name':_0x2aee55[_0xfb77('0xa')]||'Bug'}}};_0x4e6ab4[_0xfb77('0xb')][_0xfb77('0xc')]=_0x2aee55[_0xfb77('0xd')];_0x4e6ab4[_0xfb77('0xb')]['customfield_11501']=_0x2aee55['oldToken'];_0x4e6ab4[_0xfb77('0xb')][_0xfb77('0xe')]=_0x2aee55[_0xfb77('0xf')];_0x4e6ab4[_0xfb77('0xb')][_0xfb77('0x10')]=_0x2aee55[_0xfb77('0x11')];_0x4e6ab4['fields'][_0xfb77('0x12')]=_0x2aee55['reason'];_0x4e6ab4[_0xfb77('0xb')][_0xfb77('0x13')]=_0x2aee55['ip'];var _0x5be826={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xfb77('0x14'),'method':_0xfb77('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0xfb77('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0xfb77('0x17')](_0xfb77('0x18'))}};var _0x3d8d06=JSON['stringify'](_0x4e6ab4);var _0x5daaf1=https['request'](_0x5be826,function(_0x48e2b1){_0x48e2b1[_0xfb77('0x19')](_0xfb77('0x1a'));var _0x3701bc='';_0x48e2b1['on'](_0xfb77('0x1b'),function(_0x3a9346){_0x3701bc+=_0x3a9346;});_0x48e2b1['on'](_0xfb77('0x1c'),function(){if(_0x110974){return _0x110974[_0xfb77('0x1d')](_0x48e2b1[_0xfb77('0x1e')])[_0xfb77('0x1f')](JSON['parse'](_0x3701bc));}});});_0x5daaf1['on'](_0xfb77('0x20'),function(_0x345487){if(_0x110974){return _0x110974[_0xfb77('0x1d')](0x1f4)['json']({'errors':[{'message':_0xfb77('0x21'),'type':_0xfb77('0x22')}]});}});_0x5daaf1[_0xfb77('0x23')](_0x3d8d06);_0x5daaf1['end']();}exports[_0xfb77('0x24')]=openIssue;exports[_0xfb77('0x25')]=function(_0x43ce9b,_0x974860){_0x43ce9b[_0xfb77('0x26')]['ip']=_0x43ce9b[_0xfb77('0x27')]['x-forwarded-for']||_0x43ce9b[_0xfb77('0x28')][_0xfb77('0x29')]||_0x43ce9b['socket'][_0xfb77('0x29')]||_0x43ce9b[_0xfb77('0x28')][_0xfb77('0x2a')][_0xfb77('0x29')];return openIssue(_0x43ce9b[_0xfb77('0x26')],_0x974860);}; \ No newline at end of file +var _0xd58d=['support','key','summary','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','customfield_11504','customfield_10102','/rest/api/2/issue','POST','application/json','Basic\x20','toString','request','setEncoding','utf8','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write','openIssue','send','body','x-forwarded-for','remoteAddress','connection','socket','bluebird','api'];(function(_0x367c5f,_0x2cf79c){var _0xd05198=function(_0x293e35){while(--_0x293e35){_0x367c5f['push'](_0x367c5f['shift']());}};_0xd05198(++_0x2cf79c);}(_0xd58d,0x12b));var _0xdd58=function(_0x3479f3,_0x4a778f){_0x3479f3=_0x3479f3-0x0;var _0x4bd9a2=_0xd58d[_0x3479f3];return _0x4bd9a2;};'use strict';var BPromise=require(_0xdd58('0x0'));var https=require('https');var logger=require('../../config/logger')(_0xdd58('0x1'));var USERNAME=_0xdd58('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x3eb7eb,_0x57ef4a){var _0xade3e8={'fields':{'project':{'key':_0x3eb7eb[_0xdd58('0x3')]||'MOTGUI'},'summary':(_0x3eb7eb[_0xdd58('0x4')]||'Report')+_0xdd58('0x5')+_0x3eb7eb['ip'],'description':_0x3eb7eb[_0xdd58('0x6')]||JSON[_0xdd58('0x7')](_0x3eb7eb),'issuetype':{'name':_0x3eb7eb[_0xdd58('0x8')]||'Bug'}}};_0xade3e8[_0xdd58('0x9')][_0xdd58('0xa')]=_0x3eb7eb[_0xdd58('0xb')];_0xade3e8[_0xdd58('0x9')][_0xdd58('0xc')]=_0x3eb7eb[_0xdd58('0xd')];_0xade3e8[_0xdd58('0x9')][_0xdd58('0xe')]=_0x3eb7eb[_0xdd58('0xf')];_0xade3e8[_0xdd58('0x9')][_0xdd58('0x10')]=_0x3eb7eb['name'];_0xade3e8[_0xdd58('0x9')][_0xdd58('0x11')]=_0x3eb7eb['reason'];_0xade3e8['fields'][_0xdd58('0x12')]=_0x3eb7eb['ip'];var _0x558baf={'host':'track.xcallymotion.com','port':0x1bb,'path':_0xdd58('0x13'),'method':_0xdd58('0x14'),'timeout':0x4e20,'headers':{'Content-Type':_0xdd58('0x15'),'Authorization':_0xdd58('0x16')+new Buffer(USERNAME+':'+PASSWORD)[_0xdd58('0x17')]('base64')}};var _0xcd34f6=JSON[_0xdd58('0x7')](_0xade3e8);var _0x327d85=https[_0xdd58('0x18')](_0x558baf,function(_0x2d0a54){_0x2d0a54[_0xdd58('0x19')](_0xdd58('0x1a'));var _0x127759='';_0x2d0a54['on']('data',function(_0x468bb7){_0x127759+=_0x468bb7;});_0x2d0a54['on'](_0xdd58('0x1b'),function(){if(_0x57ef4a){return _0x57ef4a[_0xdd58('0x1c')](_0x2d0a54[_0xdd58('0x1d')])[_0xdd58('0x1e')](JSON[_0xdd58('0x1f')](_0x127759));}});});_0x327d85['on'](_0xdd58('0x20'),function(_0x28b510){if(_0x57ef4a){return _0x57ef4a[_0xdd58('0x1c')](0x1f4)[_0xdd58('0x1e')]({'errors':[{'message':_0xdd58('0x21'),'type':_0xdd58('0x22')}]});}});_0x327d85[_0xdd58('0x23')](_0xcd34f6);_0x327d85[_0xdd58('0x1b')]();}exports[_0xdd58('0x24')]=openIssue;exports[_0xdd58('0x25')]=function(_0x34b49f,_0x40a698){_0x34b49f[_0xdd58('0x26')]['ip']=_0x34b49f['headers'][_0xdd58('0x27')]||_0x34b49f['connection']['remoteAddress']||_0x34b49f['socket'][_0xdd58('0x28')]||_0x34b49f[_0xdd58('0x29')][_0xdd58('0x2a')]['remoteAddress'];return openIssue(_0x34b49f['body'],_0x40a698);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index be61766..8a0ffc3 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 _0x4622=['../../config/environment','./jscriptyAnswerReport.controller','index','get','/describe','isAuthenticated','show','create','put','delete','/:id','destroy','exports','multer','path','connect-timeout','express'];(function(_0x264b9b,_0xa1181e){var _0x4c7a0e=function(_0x4b77a0){while(--_0x4b77a0){_0x264b9b['push'](_0x264b9b['shift']());}};_0x4c7a0e(++_0xa1181e);}(_0x4622,0x95));var _0x2462=function(_0xc69f39,_0x2ce0cf){_0xc69f39=_0xc69f39-0x0;var _0x93be41=_0x4622[_0xc69f39];return _0x93be41;};'use strict';var multer=require(_0x2462('0x0'));var util=require('util');var path=require(_0x2462('0x1'));var timeout=require(_0x2462('0x2'));var express=require(_0x2462('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2462('0x4'));var controller=require(_0x2462('0x5'));router['get']('/',auth['isAuthenticated'](),controller[_0x2462('0x6')]);router[_0x2462('0x7')](_0x2462('0x8'),auth[_0x2462('0x9')](),controller['describe']);router[_0x2462('0x7')]('/:id',auth[_0x2462('0x9')](),controller[_0x2462('0xa')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2462('0xb')]);router[_0x2462('0xc')]('/:id',auth[_0x2462('0x9')](),controller['update']);router[_0x2462('0xd')](_0x2462('0xe'),auth['isAuthenticated'](),controller[_0x2462('0xf')]);module[_0x2462('0x10')]=router; \ No newline at end of file +var _0xdbd9=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyAnswerReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post','create','update','destroy','exports','util','path'];(function(_0x1121fc,_0x588576){var _0x28238c=function(_0x2a199){while(--_0x2a199){_0x1121fc['push'](_0x1121fc['shift']());}};_0x28238c(++_0x588576);}(_0xdbd9,0xda));var _0x9dbd=function(_0x581d2a,_0x5aadbe){_0x581d2a=_0x581d2a-0x0;var _0x29e050=_0xdbd9[_0x581d2a];return _0x29e050;};'use strict';var multer=require('multer');var util=require(_0x9dbd('0x0'));var path=require(_0x9dbd('0x1'));var timeout=require(_0x9dbd('0x2'));var express=require(_0x9dbd('0x3'));var router=express[_0x9dbd('0x4')]();var auth=require(_0x9dbd('0x5'));var interaction=require(_0x9dbd('0x6'));var config=require(_0x9dbd('0x7'));var controller=require(_0x9dbd('0x8'));router[_0x9dbd('0x9')]('/',auth[_0x9dbd('0xa')](),controller[_0x9dbd('0xb')]);router[_0x9dbd('0x9')](_0x9dbd('0xc'),auth[_0x9dbd('0xa')](),controller[_0x9dbd('0xd')]);router['get'](_0x9dbd('0xe'),auth[_0x9dbd('0xa')](),controller['show']);router[_0x9dbd('0xf')]('/',auth['isAuthenticated'](),controller[_0x9dbd('0x10')]);router['put'](_0x9dbd('0xe'),auth['isAuthenticated'](),controller[_0x9dbd('0x11')]);router['delete'](_0x9dbd('0xe'),auth['isAuthenticated'](),controller[_0x9dbd('0x12')]);module[_0x9dbd('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index ed7b7d3..2c56fda 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 _0xf674=['TEXT','sequelize','exports','STRING'];(function(_0x3dd266,_0x4d919f){var _0x320665=function(_0x447b4e){while(--_0x447b4e){_0x3dd266['push'](_0x3dd266['shift']());}};_0x320665(++_0x4d919f);}(_0xf674,0xd5));var _0x4f67=function(_0x47b7c9,_0x3848b2){_0x47b7c9=_0x47b7c9-0x0;var _0x435aaf=_0xf674[_0x47b7c9];return _0x435aaf;};'use strict';var Sequelize=require(_0x4f67('0x0'));module[_0x4f67('0x1')]={'question':{'type':Sequelize[_0x4f67('0x2')]},'answer':{'type':Sequelize[_0x4f67('0x3')]('long')},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x4f67('0x2')]},'queue':{'type':Sequelize[_0x4f67('0x2')]},'uniqueid':{'type':Sequelize[_0x4f67('0x2')]},'calleridname':{'type':Sequelize[_0x4f67('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0x4f67('0x2')]}}; \ No newline at end of file +var _0x50ce=['sequelize','exports','TEXT','long','STRING'];(function(_0x1d8c57,_0x33618f){var _0x19a971=function(_0x49556e){while(--_0x49556e){_0x1d8c57['push'](_0x1d8c57['shift']());}};_0x19a971(++_0x33618f);}(_0x50ce,0x8c));var _0xe50c=function(_0x4abc8f,_0xef597d){_0x4abc8f=_0x4abc8f-0x0;var _0x5d7939=_0x50ce[_0x4abc8f];return _0x5d7939;};'use strict';var Sequelize=require(_0xe50c('0x0'));module[_0xe50c('0x1')]={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xe50c('0x2')](_0xe50c('0x3'))},'membername':{'type':Sequelize[_0xe50c('0x4')]},'projectname':{'type':Sequelize[_0xe50c('0x4')]},'queue':{'type':Sequelize[_0xe50c('0x4')]},'uniqueid':{'type':Sequelize[_0xe50c('0x4')]},'calleridname':{'type':Sequelize[_0xe50c('0x4')]},'calleridnum':{'type':Sequelize[_0xe50c('0x4')]},'questionId':{'type':Sequelize[_0xe50c('0x4')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 071f1f7..220445f 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 _0xcdac=['rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','offset','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','length','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send','index','map','JscriptyAnswerReport'];(function(_0x87b0ff,_0x314389){var _0x3bc0b2=function(_0x41682b){while(--_0x41682b){_0x87b0ff['push'](_0x87b0ff['shift']());}};_0x3bc0b2(++_0x314389);}(_0xcdac,0xb6));var _0xccda=function(_0x44663e,_0x1f96a2){_0x44663e=_0x44663e-0x0;var _0x3842a6=_0xcdac[_0x44663e];return _0x3842a6;};'use strict';var pdf=require(_0xccda('0x0'));var emlformat=require(_0xccda('0x1'));var rimraf=require(_0xccda('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xccda('0x3'));var rp=require(_0xccda('0x4'));var moment=require(_0xccda('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xccda('0x6'));var path=require('path');var sox=require(_0xccda('0x7'));var csv=require(_0xccda('0x8'));var ejs=require(_0xccda('0x9'));var fs=require('fs');var _=require(_0xccda('0xa'));var squel=require(_0xccda('0xb'));var crypto=require(_0xccda('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xccda('0xd'));var toCsv=require(_0xccda('0x8'));var querystring=require(_0xccda('0xe'));var Papa=require(_0xccda('0xf'));var Redis=require(_0xccda('0x10'));var authService=require(_0xccda('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xccda('0x12'));var hardwareService=require(_0xccda('0x13'));var logger=require(_0xccda('0x14'))(_0xccda('0x15'));var utils=require(_0xccda('0x16'));var config=require('../../config/environment');var db=require(_0xccda('0x17'))['db'];function respondWithStatusCode(_0x98795b,_0x171c8f){_0x171c8f=_0x171c8f||0xcc;return function(_0x5d661d){if(_0x5d661d){return _0x98795b[_0xccda('0x18')](_0x171c8f);}return _0x98795b[_0xccda('0x19')](_0x171c8f)['end']();};}function respondWithResult(_0x5e2090,_0x3382fd){_0x3382fd=_0x3382fd||0xc8;return function(_0xdf631e){if(_0xdf631e){return _0x5e2090[_0xccda('0x19')](_0x3382fd)['json'](_0xdf631e);}};}function respondWithFilteredResult(_0x18f3c3,_0x53c4d8){return function(_0x2e3fa3){if(_0x2e3fa3){var _0x4b2bb3=_0x2e3fa3[_0xccda('0x1a')],_0x8c82b8=_0x53c4d8['offset'],_0x1a8aa4=_0x53c4d8['offset']+_0x53c4d8['limit'],_0x1f4def;if(_0x1a8aa4>=_0x4b2bb3){_0x1a8aa4=_0x4b2bb3;_0x1f4def=0xc8;}else{_0x1f4def=0xce;}_0x18f3c3[_0xccda('0x19')](_0x1f4def);return _0x18f3c3[_0xccda('0x1b')](_0xccda('0x1c'),_0x8c82b8+'-'+_0x1a8aa4+'/'+_0x4b2bb3)[_0xccda('0x1d')](_0x2e3fa3);}return null;};}function patchUpdates(_0x1ffcaf){return function(_0x4fbcbe){try{jsonpatch[_0xccda('0x1e')](_0x4fbcbe,_0x1ffcaf,!![]);}catch(_0x235a36){return BPromise[_0xccda('0x1f')](_0x235a36);}return _0x4fbcbe[_0xccda('0x20')]();};}function saveUpdates(_0x17938b,_0x495160){return function(_0xeaf645){if(_0xeaf645){return _0xeaf645[_0xccda('0x21')](_0x17938b)[_0xccda('0x22')](function(_0x1b7a73){return _0x1b7a73;});}return null;};}function removeEntity(_0x5ce128,_0x199dbd){return function(_0x47e29c){if(_0x47e29c){return _0x47e29c[_0xccda('0x23')]()[_0xccda('0x22')](function(){_0x5ce128['status'](0xcc)[_0xccda('0x24')]();});}};}function handleEntityNotFound(_0x24ed00,_0x373280){return function(_0x43689b){if(!_0x43689b){_0x24ed00[_0xccda('0x18')](0x194);}return _0x43689b;};}function handleError(_0x312075,_0x565aa5){_0x565aa5=_0x565aa5||0x1f4;return function(_0x3695be){logger['error'](_0x3695be[_0xccda('0x25')]);if(_0x3695be[_0xccda('0x26')]){delete _0x3695be[_0xccda('0x26')];}_0x312075['status'](_0x565aa5)[_0xccda('0x27')](_0x3695be);};}exports[_0xccda('0x28')]=function(_0x7aee38,_0x52de4c){var _0x3b6e75={},_0x30a3da={},_0x2d60e4={'count':0x0,'rows':[]};var _0x253b75=_[_0xccda('0x29')](db[_0xccda('0x2a')][_0xccda('0x2b')],function(_0x3863ec){return{'name':_0x3863ec[_0xccda('0x2c')],'type':_0x3863ec[_0xccda('0x2d')]['key']};});_0x30a3da['model']=_[_0xccda('0x29')](_0x253b75,_0xccda('0x26'));_0x30a3da[_0xccda('0x2e')]=_[_0xccda('0x2f')](_0x7aee38[_0xccda('0x2e')]);_0x30a3da[_0xccda('0x30')]=_[_0xccda('0x31')](_0x30a3da[_0xccda('0x32')],_0x30a3da[_0xccda('0x2e')]);_0x3b6e75['attributes']=_[_0xccda('0x31')](_0x30a3da['model'],qs[_0xccda('0x33')](_0x7aee38['query']['fields']));_0x3b6e75[_0xccda('0x34')]=_0x3b6e75[_0xccda('0x34')]['length']?_0x3b6e75[_0xccda('0x34')]:_0x30a3da[_0xccda('0x32')];if(!_0x7aee38[_0xccda('0x2e')][_0xccda('0x35')](_0xccda('0x36'))){_0x3b6e75['limit']=qs[_0xccda('0x37')](_0x7aee38['query'][_0xccda('0x37')]);_0x3b6e75[_0xccda('0x38')]=qs[_0xccda('0x38')](_0x7aee38[_0xccda('0x2e')][_0xccda('0x38')]);}_0x3b6e75[_0xccda('0x39')]=qs['sort'](_0x7aee38[_0xccda('0x2e')][_0xccda('0x3a')]);_0x3b6e75[_0xccda('0x3b')]=qs['filters'](_['pick'](_0x7aee38[_0xccda('0x2e')],_0x30a3da[_0xccda('0x30')]));if(_0x7aee38[_0xccda('0x2e')][_0xccda('0x3c')]){_0x3b6e75[_0xccda('0x3b')]=_[_0xccda('0x3d')](_0x3b6e75[_0xccda('0x3b')],{'$or':_[_0xccda('0x29')](_0x253b75,function(_0x4ca5c0){if(_0x4ca5c0[_0xccda('0x2d')]!==_0xccda('0x3e')){var _0x36d10b={};_0x36d10b[_0x4ca5c0['name']]={'$like':'%'+_0x7aee38[_0xccda('0x2e')]['filter']+'%'};return _0x36d10b;}})});}_0x3b6e75=_[_0xccda('0x3d')]({},_0x3b6e75,_0x7aee38['options']);var _0x315edf={'where':_0x3b6e75[_0xccda('0x3b')]};return db['JscriptyAnswerReport']['count'](_0x315edf)['then'](function(_0x5461f9){_0x2d60e4[_0xccda('0x1a')]=_0x5461f9;if(_0x7aee38[_0xccda('0x2e')][_0xccda('0x3f')]){_0x3b6e75['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0xccda('0x40')](_0x3b6e75);})[_0xccda('0x22')](function(_0x3e52ad){_0x2d60e4['rows']=_0x3e52ad;return _0x2d60e4;})[_0xccda('0x22')](respondWithFilteredResult(_0x52de4c,_0x3b6e75))[_0xccda('0x41')](handleError(_0x52de4c,null));};exports[_0xccda('0x42')]=function(_0x12cf83,_0x3b9b08){var _0x51c665={'raw':!![],'where':{'id':_0x12cf83[_0xccda('0x43')]['id']}},_0x53a66c={};_0x53a66c[_0xccda('0x32')]=_[_0xccda('0x2f')](db[_0xccda('0x2a')][_0xccda('0x2b')]);_0x53a66c[_0xccda('0x2e')]=_['keys'](_0x12cf83[_0xccda('0x2e')]);_0x53a66c[_0xccda('0x30')]=_['intersection'](_0x53a66c[_0xccda('0x32')],_0x53a66c[_0xccda('0x2e')]);_0x51c665[_0xccda('0x34')]=_[_0xccda('0x31')](_0x53a66c[_0xccda('0x32')],qs['fields'](_0x12cf83['query'][_0xccda('0x33')]));_0x51c665[_0xccda('0x34')]=_0x51c665['attributes'][_0xccda('0x44')]?_0x51c665[_0xccda('0x34')]:_0x53a66c['model'];if(_0x12cf83[_0xccda('0x2e')]['includeAll']){_0x51c665[_0xccda('0x45')]=[{'all':!![]}];}_0x51c665=_[_0xccda('0x3d')]({},_0x51c665,_0x12cf83[_0xccda('0x46')]);return db['JscriptyAnswerReport'][_0xccda('0x47')](_0x51c665)[_0xccda('0x22')](handleEntityNotFound(_0x3b9b08,null))[_0xccda('0x22')](respondWithResult(_0x3b9b08,null))[_0xccda('0x41')](handleError(_0x3b9b08,null));};exports['create']=function(_0x197172,_0x52c31d){return db['JscriptyAnswerReport'][_0xccda('0x48')](_0x197172[_0xccda('0x49')],{})[_0xccda('0x22')](respondWithResult(_0x52c31d,0xc9))[_0xccda('0x41')](handleError(_0x52c31d,null));};exports[_0xccda('0x21')]=function(_0x134a68,_0x1e9bfa){if(_0x134a68[_0xccda('0x49')]['id']){delete _0x134a68[_0xccda('0x49')]['id'];}return db['JscriptyAnswerReport'][_0xccda('0x47')]({'where':{'id':_0x134a68['params']['id']}})['then'](handleEntityNotFound(_0x1e9bfa,null))[_0xccda('0x22')](saveUpdates(_0x134a68[_0xccda('0x49')],null))[_0xccda('0x22')](respondWithResult(_0x1e9bfa,null))[_0xccda('0x41')](handleError(_0x1e9bfa,null));};exports[_0xccda('0x23')]=function(_0x161d7a,_0x4a7164){return db[_0xccda('0x2a')]['find']({'where':{'id':_0x161d7a[_0xccda('0x43')]['id']}})[_0xccda('0x22')](handleEntityNotFound(_0x4a7164,null))[_0xccda('0x22')](removeEntity(_0x4a7164,null))['catch'](handleError(_0x4a7164,null));};exports[_0xccda('0x4a')]=function(_0x5c89a5,_0xb963bc){return db[_0xccda('0x2a')][_0xccda('0x4a')]()['then'](respondWithResult(_0xb963bc,null))[_0xccda('0x41')](handleError(_0xb963bc,null));}; \ No newline at end of file +var _0xd535=['to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','count','include','findAll','catch','includeAll','find','create','body','params','describe','html-pdf','eml-format','request-promise','mustache','util','path','sox'];(function(_0xa3a538,_0x156684){var _0x3bdbbb=function(_0x10edb9){while(--_0x10edb9){_0xa3a538['push'](_0xa3a538['shift']());}};_0x3bdbbb(++_0x156684);}(_0xd535,0x161));var _0x5d53=function(_0x1e890d,_0x59670e){_0x1e890d=_0x1e890d-0x0;var _0xd8f6c6=_0xd535[_0x1e890d];return _0xd8f6c6;};'use strict';var pdf=require(_0x5d53('0x0'));var emlformat=require(_0x5d53('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5d53('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5d53('0x3'));var util=require(_0x5d53('0x4'));var path=require(_0x5d53('0x5'));var sox=require(_0x5d53('0x6'));var csv=require(_0x5d53('0x7'));var ejs=require(_0x5d53('0x8'));var fs=require('fs');var _=require(_0x5d53('0x9'));var squel=require(_0x5d53('0xa'));var crypto=require(_0x5d53('0xb'));var jsforce=require(_0x5d53('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x5d53('0x7'));var querystring=require('querystring');var Papa=require(_0x5d53('0xd'));var Redis=require(_0x5d53('0xe'));var authService=require(_0x5d53('0xf'));var qs=require(_0x5d53('0x10'));var as=require(_0x5d53('0x11'));var hardwareService=require(_0x5d53('0x12'));var logger=require(_0x5d53('0x13'))(_0x5d53('0x14'));var utils=require(_0x5d53('0x15'));var config=require(_0x5d53('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31c9bc,_0x2dff7c){_0x2dff7c=_0x2dff7c||0xcc;return function(_0x1b9721){if(_0x1b9721){return _0x31c9bc[_0x5d53('0x17')](_0x2dff7c);}return _0x31c9bc[_0x5d53('0x18')](_0x2dff7c)[_0x5d53('0x19')]();};}function respondWithResult(_0x9822ad,_0x24e819){_0x24e819=_0x24e819||0xc8;return function(_0x3d7e34){if(_0x3d7e34){return _0x9822ad[_0x5d53('0x18')](_0x24e819)[_0x5d53('0x1a')](_0x3d7e34);}};}function respondWithFilteredResult(_0x1262d6,_0x3e8d72){return function(_0x336c39){if(_0x336c39){var _0x3c4143=_0x336c39['count'],_0x5f2453=_0x3e8d72[_0x5d53('0x1b')],_0x4e716b=_0x3e8d72[_0x5d53('0x1b')]+_0x3e8d72[_0x5d53('0x1c')],_0x894bcc;if(_0x4e716b>=_0x3c4143){_0x4e716b=_0x3c4143;_0x894bcc=0xc8;}else{_0x894bcc=0xce;}_0x1262d6[_0x5d53('0x18')](_0x894bcc);return _0x1262d6[_0x5d53('0x1d')](_0x5d53('0x1e'),_0x5f2453+'-'+_0x4e716b+'/'+_0x3c4143)[_0x5d53('0x1a')](_0x336c39);}return null;};}function patchUpdates(_0x33cdaa){return function(_0x2684bf){try{jsonpatch['apply'](_0x2684bf,_0x33cdaa,!![]);}catch(_0x264c18){return BPromise[_0x5d53('0x1f')](_0x264c18);}return _0x2684bf['save']();};}function saveUpdates(_0x44b614,_0x3d3e3d){return function(_0x5f4d6e){if(_0x5f4d6e){return _0x5f4d6e[_0x5d53('0x20')](_0x44b614)[_0x5d53('0x21')](function(_0xb06567){return _0xb06567;});}return null;};}function removeEntity(_0x1afcac,_0x1c26cf){return function(_0x438a61){if(_0x438a61){return _0x438a61[_0x5d53('0x22')]()['then'](function(){_0x1afcac[_0x5d53('0x18')](0xcc)[_0x5d53('0x19')]();});}};}function handleEntityNotFound(_0x3a4058,_0x441b66){return function(_0x39d964){if(!_0x39d964){_0x3a4058[_0x5d53('0x17')](0x194);}return _0x39d964;};}function handleError(_0x4c64ac,_0x96ea19){_0x96ea19=_0x96ea19||0x1f4;return function(_0xda339e){logger['error'](_0xda339e[_0x5d53('0x23')]);if(_0xda339e[_0x5d53('0x24')]){delete _0xda339e[_0x5d53('0x24')];}_0x4c64ac['status'](_0x96ea19)[_0x5d53('0x25')](_0xda339e);};}exports[_0x5d53('0x26')]=function(_0x46ad96,_0x19fb92){var _0x1b1abc={},_0x1cc864={},_0x5f336b={'count':0x0,'rows':[]};var _0x54f140=_[_0x5d53('0x27')](db[_0x5d53('0x28')][_0x5d53('0x29')],function(_0x4c2ee8){return{'name':_0x4c2ee8[_0x5d53('0x2a')],'type':_0x4c2ee8['type'][_0x5d53('0x2b')]};});_0x1cc864[_0x5d53('0x2c')]=_[_0x5d53('0x27')](_0x54f140,'name');_0x1cc864[_0x5d53('0x2d')]=_[_0x5d53('0x2e')](_0x46ad96['query']);_0x1cc864['filters']=_[_0x5d53('0x2f')](_0x1cc864['model'],_0x1cc864['query']);_0x1b1abc[_0x5d53('0x30')]=_[_0x5d53('0x2f')](_0x1cc864[_0x5d53('0x2c')],qs['fields'](_0x46ad96[_0x5d53('0x2d')][_0x5d53('0x31')]));_0x1b1abc[_0x5d53('0x30')]=_0x1b1abc[_0x5d53('0x30')][_0x5d53('0x32')]?_0x1b1abc[_0x5d53('0x30')]:_0x1cc864[_0x5d53('0x2c')];if(!_0x46ad96[_0x5d53('0x2d')][_0x5d53('0x33')](_0x5d53('0x34'))){_0x1b1abc['limit']=qs['limit'](_0x46ad96['query'][_0x5d53('0x1c')]);_0x1b1abc[_0x5d53('0x1b')]=qs[_0x5d53('0x1b')](_0x46ad96[_0x5d53('0x2d')]['offset']);}_0x1b1abc[_0x5d53('0x35')]=qs[_0x5d53('0x36')](_0x46ad96[_0x5d53('0x2d')][_0x5d53('0x36')]);_0x1b1abc[_0x5d53('0x37')]=qs[_0x5d53('0x38')](_['pick'](_0x46ad96[_0x5d53('0x2d')],_0x1cc864[_0x5d53('0x38')]));if(_0x46ad96['query'][_0x5d53('0x39')]){_0x1b1abc[_0x5d53('0x37')]=_[_0x5d53('0x3a')](_0x1b1abc['where'],{'$or':_[_0x5d53('0x27')](_0x54f140,function(_0x22fce9){if(_0x22fce9[_0x5d53('0x3b')]!==_0x5d53('0x3c')){var _0x334ba2={};_0x334ba2[_0x22fce9[_0x5d53('0x24')]]={'$like':'%'+_0x46ad96[_0x5d53('0x2d')][_0x5d53('0x39')]+'%'};return _0x334ba2;}})});}_0x1b1abc=_[_0x5d53('0x3a')]({},_0x1b1abc,_0x46ad96[_0x5d53('0x3d')]);var _0x5a4c06={'where':_0x1b1abc[_0x5d53('0x37')]};return db[_0x5d53('0x28')][_0x5d53('0x3e')](_0x5a4c06)[_0x5d53('0x21')](function(_0x3c766a){_0x5f336b[_0x5d53('0x3e')]=_0x3c766a;if(_0x46ad96['query']['includeAll']){_0x1b1abc[_0x5d53('0x3f')]=[{'all':!![]}];}return db[_0x5d53('0x28')][_0x5d53('0x40')](_0x1b1abc);})[_0x5d53('0x21')](function(_0x42bafe){_0x5f336b['rows']=_0x42bafe;return _0x5f336b;})[_0x5d53('0x21')](respondWithFilteredResult(_0x19fb92,_0x1b1abc))[_0x5d53('0x41')](handleError(_0x19fb92,null));};exports['show']=function(_0x3d5570,_0x3a3b3e){var _0x468a5b={'raw':!![],'where':{'id':_0x3d5570['params']['id']}},_0x557c69={};_0x557c69['model']=_[_0x5d53('0x2e')](db[_0x5d53('0x28')][_0x5d53('0x29')]);_0x557c69['query']=_[_0x5d53('0x2e')](_0x3d5570[_0x5d53('0x2d')]);_0x557c69[_0x5d53('0x38')]=_[_0x5d53('0x2f')](_0x557c69[_0x5d53('0x2c')],_0x557c69[_0x5d53('0x2d')]);_0x468a5b[_0x5d53('0x30')]=_[_0x5d53('0x2f')](_0x557c69[_0x5d53('0x2c')],qs[_0x5d53('0x31')](_0x3d5570[_0x5d53('0x2d')][_0x5d53('0x31')]));_0x468a5b[_0x5d53('0x30')]=_0x468a5b['attributes'][_0x5d53('0x32')]?_0x468a5b[_0x5d53('0x30')]:_0x557c69['model'];if(_0x3d5570[_0x5d53('0x2d')][_0x5d53('0x42')]){_0x468a5b['include']=[{'all':!![]}];}_0x468a5b=_['merge']({},_0x468a5b,_0x3d5570['options']);return db['JscriptyAnswerReport'][_0x5d53('0x43')](_0x468a5b)[_0x5d53('0x21')](handleEntityNotFound(_0x3a3b3e,null))['then'](respondWithResult(_0x3a3b3e,null))[_0x5d53('0x41')](handleError(_0x3a3b3e,null));};exports[_0x5d53('0x44')]=function(_0x5b3208,_0x4d9e16){return db[_0x5d53('0x28')][_0x5d53('0x44')](_0x5b3208[_0x5d53('0x45')],{})['then'](respondWithResult(_0x4d9e16,0xc9))['catch'](handleError(_0x4d9e16,null));};exports['update']=function(_0x3b9d80,_0x3c979b){if(_0x3b9d80[_0x5d53('0x45')]['id']){delete _0x3b9d80['body']['id'];}return db[_0x5d53('0x28')][_0x5d53('0x43')]({'where':{'id':_0x3b9d80['params']['id']}})[_0x5d53('0x21')](handleEntityNotFound(_0x3c979b,null))[_0x5d53('0x21')](saveUpdates(_0x3b9d80[_0x5d53('0x45')],null))[_0x5d53('0x21')](respondWithResult(_0x3c979b,null))['catch'](handleError(_0x3c979b,null));};exports[_0x5d53('0x22')]=function(_0x5b8947,_0x42a65a){return db[_0x5d53('0x28')][_0x5d53('0x43')]({'where':{'id':_0x5b8947[_0x5d53('0x46')]['id']}})[_0x5d53('0x21')](handleEntityNotFound(_0x42a65a,null))[_0x5d53('0x21')](removeEntity(_0x42a65a,null))[_0x5d53('0x41')](handleError(_0x42a65a,null));};exports[_0x5d53('0x47')]=function(_0x231a14,_0xf569ad){return db['JscriptyAnswerReport'][_0x5d53('0x47')]()[_0x5d53('0x21')](respondWithResult(_0xf569ad,null))[_0x5d53('0x41')](handleError(_0xf569ad,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index 11c0bbf..53d2df3 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 _0x0efd=['../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','util','../../config/logger','api','moment','request-promise','path'];(function(_0x21a448,_0x560c18){var _0xe9218b=function(_0x4b53ef){while(--_0x4b53ef){_0x21a448['push'](_0x21a448['shift']());}};_0xe9218b(++_0x560c18);}(_0x0efd,0xcb));var _0xd0ef=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0efd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd0ef('0x0'));var logger=require(_0xd0ef('0x1'))(_0xd0ef('0x2'));var moment=require(_0xd0ef('0x3'));var BPromise=require('bluebird');var rp=require(_0xd0ef('0x4'));var fs=require('fs');var path=require(_0xd0ef('0x5'));var rimraf=require('rimraf');var config=require(_0xd0ef('0x6'));var attributes=require(_0xd0ef('0x7'));module['exports']=function(_0x251c8c,_0x1ced58){return _0x251c8c[_0xd0ef('0x8')](_0xd0ef('0x9'),attributes,{'tableName':_0xd0ef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2a09=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash','api','bluebird','request-promise','path'];(function(_0x1057db,_0x18e544){var _0x35df42=function(_0x556844){while(--_0x556844){_0x1057db['push'](_0x1057db['shift']());}};_0x35df42(++_0x18e544);}(_0x2a09,0xed));var _0x92a0=function(_0x2ed577,_0x358b1a){_0x2ed577=_0x2ed577-0x0;var _0x48861f=_0x2a09[_0x2ed577];return _0x48861f;};'use strict';var _=require(_0x92a0('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x92a0('0x1'));var moment=require('moment');var BPromise=require(_0x92a0('0x2'));var rp=require(_0x92a0('0x3'));var fs=require('fs');var path=require(_0x92a0('0x4'));var rimraf=require(_0x92a0('0x5'));var config=require(_0x92a0('0x6'));var attributes=require(_0x92a0('0x7'));module['exports']=function(_0x3904b6,_0x180478){return _0x3904b6[_0x92a0('0x8')](_0x92a0('0x9'),attributes,{'tableName':_0x92a0('0xa'),'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 21d8f5f..f3037ec 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 _0x75c4=['request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','JscriptyAnswerReport,\x20%s,\x20%s'];(function(_0x1cd577,_0x180f2a){var _0x790837=function(_0x2cace5){while(--_0x2cace5){_0x1cd577['push'](_0x1cd577['shift']());}};_0x790837(++_0x180f2a);}(_0x75c4,0x1eb));var _0x475c=function(_0x42dca8,_0x564907){_0x42dca8=_0x42dca8-0x0;var _0x46e33a=_0x75c4[_0x42dca8];return _0x46e33a;};'use strict';var _=require(_0x475c('0x0'));var util=require(_0x475c('0x1'));var moment=require('moment');var BPromise=require(_0x475c('0x2'));var rs=require(_0x475c('0x3'));var fs=require('fs');var Redis=require(_0x475c('0x4'));var db=require(_0x475c('0x5'))['db'];var utils=require(_0x475c('0x6'));var logger=require('../../config/logger')(_0x475c('0x7'));var config=require(_0x475c('0x8'));var jayson=require(_0x475c('0x9'));var client=jayson[_0x475c('0xa')][_0x475c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1c953d,_0x2fa428,_0x4d6eb7){return new BPromise(function(_0x7d4e88,_0x376815){return client[_0x475c('0xc')](_0x1c953d,_0x4d6eb7)[_0x475c('0xd')](function(_0x1b4b25){logger['info'](_0x475c('0xe'),_0x2fa428,_0x475c('0xf'));logger['debug']('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x2fa428,_0x475c('0xf'),JSON[_0x475c('0x10')](_0x1b4b25));if(_0x1b4b25[_0x475c('0x11')]){if(_0x1b4b25[_0x475c('0x11')][_0x475c('0x12')]===0x1f4){logger[_0x475c('0x11')](_0x475c('0xe'),_0x2fa428,_0x1b4b25['error'][_0x475c('0x13')]);return _0x376815(_0x1b4b25[_0x475c('0x11')][_0x475c('0x13')]);}logger['error'](_0x475c('0xe'),_0x2fa428,_0x1b4b25['error'][_0x475c('0x13')]);return _0x7d4e88(_0x1b4b25['error'][_0x475c('0x13')]);}else{logger[_0x475c('0x14')](_0x475c('0xe'),_0x2fa428,_0x475c('0xf'));_0x7d4e88(_0x1b4b25[_0x475c('0x15')][_0x475c('0x13')]);}})[_0x475c('0x16')](function(_0x59bd5f){logger['error'](_0x475c('0xe'),_0x2fa428,_0x59bd5f);_0x376815(_0x59bd5f);});});} \ No newline at end of file +var _0x44f1=['JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','info'];(function(_0x22d318,_0x22dc24){var _0x1c8e5c=function(_0x4ff565){while(--_0x4ff565){_0x22d318['push'](_0x22d318['shift']());}};_0x1c8e5c(++_0x22dc24);}(_0x44f1,0x87));var _0x144f=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x44f1[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x144f('0x0'));var BPromise=require(_0x144f('0x1'));var rs=require(_0x144f('0x2'));var fs=require('fs');var Redis=require(_0x144f('0x3'));var db=require(_0x144f('0x4'))['db'];var utils=require(_0x144f('0x5'));var logger=require(_0x144f('0x6'))(_0x144f('0x7'));var config=require(_0x144f('0x8'));var jayson=require(_0x144f('0x9'));var client=jayson[_0x144f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19332e,_0x30c086,_0x2ff5d8){return new BPromise(function(_0x111ce5,_0x22378f){return client['request'](_0x19332e,_0x2ff5d8)['then'](function(_0x5acea1){logger[_0x144f('0xb')](_0x144f('0xc'),_0x30c086,_0x144f('0xd'));logger[_0x144f('0xe')]('JscriptyAnswerReport,\x20%s,\x20%s,\x20%s',_0x30c086,'request\x20sent',JSON[_0x144f('0xf')](_0x5acea1));if(_0x5acea1[_0x144f('0x10')]){if(_0x5acea1[_0x144f('0x10')][_0x144f('0x11')]===0x1f4){logger[_0x144f('0x10')](_0x144f('0xc'),_0x30c086,_0x5acea1['error']['message']);return _0x22378f(_0x5acea1[_0x144f('0x10')][_0x144f('0x12')]);}logger['error'](_0x144f('0xc'),_0x30c086,_0x5acea1[_0x144f('0x10')][_0x144f('0x12')]);return _0x111ce5(_0x5acea1[_0x144f('0x10')]['message']);}else{logger[_0x144f('0xb')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x30c086,_0x144f('0xd'));_0x111ce5(_0x5acea1[_0x144f('0x13')][_0x144f('0x12')]);}})[_0x144f('0x14')](function(_0x49409e){logger[_0x144f('0x10')](_0x144f('0xc'),_0x30c086,_0x49409e);_0x22378f(_0x49409e);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 174aab8..1521161 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 _0x70e2=['../../components/interaction/service','../../config/environment','./jscriptyProject.controller','isAuthenticated','get','/:id','show','/:id/sessions','getSessions','getAnswers','/:id/summary','30s','post','/:id/clone','clone','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4fb9ed,_0x187ea0){var _0x263645=function(_0x11c604){while(--_0x11c604){_0x4fb9ed['push'](_0x4fb9ed['shift']());}};_0x263645(++_0x187ea0);}(_0x70e2,0x107));var _0x270e=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x70e2[_0x1035c1];return _0x308d67;};'use strict';var multer=require(_0x270e('0x0'));var util=require(_0x270e('0x1'));var path=require(_0x270e('0x2'));var timeout=require(_0x270e('0x3'));var express=require(_0x270e('0x4'));var router=express[_0x270e('0x5')]();var auth=require(_0x270e('0x6'));var interaction=require(_0x270e('0x7'));var config=require(_0x270e('0x8'));var controller=require(_0x270e('0x9'));router['get']('/',auth[_0x270e('0xa')](),controller['index']);router[_0x270e('0xb')](_0x270e('0xc'),auth[_0x270e('0xa')](),controller[_0x270e('0xd')]);router[_0x270e('0xb')](_0x270e('0xe'),auth['isAuthenticated'](),controller[_0x270e('0xf')]);router[_0x270e('0xb')]('/:id/answers',auth['isAuthenticated'](),controller[_0x270e('0x10')]);router[_0x270e('0xb')](_0x270e('0x11'),auth[_0x270e('0xa')](),timeout(_0x270e('0x12')),controller['getSummary']);router['post']('/',auth[_0x270e('0xa')](),controller['create']);router[_0x270e('0x13')](_0x270e('0x14'),auth[_0x270e('0xa')](),controller[_0x270e('0x15')]);router[_0x270e('0x16')](_0x270e('0xc'),auth[_0x270e('0xa')](),controller[_0x270e('0x17')]);router[_0x270e('0x18')]('/:id',auth['isAuthenticated'](),controller[_0x270e('0x19')]);module[_0x270e('0x1a')]=router; \ No newline at end of file +var _0x6867=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./jscriptyProject.controller','get','isAuthenticated','index','/:id','show','getSessions','getAnswers','30s','getSummary','post','/:id/clone','clone','put','update','delete'];(function(_0x4b74d3,_0x607c2c){var _0x3b38bb=function(_0x1ab8f3){while(--_0x1ab8f3){_0x4b74d3['push'](_0x4b74d3['shift']());}};_0x3b38bb(++_0x607c2c);}(_0x6867,0x98));var _0x7686=function(_0x334a90,_0x1dc3a1){_0x334a90=_0x334a90-0x0;var _0x5f5857=_0x6867[_0x334a90];return _0x5f5857;};'use strict';var multer=require(_0x7686('0x0'));var util=require('util');var path=require(_0x7686('0x1'));var timeout=require(_0x7686('0x2'));var express=require(_0x7686('0x3'));var router=express[_0x7686('0x4')]();var auth=require(_0x7686('0x5'));var interaction=require(_0x7686('0x6'));var config=require('../../config/environment');var controller=require(_0x7686('0x7'));router[_0x7686('0x8')]('/',auth[_0x7686('0x9')](),controller[_0x7686('0xa')]);router[_0x7686('0x8')](_0x7686('0xb'),auth['isAuthenticated'](),controller[_0x7686('0xc')]);router['get']('/:id/sessions',auth['isAuthenticated'](),controller[_0x7686('0xd')]);router[_0x7686('0x8')]('/:id/answers',auth[_0x7686('0x9')](),controller[_0x7686('0xe')]);router[_0x7686('0x8')]('/:id/summary',auth[_0x7686('0x9')](),timeout(_0x7686('0xf')),controller[_0x7686('0x10')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x7686('0x11')](_0x7686('0x12'),auth[_0x7686('0x9')](),controller[_0x7686('0x13')]);router[_0x7686('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x7686('0x15')]);router[_0x7686('0x16')](_0x7686('0xb'),auth[_0x7686('0x9')](),controller[_0x7686('0x17')]);module[_0x7686('0x18')]=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index e35d544..722ae07 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 _0xca38=['sequelize','lodash','util','exports','name','STRING','TEXT','long','setDataValue','formData','stringify','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN'];(function(_0x4db3ce,_0x235ef5){var _0x291538=function(_0x204064){while(--_0x204064){_0x4db3ce['push'](_0x4db3ce['shift']());}};_0x291538(++_0x235ef5);}(_0xca38,0xa0));var _0x8ca3=function(_0x27a3ca,_0x19fad1){_0x27a3ca=_0x27a3ca-0x0;var _0xa88821=_0xca38[_0x27a3ca];return _0xa88821;};'use strict';var Sequelize=require(_0x8ca3('0x0'));var _=require(_0x8ca3('0x1'));var util=require(_0x8ca3('0x2'));module[_0x8ca3('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x8ca3('0x4')},'description':{'type':Sequelize[_0x8ca3('0x5')]},'formData':{'type':Sequelize[_0x8ca3('0x6')](_0x8ca3('0x7')),'set':function(_0x49b1fa){if(_['isObjectLike'](_0x49b1fa)){this[_0x8ca3('0x8')](_0x8ca3('0x9'),JSON[_0x8ca3('0xa')](_0x49b1fa));}else if(_[_0x8ca3('0xb')](_0x49b1fa)){this[_0x8ca3('0x8')](_0x8ca3('0x9'),_0x49b1fa);}else{this[_0x8ca3('0x8')]('formData',util['format'](_0x8ca3('0xc'),this[_0x8ca3('0xd')](_0x8ca3('0x4'))||'',this['getDataValue'](_0x8ca3('0xe'))||''));}}},'enableUncompleteSave':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x8ca3('0xf')],'defaultValue':![]}}; \ No newline at end of file +var _0x7e98=['exports','name','long','setDataValue','formData','isString','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','sequelize','lodash','util'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x7e98,0x14f));var _0x87e9=function(_0x82d3e0,_0x351608){_0x82d3e0=_0x82d3e0-0x0;var _0x20a566=_0x7e98[_0x82d3e0];return _0x20a566;};'use strict';var Sequelize=require(_0x87e9('0x0'));var _=require(_0x87e9('0x1'));var util=require(_0x87e9('0x2'));module[_0x87e9('0x3')]={'name':{'type':Sequelize['STRING'],'unique':_0x87e9('0x4')},'description':{'type':Sequelize['STRING']},'formData':{'type':Sequelize['TEXT'](_0x87e9('0x5')),'set':function(_0xdd10a2){if(_['isObjectLike'](_0xdd10a2)){this[_0x87e9('0x6')](_0x87e9('0x7'),JSON['stringify'](_0xdd10a2));}else if(_[_0x87e9('0x8')](_0xdd10a2)){this[_0x87e9('0x6')]('formData',_0xdd10a2);}else{this[_0x87e9('0x6')](_0x87e9('0x7'),util['format'](_0x87e9('0x9'),this[_0x87e9('0xa')](_0x87e9('0x4'))||'',this[_0x87e9('0xa')](_0x87e9('0xb'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x87e9('0xc')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x87e9('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index 865316d..9419ae8 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 _0x1c23=['zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','json','offset','limit','apply','reject','update','destroy','then','get','Projects','UserProfileResource','sendStatus','error','stack','name','send','index','map','JscriptyProject','rawAttributes','fieldName','type','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','rows','catch','show','params','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','getSessions','findOne','ProjectId','JscriptySessionReport','findAll','getAnswers','order','JscriptyAnswerReport','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','JscriptyQuestionReport','-createdAt','questionId','question','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','isEmpty','writeFileSync','format','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','html-pdf','eml-format','rimraf'];(function(_0x5ac0f0,_0xee4d98){var _0x4aceec=function(_0x3a9044){while(--_0x3a9044){_0x5ac0f0['push'](_0x5ac0f0['shift']());}};_0x4aceec(++_0xee4d98);}(_0x1c23,0x1d5));var _0x31c2=function(_0x48df0a,_0x475680){_0x48df0a=_0x48df0a-0x0;var _0x1e4e4e=_0x1c23[_0x48df0a];return _0x1e4e4e;};'use strict';var pdf=require(_0x31c2('0x0'));var emlformat=require(_0x31c2('0x1'));var rimraf=require(_0x31c2('0x2'));var zipdir=require(_0x31c2('0x3'));var jsonpatch=require(_0x31c2('0x4'));var rp=require(_0x31c2('0x5'));var moment=require('moment');var BPromise=require(_0x31c2('0x6'));var Mustache=require(_0x31c2('0x7'));var util=require('util');var path=require(_0x31c2('0x8'));var sox=require(_0x31c2('0x9'));var csv=require(_0x31c2('0xa'));var ejs=require(_0x31c2('0xb'));var fs=require('fs');var _=require(_0x31c2('0xc'));var squel=require('squel');var crypto=require(_0x31c2('0xd'));var jsforce=require(_0x31c2('0xe'));var deskjs=require(_0x31c2('0xf'));var toCsv=require(_0x31c2('0xa'));var querystring=require(_0x31c2('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x31c2('0x11'));var qs=require(_0x31c2('0x12'));var as=require(_0x31c2('0x13'));var hardwareService=require(_0x31c2('0x14'));var logger=require(_0x31c2('0x15'))(_0x31c2('0x16'));var utils=require('../../config/utils');var config=require(_0x31c2('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xfbac47,_0x2df4e5){_0x2df4e5=_0x2df4e5||0xcc;return function(_0x1d8406){if(_0x1d8406){return _0xfbac47['sendStatus'](_0x2df4e5);}return _0xfbac47[_0x31c2('0x18')](_0x2df4e5)[_0x31c2('0x19')]();};}function respondWithResult(_0x5cfc94,_0x14c25f){_0x14c25f=_0x14c25f||0xc8;return function(_0x44d874){if(_0x44d874){return _0x5cfc94[_0x31c2('0x18')](_0x14c25f)[_0x31c2('0x1a')](_0x44d874);}};}function respondWithFilteredResult(_0x3f092f,_0x5fa42e){return function(_0x1cf235){if(_0x1cf235){var _0x35f75b=_0x1cf235['count'],_0x3f1d79=_0x5fa42e['offset'],_0x289fff=_0x5fa42e[_0x31c2('0x1b')]+_0x5fa42e[_0x31c2('0x1c')],_0x3b23b9;if(_0x289fff>=_0x35f75b){_0x289fff=_0x35f75b;_0x3b23b9=0xc8;}else{_0x3b23b9=0xce;}_0x3f092f[_0x31c2('0x18')](_0x3b23b9);return _0x3f092f['set']('Content-Range',_0x3f1d79+'-'+_0x289fff+'/'+_0x35f75b)[_0x31c2('0x1a')](_0x1cf235);}return null;};}function patchUpdates(_0x4a52fa){return function(_0x1ead6a){try{jsonpatch[_0x31c2('0x1d')](_0x1ead6a,_0x4a52fa,!![]);}catch(_0x3ccfa1){return BPromise[_0x31c2('0x1e')](_0x3ccfa1);}return _0x1ead6a['save']();};}function saveUpdates(_0xc29f8a,_0x4ae7ad){return function(_0x35d945){if(_0x35d945){return _0x35d945[_0x31c2('0x1f')](_0xc29f8a)['then'](function(_0x5a5004){return _0x5a5004;});}return null;};}function removeEntity(_0x3c14bc,_0x36ae8e){return function(_0x4cd43e){if(_0x4cd43e){return _0x4cd43e[_0x31c2('0x20')]()[_0x31c2('0x21')](function(){var _0x321cf9=_0x4cd43e[_0x31c2('0x22')]({'plain':!![]});var _0x5e10e7=_0x31c2('0x23');return db[_0x31c2('0x24')]['destroy']({'where':{'type':_0x5e10e7,'resourceId':_0x321cf9['id']}})[_0x31c2('0x21')](function(){return _0x4cd43e;});})['then'](function(){_0x3c14bc['status'](0xcc)[_0x31c2('0x19')]();});}};}function handleEntityNotFound(_0x58f82d,_0x37b749){return function(_0x30c767){if(!_0x30c767){_0x58f82d[_0x31c2('0x25')](0x194);}return _0x30c767;};}function handleError(_0x211a43,_0x3ad658){_0x3ad658=_0x3ad658||0x1f4;return function(_0x5c3fb0){logger[_0x31c2('0x26')](_0x5c3fb0[_0x31c2('0x27')]);if(_0x5c3fb0[_0x31c2('0x28')]){delete _0x5c3fb0['name'];}_0x211a43[_0x31c2('0x18')](_0x3ad658)[_0x31c2('0x29')](_0x5c3fb0);};}exports[_0x31c2('0x2a')]=function(_0x2a936e,_0x45aa60){var _0x2164d8={},_0x13c1ea={},_0x5d2a1a={'count':0x0,'rows':[]};var _0x296d91=_[_0x31c2('0x2b')](db[_0x31c2('0x2c')][_0x31c2('0x2d')],function(_0x276137){return{'name':_0x276137[_0x31c2('0x2e')],'type':_0x276137[_0x31c2('0x2f')]['key']};});_0x13c1ea['model']=_[_0x31c2('0x2b')](_0x296d91,'name');_0x13c1ea[_0x31c2('0x30')]=_[_0x31c2('0x31')](_0x2a936e[_0x31c2('0x30')]);_0x13c1ea[_0x31c2('0x32')]=_['intersection'](_0x13c1ea[_0x31c2('0x33')],_0x13c1ea['query']);_0x2164d8[_0x31c2('0x34')]=_[_0x31c2('0x35')](_0x13c1ea[_0x31c2('0x33')],qs[_0x31c2('0x36')](_0x2a936e['query']['fields']));_0x2164d8['attributes']=_0x2164d8[_0x31c2('0x34')][_0x31c2('0x37')]?_0x2164d8[_0x31c2('0x34')]:_0x13c1ea[_0x31c2('0x33')];if(!_0x2a936e[_0x31c2('0x30')][_0x31c2('0x38')](_0x31c2('0x39'))){_0x2164d8[_0x31c2('0x1c')]=qs[_0x31c2('0x1c')](_0x2a936e[_0x31c2('0x30')][_0x31c2('0x1c')]);_0x2164d8[_0x31c2('0x1b')]=qs[_0x31c2('0x1b')](_0x2a936e[_0x31c2('0x30')][_0x31c2('0x1b')]);}_0x2164d8['order']=qs['sort'](_0x2a936e[_0x31c2('0x30')][_0x31c2('0x3a')]);_0x2164d8[_0x31c2('0x3b')]=qs[_0x31c2('0x32')](_[_0x31c2('0x3c')](_0x2a936e['query'],_0x13c1ea['filters']));if(_0x2a936e[_0x31c2('0x30')][_0x31c2('0x3d')]){_0x2164d8[_0x31c2('0x3b')]=_[_0x31c2('0x3e')](_0x2164d8[_0x31c2('0x3b')],{'$or':_['map'](_0x296d91,function(_0x1ce0f4){if(_0x1ce0f4[_0x31c2('0x2f')]!=='VIRTUAL'){var _0x1609b9={};_0x1609b9[_0x1ce0f4['name']]={'$like':'%'+_0x2a936e[_0x31c2('0x30')][_0x31c2('0x3d')]+'%'};return _0x1609b9;}})});}_0x2164d8=_[_0x31c2('0x3e')]({},_0x2164d8,_0x2a936e[_0x31c2('0x3f')]);var _0x54980e={'where':_0x2164d8[_0x31c2('0x3b')]};return db[_0x31c2('0x2c')][_0x31c2('0x40')](_0x54980e)[_0x31c2('0x21')](function(_0x5a4ad5){_0x5d2a1a[_0x31c2('0x40')]=_0x5a4ad5;if(_0x2a936e[_0x31c2('0x30')][_0x31c2('0x41')]){_0x2164d8[_0x31c2('0x42')]=[{'all':!![]}];}return db[_0x31c2('0x2c')]['findAll'](_0x2164d8);})[_0x31c2('0x21')](function(_0x4e8aef){_0x5d2a1a[_0x31c2('0x43')]=_0x4e8aef;return _0x5d2a1a;})['then'](respondWithFilteredResult(_0x45aa60,_0x2164d8))[_0x31c2('0x44')](handleError(_0x45aa60,null));};exports[_0x31c2('0x45')]=function(_0x149bd0,_0x1932b5){var _0x32cfe3={'raw':![],'where':{'id':_0x149bd0[_0x31c2('0x46')]['id']}},_0x20c3a7={};_0x20c3a7['model']=_[_0x31c2('0x31')](db[_0x31c2('0x2c')][_0x31c2('0x2d')]);_0x20c3a7[_0x31c2('0x30')]=_[_0x31c2('0x31')](_0x149bd0[_0x31c2('0x30')]);_0x20c3a7[_0x31c2('0x32')]=_[_0x31c2('0x35')](_0x20c3a7[_0x31c2('0x33')],_0x20c3a7[_0x31c2('0x30')]);_0x32cfe3[_0x31c2('0x34')]=_[_0x31c2('0x35')](_0x20c3a7[_0x31c2('0x33')],qs[_0x31c2('0x36')](_0x149bd0[_0x31c2('0x30')][_0x31c2('0x36')]));_0x32cfe3[_0x31c2('0x34')]=_0x32cfe3[_0x31c2('0x34')]['length']?_0x32cfe3[_0x31c2('0x34')]:_0x20c3a7[_0x31c2('0x33')];if(_0x149bd0['query'][_0x31c2('0x41')]){_0x32cfe3[_0x31c2('0x42')]=[{'all':!![]}];}_0x32cfe3=_[_0x31c2('0x3e')]({},_0x32cfe3,_0x149bd0[_0x31c2('0x3f')]);return db[_0x31c2('0x2c')][_0x31c2('0x47')](_0x32cfe3)[_0x31c2('0x21')](handleEntityNotFound(_0x1932b5,null))['then'](respondWithResult(_0x1932b5,null))['catch'](handleError(_0x1932b5,null));};exports['create']=function(_0x29be6f,_0x254425){return db['JscriptyProject']['create'](_0x29be6f[_0x31c2('0x48')],{})[_0x31c2('0x21')](function(_0x48c147){var _0x2f935d=_0x29be6f[_0x31c2('0x49')]['get']({'plain':!![]});if(!_0x2f935d)throw new Error(_0x31c2('0x4a'));if(_0x2f935d[_0x31c2('0x4b')]==='user'){var _0x17428c=_0x48c147[_0x31c2('0x22')]({'plain':!![]});var _0x49ad6d=_0x31c2('0x23');return db[_0x31c2('0x4c')][_0x31c2('0x47')]({'where':{'name':_0x49ad6d,'userProfileId':_0x2f935d[_0x31c2('0x4d')]},'raw':!![]})[_0x31c2('0x21')](function(_0xa924bd){if(_0xa924bd&&_0xa924bd[_0x31c2('0x4e')]===0x0){return db[_0x31c2('0x24')][_0x31c2('0x4f')]({'name':_0x17428c[_0x31c2('0x28')],'resourceId':_0x17428c['id'],'type':_0xa924bd['name'],'sectionId':_0xa924bd['id']},{})['then'](function(){return _0x48c147;});}else{return _0x48c147;}})[_0x31c2('0x44')](function(_0x41f7e6){logger[_0x31c2('0x26')](_0x31c2('0x50'),_0x41f7e6);throw _0x41f7e6;});}return _0x48c147;})[_0x31c2('0x21')](respondWithResult(_0x254425,0xc9))[_0x31c2('0x44')](handleError(_0x254425,null));};exports[_0x31c2('0x51')]=function(_0x72f670,_0xc633f){var _0x190952={'where':{'id':_0x72f670[_0x31c2('0x46')]['id']}},_0x99af41={};_0x99af41[_0x31c2('0x33')]=_[_0x31c2('0x31')](db[_0x31c2('0x2c')][_0x31c2('0x2d')]);_0x190952[_0x31c2('0x34')]=_['intersection'](_0x99af41[_0x31c2('0x33')],qs[_0x31c2('0x36')](_0x72f670[_0x31c2('0x30')][_0x31c2('0x36')]));_0x190952['attributes']=_0x190952['attributes'][_0x31c2('0x37')]?_0x190952[_0x31c2('0x34')]:_0x99af41['model'];if(_0x72f670[_0x31c2('0x30')][_0x31c2('0x41')]){_0x190952[_0x31c2('0x42')]=[{'all':!![]}];}_0x190952=_[_0x31c2('0x3e')]({},_0x190952,_0x72f670['options']);return db['JscriptyProject'][_0x31c2('0x47')](_0x190952)[_0x31c2('0x21')](handleEntityNotFound(_0xc633f,null))[_0x31c2('0x21')](function(_0x1418a3){if(_0x1418a3){var _0x243ea6=_0x1418a3['get']({'plain':!![]});_0x243ea6=qs[_0x31c2('0x52')](_0x243ea6,['id',_0x31c2('0x53'),'updatedAt']);_0x72f670[_0x31c2('0x48')]=_[_0x31c2('0x52')](_0x72f670['body'],['id',_0x31c2('0x53'),_0x31c2('0x54')]);return db[_0x31c2('0x2c')][_0x31c2('0x4f')](_[_0x31c2('0x3e')](_0x243ea6,_0x72f670['body']),{'include':_0x72f670[_0x31c2('0x30')][_0x31c2('0x41')]?[{'all':!![]}]:undefined})['then'](function(_0x1ccbd6){var _0x32dc65=_0x72f670[_0x31c2('0x49')][_0x31c2('0x22')]({'plain':!![]});if(!_0x32dc65)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32dc65[_0x31c2('0x4b')]===_0x31c2('0x49')){var _0x41be16=_0x1ccbd6[_0x31c2('0x22')]({'plain':!![]});var _0x5666eb=_0x31c2('0x23');return db[_0x31c2('0x4c')][_0x31c2('0x47')]({'where':{'name':_0x5666eb,'userProfileId':_0x32dc65['userProfileId']},'raw':!![]})[_0x31c2('0x21')](function(_0x3136ae){if(_0x3136ae&&_0x3136ae[_0x31c2('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x41be16[_0x31c2('0x28')],'resourceId':_0x41be16['id'],'type':_0x3136ae[_0x31c2('0x28')],'sectionId':_0x3136ae['id']},{})[_0x31c2('0x21')](function(){return _0x1ccbd6;});}else{return _0x1ccbd6;}})['catch'](function(_0x2282d4){logger[_0x31c2('0x26')](_0x31c2('0x50'),_0x2282d4);throw _0x2282d4;});}return _0x1ccbd6;});}})[_0x31c2('0x21')](respondWithResult(_0xc633f,0xc9))[_0x31c2('0x44')](handleError(_0xc633f,null));};exports['update']=function(_0x562f6a,_0x72cb22){if(_0x562f6a[_0x31c2('0x48')]['id']){delete _0x562f6a['body']['id'];}return db[_0x31c2('0x2c')][_0x31c2('0x47')]({'where':{'id':_0x562f6a[_0x31c2('0x46')]['id']}})[_0x31c2('0x21')](handleEntityNotFound(_0x72cb22,null))[_0x31c2('0x21')](saveUpdates(_0x562f6a[_0x31c2('0x48')],null))['then'](respondWithResult(_0x72cb22,null))['catch'](handleError(_0x72cb22,null));};exports[_0x31c2('0x20')]=function(_0x1f369a,_0x2d775e){return db['JscriptyProject']['find']({'where':{'id':_0x1f369a[_0x31c2('0x46')]['id']}})[_0x31c2('0x21')](handleEntityNotFound(_0x2d775e,null))[_0x31c2('0x21')](removeEntity(_0x2d775e,null))[_0x31c2('0x44')](handleError(_0x2d775e,null));};exports[_0x31c2('0x55')]=function(_0x269f9e,_0x486004,_0x327a1c){var _0x829f5a={'raw':!![],'where':{}};var _0x3dba2a={};var _0xe35f9c={'count':0x0,'rows':[]};return db[_0x31c2('0x2c')][_0x31c2('0x56')]({'where':{'id':_0x269f9e['params']['id']}})[_0x31c2('0x21')](handleEntityNotFound(_0x486004,null))[_0x31c2('0x21')](function(_0x37b659){if(_0x37b659){_0x3dba2a[_0x31c2('0x33')]=_['keys'](db['JscriptySessionReport'][_0x31c2('0x2d')]);_0x3dba2a[_0x31c2('0x30')]=_[_0x31c2('0x31')](_0x269f9e[_0x31c2('0x30')]);_0x3dba2a[_0x31c2('0x32')]=_[_0x31c2('0x35')](_0x3dba2a[_0x31c2('0x33')],_0x3dba2a[_0x31c2('0x30')]);_0x829f5a['attributes']=_[_0x31c2('0x35')](_0x3dba2a[_0x31c2('0x33')],qs[_0x31c2('0x36')](_0x269f9e[_0x31c2('0x30')][_0x31c2('0x36')]));_0x829f5a[_0x31c2('0x34')]=_0x829f5a[_0x31c2('0x34')][_0x31c2('0x37')]?_0x829f5a[_0x31c2('0x34')]:_0x3dba2a['model'];if(!_0x269f9e[_0x31c2('0x30')]['hasOwnProperty'](_0x31c2('0x39'))){_0x829f5a[_0x31c2('0x1c')]=qs['limit'](_0x269f9e[_0x31c2('0x30')]['limit']);_0x829f5a['offset']=qs['offset'](_0x269f9e[_0x31c2('0x30')][_0x31c2('0x1b')]);}_0x829f5a['order']=qs[_0x31c2('0x3a')](_0x269f9e[_0x31c2('0x30')][_0x31c2('0x3a')]);_0x829f5a[_0x31c2('0x3b')]=qs[_0x31c2('0x32')](_[_0x31c2('0x3c')](_0x269f9e['query'],_0x3dba2a['filters']));_0x829f5a[_0x31c2('0x3b')][_0x31c2('0x57')]=_0x37b659['id'];if(_0x269f9e[_0x31c2('0x30')][_0x31c2('0x3d')]){_0x829f5a['where']=_[_0x31c2('0x3e')](_0x829f5a[_0x31c2('0x3b')],{'$or':_[_0x31c2('0x2b')](_0x829f5a[_0x31c2('0x34')],function(_0x4de95b){var _0x5a92bb={};_0x5a92bb[_0x4de95b]={'$like':'%'+_0x269f9e[_0x31c2('0x30')][_0x31c2('0x3d')]+'%'};return _0x5a92bb;})});}_0x829f5a=_[_0x31c2('0x3e')]({},_0x829f5a,_0x269f9e[_0x31c2('0x3f')]);return db[_0x31c2('0x58')]['count']({'where':_0x829f5a['where']})[_0x31c2('0x21')](function(_0xdc2677){_0xe35f9c[_0x31c2('0x40')]=_0xdc2677;if(_0x269f9e['query']['includeAll']){_0x829f5a[_0x31c2('0x42')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x31c2('0x59')](_0x829f5a);})[_0x31c2('0x21')](function(_0x4bc985){_0xe35f9c[_0x31c2('0x43')]=_0x4bc985;return _0xe35f9c;});}})[_0x31c2('0x21')](respondWithFilteredResult(_0x486004,_0x829f5a))['catch'](handleError(_0x486004,null));};exports[_0x31c2('0x5a')]=function(_0x56314f,_0x425519,_0x36b3c6){var _0x1246f1={'raw':!![],'where':{}};var _0x19e85d={};var _0x1c7a23={'count':0x0,'rows':[]};return db[_0x31c2('0x2c')][_0x31c2('0x56')]({'where':{'id':_0x56314f[_0x31c2('0x46')]['id']}})['then'](handleEntityNotFound(_0x425519,null))[_0x31c2('0x21')](function(_0x4b2aed){if(_0x4b2aed){_0x19e85d[_0x31c2('0x33')]=_[_0x31c2('0x31')](db['JscriptyAnswerReport']['rawAttributes']);_0x19e85d[_0x31c2('0x30')]=_['keys'](_0x56314f[_0x31c2('0x30')]);_0x19e85d['filters']=_[_0x31c2('0x35')](_0x19e85d[_0x31c2('0x33')],_0x19e85d[_0x31c2('0x30')]);_0x1246f1['attributes']=_['intersection'](_0x19e85d['model'],qs[_0x31c2('0x36')](_0x56314f['query']['fields']));_0x1246f1['attributes']=_0x1246f1[_0x31c2('0x34')]['length']?_0x1246f1[_0x31c2('0x34')]:_0x19e85d['model'];if(!_0x56314f['query'][_0x31c2('0x38')](_0x31c2('0x39'))){_0x1246f1[_0x31c2('0x1c')]=qs[_0x31c2('0x1c')](_0x56314f[_0x31c2('0x30')]['limit']);_0x1246f1['offset']=qs[_0x31c2('0x1b')](_0x56314f[_0x31c2('0x30')]['offset']);}_0x1246f1[_0x31c2('0x5b')]=qs['sort'](_0x56314f[_0x31c2('0x30')][_0x31c2('0x3a')]);_0x1246f1['where']=qs[_0x31c2('0x32')](_[_0x31c2('0x3c')](_0x56314f[_0x31c2('0x30')],_0x19e85d[_0x31c2('0x32')]));_0x1246f1[_0x31c2('0x3b')][_0x31c2('0x57')]=_0x4b2aed['id'];if(_0x56314f['query'][_0x31c2('0x3d')]){_0x1246f1[_0x31c2('0x3b')]=_[_0x31c2('0x3e')](_0x1246f1['where'],{'$or':_[_0x31c2('0x2b')](_0x1246f1[_0x31c2('0x34')],function(_0x3605a3){var _0x2fb6ad={};_0x2fb6ad[_0x3605a3]={'$like':'%'+_0x56314f[_0x31c2('0x30')][_0x31c2('0x3d')]+'%'};return _0x2fb6ad;})});}_0x1246f1=_[_0x31c2('0x3e')]({},_0x1246f1,_0x56314f[_0x31c2('0x3f')]);return db['JscriptyAnswerReport'][_0x31c2('0x40')]({'where':_0x1246f1[_0x31c2('0x3b')]})[_0x31c2('0x21')](function(_0x325359){_0x1c7a23[_0x31c2('0x40')]=_0x325359;if(_0x56314f[_0x31c2('0x30')][_0x31c2('0x41')]){_0x1246f1[_0x31c2('0x42')]=[{'all':!![]}];}return db[_0x31c2('0x5c')][_0x31c2('0x59')](_0x1246f1);})[_0x31c2('0x21')](function(_0x5b69c7){_0x1c7a23['rows']=_0x5b69c7;return _0x1c7a23;});}})[_0x31c2('0x21')](respondWithFilteredResult(_0x425519,_0x1246f1))[_0x31c2('0x44')](handleError(_0x425519,null));};function char(_0x542595){return'number'===typeof _0x542595?String[_0x31c2('0x5d')][_0x31c2('0x1d')](null,arguments):_0x542595;}function needsEncapsulation(_0x39fb6a){return!!_0x39fb6a&&(_0x39fb6a[_0x31c2('0x5e')]()[_0x31c2('0x5f')](char(0xd))>=0x0||_0x39fb6a[_0x31c2('0x5e')]()[_0x31c2('0x5f')](char(0xa))>=0x0||_0x39fb6a[_0x31c2('0x5e')]()[_0x31c2('0x5f')](char(0x2c))>=0x0||_0x39fb6a[_0x31c2('0x5e')]()['indexOf'](char(0x22))>=0x0);}function encapsulate(_0x48a96e){var _0x1087ae=char(0x22),_0x4aeee2='\x5c'+char(0x22),_0x56371b=_0x48a96e[_0x31c2('0x5e')]()[_0x31c2('0x60')](new RegExp(_0x1087ae,'g'),_0x4aeee2);return _0x1087ae+_0x56371b+_0x1087ae;}exports[_0x31c2('0x61')]=function(_0x50710b,_0x2ce76a,_0x40f3cd){var _0x4e4413,_0x5466be;var _0x3873fc={'where':{'ProjectId':_0x50710b[_0x31c2('0x46')]['id']}};if(_0x50710b[_0x31c2('0x30')][_0x31c2('0x62')]){_0x3873fc[_0x31c2('0x3b')][_0x31c2('0x63')]=JSON['parse'](_0x50710b[_0x31c2('0x30')][_0x31c2('0x62')]);}return db[_0x31c2('0x58')]['findAll'](_0x3873fc)['then'](handleEntityNotFound(_0x2ce76a,null))['then'](function(_0x3f0f50){if(_0x3f0f50){_0x4e4413=_0x3f0f50;return db[_0x31c2('0x64')][_0x31c2('0x59')]({'where':{'SessionId':{'$in':_['map'](_0x4e4413,'id')},'ProjectId':_0x50710b[_0x31c2('0x46')]['id']},'order':_0x31c2('0x65')});}})[_0x31c2('0x21')](handleEntityNotFound(_0x2ce76a,null))['then'](function(_0x3b6ad7){if(_0x3b6ad7){_0x5466be=_0x3b6ad7;var _0x5a060e={};for(var _0x53565c=0x0,_0x88d1a1=_0x5466be[_0x31c2('0x37')];_0x53565c<_0x88d1a1;_0x53565c++){if(!_0x5a060e[_0x31c2('0x38')](_0x5466be[_0x53565c][_0x31c2('0x66')])){_0x5a060e[_0x5466be[_0x53565c][_0x31c2('0x66')]]=needsEncapsulation(_0x5466be[_0x53565c]['question'])?encapsulate(_0x5466be[_0x53565c][_0x31c2('0x67')]):_0x5466be[_0x53565c][_0x31c2('0x67')];}}var _0x176b9c=[],_0x1a7509={};for(var _0x1afbe9=0x0,_0x38bcb8=_0x4e4413[_0x31c2('0x37')];_0x1afbe9<_0x38bcb8;_0x1afbe9++){_0x1a7509={'ProjectId':_0x50710b[_0x31c2('0x46')]['id'],'SessionId':_0x4e4413[_0x1afbe9]['id'],'StartTime':moment(_0x4e4413[_0x1afbe9][_0x31c2('0x63')])['format'](_0x31c2('0x68'))};for(var _0x25d440=0x0,_0x456f2d=_0x5466be['length'];_0x25d440<_0x456f2d;_0x25d440++){if(_0x5466be[_0x25d440][_0x31c2('0x69')]==_0x4e4413[_0x1afbe9]['id']&&_0x5a060e[_0x31c2('0x38')](_0x5466be[_0x25d440][_0x31c2('0x66')])){_0x1a7509[_0x5a060e[_0x5466be[_0x25d440]['questionId']]]=_0x5466be[_0x25d440][_0x31c2('0x6a')];}}for(var _0x5330fb in _0x5a060e){if(!_0x1a7509[_0x31c2('0x38')](_0x5a060e[_0x5330fb])){_0x1a7509[_0x5a060e[_0x5330fb]]=null;}}_0x176b9c[_0x31c2('0x6b')](_0x1a7509);}return _0x176b9c;}})[_0x31c2('0x21')](function(_0x58ff4d){if(!_[_0x31c2('0x6c')](_0x58ff4d)){var _0x56d514=toCsv(_0x58ff4d);var _0x58de7a=Date['now']();fs[_0x31c2('0x6d')](util[_0x31c2('0x6e')](_0x31c2('0x6f'),_0x50710b[_0x31c2('0x46')]['id'],_0x58de7a),_0x56d514);_0x2ce76a[_0x31c2('0x70')]('Content-disposition',_0x31c2('0x71')+util['format'](_0x31c2('0x72'),_0x50710b[_0x31c2('0x46')]['id'],_0x58de7a));_0x2ce76a[_0x31c2('0x70')](_0x31c2('0x73'),_0x31c2('0x74'));return _0x2ce76a[_0x31c2('0x75')](util[_0x31c2('0x6e')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x50710b[_0x31c2('0x46')]['id'],_0x58de7a));}else{return _0x2ce76a[_0x31c2('0x25')](0xcc);}})[_0x31c2('0x44')](handleError(_0x2ce76a,null));}; \ No newline at end of file +var _0x7217=['UserProfileSection','find','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','pick','ProjectId','getAnswers','JscriptyAnswerReport','rows','number','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','answer','isEmpty','now','writeFileSync','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','setHeader','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','Content-Range','apply','reject','save','update','then','get','Projects','UserProfileResource','destroy','error','name','send','index','map','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','JscriptyProject','includeAll','include','findAll','catch','show','rawAttributes','options','body','user','role'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x7217,0x19e));var _0x7721=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0x7217[_0x4c7fb5];return _0x2e10ac;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];function respondWithStatusCode(_0x27b36b,_0x55b4ca){_0x55b4ca=_0x55b4ca||0xcc;return function(_0x2911ec){if(_0x2911ec){return _0x27b36b[_0x7721('0x1b')](_0x55b4ca);}return _0x27b36b['status'](_0x55b4ca)[_0x7721('0x1c')]();};}function respondWithResult(_0x30da54,_0x3f01c5){_0x3f01c5=_0x3f01c5||0xc8;return function(_0x2e9752){if(_0x2e9752){return _0x30da54['status'](_0x3f01c5)[_0x7721('0x1d')](_0x2e9752);}};}function respondWithFilteredResult(_0x25b1c0,_0x534f1b){return function(_0x4e199a){if(_0x4e199a){var _0x4b183e=_0x4e199a[_0x7721('0x1e')],_0x5ed54=_0x534f1b['offset'],_0x25a628=_0x534f1b[_0x7721('0x1f')]+_0x534f1b['limit'],_0x3cc909;if(_0x25a628>=_0x4b183e){_0x25a628=_0x4b183e;_0x3cc909=0xc8;}else{_0x3cc909=0xce;}_0x25b1c0[_0x7721('0x20')](_0x3cc909);return _0x25b1c0['set'](_0x7721('0x21'),_0x5ed54+'-'+_0x25a628+'/'+_0x4b183e)[_0x7721('0x1d')](_0x4e199a);}return null;};}function patchUpdates(_0x3ab5a5){return function(_0x3e140d){try{jsonpatch[_0x7721('0x22')](_0x3e140d,_0x3ab5a5,!![]);}catch(_0x40af90){return BPromise[_0x7721('0x23')](_0x40af90);}return _0x3e140d[_0x7721('0x24')]();};}function saveUpdates(_0x3b29ac,_0xaeccc4){return function(_0x4ce1db){if(_0x4ce1db){return _0x4ce1db[_0x7721('0x25')](_0x3b29ac)[_0x7721('0x26')](function(_0x3a053f){return _0x3a053f;});}return null;};}function removeEntity(_0xd8ad3c,_0x57140c){return function(_0x28f5a6){if(_0x28f5a6){return _0x28f5a6['destroy']()[_0x7721('0x26')](function(){var _0x288e3a=_0x28f5a6[_0x7721('0x27')]({'plain':!![]});var _0x1caad8=_0x7721('0x28');return db[_0x7721('0x29')][_0x7721('0x2a')]({'where':{'type':_0x1caad8,'resourceId':_0x288e3a['id']}})['then'](function(){return _0x28f5a6;});})[_0x7721('0x26')](function(){_0xd8ad3c[_0x7721('0x20')](0xcc)[_0x7721('0x1c')]();});}};}function handleEntityNotFound(_0x1f67c7,_0x40d550){return function(_0x16355a){if(!_0x16355a){_0x1f67c7[_0x7721('0x1b')](0x194);}return _0x16355a;};}function handleError(_0xf753f1,_0x40f367){_0x40f367=_0x40f367||0x1f4;return function(_0x52316e){logger[_0x7721('0x2b')](_0x52316e['stack']);if(_0x52316e['name']){delete _0x52316e[_0x7721('0x2c')];}_0xf753f1[_0x7721('0x20')](_0x40f367)[_0x7721('0x2d')](_0x52316e);};}exports[_0x7721('0x2e')]=function(_0x1ea4d,_0x37b9f0){var _0xd7d703={},_0x1da2d8={},_0x5c54f0={'count':0x0,'rows':[]};var _0x471651=_[_0x7721('0x2f')](db['JscriptyProject']['rawAttributes'],function(_0xfde9ec){return{'name':_0xfde9ec[_0x7721('0x30')],'type':_0xfde9ec['type'][_0x7721('0x31')]};});_0x1da2d8[_0x7721('0x32')]=_[_0x7721('0x2f')](_0x471651,'name');_0x1da2d8[_0x7721('0x33')]=_[_0x7721('0x34')](_0x1ea4d[_0x7721('0x33')]);_0x1da2d8[_0x7721('0x35')]=_[_0x7721('0x36')](_0x1da2d8['model'],_0x1da2d8[_0x7721('0x33')]);_0xd7d703[_0x7721('0x37')]=_[_0x7721('0x36')](_0x1da2d8['model'],qs[_0x7721('0x38')](_0x1ea4d[_0x7721('0x33')]['fields']));_0xd7d703[_0x7721('0x37')]=_0xd7d703['attributes'][_0x7721('0x39')]?_0xd7d703[_0x7721('0x37')]:_0x1da2d8[_0x7721('0x32')];if(!_0x1ea4d[_0x7721('0x33')][_0x7721('0x3a')](_0x7721('0x3b'))){_0xd7d703[_0x7721('0x3c')]=qs[_0x7721('0x3c')](_0x1ea4d[_0x7721('0x33')][_0x7721('0x3c')]);_0xd7d703[_0x7721('0x1f')]=qs['offset'](_0x1ea4d[_0x7721('0x33')]['offset']);}_0xd7d703[_0x7721('0x3d')]=qs[_0x7721('0x3e')](_0x1ea4d[_0x7721('0x33')][_0x7721('0x3e')]);_0xd7d703[_0x7721('0x3f')]=qs[_0x7721('0x35')](_['pick'](_0x1ea4d['query'],_0x1da2d8['filters']));if(_0x1ea4d['query'][_0x7721('0x40')]){_0xd7d703[_0x7721('0x3f')]=_[_0x7721('0x41')](_0xd7d703[_0x7721('0x3f')],{'$or':_['map'](_0x471651,function(_0xa389fa){if(_0xa389fa['type']!==_0x7721('0x42')){var _0x11f356={};_0x11f356[_0xa389fa['name']]={'$like':'%'+_0x1ea4d[_0x7721('0x33')][_0x7721('0x40')]+'%'};return _0x11f356;}})});}_0xd7d703=_['merge']({},_0xd7d703,_0x1ea4d['options']);var _0x3d84d3={'where':_0xd7d703[_0x7721('0x3f')]};return db[_0x7721('0x43')][_0x7721('0x1e')](_0x3d84d3)['then'](function(_0x2db173){_0x5c54f0[_0x7721('0x1e')]=_0x2db173;if(_0x1ea4d[_0x7721('0x33')][_0x7721('0x44')]){_0xd7d703[_0x7721('0x45')]=[{'all':!![]}];}return db['JscriptyProject'][_0x7721('0x46')](_0xd7d703);})['then'](function(_0xaa3216){_0x5c54f0['rows']=_0xaa3216;return _0x5c54f0;})[_0x7721('0x26')](respondWithFilteredResult(_0x37b9f0,_0xd7d703))[_0x7721('0x47')](handleError(_0x37b9f0,null));};exports[_0x7721('0x48')]=function(_0x49e0c5,_0x1453d4){var _0x11d853={'raw':![],'where':{'id':_0x49e0c5['params']['id']}},_0x1ad315={};_0x1ad315[_0x7721('0x32')]=_[_0x7721('0x34')](db[_0x7721('0x43')][_0x7721('0x49')]);_0x1ad315[_0x7721('0x33')]=_[_0x7721('0x34')](_0x49e0c5[_0x7721('0x33')]);_0x1ad315['filters']=_['intersection'](_0x1ad315[_0x7721('0x32')],_0x1ad315[_0x7721('0x33')]);_0x11d853[_0x7721('0x37')]=_[_0x7721('0x36')](_0x1ad315[_0x7721('0x32')],qs[_0x7721('0x38')](_0x49e0c5[_0x7721('0x33')][_0x7721('0x38')]));_0x11d853[_0x7721('0x37')]=_0x11d853[_0x7721('0x37')]['length']?_0x11d853['attributes']:_0x1ad315[_0x7721('0x32')];if(_0x49e0c5[_0x7721('0x33')][_0x7721('0x44')]){_0x11d853[_0x7721('0x45')]=[{'all':!![]}];}_0x11d853=_['merge']({},_0x11d853,_0x49e0c5[_0x7721('0x4a')]);return db[_0x7721('0x43')]['find'](_0x11d853)[_0x7721('0x26')](handleEntityNotFound(_0x1453d4,null))['then'](respondWithResult(_0x1453d4,null))[_0x7721('0x47')](handleError(_0x1453d4,null));};exports['create']=function(_0x334f23,_0x196be4){return db[_0x7721('0x43')]['create'](_0x334f23[_0x7721('0x4b')],{})[_0x7721('0x26')](function(_0x499381){var _0x223d93=_0x334f23[_0x7721('0x4c')][_0x7721('0x27')]({'plain':!![]});if(!_0x223d93)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x223d93[_0x7721('0x4d')]==='user'){var _0xdb1ca8=_0x499381[_0x7721('0x27')]({'plain':!![]});var _0x4738ef=_0x7721('0x28');return db[_0x7721('0x4e')][_0x7721('0x4f')]({'where':{'name':_0x4738ef,'userProfileId':_0x223d93[_0x7721('0x50')]},'raw':!![]})[_0x7721('0x26')](function(_0x694d2f){if(_0x694d2f&&_0x694d2f[_0x7721('0x51')]===0x0){return db[_0x7721('0x29')][_0x7721('0x52')]({'name':_0xdb1ca8[_0x7721('0x2c')],'resourceId':_0xdb1ca8['id'],'type':_0x694d2f[_0x7721('0x2c')],'sectionId':_0x694d2f['id']},{})[_0x7721('0x26')](function(){return _0x499381;});}else{return _0x499381;}})['catch'](function(_0x474f32){logger[_0x7721('0x2b')](_0x7721('0x53'),_0x474f32);throw _0x474f32;});}return _0x499381;})[_0x7721('0x26')](respondWithResult(_0x196be4,0xc9))[_0x7721('0x47')](handleError(_0x196be4,null));};exports[_0x7721('0x54')]=function(_0x267f5e,_0x57484c){var _0x234bee={'where':{'id':_0x267f5e[_0x7721('0x55')]['id']}},_0x17036e={};_0x17036e[_0x7721('0x32')]=_[_0x7721('0x34')](db[_0x7721('0x43')][_0x7721('0x49')]);_0x234bee[_0x7721('0x37')]=_[_0x7721('0x36')](_0x17036e[_0x7721('0x32')],qs[_0x7721('0x38')](_0x267f5e['query'][_0x7721('0x38')]));_0x234bee[_0x7721('0x37')]=_0x234bee[_0x7721('0x37')][_0x7721('0x39')]?_0x234bee[_0x7721('0x37')]:_0x17036e[_0x7721('0x32')];if(_0x267f5e[_0x7721('0x33')][_0x7721('0x44')]){_0x234bee[_0x7721('0x45')]=[{'all':!![]}];}_0x234bee=_[_0x7721('0x41')]({},_0x234bee,_0x267f5e[_0x7721('0x4a')]);return db[_0x7721('0x43')][_0x7721('0x4f')](_0x234bee)[_0x7721('0x26')](handleEntityNotFound(_0x57484c,null))[_0x7721('0x26')](function(_0x577f47){if(_0x577f47){var _0x50e9e9=_0x577f47['get']({'plain':!![]});_0x50e9e9=qs[_0x7721('0x56')](_0x50e9e9,['id','createdAt','updatedAt']);_0x267f5e['body']=_['omit'](_0x267f5e[_0x7721('0x4b')],['id',_0x7721('0x57'),_0x7721('0x58')]);return db['JscriptyProject'][_0x7721('0x52')](_['merge'](_0x50e9e9,_0x267f5e['body']),{'include':_0x267f5e['query'][_0x7721('0x44')]?[{'all':!![]}]:undefined})['then'](function(_0x48e7e3){var _0x54642a=_0x267f5e[_0x7721('0x4c')][_0x7721('0x27')]({'plain':!![]});if(!_0x54642a)throw new Error(_0x7721('0x59'));if(_0x54642a['role']===_0x7721('0x4c')){var _0x1f1890=_0x48e7e3[_0x7721('0x27')]({'plain':!![]});var _0x168343=_0x7721('0x28');return db[_0x7721('0x4e')][_0x7721('0x4f')]({'where':{'name':_0x168343,'userProfileId':_0x54642a[_0x7721('0x50')]},'raw':!![]})[_0x7721('0x26')](function(_0x197b73){if(_0x197b73&&_0x197b73[_0x7721('0x51')]===0x0){return db[_0x7721('0x29')][_0x7721('0x52')]({'name':_0x1f1890[_0x7721('0x2c')],'resourceId':_0x1f1890['id'],'type':_0x197b73[_0x7721('0x2c')],'sectionId':_0x197b73['id']},{})['then'](function(){return _0x48e7e3;});}else{return _0x48e7e3;}})[_0x7721('0x47')](function(_0x2c93b0){logger[_0x7721('0x2b')](_0x7721('0x53'),_0x2c93b0);throw _0x2c93b0;});}return _0x48e7e3;});}})['then'](respondWithResult(_0x57484c,0xc9))[_0x7721('0x47')](handleError(_0x57484c,null));};exports[_0x7721('0x25')]=function(_0x4c8284,_0x3e7df3){if(_0x4c8284['body']['id']){delete _0x4c8284[_0x7721('0x4b')]['id'];}return db[_0x7721('0x43')][_0x7721('0x4f')]({'where':{'id':_0x4c8284[_0x7721('0x55')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x3e7df3,null))[_0x7721('0x26')](saveUpdates(_0x4c8284[_0x7721('0x4b')],null))[_0x7721('0x26')](respondWithResult(_0x3e7df3,null))[_0x7721('0x47')](handleError(_0x3e7df3,null));};exports['destroy']=function(_0xf6056,_0x24444f){return db[_0x7721('0x43')][_0x7721('0x4f')]({'where':{'id':_0xf6056[_0x7721('0x55')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x24444f,null))[_0x7721('0x26')](removeEntity(_0x24444f,null))['catch'](handleError(_0x24444f,null));};exports[_0x7721('0x5a')]=function(_0xb19b84,_0x53c918,_0x192f2e){var _0x565c49={'raw':!![],'where':{}};var _0x14b543={};var _0x382800={'count':0x0,'rows':[]};return db[_0x7721('0x43')][_0x7721('0x5b')]({'where':{'id':_0xb19b84[_0x7721('0x55')]['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x53c918,null))[_0x7721('0x26')](function(_0x5dca04){if(_0x5dca04){_0x14b543[_0x7721('0x32')]=_[_0x7721('0x34')](db[_0x7721('0x5c')]['rawAttributes']);_0x14b543['query']=_['keys'](_0xb19b84['query']);_0x14b543['filters']=_[_0x7721('0x36')](_0x14b543[_0x7721('0x32')],_0x14b543['query']);_0x565c49[_0x7721('0x37')]=_[_0x7721('0x36')](_0x14b543[_0x7721('0x32')],qs[_0x7721('0x38')](_0xb19b84['query'][_0x7721('0x38')]));_0x565c49[_0x7721('0x37')]=_0x565c49[_0x7721('0x37')][_0x7721('0x39')]?_0x565c49[_0x7721('0x37')]:_0x14b543['model'];if(!_0xb19b84[_0x7721('0x33')][_0x7721('0x3a')](_0x7721('0x3b'))){_0x565c49['limit']=qs['limit'](_0xb19b84[_0x7721('0x33')][_0x7721('0x3c')]);_0x565c49[_0x7721('0x1f')]=qs[_0x7721('0x1f')](_0xb19b84[_0x7721('0x33')]['offset']);}_0x565c49['order']=qs[_0x7721('0x3e')](_0xb19b84[_0x7721('0x33')][_0x7721('0x3e')]);_0x565c49[_0x7721('0x3f')]=qs[_0x7721('0x35')](_[_0x7721('0x5d')](_0xb19b84[_0x7721('0x33')],_0x14b543['filters']));_0x565c49[_0x7721('0x3f')][_0x7721('0x5e')]=_0x5dca04['id'];if(_0xb19b84[_0x7721('0x33')]['filter']){_0x565c49[_0x7721('0x3f')]=_[_0x7721('0x41')](_0x565c49[_0x7721('0x3f')],{'$or':_[_0x7721('0x2f')](_0x565c49['attributes'],function(_0x4d4d6a){var _0x37f8f8={};_0x37f8f8[_0x4d4d6a]={'$like':'%'+_0xb19b84[_0x7721('0x33')][_0x7721('0x40')]+'%'};return _0x37f8f8;})});}_0x565c49=_[_0x7721('0x41')]({},_0x565c49,_0xb19b84[_0x7721('0x4a')]);return db[_0x7721('0x5c')]['count']({'where':_0x565c49[_0x7721('0x3f')]})[_0x7721('0x26')](function(_0x36d702){_0x382800['count']=_0x36d702;if(_0xb19b84[_0x7721('0x33')][_0x7721('0x44')]){_0x565c49[_0x7721('0x45')]=[{'all':!![]}];}return db[_0x7721('0x5c')][_0x7721('0x46')](_0x565c49);})['then'](function(_0x9c05e4){_0x382800['rows']=_0x9c05e4;return _0x382800;});}})[_0x7721('0x26')](respondWithFilteredResult(_0x53c918,_0x565c49))[_0x7721('0x47')](handleError(_0x53c918,null));};exports[_0x7721('0x5f')]=function(_0x7f0598,_0x963dbe,_0x438b9f){var _0x24fe2a={'raw':!![],'where':{}};var _0x123049={};var _0x2ec5f8={'count':0x0,'rows':[]};return db[_0x7721('0x43')][_0x7721('0x5b')]({'where':{'id':_0x7f0598['params']['id']}})[_0x7721('0x26')](handleEntityNotFound(_0x963dbe,null))[_0x7721('0x26')](function(_0x39194e){if(_0x39194e){_0x123049['model']=_[_0x7721('0x34')](db[_0x7721('0x60')][_0x7721('0x49')]);_0x123049[_0x7721('0x33')]=_[_0x7721('0x34')](_0x7f0598['query']);_0x123049[_0x7721('0x35')]=_[_0x7721('0x36')](_0x123049[_0x7721('0x32')],_0x123049[_0x7721('0x33')]);_0x24fe2a[_0x7721('0x37')]=_[_0x7721('0x36')](_0x123049['model'],qs[_0x7721('0x38')](_0x7f0598[_0x7721('0x33')]['fields']));_0x24fe2a[_0x7721('0x37')]=_0x24fe2a['attributes'][_0x7721('0x39')]?_0x24fe2a[_0x7721('0x37')]:_0x123049['model'];if(!_0x7f0598[_0x7721('0x33')]['hasOwnProperty']('nolimit')){_0x24fe2a['limit']=qs[_0x7721('0x3c')](_0x7f0598[_0x7721('0x33')][_0x7721('0x3c')]);_0x24fe2a['offset']=qs['offset'](_0x7f0598['query'][_0x7721('0x1f')]);}_0x24fe2a[_0x7721('0x3d')]=qs[_0x7721('0x3e')](_0x7f0598[_0x7721('0x33')][_0x7721('0x3e')]);_0x24fe2a[_0x7721('0x3f')]=qs['filters'](_[_0x7721('0x5d')](_0x7f0598[_0x7721('0x33')],_0x123049[_0x7721('0x35')]));_0x24fe2a[_0x7721('0x3f')][_0x7721('0x5e')]=_0x39194e['id'];if(_0x7f0598[_0x7721('0x33')][_0x7721('0x40')]){_0x24fe2a[_0x7721('0x3f')]=_[_0x7721('0x41')](_0x24fe2a[_0x7721('0x3f')],{'$or':_[_0x7721('0x2f')](_0x24fe2a[_0x7721('0x37')],function(_0x58429d){var _0x4bfa29={};_0x4bfa29[_0x58429d]={'$like':'%'+_0x7f0598[_0x7721('0x33')][_0x7721('0x40')]+'%'};return _0x4bfa29;})});}_0x24fe2a=_['merge']({},_0x24fe2a,_0x7f0598[_0x7721('0x4a')]);return db['JscriptyAnswerReport']['count']({'where':_0x24fe2a[_0x7721('0x3f')]})['then'](function(_0x580a69){_0x2ec5f8[_0x7721('0x1e')]=_0x580a69;if(_0x7f0598[_0x7721('0x33')][_0x7721('0x44')]){_0x24fe2a[_0x7721('0x45')]=[{'all':!![]}];}return db[_0x7721('0x60')]['findAll'](_0x24fe2a);})[_0x7721('0x26')](function(_0xcf2c06){_0x2ec5f8[_0x7721('0x61')]=_0xcf2c06;return _0x2ec5f8;});}})[_0x7721('0x26')](respondWithFilteredResult(_0x963dbe,_0x24fe2a))['catch'](handleError(_0x963dbe,null));};function char(_0x52fcc1){return _0x7721('0x62')===typeof _0x52fcc1?String[_0x7721('0x63')]['apply'](null,arguments):_0x52fcc1;}function needsEncapsulation(_0x2005d1){return!!_0x2005d1&&(_0x2005d1[_0x7721('0x64')]()['indexOf'](char(0xd))>=0x0||_0x2005d1['toString']()[_0x7721('0x65')](char(0xa))>=0x0||_0x2005d1[_0x7721('0x64')]()[_0x7721('0x65')](char(0x2c))>=0x0||_0x2005d1[_0x7721('0x64')]()[_0x7721('0x65')](char(0x22))>=0x0);}function encapsulate(_0x29053e){var _0x996071=char(0x22),_0x2dafa0='\x5c'+char(0x22),_0x59de30=_0x29053e[_0x7721('0x64')]()[_0x7721('0x66')](new RegExp(_0x996071,'g'),_0x2dafa0);return _0x996071+_0x59de30+_0x996071;}exports[_0x7721('0x67')]=function(_0x1c4f14,_0xe1c795,_0x9b5f60){var _0x9547c4,_0x4a7cd4;var _0x201f3d={'where':{'ProjectId':_0x1c4f14[_0x7721('0x55')]['id']}};if(_0x1c4f14['query'][_0x7721('0x68')]){_0x201f3d[_0x7721('0x3f')][_0x7721('0x69')]=JSON[_0x7721('0x6a')](_0x1c4f14[_0x7721('0x33')][_0x7721('0x68')]);}return db[_0x7721('0x5c')][_0x7721('0x46')](_0x201f3d)[_0x7721('0x26')](handleEntityNotFound(_0xe1c795,null))[_0x7721('0x26')](function(_0x4eb558){if(_0x4eb558){_0x9547c4=_0x4eb558;return db[_0x7721('0x6b')][_0x7721('0x46')]({'where':{'SessionId':{'$in':_[_0x7721('0x2f')](_0x9547c4,'id')},'ProjectId':_0x1c4f14[_0x7721('0x55')]['id']},'order':_0x7721('0x6c')});}})[_0x7721('0x26')](handleEntityNotFound(_0xe1c795,null))[_0x7721('0x26')](function(_0x1cfee2){if(_0x1cfee2){_0x4a7cd4=_0x1cfee2;var _0x425327={};for(var _0x42ee11=0x0,_0x29b576=_0x4a7cd4[_0x7721('0x39')];_0x42ee11<_0x29b576;_0x42ee11++){if(!_0x425327[_0x7721('0x3a')](_0x4a7cd4[_0x42ee11][_0x7721('0x6d')])){_0x425327[_0x4a7cd4[_0x42ee11][_0x7721('0x6d')]]=needsEncapsulation(_0x4a7cd4[_0x42ee11][_0x7721('0x6e')])?encapsulate(_0x4a7cd4[_0x42ee11][_0x7721('0x6e')]):_0x4a7cd4[_0x42ee11][_0x7721('0x6e')];}}var _0xfe14f3=[],_0x398ea0={};for(var _0x5f46d1=0x0,_0x3fc25c=_0x9547c4['length'];_0x5f46d1<_0x3fc25c;_0x5f46d1++){_0x398ea0={'ProjectId':_0x1c4f14[_0x7721('0x55')]['id'],'SessionId':_0x9547c4[_0x5f46d1]['id'],'StartTime':moment(_0x9547c4[_0x5f46d1][_0x7721('0x69')])[_0x7721('0x6f')](_0x7721('0x70'))};for(var _0x7c69ac=0x0,_0x52b72d=_0x4a7cd4['length'];_0x7c69ac<_0x52b72d;_0x7c69ac++){if(_0x4a7cd4[_0x7c69ac]['SessionId']==_0x9547c4[_0x5f46d1]['id']&&_0x425327['hasOwnProperty'](_0x4a7cd4[_0x7c69ac][_0x7721('0x6d')])){_0x398ea0[_0x425327[_0x4a7cd4[_0x7c69ac][_0x7721('0x6d')]]]=_0x4a7cd4[_0x7c69ac][_0x7721('0x71')];}}for(var _0x43e4ff in _0x425327){if(!_0x398ea0[_0x7721('0x3a')](_0x425327[_0x43e4ff])){_0x398ea0[_0x425327[_0x43e4ff]]=null;}}_0xfe14f3['push'](_0x398ea0);}return _0xfe14f3;}})[_0x7721('0x26')](function(_0x501a11){if(!_[_0x7721('0x72')](_0x501a11)){var _0x13d2f1=toCsv(_0x501a11);var _0x317717=Date[_0x7721('0x73')]();fs[_0x7721('0x74')](util[_0x7721('0x6f')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x1c4f14[_0x7721('0x55')]['id'],_0x317717),_0x13d2f1);_0xe1c795['setHeader']('Content-disposition',_0x7721('0x75')+util[_0x7721('0x6f')](_0x7721('0x76'),_0x1c4f14[_0x7721('0x55')]['id'],_0x317717));_0xe1c795[_0x7721('0x77')]('Content-type',_0x7721('0x78'));return _0xe1c795[_0x7721('0x79')](util[_0x7721('0x6f')](_0x7721('0x7a'),_0x1c4f14[_0x7721('0x55')]['id'],_0x317717));}else{return _0xe1c795[_0x7721('0x1b')](0xcc);}})[_0x7721('0x47')](handleError(_0xe1c795,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 96da1f9..9a1fefd 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 _0xad91=['../../config/environment','./jscriptyProject.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad91,0xd0));var _0x1ad9=function(_0x4282aa,_0xe66504){_0x4282aa=_0x4282aa-0x0;var _0x5085f0=_0xad91[_0x4282aa];return _0x5085f0;};'use strict';var _=require(_0x1ad9('0x0'));var util=require(_0x1ad9('0x1'));var logger=require(_0x1ad9('0x2'))(_0x1ad9('0x3'));var moment=require('moment');var BPromise=require(_0x1ad9('0x4'));var rp=require(_0x1ad9('0x5'));var fs=require('fs');var path=require(_0x1ad9('0x6'));var rimraf=require(_0x1ad9('0x7'));var config=require(_0x1ad9('0x8'));var attributes=require(_0x1ad9('0x9'));module[_0x1ad9('0xa')]=function(_0x3f764f,_0x458581){return _0x3f764f[_0x1ad9('0xb')]('JscriptyProject',attributes,{'tableName':'jscripty_projects','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb75b=['bluebird','request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','JscriptyProject','jscripty_projects','lodash','api','moment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb75b,0x142));var _0xbb75=function(_0x5d571c,_0x5b150e){_0x5d571c=_0x5d571c-0x0;var _0x365c03=_0xb75b[_0x5d571c];return _0x365c03;};'use strict';var _=require(_0xbb75('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbb75('0x1'));var moment=require(_0xbb75('0x2'));var BPromise=require(_0xbb75('0x3'));var rp=require(_0xbb75('0x4'));var fs=require('fs');var path=require(_0xbb75('0x5'));var rimraf=require(_0xbb75('0x6'));var config=require(_0xbb75('0x7'));var attributes=require(_0xbb75('0x8'));module[_0xbb75('0x9')]=function(_0x48092f,_0x356f23){return _0x48092f[_0xbb75('0xa')](_0xbb75('0xb'),attributes,{'tableName':_0xbb75('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.rpc.js b/server/api/jscriptyProject/jscriptyProject.rpc.js index e4c4646..5555be1 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 _0x1658=['bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','JscriptyProject,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x590455,_0x338a42){var _0x1b5a98=function(_0x29f08c){while(--_0x29f08c){_0x590455['push'](_0x590455['shift']());}};_0x1b5a98(++_0x338a42);}(_0x1658,0x106));var _0x8165=function(_0x36c538,_0x265763){_0x36c538=_0x36c538-0x0;var _0x324dbe=_0x1658[_0x36c538];return _0x324dbe;};'use strict';var _=require(_0x8165('0x0'));var util=require(_0x8165('0x1'));var moment=require('moment');var BPromise=require(_0x8165('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8165('0x3'));var db=require(_0x8165('0x4'))['db'];var utils=require(_0x8165('0x5'));var logger=require(_0x8165('0x6'))(_0x8165('0x7'));var config=require('../../config/environment');var jayson=require(_0x8165('0x8'));var client=jayson[_0x8165('0x9')][_0x8165('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x306b57,_0x206f93,_0x6d31fb){return new BPromise(function(_0x1ac700,_0x5aa298){return client[_0x8165('0xb')](_0x306b57,_0x6d31fb)[_0x8165('0xc')](function(_0x21ea10){logger[_0x8165('0xd')]('JscriptyProject,\x20%s,\x20%s',_0x206f93,_0x8165('0xe'));logger[_0x8165('0xf')](_0x8165('0x10'),_0x206f93,_0x8165('0xe'),JSON[_0x8165('0x11')](_0x21ea10));if(_0x21ea10[_0x8165('0x12')]){if(_0x21ea10[_0x8165('0x12')][_0x8165('0x13')]===0x1f4){logger[_0x8165('0x12')](_0x8165('0x14'),_0x206f93,_0x21ea10[_0x8165('0x12')][_0x8165('0x15')]);return _0x5aa298(_0x21ea10[_0x8165('0x12')][_0x8165('0x15')]);}logger['error'](_0x8165('0x14'),_0x206f93,_0x21ea10[_0x8165('0x12')]['message']);return _0x1ac700(_0x21ea10[_0x8165('0x12')]['message']);}else{logger[_0x8165('0xd')](_0x8165('0x14'),_0x206f93,'request\x20sent');_0x1ac700(_0x21ea10[_0x8165('0x16')][_0x8165('0x15')]);}})[_0x8165('0x17')](function(_0x4e832f){logger[_0x8165('0x12')](_0x8165('0x14'),_0x206f93,_0x4e832f);_0x5aa298(_0x4e832f);});});} \ No newline at end of file +var _0xf229=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x134f20,_0x4d9d50){var _0x37a3a9=function(_0x3faf0d){while(--_0x3faf0d){_0x134f20['push'](_0x134f20['shift']());}};_0x37a3a9(++_0x4d9d50);}(_0xf229,0x192));var _0x9f22=function(_0x51b1ec,_0x4a0ad6){_0x51b1ec=_0x51b1ec-0x0;var _0x16fb30=_0xf229[_0x51b1ec];return _0x16fb30;};'use strict';var _=require(_0x9f22('0x0'));var util=require(_0x9f22('0x1'));var moment=require(_0x9f22('0x2'));var BPromise=require(_0x9f22('0x3'));var rs=require(_0x9f22('0x4'));var fs=require('fs');var Redis=require(_0x9f22('0x5'));var db=require(_0x9f22('0x6'))['db'];var utils=require(_0x9f22('0x7'));var logger=require('../../config/logger')(_0x9f22('0x8'));var config=require(_0x9f22('0x9'));var jayson=require(_0x9f22('0xa'));var client=jayson[_0x9f22('0xb')][_0x9f22('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x50ae6d,_0x51ae2e,_0x1e7778){return new BPromise(function(_0xae3b25,_0x261043){return client[_0x9f22('0xd')](_0x50ae6d,_0x1e7778)[_0x9f22('0xe')](function(_0x476c29){logger[_0x9f22('0xf')](_0x9f22('0x10'),_0x51ae2e,_0x9f22('0x11'));logger[_0x9f22('0x12')](_0x9f22('0x13'),_0x51ae2e,_0x9f22('0x11'),JSON[_0x9f22('0x14')](_0x476c29));if(_0x476c29[_0x9f22('0x15')]){if(_0x476c29[_0x9f22('0x15')]['code']===0x1f4){logger[_0x9f22('0x15')](_0x9f22('0x10'),_0x51ae2e,_0x476c29[_0x9f22('0x15')][_0x9f22('0x16')]);return _0x261043(_0x476c29[_0x9f22('0x15')][_0x9f22('0x16')]);}logger[_0x9f22('0x15')](_0x9f22('0x10'),_0x51ae2e,_0x476c29[_0x9f22('0x15')][_0x9f22('0x16')]);return _0xae3b25(_0x476c29[_0x9f22('0x15')][_0x9f22('0x16')]);}else{logger[_0x9f22('0xf')](_0x9f22('0x10'),_0x51ae2e,_0x9f22('0x11'));_0xae3b25(_0x476c29['result'][_0x9f22('0x16')]);}})[_0x9f22('0x17')](function(_0x58a580){logger[_0x9f22('0x15')](_0x9f22('0x10'),_0x51ae2e,_0x58a580);_0x261043(_0x58a580);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index de0481d..804b283 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 _0xb1b4=['get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller'];(function(_0x4e457b,_0x31b37c){var _0x248e7b=function(_0x35d865){while(--_0x35d865){_0x4e457b['push'](_0x4e457b['shift']());}};_0x248e7b(++_0x31b37c);}(_0xb1b4,0x1af));var _0x4b1b=function(_0x19dd32,_0x5b5417){_0x19dd32=_0x19dd32-0x0;var _0x501852=_0xb1b4[_0x19dd32];return _0x501852;};'use strict';var multer=require(_0x4b1b('0x0'));var util=require('util');var path=require(_0x4b1b('0x1'));var timeout=require(_0x4b1b('0x2'));var express=require(_0x4b1b('0x3'));var router=express[_0x4b1b('0x4')]();var auth=require(_0x4b1b('0x5'));var interaction=require(_0x4b1b('0x6'));var config=require(_0x4b1b('0x7'));var controller=require(_0x4b1b('0x8'));router[_0x4b1b('0x9')]('/',auth[_0x4b1b('0xa')](),controller[_0x4b1b('0xb')]);router['get'](_0x4b1b('0xc'),auth[_0x4b1b('0xa')](),controller[_0x4b1b('0xd')]);router[_0x4b1b('0x9')]('/:id',auth[_0x4b1b('0xa')](),controller['show']);router[_0x4b1b('0xe')]('/',auth[_0x4b1b('0xa')](),controller[_0x4b1b('0xf')]);router[_0x4b1b('0x10')](_0x4b1b('0x11'),auth['isAuthenticated'](),controller[_0x4b1b('0x12')]);router[_0x4b1b('0x13')](_0x4b1b('0x11'),auth[_0x4b1b('0xa')](),controller[_0x4b1b('0x14')]);module[_0x4b1b('0x15')]=router; \ No newline at end of file +var _0x300d=['create','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show','post'];(function(_0x22b53f,_0xaa88ef){var _0x552c0a=function(_0x33c990){while(--_0x33c990){_0x22b53f['push'](_0x22b53f['shift']());}};_0x552c0a(++_0xaa88ef);}(_0x300d,0x191));var _0xd300=function(_0x40fe26,_0x1a9bc0){_0x40fe26=_0x40fe26-0x0;var _0x469998=_0x300d[_0x40fe26];return _0x469998;};'use strict';var multer=require(_0xd300('0x0'));var util=require(_0xd300('0x1'));var path=require('path');var timeout=require(_0xd300('0x2'));var express=require(_0xd300('0x3'));var router=express[_0xd300('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd300('0x5'));var config=require(_0xd300('0x6'));var controller=require('./jscriptyQuestionReport.controller');router[_0xd300('0x7')]('/',auth[_0xd300('0x8')](),controller['index']);router[_0xd300('0x7')](_0xd300('0x9'),auth[_0xd300('0x8')](),controller[_0xd300('0xa')]);router['get']('/:id',auth[_0xd300('0x8')](),controller[_0xd300('0xb')]);router[_0xd300('0xc')]('/',auth[_0xd300('0x8')](),controller[_0xd300('0xd')]);router['put']('/:id',auth[_0xd300('0x8')](),controller[_0xd300('0xe')]);router[_0xd300('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xd300('0x10')]);module[_0xd300('0x11')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index 9140e7e..db04627 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 _0x2d3a=['STRING','TEXT','long','sequelize'];(function(_0x44529c,_0x50b252){var _0xe5c58e=function(_0x53f7c5){while(--_0x53f7c5){_0x44529c['push'](_0x44529c['shift']());}};_0xe5c58e(++_0x50b252);}(_0x2d3a,0x193));var _0xa2d3=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0x2d3a[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0xa2d3('0x0'));module['exports']={'question':{'type':Sequelize[_0xa2d3('0x1')]},'answer':{'type':Sequelize[_0xa2d3('0x2')](_0xa2d3('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xa2d3('0x1')]},'queue':{'type':Sequelize[_0xa2d3('0x1')]},'uniqueid':{'type':Sequelize[_0xa2d3('0x1')]},'calleridname':{'type':Sequelize[_0xa2d3('0x1')]},'calleridnum':{'type':Sequelize[_0xa2d3('0x1')]},'questionId':{'type':Sequelize[_0xa2d3('0x1')]}}; \ No newline at end of file +var _0xb634=['STRING','long','sequelize','exports'];(function(_0x17814f,_0x1ede72){var _0x139b49=function(_0x4d2017){while(--_0x4d2017){_0x17814f['push'](_0x17814f['shift']());}};_0x139b49(++_0x1ede72);}(_0xb634,0x136));var _0x4b63=function(_0x104a20,_0x40c1d3){_0x104a20=_0x104a20-0x0;var _0x2ab4ff=_0xb634[_0x104a20];return _0x2ab4ff;};'use strict';var Sequelize=require(_0x4b63('0x0'));module[_0x4b63('0x1')]={'question':{'type':Sequelize[_0x4b63('0x2')]},'answer':{'type':Sequelize['TEXT'](_0x4b63('0x3'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x4b63('0x2')]},'queue':{'type':Sequelize[_0x4b63('0x2')]},'uniqueid':{'type':Sequelize[_0x4b63('0x2')]},'calleridname':{'type':Sequelize[_0x4b63('0x2')]},'calleridnum':{'type':Sequelize[_0x4b63('0x2')]},'questionId':{'type':Sequelize[_0x4b63('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 0274c0d..0ca523f 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 _0xe642=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','end','stack','name','send','JscriptyQuestionReport','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','findAll','rows','catch','show','rawAttributes','fields','length','include','find','create','body','params','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js'];(function(_0x2f8ab7,_0x2939fd){var _0x3f0a96=function(_0x41da5a){while(--_0x41da5a){_0x2f8ab7['push'](_0x2f8ab7['shift']());}};_0x3f0a96(++_0x2939fd);}(_0xe642,0x128));var _0x2e64=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe642[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x2e64('0x0'));var emlformat=require(_0x2e64('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x2e64('0x2'));var jsonpatch=require(_0x2e64('0x3'));var rp=require('request-promise');var moment=require(_0x2e64('0x4'));var BPromise=require(_0x2e64('0x5'));var Mustache=require(_0x2e64('0x6'));var util=require(_0x2e64('0x7'));var path=require(_0x2e64('0x8'));var sox=require(_0x2e64('0x9'));var csv=require(_0x2e64('0xa'));var ejs=require(_0x2e64('0xb'));var fs=require('fs');var _=require(_0x2e64('0xc'));var squel=require(_0x2e64('0xd'));var crypto=require('crypto');var jsforce=require(_0x2e64('0xe'));var deskjs=require(_0x2e64('0xf'));var toCsv=require(_0x2e64('0xa'));var querystring=require(_0x2e64('0x10'));var Papa=require(_0x2e64('0x11'));var Redis=require('ioredis');var authService=require(_0x2e64('0x12'));var qs=require(_0x2e64('0x13'));var as=require(_0x2e64('0x14'));var hardwareService=require(_0x2e64('0x15'));var logger=require(_0x2e64('0x16'))(_0x2e64('0x17'));var utils=require(_0x2e64('0x18'));var config=require(_0x2e64('0x19'));var db=require(_0x2e64('0x1a'))['db'];function respondWithStatusCode(_0x31cfb8,_0x5033a1){_0x5033a1=_0x5033a1||0xcc;return function(_0x364414){if(_0x364414){return _0x31cfb8[_0x2e64('0x1b')](_0x5033a1);}return _0x31cfb8[_0x2e64('0x1c')](_0x5033a1)['end']();};}function respondWithResult(_0x3ae8c5,_0x361e7a){_0x361e7a=_0x361e7a||0xc8;return function(_0x3961fe){if(_0x3961fe){return _0x3ae8c5[_0x2e64('0x1c')](_0x361e7a)[_0x2e64('0x1d')](_0x3961fe);}};}function respondWithFilteredResult(_0x460ee,_0x307009){return function(_0x136868){if(_0x136868){var _0x19a83f=_0x136868['count'],_0x5a8854=_0x307009['offset'],_0x8a1a35=_0x307009[_0x2e64('0x1e')]+_0x307009[_0x2e64('0x1f')],_0x456006;if(_0x8a1a35>=_0x19a83f){_0x8a1a35=_0x19a83f;_0x456006=0xc8;}else{_0x456006=0xce;}_0x460ee[_0x2e64('0x1c')](_0x456006);return _0x460ee[_0x2e64('0x20')](_0x2e64('0x21'),_0x5a8854+'-'+_0x8a1a35+'/'+_0x19a83f)[_0x2e64('0x1d')](_0x136868);}return null;};}function patchUpdates(_0x413a8b){return function(_0x1ba360){try{jsonpatch[_0x2e64('0x22')](_0x1ba360,_0x413a8b,!![]);}catch(_0x568436){return BPromise['reject'](_0x568436);}return _0x1ba360[_0x2e64('0x23')]();};}function saveUpdates(_0x183f4e,_0x2652d3){return function(_0x1caae7){if(_0x1caae7){return _0x1caae7[_0x2e64('0x24')](_0x183f4e)[_0x2e64('0x25')](function(_0x2d02ed){return _0x2d02ed;});}return null;};}function removeEntity(_0x2145db,_0x2d0ee7){return function(_0x53343b){if(_0x53343b){return _0x53343b[_0x2e64('0x26')]()['then'](function(){_0x2145db[_0x2e64('0x1c')](0xcc)[_0x2e64('0x27')]();});}};}function handleEntityNotFound(_0x1002b0,_0x188398){return function(_0x41192f){if(!_0x41192f){_0x1002b0[_0x2e64('0x1b')](0x194);}return _0x41192f;};}function handleError(_0x2fa291,_0x164582){_0x164582=_0x164582||0x1f4;return function(_0x98df4c){logger['error'](_0x98df4c[_0x2e64('0x28')]);if(_0x98df4c[_0x2e64('0x29')]){delete _0x98df4c[_0x2e64('0x29')];}_0x2fa291[_0x2e64('0x1c')](_0x164582)[_0x2e64('0x2a')](_0x98df4c);};}exports['index']=function(_0x30b136,_0x10b254){var _0x2eadd3={},_0x3f421d={},_0x401de5={'count':0x0,'rows':[]};var _0x3013b7=_['map'](db[_0x2e64('0x2b')]['rawAttributes'],function(_0x3072b8){return{'name':_0x3072b8[_0x2e64('0x2c')],'type':_0x3072b8[_0x2e64('0x2d')][_0x2e64('0x2e')]};});_0x3f421d[_0x2e64('0x2f')]=_[_0x2e64('0x30')](_0x3013b7,_0x2e64('0x29'));_0x3f421d[_0x2e64('0x31')]=_[_0x2e64('0x32')](_0x30b136['query']);_0x3f421d[_0x2e64('0x33')]=_[_0x2e64('0x34')](_0x3f421d[_0x2e64('0x2f')],_0x3f421d['query']);_0x2eadd3['attributes']=_[_0x2e64('0x34')](_0x3f421d[_0x2e64('0x2f')],qs['fields'](_0x30b136[_0x2e64('0x31')]['fields']));_0x2eadd3[_0x2e64('0x35')]=_0x2eadd3[_0x2e64('0x35')]['length']?_0x2eadd3[_0x2e64('0x35')]:_0x3f421d['model'];if(!_0x30b136[_0x2e64('0x31')][_0x2e64('0x36')](_0x2e64('0x37'))){_0x2eadd3['limit']=qs[_0x2e64('0x1f')](_0x30b136[_0x2e64('0x31')][_0x2e64('0x1f')]);_0x2eadd3[_0x2e64('0x1e')]=qs[_0x2e64('0x1e')](_0x30b136['query'][_0x2e64('0x1e')]);}_0x2eadd3[_0x2e64('0x38')]=qs[_0x2e64('0x39')](_0x30b136[_0x2e64('0x31')][_0x2e64('0x39')]);_0x2eadd3[_0x2e64('0x3a')]=qs['filters'](_['pick'](_0x30b136[_0x2e64('0x31')],_0x3f421d[_0x2e64('0x33')]));if(_0x30b136[_0x2e64('0x31')][_0x2e64('0x3b')]){_0x2eadd3[_0x2e64('0x3a')]=_['merge'](_0x2eadd3[_0x2e64('0x3a')],{'$or':_['map'](_0x3013b7,function(_0x1336c1){if(_0x1336c1[_0x2e64('0x2d')]!==_0x2e64('0x3c')){var _0x55a05d={};_0x55a05d[_0x1336c1[_0x2e64('0x29')]]={'$like':'%'+_0x30b136['query'][_0x2e64('0x3b')]+'%'};return _0x55a05d;}})});}_0x2eadd3=_[_0x2e64('0x3d')]({},_0x2eadd3,_0x30b136[_0x2e64('0x3e')]);var _0x157b2e={'where':_0x2eadd3[_0x2e64('0x3a')]};return db[_0x2e64('0x2b')][_0x2e64('0x3f')](_0x157b2e)['then'](function(_0x1b517a){_0x401de5[_0x2e64('0x3f')]=_0x1b517a;if(_0x30b136[_0x2e64('0x31')][_0x2e64('0x40')]){_0x2eadd3['include']=[{'all':!![]}];}return db[_0x2e64('0x2b')][_0x2e64('0x41')](_0x2eadd3);})[_0x2e64('0x25')](function(_0x5b679f){_0x401de5[_0x2e64('0x42')]=_0x5b679f;return _0x401de5;})[_0x2e64('0x25')](respondWithFilteredResult(_0x10b254,_0x2eadd3))[_0x2e64('0x43')](handleError(_0x10b254,null));};exports[_0x2e64('0x44')]=function(_0x5e51fd,_0x404fa5){var _0x5bd1fa={'raw':!![],'where':{'id':_0x5e51fd['params']['id']}},_0x4869ab={};_0x4869ab[_0x2e64('0x2f')]=_['keys'](db[_0x2e64('0x2b')][_0x2e64('0x45')]);_0x4869ab[_0x2e64('0x31')]=_['keys'](_0x5e51fd['query']);_0x4869ab['filters']=_['intersection'](_0x4869ab[_0x2e64('0x2f')],_0x4869ab[_0x2e64('0x31')]);_0x5bd1fa[_0x2e64('0x35')]=_[_0x2e64('0x34')](_0x4869ab['model'],qs[_0x2e64('0x46')](_0x5e51fd['query'][_0x2e64('0x46')]));_0x5bd1fa[_0x2e64('0x35')]=_0x5bd1fa[_0x2e64('0x35')][_0x2e64('0x47')]?_0x5bd1fa[_0x2e64('0x35')]:_0x4869ab[_0x2e64('0x2f')];if(_0x5e51fd[_0x2e64('0x31')][_0x2e64('0x40')]){_0x5bd1fa[_0x2e64('0x48')]=[{'all':!![]}];}_0x5bd1fa=_[_0x2e64('0x3d')]({},_0x5bd1fa,_0x5e51fd[_0x2e64('0x3e')]);return db[_0x2e64('0x2b')][_0x2e64('0x49')](_0x5bd1fa)[_0x2e64('0x25')](handleEntityNotFound(_0x404fa5,null))['then'](respondWithResult(_0x404fa5,null))[_0x2e64('0x43')](handleError(_0x404fa5,null));};exports[_0x2e64('0x4a')]=function(_0xf14071,_0x40bc6e){return db['JscriptyQuestionReport'][_0x2e64('0x4a')](_0xf14071[_0x2e64('0x4b')],{})[_0x2e64('0x25')](respondWithResult(_0x40bc6e,0xc9))[_0x2e64('0x43')](handleError(_0x40bc6e,null));};exports[_0x2e64('0x24')]=function(_0x4ff75b,_0x56e66a){if(_0x4ff75b[_0x2e64('0x4b')]['id']){delete _0x4ff75b[_0x2e64('0x4b')]['id'];}return db['JscriptyQuestionReport'][_0x2e64('0x49')]({'where':{'id':_0x4ff75b[_0x2e64('0x4c')]['id']}})['then'](handleEntityNotFound(_0x56e66a,null))['then'](saveUpdates(_0x4ff75b['body'],null))[_0x2e64('0x25')](respondWithResult(_0x56e66a,null))['catch'](handleError(_0x56e66a,null));};exports[_0x2e64('0x26')]=function(_0x5a2dab,_0x164e50){return db['JscriptyQuestionReport']['find']({'where':{'id':_0x5a2dab['params']['id']}})[_0x2e64('0x25')](handleEntityNotFound(_0x164e50,null))[_0x2e64('0x25')](removeEntity(_0x164e50,null))[_0x2e64('0x43')](handleError(_0x164e50,null));};exports[_0x2e64('0x4d')]=function(_0x1ecbb3,_0x2cae6e){return db[_0x2e64('0x2b')][_0x2e64('0x4d')]()['then'](respondWithResult(_0x2cae6e,null))[_0x2e64('0x43')](handleError(_0x2cae6e,null));}; \ No newline at end of file +var _0xb296=['model','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','keys','JscriptyQuestionReport','length','options','find','create','body','update','describe','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','map','rawAttributes','type','query','filters','intersection','attributes'];(function(_0x120b1e,_0x4d2bec){var _0x186859=function(_0xed22d){while(--_0xed22d){_0x120b1e['push'](_0x120b1e['shift']());}};_0x186859(++_0x4d2bec);}(_0xb296,0x1ca));var _0x6b29=function(_0xb7e548,_0x3f7f37){_0xb7e548=_0xb7e548-0x0;var _0x2fa37f=_0xb296[_0xb7e548];return _0x2fa37f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6b29('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6b29('0x1'));var moment=require(_0x6b29('0x2'));var BPromise=require(_0x6b29('0x3'));var Mustache=require(_0x6b29('0x4'));var util=require(_0x6b29('0x5'));var path=require(_0x6b29('0x6'));var sox=require(_0x6b29('0x7'));var csv=require(_0x6b29('0x8'));var ejs=require(_0x6b29('0x9'));var fs=require('fs');var _=require(_0x6b29('0xa'));var squel=require(_0x6b29('0xb'));var crypto=require(_0x6b29('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x6b29('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6b29('0xe'));var Redis=require('ioredis');var authService=require(_0x6b29('0xf'));var qs=require(_0x6b29('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6b29('0x11'))(_0x6b29('0x12'));var utils=require(_0x6b29('0x13'));var config=require(_0x6b29('0x14'));var db=require(_0x6b29('0x15'))['db'];function respondWithStatusCode(_0x4867d8,_0xd21188){_0xd21188=_0xd21188||0xcc;return function(_0x2b1757){if(_0x2b1757){return _0x4867d8['sendStatus'](_0xd21188);}return _0x4867d8[_0x6b29('0x16')](_0xd21188)[_0x6b29('0x17')]();};}function respondWithResult(_0x3105e7,_0x5c8d34){_0x5c8d34=_0x5c8d34||0xc8;return function(_0x4931ff){if(_0x4931ff){return _0x3105e7[_0x6b29('0x16')](_0x5c8d34)[_0x6b29('0x18')](_0x4931ff);}};}function respondWithFilteredResult(_0x578b0e,_0x109268){return function(_0x2f4ca6){if(_0x2f4ca6){var _0x4d53d4=_0x2f4ca6[_0x6b29('0x19')],_0x136d52=_0x109268[_0x6b29('0x1a')],_0x33f405=_0x109268['offset']+_0x109268['limit'],_0x453c60;if(_0x33f405>=_0x4d53d4){_0x33f405=_0x4d53d4;_0x453c60=0xc8;}else{_0x453c60=0xce;}_0x578b0e['status'](_0x453c60);return _0x578b0e[_0x6b29('0x1b')](_0x6b29('0x1c'),_0x136d52+'-'+_0x33f405+'/'+_0x4d53d4)[_0x6b29('0x18')](_0x2f4ca6);}return null;};}function patchUpdates(_0x31a6e7){return function(_0x51ea85){try{jsonpatch[_0x6b29('0x1d')](_0x51ea85,_0x31a6e7,!![]);}catch(_0x17fb56){return BPromise[_0x6b29('0x1e')](_0x17fb56);}return _0x51ea85[_0x6b29('0x1f')]();};}function saveUpdates(_0x2f3cde,_0x1cca31){return function(_0x4a9d0c){if(_0x4a9d0c){return _0x4a9d0c['update'](_0x2f3cde)[_0x6b29('0x20')](function(_0x509ff0){return _0x509ff0;});}return null;};}function removeEntity(_0xdebbe2,_0xe35a39){return function(_0x21ad15){if(_0x21ad15){return _0x21ad15[_0x6b29('0x21')]()[_0x6b29('0x20')](function(){_0xdebbe2[_0x6b29('0x16')](0xcc)[_0x6b29('0x17')]();});}};}function handleEntityNotFound(_0x2900a5,_0x1e8b28){return function(_0x33c95c){if(!_0x33c95c){_0x2900a5[_0x6b29('0x22')](0x194);}return _0x33c95c;};}function handleError(_0x149d29,_0x8b947a){_0x8b947a=_0x8b947a||0x1f4;return function(_0xbae8f3){logger[_0x6b29('0x23')](_0xbae8f3['stack']);if(_0xbae8f3[_0x6b29('0x24')]){delete _0xbae8f3[_0x6b29('0x24')];}_0x149d29[_0x6b29('0x16')](_0x8b947a)[_0x6b29('0x25')](_0xbae8f3);};}exports[_0x6b29('0x26')]=function(_0xa89f9f,_0x15eb4a){var _0x5502c3={},_0xe943da={},_0x14519c={'count':0x0,'rows':[]};var _0x30a86b=_[_0x6b29('0x27')](db['JscriptyQuestionReport'][_0x6b29('0x28')],function(_0xf2e7b){return{'name':_0xf2e7b['fieldName'],'type':_0xf2e7b[_0x6b29('0x29')]['key']};});_0xe943da['model']=_['map'](_0x30a86b,'name');_0xe943da[_0x6b29('0x2a')]=_['keys'](_0xa89f9f[_0x6b29('0x2a')]);_0xe943da[_0x6b29('0x2b')]=_[_0x6b29('0x2c')](_0xe943da['model'],_0xe943da[_0x6b29('0x2a')]);_0x5502c3[_0x6b29('0x2d')]=_[_0x6b29('0x2c')](_0xe943da[_0x6b29('0x2e')],qs['fields'](_0xa89f9f[_0x6b29('0x2a')][_0x6b29('0x2f')]));_0x5502c3[_0x6b29('0x2d')]=_0x5502c3['attributes']['length']?_0x5502c3[_0x6b29('0x2d')]:_0xe943da[_0x6b29('0x2e')];if(!_0xa89f9f[_0x6b29('0x2a')][_0x6b29('0x30')](_0x6b29('0x31'))){_0x5502c3[_0x6b29('0x32')]=qs['limit'](_0xa89f9f[_0x6b29('0x2a')][_0x6b29('0x32')]);_0x5502c3[_0x6b29('0x1a')]=qs[_0x6b29('0x1a')](_0xa89f9f[_0x6b29('0x2a')][_0x6b29('0x1a')]);}_0x5502c3[_0x6b29('0x33')]=qs['sort'](_0xa89f9f[_0x6b29('0x2a')][_0x6b29('0x34')]);_0x5502c3[_0x6b29('0x35')]=qs[_0x6b29('0x2b')](_['pick'](_0xa89f9f['query'],_0xe943da['filters']));if(_0xa89f9f[_0x6b29('0x2a')][_0x6b29('0x36')]){_0x5502c3[_0x6b29('0x35')]=_[_0x6b29('0x37')](_0x5502c3[_0x6b29('0x35')],{'$or':_[_0x6b29('0x27')](_0x30a86b,function(_0x15c6bf){if(_0x15c6bf['type']!==_0x6b29('0x38')){var _0x519c5c={};_0x519c5c[_0x15c6bf['name']]={'$like':'%'+_0xa89f9f[_0x6b29('0x2a')][_0x6b29('0x36')]+'%'};return _0x519c5c;}})});}_0x5502c3=_[_0x6b29('0x37')]({},_0x5502c3,_0xa89f9f['options']);var _0x241a7b={'where':_0x5502c3[_0x6b29('0x35')]};return db['JscriptyQuestionReport'][_0x6b29('0x19')](_0x241a7b)[_0x6b29('0x20')](function(_0x49b6f8){_0x14519c[_0x6b29('0x19')]=_0x49b6f8;if(_0xa89f9f['query'][_0x6b29('0x39')]){_0x5502c3[_0x6b29('0x3a')]=[{'all':!![]}];}return db['JscriptyQuestionReport']['findAll'](_0x5502c3);})[_0x6b29('0x20')](function(_0x50349e){_0x14519c[_0x6b29('0x3b')]=_0x50349e;return _0x14519c;})[_0x6b29('0x20')](respondWithFilteredResult(_0x15eb4a,_0x5502c3))[_0x6b29('0x3c')](handleError(_0x15eb4a,null));};exports[_0x6b29('0x3d')]=function(_0x413420,_0x52557a){var _0x18ff63={'raw':!![],'where':{'id':_0x413420[_0x6b29('0x3e')]['id']}},_0x4a1568={};_0x4a1568['model']=_[_0x6b29('0x3f')](db[_0x6b29('0x40')][_0x6b29('0x28')]);_0x4a1568[_0x6b29('0x2a')]=_['keys'](_0x413420[_0x6b29('0x2a')]);_0x4a1568[_0x6b29('0x2b')]=_['intersection'](_0x4a1568[_0x6b29('0x2e')],_0x4a1568[_0x6b29('0x2a')]);_0x18ff63[_0x6b29('0x2d')]=_[_0x6b29('0x2c')](_0x4a1568[_0x6b29('0x2e')],qs[_0x6b29('0x2f')](_0x413420['query'][_0x6b29('0x2f')]));_0x18ff63[_0x6b29('0x2d')]=_0x18ff63[_0x6b29('0x2d')][_0x6b29('0x41')]?_0x18ff63[_0x6b29('0x2d')]:_0x4a1568[_0x6b29('0x2e')];if(_0x413420[_0x6b29('0x2a')][_0x6b29('0x39')]){_0x18ff63[_0x6b29('0x3a')]=[{'all':!![]}];}_0x18ff63=_[_0x6b29('0x37')]({},_0x18ff63,_0x413420[_0x6b29('0x42')]);return db[_0x6b29('0x40')][_0x6b29('0x43')](_0x18ff63)[_0x6b29('0x20')](handleEntityNotFound(_0x52557a,null))[_0x6b29('0x20')](respondWithResult(_0x52557a,null))[_0x6b29('0x3c')](handleError(_0x52557a,null));};exports[_0x6b29('0x44')]=function(_0x5c47bd,_0x4cf545){return db[_0x6b29('0x40')]['create'](_0x5c47bd[_0x6b29('0x45')],{})[_0x6b29('0x20')](respondWithResult(_0x4cf545,0xc9))[_0x6b29('0x3c')](handleError(_0x4cf545,null));};exports[_0x6b29('0x46')]=function(_0x48c37b,_0x3454f9){if(_0x48c37b['body']['id']){delete _0x48c37b[_0x6b29('0x45')]['id'];}return db[_0x6b29('0x40')]['find']({'where':{'id':_0x48c37b[_0x6b29('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3454f9,null))[_0x6b29('0x20')](saveUpdates(_0x48c37b[_0x6b29('0x45')],null))[_0x6b29('0x20')](respondWithResult(_0x3454f9,null))[_0x6b29('0x3c')](handleError(_0x3454f9,null));};exports[_0x6b29('0x21')]=function(_0x16ab0e,_0x3e1d65){return db[_0x6b29('0x40')][_0x6b29('0x43')]({'where':{'id':_0x16ab0e[_0x6b29('0x3e')]['id']}})[_0x6b29('0x20')](handleEntityNotFound(_0x3e1d65,null))[_0x6b29('0x20')](removeEntity(_0x3e1d65,null))[_0x6b29('0x3c')](handleError(_0x3e1d65,null));};exports[_0x6b29('0x47')]=function(_0x27c233,_0x595cc5){return db[_0x6b29('0x40')][_0x6b29('0x47')]()[_0x6b29('0x20')](respondWithResult(_0x595cc5,null))[_0x6b29('0x3c')](handleError(_0x595cc5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index f1a965f..adb2771 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 _0xbf6a=['request-promise','path','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','define','JscriptyQuestionReport','report_jscripty_questions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2f71f6,_0x3a1f4d){var _0x2b23ea=function(_0x285980){while(--_0x285980){_0x2f71f6['push'](_0x2f71f6['shift']());}};_0x2b23ea(++_0x3a1f4d);}(_0xbf6a,0xbd));var _0xabf6=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0xbf6a[_0x56f7e2];return _0x36240b;};'use strict';var _=require(_0xabf6('0x0'));var util=require(_0xabf6('0x1'));var logger=require(_0xabf6('0x2'))(_0xabf6('0x3'));var moment=require(_0xabf6('0x4'));var BPromise=require(_0xabf6('0x5'));var rp=require(_0xabf6('0x6'));var fs=require('fs');var path=require(_0xabf6('0x7'));var rimraf=require(_0xabf6('0x8'));var config=require(_0xabf6('0x9'));var attributes=require(_0xabf6('0xa'));module[_0xabf6('0xb')]=function(_0x13f139,_0x2f6d63){return _0x13f139[_0xabf6('0xc')](_0xabf6('0xd'),attributes,{'tableName':_0xabf6('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a7f=['define','JscriptyQuestionReport','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports'];(function(_0xc66667,_0x208b7c){var _0x4f9e33=function(_0x4f9c2c){while(--_0x4f9c2c){_0xc66667['push'](_0xc66667['shift']());}};_0x4f9e33(++_0x208b7c);}(_0x9a7f,0x92));var _0xf9a7=function(_0x17e8ae,_0x12551d){_0x17e8ae=_0x17e8ae-0x0;var _0x55bcf4=_0x9a7f[_0x17e8ae];return _0x55bcf4;};'use strict';var _=require(_0xf9a7('0x0'));var util=require('util');var logger=require(_0xf9a7('0x1'))(_0xf9a7('0x2'));var moment=require(_0xf9a7('0x3'));var BPromise=require(_0xf9a7('0x4'));var rp=require(_0xf9a7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf9a7('0x6'));var config=require(_0xf9a7('0x7'));var attributes=require(_0xf9a7('0x8'));module[_0xf9a7('0x9')]=function(_0x1b70bc,_0x3755b6){return _0x1b70bc[_0xf9a7('0xa')](_0xf9a7('0xb'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 6565829..c1daf0b 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 _0xa069=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','JscriptyQuestionReport,\x20%s,\x20%s','catch','lodash'];(function(_0x4008cb,_0x13b433){var _0x3bc1e1=function(_0x3e70f6){while(--_0x3e70f6){_0x4008cb['push'](_0x4008cb['shift']());}};_0x3bc1e1(++_0x13b433);}(_0xa069,0x1c1));var _0x9a06=function(_0x16b9d5,_0x85ce4){_0x16b9d5=_0x16b9d5-0x0;var _0x42dd90=_0xa069[_0x16b9d5];return _0x42dd90;};'use strict';var _=require(_0x9a06('0x0'));var util=require(_0x9a06('0x1'));var moment=require('moment');var BPromise=require(_0x9a06('0x2'));var rs=require(_0x9a06('0x3'));var fs=require('fs');var Redis=require(_0x9a06('0x4'));var db=require(_0x9a06('0x5'))['db'];var utils=require(_0x9a06('0x6'));var logger=require(_0x9a06('0x7'))(_0x9a06('0x8'));var config=require(_0x9a06('0x9'));var jayson=require(_0x9a06('0xa'));var client=jayson[_0x9a06('0xb')][_0x9a06('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x40fa98,_0x5b79ab,_0x4d5848){return new BPromise(function(_0x130387,_0x744076){return client[_0x9a06('0xd')](_0x40fa98,_0x4d5848)[_0x9a06('0xe')](function(_0x4146d8){logger[_0x9a06('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5b79ab,_0x9a06('0x10'));logger[_0x9a06('0x11')](_0x9a06('0x12'),_0x5b79ab,'request\x20sent',JSON[_0x9a06('0x13')](_0x4146d8));if(_0x4146d8[_0x9a06('0x14')]){if(_0x4146d8[_0x9a06('0x14')][_0x9a06('0x15')]===0x1f4){logger[_0x9a06('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5b79ab,_0x4146d8['error'][_0x9a06('0x16')]);return _0x744076(_0x4146d8['error']['message']);}logger[_0x9a06('0x14')](_0x9a06('0x17'),_0x5b79ab,_0x4146d8[_0x9a06('0x14')][_0x9a06('0x16')]);return _0x130387(_0x4146d8[_0x9a06('0x14')]['message']);}else{logger[_0x9a06('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x5b79ab,_0x9a06('0x10'));_0x130387(_0x4146d8['result'][_0x9a06('0x16')]);}})[_0x9a06('0x18')](function(_0x16f3d4){logger[_0x9a06('0x14')](_0x9a06('0x17'),_0x5b79ab,_0x16f3d4);_0x744076(_0x16f3d4);});});} \ No newline at end of file +var _0x5225=['util','moment','bluebird','ioredis','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash'];(function(_0x5f46b0,_0x5580f7){var _0x87388a=function(_0x27e078){while(--_0x27e078){_0x5f46b0['push'](_0x5f46b0['shift']());}};_0x87388a(++_0x5580f7);}(_0x5225,0xdb));var _0x5522=function(_0xb4ec3a,_0x2bace0){_0xb4ec3a=_0xb4ec3a-0x0;var _0x1b83db=_0x5225[_0xb4ec3a];return _0x1b83db;};'use strict';var _=require(_0x5522('0x0'));var util=require(_0x5522('0x1'));var moment=require(_0x5522('0x2'));var BPromise=require(_0x5522('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5522('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x5522('0x5'));var config=require(_0x5522('0x6'));var jayson=require(_0x5522('0x7'));var client=jayson[_0x5522('0x8')][_0x5522('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36705c,_0x476d7e,_0x34bda4){return new BPromise(function(_0x29735c,_0x120806){return client[_0x5522('0xa')](_0x36705c,_0x34bda4)['then'](function(_0x215f92){logger[_0x5522('0xb')](_0x5522('0xc'),_0x476d7e,_0x5522('0xd'));logger[_0x5522('0xe')]('JscriptyQuestionReport,\x20%s,\x20%s,\x20%s',_0x476d7e,_0x5522('0xd'),JSON['stringify'](_0x215f92));if(_0x215f92[_0x5522('0xf')]){if(_0x215f92['error'][_0x5522('0x10')]===0x1f4){logger[_0x5522('0xf')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x476d7e,_0x215f92[_0x5522('0xf')][_0x5522('0x11')]);return _0x120806(_0x215f92[_0x5522('0xf')]['message']);}logger['error'](_0x5522('0xc'),_0x476d7e,_0x215f92['error'][_0x5522('0x11')]);return _0x29735c(_0x215f92[_0x5522('0xf')]['message']);}else{logger[_0x5522('0xb')](_0x5522('0xc'),_0x476d7e,'request\x20sent');_0x29735c(_0x215f92[_0x5522('0x12')][_0x5522('0x11')]);}})[_0x5522('0x13')](function(_0x5a4ca3){logger[_0x5522('0xf')](_0x5522('0xc'),_0x476d7e,_0x5a4ca3);_0x120806(_0x5a4ca3);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 8c37adb..bb985cb 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 _0xeb0d=['post','/:id','update','delete','destroy','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions'];(function(_0x24c496,_0x466a89){var _0x2f13ad=function(_0x186a1f){while(--_0x186a1f){_0x24c496['push'](_0x24c496['shift']());}};_0x2f13ad(++_0x466a89);}(_0xeb0d,0xe2));var _0xdeb0=function(_0xe33d82,_0x5e6a3e){_0xe33d82=_0xe33d82-0x0;var _0x3c8d54=_0xeb0d[_0xe33d82];return _0x3c8d54;};'use strict';var multer=require(_0xdeb0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdeb0('0x1'));var router=express[_0xdeb0('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xdeb0('0x3'));var config=require(_0xdeb0('0x4'));var controller=require(_0xdeb0('0x5'));router[_0xdeb0('0x6')]('/',auth[_0xdeb0('0x7')](),controller[_0xdeb0('0x8')]);router[_0xdeb0('0x6')](_0xdeb0('0x9'),auth['isAuthenticated'](),controller[_0xdeb0('0xa')]);router[_0xdeb0('0x6')]('/:id',auth[_0xdeb0('0x7')](),controller[_0xdeb0('0xb')]);router[_0xdeb0('0x6')](_0xdeb0('0xc'),auth[_0xdeb0('0x7')](),controller[_0xdeb0('0xd')]);router[_0xdeb0('0xe')]('/',auth[_0xdeb0('0x7')](),controller['create']);router['put'](_0xdeb0('0xf'),auth['isAuthenticated'](),controller[_0xdeb0('0x10')]);router[_0xdeb0('0x11')](_0xdeb0('0xf'),auth[_0xdeb0('0x7')](),controller[_0xdeb0('0x12')]);module[_0xdeb0('0x13')]=router; \ No newline at end of file +var _0x8d9b=['./jscriptySessionReport.controller','get','/describe','/:id','isAuthenticated','show','/:id/questions','getQuestions','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x5dbbc7,_0x5ca4c4){var _0x3f8409=function(_0x19823c){while(--_0x19823c){_0x5dbbc7['push'](_0x5dbbc7['shift']());}};_0x3f8409(++_0x5ca4c4);}(_0x8d9b,0x104));var _0xb8d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8d9b[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xb8d9('0x0'));var util=require(_0xb8d9('0x1'));var path=require(_0xb8d9('0x2'));var timeout=require(_0xb8d9('0x3'));var express=require(_0xb8d9('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xb8d9('0x5'));var config=require('../../config/environment');var controller=require(_0xb8d9('0x6'));router[_0xb8d9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb8d9('0x8'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xb8d9('0x9'),auth[_0xb8d9('0xa')](),controller[_0xb8d9('0xb')]);router[_0xb8d9('0x7')](_0xb8d9('0xc'),auth[_0xb8d9('0xa')](),controller[_0xb8d9('0xd')]);router['post']('/',auth[_0xb8d9('0xa')](),controller['create']);router[_0xb8d9('0xe')](_0xb8d9('0x9'),auth[_0xb8d9('0xa')](),controller[_0xb8d9('0xf')]);router[_0xb8d9('0x10')](_0xb8d9('0x9'),auth[_0xb8d9('0xa')](),controller[_0xb8d9('0x11')]);module[_0xb8d9('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index a9c138f..bdae3a7 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 _0xb77d=['STRING','BOOLEAN','moment','sequelize','exports','DATE','setDataValue','endtime','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x6054be,_0x2f4ffa){var _0xd1d697=function(_0x5f558b){while(--_0x5f558b){_0x6054be['push'](_0x6054be['shift']());}};_0xd1d697(++_0x2f4ffa);}(_0xb77d,0x70));var _0xdb77=function(_0x41d3e3,_0x16732a){_0x41d3e3=_0x41d3e3-0x0;var _0x22ebed=_0xb77d[_0x41d3e3];return _0x22ebed;};'use strict';var moment=require(_0xdb77('0x0'));var Sequelize=require(_0xdb77('0x1'));module[_0xdb77('0x2')]={'starttime':{'type':Sequelize[_0xdb77('0x3')],'set':function(_0x116548){this[_0xdb77('0x4')]('starttime',_0x116548);this[_0xdb77('0x4')](_0xdb77('0x5'),moment()[_0xdb77('0x6')](_0xdb77('0x7')));}},'endtime':{'type':Sequelize[_0xdb77('0x3')]},'membername':{'type':Sequelize[_0xdb77('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xdb77('0x8')]},'uniqueid':{'type':Sequelize[_0xdb77('0x8')]},'calleridname':{'type':Sequelize[_0xdb77('0x8')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0xdb77('0x9')],'defaultValue':![]}}; \ No newline at end of file +var _0x0574=['exports','setDataValue','endtime','YYYY-MM-DD\x20HH:mm:ss','DATE','STRING','BOOLEAN','moment','sequelize'];(function(_0x42f318,_0x336c90){var _0x4aa72a=function(_0xfce356){while(--_0xfce356){_0x42f318['push'](_0x42f318['shift']());}};_0x4aa72a(++_0x336c90);}(_0x0574,0xa9));var _0x4057=function(_0x121035,_0x427bb2){_0x121035=_0x121035-0x0;var _0x236663=_0x0574[_0x121035];return _0x236663;};'use strict';var moment=require(_0x4057('0x0'));var Sequelize=require(_0x4057('0x1'));module[_0x4057('0x2')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x2b971b){this[_0x4057('0x3')]('starttime',_0x2b971b);this[_0x4057('0x3')](_0x4057('0x4'),moment()['format'](_0x4057('0x5')));}},'endtime':{'type':Sequelize[_0x4057('0x6')]},'membername':{'type':Sequelize[_0x4057('0x7')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x4057('0x7')]},'calleridname':{'type':Sequelize[_0x4057('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x4057('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index c8245bb..9d77de2 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 _0xbfcb=['catch','show','params','find','create','body','describe','getQuestions','findOne','fields','order','JscriptyQuestionReport','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','count','offset','limit','apply','reject','save','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','type','key','model','query','keys','intersection','attributes','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows'];(function(_0x2f6cfb,_0x43a30a){var _0x566464=function(_0x167d40){while(--_0x167d40){_0x2f6cfb['push'](_0x2f6cfb['shift']());}};_0x566464(++_0x43a30a);}(_0xbfcb,0x17e));var _0xbbfc=function(_0x47477a,_0x5c6c05){_0x47477a=_0x47477a-0x0;var _0x375baa=_0xbfcb[_0x47477a];return _0x375baa;};'use strict';var pdf=require(_0xbbfc('0x0'));var emlformat=require(_0xbbfc('0x1'));var rimraf=require(_0xbbfc('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbbfc('0x3'));var rp=require(_0xbbfc('0x4'));var moment=require(_0xbbfc('0x5'));var BPromise=require(_0xbbfc('0x6'));var Mustache=require(_0xbbfc('0x7'));var util=require(_0xbbfc('0x8'));var path=require('path');var sox=require(_0xbbfc('0x9'));var csv=require(_0xbbfc('0xa'));var ejs=require(_0xbbfc('0xb'));var fs=require('fs');var _=require(_0xbbfc('0xc'));var squel=require('squel');var crypto=require(_0xbbfc('0xd'));var jsforce=require(_0xbbfc('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xbbfc('0xa'));var querystring=require(_0xbbfc('0xf'));var Papa=require(_0xbbfc('0x10'));var Redis=require('ioredis');var authService=require(_0xbbfc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbbfc('0x12'));var hardwareService=require(_0xbbfc('0x13'));var logger=require(_0xbbfc('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29426e,_0x5b55d6){_0x5b55d6=_0x5b55d6||0xcc;return function(_0x3702c9){if(_0x3702c9){return _0x29426e[_0xbbfc('0x15')](_0x5b55d6);}return _0x29426e[_0xbbfc('0x16')](_0x5b55d6)[_0xbbfc('0x17')]();};}function respondWithResult(_0x2fd8e5,_0x262286){_0x262286=_0x262286||0xc8;return function(_0x47aff9){if(_0x47aff9){return _0x2fd8e5[_0xbbfc('0x16')](_0x262286)[_0xbbfc('0x18')](_0x47aff9);}};}function respondWithFilteredResult(_0xa61433,_0x48e066){return function(_0x4767da){if(_0x4767da){var _0x34b21e=_0x4767da[_0xbbfc('0x19')],_0x2b2de8=_0x48e066['offset'],_0x10bfe5=_0x48e066[_0xbbfc('0x1a')]+_0x48e066[_0xbbfc('0x1b')],_0x295678;if(_0x10bfe5>=_0x34b21e){_0x10bfe5=_0x34b21e;_0x295678=0xc8;}else{_0x295678=0xce;}_0xa61433[_0xbbfc('0x16')](_0x295678);return _0xa61433['set']('Content-Range',_0x2b2de8+'-'+_0x10bfe5+'/'+_0x34b21e)[_0xbbfc('0x18')](_0x4767da);}return null;};}function patchUpdates(_0x4af43e){return function(_0x599d56){try{jsonpatch[_0xbbfc('0x1c')](_0x599d56,_0x4af43e,!![]);}catch(_0x4d8d13){return BPromise[_0xbbfc('0x1d')](_0x4d8d13);}return _0x599d56[_0xbbfc('0x1e')]();};}function saveUpdates(_0x35ef34,_0x336a6c){return function(_0x388cb5){if(_0x388cb5){return _0x388cb5['update'](_0x35ef34)[_0xbbfc('0x1f')](function(_0x3f0aa3){return _0x3f0aa3;});}return null;};}function removeEntity(_0x597e7f,_0x3b3820){return function(_0x3888c8){if(_0x3888c8){return _0x3888c8[_0xbbfc('0x20')]()[_0xbbfc('0x1f')](function(){_0x597e7f['status'](0xcc)[_0xbbfc('0x17')]();});}};}function handleEntityNotFound(_0x27291d,_0x41c766){return function(_0x57f9cf){if(!_0x57f9cf){_0x27291d[_0xbbfc('0x15')](0x194);}return _0x57f9cf;};}function handleError(_0x9cd40d,_0x114bd2){_0x114bd2=_0x114bd2||0x1f4;return function(_0x16ded1){logger[_0xbbfc('0x21')](_0x16ded1[_0xbbfc('0x22')]);if(_0x16ded1[_0xbbfc('0x23')]){delete _0x16ded1[_0xbbfc('0x23')];}_0x9cd40d[_0xbbfc('0x16')](_0x114bd2)[_0xbbfc('0x24')](_0x16ded1);};}exports[_0xbbfc('0x25')]=function(_0x42827b,_0xa96c1a){var _0x1f8370={},_0x2e01ff={},_0xd2c871={'count':0x0,'rows':[]};var _0x5d29f2=_[_0xbbfc('0x26')](db[_0xbbfc('0x27')][_0xbbfc('0x28')],function(_0x2af735){return{'name':_0x2af735['fieldName'],'type':_0x2af735[_0xbbfc('0x29')][_0xbbfc('0x2a')]};});_0x2e01ff[_0xbbfc('0x2b')]=_[_0xbbfc('0x26')](_0x5d29f2,_0xbbfc('0x23'));_0x2e01ff[_0xbbfc('0x2c')]=_[_0xbbfc('0x2d')](_0x42827b[_0xbbfc('0x2c')]);_0x2e01ff['filters']=_['intersection'](_0x2e01ff[_0xbbfc('0x2b')],_0x2e01ff[_0xbbfc('0x2c')]);_0x1f8370['attributes']=_[_0xbbfc('0x2e')](_0x2e01ff[_0xbbfc('0x2b')],qs['fields'](_0x42827b[_0xbbfc('0x2c')]['fields']));_0x1f8370[_0xbbfc('0x2f')]=_0x1f8370[_0xbbfc('0x2f')][_0xbbfc('0x30')]?_0x1f8370[_0xbbfc('0x2f')]:_0x2e01ff[_0xbbfc('0x2b')];if(!_0x42827b[_0xbbfc('0x2c')][_0xbbfc('0x31')](_0xbbfc('0x32'))){_0x1f8370['limit']=qs[_0xbbfc('0x1b')](_0x42827b[_0xbbfc('0x2c')][_0xbbfc('0x1b')]);_0x1f8370[_0xbbfc('0x1a')]=qs[_0xbbfc('0x1a')](_0x42827b[_0xbbfc('0x2c')][_0xbbfc('0x1a')]);}_0x1f8370['order']=qs[_0xbbfc('0x33')](_0x42827b[_0xbbfc('0x2c')][_0xbbfc('0x33')]);_0x1f8370['where']=qs[_0xbbfc('0x34')](_[_0xbbfc('0x35')](_0x42827b[_0xbbfc('0x2c')],_0x2e01ff[_0xbbfc('0x34')]));if(_0x42827b[_0xbbfc('0x2c')][_0xbbfc('0x36')]){_0x1f8370[_0xbbfc('0x37')]=_[_0xbbfc('0x38')](_0x1f8370['where'],{'$or':_[_0xbbfc('0x26')](_0x5d29f2,function(_0x1eb0bc){if(_0x1eb0bc[_0xbbfc('0x29')]!==_0xbbfc('0x39')){var _0x1c4f9a={};_0x1c4f9a[_0x1eb0bc[_0xbbfc('0x23')]]={'$like':'%'+_0x42827b[_0xbbfc('0x2c')][_0xbbfc('0x36')]+'%'};return _0x1c4f9a;}})});}_0x1f8370=_[_0xbbfc('0x38')]({},_0x1f8370,_0x42827b[_0xbbfc('0x3a')]);var _0x2284bc={'where':_0x1f8370[_0xbbfc('0x37')]};return db[_0xbbfc('0x27')][_0xbbfc('0x19')](_0x2284bc)['then'](function(_0x390490){_0xd2c871[_0xbbfc('0x19')]=_0x390490;if(_0x42827b[_0xbbfc('0x2c')][_0xbbfc('0x3b')]){_0x1f8370['include']=[{'all':!![]}];}return db[_0xbbfc('0x27')][_0xbbfc('0x3c')](_0x1f8370);})[_0xbbfc('0x1f')](function(_0x29f514){_0xd2c871[_0xbbfc('0x3d')]=_0x29f514;return _0xd2c871;})[_0xbbfc('0x1f')](respondWithFilteredResult(_0xa96c1a,_0x1f8370))[_0xbbfc('0x3e')](handleError(_0xa96c1a,null));};exports[_0xbbfc('0x3f')]=function(_0x18ad66,_0xafa364){var _0x1701f9={'raw':!![],'where':{'id':_0x18ad66[_0xbbfc('0x40')]['id']}},_0x336b4e={};_0x336b4e['model']=_['keys'](db['JscriptySessionReport'][_0xbbfc('0x28')]);_0x336b4e[_0xbbfc('0x2c')]=_[_0xbbfc('0x2d')](_0x18ad66[_0xbbfc('0x2c')]);_0x336b4e[_0xbbfc('0x34')]=_[_0xbbfc('0x2e')](_0x336b4e[_0xbbfc('0x2b')],_0x336b4e['query']);_0x1701f9[_0xbbfc('0x2f')]=_[_0xbbfc('0x2e')](_0x336b4e[_0xbbfc('0x2b')],qs['fields'](_0x18ad66[_0xbbfc('0x2c')]['fields']));_0x1701f9[_0xbbfc('0x2f')]=_0x1701f9[_0xbbfc('0x2f')][_0xbbfc('0x30')]?_0x1701f9['attributes']:_0x336b4e[_0xbbfc('0x2b')];if(_0x18ad66['query'][_0xbbfc('0x3b')]){_0x1701f9['include']=[{'all':!![]}];}_0x1701f9=_['merge']({},_0x1701f9,_0x18ad66['options']);return db['JscriptySessionReport'][_0xbbfc('0x41')](_0x1701f9)[_0xbbfc('0x1f')](handleEntityNotFound(_0xafa364,null))['then'](respondWithResult(_0xafa364,null))[_0xbbfc('0x3e')](handleError(_0xafa364,null));};exports[_0xbbfc('0x42')]=function(_0x4f36f3,_0xae6400){return db[_0xbbfc('0x27')][_0xbbfc('0x42')](_0x4f36f3[_0xbbfc('0x43')],{})[_0xbbfc('0x1f')](respondWithResult(_0xae6400,0xc9))[_0xbbfc('0x3e')](handleError(_0xae6400,null));};exports['update']=function(_0x4d2d13,_0x5d0fba){if(_0x4d2d13['body']['id']){delete _0x4d2d13[_0xbbfc('0x43')]['id'];}return db[_0xbbfc('0x27')][_0xbbfc('0x41')]({'where':{'id':_0x4d2d13[_0xbbfc('0x40')]['id']}})[_0xbbfc('0x1f')](handleEntityNotFound(_0x5d0fba,null))[_0xbbfc('0x1f')](saveUpdates(_0x4d2d13[_0xbbfc('0x43')],null))[_0xbbfc('0x1f')](respondWithResult(_0x5d0fba,null))[_0xbbfc('0x3e')](handleError(_0x5d0fba,null));};exports[_0xbbfc('0x20')]=function(_0x22f902,_0x1a0214){return db['JscriptySessionReport'][_0xbbfc('0x41')]({'where':{'id':_0x22f902[_0xbbfc('0x40')]['id']}})['then'](handleEntityNotFound(_0x1a0214,null))[_0xbbfc('0x1f')](removeEntity(_0x1a0214,null))['catch'](handleError(_0x1a0214,null));};exports[_0xbbfc('0x44')]=function(_0x4a85ad,_0x5b2d21){return db[_0xbbfc('0x27')][_0xbbfc('0x44')]()[_0xbbfc('0x1f')](respondWithResult(_0x5b2d21,null))[_0xbbfc('0x3e')](handleError(_0x5b2d21,null));};exports[_0xbbfc('0x45')]=function(_0x353689,_0x201410,_0x201e87){var _0x3f116b={'raw':!![],'where':{}};var _0x54f6ee={};var _0x1c464a={'count':0x0,'rows':[]};return db[_0xbbfc('0x27')][_0xbbfc('0x46')]({'where':{'id':_0x353689[_0xbbfc('0x40')]['id']}})['then'](handleEntityNotFound(_0x201410,null))[_0xbbfc('0x1f')](function(_0x68c21f){if(_0x68c21f){_0x54f6ee[_0xbbfc('0x2b')]=_[_0xbbfc('0x2d')](db['JscriptyQuestionReport']['rawAttributes']);_0x54f6ee['query']=_[_0xbbfc('0x2d')](_0x353689[_0xbbfc('0x2c')]);_0x54f6ee[_0xbbfc('0x34')]=_[_0xbbfc('0x2e')](_0x54f6ee[_0xbbfc('0x2b')],_0x54f6ee['query']);_0x3f116b['attributes']=_[_0xbbfc('0x2e')](_0x54f6ee[_0xbbfc('0x2b')],qs[_0xbbfc('0x47')](_0x353689[_0xbbfc('0x2c')][_0xbbfc('0x47')]));_0x3f116b[_0xbbfc('0x2f')]=_0x3f116b['attributes'][_0xbbfc('0x30')]?_0x3f116b['attributes']:_0x54f6ee[_0xbbfc('0x2b')];if(!_0x353689[_0xbbfc('0x2c')]['hasOwnProperty'](_0xbbfc('0x32'))){_0x3f116b[_0xbbfc('0x1b')]=qs[_0xbbfc('0x1b')](_0x353689[_0xbbfc('0x2c')][_0xbbfc('0x1b')]);_0x3f116b[_0xbbfc('0x1a')]=qs[_0xbbfc('0x1a')](_0x353689[_0xbbfc('0x2c')][_0xbbfc('0x1a')]);}_0x3f116b[_0xbbfc('0x48')]=qs[_0xbbfc('0x33')](_0x353689[_0xbbfc('0x2c')][_0xbbfc('0x33')]);_0x3f116b[_0xbbfc('0x37')]=qs['filters'](_[_0xbbfc('0x35')](_0x353689[_0xbbfc('0x2c')],_0x54f6ee[_0xbbfc('0x34')]));_0x3f116b[_0xbbfc('0x37')]['SessionId']=_0x68c21f['id'];if(_0x353689[_0xbbfc('0x2c')][_0xbbfc('0x36')]){_0x3f116b[_0xbbfc('0x37')]=_[_0xbbfc('0x38')](_0x3f116b[_0xbbfc('0x37')],{'$or':_[_0xbbfc('0x26')](_0x3f116b['attributes'],function(_0x13b095){var _0x41f86c={};_0x41f86c[_0x13b095]={'$like':'%'+_0x353689[_0xbbfc('0x2c')]['filter']+'%'};return _0x41f86c;})});}_0x3f116b=_[_0xbbfc('0x38')]({},_0x3f116b,_0x353689[_0xbbfc('0x3a')]);return db[_0xbbfc('0x49')][_0xbbfc('0x19')]({'where':_0x3f116b['where']})[_0xbbfc('0x1f')](function(_0x2e0eb9){_0x1c464a[_0xbbfc('0x19')]=_0x2e0eb9;if(_0x353689[_0xbbfc('0x2c')][_0xbbfc('0x3b')]){_0x3f116b['include']=[{'all':!![]}];}return db[_0xbbfc('0x49')][_0xbbfc('0x3c')](_0x3f116b);})[_0xbbfc('0x1f')](function(_0x4ab0c3){_0x1c464a[_0xbbfc('0x3d')]=_0x4ab0c3;return _0x1c464a;});}})['then'](respondWithFilteredResult(_0x201410,_0x3f116b))['catch'](handleError(_0x201410,null));}; \ No newline at end of file +var _0xf921=['map','rawAttributes','fieldName','type','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','filter','VIRTUAL','merge','options','JscriptySessionReport','include','findAll','rows','catch','show','params','find','create','body','describe','getQuestions','findOne','JscriptyQuestionReport','nolimit','sort','pick','includeAll','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','name','send'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0xf921,0x10f));var _0x1f92=function(_0x550aed,_0x1ba6cb){_0x550aed=_0x550aed-0x0;var _0x1c43a5=_0xf921[_0x550aed];return _0x1c43a5;};'use strict';var pdf=require(_0x1f92('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1f92('0x1'));var zipdir=require(_0x1f92('0x2'));var jsonpatch=require(_0x1f92('0x3'));var rp=require(_0x1f92('0x4'));var moment=require(_0x1f92('0x5'));var BPromise=require(_0x1f92('0x6'));var Mustache=require(_0x1f92('0x7'));var util=require(_0x1f92('0x8'));var path=require(_0x1f92('0x9'));var sox=require('sox');var csv=require(_0x1f92('0xa'));var ejs=require(_0x1f92('0xb'));var fs=require('fs');var _=require(_0x1f92('0xc'));var squel=require(_0x1f92('0xd'));var crypto=require('crypto');var jsforce=require(_0x1f92('0xe'));var deskjs=require(_0x1f92('0xf'));var toCsv=require(_0x1f92('0xa'));var querystring=require(_0x1f92('0x10'));var Papa=require(_0x1f92('0x11'));var Redis=require('ioredis');var authService=require(_0x1f92('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1f92('0x13'));var logger=require(_0x1f92('0x14'))(_0x1f92('0x15'));var utils=require(_0x1f92('0x16'));var config=require(_0x1f92('0x17'));var db=require(_0x1f92('0x18'))['db'];function respondWithStatusCode(_0x2d87c7,_0x200eb9){_0x200eb9=_0x200eb9||0xcc;return function(_0x1d3cbc){if(_0x1d3cbc){return _0x2d87c7[_0x1f92('0x19')](_0x200eb9);}return _0x2d87c7[_0x1f92('0x1a')](_0x200eb9)[_0x1f92('0x1b')]();};}function respondWithResult(_0x2856f4,_0x5c0695){_0x5c0695=_0x5c0695||0xc8;return function(_0x39e531){if(_0x39e531){return _0x2856f4[_0x1f92('0x1a')](_0x5c0695)[_0x1f92('0x1c')](_0x39e531);}};}function respondWithFilteredResult(_0x7d5704,_0x37c66a){return function(_0x2c701a){if(_0x2c701a){var _0x54b840=_0x2c701a[_0x1f92('0x1d')],_0x548fc3=_0x37c66a[_0x1f92('0x1e')],_0x3b2cf8=_0x37c66a['offset']+_0x37c66a[_0x1f92('0x1f')],_0x4cda17;if(_0x3b2cf8>=_0x54b840){_0x3b2cf8=_0x54b840;_0x4cda17=0xc8;}else{_0x4cda17=0xce;}_0x7d5704[_0x1f92('0x1a')](_0x4cda17);return _0x7d5704[_0x1f92('0x20')](_0x1f92('0x21'),_0x548fc3+'-'+_0x3b2cf8+'/'+_0x54b840)[_0x1f92('0x1c')](_0x2c701a);}return null;};}function patchUpdates(_0x46486e){return function(_0x432722){try{jsonpatch[_0x1f92('0x22')](_0x432722,_0x46486e,!![]);}catch(_0x4de432){return BPromise['reject'](_0x4de432);}return _0x432722[_0x1f92('0x23')]();};}function saveUpdates(_0x57167c,_0x5640c0){return function(_0x43c10e){if(_0x43c10e){return _0x43c10e[_0x1f92('0x24')](_0x57167c)[_0x1f92('0x25')](function(_0x5da8f3){return _0x5da8f3;});}return null;};}function removeEntity(_0x3ccbfe,_0x4b2408){return function(_0x382688){if(_0x382688){return _0x382688[_0x1f92('0x26')]()[_0x1f92('0x25')](function(){_0x3ccbfe[_0x1f92('0x1a')](0xcc)[_0x1f92('0x1b')]();});}};}function handleEntityNotFound(_0x2aa7f6,_0x454ce1){return function(_0x48464d){if(!_0x48464d){_0x2aa7f6[_0x1f92('0x19')](0x194);}return _0x48464d;};}function handleError(_0x4c0a4d,_0x3a345e){_0x3a345e=_0x3a345e||0x1f4;return function(_0x10e04f){logger['error'](_0x10e04f['stack']);if(_0x10e04f[_0x1f92('0x27')]){delete _0x10e04f[_0x1f92('0x27')];}_0x4c0a4d[_0x1f92('0x1a')](_0x3a345e)[_0x1f92('0x28')](_0x10e04f);};}exports['index']=function(_0x1fe693,_0x58dbcf){var _0x2a07c4={},_0x26abf7={},_0x596d74={'count':0x0,'rows':[]};var _0x5a53b0=_[_0x1f92('0x29')](db['JscriptySessionReport'][_0x1f92('0x2a')],function(_0x273dc1){return{'name':_0x273dc1[_0x1f92('0x2b')],'type':_0x273dc1[_0x1f92('0x2c')]['key']};});_0x26abf7[_0x1f92('0x2d')]=_[_0x1f92('0x29')](_0x5a53b0,_0x1f92('0x27'));_0x26abf7['query']=_[_0x1f92('0x2e')](_0x1fe693[_0x1f92('0x2f')]);_0x26abf7[_0x1f92('0x30')]=_['intersection'](_0x26abf7[_0x1f92('0x2d')],_0x26abf7[_0x1f92('0x2f')]);_0x2a07c4[_0x1f92('0x31')]=_[_0x1f92('0x32')](_0x26abf7['model'],qs[_0x1f92('0x33')](_0x1fe693[_0x1f92('0x2f')][_0x1f92('0x33')]));_0x2a07c4[_0x1f92('0x31')]=_0x2a07c4[_0x1f92('0x31')][_0x1f92('0x34')]?_0x2a07c4[_0x1f92('0x31')]:_0x26abf7['model'];if(!_0x1fe693['query'][_0x1f92('0x35')]('nolimit')){_0x2a07c4['limit']=qs[_0x1f92('0x1f')](_0x1fe693[_0x1f92('0x2f')][_0x1f92('0x1f')]);_0x2a07c4[_0x1f92('0x1e')]=qs[_0x1f92('0x1e')](_0x1fe693[_0x1f92('0x2f')][_0x1f92('0x1e')]);}_0x2a07c4[_0x1f92('0x36')]=qs['sort'](_0x1fe693[_0x1f92('0x2f')]['sort']);_0x2a07c4[_0x1f92('0x37')]=qs['filters'](_['pick'](_0x1fe693[_0x1f92('0x2f')],_0x26abf7[_0x1f92('0x30')]));if(_0x1fe693[_0x1f92('0x2f')][_0x1f92('0x38')]){_0x2a07c4[_0x1f92('0x37')]=_['merge'](_0x2a07c4[_0x1f92('0x37')],{'$or':_['map'](_0x5a53b0,function(_0xb788ac){if(_0xb788ac['type']!==_0x1f92('0x39')){var _0xe28df0={};_0xe28df0[_0xb788ac[_0x1f92('0x27')]]={'$like':'%'+_0x1fe693[_0x1f92('0x2f')][_0x1f92('0x38')]+'%'};return _0xe28df0;}})});}_0x2a07c4=_[_0x1f92('0x3a')]({},_0x2a07c4,_0x1fe693[_0x1f92('0x3b')]);var _0x29ed59={'where':_0x2a07c4[_0x1f92('0x37')]};return db[_0x1f92('0x3c')]['count'](_0x29ed59)[_0x1f92('0x25')](function(_0x11d7d5){_0x596d74['count']=_0x11d7d5;if(_0x1fe693[_0x1f92('0x2f')]['includeAll']){_0x2a07c4[_0x1f92('0x3d')]=[{'all':!![]}];}return db[_0x1f92('0x3c')][_0x1f92('0x3e')](_0x2a07c4);})['then'](function(_0x43cb3b){_0x596d74[_0x1f92('0x3f')]=_0x43cb3b;return _0x596d74;})[_0x1f92('0x25')](respondWithFilteredResult(_0x58dbcf,_0x2a07c4))[_0x1f92('0x40')](handleError(_0x58dbcf,null));};exports[_0x1f92('0x41')]=function(_0x3f8622,_0xf0a66c){var _0x30be5b={'raw':!![],'where':{'id':_0x3f8622[_0x1f92('0x42')]['id']}},_0x336ddd={};_0x336ddd[_0x1f92('0x2d')]=_[_0x1f92('0x2e')](db[_0x1f92('0x3c')]['rawAttributes']);_0x336ddd['query']=_[_0x1f92('0x2e')](_0x3f8622[_0x1f92('0x2f')]);_0x336ddd[_0x1f92('0x30')]=_['intersection'](_0x336ddd['model'],_0x336ddd[_0x1f92('0x2f')]);_0x30be5b[_0x1f92('0x31')]=_['intersection'](_0x336ddd[_0x1f92('0x2d')],qs['fields'](_0x3f8622[_0x1f92('0x2f')]['fields']));_0x30be5b[_0x1f92('0x31')]=_0x30be5b['attributes']['length']?_0x30be5b[_0x1f92('0x31')]:_0x336ddd[_0x1f92('0x2d')];if(_0x3f8622[_0x1f92('0x2f')]['includeAll']){_0x30be5b[_0x1f92('0x3d')]=[{'all':!![]}];}_0x30be5b=_[_0x1f92('0x3a')]({},_0x30be5b,_0x3f8622[_0x1f92('0x3b')]);return db[_0x1f92('0x3c')][_0x1f92('0x43')](_0x30be5b)[_0x1f92('0x25')](handleEntityNotFound(_0xf0a66c,null))[_0x1f92('0x25')](respondWithResult(_0xf0a66c,null))[_0x1f92('0x40')](handleError(_0xf0a66c,null));};exports[_0x1f92('0x44')]=function(_0xe6ba4e,_0x396c0a){return db[_0x1f92('0x3c')][_0x1f92('0x44')](_0xe6ba4e[_0x1f92('0x45')],{})[_0x1f92('0x25')](respondWithResult(_0x396c0a,0xc9))[_0x1f92('0x40')](handleError(_0x396c0a,null));};exports['update']=function(_0x584735,_0x35cf3d){if(_0x584735[_0x1f92('0x45')]['id']){delete _0x584735[_0x1f92('0x45')]['id'];}return db[_0x1f92('0x3c')][_0x1f92('0x43')]({'where':{'id':_0x584735['params']['id']}})[_0x1f92('0x25')](handleEntityNotFound(_0x35cf3d,null))[_0x1f92('0x25')](saveUpdates(_0x584735[_0x1f92('0x45')],null))[_0x1f92('0x25')](respondWithResult(_0x35cf3d,null))[_0x1f92('0x40')](handleError(_0x35cf3d,null));};exports[_0x1f92('0x26')]=function(_0x109bb7,_0x17d09f){return db[_0x1f92('0x3c')]['find']({'where':{'id':_0x109bb7['params']['id']}})[_0x1f92('0x25')](handleEntityNotFound(_0x17d09f,null))[_0x1f92('0x25')](removeEntity(_0x17d09f,null))[_0x1f92('0x40')](handleError(_0x17d09f,null));};exports[_0x1f92('0x46')]=function(_0x7f3b15,_0x516b0e){return db['JscriptySessionReport'][_0x1f92('0x46')]()['then'](respondWithResult(_0x516b0e,null))['catch'](handleError(_0x516b0e,null));};exports[_0x1f92('0x47')]=function(_0x1cf5bc,_0x5a8745,_0x10ef95){var _0x522a65={'raw':!![],'where':{}};var _0x470284={};var _0x181fa4={'count':0x0,'rows':[]};return db[_0x1f92('0x3c')][_0x1f92('0x48')]({'where':{'id':_0x1cf5bc['params']['id']}})['then'](handleEntityNotFound(_0x5a8745,null))[_0x1f92('0x25')](function(_0x54d513){if(_0x54d513){_0x470284[_0x1f92('0x2d')]=_['keys'](db[_0x1f92('0x49')][_0x1f92('0x2a')]);_0x470284['query']=_[_0x1f92('0x2e')](_0x1cf5bc[_0x1f92('0x2f')]);_0x470284[_0x1f92('0x30')]=_[_0x1f92('0x32')](_0x470284[_0x1f92('0x2d')],_0x470284['query']);_0x522a65['attributes']=_[_0x1f92('0x32')](_0x470284[_0x1f92('0x2d')],qs[_0x1f92('0x33')](_0x1cf5bc[_0x1f92('0x2f')]['fields']));_0x522a65[_0x1f92('0x31')]=_0x522a65[_0x1f92('0x31')][_0x1f92('0x34')]?_0x522a65['attributes']:_0x470284[_0x1f92('0x2d')];if(!_0x1cf5bc['query'][_0x1f92('0x35')](_0x1f92('0x4a'))){_0x522a65[_0x1f92('0x1f')]=qs[_0x1f92('0x1f')](_0x1cf5bc[_0x1f92('0x2f')]['limit']);_0x522a65[_0x1f92('0x1e')]=qs[_0x1f92('0x1e')](_0x1cf5bc[_0x1f92('0x2f')][_0x1f92('0x1e')]);}_0x522a65[_0x1f92('0x36')]=qs[_0x1f92('0x4b')](_0x1cf5bc[_0x1f92('0x2f')][_0x1f92('0x4b')]);_0x522a65[_0x1f92('0x37')]=qs['filters'](_[_0x1f92('0x4c')](_0x1cf5bc[_0x1f92('0x2f')],_0x470284[_0x1f92('0x30')]));_0x522a65[_0x1f92('0x37')]['SessionId']=_0x54d513['id'];if(_0x1cf5bc[_0x1f92('0x2f')]['filter']){_0x522a65['where']=_['merge'](_0x522a65['where'],{'$or':_[_0x1f92('0x29')](_0x522a65[_0x1f92('0x31')],function(_0x460b29){var _0x57a155={};_0x57a155[_0x460b29]={'$like':'%'+_0x1cf5bc['query'][_0x1f92('0x38')]+'%'};return _0x57a155;})});}_0x522a65=_[_0x1f92('0x3a')]({},_0x522a65,_0x1cf5bc[_0x1f92('0x3b')]);return db[_0x1f92('0x49')][_0x1f92('0x1d')]({'where':_0x522a65[_0x1f92('0x37')]})[_0x1f92('0x25')](function(_0x56b6f2){_0x181fa4['count']=_0x56b6f2;if(_0x1cf5bc['query'][_0x1f92('0x4d')]){_0x522a65[_0x1f92('0x3d')]=[{'all':!![]}];}return db[_0x1f92('0x49')][_0x1f92('0x3e')](_0x522a65);})[_0x1f92('0x25')](function(_0x1a8c93){_0x181fa4[_0x1f92('0x3f')]=_0x1a8c93;return _0x181fa4;});}})[_0x1f92('0x25')](respondWithFilteredResult(_0x5a8745,_0x522a65))[_0x1f92('0x40')](handleError(_0x5a8745,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index 3803bf5..1a63ca8 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 _0x96d9=['exports','define','JscriptySessionReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x2af731,_0x1d2667){var _0x268201=function(_0x2d3033){while(--_0x2d3033){_0x2af731['push'](_0x2af731['shift']());}};_0x268201(++_0x1d2667);}(_0x96d9,0x12e));var _0x996d=function(_0x5ee3b5,_0x4ff8b0){_0x5ee3b5=_0x5ee3b5-0x0;var _0x2784ea=_0x96d9[_0x5ee3b5];return _0x2784ea;};'use strict';var _=require(_0x996d('0x0'));var util=require(_0x996d('0x1'));var logger=require(_0x996d('0x2'))(_0x996d('0x3'));var moment=require(_0x996d('0x4'));var BPromise=require(_0x996d('0x5'));var rp=require(_0x996d('0x6'));var fs=require('fs');var path=require(_0x996d('0x7'));var rimraf=require('rimraf');var config=require(_0x996d('0x8'));var attributes=require(_0x996d('0x9'));module[_0x996d('0xa')]=function(_0x102efd,_0x47f6b5){return _0x102efd[_0x996d('0xb')](_0x996d('0xc'),attributes,{'tableName':'report_jscripty_sessions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4260=['request-promise','path','./jscriptySessionReport.attributes','exports','define','JscriptySessionReport','report_jscripty_sessions','util','../../config/logger','api','bluebird'];(function(_0x5a6cba,_0x171b97){var _0x5a273a=function(_0x567c1f){while(--_0x567c1f){_0x5a6cba['push'](_0x5a6cba['shift']());}};_0x5a273a(++_0x171b97);}(_0x4260,0x1e0));var _0x0426=function(_0x487683,_0x58b9b8){_0x487683=_0x487683-0x0;var _0x178a4d=_0x4260[_0x487683];return _0x178a4d;};'use strict';var _=require('lodash');var util=require(_0x0426('0x0'));var logger=require(_0x0426('0x1'))(_0x0426('0x2'));var moment=require('moment');var BPromise=require(_0x0426('0x3'));var rp=require(_0x0426('0x4'));var fs=require('fs');var path=require(_0x0426('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x0426('0x6'));module[_0x0426('0x7')]=function(_0x43e069,_0x511513){return _0x43e069[_0x0426('0x8')](_0x0426('0x9'),attributes,{'tableName':_0x0426('0xa'),'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 8dea6f1..6938305 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 _0xb12d=['rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','JscriptySessionReport,\x20%s,\x20%s','result','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x498eb8,_0xba6159){var _0x131ad3=function(_0x561622){while(--_0x561622){_0x498eb8['push'](_0x498eb8['shift']());}};_0x131ad3(++_0xba6159);}(_0xb12d,0x124));var _0xdb12=function(_0x3f578f,_0x51f172){_0x3f578f=_0x3f578f-0x0;var _0x32c754=_0xb12d[_0x3f578f];return _0x32c754;};'use strict';var _=require(_0xdb12('0x0'));var util=require(_0xdb12('0x1'));var moment=require(_0xdb12('0x2'));var BPromise=require('bluebird');var rs=require(_0xdb12('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb12('0x4'))['db'];var utils=require(_0xdb12('0x5'));var logger=require(_0xdb12('0x6'))(_0xdb12('0x7'));var config=require(_0xdb12('0x8'));var jayson=require(_0xdb12('0x9'));var client=jayson['client'][_0xdb12('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x19e73f,_0x27eb31,_0x3872c3){return new BPromise(function(_0x11385d,_0x11d97c){return client[_0xdb12('0xb')](_0x19e73f,_0x3872c3)[_0xdb12('0xc')](function(_0x54eb5b){logger[_0xdb12('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x27eb31,_0xdb12('0xe'));logger[_0xdb12('0xf')](_0xdb12('0x10'),_0x27eb31,'request\x20sent',JSON[_0xdb12('0x11')](_0x54eb5b));if(_0x54eb5b[_0xdb12('0x12')]){if(_0x54eb5b[_0xdb12('0x12')]['code']===0x1f4){logger[_0xdb12('0x12')]('JscriptySessionReport,\x20%s,\x20%s',_0x27eb31,_0x54eb5b[_0xdb12('0x12')][_0xdb12('0x13')]);return _0x11d97c(_0x54eb5b[_0xdb12('0x12')]['message']);}logger[_0xdb12('0x12')](_0xdb12('0x14'),_0x27eb31,_0x54eb5b['error'][_0xdb12('0x13')]);return _0x11385d(_0x54eb5b['error'][_0xdb12('0x13')]);}else{logger[_0xdb12('0xd')]('JscriptySessionReport,\x20%s,\x20%s',_0x27eb31,_0xdb12('0xe'));_0x11385d(_0x54eb5b[_0xdb12('0x15')][_0xdb12('0x13')]);}})[_0xdb12('0x16')](function(_0x504cf5){logger['error'](_0xdb12('0x14'),_0x27eb31,_0x504cf5);_0x11d97c(_0x504cf5);});});} \ No newline at end of file +var _0xd3ef=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','util'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xd3ef,0xce));var _0xfd3e=function(_0x1a5eb0,_0x1f8fbb){_0x1a5eb0=_0x1a5eb0-0x0;var _0x30f9ba=_0xd3ef[_0x1a5eb0];return _0x30f9ba;};'use strict';var _=require('lodash');var util=require(_0xfd3e('0x0'));var moment=require(_0xfd3e('0x1'));var BPromise=require(_0xfd3e('0x2'));var rs=require(_0xfd3e('0x3'));var fs=require('fs');var Redis=require(_0xfd3e('0x4'));var db=require(_0xfd3e('0x5'))['db'];var utils=require(_0xfd3e('0x6'));var logger=require(_0xfd3e('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xfd3e('0x8'));var client=jayson[_0xfd3e('0x9')][_0xfd3e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x94129d,_0x41a08c,_0x2a1bee){return new BPromise(function(_0x3465e3,_0x1dcbff){return client[_0xfd3e('0xb')](_0x94129d,_0x2a1bee)[_0xfd3e('0xc')](function(_0x542b78){logger[_0xfd3e('0xd')](_0xfd3e('0xe'),_0x41a08c,_0xfd3e('0xf'));logger[_0xfd3e('0x10')](_0xfd3e('0x11'),_0x41a08c,'request\x20sent',JSON[_0xfd3e('0x12')](_0x542b78));if(_0x542b78[_0xfd3e('0x13')]){if(_0x542b78['error']['code']===0x1f4){logger[_0xfd3e('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x41a08c,_0x542b78[_0xfd3e('0x13')][_0xfd3e('0x14')]);return _0x1dcbff(_0x542b78['error']['message']);}logger[_0xfd3e('0x13')](_0xfd3e('0xe'),_0x41a08c,_0x542b78[_0xfd3e('0x13')][_0xfd3e('0x14')]);return _0x3465e3(_0x542b78[_0xfd3e('0x13')][_0xfd3e('0x14')]);}else{logger[_0xfd3e('0xd')](_0xfd3e('0xe'),_0x41a08c,'request\x20sent');_0x3465e3(_0x542b78[_0xfd3e('0x15')][_0xfd3e('0x14')]);}})[_0xfd3e('0x16')](function(_0x303f12){logger[_0xfd3e('0x13')]('JscriptySessionReport,\x20%s,\x20%s',_0x41a08c,_0x303f12);_0x1dcbff(_0x303f12);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 4e7f08c..bc520c4 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 _0x0f0a=['multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./license.controller','get','/:id','isAuthenticated','update','exports'];(function(_0x373a50,_0x274994){var _0x404d85=function(_0x37779a){while(--_0x37779a){_0x373a50['push'](_0x373a50['shift']());}};_0x404d85(++_0x274994);}(_0x0f0a,0x82));var _0xa0f0=function(_0x4d4a2d,_0x1c17d0){_0x4d4a2d=_0x4d4a2d-0x0;var _0x4db007=_0x0f0a[_0x4d4a2d];return _0x4db007;};'use strict';var multer=require(_0xa0f0('0x0'));var util=require(_0xa0f0('0x1'));var path=require(_0xa0f0('0x2'));var timeout=require(_0xa0f0('0x3'));var express=require('express');var router=express[_0xa0f0('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa0f0('0x5'));var config=require(_0xa0f0('0x6'));var controller=require(_0xa0f0('0x7'));router[_0xa0f0('0x8')]('/',controller['index']);router['put'](_0xa0f0('0x9'),auth[_0xa0f0('0xa')](),controller[_0xa0f0('0xb')]);module[_0xa0f0('0xc')]=router; \ No newline at end of file +var _0xb9da=['get','/:id','isAuthenticated','update','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./license.controller'];(function(_0x291cb6,_0x4af8e9){var _0x2c7c5c=function(_0x252805){while(--_0x252805){_0x291cb6['push'](_0x291cb6['shift']());}};_0x2c7c5c(++_0x4af8e9);}(_0xb9da,0x1b5));var _0xab9d=function(_0x3e618a,_0x135251){_0x3e618a=_0x3e618a-0x0;var _0x1f3d61=_0xb9da[_0x3e618a];return _0x1f3d61;};'use strict';var multer=require(_0xab9d('0x0'));var util=require('util');var path=require(_0xab9d('0x1'));var timeout=require(_0xab9d('0x2'));var express=require(_0xab9d('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xab9d('0x4'));var config=require(_0xab9d('0x5'));var controller=require(_0xab9d('0x6'));router[_0xab9d('0x7')]('/',controller['index']);router['put'](_0xab9d('0x8'),auth[_0xab9d('0x9')](),controller[_0xab9d('0xa')]);module[_0xab9d('0xb')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index e5444a0..1917a3d 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 _0x687b=['TEXT','STRING','sequelize','exports'];(function(_0x440b4c,_0x5d2fa6){var _0x2391fd=function(_0x4648ee){while(--_0x4648ee){_0x440b4c['push'](_0x440b4c['shift']());}};_0x2391fd(++_0x5d2fa6);}(_0x687b,0x14a));var _0xb687=function(_0x64924c,_0x472da8){_0x64924c=_0x64924c-0x0;var _0x1b8e46=_0x687b[_0x64924c];return _0x1b8e46;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'license':{'type':Sequelize[_0xb687('0x2')]},'data1':{'type':Sequelize[_0xb687('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xabce=['exports','TEXT','STRING','sequelize'];(function(_0x215dc8,_0x52c245){var _0x583ea3=function(_0x32350d){while(--_0x32350d){_0x215dc8['push'](_0x215dc8['shift']());}};_0x583ea3(++_0x52c245);}(_0xabce,0x103));var _0xeabc=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xabce[_0x3054be];return _0x3df150;};'use strict';var Sequelize=require(_0xeabc('0x0'));module[_0xeabc('0x1')]={'license':{'type':Sequelize[_0xeabc('0x2')]},'data1':{'type':Sequelize[_0xeabc('0x3')]},'data2':{'type':Sequelize[_0xeabc('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index fbb20cd..ac9394a 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 _0x3287=['options','getLicense','catch','body','find','params','get','checkLicense','key','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','sendStatus','error','stack','name','send','../../config/license/util','index','model','rawAttributes','keys','query','intersection','fields','attributes','length','merge'];(function(_0x355e2b,_0x1e99eb){var _0x2b59bb=function(_0x14f698){while(--_0x14f698){_0x355e2b['push'](_0x355e2b['shift']());}};_0x2b59bb(++_0x1e99eb);}(_0x3287,0x85));var _0x7328=function(_0x442aca,_0x28f24e){_0x442aca=_0x442aca-0x0;var _0x675ae9=_0x3287[_0x442aca];return _0x675ae9;};'use strict';var pdf=require(_0x7328('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7328('0x1'));var zipdir=require(_0x7328('0x2'));var jsonpatch=require(_0x7328('0x3'));var rp=require(_0x7328('0x4'));var moment=require(_0x7328('0x5'));var BPromise=require(_0x7328('0x6'));var Mustache=require(_0x7328('0x7'));var util=require('util');var path=require(_0x7328('0x8'));var sox=require(_0x7328('0x9'));var csv=require(_0x7328('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x7328('0xb'));var squel=require(_0x7328('0xc'));var crypto=require(_0x7328('0xd'));var jsforce=require(_0x7328('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x7328('0xa'));var querystring=require(_0x7328('0xf'));var Papa=require(_0x7328('0x10'));var Redis=require(_0x7328('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x7328('0x12'));var as=require(_0x7328('0x13'));var hardwareService=require(_0x7328('0x14'));var logger=require(_0x7328('0x15'))(_0x7328('0x16'));var utils=require(_0x7328('0x17'));var config=require('../../config/environment');var db=require(_0x7328('0x18'))['db'];function respondWithStatusCode(_0x2936ee,_0x2d850f){_0x2d850f=_0x2d850f||0xcc;return function(_0x56954){if(_0x56954){return _0x2936ee['sendStatus'](_0x2d850f);}return _0x2936ee['status'](_0x2d850f)[_0x7328('0x19')]();};}function respondWithResult(_0x325bf9,_0x391298){_0x391298=_0x391298||0xc8;return function(_0x10e930){if(_0x10e930){return _0x325bf9[_0x7328('0x1a')](_0x391298)['json'](_0x10e930);}};}function respondWithFilteredResult(_0x4cc162,_0x5ca619){return function(_0x21d9e8){if(_0x21d9e8){var _0x12047b=_0x21d9e8['count'],_0x17ee5d=_0x5ca619[_0x7328('0x1b')],_0x162f4c=_0x5ca619['offset']+_0x5ca619[_0x7328('0x1c')],_0x5090cd;if(_0x162f4c>=_0x12047b){_0x162f4c=_0x12047b;_0x5090cd=0xc8;}else{_0x5090cd=0xce;}_0x4cc162[_0x7328('0x1a')](_0x5090cd);return _0x4cc162[_0x7328('0x1d')](_0x7328('0x1e'),_0x17ee5d+'-'+_0x162f4c+'/'+_0x12047b)[_0x7328('0x1f')](_0x21d9e8);}return null;};}function patchUpdates(_0x382b87){return function(_0x39c6d){try{jsonpatch[_0x7328('0x20')](_0x39c6d,_0x382b87,!![]);}catch(_0x277141){return BPromise['reject'](_0x277141);}return _0x39c6d[_0x7328('0x21')]();};}function saveUpdates(_0x1c11d4,_0x5bb339){return function(_0x29935d){if(_0x29935d){return _0x29935d[_0x7328('0x22')](_0x1c11d4)['then'](function(_0x1a86ab){return _0x1a86ab;});}return null;};}function removeEntity(_0x3cdafb,_0x4d7550){return function(_0x3dd281){if(_0x3dd281){return _0x3dd281[_0x7328('0x23')]()[_0x7328('0x24')](function(){_0x3cdafb[_0x7328('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xa06f08,_0x50bc83){return function(_0x37143c){if(!_0x37143c){_0xa06f08[_0x7328('0x25')](0x194);}return _0x37143c;};}function handleError(_0x2f82d8,_0x289879){_0x289879=_0x289879||0x1f4;return function(_0x110379){logger[_0x7328('0x26')](_0x110379[_0x7328('0x27')]);if(_0x110379[_0x7328('0x28')]){delete _0x110379['name'];}_0x2f82d8[_0x7328('0x1a')](_0x289879)[_0x7328('0x29')](_0x110379);};}var utilLicense=require(_0x7328('0x2a'));exports[_0x7328('0x2b')]=function(_0x1a7e74,_0xe652b5){var _0x4dd60a={'raw':!![],'where':{'id':0x1}},_0x286730={};_0x286730[_0x7328('0x2c')]=_['keys'](db['License'][_0x7328('0x2d')]);_0x286730['query']=_[_0x7328('0x2e')](_0x1a7e74[_0x7328('0x2f')]);_0x286730['filters']=_[_0x7328('0x30')](_0x286730[_0x7328('0x2c')],_0x286730[_0x7328('0x2f')]);_0x4dd60a['attributes']=_['intersection'](_0x286730[_0x7328('0x2c')],qs[_0x7328('0x31')](_0x1a7e74[_0x7328('0x2f')][_0x7328('0x31')]));_0x4dd60a[_0x7328('0x32')]=_0x4dd60a['attributes'][_0x7328('0x33')]?_0x4dd60a[_0x7328('0x32')]:_0x286730[_0x7328('0x2c')];_0x4dd60a=_[_0x7328('0x34')]({},_0x4dd60a,_0x1a7e74[_0x7328('0x35')]);return utilLicense[_0x7328('0x36')](_0x4dd60a)[_0x7328('0x24')](respondWithResult(_0xe652b5,null))[_0x7328('0x37')](handleError(_0xe652b5,null));};exports[_0x7328('0x22')]=function(_0x400342,_0xcc061e){if(_0x400342[_0x7328('0x38')]['id']){delete _0x400342[_0x7328('0x38')]['id'];}return db['License'][_0x7328('0x39')]({'where':{'id':_0x400342[_0x7328('0x3a')]['id']}})[_0x7328('0x24')](handleEntityNotFound(_0xcc061e,null))['then'](function(_0x53eb7c){var _0x59012d=_0x53eb7c[_0x7328('0x3b')]({'plain':!![]});return utilLicense[_0x7328('0x3c')](_0x59012d,_0x400342[_0x7328('0x38')][_0x7328('0x3d')]);})['then'](function(_0x30012a){if(!_0x30012a['demo']){return saveUpdates(_0x400342[_0x7328('0x38')],null);}return _0x30012a;})[_0x7328('0x24')](respondWithResult(_0xcc061e,null))['catch'](handleError(_0xcc061e,null));}; \ No newline at end of file +var _0xfabd=['util','path','sox','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','../../config/license/util','model','keys','License','rawAttributes','query','filters','intersection','fields','attributes','length','merge','options','update','body','params','get','checkLicense','key','catch','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xa46a1c,_0x5e1477){var _0x517038=function(_0x5f09cc){while(--_0x5f09cc){_0xa46a1c['push'](_0xa46a1c['shift']());}};_0x517038(++_0x5e1477);}(_0xfabd,0x161));var _0xdfab=function(_0x3bc06d,_0xb01792){_0x3bc06d=_0x3bc06d-0x0;var _0x3b3ebe=_0xfabd[_0x3bc06d];return _0x3b3ebe;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xdfab('0x0'));var zipdir=require(_0xdfab('0x1'));var jsonpatch=require(_0xdfab('0x2'));var rp=require(_0xdfab('0x3'));var moment=require(_0xdfab('0x4'));var BPromise=require(_0xdfab('0x5'));var Mustache=require(_0xdfab('0x6'));var util=require(_0xdfab('0x7'));var path=require(_0xdfab('0x8'));var sox=require(_0xdfab('0x9'));var csv=require(_0xdfab('0xa'));var ejs=require(_0xdfab('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xdfab('0xc'));var crypto=require('crypto');var jsforce=require(_0xdfab('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdfab('0xe'));var Papa=require(_0xdfab('0xf'));var Redis=require(_0xdfab('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdfab('0x11'));var hardwareService=require(_0xdfab('0x12'));var logger=require(_0xdfab('0x13'))(_0xdfab('0x14'));var utils=require(_0xdfab('0x15'));var config=require('../../config/environment');var db=require(_0xdfab('0x16'))['db'];function respondWithStatusCode(_0x4af6e5,_0xd83302){_0xd83302=_0xd83302||0xcc;return function(_0x139881){if(_0x139881){return _0x4af6e5[_0xdfab('0x17')](_0xd83302);}return _0x4af6e5[_0xdfab('0x18')](_0xd83302)['end']();};}function respondWithResult(_0x3e8e56,_0x2ac5b4){_0x2ac5b4=_0x2ac5b4||0xc8;return function(_0x3ca4f7){if(_0x3ca4f7){return _0x3e8e56['status'](_0x2ac5b4)[_0xdfab('0x19')](_0x3ca4f7);}};}function respondWithFilteredResult(_0x344a5c,_0x2c491d){return function(_0x548805){if(_0x548805){var _0x4fc27a=_0x548805[_0xdfab('0x1a')],_0x543379=_0x2c491d['offset'],_0x38805c=_0x2c491d[_0xdfab('0x1b')]+_0x2c491d[_0xdfab('0x1c')],_0x2eb87d;if(_0x38805c>=_0x4fc27a){_0x38805c=_0x4fc27a;_0x2eb87d=0xc8;}else{_0x2eb87d=0xce;}_0x344a5c[_0xdfab('0x18')](_0x2eb87d);return _0x344a5c[_0xdfab('0x1d')](_0xdfab('0x1e'),_0x543379+'-'+_0x38805c+'/'+_0x4fc27a)[_0xdfab('0x19')](_0x548805);}return null;};}function patchUpdates(_0x3224dd){return function(_0x59c52f){try{jsonpatch[_0xdfab('0x1f')](_0x59c52f,_0x3224dd,!![]);}catch(_0x19ec75){return BPromise[_0xdfab('0x20')](_0x19ec75);}return _0x59c52f[_0xdfab('0x21')]();};}function saveUpdates(_0x35a122,_0x16e1af){return function(_0x45215f){if(_0x45215f){return _0x45215f['update'](_0x35a122)[_0xdfab('0x22')](function(_0x28a90e){return _0x28a90e;});}return null;};}function removeEntity(_0x5476c7,_0x228e39){return function(_0x41918a){if(_0x41918a){return _0x41918a[_0xdfab('0x23')]()[_0xdfab('0x22')](function(){_0x5476c7[_0xdfab('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3ff9af,_0x31ab9c){return function(_0xf5be50){if(!_0xf5be50){_0x3ff9af[_0xdfab('0x17')](0x194);}return _0xf5be50;};}function handleError(_0x4ca9a7,_0x2aa03d){_0x2aa03d=_0x2aa03d||0x1f4;return function(_0x20bdf5){logger[_0xdfab('0x24')](_0x20bdf5[_0xdfab('0x25')]);if(_0x20bdf5[_0xdfab('0x26')]){delete _0x20bdf5[_0xdfab('0x26')];}_0x4ca9a7[_0xdfab('0x18')](_0x2aa03d)[_0xdfab('0x27')](_0x20bdf5);};}var utilLicense=require(_0xdfab('0x28'));exports['index']=function(_0x3a71d6,_0x423de5){var _0x4f95ec={'raw':!![],'where':{'id':0x1}},_0xd8193e={};_0xd8193e[_0xdfab('0x29')]=_[_0xdfab('0x2a')](db[_0xdfab('0x2b')][_0xdfab('0x2c')]);_0xd8193e[_0xdfab('0x2d')]=_[_0xdfab('0x2a')](_0x3a71d6[_0xdfab('0x2d')]);_0xd8193e[_0xdfab('0x2e')]=_[_0xdfab('0x2f')](_0xd8193e[_0xdfab('0x29')],_0xd8193e['query']);_0x4f95ec['attributes']=_[_0xdfab('0x2f')](_0xd8193e[_0xdfab('0x29')],qs[_0xdfab('0x30')](_0x3a71d6[_0xdfab('0x2d')][_0xdfab('0x30')]));_0x4f95ec['attributes']=_0x4f95ec[_0xdfab('0x31')][_0xdfab('0x32')]?_0x4f95ec['attributes']:_0xd8193e[_0xdfab('0x29')];_0x4f95ec=_[_0xdfab('0x33')]({},_0x4f95ec,_0x3a71d6[_0xdfab('0x34')]);return utilLicense['getLicense'](_0x4f95ec)[_0xdfab('0x22')](respondWithResult(_0x423de5,null))['catch'](handleError(_0x423de5,null));};exports[_0xdfab('0x35')]=function(_0x31900b,_0x3e4f21){if(_0x31900b['body']['id']){delete _0x31900b[_0xdfab('0x36')]['id'];}return db[_0xdfab('0x2b')]['find']({'where':{'id':_0x31900b[_0xdfab('0x37')]['id']}})[_0xdfab('0x22')](handleEntityNotFound(_0x3e4f21,null))[_0xdfab('0x22')](function(_0x582007){var _0x23883f=_0x582007[_0xdfab('0x38')]({'plain':!![]});return utilLicense[_0xdfab('0x39')](_0x23883f,_0x31900b[_0xdfab('0x36')][_0xdfab('0x3a')]);})['then'](function(_0x2d2893){if(!_0x2d2893['demo']){return saveUpdates(_0x31900b[_0xdfab('0x36')],null);}return _0x2d2893;})[_0xdfab('0x22')](respondWithResult(_0x3e4f21,null))[_0xdfab('0x3b')](handleError(_0x3e4f21,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index 5958328..c68f2cc 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 _0x63b6=['rimraf','../../config/environment','./license.attributes','define','license','lodash','util','../../config/logger','moment','request-promise'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x63b6,0x127));var _0x663b=function(_0x21f4ad,_0x280c74){_0x21f4ad=_0x21f4ad-0x0;var _0x1e383d=_0x63b6[_0x21f4ad];return _0x1e383d;};'use strict';var _=require(_0x663b('0x0'));var util=require(_0x663b('0x1'));var logger=require(_0x663b('0x2'))('api');var moment=require(_0x663b('0x3'));var BPromise=require('bluebird');var rp=require(_0x663b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x663b('0x5'));var config=require(_0x663b('0x6'));var attributes=require(_0x663b('0x7'));module['exports']=function(_0x4486b1,_0x57e43e){return _0x4486b1[_0x663b('0x8')]('License',attributes,{'tableName':_0x663b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x093d=['License','license','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x093d,0x1c9));var _0xd093=function(_0x3e7b5a,_0x4c06fe){_0x3e7b5a=_0x3e7b5a-0x0;var _0x4880aa=_0x093d[_0x3e7b5a];return _0x4880aa;};'use strict';var _=require(_0xd093('0x0'));var util=require(_0xd093('0x1'));var logger=require(_0xd093('0x2'))(_0xd093('0x3'));var moment=require(_0xd093('0x4'));var BPromise=require(_0xd093('0x5'));var rp=require(_0xd093('0x6'));var fs=require('fs');var path=require(_0xd093('0x7'));var rimraf=require(_0xd093('0x8'));var config=require(_0xd093('0x9'));var attributes=require(_0xd093('0xa'));module['exports']=function(_0x5851ee,_0x4e565d){return _0x5851ee['define'](_0xd093('0xb'),attributes,{'tableName':_0xd093('0xc'),'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 41d33d3..280bc0a 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 _0x60e1=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x369590,_0x169ae9){var _0x485d6d=function(_0x3c1372){while(--_0x3c1372){_0x369590['push'](_0x369590['shift']());}};_0x485d6d(++_0x169ae9);}(_0x60e1,0x14c));var _0x160e=function(_0x39408d,_0x55d104){_0x39408d=_0x39408d-0x0;var _0x5a5613=_0x60e1[_0x39408d];return _0x5a5613;};'use strict';var _=require(_0x160e('0x0'));var util=require('util');var moment=require(_0x160e('0x1'));var BPromise=require(_0x160e('0x2'));var rs=require(_0x160e('0x3'));var fs=require('fs');var Redis=require(_0x160e('0x4'));var db=require(_0x160e('0x5'))['db'];var utils=require(_0x160e('0x6'));var logger=require(_0x160e('0x7'))(_0x160e('0x8'));var config=require(_0x160e('0x9'));var jayson=require(_0x160e('0xa'));var client=jayson['client'][_0x160e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4da502,_0x3b58ca,_0x195a22){return new BPromise(function(_0xbc9baa,_0x5cc74f){return client[_0x160e('0xc')](_0x4da502,_0x195a22)[_0x160e('0xd')](function(_0x2b90da){logger[_0x160e('0xe')](_0x160e('0xf'),_0x3b58ca,_0x160e('0x10'));logger['debug'](_0x160e('0x11'),_0x3b58ca,_0x160e('0x10'),JSON[_0x160e('0x12')](_0x2b90da));if(_0x2b90da[_0x160e('0x13')]){if(_0x2b90da[_0x160e('0x13')][_0x160e('0x14')]===0x1f4){logger[_0x160e('0x13')]('License,\x20%s,\x20%s',_0x3b58ca,_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);return _0x5cc74f(_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);}logger['error'](_0x160e('0xf'),_0x3b58ca,_0x2b90da[_0x160e('0x13')][_0x160e('0x15')]);return _0xbc9baa(_0x2b90da[_0x160e('0x13')]['message']);}else{logger['info']('License,\x20%s,\x20%s',_0x3b58ca,'request\x20sent');_0xbc9baa(_0x2b90da[_0x160e('0x16')][_0x160e('0x15')]);}})[_0x160e('0x17')](function(_0x2a5ec5){logger[_0x160e('0x13')](_0x160e('0xf'),_0x3b58ca,_0x2a5ec5);_0x5cc74f(_0x2a5ec5);});});} \ No newline at end of file +var _0xbefe=['request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','License,\x20%s,\x20%s'];(function(_0x52ffec,_0x3ae660){var _0x5daa39=function(_0x5295c1){while(--_0x5295c1){_0x52ffec['push'](_0x52ffec['shift']());}};_0x5daa39(++_0x3ae660);}(_0xbefe,0x168));var _0xebef=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0xbefe[_0x4ded65];return _0x5864fb;};'use strict';var _=require('lodash');var util=require(_0xebef('0x0'));var moment=require('moment');var BPromise=require(_0xebef('0x1'));var rs=require(_0xebef('0x2'));var fs=require('fs');var Redis=require(_0xebef('0x3'));var db=require(_0xebef('0x4'))['db'];var utils=require(_0xebef('0x5'));var logger=require(_0xebef('0x6'))(_0xebef('0x7'));var config=require(_0xebef('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xebef('0x9')][_0xebef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e89ca,_0x4fb4fa,_0x4286bf){return new BPromise(function(_0x2fbd2c,_0x598d6d){return client['request'](_0x3e89ca,_0x4286bf)[_0xebef('0xb')](function(_0xa0a8ef){logger[_0xebef('0xc')](_0xebef('0xd'),_0x4fb4fa,_0xebef('0xe'));logger[_0xebef('0xf')](_0xebef('0x10'),_0x4fb4fa,_0xebef('0xe'),JSON['stringify'](_0xa0a8ef));if(_0xa0a8ef[_0xebef('0x11')]){if(_0xa0a8ef[_0xebef('0x11')][_0xebef('0x12')]===0x1f4){logger[_0xebef('0x11')](_0xebef('0xd'),_0x4fb4fa,_0xa0a8ef['error']['message']);return _0x598d6d(_0xa0a8ef['error']['message']);}logger[_0xebef('0x11')](_0xebef('0xd'),_0x4fb4fa,_0xa0a8ef[_0xebef('0x11')][_0xebef('0x13')]);return _0x2fbd2c(_0xa0a8ef[_0xebef('0x11')][_0xebef('0x13')]);}else{logger['info'](_0xebef('0xd'),_0x4fb4fa,_0xebef('0xe'));_0x2fbd2c(_0xa0a8ef[_0xebef('0x14')][_0xebef('0x13')]);}})[_0xebef('0x15')](function(_0x8e7044){logger[_0xebef('0x11')](_0xebef('0xd'),_0x4fb4fa,_0x8e7044);_0x598d6d(_0x8e7044);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 9ca1785..1583b3e 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 _0xc8bd=['getImap','/:id/out_servers','getSmtp','/:id/interactions','/:id/users','post','addDisposition','addAnswer','create','/:id/in_servers','addSmtp','addInteraction','addApplications','/:id/send','addAgents','/:id','update','delete','removeAnswers','removeImap','destroy','removeAgents','exports','multer','express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x5d21dd,_0x30cbba){var _0x3d89d8=function(_0x5b0b48){while(--_0x5b0b48){_0x5d21dd['push'](_0x5d21dd['shift']());}};_0x3d89d8(++_0x30cbba);}(_0xc8bd,0x15b));var _0xdc8b=function(_0x13f3af,_0x2ac326){_0x13f3af=_0x13f3af-0x0;var _0xda3c9f=_0xc8bd[_0x13f3af];return _0xda3c9f;};'use strict';var multer=require(_0xdc8b('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdc8b('0x1'));var router=express[_0xdc8b('0x2')]();var auth=require(_0xdc8b('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./mailAccount.controller');router[_0xdc8b('0x4')]('/',auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x6')]);router['get'](_0xdc8b('0x7'),auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x8')]);router[_0xdc8b('0x4')](_0xdc8b('0x9'),auth[_0xdc8b('0x5')](),controller[_0xdc8b('0xa')]);router[_0xdc8b('0x4')](_0xdc8b('0xb'),auth['isAuthenticated'](),controller[_0xdc8b('0xc')]);router['get']('/:id/in_servers',auth[_0xdc8b('0x5')](),controller[_0xdc8b('0xd')]);router[_0xdc8b('0x4')](_0xdc8b('0xe'),auth[_0xdc8b('0x5')](),controller[_0xdc8b('0xf')]);router['get'](_0xdc8b('0x10'),auth[_0xdc8b('0x5')](),controller['getInteractions']);router[_0xdc8b('0x4')]('/:id/applications',auth['isAuthenticated'](),controller['getApplications']);router[_0xdc8b('0x4')]('/:id/messages',auth[_0xdc8b('0x5')](),controller['getMessages']);router[_0xdc8b('0x4')]('/:id/verify',auth[_0xdc8b('0x5')](),controller['verifySmtp']);router[_0xdc8b('0x4')](_0xdc8b('0x11'),auth[_0xdc8b('0x5')](),controller['getAgents']);router[_0xdc8b('0x12')](_0xdc8b('0x9'),auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x13')]);router[_0xdc8b('0x12')](_0xdc8b('0xb'),auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x14')]);router[_0xdc8b('0x12')]('/',auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x15')]);router['post'](_0xdc8b('0x16'),auth[_0xdc8b('0x5')](),controller['addImap']);router[_0xdc8b('0x12')]('/:id/out_servers',auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x17')]);router[_0xdc8b('0x12')](_0xdc8b('0x10'),auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x18')]);router[_0xdc8b('0x12')]('/:id/applications',auth['isAuthenticated'](),controller[_0xdc8b('0x19')]);router[_0xdc8b('0x12')](_0xdc8b('0x1a'),auth[_0xdc8b('0x5')](),controller['send']);router[_0xdc8b('0x12')](_0xdc8b('0x11'),auth['isAuthenticated'](),controller[_0xdc8b('0x1b')]);router['put'](_0xdc8b('0x1c'),auth['isAuthenticated'](),controller[_0xdc8b('0x1d')]);router[_0xdc8b('0x1e')](_0xdc8b('0x9'),auth[_0xdc8b('0x5')](),controller['removeDispositions']);router[_0xdc8b('0x1e')]('/:id/canned_answers',auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x1f')]);router[_0xdc8b('0x1e')](_0xdc8b('0x16'),auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x20')]);router[_0xdc8b('0x1e')](_0xdc8b('0xe'),auth[_0xdc8b('0x5')](),controller['removeSmtp']);router[_0xdc8b('0x1e')](_0xdc8b('0x1c'),auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x21')]);router[_0xdc8b('0x1e')]('/:id/users',auth[_0xdc8b('0x5')](),controller[_0xdc8b('0x22')]);module[_0xdc8b('0x23')]=router; \ No newline at end of file +var _0x373b=['/:id/messages','getMessages','/:id/verify','verifySmtp','/:id/users','getAgents','post','create','addImap','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','update','delete','removeDispositions','removeAnswers','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailAccount.controller','get','/describe','isAuthenticated','describe','/:id','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','/:id/interactions','getInteractions','/:id/applications','getApplications'];(function(_0x21fd7d,_0x241fe1){var _0x473c12=function(_0x23d1e6){while(--_0x23d1e6){_0x21fd7d['push'](_0x21fd7d['shift']());}};_0x473c12(++_0x241fe1);}(_0x373b,0x13e));var _0xb373=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x373b[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0xb373('0x0'));var util=require(_0xb373('0x1'));var path=require(_0xb373('0x2'));var timeout=require('connect-timeout');var express=require(_0xb373('0x3'));var router=express[_0xb373('0x4')]();var auth=require(_0xb373('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb373('0x6'));var controller=require(_0xb373('0x7'));router[_0xb373('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xb373('0x8')](_0xb373('0x9'),auth[_0xb373('0xa')](),controller[_0xb373('0xb')]);router[_0xb373('0x8')](_0xb373('0xc'),auth[_0xb373('0xa')](),controller['show']);router[_0xb373('0x8')](_0xb373('0xd'),auth[_0xb373('0xa')](),controller[_0xb373('0xe')]);router[_0xb373('0x8')](_0xb373('0xf'),auth['isAuthenticated'](),controller[_0xb373('0x10')]);router[_0xb373('0x8')](_0xb373('0x11'),auth[_0xb373('0xa')](),controller[_0xb373('0x12')]);router[_0xb373('0x8')](_0xb373('0x13'),auth[_0xb373('0xa')](),controller[_0xb373('0x14')]);router[_0xb373('0x8')](_0xb373('0x15'),auth[_0xb373('0xa')](),controller[_0xb373('0x16')]);router['get'](_0xb373('0x17'),auth[_0xb373('0xa')](),controller[_0xb373('0x18')]);router[_0xb373('0x8')](_0xb373('0x19'),auth['isAuthenticated'](),controller[_0xb373('0x1a')]);router[_0xb373('0x8')](_0xb373('0x1b'),auth[_0xb373('0xa')](),controller[_0xb373('0x1c')]);router['get'](_0xb373('0x1d'),auth[_0xb373('0xa')](),controller[_0xb373('0x1e')]);router['post'](_0xb373('0xd'),auth[_0xb373('0xa')](),controller['addDisposition']);router[_0xb373('0x1f')](_0xb373('0xf'),auth[_0xb373('0xa')](),controller['addAnswer']);router[_0xb373('0x1f')]('/',auth[_0xb373('0xa')](),controller[_0xb373('0x20')]);router[_0xb373('0x1f')]('/:id/in_servers',auth[_0xb373('0xa')](),controller[_0xb373('0x21')]);router['post'](_0xb373('0x13'),auth['isAuthenticated'](),controller[_0xb373('0x22')]);router[_0xb373('0x1f')](_0xb373('0x15'),auth[_0xb373('0xa')](),controller[_0xb373('0x23')]);router[_0xb373('0x1f')](_0xb373('0x17'),auth['isAuthenticated'](),controller[_0xb373('0x24')]);router[_0xb373('0x1f')](_0xb373('0x25'),auth[_0xb373('0xa')](),controller[_0xb373('0x26')]);router[_0xb373('0x1f')](_0xb373('0x1d'),auth['isAuthenticated'](),controller[_0xb373('0x27')]);router['put'](_0xb373('0xc'),auth[_0xb373('0xa')](),controller[_0xb373('0x28')]);router[_0xb373('0x29')](_0xb373('0xd'),auth[_0xb373('0xa')](),controller[_0xb373('0x2a')]);router[_0xb373('0x29')](_0xb373('0xf'),auth[_0xb373('0xa')](),controller[_0xb373('0x2b')]);router[_0xb373('0x29')](_0xb373('0x11'),auth['isAuthenticated'](),controller[_0xb373('0x2c')]);router[_0xb373('0x29')]('/:id/out_servers',auth[_0xb373('0xa')](),controller[_0xb373('0x2d')]);router[_0xb373('0x29')](_0xb373('0xc'),auth['isAuthenticated'](),controller[_0xb373('0x2e')]);router[_0xb373('0x29')]('/:id/users',auth[_0xb373('0xa')](),controller[_0xb373('0x2f')]);module[_0xb373('0x30')]=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index ac52c81..d8fc89e 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 _0x91ac=['TEXT','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','exports','STRING','BOOLEAN'];(function(_0x3c917e,_0x37fecf){var _0xa9dd8c=function(_0x3af661){while(--_0x3af661){_0x3c917e['push'](_0x3c917e['shift']());}};_0xa9dd8c(++_0x37fecf);}(_0x91ac,0x1c5));var _0xc91a=function(_0x2efda4,_0x86b53b){_0x2efda4=_0x2efda4-0x0;var _0x1b5c11=_0x91ac[_0x2efda4];return _0x1b5c11;};'use strict';var Sequelize=require('sequelize');module[_0xc91a('0x0')]={'description':{'type':Sequelize[_0xc91a('0x1')]},'name':{'type':Sequelize[_0xc91a('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0xc91a('0x2')],'defaultValue':![]},'email':{'type':Sequelize[_0xc91a('0x1')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0xc91a('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0xc91a('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0xc91a('0x3')]},'markAsUnread':{'type':Sequelize[_0xc91a('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xc91a('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize['INTEGER'](0x2)[_0xc91a('0x4')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xc91a('0x3')],'defaultValue':function(){return _0xc91a('0x5');}},'notificationSound':{'type':Sequelize[_0xc91a('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xc91a('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xc91a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xc91a('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xc91a('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xc91a('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xc91a('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xc91a('0x2')],'defaultValue':![],'comment':_0xc91a('0x8'),'set':function(_0x39280e){if(!_0x39280e)this[_0xc91a('0x9')](_0xc91a('0xa'),null);this[_0xc91a('0x9')](_0xc91a('0xb'),_0x39280e);}}}; \ No newline at end of file +var _0xec02=['mandatoryDisposition','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0xec02,0xa6));var _0x2ec0=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xec02[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');module[_0x2ec0('0x0')]={'description':{'type':Sequelize[_0x2ec0('0x1')]},'name':{'type':Sequelize[_0x2ec0('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x2ec0('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x2ec0('0x2')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x2ec0('0x3')]},'markAsUnread':{'type':Sequelize[_0x2ec0('0x2')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x2ec0('0x1')],'allowNull':![],'defaultValue':_0x2ec0('0x4')},'fontSize':{'type':Sequelize[_0x2ec0('0x5')](0x2)[_0x2ec0('0x6')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x2ec0('0x2')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x2ec0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x2ec0('0x2')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x2ec0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x2ec0('0x2')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x2ec0('0x5')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x2ec0('0x7')},'mandatoryDisposition':{'type':Sequelize[_0x2ec0('0x2')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x583884){if(!_0x583884)this[_0x2ec0('0x8')](_0x2ec0('0x9'),null);this[_0x2ec0('0x8')](_0x2ec0('0xa'),_0x583884);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index abb2cdc..cc51b13 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 _0x7f1c=['MailMessage','$gte','split','format','CmList','List','updatedAt','DESC','isNil','from','%s\x20<%s>','attachments','root','server/files/attachments','secure','auth','SendMail','Contacts','CmContact','messageId','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','Interaction','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','redis','defaults','socket.io-emitter','./mailAccount.socket','register','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','debug','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','set','update','destroy','get','MailAccounts','UserProfileResource','name','index','MailServerIn','Imap','MailServerOut','Pause','map','MailAccount','fieldName','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','count','include','findAll','rows','catch','show','params','Smtp','mandatoryDispositionPause','rawAttributes','includeAll','find','body','describe','addDisposition','findOne','order','MailAccountId','Disposition','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','create','email','ListId','active','description','cservice','cauthentication','cuser','password','pass','cpassword','authentication','host','port','service','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','setSmtp','MailInteraction','omit','getInteractions','User','Owner','internal','Tag','Tags','color','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','getApplications','getMessages'];(function(_0x1bec2e,_0x2599f7){var _0x4d8f5b=function(_0x206292){while(--_0x206292){_0x1bec2e['push'](_0x1bec2e['shift']());}};_0x4d8f5b(++_0x2599f7);}(_0x7f1c,0xdf));var _0xc7f1=function(_0xd6e343,_0x41a619){_0xd6e343=_0xd6e343-0x0;var _0x5c0e4a=_0x7f1c[_0xd6e343];return _0x5c0e4a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc7f1('0x0'));var rimraf=require(_0xc7f1('0x1'));var zipdir=require(_0xc7f1('0x2'));var jsonpatch=require(_0xc7f1('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xc7f1('0x4'));var Mustache=require(_0xc7f1('0x5'));var util=require(_0xc7f1('0x6'));var path=require(_0xc7f1('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc7f1('0x8'));var fs=require('fs');var _=require(_0xc7f1('0x9'));var squel=require(_0xc7f1('0xa'));var crypto=require(_0xc7f1('0xb'));var jsforce=require(_0xc7f1('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc7f1('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc7f1('0xe'));var authService=require(_0xc7f1('0xf'));var qs=require(_0xc7f1('0x10'));var as=require(_0xc7f1('0x11'));var hardwareService=require(_0xc7f1('0x12'));var logger=require(_0xc7f1('0x13'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc7f1('0x14'))['db'];config[_0xc7f1('0x15')]=_[_0xc7f1('0x16')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xc7f1('0x17'))(new Redis(config[_0xc7f1('0x15')]));require(_0xc7f1('0x18'))[_0xc7f1('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0xc7f1('0x1a')][_0xc7f1('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x10b852,_0x3d37e8,_0x492684){if(_0x492684){var _0x297175=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x297175[_0xc7f1('0x1c')](_0x3d37e8)){return _0x10b852;}else{throw new db[(_0xc7f1('0x1d'))]['ValidationError'](_0xc7f1('0x1e'));}}else{return _0x10b852;}}function respondWithRpcPromise(_0x1ae8e7,_0xee7d49,_0x29e5e4,_0x226f23){return new BPromise(function(_0x29f1d3,_0x5e5601){var _0x4906ea=_0x226f23||client;return _0x4906ea[_0xc7f1('0x1f')](_0x1ae8e7,_0x29e5e4)[_0xc7f1('0x20')](function(_0x3e0f1d){logger[_0xc7f1('0x21')](_0xc7f1('0x22'),_0xee7d49,'request\x20sent');logger[_0xc7f1('0x23')](_0xc7f1('0x24'),_0xee7d49,_0xc7f1('0x25'),JSON[_0xc7f1('0x26')](_0x3e0f1d));if(_0x3e0f1d[_0xc7f1('0x27')]){if(_0x3e0f1d[_0xc7f1('0x27')][_0xc7f1('0x28')]===0x1f4){logger[_0xc7f1('0x27')](_0xc7f1('0x22'),_0xee7d49,_0x3e0f1d[_0xc7f1('0x27')][_0xc7f1('0x29')]);return _0x5e5601(_0x3e0f1d[_0xc7f1('0x27')][_0xc7f1('0x29')]);}logger[_0xc7f1('0x27')](_0xc7f1('0x22'),_0xee7d49,_0x3e0f1d[_0xc7f1('0x27')][_0xc7f1('0x29')]);return _0x29f1d3(_0x3e0f1d[_0xc7f1('0x27')][_0xc7f1('0x29')]);}else{logger[_0xc7f1('0x21')](_0xc7f1('0x22'),_0xee7d49,'request\x20sent');_0x29f1d3(_0x3e0f1d[_0xc7f1('0x2a')][_0xc7f1('0x29')]);}})['catch'](function(_0x352dcc){logger[_0xc7f1('0x27')]('MailAccount,\x20%s,\x20%s',_0xee7d49,_0x352dcc);_0x5e5601(_0x352dcc);});});}function respondWithStatusCode(_0x51a485,_0x251ef6){_0x251ef6=_0x251ef6||0xcc;return function(_0x10b1ab){if(_0x10b1ab){return _0x51a485[_0xc7f1('0x2b')](_0x251ef6);}return _0x51a485[_0xc7f1('0x2c')](_0x251ef6)[_0xc7f1('0x2d')]();};}function respondWithResult(_0x225aa3,_0x4737f5){_0x4737f5=_0x4737f5||0xc8;return function(_0x13fa70){if(_0x13fa70){return _0x225aa3[_0xc7f1('0x2c')](_0x4737f5)[_0xc7f1('0x2e')](_0x13fa70);}};}function respondWithFilteredResult(_0x3299e3,_0x2e066d){return function(_0x315cc2){if(_0x315cc2){var _0x4efee4=_0x315cc2['count'],_0x3a8975=_0x2e066d[_0xc7f1('0x2f')],_0x2a28ab=_0x2e066d['offset']+_0x2e066d[_0xc7f1('0x30')],_0x311d8e;if(_0x2a28ab>=_0x4efee4){_0x2a28ab=_0x4efee4;_0x311d8e=0xc8;}else{_0x311d8e=0xce;}_0x3299e3['status'](_0x311d8e);return _0x3299e3[_0xc7f1('0x31')]('Content-Range',_0x3a8975+'-'+_0x2a28ab+'/'+_0x4efee4)['json'](_0x315cc2);}return null;};}function patchUpdates(_0x24f41c){return function(_0x1d64ce){try{jsonpatch['apply'](_0x1d64ce,_0x24f41c,!![]);}catch(_0x243a65){return BPromise['reject'](_0x243a65);}return _0x1d64ce['save']();};}function saveUpdates(_0x41ea54,_0x30db2c){return function(_0x3d153b){if(_0x3d153b){return _0x3d153b[_0xc7f1('0x32')](_0x41ea54)[_0xc7f1('0x20')](function(_0xd47b51){return _0xd47b51;});}return null;};}function removeEntity(_0x42d153,_0x154d9d){return function(_0x294b70){if(_0x294b70){return _0x294b70[_0xc7f1('0x33')]()[_0xc7f1('0x20')](function(){var _0x17a64e=_0x294b70[_0xc7f1('0x34')]({'plain':!![]});var _0x43d902=_0xc7f1('0x35');return db[_0xc7f1('0x36')][_0xc7f1('0x33')]({'where':{'type':_0x43d902,'resourceId':_0x17a64e['id']}})['then'](function(){return _0x294b70;});})[_0xc7f1('0x20')](function(){_0x42d153['status'](0xcc)[_0xc7f1('0x2d')]();});}};}function handleEntityNotFound(_0x5510c4,_0x469090){return function(_0x51fe4d){if(!_0x51fe4d){_0x5510c4[_0xc7f1('0x2b')](0x194);}return _0x51fe4d;};}function handleError(_0x16c951,_0x10bdff){_0x10bdff=_0x10bdff||0x1f4;return function(_0x58ee87){logger[_0xc7f1('0x27')](_0x58ee87['stack']);if(_0x58ee87[_0xc7f1('0x37')]){delete _0x58ee87[_0xc7f1('0x37')];}_0x16c951['status'](_0x10bdff)['send'](_0x58ee87);};}exports[_0xc7f1('0x38')]=function(_0x37456e,_0xc5e466){var _0x324965={'include':[{'model':db[_0xc7f1('0x39')],'as':_0xc7f1('0x3a')},{'model':db[_0xc7f1('0x3b')],'as':'Smtp'},{'model':db[_0xc7f1('0x3c')],'as':'mandatoryDispositionPause'}]},_0x3b7ae4={},_0x4c2ec2={'count':0x0,'rows':[]};var _0x4acc53=_[_0xc7f1('0x3d')](db[_0xc7f1('0x3e')]['rawAttributes'],function(_0x3c8d0f){return{'name':_0x3c8d0f[_0xc7f1('0x3f')],'type':_0x3c8d0f['type'][_0xc7f1('0x40')]};});_0x3b7ae4['model']=_[_0xc7f1('0x3d')](_0x4acc53,_0xc7f1('0x37'));_0x3b7ae4['query']=_[_0xc7f1('0x41')](_0x37456e[_0xc7f1('0x42')]);_0x3b7ae4['filters']=_['intersection'](_0x3b7ae4[_0xc7f1('0x43')],_0x3b7ae4['query']);_0x324965[_0xc7f1('0x44')]=_[_0xc7f1('0x45')](_0x3b7ae4['model'],qs[_0xc7f1('0x46')](_0x37456e['query']['fields']));_0x324965[_0xc7f1('0x44')]=_0x324965[_0xc7f1('0x44')][_0xc7f1('0x47')]?_0x324965[_0xc7f1('0x44')]:_0x3b7ae4[_0xc7f1('0x43')];if(!_0x37456e[_0xc7f1('0x42')][_0xc7f1('0x48')](_0xc7f1('0x49'))){_0x324965[_0xc7f1('0x30')]=qs['limit'](_0x37456e[_0xc7f1('0x42')]['limit']);_0x324965['offset']=qs['offset'](_0x37456e[_0xc7f1('0x42')][_0xc7f1('0x2f')]);}_0x324965['order']=qs[_0xc7f1('0x4a')](_0x37456e[_0xc7f1('0x42')][_0xc7f1('0x4a')]);_0x324965[_0xc7f1('0x4b')]=qs[_0xc7f1('0x4c')](_[_0xc7f1('0x4d')](_0x37456e['query'],_0x3b7ae4['filters']));if(_0x37456e[_0xc7f1('0x42')][_0xc7f1('0x4e')]){_0x324965[_0xc7f1('0x4b')]=_[_0xc7f1('0x4f')](_0x324965[_0xc7f1('0x4b')],{'$or':_[_0xc7f1('0x3d')](_0x4acc53,function(_0x2d3368){if(_0x2d3368[_0xc7f1('0x50')]!==_0xc7f1('0x51')){var _0xf48b90={};_0xf48b90[_0x2d3368[_0xc7f1('0x37')]]={'$like':'%'+_0x37456e[_0xc7f1('0x42')]['filter']+'%'};return _0xf48b90;}})});}_0x324965=_[_0xc7f1('0x4f')]({},_0x324965,_0x37456e[_0xc7f1('0x52')]);var _0x5cb220={'where':_0x324965[_0xc7f1('0x4b')]};return db[_0xc7f1('0x3e')][_0xc7f1('0x53')](_0x5cb220)[_0xc7f1('0x20')](function(_0x5c413e){_0x4c2ec2['count']=_0x5c413e;if(_0x37456e[_0xc7f1('0x42')]['includeAll']){_0x324965[_0xc7f1('0x54')]=[{'all':!![]}];}return db[_0xc7f1('0x3e')][_0xc7f1('0x55')](_0x324965);})[_0xc7f1('0x20')](function(_0x46f5cf){_0x4c2ec2[_0xc7f1('0x56')]=_0x46f5cf;return _0x4c2ec2;})[_0xc7f1('0x20')](respondWithFilteredResult(_0xc5e466,_0x324965))[_0xc7f1('0x57')](handleError(_0xc5e466,null));};exports[_0xc7f1('0x58')]=function(_0x1219f8,_0xc25e17){var _0x218857={'raw':![],'where':{'id':_0x1219f8[_0xc7f1('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':_0xc7f1('0x3a')},{'model':db['MailServerOut'],'as':_0xc7f1('0x5a')},{'model':db[_0xc7f1('0x3c')],'as':_0xc7f1('0x5b')}]},_0xf050b3={};_0xf050b3[_0xc7f1('0x43')]=_['keys'](db[_0xc7f1('0x3e')][_0xc7f1('0x5c')]);_0xf050b3[_0xc7f1('0x42')]=_[_0xc7f1('0x41')](_0x1219f8[_0xc7f1('0x42')]);_0xf050b3[_0xc7f1('0x4c')]=_['intersection'](_0xf050b3[_0xc7f1('0x43')],_0xf050b3[_0xc7f1('0x42')]);_0x218857[_0xc7f1('0x44')]=_[_0xc7f1('0x45')](_0xf050b3[_0xc7f1('0x43')],qs[_0xc7f1('0x46')](_0x1219f8['query']['fields']));_0x218857[_0xc7f1('0x44')]=_0x218857['attributes'][_0xc7f1('0x47')]?_0x218857[_0xc7f1('0x44')]:_0xf050b3[_0xc7f1('0x43')];if(_0x1219f8['query'][_0xc7f1('0x5d')]){_0x218857['include']=[{'all':!![]}];}_0x218857=_[_0xc7f1('0x4f')]({},_0x218857,_0x1219f8[_0xc7f1('0x52')]);return db['MailAccount'][_0xc7f1('0x5e')](_0x218857)[_0xc7f1('0x20')](handleEntityNotFound(_0xc25e17,null))['then'](respondWithResult(_0xc25e17,null))[_0xc7f1('0x57')](handleError(_0xc25e17,null));};exports[_0xc7f1('0x32')]=function(_0x26b19b,_0x48ae73){if(_0x26b19b['body']['id']){delete _0x26b19b[_0xc7f1('0x5f')]['id'];}return db[_0xc7f1('0x3e')][_0xc7f1('0x5e')]({'where':{'id':_0x26b19b[_0xc7f1('0x59')]['id']},'include':[{'model':db[_0xc7f1('0x39')],'as':_0xc7f1('0x3a')},{'model':db['MailServerOut'],'as':_0xc7f1('0x5a')},{'model':db[_0xc7f1('0x3c')],'as':'mandatoryDispositionPause'}]})[_0xc7f1('0x20')](handleEntityNotFound(_0x48ae73,null))[_0xc7f1('0x20')](saveUpdates(_0x26b19b['body'],null))[_0xc7f1('0x20')](function(_0x188513){if(_0x188513&&_0x26b19b[_0xc7f1('0x5f')][_0xc7f1('0x3a')]){return db[_0xc7f1('0x39')][_0xc7f1('0x32')](_0x26b19b[_0xc7f1('0x5f')][_0xc7f1('0x3a')],{'where':{'MailAccountId':_0x188513['id']}})['then'](function(){return _0x188513;});}return _0x188513;})['then'](function(_0x5a8831){if(_0x5a8831&&_0x26b19b['body'][_0xc7f1('0x5a')]){return db['MailServerOut'][_0xc7f1('0x32')](_0x26b19b['body'][_0xc7f1('0x5a')],{'where':{'MailAccountId':_0x5a8831['id']}})[_0xc7f1('0x20')](function(){return _0x5a8831;});}return _0x5a8831;})['then'](respondWithResult(_0x48ae73,null))[_0xc7f1('0x57')](handleError(_0x48ae73,null));};exports[_0xc7f1('0x60')]=function(_0x4fc789,_0x28c9a9){return db[_0xc7f1('0x3e')][_0xc7f1('0x60')]()[_0xc7f1('0x20')](respondWithResult(_0x28c9a9,null))[_0xc7f1('0x57')](handleError(_0x28c9a9,null));};exports[_0xc7f1('0x61')]=function(_0x449a87,_0x343b80,_0x15a86f){if(_0x449a87[_0xc7f1('0x5f')]['id']){delete _0x449a87[_0xc7f1('0x5f')]['id'];}return db[_0xc7f1('0x3e')]['find']({'where':{'id':_0x449a87[_0xc7f1('0x59')]['id']}})['then'](handleEntityNotFound(_0x343b80,null))['then'](function(_0x580c38){if(_0x580c38){_0x449a87['body']['MailAccountId']=_0x580c38['id'];return db['Disposition']['create'](_0x449a87[_0xc7f1('0x5f')]);}})[_0xc7f1('0x20')](respondWithResult(_0x343b80,null))['catch'](handleError(_0x343b80,null));};exports['getDispositions']=function(_0x5c2ed1,_0x3da02a,_0x5d8f4a){var _0x2139e8={'raw':![],'where':{}};var _0x5972ad={};var _0x3b54a3={'count':0x0,'rows':[]};return db[_0xc7f1('0x3e')][_0xc7f1('0x62')]({'where':{'id':_0x5c2ed1[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x3da02a,null))[_0xc7f1('0x20')](function(_0xd03a9){if(_0xd03a9){_0x5972ad[_0xc7f1('0x43')]=_['keys'](db['Disposition'][_0xc7f1('0x5c')]);_0x5972ad[_0xc7f1('0x42')]=_[_0xc7f1('0x41')](_0x5c2ed1['query']);_0x5972ad[_0xc7f1('0x4c')]=_[_0xc7f1('0x45')](_0x5972ad[_0xc7f1('0x43')],_0x5972ad[_0xc7f1('0x42')]);_0x2139e8[_0xc7f1('0x44')]=_[_0xc7f1('0x45')](_0x5972ad['model'],qs[_0xc7f1('0x46')](_0x5c2ed1[_0xc7f1('0x42')][_0xc7f1('0x46')]));_0x2139e8[_0xc7f1('0x44')]=_0x2139e8[_0xc7f1('0x44')][_0xc7f1('0x47')]?_0x2139e8[_0xc7f1('0x44')]:_0x5972ad['model'];if(!_0x5c2ed1[_0xc7f1('0x42')][_0xc7f1('0x48')](_0xc7f1('0x49'))){_0x2139e8[_0xc7f1('0x30')]=qs[_0xc7f1('0x30')](_0x5c2ed1['query'][_0xc7f1('0x30')]);_0x2139e8[_0xc7f1('0x2f')]=qs['offset'](_0x5c2ed1[_0xc7f1('0x42')][_0xc7f1('0x2f')]);}_0x2139e8[_0xc7f1('0x63')]=qs[_0xc7f1('0x4a')](_0x5c2ed1[_0xc7f1('0x42')][_0xc7f1('0x4a')]);_0x2139e8[_0xc7f1('0x4b')]=qs[_0xc7f1('0x4c')](_[_0xc7f1('0x4d')](_0x5c2ed1[_0xc7f1('0x42')],_0x5972ad['filters']));_0x2139e8[_0xc7f1('0x4b')][_0xc7f1('0x64')]=_0xd03a9['id'];if(_0x5c2ed1['query']['filter']){_0x2139e8[_0xc7f1('0x4b')]=_[_0xc7f1('0x4f')](_0x2139e8[_0xc7f1('0x4b')],{'$or':_[_0xc7f1('0x3d')](_0x2139e8['attributes'],function(_0x1984ac){var _0x4c6511={};_0x4c6511[_0x1984ac]={'$like':'%'+_0x5c2ed1[_0xc7f1('0x42')][_0xc7f1('0x4e')]+'%'};return _0x4c6511;})});}_0x2139e8=_[_0xc7f1('0x4f')]({},_0x2139e8,_0x5c2ed1[_0xc7f1('0x52')]);return db[_0xc7f1('0x65')][_0xc7f1('0x53')]({'where':_0x2139e8[_0xc7f1('0x4b')]})[_0xc7f1('0x20')](function(_0x469dae){_0x3b54a3[_0xc7f1('0x53')]=_0x469dae;if(_0x5c2ed1[_0xc7f1('0x42')][_0xc7f1('0x5d')]){_0x2139e8['include']=[{'all':!![]}];}return db['Disposition'][_0xc7f1('0x55')](_0x2139e8);})[_0xc7f1('0x20')](function(_0x2f67fe){_0x3b54a3[_0xc7f1('0x56')]=_0x2f67fe;return _0x3b54a3;});}})[_0xc7f1('0x20')](respondWithFilteredResult(_0x3da02a,_0x2139e8))['catch'](handleError(_0x3da02a,null));};exports[_0xc7f1('0x66')]=function(_0x18083e,_0x58f7fc,_0x514959){return db['MailAccount']['find']({'where':{'id':_0x18083e[_0xc7f1('0x59')]['id']}})['then'](handleEntityNotFound(_0x58f7fc,null))['then'](function(_0x401706){if(_0x401706){return _0x401706['removeDispositions'](_0x18083e[_0xc7f1('0x42')][_0xc7f1('0x67')]);}})[_0xc7f1('0x20')](respondWithStatusCode(_0x58f7fc,null))[_0xc7f1('0x57')](handleError(_0x58f7fc,null));};exports[_0xc7f1('0x68')]=function(_0x2132c1,_0x248c56,_0x2056ee){if(_0x2132c1[_0xc7f1('0x5f')]['id']){delete _0x2132c1[_0xc7f1('0x5f')]['id'];}return db[_0xc7f1('0x3e')]['find']({'where':{'id':_0x2132c1['params']['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x248c56,null))['then'](function(_0x232e7c){if(_0x232e7c){_0x2132c1[_0xc7f1('0x5f')][_0xc7f1('0x64')]=_0x232e7c['id'];return db[_0xc7f1('0x69')]['create'](_0x2132c1['body']);}})[_0xc7f1('0x20')](respondWithResult(_0x248c56,null))[_0xc7f1('0x57')](handleError(_0x248c56,null));};exports[_0xc7f1('0x6a')]=function(_0xac62ff,_0x2128b0,_0x2a6c9a){var _0x1e8167={'raw':![],'where':{}};var _0x136a7e={};var _0x2a85bd={'count':0x0,'rows':[]};return db[_0xc7f1('0x3e')]['findOne']({'where':{'id':_0xac62ff[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x2128b0,null))[_0xc7f1('0x20')](function(_0x499aa5){if(_0x499aa5){_0x136a7e[_0xc7f1('0x43')]=_['keys'](db[_0xc7f1('0x69')]['rawAttributes']);_0x136a7e[_0xc7f1('0x42')]=_[_0xc7f1('0x41')](_0xac62ff[_0xc7f1('0x42')]);_0x136a7e['filters']=_['intersection'](_0x136a7e[_0xc7f1('0x43')],_0x136a7e[_0xc7f1('0x42')]);_0x1e8167['attributes']=_[_0xc7f1('0x45')](_0x136a7e[_0xc7f1('0x43')],qs[_0xc7f1('0x46')](_0xac62ff[_0xc7f1('0x42')][_0xc7f1('0x46')]));_0x1e8167[_0xc7f1('0x44')]=_0x1e8167[_0xc7f1('0x44')][_0xc7f1('0x47')]?_0x1e8167['attributes']:_0x136a7e[_0xc7f1('0x43')];if(!_0xac62ff['query'][_0xc7f1('0x48')]('nolimit')){_0x1e8167[_0xc7f1('0x30')]=qs['limit'](_0xac62ff[_0xc7f1('0x42')][_0xc7f1('0x30')]);_0x1e8167['offset']=qs[_0xc7f1('0x2f')](_0xac62ff[_0xc7f1('0x42')][_0xc7f1('0x2f')]);}_0x1e8167[_0xc7f1('0x63')]=qs[_0xc7f1('0x4a')](_0xac62ff['query'][_0xc7f1('0x4a')]);_0x1e8167[_0xc7f1('0x4b')]=qs[_0xc7f1('0x4c')](_[_0xc7f1('0x4d')](_0xac62ff[_0xc7f1('0x42')],_0x136a7e[_0xc7f1('0x4c')]));_0x1e8167[_0xc7f1('0x4b')][_0xc7f1('0x64')]=_0x499aa5['id'];if(_0xac62ff[_0xc7f1('0x42')][_0xc7f1('0x4e')]){_0x1e8167['where']=_['merge'](_0x1e8167['where'],{'$or':_['map'](_0x1e8167['attributes'],function(_0x467194){var _0x80b031={};_0x80b031[_0x467194]={'$like':'%'+_0xac62ff[_0xc7f1('0x42')][_0xc7f1('0x4e')]+'%'};return _0x80b031;})});}_0x1e8167=_['merge']({},_0x1e8167,_0xac62ff[_0xc7f1('0x52')]);return db['CannedAnswer']['count']({'where':_0x1e8167[_0xc7f1('0x4b')]})[_0xc7f1('0x20')](function(_0x3fde50){_0x2a85bd[_0xc7f1('0x53')]=_0x3fde50;if(_0xac62ff[_0xc7f1('0x42')][_0xc7f1('0x5d')]){_0x1e8167['include']=[{'all':!![]}];}return db['CannedAnswer'][_0xc7f1('0x55')](_0x1e8167);})['then'](function(_0x4119d2){_0x2a85bd[_0xc7f1('0x56')]=_0x4119d2;return _0x2a85bd;});}})[_0xc7f1('0x20')](respondWithFilteredResult(_0x2128b0,_0x1e8167))[_0xc7f1('0x57')](handleError(_0x2128b0,null));};exports[_0xc7f1('0x6b')]=function(_0x4f73a4,_0x3790b5,_0x5a1643){return db[_0xc7f1('0x3e')]['find']({'where':{'id':_0x4f73a4[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x3790b5,null))[_0xc7f1('0x20')](function(_0x507440){if(_0x507440){return _0x507440['removeAnswers'](_0x4f73a4[_0xc7f1('0x42')][_0xc7f1('0x67')]);}})['then'](respondWithStatusCode(_0x3790b5,null))['catch'](handleError(_0x3790b5,null));};exports[_0xc7f1('0x6c')]=function(_0xa91e8e,_0x51cfa2){var _0x4ab5b5={'name':_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x37')],'key':_0xa91e8e['body'][_0xc7f1('0x40')],'email':_0xa91e8e['body'][_0xc7f1('0x6d')],'ListId':_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x6e')],'active':!_['isNil'](_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x6f')])?_0xa91e8e['body'][_0xc7f1('0x6f')]:!![],'description':_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x70')]||null,'Imap':{},'Smtp':{}};if(_['isNil'](_0xa91e8e['body'][_0xc7f1('0x71')])){if(_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x72')]){_0x4ab5b5[_0xc7f1('0x3a')]['user']=_0x4ab5b5[_0xc7f1('0x5a')]['user']=_0xa91e8e['body'][_0xc7f1('0x73')];_0x4ab5b5[_0xc7f1('0x3a')][_0xc7f1('0x74')]=_0x4ab5b5[_0xc7f1('0x5a')][_0xc7f1('0x75')]=_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x76')];}else{_0x4ab5b5[_0xc7f1('0x3a')][_0xc7f1('0x77')]=_0x4ab5b5[_0xc7f1('0x5a')]['authentication']=![];}_0x4ab5b5[_0xc7f1('0x3a')][_0xc7f1('0x78')]=_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x3a')]['host'];_0x4ab5b5[_0xc7f1('0x3a')][_0xc7f1('0x79')]=_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x3a')][_0xc7f1('0x79')];_0x4ab5b5[_0xc7f1('0x5a')][_0xc7f1('0x78')]=_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x5a')][_0xc7f1('0x78')];_0x4ab5b5[_0xc7f1('0x5a')]['port']=_0xa91e8e[_0xc7f1('0x5f')]['Smtp'][_0xc7f1('0x79')];}else{_0x4ab5b5['Imap'][_0xc7f1('0x7a')]=_0x4ab5b5['Smtp']['service']=_0xa91e8e['body'][_0xc7f1('0x71')];_0x4ab5b5[_0xc7f1('0x3a')]['user']=_0x4ab5b5['Smtp'][_0xc7f1('0x7b')]=_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x73')];_0x4ab5b5[_0xc7f1('0x3a')][_0xc7f1('0x74')]=_0x4ab5b5[_0xc7f1('0x5a')][_0xc7f1('0x75')]=_0xa91e8e[_0xc7f1('0x5f')][_0xc7f1('0x76')];}return db[_0xc7f1('0x3e')][_0xc7f1('0x6c')](_0x4ab5b5,{'include':[{'model':db['MailServerOut'],'as':_0xc7f1('0x5a')},{'model':db['MailServerIn'],'as':'Imap'}]})[_0xc7f1('0x20')](function(_0x1e77ef){var _0x1ed101=_0xa91e8e[_0xc7f1('0x7b')][_0xc7f1('0x34')]({'plain':!![]});if(!_0x1ed101)throw new Error(_0xc7f1('0x7c'));if(_0x1ed101[_0xc7f1('0x7d')]===_0xc7f1('0x7b')){var _0x8e0b2b=_0x1e77ef[_0xc7f1('0x34')]({'plain':!![]});return db[_0xc7f1('0x7e')][_0xc7f1('0x5e')]({'where':{'name':_0xc7f1('0x35'),'userProfileId':_0x1ed101['userProfileId']},'raw':!![]})[_0xc7f1('0x20')](function(_0x555aa2){if(_0x555aa2&&_0x555aa2[_0xc7f1('0x7f')]===0x0){return db[_0xc7f1('0x36')][_0xc7f1('0x6c')]({'name':_0x8e0b2b[_0xc7f1('0x37')],'resourceId':_0x8e0b2b['id'],'type':_0x555aa2['name'],'sectionId':_0x555aa2['id']},{})[_0xc7f1('0x20')](function(){return _0x1e77ef;});}else{return _0x1e77ef;}})['catch'](function(_0x54aa30){logger[_0xc7f1('0x27')](_0xc7f1('0x80'),_0x54aa30);throw _0x54aa30;});}return _0x1e77ef;})[_0xc7f1('0x20')](respondWithResult(_0x51cfa2,0xc9))[_0xc7f1('0x57')](handleError(_0x51cfa2,null));};exports[_0xc7f1('0x81')]=function(_0xe448a2,_0x16c109,_0x2fbaff){return db[_0xc7f1('0x3e')][_0xc7f1('0x62')]({'where':{'id':_0xe448a2[_0xc7f1('0x59')]['id']}})['then'](handleEntityNotFound(_0x16c109,null))[_0xc7f1('0x20')](function(_0x343b42){if(_0x343b42){return _0x343b42[_0xc7f1('0x81')]();}return null;})[_0xc7f1('0x20')](respondWithResult(_0x16c109,null))[_0xc7f1('0x57')](handleError(_0x16c109,null));};exports[_0xc7f1('0x82')]=function(_0x19ec4d,_0x5457ee,_0x4c1ad4){if(_0x19ec4d['body']['id']){delete _0x19ec4d[_0xc7f1('0x5f')]['id'];}return db[_0xc7f1('0x3e')][_0xc7f1('0x5e')]({'where':{'id':_0x19ec4d[_0xc7f1('0x59')]['id']}})['then'](handleEntityNotFound(_0x5457ee,null))[_0xc7f1('0x20')](function(_0x47b2f6){if(_0x47b2f6){_0x19ec4d[_0xc7f1('0x5f')][_0xc7f1('0x64')]=_0x47b2f6['id'];return db[_0xc7f1('0x39')][_0xc7f1('0x6c')](_0x19ec4d[_0xc7f1('0x5f')]);}})[_0xc7f1('0x20')](respondWithResult(_0x5457ee,null))[_0xc7f1('0x57')](handleError(_0x5457ee,null));};exports[_0xc7f1('0x83')]=function(_0x172caa,_0x459777,_0x372998){return db[_0xc7f1('0x3e')][_0xc7f1('0x62')]({'where':{'id':_0x172caa[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x459777,null))[_0xc7f1('0x20')](function(_0x91b60a){if(_0x91b60a){return _0x91b60a[_0xc7f1('0x84')](null);}return null;})['then'](respondWithStatusCode(_0x459777,null))[_0xc7f1('0x57')](handleError(_0x459777,null));};exports[_0xc7f1('0x85')]=function(_0x3a8629,_0xc6ad3b,_0x6bdca2){return db[_0xc7f1('0x3e')][_0xc7f1('0x62')]({'where':{'id':_0x3a8629['params']['id']}})['then'](handleEntityNotFound(_0xc6ad3b,null))[_0xc7f1('0x20')](function(_0x46c28d){if(_0x46c28d){return _0x46c28d[_0xc7f1('0x85')]();}return null;})[_0xc7f1('0x20')](respondWithResult(_0xc6ad3b,null))[_0xc7f1('0x57')](handleError(_0xc6ad3b,null));};exports['addSmtp']=function(_0x47e349,_0x10a1f0,_0x9de1fe){if(_0x47e349['body']['id']){delete _0x47e349[_0xc7f1('0x5f')]['id'];}return db['MailAccount']['find']({'where':{'id':_0x47e349[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x10a1f0,null))[_0xc7f1('0x20')](function(_0x42a1ee){if(_0x42a1ee){_0x47e349[_0xc7f1('0x5f')]['MailAccountId']=_0x42a1ee['id'];return db['MailServerOut'][_0xc7f1('0x6c')](_0x47e349[_0xc7f1('0x5f')]);}})[_0xc7f1('0x20')](respondWithResult(_0x10a1f0,null))[_0xc7f1('0x57')](handleError(_0x10a1f0,null));};exports['removeSmtp']=function(_0x2629c7,_0x38290a,_0x5664e1){return db['MailAccount']['findOne']({'where':{'id':_0x2629c7['params']['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x38290a,null))['then'](function(_0x3921c5){if(_0x3921c5){return _0x3921c5[_0xc7f1('0x86')](null);}return null;})[_0xc7f1('0x20')](respondWithStatusCode(_0x38290a,null))[_0xc7f1('0x57')](handleError(_0x38290a,null));};exports['addInteraction']=function(_0x154b63,_0x439c32,_0x40c39d){return db[_0xc7f1('0x87')][_0xc7f1('0x5e')]({'where':{'id':_0x154b63[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x439c32,null))[_0xc7f1('0x20')](function(_0x1954ef){if(_0x1954ef){return _0x1954ef['addInteraction'](_0x154b63[_0xc7f1('0x5f')][_0xc7f1('0x67')],_[_0xc7f1('0x88')](_0x154b63[_0xc7f1('0x5f')],[_0xc7f1('0x67'),'id'])||{});}})[_0xc7f1('0x20')](respondWithResult(_0x439c32,null))['catch'](handleError(_0x439c32,null));};exports[_0xc7f1('0x89')]=function(_0xdf814f,_0xf5fa60,_0x7244a1){var _0x5dc371={'raw':![],'where':{}};var _0xbeded2={};var _0x10e4fe={'count':0x0,'rows':[]};return db[_0xc7f1('0x3e')][_0xc7f1('0x62')]({'where':{'id':_0xdf814f[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0xf5fa60,null))[_0xc7f1('0x20')](function(_0x32402c){if(_0x32402c){_0xbeded2[_0xc7f1('0x43')]=_[_0xc7f1('0x41')](db[_0xc7f1('0x87')][_0xc7f1('0x5c')]);_0xbeded2[_0xc7f1('0x42')]=_[_0xc7f1('0x41')](_0xdf814f[_0xc7f1('0x42')]);_0xbeded2['filters']=_['intersection'](_0xbeded2[_0xc7f1('0x43')],_0xbeded2[_0xc7f1('0x42')]);_0x5dc371[_0xc7f1('0x44')]=_[_0xc7f1('0x45')](_0xbeded2['model'],qs[_0xc7f1('0x46')](_0xdf814f[_0xc7f1('0x42')][_0xc7f1('0x46')]));_0x5dc371[_0xc7f1('0x44')]=_0x5dc371['attributes']['length']?_0x5dc371[_0xc7f1('0x44')]:_0xbeded2[_0xc7f1('0x43')];if(!_0xdf814f[_0xc7f1('0x42')]['hasOwnProperty'](_0xc7f1('0x49'))){_0x5dc371[_0xc7f1('0x30')]=qs[_0xc7f1('0x30')](_0xdf814f[_0xc7f1('0x42')]['limit']);_0x5dc371[_0xc7f1('0x2f')]=qs['offset'](_0xdf814f['query'][_0xc7f1('0x2f')]);}_0x5dc371[_0xc7f1('0x63')]=qs[_0xc7f1('0x4a')](_0xdf814f[_0xc7f1('0x42')][_0xc7f1('0x4a')]);_0x5dc371[_0xc7f1('0x4b')]=qs['filters'](_['pick'](_0xdf814f[_0xc7f1('0x42')],_0xbeded2['filters']));_0x5dc371[_0xc7f1('0x4b')][_0xc7f1('0x64')]=_0x32402c['id'];if(_0xdf814f[_0xc7f1('0x42')][_0xc7f1('0x4e')]){_0x5dc371[_0xc7f1('0x4b')]=_[_0xc7f1('0x4f')](_0x5dc371[_0xc7f1('0x4b')],{'$or':_[_0xc7f1('0x3d')](_0x5dc371[_0xc7f1('0x44')],function(_0x113b8c){var _0x29fafa={};_0x29fafa[_0x113b8c]={'$like':'%'+_0xdf814f[_0xc7f1('0x42')]['filter']+'%'};return _0x29fafa;})});}_0x5dc371=_[_0xc7f1('0x4f')]({},_0x5dc371,_0xdf814f[_0xc7f1('0x52')]);return db[_0xc7f1('0x87')][_0xc7f1('0x53')]({'where':_0x5dc371[_0xc7f1('0x4b')]})[_0xc7f1('0x20')](function(_0x23bd53){_0x10e4fe[_0xc7f1('0x53')]=_0x23bd53;if(_0xdf814f[_0xc7f1('0x42')][_0xc7f1('0x5d')]){_0x5dc371['include']=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xc7f1('0x8a')],'as':_0xc7f1('0x8b'),'attributes':['name','fullname',_0xc7f1('0x8c')],'required':![]},{'model':db[_0xc7f1('0x8d')],'as':_0xc7f1('0x8e'),'attributes':['id','name',_0xc7f1('0x8f')],'where':_0xdf814f[_0xc7f1('0x42')]['tag']?{'id':_0xdf814f[_0xc7f1('0x42')]['tag']}:undefined,'required':_0xdf814f['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0xc7f1('0x55')](_0x5dc371);})[_0xc7f1('0x20')](function(_0x43c72a){_0x10e4fe['rows']=_0x43c72a;return _0x10e4fe;});}})[_0xc7f1('0x20')](respondWithFilteredResult(_0xf5fa60,_0x5dc371))[_0xc7f1('0x57')](handleError(_0xf5fa60,null));};exports['addApplications']=function(_0xd58bca,_0x6a2108,_0x2ebbd0){return db[_0xc7f1('0x3e')][_0xc7f1('0x62')]({'where':{'id':_0xd58bca[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x6a2108,null))[_0xc7f1('0x20')](function(_0x31a242){if(_0x31a242){return db[_0xc7f1('0x90')][_0xc7f1('0x91')](function(_0x3af7b8){return db[_0xc7f1('0x92')][_0xc7f1('0x33')]({'where':{'MailAccountId':_0xd58bca['params']['id']},'transaction':_0x3af7b8})[_0xc7f1('0x20')](function(_0x3314fd){var _0x4da8af=_[_0xc7f1('0x3d')](_0xd58bca[_0xc7f1('0x5f')],function(_0x1f7826){_0x1f7826['MailAccountId']=_0xd58bca[_0xc7f1('0x59')]['id'];return _0x1f7826;});return db[_0xc7f1('0x92')][_0xc7f1('0x93')](_0x4da8af,{'transaction':_0x3af7b8});});})[_0xc7f1('0x20')](function(){return db[_0xc7f1('0x92')][_0xc7f1('0x94')]({'where':{'MailAccountId':_0xd58bca[_0xc7f1('0x59')]['id']},'order':'priority'});});}})[_0xc7f1('0x20')](respondWithResult(_0x6a2108,null))[_0xc7f1('0x57')](handleError(_0x6a2108,null));};exports[_0xc7f1('0x95')]=function(_0x98496c,_0x2d3f5b,_0x2397fb){var _0x2cf67c={};var _0x14c176={};var _0x224379;var _0xcb98d3;return db[_0xc7f1('0x3e')][_0xc7f1('0x62')]({'where':{'id':_0x98496c[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x2d3f5b,null))[_0xc7f1('0x20')](function(_0x1bc247){if(_0x1bc247){_0x224379=_0x1bc247;_0x14c176[_0xc7f1('0x43')]=_[_0xc7f1('0x41')](db[_0xc7f1('0x92')][_0xc7f1('0x5c')]);_0x14c176['query']=_[_0xc7f1('0x41')](_0x98496c[_0xc7f1('0x42')]);_0x14c176['filters']=_['intersection'](_0x14c176[_0xc7f1('0x43')],_0x14c176[_0xc7f1('0x42')]);_0x2cf67c['attributes']=_[_0xc7f1('0x45')](_0x14c176[_0xc7f1('0x43')],qs[_0xc7f1('0x46')](_0x98496c[_0xc7f1('0x42')][_0xc7f1('0x46')]));_0x2cf67c[_0xc7f1('0x44')]=_0x2cf67c[_0xc7f1('0x44')][_0xc7f1('0x47')]?_0x2cf67c[_0xc7f1('0x44')]:_0x14c176[_0xc7f1('0x43')];_0x2cf67c['order']=qs['sort'](_0x98496c['query'][_0xc7f1('0x4a')]);_0x2cf67c[_0xc7f1('0x4b')]=qs['filters'](_['pick'](_0x98496c[_0xc7f1('0x42')],_0x14c176[_0xc7f1('0x4c')]));if(_0x98496c[_0xc7f1('0x42')]['filter']){_0x2cf67c[_0xc7f1('0x4b')]=_[_0xc7f1('0x4f')](_0x2cf67c[_0xc7f1('0x4b')],{'$or':_[_0xc7f1('0x3d')](_0x2cf67c['attributes'],function(_0x38c09f){var _0x5c9280={};_0x5c9280[_0x38c09f]={'$like':'%'+_0x98496c[_0xc7f1('0x42')]['filter']+'%'};return _0x5c9280;})});}_0x2cf67c=_[_0xc7f1('0x4f')]({},_0x2cf67c,_0x98496c[_0xc7f1('0x52')]);return _0x224379[_0xc7f1('0x95')](_0x2cf67c);}})['then'](function(_0x21e47d){if(_0x21e47d){_0xcb98d3=_0x21e47d[_0xc7f1('0x47')];if(!_0x98496c[_0xc7f1('0x42')][_0xc7f1('0x48')]('nolimit')){_0x2cf67c[_0xc7f1('0x30')]=qs[_0xc7f1('0x30')](_0x98496c[_0xc7f1('0x42')]['limit']);_0x2cf67c[_0xc7f1('0x2f')]=qs[_0xc7f1('0x2f')](_0x98496c[_0xc7f1('0x42')][_0xc7f1('0x2f')]);}return _0x224379[_0xc7f1('0x95')](_0x2cf67c);}})[_0xc7f1('0x20')](function(_0x4a10e0){if(_0x4a10e0){return _0x4a10e0?{'count':_0xcb98d3,'rows':_0x4a10e0}:null;}})[_0xc7f1('0x20')](respondWithResult(_0x2d3f5b,null))[_0xc7f1('0x57')](handleError(_0x2d3f5b,null));};exports[_0xc7f1('0x96')]=function(_0x1ee6dd,_0x4ee1dc,_0x1d90d5){var _0x4fd7ac={'raw':!![],'where':{}};var _0x1837aa={};var _0x449235={'count':0x0,'rows':[]};return db['MailAccount'][_0xc7f1('0x62')]({'where':{'id':_0x1ee6dd[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x4ee1dc,null))[_0xc7f1('0x20')](function(_0x4c185b){if(_0x4c185b){_0x1837aa[_0xc7f1('0x43')]=_[_0xc7f1('0x41')](db[_0xc7f1('0x97')][_0xc7f1('0x5c')]);_0x1837aa[_0xc7f1('0x42')]=_[_0xc7f1('0x41')](_0x1ee6dd[_0xc7f1('0x42')]);_0x1837aa['filters']=_[_0xc7f1('0x45')](_0x1837aa['model'],_0x1837aa[_0xc7f1('0x42')]);_0x4fd7ac['attributes']=_[_0xc7f1('0x45')](_0x1837aa[_0xc7f1('0x43')],qs['fields'](_0x1ee6dd['query']['fields']));_0x4fd7ac[_0xc7f1('0x44')]=_0x4fd7ac[_0xc7f1('0x44')][_0xc7f1('0x47')]?_0x4fd7ac[_0xc7f1('0x44')]:_0x1837aa[_0xc7f1('0x43')];if(!_0x1ee6dd[_0xc7f1('0x42')][_0xc7f1('0x48')]('nolimit')){_0x4fd7ac[_0xc7f1('0x30')]=qs[_0xc7f1('0x30')](_0x1ee6dd[_0xc7f1('0x42')][_0xc7f1('0x30')]);_0x4fd7ac[_0xc7f1('0x2f')]=qs[_0xc7f1('0x2f')](_0x1ee6dd[_0xc7f1('0x42')][_0xc7f1('0x2f')]);}_0x4fd7ac[_0xc7f1('0x63')]=qs[_0xc7f1('0x4a')](_0x1ee6dd[_0xc7f1('0x42')]['sort']);_0x4fd7ac[_0xc7f1('0x4b')]=qs['filters'](_[_0xc7f1('0x4d')](_0x1ee6dd[_0xc7f1('0x42')],_0x1837aa[_0xc7f1('0x4c')]));_0x4fd7ac[_0xc7f1('0x4b')][_0xc7f1('0x64')]=_0x4c185b['id'];if(_0x1ee6dd[_0xc7f1('0x42')][_0xc7f1('0x4e')]){_0x4fd7ac[_0xc7f1('0x4b')]=_['merge'](_0x4fd7ac[_0xc7f1('0x4b')],{'$or':_[_0xc7f1('0x3d')](_0x4fd7ac[_0xc7f1('0x44')],function(_0x5bccdc){var _0x26ec96={};_0x26ec96[_0x5bccdc]={'$like':'%'+_0x1ee6dd[_0xc7f1('0x42')][_0xc7f1('0x4e')]+'%'};return _0x26ec96;})});}if(_0x1ee6dd[_0xc7f1('0x42')][_0xc7f1('0x98')]){var _0xc40ed5=_0x1ee6dd[_0xc7f1('0x42')][_0xc7f1('0x98')][_0xc7f1('0x99')](',');var _0x57b568={};_0x57b568[_0xc40ed5[0x0]]={'$gte':moment(_0xc40ed5[0x1])[_0xc7f1('0x9a')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4fd7ac[_0xc7f1('0x4b')]=_[_0xc7f1('0x4f')](_0x4fd7ac[_0xc7f1('0x4b')],_0x57b568);}_0x4fd7ac=_[_0xc7f1('0x4f')]({},_0x4fd7ac,_0x1ee6dd['options']);return db[_0xc7f1('0x97')][_0xc7f1('0x53')]({'where':_0x4fd7ac[_0xc7f1('0x4b')]})[_0xc7f1('0x20')](function(_0x55aff7){_0x449235[_0xc7f1('0x53')]=_0x55aff7;if(_0x1ee6dd[_0xc7f1('0x42')][_0xc7f1('0x5d')]){_0x4fd7ac[_0xc7f1('0x54')]=[{'all':!![]}];}return db[_0xc7f1('0x97')][_0xc7f1('0x55')](_0x4fd7ac);})['then'](function(_0x2eaf24){_0x449235['rows']=_0x2eaf24;return _0x449235;});}})[_0xc7f1('0x20')](respondWithFilteredResult(_0x4ee1dc,_0x4fd7ac))[_0xc7f1('0x57')](handleError(_0x4ee1dc,null));};exports['send']=function(_0x2b8177,_0x50e0cc,_0x3ce114){var _0x222276,_0x312699={},_0x171bcb;if(_0x2b8177[_0xc7f1('0x5f')]['to']){_0x171bcb=_0x2b8177[_0xc7f1('0x5f')]['to'][_0xc7f1('0x99')](',')[0x0];}return db[_0xc7f1('0x3e')][_0xc7f1('0x5e')]({'where':{'id':_0x2b8177[_0xc7f1('0x59')]['id']},'include':[{'model':db[_0xc7f1('0x9b')],'as':_0xc7f1('0x9c'),'include':[{'model':db['CmContact'],'as':'Contacts','where':{'email':_0x171bcb},'limit':0x1,'order':[[_0xc7f1('0x9d'),_0xc7f1('0x9e')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0xc7f1('0x20')](handleEntityNotFound(_0x50e0cc,null))[_0xc7f1('0x20')](function(_0x59ce78){if(_0x59ce78){_0x222276=_0x59ce78;if(_0x59ce78[_0xc7f1('0x5a')]){if(_[_0xc7f1('0x9f')](_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0xa0')])){_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0xa0')]=util[_0xc7f1('0x9a')](_0xc7f1('0xa1'),_0x59ce78['name'],_0x59ce78[_0xc7f1('0x6d')]||_0x59ce78[_0xc7f1('0x5a')][_0xc7f1('0x7b')]);}if(_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0xa2')]&&_0x2b8177['body'][_0xc7f1('0xa2')][_0xc7f1('0x47')]){for(var _0x48affd=0x0;_0x48affd<_0x2b8177[_0xc7f1('0x5f')]['attachments']['length'];_0x48affd+=0x1){_0x2b8177[_0xc7f1('0x5f')]['attachments'][_0x48affd]={'filename':_0x2b8177['body'][_0xc7f1('0xa2')][_0x48affd][_0xc7f1('0x37')],'path':path['join'](config[_0xc7f1('0xa3')],_0xc7f1('0xa4'),_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0xa2')][_0x48affd]['basename'])};}}var _0x4902da={'tls':{'rejectUnauthorized':![]}};if(_[_0xc7f1('0x9f')](_0x59ce78[_0xc7f1('0x5a')]['service'])){if(_0x59ce78[_0xc7f1('0x5a')]['authentication']){_0x4902da['auth']={'user':_0x59ce78[_0xc7f1('0x5a')][_0xc7f1('0x7b')],'pass':_0x59ce78[_0xc7f1('0x5a')][_0xc7f1('0x75')]};}_0x4902da['host']=_0x59ce78[_0xc7f1('0x5a')][_0xc7f1('0x78')];_0x4902da[_0xc7f1('0x79')]=_0x59ce78[_0xc7f1('0x5a')][_0xc7f1('0x79')];_0x4902da[_0xc7f1('0xa5')]=_0x59ce78[_0xc7f1('0x5a')]['secure'];}else{_0x4902da['service']=_0x59ce78[_0xc7f1('0x5a')][_0xc7f1('0x7a')];_0x4902da[_0xc7f1('0xa6')]={'user':_0x59ce78[_0xc7f1('0x5a')][_0xc7f1('0x7b')],'pass':_0x59ce78[_0xc7f1('0x5a')][_0xc7f1('0x75')]};}return respondWithRpcPromise(_0xc7f1('0xa7'),'sendMail',{'account':_0x4902da,'message':_0x2b8177[_0xc7f1('0x5f')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x5a9c23){if(_0x5a9c23){_0x312699=_0x5a9c23;if(_0x222276[_0xc7f1('0x9c')]){if(_0x222276[_0xc7f1('0x9c')][_0xc7f1('0xa8')]['length']){return _0x222276['List'][_0xc7f1('0xa8')][0x0];}else{return db[_0xc7f1('0xa9')]['create'](_[_0xc7f1('0x16')](_0x2b8177[_0xc7f1('0x5f')],{'firstName':_0x2b8177[_0xc7f1('0x5f')]['to'],'email':_0x2b8177['body']['to'],'phone':_0x2b8177[_0xc7f1('0x5f')]['to'],'ListId':_0x222276[_0xc7f1('0x6e')]}));}}else{throw new Error('List\x20not\x20found');}}})[_0xc7f1('0x20')](function(_0x450d31){if(_0x450d31){var _0x425e2c={'UserId':_0x2b8177['user']['id'],'ContactId':_0x450d31['id'],'MailAccountId':_0x222276['id'],'inReplyTo':_0x312699[_0xc7f1('0xaa')],'to':_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0xa0')],'cc':_0x2b8177[_0xc7f1('0x5f')]['cc'],'subject':_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0xab')],'attach':_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0xac')],'firstMsgDirection':_0xc7f1('0xad'),'lastMsgAt':moment()[_0xc7f1('0x9a')](_0xc7f1('0xae')),'lastMsgDirection':_0xc7f1('0xad'),'lastMsgBody':_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0x5f')],'Messages':[_['merge'](_0x2b8177[_0xc7f1('0x5f')],{'messageId':_0x312699['messageId'],'sentAt':moment()[_0xc7f1('0x9a')](_0xc7f1('0xae')),'read':!![],'MailAccountId':_0x222276['id'],'UserId':_0x2b8177['user']['id'],'ContactId':_0x450d31['id']})]};if(_0x2b8177[_0xc7f1('0x5f')][_0xc7f1('0xaf')]){_0x425e2c=_[_0xc7f1('0x4f')](_0x425e2c,_0x2b8177['body'][_0xc7f1('0xaf')]);}return db['MailInteraction'][_0xc7f1('0x6c')](_0x425e2c,{'include':[{'model':db[_0xc7f1('0x97')],'as':'Messages'}]});}})[_0xc7f1('0x20')](respondWithResult(_0x50e0cc,null))[_0xc7f1('0x57')](handleError(_0x50e0cc,null));};exports[_0xc7f1('0xb0')]=function(_0x37a814,_0x4858ce,_0x4a4aa9){return db[_0xc7f1('0x3e')][_0xc7f1('0x5e')]({'where':{'id':_0x37a814[_0xc7f1('0x59')]['id']},'include':[{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x4858ce,null))[_0xc7f1('0x20')](function(_0x3cd72b){if(_0x3cd72b&&_0x3cd72b[_0xc7f1('0x5a')]){var _0x32da61={'id':_0x3cd72b['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3cd72b[_0xc7f1('0x5a')]['service']){_0x32da61[_0xc7f1('0x7a')]=_0x3cd72b[_0xc7f1('0x5a')][_0xc7f1('0x7a')];}else{_0x32da61['host']=_0x3cd72b[_0xc7f1('0x5a')]['host'];_0x32da61[_0xc7f1('0x79')]=_0x3cd72b[_0xc7f1('0x5a')][_0xc7f1('0x79')];_0x32da61[_0xc7f1('0xa5')]=_0x3cd72b[_0xc7f1('0x5a')]['secure'];}if(_0x3cd72b[_0xc7f1('0x5a')][_0xc7f1('0x77')]){_0x32da61['auth']={'user':_0x3cd72b[_0xc7f1('0x5a')][_0xc7f1('0x7b')],'pass':_0x3cd72b[_0xc7f1('0x5a')][_0xc7f1('0x75')]};}return respondWithRpcPromise(_0xc7f1('0xb1'),_0xc7f1('0xb0'),{'account':_0x32da61});}})[_0xc7f1('0x20')](respondWithResult(_0x4858ce,null))['catch'](handleError(_0x4858ce,null));};exports[_0xc7f1('0x33')]=function(_0x24298a,_0x52a431){return db['MailAccount'][_0xc7f1('0x5e')]({'where':{'id':_0x24298a[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x52a431,null))['then'](function(_0x1bf89d){if(_0x1bf89d&&_0x1bf89d['service']){throw new db['Sequelize'][(_0xc7f1('0xb2'))](_0xc7f1('0xb3'));}return _0x1bf89d;})[_0xc7f1('0x20')](removeEntity(_0x52a431,null))[_0xc7f1('0x57')](handleError(_0x52a431,null));};exports[_0xc7f1('0xb4')]=function(_0x50e960,_0x131607,_0x4cae80){return db['MailAccount']['find']({'where':{'id':_0x50e960[_0xc7f1('0x59')]['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x131607,null))[_0xc7f1('0x20')](function(_0x3de24b){if(_0x3de24b){return _0x3de24b['addAgents'](_0x50e960['body'][_0xc7f1('0x67')],_[_0xc7f1('0x88')](_0x50e960['body'],['ids','id'])||{})['spread'](function(_0x2b5dfe){for(var _0x49d67d=0x0;_0x49d67d<_0x50e960[_0xc7f1('0x5f')][_0xc7f1('0x67')]['length'];_0x49d67d+=0x1){socket[_0xc7f1('0xb5')](_0xc7f1('0xb6'),{'UserId':_0x50e960[_0xc7f1('0x5f')][_0xc7f1('0x67')][_0x49d67d],'MailAccountId':_0x50e960[_0xc7f1('0x59')]['id']});}return _0x2b5dfe;});}})['then'](respondWithResult(_0x131607,null))['catch'](handleError(_0x131607,null));};exports[_0xc7f1('0xb7')]=function(_0x39f0b0,_0x3e550d,_0x457ca8){return db['MailAccount'][_0xc7f1('0x5e')]({'where':{'id':_0x39f0b0['params']['id']}})[_0xc7f1('0x20')](handleEntityNotFound(_0x3e550d,null))[_0xc7f1('0x20')](function(_0x14edf9){if(_0x14edf9){return _0x14edf9[_0xc7f1('0xb7')](_0x39f0b0[_0xc7f1('0x42')][_0xc7f1('0x67')])[_0xc7f1('0x20')](function(){if(_[_0xc7f1('0xb8')](_0x39f0b0[_0xc7f1('0x42')]['ids'])){for(var _0x409170=0x0;_0x409170<_0x39f0b0['query'][_0xc7f1('0x67')][_0xc7f1('0x47')];_0x409170+=0x1){socket[_0xc7f1('0xb5')](_0xc7f1('0xb9'),{'UserId':Number(_0x39f0b0[_0xc7f1('0x42')][_0xc7f1('0x67')][_0x409170]),'MailAccountId':Number(_0x39f0b0[_0xc7f1('0x59')]['id'])});}}else{socket[_0xc7f1('0xb5')](_0xc7f1('0xb9'),{'UserId':Number(_0x39f0b0[_0xc7f1('0x42')][_0xc7f1('0x67')]),'MailAccountId':Number(_0x39f0b0[_0xc7f1('0x59')]['id'])});}});}})[_0xc7f1('0x20')](respondWithStatusCode(_0x3e550d,null))['catch'](handleError(_0x3e550d,null));};exports['getAgents']=function(_0x4acc8e,_0x1ee8b0,_0xcb94e3){var _0x3389d4={};var _0x42bee3={};var _0x220430;var _0x3c5a40;return db[_0xc7f1('0x3e')]['findOne']({'where':{'id':_0x4acc8e[_0xc7f1('0x59')]['id']}})['then'](handleEntityNotFound(_0x1ee8b0,null))[_0xc7f1('0x20')](function(_0x30088a){if(_0x30088a){_0x220430=_0x30088a;_0x42bee3[_0xc7f1('0x43')]=_[_0xc7f1('0x41')](db[_0xc7f1('0x8a')][_0xc7f1('0x5c')]);_0x42bee3['query']=_[_0xc7f1('0x41')](_0x4acc8e[_0xc7f1('0x42')]);_0x42bee3['filters']=_[_0xc7f1('0x45')](_0x42bee3[_0xc7f1('0x43')],_0x42bee3[_0xc7f1('0x42')]);_0x3389d4['attributes']=_['intersection'](_0x42bee3['model'],qs[_0xc7f1('0x46')](_0x4acc8e[_0xc7f1('0x42')][_0xc7f1('0x46')]));_0x3389d4[_0xc7f1('0x44')]=_0x3389d4[_0xc7f1('0x44')][_0xc7f1('0x47')]?_0x3389d4['attributes']:_0x42bee3['model'];_0x3389d4['order']=qs['sort'](_0x4acc8e['query'][_0xc7f1('0x4a')]);_0x3389d4[_0xc7f1('0x4b')]=qs[_0xc7f1('0x4c')](_[_0xc7f1('0x4d')](_0x4acc8e[_0xc7f1('0x42')],_0x42bee3['filters']));if(_0x4acc8e['query'][_0xc7f1('0x4e')]){_0x3389d4[_0xc7f1('0x4b')]=_[_0xc7f1('0x4f')](_0x3389d4[_0xc7f1('0x4b')],{'$or':_[_0xc7f1('0x3d')](_0x3389d4[_0xc7f1('0x44')],function(_0x28715e){var _0x43c538={};_0x43c538[_0x28715e]={'$like':'%'+_0x4acc8e['query']['filter']+'%'};return _0x43c538;})});}_0x3389d4=_[_0xc7f1('0x4f')]({},_0x3389d4,_0x4acc8e['options']);return _0x220430[_0xc7f1('0xba')](_0x3389d4);}})['then'](function(_0x4f3a38){if(_0x4f3a38){_0x3c5a40=_0x4f3a38[_0xc7f1('0x47')];if(!_0x4acc8e['query'][_0xc7f1('0x48')](_0xc7f1('0x49'))){_0x3389d4[_0xc7f1('0x30')]=qs[_0xc7f1('0x30')](_0x4acc8e[_0xc7f1('0x42')]['limit']);_0x3389d4['offset']=qs[_0xc7f1('0x2f')](_0x4acc8e[_0xc7f1('0x42')][_0xc7f1('0x2f')]);}return _0x220430[_0xc7f1('0xba')](_0x3389d4);}})[_0xc7f1('0x20')](function(_0xc4ac55){if(_0xc4ac55){return _0xc4ac55?{'count':_0x3c5a40,'rows':_0xc4ac55}:null;}})[_0xc7f1('0x20')](respondWithResult(_0x1ee8b0,null))[_0xc7f1('0x57')](handleError(_0x1ee8b0,null));}; \ No newline at end of file +var _0xd2f3=['addInteraction','MailInteraction','omit','Contact','Owner','internal','Tag','Tags','tag','addApplications','sequelize','transaction','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','format','YYYY-MM-DD\x20HH:mm:ss','send','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','server/files/attachments','basename','secure','SendMail','List\x20not\x20found','ListId','messageId','subject','attach','out','Interaction','verifySmtp','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','removeAgents','isArray','emit','userMailAccount:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./mailAccount.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~!@#$%^&-_=+[{]}.','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','update','get','MailAccounts','UserProfileResource','destroy','stack','name','MailServerIn','Smtp','MailAccount','fieldName','type','key','map','query','keys','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filters','filter','options','count','includeAll','include','findAll','rows','Imap','Pause','mandatoryDispositionPause','length','merge','find','body','params','MailServerOut','describe','addDisposition','MailAccountId','Disposition','create','rawAttributes','pick','removeDispositions','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','email','isNil','active','description','cservice','cauthentication','user','cuser','cpassword','authentication','host','port','service','password','pass','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','getSmtp','addSmtp','removeSmtp'];(function(_0xe171ee,_0x54ed0d){var _0x4625e8=function(_0x47be6a){while(--_0x47be6a){_0xe171ee['push'](_0xe171ee['shift']());}};_0x4625e8(++_0x54ed0d);}(_0xd2f3,0x1b3));var _0x3d2f=function(_0x17bdad,_0x56d508){_0x17bdad=_0x17bdad-0x0;var _0x5b188a=_0xd2f3[_0x17bdad];return _0x5b188a;};'use strict';var pdf=require(_0x3d2f('0x0'));var emlformat=require(_0x3d2f('0x1'));var rimraf=require(_0x3d2f('0x2'));var zipdir=require(_0x3d2f('0x3'));var jsonpatch=require(_0x3d2f('0x4'));var rp=require(_0x3d2f('0x5'));var moment=require(_0x3d2f('0x6'));var BPromise=require(_0x3d2f('0x7'));var Mustache=require(_0x3d2f('0x8'));var util=require(_0x3d2f('0x9'));var path=require(_0x3d2f('0xa'));var sox=require(_0x3d2f('0xb'));var csv=require('to-csv');var ejs=require(_0x3d2f('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3d2f('0xd'));var crypto=require(_0x3d2f('0xe'));var jsforce=require(_0x3d2f('0xf'));var deskjs=require(_0x3d2f('0x10'));var toCsv=require(_0x3d2f('0x11'));var querystring=require(_0x3d2f('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3d2f('0x13'));var as=require(_0x3d2f('0x14'));var hardwareService=require(_0x3d2f('0x15'));var logger=require(_0x3d2f('0x16'))(_0x3d2f('0x17'));var utils=require(_0x3d2f('0x18'));var config=require(_0x3d2f('0x19'));var db=require(_0x3d2f('0x1a'))['db'];config['redis']=_[_0x3d2f('0x1b')](config[_0x3d2f('0x1c')],{'host':_0x3d2f('0x1d'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3d2f('0x1c')]));require(_0x3d2f('0x1e'))[_0x3d2f('0x1f')](socket);var jayson=require('jayson/promise');var client=jayson[_0x3d2f('0x20')][_0x3d2f('0x21')]({'port':0x232b});function checkPasswordPattern(_0x51949a,_0x4bdea6,_0x52cdc8){if(_0x52cdc8){var _0x30a8b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30a8b9[_0x3d2f('0x22')](_0x4bdea6)){return _0x51949a;}else{throw new db['Sequelize']['ValidationError'](_0x3d2f('0x23'));}}else{return _0x51949a;}}function respondWithRpcPromise(_0x50256c,_0x3e4b63,_0x45d972,_0x50cf48){return new BPromise(function(_0x356d7b,_0x3735a6){var _0x3a0917=_0x50cf48||client;return _0x3a0917['request'](_0x50256c,_0x45d972)[_0x3d2f('0x24')](function(_0x4b1845){logger['info'](_0x3d2f('0x25'),_0x3e4b63,_0x3d2f('0x26'));logger[_0x3d2f('0x27')](_0x3d2f('0x28'),_0x3e4b63,_0x3d2f('0x26'),JSON['stringify'](_0x4b1845));if(_0x4b1845[_0x3d2f('0x29')]){if(_0x4b1845[_0x3d2f('0x29')][_0x3d2f('0x2a')]===0x1f4){logger[_0x3d2f('0x29')]('MailAccount,\x20%s,\x20%s',_0x3e4b63,_0x4b1845['error'][_0x3d2f('0x2b')]);return _0x3735a6(_0x4b1845[_0x3d2f('0x29')][_0x3d2f('0x2b')]);}logger['error'](_0x3d2f('0x25'),_0x3e4b63,_0x4b1845[_0x3d2f('0x29')][_0x3d2f('0x2b')]);return _0x356d7b(_0x4b1845['error'][_0x3d2f('0x2b')]);}else{logger[_0x3d2f('0x2c')]('MailAccount,\x20%s,\x20%s',_0x3e4b63,_0x3d2f('0x26'));_0x356d7b(_0x4b1845[_0x3d2f('0x2d')]['message']);}})[_0x3d2f('0x2e')](function(_0x311643){logger[_0x3d2f('0x29')](_0x3d2f('0x25'),_0x3e4b63,_0x311643);_0x3735a6(_0x311643);});});}function respondWithStatusCode(_0x26bc9a,_0x2efa81){_0x2efa81=_0x2efa81||0xcc;return function(_0xc7e8f7){if(_0xc7e8f7){return _0x26bc9a[_0x3d2f('0x2f')](_0x2efa81);}return _0x26bc9a[_0x3d2f('0x30')](_0x2efa81)[_0x3d2f('0x31')]();};}function respondWithResult(_0x13743c,_0x382ed4){_0x382ed4=_0x382ed4||0xc8;return function(_0x7e6d27){if(_0x7e6d27){return _0x13743c['status'](_0x382ed4)[_0x3d2f('0x32')](_0x7e6d27);}};}function respondWithFilteredResult(_0x4fb034,_0x269a4a){return function(_0x1d3d9d){if(_0x1d3d9d){var _0x5cf92f=_0x1d3d9d['count'],_0x4aa04d=_0x269a4a[_0x3d2f('0x33')],_0x5c42a2=_0x269a4a[_0x3d2f('0x33')]+_0x269a4a[_0x3d2f('0x34')],_0x4d3921;if(_0x5c42a2>=_0x5cf92f){_0x5c42a2=_0x5cf92f;_0x4d3921=0xc8;}else{_0x4d3921=0xce;}_0x4fb034[_0x3d2f('0x30')](_0x4d3921);return _0x4fb034[_0x3d2f('0x35')]('Content-Range',_0x4aa04d+'-'+_0x5c42a2+'/'+_0x5cf92f)[_0x3d2f('0x32')](_0x1d3d9d);}return null;};}function patchUpdates(_0x38dcf6){return function(_0x59f528){try{jsonpatch[_0x3d2f('0x36')](_0x59f528,_0x38dcf6,!![]);}catch(_0x4dbc8a){return BPromise[_0x3d2f('0x37')](_0x4dbc8a);}return _0x59f528['save']();};}function saveUpdates(_0x141742,_0x1da826){return function(_0x1c0f2c){if(_0x1c0f2c){return _0x1c0f2c[_0x3d2f('0x38')](_0x141742)['then'](function(_0x248099){return _0x248099;});}return null;};}function removeEntity(_0x7913a6,_0x43355f){return function(_0xb88fd0){if(_0xb88fd0){return _0xb88fd0['destroy']()['then'](function(){var _0xaad8b9=_0xb88fd0[_0x3d2f('0x39')]({'plain':!![]});var _0x590cf8=_0x3d2f('0x3a');return db[_0x3d2f('0x3b')][_0x3d2f('0x3c')]({'where':{'type':_0x590cf8,'resourceId':_0xaad8b9['id']}})[_0x3d2f('0x24')](function(){return _0xb88fd0;});})[_0x3d2f('0x24')](function(){_0x7913a6[_0x3d2f('0x30')](0xcc)[_0x3d2f('0x31')]();});}};}function handleEntityNotFound(_0x21b0d5,_0x16d561){return function(_0x207e06){if(!_0x207e06){_0x21b0d5[_0x3d2f('0x2f')](0x194);}return _0x207e06;};}function handleError(_0x1e9091,_0x778c3a){_0x778c3a=_0x778c3a||0x1f4;return function(_0x425ddf){logger['error'](_0x425ddf[_0x3d2f('0x3d')]);if(_0x425ddf[_0x3d2f('0x3e')]){delete _0x425ddf[_0x3d2f('0x3e')];}_0x1e9091[_0x3d2f('0x30')](_0x778c3a)['send'](_0x425ddf);};}exports['index']=function(_0x262c4e,_0x1e998){var _0xabed2e={'include':[{'model':db[_0x3d2f('0x3f')],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x3d2f('0x40')},{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0xea4c6e={},_0x38a5a5={'count':0x0,'rows':[]};var _0xf0588=_['map'](db[_0x3d2f('0x41')]['rawAttributes'],function(_0x198d81){return{'name':_0x198d81[_0x3d2f('0x42')],'type':_0x198d81[_0x3d2f('0x43')][_0x3d2f('0x44')]};});_0xea4c6e['model']=_[_0x3d2f('0x45')](_0xf0588,'name');_0xea4c6e[_0x3d2f('0x46')]=_[_0x3d2f('0x47')](_0x262c4e[_0x3d2f('0x46')]);_0xea4c6e['filters']=_[_0x3d2f('0x48')](_0xea4c6e[_0x3d2f('0x49')],_0xea4c6e[_0x3d2f('0x46')]);_0xabed2e[_0x3d2f('0x4a')]=_[_0x3d2f('0x48')](_0xea4c6e[_0x3d2f('0x49')],qs['fields'](_0x262c4e[_0x3d2f('0x46')][_0x3d2f('0x4b')]));_0xabed2e['attributes']=_0xabed2e['attributes']['length']?_0xabed2e['attributes']:_0xea4c6e[_0x3d2f('0x49')];if(!_0x262c4e[_0x3d2f('0x46')][_0x3d2f('0x4c')](_0x3d2f('0x4d'))){_0xabed2e[_0x3d2f('0x34')]=qs[_0x3d2f('0x34')](_0x262c4e[_0x3d2f('0x46')][_0x3d2f('0x34')]);_0xabed2e[_0x3d2f('0x33')]=qs[_0x3d2f('0x33')](_0x262c4e[_0x3d2f('0x46')][_0x3d2f('0x33')]);}_0xabed2e[_0x3d2f('0x4e')]=qs[_0x3d2f('0x4f')](_0x262c4e[_0x3d2f('0x46')][_0x3d2f('0x4f')]);_0xabed2e[_0x3d2f('0x50')]=qs[_0x3d2f('0x51')](_['pick'](_0x262c4e[_0x3d2f('0x46')],_0xea4c6e['filters']));if(_0x262c4e[_0x3d2f('0x46')][_0x3d2f('0x52')]){_0xabed2e[_0x3d2f('0x50')]=_['merge'](_0xabed2e[_0x3d2f('0x50')],{'$or':_[_0x3d2f('0x45')](_0xf0588,function(_0x52d09f){if(_0x52d09f['type']!=='VIRTUAL'){var _0x190cbb={};_0x190cbb[_0x52d09f['name']]={'$like':'%'+_0x262c4e['query']['filter']+'%'};return _0x190cbb;}})});}_0xabed2e=_['merge']({},_0xabed2e,_0x262c4e[_0x3d2f('0x53')]);var _0x2e5029={'where':_0xabed2e['where']};return db[_0x3d2f('0x41')][_0x3d2f('0x54')](_0x2e5029)[_0x3d2f('0x24')](function(_0x295756){_0x38a5a5['count']=_0x295756;if(_0x262c4e[_0x3d2f('0x46')][_0x3d2f('0x55')]){_0xabed2e[_0x3d2f('0x56')]=[{'all':!![]}];}return db[_0x3d2f('0x41')][_0x3d2f('0x57')](_0xabed2e);})['then'](function(_0x12b31a){_0x38a5a5[_0x3d2f('0x58')]=_0x12b31a;return _0x38a5a5;})[_0x3d2f('0x24')](respondWithFilteredResult(_0x1e998,_0xabed2e))['catch'](handleError(_0x1e998,null));};exports['show']=function(_0x1963d7,_0x4ba299){var _0x1f328f={'raw':![],'where':{'id':_0x1963d7['params']['id']},'include':[{'model':db[_0x3d2f('0x3f')],'as':_0x3d2f('0x59')},{'model':db['MailServerOut'],'as':_0x3d2f('0x40')},{'model':db[_0x3d2f('0x5a')],'as':_0x3d2f('0x5b')}]},_0x2b2c11={};_0x2b2c11['model']=_[_0x3d2f('0x47')](db[_0x3d2f('0x41')]['rawAttributes']);_0x2b2c11['query']=_[_0x3d2f('0x47')](_0x1963d7[_0x3d2f('0x46')]);_0x2b2c11[_0x3d2f('0x51')]=_['intersection'](_0x2b2c11[_0x3d2f('0x49')],_0x2b2c11[_0x3d2f('0x46')]);_0x1f328f[_0x3d2f('0x4a')]=_['intersection'](_0x2b2c11[_0x3d2f('0x49')],qs[_0x3d2f('0x4b')](_0x1963d7[_0x3d2f('0x46')]['fields']));_0x1f328f[_0x3d2f('0x4a')]=_0x1f328f[_0x3d2f('0x4a')][_0x3d2f('0x5c')]?_0x1f328f[_0x3d2f('0x4a')]:_0x2b2c11[_0x3d2f('0x49')];if(_0x1963d7[_0x3d2f('0x46')][_0x3d2f('0x55')]){_0x1f328f[_0x3d2f('0x56')]=[{'all':!![]}];}_0x1f328f=_[_0x3d2f('0x5d')]({},_0x1f328f,_0x1963d7['options']);return db[_0x3d2f('0x41')][_0x3d2f('0x5e')](_0x1f328f)[_0x3d2f('0x24')](handleEntityNotFound(_0x4ba299,null))[_0x3d2f('0x24')](respondWithResult(_0x4ba299,null))[_0x3d2f('0x2e')](handleError(_0x4ba299,null));};exports[_0x3d2f('0x38')]=function(_0x487649,_0x5dffbc){if(_0x487649[_0x3d2f('0x5f')]['id']){delete _0x487649[_0x3d2f('0x5f')]['id'];}return db[_0x3d2f('0x41')][_0x3d2f('0x5e')]({'where':{'id':_0x487649[_0x3d2f('0x60')]['id']},'include':[{'model':db[_0x3d2f('0x3f')],'as':_0x3d2f('0x59')},{'model':db[_0x3d2f('0x61')],'as':_0x3d2f('0x40')},{'model':db[_0x3d2f('0x5a')],'as':'mandatoryDispositionPause'}]})[_0x3d2f('0x24')](handleEntityNotFound(_0x5dffbc,null))[_0x3d2f('0x24')](saveUpdates(_0x487649[_0x3d2f('0x5f')],null))[_0x3d2f('0x24')](function(_0x12a55f){if(_0x12a55f&&_0x487649[_0x3d2f('0x5f')][_0x3d2f('0x59')]){return db['MailServerIn'][_0x3d2f('0x38')](_0x487649['body']['Imap'],{'where':{'MailAccountId':_0x12a55f['id']}})[_0x3d2f('0x24')](function(){return _0x12a55f;});}return _0x12a55f;})[_0x3d2f('0x24')](function(_0x50d136){if(_0x50d136&&_0x487649[_0x3d2f('0x5f')][_0x3d2f('0x40')]){return db[_0x3d2f('0x61')][_0x3d2f('0x38')](_0x487649['body'][_0x3d2f('0x40')],{'where':{'MailAccountId':_0x50d136['id']}})[_0x3d2f('0x24')](function(){return _0x50d136;});}return _0x50d136;})[_0x3d2f('0x24')](respondWithResult(_0x5dffbc,null))[_0x3d2f('0x2e')](handleError(_0x5dffbc,null));};exports[_0x3d2f('0x62')]=function(_0x3c00c2,_0x30e369){return db['MailAccount'][_0x3d2f('0x62')]()[_0x3d2f('0x24')](respondWithResult(_0x30e369,null))[_0x3d2f('0x2e')](handleError(_0x30e369,null));};exports[_0x3d2f('0x63')]=function(_0x5aa95e,_0x1dba64,_0x3b9ad8){if(_0x5aa95e[_0x3d2f('0x5f')]['id']){delete _0x5aa95e[_0x3d2f('0x5f')]['id'];}return db[_0x3d2f('0x41')][_0x3d2f('0x5e')]({'where':{'id':_0x5aa95e['params']['id']}})['then'](handleEntityNotFound(_0x1dba64,null))[_0x3d2f('0x24')](function(_0x10f80f){if(_0x10f80f){_0x5aa95e[_0x3d2f('0x5f')][_0x3d2f('0x64')]=_0x10f80f['id'];return db[_0x3d2f('0x65')][_0x3d2f('0x66')](_0x5aa95e['body']);}})[_0x3d2f('0x24')](respondWithResult(_0x1dba64,null))[_0x3d2f('0x2e')](handleError(_0x1dba64,null));};exports['getDispositions']=function(_0x45a020,_0x431b14,_0x2390ab){var _0x1c8317={'raw':![],'where':{}};var _0x4dc461={};var _0x12ffad={'count':0x0,'rows':[]};return db[_0x3d2f('0x41')]['findOne']({'where':{'id':_0x45a020[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x431b14,null))[_0x3d2f('0x24')](function(_0x491f98){if(_0x491f98){_0x4dc461['model']=_[_0x3d2f('0x47')](db['Disposition'][_0x3d2f('0x67')]);_0x4dc461['query']=_[_0x3d2f('0x47')](_0x45a020['query']);_0x4dc461[_0x3d2f('0x51')]=_[_0x3d2f('0x48')](_0x4dc461[_0x3d2f('0x49')],_0x4dc461[_0x3d2f('0x46')]);_0x1c8317[_0x3d2f('0x4a')]=_[_0x3d2f('0x48')](_0x4dc461[_0x3d2f('0x49')],qs[_0x3d2f('0x4b')](_0x45a020['query'][_0x3d2f('0x4b')]));_0x1c8317[_0x3d2f('0x4a')]=_0x1c8317[_0x3d2f('0x4a')][_0x3d2f('0x5c')]?_0x1c8317[_0x3d2f('0x4a')]:_0x4dc461[_0x3d2f('0x49')];if(!_0x45a020[_0x3d2f('0x46')][_0x3d2f('0x4c')](_0x3d2f('0x4d'))){_0x1c8317[_0x3d2f('0x34')]=qs[_0x3d2f('0x34')](_0x45a020[_0x3d2f('0x46')][_0x3d2f('0x34')]);_0x1c8317['offset']=qs[_0x3d2f('0x33')](_0x45a020[_0x3d2f('0x46')][_0x3d2f('0x33')]);}_0x1c8317[_0x3d2f('0x4e')]=qs['sort'](_0x45a020[_0x3d2f('0x46')][_0x3d2f('0x4f')]);_0x1c8317['where']=qs['filters'](_[_0x3d2f('0x68')](_0x45a020[_0x3d2f('0x46')],_0x4dc461['filters']));_0x1c8317[_0x3d2f('0x50')][_0x3d2f('0x64')]=_0x491f98['id'];if(_0x45a020[_0x3d2f('0x46')][_0x3d2f('0x52')]){_0x1c8317[_0x3d2f('0x50')]=_[_0x3d2f('0x5d')](_0x1c8317[_0x3d2f('0x50')],{'$or':_[_0x3d2f('0x45')](_0x1c8317[_0x3d2f('0x4a')],function(_0x25a3f6){var _0xd05345={};_0xd05345[_0x25a3f6]={'$like':'%'+_0x45a020[_0x3d2f('0x46')][_0x3d2f('0x52')]+'%'};return _0xd05345;})});}_0x1c8317=_[_0x3d2f('0x5d')]({},_0x1c8317,_0x45a020['options']);return db[_0x3d2f('0x65')][_0x3d2f('0x54')]({'where':_0x1c8317['where']})[_0x3d2f('0x24')](function(_0x25ad22){_0x12ffad[_0x3d2f('0x54')]=_0x25ad22;if(_0x45a020[_0x3d2f('0x46')][_0x3d2f('0x55')]){_0x1c8317[_0x3d2f('0x56')]=[{'all':!![]}];}return db[_0x3d2f('0x65')]['findAll'](_0x1c8317);})[_0x3d2f('0x24')](function(_0xc6e7cc){_0x12ffad[_0x3d2f('0x58')]=_0xc6e7cc;return _0x12ffad;});}})[_0x3d2f('0x24')](respondWithFilteredResult(_0x431b14,_0x1c8317))['catch'](handleError(_0x431b14,null));};exports[_0x3d2f('0x69')]=function(_0xe0f8d2,_0x55b8b6,_0x3389e6){return db[_0x3d2f('0x41')]['find']({'where':{'id':_0xe0f8d2[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x55b8b6,null))[_0x3d2f('0x24')](function(_0x4f1c63){if(_0x4f1c63){return _0x4f1c63['removeDispositions'](_0xe0f8d2[_0x3d2f('0x46')][_0x3d2f('0x6a')]);}})[_0x3d2f('0x24')](respondWithStatusCode(_0x55b8b6,null))[_0x3d2f('0x2e')](handleError(_0x55b8b6,null));};exports[_0x3d2f('0x6b')]=function(_0x136d38,_0x16ec1b,_0xfa4706){if(_0x136d38[_0x3d2f('0x5f')]['id']){delete _0x136d38[_0x3d2f('0x5f')]['id'];}return db[_0x3d2f('0x41')][_0x3d2f('0x5e')]({'where':{'id':_0x136d38[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x16ec1b,null))[_0x3d2f('0x24')](function(_0x428be3){if(_0x428be3){_0x136d38['body'][_0x3d2f('0x64')]=_0x428be3['id'];return db['CannedAnswer']['create'](_0x136d38[_0x3d2f('0x5f')]);}})[_0x3d2f('0x24')](respondWithResult(_0x16ec1b,null))[_0x3d2f('0x2e')](handleError(_0x16ec1b,null));};exports[_0x3d2f('0x6c')]=function(_0x1e1245,_0x3ccfc3,_0x21c156){var _0x298984={'raw':![],'where':{}};var _0xe5465a={};var _0x1be120={'count':0x0,'rows':[]};return db['MailAccount'][_0x3d2f('0x6d')]({'where':{'id':_0x1e1245['params']['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x3ccfc3,null))[_0x3d2f('0x24')](function(_0x7d33f7){if(_0x7d33f7){_0xe5465a['model']=_[_0x3d2f('0x47')](db[_0x3d2f('0x6e')][_0x3d2f('0x67')]);_0xe5465a['query']=_[_0x3d2f('0x47')](_0x1e1245[_0x3d2f('0x46')]);_0xe5465a['filters']=_[_0x3d2f('0x48')](_0xe5465a[_0x3d2f('0x49')],_0xe5465a[_0x3d2f('0x46')]);_0x298984[_0x3d2f('0x4a')]=_[_0x3d2f('0x48')](_0xe5465a[_0x3d2f('0x49')],qs[_0x3d2f('0x4b')](_0x1e1245[_0x3d2f('0x46')][_0x3d2f('0x4b')]));_0x298984[_0x3d2f('0x4a')]=_0x298984['attributes']['length']?_0x298984[_0x3d2f('0x4a')]:_0xe5465a[_0x3d2f('0x49')];if(!_0x1e1245[_0x3d2f('0x46')][_0x3d2f('0x4c')]('nolimit')){_0x298984['limit']=qs[_0x3d2f('0x34')](_0x1e1245[_0x3d2f('0x46')][_0x3d2f('0x34')]);_0x298984['offset']=qs[_0x3d2f('0x33')](_0x1e1245[_0x3d2f('0x46')][_0x3d2f('0x33')]);}_0x298984[_0x3d2f('0x4e')]=qs[_0x3d2f('0x4f')](_0x1e1245[_0x3d2f('0x46')][_0x3d2f('0x4f')]);_0x298984[_0x3d2f('0x50')]=qs[_0x3d2f('0x51')](_[_0x3d2f('0x68')](_0x1e1245['query'],_0xe5465a['filters']));_0x298984[_0x3d2f('0x50')]['MailAccountId']=_0x7d33f7['id'];if(_0x1e1245[_0x3d2f('0x46')]['filter']){_0x298984[_0x3d2f('0x50')]=_[_0x3d2f('0x5d')](_0x298984[_0x3d2f('0x50')],{'$or':_[_0x3d2f('0x45')](_0x298984[_0x3d2f('0x4a')],function(_0xeea41){var _0x24e521={};_0x24e521[_0xeea41]={'$like':'%'+_0x1e1245[_0x3d2f('0x46')]['filter']+'%'};return _0x24e521;})});}_0x298984=_[_0x3d2f('0x5d')]({},_0x298984,_0x1e1245['options']);return db[_0x3d2f('0x6e')]['count']({'where':_0x298984[_0x3d2f('0x50')]})[_0x3d2f('0x24')](function(_0x5cb1e3){_0x1be120['count']=_0x5cb1e3;if(_0x1e1245[_0x3d2f('0x46')][_0x3d2f('0x55')]){_0x298984[_0x3d2f('0x56')]=[{'all':!![]}];}return db['CannedAnswer'][_0x3d2f('0x57')](_0x298984);})[_0x3d2f('0x24')](function(_0x5eedd7){_0x1be120[_0x3d2f('0x58')]=_0x5eedd7;return _0x1be120;});}})[_0x3d2f('0x24')](respondWithFilteredResult(_0x3ccfc3,_0x298984))[_0x3d2f('0x2e')](handleError(_0x3ccfc3,null));};exports['removeAnswers']=function(_0x10f02a,_0xd06950,_0x7cfe0){return db['MailAccount'][_0x3d2f('0x5e')]({'where':{'id':_0x10f02a['params']['id']}})['then'](handleEntityNotFound(_0xd06950,null))[_0x3d2f('0x24')](function(_0x3fbbbb){if(_0x3fbbbb){return _0x3fbbbb[_0x3d2f('0x6f')](_0x10f02a[_0x3d2f('0x46')]['ids']);}})[_0x3d2f('0x24')](respondWithStatusCode(_0xd06950,null))[_0x3d2f('0x2e')](handleError(_0xd06950,null));};exports[_0x3d2f('0x66')]=function(_0x5b3003,_0x2f13c4){var _0x5ae6b1={'name':_0x5b3003[_0x3d2f('0x5f')][_0x3d2f('0x3e')],'key':_0x5b3003[_0x3d2f('0x5f')][_0x3d2f('0x44')],'email':_0x5b3003['body'][_0x3d2f('0x70')],'ListId':_0x5b3003[_0x3d2f('0x5f')]['ListId'],'active':!_[_0x3d2f('0x71')](_0x5b3003['body'][_0x3d2f('0x72')])?_0x5b3003[_0x3d2f('0x5f')][_0x3d2f('0x72')]:!![],'description':_0x5b3003[_0x3d2f('0x5f')][_0x3d2f('0x73')]||null,'Imap':{},'Smtp':{}};if(_[_0x3d2f('0x71')](_0x5b3003['body'][_0x3d2f('0x74')])){if(_0x5b3003['body'][_0x3d2f('0x75')]){_0x5ae6b1[_0x3d2f('0x59')][_0x3d2f('0x76')]=_0x5ae6b1[_0x3d2f('0x40')][_0x3d2f('0x76')]=_0x5b3003['body'][_0x3d2f('0x77')];_0x5ae6b1[_0x3d2f('0x59')]['password']=_0x5ae6b1[_0x3d2f('0x40')]['pass']=_0x5b3003['body'][_0x3d2f('0x78')];}else{_0x5ae6b1[_0x3d2f('0x59')][_0x3d2f('0x79')]=_0x5ae6b1[_0x3d2f('0x40')][_0x3d2f('0x79')]=![];}_0x5ae6b1[_0x3d2f('0x59')]['host']=_0x5b3003[_0x3d2f('0x5f')][_0x3d2f('0x59')][_0x3d2f('0x7a')];_0x5ae6b1['Imap']['port']=_0x5b3003['body']['Imap'][_0x3d2f('0x7b')];_0x5ae6b1[_0x3d2f('0x40')][_0x3d2f('0x7a')]=_0x5b3003['body'][_0x3d2f('0x40')][_0x3d2f('0x7a')];_0x5ae6b1[_0x3d2f('0x40')][_0x3d2f('0x7b')]=_0x5b3003[_0x3d2f('0x5f')][_0x3d2f('0x40')][_0x3d2f('0x7b')];}else{_0x5ae6b1['Imap']['service']=_0x5ae6b1[_0x3d2f('0x40')][_0x3d2f('0x7c')]=_0x5b3003['body'][_0x3d2f('0x74')];_0x5ae6b1[_0x3d2f('0x59')][_0x3d2f('0x76')]=_0x5ae6b1[_0x3d2f('0x40')][_0x3d2f('0x76')]=_0x5b3003['body']['cuser'];_0x5ae6b1[_0x3d2f('0x59')][_0x3d2f('0x7d')]=_0x5ae6b1[_0x3d2f('0x40')][_0x3d2f('0x7e')]=_0x5b3003[_0x3d2f('0x5f')][_0x3d2f('0x78')];}return db[_0x3d2f('0x41')]['create'](_0x5ae6b1,{'include':[{'model':db[_0x3d2f('0x61')],'as':_0x3d2f('0x40')},{'model':db['MailServerIn'],'as':_0x3d2f('0x59')}]})[_0x3d2f('0x24')](function(_0x2e2c96){var _0xb0b14b=_0x5b3003['user'][_0x3d2f('0x39')]({'plain':!![]});if(!_0xb0b14b)throw new Error(_0x3d2f('0x7f'));if(_0xb0b14b[_0x3d2f('0x80')]==='user'){var _0x7075cd=_0x2e2c96['get']({'plain':!![]});return db[_0x3d2f('0x81')][_0x3d2f('0x5e')]({'where':{'name':_0x3d2f('0x3a'),'userProfileId':_0xb0b14b[_0x3d2f('0x82')]},'raw':!![]})[_0x3d2f('0x24')](function(_0x5f383f){if(_0x5f383f&&_0x5f383f[_0x3d2f('0x83')]===0x0){return db[_0x3d2f('0x3b')]['create']({'name':_0x7075cd[_0x3d2f('0x3e')],'resourceId':_0x7075cd['id'],'type':_0x5f383f[_0x3d2f('0x3e')],'sectionId':_0x5f383f['id']},{})[_0x3d2f('0x24')](function(){return _0x2e2c96;});}else{return _0x2e2c96;}})[_0x3d2f('0x2e')](function(_0x491130){logger[_0x3d2f('0x29')](_0x3d2f('0x84'),_0x491130);throw _0x491130;});}return _0x2e2c96;})[_0x3d2f('0x24')](respondWithResult(_0x2f13c4,0xc9))[_0x3d2f('0x2e')](handleError(_0x2f13c4,null));};exports[_0x3d2f('0x85')]=function(_0x2e2f64,_0x1af289,_0x184a9e){return db[_0x3d2f('0x41')][_0x3d2f('0x6d')]({'where':{'id':_0x2e2f64[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x1af289,null))[_0x3d2f('0x24')](function(_0x36de13){if(_0x36de13){return _0x36de13[_0x3d2f('0x85')]();}return null;})[_0x3d2f('0x24')](respondWithResult(_0x1af289,null))[_0x3d2f('0x2e')](handleError(_0x1af289,null));};exports['addImap']=function(_0x122268,_0x3b4388,_0x38bfb4){if(_0x122268[_0x3d2f('0x5f')]['id']){delete _0x122268[_0x3d2f('0x5f')]['id'];}return db[_0x3d2f('0x41')][_0x3d2f('0x5e')]({'where':{'id':_0x122268['params']['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x3b4388,null))[_0x3d2f('0x24')](function(_0x495a2e){if(_0x495a2e){_0x122268[_0x3d2f('0x5f')][_0x3d2f('0x64')]=_0x495a2e['id'];return db[_0x3d2f('0x3f')][_0x3d2f('0x66')](_0x122268['body']);}})[_0x3d2f('0x24')](respondWithResult(_0x3b4388,null))[_0x3d2f('0x2e')](handleError(_0x3b4388,null));};exports[_0x3d2f('0x86')]=function(_0x482e45,_0x11e3d9,_0x55bc5d){return db[_0x3d2f('0x41')]['findOne']({'where':{'id':_0x482e45[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x11e3d9,null))['then'](function(_0x48b17c){if(_0x48b17c){return _0x48b17c['setImap'](null);}return null;})[_0x3d2f('0x24')](respondWithStatusCode(_0x11e3d9,null))[_0x3d2f('0x2e')](handleError(_0x11e3d9,null));};exports['getSmtp']=function(_0x1517b4,_0x5c360e,_0x5a7941){return db['MailAccount'][_0x3d2f('0x6d')]({'where':{'id':_0x1517b4[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x5c360e,null))[_0x3d2f('0x24')](function(_0x2e5d42){if(_0x2e5d42){return _0x2e5d42[_0x3d2f('0x87')]();}return null;})[_0x3d2f('0x24')](respondWithResult(_0x5c360e,null))[_0x3d2f('0x2e')](handleError(_0x5c360e,null));};exports[_0x3d2f('0x88')]=function(_0x243f23,_0x1d9143,_0xcc802d){if(_0x243f23[_0x3d2f('0x5f')]['id']){delete _0x243f23[_0x3d2f('0x5f')]['id'];}return db[_0x3d2f('0x41')]['find']({'where':{'id':_0x243f23['params']['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x1d9143,null))[_0x3d2f('0x24')](function(_0x2ae379){if(_0x2ae379){_0x243f23['body']['MailAccountId']=_0x2ae379['id'];return db[_0x3d2f('0x61')][_0x3d2f('0x66')](_0x243f23[_0x3d2f('0x5f')]);}})[_0x3d2f('0x24')](respondWithResult(_0x1d9143,null))[_0x3d2f('0x2e')](handleError(_0x1d9143,null));};exports[_0x3d2f('0x89')]=function(_0xe2765a,_0x36be26,_0xb63600){return db[_0x3d2f('0x41')][_0x3d2f('0x6d')]({'where':{'id':_0xe2765a[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x36be26,null))[_0x3d2f('0x24')](function(_0x41bc96){if(_0x41bc96){return _0x41bc96['setSmtp'](null);}return null;})[_0x3d2f('0x24')](respondWithStatusCode(_0x36be26,null))[_0x3d2f('0x2e')](handleError(_0x36be26,null));};exports[_0x3d2f('0x8a')]=function(_0x3e41cc,_0x21e9d9,_0x28b4f5){return db[_0x3d2f('0x8b')]['find']({'where':{'id':_0x3e41cc[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x21e9d9,null))['then'](function(_0x204fc7){if(_0x204fc7){return _0x204fc7[_0x3d2f('0x8a')](_0x3e41cc[_0x3d2f('0x5f')]['ids'],_[_0x3d2f('0x8c')](_0x3e41cc['body'],[_0x3d2f('0x6a'),'id'])||{});}})[_0x3d2f('0x24')](respondWithResult(_0x21e9d9,null))[_0x3d2f('0x2e')](handleError(_0x21e9d9,null));};exports['getInteractions']=function(_0x3aad9d,_0x15f93f,_0x1a86f8){var _0x1bdc2f={'raw':![],'where':{}};var _0x3ce412={};var _0x53e757={'count':0x0,'rows':[]};return db[_0x3d2f('0x41')]['findOne']({'where':{'id':_0x3aad9d['params']['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x15f93f,null))[_0x3d2f('0x24')](function(_0x42d662){if(_0x42d662){_0x3ce412[_0x3d2f('0x49')]=_[_0x3d2f('0x47')](db[_0x3d2f('0x8b')]['rawAttributes']);_0x3ce412[_0x3d2f('0x46')]=_[_0x3d2f('0x47')](_0x3aad9d[_0x3d2f('0x46')]);_0x3ce412[_0x3d2f('0x51')]=_[_0x3d2f('0x48')](_0x3ce412[_0x3d2f('0x49')],_0x3ce412[_0x3d2f('0x46')]);_0x1bdc2f[_0x3d2f('0x4a')]=_['intersection'](_0x3ce412[_0x3d2f('0x49')],qs['fields'](_0x3aad9d['query'][_0x3d2f('0x4b')]));_0x1bdc2f['attributes']=_0x1bdc2f[_0x3d2f('0x4a')][_0x3d2f('0x5c')]?_0x1bdc2f['attributes']:_0x3ce412[_0x3d2f('0x49')];if(!_0x3aad9d['query'][_0x3d2f('0x4c')]('nolimit')){_0x1bdc2f[_0x3d2f('0x34')]=qs[_0x3d2f('0x34')](_0x3aad9d[_0x3d2f('0x46')][_0x3d2f('0x34')]);_0x1bdc2f['offset']=qs[_0x3d2f('0x33')](_0x3aad9d[_0x3d2f('0x46')]['offset']);}_0x1bdc2f[_0x3d2f('0x4e')]=qs[_0x3d2f('0x4f')](_0x3aad9d[_0x3d2f('0x46')][_0x3d2f('0x4f')]);_0x1bdc2f[_0x3d2f('0x50')]=qs[_0x3d2f('0x51')](_[_0x3d2f('0x68')](_0x3aad9d[_0x3d2f('0x46')],_0x3ce412['filters']));_0x1bdc2f['where']['MailAccountId']=_0x42d662['id'];if(_0x3aad9d['query'][_0x3d2f('0x52')]){_0x1bdc2f['where']=_[_0x3d2f('0x5d')](_0x1bdc2f[_0x3d2f('0x50')],{'$or':_[_0x3d2f('0x45')](_0x1bdc2f[_0x3d2f('0x4a')],function(_0x55bcff){var _0x284db0={};_0x284db0[_0x55bcff]={'$like':'%'+_0x3aad9d[_0x3d2f('0x46')][_0x3d2f('0x52')]+'%'};return _0x284db0;})});}_0x1bdc2f=_[_0x3d2f('0x5d')]({},_0x1bdc2f,_0x3aad9d[_0x3d2f('0x53')]);return db[_0x3d2f('0x8b')][_0x3d2f('0x54')]({'where':_0x1bdc2f[_0x3d2f('0x50')]})[_0x3d2f('0x24')](function(_0x4833da){_0x53e757['count']=_0x4833da;if(_0x3aad9d[_0x3d2f('0x46')]['includeAll']){_0x1bdc2f[_0x3d2f('0x56')]=[{'model':db['CmContact'],'as':_0x3d2f('0x8d'),'required':![]},{'model':db['User'],'as':_0x3d2f('0x8e'),'attributes':[_0x3d2f('0x3e'),'fullname',_0x3d2f('0x8f')],'required':![]},{'model':db[_0x3d2f('0x90')],'as':_0x3d2f('0x91'),'attributes':['id','name','color'],'where':_0x3aad9d['query'][_0x3d2f('0x92')]?{'id':_0x3aad9d[_0x3d2f('0x46')][_0x3d2f('0x92')]}:undefined,'required':_0x3aad9d[_0x3d2f('0x46')][_0x3d2f('0x92')]?!![]:![]}];}return db[_0x3d2f('0x8b')]['findAll'](_0x1bdc2f);})[_0x3d2f('0x24')](function(_0x21b03e){_0x53e757[_0x3d2f('0x58')]=_0x21b03e;return _0x53e757;});}})[_0x3d2f('0x24')](respondWithFilteredResult(_0x15f93f,_0x1bdc2f))[_0x3d2f('0x2e')](handleError(_0x15f93f,null));};exports[_0x3d2f('0x93')]=function(_0xb4ea6b,_0xcc09e5,_0x5bc895){return db['MailAccount'][_0x3d2f('0x6d')]({'where':{'id':_0xb4ea6b[_0x3d2f('0x60')]['id']}})['then'](handleEntityNotFound(_0xcc09e5,null))[_0x3d2f('0x24')](function(_0x46f6bc){if(_0x46f6bc){return db[_0x3d2f('0x94')][_0x3d2f('0x95')](function(_0x47c8a9){return db['MailApplication'][_0x3d2f('0x3c')]({'where':{'MailAccountId':_0xb4ea6b[_0x3d2f('0x60')]['id']},'transaction':_0x47c8a9})[_0x3d2f('0x24')](function(_0x1eacfb){var _0x267231=_[_0x3d2f('0x45')](_0xb4ea6b[_0x3d2f('0x5f')],function(_0x30a0dc){_0x30a0dc['MailAccountId']=_0xb4ea6b[_0x3d2f('0x60')]['id'];return _0x30a0dc;});return db[_0x3d2f('0x96')][_0x3d2f('0x97')](_0x267231,{'transaction':_0x47c8a9});});})[_0x3d2f('0x24')](function(){return db[_0x3d2f('0x96')][_0x3d2f('0x98')]({'where':{'MailAccountId':_0xb4ea6b['params']['id']},'order':_0x3d2f('0x99')});});}})[_0x3d2f('0x24')](respondWithResult(_0xcc09e5,null))[_0x3d2f('0x2e')](handleError(_0xcc09e5,null));};exports['getApplications']=function(_0x29d4fc,_0x1b355e,_0x46e92b){var _0x55d0e3={};var _0x2f448e={};var _0xc94c67;var _0x520b1c;return db[_0x3d2f('0x41')]['findOne']({'where':{'id':_0x29d4fc[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x1b355e,null))[_0x3d2f('0x24')](function(_0x1c6ed0){if(_0x1c6ed0){_0xc94c67=_0x1c6ed0;_0x2f448e['model']=_[_0x3d2f('0x47')](db['MailApplication'][_0x3d2f('0x67')]);_0x2f448e[_0x3d2f('0x46')]=_[_0x3d2f('0x47')](_0x29d4fc[_0x3d2f('0x46')]);_0x2f448e['filters']=_['intersection'](_0x2f448e['model'],_0x2f448e['query']);_0x55d0e3['attributes']=_[_0x3d2f('0x48')](_0x2f448e[_0x3d2f('0x49')],qs[_0x3d2f('0x4b')](_0x29d4fc['query']['fields']));_0x55d0e3['attributes']=_0x55d0e3[_0x3d2f('0x4a')]['length']?_0x55d0e3[_0x3d2f('0x4a')]:_0x2f448e[_0x3d2f('0x49')];_0x55d0e3[_0x3d2f('0x4e')]=qs[_0x3d2f('0x4f')](_0x29d4fc['query'][_0x3d2f('0x4f')]);_0x55d0e3['where']=qs['filters'](_[_0x3d2f('0x68')](_0x29d4fc[_0x3d2f('0x46')],_0x2f448e[_0x3d2f('0x51')]));if(_0x29d4fc['query'][_0x3d2f('0x52')]){_0x55d0e3[_0x3d2f('0x50')]=_[_0x3d2f('0x5d')](_0x55d0e3[_0x3d2f('0x50')],{'$or':_[_0x3d2f('0x45')](_0x55d0e3[_0x3d2f('0x4a')],function(_0x3405e8){var _0x49fdfe={};_0x49fdfe[_0x3405e8]={'$like':'%'+_0x29d4fc[_0x3d2f('0x46')][_0x3d2f('0x52')]+'%'};return _0x49fdfe;})});}_0x55d0e3=_[_0x3d2f('0x5d')]({},_0x55d0e3,_0x29d4fc[_0x3d2f('0x53')]);return _0xc94c67[_0x3d2f('0x9a')](_0x55d0e3);}})[_0x3d2f('0x24')](function(_0x9d3b44){if(_0x9d3b44){_0x520b1c=_0x9d3b44['length'];if(!_0x29d4fc['query'][_0x3d2f('0x4c')](_0x3d2f('0x4d'))){_0x55d0e3['limit']=qs['limit'](_0x29d4fc[_0x3d2f('0x46')][_0x3d2f('0x34')]);_0x55d0e3[_0x3d2f('0x33')]=qs['offset'](_0x29d4fc['query']['offset']);}return _0xc94c67[_0x3d2f('0x9a')](_0x55d0e3);}})[_0x3d2f('0x24')](function(_0xfde2d6){if(_0xfde2d6){return _0xfde2d6?{'count':_0x520b1c,'rows':_0xfde2d6}:null;}})['then'](respondWithResult(_0x1b355e,null))['catch'](handleError(_0x1b355e,null));};exports['getMessages']=function(_0x5a2d3e,_0x2990b2,_0x4382b5){var _0x193826={'raw':!![],'where':{}};var _0x102772={};var _0x64ddd8={'count':0x0,'rows':[]};return db[_0x3d2f('0x41')][_0x3d2f('0x6d')]({'where':{'id':_0x5a2d3e[_0x3d2f('0x60')]['id']}})['then'](handleEntityNotFound(_0x2990b2,null))[_0x3d2f('0x24')](function(_0xd46327){if(_0xd46327){_0x102772[_0x3d2f('0x49')]=_[_0x3d2f('0x47')](db[_0x3d2f('0x9b')]['rawAttributes']);_0x102772['query']=_[_0x3d2f('0x47')](_0x5a2d3e[_0x3d2f('0x46')]);_0x102772[_0x3d2f('0x51')]=_[_0x3d2f('0x48')](_0x102772[_0x3d2f('0x49')],_0x102772[_0x3d2f('0x46')]);_0x193826[_0x3d2f('0x4a')]=_[_0x3d2f('0x48')](_0x102772[_0x3d2f('0x49')],qs[_0x3d2f('0x4b')](_0x5a2d3e['query']['fields']));_0x193826['attributes']=_0x193826['attributes'][_0x3d2f('0x5c')]?_0x193826['attributes']:_0x102772[_0x3d2f('0x49')];if(!_0x5a2d3e[_0x3d2f('0x46')][_0x3d2f('0x4c')](_0x3d2f('0x4d'))){_0x193826[_0x3d2f('0x34')]=qs[_0x3d2f('0x34')](_0x5a2d3e['query'][_0x3d2f('0x34')]);_0x193826[_0x3d2f('0x33')]=qs[_0x3d2f('0x33')](_0x5a2d3e[_0x3d2f('0x46')][_0x3d2f('0x33')]);}_0x193826['order']=qs[_0x3d2f('0x4f')](_0x5a2d3e[_0x3d2f('0x46')]['sort']);_0x193826[_0x3d2f('0x50')]=qs['filters'](_['pick'](_0x5a2d3e[_0x3d2f('0x46')],_0x102772[_0x3d2f('0x51')]));_0x193826['where'][_0x3d2f('0x64')]=_0xd46327['id'];if(_0x5a2d3e[_0x3d2f('0x46')][_0x3d2f('0x52')]){_0x193826[_0x3d2f('0x50')]=_['merge'](_0x193826[_0x3d2f('0x50')],{'$or':_[_0x3d2f('0x45')](_0x193826['attributes'],function(_0x4757d1){var _0x35acdd={};_0x35acdd[_0x4757d1]={'$like':'%'+_0x5a2d3e[_0x3d2f('0x46')][_0x3d2f('0x52')]+'%'};return _0x35acdd;})});}if(_0x5a2d3e[_0x3d2f('0x46')][_0x3d2f('0x9c')]){var _0x2f9dd3=_0x5a2d3e['query'][_0x3d2f('0x9c')]['split'](',');var _0x562d41={};_0x562d41[_0x2f9dd3[0x0]]={'$gte':moment(_0x2f9dd3[0x1])[_0x3d2f('0x9d')](_0x3d2f('0x9e'))};_0x193826['where']=_['merge'](_0x193826[_0x3d2f('0x50')],_0x562d41);}_0x193826=_['merge']({},_0x193826,_0x5a2d3e[_0x3d2f('0x53')]);return db[_0x3d2f('0x9b')][_0x3d2f('0x54')]({'where':_0x193826[_0x3d2f('0x50')]})[_0x3d2f('0x24')](function(_0x5c9df3){_0x64ddd8[_0x3d2f('0x54')]=_0x5c9df3;if(_0x5a2d3e['query'][_0x3d2f('0x55')]){_0x193826[_0x3d2f('0x56')]=[{'all':!![]}];}return db[_0x3d2f('0x9b')][_0x3d2f('0x57')](_0x193826);})[_0x3d2f('0x24')](function(_0x40a592){_0x64ddd8[_0x3d2f('0x58')]=_0x40a592;return _0x64ddd8;});}})[_0x3d2f('0x24')](respondWithFilteredResult(_0x2990b2,_0x193826))[_0x3d2f('0x2e')](handleError(_0x2990b2,null));};exports[_0x3d2f('0x9f')]=function(_0x53384e,_0x4a3192,_0xc2a11d){var _0x208c4a,_0xd9666={},_0x563064;if(_0x53384e[_0x3d2f('0x5f')]['to']){_0x563064=_0x53384e[_0x3d2f('0x5f')]['to']['split'](',')[0x0];}return db['MailAccount'][_0x3d2f('0x5e')]({'where':{'id':_0x53384e[_0x3d2f('0x60')]['id']},'include':[{'model':db['CmList'],'as':_0x3d2f('0xa0'),'include':[{'model':db[_0x3d2f('0xa1')],'as':_0x3d2f('0xa2'),'where':{'email':_0x563064},'limit':0x1,'order':[[_0x3d2f('0xa3'),_0x3d2f('0xa4')]]}]},{'model':db[_0x3d2f('0x61')],'as':'Smtp','raw':!![]}]})[_0x3d2f('0x24')](handleEntityNotFound(_0x4a3192,null))[_0x3d2f('0x24')](function(_0x259744){if(_0x259744){_0x208c4a=_0x259744;if(_0x259744[_0x3d2f('0x40')]){if(_[_0x3d2f('0x71')](_0x53384e[_0x3d2f('0x5f')]['from'])){_0x53384e[_0x3d2f('0x5f')][_0x3d2f('0xa5')]=util[_0x3d2f('0x9d')](_0x3d2f('0xa6'),_0x259744[_0x3d2f('0x3e')],_0x259744[_0x3d2f('0x70')]||_0x259744[_0x3d2f('0x40')][_0x3d2f('0x76')]);}if(_0x53384e['body'][_0x3d2f('0xa7')]&&_0x53384e['body']['attachments'][_0x3d2f('0x5c')]){for(var _0x54a4a4=0x0;_0x54a4a4<_0x53384e[_0x3d2f('0x5f')][_0x3d2f('0xa7')][_0x3d2f('0x5c')];_0x54a4a4+=0x1){_0x53384e['body'][_0x3d2f('0xa7')][_0x54a4a4]={'filename':_0x53384e[_0x3d2f('0x5f')][_0x3d2f('0xa7')][_0x54a4a4][_0x3d2f('0x3e')],'path':path[_0x3d2f('0xa8')](config['root'],_0x3d2f('0xa9'),_0x53384e[_0x3d2f('0x5f')][_0x3d2f('0xa7')][_0x54a4a4][_0x3d2f('0xaa')])};}}var _0x5ab062={'tls':{'rejectUnauthorized':![]}};if(_[_0x3d2f('0x71')](_0x259744[_0x3d2f('0x40')][_0x3d2f('0x7c')])){if(_0x259744['Smtp'][_0x3d2f('0x79')]){_0x5ab062['auth']={'user':_0x259744[_0x3d2f('0x40')][_0x3d2f('0x76')],'pass':_0x259744[_0x3d2f('0x40')]['pass']};}_0x5ab062['host']=_0x259744[_0x3d2f('0x40')][_0x3d2f('0x7a')];_0x5ab062[_0x3d2f('0x7b')]=_0x259744[_0x3d2f('0x40')][_0x3d2f('0x7b')];_0x5ab062[_0x3d2f('0xab')]=_0x259744['Smtp'][_0x3d2f('0xab')];}else{_0x5ab062[_0x3d2f('0x7c')]=_0x259744[_0x3d2f('0x40')][_0x3d2f('0x7c')];_0x5ab062['auth']={'user':_0x259744[_0x3d2f('0x40')]['user'],'pass':_0x259744['Smtp'][_0x3d2f('0x7e')]};}return respondWithRpcPromise(_0x3d2f('0xac'),'sendMail',{'account':_0x5ab062,'message':_0x53384e[_0x3d2f('0x5f')]});}else{throw new Error(_0x3d2f('0xad'));}}})[_0x3d2f('0x24')](function(_0x4fa03f){if(_0x4fa03f){_0xd9666=_0x4fa03f;if(_0x208c4a[_0x3d2f('0xa0')]){if(_0x208c4a['List'][_0x3d2f('0xa2')][_0x3d2f('0x5c')]){return _0x208c4a['List'][_0x3d2f('0xa2')][0x0];}else{return db[_0x3d2f('0xa1')]['create'](_[_0x3d2f('0x1b')](_0x53384e['body'],{'firstName':_0x53384e[_0x3d2f('0x5f')]['to'],'email':_0x53384e[_0x3d2f('0x5f')]['to'],'phone':_0x53384e[_0x3d2f('0x5f')]['to'],'ListId':_0x208c4a[_0x3d2f('0xae')]}));}}else{throw new Error(_0x3d2f('0xad'));}}})[_0x3d2f('0x24')](function(_0x433267){if(_0x433267){var _0x3e4a45={'UserId':_0x53384e['user']['id'],'ContactId':_0x433267['id'],'MailAccountId':_0x208c4a['id'],'inReplyTo':_0xd9666[_0x3d2f('0xaf')],'to':_0x53384e[_0x3d2f('0x5f')][_0x3d2f('0xa5')],'cc':_0x53384e[_0x3d2f('0x5f')]['cc'],'subject':_0x53384e['body'][_0x3d2f('0xb0')],'attach':_0x53384e[_0x3d2f('0x5f')][_0x3d2f('0xb1')],'firstMsgDirection':_0x3d2f('0xb2'),'lastMsgAt':moment()[_0x3d2f('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x3d2f('0xb2'),'lastMsgBody':_0x53384e[_0x3d2f('0x5f')][_0x3d2f('0x5f')],'Messages':[_['merge'](_0x53384e[_0x3d2f('0x5f')],{'messageId':_0xd9666[_0x3d2f('0xaf')],'sentAt':moment()[_0x3d2f('0x9d')]('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x208c4a['id'],'UserId':_0x53384e['user']['id'],'ContactId':_0x433267['id']})]};if(_0x53384e[_0x3d2f('0x5f')][_0x3d2f('0xb3')]){_0x3e4a45=_[_0x3d2f('0x5d')](_0x3e4a45,_0x53384e[_0x3d2f('0x5f')]['Interaction']);}return db[_0x3d2f('0x8b')]['create'](_0x3e4a45,{'include':[{'model':db[_0x3d2f('0x9b')],'as':'Messages'}]});}})[_0x3d2f('0x24')](respondWithResult(_0x4a3192,null))[_0x3d2f('0x2e')](handleError(_0x4a3192,null));};exports[_0x3d2f('0xb4')]=function(_0xf7a427,_0x3ee21e,_0x34f5e4){return db[_0x3d2f('0x41')]['find']({'where':{'id':_0xf7a427[_0x3d2f('0x60')]['id']},'include':[{'model':db[_0x3d2f('0x61')],'as':'Smtp','raw':!![]}]})['then'](handleEntityNotFound(_0x3ee21e,null))[_0x3d2f('0x24')](function(_0x3b1be0){if(_0x3b1be0&&_0x3b1be0[_0x3d2f('0x40')]){var _0x1bec3a={'id':_0x3b1be0['id'],'tls':{'rejectUnauthorized':![]}};if(_0x3b1be0['Smtp'][_0x3d2f('0x7c')]){_0x1bec3a[_0x3d2f('0x7c')]=_0x3b1be0[_0x3d2f('0x40')][_0x3d2f('0x7c')];}else{_0x1bec3a['host']=_0x3b1be0[_0x3d2f('0x40')][_0x3d2f('0x7a')];_0x1bec3a[_0x3d2f('0x7b')]=_0x3b1be0[_0x3d2f('0x40')]['port'];_0x1bec3a[_0x3d2f('0xab')]=_0x3b1be0['Smtp'][_0x3d2f('0xab')];}if(_0x3b1be0[_0x3d2f('0x40')]['authentication']){_0x1bec3a['auth']={'user':_0x3b1be0['Smtp']['user'],'pass':_0x3b1be0[_0x3d2f('0x40')][_0x3d2f('0x7e')]};}return respondWithRpcPromise(_0x3d2f('0xb5'),_0x3d2f('0xb4'),{'account':_0x1bec3a});}})['then'](respondWithResult(_0x3ee21e,null))['catch'](handleError(_0x3ee21e,null));};exports[_0x3d2f('0x3c')]=function(_0x6f5731,_0x2128fd){return db[_0x3d2f('0x41')]['find']({'where':{'id':_0x6f5731[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x2128fd,null))[_0x3d2f('0x24')](function(_0x258684){if(_0x258684&&_0x258684[_0x3d2f('0x7c')]){throw new db[(_0x3d2f('0xb6'))]['ValidationError'](_0x3d2f('0xb7'));}return _0x258684;})[_0x3d2f('0x24')](removeEntity(_0x2128fd,null))[_0x3d2f('0x2e')](handleError(_0x2128fd,null));};exports[_0x3d2f('0xb8')]=function(_0x517faa,_0x25d33b,_0x39103e){return db['MailAccount'][_0x3d2f('0x5e')]({'where':{'id':_0x517faa[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x25d33b,null))[_0x3d2f('0x24')](function(_0x1c5a22){if(_0x1c5a22){return _0x1c5a22[_0x3d2f('0xb8')](_0x517faa[_0x3d2f('0x5f')]['ids'],_[_0x3d2f('0x8c')](_0x517faa[_0x3d2f('0x5f')],['ids','id'])||{})['spread'](function(_0x2777e5){for(var _0x611ff6=0x0;_0x611ff6<_0x517faa['body'][_0x3d2f('0x6a')]['length'];_0x611ff6+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x517faa[_0x3d2f('0x5f')][_0x3d2f('0x6a')][_0x611ff6],'MailAccountId':_0x517faa[_0x3d2f('0x60')]['id']});}return _0x2777e5;});}})['then'](respondWithResult(_0x25d33b,null))['catch'](handleError(_0x25d33b,null));};exports[_0x3d2f('0xb9')]=function(_0x3e962a,_0x39a699,_0x3cb699){return db[_0x3d2f('0x41')]['find']({'where':{'id':_0x3e962a[_0x3d2f('0x60')]['id']}})[_0x3d2f('0x24')](handleEntityNotFound(_0x39a699,null))[_0x3d2f('0x24')](function(_0xf8d080){if(_0xf8d080){return _0xf8d080[_0x3d2f('0xb9')](_0x3e962a[_0x3d2f('0x46')][_0x3d2f('0x6a')])['then'](function(){if(_[_0x3d2f('0xba')](_0x3e962a[_0x3d2f('0x46')][_0x3d2f('0x6a')])){for(var _0x4967cd=0x0;_0x4967cd<_0x3e962a[_0x3d2f('0x46')][_0x3d2f('0x6a')]['length'];_0x4967cd+=0x1){socket[_0x3d2f('0xbb')](_0x3d2f('0xbc'),{'UserId':Number(_0x3e962a[_0x3d2f('0x46')]['ids'][_0x4967cd]),'MailAccountId':Number(_0x3e962a[_0x3d2f('0x60')]['id'])});}}else{socket[_0x3d2f('0xbb')](_0x3d2f('0xbc'),{'UserId':Number(_0x3e962a[_0x3d2f('0x46')][_0x3d2f('0x6a')]),'MailAccountId':Number(_0x3e962a[_0x3d2f('0x60')]['id'])});}});}})[_0x3d2f('0x24')](respondWithStatusCode(_0x39a699,null))[_0x3d2f('0x2e')](handleError(_0x39a699,null));};exports[_0x3d2f('0xbd')]=function(_0x3cae88,_0x1eb488,_0x4d3cc6){var _0x3e9cdb={};var _0x5a1273={};var _0x50cfe3;var _0x1a83fe;return db[_0x3d2f('0x41')][_0x3d2f('0x6d')]({'where':{'id':_0x3cae88['params']['id']}})['then'](handleEntityNotFound(_0x1eb488,null))['then'](function(_0xbd74dc){if(_0xbd74dc){_0x50cfe3=_0xbd74dc;_0x5a1273[_0x3d2f('0x49')]=_['keys'](db[_0x3d2f('0xbe')][_0x3d2f('0x67')]);_0x5a1273[_0x3d2f('0x46')]=_[_0x3d2f('0x47')](_0x3cae88[_0x3d2f('0x46')]);_0x5a1273[_0x3d2f('0x51')]=_[_0x3d2f('0x48')](_0x5a1273[_0x3d2f('0x49')],_0x5a1273[_0x3d2f('0x46')]);_0x3e9cdb[_0x3d2f('0x4a')]=_['intersection'](_0x5a1273[_0x3d2f('0x49')],qs[_0x3d2f('0x4b')](_0x3cae88[_0x3d2f('0x46')][_0x3d2f('0x4b')]));_0x3e9cdb[_0x3d2f('0x4a')]=_0x3e9cdb['attributes'][_0x3d2f('0x5c')]?_0x3e9cdb[_0x3d2f('0x4a')]:_0x5a1273[_0x3d2f('0x49')];_0x3e9cdb['order']=qs[_0x3d2f('0x4f')](_0x3cae88[_0x3d2f('0x46')][_0x3d2f('0x4f')]);_0x3e9cdb[_0x3d2f('0x50')]=qs['filters'](_[_0x3d2f('0x68')](_0x3cae88['query'],_0x5a1273[_0x3d2f('0x51')]));if(_0x3cae88[_0x3d2f('0x46')]['filter']){_0x3e9cdb['where']=_[_0x3d2f('0x5d')](_0x3e9cdb[_0x3d2f('0x50')],{'$or':_[_0x3d2f('0x45')](_0x3e9cdb[_0x3d2f('0x4a')],function(_0xfc0017){var _0x588de2={};_0x588de2[_0xfc0017]={'$like':'%'+_0x3cae88[_0x3d2f('0x46')][_0x3d2f('0x52')]+'%'};return _0x588de2;})});}_0x3e9cdb=_[_0x3d2f('0x5d')]({},_0x3e9cdb,_0x3cae88[_0x3d2f('0x53')]);return _0x50cfe3[_0x3d2f('0xbd')](_0x3e9cdb);}})[_0x3d2f('0x24')](function(_0x2d03b5){if(_0x2d03b5){_0x1a83fe=_0x2d03b5[_0x3d2f('0x5c')];if(!_0x3cae88['query'][_0x3d2f('0x4c')](_0x3d2f('0x4d'))){_0x3e9cdb[_0x3d2f('0x34')]=qs['limit'](_0x3cae88[_0x3d2f('0x46')]['limit']);_0x3e9cdb['offset']=qs[_0x3d2f('0x33')](_0x3cae88[_0x3d2f('0x46')][_0x3d2f('0x33')]);}return _0x50cfe3['getAgents'](_0x3e9cdb);}})[_0x3d2f('0x24')](function(_0xc65f80){if(_0xc65f80){return _0xc65f80?{'count':_0x1a83fe,'rows':_0xc65f80}:null;}})[_0x3d2f('0x24')](respondWithResult(_0x1eb488,null))[_0x3d2f('0x2e')](handleError(_0x1eb488,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 7233197..433566e 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 _0xf036=['hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','remove','emit'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0xf036,0xbb));var _0x6f03=function(_0x4fd162,_0xfa634e){_0x4fd162=_0x4fd162-0x0;var _0x292aa5=_0xf036[_0x4fd162];return _0x292aa5;};'use strict';var EventEmitter=require(_0x6f03('0x0'));var MailAccount=require(_0x6f03('0x1'))['db'][_0x6f03('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x6f03('0x3')};function emitEvent(_0x2d3448){return function(_0x3ab249,_0x3f8fcc,_0x44bf6c){MailAccountEvents[_0x6f03('0x4')](_0x2d3448+':'+_0x3ab249['id'],_0x3ab249);MailAccountEvents[_0x6f03('0x4')](_0x2d3448,_0x3ab249);_0x44bf6c(null);};}for(var e in events){if(events[_0x6f03('0x5')](e)){var event=events[e];MailAccount[_0x6f03('0x6')](e,emitEvent(event));}}module[_0x6f03('0x7')]=MailAccountEvents; \ No newline at end of file +var _0x97ab=['exports','events','../../mysqldb','MailAccount','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3eed3f,_0x5253b5){var _0xd68fd8=function(_0x3395c4){while(--_0x3395c4){_0x3eed3f['push'](_0x3eed3f['shift']());}};_0xd68fd8(++_0x5253b5);}(_0x97ab,0x15f));var _0xb97a=function(_0x9c96c7,_0x25b025){_0x9c96c7=_0x9c96c7-0x0;var _0x5011f3=_0x97ab[_0x9c96c7];return _0x5011f3;};'use strict';var EventEmitter=require(_0xb97a('0x0'));var MailAccount=require(_0xb97a('0x1'))['db'][_0xb97a('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xb97a('0x3')](0x0);var events={'afterCreate':_0xb97a('0x4'),'afterUpdate':_0xb97a('0x5'),'afterDestroy':_0xb97a('0x6')};function emitEvent(_0x2d22e3){return function(_0x14a20b,_0x513a02,_0x1795a2){MailAccountEvents[_0xb97a('0x7')](_0x2d22e3+':'+_0x14a20b['id'],_0x14a20b);MailAccountEvents[_0xb97a('0x7')](_0x2d22e3,_0x14a20b);_0x1795a2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xb97a('0x8')](e,emitEvent(event));}}module[_0xb97a('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 6790ed6..1575261 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 _0x0922=['exports','MailAccount','lodash','util','../../config/logger','api','bluebird','request-promise','./mailAccount.attributes'];(function(_0x25b439,_0xb20872){var _0xbf2210=function(_0x518b01){while(--_0x518b01){_0x25b439['push'](_0x25b439['shift']());}};_0xbf2210(++_0xb20872);}(_0x0922,0x77));var _0x2092=function(_0x57975f,_0x388556){_0x57975f=_0x57975f-0x0;var _0x4793b8=_0x0922[_0x57975f];return _0x4793b8;};'use strict';var _=require(_0x2092('0x0'));var util=require(_0x2092('0x1'));var logger=require(_0x2092('0x2'))(_0x2092('0x3'));var moment=require('moment');var BPromise=require(_0x2092('0x4'));var rp=require(_0x2092('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x2092('0x6'));module[_0x2092('0x7')]=function(_0x40aebe,_0x14fab7){return _0x40aebe['define'](_0x2092('0x8'),attributes,{'tableName':'mail_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x98a7=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','lodash','util'];(function(_0x305bbf,_0x5647b3){var _0x4ed772=function(_0x3315ed){while(--_0x3315ed){_0x305bbf['push'](_0x305bbf['shift']());}};_0x4ed772(++_0x5647b3);}(_0x98a7,0x116));var _0x798a=function(_0x7b021a,_0x25af9a){_0x7b021a=_0x7b021a-0x0;var _0x4699f0=_0x98a7[_0x7b021a];return _0x4699f0;};'use strict';var _=require(_0x798a('0x0'));var util=require(_0x798a('0x1'));var logger=require(_0x798a('0x2'))(_0x798a('0x3'));var moment=require(_0x798a('0x4'));var BPromise=require(_0x798a('0x5'));var rp=require(_0x798a('0x6'));var fs=require('fs');var path=require(_0x798a('0x7'));var rimraf=require(_0x798a('0x8'));var config=require('../../config/environment');var attributes=require(_0x798a('0x9'));module[_0x798a('0xa')]=function(_0x40878e,_0x10133b){return _0x40878e[_0x798a('0xb')](_0x798a('0xc'),attributes,{'tableName':_0x798a('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 41157dc..8054e40 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 _0x2a41=['name','agent','Start','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./mailAccount.socket','register','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','GetMailAccount','findAll','options','raw','where','attributes','include','model','stringify','MailAccount','find','map','ShowMailAccount','NotifyMailAccount','body','mail','difference','CmContact','rawAttributes','createdAt','updatedAt','CompanyId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','account','DESC','MailApplication','Applications','MailServerOut','List','omit','list','orderBy','applications','asc','autoclose','push','length','*,*,*,*','Contacts','defaults','ListId','List\x20not\x20found','contact','messageId','subject','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','create','spread','update','attach','format','get','interaction','created','originTo','originCc','bcc','Attachment','Attachments','UserId','User'];(function(_0x32b2d1,_0xa0b952){var _0x32a019=function(_0x3b2600){while(--_0x3b2600){_0x32b2d1['push'](_0x32b2d1['shift']());}};_0x32a019(++_0xa0b952);}(_0x2a41,0x126));var _0x12a4=function(_0x52eceb,_0x400bb4){_0x52eceb=_0x52eceb-0x0;var _0x415694=_0x2a41[_0x52eceb];return _0x415694;};'use strict';var _=require(_0x12a4('0x0'));var util=require('util');var moment=require(_0x12a4('0x1'));var BPromise=require(_0x12a4('0x2'));var rs=require(_0x12a4('0x3'));var fs=require('fs');var Redis=require(_0x12a4('0x4'));var db=require(_0x12a4('0x5'))['db'];var utils=require(_0x12a4('0x6'));var logger=require(_0x12a4('0x7'))(_0x12a4('0x8'));var config=require(_0x12a4('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x12a4('0xa')][_0x12a4('0xb')]({'port':0x232c});config['redis']=_['defaults'](config[_0x12a4('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x12a4('0xd'))(new Redis(config[_0x12a4('0xc')]));require(_0x12a4('0xe'))[_0x12a4('0xf')](socket);function respondWithRpcPromise(_0x3d8beb,_0x4cf5eb,_0x3cc61a){return new BPromise(function(_0x64149a,_0xcf8f96){return client[_0x12a4('0x10')](_0x3d8beb,_0x3cc61a)[_0x12a4('0x11')](function(_0x301953){logger[_0x12a4('0x12')](_0x12a4('0x13'),_0x4cf5eb,_0x12a4('0x14'));logger[_0x12a4('0x15')](_0x12a4('0x16'),_0x4cf5eb,_0x12a4('0x14'),JSON['stringify'](_0x301953));if(_0x301953[_0x12a4('0x17')]){if(_0x301953[_0x12a4('0x17')][_0x12a4('0x18')]===0x1f4){logger[_0x12a4('0x17')](_0x12a4('0x13'),_0x4cf5eb,_0x301953['error']['message']);return _0xcf8f96(_0x301953[_0x12a4('0x17')][_0x12a4('0x19')]);}logger[_0x12a4('0x17')](_0x12a4('0x13'),_0x4cf5eb,_0x301953['error'][_0x12a4('0x19')]);return _0x64149a(_0x301953[_0x12a4('0x17')][_0x12a4('0x19')]);}else{logger[_0x12a4('0x12')](_0x12a4('0x13'),_0x4cf5eb,_0x12a4('0x14'));_0x64149a(_0x301953['result'][_0x12a4('0x19')]);}})[_0x12a4('0x1a')](function(_0x3a3328){logger['error']('MailAccount,\x20%s,\x20%s',_0x4cf5eb,_0x3a3328);_0xcf8f96(_0x3a3328);});});}exports[_0x12a4('0x1b')]=function(_0x68998e){var _0x58fab0=this;return new Promise(function(_0x2c026e,_0x1a35d3){return db['MailAccount'][_0x12a4('0x1c')]({'raw':_0x68998e['options']?_0x68998e[_0x12a4('0x1d')][_0x12a4('0x1e')]===undefined?!![]:![]:!![],'where':_0x68998e[_0x12a4('0x1d')]?_0x68998e[_0x12a4('0x1d')][_0x12a4('0x1f')]||null:null,'attributes':_0x68998e['options']?_0x68998e[_0x12a4('0x1d')][_0x12a4('0x20')]||null:null,'limit':_0x68998e[_0x12a4('0x1d')]?_0x68998e[_0x12a4('0x1d')]['limit']||null:null,'include':_0x68998e[_0x12a4('0x1d')]?_0x68998e[_0x12a4('0x1d')][_0x12a4('0x21')]?_['map'](_0x68998e[_0x12a4('0x1d')][_0x12a4('0x21')],function(_0x5950fe){return{'model':db[_0x5950fe[_0x12a4('0x22')]],'as':_0x5950fe['as'],'attributes':_0x5950fe[_0x12a4('0x20')],'include':_0x5950fe['include']?_['map'](_0x5950fe['include'],function(_0x41e832){return{'model':db[_0x41e832[_0x12a4('0x22')]],'as':_0x41e832['as'],'attributes':_0x41e832[_0x12a4('0x20')],'include':_0x41e832[_0x12a4('0x21')]?_['map'](_0x41e832[_0x12a4('0x21')],function(_0x56c3da){return{'model':db[_0x56c3da[_0x12a4('0x22')]],'as':_0x56c3da['as'],'attributes':_0x56c3da[_0x12a4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x12a4('0x11')](function(_0x15adb7){logger['info'](_0x12a4('0x1b'),_0x68998e);logger[_0x12a4('0x15')]('GetMailAccount',_0x68998e,JSON[_0x12a4('0x23')](_0x15adb7));_0x2c026e(_0x15adb7);})['catch'](function(_0x36edf3){logger[_0x12a4('0x17')]('GetMailAccount',_0x36edf3[_0x12a4('0x19')],_0x68998e);_0x1a35d3(_0x58fab0[_0x12a4('0x17')](0x1f4,_0x36edf3[_0x12a4('0x19')]));});});};exports['ShowMailAccount']=function(_0x2bd2db){var _0x547a94=this;return new Promise(function(_0x1fd988,_0x436960){return db[_0x12a4('0x24')][_0x12a4('0x25')]({'raw':_0x2bd2db[_0x12a4('0x1d')]?_0x2bd2db[_0x12a4('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x2bd2db[_0x12a4('0x1d')]?_0x2bd2db[_0x12a4('0x1d')][_0x12a4('0x1f')]||null:null,'attributes':_0x2bd2db['options']?_0x2bd2db['options'][_0x12a4('0x20')]||null:null,'include':_0x2bd2db['options']?_0x2bd2db[_0x12a4('0x1d')][_0x12a4('0x21')]?_['map'](_0x2bd2db[_0x12a4('0x1d')][_0x12a4('0x21')],function(_0xd5574d){return{'model':db[_0xd5574d[_0x12a4('0x22')]],'as':_0xd5574d['as'],'attributes':_0xd5574d['attributes'],'include':_0xd5574d[_0x12a4('0x21')]?_[_0x12a4('0x26')](_0xd5574d[_0x12a4('0x21')],function(_0xa1a00e){return{'model':db[_0xa1a00e[_0x12a4('0x22')]],'as':_0xa1a00e['as'],'attributes':_0xa1a00e['attributes'],'include':_0xa1a00e['include']?_[_0x12a4('0x26')](_0xa1a00e['include'],function(_0x2c21dd){return{'model':db[_0x2c21dd[_0x12a4('0x22')]],'as':_0x2c21dd['as'],'attributes':_0x2c21dd[_0x12a4('0x20')]};}):[]};}):[]};}):[]:[]})[_0x12a4('0x11')](function(_0x2323cc){logger[_0x12a4('0x12')](_0x12a4('0x27'),_0x2bd2db);logger[_0x12a4('0x15')](_0x12a4('0x27'),_0x2bd2db,JSON[_0x12a4('0x23')](_0x2323cc));_0x1fd988(_0x2323cc);})['catch'](function(_0x5c1f75){logger['error'](_0x12a4('0x27'),_0x5c1f75[_0x12a4('0x19')],_0x2bd2db);_0x436960(_0x547a94['error'](0x1f4,_0x5c1f75[_0x12a4('0x19')]));});});};exports[_0x12a4('0x28')]=function(_0x487d89){var _0x403f28=this;return new Promise(function(_0x146713,_0x144607){var _0x45914e={'body':_0x487d89[_0x12a4('0x29')],'channel':_0x12a4('0x2a')};var _0x4b2a8d=_[_0x12a4('0x2b')](_['keys'](db[_0x12a4('0x2c')][_0x12a4('0x2d')]),[_0x12a4('0x2e'),_0x12a4('0x2f'),_0x12a4('0x30'),'ListId']);var _0x3c315c=![];if(_0x487d89[_0x12a4('0x29')]['id']){delete _0x487d89[_0x12a4('0x29')]['id'];}if(_[_0x12a4('0x31')](_0x487d89[_0x12a4('0x29')][_0x12a4('0x32')])){return _0x144607(_0x403f28[_0x12a4('0x17')](0x1f4,'from\x20is\x20mandatory'));}if(_[_0x12a4('0x31')](_0x487d89[_0x12a4('0x29')][_0x12a4('0x29')])||_0x487d89[_0x12a4('0x29')][_0x12a4('0x29')]===''){return _0x144607(_0x403f28[_0x12a4('0x17')](0x1f4,_0x12a4('0x33')));}if(_[_0x12a4('0x31')](_0x487d89[_0x12a4('0x29')][_0x12a4('0x34')])){return _0x144607(_0x403f28[_0x12a4('0x17')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b2a8d));}if(!_[_0x12a4('0x35')](_0x4b2a8d,_0x487d89[_0x12a4('0x29')][_0x12a4('0x34')])){return _0x144607(_0x403f28['error'](0x1f4,'mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x4b2a8d));}var _0x9e8719={};_0x9e8719[_0x487d89[_0x12a4('0x29')][_0x12a4('0x34')]]=_0x487d89['body'][_0x12a4('0x32')];return db[_0x12a4('0x24')][_0x12a4('0x25')]({'where':{'id':_0x487d89[_0x12a4('0x36')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x9e8719,'limit':0x1,'order':[[_0x12a4('0x2f'),_0x12a4('0x37')]]}]},{'model':db[_0x12a4('0x38')],'as':_0x12a4('0x39')},{'model':db[_0x12a4('0x3a')],'as':'Smtp'}]})[_0x12a4('0x11')](function(_0x2342d6){if(_0x2342d6&&_0x2342d6[_0x12a4('0x3b')]){var _0x5119b2=_0x2342d6['get']({'plain':!![]});_0x45914e[_0x12a4('0x36')]=_[_0x12a4('0x3c')](_0x5119b2,['Applications','List']);_0x45914e['applications']=_0x5119b2[_0x12a4('0x39')];_0x45914e[_0x12a4('0x3d')]=_0x5119b2[_0x12a4('0x3b')];_0x45914e['applications']=_[_0x12a4('0x3e')](_0x45914e[_0x12a4('0x3f')],['priority'],[_0x12a4('0x40')]);if(_0x45914e[_0x12a4('0x36')]&&_0x45914e[_0x12a4('0x36')][_0x12a4('0x41')]){_0x45914e[_0x12a4('0x3f')][_0x12a4('0x42')]({'id':0x0,'priority':_0x45914e['applications'][_0x12a4('0x43')]+0x1,'app':'close','appdata':_0x12a4('0x41'),'interval':_0x12a4('0x44')});}if(_0x45914e[_0x12a4('0x36')][_0x12a4('0x39')]){delete _0x45914e[_0x12a4('0x36')][_0x12a4('0x39')];}if(_0x45914e[_0x12a4('0x36')]['List']){delete _0x45914e[_0x12a4('0x36')][_0x12a4('0x3b')];}if(_0x5119b2[_0x12a4('0x3b')][_0x12a4('0x45')][_0x12a4('0x43')]){return _0x5119b2[_0x12a4('0x3b')][_0x12a4('0x45')][0x0];}var _0x3521cb=_[_0x12a4('0x46')](_0x487d89[_0x12a4('0x29')],{'firstName':_0x487d89[_0x12a4('0x29')][_0x12a4('0x32')],'ListId':_0x5119b2[_0x12a4('0x47')]});_0x3521cb[_0x487d89['body'][_0x12a4('0x34')]]=_0x487d89[_0x12a4('0x29')][_0x12a4('0x32')];return db[_0x12a4('0x2c')]['create'](_0x3521cb);}else{throw new Error(_0x12a4('0x48'));}})['then'](function(_0x36c1d7){_0x45914e[_0x12a4('0x49')]=_0x36c1d7;if(_0x36c1d7){if(!_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x4a')]){_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x4a')]=rs['generate']()+'\x20'+_0x487d89[_0x12a4('0x29')]['message'][_0x12a4('0x32')];}var _0x1c5e82={'ContactId':_0x36c1d7['id'],'MailAccountId':_0x487d89[_0x12a4('0x36')]['id'],'inReplyTo':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x4a')],'to':_0x487d89[_0x12a4('0x29')]['message'][_0x12a4('0x32')],'cc':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')]['cc'],'subject':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x4b')],'attach':_0x487d89['body'][_0x12a4('0x19')]['attach'],'lastMsgAt':moment()['format'](_0x12a4('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x487d89[_0x12a4('0x29')][_0x12a4('0x29')]};return db[_0x12a4('0x4d')]['find']({'where':{'closed':![],'MailAccountId':_0x487d89[_0x12a4('0x36')]['id']},'include':[{'model':db[_0x12a4('0x4e')],'as':'Messages','attributes':[_0x12a4('0x4a')],'where':{'messageId':_0x487d89[_0x12a4('0x29')]['message']['inReplyTo']}}]})[_0x12a4('0x11')](function(_0x49ee5b){if(_0x49ee5b){return[_0x49ee5b,![]];}return db[_0x12a4('0x4d')][_0x12a4('0x4f')](_0x1c5e82)['then'](function(_0x3a07c1){return[_0x3a07c1,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x12a4('0x50')](function(_0x573f5c,_0x35653b){if(_0x573f5c){_0x3c315c=_0x35653b;if(!_0x35653b){return _0x573f5c[_0x12a4('0x51')]({'inReplyTo':_0x487d89[_0x12a4('0x29')]['message'][_0x12a4('0x4a')],'to':_0x487d89['body'][_0x12a4('0x19')]['from'],'cc':_0x487d89[_0x12a4('0x29')]['message']['cc'],'subject':_0x487d89[_0x12a4('0x29')]['message'][_0x12a4('0x4b')],'attach':_0x573f5c[_0x12a4('0x52')]?_0x573f5c[_0x12a4('0x52')]:_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')]['attach'],'substatus':null,'substatusAt':moment()[_0x12a4('0x53')](_0x12a4('0x4c')),'lastMsgAt':moment()[_0x12a4('0x53')](_0x12a4('0x4c')),'lastMsgDirection':'in','lastMsgBody':_0x487d89[_0x12a4('0x29')]['body']});}else{return _0x573f5c;}}})[_0x12a4('0x11')](function(_0x1bbc6e){_0x45914e['interaction']=_0x1bbc6e[_0x12a4('0x54')]({'plain':!![]});_0x45914e[_0x12a4('0x55')][_0x12a4('0x56')]=_0x3c315c;return db[_0x12a4('0x4e')][_0x12a4('0x4f')]({'body':_0x487d89[_0x12a4('0x29')]['body'],'MailAccountId':_0x487d89[_0x12a4('0x36')]['id'],'MailInteractionId':_0x1bbc6e['id'],'direction':'in','ContactId':_0x45914e[_0x12a4('0x49')]['id'],'messageId':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x4a')],'from':_0x487d89['body'][_0x12a4('0x19')]['from'],'to':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')]['to'],'cc':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')]['cc'],'subject':_0x487d89['body'][_0x12a4('0x19')][_0x12a4('0x4b')],'attach':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x52')],'Attachments':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')]['attachments'],'originTo':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x57')],'originCc':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x58')],'bcc':_0x487d89[_0x12a4('0x29')][_0x12a4('0x19')][_0x12a4('0x59')]},{'include':[{'model':db[_0x12a4('0x5a')],'as':_0x12a4('0x5b')}]});})[_0x12a4('0x11')](function(_0x3bc709){_0x45914e[_0x12a4('0x19')]=_0x3bc709;if(_0x45914e['interaction'][_0x12a4('0x5c')]){return db[_0x12a4('0x5d')][_0x12a4('0x25')]({'attributes':['id',_0x12a4('0x5e')],'where':{'id':_0x45914e['interaction']['UserId']}})['then'](function(_0x5cc631){if(_0x5cc631){_0x45914e[_0x12a4('0x3f')]['unshift']({'id':0x0,'priority':0x0,'app':_0x12a4('0x5f'),'appdata':_0x5cc631[_0x12a4('0x5e')]+','+(_0x45914e['account']['waitForTheAssignedAgent']||0xa),'interval':_0x12a4('0x44')});}return respondWithRpcPromise(_0x12a4('0x60'),'startRouting',_0x45914e);});}return respondWithRpcPromise(_0x12a4('0x60'),'startRouting',_0x45914e);})[_0x12a4('0x11')](function(_0x15ac6e){_0x146713(_0x15ac6e);})[_0x12a4('0x1a')](function(_0x2971f4){_0x144607(_0x403f28['error'](0x1f4,_0x2971f4['message']));});});}; \ No newline at end of file +var _0x668b=['Messages','inReplyTo','Contact\x20not\x20found','update','subject','attach','interaction','MailMessage','attachments','originTo','originCc','bcc','UserId','User','unshift','agent','name','waitForTheAssignedAgent','*,*,*,*','startRouting','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailAccount','MailAccount','findAll','options','attributes','limit','include','map','model','ShowMailAccount','find','raw','where','NotifyMailAccount','mail','difference','keys','CmContact','createdAt','updatedAt','ListId','body','body\x20is\x20mandatory\x20and\x20not\x20empty','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','account','CmList','Contacts','DESC','Smtp','List','get','omit','Applications','applications','list','orderBy','priority','asc','autoclose','length','close','create','List\x20not\x20found','contact','messageId','generate','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction'];(function(_0x4152fb,_0x382ecb){var _0x53b04d=function(_0x500c33){while(--_0x500c33){_0x4152fb['push'](_0x4152fb['shift']());}};_0x53b04d(++_0x382ecb);}(_0x668b,0x140));var _0xb668=function(_0x220dbb,_0x99328d){_0x220dbb=_0x220dbb-0x0;var _0x2b77de=_0x668b[_0x220dbb];return _0x2b77de;};'use strict';var _=require(_0xb668('0x0'));var util=require(_0xb668('0x1'));var moment=require('moment');var BPromise=require(_0xb668('0x2'));var rs=require(_0xb668('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb668('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xb668('0x5'))(_0xb668('0x6'));var config=require(_0xb668('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb668('0x8')][_0xb668('0x9')]({'port':0x232c});config[_0xb668('0xa')]=_[_0xb668('0xb')](config[_0xb668('0xa')],{'host':_0xb668('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb668('0xa')]));require(_0xb668('0xd'))[_0xb668('0xe')](socket);function respondWithRpcPromise(_0x16d50d,_0x39b79c,_0x3606a7){return new BPromise(function(_0x45bc39,_0x3616e9){return client['request'](_0x16d50d,_0x3606a7)[_0xb668('0xf')](function(_0x27dbf7){logger[_0xb668('0x10')](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));logger[_0xb668('0x13')](_0xb668('0x14'),_0x39b79c,_0xb668('0x12'),JSON[_0xb668('0x15')](_0x27dbf7));if(_0x27dbf7[_0xb668('0x16')]){if(_0x27dbf7[_0xb668('0x16')][_0xb668('0x17')]===0x1f4){logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x3616e9(_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);}logger[_0xb668('0x16')](_0xb668('0x11'),_0x39b79c,_0x27dbf7[_0xb668('0x16')][_0xb668('0x18')]);return _0x45bc39(_0x27dbf7['error'][_0xb668('0x18')]);}else{logger['info'](_0xb668('0x11'),_0x39b79c,_0xb668('0x12'));_0x45bc39(_0x27dbf7['result'][_0xb668('0x18')]);}})[_0xb668('0x19')](function(_0x53ff78){logger[_0xb668('0x16')]('MailAccount,\x20%s,\x20%s',_0x39b79c,_0x53ff78);_0x3616e9(_0x53ff78);});});}exports[_0xb668('0x1a')]=function(_0x178a5d){var _0x253ba5=this;return new Promise(function(_0x12805a,_0x5d33ae){return db[_0xb668('0x1b')][_0xb668('0x1c')]({'raw':_0x178a5d[_0xb668('0x1d')]?_0x178a5d['options']['raw']===undefined?!![]:![]:!![],'where':_0x178a5d[_0xb668('0x1d')]?_0x178a5d[_0xb668('0x1d')]['where']||null:null,'attributes':_0x178a5d[_0xb668('0x1d')]?_0x178a5d['options'][_0xb668('0x1e')]||null:null,'limit':_0x178a5d['options']?_0x178a5d[_0xb668('0x1d')][_0xb668('0x1f')]||null:null,'include':_0x178a5d[_0xb668('0x1d')]?_0x178a5d[_0xb668('0x1d')][_0xb668('0x20')]?_[_0xb668('0x21')](_0x178a5d['options'][_0xb668('0x20')],function(_0x10d767){return{'model':db[_0x10d767[_0xb668('0x22')]],'as':_0x10d767['as'],'attributes':_0x10d767['attributes'],'include':_0x10d767['include']?_[_0xb668('0x21')](_0x10d767[_0xb668('0x20')],function(_0x30b965){return{'model':db[_0x30b965['model']],'as':_0x30b965['as'],'attributes':_0x30b965[_0xb668('0x1e')],'include':_0x30b965[_0xb668('0x20')]?_[_0xb668('0x21')](_0x30b965['include'],function(_0x5709e2){return{'model':db[_0x5709e2[_0xb668('0x22')]],'as':_0x5709e2['as'],'attributes':_0x5709e2[_0xb668('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e5857){logger[_0xb668('0x10')](_0xb668('0x1a'),_0x178a5d);logger[_0xb668('0x13')](_0xb668('0x1a'),_0x178a5d,JSON['stringify'](_0x2e5857));_0x12805a(_0x2e5857);})[_0xb668('0x19')](function(_0x3bd27c){logger['error'](_0xb668('0x1a'),_0x3bd27c['message'],_0x178a5d);_0x5d33ae(_0x253ba5[_0xb668('0x16')](0x1f4,_0x3bd27c[_0xb668('0x18')]));});});};exports[_0xb668('0x23')]=function(_0x3ddd5d){var _0x2e40dd=this;return new Promise(function(_0x655536,_0x1c6dd7){return db[_0xb668('0x1b')][_0xb668('0x24')]({'raw':_0x3ddd5d['options']?_0x3ddd5d[_0xb668('0x1d')][_0xb668('0x25')]===undefined?!![]:![]:!![],'where':_0x3ddd5d[_0xb668('0x1d')]?_0x3ddd5d['options'][_0xb668('0x26')]||null:null,'attributes':_0x3ddd5d[_0xb668('0x1d')]?_0x3ddd5d[_0xb668('0x1d')][_0xb668('0x1e')]||null:null,'include':_0x3ddd5d['options']?_0x3ddd5d[_0xb668('0x1d')][_0xb668('0x20')]?_[_0xb668('0x21')](_0x3ddd5d[_0xb668('0x1d')][_0xb668('0x20')],function(_0xe10c43){return{'model':db[_0xe10c43[_0xb668('0x22')]],'as':_0xe10c43['as'],'attributes':_0xe10c43['attributes'],'include':_0xe10c43[_0xb668('0x20')]?_[_0xb668('0x21')](_0xe10c43['include'],function(_0xede795){return{'model':db[_0xede795['model']],'as':_0xede795['as'],'attributes':_0xede795['attributes'],'include':_0xede795[_0xb668('0x20')]?_[_0xb668('0x21')](_0xede795['include'],function(_0x1d7cda){return{'model':db[_0x1d7cda['model']],'as':_0x1d7cda['as'],'attributes':_0x1d7cda[_0xb668('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c7a4f){logger[_0xb668('0x10')](_0xb668('0x23'),_0x3ddd5d);logger['debug']('ShowMailAccount',_0x3ddd5d,JSON[_0xb668('0x15')](_0x4c7a4f));_0x655536(_0x4c7a4f);})[_0xb668('0x19')](function(_0x198591){logger[_0xb668('0x16')](_0xb668('0x23'),_0x198591['message'],_0x3ddd5d);_0x1c6dd7(_0x2e40dd['error'](0x1f4,_0x198591[_0xb668('0x18')]));});});};exports[_0xb668('0x27')]=function(_0xcdf6a8){var _0x38d9c9=this;return new Promise(function(_0x41aeca,_0x385bfd){var _0x4c4907={'body':_0xcdf6a8['body'],'channel':_0xb668('0x28')};var _0x43bd90=_[_0xb668('0x29')](_[_0xb668('0x2a')](db[_0xb668('0x2b')]['rawAttributes']),[_0xb668('0x2c'),_0xb668('0x2d'),'CompanyId',_0xb668('0x2e')]);var _0x2621c0=![];if(_0xcdf6a8[_0xb668('0x2f')]['id']){delete _0xcdf6a8[_0xb668('0x2f')]['id'];}if(_['isNil'](_0xcdf6a8['body']['from'])){return _0x385bfd(_0x38d9c9[_0xb668('0x16')](0x1f4,'from\x20is\x20mandatory'));}if(_['isNil'](_0xcdf6a8['body']['body'])||_0xcdf6a8[_0xb668('0x2f')]['body']===''){return _0x385bfd(_0x38d9c9[_0xb668('0x16')](0x1f4,_0xb668('0x30')));}if(_[_0xb668('0x31')](_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x32')])){return _0x385bfd(_0x38d9c9['error'](0x1f4,_0xb668('0x33')+_0x43bd90));}if(!_[_0xb668('0x34')](_0x43bd90,_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x32')])){return _0x385bfd(_0x38d9c9[_0xb668('0x16')](0x1f4,_0xb668('0x35')+_0x43bd90));}var _0x2c726b={};_0x2c726b[_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x32')]]=_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x36')];return db['MailAccount'][_0xb668('0x24')]({'where':{'id':_0xcdf6a8[_0xb668('0x37')]['id']},'include':[{'model':db[_0xb668('0x38')],'as':'List','include':[{'model':db['CmContact'],'as':_0xb668('0x39'),'where':_0x2c726b,'limit':0x1,'order':[['updatedAt',_0xb668('0x3a')]]}]},{'model':db['MailApplication'],'as':'Applications'},{'model':db['MailServerOut'],'as':_0xb668('0x3b')}]})[_0xb668('0xf')](function(_0x4e2b98){if(_0x4e2b98&&_0x4e2b98[_0xb668('0x3c')]){var _0x27d486=_0x4e2b98[_0xb668('0x3d')]({'plain':!![]});_0x4c4907[_0xb668('0x37')]=_[_0xb668('0x3e')](_0x27d486,[_0xb668('0x3f'),_0xb668('0x3c')]);_0x4c4907[_0xb668('0x40')]=_0x27d486[_0xb668('0x3f')];_0x4c4907[_0xb668('0x41')]=_0x27d486['List'];_0x4c4907[_0xb668('0x40')]=_[_0xb668('0x42')](_0x4c4907[_0xb668('0x40')],[_0xb668('0x43')],[_0xb668('0x44')]);if(_0x4c4907[_0xb668('0x37')]&&_0x4c4907[_0xb668('0x37')][_0xb668('0x45')]){_0x4c4907[_0xb668('0x40')]['push']({'id':0x0,'priority':_0x4c4907[_0xb668('0x40')][_0xb668('0x46')]+0x1,'app':_0xb668('0x47'),'appdata':'autoclose','interval':'*,*,*,*'});}if(_0x4c4907[_0xb668('0x37')][_0xb668('0x3f')]){delete _0x4c4907[_0xb668('0x37')]['Applications'];}if(_0x4c4907[_0xb668('0x37')]['List']){delete _0x4c4907['account'][_0xb668('0x3c')];}if(_0x27d486[_0xb668('0x3c')][_0xb668('0x39')][_0xb668('0x46')]){return _0x27d486[_0xb668('0x3c')][_0xb668('0x39')][0x0];}var _0x40f9a0=_[_0xb668('0xb')](_0xcdf6a8[_0xb668('0x2f')],{'firstName':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x36')],'ListId':_0x27d486[_0xb668('0x2e')]});_0x40f9a0[_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x32')]]=_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x36')];return db[_0xb668('0x2b')][_0xb668('0x48')](_0x40f9a0);}else{throw new Error(_0xb668('0x49'));}})[_0xb668('0xf')](function(_0x3c1b83){_0x4c4907[_0xb668('0x4a')]=_0x3c1b83;if(_0x3c1b83){if(!_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x4b')]){_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x4b')]=rs[_0xb668('0x4c')]()+'\x20'+_0xcdf6a8[_0xb668('0x2f')]['message'][_0xb668('0x36')];}var _0xaad5ed={'ContactId':_0x3c1b83['id'],'MailAccountId':_0xcdf6a8[_0xb668('0x37')]['id'],'inReplyTo':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x4b')],'to':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x36')],'cc':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')]['cc'],'subject':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')]['subject'],'attach':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')]['attach'],'lastMsgAt':moment()[_0xb668('0x4d')](_0xb668('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0xcdf6a8['body'][_0xb668('0x2f')]};return db[_0xb668('0x4f')]['find']({'where':{'closed':![],'MailAccountId':_0xcdf6a8[_0xb668('0x37')]['id']},'include':[{'model':db['MailMessage'],'as':_0xb668('0x50'),'attributes':[_0xb668('0x4b')],'where':{'messageId':_0xcdf6a8['body'][_0xb668('0x18')][_0xb668('0x51')]}}]})[_0xb668('0xf')](function(_0x10e2bf){if(_0x10e2bf){return[_0x10e2bf,![]];}return db[_0xb668('0x4f')][_0xb668('0x48')](_0xaad5ed)[_0xb668('0xf')](function(_0x291260){return[_0x291260,!![]];});});}else{throw new Error(_0xb668('0x52'));}})['spread'](function(_0xc82dfd,_0x440d30){if(_0xc82dfd){_0x2621c0=_0x440d30;if(!_0x440d30){return _0xc82dfd[_0xb668('0x53')]({'inReplyTo':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')]['messageId'],'to':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x36')],'cc':_0xcdf6a8['body'][_0xb668('0x18')]['cc'],'subject':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x54')],'attach':_0xc82dfd['attach']?_0xc82dfd[_0xb668('0x55')]:_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')]['attach'],'substatus':null,'substatusAt':moment()[_0xb668('0x4d')](_0xb668('0x4e')),'lastMsgAt':moment()[_0xb668('0x4d')](_0xb668('0x4e')),'lastMsgDirection':'in','lastMsgBody':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x2f')]});}else{return _0xc82dfd;}}})[_0xb668('0xf')](function(_0x2ce26f){_0x4c4907[_0xb668('0x56')]=_0x2ce26f['get']({'plain':!![]});_0x4c4907[_0xb668('0x56')]['created']=_0x2621c0;return db[_0xb668('0x57')]['create']({'body':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x2f')],'MailAccountId':_0xcdf6a8[_0xb668('0x37')]['id'],'MailInteractionId':_0x2ce26f['id'],'direction':'in','ContactId':_0x4c4907['contact']['id'],'messageId':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x4b')],'from':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x36')],'to':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')]['to'],'cc':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')]['cc'],'subject':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x54')],'attach':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x55')],'Attachments':_0xcdf6a8[_0xb668('0x2f')][_0xb668('0x18')][_0xb668('0x58')],'originTo':_0xcdf6a8[_0xb668('0x2f')]['message'][_0xb668('0x59')],'originCc':_0xcdf6a8[_0xb668('0x2f')]['message'][_0xb668('0x5a')],'bcc':_0xcdf6a8['body'][_0xb668('0x18')][_0xb668('0x5b')]},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0xb668('0xf')](function(_0x47174a){_0x4c4907[_0xb668('0x18')]=_0x47174a;if(_0x4c4907['interaction'][_0xb668('0x5c')]){return db[_0xb668('0x5d')][_0xb668('0x24')]({'attributes':['id','name'],'where':{'id':_0x4c4907[_0xb668('0x56')][_0xb668('0x5c')]}})[_0xb668('0xf')](function(_0x3d9d4d){if(_0x3d9d4d){_0x4c4907[_0xb668('0x40')][_0xb668('0x5e')]({'id':0x0,'priority':0x0,'app':_0xb668('0x5f'),'appdata':_0x3d9d4d[_0xb668('0x60')]+','+(_0x4c4907[_0xb668('0x37')][_0xb668('0x61')]||0xa),'interval':_0xb668('0x62')});}return respondWithRpcPromise('Start',_0xb668('0x63'),_0x4c4907);});}return respondWithRpcPromise('Start','startRouting',_0x4c4907);})[_0xb668('0xf')](function(_0x72c926){_0x41aeca(_0x72c926);})[_0xb668('0x19')](function(_0x3aaeed){_0x385bfd(_0x38d9c9['error'](0x1f4,_0x3aaeed[_0xb668('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 83553e0..333f4c4 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 _0x294b=['./mailAccount.events','remove','update','emit','removeListener','register'];(function(_0x26129c,_0x29bbca){var _0x19149a=function(_0x47ef3f){while(--_0x47ef3f){_0x26129c['push'](_0x26129c['shift']());}};_0x19149a(++_0x29bbca);}(_0x294b,0xea));var _0xb294=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x294b[_0x3dd15e];return _0x231fd0;};'use strict';var MailAccountEvents=require(_0xb294('0x0'));var events=['save',_0xb294('0x1'),_0xb294('0x2')];function createListener(_0x3fb36e,_0x411640){return function(_0x1cd458){_0x411640[_0xb294('0x3')](_0x3fb36e,_0x1cd458);};}function removeListener(_0x58fe24,_0x5c0237){return function(){MailAccountEvents[_0xb294('0x4')](_0x58fe24,_0x5c0237);};}exports[_0xb294('0x5')]=function(_0xaa6a67){for(var _0x181f5e=0x0,_0xcc7910=events['length'];_0x181f5e<_0xcc7910;_0x181f5e++){var _0x39dfbf=events[_0x181f5e];var _0x5110aa=createListener('mailAccount:'+_0x39dfbf,_0xaa6a67);MailAccountEvents['on'](_0x39dfbf,_0x5110aa);}}; \ No newline at end of file +var _0xae35=['length','mailAccount:','./mailAccount.events','save','remove','update','emit','register'];(function(_0x5dee2a,_0x47d02a){var _0x31e98e=function(_0x48b1e9){while(--_0x48b1e9){_0x5dee2a['push'](_0x5dee2a['shift']());}};_0x31e98e(++_0x47d02a);}(_0xae35,0x172));var _0x5ae3=function(_0x37f222,_0x371a0b){_0x37f222=_0x37f222-0x0;var _0x228762=_0xae35[_0x37f222];return _0x228762;};'use strict';var MailAccountEvents=require(_0x5ae3('0x0'));var events=[_0x5ae3('0x1'),_0x5ae3('0x2'),_0x5ae3('0x3')];function createListener(_0xbc7c72,_0x28892a){return function(_0x2bd1c8){_0x28892a[_0x5ae3('0x4')](_0xbc7c72,_0x2bd1c8);};}function removeListener(_0x54c0f2,_0x6dffe3){return function(){MailAccountEvents['removeListener'](_0x54c0f2,_0x6dffe3);};}exports[_0x5ae3('0x5')]=function(_0x2de702){for(var _0x4be90f=0x0,_0x45e748=events[_0x5ae3('0x6')];_0x4be90f<_0x45e748;_0x4be90f++){var _0x5697d7=events[_0x4be90f];var _0x1ff692=createListener(_0x5ae3('0x7')+_0x5697d7,_0x2de702);MailAccountEvents['on'](_0x5697d7,_0x1ff692);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 949bda3..08a1ed7 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 _0xf45e=['put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','get','/:id','isAuthenticated','show'];(function(_0x2497ba,_0x308cb1){var _0x3edad0=function(_0x1051c7){while(--_0x1051c7){_0x2497ba['push'](_0x2497ba['shift']());}};_0x3edad0(++_0x308cb1);}(_0xf45e,0x115));var _0xef45=function(_0x23f8e0,_0x45e610){_0x23f8e0=_0x23f8e0-0x0;var _0x353404=_0xf45e[_0x23f8e0];return _0x353404;};'use strict';var multer=require(_0xef45('0x0'));var util=require('util');var path=require(_0xef45('0x1'));var timeout=require('connect-timeout');var express=require(_0xef45('0x2'));var router=express[_0xef45('0x3')]();var auth=require(_0xef45('0x4'));var interaction=require(_0xef45('0x5'));var config=require(_0xef45('0x6'));var controller=require(_0xef45('0x7'));router[_0xef45('0x8')](_0xef45('0x9'),auth[_0xef45('0xa')](),controller[_0xef45('0xb')]);router[_0xef45('0xc')](_0xef45('0x9'),auth[_0xef45('0xa')](),controller[_0xef45('0xd')]);router[_0xef45('0xe')](_0xef45('0x9'),auth[_0xef45('0xa')](),controller[_0xef45('0xf')]);module[_0xef45('0x10')]=router; \ No newline at end of file +var _0x9348=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailApplication.controller','get','/:id','isAuthenticated','show','put','update','delete','multer'];(function(_0x53ba5a,_0x106cdc){var _0x4cf587=function(_0x570400){while(--_0x570400){_0x53ba5a['push'](_0x53ba5a['shift']());}};_0x4cf587(++_0x106cdc);}(_0x9348,0x10d));var _0x8934=function(_0xac7b9d,_0x494248){_0xac7b9d=_0xac7b9d-0x0;var _0x5c8a7c=_0x9348[_0xac7b9d];return _0x5c8a7c;};'use strict';var multer=require(_0x8934('0x0'));var util=require(_0x8934('0x1'));var path=require(_0x8934('0x2'));var timeout=require(_0x8934('0x3'));var express=require(_0x8934('0x4'));var router=express['Router']();var auth=require(_0x8934('0x5'));var interaction=require(_0x8934('0x6'));var config=require('../../config/environment');var controller=require(_0x8934('0x7'));router[_0x8934('0x8')](_0x8934('0x9'),auth[_0x8934('0xa')](),controller[_0x8934('0xb')]);router[_0x8934('0xc')]('/:id',auth[_0x8934('0xa')](),controller[_0x8934('0xd')]);router[_0x8934('0xe')]('/:id',auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index a04e571..4b9ac57 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 _0xd0d8=['STRING','noop','TEXT','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x204911,_0x4d76d3){var _0x19c0eb=function(_0x587f2b){while(--_0x587f2b){_0x204911['push'](_0x204911['shift']());}};_0x19c0eb(++_0x4d76d3);}(_0xd0d8,0xdd));var _0x8d0d=function(_0x6106d8,_0x67937c){_0x6106d8=_0x6106d8-0x0;var _0x8a8fe8=_0xd0d8[_0x6106d8];return _0x8a8fe8;};'use strict';var Sequelize=require(_0x8d0d('0x0'));module[_0x8d0d('0x1')]={'priority':{'type':Sequelize[_0x8d0d('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8d0d('0x3')],'allowNull':![],'defaultValue':_0x8d0d('0x4')},'appdata':{'type':Sequelize[_0x8d0d('0x5')]()},'description':{'type':Sequelize[_0x8d0d('0x3')]},'interval':{'type':Sequelize[_0x8d0d('0x3')],'defaultValue':_0x8d0d('0x6')}}; \ No newline at end of file +var _0x86eb=['TEXT','*,*,*,*','sequelize','STRING','noop'];(function(_0x545712,_0x2f3449){var _0x2e1c53=function(_0x4e5fa9){while(--_0x4e5fa9){_0x545712['push'](_0x545712['shift']());}};_0x2e1c53(++_0x2f3449);}(_0x86eb,0x1e2));var _0xb86e=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x86eb[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xb86e('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0xb86e('0x1')],'allowNull':![],'defaultValue':_0xb86e('0x2')},'appdata':{'type':Sequelize[_0xb86e('0x3')]()},'description':{'type':Sequelize[_0xb86e('0x1')]},'interval':{'type':Sequelize[_0xb86e('0x1')],'defaultValue':_0xb86e('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index ba8c251..244dc8f 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 _0xe8fa=['error','stack','name','send','show','params','keys','MailApplication','rawAttributes','query','intersection','model','attributes','fields','length','includeAll','include','merge','options','find','body','catch','html-pdf','eml-format','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy'];(function(_0x4276bc,_0x45cdde){var _0x215c39=function(_0x49e90a){while(--_0x49e90a){_0x4276bc['push'](_0x4276bc['shift']());}};_0x215c39(++_0x45cdde);}(_0xe8fa,0x1b3));var _0xae8f=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xe8fa[_0x87b0ff];return _0x3bc0b2;};'use strict';var pdf=require(_0xae8f('0x0'));var emlformat=require(_0xae8f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xae8f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xae8f('0x3'));var BPromise=require(_0xae8f('0x4'));var Mustache=require('mustache');var util=require(_0xae8f('0x5'));var path=require(_0xae8f('0x6'));var sox=require(_0xae8f('0x7'));var csv=require(_0xae8f('0x8'));var ejs=require(_0xae8f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xae8f('0xa'));var crypto=require(_0xae8f('0xb'));var jsforce=require(_0xae8f('0xc'));var deskjs=require(_0xae8f('0xd'));var toCsv=require(_0xae8f('0x8'));var querystring=require(_0xae8f('0xe'));var Papa=require(_0xae8f('0xf'));var Redis=require(_0xae8f('0x10'));var authService=require(_0xae8f('0x11'));var qs=require(_0xae8f('0x12'));var as=require(_0xae8f('0x13'));var hardwareService=require(_0xae8f('0x14'));var logger=require('../../config/logger')(_0xae8f('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xae8f('0x16'))['db'];function respondWithStatusCode(_0x30efe3,_0x87e46b){_0x87e46b=_0x87e46b||0xcc;return function(_0x37776b){if(_0x37776b){return _0x30efe3[_0xae8f('0x17')](_0x87e46b);}return _0x30efe3[_0xae8f('0x18')](_0x87e46b)['end']();};}function respondWithResult(_0x2a9c5d,_0x25a914){_0x25a914=_0x25a914||0xc8;return function(_0x4738ea){if(_0x4738ea){return _0x2a9c5d['status'](_0x25a914)['json'](_0x4738ea);}};}function respondWithFilteredResult(_0x1104fc,_0x20ea62){return function(_0x37ace2){if(_0x37ace2){var _0x913a12=_0x37ace2[_0xae8f('0x19')],_0x2740bf=_0x20ea62['offset'],_0x4d0639=_0x20ea62[_0xae8f('0x1a')]+_0x20ea62[_0xae8f('0x1b')],_0x482e8a;if(_0x4d0639>=_0x913a12){_0x4d0639=_0x913a12;_0x482e8a=0xc8;}else{_0x482e8a=0xce;}_0x1104fc['status'](_0x482e8a);return _0x1104fc[_0xae8f('0x1c')](_0xae8f('0x1d'),_0x2740bf+'-'+_0x4d0639+'/'+_0x913a12)[_0xae8f('0x1e')](_0x37ace2);}return null;};}function patchUpdates(_0x7bbdaf){return function(_0x312534){try{jsonpatch[_0xae8f('0x1f')](_0x312534,_0x7bbdaf,!![]);}catch(_0x5ade8b){return BPromise[_0xae8f('0x20')](_0x5ade8b);}return _0x312534[_0xae8f('0x21')]();};}function saveUpdates(_0x594746,_0x1e2303){return function(_0x41d5f2){if(_0x41d5f2){return _0x41d5f2[_0xae8f('0x22')](_0x594746)[_0xae8f('0x23')](function(_0x440ee8){return _0x440ee8;});}return null;};}function removeEntity(_0x4a1e74,_0x204931){return function(_0x58980a){if(_0x58980a){return _0x58980a[_0xae8f('0x24')]()[_0xae8f('0x23')](function(){_0x4a1e74['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a6e84,_0x1a2008){return function(_0x2d6967){if(!_0x2d6967){_0x1a6e84[_0xae8f('0x17')](0x194);}return _0x2d6967;};}function handleError(_0x3c270f,_0x5236ce){_0x5236ce=_0x5236ce||0x1f4;return function(_0x21bef8){logger[_0xae8f('0x25')](_0x21bef8[_0xae8f('0x26')]);if(_0x21bef8[_0xae8f('0x27')]){delete _0x21bef8['name'];}_0x3c270f[_0xae8f('0x18')](_0x5236ce)[_0xae8f('0x28')](_0x21bef8);};}exports[_0xae8f('0x29')]=function(_0x208033,_0x8db557){var _0x1e8e05={'raw':!![],'where':{'id':_0x208033[_0xae8f('0x2a')]['id']}},_0x2e19d5={};_0x2e19d5['model']=_[_0xae8f('0x2b')](db[_0xae8f('0x2c')][_0xae8f('0x2d')]);_0x2e19d5['query']=_['keys'](_0x208033[_0xae8f('0x2e')]);_0x2e19d5['filters']=_[_0xae8f('0x2f')](_0x2e19d5[_0xae8f('0x30')],_0x2e19d5[_0xae8f('0x2e')]);_0x1e8e05[_0xae8f('0x31')]=_['intersection'](_0x2e19d5[_0xae8f('0x30')],qs[_0xae8f('0x32')](_0x208033['query'][_0xae8f('0x32')]));_0x1e8e05[_0xae8f('0x31')]=_0x1e8e05[_0xae8f('0x31')][_0xae8f('0x33')]?_0x1e8e05[_0xae8f('0x31')]:_0x2e19d5[_0xae8f('0x30')];if(_0x208033[_0xae8f('0x2e')][_0xae8f('0x34')]){_0x1e8e05[_0xae8f('0x35')]=[{'all':!![]}];}_0x1e8e05=_[_0xae8f('0x36')]({},_0x1e8e05,_0x208033[_0xae8f('0x37')]);return db[_0xae8f('0x2c')][_0xae8f('0x38')](_0x1e8e05)['then'](handleEntityNotFound(_0x8db557,null))['then'](respondWithResult(_0x8db557,null))['catch'](handleError(_0x8db557,null));};exports[_0xae8f('0x22')]=function(_0x183290,_0xf22e43){if(_0x183290[_0xae8f('0x39')]['id']){delete _0x183290[_0xae8f('0x39')]['id'];}return db['MailApplication'][_0xae8f('0x38')]({'where':{'id':_0x183290[_0xae8f('0x2a')]['id']}})['then'](handleEntityNotFound(_0xf22e43,null))[_0xae8f('0x23')](saveUpdates(_0x183290[_0xae8f('0x39')],null))[_0xae8f('0x23')](respondWithResult(_0xf22e43,null))['catch'](handleError(_0xf22e43,null));};exports[_0xae8f('0x24')]=function(_0x469be8,_0x3b210d){return db[_0xae8f('0x2c')]['find']({'where':{'id':_0x469be8[_0xae8f('0x2a')]['id']}})[_0xae8f('0x23')](handleEntityNotFound(_0x3b210d,null))['then'](removeEntity(_0x3b210d,null))[_0xae8f('0x3a')](handleError(_0x3b210d,null));}; \ No newline at end of file +var _0x43db=['set','Content-Range','save','update','then','error','stack','name','send','show','model','keys','MailApplication','query','filters','fields','attributes','length','includeAll','include','merge','options','find','catch','body','params','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit'];(function(_0x306ae6,_0x44465){var _0x5d7d1d=function(_0x2fa96d){while(--_0x2fa96d){_0x306ae6['push'](_0x306ae6['shift']());}};_0x5d7d1d(++_0x44465);}(_0x43db,0xd5));var _0xb43d=function(_0x2540db,_0x9b7318){_0x2540db=_0x2540db-0x0;var _0xbf6e9f=_0x43db[_0x2540db];return _0xbf6e9f;};'use strict';var pdf=require(_0xb43d('0x0'));var emlformat=require(_0xb43d('0x1'));var rimraf=require(_0xb43d('0x2'));var zipdir=require(_0xb43d('0x3'));var jsonpatch=require(_0xb43d('0x4'));var rp=require(_0xb43d('0x5'));var moment=require('moment');var BPromise=require(_0xb43d('0x6'));var Mustache=require(_0xb43d('0x7'));var util=require(_0xb43d('0x8'));var path=require(_0xb43d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb43d('0xa'));var fs=require('fs');var _=require(_0xb43d('0xb'));var squel=require(_0xb43d('0xc'));var crypto=require(_0xb43d('0xd'));var jsforce=require(_0xb43d('0xe'));var deskjs=require(_0xb43d('0xf'));var toCsv=require(_0xb43d('0x10'));var querystring=require(_0xb43d('0x11'));var Papa=require(_0xb43d('0x12'));var Redis=require(_0xb43d('0x13'));var authService=require(_0xb43d('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xb43d('0x15'));var hardwareService=require(_0xb43d('0x16'));var logger=require(_0xb43d('0x17'))(_0xb43d('0x18'));var utils=require(_0xb43d('0x19'));var config=require(_0xb43d('0x1a'));var db=require(_0xb43d('0x1b'))['db'];function respondWithStatusCode(_0x58c33d,_0x14205c){_0x14205c=_0x14205c||0xcc;return function(_0xdcf538){if(_0xdcf538){return _0x58c33d[_0xb43d('0x1c')](_0x14205c);}return _0x58c33d[_0xb43d('0x1d')](_0x14205c)[_0xb43d('0x1e')]();};}function respondWithResult(_0x59ce00,_0x187330){_0x187330=_0x187330||0xc8;return function(_0x2609a4){if(_0x2609a4){return _0x59ce00[_0xb43d('0x1d')](_0x187330)[_0xb43d('0x1f')](_0x2609a4);}};}function respondWithFilteredResult(_0x7ab18b,_0xe20a27){return function(_0x18c915){if(_0x18c915){var _0x238613=_0x18c915[_0xb43d('0x20')],_0x2cc1ce=_0xe20a27['offset'],_0x219d82=_0xe20a27[_0xb43d('0x21')]+_0xe20a27[_0xb43d('0x22')],_0x39fc34;if(_0x219d82>=_0x238613){_0x219d82=_0x238613;_0x39fc34=0xc8;}else{_0x39fc34=0xce;}_0x7ab18b['status'](_0x39fc34);return _0x7ab18b[_0xb43d('0x23')](_0xb43d('0x24'),_0x2cc1ce+'-'+_0x219d82+'/'+_0x238613)[_0xb43d('0x1f')](_0x18c915);}return null;};}function patchUpdates(_0x2872f0){return function(_0x2dcf84){try{jsonpatch['apply'](_0x2dcf84,_0x2872f0,!![]);}catch(_0x5c02c1){return BPromise['reject'](_0x5c02c1);}return _0x2dcf84[_0xb43d('0x25')]();};}function saveUpdates(_0x8b17ec,_0x3969f4){return function(_0x3f106b){if(_0x3f106b){return _0x3f106b[_0xb43d('0x26')](_0x8b17ec)[_0xb43d('0x27')](function(_0x2fc425){return _0x2fc425;});}return null;};}function removeEntity(_0x1939b0,_0x1eb4e0){return function(_0x188066){if(_0x188066){return _0x188066['destroy']()[_0xb43d('0x27')](function(){_0x1939b0[_0xb43d('0x1d')](0xcc)[_0xb43d('0x1e')]();});}};}function handleEntityNotFound(_0x1a7915,_0x550dad){return function(_0x46a018){if(!_0x46a018){_0x1a7915[_0xb43d('0x1c')](0x194);}return _0x46a018;};}function handleError(_0x28702b,_0xb1dab1){_0xb1dab1=_0xb1dab1||0x1f4;return function(_0x2d820d){logger[_0xb43d('0x28')](_0x2d820d[_0xb43d('0x29')]);if(_0x2d820d[_0xb43d('0x2a')]){delete _0x2d820d[_0xb43d('0x2a')];}_0x28702b['status'](_0xb1dab1)[_0xb43d('0x2b')](_0x2d820d);};}exports[_0xb43d('0x2c')]=function(_0x117c80,_0x15a72e){var _0x9b0eea={'raw':!![],'where':{'id':_0x117c80['params']['id']}},_0x193ad2={};_0x193ad2[_0xb43d('0x2d')]=_[_0xb43d('0x2e')](db[_0xb43d('0x2f')]['rawAttributes']);_0x193ad2[_0xb43d('0x30')]=_['keys'](_0x117c80[_0xb43d('0x30')]);_0x193ad2[_0xb43d('0x31')]=_['intersection'](_0x193ad2[_0xb43d('0x2d')],_0x193ad2[_0xb43d('0x30')]);_0x9b0eea['attributes']=_['intersection'](_0x193ad2[_0xb43d('0x2d')],qs[_0xb43d('0x32')](_0x117c80[_0xb43d('0x30')][_0xb43d('0x32')]));_0x9b0eea['attributes']=_0x9b0eea[_0xb43d('0x33')][_0xb43d('0x34')]?_0x9b0eea['attributes']:_0x193ad2[_0xb43d('0x2d')];if(_0x117c80[_0xb43d('0x30')][_0xb43d('0x35')]){_0x9b0eea[_0xb43d('0x36')]=[{'all':!![]}];}_0x9b0eea=_[_0xb43d('0x37')]({},_0x9b0eea,_0x117c80[_0xb43d('0x38')]);return db[_0xb43d('0x2f')][_0xb43d('0x39')](_0x9b0eea)[_0xb43d('0x27')](handleEntityNotFound(_0x15a72e,null))['then'](respondWithResult(_0x15a72e,null))[_0xb43d('0x3a')](handleError(_0x15a72e,null));};exports['update']=function(_0x35cc8f,_0x568192){if(_0x35cc8f[_0xb43d('0x3b')]['id']){delete _0x35cc8f[_0xb43d('0x3b')]['id'];}return db['MailApplication'][_0xb43d('0x39')]({'where':{'id':_0x35cc8f[_0xb43d('0x3c')]['id']}})['then'](handleEntityNotFound(_0x568192,null))[_0xb43d('0x27')](saveUpdates(_0x35cc8f[_0xb43d('0x3b')],null))[_0xb43d('0x27')](respondWithResult(_0x568192,null))[_0xb43d('0x3a')](handleError(_0x568192,null));};exports[_0xb43d('0x3d')]=function(_0x4d73dc,_0x3882b8){return db[_0xb43d('0x2f')]['find']({'where':{'id':_0x4d73dc[_0xb43d('0x3c')]['id']}})[_0xb43d('0x27')](handleEntityNotFound(_0x3882b8,null))[_0xb43d('0x27')](removeEntity(_0x3882b8,null))[_0xb43d('0x3a')](handleError(_0x3882b8,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 033ddde..d2aa685 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 _0x881e=['rimraf','../../config/environment','./mailApplication.attributes','MailApplication','mail_applications','utf8mb4','../../config/logger','api','bluebird','path'];(function(_0x37914d,_0x4209c0){var _0x2b4118=function(_0x10de2){while(--_0x10de2){_0x37914d['push'](_0x37914d['shift']());}};_0x2b4118(++_0x4209c0);}(_0x881e,0x146));var _0xe881=function(_0x2bf9a2,_0x175d60){_0x2bf9a2=_0x2bf9a2-0x0;var _0xdfccc6=_0x881e[_0x2bf9a2];return _0xdfccc6;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe881('0x0'))(_0xe881('0x1'));var moment=require('moment');var BPromise=require(_0xe881('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe881('0x3'));var rimraf=require(_0xe881('0x4'));var config=require(_0xe881('0x5'));var attributes=require(_0xe881('0x6'));module['exports']=function(_0x1d9bc0,_0xa4fe06){return _0x1d9bc0['define'](_0xe881('0x7'),attributes,{'tableName':_0xe881('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xe881('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x1c01=['exports','define','mail_applications','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','rimraf','../../config/environment','./mailApplication.attributes'];(function(_0x50c0c4,_0x4f5be6){var _0x3c0783=function(_0x5e7322){while(--_0x5e7322){_0x50c0c4['push'](_0x50c0c4['shift']());}};_0x3c0783(++_0x4f5be6);}(_0x1c01,0x190));var _0x11c0=function(_0x125195,_0x30f98c){_0x125195=_0x125195-0x0;var _0x338f48=_0x1c01[_0x125195];return _0x338f48;};'use strict';var _=require(_0x11c0('0x0'));var util=require(_0x11c0('0x1'));var logger=require(_0x11c0('0x2'))(_0x11c0('0x3'));var moment=require('moment');var BPromise=require(_0x11c0('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x11c0('0x5'));var config=require(_0x11c0('0x6'));var attributes=require(_0x11c0('0x7'));module[_0x11c0('0x8')]=function(_0x38c591,_0x5190a4){return _0x38c591[_0x11c0('0x9')]('MailApplication',attributes,{'tableName':_0x11c0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x11c0('0xb')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 902ca25..49685e6 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 _0x38c1=['../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','MailApplication,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','then','lodash','bluebird','randomstring','ioredis'];(function(_0x11ca63,_0xea9f9c){var _0x41f1f6=function(_0xb80b69){while(--_0xb80b69){_0x11ca63['push'](_0x11ca63['shift']());}};_0x41f1f6(++_0xea9f9c);}(_0x38c1,0x170));var _0x138c=function(_0x97eb75,_0x17c7c5){_0x97eb75=_0x97eb75-0x0;var _0x5bb240=_0x38c1[_0x97eb75];return _0x5bb240;};'use strict';var _=require(_0x138c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x138c('0x1'));var rs=require(_0x138c('0x2'));var fs=require('fs');var Redis=require(_0x138c('0x3'));var db=require(_0x138c('0x4'))['db'];var utils=require(_0x138c('0x5'));var logger=require('../../config/logger')(_0x138c('0x6'));var config=require('../../config/environment');var jayson=require(_0x138c('0x7'));var client=jayson[_0x138c('0x8')][_0x138c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20aa52,_0x521a3d,_0x1b90e6){return new BPromise(function(_0x543f06,_0x31c9f3){return client[_0x138c('0xa')](_0x20aa52,_0x1b90e6)['then'](function(_0x1be8c6){logger['info'](_0x138c('0xb'),_0x521a3d,'request\x20sent');logger[_0x138c('0xc')]('MailApplication,\x20%s,\x20%s,\x20%s',_0x521a3d,_0x138c('0xd'),JSON[_0x138c('0xe')](_0x1be8c6));if(_0x1be8c6[_0x138c('0xf')]){if(_0x1be8c6['error'][_0x138c('0x10')]===0x1f4){logger['error'](_0x138c('0xb'),_0x521a3d,_0x1be8c6[_0x138c('0xf')]['message']);return _0x31c9f3(_0x1be8c6['error'][_0x138c('0x11')]);}logger[_0x138c('0xf')](_0x138c('0xb'),_0x521a3d,_0x1be8c6['error'][_0x138c('0x11')]);return _0x543f06(_0x1be8c6['error'][_0x138c('0x11')]);}else{logger[_0x138c('0x12')](_0x138c('0xb'),_0x521a3d,_0x138c('0xd'));_0x543f06(_0x1be8c6[_0x138c('0x13')]['message']);}})[_0x138c('0x14')](function(_0x1f33f5){logger[_0x138c('0xf')](_0x138c('0xb'),_0x521a3d,_0x1f33f5);_0x31c9f3(_0x1f33f5);});});}exports[_0x138c('0x15')]=function(_0xa3ee5e){var _0x53bae4=this;return new Promise(function(_0x2e1cd6,_0x2a0eea){return db[_0x138c('0x16')][_0x138c('0x17')](_0xa3ee5e[_0x138c('0x18')],{'raw':_0xa3ee5e['options']?_0xa3ee5e[_0x138c('0x19')][_0x138c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa3ee5e[_0x138c('0x19')]?_0xa3ee5e['options'][_0x138c('0x1b')]||null:null,'attributes':_0xa3ee5e['options']?_0xa3ee5e[_0x138c('0x19')][_0x138c('0x1c')]||null:null,'limit':_0xa3ee5e[_0x138c('0x19')]?_0xa3ee5e['options'][_0x138c('0x1d')]||null:null})[_0x138c('0x1e')](function(_0x1b3ebf){logger['info'](_0x138c('0x15'),_0xa3ee5e);logger[_0x138c('0xc')](_0x138c('0x15'),_0xa3ee5e,JSON[_0x138c('0xe')](_0x1b3ebf));_0x2e1cd6(_0x1b3ebf);})[_0x138c('0x14')](function(_0x2dfc6b){logger[_0x138c('0xf')](_0x138c('0x15'),_0x2dfc6b[_0x138c('0x11')],_0xa3ee5e);_0x2a0eea(_0x53bae4[_0x138c('0xf')](0x1f4,_0x2dfc6b[_0x138c('0x11')]));});});}; \ No newline at end of file +var _0xdcd9=['body','options','raw','attributes','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','MailApplication,\x20%s,\x20%s','message','result','UpdateMailApplication','MailApplication','update'];(function(_0x3bec69,_0x178e02){var _0x5bb4b0=function(_0x261b4c){while(--_0x261b4c){_0x3bec69['push'](_0x3bec69['shift']());}};_0x5bb4b0(++_0x178e02);}(_0xdcd9,0x179));var _0x9dcd=function(_0x594e72,_0x250dd9){_0x594e72=_0x594e72-0x0;var _0x233fda=_0xdcd9[_0x594e72];return _0x233fda;};'use strict';var _=require(_0x9dcd('0x0'));var util=require(_0x9dcd('0x1'));var moment=require('moment');var BPromise=require(_0x9dcd('0x2'));var rs=require(_0x9dcd('0x3'));var fs=require('fs');var Redis=require(_0x9dcd('0x4'));var db=require(_0x9dcd('0x5'))['db'];var utils=require(_0x9dcd('0x6'));var logger=require(_0x9dcd('0x7'))('rpc');var config=require(_0x9dcd('0x8'));var jayson=require(_0x9dcd('0x9'));var client=jayson['client'][_0x9dcd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2bc931,_0x5ed78f,_0x2cd4a0){return new BPromise(function(_0x2a42cd,_0x1b171c){return client[_0x9dcd('0xb')](_0x2bc931,_0x2cd4a0)[_0x9dcd('0xc')](function(_0x46ea02){logger[_0x9dcd('0xd')]('MailApplication,\x20%s,\x20%s',_0x5ed78f,_0x9dcd('0xe'));logger[_0x9dcd('0xf')](_0x9dcd('0x10'),_0x5ed78f,_0x9dcd('0xe'),JSON[_0x9dcd('0x11')](_0x46ea02));if(_0x46ea02['error']){if(_0x46ea02[_0x9dcd('0x12')][_0x9dcd('0x13')]===0x1f4){logger[_0x9dcd('0x12')](_0x9dcd('0x14'),_0x5ed78f,_0x46ea02[_0x9dcd('0x12')][_0x9dcd('0x15')]);return _0x1b171c(_0x46ea02[_0x9dcd('0x12')][_0x9dcd('0x15')]);}logger[_0x9dcd('0x12')]('MailApplication,\x20%s,\x20%s',_0x5ed78f,_0x46ea02[_0x9dcd('0x12')]['message']);return _0x2a42cd(_0x46ea02['error'][_0x9dcd('0x15')]);}else{logger['info'](_0x9dcd('0x14'),_0x5ed78f,_0x9dcd('0xe'));_0x2a42cd(_0x46ea02[_0x9dcd('0x16')][_0x9dcd('0x15')]);}})['catch'](function(_0x44f5e6){logger[_0x9dcd('0x12')](_0x9dcd('0x14'),_0x5ed78f,_0x44f5e6);_0x1b171c(_0x44f5e6);});});}exports[_0x9dcd('0x17')]=function(_0x5347e1){var _0x52f85d=this;return new Promise(function(_0x318890,_0x38711e){return db[_0x9dcd('0x18')][_0x9dcd('0x19')](_0x5347e1[_0x9dcd('0x1a')],{'raw':_0x5347e1[_0x9dcd('0x1b')]?_0x5347e1[_0x9dcd('0x1b')][_0x9dcd('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5347e1[_0x9dcd('0x1b')]?_0x5347e1['options']['where']||null:null,'attributes':_0x5347e1['options']?_0x5347e1[_0x9dcd('0x1b')][_0x9dcd('0x1d')]||null:null,'limit':_0x5347e1[_0x9dcd('0x1b')]?_0x5347e1[_0x9dcd('0x1b')]['limit']||null:null})[_0x9dcd('0xc')](function(_0x38e665){logger['info'](_0x9dcd('0x17'),_0x5347e1);logger['debug'](_0x9dcd('0x17'),_0x5347e1,JSON[_0x9dcd('0x11')](_0x38e665));_0x318890(_0x38e665);})[_0x9dcd('0x1e')](function(_0x38a5ec){logger[_0x9dcd('0x12')]('UpdateMailApplication',_0x38a5ec[_0x9dcd('0x15')],_0x5347e1);_0x38711e(_0x52f85d['error'](0x1f4,_0x38a5ec['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 3001622..26f0819 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 _0x1488=['../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','/:id/tags','tracked','mail','mailinteraction:addtags','addTags','put','mailinteraction:update','mailinteraction:destroy','removeTags','multer','path','connect-timeout','express'];(function(_0x4beec2,_0x458dec){var _0x2cbeaa=function(_0x40f92a){while(--_0x40f92a){_0x4beec2['push'](_0x4beec2['shift']());}};_0x2cbeaa(++_0x458dec);}(_0x1488,0x88));var _0x8148=function(_0x3005d5,_0xf588c7){_0x3005d5=_0x3005d5-0x0;var _0x547c7e=_0x1488[_0x3005d5];return _0x547c7e;};'use strict';var multer=require(_0x8148('0x0'));var util=require('util');var path=require(_0x8148('0x1'));var timeout=require(_0x8148('0x2'));var express=require(_0x8148('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8148('0x4'));var config=require('../../config/environment');var controller=require(_0x8148('0x5'));router[_0x8148('0x6')]('/',auth[_0x8148('0x7')](),controller[_0x8148('0x8')]);router[_0x8148('0x6')](_0x8148('0x9'),auth[_0x8148('0x7')](),controller[_0x8148('0xa')]);router['get'](_0x8148('0xb'),auth[_0x8148('0x7')](),controller[_0x8148('0xc')]);router[_0x8148('0x6')](_0x8148('0xd'),auth[_0x8148('0x7')](),controller[_0x8148('0xe')]);router[_0x8148('0x6')](_0x8148('0xf'),auth[_0x8148('0x7')](),controller[_0x8148('0x10')]);router[_0x8148('0x11')]('/',auth['isAuthenticated'](),controller[_0x8148('0x12')]);router[_0x8148('0x11')](_0x8148('0xd'),auth['isAuthenticated'](),controller['addMessage']);router[_0x8148('0x11')](_0x8148('0x13'),auth['isAuthenticated'](),interaction[_0x8148('0x14')](_0x8148('0x15'),_0x8148('0x16')),controller[_0x8148('0x17')]);router[_0x8148('0x18')]('/:id',auth[_0x8148('0x7')](),interaction['tracked']('mail',_0x8148('0x19')),controller['update']);router['delete'](_0x8148('0xb'),auth['isAuthenticated'](),interaction['tracked']('mail',_0x8148('0x1a')),controller['destroy']);router['delete'](_0x8148('0x13'),auth['isAuthenticated'](),controller[_0x8148('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x950a=['addMessage','tracked','mail','addTags','put','mailinteraction:update','delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','/:id','show','/:id/messages','/:id/download','download','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x950a,0x111));var _0xa950=function(_0x275f64,_0x499f01){_0x275f64=_0x275f64-0x0;var _0x23523a=_0x950a[_0x275f64];return _0x23523a;};'use strict';var multer=require(_0xa950('0x0'));var util=require(_0xa950('0x1'));var path=require(_0xa950('0x2'));var timeout=require(_0xa950('0x3'));var express=require('express');var router=express[_0xa950('0x4')]();var auth=require(_0xa950('0x5'));var interaction=require(_0xa950('0x6'));var config=require(_0xa950('0x7'));var controller=require('./mailInteraction.controller');router[_0xa950('0x8')]('/',auth[_0xa950('0x9')](),controller['index']);router[_0xa950('0x8')](_0xa950('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xa950('0x8')](_0xa950('0xb'),auth[_0xa950('0x9')](),controller[_0xa950('0xc')]);router[_0xa950('0x8')](_0xa950('0xd'),auth['isAuthenticated'](),controller['getMessages']);router['get'](_0xa950('0xe'),auth['isAuthenticated'](),controller[_0xa950('0xf')]);router[_0xa950('0x10')]('/',auth[_0xa950('0x9')](),controller['create']);router[_0xa950('0x10')]('/:id/messages',auth[_0xa950('0x9')](),controller[_0xa950('0x11')]);router[_0xa950('0x10')]('/:id/tags',auth[_0xa950('0x9')](),interaction[_0xa950('0x12')](_0xa950('0x13'),'mailinteraction:addtags'),controller[_0xa950('0x14')]);router[_0xa950('0x15')](_0xa950('0xb'),auth['isAuthenticated'](),interaction[_0xa950('0x12')](_0xa950('0x13'),_0xa950('0x16')),controller['update']);router[_0xa950('0x17')](_0xa950('0xb'),auth[_0xa950('0x9')](),interaction[_0xa950('0x12')](_0xa950('0x13'),_0xa950('0x18')),controller[_0xa950('0x19')]);router[_0xa950('0x17')](_0xa950('0x1a'),auth[_0xa950('0x9')](),controller[_0xa950('0x1b')]);module[_0xa950('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index 279c9e7..ce6fed4 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 _0xeecb=['TEXT','long','BOOLEAN','ENUM','out','sequelize','iconv','exports','DATE','STRING'];(function(_0x44ee1c,_0x8fd148){var _0x51577b=function(_0x371d32){while(--_0x371d32){_0x44ee1c['push'](_0x44ee1c['shift']());}};_0x51577b(++_0x8fd148);}(_0xeecb,0xe1));var _0xbeec=function(_0x26f4f5,_0x53419e){_0x26f4f5=_0x26f4f5-0x0;var _0x91bf0a=_0xeecb[_0x26f4f5];return _0x91bf0a;};'use strict';var Sequelize=require(_0xbeec('0x0'));var iconv=require(_0xbeec('0x1'));module[_0xbeec('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xbeec('0x3')]},'disposition':{'type':Sequelize[_0xbeec('0x4')]},'note':{'type':Sequelize[_0xbeec('0x4')]},'inReplyTo':{'type':Sequelize[_0xbeec('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0xbeec('0x5')](_0xbeec('0x6'))},'subject':{'type':Sequelize[_0xbeec('0x5')]()},'attach':{'type':Sequelize[_0xbeec('0x7')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xbeec('0x3')]},'substatus':{'type':Sequelize['STRING'](0x3c)},'substatusAt':{'type':Sequelize[_0xbeec('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xbeec('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xbeec('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xbeec('0x8')]('in',_0xbeec('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xbeec('0x5')](_0xbeec('0x6'))},'lastMsgText':{'type':Sequelize[_0xbeec('0x5')](_0xbeec('0x6'))}}; \ No newline at end of file +var _0x3b52=['TEXT','long','out','sequelize','iconv','exports','BOOLEAN','DATE','STRING'];(function(_0x8c38c8,_0x47caec){var _0x2ff57d=function(_0x36f6a5){while(--_0x36f6a5){_0x8c38c8['push'](_0x8c38c8['shift']());}};_0x2ff57d(++_0x47caec);}(_0x3b52,0x78));var _0x23b5=function(_0x42f34c,_0x190ed2){_0x42f34c=_0x42f34c-0x0;var _0xf9fb24=_0x3b52[_0x42f34c];return _0xf9fb24;};'use strict';var Sequelize=require(_0x23b5('0x0'));var iconv=require(_0x23b5('0x1'));module[_0x23b5('0x2')]={'closed':{'type':Sequelize[_0x23b5('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x23b5('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0x23b5('0x5')]},'cc':{'type':Sequelize[_0x23b5('0x6')](_0x23b5('0x7'))},'subject':{'type':Sequelize[_0x23b5('0x6')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize['DATE']},'substatus':{'type':Sequelize[_0x23b5('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x23b5('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x23b5('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x23b5('0x4')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x23b5('0x8')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x23b5('0x6')](_0x23b5('0x7'))},'lastMsgText':{'type':Sequelize[_0x23b5('0x6')](_0x23b5('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 892d8e4..90bc278 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 _0x8f1a=['crypto','jsforce','desk.js','querystring','papaparse','html-to-text','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','status','end','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','name','Users','map','TagIds','split','forEach','Tags','push','lastMsgBody','lastMsgText','fromString','catch','MailInteraction','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','field','color','from','tools_tags','select','u.id','ui.MailInteractionId','users','u.id\x20=\x20ui.UserId','mail_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','find','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','UserId','plainBody','isEmpty','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','isEmail','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','MailAccountId','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','count','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.id','i.createdAt','i.closed','i.closedAt','i.lastMsgAt','i.subject','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','Contact.lastName','Contact.email','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','show','includeAll','include','create','body','params','describe','addMessage','MailMessage','ids','omit','getMessages','options','findAll','rows','addTags','setTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','attachments','tmp','format','interaction-%s.zip','bcc','Attachments','mkdirSync','each','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','basename','existsSync','writeFileSync','message%d.eml','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','to-csv','ejs','squel'];(function(_0x3b3210,_0x25e8ed){var _0x5b5484=function(_0x417858){while(--_0x417858){_0x3b3210['push'](_0x3b3210['shift']());}};_0x5b5484(++_0x25e8ed);}(_0x8f1a,0xcd));var _0xa8f1=function(_0x38da4e,_0x5c5279){_0x38da4e=_0x38da4e-0x0;var _0x31df71=_0x8f1a[_0x38da4e];return _0x31df71;};'use strict';var pdf=require(_0xa8f1('0x0'));var emlformat=require(_0xa8f1('0x1'));var rimraf=require(_0xa8f1('0x2'));var zipdir=require(_0xa8f1('0x3'));var jsonpatch=require(_0xa8f1('0x4'));var rp=require(_0xa8f1('0x5'));var moment=require(_0xa8f1('0x6'));var BPromise=require(_0xa8f1('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xa8f1('0x8'));var sox=require('sox');var csv=require(_0xa8f1('0x9'));var ejs=require(_0xa8f1('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa8f1('0xb'));var crypto=require(_0xa8f1('0xc'));var jsforce=require(_0xa8f1('0xd'));var deskjs=require(_0xa8f1('0xe'));var toCsv=require(_0xa8f1('0x9'));var querystring=require(_0xa8f1('0xf'));var Papa=require(_0xa8f1('0x10'));var htmlToText=require(_0xa8f1('0x11'));var Redis=require('ioredis');var authService=require(_0xa8f1('0x12'));var qs=require(_0xa8f1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa8f1('0x14'));var logger=require('../../config/logger')(_0xa8f1('0x15'));var utils=require(_0xa8f1('0x16'));var config=require(_0xa8f1('0x17'));var db=require('../../mysqldb')['db'];config[_0xa8f1('0x18')]=_[_0xa8f1('0x19')](config[_0xa8f1('0x18')],{'host':_0xa8f1('0x1a'),'port':0x18eb});var socket=require(_0xa8f1('0x1b'))(new Redis(config['redis']));require(_0xa8f1('0x1c'))['register'](socket);function respondWithStatusCode(_0x20c6af,_0x78aee6){_0x78aee6=_0x78aee6||0xcc;return function(_0x4a230f){if(_0x4a230f){return _0x20c6af['sendStatus'](_0x78aee6);}return _0x20c6af[_0xa8f1('0x1d')](_0x78aee6)[_0xa8f1('0x1e')]();};}function respondWithResult(_0x2a496d,_0x42c7b1){_0x42c7b1=_0x42c7b1||0xc8;return function(_0x454241){if(_0x454241){return _0x2a496d[_0xa8f1('0x1d')](_0x42c7b1)[_0xa8f1('0x1f')](_0x454241);}};}function respondWithFilteredResult(_0x1a840a,_0x28bf9c){return function(_0x124917){if(_0x124917){var _0x453532=_0x124917['count'],_0x2ea505=_0x28bf9c['offset'],_0x8b7ed1=_0x28bf9c[_0xa8f1('0x20')]+_0x28bf9c[_0xa8f1('0x21')],_0x437035;if(_0x8b7ed1>=_0x453532){_0x8b7ed1=_0x453532;_0x437035=0xc8;}else{_0x437035=0xce;}_0x1a840a[_0xa8f1('0x1d')](_0x437035);return _0x1a840a['set'](_0xa8f1('0x22'),_0x2ea505+'-'+_0x8b7ed1+'/'+_0x453532)[_0xa8f1('0x1f')](_0x124917);}return null;};}function patchUpdates(_0x2e2abc){return function(_0x31eba8){try{jsonpatch[_0xa8f1('0x23')](_0x31eba8,_0x2e2abc,!![]);}catch(_0x5076bd){return BPromise[_0xa8f1('0x24')](_0x5076bd);}return _0x31eba8[_0xa8f1('0x25')]();};}function saveUpdates(_0x4d905c,_0x3132cc){return function(_0x261af0){if(_0x261af0){return _0x261af0[_0xa8f1('0x26')](_0x4d905c)[_0xa8f1('0x27')](function(_0x2306ec){return _0x2306ec;});}return null;};}function removeEntity(_0x2f764d,_0xa0ac0f){return function(_0x2e2dc6){if(_0x2e2dc6){return _0x2e2dc6[_0xa8f1('0x28')]()['then'](function(){_0x2f764d[_0xa8f1('0x1d')](0xcc)[_0xa8f1('0x1e')]();});}};}function handleEntityNotFound(_0xb6019a,_0x3091d6){return function(_0x1ecc3e){if(!_0x1ecc3e){_0xb6019a['sendStatus'](0x194);}return _0x1ecc3e;};}function handleError(_0x3eda99,_0x18a3db){_0x18a3db=_0x18a3db||0x1f4;return function(_0x584d34){logger['error'](_0x584d34['stack']);if(_0x584d34[_0xa8f1('0x29')]){delete _0x584d34[_0xa8f1('0x29')];}_0x3eda99['status'](_0x18a3db)['send'](_0x584d34);};}function getInteractionUsers(_0x559f3b,_0x274277){return new BPromise(function(_0x50b089,_0x3a1923){try{if(_0x274277[_0x559f3b['id']]){_0x559f3b[_0xa8f1('0x2a')]=_[_0xa8f1('0x2b')](_0x274277[_0x559f3b['id']],function(_0x2de967){return{'id':_0x2de967['id']};});}}catch(_0x419a70){_0x3a1923(_0x419a70);}_0x50b089(_0x559f3b);});}function getInteractionTags(_0x2bb524,_0x179ed0){return new BPromise(function(_0x3641e2,_0x3ec18d){try{if(_0x2bb524[_0xa8f1('0x2c')]){_0x2bb524['Tags']=[];_0x2bb524['TagIds'][_0xa8f1('0x2d')](',')[_0xa8f1('0x2e')](function(_0x459998){_0x2bb524[_0xa8f1('0x2f')][_0xa8f1('0x30')](_0x179ed0[_0x459998]);});}delete _0x2bb524[_0xa8f1('0x2c')];}catch(_0x366947){_0x3ec18d(_0x366947);}_0x3641e2(_0x2bb524);});}function getLastMessageText(_0x892ae7){return new BPromise(function(_0x404d48,_0x5d148c){return db['MailInteraction']['findOne']({'where':{'id':_0x892ae7['id']},'attributes':[_0xa8f1('0x31'),_0xa8f1('0x32')],'raw':!![]})[_0xa8f1('0x27')](function(_0xf2cff7){if(!_0xf2cff7[_0xa8f1('0x32')]){_0x892ae7['lastMsgText']=_['trimStart'](htmlToText[_0xa8f1('0x33')](_0xf2cff7[_0xa8f1('0x31')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x892ae7[_0xa8f1('0x32')]=_0xf2cff7[_0xa8f1('0x32')];}_0x404d48(_0x892ae7);})[_0xa8f1('0x34')](function(_0x592af7){_0x5d148c(_0x592af7);});});}function updateMailInteraction(_0x96940d,_0x3e22a1,_0x373696,_0x24087e){return new BPromise(function(_0x3f7aa2,_0x5349b8){return getInteractionUsers(_0x96940d,_0x373696)[_0xa8f1('0x27')](function(_0x32322f){return getInteractionTags(_0x32322f,_0x3e22a1);})[_0xa8f1('0x27')](function(_0x4656f6){if(_0x24087e){_0x3f7aa2(getLastMessageText(_0x4656f6));}else{_0x3f7aa2(_0x4656f6);}})[_0xa8f1('0x34')](function(_0x4223ce){_0x5349b8(_0x4223ce);});});}exports['index']=function(_0x922ba5,_0x18e6f2){var _0x4cdeba={},_0xdbb71a={},_0x47e3b6={'count':0x0,'rows':[]};var _0x279365=_[_0xa8f1('0x2b')](db[_0xa8f1('0x35')][_0xa8f1('0x36')],function(_0xbf7724){return{'name':_0xbf7724['fieldName'],'type':_0xbf7724[_0xa8f1('0x37')][_0xa8f1('0x38')]};});_0xdbb71a[_0xa8f1('0x39')]=_['map'](_0x279365,'name');_0xdbb71a[_0xa8f1('0x3a')]=_[_0xa8f1('0x3b')](_0x922ba5['query']);_0xdbb71a['filters']=_[_0xa8f1('0x3c')](_0xdbb71a['model'],_0xdbb71a[_0xa8f1('0x3a')]);_0x4cdeba[_0xa8f1('0x3d')]=_[_0xa8f1('0x3c')](_0xdbb71a[_0xa8f1('0x39')],qs[_0xa8f1('0x3e')](_0x922ba5[_0xa8f1('0x3a')]['fields']));_0x4cdeba[_0xa8f1('0x3d')]=_0x4cdeba[_0xa8f1('0x3d')][_0xa8f1('0x3f')]?_0x4cdeba[_0xa8f1('0x3d')]:_0xdbb71a[_0xa8f1('0x39')];if(!_0x922ba5[_0xa8f1('0x3a')][_0xa8f1('0x40')](_0xa8f1('0x41'))){_0x4cdeba[_0xa8f1('0x21')]=qs[_0xa8f1('0x21')](_0x922ba5[_0xa8f1('0x3a')]['limit']);_0x4cdeba[_0xa8f1('0x20')]=qs[_0xa8f1('0x20')](_0x922ba5[_0xa8f1('0x3a')]['offset']);}_0x4cdeba[_0xa8f1('0x42')]=qs[_0xa8f1('0x43')](_0x922ba5[_0xa8f1('0x3a')]['sort']);_0x4cdeba[_0xa8f1('0x44')]=qs[_0xa8f1('0x45')](_[_0xa8f1('0x46')](_0x922ba5[_0xa8f1('0x3a')],_0xdbb71a[_0xa8f1('0x45')]));var _0x3e8272=[];var _0x58b261=squel['select']()[_0xa8f1('0x47')]('id')['field']('name')[_0xa8f1('0x47')](_0xa8f1('0x48'))[_0xa8f1('0x49')](_0xa8f1('0x4a'));var _0x534a14=squel[_0xa8f1('0x4b')]()[_0xa8f1('0x47')](_0xa8f1('0x4c'))[_0xa8f1('0x47')](_0xa8f1('0x4d'))[_0xa8f1('0x49')]('user_has_mail_interactions','ui')['left_join'](_0xa8f1('0x4e'),'u',_0xa8f1('0x4f'));var _0x546289=squel['select']()[_0xa8f1('0x49')](_0xa8f1('0x50'),'i')[_0xa8f1('0x51')]('cm_contacts','c',_0xa8f1('0x52'))[_0xa8f1('0x51')](_0xa8f1('0x4e'),'o',_0xa8f1('0x53'))['left_join'](_0xa8f1('0x54'),'a',_0xa8f1('0x55'))[_0xa8f1('0x51')](_0xa8f1('0x56'),'me',_0xa8f1('0x57'))['left_join'](_0xa8f1('0x58'),'it',_0xa8f1('0x59'))[_0xa8f1('0x51')](_0xa8f1('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x13807e=squel[_0xa8f1('0x5a')]();var _0x2cb64b=[];var _0x2d9e60=squel['expr']();var _0x38c273;if(_0x922ba5[_0xa8f1('0x3a')][_0xa8f1('0x5b')]){_0x38c273=as[_0xa8f1('0x5c')](_0x922ba5[_0xa8f1('0x3a')][_0xa8f1('0x5b')]);var _0x211614=_0x38c273[_0xa8f1('0x5d')];for(var _0xdc37ec=0x0;_0xdc37ec<_0x38c273[_0xa8f1('0x5e')][_0xa8f1('0x3f')];_0xdc37ec++){var _0x222c25=_0x38c273[_0xa8f1('0x5e')][_0xdc37ec];var _0x281ad0='i';var _0x4766c7=_['find'](_0x279365,[_0xa8f1('0x29'),_0x222c25[_0xa8f1('0x47')]]);if(!_0x4766c7){switch(_0x222c25[_0xa8f1('0x47')]){case _0xa8f1('0x5f'):if(_0x222c25[_0xa8f1('0x60')]==0x1){_0x546289[_0xa8f1('0x61')]('`'+_0x222c25[_0xa8f1('0x47')]+_0xa8f1('0x62'));}else{_0x546289[_0xa8f1('0x61')]('`'+_0x222c25[_0xa8f1('0x47')]+_0xa8f1('0x63'));}break;case _0xa8f1('0x64'):if(_0x222c25[_0xa8f1('0x65')]===_0xa8f1('0x66')){if(_0x222c25[_0xa8f1('0x60')][_0xa8f1('0x2d')]('\x20')[_0xa8f1('0x3f')]>0x1){_0x13807e[_0x211614](_0xa8f1('0x67'),qs[_0xa8f1('0x68')](_0x222c25['value']),null);}else{var _0x256a9d='%'+_0x222c25[_0xa8f1('0x60')]+'%';_0x13807e[_0x211614]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x256a9d,_0x256a9d,_0x256a9d);}}else{_0x4766c7=_[_0xa8f1('0x69')](_0x279365,[_0xa8f1('0x29'),'ContactId']);_0x222c25[_0xa8f1('0x47')]=_0xa8f1('0x6a');_0x4ba9fe=as[_0xa8f1('0x6b')](_0x281ad0,_0x4766c7[_0xa8f1('0x37')],_0x222c25);_0x13807e[_0x211614](_0x4ba9fe[_0xa8f1('0x6c')],_0x4ba9fe[_0xa8f1('0x60')][_0xa8f1('0x6d')],_0x4ba9fe[_0xa8f1('0x60')][_0xa8f1('0x1e')]);}break;case _0xa8f1('0x6e'):var _0x2baa53=_0x222c25[_0xa8f1('0x60')]['split'](',')[_0xa8f1('0x2b')](function(_0x1b893a){return Number(_0x1b893a);});_0x2baa53[_0xa8f1('0x2e')](function(_0x5d2572){_0x2d9e60['or'](_0xa8f1('0x6f'),'%,'+_0x5d2572+',%');});_0x2cb64b=_['union'](_0x2cb64b,_0x2baa53);break;case _0xa8f1('0x70'):if(_0x222c25[_0xa8f1('0x65')]===_0xa8f1('0x66')){_0x13807e[_0x211614]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x222c25['value']+'%',null);}else{_0x4766c7=_['find'](_0x279365,['name',_0xa8f1('0x71')]);_0x222c25['field']='UserId';_0x4ba9fe=as[_0xa8f1('0x6b')](_0x281ad0,_0x4766c7[_0xa8f1('0x37')],_0x222c25);_0x13807e[_0x211614](_0x4ba9fe[_0xa8f1('0x6c')],_0x4ba9fe['value'][_0xa8f1('0x6d')],_0x4ba9fe[_0xa8f1('0x60')][_0xa8f1('0x1e')]);}break;case _0xa8f1('0x72'):_0x4ba9fe=as[_0xa8f1('0x6b')]('me',null,_0x222c25);_0x13807e[_0x211614](_0x4ba9fe[_0xa8f1('0x6c')],_0x4ba9fe['value']['start'],_0x4ba9fe['value'][_0xa8f1('0x1e')]);break;}}else{var _0x4ba9fe=as['buildExpression'](_0x281ad0,_0x4766c7['type'],_0x222c25);_0x13807e[_0x211614](_0x4ba9fe['text'],_0x4ba9fe[_0xa8f1('0x60')][_0xa8f1('0x6d')],_0x4ba9fe[_0xa8f1('0x60')][_0xa8f1('0x1e')]);}}}else{var _0x12fd52=_(_0x922ba5[_0xa8f1('0x3a')])[_0xa8f1('0x3b')]()[_0xa8f1('0x2b')](function(_0x5272d4){return _['some'](_0x279365,['name',_0x5272d4])?_0x5272d4:undefined;})['compact']()[_0xa8f1('0x60')]();if(!_[_0xa8f1('0x73')](_0x12fd52)){_0x12fd52[_0xa8f1('0x2e')](function(_0x23b139){if(_0x23b139==='MailAccountId'){_0x546289[_0xa8f1('0x44')](_0xa8f1('0x74'),[][_0xa8f1('0x75')](_0x922ba5[_0xa8f1('0x3a')][_0x23b139]));}else if(_0x23b139===_0xa8f1('0x76')){var _0x5ba2af=JSON[_0xa8f1('0x77')](_0x922ba5['query'][_0x23b139])[_0xa8f1('0x78')];var _0x573161=JSON['parse'](_0x922ba5[_0xa8f1('0x3a')][_0x23b139])[_0xa8f1('0x79')];_0x546289['where'](_0xa8f1('0x7a'),_0x5ba2af,_0x573161);}else{if(_0x922ba5[_0xa8f1('0x3a')][_0x23b139]===_0xa8f1('0x7b')){_0x546289[_0xa8f1('0x44')]('i.'+_0x23b139+'\x20IS\x20NULL');}else{_0x546289[_0xa8f1('0x44')]('i.'+_0x23b139+'\x20=\x20?',_0x922ba5[_0xa8f1('0x3a')][_0x23b139]);}}});}if(_0x922ba5['query']['read']){if(_0x922ba5[_0xa8f1('0x3a')][_0xa8f1('0x7c')]==0x1){_0x546289[_0xa8f1('0x61')]('`unreadMessages`\x20=\x200');}else{_0x546289[_0xa8f1('0x61')](_0xa8f1('0x7d'));}}if(_0x922ba5[_0xa8f1('0x3a')][_0xa8f1('0x7e')]){_0x2cb64b=_['isArray'](_0x922ba5[_0xa8f1('0x3a')][_0xa8f1('0x7e')])?_0x922ba5[_0xa8f1('0x3a')][_0xa8f1('0x7e')]:new Array(_0x922ba5[_0xa8f1('0x3a')]['tag']);_0x2cb64b['forEach'](function(_0x6a7c8){_0x2d9e60['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x6a7c8+',%');});}if(_0x922ba5[_0xa8f1('0x3a')]['filter']){var _0x43e398=_0x922ba5['query'][_0xa8f1('0x7f')][_0xa8f1('0x80')]('\x5c','\x5c\x5c')[_0xa8f1('0x80')]('\x27\x27',_0xa8f1('0x81'));if(qs[_0xa8f1('0x82')](_0x43e398)){_0x13807e['or']('i.id\x20LIKE\x20?',_0x43e398+'%');}else if(qs[_0xa8f1('0x83')](_0x43e398)){_0x13807e['or']('c.email\x20LIKE\x20?',_0x43e398+'%');}else{_0x13807e['or'](_0xa8f1('0x84'),qs[_0xa8f1('0x68')](_0x43e398))['or'](_0xa8f1('0x85'),qs[_0xa8f1('0x68')](_0x43e398));}}}_0x546289[_0xa8f1('0x44')](_0x13807e);_0x546289[_0xa8f1('0x86')]('i.id');var _0x5c438b={'type':db[_0xa8f1('0x87')]['QueryTypes'][_0xa8f1('0x88')],'raw':!![]};var _0x532390=_0x546289[_0xa8f1('0x89')]();_0x532390['field']('i.id');_0x532390[_0xa8f1('0x47')](_0xa8f1('0x8a'),_0xa8f1('0x5f'));if(_0x4cdeba[_0xa8f1('0x42')]){_0x4cdeba[_0xa8f1('0x42')][_0xa8f1('0x2e')](function(_0x159146){_0x546289['order']('i.'+_0x159146[0x0],_0x159146[0x1]===_0xa8f1('0x8b')?![]:!![]);});}if(!_[_0xa8f1('0x73')](_0x2cb64b)){_0x546289[_0xa8f1('0x61')](_0x2d9e60);_0x532390[_0xa8f1('0x44')](_0xa8f1('0x8c'),_0x2cb64b);}BPromise['resolve']()[_0xa8f1('0x27')](function(){if(!_0x38c273&&_0x922ba5['query'][_0xa8f1('0x8d')])return;return _0x922ba5[_0xa8f1('0x8e')][_0xa8f1('0x8f')]({'attributes':['id'],'raw':!![]})['then'](function(_0x554183){if(_['isEmpty'](_0x554183)){_0x532390[_0xa8f1('0x44')](_0xa8f1('0x90'));_0x546289[_0xa8f1('0x44')](_0xa8f1('0x90'));}else{_0x532390[_0xa8f1('0x44')]('i.MailAccountId\x20IN\x20?',_[_0xa8f1('0x2b')](_0x554183,'id'));_0x546289['where'](_0xa8f1('0x74'),_[_0xa8f1('0x2b')](_0x554183,'id'));}});})[_0xa8f1('0x27')](function(){db[_0xa8f1('0x91')][_0xa8f1('0x3a')](_0x532390['toString'](),_0x5c438b)[_0xa8f1('0x27')](function(_0x1305e9){_0x47e3b6[_0xa8f1('0x92')]=_0x1305e9['length'];if(_0x47e3b6[_0xa8f1('0x92')]===0x0)return[];return db[_0xa8f1('0x91')][_0xa8f1('0x3a')](_0x58b261[_0xa8f1('0x93')](),_0x5c438b)['then'](function(_0x440e87){_0x3e8272=_[_0xa8f1('0x94')](_0x440e87,'id');_0x5c438b=_[_0xa8f1('0x95')](_0x5c438b,{'model':db[_0xa8f1('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x546289[_0xa8f1('0x47')](_0xa8f1('0x8a'),_0xa8f1('0x5f'));_0x546289[_0xa8f1('0x47')](_0xa8f1('0x96'),_0xa8f1('0x97'));_0x546289[_0xa8f1('0x47')]('a.mandatoryDisposition',_0xa8f1('0x98'));_0x546289[_0xa8f1('0x47')](_0xa8f1('0x99'));_0x546289[_0xa8f1('0x47')](_0xa8f1('0x9a'));_0x546289[_0xa8f1('0x47')]('i.updatedAt');_0x546289[_0xa8f1('0x47')](_0xa8f1('0x9b'));_0x546289['field'](_0xa8f1('0x9c'));_0x546289[_0xa8f1('0x47')]('i.attach');_0x546289['field'](_0xa8f1('0x9d'));_0x546289[_0xa8f1('0x47')]('i.lastMsgDirection');_0x546289['field'](_0xa8f1('0x9e'));_0x546289[_0xa8f1('0x47')]('i.disposition');_0x546289[_0xa8f1('0x47')]('i.substatus');_0x546289[_0xa8f1('0x47')](_0xa8f1('0x9f'));_0x546289['field']('i.ContactId');_0x546289['field'](_0xa8f1('0xa0'));_0x546289[_0xa8f1('0x47')](_0xa8f1('0xa1'));_0x546289[_0xa8f1('0x47')](_0xa8f1('0xa2'),_0xa8f1('0xa3'));_0x546289[_0xa8f1('0x47')]('c.lastName',_0xa8f1('0xa4'));_0x546289[_0xa8f1('0x47')]('c.email',_0xa8f1('0xa5'));_0x546289['field']('c.phone','Contact.phone');_0x546289[_0xa8f1('0x47')]('c.mobile',_0xa8f1('0xa6'));_0x546289[_0xa8f1('0x47')](_0xa8f1('0xa7'),'Contact.fax');_0x546289['field'](_0xa8f1('0xa8'),_0xa8f1('0x2c'));_0x546289[_0xa8f1('0x21')](_0x4cdeba[_0xa8f1('0x21')]);_0x546289['offset'](_0x4cdeba[_0xa8f1('0x20')]);return db[_0xa8f1('0x91')][_0xa8f1('0x3a')](_0x546289[_0xa8f1('0x93')](),_0x5c438b);})[_0xa8f1('0x27')](function(_0x34414f){_0x534a14[_0xa8f1('0x44')](_0xa8f1('0xa9'),_[_0xa8f1('0x2b')](_0x34414f,'id'));return db[_0xa8f1('0x91')][_0xa8f1('0x3a')](_0x534a14[_0xa8f1('0x93')](),_0x5c438b)[_0xa8f1('0x27')](function(_0x160f73){var _0x319482=_[_0xa8f1('0xaa')](_0x160f73,_0xa8f1('0xab'));var _0x3b2134=[];return db[_0xa8f1('0xac')]['findOne']({'attributes':['enableEmailPreview'],'raw':!![]})[_0xa8f1('0x27')](function(_0x15180f){var _0x5e45cb=_0x15180f['enableEmailPreview'];_0x34414f[_0xa8f1('0x2e')](function(_0x23f31c){_0x3b2134[_0xa8f1('0x30')](updateMailInteraction(_0x23f31c,_0x3e8272,_0x319482,_0x5e45cb));});return BPromise['all'](_0x3b2134);});});});})[_0xa8f1('0x27')](function(_0x194a4c){_0x47e3b6['rows']=_0x194a4c;return _0x47e3b6;})[_0xa8f1('0x27')](respondWithFilteredResult(_0x18e6f2,_0x4cdeba));})[_0xa8f1('0x34')](handleError(_0x18e6f2,null));};exports[_0xa8f1('0xad')]=function(_0x5a3e1a,_0x129430){var _0x17c2a7={'raw':![],'where':{'id':_0x5a3e1a['params']['id']}},_0x259f40={};_0x259f40[_0xa8f1('0x39')]=_[_0xa8f1('0x3b')](db['MailInteraction'][_0xa8f1('0x36')]);_0x259f40[_0xa8f1('0x3a')]=_[_0xa8f1('0x3b')](_0x5a3e1a[_0xa8f1('0x3a')]);_0x259f40['filters']=_[_0xa8f1('0x3c')](_0x259f40['model'],_0x259f40[_0xa8f1('0x3a')]);_0x17c2a7['attributes']=_[_0xa8f1('0x3c')](_0x259f40[_0xa8f1('0x39')],qs[_0xa8f1('0x3e')](_0x5a3e1a[_0xa8f1('0x3a')][_0xa8f1('0x3e')]));_0x17c2a7[_0xa8f1('0x3d')]=_0x17c2a7['attributes'][_0xa8f1('0x3f')]?_0x17c2a7['attributes']:_0x259f40['model'];if(_0x5a3e1a[_0xa8f1('0x3a')][_0xa8f1('0xae')]){_0x17c2a7[_0xa8f1('0xaf')]=[{'all':!![]}];}_0x17c2a7=_[_0xa8f1('0x95')]({},_0x17c2a7,_0x5a3e1a['options']);return db['MailInteraction'][_0xa8f1('0x69')](_0x17c2a7)[_0xa8f1('0x27')](handleEntityNotFound(_0x129430,null))[_0xa8f1('0x27')](respondWithResult(_0x129430,null))['catch'](handleError(_0x129430,null));};exports[_0xa8f1('0xb0')]=function(_0x14e167,_0x2b0f08){return db['MailInteraction']['create'](_0x14e167[_0xa8f1('0xb1')],{})[_0xa8f1('0x27')](respondWithResult(_0x2b0f08,0xc9))[_0xa8f1('0x34')](handleError(_0x2b0f08,null));};exports[_0xa8f1('0x26')]=function(_0x155e6b,_0x8ad99){if(_0x155e6b[_0xa8f1('0xb1')]['id']){delete _0x155e6b[_0xa8f1('0xb1')]['id'];}return db[_0xa8f1('0x35')]['find']({'where':{'id':_0x155e6b[_0xa8f1('0xb2')]['id']}})[_0xa8f1('0x27')](handleEntityNotFound(_0x8ad99,null))[_0xa8f1('0x27')](saveUpdates(_0x155e6b[_0xa8f1('0xb1')],null))['then'](respondWithResult(_0x8ad99,null))[_0xa8f1('0x34')](handleError(_0x8ad99,null));};exports[_0xa8f1('0x28')]=function(_0x14afb7,_0x3dc363){return db[_0xa8f1('0x35')][_0xa8f1('0x69')]({'where':{'id':_0x14afb7['params']['id']}})[_0xa8f1('0x27')](handleEntityNotFound(_0x3dc363,null))['then'](removeEntity(_0x3dc363,null))[_0xa8f1('0x34')](handleError(_0x3dc363,null));};exports[_0xa8f1('0xb3')]=function(_0x54ca76,_0x4749bf){return db[_0xa8f1('0x35')][_0xa8f1('0xb3')]()[_0xa8f1('0x27')](respondWithResult(_0x4749bf,null))[_0xa8f1('0x34')](handleError(_0x4749bf,null));};exports[_0xa8f1('0xb4')]=function(_0x381263,_0x480167,_0x30eb4d){return db[_0xa8f1('0xb5')][_0xa8f1('0x69')]({'where':{'id':_0x381263[_0xa8f1('0xb2')]['id']}})[_0xa8f1('0x27')](handleEntityNotFound(_0x480167,null))[_0xa8f1('0x27')](function(_0xe4f09d){if(_0xe4f09d){return _0xe4f09d[_0xa8f1('0xb4')](_0x381263[_0xa8f1('0xb1')][_0xa8f1('0xb6')],_[_0xa8f1('0xb7')](_0x381263[_0xa8f1('0xb1')],[_0xa8f1('0xb6'),'id'])||{});}})['then'](respondWithResult(_0x480167,null))[_0xa8f1('0x34')](handleError(_0x480167,null));};exports[_0xa8f1('0xb8')]=function(_0x374905,_0x3c37f1,_0x2cade2){var _0x1e698d={'raw':![],'where':{}};var _0x3ca63d={};var _0x86aad9={'count':0x0,'rows':[]};return db[_0xa8f1('0x35')]['findOne']({'where':{'id':_0x374905[_0xa8f1('0xb2')]['id']}})[_0xa8f1('0x27')](handleEntityNotFound(_0x3c37f1,null))[_0xa8f1('0x27')](function(_0x9a9e3a){if(_0x9a9e3a){_0x3ca63d[_0xa8f1('0x39')]=_[_0xa8f1('0x3b')](db[_0xa8f1('0xb5')]['rawAttributes']);_0x3ca63d[_0xa8f1('0x3a')]=_[_0xa8f1('0x3b')](_0x374905[_0xa8f1('0x3a')]);_0x3ca63d[_0xa8f1('0x45')]=_[_0xa8f1('0x3c')](_0x3ca63d['model'],_0x3ca63d[_0xa8f1('0x3a')]);_0x1e698d[_0xa8f1('0x3d')]=_[_0xa8f1('0x3c')](_0x3ca63d[_0xa8f1('0x39')],qs['fields'](_0x374905[_0xa8f1('0x3a')][_0xa8f1('0x3e')]));_0x1e698d[_0xa8f1('0x3d')]=_0x1e698d['attributes'][_0xa8f1('0x3f')]?_0x1e698d['attributes']:_0x3ca63d['model'];if(!_0x374905[_0xa8f1('0x3a')]['hasOwnProperty'](_0xa8f1('0x41'))){_0x1e698d[_0xa8f1('0x21')]=qs[_0xa8f1('0x21')](_0x374905[_0xa8f1('0x3a')][_0xa8f1('0x21')]);_0x1e698d[_0xa8f1('0x20')]=qs[_0xa8f1('0x20')](_0x374905[_0xa8f1('0x3a')][_0xa8f1('0x20')]);}_0x1e698d[_0xa8f1('0x42')]=qs[_0xa8f1('0x43')](_0x374905[_0xa8f1('0x3a')][_0xa8f1('0x43')]);_0x1e698d['where']=qs[_0xa8f1('0x45')](_[_0xa8f1('0x46')](_0x374905[_0xa8f1('0x3a')],_0x3ca63d[_0xa8f1('0x45')]));_0x1e698d['where'][_0xa8f1('0xab')]=_0x9a9e3a['id'];if(_0x374905[_0xa8f1('0x3a')][_0xa8f1('0x7f')]){_0x1e698d[_0xa8f1('0x44')]=_[_0xa8f1('0x95')](_0x1e698d[_0xa8f1('0x44')],{'$or':_['map'](_0x1e698d[_0xa8f1('0x3d')],function(_0x296b3c){var _0x515a5c={};_0x515a5c[_0x296b3c]={'$like':'%'+_0x374905[_0xa8f1('0x3a')][_0xa8f1('0x7f')]+'%'};return _0x515a5c;})});}if(_0x374905['query'][_0xa8f1('0x78')]){var _0x165758=_0x374905[_0xa8f1('0x3a')][_0xa8f1('0x78')]['split'](',');var _0x30ddf1={};_0x30ddf1[_0x165758[0x0]]={'$gte':moment(_0x165758[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1e698d[_0xa8f1('0x44')]=_[_0xa8f1('0x95')](_0x1e698d[_0xa8f1('0x44')],_0x30ddf1);}_0x1e698d=_[_0xa8f1('0x95')]({},_0x1e698d,_0x374905[_0xa8f1('0xb9')]);return db[_0xa8f1('0xb5')][_0xa8f1('0x92')]({'where':_0x1e698d[_0xa8f1('0x44')]})[_0xa8f1('0x27')](function(_0x2524a6){_0x86aad9[_0xa8f1('0x92')]=_0x2524a6;if(_0x374905['query'][_0xa8f1('0xae')]){_0x1e698d[_0xa8f1('0xaf')]=[{'all':!![]}];}return db[_0xa8f1('0xb5')][_0xa8f1('0xba')](_0x1e698d);})[_0xa8f1('0x27')](function(_0x1995c1){_0x86aad9[_0xa8f1('0xbb')]=_0x1995c1;return _0x86aad9;});}})[_0xa8f1('0x27')](respondWithFilteredResult(_0x3c37f1,_0x1e698d))[_0xa8f1('0x34')](handleError(_0x3c37f1,null));};exports[_0xa8f1('0xbc')]=function(_0xbd973,_0x8f6e6d,_0x48d26e){return db[_0xa8f1('0x35')]['find']({'where':{'id':_0xbd973[_0xa8f1('0xb2')]['id']}})['then'](handleEntityNotFound(_0x8f6e6d,null))[_0xa8f1('0x27')](function(_0x4c5005){if(_0x4c5005){return _0x4c5005[_0xa8f1('0xbd')](_0xbd973[_0xa8f1('0xb1')][_0xa8f1('0xb6')],_[_0xa8f1('0xb7')](_0xbd973[_0xa8f1('0xb1')],[_0xa8f1('0xb6'),'id'])||{})[_0xa8f1('0xbe')](function(){return db['Tag'][_0xa8f1('0xba')]({'attributes':['id','name',_0xa8f1('0x48')],'where':{'id':_0xbd973['body'][_0xa8f1('0xb6')]}});})[_0xa8f1('0x27')](function(_0x20ac26){socket[_0xa8f1('0xbf')](_0xa8f1('0xc0'),{'id':Number(_0xbd973['params']['id']),'tags':_0x20ac26||[]});return{'id':Number(_0xbd973[_0xa8f1('0xb2')]['id']),'tags':_0x20ac26||[]};});}})[_0xa8f1('0x27')](respondWithResult(_0x8f6e6d,null))['catch'](handleError(_0x8f6e6d,null));};exports['removeTags']=function(_0x55b95f,_0x4278dc,_0x20762e){return db[_0xa8f1('0x35')][_0xa8f1('0x69')]({'where':{'id':_0x55b95f['params']['id']}})[_0xa8f1('0x27')](handleEntityNotFound(_0x4278dc,null))[_0xa8f1('0x27')](function(_0x5757ee){if(_0x5757ee){return _0x5757ee[_0xa8f1('0xc1')](_0x55b95f[_0xa8f1('0x3a')][_0xa8f1('0xb6')]);}})[_0xa8f1('0x27')](respondWithStatusCode(_0x4278dc,null))[_0xa8f1('0x34')](handleError(_0x4278dc,null));};exports[_0xa8f1('0xc2')]=function(_0x4d963d,_0x27fca2){var _0x470444=moment()[_0xa8f1('0xc3')]()[_0xa8f1('0x93')]();var _0x43d175=path[_0xa8f1('0xc4')](config[_0xa8f1('0xc5')],_0xa8f1('0xc6'),'files',_0xa8f1('0xc7'));var _0x2977ed=path[_0xa8f1('0xc4')](config[_0xa8f1('0xc5')],_0xa8f1('0xc6'),'files',_0xa8f1('0xc8'));var _0x498452=path[_0xa8f1('0xc4')](_0x2977ed,_0x470444);var _0x2ce914=util[_0xa8f1('0xc9')](_0xa8f1('0xca'),_0x470444);var _0x4679c1=path[_0xa8f1('0xc4')](_0x2977ed,_0x2ce914);var _0x1e84c9=![];return db['MailInteraction']['find']({'where':{'id':_0x4d963d[_0xa8f1('0xb2')]['id']}})[_0xa8f1('0x27')](handleEntityNotFound(_0x27fca2,null))[_0xa8f1('0x27')](function(_0x37b458){if(_0x37b458){return _0x37b458[_0xa8f1('0xb8')]({'attributes':['id',_0xa8f1('0xb1'),'from','to','cc',_0xa8f1('0xcb'),'subject','createdAt'],'where':{'secret':![]},'include':_0x4d963d[_0xa8f1('0x3a')]['attachments']?[{'model':db['Attachment'],'as':_0xa8f1('0xcc')}]:undefined,'order':qs[_0xa8f1('0x43')]('id')});}return[];})[_0xa8f1('0x27')](function(_0x524ec4){_0x1e84c9=_0x524ec4[_0xa8f1('0x3f')];if(_0x524ec4[_0xa8f1('0x3f')]){fs[_0xa8f1('0xcd')](_0x498452);return BPromise[_0xa8f1('0xce')](_0x524ec4,function(_0x349dbd,_0x51063a){var _0x26cccb=_0x349dbd;var _0x5bd233={'from':_0x26cccb['from'],'to':_0x26cccb['to'],'subject':_0x26cccb[_0xa8f1('0xcf')],'html':_0x26cccb[_0xa8f1('0xb1')],'headers':{'Date':moment(_0x26cccb['createdAt'])[_0xa8f1('0xc9')](_0xa8f1('0xd0'))},'attachments':[]};if(_0x349dbd['cc']){_0x5bd233[_0xa8f1('0xd1')]['Cc']=_0x349dbd['cc'];}if(_0x349dbd[_0xa8f1('0xcb')]){_0x5bd233['headers'][_0xa8f1('0xd2')]=_0x349dbd[_0xa8f1('0xcb')];}return new BPromise(function(_0x46c446,_0x509983){if(_0x349dbd[_0xa8f1('0xcc')]){for(var _0x4ab4dc=0x0;_0x4ab4dc<_0x349dbd[_0xa8f1('0xcc')][_0xa8f1('0x3f')];_0x4ab4dc++){var _0x3418f5=_0x349dbd[_0xa8f1('0xcc')][_0x4ab4dc];var _0x218122=path[_0xa8f1('0xc4')](_0x43d175,_0x3418f5[_0xa8f1('0xd3')]);if(fs[_0xa8f1('0xd4')](_0x218122)){_0x5bd233['attachments'][_0xa8f1('0x30')]({'name':_0x3418f5['name'],'contentType':_0x3418f5[_0xa8f1('0x37')],'data':fs['readFileSync'](_0x218122)});}}}emlformat['build'](_0x5bd233,function(_0x55bddf,_0x5ed8fc){if(_0x55bddf)return _0x509983(_0x55bddf);fs[_0xa8f1('0xd5')](path['join'](_0x498452,util[_0xa8f1('0xc9')](_0xa8f1('0xd6'),_0x51063a)),_0x5ed8fc);return _0x46c446(_0x5ed8fc);});});});}})[_0xa8f1('0x27')](function(){if(_0x1e84c9){return new BPromise(function(_0x59edab,_0x2f9738){zipdir(_0x498452,{'saveTo':_0x4679c1},function(_0xd9a5e8,_0x542700){if(_0xd9a5e8)return _0x2f9738(_0xd9a5e8);return _0x59edab(_0x542700);});});}})[_0xa8f1('0x27')](function(){if(_0x1e84c9){return new BPromise(function(_0xf24ec3,_0x19696e){rimraf(_0x498452,function(_0x24fe35){if(_0x24fe35)_0x19696e(_0x24fe35);return _0xf24ec3();});});}})[_0xa8f1('0x27')](function(){if(_0x1e84c9){return _0x27fca2[_0xa8f1('0xc2')](_0x4679c1,_0x2ce914,function(_0x1a1fb6){if(_0x1a1fb6){console[_0xa8f1('0xd7')](_0xa8f1('0xd8'),_0x1a1fb6);}else{fs['unlinkSync'](_0x4679c1);}});}else{return _0x27fca2['sendStatus'](0xc8);}})[_0xa8f1('0x34')](handleError(_0x27fca2,null));}; \ No newline at end of file +var _0x6ab9=['Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','send','map','TagIds','push','MailInteraction','lastMsgText','lastMsgBody','catch','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','sort','where','pick','select','field','color','tools_tags','u.id','ui.MailInteractionId','from','user_has_mail_interactions','left_join','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','expr','search','parseSearch','conditions','find','value','having','`\x20>\x200','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','type','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','plainBody','some','isEmpty','MailAccountId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','tag','filter','replace','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','resolve','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.closed','i.attach','i.lastMsgAt','i.lastMsgDirection','i.substatus','i.to','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','findOne','enableEmailPreview','all','show','params','includeAll','options','create','body','describe','addMessage','omit','ids','getMessages','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','MailMessage','include','rows','addTags','setTags','findAll','emit','mailInteractionTags:save','unix','root','server','join','tmp','format','bcc','subject','attachments','Attachment','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','readFileSync','build','message%d.eml','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','end','status','json','count','offset','limit','set'];(function(_0x42be51,_0x324fc2){var _0x2a8496=function(_0x26c745){while(--_0x26c745){_0x42be51['push'](_0x42be51['shift']());}};_0x2a8496(++_0x324fc2);}(_0x6ab9,0x19a));var _0x96ab=function(_0x2261ce,_0x9ed8b6){_0x2261ce=_0x2261ce-0x0;var _0x524640=_0x6ab9[_0x2261ce];return _0x524640;};'use strict';var pdf=require(_0x96ab('0x0'));var emlformat=require(_0x96ab('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x96ab('0x2'));var jsonpatch=require(_0x96ab('0x3'));var rp=require(_0x96ab('0x4'));var moment=require(_0x96ab('0x5'));var BPromise=require(_0x96ab('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x96ab('0x7'));var sox=require(_0x96ab('0x8'));var csv=require(_0x96ab('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x96ab('0xa'));var squel=require(_0x96ab('0xb'));var crypto=require('crypto');var jsforce=require(_0x96ab('0xc'));var deskjs=require(_0x96ab('0xd'));var toCsv=require(_0x96ab('0x9'));var querystring=require(_0x96ab('0xe'));var Papa=require(_0x96ab('0xf'));var htmlToText=require(_0x96ab('0x10'));var Redis=require(_0x96ab('0x11'));var authService=require(_0x96ab('0x12'));var qs=require(_0x96ab('0x13'));var as=require(_0x96ab('0x14'));var hardwareService=require(_0x96ab('0x15'));var logger=require(_0x96ab('0x16'))(_0x96ab('0x17'));var utils=require('../../config/utils');var config=require(_0x96ab('0x18'));var db=require('../../mysqldb')['db'];config[_0x96ab('0x19')]=_[_0x96ab('0x1a')](config[_0x96ab('0x19')],{'host':_0x96ab('0x1b'),'port':0x18eb});var socket=require(_0x96ab('0x1c'))(new Redis(config[_0x96ab('0x19')]));require(_0x96ab('0x1d'))[_0x96ab('0x1e')](socket);function respondWithStatusCode(_0x126761,_0x3fb987){_0x3fb987=_0x3fb987||0xcc;return function(_0xba0d5e){if(_0xba0d5e){return _0x126761['sendStatus'](_0x3fb987);}return _0x126761['status'](_0x3fb987)[_0x96ab('0x1f')]();};}function respondWithResult(_0x8d5c87,_0x3843bc){_0x3843bc=_0x3843bc||0xc8;return function(_0x57237a){if(_0x57237a){return _0x8d5c87[_0x96ab('0x20')](_0x3843bc)[_0x96ab('0x21')](_0x57237a);}};}function respondWithFilteredResult(_0x56f92b,_0x20c685){return function(_0x4eca78){if(_0x4eca78){var _0x231ed5=_0x4eca78[_0x96ab('0x22')],_0x1a502a=_0x20c685[_0x96ab('0x23')],_0x397ffc=_0x20c685[_0x96ab('0x23')]+_0x20c685[_0x96ab('0x24')],_0x23f826;if(_0x397ffc>=_0x231ed5){_0x397ffc=_0x231ed5;_0x23f826=0xc8;}else{_0x23f826=0xce;}_0x56f92b[_0x96ab('0x20')](_0x23f826);return _0x56f92b[_0x96ab('0x25')](_0x96ab('0x26'),_0x1a502a+'-'+_0x397ffc+'/'+_0x231ed5)['json'](_0x4eca78);}return null;};}function patchUpdates(_0x50571b){return function(_0x347b91){try{jsonpatch[_0x96ab('0x27')](_0x347b91,_0x50571b,!![]);}catch(_0x7ce121){return BPromise['reject'](_0x7ce121);}return _0x347b91[_0x96ab('0x28')]();};}function saveUpdates(_0x5ccaaa,_0xb05aa4){return function(_0x567bf1){if(_0x567bf1){return _0x567bf1[_0x96ab('0x29')](_0x5ccaaa)[_0x96ab('0x2a')](function(_0x5a02d0){return _0x5a02d0;});}return null;};}function removeEntity(_0x1deef7,_0x84a7f7){return function(_0x4475b6){if(_0x4475b6){return _0x4475b6[_0x96ab('0x2b')]()[_0x96ab('0x2a')](function(){_0x1deef7[_0x96ab('0x20')](0xcc)[_0x96ab('0x1f')]();});}};}function handleEntityNotFound(_0x2837a7,_0x218a4c){return function(_0x53869e){if(!_0x53869e){_0x2837a7[_0x96ab('0x2c')](0x194);}return _0x53869e;};}function handleError(_0x524e1c,_0x14ff59){_0x14ff59=_0x14ff59||0x1f4;return function(_0x44e219){logger[_0x96ab('0x2d')](_0x44e219[_0x96ab('0x2e')]);if(_0x44e219[_0x96ab('0x2f')]){delete _0x44e219[_0x96ab('0x2f')];}_0x524e1c[_0x96ab('0x20')](_0x14ff59)[_0x96ab('0x30')](_0x44e219);};}function getInteractionUsers(_0x4f954c,_0xefb070){return new BPromise(function(_0x269c51,_0xa5c503){try{if(_0xefb070[_0x4f954c['id']]){_0x4f954c['Users']=_[_0x96ab('0x31')](_0xefb070[_0x4f954c['id']],function(_0x27275d){return{'id':_0x27275d['id']};});}}catch(_0x14469c){_0xa5c503(_0x14469c);}_0x269c51(_0x4f954c);});}function getInteractionTags(_0x575664,_0xaccba6){return new BPromise(function(_0x4c9a55,_0x40a55b){try{if(_0x575664[_0x96ab('0x32')]){_0x575664['Tags']=[];_0x575664[_0x96ab('0x32')]['split'](',')['forEach'](function(_0x5bb4b2){_0x575664['Tags'][_0x96ab('0x33')](_0xaccba6[_0x5bb4b2]);});}delete _0x575664['TagIds'];}catch(_0x284bb7){_0x40a55b(_0x284bb7);}_0x4c9a55(_0x575664);});}function getLastMessageText(_0x3d0ca7){return new BPromise(function(_0x1d260f,_0xb88b3b){return db[_0x96ab('0x34')]['findOne']({'where':{'id':_0x3d0ca7['id']},'attributes':['lastMsgBody',_0x96ab('0x35')],'raw':!![]})[_0x96ab('0x2a')](function(_0x56e3e2){if(!_0x56e3e2[_0x96ab('0x35')]){_0x3d0ca7[_0x96ab('0x35')]=_['trimStart'](htmlToText['fromString'](_0x56e3e2[_0x96ab('0x36')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x3d0ca7[_0x96ab('0x35')]=_0x56e3e2[_0x96ab('0x35')];}_0x1d260f(_0x3d0ca7);})[_0x96ab('0x37')](function(_0x4fdba8){_0xb88b3b(_0x4fdba8);});});}function updateMailInteraction(_0x182074,_0x48745b,_0x5e9020,_0x304382){return new BPromise(function(_0x4c2427,_0x3b59b3){return getInteractionUsers(_0x182074,_0x5e9020)[_0x96ab('0x2a')](function(_0x243920){return getInteractionTags(_0x243920,_0x48745b);})[_0x96ab('0x2a')](function(_0x4d0612){if(_0x304382){_0x4c2427(getLastMessageText(_0x4d0612));}else{_0x4c2427(_0x4d0612);}})[_0x96ab('0x37')](function(_0x10700f){_0x3b59b3(_0x10700f);});});}exports[_0x96ab('0x38')]=function(_0x376775,_0x2f86f3){var _0x58c8e6={},_0x292ab4={},_0x4aaa0b={'count':0x0,'rows':[]};var _0x1e76f6=_['map'](db[_0x96ab('0x34')][_0x96ab('0x39')],function(_0x3f2305){return{'name':_0x3f2305[_0x96ab('0x3a')],'type':_0x3f2305['type'][_0x96ab('0x3b')]};});_0x292ab4[_0x96ab('0x3c')]=_[_0x96ab('0x31')](_0x1e76f6,_0x96ab('0x2f'));_0x292ab4[_0x96ab('0x3d')]=_[_0x96ab('0x3e')](_0x376775[_0x96ab('0x3d')]);_0x292ab4[_0x96ab('0x3f')]=_[_0x96ab('0x40')](_0x292ab4[_0x96ab('0x3c')],_0x292ab4[_0x96ab('0x3d')]);_0x58c8e6[_0x96ab('0x41')]=_['intersection'](_0x292ab4['model'],qs[_0x96ab('0x42')](_0x376775[_0x96ab('0x3d')][_0x96ab('0x42')]));_0x58c8e6[_0x96ab('0x41')]=_0x58c8e6[_0x96ab('0x41')][_0x96ab('0x43')]?_0x58c8e6[_0x96ab('0x41')]:_0x292ab4['model'];if(!_0x376775[_0x96ab('0x3d')]['hasOwnProperty']('nolimit')){_0x58c8e6[_0x96ab('0x24')]=qs[_0x96ab('0x24')](_0x376775['query'][_0x96ab('0x24')]);_0x58c8e6[_0x96ab('0x23')]=qs[_0x96ab('0x23')](_0x376775[_0x96ab('0x3d')][_0x96ab('0x23')]);}_0x58c8e6['order']=qs[_0x96ab('0x44')](_0x376775['query']['sort']);_0x58c8e6[_0x96ab('0x45')]=qs['filters'](_[_0x96ab('0x46')](_0x376775[_0x96ab('0x3d')],_0x292ab4[_0x96ab('0x3f')]));var _0x5df719=[];var _0x33399b=squel[_0x96ab('0x47')]()[_0x96ab('0x48')]('id')[_0x96ab('0x48')](_0x96ab('0x2f'))['field'](_0x96ab('0x49'))['from'](_0x96ab('0x4a'));var _0x5343f9=squel[_0x96ab('0x47')]()['field'](_0x96ab('0x4b'))[_0x96ab('0x48')](_0x96ab('0x4c'))[_0x96ab('0x4d')](_0x96ab('0x4e'),'ui')[_0x96ab('0x4f')]('users','u',_0x96ab('0x50'));var _0xc82e38=squel['select']()[_0x96ab('0x4d')]('mail_interactions','i')[_0x96ab('0x4f')](_0x96ab('0x51'),'c',_0x96ab('0x52'))['left_join'](_0x96ab('0x53'),'o',_0x96ab('0x54'))['left_join'](_0x96ab('0x55'),'a',_0x96ab('0x56'))[_0x96ab('0x4f')](_0x96ab('0x57'),'me',_0x96ab('0x58'))[_0x96ab('0x4f')](_0x96ab('0x59'),'it','it.MailInteractionId\x20=\x20i.id')[_0x96ab('0x4f')](_0x96ab('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x2074da=squel[_0x96ab('0x5a')]();var _0x4e1432=[];var _0x3d35b2=squel[_0x96ab('0x5a')]();var _0x391169;if(_0x376775[_0x96ab('0x3d')][_0x96ab('0x5b')]){_0x391169=as[_0x96ab('0x5c')](_0x376775[_0x96ab('0x3d')][_0x96ab('0x5b')]);var _0x972601=_0x391169['sqlOperator'];for(var _0x2ed90f=0x0;_0x2ed90f<_0x391169[_0x96ab('0x5d')][_0x96ab('0x43')];_0x2ed90f++){var _0x27a7fa=_0x391169[_0x96ab('0x5d')][_0x2ed90f];var _0x3a36d8='i';var _0x1f1a28=_[_0x96ab('0x5e')](_0x1e76f6,[_0x96ab('0x2f'),_0x27a7fa[_0x96ab('0x48')]]);if(!_0x1f1a28){switch(_0x27a7fa['field']){case'unreadMessages':if(_0x27a7fa[_0x96ab('0x5f')]==0x1){_0xc82e38[_0x96ab('0x60')]('`'+_0x27a7fa[_0x96ab('0x48')]+'`\x20=\x200');}else{_0xc82e38[_0x96ab('0x60')]('`'+_0x27a7fa[_0x96ab('0x48')]+_0x96ab('0x61'));}break;case'Contact':if(_0x27a7fa['operator']==='$substring'){if(_0x27a7fa['value'][_0x96ab('0x62')]('\x20')[_0x96ab('0x43')]>0x1){_0x2074da[_0x972601](_0x96ab('0x63'),qs[_0x96ab('0x64')](_0x27a7fa[_0x96ab('0x5f')]),null);}else{var _0x4c28b5='%'+_0x27a7fa[_0x96ab('0x5f')]+'%';_0x2074da[_0x972601](_0x96ab('0x65'),_0x4c28b5,_0x4c28b5,_0x4c28b5);}}else{_0x1f1a28=_[_0x96ab('0x5e')](_0x1e76f6,[_0x96ab('0x2f'),_0x96ab('0x66')]);_0x27a7fa[_0x96ab('0x48')]=_0x96ab('0x66');_0x59e32f=as[_0x96ab('0x67')](_0x3a36d8,_0x1f1a28[_0x96ab('0x68')],_0x27a7fa);_0x2074da[_0x972601](_0x59e32f['text'],_0x59e32f['value'][_0x96ab('0x69')],_0x59e32f[_0x96ab('0x5f')]['end']);}break;case _0x96ab('0x6a'):var _0xea0733=_0x27a7fa[_0x96ab('0x5f')][_0x96ab('0x62')](',')[_0x96ab('0x31')](function(_0x134216){return Number(_0x134216);});_0xea0733[_0x96ab('0x6b')](function(_0x7e3386){_0x3d35b2['or'](_0x96ab('0x6c'),'%,'+_0x7e3386+',%');});_0x4e1432=_['union'](_0x4e1432,_0xea0733);break;case _0x96ab('0x6d'):if(_0x27a7fa[_0x96ab('0x6e')]===_0x96ab('0x6f')){_0x2074da[_0x972601](_0x96ab('0x70'),'%'+_0x27a7fa[_0x96ab('0x5f')]+'%',null);}else{_0x1f1a28=_[_0x96ab('0x5e')](_0x1e76f6,['name',_0x96ab('0x71')]);_0x27a7fa[_0x96ab('0x48')]=_0x96ab('0x71');_0x59e32f=as[_0x96ab('0x67')](_0x3a36d8,_0x1f1a28[_0x96ab('0x68')],_0x27a7fa);_0x2074da[_0x972601](_0x59e32f[_0x96ab('0x72')],_0x59e32f['value'][_0x96ab('0x69')],_0x59e32f[_0x96ab('0x5f')][_0x96ab('0x1f')]);}break;case _0x96ab('0x73'):_0x59e32f=as[_0x96ab('0x67')]('me',null,_0x27a7fa);_0x2074da[_0x972601](_0x59e32f[_0x96ab('0x72')],_0x59e32f[_0x96ab('0x5f')][_0x96ab('0x69')],_0x59e32f['value'][_0x96ab('0x1f')]);break;}}else{var _0x59e32f=as[_0x96ab('0x67')](_0x3a36d8,_0x1f1a28['type'],_0x27a7fa);_0x2074da[_0x972601](_0x59e32f[_0x96ab('0x72')],_0x59e32f[_0x96ab('0x5f')][_0x96ab('0x69')],_0x59e32f['value']['end']);}}}else{var _0x51fdda=_(_0x376775[_0x96ab('0x3d')])[_0x96ab('0x3e')]()['map'](function(_0x31b5d1){return _[_0x96ab('0x74')](_0x1e76f6,['name',_0x31b5d1])?_0x31b5d1:undefined;})['compact']()[_0x96ab('0x5f')]();if(!_[_0x96ab('0x75')](_0x51fdda)){_0x51fdda[_0x96ab('0x6b')](function(_0x189061){if(_0x189061===_0x96ab('0x76')){_0xc82e38['where']('i.MailAccountId\x20IN\x20?',[][_0x96ab('0x77')](_0x376775[_0x96ab('0x3d')][_0x189061]));}else if(_0x189061===_0x96ab('0x78')){var _0x28a85b=JSON[_0x96ab('0x79')](_0x376775[_0x96ab('0x3d')][_0x189061])[_0x96ab('0x7a')];var _0x281934=JSON[_0x96ab('0x79')](_0x376775[_0x96ab('0x3d')][_0x189061])[_0x96ab('0x7b')];_0xc82e38[_0x96ab('0x45')](_0x96ab('0x7c'),_0x28a85b,_0x281934);}else{if(_0x376775['query'][_0x189061]===_0x96ab('0x7d')){_0xc82e38[_0x96ab('0x45')]('i.'+_0x189061+_0x96ab('0x7e'));}else{_0xc82e38[_0x96ab('0x45')]('i.'+_0x189061+'\x20=\x20?',_0x376775[_0x96ab('0x3d')][_0x189061]);}}});}if(_0x376775['query']['read']){if(_0x376775['query'][_0x96ab('0x7f')]==0x1){_0xc82e38['having'](_0x96ab('0x80'));}else{_0xc82e38['having']('`unreadMessages`\x20>\x200');}}if(_0x376775[_0x96ab('0x3d')][_0x96ab('0x81')]){_0x4e1432=_['isArray'](_0x376775['query'][_0x96ab('0x81')])?_0x376775['query'][_0x96ab('0x81')]:new Array(_0x376775[_0x96ab('0x3d')][_0x96ab('0x81')]);_0x4e1432[_0x96ab('0x6b')](function(_0x397259){_0x3d35b2['or'](_0x96ab('0x6c'),'%,'+_0x397259+',%');});}if(_0x376775[_0x96ab('0x3d')]['filter']){var _0x2df8a7=_0x376775[_0x96ab('0x3d')][_0x96ab('0x82')]['replace']('\x5c','\x5c\x5c')[_0x96ab('0x83')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x2df8a7)){_0x2074da['or']('i.id\x20LIKE\x20?',_0x2df8a7+'%');}else if(qs[_0x96ab('0x84')](_0x2df8a7)){_0x2074da['or'](_0x96ab('0x85'),_0x2df8a7+'%');}else{_0x2074da['or'](_0x96ab('0x86'),qs[_0x96ab('0x64')](_0x2df8a7))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x96ab('0x64')](_0x2df8a7));}}}_0xc82e38['where'](_0x2074da);_0xc82e38[_0x96ab('0x87')](_0x96ab('0x88'));var _0x25c653={'type':db[_0x96ab('0x89')][_0x96ab('0x8a')][_0x96ab('0x8b')],'raw':!![]};var _0x347966=_0xc82e38[_0x96ab('0x8c')]();_0x347966[_0x96ab('0x48')](_0x96ab('0x88'));_0x347966['field'](_0x96ab('0x8d'),_0x96ab('0x8e'));if(_0x58c8e6[_0x96ab('0x8f')]){_0x58c8e6[_0x96ab('0x8f')][_0x96ab('0x6b')](function(_0x2b1af7){_0xc82e38[_0x96ab('0x8f')]('i.'+_0x2b1af7[0x0],_0x2b1af7[0x1]===_0x96ab('0x90')?![]:!![]);});}if(!_[_0x96ab('0x75')](_0x4e1432)){_0xc82e38['having'](_0x3d35b2);_0x347966['where']('t.id\x20IN\x20?',_0x4e1432);}BPromise[_0x96ab('0x91')]()[_0x96ab('0x2a')](function(){if(!_0x391169&&_0x376775['query']['MailAccountId'])return;return _0x376775[_0x96ab('0x92')][_0x96ab('0x93')]({'attributes':['id'],'raw':!![]})[_0x96ab('0x2a')](function(_0x25a3af){if(_[_0x96ab('0x75')](_0x25a3af)){_0x347966[_0x96ab('0x45')]('i.MailAccountId\x20IS\x20NULL');_0xc82e38[_0x96ab('0x45')](_0x96ab('0x94'));}else{_0x347966[_0x96ab('0x45')](_0x96ab('0x95'),_[_0x96ab('0x31')](_0x25a3af,'id'));_0xc82e38[_0x96ab('0x45')](_0x96ab('0x95'),_[_0x96ab('0x31')](_0x25a3af,'id'));}});})[_0x96ab('0x2a')](function(){db[_0x96ab('0x96')][_0x96ab('0x3d')](_0x347966[_0x96ab('0x97')](),_0x25c653)[_0x96ab('0x2a')](function(_0x2737c4){_0x4aaa0b[_0x96ab('0x22')]=_0x2737c4['length'];if(_0x4aaa0b[_0x96ab('0x22')]===0x0)return[];return db[_0x96ab('0x96')][_0x96ab('0x3d')](_0x33399b['toString'](),_0x25c653)[_0x96ab('0x2a')](function(_0x5136c3){_0x5df719=_[_0x96ab('0x98')](_0x5136c3,'id');_0x25c653=_[_0x96ab('0x99')](_0x25c653,{'model':db[_0x96ab('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});_0xc82e38[_0x96ab('0x48')](_0x96ab('0x8d'),'unreadMessages');_0xc82e38[_0x96ab('0x48')](_0x96ab('0x9a'),'Account.key');_0xc82e38[_0x96ab('0x48')](_0x96ab('0x9b'),_0x96ab('0x9c'));_0xc82e38[_0x96ab('0x48')]('i.id');_0xc82e38[_0x96ab('0x48')](_0x96ab('0x9d'));_0xc82e38[_0x96ab('0x48')]('i.updatedAt');_0xc82e38['field'](_0x96ab('0x9e'));_0xc82e38[_0x96ab('0x48')]('i.closedAt');_0xc82e38[_0x96ab('0x48')](_0x96ab('0x9f'));_0xc82e38['field'](_0x96ab('0xa0'));_0xc82e38['field'](_0x96ab('0xa1'));_0xc82e38[_0x96ab('0x48')]('i.subject');_0xc82e38[_0x96ab('0x48')]('i.disposition');_0xc82e38[_0x96ab('0x48')](_0x96ab('0xa2'));_0xc82e38['field'](_0x96ab('0xa3'));_0xc82e38[_0x96ab('0x48')]('i.ContactId');_0xc82e38[_0x96ab('0x48')](_0x96ab('0xa4'));_0xc82e38['field'](_0x96ab('0xa5'));_0xc82e38[_0x96ab('0x48')](_0x96ab('0xa6'),_0x96ab('0xa7'));_0xc82e38[_0x96ab('0x48')](_0x96ab('0xa8'),'Contact.lastName');_0xc82e38[_0x96ab('0x48')](_0x96ab('0xa9'),_0x96ab('0xaa'));_0xc82e38['field']('c.phone',_0x96ab('0xab'));_0xc82e38['field'](_0x96ab('0xac'),_0x96ab('0xad'));_0xc82e38[_0x96ab('0x48')](_0x96ab('0xae'),'Contact.fax');_0xc82e38[_0x96ab('0x48')](_0x96ab('0xaf'),_0x96ab('0x32'));_0xc82e38[_0x96ab('0x24')](_0x58c8e6[_0x96ab('0x24')]);_0xc82e38[_0x96ab('0x23')](_0x58c8e6[_0x96ab('0x23')]);return db['sequelize'][_0x96ab('0x3d')](_0xc82e38[_0x96ab('0x97')](),_0x25c653);})[_0x96ab('0x2a')](function(_0x38a4b3){_0x5343f9[_0x96ab('0x45')](_0x96ab('0xb0'),_[_0x96ab('0x31')](_0x38a4b3,'id'));return db[_0x96ab('0x96')][_0x96ab('0x3d')](_0x5343f9['toString'](),_0x25c653)['then'](function(_0x539ec6){var _0x562b67=_[_0x96ab('0xb1')](_0x539ec6,_0x96ab('0xb2'));var _0x20cb91=[];return db[_0x96ab('0xb3')][_0x96ab('0xb4')]({'attributes':[_0x96ab('0xb5')],'raw':!![]})[_0x96ab('0x2a')](function(_0x444a6b){var _0xd8404c=_0x444a6b[_0x96ab('0xb5')];_0x38a4b3[_0x96ab('0x6b')](function(_0x408ae3){_0x20cb91[_0x96ab('0x33')](updateMailInteraction(_0x408ae3,_0x5df719,_0x562b67,_0xd8404c));});return BPromise[_0x96ab('0xb6')](_0x20cb91);});});});})[_0x96ab('0x2a')](function(_0x543376){_0x4aaa0b['rows']=_0x543376;return _0x4aaa0b;})['then'](respondWithFilteredResult(_0x2f86f3,_0x58c8e6));})['catch'](handleError(_0x2f86f3,null));};exports[_0x96ab('0xb7')]=function(_0x238602,_0x90af49){var _0x299355={'raw':![],'where':{'id':_0x238602[_0x96ab('0xb8')]['id']}},_0x479c7f={};_0x479c7f[_0x96ab('0x3c')]=_['keys'](db['MailInteraction']['rawAttributes']);_0x479c7f[_0x96ab('0x3d')]=_[_0x96ab('0x3e')](_0x238602[_0x96ab('0x3d')]);_0x479c7f[_0x96ab('0x3f')]=_[_0x96ab('0x40')](_0x479c7f['model'],_0x479c7f[_0x96ab('0x3d')]);_0x299355['attributes']=_[_0x96ab('0x40')](_0x479c7f[_0x96ab('0x3c')],qs['fields'](_0x238602[_0x96ab('0x3d')][_0x96ab('0x42')]));_0x299355[_0x96ab('0x41')]=_0x299355['attributes']['length']?_0x299355['attributes']:_0x479c7f[_0x96ab('0x3c')];if(_0x238602[_0x96ab('0x3d')][_0x96ab('0xb9')]){_0x299355['include']=[{'all':!![]}];}_0x299355=_['merge']({},_0x299355,_0x238602[_0x96ab('0xba')]);return db[_0x96ab('0x34')][_0x96ab('0x5e')](_0x299355)[_0x96ab('0x2a')](handleEntityNotFound(_0x90af49,null))['then'](respondWithResult(_0x90af49,null))[_0x96ab('0x37')](handleError(_0x90af49,null));};exports[_0x96ab('0xbb')]=function(_0x34ad16,_0x3633a4){return db['MailInteraction'][_0x96ab('0xbb')](_0x34ad16[_0x96ab('0xbc')],{})[_0x96ab('0x2a')](respondWithResult(_0x3633a4,0xc9))[_0x96ab('0x37')](handleError(_0x3633a4,null));};exports[_0x96ab('0x29')]=function(_0x3d4c3f,_0x525709){if(_0x3d4c3f[_0x96ab('0xbc')]['id']){delete _0x3d4c3f[_0x96ab('0xbc')]['id'];}return db['MailInteraction']['find']({'where':{'id':_0x3d4c3f[_0x96ab('0xb8')]['id']}})[_0x96ab('0x2a')](handleEntityNotFound(_0x525709,null))['then'](saveUpdates(_0x3d4c3f[_0x96ab('0xbc')],null))[_0x96ab('0x2a')](respondWithResult(_0x525709,null))[_0x96ab('0x37')](handleError(_0x525709,null));};exports['destroy']=function(_0x2902dc,_0x4693ab){return db[_0x96ab('0x34')][_0x96ab('0x5e')]({'where':{'id':_0x2902dc[_0x96ab('0xb8')]['id']}})[_0x96ab('0x2a')](handleEntityNotFound(_0x4693ab,null))['then'](removeEntity(_0x4693ab,null))[_0x96ab('0x37')](handleError(_0x4693ab,null));};exports[_0x96ab('0xbd')]=function(_0x398872,_0x11f37c){return db[_0x96ab('0x34')][_0x96ab('0xbd')]()['then'](respondWithResult(_0x11f37c,null))['catch'](handleError(_0x11f37c,null));};exports[_0x96ab('0xbe')]=function(_0x4f091b,_0x5b45c4,_0x3e3102){return db['MailMessage'][_0x96ab('0x5e')]({'where':{'id':_0x4f091b[_0x96ab('0xb8')]['id']}})[_0x96ab('0x2a')](handleEntityNotFound(_0x5b45c4,null))['then'](function(_0x175f60){if(_0x175f60){return _0x175f60[_0x96ab('0xbe')](_0x4f091b[_0x96ab('0xbc')]['ids'],_[_0x96ab('0xbf')](_0x4f091b[_0x96ab('0xbc')],[_0x96ab('0xc0'),'id'])||{});}})[_0x96ab('0x2a')](respondWithResult(_0x5b45c4,null))[_0x96ab('0x37')](handleError(_0x5b45c4,null));};exports[_0x96ab('0xc1')]=function(_0x2efcf2,_0x5658b8,_0x1f7dec){var _0x4fdcd1={'raw':![],'where':{}};var _0x27318c={};var _0x49eace={'count':0x0,'rows':[]};return db[_0x96ab('0x34')]['findOne']({'where':{'id':_0x2efcf2['params']['id']}})[_0x96ab('0x2a')](handleEntityNotFound(_0x5658b8,null))['then'](function(_0x12f664){if(_0x12f664){_0x27318c[_0x96ab('0x3c')]=_['keys'](db['MailMessage'][_0x96ab('0x39')]);_0x27318c[_0x96ab('0x3d')]=_[_0x96ab('0x3e')](_0x2efcf2['query']);_0x27318c['filters']=_[_0x96ab('0x40')](_0x27318c[_0x96ab('0x3c')],_0x27318c[_0x96ab('0x3d')]);_0x4fdcd1[_0x96ab('0x41')]=_[_0x96ab('0x40')](_0x27318c[_0x96ab('0x3c')],qs[_0x96ab('0x42')](_0x2efcf2[_0x96ab('0x3d')][_0x96ab('0x42')]));_0x4fdcd1[_0x96ab('0x41')]=_0x4fdcd1[_0x96ab('0x41')][_0x96ab('0x43')]?_0x4fdcd1[_0x96ab('0x41')]:_0x27318c[_0x96ab('0x3c')];if(!_0x2efcf2[_0x96ab('0x3d')][_0x96ab('0xc2')]('nolimit')){_0x4fdcd1[_0x96ab('0x24')]=qs[_0x96ab('0x24')](_0x2efcf2[_0x96ab('0x3d')]['limit']);_0x4fdcd1[_0x96ab('0x23')]=qs[_0x96ab('0x23')](_0x2efcf2[_0x96ab('0x3d')][_0x96ab('0x23')]);}_0x4fdcd1[_0x96ab('0x8f')]=qs[_0x96ab('0x44')](_0x2efcf2['query'][_0x96ab('0x44')]);_0x4fdcd1['where']=qs[_0x96ab('0x3f')](_[_0x96ab('0x46')](_0x2efcf2['query'],_0x27318c[_0x96ab('0x3f')]));_0x4fdcd1['where'][_0x96ab('0xb2')]=_0x12f664['id'];if(_0x2efcf2[_0x96ab('0x3d')][_0x96ab('0x82')]){_0x4fdcd1[_0x96ab('0x45')]=_[_0x96ab('0x99')](_0x4fdcd1['where'],{'$or':_[_0x96ab('0x31')](_0x4fdcd1[_0x96ab('0x41')],function(_0x5be7a1){var _0x33463c={};_0x33463c[_0x5be7a1]={'$like':'%'+_0x2efcf2['query'][_0x96ab('0x82')]+'%'};return _0x33463c;})});}if(_0x2efcf2[_0x96ab('0x3d')][_0x96ab('0x7a')]){var _0x4b8a6e=_0x2efcf2[_0x96ab('0x3d')][_0x96ab('0x7a')][_0x96ab('0x62')](',');var _0x4e7971={};_0x4e7971[_0x4b8a6e[0x0]]={'$gte':moment(_0x4b8a6e[0x1])['format'](_0x96ab('0xc3'))};_0x4fdcd1['where']=_[_0x96ab('0x99')](_0x4fdcd1[_0x96ab('0x45')],_0x4e7971);}_0x4fdcd1=_['merge']({},_0x4fdcd1,_0x2efcf2[_0x96ab('0xba')]);return db[_0x96ab('0xc4')]['count']({'where':_0x4fdcd1[_0x96ab('0x45')]})[_0x96ab('0x2a')](function(_0x3d8bec){_0x49eace[_0x96ab('0x22')]=_0x3d8bec;if(_0x2efcf2[_0x96ab('0x3d')]['includeAll']){_0x4fdcd1[_0x96ab('0xc5')]=[{'all':!![]}];}return db[_0x96ab('0xc4')]['findAll'](_0x4fdcd1);})[_0x96ab('0x2a')](function(_0x193295){_0x49eace[_0x96ab('0xc6')]=_0x193295;return _0x49eace;});}})[_0x96ab('0x2a')](respondWithFilteredResult(_0x5658b8,_0x4fdcd1))[_0x96ab('0x37')](handleError(_0x5658b8,null));};exports[_0x96ab('0xc7')]=function(_0x202a98,_0xd50eb8,_0x1467b5){return db[_0x96ab('0x34')]['find']({'where':{'id':_0x202a98[_0x96ab('0xb8')]['id']}})[_0x96ab('0x2a')](handleEntityNotFound(_0xd50eb8,null))['then'](function(_0x37f84e){if(_0x37f84e){return _0x37f84e[_0x96ab('0xc8')](_0x202a98[_0x96ab('0xbc')][_0x96ab('0xc0')],_[_0x96ab('0xbf')](_0x202a98[_0x96ab('0xbc')],[_0x96ab('0xc0'),'id'])||{})['spread'](function(){return db[_0x96ab('0x6a')][_0x96ab('0xc9')]({'attributes':['id',_0x96ab('0x2f'),_0x96ab('0x49')],'where':{'id':_0x202a98[_0x96ab('0xbc')]['ids']}});})['then'](function(_0x51fc68){socket[_0x96ab('0xca')](_0x96ab('0xcb'),{'id':Number(_0x202a98[_0x96ab('0xb8')]['id']),'tags':_0x51fc68||[]});return{'id':Number(_0x202a98[_0x96ab('0xb8')]['id']),'tags':_0x51fc68||[]};});}})[_0x96ab('0x2a')](respondWithResult(_0xd50eb8,null))[_0x96ab('0x37')](handleError(_0xd50eb8,null));};exports['removeTags']=function(_0x17acec,_0x353a67,_0x3b2ed0){return db[_0x96ab('0x34')][_0x96ab('0x5e')]({'where':{'id':_0x17acec[_0x96ab('0xb8')]['id']}})[_0x96ab('0x2a')](handleEntityNotFound(_0x353a67,null))[_0x96ab('0x2a')](function(_0xdbfeb3){if(_0xdbfeb3){return _0xdbfeb3['removeTags'](_0x17acec[_0x96ab('0x3d')]['ids']);}})[_0x96ab('0x2a')](respondWithStatusCode(_0x353a67,null))['catch'](handleError(_0x353a67,null));};exports['download']=function(_0x17c720,_0x2c3a29){var _0x107236=moment()[_0x96ab('0xcc')]()[_0x96ab('0x97')]();var _0x5b0524=path['join'](config[_0x96ab('0xcd')],_0x96ab('0xce'),'files','attachments');var _0x597279=path[_0x96ab('0xcf')](config[_0x96ab('0xcd')],_0x96ab('0xce'),'files',_0x96ab('0xd0'));var _0x4c56e2=path['join'](_0x597279,_0x107236);var _0x2dad6d=util[_0x96ab('0xd1')]('interaction-%s.zip',_0x107236);var _0x4b730a=path[_0x96ab('0xcf')](_0x597279,_0x2dad6d);var _0x310618=![];return db[_0x96ab('0x34')][_0x96ab('0x5e')]({'where':{'id':_0x17c720[_0x96ab('0xb8')]['id']}})['then'](handleEntityNotFound(_0x2c3a29,null))[_0x96ab('0x2a')](function(_0x1d9a3f){if(_0x1d9a3f){return _0x1d9a3f[_0x96ab('0xc1')]({'attributes':['id','body','from','to','cc',_0x96ab('0xd2'),_0x96ab('0xd3'),_0x96ab('0x78')],'where':{'secret':![]},'include':_0x17c720[_0x96ab('0x3d')][_0x96ab('0xd4')]?[{'model':db[_0x96ab('0xd5')],'as':'Attachments'}]:undefined,'order':qs[_0x96ab('0x44')]('id')});}return[];})[_0x96ab('0x2a')](function(_0x47f273){_0x310618=_0x47f273[_0x96ab('0x43')];if(_0x47f273[_0x96ab('0x43')]){fs['mkdirSync'](_0x4c56e2);return BPromise[_0x96ab('0xd6')](_0x47f273,function(_0x2c14d9,_0xd2d1e7){var _0x29b40e=_0x2c14d9;var _0x2be425={'from':_0x29b40e[_0x96ab('0x4d')],'to':_0x29b40e['to'],'subject':_0x29b40e[_0x96ab('0xd3')],'html':_0x29b40e['body'],'headers':{'Date':moment(_0x29b40e['createdAt'])[_0x96ab('0xd1')](_0x96ab('0xd7'))},'attachments':[]};if(_0x2c14d9['cc']){_0x2be425[_0x96ab('0xd8')]['Cc']=_0x2c14d9['cc'];}if(_0x2c14d9['bcc']){_0x2be425[_0x96ab('0xd8')][_0x96ab('0xd9')]=_0x2c14d9[_0x96ab('0xd2')];}return new BPromise(function(_0x4e2bcd,_0x5f255c){if(_0x2c14d9[_0x96ab('0xda')]){for(var _0x5b7a53=0x0;_0x5b7a53<_0x2c14d9[_0x96ab('0xda')][_0x96ab('0x43')];_0x5b7a53++){var _0x5d52ba=_0x2c14d9['Attachments'][_0x5b7a53];var _0x1f3428=path[_0x96ab('0xcf')](_0x5b0524,_0x5d52ba['basename']);if(fs['existsSync'](_0x1f3428)){_0x2be425['attachments'][_0x96ab('0x33')]({'name':_0x5d52ba[_0x96ab('0x2f')],'contentType':_0x5d52ba['type'],'data':fs[_0x96ab('0xdb')](_0x1f3428)});}}}emlformat[_0x96ab('0xdc')](_0x2be425,function(_0xb5c494,_0x5b3ffd){if(_0xb5c494)return _0x5f255c(_0xb5c494);fs['writeFileSync'](path['join'](_0x4c56e2,util[_0x96ab('0xd1')](_0x96ab('0xdd'),_0xd2d1e7)),_0x5b3ffd);return _0x4e2bcd(_0x5b3ffd);});});});}})['then'](function(){if(_0x310618){return new BPromise(function(_0x2c6da9,_0x2fe743){zipdir(_0x4c56e2,{'saveTo':_0x4b730a},function(_0x2b4d1f,_0xa5fc1){if(_0x2b4d1f)return _0x2fe743(_0x2b4d1f);return _0x2c6da9(_0xa5fc1);});});}})[_0x96ab('0x2a')](function(){if(_0x310618){return new BPromise(function(_0x127fbc,_0x5307a8){rimraf(_0x4c56e2,function(_0xb93a68){if(_0xb93a68)_0x5307a8(_0xb93a68);return _0x127fbc();});});}})[_0x96ab('0x2a')](function(){if(_0x310618){return _0x2c3a29['download'](_0x4b730a,_0x2dad6d,function(_0x1f89d5){if(_0x1f89d5){console['log'](_0x96ab('0xde'),_0x1f89d5);}else{fs[_0x96ab('0xdf')](_0x4b730a);}});}else{return _0x2c3a29[_0x96ab('0x2c')](0xc8);}})['catch'](handleError(_0x2c3a29,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index a28dc58..852c8f0 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 _0x8459=['hook','exports','events','../../mysqldb','MailMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','unreadMessages','emit','hasOwnProperty'];(function(_0x512c83,_0x42a67a){var _0x1f7f25=function(_0x1e656c){while(--_0x1e656c){_0x512c83['push'](_0x512c83['shift']());}};_0x1f7f25(++_0x42a67a);}(_0x8459,0x80));var _0x9845=function(_0x2e94fd,_0x60ffcd){_0x2e94fd=_0x2e94fd-0x0;var _0x403c12=_0x8459[_0x2e94fd];return _0x403c12;};'use strict';var EventEmitter=require(_0x9845('0x0'));var MailInteraction=require(_0x9845('0x1'))['db']['MailInteraction'];var MailMessage=require(_0x9845('0x1'))['db'][_0x9845('0x2')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x9845('0x3')](0x0);var events={'afterCreate':_0x9845('0x4'),'afterUpdate':_0x9845('0x5'),'afterDestroy':_0x9845('0x6')};function emitEvent(_0x1754b7){return function(_0x4d6b9f,_0x3c8186,_0x4dd72e){_0x4d6b9f[_0x9845('0x7')]({'attributes':['id'],'raw':!![]})[_0x9845('0x8')](function(_0x39874f){_0x4d6b9f[_0x9845('0x9')](_0x9845('0xa'),_0x39874f[_0x9845('0xb')](function(_0x3d5ee2){return{'id':_0x3d5ee2['id']};}));return MailMessage[_0x9845('0xc')]({'where':{'MailInteractionId':_0x4d6b9f['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x238d27){_0x4d6b9f[_0x9845('0x9')](_0x9845('0xd'),_0x238d27['length']);MailInteractionEvents['emit'](_0x1754b7+':'+_0x4d6b9f['id'],_0x4d6b9f);MailInteractionEvents[_0x9845('0xe')](_0x1754b7,_0x4d6b9f);_0x4dd72e(null);})['catch'](_0x4dd72e(null));};}for(var e in events){if(events[_0x9845('0xf')](e)){var event=events[e];MailInteraction[_0x9845('0x10')](e,emitEvent(event));}}module[_0x9845('0x11')]=MailInteractionEvents; \ No newline at end of file +var _0x41e5=['catch','hasOwnProperty','hook','exports','MailInteraction','../../mysqldb','save','update','getUsers','then','setDataValue','map','unreadMessages','emit'];(function(_0x2856d7,_0x5c8fb7){var _0x2dec68=function(_0xf60202){while(--_0xf60202){_0x2856d7['push'](_0x2856d7['shift']());}};_0x2dec68(++_0x5c8fb7);}(_0x41e5,0x11c));var _0x541e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x41e5[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x541e('0x0')];var MailMessage=require(_0x541e('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x541e('0x2'),'afterUpdate':_0x541e('0x3'),'afterDestroy':'remove'};function emitEvent(_0x41e881){return function(_0x40faff,_0x5e62b0,_0x4c3ab1){_0x40faff[_0x541e('0x4')]({'attributes':['id'],'raw':!![]})[_0x541e('0x5')](function(_0x1d9f17){_0x40faff[_0x541e('0x6')]('Users',_0x1d9f17[_0x541e('0x7')](function(_0x1d8f1b){return{'id':_0x1d8f1b['id']};}));return MailMessage['findAll']({'where':{'MailInteractionId':_0x40faff['id'],'direction':'in','read':![]},'raw':!![]});})[_0x541e('0x5')](function(_0x423e29){_0x40faff['setDataValue'](_0x541e('0x8'),_0x423e29['length']);MailInteractionEvents[_0x541e('0x9')](_0x41e881+':'+_0x40faff['id'],_0x40faff);MailInteractionEvents[_0x541e('0x9')](_0x41e881,_0x40faff);_0x4c3ab1(null);})[_0x541e('0xa')](_0x4c3ab1(null));};}for(var e in events){if(events[_0x541e('0xb')](e)){var event=events[e];MailInteraction[_0x541e('0xc')](e,emitEvent(event));}}module[_0x541e('0xd')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index d266316..087c10f 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 _0x0c01=['fti_mail_interactions','subject','substatusAt','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','closedAt','get','MailMessage','update','catch','utf8mb4','utf8mb4_unicode_ci','../../config/logger','api','moment','rimraf','./mailInteraction.attributes','MailInteraction','mail_interactions'];(function(_0x16b1a5,_0x318267){var _0x475e25=function(_0x2e3bf6){while(--_0x2e3bf6){_0x16b1a5['push'](_0x16b1a5['shift']());}};_0x475e25(++_0x318267);}(_0x0c01,0x10a));var _0x10c0=function(_0x1de50b,_0x463164){_0x1de50b=_0x1de50b-0x0;var _0x10ece9=_0x0c01[_0x1de50b];return _0x10ece9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x10c0('0x0'))(_0x10c0('0x1'));var moment=require(_0x10c0('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x10c0('0x3'));var config=require('../../config/environment');var attributes=require(_0x10c0('0x4'));module['exports']=function(_0x33754f,_0x222d59){return _0x33754f['define'](_0x10c0('0x5'),attributes,{'tableName':_0x10c0('0x6'),'paranoid':![],'indexes':[{'name':_0x10c0('0x7'),'fields':[_0x10c0('0x8'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1b86ab,_0x1933e3,_0x19f64a){if(_0x1b86ab['substatus']){_0x1b86ab[_0x10c0('0x9')]=moment()[_0x10c0('0xa')](_0x10c0('0xb'));}if(_0x1b86ab[_0x10c0('0xc')]){_0x1b86ab['closedAt']=moment()[_0x10c0('0xa')](_0x10c0('0xb'));}_0x19f64a(null,_0x1933e3);},'beforeUpdate':function(_0x35b640,_0x41f3a0,_0x5efa84){if(_0x35b640[_0x10c0('0xd')]('substatus')){_0x35b640['substatusAt']=moment()[_0x10c0('0xa')](_0x10c0('0xb'));}if(_0x35b640['changed'](_0x10c0('0xc'))){_0x35b640[_0x10c0('0xe')]=moment()['format'](_0x10c0('0xb'));}_0x5efa84(null,_0x35b640);},'afterUpdate':function(_0xdaac8e,_0x549572,_0x445117){var _0x4161ee=_0x33754f['models'];var _0xce6d83=_0xdaac8e[_0x10c0('0xf')]({'plain':!![]});if(_0xce6d83[_0x10c0('0xc')]){return _0x4161ee[_0x10c0('0x10')][_0x10c0('0x11')]({'read':!![]},{'where':{'MailInteractionId':_0xce6d83['id']}})['then'](function(){_0x445117();})[_0x10c0('0x12')](function(_0x3ad8a2){_0x445117(_0x3ad8a2);});}else{_0x445117();}}},'charset':_0x10c0('0x13'),'collate':_0x10c0('0x14')});}; \ No newline at end of file +var _0xa450=['format','YYYY-MM-DD\x20HH:mm:ss','closedAt','changed','closed','models','get','MailMessage','update','then','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','MailInteraction','mail_interactions','fti_mail_interactions','FULLTEXT','substatus','substatusAt'];(function(_0x13c70c,_0x546b34){var _0x50f0f2=function(_0x2a2991){while(--_0x2a2991){_0x13c70c['push'](_0x13c70c['shift']());}};_0x50f0f2(++_0x546b34);}(_0xa450,0x70));var _0x0a45=function(_0x3854b3,_0x42cb74){_0x3854b3=_0x3854b3-0x0;var _0x147ee3=_0xa450[_0x3854b3];return _0x147ee3;};'use strict';var _=require(_0x0a45('0x0'));var util=require('util');var logger=require(_0x0a45('0x1'))(_0x0a45('0x2'));var moment=require(_0x0a45('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a45('0x4'));var rimraf=require(_0x0a45('0x5'));var config=require(_0x0a45('0x6'));var attributes=require('./mailInteraction.attributes');module['exports']=function(_0x33536d,_0x360901){return _0x33536d['define'](_0x0a45('0x7'),attributes,{'tableName':_0x0a45('0x8'),'paranoid':![],'indexes':[{'name':_0x0a45('0x9'),'fields':['subject','to'],'type':_0x0a45('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x412ebf,_0x18b4f0,_0x4f8b0c){if(_0x412ebf[_0x0a45('0xb')]){_0x412ebf[_0x0a45('0xc')]=moment()[_0x0a45('0xd')](_0x0a45('0xe'));}if(_0x412ebf['closed']){_0x412ebf[_0x0a45('0xf')]=moment()[_0x0a45('0xd')](_0x0a45('0xe'));}_0x4f8b0c(null,_0x18b4f0);},'beforeUpdate':function(_0x1acd2c,_0x1fdf48,_0x9b2d00){if(_0x1acd2c[_0x0a45('0x10')](_0x0a45('0xb'))){_0x1acd2c['substatusAt']=moment()['format'](_0x0a45('0xe'));}if(_0x1acd2c[_0x0a45('0x10')](_0x0a45('0x11'))){_0x1acd2c[_0x0a45('0xf')]=moment()[_0x0a45('0xd')](_0x0a45('0xe'));}_0x9b2d00(null,_0x1acd2c);},'afterUpdate':function(_0x39d2b5,_0x5a3f64,_0x46c122){var _0x3dbfd8=_0x33536d[_0x0a45('0x12')];var _0x3dbe3a=_0x39d2b5[_0x0a45('0x13')]({'plain':!![]});if(_0x3dbe3a[_0x0a45('0x11')]){return _0x3dbfd8[_0x0a45('0x14')][_0x0a45('0x15')]({'read':!![]},{'where':{'MailInteractionId':_0x3dbe3a['id']}})[_0x0a45('0x16')](function(){_0x46c122();})['catch'](function(_0x46ba26){_0x46c122(_0x46ba26);});}else{_0x46c122();}}},'charset':_0x0a45('0x17'),'collate':_0x0a45('0x18')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 36b8f1d..9caf1e6 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 _0x7217=['body','omit','ids','AddTags','stringify','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','register','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','MailInteraction,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','MailInteraction','options','where','UpdateMailInteraction','debug','AddTagsToMailInteraction','find','addTags'];(function(_0x19c9a1,_0x52c59a){var _0x2b18e6=function(_0x19efe1){while(--_0x19efe1){_0x19c9a1['push'](_0x19c9a1['shift']());}};_0x2b18e6(++_0x52c59a);}(_0x7217,0xa9));var _0x7721=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x7217[_0x92c450];return _0x2a9599;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7721('0x0'));var BPromise=require('bluebird');var rs=require(_0x7721('0x1'));var fs=require('fs');var Redis=require(_0x7721('0x2'));var db=require(_0x7721('0x3'))['db'];var utils=require(_0x7721('0x4'));var logger=require(_0x7721('0x5'))(_0x7721('0x6'));var config=require(_0x7721('0x7'));var jayson=require(_0x7721('0x8'));var client=jayson[_0x7721('0x9')][_0x7721('0xa')]({'port':0x232a});config['redis']=_[_0x7721('0xb')](config[_0x7721('0xc')],{'host':_0x7721('0xd'),'port':0x18eb});var socket=require(_0x7721('0xe'))(new Redis(config['redis']));require(_0x7721('0xf'))[_0x7721('0x10')](socket);function respondWithRpcPromise(_0x4eed38,_0x938a36,_0x2d6e8d){return new BPromise(function(_0x3d73a3,_0x4fab0d){return client[_0x7721('0x11')](_0x4eed38,_0x2d6e8d)[_0x7721('0x12')](function(_0x199bae){logger['info'](_0x7721('0x13'),_0x938a36,_0x7721('0x14'));logger['debug'](_0x7721('0x15'),_0x938a36,_0x7721('0x14'),JSON['stringify'](_0x199bae));if(_0x199bae[_0x7721('0x16')]){if(_0x199bae[_0x7721('0x16')][_0x7721('0x17')]===0x1f4){logger[_0x7721('0x16')](_0x7721('0x13'),_0x938a36,_0x199bae['error'][_0x7721('0x18')]);return _0x4fab0d(_0x199bae[_0x7721('0x16')][_0x7721('0x18')]);}logger[_0x7721('0x16')]('MailInteraction,\x20%s,\x20%s',_0x938a36,_0x199bae[_0x7721('0x16')]['message']);return _0x3d73a3(_0x199bae[_0x7721('0x16')]['message']);}else{logger[_0x7721('0x19')]('MailInteraction,\x20%s,\x20%s',_0x938a36,'request\x20sent');_0x3d73a3(_0x199bae[_0x7721('0x1a')]['message']);}})[_0x7721('0x1b')](function(_0x5e2300){logger[_0x7721('0x16')](_0x7721('0x13'),_0x938a36,_0x5e2300);_0x4fab0d(_0x5e2300);});});}exports['UpdateMailInteraction']=function(_0x186c36){var _0x2d42a4=this;return new Promise(function(_0x1c2176,_0x519768){return db[_0x7721('0x1c')]['update'](_0x186c36['body'],{'raw':_0x186c36[_0x7721('0x1d')]?_0x186c36[_0x7721('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x186c36[_0x7721('0x1d')]?_0x186c36[_0x7721('0x1d')][_0x7721('0x1e')]||null:null,'attributes':_0x186c36['options']?_0x186c36[_0x7721('0x1d')]['attributes']||null:null,'limit':_0x186c36[_0x7721('0x1d')]?_0x186c36[_0x7721('0x1d')]['limit']||null:null})[_0x7721('0x12')](function(_0x485fb3){logger[_0x7721('0x19')](_0x7721('0x1f'),_0x186c36);logger[_0x7721('0x20')](_0x7721('0x1f'),_0x186c36,JSON['stringify'](_0x485fb3));_0x1c2176(_0x485fb3);})[_0x7721('0x1b')](function(_0x1f3aff){logger[_0x7721('0x16')](_0x7721('0x1f'),_0x1f3aff[_0x7721('0x18')],_0x186c36);_0x519768(_0x2d42a4['error'](0x1f4,_0x1f3aff[_0x7721('0x18')]));});});};exports[_0x7721('0x21')]=function(_0x197f69){return new Promise(function(_0x370262,_0xbb3ce4){return db[_0x7721('0x1c')][_0x7721('0x22')]({'where':_0x197f69[_0x7721('0x1d')]?_0x197f69[_0x7721('0x1d')]['where']||null:null})[_0x7721('0x12')](function(_0x1a389c){if(_0x1a389c){return _0x1a389c[_0x7721('0x23')](_0x197f69[_0x7721('0x24')]['ids'],_[_0x7721('0x25')](_0x197f69[_0x7721('0x24')],[_0x7721('0x26'),'id'])||{});}})['spread'](function(_0x4f899e){logger[_0x7721('0x19')](_0x7721('0x27'),_0x197f69);logger[_0x7721('0x20')](_0x7721('0x27'),_0x197f69,JSON[_0x7721('0x28')](_0x4f899e));_0x370262(_0x4f899e);})[_0x7721('0x1b')](function(_0x2d1624){logger[_0x7721('0x16')]('AddTags',_0x2d1624[_0x7721('0x18')],_0x197f69);_0xbb3ce4(_this['error'](0x1f4,_0x2d1624[_0x7721('0x18')]));});});}; \ No newline at end of file +var _0xdeb7=['defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','then','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','UpdateMailInteraction','update','body','options','raw','where','attributes','limit','AddTagsToMailInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis'];(function(_0x9a3d47,_0x1953a0){var _0xf60b78=function(_0x31575d){while(--_0x31575d){_0x9a3d47['push'](_0x9a3d47['shift']());}};_0xf60b78(++_0x1953a0);}(_0xdeb7,0x77));var _0x7deb=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xdeb7[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x7deb('0x0'));var util=require(_0x7deb('0x1'));var moment=require(_0x7deb('0x2'));var BPromise=require('bluebird');var rs=require(_0x7deb('0x3'));var fs=require('fs');var Redis=require(_0x7deb('0x4'));var db=require(_0x7deb('0x5'))['db'];var utils=require(_0x7deb('0x6'));var logger=require(_0x7deb('0x7'))('rpc');var config=require(_0x7deb('0x8'));var jayson=require(_0x7deb('0x9'));var client=jayson[_0x7deb('0xa')][_0x7deb('0xb')]({'port':0x232a});config[_0x7deb('0xc')]=_[_0x7deb('0xd')](config['redis'],{'host':_0x7deb('0xe'),'port':0x18eb});var socket=require(_0x7deb('0xf'))(new Redis(config[_0x7deb('0xc')]));require(_0x7deb('0x10'))['register'](socket);function respondWithRpcPromise(_0x1c771d,_0x5e37c9,_0x49b193){return new BPromise(function(_0x453eaf,_0x51019e){return client[_0x7deb('0x11')](_0x1c771d,_0x49b193)[_0x7deb('0x12')](function(_0x2b749e){logger['info'](_0x7deb('0x13'),_0x5e37c9,_0x7deb('0x14'));logger[_0x7deb('0x15')](_0x7deb('0x16'),_0x5e37c9,'request\x20sent',JSON[_0x7deb('0x17')](_0x2b749e));if(_0x2b749e[_0x7deb('0x18')]){if(_0x2b749e[_0x7deb('0x18')][_0x7deb('0x19')]===0x1f4){logger[_0x7deb('0x18')](_0x7deb('0x13'),_0x5e37c9,_0x2b749e[_0x7deb('0x18')][_0x7deb('0x1a')]);return _0x51019e(_0x2b749e[_0x7deb('0x18')][_0x7deb('0x1a')]);}logger[_0x7deb('0x18')](_0x7deb('0x13'),_0x5e37c9,_0x2b749e[_0x7deb('0x18')][_0x7deb('0x1a')]);return _0x453eaf(_0x2b749e[_0x7deb('0x18')]['message']);}else{logger[_0x7deb('0x1b')]('MailInteraction,\x20%s,\x20%s',_0x5e37c9,_0x7deb('0x14'));_0x453eaf(_0x2b749e[_0x7deb('0x1c')]['message']);}})[_0x7deb('0x1d')](function(_0x42605d){logger[_0x7deb('0x18')](_0x7deb('0x13'),_0x5e37c9,_0x42605d);_0x51019e(_0x42605d);});});}exports[_0x7deb('0x1e')]=function(_0x11fbd0){var _0xfdeba4=this;return new Promise(function(_0x2ab72e,_0x27a448){return db['MailInteraction'][_0x7deb('0x1f')](_0x11fbd0[_0x7deb('0x20')],{'raw':_0x11fbd0[_0x7deb('0x21')]?_0x11fbd0[_0x7deb('0x21')][_0x7deb('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11fbd0[_0x7deb('0x21')]?_0x11fbd0[_0x7deb('0x21')][_0x7deb('0x23')]||null:null,'attributes':_0x11fbd0['options']?_0x11fbd0[_0x7deb('0x21')][_0x7deb('0x24')]||null:null,'limit':_0x11fbd0[_0x7deb('0x21')]?_0x11fbd0['options'][_0x7deb('0x25')]||null:null})[_0x7deb('0x12')](function(_0xde3478){logger[_0x7deb('0x1b')]('UpdateMailInteraction',_0x11fbd0);logger[_0x7deb('0x15')](_0x7deb('0x1e'),_0x11fbd0,JSON[_0x7deb('0x17')](_0xde3478));_0x2ab72e(_0xde3478);})[_0x7deb('0x1d')](function(_0x4972ca){logger[_0x7deb('0x18')](_0x7deb('0x1e'),_0x4972ca[_0x7deb('0x1a')],_0x11fbd0);_0x27a448(_0xfdeba4[_0x7deb('0x18')](0x1f4,_0x4972ca[_0x7deb('0x1a')]));});});};exports[_0x7deb('0x26')]=function(_0x2f9d98){return new Promise(function(_0x45d711,_0x14ec6f){return db['MailInteraction'][_0x7deb('0x27')]({'where':_0x2f9d98['options']?_0x2f9d98[_0x7deb('0x21')]['where']||null:null})[_0x7deb('0x12')](function(_0x36e0d4){if(_0x36e0d4){return _0x36e0d4['addTags'](_0x2f9d98['body'][_0x7deb('0x28')],_[_0x7deb('0x29')](_0x2f9d98['body'],['ids','id'])||{});}})[_0x7deb('0x2a')](function(_0x215112){logger[_0x7deb('0x1b')](_0x7deb('0x2b'),_0x2f9d98);logger[_0x7deb('0x15')](_0x7deb('0x2b'),_0x2f9d98,JSON[_0x7deb('0x17')](_0x215112));_0x45d711(_0x215112);})[_0x7deb('0x1d')](function(_0xe89d70){logger['error'](_0x7deb('0x2b'),_0xe89d70['message'],_0x2f9d98);_0x14ec6f(_this[_0x7deb('0x18')](0x1f4,_0xe89d70[_0x7deb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index cd9b06e..87b02c4 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 _0x9228=['update','removeListener','register','length','mailInteraction:','./mailInteraction.events','remove'];(function(_0x28d18d,_0x55896b){var _0x470640=function(_0x57e78b){while(--_0x57e78b){_0x28d18d['push'](_0x28d18d['shift']());}};_0x470640(++_0x55896b);}(_0x9228,0x98));var _0x8922=function(_0x53368e,_0x477a10){_0x53368e=_0x53368e-0x0;var _0x1528fa=_0x9228[_0x53368e];return _0x1528fa;};'use strict';var MailInteractionEvents=require(_0x8922('0x0'));var events=['save',_0x8922('0x1'),_0x8922('0x2')];function createListener(_0x327628,_0x57a0c2){return function(_0x33128b){_0x57a0c2['emit'](_0x327628,_0x33128b);};}function removeListener(_0x180d16,_0x2465ed){return function(){MailInteractionEvents[_0x8922('0x3')](_0x180d16,_0x2465ed);};}exports[_0x8922('0x4')]=function(_0x1934a7){for(var _0x116a02=0x0,_0x4d3cf0=events[_0x8922('0x5')];_0x116a02<_0x4d3cf0;_0x116a02++){var _0x2e41d3=events[_0x116a02];var _0x19f2bf=createListener(_0x8922('0x6')+_0x2e41d3,_0x1934a7);MailInteractionEvents['on'](_0x2e41d3,_0x19f2bf);}}; \ No newline at end of file +var _0x7306=['removeListener','register','mailInteraction:','save','remove'];(function(_0x16605d,_0x267f07){var _0x34d833=function(_0x27d19e){while(--_0x27d19e){_0x16605d['push'](_0x16605d['shift']());}};_0x34d833(++_0x267f07);}(_0x7306,0xf3));var _0x6730=function(_0x458c11,_0x7d3602){_0x458c11=_0x458c11-0x0;var _0x22350f=_0x7306[_0x458c11];return _0x22350f;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x6730('0x0'),_0x6730('0x1'),'update'];function createListener(_0x146089,_0x75cd4a){return function(_0x5818af){_0x75cd4a['emit'](_0x146089,_0x5818af);};}function removeListener(_0x7ec78c,_0x73304e){return function(){MailInteractionEvents[_0x6730('0x2')](_0x7ec78c,_0x73304e);};}exports[_0x6730('0x3')]=function(_0x59ae7b){for(var _0x2e60c4=0x0,_0x566ba1=events['length'];_0x2e60c4<_0x566ba1;_0x2e60c4++){var _0x5b17f7=events[_0x2e60c4];var _0x504439=createListener(_0x6730('0x4')+_0x5b17f7,_0x59ae7b);MailInteractionEvents['on'](_0x5b17f7,_0x504439);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index 2372e56..dbf0621 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 _0x98a8=['./mailMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download','post','mail','create','update','accept','put','/:id/reject','reject','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0xc4001c,_0x1bf8f0){var _0x49f7bc=function(_0x1059b8){while(--_0x1059b8){_0xc4001c['push'](_0xc4001c['shift']());}};_0x49f7bc(++_0x1bf8f0);}(_0x98a8,0x12c));var _0x898a=function(_0x127b67,_0x48a610){_0x127b67=_0x127b67-0x0;var _0x126158=_0x98a8[_0x127b67];return _0x126158;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var auth=require(_0x898a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x898a('0x7'));var controller=require(_0x898a('0x8'));router[_0x898a('0x9')]('/',auth[_0x898a('0xa')](),controller[_0x898a('0xb')]);router['get'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0xd')]);router['get'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0xf')]);router[_0x898a('0x9')](_0x898a('0x10'),auth[_0x898a('0xa')](),controller[_0x898a('0x11')]);router[_0x898a('0x12')]('/',auth[_0x898a('0xa')](),interaction['tracked'](_0x898a('0x13'),'mailmessage:create'),controller[_0x898a('0x14')]);router['put'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0x15')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x898a('0x16')]);router[_0x898a('0x17')](_0x898a('0x18'),auth[_0x898a('0xa')](),controller[_0x898a('0x19')]);router[_0x898a('0x1a')]('/:id',auth[_0x898a('0xa')](),controller['destroy']);module[_0x898a('0x1b')]=router; \ No newline at end of file +var _0x425d=['show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id'];(function(_0x347525,_0x57eb97){var _0xd8b892=function(_0x30f19f){while(--_0x30f19f){_0x347525['push'](_0x347525['shift']());}};_0xd8b892(++_0x57eb97);}(_0x425d,0x1e0));var _0xd425=function(_0x14349b,_0x1eb24d){_0x14349b=_0x14349b-0x0;var _0x34f8cb=_0x425d[_0x14349b];return _0x34f8cb;};'use strict';var multer=require(_0xd425('0x0'));var util=require('util');var path=require(_0xd425('0x1'));var timeout=require(_0xd425('0x2'));var express=require(_0xd425('0x3'));var router=express[_0xd425('0x4')]();var auth=require(_0xd425('0x5'));var interaction=require(_0xd425('0x6'));var config=require(_0xd425('0x7'));var controller=require('./mailMessage.controller');router[_0xd425('0x8')]('/',auth[_0xd425('0x9')](),controller[_0xd425('0xa')]);router[_0xd425('0x8')](_0xd425('0xb'),auth[_0xd425('0x9')](),controller['describe']);router[_0xd425('0x8')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0xd')]);router[_0xd425('0x8')](_0xd425('0xe'),auth[_0xd425('0x9')](),controller[_0xd425('0xf')]);router[_0xd425('0x10')]('/',auth[_0xd425('0x9')](),interaction[_0xd425('0x11')](_0xd425('0x12'),_0xd425('0x13')),controller[_0xd425('0x14')]);router[_0xd425('0x15')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0x16')]);router[_0xd425('0x15')](_0xd425('0x17'),auth['isAuthenticated'](),controller[_0xd425('0x18')]);router[_0xd425('0x15')](_0xd425('0x19'),auth['isAuthenticated'](),controller[_0xd425('0x1a')]);router[_0xd425('0x1b')](_0xd425('0xc'),auth[_0xd425('0x9')](),controller[_0xd425('0x1c')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index e6bee06..8648aa0 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 _0xfef9=['INTEGER','BOOLEAN','sequelize','lodash','TEXT','long','medium','ENUM','out','STRING','DATE'];(function(_0x343bd9,_0x5691e8){var _0x573c69=function(_0x3595d5){while(--_0x3595d5){_0x343bd9['push'](_0x343bd9['shift']());}};_0x573c69(++_0x5691e8);}(_0xfef9,0xd3));var _0x9fef=function(_0x5c4585,_0x3d0eab){_0x5c4585=_0x5c4585-0x0;var _0x21dede=_0xfef9[_0x5c4585];return _0x21dede;};'use strict';var Sequelize=require(_0x9fef('0x0'));var _=require(_0x9fef('0x1'));module['exports']={'body':{'type':Sequelize[_0x9fef('0x2')](_0x9fef('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT'](_0x9fef('0x4'))},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x9fef('0x5')]('in','out'),'defaultValue':_0x9fef('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0x9fef('0x7')](0x1fe)},'from':{'type':Sequelize['STRING']},'to':{'type':Sequelize[_0x9fef('0x2')](_0x9fef('0x3'))},'cc':{'type':Sequelize['TEXT'](_0x9fef('0x3'))},'bcc':{'type':Sequelize[_0x9fef('0x2')](_0x9fef('0x3'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0x9fef('0x8')]},'attach':{'type':Sequelize[_0x9fef('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x9fef('0xa')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0x9fef('0x2')]('long')},'originCc':{'type':Sequelize[_0x9fef('0x2')](_0x9fef('0x3'))}}; \ No newline at end of file +var _0x078f=['BOOLEAN','out','STRING','DATE','lodash','exports','long','TEXT','medium'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x078f,0x1b4));var _0xf078=function(_0x2418bb,_0x32040f){_0x2418bb=_0x2418bb-0x0;var _0x983292=_0x078f[_0x2418bb];return _0x983292;};'use strict';var Sequelize=require('sequelize');var _=require(_0xf078('0x0'));module[_0xf078('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf078('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf078('0x3')](_0xf078('0x4'))},'read':{'type':Sequelize[_0xf078('0x5')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xf078('0x6')),'defaultValue':_0xf078('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf078('0x7')](0x1fe)},'from':{'type':Sequelize[_0xf078('0x7')]},'to':{'type':Sequelize[_0xf078('0x3')](_0xf078('0x2'))},'cc':{'type':Sequelize[_0xf078('0x3')](_0xf078('0x2'))},'bcc':{'type':Sequelize[_0xf078('0x3')](_0xf078('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xf078('0x8')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf078('0x5')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf078('0x8')]},'originTo':{'type':Sequelize[_0xf078('0x3')](_0xf078('0x2'))},'originCc':{'type':Sequelize['TEXT'](_0xf078('0x2'))}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 86275c6..eddde39 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 _0x3570=['request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','MailMessage,\x20%s,\x20%s','debug','MailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','status','json','count','offset','set','Content-Range','apply','end','sendStatus','stack','name','send','map','MailMessage','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filter','merge','includeAll','include','findAll','then','rows','show','params','filters','options','find','update','body','destroy','describe','create','direction','secret','split','MailAccount','CmContact','Contacts','updatedAt','MailServerOut','Smtp','service','host','port','secure','auth','user','pass','attachments','length','join','root','server/files/attachments','basename','List','ListId','sendMail','format','YYYY-MM-DD\x20HH:mm:ss','mail-interactions','accept','mail','read','readAt','UserId','Contact','MailInteractionId','isNil','read1stAt','interaction','get','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','manual','interface','channel','event','reject','agent','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','EventManager','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','push','readFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x4a79bd,_0x3f7827){var _0x26fd6a=function(_0x193ee6){while(--_0x193ee6){_0x4a79bd['push'](_0x4a79bd['shift']());}};_0x26fd6a(++_0x3f7827);}(_0x3570,0x147));var _0x0357=function(_0x3f5e84,_0x4302a7){_0x3f5e84=_0x3f5e84-0x0;var _0x45c9b0=_0x3570[_0x3f5e84];return _0x45c9b0;};'use strict';var pdf=require(_0x0357('0x0'));var emlformat=require(_0x0357('0x1'));var rimraf=require(_0x0357('0x2'));var zipdir=require(_0x0357('0x3'));var jsonpatch=require(_0x0357('0x4'));var rp=require(_0x0357('0x5'));var moment=require(_0x0357('0x6'));var BPromise=require(_0x0357('0x7'));var Mustache=require(_0x0357('0x8'));var util=require(_0x0357('0x9'));var path=require(_0x0357('0xa'));var sox=require('sox');var csv=require(_0x0357('0xb'));var ejs=require(_0x0357('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x0357('0xd'));var deskjs=require(_0x0357('0xe'));var toCsv=require(_0x0357('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0357('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x0357('0x10'));var as=require(_0x0357('0x11'));var hardwareService=require(_0x0357('0x12'));var logger=require(_0x0357('0x13'))(_0x0357('0x14'));var utils=require(_0x0357('0x15'));var config=require(_0x0357('0x16'));var db=require('../../mysqldb')['db'];config[_0x0357('0x17')]=_[_0x0357('0x18')](config['redis'],{'host':_0x0357('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0357('0x17')]));require('./mailMessage.socket')[_0x0357('0x1a')](socket);var jayson=require(_0x0357('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9003=jayson[_0x0357('0x1c')][_0x0357('0x1d')]({'port':0x232b});var client9002=jayson[_0x0357('0x1c')][_0x0357('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x2d0fd2,_0x468aa8,_0x561d58){if(_0x561d58){var _0x1d6d29=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d6d29[_0x0357('0x1e')](_0x468aa8)){return _0x2d0fd2;}else{throw new db[(_0x0357('0x1f'))][(_0x0357('0x20'))](_0x0357('0x21'));}}else{return _0x2d0fd2;}}function respondWithRpcPromise(_0x243795,_0x246d1b,_0x19a9ea,_0x179720){return new BPromise(function(_0x363a78,_0x4e5621){var _0x6e3b58=_0x179720||client;return _0x6e3b58[_0x0357('0x22')](_0x243795,_0x19a9ea)['then'](function(_0x4e9804){logger[_0x0357('0x23')](_0x0357('0x24'),_0x246d1b,'request\x20sent');logger[_0x0357('0x25')](_0x0357('0x26'),_0x246d1b,_0x0357('0x27'),JSON[_0x0357('0x28')](_0x4e9804));if(_0x4e9804['error']){if(_0x4e9804[_0x0357('0x29')]['code']===0x1f4){logger[_0x0357('0x29')](_0x0357('0x24'),_0x246d1b,_0x4e9804[_0x0357('0x29')][_0x0357('0x2a')]);return _0x4e5621(_0x4e9804[_0x0357('0x29')]['message']);}logger[_0x0357('0x29')]('MailMessage,\x20%s,\x20%s',_0x246d1b,_0x4e9804[_0x0357('0x29')][_0x0357('0x2a')]);return _0x363a78(_0x4e9804[_0x0357('0x29')]['message']);}else{logger[_0x0357('0x23')]('MailMessage,\x20%s,\x20%s',_0x246d1b,_0x0357('0x27'));_0x363a78(_0x4e9804['result']['message']);}})[_0x0357('0x2b')](function(_0x53c1d6){logger[_0x0357('0x29')](_0x0357('0x24'),_0x246d1b,_0x53c1d6);_0x4e5621(_0x53c1d6);});});}function respondWithStatusCode(_0x533c06,_0x368d4c){_0x368d4c=_0x368d4c||0xcc;return function(_0x3a7e81){if(_0x3a7e81){return _0x533c06['sendStatus'](_0x368d4c);}return _0x533c06[_0x0357('0x2c')](_0x368d4c)['end']();};}function respondWithResult(_0x533576,_0x527a29){_0x527a29=_0x527a29||0xc8;return function(_0x1f09da){if(_0x1f09da){return _0x533576[_0x0357('0x2c')](_0x527a29)[_0x0357('0x2d')](_0x1f09da);}};}function respondWithFilteredResult(_0x21d6db,_0x9608a7){return function(_0x19ab55){if(_0x19ab55){var _0x266dc4=_0x19ab55[_0x0357('0x2e')],_0x5080da=_0x9608a7[_0x0357('0x2f')],_0x1d97bd=_0x9608a7[_0x0357('0x2f')]+_0x9608a7['limit'],_0x3b5190;if(_0x1d97bd>=_0x266dc4){_0x1d97bd=_0x266dc4;_0x3b5190=0xc8;}else{_0x3b5190=0xce;}_0x21d6db[_0x0357('0x2c')](_0x3b5190);return _0x21d6db[_0x0357('0x30')](_0x0357('0x31'),_0x5080da+'-'+_0x1d97bd+'/'+_0x266dc4)['json'](_0x19ab55);}return null;};}function patchUpdates(_0x525d97){return function(_0x45871d){try{jsonpatch[_0x0357('0x32')](_0x45871d,_0x525d97,!![]);}catch(_0x3aab52){return BPromise['reject'](_0x3aab52);}return _0x45871d['save']();};}function saveUpdates(_0x235bf2,_0x57f8bb){return function(_0x2c371a){if(_0x2c371a){return _0x2c371a['update'](_0x235bf2)['then'](function(_0x284d4b){return _0x284d4b;});}return null;};}function removeEntity(_0x39824c,_0x56dee7){return function(_0x369677){if(_0x369677){return _0x369677['destroy']()['then'](function(){_0x39824c[_0x0357('0x2c')](0xcc)[_0x0357('0x33')]();});}};}function handleEntityNotFound(_0xcc1869,_0x4a4d14){return function(_0x59dd3c){if(!_0x59dd3c){_0xcc1869[_0x0357('0x34')](0x194);}return _0x59dd3c;};}function handleError(_0xdac75,_0xd48329){_0xd48329=_0xd48329||0x1f4;return function(_0x5e5c2e){logger['error'](_0x5e5c2e[_0x0357('0x35')]);if(_0x5e5c2e[_0x0357('0x36')]){delete _0x5e5c2e[_0x0357('0x36')];}_0xdac75[_0x0357('0x2c')](_0xd48329)[_0x0357('0x37')](_0x5e5c2e);};}exports['index']=function(_0x2b6699,_0x695e85){var _0x476e2c={},_0x28b8e3={},_0x3bc739={'count':0x0,'rows':[]};var _0x3b1ad4=_[_0x0357('0x38')](db[_0x0357('0x39')][_0x0357('0x3a')],function(_0x336b70){return{'name':_0x336b70[_0x0357('0x3b')],'type':_0x336b70[_0x0357('0x3c')]['key']};});_0x28b8e3[_0x0357('0x3d')]=_[_0x0357('0x38')](_0x3b1ad4,_0x0357('0x36'));_0x28b8e3[_0x0357('0x3e')]=_[_0x0357('0x3f')](_0x2b6699[_0x0357('0x3e')]);_0x28b8e3['filters']=_[_0x0357('0x40')](_0x28b8e3['model'],_0x28b8e3[_0x0357('0x3e')]);_0x476e2c[_0x0357('0x41')]=_['intersection'](_0x28b8e3[_0x0357('0x3d')],qs[_0x0357('0x42')](_0x2b6699[_0x0357('0x3e')][_0x0357('0x42')]));_0x476e2c['attributes']=_0x476e2c[_0x0357('0x41')]['length']?_0x476e2c[_0x0357('0x41')]:_0x28b8e3[_0x0357('0x3d')];if(!_0x2b6699[_0x0357('0x3e')][_0x0357('0x43')]('nolimit')){_0x476e2c[_0x0357('0x44')]=qs['limit'](_0x2b6699['query'][_0x0357('0x44')]);_0x476e2c[_0x0357('0x2f')]=qs[_0x0357('0x2f')](_0x2b6699[_0x0357('0x3e')][_0x0357('0x2f')]);}_0x476e2c[_0x0357('0x45')]=qs['sort'](_0x2b6699[_0x0357('0x3e')][_0x0357('0x46')]);_0x476e2c[_0x0357('0x47')]=qs['filters'](_['pick'](_0x2b6699['query'],_0x28b8e3['filters']));if(_0x2b6699[_0x0357('0x3e')][_0x0357('0x48')]){_0x476e2c['where']=_[_0x0357('0x49')](_0x476e2c[_0x0357('0x47')],{'$or':_[_0x0357('0x38')](_0x3b1ad4,function(_0x276df1){if(_0x276df1[_0x0357('0x3c')]!=='VIRTUAL'){var _0xd6496={};_0xd6496[_0x276df1[_0x0357('0x36')]]={'$like':'%'+_0x2b6699[_0x0357('0x3e')]['filter']+'%'};return _0xd6496;}})});}_0x476e2c=_[_0x0357('0x49')]({},_0x476e2c,_0x2b6699['options']);var _0x20f2cd={'where':_0x476e2c[_0x0357('0x47')]};return db[_0x0357('0x39')]['count'](_0x20f2cd)['then'](function(_0x16ee92){_0x3bc739[_0x0357('0x2e')]=_0x16ee92;if(_0x2b6699[_0x0357('0x3e')][_0x0357('0x4a')]){_0x476e2c[_0x0357('0x4b')]=[{'all':!![]}];}return db[_0x0357('0x39')][_0x0357('0x4c')](_0x476e2c);})[_0x0357('0x4d')](function(_0x2b4613){_0x3bc739[_0x0357('0x4e')]=_0x2b4613;return _0x3bc739;})['then'](respondWithFilteredResult(_0x695e85,_0x476e2c))[_0x0357('0x2b')](handleError(_0x695e85,null));};exports[_0x0357('0x4f')]=function(_0x240a5b,_0x5b5e2c){var _0x40fa7f={'raw':!![],'where':{'id':_0x240a5b[_0x0357('0x50')]['id']}},_0x3b0d4e={};_0x3b0d4e[_0x0357('0x3d')]=_[_0x0357('0x3f')](db['MailMessage'][_0x0357('0x3a')]);_0x3b0d4e[_0x0357('0x3e')]=_[_0x0357('0x3f')](_0x240a5b['query']);_0x3b0d4e[_0x0357('0x51')]=_['intersection'](_0x3b0d4e['model'],_0x3b0d4e[_0x0357('0x3e')]);_0x40fa7f[_0x0357('0x41')]=_[_0x0357('0x40')](_0x3b0d4e[_0x0357('0x3d')],qs[_0x0357('0x42')](_0x240a5b['query']['fields']));_0x40fa7f[_0x0357('0x41')]=_0x40fa7f[_0x0357('0x41')]['length']?_0x40fa7f[_0x0357('0x41')]:_0x3b0d4e['model'];if(_0x240a5b[_0x0357('0x3e')][_0x0357('0x4a')]){_0x40fa7f[_0x0357('0x4b')]=[{'all':!![]}];}_0x40fa7f=_[_0x0357('0x49')]({},_0x40fa7f,_0x240a5b[_0x0357('0x52')]);return db['MailMessage'][_0x0357('0x53')](_0x40fa7f)['then'](handleEntityNotFound(_0x5b5e2c,null))[_0x0357('0x4d')](respondWithResult(_0x5b5e2c,null))['catch'](handleError(_0x5b5e2c,null));};exports[_0x0357('0x54')]=function(_0x32d27b,_0x1219cd){if(_0x32d27b[_0x0357('0x55')]['id']){delete _0x32d27b[_0x0357('0x55')]['id'];}return db[_0x0357('0x39')][_0x0357('0x53')]({'where':{'id':_0x32d27b['params']['id']}})['then'](handleEntityNotFound(_0x1219cd,null))[_0x0357('0x4d')](saveUpdates(_0x32d27b['body'],null))[_0x0357('0x4d')](respondWithResult(_0x1219cd,null))[_0x0357('0x2b')](handleError(_0x1219cd,null));};exports[_0x0357('0x56')]=function(_0x81867f,_0x2b927e){return db[_0x0357('0x39')][_0x0357('0x53')]({'where':{'id':_0x81867f[_0x0357('0x50')]['id']}})[_0x0357('0x4d')](handleEntityNotFound(_0x2b927e,null))[_0x0357('0x4d')](removeEntity(_0x2b927e,null))[_0x0357('0x2b')](handleError(_0x2b927e,null));};exports[_0x0357('0x57')]=function(_0x323f6b,_0x323684){return db[_0x0357('0x39')]['describe']()['then'](respondWithResult(_0x323684,null))[_0x0357('0x2b')](handleError(_0x323684,null));};exports[_0x0357('0x58')]=function(_0xc8fa7d,_0x221553){return db[_0x0357('0x39')][_0x0357('0x58')](_0xc8fa7d[_0x0357('0x55')])[_0x0357('0x4d')](function(_0x48c2d8){if(_0x48c2d8){if(_0x48c2d8[_0x0357('0x59')]==='out'&&!_0x48c2d8[_0x0357('0x5a')]){var _0x5e4535,_0x1c3bd2,_0x3d67c6;if(_0xc8fa7d[_0x0357('0x55')]['to']){_0x1c3bd2=_0xc8fa7d[_0x0357('0x55')]['to'][_0x0357('0x5b')](',')[0x0];}return db[_0x0357('0x5c')]['findOne']({'where':{'id':_0x48c2d8['MailAccountId']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db[_0x0357('0x5d')],'as':_0x0357('0x5e'),'where':{'email':_0x1c3bd2},'limit':0x1,'order':[[_0x0357('0x5f'),'DESC']]}]},{'model':db[_0x0357('0x60')],'as':_0x0357('0x61'),'raw':!![]}]})[_0x0357('0x4d')](function(_0x50433d){_0x5e4535=_0x50433d;if(_0x5e4535&&_0x5e4535['Smtp']){var _0x4cc599={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x5e4535[_0x0357('0x61')][_0x0357('0x62')])){_0x4cc599[_0x0357('0x63')]=_0x5e4535[_0x0357('0x61')][_0x0357('0x63')];_0x4cc599[_0x0357('0x64')]=_0x5e4535['Smtp'][_0x0357('0x64')];_0x4cc599['secure']=_0x5e4535[_0x0357('0x61')][_0x0357('0x65')];if(_0x5e4535[_0x0357('0x61')]['authentication']){_0x4cc599[_0x0357('0x66')]={'user':_0x5e4535['Smtp'][_0x0357('0x67')],'pass':_0x5e4535[_0x0357('0x61')][_0x0357('0x68')]};}}else{_0x4cc599[_0x0357('0x62')]=_0x5e4535[_0x0357('0x61')][_0x0357('0x62')];_0x4cc599['auth']={'user':_0x5e4535[_0x0357('0x61')][_0x0357('0x67')],'pass':_0x5e4535[_0x0357('0x61')][_0x0357('0x68')]};_0x4cc599['secure']=_0x5e4535[_0x0357('0x61')][_0x0357('0x65')];}if(_0xc8fa7d[_0x0357('0x55')]['attachments']&&_0xc8fa7d['body'][_0x0357('0x69')][_0x0357('0x6a')]){for(var _0x545860=0x0;_0x545860<_0xc8fa7d[_0x0357('0x55')][_0x0357('0x69')][_0x0357('0x6a')];_0x545860+=0x1){_0xc8fa7d[_0x0357('0x55')][_0x0357('0x69')][_0x545860]={'filename':_0xc8fa7d[_0x0357('0x55')][_0x0357('0x69')][_0x545860][_0x0357('0x36')],'path':path[_0x0357('0x6b')](config[_0x0357('0x6c')],_0x0357('0x6d'),_0xc8fa7d[_0x0357('0x55')][_0x0357('0x69')][_0x545860][_0x0357('0x6e')])};}}_0x3d67c6={'account':_0x4cc599,'message':_0xc8fa7d[_0x0357('0x55')]};return;}})[_0x0357('0x4d')](function(){if(_0x5e4535[_0x0357('0x6f')]){if(_0x5e4535['List'][_0x0357('0x5e')]['length']){return _0x5e4535['List'][_0x0357('0x5e')][0x0];}else{return db[_0x0357('0x5d')][_0x0357('0x58')](_[_0x0357('0x18')](_0xc8fa7d[_0x0357('0x55')],{'firstName':_0xc8fa7d[_0x0357('0x55')]['to'],'email':_0xc8fa7d['body']['to'],'phone':_0xc8fa7d['body']['to'],'ListId':_0x5e4535[_0x0357('0x70')]}));}}else{throw new Error('List\x20not\x20found');}})['then'](function(){if(_0x3d67c6){return respondWithRpcPromise('SendMail',_0x0357('0x71'),_0x3d67c6,client9003)[_0x0357('0x4d')](function(_0x197fef){return _0x48c2d8[_0x0357('0x54')]({'read':!![],'messageId':_0x197fef['messageId'],'sentAt':moment()[_0x0357('0x72')](_0x0357('0x73'))});})[_0x0357('0x2b')](function(_0x5e73e2){logger['error']('%s',JSON[_0x0357('0x28')](_0x5e73e2));return _0x48c2d8;});}return _0x48c2d8;});}return _0x48c2d8;}})[_0x0357('0x4d')](respondWithResult(_0x221553,0xc9))[_0x0357('0x2b')](handleError(_0x221553,null));};var interaction_log=require(_0x0357('0x13'))(_0x0357('0x74'));exports[_0x0357('0x75')]=function(_0x13a371,_0x22e3d7,_0x1c0a32){var _0x146beb={'channel':_0x0357('0x76')};if(_0x13a371[_0x0357('0x55')]['id']){delete _0x13a371[_0x0357('0x55')]['id'];}_0x13a371[_0x0357('0x55')][_0x0357('0x77')]=!![];_0x13a371[_0x0357('0x55')][_0x0357('0x78')]=moment()['format'](_0x0357('0x73'));_0x13a371['body'][_0x0357('0x79')]=_0x13a371[_0x0357('0x55')][_0x0357('0x79')]||_0x13a371[_0x0357('0x67')]['id'];return db[_0x0357('0x39')][_0x0357('0x53')]({'where':{'id':_0x13a371[_0x0357('0x50')]['id'],'UserId':null},'include':[{'model':db[_0x0357('0x5d')],'as':_0x0357('0x7a')}]})[_0x0357('0x4d')](handleEntityNotFound(_0x22e3d7,null))[_0x0357('0x4d')](saveUpdates(_0x13a371['body'],null))['then'](function(_0x59a6a2){if(_0x59a6a2){_0x146beb[_0x0357('0x2a')]=_0x59a6a2['get']({'plain':!![]});return db['MailInteraction'][_0x0357('0x53')]({'where':{'id':_0x59a6a2[_0x0357('0x7b')]}});}return null;})[_0x0357('0x4d')](handleEntityNotFound(_0x22e3d7,null))[_0x0357('0x4d')](function(_0x40592a){if(_0x40592a){return _0x40592a['update']({'UserId':_0x13a371['body'][_0x0357('0x79')],'read1stAt':_[_0x0357('0x7c')](_0x40592a[_0x0357('0x7d')])?moment()['format'](_0x0357('0x73')):undefined});}return null;})[_0x0357('0x4d')](function(_0x372b26){if(_0x372b26){_0x146beb[_0x0357('0x7e')]=_0x372b26[_0x0357('0x7f')]({'plain':!![]});interaction_log[_0x0357('0x23')](_0x0357('0x80'),_0x13a371[_0x0357('0x67')]['id'],_0x13a371[_0x0357('0x67')][_0x0357('0x36')],_0x13a371[_0x0357('0x67')]['role'],_0x146beb[_0x0357('0x7e')]['id'],_0x13a371[_0x0357('0x55')]?JSON[_0x0357('0x28')](_0x13a371[_0x0357('0x55')]):_0x0357('0x81'));return respondWithRpcPromise(_0x0357('0x82'),_0x0357('0x83'),_0x146beb);}return null;})[_0x0357('0x4d')](function(_0x51b3e2){if(_0x51b3e2){if(_0x13a371[_0x0357('0x55')][_0x0357('0x84')]){_0x146beb[_0x0357('0x2a')][_0x0357('0x85')]=util[_0x0357('0x72')]('SIP/%s',_0x13a371[_0x0357('0x67')][_0x0357('0x36')]);_0x146beb[_0x0357('0x2a')][_0x0357('0x86')]=_0x146beb[_0x0357('0x86')];_0x146beb[_0x0357('0x2a')][_0x0357('0x87')]=_0x0357('0x75');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x146beb[_0x0357('0x2a')]},client9002)[_0x0357('0x4d')](function(){return _0x146beb;});}return _0x146beb;}return null;})[_0x0357('0x4d')](respondWithResult(_0x22e3d7,null))[_0x0357('0x2b')](handleError(_0x22e3d7,null));};var interaction_log=require(_0x0357('0x13'))(_0x0357('0x74'));exports[_0x0357('0x88')]=function(_0x162b57,_0x2dc8d9,_0x650f30){var _0x2fb002={'agent':{},'channel':'mail'};if(_0x162b57['body']['id']){delete _0x162b57[_0x0357('0x55')]['id'];}_0x162b57[_0x0357('0x55')]['UserId']=_0x162b57[_0x0357('0x55')]['UserId']||_0x162b57[_0x0357('0x67')]['id'];_0x2fb002[_0x0357('0x89')]['id']=_0x162b57[_0x0357('0x55')][_0x0357('0x79')];return db['MailMessage'][_0x0357('0x53')]({'where':{'id':_0x162b57[_0x0357('0x50')]['id'],'UserId':null}})[_0x0357('0x4d')](handleEntityNotFound(_0x2dc8d9,null))['then'](function(_0x5c16aa){if(_0x5c16aa){_0x2fb002['message']=_0x5c16aa['get']({'plain':!![]});return db[_0x0357('0x8a')]['find']({'where':{'id':_0x5c16aa[_0x0357('0x7b')]}});}return null;})['then'](handleEntityNotFound(_0x2dc8d9,null))[_0x0357('0x4d')](function(_0x1b7bfa){if(_0x1b7bfa){_0x2fb002[_0x0357('0x7e')]=_0x1b7bfa[_0x0357('0x7f')]({'plain':!![]});interaction_log['info'](_0x0357('0x8b'),_0x162b57['user']['id'],_0x162b57[_0x0357('0x67')][_0x0357('0x36')],_0x162b57[_0x0357('0x67')]['role'],_0x2fb002['interaction']['id'],_0x162b57[_0x0357('0x55')]?JSON[_0x0357('0x28')](_0x162b57['body']):_0x0357('0x81'));return respondWithRpcPromise(_0x0357('0x8c'),_0x0357('0x8d'),_0x2fb002);}return null;})['then'](function(_0x491785){if(_0x491785){_0x491785['message']['interface']=util[_0x0357('0x72')](_0x0357('0x8e'),_0x162b57[_0x0357('0x67')]['name']);_0x491785['message']['channel']=_0x2fb002[_0x0357('0x86')];_0x491785['message'][_0x0357('0x87')]=_0x0357('0x88');respondWithRpcPromise(_0x0357('0x8f'),'EventManager',{'event':_0x0357('0x90'),'message':_0x491785[_0x0357('0x2a')]},client9002);return _0x2fb002;}return null;})[_0x0357('0x4d')](respondWithResult(_0x2dc8d9,null))[_0x0357('0x2b')](handleError(_0x2dc8d9,null));};exports[_0x0357('0x91')]=function(_0x36158d,_0x90970e){var _0x57616b=moment()[_0x0357('0x92')]()[_0x0357('0x93')]();var _0xb44d79=path[_0x0357('0x6b')](config['root'],_0x0357('0x94'),_0x0357('0x95'),_0x0357('0x96'));var _0x15315f=path[_0x0357('0x6b')](config[_0x0357('0x6c')],_0x0357('0x94'),_0x0357('0x95'),'attachments');var _0x2be0f2=util[_0x0357('0x72')](_0x0357('0x97'),_0x57616b);return db[_0x0357('0x39')]['find']({'where':{'id':_0x36158d[_0x0357('0x50')]['id']},'attributes':['id','body',_0x0357('0x98'),'to','cc',_0x0357('0x99'),_0x0357('0x9a'),_0x0357('0x9b')],'include':_0x36158d['query'][_0x0357('0x69')]?[{'model':db[_0x0357('0x9c')],'as':_0x0357('0x9d')}]:undefined})[_0x0357('0x4d')](handleEntityNotFound(_0x90970e,null))[_0x0357('0x4d')](function(_0xa677ed){if(_0xa677ed){var _0xfac871=_0xa677ed;var _0x3ba020={'from':_0xfac871[_0x0357('0x98')],'to':_0xfac871['to'],'subject':_0xfac871['subject'],'html':_0xfac871[_0x0357('0x55')],'headers':{'Date':moment(_0xfac871[_0x0357('0x9b')])[_0x0357('0x72')](_0x0357('0x9e'))},'attachments':[]};if(_0xa677ed['cc']){_0x3ba020[_0x0357('0x9f')]['Cc']=_0xa677ed['cc'];}if(_0xa677ed[_0x0357('0x99')]){_0x3ba020['headers'][_0x0357('0xa0')]=_0xa677ed[_0x0357('0x99')];}return new BPromise(function(_0x180f90,_0x17d251){if(_0xa677ed[_0x0357('0x9d')]){for(var _0x15e8fe=0x0;_0x15e8fe<_0xa677ed[_0x0357('0x9d')]['length'];_0x15e8fe++){var _0x54d817=_0xa677ed[_0x0357('0x9d')][_0x15e8fe];var _0x1eb7b4=path[_0x0357('0x6b')](_0x15315f,_0x54d817[_0x0357('0x6e')]);if(fs['existsSync'](_0x1eb7b4)){_0x3ba020['attachments'][_0x0357('0xa1')]({'name':_0x54d817[_0x0357('0x36')],'contentType':_0x54d817[_0x0357('0x3c')],'data':fs[_0x0357('0xa2')](_0x1eb7b4)});}}}emlformat['build'](_0x3ba020,function(_0x33f71f,_0x5a7f64){if(_0x33f71f)return _0x17d251(_0x33f71f);fs['writeFileSync'](path[_0x0357('0x6b')](_0xb44d79,_0x2be0f2),_0x5a7f64);return _0x180f90(_0x5a7f64);});});}})['then'](function(_0x29e19a){if(_0x29e19a){return _0x90970e['download'](path[_0x0357('0x6b')](_0xb44d79,_0x2be0f2),_0x2be0f2,function(_0x3a532f){if(_0x3a532f){console[_0x0357('0xa3')](_0x0357('0xa4'),_0x3a532f);}else{fs[_0x0357('0xa5')](path['join'](_0xb44d79,_0x2be0f2));}});}})[_0x0357('0x2b')](handleError(_0x90970e,null));}; \ No newline at end of file +var _0x277a=['status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','MailMessage','type','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','merge','filter','options','findAll','rows','show','params','rawAttributes','length','includeAll','include','find','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','root','server/files/attachments','List\x20not\x20found','sendMail','messageId','format','mail-interactions','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','MailInteraction','MailInteractionId','read1stAt','interaction','get','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','agent','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','rejectmessage','unix','toString','join','server','tmp','files','message-%s.eml','Attachment','Attachments','from','subject','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','bcc','basename','existsSync','readFileSync','build','writeFileSync','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','socket.io-emitter','redis','./mailMessage.socket','register','jayson/promise','http','client','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','sendStatus'];(function(_0xe17f0b,_0x1b85aa){var _0x3d559f=function(_0x3f6a0e){while(--_0x3f6a0e){_0xe17f0b['push'](_0xe17f0b['shift']());}};_0x3d559f(++_0x1b85aa);}(_0x277a,0x128));var _0xa277=function(_0x4fdeba,_0x1ff415){_0x4fdeba=_0x4fdeba-0x0;var _0x4394e7=_0x277a[_0x4fdeba];return _0x4394e7;};'use strict';var pdf=require(_0xa277('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa277('0x1'));var zipdir=require(_0xa277('0x2'));var jsonpatch=require(_0xa277('0x3'));var rp=require(_0xa277('0x4'));var moment=require(_0xa277('0x5'));var BPromise=require(_0xa277('0x6'));var Mustache=require(_0xa277('0x7'));var util=require(_0xa277('0x8'));var path=require(_0xa277('0x9'));var sox=require(_0xa277('0xa'));var csv=require(_0xa277('0xb'));var ejs=require(_0xa277('0xc'));var fs=require('fs');var _=require(_0xa277('0xd'));var squel=require(_0xa277('0xe'));var crypto=require('crypto');var jsforce=require(_0xa277('0xf'));var deskjs=require(_0xa277('0x10'));var toCsv=require('to-csv');var querystring=require(_0xa277('0x11'));var Papa=require(_0xa277('0x12'));var Redis=require(_0xa277('0x13'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa277('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa277('0x15'))(_0xa277('0x16'));var utils=require(_0xa277('0x17'));var config=require(_0xa277('0x18'));var db=require(_0xa277('0x19'))['db'];config['redis']=_[_0xa277('0x1a')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa277('0x1b'))(new Redis(config[_0xa277('0x1c')]));require(_0xa277('0x1d'))[_0xa277('0x1e')](socket);var jayson=require(_0xa277('0x1f'));var client=jayson['client'][_0xa277('0x20')]({'port':0x232c});var client9003=jayson[_0xa277('0x21')][_0xa277('0x20')]({'port':0x232b});var client9002=jayson[_0xa277('0x21')][_0xa277('0x20')]({'port':0x232a});function checkPasswordPattern(_0x3d9084,_0x395a3b,_0x354083){if(_0x354083){var _0x129a97=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x129a97[_0xa277('0x22')](_0x395a3b)){return _0x3d9084;}else{throw new db[(_0xa277('0x23'))]['ValidationError'](_0xa277('0x24'));}}else{return _0x3d9084;}}function respondWithRpcPromise(_0x1ca4ce,_0x8e1a20,_0x28a8ed,_0x13e46b){return new BPromise(function(_0x226238,_0xcced86){var _0x38bf0b=_0x13e46b||client;return _0x38bf0b[_0xa277('0x25')](_0x1ca4ce,_0x28a8ed)[_0xa277('0x26')](function(_0x1bba25){logger[_0xa277('0x27')](_0xa277('0x28'),_0x8e1a20,'request\x20sent');logger[_0xa277('0x29')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x8e1a20,_0xa277('0x2a'),JSON[_0xa277('0x2b')](_0x1bba25));if(_0x1bba25[_0xa277('0x2c')]){if(_0x1bba25[_0xa277('0x2c')][_0xa277('0x2d')]===0x1f4){logger['error'](_0xa277('0x28'),_0x8e1a20,_0x1bba25['error'][_0xa277('0x2e')]);return _0xcced86(_0x1bba25[_0xa277('0x2c')][_0xa277('0x2e')]);}logger['error'](_0xa277('0x28'),_0x8e1a20,_0x1bba25[_0xa277('0x2c')]['message']);return _0x226238(_0x1bba25[_0xa277('0x2c')][_0xa277('0x2e')]);}else{logger[_0xa277('0x27')](_0xa277('0x28'),_0x8e1a20,_0xa277('0x2a'));_0x226238(_0x1bba25[_0xa277('0x2f')]['message']);}})[_0xa277('0x30')](function(_0xf40d78){logger[_0xa277('0x2c')](_0xa277('0x28'),_0x8e1a20,_0xf40d78);_0xcced86(_0xf40d78);});});}function respondWithStatusCode(_0x40fc75,_0x2c4b8e){_0x2c4b8e=_0x2c4b8e||0xcc;return function(_0x1245c0){if(_0x1245c0){return _0x40fc75[_0xa277('0x31')](_0x2c4b8e);}return _0x40fc75[_0xa277('0x32')](_0x2c4b8e)[_0xa277('0x33')]();};}function respondWithResult(_0x3492e5,_0x2b27c6){_0x2b27c6=_0x2b27c6||0xc8;return function(_0x5a0747){if(_0x5a0747){return _0x3492e5[_0xa277('0x32')](_0x2b27c6)[_0xa277('0x34')](_0x5a0747);}};}function respondWithFilteredResult(_0xc502e9,_0x15895e){return function(_0x152b22){if(_0x152b22){var _0x533d86=_0x152b22[_0xa277('0x35')],_0x3d4a94=_0x15895e[_0xa277('0x36')],_0x49cdab=_0x15895e[_0xa277('0x36')]+_0x15895e[_0xa277('0x37')],_0x3f82fc;if(_0x49cdab>=_0x533d86){_0x49cdab=_0x533d86;_0x3f82fc=0xc8;}else{_0x3f82fc=0xce;}_0xc502e9[_0xa277('0x32')](_0x3f82fc);return _0xc502e9['set'](_0xa277('0x38'),_0x3d4a94+'-'+_0x49cdab+'/'+_0x533d86)[_0xa277('0x34')](_0x152b22);}return null;};}function patchUpdates(_0xbcf281){return function(_0x4bf554){try{jsonpatch[_0xa277('0x39')](_0x4bf554,_0xbcf281,!![]);}catch(_0x2f3f15){return BPromise[_0xa277('0x3a')](_0x2f3f15);}return _0x4bf554[_0xa277('0x3b')]();};}function saveUpdates(_0x4a3146,_0x465af8){return function(_0x132c02){if(_0x132c02){return _0x132c02[_0xa277('0x3c')](_0x4a3146)[_0xa277('0x26')](function(_0x1e1aab){return _0x1e1aab;});}return null;};}function removeEntity(_0x597dc9,_0x582c07){return function(_0x4b0ab7){if(_0x4b0ab7){return _0x4b0ab7[_0xa277('0x3d')]()['then'](function(){_0x597dc9[_0xa277('0x32')](0xcc)[_0xa277('0x33')]();});}};}function handleEntityNotFound(_0x1fec36,_0x547a43){return function(_0x168f7d){if(!_0x168f7d){_0x1fec36[_0xa277('0x31')](0x194);}return _0x168f7d;};}function handleError(_0xbc4718,_0x4457db){_0x4457db=_0x4457db||0x1f4;return function(_0x53b03d){logger['error'](_0x53b03d[_0xa277('0x3e')]);if(_0x53b03d[_0xa277('0x3f')]){delete _0x53b03d['name'];}_0xbc4718['status'](_0x4457db)[_0xa277('0x40')](_0x53b03d);};}exports[_0xa277('0x41')]=function(_0x28c630,_0x592dc6){var _0x5c994b={},_0x5e45cc={},_0x5b8502={'count':0x0,'rows':[]};var _0x284c12=_[_0xa277('0x42')](db[_0xa277('0x43')]['rawAttributes'],function(_0x1eb9f0){return{'name':_0x1eb9f0['fieldName'],'type':_0x1eb9f0[_0xa277('0x44')][_0xa277('0x45')]};});_0x5e45cc[_0xa277('0x46')]=_[_0xa277('0x42')](_0x284c12,_0xa277('0x3f'));_0x5e45cc[_0xa277('0x47')]=_[_0xa277('0x48')](_0x28c630[_0xa277('0x47')]);_0x5e45cc[_0xa277('0x49')]=_[_0xa277('0x4a')](_0x5e45cc[_0xa277('0x46')],_0x5e45cc[_0xa277('0x47')]);_0x5c994b[_0xa277('0x4b')]=_[_0xa277('0x4a')](_0x5e45cc[_0xa277('0x46')],qs[_0xa277('0x4c')](_0x28c630['query']['fields']));_0x5c994b['attributes']=_0x5c994b[_0xa277('0x4b')]['length']?_0x5c994b[_0xa277('0x4b')]:_0x5e45cc[_0xa277('0x46')];if(!_0x28c630['query']['hasOwnProperty'](_0xa277('0x4d'))){_0x5c994b['limit']=qs[_0xa277('0x37')](_0x28c630['query']['limit']);_0x5c994b[_0xa277('0x36')]=qs[_0xa277('0x36')](_0x28c630['query']['offset']);}_0x5c994b[_0xa277('0x4e')]=qs['sort'](_0x28c630['query'][_0xa277('0x4f')]);_0x5c994b[_0xa277('0x50')]=qs[_0xa277('0x49')](_[_0xa277('0x51')](_0x28c630[_0xa277('0x47')],_0x5e45cc[_0xa277('0x49')]));if(_0x28c630[_0xa277('0x47')]['filter']){_0x5c994b[_0xa277('0x50')]=_[_0xa277('0x52')](_0x5c994b['where'],{'$or':_['map'](_0x284c12,function(_0x1f5430){if(_0x1f5430[_0xa277('0x44')]!=='VIRTUAL'){var _0x34df30={};_0x34df30[_0x1f5430[_0xa277('0x3f')]]={'$like':'%'+_0x28c630[_0xa277('0x47')][_0xa277('0x53')]+'%'};return _0x34df30;}})});}_0x5c994b=_[_0xa277('0x52')]({},_0x5c994b,_0x28c630[_0xa277('0x54')]);var _0x108324={'where':_0x5c994b['where']};return db[_0xa277('0x43')][_0xa277('0x35')](_0x108324)[_0xa277('0x26')](function(_0xe8e8fa){_0x5b8502[_0xa277('0x35')]=_0xe8e8fa;if(_0x28c630['query']['includeAll']){_0x5c994b['include']=[{'all':!![]}];}return db['MailMessage'][_0xa277('0x55')](_0x5c994b);})[_0xa277('0x26')](function(_0x35a918){_0x5b8502[_0xa277('0x56')]=_0x35a918;return _0x5b8502;})['then'](respondWithFilteredResult(_0x592dc6,_0x5c994b))['catch'](handleError(_0x592dc6,null));};exports[_0xa277('0x57')]=function(_0x560cb1,_0xadeddb){var _0x14ec5a={'raw':!![],'where':{'id':_0x560cb1[_0xa277('0x58')]['id']}},_0x5a1442={};_0x5a1442[_0xa277('0x46')]=_['keys'](db[_0xa277('0x43')][_0xa277('0x59')]);_0x5a1442[_0xa277('0x47')]=_[_0xa277('0x48')](_0x560cb1['query']);_0x5a1442['filters']=_['intersection'](_0x5a1442[_0xa277('0x46')],_0x5a1442['query']);_0x14ec5a[_0xa277('0x4b')]=_[_0xa277('0x4a')](_0x5a1442[_0xa277('0x46')],qs[_0xa277('0x4c')](_0x560cb1[_0xa277('0x47')][_0xa277('0x4c')]));_0x14ec5a[_0xa277('0x4b')]=_0x14ec5a[_0xa277('0x4b')][_0xa277('0x5a')]?_0x14ec5a[_0xa277('0x4b')]:_0x5a1442[_0xa277('0x46')];if(_0x560cb1[_0xa277('0x47')][_0xa277('0x5b')]){_0x14ec5a[_0xa277('0x5c')]=[{'all':!![]}];}_0x14ec5a=_[_0xa277('0x52')]({},_0x14ec5a,_0x560cb1[_0xa277('0x54')]);return db['MailMessage'][_0xa277('0x5d')](_0x14ec5a)[_0xa277('0x26')](handleEntityNotFound(_0xadeddb,null))[_0xa277('0x26')](respondWithResult(_0xadeddb,null))[_0xa277('0x30')](handleError(_0xadeddb,null));};exports[_0xa277('0x3c')]=function(_0x4a998c,_0x42c522){if(_0x4a998c[_0xa277('0x5e')]['id']){delete _0x4a998c[_0xa277('0x5e')]['id'];}return db[_0xa277('0x43')][_0xa277('0x5d')]({'where':{'id':_0x4a998c['params']['id']}})[_0xa277('0x26')](handleEntityNotFound(_0x42c522,null))[_0xa277('0x26')](saveUpdates(_0x4a998c[_0xa277('0x5e')],null))[_0xa277('0x26')](respondWithResult(_0x42c522,null))[_0xa277('0x30')](handleError(_0x42c522,null));};exports[_0xa277('0x3d')]=function(_0x37c7b0,_0x569201){return db[_0xa277('0x43')][_0xa277('0x5d')]({'where':{'id':_0x37c7b0[_0xa277('0x58')]['id']}})['then'](handleEntityNotFound(_0x569201,null))[_0xa277('0x26')](removeEntity(_0x569201,null))[_0xa277('0x30')](handleError(_0x569201,null));};exports['describe']=function(_0x467451,_0x305a05){return db[_0xa277('0x43')][_0xa277('0x5f')]()['then'](respondWithResult(_0x305a05,null))[_0xa277('0x30')](handleError(_0x305a05,null));};exports['create']=function(_0x4c35db,_0x322605){return db[_0xa277('0x43')][_0xa277('0x60')](_0x4c35db[_0xa277('0x5e')])[_0xa277('0x26')](function(_0x6778e8){if(_0x6778e8){if(_0x6778e8[_0xa277('0x61')]===_0xa277('0x62')&&!_0x6778e8[_0xa277('0x63')]){var _0x50c6dc,_0x36e9ff,_0x2915ec;if(_0x4c35db[_0xa277('0x5e')]['to']){_0x36e9ff=_0x4c35db[_0xa277('0x5e')]['to'][_0xa277('0x64')](',')[0x0];}return db[_0xa277('0x65')][_0xa277('0x66')]({'where':{'id':_0x6778e8[_0xa277('0x67')]},'include':[{'model':db[_0xa277('0x68')],'as':_0xa277('0x69'),'include':[{'model':db[_0xa277('0x6a')],'as':_0xa277('0x6b'),'where':{'email':_0x36e9ff},'limit':0x1,'order':[['updatedAt',_0xa277('0x6c')]]}]},{'model':db[_0xa277('0x6d')],'as':_0xa277('0x6e'),'raw':!![]}]})[_0xa277('0x26')](function(_0x17fa05){_0x50c6dc=_0x17fa05;if(_0x50c6dc&&_0x50c6dc[_0xa277('0x6e')]){var _0x3b2bc9={'tls':{'rejectUnauthorized':![]}};if(_[_0xa277('0x6f')](_0x50c6dc[_0xa277('0x6e')][_0xa277('0x70')])){_0x3b2bc9[_0xa277('0x71')]=_0x50c6dc[_0xa277('0x6e')][_0xa277('0x71')];_0x3b2bc9[_0xa277('0x72')]=_0x50c6dc[_0xa277('0x6e')]['port'];_0x3b2bc9[_0xa277('0x73')]=_0x50c6dc[_0xa277('0x6e')]['secure'];if(_0x50c6dc[_0xa277('0x6e')][_0xa277('0x74')]){_0x3b2bc9[_0xa277('0x75')]={'user':_0x50c6dc[_0xa277('0x6e')][_0xa277('0x76')],'pass':_0x50c6dc[_0xa277('0x6e')][_0xa277('0x77')]};}}else{_0x3b2bc9[_0xa277('0x70')]=_0x50c6dc[_0xa277('0x6e')][_0xa277('0x70')];_0x3b2bc9[_0xa277('0x75')]={'user':_0x50c6dc[_0xa277('0x6e')]['user'],'pass':_0x50c6dc['Smtp'][_0xa277('0x77')]};_0x3b2bc9[_0xa277('0x73')]=_0x50c6dc[_0xa277('0x6e')][_0xa277('0x73')];}if(_0x4c35db['body'][_0xa277('0x78')]&&_0x4c35db['body']['attachments'][_0xa277('0x5a')]){for(var _0x896c8=0x0;_0x896c8<_0x4c35db[_0xa277('0x5e')][_0xa277('0x78')][_0xa277('0x5a')];_0x896c8+=0x1){_0x4c35db[_0xa277('0x5e')][_0xa277('0x78')][_0x896c8]={'filename':_0x4c35db['body'][_0xa277('0x78')][_0x896c8][_0xa277('0x3f')],'path':path['join'](config[_0xa277('0x79')],_0xa277('0x7a'),_0x4c35db['body'][_0xa277('0x78')][_0x896c8]['basename'])};}}_0x2915ec={'account':_0x3b2bc9,'message':_0x4c35db[_0xa277('0x5e')]};return;}})[_0xa277('0x26')](function(){if(_0x50c6dc[_0xa277('0x69')]){if(_0x50c6dc[_0xa277('0x69')][_0xa277('0x6b')][_0xa277('0x5a')]){return _0x50c6dc[_0xa277('0x69')][_0xa277('0x6b')][0x0];}else{return db[_0xa277('0x6a')][_0xa277('0x60')](_[_0xa277('0x1a')](_0x4c35db[_0xa277('0x5e')],{'firstName':_0x4c35db[_0xa277('0x5e')]['to'],'email':_0x4c35db[_0xa277('0x5e')]['to'],'phone':_0x4c35db['body']['to'],'ListId':_0x50c6dc['ListId']}));}}else{throw new Error(_0xa277('0x7b'));}})[_0xa277('0x26')](function(){if(_0x2915ec){return respondWithRpcPromise('SendMail',_0xa277('0x7c'),_0x2915ec,client9003)['then'](function(_0x219157){return _0x6778e8['update']({'read':!![],'messageId':_0x219157[_0xa277('0x7d')],'sentAt':moment()[_0xa277('0x7e')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x481246){logger['error']('%s',JSON[_0xa277('0x2b')](_0x481246));return _0x6778e8;});}return _0x6778e8;});}return _0x6778e8;}})[_0xa277('0x26')](respondWithResult(_0x322605,0xc9))[_0xa277('0x30')](handleError(_0x322605,null));};var interaction_log=require(_0xa277('0x15'))(_0xa277('0x7f'));exports[_0xa277('0x80')]=function(_0x4bb72e,_0x4622cf,_0x30b982){var _0x42f79a={'channel':'mail'};if(_0x4bb72e['body']['id']){delete _0x4bb72e[_0xa277('0x5e')]['id'];}_0x4bb72e[_0xa277('0x5e')][_0xa277('0x81')]=!![];_0x4bb72e['body']['readAt']=moment()['format'](_0xa277('0x82'));_0x4bb72e['body'][_0xa277('0x83')]=_0x4bb72e['body'][_0xa277('0x83')]||_0x4bb72e[_0xa277('0x76')]['id'];return db['MailMessage'][_0xa277('0x5d')]({'where':{'id':_0x4bb72e[_0xa277('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xa277('0x6a')],'as':_0xa277('0x84')}]})[_0xa277('0x26')](handleEntityNotFound(_0x4622cf,null))[_0xa277('0x26')](saveUpdates(_0x4bb72e[_0xa277('0x5e')],null))[_0xa277('0x26')](function(_0x19cabf){if(_0x19cabf){_0x42f79a[_0xa277('0x2e')]=_0x19cabf['get']({'plain':!![]});return db[_0xa277('0x85')][_0xa277('0x5d')]({'where':{'id':_0x19cabf[_0xa277('0x86')]}});}return null;})[_0xa277('0x26')](handleEntityNotFound(_0x4622cf,null))[_0xa277('0x26')](function(_0x3715d9){if(_0x3715d9){return _0x3715d9[_0xa277('0x3c')]({'UserId':_0x4bb72e[_0xa277('0x5e')][_0xa277('0x83')],'read1stAt':_[_0xa277('0x6f')](_0x3715d9[_0xa277('0x87')])?moment()[_0xa277('0x7e')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0xa277('0x26')](function(_0x54cc6d){if(_0x54cc6d){_0x42f79a[_0xa277('0x88')]=_0x54cc6d[_0xa277('0x89')]({'plain':!![]});interaction_log[_0xa277('0x27')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x4bb72e[_0xa277('0x76')]['id'],_0x4bb72e['user'][_0xa277('0x3f')],_0x4bb72e[_0xa277('0x76')][_0xa277('0x8a')],_0x42f79a[_0xa277('0x88')]['id'],_0x4bb72e['body']?JSON['stringify'](_0x4bb72e['body']):'null');return respondWithRpcPromise(_0xa277('0x8b'),_0xa277('0x8c'),_0x42f79a);}return null;})['then'](function(_0x186da7){if(_0x186da7){if(_0x4bb72e[_0xa277('0x5e')][_0xa277('0x8d')]){_0x42f79a[_0xa277('0x2e')][_0xa277('0x8e')]=util['format'](_0xa277('0x8f'),_0x4bb72e[_0xa277('0x76')][_0xa277('0x3f')]);_0x42f79a['message'][_0xa277('0x90')]=_0x42f79a[_0xa277('0x90')];_0x42f79a[_0xa277('0x2e')][_0xa277('0x91')]=_0xa277('0x80');return respondWithRpcPromise('EventManager',_0xa277('0x92'),{'event':_0xa277('0x93'),'message':_0x42f79a[_0xa277('0x2e')]},client9002)[_0xa277('0x26')](function(){return _0x42f79a;});}return _0x42f79a;}return null;})[_0xa277('0x26')](respondWithResult(_0x4622cf,null))[_0xa277('0x30')](handleError(_0x4622cf,null));};var interaction_log=require(_0xa277('0x15'))('mail-interactions');exports[_0xa277('0x3a')]=function(_0x331a77,_0x2086ec,_0x448c67){var _0x1e3585={'agent':{},'channel':'mail'};if(_0x331a77[_0xa277('0x5e')]['id']){delete _0x331a77[_0xa277('0x5e')]['id'];}_0x331a77[_0xa277('0x5e')][_0xa277('0x83')]=_0x331a77[_0xa277('0x5e')][_0xa277('0x83')]||_0x331a77[_0xa277('0x76')]['id'];_0x1e3585[_0xa277('0x94')]['id']=_0x331a77[_0xa277('0x5e')][_0xa277('0x83')];return db['MailMessage'][_0xa277('0x5d')]({'where':{'id':_0x331a77['params']['id'],'UserId':null}})[_0xa277('0x26')](handleEntityNotFound(_0x2086ec,null))['then'](function(_0xb89330){if(_0xb89330){_0x1e3585[_0xa277('0x2e')]=_0xb89330[_0xa277('0x89')]({'plain':!![]});return db[_0xa277('0x85')]['find']({'where':{'id':_0xb89330['MailInteractionId']}});}return null;})[_0xa277('0x26')](handleEntityNotFound(_0x2086ec,null))[_0xa277('0x26')](function(_0xfe31cd){if(_0xfe31cd){_0x1e3585['interaction']=_0xfe31cd['get']({'plain':!![]});interaction_log[_0xa277('0x27')](_0xa277('0x95'),_0x331a77[_0xa277('0x76')]['id'],_0x331a77[_0xa277('0x76')]['name'],_0x331a77[_0xa277('0x76')][_0xa277('0x8a')],_0x1e3585[_0xa277('0x88')]['id'],_0x331a77['body']?JSON['stringify'](_0x331a77['body']):'null');return respondWithRpcPromise('RejectMessage',_0xa277('0x96'),_0x1e3585);}return null;})[_0xa277('0x26')](function(_0x51e446){if(_0x51e446){_0x51e446['message']['interface']=util[_0xa277('0x7e')]('SIP/%s',_0x331a77[_0xa277('0x76')][_0xa277('0x3f')]);_0x51e446[_0xa277('0x2e')][_0xa277('0x90')]=_0x1e3585[_0xa277('0x90')];_0x51e446[_0xa277('0x2e')][_0xa277('0x91')]='reject';respondWithRpcPromise(_0xa277('0x92'),_0xa277('0x92'),{'event':_0xa277('0x97'),'message':_0x51e446[_0xa277('0x2e')]},client9002);return _0x1e3585;}return null;})['then'](respondWithResult(_0x2086ec,null))['catch'](handleError(_0x2086ec,null));};exports['download']=function(_0x1e1de0,_0x5552f5){var _0x4207af=moment()[_0xa277('0x98')]()[_0xa277('0x99')]();var _0x3d8d9d=path[_0xa277('0x9a')](config['root'],_0xa277('0x9b'),'files',_0xa277('0x9c'));var _0x49e0f4=path[_0xa277('0x9a')](config[_0xa277('0x79')],_0xa277('0x9b'),_0xa277('0x9d'),_0xa277('0x78'));var _0x2ad8e0=util[_0xa277('0x7e')](_0xa277('0x9e'),_0x4207af);return db[_0xa277('0x43')][_0xa277('0x5d')]({'where':{'id':_0x1e1de0[_0xa277('0x58')]['id']},'attributes':['id','body','from','to','cc','bcc','subject','createdAt'],'include':_0x1e1de0['query'][_0xa277('0x78')]?[{'model':db[_0xa277('0x9f')],'as':_0xa277('0xa0')}]:undefined})[_0xa277('0x26')](handleEntityNotFound(_0x5552f5,null))[_0xa277('0x26')](function(_0x537255){if(_0x537255){var _0x32ebbe=_0x537255;var _0x3cb379={'from':_0x32ebbe[_0xa277('0xa1')],'to':_0x32ebbe['to'],'subject':_0x32ebbe[_0xa277('0xa2')],'html':_0x32ebbe[_0xa277('0x5e')],'headers':{'Date':moment(_0x32ebbe['createdAt'])[_0xa277('0x7e')](_0xa277('0xa3'))},'attachments':[]};if(_0x537255['cc']){_0x3cb379[_0xa277('0xa4')]['Cc']=_0x537255['cc'];}if(_0x537255[_0xa277('0xa5')]){_0x3cb379['headers']['Bcc']=_0x537255['bcc'];}return new BPromise(function(_0x5de783,_0x1a44a4){if(_0x537255[_0xa277('0xa0')]){for(var _0x244e8c=0x0;_0x244e8c<_0x537255[_0xa277('0xa0')][_0xa277('0x5a')];_0x244e8c++){var _0x15b1a0=_0x537255[_0xa277('0xa0')][_0x244e8c];var _0x552b70=path[_0xa277('0x9a')](_0x49e0f4,_0x15b1a0[_0xa277('0xa6')]);if(fs[_0xa277('0xa7')](_0x552b70)){_0x3cb379[_0xa277('0x78')]['push']({'name':_0x15b1a0['name'],'contentType':_0x15b1a0[_0xa277('0x44')],'data':fs[_0xa277('0xa8')](_0x552b70)});}}}emlformat[_0xa277('0xa9')](_0x3cb379,function(_0x670ad5,_0x21733c){if(_0x670ad5)return _0x1a44a4(_0x670ad5);fs[_0xa277('0xaa')](path[_0xa277('0x9a')](_0x3d8d9d,_0x2ad8e0),_0x21733c);return _0x5de783(_0x21733c);});});}})['then'](function(_0xb34994){if(_0xb34994){return _0x5552f5['download'](path[_0xa277('0x9a')](_0x3d8d9d,_0x2ad8e0),_0x2ad8e0,function(_0x5579c2){if(_0x5579c2){console['log'](_0xa277('0xab'),_0x5579c2);}else{fs[_0xa277('0xac')](path[_0xa277('0x9a')](_0x3d8d9d,_0x2ad8e0));}});}})['catch'](handleError(_0x5552f5,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index bf21b04..7cf0510 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 _0xfbe5=['../../mysqldb','setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events'];(function(_0x44feca,_0x4d1e9d){var _0x13d12b=function(_0x49b12c){while(--_0x49b12c){_0x44feca['push'](_0x44feca['shift']());}};_0x13d12b(++_0x4d1e9d);}(_0xfbe5,0x13a));var _0x5fbe=function(_0x4a6e41,_0x22e551){_0x4a6e41=_0x4a6e41-0x0;var _0x54fa29=_0xfbe5[_0x4a6e41];return _0x54fa29;};'use strict';var EventEmitter=require(_0x5fbe('0x0'));var MailMessage=require(_0x5fbe('0x1'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x5fbe('0x2')](0x0);var events={'afterCreate':_0x5fbe('0x3'),'afterUpdate':_0x5fbe('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2a1867){return function(_0x5d7817,_0x453831,_0x23c245){MailMessageEvents['emit'](_0x2a1867+':'+_0x5d7817['id'],_0x5d7817);MailMessageEvents[_0x5fbe('0x5')](_0x2a1867,_0x5d7817);_0x23c245(null);};}for(var e in events){if(events[_0x5fbe('0x6')](e)){var event=events[e];MailMessage[_0x5fbe('0x7')](e,emitEvent(event));}}module[_0x5fbe('0x8')]=MailMessageEvents; \ No newline at end of file +var _0x3c10=['setMaxListeners','update','hasOwnProperty','exports','../../mysqldb','MailMessage'];(function(_0x3ff3ad,_0x405fb3){var _0x2ada24=function(_0xaf566b){while(--_0xaf566b){_0x3ff3ad['push'](_0x3ff3ad['shift']());}};_0x2ada24(++_0x405fb3);}(_0x3c10,0x1c0));var _0x03c1=function(_0x454627,_0xe22864){_0x454627=_0x454627-0x0;var _0x5154c1=_0x3c10[_0x454627];return _0x5154c1;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x03c1('0x0'))['db'][_0x03c1('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x03c1('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x03c1('0x3'),'afterDestroy':'remove'};function emitEvent(_0x49cb3e){return function(_0x4fb56a,_0x4cef05,_0x24bca4){MailMessageEvents['emit'](_0x49cb3e+':'+_0x4fb56a['id'],_0x4fb56a);MailMessageEvents['emit'](_0x49cb3e,_0x4fb56a);_0x24bca4(null);};}for(var e in events){if(events[_0x03c1('0x4')](e)){var event=events[e];MailMessage['hook'](e,emitEvent(event));}}module[_0x03c1('0x5')]=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index b5c8722..6b510da 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 _0x3fa3=['MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','get','direction','toLowerCase','out','secret','isNil','UserId','MailInteraction','findOne','then','createdAt','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','request-promise','html-to-text','path','rimraf','../../config/environment','define'];(function(_0x234a59,_0x25f6cb){var _0x1a1c33=function(_0x26d747){while(--_0x26d747){_0x234a59['push'](_0x234a59['shift']());}};_0x1a1c33(++_0x25f6cb);}(_0x3fa3,0xf5));var _0x33fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x3fa3[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x33fa('0x0'));var util=require(_0x33fa('0x1'));var logger=require(_0x33fa('0x2'))(_0x33fa('0x3'));var moment=require(_0x33fa('0x4'));var BPromise=require('bluebird');var rp=require(_0x33fa('0x5'));var htmlToText=require(_0x33fa('0x6'));var fs=require('fs');var path=require(_0x33fa('0x7'));var rimraf=require(_0x33fa('0x8'));var config=require(_0x33fa('0x9'));var attributes=require('./mailMessage.attributes');module['exports']=function(_0x55855e,_0x4d1b24){return _0x55855e[_0x33fa('0xa')](_0x33fa('0xb'),attributes,{'tableName':_0x33fa('0xc'),'paranoid':![],'indexes':[{'name':_0x33fa('0xd'),'fields':[_0x33fa('0xd')]},{'name':_0x33fa('0xe'),'fields':[_0x33fa('0xf'),_0x33fa('0x10')],'type':_0x33fa('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x10da0f,_0x3da6a0,_0x189755){if(_0x10da0f['body']){_0x10da0f['plainBody']=htmlToText[_0x33fa('0x12')](_0x10da0f[_0x33fa('0x13')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x189755(null,_0x3da6a0);},'afterCreate':function(_0x3ce672,_0x247971,_0x23d3e1){var _0x4da015=_0x55855e['models'];var _0x35a694=_0x3ce672[_0x33fa('0x14')]({'plain':!![]});if(_0x35a694[_0x33fa('0x15')]['toLowerCase']()==='in'||_0x35a694[_0x33fa('0x15')][_0x33fa('0x16')]()===_0x33fa('0x17')&&!_0x35a694[_0x33fa('0x18')]&&!_[_0x33fa('0x19')](_0x35a694[_0x33fa('0x1a')])){_0x4da015[_0x33fa('0x1b')][_0x33fa('0x1c')]({'where':{'id':_0x35a694['MailInteractionId']}})[_0x33fa('0x1d')](function(_0x7c223c){if(_0x7c223c){_0x7c223c['update']({'lastMsgAt':_0x35a694[_0x33fa('0x1e')],'lastMsgDirection':_0x35a694[_0x33fa('0x15')][_0x33fa('0x16')](),'lastMsgBody':_0x35a694[_0x33fa('0x13')]});}})['catch'](function(_0x1781f9){console['error'](_0x1781f9);});}_0x23d3e1();}},'charset':'utf8mb4','collate':_0x33fa('0x1f')});}; \ No newline at end of file +var _0x44fa=['direction','out','secret','isNil','UserId','MailInteraction','then','update','body','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','html-to-text','rimraf','../../config/environment','./mailMessage.attributes','exports','define','mail_messages','messageId','plainBody','subject','fromString','models','get','toLowerCase'];(function(_0x2cf554,_0x49cffb){var _0x56bd26=function(_0x576c85){while(--_0x576c85){_0x2cf554['push'](_0x2cf554['shift']());}};_0x56bd26(++_0x49cffb);}(_0x44fa,0x183));var _0xa44f=function(_0x443eac,_0x11e994){_0x443eac=_0x443eac-0x0;var _0x370f37=_0x44fa[_0x443eac];return _0x370f37;};'use strict';var _=require(_0xa44f('0x0'));var util=require(_0xa44f('0x1'));var logger=require(_0xa44f('0x2'))(_0xa44f('0x3'));var moment=require(_0xa44f('0x4'));var BPromise=require(_0xa44f('0x5'));var rp=require(_0xa44f('0x6'));var htmlToText=require(_0xa44f('0x7'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa44f('0x8'));var config=require(_0xa44f('0x9'));var attributes=require(_0xa44f('0xa'));module[_0xa44f('0xb')]=function(_0x3eb726,_0x26f4a7){return _0x3eb726[_0xa44f('0xc')]('MailMessage',attributes,{'tableName':_0xa44f('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xa44f('0xe')]},{'name':'fti_mail_messages','fields':[_0xa44f('0xf'),_0xa44f('0x10')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2b9fa6,_0x169c5e,_0x3d1562){if(_0x2b9fa6['body']){_0x2b9fa6[_0xa44f('0xf')]=htmlToText[_0xa44f('0x11')](_0x2b9fa6['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x3d1562(null,_0x169c5e);},'afterCreate':function(_0x4bacd7,_0x35890,_0xac2677){var _0x591846=_0x3eb726[_0xa44f('0x12')];var _0xa7102d=_0x4bacd7[_0xa44f('0x13')]({'plain':!![]});if(_0xa7102d['direction'][_0xa44f('0x14')]()==='in'||_0xa7102d[_0xa44f('0x15')]['toLowerCase']()===_0xa44f('0x16')&&!_0xa7102d[_0xa44f('0x17')]&&!_[_0xa44f('0x18')](_0xa7102d[_0xa44f('0x19')])){_0x591846[_0xa44f('0x1a')]['findOne']({'where':{'id':_0xa7102d['MailInteractionId']}})[_0xa44f('0x1b')](function(_0x572273){if(_0x572273){_0x572273[_0xa44f('0x1c')]({'lastMsgAt':_0xa7102d['createdAt'],'lastMsgDirection':_0xa7102d[_0xa44f('0x15')]['toLowerCase'](),'lastMsgBody':_0xa7102d[_0xa44f('0x1d')]});}})[_0xa44f('0x1e')](function(_0x4f850f){console[_0xa44f('0x1f')](_0x4f850f);});}_0xac2677();}},'charset':_0xa44f('0x20'),'collate':_0xa44f('0x21')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index bb6f8e9..993e48e 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 _0xcf71=['then','info','MailMessage,\x20%s,\x20%s','debug','request\x20sent','error','message','result','MailMessage','create','body','options','raw','CreateMailMessage','stringify','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./mailMessage.socket','register','request'];(function(_0x621f76,_0x16f7e0){var _0x6ffc25=function(_0x1a4986){while(--_0x1a4986){_0x621f76['push'](_0x621f76['shift']());}};_0x6ffc25(++_0x16f7e0);}(_0xcf71,0xba));var _0x1cf7=function(_0x3c5e8b,_0x17513d){_0x3c5e8b=_0x3c5e8b-0x0;var _0x1784b6=_0xcf71[_0x3c5e8b];return _0x1784b6;};'use strict';var _=require(_0x1cf7('0x0'));var util=require(_0x1cf7('0x1'));var moment=require(_0x1cf7('0x2'));var BPromise=require(_0x1cf7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1cf7('0x4'));var db=require(_0x1cf7('0x5'))['db'];var utils=require(_0x1cf7('0x6'));var logger=require(_0x1cf7('0x7'))(_0x1cf7('0x8'));var config=require(_0x1cf7('0x9'));var jayson=require(_0x1cf7('0xa'));var client=jayson[_0x1cf7('0xb')][_0x1cf7('0xc')]({'port':0x232a});config[_0x1cf7('0xd')]=_[_0x1cf7('0xe')](config[_0x1cf7('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1cf7('0xd')]));require(_0x1cf7('0xf'))[_0x1cf7('0x10')](socket);function respondWithRpcPromise(_0x540557,_0x318b81,_0x57eab0){return new BPromise(function(_0x4ce324,_0x145583){return client[_0x1cf7('0x11')](_0x540557,_0x57eab0)[_0x1cf7('0x12')](function(_0x1ca840){logger[_0x1cf7('0x13')](_0x1cf7('0x14'),_0x318b81,'request\x20sent');logger[_0x1cf7('0x15')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x318b81,_0x1cf7('0x16'),JSON['stringify'](_0x1ca840));if(_0x1ca840[_0x1cf7('0x17')]){if(_0x1ca840[_0x1cf7('0x17')]['code']===0x1f4){logger[_0x1cf7('0x17')](_0x1cf7('0x14'),_0x318b81,_0x1ca840[_0x1cf7('0x17')][_0x1cf7('0x18')]);return _0x145583(_0x1ca840[_0x1cf7('0x17')][_0x1cf7('0x18')]);}logger[_0x1cf7('0x17')](_0x1cf7('0x14'),_0x318b81,_0x1ca840[_0x1cf7('0x17')][_0x1cf7('0x18')]);return _0x4ce324(_0x1ca840[_0x1cf7('0x17')][_0x1cf7('0x18')]);}else{logger[_0x1cf7('0x13')]('MailMessage,\x20%s,\x20%s',_0x318b81,_0x1cf7('0x16'));_0x4ce324(_0x1ca840[_0x1cf7('0x19')][_0x1cf7('0x18')]);}})['catch'](function(_0x447a75){logger[_0x1cf7('0x17')](_0x1cf7('0x14'),_0x318b81,_0x447a75);_0x145583(_0x447a75);});});}exports['CreateMailMessage']=function(_0x4cebf9){var _0x2cf1ca=this;return new Promise(function(_0xa1cad3,_0x37fc26){return db[_0x1cf7('0x1a')][_0x1cf7('0x1b')](_0x4cebf9[_0x1cf7('0x1c')],{'raw':_0x4cebf9[_0x1cf7('0x1d')]?_0x4cebf9[_0x1cf7('0x1d')][_0x1cf7('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x345997){logger[_0x1cf7('0x13')](_0x1cf7('0x1f'),_0x4cebf9);logger[_0x1cf7('0x15')](_0x1cf7('0x1f'),_0x4cebf9,JSON[_0x1cf7('0x20')](_0x345997));_0xa1cad3(_0x345997);})[_0x1cf7('0x21')](function(_0x112ea2){logger['error']('CreateMailMessage',_0x112ea2['message'],_0x4cebf9);_0x37fc26(_0x2cf1ca[_0x1cf7('0x17')](0x1f4,_0x112ea2['message']));});});}; \ No newline at end of file +var _0xb470=['request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','CreateMailMessage','MailMessage','create','body','options','raw','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','register'];(function(_0x557bb0,_0x39b622){var _0x4aa50a=function(_0x3e1753){while(--_0x3e1753){_0x557bb0['push'](_0x557bb0['shift']());}};_0x4aa50a(++_0x39b622);}(_0xb470,0x75));var _0x0b47=function(_0x304f23,_0x59ee94){_0x304f23=_0x304f23-0x0;var _0x10e144=_0xb470[_0x304f23];return _0x10e144;};'use strict';var _=require(_0x0b47('0x0'));var util=require(_0x0b47('0x1'));var moment=require(_0x0b47('0x2'));var BPromise=require(_0x0b47('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b47('0x4'));var db=require(_0x0b47('0x5'))['db'];var utils=require(_0x0b47('0x6'));var logger=require('../../config/logger')(_0x0b47('0x7'));var config=require(_0x0b47('0x8'));var jayson=require(_0x0b47('0x9'));var client=jayson[_0x0b47('0xa')][_0x0b47('0xb')]({'port':0x232a});config[_0x0b47('0xc')]=_[_0x0b47('0xd')](config[_0x0b47('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./mailMessage.socket')[_0x0b47('0xe')](socket);function respondWithRpcPromise(_0x2b9cd0,_0x4e5ac5,_0x127232){return new BPromise(function(_0x19b87e,_0x243f01){return client[_0x0b47('0xf')](_0x2b9cd0,_0x127232)[_0x0b47('0x10')](function(_0x26036){logger[_0x0b47('0x11')](_0x0b47('0x12'),_0x4e5ac5,_0x0b47('0x13'));logger[_0x0b47('0x14')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x4e5ac5,'request\x20sent',JSON[_0x0b47('0x15')](_0x26036));if(_0x26036['error']){if(_0x26036[_0x0b47('0x16')][_0x0b47('0x17')]===0x1f4){logger['error'](_0x0b47('0x12'),_0x4e5ac5,_0x26036[_0x0b47('0x16')][_0x0b47('0x18')]);return _0x243f01(_0x26036[_0x0b47('0x16')][_0x0b47('0x18')]);}logger[_0x0b47('0x16')](_0x0b47('0x12'),_0x4e5ac5,_0x26036[_0x0b47('0x16')][_0x0b47('0x18')]);return _0x19b87e(_0x26036[_0x0b47('0x16')]['message']);}else{logger[_0x0b47('0x11')]('MailMessage,\x20%s,\x20%s',_0x4e5ac5,_0x0b47('0x13'));_0x19b87e(_0x26036[_0x0b47('0x19')][_0x0b47('0x18')]);}})['catch'](function(_0x5cf426){logger['error']('MailMessage,\x20%s,\x20%s',_0x4e5ac5,_0x5cf426);_0x243f01(_0x5cf426);});});}exports[_0x0b47('0x1a')]=function(_0x395591){var _0x52071c=this;return new Promise(function(_0x3f1c9c,_0x501357){return db[_0x0b47('0x1b')][_0x0b47('0x1c')](_0x395591[_0x0b47('0x1d')],{'raw':_0x395591[_0x0b47('0x1e')]?_0x395591[_0x0b47('0x1e')][_0x0b47('0x1f')]===undefined?!![]:![]:!![]})[_0x0b47('0x10')](function(_0x2dfdb4){logger[_0x0b47('0x11')](_0x0b47('0x1a'),_0x395591);logger[_0x0b47('0x14')]('CreateMailMessage',_0x395591,JSON[_0x0b47('0x15')](_0x2dfdb4));_0x3f1c9c(_0x2dfdb4);})[_0x0b47('0x20')](function(_0x4e481c){logger[_0x0b47('0x16')](_0x0b47('0x1a'),_0x4e481c[_0x0b47('0x18')],_0x395591);_0x501357(_0x52071c[_0x0b47('0x16')](0x1f4,_0x4e481c['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f36468d..612adc8 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 _0xd331=['register','length','./mailMessage.events','update','emit'];(function(_0x2cfd17,_0x47c8c6){var _0x59e14a=function(_0x416fec){while(--_0x416fec){_0x2cfd17['push'](_0x2cfd17['shift']());}};_0x59e14a(++_0x47c8c6);}(_0xd331,0xed));var _0x1d33=function(_0x3e28f9,_0x58b686){_0x3e28f9=_0x3e28f9-0x0;var _0x2a8b07=_0xd331[_0x3e28f9];return _0x2a8b07;};'use strict';var MailMessageEvents=require(_0x1d33('0x0'));var events=['save','remove',_0x1d33('0x1')];function createListener(_0x41f03e,_0x572bdd){return function(_0x254762){_0x572bdd[_0x1d33('0x2')](_0x41f03e,_0x254762);};}function removeListener(_0x2196bc,_0x2bd99f){return function(){MailMessageEvents['removeListener'](_0x2196bc,_0x2bd99f);};}exports[_0x1d33('0x3')]=function(_0x24c32b){for(var _0x4cf782=0x0,_0x506c58=events[_0x1d33('0x4')];_0x4cf782<_0x506c58;_0x4cf782++){var _0x35cb3d=events[_0x4cf782];var _0x46c81e=createListener('mailMessage:'+_0x35cb3d,_0x24c32b);MailMessageEvents['on'](_0x35cb3d,_0x46c81e);}}; \ No newline at end of file +var _0xf350=['./mailMessage.events','update','emit'];(function(_0x28fbd8,_0x308e0c){var _0x59efaa=function(_0x13f8d9){while(--_0x13f8d9){_0x28fbd8['push'](_0x28fbd8['shift']());}};_0x59efaa(++_0x308e0c);}(_0xf350,0x105));var _0x0f35=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xf350[_0x57b54c];return _0x59cc19;};'use strict';var MailMessageEvents=require(_0x0f35('0x0'));var events=['save','remove',_0x0f35('0x1')];function createListener(_0x1c3ffe,_0xd06af5){return function(_0x363a5f){_0xd06af5[_0x0f35('0x2')](_0x1c3ffe,_0x363a5f);};}function removeListener(_0x42652f,_0x25060b){return function(){MailMessageEvents['removeListener'](_0x42652f,_0x25060b);};}exports['register']=function(_0x557c1d){for(var _0x348399=0x0,_0x2c61c4=events['length'];_0x348399<_0x2c61c4;_0x348399++){var _0x544342=events[_0x348399];var _0x2c716b=createListener('mailMessage:'+_0x544342,_0x557c1d);MailMessageEvents['on'](_0x544342,_0x2c716b);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 674dfee..04494f4 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 _0x8176=['/describe','/:id','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','/:id/teams','addTeams','put','delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index'];(function(_0x516606,_0x4e3b47){var _0x3d7b4d=function(_0x19b2b8){while(--_0x19b2b8){_0x516606['push'](_0x516606['shift']());}};_0x3d7b4d(++_0x4e3b47);}(_0x8176,0x1c9));var _0x6817=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x8176[_0x433a86];return _0x23000c;};'use strict';var multer=require(_0x6817('0x0'));var util=require(_0x6817('0x1'));var path=require(_0x6817('0x2'));var timeout=require(_0x6817('0x3'));var express=require(_0x6817('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6817('0x5'));var config=require(_0x6817('0x6'));var controller=require(_0x6817('0x7'));router[_0x6817('0x8')]('/',auth[_0x6817('0x9')](),controller[_0x6817('0xa')]);router[_0x6817('0x8')](_0x6817('0xb'),auth[_0x6817('0x9')](),controller['describe']);router[_0x6817('0x8')](_0x6817('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x6817('0x8')](_0x6817('0xd'),auth['isAuthenticated'](),controller[_0x6817('0xe')]);router['get']('/:id/teams',auth['isAuthenticated'](),controller[_0x6817('0xf')]);router[_0x6817('0x8')](_0x6817('0x10'),auth[_0x6817('0x9')](),controller[_0x6817('0x11')]);router[_0x6817('0x12')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x6817('0x13'),auth[_0x6817('0x9')](),controller[_0x6817('0x14')]);router[_0x6817('0x12')](_0x6817('0x10'),auth[_0x6817('0x9')](),controller['addAgents']);router[_0x6817('0x15')]('/:id',auth[_0x6817('0x9')](),controller['update']);router[_0x6817('0x16')](_0x6817('0xc'),auth[_0x6817('0x9')](),controller[_0x6817('0x17')]);router[_0x6817('0x16')]('/:id/teams',auth['isAuthenticated'](),controller['removeTeams']);router[_0x6817('0x16')]('/:id/users',auth[_0x6817('0x9')](),controller[_0x6817('0x18')]);module[_0x6817('0x19')]=router; \ No newline at end of file +var _0xe7e7=['addTeams','/:id','update','delete','removeTeams','removeAgents','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','show','/:id/members','getMembers','/:id/teams','getAgents','post'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe7e7,0x150));var _0x7e7e=function(_0x21ab65,_0x45f753){_0x21ab65=_0x21ab65-0x0;var _0x48f8f0=_0xe7e7[_0x21ab65];return _0x48f8f0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x7e7e('0x0'));var timeout=require('connect-timeout');var express=require(_0x7e7e('0x1'));var router=express[_0x7e7e('0x2')]();var auth=require(_0x7e7e('0x3'));var interaction=require(_0x7e7e('0x4'));var config=require(_0x7e7e('0x5'));var controller=require(_0x7e7e('0x6'));router[_0x7e7e('0x7')]('/',auth[_0x7e7e('0x8')](),controller[_0x7e7e('0x9')]);router['get']('/describe',auth[_0x7e7e('0x8')](),controller['describe']);router['get']('/:id',auth[_0x7e7e('0x8')](),controller[_0x7e7e('0xa')]);router[_0x7e7e('0x7')](_0x7e7e('0xb'),auth[_0x7e7e('0x8')](),controller[_0x7e7e('0xc')]);router[_0x7e7e('0x7')](_0x7e7e('0xd'),auth['isAuthenticated'](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7e7e('0xe')]);router[_0x7e7e('0xf')]('/',auth[_0x7e7e('0x8')](),controller['create']);router['post']('/:id/teams',auth['isAuthenticated'](),controller[_0x7e7e('0x10')]);router[_0x7e7e('0xf')]('/:id/users',auth[_0x7e7e('0x8')](),controller['addAgents']);router['put'](_0x7e7e('0x11'),auth[_0x7e7e('0x8')](),controller[_0x7e7e('0x12')]);router['delete'](_0x7e7e('0x11'),auth[_0x7e7e('0x8')](),controller['destroy']);router[_0x7e7e('0x13')]('/:id/teams',auth[_0x7e7e('0x8')](),controller[_0x7e7e('0x14')]);router[_0x7e7e('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x7e7e('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 45e4332..6a03ebb 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 _0xda83=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x16caf1,_0x5abf5e){var _0x4d77b7=function(_0x5cc01e){while(--_0x5cc01e){_0x16caf1['push'](_0x16caf1['shift']());}};_0x4d77b7(++_0x5abf5e);}(_0xda83,0x18f));var _0x3da8=function(_0x56cf58,_0x560ede){_0x56cf58=_0x56cf58-0x0;var _0x37ebcc=_0xda83[_0x56cf58];return _0x37ebcc;};'use strict';var Sequelize=require(_0x3da8('0x0'));module[_0x3da8('0x1')]={'name':{'type':Sequelize[_0x3da8('0x2')],'unique':_0x3da8('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x3da8('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3da8('0x5')](_0x3da8('0x6'),_0x3da8('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x8597=['roundrobin','sequelize','STRING','name','INTEGER','rrmemory','beepall'];(function(_0x1917ee,_0x4b5d1b){var _0xab4d6=function(_0x1f51de){while(--_0x1f51de){_0x1917ee['push'](_0x1917ee['shift']());}};_0xab4d6(++_0x4b5d1b);}(_0x8597,0xe1));var _0x7859=function(_0x3ae2b2,_0x2d936f){_0x3ae2b2=_0x3ae2b2-0x0;var _0x1dbf00=_0x8597[_0x3ae2b2];return _0x1dbf00;};'use strict';var Sequelize=require(_0x7859('0x0'));module['exports']={'name':{'type':Sequelize[_0x7859('0x1')],'unique':_0x7859('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7859('0x1')]},'timeout':{'type':Sequelize[_0x7859('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x7859('0x4'),_0x7859('0x5'),_0x7859('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index d605351..1850ee4 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 _0x5e57=['format','%s/%s','mailPause','getTeams','findOne','Team','sort','addTeams','ids','User','Agents','online','voicePause','transaction','findOrCreate','forEach','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','toString','QueryTypes','SELECT','TeamId','includes','union','compact','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','json','count','offset','limit','set','Content-Range','reject','then','destroy','MailQueues','UserProfileResource','end','sendStatus','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','intersection','query','attributes','model','fields','hasOwnProperty','nolimit','order','filters','pick','filter','where','options','includeAll','findAll','rows','catch','show','params','keys','length','include','merge','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','getMembers','UserMailQueue','MailQueueId','findAndCountAll','agent','updatedAt','createdAt'];(function(_0x57e7b1,_0x3e4901){var _0x1d4012=function(_0x1d0df2){while(--_0x1d0df2){_0x57e7b1['push'](_0x57e7b1['shift']());}};_0x1d4012(++_0x3e4901);}(_0x5e57,0x144));var _0x75e5=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x5e57[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x75e5('0x0'));var emlformat=require(_0x75e5('0x1'));var rimraf=require(_0x75e5('0x2'));var zipdir=require(_0x75e5('0x3'));var jsonpatch=require(_0x75e5('0x4'));var rp=require(_0x75e5('0x5'));var moment=require(_0x75e5('0x6'));var BPromise=require(_0x75e5('0x7'));var Mustache=require(_0x75e5('0x8'));var util=require(_0x75e5('0x9'));var path=require(_0x75e5('0xa'));var sox=require(_0x75e5('0xb'));var csv=require(_0x75e5('0xc'));var ejs=require(_0x75e5('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x75e5('0xe'));var crypto=require('crypto');var jsforce=require(_0x75e5('0xf'));var deskjs=require(_0x75e5('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x75e5('0x11'));var Redis=require(_0x75e5('0x12'));var authService=require(_0x75e5('0x13'));var qs=require(_0x75e5('0x14'));var as=require(_0x75e5('0x15'));var hardwareService=require(_0x75e5('0x16'));var logger=require('../../config/logger')(_0x75e5('0x17'));var utils=require('../../config/utils');var config=require(_0x75e5('0x18'));var db=require(_0x75e5('0x19'))['db'];config[_0x75e5('0x1a')]=_['defaults'](config[_0x75e5('0x1a')],{'host':_0x75e5('0x1b'),'port':0x18eb});var socket=require(_0x75e5('0x1c'))(new Redis(config[_0x75e5('0x1a')]));require(_0x75e5('0x1d'))[_0x75e5('0x1e')](socket);function respondWithStatusCode(_0xd24dfa,_0x34ab05){_0x34ab05=_0x34ab05||0xcc;return function(_0x2619c6){if(_0x2619c6){return _0xd24dfa['sendStatus'](_0x34ab05);}return _0xd24dfa[_0x75e5('0x1f')](_0x34ab05)['end']();};}function respondWithResult(_0x433002,_0x1d8a80){_0x1d8a80=_0x1d8a80||0xc8;return function(_0x507f06){if(_0x507f06){return _0x433002['status'](_0x1d8a80)[_0x75e5('0x20')](_0x507f06);}};}function respondWithFilteredResult(_0x5646f4,_0x27d8bc){return function(_0x10fbe2){if(_0x10fbe2){var _0x2187cf=_0x10fbe2[_0x75e5('0x21')],_0x5bc5c9=_0x27d8bc['offset'],_0x56b93f=_0x27d8bc[_0x75e5('0x22')]+_0x27d8bc[_0x75e5('0x23')],_0x52e1e4;if(_0x56b93f>=_0x2187cf){_0x56b93f=_0x2187cf;_0x52e1e4=0xc8;}else{_0x52e1e4=0xce;}_0x5646f4[_0x75e5('0x1f')](_0x52e1e4);return _0x5646f4[_0x75e5('0x24')](_0x75e5('0x25'),_0x5bc5c9+'-'+_0x56b93f+'/'+_0x2187cf)[_0x75e5('0x20')](_0x10fbe2);}return null;};}function patchUpdates(_0x11176c){return function(_0x5da872){try{jsonpatch['apply'](_0x5da872,_0x11176c,!![]);}catch(_0x48c2cf){return BPromise[_0x75e5('0x26')](_0x48c2cf);}return _0x5da872['save']();};}function saveUpdates(_0x3c6bef,_0x359f3d){return function(_0x4e4736){if(_0x4e4736){return _0x4e4736['update'](_0x3c6bef)[_0x75e5('0x27')](function(_0x1640ad){return _0x1640ad;});}return null;};}function removeEntity(_0x3f27c8,_0x49e8f2){return function(_0x2d5155){if(_0x2d5155){return _0x2d5155[_0x75e5('0x28')]()[_0x75e5('0x27')](function(){var _0x324d0f=_0x2d5155['get']({'plain':!![]});var _0x45ed9e=_0x75e5('0x29');return db[_0x75e5('0x2a')][_0x75e5('0x28')]({'where':{'type':_0x45ed9e,'resourceId':_0x324d0f['id']}})[_0x75e5('0x27')](function(){return _0x2d5155;});})[_0x75e5('0x27')](function(){_0x3f27c8[_0x75e5('0x1f')](0xcc)[_0x75e5('0x2b')]();});}};}function handleEntityNotFound(_0x143031,_0x24872e){return function(_0x1ead2){if(!_0x1ead2){_0x143031[_0x75e5('0x2c')](0x194);}return _0x1ead2;};}function handleError(_0x3c0b6f,_0xb6cd3c){_0xb6cd3c=_0xb6cd3c||0x1f4;return function(_0x646860){logger['error'](_0x646860[_0x75e5('0x2d')]);if(_0x646860['name']){delete _0x646860[_0x75e5('0x2e')];}_0x3c0b6f[_0x75e5('0x1f')](_0xb6cd3c)[_0x75e5('0x2f')](_0x646860);};}exports[_0x75e5('0x30')]=function(_0xa49981,_0x5bb7d7){var _0x1df931={},_0x2beb4a={},_0x5a07b7={'count':0x0,'rows':[]};var _0x1e9fb6=_[_0x75e5('0x31')](db[_0x75e5('0x32')][_0x75e5('0x33')],function(_0x1c0eed){return{'name':_0x1c0eed[_0x75e5('0x34')],'type':_0x1c0eed[_0x75e5('0x35')]['key']};});_0x2beb4a['model']=_[_0x75e5('0x31')](_0x1e9fb6,_0x75e5('0x2e'));_0x2beb4a['query']=_['keys'](_0xa49981['query']);_0x2beb4a['filters']=_[_0x75e5('0x36')](_0x2beb4a['model'],_0x2beb4a[_0x75e5('0x37')]);_0x1df931[_0x75e5('0x38')]=_[_0x75e5('0x36')](_0x2beb4a[_0x75e5('0x39')],qs[_0x75e5('0x3a')](_0xa49981[_0x75e5('0x37')][_0x75e5('0x3a')]));_0x1df931[_0x75e5('0x38')]=_0x1df931[_0x75e5('0x38')]['length']?_0x1df931[_0x75e5('0x38')]:_0x2beb4a[_0x75e5('0x39')];if(!_0xa49981[_0x75e5('0x37')][_0x75e5('0x3b')](_0x75e5('0x3c'))){_0x1df931[_0x75e5('0x23')]=qs['limit'](_0xa49981[_0x75e5('0x37')][_0x75e5('0x23')]);_0x1df931[_0x75e5('0x22')]=qs['offset'](_0xa49981[_0x75e5('0x37')][_0x75e5('0x22')]);}_0x1df931[_0x75e5('0x3d')]=qs['sort'](_0xa49981[_0x75e5('0x37')]['sort']);_0x1df931['where']=qs[_0x75e5('0x3e')](_[_0x75e5('0x3f')](_0xa49981[_0x75e5('0x37')],_0x2beb4a['filters']));if(_0xa49981[_0x75e5('0x37')][_0x75e5('0x40')]){_0x1df931['where']=_['merge'](_0x1df931[_0x75e5('0x41')],{'$or':_[_0x75e5('0x31')](_0x1e9fb6,function(_0x36f5cb){if(_0x36f5cb['type']!=='VIRTUAL'){var _0x62dc2d={};_0x62dc2d[_0x36f5cb['name']]={'$like':'%'+_0xa49981[_0x75e5('0x37')]['filter']+'%'};return _0x62dc2d;}})});}_0x1df931=_['merge']({},_0x1df931,_0xa49981[_0x75e5('0x42')]);var _0x530e01={'where':_0x1df931[_0x75e5('0x41')]};return db[_0x75e5('0x32')][_0x75e5('0x21')](_0x530e01)['then'](function(_0x4ee0c5){_0x5a07b7[_0x75e5('0x21')]=_0x4ee0c5;if(_0xa49981[_0x75e5('0x37')][_0x75e5('0x43')]){_0x1df931['include']=[{'all':!![]}];}return db[_0x75e5('0x32')][_0x75e5('0x44')](_0x1df931);})[_0x75e5('0x27')](function(_0x10867d){_0x5a07b7[_0x75e5('0x45')]=_0x10867d;return _0x5a07b7;})[_0x75e5('0x27')](respondWithFilteredResult(_0x5bb7d7,_0x1df931))[_0x75e5('0x46')](handleError(_0x5bb7d7,null));};exports[_0x75e5('0x47')]=function(_0x27c1de,_0x155449){var _0x2fc12b={'raw':!![],'where':{'id':_0x27c1de[_0x75e5('0x48')]['id']}},_0x2cd725={};_0x2cd725[_0x75e5('0x39')]=_[_0x75e5('0x49')](db[_0x75e5('0x32')]['rawAttributes']);_0x2cd725[_0x75e5('0x37')]=_[_0x75e5('0x49')](_0x27c1de[_0x75e5('0x37')]);_0x2cd725['filters']=_[_0x75e5('0x36')](_0x2cd725[_0x75e5('0x39')],_0x2cd725[_0x75e5('0x37')]);_0x2fc12b['attributes']=_[_0x75e5('0x36')](_0x2cd725[_0x75e5('0x39')],qs['fields'](_0x27c1de[_0x75e5('0x37')][_0x75e5('0x3a')]));_0x2fc12b['attributes']=_0x2fc12b[_0x75e5('0x38')][_0x75e5('0x4a')]?_0x2fc12b[_0x75e5('0x38')]:_0x2cd725[_0x75e5('0x39')];if(_0x27c1de[_0x75e5('0x37')][_0x75e5('0x43')]){_0x2fc12b[_0x75e5('0x4b')]=[{'all':!![]}];}_0x2fc12b=_[_0x75e5('0x4c')]({},_0x2fc12b,_0x27c1de[_0x75e5('0x42')]);return db[_0x75e5('0x32')][_0x75e5('0x4d')](_0x2fc12b)[_0x75e5('0x27')](handleEntityNotFound(_0x155449,null))[_0x75e5('0x27')](respondWithResult(_0x155449,null))[_0x75e5('0x46')](handleError(_0x155449,null));};exports['create']=function(_0x365905,_0x52f14b){return db[_0x75e5('0x32')][_0x75e5('0x4e')](_0x365905[_0x75e5('0x4f')],{})[_0x75e5('0x27')](function(_0x217b5b){var _0xdf6881=_0x365905[_0x75e5('0x50')][_0x75e5('0x51')]({'plain':!![]});if(!_0xdf6881)throw new Error(_0x75e5('0x52'));if(_0xdf6881['role']===_0x75e5('0x50')){var _0x418583=_0x217b5b['get']({'plain':!![]});var _0x332e53=_0x75e5('0x29');return db['UserProfileSection']['find']({'where':{'name':_0x332e53,'userProfileId':_0xdf6881[_0x75e5('0x53')]},'raw':!![]})[_0x75e5('0x27')](function(_0x3965ae){if(_0x3965ae&&_0x3965ae[_0x75e5('0x54')]===0x0){return db[_0x75e5('0x2a')][_0x75e5('0x4e')]({'name':_0x418583[_0x75e5('0x2e')],'resourceId':_0x418583['id'],'type':_0x3965ae[_0x75e5('0x2e')],'sectionId':_0x3965ae['id']},{})[_0x75e5('0x27')](function(){return _0x217b5b;});}else{return _0x217b5b;}})['catch'](function(_0x3f70c3){logger[_0x75e5('0x55')](_0x75e5('0x56'),_0x3f70c3);throw _0x3f70c3;});}return _0x217b5b;})['then'](respondWithResult(_0x52f14b,0xc9))[_0x75e5('0x46')](handleError(_0x52f14b,null));};exports[_0x75e5('0x57')]=function(_0xdb7293,_0x379bf8){if(_0xdb7293[_0x75e5('0x4f')]['id']){delete _0xdb7293['body']['id'];}return db[_0x75e5('0x32')][_0x75e5('0x4d')]({'where':{'id':_0xdb7293[_0x75e5('0x48')]['id']}})['then'](handleEntityNotFound(_0x379bf8,null))['then'](saveUpdates(_0xdb7293[_0x75e5('0x4f')],null))['then'](respondWithResult(_0x379bf8,null))['catch'](handleError(_0x379bf8,null));};exports['destroy']=function(_0x40a5ad,_0x1658b0){return db[_0x75e5('0x32')][_0x75e5('0x4d')]({'where':{'id':_0x40a5ad[_0x75e5('0x48')]['id']}})[_0x75e5('0x27')](handleEntityNotFound(_0x1658b0,null))['then'](removeEntity(_0x1658b0,null))[_0x75e5('0x46')](handleError(_0x1658b0,null));};exports['describe']=function(_0x26f11e,_0x1174f8){return db['MailQueue'][_0x75e5('0x58')]()[_0x75e5('0x27')](respondWithResult(_0x1174f8,null))['catch'](handleError(_0x1174f8,null));};exports[_0x75e5('0x59')]=function(_0x1c412f,_0x2d42bf,_0x594525){var _0x5ea7ac={'raw':!![],'where':{}},_0x4ccf5c={},_0x4b4ff7;return db[_0x75e5('0x32')]['findOne']({'where':{'id':_0x1c412f[_0x75e5('0x48')]['id']}})[_0x75e5('0x27')](handleEntityNotFound(_0x2d42bf,null))[_0x75e5('0x27')](function(_0x44624c){if(_0x44624c){_0x4b4ff7=_0x44624c['get']({'plain':!![]});_0x4ccf5c[_0x75e5('0x39')]=_['keys'](db[_0x75e5('0x5a')][_0x75e5('0x33')]);_0x4ccf5c['query']=_[_0x75e5('0x49')](_0x1c412f[_0x75e5('0x37')]);_0x4ccf5c[_0x75e5('0x3e')]=_[_0x75e5('0x36')](_0x4ccf5c[_0x75e5('0x39')],_0x4ccf5c[_0x75e5('0x37')]);_0x5ea7ac['attributes']=_[_0x75e5('0x36')](_0x4ccf5c['model'],qs['fields'](_0x1c412f[_0x75e5('0x37')][_0x75e5('0x3a')]));_0x5ea7ac[_0x75e5('0x38')]=_0x5ea7ac[_0x75e5('0x38')][_0x75e5('0x4a')]?_0x5ea7ac[_0x75e5('0x38')]:_0x4ccf5c[_0x75e5('0x39')];if(!_0x1c412f[_0x75e5('0x37')]['hasOwnProperty']('nolimit')){_0x5ea7ac[_0x75e5('0x23')]=qs[_0x75e5('0x23')](_0x1c412f['query'][_0x75e5('0x23')]);_0x5ea7ac[_0x75e5('0x22')]=qs['offset'](_0x1c412f['query']['offset']);}_0x5ea7ac['order']=qs['sort'](_0x1c412f[_0x75e5('0x37')]['sort']);_0x5ea7ac[_0x75e5('0x41')]=qs[_0x75e5('0x3e')](_[_0x75e5('0x3f')](_0x1c412f[_0x75e5('0x37')],_0x4ccf5c['filters']));_0x5ea7ac['where'][_0x75e5('0x5b')]=_0x44624c['id'];if(_0x1c412f['query'][_0x75e5('0x40')]){_0x5ea7ac[_0x75e5('0x41')]=_['merge'](_0x5ea7ac[_0x75e5('0x41')],{'$or':_[_0x75e5('0x31')](_0x5ea7ac['attributes'],function(_0x14b7a4){var _0x4ecb81={};_0x4ecb81[_0x14b7a4]={'$like':'%'+_0x1c412f['query'][_0x75e5('0x40')]+'%'};return _0x4ecb81;})});}_0x5ea7ac=_['merge']({},_0x5ea7ac,_0x1c412f[_0x75e5('0x42')]);return db[_0x75e5('0x5a')][_0x75e5('0x44')](_0x5ea7ac);}})[_0x75e5('0x27')](function(_0x2f0498){if(_0x2f0498){return db['User'][_0x75e5('0x5c')]({'where':{'id':_[_0x75e5('0x31')](_0x2f0498,'UserId'),'role':_0x75e5('0x5d')},'attributes':['id',_0x75e5('0x2e'),'mailPause',_0x75e5('0x5e'),_0x75e5('0x5f')]});}})[_0x75e5('0x27')](function(_0x5222a9){if(_0x5222a9){return{'count':_0x5222a9[_0x75e5('0x21')],'rows':_['map'](_0x5222a9[_0x75e5('0x45')],function(_0xed6a6){return{'membername':_0xed6a6[_0x75e5('0x2e')],'UserId':_0xed6a6['id'],'queue_name':_0x4b4ff7[_0x75e5('0x2e')],'MailQueueId':_0x4b4ff7['id'],'interface':util[_0x75e5('0x60')](_0x75e5('0x61'),'SIP',_0xed6a6[_0x75e5('0x2e')]),'penalty':0x0,'paused':_0xed6a6[_0x75e5('0x62')],'createdAt':_0xed6a6[_0x75e5('0x5f')],'updatedAt':_0xed6a6['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})[_0x75e5('0x27')](respondWithFilteredResult(_0x2d42bf,_0x5ea7ac))[_0x75e5('0x46')](handleError(_0x2d42bf,null));};exports[_0x75e5('0x63')]=function(_0x472534,_0xf376da,_0x15766e){var _0xe5aca5={};var _0x5709f7={};var _0x3554fd;var _0x1c849b;return db[_0x75e5('0x32')][_0x75e5('0x64')]({'where':{'id':_0x472534[_0x75e5('0x48')]['id']}})[_0x75e5('0x27')](handleEntityNotFound(_0xf376da,null))[_0x75e5('0x27')](function(_0x1be10c){if(_0x1be10c){_0x3554fd=_0x1be10c;_0x5709f7[_0x75e5('0x39')]=_[_0x75e5('0x49')](db[_0x75e5('0x65')][_0x75e5('0x33')]);_0x5709f7[_0x75e5('0x37')]=_[_0x75e5('0x49')](_0x472534[_0x75e5('0x37')]);_0x5709f7['filters']=_[_0x75e5('0x36')](_0x5709f7[_0x75e5('0x39')],_0x5709f7[_0x75e5('0x37')]);_0xe5aca5[_0x75e5('0x38')]=_['intersection'](_0x5709f7[_0x75e5('0x39')],qs[_0x75e5('0x3a')](_0x472534[_0x75e5('0x37')][_0x75e5('0x3a')]));_0xe5aca5[_0x75e5('0x38')]=_0xe5aca5[_0x75e5('0x38')][_0x75e5('0x4a')]?_0xe5aca5[_0x75e5('0x38')]:_0x5709f7['model'];_0xe5aca5['order']=qs['sort'](_0x472534['query'][_0x75e5('0x66')]);_0xe5aca5[_0x75e5('0x41')]=qs[_0x75e5('0x3e')](_[_0x75e5('0x3f')](_0x472534[_0x75e5('0x37')],_0x5709f7[_0x75e5('0x3e')]));if(_0x472534['query'][_0x75e5('0x40')]){_0xe5aca5[_0x75e5('0x41')]=_['merge'](_0xe5aca5['where'],{'$or':_[_0x75e5('0x31')](_0xe5aca5['attributes'],function(_0x4f183c){var _0x111b6d={};_0x111b6d[_0x4f183c]={'$like':'%'+_0x472534['query'][_0x75e5('0x40')]+'%'};return _0x111b6d;})});}_0xe5aca5=_['merge']({},_0xe5aca5,_0x472534[_0x75e5('0x42')]);return _0x3554fd[_0x75e5('0x63')](_0xe5aca5);}})['then'](function(_0x2a8d1a){if(_0x2a8d1a){_0x1c849b=_0x2a8d1a['length'];if(!_0x472534[_0x75e5('0x37')][_0x75e5('0x3b')](_0x75e5('0x3c'))){_0xe5aca5['limit']=qs[_0x75e5('0x23')](_0x472534[_0x75e5('0x37')][_0x75e5('0x23')]);_0xe5aca5['offset']=qs['offset'](_0x472534[_0x75e5('0x37')][_0x75e5('0x22')]);}return _0x3554fd[_0x75e5('0x63')](_0xe5aca5);}})['then'](function(_0x4b0eac){if(_0x4b0eac){return _0x4b0eac?{'count':_0x1c849b,'rows':_0x4b0eac}:null;}})[_0x75e5('0x27')](respondWithResult(_0xf376da,null))[_0x75e5('0x46')](handleError(_0xf376da,null));};exports[_0x75e5('0x67')]=function(_0x4a5161,_0x463257,_0x1e3540){var _0x2daf58=_0x4a5161['body'][_0x75e5('0x68')];return db[_0x75e5('0x65')]['findAll']({'where':{'id':_0x2daf58},'attributes':['id'],'include':[{'model':db[_0x75e5('0x69')],'as':_0x75e5('0x6a'),'attributes':['id',_0x75e5('0x2e'),_0x75e5('0x6b'),_0x75e5('0x6c'),'interface'],'raw':!![]}]})[_0x75e5('0x27')](function(_0x501d41){if(_0x501d41){var _0x44c153=_['flatMap'](_0x501d41,function(_0x35de44){var _0x1f301b=_0x35de44[_0x75e5('0x51')]({'plain':!![]});return _0x1f301b[_0x75e5('0x6a')];});return db[_0x75e5('0x32')][_0x75e5('0x4d')]({'where':{'id':_0x4a5161[_0x75e5('0x48')]['id']}})[_0x75e5('0x27')](function(_0x26a36){return db['sequelize'][_0x75e5('0x6d')](function(_0x3ef5d4){return _0x26a36[_0x75e5('0x67')](_0x2daf58,{'transaction':_0x3ef5d4})['then'](function(){return BPromise['each'](_0x44c153,function(_0xe3456f){return db['UserMailQueue'][_0x75e5('0x6e')]({'where':{'UserId':_0xe3456f['id'],'MailQueueId':_0x4a5161[_0x75e5('0x48')]['id']},'transaction':_0x3ef5d4});});})['then'](function(){_0x44c153[_0x75e5('0x6f')](function(_0x363bff){socket[_0x75e5('0x70')](_0x75e5('0x71'),{'UserId':_0x363bff['id'],'MailQueueId':_0x26a36['id']});});});});});}})['then'](respondWithStatusCode(_0x463257,null))['catch'](handleError(_0x463257,null));};exports[_0x75e5('0x72')]=function(_0x3b26c9,_0x2008f0,_0x2574dd){return db[_0x75e5('0x65')][_0x75e5('0x44')]({'where':{'id':_0x3b26c9[_0x75e5('0x37')][_0x75e5('0x68')]},'attributes':['id'],'include':[{'model':db[_0x75e5('0x69')],'as':_0x75e5('0x6a'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2008f0,null))[_0x75e5('0x27')](function(_0xa5572a){var _0x18bec6=_['map'](_0xa5572a,'id');var _0x2d7397=[];var _0x312b08=[];var _0x1d6242=squel[_0x75e5('0x73')]();_0x1d6242[_0x75e5('0x74')](_0x75e5('0x75'))['from']('team_has_mail_queues','tq')[_0x75e5('0x76')](_0x75e5('0x77'),'ut',_0x75e5('0x78'))['where'](_0x75e5('0x79'),_0x3b26c9[_0x75e5('0x48')]['id']);for(var _0x535798=0x0;_0x535798<_0xa5572a[_0x75e5('0x4a')];_0x535798+=0x1){let _0xb4a5ce=_0xa5572a[_0x535798];for(var _0x27686f=0x0;_0x27686f<_0xb4a5ce[_0x75e5('0x6a')][_0x75e5('0x4a')];_0x27686f+=0x1){let _0x2d6355=_0xb4a5ce[_0x75e5('0x6a')][_0x27686f];var _0x1a0d38=_0x1d6242[_0x75e5('0x7a')]();_0x1a0d38[_0x75e5('0x41')](_0x75e5('0x7b'),_0x2d6355['id']);_0x312b08[_0x75e5('0x7c')](db[_0x75e5('0x7d')][_0x75e5('0x37')](_0x1a0d38[_0x75e5('0x7e')](),{'type':db['sequelize'][_0x75e5('0x7f')][_0x75e5('0x80')]})['then'](function(_0x540fb3){if(_0x540fb3[_0x75e5('0x4a')]===0x1){return _0x2d6355['id'];}else{var _0x24fa02=_['every'](_[_0x75e5('0x31')](_0x540fb3,_0x75e5('0x81')),function(_0x42a1c2){return _[_0x75e5('0x82')](_0x18bec6,_0x42a1c2);});if(_0x24fa02){return _0x2d6355['id'];}}}));}}return BPromise['all'](_0x312b08)[_0x75e5('0x27')](function(_0x416a0f){_0x2d7397=_(_0x2d7397)[_0x75e5('0x83')](_0x416a0f)[_0x75e5('0x84')]()['value']();return db['MailQueue'][_0x75e5('0x4d')]({'where':{'id':_0x3b26c9[_0x75e5('0x48')]['id']}})[_0x75e5('0x27')](function(_0x5b8162){return db[_0x75e5('0x7d')]['transaction'](function(_0xc0b5e8){return _0x5b8162['removeTeams'](_0x3b26c9['query']['ids'],{'transaction':_0xc0b5e8})[_0x75e5('0x27')](function(){if(!_[_0x75e5('0x85')](_0x2d7397)){return _0x5b8162[_0x75e5('0x86')](_0x2d7397,{'transaction':_0xc0b5e8});}})['then'](function(){_0x2d7397['forEach'](function(_0x3292e4){socket[_0x75e5('0x70')](_0x75e5('0x87'),{'UserId':_0x3292e4,'MailQueueId':_0x5b8162['id']});});});});});});})[_0x75e5('0x27')](respondWithStatusCode(_0x2008f0,null))['catch'](handleError(_0x2008f0,null));};exports[_0x75e5('0x88')]=function(_0x279ad3,_0x4a2215,_0x5d5f52){return db[_0x75e5('0x32')][_0x75e5('0x4d')]({'where':{'id':_0x279ad3[_0x75e5('0x48')]['id']}})[_0x75e5('0x27')](handleEntityNotFound(_0x4a2215,null))[_0x75e5('0x27')](function(_0x1bb329){if(_0x1bb329){return _0x1bb329['addAgents'](_0x279ad3[_0x75e5('0x4f')][_0x75e5('0x68')],_[_0x75e5('0x89')](_0x279ad3['body'],[_0x75e5('0x68'),'id'])||{})[_0x75e5('0x8a')](function(_0x4bb9bf){for(var _0x2835d3=0x0;_0x2835d3<_0x279ad3['body']['ids'][_0x75e5('0x4a')];_0x2835d3+=0x1){socket['emit'](_0x75e5('0x71'),{'UserId':_0x279ad3['body'][_0x75e5('0x68')][_0x2835d3],'MailQueueId':_0x279ad3[_0x75e5('0x48')]['id']});}return _0x4bb9bf;});}})['then'](respondWithResult(_0x4a2215,null))[_0x75e5('0x46')](handleError(_0x4a2215,null));};exports[_0x75e5('0x86')]=function(_0x4f4ff4,_0x1cbc31,_0x4272ce){return db[_0x75e5('0x32')][_0x75e5('0x4d')]({'where':{'id':_0x4f4ff4[_0x75e5('0x48')]['id']}})['then'](handleEntityNotFound(_0x1cbc31,null))[_0x75e5('0x27')](function(_0x36370a){if(_0x36370a){return _0x36370a[_0x75e5('0x86')](_0x4f4ff4[_0x75e5('0x37')][_0x75e5('0x68')])['then'](function(){if(_['isArray'](_0x4f4ff4[_0x75e5('0x37')]['ids'])){for(var _0x384dd0=0x0;_0x384dd0<_0x4f4ff4['query']['ids'][_0x75e5('0x4a')];_0x384dd0+=0x1){socket[_0x75e5('0x70')](_0x75e5('0x87'),{'UserId':Number(_0x4f4ff4['query'][_0x75e5('0x68')][_0x384dd0]),'MailQueueId':Number(_0x4f4ff4['params']['id'])});}}else{socket[_0x75e5('0x70')](_0x75e5('0x87'),{'UserId':Number(_0x4f4ff4[_0x75e5('0x37')][_0x75e5('0x68')]),'MailQueueId':Number(_0x4f4ff4[_0x75e5('0x48')]['id'])});}});}})[_0x75e5('0x27')](respondWithStatusCode(_0x1cbc31,null))['catch'](handleError(_0x1cbc31,null));};exports[_0x75e5('0x8b')]=function(_0x5eb936,_0x4b75e6,_0xadf289){var _0x4e9e48={};var _0x1de57e={};var _0x2ebc44;var _0x4ffaee;return db['MailQueue'][_0x75e5('0x64')]({'where':{'id':_0x5eb936['params']['id']}})[_0x75e5('0x27')](handleEntityNotFound(_0x4b75e6,null))[_0x75e5('0x27')](function(_0x4644c9){if(_0x4644c9){_0x2ebc44=_0x4644c9;_0x1de57e['model']=_[_0x75e5('0x49')](db['User'][_0x75e5('0x33')]);_0x1de57e[_0x75e5('0x37')]=_[_0x75e5('0x49')](_0x5eb936[_0x75e5('0x37')]);_0x1de57e['filters']=_[_0x75e5('0x36')](_0x1de57e[_0x75e5('0x39')],_0x1de57e['query']);_0x4e9e48[_0x75e5('0x38')]=_['intersection'](_0x1de57e[_0x75e5('0x39')],qs['fields'](_0x5eb936['query'][_0x75e5('0x3a')]));_0x4e9e48[_0x75e5('0x38')]=_0x4e9e48['attributes']['length']?_0x4e9e48[_0x75e5('0x38')]:_0x1de57e[_0x75e5('0x39')];_0x4e9e48[_0x75e5('0x3d')]=qs['sort'](_0x5eb936[_0x75e5('0x37')][_0x75e5('0x66')]);_0x4e9e48['where']=qs[_0x75e5('0x3e')](_['pick'](_0x5eb936['query'],_0x1de57e[_0x75e5('0x3e')]));if(_0x5eb936[_0x75e5('0x37')][_0x75e5('0x40')]){_0x4e9e48['where']=_['merge'](_0x4e9e48['where'],{'$or':_['map'](_0x4e9e48[_0x75e5('0x38')],function(_0x56043e){var _0xcd9845={};_0xcd9845[_0x56043e]={'$like':'%'+_0x5eb936[_0x75e5('0x37')][_0x75e5('0x40')]+'%'};return _0xcd9845;})});}_0x4e9e48=_['merge']({},_0x4e9e48,_0x5eb936[_0x75e5('0x42')]);return _0x2ebc44[_0x75e5('0x8b')](_0x4e9e48);}})[_0x75e5('0x27')](function(_0x27ba04){if(_0x27ba04){_0x4ffaee=_0x27ba04[_0x75e5('0x4a')];if(!_0x5eb936[_0x75e5('0x37')]['hasOwnProperty'](_0x75e5('0x3c'))){_0x4e9e48[_0x75e5('0x23')]=qs['limit'](_0x5eb936[_0x75e5('0x37')][_0x75e5('0x23')]);_0x4e9e48[_0x75e5('0x22')]=qs[_0x75e5('0x22')](_0x5eb936[_0x75e5('0x37')][_0x75e5('0x22')]);}return _0x2ebc44['getAgents'](_0x4e9e48);}})[_0x75e5('0x27')](function(_0x369707){if(_0x369707){return _0x369707?{'count':_0x4ffaee,'rows':_0x369707}:null;}})[_0x75e5('0x27')](respondWithResult(_0x4b75e6,null))[_0x75e5('0x46')](handleError(_0x4b75e6,null));}; \ No newline at end of file +var _0x76d2=['clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','TeamId','includes','all','union','compact','value','transaction','removeAgents','userMailQueue:remove','addAgents','spread','emit','userMailQueue:save','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./mailQueue.socket','sendStatus','status','end','json','count','offset','limit','Content-Range','save','update','destroy','MailQueues','then','error','stack','name','send','map','MailQueue','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','rows','catch','show','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','findOne','get','UserMailQueue','MailQueueId','findAll','User','findAndCountAll','UserId','agent','updatedAt','format','%s/%s','mailPause','createdAt','getTeams','addTeams','ids','online','flatMap','sequelize','each','findOrCreate','forEach','removeTeams','Team','Agents','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x76d2,0xa0));var _0x276d=function(_0x3f29ac,_0x5a3f12){_0x3f29ac=_0x3f29ac-0x0;var _0x3945ca=_0x76d2[_0x3f29ac];return _0x3945ca;};'use strict';var pdf=require(_0x276d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x276d('0x1'));var zipdir=require(_0x276d('0x2'));var jsonpatch=require(_0x276d('0x3'));var rp=require('request-promise');var moment=require(_0x276d('0x4'));var BPromise=require(_0x276d('0x5'));var Mustache=require(_0x276d('0x6'));var util=require('util');var path=require(_0x276d('0x7'));var sox=require(_0x276d('0x8'));var csv=require(_0x276d('0x9'));var ejs=require(_0x276d('0xa'));var fs=require('fs');var _=require(_0x276d('0xb'));var squel=require(_0x276d('0xc'));var crypto=require(_0x276d('0xd'));var jsforce=require(_0x276d('0xe'));var deskjs=require(_0x276d('0xf'));var toCsv=require(_0x276d('0x9'));var querystring=require(_0x276d('0x10'));var Papa=require('papaparse');var Redis=require(_0x276d('0x11'));var authService=require(_0x276d('0x12'));var qs=require(_0x276d('0x13'));var as=require(_0x276d('0x14'));var hardwareService=require(_0x276d('0x15'));var logger=require(_0x276d('0x16'))('api');var utils=require(_0x276d('0x17'));var config=require(_0x276d('0x18'));var db=require(_0x276d('0x19'))['db'];config[_0x276d('0x1a')]=_[_0x276d('0x1b')](config[_0x276d('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0x276d('0x1c'))(new Redis(config[_0x276d('0x1a')]));require(_0x276d('0x1d'))['register'](socket);function respondWithStatusCode(_0x58c81a,_0x26a785){_0x26a785=_0x26a785||0xcc;return function(_0x35b730){if(_0x35b730){return _0x58c81a[_0x276d('0x1e')](_0x26a785);}return _0x58c81a[_0x276d('0x1f')](_0x26a785)[_0x276d('0x20')]();};}function respondWithResult(_0x4e2a9c,_0x240920){_0x240920=_0x240920||0xc8;return function(_0x15bbc6){if(_0x15bbc6){return _0x4e2a9c[_0x276d('0x1f')](_0x240920)[_0x276d('0x21')](_0x15bbc6);}};}function respondWithFilteredResult(_0x275d4b,_0x28da6f){return function(_0x517765){if(_0x517765){var _0x21db2a=_0x517765[_0x276d('0x22')],_0xa90c6=_0x28da6f[_0x276d('0x23')],_0x4ad0f3=_0x28da6f['offset']+_0x28da6f[_0x276d('0x24')],_0xf0d645;if(_0x4ad0f3>=_0x21db2a){_0x4ad0f3=_0x21db2a;_0xf0d645=0xc8;}else{_0xf0d645=0xce;}_0x275d4b[_0x276d('0x1f')](_0xf0d645);return _0x275d4b['set'](_0x276d('0x25'),_0xa90c6+'-'+_0x4ad0f3+'/'+_0x21db2a)['json'](_0x517765);}return null;};}function patchUpdates(_0x283efb){return function(_0x341c4e){try{jsonpatch['apply'](_0x341c4e,_0x283efb,!![]);}catch(_0x4bafa9){return BPromise['reject'](_0x4bafa9);}return _0x341c4e[_0x276d('0x26')]();};}function saveUpdates(_0x320c02,_0x57b339){return function(_0x32ff17){if(_0x32ff17){return _0x32ff17[_0x276d('0x27')](_0x320c02)['then'](function(_0x59f7d8){return _0x59f7d8;});}return null;};}function removeEntity(_0x203cb0,_0x1967ac){return function(_0x1c7058){if(_0x1c7058){return _0x1c7058[_0x276d('0x28')]()['then'](function(){var _0x190f22=_0x1c7058['get']({'plain':!![]});var _0x582e73=_0x276d('0x29');return db['UserProfileResource'][_0x276d('0x28')]({'where':{'type':_0x582e73,'resourceId':_0x190f22['id']}})[_0x276d('0x2a')](function(){return _0x1c7058;});})['then'](function(){_0x203cb0['status'](0xcc)[_0x276d('0x20')]();});}};}function handleEntityNotFound(_0x390f1d,_0x55435a){return function(_0x38a535){if(!_0x38a535){_0x390f1d[_0x276d('0x1e')](0x194);}return _0x38a535;};}function handleError(_0x486eea,_0x4f20fa){_0x4f20fa=_0x4f20fa||0x1f4;return function(_0x2c26d3){logger[_0x276d('0x2b')](_0x2c26d3[_0x276d('0x2c')]);if(_0x2c26d3['name']){delete _0x2c26d3[_0x276d('0x2d')];}_0x486eea['status'](_0x4f20fa)[_0x276d('0x2e')](_0x2c26d3);};}exports['index']=function(_0x33c359,_0x5642ca){var _0x57c75d={},_0x5b337c={},_0x4bb416={'count':0x0,'rows':[]};var _0x536163=_[_0x276d('0x2f')](db[_0x276d('0x30')][_0x276d('0x31')],function(_0x2c758e){return{'name':_0x2c758e[_0x276d('0x32')],'type':_0x2c758e['type'][_0x276d('0x33')]};});_0x5b337c[_0x276d('0x34')]=_[_0x276d('0x2f')](_0x536163,'name');_0x5b337c['query']=_[_0x276d('0x35')](_0x33c359[_0x276d('0x36')]);_0x5b337c[_0x276d('0x37')]=_[_0x276d('0x38')](_0x5b337c['model'],_0x5b337c[_0x276d('0x36')]);_0x57c75d[_0x276d('0x39')]=_[_0x276d('0x38')](_0x5b337c[_0x276d('0x34')],qs[_0x276d('0x3a')](_0x33c359[_0x276d('0x36')]['fields']));_0x57c75d[_0x276d('0x39')]=_0x57c75d[_0x276d('0x39')][_0x276d('0x3b')]?_0x57c75d['attributes']:_0x5b337c[_0x276d('0x34')];if(!_0x33c359[_0x276d('0x36')][_0x276d('0x3c')](_0x276d('0x3d'))){_0x57c75d[_0x276d('0x24')]=qs[_0x276d('0x24')](_0x33c359[_0x276d('0x36')][_0x276d('0x24')]);_0x57c75d['offset']=qs[_0x276d('0x23')](_0x33c359[_0x276d('0x36')][_0x276d('0x23')]);}_0x57c75d[_0x276d('0x3e')]=qs['sort'](_0x33c359[_0x276d('0x36')][_0x276d('0x3f')]);_0x57c75d[_0x276d('0x40')]=qs[_0x276d('0x37')](_[_0x276d('0x41')](_0x33c359[_0x276d('0x36')],_0x5b337c[_0x276d('0x37')]));if(_0x33c359['query'][_0x276d('0x42')]){_0x57c75d[_0x276d('0x40')]=_[_0x276d('0x43')](_0x57c75d[_0x276d('0x40')],{'$or':_[_0x276d('0x2f')](_0x536163,function(_0x5b1fc8){if(_0x5b1fc8[_0x276d('0x44')]!==_0x276d('0x45')){var _0x44f3f3={};_0x44f3f3[_0x5b1fc8[_0x276d('0x2d')]]={'$like':'%'+_0x33c359[_0x276d('0x36')][_0x276d('0x42')]+'%'};return _0x44f3f3;}})});}_0x57c75d=_[_0x276d('0x43')]({},_0x57c75d,_0x33c359[_0x276d('0x46')]);var _0x62bd00={'where':_0x57c75d['where']};return db['MailQueue'][_0x276d('0x22')](_0x62bd00)[_0x276d('0x2a')](function(_0x3b793a){_0x4bb416[_0x276d('0x22')]=_0x3b793a;if(_0x33c359[_0x276d('0x36')][_0x276d('0x47')]){_0x57c75d['include']=[{'all':!![]}];}return db[_0x276d('0x30')]['findAll'](_0x57c75d);})[_0x276d('0x2a')](function(_0x5dac54){_0x4bb416[_0x276d('0x48')]=_0x5dac54;return _0x4bb416;})[_0x276d('0x2a')](respondWithFilteredResult(_0x5642ca,_0x57c75d))[_0x276d('0x49')](handleError(_0x5642ca,null));};exports[_0x276d('0x4a')]=function(_0x3901b5,_0x487d2d){var _0x5cb249={'raw':!![],'where':{'id':_0x3901b5['params']['id']}},_0x232aa1={};_0x232aa1[_0x276d('0x34')]=_[_0x276d('0x35')](db[_0x276d('0x30')][_0x276d('0x31')]);_0x232aa1[_0x276d('0x36')]=_[_0x276d('0x35')](_0x3901b5[_0x276d('0x36')]);_0x232aa1['filters']=_[_0x276d('0x38')](_0x232aa1['model'],_0x232aa1[_0x276d('0x36')]);_0x5cb249['attributes']=_['intersection'](_0x232aa1['model'],qs[_0x276d('0x3a')](_0x3901b5[_0x276d('0x36')][_0x276d('0x3a')]));_0x5cb249[_0x276d('0x39')]=_0x5cb249['attributes']['length']?_0x5cb249[_0x276d('0x39')]:_0x232aa1['model'];if(_0x3901b5['query'][_0x276d('0x47')]){_0x5cb249[_0x276d('0x4b')]=[{'all':!![]}];}_0x5cb249=_[_0x276d('0x43')]({},_0x5cb249,_0x3901b5[_0x276d('0x46')]);return db['MailQueue']['find'](_0x5cb249)[_0x276d('0x2a')](handleEntityNotFound(_0x487d2d,null))[_0x276d('0x2a')](respondWithResult(_0x487d2d,null))[_0x276d('0x49')](handleError(_0x487d2d,null));};exports['create']=function(_0x1094df,_0x387fef){return db['MailQueue'][_0x276d('0x4c')](_0x1094df[_0x276d('0x4d')],{})[_0x276d('0x2a')](function(_0x126ec9){var _0x1272eb=_0x1094df[_0x276d('0x4e')]['get']({'plain':!![]});if(!_0x1272eb)throw new Error(_0x276d('0x4f'));if(_0x1272eb[_0x276d('0x50')]===_0x276d('0x4e')){var _0x5ad5f4=_0x126ec9['get']({'plain':!![]});var _0x160b78='MailQueues';return db[_0x276d('0x51')][_0x276d('0x52')]({'where':{'name':_0x160b78,'userProfileId':_0x1272eb[_0x276d('0x53')]},'raw':!![]})[_0x276d('0x2a')](function(_0x286381){if(_0x286381&&_0x286381[_0x276d('0x54')]===0x0){return db[_0x276d('0x55')][_0x276d('0x4c')]({'name':_0x5ad5f4[_0x276d('0x2d')],'resourceId':_0x5ad5f4['id'],'type':_0x286381[_0x276d('0x2d')],'sectionId':_0x286381['id']},{})[_0x276d('0x2a')](function(){return _0x126ec9;});}else{return _0x126ec9;}})['catch'](function(_0x5b806d){logger['error'](_0x276d('0x56'),_0x5b806d);throw _0x5b806d;});}return _0x126ec9;})[_0x276d('0x2a')](respondWithResult(_0x387fef,0xc9))[_0x276d('0x49')](handleError(_0x387fef,null));};exports[_0x276d('0x27')]=function(_0xbd88ea,_0x58a98e){if(_0xbd88ea[_0x276d('0x4d')]['id']){delete _0xbd88ea[_0x276d('0x4d')]['id'];}return db[_0x276d('0x30')][_0x276d('0x52')]({'where':{'id':_0xbd88ea[_0x276d('0x57')]['id']}})['then'](handleEntityNotFound(_0x58a98e,null))[_0x276d('0x2a')](saveUpdates(_0xbd88ea[_0x276d('0x4d')],null))[_0x276d('0x2a')](respondWithResult(_0x58a98e,null))['catch'](handleError(_0x58a98e,null));};exports[_0x276d('0x28')]=function(_0xdc8f3a,_0x17ea3b){return db[_0x276d('0x30')][_0x276d('0x52')]({'where':{'id':_0xdc8f3a[_0x276d('0x57')]['id']}})[_0x276d('0x2a')](handleEntityNotFound(_0x17ea3b,null))[_0x276d('0x2a')](removeEntity(_0x17ea3b,null))[_0x276d('0x49')](handleError(_0x17ea3b,null));};exports[_0x276d('0x58')]=function(_0x2f0701,_0x1f0bda){return db['MailQueue']['describe']()[_0x276d('0x2a')](respondWithResult(_0x1f0bda,null))[_0x276d('0x49')](handleError(_0x1f0bda,null));};exports[_0x276d('0x59')]=function(_0x452e8b,_0x5d6f10,_0xbbb75e){var _0x6ae54f={'raw':!![],'where':{}},_0x599752={},_0x44a561;return db[_0x276d('0x30')][_0x276d('0x5a')]({'where':{'id':_0x452e8b['params']['id']}})['then'](handleEntityNotFound(_0x5d6f10,null))[_0x276d('0x2a')](function(_0x2fc135){if(_0x2fc135){_0x44a561=_0x2fc135[_0x276d('0x5b')]({'plain':!![]});_0x599752[_0x276d('0x34')]=_[_0x276d('0x35')](db[_0x276d('0x5c')]['rawAttributes']);_0x599752[_0x276d('0x36')]=_[_0x276d('0x35')](_0x452e8b[_0x276d('0x36')]);_0x599752['filters']=_[_0x276d('0x38')](_0x599752[_0x276d('0x34')],_0x599752[_0x276d('0x36')]);_0x6ae54f[_0x276d('0x39')]=_['intersection'](_0x599752[_0x276d('0x34')],qs[_0x276d('0x3a')](_0x452e8b['query']['fields']));_0x6ae54f[_0x276d('0x39')]=_0x6ae54f['attributes'][_0x276d('0x3b')]?_0x6ae54f[_0x276d('0x39')]:_0x599752['model'];if(!_0x452e8b['query']['hasOwnProperty'](_0x276d('0x3d'))){_0x6ae54f[_0x276d('0x24')]=qs['limit'](_0x452e8b[_0x276d('0x36')]['limit']);_0x6ae54f['offset']=qs[_0x276d('0x23')](_0x452e8b[_0x276d('0x36')]['offset']);}_0x6ae54f[_0x276d('0x3e')]=qs[_0x276d('0x3f')](_0x452e8b[_0x276d('0x36')][_0x276d('0x3f')]);_0x6ae54f['where']=qs[_0x276d('0x37')](_[_0x276d('0x41')](_0x452e8b[_0x276d('0x36')],_0x599752['filters']));_0x6ae54f['where'][_0x276d('0x5d')]=_0x2fc135['id'];if(_0x452e8b['query'][_0x276d('0x42')]){_0x6ae54f[_0x276d('0x40')]=_[_0x276d('0x43')](_0x6ae54f[_0x276d('0x40')],{'$or':_[_0x276d('0x2f')](_0x6ae54f[_0x276d('0x39')],function(_0x317803){var _0x5d9c8e={};_0x5d9c8e[_0x317803]={'$like':'%'+_0x452e8b[_0x276d('0x36')][_0x276d('0x42')]+'%'};return _0x5d9c8e;})});}_0x6ae54f=_['merge']({},_0x6ae54f,_0x452e8b[_0x276d('0x46')]);return db[_0x276d('0x5c')][_0x276d('0x5e')](_0x6ae54f);}})[_0x276d('0x2a')](function(_0x491410){if(_0x491410){return db[_0x276d('0x5f')][_0x276d('0x60')]({'where':{'id':_[_0x276d('0x2f')](_0x491410,_0x276d('0x61')),'role':_0x276d('0x62')},'attributes':['id','name','mailPause',_0x276d('0x63'),'createdAt']});}})[_0x276d('0x2a')](function(_0x54213b){if(_0x54213b){return{'count':_0x54213b[_0x276d('0x22')],'rows':_[_0x276d('0x2f')](_0x54213b[_0x276d('0x48')],function(_0x33d358){return{'membername':_0x33d358[_0x276d('0x2d')],'UserId':_0x33d358['id'],'queue_name':_0x44a561[_0x276d('0x2d')],'MailQueueId':_0x44a561['id'],'interface':util[_0x276d('0x64')](_0x276d('0x65'),'SIP',_0x33d358[_0x276d('0x2d')]),'penalty':0x0,'paused':_0x33d358[_0x276d('0x66')],'createdAt':_0x33d358[_0x276d('0x67')],'updatedAt':_0x33d358[_0x276d('0x63')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x276d('0x2a')](respondWithFilteredResult(_0x5d6f10,_0x6ae54f))[_0x276d('0x49')](handleError(_0x5d6f10,null));};exports[_0x276d('0x68')]=function(_0x4b8534,_0x3780fb,_0x3f06da){var _0x393078={};var _0x118e5d={};var _0x41188d;var _0x5af63b;return db[_0x276d('0x30')]['findOne']({'where':{'id':_0x4b8534[_0x276d('0x57')]['id']}})[_0x276d('0x2a')](handleEntityNotFound(_0x3780fb,null))[_0x276d('0x2a')](function(_0xb6fb10){if(_0xb6fb10){_0x41188d=_0xb6fb10;_0x118e5d[_0x276d('0x34')]=_[_0x276d('0x35')](db['Team'][_0x276d('0x31')]);_0x118e5d['query']=_[_0x276d('0x35')](_0x4b8534[_0x276d('0x36')]);_0x118e5d[_0x276d('0x37')]=_['intersection'](_0x118e5d['model'],_0x118e5d[_0x276d('0x36')]);_0x393078[_0x276d('0x39')]=_['intersection'](_0x118e5d[_0x276d('0x34')],qs[_0x276d('0x3a')](_0x4b8534[_0x276d('0x36')]['fields']));_0x393078[_0x276d('0x39')]=_0x393078[_0x276d('0x39')]['length']?_0x393078['attributes']:_0x118e5d[_0x276d('0x34')];_0x393078[_0x276d('0x3e')]=qs[_0x276d('0x3f')](_0x4b8534['query'][_0x276d('0x3f')]);_0x393078[_0x276d('0x40')]=qs['filters'](_['pick'](_0x4b8534[_0x276d('0x36')],_0x118e5d[_0x276d('0x37')]));if(_0x4b8534[_0x276d('0x36')]['filter']){_0x393078['where']=_[_0x276d('0x43')](_0x393078[_0x276d('0x40')],{'$or':_[_0x276d('0x2f')](_0x393078[_0x276d('0x39')],function(_0x7d865f){var _0x121908={};_0x121908[_0x7d865f]={'$like':'%'+_0x4b8534['query']['filter']+'%'};return _0x121908;})});}_0x393078=_['merge']({},_0x393078,_0x4b8534[_0x276d('0x46')]);return _0x41188d[_0x276d('0x68')](_0x393078);}})[_0x276d('0x2a')](function(_0x5d1112){if(_0x5d1112){_0x5af63b=_0x5d1112[_0x276d('0x3b')];if(!_0x4b8534[_0x276d('0x36')]['hasOwnProperty']('nolimit')){_0x393078['limit']=qs[_0x276d('0x24')](_0x4b8534[_0x276d('0x36')][_0x276d('0x24')]);_0x393078[_0x276d('0x23')]=qs[_0x276d('0x23')](_0x4b8534['query']['offset']);}return _0x41188d[_0x276d('0x68')](_0x393078);}})[_0x276d('0x2a')](function(_0x76f1e6){if(_0x76f1e6){return _0x76f1e6?{'count':_0x5af63b,'rows':_0x76f1e6}:null;}})[_0x276d('0x2a')](respondWithResult(_0x3780fb,null))[_0x276d('0x49')](handleError(_0x3780fb,null));};exports[_0x276d('0x69')]=function(_0x2acbcb,_0x35406c,_0x4aa0c5){var _0x548e78=_0x2acbcb[_0x276d('0x4d')][_0x276d('0x6a')];return db['Team'][_0x276d('0x5e')]({'where':{'id':_0x548e78},'attributes':['id'],'include':[{'model':db[_0x276d('0x5f')],'as':'Agents','attributes':['id',_0x276d('0x2d'),_0x276d('0x6b'),'voicePause','interface'],'raw':!![]}]})[_0x276d('0x2a')](function(_0x4ae9f2){if(_0x4ae9f2){var _0x27290b=_[_0x276d('0x6c')](_0x4ae9f2,function(_0x479024){var _0x1507a7=_0x479024[_0x276d('0x5b')]({'plain':!![]});return _0x1507a7['Agents'];});return db[_0x276d('0x30')][_0x276d('0x52')]({'where':{'id':_0x2acbcb['params']['id']}})[_0x276d('0x2a')](function(_0x26d202){return db[_0x276d('0x6d')]['transaction'](function(_0x5a1238){return _0x26d202['addTeams'](_0x548e78,{'transaction':_0x5a1238})['then'](function(){return BPromise[_0x276d('0x6e')](_0x27290b,function(_0x1d17bb){return db[_0x276d('0x5c')][_0x276d('0x6f')]({'where':{'UserId':_0x1d17bb['id'],'MailQueueId':_0x2acbcb[_0x276d('0x57')]['id']},'transaction':_0x5a1238});});})[_0x276d('0x2a')](function(){_0x27290b[_0x276d('0x70')](function(_0x2e7a75){socket['emit']('userMailQueue:save',{'UserId':_0x2e7a75['id'],'MailQueueId':_0x26d202['id']});});});});});}})[_0x276d('0x2a')](respondWithStatusCode(_0x35406c,null))[_0x276d('0x49')](handleError(_0x35406c,null));};exports[_0x276d('0x71')]=function(_0x245d68,_0x25dc9c,_0x561a50){return db[_0x276d('0x72')]['findAll']({'where':{'id':_0x245d68[_0x276d('0x36')][_0x276d('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x276d('0x5f')],'as':_0x276d('0x73'),'attributes':['id'],'raw':!![]}]})[_0x276d('0x2a')](handleEntityNotFound(_0x25dc9c,null))['then'](function(_0x4f5cf7){var _0x123406=_[_0x276d('0x2f')](_0x4f5cf7,'id');var _0x301aee=[];var _0x191b8b=[];var _0x5242a0=squel['select']();_0x5242a0['field'](_0x276d('0x74'))[_0x276d('0x75')](_0x276d('0x76'),'tq')[_0x276d('0x77')](_0x276d('0x78'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x276d('0x40')](_0x276d('0x79'),_0x245d68[_0x276d('0x57')]['id']);for(var _0x3b2fa0=0x0;_0x3b2fa0<_0x4f5cf7[_0x276d('0x3b')];_0x3b2fa0+=0x1){let _0x38bad5=_0x4f5cf7[_0x3b2fa0];for(var _0x45a954=0x0;_0x45a954<_0x38bad5[_0x276d('0x73')][_0x276d('0x3b')];_0x45a954+=0x1){let _0x23b837=_0x38bad5[_0x276d('0x73')][_0x45a954];var _0x24373b=_0x5242a0[_0x276d('0x7a')]();_0x24373b[_0x276d('0x40')](_0x276d('0x7b'),_0x23b837['id']);_0x191b8b[_0x276d('0x7c')](db[_0x276d('0x6d')][_0x276d('0x36')](_0x24373b['toString'](),{'type':db[_0x276d('0x6d')][_0x276d('0x7d')][_0x276d('0x7e')]})[_0x276d('0x2a')](function(_0x32e2c3){if(_0x32e2c3[_0x276d('0x3b')]===0x1){return _0x23b837['id'];}else{var _0x57df91=_['every'](_[_0x276d('0x2f')](_0x32e2c3,_0x276d('0x7f')),function(_0x322d5f){return _[_0x276d('0x80')](_0x123406,_0x322d5f);});if(_0x57df91){return _0x23b837['id'];}}}));}}return BPromise[_0x276d('0x81')](_0x191b8b)[_0x276d('0x2a')](function(_0x4ed376){_0x301aee=_(_0x301aee)[_0x276d('0x82')](_0x4ed376)[_0x276d('0x83')]()[_0x276d('0x84')]();return db['MailQueue']['find']({'where':{'id':_0x245d68['params']['id']}})[_0x276d('0x2a')](function(_0x2c75bf){return db[_0x276d('0x6d')][_0x276d('0x85')](function(_0x1a9c7c){return _0x2c75bf[_0x276d('0x71')](_0x245d68[_0x276d('0x36')][_0x276d('0x6a')],{'transaction':_0x1a9c7c})['then'](function(){if(!_['isEmpty'](_0x301aee)){return _0x2c75bf[_0x276d('0x86')](_0x301aee,{'transaction':_0x1a9c7c});}})[_0x276d('0x2a')](function(){_0x301aee[_0x276d('0x70')](function(_0x19433c){socket['emit'](_0x276d('0x87'),{'UserId':_0x19433c,'MailQueueId':_0x2c75bf['id']});});});});});});})[_0x276d('0x2a')](respondWithStatusCode(_0x25dc9c,null))['catch'](handleError(_0x25dc9c,null));};exports[_0x276d('0x88')]=function(_0x57cfc5,_0x7516fe,_0x3dd3e8){return db[_0x276d('0x30')][_0x276d('0x52')]({'where':{'id':_0x57cfc5[_0x276d('0x57')]['id']}})['then'](handleEntityNotFound(_0x7516fe,null))[_0x276d('0x2a')](function(_0x36a6ec){if(_0x36a6ec){return _0x36a6ec[_0x276d('0x88')](_0x57cfc5[_0x276d('0x4d')][_0x276d('0x6a')],_['omit'](_0x57cfc5[_0x276d('0x4d')],['ids','id'])||{})[_0x276d('0x89')](function(_0x15fd13){for(var _0x130804=0x0;_0x130804<_0x57cfc5[_0x276d('0x4d')][_0x276d('0x6a')][_0x276d('0x3b')];_0x130804+=0x1){socket[_0x276d('0x8a')](_0x276d('0x8b'),{'UserId':_0x57cfc5[_0x276d('0x4d')][_0x276d('0x6a')][_0x130804],'MailQueueId':_0x57cfc5['params']['id']});}return _0x15fd13;});}})[_0x276d('0x2a')](respondWithResult(_0x7516fe,null))[_0x276d('0x49')](handleError(_0x7516fe,null));};exports[_0x276d('0x86')]=function(_0x275a28,_0x265671,_0x5021d8){return db[_0x276d('0x30')][_0x276d('0x52')]({'where':{'id':_0x275a28[_0x276d('0x57')]['id']}})[_0x276d('0x2a')](handleEntityNotFound(_0x265671,null))[_0x276d('0x2a')](function(_0x11c8be){if(_0x11c8be){return _0x11c8be[_0x276d('0x86')](_0x275a28['query'][_0x276d('0x6a')])['then'](function(){if(_['isArray'](_0x275a28[_0x276d('0x36')][_0x276d('0x6a')])){for(var _0x9a766b=0x0;_0x9a766b<_0x275a28['query']['ids']['length'];_0x9a766b+=0x1){socket[_0x276d('0x8a')]('userMailQueue:remove',{'UserId':Number(_0x275a28[_0x276d('0x36')][_0x276d('0x6a')][_0x9a766b]),'MailQueueId':Number(_0x275a28[_0x276d('0x57')]['id'])});}}else{socket[_0x276d('0x8a')](_0x276d('0x87'),{'UserId':Number(_0x275a28['query'][_0x276d('0x6a')]),'MailQueueId':Number(_0x275a28[_0x276d('0x57')]['id'])});}});}})['then'](respondWithStatusCode(_0x265671,null))['catch'](handleError(_0x265671,null));};exports[_0x276d('0x8c')]=function(_0x3c1e71,_0x3c7dd9,_0x1edc8b){var _0x25ccb9={};var _0x25165d={};var _0x5b1eed;var _0x291cf2;return db[_0x276d('0x30')][_0x276d('0x5a')]({'where':{'id':_0x3c1e71[_0x276d('0x57')]['id']}})['then'](handleEntityNotFound(_0x3c7dd9,null))['then'](function(_0x3672cd){if(_0x3672cd){_0x5b1eed=_0x3672cd;_0x25165d[_0x276d('0x34')]=_[_0x276d('0x35')](db[_0x276d('0x5f')]['rawAttributes']);_0x25165d[_0x276d('0x36')]=_['keys'](_0x3c1e71[_0x276d('0x36')]);_0x25165d[_0x276d('0x37')]=_[_0x276d('0x38')](_0x25165d[_0x276d('0x34')],_0x25165d[_0x276d('0x36')]);_0x25ccb9[_0x276d('0x39')]=_[_0x276d('0x38')](_0x25165d[_0x276d('0x34')],qs['fields'](_0x3c1e71[_0x276d('0x36')][_0x276d('0x3a')]));_0x25ccb9[_0x276d('0x39')]=_0x25ccb9[_0x276d('0x39')][_0x276d('0x3b')]?_0x25ccb9[_0x276d('0x39')]:_0x25165d['model'];_0x25ccb9[_0x276d('0x3e')]=qs[_0x276d('0x3f')](_0x3c1e71['query'][_0x276d('0x3f')]);_0x25ccb9[_0x276d('0x40')]=qs['filters'](_[_0x276d('0x41')](_0x3c1e71[_0x276d('0x36')],_0x25165d['filters']));if(_0x3c1e71['query'][_0x276d('0x42')]){_0x25ccb9[_0x276d('0x40')]=_[_0x276d('0x43')](_0x25ccb9[_0x276d('0x40')],{'$or':_['map'](_0x25ccb9['attributes'],function(_0xd502b5){var _0x56ea1b={};_0x56ea1b[_0xd502b5]={'$like':'%'+_0x3c1e71[_0x276d('0x36')]['filter']+'%'};return _0x56ea1b;})});}_0x25ccb9=_[_0x276d('0x43')]({},_0x25ccb9,_0x3c1e71[_0x276d('0x46')]);return _0x5b1eed[_0x276d('0x8c')](_0x25ccb9);}})[_0x276d('0x2a')](function(_0x45a654){if(_0x45a654){_0x291cf2=_0x45a654['length'];if(!_0x3c1e71[_0x276d('0x36')]['hasOwnProperty'](_0x276d('0x3d'))){_0x25ccb9[_0x276d('0x24')]=qs[_0x276d('0x24')](_0x3c1e71[_0x276d('0x36')]['limit']);_0x25ccb9[_0x276d('0x23')]=qs[_0x276d('0x23')](_0x3c1e71[_0x276d('0x36')]['offset']);}return _0x5b1eed[_0x276d('0x8c')](_0x25ccb9);}})[_0x276d('0x2a')](function(_0xa610a9){if(_0xa610a9){return _0xa610a9?{'count':_0x291cf2,'rows':_0xa610a9}:null;}})[_0x276d('0x2a')](respondWithResult(_0x3c7dd9,null))[_0x276d('0x49')](handleError(_0x3c7dd9,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index 4601423..da13a7a 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 _0x661e=['setMaxListeners','update','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x37a79c,_0x2b19f0){var _0x561d89=function(_0x19bee3){while(--_0x19bee3){_0x37a79c['push'](_0x37a79c['shift']());}};_0x561d89(++_0x2b19f0);}(_0x661e,0x86));var _0xe661=function(_0x3d3d73,_0x3cf64e){_0x3d3d73=_0x3d3d73-0x0;var _0x38ddde=_0x661e[_0x3d3d73];return _0x38ddde;};'use strict';var EventEmitter=require(_0xe661('0x0'));var MailQueue=require(_0xe661('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xe661('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xe661('0x3'),'afterDestroy':'remove'};function emitEvent(_0x247b50){return function(_0x7db42e,_0x43e73b,_0x357edb){MailQueueEvents[_0xe661('0x4')](_0x247b50+':'+_0x7db42e['id'],_0x7db42e);MailQueueEvents[_0xe661('0x4')](_0x247b50,_0x7db42e);_0x357edb(null);};}for(var e in events){if(events[_0xe661('0x5')](e)){var event=events[e];MailQueue[_0xe661('0x6')](e,emitEvent(event));}}module[_0xe661('0x7')]=MailQueueEvents; \ No newline at end of file +var _0xf8f1=['update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','setMaxListeners','save'];(function(_0x5a89df,_0x59cf29){var _0x15a0c5=function(_0x381664){while(--_0x381664){_0x5a89df['push'](_0x5a89df['shift']());}};_0x15a0c5(++_0x59cf29);}(_0xf8f1,0x114));var _0x1f8f=function(_0x3b085,_0x250543){_0x3b085=_0x3b085-0x0;var _0x476a57=_0xf8f1[_0x3b085];return _0x476a57;};'use strict';var EventEmitter=require('events');var MailQueue=require(_0x1f8f('0x0'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x1f8f('0x1')](0x0);var events={'afterCreate':_0x1f8f('0x2'),'afterUpdate':_0x1f8f('0x3'),'afterDestroy':_0x1f8f('0x4')};function emitEvent(_0x43a279){return function(_0x46ff00,_0x2cca2d,_0x3164bc){MailQueueEvents[_0x1f8f('0x5')](_0x43a279+':'+_0x46ff00['id'],_0x46ff00);MailQueueEvents[_0x1f8f('0x5')](_0x43a279,_0x46ff00);_0x3164bc(null);};}for(var e in events){if(events[_0x1f8f('0x6')](e)){var event=events[e];MailQueue[_0x1f8f('0x7')](e,emitEvent(event));}}module[_0x1f8f('0x8')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 6fd2353..e81d8c7 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 _0xdf97=['../../config/environment','./mailQueue.attributes','define','MailQueue','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xdf97,0x1c6));var _0x7df9=function(_0x2e76a7,_0x23871a){_0x2e76a7=_0x2e76a7-0x0;var _0x454cde=_0xdf97[_0x2e76a7];return _0x454cde;};'use strict';var _=require(_0x7df9('0x0'));var util=require(_0x7df9('0x1'));var logger=require(_0x7df9('0x2'))('api');var moment=require(_0x7df9('0x3'));var BPromise=require(_0x7df9('0x4'));var rp=require(_0x7df9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x7df9('0x6'));var attributes=require(_0x7df9('0x7'));module['exports']=function(_0x25ef32,_0x589751){return _0x25ef32[_0x7df9('0x8')](_0x7df9('0x9'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x512a=['exports','define','MailQueue','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x39c500,_0x188faf){var _0x6f774c=function(_0x227c53){while(--_0x227c53){_0x39c500['push'](_0x39c500['shift']());}};_0x6f774c(++_0x188faf);}(_0x512a,0xbe));var _0xa512=function(_0x8af815,_0x321958){_0x8af815=_0x8af815-0x0;var _0xde4dbf=_0x512a[_0x8af815];return _0xde4dbf;};'use strict';var _=require('lodash');var util=require(_0xa512('0x0'));var logger=require(_0xa512('0x1'))(_0xa512('0x2'));var moment=require(_0xa512('0x3'));var BPromise=require(_0xa512('0x4'));var rp=require(_0xa512('0x5'));var fs=require('fs');var path=require(_0xa512('0x6'));var rimraf=require(_0xa512('0x7'));var config=require('../../config/environment');var attributes=require('./mailQueue.attributes');module[_0xa512('0x8')]=function(_0x2ded81,_0x1ac18d){return _0x2ded81[_0xa512('0x9')](_0xa512('0xa'),attributes,{'tableName':'mail_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index d765d20..75716b8 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 _0x7231=['find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','register','request','then','info','MailQueue,\x20%s,\x20%s','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','MailQueue','options','raw','where','limit','include','model','attributes','map','GetMailQueue','ShowMailQueue'];(function(_0x2a5af8,_0x348a65){var _0x50587d=function(_0x3811b7){while(--_0x3811b7){_0x2a5af8['push'](_0x2a5af8['shift']());}};_0x50587d(++_0x348a65);}(_0x7231,0x1a3));var _0x1723=function(_0x1df413,_0x271887){_0x1df413=_0x1df413-0x0;var _0x594f14=_0x7231[_0x1df413];return _0x594f14;};'use strict';var _=require('lodash');var util=require(_0x1723('0x0'));var moment=require(_0x1723('0x1'));var BPromise=require(_0x1723('0x2'));var rs=require(_0x1723('0x3'));var fs=require('fs');var Redis=require(_0x1723('0x4'));var db=require(_0x1723('0x5'))['db'];var utils=require(_0x1723('0x6'));var logger=require(_0x1723('0x7'))('rpc');var config=require(_0x1723('0x8'));var jayson=require(_0x1723('0x9'));var client=jayson['client'][_0x1723('0xa')]({'port':0x232a});config[_0x1723('0xb')]=_[_0x1723('0xc')](config[_0x1723('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1723('0xb')]));require('./mailQueue.socket')[_0x1723('0xd')](socket);function respondWithRpcPromise(_0x573295,_0x3ba97d,_0x3b23af){return new BPromise(function(_0x3a710a,_0x1e7185){return client[_0x1723('0xe')](_0x573295,_0x3b23af)[_0x1723('0xf')](function(_0x3ff7f1){logger[_0x1723('0x10')](_0x1723('0x11'),_0x3ba97d,_0x1723('0x12'));logger[_0x1723('0x13')](_0x1723('0x14'),_0x3ba97d,_0x1723('0x12'),JSON[_0x1723('0x15')](_0x3ff7f1));if(_0x3ff7f1[_0x1723('0x16')]){if(_0x3ff7f1[_0x1723('0x16')]['code']===0x1f4){logger[_0x1723('0x16')](_0x1723('0x11'),_0x3ba97d,_0x3ff7f1['error'][_0x1723('0x17')]);return _0x1e7185(_0x3ff7f1[_0x1723('0x16')]['message']);}logger['error'](_0x1723('0x11'),_0x3ba97d,_0x3ff7f1[_0x1723('0x16')][_0x1723('0x17')]);return _0x3a710a(_0x3ff7f1['error'][_0x1723('0x17')]);}else{logger[_0x1723('0x10')](_0x1723('0x11'),_0x3ba97d,_0x1723('0x12'));_0x3a710a(_0x3ff7f1[_0x1723('0x18')]['message']);}})[_0x1723('0x19')](function(_0x329ddd){logger[_0x1723('0x16')](_0x1723('0x11'),_0x3ba97d,_0x329ddd);_0x1e7185(_0x329ddd);});});}exports['GetMailQueue']=function(_0x5eff69){var _0x59108b=this;return new Promise(function(_0x2ca3c4,_0x4a71a4){return db[_0x1723('0x1a')]['findAll']({'raw':_0x5eff69[_0x1723('0x1b')]?_0x5eff69['options'][_0x1723('0x1c')]===undefined?!![]:![]:!![],'where':_0x5eff69[_0x1723('0x1b')]?_0x5eff69[_0x1723('0x1b')][_0x1723('0x1d')]||null:null,'attributes':_0x5eff69['options']?_0x5eff69[_0x1723('0x1b')]['attributes']||null:null,'limit':_0x5eff69[_0x1723('0x1b')]?_0x5eff69[_0x1723('0x1b')][_0x1723('0x1e')]||null:null,'include':_0x5eff69[_0x1723('0x1b')]?_0x5eff69[_0x1723('0x1b')][_0x1723('0x1f')]?_['map'](_0x5eff69[_0x1723('0x1b')][_0x1723('0x1f')],function(_0x6d0614){return{'model':db[_0x6d0614[_0x1723('0x20')]],'as':_0x6d0614['as'],'attributes':_0x6d0614[_0x1723('0x21')],'include':_0x6d0614[_0x1723('0x1f')]?_[_0x1723('0x22')](_0x6d0614[_0x1723('0x1f')],function(_0x3340cb){return{'model':db[_0x3340cb[_0x1723('0x20')]],'as':_0x3340cb['as'],'attributes':_0x3340cb[_0x1723('0x21')],'include':_0x3340cb['include']?_[_0x1723('0x22')](_0x3340cb[_0x1723('0x1f')],function(_0x1bb3db){return{'model':db[_0x1bb3db[_0x1723('0x20')]],'as':_0x1bb3db['as'],'attributes':_0x1bb3db[_0x1723('0x21')]};}):[]};}):[]};}):[]:[]})[_0x1723('0xf')](function(_0x87b98c){logger[_0x1723('0x10')](_0x1723('0x23'),_0x5eff69);logger[_0x1723('0x13')](_0x1723('0x23'),_0x5eff69,JSON['stringify'](_0x87b98c));_0x2ca3c4(_0x87b98c);})[_0x1723('0x19')](function(_0x9b2182){logger[_0x1723('0x16')](_0x1723('0x23'),_0x9b2182[_0x1723('0x17')],_0x5eff69);_0x4a71a4(_0x59108b['error'](0x1f4,_0x9b2182[_0x1723('0x17')]));});});};exports[_0x1723('0x24')]=function(_0x2d6464){var _0x28ad00=this;return new Promise(function(_0x237644,_0x6ff3d7){return db[_0x1723('0x1a')][_0x1723('0x25')]({'raw':_0x2d6464[_0x1723('0x1b')]?_0x2d6464[_0x1723('0x1b')][_0x1723('0x1c')]===undefined?!![]:![]:!![],'where':_0x2d6464[_0x1723('0x1b')]?_0x2d6464[_0x1723('0x1b')][_0x1723('0x1d')]||null:null,'attributes':_0x2d6464['options']?_0x2d6464[_0x1723('0x1b')][_0x1723('0x21')]||null:null,'include':_0x2d6464['options']?_0x2d6464[_0x1723('0x1b')][_0x1723('0x1f')]?_[_0x1723('0x22')](_0x2d6464[_0x1723('0x1b')][_0x1723('0x1f')],function(_0x1b6e53){return{'model':db[_0x1b6e53[_0x1723('0x20')]],'as':_0x1b6e53['as'],'attributes':_0x1b6e53['attributes'],'include':_0x1b6e53[_0x1723('0x1f')]?_[_0x1723('0x22')](_0x1b6e53[_0x1723('0x1f')],function(_0x25366c){return{'model':db[_0x25366c[_0x1723('0x20')]],'as':_0x25366c['as'],'attributes':_0x25366c[_0x1723('0x21')],'include':_0x25366c[_0x1723('0x1f')]?_[_0x1723('0x22')](_0x25366c[_0x1723('0x1f')],function(_0x2c127c){return{'model':db[_0x2c127c[_0x1723('0x20')]],'as':_0x2c127c['as'],'attributes':_0x2c127c['attributes']};}):[]};}):[]};}):[]:[]})[_0x1723('0xf')](function(_0x5d2bf3){logger[_0x1723('0x10')]('ShowMailQueue',_0x2d6464);logger[_0x1723('0x13')](_0x1723('0x24'),_0x2d6464,JSON[_0x1723('0x15')](_0x5d2bf3));_0x237644(_0x5d2bf3);})[_0x1723('0x19')](function(_0x4ade3a){logger[_0x1723('0x16')](_0x1723('0x24'),_0x4ade3a['message'],_0x2d6464);_0x6ff3d7(_0x28ad00[_0x1723('0x16')](0x1f4,_0x4ade3a[_0x1723('0x17')]));});});}; \ No newline at end of file +var _0x3970=['error','message','request\x20sent','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model','debug','find','ShowMailQueue','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','./mailQueue.socket','register','request','then','info','MailQueue,\x20%s,\x20%s','MailQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3981e5,_0x2c00dd){var _0x49fa78=function(_0x45ff6d){while(--_0x45ff6d){_0x3981e5['push'](_0x3981e5['shift']());}};_0x49fa78(++_0x2c00dd);}(_0x3970,0xaa));var _0x0397=function(_0x7b173,_0x539d7f){_0x7b173=_0x7b173-0x0;var _0x1c598c=_0x3970[_0x7b173];return _0x1c598c;};'use strict';var _=require('lodash');var util=require(_0x0397('0x0'));var moment=require(_0x0397('0x1'));var BPromise=require(_0x0397('0x2'));var rs=require(_0x0397('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0397('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0397('0x5'))(_0x0397('0x6'));var config=require(_0x0397('0x7'));var jayson=require(_0x0397('0x8'));var client=jayson[_0x0397('0x9')]['http']({'port':0x232a});config['redis']=_[_0x0397('0xa')](config[_0x0397('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0397('0xb')]));require(_0x0397('0xc'))[_0x0397('0xd')](socket);function respondWithRpcPromise(_0x247cea,_0x62c6b6,_0x29c623){return new BPromise(function(_0x2c3bed,_0x566669){return client[_0x0397('0xe')](_0x247cea,_0x29c623)[_0x0397('0xf')](function(_0x1637af){logger[_0x0397('0x10')](_0x0397('0x11'),_0x62c6b6,'request\x20sent');logger['debug'](_0x0397('0x12'),_0x62c6b6,'request\x20sent',JSON[_0x0397('0x13')](_0x1637af));if(_0x1637af[_0x0397('0x14')]){if(_0x1637af[_0x0397('0x14')]['code']===0x1f4){logger[_0x0397('0x14')](_0x0397('0x11'),_0x62c6b6,_0x1637af[_0x0397('0x14')][_0x0397('0x15')]);return _0x566669(_0x1637af[_0x0397('0x14')][_0x0397('0x15')]);}logger['error']('MailQueue,\x20%s,\x20%s',_0x62c6b6,_0x1637af[_0x0397('0x14')][_0x0397('0x15')]);return _0x2c3bed(_0x1637af['error'][_0x0397('0x15')]);}else{logger['info'](_0x0397('0x11'),_0x62c6b6,_0x0397('0x16'));_0x2c3bed(_0x1637af[_0x0397('0x17')][_0x0397('0x15')]);}})[_0x0397('0x18')](function(_0x48281a){logger[_0x0397('0x14')](_0x0397('0x11'),_0x62c6b6,_0x48281a);_0x566669(_0x48281a);});});}exports[_0x0397('0x19')]=function(_0x1f6dcf){var _0x2125b6=this;return new Promise(function(_0x4ea5e8,_0x270abb){return db[_0x0397('0x1a')][_0x0397('0x1b')]({'raw':_0x1f6dcf[_0x0397('0x1c')]?_0x1f6dcf['options'][_0x0397('0x1d')]===undefined?!![]:![]:!![],'where':_0x1f6dcf[_0x0397('0x1c')]?_0x1f6dcf[_0x0397('0x1c')][_0x0397('0x1e')]||null:null,'attributes':_0x1f6dcf[_0x0397('0x1c')]?_0x1f6dcf[_0x0397('0x1c')][_0x0397('0x1f')]||null:null,'limit':_0x1f6dcf[_0x0397('0x1c')]?_0x1f6dcf['options']['limit']||null:null,'include':_0x1f6dcf[_0x0397('0x1c')]?_0x1f6dcf[_0x0397('0x1c')][_0x0397('0x20')]?_[_0x0397('0x21')](_0x1f6dcf[_0x0397('0x1c')][_0x0397('0x20')],function(_0x4d6178){return{'model':db[_0x4d6178[_0x0397('0x22')]],'as':_0x4d6178['as'],'attributes':_0x4d6178[_0x0397('0x1f')],'include':_0x4d6178['include']?_['map'](_0x4d6178['include'],function(_0x26f041){return{'model':db[_0x26f041[_0x0397('0x22')]],'as':_0x26f041['as'],'attributes':_0x26f041[_0x0397('0x1f')],'include':_0x26f041[_0x0397('0x20')]?_[_0x0397('0x21')](_0x26f041[_0x0397('0x20')],function(_0x464cf2){return{'model':db[_0x464cf2['model']],'as':_0x464cf2['as'],'attributes':_0x464cf2[_0x0397('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0397('0xf')](function(_0x38a356){logger[_0x0397('0x10')](_0x0397('0x19'),_0x1f6dcf);logger[_0x0397('0x23')]('GetMailQueue',_0x1f6dcf,JSON['stringify'](_0x38a356));_0x4ea5e8(_0x38a356);})[_0x0397('0x18')](function(_0x478734){logger[_0x0397('0x14')]('GetMailQueue',_0x478734[_0x0397('0x15')],_0x1f6dcf);_0x270abb(_0x2125b6['error'](0x1f4,_0x478734[_0x0397('0x15')]));});});};exports['ShowMailQueue']=function(_0xc88a53){var _0x366183=this;return new Promise(function(_0x24cea2,_0x20d819){return db[_0x0397('0x1a')][_0x0397('0x24')]({'raw':_0xc88a53['options']?_0xc88a53[_0x0397('0x1c')][_0x0397('0x1d')]===undefined?!![]:![]:!![],'where':_0xc88a53[_0x0397('0x1c')]?_0xc88a53[_0x0397('0x1c')][_0x0397('0x1e')]||null:null,'attributes':_0xc88a53[_0x0397('0x1c')]?_0xc88a53[_0x0397('0x1c')][_0x0397('0x1f')]||null:null,'include':_0xc88a53[_0x0397('0x1c')]?_0xc88a53['options']['include']?_[_0x0397('0x21')](_0xc88a53[_0x0397('0x1c')][_0x0397('0x20')],function(_0x9ec0f2){return{'model':db[_0x9ec0f2[_0x0397('0x22')]],'as':_0x9ec0f2['as'],'attributes':_0x9ec0f2[_0x0397('0x1f')],'include':_0x9ec0f2['include']?_['map'](_0x9ec0f2[_0x0397('0x20')],function(_0x476651){return{'model':db[_0x476651[_0x0397('0x22')]],'as':_0x476651['as'],'attributes':_0x476651[_0x0397('0x1f')],'include':_0x476651[_0x0397('0x20')]?_[_0x0397('0x21')](_0x476651[_0x0397('0x20')],function(_0xb6be59){return{'model':db[_0xb6be59[_0x0397('0x22')]],'as':_0xb6be59['as'],'attributes':_0xb6be59[_0x0397('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x0397('0xf')](function(_0x1e0cce){logger[_0x0397('0x10')](_0x0397('0x25'),_0xc88a53);logger[_0x0397('0x23')](_0x0397('0x25'),_0xc88a53,JSON['stringify'](_0x1e0cce));_0x24cea2(_0x1e0cce);})[_0x0397('0x18')](function(_0x18ea98){logger[_0x0397('0x14')](_0x0397('0x25'),_0x18ea98['message'],_0xc88a53);_0x20d819(_0x366183[_0x0397('0x14')](0x1f4,_0x18ea98[_0x0397('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 12a166b..221721c 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 _0x72e3=['register','length','mailQueue:','removeListener'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x72e3,0x10f));var _0x372e=function(_0x4d5ba4,_0x20a754){_0x4d5ba4=_0x4d5ba4-0x0;var _0x5009d7=_0x72e3[_0x4d5ba4];return _0x5009d7;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=['save','remove','update'];function createListener(_0x2d40d2,_0x35dcfc){return function(_0x22e97f){_0x35dcfc['emit'](_0x2d40d2,_0x22e97f);};}function removeListener(_0x582a7d,_0x269f27){return function(){MailQueueEvents[_0x372e('0x0')](_0x582a7d,_0x269f27);};}exports[_0x372e('0x1')]=function(_0x203ca0){for(var _0x514925=0x0,_0x19f16d=events[_0x372e('0x2')];_0x514925<_0x19f16d;_0x514925++){var _0x5a06c1=events[_0x514925];var _0x10ce39=createListener(_0x372e('0x3')+_0x5a06c1,_0x203ca0);MailQueueEvents['on'](_0x5a06c1,_0x10ce39);}}; \ No newline at end of file +var _0x26ef=['remove','update','emit','removeListener','mailQueue:','save'];(function(_0x42e4f7,_0x1a7bc0){var _0x5dd299=function(_0x1823fb){while(--_0x1823fb){_0x42e4f7['push'](_0x42e4f7['shift']());}};_0x5dd299(++_0x1a7bc0);}(_0x26ef,0x14f));var _0xf26e=function(_0x3b362b,_0x32e37c){_0x3b362b=_0x3b362b-0x0;var _0x50a7d4=_0x26ef[_0x3b362b];return _0x50a7d4;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0xf26e('0x0'),_0xf26e('0x1'),_0xf26e('0x2')];function createListener(_0x5be42c,_0x21b014){return function(_0x39a546){_0x21b014[_0xf26e('0x3')](_0x5be42c,_0x39a546);};}function removeListener(_0xc00ba3,_0x3d0600){return function(){MailQueueEvents[_0xf26e('0x4')](_0xc00ba3,_0x3d0600);};}exports['register']=function(_0x16d0b0){for(var _0x4557e0=0x0,_0x276673=events['length'];_0x4557e0<_0x276673;_0x4557e0++){var _0x4e1e04=events[_0x4557e0];var _0x38b0a6=createListener(_0xf26e('0x5')+_0x4e1e04,_0x16d0b0);MailQueueEvents['on'](_0x4e1e04,_0x38b0a6);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index 63bf361..e3c7562 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 _0x89f0=['Router','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x46a267,_0x4b360a){var _0x38c48a=function(_0x441c2c){while(--_0x441c2c){_0x46a267['push'](_0x46a267['shift']());}};_0x38c48a(++_0x4b360a);}(_0x89f0,0x163));var _0x089f=function(_0x831359,_0x78619d){_0x831359=_0x831359-0x0;var _0xf3dc25=_0x89f0[_0x831359];return _0xf3dc25;};'use strict';var multer=require(_0x089f('0x0'));var util=require(_0x089f('0x1'));var path=require(_0x089f('0x2'));var timeout=require(_0x089f('0x3'));var express=require(_0x089f('0x4'));var router=express[_0x089f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x089f('0x6'));var config=require(_0x089f('0x7'));var controller=require(_0x089f('0x8'));router[_0x089f('0x9')]('/',auth[_0x089f('0xa')](),controller[_0x089f('0xb')]);router[_0x089f('0x9')](_0x089f('0xc'),auth[_0x089f('0xa')](),controller[_0x089f('0xd')]);router['get']('/:id',auth[_0x089f('0xa')](),controller['show']);router[_0x089f('0xe')]('/',auth[_0x089f('0xa')](),controller[_0x089f('0xf')]);router[_0x089f('0x10')](_0x089f('0x11'),auth[_0x089f('0xa')](),controller['update']);router[_0x089f('0x12')](_0x089f('0x11'),auth[_0x089f('0xa')](),controller[_0x089f('0x13')]);module['exports']=router; \ No newline at end of file +var _0x48ef=['update','delete','exports','multer','util','path','express','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put'];(function(_0x1abd00,_0x37fcde){var _0x2424d3=function(_0x508d8b){while(--_0x508d8b){_0x1abd00['push'](_0x1abd00['shift']());}};_0x2424d3(++_0x37fcde);}(_0x48ef,0x1bb));var _0xf48e=function(_0x4b4889,_0x41cc03){_0x4b4889=_0x4b4889-0x0;var _0x38aac9=_0x48ef[_0x4b4889];return _0x38aac9;};'use strict';var multer=require(_0xf48e('0x0'));var util=require(_0xf48e('0x1'));var path=require(_0xf48e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf48e('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xf48e('0x4'));var config=require(_0xf48e('0x5'));var controller=require(_0xf48e('0x6'));router['get']('/',auth[_0xf48e('0x7')](),controller[_0xf48e('0x8')]);router[_0xf48e('0x9')](_0xf48e('0xa'),auth['isAuthenticated'](),controller[_0xf48e('0xb')]);router[_0xf48e('0x9')](_0xf48e('0xc'),auth[_0xf48e('0x7')](),controller[_0xf48e('0xd')]);router[_0xf48e('0xe')]('/',auth['isAuthenticated'](),controller[_0xf48e('0xf')]);router[_0xf48e('0x10')](_0xf48e('0xc'),auth['isAuthenticated'](),controller[_0xf48e('0x11')]);router[_0xf48e('0x12')](_0xf48e('0xc'),auth[_0xf48e('0x7')](),controller['destroy']);module[_0xf48e('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index b241586..abdf7fd 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 _0x764b=['STRING','DATE','moment','sequelize','exports'];(function(_0x19d2d7,_0x2af098){var _0x45377c=function(_0x3f29de){while(--_0x3f29de){_0x19d2d7['push'](_0x19d2d7['shift']());}};_0x45377c(++_0x2af098);}(_0x764b,0x16f));var _0xb764=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x764b[_0x4e676e];return _0x336a3c;};'use strict';var moment=require(_0xb764('0x0'));var Sequelize=require(_0xb764('0x1'));module[_0xb764('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xb764('0x3')]},'joinAt':{'type':Sequelize[_0xb764('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xb764('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xb764('0x3')]}}; \ No newline at end of file +var _0xce01=['STRING','DATE','sequelize'];(function(_0x3a0e32,_0xcc688){var _0x22cda1=function(_0x251c63){while(--_0x251c63){_0x3a0e32['push'](_0x3a0e32['shift']());}};_0x22cda1(++_0xcc688);}(_0xce01,0x113));var _0x1ce0=function(_0x1ba288,_0x4e88ef){_0x1ba288=_0x1ba288-0x0;var _0x2fdf5c=_0xce01[_0x1ba288];return _0x2fdf5c;};'use strict';var moment=require('moment');var Sequelize=require(_0x1ce0('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x1ce0('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x1ce0('0x1')]},'joinAt':{'type':Sequelize[_0x1ce0('0x2')]},'leaveAt':{'type':Sequelize[_0x1ce0('0x2')]},'acceptAt':{'type':Sequelize[_0x1ce0('0x2')]},'exitAt':{'type':Sequelize[_0x1ce0('0x2')]},'reason':{'type':Sequelize[_0x1ce0('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index a1fbda8..38d3397 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 _0xf434=['where','filters','pick','merge','VIRTUAL','count','includeAll','findAll','catch','params','include','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','update','then','destroy','stack','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xf434,0x134));var _0x4f43=function(_0x571e64,_0x436082){_0x571e64=_0x571e64-0x0;var _0xa3042f=_0xf434[_0x571e64];return _0xa3042f;};'use strict';var pdf=require(_0x4f43('0x0'));var emlformat=require(_0x4f43('0x1'));var rimraf=require(_0x4f43('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f43('0x3'));var rp=require(_0x4f43('0x4'));var moment=require(_0x4f43('0x5'));var BPromise=require(_0x4f43('0x6'));var Mustache=require(_0x4f43('0x7'));var util=require(_0x4f43('0x8'));var path=require(_0x4f43('0x9'));var sox=require(_0x4f43('0xa'));var csv=require(_0x4f43('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f43('0xc'));var squel=require(_0x4f43('0xd'));var crypto=require(_0x4f43('0xe'));var jsforce=require(_0x4f43('0xf'));var deskjs=require(_0x4f43('0x10'));var toCsv=require(_0x4f43('0xb'));var querystring=require('querystring');var Papa=require(_0x4f43('0x11'));var Redis=require('ioredis');var authService=require(_0x4f43('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4f43('0x13'));var hardwareService=require(_0x4f43('0x14'));var logger=require(_0x4f43('0x15'))(_0x4f43('0x16'));var utils=require(_0x4f43('0x17'));var config=require(_0x4f43('0x18'));var db=require(_0x4f43('0x19'))['db'];function respondWithStatusCode(_0xee076b,_0x46d869){_0x46d869=_0x46d869||0xcc;return function(_0xd0613b){if(_0xd0613b){return _0xee076b[_0x4f43('0x1a')](_0x46d869);}return _0xee076b[_0x4f43('0x1b')](_0x46d869)[_0x4f43('0x1c')]();};}function respondWithResult(_0x5ecb68,_0x465251){_0x465251=_0x465251||0xc8;return function(_0x37c059){if(_0x37c059){return _0x5ecb68[_0x4f43('0x1b')](_0x465251)[_0x4f43('0x1d')](_0x37c059);}};}function respondWithFilteredResult(_0x44f95d,_0x3e5dc5){return function(_0x7e023b){if(_0x7e023b){var _0x571752=_0x7e023b['count'],_0xa72022=_0x3e5dc5[_0x4f43('0x1e')],_0x4338c0=_0x3e5dc5[_0x4f43('0x1e')]+_0x3e5dc5[_0x4f43('0x1f')],_0x2d9b7d;if(_0x4338c0>=_0x571752){_0x4338c0=_0x571752;_0x2d9b7d=0xc8;}else{_0x2d9b7d=0xce;}_0x44f95d[_0x4f43('0x1b')](_0x2d9b7d);return _0x44f95d[_0x4f43('0x20')](_0x4f43('0x21'),_0xa72022+'-'+_0x4338c0+'/'+_0x571752)['json'](_0x7e023b);}return null;};}function patchUpdates(_0x26486a){return function(_0xced1a8){try{jsonpatch[_0x4f43('0x22')](_0xced1a8,_0x26486a,!![]);}catch(_0x35767b){return BPromise['reject'](_0x35767b);}return _0xced1a8['save']();};}function saveUpdates(_0x16f21d,_0x14b51d){return function(_0x2c3a97){if(_0x2c3a97){return _0x2c3a97[_0x4f43('0x23')](_0x16f21d)[_0x4f43('0x24')](function(_0xc88130){return _0xc88130;});}return null;};}function removeEntity(_0x587510,_0x5b6564){return function(_0x50d323){if(_0x50d323){return _0x50d323[_0x4f43('0x25')]()[_0x4f43('0x24')](function(){_0x587510[_0x4f43('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1303fe,_0x434dd8){return function(_0x17c7d9){if(!_0x17c7d9){_0x1303fe[_0x4f43('0x1a')](0x194);}return _0x17c7d9;};}function handleError(_0x2c0371,_0x2eb070){_0x2eb070=_0x2eb070||0x1f4;return function(_0x550574){logger['error'](_0x550574[_0x4f43('0x26')]);if(_0x550574['name']){delete _0x550574['name'];}_0x2c0371[_0x4f43('0x1b')](_0x2eb070)[_0x4f43('0x27')](_0x550574);};}exports[_0x4f43('0x28')]=function(_0x59e766,_0xb3bda4){var _0x3a4c41={},_0x162218={},_0x228dd1={'count':0x0,'rows':[]};var _0x60a25=_[_0x4f43('0x29')](db[_0x4f43('0x2a')][_0x4f43('0x2b')],function(_0x1bd6df){return{'name':_0x1bd6df[_0x4f43('0x2c')],'type':_0x1bd6df[_0x4f43('0x2d')][_0x4f43('0x2e')]};});_0x162218[_0x4f43('0x2f')]=_[_0x4f43('0x29')](_0x60a25,'name');_0x162218[_0x4f43('0x30')]=_[_0x4f43('0x31')](_0x59e766[_0x4f43('0x30')]);_0x162218['filters']=_[_0x4f43('0x32')](_0x162218[_0x4f43('0x2f')],_0x162218[_0x4f43('0x30')]);_0x3a4c41[_0x4f43('0x33')]=_['intersection'](_0x162218[_0x4f43('0x2f')],qs[_0x4f43('0x34')](_0x59e766[_0x4f43('0x30')][_0x4f43('0x34')]));_0x3a4c41[_0x4f43('0x33')]=_0x3a4c41['attributes'][_0x4f43('0x35')]?_0x3a4c41[_0x4f43('0x33')]:_0x162218['model'];if(!_0x59e766[_0x4f43('0x30')][_0x4f43('0x36')]('nolimit')){_0x3a4c41[_0x4f43('0x1f')]=qs[_0x4f43('0x1f')](_0x59e766['query'][_0x4f43('0x1f')]);_0x3a4c41[_0x4f43('0x1e')]=qs[_0x4f43('0x1e')](_0x59e766['query'][_0x4f43('0x1e')]);}_0x3a4c41[_0x4f43('0x37')]=qs[_0x4f43('0x38')](_0x59e766[_0x4f43('0x30')][_0x4f43('0x38')]);_0x3a4c41[_0x4f43('0x39')]=qs[_0x4f43('0x3a')](_[_0x4f43('0x3b')](_0x59e766[_0x4f43('0x30')],_0x162218[_0x4f43('0x3a')]));if(_0x59e766[_0x4f43('0x30')]['filter']){_0x3a4c41[_0x4f43('0x39')]=_[_0x4f43('0x3c')](_0x3a4c41[_0x4f43('0x39')],{'$or':_[_0x4f43('0x29')](_0x60a25,function(_0x335260){if(_0x335260['type']!==_0x4f43('0x3d')){var _0x479186={};_0x479186[_0x335260['name']]={'$like':'%'+_0x59e766['query']['filter']+'%'};return _0x479186;}})});}_0x3a4c41=_[_0x4f43('0x3c')]({},_0x3a4c41,_0x59e766['options']);var _0x1062b8={'where':_0x3a4c41[_0x4f43('0x39')]};return db[_0x4f43('0x2a')][_0x4f43('0x3e')](_0x1062b8)[_0x4f43('0x24')](function(_0x53fbc3){_0x228dd1['count']=_0x53fbc3;if(_0x59e766[_0x4f43('0x30')][_0x4f43('0x3f')]){_0x3a4c41['include']=[{'all':!![]}];}return db[_0x4f43('0x2a')][_0x4f43('0x40')](_0x3a4c41);})[_0x4f43('0x24')](function(_0x387d8b){_0x228dd1['rows']=_0x387d8b;return _0x228dd1;})[_0x4f43('0x24')](respondWithFilteredResult(_0xb3bda4,_0x3a4c41))[_0x4f43('0x41')](handleError(_0xb3bda4,null));};exports['show']=function(_0x3cc347,_0x36c7f9){var _0x5d57db={'raw':!![],'where':{'id':_0x3cc347[_0x4f43('0x42')]['id']}},_0x441fbe={};_0x441fbe['model']=_['keys'](db[_0x4f43('0x2a')][_0x4f43('0x2b')]);_0x441fbe[_0x4f43('0x30')]=_['keys'](_0x3cc347[_0x4f43('0x30')]);_0x441fbe['filters']=_['intersection'](_0x441fbe[_0x4f43('0x2f')],_0x441fbe[_0x4f43('0x30')]);_0x5d57db[_0x4f43('0x33')]=_[_0x4f43('0x32')](_0x441fbe[_0x4f43('0x2f')],qs['fields'](_0x3cc347['query'][_0x4f43('0x34')]));_0x5d57db[_0x4f43('0x33')]=_0x5d57db[_0x4f43('0x33')][_0x4f43('0x35')]?_0x5d57db['attributes']:_0x441fbe['model'];if(_0x3cc347[_0x4f43('0x30')][_0x4f43('0x3f')]){_0x5d57db[_0x4f43('0x43')]=[{'all':!![]}];}_0x5d57db=_[_0x4f43('0x3c')]({},_0x5d57db,_0x3cc347[_0x4f43('0x44')]);return db[_0x4f43('0x2a')][_0x4f43('0x45')](_0x5d57db)[_0x4f43('0x24')](handleEntityNotFound(_0x36c7f9,null))['then'](respondWithResult(_0x36c7f9,null))[_0x4f43('0x41')](handleError(_0x36c7f9,null));};exports[_0x4f43('0x46')]=function(_0x309a4e,_0x2cf3f8){return db['MailQueueReport']['create'](_0x309a4e[_0x4f43('0x47')],{})[_0x4f43('0x24')](respondWithResult(_0x2cf3f8,0xc9))[_0x4f43('0x41')](handleError(_0x2cf3f8,null));};exports['update']=function(_0x53d762,_0x2cba59){if(_0x53d762[_0x4f43('0x47')]['id']){delete _0x53d762[_0x4f43('0x47')]['id'];}return db['MailQueueReport'][_0x4f43('0x45')]({'where':{'id':_0x53d762[_0x4f43('0x42')]['id']}})[_0x4f43('0x24')](handleEntityNotFound(_0x2cba59,null))[_0x4f43('0x24')](saveUpdates(_0x53d762['body'],null))[_0x4f43('0x24')](respondWithResult(_0x2cba59,null))[_0x4f43('0x41')](handleError(_0x2cba59,null));};exports['destroy']=function(_0x40fe0c,_0x4ed22b){return db['MailQueueReport'][_0x4f43('0x45')]({'where':{'id':_0x40fe0c[_0x4f43('0x42')]['id']}})['then'](handleEntityNotFound(_0x4ed22b,null))[_0x4f43('0x24')](removeEntity(_0x4ed22b,null))[_0x4f43('0x41')](handleError(_0x4ed22b,null));};exports['describe']=function(_0x407ecc,_0x41cfe7){return db[_0x4f43('0x2a')][_0x4f43('0x48')]()[_0x4f43('0x24')](respondWithResult(_0x41cfe7,null))[_0x4f43('0x41')](handleError(_0x41cfe7,null));}; \ No newline at end of file +var _0xa76d=['create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','sendStatus','error','name','send','index','MailQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','options','includeAll','include','catch','show','params','find'];(function(_0x5f2e4e,_0x30bf78){var _0x17689b=function(_0x416ebf){while(--_0x416ebf){_0x5f2e4e['push'](_0x5f2e4e['shift']());}};_0x17689b(++_0x30bf78);}(_0xa76d,0x1ed));var _0xda76=function(_0x2dd503,_0x337a2c){_0x2dd503=_0x2dd503-0x0;var _0x118687=_0xa76d[_0x2dd503];return _0x118687;};'use strict';var pdf=require(_0xda76('0x0'));var emlformat=require(_0xda76('0x1'));var rimraf=require(_0xda76('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xda76('0x3'));var rp=require(_0xda76('0x4'));var moment=require('moment');var BPromise=require(_0xda76('0x5'));var Mustache=require(_0xda76('0x6'));var util=require('util');var path=require(_0xda76('0x7'));var sox=require('sox');var csv=require(_0xda76('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xda76('0x9'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xda76('0xa'));var Papa=require('papaparse');var Redis=require(_0xda76('0xb'));var authService=require(_0xda76('0xc'));var qs=require(_0xda76('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xda76('0xe'));var logger=require(_0xda76('0xf'))(_0xda76('0x10'));var utils=require(_0xda76('0x11'));var config=require(_0xda76('0x12'));var db=require(_0xda76('0x13'))['db'];function respondWithStatusCode(_0x3d941a,_0x4e767e){_0x4e767e=_0x4e767e||0xcc;return function(_0x3cd941){if(_0x3cd941){return _0x3d941a['sendStatus'](_0x4e767e);}return _0x3d941a['status'](_0x4e767e)[_0xda76('0x14')]();};}function respondWithResult(_0x482ea3,_0x360cec){_0x360cec=_0x360cec||0xc8;return function(_0x533bf7){if(_0x533bf7){return _0x482ea3[_0xda76('0x15')](_0x360cec)[_0xda76('0x16')](_0x533bf7);}};}function respondWithFilteredResult(_0x1ebc7c,_0x37b80a){return function(_0x113510){if(_0x113510){var _0x13c9d8=_0x113510[_0xda76('0x17')],_0xfc924e=_0x37b80a[_0xda76('0x18')],_0x17b125=_0x37b80a[_0xda76('0x18')]+_0x37b80a['limit'],_0x5c944f;if(_0x17b125>=_0x13c9d8){_0x17b125=_0x13c9d8;_0x5c944f=0xc8;}else{_0x5c944f=0xce;}_0x1ebc7c[_0xda76('0x15')](_0x5c944f);return _0x1ebc7c[_0xda76('0x19')](_0xda76('0x1a'),_0xfc924e+'-'+_0x17b125+'/'+_0x13c9d8)['json'](_0x113510);}return null;};}function patchUpdates(_0x233f6d){return function(_0x4153b2){try{jsonpatch['apply'](_0x4153b2,_0x233f6d,!![]);}catch(_0x2ef724){return BPromise[_0xda76('0x1b')](_0x2ef724);}return _0x4153b2[_0xda76('0x1c')]();};}function saveUpdates(_0x3a4a4e,_0x2b64cd){return function(_0x42a455){if(_0x42a455){return _0x42a455[_0xda76('0x1d')](_0x3a4a4e)[_0xda76('0x1e')](function(_0x28ca20){return _0x28ca20;});}return null;};}function removeEntity(_0x3e9f4b,_0x4e4482){return function(_0x15a7b6){if(_0x15a7b6){return _0x15a7b6[_0xda76('0x1f')]()[_0xda76('0x1e')](function(){_0x3e9f4b[_0xda76('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x33654d,_0x56e461){return function(_0x4a2e6b){if(!_0x4a2e6b){_0x33654d[_0xda76('0x20')](0x194);}return _0x4a2e6b;};}function handleError(_0x57e235,_0xd96742){_0xd96742=_0xd96742||0x1f4;return function(_0x54fbd1){logger[_0xda76('0x21')](_0x54fbd1['stack']);if(_0x54fbd1['name']){delete _0x54fbd1[_0xda76('0x22')];}_0x57e235[_0xda76('0x15')](_0xd96742)[_0xda76('0x23')](_0x54fbd1);};}exports[_0xda76('0x24')]=function(_0x4249b0,_0x124c6e){var _0x485dd1={},_0x5cb1f2={},_0x58c1ce={'count':0x0,'rows':[]};var _0x4f1c32=_['map'](db[_0xda76('0x25')][_0xda76('0x26')],function(_0xa9c2d6){return{'name':_0xa9c2d6[_0xda76('0x27')],'type':_0xa9c2d6['type'][_0xda76('0x28')]};});_0x5cb1f2[_0xda76('0x29')]=_[_0xda76('0x2a')](_0x4f1c32,_0xda76('0x22'));_0x5cb1f2[_0xda76('0x2b')]=_[_0xda76('0x2c')](_0x4249b0[_0xda76('0x2b')]);_0x5cb1f2[_0xda76('0x2d')]=_[_0xda76('0x2e')](_0x5cb1f2[_0xda76('0x29')],_0x5cb1f2[_0xda76('0x2b')]);_0x485dd1[_0xda76('0x2f')]=_['intersection'](_0x5cb1f2[_0xda76('0x29')],qs[_0xda76('0x30')](_0x4249b0[_0xda76('0x2b')]['fields']));_0x485dd1[_0xda76('0x2f')]=_0x485dd1[_0xda76('0x2f')][_0xda76('0x31')]?_0x485dd1[_0xda76('0x2f')]:_0x5cb1f2['model'];if(!_0x4249b0[_0xda76('0x2b')][_0xda76('0x32')]('nolimit')){_0x485dd1[_0xda76('0x33')]=qs[_0xda76('0x33')](_0x4249b0[_0xda76('0x2b')][_0xda76('0x33')]);_0x485dd1[_0xda76('0x18')]=qs[_0xda76('0x18')](_0x4249b0[_0xda76('0x2b')][_0xda76('0x18')]);}_0x485dd1[_0xda76('0x34')]=qs[_0xda76('0x35')](_0x4249b0[_0xda76('0x2b')][_0xda76('0x35')]);_0x485dd1[_0xda76('0x36')]=qs['filters'](_[_0xda76('0x37')](_0x4249b0[_0xda76('0x2b')],_0x5cb1f2[_0xda76('0x2d')]));if(_0x4249b0['query'][_0xda76('0x38')]){_0x485dd1[_0xda76('0x36')]=_['merge'](_0x485dd1[_0xda76('0x36')],{'$or':_[_0xda76('0x2a')](_0x4f1c32,function(_0x6fada4){if(_0x6fada4[_0xda76('0x39')]!==_0xda76('0x3a')){var _0x186d58={};_0x186d58[_0x6fada4['name']]={'$like':'%'+_0x4249b0['query'][_0xda76('0x38')]+'%'};return _0x186d58;}})});}_0x485dd1=_[_0xda76('0x3b')]({},_0x485dd1,_0x4249b0[_0xda76('0x3c')]);var _0x50133f={'where':_0x485dd1['where']};return db[_0xda76('0x25')]['count'](_0x50133f)['then'](function(_0x32431f){_0x58c1ce['count']=_0x32431f;if(_0x4249b0[_0xda76('0x2b')][_0xda76('0x3d')]){_0x485dd1[_0xda76('0x3e')]=[{'all':!![]}];}return db[_0xda76('0x25')]['findAll'](_0x485dd1);})[_0xda76('0x1e')](function(_0x46823e){_0x58c1ce['rows']=_0x46823e;return _0x58c1ce;})['then'](respondWithFilteredResult(_0x124c6e,_0x485dd1))[_0xda76('0x3f')](handleError(_0x124c6e,null));};exports[_0xda76('0x40')]=function(_0x4c3c08,_0x38d4d0){var _0xaeca23={'raw':!![],'where':{'id':_0x4c3c08[_0xda76('0x41')]['id']}},_0x5444bc={};_0x5444bc[_0xda76('0x29')]=_[_0xda76('0x2c')](db[_0xda76('0x25')][_0xda76('0x26')]);_0x5444bc[_0xda76('0x2b')]=_[_0xda76('0x2c')](_0x4c3c08[_0xda76('0x2b')]);_0x5444bc[_0xda76('0x2d')]=_[_0xda76('0x2e')](_0x5444bc[_0xda76('0x29')],_0x5444bc[_0xda76('0x2b')]);_0xaeca23[_0xda76('0x2f')]=_[_0xda76('0x2e')](_0x5444bc['model'],qs[_0xda76('0x30')](_0x4c3c08[_0xda76('0x2b')][_0xda76('0x30')]));_0xaeca23[_0xda76('0x2f')]=_0xaeca23[_0xda76('0x2f')]['length']?_0xaeca23['attributes']:_0x5444bc['model'];if(_0x4c3c08[_0xda76('0x2b')][_0xda76('0x3d')]){_0xaeca23[_0xda76('0x3e')]=[{'all':!![]}];}_0xaeca23=_['merge']({},_0xaeca23,_0x4c3c08[_0xda76('0x3c')]);return db[_0xda76('0x25')][_0xda76('0x42')](_0xaeca23)[_0xda76('0x1e')](handleEntityNotFound(_0x38d4d0,null))[_0xda76('0x1e')](respondWithResult(_0x38d4d0,null))[_0xda76('0x3f')](handleError(_0x38d4d0,null));};exports[_0xda76('0x43')]=function(_0x408ee3,_0x5eb785){return db[_0xda76('0x25')]['create'](_0x408ee3[_0xda76('0x44')],{})[_0xda76('0x1e')](respondWithResult(_0x5eb785,0xc9))[_0xda76('0x3f')](handleError(_0x5eb785,null));};exports[_0xda76('0x1d')]=function(_0x317945,_0xd6e80a){if(_0x317945[_0xda76('0x44')]['id']){delete _0x317945[_0xda76('0x44')]['id'];}return db[_0xda76('0x25')][_0xda76('0x42')]({'where':{'id':_0x317945['params']['id']}})['then'](handleEntityNotFound(_0xd6e80a,null))[_0xda76('0x1e')](saveUpdates(_0x317945['body'],null))[_0xda76('0x1e')](respondWithResult(_0xd6e80a,null))[_0xda76('0x3f')](handleError(_0xd6e80a,null));};exports[_0xda76('0x1f')]=function(_0x27bf43,_0x171362){return db[_0xda76('0x25')][_0xda76('0x42')]({'where':{'id':_0x27bf43[_0xda76('0x41')]['id']}})['then'](handleEntityNotFound(_0x171362,null))[_0xda76('0x1e')](removeEntity(_0x171362,null))[_0xda76('0x3f')](handleError(_0x171362,null));};exports['describe']=function(_0x50361d,_0x7db531){return db[_0xda76('0x25')][_0xda76('0x45')]()[_0xda76('0x1e')](respondWithResult(_0x7db531,null))[_0xda76('0x3f')](handleError(_0x7db531,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 380b3fb..5a3f383 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 _0x38c5=['rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2b823d,_0x468562){var _0x13641e=function(_0x17db88){while(--_0x17db88){_0x2b823d['push'](_0x2b823d['shift']());}};_0x13641e(++_0x468562);}(_0x38c5,0x8f));var _0x538c=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x38c5[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x538c('0x0'));var util=require(_0x538c('0x1'));var logger=require('../../config/logger')(_0x538c('0x2'));var moment=require(_0x538c('0x3'));var BPromise=require(_0x538c('0x4'));var rp=require(_0x538c('0x5'));var fs=require('fs');var path=require(_0x538c('0x6'));var rimraf=require(_0x538c('0x7'));var config=require(_0x538c('0x8'));var attributes=require(_0x538c('0x9'));module[_0x538c('0xa')]=function(_0x16fbae,_0x1229c2){return _0x16fbae[_0x538c('0xb')](_0x538c('0xc'),attributes,{'tableName':_0x538c('0xd'),'paranoid':![],'indexes':[{'name':_0x538c('0xe'),'fields':[_0x538c('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xcd66=['path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x58254a,_0x126ea6){var _0x1f6e95=function(_0xc50fbd){while(--_0xc50fbd){_0x58254a['push'](_0x58254a['shift']());}};_0x1f6e95(++_0x126ea6);}(_0xcd66,0x166));var _0x6cd6=function(_0x255d4b,_0x50111c){_0x255d4b=_0x255d4b-0x0;var _0x2ce653=_0xcd66[_0x255d4b];return _0x2ce653;};'use strict';var _=require(_0x6cd6('0x0'));var util=require(_0x6cd6('0x1'));var logger=require(_0x6cd6('0x2'))('api');var moment=require(_0x6cd6('0x3'));var BPromise=require(_0x6cd6('0x4'));var rp=require(_0x6cd6('0x5'));var fs=require('fs');var path=require(_0x6cd6('0x6'));var rimraf=require(_0x6cd6('0x7'));var config=require(_0x6cd6('0x8'));var attributes=require(_0x6cd6('0x9'));module[_0x6cd6('0xa')]=function(_0x305e84,_0x20bb57){return _0x305e84['define'](_0x6cd6('0xb'),attributes,{'tableName':_0x6cd6('0xc'),'paranoid':![],'indexes':[{'name':_0x6cd6('0xd'),'fields':[_0x6cd6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index d37026c..9300e08 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 _0x7096=['then','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','body','options','raw','UpdateMailQueueReport','update','where','attributes','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x3730f8,_0x22c046){var _0x3efd4c=function(_0x270151){while(--_0x270151){_0x3730f8['push'](_0x3730f8['shift']());}};_0x3efd4c(++_0x22c046);}(_0x7096,0x10c));var _0x6709=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x7096[_0x55f8b4];return _0x2475f9;};'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});function respondWithRpcPromise(_0x3e2223,_0x11ad23,_0x985814){return new BPromise(function(_0x30147f,_0x513ab6){return client['request'](_0x3e2223,_0x985814)[_0x6709('0xb')](function(_0x2d8c0b){logger[_0x6709('0xc')](_0x6709('0xd'),_0x11ad23,_0x6709('0xe'));logger[_0x6709('0xf')]('MailQueueReport,\x20%s,\x20%s,\x20%s',_0x11ad23,'request\x20sent',JSON[_0x6709('0x10')](_0x2d8c0b));if(_0x2d8c0b[_0x6709('0x11')]){if(_0x2d8c0b[_0x6709('0x11')][_0x6709('0x12')]===0x1f4){logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')][_0x6709('0x13')]);return _0x513ab6(_0x2d8c0b['error'][_0x6709('0x13')]);}logger[_0x6709('0x11')](_0x6709('0xd'),_0x11ad23,_0x2d8c0b[_0x6709('0x11')]['message']);return _0x30147f(_0x2d8c0b[_0x6709('0x11')]['message']);}else{logger[_0x6709('0xc')]('MailQueueReport,\x20%s,\x20%s',_0x11ad23,_0x6709('0xe'));_0x30147f(_0x2d8c0b[_0x6709('0x14')][_0x6709('0x13')]);}})[_0x6709('0x15')](function(_0x4cab30){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x11ad23,_0x4cab30);_0x513ab6(_0x4cab30);});});}exports[_0x6709('0x16')]=function(_0x235a54){var _0x4a732e=this;return new Promise(function(_0x9c1fd8,_0x166c97){return db[_0x6709('0x17')]['create'](_0x235a54[_0x6709('0x18')],{'raw':_0x235a54[_0x6709('0x19')]?_0x235a54[_0x6709('0x19')][_0x6709('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x3c4971){logger[_0x6709('0xc')](_0x6709('0x16'),_0x235a54);logger[_0x6709('0xf')](_0x6709('0x16'),_0x235a54,JSON[_0x6709('0x10')](_0x3c4971));_0x9c1fd8(_0x3c4971);})[_0x6709('0x15')](function(_0x17763d){logger[_0x6709('0x11')](_0x6709('0x16'),_0x17763d[_0x6709('0x13')],_0x235a54);_0x166c97(_0x4a732e[_0x6709('0x11')](0x1f4,_0x17763d['message']));});});};exports[_0x6709('0x1b')]=function(_0x81138e){var _0x2bcc73=this;return new Promise(function(_0x5c7982,_0x2e3483){return db[_0x6709('0x17')][_0x6709('0x1c')](_0x81138e[_0x6709('0x18')],{'raw':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1d')]||null:null,'attributes':_0x81138e['options']?_0x81138e[_0x6709('0x19')][_0x6709('0x1e')]||null:null,'limit':_0x81138e['options']?_0x81138e[_0x6709('0x19')]['limit']||null:null})[_0x6709('0xb')](function(_0x3cd555){logger['info'](_0x6709('0x1b'),_0x81138e);logger['debug'](_0x6709('0x1b'),_0x81138e,JSON[_0x6709('0x10')](_0x3cd555));_0x5c7982(_0x3cd555);})['catch'](function(_0x1a9eea){logger['error'](_0x6709('0x1b'),_0x1a9eea[_0x6709('0x13')],_0x81138e);_0x2e3483(_0x2bcc73['error'](0x1f4,_0x1a9eea['message']));});});}; \ No newline at end of file +var _0xd8fb=['then','CreateMailQueueReport','stringify','UpdateMailQueueReport','update','body','where','limit','lodash','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','request\x20sent','catch','MailQueueReport','options','raw'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xd8fb,0x99));var _0xbd8f=function(_0x4582d4,_0x761f97){_0x4582d4=_0x4582d4-0x0;var _0x29f8a1=_0xd8fb[_0x4582d4];return _0x29f8a1;};'use strict';var _=require(_0xbd8f('0x0'));var util=require(_0xbd8f('0x1'));var moment=require(_0xbd8f('0x2'));var BPromise=require(_0xbd8f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xbd8f('0x4'));var logger=require(_0xbd8f('0x5'))('rpc');var config=require(_0xbd8f('0x6'));var jayson=require(_0xbd8f('0x7'));var client=jayson['client'][_0xbd8f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e97cf,_0xf503c4,_0x578499){return new BPromise(function(_0x197827,_0x403edc){return client['request'](_0x4e97cf,_0x578499)['then'](function(_0x3caa93){logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,'request\x20sent');logger[_0xbd8f('0xb')](_0xbd8f('0xc'),_0xf503c4,'request\x20sent',JSON['stringify'](_0x3caa93));if(_0x3caa93[_0xbd8f('0xd')]){if(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xe')]===0x1f4){logger['error'](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x403edc(_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);}logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x3caa93[_0xbd8f('0xd')][_0xbd8f('0xf')]);return _0x197827(_0x3caa93['error'][_0xbd8f('0xf')]);}else{logger[_0xbd8f('0x9')](_0xbd8f('0xa'),_0xf503c4,_0xbd8f('0x10'));_0x197827(_0x3caa93['result'][_0xbd8f('0xf')]);}})[_0xbd8f('0x11')](function(_0x5ebf8b){logger[_0xbd8f('0xd')](_0xbd8f('0xa'),_0xf503c4,_0x5ebf8b);_0x403edc(_0x5ebf8b);});});}exports['CreateMailQueueReport']=function(_0x4435b9){var _0x36a6af=this;return new Promise(function(_0x47d317,_0x5a572b){return db[_0xbd8f('0x12')]['create'](_0x4435b9['body'],{'raw':_0x4435b9[_0xbd8f('0x13')]?_0x4435b9['options'][_0xbd8f('0x14')]===undefined?!![]:![]:!![]})[_0xbd8f('0x15')](function(_0xb47c8e){logger[_0xbd8f('0x9')](_0xbd8f('0x16'),_0x4435b9);logger[_0xbd8f('0xb')](_0xbd8f('0x16'),_0x4435b9,JSON[_0xbd8f('0x17')](_0xb47c8e));_0x47d317(_0xb47c8e);})[_0xbd8f('0x11')](function(_0x775acc){logger[_0xbd8f('0xd')](_0xbd8f('0x16'),_0x775acc[_0xbd8f('0xf')],_0x4435b9);_0x5a572b(_0x36a6af[_0xbd8f('0xd')](0x1f4,_0x775acc[_0xbd8f('0xf')]));});});};exports[_0xbd8f('0x18')]=function(_0x395b1b){var _0x4ba8db=this;return new Promise(function(_0x359ead,_0x9fa3b1){return db[_0xbd8f('0x12')][_0xbd8f('0x19')](_0x395b1b[_0xbd8f('0x1a')],{'raw':_0x395b1b[_0xbd8f('0x13')]?_0x395b1b[_0xbd8f('0x13')][_0xbd8f('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x395b1b['options']?_0x395b1b[_0xbd8f('0x13')][_0xbd8f('0x1b')]||null:null,'attributes':_0x395b1b['options']?_0x395b1b[_0xbd8f('0x13')]['attributes']||null:null,'limit':_0x395b1b[_0xbd8f('0x13')]?_0x395b1b[_0xbd8f('0x13')][_0xbd8f('0x1c')]||null:null})[_0xbd8f('0x15')](function(_0x2aefa2){logger[_0xbd8f('0x9')]('UpdateMailQueueReport',_0x395b1b);logger[_0xbd8f('0xb')](_0xbd8f('0x18'),_0x395b1b,JSON[_0xbd8f('0x17')](_0x2aefa2));_0x359ead(_0x2aefa2);})[_0xbd8f('0x11')](function(_0x3d2e1b){logger[_0xbd8f('0xd')](_0xbd8f('0x18'),_0x3d2e1b['message'],_0x395b1b);_0x9fa3b1(_0x4ba8db[_0xbd8f('0xd')](0x1f4,_0x3d2e1b[_0xbd8f('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 811ed8d..574bb1f 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 _0x71fc=['exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x71fc,0x166));var _0xc71f=function(_0x2ee9bd,_0x2a920e){_0x2ee9bd=_0x2ee9bd-0x0;var _0x4f4849=_0x71fc[_0x2ee9bd];return _0x4f4849;};'use strict';var multer=require(_0xc71f('0x0'));var util=require(_0xc71f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc71f('0x2')]();var auth=require(_0xc71f('0x3'));var interaction=require(_0xc71f('0x4'));var config=require(_0xc71f('0x5'));module[_0xc71f('0x6')]=router; \ No newline at end of file +var _0x0fc4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','path','connect-timeout','express'];(function(_0x2119c3,_0x497123){var _0x3d9457=function(_0xe8e629){while(--_0xe8e629){_0x2119c3['push'](_0x2119c3['shift']());}};_0x3d9457(++_0x497123);}(_0x0fc4,0xc2));var _0x40fc=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x0fc4[_0x2d61b2];return _0x12df89;};'use strict';var multer=require(_0x40fc('0x0'));var util=require('util');var path=require(_0x40fc('0x1'));var timeout=require(_0x40fc('0x2'));var express=require(_0x40fc('0x3'));var router=express[_0x40fc('0x4')]();var auth=require(_0x40fc('0x5'));var interaction=require(_0x40fc('0x6'));var config=require(_0x40fc('0x7'));module[_0x40fc('0x8')]=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 7db8216..7e97090 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 _0xead1=['BOOLEAN','username','INTEGER','INBOX','sequelize','exports','STRING'];(function(_0x34f872,_0x21da70){var _0xbe8be1=function(_0x1f50c5){while(--_0x1f50c5){_0x34f872['push'](_0x34f872['shift']());}};_0xbe8be1(++_0x21da70);}(_0xead1,0x1d9));var _0x1ead=function(_0x4bb66f,_0x3cd682){_0x4bb66f=_0x4bb66f-0x0;var _0xf2772f=_0xead1[_0x4bb66f];return _0xf2772f;};'use strict';var Sequelize=require(_0x1ead('0x0'));module[_0x1ead('0x1')]={'description':{'type':Sequelize[_0x1ead('0x2')]},'host':{'type':Sequelize[_0x1ead('0x2')]},'authentication':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x1ead('0x2')],'unique':_0x1ead('0x4')},'password':{'type':Sequelize[_0x1ead('0x2')]},'port':{'type':Sequelize[_0x1ead('0x5')]},'tls':{'type':Sequelize[_0x1ead('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x1ead('0x2')],'defaultValue':_0x1ead('0x6')},'connTimeout':{'type':Sequelize[_0x1ead('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x1ead('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x1ead('0x2')]}}; \ No newline at end of file +var _0x375d=['INTEGER','sequelize','STRING','BOOLEAN'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x375d,0x17d));var _0xd375=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x375d[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xd375('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xd375('0x1')]},'authentication':{'type':Sequelize[_0xd375('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xd375('0x1')],'unique':'username'},'password':{'type':Sequelize[_0xd375('0x1')]},'port':{'type':Sequelize[_0xd375('0x3')]},'tls':{'type':Sequelize[_0xd375('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd375('0x1')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0xd375('0x3')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize[_0xd375('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index ff4b4f0..0d85b24 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 _0x5eb8=['request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in','../../config/logger','api','moment','bluebird'];(function(_0x455368,_0x2a7931){var _0x354cbe=function(_0xf0da75){while(--_0xf0da75){_0x455368['push'](_0x455368['shift']());}};_0x354cbe(++_0x2a7931);}(_0x5eb8,0xb0));var _0x85eb=function(_0x16337a,_0x4789a1){_0x16337a=_0x16337a-0x0;var _0x422365=_0x5eb8[_0x16337a];return _0x422365;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x85eb('0x0'))(_0x85eb('0x1'));var moment=require(_0x85eb('0x2'));var BPromise=require(_0x85eb('0x3'));var rp=require(_0x85eb('0x4'));var fs=require('fs');var path=require(_0x85eb('0x5'));var rimraf=require(_0x85eb('0x6'));var config=require(_0x85eb('0x7'));var attributes=require(_0x85eb('0x8'));module[_0x85eb('0x9')]=function(_0x2bf83c,_0x1ba1d8){return _0x2bf83c['define'](_0x85eb('0xa'),attributes,{'tableName':_0x85eb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3de3=['lodash','../../config/logger','api','bluebird','request-promise','path','rimraf','./mailServerIn.attributes','exports','MailServerIn','mail_servers_in'];(function(_0x3d5351,_0x27bc80){var _0x1db4db=function(_0x3f572b){while(--_0x3f572b){_0x3d5351['push'](_0x3d5351['shift']());}};_0x1db4db(++_0x27bc80);}(_0x3de3,0x1ce));var _0x33de=function(_0x171cd5,_0x104bb7){_0x171cd5=_0x171cd5-0x0;var _0x4aef32=_0x3de3[_0x171cd5];return _0x4aef32;};'use strict';var _=require(_0x33de('0x0'));var util=require('util');var logger=require(_0x33de('0x1'))(_0x33de('0x2'));var moment=require('moment');var BPromise=require(_0x33de('0x3'));var rp=require(_0x33de('0x4'));var fs=require('fs');var path=require(_0x33de('0x5'));var rimraf=require(_0x33de('0x6'));var config=require('../../config/environment');var attributes=require(_0x33de('0x7'));module[_0x33de('0x8')]=function(_0x558f98,_0x142716){return _0x558f98['define'](_0x33de('0x9'),attributes,{'tableName':_0x33de('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 956fdcc..6d17c7f 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 _0x1359=['then','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailServerIn','findAll','options','raw','where','limit','include','map','model','attributes'];(function(_0x289647,_0x14ba10){var _0x2bef4b=function(_0x5473ab){while(--_0x5473ab){_0x289647['push'](_0x289647['shift']());}};_0x2bef4b(++_0x14ba10);}(_0x1359,0x81));var _0x9135=function(_0x50d0da,_0x237e0c){_0x50d0da=_0x50d0da-0x0;var _0x17fe2a=_0x1359[_0x50d0da];return _0x17fe2a;};'use strict';var _=require(_0x9135('0x0'));var util=require(_0x9135('0x1'));var moment=require(_0x9135('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9135('0x3'))['db'];var utils=require(_0x9135('0x4'));var logger=require('../../config/logger')(_0x9135('0x5'));var config=require(_0x9135('0x6'));var jayson=require(_0x9135('0x7'));var client=jayson[_0x9135('0x8')][_0x9135('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5999b6,_0x2eb503,_0x2f1803){return new BPromise(function(_0x173f6d,_0x24e960){return client[_0x9135('0xa')](_0x5999b6,_0x2f1803)['then'](function(_0x4d4a88){logger[_0x9135('0xb')](_0x9135('0xc'),_0x2eb503,_0x9135('0xd'));logger[_0x9135('0xe')](_0x9135('0xf'),_0x2eb503,_0x9135('0xd'),JSON[_0x9135('0x10')](_0x4d4a88));if(_0x4d4a88[_0x9135('0x11')]){if(_0x4d4a88[_0x9135('0x11')]['code']===0x1f4){logger[_0x9135('0x11')](_0x9135('0xc'),_0x2eb503,_0x4d4a88['error'][_0x9135('0x12')]);return _0x24e960(_0x4d4a88[_0x9135('0x11')][_0x9135('0x12')]);}logger[_0x9135('0x11')](_0x9135('0xc'),_0x2eb503,_0x4d4a88[_0x9135('0x11')][_0x9135('0x12')]);return _0x173f6d(_0x4d4a88['error']['message']);}else{logger[_0x9135('0xb')](_0x9135('0xc'),_0x2eb503,_0x9135('0xd'));_0x173f6d(_0x4d4a88[_0x9135('0x13')][_0x9135('0x12')]);}})[_0x9135('0x14')](function(_0xe074bc){logger[_0x9135('0x11')](_0x9135('0xc'),_0x2eb503,_0xe074bc);_0x24e960(_0xe074bc);});});}exports[_0x9135('0x15')]=function(_0xb6ed24){var _0x1b3270=this;return new Promise(function(_0x1406de,_0x28d7c){return db['MailServerIn'][_0x9135('0x16')]({'raw':_0xb6ed24[_0x9135('0x17')]?_0xb6ed24[_0x9135('0x17')][_0x9135('0x18')]===undefined?!![]:![]:!![],'where':_0xb6ed24[_0x9135('0x17')]?_0xb6ed24[_0x9135('0x17')][_0x9135('0x19')]||null:null,'attributes':_0xb6ed24[_0x9135('0x17')]?_0xb6ed24[_0x9135('0x17')]['attributes']||null:null,'limit':_0xb6ed24[_0x9135('0x17')]?_0xb6ed24[_0x9135('0x17')][_0x9135('0x1a')]||null:null,'include':_0xb6ed24[_0x9135('0x17')]?_0xb6ed24[_0x9135('0x17')][_0x9135('0x1b')]?_[_0x9135('0x1c')](_0xb6ed24['options'][_0x9135('0x1b')],function(_0x22e0b6){return{'model':db[_0x22e0b6[_0x9135('0x1d')]],'as':_0x22e0b6['as'],'attributes':_0x22e0b6[_0x9135('0x1e')],'include':_0x22e0b6['include']?_['map'](_0x22e0b6['include'],function(_0x3d544b){return{'model':db[_0x3d544b[_0x9135('0x1d')]],'as':_0x3d544b['as'],'attributes':_0x3d544b[_0x9135('0x1e')],'include':_0x3d544b['include']?_['map'](_0x3d544b[_0x9135('0x1b')],function(_0xdd22a){return{'model':db[_0xdd22a['model']],'as':_0xdd22a['as'],'attributes':_0xdd22a['attributes']};}):[]};}):[]};}):[]:[]})[_0x9135('0x1f')](function(_0x4f4620){logger[_0x9135('0xb')](_0x9135('0x15'),_0xb6ed24);logger[_0x9135('0xe')]('GetMailServerIn',_0xb6ed24,JSON['stringify'](_0x4f4620));_0x1406de(_0x4f4620);})['catch'](function(_0x5e9ec0){logger['error'](_0x9135('0x15'),_0x5e9ec0['message'],_0xb6ed24);_0x28d7c(_0x1b3270['error'](0x1f4,_0x5e9ec0[_0x9135('0x12')]));});});}; \ No newline at end of file +var _0xee86=['moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','MailServerIn,\x20%s,\x20%s','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','GetMailServerIn','MailServerIn','options','attributes','limit','include','model','map','then','debug','lodash','util'];(function(_0x5e8b8d,_0x4d6a1a){var _0x520503=function(_0x268fc6){while(--_0x268fc6){_0x5e8b8d['push'](_0x5e8b8d['shift']());}};_0x520503(++_0x4d6a1a);}(_0xee86,0xee));var _0x6ee8=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xee86[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x6ee8('0x0'));var util=require(_0x6ee8('0x1'));var moment=require(_0x6ee8('0x2'));var BPromise=require(_0x6ee8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6ee8('0x4'))['db'];var utils=require(_0x6ee8('0x5'));var logger=require(_0x6ee8('0x6'))(_0x6ee8('0x7'));var config=require(_0x6ee8('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x6ee8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x460627,_0x10c9c9,_0x486d03){return new BPromise(function(_0x4bcbcb,_0x54c13d){return client[_0x6ee8('0xa')](_0x460627,_0x486d03)['then'](function(_0x32517a){logger['info'](_0x6ee8('0xb'),_0x10c9c9,'request\x20sent');logger['debug'](_0x6ee8('0xc'),_0x10c9c9,_0x6ee8('0xd'),JSON['stringify'](_0x32517a));if(_0x32517a[_0x6ee8('0xe')]){if(_0x32517a['error'][_0x6ee8('0xf')]===0x1f4){logger[_0x6ee8('0xe')](_0x6ee8('0xb'),_0x10c9c9,_0x32517a[_0x6ee8('0xe')][_0x6ee8('0x10')]);return _0x54c13d(_0x32517a['error'][_0x6ee8('0x10')]);}logger[_0x6ee8('0xe')](_0x6ee8('0xb'),_0x10c9c9,_0x32517a[_0x6ee8('0xe')][_0x6ee8('0x10')]);return _0x4bcbcb(_0x32517a[_0x6ee8('0xe')][_0x6ee8('0x10')]);}else{logger[_0x6ee8('0x11')](_0x6ee8('0xb'),_0x10c9c9,_0x6ee8('0xd'));_0x4bcbcb(_0x32517a[_0x6ee8('0x12')][_0x6ee8('0x10')]);}})[_0x6ee8('0x13')](function(_0x23f3b0){logger[_0x6ee8('0xe')]('MailServerIn,\x20%s,\x20%s',_0x10c9c9,_0x23f3b0);_0x54c13d(_0x23f3b0);});});}exports[_0x6ee8('0x14')]=function(_0x1c1f5e){var _0x24b705=this;return new Promise(function(_0xd65d9a,_0x59b1ac){return db[_0x6ee8('0x15')]['findAll']({'raw':_0x1c1f5e[_0x6ee8('0x16')]?_0x1c1f5e[_0x6ee8('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x1c1f5e['options']?_0x1c1f5e[_0x6ee8('0x16')]['where']||null:null,'attributes':_0x1c1f5e[_0x6ee8('0x16')]?_0x1c1f5e['options'][_0x6ee8('0x17')]||null:null,'limit':_0x1c1f5e[_0x6ee8('0x16')]?_0x1c1f5e[_0x6ee8('0x16')][_0x6ee8('0x18')]||null:null,'include':_0x1c1f5e[_0x6ee8('0x16')]?_0x1c1f5e[_0x6ee8('0x16')][_0x6ee8('0x19')]?_['map'](_0x1c1f5e[_0x6ee8('0x16')][_0x6ee8('0x19')],function(_0x7a1fc2){return{'model':db[_0x7a1fc2[_0x6ee8('0x1a')]],'as':_0x7a1fc2['as'],'attributes':_0x7a1fc2['attributes'],'include':_0x7a1fc2[_0x6ee8('0x19')]?_[_0x6ee8('0x1b')](_0x7a1fc2[_0x6ee8('0x19')],function(_0x3b776c){return{'model':db[_0x3b776c[_0x6ee8('0x1a')]],'as':_0x3b776c['as'],'attributes':_0x3b776c[_0x6ee8('0x17')],'include':_0x3b776c[_0x6ee8('0x19')]?_[_0x6ee8('0x1b')](_0x3b776c[_0x6ee8('0x19')],function(_0x4af526){return{'model':db[_0x4af526[_0x6ee8('0x1a')]],'as':_0x4af526['as'],'attributes':_0x4af526[_0x6ee8('0x17')]};}):[]};}):[]};}):[]:[]})[_0x6ee8('0x1c')](function(_0x73661f){logger[_0x6ee8('0x11')](_0x6ee8('0x14'),_0x1c1f5e);logger[_0x6ee8('0x1d')](_0x6ee8('0x14'),_0x1c1f5e,JSON['stringify'](_0x73661f));_0xd65d9a(_0x73661f);})['catch'](function(_0x4274ba){logger[_0x6ee8('0xe')](_0x6ee8('0x14'),_0x4274ba[_0x6ee8('0x10')],_0x1c1f5e);_0x59b1ac(_0x24b705[_0x6ee8('0xe')](0x1f4,_0x4274ba['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index a074e65..b2026f8 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 _0xc1a2=['create','put','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','get','isAuthenticated','/:id','show','post'];(function(_0x5c65ee,_0x57b017){var _0x4b8689=function(_0x57dc88){while(--_0x57dc88){_0x5c65ee['push'](_0x5c65ee['shift']());}};_0x4b8689(++_0x57b017);}(_0xc1a2,0x149));var _0x2c1a=function(_0x331c23,_0x4d736e){_0x331c23=_0x331c23-0x0;var _0x71e7f9=_0xc1a2[_0x331c23];return _0x71e7f9;};'use strict';var multer=require('multer');var util=require(_0x2c1a('0x0'));var path=require('path');var timeout=require(_0x2c1a('0x1'));var express=require(_0x2c1a('0x2'));var router=express[_0x2c1a('0x3')]();var auth=require(_0x2c1a('0x4'));var interaction=require(_0x2c1a('0x5'));var config=require(_0x2c1a('0x6'));var controller=require(_0x2c1a('0x7'));router[_0x2c1a('0x8')]('/',auth[_0x2c1a('0x9')](),controller['index']);router[_0x2c1a('0x8')](_0x2c1a('0xa'),auth[_0x2c1a('0x9')](),controller[_0x2c1a('0xb')]);router[_0x2c1a('0xc')]('/',auth[_0x2c1a('0x9')](),controller[_0x2c1a('0xd')]);router[_0x2c1a('0xe')](_0x2c1a('0xa'),auth[_0x2c1a('0x9')](),controller[_0x2c1a('0xf')]);router[_0x2c1a('0x10')]('/:id',auth[_0x2c1a('0x9')](),controller[_0x2c1a('0x11')]);module[_0x2c1a('0x12')]=router; \ No newline at end of file +var _0xd1f5=['../../components/auth/service','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x544cd7,_0x20f588){var _0x43c000=function(_0x3d71cf){while(--_0x3d71cf){_0x544cd7['push'](_0x544cd7['shift']());}};_0x43c000(++_0x20f588);}(_0xd1f5,0x162));var _0x5d1f=function(_0x36afbe,_0x34dab6){_0x36afbe=_0x36afbe-0x0;var _0x2fab75=_0xd1f5[_0x36afbe];return _0x2fab75;};'use strict';var multer=require(_0x5d1f('0x0'));var util=require(_0x5d1f('0x1'));var path=require(_0x5d1f('0x2'));var timeout=require(_0x5d1f('0x3'));var express=require(_0x5d1f('0x4'));var router=express[_0x5d1f('0x5')]();var auth=require(_0x5d1f('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x5d1f('0x7'));var controller=require('./mailServerOut.controller');router[_0x5d1f('0x8')]('/',auth['isAuthenticated'](),controller[_0x5d1f('0x9')]);router[_0x5d1f('0x8')](_0x5d1f('0xa'),auth[_0x5d1f('0xb')](),controller[_0x5d1f('0xc')]);router[_0x5d1f('0xd')]('/',auth[_0x5d1f('0xb')](),controller[_0x5d1f('0xe')]);router[_0x5d1f('0xf')](_0x5d1f('0xa'),auth[_0x5d1f('0xb')](),controller[_0x5d1f('0x10')]);router[_0x5d1f('0x11')](_0x5d1f('0xa'),auth[_0x5d1f('0xb')](),controller[_0x5d1f('0x12')]);module[_0x5d1f('0x13')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index 0bacab2..50d8e83 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 _0xafc4=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x493734,_0x4f7ed7){var _0x3e9c44=function(_0x22d76f){while(--_0x22d76f){_0x493734['push'](_0x493734['shift']());}};_0x3e9c44(++_0x4f7ed7);}(_0xafc4,0x69));var _0x4afc=function(_0x526456,_0x460b03){_0x526456=_0x526456-0x0;var _0x13dc8e=_0xafc4[_0x526456];return _0x13dc8e;};'use strict';var Sequelize=require(_0x4afc('0x0'));module['exports']={'description':{'type':Sequelize[_0x4afc('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x4afc('0x1')]},'pass':{'type':Sequelize[_0x4afc('0x1')]},'port':{'type':Sequelize[_0x4afc('0x2')]},'secure':{'type':Sequelize[_0x4afc('0x3')],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0xfc65=['BOOLEAN','sequelize','STRING','INTEGER'];(function(_0x59f42f,_0x2c47d3){var _0x2ea07a=function(_0xfa2085){while(--_0xfa2085){_0x59f42f['push'](_0x59f42f['shift']());}};_0x2ea07a(++_0x2c47d3);}(_0xfc65,0x1e1));var _0x5fc6=function(_0x4eacba,_0x26674d){_0x4eacba=_0x4eacba-0x0;var _0x4dcc11=_0xfc65[_0x4eacba];return _0x4dcc11;};'use strict';var Sequelize=require(_0x5fc6('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x5fc6('0x1')]},'user':{'type':Sequelize[_0x5fc6('0x1')]},'pass':{'type':Sequelize[_0x5fc6('0x1')]},'port':{'type':Sequelize[_0x5fc6('0x2')]},'secure':{'type':Sequelize[_0x5fc6('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x5fc6('0x1')]},'authentication':{'type':Sequelize[_0x5fc6('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 61509f7..9f2cd6f 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 _0x87f3=['map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','fields','include','find','create','body','destroy','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','sendStatus','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','send','index','MailServerOut','rawAttributes','fieldName','type','key','model'];(function(_0x4c057f,_0x1ed571){var _0x154bbd=function(_0x390c4e){while(--_0x390c4e){_0x4c057f['push'](_0x4c057f['shift']());}};_0x154bbd(++_0x1ed571);}(_0x87f3,0x1e5));var _0x387f=function(_0x4b2cc6,_0x29ef43){_0x4b2cc6=_0x4b2cc6-0x0;var _0x3e0b08=_0x87f3[_0x4b2cc6];return _0x3e0b08;};'use strict';var pdf=require(_0x387f('0x0'));var emlformat=require(_0x387f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x387f('0x2'));var jsonpatch=require(_0x387f('0x3'));var rp=require(_0x387f('0x4'));var moment=require(_0x387f('0x5'));var BPromise=require(_0x387f('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x387f('0x7'));var sox=require(_0x387f('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x387f('0x9'));var squel=require(_0x387f('0xa'));var crypto=require(_0x387f('0xb'));var jsforce=require(_0x387f('0xc'));var deskjs=require(_0x387f('0xd'));var toCsv=require(_0x387f('0xe'));var querystring=require(_0x387f('0xf'));var Papa=require(_0x387f('0x10'));var Redis=require(_0x387f('0x11'));var authService=require(_0x387f('0x12'));var qs=require(_0x387f('0x13'));var as=require(_0x387f('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x387f('0x15'))(_0x387f('0x16'));var utils=require(_0x387f('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x216d7f,_0x28744a){_0x28744a=_0x28744a||0xcc;return function(_0x35d1db){if(_0x35d1db){return _0x216d7f[_0x387f('0x18')](_0x28744a);}return _0x216d7f['status'](_0x28744a)[_0x387f('0x19')]();};}function respondWithResult(_0x5c85fa,_0x3b5535){_0x3b5535=_0x3b5535||0xc8;return function(_0x130f0f){if(_0x130f0f){return _0x5c85fa[_0x387f('0x1a')](_0x3b5535)[_0x387f('0x1b')](_0x130f0f);}};}function respondWithFilteredResult(_0x19d518,_0x2586d9){return function(_0xf756e0){if(_0xf756e0){var _0x2e25a7=_0xf756e0[_0x387f('0x1c')],_0x358e08=_0x2586d9['offset'],_0x2f1c5f=_0x2586d9[_0x387f('0x1d')]+_0x2586d9['limit'],_0x2f8c95;if(_0x2f1c5f>=_0x2e25a7){_0x2f1c5f=_0x2e25a7;_0x2f8c95=0xc8;}else{_0x2f8c95=0xce;}_0x19d518[_0x387f('0x1a')](_0x2f8c95);return _0x19d518[_0x387f('0x1e')](_0x387f('0x1f'),_0x358e08+'-'+_0x2f1c5f+'/'+_0x2e25a7)[_0x387f('0x1b')](_0xf756e0);}return null;};}function patchUpdates(_0x42ca53){return function(_0x313124){try{jsonpatch[_0x387f('0x20')](_0x313124,_0x42ca53,!![]);}catch(_0x231b96){return BPromise[_0x387f('0x21')](_0x231b96);}return _0x313124[_0x387f('0x22')]();};}function saveUpdates(_0x50a53e,_0x5b3439){return function(_0xb099bd){if(_0xb099bd){return _0xb099bd[_0x387f('0x23')](_0x50a53e)[_0x387f('0x24')](function(_0x93e36a){return _0x93e36a;});}return null;};}function removeEntity(_0x16d66e,_0xce597b){return function(_0x34ef34){if(_0x34ef34){return _0x34ef34['destroy']()['then'](function(){_0x16d66e[_0x387f('0x1a')](0xcc)[_0x387f('0x19')]();});}};}function handleEntityNotFound(_0x416943,_0x3a2739){return function(_0x34670f){if(!_0x34670f){_0x416943[_0x387f('0x18')](0x194);}return _0x34670f;};}function handleError(_0x479e6d,_0x482ce3){_0x482ce3=_0x482ce3||0x1f4;return function(_0x4011ce){logger['error'](_0x4011ce[_0x387f('0x25')]);if(_0x4011ce['name']){delete _0x4011ce[_0x387f('0x26')];}_0x479e6d['status'](_0x482ce3)[_0x387f('0x27')](_0x4011ce);};}exports[_0x387f('0x28')]=function(_0x3c08e5,_0x7a8aaa){var _0x1a3250={},_0x43c3b0={},_0x3ed81f={'count':0x0,'rows':[]};var _0x177f0b=_['map'](db[_0x387f('0x29')][_0x387f('0x2a')],function(_0x8bfcce){return{'name':_0x8bfcce[_0x387f('0x2b')],'type':_0x8bfcce[_0x387f('0x2c')][_0x387f('0x2d')]};});_0x43c3b0[_0x387f('0x2e')]=_[_0x387f('0x2f')](_0x177f0b,_0x387f('0x26'));_0x43c3b0[_0x387f('0x30')]=_[_0x387f('0x31')](_0x3c08e5['query']);_0x43c3b0[_0x387f('0x32')]=_[_0x387f('0x33')](_0x43c3b0[_0x387f('0x2e')],_0x43c3b0[_0x387f('0x30')]);_0x1a3250['attributes']=_[_0x387f('0x33')](_0x43c3b0[_0x387f('0x2e')],qs['fields'](_0x3c08e5['query']['fields']));_0x1a3250[_0x387f('0x34')]=_0x1a3250[_0x387f('0x34')][_0x387f('0x35')]?_0x1a3250['attributes']:_0x43c3b0['model'];if(!_0x3c08e5[_0x387f('0x30')][_0x387f('0x36')](_0x387f('0x37'))){_0x1a3250[_0x387f('0x38')]=qs[_0x387f('0x38')](_0x3c08e5[_0x387f('0x30')][_0x387f('0x38')]);_0x1a3250['offset']=qs['offset'](_0x3c08e5[_0x387f('0x30')]['offset']);}_0x1a3250[_0x387f('0x39')]=qs['sort'](_0x3c08e5['query'][_0x387f('0x3a')]);_0x1a3250[_0x387f('0x3b')]=qs[_0x387f('0x32')](_[_0x387f('0x3c')](_0x3c08e5[_0x387f('0x30')],_0x43c3b0[_0x387f('0x32')]));if(_0x3c08e5['query'][_0x387f('0x3d')]){_0x1a3250[_0x387f('0x3b')]=_[_0x387f('0x3e')](_0x1a3250['where'],{'$or':_[_0x387f('0x2f')](_0x177f0b,function(_0x3756b4){if(_0x3756b4[_0x387f('0x2c')]!==_0x387f('0x3f')){var _0x3cc17c={};_0x3cc17c[_0x3756b4[_0x387f('0x26')]]={'$like':'%'+_0x3c08e5[_0x387f('0x30')][_0x387f('0x3d')]+'%'};return _0x3cc17c;}})});}_0x1a3250=_[_0x387f('0x3e')]({},_0x1a3250,_0x3c08e5[_0x387f('0x40')]);var _0x4933e7={'where':_0x1a3250['where']};return db['MailServerOut']['count'](_0x4933e7)[_0x387f('0x24')](function(_0x23fa3d){_0x3ed81f['count']=_0x23fa3d;if(_0x3c08e5[_0x387f('0x30')][_0x387f('0x41')]){_0x1a3250['include']=[{'all':!![]}];}return db['MailServerOut'][_0x387f('0x42')](_0x1a3250);})['then'](function(_0xea05c6){_0x3ed81f['rows']=_0xea05c6;return _0x3ed81f;})[_0x387f('0x24')](respondWithFilteredResult(_0x7a8aaa,_0x1a3250))[_0x387f('0x43')](handleError(_0x7a8aaa,null));};exports[_0x387f('0x44')]=function(_0x2b9771,_0x5a89a3){var _0x407273={'raw':!![],'where':{'id':_0x2b9771[_0x387f('0x45')]['id']}},_0x389584={};_0x389584[_0x387f('0x2e')]=_[_0x387f('0x31')](db[_0x387f('0x29')]['rawAttributes']);_0x389584['query']=_['keys'](_0x2b9771['query']);_0x389584[_0x387f('0x32')]=_[_0x387f('0x33')](_0x389584['model'],_0x389584['query']);_0x407273[_0x387f('0x34')]=_[_0x387f('0x33')](_0x389584['model'],qs[_0x387f('0x46')](_0x2b9771[_0x387f('0x30')][_0x387f('0x46')]));_0x407273[_0x387f('0x34')]=_0x407273[_0x387f('0x34')][_0x387f('0x35')]?_0x407273[_0x387f('0x34')]:_0x389584[_0x387f('0x2e')];if(_0x2b9771[_0x387f('0x30')][_0x387f('0x41')]){_0x407273[_0x387f('0x47')]=[{'all':!![]}];}_0x407273=_[_0x387f('0x3e')]({},_0x407273,_0x2b9771[_0x387f('0x40')]);return db[_0x387f('0x29')][_0x387f('0x48')](_0x407273)[_0x387f('0x24')](handleEntityNotFound(_0x5a89a3,null))[_0x387f('0x24')](respondWithResult(_0x5a89a3,null))[_0x387f('0x43')](handleError(_0x5a89a3,null));};exports[_0x387f('0x49')]=function(_0x56b47e,_0x57536c){return db[_0x387f('0x29')][_0x387f('0x49')](_0x56b47e[_0x387f('0x4a')],{})['then'](respondWithResult(_0x57536c,0xc9))[_0x387f('0x43')](handleError(_0x57536c,null));};exports[_0x387f('0x23')]=function(_0x187141,_0x2b8e3e){if(_0x187141[_0x387f('0x4a')]['id']){delete _0x187141['body']['id'];}return db[_0x387f('0x29')][_0x387f('0x48')]({'where':{'id':_0x187141[_0x387f('0x45')]['id']}})[_0x387f('0x24')](handleEntityNotFound(_0x2b8e3e,null))[_0x387f('0x24')](saveUpdates(_0x187141['body'],null))[_0x387f('0x24')](respondWithResult(_0x2b8e3e,null))['catch'](handleError(_0x2b8e3e,null));};exports[_0x387f('0x4b')]=function(_0x62d7aa,_0xbfe3e8){return db[_0x387f('0x29')][_0x387f('0x48')]({'where':{'id':_0x62d7aa['params']['id']}})[_0x387f('0x24')](handleEntityNotFound(_0xbfe3e8,null))[_0x387f('0x24')](removeEntity(_0xbfe3e8,null))[_0x387f('0x43')](handleError(_0xbfe3e8,null));}; \ No newline at end of file +var _0x6eab=['intersection','attributes','model','fields','hasOwnProperty','nolimit','order','where','pick','merge','VIRTUAL','options','include','findAll','rows','show','params','MailServerOut','length','includeAll','find','catch','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','map','rawAttributes','type','key','keys','query','filters'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x6eab,0x1c2));var _0xb6ea=function(_0x285d29,_0x52c639){_0x285d29=_0x285d29-0x0;var _0x202256=_0x6eab[_0x285d29];return _0x202256;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb6ea('0x0'));var rimraf=require(_0xb6ea('0x1'));var zipdir=require(_0xb6ea('0x2'));var jsonpatch=require(_0xb6ea('0x3'));var rp=require(_0xb6ea('0x4'));var moment=require(_0xb6ea('0x5'));var BPromise=require(_0xb6ea('0x6'));var Mustache=require(_0xb6ea('0x7'));var util=require(_0xb6ea('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xb6ea('0x9'));var ejs=require(_0xb6ea('0xa'));var fs=require('fs');var _=require(_0xb6ea('0xb'));var squel=require(_0xb6ea('0xc'));var crypto=require(_0xb6ea('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xb6ea('0xe'));var toCsv=require(_0xb6ea('0x9'));var querystring=require(_0xb6ea('0xf'));var Papa=require(_0xb6ea('0x10'));var Redis=require(_0xb6ea('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xb6ea('0x12'));var as=require(_0xb6ea('0x13'));var hardwareService=require(_0xb6ea('0x14'));var logger=require(_0xb6ea('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb6ea('0x16'))['db'];function respondWithStatusCode(_0xca905c,_0x1bd386){_0x1bd386=_0x1bd386||0xcc;return function(_0x2521c3){if(_0x2521c3){return _0xca905c['sendStatus'](_0x1bd386);}return _0xca905c[_0xb6ea('0x17')](_0x1bd386)['end']();};}function respondWithResult(_0x5c2456,_0x501762){_0x501762=_0x501762||0xc8;return function(_0x33b630){if(_0x33b630){return _0x5c2456[_0xb6ea('0x17')](_0x501762)[_0xb6ea('0x18')](_0x33b630);}};}function respondWithFilteredResult(_0x5bb5e6,_0x57a4f3){return function(_0x3b55e2){if(_0x3b55e2){var _0x4e4d91=_0x3b55e2[_0xb6ea('0x19')],_0x313161=_0x57a4f3[_0xb6ea('0x1a')],_0x121c5b=_0x57a4f3[_0xb6ea('0x1a')]+_0x57a4f3[_0xb6ea('0x1b')],_0x5529fe;if(_0x121c5b>=_0x4e4d91){_0x121c5b=_0x4e4d91;_0x5529fe=0xc8;}else{_0x5529fe=0xce;}_0x5bb5e6[_0xb6ea('0x17')](_0x5529fe);return _0x5bb5e6[_0xb6ea('0x1c')]('Content-Range',_0x313161+'-'+_0x121c5b+'/'+_0x4e4d91)[_0xb6ea('0x18')](_0x3b55e2);}return null;};}function patchUpdates(_0x11ef6a){return function(_0x101f10){try{jsonpatch[_0xb6ea('0x1d')](_0x101f10,_0x11ef6a,!![]);}catch(_0x720256){return BPromise[_0xb6ea('0x1e')](_0x720256);}return _0x101f10[_0xb6ea('0x1f')]();};}function saveUpdates(_0x5e150c,_0xcde6cd){return function(_0x19007b){if(_0x19007b){return _0x19007b[_0xb6ea('0x20')](_0x5e150c)[_0xb6ea('0x21')](function(_0x54e4b0){return _0x54e4b0;});}return null;};}function removeEntity(_0x3c556b,_0x311b65){return function(_0x5ad735){if(_0x5ad735){return _0x5ad735[_0xb6ea('0x22')]()['then'](function(){_0x3c556b[_0xb6ea('0x17')](0xcc)[_0xb6ea('0x23')]();});}};}function handleEntityNotFound(_0x2f6b11,_0x27b57a){return function(_0x4639b5){if(!_0x4639b5){_0x2f6b11[_0xb6ea('0x24')](0x194);}return _0x4639b5;};}function handleError(_0x2965db,_0x19dd3a){_0x19dd3a=_0x19dd3a||0x1f4;return function(_0x423412){logger['error'](_0x423412[_0xb6ea('0x25')]);if(_0x423412[_0xb6ea('0x26')]){delete _0x423412[_0xb6ea('0x26')];}_0x2965db[_0xb6ea('0x17')](_0x19dd3a)[_0xb6ea('0x27')](_0x423412);};}exports['index']=function(_0x3324cd,_0x221d74){var _0x49953a={},_0x580ce1={},_0x102fb6={'count':0x0,'rows':[]};var _0x34a6e7=_[_0xb6ea('0x28')](db['MailServerOut'][_0xb6ea('0x29')],function(_0xb0f347){return{'name':_0xb0f347['fieldName'],'type':_0xb0f347[_0xb6ea('0x2a')][_0xb6ea('0x2b')]};});_0x580ce1['model']=_[_0xb6ea('0x28')](_0x34a6e7,_0xb6ea('0x26'));_0x580ce1['query']=_[_0xb6ea('0x2c')](_0x3324cd[_0xb6ea('0x2d')]);_0x580ce1[_0xb6ea('0x2e')]=_[_0xb6ea('0x2f')](_0x580ce1['model'],_0x580ce1[_0xb6ea('0x2d')]);_0x49953a[_0xb6ea('0x30')]=_[_0xb6ea('0x2f')](_0x580ce1[_0xb6ea('0x31')],qs[_0xb6ea('0x32')](_0x3324cd[_0xb6ea('0x2d')]['fields']));_0x49953a[_0xb6ea('0x30')]=_0x49953a[_0xb6ea('0x30')]['length']?_0x49953a[_0xb6ea('0x30')]:_0x580ce1[_0xb6ea('0x31')];if(!_0x3324cd[_0xb6ea('0x2d')][_0xb6ea('0x33')](_0xb6ea('0x34'))){_0x49953a['limit']=qs[_0xb6ea('0x1b')](_0x3324cd[_0xb6ea('0x2d')]['limit']);_0x49953a[_0xb6ea('0x1a')]=qs['offset'](_0x3324cd[_0xb6ea('0x2d')][_0xb6ea('0x1a')]);}_0x49953a[_0xb6ea('0x35')]=qs['sort'](_0x3324cd[_0xb6ea('0x2d')]['sort']);_0x49953a[_0xb6ea('0x36')]=qs['filters'](_[_0xb6ea('0x37')](_0x3324cd[_0xb6ea('0x2d')],_0x580ce1[_0xb6ea('0x2e')]));if(_0x3324cd[_0xb6ea('0x2d')]['filter']){_0x49953a[_0xb6ea('0x36')]=_[_0xb6ea('0x38')](_0x49953a[_0xb6ea('0x36')],{'$or':_[_0xb6ea('0x28')](_0x34a6e7,function(_0x329cc9){if(_0x329cc9[_0xb6ea('0x2a')]!==_0xb6ea('0x39')){var _0x348ce2={};_0x348ce2[_0x329cc9[_0xb6ea('0x26')]]={'$like':'%'+_0x3324cd[_0xb6ea('0x2d')]['filter']+'%'};return _0x348ce2;}})});}_0x49953a=_[_0xb6ea('0x38')]({},_0x49953a,_0x3324cd[_0xb6ea('0x3a')]);var _0x2e7d19={'where':_0x49953a[_0xb6ea('0x36')]};return db['MailServerOut'][_0xb6ea('0x19')](_0x2e7d19)[_0xb6ea('0x21')](function(_0x361581){_0x102fb6[_0xb6ea('0x19')]=_0x361581;if(_0x3324cd[_0xb6ea('0x2d')]['includeAll']){_0x49953a[_0xb6ea('0x3b')]=[{'all':!![]}];}return db['MailServerOut'][_0xb6ea('0x3c')](_0x49953a);})[_0xb6ea('0x21')](function(_0x58a3b8){_0x102fb6[_0xb6ea('0x3d')]=_0x58a3b8;return _0x102fb6;})['then'](respondWithFilteredResult(_0x221d74,_0x49953a))['catch'](handleError(_0x221d74,null));};exports[_0xb6ea('0x3e')]=function(_0x253c08,_0x239141){var _0x3fbf6f={'raw':!![],'where':{'id':_0x253c08[_0xb6ea('0x3f')]['id']}},_0x21a36c={};_0x21a36c['model']=_[_0xb6ea('0x2c')](db[_0xb6ea('0x40')][_0xb6ea('0x29')]);_0x21a36c[_0xb6ea('0x2d')]=_[_0xb6ea('0x2c')](_0x253c08[_0xb6ea('0x2d')]);_0x21a36c['filters']=_['intersection'](_0x21a36c[_0xb6ea('0x31')],_0x21a36c[_0xb6ea('0x2d')]);_0x3fbf6f[_0xb6ea('0x30')]=_[_0xb6ea('0x2f')](_0x21a36c[_0xb6ea('0x31')],qs[_0xb6ea('0x32')](_0x253c08[_0xb6ea('0x2d')][_0xb6ea('0x32')]));_0x3fbf6f[_0xb6ea('0x30')]=_0x3fbf6f[_0xb6ea('0x30')][_0xb6ea('0x41')]?_0x3fbf6f['attributes']:_0x21a36c[_0xb6ea('0x31')];if(_0x253c08[_0xb6ea('0x2d')][_0xb6ea('0x42')]){_0x3fbf6f['include']=[{'all':!![]}];}_0x3fbf6f=_[_0xb6ea('0x38')]({},_0x3fbf6f,_0x253c08[_0xb6ea('0x3a')]);return db[_0xb6ea('0x40')][_0xb6ea('0x43')](_0x3fbf6f)['then'](handleEntityNotFound(_0x239141,null))[_0xb6ea('0x21')](respondWithResult(_0x239141,null))[_0xb6ea('0x44')](handleError(_0x239141,null));};exports[_0xb6ea('0x45')]=function(_0x11637e,_0x1a997b){return db[_0xb6ea('0x40')][_0xb6ea('0x45')](_0x11637e[_0xb6ea('0x46')],{})[_0xb6ea('0x21')](respondWithResult(_0x1a997b,0xc9))[_0xb6ea('0x44')](handleError(_0x1a997b,null));};exports[_0xb6ea('0x20')]=function(_0x4f2e36,_0x43cc4f){if(_0x4f2e36[_0xb6ea('0x46')]['id']){delete _0x4f2e36[_0xb6ea('0x46')]['id'];}return db['MailServerOut'][_0xb6ea('0x43')]({'where':{'id':_0x4f2e36['params']['id']}})['then'](handleEntityNotFound(_0x43cc4f,null))[_0xb6ea('0x21')](saveUpdates(_0x4f2e36[_0xb6ea('0x46')],null))[_0xb6ea('0x21')](respondWithResult(_0x43cc4f,null))[_0xb6ea('0x44')](handleError(_0x43cc4f,null));};exports[_0xb6ea('0x22')]=function(_0x5b7cf1,_0x20a08c){return db['MailServerOut']['find']({'where':{'id':_0x5b7cf1['params']['id']}})[_0xb6ea('0x21')](handleEntityNotFound(_0x20a08c,null))[_0xb6ea('0x21')](removeEntity(_0x20a08c,null))[_0xb6ea('0x44')](handleError(_0x20a08c,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index e1a112f..393a5c5 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 _0xabce=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','define','mail_servers_out','lodash'];(function(_0xfc4ce0,_0x21069b){var _0x78b332=function(_0x16d897){while(--_0x16d897){_0xfc4ce0['push'](_0xfc4ce0['shift']());}};_0x78b332(++_0x21069b);}(_0xabce,0x103));var _0xeabc=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xabce[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var logger=require(_0xeabc('0x2'))(_0xeabc('0x3'));var moment=require(_0xeabc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xeabc('0x5'));var rimraf=require(_0xeabc('0x6'));var config=require(_0xeabc('0x7'));var attributes=require('./mailServerOut.attributes');module['exports']=function(_0x1b07a8,_0x52a4d7){return _0x1b07a8[_0xeabc('0x8')]('MailServerOut',attributes,{'tableName':_0xeabc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5a=['define','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports'];(function(_0x443468,_0x3f0b69){var _0x2f7442=function(_0x1c8703){while(--_0x1c8703){_0x443468['push'](_0x443468['shift']());}};_0x2f7442(++_0x3f0b69);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x38fc50,_0xf8716c){_0x38fc50=_0x38fc50-0x0;var _0x493960=_0x9c5a[_0x38fc50];return _0x493960;};'use strict';var _=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var logger=require('../../config/logger')(_0xa9c5('0x2'));var moment=require(_0xa9c5('0x3'));var BPromise=require(_0xa9c5('0x4'));var rp=require(_0xa9c5('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa9c5('0x6'));var config=require(_0xa9c5('0x7'));var attributes=require('./mailServerOut.attributes');module[_0xa9c5('0x8')]=function(_0x4d9c7a,_0x394d84){return _0x4d9c7a[_0xa9c5('0x9')]('MailServerOut',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 2ba3cce..23bdeee 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 _0x19e0=['../../config/logger','rpc','jayson/promise','client','http','request','then','info','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4f0e29,_0x1f3709){var _0x310707=function(_0x5bb3da){while(--_0x5bb3da){_0x4f0e29['push'](_0x4f0e29['shift']());}};_0x310707(++_0x1f3709);}(_0x19e0,0x1d4));var _0x019e=function(_0x44c5c1,_0x4d9d55){_0x44c5c1=_0x44c5c1-0x0;var _0x467172=_0x19e0[_0x44c5c1];return _0x467172;};'use strict';var _=require(_0x019e('0x0'));var util=require(_0x019e('0x1'));var moment=require(_0x019e('0x2'));var BPromise=require(_0x019e('0x3'));var rs=require(_0x019e('0x4'));var fs=require('fs');var Redis=require(_0x019e('0x5'));var db=require(_0x019e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x019e('0x7'))(_0x019e('0x8'));var config=require('../../config/environment');var jayson=require(_0x019e('0x9'));var client=jayson[_0x019e('0xa')][_0x019e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xca38dc,_0x3e116a,_0x54bbc7){return new BPromise(function(_0x4a5be1,_0x51e4cb){return client[_0x019e('0xc')](_0xca38dc,_0x54bbc7)[_0x019e('0xd')](function(_0x59f932){logger[_0x019e('0xe')](_0x019e('0xf'),_0x3e116a,'request\x20sent');logger[_0x019e('0x10')](_0x019e('0x11'),_0x3e116a,'request\x20sent',JSON[_0x019e('0x12')](_0x59f932));if(_0x59f932[_0x019e('0x13')]){if(_0x59f932[_0x019e('0x13')][_0x019e('0x14')]===0x1f4){logger[_0x019e('0x13')](_0x019e('0xf'),_0x3e116a,_0x59f932[_0x019e('0x13')][_0x019e('0x15')]);return _0x51e4cb(_0x59f932['error'][_0x019e('0x15')]);}logger[_0x019e('0x13')]('MailServerOut,\x20%s,\x20%s',_0x3e116a,_0x59f932[_0x019e('0x13')][_0x019e('0x15')]);return _0x4a5be1(_0x59f932[_0x019e('0x13')][_0x019e('0x15')]);}else{logger[_0x019e('0xe')]('MailServerOut,\x20%s,\x20%s',_0x3e116a,_0x019e('0x16'));_0x4a5be1(_0x59f932[_0x019e('0x17')][_0x019e('0x15')]);}})[_0x019e('0x18')](function(_0x3a99df){logger[_0x019e('0x13')](_0x019e('0xf'),_0x3e116a,_0x3a99df);_0x51e4cb(_0x3a99df);});});} \ No newline at end of file +var _0x30a1=['stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','client','http','request','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x30a1,0x139));var _0x130a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x30a1[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0x130a('0x0'));var moment=require('moment');var BPromise=require(_0x130a('0x1'));var rs=require(_0x130a('0x2'));var fs=require('fs');var Redis=require(_0x130a('0x3'));var db=require('../../mysqldb')['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[_0x130a('0x4')][_0x130a('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x498740,_0x2aa21a,_0x125dd2){return new BPromise(function(_0x336afb,_0x249df5){return client[_0x130a('0x6')](_0x498740,_0x125dd2)['then'](function(_0x33654d){logger['info'](_0x130a('0x7'),_0x2aa21a,_0x130a('0x8'));logger[_0x130a('0x9')](_0x130a('0xa'),_0x2aa21a,'request\x20sent',JSON[_0x130a('0xb')](_0x33654d));if(_0x33654d[_0x130a('0xc')]){if(_0x33654d[_0x130a('0xc')][_0x130a('0xd')]===0x1f4){logger[_0x130a('0xc')](_0x130a('0x7'),_0x2aa21a,_0x33654d[_0x130a('0xc')][_0x130a('0xe')]);return _0x249df5(_0x33654d[_0x130a('0xc')]['message']);}logger[_0x130a('0xc')](_0x130a('0x7'),_0x2aa21a,_0x33654d['error'][_0x130a('0xe')]);return _0x336afb(_0x33654d[_0x130a('0xc')][_0x130a('0xe')]);}else{logger[_0x130a('0xf')](_0x130a('0x7'),_0x2aa21a,_0x130a('0x8'));_0x336afb(_0x33654d[_0x130a('0x10')]['message']);}})[_0x130a('0x11')](function(_0x58f021){logger[_0x130a('0xc')](_0x130a('0x7'),_0x2aa21a,_0x58f021);_0x249df5(_0x58f021);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index f493448..3eb5b69 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 _0x5651=['describe','get','/:id','create','put','update','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','index','isAuthenticated'];(function(_0x4d331e,_0x4e3585){var _0x2e521d=function(_0x5e7bcd){while(--_0x5e7bcd){_0x4d331e['push'](_0x4d331e['shift']());}};_0x2e521d(++_0x4e3585);}(_0x5651,0xf5));var _0x1565=function(_0x1df7b8,_0x2fe5e5){_0x1df7b8=_0x1df7b8-0x0;var _0x29d911=_0x5651[_0x1df7b8];return _0x29d911;};'use strict';var multer=require('multer');var util=require(_0x1565('0x0'));var path=require(_0x1565('0x1'));var timeout=require(_0x1565('0x2'));var express=require(_0x1565('0x3'));var router=express['Router']();var auth=require(_0x1565('0x4'));var interaction=require(_0x1565('0x5'));var config=require(_0x1565('0x6'));var controller=require(_0x1565('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x1565('0x8')]);router['get']('/describe',auth[_0x1565('0x9')](),controller[_0x1565('0xa')]);router[_0x1565('0xb')](_0x1565('0xc'),auth[_0x1565('0x9')](),controller['show']);router['post']('/',auth[_0x1565('0x9')](),controller[_0x1565('0xd')]);router[_0x1565('0xe')](_0x1565('0xc'),auth[_0x1565('0x9')](),controller[_0x1565('0xf')]);router['delete'](_0x1565('0xc'),auth[_0x1565('0x9')](),controller['destroy']);module[_0x1565('0x10')]=router; \ No newline at end of file +var _0x92a3=['util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x120c7a,_0x553651){var _0x402568=function(_0x4ad30b){while(--_0x4ad30b){_0x120c7a['push'](_0x120c7a['shift']());}};_0x402568(++_0x553651);}(_0x92a3,0x175));var _0x392a=function(_0x387dc1,_0x3ba649){_0x387dc1=_0x387dc1-0x0;var _0x17567c=_0x92a3[_0x387dc1];return _0x17567c;};'use strict';var multer=require(_0x392a('0x0'));var util=require(_0x392a('0x1'));var path=require(_0x392a('0x2'));var timeout=require(_0x392a('0x3'));var express=require(_0x392a('0x4'));var router=express[_0x392a('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x392a('0x6'));var config=require(_0x392a('0x7'));var controller=require(_0x392a('0x8'));router[_0x392a('0x9')]('/',auth[_0x392a('0xa')](),controller[_0x392a('0xb')]);router[_0x392a('0x9')](_0x392a('0xc'),auth[_0x392a('0xa')](),controller['describe']);router[_0x392a('0x9')]('/:id',auth[_0x392a('0xa')](),controller[_0x392a('0xd')]);router[_0x392a('0xe')]('/',auth[_0x392a('0xa')](),controller[_0x392a('0xf')]);router[_0x392a('0x10')]('/:id',auth[_0x392a('0xa')](),controller[_0x392a('0x11')]);router[_0x392a('0x12')](_0x392a('0x13'),auth[_0x392a('0xa')](),controller[_0x392a('0x14')]);module[_0x392a('0x15')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 4da4cbb..bf83631 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 _0x7b77=['name','sequelize','exports','STRING'];(function(_0x88b6fc,_0x298073){var _0x393d35=function(_0x4482f3){while(--_0x4482f3){_0x88b6fc['push'](_0x88b6fc['shift']());}};_0x393d35(++_0x298073);}(_0x7b77,0x179));var _0x77b7=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x7b77[_0x30033a];return _0x5e3518;};'use strict';var Sequelize=require(_0x77b7('0x0'));module[_0x77b7('0x1')]={'name':{'type':Sequelize[_0x77b7('0x2')],'unique':_0x77b7('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xc00b=['STRING','sequelize'];(function(_0x3ed1b4,_0xc151b){var _0x124819=function(_0x3f4d54){while(--_0x3f4d54){_0x3ed1b4['push'](_0x3ed1b4['shift']());}};_0x124819(++_0xc151b);}(_0xc00b,0x1e5));var _0xbc00=function(_0x1af0e5,_0x152990){_0x1af0e5=_0x1af0e5-0x0;var _0x3c444a=_0xc00b[_0x1af0e5];return _0x3c444a;};'use strict';var Sequelize=require(_0xbc00('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xbc00('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index e9b2a83..8ce3a9e 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 _0xf2ca=['fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','MailSubstatus','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','pick','merge','where','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','keys','find','create','body','describe','html-pdf','eml-format','rimraf'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x1627ae,_0x2aaa24){_0x1627ae=_0x1627ae-0x0;var _0x34b38f=_0xf2ca[_0x1627ae];return _0x34b38f;};'use strict';var pdf=require(_0xaf2c('0x0'));var emlformat=require(_0xaf2c('0x1'));var rimraf=require(_0xaf2c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaf2c('0x3'));var rp=require(_0xaf2c('0x4'));var moment=require(_0xaf2c('0x5'));var BPromise=require(_0xaf2c('0x6'));var Mustache=require(_0xaf2c('0x7'));var util=require(_0xaf2c('0x8'));var path=require('path');var sox=require(_0xaf2c('0x9'));var csv=require(_0xaf2c('0xa'));var ejs=require(_0xaf2c('0xb'));var fs=require('fs');var _=require(_0xaf2c('0xc'));var squel=require('squel');var crypto=require(_0xaf2c('0xd'));var jsforce=require(_0xaf2c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xaf2c('0xa'));var querystring=require('querystring');var Papa=require(_0xaf2c('0xf'));var Redis=require('ioredis');var authService=require(_0xaf2c('0x10'));var qs=require(_0xaf2c('0x11'));var as=require(_0xaf2c('0x12'));var hardwareService=require(_0xaf2c('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0xaf2c('0x14'));var config=require(_0xaf2c('0x15'));var db=require(_0xaf2c('0x16'))['db'];function respondWithStatusCode(_0xd56a5d,_0x285dac){_0x285dac=_0x285dac||0xcc;return function(_0x59a59b){if(_0x59a59b){return _0xd56a5d['sendStatus'](_0x285dac);}return _0xd56a5d[_0xaf2c('0x17')](_0x285dac)[_0xaf2c('0x18')]();};}function respondWithResult(_0x935959,_0x18a8a5){_0x18a8a5=_0x18a8a5||0xc8;return function(_0x293ca6){if(_0x293ca6){return _0x935959[_0xaf2c('0x17')](_0x18a8a5)[_0xaf2c('0x19')](_0x293ca6);}};}function respondWithFilteredResult(_0x3c1088,_0x2119c8){return function(_0x1d0633){if(_0x1d0633){var _0x6ac8e=_0x1d0633[_0xaf2c('0x1a')],_0x2b4d13=_0x2119c8['offset'],_0x26bf7b=_0x2119c8[_0xaf2c('0x1b')]+_0x2119c8['limit'],_0x3432e4;if(_0x26bf7b>=_0x6ac8e){_0x26bf7b=_0x6ac8e;_0x3432e4=0xc8;}else{_0x3432e4=0xce;}_0x3c1088[_0xaf2c('0x17')](_0x3432e4);return _0x3c1088[_0xaf2c('0x1c')](_0xaf2c('0x1d'),_0x2b4d13+'-'+_0x26bf7b+'/'+_0x6ac8e)['json'](_0x1d0633);}return null;};}function patchUpdates(_0x28ae7b){return function(_0x297bcd){try{jsonpatch[_0xaf2c('0x1e')](_0x297bcd,_0x28ae7b,!![]);}catch(_0x20000b){return BPromise[_0xaf2c('0x1f')](_0x20000b);}return _0x297bcd[_0xaf2c('0x20')]();};}function saveUpdates(_0x531609,_0x35e712){return function(_0x164bcb){if(_0x164bcb){return _0x164bcb[_0xaf2c('0x21')](_0x531609)[_0xaf2c('0x22')](function(_0x237318){return _0x237318;});}return null;};}function removeEntity(_0x486de2,_0x396646){return function(_0xbf6f62){if(_0xbf6f62){return _0xbf6f62[_0xaf2c('0x23')]()['then'](function(){_0x486de2['status'](0xcc)[_0xaf2c('0x18')]();});}};}function handleEntityNotFound(_0x303546,_0x1cafad){return function(_0x99f78d){if(!_0x99f78d){_0x303546['sendStatus'](0x194);}return _0x99f78d;};}function handleError(_0x2b8f1a,_0xf1a7cf){_0xf1a7cf=_0xf1a7cf||0x1f4;return function(_0x3a0145){logger[_0xaf2c('0x24')](_0x3a0145[_0xaf2c('0x25')]);if(_0x3a0145[_0xaf2c('0x26')]){delete _0x3a0145[_0xaf2c('0x26')];}_0x2b8f1a['status'](_0xf1a7cf)[_0xaf2c('0x27')](_0x3a0145);};}exports[_0xaf2c('0x28')]=function(_0x36f37c,_0x410536){var _0x4b7cf2={},_0x3fb190={},_0x589d47={'count':0x0,'rows':[]};var _0x38db1b=_[_0xaf2c('0x29')](db[_0xaf2c('0x2a')]['rawAttributes'],function(_0x2747bb){return{'name':_0x2747bb[_0xaf2c('0x2b')],'type':_0x2747bb[_0xaf2c('0x2c')]['key']};});_0x3fb190[_0xaf2c('0x2d')]=_[_0xaf2c('0x29')](_0x38db1b,_0xaf2c('0x26'));_0x3fb190[_0xaf2c('0x2e')]=_['keys'](_0x36f37c[_0xaf2c('0x2e')]);_0x3fb190[_0xaf2c('0x2f')]=_[_0xaf2c('0x30')](_0x3fb190['model'],_0x3fb190['query']);_0x4b7cf2[_0xaf2c('0x31')]=_['intersection'](_0x3fb190[_0xaf2c('0x2d')],qs['fields'](_0x36f37c[_0xaf2c('0x2e')][_0xaf2c('0x32')]));_0x4b7cf2['attributes']=_0x4b7cf2[_0xaf2c('0x31')][_0xaf2c('0x33')]?_0x4b7cf2['attributes']:_0x3fb190[_0xaf2c('0x2d')];if(!_0x36f37c[_0xaf2c('0x2e')][_0xaf2c('0x34')](_0xaf2c('0x35'))){_0x4b7cf2[_0xaf2c('0x36')]=qs[_0xaf2c('0x36')](_0x36f37c['query'][_0xaf2c('0x36')]);_0x4b7cf2['offset']=qs[_0xaf2c('0x1b')](_0x36f37c['query'][_0xaf2c('0x1b')]);}_0x4b7cf2['order']=qs[_0xaf2c('0x37')](_0x36f37c['query'][_0xaf2c('0x37')]);_0x4b7cf2['where']=qs[_0xaf2c('0x2f')](_[_0xaf2c('0x38')](_0x36f37c[_0xaf2c('0x2e')],_0x3fb190[_0xaf2c('0x2f')]));if(_0x36f37c[_0xaf2c('0x2e')]['filter']){_0x4b7cf2['where']=_[_0xaf2c('0x39')](_0x4b7cf2[_0xaf2c('0x3a')],{'$or':_[_0xaf2c('0x29')](_0x38db1b,function(_0xa44813){if(_0xa44813[_0xaf2c('0x2c')]!==_0xaf2c('0x3b')){var _0x573db3={};_0x573db3[_0xa44813[_0xaf2c('0x26')]]={'$like':'%'+_0x36f37c[_0xaf2c('0x2e')]['filter']+'%'};return _0x573db3;}})});}_0x4b7cf2=_[_0xaf2c('0x39')]({},_0x4b7cf2,_0x36f37c[_0xaf2c('0x3c')]);var _0x25bebd={'where':_0x4b7cf2[_0xaf2c('0x3a')]};return db[_0xaf2c('0x2a')][_0xaf2c('0x1a')](_0x25bebd)[_0xaf2c('0x22')](function(_0x310d3b){_0x589d47[_0xaf2c('0x1a')]=_0x310d3b;if(_0x36f37c[_0xaf2c('0x2e')][_0xaf2c('0x3d')]){_0x4b7cf2[_0xaf2c('0x3e')]=[{'all':!![]}];}return db[_0xaf2c('0x2a')]['findAll'](_0x4b7cf2);})['then'](function(_0x4db7d0){_0x589d47[_0xaf2c('0x3f')]=_0x4db7d0;return _0x589d47;})[_0xaf2c('0x22')](respondWithFilteredResult(_0x410536,_0x4b7cf2))[_0xaf2c('0x40')](handleError(_0x410536,null));};exports[_0xaf2c('0x41')]=function(_0x715f39,_0x29460c){var _0x51c441={'raw':!![],'where':{'id':_0x715f39[_0xaf2c('0x42')]['id']}},_0x1d58bd={};_0x1d58bd[_0xaf2c('0x2d')]=_['keys'](db['MailSubstatus'][_0xaf2c('0x43')]);_0x1d58bd['query']=_[_0xaf2c('0x44')](_0x715f39[_0xaf2c('0x2e')]);_0x1d58bd[_0xaf2c('0x2f')]=_[_0xaf2c('0x30')](_0x1d58bd['model'],_0x1d58bd[_0xaf2c('0x2e')]);_0x51c441['attributes']=_[_0xaf2c('0x30')](_0x1d58bd[_0xaf2c('0x2d')],qs['fields'](_0x715f39[_0xaf2c('0x2e')]['fields']));_0x51c441[_0xaf2c('0x31')]=_0x51c441[_0xaf2c('0x31')][_0xaf2c('0x33')]?_0x51c441[_0xaf2c('0x31')]:_0x1d58bd[_0xaf2c('0x2d')];if(_0x715f39[_0xaf2c('0x2e')][_0xaf2c('0x3d')]){_0x51c441[_0xaf2c('0x3e')]=[{'all':!![]}];}_0x51c441=_[_0xaf2c('0x39')]({},_0x51c441,_0x715f39['options']);return db['MailSubstatus'][_0xaf2c('0x45')](_0x51c441)['then'](handleEntityNotFound(_0x29460c,null))['then'](respondWithResult(_0x29460c,null))['catch'](handleError(_0x29460c,null));};exports[_0xaf2c('0x46')]=function(_0x964b76,_0x3cabd4){return db[_0xaf2c('0x2a')]['create'](_0x964b76[_0xaf2c('0x47')],{})['then'](respondWithResult(_0x3cabd4,0xc9))[_0xaf2c('0x40')](handleError(_0x3cabd4,null));};exports['update']=function(_0x166c26,_0x133e8c){if(_0x166c26[_0xaf2c('0x47')]['id']){delete _0x166c26[_0xaf2c('0x47')]['id'];}return db[_0xaf2c('0x2a')]['find']({'where':{'id':_0x166c26[_0xaf2c('0x42')]['id']}})[_0xaf2c('0x22')](handleEntityNotFound(_0x133e8c,null))['then'](saveUpdates(_0x166c26['body'],null))[_0xaf2c('0x22')](respondWithResult(_0x133e8c,null))['catch'](handleError(_0x133e8c,null));};exports[_0xaf2c('0x23')]=function(_0x23642b,_0x17b9ec){return db[_0xaf2c('0x2a')][_0xaf2c('0x45')]({'where':{'id':_0x23642b[_0xaf2c('0x42')]['id']}})[_0xaf2c('0x22')](handleEntityNotFound(_0x17b9ec,null))[_0xaf2c('0x22')](removeEntity(_0x17b9ec,null))[_0xaf2c('0x40')](handleError(_0x17b9ec,null));};exports[_0xaf2c('0x48')]=function(_0x371486,_0x5bf349){return db[_0xaf2c('0x2a')][_0xaf2c('0x48')]()['then'](respondWithResult(_0x5bf349,null))['catch'](handleError(_0x5bf349,null));}; \ No newline at end of file +var _0xc1c6=['error','stack','name','send','map','MailSubstatus','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','filter','where','type','VIRTUAL','merge','count','includeAll','findAll','rows','catch','keys','rawAttributes','include','options','create','body','find','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','sox','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','json','offset','Content-Range','reject','save','update','then','destroy','end','sendStatus'];(function(_0x4aa348,_0x1659bd){var _0x3d1670=function(_0x45d86f){while(--_0x45d86f){_0x4aa348['push'](_0x4aa348['shift']());}};_0x3d1670(++_0x1659bd);}(_0xc1c6,0xf7));var _0x6c1c=function(_0x5bb1d0,_0x5d3408){_0x5bb1d0=_0x5bb1d0-0x0;var _0x19e428=_0xc1c6[_0x5bb1d0];return _0x19e428;};'use strict';var pdf=require(_0x6c1c('0x0'));var emlformat=require(_0x6c1c('0x1'));var rimraf=require(_0x6c1c('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6c1c('0x3'));var rp=require('request-promise');var moment=require(_0x6c1c('0x4'));var BPromise=require(_0x6c1c('0x5'));var Mustache=require(_0x6c1c('0x6'));var util=require('util');var path=require('path');var sox=require(_0x6c1c('0x7'));var csv=require('to-csv');var ejs=require(_0x6c1c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6c1c('0x9'));var crypto=require(_0x6c1c('0xa'));var jsforce=require(_0x6c1c('0xb'));var deskjs=require(_0x6c1c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x6c1c('0xd'));var Papa=require(_0x6c1c('0xe'));var Redis=require('ioredis');var authService=require(_0x6c1c('0xf'));var qs=require(_0x6c1c('0x10'));var as=require(_0x6c1c('0x11'));var hardwareService=require(_0x6c1c('0x12'));var logger=require('../../config/logger')(_0x6c1c('0x13'));var utils=require(_0x6c1c('0x14'));var config=require(_0x6c1c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x412717,_0x12a9e6){_0x12a9e6=_0x12a9e6||0xcc;return function(_0x2067bd){if(_0x2067bd){return _0x412717['sendStatus'](_0x12a9e6);}return _0x412717[_0x6c1c('0x16')](_0x12a9e6)['end']();};}function respondWithResult(_0x357370,_0x15a1fc){_0x15a1fc=_0x15a1fc||0xc8;return function(_0x2d279e){if(_0x2d279e){return _0x357370[_0x6c1c('0x16')](_0x15a1fc)[_0x6c1c('0x17')](_0x2d279e);}};}function respondWithFilteredResult(_0x3f532c,_0x297c33){return function(_0x41aa74){if(_0x41aa74){var _0x448f35=_0x41aa74['count'],_0x5f3758=_0x297c33[_0x6c1c('0x18')],_0x3df1b7=_0x297c33[_0x6c1c('0x18')]+_0x297c33['limit'],_0x174657;if(_0x3df1b7>=_0x448f35){_0x3df1b7=_0x448f35;_0x174657=0xc8;}else{_0x174657=0xce;}_0x3f532c[_0x6c1c('0x16')](_0x174657);return _0x3f532c['set'](_0x6c1c('0x19'),_0x5f3758+'-'+_0x3df1b7+'/'+_0x448f35)[_0x6c1c('0x17')](_0x41aa74);}return null;};}function patchUpdates(_0x5a3bb7){return function(_0xa667eb){try{jsonpatch['apply'](_0xa667eb,_0x5a3bb7,!![]);}catch(_0x2db60e){return BPromise[_0x6c1c('0x1a')](_0x2db60e);}return _0xa667eb[_0x6c1c('0x1b')]();};}function saveUpdates(_0x211f49,_0x1acf7f){return function(_0x1efb19){if(_0x1efb19){return _0x1efb19[_0x6c1c('0x1c')](_0x211f49)[_0x6c1c('0x1d')](function(_0x1f24a4){return _0x1f24a4;});}return null;};}function removeEntity(_0x19f4af,_0x3d2bf3){return function(_0x450b1f){if(_0x450b1f){return _0x450b1f[_0x6c1c('0x1e')]()[_0x6c1c('0x1d')](function(){_0x19f4af[_0x6c1c('0x16')](0xcc)[_0x6c1c('0x1f')]();});}};}function handleEntityNotFound(_0x2319d3,_0x12c638){return function(_0x3a3f13){if(!_0x3a3f13){_0x2319d3[_0x6c1c('0x20')](0x194);}return _0x3a3f13;};}function handleError(_0x96046a,_0x3f517e){_0x3f517e=_0x3f517e||0x1f4;return function(_0x2ef382){logger[_0x6c1c('0x21')](_0x2ef382[_0x6c1c('0x22')]);if(_0x2ef382[_0x6c1c('0x23')]){delete _0x2ef382[_0x6c1c('0x23')];}_0x96046a[_0x6c1c('0x16')](_0x3f517e)[_0x6c1c('0x24')](_0x2ef382);};}exports['index']=function(_0x2595c3,_0x4d73aa){var _0x10e9f7={},_0x4c23f8={},_0xcd3179={'count':0x0,'rows':[]};var _0x5f286b=_[_0x6c1c('0x25')](db[_0x6c1c('0x26')]['rawAttributes'],function(_0x3b1a4f){return{'name':_0x3b1a4f[_0x6c1c('0x27')],'type':_0x3b1a4f['type'][_0x6c1c('0x28')]};});_0x4c23f8[_0x6c1c('0x29')]=_[_0x6c1c('0x25')](_0x5f286b,_0x6c1c('0x23'));_0x4c23f8['query']=_['keys'](_0x2595c3[_0x6c1c('0x2a')]);_0x4c23f8[_0x6c1c('0x2b')]=_[_0x6c1c('0x2c')](_0x4c23f8[_0x6c1c('0x29')],_0x4c23f8[_0x6c1c('0x2a')]);_0x10e9f7[_0x6c1c('0x2d')]=_['intersection'](_0x4c23f8[_0x6c1c('0x29')],qs[_0x6c1c('0x2e')](_0x2595c3['query'][_0x6c1c('0x2e')]));_0x10e9f7[_0x6c1c('0x2d')]=_0x10e9f7[_0x6c1c('0x2d')][_0x6c1c('0x2f')]?_0x10e9f7['attributes']:_0x4c23f8[_0x6c1c('0x29')];if(!_0x2595c3[_0x6c1c('0x2a')][_0x6c1c('0x30')]('nolimit')){_0x10e9f7[_0x6c1c('0x31')]=qs['limit'](_0x2595c3[_0x6c1c('0x2a')]['limit']);_0x10e9f7[_0x6c1c('0x18')]=qs[_0x6c1c('0x18')](_0x2595c3[_0x6c1c('0x2a')]['offset']);}_0x10e9f7['order']=qs[_0x6c1c('0x32')](_0x2595c3[_0x6c1c('0x2a')][_0x6c1c('0x32')]);_0x10e9f7['where']=qs[_0x6c1c('0x2b')](_['pick'](_0x2595c3['query'],_0x4c23f8[_0x6c1c('0x2b')]));if(_0x2595c3[_0x6c1c('0x2a')][_0x6c1c('0x33')]){_0x10e9f7[_0x6c1c('0x34')]=_['merge'](_0x10e9f7[_0x6c1c('0x34')],{'$or':_[_0x6c1c('0x25')](_0x5f286b,function(_0x387d62){if(_0x387d62[_0x6c1c('0x35')]!==_0x6c1c('0x36')){var _0x398e95={};_0x398e95[_0x387d62[_0x6c1c('0x23')]]={'$like':'%'+_0x2595c3[_0x6c1c('0x2a')][_0x6c1c('0x33')]+'%'};return _0x398e95;}})});}_0x10e9f7=_[_0x6c1c('0x37')]({},_0x10e9f7,_0x2595c3['options']);var _0xb05b38={'where':_0x10e9f7[_0x6c1c('0x34')]};return db[_0x6c1c('0x26')][_0x6c1c('0x38')](_0xb05b38)[_0x6c1c('0x1d')](function(_0x5c8177){_0xcd3179['count']=_0x5c8177;if(_0x2595c3['query'][_0x6c1c('0x39')]){_0x10e9f7['include']=[{'all':!![]}];}return db['MailSubstatus'][_0x6c1c('0x3a')](_0x10e9f7);})[_0x6c1c('0x1d')](function(_0x5f3f3e){_0xcd3179[_0x6c1c('0x3b')]=_0x5f3f3e;return _0xcd3179;})[_0x6c1c('0x1d')](respondWithFilteredResult(_0x4d73aa,_0x10e9f7))[_0x6c1c('0x3c')](handleError(_0x4d73aa,null));};exports['show']=function(_0x313f9d,_0x2c43e1){var _0x502e75={'raw':!![],'where':{'id':_0x313f9d['params']['id']}},_0x201940={};_0x201940[_0x6c1c('0x29')]=_[_0x6c1c('0x3d')](db[_0x6c1c('0x26')][_0x6c1c('0x3e')]);_0x201940[_0x6c1c('0x2a')]=_['keys'](_0x313f9d[_0x6c1c('0x2a')]);_0x201940[_0x6c1c('0x2b')]=_[_0x6c1c('0x2c')](_0x201940['model'],_0x201940[_0x6c1c('0x2a')]);_0x502e75[_0x6c1c('0x2d')]=_[_0x6c1c('0x2c')](_0x201940[_0x6c1c('0x29')],qs[_0x6c1c('0x2e')](_0x313f9d['query'][_0x6c1c('0x2e')]));_0x502e75['attributes']=_0x502e75['attributes']['length']?_0x502e75[_0x6c1c('0x2d')]:_0x201940[_0x6c1c('0x29')];if(_0x313f9d[_0x6c1c('0x2a')][_0x6c1c('0x39')]){_0x502e75[_0x6c1c('0x3f')]=[{'all':!![]}];}_0x502e75=_[_0x6c1c('0x37')]({},_0x502e75,_0x313f9d[_0x6c1c('0x40')]);return db[_0x6c1c('0x26')]['find'](_0x502e75)[_0x6c1c('0x1d')](handleEntityNotFound(_0x2c43e1,null))[_0x6c1c('0x1d')](respondWithResult(_0x2c43e1,null))['catch'](handleError(_0x2c43e1,null));};exports[_0x6c1c('0x41')]=function(_0x5518f6,_0x39e741){return db[_0x6c1c('0x26')][_0x6c1c('0x41')](_0x5518f6[_0x6c1c('0x42')],{})[_0x6c1c('0x1d')](respondWithResult(_0x39e741,0xc9))['catch'](handleError(_0x39e741,null));};exports[_0x6c1c('0x1c')]=function(_0x58d075,_0x2a59bc){if(_0x58d075[_0x6c1c('0x42')]['id']){delete _0x58d075[_0x6c1c('0x42')]['id'];}return db[_0x6c1c('0x26')][_0x6c1c('0x43')]({'where':{'id':_0x58d075[_0x6c1c('0x44')]['id']}})['then'](handleEntityNotFound(_0x2a59bc,null))[_0x6c1c('0x1d')](saveUpdates(_0x58d075[_0x6c1c('0x42')],null))['then'](respondWithResult(_0x2a59bc,null))[_0x6c1c('0x3c')](handleError(_0x2a59bc,null));};exports[_0x6c1c('0x1e')]=function(_0x2165a7,_0x22be7c){return db['MailSubstatus'][_0x6c1c('0x43')]({'where':{'id':_0x2165a7[_0x6c1c('0x44')]['id']}})[_0x6c1c('0x1d')](handleEntityNotFound(_0x22be7c,null))['then'](removeEntity(_0x22be7c,null))['catch'](handleError(_0x22be7c,null));};exports['describe']=function(_0x5714a6,_0x5008b7){return db[_0x6c1c('0x26')][_0x6c1c('0x45')]()['then'](respondWithResult(_0x5008b7,null))[_0x6c1c('0x3c')](handleError(_0x5008b7,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 4be0c5b..73bb3e2 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 _0x5ea2=['define','MailSubstatus','mail_substatuses','lodash','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x349148,_0x31eabb){var _0x2f2b0f=function(_0x44726e){while(--_0x44726e){_0x349148['push'](_0x349148['shift']());}};_0x2f2b0f(++_0x31eabb);}(_0x5ea2,0x99));var _0x25ea=function(_0x3f69e3,_0x1fefee){_0x3f69e3=_0x3f69e3-0x0;var _0x23ab02=_0x5ea2[_0x3f69e3];return _0x23ab02;};'use strict';var _=require(_0x25ea('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x25ea('0x1'));var moment=require(_0x25ea('0x2'));var BPromise=require(_0x25ea('0x3'));var rp=require(_0x25ea('0x4'));var fs=require('fs');var path=require(_0x25ea('0x5'));var rimraf=require('rimraf');var config=require(_0x25ea('0x6'));var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x3e32e9,_0x310a27){return _0x3e32e9[_0x25ea('0x7')](_0x25ea('0x8'),attributes,{'tableName':_0x25ea('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0b7f=['bluebird','request-promise','path','./mailSubstatus.attributes','exports','define','mail_substatuses','lodash','util','api'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0b7f,0x115));var _0xf0b7=function(_0x7625d9,_0x2fea5a){_0x7625d9=_0x7625d9-0x0;var _0x5c6d75=_0x0b7f[_0x7625d9];return _0x5c6d75;};'use strict';var _=require(_0xf0b7('0x0'));var util=require(_0xf0b7('0x1'));var logger=require('../../config/logger')(_0xf0b7('0x2'));var moment=require('moment');var BPromise=require(_0xf0b7('0x3'));var rp=require(_0xf0b7('0x4'));var fs=require('fs');var path=require(_0xf0b7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf0b7('0x6'));module[_0xf0b7('0x7')]=function(_0x77940d,_0x41c63d){return _0x77940d[_0xf0b7('0x8')]('MailSubstatus',attributes,{'tableName':_0xf0b7('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 b0dee3a..dcf166b 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 _0x70e0=['code','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x28a445,_0x299832){var _0x42a1b6=function(_0x46c846){while(--_0x46c846){_0x28a445['push'](_0x28a445['shift']());}};_0x42a1b6(++_0x299832);}(_0x70e0,0x17b));var _0x070e=function(_0x364ab5,_0x3d1ee7){_0x364ab5=_0x364ab5-0x0;var _0x1554cd=_0x70e0[_0x364ab5];return _0x1554cd;};'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')]('MailSubstatus,\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')]('MailSubstatus,\x20%s,\x20%s',_0x5032e5,_0x68a09e['error']['message']);return _0x1e11f0(_0x68a09e[_0x070e('0x10')][_0x070e('0x13')]);}else{logger['info']('MailSubstatus,\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 _0x54ef=['result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message'];(function(_0xf22d0b,_0x25669c){var _0xf5391d=function(_0x55d88f){while(--_0x55d88f){_0xf22d0b['push'](_0xf22d0b['shift']());}};_0xf5391d(++_0x25669c);}(_0x54ef,0x112));var _0xf54e=function(_0x4e76c7,_0x20c68d){_0x4e76c7=_0x4e76c7-0x0;var _0x156a72=_0x54ef[_0x4e76c7];return _0x156a72;};'use strict';var _=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var BPromise=require('bluebird');var rs=require(_0xf54e('0x3'));var fs=require('fs');var Redis=require(_0xf54e('0x4'));var db=require(_0xf54e('0x5'))['db'];var utils=require(_0xf54e('0x6'));var logger=require(_0xf54e('0x7'))(_0xf54e('0x8'));var config=require(_0xf54e('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf54e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x99cf9,_0x2464ae,_0x561870){return new BPromise(function(_0x27e69b,_0x57a1ce){return client[_0xf54e('0xb')](_0x99cf9,_0x561870)[_0xf54e('0xc')](function(_0x47c5e1){logger[_0xf54e('0xd')](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));logger[_0xf54e('0x10')]('MailSubstatus,\x20%s,\x20%s,\x20%s',_0x2464ae,_0xf54e('0xf'),JSON[_0xf54e('0x11')](_0x47c5e1));if(_0x47c5e1[_0xf54e('0x12')]){if(_0x47c5e1[_0xf54e('0x12')]['code']===0x1f4){logger[_0xf54e('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x2464ae,_0x47c5e1['error'][_0xf54e('0x13')]);return _0x57a1ce(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}logger[_0xf54e('0x12')]('MailSubstatus,\x20%s,\x20%s',_0x2464ae,_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);return _0x27e69b(_0x47c5e1[_0xf54e('0x12')][_0xf54e('0x13')]);}else{logger['info'](_0xf54e('0xe'),_0x2464ae,_0xf54e('0xf'));_0x27e69b(_0x47c5e1[_0xf54e('0x14')]['message']);}})['catch'](function(_0xd87020){logger[_0xf54e('0x12')](_0xf54e('0xe'),_0x2464ae,_0xd87020);_0x57a1ce(_0xd87020);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 586ecce..5a90e88 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 _0xe3b3=['/describe','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','isAuthenticated'];(function(_0x287dc9,_0x5f5583){var _0x5ab7cd=function(_0x269cd9){while(--_0x269cd9){_0x287dc9['push'](_0x287dc9['shift']());}};_0x5ab7cd(++_0x5f5583);}(_0xe3b3,0x80));var _0x3e3b=function(_0x52a00d,_0x3ca081){_0x52a00d=_0x52a00d-0x0;var _0x1943f6=_0xe3b3[_0x52a00d];return _0x1943f6;};'use strict';var multer=require(_0x3e3b('0x0'));var util=require(_0x3e3b('0x1'));var path=require(_0x3e3b('0x2'));var timeout=require(_0x3e3b('0x3'));var express=require(_0x3e3b('0x4'));var router=express[_0x3e3b('0x5')]();var auth=require(_0x3e3b('0x6'));var interaction=require(_0x3e3b('0x7'));var config=require(_0x3e3b('0x8'));var controller=require(_0x3e3b('0x9'));router[_0x3e3b('0xa')]('/',auth[_0x3e3b('0xb')](),controller['index']);router[_0x3e3b('0xa')](_0x3e3b('0xc'),auth[_0x3e3b('0xb')](),controller['describe']);router['get']('/:id',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0xd')]);router[_0x3e3b('0xe')]('/',auth[_0x3e3b('0xb')](),controller['create']);router[_0x3e3b('0xf')]('/:id',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0x10')]);router[_0x3e3b('0x11')]('/:id',auth[_0x3e3b('0xb')](),controller[_0x3e3b('0x12')]);module[_0x3e3b('0x13')]=router; \ No newline at end of file +var _0x024d=['/:id','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailTransferReport.controller','get','index','isAuthenticated'];(function(_0x41f5a6,_0xb35c51){var _0x241efd=function(_0x2cfaa5){while(--_0x2cfaa5){_0x41f5a6['push'](_0x41f5a6['shift']());}};_0x241efd(++_0xb35c51);}(_0x024d,0x126));var _0xd024=function(_0x2190af,_0xa751ea){_0x2190af=_0x2190af-0x0;var _0x4725b8=_0x024d[_0x2190af];return _0x4725b8;};'use strict';var multer=require(_0xd024('0x0'));var util=require(_0xd024('0x1'));var path=require(_0xd024('0x2'));var timeout=require(_0xd024('0x3'));var express=require(_0xd024('0x4'));var router=express[_0xd024('0x5')]();var auth=require(_0xd024('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd024('0x7'));var controller=require(_0xd024('0x8'));router[_0xd024('0x9')]('/',auth['isAuthenticated'](),controller[_0xd024('0xa')]);router[_0xd024('0x9')]('/describe',auth[_0xd024('0xb')](),controller['describe']);router[_0xd024('0x9')](_0xd024('0xc'),auth[_0xd024('0xb')](),controller['show']);router[_0xd024('0xd')]('/',auth[_0xd024('0xb')](),controller[_0xd024('0xe')]);router[_0xd024('0xf')](_0xd024('0xc'),auth[_0xd024('0xb')](),controller[_0xd024('0x10')]);router[_0xd024('0x11')](_0xd024('0xc'),auth[_0xd024('0xb')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index ee932a6..b42a801 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 _0x8695=['account','DATE','moment','sequelize','STRING'];(function(_0x35bcf0,_0x117d26){var _0x1b1fdc=function(_0xd163e9){while(--_0xd163e9){_0x35bcf0['push'](_0x35bcf0['shift']());}};_0x1b1fdc(++_0x117d26);}(_0x8695,0x1ab));var _0x5869=function(_0x5d44d7,_0x3c13ea){_0x5d44d7=_0x5d44d7-0x0;var _0xf7b8e7=_0x8695[_0x5d44d7];return _0xf7b8e7;};'use strict';var moment=require(_0x5869('0x0'));var Sequelize=require(_0x5869('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x5869('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x5869('0x3'),'agent','queue'),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x5869('0x4')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf46e=['sequelize','exports','account','agent','queue','moment'];(function(_0x1fdf47,_0x1da0d0){var _0x2f42d3=function(_0x56f2b3){while(--_0x56f2b3){_0x1fdf47['push'](_0x1fdf47['shift']());}};_0x2f42d3(++_0x1da0d0);}(_0xf46e,0x185));var _0xef46=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xf46e[_0x5ddb1c];return _0x354adc;};'use strict';var moment=require(_0xef46('0x0'));var Sequelize=require(_0xef46('0x1'));module[_0xef46('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0xef46('0x3'),_0xef46('0x4'),_0xef46('0x5')),'allowNull':![],'defaultValue':_0xef46('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 5aa1e7a..6bb1b77 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 _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','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x18efc2,_0x35d1cb){var _0x2a92a7=function(_0x11b2ec){while(--_0x11b2ec){_0x18efc2['push'](_0x18efc2['shift']());}};_0x2a92a7(++_0x35d1cb);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');var _=require(_0x7995('0xc'));var squel=require(_0x7995('0xd'));var crypto=require('crypto');var jsforce=require(_0x7995('0xe'));var deskjs=require(_0x7995('0xf'));var toCsv=require('to-csv');var querystring=require(_0x7995('0x10'));var Papa=require(_0x7995('0x11'));var Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file +var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x1a08ce,_0x470f17){var _0x13d2ee=function(_0x309ef1){while(--_0x309ef1){_0x1a08ce['push'](_0x1a08ce['shift']());}};_0x13d2ee(++_0x470f17);}(_0x7a54,0x106));var _0x47a5=function(_0x175fee,_0x28d5ea){_0x175fee=_0x175fee-0x0;var _0x367278=_0x7a54[_0x175fee];return _0x367278;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 7e7cc68..e7540ca 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 _0x3ac3=['moment','bluebird','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','api'];(function(_0x559139,_0xd4657f){var _0x48f785=function(_0x21d42f){while(--_0x21d42f){_0x559139['push'](_0x559139['shift']());}};_0x48f785(++_0xd4657f);}(_0x3ac3,0x64));var _0x33ac=function(_0x349367,_0x1cede2){_0x349367=_0x349367-0x0;var _0x14179b=_0x3ac3[_0x349367];return _0x14179b;};'use strict';var _=require(_0x33ac('0x0'));var util=require(_0x33ac('0x1'));var logger=require(_0x33ac('0x2'))(_0x33ac('0x3'));var moment=require(_0x33ac('0x4'));var BPromise=require(_0x33ac('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x33ac('0x6'));var config=require(_0x33ac('0x7'));var attributes=require(_0x33ac('0x8'));module[_0x33ac('0x9')]=function(_0x56840d,_0x3c8176){return _0x56840d[_0x33ac('0xa')](_0x33ac('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x33ac('0xc'),'fields':[_0x33ac('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x28ad=['uniqueid','../../config/logger','api','bluebird','rimraf','../../config/environment','./mailTransferReport.attributes','MailTransferReport','report_mail_transfer'];(function(_0x576a45,_0x3cac9b){var _0x3c5573=function(_0x382c51){while(--_0x382c51){_0x576a45['push'](_0x576a45['shift']());}};_0x3c5573(++_0x3cac9b);}(_0x28ad,0x1d5));var _0xd28a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x28ad[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd28a('0x0'))(_0xd28a('0x1'));var moment=require('moment');var BPromise=require(_0xd28a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd28a('0x3'));var config=require(_0xd28a('0x4'));var attributes=require(_0xd28a('0x5'));module['exports']=function(_0x1f5067,_0x293c57){return _0x1f5067['define'](_0xd28a('0x6'),attributes,{'tableName':_0xd28a('0x7'),'paranoid':![],'indexes':[{'name':_0xd28a('0x8'),'fields':[_0xd28a('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 16ef369..f90989f 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 _0x147a=['request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','MailTransferReport,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x147a,0x11d));var _0xa147=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0x147a[_0x3ff685];return _0x2046c9;};'use strict';var _=require(_0xa147('0x0'));var util=require(_0xa147('0x1'));var moment=require(_0xa147('0x2'));var BPromise=require(_0xa147('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa147('0x4'));var db=require(_0xa147('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa147('0x6'))(_0xa147('0x7'));var config=require(_0xa147('0x8'));var jayson=require(_0xa147('0x9'));var client=jayson[_0xa147('0xa')][_0xa147('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d7031,_0x5c72c8,_0x206b65){return new BPromise(function(_0x165472,_0x223b10){return client[_0xa147('0xc')](_0x2d7031,_0x206b65)['then'](function(_0x5b99b8){logger['info'](_0xa147('0xd'),_0x5c72c8,_0xa147('0xe'));logger[_0xa147('0xf')](_0xa147('0x10'),_0x5c72c8,_0xa147('0xe'),JSON[_0xa147('0x11')](_0x5b99b8));if(_0x5b99b8[_0xa147('0x12')]){if(_0x5b99b8[_0xa147('0x12')][_0xa147('0x13')]===0x1f4){logger[_0xa147('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x5c72c8,_0x5b99b8[_0xa147('0x12')][_0xa147('0x14')]);return _0x223b10(_0x5b99b8['error'][_0xa147('0x14')]);}logger['error'](_0xa147('0xd'),_0x5c72c8,_0x5b99b8['error'][_0xa147('0x14')]);return _0x165472(_0x5b99b8[_0xa147('0x12')][_0xa147('0x14')]);}else{logger[_0xa147('0x15')](_0xa147('0xd'),_0x5c72c8,'request\x20sent');_0x165472(_0x5b99b8[_0xa147('0x16')][_0xa147('0x14')]);}})['catch'](function(_0x248a49){logger[_0xa147('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x5c72c8,_0x248a49);_0x223b10(_0x248a49);});});} \ No newline at end of file +var _0x3ba6=['message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error'];(function(_0x101e7b,_0x4ef05b){var _0x4995c0=function(_0x1a6488){while(--_0x1a6488){_0x101e7b['push'](_0x101e7b['shift']());}};_0x4995c0(++_0x4ef05b);}(_0x3ba6,0x17a));var _0x63ba=function(_0x3f3f40,_0x4c71f4){_0x3f3f40=_0x3f3f40-0x0;var _0x403b7a=_0x3ba6[_0x3f3f40];return _0x403b7a;};'use strict';var _=require(_0x63ba('0x0'));var util=require(_0x63ba('0x1'));var moment=require('moment');var BPromise=require(_0x63ba('0x2'));var rs=require(_0x63ba('0x3'));var fs=require('fs');var Redis=require(_0x63ba('0x4'));var db=require(_0x63ba('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x63ba('0x6'))(_0x63ba('0x7'));var config=require(_0x63ba('0x8'));var jayson=require(_0x63ba('0x9'));var client=jayson[_0x63ba('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x479352,_0x4b58f1,_0x543aeb){return new BPromise(function(_0x4bbb3b,_0x5d6d78){return client[_0x63ba('0xb')](_0x479352,_0x543aeb)['then'](function(_0x19d641){logger['info'](_0x63ba('0xc'),_0x4b58f1,'request\x20sent');logger[_0x63ba('0xd')](_0x63ba('0xe'),_0x4b58f1,_0x63ba('0xf'),JSON[_0x63ba('0x10')](_0x19d641));if(_0x19d641[_0x63ba('0x11')]){if(_0x19d641[_0x63ba('0x11')]['code']===0x1f4){logger[_0x63ba('0x11')](_0x63ba('0xc'),_0x4b58f1,_0x19d641[_0x63ba('0x11')][_0x63ba('0x12')]);return _0x5d6d78(_0x19d641[_0x63ba('0x11')][_0x63ba('0x12')]);}logger[_0x63ba('0x11')](_0x63ba('0xc'),_0x4b58f1,_0x19d641[_0x63ba('0x11')][_0x63ba('0x12')]);return _0x4bbb3b(_0x19d641[_0x63ba('0x11')][_0x63ba('0x12')]);}else{logger[_0x63ba('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x4b58f1,'request\x20sent');_0x4bbb3b(_0x19d641[_0x63ba('0x14')][_0x63ba('0x12')]);}})[_0x63ba('0x15')](function(_0x5796bb){logger[_0x63ba('0x11')](_0x63ba('0xc'),_0x4b58f1,_0x5796bb);_0x5d6d78(_0x5796bb);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 7dcdc3a..4b5b929 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 _0x710e=['destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./memberReport.controller','get','/describe','isAuthenticated','describe','/:id','create','put','update','delete'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x710e,0xb6));var _0xe710=function(_0x20d4a2,_0x567089){_0x20d4a2=_0x20d4a2-0x0;var _0x22727c=_0x710e[_0x20d4a2];return _0x22727c;};'use strict';var multer=require(_0xe710('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xe710('0x1'));var express=require(_0xe710('0x2'));var router=express[_0xe710('0x3')]();var auth=require(_0xe710('0x4'));var interaction=require(_0xe710('0x5'));var config=require('../../config/environment');var controller=require(_0xe710('0x6'));router[_0xe710('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe710('0x7')](_0xe710('0x8'),auth[_0xe710('0x9')](),controller[_0xe710('0xa')]);router[_0xe710('0x7')](_0xe710('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xe710('0x9')](),controller[_0xe710('0xc')]);router[_0xe710('0xd')](_0xe710('0xb'),auth[_0xe710('0x9')](),controller[_0xe710('0xe')]);router[_0xe710('0xf')](_0xe710('0xb'),auth[_0xe710('0x9')](),controller[_0xe710('0x10')]);module[_0xe710('0x11')]=router; \ No newline at end of file +var _0x1c1d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','isAuthenticated','index','describe','get','show','post','create','put','/:id'];(function(_0x3365ac,_0x5b9c67){var _0x3ec760=function(_0x3ab90f){while(--_0x3ab90f){_0x3365ac['push'](_0x3365ac['shift']());}};_0x3ec760(++_0x5b9c67);}(_0x1c1d,0x174));var _0xd1c1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c1d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd1c1('0x0'));var util=require(_0xd1c1('0x1'));var path=require(_0xd1c1('0x2'));var timeout=require(_0xd1c1('0x3'));var express=require(_0xd1c1('0x4'));var router=express[_0xd1c1('0x5')]();var auth=require(_0xd1c1('0x6'));var interaction=require(_0xd1c1('0x7'));var config=require(_0xd1c1('0x8'));var controller=require(_0xd1c1('0x9'));router['get']('/',auth[_0xd1c1('0xa')](),controller[_0xd1c1('0xb')]);router['get']('/describe',auth[_0xd1c1('0xa')](),controller[_0xd1c1('0xc')]);router[_0xd1c1('0xd')]('/:id',auth[_0xd1c1('0xa')](),controller[_0xd1c1('0xe')]);router[_0xd1c1('0xf')]('/',auth[_0xd1c1('0xa')](),controller[_0xd1c1('0x10')]);router[_0xd1c1('0x11')](_0xd1c1('0x12'),auth[_0xd1c1('0xa')](),controller[_0xd1c1('0x13')]);router[_0xd1c1('0x14')](_0xd1c1('0x12'),auth[_0xd1c1('0xa')](),controller[_0xd1c1('0x15')]);module[_0xd1c1('0x16')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index ad4c6fe..282a9d3 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 _0xc176=['moment','exports','STRING','DEFAULT\x20PAUSE','INTEGER','DATE','enterAt','seconds','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x23a299,_0x30e49c){var _0x560bb3=function(_0x1c8073){while(--_0x1c8073){_0x23a299['push'](_0x23a299['shift']());}};_0x560bb3(++_0x30e49c);}(_0xc176,0x1a3));var _0x6c17=function(_0x1757f2,_0x1b09fa){_0x1757f2=_0x1757f2-0x0;var _0x5e7212=_0xc176[_0x1757f2];return _0x5e7212;};'use strict';var Sequelize=require(_0x6c17('0x0'));var moment=require(_0x6c17('0x1'));module[_0x6c17('0x2')]={'channel':{'type':Sequelize[_0x6c17('0x3')]},'membername':{'type':Sequelize[_0x6c17('0x3')]},'interface':{'type':Sequelize[_0x6c17('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':_0x6c17('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x6c17('0x5')]},'enterAt':{'type':Sequelize[_0x6c17('0x6')]},'exitAt':{'type':Sequelize['DATE'],'set':function(_0x49185d){var _0x3ffcef=moment(_0x49185d);var _0x403705=moment(this['getDataValue'](_0x6c17('0x7')));var _0x2af8fb=_0x3ffcef['diff'](_0x403705,_0x6c17('0x8'));this['setDataValue'](_0x6c17('0x9'),_0x49185d);this['setDataValue'](_0x6c17('0xa'),_0x2af8fb||null);}},'data1':{'type':Sequelize[_0x6c17('0x3')],'comment':_0x6c17('0xb')},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x6c17('0x3')],'comment':_0x6c17('0xc')},'data4':{'type':Sequelize[_0x6c17('0x3')],'comment':_0x6c17('0xd')},'data5':{'type':Sequelize[_0x6c17('0x3')],'comment':_0x6c17('0xe')},'role':{'type':Sequelize[_0x6c17('0x3')]},'internal':{'type':Sequelize[_0x6c17('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x65e4=['talk:[queue]','moment','exports','STRING','DEFAULT\x20PAUSE','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','seconds','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[destination]','talk:[dial\x20string]'];(function(_0x54ccd7,_0x3bc3ce){var _0x4e667b=function(_0xab8fea){while(--_0xab8fea){_0x54ccd7['push'](_0x54ccd7['shift']());}};_0x4e667b(++_0x3bc3ce);}(_0x65e4,0xd9));var _0x465e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x65e4[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x465e('0x0'));module[_0x465e('0x1')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x465e('0x2')]},'type':{'type':Sequelize[_0x465e('0x2')],'defaultValue':_0x465e('0x3'),'comment':_0x465e('0x4')},'duration':{'type':Sequelize[_0x465e('0x5')]},'enterAt':{'type':Sequelize[_0x465e('0x6')]},'exitAt':{'type':Sequelize[_0x465e('0x6')],'set':function(_0x2f9520){var _0x1dd786=moment(_0x2f9520);var _0x48d854=moment(this[_0x465e('0x7')](_0x465e('0x8')));var _0x205166=_0x1dd786[_0x465e('0x9')](_0x48d854,_0x465e('0xa'));this[_0x465e('0xb')](_0x465e('0xc'),_0x2f9520);this[_0x465e('0xb')](_0x465e('0xd'),_0x205166||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x465e('0xe')},'data2':{'type':Sequelize[_0x465e('0x2')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x465e('0x2')],'comment':_0x465e('0xf')},'data4':{'type':Sequelize[_0x465e('0x2')],'comment':_0x465e('0x10')},'data5':{'type':Sequelize[_0x465e('0x2')],'comment':_0x465e('0x11')},'role':{'type':Sequelize[_0x465e('0x2')]},'internal':{'type':Sequelize[_0x465e('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 d82ffca..12bf363 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 _0xeaa3=['show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','update','destroy','then','error','stack','name','send','index','map','MemberReport','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filters','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch'];(function(_0x5ed88a,_0x1d13a7){var _0x5233fb=function(_0x161cf2){while(--_0x161cf2){_0x5ed88a['push'](_0x5ed88a['shift']());}};_0x5233fb(++_0x1d13a7);}(_0xeaa3,0x12f));var _0x3eaa=function(_0x477def,_0x1f716c){_0x477def=_0x477def-0x0;var _0x1bee04=_0xeaa3[_0x477def];return _0x1bee04;};'use strict';var pdf=require(_0x3eaa('0x0'));var emlformat=require(_0x3eaa('0x1'));var rimraf=require(_0x3eaa('0x2'));var zipdir=require(_0x3eaa('0x3'));var jsonpatch=require(_0x3eaa('0x4'));var rp=require(_0x3eaa('0x5'));var moment=require('moment');var BPromise=require(_0x3eaa('0x6'));var Mustache=require(_0x3eaa('0x7'));var util=require(_0x3eaa('0x8'));var path=require('path');var sox=require(_0x3eaa('0x9'));var csv=require(_0x3eaa('0xa'));var ejs=require(_0x3eaa('0xb'));var fs=require('fs');var _=require(_0x3eaa('0xc'));var squel=require(_0x3eaa('0xd'));var crypto=require(_0x3eaa('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3eaa('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3eaa('0x10'));var Redis=require(_0x3eaa('0x11'));var authService=require(_0x3eaa('0x12'));var qs=require(_0x3eaa('0x13'));var as=require(_0x3eaa('0x14'));var hardwareService=require(_0x3eaa('0x15'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3eaa('0x16'));var db=require(_0x3eaa('0x17'))['db'];function respondWithStatusCode(_0x4bb504,_0x183321){_0x183321=_0x183321||0xcc;return function(_0x328e2b){if(_0x328e2b){return _0x4bb504[_0x3eaa('0x18')](_0x183321);}return _0x4bb504[_0x3eaa('0x19')](_0x183321)[_0x3eaa('0x1a')]();};}function respondWithResult(_0x427f73,_0x19392a){_0x19392a=_0x19392a||0xc8;return function(_0x4a61b0){if(_0x4a61b0){return _0x427f73['status'](_0x19392a)[_0x3eaa('0x1b')](_0x4a61b0);}};}function respondWithFilteredResult(_0x3c4210,_0x56fc4a){return function(_0x5b98b4){if(_0x5b98b4){var _0x30ff0c=_0x5b98b4[_0x3eaa('0x1c')],_0x5dd0ab=_0x56fc4a[_0x3eaa('0x1d')],_0x1c8dfb=_0x56fc4a[_0x3eaa('0x1d')]+_0x56fc4a[_0x3eaa('0x1e')],_0x4be3ca;if(_0x1c8dfb>=_0x30ff0c){_0x1c8dfb=_0x30ff0c;_0x4be3ca=0xc8;}else{_0x4be3ca=0xce;}_0x3c4210[_0x3eaa('0x19')](_0x4be3ca);return _0x3c4210['set'](_0x3eaa('0x1f'),_0x5dd0ab+'-'+_0x1c8dfb+'/'+_0x30ff0c)['json'](_0x5b98b4);}return null;};}function patchUpdates(_0x2c4ee1){return function(_0xd6f9ef){try{jsonpatch[_0x3eaa('0x20')](_0xd6f9ef,_0x2c4ee1,!![]);}catch(_0x7cdc9a){return BPromise['reject'](_0x7cdc9a);}return _0xd6f9ef[_0x3eaa('0x21')]();};}function saveUpdates(_0x29f862,_0x4e1395){return function(_0x5553c5){if(_0x5553c5){return _0x5553c5[_0x3eaa('0x22')](_0x29f862)['then'](function(_0x2b7f5f){return _0x2b7f5f;});}return null;};}function removeEntity(_0x22ce39,_0x5315eb){return function(_0x3067f4){if(_0x3067f4){return _0x3067f4[_0x3eaa('0x23')]()[_0x3eaa('0x24')](function(){_0x22ce39[_0x3eaa('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x393441,_0x251a79){return function(_0x594fca){if(!_0x594fca){_0x393441[_0x3eaa('0x18')](0x194);}return _0x594fca;};}function handleError(_0x246237,_0x42978d){_0x42978d=_0x42978d||0x1f4;return function(_0x1c3210){logger[_0x3eaa('0x25')](_0x1c3210[_0x3eaa('0x26')]);if(_0x1c3210['name']){delete _0x1c3210[_0x3eaa('0x27')];}_0x246237['status'](_0x42978d)[_0x3eaa('0x28')](_0x1c3210);};}exports[_0x3eaa('0x29')]=function(_0x5cfe58,_0x36b180){var _0x6b7667={},_0x1790a9={},_0x59d475={'count':0x0,'rows':[]};var _0x350770=_[_0x3eaa('0x2a')](db[_0x3eaa('0x2b')]['rawAttributes'],function(_0xc4ba49){return{'name':_0xc4ba49['fieldName'],'type':_0xc4ba49[_0x3eaa('0x2c')]['key']};});_0x1790a9[_0x3eaa('0x2d')]=_[_0x3eaa('0x2a')](_0x350770,_0x3eaa('0x27'));_0x1790a9[_0x3eaa('0x2e')]=_[_0x3eaa('0x2f')](_0x5cfe58[_0x3eaa('0x2e')]);_0x1790a9['filters']=_[_0x3eaa('0x30')](_0x1790a9[_0x3eaa('0x2d')],_0x1790a9[_0x3eaa('0x2e')]);_0x6b7667[_0x3eaa('0x31')]=_[_0x3eaa('0x30')](_0x1790a9[_0x3eaa('0x2d')],qs[_0x3eaa('0x32')](_0x5cfe58[_0x3eaa('0x2e')][_0x3eaa('0x32')]));_0x6b7667['attributes']=_0x6b7667[_0x3eaa('0x31')][_0x3eaa('0x33')]?_0x6b7667[_0x3eaa('0x31')]:_0x1790a9[_0x3eaa('0x2d')];if(!_0x5cfe58[_0x3eaa('0x2e')][_0x3eaa('0x34')](_0x3eaa('0x35'))){_0x6b7667[_0x3eaa('0x1e')]=qs[_0x3eaa('0x1e')](_0x5cfe58['query'][_0x3eaa('0x1e')]);_0x6b7667[_0x3eaa('0x1d')]=qs['offset'](_0x5cfe58[_0x3eaa('0x2e')]['offset']);}_0x6b7667[_0x3eaa('0x36')]=qs[_0x3eaa('0x37')](_0x5cfe58[_0x3eaa('0x2e')][_0x3eaa('0x37')]);_0x6b7667['where']=qs['filters'](_[_0x3eaa('0x38')](_0x5cfe58[_0x3eaa('0x2e')],_0x1790a9[_0x3eaa('0x39')]));if(_0x5cfe58[_0x3eaa('0x2e')]['filter']){_0x6b7667[_0x3eaa('0x3a')]=_[_0x3eaa('0x3b')](_0x6b7667['where'],{'$or':_[_0x3eaa('0x2a')](_0x350770,function(_0x537157){if(_0x537157[_0x3eaa('0x2c')]!==_0x3eaa('0x3c')){var _0x470729={};_0x470729[_0x537157[_0x3eaa('0x27')]]={'$like':'%'+_0x5cfe58[_0x3eaa('0x2e')][_0x3eaa('0x3d')]+'%'};return _0x470729;}})});}_0x6b7667=_[_0x3eaa('0x3b')]({},_0x6b7667,_0x5cfe58[_0x3eaa('0x3e')]);var _0x3f92d3={'where':_0x6b7667[_0x3eaa('0x3a')]};return db['MemberReport']['count'](_0x3f92d3)[_0x3eaa('0x24')](function(_0x58757){_0x59d475[_0x3eaa('0x1c')]=_0x58757;if(_0x5cfe58[_0x3eaa('0x2e')][_0x3eaa('0x3f')]){_0x6b7667[_0x3eaa('0x40')]=[{'all':!![]}];}return db['MemberReport'][_0x3eaa('0x41')](_0x6b7667);})['then'](function(_0x4c4b3c){_0x59d475['rows']=_0x4c4b3c;return _0x59d475;})[_0x3eaa('0x24')](respondWithFilteredResult(_0x36b180,_0x6b7667))[_0x3eaa('0x42')](handleError(_0x36b180,null));};exports[_0x3eaa('0x43')]=function(_0x5f4ba0,_0x1816a9){var _0x374460={'raw':!![],'where':{'id':_0x5f4ba0[_0x3eaa('0x44')]['id']}},_0x1da5f3={};_0x1da5f3[_0x3eaa('0x2d')]=_['keys'](db[_0x3eaa('0x2b')][_0x3eaa('0x45')]);_0x1da5f3['query']=_['keys'](_0x5f4ba0[_0x3eaa('0x2e')]);_0x1da5f3[_0x3eaa('0x39')]=_[_0x3eaa('0x30')](_0x1da5f3[_0x3eaa('0x2d')],_0x1da5f3[_0x3eaa('0x2e')]);_0x374460['attributes']=_[_0x3eaa('0x30')](_0x1da5f3[_0x3eaa('0x2d')],qs[_0x3eaa('0x32')](_0x5f4ba0[_0x3eaa('0x2e')][_0x3eaa('0x32')]));_0x374460[_0x3eaa('0x31')]=_0x374460[_0x3eaa('0x31')]['length']?_0x374460[_0x3eaa('0x31')]:_0x1da5f3[_0x3eaa('0x2d')];if(_0x5f4ba0[_0x3eaa('0x2e')]['includeAll']){_0x374460[_0x3eaa('0x40')]=[{'all':!![]}];}_0x374460=_[_0x3eaa('0x3b')]({},_0x374460,_0x5f4ba0['options']);return db[_0x3eaa('0x2b')][_0x3eaa('0x46')](_0x374460)[_0x3eaa('0x24')](handleEntityNotFound(_0x1816a9,null))['then'](respondWithResult(_0x1816a9,null))['catch'](handleError(_0x1816a9,null));};exports[_0x3eaa('0x47')]=function(_0x14407b,_0x84c604){return db[_0x3eaa('0x2b')][_0x3eaa('0x47')](_0x14407b[_0x3eaa('0x48')],{})[_0x3eaa('0x24')](respondWithResult(_0x84c604,0xc9))[_0x3eaa('0x42')](handleError(_0x84c604,null));};exports['update']=function(_0x1dd266,_0x50782e){if(_0x1dd266[_0x3eaa('0x48')]['id']){delete _0x1dd266[_0x3eaa('0x48')]['id'];}return db[_0x3eaa('0x2b')][_0x3eaa('0x46')]({'where':{'id':_0x1dd266['params']['id']}})[_0x3eaa('0x24')](handleEntityNotFound(_0x50782e,null))[_0x3eaa('0x24')](saveUpdates(_0x1dd266[_0x3eaa('0x48')],null))[_0x3eaa('0x24')](respondWithResult(_0x50782e,null))[_0x3eaa('0x42')](handleError(_0x50782e,null));};exports[_0x3eaa('0x23')]=function(_0x14db02,_0x548e17){return db[_0x3eaa('0x2b')][_0x3eaa('0x46')]({'where':{'id':_0x14db02[_0x3eaa('0x44')]['id']}})['then'](handleEntityNotFound(_0x548e17,null))[_0x3eaa('0x24')](removeEntity(_0x548e17,null))[_0x3eaa('0x42')](handleError(_0x548e17,null));};exports['describe']=function(_0x1fcf61,_0x4234c4){return db[_0x3eaa('0x2b')][_0x3eaa('0x49')]()[_0x3eaa('0x24')](respondWithResult(_0x4234c4,null))['catch'](handleError(_0x4234c4,null));}; \ No newline at end of file +var _0xeed7=['length','nolimit','sort','filter','where','merge','options','include','findAll','rows','catch','show','params','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','then','destroy','error','stack','name','index','map','MemberReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes'];(function(_0x19f78d,_0x8801d5){var _0x49be82=function(_0x245b36){while(--_0x245b36){_0x19f78d['push'](_0x19f78d['shift']());}};_0x49be82(++_0x8801d5);}(_0xeed7,0x160));var _0x7eed=function(_0x515456,_0x337190){_0x515456=_0x515456-0x0;var _0x5c34b5=_0xeed7[_0x515456];return _0x5c34b5;};'use strict';var pdf=require(_0x7eed('0x0'));var emlformat=require(_0x7eed('0x1'));var rimraf=require(_0x7eed('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7eed('0x3'));var rp=require(_0x7eed('0x4'));var moment=require(_0x7eed('0x5'));var BPromise=require(_0x7eed('0x6'));var Mustache=require(_0x7eed('0x7'));var util=require('util');var path=require('path');var sox=require(_0x7eed('0x8'));var csv=require('to-csv');var ejs=require(_0x7eed('0x9'));var fs=require('fs');var _=require(_0x7eed('0xa'));var squel=require(_0x7eed('0xb'));var crypto=require(_0x7eed('0xc'));var jsforce=require(_0x7eed('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x7eed('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x7eed('0xf'));var hardwareService=require(_0x7eed('0x10'));var logger=require(_0x7eed('0x11'))('api');var utils=require(_0x7eed('0x12'));var config=require('../../config/environment');var db=require(_0x7eed('0x13'))['db'];function respondWithStatusCode(_0x5a1d46,_0x1e9e80){_0x1e9e80=_0x1e9e80||0xcc;return function(_0x286568){if(_0x286568){return _0x5a1d46[_0x7eed('0x14')](_0x1e9e80);}return _0x5a1d46[_0x7eed('0x15')](_0x1e9e80)[_0x7eed('0x16')]();};}function respondWithResult(_0x5d170f,_0x13260a){_0x13260a=_0x13260a||0xc8;return function(_0xb291b){if(_0xb291b){return _0x5d170f[_0x7eed('0x15')](_0x13260a)['json'](_0xb291b);}};}function respondWithFilteredResult(_0x55786c,_0x3cbaa3){return function(_0x2ede97){if(_0x2ede97){var _0x285c03=_0x2ede97[_0x7eed('0x17')],_0x108311=_0x3cbaa3[_0x7eed('0x18')],_0x4ec1e1=_0x3cbaa3[_0x7eed('0x18')]+_0x3cbaa3[_0x7eed('0x19')],_0x31dc25;if(_0x4ec1e1>=_0x285c03){_0x4ec1e1=_0x285c03;_0x31dc25=0xc8;}else{_0x31dc25=0xce;}_0x55786c[_0x7eed('0x15')](_0x31dc25);return _0x55786c[_0x7eed('0x1a')]('Content-Range',_0x108311+'-'+_0x4ec1e1+'/'+_0x285c03)[_0x7eed('0x1b')](_0x2ede97);}return null;};}function patchUpdates(_0x28f4ee){return function(_0x347b48){try{jsonpatch['apply'](_0x347b48,_0x28f4ee,!![]);}catch(_0x390e7e){return BPromise[_0x7eed('0x1c')](_0x390e7e);}return _0x347b48[_0x7eed('0x1d')]();};}function saveUpdates(_0x1a0d6c,_0x2b4649){return function(_0x40818e){if(_0x40818e){return _0x40818e[_0x7eed('0x1e')](_0x1a0d6c)[_0x7eed('0x1f')](function(_0x5d764a){return _0x5d764a;});}return null;};}function removeEntity(_0x5a4ece,_0x5d5793){return function(_0x2297f3){if(_0x2297f3){return _0x2297f3[_0x7eed('0x20')]()[_0x7eed('0x1f')](function(){_0x5a4ece['status'](0xcc)[_0x7eed('0x16')]();});}};}function handleEntityNotFound(_0x2e0e67,_0x501ff3){return function(_0xc09c1b){if(!_0xc09c1b){_0x2e0e67[_0x7eed('0x14')](0x194);}return _0xc09c1b;};}function handleError(_0x5f11d8,_0x14b32a){_0x14b32a=_0x14b32a||0x1f4;return function(_0x4e9c83){logger[_0x7eed('0x21')](_0x4e9c83[_0x7eed('0x22')]);if(_0x4e9c83[_0x7eed('0x23')]){delete _0x4e9c83[_0x7eed('0x23')];}_0x5f11d8[_0x7eed('0x15')](_0x14b32a)['send'](_0x4e9c83);};}exports[_0x7eed('0x24')]=function(_0x486712,_0x107fca){var _0x57d5de={},_0xa11131={},_0x29d543={'count':0x0,'rows':[]};var _0xdfb709=_[_0x7eed('0x25')](db[_0x7eed('0x26')][_0x7eed('0x27')],function(_0x567078){return{'name':_0x567078[_0x7eed('0x28')],'type':_0x567078[_0x7eed('0x29')][_0x7eed('0x2a')]};});_0xa11131[_0x7eed('0x2b')]=_[_0x7eed('0x25')](_0xdfb709,_0x7eed('0x23'));_0xa11131['query']=_[_0x7eed('0x2c')](_0x486712[_0x7eed('0x2d')]);_0xa11131[_0x7eed('0x2e')]=_[_0x7eed('0x2f')](_0xa11131[_0x7eed('0x2b')],_0xa11131[_0x7eed('0x2d')]);_0x57d5de['attributes']=_[_0x7eed('0x2f')](_0xa11131[_0x7eed('0x2b')],qs[_0x7eed('0x30')](_0x486712['query'][_0x7eed('0x30')]));_0x57d5de[_0x7eed('0x31')]=_0x57d5de[_0x7eed('0x31')][_0x7eed('0x32')]?_0x57d5de[_0x7eed('0x31')]:_0xa11131[_0x7eed('0x2b')];if(!_0x486712[_0x7eed('0x2d')]['hasOwnProperty'](_0x7eed('0x33'))){_0x57d5de[_0x7eed('0x19')]=qs[_0x7eed('0x19')](_0x486712[_0x7eed('0x2d')][_0x7eed('0x19')]);_0x57d5de[_0x7eed('0x18')]=qs[_0x7eed('0x18')](_0x486712[_0x7eed('0x2d')][_0x7eed('0x18')]);}_0x57d5de['order']=qs[_0x7eed('0x34')](_0x486712['query'][_0x7eed('0x34')]);_0x57d5de['where']=qs[_0x7eed('0x2e')](_['pick'](_0x486712[_0x7eed('0x2d')],_0xa11131[_0x7eed('0x2e')]));if(_0x486712[_0x7eed('0x2d')][_0x7eed('0x35')]){_0x57d5de[_0x7eed('0x36')]=_[_0x7eed('0x37')](_0x57d5de['where'],{'$or':_['map'](_0xdfb709,function(_0x527693){if(_0x527693[_0x7eed('0x29')]!=='VIRTUAL'){var _0x59325d={};_0x59325d[_0x527693['name']]={'$like':'%'+_0x486712[_0x7eed('0x2d')][_0x7eed('0x35')]+'%'};return _0x59325d;}})});}_0x57d5de=_[_0x7eed('0x37')]({},_0x57d5de,_0x486712[_0x7eed('0x38')]);var _0x4b10d5={'where':_0x57d5de[_0x7eed('0x36')]};return db[_0x7eed('0x26')][_0x7eed('0x17')](_0x4b10d5)[_0x7eed('0x1f')](function(_0xd6a4f4){_0x29d543['count']=_0xd6a4f4;if(_0x486712[_0x7eed('0x2d')]['includeAll']){_0x57d5de[_0x7eed('0x39')]=[{'all':!![]}];}return db['MemberReport'][_0x7eed('0x3a')](_0x57d5de);})[_0x7eed('0x1f')](function(_0x8c9e33){_0x29d543[_0x7eed('0x3b')]=_0x8c9e33;return _0x29d543;})[_0x7eed('0x1f')](respondWithFilteredResult(_0x107fca,_0x57d5de))[_0x7eed('0x3c')](handleError(_0x107fca,null));};exports[_0x7eed('0x3d')]=function(_0x5302d6,_0x32ee42){var _0x574a03={'raw':!![],'where':{'id':_0x5302d6[_0x7eed('0x3e')]['id']}},_0x321240={};_0x321240['model']=_['keys'](db[_0x7eed('0x26')]['rawAttributes']);_0x321240['query']=_['keys'](_0x5302d6[_0x7eed('0x2d')]);_0x321240[_0x7eed('0x2e')]=_[_0x7eed('0x2f')](_0x321240['model'],_0x321240[_0x7eed('0x2d')]);_0x574a03[_0x7eed('0x31')]=_['intersection'](_0x321240[_0x7eed('0x2b')],qs[_0x7eed('0x30')](_0x5302d6[_0x7eed('0x2d')]['fields']));_0x574a03[_0x7eed('0x31')]=_0x574a03['attributes'][_0x7eed('0x32')]?_0x574a03[_0x7eed('0x31')]:_0x321240[_0x7eed('0x2b')];if(_0x5302d6[_0x7eed('0x2d')]['includeAll']){_0x574a03[_0x7eed('0x39')]=[{'all':!![]}];}_0x574a03=_['merge']({},_0x574a03,_0x5302d6['options']);return db[_0x7eed('0x26')]['find'](_0x574a03)[_0x7eed('0x1f')](handleEntityNotFound(_0x32ee42,null))[_0x7eed('0x1f')](respondWithResult(_0x32ee42,null))[_0x7eed('0x3c')](handleError(_0x32ee42,null));};exports[_0x7eed('0x3f')]=function(_0x1ace22,_0x63a314){return db[_0x7eed('0x26')]['create'](_0x1ace22[_0x7eed('0x40')],{})[_0x7eed('0x1f')](respondWithResult(_0x63a314,0xc9))[_0x7eed('0x3c')](handleError(_0x63a314,null));};exports[_0x7eed('0x1e')]=function(_0x47e2f4,_0x23075d){if(_0x47e2f4[_0x7eed('0x40')]['id']){delete _0x47e2f4[_0x7eed('0x40')]['id'];}return db[_0x7eed('0x26')][_0x7eed('0x41')]({'where':{'id':_0x47e2f4[_0x7eed('0x3e')]['id']}})['then'](handleEntityNotFound(_0x23075d,null))[_0x7eed('0x1f')](saveUpdates(_0x47e2f4[_0x7eed('0x40')],null))[_0x7eed('0x1f')](respondWithResult(_0x23075d,null))[_0x7eed('0x3c')](handleError(_0x23075d,null));};exports[_0x7eed('0x20')]=function(_0x4dfec6,_0x5759b8){return db['MemberReport']['find']({'where':{'id':_0x4dfec6[_0x7eed('0x3e')]['id']}})['then'](handleEntityNotFound(_0x5759b8,null))[_0x7eed('0x1f')](removeEntity(_0x5759b8,null))[_0x7eed('0x3c')](handleError(_0x5759b8,null));};exports[_0x7eed('0x42')]=function(_0x13f820,_0x4ed3d7){return db[_0x7eed('0x26')][_0x7eed('0x42')]()['then'](respondWithResult(_0x4ed3d7,null))[_0x7eed('0x3c')](handleError(_0x4ed3d7,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 8091995..96dfd73 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 _0x25f3=['define','membername_interface','membername','interface','util','api','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x95b84,_0x1dff40){var _0x1bd420=function(_0x4e2328){while(--_0x4e2328){_0x95b84['push'](_0x95b84['shift']());}};_0x1bd420(++_0x1dff40);}(_0x25f3,0x118));var _0x325f=function(_0xea0044,_0x2fb220){_0xea0044=_0xea0044-0x0;var _0x476b9d=_0x25f3[_0xea0044];return _0x476b9d;};'use strict';var _=require('lodash');var util=require(_0x325f('0x0'));var logger=require('../../config/logger')(_0x325f('0x1'));var moment=require('moment');var BPromise=require(_0x325f('0x2'));var rp=require(_0x325f('0x3'));var fs=require('fs');var path=require(_0x325f('0x4'));var rimraf=require(_0x325f('0x5'));var config=require(_0x325f('0x6'));var attributes=require('./memberReport.attributes');module[_0x325f('0x7')]=function(_0x3ec551,_0x23ef08){return _0x3ec551[_0x325f('0x8')]('MemberReport',attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x325f('0x9'),'fields':[_0x325f('0xa'),_0x325f('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x87ee=['moment','bluebird','request-promise','path','../../config/environment','exports','define','report_member','membername_interface','membername','lodash'];(function(_0x5b5c66,_0x232916){var _0x19c519=function(_0x2f64bd){while(--_0x2f64bd){_0x5b5c66['push'](_0x5b5c66['shift']());}};_0x19c519(++_0x232916);}(_0x87ee,0x107));var _0xe87e=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x87ee[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0xe87e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xe87e('0x1'));var BPromise=require(_0xe87e('0x2'));var rp=require(_0xe87e('0x3'));var fs=require('fs');var path=require(_0xe87e('0x4'));var rimraf=require('rimraf');var config=require(_0xe87e('0x5'));var attributes=require('./memberReport.attributes');module[_0xe87e('0x6')]=function(_0x45d81a,_0x2f8d09){return _0x45d81a[_0xe87e('0x7')]('MemberReport',attributes,{'tableName':_0xe87e('0x8'),'paranoid':![],'indexes':[{'name':_0xe87e('0x9'),'fields':[_0xe87e('0xa'),'interface']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 951e549..9b98dbe 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 _0x2856=['create','body','stringify','UpdateMemberReport','update','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','MemberReport,\x20%s,\x20%s','message','result','catch','GetMemberReport','MemberReport','options','raw','include','map','model','attributes','info','CreateMemberReport'];(function(_0x1dd06f,_0x2214aa){var _0x2491fe=function(_0x59eb27){while(--_0x59eb27){_0x1dd06f['push'](_0x1dd06f['shift']());}};_0x2491fe(++_0x2214aa);}(_0x2856,0x14a));var _0x6285=function(_0x4a3168,_0x494f38){_0x4a3168=_0x4a3168-0x0;var _0x35c154=_0x2856[_0x4a3168];return _0x35c154;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x6285('0x0'));var BPromise=require(_0x6285('0x1'));var rs=require(_0x6285('0x2'));var fs=require('fs');var Redis=require(_0x6285('0x3'));var db=require(_0x6285('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6285('0x5'))(_0x6285('0x6'));var config=require(_0x6285('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6285('0x8')][_0x6285('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb668c8,_0x33690c,_0x3f0536){return new BPromise(function(_0x1264fa,_0xa458e1){return client[_0x6285('0xa')](_0xb668c8,_0x3f0536)[_0x6285('0xb')](function(_0x38df20){logger['info']('MemberReport,\x20%s,\x20%s',_0x33690c,_0x6285('0xc'));logger[_0x6285('0xd')](_0x6285('0xe'),_0x33690c,_0x6285('0xc'),JSON['stringify'](_0x38df20));if(_0x38df20['error']){if(_0x38df20[_0x6285('0xf')]['code']===0x1f4){logger[_0x6285('0xf')](_0x6285('0x10'),_0x33690c,_0x38df20[_0x6285('0xf')]['message']);return _0xa458e1(_0x38df20['error'][_0x6285('0x11')]);}logger[_0x6285('0xf')](_0x6285('0x10'),_0x33690c,_0x38df20[_0x6285('0xf')][_0x6285('0x11')]);return _0x1264fa(_0x38df20[_0x6285('0xf')][_0x6285('0x11')]);}else{logger['info'](_0x6285('0x10'),_0x33690c,_0x6285('0xc'));_0x1264fa(_0x38df20[_0x6285('0x12')][_0x6285('0x11')]);}})[_0x6285('0x13')](function(_0x413f2c){logger[_0x6285('0xf')](_0x6285('0x10'),_0x33690c,_0x413f2c);_0xa458e1(_0x413f2c);});});}exports[_0x6285('0x14')]=function(_0x48227b){var _0x4e5318=this;return new Promise(function(_0x4b1429,_0x527dfa){return db[_0x6285('0x15')]['findAll']({'raw':_0x48227b[_0x6285('0x16')]?_0x48227b[_0x6285('0x16')][_0x6285('0x17')]===undefined?!![]:![]:!![],'where':_0x48227b[_0x6285('0x16')]?_0x48227b[_0x6285('0x16')]['where']||null:null,'attributes':_0x48227b[_0x6285('0x16')]?_0x48227b[_0x6285('0x16')]['attributes']||null:null,'limit':_0x48227b[_0x6285('0x16')]?_0x48227b[_0x6285('0x16')]['limit']||null:null,'include':_0x48227b[_0x6285('0x16')]?_0x48227b[_0x6285('0x16')][_0x6285('0x18')]?_[_0x6285('0x19')](_0x48227b[_0x6285('0x16')]['include'],function(_0x47ce83){return{'model':db[_0x47ce83[_0x6285('0x1a')]],'as':_0x47ce83['as'],'attributes':_0x47ce83[_0x6285('0x1b')],'include':_0x47ce83[_0x6285('0x18')]?_[_0x6285('0x19')](_0x47ce83[_0x6285('0x18')],function(_0x4982fd){return{'model':db[_0x4982fd[_0x6285('0x1a')]],'as':_0x4982fd['as'],'attributes':_0x4982fd[_0x6285('0x1b')],'include':_0x4982fd[_0x6285('0x18')]?_['map'](_0x4982fd[_0x6285('0x18')],function(_0x5312a4){return{'model':db[_0x5312a4['model']],'as':_0x5312a4['as'],'attributes':_0x5312a4[_0x6285('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x6285('0xb')](function(_0x508d87){logger[_0x6285('0x1c')](_0x6285('0x14'),_0x48227b);logger['debug']('GetMemberReport',_0x48227b,JSON['stringify'](_0x508d87));_0x4b1429(_0x508d87);})[_0x6285('0x13')](function(_0x4389b5){logger[_0x6285('0xf')](_0x6285('0x14'),_0x4389b5['message'],_0x48227b);_0x527dfa(_0x4e5318['error'](0x1f4,_0x4389b5[_0x6285('0x11')]));});});};exports[_0x6285('0x1d')]=function(_0x2023d2){var _0x2d8299=this;return new Promise(function(_0x263758,_0x4074b2){return db[_0x6285('0x15')][_0x6285('0x1e')](_0x2023d2[_0x6285('0x1f')],{'raw':_0x2023d2[_0x6285('0x16')]?_0x2023d2['options'][_0x6285('0x17')]===undefined?!![]:![]:!![]})[_0x6285('0xb')](function(_0x268f8e){logger[_0x6285('0x1c')](_0x6285('0x1d'),_0x2023d2);logger[_0x6285('0xd')](_0x6285('0x1d'),_0x2023d2,JSON[_0x6285('0x20')](_0x268f8e));_0x263758(_0x268f8e);})['catch'](function(_0x385485){logger[_0x6285('0xf')](_0x6285('0x1d'),_0x385485[_0x6285('0x11')],_0x2023d2);_0x4074b2(_0x2d8299['error'](0x1f4,_0x385485[_0x6285('0x11')]));});});};exports[_0x6285('0x21')]=function(_0x5f3ca8){var _0x42a76d=this;return new Promise(function(_0x1b314f,_0x6fe44b){return db[_0x6285('0x15')][_0x6285('0x22')](_0x5f3ca8[_0x6285('0x1f')],{'raw':_0x5f3ca8[_0x6285('0x16')]?_0x5f3ca8[_0x6285('0x16')][_0x6285('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5f3ca8[_0x6285('0x16')]?_0x5f3ca8[_0x6285('0x16')]['where']||null:null,'attributes':_0x5f3ca8[_0x6285('0x16')]?_0x5f3ca8[_0x6285('0x16')][_0x6285('0x1b')]||null:null,'limit':_0x5f3ca8[_0x6285('0x16')]?_0x5f3ca8[_0x6285('0x16')][_0x6285('0x23')]||null:null})[_0x6285('0xb')](function(_0x5a78ef){logger[_0x6285('0x1c')](_0x6285('0x21'),_0x5f3ca8);logger['debug'](_0x6285('0x21'),_0x5f3ca8,JSON[_0x6285('0x20')](_0x5a78ef));_0x1b314f(_0x5a78ef);})[_0x6285('0x13')](function(_0x522024){logger[_0x6285('0xf')](_0x6285('0x21'),_0x522024[_0x6285('0x11')],_0x5f3ca8);_0x6fe44b(_0x42a76d[_0x6285('0xf')](0x1f4,_0x522024['message']));});});}; \ No newline at end of file +var _0xfb10=['catch','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','GetMemberReport','create','body','CreateMemberReport','UpdateMemberReport','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','debug','request\x20sent','stringify','error','message','MemberReport,\x20%s,\x20%s','result'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xfb10,0x1d7));var _0x0fb1=function(_0x51c81b,_0x12cf67){_0x51c81b=_0x51c81b-0x0;var _0x2eae1a=_0xfb10[_0x51c81b];return _0x2eae1a;};'use strict';var _=require('lodash');var util=require(_0x0fb1('0x0'));var moment=require(_0x0fb1('0x1'));var BPromise=require(_0x0fb1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0fb1('0x3'))['db'];var utils=require(_0x0fb1('0x4'));var logger=require(_0x0fb1('0x5'))(_0x0fb1('0x6'));var config=require('../../config/environment');var jayson=require(_0x0fb1('0x7'));var client=jayson[_0x0fb1('0x8')][_0x0fb1('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd870c2,_0x55f6ce,_0x4ebc3a){return new BPromise(function(_0x2dff78,_0x54d968){return client['request'](_0xd870c2,_0x4ebc3a)[_0x0fb1('0xa')](function(_0x5fdc4f){logger[_0x0fb1('0xb')]('MemberReport,\x20%s,\x20%s',_0x55f6ce,'request\x20sent');logger[_0x0fb1('0xc')]('MemberReport,\x20%s,\x20%s,\x20%s',_0x55f6ce,_0x0fb1('0xd'),JSON[_0x0fb1('0xe')](_0x5fdc4f));if(_0x5fdc4f[_0x0fb1('0xf')]){if(_0x5fdc4f[_0x0fb1('0xf')]['code']===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x55f6ce,_0x5fdc4f[_0x0fb1('0xf')][_0x0fb1('0x10')]);return _0x54d968(_0x5fdc4f[_0x0fb1('0xf')][_0x0fb1('0x10')]);}logger[_0x0fb1('0xf')]('MemberReport,\x20%s,\x20%s',_0x55f6ce,_0x5fdc4f[_0x0fb1('0xf')][_0x0fb1('0x10')]);return _0x2dff78(_0x5fdc4f[_0x0fb1('0xf')][_0x0fb1('0x10')]);}else{logger[_0x0fb1('0xb')](_0x0fb1('0x11'),_0x55f6ce,_0x0fb1('0xd'));_0x2dff78(_0x5fdc4f[_0x0fb1('0x12')]['message']);}})[_0x0fb1('0x13')](function(_0x3c6aff){logger['error'](_0x0fb1('0x11'),_0x55f6ce,_0x3c6aff);_0x54d968(_0x3c6aff);});});}exports['GetMemberReport']=function(_0x346cbd){var _0x17d69f=this;return new Promise(function(_0x56d2ca,_0xa692d2){return db[_0x0fb1('0x14')][_0x0fb1('0x15')]({'raw':_0x346cbd[_0x0fb1('0x16')]?_0x346cbd[_0x0fb1('0x16')][_0x0fb1('0x17')]===undefined?!![]:![]:!![],'where':_0x346cbd[_0x0fb1('0x16')]?_0x346cbd[_0x0fb1('0x16')][_0x0fb1('0x18')]||null:null,'attributes':_0x346cbd['options']?_0x346cbd[_0x0fb1('0x16')][_0x0fb1('0x19')]||null:null,'limit':_0x346cbd[_0x0fb1('0x16')]?_0x346cbd['options'][_0x0fb1('0x1a')]||null:null,'include':_0x346cbd[_0x0fb1('0x16')]?_0x346cbd['options'][_0x0fb1('0x1b')]?_[_0x0fb1('0x1c')](_0x346cbd[_0x0fb1('0x16')][_0x0fb1('0x1b')],function(_0x422e90){return{'model':db[_0x422e90[_0x0fb1('0x1d')]],'as':_0x422e90['as'],'attributes':_0x422e90['attributes'],'include':_0x422e90[_0x0fb1('0x1b')]?_[_0x0fb1('0x1c')](_0x422e90['include'],function(_0x5271af){return{'model':db[_0x5271af[_0x0fb1('0x1d')]],'as':_0x5271af['as'],'attributes':_0x5271af['attributes'],'include':_0x5271af[_0x0fb1('0x1b')]?_[_0x0fb1('0x1c')](_0x5271af['include'],function(_0x363c90){return{'model':db[_0x363c90[_0x0fb1('0x1d')]],'as':_0x363c90['as'],'attributes':_0x363c90[_0x0fb1('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x159ef5){logger['info']('GetMemberReport',_0x346cbd);logger['debug'](_0x0fb1('0x1e'),_0x346cbd,JSON['stringify'](_0x159ef5));_0x56d2ca(_0x159ef5);})[_0x0fb1('0x13')](function(_0x436c3d){logger[_0x0fb1('0xf')](_0x0fb1('0x1e'),_0x436c3d[_0x0fb1('0x10')],_0x346cbd);_0xa692d2(_0x17d69f[_0x0fb1('0xf')](0x1f4,_0x436c3d[_0x0fb1('0x10')]));});});};exports['CreateMemberReport']=function(_0x1c3836){var _0x2098a6=this;return new Promise(function(_0x474fff,_0x3550fc){return db[_0x0fb1('0x14')][_0x0fb1('0x1f')](_0x1c3836[_0x0fb1('0x20')],{'raw':_0x1c3836[_0x0fb1('0x16')]?_0x1c3836[_0x0fb1('0x16')][_0x0fb1('0x17')]===undefined?!![]:![]:!![]})[_0x0fb1('0xa')](function(_0x37fd53){logger[_0x0fb1('0xb')]('CreateMemberReport',_0x1c3836);logger['debug'](_0x0fb1('0x21'),_0x1c3836,JSON[_0x0fb1('0xe')](_0x37fd53));_0x474fff(_0x37fd53);})[_0x0fb1('0x13')](function(_0x530cac){logger[_0x0fb1('0xf')](_0x0fb1('0x21'),_0x530cac[_0x0fb1('0x10')],_0x1c3836);_0x3550fc(_0x2098a6[_0x0fb1('0xf')](0x1f4,_0x530cac[_0x0fb1('0x10')]));});});};exports[_0x0fb1('0x22')]=function(_0x231f37){var _0x3348dc=this;return new Promise(function(_0x14741b,_0x257776){return db[_0x0fb1('0x14')]['update'](_0x231f37[_0x0fb1('0x20')],{'raw':_0x231f37[_0x0fb1('0x16')]?_0x231f37[_0x0fb1('0x16')][_0x0fb1('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x231f37[_0x0fb1('0x16')]?_0x231f37[_0x0fb1('0x16')]['where']||null:null,'attributes':_0x231f37[_0x0fb1('0x16')]?_0x231f37[_0x0fb1('0x16')]['attributes']||null:null,'limit':_0x231f37['options']?_0x231f37['options'][_0x0fb1('0x1a')]||null:null})[_0x0fb1('0xa')](function(_0x38a809){logger[_0x0fb1('0xb')](_0x0fb1('0x22'),_0x231f37);logger[_0x0fb1('0xc')](_0x0fb1('0x22'),_0x231f37,JSON[_0x0fb1('0xe')](_0x38a809));_0x14741b(_0x38a809);})[_0x0fb1('0x13')](function(_0x11a5f8){logger[_0x0fb1('0xf')](_0x0fb1('0x22'),_0x11a5f8['message'],_0x231f37);_0x257776(_0x3348dc[_0x0fb1('0xf')](0x1f4,_0x11a5f8[_0x0fb1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 182e132..a64be6b 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 _0x3de3=['../../config/environment','get','index','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x23b573,_0x30bf32){var _0x12cc74=function(_0x50524f){while(--_0x50524f){_0x23b573['push'](_0x23b573['shift']());}};_0x12cc74(++_0x30bf32);}(_0x3de3,0x1ce));var _0x33de=function(_0x181ca1,_0x1c6b3e){_0x181ca1=_0x181ca1-0x0;var _0x5066cc=_0x3de3[_0x181ca1];return _0x5066cc;};'use strict';var multer=require(_0x33de('0x0'));var util=require('util');var path=require(_0x33de('0x1'));var timeout=require(_0x33de('0x2'));var express=require('express');var router=express[_0x33de('0x3')]();var auth=require(_0x33de('0x4'));var interaction=require(_0x33de('0x5'));var config=require(_0x33de('0x6'));var controller=require('./migration.controller');router[_0x33de('0x7')]('/',controller[_0x33de('0x8')]);module['exports']=router; \ No newline at end of file +var _0x065e=['./migration.controller','get','exports','multer','express','Router','../../components/auth/service'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x065e,0x1a7));var _0xe065=function(_0x4a7e6f,_0xcdc01){_0x4a7e6f=_0x4a7e6f-0x0;var _0x171f99=_0x065e[_0x4a7e6f];return _0x171f99;};'use strict';var multer=require(_0xe065('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe065('0x1'));var router=express[_0xe065('0x2')]();var auth=require(_0xe065('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe065('0x4'));router[_0xe065('0x5')]('/',controller['index']);module[_0xe065('0x6')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 631ce88..c4c22ce 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 _0x3e1f=['sequelize','exports'];(function(_0x14dc5d,_0x350620){var _0x1099d7=function(_0x4ec1e3){while(--_0x4ec1e3){_0x14dc5d['push'](_0x14dc5d['shift']());}};_0x1099d7(++_0x350620);}(_0x3e1f,0x16e));var _0xf3e1=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0x3e1f[_0xe65ac8];return _0x202ba1;};'use strict';var Sequelize=require(_0xf3e1('0x0'));module[_0xf3e1('0x1')]={'version':{'type':Sequelize['STRING'],'unique':'version'}}; \ No newline at end of file +var _0xa047=['exports','version','sequelize'];(function(_0x5aad59,_0x7098f9){var _0x42cbf4=function(_0x39b821){while(--_0x39b821){_0x5aad59['push'](_0x5aad59['shift']());}};_0x42cbf4(++_0x7098f9);}(_0xa047,0x155));var _0x7a04=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0xa047[_0x13b8f3];return _0x1a6d06;};'use strict';var Sequelize=require(_0x7a04('0x0'));module[_0x7a04('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x7a04('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 368c9cf..5b59cd3 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 _0x7a54=['filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x49be45,_0x2d3c47){var _0xae26f7=function(_0x44509e){while(--_0x44509e){_0x49be45['push'](_0x49be45['shift']());}};_0xae26f7(++_0x2d3c47);}(_0x7a54,0x106));var _0x47a5=function(_0x35f833,_0x5bc490){_0x35f833=_0x35f833-0x0;var _0x175579=_0x7a54[_0x35f833];return _0x175579;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['Migration'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));}; \ No newline at end of file +var _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x2cab18,_0xecbee7){var _0x2986dd=function(_0x3f807e){while(--_0x3f807e){_0x2cab18['push'](_0x2cab18['shift']());}};_0x2986dd(++_0xecbee7);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3d4f17,_0x558cb8){_0x3d4f17=_0x3d4f17-0x0;var _0x196c0e=_0x5f2f[_0x3d4f17];return _0x196c0e;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index b245068..3308e7e 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 _0x2163=['Migration','migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x26ad91,_0x345907){var _0x329b15=function(_0x2bb2f7){while(--_0x2bb2f7){_0x26ad91['push'](_0x26ad91['shift']());}};_0x329b15(++_0x345907);}(_0x2163,0xf2));var _0x3216=function(_0x3f092c,_0x33af85){_0x3f092c=_0x3f092c-0x0;var _0x4d11d1=_0x2163[_0x3f092c];return _0x4d11d1;};'use strict';var _=require(_0x3216('0x0'));var util=require('util');var logger=require(_0x3216('0x1'))(_0x3216('0x2'));var moment=require(_0x3216('0x3'));var BPromise=require(_0x3216('0x4'));var rp=require(_0x3216('0x5'));var fs=require('fs');var path=require(_0x3216('0x6'));var rimraf=require(_0x3216('0x7'));var config=require(_0x3216('0x8'));var attributes=require('./migration.attributes');module[_0x3216('0x9')]=function(_0x46d68d,_0x6f7d14){return _0x46d68d['define'](_0x3216('0xa'),attributes,{'tableName':_0x3216('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa5a2=['../../config/logger','api','bluebird','request-promise','path','rimraf','./migration.attributes','exports','migrations','util'];(function(_0x509531,_0x49d76a){var _0x555433=function(_0x5ae529){while(--_0x5ae529){_0x509531['push'](_0x509531['shift']());}};_0x555433(++_0x49d76a);}(_0xa5a2,0x121));var _0x2a5a=function(_0x4250a7,_0x5bf1a1){_0x4250a7=_0x4250a7-0x0;var _0x4cbb79=_0xa5a2[_0x4250a7];return _0x4cbb79;};'use strict';var _=require('lodash');var util=require(_0x2a5a('0x0'));var logger=require(_0x2a5a('0x1'))(_0x2a5a('0x2'));var moment=require('moment');var BPromise=require(_0x2a5a('0x3'));var rp=require(_0x2a5a('0x4'));var fs=require('fs');var path=require(_0x2a5a('0x5'));var rimraf=require(_0x2a5a('0x6'));var config=require('../../config/environment');var attributes=require(_0x2a5a('0x7'));module[_0x2a5a('0x8')]=function(_0x49ed30,_0x4b5a41){return _0x49ed30['define']('Migration',attributes,{'tableName':_0x2a5a('0x9'),'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 d914025..caaab14 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 _0x761c=['../../config/utils','rpc','jayson/promise','client','http','request','then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2cfb58,_0x3d9412){var _0xd99951=function(_0x329afa){while(--_0x329afa){_0x2cfb58['push'](_0x2cfb58['shift']());}};_0xd99951(++_0x3d9412);}(_0x761c,0x18a));var _0xc761=function(_0xcbe023,_0x70bd37){_0xcbe023=_0xcbe023-0x0;var _0x596acc=_0x761c[_0xcbe023];return _0x596acc;};'use strict';var _=require(_0xc761('0x0'));var util=require('util');var moment=require(_0xc761('0x1'));var BPromise=require(_0xc761('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc761('0x3'));var db=require(_0xc761('0x4'))['db'];var utils=require(_0xc761('0x5'));var logger=require('../../config/logger')(_0xc761('0x6'));var config=require('../../config/environment');var jayson=require(_0xc761('0x7'));var client=jayson[_0xc761('0x8')][_0xc761('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xafa0bd,_0x2f4f2e,_0x444747){return new BPromise(function(_0x46e882,_0x507772){return client[_0xc761('0xa')](_0xafa0bd,_0x444747)[_0xc761('0xb')](function(_0x175c1c){logger[_0xc761('0xc')](_0xc761('0xd'),_0x2f4f2e,_0xc761('0xe'));logger[_0xc761('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x2f4f2e,'request\x20sent',JSON[_0xc761('0x10')](_0x175c1c));if(_0x175c1c[_0xc761('0x11')]){if(_0x175c1c['error']['code']===0x1f4){logger[_0xc761('0x11')]('Migration,\x20%s,\x20%s',_0x2f4f2e,_0x175c1c[_0xc761('0x11')]['message']);return _0x507772(_0x175c1c[_0xc761('0x11')]['message']);}logger[_0xc761('0x11')](_0xc761('0xd'),_0x2f4f2e,_0x175c1c[_0xc761('0x11')][_0xc761('0x12')]);return _0x46e882(_0x175c1c[_0xc761('0x11')][_0xc761('0x12')]);}else{logger[_0xc761('0xc')]('Migration,\x20%s,\x20%s',_0x2f4f2e,'request\x20sent');_0x46e882(_0x175c1c[_0xc761('0x13')][_0xc761('0x12')]);}})[_0xc761('0x14')](function(_0x597085){logger[_0xc761('0x11')](_0xc761('0xd'),_0x2f4f2e,_0x597085);_0x507772(_0x597085);});});} \ No newline at end of file +var _0xd2f3=['Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x21622a,_0x24224b){var _0x30ecd0=function(_0x3c1836){while(--_0x3c1836){_0x21622a['push'](_0x21622a['shift']());}};_0x30ecd0(++_0x24224b);}(_0xd2f3,0x169));var _0x3d2f=function(_0x727710,_0xdfbec4){_0x727710=_0x727710-0x0;var _0x249c71=_0xd2f3[_0x727710];return _0x249c71;};'use strict';var _=require('lodash');var util=require(_0x3d2f('0x0'));var moment=require(_0x3d2f('0x1'));var BPromise=require(_0x3d2f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3d2f('0x3'));var db=require(_0x3d2f('0x4'))['db'];var utils=require(_0x3d2f('0x5'));var logger=require(_0x3d2f('0x6'))('rpc');var config=require(_0x3d2f('0x7'));var jayson=require(_0x3d2f('0x8'));var client=jayson['client'][_0x3d2f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x49c075,_0x579e41,_0x4a66b7){return new BPromise(function(_0x479e39,_0x57e73d){return client[_0x3d2f('0xa')](_0x49c075,_0x4a66b7)[_0x3d2f('0xb')](function(_0x53cb46){logger[_0x3d2f('0xc')](_0x3d2f('0xd'),_0x579e41,_0x3d2f('0xe'));logger[_0x3d2f('0xf')]('Migration,\x20%s,\x20%s,\x20%s',_0x579e41,_0x3d2f('0xe'),JSON[_0x3d2f('0x10')](_0x53cb46));if(_0x53cb46[_0x3d2f('0x11')]){if(_0x53cb46[_0x3d2f('0x11')][_0x3d2f('0x12')]===0x1f4){logger[_0x3d2f('0x11')]('Migration,\x20%s,\x20%s',_0x579e41,_0x53cb46[_0x3d2f('0x11')][_0x3d2f('0x13')]);return _0x57e73d(_0x53cb46['error'][_0x3d2f('0x13')]);}logger[_0x3d2f('0x11')](_0x3d2f('0xd'),_0x579e41,_0x53cb46[_0x3d2f('0x11')][_0x3d2f('0x13')]);return _0x479e39(_0x53cb46[_0x3d2f('0x11')][_0x3d2f('0x13')]);}else{logger['info']('Migration,\x20%s,\x20%s',_0x579e41,_0x3d2f('0xe'));_0x479e39(_0x53cb46[_0x3d2f('0x14')][_0x3d2f('0x13')]);}})[_0x3d2f('0x15')](function(_0x239991){logger[_0x3d2f('0x11')](_0x3d2f('0xd'),_0x579e41,_0x239991);_0x57e73d(_0x239991);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 264e9e2..6cb9125 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 _0xb6af=['destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./network.controller','get','isAuthenticated','index','show','post','create','/:id','update','delete'];(function(_0x1d20ba,_0x5425bf){var _0x347f2a=function(_0x488c9b){while(--_0x488c9b){_0x1d20ba['push'](_0x1d20ba['shift']());}};_0x347f2a(++_0x5425bf);}(_0xb6af,0x1ce));var _0xfb6a=function(_0x5235dd,_0x3f91cf){_0x5235dd=_0x5235dd-0x0;var _0x13059d=_0xb6af[_0x5235dd];return _0x13059d;};'use strict';var multer=require(_0xfb6a('0x0'));var util=require(_0xfb6a('0x1'));var path=require(_0xfb6a('0x2'));var timeout=require('connect-timeout');var express=require(_0xfb6a('0x3'));var router=express[_0xfb6a('0x4')]();var auth=require(_0xfb6a('0x5'));var interaction=require(_0xfb6a('0x6'));var config=require(_0xfb6a('0x7'));var controller=require(_0xfb6a('0x8'));router[_0xfb6a('0x9')]('/',auth[_0xfb6a('0xa')](),controller[_0xfb6a('0xb')]);router['get']('/:id',auth[_0xfb6a('0xa')](),controller[_0xfb6a('0xc')]);router[_0xfb6a('0xd')]('/',auth['isAuthenticated'](),controller[_0xfb6a('0xe')]);router['put'](_0xfb6a('0xf'),auth['isAuthenticated'](),controller[_0xfb6a('0x10')]);router[_0xfb6a('0x11')](_0xfb6a('0xf'),auth['isAuthenticated'](),controller[_0xfb6a('0x12')]);module[_0xfb6a('0x13')]=router; \ No newline at end of file +var _0x321b=['./network.controller','get','isAuthenticated','index','/:id','post','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x580c7f,_0x2ecf18){var _0x3b90e1=function(_0x2413ee){while(--_0x2413ee){_0x580c7f['push'](_0x580c7f['shift']());}};_0x3b90e1(++_0x2ecf18);}(_0x321b,0x161));var _0xb321=function(_0x46e1f2,_0x4651ee){_0x46e1f2=_0x46e1f2-0x0;var _0x3e0093=_0x321b[_0x46e1f2];return _0x3e0093;};'use strict';var multer=require(_0xb321('0x0'));var util=require('util');var path=require(_0xb321('0x1'));var timeout=require(_0xb321('0x2'));var express=require('express');var router=express[_0xb321('0x3')]();var auth=require(_0xb321('0x4'));var interaction=require(_0xb321('0x5'));var config=require(_0xb321('0x6'));var controller=require(_0xb321('0x7'));router[_0xb321('0x8')]('/',auth[_0xb321('0x9')](),controller[_0xb321('0xa')]);router[_0xb321('0x8')](_0xb321('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xb321('0xc')]('/',auth[_0xb321('0x9')](),controller['create']);router['put'](_0xb321('0xb'),auth[_0xb321('0x9')](),controller['update']);router['delete'](_0xb321('0xb'),auth[_0xb321('0x9')](),controller[_0xb321('0xd')]);module[_0xb321('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 8f06193..6ce3837 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 _0x7485=['sequelize','exports','ENUM','localnet','STRING'];(function(_0x45c536,_0x52a556){var _0x10e06d=function(_0x3fcca0){while(--_0x3fcca0){_0x45c536['push'](_0x45c536['shift']());}};_0x10e06d(++_0x52a556);}(_0x7485,0xaf));var _0x5748=function(_0x1d797e,_0x1ecf94){_0x1d797e=_0x1d797e-0x0;var _0x13d73e=_0x7485[_0x1d797e];return _0x13d73e;};'use strict';var Sequelize=require(_0x5748('0x0'));module[_0x5748('0x1')]={'type':{'type':Sequelize[_0x5748('0x2')](_0x5748('0x3'),'externip')},'value':{'type':Sequelize[_0x5748('0x4')]}}; \ No newline at end of file +var _0xca16=['exports','ENUM','localnet','externip','STRING','sequelize'];(function(_0x4ce1b9,_0x397a4b){var _0x2bb15d=function(_0x3790ad){while(--_0x3790ad){_0x4ce1b9['push'](_0x4ce1b9['shift']());}};_0x2bb15d(++_0x397a4b);}(_0xca16,0xa1));var _0x6ca1=function(_0x11f1d1,_0x4b9966){_0x11f1d1=_0x11f1d1-0x0;var _0x5032d4=_0xca16[_0x11f1d1];return _0x5032d4;};'use strict';var Sequelize=require(_0x6ca1('0x0'));module[_0x6ca1('0x1')]={'type':{'type':Sequelize[_0x6ca1('0x2')](_0x6ca1('0x3'),_0x6ca1('0x4'))},'value':{'type':Sequelize[_0x6ca1('0x5')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index dfd0084..79e6112 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 _0x3688=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','Network,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','status','json','offset','limit','set','Content-Range','update','destroy','stack','send','index','map','Network','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','name','count','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','find','create','sequelize','transaction','body','join','server/files/templates/network.ejs','utf8','render','writeFileSync','format','chan_sip.so','readFileSync','root','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','html-pdf','rimraf','zip-dir','mustache','util','sox','to-csv','ejs'];(function(_0x5eb462,_0x5b9889){var _0x4c3bc6=function(_0x108ebe){while(--_0x108ebe){_0x5eb462['push'](_0x5eb462['shift']());}};_0x4c3bc6(++_0x5b9889);}(_0x3688,0x170));var _0x8368=function(_0x401696,_0x1153e8){_0x401696=_0x401696-0x0;var _0x1e9aec=_0x3688[_0x401696];return _0x1e9aec;};'use strict';var pdf=require(_0x8368('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8368('0x1'));var zipdir=require(_0x8368('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8368('0x3'));var util=require(_0x8368('0x4'));var path=require('path');var sox=require(_0x8368('0x5'));var csv=require(_0x8368('0x6'));var ejs=require(_0x8368('0x7'));var fs=require('fs');var _=require(_0x8368('0x8'));var squel=require(_0x8368('0x9'));var crypto=require(_0x8368('0xa'));var jsforce=require(_0x8368('0xb'));var deskjs=require(_0x8368('0xc'));var toCsv=require(_0x8368('0x6'));var querystring=require(_0x8368('0xd'));var Papa=require(_0x8368('0xe'));var Redis=require(_0x8368('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8368('0x10'));var as=require(_0x8368('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8368('0x12'))('api');var utils=require(_0x8368('0x13'));var config=require(_0x8368('0x14'));var db=require('../../mysqldb')['db'];var jayson=require(_0x8368('0x15'));var client=jayson[_0x8368('0x16')][_0x8368('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4c7c3d,_0x448da3,_0x2f80b0){if(_0x2f80b0){var _0x27021c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27021c[_0x8368('0x18')](_0x448da3)){return _0x4c7c3d;}else{throw new db[(_0x8368('0x19'))][(_0x8368('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4c7c3d;}}function respondWithRpcPromise(_0x2008a2,_0x5be4ef,_0x5a6a6f,_0x23d6db){return new BPromise(function(_0x58cedb,_0xc58d36){var _0x44a508=_0x23d6db||client;return _0x44a508[_0x8368('0x1b')](_0x2008a2,_0x5a6a6f)[_0x8368('0x1c')](function(_0x53e1bd){logger[_0x8368('0x1d')](_0x8368('0x1e'),_0x5be4ef,_0x8368('0x1f'));logger['debug']('Network,\x20%s,\x20%s,\x20%s',_0x5be4ef,_0x8368('0x1f'),JSON[_0x8368('0x20')](_0x53e1bd));if(_0x53e1bd[_0x8368('0x21')]){if(_0x53e1bd[_0x8368('0x21')][_0x8368('0x22')]===0x1f4){logger[_0x8368('0x21')](_0x8368('0x1e'),_0x5be4ef,_0x53e1bd[_0x8368('0x21')][_0x8368('0x23')]);return _0xc58d36(_0x53e1bd['error'][_0x8368('0x23')]);}logger[_0x8368('0x21')](_0x8368('0x1e'),_0x5be4ef,_0x53e1bd[_0x8368('0x21')][_0x8368('0x23')]);return _0x58cedb(_0x53e1bd[_0x8368('0x21')]['message']);}else{logger[_0x8368('0x1d')](_0x8368('0x1e'),_0x5be4ef,_0x8368('0x1f'));_0x58cedb(_0x53e1bd[_0x8368('0x24')][_0x8368('0x23')]);}})['catch'](function(_0x30a5fc){logger[_0x8368('0x21')](_0x8368('0x1e'),_0x5be4ef,_0x30a5fc);_0xc58d36(_0x30a5fc);});});}function respondWithStatusCode(_0x320474,_0x57a32b){_0x57a32b=_0x57a32b||0xcc;return function(_0x5a6fdb){if(_0x5a6fdb){return _0x320474[_0x8368('0x25')](_0x57a32b);}return _0x320474[_0x8368('0x26')](_0x57a32b)['end']();};}function respondWithResult(_0x541a70,_0x2259fc){_0x2259fc=_0x2259fc||0xc8;return function(_0x5eebf5){if(_0x5eebf5){return _0x541a70[_0x8368('0x26')](_0x2259fc)[_0x8368('0x27')](_0x5eebf5);}};}function respondWithFilteredResult(_0x550cbb,_0x131a7d){return function(_0x48c75e){if(_0x48c75e){var _0x4051b3=_0x48c75e['count'],_0x1f915f=_0x131a7d[_0x8368('0x28')],_0xdea953=_0x131a7d['offset']+_0x131a7d[_0x8368('0x29')],_0x1cc45f;if(_0xdea953>=_0x4051b3){_0xdea953=_0x4051b3;_0x1cc45f=0xc8;}else{_0x1cc45f=0xce;}_0x550cbb[_0x8368('0x26')](_0x1cc45f);return _0x550cbb[_0x8368('0x2a')](_0x8368('0x2b'),_0x1f915f+'-'+_0xdea953+'/'+_0x4051b3)[_0x8368('0x27')](_0x48c75e);}return null;};}function patchUpdates(_0x105a95){return function(_0x1b6fa1){try{jsonpatch['apply'](_0x1b6fa1,_0x105a95,!![]);}catch(_0x5b0329){return BPromise['reject'](_0x5b0329);}return _0x1b6fa1['save']();};}function saveUpdates(_0x593c87,_0x35b20f){return function(_0x2ffc7b){if(_0x2ffc7b){return _0x2ffc7b[_0x8368('0x2c')](_0x593c87)[_0x8368('0x1c')](function(_0x5e47a2){return _0x5e47a2;});}return null;};}function removeEntity(_0x4ce3a0,_0x238ea9){return function(_0x5adfef){if(_0x5adfef){return _0x5adfef[_0x8368('0x2d')]()[_0x8368('0x1c')](function(){_0x4ce3a0[_0x8368('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1f104a,_0x2a1ae9){return function(_0x4fc75e){if(!_0x4fc75e){_0x1f104a['sendStatus'](0x194);}return _0x4fc75e;};}function handleError(_0x4aec16,_0x11be01){_0x11be01=_0x11be01||0x1f4;return function(_0x1129ba){logger['error'](_0x1129ba[_0x8368('0x2e')]);if(_0x1129ba['name']){delete _0x1129ba['name'];}_0x4aec16[_0x8368('0x26')](_0x11be01)[_0x8368('0x2f')](_0x1129ba);};}exports[_0x8368('0x30')]=function(_0x1afd74,_0x1f9a03){var _0x4d7486={},_0x19582a={},_0x2054df={'count':0x0,'rows':[]};var _0x588bbe=_[_0x8368('0x31')](db[_0x8368('0x32')]['rawAttributes'],function(_0x145a33){return{'name':_0x145a33[_0x8368('0x33')],'type':_0x145a33[_0x8368('0x34')]['key']};});_0x19582a[_0x8368('0x35')]=_['map'](_0x588bbe,'name');_0x19582a[_0x8368('0x36')]=_['keys'](_0x1afd74['query']);_0x19582a[_0x8368('0x37')]=_[_0x8368('0x38')](_0x19582a[_0x8368('0x35')],_0x19582a[_0x8368('0x36')]);_0x4d7486[_0x8368('0x39')]=_[_0x8368('0x38')](_0x19582a[_0x8368('0x35')],qs[_0x8368('0x3a')](_0x1afd74['query']['fields']));_0x4d7486[_0x8368('0x39')]=_0x4d7486[_0x8368('0x39')][_0x8368('0x3b')]?_0x4d7486[_0x8368('0x39')]:_0x19582a[_0x8368('0x35')];if(!_0x1afd74['query'][_0x8368('0x3c')](_0x8368('0x3d'))){_0x4d7486['limit']=qs['limit'](_0x1afd74[_0x8368('0x36')][_0x8368('0x29')]);_0x4d7486[_0x8368('0x28')]=qs[_0x8368('0x28')](_0x1afd74[_0x8368('0x36')]['offset']);}_0x4d7486[_0x8368('0x3e')]=qs['sort'](_0x1afd74[_0x8368('0x36')]['sort']);_0x4d7486[_0x8368('0x3f')]=qs['filters'](_['pick'](_0x1afd74[_0x8368('0x36')],_0x19582a[_0x8368('0x37')]));if(_0x1afd74[_0x8368('0x36')][_0x8368('0x40')]){_0x4d7486[_0x8368('0x3f')]=_[_0x8368('0x41')](_0x4d7486[_0x8368('0x3f')],{'$or':_[_0x8368('0x31')](_0x588bbe,function(_0xc1945){if(_0xc1945[_0x8368('0x34')]!==_0x8368('0x42')){var _0x565a19={};_0x565a19[_0xc1945[_0x8368('0x43')]]={'$like':'%'+_0x1afd74[_0x8368('0x36')][_0x8368('0x40')]+'%'};return _0x565a19;}})});}_0x4d7486=_[_0x8368('0x41')]({},_0x4d7486,_0x1afd74['options']);var _0x5d20ba={'where':_0x4d7486[_0x8368('0x3f')]};return db['Network'][_0x8368('0x44')](_0x5d20ba)[_0x8368('0x1c')](function(_0x565f28){_0x2054df[_0x8368('0x44')]=_0x565f28;if(_0x1afd74[_0x8368('0x36')][_0x8368('0x45')]){_0x4d7486[_0x8368('0x46')]=[{'all':!![]}];}return db['Network'][_0x8368('0x47')](_0x4d7486);})[_0x8368('0x1c')](function(_0x32d10f){_0x2054df[_0x8368('0x48')]=_0x32d10f;return _0x2054df;})[_0x8368('0x1c')](respondWithFilteredResult(_0x1f9a03,_0x4d7486))[_0x8368('0x49')](handleError(_0x1f9a03,null));};exports['show']=function(_0x5ca9de,_0x21c22f){var _0x5ac125={'raw':!![],'where':{'id':_0x5ca9de[_0x8368('0x4a')]['id']}},_0x39968f={};_0x39968f[_0x8368('0x35')]=_[_0x8368('0x4b')](db[_0x8368('0x32')][_0x8368('0x4c')]);_0x39968f[_0x8368('0x36')]=_['keys'](_0x5ca9de[_0x8368('0x36')]);_0x39968f[_0x8368('0x37')]=_[_0x8368('0x38')](_0x39968f['model'],_0x39968f[_0x8368('0x36')]);_0x5ac125[_0x8368('0x39')]=_['intersection'](_0x39968f['model'],qs[_0x8368('0x3a')](_0x5ca9de[_0x8368('0x36')][_0x8368('0x3a')]));_0x5ac125['attributes']=_0x5ac125[_0x8368('0x39')][_0x8368('0x3b')]?_0x5ac125[_0x8368('0x39')]:_0x39968f[_0x8368('0x35')];if(_0x5ca9de[_0x8368('0x36')][_0x8368('0x45')]){_0x5ac125[_0x8368('0x46')]=[{'all':!![]}];}_0x5ac125=_[_0x8368('0x41')]({},_0x5ac125,_0x5ca9de['options']);return db[_0x8368('0x32')][_0x8368('0x4d')](_0x5ac125)[_0x8368('0x1c')](handleEntityNotFound(_0x21c22f,null))[_0x8368('0x1c')](respondWithResult(_0x21c22f,null))[_0x8368('0x49')](handleError(_0x21c22f,null));};exports[_0x8368('0x4e')]=function(_0xfe4034,_0x5d76d1,_0x3f14e3){var _0x1264c1;return db[_0x8368('0x4f')][_0x8368('0x50')](function(_0x10fa93){return db[_0x8368('0x32')][_0x8368('0x4e')](_0xfe4034[_0x8368('0x51')],{'raw':!![]})['then'](function(_0x5133ca){_0x1264c1=_0x5133ca;return db['Network']['findAll']({'where':{'type':_0xfe4034[_0x8368('0x51')][_0x8368('0x34')]},'raw':!![]});})['then'](function(_0x509bd1){var _0x1bf619=fs['readFileSync'](path[_0x8368('0x52')](config['root'],_0x8368('0x53')),_0x8368('0x54'));var _0x1b2e6c=ejs[_0x8368('0x55')](_0x1bf619,{'networks':_0x509bd1||[]});fs[_0x8368('0x56')](util[_0x8368('0x57')]('/etc/asterisk/sip_xcally_%s.conf',_0xfe4034['body']['type']['toLowerCase']()),_0x1b2e6c);})['then'](function(){return respondWithRpcPromise('Reload','create',{'module':_0x8368('0x58')});})['then'](function(){return _0x1264c1;});})[_0x8368('0x1c')](respondWithResult(_0x5d76d1,0xc9))['catch'](handleError(_0x5d76d1,null));};exports[_0x8368('0x2c')]=function(_0x5aaa09,_0x3acd14,_0x3d51bf){var _0x36f04f;return db[_0x8368('0x4f')][_0x8368('0x50')](function(_0x437312){return db[_0x8368('0x32')]['find']({'where':{'id':_0x5aaa09[_0x8368('0x4a')]['id']}})['then'](handleEntityNotFound(_0x3acd14,null))['then'](saveUpdates(_0x5aaa09[_0x8368('0x51')],null))[_0x8368('0x1c')](function(_0x12ff83){if(_0x12ff83){_0x36f04f=_0x12ff83;return db['Network']['findAll']({'where':{'type':_0x36f04f[_0x8368('0x34')]},'raw':!![]});}return null;})[_0x8368('0x1c')](function(_0x261be1){if(_0x261be1){var _0x1e3f41=fs[_0x8368('0x59')](path['join'](config[_0x8368('0x5a')],_0x8368('0x53')),_0x8368('0x54'));var _0x3f4cb2=ejs[_0x8368('0x55')](_0x1e3f41,{'networks':_0x261be1||[]});fs[_0x8368('0x56')](util[_0x8368('0x57')](_0x8368('0x5b'),_0x36f04f[_0x8368('0x34')][_0x8368('0x5c')]()),_0x3f4cb2);return respondWithRpcPromise(_0x8368('0x5d'),_0x8368('0x2c'),{'module':_0x8368('0x58')});}return null;})[_0x8368('0x1c')](function(_0x2955e4){if(_0x2955e4){return _0x36f04f;}return null;});})[_0x8368('0x1c')](respondWithResult(_0x3acd14,null))[_0x8368('0x49')](handleError(_0x3acd14,null));};exports[_0x8368('0x2d')]=function(_0x398e5c,_0x36c8b4,_0x58a5c8){var _0x3b14f8;return db[_0x8368('0x32')][_0x8368('0x4d')]({'where':{'id':_0x398e5c[_0x8368('0x4a')]['id']}})[_0x8368('0x1c')](function(_0xc8d940){_0x3b14f8=_0xc8d940;return _0xc8d940;})[_0x8368('0x1c')](handleEntityNotFound(_0x36c8b4,null))[_0x8368('0x1c')](removeEntity(_0x36c8b4,null))['then'](function(){if(_0x3b14f8){return db[_0x8368('0x32')][_0x8368('0x47')]({'where':{'type':_0x3b14f8[_0x8368('0x34')]},'raw':!![]});}})['then'](function(_0xa61fa9){if(_0xa61fa9){var _0x1f9843=fs[_0x8368('0x59')](path[_0x8368('0x52')](config[_0x8368('0x5a')],_0x8368('0x53')),'utf8');var _0x3b67be=ejs[_0x8368('0x55')](_0x1f9843,{'networks':_0xa61fa9||[]});fs[_0x8368('0x56')](util[_0x8368('0x57')](_0x8368('0x5b'),_0x3b14f8[_0x8368('0x34')][_0x8368('0x5c')]()),_0x3b67be);return respondWithRpcPromise(_0x8368('0x5d'),_0x8368('0x2d'),{'module':_0x8368('0x58')});}})['catch'](handleError(_0x36c8b4,null));}; \ No newline at end of file +var _0xf0b0=['filter','VIRTUAL','merge','count','includeAll','include','findAll','rows','show','params','length','options','find','create','sequelize','body','readFileSync','join','root','server/files/templates/network.ejs','utf8','render','format','toLowerCase','Reload','transaction','/etc/asterisk/sip_xcally_%s.conf','chan_sip.so','writeFileSync','eml-format','rimraf','zip-dir','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','save','update','destroy','stack','name','send','index','map','Network','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x27b63d,_0x12fbf3){var _0x541d36=function(_0x2c5a25){while(--_0x2c5a25){_0x27b63d['push'](_0x27b63d['shift']());}};_0x541d36(++_0x12fbf3);}(_0xf0b0,0x143));var _0x0f0b=function(_0x1cb874,_0x4ffb75){_0x1cb874=_0x1cb874-0x0;var _0x2a4a01=_0xf0b0[_0x1cb874];return _0x2a4a01;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0f0b('0x0'));var rimraf=require(_0x0f0b('0x1'));var zipdir=require(_0x0f0b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0f0b('0x3'));var moment=require('moment');var BPromise=require(_0x0f0b('0x4'));var Mustache=require('mustache');var util=require(_0x0f0b('0x5'));var path=require(_0x0f0b('0x6'));var sox=require(_0x0f0b('0x7'));var csv=require('to-csv');var ejs=require(_0x0f0b('0x8'));var fs=require('fs');var _=require(_0x0f0b('0x9'));var squel=require('squel');var crypto=require(_0x0f0b('0xa'));var jsforce=require(_0x0f0b('0xb'));var deskjs=require(_0x0f0b('0xc'));var toCsv=require(_0x0f0b('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0f0b('0xe'));var as=require(_0x0f0b('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x0f0b('0x10'));var utils=require(_0x0f0b('0x11'));var config=require(_0x0f0b('0x12'));var db=require(_0x0f0b('0x13'))['db'];var jayson=require(_0x0f0b('0x14'));var client=jayson[_0x0f0b('0x15')]['http']({'port':0x232a});function checkPasswordPattern(_0x124c97,_0x37bc4f,_0x159e80){if(_0x159e80){var _0x32337b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32337b[_0x0f0b('0x16')](_0x37bc4f)){return _0x124c97;}else{throw new db[(_0x0f0b('0x17'))][(_0x0f0b('0x18'))](_0x0f0b('0x19'));}}else{return _0x124c97;}}function respondWithRpcPromise(_0x9bf661,_0xc14bf1,_0x2f3913,_0x169124){return new BPromise(function(_0x4f6d6b,_0x595bee){var _0x40c3a5=_0x169124||client;return _0x40c3a5[_0x0f0b('0x1a')](_0x9bf661,_0x2f3913)[_0x0f0b('0x1b')](function(_0xb70c56){logger[_0x0f0b('0x1c')](_0x0f0b('0x1d'),_0xc14bf1,_0x0f0b('0x1e'));logger[_0x0f0b('0x1f')]('Network,\x20%s,\x20%s,\x20%s',_0xc14bf1,_0x0f0b('0x1e'),JSON[_0x0f0b('0x20')](_0xb70c56));if(_0xb70c56[_0x0f0b('0x21')]){if(_0xb70c56[_0x0f0b('0x21')][_0x0f0b('0x22')]===0x1f4){logger[_0x0f0b('0x21')]('Network,\x20%s,\x20%s',_0xc14bf1,_0xb70c56[_0x0f0b('0x21')][_0x0f0b('0x23')]);return _0x595bee(_0xb70c56[_0x0f0b('0x21')][_0x0f0b('0x23')]);}logger[_0x0f0b('0x21')](_0x0f0b('0x1d'),_0xc14bf1,_0xb70c56[_0x0f0b('0x21')][_0x0f0b('0x23')]);return _0x4f6d6b(_0xb70c56['error'][_0x0f0b('0x23')]);}else{logger[_0x0f0b('0x1c')](_0x0f0b('0x1d'),_0xc14bf1,_0x0f0b('0x1e'));_0x4f6d6b(_0xb70c56[_0x0f0b('0x24')][_0x0f0b('0x23')]);}})[_0x0f0b('0x25')](function(_0x1c50ae){logger['error']('Network,\x20%s,\x20%s',_0xc14bf1,_0x1c50ae);_0x595bee(_0x1c50ae);});});}function respondWithStatusCode(_0x11e5eb,_0x911d16){_0x911d16=_0x911d16||0xcc;return function(_0x19fb2b){if(_0x19fb2b){return _0x11e5eb[_0x0f0b('0x26')](_0x911d16);}return _0x11e5eb[_0x0f0b('0x27')](_0x911d16)[_0x0f0b('0x28')]();};}function respondWithResult(_0x10c22a,_0x395203){_0x395203=_0x395203||0xc8;return function(_0x28c7f9){if(_0x28c7f9){return _0x10c22a[_0x0f0b('0x27')](_0x395203)[_0x0f0b('0x29')](_0x28c7f9);}};}function respondWithFilteredResult(_0x4a180e,_0x3efd4b){return function(_0x329200){if(_0x329200){var _0x6fded9=_0x329200['count'],_0x4eee46=_0x3efd4b[_0x0f0b('0x2a')],_0x2e8a04=_0x3efd4b['offset']+_0x3efd4b[_0x0f0b('0x2b')],_0x345d2c;if(_0x2e8a04>=_0x6fded9){_0x2e8a04=_0x6fded9;_0x345d2c=0xc8;}else{_0x345d2c=0xce;}_0x4a180e[_0x0f0b('0x27')](_0x345d2c);return _0x4a180e[_0x0f0b('0x2c')]('Content-Range',_0x4eee46+'-'+_0x2e8a04+'/'+_0x6fded9)[_0x0f0b('0x29')](_0x329200);}return null;};}function patchUpdates(_0x45c82d){return function(_0xba5e04){try{jsonpatch['apply'](_0xba5e04,_0x45c82d,!![]);}catch(_0x254348){return BPromise['reject'](_0x254348);}return _0xba5e04[_0x0f0b('0x2d')]();};}function saveUpdates(_0x42029e,_0xf13918){return function(_0x5d0ea7){if(_0x5d0ea7){return _0x5d0ea7[_0x0f0b('0x2e')](_0x42029e)[_0x0f0b('0x1b')](function(_0x371a9c){return _0x371a9c;});}return null;};}function removeEntity(_0x4f5929,_0x34b48c){return function(_0x13cb43){if(_0x13cb43){return _0x13cb43[_0x0f0b('0x2f')]()[_0x0f0b('0x1b')](function(){_0x4f5929['status'](0xcc)[_0x0f0b('0x28')]();});}};}function handleEntityNotFound(_0x1b7a9c,_0x3270e8){return function(_0x376b51){if(!_0x376b51){_0x1b7a9c[_0x0f0b('0x26')](0x194);}return _0x376b51;};}function handleError(_0x59b24d,_0x585de3){_0x585de3=_0x585de3||0x1f4;return function(_0x5281cb){logger[_0x0f0b('0x21')](_0x5281cb[_0x0f0b('0x30')]);if(_0x5281cb[_0x0f0b('0x31')]){delete _0x5281cb[_0x0f0b('0x31')];}_0x59b24d[_0x0f0b('0x27')](_0x585de3)[_0x0f0b('0x32')](_0x5281cb);};}exports[_0x0f0b('0x33')]=function(_0xc8d00e,_0x3deb2d){var _0x43b66c={},_0xfce742={},_0x363f3b={'count':0x0,'rows':[]};var _0x3724a4=_[_0x0f0b('0x34')](db[_0x0f0b('0x35')][_0x0f0b('0x36')],function(_0x115779){return{'name':_0x115779['fieldName'],'type':_0x115779[_0x0f0b('0x37')]['key']};});_0xfce742[_0x0f0b('0x38')]=_[_0x0f0b('0x34')](_0x3724a4,_0x0f0b('0x31'));_0xfce742[_0x0f0b('0x39')]=_[_0x0f0b('0x3a')](_0xc8d00e[_0x0f0b('0x39')]);_0xfce742[_0x0f0b('0x3b')]=_[_0x0f0b('0x3c')](_0xfce742[_0x0f0b('0x38')],_0xfce742[_0x0f0b('0x39')]);_0x43b66c[_0x0f0b('0x3d')]=_[_0x0f0b('0x3c')](_0xfce742[_0x0f0b('0x38')],qs[_0x0f0b('0x3e')](_0xc8d00e[_0x0f0b('0x39')][_0x0f0b('0x3e')]));_0x43b66c[_0x0f0b('0x3d')]=_0x43b66c[_0x0f0b('0x3d')]['length']?_0x43b66c[_0x0f0b('0x3d')]:_0xfce742[_0x0f0b('0x38')];if(!_0xc8d00e[_0x0f0b('0x39')][_0x0f0b('0x3f')](_0x0f0b('0x40'))){_0x43b66c[_0x0f0b('0x2b')]=qs[_0x0f0b('0x2b')](_0xc8d00e[_0x0f0b('0x39')][_0x0f0b('0x2b')]);_0x43b66c[_0x0f0b('0x2a')]=qs['offset'](_0xc8d00e[_0x0f0b('0x39')][_0x0f0b('0x2a')]);}_0x43b66c[_0x0f0b('0x41')]=qs[_0x0f0b('0x42')](_0xc8d00e['query'][_0x0f0b('0x42')]);_0x43b66c[_0x0f0b('0x43')]=qs[_0x0f0b('0x3b')](_[_0x0f0b('0x44')](_0xc8d00e[_0x0f0b('0x39')],_0xfce742[_0x0f0b('0x3b')]));if(_0xc8d00e[_0x0f0b('0x39')][_0x0f0b('0x45')]){_0x43b66c[_0x0f0b('0x43')]=_['merge'](_0x43b66c[_0x0f0b('0x43')],{'$or':_[_0x0f0b('0x34')](_0x3724a4,function(_0x5391b5){if(_0x5391b5['type']!==_0x0f0b('0x46')){var _0x5bd456={};_0x5bd456[_0x5391b5['name']]={'$like':'%'+_0xc8d00e[_0x0f0b('0x39')][_0x0f0b('0x45')]+'%'};return _0x5bd456;}})});}_0x43b66c=_[_0x0f0b('0x47')]({},_0x43b66c,_0xc8d00e['options']);var _0x59cb82={'where':_0x43b66c[_0x0f0b('0x43')]};return db[_0x0f0b('0x35')][_0x0f0b('0x48')](_0x59cb82)[_0x0f0b('0x1b')](function(_0x4ed7a3){_0x363f3b['count']=_0x4ed7a3;if(_0xc8d00e[_0x0f0b('0x39')][_0x0f0b('0x49')]){_0x43b66c[_0x0f0b('0x4a')]=[{'all':!![]}];}return db[_0x0f0b('0x35')][_0x0f0b('0x4b')](_0x43b66c);})['then'](function(_0x2b5d2f){_0x363f3b[_0x0f0b('0x4c')]=_0x2b5d2f;return _0x363f3b;})[_0x0f0b('0x1b')](respondWithFilteredResult(_0x3deb2d,_0x43b66c))[_0x0f0b('0x25')](handleError(_0x3deb2d,null));};exports[_0x0f0b('0x4d')]=function(_0x4cd16f,_0x302ac1){var _0x3e5367={'raw':!![],'where':{'id':_0x4cd16f[_0x0f0b('0x4e')]['id']}},_0x482270={};_0x482270[_0x0f0b('0x38')]=_[_0x0f0b('0x3a')](db[_0x0f0b('0x35')][_0x0f0b('0x36')]);_0x482270[_0x0f0b('0x39')]=_[_0x0f0b('0x3a')](_0x4cd16f[_0x0f0b('0x39')]);_0x482270[_0x0f0b('0x3b')]=_[_0x0f0b('0x3c')](_0x482270[_0x0f0b('0x38')],_0x482270[_0x0f0b('0x39')]);_0x3e5367[_0x0f0b('0x3d')]=_[_0x0f0b('0x3c')](_0x482270['model'],qs[_0x0f0b('0x3e')](_0x4cd16f[_0x0f0b('0x39')][_0x0f0b('0x3e')]));_0x3e5367[_0x0f0b('0x3d')]=_0x3e5367[_0x0f0b('0x3d')][_0x0f0b('0x4f')]?_0x3e5367['attributes']:_0x482270[_0x0f0b('0x38')];if(_0x4cd16f[_0x0f0b('0x39')][_0x0f0b('0x49')]){_0x3e5367[_0x0f0b('0x4a')]=[{'all':!![]}];}_0x3e5367=_[_0x0f0b('0x47')]({},_0x3e5367,_0x4cd16f[_0x0f0b('0x50')]);return db[_0x0f0b('0x35')][_0x0f0b('0x51')](_0x3e5367)[_0x0f0b('0x1b')](handleEntityNotFound(_0x302ac1,null))[_0x0f0b('0x1b')](respondWithResult(_0x302ac1,null))['catch'](handleError(_0x302ac1,null));};exports[_0x0f0b('0x52')]=function(_0x1e72e3,_0x5db158,_0x54c19b){var _0x103b78;return db[_0x0f0b('0x53')]['transaction'](function(_0x35ea46){return db[_0x0f0b('0x35')][_0x0f0b('0x52')](_0x1e72e3['body'],{'raw':!![]})[_0x0f0b('0x1b')](function(_0x56dd67){_0x103b78=_0x56dd67;return db[_0x0f0b('0x35')][_0x0f0b('0x4b')]({'where':{'type':_0x1e72e3[_0x0f0b('0x54')][_0x0f0b('0x37')]},'raw':!![]});})[_0x0f0b('0x1b')](function(_0x113ca8){var _0xa8e94f=fs[_0x0f0b('0x55')](path[_0x0f0b('0x56')](config[_0x0f0b('0x57')],_0x0f0b('0x58')),_0x0f0b('0x59'));var _0x490fe2=ejs[_0x0f0b('0x5a')](_0xa8e94f,{'networks':_0x113ca8||[]});fs['writeFileSync'](util[_0x0f0b('0x5b')]('/etc/asterisk/sip_xcally_%s.conf',_0x1e72e3[_0x0f0b('0x54')][_0x0f0b('0x37')][_0x0f0b('0x5c')]()),_0x490fe2);})['then'](function(){return respondWithRpcPromise(_0x0f0b('0x5d'),_0x0f0b('0x52'),{'module':'chan_sip.so'});})[_0x0f0b('0x1b')](function(){return _0x103b78;});})[_0x0f0b('0x1b')](respondWithResult(_0x5db158,0xc9))[_0x0f0b('0x25')](handleError(_0x5db158,null));};exports['update']=function(_0x5bf5a6,_0x44665b,_0x46a5f7){var _0x4ef9c3;return db[_0x0f0b('0x53')][_0x0f0b('0x5e')](function(_0x3c4629){return db[_0x0f0b('0x35')][_0x0f0b('0x51')]({'where':{'id':_0x5bf5a6[_0x0f0b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x44665b,null))[_0x0f0b('0x1b')](saveUpdates(_0x5bf5a6['body'],null))['then'](function(_0x17beb6){if(_0x17beb6){_0x4ef9c3=_0x17beb6;return db[_0x0f0b('0x35')][_0x0f0b('0x4b')]({'where':{'type':_0x4ef9c3['type']},'raw':!![]});}return null;})['then'](function(_0x162ff1){if(_0x162ff1){var _0x1ea827=fs[_0x0f0b('0x55')](path['join'](config[_0x0f0b('0x57')],'server/files/templates/network.ejs'),_0x0f0b('0x59'));var _0x138d82=ejs[_0x0f0b('0x5a')](_0x1ea827,{'networks':_0x162ff1||[]});fs['writeFileSync'](util['format'](_0x0f0b('0x5f'),_0x4ef9c3['type']['toLowerCase']()),_0x138d82);return respondWithRpcPromise(_0x0f0b('0x5d'),_0x0f0b('0x2e'),{'module':_0x0f0b('0x60')});}return null;})[_0x0f0b('0x1b')](function(_0x42e22c){if(_0x42e22c){return _0x4ef9c3;}return null;});})[_0x0f0b('0x1b')](respondWithResult(_0x44665b,null))[_0x0f0b('0x25')](handleError(_0x44665b,null));};exports[_0x0f0b('0x2f')]=function(_0x315c6e,_0x4d583c,_0x33f8b2){var _0xffcf88;return db[_0x0f0b('0x35')][_0x0f0b('0x51')]({'where':{'id':_0x315c6e[_0x0f0b('0x4e')]['id']}})['then'](function(_0x954dce){_0xffcf88=_0x954dce;return _0x954dce;})[_0x0f0b('0x1b')](handleEntityNotFound(_0x4d583c,null))['then'](removeEntity(_0x4d583c,null))[_0x0f0b('0x1b')](function(){if(_0xffcf88){return db[_0x0f0b('0x35')][_0x0f0b('0x4b')]({'where':{'type':_0xffcf88[_0x0f0b('0x37')]},'raw':!![]});}})[_0x0f0b('0x1b')](function(_0x11f391){if(_0x11f391){var _0x5b1e73=fs[_0x0f0b('0x55')](path[_0x0f0b('0x56')](config[_0x0f0b('0x57')],_0x0f0b('0x58')),'utf8');var _0x197f12=ejs[_0x0f0b('0x5a')](_0x5b1e73,{'networks':_0x11f391||[]});fs[_0x0f0b('0x61')](util[_0x0f0b('0x5b')](_0x0f0b('0x5f'),_0xffcf88[_0x0f0b('0x37')]['toLowerCase']()),_0x197f12);return respondWithRpcPromise('Reload',_0x0f0b('0x2f'),{'module':_0x0f0b('0x60')});}})[_0x0f0b('0x25')](handleError(_0x4d583c,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f4dad28..54ef015 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 _0xa56a=['api','moment','request-promise','path','rimraf','../../config/environment','./network.attributes','exports','lodash','util','../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xa56a,0x6b));var _0xaa56=function(_0x32471e,_0x1f3c15){_0x32471e=_0x32471e-0x0;var _0xc7793a=_0xa56a[_0x32471e];return _0xc7793a;};'use strict';var _=require(_0xaa56('0x0'));var util=require(_0xaa56('0x1'));var logger=require(_0xaa56('0x2'))(_0xaa56('0x3'));var moment=require(_0xaa56('0x4'));var BPromise=require('bluebird');var rp=require(_0xaa56('0x5'));var fs=require('fs');var path=require(_0xaa56('0x6'));var rimraf=require(_0xaa56('0x7'));var config=require(_0xaa56('0x8'));var attributes=require(_0xaa56('0x9'));module[_0xaa56('0xa')]=function(_0x594f86,_0x4c1bae){return _0x594f86['define']('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09da=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./network.attributes','exports','define','Network','network'];(function(_0x40b024,_0x2f9555){var _0x275973=function(_0xe2879b){while(--_0xe2879b){_0x40b024['push'](_0x40b024['shift']());}};_0x275973(++_0x2f9555);}(_0x09da,0x134));var _0xa09d=function(_0x2860d0,_0x4341f7){_0x2860d0=_0x2860d0-0x0;var _0x32c83c=_0x09da[_0x2860d0];return _0x32c83c;};'use strict';var _=require(_0xa09d('0x0'));var util=require(_0xa09d('0x1'));var logger=require(_0xa09d('0x2'))(_0xa09d('0x3'));var moment=require(_0xa09d('0x4'));var BPromise=require(_0xa09d('0x5'));var rp=require(_0xa09d('0x6'));var fs=require('fs');var path=require(_0xa09d('0x7'));var rimraf=require('rimraf');var config=require(_0xa09d('0x8'));var attributes=require(_0xa09d('0x9'));module[_0xa09d('0xa')]=function(_0x43369c,_0x269180){return _0x43369c[_0xa09d('0xb')](_0xa09d('0xc'),attributes,{'tableName':_0xa09d('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 96f7ec0..1c10737 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 _0xea43=['catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x59e9ff,_0x5080c3){var _0xa71d5e=function(_0x7d1718){while(--_0x7d1718){_0x59e9ff['push'](_0x59e9ff['shift']());}};_0xa71d5e(++_0x5080c3);}(_0xea43,0x11e));var _0x3ea4=function(_0x479b6a,_0x3cd5ba){_0x479b6a=_0x479b6a-0x0;var _0x53befb=_0xea43[_0x479b6a];return _0x53befb;};'use strict';var _=require(_0x3ea4('0x0'));var util=require(_0x3ea4('0x1'));var moment=require('moment');var BPromise=require(_0x3ea4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3ea4('0x3'));var db=require(_0x3ea4('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x3ea4('0x5'));var jayson=require(_0x3ea4('0x6'));var client=jayson[_0x3ea4('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7b71f6,_0x2d3b38,_0x576d41){return new BPromise(function(_0x742bf2,_0x25463b){return client['request'](_0x7b71f6,_0x576d41)[_0x3ea4('0x8')](function(_0x3f59c5){logger[_0x3ea4('0x9')](_0x3ea4('0xa'),_0x2d3b38,_0x3ea4('0xb'));logger['debug'](_0x3ea4('0xc'),_0x2d3b38,_0x3ea4('0xb'),JSON[_0x3ea4('0xd')](_0x3f59c5));if(_0x3f59c5[_0x3ea4('0xe')]){if(_0x3f59c5['error'][_0x3ea4('0xf')]===0x1f4){logger[_0x3ea4('0xe')](_0x3ea4('0xa'),_0x2d3b38,_0x3f59c5[_0x3ea4('0xe')][_0x3ea4('0x10')]);return _0x25463b(_0x3f59c5[_0x3ea4('0xe')][_0x3ea4('0x10')]);}logger[_0x3ea4('0xe')]('Network,\x20%s,\x20%s',_0x2d3b38,_0x3f59c5[_0x3ea4('0xe')][_0x3ea4('0x10')]);return _0x742bf2(_0x3f59c5['error'][_0x3ea4('0x10')]);}else{logger['info'](_0x3ea4('0xa'),_0x2d3b38,'request\x20sent');_0x742bf2(_0x3f59c5[_0x3ea4('0x11')][_0x3ea4('0x10')]);}})[_0x3ea4('0x12')](function(_0x2665bd){logger[_0x3ea4('0xe')](_0x3ea4('0xa'),_0x2d3b38,_0x2665bd);_0x25463b(_0x2665bd);});});} \ No newline at end of file +var _0xf61c=['jayson/promise','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0xf61c,0xd5));var _0xcf61=function(_0x305796,_0x382696){_0x305796=_0x305796-0x0;var _0x228241=_0xf61c[_0x305796];return _0x228241;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xcf61('0x0'));var BPromise=require('bluebird');var rs=require(_0xcf61('0x1'));var fs=require('fs');var Redis=require(_0xcf61('0x2'));var db=require(_0xcf61('0x3'))['db'];var utils=require(_0xcf61('0x4'));var logger=require('../../config/logger')(_0xcf61('0x5'));var config=require(_0xcf61('0x6'));var jayson=require(_0xcf61('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3105b2,_0x1dd6d1,_0x52c3b8){return new BPromise(function(_0x33d554,_0x1cc32d){return client[_0xcf61('0x8')](_0x3105b2,_0x52c3b8)[_0xcf61('0x9')](function(_0x2d927e){logger[_0xcf61('0xa')](_0xcf61('0xb'),_0x1dd6d1,_0xcf61('0xc'));logger[_0xcf61('0xd')](_0xcf61('0xe'),_0x1dd6d1,_0xcf61('0xc'),JSON[_0xcf61('0xf')](_0x2d927e));if(_0x2d927e['error']){if(_0x2d927e[_0xcf61('0x10')][_0xcf61('0x11')]===0x1f4){logger['error'](_0xcf61('0xb'),_0x1dd6d1,_0x2d927e['error']['message']);return _0x1cc32d(_0x2d927e['error'][_0xcf61('0x12')]);}logger[_0xcf61('0x10')]('Network,\x20%s,\x20%s',_0x1dd6d1,_0x2d927e[_0xcf61('0x10')][_0xcf61('0x12')]);return _0x33d554(_0x2d927e['error'][_0xcf61('0x12')]);}else{logger[_0xcf61('0xa')](_0xcf61('0xb'),_0x1dd6d1,_0xcf61('0xc'));_0x33d554(_0x2d927e['result'][_0xcf61('0x12')]);}})[_0xcf61('0x13')](function(_0x12d97d){logger[_0xcf61('0x10')](_0xcf61('0xb'),_0x1dd6d1,_0x12d97d);_0x1cc32d(_0x12d97d);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index bf8cbd3..8df9cd2 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 _0x0535=['/:id/send','send','put','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','describe','/:id','show','isAuthenticated','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','create','addDisposition','post','addAnswer','notify','addApplications','addAgents'];(function(_0x5b9638,_0x227ce2){var _0x2ba0d1=function(_0x38224c){while(--_0x38224c){_0x5b9638['push'](_0x5b9638['shift']());}};_0x2ba0d1(++_0x227ce2);}(_0x0535,0x1e9));var _0x5053=function(_0x2ce948,_0xe2d744){_0x2ce948=_0x2ce948-0x0;var _0xb0e9a1=_0x0535[_0x2ce948];return _0xb0e9a1;};'use strict';var multer=require(_0x5053('0x0'));var util=require(_0x5053('0x1'));var path=require(_0x5053('0x2'));var timeout=require(_0x5053('0x3'));var express=require(_0x5053('0x4'));var router=express['Router']();var auth=require(_0x5053('0x5'));var interaction=require(_0x5053('0x6'));var config=require(_0x5053('0x7'));var controller=require('./openchannelAccount.controller');router[_0x5053('0x8')]('/',auth['isAuthenticated'](),controller[_0x5053('0x9')]);router[_0x5053('0x8')](_0x5053('0xa'),auth['isAuthenticated'](),controller[_0x5053('0xb')]);router['get'](_0x5053('0xc'),auth['isAuthenticated'](),controller[_0x5053('0xd')]);router[_0x5053('0x8')]('/:id/dispositions',auth[_0x5053('0xe')](),controller[_0x5053('0xf')]);router[_0x5053('0x8')](_0x5053('0x10'),auth['isAuthenticated'](),controller[_0x5053('0x11')]);router[_0x5053('0x8')](_0x5053('0x12'),auth[_0x5053('0xe')](),controller[_0x5053('0x13')]);router[_0x5053('0x8')](_0x5053('0x14'),auth[_0x5053('0xe')](),controller['getInteractions']);router[_0x5053('0x8')](_0x5053('0x15'),auth[_0x5053('0xe')](),controller['getAgents']);router['post']('/',auth[_0x5053('0xe')](),controller[_0x5053('0x16')]);router['post']('/:id/dispositions',auth[_0x5053('0xe')](),controller[_0x5053('0x17')]);router[_0x5053('0x18')](_0x5053('0x10'),auth[_0x5053('0xe')](),controller[_0x5053('0x19')]);router[_0x5053('0x18')]('/:id/notify',controller[_0x5053('0x1a')]);router['post'](_0x5053('0x12'),auth[_0x5053('0xe')](),controller[_0x5053('0x1b')]);router[_0x5053('0x18')]('/:id/users',auth[_0x5053('0xe')](),controller[_0x5053('0x1c')]);router[_0x5053('0x18')](_0x5053('0x1d'),auth[_0x5053('0xe')](),controller[_0x5053('0x1e')]);router[_0x5053('0x1f')](_0x5053('0xc'),auth[_0x5053('0xe')](),controller['update']);router[_0x5053('0x20')](_0x5053('0xc'),auth[_0x5053('0xe')](),controller[_0x5053('0x21')]);router[_0x5053('0x20')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5053('0x22')]);router[_0x5053('0x20')](_0x5053('0x10'),auth[_0x5053('0xe')](),controller['removeAnswers']);router['delete']('/:id/users',auth[_0x5053('0xe')](),controller[_0x5053('0x23')]);module[_0x5053('0x24')]=router; \ No newline at end of file +var _0x12c8=['/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','addApplications','/:id/send','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x12c8,0xf9));var _0x812c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x12c8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x812c('0x0'));var util=require(_0x812c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x812c('0x2'));var router=express[_0x812c('0x3')]();var auth=require(_0x812c('0x4'));var interaction=require(_0x812c('0x5'));var config=require(_0x812c('0x6'));var controller=require('./openchannelAccount.controller');router[_0x812c('0x7')]('/',auth[_0x812c('0x8')](),controller[_0x812c('0x9')]);router['get'](_0x812c('0xa'),auth[_0x812c('0x8')](),controller[_0x812c('0xb')]);router['get'](_0x812c('0xc'),auth[_0x812c('0x8')](),controller[_0x812c('0xd')]);router[_0x812c('0x7')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x812c('0xe')]);router[_0x812c('0x7')](_0x812c('0xf'),auth[_0x812c('0x8')](),controller[_0x812c('0x10')]);router['get'](_0x812c('0x11'),auth['isAuthenticated'](),controller[_0x812c('0x12')]);router[_0x812c('0x7')](_0x812c('0x13'),auth[_0x812c('0x8')](),controller[_0x812c('0x14')]);router[_0x812c('0x7')](_0x812c('0x15'),auth[_0x812c('0x8')](),controller[_0x812c('0x16')]);router[_0x812c('0x17')]('/',auth[_0x812c('0x8')](),controller[_0x812c('0x18')]);router[_0x812c('0x17')](_0x812c('0x19'),auth['isAuthenticated'](),controller[_0x812c('0x1a')]);router[_0x812c('0x17')]('/:id/canned_answers',auth[_0x812c('0x8')](),controller[_0x812c('0x1b')]);router[_0x812c('0x17')](_0x812c('0x1c'),controller['notify']);router[_0x812c('0x17')](_0x812c('0x11'),auth[_0x812c('0x8')](),controller[_0x812c('0x1d')]);router[_0x812c('0x17')](_0x812c('0x15'),auth[_0x812c('0x8')](),controller['addAgents']);router['post'](_0x812c('0x1e'),auth[_0x812c('0x8')](),controller['send']);router[_0x812c('0x1f')](_0x812c('0xc'),auth[_0x812c('0x8')](),controller[_0x812c('0x20')]);router[_0x812c('0x21')](_0x812c('0xc'),auth[_0x812c('0x8')](),controller['destroy']);router[_0x812c('0x21')](_0x812c('0x19'),auth[_0x812c('0x8')](),controller[_0x812c('0x22')]);router[_0x812c('0x21')](_0x812c('0xf'),auth[_0x812c('0x8')](),controller[_0x812c('0x23')]);router[_0x812c('0x21')](_0x812c('0x15'),auth[_0x812c('0x8')](),controller[_0x812c('0x24')]);module[_0x812c('0x25')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index e3afc88..f9f44a2 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 _0x455d=['setDataValue','mandatoryDisposition','sequelize','randomstring','STRING','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId'];(function(_0x4684b1,_0x31baaf){var _0x122f45=function(_0x20bcbe){while(--_0x20bcbe){_0x4684b1['push'](_0x4684b1['shift']());}};_0x122f45(++_0x31baaf);}(_0x455d,0x120));var _0xd455=function(_0x5c9d38,_0x2fc071){_0x5c9d38=_0x5c9d38-0x0;var _0x40d077=_0x455d[_0x5c9d38];return _0x40d077;};'use strict';var Sequelize=require(_0xd455('0x0'));var rs=require(_0xd455('0x1'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xd455('0x2')]},'token':{'type':Sequelize[_0xd455('0x2')],'defaultValue':function(){return rs[_0xd455('0x3')]();}},'replyUri':{'type':Sequelize[_0xd455('0x2')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xd455('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xd455('0x4');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xd455('0x5')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xd455('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xd455('0x2')]},'queueTransfer':{'type':Sequelize[_0xd455('0x5')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xd455('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xd455('0x5')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xd455('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xd455('0x7')},'mandatoryDisposition':{'type':Sequelize[_0xd455('0x5')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x58276c){if(!_0x58276c)this['setDataValue'](_0xd455('0x8'),null);this[_0xd455('0x9')](_0xd455('0xa'),_0x58276c);}}}; \ No newline at end of file +var _0xc710=['name','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition','sequelize','randomstring','STRING'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0xc710,0x159));var _0x0c71=function(_0x2faeb7,_0x1e2291){_0x2faeb7=_0x2faeb7-0x0;var _0x3a49b6=_0xc710[_0x2faeb7];return _0x3a49b6;};'use strict';var Sequelize=require(_0x0c71('0x0'));var rs=require(_0x0c71('0x1'));module['exports']={'name':{'type':Sequelize[_0x0c71('0x2')],'unique':_0x0c71('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x0c71('0x2')]},'token':{'type':Sequelize[_0x0c71('0x2')],'defaultValue':function(){return rs['generate']();}},'replyUri':{'type':Sequelize['STRING'],'validate':{'isUrl':!![]}},'key':{'type':Sequelize['STRING'],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x0c71('0x4')],'defaultValue':function(){return _0x0c71('0x5');}},'notificationSound':{'type':Sequelize[_0x0c71('0x6')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0c71('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x0c71('0x2')]},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0c71('0x6')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x0c71('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0c71('0x7')],'allowNull':!![],'defaultValue':null,'comment':_0x0c71('0x8')},'mandatoryDisposition':{'type':Sequelize[_0x0c71('0x6')],'defaultValue':![],'comment':_0x0c71('0x9'),'set':function(_0x3106a4){if(!_0x3106a4)this[_0x0c71('0xa')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x0c71('0xb'),_0x3106a4);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index bbaa825..c794661 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 _0xf5e3=['isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','count','offset','limit','Content-Range','json','reject','save','update','destroy','get','OpenchannelAccounts','UserProfileResource','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','filters','filter','merge','where','VIRTUAL','options','include','findAll','rows','catch','show','params','length','includeAll','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','OpnechannelAccountId','getDispositions','Disposition','pick','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','getAnswers','removeAnswers','notify','CmContact','no\x20available\x20attributes','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','Contacts','DESC','OpenchannelApplication','List','applications','Applications','orderBy','priority','asc','account','contact','firstName','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','messageId','interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','findOne','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','spread','emit','removeAgents'];(function(_0x364339,_0x4732dd){var _0x7b5072=function(_0x21ebfe){while(--_0x21ebfe){_0x364339['push'](_0x364339['shift']());}};_0x7b5072(++_0x4732dd);}(_0xf5e3,0xc7));var _0x3f5e=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0xf5e3[_0x874cf1];return _0x233579;};'use strict';var pdf=require(_0x3f5e('0x0'));var emlformat=require(_0x3f5e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3f5e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x3f5e('0x3'));var moment=require(_0x3f5e('0x4'));var BPromise=require(_0x3f5e('0x5'));var Mustache=require(_0x3f5e('0x6'));var util=require(_0x3f5e('0x7'));var path=require('path');var sox=require(_0x3f5e('0x8'));var csv=require('to-csv');var ejs=require(_0x3f5e('0x9'));var fs=require('fs');var _=require(_0x3f5e('0xa'));var squel=require(_0x3f5e('0xb'));var crypto=require(_0x3f5e('0xc'));var jsforce=require(_0x3f5e('0xd'));var deskjs=require(_0x3f5e('0xe'));var toCsv=require(_0x3f5e('0xf'));var querystring=require(_0x3f5e('0x10'));var Papa=require(_0x3f5e('0x11'));var Redis=require(_0x3f5e('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3f5e('0x13'));var hardwareService=require(_0x3f5e('0x14'));var logger=require(_0x3f5e('0x15'))(_0x3f5e('0x16'));var utils=require(_0x3f5e('0x17'));var config=require(_0x3f5e('0x18'));var db=require(_0x3f5e('0x19'))['db'];config[_0x3f5e('0x1a')]=_[_0x3f5e('0x1b')](config[_0x3f5e('0x1a')],{'host':_0x3f5e('0x1c'),'port':0x18eb});var socket=require(_0x3f5e('0x1d'))(new Redis(config[_0x3f5e('0x1a')]));require(_0x3f5e('0x1e'))[_0x3f5e('0x1f')](socket);var jayson=require(_0x3f5e('0x20'));var client=jayson[_0x3f5e('0x21')][_0x3f5e('0x22')]({'port':0x232c});var client9002=jayson[_0x3f5e('0x21')][_0x3f5e('0x22')]({'port':0x232a});function checkPasswordPattern(_0x5e0373,_0x1c1cc9,_0x2d6729){if(_0x2d6729){var _0xa70b3c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa70b3c['test'](_0x1c1cc9)){return _0x5e0373;}else{throw new db[(_0x3f5e('0x23'))][(_0x3f5e('0x24'))](_0x3f5e('0x25'));}}else{return _0x5e0373;}}function respondWithRpcPromise(_0x4ff8fc,_0x5acb5b,_0x228ff5,_0x4e89d6){return new BPromise(function(_0x444c28,_0x45ed78){var _0xc3f9c4=_0x4e89d6||client;return _0xc3f9c4[_0x3f5e('0x26')](_0x4ff8fc,_0x228ff5)[_0x3f5e('0x27')](function(_0x43408a){logger[_0x3f5e('0x28')](_0x3f5e('0x29'),_0x5acb5b,_0x3f5e('0x2a'));logger[_0x3f5e('0x2b')](_0x3f5e('0x2c'),_0x5acb5b,'request\x20sent',JSON[_0x3f5e('0x2d')](_0x43408a));if(_0x43408a[_0x3f5e('0x2e')]){if(_0x43408a['error'][_0x3f5e('0x2f')]===0x1f4){logger[_0x3f5e('0x2e')]('OpenchannelAccount,\x20%s,\x20%s',_0x5acb5b,_0x43408a[_0x3f5e('0x2e')]['message']);return _0x45ed78(_0x43408a[_0x3f5e('0x2e')][_0x3f5e('0x30')]);}logger['error'](_0x3f5e('0x29'),_0x5acb5b,_0x43408a[_0x3f5e('0x2e')]['message']);return _0x444c28(_0x43408a[_0x3f5e('0x2e')][_0x3f5e('0x30')]);}else{logger[_0x3f5e('0x28')](_0x3f5e('0x29'),_0x5acb5b,_0x3f5e('0x2a'));_0x444c28(_0x43408a[_0x3f5e('0x31')][_0x3f5e('0x30')]);}})['catch'](function(_0x316322){logger[_0x3f5e('0x2e')](_0x3f5e('0x29'),_0x5acb5b,_0x316322);_0x45ed78(_0x316322);});});}function respondWithStatusCode(_0x27698e,_0x35e8c5){_0x35e8c5=_0x35e8c5||0xcc;return function(_0x2ea184){if(_0x2ea184){return _0x27698e[_0x3f5e('0x32')](_0x35e8c5);}return _0x27698e[_0x3f5e('0x33')](_0x35e8c5)[_0x3f5e('0x34')]();};}function respondWithResult(_0x30ee47,_0x3951cf){_0x3951cf=_0x3951cf||0xc8;return function(_0x51a741){if(_0x51a741){return _0x30ee47['status'](_0x3951cf)['json'](_0x51a741);}};}function respondWithFilteredResult(_0x16ed83,_0x5b4c5f){return function(_0x116c96){if(_0x116c96){var _0xee8efb=_0x116c96[_0x3f5e('0x35')],_0x4e6d36=_0x5b4c5f[_0x3f5e('0x36')],_0x4457a4=_0x5b4c5f['offset']+_0x5b4c5f[_0x3f5e('0x37')],_0x3bdd2d;if(_0x4457a4>=_0xee8efb){_0x4457a4=_0xee8efb;_0x3bdd2d=0xc8;}else{_0x3bdd2d=0xce;}_0x16ed83[_0x3f5e('0x33')](_0x3bdd2d);return _0x16ed83['set'](_0x3f5e('0x38'),_0x4e6d36+'-'+_0x4457a4+'/'+_0xee8efb)[_0x3f5e('0x39')](_0x116c96);}return null;};}function patchUpdates(_0x46be64){return function(_0x19878b){try{jsonpatch['apply'](_0x19878b,_0x46be64,!![]);}catch(_0x1cd007){return BPromise[_0x3f5e('0x3a')](_0x1cd007);}return _0x19878b[_0x3f5e('0x3b')]();};}function saveUpdates(_0x13b64a,_0x4e12b0){return function(_0x31f3c3){if(_0x31f3c3){return _0x31f3c3[_0x3f5e('0x3c')](_0x13b64a)['then'](function(_0x3c5148){return _0x3c5148;});}return null;};}function removeEntity(_0x4a5ca0,_0x44983b){return function(_0x36dd88){if(_0x36dd88){return _0x36dd88[_0x3f5e('0x3d')]()[_0x3f5e('0x27')](function(){var _0x112e12=_0x36dd88[_0x3f5e('0x3e')]({'plain':!![]});var _0x21d1c0=_0x3f5e('0x3f');return db[_0x3f5e('0x40')]['destroy']({'where':{'type':_0x21d1c0,'resourceId':_0x112e12['id']}})[_0x3f5e('0x27')](function(){return _0x36dd88;});})[_0x3f5e('0x27')](function(){_0x4a5ca0['status'](0xcc)[_0x3f5e('0x34')]();});}};}function handleEntityNotFound(_0x23e69b,_0x4c5e22){return function(_0x5d18a2){if(!_0x5d18a2){_0x23e69b[_0x3f5e('0x32')](0x194);}return _0x5d18a2;};}function handleError(_0x2923e0,_0x5d8c47){_0x5d8c47=_0x5d8c47||0x1f4;return function(_0x10367e){logger['error'](_0x10367e['stack']);if(_0x10367e['name']){delete _0x10367e[_0x3f5e('0x41')];}_0x2923e0['status'](_0x5d8c47)['send'](_0x10367e);};}exports['index']=function(_0x57957f,_0x79ecd3){var _0x118287={'include':[{'model':db[_0x3f5e('0x42')],'as':_0x3f5e('0x43')}]},_0x105dd4={},_0x1cca13={'count':0x0,'rows':[]};var _0x4ec526=_[_0x3f5e('0x44')](db[_0x3f5e('0x45')][_0x3f5e('0x46')],function(_0x189947){return{'name':_0x189947['fieldName'],'type':_0x189947[_0x3f5e('0x47')][_0x3f5e('0x48')]};});_0x105dd4[_0x3f5e('0x49')]=_[_0x3f5e('0x44')](_0x4ec526,_0x3f5e('0x41'));_0x105dd4[_0x3f5e('0x4a')]=_[_0x3f5e('0x4b')](_0x57957f[_0x3f5e('0x4a')]);_0x105dd4['filters']=_[_0x3f5e('0x4c')](_0x105dd4['model'],_0x105dd4[_0x3f5e('0x4a')]);_0x118287[_0x3f5e('0x4d')]=_['intersection'](_0x105dd4[_0x3f5e('0x49')],qs[_0x3f5e('0x4e')](_0x57957f[_0x3f5e('0x4a')][_0x3f5e('0x4e')]));_0x118287[_0x3f5e('0x4d')]=_0x118287[_0x3f5e('0x4d')]['length']?_0x118287['attributes']:_0x105dd4[_0x3f5e('0x49')];if(!_0x57957f['query'][_0x3f5e('0x4f')](_0x3f5e('0x50'))){_0x118287[_0x3f5e('0x37')]=qs[_0x3f5e('0x37')](_0x57957f[_0x3f5e('0x4a')][_0x3f5e('0x37')]);_0x118287['offset']=qs[_0x3f5e('0x36')](_0x57957f[_0x3f5e('0x4a')][_0x3f5e('0x36')]);}_0x118287[_0x3f5e('0x51')]=qs[_0x3f5e('0x52')](_0x57957f[_0x3f5e('0x4a')][_0x3f5e('0x52')]);_0x118287['where']=qs['filters'](_['pick'](_0x57957f['query'],_0x105dd4[_0x3f5e('0x53')]));if(_0x57957f[_0x3f5e('0x4a')][_0x3f5e('0x54')]){_0x118287['where']=_[_0x3f5e('0x55')](_0x118287[_0x3f5e('0x56')],{'$or':_[_0x3f5e('0x44')](_0x4ec526,function(_0x1c679c){if(_0x1c679c[_0x3f5e('0x47')]!==_0x3f5e('0x57')){var _0x4b548a={};_0x4b548a[_0x1c679c['name']]={'$like':'%'+_0x57957f[_0x3f5e('0x4a')]['filter']+'%'};return _0x4b548a;}})});}_0x118287=_[_0x3f5e('0x55')]({},_0x118287,_0x57957f[_0x3f5e('0x58')]);var _0x7700e={'where':_0x118287['where']};return db[_0x3f5e('0x45')][_0x3f5e('0x35')](_0x7700e)[_0x3f5e('0x27')](function(_0x52c9f9){_0x1cca13['count']=_0x52c9f9;if(_0x57957f[_0x3f5e('0x4a')]['includeAll']){_0x118287[_0x3f5e('0x59')]=[{'all':!![]}];}return db[_0x3f5e('0x45')][_0x3f5e('0x5a')](_0x118287);})[_0x3f5e('0x27')](function(_0x54c092){_0x1cca13[_0x3f5e('0x5b')]=_0x54c092;return _0x1cca13;})[_0x3f5e('0x27')](respondWithFilteredResult(_0x79ecd3,_0x118287))[_0x3f5e('0x5c')](handleError(_0x79ecd3,null));};exports[_0x3f5e('0x5d')]=function(_0x4b3acf,_0x5e51ef){var _0x573f91={'raw':![],'where':{'id':_0x4b3acf[_0x3f5e('0x5e')]['id']},'include':[{'model':db[_0x3f5e('0x42')],'as':_0x3f5e('0x43')}]},_0xfc6264={};_0xfc6264[_0x3f5e('0x49')]=_[_0x3f5e('0x4b')](db[_0x3f5e('0x45')][_0x3f5e('0x46')]);_0xfc6264[_0x3f5e('0x4a')]=_[_0x3f5e('0x4b')](_0x4b3acf[_0x3f5e('0x4a')]);_0xfc6264[_0x3f5e('0x53')]=_[_0x3f5e('0x4c')](_0xfc6264[_0x3f5e('0x49')],_0xfc6264[_0x3f5e('0x4a')]);_0x573f91[_0x3f5e('0x4d')]=_[_0x3f5e('0x4c')](_0xfc6264[_0x3f5e('0x49')],qs['fields'](_0x4b3acf[_0x3f5e('0x4a')][_0x3f5e('0x4e')]));_0x573f91[_0x3f5e('0x4d')]=_0x573f91[_0x3f5e('0x4d')][_0x3f5e('0x5f')]?_0x573f91['attributes']:_0xfc6264['model'];if(_0x4b3acf[_0x3f5e('0x4a')][_0x3f5e('0x60')]){_0x573f91['include']=[{'all':!![]}];}_0x573f91=_[_0x3f5e('0x55')]({},_0x573f91,_0x4b3acf[_0x3f5e('0x58')]);return db['OpenchannelAccount'][_0x3f5e('0x61')](_0x573f91)[_0x3f5e('0x27')](handleEntityNotFound(_0x5e51ef,null))['then'](respondWithResult(_0x5e51ef,null))[_0x3f5e('0x5c')](handleError(_0x5e51ef,null));};exports[_0x3f5e('0x62')]=function(_0x2ab061,_0x14816a){return db[_0x3f5e('0x45')]['create'](_0x2ab061[_0x3f5e('0x63')],{})[_0x3f5e('0x27')](function(_0x2e862b){var _0x1f167e=_0x2ab061[_0x3f5e('0x64')][_0x3f5e('0x3e')]({'plain':!![]});if(!_0x1f167e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1f167e['role']===_0x3f5e('0x64')){var _0x450586=_0x2e862b[_0x3f5e('0x3e')]({'plain':!![]});var _0xc2319f=_0x3f5e('0x3f');return db[_0x3f5e('0x65')][_0x3f5e('0x61')]({'where':{'name':_0xc2319f,'userProfileId':_0x1f167e[_0x3f5e('0x66')]},'raw':!![]})[_0x3f5e('0x27')](function(_0x529027){if(_0x529027&&_0x529027[_0x3f5e('0x67')]===0x0){return db[_0x3f5e('0x40')][_0x3f5e('0x62')]({'name':_0x450586[_0x3f5e('0x41')],'resourceId':_0x450586['id'],'type':_0x529027['name'],'sectionId':_0x529027['id']},{})[_0x3f5e('0x27')](function(){return _0x2e862b;});}else{return _0x2e862b;}})[_0x3f5e('0x5c')](function(_0x3e5e03){logger[_0x3f5e('0x2e')](_0x3f5e('0x68'),_0x3e5e03);throw _0x3e5e03;});}return _0x2e862b;})[_0x3f5e('0x27')](respondWithResult(_0x14816a,0xc9))[_0x3f5e('0x5c')](handleError(_0x14816a,null));};exports[_0x3f5e('0x3c')]=function(_0x3c4e6a,_0x5827dd){if(_0x3c4e6a[_0x3f5e('0x63')]['id']){delete _0x3c4e6a[_0x3f5e('0x63')]['id'];}return db[_0x3f5e('0x45')][_0x3f5e('0x61')]({'where':{'id':_0x3c4e6a[_0x3f5e('0x5e')]['id']},'include':[{'model':db[_0x3f5e('0x42')],'as':_0x3f5e('0x43')}]})['then'](handleEntityNotFound(_0x5827dd,null))['then'](saveUpdates(_0x3c4e6a[_0x3f5e('0x63')],null))[_0x3f5e('0x27')](respondWithResult(_0x5827dd,null))[_0x3f5e('0x5c')](handleError(_0x5827dd,null));};exports[_0x3f5e('0x3d')]=function(_0x8c8eab,_0x465fec){return db[_0x3f5e('0x45')]['find']({'where':{'id':_0x8c8eab[_0x3f5e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x465fec,null))[_0x3f5e('0x27')](removeEntity(_0x465fec,null))[_0x3f5e('0x5c')](handleError(_0x465fec,null));};exports[_0x3f5e('0x69')]=function(_0x481d43,_0xdaefe2){return db[_0x3f5e('0x45')]['describe']()[_0x3f5e('0x27')](respondWithResult(_0xdaefe2,null))[_0x3f5e('0x5c')](handleError(_0xdaefe2,null));};exports[_0x3f5e('0x6a')]=function(_0x59cf49,_0x1cb22c,_0x2780e0){if(_0x59cf49['body']['id']){delete _0x59cf49[_0x3f5e('0x63')]['id'];}return db['OpenchannelAccount'][_0x3f5e('0x61')]({'where':{'id':_0x59cf49['params']['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x1cb22c,null))[_0x3f5e('0x27')](function(_0x169f7f){if(_0x169f7f){_0x59cf49[_0x3f5e('0x63')][_0x3f5e('0x6b')]=_0x169f7f['id'];return db['Disposition']['create'](_0x59cf49['body']);}})[_0x3f5e('0x27')](respondWithResult(_0x1cb22c,null))[_0x3f5e('0x5c')](handleError(_0x1cb22c,null));};exports[_0x3f5e('0x6c')]=function(_0x27e22a,_0x42faef,_0x5ad118){var _0x144cab={'raw':![],'where':{}};var _0x5d35fa={};var _0x2e03da={'count':0x0,'rows':[]};return db[_0x3f5e('0x45')]['findOne']({'where':{'id':_0x27e22a['params']['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x42faef,null))[_0x3f5e('0x27')](function(_0x4d325e){if(_0x4d325e){_0x5d35fa['model']=_[_0x3f5e('0x4b')](db[_0x3f5e('0x6d')][_0x3f5e('0x46')]);_0x5d35fa[_0x3f5e('0x4a')]=_[_0x3f5e('0x4b')](_0x27e22a[_0x3f5e('0x4a')]);_0x5d35fa[_0x3f5e('0x53')]=_[_0x3f5e('0x4c')](_0x5d35fa[_0x3f5e('0x49')],_0x5d35fa[_0x3f5e('0x4a')]);_0x144cab['attributes']=_[_0x3f5e('0x4c')](_0x5d35fa['model'],qs[_0x3f5e('0x4e')](_0x27e22a['query'][_0x3f5e('0x4e')]));_0x144cab[_0x3f5e('0x4d')]=_0x144cab['attributes'][_0x3f5e('0x5f')]?_0x144cab[_0x3f5e('0x4d')]:_0x5d35fa['model'];if(!_0x27e22a[_0x3f5e('0x4a')][_0x3f5e('0x4f')](_0x3f5e('0x50'))){_0x144cab[_0x3f5e('0x37')]=qs['limit'](_0x27e22a[_0x3f5e('0x4a')][_0x3f5e('0x37')]);_0x144cab[_0x3f5e('0x36')]=qs['offset'](_0x27e22a['query'][_0x3f5e('0x36')]);}_0x144cab[_0x3f5e('0x51')]=qs[_0x3f5e('0x52')](_0x27e22a[_0x3f5e('0x4a')][_0x3f5e('0x52')]);_0x144cab[_0x3f5e('0x56')]=qs['filters'](_[_0x3f5e('0x6e')](_0x27e22a[_0x3f5e('0x4a')],_0x5d35fa[_0x3f5e('0x53')]));_0x144cab[_0x3f5e('0x56')][_0x3f5e('0x6f')]=_0x4d325e['id'];if(_0x27e22a[_0x3f5e('0x4a')][_0x3f5e('0x54')]){_0x144cab[_0x3f5e('0x56')]=_[_0x3f5e('0x55')](_0x144cab['where'],{'$or':_['map'](_0x144cab[_0x3f5e('0x4d')],function(_0x5d3289){var _0x537d5a={};_0x537d5a[_0x5d3289]={'$like':'%'+_0x27e22a['query'][_0x3f5e('0x54')]+'%'};return _0x537d5a;})});}_0x144cab=_[_0x3f5e('0x55')]({},_0x144cab,_0x27e22a[_0x3f5e('0x58')]);return db[_0x3f5e('0x6d')][_0x3f5e('0x35')]({'where':_0x144cab[_0x3f5e('0x56')]})['then'](function(_0x27ea1c){_0x2e03da['count']=_0x27ea1c;if(_0x27e22a[_0x3f5e('0x4a')][_0x3f5e('0x60')]){_0x144cab[_0x3f5e('0x59')]=[{'all':!![]}];}return db[_0x3f5e('0x6d')][_0x3f5e('0x5a')](_0x144cab);})[_0x3f5e('0x27')](function(_0x33996c){_0x2e03da[_0x3f5e('0x5b')]=_0x33996c;return _0x2e03da;});}})[_0x3f5e('0x27')](respondWithFilteredResult(_0x42faef,_0x144cab))['catch'](handleError(_0x42faef,null));};exports['removeDispositions']=function(_0x17532c,_0x28a882,_0x4b4ebc){return db[_0x3f5e('0x45')][_0x3f5e('0x61')]({'where':{'id':_0x17532c[_0x3f5e('0x5e')]['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x28a882,null))[_0x3f5e('0x27')](function(_0x45b165){if(_0x45b165){return _0x45b165[_0x3f5e('0x70')](_0x17532c[_0x3f5e('0x4a')][_0x3f5e('0x71')]);}})['then'](respondWithStatusCode(_0x28a882,null))[_0x3f5e('0x5c')](handleError(_0x28a882,null));};exports['addAnswer']=function(_0x45e8e3,_0x113b0b,_0x27925b){if(_0x45e8e3[_0x3f5e('0x63')]['id']){delete _0x45e8e3[_0x3f5e('0x63')]['id'];}return db[_0x3f5e('0x45')][_0x3f5e('0x61')]({'where':{'id':_0x45e8e3[_0x3f5e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x113b0b,null))['then'](function(_0x42bc4f){if(_0x42bc4f){_0x45e8e3[_0x3f5e('0x63')]['OpenchannelAccountId']=_0x42bc4f['id'];return db[_0x3f5e('0x72')][_0x3f5e('0x62')](_0x45e8e3[_0x3f5e('0x63')]);}})[_0x3f5e('0x27')](respondWithResult(_0x113b0b,null))[_0x3f5e('0x5c')](handleError(_0x113b0b,null));};exports[_0x3f5e('0x73')]=function(_0x6098d6,_0x49ea12,_0x527797){var _0x4d59ea={'raw':![],'where':{}};var _0x7d0215={};var _0x1a3226={'count':0x0,'rows':[]};return db[_0x3f5e('0x45')]['findOne']({'where':{'id':_0x6098d6[_0x3f5e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x49ea12,null))['then'](function(_0x5f0204){if(_0x5f0204){_0x7d0215['model']=_[_0x3f5e('0x4b')](db[_0x3f5e('0x72')][_0x3f5e('0x46')]);_0x7d0215[_0x3f5e('0x4a')]=_[_0x3f5e('0x4b')](_0x6098d6[_0x3f5e('0x4a')]);_0x7d0215[_0x3f5e('0x53')]=_[_0x3f5e('0x4c')](_0x7d0215[_0x3f5e('0x49')],_0x7d0215[_0x3f5e('0x4a')]);_0x4d59ea[_0x3f5e('0x4d')]=_[_0x3f5e('0x4c')](_0x7d0215[_0x3f5e('0x49')],qs[_0x3f5e('0x4e')](_0x6098d6['query'][_0x3f5e('0x4e')]));_0x4d59ea[_0x3f5e('0x4d')]=_0x4d59ea[_0x3f5e('0x4d')][_0x3f5e('0x5f')]?_0x4d59ea[_0x3f5e('0x4d')]:_0x7d0215[_0x3f5e('0x49')];if(!_0x6098d6['query'][_0x3f5e('0x4f')](_0x3f5e('0x50'))){_0x4d59ea['limit']=qs[_0x3f5e('0x37')](_0x6098d6[_0x3f5e('0x4a')][_0x3f5e('0x37')]);_0x4d59ea['offset']=qs[_0x3f5e('0x36')](_0x6098d6[_0x3f5e('0x4a')][_0x3f5e('0x36')]);}_0x4d59ea[_0x3f5e('0x51')]=qs[_0x3f5e('0x52')](_0x6098d6[_0x3f5e('0x4a')]['sort']);_0x4d59ea[_0x3f5e('0x56')]=qs[_0x3f5e('0x53')](_[_0x3f5e('0x6e')](_0x6098d6['query'],_0x7d0215[_0x3f5e('0x53')]));_0x4d59ea[_0x3f5e('0x56')][_0x3f5e('0x6f')]=_0x5f0204['id'];if(_0x6098d6[_0x3f5e('0x4a')][_0x3f5e('0x54')]){_0x4d59ea[_0x3f5e('0x56')]=_[_0x3f5e('0x55')](_0x4d59ea['where'],{'$or':_[_0x3f5e('0x44')](_0x4d59ea['attributes'],function(_0x2db59b){var _0x581861={};_0x581861[_0x2db59b]={'$like':'%'+_0x6098d6[_0x3f5e('0x4a')]['filter']+'%'};return _0x581861;})});}_0x4d59ea=_[_0x3f5e('0x55')]({},_0x4d59ea,_0x6098d6['options']);return db[_0x3f5e('0x72')][_0x3f5e('0x35')]({'where':_0x4d59ea[_0x3f5e('0x56')]})[_0x3f5e('0x27')](function(_0x1cb75e){_0x1a3226['count']=_0x1cb75e;if(_0x6098d6['query'][_0x3f5e('0x60')]){_0x4d59ea[_0x3f5e('0x59')]=[{'all':!![]}];}return db[_0x3f5e('0x72')][_0x3f5e('0x5a')](_0x4d59ea);})[_0x3f5e('0x27')](function(_0x4c8c20){_0x1a3226[_0x3f5e('0x5b')]=_0x4c8c20;return _0x1a3226;});}})[_0x3f5e('0x27')](respondWithFilteredResult(_0x49ea12,_0x4d59ea))['catch'](handleError(_0x49ea12,null));};exports[_0x3f5e('0x74')]=function(_0x2f2959,_0x320cf5,_0x39b2a3){return db[_0x3f5e('0x45')][_0x3f5e('0x61')]({'where':{'id':_0x2f2959[_0x3f5e('0x5e')]['id']}})['then'](handleEntityNotFound(_0x320cf5,null))[_0x3f5e('0x27')](function(_0x36853a){if(_0x36853a){return _0x36853a[_0x3f5e('0x74')](_0x2f2959['query'][_0x3f5e('0x71')]);}})[_0x3f5e('0x27')](respondWithStatusCode(_0x320cf5,null))['catch'](handleError(_0x320cf5,null));};exports[_0x3f5e('0x75')]=function(_0x4ab47a,_0x2aadbb,_0x41bb02){var _0x5fc849={'body':_0x4ab47a[_0x3f5e('0x63')],'channel':'openchannel'};var _0x289684=[];var _0x145d46=[];var _0x5652a2={};var _0xf078b3=![];return db[_0x3f5e('0x76')][_0x3f5e('0x69')]()[_0x3f5e('0x27')](function(_0x287048){if(!_0x287048){throw new db[(_0x3f5e('0x23'))][(_0x3f5e('0x24'))](_0x3f5e('0x77'));}_0x289684=_['difference'](_['keys'](_0x287048),[_0x3f5e('0x78'),'updatedAt']);_0x145d46=_['difference'](_['keys'](_0x287048),[_0x3f5e('0x78'),_0x3f5e('0x79'),_0x3f5e('0x7a'),_0x3f5e('0x7b')]);if(_0x4ab47a[_0x3f5e('0x63')]['id']){delete _0x4ab47a['body']['id'];}if(_[_0x3f5e('0x7c')](_0x4ab47a[_0x3f5e('0x63')]['from'])){throw new db[(_0x3f5e('0x23'))][(_0x3f5e('0x24'))](_0x3f5e('0x7d'));}if(_[_0x3f5e('0x7c')](_0x4ab47a[_0x3f5e('0x63')]['body'])||_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x63')]===''){throw new db[(_0x3f5e('0x23'))][(_0x3f5e('0x24'))](_0x3f5e('0x7e'));}if(_[_0x3f5e('0x7c')](_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x7f')])){throw new db['Sequelize'][(_0x3f5e('0x24'))](_0x3f5e('0x80')+_0x145d46);}if(!_['includes'](_0x145d46,_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x7f')])){throw new db[(_0x3f5e('0x23'))][(_0x3f5e('0x24'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x145d46);}_0x5652a2[_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x7f')]]=_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x81')];})[_0x3f5e('0x27')](function(){return db['OpenchannelAccount'][_0x3f5e('0x61')]({'where':{'id':_0x4ab47a[_0x3f5e('0x5e')]['id']},'include':[{'model':db[_0x3f5e('0x82')],'as':'List','include':[{'model':db[_0x3f5e('0x76')],'as':_0x3f5e('0x83'),'where':_0x5652a2,'limit':0x1,'order':[[_0x3f5e('0x79'),_0x3f5e('0x84')]]}]},{'model':db[_0x3f5e('0x85')],'as':'Applications'}]});})[_0x3f5e('0x27')](handleEntityNotFound(_0x2aadbb,null))[_0x3f5e('0x27')](function(_0x17018e){if(_0x17018e&&_0x17018e[_0x3f5e('0x86')]){_0x5fc849['account']=_0x17018e;_0x5fc849[_0x3f5e('0x87')]=_0x17018e[_0x3f5e('0x88')];_0x5fc849['list']=_0x17018e[_0x3f5e('0x86')];_0x5fc849['applications']=_[_0x3f5e('0x89')](_0x5fc849['applications'],[_0x3f5e('0x8a')],[_0x3f5e('0x8b')]);if(_0x5fc849[_0x3f5e('0x8c')][_0x3f5e('0x88')]){delete _0x5fc849['account'][_0x3f5e('0x88')];}if(_0x5fc849[_0x3f5e('0x8c')]['List']&&_0x5fc849[_0x3f5e('0x8c')][_0x3f5e('0x86')]['Contacts'][_0x3f5e('0x5f')]){return _0x5fc849[_0x3f5e('0x8c')][_0x3f5e('0x86')][_0x3f5e('0x83')][0x0];}var _0x10a170=_[_0x3f5e('0x1b')](_0x4ab47a[_0x3f5e('0x63')],{'firstName':_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x81')],'ListId':_0x17018e[_0x3f5e('0x7b')]});_0x10a170[_0x4ab47a['body'][_0x3f5e('0x7f')]]=_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x81')];return db[_0x3f5e('0x76')][_0x3f5e('0x62')](_0x10a170,{'fields':_0x289684,'raw':!![]});}})['then'](handleEntityNotFound(_0x2aadbb,null))[_0x3f5e('0x27')](function(_0x3781aa){_0x5fc849[_0x3f5e('0x8d')]=_0x3781aa;if(_0x3781aa){var _0x21c2a4={'ContactId':_0x3781aa['id'],'OpenchannelAccountId':_0x4ab47a['params']['id'],'from':(_0x3781aa[_0x3f5e('0x8e')]||'')+'\x20'+(_0x3781aa[_0x3f5e('0x8f')]||'')};var _0x3c6a38={'OpenchannelAccountId':_0x4ab47a[_0x3f5e('0x5e')]['id'],'closed':![]};if(_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x90')]){_0x3c6a38[_0x3f5e('0x90')]=_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x90')];return db[_0x3f5e('0x91')][_0x3f5e('0x61')]({'where':_0x3c6a38})['then'](function(_0x5e4588){if(_0x5e4588){return[_0x5e4588,![]];}_0x21c2a4[_0x3f5e('0x90')]=_0x4ab47a[_0x3f5e('0x63')]['threadId'];_0x21c2a4['externalUrl']=_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x92')];return db[_0x3f5e('0x91')][_0x3f5e('0x62')](_0x21c2a4)[_0x3f5e('0x27')](function(_0x4fbfe8){return[_0x4fbfe8,!![]];});});}else{_0x3c6a38[_0x3f5e('0x90')]=null;}_0x3c6a38[_0x3f5e('0x93')]=_0x3781aa['id'];return db[_0x3f5e('0x91')][_0x3f5e('0x61')]({'where':_0x3c6a38})['then'](function(_0x2d7a46){if(_0x2d7a46){return[_0x2d7a46,![]];}return db[_0x3f5e('0x91')]['create'](_0x21c2a4)[_0x3f5e('0x27')](function(_0x387a5b){return[_0x387a5b,!![]];});});}})['spread'](function(_0x551aa3,_0x30f1c2){if(_0x551aa3){_0xf078b3=_0x30f1c2;if(!_0x30f1c2){var _0x5b3cfd={'from':(_0x5fc849['contact']['firstName']||'')+'\x20'+(_0x5fc849[_0x3f5e('0x8d')][_0x3f5e('0x8f')]||'')};if(_0x4ab47a['body'][_0x3f5e('0x90')]&&_0x4ab47a[_0x3f5e('0x63')]['messageId']&&_0x4ab47a[_0x3f5e('0x63')]['threadId']!=_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x94')]){_0x5b3cfd['threadId']=_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x94')];}return _0x551aa3[_0x3f5e('0x3c')](_0x5b3cfd);}else{return _0x551aa3;}}})['then'](function(_0x3e8b02){_0x5fc849['interaction']=_0x3e8b02[_0x3f5e('0x3e')]({'plain':!![]});_0x5fc849[_0x3f5e('0x95')][_0x3f5e('0x96')]=_0xf078b3;if(_0x5fc849[_0x3f5e('0x95')][_0x3f5e('0x96')]){if(_0x5fc849['account']['autoclose']){_0x5fc849[_0x3f5e('0x87')]['push']({'id':0x0,'priority':_0x5fc849[_0x3f5e('0x87')][_0x3f5e('0x5f')]+0x1,'app':_0x3f5e('0x97'),'appdata':_0x3f5e('0x98'),'interval':_0x3f5e('0x99')});}}return db[_0x3f5e('0x9a')][_0x3f5e('0x62')]({'body':_0x4ab47a['body'][_0x3f5e('0x63')],'OpenchannelAccountId':_0x4ab47a[_0x3f5e('0x5e')]['id'],'OpenchannelInteractionId':_0x3e8b02['id'],'direction':'in','ContactId':_0x5fc849[_0x3f5e('0x8d')]['id'],'AttachmentId':_0x4ab47a[_0x3f5e('0x63')][_0x3f5e('0x9b')]});})[_0x3f5e('0x27')](function(_0x4d2e88){_0x5fc849['message']=_0x4d2e88;if(_0x5fc849[_0x3f5e('0x95')][_0x3f5e('0x9c')]){return db[_0x3f5e('0x9d')][_0x3f5e('0x61')]({'attributes':['id',_0x3f5e('0x41')],'where':{'id':_0x5fc849[_0x3f5e('0x95')][_0x3f5e('0x9c')]}})[_0x3f5e('0x27')](function(_0x505748){if(_0x505748){_0x5fc849[_0x3f5e('0x87')][_0x3f5e('0x9e')]({'id':0x0,'priority':0x0,'app':_0x3f5e('0x9f'),'appdata':_0x505748['name']+','+(_0x5fc849[_0x3f5e('0x8c')][_0x3f5e('0xa0')]||0xa),'interval':_0x3f5e('0x99')});_0x5fc849[_0x3f5e('0xa1')]=![];}return respondWithRpcPromise(_0x3f5e('0xa2'),_0x3f5e('0xa3'),_0x5fc849);});}return respondWithRpcPromise('Start',_0x3f5e('0xa3'),_0x5fc849);})[_0x3f5e('0x27')](function(_0x4aaeac){respondWithRpcPromise(_0x3f5e('0xa4'),_0x3f5e('0xa4'),{'event':_0x3f5e('0x75'),'message':_0x4aaeac},client9002);return _0x4aaeac;})[_0x3f5e('0x27')](respondWithResult(_0x2aadbb,null))[_0x3f5e('0x5c')](handleError(_0x2aadbb,null));};exports['addApplications']=function(_0x1a1096,_0x1bea2b,_0x10112a){return db['OpenchannelAccount'][_0x3f5e('0xa5')]({'where':{'id':_0x1a1096['params']['id']}})['then'](handleEntityNotFound(_0x1bea2b,null))[_0x3f5e('0x27')](function(_0x550ddb){if(_0x550ddb){return db[_0x3f5e('0xa6')][_0x3f5e('0xa7')](function(_0x2110e0){return db[_0x3f5e('0x85')][_0x3f5e('0x3d')]({'where':{'OpenchannelAccountId':_0x1a1096[_0x3f5e('0x5e')]['id']},'transaction':_0x2110e0})[_0x3f5e('0x27')](function(_0x4d7dd5){var _0x16d341=_[_0x3f5e('0x44')](_0x1a1096[_0x3f5e('0x63')],function(_0x4cf8a0){_0x4cf8a0[_0x3f5e('0x6f')]=_0x1a1096[_0x3f5e('0x5e')]['id'];return _0x4cf8a0;});return db[_0x3f5e('0x85')][_0x3f5e('0xa8')](_0x16d341,{'transaction':_0x2110e0});});})[_0x3f5e('0x27')](function(){return db[_0x3f5e('0x85')][_0x3f5e('0xa9')]({'where':{'OpenchannelAccountId':_0x1a1096[_0x3f5e('0x5e')]['id']},'order':_0x3f5e('0x8a')});});}})[_0x3f5e('0x27')](respondWithResult(_0x1bea2b,null))[_0x3f5e('0x5c')](handleError(_0x1bea2b,null));};exports['getApplications']=function(_0x33d09d,_0x45dd2a,_0x1adbb1){var _0x3665d0={};var _0x394a7b={};var _0x13c9c2;var _0x8b0296;return db[_0x3f5e('0x45')][_0x3f5e('0xa5')]({'where':{'id':_0x33d09d['params']['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x45dd2a,null))['then'](function(_0x5f631c){if(_0x5f631c){_0x13c9c2=_0x5f631c;_0x394a7b[_0x3f5e('0x49')]=_[_0x3f5e('0x4b')](db['OpenchannelApplication'][_0x3f5e('0x46')]);_0x394a7b[_0x3f5e('0x4a')]=_[_0x3f5e('0x4b')](_0x33d09d[_0x3f5e('0x4a')]);_0x394a7b[_0x3f5e('0x53')]=_[_0x3f5e('0x4c')](_0x394a7b[_0x3f5e('0x49')],_0x394a7b[_0x3f5e('0x4a')]);_0x3665d0['attributes']=_[_0x3f5e('0x4c')](_0x394a7b[_0x3f5e('0x49')],qs[_0x3f5e('0x4e')](_0x33d09d['query'][_0x3f5e('0x4e')]));_0x3665d0[_0x3f5e('0x4d')]=_0x3665d0['attributes'][_0x3f5e('0x5f')]?_0x3665d0[_0x3f5e('0x4d')]:_0x394a7b[_0x3f5e('0x49')];_0x3665d0[_0x3f5e('0x51')]=qs[_0x3f5e('0x52')](_0x33d09d[_0x3f5e('0x4a')][_0x3f5e('0x52')]);_0x3665d0[_0x3f5e('0x56')]=qs[_0x3f5e('0x53')](_['pick'](_0x33d09d['query'],_0x394a7b[_0x3f5e('0x53')]));if(_0x33d09d[_0x3f5e('0x4a')][_0x3f5e('0x54')]){_0x3665d0[_0x3f5e('0x56')]=_['merge'](_0x3665d0[_0x3f5e('0x56')],{'$or':_[_0x3f5e('0x44')](_0x3665d0[_0x3f5e('0x4d')],function(_0x2ddb36){var _0x1c4c3e={};_0x1c4c3e[_0x2ddb36]={'$like':'%'+_0x33d09d['query']['filter']+'%'};return _0x1c4c3e;})});}_0x3665d0=_[_0x3f5e('0x55')]({},_0x3665d0,_0x33d09d[_0x3f5e('0x58')]);return _0x13c9c2[_0x3f5e('0xaa')](_0x3665d0);}})[_0x3f5e('0x27')](function(_0x1069a4){if(_0x1069a4){_0x8b0296=_0x1069a4[_0x3f5e('0x5f')];if(!_0x33d09d[_0x3f5e('0x4a')][_0x3f5e('0x4f')](_0x3f5e('0x50'))){_0x3665d0[_0x3f5e('0x37')]=qs[_0x3f5e('0x37')](_0x33d09d[_0x3f5e('0x4a')]['limit']);_0x3665d0['offset']=qs[_0x3f5e('0x36')](_0x33d09d['query'][_0x3f5e('0x36')]);}return _0x13c9c2[_0x3f5e('0xaa')](_0x3665d0);}})['then'](function(_0x1e4703){if(_0x1e4703){return _0x1e4703?{'count':_0x8b0296,'rows':_0x1e4703}:null;}})[_0x3f5e('0x27')](respondWithResult(_0x45dd2a,null))['catch'](handleError(_0x45dd2a,null));};exports[_0x3f5e('0xab')]=function(_0xb66b15,_0x436e6d,_0x5ae799){var _0x9fa7db={'raw':![],'where':{}};var _0x54ae62={};var _0x1dbf30={'count':0x0,'rows':[]};return db[_0x3f5e('0x45')][_0x3f5e('0xa5')]({'where':{'id':_0xb66b15[_0x3f5e('0x5e')]['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x436e6d,null))['then'](function(_0x230518){if(_0x230518){_0x54ae62[_0x3f5e('0x49')]=_[_0x3f5e('0x4b')](db['OpenchannelInteraction'][_0x3f5e('0x46')]);_0x54ae62[_0x3f5e('0x4a')]=_[_0x3f5e('0x4b')](_0xb66b15[_0x3f5e('0x4a')]);_0x54ae62[_0x3f5e('0x53')]=_[_0x3f5e('0x4c')](_0x54ae62[_0x3f5e('0x49')],_0x54ae62[_0x3f5e('0x4a')]);_0x9fa7db[_0x3f5e('0x4d')]=_[_0x3f5e('0x4c')](_0x54ae62[_0x3f5e('0x49')],qs[_0x3f5e('0x4e')](_0xb66b15[_0x3f5e('0x4a')]['fields']));_0x9fa7db[_0x3f5e('0x4d')]=_0x9fa7db[_0x3f5e('0x4d')][_0x3f5e('0x5f')]?_0x9fa7db['attributes']:_0x54ae62[_0x3f5e('0x49')];if(!_0xb66b15[_0x3f5e('0x4a')][_0x3f5e('0x4f')](_0x3f5e('0x50'))){_0x9fa7db[_0x3f5e('0x37')]=qs['limit'](_0xb66b15[_0x3f5e('0x4a')][_0x3f5e('0x37')]);_0x9fa7db[_0x3f5e('0x36')]=qs[_0x3f5e('0x36')](_0xb66b15['query']['offset']);}_0x9fa7db[_0x3f5e('0x51')]=qs['sort'](_0xb66b15[_0x3f5e('0x4a')]['sort']);_0x9fa7db[_0x3f5e('0x56')]=qs[_0x3f5e('0x53')](_[_0x3f5e('0x6e')](_0xb66b15['query'],_0x54ae62[_0x3f5e('0x53')]));_0x9fa7db[_0x3f5e('0x56')][_0x3f5e('0x6f')]=_0x230518['id'];if(_0xb66b15[_0x3f5e('0x4a')][_0x3f5e('0x54')]){_0x9fa7db[_0x3f5e('0x56')]=_[_0x3f5e('0x55')](_0x9fa7db[_0x3f5e('0x56')],{'$or':_[_0x3f5e('0x44')](_0x9fa7db['attributes'],function(_0x1315c8){var _0x25af33={};_0x25af33[_0x1315c8]={'$like':'%'+_0xb66b15[_0x3f5e('0x4a')][_0x3f5e('0x54')]+'%'};return _0x25af33;})});}_0x9fa7db=_[_0x3f5e('0x55')]({},_0x9fa7db,_0xb66b15[_0x3f5e('0x58')]);return db[_0x3f5e('0x91')][_0x3f5e('0x35')]({'where':_0x9fa7db[_0x3f5e('0x56')]})[_0x3f5e('0x27')](function(_0x48974c){_0x1dbf30[_0x3f5e('0x35')]=_0x48974c;if(_0xb66b15[_0x3f5e('0x4a')][_0x3f5e('0x60')]){_0x9fa7db[_0x3f5e('0x59')]=[{'model':db[_0x3f5e('0x76')],'as':_0x3f5e('0xac'),'required':![]},{'model':db[_0x3f5e('0x9d')],'as':_0x3f5e('0xad'),'attributes':[_0x3f5e('0x41'),_0x3f5e('0xae'),_0x3f5e('0xaf')],'required':![]},{'model':db[_0x3f5e('0xb0')],'as':_0x3f5e('0xb1'),'attributes':['id','name',_0x3f5e('0xb2')],'where':_0xb66b15[_0x3f5e('0x4a')][_0x3f5e('0xb3')]?{'id':_0xb66b15[_0x3f5e('0x4a')]['tag']}:undefined,'required':_0xb66b15[_0x3f5e('0x4a')]['tag']?!![]:![]}];}return db[_0x3f5e('0x91')][_0x3f5e('0x5a')](_0x9fa7db);})['then'](function(_0x3768f9){_0x1dbf30[_0x3f5e('0x5b')]=_0x3768f9;return _0x1dbf30;});}})[_0x3f5e('0x27')](respondWithFilteredResult(_0x436e6d,_0x9fa7db))[_0x3f5e('0x5c')](handleError(_0x436e6d,null));};exports[_0x3f5e('0xb4')]=function(_0x59d1df,_0x4592b7,_0x16ab78){return db['OpenchannelAccount'][_0x3f5e('0x61')]({'where':{'id':_0x59d1df['params']['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x4592b7,null))[_0x3f5e('0x27')](function(_0x266622){if(_0x266622){return _0x266622[_0x3f5e('0xb4')](_0x59d1df[_0x3f5e('0x63')][_0x3f5e('0x71')],_[_0x3f5e('0xb5')](_0x59d1df['body'],[_0x3f5e('0x71'),'id'])||{})[_0x3f5e('0xb6')](function(_0x44bb23){for(var _0x36a828=0x0;_0x36a828<_0x59d1df[_0x3f5e('0x63')][_0x3f5e('0x71')][_0x3f5e('0x5f')];_0x36a828+=0x1){socket[_0x3f5e('0xb7')]('userOpenchannelAccount:save',{'UserId':_0x59d1df['body']['ids'][_0x36a828],'OpenchannelAccountId':_0x59d1df[_0x3f5e('0x5e')]['id']});}return _0x44bb23;});}})[_0x3f5e('0x27')](respondWithResult(_0x4592b7,null))[_0x3f5e('0x5c')](handleError(_0x4592b7,null));};exports['removeAgents']=function(_0x2cc7f7,_0x19e88a,_0x5c5083){return db[_0x3f5e('0x45')][_0x3f5e('0x61')]({'where':{'id':_0x2cc7f7[_0x3f5e('0x5e')]['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x19e88a,null))['then'](function(_0xb000e){if(_0xb000e){return _0xb000e[_0x3f5e('0xb8')](_0x2cc7f7[_0x3f5e('0x4a')]['ids'])['then'](function(){if(_[_0x3f5e('0xb9')](_0x2cc7f7[_0x3f5e('0x4a')][_0x3f5e('0x71')])){for(var _0x4f7c22=0x0;_0x4f7c22<_0x2cc7f7['query'][_0x3f5e('0x71')][_0x3f5e('0x5f')];_0x4f7c22+=0x1){socket[_0x3f5e('0xb7')](_0x3f5e('0xba'),{'UserId':Number(_0x2cc7f7[_0x3f5e('0x4a')]['ids'][_0x4f7c22]),'OpenchannelAccountId':Number(_0x2cc7f7['params']['id'])});}}else{socket['emit'](_0x3f5e('0xba'),{'UserId':Number(_0x2cc7f7[_0x3f5e('0x4a')]['ids']),'OpenchannelAccountId':Number(_0x2cc7f7['params']['id'])});}});}})[_0x3f5e('0x27')](respondWithStatusCode(_0x19e88a,null))['catch'](handleError(_0x19e88a,null));};exports['getAgents']=function(_0x344951,_0x22d5a4,_0x525b51){var _0x530068={};var _0x49b20a={};var _0x14b3da;var _0x55d335;return db[_0x3f5e('0x45')][_0x3f5e('0xa5')]({'where':{'id':_0x344951[_0x3f5e('0x5e')]['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x22d5a4,null))[_0x3f5e('0x27')](function(_0x1264a9){if(_0x1264a9){_0x14b3da=_0x1264a9;_0x49b20a[_0x3f5e('0x49')]=_[_0x3f5e('0x4b')](db[_0x3f5e('0x9d')]['rawAttributes']);_0x49b20a['query']=_['keys'](_0x344951[_0x3f5e('0x4a')]);_0x49b20a['filters']=_[_0x3f5e('0x4c')](_0x49b20a[_0x3f5e('0x49')],_0x49b20a[_0x3f5e('0x4a')]);_0x530068[_0x3f5e('0x4d')]=_['intersection'](_0x49b20a[_0x3f5e('0x49')],qs['fields'](_0x344951[_0x3f5e('0x4a')][_0x3f5e('0x4e')]));_0x530068[_0x3f5e('0x4d')]=_0x530068[_0x3f5e('0x4d')]['length']?_0x530068[_0x3f5e('0x4d')]:_0x49b20a['model'];_0x530068[_0x3f5e('0x51')]=qs[_0x3f5e('0x52')](_0x344951[_0x3f5e('0x4a')][_0x3f5e('0x52')]);_0x530068[_0x3f5e('0x56')]=qs[_0x3f5e('0x53')](_[_0x3f5e('0x6e')](_0x344951[_0x3f5e('0x4a')],_0x49b20a[_0x3f5e('0x53')]));if(_0x344951[_0x3f5e('0x4a')][_0x3f5e('0x54')]){_0x530068[_0x3f5e('0x56')]=_[_0x3f5e('0x55')](_0x530068[_0x3f5e('0x56')],{'$or':_[_0x3f5e('0x44')](_0x530068[_0x3f5e('0x4d')],function(_0x2f8f0d){var _0x2f00b0={};_0x2f00b0[_0x2f8f0d]={'$like':'%'+_0x344951['query'][_0x3f5e('0x54')]+'%'};return _0x2f00b0;})});}_0x530068=_[_0x3f5e('0x55')]({},_0x530068,_0x344951[_0x3f5e('0x58')]);return _0x14b3da[_0x3f5e('0xbb')](_0x530068);}})[_0x3f5e('0x27')](function(_0x33e63f){if(_0x33e63f){_0x55d335=_0x33e63f[_0x3f5e('0x5f')];if(!_0x344951[_0x3f5e('0x4a')][_0x3f5e('0x4f')](_0x3f5e('0x50'))){_0x530068['limit']=qs[_0x3f5e('0x37')](_0x344951[_0x3f5e('0x4a')][_0x3f5e('0x37')]);_0x530068[_0x3f5e('0x36')]=qs[_0x3f5e('0x36')](_0x344951['query'][_0x3f5e('0x36')]);}return _0x14b3da[_0x3f5e('0xbb')](_0x530068);}})['then'](function(_0x57e43b){if(_0x57e43b){return _0x57e43b?{'count':_0x55d335,'rows':_0x57e43b}:null;}})[_0x3f5e('0x27')](respondWithResult(_0x22d5a4,null))[_0x3f5e('0x5c')](handleError(_0x22d5a4,null));};exports['send']=function(_0x1c54b1,_0x1cf0ae,_0x4a5855){var _0x4619ec,_0x598093,_0x572a9d;if(_[_0x3f5e('0x7c')](_0x1c54b1['body'][_0x3f5e('0x63')])||_0x1c54b1['body'][_0x3f5e('0x63')]===''){throw new db['Sequelize'][(_0x3f5e('0x24'))](_0x3f5e('0x7e'));}if(_[_0x3f5e('0x7c')](_0x1c54b1['body']['to'])){}_0x4619ec=_0x1c54b1[_0x3f5e('0x63')]['to'];return db[_0x3f5e('0x45')]['findOne']({'where':{'id':_0x1c54b1[_0x3f5e('0x5e')]['id']}})[_0x3f5e('0x27')](handleEntityNotFound(_0x1cf0ae,null))[_0x3f5e('0x27')](function(_0x2a2f36){if(_0x2a2f36){return db[_0x3f5e('0x45')]['find']({'where':{'id':_0x2a2f36['id']},'include':[{'model':db['CmList'],'as':_0x3f5e('0x86'),'include':[{'model':db['CmContact'],'as':_0x3f5e('0x83'),'where':{[_0x2a2f36[_0x3f5e('0x7f')]]:_0x4619ec},'limit':0x1,'order':[[_0x3f5e('0x79'),_0x3f5e('0x84')]]}]}]})[_0x3f5e('0x27')](handleEntityNotFound(_0x1cf0ae,null))[_0x3f5e('0x27')](function(_0x3e1e0a){if(_0x3e1e0a&&_0x3e1e0a[_0x3f5e('0x86')]){_0x598093=_0x3e1e0a[_0x3f5e('0x3e')]({'plain':!![]});if(_0x598093[_0x3f5e('0x86')]&&_0x598093[_0x3f5e('0x86')]['Contacts'][_0x3f5e('0x5f')]){return _0x598093[_0x3f5e('0x86')][_0x3f5e('0x83')][0x0];}return db[_0x3f5e('0x76')]['create'](_[_0x3f5e('0x1b')](_0x1c54b1['body'],{'firstName':_0x4619ec,[_0x3e1e0a['mapKey']]:_0x4619ec,'phone':_0x4619ec,'ListId':_0x598093['ListId']}));}})['then'](handleEntityNotFound(_0x1cf0ae,null))['then'](function(_0x1bdb06){if(_0x1bdb06){_0x572a9d=_0x1bdb06;return db[_0x3f5e('0x91')][_0x3f5e('0x61')]({'where':{'ContactId':_0x572a9d['id'],'closed':![],'OpenchannelAccountId':_0x598093['id']}})['then'](function(_0x137de1){if(_0x137de1){return[_0x137de1,![]];}return db[_0x3f5e('0x91')][_0x3f5e('0x62')]({'UserId':_0x1c54b1[_0x3f5e('0x64')]['id'],'ContactId':_0x572a9d['id'],'OpenchannelAccountId':_0x598093['id'],'lastMsgDirection':_0x3f5e('0xbc'),'Messages':[_[_0x3f5e('0x55')](_0x1c54b1['body'],{'read':![],'body':_0x1c54b1['body'][_0x3f5e('0x63')],'OpenchannelAccountId':_0x598093['id'],'UserId':_0x1c54b1[_0x3f5e('0x64')]['id'],'ContactId':_0x572a9d['id']})]},{'include':[{'model':db[_0x3f5e('0x9a')],'as':_0x3f5e('0xbd')}]})[_0x3f5e('0x27')](function(_0xd8922){return[_0xd8922,!![]];});});}})['spread'](function(_0x9a2da8,_0x838fbf){if(_0x838fbf){return _0x9a2da8;}return db[_0x3f5e('0x9a')][_0x3f5e('0x62')](_[_0x3f5e('0x55')](_0x1c54b1[_0x3f5e('0x63')],{'read':![],'body':_0x1c54b1[_0x3f5e('0x63')]['body'],'OpenchannelAccountId':_0x598093['id'],'OpenchannelInteractionId':_0x9a2da8['id'],'UserId':_0x1c54b1[_0x3f5e('0x64')]['id'],'ContactId':_0x572a9d['id']}))[_0x3f5e('0x27')](function(_0x179ef1){_0x9a2da8['dataValues']['Messages']=[];_0x9a2da8[_0x3f5e('0xbe')][_0x3f5e('0xbd')][_0x3f5e('0xbf')](_0x179ef1['dataValues']);return _0x9a2da8;});});}})[_0x3f5e('0x27')](respondWithResult(_0x1cf0ae,null))[_0x3f5e('0x5c')](handleError(_0x1cf0ae,null));}; \ No newline at end of file +var _0x118d=['jayson/promise','client','http','test','ValidationError','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','status','json','count','offset','limit','Content-Range','reject','save','update','get','OpenchannelAccounts','UserProfileResource','end','sendStatus','stack','name','send','index','Pause','mandatoryDispositionPause','map','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','pick','filter','VIRTUAL','include','OpenchannelAccount','findAll','rows','show','params','keys','includeAll','merge','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','destroy','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','nolimit','where','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','rawAttributes','options','removeAnswers','notify','Sequelize','createdAt','difference','updatedAt','CompanyId','ListId','isNil','from','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','DESC','Applications','List','applications','orderBy','asc','account','contact','firstName','threadId','OpenchannelInteraction','externalUrl','spread','lastName','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','addApplications','sequelize','OpenchannelApplication','bulkCreate','findAndCountAll','getApplications','getInteractions','CmContact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','CmList','Contacts','out','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register'];(function(_0x3ac7e6,_0x392fe5){var _0x592a9b=function(_0x515656){while(--_0x515656){_0x3ac7e6['push'](_0x3ac7e6['shift']());}};_0x592a9b(++_0x392fe5);}(_0x118d,0x156));var _0xd118=function(_0x255e68,_0x1fbe06){_0x255e68=_0x255e68-0x0;var _0x30d38a=_0x118d[_0x255e68];return _0x30d38a;};'use strict';var pdf=require(_0xd118('0x0'));var emlformat=require(_0xd118('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd118('0x2'));var moment=require(_0xd118('0x3'));var BPromise=require(_0xd118('0x4'));var Mustache=require(_0xd118('0x5'));var util=require(_0xd118('0x6'));var path=require(_0xd118('0x7'));var sox=require('sox');var csv=require(_0xd118('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd118('0x9'));var jsforce=require(_0xd118('0xa'));var deskjs=require(_0xd118('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd118('0xc'));var Papa=require(_0xd118('0xd'));var Redis=require('ioredis');var authService=require(_0xd118('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xd118('0xf'));var hardwareService=require(_0xd118('0x10'));var logger=require(_0xd118('0x11'))(_0xd118('0x12'));var utils=require(_0xd118('0x13'));var config=require('../../config/environment');var db=require(_0xd118('0x14'))['db'];config[_0xd118('0x15')]=_[_0xd118('0x16')](config[_0xd118('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xd118('0x17'))(new Redis(config['redis']));require(_0xd118('0x18'))[_0xd118('0x19')](socket);var jayson=require(_0xd118('0x1a'));var client=jayson[_0xd118('0x1b')][_0xd118('0x1c')]({'port':0x232c});var client9002=jayson[_0xd118('0x1b')][_0xd118('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x47771c,_0x2f1077,_0x130f6d){if(_0x130f6d){var _0x5aec32=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5aec32[_0xd118('0x1d')](_0x2f1077)){return _0x47771c;}else{throw new db['Sequelize'][(_0xd118('0x1e'))]('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 _0x47771c;}}function respondWithRpcPromise(_0x31382e,_0x5487ac,_0x3de645,_0x8dce62){return new BPromise(function(_0x2deb76,_0x3da3ab){var _0x1a1790=_0x8dce62||client;return _0x1a1790[_0xd118('0x1f')](_0x31382e,_0x3de645)[_0xd118('0x20')](function(_0x87d8b9){logger[_0xd118('0x21')](_0xd118('0x22'),_0x5487ac,_0xd118('0x23'));logger['debug'](_0xd118('0x24'),_0x5487ac,_0xd118('0x23'),JSON[_0xd118('0x25')](_0x87d8b9));if(_0x87d8b9[_0xd118('0x26')]){if(_0x87d8b9[_0xd118('0x26')]['code']===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x5487ac,_0x87d8b9[_0xd118('0x26')][_0xd118('0x27')]);return _0x3da3ab(_0x87d8b9['error'][_0xd118('0x27')]);}logger[_0xd118('0x26')](_0xd118('0x22'),_0x5487ac,_0x87d8b9[_0xd118('0x26')][_0xd118('0x27')]);return _0x2deb76(_0x87d8b9[_0xd118('0x26')][_0xd118('0x27')]);}else{logger[_0xd118('0x21')](_0xd118('0x22'),_0x5487ac,_0xd118('0x23'));_0x2deb76(_0x87d8b9[_0xd118('0x28')][_0xd118('0x27')]);}})[_0xd118('0x29')](function(_0x4450b0){logger[_0xd118('0x26')]('OpenchannelAccount,\x20%s,\x20%s',_0x5487ac,_0x4450b0);_0x3da3ab(_0x4450b0);});});}function respondWithStatusCode(_0x3e8161,_0x3b2153){_0x3b2153=_0x3b2153||0xcc;return function(_0x1d1f6e){if(_0x1d1f6e){return _0x3e8161['sendStatus'](_0x3b2153);}return _0x3e8161[_0xd118('0x2a')](_0x3b2153)['end']();};}function respondWithResult(_0x16e867,_0x4f82c4){_0x4f82c4=_0x4f82c4||0xc8;return function(_0x2fc58f){if(_0x2fc58f){return _0x16e867[_0xd118('0x2a')](_0x4f82c4)[_0xd118('0x2b')](_0x2fc58f);}};}function respondWithFilteredResult(_0x2b02d8,_0x8a6f70){return function(_0x471ed5){if(_0x471ed5){var _0xcd16d7=_0x471ed5[_0xd118('0x2c')],_0x3785e8=_0x8a6f70[_0xd118('0x2d')],_0x5bbb88=_0x8a6f70['offset']+_0x8a6f70[_0xd118('0x2e')],_0xaba395;if(_0x5bbb88>=_0xcd16d7){_0x5bbb88=_0xcd16d7;_0xaba395=0xc8;}else{_0xaba395=0xce;}_0x2b02d8[_0xd118('0x2a')](_0xaba395);return _0x2b02d8['set'](_0xd118('0x2f'),_0x3785e8+'-'+_0x5bbb88+'/'+_0xcd16d7)[_0xd118('0x2b')](_0x471ed5);}return null;};}function patchUpdates(_0x45bd00){return function(_0x16e25c){try{jsonpatch['apply'](_0x16e25c,_0x45bd00,!![]);}catch(_0xf60529){return BPromise[_0xd118('0x30')](_0xf60529);}return _0x16e25c[_0xd118('0x31')]();};}function saveUpdates(_0x2f2cc8,_0xade6ea){return function(_0x560980){if(_0x560980){return _0x560980[_0xd118('0x32')](_0x2f2cc8)[_0xd118('0x20')](function(_0x4fc380){return _0x4fc380;});}return null;};}function removeEntity(_0x103010,_0x44a9a4){return function(_0x4b129b){if(_0x4b129b){return _0x4b129b['destroy']()[_0xd118('0x20')](function(){var _0xd1ac9b=_0x4b129b[_0xd118('0x33')]({'plain':!![]});var _0x469d62=_0xd118('0x34');return db[_0xd118('0x35')]['destroy']({'where':{'type':_0x469d62,'resourceId':_0xd1ac9b['id']}})['then'](function(){return _0x4b129b;});})[_0xd118('0x20')](function(){_0x103010['status'](0xcc)[_0xd118('0x36')]();});}};}function handleEntityNotFound(_0x3070a4,_0x12e4ed){return function(_0x225b4e){if(!_0x225b4e){_0x3070a4[_0xd118('0x37')](0x194);}return _0x225b4e;};}function handleError(_0x4d7118,_0x2287c3){_0x2287c3=_0x2287c3||0x1f4;return function(_0x367b05){logger['error'](_0x367b05[_0xd118('0x38')]);if(_0x367b05[_0xd118('0x39')]){delete _0x367b05[_0xd118('0x39')];}_0x4d7118[_0xd118('0x2a')](_0x2287c3)[_0xd118('0x3a')](_0x367b05);};}exports[_0xd118('0x3b')]=function(_0x80f1ed,_0xeed717){var _0x17b3a2={'include':[{'model':db[_0xd118('0x3c')],'as':_0xd118('0x3d')}]},_0x48512e={},_0x40bc7d={'count':0x0,'rows':[]};var _0x1ee084=_[_0xd118('0x3e')](db['OpenchannelAccount']['rawAttributes'],function(_0x2de8ed){return{'name':_0x2de8ed['fieldName'],'type':_0x2de8ed[_0xd118('0x3f')][_0xd118('0x40')]};});_0x48512e[_0xd118('0x41')]=_[_0xd118('0x3e')](_0x1ee084,_0xd118('0x39'));_0x48512e[_0xd118('0x42')]=_['keys'](_0x80f1ed[_0xd118('0x42')]);_0x48512e[_0xd118('0x43')]=_['intersection'](_0x48512e[_0xd118('0x41')],_0x48512e[_0xd118('0x42')]);_0x17b3a2[_0xd118('0x44')]=_[_0xd118('0x45')](_0x48512e['model'],qs[_0xd118('0x46')](_0x80f1ed['query']['fields']));_0x17b3a2['attributes']=_0x17b3a2[_0xd118('0x44')][_0xd118('0x47')]?_0x17b3a2[_0xd118('0x44')]:_0x48512e[_0xd118('0x41')];if(!_0x80f1ed[_0xd118('0x42')][_0xd118('0x48')]('nolimit')){_0x17b3a2[_0xd118('0x2e')]=qs[_0xd118('0x2e')](_0x80f1ed[_0xd118('0x42')]['limit']);_0x17b3a2[_0xd118('0x2d')]=qs[_0xd118('0x2d')](_0x80f1ed['query'][_0xd118('0x2d')]);}_0x17b3a2[_0xd118('0x49')]=qs[_0xd118('0x4a')](_0x80f1ed[_0xd118('0x42')][_0xd118('0x4a')]);_0x17b3a2['where']=qs[_0xd118('0x43')](_[_0xd118('0x4b')](_0x80f1ed[_0xd118('0x42')],_0x48512e[_0xd118('0x43')]));if(_0x80f1ed[_0xd118('0x42')][_0xd118('0x4c')]){_0x17b3a2['where']=_['merge'](_0x17b3a2['where'],{'$or':_[_0xd118('0x3e')](_0x1ee084,function(_0x5cbca7){if(_0x5cbca7[_0xd118('0x3f')]!==_0xd118('0x4d')){var _0x546035={};_0x546035[_0x5cbca7[_0xd118('0x39')]]={'$like':'%'+_0x80f1ed[_0xd118('0x42')][_0xd118('0x4c')]+'%'};return _0x546035;}})});}_0x17b3a2=_['merge']({},_0x17b3a2,_0x80f1ed['options']);var _0x4d46ef={'where':_0x17b3a2['where']};return db['OpenchannelAccount']['count'](_0x4d46ef)[_0xd118('0x20')](function(_0x362370){_0x40bc7d[_0xd118('0x2c')]=_0x362370;if(_0x80f1ed['query']['includeAll']){_0x17b3a2[_0xd118('0x4e')]=[{'all':!![]}];}return db[_0xd118('0x4f')][_0xd118('0x50')](_0x17b3a2);})[_0xd118('0x20')](function(_0xd7b68c){_0x40bc7d[_0xd118('0x51')]=_0xd7b68c;return _0x40bc7d;})[_0xd118('0x20')](respondWithFilteredResult(_0xeed717,_0x17b3a2))[_0xd118('0x29')](handleError(_0xeed717,null));};exports[_0xd118('0x52')]=function(_0x4da461,_0x4f1cab){var _0x2e6c0b={'raw':![],'where':{'id':_0x4da461[_0xd118('0x53')]['id']},'include':[{'model':db[_0xd118('0x3c')],'as':'mandatoryDispositionPause'}]},_0x1f30ff={};_0x1f30ff[_0xd118('0x41')]=_[_0xd118('0x54')](db[_0xd118('0x4f')]['rawAttributes']);_0x1f30ff[_0xd118('0x42')]=_[_0xd118('0x54')](_0x4da461[_0xd118('0x42')]);_0x1f30ff['filters']=_[_0xd118('0x45')](_0x1f30ff[_0xd118('0x41')],_0x1f30ff[_0xd118('0x42')]);_0x2e6c0b['attributes']=_[_0xd118('0x45')](_0x1f30ff['model'],qs[_0xd118('0x46')](_0x4da461[_0xd118('0x42')][_0xd118('0x46')]));_0x2e6c0b['attributes']=_0x2e6c0b[_0xd118('0x44')][_0xd118('0x47')]?_0x2e6c0b['attributes']:_0x1f30ff[_0xd118('0x41')];if(_0x4da461[_0xd118('0x42')][_0xd118('0x55')]){_0x2e6c0b[_0xd118('0x4e')]=[{'all':!![]}];}_0x2e6c0b=_[_0xd118('0x56')]({},_0x2e6c0b,_0x4da461['options']);return db[_0xd118('0x4f')][_0xd118('0x57')](_0x2e6c0b)['then'](handleEntityNotFound(_0x4f1cab,null))['then'](respondWithResult(_0x4f1cab,null))[_0xd118('0x29')](handleError(_0x4f1cab,null));};exports[_0xd118('0x58')]=function(_0x3b3b51,_0x5d7e25){return db[_0xd118('0x4f')]['create'](_0x3b3b51['body'],{})[_0xd118('0x20')](function(_0x4b3ebd){var _0x218d56=_0x3b3b51['user'][_0xd118('0x33')]({'plain':!![]});if(!_0x218d56)throw new Error(_0xd118('0x59'));if(_0x218d56[_0xd118('0x5a')]===_0xd118('0x5b')){var _0x5c98e4=_0x4b3ebd['get']({'plain':!![]});var _0x51c501='OpenchannelAccounts';return db[_0xd118('0x5c')][_0xd118('0x57')]({'where':{'name':_0x51c501,'userProfileId':_0x218d56[_0xd118('0x5d')]},'raw':!![]})[_0xd118('0x20')](function(_0x2131a8){if(_0x2131a8&&_0x2131a8['autoAssociation']===0x0){return db[_0xd118('0x35')][_0xd118('0x58')]({'name':_0x5c98e4[_0xd118('0x39')],'resourceId':_0x5c98e4['id'],'type':_0x2131a8[_0xd118('0x39')],'sectionId':_0x2131a8['id']},{})[_0xd118('0x20')](function(){return _0x4b3ebd;});}else{return _0x4b3ebd;}})['catch'](function(_0x210d17){logger['error'](_0xd118('0x5e'),_0x210d17);throw _0x210d17;});}return _0x4b3ebd;})[_0xd118('0x20')](respondWithResult(_0x5d7e25,0xc9))[_0xd118('0x29')](handleError(_0x5d7e25,null));};exports[_0xd118('0x32')]=function(_0x46074e,_0x114dc5){if(_0x46074e[_0xd118('0x5f')]['id']){delete _0x46074e['body']['id'];}return db[_0xd118('0x4f')][_0xd118('0x57')]({'where':{'id':_0x46074e[_0xd118('0x53')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0xd118('0x20')](handleEntityNotFound(_0x114dc5,null))[_0xd118('0x20')](saveUpdates(_0x46074e['body'],null))[_0xd118('0x20')](respondWithResult(_0x114dc5,null))[_0xd118('0x29')](handleError(_0x114dc5,null));};exports[_0xd118('0x60')]=function(_0x2aee6f,_0x199358){return db[_0xd118('0x4f')][_0xd118('0x57')]({'where':{'id':_0x2aee6f['params']['id']}})[_0xd118('0x20')](handleEntityNotFound(_0x199358,null))[_0xd118('0x20')](removeEntity(_0x199358,null))[_0xd118('0x29')](handleError(_0x199358,null));};exports[_0xd118('0x61')]=function(_0x3687ba,_0x508d3d){return db[_0xd118('0x4f')]['describe']()[_0xd118('0x20')](respondWithResult(_0x508d3d,null))[_0xd118('0x29')](handleError(_0x508d3d,null));};exports['addDisposition']=function(_0x57f9ac,_0x47702b,_0x318d79){if(_0x57f9ac['body']['id']){delete _0x57f9ac['body']['id'];}return db[_0xd118('0x4f')][_0xd118('0x57')]({'where':{'id':_0x57f9ac[_0xd118('0x53')]['id']}})[_0xd118('0x20')](handleEntityNotFound(_0x47702b,null))['then'](function(_0x4159c0){if(_0x4159c0){_0x57f9ac[_0xd118('0x5f')][_0xd118('0x62')]=_0x4159c0['id'];return db[_0xd118('0x63')][_0xd118('0x58')](_0x57f9ac[_0xd118('0x5f')]);}})[_0xd118('0x20')](respondWithResult(_0x47702b,null))['catch'](handleError(_0x47702b,null));};exports[_0xd118('0x64')]=function(_0x365e45,_0x17956a,_0x72559f){var _0x28b717={'raw':![],'where':{}};var _0x4b3e90={};var _0x1796e5={'count':0x0,'rows':[]};return db[_0xd118('0x4f')][_0xd118('0x65')]({'where':{'id':_0x365e45[_0xd118('0x53')]['id']}})['then'](handleEntityNotFound(_0x17956a,null))[_0xd118('0x20')](function(_0x386d4c){if(_0x386d4c){_0x4b3e90[_0xd118('0x41')]=_[_0xd118('0x54')](db[_0xd118('0x63')]['rawAttributes']);_0x4b3e90[_0xd118('0x42')]=_[_0xd118('0x54')](_0x365e45[_0xd118('0x42')]);_0x4b3e90[_0xd118('0x43')]=_[_0xd118('0x45')](_0x4b3e90['model'],_0x4b3e90['query']);_0x28b717[_0xd118('0x44')]=_['intersection'](_0x4b3e90[_0xd118('0x41')],qs['fields'](_0x365e45[_0xd118('0x42')][_0xd118('0x46')]));_0x28b717[_0xd118('0x44')]=_0x28b717[_0xd118('0x44')][_0xd118('0x47')]?_0x28b717[_0xd118('0x44')]:_0x4b3e90[_0xd118('0x41')];if(!_0x365e45[_0xd118('0x42')][_0xd118('0x48')](_0xd118('0x66'))){_0x28b717[_0xd118('0x2e')]=qs[_0xd118('0x2e')](_0x365e45[_0xd118('0x42')][_0xd118('0x2e')]);_0x28b717[_0xd118('0x2d')]=qs[_0xd118('0x2d')](_0x365e45[_0xd118('0x42')][_0xd118('0x2d')]);}_0x28b717[_0xd118('0x49')]=qs['sort'](_0x365e45[_0xd118('0x42')][_0xd118('0x4a')]);_0x28b717[_0xd118('0x67')]=qs['filters'](_[_0xd118('0x4b')](_0x365e45[_0xd118('0x42')],_0x4b3e90[_0xd118('0x43')]));_0x28b717['where'][_0xd118('0x68')]=_0x386d4c['id'];if(_0x365e45[_0xd118('0x42')][_0xd118('0x4c')]){_0x28b717[_0xd118('0x67')]=_[_0xd118('0x56')](_0x28b717[_0xd118('0x67')],{'$or':_[_0xd118('0x3e')](_0x28b717[_0xd118('0x44')],function(_0xee768b){var _0x26cccd={};_0x26cccd[_0xee768b]={'$like':'%'+_0x365e45[_0xd118('0x42')][_0xd118('0x4c')]+'%'};return _0x26cccd;})});}_0x28b717=_[_0xd118('0x56')]({},_0x28b717,_0x365e45['options']);return db[_0xd118('0x63')][_0xd118('0x2c')]({'where':_0x28b717[_0xd118('0x67')]})[_0xd118('0x20')](function(_0x1fb276){_0x1796e5[_0xd118('0x2c')]=_0x1fb276;if(_0x365e45[_0xd118('0x42')][_0xd118('0x55')]){_0x28b717[_0xd118('0x4e')]=[{'all':!![]}];}return db[_0xd118('0x63')][_0xd118('0x50')](_0x28b717);})[_0xd118('0x20')](function(_0x29e51e){_0x1796e5[_0xd118('0x51')]=_0x29e51e;return _0x1796e5;});}})[_0xd118('0x20')](respondWithFilteredResult(_0x17956a,_0x28b717))[_0xd118('0x29')](handleError(_0x17956a,null));};exports['removeDispositions']=function(_0x38f885,_0x418b57,_0x1fc376){return db[_0xd118('0x4f')]['find']({'where':{'id':_0x38f885['params']['id']}})[_0xd118('0x20')](handleEntityNotFound(_0x418b57,null))[_0xd118('0x20')](function(_0x925c03){if(_0x925c03){return _0x925c03[_0xd118('0x69')](_0x38f885[_0xd118('0x42')][_0xd118('0x6a')]);}})['then'](respondWithStatusCode(_0x418b57,null))['catch'](handleError(_0x418b57,null));};exports['addAnswer']=function(_0x367c4c,_0x106739,_0x5d3c53){if(_0x367c4c[_0xd118('0x5f')]['id']){delete _0x367c4c[_0xd118('0x5f')]['id'];}return db['OpenchannelAccount'][_0xd118('0x57')]({'where':{'id':_0x367c4c[_0xd118('0x53')]['id']}})['then'](handleEntityNotFound(_0x106739,null))[_0xd118('0x20')](function(_0x376c4b){if(_0x376c4b){_0x367c4c[_0xd118('0x5f')][_0xd118('0x68')]=_0x376c4b['id'];return db[_0xd118('0x6b')][_0xd118('0x58')](_0x367c4c[_0xd118('0x5f')]);}})['then'](respondWithResult(_0x106739,null))[_0xd118('0x29')](handleError(_0x106739,null));};exports['getAnswers']=function(_0x3ce896,_0x2c3165,_0x41b982){var _0x1a7d72={'raw':![],'where':{}};var _0xed7d4={};var _0x516c24={'count':0x0,'rows':[]};return db[_0xd118('0x4f')]['findOne']({'where':{'id':_0x3ce896['params']['id']}})[_0xd118('0x20')](handleEntityNotFound(_0x2c3165,null))[_0xd118('0x20')](function(_0x5bdcdc){if(_0x5bdcdc){_0xed7d4[_0xd118('0x41')]=_['keys'](db[_0xd118('0x6b')][_0xd118('0x6c')]);_0xed7d4['query']=_[_0xd118('0x54')](_0x3ce896['query']);_0xed7d4[_0xd118('0x43')]=_['intersection'](_0xed7d4[_0xd118('0x41')],_0xed7d4[_0xd118('0x42')]);_0x1a7d72[_0xd118('0x44')]=_['intersection'](_0xed7d4[_0xd118('0x41')],qs[_0xd118('0x46')](_0x3ce896[_0xd118('0x42')][_0xd118('0x46')]));_0x1a7d72[_0xd118('0x44')]=_0x1a7d72[_0xd118('0x44')][_0xd118('0x47')]?_0x1a7d72['attributes']:_0xed7d4['model'];if(!_0x3ce896[_0xd118('0x42')][_0xd118('0x48')]('nolimit')){_0x1a7d72['limit']=qs[_0xd118('0x2e')](_0x3ce896['query'][_0xd118('0x2e')]);_0x1a7d72[_0xd118('0x2d')]=qs[_0xd118('0x2d')](_0x3ce896[_0xd118('0x42')]['offset']);}_0x1a7d72[_0xd118('0x49')]=qs[_0xd118('0x4a')](_0x3ce896['query']['sort']);_0x1a7d72[_0xd118('0x67')]=qs[_0xd118('0x43')](_[_0xd118('0x4b')](_0x3ce896[_0xd118('0x42')],_0xed7d4['filters']));_0x1a7d72[_0xd118('0x67')][_0xd118('0x68')]=_0x5bdcdc['id'];if(_0x3ce896['query'][_0xd118('0x4c')]){_0x1a7d72['where']=_[_0xd118('0x56')](_0x1a7d72[_0xd118('0x67')],{'$or':_[_0xd118('0x3e')](_0x1a7d72[_0xd118('0x44')],function(_0x14be5f){var _0x2eb778={};_0x2eb778[_0x14be5f]={'$like':'%'+_0x3ce896[_0xd118('0x42')][_0xd118('0x4c')]+'%'};return _0x2eb778;})});}_0x1a7d72=_['merge']({},_0x1a7d72,_0x3ce896[_0xd118('0x6d')]);return db['CannedAnswer'][_0xd118('0x2c')]({'where':_0x1a7d72['where']})[_0xd118('0x20')](function(_0xf7e288){_0x516c24[_0xd118('0x2c')]=_0xf7e288;if(_0x3ce896[_0xd118('0x42')]['includeAll']){_0x1a7d72[_0xd118('0x4e')]=[{'all':!![]}];}return db['CannedAnswer'][_0xd118('0x50')](_0x1a7d72);})[_0xd118('0x20')](function(_0x35b438){_0x516c24[_0xd118('0x51')]=_0x35b438;return _0x516c24;});}})[_0xd118('0x20')](respondWithFilteredResult(_0x2c3165,_0x1a7d72))[_0xd118('0x29')](handleError(_0x2c3165,null));};exports['removeAnswers']=function(_0x2dd1ea,_0x511e19,_0x18368b){return db['OpenchannelAccount'][_0xd118('0x57')]({'where':{'id':_0x2dd1ea['params']['id']}})[_0xd118('0x20')](handleEntityNotFound(_0x511e19,null))[_0xd118('0x20')](function(_0x35cc9a){if(_0x35cc9a){return _0x35cc9a[_0xd118('0x6e')](_0x2dd1ea[_0xd118('0x42')]['ids']);}})['then'](respondWithStatusCode(_0x511e19,null))[_0xd118('0x29')](handleError(_0x511e19,null));};exports[_0xd118('0x6f')]=function(_0xaccc20,_0x2ea1e6,_0x4b2077){var _0x25f324={'body':_0xaccc20[_0xd118('0x5f')],'channel':'openchannel'};var _0x1a44a3=[];var _0x40d125=[];var _0x146365={};var _0x1309f1=![];return db['CmContact'][_0xd118('0x61')]()['then'](function(_0x48aee0){if(!_0x48aee0){throw new db[(_0xd118('0x70'))][(_0xd118('0x1e'))]('no\x20available\x20attributes');}_0x1a44a3=_['difference'](_[_0xd118('0x54')](_0x48aee0),[_0xd118('0x71'),'updatedAt']);_0x40d125=_[_0xd118('0x72')](_[_0xd118('0x54')](_0x48aee0),[_0xd118('0x71'),_0xd118('0x73'),_0xd118('0x74'),_0xd118('0x75')]);if(_0xaccc20[_0xd118('0x5f')]['id']){delete _0xaccc20[_0xd118('0x5f')]['id'];}if(_[_0xd118('0x76')](_0xaccc20[_0xd118('0x5f')][_0xd118('0x77')])){throw new db[(_0xd118('0x70'))][(_0xd118('0x1e'))]('from\x20is\x20mandatory');}if(_['isNil'](_0xaccc20['body'][_0xd118('0x5f')])||_0xaccc20['body']['body']===''){throw new db[(_0xd118('0x70'))][(_0xd118('0x1e'))](_0xd118('0x78'));}if(_[_0xd118('0x76')](_0xaccc20[_0xd118('0x5f')][_0xd118('0x79')])){throw new db[(_0xd118('0x70'))][(_0xd118('0x1e'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x40d125);}if(!_['includes'](_0x40d125,_0xaccc20[_0xd118('0x5f')][_0xd118('0x79')])){throw new db[(_0xd118('0x70'))][(_0xd118('0x1e'))](_0xd118('0x7a')+_0x40d125);}_0x146365[_0xaccc20[_0xd118('0x5f')][_0xd118('0x79')]]=_0xaccc20[_0xd118('0x5f')][_0xd118('0x77')];})[_0xd118('0x20')](function(){return db[_0xd118('0x4f')][_0xd118('0x57')]({'where':{'id':_0xaccc20[_0xd118('0x53')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':'Contacts','where':_0x146365,'limit':0x1,'order':[[_0xd118('0x73'),_0xd118('0x7b')]]}]},{'model':db['OpenchannelApplication'],'as':_0xd118('0x7c')}]});})[_0xd118('0x20')](handleEntityNotFound(_0x2ea1e6,null))['then'](function(_0x4f2b13){if(_0x4f2b13&&_0x4f2b13[_0xd118('0x7d')]){_0x25f324['account']=_0x4f2b13;_0x25f324['applications']=_0x4f2b13[_0xd118('0x7c')];_0x25f324['list']=_0x4f2b13['List'];_0x25f324[_0xd118('0x7e')]=_[_0xd118('0x7f')](_0x25f324[_0xd118('0x7e')],['priority'],[_0xd118('0x80')]);if(_0x25f324[_0xd118('0x81')][_0xd118('0x7c')]){delete _0x25f324[_0xd118('0x81')][_0xd118('0x7c')];}if(_0x25f324[_0xd118('0x81')][_0xd118('0x7d')]&&_0x25f324[_0xd118('0x81')][_0xd118('0x7d')]['Contacts'][_0xd118('0x47')]){return _0x25f324['account']['List']['Contacts'][0x0];}var _0x106132=_['defaults'](_0xaccc20['body'],{'firstName':_0xaccc20['body'][_0xd118('0x77')],'ListId':_0x4f2b13['ListId']});_0x106132[_0xaccc20[_0xd118('0x5f')][_0xd118('0x79')]]=_0xaccc20[_0xd118('0x5f')][_0xd118('0x77')];return db['CmContact'][_0xd118('0x58')](_0x106132,{'fields':_0x1a44a3,'raw':!![]});}})['then'](handleEntityNotFound(_0x2ea1e6,null))[_0xd118('0x20')](function(_0x218b54){_0x25f324[_0xd118('0x82')]=_0x218b54;if(_0x218b54){var _0x5775be={'ContactId':_0x218b54['id'],'OpenchannelAccountId':_0xaccc20[_0xd118('0x53')]['id'],'from':(_0x218b54[_0xd118('0x83')]||'')+'\x20'+(_0x218b54['lastName']||'')};var _0x2c385e={'OpenchannelAccountId':_0xaccc20[_0xd118('0x53')]['id'],'closed':![]};if(_0xaccc20[_0xd118('0x5f')][_0xd118('0x84')]){_0x2c385e['threadId']=_0xaccc20[_0xd118('0x5f')][_0xd118('0x84')];return db[_0xd118('0x85')]['find']({'where':_0x2c385e})['then'](function(_0x23ea27){if(_0x23ea27){return[_0x23ea27,![]];}_0x5775be[_0xd118('0x84')]=_0xaccc20[_0xd118('0x5f')][_0xd118('0x84')];_0x5775be[_0xd118('0x86')]=_0xaccc20['body'][_0xd118('0x86')];return db['OpenchannelInteraction'][_0xd118('0x58')](_0x5775be)[_0xd118('0x20')](function(_0x3b06a0){return[_0x3b06a0,!![]];});});}else{_0x2c385e[_0xd118('0x84')]=null;}_0x2c385e['ContactId']=_0x218b54['id'];return db[_0xd118('0x85')][_0xd118('0x57')]({'where':_0x2c385e})[_0xd118('0x20')](function(_0x52b36b){if(_0x52b36b){return[_0x52b36b,![]];}return db[_0xd118('0x85')]['create'](_0x5775be)[_0xd118('0x20')](function(_0x2ffb75){return[_0x2ffb75,!![]];});});}})[_0xd118('0x87')](function(_0x3213c9,_0x3737bc){if(_0x3213c9){_0x1309f1=_0x3737bc;if(!_0x3737bc){var _0x4f05da={'from':(_0x25f324[_0xd118('0x82')]['firstName']||'')+'\x20'+(_0x25f324[_0xd118('0x82')][_0xd118('0x88')]||'')};if(_0xaccc20[_0xd118('0x5f')][_0xd118('0x84')]&&_0xaccc20[_0xd118('0x5f')][_0xd118('0x89')]&&_0xaccc20[_0xd118('0x5f')][_0xd118('0x84')]!=_0xaccc20[_0xd118('0x5f')]['messageId']){_0x4f05da['threadId']=_0xaccc20[_0xd118('0x5f')][_0xd118('0x89')];}return _0x3213c9[_0xd118('0x32')](_0x4f05da);}else{return _0x3213c9;}}})['then'](function(_0xb3db70){_0x25f324['interaction']=_0xb3db70[_0xd118('0x33')]({'plain':!![]});_0x25f324[_0xd118('0x8a')]['created']=_0x1309f1;if(_0x25f324[_0xd118('0x8a')][_0xd118('0x8b')]){if(_0x25f324[_0xd118('0x81')][_0xd118('0x8c')]){_0x25f324['applications'][_0xd118('0x8d')]({'id':0x0,'priority':_0x25f324[_0xd118('0x7e')][_0xd118('0x47')]+0x1,'app':_0xd118('0x8e'),'appdata':_0xd118('0x8f'),'interval':_0xd118('0x90')});}}return db['OpenchannelMessage']['create']({'body':_0xaccc20[_0xd118('0x5f')][_0xd118('0x5f')],'OpenchannelAccountId':_0xaccc20[_0xd118('0x53')]['id'],'OpenchannelInteractionId':_0xb3db70['id'],'direction':'in','ContactId':_0x25f324[_0xd118('0x82')]['id'],'AttachmentId':_0xaccc20[_0xd118('0x5f')][_0xd118('0x91')]});})['then'](function(_0x28c8a3){_0x25f324['message']=_0x28c8a3;if(_0x25f324['interaction'][_0xd118('0x92')]){return db[_0xd118('0x93')][_0xd118('0x57')]({'attributes':['id',_0xd118('0x39')],'where':{'id':_0x25f324[_0xd118('0x8a')][_0xd118('0x92')]}})[_0xd118('0x20')](function(_0x48fd94){if(_0x48fd94){_0x25f324[_0xd118('0x7e')][_0xd118('0x94')]({'id':0x0,'priority':0x0,'app':_0xd118('0x95'),'appdata':_0x48fd94['name']+','+(_0x25f324[_0xd118('0x81')][_0xd118('0x96')]||0xa),'interval':'*,*,*,*'});_0x25f324[_0xd118('0x97')]=![];}return respondWithRpcPromise(_0xd118('0x98'),_0xd118('0x99'),_0x25f324);});}return respondWithRpcPromise('Start',_0xd118('0x99'),_0x25f324);})[_0xd118('0x20')](function(_0x57181e){respondWithRpcPromise(_0xd118('0x9a'),_0xd118('0x9a'),{'event':_0xd118('0x6f'),'message':_0x57181e},client9002);return _0x57181e;})[_0xd118('0x20')](respondWithResult(_0x2ea1e6,null))[_0xd118('0x29')](handleError(_0x2ea1e6,null));};exports[_0xd118('0x9b')]=function(_0x1aa2db,_0x2725e2,_0x1e00d8){return db[_0xd118('0x4f')][_0xd118('0x65')]({'where':{'id':_0x1aa2db[_0xd118('0x53')]['id']}})[_0xd118('0x20')](handleEntityNotFound(_0x2725e2,null))['then'](function(_0x7e36cd){if(_0x7e36cd){return db[_0xd118('0x9c')]['transaction'](function(_0x18312b){return db[_0xd118('0x9d')][_0xd118('0x60')]({'where':{'OpenchannelAccountId':_0x1aa2db[_0xd118('0x53')]['id']},'transaction':_0x18312b})[_0xd118('0x20')](function(_0x450f76){var _0x2e9337=_['map'](_0x1aa2db[_0xd118('0x5f')],function(_0x1b3f13){_0x1b3f13['OpenchannelAccountId']=_0x1aa2db[_0xd118('0x53')]['id'];return _0x1b3f13;});return db[_0xd118('0x9d')][_0xd118('0x9e')](_0x2e9337,{'transaction':_0x18312b});});})[_0xd118('0x20')](function(){return db[_0xd118('0x9d')][_0xd118('0x9f')]({'where':{'OpenchannelAccountId':_0x1aa2db['params']['id']},'order':'priority'});});}})[_0xd118('0x20')](respondWithResult(_0x2725e2,null))[_0xd118('0x29')](handleError(_0x2725e2,null));};exports['getApplications']=function(_0x4bc0b3,_0x56ee86,_0x10401c){var _0x2823ec={};var _0x135bbf={};var _0x59c782;var _0x436741;return db[_0xd118('0x4f')][_0xd118('0x65')]({'where':{'id':_0x4bc0b3['params']['id']}})[_0xd118('0x20')](handleEntityNotFound(_0x56ee86,null))[_0xd118('0x20')](function(_0x1becc5){if(_0x1becc5){_0x59c782=_0x1becc5;_0x135bbf[_0xd118('0x41')]=_['keys'](db[_0xd118('0x9d')]['rawAttributes']);_0x135bbf[_0xd118('0x42')]=_['keys'](_0x4bc0b3[_0xd118('0x42')]);_0x135bbf['filters']=_[_0xd118('0x45')](_0x135bbf['model'],_0x135bbf[_0xd118('0x42')]);_0x2823ec[_0xd118('0x44')]=_[_0xd118('0x45')](_0x135bbf[_0xd118('0x41')],qs[_0xd118('0x46')](_0x4bc0b3['query'][_0xd118('0x46')]));_0x2823ec[_0xd118('0x44')]=_0x2823ec[_0xd118('0x44')]['length']?_0x2823ec[_0xd118('0x44')]:_0x135bbf[_0xd118('0x41')];_0x2823ec['order']=qs[_0xd118('0x4a')](_0x4bc0b3[_0xd118('0x42')]['sort']);_0x2823ec[_0xd118('0x67')]=qs[_0xd118('0x43')](_[_0xd118('0x4b')](_0x4bc0b3[_0xd118('0x42')],_0x135bbf[_0xd118('0x43')]));if(_0x4bc0b3[_0xd118('0x42')]['filter']){_0x2823ec[_0xd118('0x67')]=_[_0xd118('0x56')](_0x2823ec[_0xd118('0x67')],{'$or':_[_0xd118('0x3e')](_0x2823ec[_0xd118('0x44')],function(_0x74fc2e){var _0x52e4cd={};_0x52e4cd[_0x74fc2e]={'$like':'%'+_0x4bc0b3[_0xd118('0x42')][_0xd118('0x4c')]+'%'};return _0x52e4cd;})});}_0x2823ec=_[_0xd118('0x56')]({},_0x2823ec,_0x4bc0b3[_0xd118('0x6d')]);return _0x59c782[_0xd118('0xa0')](_0x2823ec);}})['then'](function(_0x884b4b){if(_0x884b4b){_0x436741=_0x884b4b[_0xd118('0x47')];if(!_0x4bc0b3['query'][_0xd118('0x48')](_0xd118('0x66'))){_0x2823ec[_0xd118('0x2e')]=qs[_0xd118('0x2e')](_0x4bc0b3['query'][_0xd118('0x2e')]);_0x2823ec[_0xd118('0x2d')]=qs[_0xd118('0x2d')](_0x4bc0b3[_0xd118('0x42')][_0xd118('0x2d')]);}return _0x59c782[_0xd118('0xa0')](_0x2823ec);}})[_0xd118('0x20')](function(_0x118c2){if(_0x118c2){return _0x118c2?{'count':_0x436741,'rows':_0x118c2}:null;}})[_0xd118('0x20')](respondWithResult(_0x56ee86,null))[_0xd118('0x29')](handleError(_0x56ee86,null));};exports[_0xd118('0xa1')]=function(_0xead52a,_0x2e3fd2,_0x40e4db){var _0x10c410={'raw':![],'where':{}};var _0x3df05b={};var _0x2ad497={'count':0x0,'rows':[]};return db[_0xd118('0x4f')][_0xd118('0x65')]({'where':{'id':_0xead52a[_0xd118('0x53')]['id']}})[_0xd118('0x20')](handleEntityNotFound(_0x2e3fd2,null))[_0xd118('0x20')](function(_0x8be2c8){if(_0x8be2c8){_0x3df05b[_0xd118('0x41')]=_['keys'](db[_0xd118('0x85')][_0xd118('0x6c')]);_0x3df05b[_0xd118('0x42')]=_[_0xd118('0x54')](_0xead52a['query']);_0x3df05b[_0xd118('0x43')]=_[_0xd118('0x45')](_0x3df05b['model'],_0x3df05b['query']);_0x10c410[_0xd118('0x44')]=_['intersection'](_0x3df05b[_0xd118('0x41')],qs[_0xd118('0x46')](_0xead52a['query']['fields']));_0x10c410[_0xd118('0x44')]=_0x10c410['attributes'][_0xd118('0x47')]?_0x10c410[_0xd118('0x44')]:_0x3df05b[_0xd118('0x41')];if(!_0xead52a[_0xd118('0x42')][_0xd118('0x48')](_0xd118('0x66'))){_0x10c410[_0xd118('0x2e')]=qs[_0xd118('0x2e')](_0xead52a[_0xd118('0x42')]['limit']);_0x10c410[_0xd118('0x2d')]=qs[_0xd118('0x2d')](_0xead52a[_0xd118('0x42')]['offset']);}_0x10c410[_0xd118('0x49')]=qs[_0xd118('0x4a')](_0xead52a[_0xd118('0x42')]['sort']);_0x10c410[_0xd118('0x67')]=qs['filters'](_[_0xd118('0x4b')](_0xead52a[_0xd118('0x42')],_0x3df05b[_0xd118('0x43')]));_0x10c410[_0xd118('0x67')][_0xd118('0x68')]=_0x8be2c8['id'];if(_0xead52a[_0xd118('0x42')]['filter']){_0x10c410[_0xd118('0x67')]=_[_0xd118('0x56')](_0x10c410[_0xd118('0x67')],{'$or':_[_0xd118('0x3e')](_0x10c410[_0xd118('0x44')],function(_0x5d23f8){var _0x202f95={};_0x202f95[_0x5d23f8]={'$like':'%'+_0xead52a[_0xd118('0x42')][_0xd118('0x4c')]+'%'};return _0x202f95;})});}_0x10c410=_[_0xd118('0x56')]({},_0x10c410,_0xead52a[_0xd118('0x6d')]);return db['OpenchannelInteraction']['count']({'where':_0x10c410['where']})[_0xd118('0x20')](function(_0x27d03b){_0x2ad497[_0xd118('0x2c')]=_0x27d03b;if(_0xead52a[_0xd118('0x42')][_0xd118('0x55')]){_0x10c410[_0xd118('0x4e')]=[{'model':db[_0xd118('0xa2')],'as':'Contact','required':![]},{'model':db[_0xd118('0x93')],'as':_0xd118('0xa3'),'attributes':[_0xd118('0x39'),_0xd118('0xa4'),_0xd118('0xa5')],'required':![]},{'model':db[_0xd118('0xa6')],'as':_0xd118('0xa7'),'attributes':['id',_0xd118('0x39'),_0xd118('0xa8')],'where':_0xead52a[_0xd118('0x42')][_0xd118('0xa9')]?{'id':_0xead52a[_0xd118('0x42')]['tag']}:undefined,'required':_0xead52a[_0xd118('0x42')][_0xd118('0xa9')]?!![]:![]}];}return db[_0xd118('0x85')][_0xd118('0x50')](_0x10c410);})['then'](function(_0x1d167f){_0x2ad497['rows']=_0x1d167f;return _0x2ad497;});}})[_0xd118('0x20')](respondWithFilteredResult(_0x2e3fd2,_0x10c410))['catch'](handleError(_0x2e3fd2,null));};exports[_0xd118('0xaa')]=function(_0x378324,_0x5b4af2,_0x137205){return db[_0xd118('0x4f')][_0xd118('0x57')]({'where':{'id':_0x378324[_0xd118('0x53')]['id']}})['then'](handleEntityNotFound(_0x5b4af2,null))[_0xd118('0x20')](function(_0x525ea0){if(_0x525ea0){return _0x525ea0['addAgents'](_0x378324[_0xd118('0x5f')][_0xd118('0x6a')],_[_0xd118('0xab')](_0x378324[_0xd118('0x5f')],[_0xd118('0x6a'),'id'])||{})['spread'](function(_0x2304b1){for(var _0x22de6c=0x0;_0x22de6c<_0x378324['body'][_0xd118('0x6a')][_0xd118('0x47')];_0x22de6c+=0x1){socket[_0xd118('0xac')](_0xd118('0xad'),{'UserId':_0x378324[_0xd118('0x5f')][_0xd118('0x6a')][_0x22de6c],'OpenchannelAccountId':_0x378324['params']['id']});}return _0x2304b1;});}})[_0xd118('0x20')](respondWithResult(_0x5b4af2,null))[_0xd118('0x29')](handleError(_0x5b4af2,null));};exports[_0xd118('0xae')]=function(_0x35032b,_0x5803d9,_0x331e5d){return db[_0xd118('0x4f')][_0xd118('0x57')]({'where':{'id':_0x35032b[_0xd118('0x53')]['id']}})['then'](handleEntityNotFound(_0x5803d9,null))[_0xd118('0x20')](function(_0x30a5db){if(_0x30a5db){return _0x30a5db[_0xd118('0xae')](_0x35032b[_0xd118('0x42')][_0xd118('0x6a')])[_0xd118('0x20')](function(){if(_[_0xd118('0xaf')](_0x35032b[_0xd118('0x42')][_0xd118('0x6a')])){for(var _0x4d60f1=0x0;_0x4d60f1<_0x35032b[_0xd118('0x42')][_0xd118('0x6a')][_0xd118('0x47')];_0x4d60f1+=0x1){socket[_0xd118('0xac')](_0xd118('0xb0'),{'UserId':Number(_0x35032b[_0xd118('0x42')][_0xd118('0x6a')][_0x4d60f1]),'OpenchannelAccountId':Number(_0x35032b[_0xd118('0x53')]['id'])});}}else{socket[_0xd118('0xac')](_0xd118('0xb0'),{'UserId':Number(_0x35032b[_0xd118('0x42')]['ids']),'OpenchannelAccountId':Number(_0x35032b[_0xd118('0x53')]['id'])});}});}})[_0xd118('0x20')](respondWithStatusCode(_0x5803d9,null))['catch'](handleError(_0x5803d9,null));};exports['getAgents']=function(_0x2c540,_0x1dcfc1,_0x5cfc4d){var _0x428ac1={};var _0x50a32f={};var _0x1f85ba;var _0x24be3a;return db['OpenchannelAccount'][_0xd118('0x65')]({'where':{'id':_0x2c540[_0xd118('0x53')]['id']}})['then'](handleEntityNotFound(_0x1dcfc1,null))['then'](function(_0xc80558){if(_0xc80558){_0x1f85ba=_0xc80558;_0x50a32f[_0xd118('0x41')]=_[_0xd118('0x54')](db[_0xd118('0x93')][_0xd118('0x6c')]);_0x50a32f['query']=_[_0xd118('0x54')](_0x2c540[_0xd118('0x42')]);_0x50a32f[_0xd118('0x43')]=_['intersection'](_0x50a32f[_0xd118('0x41')],_0x50a32f[_0xd118('0x42')]);_0x428ac1['attributes']=_['intersection'](_0x50a32f[_0xd118('0x41')],qs['fields'](_0x2c540[_0xd118('0x42')]['fields']));_0x428ac1[_0xd118('0x44')]=_0x428ac1[_0xd118('0x44')][_0xd118('0x47')]?_0x428ac1['attributes']:_0x50a32f['model'];_0x428ac1[_0xd118('0x49')]=qs['sort'](_0x2c540[_0xd118('0x42')][_0xd118('0x4a')]);_0x428ac1['where']=qs[_0xd118('0x43')](_[_0xd118('0x4b')](_0x2c540[_0xd118('0x42')],_0x50a32f[_0xd118('0x43')]));if(_0x2c540['query'][_0xd118('0x4c')]){_0x428ac1['where']=_[_0xd118('0x56')](_0x428ac1[_0xd118('0x67')],{'$or':_[_0xd118('0x3e')](_0x428ac1['attributes'],function(_0x284aea){var _0x121a89={};_0x121a89[_0x284aea]={'$like':'%'+_0x2c540[_0xd118('0x42')][_0xd118('0x4c')]+'%'};return _0x121a89;})});}_0x428ac1=_['merge']({},_0x428ac1,_0x2c540[_0xd118('0x6d')]);return _0x1f85ba[_0xd118('0xb1')](_0x428ac1);}})[_0xd118('0x20')](function(_0x2ac6e8){if(_0x2ac6e8){_0x24be3a=_0x2ac6e8['length'];if(!_0x2c540[_0xd118('0x42')][_0xd118('0x48')](_0xd118('0x66'))){_0x428ac1[_0xd118('0x2e')]=qs['limit'](_0x2c540[_0xd118('0x42')]['limit']);_0x428ac1[_0xd118('0x2d')]=qs[_0xd118('0x2d')](_0x2c540[_0xd118('0x42')][_0xd118('0x2d')]);}return _0x1f85ba[_0xd118('0xb1')](_0x428ac1);}})['then'](function(_0x3b02e6){if(_0x3b02e6){return _0x3b02e6?{'count':_0x24be3a,'rows':_0x3b02e6}:null;}})[_0xd118('0x20')](respondWithResult(_0x1dcfc1,null))['catch'](handleError(_0x1dcfc1,null));};exports[_0xd118('0x3a')]=function(_0x30155b,_0x10ce1a,_0x16e619){var _0x2e236d,_0x3f8c27,_0x2c55d6;if(_['isNil'](_0x30155b[_0xd118('0x5f')]['body'])||_0x30155b[_0xd118('0x5f')]['body']===''){throw new db[(_0xd118('0x70'))]['ValidationError'](_0xd118('0x78'));}if(_['isNil'](_0x30155b[_0xd118('0x5f')]['to'])){}_0x2e236d=_0x30155b[_0xd118('0x5f')]['to'];return db['OpenchannelAccount']['findOne']({'where':{'id':_0x30155b[_0xd118('0x53')]['id']}})['then'](handleEntityNotFound(_0x10ce1a,null))[_0xd118('0x20')](function(_0x48ed8c){if(_0x48ed8c){return db[_0xd118('0x4f')][_0xd118('0x57')]({'where':{'id':_0x48ed8c['id']},'include':[{'model':db[_0xd118('0xb2')],'as':_0xd118('0x7d'),'include':[{'model':db[_0xd118('0xa2')],'as':'Contacts','where':{[_0x48ed8c[_0xd118('0x79')]]:_0x2e236d},'limit':0x1,'order':[['updatedAt',_0xd118('0x7b')]]}]}]})[_0xd118('0x20')](handleEntityNotFound(_0x10ce1a,null))[_0xd118('0x20')](function(_0x7a2c33){if(_0x7a2c33&&_0x7a2c33[_0xd118('0x7d')]){_0x3f8c27=_0x7a2c33['get']({'plain':!![]});if(_0x3f8c27[_0xd118('0x7d')]&&_0x3f8c27[_0xd118('0x7d')]['Contacts']['length']){return _0x3f8c27[_0xd118('0x7d')][_0xd118('0xb3')][0x0];}return db[_0xd118('0xa2')]['create'](_['defaults'](_0x30155b[_0xd118('0x5f')],{'firstName':_0x2e236d,[_0x7a2c33[_0xd118('0x79')]]:_0x2e236d,'phone':_0x2e236d,'ListId':_0x3f8c27[_0xd118('0x75')]}));}})[_0xd118('0x20')](handleEntityNotFound(_0x10ce1a,null))['then'](function(_0x41716e){if(_0x41716e){_0x2c55d6=_0x41716e;return db[_0xd118('0x85')]['find']({'where':{'ContactId':_0x2c55d6['id'],'closed':![],'OpenchannelAccountId':_0x3f8c27['id']}})[_0xd118('0x20')](function(_0x27f8ac){if(_0x27f8ac){return[_0x27f8ac,![]];}return db['OpenchannelInteraction'][_0xd118('0x58')]({'UserId':_0x30155b[_0xd118('0x5b')]['id'],'ContactId':_0x2c55d6['id'],'OpenchannelAccountId':_0x3f8c27['id'],'lastMsgDirection':_0xd118('0xb4'),'Messages':[_[_0xd118('0x56')](_0x30155b[_0xd118('0x5f')],{'read':![],'body':_0x30155b[_0xd118('0x5f')]['body'],'OpenchannelAccountId':_0x3f8c27['id'],'UserId':_0x30155b[_0xd118('0x5b')]['id'],'ContactId':_0x2c55d6['id']})]},{'include':[{'model':db[_0xd118('0xb5')],'as':_0xd118('0xb6')}]})[_0xd118('0x20')](function(_0x1d2a7f){return[_0x1d2a7f,!![]];});});}})[_0xd118('0x87')](function(_0x5d618d,_0xdab4fa){if(_0xdab4fa){return _0x5d618d;}return db[_0xd118('0xb5')][_0xd118('0x58')](_['merge'](_0x30155b['body'],{'read':![],'body':_0x30155b[_0xd118('0x5f')][_0xd118('0x5f')],'OpenchannelAccountId':_0x3f8c27['id'],'OpenchannelInteractionId':_0x5d618d['id'],'UserId':_0x30155b[_0xd118('0x5b')]['id'],'ContactId':_0x2c55d6['id']}))[_0xd118('0x20')](function(_0x330c21){_0x5d618d[_0xd118('0xb7')][_0xd118('0xb6')]=[];_0x5d618d[_0xd118('0xb7')][_0xd118('0xb6')][_0xd118('0x8d')](_0x330c21[_0xd118('0xb7')]);return _0x5d618d;});});}})[_0xd118('0x20')](respondWithResult(_0x10ce1a,null))[_0xd118('0x29')](handleError(_0x10ce1a,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 20c9039..22a014b 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 _0xf945=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','OpenchannelAccount'];(function(_0x4c1fe8,_0xbd30e8){var _0x53f50e=function(_0xf697a8){while(--_0xf697a8){_0x4c1fe8['push'](_0x4c1fe8['shift']());}};_0x53f50e(++_0xbd30e8);}(_0xf945,0x18d));var _0x5f94=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xf945[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require(_0x5f94('0x0'));var OpenchannelAccount=require(_0x5f94('0x1'))['db'][_0x5f94('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x5f94('0x3')](0x0);var events={'afterCreate':_0x5f94('0x4'),'afterUpdate':_0x5f94('0x5'),'afterDestroy':_0x5f94('0x6')};function emitEvent(_0x37b3d1){return function(_0x3705c6,_0x3b1db8,_0x307234){OpenchannelAccountEvents[_0x5f94('0x7')](_0x37b3d1+':'+_0x3705c6['id'],_0x3705c6);OpenchannelAccountEvents['emit'](_0x37b3d1,_0x3705c6);_0x307234(null);};}for(var e in events){if(events[_0x5f94('0x8')](e)){var event=events[e];OpenchannelAccount[_0x5f94('0x9')](e,emitEvent(event));}}module['exports']=OpenchannelAccountEvents; \ No newline at end of file +var _0xd3b3=['hook','exports','../../mysqldb','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x500e71,_0x40496e){var _0x32900a=function(_0x2d5e49){while(--_0x2d5e49){_0x500e71['push'](_0x500e71['shift']());}};_0x32900a(++_0x40496e);}(_0xd3b3,0x1d0));var _0x3d3b=function(_0x48051b,_0x339115){_0x48051b=_0x48051b-0x0;var _0x2a4f6e=_0xd3b3[_0x48051b];return _0x2a4f6e;};'use strict';var EventEmitter=require('events');var OpenchannelAccount=require(_0x3d3b('0x0'))['db']['OpenchannelAccount'];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x3d3b('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x3d3b('0x2')};function emitEvent(_0x1c4144){return function(_0x377724,_0x36ac75,_0x45767f){OpenchannelAccountEvents[_0x3d3b('0x3')](_0x1c4144+':'+_0x377724['id'],_0x377724);OpenchannelAccountEvents[_0x3d3b('0x3')](_0x1c4144,_0x377724);_0x45767f(null);};}for(var e in events){if(events[_0x3d3b('0x4')](e)){var event=events[e];OpenchannelAccount[_0x3d3b('0x5')](e,emitEvent(event));}}module[_0x3d3b('0x6')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 8c5c7e3..fff5b4b 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 _0x6f8d=['api','moment','bluebird','request-promise','path','rimraf','exports','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger'];(function(_0x9c1e55,_0x460bc5){var _0x1ffafa=function(_0x3f3221){while(--_0x3f3221){_0x9c1e55['push'](_0x9c1e55['shift']());}};_0x1ffafa(++_0x460bc5);}(_0x6f8d,0x11d));var _0xd6f8=function(_0x52121d,_0x1d1704){_0x52121d=_0x52121d-0x0;var _0x448627=_0x6f8d[_0x52121d];return _0x448627;};'use strict';var _=require(_0xd6f8('0x0'));var util=require(_0xd6f8('0x1'));var logger=require(_0xd6f8('0x2'))(_0xd6f8('0x3'));var moment=require(_0xd6f8('0x4'));var BPromise=require(_0xd6f8('0x5'));var rp=require(_0xd6f8('0x6'));var fs=require('fs');var path=require(_0xd6f8('0x7'));var rimraf=require(_0xd6f8('0x8'));var config=require('../../config/environment');var attributes=require('./openchannelAccount.attributes');module[_0xd6f8('0x9')]=function(_0x136203,_0xef63ad){return _0x136203['define'](_0xd6f8('0xa'),attributes,{'tableName':_0xd6f8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf2f6=['../../config/logger','request-promise','../../config/environment','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0x31cb02,_0x3cf67e){var _0x468ea9=function(_0x27c5ae){while(--_0x27c5ae){_0x31cb02['push'](_0x31cb02['shift']());}};_0x468ea9(++_0x3cf67e);}(_0xf2f6,0x139));var _0x6f2f=function(_0x1ec94a,_0x514d90){_0x1ec94a=_0x1ec94a-0x0;var _0x1ebc99=_0xf2f6[_0x1ec94a];return _0x1ebc99;};'use strict';var _=require(_0x6f2f('0x0'));var util=require(_0x6f2f('0x1'));var logger=require(_0x6f2f('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6f2f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x6f2f('0x4'));var attributes=require('./openchannelAccount.attributes');module['exports']=function(_0x43a781,_0x1382b6){return _0x43a781['define'](_0x6f2f('0x5'),attributes,{'tableName':_0x6f2f('0x6'),'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 afb92a2..de0ecc2 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 _0xee37=['request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','localhost','socket.io-emitter'];(function(_0x19292a,_0x2063db){var _0x43b537=function(_0x370369){while(--_0x370369){_0x19292a['push'](_0x19292a['shift']());}};_0x43b537(++_0x2063db);}(_0xee37,0xb4));var _0x7ee3=function(_0xf91841,_0x182ae3){_0xf91841=_0xf91841-0x0;var _0x4b9c44=_0xee37[_0xf91841];return _0x4b9c44;};'use strict';var _=require('lodash');var util=require(_0x7ee3('0x0'));var moment=require(_0x7ee3('0x1'));var BPromise=require(_0x7ee3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ee3('0x3'));var db=require(_0x7ee3('0x4'))['db'];var utils=require(_0x7ee3('0x5'));var logger=require('../../config/logger')(_0x7ee3('0x6'));var config=require('../../config/environment');var jayson=require(_0x7ee3('0x7'));var client=jayson['client'][_0x7ee3('0x8')]({'port':0x232a});config[_0x7ee3('0x9')]=_['defaults'](config[_0x7ee3('0x9')],{'host':_0x7ee3('0xa'),'port':0x18eb});var socket=require(_0x7ee3('0xb'))(new Redis(config[_0x7ee3('0x9')]));require('./openchannelAccount.socket')['register'](socket);function respondWithRpcPromise(_0x3bb399,_0x3717aa,_0x4df26e){return new BPromise(function(_0x429707,_0x2a3fd8){return client[_0x7ee3('0xc')](_0x3bb399,_0x4df26e)[_0x7ee3('0xd')](function(_0xf53fc0){logger[_0x7ee3('0xe')](_0x7ee3('0xf'),_0x3717aa,_0x7ee3('0x10'));logger[_0x7ee3('0x11')](_0x7ee3('0x12'),_0x3717aa,_0x7ee3('0x10'),JSON[_0x7ee3('0x13')](_0xf53fc0));if(_0xf53fc0[_0x7ee3('0x14')]){if(_0xf53fc0[_0x7ee3('0x14')][_0x7ee3('0x15')]===0x1f4){logger[_0x7ee3('0x14')](_0x7ee3('0xf'),_0x3717aa,_0xf53fc0[_0x7ee3('0x14')][_0x7ee3('0x16')]);return _0x2a3fd8(_0xf53fc0['error'][_0x7ee3('0x16')]);}logger[_0x7ee3('0x14')](_0x7ee3('0xf'),_0x3717aa,_0xf53fc0[_0x7ee3('0x14')][_0x7ee3('0x16')]);return _0x429707(_0xf53fc0['error'][_0x7ee3('0x16')]);}else{logger[_0x7ee3('0xe')](_0x7ee3('0xf'),_0x3717aa,_0x7ee3('0x10'));_0x429707(_0xf53fc0['result']['message']);}})[_0x7ee3('0x17')](function(_0xb08ad1){logger[_0x7ee3('0x14')](_0x7ee3('0xf'),_0x3717aa,_0xb08ad1);_0x2a3fd8(_0xb08ad1);});});} \ No newline at end of file +var _0x1b8f=['util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','./openchannelAccount.socket','register','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','lodash'];(function(_0x2b7656,_0x416b0f){var _0x3448c2=function(_0x272e45){while(--_0x272e45){_0x2b7656['push'](_0x2b7656['shift']());}};_0x3448c2(++_0x416b0f);}(_0x1b8f,0x151));var _0xf1b8=function(_0x2e4044,_0x52e11b){_0x2e4044=_0x2e4044-0x0;var _0x3babc2=_0x1b8f[_0x2e4044];return _0x3babc2;};'use strict';var _=require(_0xf1b8('0x0'));var util=require(_0xf1b8('0x1'));var moment=require('moment');var BPromise=require(_0xf1b8('0x2'));var rs=require(_0xf1b8('0x3'));var fs=require('fs');var Redis=require(_0xf1b8('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf1b8('0x5'));var logger=require(_0xf1b8('0x6'))(_0xf1b8('0x7'));var config=require(_0xf1b8('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xf1b8('0x9')]['http']({'port':0x232a});config[_0xf1b8('0xa')]=_[_0xf1b8('0xb')](config[_0xf1b8('0xa')],{'host':_0xf1b8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xf1b8('0xa')]));require(_0xf1b8('0xd'))[_0xf1b8('0xe')](socket);function respondWithRpcPromise(_0xc9fe46,_0x21c73c,_0x21e772){return new BPromise(function(_0x18d2cb,_0x16337e){return client['request'](_0xc9fe46,_0x21e772)[_0xf1b8('0xf')](function(_0x41886c){logger['info'](_0xf1b8('0x10'),_0x21c73c,_0xf1b8('0x11'));logger[_0xf1b8('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x21c73c,_0xf1b8('0x11'),JSON[_0xf1b8('0x13')](_0x41886c));if(_0x41886c['error']){if(_0x41886c[_0xf1b8('0x14')][_0xf1b8('0x15')]===0x1f4){logger['error'](_0xf1b8('0x10'),_0x21c73c,_0x41886c['error'][_0xf1b8('0x16')]);return _0x16337e(_0x41886c[_0xf1b8('0x14')][_0xf1b8('0x16')]);}logger[_0xf1b8('0x14')](_0xf1b8('0x10'),_0x21c73c,_0x41886c[_0xf1b8('0x14')]['message']);return _0x18d2cb(_0x41886c['error'][_0xf1b8('0x16')]);}else{logger[_0xf1b8('0x17')](_0xf1b8('0x10'),_0x21c73c,_0xf1b8('0x11'));_0x18d2cb(_0x41886c[_0xf1b8('0x18')][_0xf1b8('0x16')]);}})[_0xf1b8('0x19')](function(_0x3ae1cd){logger[_0xf1b8('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x21c73c,_0x3ae1cd);_0x16337e(_0x3ae1cd);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index a2f1a9b..858b4c9 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 _0x35c9=['register','length','./openchannelAccount.events','save','remove','update','emit','removeListener'];(function(_0x1743b0,_0x2fc750){var _0x613b13=function(_0x3d37ec){while(--_0x3d37ec){_0x1743b0['push'](_0x1743b0['shift']());}};_0x613b13(++_0x2fc750);}(_0x35c9,0x18a));var _0x935c=function(_0xa840fe,_0x20c87b){_0xa840fe=_0xa840fe-0x0;var _0x2a8cab=_0x35c9[_0xa840fe];return _0x2a8cab;};'use strict';var OpenchannelAccountEvents=require(_0x935c('0x0'));var events=[_0x935c('0x1'),_0x935c('0x2'),_0x935c('0x3')];function createListener(_0x1390ed,_0x2d9740){return function(_0x4181d6){_0x2d9740[_0x935c('0x4')](_0x1390ed,_0x4181d6);};}function removeListener(_0x194a07,_0x38e246){return function(){OpenchannelAccountEvents[_0x935c('0x5')](_0x194a07,_0x38e246);};}exports[_0x935c('0x6')]=function(_0x3dfbd4){for(var _0x39909b=0x0,_0x5c9d24=events[_0x935c('0x7')];_0x39909b<_0x5c9d24;_0x39909b++){var _0x48f724=events[_0x39909b];var _0x4d17ec=createListener('openchannelAccount:'+_0x48f724,_0x3dfbd4);OpenchannelAccountEvents['on'](_0x48f724,_0x4d17ec);}}; \ No newline at end of file +var _0x8b10=['save','remove','emit','removeListener','register','length'];(function(_0x4c3c9b,_0x33d0de){var _0x405b03=function(_0x1af9f1){while(--_0x1af9f1){_0x4c3c9b['push'](_0x4c3c9b['shift']());}};_0x405b03(++_0x33d0de);}(_0x8b10,0x156));var _0x08b1=function(_0x369d10,_0x1d2384){_0x369d10=_0x369d10-0x0;var _0x63efa5=_0x8b10[_0x369d10];return _0x63efa5;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x08b1('0x0'),_0x08b1('0x1'),'update'];function createListener(_0x25d195,_0x283bf0){return function(_0x1f7d07){_0x283bf0[_0x08b1('0x2')](_0x25d195,_0x1f7d07);};}function removeListener(_0xb63d74,_0x42c736){return function(){OpenchannelAccountEvents[_0x08b1('0x3')](_0xb63d74,_0x42c736);};}exports[_0x08b1('0x4')]=function(_0x204958){for(var _0xefba51=0x0,_0x413984=events[_0x08b1('0x5')];_0xefba51<_0x413984;_0xefba51++){var _0xd00777=events[_0xefba51];var _0x492cf6=createListener('openchannelAccount:'+_0xd00777,_0x204958);OpenchannelAccountEvents['on'](_0xd00777,_0x492cf6);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index c6f89af..23ba2be 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 _0xba44=['util','path','Router','../../components/auth/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3b16f2,_0x15080d){var _0x528a84=function(_0x49644e){while(--_0x49644e){_0x3b16f2['push'](_0x3b16f2['shift']());}};_0x528a84(++_0x15080d);}(_0xba44,0x6b));var _0x4ba4=function(_0x2e7f4c,_0x2f6192){_0x2e7f4c=_0x2e7f4c-0x0;var _0xaa2e07=_0xba44[_0x2e7f4c];return _0xaa2e07;};'use strict';var multer=require(_0x4ba4('0x0'));var util=require(_0x4ba4('0x1'));var path=require(_0x4ba4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x4ba4('0x3')]();var auth=require(_0x4ba4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4ba4('0x5'));var controller=require(_0x4ba4('0x6'));router[_0x4ba4('0x7')]('/',auth[_0x4ba4('0x8')](),controller[_0x4ba4('0x9')]);router[_0x4ba4('0x7')](_0x4ba4('0xa'),auth[_0x4ba4('0x8')](),controller['show']);router[_0x4ba4('0xb')]('/',auth[_0x4ba4('0x8')](),controller[_0x4ba4('0xc')]);router[_0x4ba4('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x4ba4('0xe')]);router[_0x4ba4('0xf')](_0x4ba4('0xa'),auth[_0x4ba4('0x8')](),controller[_0x4ba4('0x10')]);module[_0x4ba4('0x11')]=router; \ No newline at end of file +var _0x48ed=['Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','isAuthenticated','index','get','/:id','show','create','put','update','exports','multer','path','connect-timeout'];(function(_0x3246dc,_0x4eafbc){var _0x5d666c=function(_0x371b34){while(--_0x371b34){_0x3246dc['push'](_0x3246dc['shift']());}};_0x5d666c(++_0x4eafbc);}(_0x48ed,0x8d));var _0xd48e=function(_0x3a6772,_0x6c05d0){_0x3a6772=_0x3a6772-0x0;var _0x21a255=_0x48ed[_0x3a6772];return _0x21a255;};'use strict';var multer=require(_0xd48e('0x0'));var util=require('util');var path=require(_0xd48e('0x1'));var timeout=require(_0xd48e('0x2'));var express=require('express');var router=express[_0xd48e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd48e('0x4'));var config=require(_0xd48e('0x5'));var controller=require(_0xd48e('0x6'));router['get']('/',auth[_0xd48e('0x7')](),controller[_0xd48e('0x8')]);router[_0xd48e('0x9')](_0xd48e('0xa'),auth['isAuthenticated'](),controller[_0xd48e('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0xd48e('0xc')]);router[_0xd48e('0xd')]('/:id',auth[_0xd48e('0x7')](),controller[_0xd48e('0xe')]);router['delete'](_0xd48e('0xa'),auth[_0xd48e('0x7')](),controller['destroy']);module[_0xd48e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index c5a92a1..a2930d8 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 _0xb4f9=['sequelize','exports','INTEGER','STRING','noop','TEXT','*,*,*,*'];(function(_0x4b22bd,_0x28d37a){var _0x56951e=function(_0x875cf1){while(--_0x875cf1){_0x4b22bd['push'](_0x4b22bd['shift']());}};_0x56951e(++_0x28d37a);}(_0xb4f9,0x77));var _0x9b4f=function(_0x268ad0,_0x50c35b){_0x268ad0=_0x268ad0-0x0;var _0x4619ea=_0xb4f9[_0x268ad0];return _0x4619ea;};'use strict';var Sequelize=require(_0x9b4f('0x0'));module[_0x9b4f('0x1')]={'priority':{'type':Sequelize[_0x9b4f('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x9b4f('0x3')],'allowNull':![],'defaultValue':_0x9b4f('0x4')},'appdata':{'type':Sequelize[_0x9b4f('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x9b4f('0x3')],'defaultValue':_0x9b4f('0x6')}}; \ No newline at end of file +var _0x2f85=['*,*,*,*','exports','INTEGER','STRING','noop','TEXT'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2f85,0x115));var _0x52f8=function(_0x5f4de1,_0xfa9b7b){_0x5f4de1=_0x5f4de1-0x0;var _0x4d8647=_0x2f85[_0x5f4de1];return _0x4d8647;};'use strict';var Sequelize=require('sequelize');module[_0x52f8('0x0')]={'priority':{'type':Sequelize[_0x52f8('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x52f8('0x2')],'allowNull':![],'defaultValue':_0x52f8('0x3')},'appdata':{'type':Sequelize[_0x52f8('0x4')]()},'description':{'type':Sequelize[_0x52f8('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x52f8('0x5')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 68370dc..fcefcae 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 _0x995c=['html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','options','OpenchannelApplication','include','findAll','rows','show','params','rawAttributes','includeAll','find','catch','create','body'];(function(_0x5d8ea9,_0x47c651){var _0x453db6=function(_0x1b8279){while(--_0x1b8279){_0x5d8ea9['push'](_0x5d8ea9['shift']());}};_0x453db6(++_0x47c651);}(_0x995c,0x96));var _0xc995=function(_0x2d1097,_0x5bd98e){_0x2d1097=_0x2d1097-0x0;var _0x36cff1=_0x995c[_0x2d1097];return _0x36cff1;};'use strict';var pdf=require(_0xc995('0x0'));var emlformat=require(_0xc995('0x1'));var rimraf=require(_0xc995('0x2'));var zipdir=require(_0xc995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc995('0x4'));var moment=require(_0xc995('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xc995('0x6'));var util=require(_0xc995('0x7'));var path=require(_0xc995('0x8'));var sox=require(_0xc995('0x9'));var csv=require(_0xc995('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc995('0xb'));var squel=require(_0xc995('0xc'));var crypto=require(_0xc995('0xd'));var jsforce=require(_0xc995('0xe'));var deskjs=require(_0xc995('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc995('0x10'));var Papa=require(_0xc995('0x11'));var Redis=require(_0xc995('0x12'));var authService=require(_0xc995('0x13'));var qs=require(_0xc995('0x14'));var as=require(_0xc995('0x15'));var hardwareService=require(_0xc995('0x16'));var logger=require(_0xc995('0x17'))(_0xc995('0x18'));var utils=require('../../config/utils');var config=require(_0xc995('0x19'));var db=require(_0xc995('0x1a'))['db'];function respondWithStatusCode(_0x771d71,_0x21ef1b){_0x21ef1b=_0x21ef1b||0xcc;return function(_0xc9632a){if(_0xc9632a){return _0x771d71[_0xc995('0x1b')](_0x21ef1b);}return _0x771d71['status'](_0x21ef1b)[_0xc995('0x1c')]();};}function respondWithResult(_0x4c3e8f,_0x48e912){_0x48e912=_0x48e912||0xc8;return function(_0x1b8d50){if(_0x1b8d50){return _0x4c3e8f[_0xc995('0x1d')](_0x48e912)[_0xc995('0x1e')](_0x1b8d50);}};}function respondWithFilteredResult(_0xb6b842,_0x4a36b8){return function(_0x3471e2){if(_0x3471e2){var _0xe563db=_0x3471e2[_0xc995('0x1f')],_0x2047f8=_0x4a36b8[_0xc995('0x20')],_0x37e2ce=_0x4a36b8[_0xc995('0x20')]+_0x4a36b8[_0xc995('0x21')],_0x5b21c0;if(_0x37e2ce>=_0xe563db){_0x37e2ce=_0xe563db;_0x5b21c0=0xc8;}else{_0x5b21c0=0xce;}_0xb6b842['status'](_0x5b21c0);return _0xb6b842['set'](_0xc995('0x22'),_0x2047f8+'-'+_0x37e2ce+'/'+_0xe563db)[_0xc995('0x1e')](_0x3471e2);}return null;};}function patchUpdates(_0x2fe68f){return function(_0x562401){try{jsonpatch['apply'](_0x562401,_0x2fe68f,!![]);}catch(_0x27bd00){return BPromise[_0xc995('0x23')](_0x27bd00);}return _0x562401[_0xc995('0x24')]();};}function saveUpdates(_0x3b4b4f,_0x1d946b){return function(_0x275252){if(_0x275252){return _0x275252[_0xc995('0x25')](_0x3b4b4f)[_0xc995('0x26')](function(_0x8e4617){return _0x8e4617;});}return null;};}function removeEntity(_0x3fd31b,_0x5946e4){return function(_0x15a24c){if(_0x15a24c){return _0x15a24c[_0xc995('0x27')]()[_0xc995('0x26')](function(){_0x3fd31b[_0xc995('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4eea7a,_0x5616f4){return function(_0x2724d4){if(!_0x2724d4){_0x4eea7a[_0xc995('0x1b')](0x194);}return _0x2724d4;};}function handleError(_0x5c8b3c,_0xacbc5b){_0xacbc5b=_0xacbc5b||0x1f4;return function(_0x4ac67e){logger[_0xc995('0x28')](_0x4ac67e[_0xc995('0x29')]);if(_0x4ac67e['name']){delete _0x4ac67e[_0xc995('0x2a')];}_0x5c8b3c[_0xc995('0x1d')](_0xacbc5b)[_0xc995('0x2b')](_0x4ac67e);};}exports['index']=function(_0x4a0ef6,_0x40d304){var _0x1c4aef={},_0x5b37c5={},_0x9fb5de={'count':0x0,'rows':[]};var _0x4b3a52=_['map'](db['OpenchannelApplication']['rawAttributes'],function(_0x6c0fb4){return{'name':_0x6c0fb4[_0xc995('0x2c')],'type':_0x6c0fb4[_0xc995('0x2d')]['key']};});_0x5b37c5[_0xc995('0x2e')]=_[_0xc995('0x2f')](_0x4b3a52,_0xc995('0x2a'));_0x5b37c5[_0xc995('0x30')]=_[_0xc995('0x31')](_0x4a0ef6[_0xc995('0x30')]);_0x5b37c5[_0xc995('0x32')]=_[_0xc995('0x33')](_0x5b37c5[_0xc995('0x2e')],_0x5b37c5['query']);_0x1c4aef[_0xc995('0x34')]=_[_0xc995('0x33')](_0x5b37c5[_0xc995('0x2e')],qs['fields'](_0x4a0ef6[_0xc995('0x30')][_0xc995('0x35')]));_0x1c4aef['attributes']=_0x1c4aef[_0xc995('0x34')][_0xc995('0x36')]?_0x1c4aef['attributes']:_0x5b37c5[_0xc995('0x2e')];if(!_0x4a0ef6[_0xc995('0x30')]['hasOwnProperty'](_0xc995('0x37'))){_0x1c4aef[_0xc995('0x21')]=qs[_0xc995('0x21')](_0x4a0ef6[_0xc995('0x30')][_0xc995('0x21')]);_0x1c4aef[_0xc995('0x20')]=qs['offset'](_0x4a0ef6['query'][_0xc995('0x20')]);}_0x1c4aef[_0xc995('0x38')]=qs['sort'](_0x4a0ef6[_0xc995('0x30')][_0xc995('0x39')]);_0x1c4aef['where']=qs[_0xc995('0x32')](_[_0xc995('0x3a')](_0x4a0ef6[_0xc995('0x30')],_0x5b37c5[_0xc995('0x32')]));if(_0x4a0ef6[_0xc995('0x30')][_0xc995('0x3b')]){_0x1c4aef[_0xc995('0x3c')]=_['merge'](_0x1c4aef[_0xc995('0x3c')],{'$or':_[_0xc995('0x2f')](_0x4b3a52,function(_0x54beac){if(_0x54beac[_0xc995('0x2d')]!=='VIRTUAL'){var _0x5cbcbd={};_0x5cbcbd[_0x54beac[_0xc995('0x2a')]]={'$like':'%'+_0x4a0ef6[_0xc995('0x30')]['filter']+'%'};return _0x5cbcbd;}})});}_0x1c4aef=_[_0xc995('0x3d')]({},_0x1c4aef,_0x4a0ef6[_0xc995('0x3e')]);var _0x340ab8={'where':_0x1c4aef[_0xc995('0x3c')]};return db[_0xc995('0x3f')][_0xc995('0x1f')](_0x340ab8)[_0xc995('0x26')](function(_0x199c9e){_0x9fb5de[_0xc995('0x1f')]=_0x199c9e;if(_0x4a0ef6['query']['includeAll']){_0x1c4aef[_0xc995('0x40')]=[{'all':!![]}];}return db[_0xc995('0x3f')][_0xc995('0x41')](_0x1c4aef);})[_0xc995('0x26')](function(_0x142c42){_0x9fb5de[_0xc995('0x42')]=_0x142c42;return _0x9fb5de;})[_0xc995('0x26')](respondWithFilteredResult(_0x40d304,_0x1c4aef))['catch'](handleError(_0x40d304,null));};exports[_0xc995('0x43')]=function(_0xec39cb,_0x3a4548){var _0x4df82b={'raw':!![],'where':{'id':_0xec39cb[_0xc995('0x44')]['id']}},_0x13c950={};_0x13c950[_0xc995('0x2e')]=_[_0xc995('0x31')](db[_0xc995('0x3f')][_0xc995('0x45')]);_0x13c950['query']=_[_0xc995('0x31')](_0xec39cb[_0xc995('0x30')]);_0x13c950[_0xc995('0x32')]=_[_0xc995('0x33')](_0x13c950[_0xc995('0x2e')],_0x13c950[_0xc995('0x30')]);_0x4df82b[_0xc995('0x34')]=_[_0xc995('0x33')](_0x13c950[_0xc995('0x2e')],qs[_0xc995('0x35')](_0xec39cb[_0xc995('0x30')][_0xc995('0x35')]));_0x4df82b[_0xc995('0x34')]=_0x4df82b[_0xc995('0x34')][_0xc995('0x36')]?_0x4df82b[_0xc995('0x34')]:_0x13c950['model'];if(_0xec39cb['query'][_0xc995('0x46')]){_0x4df82b[_0xc995('0x40')]=[{'all':!![]}];}_0x4df82b=_[_0xc995('0x3d')]({},_0x4df82b,_0xec39cb['options']);return db['OpenchannelApplication'][_0xc995('0x47')](_0x4df82b)[_0xc995('0x26')](handleEntityNotFound(_0x3a4548,null))[_0xc995('0x26')](respondWithResult(_0x3a4548,null))[_0xc995('0x48')](handleError(_0x3a4548,null));};exports[_0xc995('0x49')]=function(_0x169c72,_0x394d33){return db[_0xc995('0x3f')][_0xc995('0x49')](_0x169c72[_0xc995('0x4a')],{})[_0xc995('0x26')](respondWithResult(_0x394d33,0xc9))[_0xc995('0x48')](handleError(_0x394d33,null));};exports[_0xc995('0x25')]=function(_0x1017aa,_0x5cdf94){if(_0x1017aa[_0xc995('0x4a')]['id']){delete _0x1017aa[_0xc995('0x4a')]['id'];}return db[_0xc995('0x3f')]['find']({'where':{'id':_0x1017aa['params']['id']}})['then'](handleEntityNotFound(_0x5cdf94,null))[_0xc995('0x26')](saveUpdates(_0x1017aa[_0xc995('0x4a')],null))['then'](respondWithResult(_0x5cdf94,null))['catch'](handleError(_0x5cdf94,null));};exports[_0xc995('0x27')]=function(_0x3ee091,_0x13864d){return db[_0xc995('0x3f')][_0xc995('0x47')]({'where':{'id':_0x3ee091['params']['id']}})[_0xc995('0x26')](handleEntityNotFound(_0x13864d,null))['then'](removeEntity(_0x13864d,null))[_0xc995('0x48')](handleError(_0x13864d,null));}; \ No newline at end of file +var _0xee29=['../../config/environment','sendStatus','status','end','limit','set','json','reject','then','destroy','error','stack','name','send','map','OpenchannelApplication','key','model','filters','query','attributes','fields','length','hasOwnProperty','offset','sort','where','filter','merge','type','VIRTUAL','options','count','includeAll','include','findAll','show','params','keys','rawAttributes','intersection','find','catch','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xee29,0xbe));var _0x9ee2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee29[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x9ee2('0x0'));var emlformat=require(_0x9ee2('0x1'));var rimraf=require(_0x9ee2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9ee2('0x3'));var rp=require(_0x9ee2('0x4'));var moment=require(_0x9ee2('0x5'));var BPromise=require(_0x9ee2('0x6'));var Mustache=require(_0x9ee2('0x7'));var util=require(_0x9ee2('0x8'));var path=require(_0x9ee2('0x9'));var sox=require(_0x9ee2('0xa'));var csv=require('to-csv');var ejs=require(_0x9ee2('0xb'));var fs=require('fs');var _=require(_0x9ee2('0xc'));var squel=require(_0x9ee2('0xd'));var crypto=require(_0x9ee2('0xe'));var jsforce=require(_0x9ee2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9ee2('0x10'));var querystring=require(_0x9ee2('0x11'));var Papa=require(_0x9ee2('0x12'));var Redis=require('ioredis');var authService=require(_0x9ee2('0x13'));var qs=require(_0x9ee2('0x14'));var as=require(_0x9ee2('0x15'));var hardwareService=require(_0x9ee2('0x16'));var logger=require(_0x9ee2('0x17'))(_0x9ee2('0x18'));var utils=require(_0x9ee2('0x19'));var config=require(_0x9ee2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2eb23b,_0x6dbd28){_0x6dbd28=_0x6dbd28||0xcc;return function(_0x254f6a){if(_0x254f6a){return _0x2eb23b[_0x9ee2('0x1b')](_0x6dbd28);}return _0x2eb23b[_0x9ee2('0x1c')](_0x6dbd28)[_0x9ee2('0x1d')]();};}function respondWithResult(_0x1a0ddf,_0xd96a63){_0xd96a63=_0xd96a63||0xc8;return function(_0x3b1af5){if(_0x3b1af5){return _0x1a0ddf[_0x9ee2('0x1c')](_0xd96a63)['json'](_0x3b1af5);}};}function respondWithFilteredResult(_0x1e878a,_0x5c4929){return function(_0x194287){if(_0x194287){var _0x5d7806=_0x194287['count'],_0x533265=_0x5c4929['offset'],_0x5f43f6=_0x5c4929['offset']+_0x5c4929[_0x9ee2('0x1e')],_0x3bfcb5;if(_0x5f43f6>=_0x5d7806){_0x5f43f6=_0x5d7806;_0x3bfcb5=0xc8;}else{_0x3bfcb5=0xce;}_0x1e878a['status'](_0x3bfcb5);return _0x1e878a[_0x9ee2('0x1f')]('Content-Range',_0x533265+'-'+_0x5f43f6+'/'+_0x5d7806)[_0x9ee2('0x20')](_0x194287);}return null;};}function patchUpdates(_0x951960){return function(_0x2807ce){try{jsonpatch['apply'](_0x2807ce,_0x951960,!![]);}catch(_0x558c53){return BPromise[_0x9ee2('0x21')](_0x558c53);}return _0x2807ce['save']();};}function saveUpdates(_0x42a816,_0xea82bf){return function(_0x1cbf2e){if(_0x1cbf2e){return _0x1cbf2e['update'](_0x42a816)[_0x9ee2('0x22')](function(_0x3cb2b7){return _0x3cb2b7;});}return null;};}function removeEntity(_0x65045b,_0x58fd7f){return function(_0x16a031){if(_0x16a031){return _0x16a031[_0x9ee2('0x23')]()[_0x9ee2('0x22')](function(){_0x65045b['status'](0xcc)[_0x9ee2('0x1d')]();});}};}function handleEntityNotFound(_0x6c750f,_0x4683ee){return function(_0x386fd8){if(!_0x386fd8){_0x6c750f['sendStatus'](0x194);}return _0x386fd8;};}function handleError(_0x954503,_0x10e809){_0x10e809=_0x10e809||0x1f4;return function(_0x518573){logger[_0x9ee2('0x24')](_0x518573[_0x9ee2('0x25')]);if(_0x518573[_0x9ee2('0x26')]){delete _0x518573[_0x9ee2('0x26')];}_0x954503[_0x9ee2('0x1c')](_0x10e809)[_0x9ee2('0x27')](_0x518573);};}exports['index']=function(_0x17abc7,_0x38a58d){var _0x55ef3b={},_0x19f4e7={},_0x329b86={'count':0x0,'rows':[]};var _0x4fcf22=_[_0x9ee2('0x28')](db[_0x9ee2('0x29')]['rawAttributes'],function(_0x92b129){return{'name':_0x92b129['fieldName'],'type':_0x92b129['type'][_0x9ee2('0x2a')]};});_0x19f4e7[_0x9ee2('0x2b')]=_[_0x9ee2('0x28')](_0x4fcf22,_0x9ee2('0x26'));_0x19f4e7['query']=_['keys'](_0x17abc7['query']);_0x19f4e7[_0x9ee2('0x2c')]=_['intersection'](_0x19f4e7[_0x9ee2('0x2b')],_0x19f4e7[_0x9ee2('0x2d')]);_0x55ef3b[_0x9ee2('0x2e')]=_['intersection'](_0x19f4e7[_0x9ee2('0x2b')],qs[_0x9ee2('0x2f')](_0x17abc7['query'][_0x9ee2('0x2f')]));_0x55ef3b['attributes']=_0x55ef3b[_0x9ee2('0x2e')][_0x9ee2('0x30')]?_0x55ef3b[_0x9ee2('0x2e')]:_0x19f4e7[_0x9ee2('0x2b')];if(!_0x17abc7['query'][_0x9ee2('0x31')]('nolimit')){_0x55ef3b[_0x9ee2('0x1e')]=qs[_0x9ee2('0x1e')](_0x17abc7[_0x9ee2('0x2d')][_0x9ee2('0x1e')]);_0x55ef3b[_0x9ee2('0x32')]=qs[_0x9ee2('0x32')](_0x17abc7[_0x9ee2('0x2d')][_0x9ee2('0x32')]);}_0x55ef3b['order']=qs[_0x9ee2('0x33')](_0x17abc7['query'][_0x9ee2('0x33')]);_0x55ef3b[_0x9ee2('0x34')]=qs[_0x9ee2('0x2c')](_['pick'](_0x17abc7['query'],_0x19f4e7[_0x9ee2('0x2c')]));if(_0x17abc7[_0x9ee2('0x2d')][_0x9ee2('0x35')]){_0x55ef3b['where']=_[_0x9ee2('0x36')](_0x55ef3b[_0x9ee2('0x34')],{'$or':_[_0x9ee2('0x28')](_0x4fcf22,function(_0x1354b9){if(_0x1354b9[_0x9ee2('0x37')]!==_0x9ee2('0x38')){var _0x6870b7={};_0x6870b7[_0x1354b9[_0x9ee2('0x26')]]={'$like':'%'+_0x17abc7[_0x9ee2('0x2d')]['filter']+'%'};return _0x6870b7;}})});}_0x55ef3b=_[_0x9ee2('0x36')]({},_0x55ef3b,_0x17abc7[_0x9ee2('0x39')]);var _0x30931f={'where':_0x55ef3b[_0x9ee2('0x34')]};return db[_0x9ee2('0x29')][_0x9ee2('0x3a')](_0x30931f)[_0x9ee2('0x22')](function(_0x412627){_0x329b86[_0x9ee2('0x3a')]=_0x412627;if(_0x17abc7[_0x9ee2('0x2d')][_0x9ee2('0x3b')]){_0x55ef3b[_0x9ee2('0x3c')]=[{'all':!![]}];}return db[_0x9ee2('0x29')][_0x9ee2('0x3d')](_0x55ef3b);})[_0x9ee2('0x22')](function(_0x671ec9){_0x329b86['rows']=_0x671ec9;return _0x329b86;})[_0x9ee2('0x22')](respondWithFilteredResult(_0x38a58d,_0x55ef3b))['catch'](handleError(_0x38a58d,null));};exports[_0x9ee2('0x3e')]=function(_0x1751ef,_0x4e873a){var _0x18aeff={'raw':!![],'where':{'id':_0x1751ef[_0x9ee2('0x3f')]['id']}},_0x2693ea={};_0x2693ea[_0x9ee2('0x2b')]=_[_0x9ee2('0x40')](db[_0x9ee2('0x29')][_0x9ee2('0x41')]);_0x2693ea[_0x9ee2('0x2d')]=_[_0x9ee2('0x40')](_0x1751ef[_0x9ee2('0x2d')]);_0x2693ea[_0x9ee2('0x2c')]=_[_0x9ee2('0x42')](_0x2693ea[_0x9ee2('0x2b')],_0x2693ea[_0x9ee2('0x2d')]);_0x18aeff[_0x9ee2('0x2e')]=_[_0x9ee2('0x42')](_0x2693ea['model'],qs['fields'](_0x1751ef[_0x9ee2('0x2d')][_0x9ee2('0x2f')]));_0x18aeff['attributes']=_0x18aeff['attributes'][_0x9ee2('0x30')]?_0x18aeff['attributes']:_0x2693ea[_0x9ee2('0x2b')];if(_0x1751ef['query'][_0x9ee2('0x3b')]){_0x18aeff['include']=[{'all':!![]}];}_0x18aeff=_[_0x9ee2('0x36')]({},_0x18aeff,_0x1751ef[_0x9ee2('0x39')]);return db[_0x9ee2('0x29')][_0x9ee2('0x43')](_0x18aeff)['then'](handleEntityNotFound(_0x4e873a,null))[_0x9ee2('0x22')](respondWithResult(_0x4e873a,null))[_0x9ee2('0x44')](handleError(_0x4e873a,null));};exports[_0x9ee2('0x45')]=function(_0x2f6a92,_0x452150){return db[_0x9ee2('0x29')][_0x9ee2('0x45')](_0x2f6a92[_0x9ee2('0x46')],{})[_0x9ee2('0x22')](respondWithResult(_0x452150,0xc9))['catch'](handleError(_0x452150,null));};exports[_0x9ee2('0x47')]=function(_0x3a6395,_0x3ab97e){if(_0x3a6395[_0x9ee2('0x46')]['id']){delete _0x3a6395['body']['id'];}return db[_0x9ee2('0x29')][_0x9ee2('0x43')]({'where':{'id':_0x3a6395[_0x9ee2('0x3f')]['id']}})['then'](handleEntityNotFound(_0x3ab97e,null))['then'](saveUpdates(_0x3a6395[_0x9ee2('0x46')],null))[_0x9ee2('0x22')](respondWithResult(_0x3ab97e,null))[_0x9ee2('0x44')](handleError(_0x3ab97e,null));};exports[_0x9ee2('0x23')]=function(_0x36bf09,_0x193560){return db['OpenchannelApplication']['find']({'where':{'id':_0x36bf09[_0x9ee2('0x3f')]['id']}})[_0x9ee2('0x22')](handleEntityNotFound(_0x193560,null))[_0x9ee2('0x22')](removeEntity(_0x193560,null))['catch'](handleError(_0x193560,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 069140f..0822d1a 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 _0xe40e=['openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelApplication'];(function(_0x4acdd0,_0x4d1f59){var _0x392ba5=function(_0x30cab7){while(--_0x30cab7){_0x4acdd0['push'](_0x4acdd0['shift']());}};_0x392ba5(++_0x4d1f59);}(_0xe40e,0x19b));var _0xee40=function(_0x3fac88,_0xceed4f){_0x3fac88=_0x3fac88-0x0;var _0x4424fe=_0xe40e[_0x3fac88];return _0x4424fe;};'use strict';var _=require('lodash');var util=require(_0xee40('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xee40('0x1'));var rp=require(_0xee40('0x2'));var fs=require('fs');var path=require(_0xee40('0x3'));var rimraf=require(_0xee40('0x4'));var config=require(_0xee40('0x5'));var attributes=require('./openchannelApplication.attributes');module[_0xee40('0x6')]=function(_0xe89d43,_0x239449){return _0xe89d43[_0xee40('0x7')](_0xee40('0x8'),attributes,{'tableName':_0xee40('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xee40('0xa'),'collate':_0xee40('0xb')});}; \ No newline at end of file +var _0xab7e=['../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4_unicode_ci','lodash','util'];(function(_0x4f5319,_0x5d3297){var _0x2f8bd8=function(_0xed0312){while(--_0xed0312){_0x4f5319['push'](_0x4f5319['shift']());}};_0x2f8bd8(++_0x5d3297);}(_0xab7e,0xa7));var _0xeab7=function(_0xab5444,_0x349f6b){_0xab5444=_0xab5444-0x0;var _0x4c8261=_0xab7e[_0xab5444];return _0x4c8261;};'use strict';var _=require(_0xeab7('0x0'));var util=require(_0xeab7('0x1'));var logger=require(_0xeab7('0x2'))('api');var moment=require(_0xeab7('0x3'));var BPromise=require(_0xeab7('0x4'));var rp=require(_0xeab7('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeab7('0x6'));var config=require(_0xeab7('0x7'));var attributes=require(_0xeab7('0x8'));module[_0xeab7('0x9')]=function(_0x28036f,_0x5e46fb){return _0x28036f[_0xeab7('0xa')]('OpenchannelApplication',attributes,{'tableName':_0xeab7('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xeab7('0xc')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index fb1d46c..758ecbf 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 _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0xb99421,_0xaab133){var _0x4b3ec7=function(_0x591d1a){while(--_0x591d1a){_0xb99421['push'](_0xb99421['shift']());}};_0x4b3ec7(++_0xaab133);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});}; \ No newline at end of file +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(_0x7e3f06,_0x426f70){var _0x12b8ff=function(_0x47c83c){while(--_0x47c83c){_0x7e3f06['push'](_0x7e3f06['shift']());}};_0x12b8ff(++_0x426f70);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3537cb,_0x15218f){_0x3537cb=_0x3537cb-0x0;var _0x511029=_0x5f2f[_0x3537cb];return _0x511029;};'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 diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 270f08a..ae434b7 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 _0x0fb1=['isAuthenticated','index','/describe','describe','get','/:id','show','/:id/messages','getMessages','/:id/download','post','create','addMessage','tracked','put','openchannel','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelInteraction.controller'];(function(_0x119033,_0x579478){var _0x15b7a3=function(_0x3fd98b){while(--_0x3fd98b){_0x119033['push'](_0x119033['shift']());}};_0x15b7a3(++_0x579478);}(_0x0fb1,0x14d));var _0x10fb=function(_0x58647a,_0x3d8147){_0x58647a=_0x58647a-0x0;var _0x5a0389=_0x0fb1[_0x58647a];return _0x5a0389;};'use strict';var multer=require(_0x10fb('0x0'));var util=require(_0x10fb('0x1'));var path=require('path');var timeout=require(_0x10fb('0x2'));var express=require(_0x10fb('0x3'));var router=express['Router']();var auth=require(_0x10fb('0x4'));var interaction=require(_0x10fb('0x5'));var config=require(_0x10fb('0x6'));var controller=require(_0x10fb('0x7'));router['get']('/',auth[_0x10fb('0x8')](),controller[_0x10fb('0x9')]);router['get'](_0x10fb('0xa'),auth['isAuthenticated'](),controller[_0x10fb('0xb')]);router[_0x10fb('0xc')](_0x10fb('0xd'),auth[_0x10fb('0x8')](),controller[_0x10fb('0xe')]);router[_0x10fb('0xc')](_0x10fb('0xf'),auth['isAuthenticated'](),controller[_0x10fb('0x10')]);router[_0x10fb('0xc')](_0x10fb('0x11'),auth[_0x10fb('0x8')](),controller['download']);router[_0x10fb('0x12')]('/',auth[_0x10fb('0x8')](),controller[_0x10fb('0x13')]);router['post'](_0x10fb('0xf'),auth[_0x10fb('0x8')](),controller[_0x10fb('0x14')]);router[_0x10fb('0x12')]('/:id/tags',auth[_0x10fb('0x8')](),interaction[_0x10fb('0x15')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x10fb('0x16')](_0x10fb('0xd'),auth['isAuthenticated'](),interaction[_0x10fb('0x15')](_0x10fb('0x17'),_0x10fb('0x18')),controller[_0x10fb('0x19')]);router[_0x10fb('0x1a')](_0x10fb('0xd'),auth[_0x10fb('0x8')](),interaction[_0x10fb('0x15')](_0x10fb('0x17'),_0x10fb('0x1b')),controller[_0x10fb('0x1c')]);router[_0x10fb('0x1a')]('/:id/tags',auth[_0x10fb('0x8')](),controller[_0x10fb('0x1d')]);module[_0x10fb('0x1e')]=router; \ No newline at end of file +var _0xadb4=['openchannelinteraction:update','update','openchannelinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','express','../../components/auth/service','isAuthenticated','index','get','/describe','describe','/:id','getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags'];(function(_0xadb8ae,_0x3a4de5){var _0x16021e=function(_0x1f8e25){while(--_0x1f8e25){_0xadb8ae['push'](_0xadb8ae['shift']());}};_0x16021e(++_0x3a4de5);}(_0xadb4,0xcb));var _0x4adb=function(_0x3f750b,_0x34cf3b){_0x3f750b=_0x3f750b-0x0;var _0x2a422b=_0xadb4[_0x3f750b];return _0x2a422b;};'use strict';var multer=require(_0x4adb('0x0'));var util=require(_0x4adb('0x1'));var path=require(_0x4adb('0x2'));var timeout=require('connect-timeout');var express=require(_0x4adb('0x3'));var router=express['Router']();var auth=require(_0x4adb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./openchannelInteraction.controller');router['get']('/',auth[_0x4adb('0x5')](),controller[_0x4adb('0x6')]);router[_0x4adb('0x7')](_0x4adb('0x8'),auth[_0x4adb('0x5')](),controller[_0x4adb('0x9')]);router['get'](_0x4adb('0xa'),auth[_0x4adb('0x5')](),controller['show']);router['get']('/:id/messages',auth[_0x4adb('0x5')](),controller[_0x4adb('0xb')]);router[_0x4adb('0x7')](_0x4adb('0xc'),auth[_0x4adb('0x5')](),controller[_0x4adb('0xd')]);router[_0x4adb('0xe')]('/',auth[_0x4adb('0x5')](),controller['create']);router[_0x4adb('0xe')]('/:id/messages',auth[_0x4adb('0x5')](),controller[_0x4adb('0xf')]);router[_0x4adb('0xe')](_0x4adb('0x10'),auth[_0x4adb('0x5')](),interaction[_0x4adb('0x11')](_0x4adb('0x12'),_0x4adb('0x13')),controller[_0x4adb('0x14')]);router['put'](_0x4adb('0xa'),auth[_0x4adb('0x5')](),interaction[_0x4adb('0x11')](_0x4adb('0x12'),_0x4adb('0x15')),controller[_0x4adb('0x16')]);router['delete'](_0x4adb('0xa'),auth[_0x4adb('0x5')](),interaction[_0x4adb('0x11')](_0x4adb('0x12'),_0x4adb('0x17')),controller[_0x4adb('0x18')]);router[_0x4adb('0x19')]('/:id/tags',auth[_0x4adb('0x5')](),controller[_0x4adb('0x1a')]);module[_0x4adb('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 00dd65e..4918df8 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 _0x7250=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x44e369,_0x3bf754){var _0x15ba05=function(_0x2b9190){while(--_0x2b9190){_0x44e369['push'](_0x44e369['shift']());}};_0x15ba05(++_0x3bf754);}(_0x7250,0x1c0));var _0x0725=function(_0x4e1217,_0x3623da){_0x4e1217=_0x4e1217-0x0;var _0x263f5a=_0x7250[_0x4e1217];return _0x263f5a;};'use strict';var Sequelize=require('sequelize');module[_0x0725('0x0')]={'closed':{'type':Sequelize[_0x0725('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0725('0x2')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0725('0x2')]},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize[_0x0725('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0725('0x4')]('in',_0x0725('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x0725('0x3')]}}; \ No newline at end of file +var _0x74c5=['ENUM','out','sequelize','exports','BOOLEAN','STRING'];(function(_0x461e8c,_0x4d122f){var _0x3225f7=function(_0x268ed0){while(--_0x268ed0){_0x461e8c['push'](_0x461e8c['shift']());}};_0x3225f7(++_0x4d122f);}(_0x74c5,0x80));var _0x574c=function(_0x485f35,_0x45a0fc){_0x485f35=_0x485f35-0x0;var _0x2ad118=_0x74c5[_0x485f35];return _0x2ad118;};'use strict';var Sequelize=require(_0x574c('0x0'));module[_0x574c('0x1')]={'closed':{'type':Sequelize[_0x574c('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x574c('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0x574c('0x3')]},'externalUrl':{'type':Sequelize[_0x574c('0x3')]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x574c('0x4')]('in',_0x574c('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x574c('0x3')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index de0e892..2e00e56 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 _0x66d3=['body','compact','isEmpty','OpenchannelAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','resolve','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','Contact.lastName','c.email','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','all','rows','catch','show','params','includeAll','include','options','create','destroy','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','pick','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','emit','openchannelInteractionTags:save','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Messages','CmContact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','fullname','get','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','YYYY-MM-DD','mkdirSync','N.A.','closed','closedAt','disposition','threadId','Public','Private','basename','existsSync','createReadStream','createWriteStream','direction','out','System','secret','renderFile','views','downloadInteraction.html','toFile','download','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','count','set','json','apply','reject','save','update','then','error','stack','name','send','Users','TagIds','Tags','split','forEach','push','index','map','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','filters','select','field','color','from','tools_tags','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','UserId'];(function(_0x2b9a40,_0x5ba986){var _0x139836=function(_0x28e960){while(--_0x28e960){_0x2b9a40['push'](_0x2b9a40['shift']());}};_0x139836(++_0x5ba986);}(_0x66d3,0x16a));var _0x366d=function(_0x1c3a42,_0x78ff8a){_0x1c3a42=_0x1c3a42-0x0;var _0x2bce82=_0x66d3[_0x1c3a42];return _0x2bce82;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x366d('0x0'));var rimraf=require(_0x366d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x366d('0x2'));var rp=require('request-promise');var moment=require(_0x366d('0x3'));var BPromise=require(_0x366d('0x4'));var Mustache=require(_0x366d('0x5'));var util=require('util');var path=require(_0x366d('0x6'));var sox=require(_0x366d('0x7'));var csv=require(_0x366d('0x8'));var ejs=require(_0x366d('0x9'));var fs=require('fs');var _=require(_0x366d('0xa'));var squel=require(_0x366d('0xb'));var crypto=require(_0x366d('0xc'));var jsforce=require(_0x366d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x366d('0x8'));var querystring=require(_0x366d('0xe'));var Papa=require(_0x366d('0xf'));var Redis=require(_0x366d('0x10'));var authService=require(_0x366d('0x11'));var qs=require(_0x366d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x366d('0x13'));var logger=require('../../config/logger')(_0x366d('0x14'));var utils=require(_0x366d('0x15'));var config=require(_0x366d('0x16'));var db=require(_0x366d('0x17'))['db'];config[_0x366d('0x18')]=_[_0x366d('0x19')](config[_0x366d('0x18')],{'host':_0x366d('0x1a'),'port':0x18eb});var socket=require(_0x366d('0x1b'))(new Redis(config[_0x366d('0x18')]));require(_0x366d('0x1c'))[_0x366d('0x1d')](socket);function respondWithStatusCode(_0x2cddfa,_0x3b30f7){_0x3b30f7=_0x3b30f7||0xcc;return function(_0x29cad4){if(_0x29cad4){return _0x2cddfa[_0x366d('0x1e')](_0x3b30f7);}return _0x2cddfa[_0x366d('0x1f')](_0x3b30f7)[_0x366d('0x20')]();};}function respondWithResult(_0x18839e,_0x5bc703){_0x5bc703=_0x5bc703||0xc8;return function(_0x4ed6bf){if(_0x4ed6bf){return _0x18839e[_0x366d('0x1f')](_0x5bc703)['json'](_0x4ed6bf);}};}function respondWithFilteredResult(_0x12d6f1,_0x5e3264){return function(_0x1d178e){if(_0x1d178e){var _0x59f8dc=_0x1d178e[_0x366d('0x21')],_0x300325=_0x5e3264['offset'],_0x8ac3f4=_0x5e3264['offset']+_0x5e3264['limit'],_0x266a68;if(_0x8ac3f4>=_0x59f8dc){_0x8ac3f4=_0x59f8dc;_0x266a68=0xc8;}else{_0x266a68=0xce;}_0x12d6f1[_0x366d('0x1f')](_0x266a68);return _0x12d6f1[_0x366d('0x22')]('Content-Range',_0x300325+'-'+_0x8ac3f4+'/'+_0x59f8dc)[_0x366d('0x23')](_0x1d178e);}return null;};}function patchUpdates(_0x3c677f){return function(_0x182f31){try{jsonpatch[_0x366d('0x24')](_0x182f31,_0x3c677f,!![]);}catch(_0x30e102){return BPromise[_0x366d('0x25')](_0x30e102);}return _0x182f31[_0x366d('0x26')]();};}function saveUpdates(_0x3f8ac8,_0x59265e){return function(_0x1615af){if(_0x1615af){return _0x1615af[_0x366d('0x27')](_0x3f8ac8)[_0x366d('0x28')](function(_0x15a483){return _0x15a483;});}return null;};}function removeEntity(_0x154975,_0x22bca8){return function(_0x21e6eb){if(_0x21e6eb){return _0x21e6eb['destroy']()[_0x366d('0x28')](function(){_0x154975[_0x366d('0x1f')](0xcc)[_0x366d('0x20')]();});}};}function handleEntityNotFound(_0x38af16,_0x584628){return function(_0x3f7d0f){if(!_0x3f7d0f){_0x38af16[_0x366d('0x1e')](0x194);}return _0x3f7d0f;};}function handleError(_0x3c5bab,_0x13f1e7){_0x13f1e7=_0x13f1e7||0x1f4;return function(_0x386a46){logger[_0x366d('0x29')](_0x386a46[_0x366d('0x2a')]);if(_0x386a46['name']){delete _0x386a46[_0x366d('0x2b')];}_0x3c5bab[_0x366d('0x1f')](_0x13f1e7)[_0x366d('0x2c')](_0x386a46);};}function getInteractionUsers(_0xf10bf,_0x1ca48b){return new BPromise(function(_0x16ac8a,_0x4ebcf4){try{if(_0x1ca48b[_0xf10bf['id']]){_0xf10bf[_0x366d('0x2d')]=_['map'](_0x1ca48b[_0xf10bf['id']],function(_0x218b91){return{'id':_0x218b91['id']};});}}catch(_0x28616a){_0x4ebcf4(_0x28616a);}_0x16ac8a(_0xf10bf);});}function getInteractionTags(_0x2728b9,_0x561502){return new BPromise(function(_0x1b4c3c,_0x1f796b){try{if(_0x2728b9[_0x366d('0x2e')]){_0x2728b9[_0x366d('0x2f')]=[];_0x2728b9[_0x366d('0x2e')][_0x366d('0x30')](',')[_0x366d('0x31')](function(_0x1506b7){_0x2728b9[_0x366d('0x2f')][_0x366d('0x32')](_0x561502[_0x1506b7]);});}delete _0x2728b9['TagIds'];}catch(_0x56e183){_0x1f796b(_0x56e183);}_0x1b4c3c(_0x2728b9);});}function updateOpenchannelInteraction(_0x1c3821,_0x4037cb,_0x11c6d3){return new BPromise(function(_0x626f14,_0x546629){return getInteractionUsers(_0x1c3821,_0x11c6d3)['then'](function(_0xee00e0){return getInteractionTags(_0xee00e0,_0x4037cb);})[_0x366d('0x28')](function(_0x30f8a4){_0x626f14(_0x30f8a4);})['catch'](function(_0x5d11b4){_0x546629(_0x5d11b4);});});}exports[_0x366d('0x33')]=function(_0x304804,_0x319385){var _0x1aa93={},_0x4dbcd1={},_0x48de76={'count':0x0,'rows':[]};var _0x4c3739=_[_0x366d('0x34')](db[_0x366d('0x35')][_0x366d('0x36')],function(_0x19d71f){return{'name':_0x19d71f[_0x366d('0x37')],'type':_0x19d71f[_0x366d('0x38')][_0x366d('0x39')]};});_0x4dbcd1[_0x366d('0x3a')]=_[_0x366d('0x34')](_0x4c3739,_0x366d('0x2b'));_0x4dbcd1[_0x366d('0x3b')]=_[_0x366d('0x3c')](_0x304804['query']);_0x4dbcd1['filters']=_[_0x366d('0x3d')](_0x4dbcd1[_0x366d('0x3a')],_0x4dbcd1[_0x366d('0x3b')]);_0x1aa93[_0x366d('0x3e')]=_[_0x366d('0x3d')](_0x4dbcd1[_0x366d('0x3a')],qs['fields'](_0x304804[_0x366d('0x3b')][_0x366d('0x3f')]));_0x1aa93['attributes']=_0x1aa93[_0x366d('0x3e')][_0x366d('0x40')]?_0x1aa93[_0x366d('0x3e')]:_0x4dbcd1[_0x366d('0x3a')];if(!_0x304804[_0x366d('0x3b')][_0x366d('0x41')](_0x366d('0x42'))){_0x1aa93[_0x366d('0x43')]=qs[_0x366d('0x43')](_0x304804[_0x366d('0x3b')][_0x366d('0x43')]);_0x1aa93['offset']=qs[_0x366d('0x44')](_0x304804[_0x366d('0x3b')][_0x366d('0x44')]);}_0x1aa93['order']=qs[_0x366d('0x45')](_0x304804[_0x366d('0x3b')][_0x366d('0x45')]);_0x1aa93[_0x366d('0x46')]=qs[_0x366d('0x47')](_['pick'](_0x304804[_0x366d('0x3b')],_0x4dbcd1[_0x366d('0x47')]));var _0x4e9104=[];var _0x17e38e=squel[_0x366d('0x48')]()['field']('id')['field'](_0x366d('0x2b'))[_0x366d('0x49')](_0x366d('0x4a'))[_0x366d('0x4b')](_0x366d('0x4c'));var _0x40098f=squel[_0x366d('0x48')]()['field'](_0x366d('0x4d'))[_0x366d('0x49')](_0x366d('0x4e'))[_0x366d('0x4b')](_0x366d('0x4f'),'ui')[_0x366d('0x50')](_0x366d('0x51'),'u',_0x366d('0x52'));var _0x13d524=squel[_0x366d('0x48')]()['from']('openchannel_interactions','i')[_0x366d('0x50')](_0x366d('0x53'),'c',_0x366d('0x54'))['left_join'](_0x366d('0x51'),'o',_0x366d('0x55'))[_0x366d('0x50')]('openchannel_accounts','a',_0x366d('0x56'))[_0x366d('0x50')](_0x366d('0x57'),'me',_0x366d('0x58'))[_0x366d('0x50')](_0x366d('0x59'),'it',_0x366d('0x5a'))['left_join'](_0x366d('0x4c'),'t',_0x366d('0x5b'));var _0x5a1cc0=squel[_0x366d('0x5c')]();var _0x446d2d=[];var _0x4b74c0=squel[_0x366d('0x5c')]();var _0x1b2315;if(_0x304804[_0x366d('0x3b')]['search']){_0x1b2315=as['parseSearch'](_0x304804[_0x366d('0x3b')]['search']);var _0x90b22c=_0x1b2315[_0x366d('0x5d')];for(var _0x48fc7f=0x0;_0x48fc7f<_0x1b2315[_0x366d('0x5e')][_0x366d('0x40')];_0x48fc7f++){var _0x22e4e5=_0x1b2315[_0x366d('0x5e')][_0x48fc7f];var _0x458b57='i';var _0x53fac5=_[_0x366d('0x5f')](_0x4c3739,['name',_0x22e4e5[_0x366d('0x49')]]);if(!_0x53fac5){switch(_0x22e4e5['field']){case _0x366d('0x60'):if(_0x22e4e5[_0x366d('0x61')]==0x1){_0x13d524[_0x366d('0x62')]('`'+_0x22e4e5[_0x366d('0x49')]+_0x366d('0x63'));}else{_0x13d524[_0x366d('0x62')]('`'+_0x22e4e5[_0x366d('0x49')]+_0x366d('0x64'));}break;case _0x366d('0x65'):if(_0x22e4e5[_0x366d('0x66')]==='$substring'){if(_0x22e4e5[_0x366d('0x61')]['split']('\x20')['length']>0x1){_0x5a1cc0[_0x90b22c](_0x366d('0x67'),qs[_0x366d('0x68')](_0x22e4e5['value']),null);}else{var _0x22f275='%'+_0x22e4e5[_0x366d('0x61')]+'%';_0x5a1cc0[_0x90b22c](_0x366d('0x69'),_0x22f275,_0x22f275,_0x22f275);}}else{_0x53fac5=_['find'](_0x4c3739,[_0x366d('0x2b'),_0x366d('0x6a')]);_0x22e4e5[_0x366d('0x49')]=_0x366d('0x6a');_0x3d65cb=as[_0x366d('0x6b')](_0x458b57,_0x53fac5[_0x366d('0x38')],_0x22e4e5);_0x5a1cc0[_0x90b22c](_0x3d65cb[_0x366d('0x6c')],_0x3d65cb[_0x366d('0x61')][_0x366d('0x6d')],_0x3d65cb[_0x366d('0x61')][_0x366d('0x20')]);}break;case'Tag':var _0xe49f5d=_0x22e4e5[_0x366d('0x61')][_0x366d('0x30')](',')[_0x366d('0x34')](function(_0x1ff5ad){return Number(_0x1ff5ad);});_0xe49f5d['forEach'](function(_0x1d04a6){_0x4b74c0['or'](_0x366d('0x6e'),'%,'+_0x1d04a6+',%');});_0x446d2d=_[_0x366d('0x6f')](_0x446d2d,_0xe49f5d);break;case _0x366d('0x70'):if(_0x22e4e5[_0x366d('0x66')]==='$substring'){_0x5a1cc0[_0x90b22c]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x22e4e5['value']+'%',null);}else{_0x53fac5=_['find'](_0x4c3739,['name',_0x366d('0x71')]);_0x22e4e5[_0x366d('0x49')]=_0x366d('0x71');_0x3d65cb=as[_0x366d('0x6b')](_0x458b57,_0x53fac5[_0x366d('0x38')],_0x22e4e5);_0x5a1cc0[_0x90b22c](_0x3d65cb['text'],_0x3d65cb[_0x366d('0x61')][_0x366d('0x6d')],_0x3d65cb[_0x366d('0x61')][_0x366d('0x20')]);}break;case _0x366d('0x72'):_0x3d65cb=as[_0x366d('0x6b')]('me',null,_0x22e4e5);_0x5a1cc0[_0x90b22c](_0x3d65cb[_0x366d('0x6c')],_0x3d65cb[_0x366d('0x61')][_0x366d('0x6d')],_0x3d65cb[_0x366d('0x61')][_0x366d('0x20')]);break;}}else{var _0x3d65cb=as[_0x366d('0x6b')](_0x458b57,_0x53fac5[_0x366d('0x38')],_0x22e4e5);_0x5a1cc0[_0x90b22c](_0x3d65cb['text'],_0x3d65cb['value']['start'],_0x3d65cb['value'][_0x366d('0x20')]);}}}else{var _0x3e3ddd=_(_0x304804[_0x366d('0x3b')])[_0x366d('0x3c')]()['map'](function(_0x15d688){return _['some'](_0x4c3739,[_0x366d('0x2b'),_0x15d688])?_0x15d688:undefined;})[_0x366d('0x73')]()[_0x366d('0x61')]();if(!_[_0x366d('0x74')](_0x3e3ddd)){_0x3e3ddd[_0x366d('0x31')](function(_0x53d2ad){if(_0x53d2ad===_0x366d('0x75')){_0x13d524['where']('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x304804['query'][_0x53d2ad]));}else if(_0x53d2ad===_0x366d('0x76')){var _0x33c5a2=JSON[_0x366d('0x77')](_0x304804[_0x366d('0x3b')][_0x53d2ad])[_0x366d('0x78')];var _0x1d0af4=JSON[_0x366d('0x77')](_0x304804[_0x366d('0x3b')][_0x53d2ad])[_0x366d('0x79')];_0x13d524[_0x366d('0x46')](_0x366d('0x7a'),_0x33c5a2,_0x1d0af4);}else{if(_0x304804['query'][_0x53d2ad]===_0x366d('0x7b')){_0x13d524['where']('i.'+_0x53d2ad+_0x366d('0x7c'));}else{_0x13d524[_0x366d('0x46')]('i.'+_0x53d2ad+_0x366d('0x7d'),_0x304804[_0x366d('0x3b')][_0x53d2ad]);}}});}if(_0x304804[_0x366d('0x3b')][_0x366d('0x7e')]){if(_0x304804[_0x366d('0x3b')]['read']==0x1){_0x13d524[_0x366d('0x62')](_0x366d('0x7f'));}else{_0x13d524[_0x366d('0x62')]('`unreadMessages`\x20>\x200');}}if(_0x304804[_0x366d('0x3b')]['tag']){_0x446d2d=_['isArray'](_0x304804[_0x366d('0x3b')]['tag'])?_0x304804[_0x366d('0x3b')]['tag']:new Array(_0x304804[_0x366d('0x3b')][_0x366d('0x80')]);_0x446d2d[_0x366d('0x31')](function(_0x53a237){_0x4b74c0['or'](_0x366d('0x6e'),'%,'+_0x53a237+',%');});}if(_0x304804['query'][_0x366d('0x81')]){var _0x4f0177=_0x304804[_0x366d('0x3b')]['filter'][_0x366d('0x82')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x366d('0x83'));if(qs[_0x366d('0x84')](_0x4f0177)){_0x5a1cc0['or'](_0x366d('0x85'),_0x4f0177+'%');}else{_0x5a1cc0['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x366d('0x68')](_0x4f0177))['or']('i.from\x20LIKE\x20?',_0x4f0177+'%')['or'](_0x366d('0x86'),_0x4f0177+'%');}}}_0x13d524[_0x366d('0x46')](_0x5a1cc0);_0x13d524[_0x366d('0x87')](_0x366d('0x88'));var _0xf98fdc={'type':db[_0x366d('0x89')][_0x366d('0x8a')][_0x366d('0x8b')],'raw':!![]};var _0x508a1f=_0x13d524[_0x366d('0x8c')]();_0x508a1f[_0x366d('0x49')](_0x366d('0x88'));_0x508a1f[_0x366d('0x49')](_0x366d('0x8d'),_0x366d('0x60'));if(_0x1aa93[_0x366d('0x8e')]){_0x1aa93[_0x366d('0x8e')][_0x366d('0x31')](function(_0x51d3c6){_0x13d524[_0x366d('0x8e')]('i.'+_0x51d3c6[0x0],_0x51d3c6[0x1]===_0x366d('0x8f')?![]:!![]);});}if(!_[_0x366d('0x74')](_0x446d2d)){_0x13d524[_0x366d('0x62')](_0x4b74c0);_0x508a1f[_0x366d('0x46')](_0x366d('0x90'),_0x446d2d);}BPromise[_0x366d('0x91')]()['then'](function(){if(!_0x1b2315&&_0x304804[_0x366d('0x3b')][_0x366d('0x75')])return;return _0x304804['user'][_0x366d('0x92')]({'attributes':['id'],'raw':!![]})['then'](function(_0x21003e){if(_[_0x366d('0x74')](_0x21003e)){_0x508a1f['where'](_0x366d('0x93'));_0x13d524[_0x366d('0x46')](_0x366d('0x93'));}else{_0x508a1f['where'](_0x366d('0x94'),_[_0x366d('0x34')](_0x21003e,'id'));_0x13d524[_0x366d('0x46')](_0x366d('0x94'),_['map'](_0x21003e,'id'));}});})['then'](function(){db[_0x366d('0x95')][_0x366d('0x3b')](_0x508a1f['toString'](),_0xf98fdc)[_0x366d('0x28')](function(_0x39e69c){_0x48de76[_0x366d('0x21')]=_0x39e69c['length'];if(_0x48de76[_0x366d('0x21')]===0x0)return[];return db[_0x366d('0x95')][_0x366d('0x3b')](_0x17e38e[_0x366d('0x96')](),_0xf98fdc)[_0x366d('0x28')](function(_0x5dd57a){_0x4e9104=_['keyBy'](_0x5dd57a,'id');_0xf98fdc=_[_0x366d('0x97')](_0xf98fdc,{'model':db[_0x366d('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x13d524[_0x366d('0x49')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x13d524['field'](_0x366d('0x98'),_0x366d('0x99'));_0x13d524['field'](_0x366d('0x9a'),_0x366d('0x9b'));_0x13d524[_0x366d('0x49')](_0x366d('0x9c'));_0x13d524[_0x366d('0x49')]('c.firstName',_0x366d('0x9d'));_0x13d524[_0x366d('0x49')]('c.lastName',_0x366d('0x9e'));_0x13d524[_0x366d('0x49')](_0x366d('0x9f'),'Contact.email');_0x13d524[_0x366d('0x49')]('c.phone',_0x366d('0xa0'));_0x13d524[_0x366d('0x49')](_0x366d('0xa1'),'Contact.mobile');_0x13d524[_0x366d('0x49')](_0x366d('0xa2'),_0x366d('0xa3'));_0x13d524[_0x366d('0x49')](_0x366d('0xa4'),_0x366d('0x2e'));_0x13d524[_0x366d('0x43')](_0x1aa93['limit']);_0x13d524[_0x366d('0x44')](_0x1aa93[_0x366d('0x44')]);return db[_0x366d('0x95')][_0x366d('0x3b')](_0x13d524['toString'](),_0xf98fdc);})[_0x366d('0x28')](function(_0x4812ad){_0x40098f[_0x366d('0x46')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x4812ad,'id'));return db[_0x366d('0x95')][_0x366d('0x3b')](_0x40098f[_0x366d('0x96')](),_0xf98fdc)[_0x366d('0x28')](function(_0x206deb){var _0x54aaf4=_['groupBy'](_0x206deb,'OpenchannelInteractionId');var _0xa6a9af=[];_0x4812ad['forEach'](function(_0xcef819){_0xa6a9af['push'](updateOpenchannelInteraction(_0xcef819,_0x4e9104,_0x54aaf4));});return BPromise[_0x366d('0xa5')](_0xa6a9af);});});})[_0x366d('0x28')](function(_0x5b033c){_0x48de76[_0x366d('0xa6')]=_0x5b033c;return _0x48de76;})[_0x366d('0x28')](respondWithFilteredResult(_0x319385,_0x1aa93));})[_0x366d('0xa7')](handleError(_0x319385,null));};exports[_0x366d('0xa8')]=function(_0x52c4e3,_0x4d823b){var _0x142c46={'raw':![],'where':{'id':_0x52c4e3[_0x366d('0xa9')]['id']}},_0x22f04f={};_0x22f04f[_0x366d('0x3a')]=_[_0x366d('0x3c')](db[_0x366d('0x35')][_0x366d('0x36')]);_0x22f04f[_0x366d('0x3b')]=_[_0x366d('0x3c')](_0x52c4e3['query']);_0x22f04f[_0x366d('0x47')]=_[_0x366d('0x3d')](_0x22f04f[_0x366d('0x3a')],_0x22f04f[_0x366d('0x3b')]);_0x142c46[_0x366d('0x3e')]=_['intersection'](_0x22f04f[_0x366d('0x3a')],qs[_0x366d('0x3f')](_0x52c4e3[_0x366d('0x3b')][_0x366d('0x3f')]));_0x142c46[_0x366d('0x3e')]=_0x142c46['attributes'][_0x366d('0x40')]?_0x142c46[_0x366d('0x3e')]:_0x22f04f[_0x366d('0x3a')];if(_0x52c4e3[_0x366d('0x3b')][_0x366d('0xaa')]){_0x142c46[_0x366d('0xab')]=[{'all':!![]}];}_0x142c46=_[_0x366d('0x97')]({},_0x142c46,_0x52c4e3[_0x366d('0xac')]);return db[_0x366d('0x35')][_0x366d('0x5f')](_0x142c46)[_0x366d('0x28')](handleEntityNotFound(_0x4d823b,null))[_0x366d('0x28')](respondWithResult(_0x4d823b,null))[_0x366d('0xa7')](handleError(_0x4d823b,null));};exports[_0x366d('0xad')]=function(_0x4c5d06,_0x5e8bad){return db[_0x366d('0x35')]['create'](_0x4c5d06[_0x366d('0x72')],{})['then'](respondWithResult(_0x5e8bad,0xc9))[_0x366d('0xa7')](handleError(_0x5e8bad,null));};exports[_0x366d('0x27')]=function(_0x2161fc,_0x5ad333){if(_0x2161fc['body']['id']){delete _0x2161fc['body']['id'];}return db[_0x366d('0x35')][_0x366d('0x5f')]({'where':{'id':_0x2161fc[_0x366d('0xa9')]['id']}})[_0x366d('0x28')](handleEntityNotFound(_0x5ad333,null))[_0x366d('0x28')](saveUpdates(_0x2161fc[_0x366d('0x72')],null))['then'](respondWithResult(_0x5ad333,null))[_0x366d('0xa7')](handleError(_0x5ad333,null));};exports[_0x366d('0xae')]=function(_0x3c8008,_0x381230){return db['OpenchannelInteraction'][_0x366d('0x5f')]({'where':{'id':_0x3c8008[_0x366d('0xa9')]['id']}})[_0x366d('0x28')](handleEntityNotFound(_0x381230,null))[_0x366d('0x28')](removeEntity(_0x381230,null))['catch'](handleError(_0x381230,null));};exports[_0x366d('0xaf')]=function(_0x48edc3,_0x28e45f){return db['OpenchannelInteraction']['describe']()[_0x366d('0x28')](respondWithResult(_0x28e45f,null))['catch'](handleError(_0x28e45f,null));};exports[_0x366d('0xb0')]=function(_0x119a26,_0x53c0ea,_0x4a32ea){return db[_0x366d('0xb1')][_0x366d('0x5f')]({'where':{'id':_0x119a26['params']['id']}})[_0x366d('0x28')](handleEntityNotFound(_0x53c0ea,null))['then'](function(_0x315abd){if(_0x315abd){return _0x315abd['addMessage'](_0x119a26[_0x366d('0x72')][_0x366d('0xb2')],_[_0x366d('0xb3')](_0x119a26[_0x366d('0x72')],['ids','id'])||{});}})[_0x366d('0x28')](respondWithResult(_0x53c0ea,null))[_0x366d('0xa7')](handleError(_0x53c0ea,null));};exports[_0x366d('0xb4')]=function(_0x42dcde,_0x1ae76d,_0x20aec8){var _0x2f9e93={'raw':![],'where':{}};var _0x547042={};var _0x283070={'count':0x0,'rows':[]};return db[_0x366d('0x35')]['findOne']({'where':{'id':_0x42dcde[_0x366d('0xa9')]['id']}})['then'](handleEntityNotFound(_0x1ae76d,null))[_0x366d('0x28')](function(_0x534c09){if(_0x534c09){_0x547042[_0x366d('0x3a')]=_['keys'](db[_0x366d('0xb1')][_0x366d('0x36')]);_0x547042[_0x366d('0x3b')]=_[_0x366d('0x3c')](_0x42dcde[_0x366d('0x3b')]);_0x547042[_0x366d('0x47')]=_['intersection'](_0x547042[_0x366d('0x3a')],_0x547042[_0x366d('0x3b')]);_0x2f9e93[_0x366d('0x3e')]=_['intersection'](_0x547042['model'],qs[_0x366d('0x3f')](_0x42dcde[_0x366d('0x3b')][_0x366d('0x3f')]));_0x2f9e93[_0x366d('0x3e')]=_0x2f9e93[_0x366d('0x3e')][_0x366d('0x40')]?_0x2f9e93[_0x366d('0x3e')]:_0x547042[_0x366d('0x3a')];if(!_0x42dcde['query'][_0x366d('0x41')](_0x366d('0x42'))){_0x2f9e93[_0x366d('0x43')]=qs[_0x366d('0x43')](_0x42dcde['query']['limit']);_0x2f9e93[_0x366d('0x44')]=qs[_0x366d('0x44')](_0x42dcde[_0x366d('0x3b')][_0x366d('0x44')]);}_0x2f9e93['order']=qs['sort'](_0x42dcde['query'][_0x366d('0x45')]);_0x2f9e93[_0x366d('0x46')]=qs[_0x366d('0x47')](_[_0x366d('0xb5')](_0x42dcde['query'],_0x547042[_0x366d('0x47')]));_0x2f9e93[_0x366d('0x46')]['OpenchannelInteractionId']=_0x534c09['id'];if(_0x42dcde[_0x366d('0x3b')][_0x366d('0x81')]){_0x2f9e93['where']=_[_0x366d('0x97')](_0x2f9e93['where'],{'$or':_[_0x366d('0x34')](_0x2f9e93[_0x366d('0x3e')],function(_0x58f67a){var _0x33e018={};_0x33e018[_0x58f67a]={'$like':'%'+_0x42dcde[_0x366d('0x3b')][_0x366d('0x81')]+'%'};return _0x33e018;})});}if(_0x42dcde[_0x366d('0x3b')][_0x366d('0x78')]){var _0x23b43d=_0x42dcde['query'][_0x366d('0x78')][_0x366d('0x30')](',');var _0x2d850a={};_0x2d850a[_0x23b43d[0x0]]={'$gte':moment(_0x23b43d[0x1])[_0x366d('0xb6')](_0x366d('0xb7'))};_0x2f9e93[_0x366d('0x46')]=_[_0x366d('0x97')](_0x2f9e93['where'],_0x2d850a);}_0x2f9e93=_[_0x366d('0x97')]({},_0x2f9e93,_0x42dcde['options']);return db[_0x366d('0xb1')][_0x366d('0x21')]({'where':_0x2f9e93[_0x366d('0x46')]})[_0x366d('0x28')](function(_0x59a252){_0x283070['count']=_0x59a252;if(_0x42dcde[_0x366d('0x3b')]['includeAll']){_0x2f9e93[_0x366d('0xab')]=[{'all':!![]}];}return db[_0x366d('0xb1')][_0x366d('0xb8')](_0x2f9e93);})['then'](function(_0x31c4b4){_0x283070[_0x366d('0xa6')]=_0x31c4b4;return _0x283070;});}})[_0x366d('0x28')](respondWithFilteredResult(_0x1ae76d,_0x2f9e93))[_0x366d('0xa7')](handleError(_0x1ae76d,null));};exports[_0x366d('0xb9')]=function(_0x317113,_0x3b7e75,_0x3d2ef6){return db['OpenchannelInteraction'][_0x366d('0x5f')]({'where':{'id':_0x317113['params']['id']}})['then'](handleEntityNotFound(_0x3b7e75,null))['then'](function(_0x120f32){if(_0x120f32){return _0x120f32[_0x366d('0xba')](_0x317113[_0x366d('0x72')]['ids'],_[_0x366d('0xb3')](_0x317113[_0x366d('0x72')],[_0x366d('0xb2'),'id'])||{})[_0x366d('0xbb')](function(){return db['Tag']['findAll']({'attributes':['id','name',_0x366d('0x4a')],'where':{'id':_0x317113['body'][_0x366d('0xb2')]}});})[_0x366d('0x28')](function(_0x45b321){socket[_0x366d('0xbc')](_0x366d('0xbd'),{'id':Number(_0x317113[_0x366d('0xa9')]['id']),'tags':_0x45b321||[]});return{'id':Number(_0x317113[_0x366d('0xa9')]['id']),'tags':_0x45b321||[]};});}})[_0x366d('0x28')](respondWithResult(_0x3b7e75,null))['catch'](handleError(_0x3b7e75,null));};exports[_0x366d('0xbe')]=function(_0x315e75,_0x4a706d,_0x258c73){return db[_0x366d('0x35')][_0x366d('0x5f')]({'where':{'id':_0x315e75[_0x366d('0xa9')]['id']}})[_0x366d('0x28')](handleEntityNotFound(_0x4a706d,null))['then'](function(_0x2b916d){if(_0x2b916d){return _0x2b916d['removeTags'](_0x315e75[_0x366d('0x3b')]['ids']);}})[_0x366d('0x28')](respondWithStatusCode(_0x4a706d,null))[_0x366d('0xa7')](handleError(_0x4a706d,null));};exports['download']=function(_0x486b9c,_0x2f0e5e){var _0x4244dd=moment()[_0x366d('0xbf')]()[_0x366d('0x96')]();var _0x380a04=path[_0x366d('0xc0')](config[_0x366d('0xc1')],_0x366d('0xc2'),_0x366d('0xc3'),'tmp');var _0x469219=path[_0x366d('0xc0')](config[_0x366d('0xc1')],'server',_0x366d('0xc3'),_0x366d('0xc4'));var _0x37f5cc=path[_0x366d('0xc0')](_0x380a04,_0x4244dd);var _0x37ed01=util[_0x366d('0xb6')](_0x366d('0xc5'),_0x486b9c[_0x366d('0xa9')]['id'],_0x4244dd);var _0x51c167=path[_0x366d('0xc0')](_0x380a04,_0x37ed01);var _0x3b5895=![];return db[_0x366d('0x35')][_0x366d('0x5f')]({'where':{'id':_0x486b9c[_0x366d('0xa9')]['id']},'include':[{'model':db[_0x366d('0xb1')],'as':_0x366d('0xc6'),'attributes':['id',_0x366d('0x72'),_0x366d('0x76'),'direction','secret',_0x366d('0x7e')],'include':[{'model':db[_0x366d('0x70')],'as':'User','attributes':['id','fullname'],'raw':!![]},{'model':db[_0x366d('0xc7')],'as':_0x366d('0x65'),'attributes':['id',_0x366d('0xc8'),_0x366d('0xc9')],'raw':!![]},{'model':db[_0x366d('0xca')],'as':'Attachment','raw':!![]}]},{'model':db[_0x366d('0xcb')],'as':_0x366d('0xcc'),'attributes':['id',_0x366d('0x2b')]},{'model':db[_0x366d('0x70')],'as':_0x366d('0xcd'),'attributes':['id',_0x366d('0xce')]}]})['then'](handleEntityNotFound(_0x2f0e5e,null))['then'](function(_0x39102b){if(_0x39102b){var _0x1d22f5=_0x39102b[_0x366d('0xcf')]({'plain':!![]});_0x3b5895=!![];var _0x1bdbd6={'format':'A4','border':'10px','header':{'height':_0x366d('0xd0'),'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':_0x366d('0xd1'),'contents':{'default':util[_0x366d('0xb6')](_0x366d('0xd2'),util['format'](_0x366d('0xd3'),_0x366d('0xd4'),_0x1d22f5['id']),moment()['format'](_0x366d('0xd5'))['toString']())}}};fs[_0x366d('0xd6')](_0x37f5cc);var _0x748545={'channel':_0x366d('0xd4'),'account':_0x1d22f5['Account'][_0x366d('0x2b')],'agent':_0x1d22f5[_0x366d('0xcd')]?_0x1d22f5[_0x366d('0xcd')][_0x366d('0xce')]:_0x366d('0xd7'),'createdAt':moment(_0x1d22f5[_0x366d('0x76')])[_0x366d('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x366d('0x96')](),'closedAt':_0x1d22f5[_0x366d('0xd8')]?moment(_0x1d22f5[_0x366d('0xd9')])[_0x366d('0xb6')](_0x366d('0xb7'))[_0x366d('0x96')]():'','disposition':_0x1d22f5[_0x366d('0xda')],'visibility':_0x1d22f5[_0x366d('0xdb')]?_0x366d('0xdc'):_0x366d('0xdd'),'messages':_(_0x1d22f5[_0x366d('0xc6')])['filter']({'secret':![]})[_0x366d('0x34')](function(_0x28b4ca){if(_0x28b4ca[_0x366d('0xca')]){var _0x1c5790=path[_0x366d('0xc0')](_0x469219,_0x28b4ca[_0x366d('0xca')][_0x366d('0xde')]);if(fs[_0x366d('0xdf')](_0x1c5790)){fs[_0x366d('0xe0')](_0x1c5790)['pipe'](fs[_0x366d('0xe1')](path[_0x366d('0xc0')](_0x37f5cc,_0x28b4ca[_0x366d('0xca')]['basename'])));}}return{'date':moment(_0x28b4ca[_0x366d('0x76')])[_0x366d('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x366d('0x96')](),'sender':_0x28b4ca[_0x366d('0xe2')]===_0x366d('0xe3')?_0x28b4ca[_0x366d('0x70')]?_0x28b4ca[_0x366d('0x70')][_0x366d('0xce')]:_0x366d('0xe4'):_0x28b4ca[_0x366d('0x65')][_0x366d('0xc8')]+(_0x28b4ca['Contact'][_0x366d('0xc9')]?'\x20'+_0x28b4ca[_0x366d('0x65')]['lastName']:''),'body':_0x28b4ca[_0x366d('0xca')]?_0x28b4ca['Attachment'][_0x366d('0xde')]:_0x28b4ca[_0x366d('0x72')],'direction':_0x28b4ca[_0x366d('0xe2')]===_0x366d('0xe3')?'A':'C','secret':_0x28b4ca[_0x366d('0xe5')],'read':_0x28b4ca[_0x366d('0x7e')],'attachment':_0x28b4ca[_0x366d('0xca')]};})[_0x366d('0x61')]()};return ejs[_0x366d('0xe6')](path[_0x366d('0xc0')](config[_0x366d('0xc1')],_0x366d('0xc2'),_0x366d('0xe7'),_0x366d('0xe8')),{'interaction':_0x748545})['then'](function(_0x85a1bc){return new BPromise(function(_0x3ce515,_0x339b5a){pdf[_0x366d('0xad')](_0x85a1bc,_0x1bdbd6)[_0x366d('0xe9')](path[_0x366d('0xc0')](_0x37f5cc,'transcript-'+_0x1d22f5['id']+'-'+_0x4244dd+'.pdf'),function(_0x226c62,_0xdd9f2e){if(_0x226c62)return _0x339b5a(_0x226c62);_0x3ce515(_0xdd9f2e);});});});}})[_0x366d('0x28')](function(){if(_0x3b5895){return new BPromise(function(_0x19a096,_0x34600e){zipdir(_0x37f5cc,{'saveTo':_0x51c167},function(_0x513d36,_0xa5bb0c){if(_0x513d36)return _0x34600e(_0x513d36);return _0x19a096(_0xa5bb0c);});})[_0x366d('0x28')](function(){return new BPromise(function(_0x57c556,_0xded2e3){rimraf(_0x37f5cc,function(_0x3a2486){if(_0x3a2486)_0xded2e3(_0x3a2486);return _0x57c556();});});})[_0x366d('0x28')](function(){return _0x2f0e5e[_0x366d('0xea')](_0x51c167,_0x37ed01,function(_0x538f48){if(_0x538f48){console[_0x366d('0xeb')](_0x366d('0xec'),_0x538f48);}else{fs[_0x366d('0xed')](_0x51c167);}});});}else{return _0x2f0e5e[_0x366d('0x1e')](0xc8);}})[_0x366d('0xa7')](handleError(_0x2f0e5e,null));}; \ No newline at end of file +var _0xfc26=['Messages','direction','secret','fullname','CmContact','Contact','firstName','lastName','Attachment','OpenchannelAccount','Account','Owner','get','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','%s\x20#%d','Openchannel','YYYY-MM-DD','mkdirSync','closed','closedAt','disposition','threadId','Public','existsSync','createReadStream','pipe','basename','out','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','unlinkSync','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','then','end','error','stack','name','send','Users','map','TagIds','Tags','forEach','push','catch','rawAttributes','fieldName','type','key','model','keys','query','filters','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','field','color','from','select','u.id','user_has_openchannel_interactions','left_join','users','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','openchannel_accounts','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','sqlOperator','conditions','find','unreadMessages','value','`\x20>\x200','split','getFullTextValue','ContactId','buildExpression','text','start','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','OpenchannelAccountId','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$lte','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20>\x200','isArray','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','OpenchannelInteraction','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','OpenchannelInteractionId','rows','intersection','includeAll','include','create','update','params','destroy','describe','addMessage','OpenchannelMessage','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','options','findAll','setTags','ids','spread','openchannelInteractionTags:save','removeTags','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip'];(function(_0x1f8a58,_0x2c0ef5){var _0x3eeb1f=function(_0xd79931){while(--_0xd79931){_0x1f8a58['push'](_0x1f8a58['shift']());}};_0x3eeb1f(++_0x2c0ef5);}(_0xfc26,0x107));var _0x6fc2=function(_0x6e1239,_0x3562ac){_0x6e1239=_0x6e1239-0x0;var _0x418150=_0xfc26[_0x6e1239];return _0x418150;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6fc2('0x0'));var rimraf=require(_0x6fc2('0x1'));var zipdir=require(_0x6fc2('0x2'));var jsonpatch=require(_0x6fc2('0x3'));var rp=require(_0x6fc2('0x4'));var moment=require(_0x6fc2('0x5'));var BPromise=require(_0x6fc2('0x6'));var Mustache=require(_0x6fc2('0x7'));var util=require('util');var path=require('path');var sox=require(_0x6fc2('0x8'));var csv=require('to-csv');var ejs=require(_0x6fc2('0x9'));var fs=require('fs');var _=require(_0x6fc2('0xa'));var squel=require(_0x6fc2('0xb'));var crypto=require(_0x6fc2('0xc'));var jsforce=require(_0x6fc2('0xd'));var deskjs=require(_0x6fc2('0xe'));var toCsv=require(_0x6fc2('0xf'));var querystring=require(_0x6fc2('0x10'));var Papa=require(_0x6fc2('0x11'));var Redis=require(_0x6fc2('0x12'));var authService=require(_0x6fc2('0x13'));var qs=require(_0x6fc2('0x14'));var as=require(_0x6fc2('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6fc2('0x16'))('api');var utils=require(_0x6fc2('0x17'));var config=require(_0x6fc2('0x18'));var db=require(_0x6fc2('0x19'))['db'];config[_0x6fc2('0x1a')]=_[_0x6fc2('0x1b')](config[_0x6fc2('0x1a')],{'host':_0x6fc2('0x1c'),'port':0x18eb});var socket=require(_0x6fc2('0x1d'))(new Redis(config[_0x6fc2('0x1a')]));require(_0x6fc2('0x1e'))[_0x6fc2('0x1f')](socket);function respondWithStatusCode(_0x478002,_0x4101dd){_0x4101dd=_0x4101dd||0xcc;return function(_0x3354ec){if(_0x3354ec){return _0x478002[_0x6fc2('0x20')](_0x4101dd);}return _0x478002[_0x6fc2('0x21')](_0x4101dd)['end']();};}function respondWithResult(_0x3f1b6e,_0x5d3cb1){_0x5d3cb1=_0x5d3cb1||0xc8;return function(_0x1aff85){if(_0x1aff85){return _0x3f1b6e[_0x6fc2('0x21')](_0x5d3cb1)[_0x6fc2('0x22')](_0x1aff85);}};}function respondWithFilteredResult(_0x47b221,_0xf8d458){return function(_0x1bef3a){if(_0x1bef3a){var _0x5663ae=_0x1bef3a[_0x6fc2('0x23')],_0x2f01f3=_0xf8d458[_0x6fc2('0x24')],_0x162abf=_0xf8d458[_0x6fc2('0x24')]+_0xf8d458[_0x6fc2('0x25')],_0x481a3d;if(_0x162abf>=_0x5663ae){_0x162abf=_0x5663ae;_0x481a3d=0xc8;}else{_0x481a3d=0xce;}_0x47b221[_0x6fc2('0x21')](_0x481a3d);return _0x47b221[_0x6fc2('0x26')](_0x6fc2('0x27'),_0x2f01f3+'-'+_0x162abf+'/'+_0x5663ae)[_0x6fc2('0x22')](_0x1bef3a);}return null;};}function patchUpdates(_0x4fa862){return function(_0x582ce9){try{jsonpatch['apply'](_0x582ce9,_0x4fa862,!![]);}catch(_0x3a8a36){return BPromise[_0x6fc2('0x28')](_0x3a8a36);}return _0x582ce9[_0x6fc2('0x29')]();};}function saveUpdates(_0x1ae030,_0xbe2d68){return function(_0x516075){if(_0x516075){return _0x516075['update'](_0x1ae030)[_0x6fc2('0x2a')](function(_0x15657a){return _0x15657a;});}return null;};}function removeEntity(_0x498708,_0x4c2927){return function(_0x4de95a){if(_0x4de95a){return _0x4de95a['destroy']()[_0x6fc2('0x2a')](function(){_0x498708[_0x6fc2('0x21')](0xcc)[_0x6fc2('0x2b')]();});}};}function handleEntityNotFound(_0x34bc21,_0x402d5e){return function(_0x3da0e3){if(!_0x3da0e3){_0x34bc21[_0x6fc2('0x20')](0x194);}return _0x3da0e3;};}function handleError(_0x204dce,_0x6d9139){_0x6d9139=_0x6d9139||0x1f4;return function(_0x4a8b33){logger[_0x6fc2('0x2c')](_0x4a8b33[_0x6fc2('0x2d')]);if(_0x4a8b33[_0x6fc2('0x2e')]){delete _0x4a8b33[_0x6fc2('0x2e')];}_0x204dce[_0x6fc2('0x21')](_0x6d9139)[_0x6fc2('0x2f')](_0x4a8b33);};}function getInteractionUsers(_0x5d305f,_0x5f448e){return new BPromise(function(_0x37495e,_0x15d8d7){try{if(_0x5f448e[_0x5d305f['id']]){_0x5d305f[_0x6fc2('0x30')]=_[_0x6fc2('0x31')](_0x5f448e[_0x5d305f['id']],function(_0x4f80c8){return{'id':_0x4f80c8['id']};});}}catch(_0x695b48){_0x15d8d7(_0x695b48);}_0x37495e(_0x5d305f);});}function getInteractionTags(_0x14bee6,_0x5f4852){return new BPromise(function(_0x40c77c,_0x2cece2){try{if(_0x14bee6[_0x6fc2('0x32')]){_0x14bee6[_0x6fc2('0x33')]=[];_0x14bee6[_0x6fc2('0x32')]['split'](',')[_0x6fc2('0x34')](function(_0x276e85){_0x14bee6['Tags'][_0x6fc2('0x35')](_0x5f4852[_0x276e85]);});}delete _0x14bee6[_0x6fc2('0x32')];}catch(_0x36d0a9){_0x2cece2(_0x36d0a9);}_0x40c77c(_0x14bee6);});}function updateOpenchannelInteraction(_0x4b7074,_0x1a82d1,_0x57d6a4){return new BPromise(function(_0x50d067,_0x3c07c3){return getInteractionUsers(_0x4b7074,_0x57d6a4)['then'](function(_0x39b205){return getInteractionTags(_0x39b205,_0x1a82d1);})[_0x6fc2('0x2a')](function(_0x4e4b40){_0x50d067(_0x4e4b40);})[_0x6fc2('0x36')](function(_0x463cda){_0x3c07c3(_0x463cda);});});}exports['index']=function(_0x7aec8,_0xcfac13){var _0x2aca9d={},_0x3bd441={},_0xd2fcc6={'count':0x0,'rows':[]};var _0x3ad5b0=_[_0x6fc2('0x31')](db['OpenchannelInteraction'][_0x6fc2('0x37')],function(_0x5707b5){return{'name':_0x5707b5[_0x6fc2('0x38')],'type':_0x5707b5[_0x6fc2('0x39')][_0x6fc2('0x3a')]};});_0x3bd441[_0x6fc2('0x3b')]=_[_0x6fc2('0x31')](_0x3ad5b0,_0x6fc2('0x2e'));_0x3bd441['query']=_[_0x6fc2('0x3c')](_0x7aec8[_0x6fc2('0x3d')]);_0x3bd441[_0x6fc2('0x3e')]=_['intersection'](_0x3bd441[_0x6fc2('0x3b')],_0x3bd441[_0x6fc2('0x3d')]);_0x2aca9d['attributes']=_['intersection'](_0x3bd441[_0x6fc2('0x3b')],qs[_0x6fc2('0x3f')](_0x7aec8['query'][_0x6fc2('0x3f')]));_0x2aca9d[_0x6fc2('0x40')]=_0x2aca9d[_0x6fc2('0x40')][_0x6fc2('0x41')]?_0x2aca9d[_0x6fc2('0x40')]:_0x3bd441[_0x6fc2('0x3b')];if(!_0x7aec8[_0x6fc2('0x3d')][_0x6fc2('0x42')](_0x6fc2('0x43'))){_0x2aca9d['limit']=qs[_0x6fc2('0x25')](_0x7aec8[_0x6fc2('0x3d')]['limit']);_0x2aca9d['offset']=qs[_0x6fc2('0x24')](_0x7aec8['query'][_0x6fc2('0x24')]);}_0x2aca9d['order']=qs[_0x6fc2('0x44')](_0x7aec8['query'][_0x6fc2('0x44')]);_0x2aca9d[_0x6fc2('0x45')]=qs['filters'](_[_0x6fc2('0x46')](_0x7aec8[_0x6fc2('0x3d')],_0x3bd441[_0x6fc2('0x3e')]));var _0xfe19b5=[];var _0x5a983d=squel['select']()['field']('id')[_0x6fc2('0x47')]('name')[_0x6fc2('0x47')](_0x6fc2('0x48'))[_0x6fc2('0x49')]('tools_tags');var _0x467609=squel[_0x6fc2('0x4a')]()[_0x6fc2('0x47')](_0x6fc2('0x4b'))[_0x6fc2('0x47')]('ui.OpenchannelInteractionId')['from'](_0x6fc2('0x4c'),'ui')[_0x6fc2('0x4d')](_0x6fc2('0x4e'),'u','u.id\x20=\x20ui.UserId');var _0x56fae6=squel['select']()[_0x6fc2('0x49')](_0x6fc2('0x4f'),'i')[_0x6fc2('0x4d')](_0x6fc2('0x50'),'c',_0x6fc2('0x51'))['left_join']('users','o',_0x6fc2('0x52'))[_0x6fc2('0x4d')](_0x6fc2('0x53'),'a','a.id\x20=\x20i.OpenchannelAccountId')[_0x6fc2('0x4d')]('openchannel_messages','me',_0x6fc2('0x54'))[_0x6fc2('0x4d')](_0x6fc2('0x55'),'it',_0x6fc2('0x56'))[_0x6fc2('0x4d')](_0x6fc2('0x57'),'t',_0x6fc2('0x58'));var _0x533b60=squel['expr']();var _0x23b96b=[];var _0x5af564=squel[_0x6fc2('0x59')]();var _0x3bd631;if(_0x7aec8[_0x6fc2('0x3d')]['search']){_0x3bd631=as[_0x6fc2('0x5a')](_0x7aec8[_0x6fc2('0x3d')]['search']);var _0x1d3859=_0x3bd631[_0x6fc2('0x5b')];for(var _0xec13ca=0x0;_0xec13ca<_0x3bd631['conditions'][_0x6fc2('0x41')];_0xec13ca++){var _0x109139=_0x3bd631[_0x6fc2('0x5c')][_0xec13ca];var _0x560ac8='i';var _0x2c0fd6=_[_0x6fc2('0x5d')](_0x3ad5b0,['name',_0x109139[_0x6fc2('0x47')]]);if(!_0x2c0fd6){switch(_0x109139['field']){case _0x6fc2('0x5e'):if(_0x109139[_0x6fc2('0x5f')]==0x1){_0x56fae6['having']('`'+_0x109139[_0x6fc2('0x47')]+'`\x20=\x200');}else{_0x56fae6['having']('`'+_0x109139['field']+_0x6fc2('0x60'));}break;case'Contact':if(_0x109139['operator']==='$substring'){if(_0x109139[_0x6fc2('0x5f')][_0x6fc2('0x61')]('\x20')[_0x6fc2('0x41')]>0x1){_0x533b60[_0x1d3859]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x6fc2('0x62')](_0x109139[_0x6fc2('0x5f')]),null);}else{var _0x331f60='%'+_0x109139['value']+'%';_0x533b60[_0x1d3859]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x331f60,_0x331f60,_0x331f60);}}else{_0x2c0fd6=_[_0x6fc2('0x5d')](_0x3ad5b0,['name',_0x6fc2('0x63')]);_0x109139[_0x6fc2('0x47')]=_0x6fc2('0x63');_0x29162e=as[_0x6fc2('0x64')](_0x560ac8,_0x2c0fd6['type'],_0x109139);_0x533b60[_0x1d3859](_0x29162e[_0x6fc2('0x65')],_0x29162e[_0x6fc2('0x5f')][_0x6fc2('0x66')],_0x29162e[_0x6fc2('0x5f')]['end']);}break;case'Tag':var _0x5870bd=_0x109139[_0x6fc2('0x5f')][_0x6fc2('0x61')](',')['map'](function(_0x325967){return Number(_0x325967);});_0x5870bd['forEach'](function(_0x38470f){_0x5af564['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x38470f+',%');});_0x23b96b=_[_0x6fc2('0x67')](_0x23b96b,_0x5870bd);break;case _0x6fc2('0x68'):if(_0x109139['operator']==='$substring'){_0x533b60[_0x1d3859](_0x6fc2('0x69'),'%'+_0x109139[_0x6fc2('0x5f')]+'%',null);}else{_0x2c0fd6=_['find'](_0x3ad5b0,['name','UserId']);_0x109139['field']=_0x6fc2('0x6a');_0x29162e=as[_0x6fc2('0x64')](_0x560ac8,_0x2c0fd6[_0x6fc2('0x39')],_0x109139);_0x533b60[_0x1d3859](_0x29162e[_0x6fc2('0x65')],_0x29162e['value'][_0x6fc2('0x66')],_0x29162e['value'][_0x6fc2('0x2b')]);}break;case _0x6fc2('0x6b'):_0x29162e=as[_0x6fc2('0x64')]('me',null,_0x109139);_0x533b60[_0x1d3859](_0x29162e['text'],_0x29162e['value'][_0x6fc2('0x66')],_0x29162e[_0x6fc2('0x5f')][_0x6fc2('0x2b')]);break;}}else{var _0x29162e=as['buildExpression'](_0x560ac8,_0x2c0fd6[_0x6fc2('0x39')],_0x109139);_0x533b60[_0x1d3859](_0x29162e['text'],_0x29162e[_0x6fc2('0x5f')][_0x6fc2('0x66')],_0x29162e[_0x6fc2('0x5f')][_0x6fc2('0x2b')]);}}}else{var _0x3ed4e1=_(_0x7aec8[_0x6fc2('0x3d')])[_0x6fc2('0x3c')]()['map'](function(_0x2829e5){return _[_0x6fc2('0x6c')](_0x3ad5b0,[_0x6fc2('0x2e'),_0x2829e5])?_0x2829e5:undefined;})['compact']()[_0x6fc2('0x5f')]();if(!_['isEmpty'](_0x3ed4e1)){_0x3ed4e1['forEach'](function(_0x241e2c){if(_0x241e2c===_0x6fc2('0x6d')){_0x56fae6[_0x6fc2('0x45')](_0x6fc2('0x6e'),[]['concat'](_0x7aec8[_0x6fc2('0x3d')][_0x241e2c]));}else if(_0x241e2c===_0x6fc2('0x6f')){var _0x160c90=JSON[_0x6fc2('0x70')](_0x7aec8[_0x6fc2('0x3d')][_0x241e2c])['$gte'];var _0x1fb733=JSON[_0x6fc2('0x70')](_0x7aec8[_0x6fc2('0x3d')][_0x241e2c])[_0x6fc2('0x71')];_0x56fae6[_0x6fc2('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x160c90,_0x1fb733);}else{if(_0x7aec8['query'][_0x241e2c]==='null'){_0x56fae6[_0x6fc2('0x45')]('i.'+_0x241e2c+_0x6fc2('0x72'));}else{_0x56fae6['where']('i.'+_0x241e2c+_0x6fc2('0x73'),_0x7aec8[_0x6fc2('0x3d')][_0x241e2c]);}}});}if(_0x7aec8[_0x6fc2('0x3d')][_0x6fc2('0x74')]){if(_0x7aec8[_0x6fc2('0x3d')][_0x6fc2('0x74')]==0x1){_0x56fae6[_0x6fc2('0x75')]('`unreadMessages`\x20=\x200');}else{_0x56fae6['having'](_0x6fc2('0x76'));}}if(_0x7aec8[_0x6fc2('0x3d')]['tag']){_0x23b96b=_[_0x6fc2('0x77')](_0x7aec8['query'][_0x6fc2('0x78')])?_0x7aec8['query'][_0x6fc2('0x78')]:new Array(_0x7aec8[_0x6fc2('0x3d')]['tag']);_0x23b96b[_0x6fc2('0x34')](function(_0x31928e){_0x5af564['or'](_0x6fc2('0x79'),'%,'+_0x31928e+',%');});}if(_0x7aec8[_0x6fc2('0x3d')][_0x6fc2('0x7a')]){var _0x40adca=_0x7aec8[_0x6fc2('0x3d')][_0x6fc2('0x7a')][_0x6fc2('0x7b')]('\x5c','\x5c\x5c')[_0x6fc2('0x7b')]('\x27\x27',_0x6fc2('0x7c'));if(qs[_0x6fc2('0x7d')](_0x40adca)){_0x533b60['or']('i.id\x20LIKE\x20?',_0x40adca+'%');}else{_0x533b60['or'](_0x6fc2('0x7e'),qs[_0x6fc2('0x62')](_0x40adca))['or']('i.from\x20LIKE\x20?',_0x40adca+'%')['or'](_0x6fc2('0x7f'),_0x40adca+'%');}}}_0x56fae6['where'](_0x533b60);_0x56fae6[_0x6fc2('0x80')](_0x6fc2('0x81'));var _0xa4724d={'type':db[_0x6fc2('0x82')][_0x6fc2('0x83')][_0x6fc2('0x84')],'raw':!![]};var _0x8d1e67=_0x56fae6[_0x6fc2('0x85')]();_0x8d1e67[_0x6fc2('0x47')]('i.id');_0x8d1e67[_0x6fc2('0x47')](_0x6fc2('0x86'),_0x6fc2('0x5e'));if(_0x2aca9d['order']){_0x2aca9d[_0x6fc2('0x87')][_0x6fc2('0x34')](function(_0x15c79f){_0x56fae6[_0x6fc2('0x87')]('i.'+_0x15c79f[0x0],_0x15c79f[0x1]===_0x6fc2('0x88')?![]:!![]);});}if(!_[_0x6fc2('0x89')](_0x23b96b)){_0x56fae6['having'](_0x5af564);_0x8d1e67[_0x6fc2('0x45')](_0x6fc2('0x8a'),_0x23b96b);}BPromise[_0x6fc2('0x8b')]()[_0x6fc2('0x2a')](function(){if(!_0x3bd631&&_0x7aec8['query']['OpenchannelAccountId'])return;return _0x7aec8[_0x6fc2('0x8c')][_0x6fc2('0x8d')]({'attributes':['id'],'raw':!![]})[_0x6fc2('0x2a')](function(_0x2e2658){if(_[_0x6fc2('0x89')](_0x2e2658)){_0x8d1e67[_0x6fc2('0x45')](_0x6fc2('0x8e'));_0x56fae6['where']('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x8d1e67[_0x6fc2('0x45')](_0x6fc2('0x6e'),_[_0x6fc2('0x31')](_0x2e2658,'id'));_0x56fae6[_0x6fc2('0x45')](_0x6fc2('0x6e'),_['map'](_0x2e2658,'id'));}});})[_0x6fc2('0x2a')](function(){db[_0x6fc2('0x8f')]['query'](_0x8d1e67[_0x6fc2('0x90')](),_0xa4724d)[_0x6fc2('0x2a')](function(_0x1ce065){_0xd2fcc6[_0x6fc2('0x23')]=_0x1ce065['length'];if(_0xd2fcc6[_0x6fc2('0x23')]===0x0)return[];return db[_0x6fc2('0x8f')][_0x6fc2('0x3d')](_0x5a983d[_0x6fc2('0x90')](),_0xa4724d)[_0x6fc2('0x2a')](function(_0x41d279){_0xfe19b5=_[_0x6fc2('0x91')](_0x41d279,'id');_0xa4724d=_[_0x6fc2('0x92')](_0xa4724d,{'model':db[_0x6fc2('0x93')],'mapToModel':!![],'raw':!![],'nest':!![]});_0x56fae6[_0x6fc2('0x47')](_0x6fc2('0x86'),_0x6fc2('0x5e'));_0x56fae6[_0x6fc2('0x47')]('a.key','Account.key');_0x56fae6[_0x6fc2('0x47')]('a.mandatoryDisposition',_0x6fc2('0x94'));_0x56fae6['field'](_0x6fc2('0x95'));_0x56fae6[_0x6fc2('0x47')]('c.firstName',_0x6fc2('0x96'));_0x56fae6[_0x6fc2('0x47')](_0x6fc2('0x97'),'Contact.lastName');_0x56fae6[_0x6fc2('0x47')]('c.email','Contact.email');_0x56fae6[_0x6fc2('0x47')](_0x6fc2('0x98'),_0x6fc2('0x99'));_0x56fae6['field'](_0x6fc2('0x9a'),'Contact.mobile');_0x56fae6[_0x6fc2('0x47')](_0x6fc2('0x9b'),_0x6fc2('0x9c'));_0x56fae6[_0x6fc2('0x47')](_0x6fc2('0x9d'),_0x6fc2('0x32'));_0x56fae6[_0x6fc2('0x25')](_0x2aca9d[_0x6fc2('0x25')]);_0x56fae6[_0x6fc2('0x24')](_0x2aca9d[_0x6fc2('0x24')]);return db['sequelize']['query'](_0x56fae6[_0x6fc2('0x90')](),_0xa4724d);})[_0x6fc2('0x2a')](function(_0x5e6bce){_0x467609['where']('ui.OpenchannelInteractionId\x20IN\x20?',_[_0x6fc2('0x31')](_0x5e6bce,'id'));return db[_0x6fc2('0x8f')][_0x6fc2('0x3d')](_0x467609[_0x6fc2('0x90')](),_0xa4724d)[_0x6fc2('0x2a')](function(_0x11394b){var _0x1088fa=_['groupBy'](_0x11394b,_0x6fc2('0x9e'));var _0x17c8d2=[];_0x5e6bce[_0x6fc2('0x34')](function(_0x325831){_0x17c8d2[_0x6fc2('0x35')](updateOpenchannelInteraction(_0x325831,_0xfe19b5,_0x1088fa));});return BPromise['all'](_0x17c8d2);});});})[_0x6fc2('0x2a')](function(_0xff26c3){_0xd2fcc6[_0x6fc2('0x9f')]=_0xff26c3;return _0xd2fcc6;})[_0x6fc2('0x2a')](respondWithFilteredResult(_0xcfac13,_0x2aca9d));})[_0x6fc2('0x36')](handleError(_0xcfac13,null));};exports['show']=function(_0xd5938d,_0x384a3c){var _0x43f696={'raw':![],'where':{'id':_0xd5938d['params']['id']}},_0x2e9b49={};_0x2e9b49[_0x6fc2('0x3b')]=_[_0x6fc2('0x3c')](db[_0x6fc2('0x93')][_0x6fc2('0x37')]);_0x2e9b49[_0x6fc2('0x3d')]=_['keys'](_0xd5938d['query']);_0x2e9b49[_0x6fc2('0x3e')]=_['intersection'](_0x2e9b49['model'],_0x2e9b49[_0x6fc2('0x3d')]);_0x43f696[_0x6fc2('0x40')]=_[_0x6fc2('0xa0')](_0x2e9b49[_0x6fc2('0x3b')],qs[_0x6fc2('0x3f')](_0xd5938d[_0x6fc2('0x3d')]['fields']));_0x43f696[_0x6fc2('0x40')]=_0x43f696[_0x6fc2('0x40')][_0x6fc2('0x41')]?_0x43f696[_0x6fc2('0x40')]:_0x2e9b49[_0x6fc2('0x3b')];if(_0xd5938d[_0x6fc2('0x3d')][_0x6fc2('0xa1')]){_0x43f696[_0x6fc2('0xa2')]=[{'all':!![]}];}_0x43f696=_[_0x6fc2('0x92')]({},_0x43f696,_0xd5938d['options']);return db[_0x6fc2('0x93')]['find'](_0x43f696)[_0x6fc2('0x2a')](handleEntityNotFound(_0x384a3c,null))[_0x6fc2('0x2a')](respondWithResult(_0x384a3c,null))[_0x6fc2('0x36')](handleError(_0x384a3c,null));};exports[_0x6fc2('0xa3')]=function(_0x52254a,_0x2c0fd1){return db[_0x6fc2('0x93')][_0x6fc2('0xa3')](_0x52254a[_0x6fc2('0x6b')],{})[_0x6fc2('0x2a')](respondWithResult(_0x2c0fd1,0xc9))[_0x6fc2('0x36')](handleError(_0x2c0fd1,null));};exports[_0x6fc2('0xa4')]=function(_0x136479,_0x4c8d81){if(_0x136479['body']['id']){delete _0x136479[_0x6fc2('0x6b')]['id'];}return db[_0x6fc2('0x93')][_0x6fc2('0x5d')]({'where':{'id':_0x136479[_0x6fc2('0xa5')]['id']}})[_0x6fc2('0x2a')](handleEntityNotFound(_0x4c8d81,null))['then'](saveUpdates(_0x136479[_0x6fc2('0x6b')],null))[_0x6fc2('0x2a')](respondWithResult(_0x4c8d81,null))[_0x6fc2('0x36')](handleError(_0x4c8d81,null));};exports[_0x6fc2('0xa6')]=function(_0x4f4d16,_0x8c06a9){return db[_0x6fc2('0x93')][_0x6fc2('0x5d')]({'where':{'id':_0x4f4d16['params']['id']}})[_0x6fc2('0x2a')](handleEntityNotFound(_0x8c06a9,null))[_0x6fc2('0x2a')](removeEntity(_0x8c06a9,null))['catch'](handleError(_0x8c06a9,null));};exports[_0x6fc2('0xa7')]=function(_0x3197f5,_0x585df6){return db['OpenchannelInteraction']['describe']()[_0x6fc2('0x2a')](respondWithResult(_0x585df6,null))[_0x6fc2('0x36')](handleError(_0x585df6,null));};exports[_0x6fc2('0xa8')]=function(_0x859518,_0x3e3396,_0x37b6fd){return db[_0x6fc2('0xa9')][_0x6fc2('0x5d')]({'where':{'id':_0x859518['params']['id']}})['then'](handleEntityNotFound(_0x3e3396,null))['then'](function(_0x32e85e){if(_0x32e85e){return _0x32e85e[_0x6fc2('0xa8')](_0x859518[_0x6fc2('0x6b')]['ids'],_[_0x6fc2('0xaa')](_0x859518[_0x6fc2('0x6b')],['ids','id'])||{});}})[_0x6fc2('0x2a')](respondWithResult(_0x3e3396,null))[_0x6fc2('0x36')](handleError(_0x3e3396,null));};exports['getMessages']=function(_0x5e767b,_0x70c185,_0x240320){var _0x63080d={'raw':![],'where':{}};var _0x521b72={};var _0x42aad4={'count':0x0,'rows':[]};return db[_0x6fc2('0x93')][_0x6fc2('0xab')]({'where':{'id':_0x5e767b['params']['id']}})[_0x6fc2('0x2a')](handleEntityNotFound(_0x70c185,null))[_0x6fc2('0x2a')](function(_0x3ba000){if(_0x3ba000){_0x521b72[_0x6fc2('0x3b')]=_[_0x6fc2('0x3c')](db['OpenchannelMessage'][_0x6fc2('0x37')]);_0x521b72[_0x6fc2('0x3d')]=_[_0x6fc2('0x3c')](_0x5e767b[_0x6fc2('0x3d')]);_0x521b72[_0x6fc2('0x3e')]=_[_0x6fc2('0xa0')](_0x521b72[_0x6fc2('0x3b')],_0x521b72['query']);_0x63080d[_0x6fc2('0x40')]=_['intersection'](_0x521b72[_0x6fc2('0x3b')],qs[_0x6fc2('0x3f')](_0x5e767b[_0x6fc2('0x3d')][_0x6fc2('0x3f')]));_0x63080d['attributes']=_0x63080d[_0x6fc2('0x40')]['length']?_0x63080d[_0x6fc2('0x40')]:_0x521b72[_0x6fc2('0x3b')];if(!_0x5e767b['query']['hasOwnProperty'](_0x6fc2('0x43'))){_0x63080d[_0x6fc2('0x25')]=qs[_0x6fc2('0x25')](_0x5e767b[_0x6fc2('0x3d')]['limit']);_0x63080d[_0x6fc2('0x24')]=qs[_0x6fc2('0x24')](_0x5e767b[_0x6fc2('0x3d')][_0x6fc2('0x24')]);}_0x63080d['order']=qs[_0x6fc2('0x44')](_0x5e767b[_0x6fc2('0x3d')][_0x6fc2('0x44')]);_0x63080d[_0x6fc2('0x45')]=qs[_0x6fc2('0x3e')](_[_0x6fc2('0x46')](_0x5e767b[_0x6fc2('0x3d')],_0x521b72[_0x6fc2('0x3e')]));_0x63080d['where']['OpenchannelInteractionId']=_0x3ba000['id'];if(_0x5e767b[_0x6fc2('0x3d')][_0x6fc2('0x7a')]){_0x63080d[_0x6fc2('0x45')]=_[_0x6fc2('0x92')](_0x63080d[_0x6fc2('0x45')],{'$or':_['map'](_0x63080d[_0x6fc2('0x40')],function(_0x359280){var _0x193d19={};_0x193d19[_0x359280]={'$like':'%'+_0x5e767b[_0x6fc2('0x3d')]['filter']+'%'};return _0x193d19;})});}if(_0x5e767b['query']['$gte']){var _0xe2a073=_0x5e767b[_0x6fc2('0x3d')]['$gte'][_0x6fc2('0x61')](',');var _0x86887c={};_0x86887c[_0xe2a073[0x0]]={'$gte':moment(_0xe2a073[0x1])[_0x6fc2('0xac')](_0x6fc2('0xad'))};_0x63080d['where']=_['merge'](_0x63080d[_0x6fc2('0x45')],_0x86887c);}_0x63080d=_['merge']({},_0x63080d,_0x5e767b[_0x6fc2('0xae')]);return db[_0x6fc2('0xa9')][_0x6fc2('0x23')]({'where':_0x63080d[_0x6fc2('0x45')]})['then'](function(_0x23ada5){_0x42aad4[_0x6fc2('0x23')]=_0x23ada5;if(_0x5e767b[_0x6fc2('0x3d')]['includeAll']){_0x63080d[_0x6fc2('0xa2')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0x6fc2('0xaf')](_0x63080d);})['then'](function(_0x3d16d0){_0x42aad4['rows']=_0x3d16d0;return _0x42aad4;});}})['then'](respondWithFilteredResult(_0x70c185,_0x63080d))[_0x6fc2('0x36')](handleError(_0x70c185,null));};exports['addTags']=function(_0x8d8fbc,_0x325da6,_0x182b87){return db['OpenchannelInteraction'][_0x6fc2('0x5d')]({'where':{'id':_0x8d8fbc[_0x6fc2('0xa5')]['id']}})[_0x6fc2('0x2a')](handleEntityNotFound(_0x325da6,null))[_0x6fc2('0x2a')](function(_0x190e99){if(_0x190e99){return _0x190e99[_0x6fc2('0xb0')](_0x8d8fbc['body'][_0x6fc2('0xb1')],_['omit'](_0x8d8fbc['body'],[_0x6fc2('0xb1'),'id'])||{})[_0x6fc2('0xb2')](function(){return db['Tag'][_0x6fc2('0xaf')]({'attributes':['id',_0x6fc2('0x2e'),_0x6fc2('0x48')],'where':{'id':_0x8d8fbc['body'][_0x6fc2('0xb1')]}});})[_0x6fc2('0x2a')](function(_0x5b9e75){socket['emit'](_0x6fc2('0xb3'),{'id':Number(_0x8d8fbc[_0x6fc2('0xa5')]['id']),'tags':_0x5b9e75||[]});return{'id':Number(_0x8d8fbc[_0x6fc2('0xa5')]['id']),'tags':_0x5b9e75||[]};});}})[_0x6fc2('0x2a')](respondWithResult(_0x325da6,null))[_0x6fc2('0x36')](handleError(_0x325da6,null));};exports[_0x6fc2('0xb4')]=function(_0x56056d,_0x51b6c3,_0x4f01d6){return db['OpenchannelInteraction'][_0x6fc2('0x5d')]({'where':{'id':_0x56056d[_0x6fc2('0xa5')]['id']}})[_0x6fc2('0x2a')](handleEntityNotFound(_0x51b6c3,null))[_0x6fc2('0x2a')](function(_0x20954c){if(_0x20954c){return _0x20954c[_0x6fc2('0xb4')](_0x56056d[_0x6fc2('0x3d')][_0x6fc2('0xb1')]);}})[_0x6fc2('0x2a')](respondWithStatusCode(_0x51b6c3,null))[_0x6fc2('0x36')](handleError(_0x51b6c3,null));};exports['download']=function(_0x5af5d3,_0x5ba7fd){var _0x455295=moment()[_0x6fc2('0xb5')]()[_0x6fc2('0x90')]();var _0x5a24ca=path[_0x6fc2('0xb6')](config[_0x6fc2('0xb7')],_0x6fc2('0xb8'),'files',_0x6fc2('0xb9'));var _0x56ef64=path[_0x6fc2('0xb6')](config[_0x6fc2('0xb7')],_0x6fc2('0xb8'),_0x6fc2('0xba'),_0x6fc2('0xbb'));var _0x37d854=path[_0x6fc2('0xb6')](_0x5a24ca,_0x455295);var _0x1a2418=util[_0x6fc2('0xac')](_0x6fc2('0xbc'),_0x5af5d3[_0x6fc2('0xa5')]['id'],_0x455295);var _0x4eb49e=path[_0x6fc2('0xb6')](_0x5a24ca,_0x1a2418);var _0x1ff71f=![];return db[_0x6fc2('0x93')]['find']({'where':{'id':_0x5af5d3['params']['id']},'include':[{'model':db[_0x6fc2('0xa9')],'as':_0x6fc2('0xbd'),'attributes':['id',_0x6fc2('0x6b'),_0x6fc2('0x6f'),_0x6fc2('0xbe'),_0x6fc2('0xbf'),_0x6fc2('0x74')],'include':[{'model':db[_0x6fc2('0x68')],'as':_0x6fc2('0x68'),'attributes':['id',_0x6fc2('0xc0')],'raw':!![]},{'model':db[_0x6fc2('0xc1')],'as':_0x6fc2('0xc2'),'attributes':['id',_0x6fc2('0xc3'),_0x6fc2('0xc4')],'raw':!![]},{'model':db[_0x6fc2('0xc5')],'as':'Attachment','raw':!![]}]},{'model':db[_0x6fc2('0xc6')],'as':_0x6fc2('0xc7'),'attributes':['id',_0x6fc2('0x2e')]},{'model':db[_0x6fc2('0x68')],'as':_0x6fc2('0xc8'),'attributes':['id',_0x6fc2('0xc0')]}]})[_0x6fc2('0x2a')](handleEntityNotFound(_0x5ba7fd,null))['then'](function(_0x7a861e){if(_0x7a861e){var _0x13e2ac=_0x7a861e[_0x6fc2('0xc9')]({'plain':!![]});_0x1ff71f=!![];var _0x2ed455={'format':'A4','border':_0x6fc2('0xca'),'header':{'height':'40px','contents':{'first':_0x6fc2('0xcb')}},'footer':{'height':_0x6fc2('0xcc'),'contents':{'default':util[_0x6fc2('0xac')]('\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[_0x6fc2('0xac')](_0x6fc2('0xcd'),_0x6fc2('0xce'),_0x13e2ac['id']),moment()[_0x6fc2('0xac')](_0x6fc2('0xcf'))[_0x6fc2('0x90')]())}}};fs[_0x6fc2('0xd0')](_0x37d854);var _0x3e4410={'channel':'Openchannel','account':_0x13e2ac[_0x6fc2('0xc7')][_0x6fc2('0x2e')],'agent':_0x13e2ac[_0x6fc2('0xc8')]?_0x13e2ac[_0x6fc2('0xc8')][_0x6fc2('0xc0')]:'N.A.','createdAt':moment(_0x13e2ac[_0x6fc2('0x6f')])[_0x6fc2('0xac')](_0x6fc2('0xad'))['toString'](),'closedAt':_0x13e2ac[_0x6fc2('0xd1')]?moment(_0x13e2ac[_0x6fc2('0xd2')])[_0x6fc2('0xac')]('YYYY-MM-DD\x20HH:mm:ss')[_0x6fc2('0x90')]():'','disposition':_0x13e2ac[_0x6fc2('0xd3')],'visibility':_0x13e2ac[_0x6fc2('0xd4')]?_0x6fc2('0xd5'):'Private','messages':_(_0x13e2ac['Messages'])[_0x6fc2('0x7a')]({'secret':![]})['map'](function(_0x31588d){if(_0x31588d[_0x6fc2('0xc5')]){var _0x5a89f0=path[_0x6fc2('0xb6')](_0x56ef64,_0x31588d[_0x6fc2('0xc5')]['basename']);if(fs[_0x6fc2('0xd6')](_0x5a89f0)){fs[_0x6fc2('0xd7')](_0x5a89f0)[_0x6fc2('0xd8')](fs['createWriteStream'](path['join'](_0x37d854,_0x31588d[_0x6fc2('0xc5')][_0x6fc2('0xd9')])));}}return{'date':moment(_0x31588d[_0x6fc2('0x6f')])[_0x6fc2('0xac')](_0x6fc2('0xad'))['toString'](),'sender':_0x31588d[_0x6fc2('0xbe')]===_0x6fc2('0xda')?_0x31588d[_0x6fc2('0x68')]?_0x31588d[_0x6fc2('0x68')][_0x6fc2('0xc0')]:_0x6fc2('0xdb'):_0x31588d[_0x6fc2('0xc2')]['firstName']+(_0x31588d[_0x6fc2('0xc2')][_0x6fc2('0xc4')]?'\x20'+_0x31588d[_0x6fc2('0xc2')][_0x6fc2('0xc4')]:''),'body':_0x31588d[_0x6fc2('0xc5')]?_0x31588d['Attachment']['basename']:_0x31588d[_0x6fc2('0x6b')],'direction':_0x31588d[_0x6fc2('0xbe')]==='out'?'A':'C','secret':_0x31588d[_0x6fc2('0xbf')],'read':_0x31588d[_0x6fc2('0x74')],'attachment':_0x31588d[_0x6fc2('0xc5')]};})[_0x6fc2('0x5f')]()};return ejs[_0x6fc2('0xdc')](path[_0x6fc2('0xb6')](config[_0x6fc2('0xb7')],_0x6fc2('0xb8'),'views',_0x6fc2('0xdd')),{'interaction':_0x3e4410})[_0x6fc2('0x2a')](function(_0x20417f){return new BPromise(function(_0x471309,_0x17a293){pdf[_0x6fc2('0xa3')](_0x20417f,_0x2ed455)[_0x6fc2('0xde')](path[_0x6fc2('0xb6')](_0x37d854,_0x6fc2('0xdf')+_0x13e2ac['id']+'-'+_0x455295+_0x6fc2('0xe0')),function(_0x241ecf,_0x29c3c6){if(_0x241ecf)return _0x17a293(_0x241ecf);_0x471309(_0x29c3c6);});});});}})[_0x6fc2('0x2a')](function(){if(_0x1ff71f){return new BPromise(function(_0x3d8420,_0x5df794){zipdir(_0x37d854,{'saveTo':_0x4eb49e},function(_0x20022e,_0x47f2af){if(_0x20022e)return _0x5df794(_0x20022e);return _0x3d8420(_0x47f2af);});})[_0x6fc2('0x2a')](function(){return new BPromise(function(_0x9b13aa,_0x1e3cd1){rimraf(_0x37d854,function(_0x20954f){if(_0x20954f)_0x1e3cd1(_0x20954f);return _0x9b13aa();});});})[_0x6fc2('0x2a')](function(){return _0x5ba7fd['download'](_0x4eb49e,_0x1a2418,function(_0x2732d8){if(_0x2732d8){console['log']('err',_0x2732d8);}else{fs[_0x6fc2('0xe1')](_0x4eb49e);}});});}else{return _0x5ba7fd[_0x6fc2('0x20')](0xc8);}})[_0x6fc2('0x36')](handleError(_0x5ba7fd,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index c558c7a..650df7a 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 _0x85fe=['getUsers','map','findAll','unreadMessages','length','emit','catch','hook','exports','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','remove'];(function(_0x3ac715,_0x46b6aa){var _0x3e228e=function(_0x46303e){while(--_0x46303e){_0x3ac715['push'](_0x3ac715['shift']());}};_0x3e228e(++_0x46b6aa);}(_0x85fe,0xcc));var _0xe85f=function(_0x5a11bf,_0x23217a){_0x5a11bf=_0x5a11bf-0x0;var _0x38a386=_0x85fe[_0x5a11bf];return _0x38a386;};'use strict';var EventEmitter=require(_0xe85f('0x0'));var OpenchannelInteraction=require(_0xe85f('0x1'))['db'][_0xe85f('0x2')];var OpenchannelMessage=require('../../mysqldb')['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xe85f('0x3')](0x0);var events={'afterCreate':_0xe85f('0x4'),'afterUpdate':'update','afterDestroy':_0xe85f('0x5')};function emitEvent(_0x39a51f){return function(_0x5d680d,_0x3e57c1,_0x450d09){_0x5d680d[_0xe85f('0x6')]({'attributes':['id'],'raw':!![]})['then'](function(_0x44d8d3){_0x5d680d['setDataValue']('Users',_0x44d8d3[_0xe85f('0x7')](function(_0x23e185){return{'id':_0x23e185['id']};}));return OpenchannelMessage[_0xe85f('0x8')]({'where':{'OpenchannelInteractionId':_0x5d680d['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x56dd85){_0x5d680d['setDataValue'](_0xe85f('0x9'),_0x56dd85[_0xe85f('0xa')]);OpenchannelInteractionEvents[_0xe85f('0xb')](_0x39a51f+':'+_0x5d680d['id'],_0x5d680d);OpenchannelInteractionEvents[_0xe85f('0xb')](_0x39a51f,_0x5d680d);_0x450d09(null);})[_0xe85f('0xc')](_0x450d09(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0xe85f('0xd')](e,emitEvent(event));}}module[_0xe85f('0xe')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0x1434=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','getUsers','then','setDataValue','map','findAll','length','emit','catch'];(function(_0x37cc52,_0x459a9b){var _0x2b4a90=function(_0xabcfc7){while(--_0xabcfc7){_0x37cc52['push'](_0x37cc52['shift']());}};_0x2b4a90(++_0x459a9b);}(_0x1434,0x123));var _0x4143=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x1434[_0x4c12ec];return _0x3ae42c;};'use strict';var EventEmitter=require(_0x4143('0x0'));var OpenchannelInteraction=require(_0x4143('0x1'))['db'][_0x4143('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x4143('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x4143('0x4')](0x0);var events={'afterCreate':_0x4143('0x5'),'afterUpdate':_0x4143('0x6'),'afterDestroy':'remove'};function emitEvent(_0x587eee){return function(_0x38a058,_0x22d805,_0x16a779){_0x38a058[_0x4143('0x7')]({'attributes':['id'],'raw':!![]})[_0x4143('0x8')](function(_0x199637){_0x38a058[_0x4143('0x9')]('Users',_0x199637[_0x4143('0xa')](function(_0x50b758){return{'id':_0x50b758['id']};}));return OpenchannelMessage[_0x4143('0xb')]({'where':{'OpenchannelInteractionId':_0x38a058['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x25014e){_0x38a058[_0x4143('0x9')]('unreadMessages',_0x25014e[_0x4143('0xc')]);OpenchannelInteractionEvents[_0x4143('0xd')](_0x587eee+':'+_0x38a058['id'],_0x38a058);OpenchannelInteractionEvents[_0x4143('0xd')](_0x587eee,_0x38a058);_0x16a779(null);})[_0x4143('0xe')](_0x16a779(null));};}for(var e in events){if(events[_0x4143('0xf')](e)){var event=events[e];OpenchannelInteraction[_0x4143('0x10')](e,emitEvent(event));}}module[_0x4143('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 020965e..9b8c8f5 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 _0x90b5=['openchannel_interactions','changed','closed','closedAt','format','lodash','../../config/logger','api','moment','bluebird','rimraf','../../config/environment','exports','OpenchannelInteraction'];(function(_0x4828f3,_0x5774b6){var _0x8a2a6=function(_0x5d82dd){while(--_0x5d82dd){_0x4828f3['push'](_0x4828f3['shift']());}};_0x8a2a6(++_0x5774b6);}(_0x90b5,0x139));var _0x590b=function(_0x484f98,_0x1f6f4a){_0x484f98=_0x484f98-0x0;var _0x4a87cf=_0x90b5[_0x484f98];return _0x4a87cf;};'use strict';var _=require(_0x590b('0x0'));var util=require('util');var logger=require(_0x590b('0x1'))(_0x590b('0x2'));var moment=require(_0x590b('0x3'));var BPromise=require(_0x590b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x590b('0x5'));var config=require(_0x590b('0x6'));var attributes=require('./openchannelInteraction.attributes');module[_0x590b('0x7')]=function(_0x2059e4,_0x88a5f9){return _0x2059e4['define'](_0x590b('0x8'),attributes,{'tableName':_0x590b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x3ec156,_0x9c408b,_0x450969){if(_0x3ec156[_0x590b('0xa')](_0x590b('0xb'))){_0x3ec156[_0x590b('0xc')]=moment()[_0x590b('0xd')]('YYYY-MM-DD\x20HH:mm:ss');}_0x450969(null,_0x3ec156);}}});}; \ No newline at end of file +var _0xf072=['closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','request-promise','path','rimraf','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed'];(function(_0x1a00e7,_0x2d5fca){var _0x152b50=function(_0x5bb4f2){while(--_0x5bb4f2){_0x1a00e7['push'](_0x1a00e7['shift']());}};_0x152b50(++_0x2d5fca);}(_0xf072,0x1cf));var _0x2f07=function(_0xc8a8b,_0x19c9ae){_0xc8a8b=_0xc8a8b-0x0;var _0x3a04ca=_0xf072[_0xc8a8b];return _0x3a04ca;};'use strict';var _=require(_0x2f07('0x0'));var util=require(_0x2f07('0x1'));var logger=require(_0x2f07('0x2'))('api');var moment=require(_0x2f07('0x3'));var BPromise=require('bluebird');var rp=require(_0x2f07('0x4'));var fs=require('fs');var path=require(_0x2f07('0x5'));var rimraf=require(_0x2f07('0x6'));var config=require('../../config/environment');var attributes=require(_0x2f07('0x7'));module[_0x2f07('0x8')]=function(_0x3643bb,_0x2e6422){return _0x3643bb[_0x2f07('0x9')](_0x2f07('0xa'),attributes,{'tableName':_0x2f07('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x379b2e,_0x4746c2,_0x2e167){if(_0x379b2e[_0x2f07('0xc')](_0x2f07('0xd'))){_0x379b2e[_0x2f07('0xe')]=moment()[_0x2f07('0xf')](_0x2f07('0x10'));}_0x2e167(null,_0x379b2e);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 3eda606..a814ce5 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 _0xe026=['limit','debug','stringify','catch','AddTagsToOpenchannelInteraction','find','where','addTags','omit','ids','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','register','then','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','error','message','result','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','attributes'];(function(_0x2d9438,_0x224733){var _0x52ce52=function(_0x49bc24){while(--_0x49bc24){_0x2d9438['push'](_0x2d9438['shift']());}};_0x52ce52(++_0x224733);}(_0xe026,0x1cf));var _0x6e02=function(_0x32f7d7,_0x54231b){_0x32f7d7=_0x32f7d7-0x0;var _0x133d09=_0xe026[_0x32f7d7];return _0x133d09;};'use strict';var _=require(_0x6e02('0x0'));var util=require(_0x6e02('0x1'));var moment=require(_0x6e02('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6e02('0x3'));var db=require(_0x6e02('0x4'))['db'];var utils=require(_0x6e02('0x5'));var logger=require(_0x6e02('0x6'))(_0x6e02('0x7'));var config=require('../../config/environment');var jayson=require(_0x6e02('0x8'));var client=jayson[_0x6e02('0x9')]['http']({'port':0x232a});config['redis']=_[_0x6e02('0xa')](config[_0x6e02('0xb')],{'host':_0x6e02('0xc'),'port':0x18eb});var socket=require(_0x6e02('0xd'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x6e02('0xe')](socket);function respondWithRpcPromise(_0x5d9c98,_0x1e9c3f,_0x36960d){return new BPromise(function(_0x22bc7a,_0x4e3b1f){return client['request'](_0x5d9c98,_0x36960d)[_0x6e02('0xf')](function(_0x4d8e63){logger[_0x6e02('0x10')](_0x6e02('0x11'),_0x1e9c3f,_0x6e02('0x12'));logger['debug']('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x1e9c3f,_0x6e02('0x12'),JSON['stringify'](_0x4d8e63));if(_0x4d8e63[_0x6e02('0x13')]){if(_0x4d8e63[_0x6e02('0x13')]['code']===0x1f4){logger[_0x6e02('0x13')](_0x6e02('0x11'),_0x1e9c3f,_0x4d8e63['error'][_0x6e02('0x14')]);return _0x4e3b1f(_0x4d8e63[_0x6e02('0x13')]['message']);}logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x1e9c3f,_0x4d8e63['error']['message']);return _0x22bc7a(_0x4d8e63['error']['message']);}else{logger[_0x6e02('0x10')](_0x6e02('0x11'),_0x1e9c3f,_0x6e02('0x12'));_0x22bc7a(_0x4d8e63[_0x6e02('0x15')]['message']);}})['catch'](function(_0x103459){logger[_0x6e02('0x13')]('OpenchannelInteraction,\x20%s,\x20%s',_0x1e9c3f,_0x103459);_0x4e3b1f(_0x103459);});});}exports[_0x6e02('0x16')]=function(_0x1326ea){var _0x114b24=this;return new Promise(function(_0x57e238,_0x122eed){return db[_0x6e02('0x17')][_0x6e02('0x18')](_0x1326ea[_0x6e02('0x19')],{'raw':_0x1326ea[_0x6e02('0x1a')]?_0x1326ea[_0x6e02('0x1a')][_0x6e02('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1326ea[_0x6e02('0x1a')]?_0x1326ea['options']['where']||null:null,'attributes':_0x1326ea[_0x6e02('0x1a')]?_0x1326ea[_0x6e02('0x1a')][_0x6e02('0x1c')]||null:null,'limit':_0x1326ea['options']?_0x1326ea[_0x6e02('0x1a')][_0x6e02('0x1d')]||null:null})[_0x6e02('0xf')](function(_0x1bdae1){logger['info'](_0x6e02('0x16'),_0x1326ea);logger[_0x6e02('0x1e')]('UpdateOpenchannelInteraction',_0x1326ea,JSON[_0x6e02('0x1f')](_0x1bdae1));_0x57e238(_0x1bdae1);})[_0x6e02('0x20')](function(_0x52a18b){logger[_0x6e02('0x13')]('UpdateOpenchannelInteraction',_0x52a18b[_0x6e02('0x14')],_0x1326ea);_0x122eed(_0x114b24[_0x6e02('0x13')](0x1f4,_0x52a18b['message']));});});};exports[_0x6e02('0x21')]=function(_0xef3fd2){return new Promise(function(_0x13a034,_0x5ad87e){return db[_0x6e02('0x17')][_0x6e02('0x22')]({'where':_0xef3fd2[_0x6e02('0x1a')]?_0xef3fd2[_0x6e02('0x1a')][_0x6e02('0x23')]||null:null})[_0x6e02('0xf')](function(_0x13a119){if(_0x13a119){return _0x13a119[_0x6e02('0x24')](_0xef3fd2[_0x6e02('0x19')]['ids'],_[_0x6e02('0x25')](_0xef3fd2[_0x6e02('0x19')],[_0x6e02('0x26'),'id'])||{});}})[_0x6e02('0x27')](function(_0x4452e5){logger[_0x6e02('0x10')](_0x6e02('0x28'),_0xef3fd2);logger[_0x6e02('0x1e')]('AddTags',_0xef3fd2,JSON['stringify'](_0x4452e5));_0x13a034(_0x4452e5);})[_0x6e02('0x20')](function(_0x4cfebf){logger[_0x6e02('0x13')]('AddTags',_0x4cfebf['message'],_0xef3fd2);_0x5ad87e(_this[_0x6e02('0x13')](0x1f4,_0x4cfebf[_0x6e02('0x14')]));});});}; \ No newline at end of file +var _0xc3c5=['raw','where','limit','debug','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','OpenchannelInteraction','find','addTags','omit','ids','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','./openchannelInteraction.socket','register','then','info','request\x20sent','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','OpenchannelInteraction,\x20%s,\x20%s','result','catch','body','options'];(function(_0x554c61,_0x1c13ed){var _0x43d7e2=function(_0x4e31c2){while(--_0x4e31c2){_0x554c61['push'](_0x554c61['shift']());}};_0x43d7e2(++_0x1c13ed);}(_0xc3c5,0xca));var _0x5c3c=function(_0x125522,_0x30e269){_0x125522=_0x125522-0x0;var _0x2f1760=_0xc3c5[_0x125522];return _0x2f1760;};'use strict';var _=require(_0x5c3c('0x0'));var util=require('util');var moment=require(_0x5c3c('0x1'));var BPromise=require(_0x5c3c('0x2'));var rs=require(_0x5c3c('0x3'));var fs=require('fs');var Redis=require(_0x5c3c('0x4'));var db=require(_0x5c3c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x5c3c('0x6'))(_0x5c3c('0x7'));var config=require(_0x5c3c('0x8'));var jayson=require(_0x5c3c('0x9'));var client=jayson[_0x5c3c('0xa')]['http']({'port':0x232a});config[_0x5c3c('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x5c3c('0xc'))[_0x5c3c('0xd')](socket);function respondWithRpcPromise(_0x4e4ead,_0x16dd82,_0x1de09d){return new BPromise(function(_0x2e1a86,_0x9a0f19){return client['request'](_0x4e4ead,_0x1de09d)[_0x5c3c('0xe')](function(_0x210b8f){logger[_0x5c3c('0xf')]('OpenchannelInteraction,\x20%s,\x20%s',_0x16dd82,_0x5c3c('0x10'));logger['debug'](_0x5c3c('0x11'),_0x16dd82,_0x5c3c('0x10'),JSON[_0x5c3c('0x12')](_0x210b8f));if(_0x210b8f['error']){if(_0x210b8f[_0x5c3c('0x13')]['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x16dd82,_0x210b8f[_0x5c3c('0x13')][_0x5c3c('0x14')]);return _0x9a0f19(_0x210b8f['error'][_0x5c3c('0x14')]);}logger[_0x5c3c('0x13')](_0x5c3c('0x15'),_0x16dd82,_0x210b8f[_0x5c3c('0x13')][_0x5c3c('0x14')]);return _0x2e1a86(_0x210b8f['error'][_0x5c3c('0x14')]);}else{logger[_0x5c3c('0xf')](_0x5c3c('0x15'),_0x16dd82,_0x5c3c('0x10'));_0x2e1a86(_0x210b8f[_0x5c3c('0x16')]['message']);}})[_0x5c3c('0x17')](function(_0x2addde){logger[_0x5c3c('0x13')](_0x5c3c('0x15'),_0x16dd82,_0x2addde);_0x9a0f19(_0x2addde);});});}exports['UpdateOpenchannelInteraction']=function(_0x582d98){var _0x7a9f44=this;return new Promise(function(_0x5b9839,_0x312112){return db['OpenchannelInteraction']['update'](_0x582d98[_0x5c3c('0x18')],{'raw':_0x582d98[_0x5c3c('0x19')]?_0x582d98['options'][_0x5c3c('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x582d98[_0x5c3c('0x19')]?_0x582d98['options'][_0x5c3c('0x1b')]||null:null,'attributes':_0x582d98[_0x5c3c('0x19')]?_0x582d98[_0x5c3c('0x19')]['attributes']||null:null,'limit':_0x582d98[_0x5c3c('0x19')]?_0x582d98[_0x5c3c('0x19')][_0x5c3c('0x1c')]||null:null})[_0x5c3c('0xe')](function(_0x334d5a){logger[_0x5c3c('0xf')]('UpdateOpenchannelInteraction',_0x582d98);logger[_0x5c3c('0x1d')](_0x5c3c('0x1e'),_0x582d98,JSON[_0x5c3c('0x12')](_0x334d5a));_0x5b9839(_0x334d5a);})['catch'](function(_0x405f65){logger[_0x5c3c('0x13')](_0x5c3c('0x1e'),_0x405f65[_0x5c3c('0x14')],_0x582d98);_0x312112(_0x7a9f44[_0x5c3c('0x13')](0x1f4,_0x405f65[_0x5c3c('0x14')]));});});};exports[_0x5c3c('0x1f')]=function(_0x3c0db1){return new Promise(function(_0x408a46,_0x18433f){return db[_0x5c3c('0x20')][_0x5c3c('0x21')]({'where':_0x3c0db1['options']?_0x3c0db1[_0x5c3c('0x19')][_0x5c3c('0x1b')]||null:null})[_0x5c3c('0xe')](function(_0x4b8797){if(_0x4b8797){return _0x4b8797[_0x5c3c('0x22')](_0x3c0db1[_0x5c3c('0x18')]['ids'],_[_0x5c3c('0x23')](_0x3c0db1[_0x5c3c('0x18')],[_0x5c3c('0x24'),'id'])||{});}})['spread'](function(_0x5d387e){logger[_0x5c3c('0xf')](_0x5c3c('0x25'),_0x3c0db1);logger['debug'](_0x5c3c('0x25'),_0x3c0db1,JSON[_0x5c3c('0x12')](_0x5d387e));_0x408a46(_0x5d387e);})[_0x5c3c('0x17')](function(_0x100428){logger[_0x5c3c('0x13')](_0x5c3c('0x25'),_0x100428[_0x5c3c('0x14')],_0x3c0db1);_0x18433f(_this[_0x5c3c('0x13')](0x1f4,_0x100428[_0x5c3c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index ad19ca2..2b55059 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 _0xc06f=['length','./openchannelInteraction.events','save','remove'];(function(_0xff0964,_0x27d242){var _0x4f9a27=function(_0x47ecbe){while(--_0x47ecbe){_0xff0964['push'](_0xff0964['shift']());}};_0x4f9a27(++_0x27d242);}(_0xc06f,0x1bd));var _0xfc06=function(_0x204674,_0x4bcc8d){_0x204674=_0x204674-0x0;var _0x57996c=_0xc06f[_0x204674];return _0x57996c;};'use strict';var OpenchannelInteractionEvents=require(_0xfc06('0x0'));var events=[_0xfc06('0x1'),_0xfc06('0x2'),'update'];function createListener(_0x1993dd,_0x48455f){return function(_0x5e9c27){_0x48455f['emit'](_0x1993dd,_0x5e9c27);};}function removeListener(_0x53ef19,_0x1fd568){return function(){OpenchannelInteractionEvents['removeListener'](_0x53ef19,_0x1fd568);};}exports['register']=function(_0x8510d2){for(var _0x2000fc=0x0,_0x3c494b=events[_0xfc06('0x3')];_0x2000fc<_0x3c494b;_0x2000fc++){var _0x4bcfaf=events[_0x2000fc];var _0x30f7f0=createListener('openchannelInteraction:'+_0x4bcfaf,_0x8510d2);OpenchannelInteractionEvents['on'](_0x4bcfaf,_0x30f7f0);}}; \ No newline at end of file +var _0x717c=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','emit','register'];(function(_0x5e1f4b,_0x50b208){var _0x5ce7b4=function(_0x53d04f){while(--_0x53d04f){_0x5e1f4b['push'](_0x5e1f4b['shift']());}};_0x5ce7b4(++_0x50b208);}(_0x717c,0xf0));var _0xc717=function(_0x357d4a,_0x1b7f38){_0x357d4a=_0x357d4a-0x0;var _0xe51f59=_0x717c[_0x357d4a];return _0xe51f59;};'use strict';var OpenchannelInteractionEvents=require(_0xc717('0x0'));var events=[_0xc717('0x1'),_0xc717('0x2'),'update'];function createListener(_0x44bf62,_0x1a6fe5){return function(_0x539ede){_0x1a6fe5[_0xc717('0x3')](_0x44bf62,_0x539ede);};}function removeListener(_0x2a4166,_0x572a98){return function(){OpenchannelInteractionEvents['removeListener'](_0x2a4166,_0x572a98);};}exports[_0xc717('0x4')]=function(_0x21b3ec){for(var _0x5ad33b=0x0,_0xb00126=events[_0xc717('0x5')];_0x5ad33b<_0xb00126;_0x5ad33b++){var _0x35c0ef=events[_0x5ad33b];var _0x414eca=createListener(_0xc717('0x6')+_0x35c0ef,_0x21b3ec);OpenchannelInteractionEvents['on'](_0x35c0ef,_0x414eca);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index c6061e8..7175b2e 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 _0x1802=['tracked','openchannel','openchannelmessage:create','put','/:id','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','./openchannelMessage.controller','isAuthenticated','/describe','describe','show','post'];(function(_0x1e7784,_0x3cee08){var _0x3ce0c0=function(_0x50c5d2){while(--_0x50c5d2){_0x1e7784['push'](_0x1e7784['shift']());}};_0x3ce0c0(++_0x3cee08);}(_0x1802,0x1e2));var _0x2180=function(_0x58a907,_0x31025b){_0x58a907=_0x58a907-0x0;var _0x1180d8=_0x1802[_0x58a907];return _0x1180d8;};'use strict';var multer=require(_0x2180('0x0'));var util=require(_0x2180('0x1'));var path=require('path');var timeout=require(_0x2180('0x2'));var express=require(_0x2180('0x3'));var router=express['Router']();var auth=require(_0x2180('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2180('0x5'));var controller=require(_0x2180('0x6'));router['get']('/',auth[_0x2180('0x7')](),controller['index']);router['get'](_0x2180('0x8'),auth[_0x2180('0x7')](),controller[_0x2180('0x9')]);router['get']('/:id',auth[_0x2180('0x7')](),controller[_0x2180('0xa')]);router[_0x2180('0xb')]('/',auth[_0x2180('0x7')](),interaction[_0x2180('0xc')](_0x2180('0xd'),_0x2180('0xe')),controller['create']);router[_0x2180('0xf')](_0x2180('0x10'),auth[_0x2180('0x7')](),controller['update']);router[_0x2180('0xf')]('/:id/accept',auth[_0x2180('0x7')](),controller['accept']);router[_0x2180('0xf')]('/:id/reject',auth[_0x2180('0x7')](),controller['reject']);router['delete'](_0x2180('0x10'),auth[_0x2180('0x7')](),controller[_0x2180('0x11')]);module[_0x2180('0x12')]=router; \ No newline at end of file +var _0xb49c=['delete','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','show','tracked','openchannel','openchannelmessage:create','put','update','/:id/accept','accept','/:id/reject'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xb49c,0x10a));var _0xcb49=function(_0x47b9d3,_0x58c7bf){_0x47b9d3=_0x47b9d3-0x0;var _0x2662b9=_0xb49c[_0x47b9d3];return _0x2662b9;};'use strict';var multer=require(_0xcb49('0x0'));var util=require('util');var path=require(_0xcb49('0x1'));var timeout=require(_0xcb49('0x2'));var express=require('express');var router=express[_0xcb49('0x3')]();var auth=require(_0xcb49('0x4'));var interaction=require(_0xcb49('0x5'));var config=require('../../config/environment');var controller=require(_0xcb49('0x6'));router[_0xcb49('0x7')]('/',auth[_0xcb49('0x8')](),controller[_0xcb49('0x9')]);router['get'](_0xcb49('0xa'),auth[_0xcb49('0x8')](),controller[_0xcb49('0xb')]);router['get'](_0xcb49('0xc'),auth[_0xcb49('0x8')](),controller[_0xcb49('0xd')]);router['post']('/',auth[_0xcb49('0x8')](),interaction[_0xcb49('0xe')](_0xcb49('0xf'),_0xcb49('0x10')),controller['create']);router[_0xcb49('0x11')]('/:id',auth[_0xcb49('0x8')](),controller[_0xcb49('0x12')]);router[_0xcb49('0x11')](_0xcb49('0x13'),auth[_0xcb49('0x8')](),controller[_0xcb49('0x14')]);router[_0xcb49('0x11')](_0xcb49('0x15'),auth[_0xcb49('0x8')](),controller['reject']);router[_0xcb49('0x16')](_0xcb49('0xc'),auth[_0xcb49('0x8')](),controller['destroy']);module[_0xcb49('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 5d1f80d..02a5288 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 _0xe475=['sequelize','exports','medium','BOOLEAN','ENUM','out','DATE'];(function(_0x438912,_0x3f7f74){var _0x18112f=function(_0x1b8ac9){while(--_0x1b8ac9){_0x438912['push'](_0x438912['shift']());}};_0x18112f(++_0x3f7f74);}(_0xe475,0x165));var _0x5e47=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe475[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x5e47('0x0'));module[_0x5e47('0x1')]={'body':{'type':Sequelize['TEXT'](_0x5e47('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5e47('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x5e47('0x4')]('in',_0x5e47('0x5')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x5e47('0x6')]}}; \ No newline at end of file +var _0x14d7=['TEXT','medium','BOOLEAN','ENUM','out','sequelize','exports'];(function(_0x2c4a38,_0x10b29e){var _0x4e96ee=function(_0x930921){while(--_0x930921){_0x2c4a38['push'](_0x2c4a38['shift']());}};_0x4e96ee(++_0x10b29e);}(_0x14d7,0x16a));var _0x714d=function(_0x577fa5,_0x1989b4){_0x577fa5=_0x577fa5-0x0;var _0x3c36be=_0x14d7[_0x577fa5];return _0x3c36be;};'use strict';var Sequelize=require(_0x714d('0x0'));module[_0x714d('0x1')]={'body':{'type':Sequelize[_0x714d('0x2')](_0x714d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x714d('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0x714d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x714d('0x5')]('in',_0x714d('0x6')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 69fee43..8f027b0 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 _0x5340=['name','map','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filters','merge','type','VIRTUAL','filter','options','OpenchannelMessage','count','includeAll','include','findAll','show','params','length','body','find','describe','openchannel-interactions','accept','openchannel','read','readAt','format','UserId','CmContact','Contact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','channel','EventManager','acceptmessage','../../config/logger','agent','interaction','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','SIP/%s','event','reject','rejectmessage','html-pdf','zip-dir','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/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','limit','set','Content-Range','json','apply','save','update','destroy'];(function(_0x40042d,_0x3ce810){var _0x3889a1=function(_0x2fdcbb){while(--_0x2fdcbb){_0x40042d['push'](_0x40042d['shift']());}};_0x3889a1(++_0x3ce810);}(_0x5340,0x1b8));var _0x0534=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5340[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x0534('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0534('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x0534('0x2'));var BPromise=require(_0x0534('0x3'));var Mustache=require(_0x0534('0x4'));var util=require(_0x0534('0x5'));var path=require(_0x0534('0x6'));var sox=require(_0x0534('0x7'));var csv=require(_0x0534('0x8'));var ejs=require(_0x0534('0x9'));var fs=require('fs');var _=require(_0x0534('0xa'));var squel=require(_0x0534('0xb'));var crypto=require(_0x0534('0xc'));var jsforce=require(_0x0534('0xd'));var deskjs=require(_0x0534('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0534('0xf'));var Redis=require(_0x0534('0x10'));var authService=require(_0x0534('0x11'));var qs=require(_0x0534('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0534('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x0534('0x14'));var config=require(_0x0534('0x15'));var db=require('../../mysqldb')['db'];config[_0x0534('0x16')]=_[_0x0534('0x17')](config[_0x0534('0x16')],{'host':_0x0534('0x18'),'port':0x18eb});var socket=require(_0x0534('0x19'))(new Redis(config[_0x0534('0x16')]));require('./openchannelMessage.socket')[_0x0534('0x1a')](socket);var jayson=require(_0x0534('0x1b'));var client=jayson[_0x0534('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x0534('0x1c')][_0x0534('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x2e270a,_0x5c6ffb,_0x5418bb){if(_0x5418bb){var _0x43aad2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43aad2[_0x0534('0x1e')](_0x5c6ffb)){return _0x2e270a;}else{throw new db[(_0x0534('0x1f'))]['ValidationError'](_0x0534('0x20'));}}else{return _0x2e270a;}}function respondWithRpcPromise(_0x106306,_0x8c3a93,_0x281159,_0x3b1d84){return new BPromise(function(_0x2337af,_0x2d7668){var _0x4d1e17=_0x3b1d84||client;return _0x4d1e17[_0x0534('0x21')](_0x106306,_0x281159)[_0x0534('0x22')](function(_0x19f591){logger[_0x0534('0x23')](_0x0534('0x24'),_0x8c3a93,_0x0534('0x25'));logger['debug'](_0x0534('0x26'),_0x8c3a93,_0x0534('0x25'),JSON[_0x0534('0x27')](_0x19f591));if(_0x19f591['error']){if(_0x19f591[_0x0534('0x28')][_0x0534('0x29')]===0x1f4){logger['error'](_0x0534('0x24'),_0x8c3a93,_0x19f591[_0x0534('0x28')]['message']);return _0x2d7668(_0x19f591[_0x0534('0x28')]['message']);}logger['error'](_0x0534('0x24'),_0x8c3a93,_0x19f591['error'][_0x0534('0x2a')]);return _0x2337af(_0x19f591[_0x0534('0x28')][_0x0534('0x2a')]);}else{logger[_0x0534('0x23')](_0x0534('0x24'),_0x8c3a93,_0x0534('0x25'));_0x2337af(_0x19f591[_0x0534('0x2b')][_0x0534('0x2a')]);}})[_0x0534('0x2c')](function(_0x126a72){logger['error'](_0x0534('0x24'),_0x8c3a93,_0x126a72);_0x2d7668(_0x126a72);});});}function respondWithStatusCode(_0x29af18,_0x4bb146){_0x4bb146=_0x4bb146||0xcc;return function(_0x726bb3){if(_0x726bb3){return _0x29af18[_0x0534('0x2d')](_0x4bb146);}return _0x29af18[_0x0534('0x2e')](_0x4bb146)[_0x0534('0x2f')]();};}function respondWithResult(_0x2d81fb,_0x125d25){_0x125d25=_0x125d25||0xc8;return function(_0x3923d7){if(_0x3923d7){return _0x2d81fb[_0x0534('0x2e')](_0x125d25)['json'](_0x3923d7);}};}function respondWithFilteredResult(_0xdf707a,_0x5626da){return function(_0x3115bb){if(_0x3115bb){var _0x2ba492=_0x3115bb['count'],_0x424534=_0x5626da['offset'],_0x245fd1=_0x5626da['offset']+_0x5626da[_0x0534('0x30')],_0x4962e9;if(_0x245fd1>=_0x2ba492){_0x245fd1=_0x2ba492;_0x4962e9=0xc8;}else{_0x4962e9=0xce;}_0xdf707a[_0x0534('0x2e')](_0x4962e9);return _0xdf707a[_0x0534('0x31')](_0x0534('0x32'),_0x424534+'-'+_0x245fd1+'/'+_0x2ba492)[_0x0534('0x33')](_0x3115bb);}return null;};}function patchUpdates(_0x16f2b1){return function(_0x5702e6){try{jsonpatch[_0x0534('0x34')](_0x5702e6,_0x16f2b1,!![]);}catch(_0xfe05b4){return BPromise['reject'](_0xfe05b4);}return _0x5702e6[_0x0534('0x35')]();};}function saveUpdates(_0x512e9b,_0x1fae63){return function(_0x4ef557){if(_0x4ef557){return _0x4ef557[_0x0534('0x36')](_0x512e9b)['then'](function(_0x5e8df5){return _0x5e8df5;});}return null;};}function removeEntity(_0x5ce642,_0x2cc886){return function(_0x13cce7){if(_0x13cce7){return _0x13cce7[_0x0534('0x37')]()[_0x0534('0x22')](function(){_0x5ce642[_0x0534('0x2e')](0xcc)[_0x0534('0x2f')]();});}};}function handleEntityNotFound(_0x465763,_0x560974){return function(_0x2157d8){if(!_0x2157d8){_0x465763[_0x0534('0x2d')](0x194);}return _0x2157d8;};}function handleError(_0x462f3b,_0x36539b){_0x36539b=_0x36539b||0x1f4;return function(_0x3bed41){logger['error'](_0x3bed41['stack']);if(_0x3bed41[_0x0534('0x38')]){delete _0x3bed41['name'];}_0x462f3b['status'](_0x36539b)['send'](_0x3bed41);};}exports['index']=function(_0x3c1fce,_0x354b92){var _0x4956e9={},_0x1a7914={},_0x466663={'count':0x0,'rows':[]};var _0x199b1=_[_0x0534('0x39')](db['OpenchannelMessage'][_0x0534('0x3a')],function(_0x1e475a){return{'name':_0x1e475a[_0x0534('0x3b')],'type':_0x1e475a['type'][_0x0534('0x3c')]};});_0x1a7914[_0x0534('0x3d')]=_[_0x0534('0x39')](_0x199b1,_0x0534('0x38'));_0x1a7914[_0x0534('0x3e')]=_[_0x0534('0x3f')](_0x3c1fce[_0x0534('0x3e')]);_0x1a7914['filters']=_[_0x0534('0x40')](_0x1a7914[_0x0534('0x3d')],_0x1a7914['query']);_0x4956e9[_0x0534('0x41')]=_[_0x0534('0x40')](_0x1a7914[_0x0534('0x3d')],qs[_0x0534('0x42')](_0x3c1fce[_0x0534('0x3e')][_0x0534('0x42')]));_0x4956e9['attributes']=_0x4956e9['attributes']['length']?_0x4956e9[_0x0534('0x41')]:_0x1a7914[_0x0534('0x3d')];if(!_0x3c1fce[_0x0534('0x3e')][_0x0534('0x43')](_0x0534('0x44'))){_0x4956e9[_0x0534('0x30')]=qs['limit'](_0x3c1fce[_0x0534('0x3e')][_0x0534('0x30')]);_0x4956e9[_0x0534('0x45')]=qs['offset'](_0x3c1fce[_0x0534('0x3e')][_0x0534('0x45')]);}_0x4956e9[_0x0534('0x46')]=qs[_0x0534('0x47')](_0x3c1fce[_0x0534('0x3e')][_0x0534('0x47')]);_0x4956e9[_0x0534('0x48')]=qs['filters'](_[_0x0534('0x49')](_0x3c1fce['query'],_0x1a7914[_0x0534('0x4a')]));if(_0x3c1fce[_0x0534('0x3e')]['filter']){_0x4956e9[_0x0534('0x48')]=_[_0x0534('0x4b')](_0x4956e9[_0x0534('0x48')],{'$or':_[_0x0534('0x39')](_0x199b1,function(_0x4dfd71){if(_0x4dfd71[_0x0534('0x4c')]!==_0x0534('0x4d')){var _0x4896b2={};_0x4896b2[_0x4dfd71[_0x0534('0x38')]]={'$like':'%'+_0x3c1fce[_0x0534('0x3e')][_0x0534('0x4e')]+'%'};return _0x4896b2;}})});}_0x4956e9=_[_0x0534('0x4b')]({},_0x4956e9,_0x3c1fce[_0x0534('0x4f')]);var _0x3b1e6f={'where':_0x4956e9[_0x0534('0x48')]};return db[_0x0534('0x50')][_0x0534('0x51')](_0x3b1e6f)['then'](function(_0x1c43b1){_0x466663[_0x0534('0x51')]=_0x1c43b1;if(_0x3c1fce[_0x0534('0x3e')][_0x0534('0x52')]){_0x4956e9[_0x0534('0x53')]=[{'all':!![]}];}return db[_0x0534('0x50')][_0x0534('0x54')](_0x4956e9);})[_0x0534('0x22')](function(_0x1c1915){_0x466663['rows']=_0x1c1915;return _0x466663;})['then'](respondWithFilteredResult(_0x354b92,_0x4956e9))[_0x0534('0x2c')](handleError(_0x354b92,null));};exports[_0x0534('0x55')]=function(_0x1ba728,_0x1b61b5){var _0x4591f0={'raw':!![],'where':{'id':_0x1ba728[_0x0534('0x56')]['id']}},_0x45ce33={};_0x45ce33[_0x0534('0x3d')]=_['keys'](db[_0x0534('0x50')][_0x0534('0x3a')]);_0x45ce33['query']=_['keys'](_0x1ba728[_0x0534('0x3e')]);_0x45ce33['filters']=_[_0x0534('0x40')](_0x45ce33[_0x0534('0x3d')],_0x45ce33[_0x0534('0x3e')]);_0x4591f0['attributes']=_[_0x0534('0x40')](_0x45ce33[_0x0534('0x3d')],qs[_0x0534('0x42')](_0x1ba728[_0x0534('0x3e')][_0x0534('0x42')]));_0x4591f0[_0x0534('0x41')]=_0x4591f0[_0x0534('0x41')][_0x0534('0x57')]?_0x4591f0[_0x0534('0x41')]:_0x45ce33[_0x0534('0x3d')];if(_0x1ba728['query'][_0x0534('0x52')]){_0x4591f0[_0x0534('0x53')]=[{'all':!![]}];}_0x4591f0=_[_0x0534('0x4b')]({},_0x4591f0,_0x1ba728['options']);return db[_0x0534('0x50')]['find'](_0x4591f0)[_0x0534('0x22')](handleEntityNotFound(_0x1b61b5,null))[_0x0534('0x22')](respondWithResult(_0x1b61b5,null))['catch'](handleError(_0x1b61b5,null));};exports['create']=function(_0xfba559,_0x7fa7e5){return db['OpenchannelMessage']['create'](_0xfba559[_0x0534('0x58')],{})['then'](respondWithResult(_0x7fa7e5,0xc9))['catch'](handleError(_0x7fa7e5,null));};exports['update']=function(_0x4e5031,_0xea5338){if(_0x4e5031['body']['id']){delete _0x4e5031[_0x0534('0x58')]['id'];}return db[_0x0534('0x50')][_0x0534('0x59')]({'where':{'id':_0x4e5031[_0x0534('0x56')]['id']}})[_0x0534('0x22')](handleEntityNotFound(_0xea5338,null))[_0x0534('0x22')](saveUpdates(_0x4e5031[_0x0534('0x58')],null))[_0x0534('0x22')](respondWithResult(_0xea5338,null))[_0x0534('0x2c')](handleError(_0xea5338,null));};exports[_0x0534('0x37')]=function(_0x8d152,_0x535e29){return db[_0x0534('0x50')][_0x0534('0x59')]({'where':{'id':_0x8d152[_0x0534('0x56')]['id']}})[_0x0534('0x22')](handleEntityNotFound(_0x535e29,null))['then'](removeEntity(_0x535e29,null))[_0x0534('0x2c')](handleError(_0x535e29,null));};exports[_0x0534('0x5a')]=function(_0xf138e,_0x2e6dd7){return db[_0x0534('0x50')][_0x0534('0x5a')]()[_0x0534('0x22')](respondWithResult(_0x2e6dd7,null))[_0x0534('0x2c')](handleError(_0x2e6dd7,null));};var interaction_log=require('../../config/logger')(_0x0534('0x5b'));exports[_0x0534('0x5c')]=function(_0xa45484,_0x5b5a29,_0x2449cb){var _0x525d16={'channel':_0x0534('0x5d')};if(_0xa45484[_0x0534('0x58')]['id']){delete _0xa45484[_0x0534('0x58')]['id'];}_0xa45484[_0x0534('0x58')][_0x0534('0x5e')]=!![];_0xa45484[_0x0534('0x58')][_0x0534('0x5f')]=moment()[_0x0534('0x60')]('YYYY-MM-DD\x20HH:mm:ss');_0xa45484['body'][_0x0534('0x61')]=_0xa45484[_0x0534('0x58')][_0x0534('0x61')]||_0xa45484['user']['id'];return db[_0x0534('0x50')]['find']({'where':{'id':_0xa45484['params']['id'],'UserId':null},'include':[{'model':db[_0x0534('0x62')],'as':_0x0534('0x63')}]})['then'](handleEntityNotFound(_0x5b5a29,null))['then'](saveUpdates(_0xa45484[_0x0534('0x58')],null))['then'](function(_0x5aab81){if(_0x5aab81){_0x525d16[_0x0534('0x2a')]=_0x5aab81[_0x0534('0x64')]({'plain':!![]});return db[_0x0534('0x65')]['find']({'where':{'id':_0x5aab81[_0x0534('0x66')]}});}return null;})['then'](handleEntityNotFound(_0x5b5a29,null))[_0x0534('0x22')](function(_0x2bec32){if(_0x2bec32){return _0x2bec32[_0x0534('0x36')]({'UserId':_0xa45484[_0x0534('0x58')][_0x0534('0x61')],'read1stAt':_[_0x0534('0x67')](_0x2bec32['read1stAt'])?moment()[_0x0534('0x60')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0534('0x22')](function(_0x2ea530){if(_0x2ea530){_0x525d16['interaction']=_0x2ea530[_0x0534('0x64')]({'plain':!![]});interaction_log[_0x0534('0x23')](_0x0534('0x68'),_0xa45484[_0x0534('0x69')]['id'],_0xa45484[_0x0534('0x69')][_0x0534('0x38')],_0xa45484['user'][_0x0534('0x6a')],_0x525d16['interaction']['id'],_0xa45484[_0x0534('0x58')]?JSON[_0x0534('0x27')](_0xa45484['body']):_0x0534('0x6b'));return respondWithRpcPromise(_0x0534('0x6c'),_0x0534('0x6d'),_0x525d16);}return null;})[_0x0534('0x22')](function(_0x3c5059){if(_0x3c5059){if(_0xa45484[_0x0534('0x58')]['manual']){_0x525d16[_0x0534('0x2a')]['interface']=util[_0x0534('0x60')]('SIP/%s',_0xa45484['user'][_0x0534('0x38')]);_0x525d16[_0x0534('0x2a')][_0x0534('0x6e')]=_0x525d16[_0x0534('0x6e')];_0x525d16[_0x0534('0x2a')]['event']=_0x0534('0x5c');return respondWithRpcPromise('EventManager',_0x0534('0x6f'),{'event':_0x0534('0x70'),'message':_0x525d16[_0x0534('0x2a')]},client9002)[_0x0534('0x22')](function(){return _0x525d16;});}return _0x525d16;}return null;})[_0x0534('0x22')](respondWithResult(_0x5b5a29,null))[_0x0534('0x2c')](handleError(_0x5b5a29,null));};var interaction_log=require(_0x0534('0x71'))('openchannel-interactions');exports['reject']=function(_0x5ea07c,_0x16105f,_0x6038d4){var _0x24c8f3={'agent':{},'channel':_0x0534('0x5d')};if(_0x5ea07c[_0x0534('0x58')]['id']){delete _0x5ea07c[_0x0534('0x58')]['id'];}_0x5ea07c[_0x0534('0x58')][_0x0534('0x61')]=_0x5ea07c[_0x0534('0x58')]['UserId']||_0x5ea07c[_0x0534('0x69')]['id'];_0x24c8f3[_0x0534('0x72')]['id']=_0x5ea07c['body'][_0x0534('0x61')];return db[_0x0534('0x50')][_0x0534('0x59')]({'where':{'id':_0x5ea07c[_0x0534('0x56')]['id'],'UserId':null}})[_0x0534('0x22')](handleEntityNotFound(_0x16105f,null))[_0x0534('0x22')](function(_0x57f1b6){if(_0x57f1b6){_0x24c8f3[_0x0534('0x2a')]=_0x57f1b6[_0x0534('0x64')]({'plain':!![]});return db[_0x0534('0x65')][_0x0534('0x59')]({'where':{'id':_0x57f1b6[_0x0534('0x66')]}});}return null;})[_0x0534('0x22')](handleEntityNotFound(_0x16105f,null))[_0x0534('0x22')](function(_0x41fa02){if(_0x41fa02){_0x24c8f3[_0x0534('0x73')]=_0x41fa02[_0x0534('0x64')]({'plain':!![]});interaction_log[_0x0534('0x23')](_0x0534('0x74'),_0x5ea07c[_0x0534('0x69')]['id'],_0x5ea07c[_0x0534('0x69')][_0x0534('0x38')],_0x5ea07c[_0x0534('0x69')][_0x0534('0x6a')],_0x24c8f3[_0x0534('0x73')]['id'],_0x5ea07c[_0x0534('0x58')]?JSON[_0x0534('0x27')](_0x5ea07c[_0x0534('0x58')]):_0x0534('0x6b'));return respondWithRpcPromise(_0x0534('0x75'),_0x0534('0x76'),_0x24c8f3);}return null;})['then'](function(_0x2c59d7){if(_0x2c59d7){_0x2c59d7[_0x0534('0x2a')][_0x0534('0x77')]=util[_0x0534('0x60')](_0x0534('0x78'),_0x5ea07c[_0x0534('0x69')][_0x0534('0x38')]);_0x2c59d7[_0x0534('0x2a')][_0x0534('0x6e')]=_0x24c8f3[_0x0534('0x6e')];_0x2c59d7[_0x0534('0x2a')][_0x0534('0x79')]=_0x0534('0x7a');respondWithRpcPromise(_0x0534('0x6f'),_0x0534('0x6f'),{'event':_0x0534('0x7b'),'message':_0x2c59d7[_0x0534('0x2a')]},client9002);return _0x24c8f3;}return null;})[_0x0534('0x22')](respondWithResult(_0x16105f,null))[_0x0534('0x2c')](handleError(_0x16105f,null));}; \ No newline at end of file +var _0xb294=['event','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','stack','name','send','index','map','OpenchannelMessage','rawAttributes','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','show','params','intersection','includeAll','find','create','body','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','update','isNil','read1stAt','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','acceptMessage','manual','interface','SIP/%s','channel','accept','EventManager','acceptmessage','../../config/logger','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage'];(function(_0x37f40c,_0x22d8d6){var _0x570049=function(_0xbdd286){while(--_0xbdd286){_0x37f40c['push'](_0x37f40c['shift']());}};_0x570049(++_0x22d8d6);}(_0xb294,0x176));var _0x4b29=function(_0x1f412e,_0xf21768){_0x1f412e=_0x1f412e-0x0;var _0x387e2d=_0xb294[_0x1f412e];return _0x387e2d;};'use strict';var pdf=require(_0x4b29('0x0'));var emlformat=require(_0x4b29('0x1'));var rimraf=require(_0x4b29('0x2'));var zipdir=require(_0x4b29('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4b29('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4b29('0x5'));var util=require(_0x4b29('0x6'));var path=require(_0x4b29('0x7'));var sox=require(_0x4b29('0x8'));var csv=require(_0x4b29('0x9'));var ejs=require(_0x4b29('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4b29('0xb'));var crypto=require(_0x4b29('0xc'));var jsforce=require(_0x4b29('0xd'));var deskjs=require(_0x4b29('0xe'));var toCsv=require(_0x4b29('0x9'));var querystring=require(_0x4b29('0xf'));var Papa=require('papaparse');var Redis=require(_0x4b29('0x10'));var authService=require(_0x4b29('0x11'));var qs=require(_0x4b29('0x12'));var as=require(_0x4b29('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x4b29('0x14'));var db=require('../../mysqldb')['db'];config[_0x4b29('0x15')]=_[_0x4b29('0x16')](config['redis'],{'host':_0x4b29('0x17'),'port':0x18eb});var socket=require(_0x4b29('0x18'))(new Redis(config[_0x4b29('0x15')]));require(_0x4b29('0x19'))['register'](socket);var jayson=require(_0x4b29('0x1a'));var client=jayson[_0x4b29('0x1b')][_0x4b29('0x1c')]({'port':0x232c});var client9002=jayson['client'][_0x4b29('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x1e67d8,_0x56bbb4,_0x2eb366){if(_0x2eb366){var _0x27c425=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x27c425[_0x4b29('0x1d')](_0x56bbb4)){return _0x1e67d8;}else{throw new db['Sequelize']['ValidationError'](_0x4b29('0x1e'));}}else{return _0x1e67d8;}}function respondWithRpcPromise(_0x49c0a3,_0x4fc1f6,_0x36cf5e,_0x27333d){return new BPromise(function(_0x202a4e,_0x3ea750){var _0x477aab=_0x27333d||client;return _0x477aab[_0x4b29('0x1f')](_0x49c0a3,_0x36cf5e)[_0x4b29('0x20')](function(_0x40eae1){logger['info'](_0x4b29('0x21'),_0x4fc1f6,'request\x20sent');logger[_0x4b29('0x22')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x4fc1f6,_0x4b29('0x23'),JSON[_0x4b29('0x24')](_0x40eae1));if(_0x40eae1['error']){if(_0x40eae1[_0x4b29('0x25')][_0x4b29('0x26')]===0x1f4){logger[_0x4b29('0x25')](_0x4b29('0x21'),_0x4fc1f6,_0x40eae1[_0x4b29('0x25')][_0x4b29('0x27')]);return _0x3ea750(_0x40eae1[_0x4b29('0x25')][_0x4b29('0x27')]);}logger[_0x4b29('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x4fc1f6,_0x40eae1[_0x4b29('0x25')][_0x4b29('0x27')]);return _0x202a4e(_0x40eae1[_0x4b29('0x25')][_0x4b29('0x27')]);}else{logger[_0x4b29('0x28')](_0x4b29('0x21'),_0x4fc1f6,'request\x20sent');_0x202a4e(_0x40eae1[_0x4b29('0x29')][_0x4b29('0x27')]);}})[_0x4b29('0x2a')](function(_0x2930f7){logger[_0x4b29('0x25')](_0x4b29('0x21'),_0x4fc1f6,_0x2930f7);_0x3ea750(_0x2930f7);});});}function respondWithStatusCode(_0x864f1d,_0x3a60a4){_0x3a60a4=_0x3a60a4||0xcc;return function(_0x13ac5c){if(_0x13ac5c){return _0x864f1d['sendStatus'](_0x3a60a4);}return _0x864f1d[_0x4b29('0x2b')](_0x3a60a4)[_0x4b29('0x2c')]();};}function respondWithResult(_0x31bf7f,_0x39cffd){_0x39cffd=_0x39cffd||0xc8;return function(_0x3d0ce5){if(_0x3d0ce5){return _0x31bf7f[_0x4b29('0x2b')](_0x39cffd)[_0x4b29('0x2d')](_0x3d0ce5);}};}function respondWithFilteredResult(_0x2ba4e2,_0xf3ac3e){return function(_0x3db579){if(_0x3db579){var _0xb2a45e=_0x3db579[_0x4b29('0x2e')],_0x37f9bc=_0xf3ac3e[_0x4b29('0x2f')],_0x181f74=_0xf3ac3e[_0x4b29('0x2f')]+_0xf3ac3e[_0x4b29('0x30')],_0x301af3;if(_0x181f74>=_0xb2a45e){_0x181f74=_0xb2a45e;_0x301af3=0xc8;}else{_0x301af3=0xce;}_0x2ba4e2[_0x4b29('0x2b')](_0x301af3);return _0x2ba4e2[_0x4b29('0x31')](_0x4b29('0x32'),_0x37f9bc+'-'+_0x181f74+'/'+_0xb2a45e)[_0x4b29('0x2d')](_0x3db579);}return null;};}function patchUpdates(_0x2fc6c4){return function(_0x466369){try{jsonpatch[_0x4b29('0x33')](_0x466369,_0x2fc6c4,!![]);}catch(_0x4870e2){return BPromise[_0x4b29('0x34')](_0x4870e2);}return _0x466369[_0x4b29('0x35')]();};}function saveUpdates(_0x315808,_0x1d9552){return function(_0x46339){if(_0x46339){return _0x46339['update'](_0x315808)['then'](function(_0x505115){return _0x505115;});}return null;};}function removeEntity(_0x5748cc,_0x5a99f4){return function(_0xa928a2){if(_0xa928a2){return _0xa928a2['destroy']()[_0x4b29('0x20')](function(){_0x5748cc[_0x4b29('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x430dd7,_0xfa69b){return function(_0x303eb0){if(!_0x303eb0){_0x430dd7['sendStatus'](0x194);}return _0x303eb0;};}function handleError(_0x1ab899,_0x51dab4){_0x51dab4=_0x51dab4||0x1f4;return function(_0x1b507e){logger[_0x4b29('0x25')](_0x1b507e[_0x4b29('0x36')]);if(_0x1b507e[_0x4b29('0x37')]){delete _0x1b507e[_0x4b29('0x37')];}_0x1ab899[_0x4b29('0x2b')](_0x51dab4)[_0x4b29('0x38')](_0x1b507e);};}exports[_0x4b29('0x39')]=function(_0x405d04,_0x58207c){var _0x2d5a32={},_0xae192b={},_0x112e96={'count':0x0,'rows':[]};var _0x4198e9=_[_0x4b29('0x3a')](db[_0x4b29('0x3b')][_0x4b29('0x3c')],function(_0x348714){return{'name':_0x348714['fieldName'],'type':_0x348714['type'][_0x4b29('0x3d')]};});_0xae192b[_0x4b29('0x3e')]=_[_0x4b29('0x3a')](_0x4198e9,_0x4b29('0x37'));_0xae192b[_0x4b29('0x3f')]=_[_0x4b29('0x40')](_0x405d04[_0x4b29('0x3f')]);_0xae192b[_0x4b29('0x41')]=_['intersection'](_0xae192b[_0x4b29('0x3e')],_0xae192b['query']);_0x2d5a32[_0x4b29('0x42')]=_['intersection'](_0xae192b[_0x4b29('0x3e')],qs['fields'](_0x405d04[_0x4b29('0x3f')][_0x4b29('0x43')]));_0x2d5a32[_0x4b29('0x42')]=_0x2d5a32[_0x4b29('0x42')][_0x4b29('0x44')]?_0x2d5a32['attributes']:_0xae192b['model'];if(!_0x405d04[_0x4b29('0x3f')][_0x4b29('0x45')](_0x4b29('0x46'))){_0x2d5a32[_0x4b29('0x30')]=qs[_0x4b29('0x30')](_0x405d04[_0x4b29('0x3f')][_0x4b29('0x30')]);_0x2d5a32[_0x4b29('0x2f')]=qs[_0x4b29('0x2f')](_0x405d04['query'][_0x4b29('0x2f')]);}_0x2d5a32[_0x4b29('0x47')]=qs[_0x4b29('0x48')](_0x405d04[_0x4b29('0x3f')][_0x4b29('0x48')]);_0x2d5a32[_0x4b29('0x49')]=qs[_0x4b29('0x41')](_[_0x4b29('0x4a')](_0x405d04[_0x4b29('0x3f')],_0xae192b['filters']));if(_0x405d04[_0x4b29('0x3f')][_0x4b29('0x4b')]){_0x2d5a32['where']=_[_0x4b29('0x4c')](_0x2d5a32[_0x4b29('0x49')],{'$or':_[_0x4b29('0x3a')](_0x4198e9,function(_0x124ad6){if(_0x124ad6[_0x4b29('0x4d')]!==_0x4b29('0x4e')){var _0x41dbb4={};_0x41dbb4[_0x124ad6['name']]={'$like':'%'+_0x405d04[_0x4b29('0x3f')]['filter']+'%'};return _0x41dbb4;}})});}_0x2d5a32=_[_0x4b29('0x4c')]({},_0x2d5a32,_0x405d04[_0x4b29('0x4f')]);var _0x4d2b1a={'where':_0x2d5a32['where']};return db['OpenchannelMessage'][_0x4b29('0x2e')](_0x4d2b1a)['then'](function(_0x4bf7ec){_0x112e96[_0x4b29('0x2e')]=_0x4bf7ec;if(_0x405d04['query']['includeAll']){_0x2d5a32[_0x4b29('0x50')]=[{'all':!![]}];}return db[_0x4b29('0x3b')][_0x4b29('0x51')](_0x2d5a32);})['then'](function(_0x54adda){_0x112e96[_0x4b29('0x52')]=_0x54adda;return _0x112e96;})[_0x4b29('0x20')](respondWithFilteredResult(_0x58207c,_0x2d5a32))[_0x4b29('0x2a')](handleError(_0x58207c,null));};exports[_0x4b29('0x53')]=function(_0x54f76b,_0x1b689f){var _0x231cba={'raw':!![],'where':{'id':_0x54f76b[_0x4b29('0x54')]['id']}},_0x5b5939={};_0x5b5939[_0x4b29('0x3e')]=_[_0x4b29('0x40')](db[_0x4b29('0x3b')][_0x4b29('0x3c')]);_0x5b5939[_0x4b29('0x3f')]=_[_0x4b29('0x40')](_0x54f76b[_0x4b29('0x3f')]);_0x5b5939[_0x4b29('0x41')]=_[_0x4b29('0x55')](_0x5b5939[_0x4b29('0x3e')],_0x5b5939[_0x4b29('0x3f')]);_0x231cba[_0x4b29('0x42')]=_['intersection'](_0x5b5939[_0x4b29('0x3e')],qs[_0x4b29('0x43')](_0x54f76b[_0x4b29('0x3f')][_0x4b29('0x43')]));_0x231cba[_0x4b29('0x42')]=_0x231cba[_0x4b29('0x42')][_0x4b29('0x44')]?_0x231cba[_0x4b29('0x42')]:_0x5b5939[_0x4b29('0x3e')];if(_0x54f76b[_0x4b29('0x3f')][_0x4b29('0x56')]){_0x231cba[_0x4b29('0x50')]=[{'all':!![]}];}_0x231cba=_[_0x4b29('0x4c')]({},_0x231cba,_0x54f76b[_0x4b29('0x4f')]);return db[_0x4b29('0x3b')][_0x4b29('0x57')](_0x231cba)[_0x4b29('0x20')](handleEntityNotFound(_0x1b689f,null))[_0x4b29('0x20')](respondWithResult(_0x1b689f,null))[_0x4b29('0x2a')](handleError(_0x1b689f,null));};exports[_0x4b29('0x58')]=function(_0x29124d,_0x2fb613){return db['OpenchannelMessage'][_0x4b29('0x58')](_0x29124d[_0x4b29('0x59')],{})[_0x4b29('0x20')](respondWithResult(_0x2fb613,0xc9))[_0x4b29('0x2a')](handleError(_0x2fb613,null));};exports['update']=function(_0x5c6fa1,_0x26e48f){if(_0x5c6fa1[_0x4b29('0x59')]['id']){delete _0x5c6fa1[_0x4b29('0x59')]['id'];}return db[_0x4b29('0x3b')][_0x4b29('0x57')]({'where':{'id':_0x5c6fa1[_0x4b29('0x54')]['id']}})[_0x4b29('0x20')](handleEntityNotFound(_0x26e48f,null))['then'](saveUpdates(_0x5c6fa1['body'],null))[_0x4b29('0x20')](respondWithResult(_0x26e48f,null))[_0x4b29('0x2a')](handleError(_0x26e48f,null));};exports['destroy']=function(_0x2fbf54,_0x366025){return db[_0x4b29('0x3b')][_0x4b29('0x57')]({'where':{'id':_0x2fbf54[_0x4b29('0x54')]['id']}})['then'](handleEntityNotFound(_0x366025,null))[_0x4b29('0x20')](removeEntity(_0x366025,null))[_0x4b29('0x2a')](handleError(_0x366025,null));};exports[_0x4b29('0x5a')]=function(_0x5a90a3,_0x44bbd2){return db[_0x4b29('0x3b')][_0x4b29('0x5a')]()[_0x4b29('0x20')](respondWithResult(_0x44bbd2,null))[_0x4b29('0x2a')](handleError(_0x44bbd2,null));};var interaction_log=require('../../config/logger')(_0x4b29('0x5b'));exports['accept']=function(_0x42eae0,_0x284843,_0x2e954d){var _0xd51375={'channel':_0x4b29('0x5c')};if(_0x42eae0['body']['id']){delete _0x42eae0[_0x4b29('0x59')]['id'];}_0x42eae0[_0x4b29('0x59')][_0x4b29('0x5d')]=!![];_0x42eae0['body'][_0x4b29('0x5e')]=moment()[_0x4b29('0x5f')](_0x4b29('0x60'));_0x42eae0['body']['UserId']=_0x42eae0[_0x4b29('0x59')][_0x4b29('0x61')]||_0x42eae0[_0x4b29('0x62')]['id'];return db['OpenchannelMessage'][_0x4b29('0x57')]({'where':{'id':_0x42eae0[_0x4b29('0x54')]['id'],'UserId':null},'include':[{'model':db[_0x4b29('0x63')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x284843,null))[_0x4b29('0x20')](saveUpdates(_0x42eae0['body'],null))['then'](function(_0x5a310a){if(_0x5a310a){_0xd51375[_0x4b29('0x27')]=_0x5a310a[_0x4b29('0x64')]({'plain':!![]});return db[_0x4b29('0x65')][_0x4b29('0x57')]({'where':{'id':_0x5a310a[_0x4b29('0x66')]}});}return null;})[_0x4b29('0x20')](handleEntityNotFound(_0x284843,null))[_0x4b29('0x20')](function(_0x9df3f5){if(_0x9df3f5){return _0x9df3f5[_0x4b29('0x67')]({'UserId':_0x42eae0[_0x4b29('0x59')][_0x4b29('0x61')],'read1stAt':_[_0x4b29('0x68')](_0x9df3f5[_0x4b29('0x69')])?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x4b29('0x20')](function(_0x285149){if(_0x285149){_0xd51375[_0x4b29('0x6a')]=_0x285149['get']({'plain':!![]});interaction_log[_0x4b29('0x28')](_0x4b29('0x6b'),_0x42eae0[_0x4b29('0x62')]['id'],_0x42eae0[_0x4b29('0x62')][_0x4b29('0x37')],_0x42eae0[_0x4b29('0x62')]['role'],_0xd51375[_0x4b29('0x6a')]['id'],_0x42eae0[_0x4b29('0x59')]?JSON['stringify'](_0x42eae0[_0x4b29('0x59')]):'null');return respondWithRpcPromise('AcceptMessage',_0x4b29('0x6c'),_0xd51375);}return null;})[_0x4b29('0x20')](function(_0x1ca9c5){if(_0x1ca9c5){if(_0x42eae0[_0x4b29('0x59')][_0x4b29('0x6d')]){_0xd51375[_0x4b29('0x27')][_0x4b29('0x6e')]=util[_0x4b29('0x5f')](_0x4b29('0x6f'),_0x42eae0[_0x4b29('0x62')][_0x4b29('0x37')]);_0xd51375['message']['channel']=_0xd51375[_0x4b29('0x70')];_0xd51375[_0x4b29('0x27')]['event']=_0x4b29('0x71');return respondWithRpcPromise(_0x4b29('0x72'),_0x4b29('0x72'),{'event':_0x4b29('0x73'),'message':_0xd51375[_0x4b29('0x27')]},client9002)[_0x4b29('0x20')](function(){return _0xd51375;});}return _0xd51375;}return null;})[_0x4b29('0x20')](respondWithResult(_0x284843,null))[_0x4b29('0x2a')](handleError(_0x284843,null));};var interaction_log=require(_0x4b29('0x74'))(_0x4b29('0x5b'));exports[_0x4b29('0x34')]=function(_0x49cda4,_0xc3cef3,_0x3a250b){var _0x4b663c={'agent':{},'channel':_0x4b29('0x5c')};if(_0x49cda4[_0x4b29('0x59')]['id']){delete _0x49cda4[_0x4b29('0x59')]['id'];}_0x49cda4[_0x4b29('0x59')]['UserId']=_0x49cda4['body'][_0x4b29('0x61')]||_0x49cda4[_0x4b29('0x62')]['id'];_0x4b663c['agent']['id']=_0x49cda4[_0x4b29('0x59')][_0x4b29('0x61')];return db[_0x4b29('0x3b')][_0x4b29('0x57')]({'where':{'id':_0x49cda4['params']['id'],'UserId':null}})[_0x4b29('0x20')](handleEntityNotFound(_0xc3cef3,null))[_0x4b29('0x20')](function(_0x361aa1){if(_0x361aa1){_0x4b663c[_0x4b29('0x27')]=_0x361aa1[_0x4b29('0x64')]({'plain':!![]});return db[_0x4b29('0x65')][_0x4b29('0x57')]({'where':{'id':_0x361aa1[_0x4b29('0x66')]}});}return null;})[_0x4b29('0x20')](handleEntityNotFound(_0xc3cef3,null))[_0x4b29('0x20')](function(_0x595663){if(_0x595663){_0x4b663c[_0x4b29('0x6a')]=_0x595663['get']({'plain':!![]});interaction_log[_0x4b29('0x28')](_0x4b29('0x75'),_0x49cda4['user']['id'],_0x49cda4[_0x4b29('0x62')][_0x4b29('0x37')],_0x49cda4[_0x4b29('0x62')][_0x4b29('0x76')],_0x4b663c[_0x4b29('0x6a')]['id'],_0x49cda4[_0x4b29('0x59')]?JSON[_0x4b29('0x24')](_0x49cda4[_0x4b29('0x59')]):_0x4b29('0x77'));return respondWithRpcPromise(_0x4b29('0x78'),_0x4b29('0x79'),_0x4b663c);}return null;})['then'](function(_0x3f74a9){if(_0x3f74a9){_0x3f74a9[_0x4b29('0x27')][_0x4b29('0x6e')]=util[_0x4b29('0x5f')]('SIP/%s',_0x49cda4[_0x4b29('0x62')][_0x4b29('0x37')]);_0x3f74a9['message']['channel']=_0x4b663c['channel'];_0x3f74a9[_0x4b29('0x27')][_0x4b29('0x7a')]='reject';respondWithRpcPromise(_0x4b29('0x72'),_0x4b29('0x72'),{'event':_0x4b29('0x7b'),'message':_0x3f74a9[_0x4b29('0x27')]},client9002);return _0x4b663c;}return null;})[_0x4b29('0x20')](respondWithResult(_0xc3cef3,null))[_0x4b29('0x2a')](handleError(_0xc3cef3,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index d557a6c..d04bb88 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 _0xb7fe=['exports','events','../../mysqldb','OpenchannelMessage','save','update','remove','emit'];(function(_0x490d59,_0x3a3c75){var _0x1738be=function(_0x580880){while(--_0x580880){_0x490d59['push'](_0x490d59['shift']());}};_0x1738be(++_0x3a3c75);}(_0xb7fe,0xe1));var _0xeb7f=function(_0x3a3dfd,_0x3bc09e){_0x3a3dfd=_0x3a3dfd-0x0;var _0x1a7afb=_0xb7fe[_0x3a3dfd];return _0x1a7afb;};'use strict';var EventEmitter=require(_0xeb7f('0x0'));var OpenchannelMessage=require(_0xeb7f('0x1'))['db'][_0xeb7f('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb7f('0x3'),'afterUpdate':_0xeb7f('0x4'),'afterDestroy':_0xeb7f('0x5')};function emitEvent(_0x2697aa){return function(_0x303e75,_0x27135f,_0x624714){OpenchannelMessageEvents[_0xeb7f('0x6')](_0x2697aa+':'+_0x303e75['id'],_0x303e75);OpenchannelMessageEvents['emit'](_0x2697aa,_0x303e75);_0x624714(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xeb7f('0x7')]=OpenchannelMessageEvents; \ No newline at end of file +var _0x28a6=['events','../../mysqldb','remove','emit','hasOwnProperty','hook'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x28a6,0xc0));var _0x628a=function(_0x54a9e3,_0x4a3813){_0x54a9e3=_0x54a9e3-0x0;var _0x247cce=_0x28a6[_0x54a9e3];return _0x247cce;};'use strict';var EventEmitter=require(_0x628a('0x0'));var OpenchannelMessage=require(_0x628a('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x628a('0x2')};function emitEvent(_0x36344d){return function(_0x3d9210,_0x17ae49,_0xd48355){OpenchannelMessageEvents[_0x628a('0x3')](_0x36344d+':'+_0x3d9210['id'],_0x3d9210);OpenchannelMessageEvents[_0x628a('0x3')](_0x36344d,_0x3d9210);_0xd48355(null);};}for(var e in events){if(events[_0x628a('0x4')](e)){var event=events[e];OpenchannelMessage[_0x628a('0x5')](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 e3672c9..f79c932 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 _0x688e=['omit','Contact','method','GET','POST','OpenchannelMessage,\x20%s,\x20%s','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','openchannel_messages','body','models','get','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','error','CmContact','describe','OpenchannelAccount','OpenchannelAccountId','Interactions','info','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction'];(function(_0x2145c0,_0x549319){var _0x4c613a=function(_0x4e7350){while(--_0x4e7350){_0x2145c0['push'](_0x2145c0['shift']());}};_0x4c613a(++_0x549319);}(_0x688e,0x6d));var _0xe688=function(_0x484c0e,_0x46a1f3){_0x484c0e=_0x484c0e-0x0;var _0x1e1985=_0x688e[_0x484c0e];return _0x1e1985;};'use strict';var _=require(_0xe688('0x0'));var util=require(_0xe688('0x1'));var logger=require(_0xe688('0x2'))(_0xe688('0x3'));var moment=require(_0xe688('0x4'));var BPromise=require('bluebird');var rp=require(_0xe688('0x5'));var fs=require('fs');var path=require(_0xe688('0x6'));var rimraf=require(_0xe688('0x7'));var config=require(_0xe688('0x8'));var attributes=require(_0xe688('0x9'));module[_0xe688('0xa')]=function(_0xb9d846,_0x3a5e05){return _0xb9d846['define']('OpenchannelMessage',attributes,{'tableName':_0xe688('0xb'),'paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xe688('0xc')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x21aa86,_0x5373e0,_0xcd16e5){var _0x567613=_0xb9d846[_0xe688('0xd')];var _0x2e9886=_0x21aa86[_0xe688('0xe')]({'plain':!![]});if(_0x2e9886[_0xe688('0xf')][_0xe688('0x10')]()==='in'||_0x2e9886[_0xe688('0xf')][_0xe688('0x10')]()===_0xe688('0x11')&&!_0x2e9886[_0xe688('0x12')]&&!_[_0xe688('0x13')](_0x2e9886['UserId'])){_0x567613[_0xe688('0x14')][_0xe688('0x15')]({'where':{'id':_0x2e9886[_0xe688('0x16')]}})[_0xe688('0x17')](function(_0x53ec60){if(_0x53ec60){_0x53ec60[_0xe688('0x18')]({'lastMsgAt':_0x2e9886['createdAt'],'lastMsgDirection':_0x2e9886[_0xe688('0xf')][_0xe688('0x10')]()});}})[_0xe688('0x19')](function(_0x998398){console[_0xe688('0x1a')](_0x998398);});}if(_0x2e9886[_0xe688('0xf')]===_0xe688('0x11')&&!_0x2e9886['secret']){var _0x392680;_0x567613[_0xe688('0x1b')][_0xe688('0x1c')]()[_0xe688('0x17')](function(_0x2cd13c){return _0x567613[_0xe688('0x1d')]['find']({'where':{'id':_0x2e9886[_0xe688('0x1e')]},'include':[{'model':_0x567613[_0xe688('0x14')],'as':_0xe688('0x1f'),'where':{'id':_0x2e9886[_0xe688('0x16')]},'limit':0x1,'include':[{'model':_0x567613[_0xe688('0x1b')],'as':'Contact','attributes':_['keys'](_0x2cd13c)}]}]});})[_0xe688('0x17')](function(_0x5cf65c){_0x392680=_0x5cf65c[_0xe688('0xe')]({'plain':!![]});if(_0x392680&&_0x392680['replyUri']){logger[_0xe688('0x20')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xe688('0x21')](_0xe688('0x22'),_0x2e9886['id'],_0x392680[_0xe688('0x23')]));if(_0x392680['Interactions']&&_0x392680[_0xe688('0x1f')][_0xe688('0x24')]){_0x2e9886[_0xe688('0x25')]=_[_0xe688('0x26')](_0x392680['Interactions'][0x0],'Contact');_0x2e9886['Contact']=_0x392680[_0xe688('0x1f')][0x0][_0xe688('0x27')];}var _0x5373e0={'method':'POST','uri':encodeURI(_0x392680['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x5373e0[_0xe688('0x28')]){case _0xe688('0x29'):_0x5373e0['qs']=_0x2e9886;break;case _0xe688('0x2a'):_0x5373e0['body']=_0x2e9886;break;}return rp(_0x5373e0)[_0xe688('0x17')](function(_0x26dbd3){logger[_0xe688('0x20')](_0xe688('0x2b'),_0xe688('0x2c'),util['format'](_0xe688('0x2d'),_0x2e9886['id'],_0x392680[_0xe688('0x23')]));if(_0x26dbd3['body'][_0xe688('0x2e')]&&_0x26dbd3[_0xe688('0xc')][_0xe688('0x2e')]!=_0x2e9886[_0xe688('0x25')][_0xe688('0x2e')]){return _0x567613['OpenchannelInteraction'][_0xe688('0x18')]({'threadId':_0x26dbd3[_0xe688('0xc')][_0xe688('0x2e')]},{'logging':!![],'where':{'id':_0x2e9886[_0xe688('0x25')]['id']}});}else{return;}})[_0xe688('0x17')](function(){return _0x21aa86['update']({'read':!![]});})[_0xe688('0x19')](function(_0x4f9c4f){logger[_0xe688('0x1a')]('OpenchannelMessage,\x20%s,\x20%s',_0xe688('0x2c'),util[_0xe688('0x2f')](_0x4f9c4f,{'showHidden':![],'depth':null}));_0xcd16e5();});}else{_0xcd16e5();}})['finally'](function(){_0xcd16e5();});}else{_0xcd16e5();}}},'charset':_0xe688('0x30'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x06cd=['lodash','util','../../config/logger','request-promise','path','rimraf','./openchannelMessage.attributes','exports','OpenchannelMessage','fti_openchannel_messages','body','FULLTEXT','models','direction','out','secret','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','createdAt','toLowerCase','catch','error','CmContact','describe','find','OpenchannelAccountId','Interactions','keys','get','replyUri','info','format','Forwarding\x20message\x20%d\x20to\x20%s','length','Interaction','omit','Contact','method','GET','POST','afterCreate','Message\x20%d\x20forwarded\x20to\x20%s','threadId','inspect','utf8mb4_unicode_ci'];(function(_0x4c3cda,_0x4aa3e7){var _0xf33348=function(_0x574059){while(--_0x574059){_0x4c3cda['push'](_0x4c3cda['shift']());}};_0xf33348(++_0x4aa3e7);}(_0x06cd,0xf0));var _0xd06c=function(_0x2e763a,_0x3cfda7){_0x2e763a=_0x2e763a-0x0;var _0x3dbb5b=_0x06cd[_0x2e763a];return _0x3dbb5b;};'use strict';var _=require(_0xd06c('0x0'));var util=require(_0xd06c('0x1'));var logger=require(_0xd06c('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xd06c('0x3'));var fs=require('fs');var path=require(_0xd06c('0x4'));var rimraf=require(_0xd06c('0x5'));var config=require('../../config/environment');var attributes=require(_0xd06c('0x6'));module[_0xd06c('0x7')]=function(_0x3409b6,_0x2cbfaa){return _0x3409b6['define'](_0xd06c('0x8'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':_0xd06c('0x9'),'fields':[_0xd06c('0xa')],'type':_0xd06c('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1a9e13,_0x4ce9d0,_0x3aa3a3){var _0x4d9040=_0x3409b6[_0xd06c('0xc')];var _0x5ba03e=_0x1a9e13['get']({'plain':!![]});if(_0x5ba03e[_0xd06c('0xd')]['toLowerCase']()==='in'||_0x5ba03e[_0xd06c('0xd')]['toLowerCase']()===_0xd06c('0xe')&&!_0x5ba03e[_0xd06c('0xf')]&&!_['isNil'](_0x5ba03e['UserId'])){_0x4d9040[_0xd06c('0x10')][_0xd06c('0x11')]({'where':{'id':_0x5ba03e[_0xd06c('0x12')]}})[_0xd06c('0x13')](function(_0x196575){if(_0x196575){_0x196575[_0xd06c('0x14')]({'lastMsgAt':_0x5ba03e[_0xd06c('0x15')],'lastMsgDirection':_0x5ba03e[_0xd06c('0xd')][_0xd06c('0x16')]()});}})[_0xd06c('0x17')](function(_0x59f71c){console[_0xd06c('0x18')](_0x59f71c);});}if(_0x5ba03e[_0xd06c('0xd')]===_0xd06c('0xe')&&!_0x5ba03e[_0xd06c('0xf')]){var _0x141e2b;_0x4d9040[_0xd06c('0x19')][_0xd06c('0x1a')]()[_0xd06c('0x13')](function(_0x12dde0){return _0x4d9040['OpenchannelAccount'][_0xd06c('0x1b')]({'where':{'id':_0x5ba03e[_0xd06c('0x1c')]},'include':[{'model':_0x4d9040[_0xd06c('0x10')],'as':_0xd06c('0x1d'),'where':{'id':_0x5ba03e[_0xd06c('0x12')]},'limit':0x1,'include':[{'model':_0x4d9040[_0xd06c('0x19')],'as':'Contact','attributes':_[_0xd06c('0x1e')](_0x12dde0)}]}]});})[_0xd06c('0x13')](function(_0x5737a8){_0x141e2b=_0x5737a8[_0xd06c('0x1f')]({'plain':!![]});if(_0x141e2b&&_0x141e2b[_0xd06c('0x20')]){logger[_0xd06c('0x21')]('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xd06c('0x22')](_0xd06c('0x23'),_0x5ba03e['id'],_0x141e2b[_0xd06c('0x20')]));if(_0x141e2b[_0xd06c('0x1d')]&&_0x141e2b[_0xd06c('0x1d')][_0xd06c('0x24')]){_0x5ba03e[_0xd06c('0x25')]=_[_0xd06c('0x26')](_0x141e2b['Interactions'][0x0],_0xd06c('0x27'));_0x5ba03e['Contact']=_0x141e2b[_0xd06c('0x1d')][0x0][_0xd06c('0x27')];}var _0x4ce9d0={'method':'POST','uri':encodeURI(_0x141e2b[_0xd06c('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x4ce9d0[_0xd06c('0x28')]){case _0xd06c('0x29'):_0x4ce9d0['qs']=_0x5ba03e;break;case _0xd06c('0x2a'):_0x4ce9d0[_0xd06c('0xa')]=_0x5ba03e;break;}return rp(_0x4ce9d0)['then'](function(_0x136e69){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xd06c('0x2b'),util['format'](_0xd06c('0x2c'),_0x5ba03e['id'],_0x141e2b[_0xd06c('0x20')]));if(_0x136e69['body'][_0xd06c('0x2d')]&&_0x136e69['body'][_0xd06c('0x2d')]!=_0x5ba03e[_0xd06c('0x25')]['threadId']){return _0x4d9040[_0xd06c('0x10')][_0xd06c('0x14')]({'threadId':_0x136e69[_0xd06c('0xa')][_0xd06c('0x2d')]},{'logging':!![],'where':{'id':_0x5ba03e[_0xd06c('0x25')]['id']}});}else{return;}})[_0xd06c('0x13')](function(){return _0x1a9e13[_0xd06c('0x14')]({'read':!![]});})['catch'](function(_0xc3461b){logger['error']('OpenchannelMessage,\x20%s,\x20%s','afterCreate',util[_0xd06c('0x2e')](_0xc3461b,{'showHidden':![],'depth':null}));_0x3aa3a3();});}else{_0x3aa3a3();}})['finally'](function(){_0x3aa3a3();});}else{_0x3aa3a3();}}},'charset':'utf8mb4','collate':_0xd06c('0x2f')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 294e6c7..586cced 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 _0x7a54=['../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateOpenchannelMessage','OpenchannelMessage','body','options','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x462401,_0x13a1c1){var _0x51a6e1=function(_0x2f0d99){while(--_0x2f0d99){_0x462401['push'](_0x462401['shift']());}};_0x51a6e1(++_0x13a1c1);}(_0x7a54,0x106));var _0x47a5=function(_0x2d720c,_0x8055e3){_0x2d720c=_0x2d720c-0x0;var _0x302a1f=_0x7a54[_0x2d720c];return _0x302a1f;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var moment=require(_0x47a5('0x2'));var BPromise=require('bluebird');var rs=require(_0x47a5('0x3'));var fs=require('fs');var Redis=require(_0x47a5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x47a5('0x5'));var logger=require(_0x47a5('0x6'))(_0x47a5('0x7'));var config=require(_0x47a5('0x8'));var jayson=require(_0x47a5('0x9'));var client=jayson['client'][_0x47a5('0xa')]({'port':0x232a});config['redis']=_[_0x47a5('0xb')](config[_0x47a5('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0xd'))(new Redis(config['redis']));require('./openchannelMessage.socket')['register'](socket);function respondWithRpcPromise(_0x2a0e98,_0x2baee7,_0x5e31dd){return new BPromise(function(_0x2eb0dd,_0x49e844){return client['request'](_0x2a0e98,_0x5e31dd)[_0x47a5('0xe')](function(_0x69e4d4){logger[_0x47a5('0xf')](_0x47a5('0x10'),_0x2baee7,_0x47a5('0x11'));logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x2baee7,'request\x20sent',JSON[_0x47a5('0x14')](_0x69e4d4));if(_0x69e4d4[_0x47a5('0x15')]){if(_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x16')]===0x1f4){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x49e844(_0x69e4d4['error'][_0x47a5('0x17')]);}logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x69e4d4[_0x47a5('0x15')][_0x47a5('0x17')]);return _0x2eb0dd(_0x69e4d4['error']['message']);}else{logger[_0x47a5('0xf')]('OpenchannelMessage,\x20%s,\x20%s',_0x2baee7,'request\x20sent');_0x2eb0dd(_0x69e4d4[_0x47a5('0x18')][_0x47a5('0x17')]);}})[_0x47a5('0x19')](function(_0x1ef371){logger[_0x47a5('0x15')](_0x47a5('0x10'),_0x2baee7,_0x1ef371);_0x49e844(_0x1ef371);});});}exports[_0x47a5('0x1a')]=function(_0xe3c618){var _0x3aed38=this;return new Promise(function(_0x4a9fcb,_0x1570bc){return db[_0x47a5('0x1b')]['create'](_0xe3c618[_0x47a5('0x1c')],{'raw':_0xe3c618[_0x47a5('0x1d')]?_0xe3c618[_0x47a5('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x47a5('0xe')](function(_0x2f142b){logger[_0x47a5('0xf')](_0x47a5('0x1a'),_0xe3c618);logger['debug'](_0x47a5('0x1a'),_0xe3c618,JSON[_0x47a5('0x14')](_0x2f142b));_0x4a9fcb(_0x2f142b);})['catch'](function(_0x28747d){logger[_0x47a5('0x15')](_0x47a5('0x1a'),_0x28747d[_0x47a5('0x17')],_0xe3c618);_0x1570bc(_0x3aed38[_0x47a5('0x15')](0x1f4,_0x28747d['message']));});});}; \ No newline at end of file +var _0x7da6=['request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','register','request','info','OpenchannelMessage,\x20%s,\x20%s'];(function(_0x33eba2,_0x1a1b94){var _0x4d1d64=function(_0x464524){while(--_0x464524){_0x33eba2['push'](_0x33eba2['shift']());}};_0x4d1d64(++_0x1a1b94);}(_0x7da6,0x124));var _0x67da=function(_0x1f239e,_0x367b43){_0x1f239e=_0x1f239e-0x0;var _0x826971=_0x7da6[_0x1f239e];return _0x826971;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x67da('0x0'));var BPromise=require(_0x67da('0x1'));var rs=require(_0x67da('0x2'));var fs=require('fs');var Redis=require(_0x67da('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x67da('0x4'));var logger=require(_0x67da('0x5'))(_0x67da('0x6'));var config=require(_0x67da('0x7'));var jayson=require(_0x67da('0x8'));var client=jayson[_0x67da('0x9')]['http']({'port':0x232a});config[_0x67da('0xa')]=_['defaults'](config['redis'],{'host':_0x67da('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x67da('0xa')]));require('./openchannelMessage.socket')[_0x67da('0xc')](socket);function respondWithRpcPromise(_0x391299,_0x3791cb,_0x2b8f3a){return new BPromise(function(_0x7adba5,_0x26198c){return client[_0x67da('0xd')](_0x391299,_0x2b8f3a)['then'](function(_0x5bfa4f){logger[_0x67da('0xe')](_0x67da('0xf'),_0x3791cb,_0x67da('0x10'));logger[_0x67da('0x11')](_0x67da('0x12'),_0x3791cb,'request\x20sent',JSON[_0x67da('0x13')](_0x5bfa4f));if(_0x5bfa4f[_0x67da('0x14')]){if(_0x5bfa4f[_0x67da('0x14')][_0x67da('0x15')]===0x1f4){logger[_0x67da('0x14')]('OpenchannelMessage,\x20%s,\x20%s',_0x3791cb,_0x5bfa4f[_0x67da('0x14')][_0x67da('0x16')]);return _0x26198c(_0x5bfa4f['error'][_0x67da('0x16')]);}logger[_0x67da('0x14')](_0x67da('0xf'),_0x3791cb,_0x5bfa4f[_0x67da('0x14')][_0x67da('0x16')]);return _0x7adba5(_0x5bfa4f[_0x67da('0x14')][_0x67da('0x16')]);}else{logger[_0x67da('0xe')]('OpenchannelMessage,\x20%s,\x20%s',_0x3791cb,_0x67da('0x10'));_0x7adba5(_0x5bfa4f['result'][_0x67da('0x16')]);}})['catch'](function(_0x263517){logger[_0x67da('0x14')](_0x67da('0xf'),_0x3791cb,_0x263517);_0x26198c(_0x263517);});});}exports[_0x67da('0x17')]=function(_0x4b91af){var _0x2a43db=this;return new Promise(function(_0x4f0676,_0x48b1e1){return db[_0x67da('0x18')][_0x67da('0x19')](_0x4b91af[_0x67da('0x1a')],{'raw':_0x4b91af[_0x67da('0x1b')]?_0x4b91af['options']['raw']===undefined?!![]:![]:!![]})['then'](function(_0x3f2182){logger[_0x67da('0xe')](_0x67da('0x17'),_0x4b91af);logger[_0x67da('0x11')](_0x67da('0x17'),_0x4b91af,JSON[_0x67da('0x13')](_0x3f2182));_0x4f0676(_0x3f2182);})['catch'](function(_0xc2667e){logger[_0x67da('0x14')]('CreateOpenchannelMessage',_0xc2667e[_0x67da('0x16')],_0x4b91af);_0x48b1e1(_0x2a43db['error'](0x1f4,_0xc2667e[_0x67da('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index b2aa21d..d0e7d3e 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 _0xedd9=['removeListener','register','length','openchannelMessage:','save','remove','update','emit'];(function(_0x3c6e74,_0x3d68c1){var _0x1e320f=function(_0x4ed38e){while(--_0x4ed38e){_0x3c6e74['push'](_0x3c6e74['shift']());}};_0x1e320f(++_0x3d68c1);}(_0xedd9,0xfc));var _0x9edd=function(_0x2d8f0f,_0x535615){_0x2d8f0f=_0x2d8f0f-0x0;var _0x149b02=_0xedd9[_0x2d8f0f];return _0x149b02;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0x9edd('0x0'),_0x9edd('0x1'),_0x9edd('0x2')];function createListener(_0x2c16b8,_0x3b51bc){return function(_0x127cbe){_0x3b51bc[_0x9edd('0x3')](_0x2c16b8,_0x127cbe);};}function removeListener(_0x36b53f,_0x5943b3){return function(){OpenchannelMessageEvents[_0x9edd('0x4')](_0x36b53f,_0x5943b3);};}exports[_0x9edd('0x5')]=function(_0x268f9e){for(var _0x34c1a7=0x0,_0x5319f7=events[_0x9edd('0x6')];_0x34c1a7<_0x5319f7;_0x34c1a7++){var _0x571af9=events[_0x34c1a7];var _0x172522=createListener(_0x9edd('0x7')+_0x571af9,_0x268f9e);OpenchannelMessageEvents['on'](_0x571af9,_0x172522);}}; \ No newline at end of file +var _0x70e0=['openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x1b33f,_0x2a12e1){var _0x12f869=function(_0x11e7d8){while(--_0x11e7d8){_0x1b33f['push'](_0x1b33f['shift']());}};_0x12f869(++_0x2a12e1);}(_0x70e0,0x17b));var _0x070e=function(_0x46c641,_0x5dd5ea){_0x46c641=_0x46c641-0x0;var _0x41e5bd=_0x70e0[_0x46c641];return _0x41e5bd;};'use strict';var OpenchannelMessageEvents=require(_0x070e('0x0'));var events=[_0x070e('0x1'),_0x070e('0x2'),'update'];function createListener(_0x579b83,_0x16e651){return function(_0xee173){_0x16e651[_0x070e('0x3')](_0x579b83,_0xee173);};}function removeListener(_0x2593e5,_0x5c90fc){return function(){OpenchannelMessageEvents[_0x070e('0x4')](_0x2593e5,_0x5c90fc);};}exports['register']=function(_0x46fe68){for(var _0x4b041d=0x0,_0x56e420=events['length'];_0x4b041d<_0x56e420;_0x4b041d++){var _0x35ab0c=events[_0x4b041d];var _0x1e11f0=createListener(_0x070e('0x5')+_0x35ab0c,_0x46fe68);OpenchannelMessageEvents['on'](_0x35ab0c,_0x1e11f0);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 156a7d6..bce34b1 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 _0xf698=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','isAuthenticated','describe','get','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util'];(function(_0x151cfc,_0x54c485){var _0x24b68b=function(_0x5d7b0e){while(--_0x5d7b0e){_0x151cfc['push'](_0x151cfc['shift']());}};_0x24b68b(++_0x54c485);}(_0xf698,0x1de));var _0x8f69=function(_0x1e4f2d,_0x22e2bb){_0x1e4f2d=_0x1e4f2d-0x0;var _0xd05ce5=_0xf698[_0x1e4f2d];return _0xd05ce5;};'use strict';var multer=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var path=require('path');var timeout=require(_0x8f69('0x2'));var express=require(_0x8f69('0x3'));var router=express['Router']();var auth=require(_0x8f69('0x4'));var interaction=require(_0x8f69('0x5'));var config=require(_0x8f69('0x6'));var controller=require(_0x8f69('0x7'));router['get']('/',auth[_0x8f69('0x8')](),controller['index']);router['get']('/describe',auth[_0x8f69('0x8')](),controller[_0x8f69('0x9')]);router[_0x8f69('0xa')](_0x8f69('0xb'),auth[_0x8f69('0x8')](),controller[_0x8f69('0xc')]);router[_0x8f69('0xa')](_0x8f69('0xd'),auth[_0x8f69('0x8')](),controller[_0x8f69('0xe')]);router[_0x8f69('0xa')](_0x8f69('0xf'),auth['isAuthenticated'](),controller[_0x8f69('0x10')]);router['get'](_0x8f69('0x11'),auth['isAuthenticated'](),controller[_0x8f69('0x12')]);router['post']('/',auth[_0x8f69('0x8')](),controller[_0x8f69('0x13')]);router[_0x8f69('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0x8f69('0x15')]);router[_0x8f69('0x14')]('/:id/users',auth[_0x8f69('0x8')](),controller[_0x8f69('0x16')]);router[_0x8f69('0x17')]('/:id',auth[_0x8f69('0x8')](),controller[_0x8f69('0x18')]);router[_0x8f69('0x19')]('/:id',auth[_0x8f69('0x8')](),controller[_0x8f69('0x1a')]);router[_0x8f69('0x19')](_0x8f69('0xf'),auth[_0x8f69('0x8')](),controller[_0x8f69('0x1b')]);router['delete'](_0x8f69('0x11'),auth[_0x8f69('0x8')](),controller[_0x8f69('0x1c')]);module[_0x8f69('0x1d')]=router; \ No newline at end of file +var _0x8daf=['getTeams','getAgents','post','addTeams','/:id/users','put','/:id','update','delete','removeTeams','removeAgents','exports','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','/:id/members','getMembers','/:id/teams'];(function(_0x387836,_0x4da87e){var _0x489991=function(_0x33b085){while(--_0x33b085){_0x387836['push'](_0x387836['shift']());}};_0x489991(++_0x4da87e);}(_0x8daf,0x15c));var _0xf8da=function(_0xac6fdf,_0x315296){_0xac6fdf=_0xac6fdf-0x0;var _0x56d02f=_0x8daf[_0xac6fdf];return _0x56d02f;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf8da('0x0'));var router=express[_0xf8da('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xf8da('0x2'));var config=require(_0xf8da('0x3'));var controller=require(_0xf8da('0x4'));router[_0xf8da('0x5')]('/',auth[_0xf8da('0x6')](),controller[_0xf8da('0x7')]);router[_0xf8da('0x5')](_0xf8da('0x8'),auth[_0xf8da('0x6')](),controller['describe']);router[_0xf8da('0x5')]('/:id',auth[_0xf8da('0x6')](),controller['show']);router['get'](_0xf8da('0x9'),auth[_0xf8da('0x6')](),controller[_0xf8da('0xa')]);router[_0xf8da('0x5')](_0xf8da('0xb'),auth[_0xf8da('0x6')](),controller[_0xf8da('0xc')]);router[_0xf8da('0x5')]('/:id/users',auth[_0xf8da('0x6')](),controller[_0xf8da('0xd')]);router[_0xf8da('0xe')]('/',auth[_0xf8da('0x6')](),controller['create']);router[_0xf8da('0xe')]('/:id/teams',auth[_0xf8da('0x6')](),controller[_0xf8da('0xf')]);router[_0xf8da('0xe')](_0xf8da('0x10'),auth[_0xf8da('0x6')](),controller['addAgents']);router[_0xf8da('0x11')](_0xf8da('0x12'),auth[_0xf8da('0x6')](),controller[_0xf8da('0x13')]);router[_0xf8da('0x14')](_0xf8da('0x12'),auth[_0xf8da('0x6')](),controller['destroy']);router[_0xf8da('0x14')]('/:id/teams',auth['isAuthenticated'](),controller[_0xf8da('0x15')]);router[_0xf8da('0x14')]('/:id/users',auth[_0xf8da('0x6')](),controller[_0xf8da('0x16')]);module[_0xf8da('0x17')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 0f50530..de0ea87 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 _0x925a=['roundrobin','exports','STRING','name','rrmemory','beepall'];(function(_0x363ef8,_0x4ecb1a){var _0x148822=function(_0x232634){while(--_0x232634){_0x363ef8['push'](_0x363ef8['shift']());}};_0x148822(++_0x4ecb1a);}(_0x925a,0x199));var _0xa925=function(_0x39e26c,_0x1db2d8){_0x39e26c=_0x39e26c-0x0;var _0x29aade=_0x925a[_0x39e26c];return _0x29aade;};'use strict';var Sequelize=require('sequelize');module[_0xa925('0x0')]={'name':{'type':Sequelize[_0xa925('0x1')],'unique':_0xa925('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa925('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0xa925('0x3'),_0xa925('0x4'),_0xa925('0x5'))}}; \ No newline at end of file +var _0x7096=['beepall','roundrobin','exports','name','INTEGER','ENUM','rrmemory'];(function(_0x10b656,_0x421b24){var _0x3c6af4=function(_0x115abe){while(--_0x115abe){_0x10b656['push'](_0x10b656['shift']());}};_0x3c6af4(++_0x421b24);}(_0x7096,0x10c));var _0x6709=function(_0x543084,_0x4337f5){_0x543084=_0x543084-0x0;var _0x306a57=_0x7096[_0x543084];return _0x306a57;};'use strict';var Sequelize=require('sequelize');module[_0x6709('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0x6709('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x6709('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x6709('0x3')](_0x6709('0x4'),_0x6709('0x5'),_0x6709('0x6'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index 32a1868..d04db5d 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 _0xa57a=['./openchannelQueue.socket','register','sendStatus','status','end','count','offset','limit','set','json','reject','save','update','then','OpenchannelQueues','UserProfileResource','destroy','error','stack','name','index','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','filter','merge','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','catch','params','rawAttributes','create','get','role','UserProfileSection','autoAssociation','body','find','describe','getMembers','UserOpenchannelQueue','nolimit','sort','OpenchannelQueueId','User','findAndCountAll','UserId','agent','openchannelPause','updatedAt','rows','format','SIP','findOne','Team','pick','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','emit','userOpenchannelQueue:save','removeTeams','tq.TeamId','join','user_has_teams','ut.UserId\x20=\x20?','toString','QueryTypes','SELECT','includes','all','value','isEmpty','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x301696,_0x40bc05){var _0x3f7afb=function(_0x47180d){while(--_0x47180d){_0x301696['push'](_0x301696['shift']());}};_0x3f7afb(++_0x40bc05);}(_0xa57a,0x173));var _0xaa57=function(_0x3c1a81,_0x57a2b7){_0x3c1a81=_0x3c1a81-0x0;var _0x289d61=_0xa57a[_0x3c1a81];return _0x289d61;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaa57('0x0'));var rimraf=require(_0xaa57('0x1'));var zipdir=require(_0xaa57('0x2'));var jsonpatch=require(_0xaa57('0x3'));var rp=require(_0xaa57('0x4'));var moment=require(_0xaa57('0x5'));var BPromise=require(_0xaa57('0x6'));var Mustache=require('mustache');var util=require(_0xaa57('0x7'));var path=require(_0xaa57('0x8'));var sox=require(_0xaa57('0x9'));var csv=require(_0xaa57('0xa'));var ejs=require(_0xaa57('0xb'));var fs=require('fs');var _=require(_0xaa57('0xc'));var squel=require(_0xaa57('0xd'));var crypto=require(_0xaa57('0xe'));var jsforce=require(_0xaa57('0xf'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xaa57('0x10'));var Papa=require(_0xaa57('0x11'));var Redis=require(_0xaa57('0x12'));var authService=require(_0xaa57('0x13'));var qs=require(_0xaa57('0x14'));var as=require(_0xaa57('0x15'));var hardwareService=require(_0xaa57('0x16'));var logger=require('../../config/logger')(_0xaa57('0x17'));var utils=require(_0xaa57('0x18'));var config=require(_0xaa57('0x19'));var db=require(_0xaa57('0x1a'))['db'];config[_0xaa57('0x1b')]=_[_0xaa57('0x1c')](config[_0xaa57('0x1b')],{'host':_0xaa57('0x1d'),'port':0x18eb});var socket=require(_0xaa57('0x1e'))(new Redis(config['redis']));require(_0xaa57('0x1f'))[_0xaa57('0x20')](socket);function respondWithStatusCode(_0xec18c5,_0x7175a){_0x7175a=_0x7175a||0xcc;return function(_0x50480d){if(_0x50480d){return _0xec18c5[_0xaa57('0x21')](_0x7175a);}return _0xec18c5[_0xaa57('0x22')](_0x7175a)[_0xaa57('0x23')]();};}function respondWithResult(_0x593e1f,_0x48aac2){_0x48aac2=_0x48aac2||0xc8;return function(_0x11be39){if(_0x11be39){return _0x593e1f['status'](_0x48aac2)['json'](_0x11be39);}};}function respondWithFilteredResult(_0x4ef770,_0x5cffa1){return function(_0x3c8030){if(_0x3c8030){var _0x2e4b0e=_0x3c8030[_0xaa57('0x24')],_0x5879b8=_0x5cffa1[_0xaa57('0x25')],_0x5b0022=_0x5cffa1[_0xaa57('0x25')]+_0x5cffa1[_0xaa57('0x26')],_0x25e94d;if(_0x5b0022>=_0x2e4b0e){_0x5b0022=_0x2e4b0e;_0x25e94d=0xc8;}else{_0x25e94d=0xce;}_0x4ef770[_0xaa57('0x22')](_0x25e94d);return _0x4ef770[_0xaa57('0x27')]('Content-Range',_0x5879b8+'-'+_0x5b0022+'/'+_0x2e4b0e)[_0xaa57('0x28')](_0x3c8030);}return null;};}function patchUpdates(_0x3aaf66){return function(_0x404eb1){try{jsonpatch['apply'](_0x404eb1,_0x3aaf66,!![]);}catch(_0x1f2872){return BPromise[_0xaa57('0x29')](_0x1f2872);}return _0x404eb1[_0xaa57('0x2a')]();};}function saveUpdates(_0x3c86bb,_0x6e8751){return function(_0x5428b0){if(_0x5428b0){return _0x5428b0[_0xaa57('0x2b')](_0x3c86bb)[_0xaa57('0x2c')](function(_0x1099c9){return _0x1099c9;});}return null;};}function removeEntity(_0x916f1c,_0x426bb1){return function(_0x302081){if(_0x302081){return _0x302081['destroy']()['then'](function(){var _0x47ba4c=_0x302081['get']({'plain':!![]});var _0x25b4a2=_0xaa57('0x2d');return db[_0xaa57('0x2e')][_0xaa57('0x2f')]({'where':{'type':_0x25b4a2,'resourceId':_0x47ba4c['id']}})['then'](function(){return _0x302081;});})[_0xaa57('0x2c')](function(){_0x916f1c[_0xaa57('0x22')](0xcc)[_0xaa57('0x23')]();});}};}function handleEntityNotFound(_0x557e70,_0x5187e0){return function(_0x2cf501){if(!_0x2cf501){_0x557e70[_0xaa57('0x21')](0x194);}return _0x2cf501;};}function handleError(_0x353eb2,_0x5d7f3e){_0x5d7f3e=_0x5d7f3e||0x1f4;return function(_0x50c6bf){logger[_0xaa57('0x30')](_0x50c6bf[_0xaa57('0x31')]);if(_0x50c6bf[_0xaa57('0x32')]){delete _0x50c6bf[_0xaa57('0x32')];}_0x353eb2[_0xaa57('0x22')](_0x5d7f3e)['send'](_0x50c6bf);};}exports[_0xaa57('0x33')]=function(_0x10e1a6,_0x1e682d){var _0x25a6a8={},_0x1d5699={},_0x2d26a0={'count':0x0,'rows':[]};var _0x3195b0=_[_0xaa57('0x34')](db['OpenchannelQueue']['rawAttributes'],function(_0x1473ab){return{'name':_0x1473ab['fieldName'],'type':_0x1473ab[_0xaa57('0x35')][_0xaa57('0x36')]};});_0x1d5699[_0xaa57('0x37')]=_[_0xaa57('0x34')](_0x3195b0,_0xaa57('0x32'));_0x1d5699[_0xaa57('0x38')]=_[_0xaa57('0x39')](_0x10e1a6[_0xaa57('0x38')]);_0x1d5699[_0xaa57('0x3a')]=_[_0xaa57('0x3b')](_0x1d5699[_0xaa57('0x37')],_0x1d5699[_0xaa57('0x38')]);_0x25a6a8[_0xaa57('0x3c')]=_[_0xaa57('0x3b')](_0x1d5699[_0xaa57('0x37')],qs[_0xaa57('0x3d')](_0x10e1a6[_0xaa57('0x38')][_0xaa57('0x3d')]));_0x25a6a8[_0xaa57('0x3c')]=_0x25a6a8['attributes'][_0xaa57('0x3e')]?_0x25a6a8['attributes']:_0x1d5699[_0xaa57('0x37')];if(!_0x10e1a6[_0xaa57('0x38')][_0xaa57('0x3f')]('nolimit')){_0x25a6a8[_0xaa57('0x26')]=qs[_0xaa57('0x26')](_0x10e1a6[_0xaa57('0x38')][_0xaa57('0x26')]);_0x25a6a8['offset']=qs[_0xaa57('0x25')](_0x10e1a6[_0xaa57('0x38')]['offset']);}_0x25a6a8[_0xaa57('0x40')]=qs['sort'](_0x10e1a6['query']['sort']);_0x25a6a8[_0xaa57('0x41')]=qs[_0xaa57('0x3a')](_['pick'](_0x10e1a6[_0xaa57('0x38')],_0x1d5699[_0xaa57('0x3a')]));if(_0x10e1a6[_0xaa57('0x38')][_0xaa57('0x42')]){_0x25a6a8[_0xaa57('0x41')]=_[_0xaa57('0x43')](_0x25a6a8[_0xaa57('0x41')],{'$or':_['map'](_0x3195b0,function(_0x58911b){if(_0x58911b[_0xaa57('0x35')]!==_0xaa57('0x44')){var _0x473665={};_0x473665[_0x58911b[_0xaa57('0x32')]]={'$like':'%'+_0x10e1a6['query'][_0xaa57('0x42')]+'%'};return _0x473665;}})});}_0x25a6a8=_[_0xaa57('0x43')]({},_0x25a6a8,_0x10e1a6[_0xaa57('0x45')]);var _0x520325={'where':_0x25a6a8[_0xaa57('0x41')]};return db[_0xaa57('0x46')]['count'](_0x520325)[_0xaa57('0x2c')](function(_0x1dc72b){_0x2d26a0[_0xaa57('0x24')]=_0x1dc72b;if(_0x10e1a6[_0xaa57('0x38')][_0xaa57('0x47')]){_0x25a6a8[_0xaa57('0x48')]=[{'all':!![]}];}return db[_0xaa57('0x46')][_0xaa57('0x49')](_0x25a6a8);})[_0xaa57('0x2c')](function(_0x450d10){_0x2d26a0['rows']=_0x450d10;return _0x2d26a0;})[_0xaa57('0x2c')](respondWithFilteredResult(_0x1e682d,_0x25a6a8))[_0xaa57('0x4a')](handleError(_0x1e682d,null));};exports['show']=function(_0x30ff57,_0x54ddab){var _0x5ba95d={'raw':!![],'where':{'id':_0x30ff57[_0xaa57('0x4b')]['id']}},_0x5a4d9e={};_0x5a4d9e[_0xaa57('0x37')]=_[_0xaa57('0x39')](db[_0xaa57('0x46')][_0xaa57('0x4c')]);_0x5a4d9e['query']=_[_0xaa57('0x39')](_0x30ff57[_0xaa57('0x38')]);_0x5a4d9e[_0xaa57('0x3a')]=_[_0xaa57('0x3b')](_0x5a4d9e[_0xaa57('0x37')],_0x5a4d9e[_0xaa57('0x38')]);_0x5ba95d[_0xaa57('0x3c')]=_[_0xaa57('0x3b')](_0x5a4d9e[_0xaa57('0x37')],qs[_0xaa57('0x3d')](_0x30ff57[_0xaa57('0x38')]['fields']));_0x5ba95d[_0xaa57('0x3c')]=_0x5ba95d[_0xaa57('0x3c')][_0xaa57('0x3e')]?_0x5ba95d[_0xaa57('0x3c')]:_0x5a4d9e[_0xaa57('0x37')];if(_0x30ff57[_0xaa57('0x38')][_0xaa57('0x47')]){_0x5ba95d[_0xaa57('0x48')]=[{'all':!![]}];}_0x5ba95d=_[_0xaa57('0x43')]({},_0x5ba95d,_0x30ff57[_0xaa57('0x45')]);return db['OpenchannelQueue']['find'](_0x5ba95d)[_0xaa57('0x2c')](handleEntityNotFound(_0x54ddab,null))[_0xaa57('0x2c')](respondWithResult(_0x54ddab,null))[_0xaa57('0x4a')](handleError(_0x54ddab,null));};exports[_0xaa57('0x4d')]=function(_0x14e397,_0x169d3f){return db['OpenchannelQueue']['create'](_0x14e397['body'],{})[_0xaa57('0x2c')](function(_0x58c3e5){var _0x5b86f4=_0x14e397['user'][_0xaa57('0x4e')]({'plain':!![]});if(!_0x5b86f4)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5b86f4[_0xaa57('0x4f')]==='user'){var _0x546a1b=_0x58c3e5[_0xaa57('0x4e')]({'plain':!![]});var _0x25b40f=_0xaa57('0x2d');return db[_0xaa57('0x50')]['find']({'where':{'name':_0x25b40f,'userProfileId':_0x5b86f4['userProfileId']},'raw':!![]})[_0xaa57('0x2c')](function(_0x5c0cbb){if(_0x5c0cbb&&_0x5c0cbb[_0xaa57('0x51')]===0x0){return db[_0xaa57('0x2e')][_0xaa57('0x4d')]({'name':_0x546a1b['name'],'resourceId':_0x546a1b['id'],'type':_0x5c0cbb[_0xaa57('0x32')],'sectionId':_0x5c0cbb['id']},{})[_0xaa57('0x2c')](function(){return _0x58c3e5;});}else{return _0x58c3e5;}})[_0xaa57('0x4a')](function(_0x5211ff){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5211ff);throw _0x5211ff;});}return _0x58c3e5;})[_0xaa57('0x2c')](respondWithResult(_0x169d3f,0xc9))['catch'](handleError(_0x169d3f,null));};exports[_0xaa57('0x2b')]=function(_0x57509b,_0x734387){if(_0x57509b[_0xaa57('0x52')]['id']){delete _0x57509b['body']['id'];}return db[_0xaa57('0x46')]['find']({'where':{'id':_0x57509b[_0xaa57('0x4b')]['id']}})['then'](handleEntityNotFound(_0x734387,null))[_0xaa57('0x2c')](saveUpdates(_0x57509b[_0xaa57('0x52')],null))['then'](respondWithResult(_0x734387,null))[_0xaa57('0x4a')](handleError(_0x734387,null));};exports['destroy']=function(_0x127edd,_0xb554dd){return db[_0xaa57('0x46')][_0xaa57('0x53')]({'where':{'id':_0x127edd['params']['id']}})[_0xaa57('0x2c')](handleEntityNotFound(_0xb554dd,null))[_0xaa57('0x2c')](removeEntity(_0xb554dd,null))[_0xaa57('0x4a')](handleError(_0xb554dd,null));};exports[_0xaa57('0x54')]=function(_0x45ec71,_0x31fead){return db[_0xaa57('0x46')][_0xaa57('0x54')]()[_0xaa57('0x2c')](respondWithResult(_0x31fead,null))[_0xaa57('0x4a')](handleError(_0x31fead,null));};exports[_0xaa57('0x55')]=function(_0x4fdde0,_0x4e7ba2,_0x1075d1){var _0x426241={'raw':!![],'where':{}},_0x2e62e5={},_0x5973f4;return db[_0xaa57('0x46')]['findOne']({'where':{'id':_0x4fdde0['params']['id']}})[_0xaa57('0x2c')](handleEntityNotFound(_0x4e7ba2,null))['then'](function(_0x5d8619){if(_0x5d8619){_0x5973f4=_0x5d8619[_0xaa57('0x4e')]({'plain':!![]});_0x2e62e5[_0xaa57('0x37')]=_[_0xaa57('0x39')](db[_0xaa57('0x56')][_0xaa57('0x4c')]);_0x2e62e5['query']=_[_0xaa57('0x39')](_0x4fdde0['query']);_0x2e62e5[_0xaa57('0x3a')]=_[_0xaa57('0x3b')](_0x2e62e5[_0xaa57('0x37')],_0x2e62e5[_0xaa57('0x38')]);_0x426241[_0xaa57('0x3c')]=_[_0xaa57('0x3b')](_0x2e62e5[_0xaa57('0x37')],qs[_0xaa57('0x3d')](_0x4fdde0[_0xaa57('0x38')][_0xaa57('0x3d')]));_0x426241[_0xaa57('0x3c')]=_0x426241[_0xaa57('0x3c')][_0xaa57('0x3e')]?_0x426241[_0xaa57('0x3c')]:_0x2e62e5[_0xaa57('0x37')];if(!_0x4fdde0[_0xaa57('0x38')]['hasOwnProperty'](_0xaa57('0x57'))){_0x426241['limit']=qs['limit'](_0x4fdde0[_0xaa57('0x38')]['limit']);_0x426241['offset']=qs['offset'](_0x4fdde0[_0xaa57('0x38')][_0xaa57('0x25')]);}_0x426241[_0xaa57('0x40')]=qs['sort'](_0x4fdde0[_0xaa57('0x38')][_0xaa57('0x58')]);_0x426241[_0xaa57('0x41')]=qs['filters'](_['pick'](_0x4fdde0[_0xaa57('0x38')],_0x2e62e5[_0xaa57('0x3a')]));_0x426241[_0xaa57('0x41')][_0xaa57('0x59')]=_0x5d8619['id'];if(_0x4fdde0[_0xaa57('0x38')][_0xaa57('0x42')]){_0x426241['where']=_[_0xaa57('0x43')](_0x426241[_0xaa57('0x41')],{'$or':_[_0xaa57('0x34')](_0x426241[_0xaa57('0x3c')],function(_0x245722){var _0x458bd8={};_0x458bd8[_0x245722]={'$like':'%'+_0x4fdde0[_0xaa57('0x38')][_0xaa57('0x42')]+'%'};return _0x458bd8;})});}_0x426241=_[_0xaa57('0x43')]({},_0x426241,_0x4fdde0['options']);return db[_0xaa57('0x56')][_0xaa57('0x49')](_0x426241);}})[_0xaa57('0x2c')](function(_0x3e6903){if(_0x3e6903){return db[_0xaa57('0x5a')][_0xaa57('0x5b')]({'where':{'id':_[_0xaa57('0x34')](_0x3e6903,_0xaa57('0x5c')),'role':_0xaa57('0x5d')},'attributes':['id',_0xaa57('0x32'),_0xaa57('0x5e'),_0xaa57('0x5f'),'createdAt']});}})['then'](function(_0x894164){if(_0x894164){return{'count':_0x894164['count'],'rows':_[_0xaa57('0x34')](_0x894164[_0xaa57('0x60')],function(_0x64d82c){return{'membername':_0x64d82c[_0xaa57('0x32')],'UserId':_0x64d82c['id'],'queue_name':_0x5973f4['name'],'OpenchannelQueueId':_0x5973f4['id'],'interface':util[_0xaa57('0x61')]('%s/%s',_0xaa57('0x62'),_0x64d82c[_0xaa57('0x32')]),'penalty':0x0,'paused':_0x64d82c[_0xaa57('0x5e')],'createdAt':_0x64d82c['createdAt'],'updatedAt':_0x64d82c[_0xaa57('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xaa57('0x2c')](respondWithFilteredResult(_0x4e7ba2,_0x426241))[_0xaa57('0x4a')](handleError(_0x4e7ba2,null));};exports['getTeams']=function(_0x3a2bb9,_0x2ada2c,_0x1e2dd7){var _0x4849cb={};var _0x5e45f3={};var _0x4244c8;var _0x58a133;return db['OpenchannelQueue'][_0xaa57('0x63')]({'where':{'id':_0x3a2bb9[_0xaa57('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2ada2c,null))[_0xaa57('0x2c')](function(_0x36c98d){if(_0x36c98d){_0x4244c8=_0x36c98d;_0x5e45f3['model']=_[_0xaa57('0x39')](db[_0xaa57('0x64')][_0xaa57('0x4c')]);_0x5e45f3[_0xaa57('0x38')]=_[_0xaa57('0x39')](_0x3a2bb9[_0xaa57('0x38')]);_0x5e45f3[_0xaa57('0x3a')]=_['intersection'](_0x5e45f3[_0xaa57('0x37')],_0x5e45f3['query']);_0x4849cb[_0xaa57('0x3c')]=_[_0xaa57('0x3b')](_0x5e45f3['model'],qs[_0xaa57('0x3d')](_0x3a2bb9['query'][_0xaa57('0x3d')]));_0x4849cb['attributes']=_0x4849cb[_0xaa57('0x3c')]['length']?_0x4849cb[_0xaa57('0x3c')]:_0x5e45f3['model'];_0x4849cb[_0xaa57('0x40')]=qs['sort'](_0x3a2bb9[_0xaa57('0x38')][_0xaa57('0x58')]);_0x4849cb['where']=qs['filters'](_[_0xaa57('0x65')](_0x3a2bb9[_0xaa57('0x38')],_0x5e45f3[_0xaa57('0x3a')]));if(_0x3a2bb9[_0xaa57('0x38')][_0xaa57('0x42')]){_0x4849cb[_0xaa57('0x41')]=_['merge'](_0x4849cb['where'],{'$or':_[_0xaa57('0x34')](_0x4849cb['attributes'],function(_0x71b8d4){var _0x37c62e={};_0x37c62e[_0x71b8d4]={'$like':'%'+_0x3a2bb9['query'][_0xaa57('0x42')]+'%'};return _0x37c62e;})});}_0x4849cb=_[_0xaa57('0x43')]({},_0x4849cb,_0x3a2bb9['options']);return _0x4244c8['getTeams'](_0x4849cb);}})[_0xaa57('0x2c')](function(_0x86443f){if(_0x86443f){_0x58a133=_0x86443f['length'];if(!_0x3a2bb9['query'][_0xaa57('0x3f')]('nolimit')){_0x4849cb[_0xaa57('0x26')]=qs[_0xaa57('0x26')](_0x3a2bb9[_0xaa57('0x38')][_0xaa57('0x26')]);_0x4849cb['offset']=qs['offset'](_0x3a2bb9[_0xaa57('0x38')]['offset']);}return _0x4244c8[_0xaa57('0x66')](_0x4849cb);}})['then'](function(_0x47f276){if(_0x47f276){return _0x47f276?{'count':_0x58a133,'rows':_0x47f276}:null;}})[_0xaa57('0x2c')](respondWithResult(_0x2ada2c,null))[_0xaa57('0x4a')](handleError(_0x2ada2c,null));};exports[_0xaa57('0x67')]=function(_0x4aa864,_0x318636,_0x4e9bf5){var _0x2c0809=_0x4aa864[_0xaa57('0x52')][_0xaa57('0x68')];return db[_0xaa57('0x64')][_0xaa57('0x49')]({'where':{'id':_0x2c0809},'attributes':['id'],'include':[{'model':db[_0xaa57('0x5a')],'as':_0xaa57('0x69'),'attributes':['id','name',_0xaa57('0x6a'),'voicePause',_0xaa57('0x6b')],'raw':!![]}]})['then'](function(_0x2df41d){if(_0x2df41d){var _0x58beb4=_[_0xaa57('0x6c')](_0x2df41d,function(_0x2d3d0d){var _0x295517=_0x2d3d0d['get']({'plain':!![]});return _0x295517[_0xaa57('0x69')];});return db[_0xaa57('0x46')][_0xaa57('0x53')]({'where':{'id':_0x4aa864[_0xaa57('0x4b')]['id']}})[_0xaa57('0x2c')](function(_0x31176){return db[_0xaa57('0x6d')][_0xaa57('0x6e')](function(_0x234d79){return _0x31176['addTeams'](_0x2c0809,{'transaction':_0x234d79})[_0xaa57('0x2c')](function(){return BPromise['each'](_0x58beb4,function(_0x2a6b5a){return db[_0xaa57('0x56')][_0xaa57('0x6f')]({'where':{'UserId':_0x2a6b5a['id'],'OpenchannelQueueId':_0x4aa864['params']['id']},'transaction':_0x234d79});});})[_0xaa57('0x2c')](function(){_0x58beb4['forEach'](function(_0x33f483){socket[_0xaa57('0x70')](_0xaa57('0x71'),{'UserId':_0x33f483['id'],'OpenchannelQueueId':_0x31176['id']});});});});});}})[_0xaa57('0x2c')](respondWithStatusCode(_0x318636,null))['catch'](handleError(_0x318636,null));};exports[_0xaa57('0x72')]=function(_0x591d4e,_0x44af31,_0x44d74c){return db['Team'][_0xaa57('0x49')]({'where':{'id':_0x591d4e[_0xaa57('0x38')]['ids']},'attributes':['id'],'include':[{'model':db[_0xaa57('0x5a')],'as':_0xaa57('0x69'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x44af31,null))[_0xaa57('0x2c')](function(_0x3e3d22){var _0x1e1647=_[_0xaa57('0x34')](_0x3e3d22,'id');var _0x18e6b7=[];var _0x541843=[];var _0x2bd531=squel['select']();_0x2bd531['field'](_0xaa57('0x73'))['from']('team_has_openchannel_queues','tq')[_0xaa57('0x74')](_0xaa57('0x75'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where']('OpenchannelQueueId\x20=\x20?',_0x591d4e[_0xaa57('0x4b')]['id']);for(var _0x1203a4=0x0;_0x1203a4<_0x3e3d22['length'];_0x1203a4+=0x1){let _0xe2b263=_0x3e3d22[_0x1203a4];for(var _0x355b5f=0x0;_0x355b5f<_0xe2b263[_0xaa57('0x69')]['length'];_0x355b5f+=0x1){let _0x54193a=_0xe2b263[_0xaa57('0x69')][_0x355b5f];var _0x1b81f0=_0x2bd531['clone']();_0x1b81f0[_0xaa57('0x41')](_0xaa57('0x76'),_0x54193a['id']);_0x541843['push'](db[_0xaa57('0x6d')]['query'](_0x1b81f0[_0xaa57('0x77')](),{'type':db['sequelize'][_0xaa57('0x78')][_0xaa57('0x79')]})[_0xaa57('0x2c')](function(_0x331222){if(_0x331222[_0xaa57('0x3e')]===0x1){return _0x54193a['id'];}else{var _0x283639=_['every'](_[_0xaa57('0x34')](_0x331222,'TeamId'),function(_0x4cc8f1){return _[_0xaa57('0x7a')](_0x1e1647,_0x4cc8f1);});if(_0x283639){return _0x54193a['id'];}}}));}}return BPromise[_0xaa57('0x7b')](_0x541843)['then'](function(_0x22978c){_0x18e6b7=_(_0x18e6b7)['union'](_0x22978c)['compact']()[_0xaa57('0x7c')]();return db['OpenchannelQueue'][_0xaa57('0x53')]({'where':{'id':_0x591d4e[_0xaa57('0x4b')]['id']}})[_0xaa57('0x2c')](function(_0x28362c){return db[_0xaa57('0x6d')]['transaction'](function(_0x55a511){return _0x28362c[_0xaa57('0x72')](_0x591d4e[_0xaa57('0x38')][_0xaa57('0x68')],{'transaction':_0x55a511})[_0xaa57('0x2c')](function(){if(!_[_0xaa57('0x7d')](_0x18e6b7)){return _0x28362c[_0xaa57('0x7e')](_0x18e6b7,{'transaction':_0x55a511});}})[_0xaa57('0x2c')](function(){_0x18e6b7[_0xaa57('0x7f')](function(_0x73accc){socket['emit'](_0xaa57('0x80'),{'UserId':_0x73accc,'OpenchannelQueueId':_0x28362c['id']});});});});});});})['then'](respondWithStatusCode(_0x44af31,null))[_0xaa57('0x4a')](handleError(_0x44af31,null));};exports['addAgents']=function(_0x4c0652,_0x35646e,_0x42c0d8){return db[_0xaa57('0x46')][_0xaa57('0x53')]({'where':{'id':_0x4c0652['params']['id']}})['then'](handleEntityNotFound(_0x35646e,null))[_0xaa57('0x2c')](function(_0x183d51){if(_0x183d51){return _0x183d51[_0xaa57('0x81')](_0x4c0652[_0xaa57('0x52')][_0xaa57('0x68')],_[_0xaa57('0x82')](_0x4c0652[_0xaa57('0x52')],[_0xaa57('0x68'),'id'])||{})[_0xaa57('0x83')](function(_0x50e180){for(var _0x398ea6=0x0;_0x398ea6<_0x4c0652[_0xaa57('0x52')][_0xaa57('0x68')][_0xaa57('0x3e')];_0x398ea6+=0x1){socket[_0xaa57('0x70')](_0xaa57('0x71'),{'UserId':_0x4c0652['body']['ids'][_0x398ea6],'OpenchannelQueueId':_0x4c0652[_0xaa57('0x4b')]['id']});}return _0x50e180;});}})[_0xaa57('0x2c')](respondWithResult(_0x35646e,null))[_0xaa57('0x4a')](handleError(_0x35646e,null));};exports[_0xaa57('0x7e')]=function(_0x870812,_0x5d5dae,_0x137587){return db[_0xaa57('0x46')]['find']({'where':{'id':_0x870812['params']['id']}})[_0xaa57('0x2c')](handleEntityNotFound(_0x5d5dae,null))[_0xaa57('0x2c')](function(_0x50a629){if(_0x50a629){return _0x50a629[_0xaa57('0x7e')](_0x870812['query'][_0xaa57('0x68')])[_0xaa57('0x2c')](function(){if(_[_0xaa57('0x84')](_0x870812[_0xaa57('0x38')][_0xaa57('0x68')])){for(var _0x557035=0x0;_0x557035<_0x870812[_0xaa57('0x38')]['ids'][_0xaa57('0x3e')];_0x557035+=0x1){socket[_0xaa57('0x70')](_0xaa57('0x80'),{'UserId':Number(_0x870812['query'][_0xaa57('0x68')][_0x557035]),'OpenchannelQueueId':Number(_0x870812[_0xaa57('0x4b')]['id'])});}}else{socket[_0xaa57('0x70')](_0xaa57('0x80'),{'UserId':Number(_0x870812['query']['ids']),'OpenchannelQueueId':Number(_0x870812['params']['id'])});}});}})[_0xaa57('0x2c')](respondWithStatusCode(_0x5d5dae,null))[_0xaa57('0x4a')](handleError(_0x5d5dae,null));};exports[_0xaa57('0x85')]=function(_0x2216eb,_0xb8f6fc,_0x4bbcce){var _0x1d30e2={};var _0x2f64a0={};var _0x5425a6;var _0x5c51b5;return db[_0xaa57('0x46')][_0xaa57('0x63')]({'where':{'id':_0x2216eb[_0xaa57('0x4b')]['id']}})[_0xaa57('0x2c')](handleEntityNotFound(_0xb8f6fc,null))[_0xaa57('0x2c')](function(_0x149d73){if(_0x149d73){_0x5425a6=_0x149d73;_0x2f64a0[_0xaa57('0x37')]=_[_0xaa57('0x39')](db[_0xaa57('0x5a')][_0xaa57('0x4c')]);_0x2f64a0['query']=_[_0xaa57('0x39')](_0x2216eb['query']);_0x2f64a0[_0xaa57('0x3a')]=_['intersection'](_0x2f64a0[_0xaa57('0x37')],_0x2f64a0[_0xaa57('0x38')]);_0x1d30e2[_0xaa57('0x3c')]=_[_0xaa57('0x3b')](_0x2f64a0[_0xaa57('0x37')],qs[_0xaa57('0x3d')](_0x2216eb[_0xaa57('0x38')][_0xaa57('0x3d')]));_0x1d30e2[_0xaa57('0x3c')]=_0x1d30e2[_0xaa57('0x3c')]['length']?_0x1d30e2['attributes']:_0x2f64a0['model'];_0x1d30e2[_0xaa57('0x40')]=qs['sort'](_0x2216eb[_0xaa57('0x38')]['sort']);_0x1d30e2[_0xaa57('0x41')]=qs[_0xaa57('0x3a')](_['pick'](_0x2216eb[_0xaa57('0x38')],_0x2f64a0[_0xaa57('0x3a')]));if(_0x2216eb[_0xaa57('0x38')][_0xaa57('0x42')]){_0x1d30e2[_0xaa57('0x41')]=_[_0xaa57('0x43')](_0x1d30e2['where'],{'$or':_[_0xaa57('0x34')](_0x1d30e2['attributes'],function(_0x1bb8b6){var _0x256e44={};_0x256e44[_0x1bb8b6]={'$like':'%'+_0x2216eb[_0xaa57('0x38')][_0xaa57('0x42')]+'%'};return _0x256e44;})});}_0x1d30e2=_[_0xaa57('0x43')]({},_0x1d30e2,_0x2216eb['options']);return _0x5425a6[_0xaa57('0x85')](_0x1d30e2);}})[_0xaa57('0x2c')](function(_0x44bc1c){if(_0x44bc1c){_0x5c51b5=_0x44bc1c['length'];if(!_0x2216eb[_0xaa57('0x38')][_0xaa57('0x3f')](_0xaa57('0x57'))){_0x1d30e2[_0xaa57('0x26')]=qs[_0xaa57('0x26')](_0x2216eb[_0xaa57('0x38')][_0xaa57('0x26')]);_0x1d30e2['offset']=qs[_0xaa57('0x25')](_0x2216eb[_0xaa57('0x38')][_0xaa57('0x25')]);}return _0x5425a6[_0xaa57('0x85')](_0x1d30e2);}})[_0xaa57('0x2c')](function(_0x5bffd1){if(_0x5bffd1){return _0x5bffd1?{'count':_0x5c51b5,'rows':_0x5bffd1}:null;}})[_0xaa57('0x2c')](respondWithResult(_0xb8f6fc,null))[_0xaa57('0x4a')](handleError(_0xb8f6fc,null));}; \ No newline at end of file +var _0x49e1=['findOrCreate','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','team_has_openchannel_queues','join','user_has_teams','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','sequelize','QueryTypes','SELECT','TeamId','includes','all','value','transaction','isEmpty','removeAgents','forEach','addAgents','omit','spread','isArray','userOpenchannelQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','defaults','redis','localhost','socket.io-emitter','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','get','UserProfileResource','destroy','then','stack','name','send','index','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','map','VIRTUAL','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMembers','findOne','UserOpenchannelQueue','sort','pick','OpenchannelQueueId','User','findAndCountAll','UserId','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','ids','Agents','voicePause','interface','flatMap','each'];(function(_0x4aebcd,_0x425659){var _0x256928=function(_0x53b4e6){while(--_0x53b4e6){_0x4aebcd['push'](_0x4aebcd['shift']());}};_0x256928(++_0x425659);}(_0x49e1,0x1be));var _0x149e=function(_0x5b6cbc,_0x55fd25){_0x5b6cbc=_0x5b6cbc-0x0;var _0x3b985e=_0x49e1[_0x5b6cbc];return _0x3b985e;};'use strict';var pdf=require(_0x149e('0x0'));var emlformat=require(_0x149e('0x1'));var rimraf=require(_0x149e('0x2'));var zipdir=require(_0x149e('0x3'));var jsonpatch=require(_0x149e('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x149e('0x5'));var Mustache=require(_0x149e('0x6'));var util=require('util');var path=require(_0x149e('0x7'));var sox=require('sox');var csv=require(_0x149e('0x8'));var ejs=require(_0x149e('0x9'));var fs=require('fs');var _=require(_0x149e('0xa'));var squel=require(_0x149e('0xb'));var crypto=require(_0x149e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x149e('0xd'));var toCsv=require(_0x149e('0x8'));var querystring=require(_0x149e('0xe'));var Papa=require(_0x149e('0xf'));var Redis=require(_0x149e('0x10'));var authService=require(_0x149e('0x11'));var qs=require(_0x149e('0x12'));var as=require(_0x149e('0x13'));var hardwareService=require(_0x149e('0x14'));var logger=require(_0x149e('0x15'))(_0x149e('0x16'));var utils=require(_0x149e('0x17'));var config=require('../../config/environment');var db=require(_0x149e('0x18'))['db'];config['redis']=_[_0x149e('0x19')](config[_0x149e('0x1a')],{'host':_0x149e('0x1b'),'port':0x18eb});var socket=require(_0x149e('0x1c'))(new Redis(config[_0x149e('0x1a')]));require('./openchannelQueue.socket')['register'](socket);function respondWithStatusCode(_0x5c021a,_0x4ac034){_0x4ac034=_0x4ac034||0xcc;return function(_0x2b379f){if(_0x2b379f){return _0x5c021a[_0x149e('0x1d')](_0x4ac034);}return _0x5c021a[_0x149e('0x1e')](_0x4ac034)[_0x149e('0x1f')]();};}function respondWithResult(_0x3d5b3f,_0x3feb09){_0x3feb09=_0x3feb09||0xc8;return function(_0x429278){if(_0x429278){return _0x3d5b3f[_0x149e('0x1e')](_0x3feb09)[_0x149e('0x20')](_0x429278);}};}function respondWithFilteredResult(_0xb5c843,_0x2e12b1){return function(_0x328c05){if(_0x328c05){var _0x2a9f69=_0x328c05[_0x149e('0x21')],_0x5cc755=_0x2e12b1[_0x149e('0x22')],_0x4c35d6=_0x2e12b1[_0x149e('0x22')]+_0x2e12b1[_0x149e('0x23')],_0x4003a8;if(_0x4c35d6>=_0x2a9f69){_0x4c35d6=_0x2a9f69;_0x4003a8=0xc8;}else{_0x4003a8=0xce;}_0xb5c843[_0x149e('0x1e')](_0x4003a8);return _0xb5c843[_0x149e('0x24')]('Content-Range',_0x5cc755+'-'+_0x4c35d6+'/'+_0x2a9f69)[_0x149e('0x20')](_0x328c05);}return null;};}function patchUpdates(_0x7c65d6){return function(_0x30e619){try{jsonpatch['apply'](_0x30e619,_0x7c65d6,!![]);}catch(_0x3f78af){return BPromise[_0x149e('0x25')](_0x3f78af);}return _0x30e619[_0x149e('0x26')]();};}function saveUpdates(_0x5a4821,_0x1795d6){return function(_0x4b0eae){if(_0x4b0eae){return _0x4b0eae[_0x149e('0x27')](_0x5a4821)['then'](function(_0x151968){return _0x151968;});}return null;};}function removeEntity(_0x3c0c1f,_0x588bcc){return function(_0x43a884){if(_0x43a884){return _0x43a884['destroy']()['then'](function(){var _0x4a5cd3=_0x43a884[_0x149e('0x28')]({'plain':!![]});var _0x12a61d='OpenchannelQueues';return db[_0x149e('0x29')][_0x149e('0x2a')]({'where':{'type':_0x12a61d,'resourceId':_0x4a5cd3['id']}})[_0x149e('0x2b')](function(){return _0x43a884;});})[_0x149e('0x2b')](function(){_0x3c0c1f[_0x149e('0x1e')](0xcc)[_0x149e('0x1f')]();});}};}function handleEntityNotFound(_0x1096ef,_0x189289){return function(_0x2389b6){if(!_0x2389b6){_0x1096ef['sendStatus'](0x194);}return _0x2389b6;};}function handleError(_0x2153a2,_0x3f15fc){_0x3f15fc=_0x3f15fc||0x1f4;return function(_0x318a27){logger['error'](_0x318a27[_0x149e('0x2c')]);if(_0x318a27[_0x149e('0x2d')]){delete _0x318a27[_0x149e('0x2d')];}_0x2153a2[_0x149e('0x1e')](_0x3f15fc)[_0x149e('0x2e')](_0x318a27);};}exports[_0x149e('0x2f')]=function(_0x4b5c85,_0x48a2fe){var _0x127bc5={},_0x1dc99b={},_0x190e9c={'count':0x0,'rows':[]};var _0x40aebc=_['map'](db['OpenchannelQueue'][_0x149e('0x30')],function(_0x6c1edf){return{'name':_0x6c1edf[_0x149e('0x31')],'type':_0x6c1edf[_0x149e('0x32')]['key']};});_0x1dc99b[_0x149e('0x33')]=_['map'](_0x40aebc,_0x149e('0x2d'));_0x1dc99b['query']=_[_0x149e('0x34')](_0x4b5c85[_0x149e('0x35')]);_0x1dc99b[_0x149e('0x36')]=_[_0x149e('0x37')](_0x1dc99b[_0x149e('0x33')],_0x1dc99b['query']);_0x127bc5[_0x149e('0x38')]=_['intersection'](_0x1dc99b[_0x149e('0x33')],qs[_0x149e('0x39')](_0x4b5c85[_0x149e('0x35')][_0x149e('0x39')]));_0x127bc5[_0x149e('0x38')]=_0x127bc5[_0x149e('0x38')][_0x149e('0x3a')]?_0x127bc5[_0x149e('0x38')]:_0x1dc99b[_0x149e('0x33')];if(!_0x4b5c85[_0x149e('0x35')][_0x149e('0x3b')](_0x149e('0x3c'))){_0x127bc5[_0x149e('0x23')]=qs[_0x149e('0x23')](_0x4b5c85[_0x149e('0x35')][_0x149e('0x23')]);_0x127bc5[_0x149e('0x22')]=qs['offset'](_0x4b5c85[_0x149e('0x35')][_0x149e('0x22')]);}_0x127bc5[_0x149e('0x3d')]=qs['sort'](_0x4b5c85[_0x149e('0x35')]['sort']);_0x127bc5['where']=qs['filters'](_['pick'](_0x4b5c85[_0x149e('0x35')],_0x1dc99b[_0x149e('0x36')]));if(_0x4b5c85[_0x149e('0x35')][_0x149e('0x3e')]){_0x127bc5[_0x149e('0x3f')]=_[_0x149e('0x40')](_0x127bc5[_0x149e('0x3f')],{'$or':_[_0x149e('0x41')](_0x40aebc,function(_0x37a7ed){if(_0x37a7ed[_0x149e('0x32')]!==_0x149e('0x42')){var _0x58da16={};_0x58da16[_0x37a7ed[_0x149e('0x2d')]]={'$like':'%'+_0x4b5c85[_0x149e('0x35')][_0x149e('0x3e')]+'%'};return _0x58da16;}})});}_0x127bc5=_[_0x149e('0x40')]({},_0x127bc5,_0x4b5c85[_0x149e('0x43')]);var _0x5e9be1={'where':_0x127bc5['where']};return db[_0x149e('0x44')]['count'](_0x5e9be1)[_0x149e('0x2b')](function(_0x25936e){_0x190e9c['count']=_0x25936e;if(_0x4b5c85[_0x149e('0x35')][_0x149e('0x45')]){_0x127bc5[_0x149e('0x46')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x149e('0x47')](_0x127bc5);})[_0x149e('0x2b')](function(_0x279721){_0x190e9c[_0x149e('0x48')]=_0x279721;return _0x190e9c;})[_0x149e('0x2b')](respondWithFilteredResult(_0x48a2fe,_0x127bc5))[_0x149e('0x49')](handleError(_0x48a2fe,null));};exports[_0x149e('0x4a')]=function(_0x351b4c,_0x2458f1){var _0x29fe28={'raw':!![],'where':{'id':_0x351b4c[_0x149e('0x4b')]['id']}},_0x518c14={};_0x518c14[_0x149e('0x33')]=_['keys'](db[_0x149e('0x44')][_0x149e('0x30')]);_0x518c14[_0x149e('0x35')]=_[_0x149e('0x34')](_0x351b4c[_0x149e('0x35')]);_0x518c14['filters']=_[_0x149e('0x37')](_0x518c14['model'],_0x518c14['query']);_0x29fe28[_0x149e('0x38')]=_[_0x149e('0x37')](_0x518c14[_0x149e('0x33')],qs[_0x149e('0x39')](_0x351b4c[_0x149e('0x35')][_0x149e('0x39')]));_0x29fe28[_0x149e('0x38')]=_0x29fe28[_0x149e('0x38')]['length']?_0x29fe28[_0x149e('0x38')]:_0x518c14[_0x149e('0x33')];if(_0x351b4c[_0x149e('0x35')][_0x149e('0x45')]){_0x29fe28[_0x149e('0x46')]=[{'all':!![]}];}_0x29fe28=_[_0x149e('0x40')]({},_0x29fe28,_0x351b4c[_0x149e('0x43')]);return db[_0x149e('0x44')][_0x149e('0x4c')](_0x29fe28)[_0x149e('0x2b')](handleEntityNotFound(_0x2458f1,null))['then'](respondWithResult(_0x2458f1,null))[_0x149e('0x49')](handleError(_0x2458f1,null));};exports['create']=function(_0xf0b71f,_0x2f4785){return db[_0x149e('0x44')][_0x149e('0x4d')](_0xf0b71f['body'],{})['then'](function(_0x3a9285){var _0x1c2047=_0xf0b71f['user']['get']({'plain':!![]});if(!_0x1c2047)throw new Error(_0x149e('0x4e'));if(_0x1c2047[_0x149e('0x4f')]===_0x149e('0x50')){var _0x925d1=_0x3a9285[_0x149e('0x28')]({'plain':!![]});var _0x4d1d5c='OpenchannelQueues';return db[_0x149e('0x51')][_0x149e('0x4c')]({'where':{'name':_0x4d1d5c,'userProfileId':_0x1c2047[_0x149e('0x52')]},'raw':!![]})[_0x149e('0x2b')](function(_0x449ada){if(_0x449ada&&_0x449ada['autoAssociation']===0x0){return db[_0x149e('0x29')][_0x149e('0x4d')]({'name':_0x925d1[_0x149e('0x2d')],'resourceId':_0x925d1['id'],'type':_0x449ada['name'],'sectionId':_0x449ada['id']},{})[_0x149e('0x2b')](function(){return _0x3a9285;});}else{return _0x3a9285;}})[_0x149e('0x49')](function(_0x2c0ed){logger[_0x149e('0x53')](_0x149e('0x54'),_0x2c0ed);throw _0x2c0ed;});}return _0x3a9285;})[_0x149e('0x2b')](respondWithResult(_0x2f4785,0xc9))[_0x149e('0x49')](handleError(_0x2f4785,null));};exports[_0x149e('0x27')]=function(_0x2f3527,_0x5d3007){if(_0x2f3527[_0x149e('0x55')]['id']){delete _0x2f3527['body']['id'];}return db[_0x149e('0x44')][_0x149e('0x4c')]({'where':{'id':_0x2f3527[_0x149e('0x4b')]['id']}})[_0x149e('0x2b')](handleEntityNotFound(_0x5d3007,null))[_0x149e('0x2b')](saveUpdates(_0x2f3527[_0x149e('0x55')],null))[_0x149e('0x2b')](respondWithResult(_0x5d3007,null))[_0x149e('0x49')](handleError(_0x5d3007,null));};exports[_0x149e('0x2a')]=function(_0x43565c,_0x5c4d4a){return db[_0x149e('0x44')]['find']({'where':{'id':_0x43565c[_0x149e('0x4b')]['id']}})[_0x149e('0x2b')](handleEntityNotFound(_0x5c4d4a,null))[_0x149e('0x2b')](removeEntity(_0x5c4d4a,null))[_0x149e('0x49')](handleError(_0x5c4d4a,null));};exports['describe']=function(_0x1cfb09,_0x4c2d5f){return db['OpenchannelQueue']['describe']()[_0x149e('0x2b')](respondWithResult(_0x4c2d5f,null))[_0x149e('0x49')](handleError(_0x4c2d5f,null));};exports[_0x149e('0x56')]=function(_0x438c6a,_0x4771ab,_0x23331f){var _0x409d7f={'raw':!![],'where':{}},_0x776a36={},_0x34f4c1;return db[_0x149e('0x44')][_0x149e('0x57')]({'where':{'id':_0x438c6a[_0x149e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4771ab,null))[_0x149e('0x2b')](function(_0x1a16f7){if(_0x1a16f7){_0x34f4c1=_0x1a16f7[_0x149e('0x28')]({'plain':!![]});_0x776a36[_0x149e('0x33')]=_[_0x149e('0x34')](db[_0x149e('0x58')][_0x149e('0x30')]);_0x776a36['query']=_['keys'](_0x438c6a['query']);_0x776a36[_0x149e('0x36')]=_[_0x149e('0x37')](_0x776a36[_0x149e('0x33')],_0x776a36[_0x149e('0x35')]);_0x409d7f[_0x149e('0x38')]=_[_0x149e('0x37')](_0x776a36[_0x149e('0x33')],qs[_0x149e('0x39')](_0x438c6a[_0x149e('0x35')][_0x149e('0x39')]));_0x409d7f[_0x149e('0x38')]=_0x409d7f[_0x149e('0x38')][_0x149e('0x3a')]?_0x409d7f[_0x149e('0x38')]:_0x776a36['model'];if(!_0x438c6a[_0x149e('0x35')][_0x149e('0x3b')](_0x149e('0x3c'))){_0x409d7f['limit']=qs[_0x149e('0x23')](_0x438c6a[_0x149e('0x35')][_0x149e('0x23')]);_0x409d7f[_0x149e('0x22')]=qs[_0x149e('0x22')](_0x438c6a[_0x149e('0x35')][_0x149e('0x22')]);}_0x409d7f[_0x149e('0x3d')]=qs[_0x149e('0x59')](_0x438c6a[_0x149e('0x35')][_0x149e('0x59')]);_0x409d7f[_0x149e('0x3f')]=qs[_0x149e('0x36')](_[_0x149e('0x5a')](_0x438c6a[_0x149e('0x35')],_0x776a36[_0x149e('0x36')]));_0x409d7f[_0x149e('0x3f')][_0x149e('0x5b')]=_0x1a16f7['id'];if(_0x438c6a['query']['filter']){_0x409d7f[_0x149e('0x3f')]=_['merge'](_0x409d7f[_0x149e('0x3f')],{'$or':_[_0x149e('0x41')](_0x409d7f[_0x149e('0x38')],function(_0x82f057){var _0x225c70={};_0x225c70[_0x82f057]={'$like':'%'+_0x438c6a[_0x149e('0x35')]['filter']+'%'};return _0x225c70;})});}_0x409d7f=_['merge']({},_0x409d7f,_0x438c6a['options']);return db['UserOpenchannelQueue']['findAll'](_0x409d7f);}})['then'](function(_0x4dac50){if(_0x4dac50){return db[_0x149e('0x5c')][_0x149e('0x5d')]({'where':{'id':_[_0x149e('0x41')](_0x4dac50,_0x149e('0x5e')),'role':'agent'},'attributes':['id',_0x149e('0x2d'),_0x149e('0x5f'),_0x149e('0x60'),'createdAt']});}})[_0x149e('0x2b')](function(_0x558ae2){if(_0x558ae2){return{'count':_0x558ae2['count'],'rows':_[_0x149e('0x41')](_0x558ae2[_0x149e('0x48')],function(_0x1aaa3b){return{'membername':_0x1aaa3b[_0x149e('0x2d')],'UserId':_0x1aaa3b['id'],'queue_name':_0x34f4c1[_0x149e('0x2d')],'OpenchannelQueueId':_0x34f4c1['id'],'interface':util[_0x149e('0x61')](_0x149e('0x62'),_0x149e('0x63'),_0x1aaa3b[_0x149e('0x2d')]),'penalty':0x0,'paused':_0x1aaa3b[_0x149e('0x5f')],'createdAt':_0x1aaa3b[_0x149e('0x64')],'updatedAt':_0x1aaa3b[_0x149e('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x4771ab,_0x409d7f))[_0x149e('0x49')](handleError(_0x4771ab,null));};exports[_0x149e('0x65')]=function(_0x140b4a,_0x20e457,_0x504c76){var _0x44a8f8={};var _0x49ae3a={};var _0x3be270;var _0x360366;return db['OpenchannelQueue'][_0x149e('0x57')]({'where':{'id':_0x140b4a[_0x149e('0x4b')]['id']}})[_0x149e('0x2b')](handleEntityNotFound(_0x20e457,null))['then'](function(_0x33e196){if(_0x33e196){_0x3be270=_0x33e196;_0x49ae3a[_0x149e('0x33')]=_[_0x149e('0x34')](db[_0x149e('0x66')][_0x149e('0x30')]);_0x49ae3a[_0x149e('0x35')]=_[_0x149e('0x34')](_0x140b4a[_0x149e('0x35')]);_0x49ae3a[_0x149e('0x36')]=_[_0x149e('0x37')](_0x49ae3a['model'],_0x49ae3a[_0x149e('0x35')]);_0x44a8f8[_0x149e('0x38')]=_['intersection'](_0x49ae3a['model'],qs[_0x149e('0x39')](_0x140b4a[_0x149e('0x35')][_0x149e('0x39')]));_0x44a8f8['attributes']=_0x44a8f8['attributes']['length']?_0x44a8f8['attributes']:_0x49ae3a[_0x149e('0x33')];_0x44a8f8['order']=qs[_0x149e('0x59')](_0x140b4a[_0x149e('0x35')][_0x149e('0x59')]);_0x44a8f8[_0x149e('0x3f')]=qs['filters'](_[_0x149e('0x5a')](_0x140b4a[_0x149e('0x35')],_0x49ae3a['filters']));if(_0x140b4a[_0x149e('0x35')]['filter']){_0x44a8f8[_0x149e('0x3f')]=_[_0x149e('0x40')](_0x44a8f8['where'],{'$or':_[_0x149e('0x41')](_0x44a8f8[_0x149e('0x38')],function(_0x1acc2d){var _0x49e8db={};_0x49e8db[_0x1acc2d]={'$like':'%'+_0x140b4a[_0x149e('0x35')][_0x149e('0x3e')]+'%'};return _0x49e8db;})});}_0x44a8f8=_[_0x149e('0x40')]({},_0x44a8f8,_0x140b4a['options']);return _0x3be270[_0x149e('0x65')](_0x44a8f8);}})['then'](function(_0x3bc508){if(_0x3bc508){_0x360366=_0x3bc508[_0x149e('0x3a')];if(!_0x140b4a[_0x149e('0x35')][_0x149e('0x3b')](_0x149e('0x3c'))){_0x44a8f8['limit']=qs[_0x149e('0x23')](_0x140b4a[_0x149e('0x35')][_0x149e('0x23')]);_0x44a8f8[_0x149e('0x22')]=qs[_0x149e('0x22')](_0x140b4a['query'][_0x149e('0x22')]);}return _0x3be270[_0x149e('0x65')](_0x44a8f8);}})[_0x149e('0x2b')](function(_0x151a05){if(_0x151a05){return _0x151a05?{'count':_0x360366,'rows':_0x151a05}:null;}})[_0x149e('0x2b')](respondWithResult(_0x20e457,null))['catch'](handleError(_0x20e457,null));};exports[_0x149e('0x67')]=function(_0x1c0f86,_0x110c19,_0x170767){var _0x3c9288=_0x1c0f86[_0x149e('0x55')][_0x149e('0x68')];return db[_0x149e('0x66')]['findAll']({'where':{'id':_0x3c9288},'attributes':['id'],'include':[{'model':db[_0x149e('0x5c')],'as':_0x149e('0x69'),'attributes':['id',_0x149e('0x2d'),'online',_0x149e('0x6a'),_0x149e('0x6b')],'raw':!![]}]})['then'](function(_0x147d1f){if(_0x147d1f){var _0x2175d1=_[_0x149e('0x6c')](_0x147d1f,function(_0x662eeb){var _0x3bc5b9=_0x662eeb[_0x149e('0x28')]({'plain':!![]});return _0x3bc5b9[_0x149e('0x69')];});return db[_0x149e('0x44')]['find']({'where':{'id':_0x1c0f86[_0x149e('0x4b')]['id']}})[_0x149e('0x2b')](function(_0x57108f){return db['sequelize']['transaction'](function(_0x56f373){return _0x57108f[_0x149e('0x67')](_0x3c9288,{'transaction':_0x56f373})[_0x149e('0x2b')](function(){return BPromise[_0x149e('0x6d')](_0x2175d1,function(_0x59471d){return db[_0x149e('0x58')][_0x149e('0x6e')]({'where':{'UserId':_0x59471d['id'],'OpenchannelQueueId':_0x1c0f86[_0x149e('0x4b')]['id']},'transaction':_0x56f373});});})[_0x149e('0x2b')](function(){_0x2175d1['forEach'](function(_0x4f294a){socket[_0x149e('0x6f')](_0x149e('0x70'),{'UserId':_0x4f294a['id'],'OpenchannelQueueId':_0x57108f['id']});});});});});}})[_0x149e('0x2b')](respondWithStatusCode(_0x110c19,null))['catch'](handleError(_0x110c19,null));};exports[_0x149e('0x71')]=function(_0x52bb31,_0x8d418,_0x5190c6){return db['Team'][_0x149e('0x47')]({'where':{'id':_0x52bb31['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x149e('0x5c')],'as':_0x149e('0x69'),'attributes':['id'],'raw':!![]}]})[_0x149e('0x2b')](handleEntityNotFound(_0x8d418,null))[_0x149e('0x2b')](function(_0x1f4281){var _0x3e7c84=_[_0x149e('0x41')](_0x1f4281,'id');var _0x20a38d=[];var _0x4332c3=[];var _0x55a60b=squel[_0x149e('0x72')]();_0x55a60b['field'](_0x149e('0x73'))['from'](_0x149e('0x74'),'tq')[_0x149e('0x75')](_0x149e('0x76'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x149e('0x3f')](_0x149e('0x77'),_0x52bb31[_0x149e('0x4b')]['id']);for(var _0x5488db=0x0;_0x5488db<_0x1f4281[_0x149e('0x3a')];_0x5488db+=0x1){let _0x111131=_0x1f4281[_0x5488db];for(var _0x3cb5c2=0x0;_0x3cb5c2<_0x111131['Agents'][_0x149e('0x3a')];_0x3cb5c2+=0x1){let _0x3c05de=_0x111131[_0x149e('0x69')][_0x3cb5c2];var _0x5ef9c8=_0x55a60b[_0x149e('0x78')]();_0x5ef9c8['where'](_0x149e('0x79'),_0x3c05de['id']);_0x4332c3['push'](db['sequelize'][_0x149e('0x35')](_0x5ef9c8['toString'](),{'type':db[_0x149e('0x7a')][_0x149e('0x7b')][_0x149e('0x7c')]})[_0x149e('0x2b')](function(_0x4aa63e){if(_0x4aa63e[_0x149e('0x3a')]===0x1){return _0x3c05de['id'];}else{var _0x43faaa=_['every'](_[_0x149e('0x41')](_0x4aa63e,_0x149e('0x7d')),function(_0x3e0549){return _[_0x149e('0x7e')](_0x3e7c84,_0x3e0549);});if(_0x43faaa){return _0x3c05de['id'];}}}));}}return BPromise[_0x149e('0x7f')](_0x4332c3)['then'](function(_0x41d3b1){_0x20a38d=_(_0x20a38d)['union'](_0x41d3b1)['compact']()[_0x149e('0x80')]();return db[_0x149e('0x44')]['find']({'where':{'id':_0x52bb31[_0x149e('0x4b')]['id']}})[_0x149e('0x2b')](function(_0x46586d){return db[_0x149e('0x7a')][_0x149e('0x81')](function(_0x6e6f1a){return _0x46586d['removeTeams'](_0x52bb31[_0x149e('0x35')][_0x149e('0x68')],{'transaction':_0x6e6f1a})[_0x149e('0x2b')](function(){if(!_[_0x149e('0x82')](_0x20a38d)){return _0x46586d[_0x149e('0x83')](_0x20a38d,{'transaction':_0x6e6f1a});}})[_0x149e('0x2b')](function(){_0x20a38d[_0x149e('0x84')](function(_0x5dba09){socket[_0x149e('0x6f')]('userOpenchannelQueue:remove',{'UserId':_0x5dba09,'OpenchannelQueueId':_0x46586d['id']});});});});});});})['then'](respondWithStatusCode(_0x8d418,null))[_0x149e('0x49')](handleError(_0x8d418,null));};exports[_0x149e('0x85')]=function(_0x29ed03,_0x13d428,_0x3d0fda){return db['OpenchannelQueue']['find']({'where':{'id':_0x29ed03[_0x149e('0x4b')]['id']}})[_0x149e('0x2b')](handleEntityNotFound(_0x13d428,null))[_0x149e('0x2b')](function(_0x295dd0){if(_0x295dd0){return _0x295dd0[_0x149e('0x85')](_0x29ed03['body'][_0x149e('0x68')],_[_0x149e('0x86')](_0x29ed03[_0x149e('0x55')],[_0x149e('0x68'),'id'])||{})[_0x149e('0x87')](function(_0x3b4f3a){for(var _0x1398b2=0x0;_0x1398b2<_0x29ed03[_0x149e('0x55')]['ids'][_0x149e('0x3a')];_0x1398b2+=0x1){socket[_0x149e('0x6f')](_0x149e('0x70'),{'UserId':_0x29ed03[_0x149e('0x55')][_0x149e('0x68')][_0x1398b2],'OpenchannelQueueId':_0x29ed03[_0x149e('0x4b')]['id']});}return _0x3b4f3a;});}})[_0x149e('0x2b')](respondWithResult(_0x13d428,null))[_0x149e('0x49')](handleError(_0x13d428,null));};exports[_0x149e('0x83')]=function(_0x2b51d0,_0x281795,_0x19b1f7){return db[_0x149e('0x44')][_0x149e('0x4c')]({'where':{'id':_0x2b51d0[_0x149e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x281795,null))[_0x149e('0x2b')](function(_0xcdeb0c){if(_0xcdeb0c){return _0xcdeb0c[_0x149e('0x83')](_0x2b51d0[_0x149e('0x35')][_0x149e('0x68')])[_0x149e('0x2b')](function(){if(_[_0x149e('0x88')](_0x2b51d0[_0x149e('0x35')][_0x149e('0x68')])){for(var _0x5eb065=0x0;_0x5eb065<_0x2b51d0[_0x149e('0x35')][_0x149e('0x68')][_0x149e('0x3a')];_0x5eb065+=0x1){socket[_0x149e('0x6f')](_0x149e('0x89'),{'UserId':Number(_0x2b51d0[_0x149e('0x35')][_0x149e('0x68')][_0x5eb065]),'OpenchannelQueueId':Number(_0x2b51d0[_0x149e('0x4b')]['id'])});}}else{socket[_0x149e('0x6f')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2b51d0[_0x149e('0x35')][_0x149e('0x68')]),'OpenchannelQueueId':Number(_0x2b51d0['params']['id'])});}});}})['then'](respondWithStatusCode(_0x281795,null))[_0x149e('0x49')](handleError(_0x281795,null));};exports['getAgents']=function(_0x1c2e71,_0x460c13,_0x57cade){var _0x809eb9={};var _0xcdb744={};var _0x3d4875;var _0x3a1b75;return db[_0x149e('0x44')]['findOne']({'where':{'id':_0x1c2e71[_0x149e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x460c13,null))[_0x149e('0x2b')](function(_0x2d51bb){if(_0x2d51bb){_0x3d4875=_0x2d51bb;_0xcdb744[_0x149e('0x33')]=_[_0x149e('0x34')](db['User']['rawAttributes']);_0xcdb744[_0x149e('0x35')]=_[_0x149e('0x34')](_0x1c2e71['query']);_0xcdb744[_0x149e('0x36')]=_['intersection'](_0xcdb744[_0x149e('0x33')],_0xcdb744['query']);_0x809eb9['attributes']=_['intersection'](_0xcdb744['model'],qs[_0x149e('0x39')](_0x1c2e71[_0x149e('0x35')][_0x149e('0x39')]));_0x809eb9['attributes']=_0x809eb9[_0x149e('0x38')][_0x149e('0x3a')]?_0x809eb9[_0x149e('0x38')]:_0xcdb744[_0x149e('0x33')];_0x809eb9[_0x149e('0x3d')]=qs[_0x149e('0x59')](_0x1c2e71[_0x149e('0x35')]['sort']);_0x809eb9[_0x149e('0x3f')]=qs[_0x149e('0x36')](_['pick'](_0x1c2e71[_0x149e('0x35')],_0xcdb744[_0x149e('0x36')]));if(_0x1c2e71['query'][_0x149e('0x3e')]){_0x809eb9[_0x149e('0x3f')]=_[_0x149e('0x40')](_0x809eb9[_0x149e('0x3f')],{'$or':_[_0x149e('0x41')](_0x809eb9[_0x149e('0x38')],function(_0x18a040){var _0x49c259={};_0x49c259[_0x18a040]={'$like':'%'+_0x1c2e71['query'][_0x149e('0x3e')]+'%'};return _0x49c259;})});}_0x809eb9=_[_0x149e('0x40')]({},_0x809eb9,_0x1c2e71[_0x149e('0x43')]);return _0x3d4875[_0x149e('0x8a')](_0x809eb9);}})[_0x149e('0x2b')](function(_0x2eea55){if(_0x2eea55){_0x3a1b75=_0x2eea55[_0x149e('0x3a')];if(!_0x1c2e71[_0x149e('0x35')]['hasOwnProperty'](_0x149e('0x3c'))){_0x809eb9[_0x149e('0x23')]=qs[_0x149e('0x23')](_0x1c2e71[_0x149e('0x35')][_0x149e('0x23')]);_0x809eb9['offset']=qs[_0x149e('0x22')](_0x1c2e71['query'][_0x149e('0x22')]);}return _0x3d4875[_0x149e('0x8a')](_0x809eb9);}})[_0x149e('0x2b')](function(_0x7bf05f){if(_0x7bf05f){return _0x7bf05f?{'count':_0x3a1b75,'rows':_0x7bf05f}:null;}})['then'](respondWithResult(_0x460c13,null))['catch'](handleError(_0x460c13,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 04e5eed..7bf65d2 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 _0x85f0=['OpenchannelQueue','save','update','emit','hasOwnProperty','exports','events','../../mysqldb'];(function(_0xf7831f,_0x1c6188){var _0x3f88e7=function(_0x2c6d4e){while(--_0x2c6d4e){_0xf7831f['push'](_0xf7831f['shift']());}};_0x3f88e7(++_0x1c6188);}(_0x85f0,0x17e));var _0x085f=function(_0x4ca333,_0x1218a3){_0x4ca333=_0x4ca333-0x0;var _0x13b2e1=_0x85f0[_0x4ca333];return _0x13b2e1;};'use strict';var EventEmitter=require(_0x085f('0x0'));var OpenchannelQueue=require(_0x085f('0x1'))['db'][_0x085f('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x085f('0x3'),'afterUpdate':_0x085f('0x4'),'afterDestroy':'remove'};function emitEvent(_0x21a3ae){return function(_0x2a1a0f,_0xb0587d,_0x5dd285){OpenchannelQueueEvents[_0x085f('0x5')](_0x21a3ae+':'+_0x2a1a0f['id'],_0x2a1a0f);OpenchannelQueueEvents[_0x085f('0x5')](_0x21a3ae,_0x2a1a0f);_0x5dd285(null);};}for(var e in events){if(events[_0x085f('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0x085f('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x66ec=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelQueue','setMaxListeners','save','update'];(function(_0x2aa48b,_0x5a4446){var _0x48caf8=function(_0x13230c){while(--_0x13230c){_0x2aa48b['push'](_0x2aa48b['shift']());}};_0x48caf8(++_0x5a4446);}(_0x66ec,0x170));var _0xc66e=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0x66ec[_0x555b2f];return _0x81c0a6;};'use strict';var EventEmitter=require(_0xc66e('0x0'));var OpenchannelQueue=require(_0xc66e('0x1'))['db'][_0xc66e('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc66e('0x3')](0x0);var events={'afterCreate':_0xc66e('0x4'),'afterUpdate':_0xc66e('0x5'),'afterDestroy':_0xc66e('0x6')};function emitEvent(_0x5e511f){return function(_0x37d430,_0x57a414,_0x54e34b){OpenchannelQueueEvents[_0xc66e('0x7')](_0x5e511f+':'+_0x37d430['id'],_0x37d430);OpenchannelQueueEvents[_0xc66e('0x7')](_0x5e511f,_0x37d430);_0x54e34b(null);};}for(var e in events){if(events[_0xc66e('0x8')](e)){var event=events[e];OpenchannelQueue[_0xc66e('0x9')](e,emitEvent(event));}}module[_0xc66e('0xa')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 9e60cab..8534334 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 _0xebb1=['./openchannelQueue.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x3398ed,_0x5374ee){var _0x5ed583=function(_0x1d63c7){while(--_0x1d63c7){_0x3398ed['push'](_0x3398ed['shift']());}};_0x5ed583(++_0x5374ee);}(_0xebb1,0x1e3));var _0x1ebb=function(_0x177ff2,_0x472258){_0x177ff2=_0x177ff2-0x0;var _0x289751=_0xebb1[_0x177ff2];return _0x289751;};'use strict';var _=require('lodash');var util=require(_0x1ebb('0x0'));var logger=require(_0x1ebb('0x1'))(_0x1ebb('0x2'));var moment=require(_0x1ebb('0x3'));var BPromise=require(_0x1ebb('0x4'));var rp=require(_0x1ebb('0x5'));var fs=require('fs');var path=require(_0x1ebb('0x6'));var rimraf=require(_0x1ebb('0x7'));var config=require(_0x1ebb('0x8'));var attributes=require(_0x1ebb('0x9'));module[_0x1ebb('0xa')]=function(_0x58d76b,_0x3628f2){return _0x58d76b[_0x1ebb('0xb')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde71=['path','rimraf','../../config/environment','./openchannelQueue.attributes','define','OpenchannelQueue','openchannel_queues','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x202517,_0x47ada9){var _0x72463a=function(_0x452ad4){while(--_0x452ad4){_0x202517['push'](_0x202517['shift']());}};_0x72463a(++_0x47ada9);}(_0xde71,0x1c1));var _0x1de7=function(_0x17784a,_0x42fe44){_0x17784a=_0x17784a-0x0;var _0x41aded=_0xde71[_0x17784a];return _0x41aded;};'use strict';var _=require(_0x1de7('0x0'));var util=require(_0x1de7('0x1'));var logger=require(_0x1de7('0x2'))(_0x1de7('0x3'));var moment=require('moment');var BPromise=require(_0x1de7('0x4'));var rp=require(_0x1de7('0x5'));var fs=require('fs');var path=require(_0x1de7('0x6'));var rimraf=require(_0x1de7('0x7'));var config=require(_0x1de7('0x8'));var attributes=require(_0x1de7('0x9'));module['exports']=function(_0x34d17a,_0xd38b7f){return _0x34d17a[_0x1de7('0xa')](_0x1de7('0xb'),attributes,{'tableName':_0x1de7('0xc'),'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 a146683..747fbea 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 _0x129f=['http','redis','localhost','socket.io-emitter','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','findAll','options','raw','where','attributes','include','map','model','catch','GetOpenchannelQueue','ShowOpenchannelQueue','OpenchannelQueue','find','moment','bluebird','ioredis','../../config/logger','rpc','client'];(function(_0x2f2377,_0x11cc21){var _0x441e6b=function(_0x1d0e90){while(--_0x1d0e90){_0x2f2377['push'](_0x2f2377['shift']());}};_0x441e6b(++_0x11cc21);}(_0x129f,0x14e));var _0xf129=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x129f[_0x4b369d];return _0x571a98;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf129('0x0'));var BPromise=require(_0xf129('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf129('0x2'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf129('0x3'))(_0xf129('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf129('0x5')][_0xf129('0x6')]({'port':0x232a});config[_0xf129('0x7')]=_['defaults'](config[_0xf129('0x7')],{'host':_0xf129('0x8'),'port':0x18eb});var socket=require(_0xf129('0x9'))(new Redis(config[_0xf129('0x7')]));require('./openchannelQueue.socket')[_0xf129('0xa')](socket);function respondWithRpcPromise(_0xcf2a26,_0x43bfe9,_0x1af860){return new BPromise(function(_0xa56dce,_0x11c6b0){return client[_0xf129('0xb')](_0xcf2a26,_0x1af860)[_0xf129('0xc')](function(_0x298184){logger[_0xf129('0xd')](_0xf129('0xe'),_0x43bfe9,_0xf129('0xf'));logger[_0xf129('0x10')](_0xf129('0x11'),_0x43bfe9,_0xf129('0xf'),JSON[_0xf129('0x12')](_0x298184));if(_0x298184[_0xf129('0x13')]){if(_0x298184[_0xf129('0x13')]['code']===0x1f4){logger['error'](_0xf129('0xe'),_0x43bfe9,_0x298184[_0xf129('0x13')][_0xf129('0x14')]);return _0x11c6b0(_0x298184[_0xf129('0x13')][_0xf129('0x14')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x43bfe9,_0x298184[_0xf129('0x13')]['message']);return _0xa56dce(_0x298184['error'][_0xf129('0x14')]);}else{logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x43bfe9,'request\x20sent');_0xa56dce(_0x298184['result'][_0xf129('0x14')]);}})['catch'](function(_0xa9f3d0){logger[_0xf129('0x13')](_0xf129('0xe'),_0x43bfe9,_0xa9f3d0);_0x11c6b0(_0xa9f3d0);});});}exports['GetOpenchannelQueue']=function(_0x28e9c8){var _0x50cbc3=this;return new Promise(function(_0x16691b,_0x2c6326){return db['OpenchannelQueue'][_0xf129('0x15')]({'raw':_0x28e9c8[_0xf129('0x16')]?_0x28e9c8['options'][_0xf129('0x17')]===undefined?!![]:![]:!![],'where':_0x28e9c8['options']?_0x28e9c8[_0xf129('0x16')][_0xf129('0x18')]||null:null,'attributes':_0x28e9c8['options']?_0x28e9c8[_0xf129('0x16')][_0xf129('0x19')]||null:null,'limit':_0x28e9c8['options']?_0x28e9c8[_0xf129('0x16')]['limit']||null:null,'include':_0x28e9c8[_0xf129('0x16')]?_0x28e9c8[_0xf129('0x16')][_0xf129('0x1a')]?_[_0xf129('0x1b')](_0x28e9c8[_0xf129('0x16')][_0xf129('0x1a')],function(_0x50bb03){return{'model':db[_0x50bb03['model']],'as':_0x50bb03['as'],'attributes':_0x50bb03[_0xf129('0x19')],'include':_0x50bb03[_0xf129('0x1a')]?_[_0xf129('0x1b')](_0x50bb03['include'],function(_0x472a4f){return{'model':db[_0x472a4f[_0xf129('0x1c')]],'as':_0x472a4f['as'],'attributes':_0x472a4f['attributes'],'include':_0x472a4f[_0xf129('0x1a')]?_[_0xf129('0x1b')](_0x472a4f[_0xf129('0x1a')],function(_0x437e5d){return{'model':db[_0x437e5d[_0xf129('0x1c')]],'as':_0x437e5d['as'],'attributes':_0x437e5d[_0xf129('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf129('0xc')](function(_0x5027cc){logger[_0xf129('0xd')]('GetOpenchannelQueue',_0x28e9c8);logger[_0xf129('0x10')]('GetOpenchannelQueue',_0x28e9c8,JSON[_0xf129('0x12')](_0x5027cc));_0x16691b(_0x5027cc);})[_0xf129('0x1d')](function(_0xb5a54b){logger[_0xf129('0x13')](_0xf129('0x1e'),_0xb5a54b[_0xf129('0x14')],_0x28e9c8);_0x2c6326(_0x50cbc3[_0xf129('0x13')](0x1f4,_0xb5a54b['message']));});});};exports[_0xf129('0x1f')]=function(_0x3f313d){var _0x12cf04=this;return new Promise(function(_0x41051c,_0x3fd28e){return db[_0xf129('0x20')][_0xf129('0x21')]({'raw':_0x3f313d[_0xf129('0x16')]?_0x3f313d['options'][_0xf129('0x17')]===undefined?!![]:![]:!![],'where':_0x3f313d[_0xf129('0x16')]?_0x3f313d[_0xf129('0x16')][_0xf129('0x18')]||null:null,'attributes':_0x3f313d[_0xf129('0x16')]?_0x3f313d[_0xf129('0x16')][_0xf129('0x19')]||null:null,'include':_0x3f313d[_0xf129('0x16')]?_0x3f313d[_0xf129('0x16')]['include']?_[_0xf129('0x1b')](_0x3f313d[_0xf129('0x16')][_0xf129('0x1a')],function(_0x71996e){return{'model':db[_0x71996e[_0xf129('0x1c')]],'as':_0x71996e['as'],'attributes':_0x71996e[_0xf129('0x19')],'include':_0x71996e[_0xf129('0x1a')]?_['map'](_0x71996e['include'],function(_0x3ee021){return{'model':db[_0x3ee021[_0xf129('0x1c')]],'as':_0x3ee021['as'],'attributes':_0x3ee021[_0xf129('0x19')],'include':_0x3ee021[_0xf129('0x1a')]?_['map'](_0x3ee021[_0xf129('0x1a')],function(_0x51cf48){return{'model':db[_0x51cf48['model']],'as':_0x51cf48['as'],'attributes':_0x51cf48[_0xf129('0x19')]};}):[]};}):[]};}):[]:[]})[_0xf129('0xc')](function(_0x474301){logger[_0xf129('0xd')](_0xf129('0x1f'),_0x3f313d);logger[_0xf129('0x10')](_0xf129('0x1f'),_0x3f313d,JSON[_0xf129('0x12')](_0x474301));_0x41051c(_0x474301);})['catch'](function(_0x4fd29a){logger[_0xf129('0x13')](_0xf129('0x1f'),_0x4fd29a['message'],_0x3f313d);_0x3fd28e(_0x12cf04[_0xf129('0x13')](0x1f4,_0x4fd29a[_0xf129('0x14')]));});});}; \ No newline at end of file +var _0x0750=['code','message','result','catch','findAll','options','where','attributes','limit','include','map','model','GetOpenchannelQueue','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./openchannelQueue.socket','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0x0750,0x1e2));var _0x0075=function(_0x15c09e,_0x5ee9c6){_0x15c09e=_0x15c09e-0x0;var _0x364fee=_0x0750[_0x15c09e];return _0x364fee;};'use strict';var _=require(_0x0075('0x0'));var util=require(_0x0075('0x1'));var moment=require(_0x0075('0x2'));var BPromise=require(_0x0075('0x3'));var rs=require(_0x0075('0x4'));var fs=require('fs');var Redis=require(_0x0075('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0075('0x6'));var logger=require(_0x0075('0x7'))(_0x0075('0x8'));var config=require(_0x0075('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x0075('0xa')]['http']({'port':0x232a});config[_0x0075('0xb')]=_[_0x0075('0xc')](config['redis'],{'host':_0x0075('0xd'),'port':0x18eb});var socket=require(_0x0075('0xe'))(new Redis(config[_0x0075('0xb')]));require(_0x0075('0xf'))['register'](socket);function respondWithRpcPromise(_0x4960d1,_0x1cc5c2,_0x15885a){return new BPromise(function(_0x11c413,_0x1e4b46){return client[_0x0075('0x10')](_0x4960d1,_0x15885a)[_0x0075('0x11')](function(_0x56412f){logger[_0x0075('0x12')](_0x0075('0x13'),_0x1cc5c2,_0x0075('0x14'));logger[_0x0075('0x15')](_0x0075('0x16'),_0x1cc5c2,_0x0075('0x14'),JSON[_0x0075('0x17')](_0x56412f));if(_0x56412f[_0x0075('0x18')]){if(_0x56412f[_0x0075('0x18')][_0x0075('0x19')]===0x1f4){logger[_0x0075('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x1cc5c2,_0x56412f[_0x0075('0x18')][_0x0075('0x1a')]);return _0x1e4b46(_0x56412f['error']['message']);}logger[_0x0075('0x18')]('OpenchannelQueue,\x20%s,\x20%s',_0x1cc5c2,_0x56412f[_0x0075('0x18')]['message']);return _0x11c413(_0x56412f['error'][_0x0075('0x1a')]);}else{logger[_0x0075('0x12')](_0x0075('0x13'),_0x1cc5c2,'request\x20sent');_0x11c413(_0x56412f[_0x0075('0x1b')]['message']);}})[_0x0075('0x1c')](function(_0xafb1fe){logger[_0x0075('0x18')](_0x0075('0x13'),_0x1cc5c2,_0xafb1fe);_0x1e4b46(_0xafb1fe);});});}exports['GetOpenchannelQueue']=function(_0x2bfa5d){var _0x1db4aa=this;return new Promise(function(_0x1603f2,_0x4ae6a7){return db['OpenchannelQueue'][_0x0075('0x1d')]({'raw':_0x2bfa5d[_0x0075('0x1e')]?_0x2bfa5d[_0x0075('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x2bfa5d['options']?_0x2bfa5d[_0x0075('0x1e')][_0x0075('0x1f')]||null:null,'attributes':_0x2bfa5d[_0x0075('0x1e')]?_0x2bfa5d[_0x0075('0x1e')][_0x0075('0x20')]||null:null,'limit':_0x2bfa5d['options']?_0x2bfa5d['options'][_0x0075('0x21')]||null:null,'include':_0x2bfa5d[_0x0075('0x1e')]?_0x2bfa5d[_0x0075('0x1e')][_0x0075('0x22')]?_['map'](_0x2bfa5d['options']['include'],function(_0x19a1e3){return{'model':db[_0x19a1e3['model']],'as':_0x19a1e3['as'],'attributes':_0x19a1e3['attributes'],'include':_0x19a1e3['include']?_[_0x0075('0x23')](_0x19a1e3['include'],function(_0x227585){return{'model':db[_0x227585[_0x0075('0x24')]],'as':_0x227585['as'],'attributes':_0x227585[_0x0075('0x20')],'include':_0x227585[_0x0075('0x22')]?_[_0x0075('0x23')](_0x227585[_0x0075('0x22')],function(_0x598593){return{'model':db[_0x598593['model']],'as':_0x598593['as'],'attributes':_0x598593[_0x0075('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0075('0x11')](function(_0x2af759){logger['info']('GetOpenchannelQueue',_0x2bfa5d);logger[_0x0075('0x15')](_0x0075('0x25'),_0x2bfa5d,JSON[_0x0075('0x17')](_0x2af759));_0x1603f2(_0x2af759);})[_0x0075('0x1c')](function(_0x171868){logger[_0x0075('0x18')](_0x0075('0x25'),_0x171868[_0x0075('0x1a')],_0x2bfa5d);_0x4ae6a7(_0x1db4aa[_0x0075('0x18')](0x1f4,_0x171868[_0x0075('0x1a')]));});});};exports[_0x0075('0x26')]=function(_0xf46e00){var _0x37ecaf=this;return new Promise(function(_0x4ff639,_0x2cfc6a){return db['OpenchannelQueue']['find']({'raw':_0xf46e00[_0x0075('0x1e')]?_0xf46e00[_0x0075('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0xf46e00['options']?_0xf46e00['options'][_0x0075('0x1f')]||null:null,'attributes':_0xf46e00[_0x0075('0x1e')]?_0xf46e00[_0x0075('0x1e')][_0x0075('0x20')]||null:null,'include':_0xf46e00[_0x0075('0x1e')]?_0xf46e00[_0x0075('0x1e')]['include']?_[_0x0075('0x23')](_0xf46e00[_0x0075('0x1e')]['include'],function(_0x2ae3be){return{'model':db[_0x2ae3be[_0x0075('0x24')]],'as':_0x2ae3be['as'],'attributes':_0x2ae3be[_0x0075('0x20')],'include':_0x2ae3be[_0x0075('0x22')]?_[_0x0075('0x23')](_0x2ae3be[_0x0075('0x22')],function(_0x1cc133){return{'model':db[_0x1cc133['model']],'as':_0x1cc133['as'],'attributes':_0x1cc133[_0x0075('0x20')],'include':_0x1cc133['include']?_[_0x0075('0x23')](_0x1cc133['include'],function(_0x373843){return{'model':db[_0x373843[_0x0075('0x24')]],'as':_0x373843['as'],'attributes':_0x373843['attributes']};}):[]};}):[]};}):[]:[]})[_0x0075('0x11')](function(_0x478681){logger[_0x0075('0x12')]('ShowOpenchannelQueue',_0xf46e00);logger['debug']('ShowOpenchannelQueue',_0xf46e00,JSON[_0x0075('0x17')](_0x478681));_0x4ff639(_0x478681);})['catch'](function(_0x3d825c){logger[_0x0075('0x18')](_0x0075('0x26'),_0x3d825c[_0x0075('0x1a')],_0xf46e00);_0x2cfc6a(_0x37ecaf[_0x0075('0x18')](0x1f4,_0x3d825c[_0x0075('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 6a067ae..b891ecd 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 _0x0a68=['removeListener','register','length','./openchannelQueue.events','remove','update','emit'];(function(_0x224672,_0x42b29c){var _0x43350f=function(_0x5a111f){while(--_0x5a111f){_0x224672['push'](_0x224672['shift']());}};_0x43350f(++_0x42b29c);}(_0x0a68,0x8f));var _0x80a6=function(_0x23739d,_0x1f830b){_0x23739d=_0x23739d-0x0;var _0x1ec3e8=_0x0a68[_0x23739d];return _0x1ec3e8;};'use strict';var OpenchannelQueueEvents=require(_0x80a6('0x0'));var events=['save',_0x80a6('0x1'),_0x80a6('0x2')];function createListener(_0x3a12c5,_0x24b56d){return function(_0x5d6956){_0x24b56d[_0x80a6('0x3')](_0x3a12c5,_0x5d6956);};}function removeListener(_0x347b0a,_0x5c2414){return function(){OpenchannelQueueEvents[_0x80a6('0x4')](_0x347b0a,_0x5c2414);};}exports[_0x80a6('0x5')]=function(_0x5271a3){for(var _0x2f1cf4=0x0,_0x3eb7c5=events[_0x80a6('0x6')];_0x2f1cf4<_0x3eb7c5;_0x2f1cf4++){var _0x1b619e=events[_0x2f1cf4];var _0x57df50=createListener('openchannelQueue:'+_0x1b619e,_0x5271a3);OpenchannelQueueEvents['on'](_0x1b619e,_0x57df50);}}; \ No newline at end of file +var _0xbd55=['update','emit','register','openchannelQueue:','./openchannelQueue.events','remove'];(function(_0x3b7375,_0x2b39a8){var _0x3b40af=function(_0x613d9){while(--_0x613d9){_0x3b7375['push'](_0x3b7375['shift']());}};_0x3b40af(++_0x2b39a8);}(_0xbd55,0x1de));var _0x5bd5=function(_0x19e206,_0x3e945d){_0x19e206=_0x19e206-0x0;var _0x531b21=_0xbd55[_0x19e206];return _0x531b21;};'use strict';var OpenchannelQueueEvents=require(_0x5bd5('0x0'));var events=['save',_0x5bd5('0x1'),_0x5bd5('0x2')];function createListener(_0xe9054f,_0x4ab92c){return function(_0x5c1121){_0x4ab92c[_0x5bd5('0x3')](_0xe9054f,_0x5c1121);};}function removeListener(_0x119125,_0x4ae084){return function(){OpenchannelQueueEvents['removeListener'](_0x119125,_0x4ae084);};}exports[_0x5bd5('0x4')]=function(_0x5ea3d9){for(var _0x17a3c1=0x0,_0x5342ff=events['length'];_0x17a3c1<_0x5342ff;_0x17a3c1++){var _0xc5eb54=events[_0x17a3c1];var _0x187427=createListener(_0x5bd5('0x5')+_0xc5eb54,_0x5ea3d9);OpenchannelQueueEvents['on'](_0xc5eb54,_0x187427);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 29c7222..bbcb126 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 _0xa2ea=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','/describe','/:id','show','post','create','put','update','delete','destroy'];(function(_0x3fa545,_0x38658b){var _0x1149f0=function(_0x383acb){while(--_0x383acb){_0x3fa545['push'](_0x3fa545['shift']());}};_0x1149f0(++_0x38658b);}(_0xa2ea,0x168));var _0xaa2e=function(_0x4ccbe2,_0x11eacf){_0x4ccbe2=_0x4ccbe2-0x0;var _0x134525=_0xa2ea[_0x4ccbe2];return _0x134525;};'use strict';var multer=require(_0xaa2e('0x0'));var util=require(_0xaa2e('0x1'));var path=require(_0xaa2e('0x2'));var timeout=require(_0xaa2e('0x3'));var express=require('express');var router=express[_0xaa2e('0x4')]();var auth=require(_0xaa2e('0x5'));var interaction=require(_0xaa2e('0x6'));var config=require(_0xaa2e('0x7'));var controller=require(_0xaa2e('0x8'));router[_0xaa2e('0x9')]('/',auth[_0xaa2e('0xa')](),controller['index']);router['get'](_0xaa2e('0xb'),auth[_0xaa2e('0xa')](),controller['describe']);router['get'](_0xaa2e('0xc'),auth[_0xaa2e('0xa')](),controller[_0xaa2e('0xd')]);router[_0xaa2e('0xe')]('/',auth[_0xaa2e('0xa')](),controller[_0xaa2e('0xf')]);router[_0xaa2e('0x10')](_0xaa2e('0xc'),auth[_0xaa2e('0xa')](),controller[_0xaa2e('0x11')]);router[_0xaa2e('0x12')](_0xaa2e('0xc'),auth[_0xaa2e('0xa')](),controller[_0xaa2e('0x13')]);module['exports']=router; \ No newline at end of file +var _0x6d7a=['delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','isAuthenticated','get','/describe','describe','/:id','show','put'];(function(_0x2b8671,_0x51bedb){var _0x4d95dd=function(_0x57e8c9){while(--_0x57e8c9){_0x2b8671['push'](_0x2b8671['shift']());}};_0x4d95dd(++_0x51bedb);}(_0x6d7a,0x1d6));var _0xa6d7=function(_0x2d41b8,_0x20d54d){_0x2d41b8=_0x2d41b8-0x0;var _0x40cb74=_0x6d7a[_0x2d41b8];return _0x40cb74;};'use strict';var multer=require(_0xa6d7('0x0'));var util=require('util');var path=require(_0xa6d7('0x1'));var timeout=require(_0xa6d7('0x2'));var express=require(_0xa6d7('0x3'));var router=express[_0xa6d7('0x4')]();var auth=require(_0xa6d7('0x5'));var interaction=require(_0xa6d7('0x6'));var config=require(_0xa6d7('0x7'));var controller=require(_0xa6d7('0x8'));router['get']('/',auth[_0xa6d7('0x9')](),controller['index']);router[_0xa6d7('0xa')](_0xa6d7('0xb'),auth['isAuthenticated'](),controller[_0xa6d7('0xc')]);router[_0xa6d7('0xa')](_0xa6d7('0xd'),auth[_0xa6d7('0x9')](),controller[_0xa6d7('0xe')]);router['post']('/',auth[_0xa6d7('0x9')](),controller['create']);router[_0xa6d7('0xf')](_0xa6d7('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xa6d7('0x10')](_0xa6d7('0xd'),auth[_0xa6d7('0x9')](),controller[_0xa6d7('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index 19d0461..9bceb07 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 _0x6835=['exports','STRING','DATE','moment','sequelize'];(function(_0x4a7976,_0x3bbc28){var _0x3bcc75=function(_0x590fa2){while(--_0x590fa2){_0x4a7976['push'](_0x4a7976['shift']());}};_0x3bcc75(++_0x3bbc28);}(_0x6835,0x17a));var _0x5683=function(_0x66e1f0,_0x952c3f){_0x66e1f0=_0x66e1f0-0x0;var _0x19df36=_0x6835[_0x66e1f0];return _0x19df36;};'use strict';var moment=require(_0x5683('0x0'));var Sequelize=require(_0x5683('0x1'));module[_0x5683('0x2')]={'uniqueid':{'type':Sequelize[_0x5683('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x5683('0x3')]},'joinAt':{'type':Sequelize[_0x5683('0x4')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x5683('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x5683('0x3')]}}; \ No newline at end of file +var _0x2baa=['moment','sequelize','STRING','DATE'];(function(_0x8f3d23,_0x2275be){var _0x82b087=function(_0x2ecdd4){while(--_0x2ecdd4){_0x8f3d23['push'](_0x8f3d23['shift']());}};_0x82b087(++_0x2275be);}(_0x2baa,0x14c));var _0xa2ba=function(_0x3aafb3,_0x551aa0){_0x3aafb3=_0x3aafb3-0x0;var _0x2999d7=_0x2baa[_0x3aafb3];return _0x2999d7;};'use strict';var moment=require(_0xa2ba('0x0'));var Sequelize=require(_0xa2ba('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0xa2ba('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xa2ba('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa2ba('0x3')]},'reason':{'type':Sequelize[_0xa2ba('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 4b583f0..a68a1d6 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 _0x1189=['merge','VIRTUAL','filter','rows','catch','params','keys','includeAll','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','then','destroy','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','fieldName','type','key','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters'];(function(_0x21c14f,_0x2c1d2e){var _0x2b1dc6=function(_0x5cbda9){while(--_0x5cbda9){_0x21c14f['push'](_0x21c14f['shift']());}};_0x2b1dc6(++_0x2c1d2e);}(_0x1189,0x17f));var _0x9118=function(_0x124128,_0x1934dd){_0x124128=_0x124128-0x0;var _0x25079e=_0x1189[_0x124128];return _0x25079e;};'use strict';var pdf=require(_0x9118('0x0'));var emlformat=require(_0x9118('0x1'));var rimraf=require(_0x9118('0x2'));var zipdir=require(_0x9118('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9118('0x4'));var moment=require(_0x9118('0x5'));var BPromise=require(_0x9118('0x6'));var Mustache=require(_0x9118('0x7'));var util=require(_0x9118('0x8'));var path=require(_0x9118('0x9'));var sox=require(_0x9118('0xa'));var csv=require('to-csv');var ejs=require(_0x9118('0xb'));var fs=require('fs');var _=require(_0x9118('0xc'));var squel=require(_0x9118('0xd'));var crypto=require(_0x9118('0xe'));var jsforce=require(_0x9118('0xf'));var deskjs=require(_0x9118('0x10'));var toCsv=require('to-csv');var querystring=require(_0x9118('0x11'));var Papa=require(_0x9118('0x12'));var Redis=require(_0x9118('0x13'));var authService=require(_0x9118('0x14'));var qs=require(_0x9118('0x15'));var as=require(_0x9118('0x16'));var hardwareService=require(_0x9118('0x17'));var logger=require('../../config/logger')(_0x9118('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9118('0x19'))['db'];function respondWithStatusCode(_0x30e5a5,_0x57a2ee){_0x57a2ee=_0x57a2ee||0xcc;return function(_0x3b2bd0){if(_0x3b2bd0){return _0x30e5a5[_0x9118('0x1a')](_0x57a2ee);}return _0x30e5a5[_0x9118('0x1b')](_0x57a2ee)[_0x9118('0x1c')]();};}function respondWithResult(_0x32d820,_0x3817ab){_0x3817ab=_0x3817ab||0xc8;return function(_0x42c301){if(_0x42c301){return _0x32d820[_0x9118('0x1b')](_0x3817ab)[_0x9118('0x1d')](_0x42c301);}};}function respondWithFilteredResult(_0x389301,_0x2c1ab4){return function(_0x48e13a){if(_0x48e13a){var _0x5c403d=_0x48e13a[_0x9118('0x1e')],_0x30241a=_0x2c1ab4[_0x9118('0x1f')],_0x563d91=_0x2c1ab4[_0x9118('0x1f')]+_0x2c1ab4['limit'],_0x45a089;if(_0x563d91>=_0x5c403d){_0x563d91=_0x5c403d;_0x45a089=0xc8;}else{_0x45a089=0xce;}_0x389301[_0x9118('0x1b')](_0x45a089);return _0x389301['set'](_0x9118('0x20'),_0x30241a+'-'+_0x563d91+'/'+_0x5c403d)['json'](_0x48e13a);}return null;};}function patchUpdates(_0x2dda6a){return function(_0x3f30a0){try{jsonpatch['apply'](_0x3f30a0,_0x2dda6a,!![]);}catch(_0x2763a3){return BPromise[_0x9118('0x21')](_0x2763a3);}return _0x3f30a0[_0x9118('0x22')]();};}function saveUpdates(_0x172d10,_0x30756f){return function(_0x5e683e){if(_0x5e683e){return _0x5e683e[_0x9118('0x23')](_0x172d10)[_0x9118('0x24')](function(_0x3e41c5){return _0x3e41c5;});}return null;};}function removeEntity(_0x2cd550,_0x3bae42){return function(_0x87dfa9){if(_0x87dfa9){return _0x87dfa9[_0x9118('0x25')]()[_0x9118('0x24')](function(){_0x2cd550[_0x9118('0x1b')](0xcc)[_0x9118('0x1c')]();});}};}function handleEntityNotFound(_0x5613dc,_0x2f338e){return function(_0x5b0c3b){if(!_0x5b0c3b){_0x5613dc[_0x9118('0x1a')](0x194);}return _0x5b0c3b;};}function handleError(_0x2a2ee8,_0x368bc0){_0x368bc0=_0x368bc0||0x1f4;return function(_0x54552d){logger['error'](_0x54552d[_0x9118('0x26')]);if(_0x54552d[_0x9118('0x27')]){delete _0x54552d['name'];}_0x2a2ee8[_0x9118('0x1b')](_0x368bc0)[_0x9118('0x28')](_0x54552d);};}exports[_0x9118('0x29')]=function(_0x26a88d,_0x730b31){var _0x12c254={},_0x3ff148={},_0x1f995f={'count':0x0,'rows':[]};var _0x5397be=_[_0x9118('0x2a')](db[_0x9118('0x2b')][_0x9118('0x2c')],function(_0x71cd37){return{'name':_0x71cd37[_0x9118('0x2d')],'type':_0x71cd37[_0x9118('0x2e')][_0x9118('0x2f')]};});_0x3ff148[_0x9118('0x30')]=_['map'](_0x5397be,_0x9118('0x27'));_0x3ff148[_0x9118('0x31')]=_['keys'](_0x26a88d[_0x9118('0x31')]);_0x3ff148['filters']=_['intersection'](_0x3ff148['model'],_0x3ff148[_0x9118('0x31')]);_0x12c254[_0x9118('0x32')]=_[_0x9118('0x33')](_0x3ff148[_0x9118('0x30')],qs[_0x9118('0x34')](_0x26a88d[_0x9118('0x31')][_0x9118('0x34')]));_0x12c254[_0x9118('0x32')]=_0x12c254['attributes'][_0x9118('0x35')]?_0x12c254[_0x9118('0x32')]:_0x3ff148[_0x9118('0x30')];if(!_0x26a88d['query'][_0x9118('0x36')](_0x9118('0x37'))){_0x12c254[_0x9118('0x38')]=qs['limit'](_0x26a88d[_0x9118('0x31')]['limit']);_0x12c254['offset']=qs[_0x9118('0x1f')](_0x26a88d['query'][_0x9118('0x1f')]);}_0x12c254[_0x9118('0x39')]=qs[_0x9118('0x3a')](_0x26a88d[_0x9118('0x31')][_0x9118('0x3a')]);_0x12c254[_0x9118('0x3b')]=qs[_0x9118('0x3c')](_['pick'](_0x26a88d['query'],_0x3ff148[_0x9118('0x3c')]));if(_0x26a88d[_0x9118('0x31')]['filter']){_0x12c254[_0x9118('0x3b')]=_[_0x9118('0x3d')](_0x12c254[_0x9118('0x3b')],{'$or':_['map'](_0x5397be,function(_0x1ffb75){if(_0x1ffb75[_0x9118('0x2e')]!==_0x9118('0x3e')){var _0x3bea0b={};_0x3bea0b[_0x1ffb75[_0x9118('0x27')]]={'$like':'%'+_0x26a88d[_0x9118('0x31')][_0x9118('0x3f')]+'%'};return _0x3bea0b;}})});}_0x12c254=_[_0x9118('0x3d')]({},_0x12c254,_0x26a88d['options']);var _0x32b48c={'where':_0x12c254['where']};return db['OpenchannelQueueReport'][_0x9118('0x1e')](_0x32b48c)[_0x9118('0x24')](function(_0x27cb73){_0x1f995f[_0x9118('0x1e')]=_0x27cb73;if(_0x26a88d[_0x9118('0x31')]['includeAll']){_0x12c254['include']=[{'all':!![]}];}return db['OpenchannelQueueReport']['findAll'](_0x12c254);})[_0x9118('0x24')](function(_0x543ce7){_0x1f995f[_0x9118('0x40')]=_0x543ce7;return _0x1f995f;})[_0x9118('0x24')](respondWithFilteredResult(_0x730b31,_0x12c254))[_0x9118('0x41')](handleError(_0x730b31,null));};exports['show']=function(_0x373346,_0x227bdd){var _0x5442bc={'raw':!![],'where':{'id':_0x373346[_0x9118('0x42')]['id']}},_0x4c681b={};_0x4c681b[_0x9118('0x30')]=_['keys'](db[_0x9118('0x2b')][_0x9118('0x2c')]);_0x4c681b['query']=_[_0x9118('0x43')](_0x373346[_0x9118('0x31')]);_0x4c681b[_0x9118('0x3c')]=_[_0x9118('0x33')](_0x4c681b['model'],_0x4c681b[_0x9118('0x31')]);_0x5442bc[_0x9118('0x32')]=_[_0x9118('0x33')](_0x4c681b['model'],qs[_0x9118('0x34')](_0x373346[_0x9118('0x31')][_0x9118('0x34')]));_0x5442bc['attributes']=_0x5442bc[_0x9118('0x32')][_0x9118('0x35')]?_0x5442bc[_0x9118('0x32')]:_0x4c681b[_0x9118('0x30')];if(_0x373346[_0x9118('0x31')][_0x9118('0x44')]){_0x5442bc['include']=[{'all':!![]}];}_0x5442bc=_[_0x9118('0x3d')]({},_0x5442bc,_0x373346[_0x9118('0x45')]);return db[_0x9118('0x2b')][_0x9118('0x46')](_0x5442bc)['then'](handleEntityNotFound(_0x227bdd,null))[_0x9118('0x24')](respondWithResult(_0x227bdd,null))[_0x9118('0x41')](handleError(_0x227bdd,null));};exports[_0x9118('0x47')]=function(_0x3edfe8,_0x46f86a){return db[_0x9118('0x2b')][_0x9118('0x47')](_0x3edfe8[_0x9118('0x48')],{})['then'](respondWithResult(_0x46f86a,0xc9))[_0x9118('0x41')](handleError(_0x46f86a,null));};exports[_0x9118('0x23')]=function(_0x336f05,_0x5a56bb){if(_0x336f05[_0x9118('0x48')]['id']){delete _0x336f05[_0x9118('0x48')]['id'];}return db['OpenchannelQueueReport'][_0x9118('0x46')]({'where':{'id':_0x336f05['params']['id']}})['then'](handleEntityNotFound(_0x5a56bb,null))['then'](saveUpdates(_0x336f05[_0x9118('0x48')],null))[_0x9118('0x24')](respondWithResult(_0x5a56bb,null))[_0x9118('0x41')](handleError(_0x5a56bb,null));};exports[_0x9118('0x25')]=function(_0x292981,_0x18c16e){return db[_0x9118('0x2b')]['find']({'where':{'id':_0x292981['params']['id']}})[_0x9118('0x24')](handleEntityNotFound(_0x18c16e,null))[_0x9118('0x24')](removeEntity(_0x18c16e,null))['catch'](handleError(_0x18c16e,null));};exports['describe']=function(_0x15065b,_0x4f9c9e){return db['OpenchannelQueueReport'][_0x9118('0x49')]()[_0x9118('0x24')](respondWithResult(_0x4f9c9e,null))[_0x9118('0x41')](handleError(_0x4f9c9e,null));}; \ No newline at end of file +var _0xd906=['apply','destroy','then','stack','name','send','index','map','OpenchannelQueueReport','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','find','catch','create','body','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set'];(function(_0xac8f76,_0x3dc28f){var _0xed9c43=function(_0x4756d9){while(--_0x4756d9){_0xac8f76['push'](_0xac8f76['shift']());}};_0xed9c43(++_0x3dc28f);}(_0xd906,0x6b));var _0x6d90=function(_0x35b7c5,_0x4d997e){_0x35b7c5=_0x35b7c5-0x0;var _0x35102f=_0xd906[_0x35b7c5];return _0x35102f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x6d90('0x0'));var zipdir=require(_0x6d90('0x1'));var jsonpatch=require(_0x6d90('0x2'));var rp=require(_0x6d90('0x3'));var moment=require(_0x6d90('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x6d90('0x5'));var util=require(_0x6d90('0x6'));var path=require(_0x6d90('0x7'));var sox=require(_0x6d90('0x8'));var csv=require('to-csv');var ejs=require(_0x6d90('0x9'));var fs=require('fs');var _=require(_0x6d90('0xa'));var squel=require(_0x6d90('0xb'));var crypto=require(_0x6d90('0xc'));var jsforce=require(_0x6d90('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d90('0xe'));var Redis=require(_0x6d90('0xf'));var authService=require(_0x6d90('0x10'));var qs=require(_0x6d90('0x11'));var as=require(_0x6d90('0x12'));var hardwareService=require(_0x6d90('0x13'));var logger=require(_0x6d90('0x14'))('api');var utils=require(_0x6d90('0x15'));var config=require('../../config/environment');var db=require(_0x6d90('0x16'))['db'];function respondWithStatusCode(_0x4b1ce0,_0x2e791b){_0x2e791b=_0x2e791b||0xcc;return function(_0x3c5dc9){if(_0x3c5dc9){return _0x4b1ce0[_0x6d90('0x17')](_0x2e791b);}return _0x4b1ce0[_0x6d90('0x18')](_0x2e791b)[_0x6d90('0x19')]();};}function respondWithResult(_0x579908,_0x9c7ac9){_0x9c7ac9=_0x9c7ac9||0xc8;return function(_0x2c2475){if(_0x2c2475){return _0x579908['status'](_0x9c7ac9)[_0x6d90('0x1a')](_0x2c2475);}};}function respondWithFilteredResult(_0x513417,_0x2de602){return function(_0x2c0b05){if(_0x2c0b05){var _0x1f128f=_0x2c0b05[_0x6d90('0x1b')],_0x4dc4e3=_0x2de602['offset'],_0x1e44db=_0x2de602[_0x6d90('0x1c')]+_0x2de602[_0x6d90('0x1d')],_0x49b4ad;if(_0x1e44db>=_0x1f128f){_0x1e44db=_0x1f128f;_0x49b4ad=0xc8;}else{_0x49b4ad=0xce;}_0x513417[_0x6d90('0x18')](_0x49b4ad);return _0x513417[_0x6d90('0x1e')]('Content-Range',_0x4dc4e3+'-'+_0x1e44db+'/'+_0x1f128f)['json'](_0x2c0b05);}return null;};}function patchUpdates(_0x4079c9){return function(_0x54a720){try{jsonpatch[_0x6d90('0x1f')](_0x54a720,_0x4079c9,!![]);}catch(_0x26374e){return BPromise['reject'](_0x26374e);}return _0x54a720['save']();};}function saveUpdates(_0x3f383d,_0x2ca50e){return function(_0x43b6bf){if(_0x43b6bf){return _0x43b6bf['update'](_0x3f383d)['then'](function(_0x48e63c){return _0x48e63c;});}return null;};}function removeEntity(_0x4cac22,_0x2d07f9){return function(_0x5703e6){if(_0x5703e6){return _0x5703e6[_0x6d90('0x20')]()[_0x6d90('0x21')](function(){_0x4cac22[_0x6d90('0x18')](0xcc)[_0x6d90('0x19')]();});}};}function handleEntityNotFound(_0x4378ca,_0x3dcccd){return function(_0x3aef5b){if(!_0x3aef5b){_0x4378ca[_0x6d90('0x17')](0x194);}return _0x3aef5b;};}function handleError(_0x243a32,_0x3b62da){_0x3b62da=_0x3b62da||0x1f4;return function(_0x1cf729){logger['error'](_0x1cf729[_0x6d90('0x22')]);if(_0x1cf729[_0x6d90('0x23')]){delete _0x1cf729[_0x6d90('0x23')];}_0x243a32['status'](_0x3b62da)[_0x6d90('0x24')](_0x1cf729);};}exports[_0x6d90('0x25')]=function(_0x20cbc6,_0x46d76b){var _0x40252c={},_0x41cdfc={},_0x17fada={'count':0x0,'rows':[]};var _0xd4696=_[_0x6d90('0x26')](db[_0x6d90('0x27')]['rawAttributes'],function(_0x5ec50d){return{'name':_0x5ec50d['fieldName'],'type':_0x5ec50d[_0x6d90('0x28')]['key']};});_0x41cdfc[_0x6d90('0x29')]=_[_0x6d90('0x26')](_0xd4696,_0x6d90('0x23'));_0x41cdfc[_0x6d90('0x2a')]=_[_0x6d90('0x2b')](_0x20cbc6[_0x6d90('0x2a')]);_0x41cdfc[_0x6d90('0x2c')]=_[_0x6d90('0x2d')](_0x41cdfc[_0x6d90('0x29')],_0x41cdfc[_0x6d90('0x2a')]);_0x40252c[_0x6d90('0x2e')]=_[_0x6d90('0x2d')](_0x41cdfc[_0x6d90('0x29')],qs['fields'](_0x20cbc6[_0x6d90('0x2a')][_0x6d90('0x2f')]));_0x40252c['attributes']=_0x40252c[_0x6d90('0x2e')][_0x6d90('0x30')]?_0x40252c['attributes']:_0x41cdfc[_0x6d90('0x29')];if(!_0x20cbc6[_0x6d90('0x2a')][_0x6d90('0x31')](_0x6d90('0x32'))){_0x40252c[_0x6d90('0x1d')]=qs[_0x6d90('0x1d')](_0x20cbc6[_0x6d90('0x2a')][_0x6d90('0x1d')]);_0x40252c[_0x6d90('0x1c')]=qs[_0x6d90('0x1c')](_0x20cbc6[_0x6d90('0x2a')][_0x6d90('0x1c')]);}_0x40252c[_0x6d90('0x33')]=qs[_0x6d90('0x34')](_0x20cbc6[_0x6d90('0x2a')][_0x6d90('0x34')]);_0x40252c[_0x6d90('0x35')]=qs[_0x6d90('0x2c')](_['pick'](_0x20cbc6[_0x6d90('0x2a')],_0x41cdfc['filters']));if(_0x20cbc6[_0x6d90('0x2a')][_0x6d90('0x36')]){_0x40252c['where']=_[_0x6d90('0x37')](_0x40252c[_0x6d90('0x35')],{'$or':_['map'](_0xd4696,function(_0x2d8182){if(_0x2d8182[_0x6d90('0x28')]!==_0x6d90('0x38')){var _0xae7292={};_0xae7292[_0x2d8182[_0x6d90('0x23')]]={'$like':'%'+_0x20cbc6['query'][_0x6d90('0x36')]+'%'};return _0xae7292;}})});}_0x40252c=_[_0x6d90('0x37')]({},_0x40252c,_0x20cbc6[_0x6d90('0x39')]);var _0x58f0b9={'where':_0x40252c[_0x6d90('0x35')]};return db['OpenchannelQueueReport'][_0x6d90('0x1b')](_0x58f0b9)['then'](function(_0x5519d7){_0x17fada[_0x6d90('0x1b')]=_0x5519d7;if(_0x20cbc6[_0x6d90('0x2a')][_0x6d90('0x3a')]){_0x40252c[_0x6d90('0x3b')]=[{'all':!![]}];}return db[_0x6d90('0x27')][_0x6d90('0x3c')](_0x40252c);})[_0x6d90('0x21')](function(_0x1b416b){_0x17fada[_0x6d90('0x3d')]=_0x1b416b;return _0x17fada;})[_0x6d90('0x21')](respondWithFilteredResult(_0x46d76b,_0x40252c))['catch'](handleError(_0x46d76b,null));};exports['show']=function(_0x513fe9,_0x561531){var _0x4f424c={'raw':!![],'where':{'id':_0x513fe9[_0x6d90('0x3e')]['id']}},_0x523f1e={};_0x523f1e['model']=_[_0x6d90('0x2b')](db[_0x6d90('0x27')][_0x6d90('0x3f')]);_0x523f1e[_0x6d90('0x2a')]=_['keys'](_0x513fe9[_0x6d90('0x2a')]);_0x523f1e['filters']=_[_0x6d90('0x2d')](_0x523f1e[_0x6d90('0x29')],_0x523f1e[_0x6d90('0x2a')]);_0x4f424c[_0x6d90('0x2e')]=_[_0x6d90('0x2d')](_0x523f1e['model'],qs[_0x6d90('0x2f')](_0x513fe9[_0x6d90('0x2a')][_0x6d90('0x2f')]));_0x4f424c[_0x6d90('0x2e')]=_0x4f424c[_0x6d90('0x2e')]['length']?_0x4f424c[_0x6d90('0x2e')]:_0x523f1e[_0x6d90('0x29')];if(_0x513fe9['query'][_0x6d90('0x3a')]){_0x4f424c[_0x6d90('0x3b')]=[{'all':!![]}];}_0x4f424c=_['merge']({},_0x4f424c,_0x513fe9['options']);return db[_0x6d90('0x27')][_0x6d90('0x40')](_0x4f424c)[_0x6d90('0x21')](handleEntityNotFound(_0x561531,null))[_0x6d90('0x21')](respondWithResult(_0x561531,null))[_0x6d90('0x41')](handleError(_0x561531,null));};exports[_0x6d90('0x42')]=function(_0x3beede,_0x180226){return db[_0x6d90('0x27')][_0x6d90('0x42')](_0x3beede[_0x6d90('0x43')],{})['then'](respondWithResult(_0x180226,0xc9))[_0x6d90('0x41')](handleError(_0x180226,null));};exports['update']=function(_0x5de697,_0x5c46e3){if(_0x5de697[_0x6d90('0x43')]['id']){delete _0x5de697[_0x6d90('0x43')]['id'];}return db[_0x6d90('0x27')][_0x6d90('0x40')]({'where':{'id':_0x5de697[_0x6d90('0x3e')]['id']}})[_0x6d90('0x21')](handleEntityNotFound(_0x5c46e3,null))[_0x6d90('0x21')](saveUpdates(_0x5de697[_0x6d90('0x43')],null))['then'](respondWithResult(_0x5c46e3,null))[_0x6d90('0x41')](handleError(_0x5c46e3,null));};exports[_0x6d90('0x20')]=function(_0x5eba5e,_0x2e2054){return db[_0x6d90('0x27')][_0x6d90('0x40')]({'where':{'id':_0x5eba5e[_0x6d90('0x3e')]['id']}})[_0x6d90('0x21')](handleEntityNotFound(_0x2e2054,null))[_0x6d90('0x21')](removeEntity(_0x2e2054,null))['catch'](handleError(_0x2e2054,null));};exports[_0x6d90('0x44')]=function(_0x16e9cd,_0x5301a8){return db[_0x6d90('0x27')][_0x6d90('0x44')]()[_0x6d90('0x21')](respondWithResult(_0x5301a8,null))['catch'](handleError(_0x5301a8,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 701dd82..778ecd9 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 _0x35f9=['rimraf','../../config/environment','define','OpenchannelQueueReport','report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x420f2a,_0x2cc58d){var _0x28f802=function(_0x3329cc){while(--_0x3329cc){_0x420f2a['push'](_0x420f2a['shift']());}};_0x28f802(++_0x2cc58d);}(_0x35f9,0x1df));var _0x935f=function(_0x4ecf11,_0x1952e3){_0x4ecf11=_0x4ecf11-0x0;var _0x1696c4=_0x35f9[_0x4ecf11];return _0x1696c4;};'use strict';var _=require(_0x935f('0x0'));var util=require(_0x935f('0x1'));var logger=require(_0x935f('0x2'))(_0x935f('0x3'));var moment=require('moment');var BPromise=require(_0x935f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x935f('0x5'));var config=require(_0x935f('0x6'));var attributes=require('./openchannelQueueReport.attributes');module['exports']=function(_0x287043,_0x4403e1){return _0x287043[_0x935f('0x7')](_0x935f('0x8'),attributes,{'tableName':_0x935f('0x9'),'paranoid':![],'indexes':[{'name':_0x935f('0xa'),'fields':[_0x935f('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x92f0=['../../config/logger','moment','bluebird','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport','uniqueid','util'];(function(_0x40227c,_0x5ba0a4){var _0x113636=function(_0x21b46c){while(--_0x21b46c){_0x40227c['push'](_0x40227c['shift']());}};_0x113636(++_0x5ba0a4);}(_0x92f0,0x10d));var _0x092f=function(_0x290201,_0x279632){_0x290201=_0x290201-0x0;var _0x3d5c08=_0x92f0[_0x290201];return _0x3d5c08;};'use strict';var _=require('lodash');var util=require(_0x092f('0x0'));var logger=require(_0x092f('0x1'))('api');var moment=require(_0x092f('0x2'));var BPromise=require(_0x092f('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x092f('0x4'));var config=require(_0x092f('0x5'));var attributes=require(_0x092f('0x6'));module[_0x092f('0x7')]=function(_0x2996b0,_0x2b6dcb){return _0x2996b0['define'](_0x092f('0x8'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x092f('0x9'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index 12c1305..372942c 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 _0x5c3c=['../../config/environment','jayson/promise','client','http','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','catch','UpdateOpenchannelQueueReport','update','attributes','limit','debug','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5e9092,_0x2a064e){var _0x8fea2f=function(_0x82cbe1){while(--_0x82cbe1){_0x5e9092['push'](_0x5e9092['shift']());}};_0x8fea2f(++_0x2a064e);}(_0x5c3c,0x132));var _0xc5c3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x5c3c[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xc5c3('0x0'));var util=require(_0xc5c3('0x1'));var moment=require(_0xc5c3('0x2'));var BPromise=require(_0xc5c3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc5c3('0x4'));var db=require(_0xc5c3('0x5'))['db'];var utils=require(_0xc5c3('0x6'));var logger=require(_0xc5c3('0x7'))(_0xc5c3('0x8'));var config=require(_0xc5c3('0x9'));var jayson=require(_0xc5c3('0xa'));var client=jayson[_0xc5c3('0xb')][_0xc5c3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5a392b,_0x4b8404,_0x591f7d){return new BPromise(function(_0x723c31,_0x522be1){return client['request'](_0x5a392b,_0x591f7d)[_0xc5c3('0xd')](function(_0x46e2c1){logger['info'](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));logger['debug'](_0xc5c3('0x10'),_0x4b8404,_0xc5c3('0xf'),JSON[_0xc5c3('0x11')](_0x46e2c1));if(_0x46e2c1['error']){if(_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x13')]===0x1f4){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x522be1(_0x46e2c1['error'][_0xc5c3('0x14')]);}logger[_0xc5c3('0x12')](_0xc5c3('0xe'),_0x4b8404,_0x46e2c1[_0xc5c3('0x12')][_0xc5c3('0x14')]);return _0x723c31(_0x46e2c1['error']['message']);}else{logger[_0xc5c3('0x15')](_0xc5c3('0xe'),_0x4b8404,_0xc5c3('0xf'));_0x723c31(_0x46e2c1[_0xc5c3('0x16')]['message']);}})['catch'](function(_0x467ba9){logger['error'](_0xc5c3('0xe'),_0x4b8404,_0x467ba9);_0x522be1(_0x467ba9);});});}exports[_0xc5c3('0x17')]=function(_0x2ff158){var _0x13c867=this;return new Promise(function(_0x28bae6,_0x5e11d5){return db[_0xc5c3('0x18')][_0xc5c3('0x19')](_0x2ff158[_0xc5c3('0x1a')],{'raw':_0x2ff158[_0xc5c3('0x1b')]?_0x2ff158['options'][_0xc5c3('0x1c')]===undefined?!![]:![]:!![]})[_0xc5c3('0xd')](function(_0x3cc612){logger[_0xc5c3('0x15')](_0xc5c3('0x17'),_0x2ff158);logger['debug'](_0xc5c3('0x17'),_0x2ff158,JSON[_0xc5c3('0x11')](_0x3cc612));_0x28bae6(_0x3cc612);})[_0xc5c3('0x1d')](function(_0x2de266){logger[_0xc5c3('0x12')](_0xc5c3('0x17'),_0x2de266[_0xc5c3('0x14')],_0x2ff158);_0x5e11d5(_0x13c867['error'](0x1f4,_0x2de266['message']));});});};exports[_0xc5c3('0x1e')]=function(_0x38dd9e){var _0x53ab72=this;return new Promise(function(_0x5c7329,_0x23e2fb){return db[_0xc5c3('0x18')][_0xc5c3('0x1f')](_0x38dd9e['body'],{'raw':_0x38dd9e['options']?_0x38dd9e[_0xc5c3('0x1b')][_0xc5c3('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x38dd9e[_0xc5c3('0x1b')]?_0x38dd9e[_0xc5c3('0x1b')]['where']||null:null,'attributes':_0x38dd9e[_0xc5c3('0x1b')]?_0x38dd9e['options'][_0xc5c3('0x20')]||null:null,'limit':_0x38dd9e['options']?_0x38dd9e[_0xc5c3('0x1b')][_0xc5c3('0x21')]||null:null})[_0xc5c3('0xd')](function(_0x4773c5){logger[_0xc5c3('0x15')](_0xc5c3('0x1e'),_0x38dd9e);logger[_0xc5c3('0x22')]('UpdateOpenchannelQueueReport',_0x38dd9e,JSON[_0xc5c3('0x11')](_0x4773c5));_0x5c7329(_0x4773c5);})['catch'](function(_0xc4b134){logger[_0xc5c3('0x12')]('UpdateOpenchannelQueueReport',_0xc4b134['message'],_0x38dd9e);_0x23e2fb(_0x53ab72[_0xc5c3('0x12')](0x1f4,_0xc4b134[_0xc5c3('0x14')]));});});}; \ No newline at end of file +var _0x97e6=['UpdateOpenchannelQueueReport','update','attributes','limit','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','error','message','info','result','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','body','options','raw','stringify'];(function(_0x312f0e,_0xa816f7){var _0x5e4963=function(_0x9b909f){while(--_0x9b909f){_0x312f0e['push'](_0x312f0e['shift']());}};_0x5e4963(++_0xa816f7);}(_0x97e6,0x159));var _0x697e=function(_0x35c12c,_0x378ba0){_0x35c12c=_0x35c12c-0x0;var _0x2bab3a=_0x97e6[_0x35c12c];return _0x2bab3a;};'use strict';var _=require(_0x697e('0x0'));var util=require('util');var moment=require(_0x697e('0x1'));var BPromise=require(_0x697e('0x2'));var rs=require(_0x697e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x697e('0x4'))['db'];var utils=require(_0x697e('0x5'));var logger=require('../../config/logger')(_0x697e('0x6'));var config=require('../../config/environment');var jayson=require(_0x697e('0x7'));var client=jayson[_0x697e('0x8')][_0x697e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x546438,_0x371e2f,_0x21b9d5){return new BPromise(function(_0x4cf39f,_0x5670e3){return client[_0x697e('0xa')](_0x546438,_0x21b9d5)[_0x697e('0xb')](function(_0x2499f6){logger['info'](_0x697e('0xc'),_0x371e2f,_0x697e('0xd'));logger[_0x697e('0xe')](_0x697e('0xf'),_0x371e2f,_0x697e('0xd'),JSON['stringify'](_0x2499f6));if(_0x2499f6[_0x697e('0x10')]){if(_0x2499f6['error']['code']===0x1f4){logger[_0x697e('0x10')](_0x697e('0xc'),_0x371e2f,_0x2499f6[_0x697e('0x10')]['message']);return _0x5670e3(_0x2499f6[_0x697e('0x10')][_0x697e('0x11')]);}logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x371e2f,_0x2499f6[_0x697e('0x10')][_0x697e('0x11')]);return _0x4cf39f(_0x2499f6[_0x697e('0x10')][_0x697e('0x11')]);}else{logger[_0x697e('0x12')](_0x697e('0xc'),_0x371e2f,_0x697e('0xd'));_0x4cf39f(_0x2499f6[_0x697e('0x13')][_0x697e('0x11')]);}})['catch'](function(_0x316bdb){logger[_0x697e('0x10')]('OpenchannelQueueReport,\x20%s,\x20%s',_0x371e2f,_0x316bdb);_0x5670e3(_0x316bdb);});});}exports[_0x697e('0x14')]=function(_0x5edd20){var _0x233404=this;return new Promise(function(_0x281216,_0x50da1e){return db[_0x697e('0x15')][_0x697e('0x16')](_0x5edd20[_0x697e('0x17')],{'raw':_0x5edd20[_0x697e('0x18')]?_0x5edd20[_0x697e('0x18')][_0x697e('0x19')]===undefined?!![]:![]:!![]})[_0x697e('0xb')](function(_0x26e3cd){logger[_0x697e('0x12')](_0x697e('0x14'),_0x5edd20);logger[_0x697e('0xe')]('CreateOpenchannelQueueReport',_0x5edd20,JSON[_0x697e('0x1a')](_0x26e3cd));_0x281216(_0x26e3cd);})['catch'](function(_0x179fab){logger[_0x697e('0x10')]('CreateOpenchannelQueueReport',_0x179fab[_0x697e('0x11')],_0x5edd20);_0x50da1e(_0x233404['error'](0x1f4,_0x179fab[_0x697e('0x11')]));});});};exports[_0x697e('0x1b')]=function(_0x1d37ae){var _0x15737b=this;return new Promise(function(_0x11122b,_0x4b4514){return db['OpenchannelQueueReport'][_0x697e('0x1c')](_0x1d37ae[_0x697e('0x17')],{'raw':_0x1d37ae[_0x697e('0x18')]?_0x1d37ae[_0x697e('0x18')][_0x697e('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1d37ae[_0x697e('0x18')]?_0x1d37ae[_0x697e('0x18')]['where']||null:null,'attributes':_0x1d37ae['options']?_0x1d37ae[_0x697e('0x18')][_0x697e('0x1d')]||null:null,'limit':_0x1d37ae[_0x697e('0x18')]?_0x1d37ae[_0x697e('0x18')][_0x697e('0x1e')]||null:null})[_0x697e('0xb')](function(_0x33f4b5){logger['info']('UpdateOpenchannelQueueReport',_0x1d37ae);logger['debug'](_0x697e('0x1b'),_0x1d37ae,JSON['stringify'](_0x33f4b5));_0x11122b(_0x33f4b5);})['catch'](function(_0x5785e5){logger['error'](_0x697e('0x1b'),_0x5785e5[_0x697e('0x11')],_0x1d37ae);_0x4b4514(_0x15737b[_0x697e('0x10')](0x1f4,_0x5785e5[_0x697e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index cb1493f..9e503ce 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(_0x323419,_0x2a6172){var _0x4c0be7=function(_0x5ae2df){while(--_0x5ae2df){_0x323419['push'](_0x323419['shift']());}};_0x4c0be7(++_0x2a6172);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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(_0x1602ef,_0x447aba){var _0x5870ee=function(_0x4d94e7){while(--_0x4d94e7){_0x1602ef['push'](_0x1602ef['shift']());}};_0x5870ee(++_0x447aba);}(_0xa9e0,0x123));var _0x0a9e=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0xa9e0[_0x6131cd];return _0x47e916;};'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 3779e30..d3d94a6 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 _0x1a17=['queue','NOW','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x127c6b,_0x2795ff){var _0x508c0d=function(_0x5df4d3){while(--_0x5df4d3){_0x127c6b['push'](_0x127c6b['shift']());}};_0x508c0d(++_0x2795ff);}(_0x1a17,0x82));var _0x71a1=function(_0x4c9316,_0x5c7f6f){_0x4c9316=_0x4c9316-0x0;var _0x146aad=_0x1a17[_0x4c9316];return _0x146aad;};'use strict';var moment=require(_0x71a1('0x0'));var Sequelize=require(_0x71a1('0x1'));module[_0x71a1('0x2')]={'uniqueid':{'type':Sequelize[_0x71a1('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x71a1('0x4')](_0x71a1('0x5'),'agent',_0x71a1('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x71a1('0x7')]}}; \ No newline at end of file +var _0x5cf1=['STRING','ENUM','account','agent','queue','DATE','moment','sequelize','exports'];(function(_0x20762b,_0x23ca64){var _0x18d222=function(_0x532429){while(--_0x532429){_0x20762b['push'](_0x20762b['shift']());}};_0x18d222(++_0x23ca64);}(_0x5cf1,0xb1));var _0x15cf=function(_0x2a43b9,_0x2aa7ea){_0x2a43b9=_0x2a43b9-0x0;var _0x3b6c90=_0x5cf1[_0x2a43b9];return _0x3b6c90;};'use strict';var moment=require(_0x15cf('0x0'));var Sequelize=require(_0x15cf('0x1'));module[_0x15cf('0x2')]={'uniqueid':{'type':Sequelize[_0x15cf('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x15cf('0x4')](_0x15cf('0x5'),_0x15cf('0x6'),_0x15cf('0x7')),'allowNull':![],'defaultValue':_0x15cf('0x7')},'transferredAt':{'type':Sequelize[_0x15cf('0x8')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 7db99a8..a9c65d8 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 _0xb19a=['body','destroy','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','status','set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','OpenchannelTransferReport','includeAll','include','findAll','catch','show','params','keys','length','options','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb19a,0x16b));var _0xab19=function(_0x3fb34a,_0x51bb70){_0x3fb34a=_0x3fb34a-0x0;var _0x51b776=_0xb19a[_0x3fb34a];return _0x51b776;};'use strict';var pdf=require(_0xab19('0x0'));var emlformat=require(_0xab19('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xab19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab19('0x3'));var moment=require(_0xab19('0x4'));var BPromise=require(_0xab19('0x5'));var Mustache=require(_0xab19('0x6'));var util=require(_0xab19('0x7'));var path=require(_0xab19('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xab19('0x9'));var crypto=require('crypto');var jsforce=require(_0xab19('0xa'));var deskjs=require(_0xab19('0xb'));var toCsv=require(_0xab19('0xc'));var querystring=require('querystring');var Papa=require(_0xab19('0xd'));var Redis=require(_0xab19('0xe'));var authService=require(_0xab19('0xf'));var qs=require(_0xab19('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xab19('0x11'));var logger=require('../../config/logger')(_0xab19('0x12'));var utils=require(_0xab19('0x13'));var config=require(_0xab19('0x14'));var db=require(_0xab19('0x15'))['db'];function respondWithStatusCode(_0xff0cf6,_0x1281b3){_0x1281b3=_0x1281b3||0xcc;return function(_0x5e7c11){if(_0x5e7c11){return _0xff0cf6[_0xab19('0x16')](_0x1281b3);}return _0xff0cf6['status'](_0x1281b3)[_0xab19('0x17')]();};}function respondWithResult(_0x252922,_0x506548){_0x506548=_0x506548||0xc8;return function(_0xb6ee2b){if(_0xb6ee2b){return _0x252922['status'](_0x506548)[_0xab19('0x18')](_0xb6ee2b);}};}function respondWithFilteredResult(_0x42d861,_0x2906f5){return function(_0x1321e7){if(_0x1321e7){var _0x9daa86=_0x1321e7[_0xab19('0x19')],_0x713a54=_0x2906f5['offset'],_0xf8b7e=_0x2906f5[_0xab19('0x1a')]+_0x2906f5['limit'],_0x1273c0;if(_0xf8b7e>=_0x9daa86){_0xf8b7e=_0x9daa86;_0x1273c0=0xc8;}else{_0x1273c0=0xce;}_0x42d861[_0xab19('0x1b')](_0x1273c0);return _0x42d861[_0xab19('0x1c')](_0xab19('0x1d'),_0x713a54+'-'+_0xf8b7e+'/'+_0x9daa86)[_0xab19('0x18')](_0x1321e7);}return null;};}function patchUpdates(_0x503cc5){return function(_0x5ac578){try{jsonpatch[_0xab19('0x1e')](_0x5ac578,_0x503cc5,!![]);}catch(_0x572fda){return BPromise['reject'](_0x572fda);}return _0x5ac578[_0xab19('0x1f')]();};}function saveUpdates(_0x106eb6,_0x11b9a1){return function(_0x88dd6b){if(_0x88dd6b){return _0x88dd6b[_0xab19('0x20')](_0x106eb6)[_0xab19('0x21')](function(_0x157cae){return _0x157cae;});}return null;};}function removeEntity(_0x3fa04e,_0x3cfa30){return function(_0x194a6a){if(_0x194a6a){return _0x194a6a['destroy']()['then'](function(){_0x3fa04e[_0xab19('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1db2be,_0x4e21a3){return function(_0x51033c){if(!_0x51033c){_0x1db2be[_0xab19('0x16')](0x194);}return _0x51033c;};}function handleError(_0x1eb2c0,_0x2b891b){_0x2b891b=_0x2b891b||0x1f4;return function(_0x198d56){logger[_0xab19('0x22')](_0x198d56[_0xab19('0x23')]);if(_0x198d56[_0xab19('0x24')]){delete _0x198d56[_0xab19('0x24')];}_0x1eb2c0[_0xab19('0x1b')](_0x2b891b)[_0xab19('0x25')](_0x198d56);};}exports[_0xab19('0x26')]=function(_0x342025,_0x5b9fa5){var _0x55c5a6={},_0x57756f={},_0x2a751f={'count':0x0,'rows':[]};var _0x467ec2=_[_0xab19('0x27')](db['OpenchannelTransferReport'][_0xab19('0x28')],function(_0x2475fe){return{'name':_0x2475fe[_0xab19('0x29')],'type':_0x2475fe[_0xab19('0x2a')]['key']};});_0x57756f['model']=_['map'](_0x467ec2,_0xab19('0x24'));_0x57756f['query']=_['keys'](_0x342025[_0xab19('0x2b')]);_0x57756f[_0xab19('0x2c')]=_[_0xab19('0x2d')](_0x57756f[_0xab19('0x2e')],_0x57756f['query']);_0x55c5a6[_0xab19('0x2f')]=_['intersection'](_0x57756f['model'],qs[_0xab19('0x30')](_0x342025[_0xab19('0x2b')][_0xab19('0x30')]));_0x55c5a6[_0xab19('0x2f')]=_0x55c5a6[_0xab19('0x2f')]['length']?_0x55c5a6[_0xab19('0x2f')]:_0x57756f[_0xab19('0x2e')];if(!_0x342025[_0xab19('0x2b')][_0xab19('0x31')](_0xab19('0x32'))){_0x55c5a6[_0xab19('0x33')]=qs[_0xab19('0x33')](_0x342025[_0xab19('0x2b')]['limit']);_0x55c5a6[_0xab19('0x1a')]=qs[_0xab19('0x1a')](_0x342025[_0xab19('0x2b')][_0xab19('0x1a')]);}_0x55c5a6['order']=qs[_0xab19('0x34')](_0x342025[_0xab19('0x2b')][_0xab19('0x34')]);_0x55c5a6[_0xab19('0x35')]=qs['filters'](_[_0xab19('0x36')](_0x342025[_0xab19('0x2b')],_0x57756f['filters']));if(_0x342025[_0xab19('0x2b')][_0xab19('0x37')]){_0x55c5a6[_0xab19('0x35')]=_[_0xab19('0x38')](_0x55c5a6[_0xab19('0x35')],{'$or':_['map'](_0x467ec2,function(_0x2f3824){if(_0x2f3824['type']!=='VIRTUAL'){var _0x38cd15={};_0x38cd15[_0x2f3824[_0xab19('0x24')]]={'$like':'%'+_0x342025[_0xab19('0x2b')]['filter']+'%'};return _0x38cd15;}})});}_0x55c5a6=_[_0xab19('0x38')]({},_0x55c5a6,_0x342025['options']);var _0x5f5292={'where':_0x55c5a6[_0xab19('0x35')]};return db[_0xab19('0x39')]['count'](_0x5f5292)[_0xab19('0x21')](function(_0x562243){_0x2a751f[_0xab19('0x19')]=_0x562243;if(_0x342025[_0xab19('0x2b')][_0xab19('0x3a')]){_0x55c5a6[_0xab19('0x3b')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0xab19('0x3c')](_0x55c5a6);})[_0xab19('0x21')](function(_0x35a3be){_0x2a751f['rows']=_0x35a3be;return _0x2a751f;})[_0xab19('0x21')](respondWithFilteredResult(_0x5b9fa5,_0x55c5a6))[_0xab19('0x3d')](handleError(_0x5b9fa5,null));};exports[_0xab19('0x3e')]=function(_0x35c966,_0x524c62){var _0x20bfd5={'raw':!![],'where':{'id':_0x35c966[_0xab19('0x3f')]['id']}},_0x4995db={};_0x4995db[_0xab19('0x2e')]=_['keys'](db[_0xab19('0x39')]['rawAttributes']);_0x4995db[_0xab19('0x2b')]=_[_0xab19('0x40')](_0x35c966[_0xab19('0x2b')]);_0x4995db[_0xab19('0x2c')]=_[_0xab19('0x2d')](_0x4995db[_0xab19('0x2e')],_0x4995db['query']);_0x20bfd5[_0xab19('0x2f')]=_[_0xab19('0x2d')](_0x4995db[_0xab19('0x2e')],qs[_0xab19('0x30')](_0x35c966[_0xab19('0x2b')]['fields']));_0x20bfd5[_0xab19('0x2f')]=_0x20bfd5[_0xab19('0x2f')][_0xab19('0x41')]?_0x20bfd5[_0xab19('0x2f')]:_0x4995db[_0xab19('0x2e')];if(_0x35c966[_0xab19('0x2b')][_0xab19('0x3a')]){_0x20bfd5['include']=[{'all':!![]}];}_0x20bfd5=_['merge']({},_0x20bfd5,_0x35c966[_0xab19('0x42')]);return db['OpenchannelTransferReport'][_0xab19('0x43')](_0x20bfd5)['then'](handleEntityNotFound(_0x524c62,null))['then'](respondWithResult(_0x524c62,null))[_0xab19('0x3d')](handleError(_0x524c62,null));};exports[_0xab19('0x44')]=function(_0x2bca46,_0x336224){return db[_0xab19('0x39')]['create'](_0x2bca46[_0xab19('0x45')],{})[_0xab19('0x21')](respondWithResult(_0x336224,0xc9))[_0xab19('0x3d')](handleError(_0x336224,null));};exports['update']=function(_0x3df4db,_0x4f64aa){if(_0x3df4db[_0xab19('0x45')]['id']){delete _0x3df4db['body']['id'];}return db[_0xab19('0x39')][_0xab19('0x43')]({'where':{'id':_0x3df4db[_0xab19('0x3f')]['id']}})[_0xab19('0x21')](handleEntityNotFound(_0x4f64aa,null))[_0xab19('0x21')](saveUpdates(_0x3df4db[_0xab19('0x45')],null))[_0xab19('0x21')](respondWithResult(_0x4f64aa,null))[_0xab19('0x3d')](handleError(_0x4f64aa,null));};exports[_0xab19('0x46')]=function(_0x102949,_0x1b2d71){return db[_0xab19('0x39')][_0xab19('0x43')]({'where':{'id':_0x102949['params']['id']}})[_0xab19('0x21')](handleEntityNotFound(_0x1b2d71,null))['then'](removeEntity(_0x1b2d71,null))[_0xab19('0x3d')](handleError(_0x1b2d71,null));};exports[_0xab19('0x47')]=function(_0x21a5a8,_0x4596dc){return db[_0xab19('0x39')]['describe']()[_0xab19('0x21')](respondWithResult(_0x4596dc,null))[_0xab19('0x3d')](handleError(_0x4596dc,null));}; \ No newline at end of file +var _0xab06=['api','../../mysqldb','sendStatus','json','status','reject','save','then','destroy','end','error','stack','name','map','OpenchannelTransferReport','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','offset','order','sort','where','type','merge','options','count','includeAll','include','show','length','find','catch','create','update','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x7fb1c3,_0x3f8037){var _0x2a22ce=function(_0x5d6269){while(--_0x5d6269){_0x7fb1c3['push'](_0x7fb1c3['shift']());}};_0x2a22ce(++_0x3f8037);}(_0xab06,0xb5));var _0x6ab0=function(_0x38b14f,_0xd08fa8){_0x38b14f=_0x38b14f-0x0;var _0x22a324=_0xab06[_0x38b14f];return _0x22a324;};'use strict';var pdf=require(_0x6ab0('0x0'));var emlformat=require(_0x6ab0('0x1'));var rimraf=require(_0x6ab0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6ab0('0x3'));var rp=require(_0x6ab0('0x4'));var moment=require(_0x6ab0('0x5'));var BPromise=require(_0x6ab0('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6ab0('0x7'));var sox=require(_0x6ab0('0x8'));var csv=require(_0x6ab0('0x9'));var ejs=require(_0x6ab0('0xa'));var fs=require('fs');var _=require(_0x6ab0('0xb'));var squel=require('squel');var crypto=require(_0x6ab0('0xc'));var jsforce=require(_0x6ab0('0xd'));var deskjs=require(_0x6ab0('0xe'));var toCsv=require(_0x6ab0('0x9'));var querystring=require('querystring');var Papa=require(_0x6ab0('0xf'));var Redis=require(_0x6ab0('0x10'));var authService=require(_0x6ab0('0x11'));var qs=require(_0x6ab0('0x12'));var as=require(_0x6ab0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6ab0('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x6ab0('0x15'))['db'];function respondWithStatusCode(_0x49b0fb,_0x336ac0){_0x336ac0=_0x336ac0||0xcc;return function(_0x549b20){if(_0x549b20){return _0x49b0fb[_0x6ab0('0x16')](_0x336ac0);}return _0x49b0fb['status'](_0x336ac0)['end']();};}function respondWithResult(_0x57308f,_0x23a9e6){_0x23a9e6=_0x23a9e6||0xc8;return function(_0x24a41c){if(_0x24a41c){return _0x57308f['status'](_0x23a9e6)[_0x6ab0('0x17')](_0x24a41c);}};}function respondWithFilteredResult(_0x3a1c3f,_0x250545){return function(_0x58a08f){if(_0x58a08f){var _0x378e3a=_0x58a08f['count'],_0x334246=_0x250545['offset'],_0x8aadb1=_0x250545['offset']+_0x250545['limit'],_0x49ba3f;if(_0x8aadb1>=_0x378e3a){_0x8aadb1=_0x378e3a;_0x49ba3f=0xc8;}else{_0x49ba3f=0xce;}_0x3a1c3f[_0x6ab0('0x18')](_0x49ba3f);return _0x3a1c3f['set']('Content-Range',_0x334246+'-'+_0x8aadb1+'/'+_0x378e3a)['json'](_0x58a08f);}return null;};}function patchUpdates(_0x1d601c){return function(_0x46d609){try{jsonpatch['apply'](_0x46d609,_0x1d601c,!![]);}catch(_0xabe0fb){return BPromise[_0x6ab0('0x19')](_0xabe0fb);}return _0x46d609[_0x6ab0('0x1a')]();};}function saveUpdates(_0x4cf1f2,_0x55a15e){return function(_0x368106){if(_0x368106){return _0x368106['update'](_0x4cf1f2)[_0x6ab0('0x1b')](function(_0x11dbbc){return _0x11dbbc;});}return null;};}function removeEntity(_0x15d282,_0x389015){return function(_0x544b60){if(_0x544b60){return _0x544b60[_0x6ab0('0x1c')]()[_0x6ab0('0x1b')](function(){_0x15d282[_0x6ab0('0x18')](0xcc)[_0x6ab0('0x1d')]();});}};}function handleEntityNotFound(_0x198e1c,_0x358b37){return function(_0x1f84b5){if(!_0x1f84b5){_0x198e1c[_0x6ab0('0x16')](0x194);}return _0x1f84b5;};}function handleError(_0x3deba5,_0x47a0f6){_0x47a0f6=_0x47a0f6||0x1f4;return function(_0x1b47d7){logger[_0x6ab0('0x1e')](_0x1b47d7[_0x6ab0('0x1f')]);if(_0x1b47d7[_0x6ab0('0x20')]){delete _0x1b47d7[_0x6ab0('0x20')];}_0x3deba5[_0x6ab0('0x18')](_0x47a0f6)['send'](_0x1b47d7);};}exports['index']=function(_0x4716a0,_0x3e70a7){var _0x1fbe72={},_0x409ead={},_0x13b009={'count':0x0,'rows':[]};var _0x59b306=_[_0x6ab0('0x21')](db[_0x6ab0('0x22')][_0x6ab0('0x23')],function(_0x4af370){return{'name':_0x4af370[_0x6ab0('0x24')],'type':_0x4af370['type'][_0x6ab0('0x25')]};});_0x409ead['model']=_['map'](_0x59b306,_0x6ab0('0x20'));_0x409ead[_0x6ab0('0x26')]=_[_0x6ab0('0x27')](_0x4716a0[_0x6ab0('0x26')]);_0x409ead[_0x6ab0('0x28')]=_[_0x6ab0('0x29')](_0x409ead[_0x6ab0('0x2a')],_0x409ead[_0x6ab0('0x26')]);_0x1fbe72[_0x6ab0('0x2b')]=_['intersection'](_0x409ead[_0x6ab0('0x2a')],qs[_0x6ab0('0x2c')](_0x4716a0[_0x6ab0('0x26')][_0x6ab0('0x2c')]));_0x1fbe72['attributes']=_0x1fbe72[_0x6ab0('0x2b')]['length']?_0x1fbe72[_0x6ab0('0x2b')]:_0x409ead['model'];if(!_0x4716a0[_0x6ab0('0x26')][_0x6ab0('0x2d')](_0x6ab0('0x2e'))){_0x1fbe72[_0x6ab0('0x2f')]=qs['limit'](_0x4716a0[_0x6ab0('0x26')][_0x6ab0('0x2f')]);_0x1fbe72[_0x6ab0('0x30')]=qs[_0x6ab0('0x30')](_0x4716a0[_0x6ab0('0x26')][_0x6ab0('0x30')]);}_0x1fbe72[_0x6ab0('0x31')]=qs['sort'](_0x4716a0[_0x6ab0('0x26')][_0x6ab0('0x32')]);_0x1fbe72[_0x6ab0('0x33')]=qs[_0x6ab0('0x28')](_['pick'](_0x4716a0['query'],_0x409ead[_0x6ab0('0x28')]));if(_0x4716a0[_0x6ab0('0x26')]['filter']){_0x1fbe72[_0x6ab0('0x33')]=_['merge'](_0x1fbe72[_0x6ab0('0x33')],{'$or':_[_0x6ab0('0x21')](_0x59b306,function(_0x3e7778){if(_0x3e7778[_0x6ab0('0x34')]!=='VIRTUAL'){var _0x9db282={};_0x9db282[_0x3e7778[_0x6ab0('0x20')]]={'$like':'%'+_0x4716a0['query']['filter']+'%'};return _0x9db282;}})});}_0x1fbe72=_[_0x6ab0('0x35')]({},_0x1fbe72,_0x4716a0[_0x6ab0('0x36')]);var _0x51f2b6={'where':_0x1fbe72[_0x6ab0('0x33')]};return db['OpenchannelTransferReport'][_0x6ab0('0x37')](_0x51f2b6)[_0x6ab0('0x1b')](function(_0x1e6042){_0x13b009[_0x6ab0('0x37')]=_0x1e6042;if(_0x4716a0[_0x6ab0('0x26')][_0x6ab0('0x38')]){_0x1fbe72[_0x6ab0('0x39')]=[{'all':!![]}];}return db[_0x6ab0('0x22')]['findAll'](_0x1fbe72);})[_0x6ab0('0x1b')](function(_0x16c1c2){_0x13b009['rows']=_0x16c1c2;return _0x13b009;})[_0x6ab0('0x1b')](respondWithFilteredResult(_0x3e70a7,_0x1fbe72))['catch'](handleError(_0x3e70a7,null));};exports[_0x6ab0('0x3a')]=function(_0x1281a5,_0x4a0375){var _0x41336d={'raw':!![],'where':{'id':_0x1281a5['params']['id']}},_0x33fe9c={};_0x33fe9c[_0x6ab0('0x2a')]=_[_0x6ab0('0x27')](db['OpenchannelTransferReport'][_0x6ab0('0x23')]);_0x33fe9c[_0x6ab0('0x26')]=_['keys'](_0x1281a5[_0x6ab0('0x26')]);_0x33fe9c['filters']=_[_0x6ab0('0x29')](_0x33fe9c[_0x6ab0('0x2a')],_0x33fe9c[_0x6ab0('0x26')]);_0x41336d['attributes']=_[_0x6ab0('0x29')](_0x33fe9c['model'],qs['fields'](_0x1281a5['query'][_0x6ab0('0x2c')]));_0x41336d[_0x6ab0('0x2b')]=_0x41336d[_0x6ab0('0x2b')][_0x6ab0('0x3b')]?_0x41336d['attributes']:_0x33fe9c['model'];if(_0x1281a5[_0x6ab0('0x26')][_0x6ab0('0x38')]){_0x41336d[_0x6ab0('0x39')]=[{'all':!![]}];}_0x41336d=_['merge']({},_0x41336d,_0x1281a5[_0x6ab0('0x36')]);return db[_0x6ab0('0x22')][_0x6ab0('0x3c')](_0x41336d)[_0x6ab0('0x1b')](handleEntityNotFound(_0x4a0375,null))[_0x6ab0('0x1b')](respondWithResult(_0x4a0375,null))[_0x6ab0('0x3d')](handleError(_0x4a0375,null));};exports[_0x6ab0('0x3e')]=function(_0xf42cfb,_0x5f442e){return db[_0x6ab0('0x22')][_0x6ab0('0x3e')](_0xf42cfb['body'],{})[_0x6ab0('0x1b')](respondWithResult(_0x5f442e,0xc9))[_0x6ab0('0x3d')](handleError(_0x5f442e,null));};exports[_0x6ab0('0x3f')]=function(_0x542919,_0x2a9427){if(_0x542919[_0x6ab0('0x40')]['id']){delete _0x542919[_0x6ab0('0x40')]['id'];}return db[_0x6ab0('0x22')][_0x6ab0('0x3c')]({'where':{'id':_0x542919[_0x6ab0('0x41')]['id']}})[_0x6ab0('0x1b')](handleEntityNotFound(_0x2a9427,null))[_0x6ab0('0x1b')](saveUpdates(_0x542919[_0x6ab0('0x40')],null))[_0x6ab0('0x1b')](respondWithResult(_0x2a9427,null))[_0x6ab0('0x3d')](handleError(_0x2a9427,null));};exports[_0x6ab0('0x1c')]=function(_0x21463f,_0xae6eb6){return db[_0x6ab0('0x22')][_0x6ab0('0x3c')]({'where':{'id':_0x21463f['params']['id']}})[_0x6ab0('0x1b')](handleEntityNotFound(_0xae6eb6,null))[_0x6ab0('0x1b')](removeEntity(_0xae6eb6,null))['catch'](handleError(_0xae6eb6,null));};exports[_0x6ab0('0x42')]=function(_0x3b2465,_0x41c111){return db[_0x6ab0('0x22')][_0x6ab0('0x42')]()[_0x6ab0('0x1b')](respondWithResult(_0x41c111,null))[_0x6ab0('0x3d')](handleError(_0x41c111,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 8f6146d..98ecd16 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 _0x3c34=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','uniqueid','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x30cdc0,_0x42a29a){var _0x10dbeb=function(_0x2b433b){while(--_0x2b433b){_0x30cdc0['push'](_0x30cdc0['shift']());}};_0x10dbeb(++_0x42a29a);}(_0x3c34,0x123));var _0x43c3=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x3c34[_0x3e2fcf];return _0x497db7;};'use strict';var _=require(_0x43c3('0x0'));var util=require(_0x43c3('0x1'));var logger=require(_0x43c3('0x2'))('api');var moment=require('moment');var BPromise=require(_0x43c3('0x3'));var rp=require(_0x43c3('0x4'));var fs=require('fs');var path=require(_0x43c3('0x5'));var rimraf=require(_0x43c3('0x6'));var config=require(_0x43c3('0x7'));var attributes=require(_0x43c3('0x8'));module[_0x43c3('0x9')]=function(_0x3224a6,_0x42b76a){return _0x3224a6[_0x43c3('0xa')](_0x43c3('0xb'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x43c3('0xc'),'fields':[_0x43c3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf778=['moment','request-promise','rimraf','exports','define','OpenchannelTransferReport','uniqueid','lodash','../../config/logger','api'];(function(_0x11f226,_0x491e30){var _0x30be77=function(_0x2049bd){while(--_0x2049bd){_0x11f226['push'](_0x11f226['shift']());}};_0x30be77(++_0x491e30);}(_0xf778,0xbb));var _0x8f77=function(_0x2682a4,_0x5db558){_0x2682a4=_0x2682a4-0x0;var _0x3489ea=_0xf778[_0x2682a4];return _0x3489ea;};'use strict';var _=require(_0x8f77('0x0'));var util=require('util');var logger=require(_0x8f77('0x1'))(_0x8f77('0x2'));var moment=require(_0x8f77('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f77('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8f77('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module[_0x8f77('0x6')]=function(_0x5eb19a,_0x271150){return _0x5eb19a[_0x8f77('0x7')](_0x8f77('0x8'),attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x8f77('0x9'),'fields':[_0x8f77('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 e791015..223ef86 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 _0x644e=['debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s'];(function(_0x53b5ce,_0x424a53){var _0x1bba1f=function(_0x56cca9){while(--_0x56cca9){_0x53b5ce['push'](_0x53b5ce['shift']());}};_0x1bba1f(++_0x424a53);}(_0x644e,0x103));var _0xe644=function(_0x55bdf9,_0x1d04f3){_0x55bdf9=_0x55bdf9-0x0;var _0x5f46b1=_0x644e[_0x55bdf9];return _0x5f46b1;};'use strict';var _=require('lodash');var util=require(_0xe644('0x0'));var moment=require(_0xe644('0x1'));var BPromise=require(_0xe644('0x2'));var rs=require(_0xe644('0x3'));var fs=require('fs');var Redis=require(_0xe644('0x4'));var db=require(_0xe644('0x5'))['db'];var utils=require(_0xe644('0x6'));var logger=require(_0xe644('0x7'))(_0xe644('0x8'));var config=require(_0xe644('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xe644('0xa')][_0xe644('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xe67a18,_0x456e1b,_0x5a438e){return new BPromise(function(_0x58d0d2,_0x39120b){return client[_0xe644('0xc')](_0xe67a18,_0x5a438e)[_0xe644('0xd')](function(_0x1a7a17){logger[_0xe644('0xe')](_0xe644('0xf'),_0x456e1b,'request\x20sent');logger[_0xe644('0x10')](_0xe644('0x11'),_0x456e1b,_0xe644('0x12'),JSON[_0xe644('0x13')](_0x1a7a17));if(_0x1a7a17[_0xe644('0x14')]){if(_0x1a7a17['error'][_0xe644('0x15')]===0x1f4){logger[_0xe644('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x456e1b,_0x1a7a17[_0xe644('0x14')][_0xe644('0x16')]);return _0x39120b(_0x1a7a17[_0xe644('0x14')][_0xe644('0x16')]);}logger[_0xe644('0x14')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x456e1b,_0x1a7a17[_0xe644('0x14')]['message']);return _0x58d0d2(_0x1a7a17[_0xe644('0x14')]['message']);}else{logger[_0xe644('0xe')](_0xe644('0xf'),_0x456e1b,_0xe644('0x12'));_0x58d0d2(_0x1a7a17[_0xe644('0x17')][_0xe644('0x16')]);}})[_0xe644('0x18')](function(_0x73fd7e){logger[_0xe644('0x14')](_0xe644('0xf'),_0x456e1b,_0x73fd7e);_0x39120b(_0x73fd7e);});});} \ No newline at end of file +var _0x8c7b=['stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x8c7b,0xd8));var _0xb8c7=function(_0x3c89fa,_0x123d74){_0x3c89fa=_0x3c89fa-0x0;var _0x48062c=_0x8c7b[_0x3c89fa];return _0x48062c;};'use strict';var _=require(_0xb8c7('0x0'));var util=require(_0xb8c7('0x1'));var moment=require(_0xb8c7('0x2'));var BPromise=require(_0xb8c7('0x3'));var rs=require(_0xb8c7('0x4'));var fs=require('fs');var Redis=require(_0xb8c7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb8c7('0x6'));var logger=require('../../config/logger')(_0xb8c7('0x7'));var config=require('../../config/environment');var jayson=require(_0xb8c7('0x8'));var client=jayson[_0xb8c7('0x9')][_0xb8c7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3c4823,_0x3671b9,_0x2d281b){return new BPromise(function(_0x28c1c7,_0x42104a){return client[_0xb8c7('0xb')](_0x3c4823,_0x2d281b)['then'](function(_0x430d9f){logger['info'](_0xb8c7('0xc'),_0x3671b9,_0xb8c7('0xd'));logger['debug'](_0xb8c7('0xe'),_0x3671b9,_0xb8c7('0xd'),JSON[_0xb8c7('0xf')](_0x430d9f));if(_0x430d9f[_0xb8c7('0x10')]){if(_0x430d9f[_0xb8c7('0x10')][_0xb8c7('0x11')]===0x1f4){logger['error'](_0xb8c7('0xc'),_0x3671b9,_0x430d9f[_0xb8c7('0x10')][_0xb8c7('0x12')]);return _0x42104a(_0x430d9f[_0xb8c7('0x10')][_0xb8c7('0x12')]);}logger[_0xb8c7('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3671b9,_0x430d9f['error'][_0xb8c7('0x12')]);return _0x28c1c7(_0x430d9f['error']['message']);}else{logger[_0xb8c7('0x13')](_0xb8c7('0xc'),_0x3671b9,'request\x20sent');_0x28c1c7(_0x430d9f['result'][_0xb8c7('0x12')]);}})[_0xb8c7('0x14')](function(_0x2dd2c7){logger[_0xb8c7('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x3671b9,_0x2dd2c7);_0x42104a(_0x2dd2c7);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 58770ed..3eac2fb 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 _0xd835=['put','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./pause.controller','get','isAuthenticated','show','create'];(function(_0x22e11c,_0x32ef49){var _0x4fd8ed=function(_0x1098b7){while(--_0x1098b7){_0x22e11c['push'](_0x22e11c['shift']());}};_0x4fd8ed(++_0x32ef49);}(_0xd835,0x114));var _0x5d83=function(_0x38987f,_0xc79720){_0x38987f=_0x38987f-0x0;var _0x4cb697=_0xd835[_0x38987f];return _0x4cb697;};'use strict';var multer=require(_0x5d83('0x0'));var util=require('util');var path=require(_0x5d83('0x1'));var timeout=require(_0x5d83('0x2'));var express=require(_0x5d83('0x3'));var router=express[_0x5d83('0x4')]();var auth=require(_0x5d83('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5d83('0x6'));var controller=require(_0x5d83('0x7'));router[_0x5d83('0x8')]('/',auth[_0x5d83('0x9')](),controller['index']);router[_0x5d83('0x8')]('/:id',auth[_0x5d83('0x9')](),controller[_0x5d83('0xa')]);router['post']('/',auth[_0x5d83('0x9')](),controller[_0x5d83('0xb')]);router[_0x5d83('0xc')](_0x5d83('0xd'),auth[_0x5d83('0x9')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x5d83('0xe')]);module[_0x5d83('0xf')]=router; \ No newline at end of file +var _0x4305=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','post','create','put','delete','/:id'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x4305,0x71));var _0x5430=function(_0x55b037,_0x2d9392){_0x55b037=_0x55b037-0x0;var _0x5f1053=_0x4305[_0x55b037];return _0x5f1053;};'use strict';var multer=require(_0x5430('0x0'));var util=require('util');var path=require(_0x5430('0x1'));var timeout=require(_0x5430('0x2'));var express=require(_0x5430('0x3'));var router=express[_0x5430('0x4')]();var auth=require(_0x5430('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5430('0x6'));var controller=require('./pause.controller');router[_0x5430('0x7')]('/',auth[_0x5430('0x8')](),controller[_0x5430('0x9')]);router[_0x5430('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x5430('0xa')]('/',auth['isAuthenticated'](),controller[_0x5430('0xb')]);router[_0x5430('0xc')]('/:id',auth[_0x5430('0x8')](),controller['update']);router[_0x5430('0xd')](_0x5430('0xe'),auth[_0x5430('0x8')](),controller['destroy']);module[_0x5430('0xf')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index ff8188c..49519a6 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 _0x60db=['name','sequelize','STRING'];(function(_0x388f7d,_0x132d45){var _0x2cf872=function(_0x640ce3){while(--_0x640ce3){_0x388f7d['push'](_0x388f7d['shift']());}};_0x2cf872(++_0x132d45);}(_0x60db,0x139));var _0xb60d=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x60db[_0x334841];return _0x5beb4b;};'use strict';var Sequelize=require(_0xb60d('0x0'));module['exports']={'name':{'type':Sequelize[_0xb60d('0x1')],'unique':_0xb60d('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb60d('0x1')]}}; \ No newline at end of file +var _0x1d9e=['exports','STRING','name','sequelize'];(function(_0x4c6d6f,_0x291557){var _0x2d4478=function(_0x106946){while(--_0x106946){_0x4c6d6f['push'](_0x4c6d6f['shift']());}};_0x2d4478(++_0x291557);}(_0x1d9e,0xc3));var _0xe1d9=function(_0x1ea4be,_0x276e41){_0x1ea4be=_0x1ea4be-0x0;var _0x2f46b4=_0x1d9e[_0x1ea4be];return _0x2f46b4;};'use strict';var Sequelize=require(_0xe1d9('0x0'));module[_0xe1d9('0x1')]={'name':{'type':Sequelize[_0xe1d9('0x2')],'unique':_0xe1d9('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 6f66861..2189099 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 _0x24ef=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','save','update','then','destroy','get','Pauses','UserProfileResource','error','stack','name','send','map','Pause','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','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','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce'];(function(_0x1605ba,_0x2d6aa3){var _0x50a8bd=function(_0x10b9a7){while(--_0x10b9a7){_0x1605ba['push'](_0x1605ba['shift']());}};_0x50a8bd(++_0x2d6aa3);}(_0x24ef,0x182));var _0xf24e=function(_0x5b369b,_0x52f05d){_0x5b369b=_0x5b369b-0x0;var _0x1066b2=_0x24ef[_0x5b369b];return _0x1066b2;};'use strict';var pdf=require(_0xf24e('0x0'));var emlformat=require(_0xf24e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xf24e('0x2'));var jsonpatch=require(_0xf24e('0x3'));var rp=require(_0xf24e('0x4'));var moment=require('moment');var BPromise=require(_0xf24e('0x5'));var Mustache=require(_0xf24e('0x6'));var util=require(_0xf24e('0x7'));var path=require('path');var sox=require(_0xf24e('0x8'));var csv=require(_0xf24e('0x9'));var ejs=require(_0xf24e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf24e('0xb'));var crypto=require(_0xf24e('0xc'));var jsforce=require(_0xf24e('0xd'));var deskjs=require(_0xf24e('0xe'));var toCsv=require(_0xf24e('0x9'));var querystring=require('querystring');var Papa=require(_0xf24e('0xf'));var Redis=require(_0xf24e('0x10'));var authService=require(_0xf24e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf24e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf24e('0x13'))(_0xf24e('0x14'));var utils=require(_0xf24e('0x15'));var config=require('../../config/environment');var db=require(_0xf24e('0x16'))['db'];function respondWithStatusCode(_0x3ffb1c,_0x14c9bd){_0x14c9bd=_0x14c9bd||0xcc;return function(_0x523485){if(_0x523485){return _0x3ffb1c[_0xf24e('0x17')](_0x14c9bd);}return _0x3ffb1c[_0xf24e('0x18')](_0x14c9bd)[_0xf24e('0x19')]();};}function respondWithResult(_0xf3d680,_0x1075c8){_0x1075c8=_0x1075c8||0xc8;return function(_0x5ebcc0){if(_0x5ebcc0){return _0xf3d680[_0xf24e('0x18')](_0x1075c8)[_0xf24e('0x1a')](_0x5ebcc0);}};}function respondWithFilteredResult(_0x2495dd,_0x238133){return function(_0x401271){if(_0x401271){var _0x3b8faf=_0x401271[_0xf24e('0x1b')],_0xdce3bc=_0x238133[_0xf24e('0x1c')],_0x2c5ab5=_0x238133[_0xf24e('0x1c')]+_0x238133[_0xf24e('0x1d')],_0x274311;if(_0x2c5ab5>=_0x3b8faf){_0x2c5ab5=_0x3b8faf;_0x274311=0xc8;}else{_0x274311=0xce;}_0x2495dd[_0xf24e('0x18')](_0x274311);return _0x2495dd[_0xf24e('0x1e')]('Content-Range',_0xdce3bc+'-'+_0x2c5ab5+'/'+_0x3b8faf)['json'](_0x401271);}return null;};}function patchUpdates(_0x2c9958){return function(_0x13b4c6){try{jsonpatch['apply'](_0x13b4c6,_0x2c9958,!![]);}catch(_0x360ff9){return BPromise['reject'](_0x360ff9);}return _0x13b4c6[_0xf24e('0x1f')]();};}function saveUpdates(_0x4030e4,_0x349adb){return function(_0x18dc27){if(_0x18dc27){return _0x18dc27[_0xf24e('0x20')](_0x4030e4)[_0xf24e('0x21')](function(_0x4f9b24){return _0x4f9b24;});}return null;};}function removeEntity(_0x263fc9,_0x32ff93){return function(_0x405762){if(_0x405762){return _0x405762[_0xf24e('0x22')]()[_0xf24e('0x21')](function(){var _0x352ae4=_0x405762[_0xf24e('0x23')]({'plain':!![]});var _0x5a9100=_0xf24e('0x24');return db[_0xf24e('0x25')][_0xf24e('0x22')]({'where':{'type':_0x5a9100,'resourceId':_0x352ae4['id']}})[_0xf24e('0x21')](function(){return _0x405762;});})[_0xf24e('0x21')](function(){_0x263fc9[_0xf24e('0x18')](0xcc)[_0xf24e('0x19')]();});}};}function handleEntityNotFound(_0x3c00d1,_0x2dc211){return function(_0x50617b){if(!_0x50617b){_0x3c00d1[_0xf24e('0x17')](0x194);}return _0x50617b;};}function handleError(_0x16506e,_0x388845){_0x388845=_0x388845||0x1f4;return function(_0x322877){logger[_0xf24e('0x26')](_0x322877[_0xf24e('0x27')]);if(_0x322877[_0xf24e('0x28')]){delete _0x322877[_0xf24e('0x28')];}_0x16506e['status'](_0x388845)[_0xf24e('0x29')](_0x322877);};}exports['index']=function(_0x675260,_0x4f7305){var _0x54da03={},_0x29af6b={},_0x366230={'count':0x0,'rows':[]};var _0x4535c3=_[_0xf24e('0x2a')](db[_0xf24e('0x2b')][_0xf24e('0x2c')],function(_0x182f3a){return{'name':_0x182f3a[_0xf24e('0x2d')],'type':_0x182f3a[_0xf24e('0x2e')][_0xf24e('0x2f')]};});_0x29af6b[_0xf24e('0x30')]=_[_0xf24e('0x2a')](_0x4535c3,_0xf24e('0x28'));_0x29af6b['query']=_['keys'](_0x675260[_0xf24e('0x31')]);_0x29af6b[_0xf24e('0x32')]=_[_0xf24e('0x33')](_0x29af6b['model'],_0x29af6b[_0xf24e('0x31')]);_0x54da03[_0xf24e('0x34')]=_[_0xf24e('0x33')](_0x29af6b['model'],qs[_0xf24e('0x35')](_0x675260[_0xf24e('0x31')][_0xf24e('0x35')]));_0x54da03[_0xf24e('0x34')]=_0x54da03[_0xf24e('0x34')]['length']?_0x54da03[_0xf24e('0x34')]:_0x29af6b[_0xf24e('0x30')];if(!_0x675260[_0xf24e('0x31')][_0xf24e('0x36')](_0xf24e('0x37'))){_0x54da03[_0xf24e('0x1d')]=qs[_0xf24e('0x1d')](_0x675260[_0xf24e('0x31')][_0xf24e('0x1d')]);_0x54da03[_0xf24e('0x1c')]=qs[_0xf24e('0x1c')](_0x675260[_0xf24e('0x31')][_0xf24e('0x1c')]);}_0x54da03[_0xf24e('0x38')]=qs[_0xf24e('0x39')](_0x675260[_0xf24e('0x31')][_0xf24e('0x39')]);_0x54da03[_0xf24e('0x3a')]=qs['filters'](_[_0xf24e('0x3b')](_0x675260[_0xf24e('0x31')],_0x29af6b[_0xf24e('0x32')]));if(_0x675260[_0xf24e('0x31')][_0xf24e('0x3c')]){_0x54da03['where']=_[_0xf24e('0x3d')](_0x54da03[_0xf24e('0x3a')],{'$or':_[_0xf24e('0x2a')](_0x4535c3,function(_0x4dd823){if(_0x4dd823[_0xf24e('0x2e')]!==_0xf24e('0x3e')){var _0x685e6f={};_0x685e6f[_0x4dd823['name']]={'$like':'%'+_0x675260[_0xf24e('0x31')][_0xf24e('0x3c')]+'%'};return _0x685e6f;}})});}_0x54da03=_['merge']({},_0x54da03,_0x675260[_0xf24e('0x3f')]);var _0x10b6f7={'where':_0x54da03[_0xf24e('0x3a')]};return db[_0xf24e('0x2b')][_0xf24e('0x1b')](_0x10b6f7)[_0xf24e('0x21')](function(_0x4bd6d0){_0x366230[_0xf24e('0x1b')]=_0x4bd6d0;if(_0x675260[_0xf24e('0x31')][_0xf24e('0x40')]){_0x54da03[_0xf24e('0x41')]=[{'all':!![]}];}return db[_0xf24e('0x2b')]['findAll'](_0x54da03);})[_0xf24e('0x21')](function(_0x51d9d2){_0x366230[_0xf24e('0x42')]=_0x51d9d2;return _0x366230;})[_0xf24e('0x21')](respondWithFilteredResult(_0x4f7305,_0x54da03))[_0xf24e('0x43')](handleError(_0x4f7305,null));};exports[_0xf24e('0x44')]=function(_0x502932,_0x305561){var _0x24abca={'raw':!![],'where':{'id':_0x502932[_0xf24e('0x45')]['id']}},_0x4e8a08={};_0x4e8a08[_0xf24e('0x30')]=_['keys'](db[_0xf24e('0x2b')]['rawAttributes']);_0x4e8a08[_0xf24e('0x31')]=_[_0xf24e('0x46')](_0x502932[_0xf24e('0x31')]);_0x4e8a08['filters']=_[_0xf24e('0x33')](_0x4e8a08[_0xf24e('0x30')],_0x4e8a08[_0xf24e('0x31')]);_0x24abca[_0xf24e('0x34')]=_[_0xf24e('0x33')](_0x4e8a08[_0xf24e('0x30')],qs[_0xf24e('0x35')](_0x502932[_0xf24e('0x31')][_0xf24e('0x35')]));_0x24abca[_0xf24e('0x34')]=_0x24abca[_0xf24e('0x34')]['length']?_0x24abca['attributes']:_0x4e8a08['model'];if(_0x502932['query'][_0xf24e('0x40')]){_0x24abca[_0xf24e('0x41')]=[{'all':!![]}];}_0x24abca=_[_0xf24e('0x3d')]({},_0x24abca,_0x502932['options']);return db[_0xf24e('0x2b')][_0xf24e('0x47')](_0x24abca)['then'](handleEntityNotFound(_0x305561,null))[_0xf24e('0x21')](respondWithResult(_0x305561,null))['catch'](handleError(_0x305561,null));};exports[_0xf24e('0x48')]=function(_0x4bd911,_0x168e8a){return db[_0xf24e('0x2b')]['create'](_0x4bd911['body'],{})[_0xf24e('0x21')](function(_0x40c018){var _0xe21473=_0x4bd911[_0xf24e('0x49')][_0xf24e('0x23')]({'plain':!![]});if(!_0xe21473)throw new Error(_0xf24e('0x4a'));if(_0xe21473[_0xf24e('0x4b')]==='user'){var _0x3c73a8=_0x40c018[_0xf24e('0x23')]({'plain':!![]});var _0x4e82ac='Pauses';return db['UserProfileSection'][_0xf24e('0x47')]({'where':{'name':_0x4e82ac,'userProfileId':_0xe21473[_0xf24e('0x4c')]},'raw':!![]})[_0xf24e('0x21')](function(_0x28dc9e){if(_0x28dc9e&&_0x28dc9e[_0xf24e('0x4d')]===0x0){return db['UserProfileResource'][_0xf24e('0x48')]({'name':_0x3c73a8[_0xf24e('0x28')],'resourceId':_0x3c73a8['id'],'type':_0x28dc9e[_0xf24e('0x28')],'sectionId':_0x28dc9e['id']},{})[_0xf24e('0x21')](function(){return _0x40c018;});}else{return _0x40c018;}})[_0xf24e('0x43')](function(_0x975222){logger[_0xf24e('0x26')](_0xf24e('0x4e'),_0x975222);throw _0x975222;});}return _0x40c018;})[_0xf24e('0x21')](respondWithResult(_0x168e8a,0xc9))[_0xf24e('0x43')](handleError(_0x168e8a,null));};exports[_0xf24e('0x20')]=function(_0x39b10c,_0x23648e){if(_0x39b10c['body']['id']){delete _0x39b10c['body']['id'];}return db[_0xf24e('0x2b')][_0xf24e('0x47')]({'where':{'id':_0x39b10c['params']['id']}})[_0xf24e('0x21')](handleEntityNotFound(_0x23648e,null))[_0xf24e('0x21')](saveUpdates(_0x39b10c[_0xf24e('0x4f')],null))[_0xf24e('0x21')](respondWithResult(_0x23648e,null))['catch'](handleError(_0x23648e,null));};exports[_0xf24e('0x22')]=function(_0x689e03,_0x56c614){return db[_0xf24e('0x2b')][_0xf24e('0x47')]({'where':{'id':_0x689e03[_0xf24e('0x45')]['id']}})['then'](handleEntityNotFound(_0x56c614,null))[_0xf24e('0x21')](removeEntity(_0x56c614,null))['catch'](handleError(_0x56c614,null));}; \ No newline at end of file +var _0xdffe=['filters','filter','VIRTUAL','Pause','count','includeAll','include','findAll','rows','catch','show','params','keys','merge','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Pauses','UserProfileSection','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','get','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','map','query','model','attributes','intersection','fields','length','hasOwnProperty','order','sort','where'];(function(_0x4ae6ef,_0xc2af80){var _0x3cbb4e=function(_0x569ad5){while(--_0x569ad5){_0x4ae6ef['push'](_0x4ae6ef['shift']());}};_0x3cbb4e(++_0xc2af80);}(_0xdffe,0x1d2));var _0xedff=function(_0x2a8d0f,_0x42983b){_0x2a8d0f=_0x2a8d0f-0x0;var _0xf4cc50=_0xdffe[_0x2a8d0f];return _0xf4cc50;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xedff('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xedff('0x1'));var jsonpatch=require(_0xedff('0x2'));var rp=require(_0xedff('0x3'));var moment=require(_0xedff('0x4'));var BPromise=require(_0xedff('0x5'));var Mustache=require(_0xedff('0x6'));var util=require('util');var path=require(_0xedff('0x7'));var sox=require(_0xedff('0x8'));var csv=require(_0xedff('0x9'));var ejs=require(_0xedff('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xedff('0xb'));var crypto=require(_0xedff('0xc'));var jsforce=require(_0xedff('0xd'));var deskjs=require(_0xedff('0xe'));var toCsv=require(_0xedff('0x9'));var querystring=require(_0xedff('0xf'));var Papa=require(_0xedff('0x10'));var Redis=require(_0xedff('0x11'));var authService=require(_0xedff('0x12'));var qs=require(_0xedff('0x13'));var as=require(_0xedff('0x14'));var hardwareService=require(_0xedff('0x15'));var logger=require(_0xedff('0x16'))(_0xedff('0x17'));var utils=require(_0xedff('0x18'));var config=require(_0xedff('0x19'));var db=require(_0xedff('0x1a'))['db'];function respondWithStatusCode(_0x9a4796,_0x45bd1d){_0x45bd1d=_0x45bd1d||0xcc;return function(_0x527024){if(_0x527024){return _0x9a4796[_0xedff('0x1b')](_0x45bd1d);}return _0x9a4796['status'](_0x45bd1d)['end']();};}function respondWithResult(_0xcc68b9,_0x47a8a2){_0x47a8a2=_0x47a8a2||0xc8;return function(_0x21b554){if(_0x21b554){return _0xcc68b9[_0xedff('0x1c')](_0x47a8a2)['json'](_0x21b554);}};}function respondWithFilteredResult(_0x2c3913,_0x1c9dbd){return function(_0x4b74ea){if(_0x4b74ea){var _0x106a74=_0x4b74ea['count'],_0x23f1c4=_0x1c9dbd['offset'],_0x261038=_0x1c9dbd[_0xedff('0x1d')]+_0x1c9dbd[_0xedff('0x1e')],_0x2ccc55;if(_0x261038>=_0x106a74){_0x261038=_0x106a74;_0x2ccc55=0xc8;}else{_0x2ccc55=0xce;}_0x2c3913['status'](_0x2ccc55);return _0x2c3913[_0xedff('0x1f')](_0xedff('0x20'),_0x23f1c4+'-'+_0x261038+'/'+_0x106a74)[_0xedff('0x21')](_0x4b74ea);}return null;};}function patchUpdates(_0xfe8758){return function(_0x135503){try{jsonpatch[_0xedff('0x22')](_0x135503,_0xfe8758,!![]);}catch(_0x552e9b){return BPromise[_0xedff('0x23')](_0x552e9b);}return _0x135503[_0xedff('0x24')]();};}function saveUpdates(_0x36e6b4,_0xc2e48b){return function(_0x1c391c){if(_0x1c391c){return _0x1c391c[_0xedff('0x25')](_0x36e6b4)[_0xedff('0x26')](function(_0x2cc354){return _0x2cc354;});}return null;};}function removeEntity(_0x48a243,_0x78bdaf){return function(_0x405519){if(_0x405519){return _0x405519['destroy']()[_0xedff('0x26')](function(){var _0x58262d=_0x405519[_0xedff('0x27')]({'plain':!![]});var _0x4ed54b='Pauses';return db[_0xedff('0x28')]['destroy']({'where':{'type':_0x4ed54b,'resourceId':_0x58262d['id']}})[_0xedff('0x26')](function(){return _0x405519;});})['then'](function(){_0x48a243[_0xedff('0x1c')](0xcc)[_0xedff('0x29')]();});}};}function handleEntityNotFound(_0x57ee89,_0x466634){return function(_0x47a1d7){if(!_0x47a1d7){_0x57ee89[_0xedff('0x1b')](0x194);}return _0x47a1d7;};}function handleError(_0x5a8ebd,_0x4505bc){_0x4505bc=_0x4505bc||0x1f4;return function(_0x39ea40){logger[_0xedff('0x2a')](_0x39ea40[_0xedff('0x2b')]);if(_0x39ea40['name']){delete _0x39ea40[_0xedff('0x2c')];}_0x5a8ebd[_0xedff('0x1c')](_0x4505bc)[_0xedff('0x2d')](_0x39ea40);};}exports[_0xedff('0x2e')]=function(_0x16d0f2,_0x1e450c){var _0x24c986={},_0x542779={},_0x5828b1={'count':0x0,'rows':[]};var _0x2ade43=_['map'](db['Pause'][_0xedff('0x2f')],function(_0xb070f){return{'name':_0xb070f[_0xedff('0x30')],'type':_0xb070f[_0xedff('0x31')][_0xedff('0x32')]};});_0x542779['model']=_[_0xedff('0x33')](_0x2ade43,_0xedff('0x2c'));_0x542779['query']=_['keys'](_0x16d0f2[_0xedff('0x34')]);_0x542779['filters']=_['intersection'](_0x542779[_0xedff('0x35')],_0x542779[_0xedff('0x34')]);_0x24c986[_0xedff('0x36')]=_[_0xedff('0x37')](_0x542779[_0xedff('0x35')],qs[_0xedff('0x38')](_0x16d0f2[_0xedff('0x34')][_0xedff('0x38')]));_0x24c986[_0xedff('0x36')]=_0x24c986['attributes'][_0xedff('0x39')]?_0x24c986[_0xedff('0x36')]:_0x542779['model'];if(!_0x16d0f2[_0xedff('0x34')][_0xedff('0x3a')]('nolimit')){_0x24c986[_0xedff('0x1e')]=qs['limit'](_0x16d0f2['query']['limit']);_0x24c986[_0xedff('0x1d')]=qs[_0xedff('0x1d')](_0x16d0f2['query'][_0xedff('0x1d')]);}_0x24c986[_0xedff('0x3b')]=qs[_0xedff('0x3c')](_0x16d0f2['query'][_0xedff('0x3c')]);_0x24c986[_0xedff('0x3d')]=qs[_0xedff('0x3e')](_['pick'](_0x16d0f2[_0xedff('0x34')],_0x542779[_0xedff('0x3e')]));if(_0x16d0f2['query'][_0xedff('0x3f')]){_0x24c986[_0xedff('0x3d')]=_['merge'](_0x24c986[_0xedff('0x3d')],{'$or':_[_0xedff('0x33')](_0x2ade43,function(_0x1ad53f){if(_0x1ad53f[_0xedff('0x31')]!==_0xedff('0x40')){var _0x2cc836={};_0x2cc836[_0x1ad53f[_0xedff('0x2c')]]={'$like':'%'+_0x16d0f2[_0xedff('0x34')][_0xedff('0x3f')]+'%'};return _0x2cc836;}})});}_0x24c986=_['merge']({},_0x24c986,_0x16d0f2['options']);var _0x2c5005={'where':_0x24c986[_0xedff('0x3d')]};return db[_0xedff('0x41')][_0xedff('0x42')](_0x2c5005)[_0xedff('0x26')](function(_0x408526){_0x5828b1['count']=_0x408526;if(_0x16d0f2[_0xedff('0x34')][_0xedff('0x43')]){_0x24c986[_0xedff('0x44')]=[{'all':!![]}];}return db[_0xedff('0x41')][_0xedff('0x45')](_0x24c986);})[_0xedff('0x26')](function(_0x24d27a){_0x5828b1[_0xedff('0x46')]=_0x24d27a;return _0x5828b1;})['then'](respondWithFilteredResult(_0x1e450c,_0x24c986))[_0xedff('0x47')](handleError(_0x1e450c,null));};exports[_0xedff('0x48')]=function(_0x1f1c0c,_0x2c9dd2){var _0x7e92d1={'raw':!![],'where':{'id':_0x1f1c0c[_0xedff('0x49')]['id']}},_0x11692b={};_0x11692b[_0xedff('0x35')]=_[_0xedff('0x4a')](db['Pause'][_0xedff('0x2f')]);_0x11692b[_0xedff('0x34')]=_[_0xedff('0x4a')](_0x1f1c0c[_0xedff('0x34')]);_0x11692b[_0xedff('0x3e')]=_[_0xedff('0x37')](_0x11692b[_0xedff('0x35')],_0x11692b[_0xedff('0x34')]);_0x7e92d1[_0xedff('0x36')]=_[_0xedff('0x37')](_0x11692b[_0xedff('0x35')],qs[_0xedff('0x38')](_0x1f1c0c[_0xedff('0x34')]['fields']));_0x7e92d1[_0xedff('0x36')]=_0x7e92d1[_0xedff('0x36')][_0xedff('0x39')]?_0x7e92d1['attributes']:_0x11692b[_0xedff('0x35')];if(_0x1f1c0c['query'][_0xedff('0x43')]){_0x7e92d1[_0xedff('0x44')]=[{'all':!![]}];}_0x7e92d1=_[_0xedff('0x4b')]({},_0x7e92d1,_0x1f1c0c[_0xedff('0x4c')]);return db[_0xedff('0x41')]['find'](_0x7e92d1)[_0xedff('0x26')](handleEntityNotFound(_0x2c9dd2,null))['then'](respondWithResult(_0x2c9dd2,null))[_0xedff('0x47')](handleError(_0x2c9dd2,null));};exports[_0xedff('0x4d')]=function(_0x46516e,_0x32ceb){return db[_0xedff('0x41')][_0xedff('0x4d')](_0x46516e[_0xedff('0x4e')],{})[_0xedff('0x26')](function(_0xe884fc){var _0x2ec422=_0x46516e[_0xedff('0x4f')][_0xedff('0x27')]({'plain':!![]});if(!_0x2ec422)throw new Error(_0xedff('0x50'));if(_0x2ec422[_0xedff('0x51')]===_0xedff('0x4f')){var _0x1ee17d=_0xe884fc[_0xedff('0x27')]({'plain':!![]});var _0x5176c3=_0xedff('0x52');return db[_0xedff('0x53')][_0xedff('0x54')]({'where':{'name':_0x5176c3,'userProfileId':_0x2ec422['userProfileId']},'raw':!![]})[_0xedff('0x26')](function(_0x25a5c2){if(_0x25a5c2&&_0x25a5c2[_0xedff('0x55')]===0x0){return db[_0xedff('0x28')][_0xedff('0x4d')]({'name':_0x1ee17d[_0xedff('0x2c')],'resourceId':_0x1ee17d['id'],'type':_0x25a5c2['name'],'sectionId':_0x25a5c2['id']},{})[_0xedff('0x26')](function(){return _0xe884fc;});}else{return _0xe884fc;}})['catch'](function(_0x3ad215){logger[_0xedff('0x2a')](_0xedff('0x56'),_0x3ad215);throw _0x3ad215;});}return _0xe884fc;})['then'](respondWithResult(_0x32ceb,0xc9))['catch'](handleError(_0x32ceb,null));};exports[_0xedff('0x25')]=function(_0x3760bb,_0x3c9ed2){if(_0x3760bb[_0xedff('0x4e')]['id']){delete _0x3760bb[_0xedff('0x4e')]['id'];}return db['Pause'][_0xedff('0x54')]({'where':{'id':_0x3760bb[_0xedff('0x49')]['id']}})[_0xedff('0x26')](handleEntityNotFound(_0x3c9ed2,null))[_0xedff('0x26')](saveUpdates(_0x3760bb[_0xedff('0x4e')],null))[_0xedff('0x26')](respondWithResult(_0x3c9ed2,null))[_0xedff('0x47')](handleError(_0x3c9ed2,null));};exports[_0xedff('0x57')]=function(_0xa281be,_0xcc31fb){return db['Pause'][_0xedff('0x54')]({'where':{'id':_0xa281be[_0xedff('0x49')]['id']}})[_0xedff('0x26')](handleEntityNotFound(_0xcc31fb,null))[_0xedff('0x26')](removeEntity(_0xcc31fb,null))[_0xedff('0x47')](handleError(_0xcc31fb,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index b1bfbc6..9ab75bd 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 _0x1d11=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./pause.attributes','define','Pause'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x1d11,0xb6));var _0x11d1=function(_0x1deb5f,_0x2fdb8f){_0x1deb5f=_0x1deb5f-0x0;var _0x3729a3=_0x1d11[_0x1deb5f];return _0x3729a3;};'use strict';var _=require(_0x11d1('0x0'));var util=require(_0x11d1('0x1'));var logger=require(_0x11d1('0x2'))(_0x11d1('0x3'));var moment=require(_0x11d1('0x4'));var BPromise=require(_0x11d1('0x5'));var rp=require(_0x11d1('0x6'));var fs=require('fs');var path=require(_0x11d1('0x7'));var rimraf=require(_0x11d1('0x8'));var config=require(_0x11d1('0x9'));var attributes=require(_0x11d1('0xa'));module['exports']=function(_0x32d808,_0x4a9622){return _0x32d808[_0x11d1('0xb')](_0x11d1('0xc'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa25=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','Pause','util'];(function(_0x4b2e0b,_0x503944){var _0x243de0=function(_0x2842fb){while(--_0x2842fb){_0x4b2e0b['push'](_0x4b2e0b['shift']());}};_0x243de0(++_0x503944);}(_0xfa25,0xd1));var _0x5fa2=function(_0x25dca6,_0x3fe0c8){_0x25dca6=_0x25dca6-0x0;var _0x174424=_0xfa25[_0x25dca6];return _0x174424;};'use strict';var _=require('lodash');var util=require(_0x5fa2('0x0'));var logger=require(_0x5fa2('0x1'))(_0x5fa2('0x2'));var moment=require(_0x5fa2('0x3'));var BPromise=require(_0x5fa2('0x4'));var rp=require(_0x5fa2('0x5'));var fs=require('fs');var path=require(_0x5fa2('0x6'));var rimraf=require(_0x5fa2('0x7'));var config=require('../../config/environment');var attributes=require('./pause.attributes');module[_0x5fa2('0x8')]=function(_0x29efc3,_0x479b86){return _0x29efc3['define'](_0x5fa2('0x9'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/pause/pause.rpc.js b/server/api/pause/pause.rpc.js index f665dd5..e985d53 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 _0x9c2b=['then','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','info','Pause,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','ShowPause','Pause','options','where','attributes','map','include','model'];(function(_0x34bf97,_0xc60f9d){var _0x292719=function(_0x31354e){while(--_0x31354e){_0x34bf97['push'](_0x34bf97['shift']());}};_0x292719(++_0xc60f9d);}(_0x9c2b,0x1a5));var _0xb9c2=function(_0x2112d4,_0x3c863c){_0x2112d4=_0x2112d4-0x0;var _0x434972=_0x9c2b[_0x2112d4];return _0x434972;};'use strict';var _=require('lodash');var util=require(_0xb9c2('0x0'));var moment=require('moment');var BPromise=require(_0xb9c2('0x1'));var rs=require(_0xb9c2('0x2'));var fs=require('fs');var Redis=require(_0xb9c2('0x3'));var db=require(_0xb9c2('0x4'))['db'];var utils=require(_0xb9c2('0x5'));var logger=require(_0xb9c2('0x6'))('rpc');var config=require(_0xb9c2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb9c2('0x8')][_0xb9c2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4a2c2e,_0x2830ec,_0x156740){return new BPromise(function(_0x25d7a7,_0x4011bb){return client['request'](_0x4a2c2e,_0x156740)['then'](function(_0x3d9c98){logger[_0xb9c2('0xa')](_0xb9c2('0xb'),_0x2830ec,'request\x20sent');logger[_0xb9c2('0xc')]('Pause,\x20%s,\x20%s,\x20%s',_0x2830ec,_0xb9c2('0xd'),JSON[_0xb9c2('0xe')](_0x3d9c98));if(_0x3d9c98['error']){if(_0x3d9c98[_0xb9c2('0xf')]['code']===0x1f4){logger[_0xb9c2('0xf')]('Pause,\x20%s,\x20%s',_0x2830ec,_0x3d9c98['error'][_0xb9c2('0x10')]);return _0x4011bb(_0x3d9c98[_0xb9c2('0xf')][_0xb9c2('0x10')]);}logger[_0xb9c2('0xf')](_0xb9c2('0xb'),_0x2830ec,_0x3d9c98['error']['message']);return _0x25d7a7(_0x3d9c98['error'][_0xb9c2('0x10')]);}else{logger['info']('Pause,\x20%s,\x20%s',_0x2830ec,_0xb9c2('0xd'));_0x25d7a7(_0x3d9c98[_0xb9c2('0x11')][_0xb9c2('0x10')]);}})[_0xb9c2('0x12')](function(_0x1aaaee){logger[_0xb9c2('0xf')]('Pause,\x20%s,\x20%s',_0x2830ec,_0x1aaaee);_0x4011bb(_0x1aaaee);});});}exports[_0xb9c2('0x13')]=function(_0x3b4115){var _0x5e5aff=this;return new Promise(function(_0x4e67dd,_0x1f50ea){return db[_0xb9c2('0x14')]['find']({'raw':_0x3b4115['options']?_0x3b4115[_0xb9c2('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x3b4115[_0xb9c2('0x15')]?_0x3b4115[_0xb9c2('0x15')][_0xb9c2('0x16')]||null:null,'attributes':_0x3b4115[_0xb9c2('0x15')]?_0x3b4115[_0xb9c2('0x15')][_0xb9c2('0x17')]||null:null,'include':_0x3b4115[_0xb9c2('0x15')]?_0x3b4115['options']['include']?_[_0xb9c2('0x18')](_0x3b4115[_0xb9c2('0x15')][_0xb9c2('0x19')],function(_0x5c5d5e){return{'model':db[_0x5c5d5e['model']],'as':_0x5c5d5e['as'],'attributes':_0x5c5d5e[_0xb9c2('0x17')],'include':_0x5c5d5e[_0xb9c2('0x19')]?_['map'](_0x5c5d5e[_0xb9c2('0x19')],function(_0x123a7b){return{'model':db[_0x123a7b[_0xb9c2('0x1a')]],'as':_0x123a7b['as'],'attributes':_0x123a7b[_0xb9c2('0x17')],'include':_0x123a7b[_0xb9c2('0x19')]?_[_0xb9c2('0x18')](_0x123a7b['include'],function(_0x299a90){return{'model':db[_0x299a90['model']],'as':_0x299a90['as'],'attributes':_0x299a90[_0xb9c2('0x17')]};}):[]};}):[]};}):[]:[]})[_0xb9c2('0x1b')](function(_0x5dceca){logger['info']('ShowPause',_0x3b4115);logger[_0xb9c2('0xc')](_0xb9c2('0x13'),_0x3b4115,JSON['stringify'](_0x5dceca));_0x4e67dd(_0x5dceca);})['catch'](function(_0x51e846){logger['error'](_0xb9c2('0x13'),_0x51e846[_0xb9c2('0x10')],_0x3b4115);_0x1f50ea(_0x5e5aff[_0xb9c2('0xf')](0x1f4,_0x51e846[_0xb9c2('0x10')]));});});}; \ No newline at end of file +var _0xfae2=['debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','Pause,\x20%s,\x20%s','message','result','ShowPause','Pause','find','options','where','attributes','include','model','map','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent'];(function(_0x5b391c,_0x4597a3){var _0x3cc2fb=function(_0x15bf24){while(--_0x15bf24){_0x5b391c['push'](_0x5b391c['shift']());}};_0x3cc2fb(++_0x4597a3);}(_0xfae2,0x152));var _0x2fae=function(_0x1fd5eb,_0x235203){_0x1fd5eb=_0x1fd5eb-0x0;var _0x102365=_0xfae2[_0x1fd5eb];return _0x102365;};'use strict';var _=require(_0x2fae('0x0'));var util=require(_0x2fae('0x1'));var moment=require(_0x2fae('0x2'));var BPromise=require(_0x2fae('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2fae('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2fae('0x5'))(_0x2fae('0x6'));var config=require(_0x2fae('0x7'));var jayson=require(_0x2fae('0x8'));var client=jayson[_0x2fae('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58f3f6,_0x2347b5,_0x12c90b){return new BPromise(function(_0x3d9ba5,_0x1de2c5){return client[_0x2fae('0xa')](_0x58f3f6,_0x12c90b)[_0x2fae('0xb')](function(_0x1215de){logger[_0x2fae('0xc')]('Pause,\x20%s,\x20%s',_0x2347b5,_0x2fae('0xd'));logger[_0x2fae('0xe')](_0x2fae('0xf'),_0x2347b5,_0x2fae('0xd'),JSON[_0x2fae('0x10')](_0x1215de));if(_0x1215de[_0x2fae('0x11')]){if(_0x1215de[_0x2fae('0x11')][_0x2fae('0x12')]===0x1f4){logger['error'](_0x2fae('0x13'),_0x2347b5,_0x1215de[_0x2fae('0x11')][_0x2fae('0x14')]);return _0x1de2c5(_0x1215de[_0x2fae('0x11')][_0x2fae('0x14')]);}logger[_0x2fae('0x11')](_0x2fae('0x13'),_0x2347b5,_0x1215de[_0x2fae('0x11')][_0x2fae('0x14')]);return _0x3d9ba5(_0x1215de[_0x2fae('0x11')][_0x2fae('0x14')]);}else{logger['info'](_0x2fae('0x13'),_0x2347b5,_0x2fae('0xd'));_0x3d9ba5(_0x1215de[_0x2fae('0x15')][_0x2fae('0x14')]);}})['catch'](function(_0x1c8a90){logger[_0x2fae('0x11')](_0x2fae('0x13'),_0x2347b5,_0x1c8a90);_0x1de2c5(_0x1c8a90);});});}exports[_0x2fae('0x16')]=function(_0x24ada3){var _0x3b5cf5=this;return new Promise(function(_0x238a87,_0x24b426){return db[_0x2fae('0x17')][_0x2fae('0x18')]({'raw':_0x24ada3['options']?_0x24ada3['options']['raw']===undefined?!![]:![]:!![],'where':_0x24ada3['options']?_0x24ada3[_0x2fae('0x19')][_0x2fae('0x1a')]||null:null,'attributes':_0x24ada3[_0x2fae('0x19')]?_0x24ada3[_0x2fae('0x19')][_0x2fae('0x1b')]||null:null,'include':_0x24ada3['options']?_0x24ada3[_0x2fae('0x19')][_0x2fae('0x1c')]?_['map'](_0x24ada3[_0x2fae('0x19')]['include'],function(_0x2f2bc3){return{'model':db[_0x2f2bc3[_0x2fae('0x1d')]],'as':_0x2f2bc3['as'],'attributes':_0x2f2bc3[_0x2fae('0x1b')],'include':_0x2f2bc3[_0x2fae('0x1c')]?_[_0x2fae('0x1e')](_0x2f2bc3[_0x2fae('0x1c')],function(_0x118cb9){return{'model':db[_0x118cb9[_0x2fae('0x1d')]],'as':_0x118cb9['as'],'attributes':_0x118cb9[_0x2fae('0x1b')],'include':_0x118cb9[_0x2fae('0x1c')]?_[_0x2fae('0x1e')](_0x118cb9['include'],function(_0x28ed99){return{'model':db[_0x28ed99[_0x2fae('0x1d')]],'as':_0x28ed99['as'],'attributes':_0x28ed99[_0x2fae('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2fae('0xb')](function(_0x2b1e80){logger['info']('ShowPause',_0x24ada3);logger[_0x2fae('0xe')](_0x2fae('0x16'),_0x24ada3,JSON['stringify'](_0x2b1e80));_0x238a87(_0x2b1e80);})[_0x2fae('0x1f')](function(_0x31f96b){logger[_0x2fae('0x11')](_0x2fae('0x16'),_0x31f96b[_0x2fae('0x14')],_0x24ada3);_0x24b426(_0x3b5cf5[_0x2fae('0x11')](0x1f4,_0x31f96b['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 1d0275a..907cfbe 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 _0xb1fe=['../../components/interaction/service','../../config/environment','./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','download','join','root','originalname','%s-%s%s','basename','extname','now','file','webhookPost','put','update','exports','multer','connect-timeout','Router'];(function(_0x3a7f15,_0x48ac0d){var _0x3b7ec9=function(_0x356ad3){while(--_0x356ad3){_0x3a7f15['push'](_0x3a7f15['shift']());}};_0x3b7ec9(++_0x48ac0d);}(_0xb1fe,0x11d));var _0xeb1f=function(_0xb33be5,_0x4a8258){_0xb33be5=_0xb33be5-0x0;var _0x5e942d=_0xb1fe[_0xb33be5];return _0x5e942d;};'use strict';var multer=require(_0xeb1f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xeb1f('0x1'));var express=require('express');var router=express[_0xeb1f('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xeb1f('0x3'));var config=require(_0xeb1f('0x4'));var controller=require(_0xeb1f('0x5'));router[_0xeb1f('0x6')]('/',auth[_0xeb1f('0x7')](),controller['index']);router['get'](_0xeb1f('0x8'),controller[_0xeb1f('0x9')]);router[_0xeb1f('0x6')](_0xeb1f('0xa'),auth[_0xeb1f('0x7')](),controller['show']);router[_0xeb1f('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0xeb1f('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xcf1688,_0x53c34c,_0x3dc601){_0x3dc601(null,path[_0xeb1f('0xc')](config[_0xeb1f('0xd')],'server/files/plugins'));},'filename':function(_0x4352df,_0x209df0,_0x5cd0b0){_0x209df0[_0xeb1f('0xe')]=_0x209df0['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x5cd0b0(null,util['format'](_0xeb1f('0xf'),path[_0xeb1f('0x10')](_0x209df0[_0xeb1f('0xe')],path[_0xeb1f('0x11')](_0x209df0[_0xeb1f('0xe')])),Date[_0xeb1f('0x12')](),path[_0xeb1f('0x11')](_0x209df0[_0xeb1f('0xe')])));}})});router['post']('/',upload['single'](_0xeb1f('0x13')),controller['upload']);router['post']('/webhook',controller[_0xeb1f('0x14')]);router[_0xeb1f('0x15')]('/:id',auth[_0xeb1f('0x7')](),controller[_0xeb1f('0x16')]);router['delete'](_0xeb1f('0xa'),auth[_0xeb1f('0x7')](),controller['delete']);module[_0xeb1f('0x17')]=router; \ No newline at end of file +var _0xa540=['single','upload','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','./plugin.controller','get','index','/webhook','/:id','isAuthenticated','show','/:id/download','diskStorage','join','server/files/plugins','originalname','replace','format','basename','extname','now'];(function(_0x1fb7e3,_0x5943f3){var _0x5515d4=function(_0x1959f2){while(--_0x1959f2){_0x1fb7e3['push'](_0x1fb7e3['shift']());}};_0x5515d4(++_0x5943f3);}(_0xa540,0x163));var _0x0a54=function(_0x6173fc,_0x32aadf){_0x6173fc=_0x6173fc-0x0;var _0x965fbe=_0xa540[_0x6173fc];return _0x965fbe;};'use strict';var multer=require(_0x0a54('0x0'));var util=require(_0x0a54('0x1'));var path=require(_0x0a54('0x2'));var timeout=require(_0x0a54('0x3'));var express=require('express');var router=express[_0x0a54('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x0a54('0x5'));router[_0x0a54('0x6')]('/',auth['isAuthenticated'](),controller[_0x0a54('0x7')]);router[_0x0a54('0x6')](_0x0a54('0x8'),controller['webhookGet']);router[_0x0a54('0x6')](_0x0a54('0x9'),auth[_0x0a54('0xa')](),controller[_0x0a54('0xb')]);router['get'](_0x0a54('0xc'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer[_0x0a54('0xd')]({'destination':function(_0x3a3af3,_0x5cad44,_0x3943de){_0x3943de(null,path[_0x0a54('0xe')](config['root'],_0x0a54('0xf')));},'filename':function(_0x48eca9,_0x1e4705,_0x6de8a3){_0x1e4705[_0x0a54('0x10')]=_0x1e4705[_0x0a54('0x10')][_0x0a54('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x6de8a3(null,util[_0x0a54('0x12')]('%s-%s%s',path[_0x0a54('0x13')](_0x1e4705[_0x0a54('0x10')],path[_0x0a54('0x14')](_0x1e4705[_0x0a54('0x10')])),Date[_0x0a54('0x15')](),path[_0x0a54('0x14')](_0x1e4705[_0x0a54('0x10')])));}})});router['post']('/',upload[_0x0a54('0x16')]('file'),controller[_0x0a54('0x17')]);router[_0x0a54('0x18')]('/webhook',controller['webhookPost']);router[_0x0a54('0x19')](_0x0a54('0x9'),auth[_0x0a54('0xa')](),controller[_0x0a54('0x1a')]);router[_0x0a54('0x1b')](_0x0a54('0x9'),auth[_0x0a54('0xa')](),controller[_0x0a54('0x1b')]);module[_0x0a54('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index 16dcb0e..1afc01a 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 _0x1d88=['Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','html','TEXT','STRING','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','ENUM','always','never'];(function(_0x24f4ad,_0x548590){var _0x4b208d=function(_0x496063){while(--_0x496063){_0x24f4ad['push'](_0x24f4ad['shift']());}};_0x4b208d(++_0x548590);}(_0x1d88,0x65));var _0x81d8=function(_0x196d1a,_0x15db90){_0x196d1a=_0x196d1a-0x0;var _0x368904=_0x1d88[_0x196d1a];return _0x368904;};'use strict';var Sequelize=require(_0x81d8('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x81d8('0x1'),'script')},'description':{'type':Sequelize[_0x81d8('0x2')]},'version':{'type':Sequelize[_0x81d8('0x2')]},'path':{'type':Sequelize[_0x81d8('0x3')],'comment':_0x81d8('0x4')},'active':{'type':Sequelize[_0x81d8('0x5')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x81d8('0x6')]('adminOnly','agentOnly',_0x81d8('0x7'),_0x81d8('0x8')),'defaultValue':_0x81d8('0x7'),'comment':_0x81d8('0x9')},'icon':{'type':Sequelize[_0x81d8('0x3')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x81d8('0x3')]},'scriptName':{'type':Sequelize[_0x81d8('0x3')]},'scriptPath':{'type':Sequelize[_0x81d8('0x3')]}}; \ No newline at end of file +var _0x9434=['STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','never','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize'];(function(_0x51a882,_0x840735){var _0x114151=function(_0x3ecb7f){while(--_0x3ecb7f){_0x51a882['push'](_0x51a882['shift']());}};_0x114151(++_0x840735);}(_0x9434,0x74));var _0x4943=function(_0x2dcb53,_0x1f714b){_0x2dcb53=_0x2dcb53-0x0;var _0x44f14e=_0x9434[_0x2dcb53];return _0x44f14e;};'use strict';var Sequelize=require(_0x4943('0x0'));module['exports']={'name':{'type':Sequelize[_0x4943('0x1')]},'type':{'type':Sequelize['ENUM'](_0x4943('0x2'),_0x4943('0x3'))},'description':{'type':Sequelize[_0x4943('0x4')]},'version':{'type':Sequelize[_0x4943('0x4')]},'path':{'type':Sequelize[_0x4943('0x1')],'comment':_0x4943('0x5')},'active':{'type':Sequelize[_0x4943('0x6')],'defaultValue':0x0,'comment':_0x4943('0x7')},'sidebar':{'type':Sequelize[_0x4943('0x8')](_0x4943('0x9'),'agentOnly','always',_0x4943('0xa')),'defaultValue':_0x4943('0xb'),'comment':_0x4943('0xc')},'icon':{'type':Sequelize[_0x4943('0x1')]},'adminUrl':{'type':Sequelize[_0x4943('0x1')]},'agentUrl':{'type':Sequelize[_0x4943('0x1')]},'scriptName':{'type':Sequelize[_0x4943('0x1')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index 7472b11..f1c8fce 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 _0x41bb=['UserProfileResource','destroy','end','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','keys','find','catch','download','join','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','Sequelize','**/*','dirname','attachments/**/*','finalize','close','existsSync','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','filename','extname','file','chmodSync','readdirSync','Invalid\x20plugin\x20structure','isFile','isDirectory','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','html','Invalid\x20manifest:\x20views\x20missing','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','Plugins','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','update','delete','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','sendStatus','webhookPost','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','offset','limit','set','Content-Range','apply','reject','save','then','get'];(function(_0x2b3cad,_0x573629){var _0x2175c4=function(_0x2f5a4f){while(--_0x2f5a4f){_0x2b3cad['push'](_0x2b3cad['shift']());}};_0x2175c4(++_0x573629);}(_0x41bb,0x1d9));var _0xb41b=function(_0x56c859,_0x11dac2){_0x56c859=_0x56c859-0x0;var _0x57f2a5=_0x41bb[_0x56c859];return _0x57f2a5;};'use strict';var pdf=require(_0xb41b('0x0'));var emlformat=require(_0xb41b('0x1'));var rimraf=require(_0xb41b('0x2'));var zipdir=require(_0xb41b('0x3'));var jsonpatch=require(_0xb41b('0x4'));var rp=require('request-promise');var moment=require(_0xb41b('0x5'));var BPromise=require(_0xb41b('0x6'));var Mustache=require(_0xb41b('0x7'));var util=require('util');var path=require(_0xb41b('0x8'));var sox=require(_0xb41b('0x9'));var csv=require(_0xb41b('0xa'));var ejs=require(_0xb41b('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb41b('0xc'));var crypto=require(_0xb41b('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb41b('0xa'));var querystring=require('querystring');var Papa=require(_0xb41b('0xe'));var extract=require('extract-zip');var rimraf=require('rimraf');var archiver=require(_0xb41b('0xf'));var Redis=require(_0xb41b('0x10'));var authService=require(_0xb41b('0x11'));var qs=require(_0xb41b('0x12'));var as=require(_0xb41b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb41b('0x14'));var utils=require(_0xb41b('0x15'));var config=require(_0xb41b('0x16'));var db=require(_0xb41b('0x17'))['db'];config[_0xb41b('0x18')]=_[_0xb41b('0x19')](config[_0xb41b('0x18')],{'host':_0xb41b('0x1a'),'port':0x18eb});var socket=require(_0xb41b('0x1b'))(new Redis(config[_0xb41b('0x18')]));require('./plugin.socket')[_0xb41b('0x1c')](socket);function respondWithStatusCode(_0x5c509d,_0x19c5d7){_0x19c5d7=_0x19c5d7||0xcc;return function(_0x41705e){if(_0x41705e){return _0x5c509d['sendStatus'](_0x19c5d7);}return _0x5c509d[_0xb41b('0x1d')](_0x19c5d7)['end']();};}function respondWithResult(_0x15148c,_0x3f2d86){_0x3f2d86=_0x3f2d86||0xc8;return function(_0x1d903b){if(_0x1d903b){return _0x15148c['status'](_0x3f2d86)[_0xb41b('0x1e')](_0x1d903b);}};}function respondWithFilteredResult(_0x4f3768,_0x51bf41){return function(_0x327cef){if(_0x327cef){var _0x524fd6=_0x327cef['count'],_0x1aedb8=_0x51bf41[_0xb41b('0x1f')],_0x40e1f8=_0x51bf41[_0xb41b('0x1f')]+_0x51bf41[_0xb41b('0x20')],_0x57bd08;if(_0x40e1f8>=_0x524fd6){_0x40e1f8=_0x524fd6;_0x57bd08=0xc8;}else{_0x57bd08=0xce;}_0x4f3768[_0xb41b('0x1d')](_0x57bd08);return _0x4f3768[_0xb41b('0x21')](_0xb41b('0x22'),_0x1aedb8+'-'+_0x40e1f8+'/'+_0x524fd6)['json'](_0x327cef);}return null;};}function patchUpdates(_0x46051d){return function(_0x1c45df){try{jsonpatch[_0xb41b('0x23')](_0x1c45df,_0x46051d,!![]);}catch(_0x3b465e){return BPromise[_0xb41b('0x24')](_0x3b465e);}return _0x1c45df[_0xb41b('0x25')]();};}function saveUpdates(_0x2fde06,_0x553b53){return function(_0x37debb){if(_0x37debb){return _0x37debb['update'](_0x2fde06)[_0xb41b('0x26')](function(_0x274710){return _0x274710;});}return null;};}function removeEntity(_0x12927f,_0x11d05e){return function(_0x14000b){if(_0x14000b){return _0x14000b['destroy']()[_0xb41b('0x26')](function(){var _0x1c55ac=_0x14000b[_0xb41b('0x27')]({'plain':!![]});var _0x4a14a7='Plugins';return db[_0xb41b('0x28')][_0xb41b('0x29')]({'where':{'type':_0x4a14a7,'resourceId':_0x1c55ac['id']}})[_0xb41b('0x26')](function(){return _0x14000b;});})[_0xb41b('0x26')](function(){_0x12927f[_0xb41b('0x1d')](0xcc)[_0xb41b('0x2a')]();});}};}function handleEntityNotFound(_0x40fbfc,_0x5961ed){return function(_0x30407e){if(!_0x30407e){_0x40fbfc['sendStatus'](0x194);}return _0x30407e;};}function handleError(_0x667a21,_0x2d7c7d){_0x2d7c7d=_0x2d7c7d||0x1f4;return function(_0xd7c788){logger[_0xb41b('0x2b')](_0xd7c788[_0xb41b('0x2c')]);if(_0xd7c788[_0xb41b('0x2d')]){delete _0xd7c788[_0xb41b('0x2d')];}_0x667a21[_0xb41b('0x1d')](_0x2d7c7d)[_0xb41b('0x2e')](_0xd7c788);};}exports[_0xb41b('0x2f')]=function(_0x508f03,_0xd31af7){var _0xcdfda8={},_0x2ba7f9={},_0x5f308d={'count':0x0,'rows':[]};var _0x20637e=_[_0xb41b('0x30')](db[_0xb41b('0x31')][_0xb41b('0x32')],function(_0x58fb46){return{'name':_0x58fb46[_0xb41b('0x33')],'type':_0x58fb46[_0xb41b('0x34')][_0xb41b('0x35')]};});_0x2ba7f9[_0xb41b('0x36')]=_['map'](_0x20637e,_0xb41b('0x2d'));_0x2ba7f9[_0xb41b('0x37')]=_['keys'](_0x508f03[_0xb41b('0x37')]);_0x2ba7f9[_0xb41b('0x38')]=_['intersection'](_0x2ba7f9[_0xb41b('0x36')],_0x2ba7f9[_0xb41b('0x37')]);_0xcdfda8[_0xb41b('0x39')]=_[_0xb41b('0x3a')](_0x2ba7f9[_0xb41b('0x36')],qs[_0xb41b('0x3b')](_0x508f03[_0xb41b('0x37')]['fields']));_0xcdfda8[_0xb41b('0x39')]=_0xcdfda8[_0xb41b('0x39')][_0xb41b('0x3c')]?_0xcdfda8[_0xb41b('0x39')]:_0x2ba7f9[_0xb41b('0x36')];if(!_0x508f03[_0xb41b('0x37')][_0xb41b('0x3d')]('nolimit')){_0xcdfda8[_0xb41b('0x20')]=qs[_0xb41b('0x20')](_0x508f03['query'][_0xb41b('0x20')]);_0xcdfda8[_0xb41b('0x1f')]=qs[_0xb41b('0x1f')](_0x508f03[_0xb41b('0x37')][_0xb41b('0x1f')]);}_0xcdfda8[_0xb41b('0x3e')]=qs[_0xb41b('0x3f')](_0x508f03['query'][_0xb41b('0x3f')]);_0xcdfda8[_0xb41b('0x40')]=qs[_0xb41b('0x38')](_[_0xb41b('0x41')](_0x508f03[_0xb41b('0x37')],_0x2ba7f9[_0xb41b('0x38')]));if(_0x508f03[_0xb41b('0x37')][_0xb41b('0x42')]){_0xcdfda8['where']=_[_0xb41b('0x43')](_0xcdfda8[_0xb41b('0x40')],{'$or':_[_0xb41b('0x30')](_0x20637e,function(_0x44a7f1){if(_0x44a7f1[_0xb41b('0x34')]!==_0xb41b('0x44')){var _0x541f16={};_0x541f16[_0x44a7f1[_0xb41b('0x2d')]]={'$like':'%'+_0x508f03[_0xb41b('0x37')]['filter']+'%'};return _0x541f16;}})});}_0xcdfda8=_[_0xb41b('0x43')]({},_0xcdfda8,_0x508f03[_0xb41b('0x45')]);var _0x463dfd={'where':_0xcdfda8[_0xb41b('0x40')]};return db[_0xb41b('0x31')]['count'](_0x463dfd)[_0xb41b('0x26')](function(_0x364d18){_0x5f308d[_0xb41b('0x46')]=_0x364d18;if(_0x508f03[_0xb41b('0x37')][_0xb41b('0x47')]){_0xcdfda8[_0xb41b('0x48')]=[{'all':!![]}];}return db['Plugin'][_0xb41b('0x49')](_0xcdfda8);})[_0xb41b('0x26')](function(_0x4f24be){_0x5f308d['rows']=_0x4f24be;return _0x5f308d;})['then'](respondWithFilteredResult(_0xd31af7,_0xcdfda8))['catch'](handleError(_0xd31af7,null));};exports[_0xb41b('0x4a')]=function(_0x214bd1,_0x5eb283){var _0x162643={'raw':!![],'where':{'id':_0x214bd1[_0xb41b('0x4b')]['id']}},_0x5ccb46={};_0x5ccb46[_0xb41b('0x36')]=_[_0xb41b('0x4c')](db[_0xb41b('0x31')]['rawAttributes']);_0x5ccb46[_0xb41b('0x37')]=_['keys'](_0x214bd1[_0xb41b('0x37')]);_0x5ccb46[_0xb41b('0x38')]=_['intersection'](_0x5ccb46['model'],_0x5ccb46[_0xb41b('0x37')]);_0x162643[_0xb41b('0x39')]=_['intersection'](_0x5ccb46[_0xb41b('0x36')],qs[_0xb41b('0x3b')](_0x214bd1[_0xb41b('0x37')][_0xb41b('0x3b')]));_0x162643[_0xb41b('0x39')]=_0x162643[_0xb41b('0x39')]['length']?_0x162643[_0xb41b('0x39')]:_0x5ccb46['model'];if(_0x214bd1[_0xb41b('0x37')]['includeAll']){_0x162643[_0xb41b('0x48')]=[{'all':!![]}];}_0x162643=_[_0xb41b('0x43')]({},_0x162643,_0x214bd1[_0xb41b('0x45')]);return db[_0xb41b('0x31')][_0xb41b('0x4d')](_0x162643)[_0xb41b('0x26')](handleEntityNotFound(_0x5eb283,null))['then'](respondWithResult(_0x5eb283,null))[_0xb41b('0x4e')](handleError(_0x5eb283,null));};exports[_0xb41b('0x4f')]=function(_0x50a9a1,_0x2dad4f,_0x41a231){return db[_0xb41b('0x31')][_0xb41b('0x4d')]({'where':{'id':_0x50a9a1[_0xb41b('0x4b')]['id']},'attributes':[_0xb41b('0x2d'),_0xb41b('0x8')],'raw':!![]})[_0xb41b('0x26')](handleEntityNotFound(_0x2dad4f,null))[_0xb41b('0x26')](function(_0x4748d8){if(_0x4748d8){var _0x56a3cf=path[_0xb41b('0x50')](config[_0xb41b('0x51')],_0xb41b('0x52'),util[_0xb41b('0x53')](_0xb41b('0x54'),path[_0xb41b('0x55')](_0x4748d8[_0xb41b('0x8')])));var _0xd81e10=fs[_0xb41b('0x56')](_0x56a3cf);var _0x35517=archiver(_0xb41b('0x57'),{'zlib':{'level':0x9}});_0x35517['on'](_0xb41b('0x58'),function(_0x510b29){if(_0x510b29[_0xb41b('0x59')]===_0xb41b('0x5a')){logger[_0xb41b('0x2b')](_0x510b29);}else{throw new db['Sequelize'][(_0xb41b('0x5b'))](_0xb41b('0x5c'));}});_0x35517['on'](_0xb41b('0x2b'),function(_0x4ecdcb){throw new db[(_0xb41b('0x5d'))]['Error']('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x35517['pipe'](_0xd81e10);_0x35517['glob'](_0xb41b('0x5e'),{'cwd':path[_0xb41b('0x50')](config[_0xb41b('0x51')],_0xb41b('0x52'),path[_0xb41b('0x5f')](_0x4748d8[_0xb41b('0x8')])),'ignore':[path[_0xb41b('0x50')](path['basename'](_0x4748d8[_0xb41b('0x8')]),'node_modules/**/*'),path[_0xb41b('0x50')](path[_0xb41b('0x55')](_0x4748d8[_0xb41b('0x8')]),_0xb41b('0x60'))],'nodir':!![]})[_0xb41b('0x61')]();_0xd81e10['on'](_0xb41b('0x62'),function(){if(!fs[_0xb41b('0x63')](_0x56a3cf)){throw new db['Sequelize'][(_0xb41b('0x5b'))](_0xb41b('0x64'));}return _0x2dad4f[_0xb41b('0x4f')](_0x56a3cf,util[_0xb41b('0x53')](_0xb41b('0x54'),path[_0xb41b('0x55')](_0x4748d8['path'])),function(_0x2d0c11){if(_0x2d0c11){throw new db[(_0xb41b('0x5d'))]['Error'](_0xb41b('0x65'));}fs[_0xb41b('0x66')](_0x56a3cf);logger[_0xb41b('0x67')](_0xb41b('0x68'));logger[_0xb41b('0x67')](_0xb41b('0x69'));});});}return null;})[_0xb41b('0x4e')](handleError(_0x2dad4f,null));};exports['upload']=function(_0x4533f0,_0x24a7da,_0x22a689){var _0x498193=path[_0xb41b('0x55')](_0x4533f0['file'][_0xb41b('0x6a')],path[_0xb41b('0x6b')](_0x4533f0[_0xb41b('0x6c')][_0xb41b('0x6a')]));var _0x39cc81=path[_0xb41b('0x50')](config[_0xb41b('0x51')],_0xb41b('0x52'),_0x4533f0[_0xb41b('0x6c')][_0xb41b('0x6a')]);var _0x517d31=path['join'](config[_0xb41b('0x51')],_0xb41b('0x52'),_0x498193);logger[_0xb41b('0x67')]('Plugin\x20upload\x20filepath:\x20%s',_0x39cc81);logger[_0xb41b('0x67')]('Plugin\x20upload\x20destination:\x20%s',_0x517d31);try{fs[_0xb41b('0x6d')](_0x39cc81,parseInt('0777',0x8));extract(_0x39cc81,{'dir':_0x517d31},function(_0x31a54c){if(_0x31a54c){logger[_0xb41b('0x2b')](_0x31a54c);handleError(_0x31a54c,!![]);};var _0x589992=fs[_0xb41b('0x6e')](_0x517d31);if(_0x589992[_0xb41b('0x3c')]>0x1){removeReferences(_0x39cc81,_0x517d31);logger[_0xb41b('0x2b')](_0xb41b('0x6f'));return _0x22a689(new Error(_0xb41b('0x6f')));}var _0x5942a2=fs['lstatSync'](path[_0xb41b('0x50')](_0x517d31,_0x589992[0x0]));if(_0x5942a2[_0xb41b('0x70')]()){removeReferences(_0x39cc81,_0x517d31);logger['error'](_0xb41b('0x6f'));return _0x22a689(new Error(_0xb41b('0x6f')));}if(_0x5942a2[_0xb41b('0x71')]()){var _0x4daadc=fs[_0xb41b('0x6e')](path['join'](_0x517d31,_0x589992[0x0]));if(_0x4daadc[_0xb41b('0x3c')]===0x0){removeReferences(_0x39cc81,_0x517d31);logger[_0xb41b('0x2b')]('Invalid\x20plugin\x20structure');return _0x22a689(new Error(_0xb41b('0x6f')));}var _0x2e4cdd=_0x4daadc['some'](function(_0x180c7f){return _0x180c7f===_0xb41b('0x72');});if(!_0x2e4cdd){return _0x22a689(new Error(_0xb41b('0x73')));}var _0x47e9f0=fs[_0xb41b('0x74')](path[_0xb41b('0x50')](_0x517d31,_0x589992[0x0],_0xb41b('0x72')));var _0x92e82c=JSON[_0xb41b('0x75')](_0x47e9f0);if(_0xb41b('0x76')==typeof _0x92e82c[_0xb41b('0x2d')]){return _0x22a689(new Error(_0xb41b('0x77')));}if(_0xb41b('0x76')==typeof _0x92e82c[_0xb41b('0x34')]){return _0x22a689(new Error(_0xb41b('0x78')));}if(_0xb41b('0x76')==typeof _0x92e82c[_0xb41b('0x79')]){return _0x22a689(new Error(_0xb41b('0x7a')));}if(_0xb41b('0x76')==typeof _0x92e82c[_0xb41b('0x7b')]){return _0x22a689(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x92e82c[_0xb41b('0x34')]===_0xb41b('0x7c')){if(_0xb41b('0x76')==typeof _0x92e82c['parameters']['views']){return _0x22a689(new Error(_0xb41b('0x7d')));}if(_0xb41b('0x76')==typeof _0x92e82c[_0xb41b('0x7b')][_0xb41b('0x7e')][_0xb41b('0x7f')]&&_0xb41b('0x76')==typeof _0x92e82c['parameters'][_0xb41b('0x7e')][_0xb41b('0x80')]){return _0x22a689(new Error(_0xb41b('0x81')));}}else if(_0x92e82c['type']===_0xb41b('0x82')){if('undefined'==typeof _0x92e82c[_0xb41b('0x7b')][_0xb41b('0x83')]){return _0x22a689(new Error('Invalid\x20manifest:\x20script\x20name\x20missing'));}if(_0xb41b('0x76')==typeof _0x92e82c[_0xb41b('0x7b')][_0xb41b('0x84')]){return _0x22a689(new Error(_0xb41b('0x85')));}}else{return _0x22a689(new Error(_0xb41b('0x86')));}var _0x32eb1b=_0x92e82c[_0xb41b('0x2d')];var _0x3ae688=_0x92e82c[_0xb41b('0x87')];var _0x25c440=_0x92e82c[_0xb41b('0x34')];var _0x56a0b9=_0x92e82c[_0xb41b('0x88')]?_0x92e82c['sidebar']:_0xb41b('0x89');var _0xf6c40b=_0x92e82c[_0xb41b('0x8a')]?_0x92e82c['icon']:_0xb41b('0x8b');var _0x5649a3='';var _0x5e2aa7='';var _0x20cc66='';var _0x4d395e='';var _0x1ccb86=_0x92e82c[_0xb41b('0x79')];if(_0x25c440===_0xb41b('0x7c')){if('undefined'!=typeof _0x92e82c[_0xb41b('0x7b')][_0xb41b('0x7e')][_0xb41b('0x7f')]){var _0x19def3=_0x92e82c[_0xb41b('0x7b')]['views'][_0xb41b('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xb41b('0x8c')](_0x19def3)){_0x5649a3=path[_0xb41b('0x50')](_0xb41b('0x8d'),_0x498193,_0x589992[0x0],_0x19def3);}else{_0x5649a3=_0x19def3;}}else{logger['info'](_0xb41b('0x8e'));}if('undefined'!=typeof _0x92e82c[_0xb41b('0x7b')][_0xb41b('0x7e')][_0xb41b('0x80')]){var _0x898d35=_0x92e82c[_0xb41b('0x7b')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0xb41b('0x8c')](_0x898d35)){_0x5e2aa7=path[_0xb41b('0x50')](_0xb41b('0x8d'),_0x498193,_0x589992[0x0],_0x898d35);}else{_0x5e2aa7=_0x898d35;}}else{logger[_0xb41b('0x67')](_0xb41b('0x8f'));}}else if(_0x25c440===_0xb41b('0x82')){_0x20cc66=_0x92e82c[_0xb41b('0x7b')][_0xb41b('0x83')];_0x4d395e=_0x92e82c[_0xb41b('0x7b')][_0xb41b('0x84')];if(_0xb41b('0x76')!=typeof _0x92e82c['parameters']['views']){if(_0xb41b('0x76')!=typeof _0x92e82c[_0xb41b('0x7b')][_0xb41b('0x7e')][_0xb41b('0x7f')]){var _0x19def3=_0x92e82c[_0xb41b('0x7b')][_0xb41b('0x7e')][_0xb41b('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0xb41b('0x8c')](_0x19def3)){_0x5649a3=path[_0xb41b('0x50')](_0xb41b('0x8d'),_0x498193,_0x589992[0x0],_0x19def3);}else{_0x5649a3=_0x19def3;}}if(_0xb41b('0x76')!=typeof _0x92e82c[_0xb41b('0x7b')][_0xb41b('0x7e')][_0xb41b('0x80')]){var _0x898d35=_0x92e82c['parameters'][_0xb41b('0x7e')][_0xb41b('0x80')];if(!/^(f|ht)tps?:\/\//i[_0xb41b('0x8c')](_0x898d35)){_0x5e2aa7=path[_0xb41b('0x50')](_0xb41b('0x8d'),_0x498193,_0x589992[0x0],_0x898d35);}else{_0x5e2aa7=_0x898d35;}}}}var _0x4785e8={'name':_0x32eb1b,'description':_0x3ae688,'path':path[_0xb41b('0x50')](_0x498193,_0x589992[0x0]),'type':_0x25c440,'sidebar':_0x56a0b9,'icon':_0xf6c40b,'adminUrl':_0x5649a3,'agentUrl':_0x5e2aa7,'scriptName':_0x20cc66,'scriptPath':_0x4d395e,'version':_0x1ccb86};removeReferences(_0x39cc81,null);return db[_0xb41b('0x31')][_0xb41b('0x90')](_0x4785e8)[_0xb41b('0x26')](function(_0x8d80ca){var _0x5b2d5e={'role':_0x4533f0['body'][_0xb41b('0x91')],'userProfileId':_0x4533f0[_0xb41b('0x92')][_0xb41b('0x93')]};if(!_0x5b2d5e)throw new Error(_0xb41b('0x94'));if(_0x5b2d5e['role']==='user'){var _0x5440cd=_0x8d80ca[_0xb41b('0x27')]({'plain':!![]});return db['UserProfileSection'][_0xb41b('0x4d')]({'where':{'name':_0xb41b('0x95'),'userProfileId':_0x5b2d5e[_0xb41b('0x93')]},'raw':!![]})[_0xb41b('0x26')](function(_0x2dfc21){if(_0x2dfc21&&_0x2dfc21['autoAssociation']===0x0){return db['UserProfileResource'][_0xb41b('0x90')]({'name':_0x5440cd[_0xb41b('0x2d')],'resourceId':_0x5440cd['id'],'type':_0x2dfc21['name'],'sectionId':_0x2dfc21['id']},{})[_0xb41b('0x26')](function(){return _0x8d80ca;});}else{return _0x8d80ca;}})[_0xb41b('0x4e')](function(_0x5f082a){logger[_0xb41b('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5f082a);throw _0x5f082a;});}return _0x8d80ca;})['then'](respondWithResult(_0x24a7da,null))[_0xb41b('0x4e')](handleError(_0x24a7da,null));}});}catch(_0x279c37){_0x24a7da[_0xb41b('0x1d')](0x1f4)[_0xb41b('0x2e')](_0x279c37);}};function removeReferences(_0x29067a,_0x258105){try{if(_0x29067a){fs['unlinkSync'](_0x29067a);logger[_0xb41b('0x67')](_0xb41b('0x96'));}if(_0x258105){rimraf(_0x258105,function(){});logger[_0xb41b('0x67')](_0xb41b('0x97'));}}catch(_0x6a8fc4){logger[_0xb41b('0x2b')](_0x6a8fc4);}}exports[_0xb41b('0x98')]=function(_0x25f34d,_0x53f871,_0x2c22d1){return db['Plugin'][_0xb41b('0x4d')]({'where':{'id':_0x25f34d[_0xb41b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x53f871,null))['then'](saveUpdates(_0x25f34d[_0xb41b('0x92')],null))['then'](respondWithResult(_0x53f871,null))[_0xb41b('0x4e')](handleError(_0x53f871,null));};exports[_0xb41b('0x99')]=function(_0x3b6d67,_0x10b734,_0x415b69){return db[_0xb41b('0x31')][_0xb41b('0x4d')]({'where':{'id':_0x3b6d67[_0xb41b('0x4b')]['id']}})[_0xb41b('0x26')](function(_0x1810a0){if(_0x1810a0){return _0x1810a0[_0xb41b('0x29')]();}})['then'](function(_0x3f9304){rimraf(path[_0xb41b('0x50')](config[_0xb41b('0x51')],_0xb41b('0x52'),path[_0xb41b('0x5f')](_0x3f9304[_0xb41b('0x8')])),function(){});return _0x3f9304;})[_0xb41b('0x26')](handleEntityNotFound(_0x10b734,null))['then'](respondWithStatusCode(_0x10b734,null))[_0xb41b('0x4e')](handleError(_0x10b734,null));};exports[_0xb41b('0x9a')]=function(_0x2163a7,_0x2daaf4,_0x4c8cf1){return BPromise[_0xb41b('0x9b')]()['then'](function(){if(!_0x2163a7['query'][_0xb41b('0x8')]){throw new Error(_0xb41b('0x9c'));}if(!_0x2163a7[_0xb41b('0x37')][_0xb41b('0x9d')]){throw new Error(_0xb41b('0x9e'));}var _0x2055e7=_0x2163a7[_0xb41b('0x37')][_0xb41b('0x9f')]?_0x2163a7[_0xb41b('0x37')][_0xb41b('0x9f')]+':'+_0x2163a7[_0xb41b('0x37')][_0xb41b('0x9d')]:_0xb41b('0xa0')+_0x2163a7['query']['port'];var _0x4c7d15=_0x2163a7[_0xb41b('0x37')][_0xb41b('0x1e')]?_0x2163a7[_0xb41b('0x37')][_0xb41b('0x1e')]:!![];var _0x510296=_0x2163a7['query']['encoding']?_0x2163a7['query'][_0xb41b('0xa1')]:null;var _0x3512d3={'method':_0x2163a7[_0xb41b('0xa2')],'uri':util[_0xb41b('0x53')](_0xb41b('0xa3'),_0x2055e7,_0x2163a7[_0xb41b('0x37')][_0xb41b('0x8')]),'json':_0x4c7d15,'resolveWithFullResponse':!![],'encoding':_0x510296,'qs':_0x2163a7['query']};if(_0x2163a7[_0xb41b('0xa4')]){_0x3512d3[_0xb41b('0xa4')]=_0x2163a7[_0xb41b('0xa4')];if(_0x3512d3[_0xb41b('0xa4')]['content-length']){delete _0x3512d3[_0xb41b('0xa4')][_0xb41b('0xa5')];}}if(_0x3512d3[_0xb41b('0xa4')][_0xb41b('0xa6')]){delete _0x3512d3[_0xb41b('0xa4')][_0xb41b('0xa6')];}return rp(_0x3512d3);})[_0xb41b('0x26')](function(_0x1c0ba4){if(_0x1c0ba4){_0x2daaf4[_0xb41b('0x21')](_0x1c0ba4['headers']);logger[_0xb41b('0x67')](_0x1c0ba4[_0xb41b('0x92')]);if(_[_0xb41b('0xa7')](_0x2163a7[_0xb41b('0x37')][_0xb41b('0x8')],_0xb41b('0x4f'))&&_0x1c0ba4[_0xb41b('0xa8')]==0x1f4){return _0x2daaf4[_0xb41b('0xa9')](_0x1c0ba4[_0xb41b('0xa8')]);}else{return _0x2daaf4[_0xb41b('0x1d')](_0x1c0ba4['statusCode'])['send'](_0x1c0ba4['body']);}}else{return _0x2daaf4['sendStatus'](0xc8);}})[_0xb41b('0x4e')](handleError(_0x2daaf4,null));};exports[_0xb41b('0xaa')]=function(_0x5ed1c0,_0x53ed8a,_0x5c06b7){return BPromise[_0xb41b('0x9b')]()['then'](function(){if(!_0x5ed1c0['query']['path']){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x5ed1c0[_0xb41b('0x37')][_0xb41b('0x9d')]){throw new Error(_0xb41b('0x9e'));}var _0x347472=_0x5ed1c0['query'][_0xb41b('0x9f')]?_0x5ed1c0[_0xb41b('0x37')][_0xb41b('0x9f')]+':'+_0x5ed1c0[_0xb41b('0x37')][_0xb41b('0x9d')]:'http://localhost:'+_0x5ed1c0[_0xb41b('0x37')]['port'];var _0x4d46da=_0x5ed1c0['query'][_0xb41b('0x1e')]?_0x5ed1c0[_0xb41b('0x37')][_0xb41b('0x1e')]:!![];var _0x37cfad=_0x5ed1c0[_0xb41b('0x37')]['encoding']?_0x5ed1c0[_0xb41b('0x37')][_0xb41b('0xa1')]:null;var _0x598411={'method':_0x5ed1c0['method'],'uri':util[_0xb41b('0x53')](_0xb41b('0xa3'),_0x347472,_0x5ed1c0[_0xb41b('0x37')][_0xb41b('0x8')]),'json':_0x4d46da,'resolveWithFullResponse':!![],'encoding':_0x37cfad,'body':_0x5ed1c0[_0xb41b('0x92')]};if(_0x5ed1c0['headers']){_0x598411[_0xb41b('0xa4')]=_0x5ed1c0[_0xb41b('0xa4')];if(_0x598411[_0xb41b('0xa4')][_0xb41b('0xa5')]){delete _0x598411[_0xb41b('0xa4')]['content-length'];}}if(_0x598411[_0xb41b('0xa4')][_0xb41b('0xa6')]){delete _0x598411[_0xb41b('0xa4')][_0xb41b('0xa6')];}return rp(_0x598411);})[_0xb41b('0x26')](function(_0x3972c2){if(_0x3972c2){_0x53ed8a[_0xb41b('0x21')](_0x3972c2[_0xb41b('0xa4')]);logger[_0xb41b('0x67')](_0x3972c2[_0xb41b('0x92')]);return _0x53ed8a[_0xb41b('0x1d')](_0x3972c2[_0xb41b('0xa8')])[_0xb41b('0x2e')](_0x3972c2[_0xb41b('0x92')]);}else{return _0x53ed8a[_0xb41b('0xa9')](0xc8);}})[_0xb41b('0x4e')](handleError(_0x53ed8a,null));}; \ No newline at end of file +var _0x5ccc=['Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','version','admin','plugins','Warning:\x20admin\x20view\x20not\x20specified','test','Warning:\x20agent\x20view\x20not\x20specified','scriptName','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Extracted\x20folder\x20removed','destroy','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','headers','content-length','content-type','endsWith','statusCode','webhookPost','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','localhost','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','get','Plugins','UserProfileResource','then','error','stack','name','send','index','map','Plugin','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','intersection','length','find','download','join','root','server/files/plugins','format','%s.zip','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','pipe','glob','**/*','dirname','basename','attachments/**/*','finalize','close','Plugin\x20not\x20found','Error\x20while\x20downloading\x20the\x20plugin','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','manifest.json','Plugin\x20manifest\x20missing','readFileSync','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0x5ccc,0x192));var _0xc5cc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5ccc[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xc5cc('0x0'));var emlformat=require(_0xc5cc('0x1'));var rimraf=require(_0xc5cc('0x2'));var zipdir=require(_0xc5cc('0x3'));var jsonpatch=require(_0xc5cc('0x4'));var rp=require('request-promise');var moment=require(_0xc5cc('0x5'));var BPromise=require(_0xc5cc('0x6'));var Mustache=require(_0xc5cc('0x7'));var util=require(_0xc5cc('0x8'));var path=require(_0xc5cc('0x9'));var sox=require(_0xc5cc('0xa'));var csv=require(_0xc5cc('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc5cc('0xc'));var squel=require(_0xc5cc('0xd'));var crypto=require('crypto');var jsforce=require(_0xc5cc('0xe'));var deskjs=require(_0xc5cc('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc5cc('0x10'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0xc5cc('0x2'));var archiver=require(_0xc5cc('0x11'));var Redis=require(_0xc5cc('0x12'));var authService=require(_0xc5cc('0x13'));var qs=require(_0xc5cc('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc5cc('0x15'));var logger=require('../../config/logger')(_0xc5cc('0x16'));var utils=require('../../config/utils');var config=require(_0xc5cc('0x17'));var db=require(_0xc5cc('0x18'))['db'];config[_0xc5cc('0x19')]=_[_0xc5cc('0x1a')](config[_0xc5cc('0x19')],{'host':_0xc5cc('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc5cc('0x19')]));require('./plugin.socket')['register'](socket);function respondWithStatusCode(_0x281c84,_0x995d25){_0x995d25=_0x995d25||0xcc;return function(_0x46cabb){if(_0x46cabb){return _0x281c84[_0xc5cc('0x1c')](_0x995d25);}return _0x281c84[_0xc5cc('0x1d')](_0x995d25)[_0xc5cc('0x1e')]();};}function respondWithResult(_0x3a9d2c,_0x51c9f5){_0x51c9f5=_0x51c9f5||0xc8;return function(_0x3c16e7){if(_0x3c16e7){return _0x3a9d2c[_0xc5cc('0x1d')](_0x51c9f5)[_0xc5cc('0x1f')](_0x3c16e7);}};}function respondWithFilteredResult(_0x3f66e3,_0x4cff90){return function(_0x5af434){if(_0x5af434){var _0x372efc=_0x5af434[_0xc5cc('0x20')],_0x545f57=_0x4cff90[_0xc5cc('0x21')],_0x5d2625=_0x4cff90[_0xc5cc('0x21')]+_0x4cff90['limit'],_0x44eb59;if(_0x5d2625>=_0x372efc){_0x5d2625=_0x372efc;_0x44eb59=0xc8;}else{_0x44eb59=0xce;}_0x3f66e3[_0xc5cc('0x1d')](_0x44eb59);return _0x3f66e3[_0xc5cc('0x22')]('Content-Range',_0x545f57+'-'+_0x5d2625+'/'+_0x372efc)['json'](_0x5af434);}return null;};}function patchUpdates(_0x9074f){return function(_0xa16f09){try{jsonpatch[_0xc5cc('0x23')](_0xa16f09,_0x9074f,!![]);}catch(_0x2ca560){return BPromise[_0xc5cc('0x24')](_0x2ca560);}return _0xa16f09[_0xc5cc('0x25')]();};}function saveUpdates(_0x39d807,_0xd11b43){return function(_0x20a0b7){if(_0x20a0b7){return _0x20a0b7[_0xc5cc('0x26')](_0x39d807)['then'](function(_0x54bea4){return _0x54bea4;});}return null;};}function removeEntity(_0x403ec6,_0x3491c8){return function(_0x333a69){if(_0x333a69){return _0x333a69['destroy']()['then'](function(){var _0x6e9eb4=_0x333a69[_0xc5cc('0x27')]({'plain':!![]});var _0x28fc46=_0xc5cc('0x28');return db[_0xc5cc('0x29')]['destroy']({'where':{'type':_0x28fc46,'resourceId':_0x6e9eb4['id']}})[_0xc5cc('0x2a')](function(){return _0x333a69;});})[_0xc5cc('0x2a')](function(){_0x403ec6[_0xc5cc('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x453767,_0x5775fb){return function(_0x20f91d){if(!_0x20f91d){_0x453767[_0xc5cc('0x1c')](0x194);}return _0x20f91d;};}function handleError(_0x3d25ef,_0x31acf3){_0x31acf3=_0x31acf3||0x1f4;return function(_0x5195b2){logger[_0xc5cc('0x2b')](_0x5195b2[_0xc5cc('0x2c')]);if(_0x5195b2[_0xc5cc('0x2d')]){delete _0x5195b2['name'];}_0x3d25ef[_0xc5cc('0x1d')](_0x31acf3)[_0xc5cc('0x2e')](_0x5195b2);};}exports[_0xc5cc('0x2f')]=function(_0x1f57f4,_0x22ee9b){var _0x113313={},_0x354620={},_0x325f18={'count':0x0,'rows':[]};var _0x2659d0=_[_0xc5cc('0x30')](db[_0xc5cc('0x31')][_0xc5cc('0x32')],function(_0x38d1ad){return{'name':_0x38d1ad[_0xc5cc('0x33')],'type':_0x38d1ad[_0xc5cc('0x34')][_0xc5cc('0x35')]};});_0x354620[_0xc5cc('0x36')]=_['map'](_0x2659d0,_0xc5cc('0x2d'));_0x354620['query']=_[_0xc5cc('0x37')](_0x1f57f4[_0xc5cc('0x38')]);_0x354620[_0xc5cc('0x39')]=_['intersection'](_0x354620[_0xc5cc('0x36')],_0x354620[_0xc5cc('0x38')]);_0x113313[_0xc5cc('0x3a')]=_['intersection'](_0x354620['model'],qs[_0xc5cc('0x3b')](_0x1f57f4[_0xc5cc('0x38')]['fields']));_0x113313[_0xc5cc('0x3a')]=_0x113313['attributes']['length']?_0x113313[_0xc5cc('0x3a')]:_0x354620['model'];if(!_0x1f57f4['query'][_0xc5cc('0x3c')](_0xc5cc('0x3d'))){_0x113313[_0xc5cc('0x3e')]=qs['limit'](_0x1f57f4[_0xc5cc('0x38')][_0xc5cc('0x3e')]);_0x113313['offset']=qs['offset'](_0x1f57f4[_0xc5cc('0x38')][_0xc5cc('0x21')]);}_0x113313[_0xc5cc('0x3f')]=qs['sort'](_0x1f57f4[_0xc5cc('0x38')][_0xc5cc('0x40')]);_0x113313[_0xc5cc('0x41')]=qs['filters'](_[_0xc5cc('0x42')](_0x1f57f4[_0xc5cc('0x38')],_0x354620[_0xc5cc('0x39')]));if(_0x1f57f4[_0xc5cc('0x38')]['filter']){_0x113313[_0xc5cc('0x41')]=_[_0xc5cc('0x43')](_0x113313[_0xc5cc('0x41')],{'$or':_['map'](_0x2659d0,function(_0x1e90b8){if(_0x1e90b8[_0xc5cc('0x34')]!==_0xc5cc('0x44')){var _0x366fa5={};_0x366fa5[_0x1e90b8[_0xc5cc('0x2d')]]={'$like':'%'+_0x1f57f4[_0xc5cc('0x38')][_0xc5cc('0x45')]+'%'};return _0x366fa5;}})});}_0x113313=_[_0xc5cc('0x43')]({},_0x113313,_0x1f57f4[_0xc5cc('0x46')]);var _0x2461e5={'where':_0x113313['where']};return db['Plugin'][_0xc5cc('0x20')](_0x2461e5)['then'](function(_0x4165e2){_0x325f18[_0xc5cc('0x20')]=_0x4165e2;if(_0x1f57f4['query'][_0xc5cc('0x47')]){_0x113313['include']=[{'all':!![]}];}return db[_0xc5cc('0x31')][_0xc5cc('0x48')](_0x113313);})[_0xc5cc('0x2a')](function(_0x33a2d8){_0x325f18[_0xc5cc('0x49')]=_0x33a2d8;return _0x325f18;})[_0xc5cc('0x2a')](respondWithFilteredResult(_0x22ee9b,_0x113313))[_0xc5cc('0x4a')](handleError(_0x22ee9b,null));};exports[_0xc5cc('0x4b')]=function(_0x1f39f5,_0xf4dfc1){var _0x3cddff={'raw':!![],'where':{'id':_0x1f39f5[_0xc5cc('0x4c')]['id']}},_0x3e05df={};_0x3e05df[_0xc5cc('0x36')]=_[_0xc5cc('0x37')](db['Plugin'][_0xc5cc('0x32')]);_0x3e05df[_0xc5cc('0x38')]=_[_0xc5cc('0x37')](_0x1f39f5[_0xc5cc('0x38')]);_0x3e05df[_0xc5cc('0x39')]=_[_0xc5cc('0x4d')](_0x3e05df['model'],_0x3e05df[_0xc5cc('0x38')]);_0x3cddff['attributes']=_['intersection'](_0x3e05df[_0xc5cc('0x36')],qs[_0xc5cc('0x3b')](_0x1f39f5[_0xc5cc('0x38')]['fields']));_0x3cddff['attributes']=_0x3cddff[_0xc5cc('0x3a')][_0xc5cc('0x4e')]?_0x3cddff[_0xc5cc('0x3a')]:_0x3e05df[_0xc5cc('0x36')];if(_0x1f39f5[_0xc5cc('0x38')][_0xc5cc('0x47')]){_0x3cddff['include']=[{'all':!![]}];}_0x3cddff=_[_0xc5cc('0x43')]({},_0x3cddff,_0x1f39f5[_0xc5cc('0x46')]);return db['Plugin'][_0xc5cc('0x4f')](_0x3cddff)[_0xc5cc('0x2a')](handleEntityNotFound(_0xf4dfc1,null))[_0xc5cc('0x2a')](respondWithResult(_0xf4dfc1,null))[_0xc5cc('0x4a')](handleError(_0xf4dfc1,null));};exports[_0xc5cc('0x50')]=function(_0x3744ed,_0x5c0e14,_0x111d4d){return db[_0xc5cc('0x31')][_0xc5cc('0x4f')]({'where':{'id':_0x3744ed['params']['id']},'attributes':[_0xc5cc('0x2d'),_0xc5cc('0x9')],'raw':!![]})[_0xc5cc('0x2a')](handleEntityNotFound(_0x5c0e14,null))[_0xc5cc('0x2a')](function(_0x3dc2e3){if(_0x3dc2e3){var _0x39ed4f=path[_0xc5cc('0x51')](config[_0xc5cc('0x52')],_0xc5cc('0x53'),util[_0xc5cc('0x54')](_0xc5cc('0x55'),path['basename'](_0x3dc2e3['path'])));var _0x50cced=fs[_0xc5cc('0x56')](_0x39ed4f);var _0x483938=archiver(_0xc5cc('0x57'),{'zlib':{'level':0x9}});_0x483938['on'](_0xc5cc('0x58'),function(_0x2fedf4){if(_0x2fedf4[_0xc5cc('0x59')]===_0xc5cc('0x5a')){logger[_0xc5cc('0x2b')](_0x2fedf4);}else{throw new db[(_0xc5cc('0x5b'))]['Error'](_0xc5cc('0x5c'));}});_0x483938['on'](_0xc5cc('0x2b'),function(_0x74bdf1){throw new db[(_0xc5cc('0x5b'))][(_0xc5cc('0x5d'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');});_0x483938[_0xc5cc('0x5e')](_0x50cced);_0x483938[_0xc5cc('0x5f')](_0xc5cc('0x60'),{'cwd':path[_0xc5cc('0x51')](config[_0xc5cc('0x52')],_0xc5cc('0x53'),path[_0xc5cc('0x61')](_0x3dc2e3[_0xc5cc('0x9')])),'ignore':[path['join'](path[_0xc5cc('0x62')](_0x3dc2e3['path']),'node_modules/**/*'),path['join'](path[_0xc5cc('0x62')](_0x3dc2e3[_0xc5cc('0x9')]),_0xc5cc('0x63'))],'nodir':!![]})[_0xc5cc('0x64')]();_0x50cced['on'](_0xc5cc('0x65'),function(){if(!fs['existsSync'](_0x39ed4f)){throw new db[(_0xc5cc('0x5b'))][(_0xc5cc('0x5d'))](_0xc5cc('0x66'));}return _0x5c0e14[_0xc5cc('0x50')](_0x39ed4f,util[_0xc5cc('0x54')](_0xc5cc('0x55'),path[_0xc5cc('0x62')](_0x3dc2e3[_0xc5cc('0x9')])),function(_0x3b153d){if(_0x3b153d){throw new db[(_0xc5cc('0x5b'))][(_0xc5cc('0x5d'))](_0xc5cc('0x67'));}fs['unlinkSync'](_0x39ed4f);logger[_0xc5cc('0x68')](_0xc5cc('0x69'));logger[_0xc5cc('0x68')](_0xc5cc('0x6a'));});});}return null;})[_0xc5cc('0x4a')](handleError(_0x5c0e14,null));};exports[_0xc5cc('0x6b')]=function(_0x3849f4,_0x2c7739,_0x52c331){var _0x19697c=path[_0xc5cc('0x62')](_0x3849f4[_0xc5cc('0x6c')][_0xc5cc('0x6d')],path[_0xc5cc('0x6e')](_0x3849f4[_0xc5cc('0x6c')][_0xc5cc('0x6d')]));var _0x47265b=path[_0xc5cc('0x51')](config[_0xc5cc('0x52')],_0xc5cc('0x53'),_0x3849f4[_0xc5cc('0x6c')][_0xc5cc('0x6d')]);var _0x16ed10=path[_0xc5cc('0x51')](config[_0xc5cc('0x52')],'server/files/plugins',_0x19697c);logger[_0xc5cc('0x68')](_0xc5cc('0x6f'),_0x47265b);logger[_0xc5cc('0x68')](_0xc5cc('0x70'),_0x16ed10);try{fs[_0xc5cc('0x71')](_0x47265b,parseInt('0777',0x8));extract(_0x47265b,{'dir':_0x16ed10},function(_0x177f44){if(_0x177f44){logger[_0xc5cc('0x2b')](_0x177f44);handleError(_0x177f44,!![]);};var _0x2111b9=fs['readdirSync'](_0x16ed10);if(_0x2111b9[_0xc5cc('0x4e')]>0x1){removeReferences(_0x47265b,_0x16ed10);logger['error'](_0xc5cc('0x72'));return _0x52c331(new Error(_0xc5cc('0x72')));}var _0x1e9273=fs[_0xc5cc('0x73')](path[_0xc5cc('0x51')](_0x16ed10,_0x2111b9[0x0]));if(_0x1e9273[_0xc5cc('0x74')]()){removeReferences(_0x47265b,_0x16ed10);logger[_0xc5cc('0x2b')](_0xc5cc('0x72'));return _0x52c331(new Error('Invalid\x20plugin\x20structure'));}if(_0x1e9273[_0xc5cc('0x75')]()){var _0x24fd55=fs[_0xc5cc('0x76')](path['join'](_0x16ed10,_0x2111b9[0x0]));if(_0x24fd55[_0xc5cc('0x4e')]===0x0){removeReferences(_0x47265b,_0x16ed10);logger['error'](_0xc5cc('0x72'));return _0x52c331(new Error(_0xc5cc('0x72')));}var _0x4a66a1=_0x24fd55[_0xc5cc('0x77')](function(_0x5685b6){return _0x5685b6===_0xc5cc('0x78');});if(!_0x4a66a1){return _0x52c331(new Error(_0xc5cc('0x79')));}var _0x9c7354=fs[_0xc5cc('0x7a')](path['join'](_0x16ed10,_0x2111b9[0x0],_0xc5cc('0x78')));var _0x2d9246=JSON[_0xc5cc('0x7b')](_0x9c7354);if(_0xc5cc('0x7c')==typeof _0x2d9246['name']){return _0x52c331(new Error(_0xc5cc('0x7d')));}if('undefined'==typeof _0x2d9246[_0xc5cc('0x34')]){return _0x52c331(new Error(_0xc5cc('0x7e')));}if('undefined'==typeof _0x2d9246['version']){return _0x52c331(new Error(_0xc5cc('0x7f')));}if(_0xc5cc('0x7c')==typeof _0x2d9246[_0xc5cc('0x80')]){return _0x52c331(new Error(_0xc5cc('0x81')));}if(_0x2d9246['type']===_0xc5cc('0x82')){if(_0xc5cc('0x7c')==typeof _0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x83')]){return _0x52c331(new Error(_0xc5cc('0x84')));}if(_0xc5cc('0x7c')==typeof _0x2d9246['parameters'][_0xc5cc('0x83')]['admin']&&_0xc5cc('0x7c')==typeof _0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x83')][_0xc5cc('0x85')]){return _0x52c331(new Error(_0xc5cc('0x86')));}}else if(_0x2d9246['type']===_0xc5cc('0x87')){if(_0xc5cc('0x7c')==typeof _0x2d9246['parameters']['scriptName']){return _0x52c331(new Error(_0xc5cc('0x88')));}if(_0xc5cc('0x7c')==typeof _0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x89')]){return _0x52c331(new Error(_0xc5cc('0x8a')));}}else{return _0x52c331(new Error(_0xc5cc('0x8b')));}var _0x1aa5fd=_0x2d9246[_0xc5cc('0x2d')];var _0x212acb=_0x2d9246[_0xc5cc('0x8c')];var _0x55299d=_0x2d9246[_0xc5cc('0x34')];var _0xeda85f=_0x2d9246[_0xc5cc('0x8d')]?_0x2d9246['sidebar']:_0xc5cc('0x8e');var _0x57fc04=_0x2d9246[_0xc5cc('0x8f')]?_0x2d9246[_0xc5cc('0x8f')]:'icon-apps';var _0x56c102='';var _0x2203ec='';var _0x50ca71='';var _0x5db810='';var _0x1f86c7=_0x2d9246[_0xc5cc('0x90')];if(_0x55299d===_0xc5cc('0x82')){if(_0xc5cc('0x7c')!=typeof _0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x83')]['admin']){var _0x47d0a7=_0x2d9246['parameters']['views'][_0xc5cc('0x91')];if(!/^(f|ht)tps?:\/\//i['test'](_0x47d0a7)){_0x56c102=path[_0xc5cc('0x51')](_0xc5cc('0x92'),_0x19697c,_0x2111b9[0x0],_0x47d0a7);}else{_0x56c102=_0x47d0a7;}}else{logger['info'](_0xc5cc('0x93'));}if(_0xc5cc('0x7c')!=typeof _0x2d9246['parameters'][_0xc5cc('0x83')]['agent']){var _0x2a3117=_0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x83')][_0xc5cc('0x85')];if(!/^(f|ht)tps?:\/\//i[_0xc5cc('0x94')](_0x2a3117)){_0x2203ec=path['join']('plugins',_0x19697c,_0x2111b9[0x0],_0x2a3117);}else{_0x2203ec=_0x2a3117;}}else{logger[_0xc5cc('0x68')](_0xc5cc('0x95'));}}else if(_0x55299d==='script'){_0x50ca71=_0x2d9246['parameters'][_0xc5cc('0x96')];_0x5db810=_0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x89')];if(_0xc5cc('0x7c')!=typeof _0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x83')]){if(_0xc5cc('0x7c')!=typeof _0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x83')][_0xc5cc('0x91')]){var _0x47d0a7=_0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x83')][_0xc5cc('0x91')];if(!/^(f|ht)tps?:\/\//i['test'](_0x47d0a7)){_0x56c102=path[_0xc5cc('0x51')](_0xc5cc('0x92'),_0x19697c,_0x2111b9[0x0],_0x47d0a7);}else{_0x56c102=_0x47d0a7;}}if(_0xc5cc('0x7c')!=typeof _0x2d9246['parameters']['views'][_0xc5cc('0x85')]){var _0x2a3117=_0x2d9246[_0xc5cc('0x80')][_0xc5cc('0x83')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0xc5cc('0x94')](_0x2a3117)){_0x2203ec=path[_0xc5cc('0x51')](_0xc5cc('0x92'),_0x19697c,_0x2111b9[0x0],_0x2a3117);}else{_0x2203ec=_0x2a3117;}}}}var _0x19f44a={'name':_0x1aa5fd,'description':_0x212acb,'path':path[_0xc5cc('0x51')](_0x19697c,_0x2111b9[0x0]),'type':_0x55299d,'sidebar':_0xeda85f,'icon':_0x57fc04,'adminUrl':_0x56c102,'agentUrl':_0x2203ec,'scriptName':_0x50ca71,'scriptPath':_0x5db810,'version':_0x1f86c7};removeReferences(_0x47265b,null);return db[_0xc5cc('0x31')][_0xc5cc('0x97')](_0x19f44a)[_0xc5cc('0x2a')](function(_0x1ebb74){var _0xfb91d1={'role':_0x3849f4[_0xc5cc('0x98')][_0xc5cc('0x99')],'userProfileId':_0x3849f4[_0xc5cc('0x98')][_0xc5cc('0x9a')]};if(!_0xfb91d1)throw new Error(_0xc5cc('0x9b'));if(_0xfb91d1[_0xc5cc('0x99')]===_0xc5cc('0x9c')){var _0x3bf724=_0x1ebb74[_0xc5cc('0x27')]({'plain':!![]});return db[_0xc5cc('0x9d')][_0xc5cc('0x4f')]({'where':{'name':'Plugins','userProfileId':_0xfb91d1[_0xc5cc('0x9a')]},'raw':!![]})[_0xc5cc('0x2a')](function(_0x381164){if(_0x381164&&_0x381164[_0xc5cc('0x9e')]===0x0){return db[_0xc5cc('0x29')][_0xc5cc('0x97')]({'name':_0x3bf724[_0xc5cc('0x2d')],'resourceId':_0x3bf724['id'],'type':_0x381164[_0xc5cc('0x2d')],'sectionId':_0x381164['id']},{})[_0xc5cc('0x2a')](function(){return _0x1ebb74;});}else{return _0x1ebb74;}})[_0xc5cc('0x4a')](function(_0x2bf97f){logger[_0xc5cc('0x2b')](_0xc5cc('0x9f'),_0x2bf97f);throw _0x2bf97f;});}return _0x1ebb74;})[_0xc5cc('0x2a')](respondWithResult(_0x2c7739,null))[_0xc5cc('0x4a')](handleError(_0x2c7739,null));}});}catch(_0x34d161){_0x2c7739[_0xc5cc('0x1d')](0x1f4)[_0xc5cc('0x2e')](_0x34d161);}};function removeReferences(_0x5dc788,_0x1ae49a){try{if(_0x5dc788){fs[_0xc5cc('0xa0')](_0x5dc788);logger['info']('Zip\x20archive\x20removed');}if(_0x1ae49a){rimraf(_0x1ae49a,function(){});logger[_0xc5cc('0x68')](_0xc5cc('0xa1'));}}catch(_0x3032ad){logger['error'](_0x3032ad);}}exports['update']=function(_0x21cdaa,_0x1adcae,_0x137472){return db['Plugin'][_0xc5cc('0x4f')]({'where':{'id':_0x21cdaa[_0xc5cc('0x4c')]['id']}})[_0xc5cc('0x2a')](handleEntityNotFound(_0x1adcae,null))[_0xc5cc('0x2a')](saveUpdates(_0x21cdaa[_0xc5cc('0x98')],null))[_0xc5cc('0x2a')](respondWithResult(_0x1adcae,null))['catch'](handleError(_0x1adcae,null));};exports['delete']=function(_0x41d6f6,_0x2a0be0,_0xa9b859){return db[_0xc5cc('0x31')][_0xc5cc('0x4f')]({'where':{'id':_0x41d6f6[_0xc5cc('0x4c')]['id']}})['then'](function(_0x4698a4){if(_0x4698a4){return _0x4698a4[_0xc5cc('0xa2')]();}})[_0xc5cc('0x2a')](function(_0x1b28bc){rimraf(path[_0xc5cc('0x51')](config['root'],_0xc5cc('0x53'),path['dirname'](_0x1b28bc['path'])),function(){});return _0x1b28bc;})[_0xc5cc('0x2a')](handleEntityNotFound(_0x2a0be0,null))[_0xc5cc('0x2a')](respondWithStatusCode(_0x2a0be0,null))[_0xc5cc('0x4a')](handleError(_0x2a0be0,null));};exports[_0xc5cc('0xa3')]=function(_0x2a6484,_0x344657,_0x445ec1){return BPromise[_0xc5cc('0xa4')]()[_0xc5cc('0x2a')](function(){if(!_0x2a6484['query']['path']){throw new Error(_0xc5cc('0xa5'));}if(!_0x2a6484[_0xc5cc('0x38')][_0xc5cc('0xa6')]){throw new Error(_0xc5cc('0xa7'));}var _0x509ef6=_0x2a6484['query'][_0xc5cc('0xa8')]?_0x2a6484[_0xc5cc('0x38')]['hostname']+':'+_0x2a6484[_0xc5cc('0x38')][_0xc5cc('0xa6')]:_0xc5cc('0xa9')+_0x2a6484[_0xc5cc('0x38')][_0xc5cc('0xa6')];var _0x347acd=_0x2a6484['query'][_0xc5cc('0x1f')]?_0x2a6484[_0xc5cc('0x38')][_0xc5cc('0x1f')]:!![];var _0x539224=_0x2a6484[_0xc5cc('0x38')][_0xc5cc('0xaa')]?_0x2a6484[_0xc5cc('0x38')][_0xc5cc('0xaa')]:null;var _0x54f03c={'method':_0x2a6484[_0xc5cc('0xab')],'uri':util['format']('%s%s',_0x509ef6,_0x2a6484[_0xc5cc('0x38')]['path']),'json':_0x347acd,'resolveWithFullResponse':!![],'encoding':_0x539224,'qs':_0x2a6484[_0xc5cc('0x38')]};if(_0x2a6484[_0xc5cc('0xac')]){_0x54f03c[_0xc5cc('0xac')]=_0x2a6484['headers'];if(_0x54f03c[_0xc5cc('0xac')][_0xc5cc('0xad')]){delete _0x54f03c[_0xc5cc('0xac')][_0xc5cc('0xad')];}}if(_0x54f03c[_0xc5cc('0xac')]['content-type']){delete _0x54f03c[_0xc5cc('0xac')][_0xc5cc('0xae')];}return rp(_0x54f03c);})[_0xc5cc('0x2a')](function(_0xb55997){if(_0xb55997){_0x344657['set'](_0xb55997[_0xc5cc('0xac')]);logger[_0xc5cc('0x68')](_0xb55997[_0xc5cc('0x98')]);if(_[_0xc5cc('0xaf')](_0x2a6484[_0xc5cc('0x38')][_0xc5cc('0x9')],'download')&&_0xb55997[_0xc5cc('0xb0')]==0x1f4){return _0x344657[_0xc5cc('0x1c')](_0xb55997[_0xc5cc('0xb0')]);}else{return _0x344657[_0xc5cc('0x1d')](_0xb55997[_0xc5cc('0xb0')])[_0xc5cc('0x2e')](_0xb55997[_0xc5cc('0x98')]);}}else{return _0x344657[_0xc5cc('0x1c')](0xc8);}})['catch'](handleError(_0x344657,null));};exports[_0xc5cc('0xb1')]=function(_0x14ad51,_0x47ce0f,_0x54a4ad){return BPromise[_0xc5cc('0xa4')]()[_0xc5cc('0x2a')](function(){if(!_0x14ad51[_0xc5cc('0x38')][_0xc5cc('0x9')]){throw new Error(_0xc5cc('0xa5'));}if(!_0x14ad51[_0xc5cc('0x38')][_0xc5cc('0xa6')]){throw new Error(_0xc5cc('0xa7'));}var _0x1f3ac3=_0x14ad51[_0xc5cc('0x38')][_0xc5cc('0xa8')]?_0x14ad51[_0xc5cc('0x38')][_0xc5cc('0xa8')]+':'+_0x14ad51[_0xc5cc('0x38')][_0xc5cc('0xa6')]:'http://localhost:'+_0x14ad51[_0xc5cc('0x38')][_0xc5cc('0xa6')];var _0x477534=_0x14ad51['query'][_0xc5cc('0x1f')]?_0x14ad51[_0xc5cc('0x38')]['json']:!![];var _0x359995=_0x14ad51[_0xc5cc('0x38')][_0xc5cc('0xaa')]?_0x14ad51[_0xc5cc('0x38')][_0xc5cc('0xaa')]:null;var _0x55d4cb={'method':_0x14ad51[_0xc5cc('0xab')],'uri':util[_0xc5cc('0x54')]('%s%s',_0x1f3ac3,_0x14ad51['query'][_0xc5cc('0x9')]),'json':_0x477534,'resolveWithFullResponse':!![],'encoding':_0x359995,'body':_0x14ad51[_0xc5cc('0x98')]};if(_0x14ad51[_0xc5cc('0xac')]){_0x55d4cb[_0xc5cc('0xac')]=_0x14ad51[_0xc5cc('0xac')];if(_0x55d4cb['headers'][_0xc5cc('0xad')]){delete _0x55d4cb[_0xc5cc('0xac')][_0xc5cc('0xad')];}}if(_0x55d4cb[_0xc5cc('0xac')][_0xc5cc('0xae')]){delete _0x55d4cb['headers'][_0xc5cc('0xae')];}return rp(_0x55d4cb);})['then'](function(_0x547c9b){if(_0x547c9b){_0x47ce0f['set'](_0x547c9b['headers']);logger[_0xc5cc('0x68')](_0x547c9b[_0xc5cc('0x98')]);return _0x47ce0f[_0xc5cc('0x1d')](_0x547c9b[_0xc5cc('0xb0')])[_0xc5cc('0x2e')](_0x547c9b['body']);}else{return _0x47ce0f[_0xc5cc('0x1c')](0xc8);}})[_0xc5cc('0x4a')](handleError(_0x47ce0f,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index c9885e2..cbdf862 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 _0x66fa=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0x66fa,0x117));var _0xa66f=function(_0x1e5643,_0x41e185){_0x1e5643=_0x1e5643-0x0;var _0xf04393=_0x66fa[_0x1e5643];return _0xf04393;};'use strict';var EventEmitter=require(_0xa66f('0x0'));var Plugin=require(_0xa66f('0x1'))['db']['Plugin'];var PluginEvents=new EventEmitter();PluginEvents[_0xa66f('0x2')](0x0);var events={'afterCreate':_0xa66f('0x3'),'afterUpdate':_0xa66f('0x4'),'afterDestroy':_0xa66f('0x5')};function emitEvent(_0x3d0c49){return function(_0x2a2abf,_0x3f4904,_0x5ebea5){PluginEvents['emit'](_0x3d0c49+':'+_0x2a2abf['id'],_0x2a2abf);PluginEvents[_0xa66f('0x6')](_0x3d0c49,_0x2a2abf);_0x5ebea5(null);};}for(var e in events){if(events[_0xa66f('0x7')](e)){var event=events[e];Plugin[_0xa66f('0x8')](e,emitEvent(event));}}module[_0xa66f('0x9')]=PluginEvents; \ No newline at end of file +var _0xdb28=['Plugin','setMaxListeners','update','remove','emit','exports','events','../../mysqldb'];(function(_0x3c42ca,_0x3261e4){var _0x30a51f=function(_0xbfbfea){while(--_0xbfbfea){_0x3c42ca['push'](_0x3c42ca['shift']());}};_0x30a51f(++_0x3261e4);}(_0xdb28,0x106));var _0x8db2=function(_0x32ea2d,_0xcd2873){_0x32ea2d=_0x32ea2d-0x0;var _0xb5e112=_0xdb28[_0x32ea2d];return _0xb5e112;};'use strict';var EventEmitter=require(_0x8db2('0x0'));var Plugin=require(_0x8db2('0x1'))['db'][_0x8db2('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x8db2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8db2('0x4'),'afterDestroy':_0x8db2('0x5')};function emitEvent(_0xfcf49f){return function(_0x4426fe,_0x11109e,_0x52bf99){PluginEvents[_0x8db2('0x6')](_0xfcf49f+':'+_0x4426fe['id'],_0x4426fe);PluginEvents[_0x8db2('0x6')](_0xfcf49f,_0x4426fe);_0x52bf99(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module[_0x8db2('0x7')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 44332de..770d046 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 _0x7bae=['rimraf','../../config/environment','./plugin.attributes','exports','define','Plugin','plugins','../../config/logger','api','bluebird','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7bae,0x13b));var _0xe7ba=function(_0x18cd5b,_0x10240b){_0x18cd5b=_0x18cd5b-0x0;var _0x5eaa52=_0x7bae[_0x18cd5b];return _0x5eaa52;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7ba('0x0'))(_0xe7ba('0x1'));var moment=require('moment');var BPromise=require(_0xe7ba('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe7ba('0x3'));var rimraf=require(_0xe7ba('0x4'));var config=require(_0xe7ba('0x5'));var attributes=require(_0xe7ba('0x6'));module[_0xe7ba('0x7')]=function(_0xfd3a22,_0x2d31df){return _0xfd3a22[_0xe7ba('0x8')](_0xe7ba('0x9'),attributes,{'tableName':_0xe7ba('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9a19=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./plugin.attributes','exports','define'];(function(_0x220f3f,_0x11c540){var _0x1f170e=function(_0x2c0ec9){while(--_0x2c0ec9){_0x220f3f['push'](_0x220f3f['shift']());}};_0x1f170e(++_0x11c540);}(_0x9a19,0x114));var _0x99a1=function(_0x213518,_0x51e022){_0x213518=_0x213518-0x0;var _0x1baf75=_0x9a19[_0x213518];return _0x1baf75;};'use strict';var _=require(_0x99a1('0x0'));var util=require(_0x99a1('0x1'));var logger=require(_0x99a1('0x2'))('api');var moment=require(_0x99a1('0x3'));var BPromise=require(_0x99a1('0x4'));var rp=require(_0x99a1('0x5'));var fs=require('fs');var path=require(_0x99a1('0x6'));var rimraf=require(_0x99a1('0x7'));var config=require(_0x99a1('0x8'));var attributes=require(_0x99a1('0x9'));module[_0x99a1('0xa')]=function(_0x3eff4a,_0xff0240){return _0x3eff4a[_0x99a1('0xb')]('Plugin',attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 4f9c898..e7fa35d 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 _0x5775=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreatePlugin','create','options','raw','then'];(function(_0x25909b,_0x24d88b){var _0x5669c5=function(_0x1c1612){while(--_0x1c1612){_0x25909b['push'](_0x25909b['shift']());}};_0x5669c5(++_0x24d88b);}(_0x5775,0x155));var _0x5577=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x5775[_0x33032e];return _0x13316b;};'use strict';var _=require('lodash');var util=require(_0x5577('0x0'));var moment=require('moment');var BPromise=require(_0x5577('0x1'));var rs=require(_0x5577('0x2'));var fs=require('fs');var Redis=require(_0x5577('0x3'));var db=require(_0x5577('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x5577('0x5'))(_0x5577('0x6'));var config=require(_0x5577('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5577('0x8')][_0x5577('0x9')]({'port':0x232a});config[_0x5577('0xa')]=_[_0x5577('0xb')](config[_0x5577('0xa')],{'host':_0x5577('0xc'),'port':0x18eb});var socket=require(_0x5577('0xd'))(new Redis(config['redis']));require(_0x5577('0xe'))[_0x5577('0xf')](socket);function respondWithRpcPromise(_0x596990,_0xcbbf0e,_0x139644){return new BPromise(function(_0x5dc83c,_0x4e8022){return client[_0x5577('0x10')](_0x596990,_0x139644)['then'](function(_0x551dc5){logger[_0x5577('0x11')](_0x5577('0x12'),_0xcbbf0e,'request\x20sent');logger['debug']('Plugin,\x20%s,\x20%s,\x20%s',_0xcbbf0e,_0x5577('0x13'),JSON[_0x5577('0x14')](_0x551dc5));if(_0x551dc5[_0x5577('0x15')]){if(_0x551dc5['error'][_0x5577('0x16')]===0x1f4){logger['error'](_0x5577('0x12'),_0xcbbf0e,_0x551dc5[_0x5577('0x15')]['message']);return _0x4e8022(_0x551dc5[_0x5577('0x15')][_0x5577('0x17')]);}logger[_0x5577('0x15')]('Plugin,\x20%s,\x20%s',_0xcbbf0e,_0x551dc5[_0x5577('0x15')][_0x5577('0x17')]);return _0x5dc83c(_0x551dc5['error']['message']);}else{logger['info'](_0x5577('0x12'),_0xcbbf0e,_0x5577('0x13'));_0x5dc83c(_0x551dc5[_0x5577('0x18')]['message']);}})[_0x5577('0x19')](function(_0x2cbfc7){logger[_0x5577('0x15')]('Plugin,\x20%s,\x20%s',_0xcbbf0e,_0x2cbfc7);_0x4e8022(_0x2cbfc7);});});}exports[_0x5577('0x1a')]=function(_0x4a89d7){var _0x407d90=this;return new Promise(function(_0x5b0bc4,_0x3b1800){return db['Plugin'][_0x5577('0x1b')](_0x4a89d7['body'],{'raw':_0x4a89d7[_0x5577('0x1c')]?_0x4a89d7[_0x5577('0x1c')][_0x5577('0x1d')]===undefined?!![]:![]:!![]})[_0x5577('0x1e')](function(_0x55227c){logger[_0x5577('0x11')](_0x5577('0x1a'),_0x4a89d7);logger['debug'](_0x5577('0x1a'),_0x4a89d7,JSON[_0x5577('0x14')](_0x55227c));_0x5b0bc4(_0x55227c);})[_0x5577('0x19')](function(_0x29b454){logger[_0x5577('0x15')](_0x5577('0x1a'),_0x29b454[_0x5577('0x17')],_0x4a89d7);_0x3b1800(_0x407d90[_0x5577('0x15')](0x1f4,_0x29b454[_0x5577('0x17')]));});});}; \ No newline at end of file +var _0x2fc3=['../../config/logger','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter','./plugin.socket','register','then','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','error','message','result','CreatePlugin','Plugin','create','body','options','raw','stringify','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2fc3,0x1e8));var _0x32fc=function(_0x31d186,_0x24f453){_0x31d186=_0x31d186-0x0;var _0x3bf508=_0x2fc3[_0x31d186];return _0x3bf508;};'use strict';var _=require(_0x32fc('0x0'));var util=require(_0x32fc('0x1'));var moment=require(_0x32fc('0x2'));var BPromise=require('bluebird');var rs=require(_0x32fc('0x3'));var fs=require('fs');var Redis=require(_0x32fc('0x4'));var db=require(_0x32fc('0x5'))['db'];var utils=require(_0x32fc('0x6'));var logger=require(_0x32fc('0x7'))(_0x32fc('0x8'));var config=require('../../config/environment');var jayson=require(_0x32fc('0x9'));var client=jayson[_0x32fc('0xa')][_0x32fc('0xb')]({'port':0x232a});config[_0x32fc('0xc')]=_[_0x32fc('0xd')](config[_0x32fc('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x32fc('0xe'))(new Redis(config[_0x32fc('0xc')]));require(_0x32fc('0xf'))[_0x32fc('0x10')](socket);function respondWithRpcPromise(_0x4fd40f,_0x21bd30,_0x480b25){return new BPromise(function(_0x4061c9,_0xef4ddd){return client['request'](_0x4fd40f,_0x480b25)[_0x32fc('0x11')](function(_0x16d21e){logger[_0x32fc('0x12')](_0x32fc('0x13'),_0x21bd30,_0x32fc('0x14'));logger[_0x32fc('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x21bd30,_0x32fc('0x14'),JSON['stringify'](_0x16d21e));if(_0x16d21e[_0x32fc('0x16')]){if(_0x16d21e[_0x32fc('0x16')]['code']===0x1f4){logger[_0x32fc('0x16')](_0x32fc('0x13'),_0x21bd30,_0x16d21e[_0x32fc('0x16')]['message']);return _0xef4ddd(_0x16d21e[_0x32fc('0x16')][_0x32fc('0x17')]);}logger[_0x32fc('0x16')](_0x32fc('0x13'),_0x21bd30,_0x16d21e[_0x32fc('0x16')]['message']);return _0x4061c9(_0x16d21e['error'][_0x32fc('0x17')]);}else{logger[_0x32fc('0x12')]('Plugin,\x20%s,\x20%s',_0x21bd30,'request\x20sent');_0x4061c9(_0x16d21e[_0x32fc('0x18')][_0x32fc('0x17')]);}})['catch'](function(_0x416d14){logger[_0x32fc('0x16')](_0x32fc('0x13'),_0x21bd30,_0x416d14);_0xef4ddd(_0x416d14);});});}exports[_0x32fc('0x19')]=function(_0xb62557){var _0x436e70=this;return new Promise(function(_0x2ebdfa,_0x1b4271){return db[_0x32fc('0x1a')][_0x32fc('0x1b')](_0xb62557[_0x32fc('0x1c')],{'raw':_0xb62557[_0x32fc('0x1d')]?_0xb62557[_0x32fc('0x1d')][_0x32fc('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x7fe154){logger[_0x32fc('0x12')](_0x32fc('0x19'),_0xb62557);logger['debug'](_0x32fc('0x19'),_0xb62557,JSON[_0x32fc('0x1f')](_0x7fe154));_0x2ebdfa(_0x7fe154);})[_0x32fc('0x20')](function(_0xab50c){logger['error']('CreatePlugin',_0xab50c[_0x32fc('0x17')],_0xb62557);_0x1b4271(_0x436e70[_0x32fc('0x16')](0x1f4,_0xab50c[_0x32fc('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index 353b94e..ca7dc11 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 _0xf2e9=['length','plugin:','./plugin.events','save','emit','removeListener'];(function(_0x39263d,_0x24cc39){var _0x3ae0fb=function(_0x5a30ea){while(--_0x5a30ea){_0x39263d['push'](_0x39263d['shift']());}};_0x3ae0fb(++_0x24cc39);}(_0xf2e9,0x146));var _0x9f2e=function(_0x31de40,_0x3732cb){_0x31de40=_0x31de40-0x0;var _0x3cb144=_0xf2e9[_0x31de40];return _0x3cb144;};'use strict';var PluginEvents=require(_0x9f2e('0x0'));var events=[_0x9f2e('0x1'),'remove','update'];function createListener(_0x350e49,_0x1d8892){return function(_0x4d1964){_0x1d8892[_0x9f2e('0x2')](_0x350e49,_0x4d1964);};}function removeListener(_0x55e6d5,_0x4001d1){return function(){PluginEvents[_0x9f2e('0x3')](_0x55e6d5,_0x4001d1);};}exports['register']=function(_0x47fde2){for(var _0x42e9da=0x0,_0x205b7d=events[_0x9f2e('0x4')];_0x42e9da<_0x205b7d;_0x42e9da++){var _0x4719d1=events[_0x42e9da];var _0x31ccae=createListener(_0x9f2e('0x5')+_0x4719d1,_0x47fde2);PluginEvents['on'](_0x4719d1,_0x31ccae);}}; \ No newline at end of file +var _0x13e3=['remove','update','removeListener','register','length'];(function(_0x18eb0f,_0xa9a95){var _0x3d7161=function(_0x410e11){while(--_0x410e11){_0x18eb0f['push'](_0x18eb0f['shift']());}};_0x3d7161(++_0xa9a95);}(_0x13e3,0x6e));var _0x313e=function(_0x2c0be1,_0x1e88f2){_0x2c0be1=_0x2c0be1-0x0;var _0x3d4bd2=_0x13e3[_0x2c0be1];return _0x3d4bd2;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x313e('0x0'),_0x313e('0x1')];function createListener(_0x5c0432,_0x3d123f){return function(_0x36974e){_0x3d123f['emit'](_0x5c0432,_0x36974e);};}function removeListener(_0xf03058,_0x5d5aec){return function(){PluginEvents[_0x313e('0x2')](_0xf03058,_0x5d5aec);};}exports[_0x313e('0x3')]=function(_0x426439){for(var _0x3b86ce=0x0,_0x113baf=events[_0x313e('0x4')];_0x3b86ce<_0x113baf;_0x3b86ce++){var _0x29519d=events[_0x3b86ce];var _0x159eaf=createListener('plugin:'+_0x29519d,_0x426439);PluginEvents['on'](_0x29519d,_0x159eaf);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 106732e..7bc0999 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 _0x5395=['Router','./pm2.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','destroy','exports','express'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5395,0x8b));var _0x5539=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x5395[_0xfae23b];return _0x200640;};'use strict';var express=require(_0x5539('0x0'));var router=express[_0x5539('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0x5539('0x2'));router[_0x5539('0x3')]('/',auth[_0x5539('0x4')](),controller[_0x5539('0x5')]);router[_0x5539('0x3')](_0x5539('0x6'),auth[_0x5539('0x4')](),controller[_0x5539('0x7')]);router[_0x5539('0x8')]('/',auth[_0x5539('0x4')](),controller[_0x5539('0x9')]);router[_0x5539('0xa')](_0x5539('0x6'),auth[_0x5539('0x4')](),controller[_0x5539('0xb')]);router['delete'](_0x5539('0x6'),auth['isAuthenticated'](),controller[_0x5539('0xc')]);module[_0x5539('0xd')]=router; \ No newline at end of file +var _0xc20b=['exports','express','Router','./pm2.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x1e441f,_0x51dcad){var _0x5dc8d4=function(_0x2a9696){while(--_0x2a9696){_0x1e441f['push'](_0x1e441f['shift']());}};_0x5dc8d4(++_0x51dcad);}(_0xc20b,0xe1));var _0xbc20=function(_0x470eb7,_0x469345){_0x470eb7=_0x470eb7-0x0;var _0x51cefc=_0xc20b[_0x470eb7];return _0x51cefc;};'use strict';var express=require(_0xbc20('0x0'));var router=express[_0xbc20('0x1')]();var auth=require('../../components/auth/service');var controller=require(_0xbc20('0x2'));router[_0xbc20('0x3')]('/',auth[_0xbc20('0x4')](),controller[_0xbc20('0x5')]);router[_0xbc20('0x3')](_0xbc20('0x6'),auth[_0xbc20('0x4')](),controller['show']);router[_0xbc20('0x7')]('/',auth[_0xbc20('0x4')](),controller[_0xbc20('0x8')]);router[_0xbc20('0x9')](_0xbc20('0x6'),auth[_0xbc20('0x4')](),controller[_0xbc20('0xa')]);router[_0xbc20('0xb')](_0xbc20('0x6'),auth[_0xbc20('0x4')](),controller[_0xbc20('0xc')]);module[_0xbc20('0xd')]=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index 1de315b..3c6b7eb 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 _0xae35=['cwd','dirname','chdir','start','dump','restart','stop','hasOwnProperty','delete','lodash','../../config/pm2','../../config/logger','api','path','exec','status','json','name','send','npm\x20install','info','then','reject','express','length','show','describe','params','catch','body','script','../../files/plugins'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0xae35,0x89));var _0x5ae3=function(_0x5afe78,_0x2680fb){_0x5afe78=_0x5afe78-0x0;var _0x3b31ab=_0xae35[_0x5afe78];return _0x3b31ab;};'use strict';var _=require(_0x5ae3('0x0'));var pm2=require(_0x5ae3('0x1'));var logger=require(_0x5ae3('0x2'))(_0x5ae3('0x3'));var path=require(_0x5ae3('0x4'));var exec=require('child_process')[_0x5ae3('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x445f93,_0x1397a9){return function(_0x50c5e2){if(!_0x50c5e2){_0x445f93['sendStatus'](0x194);;}return _0x50c5e2;};}function respondWithResult(_0x578194,_0x4c41ae){_0x4c41ae=_0x4c41ae||0xc8;return function(_0x187b98){if(_0x187b98){return _0x578194[_0x5ae3('0x6')](_0x4c41ae)[_0x5ae3('0x7')](_0x187b98);}return null;};}function handleError(_0x3c8832,_0x46bfaf){_0x46bfaf=_0x46bfaf||0x1f4;return function(_0x59e897){logger['error'](_0x59e897['stack']);if(_0x59e897['name']){delete _0x59e897[_0x5ae3('0x8')];}_0x3c8832[_0x5ae3('0x6')](_0x46bfaf)[_0x5ae3('0x9')](_0x59e897);};}function execChildProcess(){return new BPromise(function(_0x2765dc,_0x48507b){exec(_0x5ae3('0xa'),function(_0x500487,_0x125c09,_0x4704f5){logger[_0x5ae3('0xb')](_0x125c09);logger['info'](_0x4704f5);if(_0x500487){logger['error'](_0x500487);return _0x48507b(_0x500487);}return _0x2765dc(_0x125c09);});});}exports['index']=function(_0x3b396,_0xbfeb1d){return pm2['list']()[_0x5ae3('0xc')](function(_0x3f5b96){if(_0x3f5b96){var _0x1cddb1=_[_0x5ae3('0xd')](_0x3f5b96,function(_0x2dbb9b){return _0x2dbb9b['name']===_0x5ae3('0xe')||_0x2dbb9b['name']==='motion2';});return{'rows':_0x1cddb1,'count':_0x1cddb1[_0x5ae3('0xf')]};}return null;})[_0x5ae3('0xc')](respondWithResult(_0xbfeb1d,null))['catch'](handleError(_0xbfeb1d,null));};exports[_0x5ae3('0x10')]=function(_0x5f1736,_0x366eeb){return pm2[_0x5ae3('0x11')](_0x5f1736[_0x5ae3('0x12')]['id'])['then'](respondWithResult(_0x366eeb,null))['then'](handleEntityNotFound(_0x366eeb,null))[_0x5ae3('0x13')](handleError(_0x366eeb,null));};exports['create']=function(_0x5b4c5,_0x2a8eb7){if(_0x5b4c5[_0x5ae3('0x14')][_0x5ae3('0x8')]&&_0x5b4c5[_0x5ae3('0x14')][_0x5ae3('0x15')]){var _0x236f7a=path['join'](__dirname,_0x5ae3('0x16'),_0x5b4c5[_0x5ae3('0x14')]['script']);var _0x1144c5=process[_0x5ae3('0x17')]();process['chdir'](path[_0x5ae3('0x18')](_0x236f7a));return execChildProcess()[_0x5ae3('0xc')](function(_0x45d4c4){process[_0x5ae3('0x19')](_0x1144c5);return pm2[_0x5ae3('0x1a')]({'name':_0x5b4c5['body'][_0x5ae3('0x8')],'script':_0x236f7a});})[_0x5ae3('0xc')](function(_0x40aca1){pm2[_0x5ae3('0x1b')]();return _0x40aca1[0x0];})[_0x5ae3('0xc')](respondWithResult(_0x2a8eb7,0xc9))['catch'](handleError(_0x2a8eb7,null));}else{return _0x2a8eb7[_0x5ae3('0x6')](0x1f4)[_0x5ae3('0x9')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x5ba826,_0x2d425d){if(_0x5ba826[_0x5ae3('0x14')]['id']){delete _0x5ba826[_0x5ae3('0x14')]['id'];}var _0x2ee44b={'online':_0x5ae3('0x1c'),'stopped':_0x5ae3('0x1d')};if(_0x2ee44b[_0x5ae3('0x1e')](_0x5ba826[_0x5ae3('0x14')]['status'])){return pm2[_0x2ee44b[_0x5ba826[_0x5ae3('0x14')]['status']]](_0x5ba826[_0x5ae3('0x12')]['id'])[_0x5ae3('0xc')](respondWithResult(_0x2d425d,0xc8))[_0x5ae3('0x13')](handleError(_0x2d425d,null));}else{return _0x2d425d[_0x5ae3('0x6')](0x1f4)[_0x5ae3('0x9')]({'message':'Unknown\x20status'});}};exports['destroy']=function(_0x340c27,_0x3ecc85){if(_0x340c27[_0x5ae3('0x14')]['id']){delete _0x340c27[_0x5ae3('0x14')]['id'];}if(_0x340c27['params']['id']){return pm2[_0x5ae3('0x1f')](_0x340c27[_0x5ae3('0x12')]['id'])['then'](function(_0x5f0879){pm2[_0x5ae3('0x1b')]();return _0x5f0879[0x0];})[_0x5ae3('0xc')](respondWithResult(_0x3ecc85,null))['catch'](handleError(_0x3ecc85,null));}else{return _0x3ecc85[_0x5ae3('0x6')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file +var _0x6105=['path','exec','bluebird','sendStatus','status','name','info','error','index','reject','express','motion2','length','then','catch','show','create','body','script','join','../../files/plugins','dirname','dump','send','Missing\x20name\x20and/or\x20path','update','stop','params','Unknown\x20status','destroy','../../config/pm2','../../config/logger','api'];(function(_0x237504,_0x3d84cb){var _0x5c3ada=function(_0x7ea9c0){while(--_0x7ea9c0){_0x237504['push'](_0x237504['shift']());}};_0x5c3ada(++_0x3d84cb);}(_0x6105,0x126));var _0x5610=function(_0x7a35b1,_0x925417){_0x7a35b1=_0x7a35b1-0x0;var _0x3c4535=_0x6105[_0x7a35b1];return _0x3c4535;};'use strict';var _=require('lodash');var pm2=require(_0x5610('0x0'));var logger=require(_0x5610('0x1'))(_0x5610('0x2'));var path=require(_0x5610('0x3'));var exec=require('child_process')[_0x5610('0x4')];var BPromise=require(_0x5610('0x5'));function handleEntityNotFound(_0x503cbe,_0x246c12){return function(_0x8f413a){if(!_0x8f413a){_0x503cbe[_0x5610('0x6')](0x194);;}return _0x8f413a;};}function respondWithResult(_0x245bad,_0x580300){_0x580300=_0x580300||0xc8;return function(_0x5c461b){if(_0x5c461b){return _0x245bad[_0x5610('0x7')](_0x580300)['json'](_0x5c461b);}return null;};}function handleError(_0x4f52e1,_0x44109f){_0x44109f=_0x44109f||0x1f4;return function(_0x3521a8){logger['error'](_0x3521a8['stack']);if(_0x3521a8[_0x5610('0x8')]){delete _0x3521a8['name'];}_0x4f52e1[_0x5610('0x7')](_0x44109f)['send'](_0x3521a8);};}function execChildProcess(){return new BPromise(function(_0x16dee8,_0x268a9b){exec('npm\x20install',function(_0x848890,_0x3ed3ab,_0x2ba707){logger[_0x5610('0x9')](_0x3ed3ab);logger[_0x5610('0x9')](_0x2ba707);if(_0x848890){logger[_0x5610('0xa')](_0x848890);return _0x268a9b(_0x848890);}return _0x16dee8(_0x3ed3ab);});});}exports[_0x5610('0xb')]=function(_0x1c99f6,_0x412e2e){return pm2['list']()['then'](function(_0xa2b505){if(_0xa2b505){var _0x1abdca=_[_0x5610('0xc')](_0xa2b505,function(_0x508cfb){return _0x508cfb[_0x5610('0x8')]===_0x5610('0xd')||_0x508cfb['name']===_0x5610('0xe');});return{'rows':_0x1abdca,'count':_0x1abdca[_0x5610('0xf')]};}return null;})[_0x5610('0x10')](respondWithResult(_0x412e2e,null))[_0x5610('0x11')](handleError(_0x412e2e,null));};exports[_0x5610('0x12')]=function(_0x5f0fc8,_0x1d12cf){return pm2['describe'](_0x5f0fc8['params']['id'])[_0x5610('0x10')](respondWithResult(_0x1d12cf,null))['then'](handleEntityNotFound(_0x1d12cf,null))[_0x5610('0x11')](handleError(_0x1d12cf,null));};exports[_0x5610('0x13')]=function(_0x755fb0,_0x26a2d8){if(_0x755fb0['body'][_0x5610('0x8')]&&_0x755fb0[_0x5610('0x14')][_0x5610('0x15')]){var _0x3ed143=path[_0x5610('0x16')](__dirname,_0x5610('0x17'),_0x755fb0[_0x5610('0x14')][_0x5610('0x15')]);var _0x29a3a7=process['cwd']();process['chdir'](path[_0x5610('0x18')](_0x3ed143));return execChildProcess()[_0x5610('0x10')](function(_0x5da93a){process['chdir'](_0x29a3a7);return pm2['start']({'name':_0x755fb0[_0x5610('0x14')]['name'],'script':_0x3ed143});})[_0x5610('0x10')](function(_0x12e3bb){pm2[_0x5610('0x19')]();return _0x12e3bb[0x0];})[_0x5610('0x10')](respondWithResult(_0x26a2d8,0xc9))[_0x5610('0x11')](handleError(_0x26a2d8,null));}else{return _0x26a2d8[_0x5610('0x7')](0x1f4)[_0x5610('0x1a')]({'message':_0x5610('0x1b')});}};exports[_0x5610('0x1c')]=function(_0x1e88e8,_0x3dc588){if(_0x1e88e8[_0x5610('0x14')]['id']){delete _0x1e88e8[_0x5610('0x14')]['id'];}var _0x5ec62a={'online':'restart','stopped':_0x5610('0x1d')};if(_0x5ec62a['hasOwnProperty'](_0x1e88e8['body'][_0x5610('0x7')])){return pm2[_0x5ec62a[_0x1e88e8[_0x5610('0x14')][_0x5610('0x7')]]](_0x1e88e8[_0x5610('0x1e')]['id'])[_0x5610('0x10')](respondWithResult(_0x3dc588,0xc8))[_0x5610('0x11')](handleError(_0x3dc588,null));}else{return _0x3dc588['status'](0x1f4)[_0x5610('0x1a')]({'message':_0x5610('0x1f')});}};exports[_0x5610('0x20')]=function(_0x2e1d88,_0x361131){if(_0x2e1d88[_0x5610('0x14')]['id']){delete _0x2e1d88[_0x5610('0x14')]['id'];}if(_0x2e1d88[_0x5610('0x1e')]['id']){return pm2['delete'](_0x2e1d88['params']['id'])[_0x5610('0x10')](function(_0x422ef0){pm2[_0x5610('0x19')]();return _0x422ef0[0x0];})[_0x5610('0x10')](respondWithResult(_0x361131,null))['catch'](handleError(_0x361131,null));}else{return _0x361131[_0x5610('0x7')](0x1f4)['send']({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index 6894f4b..0ef2fac 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 _0x7ab6=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ab6,0x1bf));var _0x67ab=function(_0x3a475a,_0x40bf1d){_0x3a475a=_0x3a475a-0x0;var _0x3acf74=_0x7ab6[_0x3a475a];return _0x3acf74;};'use strict';var multer=require(_0x67ab('0x0'));var util=require(_0x67ab('0x1'));var path=require(_0x67ab('0x2'));var timeout=require(_0x67ab('0x3'));var express=require(_0x67ab('0x4'));var router=express[_0x67ab('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x67ab('0x6'));var config=require(_0x67ab('0x7'));module[_0x67ab('0x8')]=router; \ No newline at end of file +var _0x3883=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x5ac1e5,_0x4b5012){var _0x1bccc6=function(_0x102562){while(--_0x102562){_0x5ac1e5['push'](_0x5ac1e5['shift']());}};_0x1bccc6(++_0x4b5012);}(_0x3883,0xfd));var _0x3388=function(_0x22af88,_0xa6fa84){_0x22af88=_0x22af88-0x0;var _0x14967c=_0x3883[_0x22af88];return _0x14967c;};'use strict';var multer=require(_0x3388('0x0'));var util=require(_0x3388('0x1'));var path=require(_0x3388('0x2'));var timeout=require(_0x3388('0x3'));var express=require(_0x3388('0x4'));var router=express[_0x3388('0x5')]();var auth=require(_0x3388('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3388('0x7'));module[_0x3388('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 534d5a4..30a931d 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 _0x70ec=['sequelize','exports','STRING','DATE','INTEGER'];(function(_0x49c69a,_0x13827c){var _0x306548=function(_0x46e5f4){while(--_0x46e5f4){_0x49c69a['push'](_0x49c69a['shift']());}};_0x306548(++_0x13827c);}(_0x70ec,0xf5));var _0xc70e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x70ec[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc70e('0x0'));module[_0xc70e('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xc70e('0x2')]},'scheduledat':{'type':Sequelize[_0xc70e('0x3')]},'uniqueid':{'type':Sequelize[_0xc70e('0x2')]},'starttime':{'type':Sequelize[_0xc70e('0x3')]},'responsetime':{'type':Sequelize[_0xc70e('0x3')]},'ringtime':{'type':Sequelize[_0xc70e('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xc70e('0x2')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0431=['exports','DATE','STRING','INTEGER','sequelize'];(function(_0x30ebcc,_0x307cf4){var _0x19b3d8=function(_0x315965){while(--_0x315965){_0x30ebcc['push'](_0x30ebcc['shift']());}};_0x19b3d8(++_0x307cf4);}(_0x0431,0x9f));var _0x1043=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x0431[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x1043('0x0'));module[_0x1043('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x1043('0x2')]},'uniqueid':{'type':Sequelize[_0x1043('0x3')]},'starttime':{'type':Sequelize[_0x1043('0x2')]},'responsetime':{'type':Sequelize[_0x1043('0x2')]},'ringtime':{'type':Sequelize[_0x1043('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x1043('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 1c4e296..4784345 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 _0x38e5=['ReportAgentPreview','report_agent_preview','lodash','moment','bluebird','path','../../config/environment','./reportAgentPreview.attributes','exports','define'];(function(_0x3ee5fa,_0x181779){var _0x1144ab=function(_0x4ae616){while(--_0x4ae616){_0x3ee5fa['push'](_0x3ee5fa['shift']());}};_0x1144ab(++_0x181779);}(_0x38e5,0xde));var _0x538e=function(_0x28aa1d,_0x5bfa23){_0x28aa1d=_0x28aa1d-0x0;var _0x90a8a7=_0x38e5[_0x28aa1d];return _0x90a8a7;};'use strict';var _=require(_0x538e('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x538e('0x1'));var BPromise=require(_0x538e('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x538e('0x3'));var rimraf=require('rimraf');var config=require(_0x538e('0x4'));var attributes=require(_0x538e('0x5'));module[_0x538e('0x6')]=function(_0x2d7f42,_0x2679f5){return _0x2d7f42[_0x538e('0x7')](_0x538e('0x8'),attributes,{'tableName':_0x538e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x64a1=['api','moment','request-promise','path','rimraf','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','report_agent_preview','util'];(function(_0xefb33e,_0x11bbb5){var _0x529db6=function(_0x4439ea){while(--_0x4439ea){_0xefb33e['push'](_0xefb33e['shift']());}};_0x529db6(++_0x11bbb5);}(_0x64a1,0x107));var _0x164a=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0x64a1[_0x255d5b];return _0x3e141a;};'use strict';var _=require('lodash');var util=require(_0x164a('0x0'));var logger=require('../../config/logger')(_0x164a('0x1'));var moment=require(_0x164a('0x2'));var BPromise=require('bluebird');var rp=require(_0x164a('0x3'));var fs=require('fs');var path=require(_0x164a('0x4'));var rimraf=require(_0x164a('0x5'));var config=require('../../config/environment');var attributes=require(_0x164a('0x6'));module[_0x164a('0x7')]=function(_0x124834,_0x3a3239){return _0x124834[_0x164a('0x8')](_0x164a('0x9'),attributes,{'tableName':_0x164a('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 d6c3500..6897c91 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 _0xedb0=['error','code','ReportAgentPreview,\x20%s,\x20%s','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','raw','stringify','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','then','info','request\x20sent','debug'];(function(_0x55f549,_0x4f90ac){var _0x589a78=function(_0x4b2cc3){while(--_0x4b2cc3){_0x55f549['push'](_0x55f549['shift']());}};_0x589a78(++_0x4f90ac);}(_0xedb0,0x74));var _0x0edb=function(_0x19cd84,_0x4228cb){_0x19cd84=_0x19cd84-0x0;var _0x5153ae=_0xedb0[_0x19cd84];return _0x5153ae;};'use strict';var _=require(_0x0edb('0x0'));var util=require(_0x0edb('0x1'));var moment=require(_0x0edb('0x2'));var BPromise=require(_0x0edb('0x3'));var rs=require(_0x0edb('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x0edb('0x5'));var logger=require(_0x0edb('0x6'))(_0x0edb('0x7'));var config=require(_0x0edb('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x0edb('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4625cb,_0x3b23c6,_0x336965){return new BPromise(function(_0x359ceb,_0x19dc6a){return client['request'](_0x4625cb,_0x336965)[_0x0edb('0xa')](function(_0x30071b){logger[_0x0edb('0xb')]('ReportAgentPreview,\x20%s,\x20%s',_0x3b23c6,_0x0edb('0xc'));logger[_0x0edb('0xd')]('ReportAgentPreview,\x20%s,\x20%s,\x20%s',_0x3b23c6,'request\x20sent',JSON['stringify'](_0x30071b));if(_0x30071b['error']){if(_0x30071b[_0x0edb('0xe')][_0x0edb('0xf')]===0x1f4){logger[_0x0edb('0xe')](_0x0edb('0x10'),_0x3b23c6,_0x30071b[_0x0edb('0xe')][_0x0edb('0x11')]);return _0x19dc6a(_0x30071b[_0x0edb('0xe')]['message']);}logger[_0x0edb('0xe')](_0x0edb('0x10'),_0x3b23c6,_0x30071b[_0x0edb('0xe')]['message']);return _0x359ceb(_0x30071b['error']['message']);}else{logger['info'](_0x0edb('0x10'),_0x3b23c6,'request\x20sent');_0x359ceb(_0x30071b['result'][_0x0edb('0x11')]);}})[_0x0edb('0x12')](function(_0x4d5570){logger['error'](_0x0edb('0x10'),_0x3b23c6,_0x4d5570);_0x19dc6a(_0x4d5570);});});}exports[_0x0edb('0x13')]=function(_0x1b0c2b){var _0xa7c997=this;return new Promise(function(_0x490bdf,_0x20af5c){return db[_0x0edb('0x14')][_0x0edb('0x15')](_0x1b0c2b[_0x0edb('0x16')],{'raw':_0x1b0c2b[_0x0edb('0x17')]?_0x1b0c2b[_0x0edb('0x17')][_0x0edb('0x18')]===undefined?!![]:![]:!![]})[_0x0edb('0xa')](function(_0x3046f8){logger[_0x0edb('0xb')]('CreateReportAgentPreview',_0x1b0c2b);logger[_0x0edb('0xd')](_0x0edb('0x13'),_0x1b0c2b,JSON[_0x0edb('0x19')](_0x3046f8));_0x490bdf(_0x3046f8);})['catch'](function(_0x3e94ef){logger[_0x0edb('0xe')](_0x0edb('0x13'),_0x3e94ef[_0x0edb('0x11')],_0x1b0c2b);_0x20af5c(_0xa7c997[_0x0edb('0xe')](0x1f4,_0x3e94ef[_0x0edb('0x11')]));});});}; \ No newline at end of file +var _0x9183=['http','request','then','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','error','code','message','ReportAgentPreview,\x20%s,\x20%s','result','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xf807a6,_0x3dac93){var _0x4f3718=function(_0x1609ee){while(--_0x1609ee){_0xf807a6['push'](_0xf807a6['shift']());}};_0x4f3718(++_0x3dac93);}(_0x9183,0xcd));var _0x3918=function(_0x4c7fb3,_0x2af18a){_0x4c7fb3=_0x4c7fb3-0x0;var _0x59855f=_0x9183[_0x4c7fb3];return _0x59855f;};'use strict';var _=require(_0x3918('0x0'));var util=require('util');var moment=require(_0x3918('0x1'));var BPromise=require(_0x3918('0x2'));var rs=require(_0x3918('0x3'));var fs=require('fs');var Redis=require(_0x3918('0x4'));var db=require(_0x3918('0x5'))['db'];var utils=require(_0x3918('0x6'));var logger=require(_0x3918('0x7'))(_0x3918('0x8'));var config=require(_0x3918('0x9'));var jayson=require(_0x3918('0xa'));var client=jayson[_0x3918('0xb')][_0x3918('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1a02d1,_0x43d8cc,_0xc25e75){return new BPromise(function(_0x45edfa,_0x4be9d0){return client[_0x3918('0xd')](_0x1a02d1,_0xc25e75)[_0x3918('0xe')](function(_0xf5cdc4){logger[_0x3918('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x43d8cc,_0x3918('0x10'));logger[_0x3918('0x11')](_0x3918('0x12'),_0x43d8cc,_0x3918('0x10'),JSON['stringify'](_0xf5cdc4));if(_0xf5cdc4[_0x3918('0x13')]){if(_0xf5cdc4[_0x3918('0x13')][_0x3918('0x14')]===0x1f4){logger[_0x3918('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x43d8cc,_0xf5cdc4[_0x3918('0x13')][_0x3918('0x15')]);return _0x4be9d0(_0xf5cdc4[_0x3918('0x13')][_0x3918('0x15')]);}logger[_0x3918('0x13')](_0x3918('0x16'),_0x43d8cc,_0xf5cdc4[_0x3918('0x13')][_0x3918('0x15')]);return _0x45edfa(_0xf5cdc4[_0x3918('0x13')]['message']);}else{logger[_0x3918('0xf')](_0x3918('0x16'),_0x43d8cc,'request\x20sent');_0x45edfa(_0xf5cdc4[_0x3918('0x17')][_0x3918('0x15')]);}})[_0x3918('0x18')](function(_0x28f205){logger[_0x3918('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x43d8cc,_0x28f205);_0x4be9d0(_0x28f205);});});}exports[_0x3918('0x19')]=function(_0x527fa6){var _0x1969b0=this;return new Promise(function(_0x432531,_0x5ca2c8){return db[_0x3918('0x1a')][_0x3918('0x1b')](_0x527fa6[_0x3918('0x1c')],{'raw':_0x527fa6['options']?_0x527fa6[_0x3918('0x1d')]['raw']===undefined?!![]:![]:!![]})[_0x3918('0xe')](function(_0x4e7212){logger['info'](_0x3918('0x19'),_0x527fa6);logger[_0x3918('0x11')]('CreateReportAgentPreview',_0x527fa6,JSON[_0x3918('0x1e')](_0x4e7212));_0x432531(_0x4e7212);})[_0x3918('0x18')](function(_0x2835fa){logger['error'](_0x3918('0x19'),_0x2835fa[_0x3918('0x15')],_0x527fa6);_0x5ca2c8(_0x1969b0['error'](0x1f4,_0x2835fa['message']));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 05a67a1..ad04162 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 _0x1fac=['put','/agents/:id/capacity','telephones','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','mail','/mail/queues/:id','queueNotify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','/agents/:id/notify','agentNotify','multer','path','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','mailQueues','/mail/accounts','openchannelQueues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','outbound','/outbound/channels','/agents','agents'];(function(_0x1d227e,_0x491955){var _0x4f752a=function(_0x521229){while(--_0x521229){_0x1d227e['push'](_0x1d227e['shift']());}};_0x4f752a(++_0x491955);}(_0x1fac,0xe9));var _0xc1fa=function(_0x5f3042,_0x3b31ce){_0x5f3042=_0x5f3042-0x0;var _0x2369da=_0x1fac[_0x5f3042];return _0x2369da;};'use strict';var multer=require(_0xc1fa('0x0'));var util=require('util');var path=require(_0xc1fa('0x1'));var express=require('express');var router=express[_0xc1fa('0x2')]();var auth=require(_0xc1fa('0x3'));var controller=require(_0xc1fa('0x4'));router[_0xc1fa('0x5')](_0xc1fa('0x6'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x8')]);router[_0xc1fa('0x5')](_0xc1fa('0x9'),auth['isAuthenticated'](),controller[_0xc1fa('0xa')]);router[_0xc1fa('0x5')](_0xc1fa('0xb'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0xc')]);router['get'](_0xc1fa('0xd'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0xe')]);router[_0xc1fa('0x5')](_0xc1fa('0xf'),auth[_0xc1fa('0x7')](),controller['chatQueues']);router[_0xc1fa('0x5')]('/mail/queues',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x10')]);router[_0xc1fa('0x5')](_0xc1fa('0x11'),auth[_0xc1fa('0x7')](),controller['mailAccounts']);router[_0xc1fa('0x5')]('/openchannel/queues',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x12')]);router[_0xc1fa('0x5')]('/sms/queues',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x13')]);router[_0xc1fa('0x5')](_0xc1fa('0x14'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x15')]);router[_0xc1fa('0x5')](_0xc1fa('0x16'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x17')]);router[_0xc1fa('0x5')](_0xc1fa('0x18'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x19')]);router[_0xc1fa('0x5')]('/voice/queues/channels/:uniqueid',auth[_0xc1fa('0x7')](),controller['voiceQueuesChannel']);router[_0xc1fa('0x5')]('/voice/queues/channels/:uniqueid/hangup',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x1a')]);router['get'](_0xc1fa('0x1b'),auth[_0xc1fa('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0xc1fa('0x5')](_0xc1fa('0x1c'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x1d')]);router[_0xc1fa('0x5')](_0xc1fa('0x1e'),auth['isAuthenticated'](),controller[_0xc1fa('0x1f')]);router[_0xc1fa('0x5')](_0xc1fa('0x20'),auth['isAuthenticated'](),controller['outboundChannels']);router['get'](_0xc1fa('0x21'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x22')]);router[_0xc1fa('0x23')](_0xc1fa('0x24'),auth[_0xc1fa('0x7')](),controller['agentCapacity']);router[_0xc1fa('0x5')]('/telephones',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x25')]);router['get']('/trunks',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x26')]);router[_0xc1fa('0x5')]('/campaigns',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x27')]);router[_0xc1fa('0x5')](_0xc1fa('0x28'),auth['isAuthenticated'](),controller[_0xc1fa('0x29')]);router[_0xc1fa('0x5')](_0xc1fa('0x2a'),auth[_0xc1fa('0x7')](),controller['chatQueuesWaitingInteractions']);router[_0xc1fa('0x5')](_0xc1fa('0x2b'),auth['isAuthenticated'](),controller[_0xc1fa('0x2c')]);router[_0xc1fa('0x5')](_0xc1fa('0x2d'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x2e')]);router[_0xc1fa('0x5')](_0xc1fa('0x2f'),auth['isAuthenticated'](),controller[_0xc1fa('0x30')]);router[_0xc1fa('0x5')](_0xc1fa('0x31'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0xc1fa('0x32')](_0xc1fa('0x33'),auth['isAuthenticated'](),controller['queueNotify'](_0xc1fa('0x34')));router['get'](_0xc1fa('0x35'),auth[_0xc1fa('0x7')](),controller['showMailQueues']);router['post']('/chat/queues/:id/notify',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x36')]('chat'));router['get']('/chat/queues/:id',auth['isAuthenticated'](),controller['showChatQueues']);router['post']('/fax/queues/:id/notify',auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x36')](_0xc1fa('0x37')));router[_0xc1fa('0x5')](_0xc1fa('0x38'),auth['isAuthenticated'](),controller[_0xc1fa('0x39')]);router[_0xc1fa('0x32')](_0xc1fa('0x3a'),auth[_0xc1fa('0x7')](),controller['queueNotify'](_0xc1fa('0x3b')));router['get'](_0xc1fa('0x3c'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x3d')]);router['post'](_0xc1fa('0x3e'),auth[_0xc1fa('0x7')](),controller['queueNotify'](_0xc1fa('0x3f')));router[_0xc1fa('0x5')](_0xc1fa('0x40'),auth[_0xc1fa('0x7')](),controller['showSmsQueues']);router['post'](_0xc1fa('0x41'),auth[_0xc1fa('0x7')](),controller[_0xc1fa('0x42')]);module['exports']=router; \ No newline at end of file +var _0xe0ea=['/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','trunks','/campaigns','campaigns','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','showSmsQueues','/agents/:id/notify','agentNotify','exports','multer','util','path','express','../../components/auth/service','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/mail/queues','/mail/accounts','/openchannel/queues','openchannelQueues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','/voice/queues/channels','voiceQueuesChannels','/voice/queues/channels/:uniqueid','/voice/queues/channels/:uniqueid/hangup','/voice/queues/channels/:uniqueid/redirect/:exten','/outbound','/outbound/channels','outboundChannels','/agents','agents','put'];(function(_0x3725ee,_0x543bd9){var _0x399c71=function(_0xaf9400){while(--_0xaf9400){_0x3725ee['push'](_0x3725ee['shift']());}};_0x399c71(++_0x543bd9);}(_0xe0ea,0xb9));var _0xae0e=function(_0x104666,_0x5482d4){_0x104666=_0x104666-0x0;var _0x5d305a=_0xe0ea[_0x104666];return _0x5d305a;};'use strict';var multer=require(_0xae0e('0x0'));var util=require(_0xae0e('0x1'));var path=require(_0xae0e('0x2'));var express=require(_0xae0e('0x3'));var router=express['Router']();var auth=require(_0xae0e('0x4'));var controller=require('./rpc.controller');router[_0xae0e('0x5')](_0xae0e('0x6'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x8')]);router[_0xae0e('0x5')](_0xae0e('0x9'),auth[_0xae0e('0x7')](),controller[_0xae0e('0xa')]);router[_0xae0e('0x5')](_0xae0e('0xb'),auth['isAuthenticated'](),controller[_0xae0e('0xc')]);router[_0xae0e('0x5')](_0xae0e('0xd'),auth[_0xae0e('0x7')](),controller[_0xae0e('0xe')]);router[_0xae0e('0x5')]('/chat/queues',auth[_0xae0e('0x7')](),controller['chatQueues']);router[_0xae0e('0x5')](_0xae0e('0xf'),auth[_0xae0e('0x7')](),controller['mailQueues']);router[_0xae0e('0x5')](_0xae0e('0x10'),auth[_0xae0e('0x7')](),controller['mailAccounts']);router[_0xae0e('0x5')](_0xae0e('0x11'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x12')]);router[_0xae0e('0x5')]('/sms/queues',auth[_0xae0e('0x7')](),controller[_0xae0e('0x13')]);router[_0xae0e('0x5')]('/fax/queues',auth[_0xae0e('0x7')](),controller[_0xae0e('0x14')]);router['get'](_0xae0e('0x15'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x16')]);router[_0xae0e('0x5')](_0xae0e('0x17'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x18')]);router[_0xae0e('0x5')](_0xae0e('0x19'),auth['isAuthenticated'](),controller['voiceQueuesChannel']);router[_0xae0e('0x5')](_0xae0e('0x1a'),auth[_0xae0e('0x7')](),controller['voiceQueuesChannelHangup']);router[_0xae0e('0x5')](_0xae0e('0x1b'),auth['isAuthenticated'](),controller['voiceQueuesChannelRedirect']);router[_0xae0e('0x5')]('/voice/queues/:id',auth[_0xae0e('0x7')](),controller['showVoiceQueues']);router[_0xae0e('0x5')](_0xae0e('0x1c'),auth[_0xae0e('0x7')](),controller['outbound']);router['get'](_0xae0e('0x1d'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x1e')]);router[_0xae0e('0x5')](_0xae0e('0x1f'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x20')]);router[_0xae0e('0x21')](_0xae0e('0x22'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x23')]);router[_0xae0e('0x5')](_0xae0e('0x24'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x25')]);router['get'](_0xae0e('0x26'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x27')]);router[_0xae0e('0x5')](_0xae0e('0x28'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x29')]);router[_0xae0e('0x5')]('/fax/accounts',auth['isAuthenticated'](),controller[_0xae0e('0x2a')]);router[_0xae0e('0x5')](_0xae0e('0x2b'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x2c')]);router['get'](_0xae0e('0x2d'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x2e')]);router[_0xae0e('0x5')](_0xae0e('0x2f'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x30')]);router[_0xae0e('0x5')](_0xae0e('0x31'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x32')]);router[_0xae0e('0x5')]('/fax/queues/waitinginteractions',auth[_0xae0e('0x7')](),controller[_0xae0e('0x33')]);router[_0xae0e('0x34')](_0xae0e('0x35'),auth['isAuthenticated'](),controller[_0xae0e('0x36')](_0xae0e('0x37')));router['get']('/mail/queues/:id',auth[_0xae0e('0x7')](),controller[_0xae0e('0x38')]);router[_0xae0e('0x34')](_0xae0e('0x39'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x36')]('chat'));router[_0xae0e('0x5')](_0xae0e('0x3a'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x3b')]);router['post'](_0xae0e('0x3c'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x36')](_0xae0e('0x3d')));router[_0xae0e('0x5')](_0xae0e('0x3e'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x3f')]);router[_0xae0e('0x34')](_0xae0e('0x40'),auth['isAuthenticated'](),controller[_0xae0e('0x36')]('openchannel'));router[_0xae0e('0x5')](_0xae0e('0x41'),auth['isAuthenticated'](),controller[_0xae0e('0x42')]);router[_0xae0e('0x34')](_0xae0e('0x43'),auth['isAuthenticated'](),controller['queueNotify'](_0xae0e('0x44')));router[_0xae0e('0x5')]('/sms/queues/:id',auth[_0xae0e('0x7')](),controller[_0xae0e('0x45')]);router[_0xae0e('0x34')](_0xae0e('0x46'),auth[_0xae0e('0x7')](),controller[_0xae0e('0x47')]);module[_0xae0e('0x48')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index cb3431a..0763775 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 _0xc77e=['agent','Agent\x20not\x20found','\x20Message\x20not\x20found','agentTransferTimeout','*,*,*,*','bluebird','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','http','client','request','then','error','message','result','catch','status','json','sendStatus','stack','name','send','isNil','rows','find','VoiceChannels','voiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','query','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','outboundChannels','OutboundChannels','agents','Agents','agentCapacity','body','interaction','user','MemberReport','findAll','INTERACTION','length','format','updateAttributes','findOrCreate','SIP/%s','interface','YYYY-MM-DD\x20HH:mm:ss','internal','AgentCapacity','capacity','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','MailQueues','MailAccounts','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','showFaxQueues','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Account','Queue','\x20Queue\x20not\x20found','Message','findOne','messageId','Interaction','update','queue','MessageId','InteractionId','From','TransferReport','queueTransferTimeout','agentNotify','Channel\x20field\x20is\x20mandatory','Website','User'];(function(_0x21940d,_0x2209da){var _0x22d948=function(_0x53ee6d){while(--_0x53ee6d){_0x21940d['push'](_0x21940d['shift']());}};_0x22d948(++_0x2209da);}(_0xc77e,0x15e));var _0xec77=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc77e[_0x2641f9];return _0x585741;};'use strict';var BPromise=require(_0xec77('0x0'));var moment=require('moment');var _=require(_0xec77('0x1'));var util=require(_0xec77('0x2'));var db=require(_0xec77('0x3'))['db'];var logger=require(_0xec77('0x4'))(_0xec77('0x5'));var jayson=require(_0xec77('0x6'));var amiClient=jayson['client'][_0xec77('0x7')]({'port':0x232a});var mailClient=jayson[_0xec77('0x8')][_0xec77('0x7')]({'port':0x232b});var routingClient=jayson[_0xec77('0x8')][_0xec77('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x4237b4,_0x4121d1,_0x2da214){return new BPromise(function(_0x56a38e,_0x6cba9c){var _0x27147d=_0x2da214?_0x2da214:amiClient;return _0x27147d[_0xec77('0x9')](_0x4237b4,_0x4121d1)[_0xec77('0xa')](function(_0x1b0b23){if(_0x1b0b23['error']){if(_0x1b0b23['error']['code']===0x1f4){return _0x6cba9c(_0x1b0b23[_0xec77('0xb')][_0xec77('0xc')]);}return _0x56a38e(_0x1b0b23[_0xec77('0xb')][_0xec77('0xc')]);}else{_0x56a38e(_0x1b0b23[_0xec77('0xd')]);}})[_0xec77('0xe')](function(_0x505e73){_0x6cba9c(_0x505e73);});});}function respondWithResult(_0x220701,_0x1ee3fa){_0x1ee3fa=_0x1ee3fa||0xc8;return function(_0x4a801f){if(_0x4a801f){return _0x220701[_0xec77('0xf')](_0x1ee3fa)[_0xec77('0x10')](_0x4a801f);}return _0x220701[_0xec77('0x11')](0x194);};}function handleError(_0x9207b8,_0x97614){_0x97614=_0x97614||0x1f4;return function(_0x3903d0){logger[_0xec77('0xb')](_0x3903d0[_0xec77('0x12')]);if(_0x3903d0[_0xec77('0x13')]){delete _0x3903d0[_0xec77('0x13')];}_0x9207b8[_0xec77('0xf')](_0x97614)[_0xec77('0x14')](_0x3903d0);};}function findById(_0x2e978c){return function(_0x376a23){if(!_[_0xec77('0x15')](_0x2e978c)&&!_[_0xec77('0x15')](_0x376a23)&&!_[_0xec77('0x15')](_0x376a23[_0xec77('0x16')])){return _[_0xec77('0x17')](_0x376a23[_0xec77('0x16')],function(_0x4ccf91){return _0x4ccf91['id']==_0x2e978c;});}return null;};}exports['voiceChannels']=function(_0x435761,_0x357e82){return respondWithRpcPromise(_0xec77('0x18'),_0x435761['query'])[_0xec77('0xa')](respondWithResult(_0x357e82,null))[_0xec77('0xe')](handleError(_0x357e82,null));};exports[_0xec77('0x19')]=function(_0xc9103e,_0x1db9b8){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0xec77('0x1a')](_0xc9103e['query'],_0xc9103e[_0xec77('0x1b')]))[_0xec77('0xa')](respondWithResult(_0x1db9b8,null))[_0xec77('0xe')](handleError(_0x1db9b8,null));};exports[_0xec77('0x1c')]=function(_0x2851d0,_0x5464b8){return respondWithRpcPromise(_0xec77('0x1d'),_[_0xec77('0x1a')](_0x2851d0[_0xec77('0x1e')],_0x2851d0[_0xec77('0x1b')]))[_0xec77('0xa')](respondWithResult(_0x5464b8,null))['catch'](handleError(_0x5464b8,null));};exports[_0xec77('0x1f')]=function(_0x14302a,_0x275030){return respondWithRpcPromise(_0xec77('0x20'),_0x14302a[_0xec77('0x1e')])[_0xec77('0xa')](respondWithResult(_0x275030,null))[_0xec77('0xe')](handleError(_0x275030,null));};exports['showVoiceQueues']=function(_0x1ada02,_0x2fa271){return respondWithRpcPromise(_0xec77('0x20'),_0x1ada02[_0xec77('0x1e')])[_0xec77('0xa')](findById(_0x1ada02['params']['id']))[_0xec77('0xa')](respondWithResult(_0x2fa271,null))[_0xec77('0xe')](handleError(_0x2fa271,null));};exports[_0xec77('0x21')]=function(_0x53b731,_0x40b371){return respondWithRpcPromise(_0xec77('0x22'),_[_0xec77('0x1a')](_0x53b731['query'],_0x53b731['params']))[_0xec77('0xa')](respondWithResult(_0x40b371,null))[_0xec77('0xe')](handleError(_0x40b371,null));};exports['voiceQueuesChannels']=function(_0x5e7d55,_0x3cbc3a){return respondWithRpcPromise(_0xec77('0x23'),_0x5e7d55['query'])[_0xec77('0xa')](respondWithResult(_0x3cbc3a,null))[_0xec77('0xe')](handleError(_0x3cbc3a,null));};exports[_0xec77('0x24')]=function(_0x1a8c68,_0x107074){return respondWithRpcPromise(_0xec77('0x25'),_[_0xec77('0x1a')](_0x1a8c68['query'],_0x1a8c68[_0xec77('0x1b')]))[_0xec77('0xa')](respondWithResult(_0x107074,null))[_0xec77('0xe')](handleError(_0x107074,null));};exports[_0xec77('0x26')]=function(_0x3e2e93,_0x1c04d0){return respondWithRpcPromise(_0xec77('0x27'),_[_0xec77('0x1a')](_0x3e2e93[_0xec77('0x1e')],_0x3e2e93[_0xec77('0x1b')]))[_0xec77('0xa')](respondWithResult(_0x1c04d0,null))['catch'](handleError(_0x1c04d0,null));};exports[_0xec77('0x28')]=function(_0x769f3,_0x22f7f9){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x769f3[_0xec77('0x1e')],_0x769f3['params']))['then'](respondWithResult(_0x22f7f9,null))[_0xec77('0xe')](handleError(_0x22f7f9,null));};exports[_0xec77('0x29')]=function(_0x5a3f06,_0xa00c92){return respondWithRpcPromise(_0xec77('0x2a'),_0x5a3f06[_0xec77('0x1e')])[_0xec77('0xa')](respondWithResult(_0xa00c92,null))[_0xec77('0xe')](handleError(_0xa00c92,null));};exports[_0xec77('0x2b')]=function(_0x592c06,_0x1e8a1c){return respondWithRpcPromise(_0xec77('0x2c'),_0x592c06[_0xec77('0x1e')])[_0xec77('0xa')](respondWithResult(_0x1e8a1c,null))[_0xec77('0xe')](handleError(_0x1e8a1c,null));};exports[_0xec77('0x2d')]=function(_0x1a7510,_0x3ffae2){var _0x68c5d3;return respondWithRpcPromise('Agents',_0x1a7510[_0xec77('0x1e')])[_0xec77('0xa')](function(_0x4ff954){_0x68c5d3=_0x4ff954;return respondWithRpcPromise(_0xec77('0x2e'),_0x1a7510['query'],routingClient);})[_0xec77('0xa')](function(_0x40d6b9){return _[_0xec77('0x1a')]({},_0x40d6b9,_0x68c5d3);})[_0xec77('0xa')](respondWithResult(_0x3ffae2,null))[_0xec77('0xe')](handleError(_0x3ffae2,null));};exports[_0xec77('0x2f')]=function(_0x25d00e,_0x3d95e5){if(_0x25d00e[_0xec77('0x30')]&&_0x25d00e[_0xec77('0x30')][_0xec77('0x31')]&&_0x25d00e[_0xec77('0x32')]&&_0x25d00e['user'][_0xec77('0x13')]){for(var _0x25d73c in _0x25d00e['body'][_0xec77('0x31')]){if(_0x25d00e[_0xec77('0x30')]['interaction']['hasOwnProperty'](_0x25d73c)){db[_0xec77('0x33')][_0xec77('0x34')]({'where':{'channel':_0x25d73c,'membername':_0x25d00e[_0xec77('0x32')][_0xec77('0x13')],'type':_0xec77('0x35'),'exitAt':null,'uniqueid':_0x25d00e['body'][_0xec77('0x31')][_0x25d73c]&&_0x25d00e[_0xec77('0x30')]['interaction'][_0x25d73c][_0xec77('0x36')]?{'$notIn':_0x25d00e[_0xec77('0x30')][_0xec77('0x31')][_0x25d73c]}:{'$ne':null}}})[_0xec77('0xa')](function(_0x3aead7){var _0x752169=moment()[_0xec77('0x37')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0xe9da1c=0x0,_0x412f41=_0x3aead7[_0xec77('0x36')];_0xe9da1c<_0x412f41;_0xe9da1c+=0x1){_0x3aead7[_0xe9da1c][_0xec77('0x38')]({'exitAt':_0x752169});}});for(var _0x2c5be6=0x0;_0x2c5be6<_0x25d00e['body'][_0xec77('0x31')][_0x25d73c][_0xec77('0x36')];_0x2c5be6+=0x1){db[_0xec77('0x33')][_0xec77('0x39')]({'where':{'channel':_0x25d73c,'membername':_0x25d00e[_0xec77('0x32')][_0xec77('0x13')],'type':_0xec77('0x35'),'uniqueid':_0x25d00e[_0xec77('0x30')][_0xec77('0x31')][_0x25d73c][_0x2c5be6],'exitAt':null},'defaults':{'channel':_0x25d73c,'membername':_0x25d00e['user'][_0xec77('0x13')],'interface':_[_0xec77('0x15')](_0x25d00e['user']['interface'])?util['format'](_0xec77('0x3a'),_0x25d00e[_0xec77('0x32')][_0xec77('0x13')]):_0x25d00e[_0xec77('0x32')][_0xec77('0x3b')],'type':'INTERACTION','enterAt':moment()[_0xec77('0x37')](_0xec77('0x3c')),'role':'agent','internal':_0x25d00e[_0xec77('0x32')][_0xec77('0x3d')],'uniqueid':_0x25d00e[_0xec77('0x30')][_0xec77('0x31')][_0x25d73c][_0x2c5be6]}});}}}}return respondWithRpcPromise(_0xec77('0x3e'),{'id':_0x25d00e[_0xec77('0x1b')]['id'],'capacity':_0x25d00e['body'][_0xec77('0x3f')]},routingClient)['then'](respondWithResult(_0x3d95e5,null))[_0xec77('0xe')](handleError(_0x3d95e5,null));};exports['telephones']=function(_0xa94457,_0x1d0177){return respondWithRpcPromise('Telephones',_0xa94457[_0xec77('0x1e')])[_0xec77('0xa')](respondWithResult(_0x1d0177,null))['catch'](handleError(_0x1d0177,null));};exports[_0xec77('0x40')]=function(_0x192570,_0x3162c3){return respondWithRpcPromise(_0xec77('0x41'),_0x192570['query'])[_0xec77('0xa')](respondWithResult(_0x3162c3,null))[_0xec77('0xe')](handleError(_0x3162c3,null));};exports[_0xec77('0x42')]=function(_0x26b722,_0x2d9fdd){return respondWithRpcPromise(_0xec77('0x43'),_0x26b722[_0xec77('0x1e')])[_0xec77('0xa')](respondWithResult(_0x2d9fdd,null))[_0xec77('0xe')](handleError(_0x2d9fdd,null));};exports[_0xec77('0x44')]=function(_0x1f547a,_0x2b9f07){return respondWithRpcPromise('ChatQueues',_0x1f547a[_0xec77('0x1e')],routingClient)['then'](respondWithResult(_0x2b9f07,null))[_0xec77('0xe')](handleError(_0x2b9f07,null));};exports[_0xec77('0x45')]=function(_0x1ea47e,_0x437b3a){return respondWithRpcPromise(_0xec77('0x46'),_0x1ea47e['query'],routingClient)[_0xec77('0xa')](findById(_0x1ea47e[_0xec77('0x1b')]['id']))[_0xec77('0xa')](respondWithResult(_0x437b3a,null))[_0xec77('0xe')](handleError(_0x437b3a,null));};exports['mailQueues']=function(_0x199a59,_0x42dc91){return respondWithRpcPromise(_0xec77('0x47'),_0x199a59[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](respondWithResult(_0x42dc91,null))[_0xec77('0xe')](handleError(_0x42dc91,null));};exports['showMailQueues']=function(_0x5ea062,_0x1460d3){return respondWithRpcPromise('MailQueues',_0x5ea062[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](findById(_0x5ea062[_0xec77('0x1b')]['id']))[_0xec77('0xa')](respondWithResult(_0x1460d3,null))['catch'](handleError(_0x1460d3,null));};exports['mailAccounts']=function(_0x296943,_0x1fbc57){return respondWithRpcPromise(_0xec77('0x48'),_0x296943['query'],mailClient)[_0xec77('0xa')](respondWithResult(_0x1fbc57,null))[_0xec77('0xe')](handleError(_0x1fbc57,null));};exports[_0xec77('0x49')]=function(_0x31d16c,_0x487d28){return respondWithRpcPromise(_0xec77('0x4a'),_0x31d16c[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](respondWithResult(_0x487d28,null))['catch'](handleError(_0x487d28,null));};exports[_0xec77('0x4b')]=function(_0x52c35f,_0x5db8a7){return respondWithRpcPromise(_0xec77('0x4a'),_0x52c35f[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](findById(_0x52c35f[_0xec77('0x1b')]['id']))[_0xec77('0xa')](respondWithResult(_0x5db8a7,null))[_0xec77('0xe')](handleError(_0x5db8a7,null));};exports[_0xec77('0x4c')]=function(_0xef3d83,_0x50b8c9){return respondWithRpcPromise(_0xec77('0x4d'),_0xef3d83['query'],routingClient)['then'](respondWithResult(_0x50b8c9,null))['catch'](handleError(_0x50b8c9,null));};exports[_0xec77('0x4e')]=function(_0x4b865d,_0x599db2){return respondWithRpcPromise(_0xec77('0x4d'),_0x4b865d['query'],routingClient)[_0xec77('0xa')](findById(_0x4b865d[_0xec77('0x1b')]['id']))['then'](respondWithResult(_0x599db2,null))[_0xec77('0xe')](handleError(_0x599db2,null));};exports[_0xec77('0x4f')]=function(_0x1939f4,_0x16b1fc){return respondWithRpcPromise('FaxQueues',_0x1939f4['query'],routingClient)['then'](respondWithResult(_0x16b1fc,null))[_0xec77('0xe')](handleError(_0x16b1fc,null));};exports[_0xec77('0x50')]=function(_0x241247,_0x6dc02b){return respondWithRpcPromise('FaxQueues',_0x241247[_0xec77('0x1e')],routingClient)['then'](findById(_0x241247[_0xec77('0x1b')]['id']))[_0xec77('0xa')](respondWithResult(_0x6dc02b,null))[_0xec77('0xe')](handleError(_0x6dc02b,null));};exports['faxAccounts']=function(_0x32d80a,_0x15568a){return respondWithRpcPromise(_0xec77('0x51'),_0x32d80a[_0xec77('0x1e')])['then'](respondWithResult(_0x15568a,null))[_0xec77('0xe')](handleError(_0x15568a,null));};exports[_0xec77('0x52')]=function(_0x54e2cb,_0x39bef6){return respondWithRpcPromise(_0xec77('0x53'),_0x54e2cb[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](respondWithResult(_0x39bef6,null))[_0xec77('0xe')](handleError(_0x39bef6,null));};exports['mailQueuesWaitingInteractions']=function(_0x5bf94d,_0x5db703){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x5bf94d[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](respondWithResult(_0x5db703,null))['catch'](handleError(_0x5db703,null));};exports[_0xec77('0x54')]=function(_0x3c7ab2,_0x31a378){return respondWithRpcPromise(_0xec77('0x55'),_0x3c7ab2[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](respondWithResult(_0x31a378,null))[_0xec77('0xe')](handleError(_0x31a378,null));};exports[_0xec77('0x56')]=function(_0xce9318,_0x39c71f){return respondWithRpcPromise(_0xec77('0x57'),_0xce9318[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](respondWithResult(_0x39c71f,null))[_0xec77('0xe')](handleError(_0x39c71f,null));};exports['faxQueuesWaitingInteractions']=function(_0x25d038,_0xc07e96){return respondWithRpcPromise(_0xec77('0x58'),_0x25d038[_0xec77('0x1e')],routingClient)[_0xec77('0xa')](respondWithResult(_0xc07e96,null))[_0xec77('0xe')](handleError(_0xc07e96,null));};exports[_0xec77('0x59')]=function(_0x12c2f0){return function(_0x4b5812,_0x55f083){var _0x408603,_0x6d1b0a;var _0x50d4a5=_[_0xec77('0x5a')](_0x12c2f0);var _0x48f8a8=_0x12c2f0===_0xec77('0x5b')?'Website':_0xec77('0x5c');return db[_0x50d4a5+_0xec77('0x5d')]['findOne']({'raw':!![],'where':{'id':_0x4b5812[_0xec77('0x1b')]['id']}})['then'](function(_0x316230){if(_[_0xec77('0x15')](_0x316230)){throw new Error(_0x50d4a5+_0xec77('0x5e'));}_0x408603=_0x316230;return db[_0x50d4a5+_0xec77('0x5f')][_0xec77('0x60')]({'where':{'id':_0x4b5812[_0xec77('0x30')][_0xec77('0x61')]},'include':[{'model':db[_0x50d4a5+_0xec77('0x62')],'as':'Interaction'},{'model':db[_0x50d4a5+_0x48f8a8],'as':_0xec77('0x5c')}]});})[_0xec77('0xa')](function(_0x3bb14c){if(_['isNil'](_0x3bb14c)){throw new Error(_0x50d4a5+'\x20Message\x20not\x20found');}_0x6d1b0a=_0x3bb14c;return _0x3bb14c[_0xec77('0x63')]({'read':0x0,'readAt':null,'UserId':null});})[_0xec77('0xa')](function(){var _0x1631b8={'uniqueid':_0x12c2f0+'.'+_0x6d1b0a['id']+'.'+_0x6d1b0a['Interaction']['id'],'FromUserId':_0x4b5812[_0xec77('0x32')]['id'],'type':_0xec77('0x64')};_0x1631b8[_0x50d4a5+_0xec77('0x65')]=_0x6d1b0a['id'];_0x1631b8[_0x50d4a5+_0xec77('0x66')]=_0x6d1b0a['Interaction']['id'];_0x1631b8[_0xec77('0x67')+_0x50d4a5+_0x48f8a8+'Id']=_0x6d1b0a[_0xec77('0x5c')]['id'];_0x1631b8['To'+_0x50d4a5+'QueueId']=_0x408603['id'];return db[_0x50d4a5+_0xec77('0x68')]['create'](_0x1631b8);})[_0xec77('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x12c2f0,'interaction':_0x6d1b0a['Interaction'],'message':_0x6d1b0a,'account':_0x6d1b0a[_0xec77('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x408603['name']+','+(_0x6d1b0a['Account'][_0xec77('0x69')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xec77('0xa')](respondWithResult(_0x55f083,null))[_0xec77('0xe')](handleError(_0x55f083,null));};};exports[_0xec77('0x6a')]=function(_0x11a005,_0x22b38d){var _0x764fdc,_0x2053f4;if(_[_0xec77('0x15')](_0x11a005[_0xec77('0x30')]['channel'])){throw new Error(_0xec77('0x6b'));}var _0x57a1aa=_0x11a005['body']['channel'];var _0x4bba9c=_[_0xec77('0x5a')](_0x57a1aa);var _0x493c7c=_0x57a1aa===_0xec77('0x5b')?_0xec77('0x6c'):'Account';return db[_0xec77('0x6d')][_0xec77('0x60')]({'raw':!![],'where':{'id':_0x11a005[_0xec77('0x1b')]['id'],'role':_0xec77('0x6e')}})[_0xec77('0xa')](function(_0x4ece6f){if(_[_0xec77('0x15')](_0x4ece6f)){throw new Error(_0xec77('0x6f'));}_0x764fdc=_0x4ece6f;return db[_0x4bba9c+'Message'][_0xec77('0x60')]({'where':{'id':_0x11a005[_0xec77('0x30')][_0xec77('0x61')]},'include':[{'model':db[_0x4bba9c+'Interaction'],'as':_0xec77('0x62')},{'model':db[_0x4bba9c+_0x493c7c],'as':_0xec77('0x5c')}]});})[_0xec77('0xa')](function(_0x5a98e7){if(_[_0xec77('0x15')](_0x5a98e7)){throw new Error(_0x4bba9c+_0xec77('0x70'));}_0x2053f4=_0x5a98e7;return _0x5a98e7[_0xec77('0x63')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0xa72a72={'uniqueid':_0x57a1aa+'.'+_0x2053f4['id']+'.'+_0x2053f4['Interaction']['id'],'FromUserId':_0x11a005[_0xec77('0x32')]['id'],'type':_0xec77('0x64'),'ToUserId':_0x764fdc['id']};_0xa72a72[_0x4bba9c+_0xec77('0x65')]=_0x2053f4['id'];_0xa72a72[_0x4bba9c+_0xec77('0x66')]=_0x2053f4[_0xec77('0x62')]['id'];_0xa72a72[_0xec77('0x67')+_0x4bba9c+_0x493c7c+'Id']=_0x2053f4[_0xec77('0x5c')]['id'];return db[_0x4bba9c+_0xec77('0x68')]['create'](_0xa72a72);})[_0xec77('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x57a1aa,'interaction':_0x2053f4[_0xec77('0x62')],'message':_0x2053f4,'account':_0x2053f4[_0xec77('0x5c')],'applications':[{'id':0x0,'priority':0x1,'app':_0xec77('0x6e'),'appdata':_0x764fdc[_0xec77('0x13')]+','+(_0x2053f4[_0xec77('0x5c')][_0xec77('0x71')]||0x12c),'interval':_0xec77('0x72')}]},routingClient);})[_0xec77('0xa')](respondWithResult(_0x22b38d,null))[_0xec77('0xe')](handleError(_0x22b38d,null));}; \ No newline at end of file +var _0xdaca=['hasOwnProperty','findAll','user','length','format','updateAttributes','MemberReport','interface','SIP/%s','INTERACTION','YYYY-MM-DD\x20HH:mm:ss','agent','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','ChatQueues','showChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','faxAccounts','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','SmsQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','Website','Queue','findOne','\x20Queue\x20not\x20found','Message','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','capitalize','chat','Agent\x20not\x20found','messageId','agentTransferTimeout','bluebird','moment','lodash','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','error','code','message','result','catch','sendStatus','stack','name','status','send','isNil','rows','find','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','outbound','OutboundChannels','Agents','agentCapacity','body','interaction'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0xdaca,0x123));var _0xadac=function(_0x272802,_0x393109){_0x272802=_0x272802-0x0;var _0x279b2b=_0xdaca[_0x272802];return _0x279b2b;};'use strict';var BPromise=require(_0xadac('0x0'));var moment=require(_0xadac('0x1'));var _=require(_0xadac('0x2'));var util=require('util');var db=require(_0xadac('0x3'))['db'];var logger=require(_0xadac('0x4'))('api');var jayson=require(_0xadac('0x5'));var amiClient=jayson[_0xadac('0x6')][_0xadac('0x7')]({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0xadac('0x6')][_0xadac('0x7')]({'port':0x232c});function respondWithRpcPromise(_0x3a71de,_0x5d613e,_0x2eac66){return new BPromise(function(_0x4a6f7b,_0x5a9abe){var _0x8acdc8=_0x2eac66?_0x2eac66:amiClient;return _0x8acdc8[_0xadac('0x8')](_0x3a71de,_0x5d613e)[_0xadac('0x9')](function(_0x2efe7d){if(_0x2efe7d[_0xadac('0xa')]){if(_0x2efe7d[_0xadac('0xa')][_0xadac('0xb')]===0x1f4){return _0x5a9abe(_0x2efe7d[_0xadac('0xa')][_0xadac('0xc')]);}return _0x4a6f7b(_0x2efe7d[_0xadac('0xa')][_0xadac('0xc')]);}else{_0x4a6f7b(_0x2efe7d[_0xadac('0xd')]);}})[_0xadac('0xe')](function(_0x5dcc67){_0x5a9abe(_0x5dcc67);});});}function respondWithResult(_0x3c5029,_0x194dce){_0x194dce=_0x194dce||0xc8;return function(_0x38605a){if(_0x38605a){return _0x3c5029['status'](_0x194dce)['json'](_0x38605a);}return _0x3c5029[_0xadac('0xf')](0x194);};}function handleError(_0x1421f2,_0x3c8356){_0x3c8356=_0x3c8356||0x1f4;return function(_0x5b4cee){logger['error'](_0x5b4cee[_0xadac('0x10')]);if(_0x5b4cee[_0xadac('0x11')]){delete _0x5b4cee[_0xadac('0x11')];}_0x1421f2[_0xadac('0x12')](_0x3c8356)[_0xadac('0x13')](_0x5b4cee);};}function findById(_0x2a59a1){return function(_0x339790){if(!_['isNil'](_0x2a59a1)&&!_[_0xadac('0x14')](_0x339790)&&!_[_0xadac('0x14')](_0x339790[_0xadac('0x15')])){return _[_0xadac('0x16')](_0x339790[_0xadac('0x15')],function(_0x3fe56a){return _0x3fe56a['id']==_0x2a59a1;});}return null;};}exports['voiceChannels']=function(_0x3f83c2,_0x58e7e3){return respondWithRpcPromise('VoiceChannels',_0x3f83c2[_0xadac('0x17')])['then'](respondWithResult(_0x58e7e3,null))['catch'](handleError(_0x58e7e3,null));};exports[_0xadac('0x18')]=function(_0x29b214,_0x2be858){return respondWithRpcPromise(_0xadac('0x19'),_[_0xadac('0x1a')](_0x29b214['query'],_0x29b214['params']))['then'](respondWithResult(_0x2be858,null))[_0xadac('0xe')](handleError(_0x2be858,null));};exports[_0xadac('0x1b')]=function(_0x25c1e6,_0x24a934){return respondWithRpcPromise(_0xadac('0x1c'),_['merge'](_0x25c1e6['query'],_0x25c1e6[_0xadac('0x1d')]))[_0xadac('0x9')](respondWithResult(_0x24a934,null))[_0xadac('0xe')](handleError(_0x24a934,null));};exports[_0xadac('0x1e')]=function(_0x4010cd,_0x652915){return respondWithRpcPromise(_0xadac('0x1f'),_0x4010cd[_0xadac('0x17')])[_0xadac('0x9')](respondWithResult(_0x652915,null))[_0xadac('0xe')](handleError(_0x652915,null));};exports['showVoiceQueues']=function(_0x4a47a3,_0x32a27c){return respondWithRpcPromise('VoiceQueues',_0x4a47a3[_0xadac('0x17')])['then'](findById(_0x4a47a3['params']['id']))[_0xadac('0x9')](respondWithResult(_0x32a27c,null))[_0xadac('0xe')](handleError(_0x32a27c,null));};exports[_0xadac('0x20')]=function(_0x3f1974,_0x1167e2){return respondWithRpcPromise(_0xadac('0x21'),_[_0xadac('0x1a')](_0x3f1974[_0xadac('0x17')],_0x3f1974[_0xadac('0x1d')]))[_0xadac('0x9')](respondWithResult(_0x1167e2,null))[_0xadac('0xe')](handleError(_0x1167e2,null));};exports[_0xadac('0x22')]=function(_0x3d64b0,_0x5bd5d0){return respondWithRpcPromise(_0xadac('0x23'),_0x3d64b0['query'])['then'](respondWithResult(_0x5bd5d0,null))[_0xadac('0xe')](handleError(_0x5bd5d0,null));};exports[_0xadac('0x24')]=function(_0x2b0667,_0x390c4d){return respondWithRpcPromise(_0xadac('0x25'),_['merge'](_0x2b0667[_0xadac('0x17')],_0x2b0667[_0xadac('0x1d')]))['then'](respondWithResult(_0x390c4d,null))[_0xadac('0xe')](handleError(_0x390c4d,null));};exports[_0xadac('0x26')]=function(_0x7c0844,_0x394476){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0xadac('0x1a')](_0x7c0844[_0xadac('0x17')],_0x7c0844[_0xadac('0x1d')]))[_0xadac('0x9')](respondWithResult(_0x394476,null))[_0xadac('0xe')](handleError(_0x394476,null));};exports['voiceQueuesChannelRedirect']=function(_0x43bc4c,_0x78f336){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0xadac('0x1a')](_0x43bc4c[_0xadac('0x17')],_0x43bc4c['params']))['then'](respondWithResult(_0x78f336,null))[_0xadac('0xe')](handleError(_0x78f336,null));};exports[_0xadac('0x27')]=function(_0x374c2d,_0x4747f7){return respondWithRpcPromise('Outbound',_0x374c2d['query'])[_0xadac('0x9')](respondWithResult(_0x4747f7,null))['catch'](handleError(_0x4747f7,null));};exports['outboundChannels']=function(_0x2977df,_0x2b04e4){return respondWithRpcPromise(_0xadac('0x28'),_0x2977df[_0xadac('0x17')])['then'](respondWithResult(_0x2b04e4,null))[_0xadac('0xe')](handleError(_0x2b04e4,null));};exports['agents']=function(_0x580845,_0x41a976){var _0x3590e2;return respondWithRpcPromise(_0xadac('0x29'),_0x580845[_0xadac('0x17')])['then'](function(_0x5758a8){_0x3590e2=_0x5758a8;return respondWithRpcPromise(_0xadac('0x29'),_0x580845[_0xadac('0x17')],routingClient);})[_0xadac('0x9')](function(_0x3c97f2){return _[_0xadac('0x1a')]({},_0x3c97f2,_0x3590e2);})[_0xadac('0x9')](respondWithResult(_0x41a976,null))['catch'](handleError(_0x41a976,null));};exports[_0xadac('0x2a')]=function(_0x90f29d,_0x43fa6c){if(_0x90f29d[_0xadac('0x2b')]&&_0x90f29d['body'][_0xadac('0x2c')]&&_0x90f29d['user']&&_0x90f29d['user']['name']){for(var _0x3eebf7 in _0x90f29d[_0xadac('0x2b')][_0xadac('0x2c')]){if(_0x90f29d[_0xadac('0x2b')][_0xadac('0x2c')][_0xadac('0x2d')](_0x3eebf7)){db['MemberReport'][_0xadac('0x2e')]({'where':{'channel':_0x3eebf7,'membername':_0x90f29d[_0xadac('0x2f')][_0xadac('0x11')],'type':'INTERACTION','exitAt':null,'uniqueid':_0x90f29d[_0xadac('0x2b')]['interaction'][_0x3eebf7]&&_0x90f29d['body']['interaction'][_0x3eebf7][_0xadac('0x30')]?{'$notIn':_0x90f29d['body'][_0xadac('0x2c')][_0x3eebf7]}:{'$ne':null}}})[_0xadac('0x9')](function(_0x52f98a){var _0xfc6b45=moment()[_0xadac('0x31')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x4f5aab=0x0,_0x507731=_0x52f98a[_0xadac('0x30')];_0x4f5aab<_0x507731;_0x4f5aab+=0x1){_0x52f98a[_0x4f5aab][_0xadac('0x32')]({'exitAt':_0xfc6b45});}});for(var _0x8bad1f=0x0;_0x8bad1f<_0x90f29d[_0xadac('0x2b')][_0xadac('0x2c')][_0x3eebf7][_0xadac('0x30')];_0x8bad1f+=0x1){db[_0xadac('0x33')]['findOrCreate']({'where':{'channel':_0x3eebf7,'membername':_0x90f29d[_0xadac('0x2f')][_0xadac('0x11')],'type':'INTERACTION','uniqueid':_0x90f29d[_0xadac('0x2b')][_0xadac('0x2c')][_0x3eebf7][_0x8bad1f],'exitAt':null},'defaults':{'channel':_0x3eebf7,'membername':_0x90f29d[_0xadac('0x2f')][_0xadac('0x11')],'interface':_[_0xadac('0x14')](_0x90f29d[_0xadac('0x2f')][_0xadac('0x34')])?util[_0xadac('0x31')](_0xadac('0x35'),_0x90f29d[_0xadac('0x2f')][_0xadac('0x11')]):_0x90f29d[_0xadac('0x2f')][_0xadac('0x34')],'type':_0xadac('0x36'),'enterAt':moment()[_0xadac('0x31')](_0xadac('0x37')),'role':_0xadac('0x38'),'internal':_0x90f29d[_0xadac('0x2f')]['internal'],'uniqueid':_0x90f29d[_0xadac('0x2b')][_0xadac('0x2c')][_0x3eebf7][_0x8bad1f]}});}}}}return respondWithRpcPromise(_0xadac('0x39'),{'id':_0x90f29d['params']['id'],'capacity':_0x90f29d[_0xadac('0x2b')][_0xadac('0x3a')]},routingClient)[_0xadac('0x9')](respondWithResult(_0x43fa6c,null))[_0xadac('0xe')](handleError(_0x43fa6c,null));};exports['telephones']=function(_0x1257f6,_0x2d984a){return respondWithRpcPromise(_0xadac('0x3b'),_0x1257f6[_0xadac('0x17')])[_0xadac('0x9')](respondWithResult(_0x2d984a,null))[_0xadac('0xe')](handleError(_0x2d984a,null));};exports[_0xadac('0x3c')]=function(_0x5450b5,_0x362fa8){return respondWithRpcPromise(_0xadac('0x3d'),_0x5450b5[_0xadac('0x17')])[_0xadac('0x9')](respondWithResult(_0x362fa8,null))[_0xadac('0xe')](handleError(_0x362fa8,null));};exports[_0xadac('0x3e')]=function(_0x1ca761,_0x2770dc){return respondWithRpcPromise(_0xadac('0x3f'),_0x1ca761[_0xadac('0x17')])[_0xadac('0x9')](respondWithResult(_0x2770dc,null))[_0xadac('0xe')](handleError(_0x2770dc,null));};exports['chatQueues']=function(_0x3abfff,_0x59ecf7){return respondWithRpcPromise(_0xadac('0x40'),_0x3abfff[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x59ecf7,null))[_0xadac('0xe')](handleError(_0x59ecf7,null));};exports[_0xadac('0x41')]=function(_0x4f97ac,_0x403260){return respondWithRpcPromise(_0xadac('0x40'),_0x4f97ac[_0xadac('0x17')],routingClient)[_0xadac('0x9')](findById(_0x4f97ac[_0xadac('0x1d')]['id']))[_0xadac('0x9')](respondWithResult(_0x403260,null))[_0xadac('0xe')](handleError(_0x403260,null));};exports[_0xadac('0x42')]=function(_0x1b414f,_0x15fb72){return respondWithRpcPromise(_0xadac('0x43'),_0x1b414f[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x15fb72,null))[_0xadac('0xe')](handleError(_0x15fb72,null));};exports[_0xadac('0x44')]=function(_0x12f4b1,_0x1e4a11){return respondWithRpcPromise(_0xadac('0x43'),_0x12f4b1['query'],routingClient)['then'](findById(_0x12f4b1[_0xadac('0x1d')]['id']))[_0xadac('0x9')](respondWithResult(_0x1e4a11,null))[_0xadac('0xe')](handleError(_0x1e4a11,null));};exports[_0xadac('0x45')]=function(_0x27485f,_0x3a8a6c){return respondWithRpcPromise('MailAccounts',_0x27485f['query'],mailClient)[_0xadac('0x9')](respondWithResult(_0x3a8a6c,null))[_0xadac('0xe')](handleError(_0x3a8a6c,null));};exports[_0xadac('0x46')]=function(_0x4a1575,_0x134c64){return respondWithRpcPromise(_0xadac('0x47'),_0x4a1575[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x134c64,null))['catch'](handleError(_0x134c64,null));};exports['showOpenchannelQueues']=function(_0x1011c1,_0xaa4979){return respondWithRpcPromise(_0xadac('0x47'),_0x1011c1[_0xadac('0x17')],routingClient)[_0xadac('0x9')](findById(_0x1011c1[_0xadac('0x1d')]['id']))[_0xadac('0x9')](respondWithResult(_0xaa4979,null))[_0xadac('0xe')](handleError(_0xaa4979,null));};exports[_0xadac('0x48')]=function(_0x221508,_0x57db7e){return respondWithRpcPromise(_0xadac('0x49'),_0x221508[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x57db7e,null))['catch'](handleError(_0x57db7e,null));};exports[_0xadac('0x4a')]=function(_0x1c7e1f,_0x14c351){return respondWithRpcPromise(_0xadac('0x49'),_0x1c7e1f[_0xadac('0x17')],routingClient)[_0xadac('0x9')](findById(_0x1c7e1f[_0xadac('0x1d')]['id']))[_0xadac('0x9')](respondWithResult(_0x14c351,null))[_0xadac('0xe')](handleError(_0x14c351,null));};exports[_0xadac('0x4b')]=function(_0x3dbc0e,_0x3d0c34){return respondWithRpcPromise(_0xadac('0x4c'),_0x3dbc0e[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x3d0c34,null))[_0xadac('0xe')](handleError(_0x3d0c34,null));};exports['showFaxQueues']=function(_0x4b5c41,_0x506464){return respondWithRpcPromise(_0xadac('0x4c'),_0x4b5c41[_0xadac('0x17')],routingClient)[_0xadac('0x9')](findById(_0x4b5c41[_0xadac('0x1d')]['id']))[_0xadac('0x9')](respondWithResult(_0x506464,null))[_0xadac('0xe')](handleError(_0x506464,null));};exports[_0xadac('0x4d')]=function(_0x3b46f4,_0x131145){return respondWithRpcPromise('FaxAccounts',_0x3b46f4[_0xadac('0x17')])['then'](respondWithResult(_0x131145,null))['catch'](handleError(_0x131145,null));};exports['chatQueuesWaitingInteractions']=function(_0x17dd16,_0x11d535){return respondWithRpcPromise(_0xadac('0x4e'),_0x17dd16[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x11d535,null))[_0xadac('0xe')](handleError(_0x11d535,null));};exports[_0xadac('0x4f')]=function(_0x2951c5,_0x44b459){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x2951c5[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x44b459,null))[_0xadac('0xe')](handleError(_0x44b459,null));};exports[_0xadac('0x50')]=function(_0x384b76,_0xbe99d6){return respondWithRpcPromise(_0xadac('0x51'),_0x384b76[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0xbe99d6,null))['catch'](handleError(_0xbe99d6,null));};exports['smsQueuesWaitingInteractions']=function(_0x13cb76,_0x579a04){return respondWithRpcPromise(_0xadac('0x52'),_0x13cb76[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x579a04,null))[_0xadac('0xe')](handleError(_0x579a04,null));};exports['faxQueuesWaitingInteractions']=function(_0x4ae8b0,_0x42487c){return respondWithRpcPromise(_0xadac('0x53'),_0x4ae8b0[_0xadac('0x17')],routingClient)[_0xadac('0x9')](respondWithResult(_0x42487c,null))[_0xadac('0xe')](handleError(_0x42487c,null));};exports[_0xadac('0x54')]=function(_0xcec1e2){return function(_0x146b88,_0x3ecb74){var _0x3c5a7a,_0x122346;var _0x24687e=_['capitalize'](_0xcec1e2);var _0x2b1d12=_0xcec1e2==='chat'?_0xadac('0x55'):'Account';return db[_0x24687e+_0xadac('0x56')][_0xadac('0x57')]({'raw':!![],'where':{'id':_0x146b88[_0xadac('0x1d')]['id']}})[_0xadac('0x9')](function(_0x45abd8){if(_[_0xadac('0x14')](_0x45abd8)){throw new Error(_0x24687e+_0xadac('0x58'));}_0x3c5a7a=_0x45abd8;return db[_0x24687e+_0xadac('0x59')][_0xadac('0x57')]({'where':{'id':_0x146b88[_0xadac('0x2b')]['messageId']},'include':[{'model':db[_0x24687e+_0xadac('0x5a')],'as':_0xadac('0x5a')},{'model':db[_0x24687e+_0x2b1d12],'as':_0xadac('0x5b')}]});})[_0xadac('0x9')](function(_0x56e6e3){if(_[_0xadac('0x14')](_0x56e6e3)){throw new Error(_0x24687e+_0xadac('0x5c'));}_0x122346=_0x56e6e3;return _0x56e6e3[_0xadac('0x5d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xadac('0x9')](function(){var _0x4b4233={'uniqueid':_0xcec1e2+'.'+_0x122346['id']+'.'+_0x122346['Interaction']['id'],'FromUserId':_0x146b88['user']['id'],'type':_0xadac('0x5e')};_0x4b4233[_0x24687e+_0xadac('0x5f')]=_0x122346['id'];_0x4b4233[_0x24687e+_0xadac('0x60')]=_0x122346[_0xadac('0x5a')]['id'];_0x4b4233[_0xadac('0x61')+_0x24687e+_0x2b1d12+'Id']=_0x122346[_0xadac('0x5b')]['id'];_0x4b4233['To'+_0x24687e+_0xadac('0x62')]=_0x3c5a7a['id'];return db[_0x24687e+_0xadac('0x63')][_0xadac('0x64')](_0x4b4233);})['then'](function(){return respondWithRpcPromise(_0xadac('0x65'),{'channel':_0xcec1e2,'interaction':_0x122346[_0xadac('0x5a')],'message':_0x122346,'account':_0x122346[_0xadac('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xadac('0x5e'),'appdata':_0x3c5a7a[_0xadac('0x11')]+','+(_0x122346['Account'][_0xadac('0x66')]||0x12c),'interval':_0xadac('0x67')}]},routingClient);})[_0xadac('0x9')](respondWithResult(_0x3ecb74,null))[_0xadac('0xe')](handleError(_0x3ecb74,null));};};exports[_0xadac('0x68')]=function(_0x26dff4,_0x125689){var _0x342302,_0x3d06f9;if(_[_0xadac('0x14')](_0x26dff4['body']['channel'])){throw new Error(_0xadac('0x69'));}var _0x1a8fc=_0x26dff4[_0xadac('0x2b')][_0xadac('0x6a')];var _0x63cf1f=_[_0xadac('0x6b')](_0x1a8fc);var _0x509290=_0x1a8fc===_0xadac('0x6c')?_0xadac('0x55'):_0xadac('0x5b');return db['User'][_0xadac('0x57')]({'raw':!![],'where':{'id':_0x26dff4['params']['id'],'role':'agent'}})[_0xadac('0x9')](function(_0xc70a10){if(_['isNil'](_0xc70a10)){throw new Error(_0xadac('0x6d'));}_0x342302=_0xc70a10;return db[_0x63cf1f+_0xadac('0x59')]['findOne']({'where':{'id':_0x26dff4['body'][_0xadac('0x6e')]},'include':[{'model':db[_0x63cf1f+'Interaction'],'as':'Interaction'},{'model':db[_0x63cf1f+_0x509290],'as':_0xadac('0x5b')}]});})[_0xadac('0x9')](function(_0x1d6a91){if(_[_0xadac('0x14')](_0x1d6a91)){throw new Error(_0x63cf1f+_0xadac('0x5c'));}_0x3d06f9=_0x1d6a91;return _0x1d6a91[_0xadac('0x5d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xadac('0x9')](function(){var _0x3f750a={'uniqueid':_0x1a8fc+'.'+_0x3d06f9['id']+'.'+_0x3d06f9[_0xadac('0x5a')]['id'],'FromUserId':_0x26dff4[_0xadac('0x2f')]['id'],'type':_0xadac('0x5e'),'ToUserId':_0x342302['id']};_0x3f750a[_0x63cf1f+_0xadac('0x5f')]=_0x3d06f9['id'];_0x3f750a[_0x63cf1f+'InteractionId']=_0x3d06f9[_0xadac('0x5a')]['id'];_0x3f750a[_0xadac('0x61')+_0x63cf1f+_0x509290+'Id']=_0x3d06f9[_0xadac('0x5b')]['id'];return db[_0x63cf1f+'TransferReport'][_0xadac('0x64')](_0x3f750a);})[_0xadac('0x9')](function(){return respondWithRpcPromise(_0xadac('0x65'),{'channel':_0x1a8fc,'interaction':_0x3d06f9[_0xadac('0x5a')],'message':_0x3d06f9,'account':_0x3d06f9[_0xadac('0x5b')],'applications':[{'id':0x0,'priority':0x1,'app':_0xadac('0x38'),'appdata':_0x342302['name']+','+(_0x3d06f9[_0xadac('0x5b')][_0xadac('0x6f')]||0x12c),'interval':_0xadac('0x67')}]},routingClient);})[_0xadac('0x9')](respondWithResult(_0x125689,null))[_0xadac('0xe')](handleError(_0x125689,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 0760da0..eeb5074 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 _0xcba6=['util','connect-timeout','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/run','run','create','put','update','delete','destroy','exports'];(function(_0x30f97e,_0x3d83ca){var _0xe57505=function(_0x52fed5){while(--_0x52fed5){_0x30f97e['push'](_0x30f97e['shift']());}};_0xe57505(++_0x3d83ca);}(_0xcba6,0xb0));var _0x6cba=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0xcba6[_0x87b0ff];return _0x3bc0b2;};'use strict';var multer=require('multer');var util=require(_0x6cba('0x0'));var path=require('path');var timeout=require(_0x6cba('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x6cba('0x2'));var config=require(_0x6cba('0x3'));var controller=require('./schedule.controller');router['get']('/',auth[_0x6cba('0x4')](),controller[_0x6cba('0x5')]);router[_0x6cba('0x6')](_0x6cba('0x7'),auth['isAuthenticated'](),controller['show']);router['get'](_0x6cba('0x8'),auth[_0x6cba('0x4')](),controller[_0x6cba('0x9')]);router['post']('/',auth[_0x6cba('0x4')](),controller[_0x6cba('0xa')]);router[_0x6cba('0xb')]('/:id',auth[_0x6cba('0x4')](),controller[_0x6cba('0xc')]);router[_0x6cba('0xd')](_0x6cba('0x7'),auth[_0x6cba('0x4')](),controller[_0x6cba('0xe')]);module[_0x6cba('0xf')]=router; \ No newline at end of file +var _0x779d=['get','/:id','isAuthenticated','show','/:id/run','run','post','create','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./schedule.controller','index'];(function(_0x2a0c92,_0x4ba0b3){var _0x2a5e7b=function(_0xeb66ef){while(--_0xeb66ef){_0x2a0c92['push'](_0x2a0c92['shift']());}};_0x2a5e7b(++_0x4ba0b3);}(_0x779d,0x1da));var _0xd779=function(_0x42594b,_0x5b6cc1){_0x42594b=_0x42594b-0x0;var _0x3fc951=_0x779d[_0x42594b];return _0x3fc951;};'use strict';var multer=require(_0xd779('0x0'));var util=require(_0xd779('0x1'));var path=require(_0xd779('0x2'));var timeout=require(_0xd779('0x3'));var express=require('express');var router=express[_0xd779('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd779('0x5'));var config=require(_0xd779('0x6'));var controller=require(_0xd779('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0xd779('0x8')]);router[_0xd779('0x9')](_0xd779('0xa'),auth[_0xd779('0xb')](),controller[_0xd779('0xc')]);router[_0xd779('0x9')](_0xd779('0xd'),auth[_0xd779('0xb')](),controller[_0xd779('0xe')]);router[_0xd779('0xf')]('/',auth[_0xd779('0xb')](),controller[_0xd779('0x10')]);router['put'](_0xd779('0xa'),auth[_0xd779('0xb')](),controller[_0xd779('0x11')]);router[_0xd779('0x12')](_0xd779('0xa'),auth[_0xd779('0xb')](),controller[_0xd779('0x13')]);module[_0xd779('0x14')]=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index 0179714..a473af2 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 _0xfdcd=['xlsx','custom','default','BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','minutes','csv'];(function(_0x589d2f,_0xc49372){var _0x1db27c=function(_0x25d0d3){while(--_0x25d0d3){_0x589d2f['push'](_0x589d2f['shift']());}};_0x1db27c(++_0xc49372);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfdcd[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0xdfdc('0x0')]={'name':{'type':Sequelize[_0xdfdc('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xdfdc('0x1')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0xdfdc('0x1')],'allowNull':![],'defaultValue':_0xdfdc('0x2')},'startAt':{'type':Sequelize[_0xdfdc('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0xdfdc('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0xdfdc('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xdfdc('0x5')](_0xdfdc('0x6'),_0xdfdc('0x7'),_0xdfdc('0x8'),_0xdfdc('0x9'),_0xdfdc('0xa'),_0xdfdc('0xb'),_0xdfdc('0xc')),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0xdfdc('0x5')](_0xdfdc('0xd'),'pdf',_0xdfdc('0xe')),'allowNull':![],'defaultValue':_0xdfdc('0xd')},'type':{'type':Sequelize[_0xdfdc('0x5')](_0xdfdc('0xf'),_0xdfdc('0x10')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0xdfdc('0x11')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize['TEXT']},'bcc':{'type':Sequelize[_0xdfdc('0x12')]},'sendIfEmpty':{'type':Sequelize[_0xdfdc('0x11')],'defaultValue':!![]}}; \ No newline at end of file +var _0x5334=['0\x200\x20*\x20*\x20*','DATE','INTEGER','months','minutes','days','ENUM','csv','pdf','xlsx','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN'];(function(_0x598276,_0x36eb71){var _0x1f968a=function(_0x22ab99){while(--_0x22ab99){_0x598276['push'](_0x598276['shift']());}};_0x1f968a(++_0x36eb71);}(_0x5334,0x84));var _0x4533=function(_0x4d3f63,_0x489240){_0x4d3f63=_0x4d3f63-0x0;var _0x268adb=_0x5334[_0x4d3f63];return _0x268adb;};'use strict';var Sequelize=require(_0x4533('0x0'));module[_0x4533('0x1')]={'name':{'type':Sequelize[_0x4533('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x4533('0x2')]},'active':{'type':Sequelize[_0x4533('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4533('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize[_0x4533('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x4533('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years','quarters',_0x4533('0x7'),'weeks','days','hours',_0x4533('0x8')),'allowNull':![],'defaultValue':_0x4533('0x9')},'output':{'type':Sequelize[_0x4533('0xa')](_0x4533('0xb'),_0x4533('0xc'),_0x4533('0xd')),'allowNull':![],'defaultValue':_0x4533('0xb')},'type':{'type':Sequelize['ENUM'](_0x4533('0xe'),_0x4533('0xf')),'allowNull':![],'defaultValue':_0x4533('0xe')},'sendMail':{'type':Sequelize[_0x4533('0x3')],'defaultValue':![]},'email':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4533('0x10')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize[_0x4533('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 8925e9e..0c4fa38 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 _0x9736=['options','count','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','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','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','then','destroy','get','Scheduler','UserProfileResource','end','stack','name','send','index','Schedule','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','VIRTUAL','filter','merge'];(function(_0x54dea0,_0x56f6bd){var _0x3f8f95=function(_0x5a555b){while(--_0x5a555b){_0x54dea0['push'](_0x54dea0['shift']());}};_0x3f8f95(++_0x56f6bd);}(_0x9736,0x69));var _0x6973=function(_0x57267d,_0x44976d){_0x57267d=_0x57267d-0x0;var _0x2cab22=_0x9736[_0x57267d];return _0x2cab22;};'use strict';var pdf=require(_0x6973('0x0'));var emlformat=require(_0x6973('0x1'));var rimraf=require(_0x6973('0x2'));var zipdir=require(_0x6973('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6973('0x4'));var moment=require(_0x6973('0x5'));var BPromise=require(_0x6973('0x6'));var Mustache=require(_0x6973('0x7'));var util=require(_0x6973('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x6973('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x6973('0xa'));var squel=require(_0x6973('0xb'));var crypto=require(_0x6973('0xc'));var jsforce=require(_0x6973('0xd'));var deskjs=require(_0x6973('0xe'));var toCsv=require(_0x6973('0x9'));var querystring=require('querystring');var Papa=require(_0x6973('0xf'));var Redis=require('ioredis');var authService=require(_0x6973('0x10'));var qs=require(_0x6973('0x11'));var as=require(_0x6973('0x12'));var hardwareService=require(_0x6973('0x13'));var logger=require(_0x6973('0x14'))(_0x6973('0x15'));var utils=require(_0x6973('0x16'));var config=require(_0x6973('0x17'));var db=require(_0x6973('0x18'))['db'];function respondWithStatusCode(_0x1c952c,_0x27b2b9){_0x27b2b9=_0x27b2b9||0xcc;return function(_0x594882){if(_0x594882){return _0x1c952c[_0x6973('0x19')](_0x27b2b9);}return _0x1c952c['status'](_0x27b2b9)['end']();};}function respondWithResult(_0x41263d,_0x28dab7){_0x28dab7=_0x28dab7||0xc8;return function(_0x588255){if(_0x588255){return _0x41263d[_0x6973('0x1a')](_0x28dab7)[_0x6973('0x1b')](_0x588255);}};}function respondWithFilteredResult(_0x2385a2,_0x798111){return function(_0x4b96dd){if(_0x4b96dd){var _0x1cfde5=_0x4b96dd['count'],_0x42c21d=_0x798111[_0x6973('0x1c')],_0x3ce7e7=_0x798111[_0x6973('0x1c')]+_0x798111['limit'],_0x1261b9;if(_0x3ce7e7>=_0x1cfde5){_0x3ce7e7=_0x1cfde5;_0x1261b9=0xc8;}else{_0x1261b9=0xce;}_0x2385a2['status'](_0x1261b9);return _0x2385a2[_0x6973('0x1d')](_0x6973('0x1e'),_0x42c21d+'-'+_0x3ce7e7+'/'+_0x1cfde5)[_0x6973('0x1b')](_0x4b96dd);}return null;};}function patchUpdates(_0x1b1b63){return function(_0x1b4c54){try{jsonpatch[_0x6973('0x1f')](_0x1b4c54,_0x1b1b63,!![]);}catch(_0x228485){return BPromise[_0x6973('0x20')](_0x228485);}return _0x1b4c54[_0x6973('0x21')]();};}function saveUpdates(_0x463962,_0x2b5173){return function(_0x5abaad){if(_0x5abaad){return _0x5abaad['update'](_0x463962)[_0x6973('0x22')](function(_0x14ff77){return _0x14ff77;});}return null;};}function removeEntity(_0x25b73f,_0x4aed31){return function(_0x5f5b29){if(_0x5f5b29){return _0x5f5b29[_0x6973('0x23')]()[_0x6973('0x22')](function(){var _0x2c5bca=_0x5f5b29[_0x6973('0x24')]({'plain':!![]});var _0x561459=_0x6973('0x25');return db[_0x6973('0x26')][_0x6973('0x23')]({'where':{'type':_0x561459,'resourceId':_0x2c5bca['id']}})[_0x6973('0x22')](function(){return _0x5f5b29;});})[_0x6973('0x22')](function(){_0x25b73f[_0x6973('0x1a')](0xcc)[_0x6973('0x27')]();});}};}function handleEntityNotFound(_0x4f7e9b,_0x12e76b){return function(_0x4594fd){if(!_0x4594fd){_0x4f7e9b[_0x6973('0x19')](0x194);}return _0x4594fd;};}function handleError(_0x347d61,_0x48a245){_0x48a245=_0x48a245||0x1f4;return function(_0x2b6aa8){logger['error'](_0x2b6aa8[_0x6973('0x28')]);if(_0x2b6aa8[_0x6973('0x29')]){delete _0x2b6aa8[_0x6973('0x29')];}_0x347d61[_0x6973('0x1a')](_0x48a245)[_0x6973('0x2a')](_0x2b6aa8);};}exports[_0x6973('0x2b')]=function(_0x342547,_0x377eb4){var _0x48ee30={},_0x49a0f2={},_0x139073={'count':0x0,'rows':[]};var _0x510260=_['map'](db[_0x6973('0x2c')][_0x6973('0x2d')],function(_0x15a7a2){return{'name':_0x15a7a2[_0x6973('0x2e')],'type':_0x15a7a2[_0x6973('0x2f')]['key']};});_0x49a0f2[_0x6973('0x30')]=_[_0x6973('0x31')](_0x510260,_0x6973('0x29'));_0x49a0f2[_0x6973('0x32')]=_[_0x6973('0x33')](_0x342547[_0x6973('0x32')]);_0x49a0f2[_0x6973('0x34')]=_[_0x6973('0x35')](_0x49a0f2[_0x6973('0x30')],_0x49a0f2[_0x6973('0x32')]);_0x48ee30[_0x6973('0x36')]=_[_0x6973('0x35')](_0x49a0f2[_0x6973('0x30')],qs[_0x6973('0x37')](_0x342547['query']['fields']));_0x48ee30[_0x6973('0x36')]=_0x48ee30['attributes'][_0x6973('0x38')]?_0x48ee30[_0x6973('0x36')]:_0x49a0f2[_0x6973('0x30')];if(!_0x342547[_0x6973('0x32')][_0x6973('0x39')]('nolimit')){_0x48ee30[_0x6973('0x3a')]=qs['limit'](_0x342547[_0x6973('0x32')][_0x6973('0x3a')]);_0x48ee30['offset']=qs[_0x6973('0x1c')](_0x342547[_0x6973('0x32')][_0x6973('0x1c')]);}_0x48ee30['order']=qs[_0x6973('0x3b')](_0x342547[_0x6973('0x32')][_0x6973('0x3b')]);_0x48ee30[_0x6973('0x3c')]=qs['filters'](_[_0x6973('0x3d')](_0x342547[_0x6973('0x32')],_0x49a0f2[_0x6973('0x34')]));if(_0x342547[_0x6973('0x32')]['filter']){_0x48ee30['where']=_['merge'](_0x48ee30[_0x6973('0x3c')],{'$or':_['map'](_0x510260,function(_0x5c3795){if(_0x5c3795[_0x6973('0x2f')]!==_0x6973('0x3e')){var _0x58e430={};_0x58e430[_0x5c3795[_0x6973('0x29')]]={'$like':'%'+_0x342547[_0x6973('0x32')][_0x6973('0x3f')]+'%'};return _0x58e430;}})});}_0x48ee30=_[_0x6973('0x40')]({},_0x48ee30,_0x342547[_0x6973('0x41')]);var _0x14b687={'where':_0x48ee30[_0x6973('0x3c')]};return db[_0x6973('0x2c')]['count'](_0x14b687)[_0x6973('0x22')](function(_0x2fb37f){_0x139073[_0x6973('0x42')]=_0x2fb37f;if(_0x342547[_0x6973('0x32')][_0x6973('0x43')]){_0x48ee30[_0x6973('0x44')]=[{'all':!![]}];}return db[_0x6973('0x2c')]['findAll'](_0x48ee30);})[_0x6973('0x22')](function(_0x2c907e){_0x139073[_0x6973('0x45')]=_0x2c907e;return _0x139073;})[_0x6973('0x22')](respondWithFilteredResult(_0x377eb4,_0x48ee30))[_0x6973('0x46')](handleError(_0x377eb4,null));};exports[_0x6973('0x47')]=function(_0x3ee90d,_0x3d2746){var _0x32786f={'raw':![],'where':{'id':_0x3ee90d[_0x6973('0x48')]['id']}},_0x293e7a={};_0x293e7a[_0x6973('0x30')]=_[_0x6973('0x33')](db[_0x6973('0x2c')]['rawAttributes']);_0x293e7a[_0x6973('0x32')]=_[_0x6973('0x33')](_0x3ee90d['query']);_0x293e7a[_0x6973('0x34')]=_[_0x6973('0x35')](_0x293e7a[_0x6973('0x30')],_0x293e7a[_0x6973('0x32')]);_0x32786f[_0x6973('0x36')]=_[_0x6973('0x35')](_0x293e7a['model'],qs[_0x6973('0x37')](_0x3ee90d[_0x6973('0x32')]['fields']));_0x32786f[_0x6973('0x36')]=_0x32786f[_0x6973('0x36')][_0x6973('0x38')]?_0x32786f[_0x6973('0x36')]:_0x293e7a['model'];if(_0x3ee90d[_0x6973('0x32')][_0x6973('0x43')]){_0x32786f[_0x6973('0x44')]=[{'all':!![]}];}_0x32786f=_[_0x6973('0x40')]({},_0x32786f,_0x3ee90d['options']);return db[_0x6973('0x2c')][_0x6973('0x49')](_0x32786f)['then'](handleEntityNotFound(_0x3d2746,null))['then'](respondWithResult(_0x3d2746,null))[_0x6973('0x46')](handleError(_0x3d2746,null));};exports[_0x6973('0x4a')]=function(_0x591809,_0x231016){return db[_0x6973('0x2c')][_0x6973('0x4a')](_0x591809[_0x6973('0x4b')],{})[_0x6973('0x22')](function(_0x2f8b0b){var _0x2cb934=_0x591809['user'][_0x6973('0x24')]({'plain':!![]});if(!_0x2cb934)throw new Error(_0x6973('0x4c'));if(_0x2cb934['role']===_0x6973('0x4d')){var _0x212ecb=_0x2f8b0b[_0x6973('0x24')]({'plain':!![]});var _0x38a4ce=_0x6973('0x25');return db[_0x6973('0x4e')][_0x6973('0x49')]({'where':{'name':_0x38a4ce,'userProfileId':_0x2cb934[_0x6973('0x4f')]},'raw':!![]})[_0x6973('0x22')](function(_0x4ba5ba){if(_0x4ba5ba&&_0x4ba5ba[_0x6973('0x50')]===0x0){return db[_0x6973('0x26')]['create']({'name':_0x212ecb[_0x6973('0x29')],'resourceId':_0x212ecb['id'],'type':_0x4ba5ba[_0x6973('0x29')],'sectionId':_0x4ba5ba['id']},{})[_0x6973('0x22')](function(){return _0x2f8b0b;});}else{return _0x2f8b0b;}})['catch'](function(_0x311b53){logger[_0x6973('0x51')](_0x6973('0x52'),_0x311b53);throw _0x311b53;});}return _0x2f8b0b;})[_0x6973('0x22')](respondWithResult(_0x231016,0xc9))['catch'](handleError(_0x231016,null));};exports[_0x6973('0x53')]=function(_0x5387a8,_0x27b366){if(_0x5387a8['body']['id']){delete _0x5387a8[_0x6973('0x4b')]['id'];}return db[_0x6973('0x2c')][_0x6973('0x49')]({'where':{'id':_0x5387a8[_0x6973('0x48')]['id']}})[_0x6973('0x22')](handleEntityNotFound(_0x27b366,null))['then'](saveUpdates(_0x5387a8['body'],null))['then'](respondWithResult(_0x27b366,null))['catch'](handleError(_0x27b366,null));};exports['destroy']=function(_0x11f048,_0x2a995c){return db['Schedule'][_0x6973('0x49')]({'where':{'id':_0x11f048[_0x6973('0x48')]['id']}})[_0x6973('0x22')](handleEntityNotFound(_0x2a995c,null))[_0x6973('0x22')](removeEntity(_0x2a995c,null))['catch'](handleError(_0x2a995c,null));};exports[_0x6973('0x54')]=function(_0x724d2c,_0x40b40a,_0x58a791){var _0x3f042f=require('../../config/schedule');return db['Schedule']['find']({'where':{'id':_0x724d2c['params']['id']},'raw':!![]})[_0x6973('0x22')](handleEntityNotFound(_0x40b40a,null))[_0x6973('0x22')](function(){_0x3f042f[_0x6973('0x54')](_0x724d2c['params']['id']);})[_0x6973('0x22')](respondWithStatusCode(_0x40b40a,null))['catch'](handleError(_0x40b40a,null));}; \ No newline at end of file +var _0x98d3=['model','attributes','fields','hasOwnProperty','nolimit','sort','filter','where','merge','options','Schedule','includeAll','include','findAll','rows','catch','show','intersection','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','run','../../config/schedule','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','then','destroy','get','Scheduler','UserProfileResource','sendStatus','error','name','send','index','map','rawAttributes','fieldName','type','key','query','keys','filters'];(function(_0xcda92b,_0x278f8a){var _0x54efad=function(_0x1d11db){while(--_0x1d11db){_0xcda92b['push'](_0xcda92b['shift']());}};_0x54efad(++_0x278f8a);}(_0x98d3,0x160));var _0x398d=function(_0xa52705,_0x5c8a3f){_0xa52705=_0xa52705-0x0;var _0x3e0517=_0x98d3[_0xa52705];return _0x3e0517;};'use strict';var pdf=require(_0x398d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x398d('0x1'));var zipdir=require(_0x398d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x398d('0x3'));var moment=require('moment');var BPromise=require(_0x398d('0x4'));var Mustache=require(_0x398d('0x5'));var util=require(_0x398d('0x6'));var path=require(_0x398d('0x7'));var sox=require(_0x398d('0x8'));var csv=require('to-csv');var ejs=require(_0x398d('0x9'));var fs=require('fs');var _=require(_0x398d('0xa'));var squel=require(_0x398d('0xb'));var crypto=require('crypto');var jsforce=require(_0x398d('0xc'));var deskjs=require(_0x398d('0xd'));var toCsv=require(_0x398d('0xe'));var querystring=require(_0x398d('0xf'));var Papa=require(_0x398d('0x10'));var Redis=require(_0x398d('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x398d('0x12'));var hardwareService=require(_0x398d('0x13'));var logger=require('../../config/logger')(_0x398d('0x14'));var utils=require(_0x398d('0x15'));var config=require(_0x398d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x570541,_0x58146c){_0x58146c=_0x58146c||0xcc;return function(_0x16bfed){if(_0x16bfed){return _0x570541['sendStatus'](_0x58146c);}return _0x570541[_0x398d('0x17')](_0x58146c)[_0x398d('0x18')]();};}function respondWithResult(_0xb19b5,_0x2b8e87){_0x2b8e87=_0x2b8e87||0xc8;return function(_0x4ad0ae){if(_0x4ad0ae){return _0xb19b5[_0x398d('0x17')](_0x2b8e87)['json'](_0x4ad0ae);}};}function respondWithFilteredResult(_0x5d4696,_0x256817){return function(_0x4ff2d9){if(_0x4ff2d9){var _0x1abf1d=_0x4ff2d9[_0x398d('0x19')],_0x143b8e=_0x256817[_0x398d('0x1a')],_0x213634=_0x256817['offset']+_0x256817[_0x398d('0x1b')],_0x1bbbe0;if(_0x213634>=_0x1abf1d){_0x213634=_0x1abf1d;_0x1bbbe0=0xc8;}else{_0x1bbbe0=0xce;}_0x5d4696[_0x398d('0x17')](_0x1bbbe0);return _0x5d4696[_0x398d('0x1c')](_0x398d('0x1d'),_0x143b8e+'-'+_0x213634+'/'+_0x1abf1d)['json'](_0x4ff2d9);}return null;};}function patchUpdates(_0xac5190){return function(_0x40762c){try{jsonpatch['apply'](_0x40762c,_0xac5190,!![]);}catch(_0x213824){return BPromise['reject'](_0x213824);}return _0x40762c['save']();};}function saveUpdates(_0x9c7fde,_0x49460d){return function(_0x2ca32f){if(_0x2ca32f){return _0x2ca32f['update'](_0x9c7fde)[_0x398d('0x1e')](function(_0x14eaae){return _0x14eaae;});}return null;};}function removeEntity(_0x93bc36,_0x28f0ae){return function(_0x157ac0){if(_0x157ac0){return _0x157ac0[_0x398d('0x1f')]()[_0x398d('0x1e')](function(){var _0x1fc63f=_0x157ac0[_0x398d('0x20')]({'plain':!![]});var _0x257c02=_0x398d('0x21');return db[_0x398d('0x22')]['destroy']({'where':{'type':_0x257c02,'resourceId':_0x1fc63f['id']}})[_0x398d('0x1e')](function(){return _0x157ac0;});})['then'](function(){_0x93bc36[_0x398d('0x17')](0xcc)[_0x398d('0x18')]();});}};}function handleEntityNotFound(_0xd3a608,_0x44dc73){return function(_0x81f624){if(!_0x81f624){_0xd3a608[_0x398d('0x23')](0x194);}return _0x81f624;};}function handleError(_0x2a558d,_0x2853c7){_0x2853c7=_0x2853c7||0x1f4;return function(_0x263c51){logger[_0x398d('0x24')](_0x263c51['stack']);if(_0x263c51[_0x398d('0x25')]){delete _0x263c51[_0x398d('0x25')];}_0x2a558d['status'](_0x2853c7)[_0x398d('0x26')](_0x263c51);};}exports[_0x398d('0x27')]=function(_0x67a925,_0x485fef){var _0x3dafa7={},_0xe2dd94={},_0x2f7fbe={'count':0x0,'rows':[]};var _0x57827e=_[_0x398d('0x28')](db['Schedule'][_0x398d('0x29')],function(_0x120a0d){return{'name':_0x120a0d[_0x398d('0x2a')],'type':_0x120a0d[_0x398d('0x2b')][_0x398d('0x2c')]};});_0xe2dd94['model']=_[_0x398d('0x28')](_0x57827e,'name');_0xe2dd94[_0x398d('0x2d')]=_[_0x398d('0x2e')](_0x67a925[_0x398d('0x2d')]);_0xe2dd94[_0x398d('0x2f')]=_['intersection'](_0xe2dd94[_0x398d('0x30')],_0xe2dd94['query']);_0x3dafa7[_0x398d('0x31')]=_['intersection'](_0xe2dd94[_0x398d('0x30')],qs[_0x398d('0x32')](_0x67a925['query'][_0x398d('0x32')]));_0x3dafa7[_0x398d('0x31')]=_0x3dafa7['attributes']['length']?_0x3dafa7[_0x398d('0x31')]:_0xe2dd94[_0x398d('0x30')];if(!_0x67a925['query'][_0x398d('0x33')](_0x398d('0x34'))){_0x3dafa7[_0x398d('0x1b')]=qs['limit'](_0x67a925['query'][_0x398d('0x1b')]);_0x3dafa7[_0x398d('0x1a')]=qs[_0x398d('0x1a')](_0x67a925['query'][_0x398d('0x1a')]);}_0x3dafa7['order']=qs[_0x398d('0x35')](_0x67a925[_0x398d('0x2d')]['sort']);_0x3dafa7['where']=qs[_0x398d('0x2f')](_['pick'](_0x67a925[_0x398d('0x2d')],_0xe2dd94[_0x398d('0x2f')]));if(_0x67a925[_0x398d('0x2d')][_0x398d('0x36')]){_0x3dafa7[_0x398d('0x37')]=_[_0x398d('0x38')](_0x3dafa7[_0x398d('0x37')],{'$or':_[_0x398d('0x28')](_0x57827e,function(_0x3f2db0){if(_0x3f2db0['type']!=='VIRTUAL'){var _0x56585a={};_0x56585a[_0x3f2db0[_0x398d('0x25')]]={'$like':'%'+_0x67a925[_0x398d('0x2d')][_0x398d('0x36')]+'%'};return _0x56585a;}})});}_0x3dafa7=_[_0x398d('0x38')]({},_0x3dafa7,_0x67a925[_0x398d('0x39')]);var _0x370779={'where':_0x3dafa7[_0x398d('0x37')]};return db[_0x398d('0x3a')][_0x398d('0x19')](_0x370779)[_0x398d('0x1e')](function(_0x29856e){_0x2f7fbe['count']=_0x29856e;if(_0x67a925[_0x398d('0x2d')][_0x398d('0x3b')]){_0x3dafa7[_0x398d('0x3c')]=[{'all':!![]}];}return db['Schedule'][_0x398d('0x3d')](_0x3dafa7);})[_0x398d('0x1e')](function(_0x1e7502){_0x2f7fbe[_0x398d('0x3e')]=_0x1e7502;return _0x2f7fbe;})[_0x398d('0x1e')](respondWithFilteredResult(_0x485fef,_0x3dafa7))[_0x398d('0x3f')](handleError(_0x485fef,null));};exports[_0x398d('0x40')]=function(_0x2066f0,_0x555d42){var _0x179f2f={'raw':![],'where':{'id':_0x2066f0['params']['id']}},_0x21ea92={};_0x21ea92[_0x398d('0x30')]=_[_0x398d('0x2e')](db[_0x398d('0x3a')]['rawAttributes']);_0x21ea92[_0x398d('0x2d')]=_[_0x398d('0x2e')](_0x2066f0[_0x398d('0x2d')]);_0x21ea92[_0x398d('0x2f')]=_[_0x398d('0x41')](_0x21ea92[_0x398d('0x30')],_0x21ea92[_0x398d('0x2d')]);_0x179f2f[_0x398d('0x31')]=_[_0x398d('0x41')](_0x21ea92[_0x398d('0x30')],qs[_0x398d('0x32')](_0x2066f0[_0x398d('0x2d')][_0x398d('0x32')]));_0x179f2f[_0x398d('0x31')]=_0x179f2f['attributes'][_0x398d('0x42')]?_0x179f2f[_0x398d('0x31')]:_0x21ea92[_0x398d('0x30')];if(_0x2066f0[_0x398d('0x2d')][_0x398d('0x3b')]){_0x179f2f[_0x398d('0x3c')]=[{'all':!![]}];}_0x179f2f=_['merge']({},_0x179f2f,_0x2066f0['options']);return db[_0x398d('0x3a')][_0x398d('0x43')](_0x179f2f)[_0x398d('0x1e')](handleEntityNotFound(_0x555d42,null))['then'](respondWithResult(_0x555d42,null))[_0x398d('0x3f')](handleError(_0x555d42,null));};exports[_0x398d('0x44')]=function(_0x800d74,_0x4d278a){return db[_0x398d('0x3a')][_0x398d('0x44')](_0x800d74[_0x398d('0x45')],{})['then'](function(_0x129abd){var _0x15e510=_0x800d74[_0x398d('0x46')][_0x398d('0x20')]({'plain':!![]});if(!_0x15e510)throw new Error(_0x398d('0x47'));if(_0x15e510[_0x398d('0x48')]===_0x398d('0x46')){var _0x43ea9d=_0x129abd['get']({'plain':!![]});var _0x1d3d9a=_0x398d('0x21');return db[_0x398d('0x49')][_0x398d('0x43')]({'where':{'name':_0x1d3d9a,'userProfileId':_0x15e510[_0x398d('0x4a')]},'raw':!![]})[_0x398d('0x1e')](function(_0x107348){if(_0x107348&&_0x107348['autoAssociation']===0x0){return db[_0x398d('0x22')]['create']({'name':_0x43ea9d[_0x398d('0x25')],'resourceId':_0x43ea9d['id'],'type':_0x107348[_0x398d('0x25')],'sectionId':_0x107348['id']},{})['then'](function(){return _0x129abd;});}else{return _0x129abd;}})[_0x398d('0x3f')](function(_0x15fd95){logger[_0x398d('0x24')](_0x398d('0x4b'),_0x15fd95);throw _0x15fd95;});}return _0x129abd;})[_0x398d('0x1e')](respondWithResult(_0x4d278a,0xc9))[_0x398d('0x3f')](handleError(_0x4d278a,null));};exports[_0x398d('0x4c')]=function(_0x23db6a,_0x4e166f){if(_0x23db6a[_0x398d('0x45')]['id']){delete _0x23db6a[_0x398d('0x45')]['id'];}return db[_0x398d('0x3a')][_0x398d('0x43')]({'where':{'id':_0x23db6a[_0x398d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e166f,null))[_0x398d('0x1e')](saveUpdates(_0x23db6a[_0x398d('0x45')],null))[_0x398d('0x1e')](respondWithResult(_0x4e166f,null))['catch'](handleError(_0x4e166f,null));};exports[_0x398d('0x1f')]=function(_0x4e1499,_0x435a77){return db[_0x398d('0x3a')][_0x398d('0x43')]({'where':{'id':_0x4e1499[_0x398d('0x4d')]['id']}})[_0x398d('0x1e')](handleEntityNotFound(_0x435a77,null))['then'](removeEntity(_0x435a77,null))[_0x398d('0x3f')](handleError(_0x435a77,null));};exports[_0x398d('0x4e')]=function(_0x3e066e,_0x1ac218,_0xa572af){var _0x537e89=require(_0x398d('0x4f'));return db[_0x398d('0x3a')][_0x398d('0x43')]({'where':{'id':_0x3e066e[_0x398d('0x4d')]['id']},'raw':!![]})[_0x398d('0x1e')](handleEntityNotFound(_0x1ac218,null))[_0x398d('0x1e')](function(){_0x537e89[_0x398d('0x4e')](_0x3e066e[_0x398d('0x4d')]['id']);})[_0x398d('0x1e')](respondWithStatusCode(_0x1ac218,null))[_0x398d('0x3f')](handleError(_0x1ac218,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index c578f3c..901b307 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 _0x05f8=['api','moment','bluebird','path','../../config/environment','./schedule.attributes','Schedule','lodash','util'];(function(_0x46b8aa,_0x246d21){var _0x5a3d61=function(_0x5c748d){while(--_0x5c748d){_0x46b8aa['push'](_0x46b8aa['shift']());}};_0x5a3d61(++_0x246d21);}(_0x05f8,0xd6));var _0x805f=function(_0x5639b5,_0x41c327){_0x5639b5=_0x5639b5-0x0;var _0x2ba481=_0x05f8[_0x5639b5];return _0x2ba481;};'use strict';var _=require(_0x805f('0x0'));var util=require(_0x805f('0x1'));var logger=require('../../config/logger')(_0x805f('0x2'));var moment=require(_0x805f('0x3'));var BPromise=require(_0x805f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x805f('0x5'));var rimraf=require('rimraf');var config=require(_0x805f('0x6'));var attributes=require(_0x805f('0x7'));module['exports']=function(_0x6ee325,_0x3c6e6c){return _0x6ee325['define'](_0x805f('0x8'),attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1f3a=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','Schedule','tools_schedules','lodash','util','../../config/logger','api','moment'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x1f3a,0x1bb));var _0xa1f3=function(_0x4bf8ae,_0x148e7a){_0x4bf8ae=_0x4bf8ae-0x0;var _0x4671a3=_0x1f3a[_0x4bf8ae];return _0x4671a3;};'use strict';var _=require(_0xa1f3('0x0'));var util=require(_0xa1f3('0x1'));var logger=require(_0xa1f3('0x2'))(_0xa1f3('0x3'));var moment=require(_0xa1f3('0x4'));var BPromise=require(_0xa1f3('0x5'));var rp=require(_0xa1f3('0x6'));var fs=require('fs');var path=require(_0xa1f3('0x7'));var rimraf=require(_0xa1f3('0x8'));var config=require(_0xa1f3('0x9'));var attributes=require(_0xa1f3('0xa'));module[_0xa1f3('0xb')]=function(_0xe64608,_0x5a93c9){return _0xe64608['define'](_0xa1f3('0xc'),attributes,{'tableName':_0xa1f3('0xd'),'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 ecf9db1..78d9bf7 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 _0x67a8=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','Schedule,\x20%s,\x20%s','debug','Schedule,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','moment'];(function(_0x3c1f5f,_0x1960e3){var _0x2f714f=function(_0x41cfdb){while(--_0x41cfdb){_0x3c1f5f['push'](_0x3c1f5f['shift']());}};_0x2f714f(++_0x1960e3);}(_0x67a8,0x92));var _0x867a=function(_0x4ea79e,_0x3d61a3){_0x4ea79e=_0x4ea79e-0x0;var _0x4ce2bf=_0x67a8[_0x4ea79e];return _0x4ce2bf;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x867a('0x0'));var BPromise=require(_0x867a('0x1'));var rs=require(_0x867a('0x2'));var fs=require('fs');var Redis=require(_0x867a('0x3'));var db=require(_0x867a('0x4'))['db'];var utils=require(_0x867a('0x5'));var logger=require('../../config/logger')(_0x867a('0x6'));var config=require(_0x867a('0x7'));var jayson=require(_0x867a('0x8'));var client=jayson[_0x867a('0x9')][_0x867a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x13ca93,_0x5b4e16,_0x2a5357){return new BPromise(function(_0x5c8c0d,_0x63aba3){return client[_0x867a('0xb')](_0x13ca93,_0x2a5357)['then'](function(_0xa8a8ea){logger[_0x867a('0xc')](_0x867a('0xd'),_0x5b4e16,'request\x20sent');logger[_0x867a('0xe')](_0x867a('0xf'),_0x5b4e16,'request\x20sent',JSON['stringify'](_0xa8a8ea));if(_0xa8a8ea['error']){if(_0xa8a8ea['error'][_0x867a('0x10')]===0x1f4){logger['error'](_0x867a('0xd'),_0x5b4e16,_0xa8a8ea['error'][_0x867a('0x11')]);return _0x63aba3(_0xa8a8ea[_0x867a('0x12')][_0x867a('0x11')]);}logger[_0x867a('0x12')]('Schedule,\x20%s,\x20%s',_0x5b4e16,_0xa8a8ea[_0x867a('0x12')][_0x867a('0x11')]);return _0x5c8c0d(_0xa8a8ea[_0x867a('0x12')]['message']);}else{logger[_0x867a('0xc')]('Schedule,\x20%s,\x20%s',_0x5b4e16,'request\x20sent');_0x5c8c0d(_0xa8a8ea[_0x867a('0x13')]['message']);}})[_0x867a('0x14')](function(_0x19d59a){logger[_0x867a('0x12')](_0x867a('0xd'),_0x5b4e16,_0x19d59a);_0x63aba3(_0x19d59a);});});} \ No newline at end of file +var _0x6673=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','error','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x26e13f,_0x55caed){var _0x1cde37=function(_0x2277bc){while(--_0x2277bc){_0x26e13f['push'](_0x26e13f['shift']());}};_0x1cde37(++_0x55caed);}(_0x6673,0x14f));var _0x3667=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x6673[_0x2dea24];return _0x309d58;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3667('0x0'));var BPromise=require(_0x3667('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3667('0x2'));var db=require(_0x3667('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x3667('0x4'))(_0x3667('0x5'));var config=require(_0x3667('0x6'));var jayson=require(_0x3667('0x7'));var client=jayson[_0x3667('0x8')][_0x3667('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3341ad,_0x491813,_0x482427){return new BPromise(function(_0x1f7b1c,_0x7c88d7){return client[_0x3667('0xa')](_0x3341ad,_0x482427)[_0x3667('0xb')](function(_0x23ad33){logger[_0x3667('0xc')](_0x3667('0xd'),_0x491813,_0x3667('0xe'));logger[_0x3667('0xf')]('Schedule,\x20%s,\x20%s,\x20%s',_0x491813,_0x3667('0xe'),JSON['stringify'](_0x23ad33));if(_0x23ad33[_0x3667('0x10')]){if(_0x23ad33[_0x3667('0x10')]['code']===0x1f4){logger['error']('Schedule,\x20%s,\x20%s',_0x491813,_0x23ad33[_0x3667('0x10')][_0x3667('0x11')]);return _0x7c88d7(_0x23ad33[_0x3667('0x10')][_0x3667('0x11')]);}logger['error'](_0x3667('0xd'),_0x491813,_0x23ad33[_0x3667('0x10')][_0x3667('0x11')]);return _0x1f7b1c(_0x23ad33['error']['message']);}else{logger[_0x3667('0xc')](_0x3667('0xd'),_0x491813,_0x3667('0xe'));_0x1f7b1c(_0x23ad33[_0x3667('0x12')][_0x3667('0x11')]);}})[_0x3667('0x13')](function(_0x866e77){logger[_0x3667('0x10')](_0x3667('0xd'),_0x491813,_0x866e77);_0x7c88d7(_0x866e77);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index c64068a..b60cb76 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 _0x4cd7=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','show','/:id/download','download','create','update','/:id'];(function(_0x4e22c7,_0x5224a0){var _0x3c0b3b=function(_0x430b76){while(--_0x430b76){_0x4e22c7['push'](_0x4e22c7['shift']());}};_0x3c0b3b(++_0x5224a0);}(_0x4cd7,0x6b));var _0x74cd=function(_0x3dea45,_0x30dbd6){_0x3dea45=_0x3dea45-0x0;var _0xfc2f5f=_0x4cd7[_0x3dea45];return _0xfc2f5f;};'use strict';var multer=require(_0x74cd('0x0'));var util=require(_0x74cd('0x1'));var path=require(_0x74cd('0x2'));var timeout=require(_0x74cd('0x3'));var express=require(_0x74cd('0x4'));var router=express[_0x74cd('0x5')]();var auth=require(_0x74cd('0x6'));var interaction=require(_0x74cd('0x7'));var config=require(_0x74cd('0x8'));var controller=require('./screenRecording.controller');router[_0x74cd('0x9')]('/',auth[_0x74cd('0xa')](),controller[_0x74cd('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x74cd('0xc')]);router[_0x74cd('0x9')]('/:id',auth[_0x74cd('0xa')](),controller[_0x74cd('0xd')]);router[_0x74cd('0x9')](_0x74cd('0xe'),auth[_0x74cd('0xa')](),controller[_0x74cd('0xf')]);router['post']('/',auth[_0x74cd('0xa')](),controller[_0x74cd('0x10')]);router['put']('/:id',auth[_0x74cd('0xa')](),controller[_0x74cd('0x11')]);router['delete'](_0x74cd('0x12'),auth[_0x74cd('0xa')](),controller[_0x74cd('0x13')]);module[_0x74cd('0x14')]=router; \ No newline at end of file +var _0xbecc=['index','get','/describe','describe','/:id','show','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xbecc,0x116));var _0xcbec=function(_0x41b9bf,_0x3c9b67){_0x41b9bf=_0x41b9bf-0x0;var _0x5a8415=_0xbecc[_0x41b9bf];return _0x5a8415;};'use strict';var multer=require(_0xcbec('0x0'));var util=require(_0xcbec('0x1'));var path=require(_0xcbec('0x2'));var timeout=require(_0xcbec('0x3'));var express=require(_0xcbec('0x4'));var router=express[_0xcbec('0x5')]();var auth=require(_0xcbec('0x6'));var interaction=require(_0xcbec('0x7'));var config=require(_0xcbec('0x8'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0xcbec('0x9')](),controller[_0xcbec('0xa')]);router[_0xcbec('0xb')](_0xcbec('0xc'),auth[_0xcbec('0x9')](),controller[_0xcbec('0xd')]);router[_0xcbec('0xb')](_0xcbec('0xe'),auth[_0xcbec('0x9')](),controller[_0xcbec('0xf')]);router[_0xcbec('0xb')]('/:id/download',auth[_0xcbec('0x9')](),controller[_0xcbec('0x10')]);router[_0xcbec('0x11')]('/',auth[_0xcbec('0x9')](),controller[_0xcbec('0x12')]);router[_0xcbec('0x13')](_0xcbec('0xe'),auth[_0xcbec('0x9')](),controller[_0xcbec('0x14')]);router[_0xcbec('0x15')](_0xcbec('0xe'),auth[_0xcbec('0x9')](),controller[_0xcbec('0x16')]);module[_0xcbec('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 056b328..629c8c6 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 _0xf2ca=['format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE'];(function(_0x4ce4ae,_0x327b0c){var _0x3ca28e=function(_0x2e1031){while(--_0x2e1031){_0x4ce4ae['push'](_0x4ce4ae['shift']());}};_0x3ca28e(++_0x327b0c);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x5c1b05,_0x213768){_0x5c1b05=_0x5c1b05-0x0;var _0x1a65e7=_0xf2ca[_0x5c1b05];return _0x1a65e7;};'use strict';var Sequelize=require(_0xaf2c('0x0'));var moment=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var config=require('../../config/environment');module[_0xaf2c('0x3')]={'format':{'type':Sequelize[_0xaf2c('0x4')],'get':function(){return this[_0xaf2c('0x5')](_0xaf2c('0x6'))?path[_0xaf2c('0x7')](this[_0xaf2c('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize[_0xaf2c('0x8')]},'channel':{'type':Sequelize[_0xaf2c('0x8')]},'value':{'type':Sequelize[_0xaf2c('0x8')],'set':function(_0x1f9531){var _0x58351f=_0x1f9531[_0xaf2c('0x9')](/\\/g,'/');this[_0xaf2c('0xa')]('value',_0x58351f);}},'rating':{'type':Sequelize[_0xaf2c('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x439ca3){this['setDataValue'](_0xaf2c('0xc'),moment()[_0xaf2c('0xd')](_0x439ca3,'ms'));this[_0xaf2c('0xa')](_0xaf2c('0xe'),moment());this['setDataValue']('duration',_0x439ca3);}},'startedAt':{'type':Sequelize[_0xaf2c('0xf')],'get':function(){return moment(this[_0xaf2c('0x5')](_0xaf2c('0xc')))[_0xaf2c('0x10')](_0xaf2c('0x11'))['toString']();}},'closedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xaf2c('0x5')](_0xaf2c('0xe')))[_0xaf2c('0x10')](_0xaf2c('0x11'))[_0xaf2c('0x12')]();}},'createdAt':{'type':Sequelize[_0xaf2c('0xf')],'get':function(){return moment(this[_0xaf2c('0x5')](_0xaf2c('0x13')))[_0xaf2c('0x10')](_0xaf2c('0x11'))[_0xaf2c('0x12')]();}},'updatedAt':{'type':Sequelize[_0xaf2c('0xf')],'get':function(){return moment(this[_0xaf2c('0x5')](_0xaf2c('0x14')))[_0xaf2c('0x10')]('MM-DD-YYYY\x20HH:mm')[_0xaf2c('0x12')]();}}}; \ No newline at end of file +var _0x207c=['createdAt','updatedAt','moment','path','../../config/environment','exports','VIRTUAL','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','closedAt','format','MM-DD-YYYY\x20HH:mm','DATE'];(function(_0x24495f,_0x33da59){var _0x4b7571=function(_0x3b1dcd){while(--_0x3b1dcd){_0x24495f['push'](_0x24495f['shift']());}};_0x4b7571(++_0x33da59);}(_0x207c,0x1e8));var _0xc207=function(_0x5b1fe6,_0x5678f8){_0x5b1fe6=_0x5b1fe6-0x0;var _0x37db41=_0x207c[_0x5b1fe6];return _0x37db41;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xc207('0x0'));var path=require(_0xc207('0x1'));var config=require(_0xc207('0x2'));module[_0xc207('0x3')]={'format':{'type':Sequelize[_0xc207('0x4')],'get':function(){return this[_0xc207('0x5')](_0xc207('0x6'))?path['extname'](this[_0xc207('0x5')]('value')):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0xc207('0x7')],'set':function(_0x314561){var _0x3395e4=_0x314561['replace'](/\\/g,'/');this[_0xc207('0x8')](_0xc207('0x6'),_0x3395e4);}},'rating':{'type':Sequelize[_0xc207('0x9')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0xffae6c){this[_0xc207('0x8')](_0xc207('0xa'),moment()[_0xc207('0xb')](_0xffae6c,'ms'));this[_0xc207('0x8')](_0xc207('0xc'),moment());this['setDataValue']('duration',_0xffae6c);}},'startedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc207('0x5')]('startedAt'))[_0xc207('0xd')](_0xc207('0xe'))['toString']();}},'closedAt':{'type':Sequelize[_0xc207('0xf')],'get':function(){return moment(this[_0xc207('0x5')](_0xc207('0xc')))[_0xc207('0xd')](_0xc207('0xe'))['toString']();}},'createdAt':{'type':Sequelize[_0xc207('0xf')],'get':function(){return moment(this[_0xc207('0x5')](_0xc207('0x10')))[_0xc207('0xd')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc207('0x5')](_0xc207('0x11')))[_0xc207('0xd')](_0xc207('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 968838e..1234a85 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 _0xd041=['model','differenceBy','format','keys','intersection','attributes','fields','query','length','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','ScreenRecording','includeAll','findAll','rows','catch','show','rawAttributes','include','find','create','body','createdAt','closedAt','value','params','describe','download','uniqueid','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','recording','join','ValidationError','filename','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','destroy','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','existsSync','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','Content-Range','apply','reject','save','then','sendStatus','error','stack','name','send','index','map','fieldName','type','key'];(function(_0x103cee,_0x48dc79){var _0x230f37=function(_0x6df499){while(--_0x6df499){_0x103cee['push'](_0x103cee['shift']());}};_0x230f37(++_0x48dc79);}(_0xd041,0x1e9));var _0x1d04=function(_0x1e4e1a,_0x3bdb4a){_0x1e4e1a=_0x1e4e1a-0x0;var _0x462e08=_0xd041[_0x1e4e1a];return _0x462e08;};'use strict';var pdf=require(_0x1d04('0x0'));var emlformat=require(_0x1d04('0x1'));var rimraf=require(_0x1d04('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d04('0x3'));var rp=require(_0x1d04('0x4'));var moment=require(_0x1d04('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1d04('0x6'));var util=require(_0x1d04('0x7'));var path=require('path');var sox=require(_0x1d04('0x8'));var csv=require(_0x1d04('0x9'));var ejs=require(_0x1d04('0xa'));var fs=require('fs');var _=require(_0x1d04('0xb'));var squel=require(_0x1d04('0xc'));var crypto=require(_0x1d04('0xd'));var jsforce=require(_0x1d04('0xe'));var deskjs=require(_0x1d04('0xf'));var toCsv=require(_0x1d04('0x9'));var querystring=require(_0x1d04('0x10'));var Papa=require('papaparse');var Redis=require(_0x1d04('0x11'));var authService=require(_0x1d04('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x1d04('0x13'));var hardwareService=require(_0x1d04('0x14'));var logger=require(_0x1d04('0x15'))(_0x1d04('0x16'));var utils=require(_0x1d04('0x17'));var config=require(_0x1d04('0x18'));var db=require(_0x1d04('0x19'))['db'];function respondWithStatusCode(_0x377585,_0xd4bbee){_0xd4bbee=_0xd4bbee||0xcc;return function(_0x33657f){if(_0x33657f){return _0x377585['sendStatus'](_0xd4bbee);}return _0x377585['status'](_0xd4bbee)[_0x1d04('0x1a')]();};}function respondWithResult(_0x2f140f,_0x156d7b){_0x156d7b=_0x156d7b||0xc8;return function(_0x42f9b2){if(_0x42f9b2){return _0x2f140f[_0x1d04('0x1b')](_0x156d7b)[_0x1d04('0x1c')](_0x42f9b2);}};}function respondWithFilteredResult(_0x57f419,_0x5d72a8){return function(_0x4144c3){if(_0x4144c3){var _0x40296f=_0x4144c3[_0x1d04('0x1d')],_0x45bb9e=_0x5d72a8[_0x1d04('0x1e')],_0x1459be=_0x5d72a8[_0x1d04('0x1e')]+_0x5d72a8['limit'],_0x2adc4c;if(_0x1459be>=_0x40296f){_0x1459be=_0x40296f;_0x2adc4c=0xc8;}else{_0x2adc4c=0xce;}_0x57f419[_0x1d04('0x1b')](_0x2adc4c);return _0x57f419['set'](_0x1d04('0x1f'),_0x45bb9e+'-'+_0x1459be+'/'+_0x40296f)[_0x1d04('0x1c')](_0x4144c3);}return null;};}function patchUpdates(_0x2175ea){return function(_0x410d9a){try{jsonpatch[_0x1d04('0x20')](_0x410d9a,_0x2175ea,!![]);}catch(_0x43fc38){return BPromise[_0x1d04('0x21')](_0x43fc38);}return _0x410d9a[_0x1d04('0x22')]();};}function saveUpdates(_0x1563dc,_0x539f0){return function(_0xcfb4b){if(_0xcfb4b){return _0xcfb4b['update'](_0x1563dc)[_0x1d04('0x23')](function(_0x1aec47){return _0x1aec47;});}return null;};}function removeEntity(_0x33ca6b,_0x2806f8){return function(_0x32590d){if(_0x32590d){return _0x32590d['destroy']()[_0x1d04('0x23')](function(){_0x33ca6b[_0x1d04('0x1b')](0xcc)[_0x1d04('0x1a')]();});}};}function handleEntityNotFound(_0x31793e,_0x2ad191){return function(_0x4eafcc){if(!_0x4eafcc){_0x31793e[_0x1d04('0x24')](0x194);}return _0x4eafcc;};}function handleError(_0x36bfd5,_0xfcc5e3){_0xfcc5e3=_0xfcc5e3||0x1f4;return function(_0x41fdae){logger[_0x1d04('0x25')](_0x41fdae[_0x1d04('0x26')]);if(_0x41fdae[_0x1d04('0x27')]){delete _0x41fdae[_0x1d04('0x27')];}_0x36bfd5[_0x1d04('0x1b')](_0xfcc5e3)[_0x1d04('0x28')](_0x41fdae);};}exports[_0x1d04('0x29')]=function(_0x287154,_0x557fbd){var _0x24429a={},_0x2a723d={},_0x1cd625={'count':0x0,'rows':[]};var _0x2ecf10=_[_0x1d04('0x2a')](db['ScreenRecording']['rawAttributes'],function(_0xf9c2f9){return{'name':_0xf9c2f9[_0x1d04('0x2b')],'type':_0xf9c2f9[_0x1d04('0x2c')][_0x1d04('0x2d')]};});_0x2a723d[_0x1d04('0x2e')]=_[_0x1d04('0x2f')](_['map'](_0x2ecf10,_0x1d04('0x27')),[_0x1d04('0x30')]);_0x2a723d['query']=_[_0x1d04('0x31')](_0x287154['query']);_0x2a723d['filters']=_[_0x1d04('0x32')](_0x2a723d[_0x1d04('0x2e')],_0x2a723d['query']);_0x24429a[_0x1d04('0x33')]=_['intersection'](_0x2a723d[_0x1d04('0x2e')],qs[_0x1d04('0x34')](_0x287154[_0x1d04('0x35')]['fields']));_0x24429a[_0x1d04('0x33')]=_0x24429a[_0x1d04('0x33')][_0x1d04('0x36')]?_0x24429a['attributes']:_0x2a723d['model'];if(!_0x287154[_0x1d04('0x35')]['hasOwnProperty'](_0x1d04('0x37'))){_0x24429a[_0x1d04('0x38')]=qs[_0x1d04('0x38')](_0x287154[_0x1d04('0x35')][_0x1d04('0x38')]);_0x24429a[_0x1d04('0x1e')]=qs[_0x1d04('0x1e')](_0x287154['query'][_0x1d04('0x1e')]);}_0x24429a[_0x1d04('0x39')]=qs[_0x1d04('0x3a')](_0x287154[_0x1d04('0x35')][_0x1d04('0x3a')]);_0x24429a[_0x1d04('0x3b')]=qs[_0x1d04('0x3c')](_[_0x1d04('0x3d')](_0x287154[_0x1d04('0x35')],_0x2a723d[_0x1d04('0x3c')]));if(_0x287154[_0x1d04('0x35')][_0x1d04('0x3e')]){_0x24429a[_0x1d04('0x3b')]=_[_0x1d04('0x3f')](_0x24429a[_0x1d04('0x3b')],{'$or':_[_0x1d04('0x2a')](_0x2ecf10,function(_0x5a2345){if(_0x5a2345[_0x1d04('0x2c')]!==_0x1d04('0x40')){var _0x2e2cff={};_0x2e2cff[_0x5a2345[_0x1d04('0x27')]]={'$like':'%'+_0x287154[_0x1d04('0x35')][_0x1d04('0x3e')]+'%'};return _0x2e2cff;}})});}_0x24429a=_[_0x1d04('0x3f')]({},_0x24429a,_0x287154[_0x1d04('0x41')]);var _0x59b30e={'where':_0x24429a[_0x1d04('0x3b')]};return db[_0x1d04('0x42')][_0x1d04('0x1d')](_0x59b30e)[_0x1d04('0x23')](function(_0x4e3e4d){_0x1cd625[_0x1d04('0x1d')]=_0x4e3e4d;if(_0x287154[_0x1d04('0x35')][_0x1d04('0x43')]){_0x24429a['include']=[{'all':!![]}];}return db[_0x1d04('0x42')][_0x1d04('0x44')](_0x24429a);})[_0x1d04('0x23')](function(_0xec5f3b){_0x1cd625[_0x1d04('0x45')]=_0xec5f3b;return _0x1cd625;})[_0x1d04('0x23')](respondWithFilteredResult(_0x557fbd,_0x24429a))[_0x1d04('0x46')](handleError(_0x557fbd,null));};exports[_0x1d04('0x47')]=function(_0xd25fe8,_0x2007ef){var _0x516e09={'raw':![],'where':{'id':_0xd25fe8['params']['id']}},_0x2449a5={};_0x2449a5[_0x1d04('0x2e')]=_['keys'](db[_0x1d04('0x42')][_0x1d04('0x48')]);_0x2449a5['query']=_[_0x1d04('0x31')](_0xd25fe8[_0x1d04('0x35')]);_0x2449a5[_0x1d04('0x3c')]=_['intersection'](_0x2449a5[_0x1d04('0x2e')],_0x2449a5[_0x1d04('0x35')]);_0x516e09[_0x1d04('0x33')]=_[_0x1d04('0x32')](_0x2449a5[_0x1d04('0x2e')],qs[_0x1d04('0x34')](_0xd25fe8['query'][_0x1d04('0x34')]));_0x516e09[_0x1d04('0x33')]=_0x516e09[_0x1d04('0x33')]['length']?_0x516e09[_0x1d04('0x33')]:_0x2449a5['model'];if(_0xd25fe8[_0x1d04('0x35')]['includeAll']){_0x516e09[_0x1d04('0x49')]=[{'all':!![]}];}_0x516e09=_[_0x1d04('0x3f')]({},_0x516e09,_0xd25fe8[_0x1d04('0x41')]);return db[_0x1d04('0x42')][_0x1d04('0x4a')](_0x516e09)[_0x1d04('0x23')](handleEntityNotFound(_0x2007ef,null))['then'](respondWithResult(_0x2007ef,null))[_0x1d04('0x46')](handleError(_0x2007ef,null));};exports[_0x1d04('0x4b')]=function(_0x145d14,_0x13fcae){return db[_0x1d04('0x42')][_0x1d04('0x4b')](_0x145d14[_0x1d04('0x4c')],{})[_0x1d04('0x23')](respondWithResult(_0x13fcae,0xc9))[_0x1d04('0x46')](handleError(_0x13fcae,null));};exports['update']=function(_0x535ec9,_0x1f4521){if(_0x535ec9[_0x1d04('0x4c')]['id']){delete _0x535ec9[_0x1d04('0x4c')]['id'];}delete _0x535ec9['body']['duration'];delete _0x535ec9[_0x1d04('0x4c')][_0x1d04('0x4d')];delete _0x535ec9[_0x1d04('0x4c')][_0x1d04('0x4e')];delete _0x535ec9[_0x1d04('0x4c')][_0x1d04('0x4f')];return db[_0x1d04('0x42')][_0x1d04('0x4a')]({'where':{'id':_0x535ec9[_0x1d04('0x50')]['id']}})['then'](handleEntityNotFound(_0x1f4521,null))[_0x1d04('0x23')](saveUpdates(_0x535ec9[_0x1d04('0x4c')],null))['then'](respondWithResult(_0x1f4521,null))[_0x1d04('0x46')](handleError(_0x1f4521,null));};exports[_0x1d04('0x51')]=function(_0x71568b,_0x1918cf){return db[_0x1d04('0x42')][_0x1d04('0x51')]()[_0x1d04('0x23')](respondWithResult(_0x1918cf,null))[_0x1d04('0x46')](handleError(_0x1918cf,null));};exports[_0x1d04('0x52')]=function(_0x7acf71,_0x32eb20,_0x1ac1c6){var _0x415b97=require('../../components/encryptor');var _0x5b3b3f=![];var _0x3dbcdf={};if(_0x7acf71[_0x1d04('0x35')][_0x1d04('0x2c')]&&_0x7acf71['query']['type']==='uniqueid'){_0x3dbcdf[_0x1d04('0x53')]=_0x7acf71[_0x1d04('0x50')]['id'];}else{_0x3dbcdf['id']=_0x7acf71[_0x1d04('0x50')]['id'];}return db['ScreenRecording'][_0x1d04('0x4a')]({'where':_0x3dbcdf,'attributes':['id',_0x1d04('0x4f')],'raw':!![]})[_0x1d04('0x23')](handleEntityNotFound(_0x32eb20,null))[_0x1d04('0x23')](function(_0x41bbb6){if(_0x41bbb6){var _0x4e8e15=path['join'](config[_0x1d04('0x54')],_0x1d04('0x55'),_0x41bbb6[_0x1d04('0x4f')]);var _0x49a7a4=util[_0x1d04('0x30')](_0x1d04('0x56'),_0x4e8e15);if(fs['existsSync'](_0x49a7a4)){_0x5b3b3f=!![];return _0x415b97[_0x1d04('0x57')](_0x49a7a4,_0x4e8e15,config[_0x1d04('0x58')][_0x1d04('0x59')])[_0x1d04('0x23')](function(){return _0x41bbb6;});}return _0x41bbb6;}})[_0x1d04('0x23')](function(_0xdf1dab){if(_0xdf1dab){var _0x3bccd8=path[_0x1d04('0x5a')](config['root'],'server/files/screen_recordings',_0xdf1dab[_0x1d04('0x4f')]);if(!fs['existsSync'](_0x3bccd8)){throw new db['Sequelize'][(_0x1d04('0x5b'))]('ScreenRecording\x20not\x20found');}if(_0xdf1dab[_0x1d04('0x5c')]){return _0x32eb20[_0x1d04('0x52')](_0x3bccd8,_0xdf1dab[_0x1d04('0x5c')]+path[_0x1d04('0x5d')](_0x3bccd8),function(){if(_0x5b3b3f){fs[_0x1d04('0x5e')](_0x3bccd8);}});}else{return _0x32eb20[_0x1d04('0x52')](_0x3bccd8,function(_0xebdcfa){if(_0x5b3b3f){fs[_0x1d04('0x5e')](_0x3bccd8);}});}}})['catch'](function(_0x23398b){if(_0x23398b[_0x1d04('0x5f')]===_0x1d04('0x60')){_0x32eb20[_0x1d04('0x1b')](0x194)[_0x1d04('0x28')](_0x1d04('0x61'));}else{return handleError(_0x32eb20,null);}});};exports[_0x1d04('0x62')]=function(_0xb56fee,_0x5a4092){return db[_0x1d04('0x42')][_0x1d04('0x4a')]({'where':{'id':_0xb56fee[_0x1d04('0x50')]['id']}})[_0x1d04('0x23')](function(_0x51899f){if(!_0x51899f)throw new ReferenceError(_0x1d04('0x63'));return _0x51899f;})['then'](function(_0x2f7c64){var _0x2cf33e=path['join'](config[_0x1d04('0x54')],_0x1d04('0x55'),_0x2f7c64[_0x1d04('0x4f')]);logger[_0x1d04('0x64')](_0x1d04('0x65'),_0x2cf33e);if(!_[_0x1d04('0x66')](_0x2f7c64[_0x1d04('0x4f')])&&fs[_0x1d04('0x67')](_0x2cf33e)){logger['info'](_0x1d04('0x68')+_0x2cf33e+_0x1d04('0x69'));fs[_0x1d04('0x6a')](_0x2cf33e);}_0x2cf33e=_0x2cf33e+'.cypher';if(!_[_0x1d04('0x66')](_0x2f7c64[_0x1d04('0x4f')])&&fs['existsSync'](_0x2cf33e)){logger[_0x1d04('0x64')](_0x1d04('0x68')+_0x2cf33e+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x2cf33e);}return _0x2f7c64;})[_0x1d04('0x23')](function(_0x527934){if(!_0x527934)throw new InternalError();return _0x527934[_0x1d04('0x62')]();})[_0x1d04('0x23')](function(){_0x5a4092[_0x1d04('0x1b')](0xcc)[_0x1d04('0x1a')]();})['catch'](function(_0x3a45e5){var _0x3eeedb=0x1f4;if(e instanceof ReferenceError){_0x3eeedb=0x194;}else if(e instanceof InternalError){_0x3eeedb=0x1f4;}logger['error'](_0x3a45e5['stack']);if(_0x3a45e5[_0x1d04('0x27')]){delete _0x3a45e5[_0x1d04('0x27')];}_0x5a4092[_0x1d04('0x1b')](_0x3eeedb)[_0x1d04('0x28')](_0x3a45e5);});}; \ No newline at end of file +var _0xb6b1=['lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','ScreenRecording','fieldName','key','model','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','rows','catch','show','params','keys','create','body','duration','createdAt','closedAt','value','find','describe','../../components/encryptor','type','join','root','server/files/screen_recordings','%s.cypher','existsSync','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','.cypher','unlinkSync','end','stack','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xb6b1,0x17b));var _0x1b6b=function(_0x585ee5,_0x1c9dba){_0x585ee5=_0x585ee5-0x0;var _0x470808=_0xb6b1[_0x585ee5];return _0x470808;};'use strict';var pdf=require(_0x1b6b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1b6b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b6b('0x2'));var rp=require(_0x1b6b('0x3'));var moment=require('moment');var BPromise=require(_0x1b6b('0x4'));var Mustache=require('mustache');var util=require(_0x1b6b('0x5'));var path=require(_0x1b6b('0x6'));var sox=require(_0x1b6b('0x7'));var csv=require(_0x1b6b('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1b6b('0x9'));var squel=require('squel');var crypto=require(_0x1b6b('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x1b6b('0xb'));var toCsv=require(_0x1b6b('0x8'));var querystring=require(_0x1b6b('0xc'));var Papa=require(_0x1b6b('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1b6b('0xe'));var as=require(_0x1b6b('0xf'));var hardwareService=require(_0x1b6b('0x10'));var logger=require(_0x1b6b('0x11'))(_0x1b6b('0x12'));var utils=require(_0x1b6b('0x13'));var config=require(_0x1b6b('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x360a8b,_0x3554b5){_0x3554b5=_0x3554b5||0xcc;return function(_0xf6a4be){if(_0xf6a4be){return _0x360a8b['sendStatus'](_0x3554b5);}return _0x360a8b[_0x1b6b('0x15')](_0x3554b5)['end']();};}function respondWithResult(_0x59bc99,_0x2f540f){_0x2f540f=_0x2f540f||0xc8;return function(_0x20a2d7){if(_0x20a2d7){return _0x59bc99[_0x1b6b('0x15')](_0x2f540f)[_0x1b6b('0x16')](_0x20a2d7);}};}function respondWithFilteredResult(_0x1b9cc4,_0x268fe9){return function(_0x321263){if(_0x321263){var _0x553a6d=_0x321263[_0x1b6b('0x17')],_0x1069a4=_0x268fe9['offset'],_0x251821=_0x268fe9[_0x1b6b('0x18')]+_0x268fe9[_0x1b6b('0x19')],_0x10af08;if(_0x251821>=_0x553a6d){_0x251821=_0x553a6d;_0x10af08=0xc8;}else{_0x10af08=0xce;}_0x1b9cc4[_0x1b6b('0x15')](_0x10af08);return _0x1b9cc4['set'](_0x1b6b('0x1a'),_0x1069a4+'-'+_0x251821+'/'+_0x553a6d)[_0x1b6b('0x16')](_0x321263);}return null;};}function patchUpdates(_0x38801e){return function(_0xcbac62){try{jsonpatch[_0x1b6b('0x1b')](_0xcbac62,_0x38801e,!![]);}catch(_0xe720e7){return BPromise[_0x1b6b('0x1c')](_0xe720e7);}return _0xcbac62[_0x1b6b('0x1d')]();};}function saveUpdates(_0x30f9d6,_0x20a5a3){return function(_0x5dbd46){if(_0x5dbd46){return _0x5dbd46[_0x1b6b('0x1e')](_0x30f9d6)[_0x1b6b('0x1f')](function(_0x3b427d){return _0x3b427d;});}return null;};}function removeEntity(_0xa8cd35,_0x27974f){return function(_0x276713){if(_0x276713){return _0x276713[_0x1b6b('0x20')]()[_0x1b6b('0x1f')](function(){_0xa8cd35[_0x1b6b('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b2cdf,_0x489e7a){return function(_0x4efab0){if(!_0x4efab0){_0x1b2cdf['sendStatus'](0x194);}return _0x4efab0;};}function handleError(_0x11449b,_0xc9554d){_0xc9554d=_0xc9554d||0x1f4;return function(_0x4e1876){logger[_0x1b6b('0x21')](_0x4e1876['stack']);if(_0x4e1876[_0x1b6b('0x22')]){delete _0x4e1876[_0x1b6b('0x22')];}_0x11449b[_0x1b6b('0x15')](_0xc9554d)[_0x1b6b('0x23')](_0x4e1876);};}exports[_0x1b6b('0x24')]=function(_0x2aa755,_0x5d0a0a){var _0xe8b7b5={},_0x1bb7f3={},_0x173961={'count':0x0,'rows':[]};var _0x3b33d4=_['map'](db[_0x1b6b('0x25')]['rawAttributes'],function(_0x5bbcd8){return{'name':_0x5bbcd8[_0x1b6b('0x26')],'type':_0x5bbcd8['type'][_0x1b6b('0x27')]};});_0x1bb7f3[_0x1b6b('0x28')]=_['differenceBy'](_['map'](_0x3b33d4,_0x1b6b('0x22')),[_0x1b6b('0x29')]);_0x1bb7f3['query']=_['keys'](_0x2aa755[_0x1b6b('0x2a')]);_0x1bb7f3[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x1bb7f3[_0x1b6b('0x28')],_0x1bb7f3['query']);_0xe8b7b5[_0x1b6b('0x2d')]=_[_0x1b6b('0x2c')](_0x1bb7f3[_0x1b6b('0x28')],qs[_0x1b6b('0x2e')](_0x2aa755[_0x1b6b('0x2a')][_0x1b6b('0x2e')]));_0xe8b7b5[_0x1b6b('0x2d')]=_0xe8b7b5[_0x1b6b('0x2d')][_0x1b6b('0x2f')]?_0xe8b7b5['attributes']:_0x1bb7f3[_0x1b6b('0x28')];if(!_0x2aa755[_0x1b6b('0x2a')][_0x1b6b('0x30')](_0x1b6b('0x31'))){_0xe8b7b5['limit']=qs[_0x1b6b('0x19')](_0x2aa755['query'][_0x1b6b('0x19')]);_0xe8b7b5['offset']=qs['offset'](_0x2aa755[_0x1b6b('0x2a')][_0x1b6b('0x18')]);}_0xe8b7b5[_0x1b6b('0x32')]=qs['sort'](_0x2aa755[_0x1b6b('0x2a')][_0x1b6b('0x33')]);_0xe8b7b5[_0x1b6b('0x34')]=qs[_0x1b6b('0x2b')](_[_0x1b6b('0x35')](_0x2aa755[_0x1b6b('0x2a')],_0x1bb7f3[_0x1b6b('0x2b')]));if(_0x2aa755[_0x1b6b('0x2a')][_0x1b6b('0x36')]){_0xe8b7b5[_0x1b6b('0x34')]=_[_0x1b6b('0x37')](_0xe8b7b5[_0x1b6b('0x34')],{'$or':_[_0x1b6b('0x38')](_0x3b33d4,function(_0xfc4d04){if(_0xfc4d04['type']!==_0x1b6b('0x39')){var _0x47349b={};_0x47349b[_0xfc4d04['name']]={'$like':'%'+_0x2aa755[_0x1b6b('0x2a')]['filter']+'%'};return _0x47349b;}})});}_0xe8b7b5=_[_0x1b6b('0x37')]({},_0xe8b7b5,_0x2aa755[_0x1b6b('0x3a')]);var _0x18f725={'where':_0xe8b7b5['where']};return db[_0x1b6b('0x25')][_0x1b6b('0x17')](_0x18f725)[_0x1b6b('0x1f')](function(_0x5578d9){_0x173961[_0x1b6b('0x17')]=_0x5578d9;if(_0x2aa755[_0x1b6b('0x2a')][_0x1b6b('0x3b')]){_0xe8b7b5['include']=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0xe8b7b5);})[_0x1b6b('0x1f')](function(_0xd8b86){_0x173961[_0x1b6b('0x3c')]=_0xd8b86;return _0x173961;})[_0x1b6b('0x1f')](respondWithFilteredResult(_0x5d0a0a,_0xe8b7b5))[_0x1b6b('0x3d')](handleError(_0x5d0a0a,null));};exports[_0x1b6b('0x3e')]=function(_0xe8bea5,_0x5b88fc){var _0x229d9e={'raw':![],'where':{'id':_0xe8bea5[_0x1b6b('0x3f')]['id']}},_0x165384={};_0x165384[_0x1b6b('0x28')]=_[_0x1b6b('0x40')](db[_0x1b6b('0x25')]['rawAttributes']);_0x165384[_0x1b6b('0x2a')]=_[_0x1b6b('0x40')](_0xe8bea5[_0x1b6b('0x2a')]);_0x165384[_0x1b6b('0x2b')]=_[_0x1b6b('0x2c')](_0x165384[_0x1b6b('0x28')],_0x165384[_0x1b6b('0x2a')]);_0x229d9e[_0x1b6b('0x2d')]=_[_0x1b6b('0x2c')](_0x165384[_0x1b6b('0x28')],qs[_0x1b6b('0x2e')](_0xe8bea5[_0x1b6b('0x2a')]['fields']));_0x229d9e[_0x1b6b('0x2d')]=_0x229d9e[_0x1b6b('0x2d')][_0x1b6b('0x2f')]?_0x229d9e[_0x1b6b('0x2d')]:_0x165384[_0x1b6b('0x28')];if(_0xe8bea5[_0x1b6b('0x2a')]['includeAll']){_0x229d9e['include']=[{'all':!![]}];}_0x229d9e=_[_0x1b6b('0x37')]({},_0x229d9e,_0xe8bea5['options']);return db[_0x1b6b('0x25')]['find'](_0x229d9e)[_0x1b6b('0x1f')](handleEntityNotFound(_0x5b88fc,null))[_0x1b6b('0x1f')](respondWithResult(_0x5b88fc,null))[_0x1b6b('0x3d')](handleError(_0x5b88fc,null));};exports[_0x1b6b('0x41')]=function(_0x53cb3d,_0x2487d6){return db['ScreenRecording']['create'](_0x53cb3d[_0x1b6b('0x42')],{})[_0x1b6b('0x1f')](respondWithResult(_0x2487d6,0xc9))[_0x1b6b('0x3d')](handleError(_0x2487d6,null));};exports[_0x1b6b('0x1e')]=function(_0x4a2a19,_0x45f31b){if(_0x4a2a19['body']['id']){delete _0x4a2a19[_0x1b6b('0x42')]['id'];}delete _0x4a2a19[_0x1b6b('0x42')][_0x1b6b('0x43')];delete _0x4a2a19['body'][_0x1b6b('0x44')];delete _0x4a2a19['body'][_0x1b6b('0x45')];delete _0x4a2a19['body'][_0x1b6b('0x46')];return db[_0x1b6b('0x25')][_0x1b6b('0x47')]({'where':{'id':_0x4a2a19[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x1f')](handleEntityNotFound(_0x45f31b,null))[_0x1b6b('0x1f')](saveUpdates(_0x4a2a19['body'],null))['then'](respondWithResult(_0x45f31b,null))[_0x1b6b('0x3d')](handleError(_0x45f31b,null));};exports[_0x1b6b('0x48')]=function(_0x56039a,_0x3ca60d){return db[_0x1b6b('0x25')][_0x1b6b('0x48')]()[_0x1b6b('0x1f')](respondWithResult(_0x3ca60d,null))[_0x1b6b('0x3d')](handleError(_0x3ca60d,null));};exports['download']=function(_0x1d59fd,_0x5ed55b,_0x2cb484){var _0x24c4d8=require(_0x1b6b('0x49'));var _0x23475a=![];var _0x3667ce={};if(_0x1d59fd[_0x1b6b('0x2a')][_0x1b6b('0x4a')]&&_0x1d59fd[_0x1b6b('0x2a')][_0x1b6b('0x4a')]==='uniqueid'){_0x3667ce['uniqueid']=_0x1d59fd['params']['id'];}else{_0x3667ce['id']=_0x1d59fd[_0x1b6b('0x3f')]['id'];}return db['ScreenRecording']['find']({'where':_0x3667ce,'attributes':['id',_0x1b6b('0x46')],'raw':!![]})[_0x1b6b('0x1f')](handleEntityNotFound(_0x5ed55b,null))[_0x1b6b('0x1f')](function(_0xad2c29){if(_0xad2c29){var _0x527aca=path[_0x1b6b('0x4b')](config[_0x1b6b('0x4c')],_0x1b6b('0x4d'),_0xad2c29['value']);var _0x4df1e4=util[_0x1b6b('0x29')](_0x1b6b('0x4e'),_0x527aca);if(fs[_0x1b6b('0x4f')](_0x4df1e4)){_0x23475a=!![];return _0x24c4d8['decryptFile'](_0x4df1e4,_0x527aca,config['secrets']['recording'])['then'](function(){return _0xad2c29;});}return _0xad2c29;}})[_0x1b6b('0x1f')](function(_0x13f3d8){if(_0x13f3d8){var _0x3ea41d=path[_0x1b6b('0x4b')](config[_0x1b6b('0x4c')],_0x1b6b('0x4d'),_0x13f3d8['value']);if(!fs[_0x1b6b('0x4f')](_0x3ea41d)){throw new db[(_0x1b6b('0x50'))][(_0x1b6b('0x51'))](_0x1b6b('0x52'));}if(_0x13f3d8[_0x1b6b('0x53')]){return _0x5ed55b[_0x1b6b('0x54')](_0x3ea41d,_0x13f3d8['filename']+path[_0x1b6b('0x55')](_0x3ea41d),function(){if(_0x23475a){fs['unlink'](_0x3ea41d);}});}else{return _0x5ed55b['download'](_0x3ea41d,function(_0x48560f){if(_0x23475a){fs[_0x1b6b('0x56')](_0x3ea41d);}});}}})['catch'](function(_0x593726){if(_0x593726[_0x1b6b('0x57')]===_0x1b6b('0x52')){_0x5ed55b[_0x1b6b('0x15')](0x194)[_0x1b6b('0x23')](_0x1b6b('0x58'));}else{return handleError(_0x5ed55b,null);}});};exports[_0x1b6b('0x20')]=function(_0x442191,_0x489015){return db[_0x1b6b('0x25')]['find']({'where':{'id':_0x442191[_0x1b6b('0x3f')]['id']}})[_0x1b6b('0x1f')](function(_0x7b4d1a){if(!_0x7b4d1a)throw new ReferenceError('Entity\x20not\x20found');return _0x7b4d1a;})['then'](function(_0xd21044){var _0x3734c6=path[_0x1b6b('0x4b')](config[_0x1b6b('0x4c')],_0x1b6b('0x4d'),_0xd21044[_0x1b6b('0x46')]);logger[_0x1b6b('0x59')](_0x1b6b('0x5a'),_0x3734c6);if(!_['isNil'](_0xd21044['value'])&&fs[_0x1b6b('0x4f')](_0x3734c6)){logger[_0x1b6b('0x59')](_0x1b6b('0x5b')+_0x3734c6+_0x1b6b('0x5c'));fs['unlinkSync'](_0x3734c6);}_0x3734c6=_0x3734c6+_0x1b6b('0x5d');if(!_['isNil'](_0xd21044[_0x1b6b('0x46')])&&fs[_0x1b6b('0x4f')](_0x3734c6)){logger['info'](_0x1b6b('0x5b')+_0x3734c6+_0x1b6b('0x5c'));fs[_0x1b6b('0x5e')](_0x3734c6);}return _0xd21044;})[_0x1b6b('0x1f')](function(_0x40b86a){if(!_0x40b86a)throw new InternalError();return _0x40b86a[_0x1b6b('0x20')]();})['then'](function(){_0x489015[_0x1b6b('0x15')](0xcc)[_0x1b6b('0x5f')]();})['catch'](function(_0x30b618){var _0x26edc4=0x1f4;if(e instanceof ReferenceError){_0x26edc4=0x194;}else if(e instanceof InternalError){_0x26edc4=0x1f4;}logger[_0x1b6b('0x21')](_0x30b618[_0x1b6b('0x60')]);if(_0x30b618[_0x1b6b('0x22')]){delete _0x30b618[_0x1b6b('0x22')];}_0x489015[_0x1b6b('0x15')](_0x26edc4)[_0x1b6b('0x23')](_0x30b618);});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 66fa42a..62d511d 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 _0xec97=['ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./screenRecording.attributes','exports','define'];(function(_0x27b989,_0x5a671f){var _0x5e8e9a=function(_0x3cb10b){while(--_0x3cb10b){_0x27b989['push'](_0x27b989['shift']());}};_0x5e8e9a(++_0x5a671f);}(_0xec97,0xff));var _0x7ec9=function(_0x58b4a0,_0x42862e){_0x58b4a0=_0x58b4a0-0x0;var _0x26be67=_0xec97[_0x58b4a0];return _0x26be67;};'use strict';var _=require(_0x7ec9('0x0'));var util=require(_0x7ec9('0x1'));var logger=require(_0x7ec9('0x2'))(_0x7ec9('0x3'));var moment=require(_0x7ec9('0x4'));var BPromise=require('bluebird');var rp=require(_0x7ec9('0x5'));var fs=require('fs');var path=require(_0x7ec9('0x6'));var rimraf=require(_0x7ec9('0x7'));var config=require('../../config/environment');var attributes=require(_0x7ec9('0x8'));module[_0x7ec9('0x9')]=function(_0x4dd848,_0x3623fd){return _0x4dd848[_0x7ec9('0xa')](_0x7ec9('0xb'),attributes,{'tableName':_0x7ec9('0xc'),'paranoid':![],'indexes':[{'name':_0x7ec9('0xd'),'fields':[_0x7ec9('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x14b0=['../../config/logger','moment','bluebird','request-promise','../../config/environment','./screenRecording.attributes','exports','define','screen_recordings','interactionid','lodash','util'];(function(_0x38b70a,_0x500e47){var _0x2dcf5c=function(_0x2e441b){while(--_0x2e441b){_0x38b70a['push'](_0x38b70a['shift']());}};_0x2dcf5c(++_0x500e47);}(_0x14b0,0x1c6));var _0x014b=function(_0x38b22a,_0x40a20e){_0x38b22a=_0x38b22a-0x0;var _0x1619ad=_0x14b0[_0x38b22a];return _0x1619ad;};'use strict';var _=require(_0x014b('0x0'));var util=require(_0x014b('0x1'));var logger=require(_0x014b('0x2'))('api');var moment=require(_0x014b('0x3'));var BPromise=require(_0x014b('0x4'));var rp=require(_0x014b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x014b('0x6'));var attributes=require(_0x014b('0x7'));module[_0x014b('0x8')]=function(_0x25235c,_0x2ae331){return _0x25235c[_0x014b('0x9')]('ScreenRecording',attributes,{'tableName':_0x014b('0xa'),'paranoid':![],'indexes':[{'name':'interactionid','fields':[_0x014b('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 4f722d4..3e6398f 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(_0x6fa9bd,_0x56baa5){var _0x47b10e=function(_0x34eb31){while(--_0x34eb31){_0x6fa9bd['push'](_0x6fa9bd['shift']());}};_0x47b10e(++_0x56baa5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0xa9e0[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ 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(_0x103269,_0x4cd6bc){var _0x5c57fa=function(_0x409816){while(--_0x409816){_0x103269['push'](_0x103269['shift']());}};_0x5c57fa(++_0x4cd6bc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'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 59d944e..b72f739 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 _0x6a03=['post','single','addLogo','server/files/images/logos/','logologin','addLogoLogin','root','preferred','file','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','util','path','connect-timeout','express','Router','../../config/environment','./setting.controller','index','get','/:id','show','/:id/logo_login','getLogoLogin','/:id/gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','diskStorage','join','format','%s%s','logo','extname','originalname'];(function(_0x237f8b,_0xc5eddb){var _0x423f94=function(_0x1f18f9){while(--_0x1f18f9){_0x237f8b['push'](_0x237f8b['shift']());}};_0x423f94(++_0xc5eddb);}(_0x6a03,0xdd));var _0x36a0=function(_0x59ad9e,_0x44abe7){_0x59ad9e=_0x59ad9e-0x0;var _0x4c1f1e=_0x6a03[_0x59ad9e];return _0x4c1f1e;};'use strict';var multer=require('multer');var util=require(_0x36a0('0x0'));var path=require(_0x36a0('0x1'));var timeout=require(_0x36a0('0x2'));var express=require(_0x36a0('0x3'));var router=express[_0x36a0('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36a0('0x5'));var controller=require(_0x36a0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x36a0('0x7')]);router[_0x36a0('0x8')](_0x36a0('0x9'),controller[_0x36a0('0xa')]);router[_0x36a0('0x8')]('/:id/logo',controller['getLogo']);router[_0x36a0('0x8')](_0x36a0('0xb'),controller[_0x36a0('0xc')]);router[_0x36a0('0x8')](_0x36a0('0xd'),controller['gdpr']);router['get'](_0x36a0('0xe'),controller[_0x36a0('0xf')]);router['get'](_0x36a0('0x10'),controller[_0x36a0('0x11')]);var upload=multer({'storage':multer[_0x36a0('0x12')]({'destination':function(_0x11f628,_0x1e6510,_0x48a473){_0x48a473(null,path[_0x36a0('0x13')](config['root'],'server/files/images/logos/'));},'filename':function(_0x1a8129,_0x4e45e6,_0x2e456b){_0x2e456b(null,util[_0x36a0('0x14')](_0x36a0('0x15'),_0x36a0('0x16'),path[_0x36a0('0x17')](_0x4e45e6[_0x36a0('0x18')])));}})});router[_0x36a0('0x19')]('/:id/logo',upload[_0x36a0('0x1a')]('file'),controller[_0x36a0('0x1b')]);var upload=multer({'storage':multer[_0x36a0('0x12')]({'destination':function(_0xc47fda,_0x2e3fb3,_0x56af19){_0x56af19(null,path[_0x36a0('0x13')](config['root'],_0x36a0('0x1c')));},'filename':function(_0xe0d2e5,_0x57c3f5,_0x57d019){_0x57d019(null,util['format'](_0x36a0('0x15'),_0x36a0('0x1d'),path[_0x36a0('0x17')](_0x57c3f5[_0x36a0('0x18')])));}})});router[_0x36a0('0x19')](_0x36a0('0xb'),upload['single']('file'),controller[_0x36a0('0x1e')]);var upload=multer({'storage':multer[_0x36a0('0x12')]({'destination':function(_0x467e05,_0x979c04,_0x419b3e){_0x419b3e(null,path[_0x36a0('0x13')](config[_0x36a0('0x1f')],_0x36a0('0x1c')));},'filename':function(_0x3b29a9,_0x5985f0,_0x59eecd){_0x59eecd(null,util[_0x36a0('0x14')](_0x36a0('0x15'),_0x36a0('0x20'),path[_0x36a0('0x17')](_0x5985f0['originalname'])));}})});router[_0x36a0('0x19')](_0x36a0('0xe'),upload[_0x36a0('0x1a')](_0x36a0('0x21')),controller[_0x36a0('0x22')]);var upload=multer({'storage':multer[_0x36a0('0x12')]({'destination':function(_0x272e6d,_0x484205,_0x1bb76c){_0x1bb76c(null,path['join'](config['root'],_0x36a0('0x1c')));},'filename':function(_0x3ce47f,_0x4a6924,_0x58fe5a){_0x58fe5a(null,util[_0x36a0('0x14')]('%s%s',_0x36a0('0x23'),path[_0x36a0('0x17')](_0x4a6924[_0x36a0('0x18')])));}})});router[_0x36a0('0x19')](_0x36a0('0x10'),upload['single'](_0x36a0('0x21')),controller[_0x36a0('0x24')]);router[_0x36a0('0x25')]('/:id',auth[_0x36a0('0x26')](),controller[_0x36a0('0x27')]);module[_0x36a0('0x28')]=router; \ No newline at end of file +var _0xcea5=['exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./setting.controller','isAuthenticated','/:id','show','get','/:id/logo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','getPreferred','/:id/favicon','getFavicon','join','root','server/files/images/logos/','format','%s%s','extname','originalname','single','file','diskStorage','logologin','addLogoLogin','preferred','addPreferred','favicon','post','put','update'];(function(_0x2b0acc,_0x4ae9d9){var _0x4d2cfb=function(_0x45a5c8){while(--_0x45a5c8){_0x2b0acc['push'](_0x2b0acc['shift']());}};_0x4d2cfb(++_0x4ae9d9);}(_0xcea5,0x76));var _0x5cea=function(_0x479dd2,_0x3f7fc2){_0x479dd2=_0x479dd2-0x0;var _0x41fecb=_0xcea5[_0x479dd2];return _0x41fecb;};'use strict';var multer=require('multer');var util=require(_0x5cea('0x0'));var path=require(_0x5cea('0x1'));var timeout=require(_0x5cea('0x2'));var express=require(_0x5cea('0x3'));var router=express['Router']();var auth=require(_0x5cea('0x4'));var interaction=require(_0x5cea('0x5'));var config=require('../../config/environment');var controller=require(_0x5cea('0x6'));router['get']('/',auth[_0x5cea('0x7')](),controller['index']);router['get'](_0x5cea('0x8'),controller[_0x5cea('0x9')]);router[_0x5cea('0xa')](_0x5cea('0xb'),controller['getLogo']);router[_0x5cea('0xa')](_0x5cea('0xc'),controller[_0x5cea('0xd')]);router[_0x5cea('0xa')](_0x5cea('0xe'),controller[_0x5cea('0xf')]);router['get'](_0x5cea('0x10'),controller[_0x5cea('0x11')]);router[_0x5cea('0xa')](_0x5cea('0x12'),controller[_0x5cea('0x13')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16cec9,_0x4380e2,_0x4c3c25){_0x4c3c25(null,path[_0x5cea('0x14')](config[_0x5cea('0x15')],_0x5cea('0x16')));},'filename':function(_0x483ac9,_0x3fca28,_0x2c5cf6){_0x2c5cf6(null,util[_0x5cea('0x17')](_0x5cea('0x18'),'logo',path[_0x5cea('0x19')](_0x3fca28[_0x5cea('0x1a')])));}})});router['post'](_0x5cea('0xb'),upload[_0x5cea('0x1b')](_0x5cea('0x1c')),controller['addLogo']);var upload=multer({'storage':multer[_0x5cea('0x1d')]({'destination':function(_0x5a040c,_0x281136,_0x45cb30){_0x45cb30(null,path['join'](config[_0x5cea('0x15')],_0x5cea('0x16')));},'filename':function(_0x4d4ea5,_0x24fd83,_0x426a11){_0x426a11(null,util['format'](_0x5cea('0x18'),_0x5cea('0x1e'),path[_0x5cea('0x19')](_0x24fd83[_0x5cea('0x1a')])));}})});router['post']('/:id/logo_login',upload[_0x5cea('0x1b')]('file'),controller[_0x5cea('0x1f')]);var upload=multer({'storage':multer[_0x5cea('0x1d')]({'destination':function(_0x1b167f,_0x31466b,_0x1b4442){_0x1b4442(null,path['join'](config['root'],_0x5cea('0x16')));},'filename':function(_0x3ebc84,_0x1f4426,_0x41b223){_0x41b223(null,util['format'](_0x5cea('0x18'),_0x5cea('0x20'),path['extname'](_0x1f4426[_0x5cea('0x1a')])));}})});router['post'](_0x5cea('0x10'),upload[_0x5cea('0x1b')](_0x5cea('0x1c')),controller[_0x5cea('0x21')]);var upload=multer({'storage':multer[_0x5cea('0x1d')]({'destination':function(_0xa9a184,_0x4222ff,_0x35ce54){_0x35ce54(null,path[_0x5cea('0x14')](config[_0x5cea('0x15')],_0x5cea('0x16')));},'filename':function(_0x1a923d,_0x25b0c5,_0x1d5a1c){_0x1d5a1c(null,util[_0x5cea('0x17')]('%s%s',_0x5cea('0x22'),path[_0x5cea('0x19')](_0x25b0c5[_0x5cea('0x1a')])));}})});router[_0x5cea('0x23')]('/:id/favicon',upload[_0x5cea('0x1b')]('file'),controller['addFavicon']);router[_0x5cea('0x24')](_0x5cea('0x8'),auth[_0x5cea('0x7')](),controller[_0x5cea('0x25')]);module[_0x5cea('0x26')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index dbf85e3..9556bbd 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 _0x86bb=['exports','INTEGER','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','sequelize'];(function(_0x32136b,_0x1ed72d){var _0x23ed20=function(_0x53aa53){while(--_0x53aa53){_0x32136b['push'](_0x32136b['shift']());}};_0x23ed20(++_0x1ed72d);}(_0x86bb,0x1ef));var _0xb86b=function(_0x217a6f,_0x3ecd8b){_0x217a6f=_0x217a6f-0x0;var _0x5553f3=_0x86bb[_0x217a6f];return _0x5553f3;};'use strict';var Sequelize=require(_0xb86b('0x0'));module[_0xb86b('0x1')]={'min_internal':{'type':Sequelize[_0xb86b('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0xb86b('0x2')](0xb),'unique':_0xb86b('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xb86b('0x4')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xb86b('0x4')]},'defaultLoginLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xb86b('0x4')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0xb86b('0x4')]},'turnaddr':{'type':Sequelize[_0xb86b('0x4')]},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize[_0xb86b('0x4')]},'pageTitle':{'type':Sequelize[_0xb86b('0x4')]},'defaultPageTitle':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0xb86b('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0xb86b('0x4')],'defaultValue':_0xb86b('0x6')},'enableEmailPreview':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xb86b('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xb86b('0x4')],'defaultValue':_0xb86b('0x7')},'chatTimeout':{'type':Sequelize[_0xb86b('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0xb86b('0x4')]},'defaultPreferred':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xb86b('0x4')]},'allowedLoginAttempts':{'type':Sequelize[_0xb86b('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xb86b('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0xb86b('0x4')]},'defaultFavicon':{'type':Sequelize[_0xb86b('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0xb86b('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0xfca4=['INTEGER','min_internal','min_mailbox','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','sequelize','exports'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0xfca4,0xd6));var _0x4fca=function(_0x5e7ae9,_0x5e37d0){_0x5e7ae9=_0x5e7ae9-0x0;var _0x152243=_0xfca4[_0x5e7ae9];return _0x152243;};'use strict';var Sequelize=require(_0x4fca('0x0'));module[_0x4fca('0x1')]={'min_internal':{'type':Sequelize[_0x4fca('0x2')](0xb),'unique':_0x4fca('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x4fca('0x2')](0xb),'unique':_0x4fca('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x4fca('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x4fca('0x5')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x4fca('0x5')]},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x4fca('0x5')]},'turnpassword':{'type':Sequelize[_0x4fca('0x5')]},'pageTitle':{'type':Sequelize[_0x4fca('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x4fca('0x2')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x4fca('0x5')],'defaultValue':_0x4fca('0x7')},'enableEmailPreview':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x4fca('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x4fca('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x4fca('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4fca('0x5')],'defaultValue':'alternate'},'chatTimeout':{'type':Sequelize[_0x4fca('0x2')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x4fca('0x5')]},'defaultPreferred':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x4fca('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x4fca('0x5')]},'allowedLoginAttempts':{'type':Sequelize[_0x4fca('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x4fca('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x4fca('0x5')]},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x4fca('0x2')],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index c510284..edbc38f 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 _0x8c2e=['getPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','http','test','ValidationError','request','then','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','destroy','end','stack','name','send','index','map','Setting','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','filter','where','merge','options','count','includeAll','include','findAll','rows','params','find','body','readFileSync','join','server/files/templates/stun.ejs','utf8','render','root','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','logo','addLogoLogin','../../config/license/util','getLogo','server/files/images/logos','loginLogo','preferred','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','default_logo.png','default','custom','Sequelize','upperFirst','download','getLicense','defaultLoginLogo','toLower','default_loginLogo.png','\x20not\x20found','securePassword','addPreferred'];(function(_0x2132a3,_0x4639e9){var _0x21890c=function(_0x34b73d){while(--_0x34b73d){_0x2132a3['push'](_0x2132a3['shift']());}};_0x21890c(++_0x4639e9);}(_0x8c2e,0x17f));var _0xe8c2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8c2e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xe8c2('0x0'));var emlformat=require(_0xe8c2('0x1'));var rimraf=require(_0xe8c2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe8c2('0x3'));var rp=require(_0xe8c2('0x4'));var moment=require(_0xe8c2('0x5'));var BPromise=require(_0xe8c2('0x6'));var Mustache=require('mustache');var util=require(_0xe8c2('0x7'));var path=require(_0xe8c2('0x8'));var sox=require(_0xe8c2('0x9'));var csv=require(_0xe8c2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe8c2('0xb'));var squel=require('squel');var crypto=require(_0xe8c2('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xe8c2('0xd'));var toCsv=require(_0xe8c2('0xa'));var querystring=require(_0xe8c2('0xe'));var Papa=require(_0xe8c2('0xf'));var Redis=require(_0xe8c2('0x10'));var authService=require(_0xe8c2('0x11'));var qs=require(_0xe8c2('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe8c2('0x13'));var logger=require(_0xe8c2('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xe8c2('0x15'));var db=require('../../mysqldb')['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xe8c2('0x16')]({'port':0x232a});function checkPasswordPattern(_0x17c1eb,_0x5b975b,_0x2c03e6){if(_0x2c03e6){var _0x64763d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x64763d[_0xe8c2('0x17')](_0x5b975b)){return _0x17c1eb;}else{throw new db['Sequelize'][(_0xe8c2('0x18'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x17c1eb;}}function respondWithRpcPromise(_0x3f3600,_0x52337d,_0x5ee39d,_0x14fc69){return new BPromise(function(_0x5313ce,_0x4149f8){var _0x120267=_0x14fc69||client;return _0x120267[_0xe8c2('0x19')](_0x3f3600,_0x5ee39d)[_0xe8c2('0x1a')](function(_0x576732){logger['info'](_0xe8c2('0x1b'),_0x52337d,_0xe8c2('0x1c'));logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x52337d,_0xe8c2('0x1c'),JSON[_0xe8c2('0x1d')](_0x576732));if(_0x576732[_0xe8c2('0x1e')]){if(_0x576732[_0xe8c2('0x1e')][_0xe8c2('0x1f')]===0x1f4){logger[_0xe8c2('0x1e')](_0xe8c2('0x1b'),_0x52337d,_0x576732[_0xe8c2('0x1e')][_0xe8c2('0x20')]);return _0x4149f8(_0x576732[_0xe8c2('0x1e')]['message']);}logger['error'](_0xe8c2('0x1b'),_0x52337d,_0x576732[_0xe8c2('0x1e')][_0xe8c2('0x20')]);return _0x5313ce(_0x576732[_0xe8c2('0x1e')][_0xe8c2('0x20')]);}else{logger['info'](_0xe8c2('0x1b'),_0x52337d,'request\x20sent');_0x5313ce(_0x576732[_0xe8c2('0x21')][_0xe8c2('0x20')]);}})[_0xe8c2('0x22')](function(_0x22b636){logger[_0xe8c2('0x1e')](_0xe8c2('0x1b'),_0x52337d,_0x22b636);_0x4149f8(_0x22b636);});});}function respondWithStatusCode(_0x5169f4,_0x3c7dfd){_0x3c7dfd=_0x3c7dfd||0xcc;return function(_0x28f0f2){if(_0x28f0f2){return _0x5169f4[_0xe8c2('0x23')](_0x3c7dfd);}return _0x5169f4['status'](_0x3c7dfd)['end']();};}function respondWithResult(_0x3685d9,_0x23e375){_0x23e375=_0x23e375||0xc8;return function(_0x130129){if(_0x130129){return _0x3685d9[_0xe8c2('0x24')](_0x23e375)[_0xe8c2('0x25')](_0x130129);}};}function respondWithFilteredResult(_0x4392fa,_0x1ce19a){return function(_0xd163a4){if(_0xd163a4){var _0x1a2a52=_0xd163a4['count'],_0x4a5002=_0x1ce19a['offset'],_0x81ef4c=_0x1ce19a[_0xe8c2('0x26')]+_0x1ce19a[_0xe8c2('0x27')],_0x1d19ce;if(_0x81ef4c>=_0x1a2a52){_0x81ef4c=_0x1a2a52;_0x1d19ce=0xc8;}else{_0x1d19ce=0xce;}_0x4392fa[_0xe8c2('0x24')](_0x1d19ce);return _0x4392fa[_0xe8c2('0x28')](_0xe8c2('0x29'),_0x4a5002+'-'+_0x81ef4c+'/'+_0x1a2a52)['json'](_0xd163a4);}return null;};}function patchUpdates(_0x2257d2){return function(_0x23e32e){try{jsonpatch['apply'](_0x23e32e,_0x2257d2,!![]);}catch(_0xbd5345){return BPromise[_0xe8c2('0x2a')](_0xbd5345);}return _0x23e32e[_0xe8c2('0x2b')]();};}function saveUpdates(_0x21d737,_0x562fed){return function(_0x4b405a){if(_0x4b405a){return _0x4b405a[_0xe8c2('0x2c')](_0x21d737)['then'](function(_0x2b7f7c){return _0x2b7f7c;});}return null;};}function removeEntity(_0x1364b0,_0x15e33b){return function(_0xe8c5da){if(_0xe8c5da){return _0xe8c5da[_0xe8c2('0x2d')]()[_0xe8c2('0x1a')](function(){_0x1364b0['status'](0xcc)[_0xe8c2('0x2e')]();});}};}function handleEntityNotFound(_0x492726,_0xca4eb3){return function(_0x1bebd1){if(!_0x1bebd1){_0x492726['sendStatus'](0x194);}return _0x1bebd1;};}function handleError(_0x2d0c38,_0x276a66){_0x276a66=_0x276a66||0x1f4;return function(_0x48fb5d){logger[_0xe8c2('0x1e')](_0x48fb5d[_0xe8c2('0x2f')]);if(_0x48fb5d[_0xe8c2('0x30')]){delete _0x48fb5d[_0xe8c2('0x30')];}_0x2d0c38[_0xe8c2('0x24')](_0x276a66)[_0xe8c2('0x31')](_0x48fb5d);};}exports[_0xe8c2('0x32')]=function(_0x481c51,_0x59d247){var _0x437b9d={},_0x5a9f89={},_0x3814e3={'count':0x0,'rows':[]};var _0x5ccfd9=_[_0xe8c2('0x33')](db[_0xe8c2('0x34')][_0xe8c2('0x35')],function(_0x19b3f0){return{'name':_0x19b3f0[_0xe8c2('0x36')],'type':_0x19b3f0[_0xe8c2('0x37')][_0xe8c2('0x38')]};});_0x5a9f89['model']=_[_0xe8c2('0x33')](_0x5ccfd9,'name');_0x5a9f89[_0xe8c2('0x39')]=_[_0xe8c2('0x3a')](_0x481c51[_0xe8c2('0x39')]);_0x5a9f89[_0xe8c2('0x3b')]=_[_0xe8c2('0x3c')](_0x5a9f89[_0xe8c2('0x3d')],_0x5a9f89['query']);_0x437b9d[_0xe8c2('0x3e')]=_['intersection'](_0x5a9f89['model'],qs[_0xe8c2('0x3f')](_0x481c51[_0xe8c2('0x39')][_0xe8c2('0x3f')]));_0x437b9d[_0xe8c2('0x3e')]=_0x437b9d['attributes'][_0xe8c2('0x40')]?_0x437b9d[_0xe8c2('0x3e')]:_0x5a9f89[_0xe8c2('0x3d')];if(!_0x481c51[_0xe8c2('0x39')][_0xe8c2('0x41')](_0xe8c2('0x42'))){_0x437b9d[_0xe8c2('0x27')]=qs[_0xe8c2('0x27')](_0x481c51[_0xe8c2('0x39')]['limit']);_0x437b9d[_0xe8c2('0x26')]=qs[_0xe8c2('0x26')](_0x481c51[_0xe8c2('0x39')][_0xe8c2('0x26')]);}_0x437b9d[_0xe8c2('0x43')]=qs['sort'](_0x481c51[_0xe8c2('0x39')]['sort']);_0x437b9d['where']=qs[_0xe8c2('0x3b')](_['pick'](_0x481c51[_0xe8c2('0x39')],_0x5a9f89[_0xe8c2('0x3b')]));if(_0x481c51['query'][_0xe8c2('0x44')]){_0x437b9d[_0xe8c2('0x45')]=_[_0xe8c2('0x46')](_0x437b9d[_0xe8c2('0x45')],{'$or':_['map'](_0x5ccfd9,function(_0x2ce6ac){if(_0x2ce6ac[_0xe8c2('0x37')]!=='VIRTUAL'){var _0xb388da={};_0xb388da[_0x2ce6ac[_0xe8c2('0x30')]]={'$like':'%'+_0x481c51[_0xe8c2('0x39')][_0xe8c2('0x44')]+'%'};return _0xb388da;}})});}_0x437b9d=_[_0xe8c2('0x46')]({},_0x437b9d,_0x481c51[_0xe8c2('0x47')]);var _0x274fc8={'where':_0x437b9d['where']};return db[_0xe8c2('0x34')][_0xe8c2('0x48')](_0x274fc8)[_0xe8c2('0x1a')](function(_0x92b20c){_0x3814e3[_0xe8c2('0x48')]=_0x92b20c;if(_0x481c51[_0xe8c2('0x39')][_0xe8c2('0x49')]){_0x437b9d[_0xe8c2('0x4a')]=[{'all':!![]}];}return db[_0xe8c2('0x34')][_0xe8c2('0x4b')](_0x437b9d);})['then'](function(_0x406401){_0x3814e3[_0xe8c2('0x4c')]=_0x406401;return _0x3814e3;})[_0xe8c2('0x1a')](respondWithFilteredResult(_0x59d247,_0x437b9d))['catch'](handleError(_0x59d247,null));};exports['show']=function(_0x167617,_0x192011){var _0x29e809={'raw':![],'where':{'id':_0x167617[_0xe8c2('0x4d')]['id']}},_0x40ebaf={};_0x40ebaf[_0xe8c2('0x3d')]=_[_0xe8c2('0x3a')](db[_0xe8c2('0x34')]['rawAttributes']);_0x40ebaf[_0xe8c2('0x39')]=_[_0xe8c2('0x3a')](_0x167617[_0xe8c2('0x39')]);_0x40ebaf['filters']=_[_0xe8c2('0x3c')](_0x40ebaf[_0xe8c2('0x3d')],_0x40ebaf[_0xe8c2('0x39')]);_0x29e809['attributes']=_['intersection'](_0x40ebaf[_0xe8c2('0x3d')],qs['fields'](_0x167617[_0xe8c2('0x39')]['fields']));_0x29e809[_0xe8c2('0x3e')]=_0x29e809[_0xe8c2('0x3e')][_0xe8c2('0x40')]?_0x29e809[_0xe8c2('0x3e')]:_0x40ebaf['model'];if(_0x167617[_0xe8c2('0x39')]['includeAll']){_0x29e809['include']=[{'all':!![]}];}_0x29e809=_['merge']({},_0x29e809,_0x167617[_0xe8c2('0x47')]);return db[_0xe8c2('0x34')][_0xe8c2('0x4e')](_0x29e809)[_0xe8c2('0x1a')](handleEntityNotFound(_0x192011,null))['then'](respondWithResult(_0x192011,null))[_0xe8c2('0x22')](handleError(_0x192011,null));};exports[_0xe8c2('0x2c')]=function(_0x2c4b49,_0x4549c3,_0x390827){var _0x2d9b87;return db[_0xe8c2('0x34')][_0xe8c2('0x4e')]({'where':{'id':_0x2c4b49[_0xe8c2('0x4d')]['id']}})[_0xe8c2('0x1a')](handleEntityNotFound(_0x4549c3,null))[_0xe8c2('0x1a')](saveUpdates(_0x2c4b49[_0xe8c2('0x4f')],null))['then'](function(_0x3c498c){if(_0x3c498c){_0x2d9b87=_0x3c498c['get']({'plain':!![]});var _0x322f5c=fs[_0xe8c2('0x50')](path[_0xe8c2('0x51')](config['root'],_0xe8c2('0x52')),_0xe8c2('0x53'));var _0x31cf70=ejs[_0xe8c2('0x54')](_0x322f5c,_0x2d9b87);var _0x4d0735=fs['readFileSync'](path['join'](config[_0xe8c2('0x55')],_0xe8c2('0x56')),_0xe8c2('0x53'));var _0x48618b=ejs[_0xe8c2('0x54')](_0x4d0735,_0x2d9b87);fs[_0xe8c2('0x57')](_0xe8c2('0x58'),_0x31cf70);fs['writeFileSync'](_0xe8c2('0x59'),_0x48618b);return respondWithRpcPromise(_0xe8c2('0x5a'),'update',{'module':_0xe8c2('0x5b')});}})[_0xe8c2('0x1a')](function(){return respondWithRpcPromise(_0xe8c2('0x5a'),_0xe8c2('0x2c'),{'module':_0xe8c2('0x5c')});})['then'](function(){return _0x2d9b87||null;})[_0xe8c2('0x1a')](respondWithResult(_0x4549c3,null))[_0xe8c2('0x22')](handleError(_0x4549c3,null));};exports[_0xe8c2('0x5d')]=function(_0x3095ac,_0x402492,_0x2f95f3){if(_0x3095ac[_0xe8c2('0x5e')]&&_0x3095ac[_0xe8c2('0x5e')][_0xe8c2('0x5f')]){_0x3095ac[_0xe8c2('0x4f')][_0xe8c2('0x60')]=_0x3095ac[_0xe8c2('0x5e')][_0xe8c2('0x5f')];}return db[_0xe8c2('0x34')][_0xe8c2('0x4e')]({'where':{'id':_0x3095ac[_0xe8c2('0x4d')]['id']}})[_0xe8c2('0x1a')](handleEntityNotFound(_0x402492,null))[_0xe8c2('0x1a')](saveUpdates(_0x3095ac[_0xe8c2('0x4f')],null))[_0xe8c2('0x1a')](respondWithResult(_0x402492,null))[_0xe8c2('0x22')](handleError(_0x402492,null));};exports[_0xe8c2('0x61')]=function(_0xaa43aa,_0x9cf7c1,_0x528eac){if(_0xaa43aa[_0xe8c2('0x5e')]&&_0xaa43aa[_0xe8c2('0x5e')]['filename']){_0xaa43aa[_0xe8c2('0x4f')]['loginLogo']=_0xaa43aa[_0xe8c2('0x5e')][_0xe8c2('0x5f')];}return db[_0xe8c2('0x34')][_0xe8c2('0x4e')]({'where':{'id':_0xaa43aa[_0xe8c2('0x4d')]['id']}})[_0xe8c2('0x1a')](handleEntityNotFound(_0x9cf7c1,null))['then'](saveUpdates(_0xaa43aa['body'],null))[_0xe8c2('0x1a')](respondWithResult(_0x9cf7c1,null))[_0xe8c2('0x22')](handleError(_0x9cf7c1,null));};var utilLicense=require(_0xe8c2('0x62'));exports[_0xe8c2('0x63')]=function(_0x31c134,_0x599f02,_0x519396){var _0x53bfeb=_0xe8c2('0x64');var _0x2a6e12={'custom':![]};return utilLicense['getLicense']()[_0xe8c2('0x1a')](function(_0xa5ec20){if(_0xa5ec20){_0x2a6e12=_0xa5ec20;}return db[_0xe8c2('0x34')][_0xe8c2('0x4e')]({'where':{'id':_0x31c134[_0xe8c2('0x4d')]['id']},'attributes':[_0xe8c2('0x60'),_0xe8c2('0x65'),_0xe8c2('0x66'),_0xe8c2('0x67'),_0xe8c2('0x68'),'defaultLoginLogo',_0xe8c2('0x69'),_0xe8c2('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x599f02,null))[_0xe8c2('0x1a')](function(_0x321781){if(_0x321781){var _0x25f9e8=_0x321781[_0xe8c2('0x60')]&&fs[_0xe8c2('0x6b')](path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x53bfeb,_['toLower'](_0x321781[_0xe8c2('0x60')])))?path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x53bfeb,_['toLower'](_0x321781[_0xe8c2('0x60')])):path[_0xe8c2('0x51')](config['root'],_0x53bfeb,_['toLower'](_0xe8c2('0x6c')));var _0x879b09=_0xe8c2('0x6d')+_['upperFirst'](_0xe8c2('0x60'));if(_0x321781[_0x879b09]||!_0x2a6e12[_0xe8c2('0x6e')]){_0x25f9e8=path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x53bfeb,_['toLower'](_0xe8c2('0x6c')));}if(!fs['existsSync'](_0x25f9e8)){throw new db[(_0xe8c2('0x6f'))]['ValidationError'](_[_0xe8c2('0x70')](_0xe8c2('0x60'))+'\x20not\x20found');}return _0x599f02[_0xe8c2('0x71')](_0x25f9e8);}})[_0xe8c2('0x22')](handleError(_0x599f02,null));};var utilLicense=require('../../config/license/util');exports['getLogoLogin']=function(_0x1016a7,_0x5361b1,_0x17bd8c){var _0x32a990='server/files/images/logos';var _0xddb550={'custom':![]};return utilLicense[_0xe8c2('0x72')]()['then'](function(_0x176aee){if(_0x176aee){_0xddb550=_0x176aee;}return db[_0xe8c2('0x34')]['find']({'where':{'id':_0x1016a7[_0xe8c2('0x4d')]['id']},'attributes':[_0xe8c2('0x60'),'loginLogo',_0xe8c2('0x66'),_0xe8c2('0x67'),'defaultLogo',_0xe8c2('0x73'),'defaultPreferred',_0xe8c2('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x5361b1,null))['then'](function(_0x63adf5){if(_0x63adf5){var _0x5c05f6=_0x63adf5[_0xe8c2('0x65')]&&fs[_0xe8c2('0x6b')](path['join'](config[_0xe8c2('0x55')],_0x32a990,_['toLower'](_0x63adf5['loginLogo'])))?path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x32a990,_[_0xe8c2('0x74')](_0x63adf5[_0xe8c2('0x65')])):path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x32a990,_[_0xe8c2('0x74')](_0xe8c2('0x75')));var _0x16791e='default'+_['upperFirst'](_0xe8c2('0x65'));if(_0x63adf5[_0x16791e]||!_0xddb550['custom']){_0x5c05f6=path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x32a990,_[_0xe8c2('0x74')](_0xe8c2('0x75')));}if(!fs[_0xe8c2('0x6b')](_0x5c05f6)){throw new db[(_0xe8c2('0x6f'))]['ValidationError'](_[_0xe8c2('0x70')](_0xe8c2('0x65'))+_0xe8c2('0x76'));}return _0x5361b1[_0xe8c2('0x71')](_0x5c05f6);}})[_0xe8c2('0x22')](handleError(_0x5361b1,null));};exports['gdpr']=function(_0x4be01c,_0x56303a){return db['Setting'][_0xe8c2('0x4e')]({'where':{'id':_0x4be01c[_0xe8c2('0x4d')]['id']},'attributes':[_0xe8c2('0x77')]})[_0xe8c2('0x1a')](respondWithResult(_0x56303a,null))['catch'](handleError(_0x56303a,null));};exports[_0xe8c2('0x78')]=function(_0x42075b,_0x2ba4a6,_0x419a66){if(_0x42075b[_0xe8c2('0x5e')]&&_0x42075b[_0xe8c2('0x5e')][_0xe8c2('0x5f')]){_0x42075b[_0xe8c2('0x4f')][_0xe8c2('0x66')]=_0x42075b[_0xe8c2('0x5e')]['filename'];}return db['Setting'][_0xe8c2('0x4e')]({'where':{'id':_0x42075b[_0xe8c2('0x4d')]['id']}})[_0xe8c2('0x1a')](handleEntityNotFound(_0x2ba4a6,null))[_0xe8c2('0x1a')](saveUpdates(_0x42075b['body'],null))[_0xe8c2('0x1a')](respondWithResult(_0x2ba4a6,null))['catch'](handleError(_0x2ba4a6,null));};var utilLicense=require('../../config/license/util');exports[_0xe8c2('0x79')]=function(_0x447e7e,_0x2b673f,_0x4edca6){var _0x16b8fc=_0xe8c2('0x64');var _0x3dab43={'custom':![]};return utilLicense[_0xe8c2('0x72')]()[_0xe8c2('0x1a')](function(_0x2bb4b6){if(_0x2bb4b6){_0x3dab43=_0x2bb4b6;}return db['Setting'][_0xe8c2('0x4e')]({'where':{'id':_0x447e7e[_0xe8c2('0x4d')]['id']},'attributes':[_0xe8c2('0x60'),'loginLogo',_0xe8c2('0x66'),_0xe8c2('0x67'),_0xe8c2('0x68'),_0xe8c2('0x73'),_0xe8c2('0x69'),_0xe8c2('0x6a')],'raw':!![]});})[_0xe8c2('0x1a')](handleEntityNotFound(_0x2b673f,null))[_0xe8c2('0x1a')](function(_0x344ad7){if(_0x344ad7){var _0x2373bc=_0x344ad7['preferred']&&fs[_0xe8c2('0x6b')](path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x16b8fc,_[_0xe8c2('0x74')](_0x344ad7['preferred'])))?path['join'](config[_0xe8c2('0x55')],_0x16b8fc,_['toLower'](_0x344ad7[_0xe8c2('0x66')])):path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x16b8fc,_['toLower'](_0xe8c2('0x7a')));var _0x4e26b0=_0xe8c2('0x6d')+_['upperFirst']('preferred');if(_0x344ad7[_0x4e26b0]||!_0x3dab43[_0xe8c2('0x6e')]||!_0x3dab43[_0xe8c2('0x66')]){_0x2373bc=path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x16b8fc,_[_0xe8c2('0x74')]('default_preferred.png'));}if(!fs[_0xe8c2('0x6b')](_0x2373bc)){throw new db[(_0xe8c2('0x6f'))][(_0xe8c2('0x18'))](_['upperFirst'](_0xe8c2('0x66'))+_0xe8c2('0x76'));}return _0x2b673f['download'](_0x2373bc);}})[_0xe8c2('0x22')](handleError(_0x2b673f,null));};exports[_0xe8c2('0x7b')]=function(_0x45dfbe,_0x1e1d54,_0x521adf){if(_0x45dfbe[_0xe8c2('0x5e')]&&_0x45dfbe['file'][_0xe8c2('0x5f')]){_0x45dfbe[_0xe8c2('0x4f')]['favicon']=_0x45dfbe[_0xe8c2('0x5e')][_0xe8c2('0x5f')];}return db['Setting'][_0xe8c2('0x4e')]({'where':{'id':_0x45dfbe[_0xe8c2('0x4d')]['id']}})[_0xe8c2('0x1a')](handleEntityNotFound(_0x1e1d54,null))[_0xe8c2('0x1a')](saveUpdates(_0x45dfbe[_0xe8c2('0x4f')],null))[_0xe8c2('0x1a')](respondWithResult(_0x1e1d54,null))['catch'](handleError(_0x1e1d54,null));};var utilLicense=require('../../config/license/util');exports[_0xe8c2('0x7c')]=function(_0xf3e366,_0x35f555,_0x3d44ac){var _0x25ecaa=_0xe8c2('0x64');var _0x4fd487={'custom':![]};return utilLicense[_0xe8c2('0x72')]()[_0xe8c2('0x1a')](function(_0x4fe880){if(_0x4fe880){_0x4fd487=_0x4fe880;}return db[_0xe8c2('0x34')][_0xe8c2('0x4e')]({'where':{'id':_0xf3e366[_0xe8c2('0x4d')]['id']},'attributes':[_0xe8c2('0x60'),_0xe8c2('0x65'),'preferred',_0xe8c2('0x67'),_0xe8c2('0x68'),'defaultLoginLogo','defaultPreferred',_0xe8c2('0x6a')],'raw':!![]});})['then'](handleEntityNotFound(_0x35f555,null))[_0xe8c2('0x1a')](function(_0x32fc01){if(_0x32fc01){var _0x26b725=_0x32fc01[_0xe8c2('0x67')]&&fs[_0xe8c2('0x6b')](path['join'](config[_0xe8c2('0x55')],_0x25ecaa,_[_0xe8c2('0x74')](_0x32fc01[_0xe8c2('0x67')])))?path[_0xe8c2('0x51')](config[_0xe8c2('0x55')],_0x25ecaa,_[_0xe8c2('0x74')](_0x32fc01['favicon'])):path['join'](config['root'],_0x25ecaa,_[_0xe8c2('0x74')](_0xe8c2('0x7d')));var _0x47b1f8=_0xe8c2('0x6d')+_[_0xe8c2('0x70')](_0xe8c2('0x67'));if(_0x32fc01[_0x47b1f8]||!_0x4fd487[_0xe8c2('0x6e')]){_0x26b725=path['join'](config[_0xe8c2('0x55')],_0x25ecaa,_[_0xe8c2('0x74')](_0xe8c2('0x7d')));}if(!fs[_0xe8c2('0x6b')](_0x26b725)){throw new db[(_0xe8c2('0x6f'))][(_0xe8c2('0x18'))](_[_0xe8c2('0x70')](_0xe8c2('0x67'))+_0xe8c2('0x76'));}return _0x35f555[_0xe8c2('0x71')](_0x26b725);}})[_0xe8c2('0x22')](handleError(_0x35f555,null));}; \ No newline at end of file +var _0x214e=['../../mysqldb','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','catch','sendStatus','status','json','offset','limit','set','Content-Range','apply','update','destroy','end','name','send','index','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','include','Setting','rows','params','rawAttributes','find','body','get','join','server/files/templates/stun.ejs','utf8','render','readFileSync','root','server/files/templates/turn.ejs','writeFileSync','/etc/asterisk/stun_xcally.conf','res_stun_monitor.so','Reload','res_rtp_asterisk.so','addLogo','file','filename','loginLogo','../../config/license/util','getLicense','logo','favicon','defaultLogo','defaultPreferred','defaultFavicon','existsSync','toLower','default_logo.png','default','upperFirst','custom','\x20not\x20found','download','getLogoLogin','server/files/images/logos','preferred','defaultLoginLogo','default_loginLogo.png','securePassword','addPreferred','default_preferred.png','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x3ed4d7,_0x3783e0){var _0x2be1a4=function(_0x5d492f){while(--_0x5d492f){_0x3ed4d7['push'](_0x3ed4d7['shift']());}};_0x2be1a4(++_0x3783e0);}(_0x214e,0xda));var _0xe214=function(_0x29f825,_0x3f1df8){_0x29f825=_0x29f825-0x0;var _0x12c953=_0x214e[_0x29f825];return _0x12c953;};'use strict';var pdf=require(_0xe214('0x0'));var emlformat=require(_0xe214('0x1'));var rimraf=require(_0xe214('0x2'));var zipdir=require(_0xe214('0x3'));var jsonpatch=require(_0xe214('0x4'));var rp=require(_0xe214('0x5'));var moment=require(_0xe214('0x6'));var BPromise=require(_0xe214('0x7'));var Mustache=require(_0xe214('0x8'));var util=require(_0xe214('0x9'));var path=require(_0xe214('0xa'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xe214('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe214('0xc'));var crypto=require('crypto');var jsforce=require(_0xe214('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xe214('0xe'));var querystring=require('querystring');var Papa=require(_0xe214('0xf'));var Redis=require(_0xe214('0x10'));var authService=require(_0xe214('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe214('0x12'));var hardwareService=require(_0xe214('0x13'));var logger=require(_0xe214('0x14'))(_0xe214('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe214('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xe214('0x17')][_0xe214('0x18')]({'port':0x232a});function checkPasswordPattern(_0x2719c3,_0x3a7231,_0x2f8761){if(_0x2f8761){var _0x36ec7f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36ec7f[_0xe214('0x19')](_0x3a7231)){return _0x2719c3;}else{throw new db[(_0xe214('0x1a'))][(_0xe214('0x1b'))](_0xe214('0x1c'));}}else{return _0x2719c3;}}function respondWithRpcPromise(_0x4ff30c,_0x37c9bc,_0x12b51b,_0x4cc57f){return new BPromise(function(_0x10d848,_0x12d046){var _0x10d4f1=_0x4cc57f||client;return _0x10d4f1['request'](_0x4ff30c,_0x12b51b)[_0xe214('0x1d')](function(_0x1da3c1){logger[_0xe214('0x1e')]('Setting,\x20%s,\x20%s',_0x37c9bc,_0xe214('0x1f'));logger['debug'](_0xe214('0x20'),_0x37c9bc,'request\x20sent',JSON[_0xe214('0x21')](_0x1da3c1));if(_0x1da3c1[_0xe214('0x22')]){if(_0x1da3c1['error'][_0xe214('0x23')]===0x1f4){logger['error'](_0xe214('0x24'),_0x37c9bc,_0x1da3c1[_0xe214('0x22')][_0xe214('0x25')]);return _0x12d046(_0x1da3c1[_0xe214('0x22')][_0xe214('0x25')]);}logger[_0xe214('0x22')](_0xe214('0x24'),_0x37c9bc,_0x1da3c1[_0xe214('0x22')][_0xe214('0x25')]);return _0x10d848(_0x1da3c1[_0xe214('0x22')]['message']);}else{logger[_0xe214('0x1e')](_0xe214('0x24'),_0x37c9bc,_0xe214('0x1f'));_0x10d848(_0x1da3c1['result'][_0xe214('0x25')]);}})[_0xe214('0x26')](function(_0x35a1dc){logger['error'](_0xe214('0x24'),_0x37c9bc,_0x35a1dc);_0x12d046(_0x35a1dc);});});}function respondWithStatusCode(_0x12464e,_0x2bd642){_0x2bd642=_0x2bd642||0xcc;return function(_0x19f57f){if(_0x19f57f){return _0x12464e[_0xe214('0x27')](_0x2bd642);}return _0x12464e['status'](_0x2bd642)['end']();};}function respondWithResult(_0x1ce265,_0x1493ed){_0x1493ed=_0x1493ed||0xc8;return function(_0x144d53){if(_0x144d53){return _0x1ce265[_0xe214('0x28')](_0x1493ed)[_0xe214('0x29')](_0x144d53);}};}function respondWithFilteredResult(_0x45ac54,_0x1a26e5){return function(_0x2027e9){if(_0x2027e9){var _0x4e0241=_0x2027e9['count'],_0x5abd03=_0x1a26e5['offset'],_0x3c30a2=_0x1a26e5[_0xe214('0x2a')]+_0x1a26e5[_0xe214('0x2b')],_0x2ed3a2;if(_0x3c30a2>=_0x4e0241){_0x3c30a2=_0x4e0241;_0x2ed3a2=0xc8;}else{_0x2ed3a2=0xce;}_0x45ac54[_0xe214('0x28')](_0x2ed3a2);return _0x45ac54[_0xe214('0x2c')](_0xe214('0x2d'),_0x5abd03+'-'+_0x3c30a2+'/'+_0x4e0241)[_0xe214('0x29')](_0x2027e9);}return null;};}function patchUpdates(_0x53c2e5){return function(_0x5d4b72){try{jsonpatch[_0xe214('0x2e')](_0x5d4b72,_0x53c2e5,!![]);}catch(_0x172cf6){return BPromise['reject'](_0x172cf6);}return _0x5d4b72['save']();};}function saveUpdates(_0x25b6d3,_0x17158){return function(_0x10cb49){if(_0x10cb49){return _0x10cb49[_0xe214('0x2f')](_0x25b6d3)[_0xe214('0x1d')](function(_0x33e1f5){return _0x33e1f5;});}return null;};}function removeEntity(_0x261853,_0x41b41e){return function(_0x4504c0){if(_0x4504c0){return _0x4504c0[_0xe214('0x30')]()[_0xe214('0x1d')](function(){_0x261853[_0xe214('0x28')](0xcc)[_0xe214('0x31')]();});}};}function handleEntityNotFound(_0x2d9406,_0x589075){return function(_0x2a3d8f){if(!_0x2a3d8f){_0x2d9406[_0xe214('0x27')](0x194);}return _0x2a3d8f;};}function handleError(_0x2f19f0,_0x2ba6f9){_0x2ba6f9=_0x2ba6f9||0x1f4;return function(_0x41d751){logger[_0xe214('0x22')](_0x41d751['stack']);if(_0x41d751[_0xe214('0x32')]){delete _0x41d751[_0xe214('0x32')];}_0x2f19f0['status'](_0x2ba6f9)[_0xe214('0x33')](_0x41d751);};}exports[_0xe214('0x34')]=function(_0x22d504,_0x32ca79){var _0x20f62b={},_0x292735={},_0x3cb64f={'count':0x0,'rows':[]};var _0x3a5649=_['map'](db['Setting']['rawAttributes'],function(_0x4433ba){return{'name':_0x4433ba['fieldName'],'type':_0x4433ba[_0xe214('0x35')]['key']};});_0x292735[_0xe214('0x36')]=_[_0xe214('0x37')](_0x3a5649,_0xe214('0x32'));_0x292735[_0xe214('0x38')]=_[_0xe214('0x39')](_0x22d504[_0xe214('0x38')]);_0x292735[_0xe214('0x3a')]=_[_0xe214('0x3b')](_0x292735[_0xe214('0x36')],_0x292735[_0xe214('0x38')]);_0x20f62b[_0xe214('0x3c')]=_[_0xe214('0x3b')](_0x292735['model'],qs[_0xe214('0x3d')](_0x22d504['query'][_0xe214('0x3d')]));_0x20f62b['attributes']=_0x20f62b[_0xe214('0x3c')][_0xe214('0x3e')]?_0x20f62b['attributes']:_0x292735[_0xe214('0x36')];if(!_0x22d504[_0xe214('0x38')][_0xe214('0x3f')](_0xe214('0x40'))){_0x20f62b[_0xe214('0x2b')]=qs[_0xe214('0x2b')](_0x22d504[_0xe214('0x38')]['limit']);_0x20f62b[_0xe214('0x2a')]=qs[_0xe214('0x2a')](_0x22d504['query'][_0xe214('0x2a')]);}_0x20f62b[_0xe214('0x41')]=qs[_0xe214('0x42')](_0x22d504[_0xe214('0x38')][_0xe214('0x42')]);_0x20f62b[_0xe214('0x43')]=qs[_0xe214('0x3a')](_[_0xe214('0x44')](_0x22d504['query'],_0x292735[_0xe214('0x3a')]));if(_0x22d504[_0xe214('0x38')][_0xe214('0x45')]){_0x20f62b[_0xe214('0x43')]=_[_0xe214('0x46')](_0x20f62b['where'],{'$or':_[_0xe214('0x37')](_0x3a5649,function(_0x3e5c68){if(_0x3e5c68[_0xe214('0x35')]!=='VIRTUAL'){var _0x27b4ec={};_0x27b4ec[_0x3e5c68[_0xe214('0x32')]]={'$like':'%'+_0x22d504[_0xe214('0x38')][_0xe214('0x45')]+'%'};return _0x27b4ec;}})});}_0x20f62b=_[_0xe214('0x46')]({},_0x20f62b,_0x22d504['options']);var _0x11351c={'where':_0x20f62b[_0xe214('0x43')]};return db['Setting'][_0xe214('0x47')](_0x11351c)[_0xe214('0x1d')](function(_0x283cd2){_0x3cb64f[_0xe214('0x47')]=_0x283cd2;if(_0x22d504[_0xe214('0x38')]['includeAll']){_0x20f62b[_0xe214('0x48')]=[{'all':!![]}];}return db[_0xe214('0x49')]['findAll'](_0x20f62b);})[_0xe214('0x1d')](function(_0x24e8d5){_0x3cb64f[_0xe214('0x4a')]=_0x24e8d5;return _0x3cb64f;})['then'](respondWithFilteredResult(_0x32ca79,_0x20f62b))[_0xe214('0x26')](handleError(_0x32ca79,null));};exports['show']=function(_0x2945e3,_0x22defb){var _0x52aa18={'raw':![],'where':{'id':_0x2945e3[_0xe214('0x4b')]['id']}},_0xe7a3f1={};_0xe7a3f1[_0xe214('0x36')]=_[_0xe214('0x39')](db['Setting'][_0xe214('0x4c')]);_0xe7a3f1[_0xe214('0x38')]=_[_0xe214('0x39')](_0x2945e3[_0xe214('0x38')]);_0xe7a3f1[_0xe214('0x3a')]=_[_0xe214('0x3b')](_0xe7a3f1[_0xe214('0x36')],_0xe7a3f1[_0xe214('0x38')]);_0x52aa18['attributes']=_[_0xe214('0x3b')](_0xe7a3f1[_0xe214('0x36')],qs['fields'](_0x2945e3['query'][_0xe214('0x3d')]));_0x52aa18[_0xe214('0x3c')]=_0x52aa18[_0xe214('0x3c')][_0xe214('0x3e')]?_0x52aa18[_0xe214('0x3c')]:_0xe7a3f1['model'];if(_0x2945e3[_0xe214('0x38')]['includeAll']){_0x52aa18[_0xe214('0x48')]=[{'all':!![]}];}_0x52aa18=_[_0xe214('0x46')]({},_0x52aa18,_0x2945e3['options']);return db[_0xe214('0x49')][_0xe214('0x4d')](_0x52aa18)['then'](handleEntityNotFound(_0x22defb,null))[_0xe214('0x1d')](respondWithResult(_0x22defb,null))[_0xe214('0x26')](handleError(_0x22defb,null));};exports[_0xe214('0x2f')]=function(_0x5cf43e,_0x2d0853,_0x52d8f8){var _0x1b2fe1;return db[_0xe214('0x49')][_0xe214('0x4d')]({'where':{'id':_0x5cf43e[_0xe214('0x4b')]['id']}})[_0xe214('0x1d')](handleEntityNotFound(_0x2d0853,null))['then'](saveUpdates(_0x5cf43e[_0xe214('0x4e')],null))[_0xe214('0x1d')](function(_0xa55b12){if(_0xa55b12){_0x1b2fe1=_0xa55b12[_0xe214('0x4f')]({'plain':!![]});var _0x135b9f=fs['readFileSync'](path[_0xe214('0x50')](config['root'],_0xe214('0x51')),_0xe214('0x52'));var _0x54f169=ejs[_0xe214('0x53')](_0x135b9f,_0x1b2fe1);var _0x2550dc=fs[_0xe214('0x54')](path[_0xe214('0x50')](config[_0xe214('0x55')],_0xe214('0x56')),_0xe214('0x52'));var _0x33a9ed=ejs[_0xe214('0x53')](_0x2550dc,_0x1b2fe1);fs[_0xe214('0x57')](_0xe214('0x58'),_0x54f169);fs['writeFileSync']('/etc/asterisk/turn_xcally.conf',_0x33a9ed);return respondWithRpcPromise('Reload',_0xe214('0x2f'),{'module':_0xe214('0x59')});}})['then'](function(){return respondWithRpcPromise(_0xe214('0x5a'),'update',{'module':_0xe214('0x5b')});})[_0xe214('0x1d')](function(){return _0x1b2fe1||null;})[_0xe214('0x1d')](respondWithResult(_0x2d0853,null))[_0xe214('0x26')](handleError(_0x2d0853,null));};exports[_0xe214('0x5c')]=function(_0xa9cf03,_0x81c4a0,_0x3227c9){if(_0xa9cf03[_0xe214('0x5d')]&&_0xa9cf03[_0xe214('0x5d')][_0xe214('0x5e')]){_0xa9cf03[_0xe214('0x4e')]['logo']=_0xa9cf03[_0xe214('0x5d')]['filename'];}return db[_0xe214('0x49')][_0xe214('0x4d')]({'where':{'id':_0xa9cf03[_0xe214('0x4b')]['id']}})[_0xe214('0x1d')](handleEntityNotFound(_0x81c4a0,null))[_0xe214('0x1d')](saveUpdates(_0xa9cf03[_0xe214('0x4e')],null))['then'](respondWithResult(_0x81c4a0,null))[_0xe214('0x26')](handleError(_0x81c4a0,null));};exports['addLogoLogin']=function(_0x5a445e,_0x27f317,_0x55d1e5){if(_0x5a445e[_0xe214('0x5d')]&&_0x5a445e[_0xe214('0x5d')][_0xe214('0x5e')]){_0x5a445e['body'][_0xe214('0x5f')]=_0x5a445e['file']['filename'];}return db[_0xe214('0x49')]['find']({'where':{'id':_0x5a445e['params']['id']}})[_0xe214('0x1d')](handleEntityNotFound(_0x27f317,null))['then'](saveUpdates(_0x5a445e[_0xe214('0x4e')],null))[_0xe214('0x1d')](respondWithResult(_0x27f317,null))[_0xe214('0x26')](handleError(_0x27f317,null));};var utilLicense=require(_0xe214('0x60'));exports['getLogo']=function(_0x16f7d4,_0x29b8d9,_0x35d830){var _0x3646cb='server/files/images/logos';var _0x243260={'custom':![]};return utilLicense[_0xe214('0x61')]()[_0xe214('0x1d')](function(_0x181b46){if(_0x181b46){_0x243260=_0x181b46;}return db[_0xe214('0x49')][_0xe214('0x4d')]({'where':{'id':_0x16f7d4['params']['id']},'attributes':[_0xe214('0x62'),_0xe214('0x5f'),'preferred',_0xe214('0x63'),_0xe214('0x64'),'defaultLoginLogo',_0xe214('0x65'),_0xe214('0x66')],'raw':!![]});})[_0xe214('0x1d')](handleEntityNotFound(_0x29b8d9,null))[_0xe214('0x1d')](function(_0x5dfac6){if(_0x5dfac6){var _0x33daae=_0x5dfac6[_0xe214('0x62')]&&fs[_0xe214('0x67')](path[_0xe214('0x50')](config[_0xe214('0x55')],_0x3646cb,_[_0xe214('0x68')](_0x5dfac6['logo'])))?path['join'](config[_0xe214('0x55')],_0x3646cb,_[_0xe214('0x68')](_0x5dfac6[_0xe214('0x62')])):path[_0xe214('0x50')](config[_0xe214('0x55')],_0x3646cb,_[_0xe214('0x68')](_0xe214('0x69')));var _0x38e556=_0xe214('0x6a')+_[_0xe214('0x6b')]('logo');if(_0x5dfac6[_0x38e556]||!_0x243260[_0xe214('0x6c')]){_0x33daae=path[_0xe214('0x50')](config['root'],_0x3646cb,_[_0xe214('0x68')](_0xe214('0x69')));}if(!fs[_0xe214('0x67')](_0x33daae)){throw new db[(_0xe214('0x1a'))][(_0xe214('0x1b'))](_[_0xe214('0x6b')]('logo')+_0xe214('0x6d'));}return _0x29b8d9[_0xe214('0x6e')](_0x33daae);}})[_0xe214('0x26')](handleError(_0x29b8d9,null));};var utilLicense=require(_0xe214('0x60'));exports[_0xe214('0x6f')]=function(_0x1e10f7,_0xfafc4d,_0x271ba1){var _0xc85ff7=_0xe214('0x70');var _0x196a28={'custom':![]};return utilLicense[_0xe214('0x61')]()['then'](function(_0x13dad8){if(_0x13dad8){_0x196a28=_0x13dad8;}return db[_0xe214('0x49')][_0xe214('0x4d')]({'where':{'id':_0x1e10f7['params']['id']},'attributes':[_0xe214('0x62'),_0xe214('0x5f'),_0xe214('0x71'),_0xe214('0x63'),_0xe214('0x64'),_0xe214('0x72'),_0xe214('0x65'),_0xe214('0x66')],'raw':!![]});})[_0xe214('0x1d')](handleEntityNotFound(_0xfafc4d,null))[_0xe214('0x1d')](function(_0xdf90d0){if(_0xdf90d0){var _0x2959d8=_0xdf90d0[_0xe214('0x5f')]&&fs[_0xe214('0x67')](path[_0xe214('0x50')](config[_0xe214('0x55')],_0xc85ff7,_[_0xe214('0x68')](_0xdf90d0['loginLogo'])))?path[_0xe214('0x50')](config[_0xe214('0x55')],_0xc85ff7,_[_0xe214('0x68')](_0xdf90d0[_0xe214('0x5f')])):path['join'](config[_0xe214('0x55')],_0xc85ff7,_[_0xe214('0x68')]('default_loginLogo.png'));var _0x1b2390=_0xe214('0x6a')+_['upperFirst'](_0xe214('0x5f'));if(_0xdf90d0[_0x1b2390]||!_0x196a28[_0xe214('0x6c')]){_0x2959d8=path['join'](config['root'],_0xc85ff7,_[_0xe214('0x68')](_0xe214('0x73')));}if(!fs[_0xe214('0x67')](_0x2959d8)){throw new db['Sequelize']['ValidationError'](_[_0xe214('0x6b')](_0xe214('0x5f'))+_0xe214('0x6d'));}return _0xfafc4d[_0xe214('0x6e')](_0x2959d8);}})[_0xe214('0x26')](handleError(_0xfafc4d,null));};exports['gdpr']=function(_0xbc8023,_0x738c53){return db[_0xe214('0x49')][_0xe214('0x4d')]({'where':{'id':_0xbc8023[_0xe214('0x4b')]['id']},'attributes':[_0xe214('0x74')]})[_0xe214('0x1d')](respondWithResult(_0x738c53,null))['catch'](handleError(_0x738c53,null));};exports[_0xe214('0x75')]=function(_0x53b886,_0x5db188,_0x253640){if(_0x53b886[_0xe214('0x5d')]&&_0x53b886[_0xe214('0x5d')][_0xe214('0x5e')]){_0x53b886[_0xe214('0x4e')][_0xe214('0x71')]=_0x53b886[_0xe214('0x5d')][_0xe214('0x5e')];}return db['Setting'][_0xe214('0x4d')]({'where':{'id':_0x53b886['params']['id']}})['then'](handleEntityNotFound(_0x5db188,null))[_0xe214('0x1d')](saveUpdates(_0x53b886[_0xe214('0x4e')],null))['then'](respondWithResult(_0x5db188,null))[_0xe214('0x26')](handleError(_0x5db188,null));};var utilLicense=require('../../config/license/util');exports['getPreferred']=function(_0x2df8e1,_0x3fa86d,_0x31be1f){var _0x3e8266=_0xe214('0x70');var _0x2c776c={'custom':![]};return utilLicense[_0xe214('0x61')]()[_0xe214('0x1d')](function(_0xc458e){if(_0xc458e){_0x2c776c=_0xc458e;}return db[_0xe214('0x49')][_0xe214('0x4d')]({'where':{'id':_0x2df8e1[_0xe214('0x4b')]['id']},'attributes':[_0xe214('0x62'),_0xe214('0x5f'),'preferred',_0xe214('0x63'),_0xe214('0x64'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x3fa86d,null))[_0xe214('0x1d')](function(_0x195663){if(_0x195663){var _0x3145b6=_0x195663[_0xe214('0x71')]&&fs[_0xe214('0x67')](path[_0xe214('0x50')](config[_0xe214('0x55')],_0x3e8266,_[_0xe214('0x68')](_0x195663[_0xe214('0x71')])))?path[_0xe214('0x50')](config[_0xe214('0x55')],_0x3e8266,_[_0xe214('0x68')](_0x195663[_0xe214('0x71')])):path[_0xe214('0x50')](config['root'],_0x3e8266,_[_0xe214('0x68')]('default_preferred.png'));var _0x438f2b=_0xe214('0x6a')+_[_0xe214('0x6b')]('preferred');if(_0x195663[_0x438f2b]||!_0x2c776c[_0xe214('0x6c')]||!_0x2c776c[_0xe214('0x71')]){_0x3145b6=path[_0xe214('0x50')](config[_0xe214('0x55')],_0x3e8266,_[_0xe214('0x68')](_0xe214('0x76')));}if(!fs[_0xe214('0x67')](_0x3145b6)){throw new db[(_0xe214('0x1a'))][(_0xe214('0x1b'))](_['upperFirst'](_0xe214('0x71'))+_0xe214('0x6d'));}return _0x3fa86d[_0xe214('0x6e')](_0x3145b6);}})[_0xe214('0x26')](handleError(_0x3fa86d,null));};exports['addFavicon']=function(_0x10b928,_0x54b651,_0x40a252){if(_0x10b928[_0xe214('0x5d')]&&_0x10b928['file'][_0xe214('0x5e')]){_0x10b928[_0xe214('0x4e')][_0xe214('0x63')]=_0x10b928['file'][_0xe214('0x5e')];}return db[_0xe214('0x49')][_0xe214('0x4d')]({'where':{'id':_0x10b928['params']['id']}})[_0xe214('0x1d')](handleEntityNotFound(_0x54b651,null))['then'](saveUpdates(_0x10b928[_0xe214('0x4e')],null))[_0xe214('0x1d')](respondWithResult(_0x54b651,null))['catch'](handleError(_0x54b651,null));};var utilLicense=require(_0xe214('0x60'));exports['getFavicon']=function(_0x4bc2ab,_0x1962b0,_0x55e298){var _0xcb70db=_0xe214('0x70');var _0x3e229b={'custom':![]};return utilLicense[_0xe214('0x61')]()[_0xe214('0x1d')](function(_0x936cac){if(_0x936cac){_0x3e229b=_0x936cac;}return db[_0xe214('0x49')][_0xe214('0x4d')]({'where':{'id':_0x4bc2ab[_0xe214('0x4b')]['id']},'attributes':[_0xe214('0x62'),_0xe214('0x5f'),'preferred','favicon',_0xe214('0x64'),_0xe214('0x72'),_0xe214('0x65'),_0xe214('0x66')],'raw':!![]});})[_0xe214('0x1d')](handleEntityNotFound(_0x1962b0,null))[_0xe214('0x1d')](function(_0x266727){if(_0x266727){var _0x554ef3=_0x266727[_0xe214('0x63')]&&fs[_0xe214('0x67')](path[_0xe214('0x50')](config['root'],_0xcb70db,_['toLower'](_0x266727[_0xe214('0x63')])))?path[_0xe214('0x50')](config[_0xe214('0x55')],_0xcb70db,_[_0xe214('0x68')](_0x266727[_0xe214('0x63')])):path['join'](config[_0xe214('0x55')],_0xcb70db,_['toLower']('default_favicon.ico'));var _0x1ade85=_0xe214('0x6a')+_[_0xe214('0x6b')](_0xe214('0x63'));if(_0x266727[_0x1ade85]||!_0x3e229b['custom']){_0x554ef3=path['join'](config[_0xe214('0x55')],_0xcb70db,_[_0xe214('0x68')](_0xe214('0x77')));}if(!fs[_0xe214('0x67')](_0x554ef3)){throw new db[(_0xe214('0x1a'))]['ValidationError'](_[_0xe214('0x6b')]('favicon')+'\x20not\x20found');}return _0x1962b0[_0xe214('0x6e')](_0x554ef3);}})[_0xe214('0x26')](handleError(_0x1962b0,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 5df99f4..ed96b15 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 _0xf5e4=['../../config/logger','moment','bluebird','path','./setting.attributes','exports','define','Setting','settings','lodash'];(function(_0x4d9bb2,_0x3db50d){var _0x3179fe=function(_0x5272f3){while(--_0x5272f3){_0x4d9bb2['push'](_0x4d9bb2['shift']());}};_0x3179fe(++_0x3db50d);}(_0xf5e4,0x10d));var _0x4f5e=function(_0x11e1c6,_0x1d0d51){_0x11e1c6=_0x11e1c6-0x0;var _0x2aec74=_0xf5e4[_0x11e1c6];return _0x2aec74;};'use strict';var _=require(_0x4f5e('0x0'));var util=require('util');var logger=require(_0x4f5e('0x1'))('api');var moment=require(_0x4f5e('0x2'));var BPromise=require(_0x4f5e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4f5e('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4f5e('0x5'));module[_0x4f5e('0x6')]=function(_0x40157b,_0x179833){return _0x40157b[_0x4f5e('0x7')](_0x4f5e('0x8'),attributes,{'tableName':_0x4f5e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfd24=['define','Setting','settings','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./setting.attributes'];(function(_0x13ef2d,_0x5aa82f){var _0xf62c41=function(_0x26ce22){while(--_0x26ce22){_0x13ef2d['push'](_0x13ef2d['shift']());}};_0xf62c41(++_0x5aa82f);}(_0xfd24,0x1e3));var _0x4fd2=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0xfd24[_0x48e1ec];return _0x3b33eb;};'use strict';var _=require('lodash');var util=require(_0x4fd2('0x0'));var logger=require(_0x4fd2('0x1'))(_0x4fd2('0x2'));var moment=require(_0x4fd2('0x3'));var BPromise=require(_0x4fd2('0x4'));var rp=require(_0x4fd2('0x5'));var fs=require('fs');var path=require(_0x4fd2('0x6'));var rimraf=require(_0x4fd2('0x7'));var config=require('../../config/environment');var attributes=require(_0x4fd2('0x8'));module['exports']=function(_0x341ddc,_0xf8001f){return _0x341ddc[_0x4fd2('0x9')](_0x4fd2('0xa'),attributes,{'tableName':_0x4fd2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/setting/setting.rpc.js b/server/api/setting/setting.rpc.js index 016b265..15520ad 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 _0xeb80=['Setting,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x165668,_0x590533){var _0x1d97a7=function(_0x2d7dd2){while(--_0x2d7dd2){_0x165668['push'](_0x165668['shift']());}};_0x1d97a7(++_0x590533);}(_0xeb80,0x14a));var _0x0eb8=function(_0x142207,_0x45055d){_0x142207=_0x142207-0x0;var _0x2997c4=_0xeb80[_0x142207];return _0x2997c4;};'use strict';var _=require('lodash');var util=require(_0x0eb8('0x0'));var moment=require(_0x0eb8('0x1'));var BPromise=require('bluebird');var rs=require(_0x0eb8('0x2'));var fs=require('fs');var Redis=require(_0x0eb8('0x3'));var db=require(_0x0eb8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x0eb8('0x5'))(_0x0eb8('0x6'));var config=require('../../config/environment');var jayson=require(_0x0eb8('0x7'));var client=jayson[_0x0eb8('0x8')][_0x0eb8('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x229445,_0x5dc0af,_0x4d5567){return new BPromise(function(_0x5d91cd,_0xd63785){return client[_0x0eb8('0xa')](_0x229445,_0x4d5567)['then'](function(_0x2142ab){logger[_0x0eb8('0xb')](_0x0eb8('0xc'),_0x5dc0af,_0x0eb8('0xd'));logger[_0x0eb8('0xe')]('Setting,\x20%s,\x20%s,\x20%s',_0x5dc0af,_0x0eb8('0xd'),JSON[_0x0eb8('0xf')](_0x2142ab));if(_0x2142ab['error']){if(_0x2142ab[_0x0eb8('0x10')]['code']===0x1f4){logger[_0x0eb8('0x10')](_0x0eb8('0xc'),_0x5dc0af,_0x2142ab[_0x0eb8('0x10')][_0x0eb8('0x11')]);return _0xd63785(_0x2142ab['error'][_0x0eb8('0x11')]);}logger['error'](_0x0eb8('0xc'),_0x5dc0af,_0x2142ab[_0x0eb8('0x10')][_0x0eb8('0x11')]);return _0x5d91cd(_0x2142ab[_0x0eb8('0x10')][_0x0eb8('0x11')]);}else{logger['info'](_0x0eb8('0xc'),_0x5dc0af,_0x0eb8('0xd'));_0x5d91cd(_0x2142ab['result'][_0x0eb8('0x11')]);}})[_0x0eb8('0x12')](function(_0x523a6a){logger[_0x0eb8('0x10')](_0x0eb8('0xc'),_0x5dc0af,_0x523a6a);_0xd63785(_0x523a6a);});});} \ No newline at end of file +var _0x9734=['moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','util'];(function(_0x468e4e,_0x1224de){var _0x4c8395=function(_0x46913a){while(--_0x46913a){_0x468e4e['push'](_0x468e4e['shift']());}};_0x4c8395(++_0x1224de);}(_0x9734,0x1a3));var _0x4973=function(_0x320886,_0x223260){_0x320886=_0x320886-0x0;var _0x45e939=_0x9734[_0x320886];return _0x45e939;};'use strict';var _=require('lodash');var util=require(_0x4973('0x0'));var moment=require(_0x4973('0x1'));var BPromise=require('bluebird');var rs=require(_0x4973('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4973('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x4973('0x4'))(_0x4973('0x5'));var config=require(_0x4973('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4973('0x7')][_0x4973('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x7460b9,_0x3d7f5d,_0x2d431a){return new BPromise(function(_0x4a9bf2,_0x517c58){return client[_0x4973('0x9')](_0x7460b9,_0x2d431a)[_0x4973('0xa')](function(_0x2b2a22){logger['info'](_0x4973('0xb'),_0x3d7f5d,_0x4973('0xc'));logger[_0x4973('0xd')](_0x4973('0xe'),_0x3d7f5d,_0x4973('0xc'),JSON[_0x4973('0xf')](_0x2b2a22));if(_0x2b2a22['error']){if(_0x2b2a22['error'][_0x4973('0x10')]===0x1f4){logger[_0x4973('0x11')](_0x4973('0xb'),_0x3d7f5d,_0x2b2a22['error'][_0x4973('0x12')]);return _0x517c58(_0x2b2a22[_0x4973('0x11')][_0x4973('0x12')]);}logger[_0x4973('0x11')](_0x4973('0xb'),_0x3d7f5d,_0x2b2a22['error'][_0x4973('0x12')]);return _0x4a9bf2(_0x2b2a22[_0x4973('0x11')][_0x4973('0x12')]);}else{logger[_0x4973('0x13')](_0x4973('0xb'),_0x3d7f5d,'request\x20sent');_0x4a9bf2(_0x2b2a22[_0x4973('0x14')][_0x4973('0x12')]);}})['catch'](function(_0x1be7b8){logger[_0x4973('0x11')](_0x4973('0xb'),_0x3d7f5d,_0x1be7b8);_0x517c58(_0x1be7b8);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 294b469..b3f3daf 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 _0xaa5f=['getDispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/status','statusGet','create','post','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','addApplications','/:id/send','send','status','addAgents','put','delete','destroy','removeDispositions','/:id/users','removeAgents','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsAccount.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/dispositions'];(function(_0x52455e,_0x2e0ccd){var _0x5a7636=function(_0x4de2fd){while(--_0x4de2fd){_0x52455e['push'](_0x52455e['shift']());}};_0x5a7636(++_0x2e0ccd);}(_0xaa5f,0x68));var _0xfaa5=function(_0x36d93a,_0x573346){_0x36d93a=_0x36d93a-0x0;var _0x6de698=_0xaa5f[_0x36d93a];return _0x6de698;};'use strict';var multer=require(_0xfaa5('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xfaa5('0x1'));var express=require('express');var router=express[_0xfaa5('0x2')]();var auth=require(_0xfaa5('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xfaa5('0x4'));var controller=require(_0xfaa5('0x5'));router[_0xfaa5('0x6')]('/',auth[_0xfaa5('0x7')](),controller['index']);router[_0xfaa5('0x6')](_0xfaa5('0x8'),auth['isAuthenticated'](),controller[_0xfaa5('0x9')]);router[_0xfaa5('0x6')](_0xfaa5('0xa'),auth[_0xfaa5('0x7')](),controller[_0xfaa5('0xb')]);router[_0xfaa5('0x6')](_0xfaa5('0xc'),auth[_0xfaa5('0x7')](),controller[_0xfaa5('0xd')]);router[_0xfaa5('0x6')]('/:id/canned_answers',auth[_0xfaa5('0x7')](),controller[_0xfaa5('0xe')]);router[_0xfaa5('0x6')](_0xfaa5('0xf'),auth['isAuthenticated'](),controller[_0xfaa5('0x10')]);router[_0xfaa5('0x6')](_0xfaa5('0x11'),auth[_0xfaa5('0x7')](),controller[_0xfaa5('0x12')]);router[_0xfaa5('0x6')](_0xfaa5('0x13'),controller[_0xfaa5('0x14')]);router[_0xfaa5('0x6')]('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router['post']('/',auth['isAuthenticated'](),controller[_0xfaa5('0x15')]);router[_0xfaa5('0x16')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0xfaa5('0x17')]);router[_0xfaa5('0x16')](_0xfaa5('0x18'),auth['isAuthenticated'](),controller[_0xfaa5('0x19')]);router[_0xfaa5('0x16')](_0xfaa5('0x1a'),controller['notify']);router['post'](_0xfaa5('0xf'),auth[_0xfaa5('0x7')](),controller[_0xfaa5('0x1b')]);router[_0xfaa5('0x16')](_0xfaa5('0x1c'),auth[_0xfaa5('0x7')](),controller[_0xfaa5('0x1d')]);router[_0xfaa5('0x16')]('/:id/status',controller[_0xfaa5('0x1e')]);router[_0xfaa5('0x16')]('/:id/users',auth['isAuthenticated'](),controller[_0xfaa5('0x1f')]);router[_0xfaa5('0x20')](_0xfaa5('0xa'),auth[_0xfaa5('0x7')](),controller['update']);router[_0xfaa5('0x21')](_0xfaa5('0xa'),auth[_0xfaa5('0x7')](),controller[_0xfaa5('0x22')]);router[_0xfaa5('0x21')]('/:id/dispositions',auth[_0xfaa5('0x7')](),controller[_0xfaa5('0x23')]);router[_0xfaa5('0x21')](_0xfaa5('0x18'),auth[_0xfaa5('0x7')](),controller['removeAnswers']);router['delete'](_0xfaa5('0x24'),auth[_0xfaa5('0x7')](),controller[_0xfaa5('0x25')]);module[_0xfaa5('0x26')]=router; \ No newline at end of file +var _0xb302=['../../components/interaction/service','./smsAccount.controller','index','get','isAuthenticated','describe','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','statusGet','post','create','/:id/dispositions','addDisposition','addAnswer','/:id/notify','notify','send','put','delete','destroy','removeDispositions','removeAnswers','/:id/users','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x628eee,_0x3f3fba){var _0x447718=function(_0x38112b){while(--_0x38112b){_0x628eee['push'](_0x628eee['shift']());}};_0x447718(++_0x3f3fba);}(_0xb302,0x19f));var _0x2b30=function(_0x3a4817,_0x5ef20a){_0x3a4817=_0x3a4817-0x0;var _0x18a988=_0xb302[_0x3a4817];return _0x18a988;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b30('0x0'));var timeout=require(_0x2b30('0x1'));var express=require(_0x2b30('0x2'));var router=express[_0x2b30('0x3')]();var auth=require(_0x2b30('0x4'));var interaction=require(_0x2b30('0x5'));var config=require('../../config/environment');var controller=require(_0x2b30('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x2b30('0x7')]);router[_0x2b30('0x8')]('/describe',auth[_0x2b30('0x9')](),controller[_0x2b30('0xa')]);router['get'](_0x2b30('0xb'),auth[_0x2b30('0x9')](),controller[_0x2b30('0xc')]);router['get']('/:id/dispositions',auth[_0x2b30('0x9')](),controller[_0x2b30('0xd')]);router[_0x2b30('0x8')](_0x2b30('0xe'),auth['isAuthenticated'](),controller[_0x2b30('0xf')]);router[_0x2b30('0x8')](_0x2b30('0x10'),auth[_0x2b30('0x9')](),controller[_0x2b30('0x11')]);router[_0x2b30('0x8')](_0x2b30('0x12'),auth[_0x2b30('0x9')](),controller['getInteractions']);router[_0x2b30('0x8')]('/:id/status',controller[_0x2b30('0x13')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0x2b30('0x14')]('/',auth[_0x2b30('0x9')](),controller[_0x2b30('0x15')]);router[_0x2b30('0x14')](_0x2b30('0x16'),auth['isAuthenticated'](),controller[_0x2b30('0x17')]);router[_0x2b30('0x14')](_0x2b30('0xe'),auth[_0x2b30('0x9')](),controller[_0x2b30('0x18')]);router[_0x2b30('0x14')](_0x2b30('0x19'),controller[_0x2b30('0x1a')]);router[_0x2b30('0x14')](_0x2b30('0x10'),auth[_0x2b30('0x9')](),controller['addApplications']);router[_0x2b30('0x14')]('/:id/send',auth[_0x2b30('0x9')](),controller[_0x2b30('0x1b')]);router['post']('/:id/status',controller['status']);router[_0x2b30('0x14')]('/:id/users',auth[_0x2b30('0x9')](),controller['addAgents']);router[_0x2b30('0x1c')](_0x2b30('0xb'),auth[_0x2b30('0x9')](),controller['update']);router[_0x2b30('0x1d')](_0x2b30('0xb'),auth[_0x2b30('0x9')](),controller[_0x2b30('0x1e')]);router[_0x2b30('0x1d')](_0x2b30('0x16'),auth[_0x2b30('0x9')](),controller[_0x2b30('0x1f')]);router[_0x2b30('0x1d')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x2b30('0x20')]);router[_0x2b30('0x1d')](_0x2b30('0x21'),auth[_0x2b30('0x9')](),controller['removeAgents']);module[_0x2b30('0x22')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index f71767c..1c3ef3b 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 _0x22fb=['mandatoryDispositionPauseId','setDataValue','mandatoryDisposition','exports','name','STRING','generate','ENUM','twilio','skebby','connectel','clicksend','plivo','csc','infobip','intelepeer','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER'];(function(_0x455893,_0x909838){var _0x3851e8=function(_0x32ac8a){while(--_0x32ac8a){_0x455893['push'](_0x455893['shift']());}};_0x3851e8(++_0x909838);}(_0x22fb,0x192));var _0xb22f=function(_0xb5ab57,_0xd8f7){_0xb5ab57=_0xb5ab57-0x0;var _0x1690e1=_0x22fb[_0xb5ab57];return _0x1690e1;};'use strict';var Sequelize=require('sequelize');var rs=require('randomstring');module[_0xb22f('0x0')]={'name':{'type':Sequelize['STRING'],'unique':_0xb22f('0x1'),'allowNull':![]},'key':{'type':Sequelize[_0xb22f('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xb22f('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xb22f('0x2')],'defaultValue':function(){return rs[_0xb22f('0x3')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xb22f('0x4')](_0xb22f('0x5'),_0xb22f('0x6'),_0xb22f('0x7'),_0xb22f('0x8'),_0xb22f('0x9'),'clickatell',_0xb22f('0xa'),_0xb22f('0xb'),_0xb22f('0xc'))},'accountSid':{'type':Sequelize[_0xb22f('0x2')]},'authId':{'type':Sequelize[_0xb22f('0x2')]},'authToken':{'type':Sequelize[_0xb22f('0x2')]},'smsMethod':{'type':Sequelize[_0xb22f('0x4')]('SI','TI','GP')},'username':{'type':Sequelize[_0xb22f('0x2')]},'password':{'type':Sequelize[_0xb22f('0x2')]},'apiKey':{'type':Sequelize[_0xb22f('0x2')]},'senderString':{'type':Sequelize[_0xb22f('0x2')]},'deliveryReport':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xb22f('0xd');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xb22f('0xe')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb22f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb22f('0xe')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb22f('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xb22f('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xb22f('0xf')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xb22f('0xe')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x36e2a8){if(!_0x36e2a8)this['setDataValue'](_0xb22f('0x10'),null);this[_0xb22f('0x11')](_0xb22f('0x12'),_0x36e2a8);}}}; \ No newline at end of file +var _0x17ba=['ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate'];(function(_0x18853d,_0x354600){var _0x8a9894=function(_0x19843c){while(--_0x19843c){_0x18853d['push'](_0x18853d['shift']());}};_0x8a9894(++_0x354600);}(_0x17ba,0xab));var _0xa17b=function(_0x162ca3,_0x408a52){_0x162ca3=_0x162ca3-0x0;var _0x418aca=_0x17ba[_0x162ca3];return _0x418aca;};'use strict';var Sequelize=require(_0xa17b('0x0'));var rs=require(_0xa17b('0x1'));module['exports']={'name':{'type':Sequelize[_0xa17b('0x2')],'unique':_0xa17b('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xa17b('0x2')],'allowNull':![]},'token':{'type':Sequelize[_0xa17b('0x2')],'defaultValue':function(){return rs[_0xa17b('0x4')]();}},'phone':{'type':Sequelize[_0xa17b('0x2')]},'type':{'type':Sequelize[_0xa17b('0x5')](_0xa17b('0x6'),_0xa17b('0x7'),_0xa17b('0x8'),_0xa17b('0x9'),_0xa17b('0xa'),_0xa17b('0xb'),_0xa17b('0xc'),_0xa17b('0xd'),_0xa17b('0xe'))},'accountSid':{'type':Sequelize[_0xa17b('0x2')]},'authId':{'type':Sequelize[_0xa17b('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xa17b('0x5')]('SI','TI','GP')},'username':{'type':Sequelize[_0xa17b('0x2')]},'password':{'type':Sequelize[_0xa17b('0x2')]},'apiKey':{'type':Sequelize[_0xa17b('0x2')]},'senderString':{'type':Sequelize[_0xa17b('0x2')]},'deliveryReport':{'type':Sequelize[_0xa17b('0xf')],'defaultValue':![]},'description':{'type':Sequelize[_0xa17b('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0xa17b('0x10');}},'notificationSound':{'type':Sequelize[_0xa17b('0xf')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xa17b('0xf')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xa17b('0xf')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xa17b('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xa17b('0xf')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xa17b('0x11')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xa17b('0x11')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0xa17b('0xf')],'defaultValue':![],'comment':_0xa17b('0x12'),'set':function(_0x5de138){if(!_0x5de138)this[_0xa17b('0x13')](_0xa17b('0x14'),null);this[_0xa17b('0x13')](_0xa17b('0x15'),_0x5de138);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index bb1f615..b3c9bdf 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 _0x255f=['received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','clickatell','intelepeer','redif','clicksend','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','ACCEPTD','statusGet','state','message-id','addAgents','emit','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','socket.io-emitter','./smsAccount.socket','register','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','VIRTUAL','filter','merge','options','includeAll','rows','show','params','include','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','describe','addDisposition','SmsAccountId','Disposition','getDispositions','findOne','pick','findAll','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','SmsApplication','Applications','account','applications','priority','asc','CmContact','Sequelize','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','From','Body','messageId','MessageSid','skebby','sender','text','message_id','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','fromNumber','replyMessageId','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','omit','defaults','SmsInteraction','spread','interaction','created','close','unmanaged','*,*,*,*','ContactId','AttachmentId','UserId','User','agent','Start','startRouting','receiveMessage','entity\x20found','Content-Type','text/xml','sequelize','transaction','bulkCreate','getApplications','Owner','fullname','Tag','Tags','color','tag','send','to\x20is\x20mandatory','List','user','out','SmsMessage','Messages','dataValues','endpoint\x20/status\x20POST\x20/','SmsAccount,\x20%s,\x20%s,\x20%s'];(function(_0x365335,_0x5cb534){var _0x2124b7=function(_0x1efa40){while(--_0x1efa40){_0x365335['push'](_0x365335['shift']());}};_0x2124b7(++_0x5cb534);}(_0x255f,0x1d6));var _0xf255=function(_0x236c44,_0x234ce8){_0x236c44=_0x236c44-0x0;var _0x277b0d=_0x255f[_0x236c44];return _0x277b0d;};'use strict';var pdf=require(_0xf255('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf255('0x1'));var zipdir=require(_0xf255('0x2'));var jsonpatch=require(_0xf255('0x3'));var rp=require('request-promise');var moment=require(_0xf255('0x4'));var BPromise=require(_0xf255('0x5'));var Mustache=require(_0xf255('0x6'));var util=require('util');var path=require(_0xf255('0x7'));var sox=require('sox');var csv=require(_0xf255('0x8'));var ejs=require(_0xf255('0x9'));var fs=require('fs');var _=require(_0xf255('0xa'));var squel=require(_0xf255('0xb'));var crypto=require(_0xf255('0xc'));var jsforce=require(_0xf255('0xd'));var deskjs=require(_0xf255('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf255('0xf'));var authService=require(_0xf255('0x10'));var qs=require(_0xf255('0x11'));var as=require(_0xf255('0x12'));var hardwareService=require(_0xf255('0x13'));var logger=require(_0xf255('0x14'))(_0xf255('0x15'));var utils=require('../../config/utils');var config=require(_0xf255('0x16'));var db=require(_0xf255('0x17'))['db'];config[_0xf255('0x18')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf255('0x19'))(new Redis(config[_0xf255('0x18')]));require(_0xf255('0x1a'))[_0xf255('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xf255('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x229172,_0x2a4717,_0xa300db){if(_0xa300db){var _0x3a5dd9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a5dd9[_0xf255('0x1d')](_0x2a4717)){return _0x229172;}else{throw new db['Sequelize'][(_0xf255('0x1e'))](_0xf255('0x1f'));}}else{return _0x229172;}}function respondWithRpcPromise(_0x387b29,_0x26a43e,_0x3273ab,_0x193da4){return new BPromise(function(_0x42d8ae,_0x406e3a){var _0x1dae0c=_0x193da4||client;return _0x1dae0c[_0xf255('0x20')](_0x387b29,_0x3273ab)[_0xf255('0x21')](function(_0x24dbef){logger[_0xf255('0x22')](_0xf255('0x23'),_0x26a43e,_0xf255('0x24'));logger[_0xf255('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x26a43e,_0xf255('0x24'),JSON[_0xf255('0x26')](_0x24dbef));if(_0x24dbef[_0xf255('0x27')]){if(_0x24dbef[_0xf255('0x27')][_0xf255('0x28')]===0x1f4){logger[_0xf255('0x27')]('SmsAccount,\x20%s,\x20%s',_0x26a43e,_0x24dbef['error'][_0xf255('0x29')]);return _0x406e3a(_0x24dbef['error'][_0xf255('0x29')]);}logger[_0xf255('0x27')](_0xf255('0x23'),_0x26a43e,_0x24dbef[_0xf255('0x27')]['message']);return _0x42d8ae(_0x24dbef['error']['message']);}else{logger['info']('SmsAccount,\x20%s,\x20%s',_0x26a43e,_0xf255('0x24'));_0x42d8ae(_0x24dbef['result']['message']);}})[_0xf255('0x2a')](function(_0x31a9f2){logger[_0xf255('0x27')](_0xf255('0x23'),_0x26a43e,_0x31a9f2);_0x406e3a(_0x31a9f2);});});}function respondWithStatusCode(_0x2df9bb,_0x3e7216){_0x3e7216=_0x3e7216||0xcc;return function(_0x2c1d57){if(_0x2c1d57){return _0x2df9bb[_0xf255('0x2b')](_0x3e7216);}return _0x2df9bb[_0xf255('0x2c')](_0x3e7216)[_0xf255('0x2d')]();};}function respondWithResult(_0x5139db,_0x734435){_0x734435=_0x734435||0xc8;return function(_0x2bbb53){if(_0x2bbb53){return _0x5139db[_0xf255('0x2c')](_0x734435)[_0xf255('0x2e')](_0x2bbb53);}};}function respondWithFilteredResult(_0x398c7a,_0x1b240e){return function(_0x2dd3ca){if(_0x2dd3ca){var _0x57b3b6=_0x2dd3ca[_0xf255('0x2f')],_0x37ce07=_0x1b240e[_0xf255('0x30')],_0x39ca95=_0x1b240e[_0xf255('0x30')]+_0x1b240e[_0xf255('0x31')],_0x363f0d;if(_0x39ca95>=_0x57b3b6){_0x39ca95=_0x57b3b6;_0x363f0d=0xc8;}else{_0x363f0d=0xce;}_0x398c7a['status'](_0x363f0d);return _0x398c7a[_0xf255('0x32')](_0xf255('0x33'),_0x37ce07+'-'+_0x39ca95+'/'+_0x57b3b6)[_0xf255('0x2e')](_0x2dd3ca);}return null;};}function patchUpdates(_0x4894ea){return function(_0xa97a1f){try{jsonpatch[_0xf255('0x34')](_0xa97a1f,_0x4894ea,!![]);}catch(_0x5e31bc){return BPromise[_0xf255('0x35')](_0x5e31bc);}return _0xa97a1f[_0xf255('0x36')]();};}function saveUpdates(_0xb12184,_0x344364){return function(_0x33549c){if(_0x33549c){return _0x33549c['update'](_0xb12184)[_0xf255('0x21')](function(_0x9739ec){return _0x9739ec;});}return null;};}function removeEntity(_0x151dba,_0x61273f){return function(_0x7d46f8){if(_0x7d46f8){return _0x7d46f8[_0xf255('0x37')]()[_0xf255('0x21')](function(){var _0x5c4d7a=_0x7d46f8[_0xf255('0x38')]({'plain':!![]});var _0x252e14=_0xf255('0x39');return db[_0xf255('0x3a')][_0xf255('0x37')]({'where':{'type':_0x252e14,'resourceId':_0x5c4d7a['id']}})['then'](function(){return _0x7d46f8;});})['then'](function(){_0x151dba[_0xf255('0x2c')](0xcc)[_0xf255('0x2d')]();});}};}function handleEntityNotFound(_0x49b763,_0x301141){return function(_0x36847e){if(!_0x36847e){_0x49b763[_0xf255('0x2b')](0x194);}return _0x36847e;};}function handleError(_0x8f4862,_0x4001dd){_0x4001dd=_0x4001dd||0x1f4;return function(_0x52d392){logger['error'](_0x52d392[_0xf255('0x3b')]);if(_0x52d392[_0xf255('0x3c')]){delete _0x52d392['name'];}_0x8f4862[_0xf255('0x2c')](_0x4001dd)['send'](_0x52d392);};}exports[_0xf255('0x3d')]=function(_0x1f7b43,_0x3608b0){var _0x35b10a={'include':[{'model':db[_0xf255('0x3e')],'as':_0xf255('0x3f')}]},_0x41b1c6={},_0x478e89={'count':0x0,'rows':[]};var _0x2e9942=_[_0xf255('0x40')](db[_0xf255('0x41')][_0xf255('0x42')],function(_0x35e31a){return{'name':_0x35e31a[_0xf255('0x43')],'type':_0x35e31a[_0xf255('0x44')]['key']};});_0x41b1c6[_0xf255('0x45')]=_['map'](_0x2e9942,_0xf255('0x3c'));_0x41b1c6[_0xf255('0x46')]=_[_0xf255('0x47')](_0x1f7b43[_0xf255('0x46')]);_0x41b1c6[_0xf255('0x48')]=_[_0xf255('0x49')](_0x41b1c6['model'],_0x41b1c6[_0xf255('0x46')]);_0x35b10a[_0xf255('0x4a')]=_[_0xf255('0x49')](_0x41b1c6[_0xf255('0x45')],qs[_0xf255('0x4b')](_0x1f7b43[_0xf255('0x46')]['fields']));_0x35b10a['attributes']=_0x35b10a[_0xf255('0x4a')][_0xf255('0x4c')]?_0x35b10a[_0xf255('0x4a')]:_0x41b1c6['model'];if(!_0x1f7b43[_0xf255('0x46')][_0xf255('0x4d')](_0xf255('0x4e'))){_0x35b10a[_0xf255('0x31')]=qs[_0xf255('0x31')](_0x1f7b43[_0xf255('0x46')][_0xf255('0x31')]);_0x35b10a[_0xf255('0x30')]=qs[_0xf255('0x30')](_0x1f7b43[_0xf255('0x46')][_0xf255('0x30')]);}_0x35b10a[_0xf255('0x4f')]=qs[_0xf255('0x50')](_0x1f7b43[_0xf255('0x46')][_0xf255('0x50')]);_0x35b10a['where']=qs[_0xf255('0x48')](_['pick'](_0x1f7b43['query'],_0x41b1c6[_0xf255('0x48')]));if(_0x1f7b43[_0xf255('0x46')]['filter']){_0x35b10a[_0xf255('0x51')]=_['merge'](_0x35b10a[_0xf255('0x51')],{'$or':_[_0xf255('0x40')](_0x2e9942,function(_0x2a4c00){if(_0x2a4c00['type']!==_0xf255('0x52')){var _0x341dc9={};_0x341dc9[_0x2a4c00[_0xf255('0x3c')]]={'$like':'%'+_0x1f7b43['query'][_0xf255('0x53')]+'%'};return _0x341dc9;}})});}_0x35b10a=_[_0xf255('0x54')]({},_0x35b10a,_0x1f7b43[_0xf255('0x55')]);var _0x2ba2c3={'where':_0x35b10a[_0xf255('0x51')]};return db[_0xf255('0x41')]['count'](_0x2ba2c3)[_0xf255('0x21')](function(_0x4f5c83){_0x478e89[_0xf255('0x2f')]=_0x4f5c83;if(_0x1f7b43[_0xf255('0x46')][_0xf255('0x56')]){_0x35b10a['include']=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x35b10a);})[_0xf255('0x21')](function(_0x46f568){_0x478e89[_0xf255('0x57')]=_0x46f568;return _0x478e89;})[_0xf255('0x21')](respondWithFilteredResult(_0x3608b0,_0x35b10a))[_0xf255('0x2a')](handleError(_0x3608b0,null));};exports[_0xf255('0x58')]=function(_0x145e37,_0x3265aa){var _0x325478={'raw':![],'where':{'id':_0x145e37[_0xf255('0x59')]['id']},'include':[{'model':db[_0xf255('0x3e')],'as':'mandatoryDispositionPause'}]},_0x47582f={};_0x47582f[_0xf255('0x45')]=_[_0xf255('0x47')](db[_0xf255('0x41')][_0xf255('0x42')]);_0x47582f[_0xf255('0x46')]=_[_0xf255('0x47')](_0x145e37[_0xf255('0x46')]);_0x47582f[_0xf255('0x48')]=_[_0xf255('0x49')](_0x47582f['model'],_0x47582f[_0xf255('0x46')]);_0x325478['attributes']=_[_0xf255('0x49')](_0x47582f[_0xf255('0x45')],qs[_0xf255('0x4b')](_0x145e37[_0xf255('0x46')][_0xf255('0x4b')]));_0x325478['attributes']=_0x325478[_0xf255('0x4a')][_0xf255('0x4c')]?_0x325478['attributes']:_0x47582f[_0xf255('0x45')];if(_0x145e37[_0xf255('0x46')]['includeAll']){_0x325478[_0xf255('0x5a')]=[{'all':!![]}];}_0x325478=_['merge']({},_0x325478,_0x145e37[_0xf255('0x55')]);return db[_0xf255('0x41')][_0xf255('0x5b')](_0x325478)[_0xf255('0x21')](handleEntityNotFound(_0x3265aa,null))[_0xf255('0x21')](respondWithResult(_0x3265aa,null))['catch'](handleError(_0x3265aa,null));};exports[_0xf255('0x5c')]=function(_0x1ca606,_0x5cb549){return db[_0xf255('0x41')][_0xf255('0x5c')](_0x1ca606['body'],{})[_0xf255('0x21')](function(_0x3f21f1){var _0x15d437=_0x1ca606['user'][_0xf255('0x38')]({'plain':!![]});if(!_0x15d437)throw new Error(_0xf255('0x5d'));if(_0x15d437[_0xf255('0x5e')]==='user'){var _0xf2d8eb=_0x3f21f1[_0xf255('0x38')]({'plain':!![]});var _0x17aeca=_0xf255('0x39');return db[_0xf255('0x5f')][_0xf255('0x5b')]({'where':{'name':_0x17aeca,'userProfileId':_0x15d437[_0xf255('0x60')]},'raw':!![]})[_0xf255('0x21')](function(_0x3d61fc){if(_0x3d61fc&&_0x3d61fc[_0xf255('0x61')]===0x0){return db['UserProfileResource'][_0xf255('0x5c')]({'name':_0xf2d8eb[_0xf255('0x3c')],'resourceId':_0xf2d8eb['id'],'type':_0x3d61fc[_0xf255('0x3c')],'sectionId':_0x3d61fc['id']},{})[_0xf255('0x21')](function(){return _0x3f21f1;});}else{return _0x3f21f1;}})[_0xf255('0x2a')](function(_0x3d2940){logger['error'](_0xf255('0x62'),_0x3d2940);throw _0x3d2940;});}return _0x3f21f1;})[_0xf255('0x21')](respondWithResult(_0x5cb549,0xc9))[_0xf255('0x2a')](handleError(_0x5cb549,null));};exports[_0xf255('0x63')]=function(_0x5c8a69,_0x590a98){if(_0x5c8a69[_0xf255('0x64')]['id']){delete _0x5c8a69['body']['id'];}return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x5c8a69[_0xf255('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0xf255('0x3f')}]})[_0xf255('0x21')](handleEntityNotFound(_0x590a98,null))[_0xf255('0x21')](saveUpdates(_0x5c8a69['body'],null))['then'](respondWithResult(_0x590a98,null))[_0xf255('0x2a')](handleError(_0x590a98,null));};exports[_0xf255('0x37')]=function(_0x47b482,_0x324b5e){return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x47b482[_0xf255('0x59')]['id']}})['then'](handleEntityNotFound(_0x324b5e,null))[_0xf255('0x21')](removeEntity(_0x324b5e,null))[_0xf255('0x2a')](handleError(_0x324b5e,null));};exports[_0xf255('0x65')]=function(_0x1940a1,_0x4611cd){return db[_0xf255('0x41')][_0xf255('0x65')]()['then'](respondWithResult(_0x4611cd,null))[_0xf255('0x2a')](handleError(_0x4611cd,null));};exports[_0xf255('0x66')]=function(_0x8f2665,_0x36d558,_0xb2c839){if(_0x8f2665[_0xf255('0x64')]['id']){delete _0x8f2665[_0xf255('0x64')]['id'];}return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x8f2665[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x36d558,null))[_0xf255('0x21')](function(_0x4804cb){if(_0x4804cb){_0x8f2665[_0xf255('0x64')][_0xf255('0x67')]=_0x4804cb['id'];return db[_0xf255('0x68')][_0xf255('0x5c')](_0x8f2665[_0xf255('0x64')]);}})[_0xf255('0x21')](respondWithResult(_0x36d558,null))[_0xf255('0x2a')](handleError(_0x36d558,null));};exports[_0xf255('0x69')]=function(_0x26dfcb,_0x461c1,_0x5292b0){var _0x2b0cb6={'raw':![],'where':{}};var _0x43b6e5={};var _0x11ed50={'count':0x0,'rows':[]};return db['SmsAccount'][_0xf255('0x6a')]({'where':{'id':_0x26dfcb[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x461c1,null))[_0xf255('0x21')](function(_0x43d90c){if(_0x43d90c){_0x43b6e5['model']=_[_0xf255('0x47')](db[_0xf255('0x68')][_0xf255('0x42')]);_0x43b6e5[_0xf255('0x46')]=_['keys'](_0x26dfcb[_0xf255('0x46')]);_0x43b6e5['filters']=_[_0xf255('0x49')](_0x43b6e5[_0xf255('0x45')],_0x43b6e5['query']);_0x2b0cb6['attributes']=_[_0xf255('0x49')](_0x43b6e5['model'],qs['fields'](_0x26dfcb['query']['fields']));_0x2b0cb6[_0xf255('0x4a')]=_0x2b0cb6[_0xf255('0x4a')]['length']?_0x2b0cb6[_0xf255('0x4a')]:_0x43b6e5[_0xf255('0x45')];if(!_0x26dfcb['query']['hasOwnProperty']('nolimit')){_0x2b0cb6[_0xf255('0x31')]=qs['limit'](_0x26dfcb[_0xf255('0x46')][_0xf255('0x31')]);_0x2b0cb6[_0xf255('0x30')]=qs[_0xf255('0x30')](_0x26dfcb[_0xf255('0x46')][_0xf255('0x30')]);}_0x2b0cb6[_0xf255('0x4f')]=qs[_0xf255('0x50')](_0x26dfcb['query'][_0xf255('0x50')]);_0x2b0cb6[_0xf255('0x51')]=qs[_0xf255('0x48')](_[_0xf255('0x6b')](_0x26dfcb[_0xf255('0x46')],_0x43b6e5[_0xf255('0x48')]));_0x2b0cb6[_0xf255('0x51')][_0xf255('0x67')]=_0x43d90c['id'];if(_0x26dfcb[_0xf255('0x46')]['filter']){_0x2b0cb6['where']=_[_0xf255('0x54')](_0x2b0cb6[_0xf255('0x51')],{'$or':_['map'](_0x2b0cb6['attributes'],function(_0x4daad0){var _0x306f89={};_0x306f89[_0x4daad0]={'$like':'%'+_0x26dfcb[_0xf255('0x46')][_0xf255('0x53')]+'%'};return _0x306f89;})});}_0x2b0cb6=_[_0xf255('0x54')]({},_0x2b0cb6,_0x26dfcb['options']);return db[_0xf255('0x68')][_0xf255('0x2f')]({'where':_0x2b0cb6[_0xf255('0x51')]})[_0xf255('0x21')](function(_0x3d60dc){_0x11ed50[_0xf255('0x2f')]=_0x3d60dc;if(_0x26dfcb[_0xf255('0x46')][_0xf255('0x56')]){_0x2b0cb6[_0xf255('0x5a')]=[{'all':!![]}];}return db[_0xf255('0x68')][_0xf255('0x6c')](_0x2b0cb6);})[_0xf255('0x21')](function(_0xdb5c51){_0x11ed50[_0xf255('0x57')]=_0xdb5c51;return _0x11ed50;});}})[_0xf255('0x21')](respondWithFilteredResult(_0x461c1,_0x2b0cb6))[_0xf255('0x2a')](handleError(_0x461c1,null));};exports[_0xf255('0x6d')]=function(_0x8c1ed1,_0x295c5c,_0x5879d6){return db['SmsAccount']['find']({'where':{'id':_0x8c1ed1[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x295c5c,null))[_0xf255('0x21')](function(_0x5b6583){if(_0x5b6583){return _0x5b6583[_0xf255('0x6d')](_0x8c1ed1[_0xf255('0x46')][_0xf255('0x6e')]);}})[_0xf255('0x21')](respondWithStatusCode(_0x295c5c,null))[_0xf255('0x2a')](handleError(_0x295c5c,null));};exports[_0xf255('0x6f')]=function(_0x431d8f,_0x4a1030,_0x29d954){if(_0x431d8f[_0xf255('0x64')]['id']){delete _0x431d8f[_0xf255('0x64')]['id'];}return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x431d8f[_0xf255('0x59')]['id']}})['then'](handleEntityNotFound(_0x4a1030,null))['then'](function(_0xbe5793){if(_0xbe5793){_0x431d8f[_0xf255('0x64')][_0xf255('0x67')]=_0xbe5793['id'];return db[_0xf255('0x70')][_0xf255('0x5c')](_0x431d8f['body']);}})['then'](respondWithResult(_0x4a1030,null))[_0xf255('0x2a')](handleError(_0x4a1030,null));};exports[_0xf255('0x71')]=function(_0x4c18f9,_0x169b93,_0x3381e1){var _0x5663dd={'raw':![],'where':{}};var _0x3bdea7={};var _0x1c4208={'count':0x0,'rows':[]};return db[_0xf255('0x41')]['findOne']({'where':{'id':_0x4c18f9[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x169b93,null))[_0xf255('0x21')](function(_0x100ea2){if(_0x100ea2){_0x3bdea7[_0xf255('0x45')]=_[_0xf255('0x47')](db['CannedAnswer'][_0xf255('0x42')]);_0x3bdea7[_0xf255('0x46')]=_[_0xf255('0x47')](_0x4c18f9['query']);_0x3bdea7[_0xf255('0x48')]=_[_0xf255('0x49')](_0x3bdea7[_0xf255('0x45')],_0x3bdea7['query']);_0x5663dd[_0xf255('0x4a')]=_[_0xf255('0x49')](_0x3bdea7[_0xf255('0x45')],qs[_0xf255('0x4b')](_0x4c18f9[_0xf255('0x46')][_0xf255('0x4b')]));_0x5663dd[_0xf255('0x4a')]=_0x5663dd[_0xf255('0x4a')]['length']?_0x5663dd[_0xf255('0x4a')]:_0x3bdea7[_0xf255('0x45')];if(!_0x4c18f9[_0xf255('0x46')][_0xf255('0x4d')](_0xf255('0x4e'))){_0x5663dd[_0xf255('0x31')]=qs[_0xf255('0x31')](_0x4c18f9[_0xf255('0x46')]['limit']);_0x5663dd[_0xf255('0x30')]=qs[_0xf255('0x30')](_0x4c18f9[_0xf255('0x46')]['offset']);}_0x5663dd[_0xf255('0x4f')]=qs[_0xf255('0x50')](_0x4c18f9[_0xf255('0x46')][_0xf255('0x50')]);_0x5663dd[_0xf255('0x51')]=qs['filters'](_['pick'](_0x4c18f9[_0xf255('0x46')],_0x3bdea7[_0xf255('0x48')]));_0x5663dd[_0xf255('0x51')][_0xf255('0x67')]=_0x100ea2['id'];if(_0x4c18f9[_0xf255('0x46')][_0xf255('0x53')]){_0x5663dd[_0xf255('0x51')]=_[_0xf255('0x54')](_0x5663dd[_0xf255('0x51')],{'$or':_[_0xf255('0x40')](_0x5663dd[_0xf255('0x4a')],function(_0x4e872c){var _0x430fc7={};_0x430fc7[_0x4e872c]={'$like':'%'+_0x4c18f9[_0xf255('0x46')][_0xf255('0x53')]+'%'};return _0x430fc7;})});}_0x5663dd=_['merge']({},_0x5663dd,_0x4c18f9['options']);return db[_0xf255('0x70')][_0xf255('0x2f')]({'where':_0x5663dd[_0xf255('0x51')]})[_0xf255('0x21')](function(_0x4d1189){_0x1c4208['count']=_0x4d1189;if(_0x4c18f9[_0xf255('0x46')]['includeAll']){_0x5663dd[_0xf255('0x5a')]=[{'all':!![]}];}return db[_0xf255('0x70')][_0xf255('0x6c')](_0x5663dd);})[_0xf255('0x21')](function(_0x2ea0d9){_0x1c4208['rows']=_0x2ea0d9;return _0x1c4208;});}})[_0xf255('0x21')](respondWithFilteredResult(_0x169b93,_0x5663dd))[_0xf255('0x2a')](handleError(_0x169b93,null));};exports[_0xf255('0x72')]=function(_0x2d624f,_0x1bb3d5,_0x37d7a9){return db['SmsAccount'][_0xf255('0x5b')]({'where':{'id':_0x2d624f['params']['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x1bb3d5,null))[_0xf255('0x21')](function(_0x37af3e){if(_0x37af3e){return _0x37af3e[_0xf255('0x72')](_0x2d624f[_0xf255('0x46')][_0xf255('0x6e')]);}})[_0xf255('0x21')](respondWithStatusCode(_0x1bb3d5,null))['catch'](handleError(_0x1bb3d5,null));};exports['notify']=function(_0x3c0900,_0x561b12,_0x2da8d1){var _0x5a52ae={'channel':'sms'};var _0x3e7329=[];var _0xcd495c=[];var _0x3cbb35={};return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x3c0900[_0xf255('0x59')]['id']},'include':[{'model':db[_0xf255('0x73')],'as':_0xf255('0x74')}]})[_0xf255('0x21')](handleEntityNotFound(_0x561b12,null))[_0xf255('0x21')](function(_0xc97a20){_0x5a52ae[_0xf255('0x75')]=_0xc97a20;_0x5a52ae[_0xf255('0x76')]=_['orderBy'](_0xc97a20[_0xf255('0x74')],[_0xf255('0x77')],[_0xf255('0x78')]);if(_0x5a52ae[_0xf255('0x75')][_0xf255('0x74')]){delete _0x5a52ae[_0xf255('0x75')][_0xf255('0x74')];}return db[_0xf255('0x79')][_0xf255('0x65')]();})['then'](function(_0x3295aa){if(!_0x3295aa){throw new db[(_0xf255('0x7a'))][(_0xf255('0x1e'))]('no\x20available\x20attributes');}_0x3e7329=_[_0xf255('0x7b')](_[_0xf255('0x47')](_0x3295aa),[_0xf255('0x7c'),_0xf255('0x7d')]);_0xcd495c=_[_0xf255('0x7b')](_[_0xf255('0x47')](_0x3295aa),['createdAt',_0xf255('0x7d'),_0xf255('0x7e'),_0xf255('0x7f')]);_0x5a52ae[_0xf255('0x64')]={'mapKey':_0xf255('0x80')};if(_0x5a52ae[_0xf255('0x75')][_0xf255('0x44')]){switch(_0x5a52ae[_0xf255('0x75')]['type']){case _0xf255('0x81'):_0x5a52ae[_0xf255('0x64')][_0xf255('0x82')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x83')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x64')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x84')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x85')]=_0x3c0900['body'][_0xf255('0x86')];break;case _0xf255('0x87'):_0x5a52ae[_0xf255('0x64')][_0xf255('0x82')]='+'+_0x3c0900[_0xf255('0x64')][_0xf255('0x88')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x64')]=_0x3c0900['body'][_0xf255('0x89')];break;case'connectel':_0x5a52ae['body'][_0xf255('0x82')]=_0x3c0900['body']['from'];_0x5a52ae[_0xf255('0x64')][_0xf255('0x64')]=_0x3c0900['body'][_0xf255('0x29')];break;case'clicksend':_0x5a52ae[_0xf255('0x64')][_0xf255('0x82')]=_0x3c0900[_0xf255('0x64')]['from'];_0x5a52ae[_0xf255('0x64')][_0xf255('0x64')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x64')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x85')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x8a')];break;case'plivo':_0x5a52ae[_0xf255('0x64')][_0xf255('0x82')]=_0x3c0900['body'][_0xf255('0x83')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x64')]=_0x3c0900['body'][_0xf255('0x8b')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x85')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x8c')];break;case _0xf255('0x8d'):_0x5a52ae['body'][_0xf255('0x82')]='+'+_0x3c0900['body']['results'][0x0][_0xf255('0x82')];_0x5a52ae['body'][_0xf255('0x64')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x8e')][0x0][_0xf255('0x89')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x85')]=_0x3c0900['body'][_0xf255('0x8e')][0x0]['messageId'];break;case _0xf255('0x8f'):_0x5a52ae[_0xf255('0x64')]['from']=_0x3c0900[_0xf255('0x64')][_0xf255('0x90')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x64')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x91')][_0xf255('0x29')];break;case'clickatell':_0x5a52ae['body'][_0xf255('0x82')]=_0x3c0900['body'][_0xf255('0x92')];_0x5a52ae['body'][_0xf255('0x64')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x89')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x85')]=_0x3c0900['body'][_0xf255('0x93')];break;case'intelepeer':_0x5a52ae['body']['from']=_0x3c0900['body'][_0xf255('0x82')];_0x5a52ae[_0xf255('0x64')][_0xf255('0x64')]=_0x3c0900[_0xf255('0x64')][_0xf255('0x29')];_0x5a52ae[_0xf255('0x64')]['messageId']=_0x3c0900[_0xf255('0x64')][_0xf255('0x94')];break;}}if(_0x5a52ae[_0xf255('0x64')]['id']){delete _0x5a52ae[_0xf255('0x64')]['id'];}if(_[_0xf255('0x95')](_0x5a52ae[_0xf255('0x64')][_0xf255('0x82')])){throw new db['Sequelize'][(_0xf255('0x1e'))](_0xf255('0x96'));}if(_['isNil'](_0x5a52ae['body'][_0xf255('0x64')])||_0x5a52ae['body'][_0xf255('0x64')]===''){throw new db[(_0xf255('0x7a'))]['ValidationError'](_0xf255('0x97'));}if(_[_0xf255('0x95')](_0x5a52ae['body'][_0xf255('0x98')])){throw new db['Sequelize']['ValidationError'](_0xf255('0x99')+_0xcd495c);}if(!_['includes'](_0xcd495c,_0x5a52ae['body'][_0xf255('0x98')])){throw new db[(_0xf255('0x7a'))][(_0xf255('0x1e'))](_0xf255('0x9a')+_0xcd495c);}_0x3cbb35[_0x5a52ae['body'][_0xf255('0x98')]]=_0x5a52ae['body'][_0xf255('0x82')];return db[_0xf255('0x9b')][_0xf255('0x5b')]({'where':{'id':_0x5a52ae[_0xf255('0x75')][_0xf255('0x7f')]},'include':[{'model':db['CmContact'],'as':_0xf255('0x9c'),'where':_0x3cbb35,'limit':0x1,'order':[['updatedAt',_0xf255('0x9d')]]}]});})[_0xf255('0x21')](handleEntityNotFound(_0x561b12,null))[_0xf255('0x21')](function(_0x41f21f){if(_0x41f21f){_0x5a52ae[_0xf255('0x9e')]=_[_0xf255('0x9f')](_0x41f21f,[_0xf255('0x9c')]);if(_0x41f21f[_0xf255('0x9c')][_0xf255('0x4c')]){return _0x41f21f[_0xf255('0x9c')][0x0];}var _0x265e13=_[_0xf255('0xa0')](_0x5a52ae[_0xf255('0x64')],{'firstName':_0x5a52ae[_0xf255('0x64')][_0xf255('0x82')],'ListId':_0x41f21f['id']});_0x265e13[_0x5a52ae['body'][_0xf255('0x98')]]=_0x5a52ae[_0xf255('0x64')][_0xf255('0x82')];return db[_0xf255('0x79')]['create'](_0x265e13,{'fields':_0x3e7329,'raw':!![]});}})['then'](handleEntityNotFound(_0x561b12,null))['then'](function(_0x49d0aa){if(_0x49d0aa){_0x5a52ae['contact']=_0x49d0aa;var _0x5ee3aa={'ContactId':_0x49d0aa['id'],'phone':_0x5a52ae[_0xf255('0x64')]['from'],'SmsAccountId':_0x3c0900[_0xf255('0x59')]['id']};var _0x3ebea5={'ContactId':_0x49d0aa['id'],'SmsAccountId':_0x3c0900[_0xf255('0x59')]['id'],'closed':![]};return db[_0xf255('0xa1')]['find']({'where':_0x3ebea5})[_0xf255('0x21')](function(_0x275dec){if(_0x275dec){return[_0x275dec,![]];}return db['SmsInteraction'][_0xf255('0x5c')](_0x5ee3aa)[_0xf255('0x21')](function(_0x2aaaef){return[_0x2aaaef,!![]];});});}})[_0xf255('0xa2')](function(_0x190328,_0x3b24f2){_0x5a52ae[_0xf255('0xa3')]=_0x190328['get']({'plain':!![]});_0x5a52ae[_0xf255('0xa3')][_0xf255('0xa4')]=![];if(_0x3b24f2){if(_0x5a52ae[_0xf255('0x75')]['autoclose']){_0x5a52ae['applications']['push']({'id':0x0,'priority':_0x5a52ae[_0xf255('0x76')]['length']+0x1,'app':_0xf255('0xa5'),'appdata':_0xf255('0xa6'),'interval':_0xf255('0xa7')});}_0x5a52ae[_0xf255('0xa3')][_0xf255('0xa4')]=!![];}return db['SmsMessage'][_0xf255('0x5c')]({'phone':_0x5a52ae[_0xf255('0x64')][_0xf255('0x82')],'messageId':_0x5a52ae['body'][_0xf255('0x85')],'body':_0x5a52ae['body'][_0xf255('0x64')],'SmsAccountId':_0x3c0900[_0xf255('0x59')]['id'],'SmsInteractionId':_0x190328['id'],'direction':'in','ContactId':_0x190328[_0xf255('0xa8')],'AttachmentId':_0x5a52ae['body'][_0xf255('0xa9')]});})['then'](function(_0x1d5819){_0x5a52ae[_0xf255('0x29')]=_0x1d5819;if(_0x5a52ae[_0xf255('0xa3')][_0xf255('0xaa')]){return db[_0xf255('0xab')][_0xf255('0x5b')]({'attributes':['id',_0xf255('0x3c')],'where':{'id':_0x5a52ae[_0xf255('0xa3')]['UserId']}})['then'](function(_0x503923){if(_0x503923){_0x5a52ae[_0xf255('0x76')]['unshift']({'id':0x0,'priority':0x0,'app':_0xf255('0xac'),'appdata':_0x503923[_0xf255('0x3c')]+','+(_0x5a52ae[_0xf255('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0xf255('0xa7')});}return respondWithRpcPromise(_0xf255('0xad'),_0xf255('0xae'),_0x5a52ae);});}return respondWithRpcPromise(_0xf255('0xad'),'startRouting',_0x5a52ae);})[_0xf255('0x21')](function(_0x492d4a){if(_0x492d4a){var _0x5281cb=0xc8;var _0x47137f=_0xf255('0xaf');logger[_0xf255('0x22')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x47137f,_0x5281cb,'entity\x20found');logger[_0xf255('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x47137f,_0x5281cb,_0xf255('0xb0'),JSON[_0xf255('0x26')](_0x492d4a));if(_0x5a52ae[_0xf255('0x75')][_0xf255('0x44')]===_0xf255('0x81')){return _0x561b12[_0xf255('0x2c')](_0x5281cb)[_0xf255('0x32')](_0xf255('0xb1'),_0xf255('0xb2'))['send']('\x0a');}else{return _0x561b12[_0xf255('0x2c')](_0x5281cb)[_0xf255('0x2e')](_0x492d4a);}}})['catch'](handleError(_0x561b12,null));};exports['addApplications']=function(_0x16d455,_0x576427,_0x1126f9){return db[_0xf255('0x41')][_0xf255('0x6a')]({'where':{'id':_0x16d455[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x576427,null))['then'](function(_0x733b80){if(_0x733b80){return db[_0xf255('0xb3')][_0xf255('0xb4')](function(_0xd7a5d1){return db['SmsApplication'][_0xf255('0x37')]({'where':{'SmsAccountId':_0x16d455[_0xf255('0x59')]['id']},'transaction':_0xd7a5d1})[_0xf255('0x21')](function(_0x120eb7){var _0x5e8f41=_[_0xf255('0x40')](_0x16d455['body'],function(_0x508eca){_0x508eca['SmsAccountId']=_0x16d455[_0xf255('0x59')]['id'];return _0x508eca;});return db[_0xf255('0x73')][_0xf255('0xb5')](_0x5e8f41,{'transaction':_0xd7a5d1});});})[_0xf255('0x21')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x16d455['params']['id']},'order':_0xf255('0x77')});});}})[_0xf255('0x21')](respondWithResult(_0x576427,null))[_0xf255('0x2a')](handleError(_0x576427,null));};exports[_0xf255('0xb6')]=function(_0x34122a,_0x3a71ed,_0x1a7e4d){var _0x439d87={};var _0x428e75={};var _0xbcd03f;var _0x5f19fa;return db[_0xf255('0x41')][_0xf255('0x6a')]({'where':{'id':_0x34122a[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x3a71ed,null))[_0xf255('0x21')](function(_0x12844f){if(_0x12844f){_0xbcd03f=_0x12844f;_0x428e75[_0xf255('0x45')]=_[_0xf255('0x47')](db[_0xf255('0x73')][_0xf255('0x42')]);_0x428e75['query']=_['keys'](_0x34122a['query']);_0x428e75[_0xf255('0x48')]=_[_0xf255('0x49')](_0x428e75['model'],_0x428e75[_0xf255('0x46')]);_0x439d87[_0xf255('0x4a')]=_[_0xf255('0x49')](_0x428e75[_0xf255('0x45')],qs[_0xf255('0x4b')](_0x34122a[_0xf255('0x46')]['fields']));_0x439d87[_0xf255('0x4a')]=_0x439d87[_0xf255('0x4a')][_0xf255('0x4c')]?_0x439d87[_0xf255('0x4a')]:_0x428e75[_0xf255('0x45')];_0x439d87['order']=qs[_0xf255('0x50')](_0x34122a[_0xf255('0x46')][_0xf255('0x50')]);_0x439d87[_0xf255('0x51')]=qs['filters'](_[_0xf255('0x6b')](_0x34122a[_0xf255('0x46')],_0x428e75[_0xf255('0x48')]));if(_0x34122a[_0xf255('0x46')][_0xf255('0x53')]){_0x439d87['where']=_[_0xf255('0x54')](_0x439d87[_0xf255('0x51')],{'$or':_[_0xf255('0x40')](_0x439d87[_0xf255('0x4a')],function(_0x444505){var _0x4c0e7e={};_0x4c0e7e[_0x444505]={'$like':'%'+_0x34122a[_0xf255('0x46')][_0xf255('0x53')]+'%'};return _0x4c0e7e;})});}_0x439d87=_[_0xf255('0x54')]({},_0x439d87,_0x34122a[_0xf255('0x55')]);return _0xbcd03f[_0xf255('0xb6')](_0x439d87);}})[_0xf255('0x21')](function(_0x3a3b4b){if(_0x3a3b4b){_0x5f19fa=_0x3a3b4b['length'];if(!_0x34122a[_0xf255('0x46')][_0xf255('0x4d')](_0xf255('0x4e'))){_0x439d87[_0xf255('0x31')]=qs[_0xf255('0x31')](_0x34122a[_0xf255('0x46')]['limit']);_0x439d87[_0xf255('0x30')]=qs[_0xf255('0x30')](_0x34122a[_0xf255('0x46')][_0xf255('0x30')]);}return _0xbcd03f[_0xf255('0xb6')](_0x439d87);}})[_0xf255('0x21')](function(_0x54573b){if(_0x54573b){return _0x54573b?{'count':_0x5f19fa,'rows':_0x54573b}:null;}})['then'](respondWithResult(_0x3a71ed,null))[_0xf255('0x2a')](handleError(_0x3a71ed,null));};exports['getInteractions']=function(_0x4c2f1e,_0x11840f,_0xa12f2f){var _0x45da9b={'raw':![],'where':{}};var _0x5eb3a4={};var _0x47af27={'count':0x0,'rows':[]};return db[_0xf255('0x41')][_0xf255('0x6a')]({'where':{'id':_0x4c2f1e[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x11840f,null))[_0xf255('0x21')](function(_0x5ba4b4){if(_0x5ba4b4){_0x5eb3a4[_0xf255('0x45')]=_['keys'](db[_0xf255('0xa1')][_0xf255('0x42')]);_0x5eb3a4[_0xf255('0x46')]=_['keys'](_0x4c2f1e['query']);_0x5eb3a4[_0xf255('0x48')]=_[_0xf255('0x49')](_0x5eb3a4[_0xf255('0x45')],_0x5eb3a4[_0xf255('0x46')]);_0x45da9b['attributes']=_[_0xf255('0x49')](_0x5eb3a4[_0xf255('0x45')],qs[_0xf255('0x4b')](_0x4c2f1e[_0xf255('0x46')][_0xf255('0x4b')]));_0x45da9b[_0xf255('0x4a')]=_0x45da9b[_0xf255('0x4a')][_0xf255('0x4c')]?_0x45da9b[_0xf255('0x4a')]:_0x5eb3a4[_0xf255('0x45')];if(!_0x4c2f1e['query'][_0xf255('0x4d')]('nolimit')){_0x45da9b[_0xf255('0x31')]=qs['limit'](_0x4c2f1e['query'][_0xf255('0x31')]);_0x45da9b[_0xf255('0x30')]=qs[_0xf255('0x30')](_0x4c2f1e[_0xf255('0x46')]['offset']);}_0x45da9b['order']=qs[_0xf255('0x50')](_0x4c2f1e[_0xf255('0x46')][_0xf255('0x50')]);_0x45da9b[_0xf255('0x51')]=qs[_0xf255('0x48')](_['pick'](_0x4c2f1e[_0xf255('0x46')],_0x5eb3a4[_0xf255('0x48')]));_0x45da9b[_0xf255('0x51')][_0xf255('0x67')]=_0x5ba4b4['id'];if(_0x4c2f1e[_0xf255('0x46')]['filter']){_0x45da9b[_0xf255('0x51')]=_[_0xf255('0x54')](_0x45da9b['where'],{'$or':_['map'](_0x45da9b['attributes'],function(_0x5ecc40){var _0x86a200={};_0x86a200[_0x5ecc40]={'$like':'%'+_0x4c2f1e[_0xf255('0x46')]['filter']+'%'};return _0x86a200;})});}_0x45da9b=_[_0xf255('0x54')]({},_0x45da9b,_0x4c2f1e[_0xf255('0x55')]);return db[_0xf255('0xa1')][_0xf255('0x2f')]({'where':_0x45da9b[_0xf255('0x51')]})[_0xf255('0x21')](function(_0x48cba2){_0x47af27['count']=_0x48cba2;if(_0x4c2f1e[_0xf255('0x46')][_0xf255('0x56')]){_0x45da9b[_0xf255('0x5a')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0xf255('0xab')],'as':_0xf255('0xb7'),'attributes':[_0xf255('0x3c'),_0xf255('0xb8'),'internal'],'required':![]},{'model':db[_0xf255('0xb9')],'as':_0xf255('0xba'),'attributes':['id',_0xf255('0x3c'),_0xf255('0xbb')],'where':_0x4c2f1e['query'][_0xf255('0xbc')]?{'id':_0x4c2f1e[_0xf255('0x46')][_0xf255('0xbc')]}:undefined,'required':_0x4c2f1e[_0xf255('0x46')][_0xf255('0xbc')]?!![]:![]}];}return db['SmsInteraction'][_0xf255('0x6c')](_0x45da9b);})[_0xf255('0x21')](function(_0x3f23eb){_0x47af27[_0xf255('0x57')]=_0x3f23eb;return _0x47af27;});}})[_0xf255('0x21')](respondWithFilteredResult(_0x11840f,_0x45da9b))[_0xf255('0x2a')](handleError(_0x11840f,null));};exports[_0xf255('0xbd')]=function(_0x31f6b7,_0x28157c,_0x5e3148){var _0x140925,_0x32f716,_0x1cb58f;if(_['isNil'](_0x31f6b7[_0xf255('0x64')]['body'])||_0x31f6b7[_0xf255('0x64')][_0xf255('0x64')]===''){throw new db[(_0xf255('0x7a'))][(_0xf255('0x1e'))](_0xf255('0x97'));}if(_[_0xf255('0x95')](_0x31f6b7[_0xf255('0x64')]['to'])){throw new db[(_0xf255('0x7a'))][(_0xf255('0x1e'))](_0xf255('0xbe'));}_0x140925=_0x31f6b7[_0xf255('0x64')]['to'];return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x31f6b7[_0xf255('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0xf255('0xbf'),'include':[{'model':db[_0xf255('0x79')],'as':_0xf255('0x9c'),'where':{'mobile':_0x140925},'limit':0x1,'order':[[_0xf255('0x7d'),_0xf255('0x9d')]]}]}]})['then'](handleEntityNotFound(_0x28157c,null))[_0xf255('0x21')](function(_0x52d213){if(_0x52d213&&_0x52d213['List']){_0x32f716=_0x52d213['get']({'plain':!![]});if(_0x32f716['List']&&_0x32f716[_0xf255('0xbf')]['Contacts'][_0xf255('0x4c')]){return _0x32f716[_0xf255('0xbf')][_0xf255('0x9c')][0x0];}return db[_0xf255('0x79')][_0xf255('0x5c')](_[_0xf255('0xa0')](_0x31f6b7['body'],{'firstName':_0x140925,'mobile':_0x140925,'phone':_0x140925,'ListId':_0x32f716[_0xf255('0x7f')]}));}})[_0xf255('0x21')](handleEntityNotFound(_0x28157c,null))[_0xf255('0x21')](function(_0x35d75b){if(_0x35d75b){_0x1cb58f=_0x35d75b;return db[_0xf255('0xa1')][_0xf255('0x5b')]({'where':{'ContactId':_0x1cb58f['id'],'closed':![],'SmsAccountId':_0x32f716['id']}})[_0xf255('0x21')](function(_0x1ac879){if(_0x1ac879){return[_0x1ac879,![]];}return db[_0xf255('0xa1')][_0xf255('0x5c')]({'UserId':_0x31f6b7[_0xf255('0xc0')]['id'],'ContactId':_0x1cb58f['id'],'SmsAccountId':_0x32f716['id'],'phone':_0x140925,'firstMsgDirection':_0xf255('0xc1'),'Messages':[_[_0xf255('0x54')](_0x31f6b7[_0xf255('0x64')],{'read':![],'body':_0x31f6b7['body'][_0xf255('0x64')],'phone':_0x140925,'SmsAccountId':_0x32f716['id'],'UserId':_0x31f6b7['user']['id'],'ContactId':_0x1cb58f['id']})]},{'include':[{'model':db[_0xf255('0xc2')],'as':_0xf255('0xc3')}]})['then'](function(_0x12ec56){return[_0x12ec56,!![]];});});}})['spread'](function(_0x4cbf90,_0x3b2790){if(_0x3b2790){return _0x4cbf90;}return db[_0xf255('0xc2')][_0xf255('0x5c')](_[_0xf255('0x54')](_0x31f6b7['body'],{'read':![],'body':_0x31f6b7[_0xf255('0x64')][_0xf255('0x64')],'phone':_0x140925,'SmsAccountId':_0x32f716['id'],'SmsInteractionId':_0x4cbf90['id'],'UserId':_0x31f6b7[_0xf255('0xc0')]['id'],'ContactId':_0x1cb58f['id']}))[_0xf255('0x21')](function(_0x4190e2){_0x4cbf90[_0xf255('0xc4')][_0xf255('0xc3')]=[];_0x4cbf90[_0xf255('0xc4')][_0xf255('0xc3')]['push'](_0x4190e2['dataValues']);return _0x4cbf90;});})[_0xf255('0x21')](respondWithResult(_0x28157c,null))[_0xf255('0x2a')](handleError(_0x28157c,null));};exports['status']=function(_0x3a7d4,_0x549c44,_0x491b1a){if(_0x3a7d4[_0xf255('0x64')]['id']){delete _0x3a7d4[_0xf255('0x64')]['id'];}console['log'](_0xf255('0xc5'),_0x3a7d4['body']);var _0x4e5722,_0x5e863a,_0x258c8f;return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x3a7d4[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x549c44,null))[_0xf255('0x21')](function(_0x1f5d31){if(_0x1f5d31){_0x258c8f=_0x1f5d31;logger[_0xf255('0x25')](_0xf255('0xc6'),_0xf255('0x2c'),_0xf255('0xc7'),_0x1f5d31[_0xf255('0x44')],util[_0xf255('0xc8')](_0x3a7d4[_0xf255('0x64')],{'showHidden':![],'depth':null}));switch(_0x1f5d31[_0xf255('0x44')]){case _0xf255('0x87'):if(_0x3a7d4[_0xf255('0x64')][_0xf255('0xc9')]&&_0x3a7d4[_0xf255('0x64')][_0xf255('0x2c')]){_0x5e863a=_0x3a7d4[_0xf255('0x64')][_0xf255('0x2c')];return db['SmsMessage'][_0xf255('0x5b')]({'where':{'messageId':_0x3a7d4[_0xf255('0x64')][_0xf255('0xc9')]}});}break;case'connectel':if(_0x3a7d4[_0xf255('0x64')][_0xf255('0xca')]&&_0x3a7d4[_0xf255('0x64')][_0xf255('0xcb')]){_0x5e863a=_0x3a7d4[_0xf255('0x64')]['statusInt'];return db['SmsMessage'][_0xf255('0x5b')]({'where':{'messageId':_0x3a7d4['body']['requestid']}});}break;case'clicksend':if(_0x3a7d4[_0xf255('0x64')][_0xf255('0x8a')]&&_0x3a7d4[_0xf255('0x64')][_0xf255('0xcc')]){_0x5e863a=_0x3a7d4[_0xf255('0x64')][_0xf255('0xcc')];return db['SmsMessage'][_0xf255('0x5b')]({'where':{'messageId':_0x3a7d4[_0xf255('0x64')][_0xf255('0x8a')]}});}break;case _0xf255('0x8d'):var _0x4cfe02=_0x3a7d4[_0xf255('0x64')][_0xf255('0x8e')][0x0];if(_0x4cfe02[_0xf255('0x85')]&&_0x4cfe02[_0xf255('0x2c')][_0xf255('0xcd')]===_0xf255('0xce')){_0x5e863a=_0x4cfe02['status']['groupName'];return db['SmsMessage']['find']({'where':{'messageId':_0x4cfe02[_0xf255('0x85')]}});}break;case _0xf255('0xcf'):if(_0x3a7d4[_0xf255('0x64')][_0xf255('0x85')]&&_0x3a7d4[_0xf255('0x64')][_0xf255('0x2c')]){_0x5e863a=_0x3a7d4['body'][_0xf255('0x2c')];return db[_0xf255('0xc2')]['find']({'where':{'messageId':_0x3a7d4['body'][_0xf255('0x85')]}});}break;case _0xf255('0xd0'):if(_0x3a7d4[_0xf255('0x64')][_0xf255('0xd1')]&&_0x3a7d4[_0xf255('0x64')][_0xf255('0x2c')]){_0x5e863a=_0x3a7d4['body']['status'];return db['SmsMessage'][_0xf255('0x5b')]({'where':{'messageId':_0x3a7d4[_0xf255('0x64')][_0xf255('0xd1')]}});}break;}}})[_0xf255('0x21')](handleEntityNotFound(_0x549c44,null))[_0xf255('0x21')](function(_0x5368b8){if(_0x5368b8){_0x4e5722=_0x5368b8;switch(_0x258c8f[_0xf255('0x44')]){case _0xf255('0x87'):if(_0x5e863a==='DELIVERED'){return _0x4e5722['update']({'read':!![]});}else{logger[_0xf255('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf255('0x2c'),_0xf255('0x87'),util[_0xf255('0xc8')](_0x3a7d4[_0xf255('0x64')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x5e863a==='1'){return _0x4e5722[_0xf255('0x63')]({'read':!![]});}else{logger[_0xf255('0x27')](_0xf255('0xc6'),_0xf255('0x2c'),_0xf255('0x87'),util[_0xf255('0xc8')](_0x3a7d4[_0xf255('0x64')],{'showHidden':![],'depth':null}));}break;case _0xf255('0xd2'):if(!_0x3a7d4[_0xf255('0x64')]['error_code']&&_0x5e863a>=0xc8&&_0x5e863a<=0xce){return _0x4e5722[_0xf255('0x63')]({'read':!![]});}else{logger['error'](_0xf255('0xc6'),'status','clicksend',util['inspect'](_0x3a7d4[_0xf255('0x64')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x485401=_0x3a7d4['body'][_0xf255('0x8e')][0x0];if(_0x485401[_0xf255('0x2c')][_0xf255('0xcd')]===_0xf255('0xce')){return _0x4e5722[_0xf255('0x63')]({'read':!![]});}else{logger['error'](_0xf255('0xc6'),'status',_0xf255('0x8d'),util[_0xf255('0xc8')](_0x3a7d4['body'],{'showHidden':![],'depth':null}));}break;case'clickatell':if(_0x5e863a==_0xf255('0xd3')||_0x5e863a==_0xf255('0xd4')){return _0x4e5722['update']({'read':!![]});}else{logger[_0xf255('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf255('0x2c'),'clickatell',util[_0xf255('0xc8')](_0x3a7d4[_0xf255('0x64')],{'showHidden':![],'depth':null}));}break;case _0xf255('0xd0'):if(_0x5e863a==='DELIVRD'||_0x5e863a===_0xf255('0xd5')){return _0x4e5722[_0xf255('0x63')]({'read':!![]});}else{logger[_0xf255('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf255('0x2c'),_0xf255('0xd0'),util[_0xf255('0xc8')](_0x3a7d4['body'],{'showHidden':![],'depth':null}));}break;}return _0x4e5722;}})[_0xf255('0x21')](respondWithResult(_0x549c44,null))[_0xf255('0x2a')](handleError(_0x549c44,null));};exports[_0xf255('0xd6')]=function(_0x5b1786,_0x4a03cf,_0x49cf6a){var _0x462616,_0x4ce3b6,_0x4af0e3;return db[_0xf255('0x41')]['find']({'where':{'id':_0x5b1786[_0xf255('0x59')]['id']}})['then'](handleEntityNotFound(_0x4a03cf,null))[_0xf255('0x21')](function(_0x461c87){if(_0x461c87){_0x4af0e3=_0x461c87;logger[_0xf255('0x25')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xf255('0x2c'),_0xf255('0xc7'),_0x461c87[_0xf255('0x44')],util[_0xf255('0xc8')](_0x5b1786[_0xf255('0x46')],{'showHidden':![],'depth':null}));switch(_0x461c87[_0xf255('0x44')]){case _0xf255('0x8f'):if(_0x5b1786[_0xf255('0x46')]['message-id']&&_0x5b1786[_0xf255('0x46')][_0xf255('0xd7')]){_0x4ce3b6=_0x5b1786[_0xf255('0x46')][_0xf255('0xd7')];return db[_0xf255('0xc2')][_0xf255('0x5b')]({'where':{'messageId':_0x5b1786[_0xf255('0x46')][_0xf255('0xd8')]}});}break;}}})['then'](handleEntityNotFound(_0x4a03cf,null))[_0xf255('0x21')](function(_0x3051f1){if(_0x3051f1){_0x462616=_0x3051f1;switch(_0x4af0e3[_0xf255('0x44')]){case _0xf255('0x8f'):if(_0x4ce3b6==='2'||_0x4ce3b6==='6'){return _0x462616[_0xf255('0x63')]({'read':!![]});}else{logger['error'](_0xf255('0xc6'),_0xf255('0x2c'),_0xf255('0x8f'),util[_0xf255('0xc8')](_0x5b1786[_0xf255('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x462616;}})[_0xf255('0x21')](respondWithResult(_0x4a03cf,null))[_0xf255('0x2a')](handleError(_0x4a03cf,null));};exports[_0xf255('0xd9')]=function(_0x185532,_0x3c731e,_0x1544d8){return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x185532[_0xf255('0x59')]['id']}})[_0xf255('0x21')](handleEntityNotFound(_0x3c731e,null))['then'](function(_0x2533f2){if(_0x2533f2){return _0x2533f2[_0xf255('0xd9')](_0x185532['body']['ids'],_['omit'](_0x185532['body'],['ids','id'])||{})[_0xf255('0xa2')](function(_0x3e51b6){for(var _0x31a12c=0x0;_0x31a12c<_0x185532[_0xf255('0x64')][_0xf255('0x6e')][_0xf255('0x4c')];_0x31a12c+=0x1){socket[_0xf255('0xda')]('userSmsAccount:save',{'UserId':_0x185532[_0xf255('0x64')][_0xf255('0x6e')][_0x31a12c],'SmsAccountId':_0x185532[_0xf255('0x59')]['id']});}return _0x3e51b6;});}})['then'](respondWithResult(_0x3c731e,null))[_0xf255('0x2a')](handleError(_0x3c731e,null));};exports[_0xf255('0xdb')]=function(_0x1ff816,_0x3910b7,_0x3f83ff){return db[_0xf255('0x41')][_0xf255('0x5b')]({'where':{'id':_0x1ff816[_0xf255('0x59')]['id']}})['then'](handleEntityNotFound(_0x3910b7,null))[_0xf255('0x21')](function(_0x1511a9){if(_0x1511a9){return _0x1511a9[_0xf255('0xdb')](_0x1ff816[_0xf255('0x46')]['ids'])[_0xf255('0x21')](function(){if(_[_0xf255('0xdc')](_0x1ff816[_0xf255('0x46')][_0xf255('0x6e')])){for(var _0x37f871=0x0;_0x37f871<_0x1ff816[_0xf255('0x46')]['ids'][_0xf255('0x4c')];_0x37f871+=0x1){socket[_0xf255('0xda')](_0xf255('0xdd'),{'UserId':Number(_0x1ff816['query'][_0xf255('0x6e')][_0x37f871]),'SmsAccountId':Number(_0x1ff816[_0xf255('0x59')]['id'])});}}else{socket[_0xf255('0xda')](_0xf255('0xdd'),{'UserId':Number(_0x1ff816[_0xf255('0x46')][_0xf255('0x6e')]),'SmsAccountId':Number(_0x1ff816[_0xf255('0x59')]['id'])});}});}})[_0xf255('0x21')](respondWithStatusCode(_0x3910b7,null))[_0xf255('0x2a')](handleError(_0x3910b7,null));};exports['getAgents']=function(_0x1d482b,_0x7f5165,_0x4a86ff){var _0x4482ab={};var _0x432d30={};var _0x525d86;var _0x504033;return db[_0xf255('0x41')][_0xf255('0x6a')]({'where':{'id':_0x1d482b[_0xf255('0x59')]['id']}})['then'](handleEntityNotFound(_0x7f5165,null))[_0xf255('0x21')](function(_0x58ac13){if(_0x58ac13){_0x525d86=_0x58ac13;_0x432d30[_0xf255('0x45')]=_[_0xf255('0x47')](db[_0xf255('0xab')][_0xf255('0x42')]);_0x432d30[_0xf255('0x46')]=_[_0xf255('0x47')](_0x1d482b['query']);_0x432d30[_0xf255('0x48')]=_[_0xf255('0x49')](_0x432d30['model'],_0x432d30[_0xf255('0x46')]);_0x4482ab[_0xf255('0x4a')]=_[_0xf255('0x49')](_0x432d30[_0xf255('0x45')],qs['fields'](_0x1d482b[_0xf255('0x46')][_0xf255('0x4b')]));_0x4482ab[_0xf255('0x4a')]=_0x4482ab[_0xf255('0x4a')][_0xf255('0x4c')]?_0x4482ab['attributes']:_0x432d30[_0xf255('0x45')];_0x4482ab[_0xf255('0x4f')]=qs[_0xf255('0x50')](_0x1d482b['query'][_0xf255('0x50')]);_0x4482ab[_0xf255('0x51')]=qs[_0xf255('0x48')](_[_0xf255('0x6b')](_0x1d482b[_0xf255('0x46')],_0x432d30['filters']));if(_0x1d482b[_0xf255('0x46')]['filter']){_0x4482ab['where']=_['merge'](_0x4482ab[_0xf255('0x51')],{'$or':_[_0xf255('0x40')](_0x4482ab[_0xf255('0x4a')],function(_0xdbd05e){var _0x95a09={};_0x95a09[_0xdbd05e]={'$like':'%'+_0x1d482b[_0xf255('0x46')]['filter']+'%'};return _0x95a09;})});}_0x4482ab=_[_0xf255('0x54')]({},_0x4482ab,_0x1d482b[_0xf255('0x55')]);return _0x525d86[_0xf255('0xde')](_0x4482ab);}})[_0xf255('0x21')](function(_0x219b69){if(_0x219b69){_0x504033=_0x219b69[_0xf255('0x4c')];if(!_0x1d482b[_0xf255('0x46')][_0xf255('0x4d')](_0xf255('0x4e'))){_0x4482ab['limit']=qs['limit'](_0x1d482b[_0xf255('0x46')]['limit']);_0x4482ab[_0xf255('0x30')]=qs[_0xf255('0x30')](_0x1d482b[_0xf255('0x46')]['offset']);}return _0x525d86[_0xf255('0xde')](_0x4482ab);}})[_0xf255('0x21')](function(_0x19dac1){if(_0x19dac1){return _0x19dac1?{'count':_0x504033,'rows':_0x19dac1}:null;}})[_0xf255('0x21')](respondWithResult(_0x7f5165,null))['catch'](handleError(_0x7f5165,null));}; \ No newline at end of file +var _0x0250=['includeAll','include','findAll','rows','show','params','Pause','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','removeDispositions','addAnswer','CannedAnswer','getAnswers','ids','notify','sms','account','applications','orderBy','Applications','asc','CmContact','describe','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','mobile','twilio','from','Body','messageId','MessageSid','text','connectel','message_id','plivo','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','isNil','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','ListId','Contacts','DESC','list','defaults','contact','SmsInteraction','spread','interaction','autoclose','push','close','unmanaged','*,*,*,*','created','SmsMessage','ContactId','AttachmentId','User','unshift','waitForTheAssignedAgent','startRouting','Start','receiveMessage','info','entity\x20found','Content-Type','text/xml','\x0a','addApplications','sequelize','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','fullname','internal','Tag','color','tag','body\x20is\x20mandatory\x20and\x20not\x20empty','CmList','List','out','Messages','dataValues','log','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','intelepeer','redif','error_code','clicksend','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','html-pdf','fast-json-patch','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SmsAccounts','stack','name','send','mandatoryDispositionPause','map','rawAttributes','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','SmsAccount','count'];(function(_0x4629ee,_0x5802d8){var _0x47fb5b=function(_0xf899cd){while(--_0xf899cd){_0x4629ee['push'](_0x4629ee['shift']());}};_0x47fb5b(++_0x5802d8);}(_0x0250,0x8d));var _0x0025=function(_0x2a5b56,_0x2dd859){_0x2a5b56=_0x2a5b56-0x0;var _0x163ede=_0x0250[_0x2a5b56];return _0x163ede;};'use strict';var pdf=require(_0x0025('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x0025('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x0025('0x2'));var Mustache=require(_0x0025('0x3'));var util=require(_0x0025('0x4'));var path=require('path');var sox=require(_0x0025('0x5'));var csv=require('to-csv');var ejs=require(_0x0025('0x6'));var fs=require('fs');var _=require(_0x0025('0x7'));var squel=require(_0x0025('0x8'));var crypto=require('crypto');var jsforce=require(_0x0025('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x0025('0xa'));var querystring=require(_0x0025('0xb'));var Papa=require(_0x0025('0xc'));var Redis=require(_0x0025('0xd'));var authService=require(_0x0025('0xe'));var qs=require(_0x0025('0xf'));var as=require(_0x0025('0x10'));var hardwareService=require(_0x0025('0x11'));var logger=require(_0x0025('0x12'))(_0x0025('0x13'));var utils=require(_0x0025('0x14'));var config=require(_0x0025('0x15'));var db=require(_0x0025('0x16'))['db'];config[_0x0025('0x17')]=_['defaults'](config[_0x0025('0x17')],{'host':_0x0025('0x18'),'port':0x18eb});var socket=require(_0x0025('0x19'))(new Redis(config[_0x0025('0x17')]));require(_0x0025('0x1a'))[_0x0025('0x1b')](socket);var jayson=require(_0x0025('0x1c'));var client=jayson[_0x0025('0x1d')]['http']({'port':0x232c});function checkPasswordPattern(_0xd6ddfa,_0x5702ba,_0x2caf07){if(_0x2caf07){var _0x1280d6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1280d6[_0x0025('0x1e')](_0x5702ba)){return _0xd6ddfa;}else{throw new db[(_0x0025('0x1f'))][(_0x0025('0x20'))](_0x0025('0x21'));}}else{return _0xd6ddfa;}}function respondWithRpcPromise(_0x1e22f4,_0x40e388,_0x5ce5e9,_0x587e42){return new BPromise(function(_0x27e8fb,_0x3eed42){var _0x5a4669=_0x587e42||client;return _0x5a4669[_0x0025('0x22')](_0x1e22f4,_0x5ce5e9)['then'](function(_0x27110d){logger['info']('SmsAccount,\x20%s,\x20%s',_0x40e388,_0x0025('0x23'));logger[_0x0025('0x24')](_0x0025('0x25'),_0x40e388,_0x0025('0x23'),JSON[_0x0025('0x26')](_0x27110d));if(_0x27110d[_0x0025('0x27')]){if(_0x27110d['error'][_0x0025('0x28')]===0x1f4){logger[_0x0025('0x27')](_0x0025('0x29'),_0x40e388,_0x27110d['error'][_0x0025('0x2a')]);return _0x3eed42(_0x27110d[_0x0025('0x27')]['message']);}logger[_0x0025('0x27')]('SmsAccount,\x20%s,\x20%s',_0x40e388,_0x27110d[_0x0025('0x27')][_0x0025('0x2a')]);return _0x27e8fb(_0x27110d['error'][_0x0025('0x2a')]);}else{logger['info'](_0x0025('0x29'),_0x40e388,'request\x20sent');_0x27e8fb(_0x27110d[_0x0025('0x2b')][_0x0025('0x2a')]);}})[_0x0025('0x2c')](function(_0xba1d96){logger[_0x0025('0x27')]('SmsAccount,\x20%s,\x20%s',_0x40e388,_0xba1d96);_0x3eed42(_0xba1d96);});});}function respondWithStatusCode(_0x187177,_0x26e281){_0x26e281=_0x26e281||0xcc;return function(_0x318cc5){if(_0x318cc5){return _0x187177[_0x0025('0x2d')](_0x26e281);}return _0x187177[_0x0025('0x2e')](_0x26e281)[_0x0025('0x2f')]();};}function respondWithResult(_0x3a5bb9,_0x33735b){_0x33735b=_0x33735b||0xc8;return function(_0x56c620){if(_0x56c620){return _0x3a5bb9['status'](_0x33735b)[_0x0025('0x30')](_0x56c620);}};}function respondWithFilteredResult(_0x432540,_0x1ddd59){return function(_0x4e712b){if(_0x4e712b){var _0x2e3085=_0x4e712b['count'],_0x5877ca=_0x1ddd59[_0x0025('0x31')],_0x2cbd3a=_0x1ddd59[_0x0025('0x31')]+_0x1ddd59[_0x0025('0x32')],_0x4eee76;if(_0x2cbd3a>=_0x2e3085){_0x2cbd3a=_0x2e3085;_0x4eee76=0xc8;}else{_0x4eee76=0xce;}_0x432540[_0x0025('0x2e')](_0x4eee76);return _0x432540[_0x0025('0x33')](_0x0025('0x34'),_0x5877ca+'-'+_0x2cbd3a+'/'+_0x2e3085)[_0x0025('0x30')](_0x4e712b);}return null;};}function patchUpdates(_0x136101){return function(_0x530e01){try{jsonpatch[_0x0025('0x35')](_0x530e01,_0x136101,!![]);}catch(_0x56d8b5){return BPromise[_0x0025('0x36')](_0x56d8b5);}return _0x530e01[_0x0025('0x37')]();};}function saveUpdates(_0x3a2cbc,_0x5366bf){return function(_0x55af93){if(_0x55af93){return _0x55af93[_0x0025('0x38')](_0x3a2cbc)[_0x0025('0x39')](function(_0x3573d1){return _0x3573d1;});}return null;};}function removeEntity(_0x3cec10,_0xbd8cf7){return function(_0x54721c){if(_0x54721c){return _0x54721c[_0x0025('0x3a')]()['then'](function(){var _0xa9fa1d=_0x54721c[_0x0025('0x3b')]({'plain':!![]});var _0x554834=_0x0025('0x3c');return db['UserProfileResource'][_0x0025('0x3a')]({'where':{'type':_0x554834,'resourceId':_0xa9fa1d['id']}})[_0x0025('0x39')](function(){return _0x54721c;});})[_0x0025('0x39')](function(){_0x3cec10[_0x0025('0x2e')](0xcc)[_0x0025('0x2f')]();});}};}function handleEntityNotFound(_0x2524f3,_0x4a4937){return function(_0x39b203){if(!_0x39b203){_0x2524f3[_0x0025('0x2d')](0x194);}return _0x39b203;};}function handleError(_0x38eb3e,_0x2bad2e){_0x2bad2e=_0x2bad2e||0x1f4;return function(_0xab831f){logger[_0x0025('0x27')](_0xab831f[_0x0025('0x3d')]);if(_0xab831f[_0x0025('0x3e')]){delete _0xab831f[_0x0025('0x3e')];}_0x38eb3e[_0x0025('0x2e')](_0x2bad2e)[_0x0025('0x3f')](_0xab831f);};}exports['index']=function(_0x4c879f,_0x34d6b0){var _0xdf0021={'include':[{'model':db['Pause'],'as':_0x0025('0x40')}]},_0xcb471f={},_0x49c59a={'count':0x0,'rows':[]};var _0x531ac0=_[_0x0025('0x41')](db['SmsAccount'][_0x0025('0x42')],function(_0x2272a6){return{'name':_0x2272a6['fieldName'],'type':_0x2272a6[_0x0025('0x43')][_0x0025('0x44')]};});_0xcb471f[_0x0025('0x45')]=_['map'](_0x531ac0,_0x0025('0x3e'));_0xcb471f[_0x0025('0x46')]=_[_0x0025('0x47')](_0x4c879f[_0x0025('0x46')]);_0xcb471f['filters']=_[_0x0025('0x48')](_0xcb471f[_0x0025('0x45')],_0xcb471f[_0x0025('0x46')]);_0xdf0021[_0x0025('0x49')]=_[_0x0025('0x48')](_0xcb471f[_0x0025('0x45')],qs['fields'](_0x4c879f[_0x0025('0x46')][_0x0025('0x4a')]));_0xdf0021[_0x0025('0x49')]=_0xdf0021[_0x0025('0x49')][_0x0025('0x4b')]?_0xdf0021[_0x0025('0x49')]:_0xcb471f['model'];if(!_0x4c879f[_0x0025('0x46')][_0x0025('0x4c')](_0x0025('0x4d'))){_0xdf0021[_0x0025('0x32')]=qs[_0x0025('0x32')](_0x4c879f[_0x0025('0x46')]['limit']);_0xdf0021['offset']=qs['offset'](_0x4c879f[_0x0025('0x46')][_0x0025('0x31')]);}_0xdf0021[_0x0025('0x4e')]=qs[_0x0025('0x4f')](_0x4c879f[_0x0025('0x46')][_0x0025('0x4f')]);_0xdf0021[_0x0025('0x50')]=qs[_0x0025('0x51')](_[_0x0025('0x52')](_0x4c879f[_0x0025('0x46')],_0xcb471f[_0x0025('0x51')]));if(_0x4c879f['query'][_0x0025('0x53')]){_0xdf0021[_0x0025('0x50')]=_[_0x0025('0x54')](_0xdf0021['where'],{'$or':_['map'](_0x531ac0,function(_0x53d25e){if(_0x53d25e['type']!==_0x0025('0x55')){var _0x24e0b4={};_0x24e0b4[_0x53d25e['name']]={'$like':'%'+_0x4c879f['query'][_0x0025('0x53')]+'%'};return _0x24e0b4;}})});}_0xdf0021=_[_0x0025('0x54')]({},_0xdf0021,_0x4c879f[_0x0025('0x56')]);var _0x16a32c={'where':_0xdf0021[_0x0025('0x50')]};return db[_0x0025('0x57')]['count'](_0x16a32c)[_0x0025('0x39')](function(_0x2276b9){_0x49c59a[_0x0025('0x58')]=_0x2276b9;if(_0x4c879f['query'][_0x0025('0x59')]){_0xdf0021[_0x0025('0x5a')]=[{'all':!![]}];}return db['SmsAccount'][_0x0025('0x5b')](_0xdf0021);})[_0x0025('0x39')](function(_0x47da39){_0x49c59a[_0x0025('0x5c')]=_0x47da39;return _0x49c59a;})[_0x0025('0x39')](respondWithFilteredResult(_0x34d6b0,_0xdf0021))['catch'](handleError(_0x34d6b0,null));};exports[_0x0025('0x5d')]=function(_0x598ba9,_0x2852f9){var _0xa827f={'raw':![],'where':{'id':_0x598ba9[_0x0025('0x5e')]['id']},'include':[{'model':db[_0x0025('0x5f')],'as':_0x0025('0x40')}]},_0x5afb07={};_0x5afb07[_0x0025('0x45')]=_[_0x0025('0x47')](db['SmsAccount'][_0x0025('0x42')]);_0x5afb07[_0x0025('0x46')]=_[_0x0025('0x47')](_0x598ba9[_0x0025('0x46')]);_0x5afb07[_0x0025('0x51')]=_[_0x0025('0x48')](_0x5afb07[_0x0025('0x45')],_0x5afb07[_0x0025('0x46')]);_0xa827f[_0x0025('0x49')]=_[_0x0025('0x48')](_0x5afb07['model'],qs['fields'](_0x598ba9[_0x0025('0x46')]['fields']));_0xa827f['attributes']=_0xa827f[_0x0025('0x49')][_0x0025('0x4b')]?_0xa827f[_0x0025('0x49')]:_0x5afb07['model'];if(_0x598ba9[_0x0025('0x46')]['includeAll']){_0xa827f[_0x0025('0x5a')]=[{'all':!![]}];}_0xa827f=_['merge']({},_0xa827f,_0x598ba9[_0x0025('0x56')]);return db[_0x0025('0x57')][_0x0025('0x60')](_0xa827f)['then'](handleEntityNotFound(_0x2852f9,null))['then'](respondWithResult(_0x2852f9,null))['catch'](handleError(_0x2852f9,null));};exports[_0x0025('0x61')]=function(_0x3f2285,_0x97204a){return db[_0x0025('0x57')]['create'](_0x3f2285['body'],{})['then'](function(_0x891832){var _0xed0f32=_0x3f2285[_0x0025('0x62')][_0x0025('0x3b')]({'plain':!![]});if(!_0xed0f32)throw new Error(_0x0025('0x63'));if(_0xed0f32[_0x0025('0x64')]===_0x0025('0x62')){var _0x13977b=_0x891832['get']({'plain':!![]});var _0x22c8c1=_0x0025('0x3c');return db[_0x0025('0x65')][_0x0025('0x60')]({'where':{'name':_0x22c8c1,'userProfileId':_0xed0f32[_0x0025('0x66')]},'raw':!![]})[_0x0025('0x39')](function(_0x16b538){if(_0x16b538&&_0x16b538['autoAssociation']===0x0){return db[_0x0025('0x67')][_0x0025('0x61')]({'name':_0x13977b['name'],'resourceId':_0x13977b['id'],'type':_0x16b538[_0x0025('0x3e')],'sectionId':_0x16b538['id']},{})[_0x0025('0x39')](function(){return _0x891832;});}else{return _0x891832;}})[_0x0025('0x2c')](function(_0x38cd2a){logger[_0x0025('0x27')](_0x0025('0x68'),_0x38cd2a);throw _0x38cd2a;});}return _0x891832;})[_0x0025('0x39')](respondWithResult(_0x97204a,0xc9))['catch'](handleError(_0x97204a,null));};exports[_0x0025('0x38')]=function(_0xad6a25,_0x4352bd){if(_0xad6a25['body']['id']){delete _0xad6a25[_0x0025('0x69')]['id'];}return db[_0x0025('0x57')][_0x0025('0x60')]({'where':{'id':_0xad6a25[_0x0025('0x5e')]['id']},'include':[{'model':db[_0x0025('0x5f')],'as':_0x0025('0x40')}]})['then'](handleEntityNotFound(_0x4352bd,null))[_0x0025('0x39')](saveUpdates(_0xad6a25[_0x0025('0x69')],null))['then'](respondWithResult(_0x4352bd,null))[_0x0025('0x2c')](handleError(_0x4352bd,null));};exports[_0x0025('0x3a')]=function(_0x5eb259,_0x17969d){return db[_0x0025('0x57')][_0x0025('0x60')]({'where':{'id':_0x5eb259['params']['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x17969d,null))[_0x0025('0x39')](removeEntity(_0x17969d,null))[_0x0025('0x2c')](handleError(_0x17969d,null));};exports['describe']=function(_0x415113,_0x53eb80){return db[_0x0025('0x57')]['describe']()[_0x0025('0x39')](respondWithResult(_0x53eb80,null))[_0x0025('0x2c')](handleError(_0x53eb80,null));};exports[_0x0025('0x6a')]=function(_0x204987,_0x27673e,_0x3ed8b6){if(_0x204987[_0x0025('0x69')]['id']){delete _0x204987['body']['id'];}return db[_0x0025('0x57')][_0x0025('0x60')]({'where':{'id':_0x204987[_0x0025('0x5e')]['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x27673e,null))[_0x0025('0x39')](function(_0x6aa839){if(_0x6aa839){_0x204987[_0x0025('0x69')][_0x0025('0x6b')]=_0x6aa839['id'];return db['Disposition']['create'](_0x204987[_0x0025('0x69')]);}})[_0x0025('0x39')](respondWithResult(_0x27673e,null))[_0x0025('0x2c')](handleError(_0x27673e,null));};exports[_0x0025('0x6c')]=function(_0x54907f,_0x1cc736,_0xbe8aa4){var _0x2f2b2f={'raw':![],'where':{}};var _0x531d79={};var _0x2c083d={'count':0x0,'rows':[]};return db[_0x0025('0x57')][_0x0025('0x6d')]({'where':{'id':_0x54907f[_0x0025('0x5e')]['id']}})['then'](handleEntityNotFound(_0x1cc736,null))[_0x0025('0x39')](function(_0x29abf9){if(_0x29abf9){_0x531d79['model']=_[_0x0025('0x47')](db[_0x0025('0x6e')]['rawAttributes']);_0x531d79[_0x0025('0x46')]=_['keys'](_0x54907f[_0x0025('0x46')]);_0x531d79[_0x0025('0x51')]=_[_0x0025('0x48')](_0x531d79[_0x0025('0x45')],_0x531d79[_0x0025('0x46')]);_0x2f2b2f[_0x0025('0x49')]=_[_0x0025('0x48')](_0x531d79[_0x0025('0x45')],qs[_0x0025('0x4a')](_0x54907f[_0x0025('0x46')][_0x0025('0x4a')]));_0x2f2b2f[_0x0025('0x49')]=_0x2f2b2f[_0x0025('0x49')][_0x0025('0x4b')]?_0x2f2b2f[_0x0025('0x49')]:_0x531d79['model'];if(!_0x54907f[_0x0025('0x46')][_0x0025('0x4c')](_0x0025('0x4d'))){_0x2f2b2f[_0x0025('0x32')]=qs[_0x0025('0x32')](_0x54907f[_0x0025('0x46')][_0x0025('0x32')]);_0x2f2b2f[_0x0025('0x31')]=qs[_0x0025('0x31')](_0x54907f[_0x0025('0x46')]['offset']);}_0x2f2b2f[_0x0025('0x4e')]=qs[_0x0025('0x4f')](_0x54907f[_0x0025('0x46')][_0x0025('0x4f')]);_0x2f2b2f[_0x0025('0x50')]=qs[_0x0025('0x51')](_['pick'](_0x54907f[_0x0025('0x46')],_0x531d79['filters']));_0x2f2b2f['where'][_0x0025('0x6b')]=_0x29abf9['id'];if(_0x54907f['query'][_0x0025('0x53')]){_0x2f2b2f[_0x0025('0x50')]=_[_0x0025('0x54')](_0x2f2b2f[_0x0025('0x50')],{'$or':_[_0x0025('0x41')](_0x2f2b2f[_0x0025('0x49')],function(_0x49754d){var _0x24199d={};_0x24199d[_0x49754d]={'$like':'%'+_0x54907f['query'][_0x0025('0x53')]+'%'};return _0x24199d;})});}_0x2f2b2f=_['merge']({},_0x2f2b2f,_0x54907f[_0x0025('0x56')]);return db[_0x0025('0x6e')][_0x0025('0x58')]({'where':_0x2f2b2f[_0x0025('0x50')]})['then'](function(_0x27cc9c){_0x2c083d[_0x0025('0x58')]=_0x27cc9c;if(_0x54907f['query'][_0x0025('0x59')]){_0x2f2b2f[_0x0025('0x5a')]=[{'all':!![]}];}return db['Disposition'][_0x0025('0x5b')](_0x2f2b2f);})[_0x0025('0x39')](function(_0xc6a686){_0x2c083d[_0x0025('0x5c')]=_0xc6a686;return _0x2c083d;});}})[_0x0025('0x39')](respondWithFilteredResult(_0x1cc736,_0x2f2b2f))[_0x0025('0x2c')](handleError(_0x1cc736,null));};exports[_0x0025('0x6f')]=function(_0x59fc48,_0x1c2e92,_0x34253f){return db['SmsAccount'][_0x0025('0x60')]({'where':{'id':_0x59fc48[_0x0025('0x5e')]['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x1c2e92,null))[_0x0025('0x39')](function(_0x3e2b56){if(_0x3e2b56){return _0x3e2b56['removeDispositions'](_0x59fc48[_0x0025('0x46')]['ids']);}})[_0x0025('0x39')](respondWithStatusCode(_0x1c2e92,null))[_0x0025('0x2c')](handleError(_0x1c2e92,null));};exports[_0x0025('0x70')]=function(_0x5236a6,_0x4703d8,_0x58cbdb){if(_0x5236a6[_0x0025('0x69')]['id']){delete _0x5236a6[_0x0025('0x69')]['id'];}return db[_0x0025('0x57')][_0x0025('0x60')]({'where':{'id':_0x5236a6[_0x0025('0x5e')]['id']}})['then'](handleEntityNotFound(_0x4703d8,null))[_0x0025('0x39')](function(_0x54731f){if(_0x54731f){_0x5236a6[_0x0025('0x69')][_0x0025('0x6b')]=_0x54731f['id'];return db[_0x0025('0x71')][_0x0025('0x61')](_0x5236a6[_0x0025('0x69')]);}})[_0x0025('0x39')](respondWithResult(_0x4703d8,null))[_0x0025('0x2c')](handleError(_0x4703d8,null));};exports[_0x0025('0x72')]=function(_0x154bd8,_0xf14046,_0x28160d){var _0x489cb1={'raw':![],'where':{}};var _0x155d77={};var _0x419190={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x154bd8['params']['id']}})[_0x0025('0x39')](handleEntityNotFound(_0xf14046,null))['then'](function(_0x20038e){if(_0x20038e){_0x155d77[_0x0025('0x45')]=_[_0x0025('0x47')](db[_0x0025('0x71')]['rawAttributes']);_0x155d77[_0x0025('0x46')]=_[_0x0025('0x47')](_0x154bd8[_0x0025('0x46')]);_0x155d77[_0x0025('0x51')]=_[_0x0025('0x48')](_0x155d77[_0x0025('0x45')],_0x155d77[_0x0025('0x46')]);_0x489cb1[_0x0025('0x49')]=_['intersection'](_0x155d77[_0x0025('0x45')],qs[_0x0025('0x4a')](_0x154bd8[_0x0025('0x46')][_0x0025('0x4a')]));_0x489cb1[_0x0025('0x49')]=_0x489cb1[_0x0025('0x49')][_0x0025('0x4b')]?_0x489cb1[_0x0025('0x49')]:_0x155d77[_0x0025('0x45')];if(!_0x154bd8[_0x0025('0x46')][_0x0025('0x4c')](_0x0025('0x4d'))){_0x489cb1['limit']=qs[_0x0025('0x32')](_0x154bd8[_0x0025('0x46')][_0x0025('0x32')]);_0x489cb1[_0x0025('0x31')]=qs[_0x0025('0x31')](_0x154bd8[_0x0025('0x46')][_0x0025('0x31')]);}_0x489cb1[_0x0025('0x4e')]=qs[_0x0025('0x4f')](_0x154bd8[_0x0025('0x46')][_0x0025('0x4f')]);_0x489cb1[_0x0025('0x50')]=qs['filters'](_[_0x0025('0x52')](_0x154bd8[_0x0025('0x46')],_0x155d77[_0x0025('0x51')]));_0x489cb1[_0x0025('0x50')][_0x0025('0x6b')]=_0x20038e['id'];if(_0x154bd8[_0x0025('0x46')][_0x0025('0x53')]){_0x489cb1['where']=_['merge'](_0x489cb1[_0x0025('0x50')],{'$or':_[_0x0025('0x41')](_0x489cb1[_0x0025('0x49')],function(_0x1999f6){var _0xede4dd={};_0xede4dd[_0x1999f6]={'$like':'%'+_0x154bd8['query'][_0x0025('0x53')]+'%'};return _0xede4dd;})});}_0x489cb1=_[_0x0025('0x54')]({},_0x489cb1,_0x154bd8[_0x0025('0x56')]);return db[_0x0025('0x71')][_0x0025('0x58')]({'where':_0x489cb1['where']})[_0x0025('0x39')](function(_0x1a19cc){_0x419190[_0x0025('0x58')]=_0x1a19cc;if(_0x154bd8[_0x0025('0x46')][_0x0025('0x59')]){_0x489cb1['include']=[{'all':!![]}];}return db[_0x0025('0x71')][_0x0025('0x5b')](_0x489cb1);})[_0x0025('0x39')](function(_0x5edf21){_0x419190[_0x0025('0x5c')]=_0x5edf21;return _0x419190;});}})[_0x0025('0x39')](respondWithFilteredResult(_0xf14046,_0x489cb1))[_0x0025('0x2c')](handleError(_0xf14046,null));};exports['removeAnswers']=function(_0x1f48eb,_0x39ab86,_0x2ced64){return db[_0x0025('0x57')]['find']({'where':{'id':_0x1f48eb['params']['id']}})['then'](handleEntityNotFound(_0x39ab86,null))[_0x0025('0x39')](function(_0x3e78e8){if(_0x3e78e8){return _0x3e78e8['removeAnswers'](_0x1f48eb[_0x0025('0x46')][_0x0025('0x73')]);}})[_0x0025('0x39')](respondWithStatusCode(_0x39ab86,null))[_0x0025('0x2c')](handleError(_0x39ab86,null));};exports[_0x0025('0x74')]=function(_0x28b34c,_0x1048e6,_0x77fd9c){var _0x134bf7={'channel':_0x0025('0x75')};var _0x21d200=[];var _0x4b161c=[];var _0x59840c={};return db[_0x0025('0x57')][_0x0025('0x60')]({'where':{'id':_0x28b34c[_0x0025('0x5e')]['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})[_0x0025('0x39')](handleEntityNotFound(_0x1048e6,null))[_0x0025('0x39')](function(_0x18e04e){_0x134bf7[_0x0025('0x76')]=_0x18e04e;_0x134bf7[_0x0025('0x77')]=_[_0x0025('0x78')](_0x18e04e[_0x0025('0x79')],['priority'],[_0x0025('0x7a')]);if(_0x134bf7['account'][_0x0025('0x79')]){delete _0x134bf7['account']['Applications'];}return db[_0x0025('0x7b')][_0x0025('0x7c')]();})[_0x0025('0x39')](function(_0x3d5180){if(!_0x3d5180){throw new db[(_0x0025('0x1f'))][(_0x0025('0x20'))](_0x0025('0x7d'));}_0x21d200=_[_0x0025('0x7e')](_[_0x0025('0x47')](_0x3d5180),[_0x0025('0x7f'),_0x0025('0x80')]);_0x4b161c=_['difference'](_[_0x0025('0x47')](_0x3d5180),[_0x0025('0x7f'),_0x0025('0x80'),_0x0025('0x81'),'ListId']);_0x134bf7[_0x0025('0x69')]={'mapKey':_0x0025('0x82')};if(_0x134bf7[_0x0025('0x76')][_0x0025('0x43')]){switch(_0x134bf7['account'][_0x0025('0x43')]){case _0x0025('0x83'):_0x134bf7[_0x0025('0x69')][_0x0025('0x84')]=_0x28b34c[_0x0025('0x69')]['From'];_0x134bf7[_0x0025('0x69')][_0x0025('0x69')]=_0x28b34c['body'][_0x0025('0x85')];_0x134bf7[_0x0025('0x69')][_0x0025('0x86')]=_0x28b34c[_0x0025('0x69')][_0x0025('0x87')];break;case'skebby':_0x134bf7['body'][_0x0025('0x84')]='+'+_0x28b34c[_0x0025('0x69')]['sender'];_0x134bf7[_0x0025('0x69')]['body']=_0x28b34c[_0x0025('0x69')][_0x0025('0x88')];break;case _0x0025('0x89'):_0x134bf7[_0x0025('0x69')][_0x0025('0x84')]=_0x28b34c[_0x0025('0x69')][_0x0025('0x84')];_0x134bf7[_0x0025('0x69')][_0x0025('0x69')]=_0x28b34c[_0x0025('0x69')]['message'];break;case'clicksend':_0x134bf7[_0x0025('0x69')][_0x0025('0x84')]=_0x28b34c[_0x0025('0x69')][_0x0025('0x84')];_0x134bf7[_0x0025('0x69')]['body']=_0x28b34c[_0x0025('0x69')]['body'];_0x134bf7[_0x0025('0x69')][_0x0025('0x86')]=_0x28b34c[_0x0025('0x69')][_0x0025('0x8a')];break;case _0x0025('0x8b'):_0x134bf7[_0x0025('0x69')][_0x0025('0x84')]=_0x28b34c[_0x0025('0x69')]['From'];_0x134bf7['body'][_0x0025('0x69')]=_0x28b34c[_0x0025('0x69')]['Text'];_0x134bf7['body'][_0x0025('0x86')]=_0x28b34c['body'][_0x0025('0x8c')];break;case _0x0025('0x8d'):_0x134bf7[_0x0025('0x69')][_0x0025('0x84')]='+'+_0x28b34c[_0x0025('0x69')]['results'][0x0][_0x0025('0x84')];_0x134bf7[_0x0025('0x69')]['body']=_0x28b34c['body'][_0x0025('0x8e')][0x0][_0x0025('0x88')];_0x134bf7[_0x0025('0x69')]['messageId']=_0x28b34c[_0x0025('0x69')][_0x0025('0x8e')][0x0][_0x0025('0x86')];break;case _0x0025('0x8f'):_0x134bf7[_0x0025('0x69')][_0x0025('0x84')]=_0x28b34c[_0x0025('0x69')][_0x0025('0x90')];_0x134bf7[_0x0025('0x69')][_0x0025('0x69')]=_0x28b34c[_0x0025('0x69')][_0x0025('0x91')][_0x0025('0x2a')];break;case _0x0025('0x92'):_0x134bf7[_0x0025('0x69')][_0x0025('0x84')]=_0x28b34c['body'][_0x0025('0x93')];_0x134bf7[_0x0025('0x69')][_0x0025('0x69')]=_0x28b34c['body']['text'];_0x134bf7[_0x0025('0x69')][_0x0025('0x86')]=_0x28b34c[_0x0025('0x69')][_0x0025('0x94')];break;case'intelepeer':_0x134bf7['body']['from']=_0x28b34c[_0x0025('0x69')][_0x0025('0x84')];_0x134bf7['body'][_0x0025('0x69')]=_0x28b34c['body'][_0x0025('0x2a')];_0x134bf7['body']['messageId']=_0x28b34c['body'][_0x0025('0x95')];break;}}if(_0x134bf7[_0x0025('0x69')]['id']){delete _0x134bf7[_0x0025('0x69')]['id'];}if(_[_0x0025('0x96')](_0x134bf7[_0x0025('0x69')][_0x0025('0x84')])){throw new db[(_0x0025('0x1f'))][(_0x0025('0x20'))]('from\x20is\x20mandatory');}if(_[_0x0025('0x96')](_0x134bf7['body'][_0x0025('0x69')])||_0x134bf7[_0x0025('0x69')][_0x0025('0x69')]===''){throw new db[(_0x0025('0x1f'))][(_0x0025('0x20'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x0025('0x96')](_0x134bf7[_0x0025('0x69')][_0x0025('0x97')])){throw new db[(_0x0025('0x1f'))]['ValidationError'](_0x0025('0x98')+_0x4b161c);}if(!_['includes'](_0x4b161c,_0x134bf7['body'][_0x0025('0x97')])){throw new db['Sequelize'][(_0x0025('0x20'))](_0x0025('0x99')+_0x4b161c);}_0x59840c[_0x134bf7['body']['mapKey']]=_0x134bf7[_0x0025('0x69')]['from'];return db['CmList']['find']({'where':{'id':_0x134bf7[_0x0025('0x76')][_0x0025('0x9a')]},'include':[{'model':db[_0x0025('0x7b')],'as':_0x0025('0x9b'),'where':_0x59840c,'limit':0x1,'order':[['updatedAt',_0x0025('0x9c')]]}]});})[_0x0025('0x39')](handleEntityNotFound(_0x1048e6,null))[_0x0025('0x39')](function(_0x3764f0){if(_0x3764f0){_0x134bf7[_0x0025('0x9d')]=_['omit'](_0x3764f0,[_0x0025('0x9b')]);if(_0x3764f0[_0x0025('0x9b')][_0x0025('0x4b')]){return _0x3764f0['Contacts'][0x0];}var _0x381d7=_[_0x0025('0x9e')](_0x134bf7['body'],{'firstName':_0x134bf7[_0x0025('0x69')][_0x0025('0x84')],'ListId':_0x3764f0['id']});_0x381d7[_0x134bf7[_0x0025('0x69')][_0x0025('0x97')]]=_0x134bf7[_0x0025('0x69')][_0x0025('0x84')];return db[_0x0025('0x7b')][_0x0025('0x61')](_0x381d7,{'fields':_0x21d200,'raw':!![]});}})[_0x0025('0x39')](handleEntityNotFound(_0x1048e6,null))[_0x0025('0x39')](function(_0x26f9a9){if(_0x26f9a9){_0x134bf7[_0x0025('0x9f')]=_0x26f9a9;var _0x1fc4e9={'ContactId':_0x26f9a9['id'],'phone':_0x134bf7[_0x0025('0x69')][_0x0025('0x84')],'SmsAccountId':_0x28b34c[_0x0025('0x5e')]['id']};var _0x44d4f7={'ContactId':_0x26f9a9['id'],'SmsAccountId':_0x28b34c[_0x0025('0x5e')]['id'],'closed':![]};return db[_0x0025('0xa0')][_0x0025('0x60')]({'where':_0x44d4f7})[_0x0025('0x39')](function(_0x31d55f){if(_0x31d55f){return[_0x31d55f,![]];}return db[_0x0025('0xa0')][_0x0025('0x61')](_0x1fc4e9)['then'](function(_0x5501bd){return[_0x5501bd,!![]];});});}})[_0x0025('0xa1')](function(_0x35350a,_0x566f3a){_0x134bf7['interaction']=_0x35350a['get']({'plain':!![]});_0x134bf7[_0x0025('0xa2')]['created']=![];if(_0x566f3a){if(_0x134bf7[_0x0025('0x76')][_0x0025('0xa3')]){_0x134bf7[_0x0025('0x77')][_0x0025('0xa4')]({'id':0x0,'priority':_0x134bf7['applications'][_0x0025('0x4b')]+0x1,'app':_0x0025('0xa5'),'appdata':_0x0025('0xa6'),'interval':_0x0025('0xa7')});}_0x134bf7[_0x0025('0xa2')][_0x0025('0xa8')]=!![];}return db[_0x0025('0xa9')][_0x0025('0x61')]({'phone':_0x134bf7[_0x0025('0x69')][_0x0025('0x84')],'messageId':_0x134bf7[_0x0025('0x69')][_0x0025('0x86')],'body':_0x134bf7['body']['body'],'SmsAccountId':_0x28b34c[_0x0025('0x5e')]['id'],'SmsInteractionId':_0x35350a['id'],'direction':'in','ContactId':_0x35350a[_0x0025('0xaa')],'AttachmentId':_0x134bf7['body'][_0x0025('0xab')]});})[_0x0025('0x39')](function(_0x37a556){_0x134bf7[_0x0025('0x2a')]=_0x37a556;if(_0x134bf7[_0x0025('0xa2')]['UserId']){return db[_0x0025('0xac')]['find']({'attributes':['id',_0x0025('0x3e')],'where':{'id':_0x134bf7[_0x0025('0xa2')]['UserId']}})['then'](function(_0x6c8602){if(_0x6c8602){_0x134bf7[_0x0025('0x77')][_0x0025('0xad')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x6c8602[_0x0025('0x3e')]+','+(_0x134bf7[_0x0025('0x76')][_0x0025('0xae')]||0xa),'interval':_0x0025('0xa7')});}return respondWithRpcPromise('Start',_0x0025('0xaf'),_0x134bf7);});}return respondWithRpcPromise(_0x0025('0xb0'),'startRouting',_0x134bf7);})[_0x0025('0x39')](function(_0x5bdae1){if(_0x5bdae1){var _0x4125fc=0xc8;var _0x30710d=_0x0025('0xb1');logger[_0x0025('0xb2')](_0x0025('0x25'),_0x30710d,_0x4125fc,_0x0025('0xb3'));logger['debug']('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x30710d,_0x4125fc,_0x0025('0xb3'),JSON[_0x0025('0x26')](_0x5bdae1));if(_0x134bf7[_0x0025('0x76')][_0x0025('0x43')]===_0x0025('0x83')){return _0x1048e6['status'](_0x4125fc)['set'](_0x0025('0xb4'),_0x0025('0xb5'))[_0x0025('0x3f')](_0x0025('0xb6'));}else{return _0x1048e6['status'](_0x4125fc)[_0x0025('0x30')](_0x5bdae1);}}})['catch'](handleError(_0x1048e6,null));};exports[_0x0025('0xb7')]=function(_0x369ecf,_0x85e5d5,_0x147e3f){return db[_0x0025('0x57')][_0x0025('0x6d')]({'where':{'id':_0x369ecf['params']['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x85e5d5,null))[_0x0025('0x39')](function(_0x10bae8){if(_0x10bae8){return db[_0x0025('0xb8')]['transaction'](function(_0x5e0e4c){return db['SmsApplication'][_0x0025('0x3a')]({'where':{'SmsAccountId':_0x369ecf[_0x0025('0x5e')]['id']},'transaction':_0x5e0e4c})[_0x0025('0x39')](function(_0x4d8209){var _0x262d02=_['map'](_0x369ecf['body'],function(_0x48f7c6){_0x48f7c6[_0x0025('0x6b')]=_0x369ecf[_0x0025('0x5e')]['id'];return _0x48f7c6;});return db['SmsApplication'][_0x0025('0xb9')](_0x262d02,{'transaction':_0x5e0e4c});});})['then'](function(){return db['SmsApplication'][_0x0025('0xba')]({'where':{'SmsAccountId':_0x369ecf[_0x0025('0x5e')]['id']},'order':_0x0025('0xbb')});});}})['then'](respondWithResult(_0x85e5d5,null))[_0x0025('0x2c')](handleError(_0x85e5d5,null));};exports[_0x0025('0xbc')]=function(_0x57aba6,_0x18533a,_0x5d9ef9){var _0xb79b56={};var _0x1c6dff={};var _0x493172;var _0x5a710a;return db[_0x0025('0x57')][_0x0025('0x6d')]({'where':{'id':_0x57aba6[_0x0025('0x5e')]['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x18533a,null))[_0x0025('0x39')](function(_0x4d3f64){if(_0x4d3f64){_0x493172=_0x4d3f64;_0x1c6dff[_0x0025('0x45')]=_[_0x0025('0x47')](db['SmsApplication']['rawAttributes']);_0x1c6dff[_0x0025('0x46')]=_['keys'](_0x57aba6[_0x0025('0x46')]);_0x1c6dff[_0x0025('0x51')]=_[_0x0025('0x48')](_0x1c6dff[_0x0025('0x45')],_0x1c6dff[_0x0025('0x46')]);_0xb79b56['attributes']=_['intersection'](_0x1c6dff[_0x0025('0x45')],qs[_0x0025('0x4a')](_0x57aba6[_0x0025('0x46')][_0x0025('0x4a')]));_0xb79b56[_0x0025('0x49')]=_0xb79b56[_0x0025('0x49')]['length']?_0xb79b56['attributes']:_0x1c6dff['model'];_0xb79b56[_0x0025('0x4e')]=qs[_0x0025('0x4f')](_0x57aba6['query']['sort']);_0xb79b56['where']=qs['filters'](_[_0x0025('0x52')](_0x57aba6['query'],_0x1c6dff[_0x0025('0x51')]));if(_0x57aba6[_0x0025('0x46')][_0x0025('0x53')]){_0xb79b56[_0x0025('0x50')]=_[_0x0025('0x54')](_0xb79b56[_0x0025('0x50')],{'$or':_['map'](_0xb79b56[_0x0025('0x49')],function(_0x181284){var _0x24bdeb={};_0x24bdeb[_0x181284]={'$like':'%'+_0x57aba6[_0x0025('0x46')]['filter']+'%'};return _0x24bdeb;})});}_0xb79b56=_[_0x0025('0x54')]({},_0xb79b56,_0x57aba6['options']);return _0x493172[_0x0025('0xbc')](_0xb79b56);}})[_0x0025('0x39')](function(_0x3aa34b){if(_0x3aa34b){_0x5a710a=_0x3aa34b[_0x0025('0x4b')];if(!_0x57aba6[_0x0025('0x46')][_0x0025('0x4c')]('nolimit')){_0xb79b56[_0x0025('0x32')]=qs[_0x0025('0x32')](_0x57aba6['query'][_0x0025('0x32')]);_0xb79b56['offset']=qs['offset'](_0x57aba6[_0x0025('0x46')][_0x0025('0x31')]);}return _0x493172[_0x0025('0xbc')](_0xb79b56);}})[_0x0025('0x39')](function(_0x2f0259){if(_0x2f0259){return _0x2f0259?{'count':_0x5a710a,'rows':_0x2f0259}:null;}})['then'](respondWithResult(_0x18533a,null))[_0x0025('0x2c')](handleError(_0x18533a,null));};exports[_0x0025('0xbd')]=function(_0x2ea935,_0x5ebb70,_0x37c584){var _0x2730fc={'raw':![],'where':{}};var _0x13fec3={};var _0x16af2b={'count':0x0,'rows':[]};return db[_0x0025('0x57')]['findOne']({'where':{'id':_0x2ea935['params']['id']}})['then'](handleEntityNotFound(_0x5ebb70,null))[_0x0025('0x39')](function(_0x15695c){if(_0x15695c){_0x13fec3[_0x0025('0x45')]=_['keys'](db['SmsInteraction'][_0x0025('0x42')]);_0x13fec3[_0x0025('0x46')]=_[_0x0025('0x47')](_0x2ea935['query']);_0x13fec3[_0x0025('0x51')]=_[_0x0025('0x48')](_0x13fec3[_0x0025('0x45')],_0x13fec3[_0x0025('0x46')]);_0x2730fc['attributes']=_['intersection'](_0x13fec3[_0x0025('0x45')],qs[_0x0025('0x4a')](_0x2ea935[_0x0025('0x46')][_0x0025('0x4a')]));_0x2730fc[_0x0025('0x49')]=_0x2730fc['attributes']['length']?_0x2730fc[_0x0025('0x49')]:_0x13fec3[_0x0025('0x45')];if(!_0x2ea935[_0x0025('0x46')][_0x0025('0x4c')]('nolimit')){_0x2730fc[_0x0025('0x32')]=qs[_0x0025('0x32')](_0x2ea935['query'][_0x0025('0x32')]);_0x2730fc['offset']=qs[_0x0025('0x31')](_0x2ea935['query'][_0x0025('0x31')]);}_0x2730fc[_0x0025('0x4e')]=qs[_0x0025('0x4f')](_0x2ea935[_0x0025('0x46')][_0x0025('0x4f')]);_0x2730fc[_0x0025('0x50')]=qs['filters'](_['pick'](_0x2ea935[_0x0025('0x46')],_0x13fec3['filters']));_0x2730fc[_0x0025('0x50')][_0x0025('0x6b')]=_0x15695c['id'];if(_0x2ea935['query'][_0x0025('0x53')]){_0x2730fc[_0x0025('0x50')]=_[_0x0025('0x54')](_0x2730fc['where'],{'$or':_[_0x0025('0x41')](_0x2730fc[_0x0025('0x49')],function(_0x14f98a){var _0x407a9c={};_0x407a9c[_0x14f98a]={'$like':'%'+_0x2ea935[_0x0025('0x46')]['filter']+'%'};return _0x407a9c;})});}_0x2730fc=_[_0x0025('0x54')]({},_0x2730fc,_0x2ea935[_0x0025('0x56')]);return db[_0x0025('0xa0')][_0x0025('0x58')]({'where':_0x2730fc['where']})[_0x0025('0x39')](function(_0x37cf2e){_0x16af2b['count']=_0x37cf2e;if(_0x2ea935[_0x0025('0x46')][_0x0025('0x59')]){_0x2730fc[_0x0025('0x5a')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x0025('0xac')],'as':'Owner','attributes':['name',_0x0025('0xbe'),_0x0025('0xbf')],'required':![]},{'model':db[_0x0025('0xc0')],'as':'Tags','attributes':['id','name',_0x0025('0xc1')],'where':_0x2ea935[_0x0025('0x46')][_0x0025('0xc2')]?{'id':_0x2ea935[_0x0025('0x46')][_0x0025('0xc2')]}:undefined,'required':_0x2ea935[_0x0025('0x46')]['tag']?!![]:![]}];}return db[_0x0025('0xa0')][_0x0025('0x5b')](_0x2730fc);})[_0x0025('0x39')](function(_0x3bdcf6){_0x16af2b['rows']=_0x3bdcf6;return _0x16af2b;});}})[_0x0025('0x39')](respondWithFilteredResult(_0x5ebb70,_0x2730fc))[_0x0025('0x2c')](handleError(_0x5ebb70,null));};exports[_0x0025('0x3f')]=function(_0x4e2f17,_0x21ca0e,_0x42c2ed){var _0x142344,_0x13c411,_0x95427;if(_[_0x0025('0x96')](_0x4e2f17['body'][_0x0025('0x69')])||_0x4e2f17['body']['body']===''){throw new db['Sequelize'][(_0x0025('0x20'))](_0x0025('0xc3'));}if(_['isNil'](_0x4e2f17[_0x0025('0x69')]['to'])){throw new db[(_0x0025('0x1f'))][(_0x0025('0x20'))]('to\x20is\x20mandatory');}_0x142344=_0x4e2f17[_0x0025('0x69')]['to'];return db[_0x0025('0x57')]['find']({'where':{'id':_0x4e2f17[_0x0025('0x5e')]['id']},'include':[{'model':db[_0x0025('0xc4')],'as':_0x0025('0xc5'),'include':[{'model':db['CmContact'],'as':_0x0025('0x9b'),'where':{'mobile':_0x142344},'limit':0x1,'order':[[_0x0025('0x80'),_0x0025('0x9c')]]}]}]})[_0x0025('0x39')](handleEntityNotFound(_0x21ca0e,null))['then'](function(_0x209944){if(_0x209944&&_0x209944[_0x0025('0xc5')]){_0x13c411=_0x209944[_0x0025('0x3b')]({'plain':!![]});if(_0x13c411[_0x0025('0xc5')]&&_0x13c411[_0x0025('0xc5')][_0x0025('0x9b')]['length']){return _0x13c411[_0x0025('0xc5')][_0x0025('0x9b')][0x0];}return db[_0x0025('0x7b')][_0x0025('0x61')](_['defaults'](_0x4e2f17['body'],{'firstName':_0x142344,'mobile':_0x142344,'phone':_0x142344,'ListId':_0x13c411[_0x0025('0x9a')]}));}})[_0x0025('0x39')](handleEntityNotFound(_0x21ca0e,null))[_0x0025('0x39')](function(_0x51eb3f){if(_0x51eb3f){_0x95427=_0x51eb3f;return db[_0x0025('0xa0')]['find']({'where':{'ContactId':_0x95427['id'],'closed':![],'SmsAccountId':_0x13c411['id']}})[_0x0025('0x39')](function(_0x675bbc){if(_0x675bbc){return[_0x675bbc,![]];}return db[_0x0025('0xa0')]['create']({'UserId':_0x4e2f17[_0x0025('0x62')]['id'],'ContactId':_0x95427['id'],'SmsAccountId':_0x13c411['id'],'phone':_0x142344,'firstMsgDirection':_0x0025('0xc6'),'Messages':[_[_0x0025('0x54')](_0x4e2f17[_0x0025('0x69')],{'read':![],'body':_0x4e2f17[_0x0025('0x69')][_0x0025('0x69')],'phone':_0x142344,'SmsAccountId':_0x13c411['id'],'UserId':_0x4e2f17[_0x0025('0x62')]['id'],'ContactId':_0x95427['id']})]},{'include':[{'model':db['SmsMessage'],'as':_0x0025('0xc7')}]})['then'](function(_0x1a199d){return[_0x1a199d,!![]];});});}})[_0x0025('0xa1')](function(_0x49dd95,_0x46e718){if(_0x46e718){return _0x49dd95;}return db[_0x0025('0xa9')][_0x0025('0x61')](_['merge'](_0x4e2f17['body'],{'read':![],'body':_0x4e2f17[_0x0025('0x69')]['body'],'phone':_0x142344,'SmsAccountId':_0x13c411['id'],'SmsInteractionId':_0x49dd95['id'],'UserId':_0x4e2f17[_0x0025('0x62')]['id'],'ContactId':_0x95427['id']}))[_0x0025('0x39')](function(_0x28850e){_0x49dd95['dataValues'][_0x0025('0xc7')]=[];_0x49dd95['dataValues'][_0x0025('0xc7')][_0x0025('0xa4')](_0x28850e[_0x0025('0xc8')]);return _0x49dd95;});})[_0x0025('0x39')](respondWithResult(_0x21ca0e,null))[_0x0025('0x2c')](handleError(_0x21ca0e,null));};exports[_0x0025('0x2e')]=function(_0x35c5dd,_0x3d7969,_0x1e72e0){if(_0x35c5dd[_0x0025('0x69')]['id']){delete _0x35c5dd[_0x0025('0x69')]['id'];}console[_0x0025('0xc9')]('endpoint\x20/status\x20POST\x20/',_0x35c5dd[_0x0025('0x69')]);var _0x54c58a,_0x1dd4d5,_0x3e0cd3;return db[_0x0025('0x57')][_0x0025('0x60')]({'where':{'id':_0x35c5dd[_0x0025('0x5e')]['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x3d7969,null))['then'](function(_0x58156b){if(_0x58156b){_0x3e0cd3=_0x58156b;logger[_0x0025('0x24')](_0x0025('0x25'),'status',_0x0025('0xca'),_0x58156b[_0x0025('0x43')],util[_0x0025('0xcb')](_0x35c5dd[_0x0025('0x69')],{'showHidden':![],'depth':null}));switch(_0x58156b['type']){case _0x0025('0xcc'):if(_0x35c5dd[_0x0025('0x69')][_0x0025('0xcd')]&&_0x35c5dd['body'][_0x0025('0x2e')]){_0x1dd4d5=_0x35c5dd[_0x0025('0x69')][_0x0025('0x2e')];return db['SmsMessage']['find']({'where':{'messageId':_0x35c5dd[_0x0025('0x69')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x35c5dd[_0x0025('0x69')][_0x0025('0xce')]&&_0x35c5dd[_0x0025('0x69')][_0x0025('0xcf')]){_0x1dd4d5=_0x35c5dd[_0x0025('0x69')][_0x0025('0xcf')];return db[_0x0025('0xa9')]['find']({'where':{'messageId':_0x35c5dd[_0x0025('0x69')][_0x0025('0xce')]}});}break;case'clicksend':if(_0x35c5dd['body'][_0x0025('0x8a')]&&_0x35c5dd['body']['status_code']){_0x1dd4d5=_0x35c5dd['body'][_0x0025('0xd0')];return db[_0x0025('0xa9')]['find']({'where':{'messageId':_0x35c5dd[_0x0025('0x69')]['message_id']}});}break;case _0x0025('0x8d'):var _0x54eb6d=_0x35c5dd[_0x0025('0x69')]['results'][0x0];if(_0x54eb6d[_0x0025('0x86')]&&_0x54eb6d[_0x0025('0x2e')][_0x0025('0xd1')]===_0x0025('0xd2')){_0x1dd4d5=_0x54eb6d[_0x0025('0x2e')]['groupName'];return db[_0x0025('0xa9')][_0x0025('0x60')]({'where':{'messageId':_0x54eb6d['messageId']}});}break;case'clickatell':if(_0x35c5dd[_0x0025('0x69')][_0x0025('0x86')]&&_0x35c5dd[_0x0025('0x69')][_0x0025('0x2e')]){_0x1dd4d5=_0x35c5dd[_0x0025('0x69')]['status'];return db['SmsMessage'][_0x0025('0x60')]({'where':{'messageId':_0x35c5dd[_0x0025('0x69')][_0x0025('0x86')]}});}break;case _0x0025('0xd3'):if(_0x35c5dd[_0x0025('0x69')][_0x0025('0xd4')]&&_0x35c5dd['body']['status']){_0x1dd4d5=_0x35c5dd[_0x0025('0x69')][_0x0025('0x2e')];return db['SmsMessage']['find']({'where':{'messageId':_0x35c5dd[_0x0025('0x69')][_0x0025('0xd4')]}});}break;}}})['then'](handleEntityNotFound(_0x3d7969,null))['then'](function(_0x1eae85){if(_0x1eae85){_0x54c58a=_0x1eae85;switch(_0x3e0cd3[_0x0025('0x43')]){case _0x0025('0xcc'):if(_0x1dd4d5===_0x0025('0xd2')){return _0x54c58a['update']({'read':!![]});}else{logger['error'](_0x0025('0x25'),_0x0025('0x2e'),_0x0025('0xcc'),util[_0x0025('0xcb')](_0x35c5dd[_0x0025('0x69')],{'showHidden':![],'depth':null}));}break;case _0x0025('0x89'):if(_0x1dd4d5==='1'){return _0x54c58a[_0x0025('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0025('0xcc'),util['inspect'](_0x35c5dd[_0x0025('0x69')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x35c5dd[_0x0025('0x69')][_0x0025('0xd5')]&&_0x1dd4d5>=0xc8&&_0x1dd4d5<=0xce){return _0x54c58a[_0x0025('0x38')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x0025('0xd6'),util['inspect'](_0x35c5dd['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x2e9f3b=_0x35c5dd[_0x0025('0x69')]['results'][0x0];if(_0x2e9f3b['status'][_0x0025('0xd1')]==='DELIVERED'){return _0x54c58a[_0x0025('0x38')]({'read':!![]});}else{logger[_0x0025('0x27')](_0x0025('0x25'),_0x0025('0x2e'),_0x0025('0x8d'),util[_0x0025('0xcb')](_0x35c5dd['body'],{'showHidden':![],'depth':null}));}break;case _0x0025('0x92'):if(_0x1dd4d5==_0x0025('0xd7')||_0x1dd4d5==_0x0025('0xd8')){return _0x54c58a[_0x0025('0x38')]({'read':!![]});}else{logger['error'](_0x0025('0x25'),_0x0025('0x2e'),_0x0025('0x92'),util[_0x0025('0xcb')](_0x35c5dd[_0x0025('0x69')],{'showHidden':![],'depth':null}));}break;case _0x0025('0xd3'):if(_0x1dd4d5===_0x0025('0xd9')||_0x1dd4d5===_0x0025('0xda')){return _0x54c58a[_0x0025('0x38')]({'read':!![]});}else{logger[_0x0025('0x27')](_0x0025('0x25'),_0x0025('0x2e'),'intelepeer',util['inspect'](_0x35c5dd['body'],{'showHidden':![],'depth':null}));}break;}return _0x54c58a;}})[_0x0025('0x39')](respondWithResult(_0x3d7969,null))['catch'](handleError(_0x3d7969,null));};exports[_0x0025('0xdb')]=function(_0x2c1446,_0x112bc5,_0x4a2711){var _0x1ae8c4,_0x36a613,_0x13d643;return db[_0x0025('0x57')][_0x0025('0x60')]({'where':{'id':_0x2c1446[_0x0025('0x5e')]['id']}})['then'](handleEntityNotFound(_0x112bc5,null))[_0x0025('0x39')](function(_0xca84a){if(_0xca84a){_0x13d643=_0xca84a;logger[_0x0025('0x24')](_0x0025('0x25'),_0x0025('0x2e'),_0x0025('0xca'),_0xca84a['type'],util[_0x0025('0xcb')](_0x2c1446['query'],{'showHidden':![],'depth':null}));switch(_0xca84a[_0x0025('0x43')]){case _0x0025('0x8f'):if(_0x2c1446[_0x0025('0x46')][_0x0025('0xdc')]&&_0x2c1446['query'][_0x0025('0xdd')]){_0x36a613=_0x2c1446[_0x0025('0x46')][_0x0025('0xdd')];return db[_0x0025('0xa9')][_0x0025('0x60')]({'where':{'messageId':_0x2c1446[_0x0025('0x46')][_0x0025('0xdc')]}});}break;}}})[_0x0025('0x39')](handleEntityNotFound(_0x112bc5,null))[_0x0025('0x39')](function(_0x5c1fda){if(_0x5c1fda){_0x1ae8c4=_0x5c1fda;switch(_0x13d643[_0x0025('0x43')]){case'csc':if(_0x36a613==='2'||_0x36a613==='6'){return _0x1ae8c4[_0x0025('0x38')]({'read':!![]});}else{logger[_0x0025('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x0025('0x2e'),_0x0025('0x8f'),util[_0x0025('0xcb')](_0x2c1446[_0x0025('0x46')],{'showHidden':![],'depth':null}));};break;}return _0x1ae8c4;}})[_0x0025('0x39')](respondWithResult(_0x112bc5,null))[_0x0025('0x2c')](handleError(_0x112bc5,null));};exports[_0x0025('0xde')]=function(_0x186b0f,_0x5d148e,_0x43b9d5){return db[_0x0025('0x57')][_0x0025('0x60')]({'where':{'id':_0x186b0f[_0x0025('0x5e')]['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x5d148e,null))[_0x0025('0x39')](function(_0x469ee1){if(_0x469ee1){return _0x469ee1[_0x0025('0xde')](_0x186b0f[_0x0025('0x69')][_0x0025('0x73')],_[_0x0025('0xdf')](_0x186b0f[_0x0025('0x69')],[_0x0025('0x73'),'id'])||{})[_0x0025('0xa1')](function(_0x48b1ce){for(var _0x1597e3=0x0;_0x1597e3<_0x186b0f[_0x0025('0x69')][_0x0025('0x73')][_0x0025('0x4b')];_0x1597e3+=0x1){socket[_0x0025('0xe0')](_0x0025('0xe1'),{'UserId':_0x186b0f['body'][_0x0025('0x73')][_0x1597e3],'SmsAccountId':_0x186b0f['params']['id']});}return _0x48b1ce;});}})[_0x0025('0x39')](respondWithResult(_0x5d148e,null))[_0x0025('0x2c')](handleError(_0x5d148e,null));};exports['removeAgents']=function(_0x28115d,_0x10a8ba,_0x38f640){return db['SmsAccount'][_0x0025('0x60')]({'where':{'id':_0x28115d[_0x0025('0x5e')]['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x10a8ba,null))[_0x0025('0x39')](function(_0x3bdde6){if(_0x3bdde6){return _0x3bdde6[_0x0025('0xe2')](_0x28115d[_0x0025('0x46')][_0x0025('0x73')])[_0x0025('0x39')](function(){if(_[_0x0025('0xe3')](_0x28115d[_0x0025('0x46')][_0x0025('0x73')])){for(var _0x26ba24=0x0;_0x26ba24<_0x28115d[_0x0025('0x46')]['ids'][_0x0025('0x4b')];_0x26ba24+=0x1){socket[_0x0025('0xe0')](_0x0025('0xe4'),{'UserId':Number(_0x28115d[_0x0025('0x46')][_0x0025('0x73')][_0x26ba24]),'SmsAccountId':Number(_0x28115d[_0x0025('0x5e')]['id'])});}}else{socket[_0x0025('0xe0')](_0x0025('0xe4'),{'UserId':Number(_0x28115d[_0x0025('0x46')][_0x0025('0x73')]),'SmsAccountId':Number(_0x28115d[_0x0025('0x5e')]['id'])});}});}})[_0x0025('0x39')](respondWithStatusCode(_0x10a8ba,null))[_0x0025('0x2c')](handleError(_0x10a8ba,null));};exports['getAgents']=function(_0x4173c8,_0x40d068,_0x490d15){var _0x1b4f56={};var _0x91b0b3={};var _0x3f3bd1;var _0x21e195;return db['SmsAccount'][_0x0025('0x6d')]({'where':{'id':_0x4173c8['params']['id']}})[_0x0025('0x39')](handleEntityNotFound(_0x40d068,null))[_0x0025('0x39')](function(_0x2e6700){if(_0x2e6700){_0x3f3bd1=_0x2e6700;_0x91b0b3[_0x0025('0x45')]=_['keys'](db[_0x0025('0xac')][_0x0025('0x42')]);_0x91b0b3['query']=_[_0x0025('0x47')](_0x4173c8[_0x0025('0x46')]);_0x91b0b3[_0x0025('0x51')]=_[_0x0025('0x48')](_0x91b0b3['model'],_0x91b0b3[_0x0025('0x46')]);_0x1b4f56[_0x0025('0x49')]=_[_0x0025('0x48')](_0x91b0b3[_0x0025('0x45')],qs[_0x0025('0x4a')](_0x4173c8['query'][_0x0025('0x4a')]));_0x1b4f56[_0x0025('0x49')]=_0x1b4f56[_0x0025('0x49')][_0x0025('0x4b')]?_0x1b4f56[_0x0025('0x49')]:_0x91b0b3[_0x0025('0x45')];_0x1b4f56[_0x0025('0x4e')]=qs[_0x0025('0x4f')](_0x4173c8[_0x0025('0x46')][_0x0025('0x4f')]);_0x1b4f56['where']=qs[_0x0025('0x51')](_[_0x0025('0x52')](_0x4173c8[_0x0025('0x46')],_0x91b0b3['filters']));if(_0x4173c8[_0x0025('0x46')]['filter']){_0x1b4f56[_0x0025('0x50')]=_[_0x0025('0x54')](_0x1b4f56[_0x0025('0x50')],{'$or':_[_0x0025('0x41')](_0x1b4f56[_0x0025('0x49')],function(_0x55ddb0){var _0x244baf={};_0x244baf[_0x55ddb0]={'$like':'%'+_0x4173c8[_0x0025('0x46')][_0x0025('0x53')]+'%'};return _0x244baf;})});}_0x1b4f56=_['merge']({},_0x1b4f56,_0x4173c8[_0x0025('0x56')]);return _0x3f3bd1['getAgents'](_0x1b4f56);}})[_0x0025('0x39')](function(_0x4c616f){if(_0x4c616f){_0x21e195=_0x4c616f[_0x0025('0x4b')];if(!_0x4173c8[_0x0025('0x46')][_0x0025('0x4c')]('nolimit')){_0x1b4f56[_0x0025('0x32')]=qs[_0x0025('0x32')](_0x4173c8[_0x0025('0x46')][_0x0025('0x32')]);_0x1b4f56[_0x0025('0x31')]=qs['offset'](_0x4173c8[_0x0025('0x46')][_0x0025('0x31')]);}return _0x3f3bd1[_0x0025('0xe5')](_0x1b4f56);}})[_0x0025('0x39')](function(_0x4eb8ef){if(_0x4eb8ef){return _0x4eb8ef?{'count':_0x21e195,'rows':_0x4eb8ef}:null;}})[_0x0025('0x39')](respondWithResult(_0x40d068,null))[_0x0025('0x2c')](handleError(_0x40d068,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index a195e1d..b743bb2 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 _0xaeb9=['hasOwnProperty','exports','events','../../mysqldb','save','emit'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xaeb9,0x1e2));var _0x9aeb=function(_0x10cedb,_0x110891){_0x10cedb=_0x10cedb-0x0;var _0x521e99=_0xaeb9[_0x10cedb];return _0x521e99;};'use strict';var EventEmitter=require(_0x9aeb('0x0'));var SmsAccount=require(_0x9aeb('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9aeb('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x5a166b){return function(_0x4cba3a,_0xa3d3db,_0x173990){SmsAccountEvents[_0x9aeb('0x3')](_0x5a166b+':'+_0x4cba3a['id'],_0x4cba3a);SmsAccountEvents[_0x9aeb('0x3')](_0x5a166b,_0x4cba3a);_0x173990(null);};}for(var e in events){if(events[_0x9aeb('0x4')](e)){var event=events[e];SmsAccount['hook'](e,emitEvent(event));}}module[_0x9aeb('0x5')]=SmsAccountEvents; \ No newline at end of file +var _0xa701=['hook','exports','events','../../mysqldb','setMaxListeners','update','remove','emit','hasOwnProperty'];(function(_0x4c773a,_0x595e84){var _0x15f978=function(_0x52d0c1){while(--_0x52d0c1){_0x4c773a['push'](_0x4c773a['shift']());}};_0x15f978(++_0x595e84);}(_0xa701,0x1cd));var _0x1a70=function(_0x42ac31,_0x3d90e9){_0x42ac31=_0x42ac31-0x0;var _0x3bcf9a=_0xa701[_0x42ac31];return _0x3bcf9a;};'use strict';var EventEmitter=require(_0x1a70('0x0'));var SmsAccount=require(_0x1a70('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1a70('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1a70('0x3'),'afterDestroy':_0x1a70('0x4')};function emitEvent(_0x44136c){return function(_0x51af55,_0x53c290,_0x2d02e0){SmsAccountEvents[_0x1a70('0x5')](_0x44136c+':'+_0x51af55['id'],_0x51af55);SmsAccountEvents[_0x1a70('0x5')](_0x44136c,_0x51af55);_0x2d02e0(null);};}for(var e in events){if(events[_0x1a70('0x6')](e)){var event=events[e];SmsAccount[_0x1a70('0x7')](e,emitEvent(event));}}module[_0x1a70('0x8')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index 52fef10..beb07a7 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 _0x587c=['sms_accounts','lodash','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','SmsAccount'];(function(_0x460fd9,_0x4b4b97){var _0x424e18=function(_0x4a4942){while(--_0x4a4942){_0x460fd9['push'](_0x460fd9['shift']());}};_0x424e18(++_0x4b4b97);}(_0x587c,0x114));var _0xc587=function(_0x249cd1,_0x532eea){_0x249cd1=_0x249cd1-0x0;var _0x26d0fe=_0x587c[_0x249cd1];return _0x26d0fe;};'use strict';var _=require(_0xc587('0x0'));var util=require(_0xc587('0x1'));var logger=require(_0xc587('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xc587('0x3'));var fs=require('fs');var path=require(_0xc587('0x4'));var rimraf=require(_0xc587('0x5'));var config=require(_0xc587('0x6'));var attributes=require(_0xc587('0x7'));module[_0xc587('0x8')]=function(_0x5dd661,_0x1f2fdd){return _0x5dd661['define'](_0xc587('0x9'),attributes,{'tableName':_0xc587('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2623=['bluebird','request-promise','path','rimraf','./smsAccount.attributes','exports','define','SmsAccount','lodash','util','../../config/logger','api','moment'];(function(_0x8d80c0,_0x3c3c59){var _0x44508d=function(_0xfae7a7){while(--_0xfae7a7){_0x8d80c0['push'](_0x8d80c0['shift']());}};_0x44508d(++_0x3c3c59);}(_0x2623,0x119));var _0x3262=function(_0x425716,_0x3e9d1c){_0x425716=_0x425716-0x0;var _0x2d39af=_0x2623[_0x425716];return _0x2d39af;};'use strict';var _=require(_0x3262('0x0'));var util=require(_0x3262('0x1'));var logger=require(_0x3262('0x2'))(_0x3262('0x3'));var moment=require(_0x3262('0x4'));var BPromise=require(_0x3262('0x5'));var rp=require(_0x3262('0x6'));var fs=require('fs');var path=require(_0x3262('0x7'));var rimraf=require(_0x3262('0x8'));var config=require('../../config/environment');var attributes=require(_0x3262('0x9'));module[_0x3262('0xa')]=function(_0x1b3ea6,_0x4e731f){return _0x1b3ea6[_0x3262('0xb')](_0x3262('0xc'),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 7a7bf4a..96f367f 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 _0xf257=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','localhost','./smsAccount.socket','register','then','info','SmsAccount,\x20%s,\x20%s','SmsAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','ShowSmsAccount','find','options','where','include','map','model','attributes','debug','lodash','util','bluebird','ioredis','../../mysqldb'];(function(_0x8cb2f9,_0x2b8706){var _0x164887=function(_0x1812cc){while(--_0x1812cc){_0x8cb2f9['push'](_0x8cb2f9['shift']());}};_0x164887(++_0x2b8706);}(_0xf257,0x14f));var _0x7f25=function(_0x40e906,_0x31cddc){_0x40e906=_0x40e906-0x0;var _0x5776d2=_0xf257[_0x40e906];return _0x5776d2;};'use strict';var _=require(_0x7f25('0x0'));var util=require(_0x7f25('0x1'));var moment=require('moment');var BPromise=require(_0x7f25('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7f25('0x3'));var db=require(_0x7f25('0x4'))['db'];var utils=require(_0x7f25('0x5'));var logger=require(_0x7f25('0x6'))('rpc');var config=require(_0x7f25('0x7'));var jayson=require(_0x7f25('0x8'));var client=jayson['client'][_0x7f25('0x9')]({'port':0x232a});config[_0x7f25('0xa')]=_['defaults'](config[_0x7f25('0xa')],{'host':_0x7f25('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7f25('0xa')]));require(_0x7f25('0xc'))[_0x7f25('0xd')](socket);function respondWithRpcPromise(_0x4a7fc5,_0x12bd82,_0x2a938e){return new BPromise(function(_0x5dafd6,_0xf3ebcc){return client['request'](_0x4a7fc5,_0x2a938e)[_0x7f25('0xe')](function(_0x34b782){logger[_0x7f25('0xf')](_0x7f25('0x10'),_0x12bd82,'request\x20sent');logger['debug'](_0x7f25('0x11'),_0x12bd82,_0x7f25('0x12'),JSON[_0x7f25('0x13')](_0x34b782));if(_0x34b782[_0x7f25('0x14')]){if(_0x34b782['error'][_0x7f25('0x15')]===0x1f4){logger[_0x7f25('0x14')](_0x7f25('0x10'),_0x12bd82,_0x34b782[_0x7f25('0x14')][_0x7f25('0x16')]);return _0xf3ebcc(_0x34b782[_0x7f25('0x14')]['message']);}logger[_0x7f25('0x14')](_0x7f25('0x10'),_0x12bd82,_0x34b782[_0x7f25('0x14')][_0x7f25('0x16')]);return _0x5dafd6(_0x34b782['error'][_0x7f25('0x16')]);}else{logger[_0x7f25('0xf')](_0x7f25('0x10'),_0x12bd82,'request\x20sent');_0x5dafd6(_0x34b782[_0x7f25('0x17')][_0x7f25('0x16')]);}})[_0x7f25('0x18')](function(_0x8c1520){logger[_0x7f25('0x14')](_0x7f25('0x10'),_0x12bd82,_0x8c1520);_0xf3ebcc(_0x8c1520);});});}exports[_0x7f25('0x19')]=function(_0x33a96b){var _0x1e3344=this;return new Promise(function(_0x2dcfc4,_0x53809c){return db['SmsAccount'][_0x7f25('0x1a')]({'raw':_0x33a96b['options']?_0x33a96b[_0x7f25('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x33a96b[_0x7f25('0x1b')]?_0x33a96b[_0x7f25('0x1b')][_0x7f25('0x1c')]||null:null,'attributes':_0x33a96b['options']?_0x33a96b[_0x7f25('0x1b')]['attributes']||null:null,'include':_0x33a96b[_0x7f25('0x1b')]?_0x33a96b[_0x7f25('0x1b')][_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x33a96b[_0x7f25('0x1b')]['include'],function(_0x8f0da8){return{'model':db[_0x8f0da8[_0x7f25('0x1f')]],'as':_0x8f0da8['as'],'attributes':_0x8f0da8[_0x7f25('0x20')],'include':_0x8f0da8[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x8f0da8[_0x7f25('0x1d')],function(_0x539481){return{'model':db[_0x539481[_0x7f25('0x1f')]],'as':_0x539481['as'],'attributes':_0x539481[_0x7f25('0x20')],'include':_0x539481[_0x7f25('0x1d')]?_[_0x7f25('0x1e')](_0x539481[_0x7f25('0x1d')],function(_0x59d1c6){return{'model':db[_0x59d1c6['model']],'as':_0x59d1c6['as'],'attributes':_0x59d1c6[_0x7f25('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7f25('0xe')](function(_0x354fc5){logger[_0x7f25('0xf')](_0x7f25('0x19'),_0x33a96b);logger[_0x7f25('0x21')](_0x7f25('0x19'),_0x33a96b,JSON[_0x7f25('0x13')](_0x354fc5));_0x2dcfc4(_0x354fc5);})['catch'](function(_0x379810){logger['error']('ShowSmsAccount',_0x379810['message'],_0x33a96b);_0x53809c(_0x1e3344[_0x7f25('0x14')](0x1f4,_0x379810[_0x7f25('0x16')]));});});}; \ No newline at end of file +var _0xe0d7=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','localhost','./smsAccount.socket','register','request','then','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsAccount,\x20%s,\x20%s','message','info','result','catch','SmsAccount','find','options','raw','where','attributes','include','map','model','ShowSmsAccount'];(function(_0x53d051,_0x10b1c9){var _0xafec65=function(_0x2a8d87){while(--_0x2a8d87){_0x53d051['push'](_0x53d051['shift']());}};_0xafec65(++_0x10b1c9);}(_0xe0d7,0x186));var _0x7e0d=function(_0x1c4420,_0x49e6fd){_0x1c4420=_0x1c4420-0x0;var _0x46e892=_0xe0d7[_0x1c4420];return _0x46e892;};'use strict';var _=require(_0x7e0d('0x0'));var util=require('util');var moment=require(_0x7e0d('0x1'));var BPromise=require(_0x7e0d('0x2'));var rs=require(_0x7e0d('0x3'));var fs=require('fs');var Redis=require(_0x7e0d('0x4'));var db=require(_0x7e0d('0x5'))['db'];var utils=require(_0x7e0d('0x6'));var logger=require(_0x7e0d('0x7'))(_0x7e0d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x7e0d('0x9')][_0x7e0d('0xa')]({'port':0x232a});config['redis']=_[_0x7e0d('0xb')](config[_0x7e0d('0xc')],{'host':_0x7e0d('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7e0d('0xc')]));require(_0x7e0d('0xe'))[_0x7e0d('0xf')](socket);function respondWithRpcPromise(_0x25cc5d,_0x4b5153,_0x51e000){return new BPromise(function(_0x49fb9b,_0x44571c){return client[_0x7e0d('0x10')](_0x25cc5d,_0x51e000)[_0x7e0d('0x11')](function(_0x5ca6f1){logger['info']('SmsAccount,\x20%s,\x20%s',_0x4b5153,_0x7e0d('0x12'));logger[_0x7e0d('0x13')](_0x7e0d('0x14'),_0x4b5153,_0x7e0d('0x12'),JSON[_0x7e0d('0x15')](_0x5ca6f1));if(_0x5ca6f1[_0x7e0d('0x16')]){if(_0x5ca6f1[_0x7e0d('0x16')][_0x7e0d('0x17')]===0x1f4){logger[_0x7e0d('0x16')](_0x7e0d('0x18'),_0x4b5153,_0x5ca6f1[_0x7e0d('0x16')][_0x7e0d('0x19')]);return _0x44571c(_0x5ca6f1[_0x7e0d('0x16')]['message']);}logger[_0x7e0d('0x16')](_0x7e0d('0x18'),_0x4b5153,_0x5ca6f1[_0x7e0d('0x16')]['message']);return _0x49fb9b(_0x5ca6f1['error'][_0x7e0d('0x19')]);}else{logger[_0x7e0d('0x1a')](_0x7e0d('0x18'),_0x4b5153,_0x7e0d('0x12'));_0x49fb9b(_0x5ca6f1[_0x7e0d('0x1b')][_0x7e0d('0x19')]);}})[_0x7e0d('0x1c')](function(_0x590141){logger['error'](_0x7e0d('0x18'),_0x4b5153,_0x590141);_0x44571c(_0x590141);});});}exports['ShowSmsAccount']=function(_0x33d360){var _0x15dc49=this;return new Promise(function(_0x542dfe,_0x5cf112){return db[_0x7e0d('0x1d')][_0x7e0d('0x1e')]({'raw':_0x33d360[_0x7e0d('0x1f')]?_0x33d360['options'][_0x7e0d('0x20')]===undefined?!![]:![]:!![],'where':_0x33d360[_0x7e0d('0x1f')]?_0x33d360[_0x7e0d('0x1f')][_0x7e0d('0x21')]||null:null,'attributes':_0x33d360[_0x7e0d('0x1f')]?_0x33d360[_0x7e0d('0x1f')][_0x7e0d('0x22')]||null:null,'include':_0x33d360[_0x7e0d('0x1f')]?_0x33d360['options'][_0x7e0d('0x23')]?_[_0x7e0d('0x24')](_0x33d360[_0x7e0d('0x1f')][_0x7e0d('0x23')],function(_0x1dfc9c){return{'model':db[_0x1dfc9c['model']],'as':_0x1dfc9c['as'],'attributes':_0x1dfc9c[_0x7e0d('0x22')],'include':_0x1dfc9c[_0x7e0d('0x23')]?_[_0x7e0d('0x24')](_0x1dfc9c[_0x7e0d('0x23')],function(_0x8cd41c){return{'model':db[_0x8cd41c[_0x7e0d('0x25')]],'as':_0x8cd41c['as'],'attributes':_0x8cd41c[_0x7e0d('0x22')],'include':_0x8cd41c[_0x7e0d('0x23')]?_[_0x7e0d('0x24')](_0x8cd41c[_0x7e0d('0x23')],function(_0x14135e){return{'model':db[_0x14135e[_0x7e0d('0x25')]],'as':_0x14135e['as'],'attributes':_0x14135e[_0x7e0d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7e0d('0x11')](function(_0x55f24c){logger[_0x7e0d('0x1a')](_0x7e0d('0x26'),_0x33d360);logger[_0x7e0d('0x13')](_0x7e0d('0x26'),_0x33d360,JSON[_0x7e0d('0x15')](_0x55f24c));_0x542dfe(_0x55f24c);})[_0x7e0d('0x1c')](function(_0x3f77f3){logger[_0x7e0d('0x16')](_0x7e0d('0x26'),_0x3f77f3['message'],_0x33d360);_0x5cf112(_0x15dc49[_0x7e0d('0x16')](0x1f4,_0x3f77f3[_0x7e0d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 8334678..804808c 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 _0x9037=['length','smsAccount:','./smsAccount.events','save','remove','update','emit','removeListener','register'];(function(_0x55f8b4,_0x43f30d){var _0x2475f9=function(_0xdd6f4a){while(--_0xdd6f4a){_0x55f8b4['push'](_0x55f8b4['shift']());}};_0x2475f9(++_0x43f30d);}(_0x9037,0x185));var _0x7903=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9037[_0x14add3];return _0x4a174f;};'use strict';var SmsAccountEvents=require(_0x7903('0x0'));var events=[_0x7903('0x1'),_0x7903('0x2'),_0x7903('0x3')];function createListener(_0x2d78c1,_0x7f631e){return function(_0x306f65){_0x7f631e[_0x7903('0x4')](_0x2d78c1,_0x306f65);};}function removeListener(_0x159c45,_0x56e9cc){return function(){SmsAccountEvents[_0x7903('0x5')](_0x159c45,_0x56e9cc);};}exports[_0x7903('0x6')]=function(_0x1ad8d6){for(var _0x15a069=0x0,_0x1c701c=events[_0x7903('0x7')];_0x15a069<_0x1c701c;_0x15a069++){var _0x21cc85=events[_0x15a069];var _0x375045=createListener(_0x7903('0x8')+_0x21cc85,_0x1ad8d6);SmsAccountEvents['on'](_0x21cc85,_0x375045);}}; \ No newline at end of file +var _0xa20a=['update','emit','removeListener','register','smsAccount:','./smsAccount.events','save','remove'];(function(_0x3dff0d,_0x4d59ff){var _0x352383=function(_0x46e5ef){while(--_0x46e5ef){_0x3dff0d['push'](_0x3dff0d['shift']());}};_0x352383(++_0x4d59ff);}(_0xa20a,0x14d));var _0xaa20=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0xa20a[_0x19950b];return _0x3c6b41;};'use strict';var SmsAccountEvents=require(_0xaa20('0x0'));var events=[_0xaa20('0x1'),_0xaa20('0x2'),_0xaa20('0x3')];function createListener(_0x5acdb5,_0xb8aaa8){return function(_0x54e898){_0xb8aaa8[_0xaa20('0x4')](_0x5acdb5,_0x54e898);};}function removeListener(_0x4590c5,_0x3333c9){return function(){SmsAccountEvents[_0xaa20('0x5')](_0x4590c5,_0x3333c9);};}exports[_0xaa20('0x6')]=function(_0x394afb){for(var _0xc4e3fa=0x0,_0x3b7fe4=events['length'];_0xc4e3fa<_0x3b7fe4;_0xc4e3fa++){var _0x201081=events[_0xc4e3fa];var _0x509ca7=createListener(_0xaa20('0x7')+_0x201081,_0x394afb);SmsAccountEvents['on'](_0x201081,_0x509ca7);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index e2769d0..4a8824a 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 _0x37ff=['destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','get','/:id','isAuthenticated','show','post','put','update'];(function(_0x525c98,_0x4aca73){var _0x2337b6=function(_0x2be7b2){while(--_0x2be7b2){_0x525c98['push'](_0x525c98['shift']());}};_0x2337b6(++_0x4aca73);}(_0x37ff,0x134));var _0xf37f=function(_0x5023cb,_0x5ae9a6){_0x5023cb=_0x5023cb-0x0;var _0x52c5d6=_0x37ff[_0x5023cb];return _0x52c5d6;};'use strict';var multer=require('multer');var util=require(_0xf37f('0x0'));var path=require(_0xf37f('0x1'));var timeout=require(_0xf37f('0x2'));var express=require(_0xf37f('0x3'));var router=express[_0xf37f('0x4')]();var auth=require(_0xf37f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xf37f('0x6'));var controller=require(_0xf37f('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xf37f('0x8')](_0xf37f('0x9'),auth[_0xf37f('0xa')](),controller[_0xf37f('0xb')]);router[_0xf37f('0xc')]('/',auth[_0xf37f('0xa')](),controller['create']);router[_0xf37f('0xd')]('/:id',auth[_0xf37f('0xa')](),controller[_0xf37f('0xe')]);router['delete'](_0xf37f('0x9'),auth[_0xf37f('0xa')](),controller[_0xf37f('0xf')]);module[_0xf37f('0x10')]=router; \ No newline at end of file +var _0xa392=['./smsApplication.controller','get','isAuthenticated','index','/:id','show','update','delete','destroy','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x5bfa44,_0x76dacc){var _0x43815f=function(_0x307fca){while(--_0x307fca){_0x5bfa44['push'](_0x5bfa44['shift']());}};_0x43815f(++_0x76dacc);}(_0xa392,0x90));var _0x2a39=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xa392[_0x4d613c];return _0x301fe3;};'use strict';var multer=require('multer');var util=require(_0x2a39('0x0'));var path=require(_0x2a39('0x1'));var timeout=require(_0x2a39('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2a39('0x3'));var interaction=require(_0x2a39('0x4'));var config=require(_0x2a39('0x5'));var controller=require(_0x2a39('0x6'));router[_0x2a39('0x7')]('/',auth[_0x2a39('0x8')](),controller[_0x2a39('0x9')]);router[_0x2a39('0x7')](_0x2a39('0xa'),auth[_0x2a39('0x8')](),controller[_0x2a39('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x2a39('0xa'),auth[_0x2a39('0x8')](),controller[_0x2a39('0xc')]);router[_0x2a39('0xd')]('/:id',auth[_0x2a39('0x8')](),controller[_0x2a39('0xe')]);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 94f8dc7..710cded 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 _0x8c09=['noop','sequelize','exports','STRING'];(function(_0x4a976a,_0x473fa7){var _0x1b97ab=function(_0x5cf823){while(--_0x5cf823){_0x4a976a['push'](_0x4a976a['shift']());}};_0x1b97ab(++_0x473fa7);}(_0x8c09,0x131));var _0x98c0=function(_0x5aea18,_0x47be1e){_0x5aea18=_0x5aea18-0x0;var _0x2d0e8e=_0x8c09[_0x5aea18];return _0x2d0e8e;};'use strict';var Sequelize=require(_0x98c0('0x0'));module[_0x98c0('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x98c0('0x2')],'allowNull':![],'defaultValue':_0x98c0('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x98c0('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x2bda=['*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x485ee5,_0x1c562f){var _0x12de85=function(_0x804741){while(--_0x804741){_0x485ee5['push'](_0x485ee5['shift']());}};_0x12de85(++_0x1c562f);}(_0x2bda,0x115));var _0xa2bd=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0x2bda[_0x4fbb15];return _0x436338;};'use strict';var Sequelize=require(_0xa2bd('0x0'));module[_0xa2bd('0x1')]={'priority':{'type':Sequelize[_0xa2bd('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xa2bd('0x3')],'allowNull':![],'defaultValue':_0xa2bd('0x4')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xa2bd('0x3')]},'interval':{'type':Sequelize[_0xa2bd('0x3')],'defaultValue':_0xa2bd('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index ce954af..7044de8 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 _0x2b7f=['attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','find','create','body','destroy','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','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','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','end','error','stack','name','send','index','map','SmsApplication','rawAttributes','fieldName','type','key','model','query','keys','intersection'];(function(_0x8ac902,_0x236cbd){var _0x1b3120=function(_0x4d7c60){while(--_0x4d7c60){_0x8ac902['push'](_0x8ac902['shift']());}};_0x1b3120(++_0x236cbd);}(_0x2b7f,0xad));var _0xf2b7=function(_0x1da895,_0x223ae8){_0x1da895=_0x1da895-0x0;var _0x4cfec3=_0x2b7f[_0x1da895];return _0x4cfec3;};'use strict';var pdf=require(_0xf2b7('0x0'));var emlformat=require(_0xf2b7('0x1'));var rimraf=require(_0xf2b7('0x2'));var zipdir=require(_0xf2b7('0x3'));var jsonpatch=require(_0xf2b7('0x4'));var rp=require(_0xf2b7('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf2b7('0x6'));var util=require('util');var path=require(_0xf2b7('0x7'));var sox=require(_0xf2b7('0x8'));var csv=require('to-csv');var ejs=require(_0xf2b7('0x9'));var fs=require('fs');var _=require(_0xf2b7('0xa'));var squel=require(_0xf2b7('0xb'));var crypto=require('crypto');var jsforce=require(_0xf2b7('0xc'));var deskjs=require(_0xf2b7('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf2b7('0xe'));var Papa=require(_0xf2b7('0xf'));var Redis=require(_0xf2b7('0x10'));var authService=require(_0xf2b7('0x11'));var qs=require(_0xf2b7('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf2b7('0x13'));var logger=require(_0xf2b7('0x14'))('api');var utils=require(_0xf2b7('0x15'));var config=require(_0xf2b7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x154af4,_0x1d4123){_0x1d4123=_0x1d4123||0xcc;return function(_0x2f1faf){if(_0x2f1faf){return _0x154af4[_0xf2b7('0x17')](_0x1d4123);}return _0x154af4['status'](_0x1d4123)['end']();};}function respondWithResult(_0x5871b8,_0x4a51cf){_0x4a51cf=_0x4a51cf||0xc8;return function(_0xb00930){if(_0xb00930){return _0x5871b8[_0xf2b7('0x18')](_0x4a51cf)['json'](_0xb00930);}};}function respondWithFilteredResult(_0x393a15,_0x222698){return function(_0x4694c5){if(_0x4694c5){var _0x481bd7=_0x4694c5[_0xf2b7('0x19')],_0x301593=_0x222698[_0xf2b7('0x1a')],_0x3ef1c2=_0x222698['offset']+_0x222698[_0xf2b7('0x1b')],_0x276dfb;if(_0x3ef1c2>=_0x481bd7){_0x3ef1c2=_0x481bd7;_0x276dfb=0xc8;}else{_0x276dfb=0xce;}_0x393a15[_0xf2b7('0x18')](_0x276dfb);return _0x393a15[_0xf2b7('0x1c')](_0xf2b7('0x1d'),_0x301593+'-'+_0x3ef1c2+'/'+_0x481bd7)[_0xf2b7('0x1e')](_0x4694c5);}return null;};}function patchUpdates(_0x2c39b0){return function(_0x47a22a){try{jsonpatch[_0xf2b7('0x1f')](_0x47a22a,_0x2c39b0,!![]);}catch(_0x2ee932){return BPromise[_0xf2b7('0x20')](_0x2ee932);}return _0x47a22a[_0xf2b7('0x21')]();};}function saveUpdates(_0x36c029,_0x183e69){return function(_0x47f97f){if(_0x47f97f){return _0x47f97f[_0xf2b7('0x22')](_0x36c029)[_0xf2b7('0x23')](function(_0x10f632){return _0x10f632;});}return null;};}function removeEntity(_0x1aa9fb,_0x4003f4){return function(_0x20ef34){if(_0x20ef34){return _0x20ef34['destroy']()['then'](function(){_0x1aa9fb[_0xf2b7('0x18')](0xcc)[_0xf2b7('0x24')]();});}};}function handleEntityNotFound(_0x5d6654,_0x3ad7da){return function(_0x38f78e){if(!_0x38f78e){_0x5d6654[_0xf2b7('0x17')](0x194);}return _0x38f78e;};}function handleError(_0x161d15,_0xb2a0bf){_0xb2a0bf=_0xb2a0bf||0x1f4;return function(_0x3955bd){logger[_0xf2b7('0x25')](_0x3955bd[_0xf2b7('0x26')]);if(_0x3955bd[_0xf2b7('0x27')]){delete _0x3955bd[_0xf2b7('0x27')];}_0x161d15[_0xf2b7('0x18')](_0xb2a0bf)[_0xf2b7('0x28')](_0x3955bd);};}exports[_0xf2b7('0x29')]=function(_0x46fa03,_0x837071){var _0x49d1f1={},_0x49bd88={},_0xdd7fc3={'count':0x0,'rows':[]};var _0x10ba83=_[_0xf2b7('0x2a')](db[_0xf2b7('0x2b')][_0xf2b7('0x2c')],function(_0x412c49){return{'name':_0x412c49[_0xf2b7('0x2d')],'type':_0x412c49[_0xf2b7('0x2e')][_0xf2b7('0x2f')]};});_0x49bd88[_0xf2b7('0x30')]=_['map'](_0x10ba83,'name');_0x49bd88[_0xf2b7('0x31')]=_[_0xf2b7('0x32')](_0x46fa03[_0xf2b7('0x31')]);_0x49bd88['filters']=_[_0xf2b7('0x33')](_0x49bd88[_0xf2b7('0x30')],_0x49bd88[_0xf2b7('0x31')]);_0x49d1f1[_0xf2b7('0x34')]=_[_0xf2b7('0x33')](_0x49bd88[_0xf2b7('0x30')],qs[_0xf2b7('0x35')](_0x46fa03[_0xf2b7('0x31')][_0xf2b7('0x35')]));_0x49d1f1[_0xf2b7('0x34')]=_0x49d1f1['attributes'][_0xf2b7('0x36')]?_0x49d1f1[_0xf2b7('0x34')]:_0x49bd88['model'];if(!_0x46fa03[_0xf2b7('0x31')][_0xf2b7('0x37')](_0xf2b7('0x38'))){_0x49d1f1[_0xf2b7('0x1b')]=qs[_0xf2b7('0x1b')](_0x46fa03[_0xf2b7('0x31')][_0xf2b7('0x1b')]);_0x49d1f1[_0xf2b7('0x1a')]=qs[_0xf2b7('0x1a')](_0x46fa03[_0xf2b7('0x31')][_0xf2b7('0x1a')]);}_0x49d1f1[_0xf2b7('0x39')]=qs['sort'](_0x46fa03[_0xf2b7('0x31')][_0xf2b7('0x3a')]);_0x49d1f1[_0xf2b7('0x3b')]=qs[_0xf2b7('0x3c')](_[_0xf2b7('0x3d')](_0x46fa03[_0xf2b7('0x31')],_0x49bd88['filters']));if(_0x46fa03[_0xf2b7('0x31')][_0xf2b7('0x3e')]){_0x49d1f1[_0xf2b7('0x3b')]=_[_0xf2b7('0x3f')](_0x49d1f1[_0xf2b7('0x3b')],{'$or':_[_0xf2b7('0x2a')](_0x10ba83,function(_0x448577){if(_0x448577[_0xf2b7('0x2e')]!==_0xf2b7('0x40')){var _0x397af5={};_0x397af5[_0x448577[_0xf2b7('0x27')]]={'$like':'%'+_0x46fa03[_0xf2b7('0x31')][_0xf2b7('0x3e')]+'%'};return _0x397af5;}})});}_0x49d1f1=_['merge']({},_0x49d1f1,_0x46fa03[_0xf2b7('0x41')]);var _0x2bd1dd={'where':_0x49d1f1[_0xf2b7('0x3b')]};return db[_0xf2b7('0x2b')][_0xf2b7('0x19')](_0x2bd1dd)[_0xf2b7('0x23')](function(_0x5c96ea){_0xdd7fc3[_0xf2b7('0x19')]=_0x5c96ea;if(_0x46fa03[_0xf2b7('0x31')][_0xf2b7('0x42')]){_0x49d1f1[_0xf2b7('0x43')]=[{'all':!![]}];}return db[_0xf2b7('0x2b')]['findAll'](_0x49d1f1);})['then'](function(_0x4452f4){_0xdd7fc3['rows']=_0x4452f4;return _0xdd7fc3;})['then'](respondWithFilteredResult(_0x837071,_0x49d1f1))[_0xf2b7('0x44')](handleError(_0x837071,null));};exports[_0xf2b7('0x45')]=function(_0x225f4f,_0x43c755){var _0x481d91={'raw':!![],'where':{'id':_0x225f4f['params']['id']}},_0x316d2d={};_0x316d2d[_0xf2b7('0x30')]=_[_0xf2b7('0x32')](db['SmsApplication'][_0xf2b7('0x2c')]);_0x316d2d[_0xf2b7('0x31')]=_[_0xf2b7('0x32')](_0x225f4f[_0xf2b7('0x31')]);_0x316d2d[_0xf2b7('0x3c')]=_[_0xf2b7('0x33')](_0x316d2d[_0xf2b7('0x30')],_0x316d2d['query']);_0x481d91[_0xf2b7('0x34')]=_[_0xf2b7('0x33')](_0x316d2d[_0xf2b7('0x30')],qs['fields'](_0x225f4f[_0xf2b7('0x31')]['fields']));_0x481d91[_0xf2b7('0x34')]=_0x481d91[_0xf2b7('0x34')][_0xf2b7('0x36')]?_0x481d91[_0xf2b7('0x34')]:_0x316d2d[_0xf2b7('0x30')];if(_0x225f4f[_0xf2b7('0x31')][_0xf2b7('0x42')]){_0x481d91[_0xf2b7('0x43')]=[{'all':!![]}];}_0x481d91=_[_0xf2b7('0x3f')]({},_0x481d91,_0x225f4f['options']);return db[_0xf2b7('0x2b')][_0xf2b7('0x46')](_0x481d91)['then'](handleEntityNotFound(_0x43c755,null))[_0xf2b7('0x23')](respondWithResult(_0x43c755,null))['catch'](handleError(_0x43c755,null));};exports[_0xf2b7('0x47')]=function(_0x229e17,_0x55ebe0){return db[_0xf2b7('0x2b')]['create'](_0x229e17['body'],{})[_0xf2b7('0x23')](respondWithResult(_0x55ebe0,0xc9))[_0xf2b7('0x44')](handleError(_0x55ebe0,null));};exports['update']=function(_0x4d1ae4,_0x513ff4){if(_0x4d1ae4[_0xf2b7('0x48')]['id']){delete _0x4d1ae4['body']['id'];}return db[_0xf2b7('0x2b')]['find']({'where':{'id':_0x4d1ae4['params']['id']}})[_0xf2b7('0x23')](handleEntityNotFound(_0x513ff4,null))[_0xf2b7('0x23')](saveUpdates(_0x4d1ae4[_0xf2b7('0x48')],null))[_0xf2b7('0x23')](respondWithResult(_0x513ff4,null))[_0xf2b7('0x44')](handleError(_0x513ff4,null));};exports[_0xf2b7('0x49')]=function(_0x148659,_0x477d71){return db['SmsApplication']['find']({'where':{'id':_0x148659[_0xf2b7('0x4a')]['id']}})[_0xf2b7('0x23')](handleEntityNotFound(_0x477d71,null))[_0xf2b7('0x23')](removeEntity(_0x477d71,null))[_0xf2b7('0x44')](handleError(_0x477d71,null));}; \ No newline at end of file +var _0x4887=['rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','rows','params','keys','catch','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','jsforce','desk.js','to-csv','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','update','then','destroy','error','stack','name','index','map','SmsApplication'];(function(_0x172d92,_0xf62170){var _0x42aca3=function(_0x3e2a3f){while(--_0x3e2a3f){_0x172d92['push'](_0x172d92['shift']());}};_0x42aca3(++_0xf62170);}(_0x4887,0x181));var _0x7488=function(_0x480096,_0x1f4a17){_0x480096=_0x480096-0x0;var _0x18d2e7=_0x4887[_0x480096];return _0x18d2e7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7488('0x0'));var rimraf=require(_0x7488('0x1'));var zipdir=require(_0x7488('0x2'));var jsonpatch=require(_0x7488('0x3'));var rp=require(_0x7488('0x4'));var moment=require(_0x7488('0x5'));var BPromise=require(_0x7488('0x6'));var Mustache=require(_0x7488('0x7'));var util=require(_0x7488('0x8'));var path=require(_0x7488('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7488('0xa'));var squel=require(_0x7488('0xb'));var crypto=require(_0x7488('0xc'));var jsforce=require(_0x7488('0xd'));var deskjs=require(_0x7488('0xe'));var toCsv=require(_0x7488('0xf'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x7488('0x10'));var qs=require(_0x7488('0x11'));var as=require(_0x7488('0x12'));var hardwareService=require(_0x7488('0x13'));var logger=require(_0x7488('0x14'))(_0x7488('0x15'));var utils=require(_0x7488('0x16'));var config=require(_0x7488('0x17'));var db=require(_0x7488('0x18'))['db'];function respondWithStatusCode(_0x2d0494,_0x6540b3){_0x6540b3=_0x6540b3||0xcc;return function(_0x4152ff){if(_0x4152ff){return _0x2d0494[_0x7488('0x19')](_0x6540b3);}return _0x2d0494[_0x7488('0x1a')](_0x6540b3)[_0x7488('0x1b')]();};}function respondWithResult(_0x29f7d4,_0xdcd1d8){_0xdcd1d8=_0xdcd1d8||0xc8;return function(_0x54e5ce){if(_0x54e5ce){return _0x29f7d4['status'](_0xdcd1d8)[_0x7488('0x1c')](_0x54e5ce);}};}function respondWithFilteredResult(_0x3b431f,_0x1d1d01){return function(_0x2c5aa9){if(_0x2c5aa9){var _0xb85fea=_0x2c5aa9[_0x7488('0x1d')],_0x13c427=_0x1d1d01[_0x7488('0x1e')],_0xb40fd4=_0x1d1d01[_0x7488('0x1e')]+_0x1d1d01['limit'],_0x3fb2dd;if(_0xb40fd4>=_0xb85fea){_0xb40fd4=_0xb85fea;_0x3fb2dd=0xc8;}else{_0x3fb2dd=0xce;}_0x3b431f[_0x7488('0x1a')](_0x3fb2dd);return _0x3b431f[_0x7488('0x1f')]('Content-Range',_0x13c427+'-'+_0xb40fd4+'/'+_0xb85fea)[_0x7488('0x1c')](_0x2c5aa9);}return null;};}function patchUpdates(_0x2445f3){return function(_0x4effd9){try{jsonpatch['apply'](_0x4effd9,_0x2445f3,!![]);}catch(_0x1f6c8a){return BPromise['reject'](_0x1f6c8a);}return _0x4effd9['save']();};}function saveUpdates(_0x4681bc,_0x35ccf7){return function(_0x255c08){if(_0x255c08){return _0x255c08[_0x7488('0x20')](_0x4681bc)[_0x7488('0x21')](function(_0x4b39e3){return _0x4b39e3;});}return null;};}function removeEntity(_0x57736e,_0x1bfcf6){return function(_0x423a08){if(_0x423a08){return _0x423a08[_0x7488('0x22')]()[_0x7488('0x21')](function(){_0x57736e[_0x7488('0x1a')](0xcc)[_0x7488('0x1b')]();});}};}function handleEntityNotFound(_0x2c9da5,_0x399179){return function(_0x30b9cf){if(!_0x30b9cf){_0x2c9da5[_0x7488('0x19')](0x194);}return _0x30b9cf;};}function handleError(_0x1b3092,_0x344e33){_0x344e33=_0x344e33||0x1f4;return function(_0x430c8a){logger[_0x7488('0x23')](_0x430c8a[_0x7488('0x24')]);if(_0x430c8a['name']){delete _0x430c8a[_0x7488('0x25')];}_0x1b3092[_0x7488('0x1a')](_0x344e33)['send'](_0x430c8a);};}exports[_0x7488('0x26')]=function(_0x314a6f,_0x267a4d){var _0x130213={},_0x10fe32={},_0x1877ae={'count':0x0,'rows':[]};var _0x352178=_[_0x7488('0x27')](db[_0x7488('0x28')][_0x7488('0x29')],function(_0x3e28ed){return{'name':_0x3e28ed['fieldName'],'type':_0x3e28ed[_0x7488('0x2a')][_0x7488('0x2b')]};});_0x10fe32['model']=_[_0x7488('0x27')](_0x352178,_0x7488('0x25'));_0x10fe32[_0x7488('0x2c')]=_['keys'](_0x314a6f[_0x7488('0x2c')]);_0x10fe32[_0x7488('0x2d')]=_[_0x7488('0x2e')](_0x10fe32[_0x7488('0x2f')],_0x10fe32[_0x7488('0x2c')]);_0x130213[_0x7488('0x30')]=_[_0x7488('0x2e')](_0x10fe32[_0x7488('0x2f')],qs[_0x7488('0x31')](_0x314a6f['query'][_0x7488('0x31')]));_0x130213['attributes']=_0x130213[_0x7488('0x30')][_0x7488('0x32')]?_0x130213[_0x7488('0x30')]:_0x10fe32[_0x7488('0x2f')];if(!_0x314a6f[_0x7488('0x2c')][_0x7488('0x33')](_0x7488('0x34'))){_0x130213[_0x7488('0x35')]=qs[_0x7488('0x35')](_0x314a6f[_0x7488('0x2c')]['limit']);_0x130213[_0x7488('0x1e')]=qs[_0x7488('0x1e')](_0x314a6f[_0x7488('0x2c')][_0x7488('0x1e')]);}_0x130213[_0x7488('0x36')]=qs[_0x7488('0x37')](_0x314a6f[_0x7488('0x2c')]['sort']);_0x130213['where']=qs['filters'](_[_0x7488('0x38')](_0x314a6f[_0x7488('0x2c')],_0x10fe32['filters']));if(_0x314a6f[_0x7488('0x2c')][_0x7488('0x39')]){_0x130213[_0x7488('0x3a')]=_[_0x7488('0x3b')](_0x130213[_0x7488('0x3a')],{'$or':_[_0x7488('0x27')](_0x352178,function(_0x192b12){if(_0x192b12[_0x7488('0x2a')]!==_0x7488('0x3c')){var _0x1b46a0={};_0x1b46a0[_0x192b12['name']]={'$like':'%'+_0x314a6f[_0x7488('0x2c')][_0x7488('0x39')]+'%'};return _0x1b46a0;}})});}_0x130213=_[_0x7488('0x3b')]({},_0x130213,_0x314a6f[_0x7488('0x3d')]);var _0x566604={'where':_0x130213['where']};return db['SmsApplication'][_0x7488('0x1d')](_0x566604)[_0x7488('0x21')](function(_0x11e246){_0x1877ae[_0x7488('0x1d')]=_0x11e246;if(_0x314a6f[_0x7488('0x2c')][_0x7488('0x3e')]){_0x130213[_0x7488('0x3f')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x130213);})[_0x7488('0x21')](function(_0x2cabf1){_0x1877ae[_0x7488('0x40')]=_0x2cabf1;return _0x1877ae;})[_0x7488('0x21')](respondWithFilteredResult(_0x267a4d,_0x130213))['catch'](handleError(_0x267a4d,null));};exports['show']=function(_0x4e4a91,_0x27878d){var _0x1cfea0={'raw':!![],'where':{'id':_0x4e4a91[_0x7488('0x41')]['id']}},_0x3a0282={};_0x3a0282[_0x7488('0x2f')]=_[_0x7488('0x42')](db[_0x7488('0x28')][_0x7488('0x29')]);_0x3a0282['query']=_[_0x7488('0x42')](_0x4e4a91[_0x7488('0x2c')]);_0x3a0282[_0x7488('0x2d')]=_[_0x7488('0x2e')](_0x3a0282[_0x7488('0x2f')],_0x3a0282[_0x7488('0x2c')]);_0x1cfea0['attributes']=_[_0x7488('0x2e')](_0x3a0282[_0x7488('0x2f')],qs[_0x7488('0x31')](_0x4e4a91['query']['fields']));_0x1cfea0[_0x7488('0x30')]=_0x1cfea0[_0x7488('0x30')][_0x7488('0x32')]?_0x1cfea0['attributes']:_0x3a0282[_0x7488('0x2f')];if(_0x4e4a91['query']['includeAll']){_0x1cfea0[_0x7488('0x3f')]=[{'all':!![]}];}_0x1cfea0=_[_0x7488('0x3b')]({},_0x1cfea0,_0x4e4a91[_0x7488('0x3d')]);return db[_0x7488('0x28')]['find'](_0x1cfea0)[_0x7488('0x21')](handleEntityNotFound(_0x27878d,null))[_0x7488('0x21')](respondWithResult(_0x27878d,null))[_0x7488('0x43')](handleError(_0x27878d,null));};exports[_0x7488('0x44')]=function(_0x54e02a,_0xc33efc){return db[_0x7488('0x28')][_0x7488('0x44')](_0x54e02a['body'],{})[_0x7488('0x21')](respondWithResult(_0xc33efc,0xc9))['catch'](handleError(_0xc33efc,null));};exports[_0x7488('0x20')]=function(_0x27ef88,_0x72669){if(_0x27ef88[_0x7488('0x45')]['id']){delete _0x27ef88['body']['id'];}return db[_0x7488('0x28')][_0x7488('0x46')]({'where':{'id':_0x27ef88[_0x7488('0x41')]['id']}})[_0x7488('0x21')](handleEntityNotFound(_0x72669,null))['then'](saveUpdates(_0x27ef88[_0x7488('0x45')],null))[_0x7488('0x21')](respondWithResult(_0x72669,null))['catch'](handleError(_0x72669,null));};exports[_0x7488('0x22')]=function(_0x8d8e86,_0x460449){return db[_0x7488('0x28')][_0x7488('0x46')]({'where':{'id':_0x8d8e86[_0x7488('0x41')]['id']}})['then'](handleEntityNotFound(_0x460449,null))[_0x7488('0x21')](removeEntity(_0x460449,null))[_0x7488('0x43')](handleError(_0x460449,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index 70fba98..d51ed9b 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 _0x095d=['bluebird','request-promise','path','../../config/environment','exports','define','SmsApplication','sms_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x095d,0x14c));var _0xd095=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x095d[_0x38eb23];return _0x48506a;};'use strict';var _=require(_0xd095('0x0'));var util=require('util');var logger=require(_0xd095('0x1'))(_0xd095('0x2'));var moment=require(_0xd095('0x3'));var BPromise=require(_0xd095('0x4'));var rp=require(_0xd095('0x5'));var fs=require('fs');var path=require(_0xd095('0x6'));var rimraf=require('rimraf');var config=require(_0xd095('0x7'));var attributes=require('./smsApplication.attributes');module[_0xd095('0x8')]=function(_0xd1d436,_0x1bf40e){return _0xd1d436[_0xd095('0x9')](_0xd095('0xa'),attributes,{'tableName':_0xd095('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xd095('0xc'),'collate':_0xd095('0xd')});}; \ No newline at end of file +var _0xd7ba=['utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x627b1b,_0x462114){var _0x2fd022=function(_0x2059c5){while(--_0x2059c5){_0x627b1b['push'](_0x627b1b['shift']());}};_0x2fd022(++_0x462114);}(_0xd7ba,0x179));var _0xad7b=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xd7ba[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0xad7b('0x0'));var util=require(_0xad7b('0x1'));var logger=require(_0xad7b('0x2'))(_0xad7b('0x3'));var moment=require(_0xad7b('0x4'));var BPromise=require(_0xad7b('0x5'));var rp=require(_0xad7b('0x6'));var fs=require('fs');var path=require(_0xad7b('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xad7b('0x8'));module[_0xad7b('0x9')]=function(_0x536cf6,_0xf94b73){return _0x536cf6[_0xad7b('0xa')](_0xad7b('0xb'),attributes,{'tableName':_0xad7b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xad7b('0xd'),'collate':_0xad7b('0xe')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 2cd96e0..07675b9 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 _0x5183=['../../config/utils','../../config/logger','jayson/promise','client','http','request','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x2298f0,_0x3bbf4f){var _0x39b136=function(_0xc2cd6e){while(--_0xc2cd6e){_0x2298f0['push'](_0x2298f0['shift']());}};_0x39b136(++_0x3bbf4f);}(_0x5183,0x13e));var _0x3518=function(_0x25f8ad,_0x408c15){_0x25f8ad=_0x25f8ad-0x0;var _0x1ce7ee=_0x5183[_0x25f8ad];return _0x1ce7ee;};'use strict';var _=require(_0x3518('0x0'));var util=require(_0x3518('0x1'));var moment=require(_0x3518('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3518('0x3'));var db=require(_0x3518('0x4'))['db'];var utils=require(_0x3518('0x5'));var logger=require(_0x3518('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3518('0x7'));var client=jayson[_0x3518('0x8')][_0x3518('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x482b2d,_0x5cd139,_0x488c52){return new BPromise(function(_0x147b59,_0x33e66c){return client[_0x3518('0xa')](_0x482b2d,_0x488c52)['then'](function(_0x12530b){logger['info'](_0x3518('0xb'),_0x5cd139,_0x3518('0xc'));logger[_0x3518('0xd')]('SmsApplication,\x20%s,\x20%s,\x20%s',_0x5cd139,_0x3518('0xc'),JSON[_0x3518('0xe')](_0x12530b));if(_0x12530b['error']){if(_0x12530b[_0x3518('0xf')][_0x3518('0x10')]===0x1f4){logger[_0x3518('0xf')](_0x3518('0xb'),_0x5cd139,_0x12530b['error']['message']);return _0x33e66c(_0x12530b[_0x3518('0xf')][_0x3518('0x11')]);}logger[_0x3518('0xf')]('SmsApplication,\x20%s,\x20%s',_0x5cd139,_0x12530b['error'][_0x3518('0x11')]);return _0x147b59(_0x12530b[_0x3518('0xf')][_0x3518('0x11')]);}else{logger['info'](_0x3518('0xb'),_0x5cd139,_0x3518('0xc'));_0x147b59(_0x12530b[_0x3518('0x12')][_0x3518('0x11')]);}})['catch'](function(_0xc7f658){logger['error'](_0x3518('0xb'),_0x5cd139,_0xc7f658);_0x33e66c(_0xc7f658);});});} \ No newline at end of file +var _0xdefc=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsApplication,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../config/utils'];(function(_0x349fb3,_0x4c1e21){var _0x6e7c85=function(_0x67fc68){while(--_0x67fc68){_0x349fb3['push'](_0x349fb3['shift']());}};_0x6e7c85(++_0x4c1e21);}(_0xdefc,0x1b3));var _0xcdef=function(_0x81024b,_0x1437bf){_0x81024b=_0x81024b-0x0;var _0x4ee29c=_0xdefc[_0x81024b];return _0x4ee29c;};'use strict';var _=require(_0xcdef('0x0'));var util=require(_0xcdef('0x1'));var moment=require(_0xcdef('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdef('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdef('0x4'));var logger=require(_0xcdef('0x5'))(_0xcdef('0x6'));var config=require(_0xcdef('0x7'));var jayson=require(_0xcdef('0x8'));var client=jayson[_0xcdef('0x9')][_0xcdef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4a2665,_0x45744d,_0x583a65){return new BPromise(function(_0x463867,_0x467f2c){return client[_0xcdef('0xb')](_0x4a2665,_0x583a65)['then'](function(_0x4c357b){logger[_0xcdef('0xc')]('SmsApplication,\x20%s,\x20%s',_0x45744d,_0xcdef('0xd'));logger[_0xcdef('0xe')](_0xcdef('0xf'),_0x45744d,_0xcdef('0xd'),JSON[_0xcdef('0x10')](_0x4c357b));if(_0x4c357b[_0xcdef('0x11')]){if(_0x4c357b[_0xcdef('0x11')][_0xcdef('0x12')]===0x1f4){logger[_0xcdef('0x11')](_0xcdef('0x13'),_0x45744d,_0x4c357b[_0xcdef('0x11')][_0xcdef('0x14')]);return _0x467f2c(_0x4c357b[_0xcdef('0x11')][_0xcdef('0x14')]);}logger['error'](_0xcdef('0x13'),_0x45744d,_0x4c357b[_0xcdef('0x11')]['message']);return _0x463867(_0x4c357b[_0xcdef('0x11')][_0xcdef('0x14')]);}else{logger['info'](_0xcdef('0x13'),_0x45744d,_0xcdef('0xd'));_0x463867(_0x4c357b['result'][_0xcdef('0x14')]);}})[_0xcdef('0x15')](function(_0xeb7530){logger[_0xcdef('0x11')](_0xcdef('0x13'),_0x45744d,_0xeb7530);_0x467f2c(_0xeb7530);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 5c0af90..0fa2434 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 _0x66d4=['smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','/:id','show','getMessages','/:id/download','download','post','/:id/messages','addMessage','/:id/tags','tracked','smsinteraction:addtags','addTags','sms'];(function(_0x218ca4,_0x41cc40){var _0x1b3ff9=function(_0x5003cd){while(--_0x5003cd){_0x218ca4['push'](_0x218ca4['shift']());}};_0x1b3ff9(++_0x41cc40);}(_0x66d4,0x10b));var _0x466d=function(_0x56825b,_0x172b8d){_0x56825b=_0x56825b-0x0;var _0x69ce77=_0x66d4[_0x56825b];return _0x69ce77;};'use strict';var multer=require('multer');var util=require(_0x466d('0x0'));var path=require('path');var timeout=require(_0x466d('0x1'));var express=require(_0x466d('0x2'));var router=express[_0x466d('0x3')]();var auth=require(_0x466d('0x4'));var interaction=require(_0x466d('0x5'));var config=require('../../config/environment');var controller=require('./smsInteraction.controller');router[_0x466d('0x6')]('/',auth['isAuthenticated'](),controller[_0x466d('0x7')]);router[_0x466d('0x6')](_0x466d('0x8'),auth[_0x466d('0x9')](),controller['describe']);router['get'](_0x466d('0xa'),auth[_0x466d('0x9')](),controller[_0x466d('0xb')]);router[_0x466d('0x6')]('/:id/messages',auth[_0x466d('0x9')](),controller[_0x466d('0xc')]);router[_0x466d('0x6')](_0x466d('0xd'),auth[_0x466d('0x9')](),controller[_0x466d('0xe')]);router[_0x466d('0xf')]('/',auth[_0x466d('0x9')](),controller['create']);router['post'](_0x466d('0x10'),auth[_0x466d('0x9')](),controller[_0x466d('0x11')]);router[_0x466d('0xf')](_0x466d('0x12'),auth[_0x466d('0x9')](),interaction[_0x466d('0x13')]('sms',_0x466d('0x14')),controller[_0x466d('0x15')]);router['put'](_0x466d('0xa'),auth[_0x466d('0x9')](),interaction[_0x466d('0x13')](_0x466d('0x16'),_0x466d('0x17')),controller[_0x466d('0x18')]);router[_0x466d('0x19')]('/:id',auth[_0x466d('0x9')](),interaction[_0x466d('0x13')]('sms',_0x466d('0x1a')),controller['destroy']);router['delete'](_0x466d('0x12'),auth[_0x466d('0x9')](),controller[_0x466d('0x1b')]);module[_0x466d('0x1c')]=router; \ No newline at end of file +var _0xffb0=['smsinteraction:destroy','destroy','delete','removeTags','exports','path','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','tracked','smsinteraction:update','update'];(function(_0x3772f4,_0x12fddb){var _0x2f792a=function(_0x519b22){while(--_0x519b22){_0x3772f4['push'](_0x3772f4['shift']());}};_0x2f792a(++_0x12fddb);}(_0xffb0,0x1d5));var _0x0ffb=function(_0x272d18,_0x1332b3){_0x272d18=_0x272d18-0x0;var _0x514028=_0xffb0[_0x272d18];return _0x514028;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0ffb('0x0'));var timeout=require('connect-timeout');var express=require(_0x0ffb('0x1'));var router=express[_0x0ffb('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x0ffb('0x3'));var config=require(_0x0ffb('0x4'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0x0ffb('0x5')](),controller[_0x0ffb('0x6')]);router[_0x0ffb('0x7')](_0x0ffb('0x8'),auth[_0x0ffb('0x5')](),controller['describe']);router[_0x0ffb('0x7')](_0x0ffb('0x9'),auth[_0x0ffb('0x5')](),controller[_0x0ffb('0xa')]);router['get'](_0x0ffb('0xb'),auth[_0x0ffb('0x5')](),controller[_0x0ffb('0xc')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0x0ffb('0xd')]);router[_0x0ffb('0xe')]('/',auth[_0x0ffb('0x5')](),controller[_0x0ffb('0xf')]);router[_0x0ffb('0xe')](_0x0ffb('0xb'),auth[_0x0ffb('0x5')](),controller[_0x0ffb('0x10')]);router[_0x0ffb('0xe')](_0x0ffb('0x11'),auth[_0x0ffb('0x5')](),interaction['tracked'](_0x0ffb('0x12'),_0x0ffb('0x13')),controller[_0x0ffb('0x14')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x0ffb('0x15')](_0x0ffb('0x12'),_0x0ffb('0x16')),controller[_0x0ffb('0x17')]);router['delete'](_0x0ffb('0x9'),auth['isAuthenticated'](),interaction['tracked'](_0x0ffb('0x12'),_0x0ffb('0x18')),controller[_0x0ffb('0x19')]);router[_0x0ffb('0x1a')](_0x0ffb('0x11'),auth['isAuthenticated'](),controller[_0x0ffb('0x1b')]);module[_0x0ffb('0x1c')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 69cf299..6b2bdf0 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 _0xd8b0=['moment','STRING','DATE','ENUM','out','sequelize'];(function(_0x121b1a,_0x42fdb7){var _0x2d89a6=function(_0x1b6027){while(--_0x1b6027){_0x121b1a['push'](_0x121b1a['shift']());}};_0x2d89a6(++_0x42fdb7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'note':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'read1stAt':{'type':Sequelize[_0x0d8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in',_0x0d8b('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x0713=['DATE','STRING','ENUM','out','exports','BOOLEAN'];(function(_0x967959,_0x53c5c1){var _0x5c4489=function(_0x1ae5c6){while(--_0x1ae5c6){_0x967959['push'](_0x967959['shift']());}};_0x5c4489(++_0x53c5c1);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x3071('0x0')]={'closed':{'type':Sequelize[_0x3071('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3071('0x2')]},'disposition':{'type':Sequelize[_0x3071('0x3')]},'note':{'type':Sequelize[_0x3071('0x3')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x3071('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3071('0x2')]},'lastMsgDirection':{'type':Sequelize[_0x3071('0x4')]('in',_0x3071('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 d319f21..d860ce4 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 _0x0972=['i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','resolve','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','groupBy','SmsInteractionId','all','show','intersection','includeAll','include','options','create','destroy','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','rows','setTags','spread','smsInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','transcript-%d-%s.zip','direction','secret','fullname','CmContact','lastName','SmsAccount','Account','Owner','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','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','mkdirSync','N.A.','closed','closedAt','Messages','out','System','Contact','firstName','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','eml-format','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','count','offset','limit','set','apply','save','update','then','end','error','name','send','Users','map','TagIds','Tags','split','forEach','catch','SmsInteraction','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','select','field','color','tools_tags','u.id','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_interaction_has_tags','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20>\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','buildExpression','some','SmsAccountId','i.SmsAccountId\x20IN\x20?','concat','createdAt','$gte','parse','$lte','null','\x20IS\x20NULL','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric'];(function(_0x44eedb,_0x11ad52){var _0x1b0d99=function(_0x9cea41){while(--_0x9cea41){_0x44eedb['push'](_0x44eedb['shift']());}};_0x1b0d99(++_0x11ad52);}(_0x0972,0x64));var _0x2097=function(_0x100dca,_0x50d8a9){_0x100dca=_0x100dca-0x0;var _0x4df8cb=_0x0972[_0x100dca];return _0x4df8cb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x2097('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x2097('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2097('0x2'));var moment=require(_0x2097('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2097('0x4'));var util=require(_0x2097('0x5'));var path=require(_0x2097('0x6'));var sox=require(_0x2097('0x7'));var csv=require(_0x2097('0x8'));var ejs=require(_0x2097('0x9'));var fs=require('fs');var _=require(_0x2097('0xa'));var squel=require('squel');var crypto=require(_0x2097('0xb'));var jsforce=require(_0x2097('0xc'));var deskjs=require(_0x2097('0xd'));var toCsv=require(_0x2097('0x8'));var querystring=require(_0x2097('0xe'));var Papa=require('papaparse');var Redis=require(_0x2097('0xf'));var authService=require(_0x2097('0x10'));var qs=require(_0x2097('0x11'));var as=require(_0x2097('0x12'));var hardwareService=require(_0x2097('0x13'));var logger=require(_0x2097('0x14'))(_0x2097('0x15'));var utils=require(_0x2097('0x16'));var config=require(_0x2097('0x17'));var db=require(_0x2097('0x18'))['db'];config[_0x2097('0x19')]=_[_0x2097('0x1a')](config[_0x2097('0x19')],{'host':_0x2097('0x1b'),'port':0x18eb});var socket=require(_0x2097('0x1c'))(new Redis(config[_0x2097('0x19')]));require(_0x2097('0x1d'))[_0x2097('0x1e')](socket);function respondWithStatusCode(_0x2c3e41,_0x354387){_0x354387=_0x354387||0xcc;return function(_0x5d0a43){if(_0x5d0a43){return _0x2c3e41[_0x2097('0x1f')](_0x354387);}return _0x2c3e41[_0x2097('0x20')](_0x354387)['end']();};}function respondWithResult(_0x4eec05,_0x4fc8c5){_0x4fc8c5=_0x4fc8c5||0xc8;return function(_0x409deb){if(_0x409deb){return _0x4eec05['status'](_0x4fc8c5)[_0x2097('0x21')](_0x409deb);}};}function respondWithFilteredResult(_0xb12c94,_0x43fec9){return function(_0x1347e4){if(_0x1347e4){var _0x44c584=_0x1347e4[_0x2097('0x22')],_0x53e2b4=_0x43fec9[_0x2097('0x23')],_0x324652=_0x43fec9[_0x2097('0x23')]+_0x43fec9[_0x2097('0x24')],_0x140094;if(_0x324652>=_0x44c584){_0x324652=_0x44c584;_0x140094=0xc8;}else{_0x140094=0xce;}_0xb12c94[_0x2097('0x20')](_0x140094);return _0xb12c94[_0x2097('0x25')]('Content-Range',_0x53e2b4+'-'+_0x324652+'/'+_0x44c584)['json'](_0x1347e4);}return null;};}function patchUpdates(_0xf65dc6){return function(_0x569c21){try{jsonpatch[_0x2097('0x26')](_0x569c21,_0xf65dc6,!![]);}catch(_0x1ac5f1){return BPromise['reject'](_0x1ac5f1);}return _0x569c21[_0x2097('0x27')]();};}function saveUpdates(_0x5b0582,_0x2e17c8){return function(_0xf32d3f){if(_0xf32d3f){return _0xf32d3f[_0x2097('0x28')](_0x5b0582)[_0x2097('0x29')](function(_0x36b15e){return _0x36b15e;});}return null;};}function removeEntity(_0x35047b,_0x56390a){return function(_0xae5f9){if(_0xae5f9){return _0xae5f9['destroy']()[_0x2097('0x29')](function(){_0x35047b[_0x2097('0x20')](0xcc)[_0x2097('0x2a')]();});}};}function handleEntityNotFound(_0x9f59bc,_0x499988){return function(_0x2d683a){if(!_0x2d683a){_0x9f59bc[_0x2097('0x1f')](0x194);}return _0x2d683a;};}function handleError(_0x56af3b,_0x1229fc){_0x1229fc=_0x1229fc||0x1f4;return function(_0x5ed0fa){logger[_0x2097('0x2b')](_0x5ed0fa['stack']);if(_0x5ed0fa[_0x2097('0x2c')]){delete _0x5ed0fa[_0x2097('0x2c')];}_0x56af3b[_0x2097('0x20')](_0x1229fc)[_0x2097('0x2d')](_0x5ed0fa);};}function getInteractionUsers(_0x410afa,_0x36228c){return new BPromise(function(_0x450e0b,_0x4b443d){try{if(_0x36228c[_0x410afa['id']]){_0x410afa[_0x2097('0x2e')]=_[_0x2097('0x2f')](_0x36228c[_0x410afa['id']],function(_0x5cce55){return{'id':_0x5cce55['id']};});}}catch(_0x1398d0){_0x4b443d(_0x1398d0);}_0x450e0b(_0x410afa);});}function getInteractionTags(_0x41487d,_0x59fb84){return new BPromise(function(_0x4d0916,_0x312c77){try{if(_0x41487d[_0x2097('0x30')]){_0x41487d[_0x2097('0x31')]=[];_0x41487d[_0x2097('0x30')][_0x2097('0x32')](',')[_0x2097('0x33')](function(_0x56c538){_0x41487d[_0x2097('0x31')]['push'](_0x59fb84[_0x56c538]);});}delete _0x41487d[_0x2097('0x30')];}catch(_0x3c36d3){_0x312c77(_0x3c36d3);}_0x4d0916(_0x41487d);});}function updateSmsInteraction(_0x2bc39c,_0x1e8af9,_0x44e398){return new BPromise(function(_0x395d9f,_0x9bc312){return getInteractionUsers(_0x2bc39c,_0x44e398)[_0x2097('0x29')](function(_0x2701bc){return getInteractionTags(_0x2701bc,_0x1e8af9);})['then'](function(_0x192160){_0x395d9f(_0x192160);})[_0x2097('0x34')](function(_0x23334d){_0x9bc312(_0x23334d);});});}exports['index']=function(_0x3d97ee,_0x3bda50){var _0x3c2fa6={},_0x396162={},_0x542a52={'count':0x0,'rows':[]};var _0x50b101=_['map'](db[_0x2097('0x35')][_0x2097('0x36')],function(_0x4123b7){return{'name':_0x4123b7[_0x2097('0x37')],'type':_0x4123b7[_0x2097('0x38')][_0x2097('0x39')]};});_0x396162['model']=_[_0x2097('0x2f')](_0x50b101,_0x2097('0x2c'));_0x396162[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x3d97ee[_0x2097('0x3a')]);_0x396162[_0x2097('0x3c')]=_['intersection'](_0x396162[_0x2097('0x3d')],_0x396162[_0x2097('0x3a')]);_0x3c2fa6[_0x2097('0x3e')]=_['intersection'](_0x396162['model'],qs[_0x2097('0x3f')](_0x3d97ee[_0x2097('0x3a')][_0x2097('0x3f')]));_0x3c2fa6[_0x2097('0x3e')]=_0x3c2fa6[_0x2097('0x3e')][_0x2097('0x40')]?_0x3c2fa6[_0x2097('0x3e')]:_0x396162[_0x2097('0x3d')];if(!_0x3d97ee[_0x2097('0x3a')][_0x2097('0x41')](_0x2097('0x42'))){_0x3c2fa6[_0x2097('0x24')]=qs['limit'](_0x3d97ee[_0x2097('0x3a')][_0x2097('0x24')]);_0x3c2fa6[_0x2097('0x23')]=qs['offset'](_0x3d97ee[_0x2097('0x3a')][_0x2097('0x23')]);}_0x3c2fa6[_0x2097('0x43')]=qs[_0x2097('0x44')](_0x3d97ee[_0x2097('0x3a')][_0x2097('0x44')]);_0x3c2fa6[_0x2097('0x45')]=qs[_0x2097('0x3c')](_['pick'](_0x3d97ee[_0x2097('0x3a')],_0x396162[_0x2097('0x3c')]));var _0x186ca5=[];var _0x3288ae=squel[_0x2097('0x46')]()[_0x2097('0x47')]('id')[_0x2097('0x47')](_0x2097('0x2c'))['field'](_0x2097('0x48'))['from'](_0x2097('0x49'));var _0x298e49=squel[_0x2097('0x46')]()[_0x2097('0x47')](_0x2097('0x4a'))['field'](_0x2097('0x4b'))[_0x2097('0x4c')](_0x2097('0x4d'),'ui')[_0x2097('0x4e')](_0x2097('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x6b68c3=squel[_0x2097('0x46')]()[_0x2097('0x4c')](_0x2097('0x50'),'i')[_0x2097('0x4e')](_0x2097('0x51'),'c',_0x2097('0x52'))[_0x2097('0x4e')]('users','o',_0x2097('0x53'))[_0x2097('0x4e')](_0x2097('0x54'),'a',_0x2097('0x55'))['left_join']('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x2097('0x4e')](_0x2097('0x56'),'it','it.SmsInteractionId\x20=\x20i.id')[_0x2097('0x4e')](_0x2097('0x49'),'t','t.id\x20=\x20it.TagId');var _0x593033=squel[_0x2097('0x57')]();var _0x21829d=[];var _0x1b4de6=squel['expr']();var _0x1ec92d;if(_0x3d97ee[_0x2097('0x3a')]['search']){_0x1ec92d=as[_0x2097('0x58')](_0x3d97ee[_0x2097('0x3a')][_0x2097('0x59')]);var _0xba6ef0=_0x1ec92d[_0x2097('0x5a')];for(var _0x56a4ad=0x0;_0x56a4ad<_0x1ec92d['conditions'][_0x2097('0x40')];_0x56a4ad++){var _0x39f9cb=_0x1ec92d[_0x2097('0x5b')][_0x56a4ad];var _0x57a45c='i';var _0x5c1739=_[_0x2097('0x5c')](_0x50b101,[_0x2097('0x2c'),_0x39f9cb['field']]);if(!_0x5c1739){switch(_0x39f9cb[_0x2097('0x47')]){case _0x2097('0x5d'):if(_0x39f9cb[_0x2097('0x5e')]==0x1){_0x6b68c3[_0x2097('0x5f')]('`'+_0x39f9cb[_0x2097('0x47')]+'`\x20=\x200');}else{_0x6b68c3[_0x2097('0x5f')]('`'+_0x39f9cb[_0x2097('0x47')]+_0x2097('0x60'));}break;case'Contact':if(_0x39f9cb[_0x2097('0x61')]===_0x2097('0x62')){if(_0x39f9cb['value'][_0x2097('0x32')]('\x20')['length']>0x1){_0x593033[_0xba6ef0](_0x2097('0x63'),qs['getFullTextValue'](_0x39f9cb['value']),null);}else{var _0x5d4f35='%'+_0x39f9cb[_0x2097('0x5e')]+'%';_0x593033[_0xba6ef0]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5d4f35,_0x5d4f35,_0x5d4f35);}}else{_0x5c1739=_['find'](_0x50b101,[_0x2097('0x2c'),'ContactId']);_0x39f9cb[_0x2097('0x47')]=_0x2097('0x64');_0x258010=as['buildExpression'](_0x57a45c,_0x5c1739[_0x2097('0x38')],_0x39f9cb);_0x593033[_0xba6ef0](_0x258010[_0x2097('0x65')],_0x258010[_0x2097('0x5e')][_0x2097('0x66')],_0x258010[_0x2097('0x5e')]['end']);}break;case _0x2097('0x67'):var _0x49e315=_0x39f9cb[_0x2097('0x5e')][_0x2097('0x32')](',')[_0x2097('0x2f')](function(_0x55e3cd){return Number(_0x55e3cd);});_0x49e315[_0x2097('0x33')](function(_0x17df41){_0x1b4de6['or'](_0x2097('0x68'),'%,'+_0x17df41+',%');});_0x21829d=_[_0x2097('0x69')](_0x21829d,_0x49e315);break;case _0x2097('0x6a'):if(_0x39f9cb['operator']==='$substring'){_0x593033[_0xba6ef0](_0x2097('0x6b'),'%'+_0x39f9cb[_0x2097('0x5e')]+'%',null);}else{_0x5c1739=_['find'](_0x50b101,['name','UserId']);_0x39f9cb['field']=_0x2097('0x6c');_0x258010=as['buildExpression'](_0x57a45c,_0x5c1739[_0x2097('0x38')],_0x39f9cb);_0x593033[_0xba6ef0](_0x258010[_0x2097('0x65')],_0x258010['value'][_0x2097('0x66')],_0x258010[_0x2097('0x5e')][_0x2097('0x2a')]);}break;case _0x2097('0x6d'):_0x258010=as[_0x2097('0x6e')]('me',null,_0x39f9cb);_0x593033[_0xba6ef0](_0x258010[_0x2097('0x65')],_0x258010[_0x2097('0x5e')][_0x2097('0x66')],_0x258010[_0x2097('0x5e')]['end']);break;}}else{var _0x258010=as[_0x2097('0x6e')](_0x57a45c,_0x5c1739[_0x2097('0x38')],_0x39f9cb);_0x593033[_0xba6ef0](_0x258010[_0x2097('0x65')],_0x258010[_0x2097('0x5e')][_0x2097('0x66')],_0x258010['value'][_0x2097('0x2a')]);}}}else{var _0x27ed29=_(_0x3d97ee[_0x2097('0x3a')])[_0x2097('0x3b')]()[_0x2097('0x2f')](function(_0x5d6b8a){return _[_0x2097('0x6f')](_0x50b101,[_0x2097('0x2c'),_0x5d6b8a])?_0x5d6b8a:undefined;})['compact']()['value']();if(!_['isEmpty'](_0x27ed29)){_0x27ed29[_0x2097('0x33')](function(_0x13456b){if(_0x13456b===_0x2097('0x70')){_0x6b68c3[_0x2097('0x45')](_0x2097('0x71'),[][_0x2097('0x72')](_0x3d97ee[_0x2097('0x3a')][_0x13456b]));}else if(_0x13456b===_0x2097('0x73')){var _0x2e5f49=JSON['parse'](_0x3d97ee['query'][_0x13456b])[_0x2097('0x74')];var _0x34d832=JSON[_0x2097('0x75')](_0x3d97ee[_0x2097('0x3a')][_0x13456b])[_0x2097('0x76')];_0x6b68c3[_0x2097('0x45')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x2e5f49,_0x34d832);}else{if(_0x3d97ee[_0x2097('0x3a')][_0x13456b]===_0x2097('0x77')){_0x6b68c3[_0x2097('0x45')]('i.'+_0x13456b+_0x2097('0x78'));}else{_0x6b68c3['where']('i.'+_0x13456b+'\x20=\x20?',_0x3d97ee[_0x2097('0x3a')][_0x13456b]);}}});}if(_0x3d97ee[_0x2097('0x3a')]['read']){if(_0x3d97ee[_0x2097('0x3a')][_0x2097('0x79')]==0x1){_0x6b68c3[_0x2097('0x5f')](_0x2097('0x7a'));}else{_0x6b68c3[_0x2097('0x5f')](_0x2097('0x7b'));}}if(_0x3d97ee[_0x2097('0x3a')][_0x2097('0x7c')]){_0x21829d=_['isArray'](_0x3d97ee[_0x2097('0x3a')][_0x2097('0x7c')])?_0x3d97ee['query'][_0x2097('0x7c')]:new Array(_0x3d97ee[_0x2097('0x3a')][_0x2097('0x7c')]);_0x21829d[_0x2097('0x33')](function(_0x307c43){_0x1b4de6['or'](_0x2097('0x68'),'%,'+_0x307c43+',%');});}if(_0x3d97ee[_0x2097('0x3a')][_0x2097('0x7d')]){var _0x2d374d=_0x3d97ee[_0x2097('0x3a')][_0x2097('0x7d')]['replace']('\x5c','\x5c\x5c')[_0x2097('0x7e')]('\x27\x27',_0x2097('0x7f'));if(qs[_0x2097('0x80')](_0x2d374d)){_0x593033['or'](_0x2097('0x81'),_0x2d374d+'%')['or'](_0x2097('0x82'),_0x2d374d+'%');}else{_0x593033['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x2097('0x83')](_0x2d374d))['or'](_0x2097('0x84'),_0x2d374d+'%');}}}_0x6b68c3[_0x2097('0x45')](_0x593033);_0x6b68c3['group'](_0x2097('0x85'));var _0x545cd9={'type':db[_0x2097('0x86')]['QueryTypes'][_0x2097('0x87')],'raw':!![]};var _0x4be822=_0x6b68c3[_0x2097('0x88')]();_0x4be822['field'](_0x2097('0x85'));_0x4be822[_0x2097('0x47')](_0x2097('0x89'),_0x2097('0x5d'));if(_0x3c2fa6[_0x2097('0x43')]){_0x3c2fa6['order'][_0x2097('0x33')](function(_0x2ad797){_0x6b68c3[_0x2097('0x43')]('i.'+_0x2ad797[0x0],_0x2ad797[0x1]===_0x2097('0x8a')?![]:!![]);});}if(!_[_0x2097('0x8b')](_0x21829d)){_0x6b68c3[_0x2097('0x5f')](_0x1b4de6);_0x4be822[_0x2097('0x45')](_0x2097('0x8c'),_0x21829d);}BPromise[_0x2097('0x8d')]()[_0x2097('0x29')](function(){if(!_0x1ec92d&&_0x3d97ee[_0x2097('0x3a')][_0x2097('0x70')])return;return _0x3d97ee[_0x2097('0x8e')][_0x2097('0x8f')]({'attributes':['id'],'raw':!![]})[_0x2097('0x29')](function(_0xf3831c){if(_['isEmpty'](_0xf3831c)){_0x4be822[_0x2097('0x45')]('i.SmsAccountId\x20IS\x20NULL');_0x6b68c3['where'](_0x2097('0x90'));}else{_0x4be822[_0x2097('0x45')](_0x2097('0x71'),_['map'](_0xf3831c,'id'));_0x6b68c3[_0x2097('0x45')](_0x2097('0x71'),_[_0x2097('0x2f')](_0xf3831c,'id'));}});})[_0x2097('0x29')](function(){db['sequelize'][_0x2097('0x3a')](_0x4be822['toString'](),_0x545cd9)[_0x2097('0x29')](function(_0x385551){_0x542a52[_0x2097('0x22')]=_0x385551[_0x2097('0x40')];if(_0x542a52['count']===0x0)return[];return db[_0x2097('0x91')][_0x2097('0x3a')](_0x3288ae[_0x2097('0x92')](),_0x545cd9)['then'](function(_0x427b3c){_0x186ca5=_[_0x2097('0x93')](_0x427b3c,'id');_0x545cd9=_[_0x2097('0x94')](_0x545cd9,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0x6b68c3[_0x2097('0x47')](_0x2097('0x89'),_0x2097('0x5d'));_0x6b68c3[_0x2097('0x47')](_0x2097('0x95'),_0x2097('0x96'));_0x6b68c3['field']('a.mandatoryDisposition',_0x2097('0x97'));_0x6b68c3[_0x2097('0x47')](_0x2097('0x98'));_0x6b68c3[_0x2097('0x47')](_0x2097('0x99'),_0x2097('0x9a'));_0x6b68c3['field'](_0x2097('0x9b'),_0x2097('0x9c'));_0x6b68c3[_0x2097('0x47')](_0x2097('0x9d'),_0x2097('0x9e'));_0x6b68c3[_0x2097('0x47')](_0x2097('0x9f'),'Contact.phone');_0x6b68c3[_0x2097('0x47')](_0x2097('0xa0'),_0x2097('0xa1'));_0x6b68c3[_0x2097('0x47')](_0x2097('0xa2'),_0x2097('0xa3'));_0x6b68c3['field']('GROUP_CONCAT(DISTINCT\x20t.id)',_0x2097('0x30'));_0x6b68c3['limit'](_0x3c2fa6['limit']);_0x6b68c3[_0x2097('0x23')](_0x3c2fa6[_0x2097('0x23')]);return db[_0x2097('0x91')][_0x2097('0x3a')](_0x6b68c3[_0x2097('0x92')](),_0x545cd9);})[_0x2097('0x29')](function(_0x290481){_0x298e49[_0x2097('0x45')]('ui.SmsInteractionId\x20IN\x20?',_[_0x2097('0x2f')](_0x290481,'id'));return db[_0x2097('0x91')][_0x2097('0x3a')](_0x298e49[_0x2097('0x92')](),_0x545cd9)[_0x2097('0x29')](function(_0x5472b9){var _0x2789ed=_[_0x2097('0xa4')](_0x5472b9,_0x2097('0xa5'));var _0x17d46b=[];_0x290481[_0x2097('0x33')](function(_0x1710cb){_0x17d46b['push'](updateSmsInteraction(_0x1710cb,_0x186ca5,_0x2789ed));});return BPromise[_0x2097('0xa6')](_0x17d46b);});});})[_0x2097('0x29')](function(_0x4c0a41){_0x542a52['rows']=_0x4c0a41;return _0x542a52;})['then'](respondWithFilteredResult(_0x3bda50,_0x3c2fa6));})['catch'](handleError(_0x3bda50,null));};exports[_0x2097('0xa7')]=function(_0x415933,_0x3fe29e){var _0x17e260={'raw':![],'where':{'id':_0x415933['params']['id']}},_0x1787aa={};_0x1787aa[_0x2097('0x3d')]=_[_0x2097('0x3b')](db[_0x2097('0x35')][_0x2097('0x36')]);_0x1787aa[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x415933['query']);_0x1787aa[_0x2097('0x3c')]=_[_0x2097('0xa8')](_0x1787aa['model'],_0x1787aa[_0x2097('0x3a')]);_0x17e260[_0x2097('0x3e')]=_[_0x2097('0xa8')](_0x1787aa[_0x2097('0x3d')],qs[_0x2097('0x3f')](_0x415933['query'][_0x2097('0x3f')]));_0x17e260[_0x2097('0x3e')]=_0x17e260[_0x2097('0x3e')][_0x2097('0x40')]?_0x17e260[_0x2097('0x3e')]:_0x1787aa[_0x2097('0x3d')];if(_0x415933[_0x2097('0x3a')][_0x2097('0xa9')]){_0x17e260[_0x2097('0xaa')]=[{'all':!![]}];}_0x17e260=_[_0x2097('0x94')]({},_0x17e260,_0x415933[_0x2097('0xab')]);return db[_0x2097('0x35')][_0x2097('0x5c')](_0x17e260)['then'](handleEntityNotFound(_0x3fe29e,null))['then'](respondWithResult(_0x3fe29e,null))[_0x2097('0x34')](handleError(_0x3fe29e,null));};exports['create']=function(_0x50d6de,_0x293ce2){return db[_0x2097('0x35')][_0x2097('0xac')](_0x50d6de[_0x2097('0x6d')],{})[_0x2097('0x29')](respondWithResult(_0x293ce2,0xc9))['catch'](handleError(_0x293ce2,null));};exports['update']=function(_0x33384b,_0x59bf68){if(_0x33384b[_0x2097('0x6d')]['id']){delete _0x33384b['body']['id'];}return db['SmsInteraction']['find']({'where':{'id':_0x33384b['params']['id']}})['then'](handleEntityNotFound(_0x59bf68,null))[_0x2097('0x29')](saveUpdates(_0x33384b[_0x2097('0x6d')],null))[_0x2097('0x29')](respondWithResult(_0x59bf68,null))[_0x2097('0x34')](handleError(_0x59bf68,null));};exports[_0x2097('0xad')]=function(_0xa9c5ee,_0x3f1ab1){return db[_0x2097('0x35')][_0x2097('0x5c')]({'where':{'id':_0xa9c5ee[_0x2097('0xae')]['id']}})[_0x2097('0x29')](handleEntityNotFound(_0x3f1ab1,null))[_0x2097('0x29')](removeEntity(_0x3f1ab1,null))[_0x2097('0x34')](handleError(_0x3f1ab1,null));};exports[_0x2097('0xaf')]=function(_0x2c1c0c,_0x14e1c8){return db[_0x2097('0x35')]['describe']()[_0x2097('0x29')](respondWithResult(_0x14e1c8,null))[_0x2097('0x34')](handleError(_0x14e1c8,null));};exports[_0x2097('0xb0')]=function(_0x10e28f,_0x2b83b9,_0x367b4e){return db[_0x2097('0xb1')][_0x2097('0x5c')]({'where':{'id':_0x10e28f[_0x2097('0xae')]['id']}})[_0x2097('0x29')](handleEntityNotFound(_0x2b83b9,null))[_0x2097('0x29')](function(_0x5af6b0){if(_0x5af6b0){return _0x5af6b0[_0x2097('0xb0')](_0x10e28f[_0x2097('0x6d')][_0x2097('0xb2')],_[_0x2097('0xb3')](_0x10e28f[_0x2097('0x6d')],[_0x2097('0xb2'),'id'])||{});}})['then'](respondWithResult(_0x2b83b9,null))['catch'](handleError(_0x2b83b9,null));};exports[_0x2097('0xb4')]=function(_0x3ada28,_0x2beb7a,_0x58f869){var _0x1967a6={'raw':![],'where':{}};var _0x4668a6={};var _0x4eeac1={'count':0x0,'rows':[]};return db[_0x2097('0x35')][_0x2097('0xb5')]({'where':{'id':_0x3ada28[_0x2097('0xae')]['id']}})[_0x2097('0x29')](handleEntityNotFound(_0x2beb7a,null))[_0x2097('0x29')](function(_0x41f718){if(_0x41f718){_0x4668a6[_0x2097('0x3d')]=_[_0x2097('0x3b')](db[_0x2097('0xb1')][_0x2097('0x36')]);_0x4668a6[_0x2097('0x3a')]=_[_0x2097('0x3b')](_0x3ada28[_0x2097('0x3a')]);_0x4668a6[_0x2097('0x3c')]=_[_0x2097('0xa8')](_0x4668a6[_0x2097('0x3d')],_0x4668a6[_0x2097('0x3a')]);_0x1967a6['attributes']=_[_0x2097('0xa8')](_0x4668a6[_0x2097('0x3d')],qs[_0x2097('0x3f')](_0x3ada28[_0x2097('0x3a')][_0x2097('0x3f')]));_0x1967a6[_0x2097('0x3e')]=_0x1967a6[_0x2097('0x3e')][_0x2097('0x40')]?_0x1967a6[_0x2097('0x3e')]:_0x4668a6[_0x2097('0x3d')];if(!_0x3ada28['query'][_0x2097('0x41')](_0x2097('0x42'))){_0x1967a6[_0x2097('0x24')]=qs[_0x2097('0x24')](_0x3ada28[_0x2097('0x3a')][_0x2097('0x24')]);_0x1967a6[_0x2097('0x23')]=qs[_0x2097('0x23')](_0x3ada28['query'][_0x2097('0x23')]);}_0x1967a6[_0x2097('0x43')]=qs[_0x2097('0x44')](_0x3ada28[_0x2097('0x3a')][_0x2097('0x44')]);_0x1967a6[_0x2097('0x45')]=qs[_0x2097('0x3c')](_['pick'](_0x3ada28[_0x2097('0x3a')],_0x4668a6[_0x2097('0x3c')]));_0x1967a6['where'][_0x2097('0xa5')]=_0x41f718['id'];if(_0x3ada28[_0x2097('0x3a')]['filter']){_0x1967a6[_0x2097('0x45')]=_['merge'](_0x1967a6[_0x2097('0x45')],{'$or':_[_0x2097('0x2f')](_0x1967a6['attributes'],function(_0x504798){var _0x2a5aec={};_0x2a5aec[_0x504798]={'$like':'%'+_0x3ada28[_0x2097('0x3a')][_0x2097('0x7d')]+'%'};return _0x2a5aec;})});}if(_0x3ada28[_0x2097('0x3a')][_0x2097('0x74')]){var _0x2de4=_0x3ada28[_0x2097('0x3a')][_0x2097('0x74')][_0x2097('0x32')](',');var _0x516ed6={};_0x516ed6[_0x2de4[0x0]]={'$gte':moment(_0x2de4[0x1])[_0x2097('0xb6')](_0x2097('0xb7'))};_0x1967a6['where']=_['merge'](_0x1967a6[_0x2097('0x45')],_0x516ed6);}_0x1967a6=_[_0x2097('0x94')]({},_0x1967a6,_0x3ada28[_0x2097('0xab')]);return db[_0x2097('0xb1')][_0x2097('0x22')]({'where':_0x1967a6[_0x2097('0x45')]})[_0x2097('0x29')](function(_0x5626f0){_0x4eeac1[_0x2097('0x22')]=_0x5626f0;if(_0x3ada28[_0x2097('0x3a')][_0x2097('0xa9')]){_0x1967a6[_0x2097('0xaa')]=[{'all':!![]}];}return db[_0x2097('0xb1')][_0x2097('0xb8')](_0x1967a6);})[_0x2097('0x29')](function(_0x3fcedc){_0x4eeac1[_0x2097('0xb9')]=_0x3fcedc;return _0x4eeac1;});}})[_0x2097('0x29')](respondWithFilteredResult(_0x2beb7a,_0x1967a6))[_0x2097('0x34')](handleError(_0x2beb7a,null));};exports['addTags']=function(_0x4054c5,_0x46152c,_0x4844f3){return db[_0x2097('0x35')][_0x2097('0x5c')]({'where':{'id':_0x4054c5['params']['id']}})[_0x2097('0x29')](handleEntityNotFound(_0x46152c,null))[_0x2097('0x29')](function(_0x5f23fa){if(_0x5f23fa){return _0x5f23fa[_0x2097('0xba')](_0x4054c5[_0x2097('0x6d')][_0x2097('0xb2')],_[_0x2097('0xb3')](_0x4054c5[_0x2097('0x6d')],[_0x2097('0xb2'),'id'])||{})[_0x2097('0xbb')](function(){return db[_0x2097('0x67')][_0x2097('0xb8')]({'attributes':['id',_0x2097('0x2c'),'color'],'where':{'id':_0x4054c5[_0x2097('0x6d')][_0x2097('0xb2')]}});})[_0x2097('0x29')](function(_0x2659a0){socket['emit'](_0x2097('0xbc'),{'id':Number(_0x4054c5['params']['id']),'tags':_0x2659a0||[]});return{'id':Number(_0x4054c5[_0x2097('0xae')]['id']),'tags':_0x2659a0||[]};});}})[_0x2097('0x29')](respondWithResult(_0x46152c,null))[_0x2097('0x34')](handleError(_0x46152c,null));};exports[_0x2097('0xbd')]=function(_0x1c3eb4,_0x184645,_0x17e489){return db[_0x2097('0x35')][_0x2097('0x5c')]({'where':{'id':_0x1c3eb4['params']['id']}})[_0x2097('0x29')](handleEntityNotFound(_0x184645,null))['then'](function(_0x4e68d9){if(_0x4e68d9){return _0x4e68d9['removeTags'](_0x1c3eb4['query'][_0x2097('0xb2')]);}})[_0x2097('0x29')](respondWithStatusCode(_0x184645,null))[_0x2097('0x34')](handleError(_0x184645,null));};exports[_0x2097('0xbe')]=function(_0x497e60,_0x3b6cab){var _0x4c3631=moment()[_0x2097('0xbf')]()[_0x2097('0x92')]();var _0x33745c=path[_0x2097('0xc0')](config['root'],_0x2097('0xc1'),_0x2097('0xc2'),_0x2097('0xc3'));var _0x4386c0=path[_0x2097('0xc0')](config[_0x2097('0xc4')],'server','files','attachments');var _0x568d23=path[_0x2097('0xc0')](_0x33745c,_0x4c3631);var _0x11d90e=util[_0x2097('0xb6')](_0x2097('0xc5'),_0x497e60[_0x2097('0xae')]['id'],_0x4c3631);var _0x514858=path['join'](_0x33745c,_0x11d90e);var _0x429eb7=![];return db['SmsInteraction'][_0x2097('0x5c')]({'where':{'id':_0x497e60[_0x2097('0xae')]['id']},'include':[{'model':db[_0x2097('0xb1')],'as':'Messages','attributes':['id',_0x2097('0x6d'),_0x2097('0x73'),_0x2097('0xc6'),_0x2097('0xc7'),_0x2097('0x79')],'include':[{'model':db['User'],'as':_0x2097('0x6a'),'attributes':['id',_0x2097('0xc8')],'raw':!![]},{'model':db[_0x2097('0xc9')],'as':'Contact','attributes':['id','firstName',_0x2097('0xca')],'raw':!![]}]},{'model':db[_0x2097('0xcb')],'as':_0x2097('0xcc'),'attributes':['id',_0x2097('0x2c')]},{'model':db[_0x2097('0x6a')],'as':_0x2097('0xcd'),'attributes':['id','fullname']}]})[_0x2097('0x29')](handleEntityNotFound(_0x3b6cab,null))[_0x2097('0x29')](function(_0x202922){if(_0x202922){var _0x2bbc95=_0x202922[_0x2097('0xce')]({'plain':!![]});_0x429eb7=!![];var _0x17e130={'format':'A4','border':'10px','header':{'height':_0x2097('0xcf'),'contents':{'first':_0x2097('0xd0')}},'footer':{'height':_0x2097('0xd1'),'contents':{'default':util[_0x2097('0xb6')](_0x2097('0xd2'),util[_0x2097('0xb6')](_0x2097('0xd3'),'Sms',_0x2bbc95['id']),moment()[_0x2097('0xb6')]('YYYY-MM-DD')[_0x2097('0x92')]())}}};fs[_0x2097('0xd4')](_0x568d23);var _0x5af79f={'channel':'Sms','account':_0x2bbc95['Account'][_0x2097('0x2c')],'agent':_0x2bbc95[_0x2097('0xcd')]?_0x2bbc95[_0x2097('0xcd')]['fullname']:_0x2097('0xd5'),'createdAt':moment(_0x2bbc95[_0x2097('0x73')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x2097('0x92')](),'closedAt':_0x2bbc95[_0x2097('0xd6')]?moment(_0x2bbc95[_0x2097('0xd7')])[_0x2097('0xb6')]('YYYY-MM-DD\x20HH:mm:ss')[_0x2097('0x92')]():'','disposition':_0x2bbc95['disposition'],'messages':_(_0x2bbc95[_0x2097('0xd8')])[_0x2097('0x7d')]({'secret':![]})[_0x2097('0x2f')](function(_0x4c8dae){return{'date':moment(_0x4c8dae[_0x2097('0x73')])[_0x2097('0xb6')](_0x2097('0xb7'))[_0x2097('0x92')](),'sender':_0x4c8dae[_0x2097('0xc6')]===_0x2097('0xd9')?_0x4c8dae[_0x2097('0x6a')]?_0x4c8dae['User'][_0x2097('0xc8')]:_0x2097('0xda'):_0x4c8dae[_0x2097('0xdb')][_0x2097('0xdc')]+(_0x4c8dae[_0x2097('0xdb')]['lastName']?'\x20'+_0x4c8dae[_0x2097('0xdb')][_0x2097('0xca')]:''),'body':_0x4c8dae[_0x2097('0x6d')],'direction':_0x4c8dae[_0x2097('0xc6')]===_0x2097('0xd9')?'A':'C','secret':_0x4c8dae[_0x2097('0xc7')],'read':_0x4c8dae[_0x2097('0x79')]};})[_0x2097('0x5e')]()};return ejs[_0x2097('0xdd')](path[_0x2097('0xc0')](config[_0x2097('0xc4')],_0x2097('0xc1'),'views',_0x2097('0xde')),{'interaction':_0x5af79f})[_0x2097('0x29')](function(_0x3ac853){return new BPromise(function(_0x3636bb,_0x308409){pdf[_0x2097('0xac')](_0x3ac853,_0x17e130)[_0x2097('0xdf')](path[_0x2097('0xc0')](_0x568d23,_0x2097('0xe0')+_0x2bbc95['id']+'-'+_0x4c3631+_0x2097('0xe1')),function(_0x39cf0a,_0x612c1){if(_0x39cf0a)return _0x308409(_0x39cf0a);_0x3636bb(_0x612c1);});});});}})['then'](function(){if(_0x429eb7){return new BPromise(function(_0x41fae6,_0x4e1024){zipdir(_0x568d23,{'saveTo':_0x514858},function(_0x26c490,_0x14aefc){if(_0x26c490)return _0x4e1024(_0x26c490);return _0x41fae6(_0x14aefc);});})['then'](function(){return new BPromise(function(_0x48a53b,_0x1227da){rimraf(_0x568d23,function(_0x4a4ae9){if(_0x4a4ae9)_0x1227da(_0x4a4ae9);return _0x48a53b();});});})[_0x2097('0x29')](function(){return _0x3b6cab[_0x2097('0xbe')](_0x514858,_0x11d90e,function(_0x7befda){if(_0x7befda){console[_0x2097('0xe2')](_0x2097('0xe3'),_0x7befda);}else{fs[_0x2097('0xe4')](_0x514858);}});});}else{return _0x3b6cab['sendStatus'](0xc8);}})[_0x2097('0x34')](handleError(_0x3b6cab,null));}; \ No newline at end of file +var _0xfcbb=['findOne','setTags','spread','findAll','color','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Messages','direction','secret','fullname','firstName','lastName','SmsAccount','Account','Owner','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','%s\x20#%d','Sms','format','YYYY-MM-DD','N.A.','createdAt','YYYY-MM-DD\x20HH:mm:ss','closed','out','System','downloadInteraction.html','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','name','send','Users','map','TagIds','Tags','split','push','index','SmsInteraction','rawAttributes','fieldName','type','keys','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','ui.SmsInteractionId','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','ContactId','buildExpression','text','start','Tag','union','User','$substring','UserId','body','some','compact','isEmpty','SmsAccountId','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','forEach','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','a.key','Account.key','a.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','Contact.fax','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','catch','show','includeAll','include','merge','options','create','params','describe','addMessage','SmsMessage','ids','omit','getMessages'];(function(_0x567b23,_0x14ff97){var _0x512c72=function(_0x14eade){while(--_0x14eade){_0x567b23['push'](_0x567b23['shift']());}};_0x512c72(++_0x14ff97);}(_0xfcbb,0x10d));var _0xbfcb=function(_0x52a04c,_0x44bd27){_0x52a04c=_0x52a04c-0x0;var _0x2f94d1=_0xfcbb[_0x52a04c];return _0x2f94d1;};'use strict';var pdf=require(_0xbfcb('0x0'));var emlformat=require(_0xbfcb('0x1'));var rimraf=require(_0xbfcb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbfcb('0x3'));var moment=require(_0xbfcb('0x4'));var BPromise=require(_0xbfcb('0x5'));var Mustache=require(_0xbfcb('0x6'));var util=require(_0xbfcb('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xbfcb('0x8'));var ejs=require(_0xbfcb('0x9'));var fs=require('fs');var _=require(_0xbfcb('0xa'));var squel=require(_0xbfcb('0xb'));var crypto=require(_0xbfcb('0xc'));var jsforce=require(_0xbfcb('0xd'));var deskjs=require(_0xbfcb('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbfcb('0xf'));var Papa=require(_0xbfcb('0x10'));var Redis=require(_0xbfcb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xbfcb('0x12'));var as=require(_0xbfcb('0x13'));var hardwareService=require(_0xbfcb('0x14'));var logger=require(_0xbfcb('0x15'))(_0xbfcb('0x16'));var utils=require(_0xbfcb('0x17'));var config=require('../../config/environment');var db=require(_0xbfcb('0x18'))['db'];config[_0xbfcb('0x19')]=_[_0xbfcb('0x1a')](config[_0xbfcb('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xbfcb('0x1b'))(new Redis(config['redis']));require(_0xbfcb('0x1c'))[_0xbfcb('0x1d')](socket);function respondWithStatusCode(_0x44ad6c,_0x1047c4){_0x1047c4=_0x1047c4||0xcc;return function(_0x2074d4){if(_0x2074d4){return _0x44ad6c[_0xbfcb('0x1e')](_0x1047c4);}return _0x44ad6c[_0xbfcb('0x1f')](_0x1047c4)[_0xbfcb('0x20')]();};}function respondWithResult(_0x90ed8c,_0x339347){_0x339347=_0x339347||0xc8;return function(_0x2c4a85){if(_0x2c4a85){return _0x90ed8c[_0xbfcb('0x1f')](_0x339347)[_0xbfcb('0x21')](_0x2c4a85);}};}function respondWithFilteredResult(_0x41dc15,_0x318d07){return function(_0x1a4d75){if(_0x1a4d75){var _0xba1d6=_0x1a4d75[_0xbfcb('0x22')],_0x38689e=_0x318d07[_0xbfcb('0x23')],_0x3404aa=_0x318d07['offset']+_0x318d07[_0xbfcb('0x24')],_0x46b8d2;if(_0x3404aa>=_0xba1d6){_0x3404aa=_0xba1d6;_0x46b8d2=0xc8;}else{_0x46b8d2=0xce;}_0x41dc15[_0xbfcb('0x1f')](_0x46b8d2);return _0x41dc15['set'](_0xbfcb('0x25'),_0x38689e+'-'+_0x3404aa+'/'+_0xba1d6)[_0xbfcb('0x21')](_0x1a4d75);}return null;};}function patchUpdates(_0x48c3c8){return function(_0x58f16b){try{jsonpatch[_0xbfcb('0x26')](_0x58f16b,_0x48c3c8,!![]);}catch(_0x45f0a0){return BPromise[_0xbfcb('0x27')](_0x45f0a0);}return _0x58f16b[_0xbfcb('0x28')]();};}function saveUpdates(_0x1c5924,_0x56c158){return function(_0x365d6c){if(_0x365d6c){return _0x365d6c[_0xbfcb('0x29')](_0x1c5924)[_0xbfcb('0x2a')](function(_0xd4d29){return _0xd4d29;});}return null;};}function removeEntity(_0x1651e5,_0x19616c){return function(_0x69c8e9){if(_0x69c8e9){return _0x69c8e9[_0xbfcb('0x2b')]()[_0xbfcb('0x2a')](function(){_0x1651e5[_0xbfcb('0x1f')](0xcc)[_0xbfcb('0x20')]();});}};}function handleEntityNotFound(_0xf6dbb7,_0x3ef71c){return function(_0x121a90){if(!_0x121a90){_0xf6dbb7[_0xbfcb('0x1e')](0x194);}return _0x121a90;};}function handleError(_0x2a1272,_0x5cd703){_0x5cd703=_0x5cd703||0x1f4;return function(_0x3465f5){logger[_0xbfcb('0x2c')](_0x3465f5['stack']);if(_0x3465f5[_0xbfcb('0x2d')]){delete _0x3465f5[_0xbfcb('0x2d')];}_0x2a1272[_0xbfcb('0x1f')](_0x5cd703)[_0xbfcb('0x2e')](_0x3465f5);};}function getInteractionUsers(_0xf4b944,_0x3542e9){return new BPromise(function(_0x4069a7,_0x1a5db2){try{if(_0x3542e9[_0xf4b944['id']]){_0xf4b944[_0xbfcb('0x2f')]=_[_0xbfcb('0x30')](_0x3542e9[_0xf4b944['id']],function(_0x59719b){return{'id':_0x59719b['id']};});}}catch(_0x17cd0e){_0x1a5db2(_0x17cd0e);}_0x4069a7(_0xf4b944);});}function getInteractionTags(_0x3aa3cd,_0x43c3c3){return new BPromise(function(_0x43de3c,_0x1f45fc){try{if(_0x3aa3cd[_0xbfcb('0x31')]){_0x3aa3cd[_0xbfcb('0x32')]=[];_0x3aa3cd[_0xbfcb('0x31')][_0xbfcb('0x33')](',')['forEach'](function(_0x297f72){_0x3aa3cd[_0xbfcb('0x32')][_0xbfcb('0x34')](_0x43c3c3[_0x297f72]);});}delete _0x3aa3cd[_0xbfcb('0x31')];}catch(_0x5d02f7){_0x1f45fc(_0x5d02f7);}_0x43de3c(_0x3aa3cd);});}function updateSmsInteraction(_0x5aa2dd,_0x30cf97,_0x35925b){return new BPromise(function(_0x1d523d,_0x1b2fa5){return getInteractionUsers(_0x5aa2dd,_0x35925b)[_0xbfcb('0x2a')](function(_0x24f2a6){return getInteractionTags(_0x24f2a6,_0x30cf97);})[_0xbfcb('0x2a')](function(_0x5d39c4){_0x1d523d(_0x5d39c4);})['catch'](function(_0x5243ee){_0x1b2fa5(_0x5243ee);});});}exports[_0xbfcb('0x35')]=function(_0x552a22,_0xda9f61){var _0x410948={},_0x505b0d={},_0x49c295={'count':0x0,'rows':[]};var _0x935af=_[_0xbfcb('0x30')](db[_0xbfcb('0x36')][_0xbfcb('0x37')],function(_0x530208){return{'name':_0x530208[_0xbfcb('0x38')],'type':_0x530208[_0xbfcb('0x39')]['key']};});_0x505b0d['model']=_[_0xbfcb('0x30')](_0x935af,'name');_0x505b0d['query']=_[_0xbfcb('0x3a')](_0x552a22[_0xbfcb('0x3b')]);_0x505b0d[_0xbfcb('0x3c')]=_[_0xbfcb('0x3d')](_0x505b0d['model'],_0x505b0d[_0xbfcb('0x3b')]);_0x410948[_0xbfcb('0x3e')]=_[_0xbfcb('0x3d')](_0x505b0d[_0xbfcb('0x3f')],qs[_0xbfcb('0x40')](_0x552a22[_0xbfcb('0x3b')]['fields']));_0x410948[_0xbfcb('0x3e')]=_0x410948['attributes'][_0xbfcb('0x41')]?_0x410948['attributes']:_0x505b0d[_0xbfcb('0x3f')];if(!_0x552a22[_0xbfcb('0x3b')][_0xbfcb('0x42')](_0xbfcb('0x43'))){_0x410948[_0xbfcb('0x24')]=qs[_0xbfcb('0x24')](_0x552a22[_0xbfcb('0x3b')][_0xbfcb('0x24')]);_0x410948[_0xbfcb('0x23')]=qs[_0xbfcb('0x23')](_0x552a22['query'][_0xbfcb('0x23')]);}_0x410948[_0xbfcb('0x44')]=qs['sort'](_0x552a22[_0xbfcb('0x3b')][_0xbfcb('0x45')]);_0x410948[_0xbfcb('0x46')]=qs[_0xbfcb('0x3c')](_[_0xbfcb('0x47')](_0x552a22[_0xbfcb('0x3b')],_0x505b0d['filters']));var _0x96691c=[];var _0x10ffa0=squel[_0xbfcb('0x48')]()['field']('id')[_0xbfcb('0x49')](_0xbfcb('0x2d'))[_0xbfcb('0x49')]('color')[_0xbfcb('0x4a')](_0xbfcb('0x4b'));var _0x58337d=squel['select']()[_0xbfcb('0x49')](_0xbfcb('0x4c'))['field'](_0xbfcb('0x4d'))[_0xbfcb('0x4a')]('user_has_sms_interactions','ui')[_0xbfcb('0x4e')](_0xbfcb('0x4f'),'u',_0xbfcb('0x50'));var _0xe12739=squel[_0xbfcb('0x48')]()[_0xbfcb('0x4a')](_0xbfcb('0x51'),'i')[_0xbfcb('0x4e')](_0xbfcb('0x52'),'c',_0xbfcb('0x53'))[_0xbfcb('0x4e')](_0xbfcb('0x4f'),'o','o.id\x20=\x20i.UserId')[_0xbfcb('0x4e')](_0xbfcb('0x54'),'a',_0xbfcb('0x55'))['left_join'](_0xbfcb('0x56'),'me','me.SmsInteractionId\x20=\x20i.id')['left_join'](_0xbfcb('0x57'),'it',_0xbfcb('0x58'))[_0xbfcb('0x4e')]('tools_tags','t',_0xbfcb('0x59'));var _0x4aa1dd=squel['expr']();var _0x33725a=[];var _0x588d32=squel[_0xbfcb('0x5a')]();var _0x7afcba;if(_0x552a22['query'][_0xbfcb('0x5b')]){_0x7afcba=as['parseSearch'](_0x552a22[_0xbfcb('0x3b')]['search']);var _0x61b146=_0x7afcba['sqlOperator'];for(var _0x238d74=0x0;_0x238d74<_0x7afcba[_0xbfcb('0x5c')]['length'];_0x238d74++){var _0x131af7=_0x7afcba['conditions'][_0x238d74];var _0x4c7867='i';var _0x3b8683=_[_0xbfcb('0x5d')](_0x935af,[_0xbfcb('0x2d'),_0x131af7['field']]);if(!_0x3b8683){switch(_0x131af7['field']){case _0xbfcb('0x5e'):if(_0x131af7[_0xbfcb('0x5f')]==0x1){_0xe12739[_0xbfcb('0x60')]('`'+_0x131af7[_0xbfcb('0x49')]+_0xbfcb('0x61'));}else{_0xe12739['having']('`'+_0x131af7[_0xbfcb('0x49')]+_0xbfcb('0x62'));}break;case _0xbfcb('0x63'):if(_0x131af7[_0xbfcb('0x64')]==='$substring'){if(_0x131af7['value'][_0xbfcb('0x33')]('\x20')['length']>0x1){_0x4aa1dd[_0x61b146](_0xbfcb('0x65'),qs['getFullTextValue'](_0x131af7['value']),null);}else{var _0x466b40='%'+_0x131af7['value']+'%';_0x4aa1dd[_0x61b146]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x466b40,_0x466b40,_0x466b40);}}else{_0x3b8683=_[_0xbfcb('0x5d')](_0x935af,['name',_0xbfcb('0x66')]);_0x131af7['field']=_0xbfcb('0x66');_0x2b9a96=as[_0xbfcb('0x67')](_0x4c7867,_0x3b8683['type'],_0x131af7);_0x4aa1dd[_0x61b146](_0x2b9a96[_0xbfcb('0x68')],_0x2b9a96[_0xbfcb('0x5f')][_0xbfcb('0x69')],_0x2b9a96['value'][_0xbfcb('0x20')]);}break;case _0xbfcb('0x6a'):var _0x2534fe=_0x131af7[_0xbfcb('0x5f')][_0xbfcb('0x33')](',')[_0xbfcb('0x30')](function(_0x338222){return Number(_0x338222);});_0x2534fe['forEach'](function(_0x9c9b13){_0x588d32['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x9c9b13+',%');});_0x33725a=_[_0xbfcb('0x6b')](_0x33725a,_0x2534fe);break;case _0xbfcb('0x6c'):if(_0x131af7[_0xbfcb('0x64')]===_0xbfcb('0x6d')){_0x4aa1dd[_0x61b146]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0x131af7['value']+'%',null);}else{_0x3b8683=_[_0xbfcb('0x5d')](_0x935af,['name',_0xbfcb('0x6e')]);_0x131af7[_0xbfcb('0x49')]=_0xbfcb('0x6e');_0x2b9a96=as[_0xbfcb('0x67')](_0x4c7867,_0x3b8683[_0xbfcb('0x39')],_0x131af7);_0x4aa1dd[_0x61b146](_0x2b9a96[_0xbfcb('0x68')],_0x2b9a96['value'][_0xbfcb('0x69')],_0x2b9a96[_0xbfcb('0x5f')][_0xbfcb('0x20')]);}break;case _0xbfcb('0x6f'):_0x2b9a96=as[_0xbfcb('0x67')]('me',null,_0x131af7);_0x4aa1dd[_0x61b146](_0x2b9a96[_0xbfcb('0x68')],_0x2b9a96[_0xbfcb('0x5f')]['start'],_0x2b9a96['value']['end']);break;}}else{var _0x2b9a96=as[_0xbfcb('0x67')](_0x4c7867,_0x3b8683[_0xbfcb('0x39')],_0x131af7);_0x4aa1dd[_0x61b146](_0x2b9a96['text'],_0x2b9a96[_0xbfcb('0x5f')][_0xbfcb('0x69')],_0x2b9a96[_0xbfcb('0x5f')]['end']);}}}else{var _0x547d26=_(_0x552a22['query'])[_0xbfcb('0x3a')]()[_0xbfcb('0x30')](function(_0x13dc5e){return _[_0xbfcb('0x70')](_0x935af,['name',_0x13dc5e])?_0x13dc5e:undefined;})[_0xbfcb('0x71')]()[_0xbfcb('0x5f')]();if(!_[_0xbfcb('0x72')](_0x547d26)){_0x547d26['forEach'](function(_0x4bf71a){if(_0x4bf71a===_0xbfcb('0x73')){_0xe12739[_0xbfcb('0x46')]('i.SmsAccountId\x20IN\x20?',[]['concat'](_0x552a22['query'][_0x4bf71a]));}else if(_0x4bf71a==='createdAt'){var _0x1866f5=JSON[_0xbfcb('0x74')](_0x552a22[_0xbfcb('0x3b')][_0x4bf71a])[_0xbfcb('0x75')];var _0x3f4e1f=JSON[_0xbfcb('0x74')](_0x552a22[_0xbfcb('0x3b')][_0x4bf71a])[_0xbfcb('0x76')];_0xe12739['where'](_0xbfcb('0x77'),_0x1866f5,_0x3f4e1f);}else{if(_0x552a22[_0xbfcb('0x3b')][_0x4bf71a]===_0xbfcb('0x78')){_0xe12739[_0xbfcb('0x46')]('i.'+_0x4bf71a+_0xbfcb('0x79'));}else{_0xe12739[_0xbfcb('0x46')]('i.'+_0x4bf71a+_0xbfcb('0x7a'),_0x552a22[_0xbfcb('0x3b')][_0x4bf71a]);}}});}if(_0x552a22['query'][_0xbfcb('0x7b')]){if(_0x552a22['query'][_0xbfcb('0x7b')]==0x1){_0xe12739[_0xbfcb('0x60')](_0xbfcb('0x7c'));}else{_0xe12739[_0xbfcb('0x60')](_0xbfcb('0x7d'));}}if(_0x552a22['query'][_0xbfcb('0x7e')]){_0x33725a=_[_0xbfcb('0x7f')](_0x552a22[_0xbfcb('0x3b')][_0xbfcb('0x7e')])?_0x552a22[_0xbfcb('0x3b')]['tag']:new Array(_0x552a22[_0xbfcb('0x3b')][_0xbfcb('0x7e')]);_0x33725a[_0xbfcb('0x80')](function(_0x25abf3){_0x588d32['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x25abf3+',%');});}if(_0x552a22['query'][_0xbfcb('0x81')]){var _0x15b4e3=_0x552a22[_0xbfcb('0x3b')][_0xbfcb('0x81')][_0xbfcb('0x82')]('\x5c','\x5c\x5c')[_0xbfcb('0x82')]('\x27\x27',_0xbfcb('0x83'));if(qs[_0xbfcb('0x84')](_0x15b4e3)){_0x4aa1dd['or'](_0xbfcb('0x85'),_0x15b4e3+'%')['or'](_0xbfcb('0x86'),_0x15b4e3+'%');}else{_0x4aa1dd['or'](_0xbfcb('0x87'),qs[_0xbfcb('0x88')](_0x15b4e3))['or'](_0xbfcb('0x89'),_0x15b4e3+'%');}}}_0xe12739[_0xbfcb('0x46')](_0x4aa1dd);_0xe12739['group'](_0xbfcb('0x8a'));var _0x4d62ff={'type':db[_0xbfcb('0x8b')][_0xbfcb('0x8c')]['SELECT'],'raw':!![]};var _0xe539ce=_0xe12739[_0xbfcb('0x8d')]();_0xe539ce[_0xbfcb('0x49')](_0xbfcb('0x8a'));_0xe539ce['field'](_0xbfcb('0x8e'),'unreadMessages');if(_0x410948[_0xbfcb('0x44')]){_0x410948[_0xbfcb('0x44')]['forEach'](function(_0x5db930){_0xe12739[_0xbfcb('0x44')]('i.'+_0x5db930[0x0],_0x5db930[0x1]===_0xbfcb('0x8f')?![]:!![]);});}if(!_[_0xbfcb('0x72')](_0x33725a)){_0xe12739[_0xbfcb('0x60')](_0x588d32);_0xe539ce[_0xbfcb('0x46')]('t.id\x20IN\x20?',_0x33725a);}BPromise['resolve']()[_0xbfcb('0x2a')](function(){if(!_0x7afcba&&_0x552a22['query']['SmsAccountId'])return;return _0x552a22[_0xbfcb('0x90')][_0xbfcb('0x91')]({'attributes':['id'],'raw':!![]})['then'](function(_0x46d6a8){if(_[_0xbfcb('0x72')](_0x46d6a8)){_0xe539ce['where'](_0xbfcb('0x92'));_0xe12739[_0xbfcb('0x46')](_0xbfcb('0x92'));}else{_0xe539ce[_0xbfcb('0x46')]('i.SmsAccountId\x20IN\x20?',_[_0xbfcb('0x30')](_0x46d6a8,'id'));_0xe12739[_0xbfcb('0x46')](_0xbfcb('0x93'),_[_0xbfcb('0x30')](_0x46d6a8,'id'));}});})[_0xbfcb('0x2a')](function(){db[_0xbfcb('0x94')]['query'](_0xe539ce[_0xbfcb('0x95')](),_0x4d62ff)[_0xbfcb('0x2a')](function(_0x3d677a){_0x49c295[_0xbfcb('0x22')]=_0x3d677a[_0xbfcb('0x41')];if(_0x49c295[_0xbfcb('0x22')]===0x0)return[];return db[_0xbfcb('0x94')][_0xbfcb('0x3b')](_0x10ffa0[_0xbfcb('0x95')](),_0x4d62ff)[_0xbfcb('0x2a')](function(_0x3e9934){_0x96691c=_[_0xbfcb('0x96')](_0x3e9934,'id');_0x4d62ff=_['merge'](_0x4d62ff,{'model':db['SmsInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});_0xe12739[_0xbfcb('0x49')](_0xbfcb('0x8e'),_0xbfcb('0x5e'));_0xe12739[_0xbfcb('0x49')](_0xbfcb('0x97'),_0xbfcb('0x98'));_0xe12739[_0xbfcb('0x49')](_0xbfcb('0x99'),'Account.mandatoryDisposition');_0xe12739[_0xbfcb('0x49')](_0xbfcb('0x9a'));_0xe12739[_0xbfcb('0x49')](_0xbfcb('0x9b'),_0xbfcb('0x9c'));_0xe12739['field'](_0xbfcb('0x9d'),'Contact.lastName');_0xe12739[_0xbfcb('0x49')](_0xbfcb('0x9e'),'Contact.email');_0xe12739['field'](_0xbfcb('0x9f'),_0xbfcb('0xa0'));_0xe12739[_0xbfcb('0x49')](_0xbfcb('0xa1'),_0xbfcb('0xa2'));_0xe12739[_0xbfcb('0x49')]('c.fax',_0xbfcb('0xa3'));_0xe12739[_0xbfcb('0x49')](_0xbfcb('0xa4'),_0xbfcb('0x31'));_0xe12739[_0xbfcb('0x24')](_0x410948[_0xbfcb('0x24')]);_0xe12739[_0xbfcb('0x23')](_0x410948[_0xbfcb('0x23')]);return db['sequelize'][_0xbfcb('0x3b')](_0xe12739[_0xbfcb('0x95')](),_0x4d62ff);})['then'](function(_0x5ec7d8){_0x58337d[_0xbfcb('0x46')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x5ec7d8,'id'));return db[_0xbfcb('0x94')]['query'](_0x58337d[_0xbfcb('0x95')](),_0x4d62ff)[_0xbfcb('0x2a')](function(_0x3df56c){var _0x4f3145=_[_0xbfcb('0xa5')](_0x3df56c,_0xbfcb('0xa6'));var _0x169830=[];_0x5ec7d8['forEach'](function(_0x5674bf){_0x169830[_0xbfcb('0x34')](updateSmsInteraction(_0x5674bf,_0x96691c,_0x4f3145));});return BPromise[_0xbfcb('0xa7')](_0x169830);});});})[_0xbfcb('0x2a')](function(_0x4fd470){_0x49c295[_0xbfcb('0xa8')]=_0x4fd470;return _0x49c295;})['then'](respondWithFilteredResult(_0xda9f61,_0x410948));})[_0xbfcb('0xa9')](handleError(_0xda9f61,null));};exports[_0xbfcb('0xaa')]=function(_0x50dddb,_0x1f0e28){var _0x6e7287={'raw':![],'where':{'id':_0x50dddb['params']['id']}},_0x36d34e={};_0x36d34e[_0xbfcb('0x3f')]=_['keys'](db[_0xbfcb('0x36')][_0xbfcb('0x37')]);_0x36d34e[_0xbfcb('0x3b')]=_[_0xbfcb('0x3a')](_0x50dddb[_0xbfcb('0x3b')]);_0x36d34e['filters']=_[_0xbfcb('0x3d')](_0x36d34e[_0xbfcb('0x3f')],_0x36d34e['query']);_0x6e7287[_0xbfcb('0x3e')]=_['intersection'](_0x36d34e['model'],qs[_0xbfcb('0x40')](_0x50dddb[_0xbfcb('0x3b')]['fields']));_0x6e7287[_0xbfcb('0x3e')]=_0x6e7287[_0xbfcb('0x3e')][_0xbfcb('0x41')]?_0x6e7287[_0xbfcb('0x3e')]:_0x36d34e[_0xbfcb('0x3f')];if(_0x50dddb['query'][_0xbfcb('0xab')]){_0x6e7287[_0xbfcb('0xac')]=[{'all':!![]}];}_0x6e7287=_[_0xbfcb('0xad')]({},_0x6e7287,_0x50dddb[_0xbfcb('0xae')]);return db[_0xbfcb('0x36')][_0xbfcb('0x5d')](_0x6e7287)[_0xbfcb('0x2a')](handleEntityNotFound(_0x1f0e28,null))[_0xbfcb('0x2a')](respondWithResult(_0x1f0e28,null))[_0xbfcb('0xa9')](handleError(_0x1f0e28,null));};exports[_0xbfcb('0xaf')]=function(_0x3796e8,_0x103020){return db[_0xbfcb('0x36')]['create'](_0x3796e8[_0xbfcb('0x6f')],{})[_0xbfcb('0x2a')](respondWithResult(_0x103020,0xc9))[_0xbfcb('0xa9')](handleError(_0x103020,null));};exports[_0xbfcb('0x29')]=function(_0xa411de,_0x3f66af){if(_0xa411de[_0xbfcb('0x6f')]['id']){delete _0xa411de[_0xbfcb('0x6f')]['id'];}return db[_0xbfcb('0x36')]['find']({'where':{'id':_0xa411de['params']['id']}})[_0xbfcb('0x2a')](handleEntityNotFound(_0x3f66af,null))['then'](saveUpdates(_0xa411de[_0xbfcb('0x6f')],null))['then'](respondWithResult(_0x3f66af,null))['catch'](handleError(_0x3f66af,null));};exports[_0xbfcb('0x2b')]=function(_0x4931a8,_0x74ecaa){return db['SmsInteraction'][_0xbfcb('0x5d')]({'where':{'id':_0x4931a8[_0xbfcb('0xb0')]['id']}})['then'](handleEntityNotFound(_0x74ecaa,null))[_0xbfcb('0x2a')](removeEntity(_0x74ecaa,null))[_0xbfcb('0xa9')](handleError(_0x74ecaa,null));};exports[_0xbfcb('0xb1')]=function(_0x324927,_0x40bda8){return db[_0xbfcb('0x36')][_0xbfcb('0xb1')]()[_0xbfcb('0x2a')](respondWithResult(_0x40bda8,null))[_0xbfcb('0xa9')](handleError(_0x40bda8,null));};exports[_0xbfcb('0xb2')]=function(_0x1e6041,_0x2aafe7,_0x413408){return db[_0xbfcb('0xb3')][_0xbfcb('0x5d')]({'where':{'id':_0x1e6041[_0xbfcb('0xb0')]['id']}})[_0xbfcb('0x2a')](handleEntityNotFound(_0x2aafe7,null))[_0xbfcb('0x2a')](function(_0x557d6d){if(_0x557d6d){return _0x557d6d[_0xbfcb('0xb2')](_0x1e6041['body'][_0xbfcb('0xb4')],_[_0xbfcb('0xb5')](_0x1e6041['body'],[_0xbfcb('0xb4'),'id'])||{});}})[_0xbfcb('0x2a')](respondWithResult(_0x2aafe7,null))[_0xbfcb('0xa9')](handleError(_0x2aafe7,null));};exports[_0xbfcb('0xb6')]=function(_0x5b64d8,_0x3c47a3,_0x2c6287){var _0x4a1792={'raw':![],'where':{}};var _0xcc1771={};var _0x46a30d={'count':0x0,'rows':[]};return db[_0xbfcb('0x36')][_0xbfcb('0xb7')]({'where':{'id':_0x5b64d8['params']['id']}})[_0xbfcb('0x2a')](handleEntityNotFound(_0x3c47a3,null))['then'](function(_0x9e7a65){if(_0x9e7a65){_0xcc1771[_0xbfcb('0x3f')]=_['keys'](db[_0xbfcb('0xb3')][_0xbfcb('0x37')]);_0xcc1771['query']=_[_0xbfcb('0x3a')](_0x5b64d8['query']);_0xcc1771['filters']=_[_0xbfcb('0x3d')](_0xcc1771[_0xbfcb('0x3f')],_0xcc1771[_0xbfcb('0x3b')]);_0x4a1792['attributes']=_[_0xbfcb('0x3d')](_0xcc1771[_0xbfcb('0x3f')],qs[_0xbfcb('0x40')](_0x5b64d8[_0xbfcb('0x3b')]['fields']));_0x4a1792['attributes']=_0x4a1792[_0xbfcb('0x3e')]['length']?_0x4a1792[_0xbfcb('0x3e')]:_0xcc1771[_0xbfcb('0x3f')];if(!_0x5b64d8[_0xbfcb('0x3b')][_0xbfcb('0x42')]('nolimit')){_0x4a1792[_0xbfcb('0x24')]=qs['limit'](_0x5b64d8[_0xbfcb('0x3b')]['limit']);_0x4a1792[_0xbfcb('0x23')]=qs['offset'](_0x5b64d8[_0xbfcb('0x3b')]['offset']);}_0x4a1792[_0xbfcb('0x44')]=qs['sort'](_0x5b64d8['query'][_0xbfcb('0x45')]);_0x4a1792[_0xbfcb('0x46')]=qs['filters'](_[_0xbfcb('0x47')](_0x5b64d8[_0xbfcb('0x3b')],_0xcc1771[_0xbfcb('0x3c')]));_0x4a1792[_0xbfcb('0x46')][_0xbfcb('0xa6')]=_0x9e7a65['id'];if(_0x5b64d8[_0xbfcb('0x3b')][_0xbfcb('0x81')]){_0x4a1792[_0xbfcb('0x46')]=_[_0xbfcb('0xad')](_0x4a1792[_0xbfcb('0x46')],{'$or':_[_0xbfcb('0x30')](_0x4a1792[_0xbfcb('0x3e')],function(_0x4ed66b){var _0x377982={};_0x377982[_0x4ed66b]={'$like':'%'+_0x5b64d8['query'][_0xbfcb('0x81')]+'%'};return _0x377982;})});}if(_0x5b64d8[_0xbfcb('0x3b')][_0xbfcb('0x75')]){var _0x5a28c2=_0x5b64d8[_0xbfcb('0x3b')][_0xbfcb('0x75')]['split'](',');var _0x4db416={};_0x4db416[_0x5a28c2[0x0]]={'$gte':moment(_0x5a28c2[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x4a1792[_0xbfcb('0x46')]=_['merge'](_0x4a1792[_0xbfcb('0x46')],_0x4db416);}_0x4a1792=_[_0xbfcb('0xad')]({},_0x4a1792,_0x5b64d8[_0xbfcb('0xae')]);return db[_0xbfcb('0xb3')][_0xbfcb('0x22')]({'where':_0x4a1792[_0xbfcb('0x46')]})[_0xbfcb('0x2a')](function(_0x295f8d){_0x46a30d[_0xbfcb('0x22')]=_0x295f8d;if(_0x5b64d8[_0xbfcb('0x3b')]['includeAll']){_0x4a1792[_0xbfcb('0xac')]=[{'all':!![]}];}return db[_0xbfcb('0xb3')]['findAll'](_0x4a1792);})[_0xbfcb('0x2a')](function(_0x36c0f3){_0x46a30d[_0xbfcb('0xa8')]=_0x36c0f3;return _0x46a30d;});}})[_0xbfcb('0x2a')](respondWithFilteredResult(_0x3c47a3,_0x4a1792))[_0xbfcb('0xa9')](handleError(_0x3c47a3,null));};exports['addTags']=function(_0x448e9d,_0x444208,_0x33135c){return db[_0xbfcb('0x36')]['find']({'where':{'id':_0x448e9d[_0xbfcb('0xb0')]['id']}})[_0xbfcb('0x2a')](handleEntityNotFound(_0x444208,null))['then'](function(_0x236080){if(_0x236080){return _0x236080[_0xbfcb('0xb8')](_0x448e9d[_0xbfcb('0x6f')]['ids'],_[_0xbfcb('0xb5')](_0x448e9d[_0xbfcb('0x6f')],[_0xbfcb('0xb4'),'id'])||{})[_0xbfcb('0xb9')](function(){return db[_0xbfcb('0x6a')][_0xbfcb('0xba')]({'attributes':['id',_0xbfcb('0x2d'),_0xbfcb('0xbb')],'where':{'id':_0x448e9d[_0xbfcb('0x6f')][_0xbfcb('0xb4')]}});})[_0xbfcb('0x2a')](function(_0x103756){socket[_0xbfcb('0xbc')](_0xbfcb('0xbd'),{'id':Number(_0x448e9d[_0xbfcb('0xb0')]['id']),'tags':_0x103756||[]});return{'id':Number(_0x448e9d['params']['id']),'tags':_0x103756||[]};});}})[_0xbfcb('0x2a')](respondWithResult(_0x444208,null))[_0xbfcb('0xa9')](handleError(_0x444208,null));};exports[_0xbfcb('0xbe')]=function(_0x3968d1,_0x48efbd,_0x1dedcf){return db[_0xbfcb('0x36')][_0xbfcb('0x5d')]({'where':{'id':_0x3968d1['params']['id']}})[_0xbfcb('0x2a')](handleEntityNotFound(_0x48efbd,null))['then'](function(_0x1310f4){if(_0x1310f4){return _0x1310f4[_0xbfcb('0xbe')](_0x3968d1[_0xbfcb('0x3b')][_0xbfcb('0xb4')]);}})[_0xbfcb('0x2a')](respondWithStatusCode(_0x48efbd,null))[_0xbfcb('0xa9')](handleError(_0x48efbd,null));};exports[_0xbfcb('0xbf')]=function(_0x2061a0,_0x3cc961){var _0x5dfff2=moment()[_0xbfcb('0xc0')]()[_0xbfcb('0x95')]();var _0x1ea2a1=path[_0xbfcb('0xc1')](config[_0xbfcb('0xc2')],_0xbfcb('0xc3'),'files','tmp');var _0x26aab2=path[_0xbfcb('0xc1')](config[_0xbfcb('0xc2')],_0xbfcb('0xc3'),_0xbfcb('0xc4'),_0xbfcb('0xc5'));var _0xd678b7=path[_0xbfcb('0xc1')](_0x1ea2a1,_0x5dfff2);var _0x52f5c8=util['format'](_0xbfcb('0xc6'),_0x2061a0[_0xbfcb('0xb0')]['id'],_0x5dfff2);var _0x17a4c9=path[_0xbfcb('0xc1')](_0x1ea2a1,_0x52f5c8);var _0x44c6d9=![];return db[_0xbfcb('0x36')][_0xbfcb('0x5d')]({'where':{'id':_0x2061a0[_0xbfcb('0xb0')]['id']},'include':[{'model':db['SmsMessage'],'as':_0xbfcb('0xc7'),'attributes':['id',_0xbfcb('0x6f'),'createdAt',_0xbfcb('0xc8'),_0xbfcb('0xc9'),_0xbfcb('0x7b')],'include':[{'model':db[_0xbfcb('0x6c')],'as':_0xbfcb('0x6c'),'attributes':['id',_0xbfcb('0xca')],'raw':!![]},{'model':db['CmContact'],'as':_0xbfcb('0x63'),'attributes':['id',_0xbfcb('0xcb'),_0xbfcb('0xcc')],'raw':!![]}]},{'model':db[_0xbfcb('0xcd')],'as':_0xbfcb('0xce'),'attributes':['id','name']},{'model':db[_0xbfcb('0x6c')],'as':_0xbfcb('0xcf'),'attributes':['id',_0xbfcb('0xca')]}]})[_0xbfcb('0x2a')](handleEntityNotFound(_0x3cc961,null))['then'](function(_0xceb14){if(_0xceb14){var _0x4a712a=_0xceb14[_0xbfcb('0xd0')]({'plain':!![]});_0x44c6d9=!![];var _0x39a4fe={'format':'A4','border':'10px','header':{'height':_0xbfcb('0xd1'),'contents':{'first':_0xbfcb('0xd2')}},'footer':{'height':'30px','contents':{'default':util['format']('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util['format'](_0xbfcb('0xd3'),_0xbfcb('0xd4'),_0x4a712a['id']),moment()[_0xbfcb('0xd5')](_0xbfcb('0xd6'))[_0xbfcb('0x95')]())}}};fs['mkdirSync'](_0xd678b7);var _0x24355b={'channel':_0xbfcb('0xd4'),'account':_0x4a712a[_0xbfcb('0xce')][_0xbfcb('0x2d')],'agent':_0x4a712a['Owner']?_0x4a712a['Owner'][_0xbfcb('0xca')]:_0xbfcb('0xd7'),'createdAt':moment(_0x4a712a[_0xbfcb('0xd8')])[_0xbfcb('0xd5')](_0xbfcb('0xd9'))[_0xbfcb('0x95')](),'closedAt':_0x4a712a[_0xbfcb('0xda')]?moment(_0x4a712a['closedAt'])[_0xbfcb('0xd5')](_0xbfcb('0xd9'))[_0xbfcb('0x95')]():'','disposition':_0x4a712a['disposition'],'messages':_(_0x4a712a[_0xbfcb('0xc7')])['filter']({'secret':![]})[_0xbfcb('0x30')](function(_0x4f5b86){return{'date':moment(_0x4f5b86['createdAt'])[_0xbfcb('0xd5')](_0xbfcb('0xd9'))[_0xbfcb('0x95')](),'sender':_0x4f5b86[_0xbfcb('0xc8')]===_0xbfcb('0xdb')?_0x4f5b86['User']?_0x4f5b86[_0xbfcb('0x6c')][_0xbfcb('0xca')]:_0xbfcb('0xdc'):_0x4f5b86[_0xbfcb('0x63')][_0xbfcb('0xcb')]+(_0x4f5b86['Contact']['lastName']?'\x20'+_0x4f5b86['Contact'][_0xbfcb('0xcc')]:''),'body':_0x4f5b86[_0xbfcb('0x6f')],'direction':_0x4f5b86[_0xbfcb('0xc8')]===_0xbfcb('0xdb')?'A':'C','secret':_0x4f5b86['secret'],'read':_0x4f5b86[_0xbfcb('0x7b')]};})[_0xbfcb('0x5f')]()};return ejs['renderFile'](path[_0xbfcb('0xc1')](config[_0xbfcb('0xc2')],_0xbfcb('0xc3'),'views',_0xbfcb('0xdd')),{'interaction':_0x24355b})[_0xbfcb('0x2a')](function(_0x130ca2){return new BPromise(function(_0xe9bd02,_0xc9932b){pdf['create'](_0x130ca2,_0x39a4fe)['toFile'](path[_0xbfcb('0xc1')](_0xd678b7,_0xbfcb('0xde')+_0x4a712a['id']+'-'+_0x5dfff2+'.pdf'),function(_0xee384d,_0x3619cb){if(_0xee384d)return _0xc9932b(_0xee384d);_0xe9bd02(_0x3619cb);});});});}})['then'](function(){if(_0x44c6d9){return new BPromise(function(_0x282bad,_0x55c91c){zipdir(_0xd678b7,{'saveTo':_0x17a4c9},function(_0x2032bf,_0x166b47){if(_0x2032bf)return _0x55c91c(_0x2032bf);return _0x282bad(_0x166b47);});})[_0xbfcb('0x2a')](function(){return new BPromise(function(_0x39515d,_0x1ee68d){rimraf(_0xd678b7,function(_0x565864){if(_0x565864)_0x1ee68d(_0x565864);return _0x39515d();});});})[_0xbfcb('0x2a')](function(){return _0x3cc961['download'](_0x17a4c9,_0x52f5c8,function(_0x55d5f9){if(_0x55d5f9){console[_0xbfcb('0xdf')](_0xbfcb('0xe0'),_0x55d5f9);}else{fs[_0xbfcb('0xe1')](_0x17a4c9);}});});}else{return _0x3cc961[_0xbfcb('0x1e')](0xc8);}})[_0xbfcb('0xa9')](handleError(_0x3cc961,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index f959029..1f13de9 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 _0x4074=['remove','getUsers','Users','map','setDataValue','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4074,0xf0));var _0x4407=function(_0x221bdb,_0x16094c){_0x221bdb=_0x221bdb-0x0;var _0x361b63=_0x4074[_0x221bdb];return _0x361b63;};'use strict';var EventEmitter=require(_0x4407('0x0'));var SmsInteraction=require(_0x4407('0x1'))['db'][_0x4407('0x2')];var SmsMessage=require('../../mysqldb')['db'][_0x4407('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x4407('0x4')](0x0);var events={'afterCreate':_0x4407('0x5'),'afterUpdate':_0x4407('0x6'),'afterDestroy':_0x4407('0x7')};function emitEvent(_0x3c9f5c){return function(_0x445548,_0x2495d2,_0x3f085d){_0x445548[_0x4407('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x988538){_0x445548['setDataValue'](_0x4407('0x9'),_0x988538[_0x4407('0xa')](function(_0x450cd4){return{'id':_0x450cd4['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x445548['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x59d74f){_0x445548[_0x4407('0xb')](_0x4407('0xc'),_0x59d74f[_0x4407('0xd')]);SmsInteractionEvents[_0x4407('0xe')](_0x3c9f5c+':'+_0x445548['id'],_0x445548);SmsInteractionEvents[_0x4407('0xe')](_0x3c9f5c,_0x445548);_0x3f085d(null);})[_0x4407('0xf')](_0x3f085d(null));};}for(var e in events){if(events[_0x4407('0x10')](e)){var event=events[e];SmsInteraction[_0x4407('0x11')](e,emitEvent(event));}}module[_0x4407('0x12')]=SmsInteractionEvents; \ No newline at end of file +var _0x7d9f=['emit','hook','exports','events','../../mysqldb','SmsInteraction','SmsMessage','save','update','remove','getUsers','then','setDataValue','Users','length'];(function(_0x19664d,_0x1edc60){var _0x4a912b=function(_0x1fbaf3){while(--_0x1fbaf3){_0x19664d['push'](_0x19664d['shift']());}};_0x4a912b(++_0x1edc60);}(_0x7d9f,0x15c));var _0xf7d9=function(_0x3861f7,_0x995b22){_0x3861f7=_0x3861f7-0x0;var _0x50879f=_0x7d9f[_0x3861f7];return _0x50879f;};'use strict';var EventEmitter=require(_0xf7d9('0x0'));var SmsInteraction=require(_0xf7d9('0x1'))['db'][_0xf7d9('0x2')];var SmsMessage=require(_0xf7d9('0x1'))['db'][_0xf7d9('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xf7d9('0x4'),'afterUpdate':_0xf7d9('0x5'),'afterDestroy':_0xf7d9('0x6')};function emitEvent(_0x159e95){return function(_0x23cb4c,_0x53fdaf,_0x4b50c7){_0x23cb4c[_0xf7d9('0x7')]({'attributes':['id'],'raw':!![]})[_0xf7d9('0x8')](function(_0x5772b4){_0x23cb4c[_0xf7d9('0x9')](_0xf7d9('0xa'),_0x5772b4['map'](function(_0x572d51){return{'id':_0x572d51['id']};}));return SmsMessage['findAll']({'where':{'SmsInteractionId':_0x23cb4c['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf7d9('0x8')](function(_0x33360a){_0x23cb4c['setDataValue']('unreadMessages',_0x33360a[_0xf7d9('0xb')]);SmsInteractionEvents[_0xf7d9('0xc')](_0x159e95+':'+_0x23cb4c['id'],_0x23cb4c);SmsInteractionEvents[_0xf7d9('0xc')](_0x159e95,_0x23cb4c);_0x4b50c7(null);})['catch'](_0x4b50c7(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsInteraction[_0xf7d9('0xd')](e,emitEvent(event));}}module[_0xf7d9('0xe')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index c305fa6..8505304 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 _0xa1ef=['closed','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','./smsInteraction.attributes','exports','define','SmsInteraction','sms_interactions','changed'];(function(_0x200d39,_0xd583ea){var _0x16cc16=function(_0x2f044a){while(--_0x2f044a){_0x200d39['push'](_0x200d39['shift']());}};_0x16cc16(++_0xd583ea);}(_0xa1ef,0x137));var _0xfa1e=function(_0x1f9773,_0x4365fb){_0x1f9773=_0x1f9773-0x0;var _0x3fc947=_0xa1ef[_0x1f9773];return _0x3fc947;};'use strict';var _=require(_0xfa1e('0x0'));var util=require(_0xfa1e('0x1'));var logger=require(_0xfa1e('0x2'))('api');var moment=require(_0xfa1e('0x3'));var BPromise=require(_0xfa1e('0x4'));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(_0xfa1e('0x5'));module[_0xfa1e('0x6')]=function(_0x2e4a48,_0x48652f){return _0x2e4a48[_0xfa1e('0x7')](_0xfa1e('0x8'),attributes,{'tableName':_0xfa1e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2910ca,_0x2146c6,_0x4027f8){if(_0x2910ca[_0xfa1e('0xa')](_0xfa1e('0xb'))){_0x2910ca['closedAt']=moment()[_0xfa1e('0xc')](_0xfa1e('0xd'));}_0x4027f8(null,_0x2910ca);}}});}; \ No newline at end of file +var _0x6057=['exports','define','SmsInteraction','sms_interactions','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','moment','bluebird','request-promise','rimraf','./smsInteraction.attributes'];(function(_0x2fb6fa,_0x447166){var _0x558b8a=function(_0x365641){while(--_0x365641){_0x2fb6fa['push'](_0x2fb6fa['shift']());}};_0x558b8a(++_0x447166);}(_0x6057,0x18d));var _0x7605=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0x6057[_0x49052b];return _0x48c045;};'use strict';var _=require(_0x7605('0x0'));var util=require(_0x7605('0x1'));var logger=require('../../config/logger')(_0x7605('0x2'));var moment=require(_0x7605('0x3'));var BPromise=require(_0x7605('0x4'));var rp=require(_0x7605('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x7605('0x6'));var config=require('../../config/environment');var attributes=require(_0x7605('0x7'));module[_0x7605('0x8')]=function(_0x3b5721,_0x2ba7ad){return _0x3b5721[_0x7605('0x9')](_0x7605('0xa'),attributes,{'tableName':_0x7605('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0xa98573,_0x53b840,_0x359b2e){if(_0xa98573['changed'](_0x7605('0xc'))){_0xa98573[_0x7605('0xd')]=moment()['format'](_0x7605('0xe'));}_0x359b2e(null,_0xa98573);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 9756ce6..811c384 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 _0xefb8=['request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','body','options','raw','where','attributes','limit','UpdateSmsInteraction','AddTagsToSmsInteraction','find','addTags','ids','omit','AddTags','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','localhost','register'];(function(_0x31428a,_0x38e3c1){var _0x29428f=function(_0x1454ee){while(--_0x1454ee){_0x31428a['push'](_0x31428a['shift']());}};_0x29428f(++_0x38e3c1);}(_0xefb8,0x159));var _0x8efb=function(_0x3002e2,_0x5c3d05){_0x3002e2=_0x3002e2-0x0;var _0x13c3aa=_0xefb8[_0x3002e2];return _0x13c3aa;};'use strict';var _=require(_0x8efb('0x0'));var util=require('util');var moment=require(_0x8efb('0x1'));var BPromise=require(_0x8efb('0x2'));var rs=require(_0x8efb('0x3'));var fs=require('fs');var Redis=require(_0x8efb('0x4'));var db=require(_0x8efb('0x5'))['db'];var utils=require(_0x8efb('0x6'));var logger=require(_0x8efb('0x7'))(_0x8efb('0x8'));var config=require('../../config/environment');var jayson=require(_0x8efb('0x9'));var client=jayson[_0x8efb('0xa')][_0x8efb('0xb')]({'port':0x232a});config[_0x8efb('0xc')]=_['defaults'](config[_0x8efb('0xc')],{'host':_0x8efb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8efb('0xc')]));require('./smsInteraction.socket')[_0x8efb('0xe')](socket);function respondWithRpcPromise(_0x595108,_0x46a764,_0x3f4573){return new BPromise(function(_0x263737,_0x528150){return client[_0x8efb('0xf')](_0x595108,_0x3f4573)[_0x8efb('0x10')](function(_0x4d3723){logger[_0x8efb('0x11')](_0x8efb('0x12'),_0x46a764,_0x8efb('0x13'));logger[_0x8efb('0x14')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x46a764,_0x8efb('0x13'),JSON[_0x8efb('0x15')](_0x4d3723));if(_0x4d3723[_0x8efb('0x16')]){if(_0x4d3723['error'][_0x8efb('0x17')]===0x1f4){logger[_0x8efb('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x46a764,_0x4d3723[_0x8efb('0x16')][_0x8efb('0x18')]);return _0x528150(_0x4d3723[_0x8efb('0x16')]['message']);}logger[_0x8efb('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x46a764,_0x4d3723[_0x8efb('0x16')]['message']);return _0x263737(_0x4d3723[_0x8efb('0x16')][_0x8efb('0x18')]);}else{logger[_0x8efb('0x11')](_0x8efb('0x12'),_0x46a764,'request\x20sent');_0x263737(_0x4d3723[_0x8efb('0x19')][_0x8efb('0x18')]);}})[_0x8efb('0x1a')](function(_0x11e031){logger[_0x8efb('0x16')](_0x8efb('0x12'),_0x46a764,_0x11e031);_0x528150(_0x11e031);});});}exports['UpdateSmsInteraction']=function(_0x141962){var _0x2a87ba=this;return new Promise(function(_0x13c8b7,_0x252987){return db['SmsInteraction']['update'](_0x141962[_0x8efb('0x1b')],{'raw':_0x141962[_0x8efb('0x1c')]?_0x141962[_0x8efb('0x1c')][_0x8efb('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x141962[_0x8efb('0x1c')]?_0x141962[_0x8efb('0x1c')][_0x8efb('0x1e')]||null:null,'attributes':_0x141962[_0x8efb('0x1c')]?_0x141962['options'][_0x8efb('0x1f')]||null:null,'limit':_0x141962[_0x8efb('0x1c')]?_0x141962[_0x8efb('0x1c')][_0x8efb('0x20')]||null:null})[_0x8efb('0x10')](function(_0xe2738c){logger[_0x8efb('0x11')]('UpdateSmsInteraction',_0x141962);logger['debug']('UpdateSmsInteraction',_0x141962,JSON[_0x8efb('0x15')](_0xe2738c));_0x13c8b7(_0xe2738c);})[_0x8efb('0x1a')](function(_0x1e828c){logger[_0x8efb('0x16')](_0x8efb('0x21'),_0x1e828c['message'],_0x141962);_0x252987(_0x2a87ba['error'](0x1f4,_0x1e828c[_0x8efb('0x18')]));});});};exports[_0x8efb('0x22')]=function(_0x4c7f2b){return new Promise(function(_0x46f8ab,_0xfdba9d){return db['SmsInteraction'][_0x8efb('0x23')]({'where':_0x4c7f2b[_0x8efb('0x1c')]?_0x4c7f2b[_0x8efb('0x1c')]['where']||null:null})[_0x8efb('0x10')](function(_0x48b687){if(_0x48b687){return _0x48b687[_0x8efb('0x24')](_0x4c7f2b['body'][_0x8efb('0x25')],_[_0x8efb('0x26')](_0x4c7f2b[_0x8efb('0x1b')],[_0x8efb('0x25'),'id'])||{});}})['spread'](function(_0x1ebadd){logger[_0x8efb('0x11')](_0x8efb('0x27'),_0x4c7f2b);logger[_0x8efb('0x14')]('AddTags',_0x4c7f2b,JSON[_0x8efb('0x15')](_0x1ebadd));_0x46f8ab(_0x1ebadd);})['catch'](function(_0xddab06){logger[_0x8efb('0x16')]('AddTags',_0xddab06[_0x8efb('0x18')],_0x4c7f2b);_0xfdba9d(_this['error'](0x1f4,_0xddab06[_0x8efb('0x18')]));});});}; \ No newline at end of file +var _0xab8d=['omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','update','options','where','attributes','AddTagsToSmsInteraction','addTags','body','ids'];(function(_0x2bf8cb,_0x3db6ac){var _0x38a3a2=function(_0x56be68){while(--_0x56be68){_0x2bf8cb['push'](_0x2bf8cb['shift']());}};_0x38a3a2(++_0x3db6ac);}(_0xab8d,0x19c));var _0xdab8=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xab8d[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0xdab8('0x0'));var util=require(_0xdab8('0x1'));var moment=require(_0xdab8('0x2'));var BPromise=require(_0xdab8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xdab8('0x4'));var db=require(_0xdab8('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xdab8('0x6'))(_0xdab8('0x7'));var config=require(_0xdab8('0x8'));var jayson=require(_0xdab8('0x9'));var client=jayson[_0xdab8('0xa')][_0xdab8('0xb')]({'port':0x232a});config[_0xdab8('0xc')]=_[_0xdab8('0xd')](config['redis'],{'host':_0xdab8('0xe'),'port':0x18eb});var socket=require(_0xdab8('0xf'))(new Redis(config['redis']));require(_0xdab8('0x10'))['register'](socket);function respondWithRpcPromise(_0xc593bc,_0x5c17d3,_0x35af8b){return new BPromise(function(_0x927900,_0x298f43){return client[_0xdab8('0x11')](_0xc593bc,_0x35af8b)[_0xdab8('0x12')](function(_0x3c871a){logger[_0xdab8('0x13')](_0xdab8('0x14'),_0x5c17d3,_0xdab8('0x15'));logger['debug'](_0xdab8('0x16'),_0x5c17d3,_0xdab8('0x15'),JSON[_0xdab8('0x17')](_0x3c871a));if(_0x3c871a['error']){if(_0x3c871a['error'][_0xdab8('0x18')]===0x1f4){logger[_0xdab8('0x19')]('SmsInteraction,\x20%s,\x20%s',_0x5c17d3,_0x3c871a[_0xdab8('0x19')][_0xdab8('0x1a')]);return _0x298f43(_0x3c871a[_0xdab8('0x19')][_0xdab8('0x1a')]);}logger[_0xdab8('0x19')](_0xdab8('0x14'),_0x5c17d3,_0x3c871a['error'][_0xdab8('0x1a')]);return _0x927900(_0x3c871a[_0xdab8('0x19')][_0xdab8('0x1a')]);}else{logger[_0xdab8('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x5c17d3,_0xdab8('0x15'));_0x927900(_0x3c871a[_0xdab8('0x1b')]['message']);}})[_0xdab8('0x1c')](function(_0x2663d5){logger[_0xdab8('0x19')](_0xdab8('0x14'),_0x5c17d3,_0x2663d5);_0x298f43(_0x2663d5);});});}exports[_0xdab8('0x1d')]=function(_0x3ffb75){var _0x52711f=this;return new Promise(function(_0x18204a,_0x181c70){return db[_0xdab8('0x1e')][_0xdab8('0x1f')](_0x3ffb75['body'],{'raw':_0x3ffb75[_0xdab8('0x20')]?_0x3ffb75[_0xdab8('0x20')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ffb75['options']?_0x3ffb75[_0xdab8('0x20')][_0xdab8('0x21')]||null:null,'attributes':_0x3ffb75[_0xdab8('0x20')]?_0x3ffb75[_0xdab8('0x20')][_0xdab8('0x22')]||null:null,'limit':_0x3ffb75[_0xdab8('0x20')]?_0x3ffb75[_0xdab8('0x20')]['limit']||null:null})[_0xdab8('0x12')](function(_0x264d09){logger[_0xdab8('0x13')]('UpdateSmsInteraction',_0x3ffb75);logger['debug']('UpdateSmsInteraction',_0x3ffb75,JSON['stringify'](_0x264d09));_0x18204a(_0x264d09);})[_0xdab8('0x1c')](function(_0x4fb2cf){logger[_0xdab8('0x19')](_0xdab8('0x1d'),_0x4fb2cf[_0xdab8('0x1a')],_0x3ffb75);_0x181c70(_0x52711f[_0xdab8('0x19')](0x1f4,_0x4fb2cf[_0xdab8('0x1a')]));});});};exports[_0xdab8('0x23')]=function(_0x66ca11){return new Promise(function(_0x144b32,_0x18374a){return db['SmsInteraction']['find']({'where':_0x66ca11[_0xdab8('0x20')]?_0x66ca11[_0xdab8('0x20')][_0xdab8('0x21')]||null:null})[_0xdab8('0x12')](function(_0x2013ce){if(_0x2013ce){return _0x2013ce[_0xdab8('0x24')](_0x66ca11[_0xdab8('0x25')][_0xdab8('0x26')],_[_0xdab8('0x27')](_0x66ca11['body'],[_0xdab8('0x26'),'id'])||{});}})['spread'](function(_0x341743){logger[_0xdab8('0x13')](_0xdab8('0x28'),_0x66ca11);logger['debug'](_0xdab8('0x28'),_0x66ca11,JSON['stringify'](_0x341743));_0x144b32(_0x341743);})['catch'](function(_0x415908){logger[_0xdab8('0x19')]('AddTags',_0x415908[_0xdab8('0x1a')],_0x66ca11);_0x18374a(_this[_0xdab8('0x19')](0x1f4,_0x415908[_0xdab8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 6bc7126..f234f93 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2032=['save','remove','update','removeListener','register','length','smsInteraction:'];(function(_0x5bb4e8,_0x44b756){var _0x2a86f2=function(_0x279ab2){while(--_0x279ab2){_0x5bb4e8['push'](_0x5bb4e8['shift']());}};_0x2a86f2(++_0x44b756);}(_0x2032,0xd9));var _0x2203=function(_0xf1f27,_0x168dcc){_0xf1f27=_0xf1f27-0x0;var _0x5eddd9=_0x2032[_0xf1f27];return _0x5eddd9;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x2203('0x0'),_0x2203('0x1'),_0x2203('0x2')];function createListener(_0x4c28da,_0x486390){return function(_0x228a29){_0x486390['emit'](_0x4c28da,_0x228a29);};}function removeListener(_0x46c49a,_0x880dcd){return function(){SmsInteractionEvents[_0x2203('0x3')](_0x46c49a,_0x880dcd);};}exports[_0x2203('0x4')]=function(_0x3f7ba1){for(var _0x13367a=0x0,_0x2e0f63=events[_0x2203('0x5')];_0x13367a<_0x2e0f63;_0x13367a++){var _0x18c4d6=events[_0x13367a];var _0x2049ff=createListener(_0x2203('0x6')+_0x18c4d6,_0x3f7ba1);SmsInteractionEvents['on'](_0x18c4d6,_0x2049ff);}}; \ No newline at end of file +var _0x0b0e=['smsInteraction:','./smsInteraction.events','remove','emit','removeListener','register'];(function(_0x2cccb0,_0x5b83f6){var _0x393bec=function(_0x137b5c){while(--_0x137b5c){_0x2cccb0['push'](_0x2cccb0['shift']());}};_0x393bec(++_0x5b83f6);}(_0x0b0e,0x187));var _0xe0b0=function(_0x4817f9,_0x4070d1){_0x4817f9=_0x4817f9-0x0;var _0x2dcfa6=_0x0b0e[_0x4817f9];return _0x2dcfa6;};'use strict';var SmsInteractionEvents=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(){SmsInteractionEvents[_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);SmsInteractionEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 8eb01c8..edeae76 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 _0x0ade=['show','tracked','post','status','put','update','/:id/accept','accept','/:id/reject','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./smsMessage.controller','get','index','/describe','isAuthenticated','/:id'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x0ade,0x1bb));var _0xe0ad=function(_0x3185a0,_0x4ac61a){_0x3185a0=_0x3185a0-0x0;var _0x15260e=_0x0ade[_0x3185a0];return _0x15260e;};'use strict';var multer=require(_0xe0ad('0x0'));var util=require(_0xe0ad('0x1'));var path=require(_0xe0ad('0x2'));var timeout=require('connect-timeout');var express=require(_0xe0ad('0x3'));var router=express[_0xe0ad('0x4')]();var auth=require(_0xe0ad('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe0ad('0x6'));var controller=require(_0xe0ad('0x7'));router[_0xe0ad('0x8')]('/',auth['isAuthenticated'](),controller[_0xe0ad('0x9')]);router['get'](_0xe0ad('0xa'),auth[_0xe0ad('0xb')](),controller['describe']);router[_0xe0ad('0x8')](_0xe0ad('0xc'),auth[_0xe0ad('0xb')](),controller[_0xe0ad('0xd')]);router['post']('/',auth[_0xe0ad('0xb')](),interaction[_0xe0ad('0xe')]('sms','smsmessage:create'),controller['create']);router[_0xe0ad('0xf')]('/:id/status',controller[_0xe0ad('0x10')]);router[_0xe0ad('0x11')]('/:id',auth[_0xe0ad('0xb')](),controller[_0xe0ad('0x12')]);router['put'](_0xe0ad('0x13'),auth['isAuthenticated'](),controller[_0xe0ad('0x14')]);router[_0xe0ad('0x11')](_0xe0ad('0x15'),auth[_0xe0ad('0xb')](),controller['reject']);router[_0xe0ad('0x16')](_0xe0ad('0xc'),auth['isAuthenticated'](),controller[_0xe0ad('0x17')]);module['exports']=router; \ No newline at end of file +var _0x7ec0=['status','put','update','/:id/accept','accept','destroy','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','index','isAuthenticated','describe','/:id','show','post','tracked','sms','smsmessage:create','/:id/status'];(function(_0x5b7dd2,_0x2ddb3b){var _0x53e0b5=function(_0x4b4228){while(--_0x4b4228){_0x5b7dd2['push'](_0x5b7dd2['shift']());}};_0x53e0b5(++_0x2ddb3b);}(_0x7ec0,0x14c));var _0x07ec=function(_0x4bb980,_0x226171){_0x4bb980=_0x4bb980-0x0;var _0x2d4806=_0x7ec0[_0x4bb980];return _0x2d4806;};'use strict';var multer=require('multer');var util=require(_0x07ec('0x0'));var path=require('path');var timeout=require(_0x07ec('0x1'));var express=require(_0x07ec('0x2'));var router=express[_0x07ec('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x07ec('0x4'));var config=require(_0x07ec('0x5'));var controller=require(_0x07ec('0x6'));router[_0x07ec('0x7')]('/',auth['isAuthenticated'](),controller[_0x07ec('0x8')]);router[_0x07ec('0x7')]('/describe',auth[_0x07ec('0x9')](),controller[_0x07ec('0xa')]);router[_0x07ec('0x7')](_0x07ec('0xb'),auth[_0x07ec('0x9')](),controller[_0x07ec('0xc')]);router[_0x07ec('0xd')]('/',auth[_0x07ec('0x9')](),interaction[_0x07ec('0xe')](_0x07ec('0xf'),_0x07ec('0x10')),controller['create']);router[_0x07ec('0xd')](_0x07ec('0x11'),controller[_0x07ec('0x12')]);router[_0x07ec('0x13')](_0x07ec('0xb'),auth[_0x07ec('0x9')](),controller[_0x07ec('0x14')]);router[_0x07ec('0x13')](_0x07ec('0x15'),auth[_0x07ec('0x9')](),controller[_0x07ec('0x16')]);router[_0x07ec('0x13')]('/:id/reject',auth[_0x07ec('0x9')](),controller['reject']);router['delete'](_0x07ec('0xb'),auth[_0x07ec('0x9')](),controller[_0x07ec('0x17')]);module[_0x07ec('0x18')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index 3cf853f..17ff68c 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 _0x53d1=['out','STRING','sequelize','exports','TEXT','medium','BOOLEAN'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x53d1,0xc6));var _0x153d=function(_0x48453d,_0x381252){_0x48453d=_0x48453d-0x0;var _0x18bfe8=_0x53d1[_0x48453d];return _0x18bfe8;};'use strict';var Sequelize=require(_0x153d('0x0'));module[_0x153d('0x1')]={'body':{'type':Sequelize[_0x153d('0x2')](_0x153d('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x153d('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x153d('0x5')),'defaultValue':_0x153d('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0x153d('0x6')](0xbe)},'phone':{'type':Sequelize[_0x153d('0x6')]},'readAt':{'type':Sequelize['DATE']},'secret':{'type':Sequelize[_0x153d('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0xed0b=['DATE','sequelize','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xed0b,0x1c8));var _0xbed0=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xed0b[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0xbed0('0x0'));module['exports']={'body':{'type':Sequelize[_0xbed0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xbed0('0x2')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbed0('0x3')]('in',_0xbed0('0x4')),'defaultValue':_0xbed0('0x4'),'allowNull':![]},'messageId':{'type':Sequelize[_0xbed0('0x5')](0xbe)},'phone':{'type':Sequelize[_0xbed0('0x5')]},'readAt':{'type':Sequelize[_0xbed0('0x6')]},'secret':{'type':Sequelize[_0xbed0('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 508c58c..157d33d 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 _0x54d2=['SmsAccount','SmsAccountId','received\x20delivery\x20report\x20from','inspect','twilio','MessageSid','MessageUUID','messageId','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','DELIVERED','infobip','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','update','destroy','stack','name','send','map','SmsMessage','type','key','query','keys','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','order','where','filters','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','find','create','body','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','interaction','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','AcceptMessage','manual','channel','event','EventManager','acceptmessage','reject','agent','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','SIP/%s','rejectmessage'];(function(_0x50ce85,_0x1aeedf){var _0x1d73d7=function(_0x1d5b91){while(--_0x1d5b91){_0x50ce85['push'](_0x50ce85['shift']());}};_0x1d73d7(++_0x1aeedf);}(_0x54d2,0x9a));var _0x254d=function(_0x5db7c7,_0x275fa0){_0x5db7c7=_0x5db7c7-0x0;var _0x48204=_0x54d2[_0x5db7c7];return _0x48204;};'use strict';var pdf=require(_0x254d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x254d('0x1'));var zipdir=require(_0x254d('0x2'));var jsonpatch=require(_0x254d('0x3'));var rp=require(_0x254d('0x4'));var moment=require(_0x254d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x254d('0x6'));var util=require(_0x254d('0x7'));var path=require(_0x254d('0x8'));var sox=require(_0x254d('0x9'));var csv=require(_0x254d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x254d('0xb'));var squel=require('squel');var crypto=require(_0x254d('0xc'));var jsforce=require(_0x254d('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x254d('0xa'));var querystring=require('querystring');var Papa=require(_0x254d('0xe'));var Redis=require(_0x254d('0xf'));var authService=require(_0x254d('0x10'));var qs=require(_0x254d('0x11'));var as=require(_0x254d('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x254d('0x13'))(_0x254d('0x14'));var utils=require(_0x254d('0x15'));var config=require(_0x254d('0x16'));var db=require(_0x254d('0x17'))['db'];config[_0x254d('0x18')]=_[_0x254d('0x19')](config[_0x254d('0x18')],{'host':_0x254d('0x1a'),'port':0x18eb});var socket=require(_0x254d('0x1b'))(new Redis(config[_0x254d('0x18')]));require(_0x254d('0x1c'))[_0x254d('0x1d')](socket);var jayson=require(_0x254d('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson['client'][_0x254d('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x4d18f0,_0x512748,_0x15a67a){if(_0x15a67a){var _0x29fde6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x29fde6['test'](_0x512748)){return _0x4d18f0;}else{throw new db[(_0x254d('0x20'))][(_0x254d('0x21'))](_0x254d('0x22'));}}else{return _0x4d18f0;}}function respondWithRpcPromise(_0x4540cb,_0x2db487,_0x34abf3,_0x1d8ad4){return new BPromise(function(_0x26cee5,_0x30ae63){var _0x457a24=_0x1d8ad4||client;return _0x457a24[_0x254d('0x23')](_0x4540cb,_0x34abf3)[_0x254d('0x24')](function(_0xdcd7e){logger[_0x254d('0x25')](_0x254d('0x26'),_0x2db487,_0x254d('0x27'));logger[_0x254d('0x28')](_0x254d('0x29'),_0x2db487,_0x254d('0x27'),JSON[_0x254d('0x2a')](_0xdcd7e));if(_0xdcd7e[_0x254d('0x2b')]){if(_0xdcd7e[_0x254d('0x2b')][_0x254d('0x2c')]===0x1f4){logger[_0x254d('0x2b')](_0x254d('0x26'),_0x2db487,_0xdcd7e['error'][_0x254d('0x2d')]);return _0x30ae63(_0xdcd7e[_0x254d('0x2b')][_0x254d('0x2d')]);}logger[_0x254d('0x2b')](_0x254d('0x26'),_0x2db487,_0xdcd7e[_0x254d('0x2b')][_0x254d('0x2d')]);return _0x26cee5(_0xdcd7e[_0x254d('0x2b')][_0x254d('0x2d')]);}else{logger[_0x254d('0x25')]('SmsMessage,\x20%s,\x20%s',_0x2db487,_0x254d('0x27'));_0x26cee5(_0xdcd7e[_0x254d('0x2e')][_0x254d('0x2d')]);}})[_0x254d('0x2f')](function(_0x1bdc2a){logger[_0x254d('0x2b')](_0x254d('0x26'),_0x2db487,_0x1bdc2a);_0x30ae63(_0x1bdc2a);});});}function respondWithStatusCode(_0x1d1af8,_0x152b01){_0x152b01=_0x152b01||0xcc;return function(_0x20ef65){if(_0x20ef65){return _0x1d1af8[_0x254d('0x30')](_0x152b01);}return _0x1d1af8[_0x254d('0x31')](_0x152b01)[_0x254d('0x32')]();};}function respondWithResult(_0x1a3413,_0x121795){_0x121795=_0x121795||0xc8;return function(_0x41caff){if(_0x41caff){return _0x1a3413[_0x254d('0x31')](_0x121795)['json'](_0x41caff);}};}function respondWithFilteredResult(_0x4f80c3,_0x402952){return function(_0x24690c){if(_0x24690c){var _0x449239=_0x24690c[_0x254d('0x33')],_0x285f6=_0x402952[_0x254d('0x34')],_0x4eb996=_0x402952[_0x254d('0x34')]+_0x402952[_0x254d('0x35')],_0x54f5a8;if(_0x4eb996>=_0x449239){_0x4eb996=_0x449239;_0x54f5a8=0xc8;}else{_0x54f5a8=0xce;}_0x4f80c3['status'](_0x54f5a8);return _0x4f80c3[_0x254d('0x36')](_0x254d('0x37'),_0x285f6+'-'+_0x4eb996+'/'+_0x449239)[_0x254d('0x38')](_0x24690c);}return null;};}function patchUpdates(_0x32fcc2){return function(_0x702b9c){try{jsonpatch[_0x254d('0x39')](_0x702b9c,_0x32fcc2,!![]);}catch(_0x800e10){return BPromise['reject'](_0x800e10);}return _0x702b9c['save']();};}function saveUpdates(_0x2b4221,_0x36a909){return function(_0x2077e8){if(_0x2077e8){return _0x2077e8[_0x254d('0x3a')](_0x2b4221)[_0x254d('0x24')](function(_0x44c8e8){return _0x44c8e8;});}return null;};}function removeEntity(_0x34a4a4,_0x1a28bf){return function(_0x3e2989){if(_0x3e2989){return _0x3e2989[_0x254d('0x3b')]()['then'](function(){_0x34a4a4[_0x254d('0x31')](0xcc)[_0x254d('0x32')]();});}};}function handleEntityNotFound(_0x371873,_0xfb73ea){return function(_0x5e5177){if(!_0x5e5177){_0x371873[_0x254d('0x30')](0x194);}return _0x5e5177;};}function handleError(_0x378577,_0x222c8a){_0x222c8a=_0x222c8a||0x1f4;return function(_0x216681){logger['error'](_0x216681[_0x254d('0x3c')]);if(_0x216681[_0x254d('0x3d')]){delete _0x216681[_0x254d('0x3d')];}_0x378577[_0x254d('0x31')](_0x222c8a)[_0x254d('0x3e')](_0x216681);};}exports['index']=function(_0x4da2dc,_0x57ffbf){var _0x559594={},_0x3f64cb={},_0xb61aaf={'count':0x0,'rows':[]};var _0x5d7905=_[_0x254d('0x3f')](db[_0x254d('0x40')]['rawAttributes'],function(_0x26ed47){return{'name':_0x26ed47['fieldName'],'type':_0x26ed47[_0x254d('0x41')][_0x254d('0x42')]};});_0x3f64cb['model']=_[_0x254d('0x3f')](_0x5d7905,'name');_0x3f64cb[_0x254d('0x43')]=_[_0x254d('0x44')](_0x4da2dc[_0x254d('0x43')]);_0x3f64cb['filters']=_[_0x254d('0x45')](_0x3f64cb[_0x254d('0x46')],_0x3f64cb[_0x254d('0x43')]);_0x559594['attributes']=_['intersection'](_0x3f64cb[_0x254d('0x46')],qs[_0x254d('0x47')](_0x4da2dc[_0x254d('0x43')]['fields']));_0x559594['attributes']=_0x559594['attributes'][_0x254d('0x48')]?_0x559594[_0x254d('0x49')]:_0x3f64cb[_0x254d('0x46')];if(!_0x4da2dc[_0x254d('0x43')][_0x254d('0x4a')](_0x254d('0x4b'))){_0x559594[_0x254d('0x35')]=qs['limit'](_0x4da2dc[_0x254d('0x43')][_0x254d('0x35')]);_0x559594[_0x254d('0x34')]=qs[_0x254d('0x34')](_0x4da2dc['query'][_0x254d('0x34')]);}_0x559594[_0x254d('0x4c')]=qs['sort'](_0x4da2dc[_0x254d('0x43')]['sort']);_0x559594[_0x254d('0x4d')]=qs[_0x254d('0x4e')](_['pick'](_0x4da2dc[_0x254d('0x43')],_0x3f64cb[_0x254d('0x4e')]));if(_0x4da2dc[_0x254d('0x43')][_0x254d('0x4f')]){_0x559594['where']=_[_0x254d('0x50')](_0x559594['where'],{'$or':_[_0x254d('0x3f')](_0x5d7905,function(_0x4fff81){if(_0x4fff81[_0x254d('0x41')]!==_0x254d('0x51')){var _0x30c0c5={};_0x30c0c5[_0x4fff81[_0x254d('0x3d')]]={'$like':'%'+_0x4da2dc[_0x254d('0x43')][_0x254d('0x4f')]+'%'};return _0x30c0c5;}})});}_0x559594=_[_0x254d('0x50')]({},_0x559594,_0x4da2dc[_0x254d('0x52')]);var _0x5d3fdc={'where':_0x559594['where']};return db['SmsMessage'][_0x254d('0x33')](_0x5d3fdc)[_0x254d('0x24')](function(_0x5554fc){_0xb61aaf['count']=_0x5554fc;if(_0x4da2dc['query'][_0x254d('0x53')]){_0x559594[_0x254d('0x54')]=[{'all':!![]}];}return db['SmsMessage'][_0x254d('0x55')](_0x559594);})[_0x254d('0x24')](function(_0x3c4ae2){_0xb61aaf[_0x254d('0x56')]=_0x3c4ae2;return _0xb61aaf;})[_0x254d('0x24')](respondWithFilteredResult(_0x57ffbf,_0x559594))[_0x254d('0x2f')](handleError(_0x57ffbf,null));};exports['show']=function(_0x5197a9,_0x253fbf){var _0x59017c={'raw':!![],'where':{'id':_0x5197a9[_0x254d('0x57')]['id']}},_0x2921c9={};_0x2921c9[_0x254d('0x46')]=_['keys'](db[_0x254d('0x40')]['rawAttributes']);_0x2921c9['query']=_[_0x254d('0x44')](_0x5197a9[_0x254d('0x43')]);_0x2921c9['filters']=_[_0x254d('0x45')](_0x2921c9[_0x254d('0x46')],_0x2921c9[_0x254d('0x43')]);_0x59017c[_0x254d('0x49')]=_[_0x254d('0x45')](_0x2921c9[_0x254d('0x46')],qs[_0x254d('0x47')](_0x5197a9[_0x254d('0x43')][_0x254d('0x47')]));_0x59017c[_0x254d('0x49')]=_0x59017c['attributes'][_0x254d('0x48')]?_0x59017c['attributes']:_0x2921c9['model'];if(_0x5197a9[_0x254d('0x43')][_0x254d('0x53')]){_0x59017c[_0x254d('0x54')]=[{'all':!![]}];}_0x59017c=_[_0x254d('0x50')]({},_0x59017c,_0x5197a9[_0x254d('0x52')]);return db[_0x254d('0x40')][_0x254d('0x58')](_0x59017c)[_0x254d('0x24')](handleEntityNotFound(_0x253fbf,null))['then'](respondWithResult(_0x253fbf,null))['catch'](handleError(_0x253fbf,null));};exports[_0x254d('0x59')]=function(_0x4bf5fb,_0x2da76e){return db[_0x254d('0x40')][_0x254d('0x59')](_0x4bf5fb['body'],{})['then'](respondWithResult(_0x2da76e,0xc9))[_0x254d('0x2f')](handleError(_0x2da76e,null));};exports[_0x254d('0x3a')]=function(_0x7c3d7e,_0x2da012){if(_0x7c3d7e['body']['id']){delete _0x7c3d7e[_0x254d('0x5a')]['id'];}return db[_0x254d('0x40')][_0x254d('0x58')]({'where':{'id':_0x7c3d7e[_0x254d('0x57')]['id']}})[_0x254d('0x24')](handleEntityNotFound(_0x2da012,null))['then'](saveUpdates(_0x7c3d7e['body'],null))[_0x254d('0x24')](respondWithResult(_0x2da012,null))[_0x254d('0x2f')](handleError(_0x2da012,null));};exports[_0x254d('0x3b')]=function(_0x2f0de6,_0x163f46){return db['SmsMessage']['find']({'where':{'id':_0x2f0de6[_0x254d('0x57')]['id']}})[_0x254d('0x24')](handleEntityNotFound(_0x163f46,null))['then'](removeEntity(_0x163f46,null))['catch'](handleError(_0x163f46,null));};exports[_0x254d('0x5b')]=function(_0x3bbacd,_0x395372){return db[_0x254d('0x40')][_0x254d('0x5b')]()[_0x254d('0x24')](respondWithResult(_0x395372,null))[_0x254d('0x2f')](handleError(_0x395372,null));};var interaction_log=require(_0x254d('0x13'))(_0x254d('0x5c'));exports[_0x254d('0x5d')]=function(_0x17c2d3,_0x58e3f5,_0xf0fb17){var _0x58aaea={'channel':_0x254d('0x5e')};if(_0x17c2d3[_0x254d('0x5a')]['id']){delete _0x17c2d3[_0x254d('0x5a')]['id'];}_0x17c2d3[_0x254d('0x5a')][_0x254d('0x5f')]=!![];_0x17c2d3[_0x254d('0x5a')]['readAt']=moment()[_0x254d('0x60')](_0x254d('0x61'));_0x17c2d3[_0x254d('0x5a')]['UserId']=_0x17c2d3[_0x254d('0x5a')][_0x254d('0x62')]||_0x17c2d3['user']['id'];return db[_0x254d('0x40')]['find']({'where':{'id':_0x17c2d3[_0x254d('0x57')]['id'],'UserId':null},'include':[{'model':db[_0x254d('0x63')],'as':_0x254d('0x64')}]})['then'](handleEntityNotFound(_0x58e3f5,null))['then'](saveUpdates(_0x17c2d3[_0x254d('0x5a')],null))[_0x254d('0x24')](function(_0x4e2c0b){if(_0x4e2c0b){_0x58aaea[_0x254d('0x2d')]=_0x4e2c0b[_0x254d('0x65')]({'plain':!![]});return db[_0x254d('0x66')][_0x254d('0x58')]({'where':{'id':_0x4e2c0b[_0x254d('0x67')]}});}return null;})[_0x254d('0x24')](handleEntityNotFound(_0x58e3f5,null))['then'](function(_0x771b13){if(_0x771b13){return _0x771b13[_0x254d('0x3a')]({'UserId':_0x17c2d3['body'][_0x254d('0x62')],'read1stAt':_[_0x254d('0x68')](_0x771b13[_0x254d('0x69')])?moment()[_0x254d('0x60')](_0x254d('0x61')):undefined});}return null;})[_0x254d('0x24')](function(_0x2d880c){if(_0x2d880c){_0x58aaea[_0x254d('0x6a')]=_0x2d880c[_0x254d('0x65')]({'plain':!![]});interaction_log[_0x254d('0x25')](_0x254d('0x6b'),_0x17c2d3[_0x254d('0x6c')]['id'],_0x17c2d3[_0x254d('0x6c')][_0x254d('0x3d')],_0x17c2d3[_0x254d('0x6c')][_0x254d('0x6d')],_0x58aaea[_0x254d('0x6a')]['id'],_0x17c2d3[_0x254d('0x5a')]?JSON[_0x254d('0x2a')](_0x17c2d3[_0x254d('0x5a')]):'null');return respondWithRpcPromise(_0x254d('0x6e'),'acceptMessage',_0x58aaea);}return null;})[_0x254d('0x24')](function(_0x17b0b){if(_0x17b0b){if(_0x17c2d3['body'][_0x254d('0x6f')]){_0x58aaea[_0x254d('0x2d')]['interface']=util[_0x254d('0x60')]('SIP/%s',_0x17c2d3[_0x254d('0x6c')][_0x254d('0x3d')]);_0x58aaea[_0x254d('0x2d')][_0x254d('0x70')]=_0x58aaea['channel'];_0x58aaea[_0x254d('0x2d')][_0x254d('0x71')]=_0x254d('0x5d');return respondWithRpcPromise('EventManager',_0x254d('0x72'),{'event':_0x254d('0x73'),'message':_0x58aaea[_0x254d('0x2d')]},client9002)[_0x254d('0x24')](function(){return _0x58aaea;});}return _0x58aaea;}return null;})['then'](respondWithResult(_0x58e3f5,null))[_0x254d('0x2f')](handleError(_0x58e3f5,null));};var interaction_log=require(_0x254d('0x13'))(_0x254d('0x5c'));exports[_0x254d('0x74')]=function(_0x4db4ef,_0x1c2cd3,_0xda5fbc){var _0x1042f9={'agent':{},'channel':_0x254d('0x5e')};if(_0x4db4ef[_0x254d('0x5a')]['id']){delete _0x4db4ef['body']['id'];}_0x4db4ef['body'][_0x254d('0x62')]=_0x4db4ef['body']['UserId']||_0x4db4ef['user']['id'];_0x1042f9[_0x254d('0x75')]['id']=_0x4db4ef[_0x254d('0x5a')]['UserId'];return db['SmsMessage']['find']({'where':{'id':_0x4db4ef[_0x254d('0x57')]['id'],'UserId':null}})[_0x254d('0x24')](handleEntityNotFound(_0x1c2cd3,null))['then'](function(_0x330910){if(_0x330910){_0x1042f9[_0x254d('0x2d')]=_0x330910[_0x254d('0x65')]({'plain':!![]});return db[_0x254d('0x66')][_0x254d('0x58')]({'where':{'id':_0x330910[_0x254d('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1c2cd3,null))[_0x254d('0x24')](function(_0x572f25){if(_0x572f25){_0x1042f9[_0x254d('0x6a')]=_0x572f25[_0x254d('0x65')]({'plain':!![]});interaction_log[_0x254d('0x25')](_0x254d('0x76'),_0x4db4ef['user']['id'],_0x4db4ef['user'][_0x254d('0x3d')],_0x4db4ef[_0x254d('0x6c')][_0x254d('0x6d')],_0x1042f9[_0x254d('0x6a')]['id'],_0x4db4ef['body']?JSON[_0x254d('0x2a')](_0x4db4ef[_0x254d('0x5a')]):'null');return respondWithRpcPromise(_0x254d('0x77'),_0x254d('0x78'),_0x1042f9);}return null;})[_0x254d('0x24')](function(_0x56cc8d){if(_0x56cc8d){_0x56cc8d[_0x254d('0x2d')][_0x254d('0x79')]=util['format'](_0x254d('0x7a'),_0x4db4ef[_0x254d('0x6c')][_0x254d('0x3d')]);_0x56cc8d[_0x254d('0x2d')][_0x254d('0x70')]=_0x1042f9['channel'];_0x56cc8d[_0x254d('0x2d')][_0x254d('0x71')]='reject';respondWithRpcPromise(_0x254d('0x72'),_0x254d('0x72'),{'event':_0x254d('0x7b'),'message':_0x56cc8d[_0x254d('0x2d')]},client9002);return _0x1042f9;}return null;})[_0x254d('0x24')](respondWithResult(_0x1c2cd3,null))[_0x254d('0x2f')](handleError(_0x1c2cd3,null));};exports[_0x254d('0x31')]=function(_0x2fa7ee,_0x267052,_0x34242a){if(_0x2fa7ee[_0x254d('0x5a')]['id']){delete _0x2fa7ee[_0x254d('0x5a')]['id'];}var _0x54c20e;return db[_0x254d('0x40')][_0x254d('0x58')]({'where':{'id':_0x2fa7ee[_0x254d('0x57')]['id']}})[_0x254d('0x24')](handleEntityNotFound(_0x267052,null))[_0x254d('0x24')](function(_0x4c6f93){if(_0x4c6f93){_0x54c20e=_0x4c6f93;return db[_0x254d('0x7c')]['find']({'where':{'id':_0x4c6f93[_0x254d('0x7d')]}});}})[_0x254d('0x24')](handleEntityNotFound(_0x267052,null))[_0x254d('0x24')](function(_0x45f877){if(_0x45f877){logger['debug'](_0x254d('0x29'),_0x254d('0x31'),_0x254d('0x7e'),_0x45f877[_0x254d('0x41')],util[_0x254d('0x7f')](_0x2fa7ee[_0x254d('0x5a')],{'showHidden':![],'depth':null}));switch(_0x45f877['type']){case _0x254d('0x80'):if(_0x2fa7ee[_0x254d('0x5a')][_0x254d('0x81')]&&_0x2fa7ee[_0x254d('0x5a')][_0x254d('0x81')]===_0x54c20e['messageId']){return _0x54c20e['update']({'read':!![]});}else{logger[_0x254d('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','twilio',util[_0x254d('0x7f')](_0x2fa7ee[_0x254d('0x5a')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x2fa7ee['body'][_0x254d('0x82')]&&_0x2fa7ee[_0x254d('0x5a')]['MessageUUID']===_0x54c20e[_0x254d('0x83')]&&_[_0x254d('0x84')]([_0x254d('0x85'),_0x254d('0x86')],_0x2fa7ee[_0x254d('0x5a')][_0x254d('0x87')])>=0x0){return _0x54c20e[_0x254d('0x3a')]({'read':!![]});}else{logger[_0x254d('0x2b')](_0x254d('0x88'),'status','plivio',util[_0x254d('0x7f')](_0x2fa7ee[_0x254d('0x5a')],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x57963a=_0x2fa7ee['body']['results'][0x0];if(_0x57963a[_0x254d('0x31')]['groupName']===_0x254d('0x89')){return _0x54c20e[_0x254d('0x3a')]({'read':!![]});}else{logger[_0x254d('0x2b')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x254d('0x31'),_0x254d('0x8a'),util[_0x254d('0x7f')](_0x2fa7ee[_0x254d('0x5a')],{'showHidden':![],'depth':null}));}break;}return _0x54c20e;}})['then'](respondWithResult(_0x267052,null))[_0x254d('0x2f')](handleError(_0x267052,null));}; \ No newline at end of file +var _0xf0de=['groupName','DELIVERED','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./smsMessage.socket','register','http','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','stack','name','map','SmsMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','options','includeAll','findAll','show','include','find','create','body','params','destroy','describe','sms-interactions','accept','sms','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','SmsInteraction','isNil','read1stAt','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','agent','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','interface','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','indexOf','delivered','Status','plivio','infobip','results'];(function(_0x494d1f,_0x3f72ff){var _0x457b6e=function(_0x38cb16){while(--_0x38cb16){_0x494d1f['push'](_0x494d1f['shift']());}};_0x457b6e(++_0x3f72ff);}(_0xf0de,0x1a0));var _0xef0d=function(_0x16b25c,_0xaca91d){_0x16b25c=_0x16b25c-0x0;var _0x2a2fb0=_0xf0de[_0x16b25c];return _0x2a2fb0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xef0d('0x0'));var rp=require(_0xef0d('0x1'));var moment=require(_0xef0d('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xef0d('0x3'));var util=require(_0xef0d('0x4'));var path=require(_0xef0d('0x5'));var sox=require(_0xef0d('0x6'));var csv=require(_0xef0d('0x7'));var ejs=require(_0xef0d('0x8'));var fs=require('fs');var _=require(_0xef0d('0x9'));var squel=require(_0xef0d('0xa'));var crypto=require(_0xef0d('0xb'));var jsforce=require(_0xef0d('0xc'));var deskjs=require(_0xef0d('0xd'));var toCsv=require(_0xef0d('0x7'));var querystring=require(_0xef0d('0xe'));var Papa=require(_0xef0d('0xf'));var Redis=require(_0xef0d('0x10'));var authService=require(_0xef0d('0x11'));var qs=require(_0xef0d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xef0d('0x13'));var logger=require(_0xef0d('0x14'))(_0xef0d('0x15'));var utils=require(_0xef0d('0x16'));var config=require(_0xef0d('0x17'));var db=require(_0xef0d('0x18'))['db'];config[_0xef0d('0x19')]=_['defaults'](config[_0xef0d('0x19')],{'host':_0xef0d('0x1a'),'port':0x18eb});var socket=require(_0xef0d('0x1b'))(new Redis(config[_0xef0d('0x19')]));require(_0xef0d('0x1c'))[_0xef0d('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xef0d('0x1e')]({'port':0x232c});var client9002=jayson[_0xef0d('0x1f')][_0xef0d('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x1b6bd4,_0xefddc2,_0x19084e){if(_0x19084e){var _0x41dea7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41dea7[_0xef0d('0x20')](_0xefddc2)){return _0x1b6bd4;}else{throw new db[(_0xef0d('0x21'))][(_0xef0d('0x22'))](_0xef0d('0x23'));}}else{return _0x1b6bd4;}}function respondWithRpcPromise(_0x4792e1,_0x1108c8,_0x3b430e,_0x382c2e){return new BPromise(function(_0x5bc030,_0x4fe8fe){var _0x5645de=_0x382c2e||client;return _0x5645de['request'](_0x4792e1,_0x3b430e)['then'](function(_0x2674c1){logger[_0xef0d('0x24')](_0xef0d('0x25'),_0x1108c8,_0xef0d('0x26'));logger['debug'](_0xef0d('0x27'),_0x1108c8,_0xef0d('0x26'),JSON[_0xef0d('0x28')](_0x2674c1));if(_0x2674c1['error']){if(_0x2674c1[_0xef0d('0x29')]['code']===0x1f4){logger[_0xef0d('0x29')]('SmsMessage,\x20%s,\x20%s',_0x1108c8,_0x2674c1[_0xef0d('0x29')][_0xef0d('0x2a')]);return _0x4fe8fe(_0x2674c1[_0xef0d('0x29')][_0xef0d('0x2a')]);}logger[_0xef0d('0x29')](_0xef0d('0x25'),_0x1108c8,_0x2674c1['error'][_0xef0d('0x2a')]);return _0x5bc030(_0x2674c1['error'][_0xef0d('0x2a')]);}else{logger[_0xef0d('0x24')](_0xef0d('0x25'),_0x1108c8,_0xef0d('0x26'));_0x5bc030(_0x2674c1['result'][_0xef0d('0x2a')]);}})[_0xef0d('0x2b')](function(_0x4eb3c0){logger[_0xef0d('0x29')](_0xef0d('0x25'),_0x1108c8,_0x4eb3c0);_0x4fe8fe(_0x4eb3c0);});});}function respondWithStatusCode(_0x16bb96,_0x460910){_0x460910=_0x460910||0xcc;return function(_0xd64217){if(_0xd64217){return _0x16bb96[_0xef0d('0x2c')](_0x460910);}return _0x16bb96[_0xef0d('0x2d')](_0x460910)['end']();};}function respondWithResult(_0x22ac62,_0x3982de){_0x3982de=_0x3982de||0xc8;return function(_0xe8b9e7){if(_0xe8b9e7){return _0x22ac62[_0xef0d('0x2d')](_0x3982de)[_0xef0d('0x2e')](_0xe8b9e7);}};}function respondWithFilteredResult(_0x1dee58,_0x4b847b){return function(_0x1cc6d9){if(_0x1cc6d9){var _0x4bf78e=_0x1cc6d9[_0xef0d('0x2f')],_0x22a65a=_0x4b847b[_0xef0d('0x30')],_0x3bbd82=_0x4b847b[_0xef0d('0x30')]+_0x4b847b['limit'],_0x70da88;if(_0x3bbd82>=_0x4bf78e){_0x3bbd82=_0x4bf78e;_0x70da88=0xc8;}else{_0x70da88=0xce;}_0x1dee58[_0xef0d('0x2d')](_0x70da88);return _0x1dee58[_0xef0d('0x31')](_0xef0d('0x32'),_0x22a65a+'-'+_0x3bbd82+'/'+_0x4bf78e)[_0xef0d('0x2e')](_0x1cc6d9);}return null;};}function patchUpdates(_0x41e187){return function(_0x56be7b){try{jsonpatch[_0xef0d('0x33')](_0x56be7b,_0x41e187,!![]);}catch(_0x581b61){return BPromise[_0xef0d('0x34')](_0x581b61);}return _0x56be7b[_0xef0d('0x35')]();};}function saveUpdates(_0x2fc831,_0x3fec26){return function(_0xb83d8a){if(_0xb83d8a){return _0xb83d8a[_0xef0d('0x36')](_0x2fc831)['then'](function(_0x3cefc0){return _0x3cefc0;});}return null;};}function removeEntity(_0xf0f47,_0xbd7542){return function(_0x443c8a){if(_0x443c8a){return _0x443c8a['destroy']()[_0xef0d('0x37')](function(){_0xf0f47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x55635e,_0x21840e){return function(_0x46a579){if(!_0x46a579){_0x55635e[_0xef0d('0x2c')](0x194);}return _0x46a579;};}function handleError(_0x403e42,_0x50decb){_0x50decb=_0x50decb||0x1f4;return function(_0x24c9ff){logger[_0xef0d('0x29')](_0x24c9ff[_0xef0d('0x38')]);if(_0x24c9ff[_0xef0d('0x39')]){delete _0x24c9ff[_0xef0d('0x39')];}_0x403e42[_0xef0d('0x2d')](_0x50decb)['send'](_0x24c9ff);};}exports['index']=function(_0x158e0b,_0x36c123){var _0x312dbe={},_0x2e9f3c={},_0x5d52a8={'count':0x0,'rows':[]};var _0x17c360=_[_0xef0d('0x3a')](db[_0xef0d('0x3b')][_0xef0d('0x3c')],function(_0x5122a0){return{'name':_0x5122a0[_0xef0d('0x3d')],'type':_0x5122a0[_0xef0d('0x3e')][_0xef0d('0x3f')]};});_0x2e9f3c[_0xef0d('0x40')]=_[_0xef0d('0x3a')](_0x17c360,_0xef0d('0x39'));_0x2e9f3c[_0xef0d('0x41')]=_[_0xef0d('0x42')](_0x158e0b[_0xef0d('0x41')]);_0x2e9f3c[_0xef0d('0x43')]=_[_0xef0d('0x44')](_0x2e9f3c[_0xef0d('0x40')],_0x2e9f3c[_0xef0d('0x41')]);_0x312dbe[_0xef0d('0x45')]=_[_0xef0d('0x44')](_0x2e9f3c[_0xef0d('0x40')],qs[_0xef0d('0x46')](_0x158e0b[_0xef0d('0x41')][_0xef0d('0x46')]));_0x312dbe[_0xef0d('0x45')]=_0x312dbe[_0xef0d('0x45')]['length']?_0x312dbe[_0xef0d('0x45')]:_0x2e9f3c[_0xef0d('0x40')];if(!_0x158e0b[_0xef0d('0x41')][_0xef0d('0x47')](_0xef0d('0x48'))){_0x312dbe[_0xef0d('0x49')]=qs[_0xef0d('0x49')](_0x158e0b[_0xef0d('0x41')]['limit']);_0x312dbe[_0xef0d('0x30')]=qs[_0xef0d('0x30')](_0x158e0b['query'][_0xef0d('0x30')]);}_0x312dbe['order']=qs[_0xef0d('0x4a')](_0x158e0b[_0xef0d('0x41')][_0xef0d('0x4a')]);_0x312dbe[_0xef0d('0x4b')]=qs['filters'](_[_0xef0d('0x4c')](_0x158e0b[_0xef0d('0x41')],_0x2e9f3c[_0xef0d('0x43')]));if(_0x158e0b[_0xef0d('0x41')][_0xef0d('0x4d')]){_0x312dbe['where']=_[_0xef0d('0x4e')](_0x312dbe[_0xef0d('0x4b')],{'$or':_['map'](_0x17c360,function(_0x22cd54){if(_0x22cd54['type']!=='VIRTUAL'){var _0x1d3a00={};_0x1d3a00[_0x22cd54[_0xef0d('0x39')]]={'$like':'%'+_0x158e0b[_0xef0d('0x41')][_0xef0d('0x4d')]+'%'};return _0x1d3a00;}})});}_0x312dbe=_[_0xef0d('0x4e')]({},_0x312dbe,_0x158e0b[_0xef0d('0x4f')]);var _0x515325={'where':_0x312dbe['where']};return db[_0xef0d('0x3b')]['count'](_0x515325)['then'](function(_0x3f9a2a){_0x5d52a8[_0xef0d('0x2f')]=_0x3f9a2a;if(_0x158e0b[_0xef0d('0x41')][_0xef0d('0x50')]){_0x312dbe['include']=[{'all':!![]}];}return db[_0xef0d('0x3b')][_0xef0d('0x51')](_0x312dbe);})[_0xef0d('0x37')](function(_0xcc3ae7){_0x5d52a8['rows']=_0xcc3ae7;return _0x5d52a8;})[_0xef0d('0x37')](respondWithFilteredResult(_0x36c123,_0x312dbe))[_0xef0d('0x2b')](handleError(_0x36c123,null));};exports[_0xef0d('0x52')]=function(_0x525b5a,_0x4cc319){var _0x57d3a8={'raw':!![],'where':{'id':_0x525b5a['params']['id']}},_0x19a5b5={};_0x19a5b5['model']=_['keys'](db[_0xef0d('0x3b')][_0xef0d('0x3c')]);_0x19a5b5[_0xef0d('0x41')]=_['keys'](_0x525b5a[_0xef0d('0x41')]);_0x19a5b5['filters']=_[_0xef0d('0x44')](_0x19a5b5[_0xef0d('0x40')],_0x19a5b5[_0xef0d('0x41')]);_0x57d3a8[_0xef0d('0x45')]=_[_0xef0d('0x44')](_0x19a5b5[_0xef0d('0x40')],qs[_0xef0d('0x46')](_0x525b5a['query'][_0xef0d('0x46')]));_0x57d3a8[_0xef0d('0x45')]=_0x57d3a8[_0xef0d('0x45')]['length']?_0x57d3a8[_0xef0d('0x45')]:_0x19a5b5[_0xef0d('0x40')];if(_0x525b5a[_0xef0d('0x41')][_0xef0d('0x50')]){_0x57d3a8[_0xef0d('0x53')]=[{'all':!![]}];}_0x57d3a8=_[_0xef0d('0x4e')]({},_0x57d3a8,_0x525b5a[_0xef0d('0x4f')]);return db[_0xef0d('0x3b')][_0xef0d('0x54')](_0x57d3a8)[_0xef0d('0x37')](handleEntityNotFound(_0x4cc319,null))['then'](respondWithResult(_0x4cc319,null))[_0xef0d('0x2b')](handleError(_0x4cc319,null));};exports[_0xef0d('0x55')]=function(_0x1b4f15,_0xcb711c){return db[_0xef0d('0x3b')][_0xef0d('0x55')](_0x1b4f15['body'],{})[_0xef0d('0x37')](respondWithResult(_0xcb711c,0xc9))[_0xef0d('0x2b')](handleError(_0xcb711c,null));};exports[_0xef0d('0x36')]=function(_0x4bedf4,_0xe6ad76){if(_0x4bedf4[_0xef0d('0x56')]['id']){delete _0x4bedf4[_0xef0d('0x56')]['id'];}return db[_0xef0d('0x3b')][_0xef0d('0x54')]({'where':{'id':_0x4bedf4[_0xef0d('0x57')]['id']}})[_0xef0d('0x37')](handleEntityNotFound(_0xe6ad76,null))[_0xef0d('0x37')](saveUpdates(_0x4bedf4[_0xef0d('0x56')],null))[_0xef0d('0x37')](respondWithResult(_0xe6ad76,null))[_0xef0d('0x2b')](handleError(_0xe6ad76,null));};exports[_0xef0d('0x58')]=function(_0x17cc0c,_0x5a0786){return db[_0xef0d('0x3b')]['find']({'where':{'id':_0x17cc0c['params']['id']}})['then'](handleEntityNotFound(_0x5a0786,null))[_0xef0d('0x37')](removeEntity(_0x5a0786,null))['catch'](handleError(_0x5a0786,null));};exports[_0xef0d('0x59')]=function(_0x586d66,_0x4bc2ec){return db[_0xef0d('0x3b')]['describe']()[_0xef0d('0x37')](respondWithResult(_0x4bc2ec,null))[_0xef0d('0x2b')](handleError(_0x4bc2ec,null));};var interaction_log=require('../../config/logger')(_0xef0d('0x5a'));exports[_0xef0d('0x5b')]=function(_0x3a410f,_0x321cd0,_0xe71e70){var _0x38ace9={'channel':_0xef0d('0x5c')};if(_0x3a410f['body']['id']){delete _0x3a410f[_0xef0d('0x56')]['id'];}_0x3a410f[_0xef0d('0x56')][_0xef0d('0x5d')]=!![];_0x3a410f['body']['readAt']=moment()[_0xef0d('0x5e')](_0xef0d('0x5f'));_0x3a410f[_0xef0d('0x56')][_0xef0d('0x60')]=_0x3a410f[_0xef0d('0x56')][_0xef0d('0x60')]||_0x3a410f['user']['id'];return db[_0xef0d('0x3b')][_0xef0d('0x54')]({'where':{'id':_0x3a410f[_0xef0d('0x57')]['id'],'UserId':null},'include':[{'model':db[_0xef0d('0x61')],'as':'Contact'}]})[_0xef0d('0x37')](handleEntityNotFound(_0x321cd0,null))[_0xef0d('0x37')](saveUpdates(_0x3a410f[_0xef0d('0x56')],null))[_0xef0d('0x37')](function(_0x84879){if(_0x84879){_0x38ace9[_0xef0d('0x2a')]=_0x84879['get']({'plain':!![]});return db[_0xef0d('0x62')][_0xef0d('0x54')]({'where':{'id':_0x84879['SmsInteractionId']}});}return null;})[_0xef0d('0x37')](handleEntityNotFound(_0x321cd0,null))['then'](function(_0x478278){if(_0x478278){return _0x478278[_0xef0d('0x36')]({'UserId':_0x3a410f['body']['UserId'],'read1stAt':_[_0xef0d('0x63')](_0x478278[_0xef0d('0x64')])?moment()['format'](_0xef0d('0x5f')):undefined});}return null;})[_0xef0d('0x37')](function(_0x7bcc){if(_0x7bcc){_0x38ace9[_0xef0d('0x65')]=_0x7bcc[_0xef0d('0x66')]({'plain':!![]});interaction_log[_0xef0d('0x24')](_0xef0d('0x67'),_0x3a410f[_0xef0d('0x68')]['id'],_0x3a410f[_0xef0d('0x68')]['name'],_0x3a410f[_0xef0d('0x68')][_0xef0d('0x69')],_0x38ace9[_0xef0d('0x65')]['id'],_0x3a410f['body']?JSON[_0xef0d('0x28')](_0x3a410f['body']):_0xef0d('0x6a'));return respondWithRpcPromise(_0xef0d('0x6b'),_0xef0d('0x6c'),_0x38ace9);}return null;})[_0xef0d('0x37')](function(_0x39c554){if(_0x39c554){if(_0x3a410f[_0xef0d('0x56')][_0xef0d('0x6d')]){_0x38ace9[_0xef0d('0x2a')]['interface']=util[_0xef0d('0x5e')](_0xef0d('0x6e'),_0x3a410f['user'][_0xef0d('0x39')]);_0x38ace9['message'][_0xef0d('0x6f')]=_0x38ace9[_0xef0d('0x6f')];_0x38ace9[_0xef0d('0x2a')][_0xef0d('0x70')]='accept';return respondWithRpcPromise(_0xef0d('0x71'),_0xef0d('0x71'),{'event':'acceptmessage','message':_0x38ace9['message']},client9002)[_0xef0d('0x37')](function(){return _0x38ace9;});}return _0x38ace9;}return null;})[_0xef0d('0x37')](respondWithResult(_0x321cd0,null))[_0xef0d('0x2b')](handleError(_0x321cd0,null));};var interaction_log=require(_0xef0d('0x14'))(_0xef0d('0x5a'));exports['reject']=function(_0x5a5643,_0x15e9cd,_0x45de13){var _0xc6204c={'agent':{},'channel':'sms'};if(_0x5a5643[_0xef0d('0x56')]['id']){delete _0x5a5643[_0xef0d('0x56')]['id'];}_0x5a5643['body']['UserId']=_0x5a5643['body'][_0xef0d('0x60')]||_0x5a5643[_0xef0d('0x68')]['id'];_0xc6204c[_0xef0d('0x72')]['id']=_0x5a5643[_0xef0d('0x56')][_0xef0d('0x60')];return db['SmsMessage'][_0xef0d('0x54')]({'where':{'id':_0x5a5643[_0xef0d('0x57')]['id'],'UserId':null}})[_0xef0d('0x37')](handleEntityNotFound(_0x15e9cd,null))[_0xef0d('0x37')](function(_0x4c74a3){if(_0x4c74a3){_0xc6204c[_0xef0d('0x2a')]=_0x4c74a3['get']({'plain':!![]});return db[_0xef0d('0x62')]['find']({'where':{'id':_0x4c74a3[_0xef0d('0x73')]}});}return null;})['then'](handleEntityNotFound(_0x15e9cd,null))[_0xef0d('0x37')](function(_0x21cedf){if(_0x21cedf){_0xc6204c[_0xef0d('0x65')]=_0x21cedf[_0xef0d('0x66')]({'plain':!![]});interaction_log['info'](_0xef0d('0x74'),_0x5a5643[_0xef0d('0x68')]['id'],_0x5a5643[_0xef0d('0x68')]['name'],_0x5a5643[_0xef0d('0x68')][_0xef0d('0x69')],_0xc6204c[_0xef0d('0x65')]['id'],_0x5a5643['body']?JSON['stringify'](_0x5a5643[_0xef0d('0x56')]):_0xef0d('0x6a'));return respondWithRpcPromise(_0xef0d('0x75'),'rejectMessage',_0xc6204c);}return null;})['then'](function(_0x2fe445){if(_0x2fe445){_0x2fe445['message'][_0xef0d('0x76')]=util[_0xef0d('0x5e')](_0xef0d('0x6e'),_0x5a5643['user'][_0xef0d('0x39')]);_0x2fe445['message'][_0xef0d('0x6f')]=_0xc6204c[_0xef0d('0x6f')];_0x2fe445[_0xef0d('0x2a')]['event']='reject';respondWithRpcPromise(_0xef0d('0x71'),_0xef0d('0x71'),{'event':_0xef0d('0x77'),'message':_0x2fe445['message']},client9002);return _0xc6204c;}return null;})[_0xef0d('0x37')](respondWithResult(_0x15e9cd,null))[_0xef0d('0x2b')](handleError(_0x15e9cd,null));};exports[_0xef0d('0x2d')]=function(_0x5ca71f,_0x3c9f3d,_0x2fcd39){if(_0x5ca71f[_0xef0d('0x56')]['id']){delete _0x5ca71f[_0xef0d('0x56')]['id'];}var _0x5b7d53;return db[_0xef0d('0x3b')][_0xef0d('0x54')]({'where':{'id':_0x5ca71f[_0xef0d('0x57')]['id']}})['then'](handleEntityNotFound(_0x3c9f3d,null))[_0xef0d('0x37')](function(_0x284051){if(_0x284051){_0x5b7d53=_0x284051;return db[_0xef0d('0x78')]['find']({'where':{'id':_0x284051[_0xef0d('0x79')]}});}})[_0xef0d('0x37')](handleEntityNotFound(_0x3c9f3d,null))[_0xef0d('0x37')](function(_0x3f470b){if(_0x3f470b){logger[_0xef0d('0x7a')](_0xef0d('0x27'),_0xef0d('0x2d'),_0xef0d('0x7b'),_0x3f470b['type'],util[_0xef0d('0x7c')](_0x5ca71f[_0xef0d('0x56')],{'showHidden':![],'depth':null}));switch(_0x3f470b[_0xef0d('0x3e')]){case'twilio':if(_0x5ca71f['body'][_0xef0d('0x7d')]&&_0x5ca71f[_0xef0d('0x56')]['MessageSid']===_0x5b7d53['messageId']){return _0x5b7d53[_0xef0d('0x36')]({'read':!![]});}else{logger[_0xef0d('0x29')](_0xef0d('0x7e'),_0xef0d('0x2d'),'twilio',util['inspect'](_0x5ca71f[_0xef0d('0x56')],{'showHidden':![],'depth':null}));}break;case _0xef0d('0x7f'):if(_0x5ca71f[_0xef0d('0x56')]['MessageUUID']&&_0x5ca71f['body'][_0xef0d('0x80')]===_0x5b7d53[_0xef0d('0x81')]&&_[_0xef0d('0x82')](['sent',_0xef0d('0x83')],_0x5ca71f[_0xef0d('0x56')][_0xef0d('0x84')])>=0x0){return _0x5b7d53['update']({'read':!![]});}else{logger[_0xef0d('0x29')](_0xef0d('0x7e'),_0xef0d('0x2d'),_0xef0d('0x85'),util['inspect'](_0x5ca71f[_0xef0d('0x56')],{'showHidden':![],'depth':null}));}break;case _0xef0d('0x86'):var _0x58c713=_0x5ca71f[_0xef0d('0x56')][_0xef0d('0x87')][0x0];if(_0x58c713[_0xef0d('0x2d')][_0xef0d('0x88')]===_0xef0d('0x89')){return _0x5b7d53[_0xef0d('0x36')]({'read':!![]});}else{logger[_0xef0d('0x29')](_0xef0d('0x7e'),_0xef0d('0x2d'),_0xef0d('0x86'),util[_0xef0d('0x7c')](_0x5ca71f[_0xef0d('0x56')],{'showHidden':![],'depth':null}));}break;}return _0x5b7d53;}})['then'](respondWithResult(_0x3c9f3d,null))['catch'](handleError(_0x3c9f3d,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index ae2da10..f541f56 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 _0xb86e=['exports','events','../../mysqldb','SmsMessage','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x4d07cc,_0x587613){var _0x42de3b=function(_0x201f78){while(--_0x201f78){_0x4d07cc['push'](_0x4d07cc['shift']());}};_0x42de3b(++_0x587613);}(_0xb86e,0x6f));var _0xeb86=function(_0xe90ec9,_0x29e6cc){_0xe90ec9=_0xe90ec9-0x0;var _0x1c10fc=_0xb86e[_0xe90ec9];return _0x1c10fc;};'use strict';var EventEmitter=require(_0xeb86('0x0'));var SmsMessage=require(_0xeb86('0x1'))['db'][_0xeb86('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xeb86('0x3')](0x0);var events={'afterCreate':_0xeb86('0x4'),'afterUpdate':'update','afterDestroy':_0xeb86('0x5')};function emitEvent(_0x41a709){return function(_0x487567,_0x466c74,_0x1e7786){SmsMessageEvents['emit'](_0x41a709+':'+_0x487567['id'],_0x487567);SmsMessageEvents[_0xeb86('0x6')](_0x41a709,_0x487567);_0x1e7786(null);};}for(var e in events){if(events[_0xeb86('0x7')](e)){var event=events[e];SmsMessage[_0xeb86('0x8')](e,emitEvent(event));}}module[_0xeb86('0x9')]=SmsMessageEvents; \ No newline at end of file +var _0xfa59=['emit','hook','exports','events','SmsMessage','setMaxListeners','save','update','remove'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfa59,0xf6));var _0x9fa5=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xfa59[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x9fa5('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x9fa5('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x9fa5('0x2')](0x0);var events={'afterCreate':_0x9fa5('0x3'),'afterUpdate':_0x9fa5('0x4'),'afterDestroy':_0x9fa5('0x5')};function emitEvent(_0x3d8f91){return function(_0x55a7db,_0x3afaac,_0x499296){SmsMessageEvents[_0x9fa5('0x6')](_0x3d8f91+':'+_0x55a7db['id'],_0x55a7db);SmsMessageEvents[_0x9fa5('0x6')](_0x3d8f91,_0x55a7db);_0x499296(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsMessage[_0x9fa5('0x7')](e,emitEvent(event));}}module[_0x9fa5('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 0fafd68..6eefb77 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 _0xe5c3=['FULLTEXT','models','direction','toLowerCase','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','catch','secret','SmsAccount','find','type','twilio','accountSid','authToken','phone','/api/sms/messages/','/status?token=','token','sid','error','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','password','smsMethod','sender','&password=','GET','sms','user_key','session_key','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','senderString','POST','requestid','Missing\x20parameters:\x20authToken','username','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','data','queued_count','head','messages','message_id','clickSend','plivo','authId','remote','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','keys','length','createHash','digest','hex','signature=','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','https://api.intelepeer.com/_rest/v4/app/sms/send','code','message','Bearer\x20','status','refid','intelepeer','finally','utf8mb4','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','messageId','fti_sms_messages','body'];(function(_0x50d94d,_0x174f36){var _0x3500c5=function(_0x152c7f){while(--_0x152c7f){_0x50d94d['push'](_0x50d94d['shift']());}};_0x3500c5(++_0x174f36);}(_0xe5c3,0x65));var _0x3e5c=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xe5c3[_0x160c73];return _0xd9302;};'use strict';var _=require(_0x3e5c('0x0'));var util=require(_0x3e5c('0x1'));var logger=require('../../config/logger')(_0x3e5c('0x2'));var moment=require(_0x3e5c('0x3'));var BPromise=require(_0x3e5c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3e5c('0x5'));var rimraf=require(_0x3e5c('0x6'));var config=require(_0x3e5c('0x7'));var attributes=require(_0x3e5c('0x8'));module[_0x3e5c('0x9')]=function(_0x510f13,_0xa78f58){return _0x510f13['define'](_0x3e5c('0xa'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0x3e5c('0xb'),'fields':[_0x3e5c('0xb')]},{'name':_0x3e5c('0xc'),'fields':[_0x3e5c('0xd')],'type':_0x3e5c('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc8b40d,_0x5d9b55,_0x57f72d){var _0x37ed12=_0x510f13[_0x3e5c('0xf')];var _0x38d110=_0xc8b40d['get']({'plain':!![]});if(_0x38d110[_0x3e5c('0x10')][_0x3e5c('0x11')]()==='in'||_0x38d110[_0x3e5c('0x10')][_0x3e5c('0x11')]()==='out'&&!_0x38d110['secret']&&!_[_0x3e5c('0x12')](_0x38d110[_0x3e5c('0x13')])){_0x37ed12[_0x3e5c('0x14')][_0x3e5c('0x15')]({'where':{'id':_0x38d110[_0x3e5c('0x16')]}})[_0x3e5c('0x17')](function(_0x3d3991){if(_0x3d3991){_0x3d3991[_0x3e5c('0x18')]({'lastMsgAt':_0x38d110['createdAt'],'lastMsgDirection':_0x38d110[_0x3e5c('0x10')][_0x3e5c('0x11')]()});}})[_0x3e5c('0x19')](function(_0x3ad3c7){console['error'](_0x3ad3c7);});}if(_0x38d110[_0x3e5c('0x10')]==='out'&&!_0x38d110[_0x3e5c('0x1a')]){var _0xbaa3c5;_0x37ed12[_0x3e5c('0x1b')][_0x3e5c('0x1c')]({'where':{'id':_0x38d110['SmsAccountId']},'raw':!![]})[_0x3e5c('0x17')](function(_0x5df2a1){_0xbaa3c5=_0x5df2a1;if(_0xbaa3c5&&_0xbaa3c5[_0x3e5c('0x1d')]){switch(_0xbaa3c5[_0x3e5c('0x1d')]){case _0x3e5c('0x1e'):var _0x2e2cc5=require(_0x3e5c('0x1e'));if(_0xbaa3c5[_0x3e5c('0x1f')]&&_0xbaa3c5[_0x3e5c('0x20')]&&_0xbaa3c5[_0x3e5c('0x21')]){var _0x4dac93=new _0x2e2cc5(_0xbaa3c5[_0x3e5c('0x1f')],_0xbaa3c5['authToken']);_0x4dac93['messages']['create']({'body':_0x38d110[_0x3e5c('0xd')],'to':_0x38d110['phone'],'from':_0xbaa3c5[_0x3e5c('0x21')],'statusCallback':_0xbaa3c5['remote']+_0x3e5c('0x22')+_0x38d110['id']+_0x3e5c('0x23')+_0xbaa3c5[_0x3e5c('0x24')]})[_0x3e5c('0x17')](function(_0x212784){if(_0x212784[_0x3e5c('0x25')]){return _0xc8b40d[_0x3e5c('0x18')]({'messageId':_0x212784[_0x3e5c('0x25')]});}})[_0x3e5c('0x19')](function(_0x416eec){logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x1e'),util[_0x3e5c('0x29')](_0x416eec,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x3e5c('0x27'),_0x3e5c('0x28'),'twilio',_0x3e5c('0x2a'));}break;case _0x3e5c('0x2b'):var _0x59dce9=_0x3e5c('0x2c');if(_0xbaa3c5['username']&&_0xbaa3c5[_0x3e5c('0x2d')]){var _0x2696f6={'recipient':[_0x38d110[_0x3e5c('0x21')]],'message':_0x38d110[_0x3e5c('0xd')],'message_type':_0xbaa3c5[_0x3e5c('0x2e')]};if(_0xbaa3c5[_0x3e5c('0x2e')]&&_0xbaa3c5[_0x3e5c('0x2e')]!=='SI'){_0x2696f6[_0x3e5c('0x2f')]=_0xbaa3c5[_0x3e5c('0x21')];}var _0x3df83d={'url':_0x59dce9+'login?username='+_0xbaa3c5['username']+_0x3e5c('0x30')+_0xbaa3c5[_0x3e5c('0x2d')],'method':_0x3e5c('0x31')};rp(_0x3df83d)[_0x3e5c('0x17')](function(_0x18fb80){var _0xb83605=_0x18fb80['split'](';');var _0x241dc3={'user_key':_0xb83605[0x0],'session_key':_0xb83605[0x1]};_0x3df83d={'url':_0x59dce9+_0x3e5c('0x32'),'method':'POST','headers':{'user_key':_0x241dc3[_0x3e5c('0x33')],'Session_key':_0x241dc3[_0x3e5c('0x34')]},'json':!![],'body':_0x2696f6};return rp(_0x3df83d);})['then'](function(_0x34c99a){if(_0x34c99a['total_sent']>=0x1){var _0x56efbc={'messageId':_0x34c99a[_0x3e5c('0x35')]};if(_0xbaa3c5[_0x3e5c('0x2e')]!=='GP'||!_0xbaa3c5[_0x3e5c('0x36')]){_0x56efbc[_0x3e5c('0x37')]=!![];}return _0xc8b40d[_0x3e5c('0x18')](_0x56efbc);}else{return logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),'skebby',util[_0x3e5c('0x29')](_0x34c99a,{'showHidden':![],'depth':null}));}})[_0x3e5c('0x19')](function(_0x3e99d3){return logger[_0x3e5c('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e5c('0x28'),_0x3e5c('0x2b'),util[_0x3e5c('0x29')](_0x3e99d3,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e5c('0x28'),_0x3e5c('0x2b'),_0x3e5c('0x38'));}break;case _0x3e5c('0x39'):if(_0xbaa3c5[_0x3e5c('0x20')]){var _0xf32324={'recipient':_0x38d110[_0x3e5c('0x21')],'message':_0x38d110[_0x3e5c('0xd')],'sender':_0xbaa3c5[_0x3e5c('0x3a')]||_0xbaa3c5[_0x3e5c('0x21')],'authorization':_0xbaa3c5[_0x3e5c('0x20')]};var _0x5d9b55={'method':_0x3e5c('0x3b'),'uri':'https://smsapi.connectel.se/api/send/','body':_0xf32324,'json':!![]};rp(_0x5d9b55)[_0x3e5c('0x17')](function(_0xc947d2){var _0x97630e={'messageId':_0xc947d2[_0x3e5c('0x3c')]};if(!_0xbaa3c5['deliveryReport']){_0x97630e[_0x3e5c('0x37')]=!![];}return _0xc8b40d[_0x3e5c('0x18')](_0x97630e);})[_0x3e5c('0x19')](function(_0x1d91a8){logger[_0x3e5c('0x26')](_0x3e5c('0x27'),'afterCreate',_0x3e5c('0x39'),util[_0x3e5c('0x29')](_0x1d91a8,{'showHidden':![],'depth':null}));});}else{logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x39'),_0x3e5c('0x3d'));}break;case'clicksend':if(_0xbaa3c5[_0x3e5c('0x3e')]&&_0xbaa3c5['password']){var _0xf32324={'messages':[{'source':_0x3e5c('0x3f'),'to':_0x38d110['phone'],'body':_0x38d110[_0x3e5c('0xd')],'from':_0xbaa3c5['senderString']||_0xbaa3c5[_0x3e5c('0x21')]}]};var _0x3c6598=util[_0x3e5c('0x40')](_0x3e5c('0x41'),_0xbaa3c5[_0x3e5c('0x3e')],_0xbaa3c5[_0x3e5c('0x2d')]);var _0x5d9b55={'method':_0x3e5c('0x3b'),'uri':_0x3e5c('0x42'),'body':_0xf32324,'headers':{'Authorization':util['format'](_0x3e5c('0x43'),new Buffer(_0x3c6598)[_0x3e5c('0x44')](_0x3e5c('0x45')))},'json':!![]};rp(_0x5d9b55)[_0x3e5c('0x17')](function(_0x2bc20c){if(_0x2bc20c['http_code']>=0xc8&&_0x2bc20c['http_code']<=0xce){if(_0x2bc20c['data']&&_0x2bc20c[_0x3e5c('0x46')][_0x3e5c('0x47')]>0x0){var _0x46b07a=_[_0x3e5c('0x48')](_0x2bc20c[_0x3e5c('0x46')][_0x3e5c('0x49')]);var _0x575350={'messageId':_0x46b07a[_0x3e5c('0x4a')]};if(!_0xbaa3c5[_0x3e5c('0x36')]){_0x575350[_0x3e5c('0x37')]=!![];}return _0xc8b40d[_0x3e5c('0x18')](_0x575350);}else{logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x4b'),util['inspect'](_0x2bc20c,{'showHidden':![],'depth':null}));}}else{logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),'clickSend',util[_0x3e5c('0x29')](_0x2bc20c,{'showHidden':![],'depth':null}));}})[_0x3e5c('0x19')](function(_0x3db5a3){logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x4b'),util[_0x3e5c('0x29')](_0x3db5a3,{'showHidden':![],'depth':null}));});}else{logger[_0x3e5c('0x26')](_0x3e5c('0x27'),'afterCreate',_0x3e5c('0x4b'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x3e5c('0x4c'):if(_0xbaa3c5[_0x3e5c('0x4d')]&&_0xbaa3c5['authToken']){var _0xf32324={'dst':_0x38d110[_0x3e5c('0x21')],'text':_0x38d110['body'],'src':_0xbaa3c5['senderString']||_0xbaa3c5[_0x3e5c('0x21')],'url':_0xbaa3c5[_0x3e5c('0x4e')]+_0x3e5c('0x22')+_0x38d110['id']+'/status?token='+_0xbaa3c5['token']};var _0x3c6598=util[_0x3e5c('0x40')](_0x3e5c('0x41'),_0xbaa3c5[_0x3e5c('0x4d')],_0xbaa3c5[_0x3e5c('0x20')]);var _0x5d9b55={'method':_0x3e5c('0x3b'),'uri':util[_0x3e5c('0x40')]('https://api.plivo.com/v1/Account/%s/Message/',_0xbaa3c5['authId']),'body':_0xf32324,'headers':{'Authorization':util[_0x3e5c('0x40')](_0x3e5c('0x43'),new Buffer(_0x3c6598)[_0x3e5c('0x44')]('base64'))},'json':!![]};rp(_0x5d9b55)[_0x3e5c('0x17')](function(_0x3f8fd8){var _0x169e6b={'messageId':_0x3f8fd8[_0x3e5c('0x4f')][0x0]};return _0xc8b40d[_0x3e5c('0x18')](_0x169e6b);})[_0x3e5c('0x19')](function(_0x5e856d){logger[_0x3e5c('0x26')](_0x3e5c('0x27'),'afterCreate',_0x3e5c('0x4c'),util[_0x3e5c('0x29')](_0x5e856d,{'showHidden':![],'depth':null}));});}else{logger[_0x3e5c('0x26')](_0x3e5c('0x27'),'afterCreate',_0x3e5c('0x4c'),_0x3e5c('0x50'));}break;case _0x3e5c('0x51'):if(_0xbaa3c5[_0x3e5c('0x3e')]&&_0xbaa3c5[_0x3e5c('0x2d')]){if(_0xbaa3c5[_0x3e5c('0x52')]){var _0x56574b={'method':_0x3e5c('0x3b'),'uri':_0xbaa3c5['baseUrl']+_0x3e5c('0x53'),'body':{'username':_0xbaa3c5[_0x3e5c('0x3e')],'password':_0xbaa3c5[_0x3e5c('0x2d')]},'json':!![]};return rp(_0x56574b)[_0x3e5c('0x17')](function(_0x23a0b1){var _0x48e964={'method':_0x3e5c('0x3b'),'uri':_0xbaa3c5[_0x3e5c('0x52')]+_0x3e5c('0x54'),'body':{'messages':[{'from':_0xbaa3c5[_0x3e5c('0x21')],'destinations':[{'to':_0x38d110['phone']}],'text':_0x38d110[_0x3e5c('0xd')],'notifyUrl':_0xbaa3c5[_0x3e5c('0x4e')]+_0x3e5c('0x22')+_0x38d110['id']+_0x3e5c('0x23')+_0xbaa3c5[_0x3e5c('0x24')],'notifyContentType':_0x3e5c('0x55'),'callbackData':_0xbaa3c5[_0x3e5c('0x21')]+';'+_0x38d110[_0x3e5c('0xd')]}]},'headers':{'Authorization':_0x3e5c('0x56')+_0x23a0b1[_0x3e5c('0x24')]},'json':!![]};return rp(_0x48e964)[_0x3e5c('0x17')](function(_0x269d60){if(_0x269d60[_0x3e5c('0x49')]){var _0x2c49d0={'messageId':_0x269d60[_0x3e5c('0x49')][0x0][_0x3e5c('0xb')]};if(!_0xbaa3c5['deliveryReport']){_0x2c49d0['read']=!![];}return _0xc8b40d['update'](_0x2c49d0);}else{return logger[_0x3e5c('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e5c('0x28'),_0x3e5c('0x51'),util[_0x3e5c('0x29')](_0x269d60,{'showHidden':![],'depth':null}));}});})[_0x3e5c('0x19')](function(_0xd196c7){return logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x51'),util[_0x3e5c('0x29')](_0xd196c7,{'showHidden':![],'depth':null}));});}else{logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x51'),_0x3e5c('0x57'));}}else{logger[_0x3e5c('0x26')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x3e5c('0x51'),_0x3e5c('0x38'));}break;case _0x3e5c('0x58'):var _0x1c3561=require('crypto');if(_0xbaa3c5[_0x3e5c('0x59')]){var _0x4198bd={};_0x4198bd[_0x3e5c('0x5a')]=_0xbaa3c5[_0x3e5c('0x3e')];_0x4198bd[_0x3e5c('0x21')]=_0x38d110[_0x3e5c('0x21')];_0x4198bd[_0x3e5c('0x2f')]=_0xbaa3c5['phone'];_0x4198bd[_0x3e5c('0x5b')]=_0x38d110[_0x3e5c('0xd')];_0x4198bd['timestamp']=+new Date();var _0x3ec993='';var _0x251336='';var _0x28ce5a=Object[_0x3e5c('0x5c')](_0x4198bd);_0x28ce5a['sort']();for(var _0x11e4a3=0x0;_0x11e4a3<_0x28ce5a[_0x3e5c('0x5d')];_0x11e4a3++){if(_0x3ec993!=''){_0x3ec993+='&';}_0x3ec993+=_0x28ce5a[_0x11e4a3]+'='+encodeURIComponent(_0x4198bd[_0x28ce5a[_0x11e4a3]]);_0x251336+=_0x4198bd[_0x28ce5a[_0x11e4a3]];}_0x251336+=_0xbaa3c5[_0x3e5c('0x59')];_0x251336=_0x1c3561[_0x3e5c('0x5e')]('md5')[_0x3e5c('0x18')](_0x251336)[_0x3e5c('0x5f')](_0x3e5c('0x60'));if(_0x3ec993!==''){_0x3ec993+='&';}_0x3ec993+=_0x3e5c('0x61')+_0x251336;var _0x3df83d={'method':_0x3e5c('0x31'),'uri':_0x3e5c('0x62')+_0x3ec993,'json':!![]};return rp(_0x3df83d)[_0x3e5c('0x17')](function(_0x1d1b84){var _0x59d89d=Object[_0x3e5c('0x5c')](_0x1d1b84);if(_0x1d1b84[_0x59d89d[0x0]][_0x3e5c('0x26')]&&parseInt(_0x1d1b84[_0x59d89d[0x0]][_0x3e5c('0x26')])===0x0){var _0xc1604a={'messageId':_0x1d1b84[_0x59d89d[0x0]][_0x3e5c('0x63')]};if(!_0xbaa3c5[_0x3e5c('0x36')]){_0xc1604a[_0x3e5c('0x37')]=!![];}return _0xc8b40d[_0x3e5c('0x18')](_0xc1604a);}else{return logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),'csc',util[_0x3e5c('0x29')](_0x1d1b84[_0x3e5c('0x26')],{'showHidden':![],'depth':null}));}})[_0x3e5c('0x19')](function(_0x1cf354){return logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),'csc',util[_0x3e5c('0x29')](_0x1cf354,{'showHidden':![],'depth':null}));});}else{logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x58'),_0x3e5c('0x64'));}break;case _0x3e5c('0x65'):if(_0xbaa3c5['apiKey']){var _0x25e0d7={'method':_0x3e5c('0x3b'),'uri':_0x3e5c('0x66'),'headers':{'Authorization':_0xbaa3c5['apiKey']},'body':{'content':_0x38d110['body'],'to':[_0x38d110[_0x3e5c('0x21')]],'from':_0xbaa3c5[_0x3e5c('0x21')],'binary':![],'clientMessageId':_0x3e5c('0x67'),'charset':_0x3e5c('0x68')},'json':!![]};rp(_0x25e0d7)['then'](function(_0x3c0fa3){if(!_0x3c0fa3[_0x3e5c('0x26')]){var _0x50fb7b={'messageId':_0x3c0fa3[_0x3e5c('0x49')][0x0][_0x3e5c('0x69')]};if(!_0xbaa3c5[_0x3e5c('0x36')]){_0x50fb7b[_0x3e5c('0x37')]=!![];}return _0xc8b40d['update'](_0x50fb7b);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e5c('0x28'),_0x3e5c('0x65'),util[_0x3e5c('0x29')](_0x3c0fa3['error'],{'showHidden':![],'depth':null}));}})[_0x3e5c('0x19')](function(_0x1ebdcc){return logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x65'),util[_0x3e5c('0x29')](_0x1ebdcc,{'showHidden':![],'depth':null}));});}else{logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),'clickatell',_0x3e5c('0x64'));}break;case'intelepeer':if(_0xbaa3c5[_0x3e5c('0x59')]){var _0x4513db={};var _0x3df83d={'method':'POST','uri':_0x3e5c('0x6a'),'headers':{'Authorization':'Bearer\x20'+_0xbaa3c5[_0x3e5c('0x59')],'Content-Type':_0x3e5c('0x55')},'body':{'from':_0xbaa3c5[_0x3e5c('0x21')],'to':_0x38d110[_0x3e5c('0x21')],'text':_0x38d110[_0x3e5c('0xd')]},'json':!![]};return rp(_0x3df83d)[_0x3e5c('0x17')](function(_0x1536d6){if(_0x1536d6[_0x3e5c('0x6b')]==0xca){_0x4513db[_0x3e5c('0x6c')]=_0x1536d6;var _0x5de30c={'method':_0x3e5c('0x3b'),'uri':'https://api.intelepeer.com/_rest/v4/app/sms/mdr','headers':{'Authorization':_0x3e5c('0x6d')+_0xbaa3c5[_0x3e5c('0x59')],'Content-Type':'application/json'},'body':{'refid':_0x4513db[_0x3e5c('0x6c')]['refid']},'json':!![]};return rp(_0x5de30c)[_0x3e5c('0x17')](function(_0x3aae93){_0x4513db[_0x3e5c('0x6e')]=_0x3aae93;var _0x20dbc3={'messageId':_0x4513db[_0x3e5c('0x6c')][_0x3e5c('0x6f')],'read':!![]};return _0xc8b40d[_0x3e5c('0x18')](_0x20dbc3);});}else{return logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x70'),util[_0x3e5c('0x29')](_0x1536d6,{'showHidden':![],'depth':null}));}})[_0x3e5c('0x19')](function(_0x5b654b){return logger[_0x3e5c('0x26')](_0x3e5c('0x27'),_0x3e5c('0x28'),_0x3e5c('0x70'),util[_0x3e5c('0x29')](_0x5b654b,{'showHidden':![],'depth':null}));});}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3e5c('0x28'),'intelepeer','Token\x20not\x20received');}break;}}})[_0x3e5c('0x71')](function(){_0x57f72d();});}else{_0x57f72d();}}},'charset':_0x3e5c('0x72'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x4224=['UTF-8','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','path','rimraf','../../config/environment','./smsMessage.attributes','exports','sms_messages','messageId','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','findOne','SmsInteractionId','then','update','createdAt','error','SmsAccount','SmsAccountId','type','twilio','accountSid','authToken','phone','remote','/api/sms/messages/','/status?token=','token','sid','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','split','sms','POST','user_key','session_key','total_sent','internal_order_id','deliveryReport','read','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','format','%s:%s','toString','http_code','data','head','messages','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','application/json','IBSSO\x20','csc','crypto','apiKey','login','timestamp','keys','sort','length','createHash','md5','digest','hex','GET','https://sms.csc.lv/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid'];(function(_0x924bb0,_0x3ff9c3){var _0x463a09=function(_0x1caf7c){while(--_0x1caf7c){_0x924bb0['push'](_0x924bb0['shift']());}};_0x463a09(++_0x3ff9c3);}(_0x4224,0x82));var _0x4422=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x4224[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x4422('0x0'));var util=require(_0x4422('0x1'));var logger=require(_0x4422('0x2'))(_0x4422('0x3'));var moment=require(_0x4422('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x4422('0x5'));var rimraf=require(_0x4422('0x6'));var config=require(_0x4422('0x7'));var attributes=require(_0x4422('0x8'));module[_0x4422('0x9')]=function(_0x5b0cad,_0xa8cdd2){return _0x5b0cad['define']('SmsMessage',attributes,{'tableName':_0x4422('0xa'),'paranoid':![],'indexes':[{'name':_0x4422('0xb'),'fields':[_0x4422('0xb')]},{'name':'fti_sms_messages','fields':[_0x4422('0xc')],'type':_0x4422('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x374ab0,_0x5aec0f,_0x52e547){var _0x1bb926=_0x5b0cad['models'];var _0x452a9a=_0x374ab0[_0x4422('0xe')]({'plain':!![]});if(_0x452a9a[_0x4422('0xf')]['toLowerCase']()==='in'||_0x452a9a[_0x4422('0xf')][_0x4422('0x10')]()===_0x4422('0x11')&&!_0x452a9a[_0x4422('0x12')]&&!_[_0x4422('0x13')](_0x452a9a[_0x4422('0x14')])){_0x1bb926['SmsInteraction'][_0x4422('0x15')]({'where':{'id':_0x452a9a[_0x4422('0x16')]}})[_0x4422('0x17')](function(_0x12be40){if(_0x12be40){_0x12be40[_0x4422('0x18')]({'lastMsgAt':_0x452a9a[_0x4422('0x19')],'lastMsgDirection':_0x452a9a[_0x4422('0xf')][_0x4422('0x10')]()});}})['catch'](function(_0x31a340){console[_0x4422('0x1a')](_0x31a340);});}if(_0x452a9a[_0x4422('0xf')]==='out'&&!_0x452a9a['secret']){var _0x20a139;_0x1bb926[_0x4422('0x1b')]['find']({'where':{'id':_0x452a9a[_0x4422('0x1c')]},'raw':!![]})[_0x4422('0x17')](function(_0x5bdc8a){_0x20a139=_0x5bdc8a;if(_0x20a139&&_0x20a139[_0x4422('0x1d')]){switch(_0x20a139[_0x4422('0x1d')]){case _0x4422('0x1e'):var _0x184114=require(_0x4422('0x1e'));if(_0x20a139[_0x4422('0x1f')]&&_0x20a139[_0x4422('0x20')]&&_0x20a139[_0x4422('0x21')]){var _0x5f41a7=new _0x184114(_0x20a139[_0x4422('0x1f')],_0x20a139['authToken']);_0x5f41a7['messages']['create']({'body':_0x452a9a[_0x4422('0xc')],'to':_0x452a9a['phone'],'from':_0x20a139[_0x4422('0x21')],'statusCallback':_0x20a139[_0x4422('0x22')]+_0x4422('0x23')+_0x452a9a['id']+_0x4422('0x24')+_0x20a139[_0x4422('0x25')]})[_0x4422('0x17')](function(_0x5e654d){if(_0x5e654d[_0x4422('0x26')]){return _0x374ab0[_0x4422('0x18')]({'messageId':_0x5e654d[_0x4422('0x26')]});}})[_0x4422('0x27')](function(_0x3db310){logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x1e'),util[_0x4422('0x2a')](_0x3db310,{'showHidden':![],'depth':null}));});}else{logger[_0x4422('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4422('0x29'),_0x4422('0x1e'),_0x4422('0x2b'));}break;case'skebby':var _0x3eb493=_0x4422('0x2c');if(_0x20a139[_0x4422('0x2d')]&&_0x20a139[_0x4422('0x2e')]){var _0x19b7d5={'recipient':[_0x452a9a[_0x4422('0x21')]],'message':_0x452a9a[_0x4422('0xc')],'message_type':_0x20a139[_0x4422('0x2f')]};if(_0x20a139[_0x4422('0x2f')]&&_0x20a139['smsMethod']!=='SI'){_0x19b7d5[_0x4422('0x30')]=_0x20a139['phone'];}var _0x313fcb={'url':_0x3eb493+'login?username='+_0x20a139['username']+'&password='+_0x20a139[_0x4422('0x2e')],'method':'GET'};rp(_0x313fcb)[_0x4422('0x17')](function(_0x19069b){var _0x508e89=_0x19069b[_0x4422('0x31')](';');var _0x42ad5={'user_key':_0x508e89[0x0],'session_key':_0x508e89[0x1]};_0x313fcb={'url':_0x3eb493+_0x4422('0x32'),'method':_0x4422('0x33'),'headers':{'user_key':_0x42ad5[_0x4422('0x34')],'Session_key':_0x42ad5[_0x4422('0x35')]},'json':!![],'body':_0x19b7d5};return rp(_0x313fcb);})['then'](function(_0x3fa720){if(_0x3fa720[_0x4422('0x36')]>=0x1){var _0x1f100f={'messageId':_0x3fa720[_0x4422('0x37')]};if(_0x20a139[_0x4422('0x2f')]!=='GP'||!_0x20a139[_0x4422('0x38')]){_0x1f100f[_0x4422('0x39')]=!![];}return _0x374ab0[_0x4422('0x18')](_0x1f100f);}else{return logger[_0x4422('0x1a')](_0x4422('0x28'),'afterCreate',_0x4422('0x3a'),util[_0x4422('0x2a')](_0x3fa720,{'showHidden':![],'depth':null}));}})[_0x4422('0x27')](function(_0x3852eb){return logger[_0x4422('0x1a')](_0x4422('0x28'),'afterCreate',_0x4422('0x3a'),util['inspect'](_0x3852eb,{'showHidden':![],'depth':null}));});}else{logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x3a'),_0x4422('0x3b'));}break;case _0x4422('0x3c'):if(_0x20a139[_0x4422('0x20')]){var _0x43add2={'recipient':_0x452a9a[_0x4422('0x21')],'message':_0x452a9a['body'],'sender':_0x20a139[_0x4422('0x3d')]||_0x20a139[_0x4422('0x21')],'authorization':_0x20a139['authToken']};var _0x5aec0f={'method':_0x4422('0x33'),'uri':_0x4422('0x3e'),'body':_0x43add2,'json':!![]};rp(_0x5aec0f)[_0x4422('0x17')](function(_0x5b614f){var _0x5ee6b9={'messageId':_0x5b614f[_0x4422('0x3f')]};if(!_0x20a139[_0x4422('0x38')]){_0x5ee6b9[_0x4422('0x39')]=!![];}return _0x374ab0['update'](_0x5ee6b9);})[_0x4422('0x27')](function(_0x1b9b50){logger[_0x4422('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4422('0x29'),'connectel',util[_0x4422('0x2a')](_0x1b9b50,{'showHidden':![],'depth':null}));});}else{logger[_0x4422('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x4422('0x3c'),'Missing\x20parameters:\x20authToken');}break;case'clicksend':if(_0x20a139[_0x4422('0x2d')]&&_0x20a139[_0x4422('0x2e')]){var _0x43add2={'messages':[{'source':'xCALLY\x20Motion','to':_0x452a9a[_0x4422('0x21')],'body':_0x452a9a[_0x4422('0xc')],'from':_0x20a139[_0x4422('0x3d')]||_0x20a139[_0x4422('0x21')]}]};var _0x2c26f4=util[_0x4422('0x40')](_0x4422('0x41'),_0x20a139['username'],_0x20a139['password']);var _0x5aec0f={'method':_0x4422('0x33'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x43add2,'headers':{'Authorization':util[_0x4422('0x40')]('Basic\x20%s',new Buffer(_0x2c26f4)[_0x4422('0x42')]('base64'))},'json':!![]};rp(_0x5aec0f)[_0x4422('0x17')](function(_0x3f1bd5){if(_0x3f1bd5[_0x4422('0x43')]>=0xc8&&_0x3f1bd5[_0x4422('0x43')]<=0xce){if(_0x3f1bd5[_0x4422('0x44')]&&_0x3f1bd5[_0x4422('0x44')]['queued_count']>0x0){var _0x3c7855=_[_0x4422('0x45')](_0x3f1bd5[_0x4422('0x44')][_0x4422('0x46')]);var _0x4bb927={'messageId':_0x3c7855[_0x4422('0x47')]};if(!_0x20a139[_0x4422('0x38')]){_0x4bb927['read']=!![];}return _0x374ab0[_0x4422('0x18')](_0x4bb927);}else{logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x48'),util[_0x4422('0x2a')](_0x3f1bd5,{'showHidden':![],'depth':null}));}}else{logger['error'](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x48'),util['inspect'](_0x3f1bd5,{'showHidden':![],'depth':null}));}})[_0x4422('0x27')](function(_0x42be1a){logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),'clickSend',util[_0x4422('0x2a')](_0x42be1a,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4422('0x28'),'afterCreate',_0x4422('0x48'),_0x4422('0x3b'));}break;case _0x4422('0x49'):if(_0x20a139[_0x4422('0x4a')]&&_0x20a139['authToken']){var _0x43add2={'dst':_0x452a9a[_0x4422('0x21')],'text':_0x452a9a[_0x4422('0xc')],'src':_0x20a139[_0x4422('0x3d')]||_0x20a139['phone'],'url':_0x20a139['remote']+_0x4422('0x23')+_0x452a9a['id']+'/status?token='+_0x20a139[_0x4422('0x25')]};var _0x2c26f4=util[_0x4422('0x40')](_0x4422('0x41'),_0x20a139[_0x4422('0x4a')],_0x20a139['authToken']);var _0x5aec0f={'method':'POST','uri':util[_0x4422('0x40')](_0x4422('0x4b'),_0x20a139[_0x4422('0x4a')]),'body':_0x43add2,'headers':{'Authorization':util[_0x4422('0x40')](_0x4422('0x4c'),new Buffer(_0x2c26f4)[_0x4422('0x42')](_0x4422('0x4d')))},'json':!![]};rp(_0x5aec0f)[_0x4422('0x17')](function(_0x4043c7){var _0x4174cf={'messageId':_0x4043c7['message_uuid'][0x0]};return _0x374ab0[_0x4422('0x18')](_0x4174cf);})['catch'](function(_0x1319bf){logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4422('0x29'),_0x4422('0x49'),util[_0x4422('0x2a')](_0x1319bf,{'showHidden':![],'depth':null}));});}else{logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),'plivo',_0x4422('0x4e'));}break;case _0x4422('0x4f'):if(_0x20a139[_0x4422('0x2d')]&&_0x20a139[_0x4422('0x2e')]){if(_0x20a139['baseUrl']){var _0x2dc752={'method':_0x4422('0x33'),'uri':_0x20a139[_0x4422('0x50')]+'/auth/1/session','body':{'username':_0x20a139[_0x4422('0x2d')],'password':_0x20a139[_0x4422('0x2e')]},'json':!![]};return rp(_0x2dc752)[_0x4422('0x17')](function(_0x28a111){var _0x5e6a82={'method':'POST','uri':_0x20a139[_0x4422('0x50')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0x20a139['phone'],'destinations':[{'to':_0x452a9a[_0x4422('0x21')]}],'text':_0x452a9a['body'],'notifyUrl':_0x20a139[_0x4422('0x22')]+_0x4422('0x23')+_0x452a9a['id']+_0x4422('0x24')+_0x20a139[_0x4422('0x25')],'notifyContentType':_0x4422('0x51'),'callbackData':_0x20a139[_0x4422('0x21')]+';'+_0x452a9a[_0x4422('0xc')]}]},'headers':{'Authorization':_0x4422('0x52')+_0x28a111['token']},'json':!![]};return rp(_0x5e6a82)[_0x4422('0x17')](function(_0x33f81e){if(_0x33f81e[_0x4422('0x46')]){var _0x240a8d={'messageId':_0x33f81e['messages'][0x0][_0x4422('0xb')]};if(!_0x20a139[_0x4422('0x38')]){_0x240a8d['read']=!![];}return _0x374ab0['update'](_0x240a8d);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4422('0x29'),_0x4422('0x4f'),util[_0x4422('0x2a')](_0x33f81e,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x11654f){return logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x4f'),util[_0x4422('0x2a')](_0x11654f,{'showHidden':![],'depth':null}));});}else{logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x4f'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),'infobip',_0x4422('0x3b'));}break;case _0x4422('0x53'):var _0x169c5c=require(_0x4422('0x54'));if(_0x20a139[_0x4422('0x55')]){var _0xa77bb5={};_0xa77bb5[_0x4422('0x56')]=_0x20a139['username'];_0xa77bb5['phone']=_0x452a9a[_0x4422('0x21')];_0xa77bb5[_0x4422('0x30')]=_0x20a139[_0x4422('0x21')];_0xa77bb5['text']=_0x452a9a[_0x4422('0xc')];_0xa77bb5[_0x4422('0x57')]=+new Date();var _0x1c5ae8='';var _0x28262e='';var _0x354868=Object[_0x4422('0x58')](_0xa77bb5);_0x354868[_0x4422('0x59')]();for(var _0x5ed1f8=0x0;_0x5ed1f8<_0x354868[_0x4422('0x5a')];_0x5ed1f8++){if(_0x1c5ae8!=''){_0x1c5ae8+='&';}_0x1c5ae8+=_0x354868[_0x5ed1f8]+'='+encodeURIComponent(_0xa77bb5[_0x354868[_0x5ed1f8]]);_0x28262e+=_0xa77bb5[_0x354868[_0x5ed1f8]];}_0x28262e+=_0x20a139[_0x4422('0x55')];_0x28262e=_0x169c5c[_0x4422('0x5b')](_0x4422('0x5c'))[_0x4422('0x18')](_0x28262e)[_0x4422('0x5d')](_0x4422('0x5e'));if(_0x1c5ae8!==''){_0x1c5ae8+='&';}_0x1c5ae8+='signature='+_0x28262e;var _0x313fcb={'method':_0x4422('0x5f'),'uri':_0x4422('0x60')+_0x1c5ae8,'json':!![]};return rp(_0x313fcb)['then'](function(_0x4c8de4){var _0x49eb31=Object['keys'](_0x4c8de4);if(_0x4c8de4[_0x49eb31[0x0]][_0x4422('0x1a')]&&parseInt(_0x4c8de4[_0x49eb31[0x0]][_0x4422('0x1a')])===0x0){var _0x366126={'messageId':_0x4c8de4[_0x49eb31[0x0]][_0x4422('0x61')]};if(!_0x20a139[_0x4422('0x38')]){_0x366126[_0x4422('0x39')]=!![];}return _0x374ab0[_0x4422('0x18')](_0x366126);}else{return logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x53'),util[_0x4422('0x2a')](_0x4c8de4[_0x4422('0x1a')],{'showHidden':![],'depth':null}));}})[_0x4422('0x27')](function(_0x557dff){return logger['error'](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x53'),util[_0x4422('0x2a')](_0x557dff,{'showHidden':![],'depth':null}));});}else{logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x53'),_0x4422('0x62'));}break;case _0x4422('0x63'):if(_0x20a139[_0x4422('0x55')]){var _0x1f34b4={'method':_0x4422('0x33'),'uri':_0x4422('0x64'),'headers':{'Authorization':_0x20a139[_0x4422('0x55')]},'body':{'content':_0x452a9a[_0x4422('0xc')],'to':[_0x452a9a['phone']],'from':_0x20a139[_0x4422('0x21')],'binary':![],'clientMessageId':_0x4422('0x65'),'charset':_0x4422('0x66')},'json':!![]};rp(_0x1f34b4)[_0x4422('0x17')](function(_0x3e8896){if(!_0x3e8896[_0x4422('0x1a')]){var _0x554fb2={'messageId':_0x3e8896[_0x4422('0x46')][0x0][_0x4422('0x67')]};if(!_0x20a139[_0x4422('0x38')]){_0x554fb2[_0x4422('0x39')]=!![];}return _0x374ab0[_0x4422('0x18')](_0x554fb2);}else{return logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x63'),util[_0x4422('0x2a')](_0x3e8896[_0x4422('0x1a')],{'showHidden':![],'depth':null}));}})[_0x4422('0x27')](function(_0x345127){return logger['error'](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x63'),util['inspect'](_0x345127,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x4422('0x28'),_0x4422('0x29'),_0x4422('0x63'),_0x4422('0x62'));}break;case _0x4422('0x68'):if(_0x20a139[_0x4422('0x55')]){var _0x33280d={};var _0x313fcb={'method':_0x4422('0x33'),'uri':_0x4422('0x69'),'headers':{'Authorization':_0x4422('0x6a')+_0x20a139[_0x4422('0x55')],'Content-Type':_0x4422('0x51')},'body':{'from':_0x20a139[_0x4422('0x21')],'to':_0x452a9a[_0x4422('0x21')],'text':_0x452a9a[_0x4422('0xc')]},'json':!![]};return rp(_0x313fcb)[_0x4422('0x17')](function(_0x117630){if(_0x117630[_0x4422('0x6b')]==0xca){_0x33280d[_0x4422('0x6c')]=_0x117630;var _0x5e58ab={'method':_0x4422('0x33'),'uri':_0x4422('0x6d'),'headers':{'Authorization':_0x4422('0x6a')+_0x20a139[_0x4422('0x55')],'Content-Type':_0x4422('0x51')},'body':{'refid':_0x33280d[_0x4422('0x6c')][_0x4422('0x6e')]},'json':!![]};return rp(_0x5e58ab)[_0x4422('0x17')](function(_0x3430c7){_0x33280d[_0x4422('0x6f')]=_0x3430c7;var _0x5cb3ff={'messageId':_0x33280d['message'][_0x4422('0x6e')],'read':!![]};return _0x374ab0[_0x4422('0x18')](_0x5cb3ff);});}else{return logger[_0x4422('0x1a')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4422('0x29'),_0x4422('0x68'),util[_0x4422('0x2a')](_0x117630,{'showHidden':![],'depth':null}));}})[_0x4422('0x27')](function(_0x5802cb){return logger['error'](_0x4422('0x28'),_0x4422('0x29'),'intelepeer',util[_0x4422('0x2a')](_0x5802cb,{'showHidden':![],'depth':null}));});}else{return logger[_0x4422('0x1a')](_0x4422('0x28'),_0x4422('0x29'),'intelepeer',_0x4422('0x70'));}break;}}})[_0x4422('0x71')](function(){_0x52e547();});}else{_0x52e547();}}},'charset':_0x4422('0x72'),'collate':_0x4422('0x73')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 295cd84..e6dfbf8 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 _0x5f66=['stringify','error','code','message','info','result','SmsMessage','create','body','options','raw','CreateSmsMessage','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','defaults','redis','localhost','socket.io-emitter','./smsMessage.socket','then','SmsMessage,\x20%s,\x20%s','debug','request\x20sent'];(function(_0x39e965,_0x5d68eb){var _0xd96bf7=function(_0x41bb13){while(--_0x41bb13){_0x39e965['push'](_0x39e965['shift']());}};_0xd96bf7(++_0x5d68eb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x5f66[_0x580576];return _0x3f55a0;};'use strict';var _=require('lodash');var util=require(_0x65f6('0x0'));var moment=require('moment');var BPromise=require(_0x65f6('0x1'));var rs=require(_0x65f6('0x2'));var fs=require('fs');var Redis=require(_0x65f6('0x3'));var db=require(_0x65f6('0x4'))['db'];var utils=require(_0x65f6('0x5'));var logger=require('../../config/logger')(_0x65f6('0x6'));var config=require('../../config/environment');var jayson=require(_0x65f6('0x7'));var client=jayson[_0x65f6('0x8')]['http']({'port':0x232a});config['redis']=_[_0x65f6('0x9')](config[_0x65f6('0xa')],{'host':_0x65f6('0xb'),'port':0x18eb});var socket=require(_0x65f6('0xc'))(new Redis(config[_0x65f6('0xa')]));require(_0x65f6('0xd'))['register'](socket);function respondWithRpcPromise(_0x5123ee,_0x18fea1,_0x2f6d5b){return new BPromise(function(_0x264647,_0x25c416){return client['request'](_0x5123ee,_0x2f6d5b)[_0x65f6('0xe')](function(_0x571436){logger['info'](_0x65f6('0xf'),_0x18fea1,'request\x20sent');logger[_0x65f6('0x10')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x18fea1,_0x65f6('0x11'),JSON[_0x65f6('0x12')](_0x571436));if(_0x571436[_0x65f6('0x13')]){if(_0x571436[_0x65f6('0x13')][_0x65f6('0x14')]===0x1f4){logger[_0x65f6('0x13')](_0x65f6('0xf'),_0x18fea1,_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);return _0x25c416(_0x571436[_0x65f6('0x13')]['message']);}logger[_0x65f6('0x13')]('SmsMessage,\x20%s,\x20%s',_0x18fea1,_0x571436['error'][_0x65f6('0x15')]);return _0x264647(_0x571436[_0x65f6('0x13')][_0x65f6('0x15')]);}else{logger[_0x65f6('0x16')](_0x65f6('0xf'),_0x18fea1,_0x65f6('0x11'));_0x264647(_0x571436[_0x65f6('0x17')][_0x65f6('0x15')]);}})['catch'](function(_0x4d79a1){logger[_0x65f6('0x13')]('SmsMessage,\x20%s,\x20%s',_0x18fea1,_0x4d79a1);_0x25c416(_0x4d79a1);});});}exports['CreateSmsMessage']=function(_0x5c5b91){var _0x365159=this;return new Promise(function(_0x21ea88,_0x5114a4){return db[_0x65f6('0x18')][_0x65f6('0x19')](_0x5c5b91[_0x65f6('0x1a')],{'raw':_0x5c5b91[_0x65f6('0x1b')]?_0x5c5b91[_0x65f6('0x1b')][_0x65f6('0x1c')]===undefined?!![]:![]:!![]})['then'](function(_0x197a49){logger['info']('CreateSmsMessage',_0x5c5b91);logger[_0x65f6('0x10')](_0x65f6('0x1d'),_0x5c5b91,JSON['stringify'](_0x197a49));_0x21ea88(_0x197a49);})[_0x65f6('0x1e')](function(_0x471a33){logger[_0x65f6('0x13')](_0x65f6('0x1d'),_0x471a33['message'],_0x5c5b91);_0x5114a4(_0x365159[_0x65f6('0x13')](0x1f4,_0x471a33[_0x65f6('0x15')]));});});}; \ No newline at end of file +var _0x0b0e=['message','result','SmsMessage','create','body','options','CreateSmsMessage','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsMessage.socket','then','info','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SmsMessage,\x20%s,\x20%s'];(function(_0x52e156,_0x5044c1){var _0x11849e=function(_0x40fa86){while(--_0x40fa86){_0x52e156['push'](_0x52e156['shift']());}};_0x11849e(++_0x5044c1);}(_0x0b0e,0x187));var _0xe0b0=function(_0x42f3a5,_0x3a4470){_0x42f3a5=_0x42f3a5-0x0;var _0x1a7d74=_0x0b0e[_0x42f3a5];return _0x1a7d74;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});config[_0xe0b0('0xc')]=_['defaults'](config['redis'],{'host':_0xe0b0('0xd'),'port':0x18eb});var socket=require(_0xe0b0('0xe'))(new Redis(config[_0xe0b0('0xc')]));require(_0xe0b0('0xf'))['register'](socket);function respondWithRpcPromise(_0x338e7c,_0x1dd3b8,_0x553d4f){return new BPromise(function(_0x1fef28,_0x2f32b6){return client['request'](_0x338e7c,_0x553d4f)[_0xe0b0('0x10')](function(_0x2cdad2){logger[_0xe0b0('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0xe0b0('0x12'));logger[_0xe0b0('0x13')](_0xe0b0('0x14'),_0x1dd3b8,_0xe0b0('0x12'),JSON[_0xe0b0('0x15')](_0x2cdad2));if(_0x2cdad2['error']){if(_0x2cdad2[_0xe0b0('0x16')][_0xe0b0('0x17')]===0x1f4){logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2[_0xe0b0('0x16')]['message']);return _0x2f32b6(_0x2cdad2[_0xe0b0('0x16')]['message']);}logger[_0xe0b0('0x16')](_0xe0b0('0x18'),_0x1dd3b8,_0x2cdad2['error'][_0xe0b0('0x19')]);return _0x1fef28(_0x2cdad2['error'][_0xe0b0('0x19')]);}else{logger[_0xe0b0('0x11')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,'request\x20sent');_0x1fef28(_0x2cdad2[_0xe0b0('0x1a')]['message']);}})['catch'](function(_0x4bce65){logger[_0xe0b0('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1dd3b8,_0x4bce65);_0x2f32b6(_0x4bce65);});});}exports['CreateSmsMessage']=function(_0x10cde1){var _0x59dff5=this;return new Promise(function(_0x472286,_0x5dba2f){return db[_0xe0b0('0x1b')][_0xe0b0('0x1c')](_0x10cde1[_0xe0b0('0x1d')],{'raw':_0x10cde1[_0xe0b0('0x1e')]?_0x10cde1[_0xe0b0('0x1e')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x2fa820){logger['info'](_0xe0b0('0x1f'),_0x10cde1);logger[_0xe0b0('0x13')]('CreateSmsMessage',_0x10cde1,JSON[_0xe0b0('0x15')](_0x2fa820));_0x472286(_0x2fa820);})['catch'](function(_0x2208d0){logger['error'](_0xe0b0('0x1f'),_0x2208d0['message'],_0x10cde1);_0x5dba2f(_0x59dff5[_0xe0b0('0x16')](0x1f4,_0x2208d0['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 1d71241..3291f46 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 _0x5499=['length','smsMessage:','./smsMessage.events','save','remove','update','emit','removeListener'];(function(_0x2d0d86,_0x20583e){var _0x29478d=function(_0x17a891){while(--_0x17a891){_0x2d0d86['push'](_0x2d0d86['shift']());}};_0x29478d(++_0x20583e);}(_0x5499,0x152));var _0x9549=function(_0x1fd2e8,_0x49432f){_0x1fd2e8=_0x1fd2e8-0x0;var _0x32524e=_0x5499[_0x1fd2e8];return _0x32524e;};'use strict';var SmsMessageEvents=require(_0x9549('0x0'));var events=[_0x9549('0x1'),_0x9549('0x2'),_0x9549('0x3')];function createListener(_0x5914a2,_0x428598){return function(_0x4adb7b){_0x428598[_0x9549('0x4')](_0x5914a2,_0x4adb7b);};}function removeListener(_0x192bbe,_0x51175d){return function(){SmsMessageEvents[_0x9549('0x5')](_0x192bbe,_0x51175d);};}exports['register']=function(_0x232f9f){for(var _0x28012f=0x0,_0x6a867e=events[_0x9549('0x6')];_0x28012f<_0x6a867e;_0x28012f++){var _0x270a50=events[_0x28012f];var _0x2882e6=createListener(_0x9549('0x7')+_0x270a50,_0x232f9f);SmsMessageEvents['on'](_0x270a50,_0x2882e6);}}; \ No newline at end of file +var _0x3545=['save','remove','update','emit','register','length'];(function(_0x433a86,_0x175b5c){var _0x23000c=function(_0x4b1fa0){while(--_0x4b1fa0){_0x433a86['push'](_0x433a86['shift']());}};_0x23000c(++_0x175b5c);}(_0x3545,0xf6));var _0x5354=function(_0x159b72,_0x183756){_0x159b72=_0x159b72-0x0;var _0x4fa7b7=_0x3545[_0x159b72];return _0x4fa7b7;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0x5354('0x0'),_0x5354('0x1'),_0x5354('0x2')];function createListener(_0x3fd3ef,_0x1be02c){return function(_0x53b936){_0x1be02c[_0x5354('0x3')](_0x3fd3ef,_0x53b936);};}function removeListener(_0x4358b0,_0x1d786e){return function(){SmsMessageEvents['removeListener'](_0x4358b0,_0x1d786e);};}exports[_0x5354('0x4')]=function(_0x3e99b3){for(var _0x3dfbd9=0x0,_0x45745b=events[_0x5354('0x5')];_0x3dfbd9<_0x45745b;_0x3dfbd9++){var _0x179ec6=events[_0x3dfbd9];var _0x439919=createListener('smsMessage:'+_0x179ec6,_0x3e99b3);SmsMessageEvents['on'](_0x179ec6,_0x439919);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index e40af20..886ab05 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 _0x0755=['getTeams','post','create','/:id/teams','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueue.controller','isAuthenticated','index','get','/describe','/:id','getMembers'];(function(_0x26007d,_0x545984){var _0x312bc4=function(_0x437424){while(--_0x437424){_0x26007d['push'](_0x26007d['shift']());}};_0x312bc4(++_0x545984);}(_0x0755,0x7c));var _0x5075=function(_0x1fa287,_0xb138f3){_0x1fa287=_0x1fa287-0x0;var _0x39c533=_0x0755[_0x1fa287];return _0x39c533;};'use strict';var multer=require(_0x5075('0x0'));var util=require(_0x5075('0x1'));var path=require(_0x5075('0x2'));var timeout=require(_0x5075('0x3'));var express=require(_0x5075('0x4'));var router=express[_0x5075('0x5')]();var auth=require(_0x5075('0x6'));var interaction=require(_0x5075('0x7'));var config=require(_0x5075('0x8'));var controller=require(_0x5075('0x9'));router['get']('/',auth[_0x5075('0xa')](),controller[_0x5075('0xb')]);router[_0x5075('0xc')](_0x5075('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x5075('0xe'),auth[_0x5075('0xa')](),controller['show']);router[_0x5075('0xc')]('/:id/members',auth['isAuthenticated'](),controller[_0x5075('0xf')]);router['get']('/:id/teams',auth[_0x5075('0xa')](),controller[_0x5075('0x10')]);router[_0x5075('0xc')]('/:id/users',auth[_0x5075('0xa')](),controller['getAgents']);router[_0x5075('0x11')]('/',auth[_0x5075('0xa')](),controller[_0x5075('0x12')]);router[_0x5075('0x11')](_0x5075('0x13'),auth[_0x5075('0xa')](),controller[_0x5075('0x14')]);router[_0x5075('0x11')](_0x5075('0x15'),auth[_0x5075('0xa')](),controller[_0x5075('0x16')]);router[_0x5075('0x17')](_0x5075('0xe'),auth['isAuthenticated'](),controller[_0x5075('0x18')]);router[_0x5075('0x19')](_0x5075('0xe'),auth[_0x5075('0xa')](),controller[_0x5075('0x1a')]);router['delete'](_0x5075('0x13'),auth[_0x5075('0xa')](),controller['removeTeams']);router[_0x5075('0x19')](_0x5075('0x15'),auth[_0x5075('0xa')](),controller[_0x5075('0x1b')]);module['exports']=router; \ No newline at end of file +var _0xe829=['update','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsQueue.controller','get','/describe','isAuthenticated','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addAgents'];(function(_0x4aed3c,_0x37ced8){var _0x3bc747=function(_0x1518a3){while(--_0x1518a3){_0x4aed3c['push'](_0x4aed3c['shift']());}};_0x3bc747(++_0x37ced8);}(_0xe829,0xde));var _0x9e82=function(_0xea46d,_0x254082){_0xea46d=_0xea46d-0x0;var _0x1fa4c5=_0xe829[_0xea46d];return _0x1fa4c5;};'use strict';var multer=require('multer');var util=require(_0x9e82('0x0'));var path=require(_0x9e82('0x1'));var timeout=require(_0x9e82('0x2'));var express=require(_0x9e82('0x3'));var router=express[_0x9e82('0x4')]();var auth=require(_0x9e82('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9e82('0x6'));var controller=require(_0x9e82('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x9e82('0x8')](_0x9e82('0x9'),auth[_0x9e82('0xa')](),controller['describe']);router[_0x9e82('0x8')](_0x9e82('0xb'),auth[_0x9e82('0xa')](),controller[_0x9e82('0xc')]);router['get'](_0x9e82('0xd'),auth[_0x9e82('0xa')](),controller['getMembers']);router[_0x9e82('0x8')](_0x9e82('0xe'),auth['isAuthenticated'](),controller[_0x9e82('0xf')]);router[_0x9e82('0x8')](_0x9e82('0x10'),auth[_0x9e82('0xa')](),controller[_0x9e82('0x11')]);router['post']('/',auth[_0x9e82('0xa')](),controller[_0x9e82('0x12')]);router[_0x9e82('0x13')](_0x9e82('0xe'),auth['isAuthenticated'](),controller['addTeams']);router['post']('/:id/users',auth['isAuthenticated'](),controller[_0x9e82('0x14')]);router['put'](_0x9e82('0xb'),auth[_0x9e82('0xa')](),controller[_0x9e82('0x15')]);router[_0x9e82('0x16')]('/:id',auth[_0x9e82('0xa')](),controller[_0x9e82('0x17')]);router['delete']('/:id/teams',auth[_0x9e82('0xa')](),controller[_0x9e82('0x18')]);router[_0x9e82('0x16')](_0x9e82('0x10'),auth[_0x9e82('0xa')](),controller[_0x9e82('0x19')]);module[_0x9e82('0x1a')]=router; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.attributes.js b/server/api/smsQueue/smsQueue.attributes.js index 513ac88..702a403 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 _0x9373=['STRING','name','INTEGER','ENUM','rrmemory','beepall','sequelize','exports'];(function(_0x1c6856,_0x8786ba){var _0x310ca5=function(_0x5d32b6){while(--_0x5d32b6){_0x1c6856['push'](_0x1c6856['shift']());}};_0x310ca5(++_0x8786ba);}(_0x9373,0x176));var _0x3937=function(_0x267cf9,_0x240c85){_0x267cf9=_0x267cf9-0x0;var _0x5230e0=_0x9373[_0x267cf9];return _0x5230e0;};'use strict';var Sequelize=require(_0x3937('0x0'));module[_0x3937('0x1')]={'name':{'type':Sequelize[_0x3937('0x2')],'unique':_0x3937('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3937('0x2')]},'timeout':{'type':Sequelize[_0x3937('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3937('0x5')](_0x3937('0x6'),_0x3937('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xa1e8=['name','STRING','INTEGER','ENUM'];(function(_0x4636e2,_0x6da055){var _0x1dcb8f=function(_0x1b05be){while(--_0x1b05be){_0x4636e2['push'](_0x4636e2['shift']());}};_0x1dcb8f(++_0x6da055);}(_0xa1e8,0x174));var _0x8a1e=function(_0x24f7e4,_0x153aad){_0x24f7e4=_0x24f7e4-0x0;var _0x51c59c=_0xa1e8[_0x24f7e4];return _0x51c59c;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x8a1e('0x0'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x8a1e('0x1')]},'timeout':{'type':Sequelize[_0x8a1e('0x2')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x8a1e('0x3')]('rrmemory','beepall','roundrobin')}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index f01d789..74ec86c 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 _0x57ca=['userSmsQueue:remove','getAgents','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','register','sendStatus','status','end','count','offset','json','apply','reject','save','update','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','options','SmsQueue','rows','params','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','catch','describe','findOne','UserSmsQueue','sort','pick','SmsQueueId','findAll','findAndCountAll','UserId','smsPause','updatedAt','format','%s/%s','getTeams','Team','addTeams','ids','User','online','Agents','sequelize','each','emit','userSmsQueue:save','removeTeams','select','tq.TeamId','from','team_has_sms_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','push','QueryTypes','TeamId','includes','all','union','compact','value','transaction','isEmpty','forEach','addAgents','omit','spread','removeAgents','isArray'];(function(_0x5bfd00,_0x3e3371){var _0x440238=function(_0x32cf59){while(--_0x32cf59){_0x5bfd00['push'](_0x5bfd00['shift']());}};_0x440238(++_0x3e3371);}(_0x57ca,0x108));var _0xa57c=function(_0x8aa8b,_0x5283c0){_0x8aa8b=_0x8aa8b-0x0;var _0x44d31f=_0x57ca[_0x8aa8b];return _0x44d31f;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa57c('0x0'));var rimraf=require(_0xa57c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa57c('0x2'));var rp=require(_0xa57c('0x3'));var moment=require(_0xa57c('0x4'));var BPromise=require(_0xa57c('0x5'));var Mustache=require(_0xa57c('0x6'));var util=require('util');var path=require(_0xa57c('0x7'));var sox=require(_0xa57c('0x8'));var csv=require(_0xa57c('0x9'));var ejs=require(_0xa57c('0xa'));var fs=require('fs');var _=require(_0xa57c('0xb'));var squel=require(_0xa57c('0xc'));var crypto=require(_0xa57c('0xd'));var jsforce=require(_0xa57c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xa57c('0x9'));var querystring=require('querystring');var Papa=require(_0xa57c('0xf'));var Redis=require(_0xa57c('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xa57c('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa57c('0x12'));var logger=require(_0xa57c('0x13'))('api');var utils=require(_0xa57c('0x14'));var config=require('../../config/environment');var db=require(_0xa57c('0x15'))['db'];config[_0xa57c('0x16')]=_[_0xa57c('0x17')](config[_0xa57c('0x16')],{'host':_0xa57c('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa57c('0x16')]));require('./smsQueue.socket')[_0xa57c('0x19')](socket);function respondWithStatusCode(_0x3d5995,_0x30940d){_0x30940d=_0x30940d||0xcc;return function(_0x3821d2){if(_0x3821d2){return _0x3d5995[_0xa57c('0x1a')](_0x30940d);}return _0x3d5995[_0xa57c('0x1b')](_0x30940d)[_0xa57c('0x1c')]();};}function respondWithResult(_0x4b4bdb,_0x26607a){_0x26607a=_0x26607a||0xc8;return function(_0xdf7ff6){if(_0xdf7ff6){return _0x4b4bdb[_0xa57c('0x1b')](_0x26607a)['json'](_0xdf7ff6);}};}function respondWithFilteredResult(_0x2746a0,_0x5f33f1){return function(_0x3e7afa){if(_0x3e7afa){var _0x3d781d=_0x3e7afa[_0xa57c('0x1d')],_0x93462c=_0x5f33f1[_0xa57c('0x1e')],_0xe3d505=_0x5f33f1[_0xa57c('0x1e')]+_0x5f33f1['limit'],_0x1fd0d8;if(_0xe3d505>=_0x3d781d){_0xe3d505=_0x3d781d;_0x1fd0d8=0xc8;}else{_0x1fd0d8=0xce;}_0x2746a0[_0xa57c('0x1b')](_0x1fd0d8);return _0x2746a0['set']('Content-Range',_0x93462c+'-'+_0xe3d505+'/'+_0x3d781d)[_0xa57c('0x1f')](_0x3e7afa);}return null;};}function patchUpdates(_0xa5b314){return function(_0x3eee75){try{jsonpatch[_0xa57c('0x20')](_0x3eee75,_0xa5b314,!![]);}catch(_0x49242c){return BPromise[_0xa57c('0x21')](_0x49242c);}return _0x3eee75[_0xa57c('0x22')]();};}function saveUpdates(_0x34d1bc,_0x2213b2){return function(_0x3bb969){if(_0x3bb969){return _0x3bb969[_0xa57c('0x23')](_0x34d1bc)[_0xa57c('0x24')](function(_0x42038e){return _0x42038e;});}return null;};}function removeEntity(_0x2e99ed,_0xdf65dd){return function(_0x382a26){if(_0x382a26){return _0x382a26[_0xa57c('0x25')]()[_0xa57c('0x24')](function(){var _0x10a33d=_0x382a26[_0xa57c('0x26')]({'plain':!![]});var _0x511a26=_0xa57c('0x27');return db[_0xa57c('0x28')][_0xa57c('0x25')]({'where':{'type':_0x511a26,'resourceId':_0x10a33d['id']}})[_0xa57c('0x24')](function(){return _0x382a26;});})[_0xa57c('0x24')](function(){_0x2e99ed[_0xa57c('0x1b')](0xcc)[_0xa57c('0x1c')]();});}};}function handleEntityNotFound(_0xe50fb8,_0x337f97){return function(_0x1d59c2){if(!_0x1d59c2){_0xe50fb8['sendStatus'](0x194);}return _0x1d59c2;};}function handleError(_0x3b7364,_0x4c1478){_0x4c1478=_0x4c1478||0x1f4;return function(_0x54a18b){logger[_0xa57c('0x29')](_0x54a18b[_0xa57c('0x2a')]);if(_0x54a18b['name']){delete _0x54a18b[_0xa57c('0x2b')];}_0x3b7364[_0xa57c('0x1b')](_0x4c1478)[_0xa57c('0x2c')](_0x54a18b);};}exports['index']=function(_0xd779f1,_0x58d46f){var _0xf5f70c={},_0x5464f2={},_0x2a3bbe={'count':0x0,'rows':[]};var _0x51ad09=_[_0xa57c('0x2d')](db['SmsQueue'][_0xa57c('0x2e')],function(_0x1d82d9){return{'name':_0x1d82d9[_0xa57c('0x2f')],'type':_0x1d82d9[_0xa57c('0x30')][_0xa57c('0x31')]};});_0x5464f2[_0xa57c('0x32')]=_[_0xa57c('0x2d')](_0x51ad09,'name');_0x5464f2[_0xa57c('0x33')]=_['keys'](_0xd779f1[_0xa57c('0x33')]);_0x5464f2[_0xa57c('0x34')]=_[_0xa57c('0x35')](_0x5464f2['model'],_0x5464f2[_0xa57c('0x33')]);_0xf5f70c['attributes']=_[_0xa57c('0x35')](_0x5464f2['model'],qs[_0xa57c('0x36')](_0xd779f1['query'][_0xa57c('0x36')]));_0xf5f70c[_0xa57c('0x37')]=_0xf5f70c['attributes'][_0xa57c('0x38')]?_0xf5f70c['attributes']:_0x5464f2[_0xa57c('0x32')];if(!_0xd779f1['query'][_0xa57c('0x39')](_0xa57c('0x3a'))){_0xf5f70c[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3b')]);_0xf5f70c['offset']=qs['offset'](_0xd779f1[_0xa57c('0x33')][_0xa57c('0x1e')]);}_0xf5f70c[_0xa57c('0x3c')]=qs['sort'](_0xd779f1[_0xa57c('0x33')]['sort']);_0xf5f70c[_0xa57c('0x3d')]=qs[_0xa57c('0x34')](_['pick'](_0xd779f1['query'],_0x5464f2['filters']));if(_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3e')]){_0xf5f70c[_0xa57c('0x3d')]=_[_0xa57c('0x3f')](_0xf5f70c[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x51ad09,function(_0x5a444a){if(_0x5a444a[_0xa57c('0x30')]!==_0xa57c('0x40')){var _0x5a5490={};_0x5a5490[_0x5a444a['name']]={'$like':'%'+_0xd779f1[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x5a5490;}})});}_0xf5f70c=_['merge']({},_0xf5f70c,_0xd779f1[_0xa57c('0x41')]);var _0x5603cf={'where':_0xf5f70c[_0xa57c('0x3d')]};return db[_0xa57c('0x42')][_0xa57c('0x1d')](_0x5603cf)[_0xa57c('0x24')](function(_0x5d210b){_0x2a3bbe[_0xa57c('0x1d')]=_0x5d210b;if(_0xd779f1['query']['includeAll']){_0xf5f70c['include']=[{'all':!![]}];}return db['SmsQueue']['findAll'](_0xf5f70c);})[_0xa57c('0x24')](function(_0x32ed25){_0x2a3bbe[_0xa57c('0x43')]=_0x32ed25;return _0x2a3bbe;})['then'](respondWithFilteredResult(_0x58d46f,_0xf5f70c))['catch'](handleError(_0x58d46f,null));};exports['show']=function(_0x44f1e8,_0x2755bc){var _0x44e38f={'raw':!![],'where':{'id':_0x44f1e8[_0xa57c('0x44')]['id']}},_0x40715e={};_0x40715e[_0xa57c('0x32')]=_['keys'](db[_0xa57c('0x42')][_0xa57c('0x2e')]);_0x40715e[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x44f1e8[_0xa57c('0x33')]);_0x40715e[_0xa57c('0x34')]=_['intersection'](_0x40715e[_0xa57c('0x32')],_0x40715e[_0xa57c('0x33')]);_0x44e38f[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x40715e[_0xa57c('0x32')],qs['fields'](_0x44f1e8[_0xa57c('0x33')][_0xa57c('0x36')]));_0x44e38f[_0xa57c('0x37')]=_0x44e38f[_0xa57c('0x37')][_0xa57c('0x38')]?_0x44e38f[_0xa57c('0x37')]:_0x40715e['model'];if(_0x44f1e8[_0xa57c('0x33')][_0xa57c('0x46')]){_0x44e38f[_0xa57c('0x47')]=[{'all':!![]}];}_0x44e38f=_[_0xa57c('0x3f')]({},_0x44e38f,_0x44f1e8[_0xa57c('0x41')]);return db[_0xa57c('0x42')]['find'](_0x44e38f)['then'](handleEntityNotFound(_0x2755bc,null))['then'](respondWithResult(_0x2755bc,null))['catch'](handleError(_0x2755bc,null));};exports[_0xa57c('0x48')]=function(_0x49492f,_0x273a17){return db[_0xa57c('0x42')]['create'](_0x49492f[_0xa57c('0x49')],{})[_0xa57c('0x24')](function(_0x368e87){var _0x128ea2=_0x49492f[_0xa57c('0x4a')]['get']({'plain':!![]});if(!_0x128ea2)throw new Error(_0xa57c('0x4b'));if(_0x128ea2[_0xa57c('0x4c')]===_0xa57c('0x4a')){var _0xd57bac=_0x368e87[_0xa57c('0x26')]({'plain':!![]});var _0x5ace6d=_0xa57c('0x27');return db['UserProfileSection']['find']({'where':{'name':_0x5ace6d,'userProfileId':_0x128ea2[_0xa57c('0x4d')]},'raw':!![]})[_0xa57c('0x24')](function(_0x5ded49){if(_0x5ded49&&_0x5ded49['autoAssociation']===0x0){return db['UserProfileResource'][_0xa57c('0x48')]({'name':_0xd57bac[_0xa57c('0x2b')],'resourceId':_0xd57bac['id'],'type':_0x5ded49[_0xa57c('0x2b')],'sectionId':_0x5ded49['id']},{})[_0xa57c('0x24')](function(){return _0x368e87;});}else{return _0x368e87;}})['catch'](function(_0x3c450f){logger[_0xa57c('0x29')](_0xa57c('0x4e'),_0x3c450f);throw _0x3c450f;});}return _0x368e87;})['then'](respondWithResult(_0x273a17,0xc9))['catch'](handleError(_0x273a17,null));};exports[_0xa57c('0x23')]=function(_0x25fc6b,_0x4d5d46){if(_0x25fc6b[_0xa57c('0x49')]['id']){delete _0x25fc6b[_0xa57c('0x49')]['id'];}return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x25fc6b[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x4d5d46,null))[_0xa57c('0x24')](saveUpdates(_0x25fc6b['body'],null))['then'](respondWithResult(_0x4d5d46,null))[_0xa57c('0x50')](handleError(_0x4d5d46,null));};exports[_0xa57c('0x25')]=function(_0x2fd759,_0x2a6538){return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x2fd759[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x2a6538,null))['then'](removeEntity(_0x2a6538,null))['catch'](handleError(_0x2a6538,null));};exports[_0xa57c('0x51')]=function(_0x4e18ad,_0x1880e6){return db[_0xa57c('0x42')][_0xa57c('0x51')]()['then'](respondWithResult(_0x1880e6,null))[_0xa57c('0x50')](handleError(_0x1880e6,null));};exports['getMembers']=function(_0x21b00a,_0x4b3416,_0x39484d){var _0x170187={'raw':!![],'where':{}},_0x398743={},_0x26a8e1;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x21b00a[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x4b3416,null))[_0xa57c('0x24')](function(_0x3345d5){if(_0x3345d5){_0x26a8e1=_0x3345d5['get']({'plain':!![]});_0x398743[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x53')][_0xa57c('0x2e')]);_0x398743[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x21b00a[_0xa57c('0x33')]);_0x398743[_0xa57c('0x34')]=_[_0xa57c('0x35')](_0x398743[_0xa57c('0x32')],_0x398743['query']);_0x170187[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x398743[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x21b00a[_0xa57c('0x33')][_0xa57c('0x36')]));_0x170187['attributes']=_0x170187[_0xa57c('0x37')][_0xa57c('0x38')]?_0x170187['attributes']:_0x398743[_0xa57c('0x32')];if(!_0x21b00a[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x170187[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x21b00a[_0xa57c('0x33')]['limit']);_0x170187[_0xa57c('0x1e')]=qs['offset'](_0x21b00a[_0xa57c('0x33')]['offset']);}_0x170187[_0xa57c('0x3c')]=qs['sort'](_0x21b00a[_0xa57c('0x33')][_0xa57c('0x54')]);_0x170187['where']=qs[_0xa57c('0x34')](_[_0xa57c('0x55')](_0x21b00a[_0xa57c('0x33')],_0x398743[_0xa57c('0x34')]));_0x170187['where'][_0xa57c('0x56')]=_0x3345d5['id'];if(_0x21b00a[_0xa57c('0x33')][_0xa57c('0x3e')]){_0x170187[_0xa57c('0x3d')]=_[_0xa57c('0x3f')](_0x170187[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x170187[_0xa57c('0x37')],function(_0x11c13e){var _0x428ac0={};_0x428ac0[_0x11c13e]={'$like':'%'+_0x21b00a[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x428ac0;})});}_0x170187=_[_0xa57c('0x3f')]({},_0x170187,_0x21b00a[_0xa57c('0x41')]);return db[_0xa57c('0x53')][_0xa57c('0x57')](_0x170187);}})['then'](function(_0x393119){if(_0x393119){return db['User'][_0xa57c('0x58')]({'where':{'id':_[_0xa57c('0x2d')](_0x393119,_0xa57c('0x59')),'role':'agent'},'attributes':['id',_0xa57c('0x2b'),_0xa57c('0x5a'),_0xa57c('0x5b'),'createdAt']});}})['then'](function(_0x20ff5f){if(_0x20ff5f){return{'count':_0x20ff5f[_0xa57c('0x1d')],'rows':_[_0xa57c('0x2d')](_0x20ff5f[_0xa57c('0x43')],function(_0x3fd9aa){return{'membername':_0x3fd9aa[_0xa57c('0x2b')],'UserId':_0x3fd9aa['id'],'queue_name':_0x26a8e1[_0xa57c('0x2b')],'SmsQueueId':_0x26a8e1['id'],'interface':util[_0xa57c('0x5c')](_0xa57c('0x5d'),'SIP',_0x3fd9aa[_0xa57c('0x2b')]),'penalty':0x0,'paused':_0x3fd9aa[_0xa57c('0x5a')],'createdAt':_0x3fd9aa['createdAt'],'updatedAt':_0x3fd9aa[_0xa57c('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xa57c('0x24')](respondWithFilteredResult(_0x4b3416,_0x170187))[_0xa57c('0x50')](handleError(_0x4b3416,null));};exports[_0xa57c('0x5e')]=function(_0x1bb561,_0x28ec46,_0x42763b){var _0x10616e={};var _0x5a457d={};var _0x2960fd;var _0x29bf7f;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x1bb561[_0xa57c('0x44')]['id']}})['then'](handleEntityNotFound(_0x28ec46,null))['then'](function(_0x30dac7){if(_0x30dac7){_0x2960fd=_0x30dac7;_0x5a457d[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x5f')][_0xa57c('0x2e')]);_0x5a457d['query']=_[_0xa57c('0x45')](_0x1bb561[_0xa57c('0x33')]);_0x5a457d[_0xa57c('0x34')]=_['intersection'](_0x5a457d[_0xa57c('0x32')],_0x5a457d['query']);_0x10616e[_0xa57c('0x37')]=_[_0xa57c('0x35')](_0x5a457d[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x1bb561['query'][_0xa57c('0x36')]));_0x10616e[_0xa57c('0x37')]=_0x10616e[_0xa57c('0x37')][_0xa57c('0x38')]?_0x10616e['attributes']:_0x5a457d[_0xa57c('0x32')];_0x10616e[_0xa57c('0x3c')]=qs[_0xa57c('0x54')](_0x1bb561['query'][_0xa57c('0x54')]);_0x10616e[_0xa57c('0x3d')]=qs[_0xa57c('0x34')](_['pick'](_0x1bb561[_0xa57c('0x33')],_0x5a457d[_0xa57c('0x34')]));if(_0x1bb561[_0xa57c('0x33')][_0xa57c('0x3e')]){_0x10616e['where']=_[_0xa57c('0x3f')](_0x10616e[_0xa57c('0x3d')],{'$or':_['map'](_0x10616e[_0xa57c('0x37')],function(_0x1157ea){var _0x59d2a2={};_0x59d2a2[_0x1157ea]={'$like':'%'+_0x1bb561[_0xa57c('0x33')]['filter']+'%'};return _0x59d2a2;})});}_0x10616e=_[_0xa57c('0x3f')]({},_0x10616e,_0x1bb561[_0xa57c('0x41')]);return _0x2960fd[_0xa57c('0x5e')](_0x10616e);}})[_0xa57c('0x24')](function(_0x599408){if(_0x599408){_0x29bf7f=_0x599408[_0xa57c('0x38')];if(!_0x1bb561[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x10616e[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x1bb561[_0xa57c('0x33')][_0xa57c('0x3b')]);_0x10616e[_0xa57c('0x1e')]=qs[_0xa57c('0x1e')](_0x1bb561[_0xa57c('0x33')]['offset']);}return _0x2960fd['getTeams'](_0x10616e);}})['then'](function(_0x29b491){if(_0x29b491){return _0x29b491?{'count':_0x29bf7f,'rows':_0x29b491}:null;}})['then'](respondWithResult(_0x28ec46,null))[_0xa57c('0x50')](handleError(_0x28ec46,null));};exports[_0xa57c('0x60')]=function(_0x193705,_0x4c543a,_0x21c428){var _0x3e7946=_0x193705[_0xa57c('0x49')][_0xa57c('0x61')];return db[_0xa57c('0x5f')][_0xa57c('0x57')]({'where':{'id':_0x3e7946},'attributes':['id'],'include':[{'model':db[_0xa57c('0x62')],'as':'Agents','attributes':['id',_0xa57c('0x2b'),_0xa57c('0x63'),'voicePause','interface'],'raw':!![]}]})[_0xa57c('0x24')](function(_0x201983){if(_0x201983){var _0x4fc97e=_['flatMap'](_0x201983,function(_0xc5f17e){var _0x4962ae=_0xc5f17e[_0xa57c('0x26')]({'plain':!![]});return _0x4962ae[_0xa57c('0x64')];});return db['SmsQueue'][_0xa57c('0x4f')]({'where':{'id':_0x193705[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](function(_0x3df8f5){return db[_0xa57c('0x65')]['transaction'](function(_0x17fc78){return _0x3df8f5['addTeams'](_0x3e7946,{'transaction':_0x17fc78})[_0xa57c('0x24')](function(){return BPromise[_0xa57c('0x66')](_0x4fc97e,function(_0x4a2b64){return db['UserSmsQueue']['findOrCreate']({'where':{'UserId':_0x4a2b64['id'],'SmsQueueId':_0x193705[_0xa57c('0x44')]['id']},'transaction':_0x17fc78});});})['then'](function(){_0x4fc97e['forEach'](function(_0x175253){socket[_0xa57c('0x67')](_0xa57c('0x68'),{'UserId':_0x175253['id'],'SmsQueueId':_0x3df8f5['id']});});});});});}})['then'](respondWithStatusCode(_0x4c543a,null))[_0xa57c('0x50')](handleError(_0x4c543a,null));};exports[_0xa57c('0x69')]=function(_0x11e592,_0x5bbb59,_0x4b8228){return db[_0xa57c('0x5f')]['findAll']({'where':{'id':_0x11e592[_0xa57c('0x33')][_0xa57c('0x61')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa57c('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x5bbb59,null))['then'](function(_0x5db013){var _0x6825df=_['map'](_0x5db013,'id');var _0x5143c0=[];var _0x542194=[];var _0x3e12e5=squel[_0xa57c('0x6a')]();_0x3e12e5['field'](_0xa57c('0x6b'))[_0xa57c('0x6c')](_0xa57c('0x6d'),'tq')['join'](_0xa57c('0x6e'),'ut',_0xa57c('0x6f'))[_0xa57c('0x3d')](_0xa57c('0x70'),_0x11e592['params']['id']);for(var _0x5e0db8=0x0;_0x5e0db8<_0x5db013[_0xa57c('0x38')];_0x5e0db8+=0x1){let _0x512e3d=_0x5db013[_0x5e0db8];for(var _0x121343=0x0;_0x121343<_0x512e3d[_0xa57c('0x64')][_0xa57c('0x38')];_0x121343+=0x1){let _0x4dc6ac=_0x512e3d[_0xa57c('0x64')][_0x121343];var _0x513f24=_0x3e12e5['clone']();_0x513f24[_0xa57c('0x3d')]('ut.UserId\x20=\x20?',_0x4dc6ac['id']);_0x542194[_0xa57c('0x71')](db[_0xa57c('0x65')]['query'](_0x513f24['toString'](),{'type':db[_0xa57c('0x65')][_0xa57c('0x72')]['SELECT']})['then'](function(_0x2550bc){if(_0x2550bc[_0xa57c('0x38')]===0x1){return _0x4dc6ac['id'];}else{var _0xa09ff=_['every'](_[_0xa57c('0x2d')](_0x2550bc,_0xa57c('0x73')),function(_0xb51336){return _[_0xa57c('0x74')](_0x6825df,_0xb51336);});if(_0xa09ff){return _0x4dc6ac['id'];}}}));}}return BPromise[_0xa57c('0x75')](_0x542194)[_0xa57c('0x24')](function(_0x10f1b5){_0x5143c0=_(_0x5143c0)[_0xa57c('0x76')](_0x10f1b5)[_0xa57c('0x77')]()[_0xa57c('0x78')]();return db[_0xa57c('0x42')][_0xa57c('0x4f')]({'where':{'id':_0x11e592[_0xa57c('0x44')]['id']}})['then'](function(_0x89be65){return db[_0xa57c('0x65')][_0xa57c('0x79')](function(_0x107ebd){return _0x89be65[_0xa57c('0x69')](_0x11e592[_0xa57c('0x33')]['ids'],{'transaction':_0x107ebd})['then'](function(){if(!_[_0xa57c('0x7a')](_0x5143c0)){return _0x89be65['removeAgents'](_0x5143c0,{'transaction':_0x107ebd});}})['then'](function(){_0x5143c0[_0xa57c('0x7b')](function(_0x138edd){socket[_0xa57c('0x67')]('userSmsQueue:remove',{'UserId':_0x138edd,'SmsQueueId':_0x89be65['id']});});});});});});})[_0xa57c('0x24')](respondWithStatusCode(_0x5bbb59,null))[_0xa57c('0x50')](handleError(_0x5bbb59,null));};exports[_0xa57c('0x7c')]=function(_0x2c0db4,_0x3eb06d,_0x4cabef){return db['SmsQueue'][_0xa57c('0x4f')]({'where':{'id':_0x2c0db4[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x3eb06d,null))['then'](function(_0x3f2152){if(_0x3f2152){return _0x3f2152['addAgents'](_0x2c0db4[_0xa57c('0x49')][_0xa57c('0x61')],_[_0xa57c('0x7d')](_0x2c0db4[_0xa57c('0x49')],[_0xa57c('0x61'),'id'])||{})[_0xa57c('0x7e')](function(_0xda3db4){for(var _0x5c76b0=0x0;_0x5c76b0<_0x2c0db4['body'][_0xa57c('0x61')][_0xa57c('0x38')];_0x5c76b0+=0x1){socket[_0xa57c('0x67')]('userSmsQueue:save',{'UserId':_0x2c0db4['body'][_0xa57c('0x61')][_0x5c76b0],'SmsQueueId':_0x2c0db4[_0xa57c('0x44')]['id']});}return _0xda3db4;});}})[_0xa57c('0x24')](respondWithResult(_0x3eb06d,null))[_0xa57c('0x50')](handleError(_0x3eb06d,null));};exports[_0xa57c('0x7f')]=function(_0x58a3c9,_0x41ffe3,_0x28dc85){return db[_0xa57c('0x42')]['find']({'where':{'id':_0x58a3c9[_0xa57c('0x44')]['id']}})[_0xa57c('0x24')](handleEntityNotFound(_0x41ffe3,null))['then'](function(_0x1883b8){if(_0x1883b8){return _0x1883b8[_0xa57c('0x7f')](_0x58a3c9[_0xa57c('0x33')][_0xa57c('0x61')])[_0xa57c('0x24')](function(){if(_[_0xa57c('0x80')](_0x58a3c9[_0xa57c('0x33')][_0xa57c('0x61')])){for(var _0x16e745=0x0;_0x16e745<_0x58a3c9['query'][_0xa57c('0x61')][_0xa57c('0x38')];_0x16e745+=0x1){socket[_0xa57c('0x67')](_0xa57c('0x81'),{'UserId':Number(_0x58a3c9['query']['ids'][_0x16e745]),'SmsQueueId':Number(_0x58a3c9[_0xa57c('0x44')]['id'])});}}else{socket['emit'](_0xa57c('0x81'),{'UserId':Number(_0x58a3c9['query'][_0xa57c('0x61')]),'SmsQueueId':Number(_0x58a3c9['params']['id'])});}});}})['then'](respondWithStatusCode(_0x41ffe3,null))[_0xa57c('0x50')](handleError(_0x41ffe3,null));};exports['getAgents']=function(_0x3facda,_0x5a4843,_0x1ecfa9){var _0x3698aa={};var _0x129a89={};var _0x422849;var _0x5abf60;return db['SmsQueue'][_0xa57c('0x52')]({'where':{'id':_0x3facda[_0xa57c('0x44')]['id']}})['then'](handleEntityNotFound(_0x5a4843,null))[_0xa57c('0x24')](function(_0xeb14ed){if(_0xeb14ed){_0x422849=_0xeb14ed;_0x129a89[_0xa57c('0x32')]=_[_0xa57c('0x45')](db[_0xa57c('0x62')][_0xa57c('0x2e')]);_0x129a89[_0xa57c('0x33')]=_[_0xa57c('0x45')](_0x3facda[_0xa57c('0x33')]);_0x129a89[_0xa57c('0x34')]=_['intersection'](_0x129a89['model'],_0x129a89[_0xa57c('0x33')]);_0x3698aa['attributes']=_[_0xa57c('0x35')](_0x129a89[_0xa57c('0x32')],qs[_0xa57c('0x36')](_0x3facda['query'][_0xa57c('0x36')]));_0x3698aa['attributes']=_0x3698aa['attributes'][_0xa57c('0x38')]?_0x3698aa[_0xa57c('0x37')]:_0x129a89[_0xa57c('0x32')];_0x3698aa[_0xa57c('0x3c')]=qs['sort'](_0x3facda[_0xa57c('0x33')]['sort']);_0x3698aa['where']=qs['filters'](_[_0xa57c('0x55')](_0x3facda[_0xa57c('0x33')],_0x129a89[_0xa57c('0x34')]));if(_0x3facda[_0xa57c('0x33')]['filter']){_0x3698aa[_0xa57c('0x3d')]=_['merge'](_0x3698aa[_0xa57c('0x3d')],{'$or':_[_0xa57c('0x2d')](_0x3698aa['attributes'],function(_0x2ca1af){var _0x287b5c={};_0x287b5c[_0x2ca1af]={'$like':'%'+_0x3facda[_0xa57c('0x33')][_0xa57c('0x3e')]+'%'};return _0x287b5c;})});}_0x3698aa=_[_0xa57c('0x3f')]({},_0x3698aa,_0x3facda['options']);return _0x422849[_0xa57c('0x82')](_0x3698aa);}})['then'](function(_0x185ee5){if(_0x185ee5){_0x5abf60=_0x185ee5[_0xa57c('0x38')];if(!_0x3facda[_0xa57c('0x33')][_0xa57c('0x39')](_0xa57c('0x3a'))){_0x3698aa[_0xa57c('0x3b')]=qs[_0xa57c('0x3b')](_0x3facda[_0xa57c('0x33')][_0xa57c('0x3b')]);_0x3698aa[_0xa57c('0x1e')]=qs['offset'](_0x3facda[_0xa57c('0x33')][_0xa57c('0x1e')]);}return _0x422849['getAgents'](_0x3698aa);}})['then'](function(_0x525865){if(_0x525865){return _0x525865?{'count':_0x5abf60,'rows':_0x525865}:null;}})[_0xa57c('0x24')](respondWithResult(_0x5a4843,null))[_0xa57c('0x50')](handleError(_0x5a4843,null));}; \ No newline at end of file +var _0x1a85=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','save','then','destroy','get','SmsQueues','UserProfileResource','error','stack','name','send','index','map','SmsQueue','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','order','where','filters','pick','filter','VIRTUAL','merge','includeAll','findAll','rows','catch','show','params','keys','length','options','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','UserSmsQueue','sort','User','agent','smsPause','updatedAt','createdAt','format','%s/%s','SIP','getTeams','nolimit','addTeams','ids','Team','Agents','online','sequelize','transaction','each','findOrCreate','forEach','removeTeams','select','field','from','team_has_sms_queues','join','ut.TeamId\x20=\x20tq.TeamId','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeAgents','emit','userSmsQueue:remove','addAgents','userSmsQueue:save','isArray','getAgents','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x19c586,_0x4a07b8){var _0x3ea191=function(_0x375d8f){while(--_0x375d8f){_0x19c586['push'](_0x19c586['shift']());}};_0x3ea191(++_0x4a07b8);}(_0x1a85,0x178));var _0x51a8=function(_0x41ee64,_0x206c94){_0x41ee64=_0x41ee64-0x0;var _0x468e47=_0x1a85[_0x41ee64];return _0x468e47;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x51a8('0x0'));var zipdir=require(_0x51a8('0x1'));var jsonpatch=require(_0x51a8('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x51a8('0x3'));var Mustache=require(_0x51a8('0x4'));var util=require(_0x51a8('0x5'));var path=require('path');var sox=require(_0x51a8('0x6'));var csv=require('to-csv');var ejs=require(_0x51a8('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x51a8('0x8'));var crypto=require(_0x51a8('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x51a8('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x51a8('0xb'));var Redis=require(_0x51a8('0xc'));var authService=require(_0x51a8('0xd'));var qs=require(_0x51a8('0xe'));var as=require(_0x51a8('0xf'));var hardwareService=require(_0x51a8('0x10'));var logger=require(_0x51a8('0x11'))(_0x51a8('0x12'));var utils=require(_0x51a8('0x13'));var config=require(_0x51a8('0x14'));var db=require(_0x51a8('0x15'))['db'];config[_0x51a8('0x16')]=_[_0x51a8('0x17')](config[_0x51a8('0x16')],{'host':_0x51a8('0x18'),'port':0x18eb});var socket=require(_0x51a8('0x19'))(new Redis(config[_0x51a8('0x16')]));require('./smsQueue.socket')[_0x51a8('0x1a')](socket);function respondWithStatusCode(_0x7a4c36,_0xaec066){_0xaec066=_0xaec066||0xcc;return function(_0x50d992){if(_0x50d992){return _0x7a4c36[_0x51a8('0x1b')](_0xaec066);}return _0x7a4c36['status'](_0xaec066)[_0x51a8('0x1c')]();};}function respondWithResult(_0x2b8d37,_0x39cd45){_0x39cd45=_0x39cd45||0xc8;return function(_0x2b0521){if(_0x2b0521){return _0x2b8d37[_0x51a8('0x1d')](_0x39cd45)[_0x51a8('0x1e')](_0x2b0521);}};}function respondWithFilteredResult(_0x1f49ee,_0x516abc){return function(_0x1c2f25){if(_0x1c2f25){var _0x45a433=_0x1c2f25[_0x51a8('0x1f')],_0xd52230=_0x516abc['offset'],_0x23539e=_0x516abc[_0x51a8('0x20')]+_0x516abc[_0x51a8('0x21')],_0x3bc1a2;if(_0x23539e>=_0x45a433){_0x23539e=_0x45a433;_0x3bc1a2=0xc8;}else{_0x3bc1a2=0xce;}_0x1f49ee[_0x51a8('0x1d')](_0x3bc1a2);return _0x1f49ee[_0x51a8('0x22')](_0x51a8('0x23'),_0xd52230+'-'+_0x23539e+'/'+_0x45a433)[_0x51a8('0x1e')](_0x1c2f25);}return null;};}function patchUpdates(_0x28aea0){return function(_0x3bf5b6){try{jsonpatch['apply'](_0x3bf5b6,_0x28aea0,!![]);}catch(_0xf80fa9){return BPromise['reject'](_0xf80fa9);}return _0x3bf5b6[_0x51a8('0x24')]();};}function saveUpdates(_0x12c029,_0x8bda40){return function(_0x3759d6){if(_0x3759d6){return _0x3759d6['update'](_0x12c029)[_0x51a8('0x25')](function(_0x4b9cdd){return _0x4b9cdd;});}return null;};}function removeEntity(_0x47f063,_0x23d26a){return function(_0x52e503){if(_0x52e503){return _0x52e503[_0x51a8('0x26')]()[_0x51a8('0x25')](function(){var _0x20ef8b=_0x52e503[_0x51a8('0x27')]({'plain':!![]});var _0x157554=_0x51a8('0x28');return db[_0x51a8('0x29')][_0x51a8('0x26')]({'where':{'type':_0x157554,'resourceId':_0x20ef8b['id']}})['then'](function(){return _0x52e503;});})[_0x51a8('0x25')](function(){_0x47f063[_0x51a8('0x1d')](0xcc)[_0x51a8('0x1c')]();});}};}function handleEntityNotFound(_0x3da187,_0x1c150d){return function(_0x11aefc){if(!_0x11aefc){_0x3da187[_0x51a8('0x1b')](0x194);}return _0x11aefc;};}function handleError(_0x2742f5,_0xec08ae){_0xec08ae=_0xec08ae||0x1f4;return function(_0x4b5cda){logger[_0x51a8('0x2a')](_0x4b5cda[_0x51a8('0x2b')]);if(_0x4b5cda['name']){delete _0x4b5cda[_0x51a8('0x2c')];}_0x2742f5['status'](_0xec08ae)[_0x51a8('0x2d')](_0x4b5cda);};}exports[_0x51a8('0x2e')]=function(_0x143f46,_0x41df56){var _0x2136b4={},_0x4ea271={},_0x10c19b={'count':0x0,'rows':[]};var _0x4c67ff=_[_0x51a8('0x2f')](db[_0x51a8('0x30')][_0x51a8('0x31')],function(_0x4b19c8){return{'name':_0x4b19c8[_0x51a8('0x32')],'type':_0x4b19c8['type'][_0x51a8('0x33')]};});_0x4ea271[_0x51a8('0x34')]=_[_0x51a8('0x2f')](_0x4c67ff,_0x51a8('0x2c'));_0x4ea271[_0x51a8('0x35')]=_['keys'](_0x143f46[_0x51a8('0x35')]);_0x4ea271['filters']=_[_0x51a8('0x36')](_0x4ea271[_0x51a8('0x34')],_0x4ea271[_0x51a8('0x35')]);_0x2136b4['attributes']=_[_0x51a8('0x36')](_0x4ea271[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x143f46[_0x51a8('0x35')][_0x51a8('0x37')]));_0x2136b4['attributes']=_0x2136b4['attributes']['length']?_0x2136b4[_0x51a8('0x38')]:_0x4ea271[_0x51a8('0x34')];if(!_0x143f46['query'][_0x51a8('0x39')]('nolimit')){_0x2136b4[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x143f46[_0x51a8('0x35')][_0x51a8('0x21')]);_0x2136b4[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x143f46['query']['offset']);}_0x2136b4[_0x51a8('0x3a')]=qs['sort'](_0x143f46['query']['sort']);_0x2136b4[_0x51a8('0x3b')]=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x143f46['query'],_0x4ea271[_0x51a8('0x3c')]));if(_0x143f46[_0x51a8('0x35')][_0x51a8('0x3e')]){_0x2136b4[_0x51a8('0x3b')]=_['merge'](_0x2136b4[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0x4c67ff,function(_0x1b0333){if(_0x1b0333['type']!==_0x51a8('0x3f')){var _0x51d7bd={};_0x51d7bd[_0x1b0333[_0x51a8('0x2c')]]={'$like':'%'+_0x143f46[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x51d7bd;}})});}_0x2136b4=_[_0x51a8('0x40')]({},_0x2136b4,_0x143f46['options']);var _0x8e248={'where':_0x2136b4[_0x51a8('0x3b')]};return db[_0x51a8('0x30')][_0x51a8('0x1f')](_0x8e248)[_0x51a8('0x25')](function(_0x35c1c9){_0x10c19b[_0x51a8('0x1f')]=_0x35c1c9;if(_0x143f46[_0x51a8('0x35')][_0x51a8('0x41')]){_0x2136b4['include']=[{'all':!![]}];}return db[_0x51a8('0x30')][_0x51a8('0x42')](_0x2136b4);})['then'](function(_0x53409d){_0x10c19b[_0x51a8('0x43')]=_0x53409d;return _0x10c19b;})[_0x51a8('0x25')](respondWithFilteredResult(_0x41df56,_0x2136b4))[_0x51a8('0x44')](handleError(_0x41df56,null));};exports[_0x51a8('0x45')]=function(_0x311574,_0x157a51){var _0x28f5b3={'raw':!![],'where':{'id':_0x311574[_0x51a8('0x46')]['id']}},_0x18c697={};_0x18c697[_0x51a8('0x34')]=_['keys'](db[_0x51a8('0x30')][_0x51a8('0x31')]);_0x18c697[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x311574[_0x51a8('0x35')]);_0x18c697[_0x51a8('0x3c')]=_['intersection'](_0x18c697[_0x51a8('0x34')],_0x18c697['query']);_0x28f5b3[_0x51a8('0x38')]=_[_0x51a8('0x36')](_0x18c697[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x311574[_0x51a8('0x35')]['fields']));_0x28f5b3['attributes']=_0x28f5b3[_0x51a8('0x38')][_0x51a8('0x48')]?_0x28f5b3[_0x51a8('0x38')]:_0x18c697[_0x51a8('0x34')];if(_0x311574[_0x51a8('0x35')]['includeAll']){_0x28f5b3['include']=[{'all':!![]}];}_0x28f5b3=_[_0x51a8('0x40')]({},_0x28f5b3,_0x311574[_0x51a8('0x49')]);return db[_0x51a8('0x30')][_0x51a8('0x4a')](_0x28f5b3)[_0x51a8('0x25')](handleEntityNotFound(_0x157a51,null))[_0x51a8('0x25')](respondWithResult(_0x157a51,null))[_0x51a8('0x44')](handleError(_0x157a51,null));};exports[_0x51a8('0x4b')]=function(_0x301578,_0x4d29ab){return db['SmsQueue']['create'](_0x301578[_0x51a8('0x4c')],{})[_0x51a8('0x25')](function(_0x103897){var _0x5259f3=_0x301578[_0x51a8('0x4d')][_0x51a8('0x27')]({'plain':!![]});if(!_0x5259f3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5259f3[_0x51a8('0x4e')]==='user'){var _0x50a2f8=_0x103897[_0x51a8('0x27')]({'plain':!![]});var _0x4393c9=_0x51a8('0x28');return db['UserProfileSection']['find']({'where':{'name':_0x4393c9,'userProfileId':_0x5259f3[_0x51a8('0x4f')]},'raw':!![]})['then'](function(_0x21c4da){if(_0x21c4da&&_0x21c4da[_0x51a8('0x50')]===0x0){return db[_0x51a8('0x29')][_0x51a8('0x4b')]({'name':_0x50a2f8[_0x51a8('0x2c')],'resourceId':_0x50a2f8['id'],'type':_0x21c4da[_0x51a8('0x2c')],'sectionId':_0x21c4da['id']},{})[_0x51a8('0x25')](function(){return _0x103897;});}else{return _0x103897;}})[_0x51a8('0x44')](function(_0x29d31e){logger['error'](_0x51a8('0x51'),_0x29d31e);throw _0x29d31e;});}return _0x103897;})[_0x51a8('0x25')](respondWithResult(_0x4d29ab,0xc9))[_0x51a8('0x44')](handleError(_0x4d29ab,null));};exports[_0x51a8('0x52')]=function(_0x533cfa,_0x13b7ba){if(_0x533cfa['body']['id']){delete _0x533cfa[_0x51a8('0x4c')]['id'];}return db[_0x51a8('0x30')]['find']({'where':{'id':_0x533cfa['params']['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x13b7ba,null))[_0x51a8('0x25')](saveUpdates(_0x533cfa[_0x51a8('0x4c')],null))[_0x51a8('0x25')](respondWithResult(_0x13b7ba,null))[_0x51a8('0x44')](handleError(_0x13b7ba,null));};exports['destroy']=function(_0x43b79a,_0xd1ddd5){return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x43b79a[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0xd1ddd5,null))[_0x51a8('0x25')](removeEntity(_0xd1ddd5,null))[_0x51a8('0x44')](handleError(_0xd1ddd5,null));};exports[_0x51a8('0x53')]=function(_0x3e43cc,_0x62966a){return db[_0x51a8('0x30')]['describe']()['then'](respondWithResult(_0x62966a,null))['catch'](handleError(_0x62966a,null));};exports['getMembers']=function(_0x2048c6,_0x1df9cc,_0x51f9f7){var _0x7ac0ae={'raw':!![],'where':{}},_0x56d3d7={},_0x41cc00;return db['SmsQueue'][_0x51a8('0x54')]({'where':{'id':_0x2048c6[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x1df9cc,null))['then'](function(_0x5eb540){if(_0x5eb540){_0x41cc00=_0x5eb540[_0x51a8('0x27')]({'plain':!![]});_0x56d3d7[_0x51a8('0x34')]=_[_0x51a8('0x47')](db[_0x51a8('0x55')][_0x51a8('0x31')]);_0x56d3d7[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x2048c6[_0x51a8('0x35')]);_0x56d3d7['filters']=_[_0x51a8('0x36')](_0x56d3d7[_0x51a8('0x34')],_0x56d3d7['query']);_0x7ac0ae[_0x51a8('0x38')]=_[_0x51a8('0x36')](_0x56d3d7[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x37')]));_0x7ac0ae['attributes']=_0x7ac0ae['attributes'][_0x51a8('0x48')]?_0x7ac0ae['attributes']:_0x56d3d7['model'];if(!_0x2048c6['query']['hasOwnProperty']('nolimit')){_0x7ac0ae[_0x51a8('0x21')]=qs['limit'](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x21')]);_0x7ac0ae[_0x51a8('0x20')]=qs[_0x51a8('0x20')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x20')]);}_0x7ac0ae[_0x51a8('0x3a')]=qs[_0x51a8('0x56')](_0x2048c6[_0x51a8('0x35')][_0x51a8('0x56')]);_0x7ac0ae['where']=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x2048c6[_0x51a8('0x35')],_0x56d3d7['filters']));_0x7ac0ae['where']['SmsQueueId']=_0x5eb540['id'];if(_0x2048c6[_0x51a8('0x35')][_0x51a8('0x3e')]){_0x7ac0ae[_0x51a8('0x3b')]=_[_0x51a8('0x40')](_0x7ac0ae[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0x7ac0ae[_0x51a8('0x38')],function(_0x418445){var _0x2813eb={};_0x2813eb[_0x418445]={'$like':'%'+_0x2048c6[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x2813eb;})});}_0x7ac0ae=_[_0x51a8('0x40')]({},_0x7ac0ae,_0x2048c6[_0x51a8('0x49')]);return db['UserSmsQueue'][_0x51a8('0x42')](_0x7ac0ae);}})[_0x51a8('0x25')](function(_0x52077e){if(_0x52077e){return db[_0x51a8('0x57')]['findAndCountAll']({'where':{'id':_['map'](_0x52077e,'UserId'),'role':_0x51a8('0x58')},'attributes':['id',_0x51a8('0x2c'),_0x51a8('0x59'),_0x51a8('0x5a'),_0x51a8('0x5b')]});}})[_0x51a8('0x25')](function(_0x8fe514){if(_0x8fe514){return{'count':_0x8fe514['count'],'rows':_['map'](_0x8fe514['rows'],function(_0x44e496){return{'membername':_0x44e496[_0x51a8('0x2c')],'UserId':_0x44e496['id'],'queue_name':_0x41cc00[_0x51a8('0x2c')],'SmsQueueId':_0x41cc00['id'],'interface':util[_0x51a8('0x5c')](_0x51a8('0x5d'),_0x51a8('0x5e'),_0x44e496['name']),'penalty':0x0,'paused':_0x44e496[_0x51a8('0x59')],'createdAt':_0x44e496['createdAt'],'updatedAt':_0x44e496[_0x51a8('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x51a8('0x25')](respondWithFilteredResult(_0x1df9cc,_0x7ac0ae))[_0x51a8('0x44')](handleError(_0x1df9cc,null));};exports[_0x51a8('0x5f')]=function(_0x149a40,_0x3aca4a,_0x895b42){var _0xc751c3={};var _0x3540cd={};var _0x39fcef;var _0x2289d9;return db['SmsQueue']['findOne']({'where':{'id':_0x149a40[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0x3aca4a,null))[_0x51a8('0x25')](function(_0x226ca4){if(_0x226ca4){_0x39fcef=_0x226ca4;_0x3540cd['model']=_[_0x51a8('0x47')](db['Team'][_0x51a8('0x31')]);_0x3540cd[_0x51a8('0x35')]=_[_0x51a8('0x47')](_0x149a40[_0x51a8('0x35')]);_0x3540cd[_0x51a8('0x3c')]=_[_0x51a8('0x36')](_0x3540cd[_0x51a8('0x34')],_0x3540cd[_0x51a8('0x35')]);_0xc751c3[_0x51a8('0x38')]=_['intersection'](_0x3540cd[_0x51a8('0x34')],qs[_0x51a8('0x37')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x37')]));_0xc751c3['attributes']=_0xc751c3['attributes'][_0x51a8('0x48')]?_0xc751c3['attributes']:_0x3540cd['model'];_0xc751c3['order']=qs[_0x51a8('0x56')](_0x149a40['query']['sort']);_0xc751c3[_0x51a8('0x3b')]=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x149a40['query'],_0x3540cd[_0x51a8('0x3c')]));if(_0x149a40[_0x51a8('0x35')][_0x51a8('0x3e')]){_0xc751c3['where']=_[_0x51a8('0x40')](_0xc751c3[_0x51a8('0x3b')],{'$or':_[_0x51a8('0x2f')](_0xc751c3[_0x51a8('0x38')],function(_0xac2108){var _0x30dd7b={};_0x30dd7b[_0xac2108]={'$like':'%'+_0x149a40[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x30dd7b;})});}_0xc751c3=_[_0x51a8('0x40')]({},_0xc751c3,_0x149a40['options']);return _0x39fcef[_0x51a8('0x5f')](_0xc751c3);}})[_0x51a8('0x25')](function(_0x4e2c5d){if(_0x4e2c5d){_0x2289d9=_0x4e2c5d[_0x51a8('0x48')];if(!_0x149a40[_0x51a8('0x35')]['hasOwnProperty'](_0x51a8('0x60'))){_0xc751c3[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x21')]);_0xc751c3['offset']=qs[_0x51a8('0x20')](_0x149a40[_0x51a8('0x35')][_0x51a8('0x20')]);}return _0x39fcef[_0x51a8('0x5f')](_0xc751c3);}})['then'](function(_0x3db2b8){if(_0x3db2b8){return _0x3db2b8?{'count':_0x2289d9,'rows':_0x3db2b8}:null;}})[_0x51a8('0x25')](respondWithResult(_0x3aca4a,null))[_0x51a8('0x44')](handleError(_0x3aca4a,null));};exports[_0x51a8('0x61')]=function(_0x6cd464,_0x1f0587,_0xf718e){var _0xd22e7b=_0x6cd464['body'][_0x51a8('0x62')];return db[_0x51a8('0x63')]['findAll']({'where':{'id':_0xd22e7b},'attributes':['id'],'include':[{'model':db[_0x51a8('0x57')],'as':_0x51a8('0x64'),'attributes':['id','name',_0x51a8('0x65'),'voicePause','interface'],'raw':!![]}]})[_0x51a8('0x25')](function(_0xf2325b){if(_0xf2325b){var _0x41e0b9=_['flatMap'](_0xf2325b,function(_0x585d4e){var _0x73ecd7=_0x585d4e['get']({'plain':!![]});return _0x73ecd7[_0x51a8('0x64')];});return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x6cd464[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](function(_0x28acb8){return db[_0x51a8('0x66')][_0x51a8('0x67')](function(_0x23d98c){return _0x28acb8[_0x51a8('0x61')](_0xd22e7b,{'transaction':_0x23d98c})[_0x51a8('0x25')](function(){return BPromise[_0x51a8('0x68')](_0x41e0b9,function(_0x1b7381){return db[_0x51a8('0x55')][_0x51a8('0x69')]({'where':{'UserId':_0x1b7381['id'],'SmsQueueId':_0x6cd464['params']['id']},'transaction':_0x23d98c});});})['then'](function(){_0x41e0b9[_0x51a8('0x6a')](function(_0x4e25d7){socket['emit']('userSmsQueue:save',{'UserId':_0x4e25d7['id'],'SmsQueueId':_0x28acb8['id']});});});});});}})[_0x51a8('0x25')](respondWithStatusCode(_0x1f0587,null))[_0x51a8('0x44')](handleError(_0x1f0587,null));};exports[_0x51a8('0x6b')]=function(_0x125a28,_0x4d5f37,_0x975b8){return db[_0x51a8('0x63')]['findAll']({'where':{'id':_0x125a28[_0x51a8('0x35')][_0x51a8('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x51a8('0x25')](handleEntityNotFound(_0x4d5f37,null))[_0x51a8('0x25')](function(_0x8587b9){var _0x429363=_[_0x51a8('0x2f')](_0x8587b9,'id');var _0x1c7691=[];var _0x4e566a=[];var _0x13dab3=squel[_0x51a8('0x6c')]();_0x13dab3[_0x51a8('0x6d')]('tq.TeamId')[_0x51a8('0x6e')](_0x51a8('0x6f'),'tq')[_0x51a8('0x70')]('user_has_teams','ut',_0x51a8('0x71'))[_0x51a8('0x3b')]('SmsQueueId\x20=\x20?',_0x125a28[_0x51a8('0x46')]['id']);for(var _0x529916=0x0;_0x529916<_0x8587b9[_0x51a8('0x48')];_0x529916+=0x1){let _0x2d4c2b=_0x8587b9[_0x529916];for(var _0xfb059=0x0;_0xfb059<_0x2d4c2b[_0x51a8('0x64')][_0x51a8('0x48')];_0xfb059+=0x1){let _0x700df1=_0x2d4c2b[_0x51a8('0x64')][_0xfb059];var _0x42d0ad=_0x13dab3['clone']();_0x42d0ad[_0x51a8('0x3b')](_0x51a8('0x72'),_0x700df1['id']);_0x4e566a[_0x51a8('0x73')](db[_0x51a8('0x66')][_0x51a8('0x35')](_0x42d0ad['toString'](),{'type':db['sequelize'][_0x51a8('0x74')][_0x51a8('0x75')]})[_0x51a8('0x25')](function(_0x2e354f){if(_0x2e354f[_0x51a8('0x48')]===0x1){return _0x700df1['id'];}else{var _0x54ef0e=_[_0x51a8('0x76')](_['map'](_0x2e354f,_0x51a8('0x77')),function(_0x1a0f3f){return _['includes'](_0x429363,_0x1a0f3f);});if(_0x54ef0e){return _0x700df1['id'];}}}));}}return BPromise[_0x51a8('0x78')](_0x4e566a)['then'](function(_0x3b7e30){_0x1c7691=_(_0x1c7691)[_0x51a8('0x79')](_0x3b7e30)[_0x51a8('0x7a')]()[_0x51a8('0x7b')]();return db[_0x51a8('0x30')]['find']({'where':{'id':_0x125a28[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](function(_0x5d00c3){return db[_0x51a8('0x66')][_0x51a8('0x67')](function(_0x54e006){return _0x5d00c3['removeTeams'](_0x125a28[_0x51a8('0x35')][_0x51a8('0x62')],{'transaction':_0x54e006})[_0x51a8('0x25')](function(){if(!_['isEmpty'](_0x1c7691)){return _0x5d00c3[_0x51a8('0x7c')](_0x1c7691,{'transaction':_0x54e006});}})[_0x51a8('0x25')](function(){_0x1c7691[_0x51a8('0x6a')](function(_0x11aab9){socket[_0x51a8('0x7d')](_0x51a8('0x7e'),{'UserId':_0x11aab9,'SmsQueueId':_0x5d00c3['id']});});});});});});})[_0x51a8('0x25')](respondWithStatusCode(_0x4d5f37,null))['catch'](handleError(_0x4d5f37,null));};exports[_0x51a8('0x7f')]=function(_0xa5074c,_0xa29735,_0x3f97bd){return db['SmsQueue']['find']({'where':{'id':_0xa5074c[_0x51a8('0x46')]['id']}})[_0x51a8('0x25')](handleEntityNotFound(_0xa29735,null))['then'](function(_0x4ea00f){if(_0x4ea00f){return _0x4ea00f['addAgents'](_0xa5074c[_0x51a8('0x4c')]['ids'],_['omit'](_0xa5074c['body'],[_0x51a8('0x62'),'id'])||{})['spread'](function(_0x2cea3f){for(var _0x2d820c=0x0;_0x2d820c<_0xa5074c['body']['ids'][_0x51a8('0x48')];_0x2d820c+=0x1){socket['emit'](_0x51a8('0x80'),{'UserId':_0xa5074c[_0x51a8('0x4c')]['ids'][_0x2d820c],'SmsQueueId':_0xa5074c[_0x51a8('0x46')]['id']});}return _0x2cea3f;});}})[_0x51a8('0x25')](respondWithResult(_0xa29735,null))['catch'](handleError(_0xa29735,null));};exports[_0x51a8('0x7c')]=function(_0x3bcc82,_0x223bd7,_0x5d2e4f){return db[_0x51a8('0x30')][_0x51a8('0x4a')]({'where':{'id':_0x3bcc82[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x223bd7,null))['then'](function(_0x1a64f4){if(_0x1a64f4){return _0x1a64f4[_0x51a8('0x7c')](_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')])[_0x51a8('0x25')](function(){if(_[_0x51a8('0x81')](_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')])){for(var _0x1482ff=0x0;_0x1482ff<_0x3bcc82[_0x51a8('0x35')][_0x51a8('0x62')][_0x51a8('0x48')];_0x1482ff+=0x1){socket[_0x51a8('0x7d')]('userSmsQueue:remove',{'UserId':Number(_0x3bcc82['query'][_0x51a8('0x62')][_0x1482ff]),'SmsQueueId':Number(_0x3bcc82[_0x51a8('0x46')]['id'])});}}else{socket[_0x51a8('0x7d')](_0x51a8('0x7e'),{'UserId':Number(_0x3bcc82[_0x51a8('0x35')]['ids']),'SmsQueueId':Number(_0x3bcc82['params']['id'])});}});}})[_0x51a8('0x25')](respondWithStatusCode(_0x223bd7,null))[_0x51a8('0x44')](handleError(_0x223bd7,null));};exports['getAgents']=function(_0x682828,_0x2e1d8e,_0x2bb024){var _0x19ffd8={};var _0x121944={};var _0x4ee800;var _0x4df6b7;return db[_0x51a8('0x30')]['findOne']({'where':{'id':_0x682828[_0x51a8('0x46')]['id']}})['then'](handleEntityNotFound(_0x2e1d8e,null))[_0x51a8('0x25')](function(_0xcc76ac){if(_0xcc76ac){_0x4ee800=_0xcc76ac;_0x121944['model']=_[_0x51a8('0x47')](db[_0x51a8('0x57')][_0x51a8('0x31')]);_0x121944[_0x51a8('0x35')]=_['keys'](_0x682828['query']);_0x121944[_0x51a8('0x3c')]=_[_0x51a8('0x36')](_0x121944[_0x51a8('0x34')],_0x121944[_0x51a8('0x35')]);_0x19ffd8['attributes']=_[_0x51a8('0x36')](_0x121944['model'],qs[_0x51a8('0x37')](_0x682828['query'][_0x51a8('0x37')]));_0x19ffd8[_0x51a8('0x38')]=_0x19ffd8[_0x51a8('0x38')][_0x51a8('0x48')]?_0x19ffd8['attributes']:_0x121944[_0x51a8('0x34')];_0x19ffd8['order']=qs[_0x51a8('0x56')](_0x682828[_0x51a8('0x35')][_0x51a8('0x56')]);_0x19ffd8['where']=qs[_0x51a8('0x3c')](_[_0x51a8('0x3d')](_0x682828[_0x51a8('0x35')],_0x121944['filters']));if(_0x682828['query'][_0x51a8('0x3e')]){_0x19ffd8[_0x51a8('0x3b')]=_[_0x51a8('0x40')](_0x19ffd8[_0x51a8('0x3b')],{'$or':_['map'](_0x19ffd8['attributes'],function(_0x46c310){var _0x4f0b3b={};_0x4f0b3b[_0x46c310]={'$like':'%'+_0x682828[_0x51a8('0x35')][_0x51a8('0x3e')]+'%'};return _0x4f0b3b;})});}_0x19ffd8=_[_0x51a8('0x40')]({},_0x19ffd8,_0x682828[_0x51a8('0x49')]);return _0x4ee800[_0x51a8('0x82')](_0x19ffd8);}})[_0x51a8('0x25')](function(_0x2b0888){if(_0x2b0888){_0x4df6b7=_0x2b0888['length'];if(!_0x682828['query']['hasOwnProperty'](_0x51a8('0x60'))){_0x19ffd8[_0x51a8('0x21')]=qs[_0x51a8('0x21')](_0x682828[_0x51a8('0x35')][_0x51a8('0x21')]);_0x19ffd8['offset']=qs[_0x51a8('0x20')](_0x682828['query'][_0x51a8('0x20')]);}return _0x4ee800[_0x51a8('0x82')](_0x19ffd8);}})[_0x51a8('0x25')](function(_0xb9dad5){if(_0xb9dad5){return _0xb9dad5?{'count':_0x4df6b7,'rows':_0xb9dad5}:null;}})['then'](respondWithResult(_0x2e1d8e,null))['catch'](handleError(_0x2e1d8e,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 5a1ad8c..4a6f3fd 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 _0x0a78=['emit','hook','exports','events','../../mysqldb','setMaxListeners','update','remove'];(function(_0x13a11b,_0x5361b4){var _0xe65d31=function(_0x5f2a91){while(--_0x5f2a91){_0x13a11b['push'](_0x13a11b['shift']());}};_0xe65d31(++_0x5361b4);}(_0x0a78,0x1ab));var _0x80a7=function(_0xdfe4da,_0x2210d4){_0xdfe4da=_0xdfe4da-0x0;var _0x164c2d=_0x0a78[_0xdfe4da];return _0x164c2d;};'use strict';var EventEmitter=require(_0x80a7('0x0'));var SmsQueue=require(_0x80a7('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x80a7('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x80a7('0x3'),'afterDestroy':_0x80a7('0x4')};function emitEvent(_0x1b6af6){return function(_0x4e1208,_0x445615,_0x5c556b){SmsQueueEvents[_0x80a7('0x5')](_0x1b6af6+':'+_0x4e1208['id'],_0x4e1208);SmsQueueEvents[_0x80a7('0x5')](_0x1b6af6,_0x4e1208);_0x5c556b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x80a7('0x6')](e,emitEvent(event));}}module[_0x80a7('0x7')]=SmsQueueEvents; \ No newline at end of file +var _0xb3a7=['emit','hasOwnProperty','exports','events','../../mysqldb','SmsQueue','setMaxListeners','save','update'];(function(_0x1c55f1,_0x3669ca){var _0x44dd27=function(_0x531d3e){while(--_0x531d3e){_0x1c55f1['push'](_0x1c55f1['shift']());}};_0x44dd27(++_0x3669ca);}(_0xb3a7,0xe4));var _0x7b3a=function(_0x134497,_0x3097ce){_0x134497=_0x134497-0x0;var _0x281d02=_0xb3a7[_0x134497];return _0x281d02;};'use strict';var EventEmitter=require(_0x7b3a('0x0'));var SmsQueue=require(_0x7b3a('0x1'))['db'][_0x7b3a('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x7b3a('0x3')](0x0);var events={'afterCreate':_0x7b3a('0x4'),'afterUpdate':_0x7b3a('0x5'),'afterDestroy':'remove'};function emitEvent(_0x5cb85b){return function(_0x8d8cca,_0x1f2a20,_0x1950e5){SmsQueueEvents[_0x7b3a('0x6')](_0x5cb85b+':'+_0x8d8cca['id'],_0x8d8cca);SmsQueueEvents[_0x7b3a('0x6')](_0x5cb85b,_0x8d8cca);_0x1950e5(null);};}for(var e in events){if(events[_0x7b3a('0x7')](e)){var event=events[e];SmsQueue['hook'](e,emitEvent(event));}}module[_0x7b3a('0x8')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 652728e..58a7c5e 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 _0x4b95=['exports','define','sms_queues','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./smsQueue.attributes'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4b95,0x1d7));var _0x54b9=function(_0x5e314e,_0x51dbe8){_0x5e314e=_0x5e314e-0x0;var _0x5bbf3f=_0x4b95[_0x5e314e];return _0x5bbf3f;};'use strict';var _=require(_0x54b9('0x0'));var util=require(_0x54b9('0x1'));var logger=require(_0x54b9('0x2'))(_0x54b9('0x3'));var moment=require('moment');var BPromise=require(_0x54b9('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x54b9('0x5'));var rimraf=require(_0x54b9('0x6'));var config=require(_0x54b9('0x7'));var attributes=require(_0x54b9('0x8'));module[_0x54b9('0x9')]=function(_0xe91451,_0x16c235){return _0xe91451[_0x54b9('0xa')]('SmsQueue',attributes,{'tableName':_0x54b9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefe9=['SmsQueue','lodash','../../config/logger','moment','bluebird','path','../../config/environment','./smsQueue.attributes','exports','define'];(function(_0xc4dbc9,_0x1aa6b6){var _0x531773=function(_0x5941d1){while(--_0x5941d1){_0xc4dbc9['push'](_0xc4dbc9['shift']());}};_0x531773(++_0x1aa6b6);}(_0xefe9,0x83));var _0x9efe=function(_0x9c6c1c,_0x21ead9){_0x9c6c1c=_0x9c6c1c-0x0;var _0x594c42=_0xefe9[_0x9c6c1c];return _0x594c42;};'use strict';var _=require(_0x9efe('0x0'));var util=require('util');var logger=require(_0x9efe('0x1'))('api');var moment=require(_0x9efe('0x2'));var BPromise=require(_0x9efe('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9efe('0x4'));var rimraf=require('rimraf');var config=require(_0x9efe('0x5'));var attributes=require(_0x9efe('0x6'));module[_0x9efe('0x7')]=function(_0x184e94,_0x333ef7){return _0x184e94[_0x9efe('0x8')](_0x9efe('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.rpc.js b/server/api/smsQueue/smsQueue.rpc.js index 4b29881..3500366 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 _0x060c=['error','code','message','SmsQueue,\x20%s,\x20%s','result','catch','GetSmsQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowSmsQueue','SmsQueue','find','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','request','info','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x53e683,_0xf62ec5){var _0x4e33ea=function(_0x58250a){while(--_0x58250a){_0x53e683['push'](_0x53e683['shift']());}};_0x4e33ea(++_0xf62ec5);}(_0x060c,0x15c));var _0xc060=function(_0x26a9a3,_0x4ff7a8){_0x26a9a3=_0x26a9a3-0x0;var _0x107999=_0x060c[_0x26a9a3];return _0x107999;};'use strict';var _=require(_0xc060('0x0'));var util=require('util');var moment=require(_0xc060('0x1'));var BPromise=require(_0xc060('0x2'));var rs=require(_0xc060('0x3'));var fs=require('fs');var Redis=require(_0xc060('0x4'));var db=require(_0xc060('0x5'))['db'];var utils=require(_0xc060('0x6'));var logger=require(_0xc060('0x7'))(_0xc060('0x8'));var config=require(_0xc060('0x9'));var jayson=require(_0xc060('0xa'));var client=jayson['client'][_0xc060('0xb')]({'port':0x232a});config['redis']=_[_0xc060('0xc')](config[_0xc060('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0xc060('0xe'))(new Redis(config[_0xc060('0xd')]));require('./smsQueue.socket')['register'](socket);function respondWithRpcPromise(_0x2e2efa,_0x85e49f,_0x35efac){return new BPromise(function(_0x1c1550,_0x202045){return client[_0xc060('0xf')](_0x2e2efa,_0x35efac)['then'](function(_0x3a753c){logger[_0xc060('0x10')]('SmsQueue,\x20%s,\x20%s',_0x85e49f,_0xc060('0x11'));logger[_0xc060('0x12')](_0xc060('0x13'),_0x85e49f,'request\x20sent',JSON[_0xc060('0x14')](_0x3a753c));if(_0x3a753c[_0xc060('0x15')]){if(_0x3a753c[_0xc060('0x15')][_0xc060('0x16')]===0x1f4){logger[_0xc060('0x15')]('SmsQueue,\x20%s,\x20%s',_0x85e49f,_0x3a753c['error'][_0xc060('0x17')]);return _0x202045(_0x3a753c[_0xc060('0x15')][_0xc060('0x17')]);}logger['error'](_0xc060('0x18'),_0x85e49f,_0x3a753c[_0xc060('0x15')]['message']);return _0x1c1550(_0x3a753c['error'][_0xc060('0x17')]);}else{logger[_0xc060('0x10')]('SmsQueue,\x20%s,\x20%s',_0x85e49f,_0xc060('0x11'));_0x1c1550(_0x3a753c[_0xc060('0x19')][_0xc060('0x17')]);}})[_0xc060('0x1a')](function(_0x1bdb47){logger[_0xc060('0x15')](_0xc060('0x18'),_0x85e49f,_0x1bdb47);_0x202045(_0x1bdb47);});});}exports[_0xc060('0x1b')]=function(_0x31a921){var _0x4912dc=this;return new Promise(function(_0x1d4ee5,_0x52eb56){return db['SmsQueue'][_0xc060('0x1c')]({'raw':_0x31a921[_0xc060('0x1d')]?_0x31a921['options']['raw']===undefined?!![]:![]:!![],'where':_0x31a921[_0xc060('0x1d')]?_0x31a921['options'][_0xc060('0x1e')]||null:null,'attributes':_0x31a921[_0xc060('0x1d')]?_0x31a921['options'][_0xc060('0x1f')]||null:null,'limit':_0x31a921[_0xc060('0x1d')]?_0x31a921[_0xc060('0x1d')][_0xc060('0x20')]||null:null,'include':_0x31a921[_0xc060('0x1d')]?_0x31a921[_0xc060('0x1d')][_0xc060('0x21')]?_[_0xc060('0x22')](_0x31a921['options']['include'],function(_0x5626e1){return{'model':db[_0x5626e1[_0xc060('0x23')]],'as':_0x5626e1['as'],'attributes':_0x5626e1[_0xc060('0x1f')],'include':_0x5626e1[_0xc060('0x21')]?_[_0xc060('0x22')](_0x5626e1[_0xc060('0x21')],function(_0x45db80){return{'model':db[_0x45db80[_0xc060('0x23')]],'as':_0x45db80['as'],'attributes':_0x45db80['attributes'],'include':_0x45db80[_0xc060('0x21')]?_[_0xc060('0x22')](_0x45db80[_0xc060('0x21')],function(_0x1f56fc){return{'model':db[_0x1f56fc['model']],'as':_0x1f56fc['as'],'attributes':_0x1f56fc[_0xc060('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc060('0x24')](function(_0x29f063){logger[_0xc060('0x10')](_0xc060('0x1b'),_0x31a921);logger['debug'](_0xc060('0x1b'),_0x31a921,JSON[_0xc060('0x14')](_0x29f063));_0x1d4ee5(_0x29f063);})[_0xc060('0x1a')](function(_0x36c0e8){logger[_0xc060('0x15')]('GetSmsQueue',_0x36c0e8['message'],_0x31a921);_0x52eb56(_0x4912dc['error'](0x1f4,_0x36c0e8[_0xc060('0x17')]));});});};exports[_0xc060('0x25')]=function(_0x3cbef2){var _0x40ca34=this;return new Promise(function(_0x5228a7,_0x361d18){return db[_0xc060('0x26')][_0xc060('0x27')]({'raw':_0x3cbef2[_0xc060('0x1d')]?_0x3cbef2[_0xc060('0x1d')][_0xc060('0x28')]===undefined?!![]:![]:!![],'where':_0x3cbef2['options']?_0x3cbef2[_0xc060('0x1d')][_0xc060('0x1e')]||null:null,'attributes':_0x3cbef2[_0xc060('0x1d')]?_0x3cbef2['options']['attributes']||null:null,'include':_0x3cbef2[_0xc060('0x1d')]?_0x3cbef2[_0xc060('0x1d')][_0xc060('0x21')]?_['map'](_0x3cbef2[_0xc060('0x1d')][_0xc060('0x21')],function(_0x4ed728){return{'model':db[_0x4ed728['model']],'as':_0x4ed728['as'],'attributes':_0x4ed728[_0xc060('0x1f')],'include':_0x4ed728['include']?_[_0xc060('0x22')](_0x4ed728[_0xc060('0x21')],function(_0x1c0390){return{'model':db[_0x1c0390[_0xc060('0x23')]],'as':_0x1c0390['as'],'attributes':_0x1c0390[_0xc060('0x1f')],'include':_0x1c0390['include']?_[_0xc060('0x22')](_0x1c0390[_0xc060('0x21')],function(_0xd276be){return{'model':db[_0xd276be['model']],'as':_0xd276be['as'],'attributes':_0xd276be[_0xc060('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xc060('0x24')](function(_0x1669e1){logger[_0xc060('0x10')](_0xc060('0x25'),_0x3cbef2);logger[_0xc060('0x12')](_0xc060('0x25'),_0x3cbef2,JSON['stringify'](_0x1669e1));_0x5228a7(_0x1669e1);})[_0xc060('0x1a')](function(_0x2c73d6){logger['error'](_0xc060('0x25'),_0x2c73d6[_0xc060('0x17')],_0x3cbef2);_0x361d18(_0x40ca34[_0xc060('0x15')](0x1f4,_0x2c73d6[_0xc060('0x17')]));});});}; \ No newline at end of file +var _0x2186=['GetSmsQueue','SmsQueue','findAll','options','where','attributes','limit','include','map','model','then','ShowSmsQueue','stringify','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','./smsQueue.socket','register','request','info','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch'];(function(_0x436737,_0x2ffcb5){var _0x59b646=function(_0x366bf2){while(--_0x366bf2){_0x436737['push'](_0x436737['shift']());}};_0x59b646(++_0x2ffcb5);}(_0x2186,0x7f));var _0x6218=function(_0xc038ed,_0x3c2df6){_0xc038ed=_0xc038ed-0x0;var _0xbea9ea=_0x2186[_0xc038ed];return _0xbea9ea;};'use strict';var _=require(_0x6218('0x0'));var util=require(_0x6218('0x1'));var moment=require(_0x6218('0x2'));var BPromise=require(_0x6218('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6218('0x4'));var db=require(_0x6218('0x5'))['db'];var utils=require(_0x6218('0x6'));var logger=require(_0x6218('0x7'))(_0x6218('0x8'));var config=require(_0x6218('0x9'));var jayson=require(_0x6218('0xa'));var client=jayson['client'][_0x6218('0xb')]({'port':0x232a});config[_0x6218('0xc')]=_['defaults'](config['redis'],{'host':_0x6218('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6218('0xc')]));require(_0x6218('0xe'))[_0x6218('0xf')](socket);function respondWithRpcPromise(_0x43a54c,_0x3ad75f,_0x295da2){return new BPromise(function(_0x46edf2,_0x5a6436){return client[_0x6218('0x10')](_0x43a54c,_0x295da2)['then'](function(_0xe19c5a){logger[_0x6218('0x11')](_0x6218('0x12'),_0x3ad75f,_0x6218('0x13'));logger[_0x6218('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x3ad75f,_0x6218('0x13'),JSON['stringify'](_0xe19c5a));if(_0xe19c5a[_0x6218('0x15')]){if(_0xe19c5a[_0x6218('0x15')][_0x6218('0x16')]===0x1f4){logger[_0x6218('0x15')](_0x6218('0x12'),_0x3ad75f,_0xe19c5a[_0x6218('0x15')][_0x6218('0x17')]);return _0x5a6436(_0xe19c5a[_0x6218('0x15')][_0x6218('0x17')]);}logger[_0x6218('0x15')](_0x6218('0x12'),_0x3ad75f,_0xe19c5a[_0x6218('0x15')][_0x6218('0x17')]);return _0x46edf2(_0xe19c5a[_0x6218('0x15')][_0x6218('0x17')]);}else{logger[_0x6218('0x11')]('SmsQueue,\x20%s,\x20%s',_0x3ad75f,'request\x20sent');_0x46edf2(_0xe19c5a['result']['message']);}})[_0x6218('0x18')](function(_0x29c898){logger[_0x6218('0x15')](_0x6218('0x12'),_0x3ad75f,_0x29c898);_0x5a6436(_0x29c898);});});}exports[_0x6218('0x19')]=function(_0x11e419){var _0x2e7cf2=this;return new Promise(function(_0x1cef47,_0x3bad25){return db[_0x6218('0x1a')][_0x6218('0x1b')]({'raw':_0x11e419[_0x6218('0x1c')]?_0x11e419[_0x6218('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x11e419['options']?_0x11e419['options'][_0x6218('0x1d')]||null:null,'attributes':_0x11e419[_0x6218('0x1c')]?_0x11e419['options'][_0x6218('0x1e')]||null:null,'limit':_0x11e419[_0x6218('0x1c')]?_0x11e419[_0x6218('0x1c')][_0x6218('0x1f')]||null:null,'include':_0x11e419[_0x6218('0x1c')]?_0x11e419[_0x6218('0x1c')][_0x6218('0x20')]?_[_0x6218('0x21')](_0x11e419[_0x6218('0x1c')][_0x6218('0x20')],function(_0x4ba8b5){return{'model':db[_0x4ba8b5[_0x6218('0x22')]],'as':_0x4ba8b5['as'],'attributes':_0x4ba8b5[_0x6218('0x1e')],'include':_0x4ba8b5[_0x6218('0x20')]?_['map'](_0x4ba8b5['include'],function(_0x3af995){return{'model':db[_0x3af995[_0x6218('0x22')]],'as':_0x3af995['as'],'attributes':_0x3af995[_0x6218('0x1e')],'include':_0x3af995['include']?_[_0x6218('0x21')](_0x3af995['include'],function(_0x286571){return{'model':db[_0x286571['model']],'as':_0x286571['as'],'attributes':_0x286571[_0x6218('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6218('0x23')](function(_0x5f43c1){logger['info'](_0x6218('0x19'),_0x11e419);logger['debug'](_0x6218('0x19'),_0x11e419,JSON['stringify'](_0x5f43c1));_0x1cef47(_0x5f43c1);})[_0x6218('0x18')](function(_0x2587b3){logger['error'](_0x6218('0x19'),_0x2587b3[_0x6218('0x17')],_0x11e419);_0x3bad25(_0x2e7cf2['error'](0x1f4,_0x2587b3[_0x6218('0x17')]));});});};exports['ShowSmsQueue']=function(_0x989326){var _0x34b67f=this;return new Promise(function(_0x1a108a,_0x491749){return db[_0x6218('0x1a')]['find']({'raw':_0x989326[_0x6218('0x1c')]?_0x989326[_0x6218('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x989326[_0x6218('0x1c')]?_0x989326[_0x6218('0x1c')][_0x6218('0x1d')]||null:null,'attributes':_0x989326['options']?_0x989326[_0x6218('0x1c')][_0x6218('0x1e')]||null:null,'include':_0x989326[_0x6218('0x1c')]?_0x989326['options'][_0x6218('0x20')]?_[_0x6218('0x21')](_0x989326[_0x6218('0x1c')][_0x6218('0x20')],function(_0x155a9d){return{'model':db[_0x155a9d['model']],'as':_0x155a9d['as'],'attributes':_0x155a9d[_0x6218('0x1e')],'include':_0x155a9d[_0x6218('0x20')]?_[_0x6218('0x21')](_0x155a9d[_0x6218('0x20')],function(_0x407d48){return{'model':db[_0x407d48[_0x6218('0x22')]],'as':_0x407d48['as'],'attributes':_0x407d48['attributes'],'include':_0x407d48['include']?_[_0x6218('0x21')](_0x407d48[_0x6218('0x20')],function(_0x18e021){return{'model':db[_0x18e021[_0x6218('0x22')]],'as':_0x18e021['as'],'attributes':_0x18e021[_0x6218('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x319c42){logger['info'](_0x6218('0x24'),_0x989326);logger[_0x6218('0x14')](_0x6218('0x24'),_0x989326,JSON[_0x6218('0x25')](_0x319c42));_0x1a108a(_0x319c42);})[_0x6218('0x18')](function(_0x145a64){logger[_0x6218('0x15')](_0x6218('0x24'),_0x145a64[_0x6218('0x17')],_0x989326);_0x491749(_0x34b67f[_0x6218('0x15')](0x1f4,_0x145a64[_0x6218('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index a106fc1..61822dd 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 _0xcf97=['smsQueue:','./smsQueue.events','save','remove','update','emit','removeListener','register'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcf97,0xa1));var _0x7cf9=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0xcf97[_0x1ab180];return _0xfb2c2d;};'use strict';var SmsQueueEvents=require(_0x7cf9('0x0'));var events=[_0x7cf9('0x1'),_0x7cf9('0x2'),_0x7cf9('0x3')];function createListener(_0xcd7acd,_0x4dfa9f){return function(_0x45845d){_0x4dfa9f[_0x7cf9('0x4')](_0xcd7acd,_0x45845d);};}function removeListener(_0x461ec5,_0x3b03c8){return function(){SmsQueueEvents[_0x7cf9('0x5')](_0x461ec5,_0x3b03c8);};}exports[_0x7cf9('0x6')]=function(_0xf08bee){for(var _0x1cdd5f=0x0,_0x37b8a0=events['length'];_0x1cdd5f<_0x37b8a0;_0x1cdd5f++){var _0x3057c7=events[_0x1cdd5f];var _0x80b8e2=createListener(_0x7cf9('0x7')+_0x3057c7,_0xf08bee);SmsQueueEvents['on'](_0x3057c7,_0x80b8e2);}}; \ No newline at end of file +var _0xc3ee=['save','remove','update','removeListener','register','length','smsQueue:','./smsQueue.events'];(function(_0x28578d,_0xcf5cf0){var _0x524826=function(_0x4a51b7){while(--_0x4a51b7){_0x28578d['push'](_0x28578d['shift']());}};_0x524826(++_0xcf5cf0);}(_0xc3ee,0xef));var _0xec3e=function(_0x1c1849,_0x48ad5c){_0x1c1849=_0x1c1849-0x0;var _0x2160c9=_0xc3ee[_0x1c1849];return _0x2160c9;};'use strict';var SmsQueueEvents=require(_0xec3e('0x0'));var events=[_0xec3e('0x1'),_0xec3e('0x2'),_0xec3e('0x3')];function createListener(_0x2f2616,_0x40e9f6){return function(_0x476d2e){_0x40e9f6['emit'](_0x2f2616,_0x476d2e);};}function removeListener(_0x4c21bb,_0x449c73){return function(){SmsQueueEvents[_0xec3e('0x4')](_0x4c21bb,_0x449c73);};}exports[_0xec3e('0x5')]=function(_0x35968f){for(var _0x1e2e39=0x0,_0x283bfd=events[_0xec3e('0x6')];_0x1e2e39<_0x283bfd;_0x1e2e39++){var _0x4b9d72=events[_0x1e2e39];var _0x2a2a2b=createListener(_0xec3e('0x7')+_0x4b9d72,_0x35968f);SmsQueueEvents['on'](_0x4b9d72,_0x2a2a2b);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 1e6eaf5..83f1ac8 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 _0x69a1=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsQueueReport.controller','get','isAuthenticated','/:id','show','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x69a1,0x95));var _0x169a=function(_0x41a818,_0x15da11){_0x41a818=_0x41a818-0x0;var _0x467042=_0x69a1[_0x41a818];return _0x467042;};'use strict';var multer=require(_0x169a('0x0'));var util=require(_0x169a('0x1'));var path=require(_0x169a('0x2'));var timeout=require(_0x169a('0x3'));var express=require('express');var router=express[_0x169a('0x4')]();var auth=require(_0x169a('0x5'));var interaction=require(_0x169a('0x6'));var config=require(_0x169a('0x7'));var controller=require(_0x169a('0x8'));router[_0x169a('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth[_0x169a('0xa')](),controller['describe']);router[_0x169a('0x9')](_0x169a('0xb'),auth[_0x169a('0xa')](),controller[_0x169a('0xc')]);router[_0x169a('0xd')]('/',auth[_0x169a('0xa')](),controller[_0x169a('0xe')]);router[_0x169a('0xf')](_0x169a('0xb'),auth[_0x169a('0xa')](),controller['update']);router[_0x169a('0x10')](_0x169a('0xb'),auth[_0x169a('0xa')](),controller[_0x169a('0x11')]);module[_0x169a('0x12')]=router; \ No newline at end of file +var _0x7df3=['update','delete','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id'];(function(_0x5a8c67,_0x57d5e0){var _0x5a058c=function(_0x168445){while(--_0x168445){_0x5a8c67['push'](_0x5a8c67['shift']());}};_0x5a058c(++_0x57d5e0);}(_0x7df3,0x1ab));var _0x37df=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0x7df3[_0x31e29a];return _0x32d892;};'use strict';var multer=require(_0x37df('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x37df('0x1'));var express=require(_0x37df('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x37df('0x3'));var config=require(_0x37df('0x4'));var controller=require('./smsQueueReport.controller');router[_0x37df('0x5')]('/',auth[_0x37df('0x6')](),controller[_0x37df('0x7')]);router[_0x37df('0x5')](_0x37df('0x8'),auth[_0x37df('0x6')](),controller[_0x37df('0x9')]);router['get']('/:id',auth[_0x37df('0x6')](),controller[_0x37df('0xa')]);router[_0x37df('0xb')]('/',auth[_0x37df('0x6')](),controller[_0x37df('0xc')]);router[_0x37df('0xd')](_0x37df('0xe'),auth[_0x37df('0x6')](),controller[_0x37df('0xf')]);router[_0x37df('0x10')]('/:id',auth[_0x37df('0x6')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index 2bceb9e..c6cf5ec 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 _0x200e=['moment','STRING','DATE'];(function(_0x1694f5,_0x49b7c3){var _0x5b4321=function(_0x58c183){while(--_0x58c183){_0x1694f5['push'](_0x1694f5['shift']());}};_0x5b4321(++_0x49b7c3);}(_0x200e,0x1f2));var _0xe200=function(_0x25df47,_0xaaf7a4){_0x25df47=_0x25df47-0x0;var _0xecfa95=_0x200e[_0x25df47];return _0xecfa95;};'use strict';var moment=require(_0xe200('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xe200('0x1')]},'joinAt':{'type':Sequelize[_0xe200('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xe200('0x2')]},'exitAt':{'type':Sequelize[_0xe200('0x2')]},'reason':{'type':Sequelize[_0xe200('0x1')]}}; \ No newline at end of file +var _0xc7e4=['STRING','DATE','moment','sequelize','exports'];(function(_0x4cfe1f,_0x4324da){var _0x4790a1=function(_0x28ce25){while(--_0x28ce25){_0x4cfe1f['push'](_0x4cfe1f['shift']());}};_0x4790a1(++_0x4324da);}(_0xc7e4,0x98));var _0x4c7e=function(_0x14b344,_0x5dd842){_0x14b344=_0x14b344-0x0;var _0x54779f=_0xc7e4[_0x14b344];return _0x54779f;};'use strict';var moment=require(_0x4c7e('0x0'));var Sequelize=require(_0x4c7e('0x1'));module[_0x4c7e('0x2')]={'uniqueid':{'type':Sequelize[_0x4c7e('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0x4c7e('0x3')]},'joinAt':{'type':Sequelize[_0x4c7e('0x4')]},'leaveAt':{'type':Sequelize[_0x4c7e('0x4')]},'acceptAt':{'type':Sequelize[_0x4c7e('0x4')]},'exitAt':{'type':Sequelize[_0x4c7e('0x4')]},'reason':{'type':Sequelize[_0x4c7e('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index d2666d8..2fc8514 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 _0xe17d=['send','index','SmsQueueReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','map','VIRTUAL','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','create','body','destroy','describe','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','stack','name'];(function(_0x394226,_0x493eb0){var _0x3c9d95=function(_0x52ef76){while(--_0x52ef76){_0x394226['push'](_0x394226['shift']());}};_0x3c9d95(++_0x493eb0);}(_0xe17d,0x1ec));var _0xde17=function(_0x1f7e0,_0x5626a3){_0x1f7e0=_0x1f7e0-0x0;var _0x244103=_0xe17d[_0x1f7e0];return _0x244103;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xde17('0x0'));var rimraf=require(_0xde17('0x1'));var zipdir=require(_0xde17('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xde17('0x3'));var BPromise=require(_0xde17('0x4'));var Mustache=require(_0xde17('0x5'));var util=require(_0xde17('0x6'));var path=require(_0xde17('0x7'));var sox=require('sox');var csv=require(_0xde17('0x8'));var ejs=require(_0xde17('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xde17('0xa'));var crypto=require(_0xde17('0xb'));var jsforce=require(_0xde17('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xde17('0xd'));var Papa=require(_0xde17('0xe'));var Redis=require(_0xde17('0xf'));var authService=require(_0xde17('0x10'));var qs=require(_0xde17('0x11'));var as=require(_0xde17('0x12'));var hardwareService=require(_0xde17('0x13'));var logger=require(_0xde17('0x14'))('api');var utils=require(_0xde17('0x15'));var config=require('../../config/environment');var db=require(_0xde17('0x16'))['db'];function respondWithStatusCode(_0x576da1,_0x3324cc){_0x3324cc=_0x3324cc||0xcc;return function(_0x5551eb){if(_0x5551eb){return _0x576da1[_0xde17('0x17')](_0x3324cc);}return _0x576da1[_0xde17('0x18')](_0x3324cc)[_0xde17('0x19')]();};}function respondWithResult(_0x3bf03c,_0x4c022f){_0x4c022f=_0x4c022f||0xc8;return function(_0x3d133e){if(_0x3d133e){return _0x3bf03c[_0xde17('0x18')](_0x4c022f)['json'](_0x3d133e);}};}function respondWithFilteredResult(_0x45951f,_0x194b1c){return function(_0x1d9018){if(_0x1d9018){var _0x5efcfe=_0x1d9018[_0xde17('0x1a')],_0x48de9c=_0x194b1c[_0xde17('0x1b')],_0xd40d0a=_0x194b1c[_0xde17('0x1b')]+_0x194b1c[_0xde17('0x1c')],_0x33ddea;if(_0xd40d0a>=_0x5efcfe){_0xd40d0a=_0x5efcfe;_0x33ddea=0xc8;}else{_0x33ddea=0xce;}_0x45951f[_0xde17('0x18')](_0x33ddea);return _0x45951f[_0xde17('0x1d')](_0xde17('0x1e'),_0x48de9c+'-'+_0xd40d0a+'/'+_0x5efcfe)[_0xde17('0x1f')](_0x1d9018);}return null;};}function patchUpdates(_0x2a3f2f){return function(_0xce7849){try{jsonpatch[_0xde17('0x20')](_0xce7849,_0x2a3f2f,!![]);}catch(_0x48c1d8){return BPromise[_0xde17('0x21')](_0x48c1d8);}return _0xce7849[_0xde17('0x22')]();};}function saveUpdates(_0x1b9dad,_0x468a5b){return function(_0xb5ddc3){if(_0xb5ddc3){return _0xb5ddc3[_0xde17('0x23')](_0x1b9dad)[_0xde17('0x24')](function(_0x15180d){return _0x15180d;});}return null;};}function removeEntity(_0x141185,_0x38d6ec){return function(_0x272ddd){if(_0x272ddd){return _0x272ddd['destroy']()[_0xde17('0x24')](function(){_0x141185[_0xde17('0x18')](0xcc)[_0xde17('0x19')]();});}};}function handleEntityNotFound(_0x13bfd5,_0x14d1ad){return function(_0x2776ea){if(!_0x2776ea){_0x13bfd5[_0xde17('0x17')](0x194);}return _0x2776ea;};}function handleError(_0x335a1f,_0x570e1f){_0x570e1f=_0x570e1f||0x1f4;return function(_0x1294e5){logger[_0xde17('0x25')](_0x1294e5[_0xde17('0x26')]);if(_0x1294e5['name']){delete _0x1294e5[_0xde17('0x27')];}_0x335a1f['status'](_0x570e1f)[_0xde17('0x28')](_0x1294e5);};}exports[_0xde17('0x29')]=function(_0x1b611b,_0x1c246d){var _0x18e332={},_0x4c00b8={},_0xcaf03f={'count':0x0,'rows':[]};var _0x3868ac=_['map'](db[_0xde17('0x2a')]['rawAttributes'],function(_0x730eec){return{'name':_0x730eec[_0xde17('0x2b')],'type':_0x730eec[_0xde17('0x2c')][_0xde17('0x2d')]};});_0x4c00b8[_0xde17('0x2e')]=_['map'](_0x3868ac,_0xde17('0x27'));_0x4c00b8[_0xde17('0x2f')]=_[_0xde17('0x30')](_0x1b611b[_0xde17('0x2f')]);_0x4c00b8[_0xde17('0x31')]=_[_0xde17('0x32')](_0x4c00b8['model'],_0x4c00b8[_0xde17('0x2f')]);_0x18e332[_0xde17('0x33')]=_[_0xde17('0x32')](_0x4c00b8[_0xde17('0x2e')],qs[_0xde17('0x34')](_0x1b611b['query'][_0xde17('0x34')]));_0x18e332['attributes']=_0x18e332[_0xde17('0x33')][_0xde17('0x35')]?_0x18e332[_0xde17('0x33')]:_0x4c00b8[_0xde17('0x2e')];if(!_0x1b611b[_0xde17('0x2f')][_0xde17('0x36')](_0xde17('0x37'))){_0x18e332[_0xde17('0x1c')]=qs[_0xde17('0x1c')](_0x1b611b['query'][_0xde17('0x1c')]);_0x18e332[_0xde17('0x1b')]=qs['offset'](_0x1b611b[_0xde17('0x2f')][_0xde17('0x1b')]);}_0x18e332[_0xde17('0x38')]=qs[_0xde17('0x39')](_0x1b611b['query'][_0xde17('0x39')]);_0x18e332['where']=qs['filters'](_[_0xde17('0x3a')](_0x1b611b[_0xde17('0x2f')],_0x4c00b8[_0xde17('0x31')]));if(_0x1b611b['query'][_0xde17('0x3b')]){_0x18e332[_0xde17('0x3c')]=_['merge'](_0x18e332[_0xde17('0x3c')],{'$or':_[_0xde17('0x3d')](_0x3868ac,function(_0xf384a3){if(_0xf384a3[_0xde17('0x2c')]!==_0xde17('0x3e')){var _0x4070d0={};_0x4070d0[_0xf384a3[_0xde17('0x27')]]={'$like':'%'+_0x1b611b[_0xde17('0x2f')][_0xde17('0x3b')]+'%'};return _0x4070d0;}})});}_0x18e332=_[_0xde17('0x3f')]({},_0x18e332,_0x1b611b[_0xde17('0x40')]);var _0x448bb1={'where':_0x18e332[_0xde17('0x3c')]};return db[_0xde17('0x2a')]['count'](_0x448bb1)['then'](function(_0x171188){_0xcaf03f[_0xde17('0x1a')]=_0x171188;if(_0x1b611b[_0xde17('0x2f')][_0xde17('0x41')]){_0x18e332[_0xde17('0x42')]=[{'all':!![]}];}return db[_0xde17('0x2a')][_0xde17('0x43')](_0x18e332);})[_0xde17('0x24')](function(_0x39b190){_0xcaf03f['rows']=_0x39b190;return _0xcaf03f;})['then'](respondWithFilteredResult(_0x1c246d,_0x18e332))['catch'](handleError(_0x1c246d,null));};exports['show']=function(_0x42da66,_0x5cafa9){var _0x397599={'raw':!![],'where':{'id':_0x42da66[_0xde17('0x44')]['id']}},_0x70004e={};_0x70004e[_0xde17('0x2e')]=_[_0xde17('0x30')](db[_0xde17('0x2a')][_0xde17('0x45')]);_0x70004e[_0xde17('0x2f')]=_['keys'](_0x42da66['query']);_0x70004e[_0xde17('0x31')]=_[_0xde17('0x32')](_0x70004e[_0xde17('0x2e')],_0x70004e[_0xde17('0x2f')]);_0x397599[_0xde17('0x33')]=_['intersection'](_0x70004e[_0xde17('0x2e')],qs[_0xde17('0x34')](_0x42da66[_0xde17('0x2f')][_0xde17('0x34')]));_0x397599[_0xde17('0x33')]=_0x397599['attributes'][_0xde17('0x35')]?_0x397599[_0xde17('0x33')]:_0x70004e[_0xde17('0x2e')];if(_0x42da66[_0xde17('0x2f')]['includeAll']){_0x397599[_0xde17('0x42')]=[{'all':!![]}];}_0x397599=_[_0xde17('0x3f')]({},_0x397599,_0x42da66[_0xde17('0x40')]);return db['SmsQueueReport'][_0xde17('0x46')](_0x397599)['then'](handleEntityNotFound(_0x5cafa9,null))[_0xde17('0x24')](respondWithResult(_0x5cafa9,null))[_0xde17('0x47')](handleError(_0x5cafa9,null));};exports[_0xde17('0x48')]=function(_0xf2b766,_0x29ce2a){return db[_0xde17('0x2a')][_0xde17('0x48')](_0xf2b766[_0xde17('0x49')],{})[_0xde17('0x24')](respondWithResult(_0x29ce2a,0xc9))[_0xde17('0x47')](handleError(_0x29ce2a,null));};exports[_0xde17('0x23')]=function(_0x333c36,_0x5ef7f9){if(_0x333c36[_0xde17('0x49')]['id']){delete _0x333c36[_0xde17('0x49')]['id'];}return db[_0xde17('0x2a')][_0xde17('0x46')]({'where':{'id':_0x333c36[_0xde17('0x44')]['id']}})[_0xde17('0x24')](handleEntityNotFound(_0x5ef7f9,null))[_0xde17('0x24')](saveUpdates(_0x333c36[_0xde17('0x49')],null))[_0xde17('0x24')](respondWithResult(_0x5ef7f9,null))[_0xde17('0x47')](handleError(_0x5ef7f9,null));};exports[_0xde17('0x4a')]=function(_0x4a76c7,_0xd879fa){return db['SmsQueueReport']['find']({'where':{'id':_0x4a76c7[_0xde17('0x44')]['id']}})['then'](handleEntityNotFound(_0xd879fa,null))[_0xde17('0x24')](removeEntity(_0xd879fa,null))[_0xde17('0x47')](handleError(_0xd879fa,null));};exports[_0xde17('0x4b')]=function(_0x2bf1f7,_0x37ec27){return db[_0xde17('0x2a')][_0xde17('0x4b')]()[_0xde17('0x24')](respondWithResult(_0x37ec27,null))['catch'](handleError(_0x37ec27,null));}; \ No newline at end of file +var _0x9445=['rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','send','index','SmsQueueReport','fieldName','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format'];(function(_0xce5cc1,_0x6816ff){var _0x3393a5=function(_0x596d82){while(--_0x596d82){_0xce5cc1['push'](_0xce5cc1['shift']());}};_0x3393a5(++_0x6816ff);}(_0x9445,0x15c));var _0x5944=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0x9445[_0x57b54c];return _0x59cc19;};'use strict';var pdf=require(_0x5944('0x0'));var emlformat=require(_0x5944('0x1'));var rimraf=require(_0x5944('0x2'));var zipdir=require(_0x5944('0x3'));var jsonpatch=require(_0x5944('0x4'));var rp=require(_0x5944('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5944('0x6'));var util=require(_0x5944('0x7'));var path=require('path');var sox=require(_0x5944('0x8'));var csv=require(_0x5944('0x9'));var ejs=require(_0x5944('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x5944('0xb'));var toCsv=require(_0x5944('0x9'));var querystring=require('querystring');var Papa=require(_0x5944('0xc'));var Redis=require(_0x5944('0xd'));var authService=require(_0x5944('0xe'));var qs=require(_0x5944('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5944('0x10'));var logger=require(_0x5944('0x11'))(_0x5944('0x12'));var utils=require(_0x5944('0x13'));var config=require(_0x5944('0x14'));var db=require(_0x5944('0x15'))['db'];function respondWithStatusCode(_0x70bcdf,_0x22ee72){_0x22ee72=_0x22ee72||0xcc;return function(_0xd43721){if(_0xd43721){return _0x70bcdf['sendStatus'](_0x22ee72);}return _0x70bcdf[_0x5944('0x16')](_0x22ee72)[_0x5944('0x17')]();};}function respondWithResult(_0x844713,_0x286ba7){_0x286ba7=_0x286ba7||0xc8;return function(_0x193e2e){if(_0x193e2e){return _0x844713[_0x5944('0x16')](_0x286ba7)[_0x5944('0x18')](_0x193e2e);}};}function respondWithFilteredResult(_0x51469f,_0x55f2d6){return function(_0x5ccc0e){if(_0x5ccc0e){var _0x1d0f51=_0x5ccc0e[_0x5944('0x19')],_0x19c8cb=_0x55f2d6[_0x5944('0x1a')],_0x5b1531=_0x55f2d6[_0x5944('0x1a')]+_0x55f2d6['limit'],_0x6d048f;if(_0x5b1531>=_0x1d0f51){_0x5b1531=_0x1d0f51;_0x6d048f=0xc8;}else{_0x6d048f=0xce;}_0x51469f[_0x5944('0x16')](_0x6d048f);return _0x51469f[_0x5944('0x1b')](_0x5944('0x1c'),_0x19c8cb+'-'+_0x5b1531+'/'+_0x1d0f51)[_0x5944('0x18')](_0x5ccc0e);}return null;};}function patchUpdates(_0x1000a5){return function(_0x52d0c2){try{jsonpatch[_0x5944('0x1d')](_0x52d0c2,_0x1000a5,!![]);}catch(_0x54d5aa){return BPromise[_0x5944('0x1e')](_0x54d5aa);}return _0x52d0c2[_0x5944('0x1f')]();};}function saveUpdates(_0x1692f6,_0x1b226f){return function(_0x49a7eb){if(_0x49a7eb){return _0x49a7eb[_0x5944('0x20')](_0x1692f6)[_0x5944('0x21')](function(_0x3bdffc){return _0x3bdffc;});}return null;};}function removeEntity(_0x41b9dc,_0x2a9dfc){return function(_0xa1cad8){if(_0xa1cad8){return _0xa1cad8[_0x5944('0x22')]()[_0x5944('0x21')](function(){_0x41b9dc[_0x5944('0x16')](0xcc)[_0x5944('0x17')]();});}};}function handleEntityNotFound(_0x12fa81,_0x34ebdd){return function(_0xe33740){if(!_0xe33740){_0x12fa81['sendStatus'](0x194);}return _0xe33740;};}function handleError(_0x58de64,_0x378fa2){_0x378fa2=_0x378fa2||0x1f4;return function(_0x4c6ff7){logger[_0x5944('0x23')](_0x4c6ff7['stack']);if(_0x4c6ff7[_0x5944('0x24')]){delete _0x4c6ff7[_0x5944('0x24')];}_0x58de64['status'](_0x378fa2)[_0x5944('0x25')](_0x4c6ff7);};}exports[_0x5944('0x26')]=function(_0x54577d,_0x9e4d08){var _0x421369={},_0x3463b7={},_0x3ee34f={'count':0x0,'rows':[]};var _0x35e4d5=_['map'](db[_0x5944('0x27')]['rawAttributes'],function(_0x249bfd){return{'name':_0x249bfd[_0x5944('0x28')],'type':_0x249bfd['type']['key']};});_0x3463b7[_0x5944('0x29')]=_[_0x5944('0x2a')](_0x35e4d5,'name');_0x3463b7[_0x5944('0x2b')]=_[_0x5944('0x2c')](_0x54577d[_0x5944('0x2b')]);_0x3463b7[_0x5944('0x2d')]=_[_0x5944('0x2e')](_0x3463b7[_0x5944('0x29')],_0x3463b7[_0x5944('0x2b')]);_0x421369['attributes']=_[_0x5944('0x2e')](_0x3463b7['model'],qs[_0x5944('0x2f')](_0x54577d[_0x5944('0x2b')][_0x5944('0x2f')]));_0x421369[_0x5944('0x30')]=_0x421369[_0x5944('0x30')]['length']?_0x421369[_0x5944('0x30')]:_0x3463b7[_0x5944('0x29')];if(!_0x54577d['query'][_0x5944('0x31')](_0x5944('0x32'))){_0x421369[_0x5944('0x33')]=qs[_0x5944('0x33')](_0x54577d[_0x5944('0x2b')][_0x5944('0x33')]);_0x421369[_0x5944('0x1a')]=qs[_0x5944('0x1a')](_0x54577d[_0x5944('0x2b')]['offset']);}_0x421369[_0x5944('0x34')]=qs['sort'](_0x54577d[_0x5944('0x2b')]['sort']);_0x421369[_0x5944('0x35')]=qs[_0x5944('0x2d')](_[_0x5944('0x36')](_0x54577d['query'],_0x3463b7[_0x5944('0x2d')]));if(_0x54577d[_0x5944('0x2b')][_0x5944('0x37')]){_0x421369[_0x5944('0x35')]=_[_0x5944('0x38')](_0x421369['where'],{'$or':_[_0x5944('0x2a')](_0x35e4d5,function(_0x57a824){if(_0x57a824[_0x5944('0x39')]!==_0x5944('0x3a')){var _0x55b02d={};_0x55b02d[_0x57a824[_0x5944('0x24')]]={'$like':'%'+_0x54577d[_0x5944('0x2b')]['filter']+'%'};return _0x55b02d;}})});}_0x421369=_[_0x5944('0x38')]({},_0x421369,_0x54577d[_0x5944('0x3b')]);var _0x152622={'where':_0x421369[_0x5944('0x35')]};return db[_0x5944('0x27')][_0x5944('0x19')](_0x152622)['then'](function(_0x912a7f){_0x3ee34f[_0x5944('0x19')]=_0x912a7f;if(_0x54577d[_0x5944('0x2b')]['includeAll']){_0x421369[_0x5944('0x3c')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x5944('0x3d')](_0x421369);})[_0x5944('0x21')](function(_0x322392){_0x3ee34f[_0x5944('0x3e')]=_0x322392;return _0x3ee34f;})[_0x5944('0x21')](respondWithFilteredResult(_0x9e4d08,_0x421369))[_0x5944('0x3f')](handleError(_0x9e4d08,null));};exports[_0x5944('0x40')]=function(_0x55da96,_0x238210){var _0x266a8c={'raw':!![],'where':{'id':_0x55da96['params']['id']}},_0x1a4c3b={};_0x1a4c3b['model']=_[_0x5944('0x2c')](db['SmsQueueReport']['rawAttributes']);_0x1a4c3b['query']=_[_0x5944('0x2c')](_0x55da96['query']);_0x1a4c3b['filters']=_[_0x5944('0x2e')](_0x1a4c3b[_0x5944('0x29')],_0x1a4c3b[_0x5944('0x2b')]);_0x266a8c[_0x5944('0x30')]=_[_0x5944('0x2e')](_0x1a4c3b['model'],qs['fields'](_0x55da96[_0x5944('0x2b')][_0x5944('0x2f')]));_0x266a8c[_0x5944('0x30')]=_0x266a8c[_0x5944('0x30')]['length']?_0x266a8c[_0x5944('0x30')]:_0x1a4c3b[_0x5944('0x29')];if(_0x55da96[_0x5944('0x2b')]['includeAll']){_0x266a8c[_0x5944('0x3c')]=[{'all':!![]}];}_0x266a8c=_[_0x5944('0x38')]({},_0x266a8c,_0x55da96['options']);return db[_0x5944('0x27')][_0x5944('0x41')](_0x266a8c)['then'](handleEntityNotFound(_0x238210,null))['then'](respondWithResult(_0x238210,null))[_0x5944('0x3f')](handleError(_0x238210,null));};exports[_0x5944('0x42')]=function(_0xcb5ad7,_0xef1f63){return db[_0x5944('0x27')][_0x5944('0x42')](_0xcb5ad7['body'],{})[_0x5944('0x21')](respondWithResult(_0xef1f63,0xc9))[_0x5944('0x3f')](handleError(_0xef1f63,null));};exports[_0x5944('0x20')]=function(_0x2798e1,_0x6c365e){if(_0x2798e1[_0x5944('0x43')]['id']){delete _0x2798e1[_0x5944('0x43')]['id'];}return db[_0x5944('0x27')][_0x5944('0x41')]({'where':{'id':_0x2798e1[_0x5944('0x44')]['id']}})[_0x5944('0x21')](handleEntityNotFound(_0x6c365e,null))['then'](saveUpdates(_0x2798e1['body'],null))['then'](respondWithResult(_0x6c365e,null))[_0x5944('0x3f')](handleError(_0x6c365e,null));};exports[_0x5944('0x22')]=function(_0x28c5de,_0x4e6848){return db[_0x5944('0x27')]['find']({'where':{'id':_0x28c5de[_0x5944('0x44')]['id']}})[_0x5944('0x21')](handleEntityNotFound(_0x4e6848,null))[_0x5944('0x21')](removeEntity(_0x4e6848,null))[_0x5944('0x3f')](handleError(_0x4e6848,null));};exports[_0x5944('0x45')]=function(_0x4d0beb,_0x42fa26){return db[_0x5944('0x27')][_0x5944('0x45')]()[_0x5944('0x21')](respondWithResult(_0x42fa26,null))['catch'](handleError(_0x42fa26,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 1c97570..9b98094 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 _0x253c=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','SmsQueueReport','report_sms_queue','uniqueid','lodash','util','../../config/logger'];(function(_0x4a8d64,_0x5ce228){var _0x254cbd=function(_0x2abd51){while(--_0x2abd51){_0x4a8d64['push'](_0x4a8d64['shift']());}};_0x254cbd(++_0x5ce228);}(_0x253c,0x13f));var _0xc253=function(_0x2c4cee,_0xed54d6){_0x2c4cee=_0x2c4cee-0x0;var _0x4cad54=_0x253c[_0x2c4cee];return _0x4cad54;};'use strict';var _=require(_0xc253('0x0'));var util=require(_0xc253('0x1'));var logger=require(_0xc253('0x2'))(_0xc253('0x3'));var moment=require(_0xc253('0x4'));var BPromise=require(_0xc253('0x5'));var rp=require(_0xc253('0x6'));var fs=require('fs');var path=require(_0xc253('0x7'));var rimraf=require(_0xc253('0x8'));var config=require(_0xc253('0x9'));var attributes=require(_0xc253('0xa'));module['exports']=function(_0xfc59d7,_0x10ef82){return _0xfc59d7['define'](_0xc253('0xb'),attributes,{'tableName':_0xc253('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xc253('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x05bf=['SmsQueueReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports'];(function(_0x46c908,_0x5bfe6c){var _0x1bc0c4=function(_0x59d587){while(--_0x59d587){_0x46c908['push'](_0x46c908['shift']());}};_0x1bc0c4(++_0x5bfe6c);}(_0x05bf,0x77));var _0xf05b=function(_0x482e1c,_0x30d14b){_0x482e1c=_0x482e1c-0x0;var _0x518f73=_0x05bf[_0x482e1c];return _0x518f73;};'use strict';var _=require(_0xf05b('0x0'));var util=require(_0xf05b('0x1'));var logger=require(_0xf05b('0x2'))(_0xf05b('0x3'));var moment=require(_0xf05b('0x4'));var BPromise=require(_0xf05b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf05b('0x6'));var rimraf=require(_0xf05b('0x7'));var config=require(_0xf05b('0x8'));var attributes=require(_0xf05b('0x9'));module[_0xf05b('0xa')]=function(_0x1d2576,_0x3ce13e){return _0x1d2576['define'](_0xf05b('0xb'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0xf05b('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index 4a3d79a..d70c216 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 _0x6dfe=['message','result','catch','CreateSmsQueueReport','SmsQueueReport','options','raw','stringify','update','body','where','attributes','UpdateSmsQueueReport','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','debug','request\x20sent','error','code'];(function(_0x2a75d2,_0x1403cc){var _0x3842a1=function(_0x23430f){while(--_0x23430f){_0x2a75d2['push'](_0x2a75d2['shift']());}};_0x3842a1(++_0x1403cc);}(_0x6dfe,0x14d));var _0xe6df=function(_0x25f7fe,_0x14544d){_0x25f7fe=_0x25f7fe-0x0;var _0x29991a=_0x6dfe[_0x25f7fe];return _0x29991a;};'use strict';var _=require('lodash');var util=require(_0xe6df('0x0'));var moment=require(_0xe6df('0x1'));var BPromise=require(_0xe6df('0x2'));var rs=require(_0xe6df('0x3'));var fs=require('fs');var Redis=require(_0xe6df('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe6df('0x5'));var logger=require(_0xe6df('0x6'))(_0xe6df('0x7'));var config=require('../../config/environment');var jayson=require(_0xe6df('0x8'));var client=jayson[_0xe6df('0x9')][_0xe6df('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3594c1,_0x41841f,_0x242295){return new BPromise(function(_0x5ce9a6,_0x289a16){return client[_0xe6df('0xb')](_0x3594c1,_0x242295)[_0xe6df('0xc')](function(_0x9ff6db){logger[_0xe6df('0xd')](_0xe6df('0xe'),_0x41841f,'request\x20sent');logger[_0xe6df('0xf')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x41841f,_0xe6df('0x10'),JSON['stringify'](_0x9ff6db));if(_0x9ff6db[_0xe6df('0x11')]){if(_0x9ff6db[_0xe6df('0x11')][_0xe6df('0x12')]===0x1f4){logger[_0xe6df('0x11')]('SmsQueueReport,\x20%s,\x20%s',_0x41841f,_0x9ff6db['error'][_0xe6df('0x13')]);return _0x289a16(_0x9ff6db[_0xe6df('0x11')]['message']);}logger[_0xe6df('0x11')](_0xe6df('0xe'),_0x41841f,_0x9ff6db['error'][_0xe6df('0x13')]);return _0x5ce9a6(_0x9ff6db[_0xe6df('0x11')][_0xe6df('0x13')]);}else{logger['info'](_0xe6df('0xe'),_0x41841f,_0xe6df('0x10'));_0x5ce9a6(_0x9ff6db[_0xe6df('0x14')][_0xe6df('0x13')]);}})[_0xe6df('0x15')](function(_0x59fe78){logger[_0xe6df('0x11')](_0xe6df('0xe'),_0x41841f,_0x59fe78);_0x289a16(_0x59fe78);});});}exports[_0xe6df('0x16')]=function(_0x4eba0a){var _0x3ab93f=this;return new Promise(function(_0x2c966f,_0xafad8f){return db[_0xe6df('0x17')]['create'](_0x4eba0a['body'],{'raw':_0x4eba0a['options']?_0x4eba0a[_0xe6df('0x18')][_0xe6df('0x19')]===undefined?!![]:![]:!![]})[_0xe6df('0xc')](function(_0x42b11b){logger[_0xe6df('0xd')](_0xe6df('0x16'),_0x4eba0a);logger['debug']('CreateSmsQueueReport',_0x4eba0a,JSON[_0xe6df('0x1a')](_0x42b11b));_0x2c966f(_0x42b11b);})[_0xe6df('0x15')](function(_0x4c25b1){logger[_0xe6df('0x11')](_0xe6df('0x16'),_0x4c25b1[_0xe6df('0x13')],_0x4eba0a);_0xafad8f(_0x3ab93f[_0xe6df('0x11')](0x1f4,_0x4c25b1['message']));});});};exports['UpdateSmsQueueReport']=function(_0x53072c){var _0x5f17bc=this;return new Promise(function(_0x2bce34,_0x3a2187){return db['SmsQueueReport'][_0xe6df('0x1b')](_0x53072c[_0xe6df('0x1c')],{'raw':_0x53072c[_0xe6df('0x18')]?_0x53072c[_0xe6df('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x53072c['options']?_0x53072c[_0xe6df('0x18')][_0xe6df('0x1d')]||null:null,'attributes':_0x53072c[_0xe6df('0x18')]?_0x53072c[_0xe6df('0x18')][_0xe6df('0x1e')]||null:null,'limit':_0x53072c[_0xe6df('0x18')]?_0x53072c[_0xe6df('0x18')]['limit']||null:null})[_0xe6df('0xc')](function(_0x129d84){logger[_0xe6df('0xd')]('UpdateSmsQueueReport',_0x53072c);logger[_0xe6df('0xf')]('UpdateSmsQueueReport',_0x53072c,JSON[_0xe6df('0x1a')](_0x129d84));_0x2bce34(_0x129d84);})['catch'](function(_0x353893){logger[_0xe6df('0x11')](_0xe6df('0x1f'),_0x353893['message'],_0x53072c);_0x3a2187(_0x5f17bc[_0xe6df('0x11')](0x1f4,_0x353893[_0xe6df('0x13')]));});});}; \ No newline at end of file +var _0x7683=['rpc','../../config/environment','client','then','request\x20sent','debug','stringify','error','code','message','SmsQueueReport,\x20%s,\x20%s','result','catch','CreateSmsQueueReport','body','options','info','update','raw','where','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger'];(function(_0x1e4152,_0x393186){var _0xea067a=function(_0x325b26){while(--_0x325b26){_0x1e4152['push'](_0x1e4152['shift']());}};_0xea067a(++_0x393186);}(_0x7683,0x71));var _0x3768=function(_0x3f00ee,_0x1d1673){_0x3f00ee=_0x3f00ee-0x0;var _0x18a07e=_0x7683[_0x3f00ee];return _0x18a07e;};'use strict';var _=require(_0x3768('0x0'));var util=require(_0x3768('0x1'));var moment=require(_0x3768('0x2'));var BPromise=require(_0x3768('0x3'));var rs=require(_0x3768('0x4'));var fs=require('fs');var Redis=require(_0x3768('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x3768('0x6'))(_0x3768('0x7'));var config=require(_0x3768('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x3768('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x471a42,_0x54692d,_0x5c695f){return new BPromise(function(_0x18c903,_0x96702a){return client['request'](_0x471a42,_0x5c695f)[_0x3768('0xa')](function(_0x43aff4){logger['info']('SmsQueueReport,\x20%s,\x20%s',_0x54692d,_0x3768('0xb'));logger[_0x3768('0xc')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x54692d,_0x3768('0xb'),JSON[_0x3768('0xd')](_0x43aff4));if(_0x43aff4[_0x3768('0xe')]){if(_0x43aff4[_0x3768('0xe')][_0x3768('0xf')]===0x1f4){logger[_0x3768('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x54692d,_0x43aff4['error'][_0x3768('0x10')]);return _0x96702a(_0x43aff4[_0x3768('0xe')][_0x3768('0x10')]);}logger[_0x3768('0xe')](_0x3768('0x11'),_0x54692d,_0x43aff4[_0x3768('0xe')][_0x3768('0x10')]);return _0x18c903(_0x43aff4[_0x3768('0xe')][_0x3768('0x10')]);}else{logger['info'](_0x3768('0x11'),_0x54692d,'request\x20sent');_0x18c903(_0x43aff4[_0x3768('0x12')][_0x3768('0x10')]);}})[_0x3768('0x13')](function(_0xe91931){logger[_0x3768('0xe')]('SmsQueueReport,\x20%s,\x20%s',_0x54692d,_0xe91931);_0x96702a(_0xe91931);});});}exports[_0x3768('0x14')]=function(_0x2cef47){var _0x5783ec=this;return new Promise(function(_0x195b2a,_0x7b6b7c){return db['SmsQueueReport']['create'](_0x2cef47[_0x3768('0x15')],{'raw':_0x2cef47['options']?_0x2cef47[_0x3768('0x16')]['raw']===undefined?!![]:![]:!![]})[_0x3768('0xa')](function(_0x48769d){logger[_0x3768('0x17')](_0x3768('0x14'),_0x2cef47);logger[_0x3768('0xc')](_0x3768('0x14'),_0x2cef47,JSON[_0x3768('0xd')](_0x48769d));_0x195b2a(_0x48769d);})[_0x3768('0x13')](function(_0x4c2d79){logger[_0x3768('0xe')]('CreateSmsQueueReport',_0x4c2d79[_0x3768('0x10')],_0x2cef47);_0x7b6b7c(_0x5783ec[_0x3768('0xe')](0x1f4,_0x4c2d79[_0x3768('0x10')]));});});};exports['UpdateSmsQueueReport']=function(_0x177c4d){var _0xf8acba=this;return new Promise(function(_0x3eec97,_0x56035){return db['SmsQueueReport'][_0x3768('0x18')](_0x177c4d[_0x3768('0x15')],{'raw':_0x177c4d['options']?_0x177c4d[_0x3768('0x16')][_0x3768('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x177c4d[_0x3768('0x16')]?_0x177c4d[_0x3768('0x16')][_0x3768('0x1a')]||null:null,'attributes':_0x177c4d['options']?_0x177c4d[_0x3768('0x16')][_0x3768('0x1b')]||null:null,'limit':_0x177c4d['options']?_0x177c4d['options'][_0x3768('0x1c')]||null:null})[_0x3768('0xa')](function(_0x75c193){logger[_0x3768('0x17')](_0x3768('0x1d'),_0x177c4d);logger[_0x3768('0xc')](_0x3768('0x1d'),_0x177c4d,JSON[_0x3768('0xd')](_0x75c193));_0x3eec97(_0x75c193);})[_0x3768('0x13')](function(_0x1b992b){logger[_0x3768('0xe')]('UpdateSmsQueueReport',_0x1b992b['message'],_0x177c4d);_0x56035(_0xf8acba['error'](0x1f4,_0x1b992b[_0x3768('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 270bdbb..f53d892 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 _0x4213=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','post'];(function(_0x3eea50,_0x54d651){var _0x3f1f0e=function(_0x1f50f7){while(--_0x1f50f7){_0x3eea50['push'](_0x3eea50['shift']());}};_0x3f1f0e(++_0x54d651);}(_0x4213,0x77));var _0x3421=function(_0x1d0e88,_0x46fc0a){_0x1d0e88=_0x1d0e88-0x0;var _0x556b97=_0x4213[_0x1d0e88];return _0x556b97;};'use strict';var multer=require(_0x3421('0x0'));var util=require(_0x3421('0x1'));var path=require(_0x3421('0x2'));var timeout=require(_0x3421('0x3'));var express=require(_0x3421('0x4'));var router=express[_0x3421('0x5')]();var auth=require(_0x3421('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3421('0x7'));var controller=require('./smsTransferReport.controller');router[_0x3421('0x8')]('/',auth[_0x3421('0x9')](),controller[_0x3421('0xa')]);router[_0x3421('0x8')]('/describe',auth[_0x3421('0x9')](),controller[_0x3421('0xb')]);router[_0x3421('0x8')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller['show']);router[_0x3421('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x3421('0xe')]('/:id',auth[_0x3421('0x9')](),controller[_0x3421('0xf')]);router[_0x3421('0x10')](_0x3421('0xc'),auth[_0x3421('0x9')](),controller[_0x3421('0x11')]);module[_0x3421('0x12')]=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','update','delete','destroy','exports','multer'];(function(_0x3e7065,_0x532559){var _0x26f57b=function(_0xeaac98){while(--_0xeaac98){_0x3e7065['push'](_0x3e7065['shift']());}};_0x26f57b(++_0x532559);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x5a08de,_0x1e713b){_0x5a08de=_0x5a08de-0x0;var _0x1374a5=_0x9ffd[_0x5a08de];return _0x1374a5;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var auth=require(_0xd9ff('0x5'));var interaction=require(_0xd9ff('0x6'));var config=require('../../config/environment');var controller=require(_0xd9ff('0x7'));router[_0xd9ff('0x8')]('/',auth['isAuthenticated'](),controller[_0xd9ff('0x9')]);router[_0xd9ff('0x8')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xc')]);router[_0xd9ff('0x8')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 2d54f71..163ee4a 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 _0x3960=['NOW','sequelize','exports','STRING','queue'];(function(_0x2aea9e,_0x1f587f){var _0x430b92=function(_0x416c37){while(--_0x416c37){_0x2aea9e['push'](_0x2aea9e['shift']());}};_0x430b92(++_0x1f587f);}(_0x3960,0x1eb));var _0x0396=function(_0xe2853d,_0x30bb16){_0xe2853d=_0xe2853d-0x0;var _0x33f750=_0x3960[_0xe2853d];return _0x33f750;};'use strict';var moment=require('moment');var Sequelize=require(_0x0396('0x0'));module[_0x0396('0x1')]={'uniqueid':{'type':Sequelize[_0x0396('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account','agent','queue'),'allowNull':![],'defaultValue':_0x0396('0x3')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x0396('0x4')]}}; \ No newline at end of file +var _0x4e85=['moment','ENUM','account','queue','DATE','NOW'];(function(_0x3a02c6,_0x31db94){var _0x378ad3=function(_0x1f8fda){while(--_0x1f8fda){_0x3a02c6['push'](_0x3a02c6['shift']());}};_0x378ad3(++_0x31db94);}(_0x4e85,0x132));var _0x54e8=function(_0xea17da,_0x1e36b7){_0xea17da=_0xea17da-0x0;var _0x5e8cc7=_0x4e85[_0xea17da];return _0x5e8cc7;};'use strict';var moment=require(_0x54e8('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x54e8('0x1')](_0x54e8('0x2'),'agent',_0x54e8('0x3')),'allowNull':![],'defaultValue':_0x54e8('0x3')},'transferredAt':{'type':Sequelize[_0x54e8('0x4')],'allowNull':![],'defaultValue':Sequelize[_0x54e8('0x5')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 43efc21..d1dc71c 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 _0x64b2=['options','includeAll','include','rows','catch','show','length','merge','create','body','find','params','describe','html-pdf','rimraf','fast-json-patch','request-promise','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','intersection','attributes','fields','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL'];(function(_0x590ce2,_0x1c1c71){var _0x3f26b8=function(_0x2c5aa8){while(--_0x2c5aa8){_0x590ce2['push'](_0x590ce2['shift']());}};_0x3f26b8(++_0x1c1c71);}(_0x64b2,0x121));var _0x264b=function(_0x2f1762,_0xab43df){_0x2f1762=_0x2f1762-0x0;var _0x8ab21=_0x64b2[_0x2f1762];return _0x8ab21;};'use strict';var pdf=require(_0x264b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x264b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x264b('0x2'));var rp=require(_0x264b('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x264b('0x4'));var csv=require(_0x264b('0x5'));var ejs=require(_0x264b('0x6'));var fs=require('fs');var _=require(_0x264b('0x7'));var squel=require(_0x264b('0x8'));var crypto=require('crypto');var jsforce=require(_0x264b('0x9'));var deskjs=require(_0x264b('0xa'));var toCsv=require(_0x264b('0x5'));var querystring=require(_0x264b('0xb'));var Papa=require('papaparse');var Redis=require(_0x264b('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x264b('0xd'));var as=require(_0x264b('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x264b('0xf'));var config=require(_0x264b('0x10'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3149b6,_0x412a08){_0x412a08=_0x412a08||0xcc;return function(_0x53adf4){if(_0x53adf4){return _0x3149b6[_0x264b('0x11')](_0x412a08);}return _0x3149b6[_0x264b('0x12')](_0x412a08)['end']();};}function respondWithResult(_0x2dc763,_0x15b804){_0x15b804=_0x15b804||0xc8;return function(_0x441f23){if(_0x441f23){return _0x2dc763['status'](_0x15b804)[_0x264b('0x13')](_0x441f23);}};}function respondWithFilteredResult(_0xaa288f,_0x58567e){return function(_0x3e2b98){if(_0x3e2b98){var _0x4614c2=_0x3e2b98[_0x264b('0x14')],_0x560a20=_0x58567e[_0x264b('0x15')],_0x3ec751=_0x58567e[_0x264b('0x15')]+_0x58567e['limit'],_0x1c1f64;if(_0x3ec751>=_0x4614c2){_0x3ec751=_0x4614c2;_0x1c1f64=0xc8;}else{_0x1c1f64=0xce;}_0xaa288f[_0x264b('0x12')](_0x1c1f64);return _0xaa288f[_0x264b('0x16')](_0x264b('0x17'),_0x560a20+'-'+_0x3ec751+'/'+_0x4614c2)[_0x264b('0x13')](_0x3e2b98);}return null;};}function patchUpdates(_0x1ff085){return function(_0x598238){try{jsonpatch[_0x264b('0x18')](_0x598238,_0x1ff085,!![]);}catch(_0x5d3166){return BPromise[_0x264b('0x19')](_0x5d3166);}return _0x598238[_0x264b('0x1a')]();};}function saveUpdates(_0x22c0c0,_0x52123b){return function(_0x2e485f){if(_0x2e485f){return _0x2e485f[_0x264b('0x1b')](_0x22c0c0)[_0x264b('0x1c')](function(_0x159e3e){return _0x159e3e;});}return null;};}function removeEntity(_0x1dcc99,_0x476ffb){return function(_0x53fc5c){if(_0x53fc5c){return _0x53fc5c[_0x264b('0x1d')]()[_0x264b('0x1c')](function(){_0x1dcc99[_0x264b('0x12')](0xcc)[_0x264b('0x1e')]();});}};}function handleEntityNotFound(_0x5aad89,_0x79b4f7){return function(_0x382736){if(!_0x382736){_0x5aad89[_0x264b('0x11')](0x194);}return _0x382736;};}function handleError(_0x516018,_0x130ca1){_0x130ca1=_0x130ca1||0x1f4;return function(_0x46f119){logger[_0x264b('0x1f')](_0x46f119[_0x264b('0x20')]);if(_0x46f119[_0x264b('0x21')]){delete _0x46f119['name'];}_0x516018['status'](_0x130ca1)[_0x264b('0x22')](_0x46f119);};}exports[_0x264b('0x23')]=function(_0x387338,_0x14d04b){var _0x16fec5={},_0x5803bf={},_0x1d6018={'count':0x0,'rows':[]};var _0x22ac38=_[_0x264b('0x24')](db[_0x264b('0x25')][_0x264b('0x26')],function(_0x190c3f){return{'name':_0x190c3f[_0x264b('0x27')],'type':_0x190c3f[_0x264b('0x28')]['key']};});_0x5803bf[_0x264b('0x29')]=_['map'](_0x22ac38,_0x264b('0x21'));_0x5803bf[_0x264b('0x2a')]=_[_0x264b('0x2b')](_0x387338[_0x264b('0x2a')]);_0x5803bf['filters']=_[_0x264b('0x2c')](_0x5803bf[_0x264b('0x29')],_0x5803bf['query']);_0x16fec5[_0x264b('0x2d')]=_['intersection'](_0x5803bf[_0x264b('0x29')],qs[_0x264b('0x2e')](_0x387338[_0x264b('0x2a')][_0x264b('0x2e')]));_0x16fec5['attributes']=_0x16fec5[_0x264b('0x2d')]['length']?_0x16fec5['attributes']:_0x5803bf['model'];if(!_0x387338[_0x264b('0x2a')]['hasOwnProperty'](_0x264b('0x2f'))){_0x16fec5[_0x264b('0x30')]=qs[_0x264b('0x30')](_0x387338['query'][_0x264b('0x30')]);_0x16fec5[_0x264b('0x15')]=qs[_0x264b('0x15')](_0x387338[_0x264b('0x2a')][_0x264b('0x15')]);}_0x16fec5[_0x264b('0x31')]=qs['sort'](_0x387338[_0x264b('0x2a')][_0x264b('0x32')]);_0x16fec5[_0x264b('0x33')]=qs[_0x264b('0x34')](_[_0x264b('0x35')](_0x387338['query'],_0x5803bf[_0x264b('0x34')]));if(_0x387338[_0x264b('0x2a')][_0x264b('0x36')]){_0x16fec5[_0x264b('0x33')]=_['merge'](_0x16fec5['where'],{'$or':_[_0x264b('0x24')](_0x22ac38,function(_0x21a26a){if(_0x21a26a[_0x264b('0x28')]!==_0x264b('0x37')){var _0x398289={};_0x398289[_0x21a26a[_0x264b('0x21')]]={'$like':'%'+_0x387338[_0x264b('0x2a')][_0x264b('0x36')]+'%'};return _0x398289;}})});}_0x16fec5=_['merge']({},_0x16fec5,_0x387338[_0x264b('0x38')]);var _0x5dc68f={'where':_0x16fec5[_0x264b('0x33')]};return db['SmsTransferReport'][_0x264b('0x14')](_0x5dc68f)[_0x264b('0x1c')](function(_0xa0fbaa){_0x1d6018[_0x264b('0x14')]=_0xa0fbaa;if(_0x387338['query'][_0x264b('0x39')]){_0x16fec5[_0x264b('0x3a')]=[{'all':!![]}];}return db[_0x264b('0x25')]['findAll'](_0x16fec5);})[_0x264b('0x1c')](function(_0x2811bc){_0x1d6018[_0x264b('0x3b')]=_0x2811bc;return _0x1d6018;})['then'](respondWithFilteredResult(_0x14d04b,_0x16fec5))[_0x264b('0x3c')](handleError(_0x14d04b,null));};exports[_0x264b('0x3d')]=function(_0x3bde51,_0x5d1979){var _0x1deb09={'raw':!![],'where':{'id':_0x3bde51['params']['id']}},_0x1657d9={};_0x1657d9['model']=_['keys'](db[_0x264b('0x25')][_0x264b('0x26')]);_0x1657d9[_0x264b('0x2a')]=_['keys'](_0x3bde51[_0x264b('0x2a')]);_0x1657d9['filters']=_[_0x264b('0x2c')](_0x1657d9[_0x264b('0x29')],_0x1657d9[_0x264b('0x2a')]);_0x1deb09['attributes']=_['intersection'](_0x1657d9['model'],qs[_0x264b('0x2e')](_0x3bde51[_0x264b('0x2a')]['fields']));_0x1deb09[_0x264b('0x2d')]=_0x1deb09[_0x264b('0x2d')][_0x264b('0x3e')]?_0x1deb09[_0x264b('0x2d')]:_0x1657d9[_0x264b('0x29')];if(_0x3bde51[_0x264b('0x2a')][_0x264b('0x39')]){_0x1deb09['include']=[{'all':!![]}];}_0x1deb09=_[_0x264b('0x3f')]({},_0x1deb09,_0x3bde51[_0x264b('0x38')]);return db[_0x264b('0x25')]['find'](_0x1deb09)[_0x264b('0x1c')](handleEntityNotFound(_0x5d1979,null))[_0x264b('0x1c')](respondWithResult(_0x5d1979,null))[_0x264b('0x3c')](handleError(_0x5d1979,null));};exports[_0x264b('0x40')]=function(_0x2923f0,_0x5f4ad3){return db['SmsTransferReport'][_0x264b('0x40')](_0x2923f0[_0x264b('0x41')],{})[_0x264b('0x1c')](respondWithResult(_0x5f4ad3,0xc9))[_0x264b('0x3c')](handleError(_0x5f4ad3,null));};exports[_0x264b('0x1b')]=function(_0x2e9e72,_0x2b7ac9){if(_0x2e9e72[_0x264b('0x41')]['id']){delete _0x2e9e72[_0x264b('0x41')]['id'];}return db['SmsTransferReport'][_0x264b('0x42')]({'where':{'id':_0x2e9e72[_0x264b('0x43')]['id']}})[_0x264b('0x1c')](handleEntityNotFound(_0x2b7ac9,null))[_0x264b('0x1c')](saveUpdates(_0x2e9e72[_0x264b('0x41')],null))[_0x264b('0x1c')](respondWithResult(_0x2b7ac9,null))[_0x264b('0x3c')](handleError(_0x2b7ac9,null));};exports[_0x264b('0x1d')]=function(_0x882fff,_0x5b1685){return db[_0x264b('0x25')][_0x264b('0x42')]({'where':{'id':_0x882fff[_0x264b('0x43')]['id']}})[_0x264b('0x1c')](handleEntityNotFound(_0x5b1685,null))[_0x264b('0x1c')](removeEntity(_0x5b1685,null))[_0x264b('0x3c')](handleError(_0x5b1685,null));};exports['describe']=function(_0x3bd16c,_0x531e7f){return db[_0x264b('0x25')][_0x264b('0x44')]()[_0x264b('0x1c')](respondWithResult(_0x531e7f,null))[_0x264b('0x3c')](handleError(_0x531e7f,null));}; \ No newline at end of file +var _0xd2df=['reject','save','update','then','destroy','end','name','send','map','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','findAll','rows','catch','show','params','keys','includeAll','include','options','SmsTransferReport','find','create','body','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply'];(function(_0x5ea2bb,_0x2fcfd2){var _0x340abd=function(_0x1e2888){while(--_0x1e2888){_0x5ea2bb['push'](_0x5ea2bb['shift']());}};_0x340abd(++_0x2fcfd2);}(_0xd2df,0x71));var _0xfd2d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd2df[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfd2d('0x0'));var rimraf=require(_0xfd2d('0x1'));var zipdir=require(_0xfd2d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xfd2d('0x3'));var BPromise=require(_0xfd2d('0x4'));var Mustache=require('mustache');var util=require(_0xfd2d('0x5'));var path=require(_0xfd2d('0x6'));var sox=require(_0xfd2d('0x7'));var csv=require(_0xfd2d('0x8'));var ejs=require(_0xfd2d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfd2d('0xa'));var crypto=require(_0xfd2d('0xb'));var jsforce=require(_0xfd2d('0xc'));var deskjs=require(_0xfd2d('0xd'));var toCsv=require(_0xfd2d('0x8'));var querystring=require(_0xfd2d('0xe'));var Papa=require(_0xfd2d('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfd2d('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfd2d('0x11'));var logger=require(_0xfd2d('0x12'))(_0xfd2d('0x13'));var utils=require(_0xfd2d('0x14'));var config=require('../../config/environment');var db=require(_0xfd2d('0x15'))['db'];function respondWithStatusCode(_0x45719c,_0x284bff){_0x284bff=_0x284bff||0xcc;return function(_0x589ee6){if(_0x589ee6){return _0x45719c[_0xfd2d('0x16')](_0x284bff);}return _0x45719c[_0xfd2d('0x17')](_0x284bff)['end']();};}function respondWithResult(_0x577cbb,_0x1681c7){_0x1681c7=_0x1681c7||0xc8;return function(_0x4e9009){if(_0x4e9009){return _0x577cbb[_0xfd2d('0x17')](_0x1681c7)[_0xfd2d('0x18')](_0x4e9009);}};}function respondWithFilteredResult(_0x3f350b,_0xf4b5e4){return function(_0x825ba1){if(_0x825ba1){var _0x463387=_0x825ba1[_0xfd2d('0x19')],_0x132bcb=_0xf4b5e4[_0xfd2d('0x1a')],_0x38eb4c=_0xf4b5e4[_0xfd2d('0x1a')]+_0xf4b5e4[_0xfd2d('0x1b')],_0x5ac835;if(_0x38eb4c>=_0x463387){_0x38eb4c=_0x463387;_0x5ac835=0xc8;}else{_0x5ac835=0xce;}_0x3f350b['status'](_0x5ac835);return _0x3f350b[_0xfd2d('0x1c')](_0xfd2d('0x1d'),_0x132bcb+'-'+_0x38eb4c+'/'+_0x463387)[_0xfd2d('0x18')](_0x825ba1);}return null;};}function patchUpdates(_0x5a3bf6){return function(_0x3c192e){try{jsonpatch[_0xfd2d('0x1e')](_0x3c192e,_0x5a3bf6,!![]);}catch(_0x4e9962){return BPromise[_0xfd2d('0x1f')](_0x4e9962);}return _0x3c192e[_0xfd2d('0x20')]();};}function saveUpdates(_0x2ea902,_0x15d2c8){return function(_0x435a6a){if(_0x435a6a){return _0x435a6a[_0xfd2d('0x21')](_0x2ea902)[_0xfd2d('0x22')](function(_0x5de217){return _0x5de217;});}return null;};}function removeEntity(_0x3a57a8,_0x2b7021){return function(_0x51ed43){if(_0x51ed43){return _0x51ed43[_0xfd2d('0x23')]()[_0xfd2d('0x22')](function(){_0x3a57a8[_0xfd2d('0x17')](0xcc)[_0xfd2d('0x24')]();});}};}function handleEntityNotFound(_0x39d6d2,_0x17bdaa){return function(_0x29609b){if(!_0x29609b){_0x39d6d2[_0xfd2d('0x16')](0x194);}return _0x29609b;};}function handleError(_0x43d0d3,_0x1210c3){_0x1210c3=_0x1210c3||0x1f4;return function(_0x321f3d){logger['error'](_0x321f3d['stack']);if(_0x321f3d[_0xfd2d('0x25')]){delete _0x321f3d[_0xfd2d('0x25')];}_0x43d0d3['status'](_0x1210c3)[_0xfd2d('0x26')](_0x321f3d);};}exports['index']=function(_0x2ea354,_0x3dedb4){var _0x44ae19={},_0x7cd2c0={},_0x2b0270={'count':0x0,'rows':[]};var _0xef7278=_[_0xfd2d('0x27')](db['SmsTransferReport'][_0xfd2d('0x28')],function(_0x472c3d){return{'name':_0x472c3d[_0xfd2d('0x29')],'type':_0x472c3d['type'][_0xfd2d('0x2a')]};});_0x7cd2c0[_0xfd2d('0x2b')]=_[_0xfd2d('0x27')](_0xef7278,_0xfd2d('0x25'));_0x7cd2c0[_0xfd2d('0x2c')]=_['keys'](_0x2ea354[_0xfd2d('0x2c')]);_0x7cd2c0[_0xfd2d('0x2d')]=_[_0xfd2d('0x2e')](_0x7cd2c0[_0xfd2d('0x2b')],_0x7cd2c0[_0xfd2d('0x2c')]);_0x44ae19[_0xfd2d('0x2f')]=_[_0xfd2d('0x2e')](_0x7cd2c0['model'],qs[_0xfd2d('0x30')](_0x2ea354[_0xfd2d('0x2c')][_0xfd2d('0x30')]));_0x44ae19[_0xfd2d('0x2f')]=_0x44ae19['attributes'][_0xfd2d('0x31')]?_0x44ae19[_0xfd2d('0x2f')]:_0x7cd2c0[_0xfd2d('0x2b')];if(!_0x2ea354[_0xfd2d('0x2c')][_0xfd2d('0x32')](_0xfd2d('0x33'))){_0x44ae19[_0xfd2d('0x1b')]=qs[_0xfd2d('0x1b')](_0x2ea354['query'][_0xfd2d('0x1b')]);_0x44ae19['offset']=qs[_0xfd2d('0x1a')](_0x2ea354[_0xfd2d('0x2c')][_0xfd2d('0x1a')]);}_0x44ae19[_0xfd2d('0x34')]=qs[_0xfd2d('0x35')](_0x2ea354[_0xfd2d('0x2c')][_0xfd2d('0x35')]);_0x44ae19[_0xfd2d('0x36')]=qs['filters'](_[_0xfd2d('0x37')](_0x2ea354[_0xfd2d('0x2c')],_0x7cd2c0[_0xfd2d('0x2d')]));if(_0x2ea354['query'][_0xfd2d('0x38')]){_0x44ae19['where']=_[_0xfd2d('0x39')](_0x44ae19[_0xfd2d('0x36')],{'$or':_[_0xfd2d('0x27')](_0xef7278,function(_0x216e65){if(_0x216e65['type']!==_0xfd2d('0x3a')){var _0x29ac6a={};_0x29ac6a[_0x216e65[_0xfd2d('0x25')]]={'$like':'%'+_0x2ea354['query']['filter']+'%'};return _0x29ac6a;}})});}_0x44ae19=_[_0xfd2d('0x39')]({},_0x44ae19,_0x2ea354['options']);var _0x5e0bc8={'where':_0x44ae19[_0xfd2d('0x36')]};return db['SmsTransferReport'][_0xfd2d('0x19')](_0x5e0bc8)[_0xfd2d('0x22')](function(_0x28ae3d){_0x2b0270[_0xfd2d('0x19')]=_0x28ae3d;if(_0x2ea354['query']['includeAll']){_0x44ae19['include']=[{'all':!![]}];}return db['SmsTransferReport'][_0xfd2d('0x3b')](_0x44ae19);})[_0xfd2d('0x22')](function(_0x33171b){_0x2b0270[_0xfd2d('0x3c')]=_0x33171b;return _0x2b0270;})[_0xfd2d('0x22')](respondWithFilteredResult(_0x3dedb4,_0x44ae19))[_0xfd2d('0x3d')](handleError(_0x3dedb4,null));};exports[_0xfd2d('0x3e')]=function(_0x5e1d5b,_0x3e9126){var _0x500458={'raw':!![],'where':{'id':_0x5e1d5b[_0xfd2d('0x3f')]['id']}},_0x51b4a9={};_0x51b4a9[_0xfd2d('0x2b')]=_[_0xfd2d('0x40')](db['SmsTransferReport'][_0xfd2d('0x28')]);_0x51b4a9[_0xfd2d('0x2c')]=_[_0xfd2d('0x40')](_0x5e1d5b['query']);_0x51b4a9[_0xfd2d('0x2d')]=_[_0xfd2d('0x2e')](_0x51b4a9[_0xfd2d('0x2b')],_0x51b4a9[_0xfd2d('0x2c')]);_0x500458[_0xfd2d('0x2f')]=_['intersection'](_0x51b4a9['model'],qs[_0xfd2d('0x30')](_0x5e1d5b[_0xfd2d('0x2c')][_0xfd2d('0x30')]));_0x500458['attributes']=_0x500458[_0xfd2d('0x2f')][_0xfd2d('0x31')]?_0x500458['attributes']:_0x51b4a9[_0xfd2d('0x2b')];if(_0x5e1d5b[_0xfd2d('0x2c')][_0xfd2d('0x41')]){_0x500458[_0xfd2d('0x42')]=[{'all':!![]}];}_0x500458=_[_0xfd2d('0x39')]({},_0x500458,_0x5e1d5b[_0xfd2d('0x43')]);return db[_0xfd2d('0x44')][_0xfd2d('0x45')](_0x500458)[_0xfd2d('0x22')](handleEntityNotFound(_0x3e9126,null))[_0xfd2d('0x22')](respondWithResult(_0x3e9126,null))[_0xfd2d('0x3d')](handleError(_0x3e9126,null));};exports[_0xfd2d('0x46')]=function(_0x1dbfaa,_0x40e982){return db['SmsTransferReport']['create'](_0x1dbfaa['body'],{})[_0xfd2d('0x22')](respondWithResult(_0x40e982,0xc9))[_0xfd2d('0x3d')](handleError(_0x40e982,null));};exports[_0xfd2d('0x21')]=function(_0x7bbc3d,_0x37dc1f){if(_0x7bbc3d[_0xfd2d('0x47')]['id']){delete _0x7bbc3d[_0xfd2d('0x47')]['id'];}return db[_0xfd2d('0x44')][_0xfd2d('0x45')]({'where':{'id':_0x7bbc3d[_0xfd2d('0x3f')]['id']}})['then'](handleEntityNotFound(_0x37dc1f,null))['then'](saveUpdates(_0x7bbc3d[_0xfd2d('0x47')],null))[_0xfd2d('0x22')](respondWithResult(_0x37dc1f,null))[_0xfd2d('0x3d')](handleError(_0x37dc1f,null));};exports[_0xfd2d('0x23')]=function(_0x572410,_0x4b04c8){return db['SmsTransferReport']['find']({'where':{'id':_0x572410[_0xfd2d('0x3f')]['id']}})[_0xfd2d('0x22')](handleEntityNotFound(_0x4b04c8,null))[_0xfd2d('0x22')](removeEntity(_0x4b04c8,null))[_0xfd2d('0x3d')](handleError(_0x4b04c8,null));};exports['describe']=function(_0x55574b,_0x521c1f){return db['SmsTransferReport']['describe']()['then'](respondWithResult(_0x521c1f,null))[_0xfd2d('0x3d')](handleError(_0x521c1f,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 58bd38e..97ad98b 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 _0x53ec=['path','../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x12f9f3,_0x3e45c9){var _0x13ea68=function(_0x245ec1){while(--_0x245ec1){_0x12f9f3['push'](_0x12f9f3['shift']());}};_0x13ea68(++_0x3e45c9);}(_0x53ec,0x192));var _0xc53e=function(_0x592cbc,_0x5ec030){_0x592cbc=_0x592cbc-0x0;var _0x39b8d9=_0x53ec[_0x592cbc];return _0x39b8d9;};'use strict';var _=require(_0xc53e('0x0'));var util=require(_0xc53e('0x1'));var logger=require(_0xc53e('0x2'))(_0xc53e('0x3'));var moment=require(_0xc53e('0x4'));var BPromise=require(_0xc53e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc53e('0x6'));var rimraf=require('rimraf');var config=require(_0xc53e('0x7'));var attributes=require(_0xc53e('0x8'));module['exports']=function(_0x2f1414,_0x4f989b){return _0x2f1414[_0xc53e('0x9')](_0xc53e('0xa'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xc53e('0xb'),'fields':[_0xc53e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x687b=['./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x545332,_0x1d114c){var _0x3d0d3f=function(_0x584d85){while(--_0x584d85){_0x545332['push'](_0x545332['shift']());}};_0x3d0d3f(++_0x1d114c);}(_0x687b,0x14a));var _0xb687=function(_0x41273c,_0x4c0c04){_0x41273c=_0x41273c-0x0;var _0x453ce4=_0x687b[_0x41273c];return _0x453ce4;};'use strict';var _=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var logger=require(_0xb687('0x2'))(_0xb687('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb687('0x4'));var fs=require('fs');var path=require(_0xb687('0x5'));var rimraf=require(_0xb687('0x6'));var config=require(_0xb687('0x7'));var attributes=require(_0xb687('0x8'));module[_0xb687('0x9')]=function(_0x16ccf3,_0xf43a1f){return _0x16ccf3[_0xb687('0xa')](_0xb687('0xb'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0xb687('0xc'),'fields':[_0xb687('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index d50e83b..4523db2 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 _0x39e8=['bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','SmsTransferReport,\x20%s,\x20%s','request\x20sent','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','util'];(function(_0x11e552,_0x105165){var _0x3772ee=function(_0x2dd8e5){while(--_0x2dd8e5){_0x11e552['push'](_0x11e552['shift']());}};_0x3772ee(++_0x105165);}(_0x39e8,0x1cc));var _0x839e=function(_0xcfdd16,_0x13b247){_0xcfdd16=_0xcfdd16-0x0;var _0x10610e=_0x39e8[_0xcfdd16];return _0x10610e;};'use strict';var _=require(_0x839e('0x0'));var util=require(_0x839e('0x1'));var moment=require('moment');var BPromise=require(_0x839e('0x2'));var rs=require(_0x839e('0x3'));var fs=require('fs');var Redis=require(_0x839e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x839e('0x5'));var logger=require(_0x839e('0x6'))(_0x839e('0x7'));var config=require(_0x839e('0x8'));var jayson=require(_0x839e('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5461a9,_0x28fba7,_0x449488){return new BPromise(function(_0x480d19,_0x378978){return client[_0x839e('0xa')](_0x5461a9,_0x449488)[_0x839e('0xb')](function(_0x19c6af){logger['info'](_0x839e('0xc'),_0x28fba7,_0x839e('0xd'));logger['debug'](_0x839e('0xe'),_0x28fba7,'request\x20sent',JSON[_0x839e('0xf')](_0x19c6af));if(_0x19c6af['error']){if(_0x19c6af[_0x839e('0x10')]['code']===0x1f4){logger[_0x839e('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x28fba7,_0x19c6af[_0x839e('0x10')][_0x839e('0x11')]);return _0x378978(_0x19c6af[_0x839e('0x10')]['message']);}logger['error'](_0x839e('0xc'),_0x28fba7,_0x19c6af[_0x839e('0x10')][_0x839e('0x11')]);return _0x480d19(_0x19c6af[_0x839e('0x10')][_0x839e('0x11')]);}else{logger[_0x839e('0x12')](_0x839e('0xc'),_0x28fba7,'request\x20sent');_0x480d19(_0x19c6af[_0x839e('0x13')]['message']);}})[_0x839e('0x14')](function(_0x17bff0){logger[_0x839e('0x10')]('SmsTransferReport,\x20%s,\x20%s',_0x28fba7,_0x17bff0);_0x378978(_0x17bff0);});});} \ No newline at end of file +var _0x9624=['../../mysqldb','../../config/environment','client','http','info','request\x20sent','debug','stringify','error','code','message','SmsTransferReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1a2855,_0x174e42){var _0x3b4e37=function(_0x4e4496){while(--_0x4e4496){_0x1a2855['push'](_0x1a2855['shift']());}};_0x3b4e37(++_0x174e42);}(_0x9624,0x80));var _0x4962=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9624[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4962('0x0'));var moment=require(_0x4962('0x1'));var BPromise=require(_0x4962('0x2'));var rs=require(_0x4962('0x3'));var fs=require('fs');var Redis=require(_0x4962('0x4'));var db=require(_0x4962('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x4962('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x4962('0x7')][_0x4962('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4e8cda,_0x46bfd6,_0x307ef5){return new BPromise(function(_0x336d14,_0x50a01e){return client['request'](_0x4e8cda,_0x307ef5)['then'](function(_0x5cbd15){logger[_0x4962('0x9')]('SmsTransferReport,\x20%s,\x20%s',_0x46bfd6,_0x4962('0xa'));logger[_0x4962('0xb')]('SmsTransferReport,\x20%s,\x20%s,\x20%s',_0x46bfd6,_0x4962('0xa'),JSON[_0x4962('0xc')](_0x5cbd15));if(_0x5cbd15[_0x4962('0xd')]){if(_0x5cbd15[_0x4962('0xd')][_0x4962('0xe')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x46bfd6,_0x5cbd15[_0x4962('0xd')][_0x4962('0xf')]);return _0x50a01e(_0x5cbd15[_0x4962('0xd')]['message']);}logger['error'](_0x4962('0x10'),_0x46bfd6,_0x5cbd15[_0x4962('0xd')][_0x4962('0xf')]);return _0x336d14(_0x5cbd15[_0x4962('0xd')][_0x4962('0xf')]);}else{logger[_0x4962('0x9')](_0x4962('0x10'),_0x46bfd6,_0x4962('0xa'));_0x336d14(_0x5cbd15[_0x4962('0x11')][_0x4962('0xf')]);}})[_0x4962('0x12')](function(_0x43629e){logger[_0x4962('0xd')](_0x4962('0x10'),_0x46bfd6,_0x43629e);_0x50a01e(_0x43629e);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 7bc1100..b738fba 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 _0xcaf5=['%s-%s%s','basename','extname','originalname','post','single','file','put','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','diskStorage','server/files/sounds/original/','replace','format'];(function(_0x408d5e,_0x27e654){var _0x577cf7=function(_0x308ed6){while(--_0x308ed6){_0x408d5e['push'](_0x408d5e['shift']());}};_0x577cf7(++_0x27e654);}(_0xcaf5,0xbf));var _0x5caf=function(_0x12040e,_0x151281){_0x12040e=_0x12040e-0x0;var _0x391847=_0xcaf5[_0x12040e];return _0x391847;};'use strict';var multer=require('multer');var util=require(_0x5caf('0x0'));var path=require(_0x5caf('0x1'));var timeout=require(_0x5caf('0x2'));var express=require(_0x5caf('0x3'));var router=express[_0x5caf('0x4')]();var auth=require(_0x5caf('0x5'));var interaction=require(_0x5caf('0x6'));var config=require(_0x5caf('0x7'));var controller=require('./sound.controller');router[_0x5caf('0x8')]('/',auth[_0x5caf('0x9')](),controller[_0x5caf('0xa')]);router['get'](_0x5caf('0xb'),auth['isAuthenticated'](),controller[_0x5caf('0xc')]);router[_0x5caf('0x8')](_0x5caf('0xd'),auth[_0x5caf('0x9')](),controller[_0x5caf('0xe')]);var upload=multer({'storage':multer[_0x5caf('0xf')]({'destination':function(_0x3816b6,_0x22fcd6,_0x132320){_0x132320(null,path['join'](config['root'],_0x5caf('0x10')));},'filename':function(_0x4ca2ee,_0x3136d8,_0x47b023){_0x3136d8['originalname']=_0x3136d8['originalname'][_0x5caf('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x47b023(null,util[_0x5caf('0x12')](_0x5caf('0x13'),path[_0x5caf('0x14')](_0x3136d8['originalname'],path[_0x5caf('0x15')](_0x3136d8[_0x5caf('0x16')])),Date['now'](),path['extname'](_0x3136d8['originalname'])));}})});router[_0x5caf('0x17')]('/',upload[_0x5caf('0x18')](_0x5caf('0x19')),controller['create']);router[_0x5caf('0x1a')](_0x5caf('0xb'),auth[_0x5caf('0x9')](),controller[_0x5caf('0x1b')]);router[_0x5caf('0x1c')]('/:id',auth[_0x5caf('0x9')](),controller['delete']);module[_0x5caf('0x1d')]=router; \ No newline at end of file +var _0x8171=['multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','/:id','show','download','server/files/sounds/original/','replace','format','%s-%s%s','basename','originalname','extname','now','post','single','put','update','delete','exports'];(function(_0x519659,_0x1ecc2a){var _0x442796=function(_0x1f208c){while(--_0x1f208c){_0x519659['push'](_0x519659['shift']());}};_0x442796(++_0x1ecc2a);}(_0x8171,0xe0));var _0x1817=function(_0x333d0f,_0x1db770){_0x333d0f=_0x333d0f-0x0;var _0x3b098e=_0x8171[_0x333d0f];return _0x3b098e;};'use strict';var multer=require(_0x1817('0x0'));var util=require(_0x1817('0x1'));var path=require(_0x1817('0x2'));var timeout=require('connect-timeout');var express=require(_0x1817('0x3'));var router=express[_0x1817('0x4')]();var auth=require(_0x1817('0x5'));var interaction=require(_0x1817('0x6'));var config=require(_0x1817('0x7'));var controller=require(_0x1817('0x8'));router[_0x1817('0x9')]('/',auth[_0x1817('0xa')](),controller['index']);router[_0x1817('0x9')](_0x1817('0xb'),auth['isAuthenticated'](),controller[_0x1817('0xc')]);router[_0x1817('0x9')]('/:id/download',auth[_0x1817('0xa')](),controller[_0x1817('0xd')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x16cf2c,_0x195f77,_0x13156e){_0x13156e(null,path['join'](config['root'],_0x1817('0xe')));},'filename':function(_0x1cc69b,_0xef9e4d,_0x1dc338){_0xef9e4d['originalname']=_0xef9e4d['originalname'][_0x1817('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1dc338(null,util[_0x1817('0x10')](_0x1817('0x11'),path[_0x1817('0x12')](_0xef9e4d[_0x1817('0x13')],path[_0x1817('0x14')](_0xef9e4d[_0x1817('0x13')])),Date[_0x1817('0x15')](),path[_0x1817('0x14')](_0xef9e4d[_0x1817('0x13')])));}})});router[_0x1817('0x16')]('/',upload[_0x1817('0x17')]('file'),controller['create']);router[_0x1817('0x18')](_0x1817('0xb'),auth[_0x1817('0xa')](),controller[_0x1817('0x19')]);router[_0x1817('0x1a')]('/:id',auth[_0x1817('0xa')](),controller[_0x1817('0x1a')]);module[_0x1817('0x1b')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index bb4b001..43be97e 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 _0x8b13=['STRING','name','FLOAT','BIGINT','INTEGER','sequelize','exports'];(function(_0x52aeae,_0x191002){var _0x414005=function(_0x18e6c5){while(--_0x18e6c5){_0x52aeae['push'](_0x52aeae['shift']());}};_0x414005(++_0x191002);}(_0x8b13,0x11d));var _0x38b1=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8b13[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x38b1('0x0'));module[_0x38b1('0x1')]={'name':{'type':Sequelize[_0x38b1('0x2')],'unique':_0x38b1('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0x38b1('0x2')]},'display_name':{'type':Sequelize[_0x38b1('0x2')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x38b1('0x2')]},'original_duration':{'type':Sequelize[_0x38b1('0x4')]},'original_sampleCount':{'type':Sequelize[_0x38b1('0x5')]},'original_channelCount':{'type':Sequelize[_0x38b1('0x6')]},'original_bitRate':{'type':Sequelize[_0x38b1('0x5')]},'original_sampleRate':{'type':Sequelize[_0x38b1('0x6')]},'converted_format':{'type':Sequelize[_0x38b1('0x2')]},'converted_duration':{'type':Sequelize['FLOAT']},'converted_sampleCount':{'type':Sequelize[_0x38b1('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x38b1('0x5')]},'converted_sampleRate':{'type':Sequelize[_0x38b1('0x6')]}}; \ No newline at end of file +var _0x968a=['exports','name','STRING','FLOAT','BIGINT','INTEGER','sequelize'];(function(_0x47f9a2,_0xc83faf){var _0x4c0fbc=function(_0x26050b){while(--_0x26050b){_0x47f9a2['push'](_0x47f9a2['shift']());}};_0x4c0fbc(++_0xc83faf);}(_0x968a,0x1e9));var _0xa968=function(_0x35cf58,_0x280717){_0x35cf58=_0x35cf58-0x0;var _0x3e8e65=_0x968a[_0x35cf58];return _0x3e8e65;};'use strict';var Sequelize=require(_0xa968('0x0'));module[_0xa968('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa968('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0xa968('0x3')]},'display_name':{'type':Sequelize[_0xa968('0x3')],'defaultValue':''},'description':{'type':Sequelize[_0xa968('0x3')]},'original_format':{'type':Sequelize['STRING']},'original_duration':{'type':Sequelize[_0xa968('0x4')]},'original_sampleCount':{'type':Sequelize[_0xa968('0x5')]},'original_channelCount':{'type':Sequelize[_0xa968('0x6')]},'original_bitRate':{'type':Sequelize[_0xa968('0x5')]},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xa968('0x3')]},'converted_duration':{'type':Sequelize[_0xa968('0x4')]},'converted_sampleCount':{'type':Sequelize['BIGINT']},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xa968('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 0e8c6a6..7a54e19 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 _0xfbfb=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','count','offset','set','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','Sound','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','find','params','save_name','converted_format','existsSync','join','root','Sequelize','ValidationError','download','server/files/sounds/converted','format','%s.%s','create','basename','file','originalname','filename','extname','substring','wav','server/files/sounds/original','info','chmodSync','transcode','unlinkSync','send','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_channelCount','converted_bitRate','end','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Sounds','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','description','delete','original_format','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x4ca43b,_0xa6e25b){var _0x545dcd=function(_0x4de21b){while(--_0x4de21b){_0x4ca43b['push'](_0x4ca43b['shift']());}};_0x545dcd(++_0xa6e25b);}(_0xfbfb,0x1c9));var _0xbfbf=function(_0x22d5a4,_0x3a1cc8){_0x22d5a4=_0x22d5a4-0x0;var _0x52b648=_0xfbfb[_0x22d5a4];return _0x52b648;};'use strict';var pdf=require(_0xbfbf('0x0'));var emlformat=require(_0xbfbf('0x1'));var rimraf=require(_0xbfbf('0x2'));var zipdir=require(_0xbfbf('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xbfbf('0x4'));var BPromise=require(_0xbfbf('0x5'));var Mustache=require('mustache');var util=require(_0xbfbf('0x6'));var path=require(_0xbfbf('0x7'));var sox=require('sox');var csv=require(_0xbfbf('0x8'));var ejs=require(_0xbfbf('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xbfbf('0xa'));var jsforce=require(_0xbfbf('0xb'));var deskjs=require(_0xbfbf('0xc'));var toCsv=require(_0xbfbf('0x8'));var querystring=require(_0xbfbf('0xd'));var Papa=require(_0xbfbf('0xe'));var Redis=require(_0xbfbf('0xf'));var authService=require(_0xbfbf('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xbfbf('0x11'));var hardwareService=require(_0xbfbf('0x12'));var logger=require('../../config/logger')(_0xbfbf('0x13'));var utils=require('../../config/utils');var config=require(_0xbfbf('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4da870,_0xc43e9){_0xc43e9=_0xc43e9||0xcc;return function(_0x10af80){if(_0x10af80){return _0x4da870[_0xbfbf('0x15')](_0xc43e9);}return _0x4da870[_0xbfbf('0x16')](_0xc43e9)['end']();};}function respondWithResult(_0x253d3a,_0x3f8a5f){_0x3f8a5f=_0x3f8a5f||0xc8;return function(_0x4d3f0d){if(_0x4d3f0d){return _0x253d3a[_0xbfbf('0x16')](_0x3f8a5f)[_0xbfbf('0x17')](_0x4d3f0d);}};}function respondWithFilteredResult(_0x1c0d7b,_0x437480){return function(_0x26fefe){if(_0x26fefe){var _0x5c62ac=_0x26fefe[_0xbfbf('0x18')],_0x2a44d6=_0x437480[_0xbfbf('0x19')],_0x25cba9=_0x437480[_0xbfbf('0x19')]+_0x437480['limit'],_0x3f2669;if(_0x25cba9>=_0x5c62ac){_0x25cba9=_0x5c62ac;_0x3f2669=0xc8;}else{_0x3f2669=0xce;}_0x1c0d7b[_0xbfbf('0x16')](_0x3f2669);return _0x1c0d7b[_0xbfbf('0x1a')]('Content-Range',_0x2a44d6+'-'+_0x25cba9+'/'+_0x5c62ac)[_0xbfbf('0x17')](_0x26fefe);}return null;};}function patchUpdates(_0x207852){return function(_0x125d40){try{jsonpatch['apply'](_0x125d40,_0x207852,!![]);}catch(_0x4d52f7){return BPromise['reject'](_0x4d52f7);}return _0x125d40[_0xbfbf('0x1b')]();};}function saveUpdates(_0x161564,_0xeb4f17){return function(_0x368770){if(_0x368770){return _0x368770[_0xbfbf('0x1c')](_0x161564)[_0xbfbf('0x1d')](function(_0x23ec94){return _0x23ec94;});}return null;};}function removeEntity(_0x38088b,_0x4521d4){return function(_0x49797f){if(_0x49797f){return _0x49797f[_0xbfbf('0x1e')]()['then'](function(){var _0x174447=_0x49797f[_0xbfbf('0x1f')]({'plain':!![]});var _0x560507='Sounds';return db[_0xbfbf('0x20')][_0xbfbf('0x1e')]({'where':{'type':_0x560507,'resourceId':_0x174447['id']}})[_0xbfbf('0x1d')](function(){return _0x49797f;});})[_0xbfbf('0x1d')](function(){_0x38088b[_0xbfbf('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4dcaf4,_0x59950c){return function(_0x2e5289){if(!_0x2e5289){_0x4dcaf4[_0xbfbf('0x15')](0x194);}return _0x2e5289;};}function handleError(_0xceaea2,_0x4d1113){_0x4d1113=_0x4d1113||0x1f4;return function(_0x46cd3){logger[_0xbfbf('0x21')](_0x46cd3[_0xbfbf('0x22')]);if(_0x46cd3[_0xbfbf('0x23')]){delete _0x46cd3[_0xbfbf('0x23')];}_0xceaea2['status'](_0x4d1113)['send'](_0x46cd3);};}exports[_0xbfbf('0x24')]=function(_0x5ed3f7,_0x431eff){var _0x1850d9={},_0x5adc18={},_0x1c790d={'count':0x0,'rows':[]};var _0x384079=_[_0xbfbf('0x25')](db[_0xbfbf('0x26')]['rawAttributes'],function(_0x123094){return{'name':_0x123094[_0xbfbf('0x27')],'type':_0x123094['type'][_0xbfbf('0x28')]};});_0x5adc18[_0xbfbf('0x29')]=_[_0xbfbf('0x25')](_0x384079,_0xbfbf('0x23'));_0x5adc18[_0xbfbf('0x2a')]=_[_0xbfbf('0x2b')](_0x5ed3f7[_0xbfbf('0x2a')]);_0x5adc18[_0xbfbf('0x2c')]=_[_0xbfbf('0x2d')](_0x5adc18[_0xbfbf('0x29')],_0x5adc18[_0xbfbf('0x2a')]);_0x1850d9['attributes']=_[_0xbfbf('0x2d')](_0x5adc18[_0xbfbf('0x29')],qs[_0xbfbf('0x2e')](_0x5ed3f7[_0xbfbf('0x2a')][_0xbfbf('0x2e')]));_0x1850d9[_0xbfbf('0x2f')]=_0x1850d9[_0xbfbf('0x2f')][_0xbfbf('0x30')]?_0x1850d9[_0xbfbf('0x2f')]:_0x5adc18[_0xbfbf('0x29')];if(!_0x5ed3f7[_0xbfbf('0x2a')][_0xbfbf('0x31')](_0xbfbf('0x32'))){_0x1850d9['limit']=qs['limit'](_0x5ed3f7[_0xbfbf('0x2a')]['limit']);_0x1850d9[_0xbfbf('0x19')]=qs['offset'](_0x5ed3f7[_0xbfbf('0x2a')][_0xbfbf('0x19')]);}_0x1850d9[_0xbfbf('0x33')]=qs[_0xbfbf('0x34')](_0x5ed3f7['query'][_0xbfbf('0x34')]);_0x1850d9[_0xbfbf('0x35')]=qs['filters'](_[_0xbfbf('0x36')](_0x5ed3f7[_0xbfbf('0x2a')],_0x5adc18['filters']));if(_0x5ed3f7[_0xbfbf('0x2a')]['filter']){_0x1850d9[_0xbfbf('0x35')]=_[_0xbfbf('0x37')](_0x1850d9[_0xbfbf('0x35')],{'$or':_['map'](_0x384079,function(_0x113862){if(_0x113862['type']!=='VIRTUAL'){var _0x2b04fe={};_0x2b04fe[_0x113862[_0xbfbf('0x23')]]={'$like':'%'+_0x5ed3f7[_0xbfbf('0x2a')][_0xbfbf('0x38')]+'%'};return _0x2b04fe;}})});}_0x1850d9=_[_0xbfbf('0x37')]({},_0x1850d9,_0x5ed3f7[_0xbfbf('0x39')]);var _0x505320={'where':_0x1850d9[_0xbfbf('0x35')]};return db[_0xbfbf('0x26')][_0xbfbf('0x18')](_0x505320)['then'](function(_0x25a33a){_0x1c790d['count']=_0x25a33a;if(_0x5ed3f7[_0xbfbf('0x2a')][_0xbfbf('0x3a')]){_0x1850d9[_0xbfbf('0x3b')]=[{'all':!![]}];}return db[_0xbfbf('0x26')][_0xbfbf('0x3c')](_0x1850d9);})[_0xbfbf('0x1d')](function(_0x293837){_0x1c790d[_0xbfbf('0x3d')]=_0x293837;return _0x1c790d;})[_0xbfbf('0x1d')](respondWithFilteredResult(_0x431eff,_0x1850d9))[_0xbfbf('0x3e')](handleError(_0x431eff,null));};exports[_0xbfbf('0x3f')]=function(_0x982f3e,_0x3360e4){var _0x19907c={'raw':!![],'where':{'id':_0x982f3e['params']['id']}},_0x1b0bfd={};_0x1b0bfd[_0xbfbf('0x29')]=_['keys'](db[_0xbfbf('0x26')]['rawAttributes']);_0x1b0bfd['query']=_[_0xbfbf('0x2b')](_0x982f3e[_0xbfbf('0x2a')]);_0x1b0bfd[_0xbfbf('0x2c')]=_['intersection'](_0x1b0bfd[_0xbfbf('0x29')],_0x1b0bfd[_0xbfbf('0x2a')]);_0x19907c[_0xbfbf('0x2f')]=_['intersection'](_0x1b0bfd[_0xbfbf('0x29')],qs[_0xbfbf('0x2e')](_0x982f3e['query'][_0xbfbf('0x2e')]));_0x19907c['attributes']=_0x19907c[_0xbfbf('0x2f')][_0xbfbf('0x30')]?_0x19907c[_0xbfbf('0x2f')]:_0x1b0bfd['model'];if(_0x982f3e[_0xbfbf('0x2a')][_0xbfbf('0x3a')]){_0x19907c[_0xbfbf('0x3b')]=[{'all':!![]}];}_0x19907c=_[_0xbfbf('0x37')]({},_0x19907c,_0x982f3e[_0xbfbf('0x39')]);return db[_0xbfbf('0x26')][_0xbfbf('0x40')](_0x19907c)[_0xbfbf('0x1d')](handleEntityNotFound(_0x3360e4,null))['then'](respondWithResult(_0x3360e4,null))[_0xbfbf('0x3e')](handleError(_0x3360e4,null));};exports['download']=function(_0xe1a2a5,_0x5c602f,_0x2e90da){return db[_0xbfbf('0x26')][_0xbfbf('0x40')]({'where':{'id':_0xe1a2a5[_0xbfbf('0x41')]['id']},'attributes':[_0xbfbf('0x23'),_0xbfbf('0x42'),_0xbfbf('0x43')],'raw':!![]})[_0xbfbf('0x1d')](handleEntityNotFound(_0x5c602f,null))['then'](function(_0x5b59f7){if(_0x5b59f7){if(!fs[_0xbfbf('0x44')](path[_0xbfbf('0x45')](config[_0xbfbf('0x46')],'server/files/sounds/converted',_0x5b59f7[_0xbfbf('0x42')]+'.'+_0x5b59f7[_0xbfbf('0x43')]))){throw new db[(_0xbfbf('0x47'))][(_0xbfbf('0x48'))]('Sound\x20not\x20found');}return _0x5c602f[_0xbfbf('0x49')](path[_0xbfbf('0x45')](config['root'],_0xbfbf('0x4a'),util[_0xbfbf('0x4b')](_0xbfbf('0x4c'),_0x5b59f7[_0xbfbf('0x42')],_0x5b59f7[_0xbfbf('0x43')])),util[_0xbfbf('0x4b')]('%s.%s',_0x5b59f7[_0xbfbf('0x23')],_0x5b59f7[_0xbfbf('0x43')]));}return null;})[_0xbfbf('0x3e')](handleError(_0x5c602f,null));};exports[_0xbfbf('0x4d')]=function(_0x9660f8,_0x1e0a2b,_0x58fe79){var _0x371ca0={'name':path[_0xbfbf('0x4e')](_0x9660f8[_0xbfbf('0x4f')][_0xbfbf('0x50')],path['extname'](_0x9660f8[_0xbfbf('0x4f')][_0xbfbf('0x50')])),'save_name':path[_0xbfbf('0x4e')](_0x9660f8['file'][_0xbfbf('0x51')],path[_0xbfbf('0x52')](_0x9660f8[_0xbfbf('0x4f')][_0xbfbf('0x51')])),'original_format':path[_0xbfbf('0x52')](_0x9660f8[_0xbfbf('0x4f')][_0xbfbf('0x50')])[_0xbfbf('0x53')](0x1),'converted_format':_0xbfbf('0x54')};var _0x1f7560=path[_0xbfbf('0x45')](config[_0xbfbf('0x46')],_0xbfbf('0x55'),_0x9660f8['file']['filename']);var _0x2c49ea=path[_0xbfbf('0x45')](config['root'],'server/files/sounds/converted',util[_0xbfbf('0x4b')](_0xbfbf('0x4c'),path[_0xbfbf('0x4e')](_0x9660f8[_0xbfbf('0x4f')]['filename'],path[_0xbfbf('0x52')](_0x9660f8[_0xbfbf('0x4f')][_0xbfbf('0x51')])),_0x371ca0[_0xbfbf('0x43')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x1f7560);logger[_0xbfbf('0x56')]('Sound\x20upload\x20destination:\x20%s',_0x2c49ea);try{fs[_0xbfbf('0x57')](_0x1f7560,parseInt('0777',0x8));var _0x2b97ad=sox[_0xbfbf('0x58')](_0x1f7560,_0x2c49ea,{'sampleRate':0x1f40,'format':_0xbfbf('0x54'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2b97ad['on']('error',function(_0x194408){fs[_0xbfbf('0x59')](_0x1f7560);_0x1e0a2b['status'](0x1f4)[_0xbfbf('0x5a')](_0x194408);});_0x2b97ad['on'](_0xbfbf('0x5b'),function(_0x76d799){_0x371ca0['original_duration']=isNaN(_0x76d799['duration'])?null:_0x76d799[_0xbfbf('0x5c')]*0x3e8;_0x371ca0[_0xbfbf('0x5d')]=isNaN(_0x76d799['sampleCount'])?null:_0x76d799[_0xbfbf('0x5e')];_0x371ca0[_0xbfbf('0x5f')]=isNaN(_0x76d799['channelCount'])?null:_0x76d799[_0xbfbf('0x60')];_0x371ca0[_0xbfbf('0x61')]=isNaN(_0x76d799[_0xbfbf('0x62')])?null:_0x76d799[_0xbfbf('0x62')];_0x371ca0[_0xbfbf('0x63')]=isNaN(_0x76d799[_0xbfbf('0x64')])?null:_0x76d799['sampleRate'];});_0x2b97ad['on'](_0xbfbf('0x65'),function(_0x2d5441){_0x371ca0[_0xbfbf('0x66')]=isNaN(_0x2d5441[_0xbfbf('0x5c')])?null:_0x2d5441[_0xbfbf('0x5c')]*0x3e8;_0x371ca0['converted_sampleCount']=isNaN(_0x2d5441[_0xbfbf('0x5e')])?null:_0x2d5441[_0xbfbf('0x5e')];_0x371ca0[_0xbfbf('0x67')]=isNaN(_0x2d5441[_0xbfbf('0x60')])?null:_0x2d5441[_0xbfbf('0x60')];_0x371ca0[_0xbfbf('0x68')]=isNaN(_0x2d5441[_0xbfbf('0x62')])?null:_0x2d5441[_0xbfbf('0x62')];_0x371ca0['converted_sampleRate']=isNaN(_0x2d5441[_0xbfbf('0x64')])?null:_0x2d5441[_0xbfbf('0x64')];});_0x2b97ad['on'](_0xbfbf('0x69'),function(){fs[_0xbfbf('0x57')](_0x2c49ea,parseInt('0777',0x8));return db[_0xbfbf('0x26')][_0xbfbf('0x4d')](_0x371ca0)['then'](function(_0x5d2a64){var _0x517f4c={'role':_0x9660f8['body']['role'],'userProfileId':_0x9660f8['body'][_0xbfbf('0x6a')]};if(!_0x517f4c)throw new Error(_0xbfbf('0x6b'));if(_0x517f4c[_0xbfbf('0x6c')]===_0xbfbf('0x6d')){var _0x87f9f6=_0x5d2a64[_0xbfbf('0x1f')]({'plain':!![]});return db[_0xbfbf('0x6e')]['find']({'where':{'name':_0xbfbf('0x6f'),'userProfileId':_0x517f4c['userProfileId']},'raw':!![]})[_0xbfbf('0x1d')](function(_0xd99295){if(_0xd99295&&_0xd99295[_0xbfbf('0x70')]===0x0){return db[_0xbfbf('0x20')]['create']({'name':_0x87f9f6[_0xbfbf('0x23')],'resourceId':_0x87f9f6['id'],'type':_0xd99295[_0xbfbf('0x23')],'sectionId':_0xd99295['id']},{})[_0xbfbf('0x1d')](function(){return _0x5d2a64;});}else{return _0x5d2a64;}})[_0xbfbf('0x3e')](function(_0x4ce32b){logger['error'](_0xbfbf('0x71'),_0x4ce32b);throw _0x4ce32b;});}return _0x5d2a64;})[_0xbfbf('0x1d')](respondWithResult(_0x1e0a2b,null))[_0xbfbf('0x3e')](handleError(_0x1e0a2b,null));});_0x2b97ad['start']();}catch(_0x5b29f6){_0x1e0a2b[_0xbfbf('0x16')](0x1f4)[_0xbfbf('0x5a')](_0x5b29f6);}};exports[_0xbfbf('0x1c')]=function(_0x575a6e,_0x20c00f,_0x5da664){return db[_0xbfbf('0x26')][_0xbfbf('0x40')]({'where':{'id':_0x575a6e[_0xbfbf('0x41')]['id']}})['then'](handleEntityNotFound(_0x20c00f,null))[_0xbfbf('0x1d')](saveUpdates(_[_0xbfbf('0x36')](_0x575a6e[_0xbfbf('0x72')],[_0xbfbf('0x23'),_0xbfbf('0x73')]),null))[_0xbfbf('0x1d')](respondWithResult(_0x20c00f,null))['catch'](handleError(_0x20c00f,null));};exports[_0xbfbf('0x74')]=function(_0x53765c,_0x474b11,_0x2f1885){return db[_0xbfbf('0x26')][_0xbfbf('0x40')]({'where':{'id':_0x53765c[_0xbfbf('0x41')]['id']}})[_0xbfbf('0x1d')](function(_0x382152){if(_0x382152){return _0x382152['destroy']();}})[_0xbfbf('0x1d')](function(_0x457def){var _0x2c4426=path[_0xbfbf('0x45')](config[_0xbfbf('0x46')],_0xbfbf('0x55'),util[_0xbfbf('0x4b')]('%s.%s',_0x457def[_0xbfbf('0x42')],_0x457def[_0xbfbf('0x75')]));var _0x3dde8f=path[_0xbfbf('0x45')](config[_0xbfbf('0x46')],_0xbfbf('0x4a'),util[_0xbfbf('0x4b')](_0xbfbf('0x4c'),_0x457def[_0xbfbf('0x42')],_0x457def['converted_format']));fs[_0xbfbf('0x59')](_0x2c4426);fs[_0xbfbf('0x59')](_0x3dde8f);return _0x457def;})[_0xbfbf('0x1d')](function(_0x4e6970){if(_0x4e6970){return _0x474b11[_0xbfbf('0x16')](0xcc)[_0xbfbf('0x69')]();}})['then'](handleEntityNotFound(_0x474b11,null))[_0xbfbf('0x3e')](handleError(_0x474b11,null));}; \ No newline at end of file +var _0x1798=['fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','save','update','destroy','then','get','UserProfileResource','end','error','name','send','index','Sound','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','filters','pick','where','merge','options','includeAll','include','findAll','rows','catch','show','params','download','find','save_name','converted_format','root','server/files/sounds/converted','Sequelize','ValidationError','Sound\x20not\x20found','join','format','%s.%s','basename','file','originalname','filename','extname','substring','wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','chmodSync','transcode','original_duration','duration','original_sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','0777','create','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Sounds','autoAssociation','description','delete','unlinkSync','eml-format','rimraf'];(function(_0x44543b,_0x5db79a){var _0x2a893f=function(_0x180700){while(--_0x180700){_0x44543b['push'](_0x44543b['shift']());}};_0x2a893f(++_0x5db79a);}(_0x1798,0x1de));var _0x8179=function(_0x587217,_0x400ae7){_0x587217=_0x587217-0x0;var _0x211e1c=_0x1798[_0x587217];return _0x211e1c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8179('0x0'));var rimraf=require(_0x8179('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8179('0x2'));var rp=require(_0x8179('0x3'));var moment=require(_0x8179('0x4'));var BPromise=require(_0x8179('0x5'));var Mustache=require('mustache');var util=require(_0x8179('0x6'));var path=require(_0x8179('0x7'));var sox=require(_0x8179('0x8'));var csv=require(_0x8179('0x9'));var ejs=require(_0x8179('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8179('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8179('0xc'));var toCsv=require(_0x8179('0x9'));var querystring=require(_0x8179('0xd'));var Papa=require(_0x8179('0xe'));var Redis=require(_0x8179('0xf'));var authService=require(_0x8179('0x10'));var qs=require(_0x8179('0x11'));var as=require(_0x8179('0x12'));var hardwareService=require(_0x8179('0x13'));var logger=require(_0x8179('0x14'))(_0x8179('0x15'));var utils=require(_0x8179('0x16'));var config=require('../../config/environment');var db=require(_0x8179('0x17'))['db'];function respondWithStatusCode(_0xb5e44f,_0x45725f){_0x45725f=_0x45725f||0xcc;return function(_0x457e0d){if(_0x457e0d){return _0xb5e44f[_0x8179('0x18')](_0x45725f);}return _0xb5e44f[_0x8179('0x19')](_0x45725f)['end']();};}function respondWithResult(_0x115808,_0x3e0502){_0x3e0502=_0x3e0502||0xc8;return function(_0x568cac){if(_0x568cac){return _0x115808[_0x8179('0x19')](_0x3e0502)[_0x8179('0x1a')](_0x568cac);}};}function respondWithFilteredResult(_0x50ff6d,_0x31d054){return function(_0x3dc609){if(_0x3dc609){var _0x9e6a07=_0x3dc609[_0x8179('0x1b')],_0x13f40d=_0x31d054[_0x8179('0x1c')],_0x4ffa3a=_0x31d054[_0x8179('0x1c')]+_0x31d054[_0x8179('0x1d')],_0x299b49;if(_0x4ffa3a>=_0x9e6a07){_0x4ffa3a=_0x9e6a07;_0x299b49=0xc8;}else{_0x299b49=0xce;}_0x50ff6d['status'](_0x299b49);return _0x50ff6d[_0x8179('0x1e')](_0x8179('0x1f'),_0x13f40d+'-'+_0x4ffa3a+'/'+_0x9e6a07)['json'](_0x3dc609);}return null;};}function patchUpdates(_0xb71409){return function(_0x538650){try{jsonpatch['apply'](_0x538650,_0xb71409,!![]);}catch(_0x4e8480){return BPromise['reject'](_0x4e8480);}return _0x538650[_0x8179('0x20')]();};}function saveUpdates(_0x1b415b,_0x2bdeb0){return function(_0x3c9c93){if(_0x3c9c93){return _0x3c9c93[_0x8179('0x21')](_0x1b415b)['then'](function(_0x34cdf6){return _0x34cdf6;});}return null;};}function removeEntity(_0x312aa1,_0x10e8c5){return function(_0x77c4d8){if(_0x77c4d8){return _0x77c4d8[_0x8179('0x22')]()[_0x8179('0x23')](function(){var _0x5ab2bb=_0x77c4d8[_0x8179('0x24')]({'plain':!![]});var _0x293502='Sounds';return db[_0x8179('0x25')][_0x8179('0x22')]({'where':{'type':_0x293502,'resourceId':_0x5ab2bb['id']}})[_0x8179('0x23')](function(){return _0x77c4d8;});})[_0x8179('0x23')](function(){_0x312aa1[_0x8179('0x19')](0xcc)[_0x8179('0x26')]();});}};}function handleEntityNotFound(_0x428508,_0x3f01ae){return function(_0x35b577){if(!_0x35b577){_0x428508[_0x8179('0x18')](0x194);}return _0x35b577;};}function handleError(_0xba08a8,_0x34de6b){_0x34de6b=_0x34de6b||0x1f4;return function(_0xdf6b3b){logger[_0x8179('0x27')](_0xdf6b3b['stack']);if(_0xdf6b3b[_0x8179('0x28')]){delete _0xdf6b3b[_0x8179('0x28')];}_0xba08a8['status'](_0x34de6b)[_0x8179('0x29')](_0xdf6b3b);};}exports[_0x8179('0x2a')]=function(_0x227ce7,_0x29636e){var _0x4c2f25={},_0x4963f4={},_0x242cb6={'count':0x0,'rows':[]};var _0xd04d2=_['map'](db[_0x8179('0x2b')][_0x8179('0x2c')],function(_0x110191){return{'name':_0x110191[_0x8179('0x2d')],'type':_0x110191[_0x8179('0x2e')][_0x8179('0x2f')]};});_0x4963f4[_0x8179('0x30')]=_[_0x8179('0x31')](_0xd04d2,_0x8179('0x28'));_0x4963f4[_0x8179('0x32')]=_[_0x8179('0x33')](_0x227ce7['query']);_0x4963f4['filters']=_[_0x8179('0x34')](_0x4963f4[_0x8179('0x30')],_0x4963f4[_0x8179('0x32')]);_0x4c2f25[_0x8179('0x35')]=_[_0x8179('0x34')](_0x4963f4[_0x8179('0x30')],qs[_0x8179('0x36')](_0x227ce7[_0x8179('0x32')][_0x8179('0x36')]));_0x4c2f25['attributes']=_0x4c2f25[_0x8179('0x35')][_0x8179('0x37')]?_0x4c2f25[_0x8179('0x35')]:_0x4963f4[_0x8179('0x30')];if(!_0x227ce7[_0x8179('0x32')]['hasOwnProperty'](_0x8179('0x38'))){_0x4c2f25[_0x8179('0x1d')]=qs[_0x8179('0x1d')](_0x227ce7[_0x8179('0x32')][_0x8179('0x1d')]);_0x4c2f25[_0x8179('0x1c')]=qs[_0x8179('0x1c')](_0x227ce7[_0x8179('0x32')]['offset']);}_0x4c2f25[_0x8179('0x39')]=qs['sort'](_0x227ce7[_0x8179('0x32')]['sort']);_0x4c2f25['where']=qs[_0x8179('0x3a')](_[_0x8179('0x3b')](_0x227ce7[_0x8179('0x32')],_0x4963f4[_0x8179('0x3a')]));if(_0x227ce7['query']['filter']){_0x4c2f25[_0x8179('0x3c')]=_[_0x8179('0x3d')](_0x4c2f25[_0x8179('0x3c')],{'$or':_[_0x8179('0x31')](_0xd04d2,function(_0x18a349){if(_0x18a349[_0x8179('0x2e')]!=='VIRTUAL'){var _0x4bb7a0={};_0x4bb7a0[_0x18a349[_0x8179('0x28')]]={'$like':'%'+_0x227ce7['query']['filter']+'%'};return _0x4bb7a0;}})});}_0x4c2f25=_[_0x8179('0x3d')]({},_0x4c2f25,_0x227ce7[_0x8179('0x3e')]);var _0x51a8ba={'where':_0x4c2f25[_0x8179('0x3c')]};return db[_0x8179('0x2b')]['count'](_0x51a8ba)[_0x8179('0x23')](function(_0x46ab14){_0x242cb6[_0x8179('0x1b')]=_0x46ab14;if(_0x227ce7[_0x8179('0x32')][_0x8179('0x3f')]){_0x4c2f25[_0x8179('0x40')]=[{'all':!![]}];}return db['Sound'][_0x8179('0x41')](_0x4c2f25);})[_0x8179('0x23')](function(_0x1f59d7){_0x242cb6[_0x8179('0x42')]=_0x1f59d7;return _0x242cb6;})[_0x8179('0x23')](respondWithFilteredResult(_0x29636e,_0x4c2f25))[_0x8179('0x43')](handleError(_0x29636e,null));};exports[_0x8179('0x44')]=function(_0xcce001,_0x1a1ca5){var _0x65c30c={'raw':!![],'where':{'id':_0xcce001[_0x8179('0x45')]['id']}},_0x44d781={};_0x44d781[_0x8179('0x30')]=_['keys'](db[_0x8179('0x2b')][_0x8179('0x2c')]);_0x44d781['query']=_[_0x8179('0x33')](_0xcce001['query']);_0x44d781[_0x8179('0x3a')]=_[_0x8179('0x34')](_0x44d781[_0x8179('0x30')],_0x44d781['query']);_0x65c30c['attributes']=_[_0x8179('0x34')](_0x44d781[_0x8179('0x30')],qs[_0x8179('0x36')](_0xcce001['query'][_0x8179('0x36')]));_0x65c30c[_0x8179('0x35')]=_0x65c30c['attributes']['length']?_0x65c30c['attributes']:_0x44d781['model'];if(_0xcce001[_0x8179('0x32')][_0x8179('0x3f')]){_0x65c30c['include']=[{'all':!![]}];}_0x65c30c=_[_0x8179('0x3d')]({},_0x65c30c,_0xcce001[_0x8179('0x3e')]);return db[_0x8179('0x2b')]['find'](_0x65c30c)[_0x8179('0x23')](handleEntityNotFound(_0x1a1ca5,null))['then'](respondWithResult(_0x1a1ca5,null))[_0x8179('0x43')](handleError(_0x1a1ca5,null));};exports[_0x8179('0x46')]=function(_0x52104f,_0x45ecb,_0x13745f){return db[_0x8179('0x2b')][_0x8179('0x47')]({'where':{'id':_0x52104f['params']['id']},'attributes':[_0x8179('0x28'),_0x8179('0x48'),_0x8179('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x45ecb,null))[_0x8179('0x23')](function(_0x3b0603){if(_0x3b0603){if(!fs['existsSync'](path['join'](config[_0x8179('0x4a')],_0x8179('0x4b'),_0x3b0603[_0x8179('0x48')]+'.'+_0x3b0603['converted_format']))){throw new db[(_0x8179('0x4c'))][(_0x8179('0x4d'))](_0x8179('0x4e'));}return _0x45ecb[_0x8179('0x46')](path[_0x8179('0x4f')](config['root'],_0x8179('0x4b'),util[_0x8179('0x50')](_0x8179('0x51'),_0x3b0603[_0x8179('0x48')],_0x3b0603[_0x8179('0x49')])),util[_0x8179('0x50')](_0x8179('0x51'),_0x3b0603[_0x8179('0x28')],_0x3b0603[_0x8179('0x49')]));}return null;})[_0x8179('0x43')](handleError(_0x45ecb,null));};exports['create']=function(_0x561431,_0x5f5378,_0x2606a8){var _0x213ee4={'name':path[_0x8179('0x52')](_0x561431[_0x8179('0x53')][_0x8179('0x54')],path['extname'](_0x561431[_0x8179('0x53')][_0x8179('0x54')])),'save_name':path[_0x8179('0x52')](_0x561431[_0x8179('0x53')][_0x8179('0x55')],path[_0x8179('0x56')](_0x561431[_0x8179('0x53')]['filename'])),'original_format':path[_0x8179('0x56')](_0x561431[_0x8179('0x53')][_0x8179('0x54')])[_0x8179('0x57')](0x1),'converted_format':_0x8179('0x58')};var _0x2bbae6=path[_0x8179('0x4f')](config[_0x8179('0x4a')],_0x8179('0x59'),_0x561431[_0x8179('0x53')][_0x8179('0x55')]);var _0x2f27b2=path[_0x8179('0x4f')](config[_0x8179('0x4a')],'server/files/sounds/converted',util[_0x8179('0x50')](_0x8179('0x51'),path[_0x8179('0x52')](_0x561431[_0x8179('0x53')][_0x8179('0x55')],path[_0x8179('0x56')](_0x561431[_0x8179('0x53')][_0x8179('0x55')])),_0x213ee4['converted_format']));logger[_0x8179('0x5a')](_0x8179('0x5b'),_0x2bbae6);logger['info']('Sound\x20upload\x20destination:\x20%s',_0x2f27b2);try{fs[_0x8179('0x5c')](_0x2bbae6,parseInt('0777',0x8));var _0x3e955b=sox[_0x8179('0x5d')](_0x2bbae6,_0x2f27b2,{'sampleRate':0x1f40,'format':_0x8179('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x3e955b['on']('error',function(_0x4a10e3){fs['unlinkSync'](_0x2bbae6);_0x5f5378[_0x8179('0x19')](0x1f4)[_0x8179('0x29')](_0x4a10e3);});_0x3e955b['on']('src',function(_0x4e0531){_0x213ee4[_0x8179('0x5e')]=isNaN(_0x4e0531[_0x8179('0x5f')])?null:_0x4e0531[_0x8179('0x5f')]*0x3e8;_0x213ee4[_0x8179('0x60')]=isNaN(_0x4e0531['sampleCount'])?null:_0x4e0531['sampleCount'];_0x213ee4[_0x8179('0x61')]=isNaN(_0x4e0531[_0x8179('0x62')])?null:_0x4e0531['channelCount'];_0x213ee4['original_bitRate']=isNaN(_0x4e0531[_0x8179('0x63')])?null:_0x4e0531[_0x8179('0x63')];_0x213ee4[_0x8179('0x64')]=isNaN(_0x4e0531['sampleRate'])?null:_0x4e0531[_0x8179('0x65')];});_0x3e955b['on'](_0x8179('0x66'),function(_0x105fe4){_0x213ee4[_0x8179('0x67')]=isNaN(_0x105fe4['duration'])?null:_0x105fe4[_0x8179('0x5f')]*0x3e8;_0x213ee4[_0x8179('0x68')]=isNaN(_0x105fe4['sampleCount'])?null:_0x105fe4['sampleCount'];_0x213ee4[_0x8179('0x69')]=isNaN(_0x105fe4[_0x8179('0x62')])?null:_0x105fe4['channelCount'];_0x213ee4[_0x8179('0x6a')]=isNaN(_0x105fe4['bitRate'])?null:_0x105fe4[_0x8179('0x63')];_0x213ee4[_0x8179('0x6b')]=isNaN(_0x105fe4[_0x8179('0x65')])?null:_0x105fe4['sampleRate'];});_0x3e955b['on'](_0x8179('0x26'),function(){fs[_0x8179('0x5c')](_0x2f27b2,parseInt(_0x8179('0x6c'),0x8));return db[_0x8179('0x2b')][_0x8179('0x6d')](_0x213ee4)['then'](function(_0x7d1af3){var _0xe866a5={'role':_0x561431[_0x8179('0x6e')][_0x8179('0x6f')],'userProfileId':_0x561431[_0x8179('0x6e')][_0x8179('0x70')]};if(!_0xe866a5)throw new Error(_0x8179('0x71'));if(_0xe866a5['role']==='user'){var _0x30005b=_0x7d1af3[_0x8179('0x24')]({'plain':!![]});return db[_0x8179('0x72')][_0x8179('0x47')]({'where':{'name':_0x8179('0x73'),'userProfileId':_0xe866a5[_0x8179('0x70')]},'raw':!![]})[_0x8179('0x23')](function(_0x2d965f){if(_0x2d965f&&_0x2d965f[_0x8179('0x74')]===0x0){return db[_0x8179('0x25')]['create']({'name':_0x30005b[_0x8179('0x28')],'resourceId':_0x30005b['id'],'type':_0x2d965f['name'],'sectionId':_0x2d965f['id']},{})['then'](function(){return _0x7d1af3;});}else{return _0x7d1af3;}})['catch'](function(_0x1c16df){logger[_0x8179('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c16df);throw _0x1c16df;});}return _0x7d1af3;})[_0x8179('0x23')](respondWithResult(_0x5f5378,null))['catch'](handleError(_0x5f5378,null));});_0x3e955b['start']();}catch(_0x45a05b){_0x5f5378[_0x8179('0x19')](0x1f4)[_0x8179('0x29')](_0x45a05b);}};exports[_0x8179('0x21')]=function(_0x70756,_0x5f12b5,_0x4f7572){return db[_0x8179('0x2b')][_0x8179('0x47')]({'where':{'id':_0x70756[_0x8179('0x45')]['id']}})[_0x8179('0x23')](handleEntityNotFound(_0x5f12b5,null))['then'](saveUpdates(_[_0x8179('0x3b')](_0x70756[_0x8179('0x6e')],[_0x8179('0x28'),_0x8179('0x75')]),null))[_0x8179('0x23')](respondWithResult(_0x5f12b5,null))[_0x8179('0x43')](handleError(_0x5f12b5,null));};exports[_0x8179('0x76')]=function(_0x6f041,_0x1da4dd,_0x4e6125){return db['Sound'][_0x8179('0x47')]({'where':{'id':_0x6f041[_0x8179('0x45')]['id']}})[_0x8179('0x23')](function(_0x2170d1){if(_0x2170d1){return _0x2170d1['destroy']();}})[_0x8179('0x23')](function(_0x59d1f8){var _0x41dfaa=path[_0x8179('0x4f')](config[_0x8179('0x4a')],_0x8179('0x59'),util[_0x8179('0x50')](_0x8179('0x51'),_0x59d1f8[_0x8179('0x48')],_0x59d1f8['original_format']));var _0x2a0b60=path[_0x8179('0x4f')](config[_0x8179('0x4a')],_0x8179('0x4b'),util[_0x8179('0x50')](_0x8179('0x51'),_0x59d1f8[_0x8179('0x48')],_0x59d1f8[_0x8179('0x49')]));fs['unlinkSync'](_0x41dfaa);fs[_0x8179('0x77')](_0x2a0b60);return _0x59d1f8;})[_0x8179('0x23')](function(_0xbd0804){if(_0xbd0804){return _0x1da4dd[_0x8179('0x19')](0xcc)[_0x8179('0x26')]();}})[_0x8179('0x23')](handleEntityNotFound(_0x1da4dd,null))[_0x8179('0x43')](handleError(_0x1da4dd,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index ebfc519..e2dcf3d 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 _0xddbd=['path','rimraf','./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x35f787,_0x1085e5){var _0x45ed82=function(_0x3bc31b){while(--_0x3bc31b){_0x35f787['push'](_0x35f787['shift']());}};_0x45ed82(++_0x1085e5);}(_0xddbd,0xa3));var _0xdddb=function(_0xb5fc3e,_0x234703){_0xb5fc3e=_0xb5fc3e-0x0;var _0x2efc3c=_0xddbd[_0xb5fc3e];return _0x2efc3c;};'use strict';var _=require(_0xdddb('0x0'));var util=require(_0xdddb('0x1'));var logger=require(_0xdddb('0x2'))('api');var moment=require(_0xdddb('0x3'));var BPromise=require(_0xdddb('0x4'));var rp=require(_0xdddb('0x5'));var fs=require('fs');var path=require(_0xdddb('0x6'));var rimraf=require(_0xdddb('0x7'));var config=require('../../config/environment');var attributes=require(_0xdddb('0x8'));module[_0xdddb('0x9')]=function(_0x54e2bc,_0x433bac){return _0x54e2bc[_0xdddb('0xa')](_0xdddb('0xb'),attributes,{'tableName':_0xdddb('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x558e=['tools_sounds','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./sound.attributes','exports','define','Sound'];(function(_0x31ced5,_0x5d5415){var _0x10d9e5=function(_0x2e51a5){while(--_0x2e51a5){_0x31ced5['push'](_0x31ced5['shift']());}};_0x10d9e5(++_0x5d5415);}(_0x558e,0x105));var _0xe558=function(_0x454165,_0x1f3e74){_0x454165=_0x454165-0x0;var _0x56db53=_0x558e[_0x454165];return _0x56db53;};'use strict';var _=require(_0xe558('0x0'));var util=require(_0xe558('0x1'));var logger=require(_0xe558('0x2'))(_0xe558('0x3'));var moment=require('moment');var BPromise=require(_0xe558('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe558('0x5'));var rimraf=require(_0xe558('0x6'));var config=require(_0xe558('0x7'));var attributes=require(_0xe558('0x8'));module[_0xe558('0x9')]=function(_0x5368ef,_0x47a975){return _0x5368ef[_0xe558('0xa')](_0xe558('0xb'),attributes,{'tableName':_0xe558('0xc'),'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 043fc7f..dd8c12f 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 _0x05f6=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','Sound,\x20%s,\x20%s','message','result','catch','ShowSound','Sound','options','raw','where','attributes','include','map','model','debug','lodash','util','moment','bluebird'];(function(_0x3c6ca7,_0xde8287){var _0x535514=function(_0x2f934f){while(--_0x2f934f){_0x3c6ca7['push'](_0x3c6ca7['shift']());}};_0x535514(++_0xde8287);}(_0x05f6,0xb0));var _0x605f=function(_0x3661d4,_0x13d978){_0x3661d4=_0x3661d4-0x0;var _0x9cd7bd=_0x05f6[_0x3661d4];return _0x9cd7bd;};'use strict';var _=require(_0x605f('0x0'));var util=require(_0x605f('0x1'));var moment=require(_0x605f('0x2'));var BPromise=require(_0x605f('0x3'));var rs=require(_0x605f('0x4'));var fs=require('fs');var Redis=require(_0x605f('0x5'));var db=require(_0x605f('0x6'))['db'];var utils=require(_0x605f('0x7'));var logger=require(_0x605f('0x8'))(_0x605f('0x9'));var config=require(_0x605f('0xa'));var jayson=require(_0x605f('0xb'));var client=jayson[_0x605f('0xc')][_0x605f('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4726b4,_0x37a4ea,_0x39e185){return new BPromise(function(_0x3cd5d6,_0x146b48){return client[_0x605f('0xe')](_0x4726b4,_0x39e185)[_0x605f('0xf')](function(_0x45f575){logger[_0x605f('0x10')]('Sound,\x20%s,\x20%s',_0x37a4ea,_0x605f('0x11'));logger['debug'](_0x605f('0x12'),_0x37a4ea,'request\x20sent',JSON[_0x605f('0x13')](_0x45f575));if(_0x45f575[_0x605f('0x14')]){if(_0x45f575[_0x605f('0x14')][_0x605f('0x15')]===0x1f4){logger[_0x605f('0x14')](_0x605f('0x16'),_0x37a4ea,_0x45f575[_0x605f('0x14')][_0x605f('0x17')]);return _0x146b48(_0x45f575[_0x605f('0x14')][_0x605f('0x17')]);}logger['error']('Sound,\x20%s,\x20%s',_0x37a4ea,_0x45f575[_0x605f('0x14')][_0x605f('0x17')]);return _0x3cd5d6(_0x45f575['error'][_0x605f('0x17')]);}else{logger[_0x605f('0x10')]('Sound,\x20%s,\x20%s',_0x37a4ea,'request\x20sent');_0x3cd5d6(_0x45f575[_0x605f('0x18')][_0x605f('0x17')]);}})[_0x605f('0x19')](function(_0x4f70c7){logger[_0x605f('0x14')](_0x605f('0x16'),_0x37a4ea,_0x4f70c7);_0x146b48(_0x4f70c7);});});}exports[_0x605f('0x1a')]=function(_0x47a8e1){var _0x1eb2bf=this;return new Promise(function(_0x12fd51,_0x391d00){return db[_0x605f('0x1b')]['find']({'raw':_0x47a8e1[_0x605f('0x1c')]?_0x47a8e1[_0x605f('0x1c')][_0x605f('0x1d')]===undefined?!![]:![]:!![],'where':_0x47a8e1[_0x605f('0x1c')]?_0x47a8e1[_0x605f('0x1c')][_0x605f('0x1e')]||null:null,'attributes':_0x47a8e1['options']?_0x47a8e1[_0x605f('0x1c')][_0x605f('0x1f')]||null:null,'include':_0x47a8e1[_0x605f('0x1c')]?_0x47a8e1[_0x605f('0x1c')][_0x605f('0x20')]?_[_0x605f('0x21')](_0x47a8e1[_0x605f('0x1c')][_0x605f('0x20')],function(_0x4dfece){return{'model':db[_0x4dfece[_0x605f('0x22')]],'as':_0x4dfece['as'],'attributes':_0x4dfece['attributes'],'include':_0x4dfece[_0x605f('0x20')]?_['map'](_0x4dfece[_0x605f('0x20')],function(_0x2fdd6a){return{'model':db[_0x2fdd6a[_0x605f('0x22')]],'as':_0x2fdd6a['as'],'attributes':_0x2fdd6a['attributes'],'include':_0x2fdd6a[_0x605f('0x20')]?_[_0x605f('0x21')](_0x2fdd6a[_0x605f('0x20')],function(_0x12d9ef){return{'model':db[_0x12d9ef[_0x605f('0x22')]],'as':_0x12d9ef['as'],'attributes':_0x12d9ef[_0x605f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x605f('0xf')](function(_0x360a00){logger[_0x605f('0x10')](_0x605f('0x1a'),_0x47a8e1);logger[_0x605f('0x23')]('ShowSound',_0x47a8e1,JSON[_0x605f('0x13')](_0x360a00));_0x12fd51(_0x360a00);})['catch'](function(_0x1eac22){logger[_0x605f('0x14')](_0x605f('0x1a'),_0x1eac22['message'],_0x47a8e1);_0x391d00(_0x1eb2bf[_0x605f('0x14')](0x1f4,_0x1eac22[_0x605f('0x17')]));});});}; \ No newline at end of file +var _0x606d=['jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','ShowSound','Sound','find','options','attributes','map','include','model','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x2d5805,_0x21954e){var _0x1cae4f=function(_0x53ff24){while(--_0x53ff24){_0x2d5805['push'](_0x2d5805['shift']());}};_0x1cae4f(++_0x21954e);}(_0x606d,0xca));var _0xd606=function(_0x2c6622,_0xc948a8){_0x2c6622=_0x2c6622-0x0;var _0x5a2533=_0x606d[_0x2c6622];return _0x5a2533;};'use strict';var _=require(_0xd606('0x0'));var util=require(_0xd606('0x1'));var moment=require(_0xd606('0x2'));var BPromise=require(_0xd606('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd606('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd606('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xd606('0x6'));var client=jayson['client'][_0xd606('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x38b02c,_0x4c576b,_0x533d3f){return new BPromise(function(_0x897024,_0x51ce85){return client[_0xd606('0x8')](_0x38b02c,_0x533d3f)[_0xd606('0x9')](function(_0x727358){logger[_0xd606('0xa')](_0xd606('0xb'),_0x4c576b,'request\x20sent');logger['debug']('Sound,\x20%s,\x20%s,\x20%s',_0x4c576b,_0xd606('0xc'),JSON[_0xd606('0xd')](_0x727358));if(_0x727358[_0xd606('0xe')]){if(_0x727358[_0xd606('0xe')][_0xd606('0xf')]===0x1f4){logger[_0xd606('0xe')](_0xd606('0xb'),_0x4c576b,_0x727358['error'][_0xd606('0x10')]);return _0x51ce85(_0x727358[_0xd606('0xe')][_0xd606('0x10')]);}logger[_0xd606('0xe')](_0xd606('0xb'),_0x4c576b,_0x727358[_0xd606('0xe')]['message']);return _0x897024(_0x727358[_0xd606('0xe')]['message']);}else{logger[_0xd606('0xa')](_0xd606('0xb'),_0x4c576b,_0xd606('0xc'));_0x897024(_0x727358['result']['message']);}})[_0xd606('0x11')](function(_0x10a416){logger[_0xd606('0xe')](_0xd606('0xb'),_0x4c576b,_0x10a416);_0x51ce85(_0x10a416);});});}exports[_0xd606('0x12')]=function(_0x1aa251){var _0x5d112f=this;return new Promise(function(_0x128074,_0x27523c){return db[_0xd606('0x13')][_0xd606('0x14')]({'raw':_0x1aa251[_0xd606('0x15')]?_0x1aa251[_0xd606('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x1aa251[_0xd606('0x15')]?_0x1aa251[_0xd606('0x15')]['where']||null:null,'attributes':_0x1aa251[_0xd606('0x15')]?_0x1aa251[_0xd606('0x15')][_0xd606('0x16')]||null:null,'include':_0x1aa251[_0xd606('0x15')]?_0x1aa251['options']['include']?_[_0xd606('0x17')](_0x1aa251[_0xd606('0x15')][_0xd606('0x18')],function(_0x58ff64){return{'model':db[_0x58ff64['model']],'as':_0x58ff64['as'],'attributes':_0x58ff64[_0xd606('0x16')],'include':_0x58ff64[_0xd606('0x18')]?_[_0xd606('0x17')](_0x58ff64[_0xd606('0x18')],function(_0x316cca){return{'model':db[_0x316cca[_0xd606('0x19')]],'as':_0x316cca['as'],'attributes':_0x316cca[_0xd606('0x16')],'include':_0x316cca[_0xd606('0x18')]?_[_0xd606('0x17')](_0x316cca[_0xd606('0x18')],function(_0x315dcb){return{'model':db[_0x315dcb[_0xd606('0x19')]],'as':_0x315dcb['as'],'attributes':_0x315dcb[_0xd606('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd606('0x9')](function(_0x323e39){logger[_0xd606('0xa')](_0xd606('0x12'),_0x1aa251);logger['debug'](_0xd606('0x12'),_0x1aa251,JSON[_0xd606('0xd')](_0x323e39));_0x128074(_0x323e39);})[_0xd606('0x11')](function(_0x4ac465){logger['error'](_0xd606('0x12'),_0x4ac465['message'],_0x1aa251);_0x27523c(_0x5d112f[_0xd606('0xe')](0x1f4,_0x4ac465['message']));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index 6f0a0b8..8f5929f 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 _0x9be8=['put','update','delete','exports','util','connect-timeout','Router','../../components/auth/service','./squareMessage.controller','index','get','/:id','show','isAuthenticated','create'];(function(_0x274be7,_0x313c27){var _0x51bc64=function(_0x3b07bf){while(--_0x3b07bf){_0x274be7['push'](_0x274be7['shift']());}};_0x51bc64(++_0x313c27);}(_0x9be8,0x15d));var _0x89be=function(_0x4347ec,_0x41c4b8){_0x4347ec=_0x4347ec-0x0;var _0x4c8314=_0x9be8[_0x4347ec];return _0x4c8314;};'use strict';var multer=require('multer');var util=require(_0x89be('0x0'));var path=require('path');var timeout=require(_0x89be('0x1'));var express=require('express');var router=express[_0x89be('0x2')]();var auth=require(_0x89be('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x89be('0x4'));router['get']('/',auth['isAuthenticated'](),controller[_0x89be('0x5')]);router[_0x89be('0x6')](_0x89be('0x7'),auth['isAuthenticated'](),controller[_0x89be('0x8')]);router['post']('/',auth[_0x89be('0x9')](),controller[_0x89be('0xa')]);router[_0x89be('0xb')](_0x89be('0x7'),auth[_0x89be('0x9')](),controller[_0x89be('0xc')]);router[_0x89be('0xd')](_0x89be('0x7'),auth[_0x89be('0x9')](),controller['destroy']);module[_0x89be('0xe')]=router; \ No newline at end of file +var _0xec41=['put','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x19560c,_0x66e7f4){var _0x232bf1=function(_0x52ab93){while(--_0x52ab93){_0x19560c['push'](_0x19560c['shift']());}};_0x232bf1(++_0x66e7f4);}(_0xec41,0x113));var _0x1ec4=function(_0x4df2f7,_0x355a93){_0x4df2f7=_0x4df2f7-0x0;var _0x5d8dd5=_0xec41[_0x4df2f7];return _0x5d8dd5;};'use strict';var multer=require(_0x1ec4('0x0'));var util=require('util');var path=require(_0x1ec4('0x1'));var timeout=require(_0x1ec4('0x2'));var express=require('express');var router=express[_0x1ec4('0x3')]();var auth=require(_0x1ec4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1ec4('0x5'));var controller=require(_0x1ec4('0x6'));router[_0x1ec4('0x7')]('/',auth[_0x1ec4('0x8')](),controller[_0x1ec4('0x9')]);router[_0x1ec4('0x7')](_0x1ec4('0xa'),auth['isAuthenticated'](),controller[_0x1ec4('0xb')]);router[_0x1ec4('0xc')]('/',auth['isAuthenticated'](),controller[_0x1ec4('0xd')]);router[_0x1ec4('0xe')](_0x1ec4('0xa'),auth[_0x1ec4('0x8')](),controller['update']);router[_0x1ec4('0xf')](_0x1ec4('0xa'),auth[_0x1ec4('0x8')](),controller[_0x1ec4('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 7075655..8b42424 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 _0x3c1d=['sequelize','exports','STRING','medium','out'];(function(_0x199c03,_0x3254aa){var _0x11a7d4=function(_0x49e1da){while(--_0x49e1da){_0x199c03['push'](_0x199c03['shift']());}};_0x11a7d4(++_0x3254aa);}(_0x3c1d,0x19a));var _0xd3c1=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x3c1d[_0x26462c];return _0x509a42;};'use strict';var Sequelize=require(_0xd3c1('0x0'));module[_0xd3c1('0x1')]={'uniqueid':{'type':Sequelize[_0xd3c1('0x2')]},'body':{'type':Sequelize['TEXT'](_0xd3c1('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd3c1('0x4')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file +var _0x9579=['exports','STRING','medium','ENUM','out','sequelize'];(function(_0x478530,_0x14ec87){var _0x3d2376=function(_0x461f98){while(--_0x461f98){_0x478530['push'](_0x478530['shift']());}};_0x3d2376(++_0x14ec87);}(_0x9579,0xa7));var _0x9957=function(_0x45096e,_0x17e82d){_0x45096e=_0x45096e-0x0;var _0xba1fa3=_0x9579[_0x45096e];return _0xba1fa3;};'use strict';var Sequelize=require(_0x9957('0x0'));module[_0x9957('0x1')]={'uniqueid':{'type':Sequelize[_0x9957('0x2')]},'body':{'type':Sequelize['TEXT'](_0x9957('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0x9957('0x4')]('in',_0x9957('0x5')),'defaultValue':_0x9957('0x5'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index b4b5fc2..03986d9 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 _0xa8a1=['destroy','name','send','index','SquareMessage','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','nolimit','order','sort','where','pick','filters','filter','merge','map','VIRTUAL','options','findAll','rows','show','params','length','includeAll','include','find','catch','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','then'];(function(_0x4d79bc,_0x32c905){var _0x4b4760=function(_0x212302){while(--_0x212302){_0x4d79bc['push'](_0x4d79bc['shift']());}};_0x4b4760(++_0x32c905);}(_0xa8a1,0x6d));var _0x1a8a=function(_0x43054d,_0x1ae4be){_0x43054d=_0x43054d-0x0;var _0x3e4770=_0xa8a1[_0x43054d];return _0x3e4770;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1a8a('0x0'));var rimraf=require(_0x1a8a('0x1'));var zipdir=require(_0x1a8a('0x2'));var jsonpatch=require(_0x1a8a('0x3'));var rp=require(_0x1a8a('0x4'));var moment=require('moment');var BPromise=require(_0x1a8a('0x5'));var Mustache=require(_0x1a8a('0x6'));var util=require(_0x1a8a('0x7'));var path=require('path');var sox=require(_0x1a8a('0x8'));var csv=require('to-csv');var ejs=require(_0x1a8a('0x9'));var fs=require('fs');var _=require(_0x1a8a('0xa'));var squel=require(_0x1a8a('0xb'));var crypto=require(_0x1a8a('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1a8a('0xd'));var toCsv=require(_0x1a8a('0xe'));var querystring=require(_0x1a8a('0xf'));var Papa=require('papaparse');var Redis=require(_0x1a8a('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x1a8a('0x11'));var hardwareService=require(_0x1a8a('0x12'));var logger=require(_0x1a8a('0x13'))('api');var utils=require(_0x1a8a('0x14'));var config=require(_0x1a8a('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2b8e15,_0x7b9d9b){_0x7b9d9b=_0x7b9d9b||0xcc;return function(_0x23db09){if(_0x23db09){return _0x2b8e15[_0x1a8a('0x16')](_0x7b9d9b);}return _0x2b8e15[_0x1a8a('0x17')](_0x7b9d9b)[_0x1a8a('0x18')]();};}function respondWithResult(_0x3eebe4,_0x340c40){_0x340c40=_0x340c40||0xc8;return function(_0x3cc563){if(_0x3cc563){return _0x3eebe4['status'](_0x340c40)[_0x1a8a('0x19')](_0x3cc563);}};}function respondWithFilteredResult(_0x91efe2,_0x5f03ad){return function(_0x23c5af){if(_0x23c5af){var _0x493c0e=_0x23c5af[_0x1a8a('0x1a')],_0x1fc5d4=_0x5f03ad[_0x1a8a('0x1b')],_0x4e5923=_0x5f03ad['offset']+_0x5f03ad[_0x1a8a('0x1c')],_0xa8bb0f;if(_0x4e5923>=_0x493c0e){_0x4e5923=_0x493c0e;_0xa8bb0f=0xc8;}else{_0xa8bb0f=0xce;}_0x91efe2[_0x1a8a('0x17')](_0xa8bb0f);return _0x91efe2[_0x1a8a('0x1d')](_0x1a8a('0x1e'),_0x1fc5d4+'-'+_0x4e5923+'/'+_0x493c0e)['json'](_0x23c5af);}return null;};}function patchUpdates(_0x3e8358){return function(_0x23338e){try{jsonpatch['apply'](_0x23338e,_0x3e8358,!![]);}catch(_0xdbec1c){return BPromise[_0x1a8a('0x1f')](_0xdbec1c);}return _0x23338e['save']();};}function saveUpdates(_0x122095,_0x4ad9e0){return function(_0x327f8f){if(_0x327f8f){return _0x327f8f['update'](_0x122095)[_0x1a8a('0x20')](function(_0x1a98bf){return _0x1a98bf;});}return null;};}function removeEntity(_0x4bfbf8,_0x56d6b9){return function(_0x1d5e72){if(_0x1d5e72){return _0x1d5e72[_0x1a8a('0x21')]()[_0x1a8a('0x20')](function(){_0x4bfbf8[_0x1a8a('0x17')](0xcc)[_0x1a8a('0x18')]();});}};}function handleEntityNotFound(_0x248d40,_0xac22f1){return function(_0xeda348){if(!_0xeda348){_0x248d40['sendStatus'](0x194);}return _0xeda348;};}function handleError(_0x49cf3c,_0x25974e){_0x25974e=_0x25974e||0x1f4;return function(_0x289193){logger['error'](_0x289193['stack']);if(_0x289193[_0x1a8a('0x22')]){delete _0x289193[_0x1a8a('0x22')];}_0x49cf3c[_0x1a8a('0x17')](_0x25974e)[_0x1a8a('0x23')](_0x289193);};}exports[_0x1a8a('0x24')]=function(_0x1dc93b,_0x5be6d4){var _0x30f872={},_0x1c18a1={},_0xe6ec02={'count':0x0,'rows':[]};var _0x2fdc1f=_['map'](db[_0x1a8a('0x25')][_0x1a8a('0x26')],function(_0xa54710){return{'name':_0xa54710[_0x1a8a('0x27')],'type':_0xa54710[_0x1a8a('0x28')][_0x1a8a('0x29')]};});_0x1c18a1['model']=_['map'](_0x2fdc1f,_0x1a8a('0x22'));_0x1c18a1[_0x1a8a('0x2a')]=_[_0x1a8a('0x2b')](_0x1dc93b[_0x1a8a('0x2a')]);_0x1c18a1['filters']=_[_0x1a8a('0x2c')](_0x1c18a1[_0x1a8a('0x2d')],_0x1c18a1['query']);_0x30f872[_0x1a8a('0x2e')]=_[_0x1a8a('0x2c')](_0x1c18a1[_0x1a8a('0x2d')],qs[_0x1a8a('0x2f')](_0x1dc93b[_0x1a8a('0x2a')]['fields']));_0x30f872[_0x1a8a('0x2e')]=_0x30f872[_0x1a8a('0x2e')]['length']?_0x30f872[_0x1a8a('0x2e')]:_0x1c18a1[_0x1a8a('0x2d')];if(!_0x1dc93b[_0x1a8a('0x2a')]['hasOwnProperty'](_0x1a8a('0x30'))){_0x30f872[_0x1a8a('0x1c')]=qs['limit'](_0x1dc93b[_0x1a8a('0x2a')]['limit']);_0x30f872['offset']=qs['offset'](_0x1dc93b[_0x1a8a('0x2a')][_0x1a8a('0x1b')]);}_0x30f872[_0x1a8a('0x31')]=qs['sort'](_0x1dc93b['query'][_0x1a8a('0x32')]);_0x30f872[_0x1a8a('0x33')]=qs['filters'](_[_0x1a8a('0x34')](_0x1dc93b['query'],_0x1c18a1[_0x1a8a('0x35')]));if(_0x1dc93b[_0x1a8a('0x2a')][_0x1a8a('0x36')]){_0x30f872[_0x1a8a('0x33')]=_[_0x1a8a('0x37')](_0x30f872[_0x1a8a('0x33')],{'$or':_[_0x1a8a('0x38')](_0x2fdc1f,function(_0x18c23b){if(_0x18c23b['type']!==_0x1a8a('0x39')){var _0xf9db05={};_0xf9db05[_0x18c23b[_0x1a8a('0x22')]]={'$like':'%'+_0x1dc93b['query']['filter']+'%'};return _0xf9db05;}})});}_0x30f872=_[_0x1a8a('0x37')]({},_0x30f872,_0x1dc93b[_0x1a8a('0x3a')]);var _0xd5f1b={'where':_0x30f872['where']};return db[_0x1a8a('0x25')][_0x1a8a('0x1a')](_0xd5f1b)[_0x1a8a('0x20')](function(_0x3aa918){_0xe6ec02[_0x1a8a('0x1a')]=_0x3aa918;if(_0x1dc93b[_0x1a8a('0x2a')]['includeAll']){_0x30f872['include']=[{'all':!![]}];}return db[_0x1a8a('0x25')][_0x1a8a('0x3b')](_0x30f872);})[_0x1a8a('0x20')](function(_0x5e3bb2){_0xe6ec02[_0x1a8a('0x3c')]=_0x5e3bb2;return _0xe6ec02;})['then'](respondWithFilteredResult(_0x5be6d4,_0x30f872))['catch'](handleError(_0x5be6d4,null));};exports[_0x1a8a('0x3d')]=function(_0x51d942,_0x1c1cc5){var _0x125316={'raw':!![],'where':{'id':_0x51d942[_0x1a8a('0x3e')]['id']}},_0x40dd4c={};_0x40dd4c[_0x1a8a('0x2d')]=_[_0x1a8a('0x2b')](db[_0x1a8a('0x25')]['rawAttributes']);_0x40dd4c['query']=_[_0x1a8a('0x2b')](_0x51d942['query']);_0x40dd4c[_0x1a8a('0x35')]=_[_0x1a8a('0x2c')](_0x40dd4c[_0x1a8a('0x2d')],_0x40dd4c['query']);_0x125316[_0x1a8a('0x2e')]=_[_0x1a8a('0x2c')](_0x40dd4c[_0x1a8a('0x2d')],qs[_0x1a8a('0x2f')](_0x51d942[_0x1a8a('0x2a')][_0x1a8a('0x2f')]));_0x125316[_0x1a8a('0x2e')]=_0x125316[_0x1a8a('0x2e')][_0x1a8a('0x3f')]?_0x125316[_0x1a8a('0x2e')]:_0x40dd4c['model'];if(_0x51d942[_0x1a8a('0x2a')][_0x1a8a('0x40')]){_0x125316[_0x1a8a('0x41')]=[{'all':!![]}];}_0x125316=_[_0x1a8a('0x37')]({},_0x125316,_0x51d942[_0x1a8a('0x3a')]);return db['SquareMessage'][_0x1a8a('0x42')](_0x125316)[_0x1a8a('0x20')](handleEntityNotFound(_0x1c1cc5,null))[_0x1a8a('0x20')](respondWithResult(_0x1c1cc5,null))[_0x1a8a('0x43')](handleError(_0x1c1cc5,null));};exports[_0x1a8a('0x44')]=function(_0x5d7b0a,_0x4be0f2){return db[_0x1a8a('0x25')][_0x1a8a('0x44')](_0x5d7b0a[_0x1a8a('0x45')],{})[_0x1a8a('0x20')](respondWithResult(_0x4be0f2,0xc9))['catch'](handleError(_0x4be0f2,null));};exports[_0x1a8a('0x46')]=function(_0x78404e,_0x3738b3){if(_0x78404e[_0x1a8a('0x45')]['id']){delete _0x78404e['body']['id'];}return db[_0x1a8a('0x25')][_0x1a8a('0x42')]({'where':{'id':_0x78404e[_0x1a8a('0x3e')]['id']}})[_0x1a8a('0x20')](handleEntityNotFound(_0x3738b3,null))[_0x1a8a('0x20')](saveUpdates(_0x78404e[_0x1a8a('0x45')],null))[_0x1a8a('0x20')](respondWithResult(_0x3738b3,null))[_0x1a8a('0x43')](handleError(_0x3738b3,null));};exports[_0x1a8a('0x21')]=function(_0x4fa524,_0x4053c1){return db[_0x1a8a('0x25')][_0x1a8a('0x42')]({'where':{'id':_0x4fa524[_0x1a8a('0x3e')]['id']}})[_0x1a8a('0x20')](handleEntityNotFound(_0x4053c1,null))[_0x1a8a('0x20')](removeEntity(_0x4053c1,null))[_0x1a8a('0x43')](handleError(_0x4053c1,null));}; \ No newline at end of file +var _0xdceb=['desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','stack','name','send','index','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','sort','where','filters','pick','merge','VIRTUAL','filter','SquareMessage','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','body','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce'];(function(_0x393da7,_0x4af9fc){var _0x3063f6=function(_0x1d8a93){while(--_0x1d8a93){_0x393da7['push'](_0x393da7['shift']());}};_0x3063f6(++_0x4af9fc);}(_0xdceb,0x160));var _0xbdce=function(_0x259246,_0x24dbbc){_0x259246=_0x259246-0x0;var _0x4eef16=_0xdceb[_0x259246];return _0x4eef16;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbdce('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbdce('0x1'));var jsonpatch=require(_0xbdce('0x2'));var rp=require(_0xbdce('0x3'));var moment=require('moment');var BPromise=require(_0xbdce('0x4'));var Mustache=require(_0xbdce('0x5'));var util=require('util');var path=require(_0xbdce('0x6'));var sox=require(_0xbdce('0x7'));var csv=require(_0xbdce('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbdce('0x9'));var squel=require(_0xbdce('0xa'));var crypto=require(_0xbdce('0xb'));var jsforce=require(_0xbdce('0xc'));var deskjs=require(_0xbdce('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbdce('0xe'));var Papa=require(_0xbdce('0xf'));var Redis=require(_0xbdce('0x10'));var authService=require(_0xbdce('0x11'));var qs=require(_0xbdce('0x12'));var as=require(_0xbdce('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xbdce('0x14'))(_0xbdce('0x15'));var utils=require(_0xbdce('0x16'));var config=require('../../config/environment');var db=require(_0xbdce('0x17'))['db'];function respondWithStatusCode(_0x44906b,_0x2d1810){_0x2d1810=_0x2d1810||0xcc;return function(_0x2bb083){if(_0x2bb083){return _0x44906b[_0xbdce('0x18')](_0x2d1810);}return _0x44906b[_0xbdce('0x19')](_0x2d1810)[_0xbdce('0x1a')]();};}function respondWithResult(_0x6f097d,_0x516deb){_0x516deb=_0x516deb||0xc8;return function(_0x99bd75){if(_0x99bd75){return _0x6f097d[_0xbdce('0x19')](_0x516deb)[_0xbdce('0x1b')](_0x99bd75);}};}function respondWithFilteredResult(_0x37388b,_0x451494){return function(_0x80dff2){if(_0x80dff2){var _0x2603d9=_0x80dff2[_0xbdce('0x1c')],_0x38484e=_0x451494[_0xbdce('0x1d')],_0x6fb06e=_0x451494[_0xbdce('0x1d')]+_0x451494['limit'],_0xe76f1a;if(_0x6fb06e>=_0x2603d9){_0x6fb06e=_0x2603d9;_0xe76f1a=0xc8;}else{_0xe76f1a=0xce;}_0x37388b[_0xbdce('0x19')](_0xe76f1a);return _0x37388b[_0xbdce('0x1e')](_0xbdce('0x1f'),_0x38484e+'-'+_0x6fb06e+'/'+_0x2603d9)[_0xbdce('0x1b')](_0x80dff2);}return null;};}function patchUpdates(_0xdce605){return function(_0x1b28ae){try{jsonpatch[_0xbdce('0x20')](_0x1b28ae,_0xdce605,!![]);}catch(_0x34d6a8){return BPromise['reject'](_0x34d6a8);}return _0x1b28ae[_0xbdce('0x21')]();};}function saveUpdates(_0x25ec3f,_0x1563e2){return function(_0x1322ac){if(_0x1322ac){return _0x1322ac[_0xbdce('0x22')](_0x25ec3f)[_0xbdce('0x23')](function(_0x1e117c){return _0x1e117c;});}return null;};}function removeEntity(_0x11e920,_0x435162){return function(_0x33cbae){if(_0x33cbae){return _0x33cbae[_0xbdce('0x24')]()[_0xbdce('0x23')](function(){_0x11e920[_0xbdce('0x19')](0xcc)[_0xbdce('0x1a')]();});}};}function handleEntityNotFound(_0x4499e0,_0x18f3e4){return function(_0x55016c){if(!_0x55016c){_0x4499e0['sendStatus'](0x194);}return _0x55016c;};}function handleError(_0x43f1a9,_0xeacdfd){_0xeacdfd=_0xeacdfd||0x1f4;return function(_0x5adc0c){logger['error'](_0x5adc0c[_0xbdce('0x25')]);if(_0x5adc0c[_0xbdce('0x26')]){delete _0x5adc0c[_0xbdce('0x26')];}_0x43f1a9[_0xbdce('0x19')](_0xeacdfd)[_0xbdce('0x27')](_0x5adc0c);};}exports[_0xbdce('0x28')]=function(_0x2bba03,_0x269d17){var _0x506051={},_0x452551={},_0x5e8a28={'count':0x0,'rows':[]};var _0xe8833b=_['map'](db['SquareMessage']['rawAttributes'],function(_0x37286c){return{'name':_0x37286c[_0xbdce('0x29')],'type':_0x37286c[_0xbdce('0x2a')][_0xbdce('0x2b')]};});_0x452551[_0xbdce('0x2c')]=_[_0xbdce('0x2d')](_0xe8833b,'name');_0x452551[_0xbdce('0x2e')]=_[_0xbdce('0x2f')](_0x2bba03[_0xbdce('0x2e')]);_0x452551['filters']=_[_0xbdce('0x30')](_0x452551[_0xbdce('0x2c')],_0x452551[_0xbdce('0x2e')]);_0x506051[_0xbdce('0x31')]=_[_0xbdce('0x30')](_0x452551[_0xbdce('0x2c')],qs[_0xbdce('0x32')](_0x2bba03[_0xbdce('0x2e')][_0xbdce('0x32')]));_0x506051[_0xbdce('0x31')]=_0x506051[_0xbdce('0x31')][_0xbdce('0x33')]?_0x506051['attributes']:_0x452551[_0xbdce('0x2c')];if(!_0x2bba03['query'][_0xbdce('0x34')]('nolimit')){_0x506051['limit']=qs[_0xbdce('0x35')](_0x2bba03[_0xbdce('0x2e')]['limit']);_0x506051[_0xbdce('0x1d')]=qs['offset'](_0x2bba03['query']['offset']);}_0x506051['order']=qs['sort'](_0x2bba03[_0xbdce('0x2e')][_0xbdce('0x36')]);_0x506051[_0xbdce('0x37')]=qs[_0xbdce('0x38')](_[_0xbdce('0x39')](_0x2bba03[_0xbdce('0x2e')],_0x452551[_0xbdce('0x38')]));if(_0x2bba03[_0xbdce('0x2e')]['filter']){_0x506051[_0xbdce('0x37')]=_[_0xbdce('0x3a')](_0x506051[_0xbdce('0x37')],{'$or':_[_0xbdce('0x2d')](_0xe8833b,function(_0x33405e){if(_0x33405e[_0xbdce('0x2a')]!==_0xbdce('0x3b')){var _0x4570b6={};_0x4570b6[_0x33405e[_0xbdce('0x26')]]={'$like':'%'+_0x2bba03[_0xbdce('0x2e')][_0xbdce('0x3c')]+'%'};return _0x4570b6;}})});}_0x506051=_[_0xbdce('0x3a')]({},_0x506051,_0x2bba03['options']);var _0x176e2e={'where':_0x506051[_0xbdce('0x37')]};return db[_0xbdce('0x3d')][_0xbdce('0x1c')](_0x176e2e)['then'](function(_0x3fc913){_0x5e8a28[_0xbdce('0x1c')]=_0x3fc913;if(_0x2bba03['query'][_0xbdce('0x3e')]){_0x506051[_0xbdce('0x3f')]=[{'all':!![]}];}return db[_0xbdce('0x3d')][_0xbdce('0x40')](_0x506051);})[_0xbdce('0x23')](function(_0x169c5f){_0x5e8a28[_0xbdce('0x41')]=_0x169c5f;return _0x5e8a28;})[_0xbdce('0x23')](respondWithFilteredResult(_0x269d17,_0x506051))[_0xbdce('0x42')](handleError(_0x269d17,null));};exports[_0xbdce('0x43')]=function(_0x1633be,_0x4da916){var _0x24088d={'raw':!![],'where':{'id':_0x1633be[_0xbdce('0x44')]['id']}},_0x45bfa7={};_0x45bfa7['model']=_[_0xbdce('0x2f')](db[_0xbdce('0x3d')][_0xbdce('0x45')]);_0x45bfa7[_0xbdce('0x2e')]=_[_0xbdce('0x2f')](_0x1633be[_0xbdce('0x2e')]);_0x45bfa7[_0xbdce('0x38')]=_['intersection'](_0x45bfa7['model'],_0x45bfa7[_0xbdce('0x2e')]);_0x24088d[_0xbdce('0x31')]=_['intersection'](_0x45bfa7[_0xbdce('0x2c')],qs[_0xbdce('0x32')](_0x1633be[_0xbdce('0x2e')][_0xbdce('0x32')]));_0x24088d[_0xbdce('0x31')]=_0x24088d[_0xbdce('0x31')][_0xbdce('0x33')]?_0x24088d[_0xbdce('0x31')]:_0x45bfa7[_0xbdce('0x2c')];if(_0x1633be[_0xbdce('0x2e')][_0xbdce('0x3e')]){_0x24088d[_0xbdce('0x3f')]=[{'all':!![]}];}_0x24088d=_[_0xbdce('0x3a')]({},_0x24088d,_0x1633be[_0xbdce('0x46')]);return db[_0xbdce('0x3d')][_0xbdce('0x47')](_0x24088d)[_0xbdce('0x23')](handleEntityNotFound(_0x4da916,null))[_0xbdce('0x23')](respondWithResult(_0x4da916,null))[_0xbdce('0x42')](handleError(_0x4da916,null));};exports['create']=function(_0x33d60f,_0xdba537){return db[_0xbdce('0x3d')]['create'](_0x33d60f[_0xbdce('0x48')],{})[_0xbdce('0x23')](respondWithResult(_0xdba537,0xc9))[_0xbdce('0x42')](handleError(_0xdba537,null));};exports['update']=function(_0x577ff4,_0x5b669d){if(_0x577ff4[_0xbdce('0x48')]['id']){delete _0x577ff4[_0xbdce('0x48')]['id'];}return db[_0xbdce('0x3d')]['find']({'where':{'id':_0x577ff4['params']['id']}})[_0xbdce('0x23')](handleEntityNotFound(_0x5b669d,null))['then'](saveUpdates(_0x577ff4[_0xbdce('0x48')],null))[_0xbdce('0x23')](respondWithResult(_0x5b669d,null))['catch'](handleError(_0x5b669d,null));};exports['destroy']=function(_0x382f8e,_0x226437){return db['SquareMessage'][_0xbdce('0x47')]({'where':{'id':_0x382f8e[_0xbdce('0x44')]['id']}})[_0xbdce('0x23')](handleEntityNotFound(_0x226437,null))[_0xbdce('0x23')](removeEntity(_0x226437,null))[_0xbdce('0x42')](handleError(_0x226437,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index 79dbf75..6db0bd3 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 _0xebad=['../../config/environment','define','SquareMessage','square_messages','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2f9f28,_0x5c3a96){var _0x35d424=function(_0x12b490){while(--_0x12b490){_0x2f9f28['push'](_0x2f9f28['shift']());}};_0x35d424(++_0x5c3a96);}(_0xebad,0x10c));var _0xdeba=function(_0x5c9063,_0x3ee306){_0x5c9063=_0x5c9063-0x0;var _0x18cb2a=_0xebad[_0x5c9063];return _0x18cb2a;};'use strict';var _=require(_0xdeba('0x0'));var util=require(_0xdeba('0x1'));var logger=require('../../config/logger')(_0xdeba('0x2'));var moment=require(_0xdeba('0x3'));var BPromise=require(_0xdeba('0x4'));var rp=require(_0xdeba('0x5'));var fs=require('fs');var path=require(_0xdeba('0x6'));var rimraf=require(_0xdeba('0x7'));var config=require(_0xdeba('0x8'));var attributes=require('./squareMessage.attributes');module['exports']=function(_0x4442ac,_0x584f7f){return _0x4442ac[_0xdeba('0x9')](_0xdeba('0xa'),attributes,{'tableName':_0xdeba('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x07ce=['util','moment','bluebird','request-promise','path','../../config/environment','./squareMessage.attributes','exports','SquareMessage'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x07ce,0xa2));var _0xe07c=function(_0x4c04fa,_0x5b3a87){_0x4c04fa=_0x4c04fa-0x0;var _0x50df77=_0x07ce[_0x4c04fa];return _0x50df77;};'use strict';var _=require('lodash');var util=require(_0xe07c('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xe07c('0x1'));var BPromise=require(_0xe07c('0x2'));var rp=require(_0xe07c('0x3'));var fs=require('fs');var path=require(_0xe07c('0x4'));var rimraf=require('rimraf');var config=require(_0xe07c('0x5'));var attributes=require(_0xe07c('0x6'));module[_0xe07c('0x7')]=function(_0x3f38d7,_0xf5b6aa){return _0x3f38d7['define'](_0xe07c('0x8'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 21fa4da..323324d 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 _0x553a=['body','options','catch','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise','then','info','debug','request\x20sent','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','CreateSquareMessage','create'];(function(_0x52ed69,_0x459639){var _0x1cac9f=function(_0x2f90ee){while(--_0x2f90ee){_0x52ed69['push'](_0x52ed69['shift']());}};_0x1cac9f(++_0x459639);}(_0x553a,0x192));var _0xa553=function(_0x317b63,_0x2acf92){_0x317b63=_0x317b63-0x0;var _0x36a2e2=_0x553a[_0x317b63];return _0x36a2e2;};'use strict';var _=require('lodash');var util=require(_0xa553('0x0'));var moment=require('moment');var BPromise=require(_0xa553('0x1'));var rs=require(_0xa553('0x2'));var fs=require('fs');var Redis=require(_0xa553('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa553('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa553('0x5'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x18da5d,_0x3da5c7,_0xaae97){return new BPromise(function(_0x48f7d2,_0x25bbb7){return client['request'](_0x18da5d,_0xaae97)[_0xa553('0x6')](function(_0xf6e0db){logger[_0xa553('0x7')]('SquareMessage,\x20%s,\x20%s',_0x3da5c7,'request\x20sent');logger[_0xa553('0x8')]('SquareMessage,\x20%s,\x20%s,\x20%s',_0x3da5c7,_0xa553('0x9'),JSON[_0xa553('0xa')](_0xf6e0db));if(_0xf6e0db[_0xa553('0xb')]){if(_0xf6e0db['error'][_0xa553('0xc')]===0x1f4){logger[_0xa553('0xb')](_0xa553('0xd'),_0x3da5c7,_0xf6e0db['error'][_0xa553('0xe')]);return _0x25bbb7(_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);}logger['error']('SquareMessage,\x20%s,\x20%s',_0x3da5c7,_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);return _0x48f7d2(_0xf6e0db[_0xa553('0xb')][_0xa553('0xe')]);}else{logger['info'](_0xa553('0xd'),_0x3da5c7,'request\x20sent');_0x48f7d2(_0xf6e0db[_0xa553('0xf')]['message']);}})['catch'](function(_0x1d0f4e){logger['error'](_0xa553('0xd'),_0x3da5c7,_0x1d0f4e);_0x25bbb7(_0x1d0f4e);});});}exports[_0xa553('0x10')]=function(_0x30d91e){var _0x54a9f9=this;return new Promise(function(_0x102ef5,_0x7331f3){return db['SquareMessage'][_0xa553('0x11')](_0x30d91e[_0xa553('0x12')],{'raw':_0x30d91e['options']?_0x30d91e[_0xa553('0x13')]['raw']===undefined?!![]:![]:!![]})[_0xa553('0x6')](function(_0x18af22){logger[_0xa553('0x7')](_0xa553('0x10'),_0x30d91e);logger['debug'](_0xa553('0x10'),_0x30d91e,JSON[_0xa553('0xa')](_0x18af22));_0x102ef5(_0x18af22);})[_0xa553('0x14')](function(_0x4dc781){logger[_0xa553('0xb')]('CreateSquareMessage',_0x4dc781['message'],_0x30d91e);_0x7331f3(_0x54a9f9[_0xa553('0xb')](0x1f4,_0x4dc781[_0xa553('0xe')]));});});}; \ No newline at end of file +var _0x8506=['ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','SquareMessage,\x20%s,\x20%s','request\x20sent','debug','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','SquareMessage','options','raw','info','stringify','util','bluebird'];(function(_0x5e1855,_0x17161e){var _0x4faf68=function(_0x2bfb27){while(--_0x2bfb27){_0x5e1855['push'](_0x5e1855['shift']());}};_0x4faf68(++_0x17161e);}(_0x8506,0xe8));var _0x6850=function(_0x433a0f,_0x34771b){_0x433a0f=_0x433a0f-0x0;var _0x31049b=_0x8506[_0x433a0f];return _0x31049b;};'use strict';var _=require('lodash');var util=require(_0x6850('0x0'));var moment=require('moment');var BPromise=require(_0x6850('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6850('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x6850('0x3'));var logger=require(_0x6850('0x4'))(_0x6850('0x5'));var config=require('../../config/environment');var jayson=require(_0x6850('0x6'));var client=jayson[_0x6850('0x7')][_0x6850('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3c301f,_0x5858ca,_0x51c0ad){return new BPromise(function(_0x5466ee,_0x117706){return client[_0x6850('0x9')](_0x3c301f,_0x51c0ad)[_0x6850('0xa')](function(_0x589417){logger['info'](_0x6850('0xb'),_0x5858ca,_0x6850('0xc'));logger[_0x6850('0xd')](_0x6850('0xe'),_0x5858ca,_0x6850('0xc'),JSON['stringify'](_0x589417));if(_0x589417[_0x6850('0xf')]){if(_0x589417[_0x6850('0xf')][_0x6850('0x10')]===0x1f4){logger[_0x6850('0xf')](_0x6850('0xb'),_0x5858ca,_0x589417[_0x6850('0xf')]['message']);return _0x117706(_0x589417[_0x6850('0xf')][_0x6850('0x11')]);}logger[_0x6850('0xf')](_0x6850('0xb'),_0x5858ca,_0x589417[_0x6850('0xf')][_0x6850('0x11')]);return _0x5466ee(_0x589417['error'][_0x6850('0x11')]);}else{logger['info'](_0x6850('0xb'),_0x5858ca,_0x6850('0xc'));_0x5466ee(_0x589417[_0x6850('0x12')][_0x6850('0x11')]);}})[_0x6850('0x13')](function(_0x32b9d3){logger[_0x6850('0xf')](_0x6850('0xb'),_0x5858ca,_0x32b9d3);_0x117706(_0x32b9d3);});});}exports[_0x6850('0x14')]=function(_0x441f79){var _0xeff8de=this;return new Promise(function(_0x145dbb,_0x44a5e4){return db[_0x6850('0x15')]['create'](_0x441f79['body'],{'raw':_0x441f79[_0x6850('0x16')]?_0x441f79[_0x6850('0x16')][_0x6850('0x17')]===undefined?!![]:![]:!![]})[_0x6850('0xa')](function(_0x12a15d){logger[_0x6850('0x18')]('CreateSquareMessage',_0x441f79);logger[_0x6850('0xd')](_0x6850('0x14'),_0x441f79,JSON[_0x6850('0x19')](_0x12a15d));_0x145dbb(_0x12a15d);})[_0x6850('0x13')](function(_0x2978a1){logger[_0x6850('0xf')](_0x6850('0x14'),_0x2978a1[_0x6850('0x11')],_0x441f79);_0x44a5e4(_0xeff8de[_0x6850('0xf')](0x1f4,_0x2978a1[_0x6850('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 9e1fd25..46cce19 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 _0x665a=['update','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','/:id','show','/:id/test','15s','test','post','create','put'];(function(_0x1f4f4f,_0x2ddd8e){var _0x450169=function(_0x5679cc){while(--_0x5679cc){_0x1f4f4f['push'](_0x1f4f4f['shift']());}};_0x450169(++_0x2ddd8e);}(_0x665a,0xbc));var _0xa665=function(_0xd4edf8,_0x3b7119){_0xd4edf8=_0xd4edf8-0x0;var _0x157cc3=_0x665a[_0xd4edf8];return _0x157cc3;};'use strict';var multer=require('multer');var util=require(_0xa665('0x0'));var path=require('path');var timeout=require(_0xa665('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xa665('0x2'));var interaction=require(_0xa665('0x3'));var config=require(_0xa665('0x4'));var controller=require(_0xa665('0x5'));router[_0xa665('0x6')]('/',auth[_0xa665('0x7')](),controller['index']);router[_0xa665('0x6')](_0xa665('0x8'),auth[_0xa665('0x7')](),controller[_0xa665('0x9')]);router[_0xa665('0x6')](_0xa665('0xa'),auth['isAuthenticated'](),timeout(_0xa665('0xb')),controller[_0xa665('0xc')]);router[_0xa665('0xd')]('/',auth['isAuthenticated'](),controller[_0xa665('0xe')]);router[_0xa665('0xf')](_0xa665('0x8'),auth['isAuthenticated'](),controller[_0xa665('0x10')]);router['delete'](_0xa665('0x8'),auth[_0xa665('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1dc2=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','15s','test','post','put','update','delete','destroy'];(function(_0x597537,_0x124ac4){var _0x4bb21=function(_0x3c0edc){while(--_0x3c0edc){_0x597537['push'](_0x597537['shift']());}};_0x4bb21(++_0x124ac4);}(_0x1dc2,0xb0));var _0x21dc=function(_0x2ae55d,_0x2b3319){_0x2ae55d=_0x2ae55d-0x0;var _0x50c4e7=_0x1dc2[_0x2ae55d];return _0x50c4e7;};'use strict';var multer=require(_0x21dc('0x0'));var util=require(_0x21dc('0x1'));var path=require(_0x21dc('0x2'));var timeout=require(_0x21dc('0x3'));var express=require('express');var router=express[_0x21dc('0x4')]();var auth=require(_0x21dc('0x5'));var interaction=require(_0x21dc('0x6'));var config=require(_0x21dc('0x7'));var controller=require(_0x21dc('0x8'));router[_0x21dc('0x9')]('/',auth[_0x21dc('0xa')](),controller[_0x21dc('0xb')]);router[_0x21dc('0x9')](_0x21dc('0xc'),auth['isAuthenticated'](),controller[_0x21dc('0xd')]);router[_0x21dc('0x9')](_0x21dc('0xe'),auth[_0x21dc('0xa')](),timeout(_0x21dc('0xf')),controller[_0x21dc('0x10')]);router[_0x21dc('0x11')]('/',auth[_0x21dc('0xa')](),controller['create']);router[_0x21dc('0x12')](_0x21dc('0xc'),auth[_0x21dc('0xa')](),controller[_0x21dc('0x13')]);router[_0x21dc('0x14')](_0x21dc('0xc'),auth['isAuthenticated'](),controller[_0x21dc('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 260fbd7..2c8a2ad 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 _0x8f99=['sequelize','exports','STRING','name'];(function(_0x338561,_0x503451){var _0x11d1bf=function(_0x306cfb){while(--_0x306cfb){_0x338561['push'](_0x338561['shift']());}};_0x11d1bf(++_0x503451);}(_0x8f99,0xa4));var _0x98f9=function(_0x3c33f6,_0x38df08){_0x3c33f6=_0x3c33f6-0x0;var _0x3f9169=_0x8f99[_0x3c33f6];return _0x3f9169;};'use strict';var Sequelize=require(_0x98f9('0x0'));module[_0x98f9('0x1')]={'name':{'type':Sequelize[_0x98f9('0x2')],'unique':_0x98f9('0x3'),'allowNull':![]},'dsn':{'type':Sequelize[_0x98f9('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x614c=['name','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x614c,0x6d));var _0xc614=function(_0x26b80e,_0x5c9333){_0x26b80e=_0x26b80e-0x0;var _0x84a8a8=_0x614c[_0x26b80e];return _0x84a8a8;};'use strict';var Sequelize=require('sequelize');module[_0xc614('0x0')]={'name':{'type':Sequelize[_0xc614('0x1')],'unique':_0xc614('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0xc614('0x1')]},'description':{'type':Sequelize[_0xc614('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index cce717a..ff51d45 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 _0x5af9=['rows','catch','show','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','odbc','openSync','dsn','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','limit','set','Content-Range','json','apply','save','update','destroy','then','get','ODBC','UserProfileResource','error','name','index','map','SquareOdbc','rawAttributes','fieldName','type','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','filters','pick','where','merge','filter','options','count','include'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x5af9,0xbe));var _0x95af=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x5af9[_0x3f6bcf];return _0x1c5350;};'use strict';var pdf=require(_0x95af('0x0'));var emlformat=require(_0x95af('0x1'));var rimraf=require(_0x95af('0x2'));var zipdir=require(_0x95af('0x3'));var jsonpatch=require(_0x95af('0x4'));var rp=require('request-promise');var moment=require(_0x95af('0x5'));var BPromise=require(_0x95af('0x6'));var Mustache=require('mustache');var util=require(_0x95af('0x7'));var path=require(_0x95af('0x8'));var sox=require(_0x95af('0x9'));var csv=require(_0x95af('0xa'));var ejs=require(_0x95af('0xb'));var fs=require('fs');var _=require(_0x95af('0xc'));var squel=require(_0x95af('0xd'));var crypto=require(_0x95af('0xe'));var jsforce=require(_0x95af('0xf'));var deskjs=require(_0x95af('0x10'));var toCsv=require('to-csv');var querystring=require(_0x95af('0x11'));var Papa=require(_0x95af('0x12'));var Redis=require(_0x95af('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x95af('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x95af('0x15'));var utils=require(_0x95af('0x16'));var config=require(_0x95af('0x17'));var db=require(_0x95af('0x18'))['db'];function respondWithStatusCode(_0x527128,_0x279359){_0x279359=_0x279359||0xcc;return function(_0x4cfd43){if(_0x4cfd43){return _0x527128[_0x95af('0x19')](_0x279359);}return _0x527128['status'](_0x279359)[_0x95af('0x1a')]();};}function respondWithResult(_0x4b5742,_0xe8c3b2){_0xe8c3b2=_0xe8c3b2||0xc8;return function(_0x22fb59){if(_0x22fb59){return _0x4b5742[_0x95af('0x1b')](_0xe8c3b2)['json'](_0x22fb59);}};}function respondWithFilteredResult(_0x5176a6,_0x3fd02e){return function(_0x491a83){if(_0x491a83){var _0x58e558=_0x491a83['count'],_0x377960=_0x3fd02e['offset'],_0x37c030=_0x3fd02e['offset']+_0x3fd02e[_0x95af('0x1c')],_0x391176;if(_0x37c030>=_0x58e558){_0x37c030=_0x58e558;_0x391176=0xc8;}else{_0x391176=0xce;}_0x5176a6[_0x95af('0x1b')](_0x391176);return _0x5176a6[_0x95af('0x1d')](_0x95af('0x1e'),_0x377960+'-'+_0x37c030+'/'+_0x58e558)[_0x95af('0x1f')](_0x491a83);}return null;};}function patchUpdates(_0x4e741e){return function(_0xa61355){try{jsonpatch[_0x95af('0x20')](_0xa61355,_0x4e741e,!![]);}catch(_0x588d16){return BPromise['reject'](_0x588d16);}return _0xa61355[_0x95af('0x21')]();};}function saveUpdates(_0xc50372,_0x3e29b6){return function(_0x4220ca){if(_0x4220ca){return _0x4220ca[_0x95af('0x22')](_0xc50372)['then'](function(_0x3d83a1){return _0x3d83a1;});}return null;};}function removeEntity(_0x14f131,_0x4f8b9e){return function(_0x54bd44){if(_0x54bd44){return _0x54bd44[_0x95af('0x23')]()[_0x95af('0x24')](function(){var _0x2dc8a8=_0x54bd44[_0x95af('0x25')]({'plain':!![]});var _0x523e3f=_0x95af('0x26');return db[_0x95af('0x27')][_0x95af('0x23')]({'where':{'type':_0x523e3f,'resourceId':_0x2dc8a8['id']}})[_0x95af('0x24')](function(){return _0x54bd44;});})[_0x95af('0x24')](function(){_0x14f131[_0x95af('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x270e53,_0x28e454){return function(_0x5b2428){if(!_0x5b2428){_0x270e53['sendStatus'](0x194);}return _0x5b2428;};}function handleError(_0x271c6b,_0x13716e){_0x13716e=_0x13716e||0x1f4;return function(_0x44281d){logger[_0x95af('0x28')](_0x44281d['stack']);if(_0x44281d[_0x95af('0x29')]){delete _0x44281d['name'];}_0x271c6b[_0x95af('0x1b')](_0x13716e)['send'](_0x44281d);};}exports[_0x95af('0x2a')]=function(_0x519413,_0x4a39b0){var _0x33ec4b={},_0x4c6bb1={},_0x5244b9={'count':0x0,'rows':[]};var _0x22f40b=_[_0x95af('0x2b')](db[_0x95af('0x2c')][_0x95af('0x2d')],function(_0x414596){return{'name':_0x414596[_0x95af('0x2e')],'type':_0x414596[_0x95af('0x2f')][_0x95af('0x30')]};});_0x4c6bb1['model']=_[_0x95af('0x2b')](_0x22f40b,_0x95af('0x29'));_0x4c6bb1[_0x95af('0x31')]=_[_0x95af('0x32')](_0x519413['query']);_0x4c6bb1['filters']=_[_0x95af('0x33')](_0x4c6bb1[_0x95af('0x34')],_0x4c6bb1[_0x95af('0x31')]);_0x33ec4b['attributes']=_['intersection'](_0x4c6bb1['model'],qs[_0x95af('0x35')](_0x519413[_0x95af('0x31')][_0x95af('0x35')]));_0x33ec4b[_0x95af('0x36')]=_0x33ec4b[_0x95af('0x36')]['length']?_0x33ec4b['attributes']:_0x4c6bb1[_0x95af('0x34')];if(!_0x519413[_0x95af('0x31')][_0x95af('0x37')](_0x95af('0x38'))){_0x33ec4b[_0x95af('0x1c')]=qs['limit'](_0x519413['query'][_0x95af('0x1c')]);_0x33ec4b[_0x95af('0x39')]=qs[_0x95af('0x39')](_0x519413[_0x95af('0x31')][_0x95af('0x39')]);}_0x33ec4b[_0x95af('0x3a')]=qs[_0x95af('0x3b')](_0x519413[_0x95af('0x31')][_0x95af('0x3b')]);_0x33ec4b['where']=qs[_0x95af('0x3c')](_[_0x95af('0x3d')](_0x519413[_0x95af('0x31')],_0x4c6bb1[_0x95af('0x3c')]));if(_0x519413['query']['filter']){_0x33ec4b[_0x95af('0x3e')]=_[_0x95af('0x3f')](_0x33ec4b[_0x95af('0x3e')],{'$or':_[_0x95af('0x2b')](_0x22f40b,function(_0x139829){if(_0x139829['type']!=='VIRTUAL'){var _0x243f2b={};_0x243f2b[_0x139829['name']]={'$like':'%'+_0x519413[_0x95af('0x31')][_0x95af('0x40')]+'%'};return _0x243f2b;}})});}_0x33ec4b=_[_0x95af('0x3f')]({},_0x33ec4b,_0x519413[_0x95af('0x41')]);var _0xbf99ec={'where':_0x33ec4b['where']};return db[_0x95af('0x2c')][_0x95af('0x42')](_0xbf99ec)[_0x95af('0x24')](function(_0x140f16){_0x5244b9['count']=_0x140f16;if(_0x519413[_0x95af('0x31')]['includeAll']){_0x33ec4b[_0x95af('0x43')]=[{'all':!![]}];}return db[_0x95af('0x2c')]['findAll'](_0x33ec4b);})[_0x95af('0x24')](function(_0x1360a6){_0x5244b9[_0x95af('0x44')]=_0x1360a6;return _0x5244b9;})[_0x95af('0x24')](respondWithFilteredResult(_0x4a39b0,_0x33ec4b))[_0x95af('0x45')](handleError(_0x4a39b0,null));};exports[_0x95af('0x46')]=function(_0x54a300,_0x97e86){var _0x519e8d={'raw':!![],'where':{'id':_0x54a300['params']['id']}},_0x2fdbf7={};_0x2fdbf7['model']=_[_0x95af('0x32')](db[_0x95af('0x2c')][_0x95af('0x2d')]);_0x2fdbf7['query']=_[_0x95af('0x32')](_0x54a300['query']);_0x2fdbf7['filters']=_[_0x95af('0x33')](_0x2fdbf7[_0x95af('0x34')],_0x2fdbf7[_0x95af('0x31')]);_0x519e8d[_0x95af('0x36')]=_['intersection'](_0x2fdbf7['model'],qs[_0x95af('0x35')](_0x54a300[_0x95af('0x31')]['fields']));_0x519e8d['attributes']=_0x519e8d['attributes']['length']?_0x519e8d['attributes']:_0x2fdbf7[_0x95af('0x34')];if(_0x54a300[_0x95af('0x31')]['includeAll']){_0x519e8d[_0x95af('0x43')]=[{'all':!![]}];}_0x519e8d=_[_0x95af('0x3f')]({},_0x519e8d,_0x54a300[_0x95af('0x41')]);return db[_0x95af('0x2c')][_0x95af('0x47')](_0x519e8d)[_0x95af('0x24')](handleEntityNotFound(_0x97e86,null))[_0x95af('0x24')](respondWithResult(_0x97e86,null))[_0x95af('0x45')](handleError(_0x97e86,null));};exports[_0x95af('0x48')]=function(_0x12e433,_0x261947){return db[_0x95af('0x2c')]['create'](_0x12e433['body'],{})[_0x95af('0x24')](function(_0x42efb3){var _0x1a26e4=_0x12e433[_0x95af('0x49')][_0x95af('0x25')]({'plain':!![]});if(!_0x1a26e4)throw new Error(_0x95af('0x4a'));if(_0x1a26e4[_0x95af('0x4b')]===_0x95af('0x49')){var _0x28356e=_0x42efb3[_0x95af('0x25')]({'plain':!![]});var _0x42d2fb='ODBC';return db[_0x95af('0x4c')][_0x95af('0x47')]({'where':{'name':_0x42d2fb,'userProfileId':_0x1a26e4[_0x95af('0x4d')]},'raw':!![]})[_0x95af('0x24')](function(_0x30513c){if(_0x30513c&&_0x30513c[_0x95af('0x4e')]===0x0){return db[_0x95af('0x27')][_0x95af('0x48')]({'name':_0x28356e[_0x95af('0x29')],'resourceId':_0x28356e['id'],'type':_0x30513c[_0x95af('0x29')],'sectionId':_0x30513c['id']},{})[_0x95af('0x24')](function(){return _0x42efb3;});}else{return _0x42efb3;}})[_0x95af('0x45')](function(_0x5eccbe){logger[_0x95af('0x28')](_0x95af('0x4f'),_0x5eccbe);throw _0x5eccbe;});}return _0x42efb3;})[_0x95af('0x24')](respondWithResult(_0x261947,0xc9))['catch'](handleError(_0x261947,null));};exports[_0x95af('0x22')]=function(_0x138f00,_0x27378f){if(_0x138f00[_0x95af('0x50')]['id']){delete _0x138f00[_0x95af('0x50')]['id'];}return db[_0x95af('0x2c')][_0x95af('0x47')]({'where':{'id':_0x138f00[_0x95af('0x51')]['id']}})[_0x95af('0x24')](handleEntityNotFound(_0x27378f,null))[_0x95af('0x24')](saveUpdates(_0x138f00[_0x95af('0x50')],null))[_0x95af('0x24')](respondWithResult(_0x27378f,null))[_0x95af('0x45')](handleError(_0x27378f,null));};exports[_0x95af('0x23')]=function(_0x5574d8,_0xd6e22e){return db['SquareOdbc'][_0x95af('0x47')]({'where':{'id':_0x5574d8[_0x95af('0x51')]['id']}})[_0x95af('0x24')](handleEntityNotFound(_0xd6e22e,null))['then'](removeEntity(_0xd6e22e,null))['catch'](handleError(_0xd6e22e,null));};exports['test']=function(_0x139a59,_0x427fa2,_0x305add){var _0x2f2477;return db[_0x95af('0x2c')]['find']({'where':{'id':_0x139a59[_0x95af('0x51')]['id']},'attributes':['id','dsn']})['then'](handleEntityNotFound(_0x427fa2,null))['then'](function(_0x229cdc){if(_0x229cdc){var _0x33d4e=require(_0x95af('0x52'))();_0x33d4e[_0x95af('0x53')](_0x229cdc[_0x95af('0x54')]);_0x33d4e[_0x95af('0x55')]();return _0x229cdc;}})[_0x95af('0x24')](respondWithResult(_0x427fa2,null))[_0x95af('0x45')](handleError(_0x427fa2,null));}; \ No newline at end of file +var _0x4866=['test','dsn','odbc','openSync','closeSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','set','reject','save','update','then','destroy','ODBC','stack','name','SquareOdbc','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','sort','filter','merge','where','VIRTUAL','options','count','include','rows','show','params','includeAll','catch','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find'];(function(_0x4fe778,_0x54f502){var _0x2ae46b=function(_0x2d4463){while(--_0x2d4463){_0x4fe778['push'](_0x4fe778['shift']());}};_0x2ae46b(++_0x54f502);}(_0x4866,0x149));var _0x6486=function(_0x198fc6,_0x5eaee9){_0x198fc6=_0x198fc6-0x0;var _0x4376bb=_0x4866[_0x198fc6];return _0x4376bb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6486('0x0'));var rimraf=require(_0x6486('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6486('0x2'));var rp=require(_0x6486('0x3'));var moment=require(_0x6486('0x4'));var BPromise=require(_0x6486('0x5'));var Mustache=require(_0x6486('0x6'));var util=require(_0x6486('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x6486('0x8'));var ejs=require(_0x6486('0x9'));var fs=require('fs');var _=require(_0x6486('0xa'));var squel=require(_0x6486('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6486('0xc'));var toCsv=require(_0x6486('0x8'));var querystring=require(_0x6486('0xd'));var Papa=require(_0x6486('0xe'));var Redis=require(_0x6486('0xf'));var authService=require(_0x6486('0x10'));var qs=require(_0x6486('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6486('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x6486('0x13'));var config=require('../../config/environment');var db=require(_0x6486('0x14'))['db'];function respondWithStatusCode(_0x222a07,_0x12b8a7){_0x12b8a7=_0x12b8a7||0xcc;return function(_0x8a2283){if(_0x8a2283){return _0x222a07[_0x6486('0x15')](_0x12b8a7);}return _0x222a07[_0x6486('0x16')](_0x12b8a7)[_0x6486('0x17')]();};}function respondWithResult(_0x4b0cc4,_0x512523){_0x512523=_0x512523||0xc8;return function(_0x1f8373){if(_0x1f8373){return _0x4b0cc4[_0x6486('0x16')](_0x512523)[_0x6486('0x18')](_0x1f8373);}};}function respondWithFilteredResult(_0x28fd39,_0x439fd5){return function(_0x3f2087){if(_0x3f2087){var _0x439e04=_0x3f2087['count'],_0x486662=_0x439fd5[_0x6486('0x19')],_0x301428=_0x439fd5[_0x6486('0x19')]+_0x439fd5['limit'],_0x51213c;if(_0x301428>=_0x439e04){_0x301428=_0x439e04;_0x51213c=0xc8;}else{_0x51213c=0xce;}_0x28fd39[_0x6486('0x16')](_0x51213c);return _0x28fd39[_0x6486('0x1a')]('Content-Range',_0x486662+'-'+_0x301428+'/'+_0x439e04)[_0x6486('0x18')](_0x3f2087);}return null;};}function patchUpdates(_0x255d61){return function(_0x121042){try{jsonpatch['apply'](_0x121042,_0x255d61,!![]);}catch(_0x2913e2){return BPromise[_0x6486('0x1b')](_0x2913e2);}return _0x121042[_0x6486('0x1c')]();};}function saveUpdates(_0x4c93ba,_0x587fa3){return function(_0x54d2cc){if(_0x54d2cc){return _0x54d2cc[_0x6486('0x1d')](_0x4c93ba)[_0x6486('0x1e')](function(_0x39c12c){return _0x39c12c;});}return null;};}function removeEntity(_0x17ee09,_0x573de1){return function(_0x19776a){if(_0x19776a){return _0x19776a[_0x6486('0x1f')]()[_0x6486('0x1e')](function(){var _0x5efb1d=_0x19776a['get']({'plain':!![]});var _0x3d5fba=_0x6486('0x20');return db['UserProfileResource'][_0x6486('0x1f')]({'where':{'type':_0x3d5fba,'resourceId':_0x5efb1d['id']}})[_0x6486('0x1e')](function(){return _0x19776a;});})['then'](function(){_0x17ee09[_0x6486('0x16')](0xcc)[_0x6486('0x17')]();});}};}function handleEntityNotFound(_0x50f136,_0x3f05f9){return function(_0x2a3de9){if(!_0x2a3de9){_0x50f136[_0x6486('0x15')](0x194);}return _0x2a3de9;};}function handleError(_0x108a5a,_0x520d29){_0x520d29=_0x520d29||0x1f4;return function(_0x5ab834){logger['error'](_0x5ab834[_0x6486('0x21')]);if(_0x5ab834['name']){delete _0x5ab834[_0x6486('0x22')];}_0x108a5a['status'](_0x520d29)['send'](_0x5ab834);};}exports['index']=function(_0x3954e4,_0x27032d){var _0x516950={},_0x40793f={},_0x252b99={'count':0x0,'rows':[]};var _0x5ab475=_['map'](db[_0x6486('0x23')][_0x6486('0x24')],function(_0x2659f4){return{'name':_0x2659f4[_0x6486('0x25')],'type':_0x2659f4[_0x6486('0x26')][_0x6486('0x27')]};});_0x40793f[_0x6486('0x28')]=_[_0x6486('0x29')](_0x5ab475,_0x6486('0x22'));_0x40793f[_0x6486('0x2a')]=_[_0x6486('0x2b')](_0x3954e4[_0x6486('0x2a')]);_0x40793f[_0x6486('0x2c')]=_['intersection'](_0x40793f[_0x6486('0x28')],_0x40793f[_0x6486('0x2a')]);_0x516950[_0x6486('0x2d')]=_[_0x6486('0x2e')](_0x40793f[_0x6486('0x28')],qs[_0x6486('0x2f')](_0x3954e4[_0x6486('0x2a')]['fields']));_0x516950['attributes']=_0x516950[_0x6486('0x2d')][_0x6486('0x30')]?_0x516950[_0x6486('0x2d')]:_0x40793f[_0x6486('0x28')];if(!_0x3954e4['query']['hasOwnProperty'](_0x6486('0x31'))){_0x516950[_0x6486('0x32')]=qs['limit'](_0x3954e4['query'][_0x6486('0x32')]);_0x516950[_0x6486('0x19')]=qs[_0x6486('0x19')](_0x3954e4[_0x6486('0x2a')][_0x6486('0x19')]);}_0x516950['order']=qs[_0x6486('0x33')](_0x3954e4['query'][_0x6486('0x33')]);_0x516950['where']=qs[_0x6486('0x2c')](_['pick'](_0x3954e4['query'],_0x40793f[_0x6486('0x2c')]));if(_0x3954e4[_0x6486('0x2a')][_0x6486('0x34')]){_0x516950['where']=_[_0x6486('0x35')](_0x516950[_0x6486('0x36')],{'$or':_[_0x6486('0x29')](_0x5ab475,function(_0x292df8){if(_0x292df8[_0x6486('0x26')]!==_0x6486('0x37')){var _0x32a335={};_0x32a335[_0x292df8[_0x6486('0x22')]]={'$like':'%'+_0x3954e4[_0x6486('0x2a')][_0x6486('0x34')]+'%'};return _0x32a335;}})});}_0x516950=_[_0x6486('0x35')]({},_0x516950,_0x3954e4[_0x6486('0x38')]);var _0x184ff2={'where':_0x516950[_0x6486('0x36')]};return db[_0x6486('0x23')][_0x6486('0x39')](_0x184ff2)[_0x6486('0x1e')](function(_0x23ddc2){_0x252b99[_0x6486('0x39')]=_0x23ddc2;if(_0x3954e4[_0x6486('0x2a')]['includeAll']){_0x516950[_0x6486('0x3a')]=[{'all':!![]}];}return db[_0x6486('0x23')]['findAll'](_0x516950);})[_0x6486('0x1e')](function(_0xb30c5a){_0x252b99[_0x6486('0x3b')]=_0xb30c5a;return _0x252b99;})[_0x6486('0x1e')](respondWithFilteredResult(_0x27032d,_0x516950))['catch'](handleError(_0x27032d,null));};exports[_0x6486('0x3c')]=function(_0x14bd2e,_0x4995e4){var _0x463ce1={'raw':!![],'where':{'id':_0x14bd2e[_0x6486('0x3d')]['id']}},_0x4cda42={};_0x4cda42[_0x6486('0x28')]=_[_0x6486('0x2b')](db[_0x6486('0x23')]['rawAttributes']);_0x4cda42['query']=_['keys'](_0x14bd2e[_0x6486('0x2a')]);_0x4cda42['filters']=_['intersection'](_0x4cda42[_0x6486('0x28')],_0x4cda42[_0x6486('0x2a')]);_0x463ce1[_0x6486('0x2d')]=_['intersection'](_0x4cda42[_0x6486('0x28')],qs[_0x6486('0x2f')](_0x14bd2e[_0x6486('0x2a')][_0x6486('0x2f')]));_0x463ce1[_0x6486('0x2d')]=_0x463ce1[_0x6486('0x2d')][_0x6486('0x30')]?_0x463ce1[_0x6486('0x2d')]:_0x4cda42[_0x6486('0x28')];if(_0x14bd2e[_0x6486('0x2a')][_0x6486('0x3e')]){_0x463ce1['include']=[{'all':!![]}];}_0x463ce1=_['merge']({},_0x463ce1,_0x14bd2e[_0x6486('0x38')]);return db[_0x6486('0x23')]['find'](_0x463ce1)[_0x6486('0x1e')](handleEntityNotFound(_0x4995e4,null))[_0x6486('0x1e')](respondWithResult(_0x4995e4,null))[_0x6486('0x3f')](handleError(_0x4995e4,null));};exports[_0x6486('0x40')]=function(_0x4f614f,_0x497c93){return db[_0x6486('0x23')]['create'](_0x4f614f['body'],{})[_0x6486('0x1e')](function(_0x357b64){var _0xd4a814=_0x4f614f[_0x6486('0x41')][_0x6486('0x42')]({'plain':!![]});if(!_0xd4a814)throw new Error(_0x6486('0x43'));if(_0xd4a814[_0x6486('0x44')]===_0x6486('0x41')){var _0x2aae52=_0x357b64[_0x6486('0x42')]({'plain':!![]});var _0x3c8d96=_0x6486('0x20');return db[_0x6486('0x45')]['find']({'where':{'name':_0x3c8d96,'userProfileId':_0xd4a814[_0x6486('0x46')]},'raw':!![]})['then'](function(_0x565c61){if(_0x565c61&&_0x565c61['autoAssociation']===0x0){return db[_0x6486('0x47')][_0x6486('0x40')]({'name':_0x2aae52[_0x6486('0x22')],'resourceId':_0x2aae52['id'],'type':_0x565c61[_0x6486('0x22')],'sectionId':_0x565c61['id']},{})[_0x6486('0x1e')](function(){return _0x357b64;});}else{return _0x357b64;}})[_0x6486('0x3f')](function(_0x13b80d){logger[_0x6486('0x48')](_0x6486('0x49'),_0x13b80d);throw _0x13b80d;});}return _0x357b64;})[_0x6486('0x1e')](respondWithResult(_0x497c93,0xc9))[_0x6486('0x3f')](handleError(_0x497c93,null));};exports[_0x6486('0x1d')]=function(_0x3025fe,_0x146ba2){if(_0x3025fe[_0x6486('0x4a')]['id']){delete _0x3025fe[_0x6486('0x4a')]['id'];}return db[_0x6486('0x23')][_0x6486('0x4b')]({'where':{'id':_0x3025fe[_0x6486('0x3d')]['id']}})[_0x6486('0x1e')](handleEntityNotFound(_0x146ba2,null))[_0x6486('0x1e')](saveUpdates(_0x3025fe[_0x6486('0x4a')],null))[_0x6486('0x1e')](respondWithResult(_0x146ba2,null))['catch'](handleError(_0x146ba2,null));};exports[_0x6486('0x1f')]=function(_0x1621f4,_0x6e0205){return db[_0x6486('0x23')][_0x6486('0x4b')]({'where':{'id':_0x1621f4[_0x6486('0x3d')]['id']}})[_0x6486('0x1e')](handleEntityNotFound(_0x6e0205,null))[_0x6486('0x1e')](removeEntity(_0x6e0205,null))['catch'](handleError(_0x6e0205,null));};exports[_0x6486('0x4c')]=function(_0x5dd5df,_0x5464f9,_0x37bd23){var _0x3e8547;return db[_0x6486('0x23')][_0x6486('0x4b')]({'where':{'id':_0x5dd5df['params']['id']},'attributes':['id',_0x6486('0x4d')]})['then'](handleEntityNotFound(_0x5464f9,null))['then'](function(_0x58bb75){if(_0x58bb75){var _0x7548fc=require(_0x6486('0x4e'))();_0x7548fc[_0x6486('0x4f')](_0x58bb75[_0x6486('0x4d')]);_0x7548fc[_0x6486('0x50')]();return _0x58bb75;}})['then'](respondWithResult(_0x5464f9,null))[_0x6486('0x3f')](handleError(_0x5464f9,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 9d79c97..f6b16c5 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 _0x3ba4=['define','SquareOdbc','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3ba4,0xc2));var _0x43ba=function(_0x611a86,_0x1e46ae){_0x611a86=_0x611a86-0x0;var _0xde60c1=_0x3ba4[_0x611a86];return _0xde60c1;};'use strict';var _=require(_0x43ba('0x0'));var util=require('util');var logger=require(_0x43ba('0x1'))(_0x43ba('0x2'));var moment=require(_0x43ba('0x3'));var BPromise=require(_0x43ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x43ba('0x5'));var rimraf=require(_0x43ba('0x6'));var config=require(_0x43ba('0x7'));var attributes=require(_0x43ba('0x8'));module[_0x43ba('0x9')]=function(_0x1866e6,_0x3a30a9){return _0x1866e6[_0x43ba('0xa')](_0x43ba('0xb'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdd0=['util','../../config/logger','api','moment','path','rimraf','../../config/environment','./squareOdbc.attributes','exports'];(function(_0x55f10c,_0x394786){var _0x3e74b9=function(_0x2cbf7e){while(--_0x2cbf7e){_0x55f10c['push'](_0x55f10c['shift']());}};_0x3e74b9(++_0x394786);}(_0xcdd0,0xbd));var _0x0cdd=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xcdd0[_0x4709c0];return _0x13348b;};'use strict';var _=require('lodash');var util=require(_0x0cdd('0x0'));var logger=require(_0x0cdd('0x1'))(_0x0cdd('0x2'));var moment=require(_0x0cdd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0cdd('0x4'));var rimraf=require(_0x0cdd('0x5'));var config=require(_0x0cdd('0x6'));var attributes=require(_0x0cdd('0x7'));module[_0x0cdd('0x8')]=function(_0x3c12f6,_0x308199){return _0x3c12f6['define']('SquareOdbc',attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.rpc.js b/server/api/squareOdbc/squareOdbc.rpc.js index f347028..5b42244 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 _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x2e9e8a,_0x307161){var _0x365248=function(_0x19a7fb){while(--_0x19a7fb){_0x2e9e8a['push'](_0x2e9e8a['shift']());}};_0x365248(++_0x307161);}(_0x9957,0x93));var _0x7995=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x9957[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x285eff,_0x4f58fa){var _0x2803c6=function(_0x4cb490){while(--_0x4cb490){_0x285eff['push'](_0x285eff['shift']());}};_0x2803c6(++_0x4f58fa);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index dc8c247..8a0609d 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 _0xdb94=['/:id/users','getUsers','post','create','addUsers','/:id','delete','removeUsers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x30182f,_0x30ce41){var _0x5207db=function(_0x50a417){while(--_0x50a417){_0x30182f['push'](_0x30182f['shift']());}};_0x5207db(++_0x30ce41);}(_0xdb94,0xab));var _0x4db9=function(_0x3507a6,_0x591f02){_0x3507a6=_0x3507a6-0x0;var _0x1f516f=_0xdb94[_0x3507a6];return _0x1f516f;};'use strict';var multer=require(_0x4db9('0x0'));var util=require(_0x4db9('0x1'));var path=require(_0x4db9('0x2'));var timeout=require(_0x4db9('0x3'));var express=require(_0x4db9('0x4'));var router=express['Router']();var auth=require(_0x4db9('0x5'));var interaction=require(_0x4db9('0x6'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0x4db9('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x4db9('0x7')]('/:id',auth[_0x4db9('0x8')](),controller['show']);router[_0x4db9('0x7')](_0x4db9('0x9'),auth[_0x4db9('0x8')](),controller[_0x4db9('0xa')]);router[_0x4db9('0xb')]('/',auth[_0x4db9('0x8')](),controller[_0x4db9('0xc')]);router[_0x4db9('0xb')](_0x4db9('0x9'),auth[_0x4db9('0x8')](),controller[_0x4db9('0xd')]);router['put'](_0x4db9('0xe'),auth[_0x4db9('0x8')](),controller['update']);router['delete'](_0x4db9('0xe'),auth['isAuthenticated'](),controller['destroy']);router[_0x4db9('0xf')](_0x4db9('0x9'),auth['isAuthenticated'](),controller[_0x4db9('0x10')]);module[_0x4db9('0x11')]=router; \ No newline at end of file +var _0xcf2f=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','create','post','addUsers','put','delete','destroy','multer'];(function(_0x4e9189,_0xc42f09){var _0x1f3b43=function(_0x2adfb6){while(--_0x2adfb6){_0x4e9189['push'](_0x4e9189['shift']());}};_0x1f3b43(++_0xc42f09);}(_0xcf2f,0xa7));var _0xfcf2=function(_0x1d3a67,_0x5157f6){_0x1d3a67=_0x1d3a67-0x0;var _0x21116d=_0xcf2f[_0x1d3a67];return _0x21116d;};'use strict';var multer=require(_0xfcf2('0x0'));var util=require(_0xfcf2('0x1'));var path=require(_0xfcf2('0x2'));var timeout=require(_0xfcf2('0x3'));var express=require(_0xfcf2('0x4'));var router=express['Router']();var auth=require(_0xfcf2('0x5'));var interaction=require(_0xfcf2('0x6'));var config=require(_0xfcf2('0x7'));var controller=require(_0xfcf2('0x8'));router[_0xfcf2('0x9')]('/',auth[_0xfcf2('0xa')](),controller[_0xfcf2('0xb')]);router[_0xfcf2('0x9')](_0xfcf2('0xc'),auth[_0xfcf2('0xa')](),controller[_0xfcf2('0xd')]);router[_0xfcf2('0x9')](_0xfcf2('0xe'),auth[_0xfcf2('0xa')](),controller['getUsers']);router['post']('/',auth['isAuthenticated'](),controller[_0xfcf2('0xf')]);router[_0xfcf2('0x10')]('/:id/users',auth[_0xfcf2('0xa')](),controller[_0xfcf2('0x11')]);router[_0xfcf2('0x12')](_0xfcf2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xfcf2('0x13')](_0xfcf2('0xc'),auth[_0xfcf2('0xa')](),controller[_0xfcf2('0x14')]);router['delete'](_0xfcf2('0xe'),auth['isAuthenticated'](),controller['removeUsers']);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 1542599..173c4f8 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 _0x6dbb=['long','preproduction','getDataValue','toString','utf8','production','sequelize','STRING','name','BLOB'];(function(_0x397e5e,_0x3a410c){var _0x2888df=function(_0x16905f){while(--_0x16905f){_0x397e5e['push'](_0x397e5e['shift']());}};_0x2888df(++_0x3a410c);}(_0x6dbb,0x18c));var _0xb6db=function(_0x450fcd,_0x59d6b4){_0x450fcd=_0x450fcd-0x0;var _0x19c4c1=_0x6dbb[_0x450fcd];return _0x19c4c1;};'use strict';var Sequelize=require(_0xb6db('0x0'));module['exports']={'name':{'type':Sequelize[_0xb6db('0x1')],'unique':_0xb6db('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xb6db('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xb6db('0x3')](_0xb6db('0x4')),'get':function(){if(this['getDataValue'](_0xb6db('0x5'))){return this[_0xb6db('0x6')]('preproduction')[_0xb6db('0x7')](_0xb6db('0x8'));}}},'production':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xb6db('0x6')](_0xb6db('0x9'))){return this[_0xb6db('0x6')](_0xb6db('0x9'))[_0xb6db('0x7')](_0xb6db('0x8'));}}}}; \ No newline at end of file +var _0x217f=['STRING','name','getDataValue','preproduction','utf8','BLOB','long','production','sequelize','exports'];(function(_0x407cd6,_0x1ee2ed){var _0x10a03b=function(_0x35c02f){while(--_0x35c02f){_0x407cd6['push'](_0x407cd6['shift']());}};_0x10a03b(++_0x1ee2ed);}(_0x217f,0x116));var _0xf217=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x217f[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xf217('0x0'));module[_0xf217('0x1')]={'name':{'type':Sequelize[_0xf217('0x2')],'unique':_0xf217('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0xf217('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize['BLOB']('long'),'get':function(){if(this[_0xf217('0x4')]('preproduction')){return this[_0xf217('0x4')](_0xf217('0x5'))['toString'](_0xf217('0x6'));}}},'production':{'type':Sequelize[_0xf217('0x7')](_0xf217('0x8')),'get':function(){if(this[_0xf217('0x4')](_0xf217('0x9'))){return this[_0xf217('0x4')](_0xf217('0x9'))['toString'](_0xf217('0x6'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 9ce204f..ebdd36d 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 _0x153f=['send','index','map','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','options','SquareProject','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','body','addUsers','ids','omit','removeUsers','isArray','userSquareProject:remove','User','order','getUsers','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name'];(function(_0x4464cd,_0x67689b){var _0x4f5ea2=function(_0xbab9c8){while(--_0xbab9c8){_0x4464cd['push'](_0x4464cd['shift']());}};_0x4f5ea2(++_0x67689b);}(_0x153f,0x15b));var _0xf153=function(_0xd6f6cc,_0xa05a16){_0xd6f6cc=_0xd6f6cc-0x0;var _0x3685dc=_0x153f[_0xd6f6cc];return _0x3685dc;};'use strict';var pdf=require(_0xf153('0x0'));var emlformat=require(_0xf153('0x1'));var rimraf=require(_0xf153('0x2'));var zipdir=require(_0xf153('0x3'));var jsonpatch=require(_0xf153('0x4'));var rp=require(_0xf153('0x5'));var moment=require(_0xf153('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xf153('0x7'));var util=require('util');var path=require(_0xf153('0x8'));var sox=require(_0xf153('0x9'));var csv=require(_0xf153('0xa'));var ejs=require(_0xf153('0xb'));var fs=require('fs');var _=require(_0xf153('0xc'));var squel=require('squel');var crypto=require(_0xf153('0xd'));var jsforce=require(_0xf153('0xe'));var deskjs=require(_0xf153('0xf'));var toCsv=require(_0xf153('0xa'));var querystring=require(_0xf153('0x10'));var Papa=require(_0xf153('0x11'));var Redis=require(_0xf153('0x12'));var authService=require(_0xf153('0x13'));var qs=require(_0xf153('0x14'));var as=require(_0xf153('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf153('0x16'))(_0xf153('0x17'));var utils=require(_0xf153('0x18'));var config=require('../../config/environment');var db=require(_0xf153('0x19'))['db'];config[_0xf153('0x1a')]=_[_0xf153('0x1b')](config[_0xf153('0x1a')],{'host':_0xf153('0x1c'),'port':0x18eb});var socket=require(_0xf153('0x1d'))(new Redis(config[_0xf153('0x1a')]));require(_0xf153('0x1e'))[_0xf153('0x1f')](socket);function respondWithStatusCode(_0x4c5283,_0x18be7e){_0x18be7e=_0x18be7e||0xcc;return function(_0x2340f5){if(_0x2340f5){return _0x4c5283[_0xf153('0x20')](_0x18be7e);}return _0x4c5283[_0xf153('0x21')](_0x18be7e)[_0xf153('0x22')]();};}function respondWithResult(_0x68f436,_0x273a90){_0x273a90=_0x273a90||0xc8;return function(_0x287bc6){if(_0x287bc6){return _0x68f436['status'](_0x273a90)[_0xf153('0x23')](_0x287bc6);}};}function respondWithFilteredResult(_0x564eeb,_0x37093a){return function(_0x2c62b6){if(_0x2c62b6){var _0x138dbe=_0x2c62b6[_0xf153('0x24')],_0x44272e=_0x37093a[_0xf153('0x25')],_0x4e790d=_0x37093a[_0xf153('0x25')]+_0x37093a[_0xf153('0x26')],_0x357d57;if(_0x4e790d>=_0x138dbe){_0x4e790d=_0x138dbe;_0x357d57=0xc8;}else{_0x357d57=0xce;}_0x564eeb[_0xf153('0x21')](_0x357d57);return _0x564eeb[_0xf153('0x27')](_0xf153('0x28'),_0x44272e+'-'+_0x4e790d+'/'+_0x138dbe)[_0xf153('0x23')](_0x2c62b6);}return null;};}function patchUpdates(_0x1dd340){return function(_0x33ce52){try{jsonpatch[_0xf153('0x29')](_0x33ce52,_0x1dd340,!![]);}catch(_0x493e8a){return BPromise[_0xf153('0x2a')](_0x493e8a);}return _0x33ce52[_0xf153('0x2b')]();};}function saveUpdates(_0x3d3e41,_0x32e759){return function(_0x5c9f44){if(_0x5c9f44){return _0x5c9f44[_0xf153('0x2c')](_0x3d3e41)[_0xf153('0x2d')](function(_0x4376f7){return _0x4376f7;});}return null;};}function removeEntity(_0xf67cde,_0x38190c){return function(_0x1570fc){if(_0x1570fc){return _0x1570fc[_0xf153('0x2e')]()[_0xf153('0x2d')](function(){var _0x1e0e49=_0x1570fc[_0xf153('0x2f')]({'plain':!![]});var _0x35f9da=_0xf153('0x30');return db[_0xf153('0x31')][_0xf153('0x2e')]({'where':{'type':_0x35f9da,'resourceId':_0x1e0e49['id']}})[_0xf153('0x2d')](function(){return _0x1570fc;});})['then'](function(){_0xf67cde[_0xf153('0x21')](0xcc)[_0xf153('0x22')]();});}};}function handleEntityNotFound(_0x576788,_0x16cdcd){return function(_0x1c8590){if(!_0x1c8590){_0x576788['sendStatus'](0x194);}return _0x1c8590;};}function handleError(_0x17305d,_0x10295e){_0x10295e=_0x10295e||0x1f4;return function(_0x261ac0){logger[_0xf153('0x32')](_0x261ac0[_0xf153('0x33')]);if(_0x261ac0[_0xf153('0x34')]){delete _0x261ac0[_0xf153('0x34')];}_0x17305d[_0xf153('0x21')](_0x10295e)[_0xf153('0x35')](_0x261ac0);};}exports[_0xf153('0x36')]=function(_0x13b541,_0x415a5f){var _0x5b5237={},_0x258fb0={},_0xbb3619={'count':0x0,'rows':[]};var _0x313516=_[_0xf153('0x37')](db['SquareProject']['rawAttributes'],function(_0x28433d){return{'name':_0x28433d['fieldName'],'type':_0x28433d['type'][_0xf153('0x38')]};});_0x258fb0['model']=_[_0xf153('0x37')](_0x313516,'name');_0x258fb0[_0xf153('0x39')]=_[_0xf153('0x3a')](_0x13b541['query']);_0x258fb0[_0xf153('0x3b')]=_[_0xf153('0x3c')](_0x258fb0[_0xf153('0x3d')],_0x258fb0[_0xf153('0x39')]);_0x5b5237[_0xf153('0x3e')]=_[_0xf153('0x3c')](_0x258fb0['model'],qs[_0xf153('0x3f')](_0x13b541['query'][_0xf153('0x3f')]));_0x5b5237[_0xf153('0x3e')]=_0x5b5237[_0xf153('0x3e')][_0xf153('0x40')]?_0x5b5237[_0xf153('0x3e')]:_0x258fb0[_0xf153('0x3d')];if(!_0x13b541['query'][_0xf153('0x41')](_0xf153('0x42'))){_0x5b5237[_0xf153('0x26')]=qs['limit'](_0x13b541[_0xf153('0x39')][_0xf153('0x26')]);_0x5b5237[_0xf153('0x25')]=qs[_0xf153('0x25')](_0x13b541[_0xf153('0x39')][_0xf153('0x25')]);}_0x5b5237['order']=qs[_0xf153('0x43')](_0x13b541[_0xf153('0x39')]['sort']);_0x5b5237[_0xf153('0x44')]=qs[_0xf153('0x3b')](_[_0xf153('0x45')](_0x13b541[_0xf153('0x39')],_0x258fb0[_0xf153('0x3b')]));if(_0x13b541[_0xf153('0x39')][_0xf153('0x46')]){_0x5b5237['where']=_[_0xf153('0x47')](_0x5b5237[_0xf153('0x44')],{'$or':_[_0xf153('0x37')](_0x313516,function(_0x352e7c){if(_0x352e7c[_0xf153('0x48')]!==_0xf153('0x49')){var _0x485c52={};_0x485c52[_0x352e7c['name']]={'$like':'%'+_0x13b541[_0xf153('0x39')]['filter']+'%'};return _0x485c52;}})});}_0x5b5237=_[_0xf153('0x47')]({},_0x5b5237,_0x13b541[_0xf153('0x4a')]);var _0x31ec0f={'where':_0x5b5237[_0xf153('0x44')]};return db[_0xf153('0x4b')][_0xf153('0x24')](_0x31ec0f)['then'](function(_0x537635){_0xbb3619[_0xf153('0x24')]=_0x537635;if(_0x13b541[_0xf153('0x39')]['includeAll']){_0x5b5237[_0xf153('0x4c')]=[{'all':!![]}];}return db[_0xf153('0x4b')][_0xf153('0x4d')](_0x5b5237);})[_0xf153('0x2d')](function(_0x72f7ee){_0xbb3619[_0xf153('0x4e')]=_0x72f7ee;return _0xbb3619;})[_0xf153('0x2d')](respondWithFilteredResult(_0x415a5f,_0x5b5237))[_0xf153('0x4f')](handleError(_0x415a5f,null));};exports[_0xf153('0x50')]=function(_0x2ff654,_0xbe2df4){var _0x46e279={'raw':![],'where':{'id':_0x2ff654[_0xf153('0x51')]['id']}},_0x59228a={};_0x59228a[_0xf153('0x3d')]=_[_0xf153('0x3a')](db['SquareProject'][_0xf153('0x52')]);_0x59228a[_0xf153('0x39')]=_['keys'](_0x2ff654[_0xf153('0x39')]);_0x59228a['filters']=_[_0xf153('0x3c')](_0x59228a[_0xf153('0x3d')],_0x59228a[_0xf153('0x39')]);_0x46e279['attributes']=_[_0xf153('0x3c')](_0x59228a[_0xf153('0x3d')],qs[_0xf153('0x3f')](_0x2ff654[_0xf153('0x39')][_0xf153('0x3f')]));_0x46e279['attributes']=_0x46e279[_0xf153('0x3e')][_0xf153('0x40')]?_0x46e279['attributes']:_0x59228a[_0xf153('0x3d')];if(_0x2ff654[_0xf153('0x39')][_0xf153('0x53')]){_0x46e279['include']=[{'all':!![]}];}_0x46e279=_[_0xf153('0x47')]({},_0x46e279,_0x2ff654[_0xf153('0x4a')]);return db[_0xf153('0x4b')][_0xf153('0x54')](_0x46e279)[_0xf153('0x2d')](handleEntityNotFound(_0xbe2df4,null))[_0xf153('0x2d')](respondWithResult(_0xbe2df4,null))[_0xf153('0x4f')](handleError(_0xbe2df4,null));};exports[_0xf153('0x55')]=function(_0x3b91ed,_0x5b33a5){return db[_0xf153('0x4b')]['create'](_0x3b91ed['body'],{})['then'](function(_0x43e608){var _0x10d476=_0x3b91ed['user'][_0xf153('0x2f')]({'plain':!![]});if(!_0x10d476)throw new Error(_0xf153('0x56'));if(_0x10d476['role']===_0xf153('0x57')){var _0xe6e023=_0x43e608[_0xf153('0x2f')]({'plain':!![]});var _0x1a1767=_0xf153('0x30');return db[_0xf153('0x58')]['find']({'where':{'name':_0x1a1767,'userProfileId':_0x10d476[_0xf153('0x59')]},'raw':!![]})[_0xf153('0x2d')](function(_0x4dca55){if(_0x4dca55&&_0x4dca55['autoAssociation']===0x0){return db[_0xf153('0x31')][_0xf153('0x55')]({'name':_0xe6e023[_0xf153('0x34')],'resourceId':_0xe6e023['id'],'type':_0x4dca55[_0xf153('0x34')],'sectionId':_0x4dca55['id']},{})[_0xf153('0x2d')](function(){return _0x43e608;});}else{return _0x43e608;}})[_0xf153('0x4f')](function(_0x517879){logger[_0xf153('0x32')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x517879);throw _0x517879;});}return _0x43e608;})[_0xf153('0x2d')](respondWithResult(_0x5b33a5,0xc9))[_0xf153('0x4f')](handleError(_0x5b33a5,null));};exports[_0xf153('0x2c')]=function(_0x5cc697,_0x35912e){if(_0x5cc697[_0xf153('0x5a')]['id']){delete _0x5cc697[_0xf153('0x5a')]['id'];}return db[_0xf153('0x4b')][_0xf153('0x54')]({'where':{'id':_0x5cc697[_0xf153('0x51')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x35912e,null))['then'](saveUpdates(_0x5cc697[_0xf153('0x5a')],null))[_0xf153('0x2d')](respondWithResult(_0x35912e,null))[_0xf153('0x4f')](handleError(_0x35912e,null));};exports['destroy']=function(_0x1bf770,_0x87af73){return db[_0xf153('0x4b')][_0xf153('0x54')]({'where':{'id':_0x1bf770[_0xf153('0x51')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x87af73,null))[_0xf153('0x2d')](removeEntity(_0x87af73,null))[_0xf153('0x4f')](handleError(_0x87af73,null));};exports['addUsers']=function(_0x308b5f,_0xca443,_0x5a0cd8){return db[_0xf153('0x4b')][_0xf153('0x54')]({'where':{'id':_0x308b5f[_0xf153('0x51')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0xca443,null))[_0xf153('0x2d')](function(_0x294de6){if(_0x294de6){return _0x294de6[_0xf153('0x5b')](_0x308b5f[_0xf153('0x5a')][_0xf153('0x5c')],_[_0xf153('0x5d')](_0x308b5f[_0xf153('0x5a')],['ids','id'])||{});}})[_0xf153('0x2d')](respondWithResult(_0xca443,null))[_0xf153('0x4f')](handleError(_0xca443,null));};exports['removeUsers']=function(_0x2645ff,_0x25e66e,_0x249cd6){return db[_0xf153('0x4b')][_0xf153('0x54')]({'where':{'id':_0x2645ff[_0xf153('0x51')]['id']}})[_0xf153('0x2d')](handleEntityNotFound(_0x25e66e,null))['then'](function(_0x219d00){if(_0x219d00){return _0x219d00[_0xf153('0x5e')](_0x2645ff[_0xf153('0x39')][_0xf153('0x5c')])[_0xf153('0x2d')](function(){if(_[_0xf153('0x5f')](_0x2645ff[_0xf153('0x39')][_0xf153('0x5c')])){for(var _0x437083=0x0;_0x437083<_0x2645ff['query'][_0xf153('0x5c')][_0xf153('0x40')];_0x437083+=0x1){socket['emit'](_0xf153('0x60'),{'UserId':Number(_0x2645ff['query'][_0xf153('0x5c')][_0x437083]),'SquareProjectId':Number(_0x2645ff[_0xf153('0x51')]['id'])});}}else{socket['emit'](_0xf153('0x60'),{'UserId':Number(_0x2645ff['query'][_0xf153('0x5c')]),'SquareProjectId':Number(_0x2645ff[_0xf153('0x51')]['id'])});}});}})[_0xf153('0x2d')](respondWithStatusCode(_0x25e66e,null))[_0xf153('0x4f')](handleError(_0x25e66e,null));};exports['getUsers']=function(_0x42cd70,_0xc0095d,_0x4be37e){var _0x43d10b={};var _0x37544d={};var _0x101bfc;var _0x362e41;return db[_0xf153('0x4b')]['findOne']({'where':{'id':_0x42cd70[_0xf153('0x51')]['id']}})['then'](handleEntityNotFound(_0xc0095d,null))[_0xf153('0x2d')](function(_0x38a7c4){if(_0x38a7c4){_0x101bfc=_0x38a7c4;_0x37544d['model']=_['keys'](db[_0xf153('0x61')][_0xf153('0x52')]);_0x37544d['query']=_[_0xf153('0x3a')](_0x42cd70[_0xf153('0x39')]);_0x37544d[_0xf153('0x3b')]=_['intersection'](_0x37544d[_0xf153('0x3d')],_0x37544d[_0xf153('0x39')]);_0x43d10b[_0xf153('0x3e')]=_[_0xf153('0x3c')](_0x37544d[_0xf153('0x3d')],qs[_0xf153('0x3f')](_0x42cd70[_0xf153('0x39')][_0xf153('0x3f')]));_0x43d10b[_0xf153('0x3e')]=_0x43d10b[_0xf153('0x3e')][_0xf153('0x40')]?_0x43d10b[_0xf153('0x3e')]:_0x37544d[_0xf153('0x3d')];_0x43d10b[_0xf153('0x62')]=qs[_0xf153('0x43')](_0x42cd70[_0xf153('0x39')]['sort']);_0x43d10b[_0xf153('0x44')]=qs['filters'](_['pick'](_0x42cd70[_0xf153('0x39')],_0x37544d['filters']));if(_0x42cd70[_0xf153('0x39')][_0xf153('0x46')]){_0x43d10b[_0xf153('0x44')]=_[_0xf153('0x47')](_0x43d10b[_0xf153('0x44')],{'$or':_[_0xf153('0x37')](_0x43d10b['attributes'],function(_0x80bdf5){var _0x3322c4={};_0x3322c4[_0x80bdf5]={'$like':'%'+_0x42cd70[_0xf153('0x39')]['filter']+'%'};return _0x3322c4;})});}_0x43d10b=_['merge']({},_0x43d10b,_0x42cd70[_0xf153('0x4a')]);return _0x101bfc[_0xf153('0x63')](_0x43d10b);}})[_0xf153('0x2d')](function(_0x48755d){if(_0x48755d){_0x362e41=_0x48755d[_0xf153('0x40')];if(!_0x42cd70['query']['hasOwnProperty'](_0xf153('0x42'))){_0x43d10b[_0xf153('0x26')]=qs[_0xf153('0x26')](_0x42cd70['query'][_0xf153('0x26')]);_0x43d10b[_0xf153('0x25')]=qs['offset'](_0x42cd70[_0xf153('0x39')][_0xf153('0x25')]);}return _0x101bfc[_0xf153('0x63')](_0x43d10b);}})[_0xf153('0x2d')](function(_0x103eff){if(_0x103eff){return _0x103eff?{'count':_0x362e41,'rows':_0x103eff}:null;}})['then'](respondWithResult(_0xc0095d,null))[_0xf153('0x4f')](handleError(_0xc0095d,null));}; \ No newline at end of file +var _0xbdb7=['role','user','get','UserProfileSection','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addUsers','omit','ids','removeUsers','isArray','userSquareProject:remove','emit','getUsers','findOne','order','hasOwnProperty','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','redis','defaults','localhost','./squareProject.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','SquareProjects','destroy','error','stack','name','send','map','SquareProject','rawAttributes','model','keys','query','filters','intersection','fields','attributes','length','nolimit','sort','where','pick','type','VIRTUAL','filter','merge','findAll','show','params','includeAll','include','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xbc9ada,_0x6cf2a6){var _0x2867f4=function(_0x3fb747){while(--_0x3fb747){_0xbc9ada['push'](_0xbc9ada['shift']());}};_0x2867f4(++_0x6cf2a6);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x946156,_0x4902e0){_0x946156=_0x946156-0x0;var _0x5a7488=_0xbdb7[_0x946156];return _0x5a7488;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x7bdb('0x16')]=_[_0x7bdb('0x17')](config['redis'],{'host':_0x7bdb('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7bdb('0x19'))[_0x7bdb('0x1a')](socket);function respondWithStatusCode(_0x4fd91a,_0x50eeca){_0x50eeca=_0x50eeca||0xcc;return function(_0x4e98f7){if(_0x4e98f7){return _0x4fd91a[_0x7bdb('0x1b')](_0x50eeca);}return _0x4fd91a[_0x7bdb('0x1c')](_0x50eeca)[_0x7bdb('0x1d')]();};}function respondWithResult(_0x25d417,_0x31c909){_0x31c909=_0x31c909||0xc8;return function(_0xbde12a){if(_0xbde12a){return _0x25d417[_0x7bdb('0x1c')](_0x31c909)[_0x7bdb('0x1e')](_0xbde12a);}};}function respondWithFilteredResult(_0x54b9ce,_0x1c5750){return function(_0x43f352){if(_0x43f352){var _0x5723f4=_0x43f352[_0x7bdb('0x1f')],_0x2aff6a=_0x1c5750['offset'],_0x4ffd4b=_0x1c5750[_0x7bdb('0x20')]+_0x1c5750[_0x7bdb('0x21')],_0x41f540;if(_0x4ffd4b>=_0x5723f4){_0x4ffd4b=_0x5723f4;_0x41f540=0xc8;}else{_0x41f540=0xce;}_0x54b9ce[_0x7bdb('0x1c')](_0x41f540);return _0x54b9ce[_0x7bdb('0x22')](_0x7bdb('0x23'),_0x2aff6a+'-'+_0x4ffd4b+'/'+_0x5723f4)['json'](_0x43f352);}return null;};}function patchUpdates(_0x49f353){return function(_0x677825){try{jsonpatch[_0x7bdb('0x24')](_0x677825,_0x49f353,!![]);}catch(_0x5daea4){return BPromise[_0x7bdb('0x25')](_0x5daea4);}return _0x677825[_0x7bdb('0x26')]();};}function saveUpdates(_0x346c72,_0x3f53e7){return function(_0x3a1d0f){if(_0x3a1d0f){return _0x3a1d0f['update'](_0x346c72)[_0x7bdb('0x27')](function(_0xdad53d){return _0xdad53d;});}return null;};}function removeEntity(_0x40c447,_0x3a456f){return function(_0x481f4b){if(_0x481f4b){return _0x481f4b['destroy']()[_0x7bdb('0x27')](function(){var _0x5eface=_0x481f4b['get']({'plain':!![]});var _0x4a9e02=_0x7bdb('0x28');return db['UserProfileResource'][_0x7bdb('0x29')]({'where':{'type':_0x4a9e02,'resourceId':_0x5eface['id']}})[_0x7bdb('0x27')](function(){return _0x481f4b;});})[_0x7bdb('0x27')](function(){_0x40c447[_0x7bdb('0x1c')](0xcc)[_0x7bdb('0x1d')]();});}};}function handleEntityNotFound(_0x523869,_0x10e818){return function(_0x32242d){if(!_0x32242d){_0x523869[_0x7bdb('0x1b')](0x194);}return _0x32242d;};}function handleError(_0xe1141d,_0x371e8a){_0x371e8a=_0x371e8a||0x1f4;return function(_0x2e8e65){logger[_0x7bdb('0x2a')](_0x2e8e65[_0x7bdb('0x2b')]);if(_0x2e8e65[_0x7bdb('0x2c')]){delete _0x2e8e65[_0x7bdb('0x2c')];}_0xe1141d[_0x7bdb('0x1c')](_0x371e8a)[_0x7bdb('0x2d')](_0x2e8e65);};}exports['index']=function(_0x388a45,_0x23fc3a){var _0x8f7672={},_0x9f5c1={},_0x29eac5={'count':0x0,'rows':[]};var _0x5da819=_[_0x7bdb('0x2e')](db[_0x7bdb('0x2f')][_0x7bdb('0x30')],function(_0x103585){return{'name':_0x103585['fieldName'],'type':_0x103585['type']['key']};});_0x9f5c1[_0x7bdb('0x31')]=_['map'](_0x5da819,_0x7bdb('0x2c'));_0x9f5c1['query']=_[_0x7bdb('0x32')](_0x388a45[_0x7bdb('0x33')]);_0x9f5c1[_0x7bdb('0x34')]=_['intersection'](_0x9f5c1[_0x7bdb('0x31')],_0x9f5c1['query']);_0x8f7672['attributes']=_[_0x7bdb('0x35')](_0x9f5c1['model'],qs[_0x7bdb('0x36')](_0x388a45['query']['fields']));_0x8f7672[_0x7bdb('0x37')]=_0x8f7672[_0x7bdb('0x37')][_0x7bdb('0x38')]?_0x8f7672[_0x7bdb('0x37')]:_0x9f5c1[_0x7bdb('0x31')];if(!_0x388a45[_0x7bdb('0x33')]['hasOwnProperty'](_0x7bdb('0x39'))){_0x8f7672[_0x7bdb('0x21')]=qs[_0x7bdb('0x21')](_0x388a45[_0x7bdb('0x33')][_0x7bdb('0x21')]);_0x8f7672[_0x7bdb('0x20')]=qs[_0x7bdb('0x20')](_0x388a45[_0x7bdb('0x33')][_0x7bdb('0x20')]);}_0x8f7672['order']=qs['sort'](_0x388a45[_0x7bdb('0x33')][_0x7bdb('0x3a')]);_0x8f7672[_0x7bdb('0x3b')]=qs[_0x7bdb('0x34')](_[_0x7bdb('0x3c')](_0x388a45['query'],_0x9f5c1['filters']));if(_0x388a45[_0x7bdb('0x33')]['filter']){_0x8f7672[_0x7bdb('0x3b')]=_['merge'](_0x8f7672[_0x7bdb('0x3b')],{'$or':_['map'](_0x5da819,function(_0x4cf3fa){if(_0x4cf3fa[_0x7bdb('0x3d')]!==_0x7bdb('0x3e')){var _0x192a2b={};_0x192a2b[_0x4cf3fa[_0x7bdb('0x2c')]]={'$like':'%'+_0x388a45[_0x7bdb('0x33')][_0x7bdb('0x3f')]+'%'};return _0x192a2b;}})});}_0x8f7672=_[_0x7bdb('0x40')]({},_0x8f7672,_0x388a45['options']);var _0x51de81={'where':_0x8f7672[_0x7bdb('0x3b')]};return db[_0x7bdb('0x2f')][_0x7bdb('0x1f')](_0x51de81)[_0x7bdb('0x27')](function(_0x39fbca){_0x29eac5[_0x7bdb('0x1f')]=_0x39fbca;if(_0x388a45[_0x7bdb('0x33')]['includeAll']){_0x8f7672['include']=[{'all':!![]}];}return db[_0x7bdb('0x2f')][_0x7bdb('0x41')](_0x8f7672);})[_0x7bdb('0x27')](function(_0x72a81c){_0x29eac5['rows']=_0x72a81c;return _0x29eac5;})[_0x7bdb('0x27')](respondWithFilteredResult(_0x23fc3a,_0x8f7672))['catch'](handleError(_0x23fc3a,null));};exports[_0x7bdb('0x42')]=function(_0x27de25,_0x218361){var _0x264f3a={'raw':![],'where':{'id':_0x27de25[_0x7bdb('0x43')]['id']}},_0x6b10d4={};_0x6b10d4[_0x7bdb('0x31')]=_[_0x7bdb('0x32')](db[_0x7bdb('0x2f')]['rawAttributes']);_0x6b10d4[_0x7bdb('0x33')]=_[_0x7bdb('0x32')](_0x27de25['query']);_0x6b10d4[_0x7bdb('0x34')]=_['intersection'](_0x6b10d4[_0x7bdb('0x31')],_0x6b10d4[_0x7bdb('0x33')]);_0x264f3a[_0x7bdb('0x37')]=_[_0x7bdb('0x35')](_0x6b10d4[_0x7bdb('0x31')],qs['fields'](_0x27de25[_0x7bdb('0x33')][_0x7bdb('0x36')]));_0x264f3a[_0x7bdb('0x37')]=_0x264f3a[_0x7bdb('0x37')][_0x7bdb('0x38')]?_0x264f3a['attributes']:_0x6b10d4[_0x7bdb('0x31')];if(_0x27de25[_0x7bdb('0x33')][_0x7bdb('0x44')]){_0x264f3a[_0x7bdb('0x45')]=[{'all':!![]}];}_0x264f3a=_[_0x7bdb('0x40')]({},_0x264f3a,_0x27de25[_0x7bdb('0x46')]);return db[_0x7bdb('0x2f')][_0x7bdb('0x47')](_0x264f3a)[_0x7bdb('0x27')](handleEntityNotFound(_0x218361,null))[_0x7bdb('0x27')](respondWithResult(_0x218361,null))['catch'](handleError(_0x218361,null));};exports[_0x7bdb('0x48')]=function(_0x58c4bc,_0x47cccd){return db[_0x7bdb('0x2f')][_0x7bdb('0x48')](_0x58c4bc['body'],{})[_0x7bdb('0x27')](function(_0x186809){var _0x5ea9ef=_0x58c4bc['user']['get']({'plain':!![]});if(!_0x5ea9ef)throw new Error(_0x7bdb('0x49'));if(_0x5ea9ef[_0x7bdb('0x4a')]===_0x7bdb('0x4b')){var _0x46410c=_0x186809[_0x7bdb('0x4c')]({'plain':!![]});var _0x24b7b8=_0x7bdb('0x28');return db[_0x7bdb('0x4d')][_0x7bdb('0x47')]({'where':{'name':_0x24b7b8,'userProfileId':_0x5ea9ef[_0x7bdb('0x4e')]},'raw':!![]})['then'](function(_0x299ef0){if(_0x299ef0&&_0x299ef0['autoAssociation']===0x0){return db[_0x7bdb('0x4f')][_0x7bdb('0x48')]({'name':_0x46410c[_0x7bdb('0x2c')],'resourceId':_0x46410c['id'],'type':_0x299ef0[_0x7bdb('0x2c')],'sectionId':_0x299ef0['id']},{})['then'](function(){return _0x186809;});}else{return _0x186809;}})[_0x7bdb('0x50')](function(_0x5c79a8){logger['error'](_0x7bdb('0x51'),_0x5c79a8);throw _0x5c79a8;});}return _0x186809;})[_0x7bdb('0x27')](respondWithResult(_0x47cccd,0xc9))['catch'](handleError(_0x47cccd,null));};exports['update']=function(_0x49bb3f,_0x3e574e){if(_0x49bb3f['body']['id']){delete _0x49bb3f['body']['id'];}return db[_0x7bdb('0x2f')][_0x7bdb('0x47')]({'where':{'id':_0x49bb3f[_0x7bdb('0x43')]['id']}})[_0x7bdb('0x27')](handleEntityNotFound(_0x3e574e,null))['then'](saveUpdates(_0x49bb3f[_0x7bdb('0x52')],null))['then'](respondWithResult(_0x3e574e,null))[_0x7bdb('0x50')](handleError(_0x3e574e,null));};exports[_0x7bdb('0x29')]=function(_0x82f990,_0x6b4277){return db[_0x7bdb('0x2f')][_0x7bdb('0x47')]({'where':{'id':_0x82f990['params']['id']}})[_0x7bdb('0x27')](handleEntityNotFound(_0x6b4277,null))[_0x7bdb('0x27')](removeEntity(_0x6b4277,null))[_0x7bdb('0x50')](handleError(_0x6b4277,null));};exports['addUsers']=function(_0x2b5493,_0x1d9927,_0x4d813f){return db[_0x7bdb('0x2f')]['find']({'where':{'id':_0x2b5493[_0x7bdb('0x43')]['id']}})[_0x7bdb('0x27')](handleEntityNotFound(_0x1d9927,null))['then'](function(_0x478bbd){if(_0x478bbd){return _0x478bbd[_0x7bdb('0x53')](_0x2b5493[_0x7bdb('0x52')]['ids'],_[_0x7bdb('0x54')](_0x2b5493['body'],[_0x7bdb('0x55'),'id'])||{});}})['then'](respondWithResult(_0x1d9927,null))['catch'](handleError(_0x1d9927,null));};exports[_0x7bdb('0x56')]=function(_0x2d4b59,_0x19bb3f,_0x26f1f5){return db[_0x7bdb('0x2f')][_0x7bdb('0x47')]({'where':{'id':_0x2d4b59[_0x7bdb('0x43')]['id']}})[_0x7bdb('0x27')](handleEntityNotFound(_0x19bb3f,null))[_0x7bdb('0x27')](function(_0x19f99f){if(_0x19f99f){return _0x19f99f[_0x7bdb('0x56')](_0x2d4b59[_0x7bdb('0x33')]['ids'])[_0x7bdb('0x27')](function(){if(_[_0x7bdb('0x57')](_0x2d4b59['query'][_0x7bdb('0x55')])){for(var _0x1a0f36=0x0;_0x1a0f36<_0x2d4b59[_0x7bdb('0x33')][_0x7bdb('0x55')][_0x7bdb('0x38')];_0x1a0f36+=0x1){socket['emit'](_0x7bdb('0x58'),{'UserId':Number(_0x2d4b59[_0x7bdb('0x33')][_0x7bdb('0x55')][_0x1a0f36]),'SquareProjectId':Number(_0x2d4b59['params']['id'])});}}else{socket[_0x7bdb('0x59')](_0x7bdb('0x58'),{'UserId':Number(_0x2d4b59[_0x7bdb('0x33')][_0x7bdb('0x55')]),'SquareProjectId':Number(_0x2d4b59[_0x7bdb('0x43')]['id'])});}});}})[_0x7bdb('0x27')](respondWithStatusCode(_0x19bb3f,null))[_0x7bdb('0x50')](handleError(_0x19bb3f,null));};exports[_0x7bdb('0x5a')]=function(_0x3b61b0,_0x4fdec0,_0x7a7c4a){var _0x2b7c7e={};var _0x1cf8b1={};var _0x16141d;var _0x3054fc;return db[_0x7bdb('0x2f')][_0x7bdb('0x5b')]({'where':{'id':_0x3b61b0[_0x7bdb('0x43')]['id']}})[_0x7bdb('0x27')](handleEntityNotFound(_0x4fdec0,null))[_0x7bdb('0x27')](function(_0x29f5af){if(_0x29f5af){_0x16141d=_0x29f5af;_0x1cf8b1[_0x7bdb('0x31')]=_[_0x7bdb('0x32')](db['User'][_0x7bdb('0x30')]);_0x1cf8b1['query']=_[_0x7bdb('0x32')](_0x3b61b0[_0x7bdb('0x33')]);_0x1cf8b1[_0x7bdb('0x34')]=_['intersection'](_0x1cf8b1[_0x7bdb('0x31')],_0x1cf8b1[_0x7bdb('0x33')]);_0x2b7c7e['attributes']=_[_0x7bdb('0x35')](_0x1cf8b1[_0x7bdb('0x31')],qs['fields'](_0x3b61b0[_0x7bdb('0x33')][_0x7bdb('0x36')]));_0x2b7c7e['attributes']=_0x2b7c7e[_0x7bdb('0x37')][_0x7bdb('0x38')]?_0x2b7c7e['attributes']:_0x1cf8b1[_0x7bdb('0x31')];_0x2b7c7e[_0x7bdb('0x5c')]=qs['sort'](_0x3b61b0[_0x7bdb('0x33')]['sort']);_0x2b7c7e[_0x7bdb('0x3b')]=qs[_0x7bdb('0x34')](_[_0x7bdb('0x3c')](_0x3b61b0[_0x7bdb('0x33')],_0x1cf8b1[_0x7bdb('0x34')]));if(_0x3b61b0['query']['filter']){_0x2b7c7e['where']=_[_0x7bdb('0x40')](_0x2b7c7e['where'],{'$or':_[_0x7bdb('0x2e')](_0x2b7c7e[_0x7bdb('0x37')],function(_0x139f4e){var _0x57d36d={};_0x57d36d[_0x139f4e]={'$like':'%'+_0x3b61b0['query'][_0x7bdb('0x3f')]+'%'};return _0x57d36d;})});}_0x2b7c7e=_[_0x7bdb('0x40')]({},_0x2b7c7e,_0x3b61b0[_0x7bdb('0x46')]);return _0x16141d[_0x7bdb('0x5a')](_0x2b7c7e);}})['then'](function(_0x194908){if(_0x194908){_0x3054fc=_0x194908[_0x7bdb('0x38')];if(!_0x3b61b0[_0x7bdb('0x33')][_0x7bdb('0x5d')](_0x7bdb('0x39'))){_0x2b7c7e[_0x7bdb('0x21')]=qs['limit'](_0x3b61b0[_0x7bdb('0x33')]['limit']);_0x2b7c7e[_0x7bdb('0x20')]=qs['offset'](_0x3b61b0[_0x7bdb('0x33')][_0x7bdb('0x20')]);}return _0x16141d[_0x7bdb('0x5a')](_0x2b7c7e);}})[_0x7bdb('0x27')](function(_0x7a8bec){if(_0x7a8bec){return _0x7a8bec?{'count':_0x3054fc,'rows':_0x7a8bec}:null;}})['then'](respondWithResult(_0x4fdec0,null))['catch'](handleError(_0x4fdec0,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 320ff7a..efbc915 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 _0x81a9=['SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x266618,_0x18f637){var _0x54dbf5=function(_0x1f7985){while(--_0x1f7985){_0x266618['push'](_0x266618['shift']());}};_0x54dbf5(++_0x18f637);}(_0x81a9,0x81));var _0x981a=function(_0x34e73a,_0x281fd3){_0x34e73a=_0x34e73a-0x0;var _0x226f41=_0x81a9[_0x34e73a];return _0x226f41;};'use strict';var EventEmitter=require(_0x981a('0x0'));var SquareProject=require('../../mysqldb')['db'][_0x981a('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x981a('0x2')](0x0);var events={'afterCreate':_0x981a('0x3'),'afterUpdate':_0x981a('0x4'),'afterDestroy':_0x981a('0x5')};function emitEvent(_0x4d9bdc){return function(_0x5647d8,_0x51b6e2,_0x16f165){SquareProjectEvents[_0x981a('0x6')](_0x4d9bdc+':'+_0x5647d8['id'],_0x5647d8);SquareProjectEvents['emit'](_0x4d9bdc,_0x5647d8);_0x16f165(null);};}for(var e in events){if(events[_0x981a('0x7')](e)){var event=events[e];SquareProject[_0x981a('0x8')](e,emitEvent(event));}}module[_0x981a('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0x81dc=['exports','../../mysqldb','SquareProject','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x153faa,_0x75f2a){var _0x43c32a=function(_0x1c5721){while(--_0x1c5721){_0x153faa['push'](_0x153faa['shift']());}};_0x43c32a(++_0x75f2a);}(_0x81dc,0x1e9));var _0xc81d=function(_0x35e92e,_0x21581b){_0x35e92e=_0x35e92e-0x0;var _0x1205a8=_0x81dc[_0x35e92e];return _0x1205a8;};'use strict';var EventEmitter=require('events');var SquareProject=require(_0xc81d('0x0'))['db'][_0xc81d('0x1')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xc81d('0x2')](0x0);var events={'afterCreate':_0xc81d('0x3'),'afterUpdate':_0xc81d('0x4'),'afterDestroy':'remove'};function emitEvent(_0x574c44){return function(_0x2a4396,_0x28fb3d,_0x572feb){SquareProjectEvents[_0xc81d('0x5')](_0x574c44+':'+_0x2a4396['id'],_0x2a4396);SquareProjectEvents['emit'](_0x574c44,_0x2a4396);_0x572feb(null);};}for(var e in events){if(events[_0xc81d('0x6')](e)){var event=events[e];SquareProject['hook'](e,emitEvent(event));}}module[_0xc81d('0x7')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index da24517..1f68101 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 _0xc022=['util','api','moment','request-promise','../../config/environment','./squareProject.attributes','exports','define','SquareProject','square_projects','lodash'];(function(_0x589da4,_0x303767){var _0x37ca68=function(_0x52d0f5){while(--_0x52d0f5){_0x589da4['push'](_0x589da4['shift']());}};_0x37ca68(++_0x303767);}(_0xc022,0x8e));var _0x2c02=function(_0x586fa2,_0x1a45bc){_0x586fa2=_0x586fa2-0x0;var _0x515be9=_0xc022[_0x586fa2];return _0x515be9;};'use strict';var _=require(_0x2c02('0x0'));var util=require(_0x2c02('0x1'));var logger=require('../../config/logger')(_0x2c02('0x2'));var moment=require(_0x2c02('0x3'));var BPromise=require('bluebird');var rp=require(_0x2c02('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x2c02('0x5'));var attributes=require(_0x2c02('0x6'));module[_0x2c02('0x7')]=function(_0x36f5ef,_0x456120){return _0x36f5ef[_0x2c02('0x8')](_0x2c02('0x9'),attributes,{'tableName':_0x2c02('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf103=['request-promise','path','../../config/environment','./squareProject.attributes','exports','square_projects','../../config/logger','api','moment','bluebird'];(function(_0x39639f,_0x4248c4){var _0x4b956d=function(_0x5f2aa2){while(--_0x5f2aa2){_0x39639f['push'](_0x39639f['shift']());}};_0x4b956d(++_0x4248c4);}(_0xf103,0x178));var _0x3f10=function(_0x4a28e5,_0x560443){_0x4a28e5=_0x4a28e5-0x0;var _0x344be2=_0xf103[_0x4a28e5];return _0x344be2;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3f10('0x0'))(_0x3f10('0x1'));var moment=require(_0x3f10('0x2'));var BPromise=require(_0x3f10('0x3'));var rp=require(_0x3f10('0x4'));var fs=require('fs');var path=require(_0x3f10('0x5'));var rimraf=require('rimraf');var config=require(_0x3f10('0x6'));var attributes=require(_0x3f10('0x7'));module[_0x3f10('0x8')]=function(_0xa21de0,_0x9f1c7b){return _0xa21de0['define']('SquareProject',attributes,{'tableName':_0x3f10('0x9'),'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 8432386..fe49a96 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 _0x9199=['stringify','error','code','message','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','redis','localhost','./squareProject.socket','register','request','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s'];(function(_0x165c96,_0x2269de){var _0x5c2420=function(_0x4e9a1e){while(--_0x4e9a1e){_0x165c96['push'](_0x165c96['shift']());}};_0x5c2420(++_0x2269de);}(_0x9199,0xa0));var _0x9919=function(_0x9be3f0,_0x628568){_0x9be3f0=_0x9be3f0-0x0;var _0x96930b=_0x9199[_0x9be3f0];return _0x96930b;};'use strict';var _=require(_0x9919('0x0'));var util=require(_0x9919('0x1'));var moment=require(_0x9919('0x2'));var BPromise=require(_0x9919('0x3'));var rs=require(_0x9919('0x4'));var fs=require('fs');var Redis=require(_0x9919('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9919('0x6'));var logger=require(_0x9919('0x7'))(_0x9919('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9919('0x9')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x9919('0xa')],{'host':_0x9919('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9919('0xa')]));require(_0x9919('0xc'))[_0x9919('0xd')](socket);function respondWithRpcPromise(_0x1c0f35,_0x5c30d6,_0x9a5834){return new BPromise(function(_0x2f2bb8,_0x4462ee){return client[_0x9919('0xe')](_0x1c0f35,_0x9a5834)[_0x9919('0xf')](function(_0x4e0bf5){logger[_0x9919('0x10')]('SquareProject,\x20%s,\x20%s',_0x5c30d6,_0x9919('0x11'));logger[_0x9919('0x12')](_0x9919('0x13'),_0x5c30d6,'request\x20sent',JSON[_0x9919('0x14')](_0x4e0bf5));if(_0x4e0bf5[_0x9919('0x15')]){if(_0x4e0bf5[_0x9919('0x15')][_0x9919('0x16')]===0x1f4){logger[_0x9919('0x15')]('SquareProject,\x20%s,\x20%s',_0x5c30d6,_0x4e0bf5[_0x9919('0x15')][_0x9919('0x17')]);return _0x4462ee(_0x4e0bf5[_0x9919('0x15')][_0x9919('0x17')]);}logger[_0x9919('0x15')]('SquareProject,\x20%s,\x20%s',_0x5c30d6,_0x4e0bf5[_0x9919('0x15')][_0x9919('0x17')]);return _0x2f2bb8(_0x4e0bf5['error']['message']);}else{logger[_0x9919('0x10')](_0x9919('0x18'),_0x5c30d6,_0x9919('0x11'));_0x2f2bb8(_0x4e0bf5[_0x9919('0x19')]['message']);}})[_0x9919('0x1a')](function(_0x1b68c2){logger['error'](_0x9919('0x18'),_0x5c30d6,_0x1b68c2);_0x4462ee(_0x1b68c2);});});}exports[_0x9919('0x1b')]=function(_0x2ad79f){var _0x32ab82=this;return new Promise(function(_0x33f933,_0x352d62){return db['SquareProject'][_0x9919('0x1c')]({'raw':_0x2ad79f['options']?_0x2ad79f[_0x9919('0x1d')][_0x9919('0x1e')]===undefined?!![]:![]:!![],'where':_0x2ad79f[_0x9919('0x1d')]?_0x2ad79f[_0x9919('0x1d')][_0x9919('0x1f')]||null:null,'attributes':_0x2ad79f[_0x9919('0x1d')]?_0x2ad79f[_0x9919('0x1d')][_0x9919('0x20')]||null:null,'include':_0x2ad79f[_0x9919('0x1d')]?_0x2ad79f[_0x9919('0x1d')][_0x9919('0x21')]?_[_0x9919('0x22')](_0x2ad79f[_0x9919('0x1d')][_0x9919('0x21')],function(_0x355341){return{'model':db[_0x355341['model']],'as':_0x355341['as'],'attributes':_0x355341['attributes'],'include':_0x355341[_0x9919('0x21')]?_[_0x9919('0x22')](_0x355341[_0x9919('0x21')],function(_0x1396fc){return{'model':db[_0x1396fc[_0x9919('0x23')]],'as':_0x1396fc['as'],'attributes':_0x1396fc[_0x9919('0x20')],'include':_0x1396fc[_0x9919('0x21')]?_['map'](_0x1396fc[_0x9919('0x21')],function(_0x102324){return{'model':db[_0x102324['model']],'as':_0x102324['as'],'attributes':_0x102324[_0x9919('0x20')]};}):[]};}):[]};}):[]:[]})[_0x9919('0xf')](function(_0x36e9e4){logger[_0x9919('0x10')](_0x9919('0x1b'),_0x2ad79f);logger[_0x9919('0x12')](_0x9919('0x1b'),_0x2ad79f,JSON['stringify'](_0x36e9e4));_0x33f933(_0x36e9e4);})[_0x9919('0x1a')](function(_0x1ec785){logger[_0x9919('0x15')]('ShowSquareProject',_0x1ec785[_0x9919('0x17')],_0x2ad79f);_0x352d62(_0x32ab82['error'](0x1f4,_0x1ec785[_0x9919('0x17')]));});});}; \ No newline at end of file +var _0x4f8a=['include','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info','SquareProject,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','ShowSquareProject','SquareProject','options','where','attributes','map','model'];(function(_0x49cff1,_0x4a06e6){var _0x12cbc4=function(_0x22484e){while(--_0x22484e){_0x49cff1['push'](_0x49cff1['shift']());}};_0x12cbc4(++_0x4a06e6);}(_0x4f8a,0x182));var _0xa4f8=function(_0x26b08d,_0x2e1f02){_0x26b08d=_0x26b08d-0x0;var _0x4137aa=_0x4f8a[_0x26b08d];return _0x4137aa;};'use strict';var _=require(_0xa4f8('0x0'));var util=require(_0xa4f8('0x1'));var moment=require(_0xa4f8('0x2'));var BPromise=require(_0xa4f8('0x3'));var rs=require(_0xa4f8('0x4'));var fs=require('fs');var Redis=require(_0xa4f8('0x5'));var db=require(_0xa4f8('0x6'))['db'];var utils=require(_0xa4f8('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xa4f8('0x8'));var jayson=require(_0xa4f8('0x9'));var client=jayson[_0xa4f8('0xa')][_0xa4f8('0xb')]({'port':0x232a});config[_0xa4f8('0xc')]=_[_0xa4f8('0xd')](config['redis'],{'host':_0xa4f8('0xe'),'port':0x18eb});var socket=require(_0xa4f8('0xf'))(new Redis(config[_0xa4f8('0xc')]));require('./squareProject.socket')[_0xa4f8('0x10')](socket);function respondWithRpcPromise(_0x15501e,_0x438089,_0x47245a){return new BPromise(function(_0x260fff,_0x19c5c0){return client['request'](_0x15501e,_0x47245a)[_0xa4f8('0x11')](function(_0x13ed27){logger[_0xa4f8('0x12')](_0xa4f8('0x13'),_0x438089,_0xa4f8('0x14'));logger[_0xa4f8('0x15')]('SquareProject,\x20%s,\x20%s,\x20%s',_0x438089,_0xa4f8('0x14'),JSON[_0xa4f8('0x16')](_0x13ed27));if(_0x13ed27['error']){if(_0x13ed27[_0xa4f8('0x17')][_0xa4f8('0x18')]===0x1f4){logger[_0xa4f8('0x17')]('SquareProject,\x20%s,\x20%s',_0x438089,_0x13ed27[_0xa4f8('0x17')][_0xa4f8('0x19')]);return _0x19c5c0(_0x13ed27[_0xa4f8('0x17')][_0xa4f8('0x19')]);}logger[_0xa4f8('0x17')](_0xa4f8('0x13'),_0x438089,_0x13ed27[_0xa4f8('0x17')][_0xa4f8('0x19')]);return _0x260fff(_0x13ed27['error'][_0xa4f8('0x19')]);}else{logger[_0xa4f8('0x12')](_0xa4f8('0x13'),_0x438089,_0xa4f8('0x14'));_0x260fff(_0x13ed27['result'][_0xa4f8('0x19')]);}})[_0xa4f8('0x1a')](function(_0x1e2536){logger[_0xa4f8('0x17')](_0xa4f8('0x13'),_0x438089,_0x1e2536);_0x19c5c0(_0x1e2536);});});}exports[_0xa4f8('0x1b')]=function(_0x28664e){var _0x1bc2f5=this;return new Promise(function(_0x123de3,_0x44dfa9){return db[_0xa4f8('0x1c')]['find']({'raw':_0x28664e['options']?_0x28664e[_0xa4f8('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x28664e['options']?_0x28664e[_0xa4f8('0x1d')][_0xa4f8('0x1e')]||null:null,'attributes':_0x28664e[_0xa4f8('0x1d')]?_0x28664e[_0xa4f8('0x1d')][_0xa4f8('0x1f')]||null:null,'include':_0x28664e[_0xa4f8('0x1d')]?_0x28664e[_0xa4f8('0x1d')]['include']?_[_0xa4f8('0x20')](_0x28664e['options']['include'],function(_0x2dcc44){return{'model':db[_0x2dcc44[_0xa4f8('0x21')]],'as':_0x2dcc44['as'],'attributes':_0x2dcc44[_0xa4f8('0x1f')],'include':_0x2dcc44[_0xa4f8('0x22')]?_[_0xa4f8('0x20')](_0x2dcc44[_0xa4f8('0x22')],function(_0x34edc0){return{'model':db[_0x34edc0['model']],'as':_0x34edc0['as'],'attributes':_0x34edc0[_0xa4f8('0x1f')],'include':_0x34edc0[_0xa4f8('0x22')]?_[_0xa4f8('0x20')](_0x34edc0[_0xa4f8('0x22')],function(_0x47f9e5){return{'model':db[_0x47f9e5['model']],'as':_0x47f9e5['as'],'attributes':_0x47f9e5[_0xa4f8('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x393b05){logger[_0xa4f8('0x12')](_0xa4f8('0x1b'),_0x28664e);logger[_0xa4f8('0x15')]('ShowSquareProject',_0x28664e,JSON[_0xa4f8('0x16')](_0x393b05));_0x123de3(_0x393b05);})['catch'](function(_0x31d9d5){logger['error'](_0xa4f8('0x1b'),_0x31d9d5[_0xa4f8('0x19')],_0x28664e);_0x44dfa9(_0x1bc2f5[_0xa4f8('0x17')](0x1f4,_0x31d9d5[_0xa4f8('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 359a1dc..2b01b82 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 _0x31f0=['emit','removeListener','squareProject:','./squareProject.events','remove'];(function(_0x5277ca,_0xba5908){var _0x4e1771=function(_0x701926){while(--_0x701926){_0x5277ca['push'](_0x5277ca['shift']());}};_0x4e1771(++_0xba5908);}(_0x31f0,0xb7));var _0x031f=function(_0x2f1fc7,_0x11ead9){_0x2f1fc7=_0x2f1fc7-0x0;var _0x4951dd=_0x31f0[_0x2f1fc7];return _0x4951dd;};'use strict';var SquareProjectEvents=require(_0x031f('0x0'));var events=['save',_0x031f('0x1'),'update'];function createListener(_0x3747a5,_0x2021ea){return function(_0x2b04d4){_0x2021ea[_0x031f('0x2')](_0x3747a5,_0x2b04d4);};}function removeListener(_0x526a45,_0x3c0612){return function(){SquareProjectEvents[_0x031f('0x3')](_0x526a45,_0x3c0612);};}exports['register']=function(_0x4c0f94){for(var _0x56328c=0x0,_0x3dc98e=events['length'];_0x56328c<_0x3dc98e;_0x56328c++){var _0x365f59=events[_0x56328c];var _0x4300b4=createListener(_0x031f('0x4')+_0x365f59,_0x4c0f94);SquareProjectEvents['on'](_0x365f59,_0x4300b4);}}; \ No newline at end of file +var _0x2542=['squareProject:','./squareProject.events','save','remove','update','emit','removeListener','register','length'];(function(_0x23b0eb,_0x30ba3e){var _0x4d4e00=function(_0x1f04cc){while(--_0x1f04cc){_0x23b0eb['push'](_0x23b0eb['shift']());}};_0x4d4e00(++_0x30ba3e);}(_0x2542,0x169));var _0x2254=function(_0x4b77d1,_0xefe054){_0x4b77d1=_0x4b77d1-0x0;var _0x6f95d0=_0x2542[_0x4b77d1];return _0x6f95d0;};'use strict';var SquareProjectEvents=require(_0x2254('0x0'));var events=[_0x2254('0x1'),_0x2254('0x2'),_0x2254('0x3')];function createListener(_0x578407,_0x105910){return function(_0x47b1da){_0x105910[_0x2254('0x4')](_0x578407,_0x47b1da);};}function removeListener(_0x3b3dcb,_0x27f5c9){return function(){SquareProjectEvents[_0x2254('0x5')](_0x3b3dcb,_0x27f5c9);};}exports[_0x2254('0x6')]=function(_0x508183){for(var _0x19ad3c=0x0,_0xe8ca50=events[_0x2254('0x7')];_0x19ad3c<_0xe8ca50;_0x19ad3c++){var _0x3c45ec=events[_0x19ad3c];var _0x1637ad=createListener(_0x2254('0x8')+_0x3c45ec,_0x508183);SquareProjectEvents['on'](_0x3c45ec,_0x1637ad);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 9c86b5c..b7eaafc 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 _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','delete','exports'];(function(_0x138b52,_0x4e67c4){var _0x4a4a3c=function(_0x5c0ec3){while(--_0x5c0ec3){_0x138b52['push'](_0x138b52['shift']());}};_0x4a4a3c(++_0x4e67c4);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3b08de,_0x63ddd0){_0x3b08de=_0x3b08de-0x0;var _0x53fbe4=_0x0b0e[_0x3b08de];return _0x53fbe4;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file +var _0x2032=['show','/:id/download','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id'];(function(_0x2af8a5,_0x8ae75e){var _0x3ad004=function(_0x3bc1a1){while(--_0x3bc1a1){_0x2af8a5['push'](_0x2af8a5['shift']());}};_0x3ad004(++_0x8ae75e);}(_0x2032,0xd9));var _0x2203=function(_0x1e11d7,_0x5e6658){_0x1e11d7=_0x1e11d7-0x0;var _0x2b3461=_0x2032[_0x1e11d7];return _0x2b3461;};'use strict';var multer=require('multer');var util=require(_0x2203('0x0'));var path=require(_0x2203('0x1'));var timeout=require(_0x2203('0x2'));var express=require('express');var router=express[_0x2203('0x3')]();var auth=require(_0x2203('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2203('0x5'));var controller=require(_0x2203('0x6'));router[_0x2203('0x7')]('/',auth[_0x2203('0x8')](),controller[_0x2203('0x9')]);router[_0x2203('0x7')](_0x2203('0xa'),auth[_0x2203('0x8')](),controller[_0x2203('0xb')]);router[_0x2203('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xa'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xa'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index ee64548..45b0927 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 _0xe2c0=['STRING','sequelize'];(function(_0x57739d,_0x3055f1){var _0x191c70=function(_0x70130d){while(--_0x70130d){_0x57739d['push'](_0x57739d['shift']());}};_0x191c70(++_0x3055f1);}(_0xe2c0,0x149));var _0x0e2c=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xe2c0[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x0e2c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x0e2c('0x1')]},'callerid':{'type':Sequelize[_0x0e2c('0x1')]},'calleridname':{'type':Sequelize[_0x0e2c('0x1')]},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x0e2c('0x1')]},'priority':{'type':Sequelize[_0x0e2c('0x1')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x0e2c('0x1')]},'projectName':{'type':Sequelize[_0x0e2c('0x1')]},'saveName':{'type':Sequelize[_0x0e2c('0x1')]},'filename':{'type':Sequelize[_0x0e2c('0x1')]},'savePath':{'type':Sequelize[_0x0e2c('0x1')]}}; \ No newline at end of file +var _0x6b7d=['sequelize','exports','STRING'];(function(_0x26b5ff,_0x92009a){var _0x58603e=function(_0x4454ff){while(--_0x4454ff){_0x26b5ff['push'](_0x26b5ff['shift']());}};_0x58603e(++_0x92009a);}(_0x6b7d,0x10b));var _0xd6b7=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6b7d[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xd6b7('0x0'));module[_0xd6b7('0x1')]={'uniqueid':{'type':Sequelize[_0xd6b7('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0xd6b7('0x2')]},'priority':{'type':Sequelize[_0xd6b7('0x2')]},'accountcode':{'type':Sequelize[_0xd6b7('0x2')]},'dnid':{'type':Sequelize[_0xd6b7('0x2')]},'projectName':{'type':Sequelize[_0xd6b7('0x2')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize[_0xd6b7('0x2')]},'savePath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 7583fc0..1510be5 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 _0xee4e=['show','params','keys','length','includeAll','include','options','find','create','body','update','download','uniqueid','filename','savePath','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','extname','unlink','message','Not\x20found','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','end','status','offset','limit','set','Content-Range','json','apply','save','then','destroy','error','name','send','index','SquareRecording','rawAttributes','type','key','map','filters','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','count','findAll','rows','catch'];(function(_0x3c22e0,_0x1dc6ea){var _0x215811=function(_0x1b453c){while(--_0x1b453c){_0x3c22e0['push'](_0x3c22e0['shift']());}};_0x215811(++_0x1dc6ea);}(_0xee4e,0x122));var _0xeee4=function(_0x31e29a,_0x349c9b){_0x31e29a=_0x31e29a-0x0;var _0x32d892=_0xee4e[_0x31e29a];return _0x32d892;};'use strict';var pdf=require(_0xeee4('0x0'));var emlformat=require(_0xeee4('0x1'));var rimraf=require(_0xeee4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xeee4('0x3'));var rp=require(_0xeee4('0x4'));var moment=require(_0xeee4('0x5'));var BPromise=require(_0xeee4('0x6'));var Mustache=require(_0xeee4('0x7'));var util=require(_0xeee4('0x8'));var path=require(_0xeee4('0x9'));var sox=require(_0xeee4('0xa'));var csv=require('to-csv');var ejs=require(_0xeee4('0xb'));var fs=require('fs');var _=require(_0xeee4('0xc'));var squel=require(_0xeee4('0xd'));var crypto=require('crypto');var jsforce=require(_0xeee4('0xe'));var deskjs=require(_0xeee4('0xf'));var toCsv=require(_0xeee4('0x10'));var querystring=require('querystring');var Papa=require(_0xeee4('0x11'));var Redis=require(_0xeee4('0x12'));var authService=require(_0xeee4('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xeee4('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xeee4('0x15'))(_0xeee4('0x16'));var utils=require(_0xeee4('0x17'));var config=require('../../config/environment');var db=require(_0xeee4('0x18'))['db'];function respondWithStatusCode(_0xab281b,_0x348c96){_0x348c96=_0x348c96||0xcc;return function(_0x138272){if(_0x138272){return _0xab281b['sendStatus'](_0x348c96);}return _0xab281b['status'](_0x348c96)[_0xeee4('0x19')]();};}function respondWithResult(_0x2433dd,_0xa32975){_0xa32975=_0xa32975||0xc8;return function(_0x498725){if(_0x498725){return _0x2433dd[_0xeee4('0x1a')](_0xa32975)['json'](_0x498725);}};}function respondWithFilteredResult(_0x4c35e1,_0x288ded){return function(_0x44631d){if(_0x44631d){var _0x1fc948=_0x44631d['count'],_0x1e0af2=_0x288ded[_0xeee4('0x1b')],_0xf3e60b=_0x288ded['offset']+_0x288ded[_0xeee4('0x1c')],_0x3cf8eb;if(_0xf3e60b>=_0x1fc948){_0xf3e60b=_0x1fc948;_0x3cf8eb=0xc8;}else{_0x3cf8eb=0xce;}_0x4c35e1['status'](_0x3cf8eb);return _0x4c35e1[_0xeee4('0x1d')](_0xeee4('0x1e'),_0x1e0af2+'-'+_0xf3e60b+'/'+_0x1fc948)[_0xeee4('0x1f')](_0x44631d);}return null;};}function patchUpdates(_0x557433){return function(_0x347416){try{jsonpatch[_0xeee4('0x20')](_0x347416,_0x557433,!![]);}catch(_0x2edbde){return BPromise['reject'](_0x2edbde);}return _0x347416[_0xeee4('0x21')]();};}function saveUpdates(_0x33765d,_0x3a981c){return function(_0x47190a){if(_0x47190a){return _0x47190a['update'](_0x33765d)[_0xeee4('0x22')](function(_0x1e470d){return _0x1e470d;});}return null;};}function removeEntity(_0x4970df,_0x3a3c63){return function(_0x414a14){if(_0x414a14){return _0x414a14[_0xeee4('0x23')]()[_0xeee4('0x22')](function(){_0x4970df['status'](0xcc)[_0xeee4('0x19')]();});}};}function handleEntityNotFound(_0x446f79,_0x28276e){return function(_0x5623e6){if(!_0x5623e6){_0x446f79['sendStatus'](0x194);}return _0x5623e6;};}function handleError(_0x2c27e0,_0x414644){_0x414644=_0x414644||0x1f4;return function(_0x4ef962){logger[_0xeee4('0x24')](_0x4ef962['stack']);if(_0x4ef962[_0xeee4('0x25')]){delete _0x4ef962[_0xeee4('0x25')];}_0x2c27e0[_0xeee4('0x1a')](_0x414644)[_0xeee4('0x26')](_0x4ef962);};}exports[_0xeee4('0x27')]=function(_0x42b4f9,_0x41ef12){var _0x42c89c={},_0x2cdee7={},_0x23b33c={'count':0x0,'rows':[]};var _0x5f17a4=_['map'](db[_0xeee4('0x28')][_0xeee4('0x29')],function(_0x4f0873){return{'name':_0x4f0873['fieldName'],'type':_0x4f0873[_0xeee4('0x2a')][_0xeee4('0x2b')]};});_0x2cdee7['model']=_[_0xeee4('0x2c')](_0x5f17a4,_0xeee4('0x25'));_0x2cdee7['query']=_['keys'](_0x42b4f9['query']);_0x2cdee7[_0xeee4('0x2d')]=_[_0xeee4('0x2e')](_0x2cdee7[_0xeee4('0x2f')],_0x2cdee7[_0xeee4('0x30')]);_0x42c89c[_0xeee4('0x31')]=_[_0xeee4('0x2e')](_0x2cdee7[_0xeee4('0x2f')],qs[_0xeee4('0x32')](_0x42b4f9['query']['fields']));_0x42c89c['attributes']=_0x42c89c[_0xeee4('0x31')]['length']?_0x42c89c[_0xeee4('0x31')]:_0x2cdee7[_0xeee4('0x2f')];if(!_0x42b4f9[_0xeee4('0x30')][_0xeee4('0x33')](_0xeee4('0x34'))){_0x42c89c[_0xeee4('0x1c')]=qs[_0xeee4('0x1c')](_0x42b4f9['query'][_0xeee4('0x1c')]);_0x42c89c[_0xeee4('0x1b')]=qs['offset'](_0x42b4f9['query'][_0xeee4('0x1b')]);}_0x42c89c['order']=qs[_0xeee4('0x35')](_0x42b4f9[_0xeee4('0x30')][_0xeee4('0x35')]);_0x42c89c[_0xeee4('0x36')]=qs['filters'](_['pick'](_0x42b4f9[_0xeee4('0x30')],_0x2cdee7['filters']));if(_0x42b4f9[_0xeee4('0x30')][_0xeee4('0x37')]){_0x42c89c[_0xeee4('0x36')]=_[_0xeee4('0x38')](_0x42c89c[_0xeee4('0x36')],{'$or':_[_0xeee4('0x2c')](_0x5f17a4,function(_0x5aa50e){if(_0x5aa50e[_0xeee4('0x2a')]!==_0xeee4('0x39')){var _0x1f65c3={};_0x1f65c3[_0x5aa50e[_0xeee4('0x25')]]={'$like':'%'+_0x42b4f9[_0xeee4('0x30')][_0xeee4('0x37')]+'%'};return _0x1f65c3;}})});}_0x42c89c=_[_0xeee4('0x38')]({},_0x42c89c,_0x42b4f9['options']);var _0x27da76={'where':_0x42c89c[_0xeee4('0x36')]};return db[_0xeee4('0x28')][_0xeee4('0x3a')](_0x27da76)[_0xeee4('0x22')](function(_0x19ee49){_0x23b33c['count']=_0x19ee49;if(_0x42b4f9[_0xeee4('0x30')]['includeAll']){_0x42c89c['include']=[{'all':!![]}];}return db['SquareRecording'][_0xeee4('0x3b')](_0x42c89c);})[_0xeee4('0x22')](function(_0x5bdf2d){_0x23b33c[_0xeee4('0x3c')]=_0x5bdf2d;return _0x23b33c;})[_0xeee4('0x22')](respondWithFilteredResult(_0x41ef12,_0x42c89c))[_0xeee4('0x3d')](handleError(_0x41ef12,null));};exports[_0xeee4('0x3e')]=function(_0xb4ce64,_0x2d6aca){var _0x2a2409={'raw':!![],'where':{'id':_0xb4ce64[_0xeee4('0x3f')]['id']}},_0x209505={};_0x209505[_0xeee4('0x2f')]=_[_0xeee4('0x40')](db[_0xeee4('0x28')][_0xeee4('0x29')]);_0x209505[_0xeee4('0x30')]=_[_0xeee4('0x40')](_0xb4ce64['query']);_0x209505['filters']=_[_0xeee4('0x2e')](_0x209505[_0xeee4('0x2f')],_0x209505[_0xeee4('0x30')]);_0x2a2409[_0xeee4('0x31')]=_['intersection'](_0x209505['model'],qs[_0xeee4('0x32')](_0xb4ce64[_0xeee4('0x30')][_0xeee4('0x32')]));_0x2a2409['attributes']=_0x2a2409['attributes'][_0xeee4('0x41')]?_0x2a2409[_0xeee4('0x31')]:_0x209505[_0xeee4('0x2f')];if(_0xb4ce64[_0xeee4('0x30')][_0xeee4('0x42')]){_0x2a2409[_0xeee4('0x43')]=[{'all':!![]}];}_0x2a2409=_[_0xeee4('0x38')]({},_0x2a2409,_0xb4ce64[_0xeee4('0x44')]);return db[_0xeee4('0x28')][_0xeee4('0x45')](_0x2a2409)[_0xeee4('0x22')](handleEntityNotFound(_0x2d6aca,null))[_0xeee4('0x22')](respondWithResult(_0x2d6aca,null))[_0xeee4('0x3d')](handleError(_0x2d6aca,null));};exports[_0xeee4('0x46')]=function(_0x1b4bdd,_0x191aae){return db[_0xeee4('0x28')][_0xeee4('0x46')](_0x1b4bdd[_0xeee4('0x47')],{})[_0xeee4('0x22')](respondWithResult(_0x191aae,0xc9))['catch'](handleError(_0x191aae,null));};exports[_0xeee4('0x48')]=function(_0x507c6d,_0x54adc3){if(_0x507c6d['body']['id']){delete _0x507c6d[_0xeee4('0x47')]['id'];}return db[_0xeee4('0x28')]['find']({'where':{'id':_0x507c6d[_0xeee4('0x3f')]['id']}})['then'](handleEntityNotFound(_0x54adc3,null))[_0xeee4('0x22')](saveUpdates(_0x507c6d['body'],null))[_0xeee4('0x22')](respondWithResult(_0x54adc3,null))[_0xeee4('0x3d')](handleError(_0x54adc3,null));};exports[_0xeee4('0x23')]=function(_0x29b599,_0x2c5c5e){return db[_0xeee4('0x28')]['find']({'where':{'id':_0x29b599[_0xeee4('0x3f')]['id']}})[_0xeee4('0x22')](handleEntityNotFound(_0x2c5c5e,null))[_0xeee4('0x22')](removeEntity(_0x2c5c5e,null))[_0xeee4('0x3d')](handleError(_0x2c5c5e,null));};exports[_0xeee4('0x49')]=function(_0x3063de,_0x54acf0,_0x2874d7){var _0x13aebc=require('../../components/encryptor');var _0x255b33=![];var _0x3a8097={};if(_0x3063de[_0xeee4('0x30')][_0xeee4('0x2a')]&&_0x3063de['query'][_0xeee4('0x2a')]===_0xeee4('0x4a')){_0x3a8097[_0xeee4('0x4a')]=_0x3063de['params']['id'];}else{_0x3a8097['id']=_0x3063de[_0xeee4('0x3f')]['id'];}return db[_0xeee4('0x28')][_0xeee4('0x45')]({'where':_0x3a8097,'attributes':['id','savePath',_0xeee4('0x4b')],'raw':!![]})[_0xeee4('0x22')](handleEntityNotFound(_0x54acf0,null))[_0xeee4('0x22')](function(_0x1ae1cb){if(_0x1ae1cb){var _0x18f95b=_0x1ae1cb[_0xeee4('0x4c')];var _0x86fbc3=util['format'](_0xeee4('0x4d'),_0x18f95b);if(fs['existsSync'](_0x86fbc3)){_0x255b33=!![];return _0x13aebc[_0xeee4('0x4e')](_0x86fbc3,_0x18f95b,config[_0xeee4('0x4f')]['recording'])[_0xeee4('0x22')](function(){return _0x1ae1cb;});}return _0x1ae1cb;}})['then'](function(_0x3cada7){if(_0x3cada7){var _0x122d64=_0x3cada7['savePath'];if(!fs[_0xeee4('0x50')](_0x122d64)){throw new db[(_0xeee4('0x51'))][(_0xeee4('0x52'))](_0xeee4('0x53'));}if(_0x3cada7[_0xeee4('0x4b')]){return _0x54acf0[_0xeee4('0x49')](_0x122d64,_0x3cada7['filename']+path[_0xeee4('0x54')](_0x122d64),function(){if(_0x255b33){fs[_0xeee4('0x55')](_0x122d64);}});}else{return _0x54acf0['download'](_0x122d64,function(_0x5797ee){if(_0x255b33){fs['unlink'](_0x122d64);}});}}})['catch'](function(_0x227d00){if(_0x227d00[_0xeee4('0x56')]===_0xeee4('0x53')){_0x54acf0['status'](0x194)['send'](_0xeee4('0x57'));}else{return handleError(_0x54acf0,null);}});}; \ No newline at end of file +var _0x2fe5=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','count','set','Content-Range','apply','save','update','then','destroy','sendStatus','error','stack','name','index','SquareRecording','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','decryptFile','secrets','recording','Sequelize','SquareRecording\x20not\x20found','unlink','message','send','Not\x20found','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse'];(function(_0x486224,_0x2ef59a){var _0x5d5932=function(_0x3ba24f){while(--_0x3ba24f){_0x486224['push'](_0x486224['shift']());}};_0x5d5932(++_0x2ef59a);}(_0x2fe5,0x14b));var _0x52fe=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2fe5[_0x19950b];return _0x3c6b41;};'use strict';var pdf=require(_0x52fe('0x0'));var emlformat=require(_0x52fe('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x52fe('0x2'));var rp=require(_0x52fe('0x3'));var moment=require(_0x52fe('0x4'));var BPromise=require(_0x52fe('0x5'));var Mustache=require(_0x52fe('0x6'));var util=require('util');var path=require(_0x52fe('0x7'));var sox=require(_0x52fe('0x8'));var csv=require('to-csv');var ejs=require(_0x52fe('0x9'));var fs=require('fs');var _=require(_0x52fe('0xa'));var squel=require(_0x52fe('0xb'));var crypto=require(_0x52fe('0xc'));var jsforce=require(_0x52fe('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x52fe('0xe'));var querystring=require(_0x52fe('0xf'));var Papa=require(_0x52fe('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x52fe('0x11'));var as=require(_0x52fe('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x52fe('0x13'))(_0x52fe('0x14'));var utils=require(_0x52fe('0x15'));var config=require(_0x52fe('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x23d6ca,_0x5ac581){_0x5ac581=_0x5ac581||0xcc;return function(_0x43a33b){if(_0x43a33b){return _0x23d6ca['sendStatus'](_0x5ac581);}return _0x23d6ca[_0x52fe('0x17')](_0x5ac581)[_0x52fe('0x18')]();};}function respondWithResult(_0x6a5ab4,_0x270f22){_0x270f22=_0x270f22||0xc8;return function(_0x49a518){if(_0x49a518){return _0x6a5ab4[_0x52fe('0x17')](_0x270f22)[_0x52fe('0x19')](_0x49a518);}};}function respondWithFilteredResult(_0x2f337c,_0x43e6ca){return function(_0x2bff26){if(_0x2bff26){var _0xcce970=_0x2bff26[_0x52fe('0x1a')],_0x3f111c=_0x43e6ca['offset'],_0x3253ff=_0x43e6ca['offset']+_0x43e6ca['limit'],_0x1088c3;if(_0x3253ff>=_0xcce970){_0x3253ff=_0xcce970;_0x1088c3=0xc8;}else{_0x1088c3=0xce;}_0x2f337c[_0x52fe('0x17')](_0x1088c3);return _0x2f337c[_0x52fe('0x1b')](_0x52fe('0x1c'),_0x3f111c+'-'+_0x3253ff+'/'+_0xcce970)[_0x52fe('0x19')](_0x2bff26);}return null;};}function patchUpdates(_0x407c3f){return function(_0x6e336e){try{jsonpatch[_0x52fe('0x1d')](_0x6e336e,_0x407c3f,!![]);}catch(_0x3355a0){return BPromise['reject'](_0x3355a0);}return _0x6e336e[_0x52fe('0x1e')]();};}function saveUpdates(_0x4585ad,_0x4e34ec){return function(_0x54c49b){if(_0x54c49b){return _0x54c49b[_0x52fe('0x1f')](_0x4585ad)[_0x52fe('0x20')](function(_0x53da90){return _0x53da90;});}return null;};}function removeEntity(_0x1f2bd7,_0x24c583){return function(_0x2d1c96){if(_0x2d1c96){return _0x2d1c96[_0x52fe('0x21')]()['then'](function(){_0x1f2bd7['status'](0xcc)[_0x52fe('0x18')]();});}};}function handleEntityNotFound(_0xc4f56,_0x5a63d8){return function(_0x51ace0){if(!_0x51ace0){_0xc4f56[_0x52fe('0x22')](0x194);}return _0x51ace0;};}function handleError(_0x40367e,_0x27a3f3){_0x27a3f3=_0x27a3f3||0x1f4;return function(_0x242a07){logger[_0x52fe('0x23')](_0x242a07[_0x52fe('0x24')]);if(_0x242a07[_0x52fe('0x25')]){delete _0x242a07[_0x52fe('0x25')];}_0x40367e['status'](_0x27a3f3)['send'](_0x242a07);};}exports[_0x52fe('0x26')]=function(_0x1c601c,_0xd9e423){var _0x3b6e09={},_0x5e7a3b={},_0x17afbd={'count':0x0,'rows':[]};var _0x2ac896=_['map'](db[_0x52fe('0x27')][_0x52fe('0x28')],function(_0x1f783d){return{'name':_0x1f783d['fieldName'],'type':_0x1f783d[_0x52fe('0x29')][_0x52fe('0x2a')]};});_0x5e7a3b[_0x52fe('0x2b')]=_[_0x52fe('0x2c')](_0x2ac896,'name');_0x5e7a3b[_0x52fe('0x2d')]=_[_0x52fe('0x2e')](_0x1c601c[_0x52fe('0x2d')]);_0x5e7a3b[_0x52fe('0x2f')]=_[_0x52fe('0x30')](_0x5e7a3b[_0x52fe('0x2b')],_0x5e7a3b[_0x52fe('0x2d')]);_0x3b6e09[_0x52fe('0x31')]=_[_0x52fe('0x30')](_0x5e7a3b[_0x52fe('0x2b')],qs[_0x52fe('0x32')](_0x1c601c[_0x52fe('0x2d')][_0x52fe('0x32')]));_0x3b6e09[_0x52fe('0x31')]=_0x3b6e09[_0x52fe('0x31')][_0x52fe('0x33')]?_0x3b6e09['attributes']:_0x5e7a3b['model'];if(!_0x1c601c[_0x52fe('0x2d')]['hasOwnProperty'](_0x52fe('0x34'))){_0x3b6e09[_0x52fe('0x35')]=qs[_0x52fe('0x35')](_0x1c601c[_0x52fe('0x2d')][_0x52fe('0x35')]);_0x3b6e09[_0x52fe('0x36')]=qs[_0x52fe('0x36')](_0x1c601c['query'][_0x52fe('0x36')]);}_0x3b6e09['order']=qs[_0x52fe('0x37')](_0x1c601c[_0x52fe('0x2d')]['sort']);_0x3b6e09[_0x52fe('0x38')]=qs['filters'](_[_0x52fe('0x39')](_0x1c601c['query'],_0x5e7a3b[_0x52fe('0x2f')]));if(_0x1c601c[_0x52fe('0x2d')][_0x52fe('0x3a')]){_0x3b6e09[_0x52fe('0x38')]=_[_0x52fe('0x3b')](_0x3b6e09['where'],{'$or':_['map'](_0x2ac896,function(_0x31d22e){if(_0x31d22e[_0x52fe('0x29')]!==_0x52fe('0x3c')){var _0x3e7d0d={};_0x3e7d0d[_0x31d22e['name']]={'$like':'%'+_0x1c601c['query'][_0x52fe('0x3a')]+'%'};return _0x3e7d0d;}})});}_0x3b6e09=_[_0x52fe('0x3b')]({},_0x3b6e09,_0x1c601c[_0x52fe('0x3d')]);var _0x2ac418={'where':_0x3b6e09[_0x52fe('0x38')]};return db[_0x52fe('0x27')][_0x52fe('0x1a')](_0x2ac418)['then'](function(_0x1fb882){_0x17afbd[_0x52fe('0x1a')]=_0x1fb882;if(_0x1c601c[_0x52fe('0x2d')]['includeAll']){_0x3b6e09[_0x52fe('0x3e')]=[{'all':!![]}];}return db[_0x52fe('0x27')][_0x52fe('0x3f')](_0x3b6e09);})[_0x52fe('0x20')](function(_0x421cd6){_0x17afbd[_0x52fe('0x40')]=_0x421cd6;return _0x17afbd;})['then'](respondWithFilteredResult(_0xd9e423,_0x3b6e09))[_0x52fe('0x41')](handleError(_0xd9e423,null));};exports[_0x52fe('0x42')]=function(_0x13ca63,_0x14077a){var _0x267e9={'raw':!![],'where':{'id':_0x13ca63[_0x52fe('0x43')]['id']}},_0x40a5a9={};_0x40a5a9[_0x52fe('0x2b')]=_['keys'](db[_0x52fe('0x27')][_0x52fe('0x28')]);_0x40a5a9[_0x52fe('0x2d')]=_[_0x52fe('0x2e')](_0x13ca63[_0x52fe('0x2d')]);_0x40a5a9['filters']=_['intersection'](_0x40a5a9[_0x52fe('0x2b')],_0x40a5a9['query']);_0x267e9[_0x52fe('0x31')]=_['intersection'](_0x40a5a9[_0x52fe('0x2b')],qs[_0x52fe('0x32')](_0x13ca63[_0x52fe('0x2d')]['fields']));_0x267e9['attributes']=_0x267e9[_0x52fe('0x31')]['length']?_0x267e9[_0x52fe('0x31')]:_0x40a5a9[_0x52fe('0x2b')];if(_0x13ca63[_0x52fe('0x2d')]['includeAll']){_0x267e9['include']=[{'all':!![]}];}_0x267e9=_[_0x52fe('0x3b')]({},_0x267e9,_0x13ca63[_0x52fe('0x3d')]);return db[_0x52fe('0x27')][_0x52fe('0x44')](_0x267e9)[_0x52fe('0x20')](handleEntityNotFound(_0x14077a,null))[_0x52fe('0x20')](respondWithResult(_0x14077a,null))[_0x52fe('0x41')](handleError(_0x14077a,null));};exports['create']=function(_0x4884de,_0x451d5b){return db[_0x52fe('0x27')][_0x52fe('0x45')](_0x4884de[_0x52fe('0x46')],{})[_0x52fe('0x20')](respondWithResult(_0x451d5b,0xc9))['catch'](handleError(_0x451d5b,null));};exports[_0x52fe('0x1f')]=function(_0x34117a,_0x3b2a35){if(_0x34117a[_0x52fe('0x46')]['id']){delete _0x34117a[_0x52fe('0x46')]['id'];}return db[_0x52fe('0x27')]['find']({'where':{'id':_0x34117a[_0x52fe('0x43')]['id']}})[_0x52fe('0x20')](handleEntityNotFound(_0x3b2a35,null))[_0x52fe('0x20')](saveUpdates(_0x34117a['body'],null))[_0x52fe('0x20')](respondWithResult(_0x3b2a35,null))[_0x52fe('0x41')](handleError(_0x3b2a35,null));};exports[_0x52fe('0x21')]=function(_0x1b3b0f,_0x2608ef){return db[_0x52fe('0x27')][_0x52fe('0x44')]({'where':{'id':_0x1b3b0f[_0x52fe('0x43')]['id']}})['then'](handleEntityNotFound(_0x2608ef,null))[_0x52fe('0x20')](removeEntity(_0x2608ef,null))[_0x52fe('0x41')](handleError(_0x2608ef,null));};exports[_0x52fe('0x47')]=function(_0x4359ac,_0x11d711,_0x70e663){var _0x3391b6=require(_0x52fe('0x48'));var _0x519e71=![];var _0x27dca1={};if(_0x4359ac['query'][_0x52fe('0x29')]&&_0x4359ac[_0x52fe('0x2d')][_0x52fe('0x29')]===_0x52fe('0x49')){_0x27dca1[_0x52fe('0x49')]=_0x4359ac[_0x52fe('0x43')]['id'];}else{_0x27dca1['id']=_0x4359ac[_0x52fe('0x43')]['id'];}return db[_0x52fe('0x27')][_0x52fe('0x44')]({'where':_0x27dca1,'attributes':['id',_0x52fe('0x4a'),_0x52fe('0x4b')],'raw':!![]})[_0x52fe('0x20')](handleEntityNotFound(_0x11d711,null))[_0x52fe('0x20')](function(_0x57d858){if(_0x57d858){var _0x96ac27=_0x57d858[_0x52fe('0x4a')];var _0x437d4e=util[_0x52fe('0x4c')](_0x52fe('0x4d'),_0x96ac27);if(fs['existsSync'](_0x437d4e)){_0x519e71=!![];return _0x3391b6[_0x52fe('0x4e')](_0x437d4e,_0x96ac27,config[_0x52fe('0x4f')][_0x52fe('0x50')])[_0x52fe('0x20')](function(){return _0x57d858;});}return _0x57d858;}})[_0x52fe('0x20')](function(_0x1f6064){if(_0x1f6064){var _0xe860bf=_0x1f6064[_0x52fe('0x4a')];if(!fs['existsSync'](_0xe860bf)){throw new db[(_0x52fe('0x51'))]['ValidationError'](_0x52fe('0x52'));}if(_0x1f6064[_0x52fe('0x4b')]){return _0x11d711[_0x52fe('0x47')](_0xe860bf,_0x1f6064['filename']+path['extname'](_0xe860bf),function(){if(_0x519e71){fs[_0x52fe('0x53')](_0xe860bf);}});}else{return _0x11d711[_0x52fe('0x47')](_0xe860bf,function(_0x45a782){if(_0x519e71){fs[_0x52fe('0x53')](_0xe860bf);}});}}})[_0x52fe('0x41')](function(_0x4d6bef){if(_0x4d6bef[_0x52fe('0x54')]===_0x52fe('0x52')){_0x11d711[_0x52fe('0x17')](0x194)[_0x52fe('0x55')](_0x52fe('0x56'));}else{return handleError(_0x11d711,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 162cc06..e32e8f3 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 _0x317b=['util','api','moment','request-promise','path','rimraf','../../config/environment','./squareRecording.attributes','exports','define','SquareRecording','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x317b,0x1c7));var _0xb317=function(_0x5c7430,_0x2abeaf){_0x5c7430=_0x5c7430-0x0;var _0x4037ee=_0x317b[_0x5c7430];return _0x4037ee;};'use strict';var _=require(_0xb317('0x0'));var util=require(_0xb317('0x1'));var logger=require('../../config/logger')(_0xb317('0x2'));var moment=require(_0xb317('0x3'));var BPromise=require('bluebird');var rp=require(_0xb317('0x4'));var fs=require('fs');var path=require(_0xb317('0x5'));var rimraf=require(_0xb317('0x6'));var config=require(_0xb317('0x7'));var attributes=require(_0xb317('0x8'));module[_0xb317('0x9')]=function(_0x2904b8,_0x33ed9c){return _0x2904b8[_0xb317('0xa')](_0xb317('0xb'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2d0b=['rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','util','../../config/logger','api','bluebird','request-promise','path'];(function(_0xd287bc,_0x4de5ef){var _0x4b0c4f=function(_0x331c1c){while(--_0x331c1c){_0xd287bc['push'](_0xd287bc['shift']());}};_0x4b0c4f(++_0x4de5ef);}(_0x2d0b,0x102));var _0xb2d0=function(_0x542498,_0x5b0a9a){_0x542498=_0x542498-0x0;var _0x59db78=_0x2d0b[_0x542498];return _0x59db78;};'use strict';var _=require('lodash');var util=require(_0xb2d0('0x0'));var logger=require(_0xb2d0('0x1'))(_0xb2d0('0x2'));var moment=require('moment');var BPromise=require(_0xb2d0('0x3'));var rp=require(_0xb2d0('0x4'));var fs=require('fs');var path=require(_0xb2d0('0x5'));var rimraf=require(_0xb2d0('0x6'));var config=require('../../config/environment');var attributes=require(_0xb2d0('0x7'));module['exports']=function(_0x395e69,_0x41521f){return _0x395e69[_0xb2d0('0x8')](_0xb2d0('0x9'),attributes,{'tableName':_0xb2d0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.rpc.js b/server/api/squareRecording/squareRecording.rpc.js index dbe7b17..690c747 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 _0x4aa3=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','SquareRecording,\x20%s,\x20%s','message','result','create','options','raw','then','CreateSquareRecording','catch','util','bluebird','ioredis','../../mysqldb','../../config/logger'];(function(_0x206d49,_0x453e63){var _0xd83a7d=function(_0x153764){while(--_0x153764){_0x206d49['push'](_0x206d49['shift']());}};_0xd83a7d(++_0x453e63);}(_0x4aa3,0x97));var _0x34aa=function(_0x596fc9,_0x4cfccf){_0x596fc9=_0x596fc9-0x0;var _0x502a04=_0x4aa3[_0x596fc9];return _0x502a04;};'use strict';var _=require('lodash');var util=require(_0x34aa('0x0'));var moment=require('moment');var BPromise=require(_0x34aa('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x34aa('0x2'));var db=require(_0x34aa('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x34aa('0x4'))(_0x34aa('0x5'));var config=require(_0x34aa('0x6'));var jayson=require(_0x34aa('0x7'));var client=jayson[_0x34aa('0x8')][_0x34aa('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d87bf,_0x1492af,_0x3918a8){return new BPromise(function(_0x1d4710,_0x34106f){return client[_0x34aa('0xa')](_0x5d87bf,_0x3918a8)['then'](function(_0xcadcf0){logger[_0x34aa('0xb')]('SquareRecording,\x20%s,\x20%s',_0x1492af,_0x34aa('0xc'));logger[_0x34aa('0xd')](_0x34aa('0xe'),_0x1492af,_0x34aa('0xc'),JSON[_0x34aa('0xf')](_0xcadcf0));if(_0xcadcf0[_0x34aa('0x10')]){if(_0xcadcf0[_0x34aa('0x10')]['code']===0x1f4){logger[_0x34aa('0x10')](_0x34aa('0x11'),_0x1492af,_0xcadcf0[_0x34aa('0x10')]['message']);return _0x34106f(_0xcadcf0[_0x34aa('0x10')][_0x34aa('0x12')]);}logger['error'](_0x34aa('0x11'),_0x1492af,_0xcadcf0[_0x34aa('0x10')][_0x34aa('0x12')]);return _0x1d4710(_0xcadcf0['error'][_0x34aa('0x12')]);}else{logger['info'](_0x34aa('0x11'),_0x1492af,_0x34aa('0xc'));_0x1d4710(_0xcadcf0[_0x34aa('0x13')]['message']);}})['catch'](function(_0x41a62c){logger[_0x34aa('0x10')](_0x34aa('0x11'),_0x1492af,_0x41a62c);_0x34106f(_0x41a62c);});});}exports['CreateSquareRecording']=function(_0x2c3b8d){var _0x2a74c1=this;return new Promise(function(_0x2c87fc,_0x1c15f9){return db['SquareRecording'][_0x34aa('0x14')](_0x2c3b8d['body'],{'raw':_0x2c3b8d[_0x34aa('0x15')]?_0x2c3b8d['options'][_0x34aa('0x16')]===undefined?!![]:![]:!![]})[_0x34aa('0x17')](function(_0x52bf56){logger[_0x34aa('0xb')](_0x34aa('0x18'),_0x2c3b8d);logger[_0x34aa('0xd')](_0x34aa('0x18'),_0x2c3b8d,JSON[_0x34aa('0xf')](_0x52bf56));_0x2c87fc(_0x52bf56);})[_0x34aa('0x19')](function(_0x3f6fa1){logger['error'](_0x34aa('0x18'),_0x3f6fa1[_0x34aa('0x12')],_0x2c3b8d);_0x1c15f9(_0x2a74c1[_0x34aa('0x10')](0x1f4,_0x3f6fa1['message']));});});}; \ No newline at end of file +var _0xd1f0=['moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','SquareRecording','body','options','raw','CreateSquareRecording','stringify','util'];(function(_0x30d988,_0x30c111){var _0x27e253=function(_0xc4206b){while(--_0xc4206b){_0x30d988['push'](_0x30d988['shift']());}};_0x27e253(++_0x30c111);}(_0xd1f0,0x16b));var _0x0d1f=function(_0x2199f1,_0x10c734){_0x2199f1=_0x2199f1-0x0;var _0x43436b=_0xd1f0[_0x2199f1];return _0x43436b;};'use strict';var _=require('lodash');var util=require(_0x0d1f('0x0'));var moment=require(_0x0d1f('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d1f('0x2'));var db=require(_0x0d1f('0x3'))['db'];var utils=require(_0x0d1f('0x4'));var logger=require('../../config/logger')(_0x0d1f('0x5'));var config=require('../../config/environment');var jayson=require(_0x0d1f('0x6'));var client=jayson[_0x0d1f('0x7')][_0x0d1f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d2455,_0x1dc0ef,_0x1a5a54){return new BPromise(function(_0x3a4dac,_0x5cb049){return client[_0x0d1f('0x9')](_0x3d2455,_0x1a5a54)[_0x0d1f('0xa')](function(_0x15b90d){logger[_0x0d1f('0xb')](_0x0d1f('0xc'),_0x1dc0ef,_0x0d1f('0xd'));logger[_0x0d1f('0xe')]('SquareRecording,\x20%s,\x20%s,\x20%s',_0x1dc0ef,_0x0d1f('0xd'),JSON['stringify'](_0x15b90d));if(_0x15b90d[_0x0d1f('0xf')]){if(_0x15b90d[_0x0d1f('0xf')][_0x0d1f('0x10')]===0x1f4){logger['error'](_0x0d1f('0xc'),_0x1dc0ef,_0x15b90d[_0x0d1f('0xf')][_0x0d1f('0x11')]);return _0x5cb049(_0x15b90d[_0x0d1f('0xf')][_0x0d1f('0x11')]);}logger[_0x0d1f('0xf')](_0x0d1f('0xc'),_0x1dc0ef,_0x15b90d[_0x0d1f('0xf')][_0x0d1f('0x11')]);return _0x3a4dac(_0x15b90d[_0x0d1f('0xf')][_0x0d1f('0x11')]);}else{logger[_0x0d1f('0xb')](_0x0d1f('0xc'),_0x1dc0ef,'request\x20sent');_0x3a4dac(_0x15b90d[_0x0d1f('0x12')]['message']);}})[_0x0d1f('0x13')](function(_0x29d06f){logger[_0x0d1f('0xf')]('SquareRecording,\x20%s,\x20%s',_0x1dc0ef,_0x29d06f);_0x5cb049(_0x29d06f);});});}exports['CreateSquareRecording']=function(_0x22d36f){var _0x375029=this;return new Promise(function(_0x128b76,_0xf79824){return db[_0x0d1f('0x14')]['create'](_0x22d36f[_0x0d1f('0x15')],{'raw':_0x22d36f[_0x0d1f('0x16')]?_0x22d36f[_0x0d1f('0x16')][_0x0d1f('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x5053a9){logger['info']('CreateSquareRecording',_0x22d36f);logger[_0x0d1f('0xe')](_0x0d1f('0x18'),_0x22d36f,JSON[_0x0d1f('0x19')](_0x5053a9));_0x128b76(_0x5053a9);})[_0x0d1f('0x13')](function(_0x42a7c0){logger[_0x0d1f('0xf')](_0x0d1f('0x18'),_0x42a7c0['message'],_0x22d36f);_0xf79824(_0x375029[_0x0d1f('0xf')](0x1f4,_0x42a7c0[_0x0d1f('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index e5e5fdf..b247ed6 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 _0x5f29=['../../config/environment','./squareReport.controller','get','/describe','describe','/:id','isAuthenticated','show','post','put','update','delete','destroy','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x2a5fa1,_0x1752c5){var _0x134572=function(_0x5c507a){while(--_0x5c507a){_0x2a5fa1['push'](_0x2a5fa1['shift']());}};_0x134572(++_0x1752c5);}(_0x5f29,0xb8));var _0x95f2=function(_0x9e3edc,_0x594d61){_0x9e3edc=_0x9e3edc-0x0;var _0x44a387=_0x5f29[_0x9e3edc];return _0x44a387;};'use strict';var multer=require(_0x95f2('0x0'));var util=require(_0x95f2('0x1'));var path=require('path');var timeout=require(_0x95f2('0x2'));var express=require('express');var router=express[_0x95f2('0x3')]();var auth=require(_0x95f2('0x4'));var interaction=require(_0x95f2('0x5'));var config=require(_0x95f2('0x6'));var controller=require(_0x95f2('0x7'));router[_0x95f2('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x95f2('0x8')](_0x95f2('0x9'),auth['isAuthenticated'](),controller[_0x95f2('0xa')]);router[_0x95f2('0x8')](_0x95f2('0xb'),auth[_0x95f2('0xc')](),controller[_0x95f2('0xd')]);router[_0x95f2('0xe')]('/',auth[_0x95f2('0xc')](),controller['create']);router[_0x95f2('0xf')](_0x95f2('0xb'),auth[_0x95f2('0xc')](),controller[_0x95f2('0x10')]);router[_0x95f2('0x11')](_0x95f2('0xb'),auth[_0x95f2('0xc')](),controller[_0x95f2('0x12')]);module['exports']=router; \ No newline at end of file +var _0x954a=['/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index','/describe'];(function(_0x5023cc,_0x17634d){var _0x17b743=function(_0xd669ca){while(--_0xd669ca){_0x5023cc['push'](_0x5023cc['shift']());}};_0x17b743(++_0x17634d);}(_0x954a,0xa3));var _0xa954=function(_0x5b2013,_0xcf991f){_0x5b2013=_0x5b2013-0x0;var _0x35b5b5=_0x954a[_0x5b2013];return _0x35b5b5;};'use strict';var multer=require(_0xa954('0x0'));var util=require('util');var path=require(_0xa954('0x1'));var timeout=require(_0xa954('0x2'));var express=require(_0xa954('0x3'));var router=express[_0xa954('0x4')]();var auth=require(_0xa954('0x5'));var interaction=require(_0xa954('0x6'));var config=require(_0xa954('0x7'));var controller=require(_0xa954('0x8'));router[_0xa954('0x9')]('/',auth[_0xa954('0xa')](),controller[_0xa954('0xb')]);router['get'](_0xa954('0xc'),auth[_0xa954('0xa')](),controller['describe']);router[_0xa954('0x9')](_0xa954('0xd'),auth[_0xa954('0xa')](),controller[_0xa954('0xe')]);router[_0xa954('0xf')]('/',auth[_0xa954('0xa')](),controller[_0xa954('0x10')]);router[_0xa954('0x11')](_0xa954('0xd'),auth[_0xa954('0xa')](),controller[_0xa954('0x12')]);router[_0xa954('0x13')](_0xa954('0xd'),auth['isAuthenticated'](),controller[_0xa954('0x14')]);module[_0xa954('0x15')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 6b7cbb1..8e3dfe9 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 _0x9db1=['STRING','DATE','sequelize','exports'];(function(_0x40142a,_0x299cfd){var _0x227e23=function(_0x268332){while(--_0x268332){_0x40142a['push'](_0x40142a['shift']());}};_0x227e23(++_0x299cfd);}(_0x9db1,0x16a));var _0x19db=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9db1[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x19db('0x0'));module[_0x19db('0x1')]={'network':{'type':Sequelize[_0x19db('0x2')]},'network_script':{'type':Sequelize[_0x19db('0x2')]},'request':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x19db('0x2')]},'language':{'type':Sequelize[_0x19db('0x2')]},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x19db('0x2')]},'version':{'type':Sequelize[_0x19db('0x2')]},'callerid':{'type':Sequelize[_0x19db('0x2')]},'calleridname':{'type':Sequelize['STRING']},'callingpres':{'type':Sequelize[_0x19db('0x2')]},'callingani2':{'type':Sequelize['STRING']},'callington':{'type':Sequelize[_0x19db('0x2')]},'callingtns':{'type':Sequelize[_0x19db('0x2')]},'dnid':{'type':Sequelize[_0x19db('0x2')]},'rdnis':{'type':Sequelize[_0x19db('0x2')]},'context':{'type':Sequelize[_0x19db('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x19db('0x2')]},'enhanced':{'type':Sequelize[_0x19db('0x2')]},'accountcode':{'type':Sequelize[_0x19db('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0x19db('0x2')]},'joinAt':{'type':Sequelize[_0x19db('0x3')]},'leaveAt':{'type':Sequelize[_0x19db('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x66c7=['STRING','DATE','sequelize','exports'];(function(_0x1b2d72,_0x3dc221){var _0x5b1f13=function(_0x195b82){while(--_0x195b82){_0x1b2d72['push'](_0x1b2d72['shift']());}};_0x5b1f13(++_0x3dc221);}(_0x66c7,0x10e));var _0x766c=function(_0x2df9d8,_0x339285){_0x2df9d8=_0x2df9d8-0x0;var _0x54b806=_0x66c7[_0x2df9d8];return _0x54b806;};'use strict';var Sequelize=require(_0x766c('0x0'));module[_0x766c('0x1')]={'network':{'type':Sequelize[_0x766c('0x2')]},'network_script':{'type':Sequelize[_0x766c('0x2')]},'request':{'type':Sequelize[_0x766c('0x2')]},'channel':{'type':Sequelize[_0x766c('0x2')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x766c('0x2')]},'uniqueid':{'type':Sequelize[_0x766c('0x2')]},'version':{'type':Sequelize[_0x766c('0x2')]},'callerid':{'type':Sequelize[_0x766c('0x2')]},'calleridname':{'type':Sequelize[_0x766c('0x2')]},'callingpres':{'type':Sequelize[_0x766c('0x2')]},'callingani2':{'type':Sequelize[_0x766c('0x2')]},'callington':{'type':Sequelize[_0x766c('0x2')]},'callingtns':{'type':Sequelize[_0x766c('0x2')]},'dnid':{'type':Sequelize[_0x766c('0x2')]},'rdnis':{'type':Sequelize[_0x766c('0x2')]},'context':{'type':Sequelize[_0x766c('0x2')]},'extension':{'type':Sequelize[_0x766c('0x2')]},'priority':{'type':Sequelize[_0x766c('0x2')]},'enhanced':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x766c('0x2')]},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x766c('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'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 26731a2..31ce7ae 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 _0x814b=['index','map','rawAttributes','fieldName','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','sort','filters','pick','filter','where','merge','VIRTUAL','include','findAll','rows','catch','show','SquareReport','options','find','create','body','params','describe','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','then','error','stack','name','send'];(function(_0x358913,_0x52ed94){var _0x41c913=function(_0x588f21){while(--_0x588f21){_0x358913['push'](_0x358913['shift']());}};_0x41c913(++_0x52ed94);}(_0x814b,0x1a2));var _0xb814=function(_0x117821,_0xaa1933){_0x117821=_0x117821-0x0;var _0x4ae9ff=_0x814b[_0x117821];return _0x4ae9ff;};'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 as=require(_0xb814('0x15'));var hardwareService=require(_0xb814('0x16'));var logger=require(_0xb814('0x17'))('api');var utils=require(_0xb814('0x18'));var config=require('../../config/environment');var db=require(_0xb814('0x19'))['db'];function respondWithStatusCode(_0x15d6ef,_0x35b10d){_0x35b10d=_0x35b10d||0xcc;return function(_0x2cc46b){if(_0x2cc46b){return _0x15d6ef[_0xb814('0x1a')](_0x35b10d);}return _0x15d6ef[_0xb814('0x1b')](_0x35b10d)[_0xb814('0x1c')]();};}function respondWithResult(_0x41ed7b,_0xa0a2e5){_0xa0a2e5=_0xa0a2e5||0xc8;return function(_0x2ab627){if(_0x2ab627){return _0x41ed7b[_0xb814('0x1b')](_0xa0a2e5)[_0xb814('0x1d')](_0x2ab627);}};}function respondWithFilteredResult(_0x17f5bd,_0x39bfcf){return function(_0x303aca){if(_0x303aca){var _0x3a71d6=_0x303aca[_0xb814('0x1e')],_0x45e0d0=_0x39bfcf[_0xb814('0x1f')],_0x265a83=_0x39bfcf['offset']+_0x39bfcf[_0xb814('0x20')],_0x125ce2;if(_0x265a83>=_0x3a71d6){_0x265a83=_0x3a71d6;_0x125ce2=0xc8;}else{_0x125ce2=0xce;}_0x17f5bd['status'](_0x125ce2);return _0x17f5bd[_0xb814('0x21')](_0xb814('0x22'),_0x45e0d0+'-'+_0x265a83+'/'+_0x3a71d6)['json'](_0x303aca);}return null;};}function patchUpdates(_0x4b55a7){return function(_0x55d63c){try{jsonpatch[_0xb814('0x23')](_0x55d63c,_0x4b55a7,!![]);}catch(_0x4d5276){return BPromise['reject'](_0x4d5276);}return _0x55d63c[_0xb814('0x24')]();};}function saveUpdates(_0x24211d,_0x25b6b6){return function(_0x4e139e){if(_0x4e139e){return _0x4e139e[_0xb814('0x25')](_0x24211d)['then'](function(_0x1e6393){return _0x1e6393;});}return null;};}function removeEntity(_0x1808a3,_0x3b267e){return function(_0x470e81){if(_0x470e81){return _0x470e81[_0xb814('0x26')]()[_0xb814('0x27')](function(){_0x1808a3[_0xb814('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ead86,_0x52b7a3){return function(_0x3f81d0){if(!_0x3f81d0){_0x2ead86[_0xb814('0x1a')](0x194);}return _0x3f81d0;};}function handleError(_0x31c7ec,_0x208927){_0x208927=_0x208927||0x1f4;return function(_0x1c8a2e){logger[_0xb814('0x28')](_0x1c8a2e[_0xb814('0x29')]);if(_0x1c8a2e['name']){delete _0x1c8a2e[_0xb814('0x2a')];}_0x31c7ec[_0xb814('0x1b')](_0x208927)[_0xb814('0x2b')](_0x1c8a2e);};}exports[_0xb814('0x2c')]=function(_0x32ed56,_0x1d5965){var _0x3f0150={},_0x1e4e89={},_0x5a6291={'count':0x0,'rows':[]};var _0x271aa8=_[_0xb814('0x2d')](db['SquareReport'][_0xb814('0x2e')],function(_0x37d24d){return{'name':_0x37d24d[_0xb814('0x2f')],'type':_0x37d24d['type'][_0xb814('0x30')]};});_0x1e4e89[_0xb814('0x31')]=_['map'](_0x271aa8,_0xb814('0x2a'));_0x1e4e89['query']=_[_0xb814('0x32')](_0x32ed56['query']);_0x1e4e89['filters']=_[_0xb814('0x33')](_0x1e4e89['model'],_0x1e4e89[_0xb814('0x34')]);_0x3f0150[_0xb814('0x35')]=_[_0xb814('0x33')](_0x1e4e89['model'],qs['fields'](_0x32ed56[_0xb814('0x34')][_0xb814('0x36')]));_0x3f0150['attributes']=_0x3f0150[_0xb814('0x35')][_0xb814('0x37')]?_0x3f0150[_0xb814('0x35')]:_0x1e4e89[_0xb814('0x31')];if(!_0x32ed56[_0xb814('0x34')][_0xb814('0x38')](_0xb814('0x39'))){_0x3f0150['limit']=qs[_0xb814('0x20')](_0x32ed56[_0xb814('0x34')][_0xb814('0x20')]);_0x3f0150[_0xb814('0x1f')]=qs[_0xb814('0x1f')](_0x32ed56['query'][_0xb814('0x1f')]);}_0x3f0150['order']=qs[_0xb814('0x3a')](_0x32ed56[_0xb814('0x34')][_0xb814('0x3a')]);_0x3f0150['where']=qs[_0xb814('0x3b')](_[_0xb814('0x3c')](_0x32ed56['query'],_0x1e4e89[_0xb814('0x3b')]));if(_0x32ed56[_0xb814('0x34')][_0xb814('0x3d')]){_0x3f0150[_0xb814('0x3e')]=_[_0xb814('0x3f')](_0x3f0150[_0xb814('0x3e')],{'$or':_['map'](_0x271aa8,function(_0xa6ce87){if(_0xa6ce87['type']!==_0xb814('0x40')){var _0x4b5583={};_0x4b5583[_0xa6ce87[_0xb814('0x2a')]]={'$like':'%'+_0x32ed56['query'][_0xb814('0x3d')]+'%'};return _0x4b5583;}})});}_0x3f0150=_[_0xb814('0x3f')]({},_0x3f0150,_0x32ed56['options']);var _0x4d308a={'where':_0x3f0150['where']};return db['SquareReport'][_0xb814('0x1e')](_0x4d308a)[_0xb814('0x27')](function(_0x38cdc2){_0x5a6291[_0xb814('0x1e')]=_0x38cdc2;if(_0x32ed56['query']['includeAll']){_0x3f0150[_0xb814('0x41')]=[{'all':!![]}];}return db['SquareReport'][_0xb814('0x42')](_0x3f0150);})[_0xb814('0x27')](function(_0x178823){_0x5a6291[_0xb814('0x43')]=_0x178823;return _0x5a6291;})[_0xb814('0x27')](respondWithFilteredResult(_0x1d5965,_0x3f0150))[_0xb814('0x44')](handleError(_0x1d5965,null));};exports[_0xb814('0x45')]=function(_0x28b2b4,_0x31989d){var _0x4b6ff8={'raw':!![],'where':{'id':_0x28b2b4['params']['id']}},_0x544d36={};_0x544d36[_0xb814('0x31')]=_['keys'](db[_0xb814('0x46')]['rawAttributes']);_0x544d36[_0xb814('0x34')]=_[_0xb814('0x32')](_0x28b2b4[_0xb814('0x34')]);_0x544d36[_0xb814('0x3b')]=_['intersection'](_0x544d36[_0xb814('0x31')],_0x544d36[_0xb814('0x34')]);_0x4b6ff8[_0xb814('0x35')]=_[_0xb814('0x33')](_0x544d36[_0xb814('0x31')],qs[_0xb814('0x36')](_0x28b2b4['query'][_0xb814('0x36')]));_0x4b6ff8[_0xb814('0x35')]=_0x4b6ff8[_0xb814('0x35')][_0xb814('0x37')]?_0x4b6ff8[_0xb814('0x35')]:_0x544d36[_0xb814('0x31')];if(_0x28b2b4[_0xb814('0x34')]['includeAll']){_0x4b6ff8['include']=[{'all':!![]}];}_0x4b6ff8=_[_0xb814('0x3f')]({},_0x4b6ff8,_0x28b2b4[_0xb814('0x47')]);return db[_0xb814('0x46')][_0xb814('0x48')](_0x4b6ff8)[_0xb814('0x27')](handleEntityNotFound(_0x31989d,null))[_0xb814('0x27')](respondWithResult(_0x31989d,null))[_0xb814('0x44')](handleError(_0x31989d,null));};exports[_0xb814('0x49')]=function(_0x2eb9b6,_0x344198){return db[_0xb814('0x46')]['create'](_0x2eb9b6[_0xb814('0x4a')],{})[_0xb814('0x27')](respondWithResult(_0x344198,0xc9))['catch'](handleError(_0x344198,null));};exports[_0xb814('0x25')]=function(_0x55234d,_0x2fb0f7){if(_0x55234d[_0xb814('0x4a')]['id']){delete _0x55234d[_0xb814('0x4a')]['id'];}return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x55234d[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x2fb0f7,null))[_0xb814('0x27')](saveUpdates(_0x55234d[_0xb814('0x4a')],null))[_0xb814('0x27')](respondWithResult(_0x2fb0f7,null))['catch'](handleError(_0x2fb0f7,null));};exports['destroy']=function(_0x32eca6,_0x30f07b){return db[_0xb814('0x46')][_0xb814('0x48')]({'where':{'id':_0x32eca6[_0xb814('0x4b')]['id']}})[_0xb814('0x27')](handleEntityNotFound(_0x30f07b,null))[_0xb814('0x27')](removeEntity(_0x30f07b,null))['catch'](handleError(_0x30f07b,null));};exports[_0xb814('0x4c')]=function(_0x388324,_0xf27a6e){return db['SquareReport'][_0xb814('0x4c')]()['then'](respondWithResult(_0xf27a6e,null))[_0xb814('0x44')](handleError(_0xf27a6e,null));}; \ No newline at end of file +var _0xf494=['pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','count','offset','limit','apply','reject','update','then','stack','name','send','index','map','SquareReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x527824,_0xc824a9){var _0xc8b8ed=function(_0x1b0e19){while(--_0x1b0e19){_0x527824['push'](_0x527824['shift']());}};_0xc8b8ed(++_0xc824a9);}(_0xf494,0x1c6));var _0x4f49=function(_0x1f3dbe,_0x583607){_0x1f3dbe=_0x1f3dbe-0x0;var _0x1ac6da=_0xf494[_0x1f3dbe];return _0x1ac6da;};'use strict';var pdf=require(_0x4f49('0x0'));var emlformat=require(_0x4f49('0x1'));var rimraf=require(_0x4f49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4f49('0x3'));var rp=require(_0x4f49('0x4'));var moment=require(_0x4f49('0x5'));var BPromise=require(_0x4f49('0x6'));var Mustache=require(_0x4f49('0x7'));var util=require(_0x4f49('0x8'));var path=require(_0x4f49('0x9'));var sox=require(_0x4f49('0xa'));var csv=require(_0x4f49('0xb'));var ejs=require(_0x4f49('0xc'));var fs=require('fs');var _=require(_0x4f49('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x4f49('0xe'));var deskjs=require(_0x4f49('0xf'));var toCsv=require(_0x4f49('0xb'));var querystring=require(_0x4f49('0x10'));var Papa=require(_0x4f49('0x11'));var Redis=require(_0x4f49('0x12'));var authService=require(_0x4f49('0x13'));var qs=require(_0x4f49('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4f49('0x15'));var logger=require(_0x4f49('0x16'))('api');var utils=require(_0x4f49('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b9cd3,_0x12527d){_0x12527d=_0x12527d||0xcc;return function(_0x4bf89f){if(_0x4bf89f){return _0x4b9cd3[_0x4f49('0x18')](_0x12527d);}return _0x4b9cd3[_0x4f49('0x19')](_0x12527d)[_0x4f49('0x1a')]();};}function respondWithResult(_0x2efe49,_0x1a0f1e){_0x1a0f1e=_0x1a0f1e||0xc8;return function(_0x2f0131){if(_0x2f0131){return _0x2efe49[_0x4f49('0x19')](_0x1a0f1e)['json'](_0x2f0131);}};}function respondWithFilteredResult(_0x515ace,_0x1f2d0d){return function(_0x415e83){if(_0x415e83){var _0x5878f4=_0x415e83[_0x4f49('0x1b')],_0x5bdfaf=_0x1f2d0d['offset'],_0x2f0a0d=_0x1f2d0d[_0x4f49('0x1c')]+_0x1f2d0d[_0x4f49('0x1d')],_0x2ecaaa;if(_0x2f0a0d>=_0x5878f4){_0x2f0a0d=_0x5878f4;_0x2ecaaa=0xc8;}else{_0x2ecaaa=0xce;}_0x515ace[_0x4f49('0x19')](_0x2ecaaa);return _0x515ace['set']('Content-Range',_0x5bdfaf+'-'+_0x2f0a0d+'/'+_0x5878f4)['json'](_0x415e83);}return null;};}function patchUpdates(_0x47f1e8){return function(_0xb2081a){try{jsonpatch[_0x4f49('0x1e')](_0xb2081a,_0x47f1e8,!![]);}catch(_0x1c2d70){return BPromise[_0x4f49('0x1f')](_0x1c2d70);}return _0xb2081a['save']();};}function saveUpdates(_0x416893,_0x2aed27){return function(_0x197a49){if(_0x197a49){return _0x197a49[_0x4f49('0x20')](_0x416893)[_0x4f49('0x21')](function(_0x509f7c){return _0x509f7c;});}return null;};}function removeEntity(_0x3e7e28,_0x357446){return function(_0x3ae590){if(_0x3ae590){return _0x3ae590['destroy']()[_0x4f49('0x21')](function(){_0x3e7e28[_0x4f49('0x19')](0xcc)[_0x4f49('0x1a')]();});}};}function handleEntityNotFound(_0x43c458,_0x9d30aa){return function(_0x36187b){if(!_0x36187b){_0x43c458['sendStatus'](0x194);}return _0x36187b;};}function handleError(_0x4e9041,_0x3a947b){_0x3a947b=_0x3a947b||0x1f4;return function(_0x429de7){logger['error'](_0x429de7[_0x4f49('0x22')]);if(_0x429de7[_0x4f49('0x23')]){delete _0x429de7[_0x4f49('0x23')];}_0x4e9041['status'](_0x3a947b)[_0x4f49('0x24')](_0x429de7);};}exports[_0x4f49('0x25')]=function(_0x298785,_0x148153){var _0xfefbab={},_0x122404={},_0x4915af={'count':0x0,'rows':[]};var _0x50c571=_[_0x4f49('0x26')](db[_0x4f49('0x27')][_0x4f49('0x28')],function(_0x560050){return{'name':_0x560050[_0x4f49('0x29')],'type':_0x560050[_0x4f49('0x2a')][_0x4f49('0x2b')]};});_0x122404['model']=_['map'](_0x50c571,_0x4f49('0x23'));_0x122404[_0x4f49('0x2c')]=_[_0x4f49('0x2d')](_0x298785['query']);_0x122404[_0x4f49('0x2e')]=_[_0x4f49('0x2f')](_0x122404[_0x4f49('0x30')],_0x122404[_0x4f49('0x2c')]);_0xfefbab[_0x4f49('0x31')]=_[_0x4f49('0x2f')](_0x122404[_0x4f49('0x30')],qs[_0x4f49('0x32')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x32')]));_0xfefbab[_0x4f49('0x31')]=_0xfefbab[_0x4f49('0x31')][_0x4f49('0x33')]?_0xfefbab[_0x4f49('0x31')]:_0x122404[_0x4f49('0x30')];if(!_0x298785[_0x4f49('0x2c')][_0x4f49('0x34')](_0x4f49('0x35'))){_0xfefbab[_0x4f49('0x1d')]=qs['limit'](_0x298785[_0x4f49('0x2c')][_0x4f49('0x1d')]);_0xfefbab[_0x4f49('0x1c')]=qs[_0x4f49('0x1c')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x1c')]);}_0xfefbab[_0x4f49('0x36')]=qs[_0x4f49('0x37')](_0x298785[_0x4f49('0x2c')][_0x4f49('0x37')]);_0xfefbab[_0x4f49('0x38')]=qs[_0x4f49('0x2e')](_[_0x4f49('0x39')](_0x298785['query'],_0x122404[_0x4f49('0x2e')]));if(_0x298785[_0x4f49('0x2c')][_0x4f49('0x3a')]){_0xfefbab[_0x4f49('0x38')]=_[_0x4f49('0x3b')](_0xfefbab[_0x4f49('0x38')],{'$or':_[_0x4f49('0x26')](_0x50c571,function(_0x25fdf8){if(_0x25fdf8[_0x4f49('0x2a')]!==_0x4f49('0x3c')){var _0x173b6e={};_0x173b6e[_0x25fdf8[_0x4f49('0x23')]]={'$like':'%'+_0x298785[_0x4f49('0x2c')][_0x4f49('0x3a')]+'%'};return _0x173b6e;}})});}_0xfefbab=_['merge']({},_0xfefbab,_0x298785[_0x4f49('0x3d')]);var _0xb0e6c2={'where':_0xfefbab['where']};return db[_0x4f49('0x27')][_0x4f49('0x1b')](_0xb0e6c2)['then'](function(_0x29e762){_0x4915af[_0x4f49('0x1b')]=_0x29e762;if(_0x298785[_0x4f49('0x2c')][_0x4f49('0x3e')]){_0xfefbab[_0x4f49('0x3f')]=[{'all':!![]}];}return db[_0x4f49('0x27')][_0x4f49('0x40')](_0xfefbab);})['then'](function(_0x5e1461){_0x4915af['rows']=_0x5e1461;return _0x4915af;})[_0x4f49('0x21')](respondWithFilteredResult(_0x148153,_0xfefbab))[_0x4f49('0x41')](handleError(_0x148153,null));};exports[_0x4f49('0x42')]=function(_0x373f90,_0x1053b2){var _0x1ecf6c={'raw':!![],'where':{'id':_0x373f90[_0x4f49('0x43')]['id']}},_0x38aff8={};_0x38aff8[_0x4f49('0x30')]=_['keys'](db['SquareReport'][_0x4f49('0x28')]);_0x38aff8[_0x4f49('0x2c')]=_[_0x4f49('0x2d')](_0x373f90['query']);_0x38aff8[_0x4f49('0x2e')]=_['intersection'](_0x38aff8['model'],_0x38aff8[_0x4f49('0x2c')]);_0x1ecf6c[_0x4f49('0x31')]=_[_0x4f49('0x2f')](_0x38aff8['model'],qs[_0x4f49('0x32')](_0x373f90[_0x4f49('0x2c')]['fields']));_0x1ecf6c[_0x4f49('0x31')]=_0x1ecf6c['attributes'][_0x4f49('0x33')]?_0x1ecf6c[_0x4f49('0x31')]:_0x38aff8[_0x4f49('0x30')];if(_0x373f90['query'][_0x4f49('0x3e')]){_0x1ecf6c[_0x4f49('0x3f')]=[{'all':!![]}];}_0x1ecf6c=_[_0x4f49('0x3b')]({},_0x1ecf6c,_0x373f90[_0x4f49('0x3d')]);return db[_0x4f49('0x27')][_0x4f49('0x44')](_0x1ecf6c)[_0x4f49('0x21')](handleEntityNotFound(_0x1053b2,null))[_0x4f49('0x21')](respondWithResult(_0x1053b2,null))[_0x4f49('0x41')](handleError(_0x1053b2,null));};exports[_0x4f49('0x45')]=function(_0x4fe382,_0x26c222){return db[_0x4f49('0x27')]['create'](_0x4fe382[_0x4f49('0x46')],{})['then'](respondWithResult(_0x26c222,0xc9))[_0x4f49('0x41')](handleError(_0x26c222,null));};exports[_0x4f49('0x20')]=function(_0x2d3dcd,_0x300230){if(_0x2d3dcd['body']['id']){delete _0x2d3dcd[_0x4f49('0x46')]['id'];}return db[_0x4f49('0x27')][_0x4f49('0x44')]({'where':{'id':_0x2d3dcd[_0x4f49('0x43')]['id']}})[_0x4f49('0x21')](handleEntityNotFound(_0x300230,null))[_0x4f49('0x21')](saveUpdates(_0x2d3dcd[_0x4f49('0x46')],null))[_0x4f49('0x21')](respondWithResult(_0x300230,null))[_0x4f49('0x41')](handleError(_0x300230,null));};exports[_0x4f49('0x47')]=function(_0x1be59a,_0x4482f7){return db[_0x4f49('0x27')][_0x4f49('0x44')]({'where':{'id':_0x1be59a[_0x4f49('0x43')]['id']}})[_0x4f49('0x21')](handleEntityNotFound(_0x4482f7,null))['then'](removeEntity(_0x4482f7,null))['catch'](handleError(_0x4482f7,null));};exports[_0x4f49('0x48')]=function(_0x197670,_0x36bcc2){return db[_0x4f49('0x27')][_0x4f49('0x48')]()[_0x4f49('0x21')](respondWithResult(_0x36bcc2,null))[_0x4f49('0x41')](handleError(_0x36bcc2,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index f3cf279..8ec36ae 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 _0xe51f=['leaveAt','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','exports','define','SquareReport','report_square','uid_pname','project_name'];(function(_0x107547,_0x41355d){var _0x1b4f34=function(_0x5c507b){while(--_0x5c507b){_0x107547['push'](_0x107547['shift']());}};_0x1b4f34(++_0x41355d);}(_0xe51f,0x100));var _0xfe51=function(_0x1d5c71,_0x2a30dc){_0x1d5c71=_0x1d5c71-0x0;var _0x3df996=_0xe51f[_0x1d5c71];return _0x3df996;};'use strict';var _=require(_0xfe51('0x0'));var util=require(_0xfe51('0x1'));var logger=require(_0xfe51('0x2'))(_0xfe51('0x3'));var moment=require(_0xfe51('0x4'));var BPromise=require(_0xfe51('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe51('0x6'));var rimraf=require('rimraf');var config=require(_0xfe51('0x7'));var attributes=require('./squareReport.attributes');module[_0xfe51('0x8')]=function(_0xd51f1b,_0x2c5fcc){return _0xd51f1b[_0xfe51('0x9')](_0xfe51('0xa'),attributes,{'tableName':_0xfe51('0xb'),'paranoid':![],'indexes':[{'name':_0xfe51('0xc'),'fields':['uniqueid',_0xfe51('0xd')]},{'name':'leaveAt','fields':[_0xfe51('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4339=['leaveAt','lodash','util','../../config/logger','moment','path','../../config/environment','define','SquareReport','report_square','uid_pname','project_name'];(function(_0x41838e,_0x902d2b){var _0x42d3d2=function(_0xd10670){while(--_0xd10670){_0x41838e['push'](_0x41838e['shift']());}};_0x42d3d2(++_0x902d2b);}(_0x4339,0xb5));var _0x9433=function(_0x5b0aa7,_0x423b59){_0x5b0aa7=_0x5b0aa7-0x0;var _0x2523b5=_0x4339[_0x5b0aa7];return _0x2523b5;};'use strict';var _=require(_0x9433('0x0'));var util=require(_0x9433('0x1'));var logger=require(_0x9433('0x2'))('api');var moment=require(_0x9433('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9433('0x4'));var rimraf=require('rimraf');var config=require(_0x9433('0x5'));var attributes=require('./squareReport.attributes');module['exports']=function(_0x14567f,_0x513c37){return _0x14567f[_0x9433('0x6')](_0x9433('0x7'),attributes,{'tableName':_0x9433('0x8'),'paranoid':![],'indexes':[{'name':_0x9433('0x9'),'fields':['uniqueid',_0x9433('0xa')]},{'name':_0x9433('0xb'),'fields':[_0x9433('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index 2448d5d..c44cf22 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 _0x3117=['attributes','limit','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareReport,\x20%s,\x20%s','message','result','CreateSquareReport','SquareReport','create','body','options','catch','UpdateSquareReport','update','raw','where'];(function(_0x5f1391,_0x19c132){var _0x50ebe3=function(_0x3d00a3){while(--_0x3d00a3){_0x5f1391['push'](_0x5f1391['shift']());}};_0x50ebe3(++_0x19c132);}(_0x3117,0x1af));var _0x7311=function(_0x533e4e,_0x4eba54){_0x533e4e=_0x533e4e-0x0;var _0x1f14bb=_0x3117[_0x533e4e];return _0x1f14bb;};'use strict';var _=require(_0x7311('0x0'));var util=require('util');var moment=require(_0x7311('0x1'));var BPromise=require('bluebird');var rs=require(_0x7311('0x2'));var fs=require('fs');var Redis=require(_0x7311('0x3'));var db=require(_0x7311('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x7311('0x5'))(_0x7311('0x6'));var config=require('../../config/environment');var jayson=require(_0x7311('0x7'));var client=jayson['client'][_0x7311('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39dcf2,_0x4e788c,_0x48e726){return new BPromise(function(_0x4a15fb,_0x2f3f7c){return client[_0x7311('0x9')](_0x39dcf2,_0x48e726)[_0x7311('0xa')](function(_0x3e7dd2){logger[_0x7311('0xb')]('SquareReport,\x20%s,\x20%s',_0x4e788c,_0x7311('0xc'));logger[_0x7311('0xd')](_0x7311('0xe'),_0x4e788c,_0x7311('0xc'),JSON[_0x7311('0xf')](_0x3e7dd2));if(_0x3e7dd2[_0x7311('0x10')]){if(_0x3e7dd2[_0x7311('0x10')][_0x7311('0x11')]===0x1f4){logger[_0x7311('0x10')](_0x7311('0x12'),_0x4e788c,_0x3e7dd2['error'][_0x7311('0x13')]);return _0x2f3f7c(_0x3e7dd2[_0x7311('0x10')][_0x7311('0x13')]);}logger[_0x7311('0x10')](_0x7311('0x12'),_0x4e788c,_0x3e7dd2[_0x7311('0x10')][_0x7311('0x13')]);return _0x4a15fb(_0x3e7dd2['error'][_0x7311('0x13')]);}else{logger[_0x7311('0xb')]('SquareReport,\x20%s,\x20%s',_0x4e788c,_0x7311('0xc'));_0x4a15fb(_0x3e7dd2[_0x7311('0x14')][_0x7311('0x13')]);}})['catch'](function(_0x3001bc){logger[_0x7311('0x10')](_0x7311('0x12'),_0x4e788c,_0x3001bc);_0x2f3f7c(_0x3001bc);});});}exports[_0x7311('0x15')]=function(_0x1042c4){var _0x5a24fe=this;return new Promise(function(_0x2c2cff,_0x99b7){return db[_0x7311('0x16')][_0x7311('0x17')](_0x1042c4[_0x7311('0x18')],{'raw':_0x1042c4[_0x7311('0x19')]?_0x1042c4[_0x7311('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x7311('0xa')](function(_0x19c5c5){logger[_0x7311('0xb')](_0x7311('0x15'),_0x1042c4);logger[_0x7311('0xd')](_0x7311('0x15'),_0x1042c4,JSON[_0x7311('0xf')](_0x19c5c5));_0x2c2cff(_0x19c5c5);})[_0x7311('0x1a')](function(_0x3617ff){logger[_0x7311('0x10')](_0x7311('0x15'),_0x3617ff[_0x7311('0x13')],_0x1042c4);_0x99b7(_0x5a24fe[_0x7311('0x10')](0x1f4,_0x3617ff[_0x7311('0x13')]));});});};exports[_0x7311('0x1b')]=function(_0x1b0f90){var _0x2892f0=this;return new Promise(function(_0x30c6a2,_0xd16445){return db[_0x7311('0x16')][_0x7311('0x1c')](_0x1b0f90[_0x7311('0x18')],{'raw':_0x1b0f90[_0x7311('0x19')]?_0x1b0f90[_0x7311('0x19')][_0x7311('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b0f90[_0x7311('0x19')]?_0x1b0f90[_0x7311('0x19')][_0x7311('0x1e')]||null:null,'attributes':_0x1b0f90[_0x7311('0x19')]?_0x1b0f90[_0x7311('0x19')][_0x7311('0x1f')]||null:null,'limit':_0x1b0f90[_0x7311('0x19')]?_0x1b0f90[_0x7311('0x19')][_0x7311('0x20')]||null:null})['then'](function(_0x1cd7b7){logger['info'](_0x7311('0x1b'),_0x1b0f90);logger[_0x7311('0xd')](_0x7311('0x1b'),_0x1b0f90,JSON[_0x7311('0xf')](_0x1cd7b7));_0x30c6a2(_0x1cd7b7);})[_0x7311('0x1a')](function(_0x3d2d49){logger[_0x7311('0x10')](_0x7311('0x1b'),_0x3d2d49[_0x7311('0x13')],_0x1b0f90);_0xd16445(_0x2892f0[_0x7311('0x10')](0x1f4,_0x3d2d49[_0x7311('0x13')]));});});}; \ No newline at end of file +var _0x1edb=['raw','stringify','UpdateSquareReport','update','where','attributes','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','SquareReport,\x20%s,\x20%s','debug','SquareReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateSquareReport','SquareReport','create','body','options'];(function(_0x4339a9,_0x196a82){var _0x3c1b86=function(_0x16a5e7){while(--_0x16a5e7){_0x4339a9['push'](_0x4339a9['shift']());}};_0x3c1b86(++_0x196a82);}(_0x1edb,0x106));var _0xb1ed=function(_0x12253b,_0x544745){_0x12253b=_0x12253b-0x0;var _0x62e3df=_0x1edb[_0x12253b];return _0x62e3df;};'use strict';var _=require(_0xb1ed('0x0'));var util=require(_0xb1ed('0x1'));var moment=require(_0xb1ed('0x2'));var BPromise=require(_0xb1ed('0x3'));var rs=require(_0xb1ed('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb1ed('0x5'))['db'];var utils=require(_0xb1ed('0x6'));var logger=require('../../config/logger')(_0xb1ed('0x7'));var config=require('../../config/environment');var jayson=require(_0xb1ed('0x8'));var client=jayson[_0xb1ed('0x9')][_0xb1ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf4697c,_0xccafe2,_0x1efa73){return new BPromise(function(_0x820839,_0x2518f3){return client['request'](_0xf4697c,_0x1efa73)[_0xb1ed('0xb')](function(_0x18f620){logger[_0xb1ed('0xc')](_0xb1ed('0xd'),_0xccafe2,'request\x20sent');logger[_0xb1ed('0xe')](_0xb1ed('0xf'),_0xccafe2,_0xb1ed('0x10'),JSON['stringify'](_0x18f620));if(_0x18f620[_0xb1ed('0x11')]){if(_0x18f620[_0xb1ed('0x11')][_0xb1ed('0x12')]===0x1f4){logger[_0xb1ed('0x11')](_0xb1ed('0xd'),_0xccafe2,_0x18f620[_0xb1ed('0x11')][_0xb1ed('0x13')]);return _0x2518f3(_0x18f620['error'][_0xb1ed('0x13')]);}logger[_0xb1ed('0x11')]('SquareReport,\x20%s,\x20%s',_0xccafe2,_0x18f620['error']['message']);return _0x820839(_0x18f620[_0xb1ed('0x11')][_0xb1ed('0x13')]);}else{logger[_0xb1ed('0xc')](_0xb1ed('0xd'),_0xccafe2,_0xb1ed('0x10'));_0x820839(_0x18f620['result'][_0xb1ed('0x13')]);}})[_0xb1ed('0x14')](function(_0x409d2c){logger[_0xb1ed('0x11')](_0xb1ed('0xd'),_0xccafe2,_0x409d2c);_0x2518f3(_0x409d2c);});});}exports[_0xb1ed('0x15')]=function(_0x25009d){var _0xc1130b=this;return new Promise(function(_0x3bce8c,_0x1f8b29){return db[_0xb1ed('0x16')][_0xb1ed('0x17')](_0x25009d[_0xb1ed('0x18')],{'raw':_0x25009d[_0xb1ed('0x19')]?_0x25009d['options'][_0xb1ed('0x1a')]===undefined?!![]:![]:!![]})[_0xb1ed('0xb')](function(_0xecc72c){logger[_0xb1ed('0xc')](_0xb1ed('0x15'),_0x25009d);logger[_0xb1ed('0xe')](_0xb1ed('0x15'),_0x25009d,JSON[_0xb1ed('0x1b')](_0xecc72c));_0x3bce8c(_0xecc72c);})['catch'](function(_0x452788){logger[_0xb1ed('0x11')]('CreateSquareReport',_0x452788[_0xb1ed('0x13')],_0x25009d);_0x1f8b29(_0xc1130b['error'](0x1f4,_0x452788[_0xb1ed('0x13')]));});});};exports[_0xb1ed('0x1c')]=function(_0x316dd5){var _0xb06608=this;return new Promise(function(_0x4cb13b,_0x184c80){return db[_0xb1ed('0x16')][_0xb1ed('0x1d')](_0x316dd5[_0xb1ed('0x18')],{'raw':_0x316dd5[_0xb1ed('0x19')]?_0x316dd5[_0xb1ed('0x19')][_0xb1ed('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x316dd5[_0xb1ed('0x19')]?_0x316dd5[_0xb1ed('0x19')][_0xb1ed('0x1e')]||null:null,'attributes':_0x316dd5[_0xb1ed('0x19')]?_0x316dd5[_0xb1ed('0x19')][_0xb1ed('0x1f')]||null:null,'limit':_0x316dd5[_0xb1ed('0x19')]?_0x316dd5[_0xb1ed('0x19')]['limit']||null:null})['then'](function(_0x3e81a){logger[_0xb1ed('0xc')](_0xb1ed('0x1c'),_0x316dd5);logger['debug'](_0xb1ed('0x1c'),_0x316dd5,JSON[_0xb1ed('0x1b')](_0x3e81a));_0x4cb13b(_0x3e81a);})[_0xb1ed('0x14')](function(_0x496a12){logger[_0xb1ed('0x11')](_0xb1ed('0x1c'),_0x496a12[_0xb1ed('0x13')],_0x316dd5);_0x184c80(_0xb06608['error'](0x1f4,_0x496a12[_0xb1ed('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index b8912b3..c0b42ea 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 _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x4d822e,_0x415c95){var _0x57484b=function(_0x417405){while(--_0x417405){_0x4d822e['push'](_0x4d822e['shift']());}};_0x57484b(++_0x415c95);}(_0x5f2f,0x73));var _0xf5f2=function(_0x163d1d,_0x1d3717){_0x163d1d=_0x163d1d-0x0;var _0x469226=_0x5f2f[_0x163d1d];return _0x469226;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x5e2759,_0x127abd){var _0x543998=function(_0x20dc3f){while(--_0x20dc3f){_0x5e2759['push'](_0x5e2759['shift']());}};_0x543998(++_0x127abd);}(_0x5f2f,0x73));var _0xf5f2=function(_0x21400c,_0x1e3988){_0x21400c=_0x21400c-0x0;var _0x53457d=_0x5f2f[_0x21400c];return _0x53457d;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index c7fd74a..acda15b 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 _0x31f2=['TEXT','STRING'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x31f2,0xc9));var _0x231f=function(_0x110aba,_0x15957a){_0x110aba=_0x110aba-0x0;var _0x8171f7=_0x31f2[_0x110aba];return _0x8171f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x231f('0x0')]},'node':{'type':Sequelize[_0x231f('0x0')]},'application':{'type':Sequelize[_0x231f('0x0')]},'data':{'type':Sequelize[_0x231f('0x1')]},'project_name':{'type':Sequelize[_0x231f('0x0')]},'callerid':{'type':Sequelize[_0x231f('0x0')]}}; \ No newline at end of file +var _0xf371=['sequelize','exports','STRING','TEXT'];(function(_0x308408,_0x37d440){var _0x9dc073=function(_0x29f0c9){while(--_0x29f0c9){_0x308408['push'](_0x308408['shift']());}};_0x9dc073(++_0x37d440);}(_0xf371,0x148));var _0x1f37=function(_0x571314,_0x2ee6c5){_0x571314=_0x571314-0x0;var _0x1a782b=_0xf371[_0x571314];return _0x1a782b;};'use strict';var Sequelize=require(_0x1f37('0x0'));module[_0x1f37('0x1')]={'uniqueid':{'type':Sequelize[_0x1f37('0x2')]},'node':{'type':Sequelize[_0x1f37('0x2')]},'application':{'type':Sequelize['STRING']},'data':{'type':Sequelize[_0x1f37('0x3')]},'project_name':{'type':Sequelize[_0x1f37('0x2')]},'callerid':{'type':Sequelize[_0x1f37('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 12cc798..3e07db5 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 _0x56e0=['options','SquareDetailsReport','includeAll','include','findAll','rows','catch','params','find','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','reject','then','destroy','name','send','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x2e9905,_0x1ce763){var _0x42a9bf=function(_0x35fe6b){while(--_0x35fe6b){_0x2e9905['push'](_0x2e9905['shift']());}};_0x42a9bf(++_0x1ce763);}(_0x56e0,0x9b));var _0x056e=function(_0x1c0f3f,_0x565657){_0x1c0f3f=_0x1c0f3f-0x0;var _0x4fe570=_0x56e0[_0x1c0f3f];return _0x4fe570;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x056e('0x0'));var rimraf=require(_0x056e('0x1'));var zipdir=require(_0x056e('0x2'));var jsonpatch=require(_0x056e('0x3'));var rp=require(_0x056e('0x4'));var moment=require(_0x056e('0x5'));var BPromise=require(_0x056e('0x6'));var Mustache=require(_0x056e('0x7'));var util=require(_0x056e('0x8'));var path=require('path');var sox=require(_0x056e('0x9'));var csv=require(_0x056e('0xa'));var ejs=require(_0x056e('0xb'));var fs=require('fs');var _=require(_0x056e('0xc'));var squel=require('squel');var crypto=require(_0x056e('0xd'));var jsforce=require(_0x056e('0xe'));var deskjs=require(_0x056e('0xf'));var toCsv=require(_0x056e('0xa'));var querystring=require(_0x056e('0x10'));var Papa=require('papaparse');var Redis=require(_0x056e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x056e('0x12'));var as=require(_0x056e('0x13'));var hardwareService=require(_0x056e('0x14'));var logger=require(_0x056e('0x15'))(_0x056e('0x16'));var utils=require(_0x056e('0x17'));var config=require('../../config/environment');var db=require(_0x056e('0x18'))['db'];function respondWithStatusCode(_0x28b40e,_0x2db51f){_0x2db51f=_0x2db51f||0xcc;return function(_0x39fae7){if(_0x39fae7){return _0x28b40e[_0x056e('0x19')](_0x2db51f);}return _0x28b40e[_0x056e('0x1a')](_0x2db51f)[_0x056e('0x1b')]();};}function respondWithResult(_0x21d7a6,_0x462061){_0x462061=_0x462061||0xc8;return function(_0x1e4ae0){if(_0x1e4ae0){return _0x21d7a6[_0x056e('0x1a')](_0x462061)[_0x056e('0x1c')](_0x1e4ae0);}};}function respondWithFilteredResult(_0x209c7d,_0x3f2c98){return function(_0x4ecdb7){if(_0x4ecdb7){var _0x42b75d=_0x4ecdb7[_0x056e('0x1d')],_0x55bc70=_0x3f2c98[_0x056e('0x1e')],_0x25792c=_0x3f2c98[_0x056e('0x1e')]+_0x3f2c98['limit'],_0x119f98;if(_0x25792c>=_0x42b75d){_0x25792c=_0x42b75d;_0x119f98=0xc8;}else{_0x119f98=0xce;}_0x209c7d[_0x056e('0x1a')](_0x119f98);return _0x209c7d[_0x056e('0x1f')]('Content-Range',_0x55bc70+'-'+_0x25792c+'/'+_0x42b75d)['json'](_0x4ecdb7);}return null;};}function patchUpdates(_0x8aeb70){return function(_0x3cbdb1){try{jsonpatch['apply'](_0x3cbdb1,_0x8aeb70,!![]);}catch(_0x39f4ee){return BPromise[_0x056e('0x20')](_0x39f4ee);}return _0x3cbdb1['save']();};}function saveUpdates(_0x2b0e76,_0x43c732){return function(_0x204c53){if(_0x204c53){return _0x204c53['update'](_0x2b0e76)[_0x056e('0x21')](function(_0x90ca0b){return _0x90ca0b;});}return null;};}function removeEntity(_0x45958a,_0x2d2f2a){return function(_0x416626){if(_0x416626){return _0x416626[_0x056e('0x22')]()['then'](function(){_0x45958a[_0x056e('0x1a')](0xcc)[_0x056e('0x1b')]();});}};}function handleEntityNotFound(_0x3bdbef,_0x1908bb){return function(_0x125fc3){if(!_0x125fc3){_0x3bdbef[_0x056e('0x19')](0x194);}return _0x125fc3;};}function handleError(_0x32f5ef,_0x29b481){_0x29b481=_0x29b481||0x1f4;return function(_0x224c8d){logger['error'](_0x224c8d['stack']);if(_0x224c8d[_0x056e('0x23')]){delete _0x224c8d[_0x056e('0x23')];}_0x32f5ef[_0x056e('0x1a')](_0x29b481)[_0x056e('0x24')](_0x224c8d);};}exports['index']=function(_0x2150cf,_0x471029){var _0x1bc921={},_0x3b86e7={},_0x46f098={'count':0x0,'rows':[]};var _0x58eee1=_[_0x056e('0x25')](db['SquareDetailsReport'][_0x056e('0x26')],function(_0x1361b5){return{'name':_0x1361b5['fieldName'],'type':_0x1361b5[_0x056e('0x27')][_0x056e('0x28')]};});_0x3b86e7[_0x056e('0x29')]=_[_0x056e('0x25')](_0x58eee1,'name');_0x3b86e7[_0x056e('0x2a')]=_[_0x056e('0x2b')](_0x2150cf[_0x056e('0x2a')]);_0x3b86e7[_0x056e('0x2c')]=_[_0x056e('0x2d')](_0x3b86e7[_0x056e('0x29')],_0x3b86e7[_0x056e('0x2a')]);_0x1bc921[_0x056e('0x2e')]=_[_0x056e('0x2d')](_0x3b86e7[_0x056e('0x29')],qs[_0x056e('0x2f')](_0x2150cf[_0x056e('0x2a')]['fields']));_0x1bc921[_0x056e('0x2e')]=_0x1bc921[_0x056e('0x2e')][_0x056e('0x30')]?_0x1bc921[_0x056e('0x2e')]:_0x3b86e7[_0x056e('0x29')];if(!_0x2150cf[_0x056e('0x2a')][_0x056e('0x31')]('nolimit')){_0x1bc921[_0x056e('0x32')]=qs['limit'](_0x2150cf[_0x056e('0x2a')][_0x056e('0x32')]);_0x1bc921[_0x056e('0x1e')]=qs[_0x056e('0x1e')](_0x2150cf[_0x056e('0x2a')][_0x056e('0x1e')]);}_0x1bc921[_0x056e('0x33')]=qs['sort'](_0x2150cf['query'][_0x056e('0x34')]);_0x1bc921[_0x056e('0x35')]=qs[_0x056e('0x2c')](_[_0x056e('0x36')](_0x2150cf[_0x056e('0x2a')],_0x3b86e7['filters']));if(_0x2150cf['query'][_0x056e('0x37')]){_0x1bc921[_0x056e('0x35')]=_[_0x056e('0x38')](_0x1bc921[_0x056e('0x35')],{'$or':_[_0x056e('0x25')](_0x58eee1,function(_0x37a6e8){if(_0x37a6e8['type']!==_0x056e('0x39')){var _0x33767f={};_0x33767f[_0x37a6e8[_0x056e('0x23')]]={'$like':'%'+_0x2150cf[_0x056e('0x2a')][_0x056e('0x37')]+'%'};return _0x33767f;}})});}_0x1bc921=_[_0x056e('0x38')]({},_0x1bc921,_0x2150cf[_0x056e('0x3a')]);var _0x583430={'where':_0x1bc921[_0x056e('0x35')]};return db[_0x056e('0x3b')][_0x056e('0x1d')](_0x583430)[_0x056e('0x21')](function(_0x55ad10){_0x46f098['count']=_0x55ad10;if(_0x2150cf['query'][_0x056e('0x3c')]){_0x1bc921[_0x056e('0x3d')]=[{'all':!![]}];}return db[_0x056e('0x3b')][_0x056e('0x3e')](_0x1bc921);})[_0x056e('0x21')](function(_0x2d19dc){_0x46f098[_0x056e('0x3f')]=_0x2d19dc;return _0x46f098;})['then'](respondWithFilteredResult(_0x471029,_0x1bc921))[_0x056e('0x40')](handleError(_0x471029,null));};exports['show']=function(_0x17fdb9,_0x30ff02){var _0x360b89={'raw':!![],'where':{'id':_0x17fdb9[_0x056e('0x41')]['id']}},_0x59764c={};_0x59764c[_0x056e('0x29')]=_[_0x056e('0x2b')](db[_0x056e('0x3b')]['rawAttributes']);_0x59764c[_0x056e('0x2a')]=_[_0x056e('0x2b')](_0x17fdb9[_0x056e('0x2a')]);_0x59764c[_0x056e('0x2c')]=_[_0x056e('0x2d')](_0x59764c[_0x056e('0x29')],_0x59764c[_0x056e('0x2a')]);_0x360b89[_0x056e('0x2e')]=_['intersection'](_0x59764c[_0x056e('0x29')],qs[_0x056e('0x2f')](_0x17fdb9[_0x056e('0x2a')][_0x056e('0x2f')]));_0x360b89[_0x056e('0x2e')]=_0x360b89[_0x056e('0x2e')][_0x056e('0x30')]?_0x360b89[_0x056e('0x2e')]:_0x59764c[_0x056e('0x29')];if(_0x17fdb9[_0x056e('0x2a')]['includeAll']){_0x360b89[_0x056e('0x3d')]=[{'all':!![]}];}_0x360b89=_[_0x056e('0x38')]({},_0x360b89,_0x17fdb9['options']);return db[_0x056e('0x3b')][_0x056e('0x42')](_0x360b89)['then'](handleEntityNotFound(_0x30ff02,null))[_0x056e('0x21')](respondWithResult(_0x30ff02,null))[_0x056e('0x40')](handleError(_0x30ff02,null));};exports[_0x056e('0x43')]=function(_0x501852,_0x1c9d4b){return db['SquareDetailsReport'][_0x056e('0x43')](_0x501852[_0x056e('0x44')],{})[_0x056e('0x21')](respondWithResult(_0x1c9d4b,0xc9))[_0x056e('0x40')](handleError(_0x1c9d4b,null));};exports[_0x056e('0x45')]=function(_0x49ce9a,_0x3cd6b4){if(_0x49ce9a['body']['id']){delete _0x49ce9a['body']['id'];}return db['SquareDetailsReport'][_0x056e('0x42')]({'where':{'id':_0x49ce9a[_0x056e('0x41')]['id']}})['then'](handleEntityNotFound(_0x3cd6b4,null))[_0x056e('0x21')](saveUpdates(_0x49ce9a['body'],null))[_0x056e('0x21')](respondWithResult(_0x3cd6b4,null))['catch'](handleError(_0x3cd6b4,null));};exports[_0x056e('0x22')]=function(_0x3c1478,_0x1e815e){return db[_0x056e('0x3b')]['find']({'where':{'id':_0x3c1478['params']['id']}})['then'](handleEntityNotFound(_0x1e815e,null))[_0x056e('0x21')](removeEntity(_0x1e815e,null))['catch'](handleError(_0x1e815e,null));};exports[_0x056e('0x46')]=function(_0x20dfb9,_0x117f9e){return db[_0x056e('0x3b')]['describe']()[_0x056e('0x21')](respondWithResult(_0x117f9e,null))['catch'](handleError(_0x117f9e,null));}; \ No newline at end of file +var _0x545e=['ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','apply','reject','save','update','then','destroy','error','stack','name','send','rawAttributes','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','SquareDetailsReport','include','findAll','rows','catch','show','params','includeAll','find','create','body','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x545e,0x158));var _0xe545=function(_0x39bf12,_0x4180b5){_0x39bf12=_0x39bf12-0x0;var _0xbf8cd8=_0x545e[_0x39bf12];return _0xbf8cd8;};'use strict';var pdf=require(_0xe545('0x0'));var emlformat=require(_0xe545('0x1'));var rimraf=require(_0xe545('0x2'));var zipdir=require(_0xe545('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe545('0x4'));var moment=require(_0xe545('0x5'));var BPromise=require(_0xe545('0x6'));var Mustache=require(_0xe545('0x7'));var util=require(_0xe545('0x8'));var path=require('path');var sox=require(_0xe545('0x9'));var csv=require(_0xe545('0xa'));var ejs=require(_0xe545('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe545('0xc'));var crypto=require(_0xe545('0xd'));var jsforce=require(_0xe545('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xe545('0xa'));var querystring=require(_0xe545('0xf'));var Papa=require('papaparse');var Redis=require(_0xe545('0x10'));var authService=require(_0xe545('0x11'));var qs=require(_0xe545('0x12'));var as=require(_0xe545('0x13'));var hardwareService=require(_0xe545('0x14'));var logger=require('../../config/logger')(_0xe545('0x15'));var utils=require('../../config/utils');var config=require(_0xe545('0x16'));var db=require(_0xe545('0x17'))['db'];function respondWithStatusCode(_0x1de7ad,_0x1116a0){_0x1116a0=_0x1116a0||0xcc;return function(_0x3443ab){if(_0x3443ab){return _0x1de7ad[_0xe545('0x18')](_0x1116a0);}return _0x1de7ad[_0xe545('0x19')](_0x1116a0)[_0xe545('0x1a')]();};}function respondWithResult(_0x2a1a27,_0x112be8){_0x112be8=_0x112be8||0xc8;return function(_0x2ca3e9){if(_0x2ca3e9){return _0x2a1a27[_0xe545('0x19')](_0x112be8)[_0xe545('0x1b')](_0x2ca3e9);}};}function respondWithFilteredResult(_0x303257,_0x20a85b){return function(_0x6e7cf5){if(_0x6e7cf5){var _0x597dda=_0x6e7cf5[_0xe545('0x1c')],_0x42db67=_0x20a85b['offset'],_0x27cfa5=_0x20a85b['offset']+_0x20a85b[_0xe545('0x1d')],_0x31d7b6;if(_0x27cfa5>=_0x597dda){_0x27cfa5=_0x597dda;_0x31d7b6=0xc8;}else{_0x31d7b6=0xce;}_0x303257[_0xe545('0x19')](_0x31d7b6);return _0x303257[_0xe545('0x1e')]('Content-Range',_0x42db67+'-'+_0x27cfa5+'/'+_0x597dda)[_0xe545('0x1b')](_0x6e7cf5);}return null;};}function patchUpdates(_0x428cd8){return function(_0xd27916){try{jsonpatch[_0xe545('0x1f')](_0xd27916,_0x428cd8,!![]);}catch(_0xd513a1){return BPromise[_0xe545('0x20')](_0xd513a1);}return _0xd27916[_0xe545('0x21')]();};}function saveUpdates(_0x3385f7,_0x410e9f){return function(_0x54ebae){if(_0x54ebae){return _0x54ebae[_0xe545('0x22')](_0x3385f7)[_0xe545('0x23')](function(_0x4d84e2){return _0x4d84e2;});}return null;};}function removeEntity(_0x4c2838,_0x144a64){return function(_0x433f03){if(_0x433f03){return _0x433f03[_0xe545('0x24')]()[_0xe545('0x23')](function(){_0x4c2838[_0xe545('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e88c8,_0x171d84){return function(_0x1a05cc){if(!_0x1a05cc){_0x1e88c8[_0xe545('0x18')](0x194);}return _0x1a05cc;};}function handleError(_0x1fdd7a,_0x8e2904){_0x8e2904=_0x8e2904||0x1f4;return function(_0x563e54){logger[_0xe545('0x25')](_0x563e54[_0xe545('0x26')]);if(_0x563e54['name']){delete _0x563e54[_0xe545('0x27')];}_0x1fdd7a['status'](_0x8e2904)[_0xe545('0x28')](_0x563e54);};}exports['index']=function(_0x39a9c5,_0x2462c1){var _0x1febfa={},_0xdbbeb0={},_0x11a4cd={'count':0x0,'rows':[]};var _0x312b57=_['map'](db['SquareDetailsReport'][_0xe545('0x29')],function(_0x5ba01d){return{'name':_0x5ba01d['fieldName'],'type':_0x5ba01d[_0xe545('0x2a')]['key']};});_0xdbbeb0['model']=_[_0xe545('0x2b')](_0x312b57,_0xe545('0x27'));_0xdbbeb0[_0xe545('0x2c')]=_[_0xe545('0x2d')](_0x39a9c5[_0xe545('0x2c')]);_0xdbbeb0[_0xe545('0x2e')]=_[_0xe545('0x2f')](_0xdbbeb0['model'],_0xdbbeb0['query']);_0x1febfa[_0xe545('0x30')]=_[_0xe545('0x2f')](_0xdbbeb0[_0xe545('0x31')],qs[_0xe545('0x32')](_0x39a9c5[_0xe545('0x2c')][_0xe545('0x32')]));_0x1febfa[_0xe545('0x30')]=_0x1febfa[_0xe545('0x30')][_0xe545('0x33')]?_0x1febfa['attributes']:_0xdbbeb0[_0xe545('0x31')];if(!_0x39a9c5[_0xe545('0x2c')][_0xe545('0x34')](_0xe545('0x35'))){_0x1febfa[_0xe545('0x1d')]=qs[_0xe545('0x1d')](_0x39a9c5[_0xe545('0x2c')][_0xe545('0x1d')]);_0x1febfa[_0xe545('0x36')]=qs[_0xe545('0x36')](_0x39a9c5['query'][_0xe545('0x36')]);}_0x1febfa[_0xe545('0x37')]=qs[_0xe545('0x38')](_0x39a9c5[_0xe545('0x2c')][_0xe545('0x38')]);_0x1febfa[_0xe545('0x39')]=qs[_0xe545('0x2e')](_['pick'](_0x39a9c5[_0xe545('0x2c')],_0xdbbeb0[_0xe545('0x2e')]));if(_0x39a9c5['query'][_0xe545('0x3a')]){_0x1febfa[_0xe545('0x39')]=_[_0xe545('0x3b')](_0x1febfa[_0xe545('0x39')],{'$or':_['map'](_0x312b57,function(_0x19b623){if(_0x19b623[_0xe545('0x2a')]!=='VIRTUAL'){var _0x17b5af={};_0x17b5af[_0x19b623[_0xe545('0x27')]]={'$like':'%'+_0x39a9c5[_0xe545('0x2c')]['filter']+'%'};return _0x17b5af;}})});}_0x1febfa=_[_0xe545('0x3b')]({},_0x1febfa,_0x39a9c5['options']);var _0x55910b={'where':_0x1febfa['where']};return db[_0xe545('0x3c')][_0xe545('0x1c')](_0x55910b)[_0xe545('0x23')](function(_0x5ca29e){_0x11a4cd[_0xe545('0x1c')]=_0x5ca29e;if(_0x39a9c5['query']['includeAll']){_0x1febfa[_0xe545('0x3d')]=[{'all':!![]}];}return db[_0xe545('0x3c')][_0xe545('0x3e')](_0x1febfa);})[_0xe545('0x23')](function(_0xfa9a9a){_0x11a4cd[_0xe545('0x3f')]=_0xfa9a9a;return _0x11a4cd;})['then'](respondWithFilteredResult(_0x2462c1,_0x1febfa))[_0xe545('0x40')](handleError(_0x2462c1,null));};exports[_0xe545('0x41')]=function(_0x1c0cc8,_0x5bfe2b){var _0x28f901={'raw':!![],'where':{'id':_0x1c0cc8[_0xe545('0x42')]['id']}},_0x4eabb5={};_0x4eabb5[_0xe545('0x31')]=_['keys'](db['SquareDetailsReport'][_0xe545('0x29')]);_0x4eabb5[_0xe545('0x2c')]=_[_0xe545('0x2d')](_0x1c0cc8[_0xe545('0x2c')]);_0x4eabb5[_0xe545('0x2e')]=_[_0xe545('0x2f')](_0x4eabb5[_0xe545('0x31')],_0x4eabb5[_0xe545('0x2c')]);_0x28f901[_0xe545('0x30')]=_[_0xe545('0x2f')](_0x4eabb5[_0xe545('0x31')],qs[_0xe545('0x32')](_0x1c0cc8[_0xe545('0x2c')]['fields']));_0x28f901['attributes']=_0x28f901[_0xe545('0x30')][_0xe545('0x33')]?_0x28f901[_0xe545('0x30')]:_0x4eabb5[_0xe545('0x31')];if(_0x1c0cc8['query'][_0xe545('0x43')]){_0x28f901['include']=[{'all':!![]}];}_0x28f901=_[_0xe545('0x3b')]({},_0x28f901,_0x1c0cc8['options']);return db[_0xe545('0x3c')][_0xe545('0x44')](_0x28f901)[_0xe545('0x23')](handleEntityNotFound(_0x5bfe2b,null))[_0xe545('0x23')](respondWithResult(_0x5bfe2b,null))['catch'](handleError(_0x5bfe2b,null));};exports[_0xe545('0x45')]=function(_0xa2f9c7,_0x3feb2e){return db['SquareDetailsReport'][_0xe545('0x45')](_0xa2f9c7[_0xe545('0x46')],{})[_0xe545('0x23')](respondWithResult(_0x3feb2e,0xc9))[_0xe545('0x40')](handleError(_0x3feb2e,null));};exports[_0xe545('0x22')]=function(_0x13f4ea,_0x4efbc9){if(_0x13f4ea['body']['id']){delete _0x13f4ea['body']['id'];}return db[_0xe545('0x3c')][_0xe545('0x44')]({'where':{'id':_0x13f4ea[_0xe545('0x42')]['id']}})['then'](handleEntityNotFound(_0x4efbc9,null))[_0xe545('0x23')](saveUpdates(_0x13f4ea[_0xe545('0x46')],null))[_0xe545('0x23')](respondWithResult(_0x4efbc9,null))[_0xe545('0x40')](handleError(_0x4efbc9,null));};exports[_0xe545('0x24')]=function(_0x1d8a8c,_0x4d2647){return db['SquareDetailsReport']['find']({'where':{'id':_0x1d8a8c[_0xe545('0x42')]['id']}})['then'](handleEntityNotFound(_0x4d2647,null))[_0xe545('0x23')](removeEntity(_0x4d2647,null))[_0xe545('0x40')](handleError(_0x4d2647,null));};exports['describe']=function(_0x307994,_0x3d559c){return db[_0xe545('0x3c')]['describe']()['then'](respondWithResult(_0x3d559c,null))[_0xe545('0x40')](handleError(_0x3d559c,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index bb198b0..4b1ca66 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 _0xf42f=['../../config/logger','api','bluebird','request-promise','./squareReportDetail.attributes','define','SquareDetailsReport','report_square_details','lodash','util'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0xf42f,0xbc));var _0xff42=function(_0x123fc7,_0x5bab6b){_0x123fc7=_0x123fc7-0x0;var _0x348e46=_0xf42f[_0x123fc7];return _0x348e46;};'use strict';var _=require(_0xff42('0x0'));var util=require(_0xff42('0x1'));var logger=require(_0xff42('0x2'))(_0xff42('0x3'));var moment=require('moment');var BPromise=require(_0xff42('0x4'));var rp=require(_0xff42('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xff42('0x6'));module['exports']=function(_0x4a71c6,_0xfaaf3a){return _0x4a71c6[_0xff42('0x7')](_0xff42('0x8'),attributes,{'tableName':_0xff42('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3996=['rimraf','../../config/environment','./squareReportDetail.attributes','exports','SquareDetailsReport','report_square_details','util','../../config/logger','api','moment','bluebird','path'];(function(_0x12ead1,_0x1dd6d3){var _0xb8e16b=function(_0x3479d8){while(--_0x3479d8){_0x12ead1['push'](_0x12ead1['shift']());}};_0xb8e16b(++_0x1dd6d3);}(_0x3996,0x1da));var _0x6399=function(_0x852931,_0x1d7f1f){_0x852931=_0x852931-0x0;var _0x4cf758=_0x3996[_0x852931];return _0x4cf758;};'use strict';var _=require('lodash');var util=require(_0x6399('0x0'));var logger=require(_0x6399('0x1'))(_0x6399('0x2'));var moment=require(_0x6399('0x3'));var BPromise=require(_0x6399('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6399('0x5'));var rimraf=require(_0x6399('0x6'));var config=require(_0x6399('0x7'));var attributes=require(_0x6399('0x8'));module[_0x6399('0x9')]=function(_0x6e17cb,_0x41a177){return _0x6e17cb['define'](_0x6399('0xa'),attributes,{'tableName':_0x6399('0xb'),'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 1b3e857..09290b8 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 _0xac63=['jayson/promise','client','http','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateSquareDetailsReport','create','options','raw','lodash','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x8340c1,_0x1dbdf0){var _0x2367fe=function(_0x5443dd){while(--_0x5443dd){_0x8340c1['push'](_0x8340c1['shift']());}};_0x2367fe(++_0x1dbdf0);}(_0xac63,0x1de));var _0x3ac6=function(_0x45d55e,_0x2fede3){_0x45d55e=_0x45d55e-0x0;var _0x29812a=_0xac63[_0x45d55e];return _0x29812a;};'use strict';var _=require(_0x3ac6('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3ac6('0x1'));var fs=require('fs');var Redis=require(_0x3ac6('0x2'));var db=require(_0x3ac6('0x3'))['db'];var utils=require(_0x3ac6('0x4'));var logger=require(_0x3ac6('0x5'))(_0x3ac6('0x6'));var config=require(_0x3ac6('0x7'));var jayson=require(_0x3ac6('0x8'));var client=jayson[_0x3ac6('0x9')][_0x3ac6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17ff0d,_0x171085,_0x5e7f3f){return new BPromise(function(_0x44bf9d,_0x51759c){return client[_0x3ac6('0xb')](_0x17ff0d,_0x5e7f3f)[_0x3ac6('0xc')](function(_0x4cc115){logger[_0x3ac6('0xd')](_0x3ac6('0xe'),_0x171085,_0x3ac6('0xf'));logger[_0x3ac6('0x10')]('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x171085,_0x3ac6('0xf'),JSON[_0x3ac6('0x11')](_0x4cc115));if(_0x4cc115['error']){if(_0x4cc115[_0x3ac6('0x12')][_0x3ac6('0x13')]===0x1f4){logger['error'](_0x3ac6('0xe'),_0x171085,_0x4cc115['error'][_0x3ac6('0x14')]);return _0x51759c(_0x4cc115['error']['message']);}logger['error'](_0x3ac6('0xe'),_0x171085,_0x4cc115[_0x3ac6('0x12')][_0x3ac6('0x14')]);return _0x44bf9d(_0x4cc115[_0x3ac6('0x12')][_0x3ac6('0x14')]);}else{logger[_0x3ac6('0xd')](_0x3ac6('0xe'),_0x171085,_0x3ac6('0xf'));_0x44bf9d(_0x4cc115[_0x3ac6('0x15')][_0x3ac6('0x14')]);}})[_0x3ac6('0x16')](function(_0x8651f3){logger['error'](_0x3ac6('0xe'),_0x171085,_0x8651f3);_0x51759c(_0x8651f3);});});}exports[_0x3ac6('0x17')]=function(_0x3f8132){var _0x259734=this;return new Promise(function(_0x480607,_0x27ec67){return db['SquareDetailsReport'][_0x3ac6('0x18')](_0x3f8132['body'],{'raw':_0x3f8132['options']?_0x3f8132[_0x3ac6('0x19')][_0x3ac6('0x1a')]===undefined?!![]:![]:!![]})[_0x3ac6('0xc')](function(_0x378aa6){logger[_0x3ac6('0xd')](_0x3ac6('0x17'),_0x3f8132);logger['debug'](_0x3ac6('0x17'),_0x3f8132,JSON['stringify'](_0x378aa6));_0x480607(_0x378aa6);})[_0x3ac6('0x16')](function(_0x3909f9){logger[_0x3ac6('0x12')](_0x3ac6('0x17'),_0x3909f9['message'],_0x3f8132);_0x27ec67(_0x259734[_0x3ac6('0x12')](0x1f4,_0x3909f9['message']));});});}; \ No newline at end of file +var _0xb82a=['create','body','options','raw','debug','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','CreateSquareDetailsReport','SquareDetailsReport'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xb82a,0x1eb));var _0xab82=function(_0x19c7b4,_0x47356e){_0x19c7b4=_0x19c7b4-0x0;var _0x6940b=_0xb82a[_0x19c7b4];return _0x6940b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xab82('0x0'));var BPromise=require('bluebird');var rs=require(_0xab82('0x1'));var fs=require('fs');var Redis=require(_0xab82('0x2'));var db=require(_0xab82('0x3'))['db'];var utils=require(_0xab82('0x4'));var logger=require(_0xab82('0x5'))(_0xab82('0x6'));var config=require(_0xab82('0x7'));var jayson=require(_0xab82('0x8'));var client=jayson[_0xab82('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7768cf,_0x53de40,_0x57fbf2){return new BPromise(function(_0x4f04cf,_0x3c087f){return client[_0xab82('0xa')](_0x7768cf,_0x57fbf2)[_0xab82('0xb')](function(_0x1eacce){logger['info'](_0xab82('0xc'),_0x53de40,'request\x20sent');logger['debug']('SquareDetailsReport,\x20%s,\x20%s,\x20%s',_0x53de40,_0xab82('0xd'),JSON[_0xab82('0xe')](_0x1eacce));if(_0x1eacce[_0xab82('0xf')]){if(_0x1eacce['error'][_0xab82('0x10')]===0x1f4){logger[_0xab82('0xf')](_0xab82('0xc'),_0x53de40,_0x1eacce[_0xab82('0xf')]['message']);return _0x3c087f(_0x1eacce[_0xab82('0xf')][_0xab82('0x11')]);}logger[_0xab82('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x53de40,_0x1eacce['error'][_0xab82('0x11')]);return _0x4f04cf(_0x1eacce['error'][_0xab82('0x11')]);}else{logger[_0xab82('0x12')]('SquareDetailsReport,\x20%s,\x20%s',_0x53de40,'request\x20sent');_0x4f04cf(_0x1eacce['result'][_0xab82('0x11')]);}})[_0xab82('0x13')](function(_0x5925e4){logger[_0xab82('0xf')]('SquareDetailsReport,\x20%s,\x20%s',_0x53de40,_0x5925e4);_0x3c087f(_0x5925e4);});});}exports[_0xab82('0x14')]=function(_0x1b8856){var _0x4915e1=this;return new Promise(function(_0x1b18c7,_0x1852dc){return db[_0xab82('0x15')][_0xab82('0x16')](_0x1b8856[_0xab82('0x17')],{'raw':_0x1b8856[_0xab82('0x18')]?_0x1b8856[_0xab82('0x18')][_0xab82('0x19')]===undefined?!![]:![]:!![]})[_0xab82('0xb')](function(_0xc82a90){logger[_0xab82('0x12')]('CreateSquareDetailsReport',_0x1b8856);logger[_0xab82('0x1a')](_0xab82('0x14'),_0x1b8856,JSON[_0xab82('0xe')](_0xc82a90));_0x1b18c7(_0xc82a90);})[_0xab82('0x13')](function(_0x59a74f){logger[_0xab82('0xf')](_0xab82('0x14'),_0x59a74f[_0xab82('0x11')],_0x1b8856);_0x1852dc(_0x4915e1[_0xab82('0xf')](0x1f4,_0x59a74f[_0xab82('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index dcee675..1bf0ce4 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 _0x51b7=['index','get','/process/:pid/kill','isAuthenticated','express','Router'];(function(_0x6e91d0,_0x33d94b){var _0x5a8853=function(_0x1b54ca){while(--_0x1b54ca){_0x6e91d0['push'](_0x6e91d0['shift']());}};_0x5a8853(++_0x33d94b);}(_0x51b7,0x142));var _0x751b=function(_0x4a70a1,_0x918cff){_0x4a70a1=_0x4a70a1-0x0;var _0x1a0897=_0x51b7[_0x4a70a1];return _0x1a0897;};'use strict';var express=require(_0x751b('0x0'));var router=express[_0x751b('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x751b('0x2')]);router[_0x751b('0x3')](_0x751b('0x4'),auth[_0x751b('0x5')](),controller['killProcess']);module['exports']=router; \ No newline at end of file +var _0xe0c0=['../../components/auth/service','./system.controller','isAuthenticated','get','/process/:pid/kill','killProcess','exports','express'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xe0c0,0xe7));var _0x0e0c=function(_0x3ea4d5,_0x50f523){_0x3ea4d5=_0x3ea4d5-0x0;var _0x5d9d78=_0xe0c0[_0x3ea4d5];return _0x5d9d78;};'use strict';var express=require(_0x0e0c('0x0'));var router=express['Router']();var auth=require(_0x0e0c('0x1'));var controller=require(_0x0e0c('0x2'));router['get']('/',auth[_0x0e0c('0x3')](),controller['index']);router[_0x0e0c('0x4')](_0x0e0c('0x5'),auth[_0x0e0c('0x3')](),controller[_0x0e0c('0x6')]);module[_0x0e0c('0x7')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index 899c1d8..6ea7099 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 _0xe2eb=['index','then','json','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','systeminformation','child_process','../../config/logger','api','util','bluebird','lodash','inspect','name','status'];(function(_0x15bf18,_0x2698d8){var _0x2bd60a=function(_0x565fda){while(--_0x565fda){_0x15bf18['push'](_0x15bf18['shift']());}};_0x2bd60a(++_0x2698d8);}(_0xe2eb,0xac));var _0xbe2e=function(_0x18f3ca,_0x5d6155){_0x18f3ca=_0x18f3ca-0x0;var _0x5df20a=_0xe2eb[_0x18f3ca];return _0x5df20a;};'use strict';var info=require(_0xbe2e('0x0'));var exec=require(_0xbe2e('0x1'))['exec'];var logger=require(_0xbe2e('0x2'))(_0xbe2e('0x3'));var util=require(_0xbe2e('0x4'));var BPromise=require(_0xbe2e('0x5'));var _=require(_0xbe2e('0x6'));function handleError(_0x1cc258,_0x4391e4,_0xfce345){_0x4391e4=_0x4391e4||0x1f4;return function(_0x12cedf){logger['error']('<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s',_0xfce345,_0x4391e4,util[_0xbe2e('0x7')](_0x12cedf,{'showHidden':![],'depth':null}));delete _0x12cedf[_0xbe2e('0x8')];_0x1cc258[_0xbe2e('0x9')](_0x4391e4)['send'](_0x12cedf);};}exports[_0xbe2e('0xa')]=function(_0x850c9a,_0xef3350){return info['getAllData']()[_0xbe2e('0xb')](function(_0x36bafe){return _0xef3350[_0xbe2e('0x9')](0xc8)[_0xbe2e('0xc')](_0x36bafe);})[_0xbe2e('0xd')](function(_0x2fe49b){return _0xef3350[_0xbe2e('0x9')](0x1f4)[_0xbe2e('0xc')](_0x2fe49b);});};exports[_0xbe2e('0xe')]=function(_0x2a6323,_0x12d107){var _0x395389=[_0xbe2e('0xf')];return new BPromise(function(_0x44f9a6,_0x274b49){return exec(util[_0xbe2e('0x10')](_0xbe2e('0x11'),_0x2a6323[_0xbe2e('0x12')][_0xbe2e('0x13')]),function(_0x2c3592,_0xc2d131,_0x1ff8c5){if(_0x2c3592){return _0x274b49(_0x2c3592);}return _0x44f9a6(_0xc2d131);});})[_0xbe2e('0xb')](function(_0x25707d){var _0x2c0bd6=![];var _0x23d40a=_0x25707d[_0xbe2e('0x14')](/\n/);for(var _0x105db1=0x0,_0x1aa03a=_0x395389[_0xbe2e('0x15')];_0x105db1<_0x1aa03a,_0x2c0bd6===![];_0x105db1+=0x1){if(_0x25707d[_0xbe2e('0x16')](_0x395389[_0x105db1])>=0x0){_0x2c0bd6=!![];}}if(!_0x2c0bd6){throw new Error(util[_0xbe2e('0x10')](_0xbe2e('0x17'),_0x2a6323['params'][_0xbe2e('0x13')]));}process[_0xbe2e('0x18')](_0x2a6323['params'][_0xbe2e('0x13')],_0xbe2e('0x19'));return _0x12d107[_0xbe2e('0x9')](0xc8)[_0xbe2e('0xc')]({'message':util[_0xbe2e('0x10')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x2a6323[_0xbe2e('0x12')][_0xbe2e('0x13')])});})[_0xbe2e('0xd')](handleError(_0x12d107,null,_0xbe2e('0xe')));}; \ No newline at end of file +var _0x5e17=['name','status','send','index','then','json','catch','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','indexOf','format','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect'];(function(_0xbe5ccc,_0x346515){var _0x51d5c7=function(_0x4ea99a){while(--_0x4ea99a){_0xbe5ccc['push'](_0xbe5ccc['shift']());}};_0x51d5c7(++_0x346515);}(_0x5e17,0x17a));var _0x75e1=function(_0x30da4f,_0x2d5291){_0x30da4f=_0x30da4f-0x0;var _0x5e8392=_0x5e17[_0x30da4f];return _0x5e8392;};'use strict';var info=require(_0x75e1('0x0'));var exec=require('child_process')['exec'];var logger=require('../../config/logger')('api');var util=require('util');var BPromise=require(_0x75e1('0x1'));var _=require(_0x75e1('0x2'));function handleError(_0x23ec49,_0x1e8819,_0x3954d0){_0x1e8819=_0x1e8819||0x1f4;return function(_0x13b72a){logger[_0x75e1('0x3')](_0x75e1('0x4'),_0x3954d0,_0x1e8819,util[_0x75e1('0x5')](_0x13b72a,{'showHidden':![],'depth':null}));delete _0x13b72a[_0x75e1('0x6')];_0x23ec49[_0x75e1('0x7')](_0x1e8819)[_0x75e1('0x8')](_0x13b72a);};}exports[_0x75e1('0x9')]=function(_0x15af48,_0x1dd4a5){return info['getAllData']()[_0x75e1('0xa')](function(_0x5ced53){return _0x1dd4a5['status'](0xc8)[_0x75e1('0xb')](_0x5ced53);})[_0x75e1('0xc')](function(_0x316c2b){return _0x1dd4a5[_0x75e1('0x7')](0x1f4)[_0x75e1('0xb')](_0x316c2b);});};exports[_0x75e1('0xd')]=function(_0x2472b7,_0x67e13e){var _0x4eb893=[_0x75e1('0xe')];return new BPromise(function(_0x39b1a1,_0x25fa06){return exec(util['format'](_0x75e1('0xf'),_0x2472b7[_0x75e1('0x10')][_0x75e1('0x11')]),function(_0x260f06,_0x582b54,_0x2686a0){if(_0x260f06){return _0x25fa06(_0x260f06);}return _0x39b1a1(_0x582b54);});})[_0x75e1('0xa')](function(_0xdd134a){var _0x37e351=![];var _0x3b50fe=_0xdd134a[_0x75e1('0x12')](/\n/);for(var _0x2fcad5=0x0,_0x56c741=_0x4eb893[_0x75e1('0x13')];_0x2fcad5<_0x56c741,_0x37e351===![];_0x2fcad5+=0x1){if(_0xdd134a[_0x75e1('0x14')](_0x4eb893[_0x2fcad5])>=0x0){_0x37e351=!![];}}if(!_0x37e351){throw new Error(util[_0x75e1('0x15')]('Process\x20with\x20pid\x20%s\x20not\x20found!',_0x2472b7[_0x75e1('0x10')][_0x75e1('0x11')]));}process['kill'](_0x2472b7[_0x75e1('0x10')][_0x75e1('0x11')],_0x75e1('0x16'));return _0x67e13e['status'](0xc8)[_0x75e1('0xb')]({'message':util[_0x75e1('0x15')](_0x75e1('0x17'),_0x2472b7[_0x75e1('0x10')][_0x75e1('0x11')])});})['catch'](handleError(_0x67e13e,null,_0x75e1('0xd')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 584d2be..019353d 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 _0xb4e6=['index','/:id','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x2e2869,_0x16beec){var _0x28048b=function(_0x36484e){while(--_0x36484e){_0x2e2869['push'](_0x2e2869['shift']());}};_0x28048b(++_0x16beec);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0xb4e6[_0x3227c1];return _0x31fd48;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var auth=require(_0x6b4e('0x5'));var interaction=require(_0x6b4e('0x6'));var config=require(_0x6b4e('0x7'));var controller=require('./tag.controller');router[_0x6b4e('0x8')]('/',auth[_0x6b4e('0x9')](),controller[_0x6b4e('0xa')]);router['get'](_0x6b4e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6b4e('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6b4e('0xd')](_0x6b4e('0xb'),auth[_0x6b4e('0x9')](),controller[_0x6b4e('0xe')]);router[_0x6b4e('0xf')](_0x6b4e('0xb'),auth[_0x6b4e('0x9')](),controller['destroy']);module[_0x6b4e('0x10')]=router; \ No newline at end of file +var _0x2750=['get','isAuthenticated','/:id','show','create','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x1bd95e,_0x25d348){var _0x48f262=function(_0x79d4b){while(--_0x79d4b){_0x1bd95e['push'](_0x1bd95e['shift']());}};_0x48f262(++_0x25d348);}(_0x2750,0x13b));var _0x0275=function(_0x3a04b3,_0x3e2d9f){_0x3a04b3=_0x3a04b3-0x0;var _0x27e170=_0x2750[_0x3a04b3];return _0x27e170;};'use strict';var multer=require(_0x0275('0x0'));var util=require('util');var path=require(_0x0275('0x1'));var timeout=require(_0x0275('0x2'));var express=require(_0x0275('0x3'));var router=express[_0x0275('0x4')]();var auth=require(_0x0275('0x5'));var interaction=require(_0x0275('0x6'));var config=require(_0x0275('0x7'));var controller=require(_0x0275('0x8'));router[_0x0275('0x9')]('/',auth[_0x0275('0xa')](),controller['index']);router[_0x0275('0x9')](_0x0275('0xb'),auth[_0x0275('0xa')](),controller[_0x0275('0xc')]);router['post']('/',auth[_0x0275('0xa')](),controller[_0x0275('0xd')]);router[_0x0275('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x0275('0xf')]);router['delete'](_0x0275('0xb'),auth[_0x0275('0xa')](),controller[_0x0275('0x10')]);module[_0x0275('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 248ce76..d35417e 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 _0x0713=['#0091EA','STRING','name'];(function(_0x3040ee,_0x460812){var _0x2a2f8c=function(_0x5554e5){while(--_0x5554e5){_0x3040ee['push'](_0x3040ee['shift']());}};_0x2a2f8c(++_0x460812);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x3071('0x0')],'unique':_0x3071('0x1'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x3071('0x0')],'defaultValue':_0x3071('0x2')},'description':{'type':Sequelize[_0x3071('0x0')]}}; \ No newline at end of file +var _0xac4a=['exports','STRING','name','#0091EA','sequelize'];(function(_0x219c38,_0x2f868d){var _0x4b359f=function(_0x59bcb8){while(--_0x59bcb8){_0x219c38['push'](_0x219c38['shift']());}};_0x4b359f(++_0x2f868d);}(_0xac4a,0x13f));var _0xaac4=function(_0x3e6d9b,_0x5c0fba){_0x3e6d9b=_0x3e6d9b-0x0;var _0x9f286c=_0xac4a[_0x3e6d9b];return _0x9f286c;};'use strict';var Sequelize=require(_0xaac4('0x0'));module[_0xaac4('0x1')]={'name':{'type':Sequelize[_0xaac4('0x2')],'unique':_0xaac4('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xaac4('0x2')],'defaultValue':_0xaac4('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 0ef8d4d..72afe00 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 _0xef4c=['sort','pick','filter','merge','VIRTUAL','options','includeAll','findAll','show','keys','include','find','create','body','user','role','Tags','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','catch','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','get','UserProfileResource','destroy','error','stack','name','send','index','Tag','rawAttributes','fieldName','key','model','map','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order'];(function(_0x5e8908,_0xb7899c){var _0x29212b=function(_0x2251aa){while(--_0x2251aa){_0x5e8908['push'](_0x5e8908['shift']());}};_0x29212b(++_0xb7899c);}(_0xef4c,0x113));var _0xcef4=function(_0x2b517f,_0x21549c){_0x2b517f=_0x2b517f-0x0;var _0x3dba08=_0xef4c[_0x2b517f];return _0x3dba08;};'use strict';var pdf=require(_0xcef4('0x0'));var emlformat=require(_0xcef4('0x1'));var rimraf=require(_0xcef4('0x2'));var zipdir=require(_0xcef4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcef4('0x4'));var moment=require(_0xcef4('0x5'));var BPromise=require(_0xcef4('0x6'));var Mustache=require(_0xcef4('0x7'));var util=require(_0xcef4('0x8'));var path=require('path');var sox=require(_0xcef4('0x9'));var csv=require(_0xcef4('0xa'));var ejs=require(_0xcef4('0xb'));var fs=require('fs');var _=require(_0xcef4('0xc'));var squel=require(_0xcef4('0xd'));var crypto=require(_0xcef4('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xcef4('0xf'));var toCsv=require('to-csv');var querystring=require(_0xcef4('0x10'));var Papa=require(_0xcef4('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xcef4('0x12'));var as=require(_0xcef4('0x13'));var hardwareService=require(_0xcef4('0x14'));var logger=require(_0xcef4('0x15'))(_0xcef4('0x16'));var utils=require('../../config/utils');var config=require(_0xcef4('0x17'));var db=require(_0xcef4('0x18'))['db'];function respondWithStatusCode(_0x1f243d,_0x42db93){_0x42db93=_0x42db93||0xcc;return function(_0x10131e){if(_0x10131e){return _0x1f243d[_0xcef4('0x19')](_0x42db93);}return _0x1f243d[_0xcef4('0x1a')](_0x42db93)[_0xcef4('0x1b')]();};}function respondWithResult(_0x3da7c7,_0x3af783){_0x3af783=_0x3af783||0xc8;return function(_0x2a960e){if(_0x2a960e){return _0x3da7c7[_0xcef4('0x1a')](_0x3af783)[_0xcef4('0x1c')](_0x2a960e);}};}function respondWithFilteredResult(_0x295ffc,_0x2e39ca){return function(_0x472a5c){if(_0x472a5c){var _0x2adae5=_0x472a5c[_0xcef4('0x1d')],_0x2a7e9c=_0x2e39ca['offset'],_0x4d5a68=_0x2e39ca[_0xcef4('0x1e')]+_0x2e39ca['limit'],_0x215505;if(_0x4d5a68>=_0x2adae5){_0x4d5a68=_0x2adae5;_0x215505=0xc8;}else{_0x215505=0xce;}_0x295ffc[_0xcef4('0x1a')](_0x215505);return _0x295ffc[_0xcef4('0x1f')](_0xcef4('0x20'),_0x2a7e9c+'-'+_0x4d5a68+'/'+_0x2adae5)[_0xcef4('0x1c')](_0x472a5c);}return null;};}function patchUpdates(_0x8bf724){return function(_0x1d90b4){try{jsonpatch[_0xcef4('0x21')](_0x1d90b4,_0x8bf724,!![]);}catch(_0x29c5a8){return BPromise['reject'](_0x29c5a8);}return _0x1d90b4[_0xcef4('0x22')]();};}function saveUpdates(_0x9ce800,_0x218e73){return function(_0x339200){if(_0x339200){return _0x339200[_0xcef4('0x23')](_0x9ce800)[_0xcef4('0x24')](function(_0xf52c06){return _0xf52c06;});}return null;};}function removeEntity(_0x148f03,_0x3afdc1){return function(_0x4225af){if(_0x4225af){return _0x4225af['destroy']()[_0xcef4('0x24')](function(){var _0x457705=_0x4225af[_0xcef4('0x25')]({'plain':!![]});var _0x254357='Tags';return db[_0xcef4('0x26')][_0xcef4('0x27')]({'where':{'type':_0x254357,'resourceId':_0x457705['id']}})[_0xcef4('0x24')](function(){return _0x4225af;});})[_0xcef4('0x24')](function(){_0x148f03[_0xcef4('0x1a')](0xcc)[_0xcef4('0x1b')]();});}};}function handleEntityNotFound(_0x5bec9b,_0x5c9693){return function(_0x51f0ca){if(!_0x51f0ca){_0x5bec9b[_0xcef4('0x19')](0x194);}return _0x51f0ca;};}function handleError(_0x5f33cb,_0x36d459){_0x36d459=_0x36d459||0x1f4;return function(_0x4ff14f){logger[_0xcef4('0x28')](_0x4ff14f[_0xcef4('0x29')]);if(_0x4ff14f[_0xcef4('0x2a')]){delete _0x4ff14f['name'];}_0x5f33cb['status'](_0x36d459)[_0xcef4('0x2b')](_0x4ff14f);};}exports[_0xcef4('0x2c')]=function(_0xbf0c6a,_0x4c32bd){var _0x3b242e={},_0x344abf={},_0x4cecc0={'count':0x0,'rows':[]};var _0x2c9472=_['map'](db[_0xcef4('0x2d')][_0xcef4('0x2e')],function(_0x3b61b1){return{'name':_0x3b61b1[_0xcef4('0x2f')],'type':_0x3b61b1['type'][_0xcef4('0x30')]};});_0x344abf[_0xcef4('0x31')]=_[_0xcef4('0x32')](_0x2c9472,_0xcef4('0x2a'));_0x344abf['query']=_['keys'](_0xbf0c6a[_0xcef4('0x33')]);_0x344abf[_0xcef4('0x34')]=_['intersection'](_0x344abf[_0xcef4('0x31')],_0x344abf[_0xcef4('0x33')]);_0x3b242e[_0xcef4('0x35')]=_[_0xcef4('0x36')](_0x344abf[_0xcef4('0x31')],qs[_0xcef4('0x37')](_0xbf0c6a[_0xcef4('0x33')][_0xcef4('0x37')]));_0x3b242e[_0xcef4('0x35')]=_0x3b242e[_0xcef4('0x35')][_0xcef4('0x38')]?_0x3b242e[_0xcef4('0x35')]:_0x344abf['model'];if(!_0xbf0c6a['query'][_0xcef4('0x39')](_0xcef4('0x3a'))){_0x3b242e[_0xcef4('0x3b')]=qs[_0xcef4('0x3b')](_0xbf0c6a[_0xcef4('0x33')][_0xcef4('0x3b')]);_0x3b242e[_0xcef4('0x1e')]=qs[_0xcef4('0x1e')](_0xbf0c6a[_0xcef4('0x33')][_0xcef4('0x1e')]);}_0x3b242e[_0xcef4('0x3c')]=qs['sort'](_0xbf0c6a['query'][_0xcef4('0x3d')]);_0x3b242e['where']=qs['filters'](_[_0xcef4('0x3e')](_0xbf0c6a[_0xcef4('0x33')],_0x344abf[_0xcef4('0x34')]));if(_0xbf0c6a['query'][_0xcef4('0x3f')]){_0x3b242e['where']=_[_0xcef4('0x40')](_0x3b242e['where'],{'$or':_[_0xcef4('0x32')](_0x2c9472,function(_0xc0d49f){if(_0xc0d49f['type']!==_0xcef4('0x41')){var _0x446ded={};_0x446ded[_0xc0d49f[_0xcef4('0x2a')]]={'$like':'%'+_0xbf0c6a[_0xcef4('0x33')][_0xcef4('0x3f')]+'%'};return _0x446ded;}})});}_0x3b242e=_[_0xcef4('0x40')]({},_0x3b242e,_0xbf0c6a[_0xcef4('0x42')]);var _0x548003={'where':_0x3b242e['where']};return db[_0xcef4('0x2d')][_0xcef4('0x1d')](_0x548003)[_0xcef4('0x24')](function(_0x493cdd){_0x4cecc0[_0xcef4('0x1d')]=_0x493cdd;if(_0xbf0c6a[_0xcef4('0x33')][_0xcef4('0x43')]){_0x3b242e['include']=[{'all':!![]}];}return db['Tag'][_0xcef4('0x44')](_0x3b242e);})['then'](function(_0x277680){_0x4cecc0['rows']=_0x277680;return _0x4cecc0;})[_0xcef4('0x24')](respondWithFilteredResult(_0x4c32bd,_0x3b242e))['catch'](handleError(_0x4c32bd,null));};exports[_0xcef4('0x45')]=function(_0x2648a0,_0x1f17d5){var _0x3fed02={'raw':!![],'where':{'id':_0x2648a0['params']['id']}},_0xc746fc={};_0xc746fc[_0xcef4('0x31')]=_[_0xcef4('0x46')](db[_0xcef4('0x2d')][_0xcef4('0x2e')]);_0xc746fc[_0xcef4('0x33')]=_[_0xcef4('0x46')](_0x2648a0[_0xcef4('0x33')]);_0xc746fc[_0xcef4('0x34')]=_[_0xcef4('0x36')](_0xc746fc[_0xcef4('0x31')],_0xc746fc[_0xcef4('0x33')]);_0x3fed02[_0xcef4('0x35')]=_[_0xcef4('0x36')](_0xc746fc['model'],qs[_0xcef4('0x37')](_0x2648a0[_0xcef4('0x33')][_0xcef4('0x37')]));_0x3fed02[_0xcef4('0x35')]=_0x3fed02[_0xcef4('0x35')]['length']?_0x3fed02[_0xcef4('0x35')]:_0xc746fc[_0xcef4('0x31')];if(_0x2648a0[_0xcef4('0x33')]['includeAll']){_0x3fed02[_0xcef4('0x47')]=[{'all':!![]}];}_0x3fed02=_[_0xcef4('0x40')]({},_0x3fed02,_0x2648a0[_0xcef4('0x42')]);return db['Tag'][_0xcef4('0x48')](_0x3fed02)[_0xcef4('0x24')](handleEntityNotFound(_0x1f17d5,null))['then'](respondWithResult(_0x1f17d5,null))['catch'](handleError(_0x1f17d5,null));};exports[_0xcef4('0x49')]=function(_0x3c781a,_0x21e0fa){return db[_0xcef4('0x2d')][_0xcef4('0x49')](_0x3c781a[_0xcef4('0x4a')],{})[_0xcef4('0x24')](function(_0x304ed6){var _0x4c58f0=_0x3c781a[_0xcef4('0x4b')][_0xcef4('0x25')]({'plain':!![]});if(!_0x4c58f0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4c58f0[_0xcef4('0x4c')]==='user'){var _0x2c0fe8=_0x304ed6[_0xcef4('0x25')]({'plain':!![]});var _0x4bbb81=_0xcef4('0x4d');return db[_0xcef4('0x4e')][_0xcef4('0x48')]({'where':{'name':_0x4bbb81,'userProfileId':_0x4c58f0[_0xcef4('0x4f')]},'raw':!![]})['then'](function(_0x45fd05){if(_0x45fd05&&_0x45fd05[_0xcef4('0x50')]===0x0){return db[_0xcef4('0x26')][_0xcef4('0x49')]({'name':_0x2c0fe8[_0xcef4('0x2a')],'resourceId':_0x2c0fe8['id'],'type':_0x45fd05[_0xcef4('0x2a')],'sectionId':_0x45fd05['id']},{})[_0xcef4('0x24')](function(){return _0x304ed6;});}else{return _0x304ed6;}})['catch'](function(_0x4af234){logger[_0xcef4('0x28')](_0xcef4('0x51'),_0x4af234);throw _0x4af234;});}return _0x304ed6;})[_0xcef4('0x24')](respondWithResult(_0x21e0fa,0xc9))[_0xcef4('0x52')](handleError(_0x21e0fa,null));};exports['update']=function(_0x5abe88,_0x11ec3a){if(_0x5abe88[_0xcef4('0x4a')]['id']){delete _0x5abe88[_0xcef4('0x4a')]['id'];}return db[_0xcef4('0x2d')][_0xcef4('0x48')]({'where':{'id':_0x5abe88[_0xcef4('0x53')]['id']}})[_0xcef4('0x24')](handleEntityNotFound(_0x11ec3a,null))[_0xcef4('0x24')](saveUpdates(_0x5abe88[_0xcef4('0x4a')],null))[_0xcef4('0x24')](respondWithResult(_0x11ec3a,null))[_0xcef4('0x52')](handleError(_0x11ec3a,null));};exports[_0xcef4('0x27')]=function(_0x144669,_0x26f799){return db[_0xcef4('0x2d')][_0xcef4('0x48')]({'where':{'id':_0x144669[_0xcef4('0x53')]['id']}})[_0xcef4('0x24')](handleEntityNotFound(_0x26f799,null))['then'](removeEntity(_0x26f799,null))[_0xcef4('0x52')](handleError(_0x26f799,null));}; \ No newline at end of file +var _0xcea3=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','then','Tags','UserProfileResource','destroy','error','stack','name','index','map','Tag','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','catch','show','params','keys','includeAll','include','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf'];(function(_0x2fb7bf,_0x595999){var _0x595a34=function(_0x2c5030){while(--_0x2c5030){_0x2fb7bf['push'](_0x2fb7bf['shift']());}};_0x595a34(++_0x595999);}(_0xcea3,0x14d));var _0x3cea=function(_0x5ec6df,_0x5e624f){_0x5ec6df=_0x5ec6df-0x0;var _0xddebc0=_0xcea3[_0x5ec6df];return _0xddebc0;};'use strict';var pdf=require(_0x3cea('0x0'));var emlformat=require(_0x3cea('0x1'));var rimraf=require(_0x3cea('0x2'));var zipdir=require(_0x3cea('0x3'));var jsonpatch=require(_0x3cea('0x4'));var rp=require(_0x3cea('0x5'));var moment=require(_0x3cea('0x6'));var BPromise=require(_0x3cea('0x7'));var Mustache=require('mustache');var util=require(_0x3cea('0x8'));var path=require(_0x3cea('0x9'));var sox=require('sox');var csv=require(_0x3cea('0xa'));var ejs=require(_0x3cea('0xb'));var fs=require('fs');var _=require(_0x3cea('0xc'));var squel=require(_0x3cea('0xd'));var crypto=require(_0x3cea('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3cea('0xf'));var toCsv=require(_0x3cea('0xa'));var querystring=require(_0x3cea('0x10'));var Papa=require(_0x3cea('0x11'));var Redis=require(_0x3cea('0x12'));var authService=require(_0x3cea('0x13'));var qs=require(_0x3cea('0x14'));var as=require(_0x3cea('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3cea('0x16'))('api');var utils=require(_0x3cea('0x17'));var config=require(_0x3cea('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55d7e1,_0x43afbd){_0x43afbd=_0x43afbd||0xcc;return function(_0x482f05){if(_0x482f05){return _0x55d7e1[_0x3cea('0x19')](_0x43afbd);}return _0x55d7e1[_0x3cea('0x1a')](_0x43afbd)[_0x3cea('0x1b')]();};}function respondWithResult(_0x42214d,_0x1ad4ef){_0x1ad4ef=_0x1ad4ef||0xc8;return function(_0x4fcd3b){if(_0x4fcd3b){return _0x42214d['status'](_0x1ad4ef)['json'](_0x4fcd3b);}};}function respondWithFilteredResult(_0x26e921,_0x56c97f){return function(_0xe75964){if(_0xe75964){var _0x278c3e=_0xe75964[_0x3cea('0x1c')],_0x3d31b2=_0x56c97f[_0x3cea('0x1d')],_0x270df6=_0x56c97f[_0x3cea('0x1d')]+_0x56c97f[_0x3cea('0x1e')],_0x44140c;if(_0x270df6>=_0x278c3e){_0x270df6=_0x278c3e;_0x44140c=0xc8;}else{_0x44140c=0xce;}_0x26e921[_0x3cea('0x1a')](_0x44140c);return _0x26e921[_0x3cea('0x1f')](_0x3cea('0x20'),_0x3d31b2+'-'+_0x270df6+'/'+_0x278c3e)[_0x3cea('0x21')](_0xe75964);}return null;};}function patchUpdates(_0x2663f5){return function(_0x3ea943){try{jsonpatch[_0x3cea('0x22')](_0x3ea943,_0x2663f5,!![]);}catch(_0x11d36e){return BPromise['reject'](_0x11d36e);}return _0x3ea943[_0x3cea('0x23')]();};}function saveUpdates(_0xadb4f,_0x1565ab){return function(_0x2bac1){if(_0x2bac1){return _0x2bac1[_0x3cea('0x24')](_0xadb4f)[_0x3cea('0x25')](function(_0x335ded){return _0x335ded;});}return null;};}function removeEntity(_0x4a1405,_0x2f7a81){return function(_0x2eca19){if(_0x2eca19){return _0x2eca19['destroy']()[_0x3cea('0x25')](function(){var _0x3b55ac=_0x2eca19['get']({'plain':!![]});var _0x579a82=_0x3cea('0x26');return db[_0x3cea('0x27')][_0x3cea('0x28')]({'where':{'type':_0x579a82,'resourceId':_0x3b55ac['id']}})[_0x3cea('0x25')](function(){return _0x2eca19;});})[_0x3cea('0x25')](function(){_0x4a1405['status'](0xcc)[_0x3cea('0x1b')]();});}};}function handleEntityNotFound(_0x48bbdd,_0x2b52a6){return function(_0x4c44d2){if(!_0x4c44d2){_0x48bbdd[_0x3cea('0x19')](0x194);}return _0x4c44d2;};}function handleError(_0x89fbb,_0x11c3eb){_0x11c3eb=_0x11c3eb||0x1f4;return function(_0x430a19){logger[_0x3cea('0x29')](_0x430a19[_0x3cea('0x2a')]);if(_0x430a19[_0x3cea('0x2b')]){delete _0x430a19[_0x3cea('0x2b')];}_0x89fbb[_0x3cea('0x1a')](_0x11c3eb)['send'](_0x430a19);};}exports[_0x3cea('0x2c')]=function(_0x50eb70,_0xad338f){var _0x5078fe={},_0x325df6={},_0x5c707b={'count':0x0,'rows':[]};var _0x1edd9c=_[_0x3cea('0x2d')](db[_0x3cea('0x2e')][_0x3cea('0x2f')],function(_0x51e938){return{'name':_0x51e938[_0x3cea('0x30')],'type':_0x51e938[_0x3cea('0x31')][_0x3cea('0x32')]};});_0x325df6[_0x3cea('0x33')]=_['map'](_0x1edd9c,'name');_0x325df6[_0x3cea('0x34')]=_['keys'](_0x50eb70[_0x3cea('0x34')]);_0x325df6[_0x3cea('0x35')]=_[_0x3cea('0x36')](_0x325df6[_0x3cea('0x33')],_0x325df6[_0x3cea('0x34')]);_0x5078fe['attributes']=_[_0x3cea('0x36')](_0x325df6[_0x3cea('0x33')],qs['fields'](_0x50eb70[_0x3cea('0x34')][_0x3cea('0x37')]));_0x5078fe[_0x3cea('0x38')]=_0x5078fe[_0x3cea('0x38')][_0x3cea('0x39')]?_0x5078fe[_0x3cea('0x38')]:_0x325df6[_0x3cea('0x33')];if(!_0x50eb70[_0x3cea('0x34')][_0x3cea('0x3a')](_0x3cea('0x3b'))){_0x5078fe[_0x3cea('0x1e')]=qs[_0x3cea('0x1e')](_0x50eb70['query'][_0x3cea('0x1e')]);_0x5078fe[_0x3cea('0x1d')]=qs['offset'](_0x50eb70[_0x3cea('0x34')][_0x3cea('0x1d')]);}_0x5078fe[_0x3cea('0x3c')]=qs['sort'](_0x50eb70[_0x3cea('0x34')][_0x3cea('0x3d')]);_0x5078fe[_0x3cea('0x3e')]=qs[_0x3cea('0x35')](_['pick'](_0x50eb70[_0x3cea('0x34')],_0x325df6[_0x3cea('0x35')]));if(_0x50eb70[_0x3cea('0x34')][_0x3cea('0x3f')]){_0x5078fe[_0x3cea('0x3e')]=_[_0x3cea('0x40')](_0x5078fe[_0x3cea('0x3e')],{'$or':_[_0x3cea('0x2d')](_0x1edd9c,function(_0x1fab36){if(_0x1fab36[_0x3cea('0x31')]!=='VIRTUAL'){var _0x55c335={};_0x55c335[_0x1fab36[_0x3cea('0x2b')]]={'$like':'%'+_0x50eb70[_0x3cea('0x34')][_0x3cea('0x3f')]+'%'};return _0x55c335;}})});}_0x5078fe=_[_0x3cea('0x40')]({},_0x5078fe,_0x50eb70[_0x3cea('0x41')]);var _0x35dfc0={'where':_0x5078fe['where']};return db[_0x3cea('0x2e')]['count'](_0x35dfc0)[_0x3cea('0x25')](function(_0x52453a){_0x5c707b[_0x3cea('0x1c')]=_0x52453a;if(_0x50eb70['query']['includeAll']){_0x5078fe['include']=[{'all':!![]}];}return db[_0x3cea('0x2e')][_0x3cea('0x42')](_0x5078fe);})[_0x3cea('0x25')](function(_0x47ae3c){_0x5c707b['rows']=_0x47ae3c;return _0x5c707b;})[_0x3cea('0x25')](respondWithFilteredResult(_0xad338f,_0x5078fe))[_0x3cea('0x43')](handleError(_0xad338f,null));};exports[_0x3cea('0x44')]=function(_0x2d685d,_0x5180dd){var _0x45c8ba={'raw':!![],'where':{'id':_0x2d685d[_0x3cea('0x45')]['id']}},_0x3e46bc={};_0x3e46bc[_0x3cea('0x33')]=_['keys'](db[_0x3cea('0x2e')][_0x3cea('0x2f')]);_0x3e46bc[_0x3cea('0x34')]=_[_0x3cea('0x46')](_0x2d685d[_0x3cea('0x34')]);_0x3e46bc['filters']=_['intersection'](_0x3e46bc['model'],_0x3e46bc[_0x3cea('0x34')]);_0x45c8ba['attributes']=_[_0x3cea('0x36')](_0x3e46bc[_0x3cea('0x33')],qs[_0x3cea('0x37')](_0x2d685d[_0x3cea('0x34')][_0x3cea('0x37')]));_0x45c8ba[_0x3cea('0x38')]=_0x45c8ba['attributes']['length']?_0x45c8ba[_0x3cea('0x38')]:_0x3e46bc[_0x3cea('0x33')];if(_0x2d685d[_0x3cea('0x34')][_0x3cea('0x47')]){_0x45c8ba[_0x3cea('0x48')]=[{'all':!![]}];}_0x45c8ba=_['merge']({},_0x45c8ba,_0x2d685d[_0x3cea('0x41')]);return db[_0x3cea('0x2e')][_0x3cea('0x49')](_0x45c8ba)[_0x3cea('0x25')](handleEntityNotFound(_0x5180dd,null))[_0x3cea('0x25')](respondWithResult(_0x5180dd,null))[_0x3cea('0x43')](handleError(_0x5180dd,null));};exports[_0x3cea('0x4a')]=function(_0x3be143,_0x682a58){return db['Tag']['create'](_0x3be143['body'],{})[_0x3cea('0x25')](function(_0x42b703){var _0x2d0f1a=_0x3be143['user'][_0x3cea('0x4b')]({'plain':!![]});if(!_0x2d0f1a)throw new Error(_0x3cea('0x4c'));if(_0x2d0f1a[_0x3cea('0x4d')]===_0x3cea('0x4e')){var _0x221732=_0x42b703[_0x3cea('0x4b')]({'plain':!![]});var _0x44cf4c='Tags';return db[_0x3cea('0x4f')][_0x3cea('0x49')]({'where':{'name':_0x44cf4c,'userProfileId':_0x2d0f1a[_0x3cea('0x50')]},'raw':!![]})['then'](function(_0x2d7b95){if(_0x2d7b95&&_0x2d7b95[_0x3cea('0x51')]===0x0){return db[_0x3cea('0x27')][_0x3cea('0x4a')]({'name':_0x221732[_0x3cea('0x2b')],'resourceId':_0x221732['id'],'type':_0x2d7b95['name'],'sectionId':_0x2d7b95['id']},{})[_0x3cea('0x25')](function(){return _0x42b703;});}else{return _0x42b703;}})[_0x3cea('0x43')](function(_0x3ce412){logger[_0x3cea('0x29')](_0x3cea('0x52'),_0x3ce412);throw _0x3ce412;});}return _0x42b703;})['then'](respondWithResult(_0x682a58,0xc9))[_0x3cea('0x43')](handleError(_0x682a58,null));};exports[_0x3cea('0x24')]=function(_0xaefde8,_0x44aa0e){if(_0xaefde8['body']['id']){delete _0xaefde8[_0x3cea('0x53')]['id'];}return db[_0x3cea('0x2e')][_0x3cea('0x49')]({'where':{'id':_0xaefde8[_0x3cea('0x45')]['id']}})[_0x3cea('0x25')](handleEntityNotFound(_0x44aa0e,null))[_0x3cea('0x25')](saveUpdates(_0xaefde8[_0x3cea('0x53')],null))['then'](respondWithResult(_0x44aa0e,null))[_0x3cea('0x43')](handleError(_0x44aa0e,null));};exports[_0x3cea('0x28')]=function(_0x57156f,_0x4d0882){return db[_0x3cea('0x2e')][_0x3cea('0x49')]({'where':{'id':_0x57156f[_0x3cea('0x45')]['id']}})['then'](handleEntityNotFound(_0x4d0882,null))[_0x3cea('0x25')](removeEntity(_0x4d0882,null))[_0x3cea('0x43')](handleError(_0x4d0882,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 6123020..22cf0f4 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 _0x85eb=['api','bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','Tag','tools_tags','lodash','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x85eb,0x150));var _0xb85e=function(_0x2d7702,_0x26f163){_0x2d7702=_0x2d7702-0x0;var _0x354816=_0x85eb[_0x2d7702];return _0x354816;};'use strict';var _=require(_0xb85e('0x0'));var util=require('util');var logger=require(_0xb85e('0x1'))(_0xb85e('0x2'));var moment=require('moment');var BPromise=require(_0xb85e('0x3'));var rp=require(_0xb85e('0x4'));var fs=require('fs');var path=require(_0xb85e('0x5'));var rimraf=require(_0xb85e('0x6'));var config=require(_0xb85e('0x7'));var attributes=require(_0xb85e('0x8'));module[_0xb85e('0x9')]=function(_0x354212,_0x212a1b){return _0x354212[_0xb85e('0xa')](_0xb85e('0xb'),attributes,{'tableName':_0xb85e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0ddf=['../../config/environment','./tag.attributes','define','Tag','util','../../config/logger','api','moment','rimraf'];(function(_0x3e7e96,_0x5683ca){var _0x13f6f0=function(_0x320767){while(--_0x320767){_0x3e7e96['push'](_0x3e7e96['shift']());}};_0x13f6f0(++_0x5683ca);}(_0x0ddf,0x187));var _0xf0dd=function(_0x3940de,_0x38aeec){_0x3940de=_0x3940de-0x0;var _0x52bae8=_0x0ddf[_0x3940de];return _0x52bae8;};'use strict';var _=require('lodash');var util=require(_0xf0dd('0x0'));var logger=require(_0xf0dd('0x1'))(_0xf0dd('0x2'));var moment=require(_0xf0dd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf0dd('0x4'));var config=require(_0xf0dd('0x5'));var attributes=require(_0xf0dd('0x6'));module['exports']=function(_0x5c05ec,_0x4c3db2){return _0x5c05ec[_0xf0dd('0x7')](_0xf0dd('0x8'),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 a7dd9a8..ee961c7 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 _0x5b02=['client','then','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','Tag,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2f7e15,_0x6e0949){var _0xbf1bf1=function(_0x538ea3){while(--_0x538ea3){_0x2f7e15['push'](_0x2f7e15['shift']());}};_0xbf1bf1(++_0x6e0949);}(_0x5b02,0xe9));var _0x25b0=function(_0x46038f,_0x306265){_0x46038f=_0x46038f-0x0;var _0x295e17=_0x5b02[_0x46038f];return _0x295e17;};'use strict';var _=require(_0x25b0('0x0'));var util=require(_0x25b0('0x1'));var moment=require(_0x25b0('0x2'));var BPromise=require(_0x25b0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x25b0('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x25b0('0x5'))(_0x25b0('0x6'));var config=require(_0x25b0('0x7'));var jayson=require(_0x25b0('0x8'));var client=jayson[_0x25b0('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d82c6,_0xd8276d,_0x49ef3a){return new BPromise(function(_0x412954,_0x4d3e71){return client['request'](_0x1d82c6,_0x49ef3a)[_0x25b0('0xa')](function(_0x45429b){logger[_0x25b0('0xb')]('Tag,\x20%s,\x20%s',_0xd8276d,_0x25b0('0xc'));logger[_0x25b0('0xd')](_0x25b0('0xe'),_0xd8276d,_0x25b0('0xc'),JSON[_0x25b0('0xf')](_0x45429b));if(_0x45429b[_0x25b0('0x10')]){if(_0x45429b[_0x25b0('0x10')][_0x25b0('0x11')]===0x1f4){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x4d3e71(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);return _0x412954(_0x45429b[_0x25b0('0x10')][_0x25b0('0x13')]);}else{logger[_0x25b0('0xb')]('Tag,\x20%s,\x20%s',_0xd8276d,'request\x20sent');_0x412954(_0x45429b[_0x25b0('0x14')]['message']);}})[_0x25b0('0x15')](function(_0x1d009f){logger[_0x25b0('0x10')](_0x25b0('0x12'),_0xd8276d,_0x1d009f);_0x4d3e71(_0x1d009f);});});} \ No newline at end of file +var _0x1be1=['stringify','error','code','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','debug','Tag,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0x1be1,0x192));var _0x11be=function(_0x4217ee,_0x49f663){_0x4217ee=_0x4217ee-0x0;var _0x1e64be=_0x1be1[_0x4217ee];return _0x1e64be;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x11be('0x0'));var BPromise=require(_0x11be('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x11be('0x2'));var db=require(_0x11be('0x3'))['db'];var utils=require(_0x11be('0x4'));var logger=require(_0x11be('0x5'))('rpc');var config=require(_0x11be('0x6'));var jayson=require(_0x11be('0x7'));var client=jayson[_0x11be('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xfe8c62,_0x497730,_0x18f661){return new BPromise(function(_0x11fc15,_0x246772){return client[_0x11be('0x9')](_0xfe8c62,_0x18f661)[_0x11be('0xa')](function(_0x5f3d04){logger[_0x11be('0xb')](_0x11be('0xc'),_0x497730,'request\x20sent');logger[_0x11be('0xd')](_0x11be('0xe'),_0x497730,_0x11be('0xf'),JSON[_0x11be('0x10')](_0x5f3d04));if(_0x5f3d04['error']){if(_0x5f3d04[_0x11be('0x11')][_0x11be('0x12')]===0x1f4){logger[_0x11be('0x11')]('Tag,\x20%s,\x20%s',_0x497730,_0x5f3d04[_0x11be('0x11')][_0x11be('0x13')]);return _0x246772(_0x5f3d04['error'][_0x11be('0x13')]);}logger['error']('Tag,\x20%s,\x20%s',_0x497730,_0x5f3d04['error']['message']);return _0x11fc15(_0x5f3d04['error']['message']);}else{logger['info'](_0x11be('0xc'),_0x497730,'request\x20sent');_0x11fc15(_0x5f3d04[_0x11be('0x14')][_0x11be('0x13')]);}})[_0x11be('0x15')](function(_0x216b8c){logger['error'](_0x11be('0xc'),_0x497730,_0x216b8c);_0x246772(_0x216b8c);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 568716f..8e1b5be 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 _0x7e9a=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','getQueues','getAgents','post','create','/:id/queues','addQueues','/:id/users','addAgents','put','delete','removeQueues','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x3bded3,_0x50a616){var _0x250846=function(_0x5ac220){while(--_0x5ac220){_0x3bded3['push'](_0x3bded3['shift']());}};_0x250846(++_0x50a616);}(_0x7e9a,0x132));var _0xa7e9=function(_0x8e08be,_0xa800f2){_0x8e08be=_0x8e08be-0x0;var _0x3c3ef4=_0x7e9a[_0x8e08be];return _0x3c3ef4;};'use strict';var multer=require(_0xa7e9('0x0'));var util=require(_0xa7e9('0x1'));var path=require(_0xa7e9('0x2'));var timeout=require(_0xa7e9('0x3'));var express=require(_0xa7e9('0x4'));var router=express[_0xa7e9('0x5')]();var auth=require(_0xa7e9('0x6'));var interaction=require(_0xa7e9('0x7'));var config=require(_0xa7e9('0x8'));var controller=require('./team.controller');router[_0xa7e9('0x9')]('/',auth['isAuthenticated'](),controller[_0xa7e9('0xa')]);router[_0xa7e9('0x9')](_0xa7e9('0xb'),auth[_0xa7e9('0xc')](),controller[_0xa7e9('0xd')]);router[_0xa7e9('0x9')]('/:id/queues',auth['isAuthenticated'](),controller[_0xa7e9('0xe')]);router[_0xa7e9('0x9')]('/:id/users',auth[_0xa7e9('0xc')](),controller[_0xa7e9('0xf')]);router[_0xa7e9('0x10')]('/',auth['isAuthenticated'](),controller[_0xa7e9('0x11')]);router[_0xa7e9('0x10')](_0xa7e9('0x12'),auth['isAuthenticated'](),controller[_0xa7e9('0x13')]);router['post'](_0xa7e9('0x14'),auth[_0xa7e9('0xc')](),controller[_0xa7e9('0x15')]);router[_0xa7e9('0x16')](_0xa7e9('0xb'),auth[_0xa7e9('0xc')](),controller['update']);router['delete'](_0xa7e9('0xb'),auth[_0xa7e9('0xc')](),controller['destroy']);router[_0xa7e9('0x17')](_0xa7e9('0x12'),auth['isAuthenticated'](),controller[_0xa7e9('0x18')]);router[_0xa7e9('0x17')](_0xa7e9('0x14'),auth[_0xa7e9('0xc')](),controller['removeAgents']);module[_0xa7e9('0x19')]=router; \ No newline at end of file +var _0x76d8=['addQueues','put','delete','destroy','removeQueues','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','/:id','show','/:id/queues','getQueues','/:id/users','getAgents','post','create'];(function(_0xa65d0,_0x5867d0){var _0x5a6f83=function(_0x2b38d3){while(--_0x2b38d3){_0xa65d0['push'](_0xa65d0['shift']());}};_0x5a6f83(++_0x5867d0);}(_0x76d8,0x16e));var _0x876d=function(_0x9e82c9,_0x3cbeba){_0x9e82c9=_0x9e82c9-0x0;var _0x4262ea=_0x76d8[_0x9e82c9];return _0x4262ea;};'use strict';var multer=require(_0x876d('0x0'));var util=require(_0x876d('0x1'));var path=require('path');var timeout=require(_0x876d('0x2'));var express=require(_0x876d('0x3'));var router=express[_0x876d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x876d('0x5'));var config=require(_0x876d('0x6'));var controller=require(_0x876d('0x7'));router[_0x876d('0x8')]('/',auth[_0x876d('0x9')](),controller['index']);router[_0x876d('0x8')](_0x876d('0xa'),auth['isAuthenticated'](),controller[_0x876d('0xb')]);router['get'](_0x876d('0xc'),auth[_0x876d('0x9')](),controller[_0x876d('0xd')]);router['get'](_0x876d('0xe'),auth[_0x876d('0x9')](),controller[_0x876d('0xf')]);router[_0x876d('0x10')]('/',auth['isAuthenticated'](),controller[_0x876d('0x11')]);router[_0x876d('0x10')](_0x876d('0xc'),auth['isAuthenticated'](),controller[_0x876d('0x12')]);router[_0x876d('0x10')](_0x876d('0xe'),auth['isAuthenticated'](),controller['addAgents']);router[_0x876d('0x13')](_0x876d('0xa'),auth[_0x876d('0x9')](),controller['update']);router[_0x876d('0x14')]('/:id',auth[_0x876d('0x9')](),controller[_0x876d('0x15')]);router[_0x876d('0x14')](_0x876d('0xc'),auth[_0x876d('0x9')](),controller[_0x876d('0x16')]);router[_0x876d('0x14')](_0x876d('0xe'),auth[_0x876d('0x9')](),controller['removeAgents']);module[_0x876d('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 a3b050a..4ecb061 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 _0x1017=['name','sequelize','STRING'];(function(_0x4800c4,_0xc4add9){var _0x3e0230=function(_0x5175c7){while(--_0x5175c7){_0x4800c4['push'](_0x4800c4['shift']());}};_0x3e0230(++_0xc4add9);}(_0x1017,0x1c0));var _0x7101=function(_0x17c158,_0x10d250){_0x17c158=_0x17c158-0x0;var _0x527699=_0x1017[_0x17c158];return _0x527699;};'use strict';var Sequelize=require(_0x7101('0x0'));module['exports']={'name':{'type':Sequelize[_0x7101('0x1')],'allowNull':![],'unique':_0x7101('0x2')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd490=['exports','STRING','name','sequelize'];(function(_0x222db7,_0x24eda1){var _0x168109=function(_0xc16666){while(--_0xc16666){_0x222db7['push'](_0x222db7['shift']());}};_0x168109(++_0x24eda1);}(_0xd490,0x14f));var _0x0d49=function(_0x3fa8a2,_0x543aaa){_0x3fa8a2=_0x3fa8a2-0x0;var _0x34cf5b=_0xd490[_0x3fa8a2];return _0x34cf5b;};'use strict';var Sequelize=require(_0x0d49('0x0'));module[_0x0d49('0x1')]={'name':{'type':Sequelize[_0x0d49('0x2')],'allowNull':![],'unique':_0x0d49('0x3')},'description':{'type':Sequelize[_0x0d49('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index ca27662..087a30b 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 _0xc692=['apply','reject','update','then','destroy','get','Teams','UserProfileResource','error','stack','name','send','index','map','Team','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError','Unknown\x20channel','toLowerCase','capitalize','Queues','addQueues','add','removeQueues','remove','ids','addAgents','Voice','Chat','Mail','Sms','Fax','Openchannel','each','User','online','voicePause','upsert','isNil','format','SIP/%s','interface','omit','spread','emit','userTeam:save','removeAgents','voice','chat','sms','openchannel','UserVoiceQueueRt','isArray','userTeam:remove','getAgents','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./team.socket','register','sendStatus','status','count','offset','limit','set','Content-Range','json'];(function(_0x48c496,_0x45bde7){var _0x5c2db9=function(_0x3efc85){while(--_0x3efc85){_0x48c496['push'](_0x48c496['shift']());}};_0x5c2db9(++_0x45bde7);}(_0xc692,0x15f));var _0x2c69=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0xc692[_0x55f8b4];return _0x2475f9;};'use strict';var pdf=require(_0x2c69('0x0'));var emlformat=require(_0x2c69('0x1'));var rimraf=require(_0x2c69('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2c69('0x3'));var moment=require(_0x2c69('0x4'));var BPromise=require(_0x2c69('0x5'));var Mustache=require(_0x2c69('0x6'));var util=require(_0x2c69('0x7'));var path=require(_0x2c69('0x8'));var sox=require(_0x2c69('0x9'));var csv=require('to-csv');var ejs=require(_0x2c69('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x2c69('0xb'));var jsforce=require(_0x2c69('0xc'));var deskjs=require(_0x2c69('0xd'));var toCsv=require(_0x2c69('0xe'));var querystring=require(_0x2c69('0xf'));var Papa=require(_0x2c69('0x10'));var Redis=require('ioredis');var authService=require(_0x2c69('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x2c69('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x2c69('0x13'))(_0x2c69('0x14'));var utils=require(_0x2c69('0x15'));var config=require(_0x2c69('0x16'));var db=require(_0x2c69('0x17'))['db'];config[_0x2c69('0x18')]=_['defaults'](config[_0x2c69('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x2c69('0x19'))(new Redis(config[_0x2c69('0x18')]));require(_0x2c69('0x1a'))[_0x2c69('0x1b')](socket);function respondWithStatusCode(_0x37a24d,_0x211496){_0x211496=_0x211496||0xcc;return function(_0x5747d8){if(_0x5747d8){return _0x37a24d[_0x2c69('0x1c')](_0x211496);}return _0x37a24d['status'](_0x211496)['end']();};}function respondWithResult(_0x2b9bdd,_0x4cabe5){_0x4cabe5=_0x4cabe5||0xc8;return function(_0x11649b){if(_0x11649b){return _0x2b9bdd[_0x2c69('0x1d')](_0x4cabe5)['json'](_0x11649b);}};}function respondWithFilteredResult(_0x5bb8ee,_0x3bd4a3){return function(_0x35d604){if(_0x35d604){var _0xa1c51=_0x35d604[_0x2c69('0x1e')],_0x5b4ca0=_0x3bd4a3[_0x2c69('0x1f')],_0x57fe09=_0x3bd4a3['offset']+_0x3bd4a3[_0x2c69('0x20')],_0x4e597d;if(_0x57fe09>=_0xa1c51){_0x57fe09=_0xa1c51;_0x4e597d=0xc8;}else{_0x4e597d=0xce;}_0x5bb8ee['status'](_0x4e597d);return _0x5bb8ee[_0x2c69('0x21')](_0x2c69('0x22'),_0x5b4ca0+'-'+_0x57fe09+'/'+_0xa1c51)[_0x2c69('0x23')](_0x35d604);}return null;};}function patchUpdates(_0x10807e){return function(_0x578978){try{jsonpatch[_0x2c69('0x24')](_0x578978,_0x10807e,!![]);}catch(_0x2ec1cd){return BPromise[_0x2c69('0x25')](_0x2ec1cd);}return _0x578978['save']();};}function saveUpdates(_0x415c4b,_0x5775fa){return function(_0x528683){if(_0x528683){return _0x528683[_0x2c69('0x26')](_0x415c4b)[_0x2c69('0x27')](function(_0x3d72db){return _0x3d72db;});}return null;};}function removeEntity(_0x4c8402,_0x58f00f){return function(_0x3fb15c){if(_0x3fb15c){return _0x3fb15c[_0x2c69('0x28')]()[_0x2c69('0x27')](function(){var _0x3784dd=_0x3fb15c[_0x2c69('0x29')]({'plain':!![]});var _0x2edc86=_0x2c69('0x2a');return db[_0x2c69('0x2b')][_0x2c69('0x28')]({'where':{'type':_0x2edc86,'resourceId':_0x3784dd['id']}})['then'](function(){return _0x3fb15c;});})[_0x2c69('0x27')](function(){_0x4c8402[_0x2c69('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1b29b8,_0xd85b20){return function(_0x2238a9){if(!_0x2238a9){_0x1b29b8['sendStatus'](0x194);}return _0x2238a9;};}function handleError(_0x321f95,_0xfe88bf){_0xfe88bf=_0xfe88bf||0x1f4;return function(_0x4fa8eb){logger[_0x2c69('0x2c')](_0x4fa8eb[_0x2c69('0x2d')]);if(_0x4fa8eb[_0x2c69('0x2e')]){delete _0x4fa8eb[_0x2c69('0x2e')];}_0x321f95['status'](_0xfe88bf)[_0x2c69('0x2f')](_0x4fa8eb);};}exports[_0x2c69('0x30')]=function(_0x47a853,_0x5c56a9){var _0x4ada2a={},_0x41d912={},_0x5cd649={'count':0x0,'rows':[]};var _0x54ce35=_[_0x2c69('0x31')](db[_0x2c69('0x32')][_0x2c69('0x33')],function(_0x22be4b){return{'name':_0x22be4b[_0x2c69('0x34')],'type':_0x22be4b['type'][_0x2c69('0x35')]};});_0x41d912[_0x2c69('0x36')]=_[_0x2c69('0x31')](_0x54ce35,_0x2c69('0x2e'));_0x41d912['query']=_[_0x2c69('0x37')](_0x47a853[_0x2c69('0x38')]);_0x41d912[_0x2c69('0x39')]=_[_0x2c69('0x3a')](_0x41d912[_0x2c69('0x36')],_0x41d912['query']);_0x4ada2a[_0x2c69('0x3b')]=_[_0x2c69('0x3a')](_0x41d912[_0x2c69('0x36')],qs[_0x2c69('0x3c')](_0x47a853[_0x2c69('0x38')][_0x2c69('0x3c')]));_0x4ada2a['attributes']=_0x4ada2a['attributes'][_0x2c69('0x3d')]?_0x4ada2a[_0x2c69('0x3b')]:_0x41d912[_0x2c69('0x36')];if(!_0x47a853['query'][_0x2c69('0x3e')](_0x2c69('0x3f'))){_0x4ada2a[_0x2c69('0x20')]=qs['limit'](_0x47a853[_0x2c69('0x38')][_0x2c69('0x20')]);_0x4ada2a[_0x2c69('0x1f')]=qs[_0x2c69('0x1f')](_0x47a853[_0x2c69('0x38')]['offset']);}_0x4ada2a[_0x2c69('0x40')]=qs[_0x2c69('0x41')](_0x47a853[_0x2c69('0x38')][_0x2c69('0x41')]);_0x4ada2a[_0x2c69('0x42')]=qs['filters'](_[_0x2c69('0x43')](_0x47a853[_0x2c69('0x38')],_0x41d912[_0x2c69('0x39')]));if(_0x47a853[_0x2c69('0x38')][_0x2c69('0x44')]){_0x4ada2a[_0x2c69('0x42')]=_[_0x2c69('0x45')](_0x4ada2a[_0x2c69('0x42')],{'$or':_['map'](_0x54ce35,function(_0x260300){if(_0x260300['type']!=='VIRTUAL'){var _0x5a3fb3={};_0x5a3fb3[_0x260300[_0x2c69('0x2e')]]={'$like':'%'+_0x47a853[_0x2c69('0x38')]['filter']+'%'};return _0x5a3fb3;}})});}_0x4ada2a=_[_0x2c69('0x45')]({},_0x4ada2a,_0x47a853[_0x2c69('0x46')]);var _0x2b18bd={'where':_0x4ada2a['where']};return db['Team'][_0x2c69('0x1e')](_0x2b18bd)[_0x2c69('0x27')](function(_0x563a54){_0x5cd649['count']=_0x563a54;if(_0x47a853[_0x2c69('0x38')][_0x2c69('0x47')]){_0x4ada2a[_0x2c69('0x48')]=[{'all':!![]}];}return db['Team'][_0x2c69('0x49')](_0x4ada2a);})[_0x2c69('0x27')](function(_0x1bec7c){_0x5cd649['rows']=_0x1bec7c;return _0x5cd649;})[_0x2c69('0x27')](respondWithFilteredResult(_0x5c56a9,_0x4ada2a))[_0x2c69('0x4a')](handleError(_0x5c56a9,null));};exports['show']=function(_0x7176ee,_0x14cd5c){var _0x2068a0={'raw':![],'where':{'id':_0x7176ee[_0x2c69('0x4b')]['id']}},_0x4edb19={};_0x4edb19['model']=_[_0x2c69('0x37')](db['Team'][_0x2c69('0x33')]);_0x4edb19[_0x2c69('0x38')]=_['keys'](_0x7176ee[_0x2c69('0x38')]);_0x4edb19[_0x2c69('0x39')]=_[_0x2c69('0x3a')](_0x4edb19[_0x2c69('0x36')],_0x4edb19[_0x2c69('0x38')]);_0x2068a0[_0x2c69('0x3b')]=_['intersection'](_0x4edb19[_0x2c69('0x36')],qs['fields'](_0x7176ee[_0x2c69('0x38')][_0x2c69('0x3c')]));_0x2068a0[_0x2c69('0x3b')]=_0x2068a0[_0x2c69('0x3b')]['length']?_0x2068a0[_0x2c69('0x3b')]:_0x4edb19[_0x2c69('0x36')];if(_0x7176ee['query']['includeAll']){_0x2068a0[_0x2c69('0x48')]=[{'all':!![]}];}_0x2068a0=_[_0x2c69('0x45')]({},_0x2068a0,_0x7176ee[_0x2c69('0x46')]);return db[_0x2c69('0x32')][_0x2c69('0x4c')](_0x2068a0)['then'](handleEntityNotFound(_0x14cd5c,null))['then'](respondWithResult(_0x14cd5c,null))[_0x2c69('0x4a')](handleError(_0x14cd5c,null));};exports[_0x2c69('0x4d')]=function(_0x5d338d,_0xd09ecf){return db[_0x2c69('0x32')][_0x2c69('0x4d')](_0x5d338d[_0x2c69('0x4e')],{})[_0x2c69('0x27')](function(_0x15808a){var _0x3ca9ff=_0x5d338d[_0x2c69('0x4f')][_0x2c69('0x29')]({'plain':!![]});if(!_0x3ca9ff)throw new Error(_0x2c69('0x50'));if(_0x3ca9ff[_0x2c69('0x51')]===_0x2c69('0x4f')){var _0x40d1dd=_0x15808a[_0x2c69('0x29')]({'plain':!![]});var _0x2d3f94='Teams';return db[_0x2c69('0x52')][_0x2c69('0x4c')]({'where':{'name':_0x2d3f94,'userProfileId':_0x3ca9ff['userProfileId']},'raw':!![]})[_0x2c69('0x27')](function(_0x49e4fd){if(_0x49e4fd&&_0x49e4fd[_0x2c69('0x53')]===0x0){return db[_0x2c69('0x2b')]['create']({'name':_0x40d1dd[_0x2c69('0x2e')],'resourceId':_0x40d1dd['id'],'type':_0x49e4fd[_0x2c69('0x2e')],'sectionId':_0x49e4fd['id']},{})[_0x2c69('0x27')](function(){return _0x15808a;});}else{return _0x15808a;}})[_0x2c69('0x4a')](function(_0x18f344){logger[_0x2c69('0x2c')](_0x2c69('0x54'),_0x18f344);throw _0x18f344;});}return _0x15808a;})[_0x2c69('0x27')](respondWithResult(_0xd09ecf,0xc9))[_0x2c69('0x4a')](handleError(_0xd09ecf,null));};exports[_0x2c69('0x26')]=function(_0x5c375c,_0x1c50dd){if(_0x5c375c[_0x2c69('0x4e')]['id']){delete _0x5c375c[_0x2c69('0x4e')]['id'];}return db[_0x2c69('0x32')][_0x2c69('0x4c')]({'where':{'id':_0x5c375c[_0x2c69('0x4b')]['id']}})[_0x2c69('0x27')](handleEntityNotFound(_0x1c50dd,null))['then'](saveUpdates(_0x5c375c[_0x2c69('0x4e')],null))[_0x2c69('0x27')](respondWithResult(_0x1c50dd,null))['catch'](handleError(_0x1c50dd,null));};exports['destroy']=function(_0x5ca2c0,_0x40cf12){return db[_0x2c69('0x32')][_0x2c69('0x4c')]({'where':{'id':_0x5ca2c0['params']['id']}})['then'](handleEntityNotFound(_0x40cf12,null))[_0x2c69('0x27')](removeEntity(_0x40cf12,null))['catch'](handleError(_0x40cf12,null));};exports[_0x2c69('0x55')]=function(_0x2959b3,_0xf8348e,_0x1947d8){return db[_0x2c69('0x32')][_0x2c69('0x56')]({'where':{'id':_0x2959b3[_0x2c69('0x4b')]['id']}})[_0x2c69('0x27')](handleEntityNotFound(_0xf8348e,null))['then'](function(_0xfb795a){if(!_0x2959b3[_0x2c69('0x38')][_0x2c69('0x57')]||!utils[_0x2c69('0x58')](_0x2959b3['query'][_0x2c69('0x57')])){throw new db[(_0x2c69('0x59'))][(_0x2c69('0x5a'))](_0x2c69('0x5b'));}var _0x58d425={};var _0x1b122f={};_0x1b122f[_0x2c69('0x36')]=_[_0x2c69('0x37')](db[_['capitalize'](_0x2959b3[_0x2c69('0x38')][_0x2c69('0x57')][_0x2c69('0x5c')]())+'Queue'][_0x2c69('0x33')]);_0x1b122f[_0x2c69('0x38')]=_[_0x2c69('0x37')](_0x2959b3['query']);_0x1b122f[_0x2c69('0x39')]=_[_0x2c69('0x3a')](_0x1b122f[_0x2c69('0x36')],_0x1b122f[_0x2c69('0x38')]);_0x58d425['attributes']=_[_0x2c69('0x3a')](_0x1b122f['model'],qs[_0x2c69('0x3c')](_0x2959b3['query'][_0x2c69('0x3c')]));_0x58d425[_0x2c69('0x3b')]=_0x58d425['attributes'][_0x2c69('0x3d')]?_0x58d425[_0x2c69('0x3b')]:_0x1b122f[_0x2c69('0x36')];_0x58d425[_0x2c69('0x20')]=qs[_0x2c69('0x20')](_0x2959b3[_0x2c69('0x38')]['limit']);_0x58d425[_0x2c69('0x1f')]=qs[_0x2c69('0x1f')](_0x2959b3[_0x2c69('0x38')][_0x2c69('0x1f')]);_0x58d425['order']=qs['sort'](_0x2959b3[_0x2c69('0x38')][_0x2c69('0x41')]);_0x58d425[_0x2c69('0x42')]=qs[_0x2c69('0x39')](_[_0x2c69('0x43')](_0x2959b3[_0x2c69('0x38')],_0x1b122f[_0x2c69('0x39')]));_0x58d425=_[_0x2c69('0x45')]({},_0x58d425,_0x2959b3['options']);return _0xfb795a['get'+_[_0x2c69('0x5d')](_0x2959b3[_0x2c69('0x38')]['channel'][_0x2c69('0x5c')]())+_0x2c69('0x5e')](_0x58d425);})['then'](respondWithResult(_0xf8348e,null))['catch'](handleError(_0xf8348e,null));};exports[_0x2c69('0x5f')]=function(_0x45b3ad,_0x3447fd,_0x137497){return db[_0x2c69('0x32')][_0x2c69('0x56')]({'where':{'id':_0x45b3ad[_0x2c69('0x4b')]['id']}})['then'](function(_0x48b50e){if(_0x48b50e){if(!_0x45b3ad[_0x2c69('0x4e')][_0x2c69('0x57')]||!utils[_0x2c69('0x58')](_0x45b3ad[_0x2c69('0x4e')][_0x2c69('0x57')])){throw new db[(_0x2c69('0x59'))][(_0x2c69('0x5a'))]('Unknown\x20channel');}return _0x48b50e[_0x2c69('0x60')+_[_0x2c69('0x5d')](_0x45b3ad[_0x2c69('0x4e')][_0x2c69('0x57')][_0x2c69('0x5c')]())+_0x2c69('0x5e')](_0x45b3ad['body']['ids']);}return null;})['then'](handleEntityNotFound(_0x3447fd,null))[_0x2c69('0x27')](respondWithStatusCode(_0x3447fd,null))['catch'](handleError(_0x3447fd,null));};exports[_0x2c69('0x61')]=function(_0x25dc56,_0x2cf853,_0x8a86f6){return db[_0x2c69('0x32')]['findOne']({'where':{'id':_0x25dc56[_0x2c69('0x4b')]['id']}})[_0x2c69('0x27')](function(_0x18b4fc){if(_0x18b4fc){if(!_0x25dc56['query']['channel']||!utils[_0x2c69('0x58')](_0x25dc56[_0x2c69('0x38')]['channel'])){throw new db[(_0x2c69('0x59'))][(_0x2c69('0x5a'))](_0x2c69('0x5b'));}return _0x18b4fc[_0x2c69('0x62')+_[_0x2c69('0x5d')](_0x25dc56[_0x2c69('0x38')][_0x2c69('0x57')][_0x2c69('0x5c')]())+_0x2c69('0x5e')](_0x25dc56['query'][_0x2c69('0x63')]);}return null;})[_0x2c69('0x27')](handleEntityNotFound(_0x2cf853,null))[_0x2c69('0x27')](respondWithStatusCode(_0x2cf853,null))[_0x2c69('0x4a')](handleError(_0x2cf853,null));};exports[_0x2c69('0x64')]=function(_0x242ebd,_0x3e95ea,_0x3814de){return db[_0x2c69('0x32')]['find']({'where':{'id':_0x242ebd['params']['id']}})[_0x2c69('0x27')](handleEntityNotFound(_0x3e95ea,null))['then'](function(_0x48ec7c){if(_0x48ec7c){var _0x4060a9=[_0x2c69('0x65'),_0x2c69('0x66'),_0x2c69('0x67'),_0x2c69('0x68'),_0x2c69('0x69'),_0x2c69('0x6a')];return BPromise[_0x2c69('0x6b')](_0x4060a9,function(_0x4b0360){return _0x48ec7c[_0x2c69('0x29')+_0x4b0360+_0x2c69('0x5e')]({'attributes':['id','name']})['then'](function(_0x240797){return BPromise[_0x2c69('0x6b')](_0x240797,function(_0x37dfbb){return _0x37dfbb[_0x2c69('0x64')](_0x242ebd[_0x2c69('0x4e')]['ids'])[_0x2c69('0x27')](function(){if(_0x4b0360===_0x2c69('0x65')){return db[_0x2c69('0x6c')][_0x2c69('0x49')]({'where':{'id':_0x242ebd[_0x2c69('0x4e')][_0x2c69('0x63')]},'attributes':['id','name',_0x2c69('0x6d'),_0x2c69('0x6e'),'interface'],'raw':!![]})[_0x2c69('0x27')](function(_0x159839){return BPromise[_0x2c69('0x6b')](_[_0x2c69('0x44')](_0x159839,{'online':0x1}),function(_0x21536a){return db['UserVoiceQueueRt'][_0x2c69('0x6f')]({'membername':_0x21536a[_0x2c69('0x2e')],'UserId':_0x21536a['id'],'queue_name':_0x37dfbb[_0x2c69('0x2e')],'VoiceQueueId':_0x37dfbb['id'],'interface':_[_0x2c69('0x70')](_0x21536a['interface'])?util[_0x2c69('0x71')](_0x2c69('0x72'),_0x21536a[_0x2c69('0x2e')]):_0x21536a[_0x2c69('0x73')],'paused':_0x21536a[_0x2c69('0x6e')]||![],'penalty':0x0});});});}});});})['then'](function(){return _0x48ec7c;});})['then'](function(){return _0x48ec7c;});}})['then'](function(_0x287054){if(_0x287054){return _0x287054[_0x2c69('0x64')](_0x242ebd[_0x2c69('0x4e')][_0x2c69('0x63')],_[_0x2c69('0x74')](_0x242ebd['body'],[_0x2c69('0x63'),'id'])||{})[_0x2c69('0x75')](function(_0x2589c5){for(var _0x5415c4=0x0;_0x5415c4<_0x242ebd['body'][_0x2c69('0x63')]['length'];_0x5415c4+=0x1){socket[_0x2c69('0x76')](_0x2c69('0x77'),{'UserId':_0x242ebd[_0x2c69('0x4e')][_0x2c69('0x63')][_0x5415c4],'TeamId':_0x242ebd[_0x2c69('0x4b')]['id']});}return _0x2589c5;});}})[_0x2c69('0x27')](respondWithResult(_0x3e95ea,null))[_0x2c69('0x4a')](handleError(_0x3e95ea,null));};exports[_0x2c69('0x78')]=function(_0x4a12c0,_0x3f2fb5,_0x197c9b){return db[_0x2c69('0x32')]['find']({'where':{'id':_0x4a12c0['params']['id']}})[_0x2c69('0x27')](handleEntityNotFound(_0x3f2fb5,null))[_0x2c69('0x27')](function(_0x55d0ad){if(_0x55d0ad){return BPromise['each']([_0x2c69('0x79'),_0x2c69('0x7a'),'mail',_0x2c69('0x7b'),'fax',_0x2c69('0x7c')],function(_0x244056){return _0x55d0ad['get'+_[_0x2c69('0x5d')](_0x244056)+_0x2c69('0x5e')]({'attributes':['id',_0x2c69('0x2e')]})[_0x2c69('0x27')](function(_0x18e2b7){return BPromise['each'](_0x18e2b7,function(_0x30f431){return _0x30f431[_0x2c69('0x78')](_0x4a12c0[_0x2c69('0x38')]['ids'])[_0x2c69('0x27')](function(){if(_0x244056==='voice'){return db[_0x2c69('0x7d')]['destroy']({'where':{'VoiceQueueId':_0x30f431['id'],'UserId':_0x4a12c0[_0x2c69('0x38')][_0x2c69('0x63')]}});}});});})['then'](function(){return _0x55d0ad;});})['then'](function(){return _0x55d0ad;});}})['then'](function(_0x23cf55){if(_0x23cf55){return _0x23cf55['removeAgents'](_0x4a12c0[_0x2c69('0x38')][_0x2c69('0x63')])[_0x2c69('0x27')](function(){if(_[_0x2c69('0x7e')](_0x4a12c0[_0x2c69('0x38')][_0x2c69('0x63')])){for(var _0x32cc7a=0x0;_0x32cc7a<_0x4a12c0[_0x2c69('0x38')]['ids'][_0x2c69('0x3d')];_0x32cc7a+=0x1){socket[_0x2c69('0x76')]('userTeam:remove',{'UserId':Number(_0x4a12c0[_0x2c69('0x38')][_0x2c69('0x63')][_0x32cc7a]),'TeamId':Number(_0x4a12c0[_0x2c69('0x4b')]['id'])});}}else{socket[_0x2c69('0x76')](_0x2c69('0x7f'),{'UserId':Number(_0x4a12c0[_0x2c69('0x38')][_0x2c69('0x63')]),'TeamId':Number(_0x4a12c0[_0x2c69('0x4b')]['id'])});}});}})['then'](respondWithStatusCode(_0x3f2fb5,null))[_0x2c69('0x4a')](handleError(_0x3f2fb5,null));};exports[_0x2c69('0x80')]=function(_0x50514a,_0x701926,_0x1cd3eb){var _0x57fe4a={};var _0x582cde={};var _0x5c5c1e;var _0x20a452;return db[_0x2c69('0x32')][_0x2c69('0x56')]({'where':{'id':_0x50514a[_0x2c69('0x4b')]['id']}})[_0x2c69('0x27')](handleEntityNotFound(_0x701926,null))[_0x2c69('0x27')](function(_0x558ed8){if(_0x558ed8){_0x5c5c1e=_0x558ed8;_0x582cde[_0x2c69('0x36')]=_[_0x2c69('0x37')](db[_0x2c69('0x6c')]['rawAttributes']);_0x582cde[_0x2c69('0x38')]=_[_0x2c69('0x37')](_0x50514a[_0x2c69('0x38')]);_0x582cde[_0x2c69('0x39')]=_['intersection'](_0x582cde[_0x2c69('0x36')],_0x582cde['query']);_0x57fe4a[_0x2c69('0x3b')]=_[_0x2c69('0x3a')](_0x582cde['model'],qs[_0x2c69('0x3c')](_0x50514a[_0x2c69('0x38')]['fields']));_0x57fe4a[_0x2c69('0x3b')]=_0x57fe4a[_0x2c69('0x3b')][_0x2c69('0x3d')]?_0x57fe4a['attributes']:_0x582cde[_0x2c69('0x36')];_0x57fe4a[_0x2c69('0x40')]=qs[_0x2c69('0x41')](_0x50514a[_0x2c69('0x38')][_0x2c69('0x41')]);_0x57fe4a[_0x2c69('0x42')]=qs['filters'](_[_0x2c69('0x43')](_0x50514a[_0x2c69('0x38')],_0x582cde[_0x2c69('0x39')]));if(_0x50514a[_0x2c69('0x38')]['filter']){_0x57fe4a[_0x2c69('0x42')]=_[_0x2c69('0x45')](_0x57fe4a['where'],{'$or':_[_0x2c69('0x31')](_0x57fe4a['attributes'],function(_0x1ebafc){var _0x246d43={};_0x246d43[_0x1ebafc]={'$like':'%'+_0x50514a['query'][_0x2c69('0x44')]+'%'};return _0x246d43;})});}_0x57fe4a=_['merge']({},_0x57fe4a,_0x50514a['options']);return _0x5c5c1e['getAgents'](_0x57fe4a);}})[_0x2c69('0x27')](function(_0x135706){if(_0x135706){_0x20a452=_0x135706[_0x2c69('0x3d')];if(!_0x50514a[_0x2c69('0x38')][_0x2c69('0x3e')](_0x2c69('0x3f'))){_0x57fe4a[_0x2c69('0x20')]=qs[_0x2c69('0x20')](_0x50514a[_0x2c69('0x38')][_0x2c69('0x20')]);_0x57fe4a[_0x2c69('0x1f')]=qs[_0x2c69('0x1f')](_0x50514a[_0x2c69('0x38')][_0x2c69('0x1f')]);}return _0x5c5c1e[_0x2c69('0x80')](_0x57fe4a);}})[_0x2c69('0x27')](function(_0x49fa87){if(_0x49fa87){return _0x49fa87?{'count':_0x20a452,'rows':_0x49fa87}:null;}})[_0x2c69('0x27')](respondWithResult(_0x701926,null))[_0x2c69('0x4a')](handleError(_0x701926,null));}; \ No newline at end of file +var _0x6ac2=['openchannel','emit','userTeam:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','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','redis','defaults','localhost','socket.io-emitter','./team.socket','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','then','destroy','get','error','name','send','index','map','Team','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','options','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Teams','UserProfileSection','autoAssociation','create','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getQueues','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','sort','pick','Queues','addQueues','findOne','ValidationError','add','ids','removeQueues','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','each','User','interface','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','omit','spread','userTeam:save','removeAgents','voice','mail'];(function(_0x34204a,_0x325b1b){var _0x363165=function(_0x31abdc){while(--_0x31abdc){_0x34204a['push'](_0x34204a['shift']());}};_0x363165(++_0x325b1b);}(_0x6ac2,0x184));var _0x26ac=function(_0x5d5b7c,_0x556a66){_0x5d5b7c=_0x5d5b7c-0x0;var _0x398c88=_0x6ac2[_0x5d5b7c];return _0x398c88;};'use strict';var pdf=require(_0x26ac('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x26ac('0x1'));var zipdir=require(_0x26ac('0x2'));var jsonpatch=require(_0x26ac('0x3'));var rp=require(_0x26ac('0x4'));var moment=require(_0x26ac('0x5'));var BPromise=require(_0x26ac('0x6'));var Mustache=require('mustache');var util=require(_0x26ac('0x7'));var path=require('path');var sox=require(_0x26ac('0x8'));var csv=require(_0x26ac('0x9'));var ejs=require(_0x26ac('0xa'));var fs=require('fs');var _=require(_0x26ac('0xb'));var squel=require(_0x26ac('0xc'));var crypto=require(_0x26ac('0xd'));var jsforce=require(_0x26ac('0xe'));var deskjs=require(_0x26ac('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x26ac('0x10'));var Redis=require(_0x26ac('0x11'));var authService=require(_0x26ac('0x12'));var qs=require(_0x26ac('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x26ac('0x14'));var logger=require(_0x26ac('0x15'))(_0x26ac('0x16'));var utils=require(_0x26ac('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x26ac('0x18')]=_[_0x26ac('0x19')](config[_0x26ac('0x18')],{'host':_0x26ac('0x1a'),'port':0x18eb});var socket=require(_0x26ac('0x1b'))(new Redis(config[_0x26ac('0x18')]));require(_0x26ac('0x1c'))['register'](socket);function respondWithStatusCode(_0x2f68ad,_0x3ec6e6){_0x3ec6e6=_0x3ec6e6||0xcc;return function(_0x290cc8){if(_0x290cc8){return _0x2f68ad[_0x26ac('0x1d')](_0x3ec6e6);}return _0x2f68ad['status'](_0x3ec6e6)[_0x26ac('0x1e')]();};}function respondWithResult(_0x1ae5aa,_0x4b2d19){_0x4b2d19=_0x4b2d19||0xc8;return function(_0x3dca1f){if(_0x3dca1f){return _0x1ae5aa[_0x26ac('0x1f')](_0x4b2d19)[_0x26ac('0x20')](_0x3dca1f);}};}function respondWithFilteredResult(_0x3a0f1a,_0x5642b7){return function(_0xfb304b){if(_0xfb304b){var _0xb03bbc=_0xfb304b[_0x26ac('0x21')],_0x5cd737=_0x5642b7['offset'],_0x539eda=_0x5642b7[_0x26ac('0x22')]+_0x5642b7['limit'],_0x111613;if(_0x539eda>=_0xb03bbc){_0x539eda=_0xb03bbc;_0x111613=0xc8;}else{_0x111613=0xce;}_0x3a0f1a['status'](_0x111613);return _0x3a0f1a['set'](_0x26ac('0x23'),_0x5cd737+'-'+_0x539eda+'/'+_0xb03bbc)['json'](_0xfb304b);}return null;};}function patchUpdates(_0x1901b6){return function(_0x31c08f){try{jsonpatch[_0x26ac('0x24')](_0x31c08f,_0x1901b6,!![]);}catch(_0x2fea19){return BPromise[_0x26ac('0x25')](_0x2fea19);}return _0x31c08f[_0x26ac('0x26')]();};}function saveUpdates(_0x21b6ab,_0x147721){return function(_0x27765e){if(_0x27765e){return _0x27765e['update'](_0x21b6ab)[_0x26ac('0x27')](function(_0x18b83c){return _0x18b83c;});}return null;};}function removeEntity(_0x2b8299,_0x1885f7){return function(_0x346001){if(_0x346001){return _0x346001[_0x26ac('0x28')]()[_0x26ac('0x27')](function(){var _0x414777=_0x346001[_0x26ac('0x29')]({'plain':!![]});var _0x2a5ceb='Teams';return db['UserProfileResource'][_0x26ac('0x28')]({'where':{'type':_0x2a5ceb,'resourceId':_0x414777['id']}})['then'](function(){return _0x346001;});})[_0x26ac('0x27')](function(){_0x2b8299[_0x26ac('0x1f')](0xcc)[_0x26ac('0x1e')]();});}};}function handleEntityNotFound(_0x591949,_0x31cb17){return function(_0x162756){if(!_0x162756){_0x591949['sendStatus'](0x194);}return _0x162756;};}function handleError(_0x4d75e2,_0x15bad7){_0x15bad7=_0x15bad7||0x1f4;return function(_0x3e2c4d){logger[_0x26ac('0x2a')](_0x3e2c4d['stack']);if(_0x3e2c4d['name']){delete _0x3e2c4d[_0x26ac('0x2b')];}_0x4d75e2[_0x26ac('0x1f')](_0x15bad7)[_0x26ac('0x2c')](_0x3e2c4d);};}exports[_0x26ac('0x2d')]=function(_0x47b7c8,_0x5e1cbc){var _0x3ea2f0={},_0x3e2148={},_0x17691a={'count':0x0,'rows':[]};var _0x1219fe=_[_0x26ac('0x2e')](db[_0x26ac('0x2f')][_0x26ac('0x30')],function(_0xcdf4eb){return{'name':_0xcdf4eb[_0x26ac('0x31')],'type':_0xcdf4eb[_0x26ac('0x32')]['key']};});_0x3e2148[_0x26ac('0x33')]=_[_0x26ac('0x2e')](_0x1219fe,'name');_0x3e2148[_0x26ac('0x34')]=_[_0x26ac('0x35')](_0x47b7c8[_0x26ac('0x34')]);_0x3e2148[_0x26ac('0x36')]=_[_0x26ac('0x37')](_0x3e2148[_0x26ac('0x33')],_0x3e2148[_0x26ac('0x34')]);_0x3ea2f0[_0x26ac('0x38')]=_[_0x26ac('0x37')](_0x3e2148[_0x26ac('0x33')],qs[_0x26ac('0x39')](_0x47b7c8[_0x26ac('0x34')]['fields']));_0x3ea2f0[_0x26ac('0x38')]=_0x3ea2f0[_0x26ac('0x38')][_0x26ac('0x3a')]?_0x3ea2f0['attributes']:_0x3e2148[_0x26ac('0x33')];if(!_0x47b7c8['query'][_0x26ac('0x3b')](_0x26ac('0x3c'))){_0x3ea2f0['limit']=qs[_0x26ac('0x3d')](_0x47b7c8[_0x26ac('0x34')][_0x26ac('0x3d')]);_0x3ea2f0[_0x26ac('0x22')]=qs[_0x26ac('0x22')](_0x47b7c8[_0x26ac('0x34')]['offset']);}_0x3ea2f0[_0x26ac('0x3e')]=qs['sort'](_0x47b7c8[_0x26ac('0x34')]['sort']);_0x3ea2f0[_0x26ac('0x3f')]=qs['filters'](_['pick'](_0x47b7c8[_0x26ac('0x34')],_0x3e2148[_0x26ac('0x36')]));if(_0x47b7c8[_0x26ac('0x34')][_0x26ac('0x40')]){_0x3ea2f0[_0x26ac('0x3f')]=_[_0x26ac('0x41')](_0x3ea2f0['where'],{'$or':_['map'](_0x1219fe,function(_0x45abaa){if(_0x45abaa[_0x26ac('0x32')]!==_0x26ac('0x42')){var _0x511cb2={};_0x511cb2[_0x45abaa['name']]={'$like':'%'+_0x47b7c8[_0x26ac('0x34')][_0x26ac('0x40')]+'%'};return _0x511cb2;}})});}_0x3ea2f0=_['merge']({},_0x3ea2f0,_0x47b7c8['options']);var _0x33361b={'where':_0x3ea2f0[_0x26ac('0x3f')]};return db[_0x26ac('0x2f')]['count'](_0x33361b)['then'](function(_0x4bde52){_0x17691a['count']=_0x4bde52;if(_0x47b7c8[_0x26ac('0x34')][_0x26ac('0x43')]){_0x3ea2f0[_0x26ac('0x44')]=[{'all':!![]}];}return db[_0x26ac('0x2f')][_0x26ac('0x45')](_0x3ea2f0);})[_0x26ac('0x27')](function(_0x26d29e){_0x17691a[_0x26ac('0x46')]=_0x26d29e;return _0x17691a;})[_0x26ac('0x27')](respondWithFilteredResult(_0x5e1cbc,_0x3ea2f0))['catch'](handleError(_0x5e1cbc,null));};exports[_0x26ac('0x47')]=function(_0xc6aeb3,_0xfb928b){var _0x36f95f={'raw':![],'where':{'id':_0xc6aeb3[_0x26ac('0x48')]['id']}},_0x272296={};_0x272296[_0x26ac('0x33')]=_[_0x26ac('0x35')](db[_0x26ac('0x2f')][_0x26ac('0x30')]);_0x272296[_0x26ac('0x34')]=_[_0x26ac('0x35')](_0xc6aeb3[_0x26ac('0x34')]);_0x272296[_0x26ac('0x36')]=_['intersection'](_0x272296[_0x26ac('0x33')],_0x272296[_0x26ac('0x34')]);_0x36f95f[_0x26ac('0x38')]=_['intersection'](_0x272296[_0x26ac('0x33')],qs[_0x26ac('0x39')](_0xc6aeb3[_0x26ac('0x34')][_0x26ac('0x39')]));_0x36f95f[_0x26ac('0x38')]=_0x36f95f[_0x26ac('0x38')]['length']?_0x36f95f['attributes']:_0x272296[_0x26ac('0x33')];if(_0xc6aeb3[_0x26ac('0x34')][_0x26ac('0x43')]){_0x36f95f[_0x26ac('0x44')]=[{'all':!![]}];}_0x36f95f=_[_0x26ac('0x41')]({},_0x36f95f,_0xc6aeb3[_0x26ac('0x49')]);return db[_0x26ac('0x2f')][_0x26ac('0x4a')](_0x36f95f)[_0x26ac('0x27')](handleEntityNotFound(_0xfb928b,null))[_0x26ac('0x27')](respondWithResult(_0xfb928b,null))['catch'](handleError(_0xfb928b,null));};exports['create']=function(_0x324a5f,_0x2d6ddc){return db[_0x26ac('0x2f')]['create'](_0x324a5f[_0x26ac('0x4b')],{})[_0x26ac('0x27')](function(_0x370ad8){var _0x3cec09=_0x324a5f[_0x26ac('0x4c')][_0x26ac('0x29')]({'plain':!![]});if(!_0x3cec09)throw new Error(_0x26ac('0x4d'));if(_0x3cec09[_0x26ac('0x4e')]===_0x26ac('0x4c')){var _0x1f795b=_0x370ad8[_0x26ac('0x29')]({'plain':!![]});var _0x550466=_0x26ac('0x4f');return db[_0x26ac('0x50')]['find']({'where':{'name':_0x550466,'userProfileId':_0x3cec09['userProfileId']},'raw':!![]})[_0x26ac('0x27')](function(_0x363b36){if(_0x363b36&&_0x363b36[_0x26ac('0x51')]===0x0){return db['UserProfileResource'][_0x26ac('0x52')]({'name':_0x1f795b[_0x26ac('0x2b')],'resourceId':_0x1f795b['id'],'type':_0x363b36[_0x26ac('0x2b')],'sectionId':_0x363b36['id']},{})[_0x26ac('0x27')](function(){return _0x370ad8;});}else{return _0x370ad8;}})[_0x26ac('0x53')](function(_0x1fc474){logger[_0x26ac('0x2a')](_0x26ac('0x54'),_0x1fc474);throw _0x1fc474;});}return _0x370ad8;})[_0x26ac('0x27')](respondWithResult(_0x2d6ddc,0xc9))[_0x26ac('0x53')](handleError(_0x2d6ddc,null));};exports[_0x26ac('0x55')]=function(_0x1e7d5c,_0xe67cf1){if(_0x1e7d5c[_0x26ac('0x4b')]['id']){delete _0x1e7d5c[_0x26ac('0x4b')]['id'];}return db[_0x26ac('0x2f')][_0x26ac('0x4a')]({'where':{'id':_0x1e7d5c[_0x26ac('0x48')]['id']}})['then'](handleEntityNotFound(_0xe67cf1,null))['then'](saveUpdates(_0x1e7d5c[_0x26ac('0x4b')],null))[_0x26ac('0x27')](respondWithResult(_0xe67cf1,null))[_0x26ac('0x53')](handleError(_0xe67cf1,null));};exports[_0x26ac('0x28')]=function(_0x4c3f99,_0x2c9ab7){return db['Team'][_0x26ac('0x4a')]({'where':{'id':_0x4c3f99['params']['id']}})[_0x26ac('0x27')](handleEntityNotFound(_0x2c9ab7,null))[_0x26ac('0x27')](removeEntity(_0x2c9ab7,null))['catch'](handleError(_0x2c9ab7,null));};exports[_0x26ac('0x56')]=function(_0x509528,_0x319418,_0x3a16bc){return db[_0x26ac('0x2f')]['findOne']({'where':{'id':_0x509528[_0x26ac('0x48')]['id']}})[_0x26ac('0x27')](handleEntityNotFound(_0x319418,null))[_0x26ac('0x27')](function(_0x4b4524){if(!_0x509528[_0x26ac('0x34')][_0x26ac('0x57')]||!utils[_0x26ac('0x58')](_0x509528[_0x26ac('0x34')]['channel'])){throw new db[(_0x26ac('0x59'))]['ValidationError'](_0x26ac('0x5a'));}var _0x59087f={};var _0x25e314={};_0x25e314['model']=_[_0x26ac('0x35')](db[_[_0x26ac('0x5b')](_0x509528[_0x26ac('0x34')]['channel'][_0x26ac('0x5c')]())+'Queue'][_0x26ac('0x30')]);_0x25e314['query']=_[_0x26ac('0x35')](_0x509528[_0x26ac('0x34')]);_0x25e314[_0x26ac('0x36')]=_[_0x26ac('0x37')](_0x25e314['model'],_0x25e314[_0x26ac('0x34')]);_0x59087f[_0x26ac('0x38')]=_['intersection'](_0x25e314['model'],qs['fields'](_0x509528[_0x26ac('0x34')][_0x26ac('0x39')]));_0x59087f[_0x26ac('0x38')]=_0x59087f[_0x26ac('0x38')][_0x26ac('0x3a')]?_0x59087f[_0x26ac('0x38')]:_0x25e314['model'];_0x59087f[_0x26ac('0x3d')]=qs['limit'](_0x509528['query']['limit']);_0x59087f[_0x26ac('0x22')]=qs[_0x26ac('0x22')](_0x509528[_0x26ac('0x34')][_0x26ac('0x22')]);_0x59087f[_0x26ac('0x3e')]=qs[_0x26ac('0x5d')](_0x509528[_0x26ac('0x34')][_0x26ac('0x5d')]);_0x59087f[_0x26ac('0x3f')]=qs[_0x26ac('0x36')](_[_0x26ac('0x5e')](_0x509528['query'],_0x25e314[_0x26ac('0x36')]));_0x59087f=_[_0x26ac('0x41')]({},_0x59087f,_0x509528['options']);return _0x4b4524[_0x26ac('0x29')+_[_0x26ac('0x5b')](_0x509528[_0x26ac('0x34')][_0x26ac('0x57')]['toLowerCase']())+_0x26ac('0x5f')](_0x59087f);})[_0x26ac('0x27')](respondWithResult(_0x319418,null))[_0x26ac('0x53')](handleError(_0x319418,null));};exports[_0x26ac('0x60')]=function(_0x296504,_0x264f34,_0x1d6262){return db[_0x26ac('0x2f')][_0x26ac('0x61')]({'where':{'id':_0x296504[_0x26ac('0x48')]['id']}})[_0x26ac('0x27')](function(_0x290130){if(_0x290130){if(!_0x296504['body'][_0x26ac('0x57')]||!utils[_0x26ac('0x58')](_0x296504['body'][_0x26ac('0x57')])){throw new db[(_0x26ac('0x59'))][(_0x26ac('0x62'))](_0x26ac('0x5a'));}return _0x290130[_0x26ac('0x63')+_[_0x26ac('0x5b')](_0x296504[_0x26ac('0x4b')]['channel'][_0x26ac('0x5c')]())+_0x26ac('0x5f')](_0x296504[_0x26ac('0x4b')][_0x26ac('0x64')]);}return null;})['then'](handleEntityNotFound(_0x264f34,null))[_0x26ac('0x27')](respondWithStatusCode(_0x264f34,null))[_0x26ac('0x53')](handleError(_0x264f34,null));};exports[_0x26ac('0x65')]=function(_0x54afc7,_0x20fcde,_0x7a3707){return db[_0x26ac('0x2f')][_0x26ac('0x61')]({'where':{'id':_0x54afc7[_0x26ac('0x48')]['id']}})[_0x26ac('0x27')](function(_0x48f5c0){if(_0x48f5c0){if(!_0x54afc7[_0x26ac('0x34')][_0x26ac('0x57')]||!utils[_0x26ac('0x58')](_0x54afc7[_0x26ac('0x34')][_0x26ac('0x57')])){throw new db[(_0x26ac('0x59'))][(_0x26ac('0x62'))](_0x26ac('0x5a'));}return _0x48f5c0[_0x26ac('0x66')+_[_0x26ac('0x5b')](_0x54afc7[_0x26ac('0x34')][_0x26ac('0x57')][_0x26ac('0x5c')]())+'Queues'](_0x54afc7['query'][_0x26ac('0x64')]);}return null;})[_0x26ac('0x27')](handleEntityNotFound(_0x20fcde,null))['then'](respondWithStatusCode(_0x20fcde,null))[_0x26ac('0x53')](handleError(_0x20fcde,null));};exports[_0x26ac('0x67')]=function(_0x1c66ff,_0x2a859b,_0x120168){return db[_0x26ac('0x2f')][_0x26ac('0x4a')]({'where':{'id':_0x1c66ff[_0x26ac('0x48')]['id']}})[_0x26ac('0x27')](handleEntityNotFound(_0x2a859b,null))[_0x26ac('0x27')](function(_0x5d917c){if(_0x5d917c){var _0x502d48=['Voice',_0x26ac('0x68'),_0x26ac('0x69'),_0x26ac('0x6a'),_0x26ac('0x6b'),_0x26ac('0x6c')];return BPromise['each'](_0x502d48,function(_0x26efef){return _0x5d917c[_0x26ac('0x29')+_0x26efef+_0x26ac('0x5f')]({'attributes':['id',_0x26ac('0x2b')]})[_0x26ac('0x27')](function(_0x3bd4a3){return BPromise[_0x26ac('0x6d')](_0x3bd4a3,function(_0x281599){return _0x281599[_0x26ac('0x67')](_0x1c66ff['body']['ids'])['then'](function(){if(_0x26efef==='Voice'){return db[_0x26ac('0x6e')][_0x26ac('0x45')]({'where':{'id':_0x1c66ff[_0x26ac('0x4b')][_0x26ac('0x64')]},'attributes':['id',_0x26ac('0x2b'),'online','voicePause',_0x26ac('0x6f')],'raw':!![]})[_0x26ac('0x27')](function(_0x42a693){return BPromise[_0x26ac('0x6d')](_[_0x26ac('0x40')](_0x42a693,{'online':0x1}),function(_0x548ddf){return db[_0x26ac('0x70')][_0x26ac('0x71')]({'membername':_0x548ddf[_0x26ac('0x2b')],'UserId':_0x548ddf['id'],'queue_name':_0x281599['name'],'VoiceQueueId':_0x281599['id'],'interface':_[_0x26ac('0x72')](_0x548ddf[_0x26ac('0x6f')])?util[_0x26ac('0x73')](_0x26ac('0x74'),_0x548ddf[_0x26ac('0x2b')]):_0x548ddf[_0x26ac('0x6f')],'paused':_0x548ddf[_0x26ac('0x75')]||![],'penalty':0x0});});});}});});})[_0x26ac('0x27')](function(){return _0x5d917c;});})[_0x26ac('0x27')](function(){return _0x5d917c;});}})['then'](function(_0x19a470){if(_0x19a470){return _0x19a470[_0x26ac('0x67')](_0x1c66ff['body'][_0x26ac('0x64')],_[_0x26ac('0x76')](_0x1c66ff[_0x26ac('0x4b')],[_0x26ac('0x64'),'id'])||{})[_0x26ac('0x77')](function(_0x1b4689){for(var _0x6b4910=0x0;_0x6b4910<_0x1c66ff[_0x26ac('0x4b')][_0x26ac('0x64')]['length'];_0x6b4910+=0x1){socket['emit'](_0x26ac('0x78'),{'UserId':_0x1c66ff[_0x26ac('0x4b')][_0x26ac('0x64')][_0x6b4910],'TeamId':_0x1c66ff[_0x26ac('0x48')]['id']});}return _0x1b4689;});}})['then'](respondWithResult(_0x2a859b,null))['catch'](handleError(_0x2a859b,null));};exports[_0x26ac('0x79')]=function(_0x517707,_0x5d9f18,_0x5d7a48){return db[_0x26ac('0x2f')][_0x26ac('0x4a')]({'where':{'id':_0x517707[_0x26ac('0x48')]['id']}})[_0x26ac('0x27')](handleEntityNotFound(_0x5d9f18,null))[_0x26ac('0x27')](function(_0x19d321){if(_0x19d321){return BPromise['each']([_0x26ac('0x7a'),'chat',_0x26ac('0x7b'),'sms','fax',_0x26ac('0x7c')],function(_0x14fd56){return _0x19d321['get'+_[_0x26ac('0x5b')](_0x14fd56)+_0x26ac('0x5f')]({'attributes':['id',_0x26ac('0x2b')]})[_0x26ac('0x27')](function(_0x2f4f38){return BPromise['each'](_0x2f4f38,function(_0x29684c){return _0x29684c[_0x26ac('0x79')](_0x517707['query'][_0x26ac('0x64')])[_0x26ac('0x27')](function(){if(_0x14fd56===_0x26ac('0x7a')){return db[_0x26ac('0x70')]['destroy']({'where':{'VoiceQueueId':_0x29684c['id'],'UserId':_0x517707['query'][_0x26ac('0x64')]}});}});});})['then'](function(){return _0x19d321;});})[_0x26ac('0x27')](function(){return _0x19d321;});}})[_0x26ac('0x27')](function(_0x432baa){if(_0x432baa){return _0x432baa[_0x26ac('0x79')](_0x517707[_0x26ac('0x34')]['ids'])['then'](function(){if(_['isArray'](_0x517707[_0x26ac('0x34')][_0x26ac('0x64')])){for(var _0x1538ec=0x0;_0x1538ec<_0x517707[_0x26ac('0x34')][_0x26ac('0x64')][_0x26ac('0x3a')];_0x1538ec+=0x1){socket[_0x26ac('0x7d')]('userTeam:remove',{'UserId':Number(_0x517707[_0x26ac('0x34')]['ids'][_0x1538ec]),'TeamId':Number(_0x517707['params']['id'])});}}else{socket[_0x26ac('0x7d')](_0x26ac('0x7e'),{'UserId':Number(_0x517707[_0x26ac('0x34')][_0x26ac('0x64')]),'TeamId':Number(_0x517707[_0x26ac('0x48')]['id'])});}});}})[_0x26ac('0x27')](respondWithStatusCode(_0x5d9f18,null))[_0x26ac('0x53')](handleError(_0x5d9f18,null));};exports[_0x26ac('0x7f')]=function(_0x1acc6a,_0x50e17b,_0x278b50){var _0x5cd489={};var _0x2ed54b={};var _0x33c8f6;var _0x6f85ac;return db[_0x26ac('0x2f')][_0x26ac('0x61')]({'where':{'id':_0x1acc6a[_0x26ac('0x48')]['id']}})['then'](handleEntityNotFound(_0x50e17b,null))[_0x26ac('0x27')](function(_0x498589){if(_0x498589){_0x33c8f6=_0x498589;_0x2ed54b[_0x26ac('0x33')]=_[_0x26ac('0x35')](db['User'][_0x26ac('0x30')]);_0x2ed54b[_0x26ac('0x34')]=_[_0x26ac('0x35')](_0x1acc6a['query']);_0x2ed54b[_0x26ac('0x36')]=_[_0x26ac('0x37')](_0x2ed54b[_0x26ac('0x33')],_0x2ed54b[_0x26ac('0x34')]);_0x5cd489[_0x26ac('0x38')]=_[_0x26ac('0x37')](_0x2ed54b[_0x26ac('0x33')],qs[_0x26ac('0x39')](_0x1acc6a[_0x26ac('0x34')]['fields']));_0x5cd489[_0x26ac('0x38')]=_0x5cd489[_0x26ac('0x38')][_0x26ac('0x3a')]?_0x5cd489['attributes']:_0x2ed54b['model'];_0x5cd489[_0x26ac('0x3e')]=qs[_0x26ac('0x5d')](_0x1acc6a[_0x26ac('0x34')][_0x26ac('0x5d')]);_0x5cd489[_0x26ac('0x3f')]=qs[_0x26ac('0x36')](_[_0x26ac('0x5e')](_0x1acc6a[_0x26ac('0x34')],_0x2ed54b['filters']));if(_0x1acc6a[_0x26ac('0x34')][_0x26ac('0x40')]){_0x5cd489[_0x26ac('0x3f')]=_['merge'](_0x5cd489[_0x26ac('0x3f')],{'$or':_[_0x26ac('0x2e')](_0x5cd489['attributes'],function(_0x4d3028){var _0x220ac0={};_0x220ac0[_0x4d3028]={'$like':'%'+_0x1acc6a[_0x26ac('0x34')][_0x26ac('0x40')]+'%'};return _0x220ac0;})});}_0x5cd489=_['merge']({},_0x5cd489,_0x1acc6a['options']);return _0x33c8f6[_0x26ac('0x7f')](_0x5cd489);}})['then'](function(_0x301cac){if(_0x301cac){_0x6f85ac=_0x301cac[_0x26ac('0x3a')];if(!_0x1acc6a[_0x26ac('0x34')][_0x26ac('0x3b')]('nolimit')){_0x5cd489[_0x26ac('0x3d')]=qs['limit'](_0x1acc6a[_0x26ac('0x34')][_0x26ac('0x3d')]);_0x5cd489[_0x26ac('0x22')]=qs[_0x26ac('0x22')](_0x1acc6a[_0x26ac('0x34')][_0x26ac('0x22')]);}return _0x33c8f6[_0x26ac('0x7f')](_0x5cd489);}})[_0x26ac('0x27')](function(_0x36c190){if(_0x36c190){return _0x36c190?{'count':_0x6f85ac,'rows':_0x36c190}:null;}})[_0x26ac('0x27')](respondWithResult(_0x50e17b,null))['catch'](handleError(_0x50e17b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index ea3dd0b..2870990 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 _0xbf54=['emit','hook','exports','events','../../mysqldb','Team','setMaxListeners','save','update','remove'];(function(_0x44032a,_0x42d3bb){var _0x49319c=function(_0x324fa1){while(--_0x324fa1){_0x44032a['push'](_0x44032a['shift']());}};_0x49319c(++_0x42d3bb);}(_0xbf54,0x12f));var _0x4bf5=function(_0x725a4c,_0x102507){_0x725a4c=_0x725a4c-0x0;var _0x37b2cc=_0xbf54[_0x725a4c];return _0x37b2cc;};'use strict';var EventEmitter=require(_0x4bf5('0x0'));var Team=require(_0x4bf5('0x1'))['db'][_0x4bf5('0x2')];var TeamEvents=new EventEmitter();TeamEvents[_0x4bf5('0x3')](0x0);var events={'afterCreate':_0x4bf5('0x4'),'afterUpdate':_0x4bf5('0x5'),'afterDestroy':_0x4bf5('0x6')};function emitEvent(_0xdba34a){return function(_0x3f0184,_0x453e63,_0x3c4a21){TeamEvents[_0x4bf5('0x7')](_0xdba34a+':'+_0x3f0184['id'],_0x3f0184);TeamEvents['emit'](_0xdba34a,_0x3f0184);_0x3c4a21(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x4bf5('0x8')](e,emitEvent(event));}}module[_0x4bf5('0x9')]=TeamEvents; \ No newline at end of file +var _0x64a4=['../../mysqldb','setMaxListeners','save','update','remove','emit','hook','exports'];(function(_0x2f4e1d,_0x1d7b3f){var _0x417ff4=function(_0x45a727){while(--_0x45a727){_0x2f4e1d['push'](_0x2f4e1d['shift']());}};_0x417ff4(++_0x1d7b3f);}(_0x64a4,0x180));var _0x464a=function(_0x41f579,_0x32526d){_0x41f579=_0x41f579-0x0;var _0x120367=_0x64a4[_0x41f579];return _0x120367;};'use strict';var EventEmitter=require('events');var Team=require(_0x464a('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0x464a('0x1')](0x0);var events={'afterCreate':_0x464a('0x2'),'afterUpdate':_0x464a('0x3'),'afterDestroy':_0x464a('0x4')};function emitEvent(_0x3664f0){return function(_0x5019d1,_0x45d004,_0x3b49c1){TeamEvents[_0x464a('0x5')](_0x3664f0+':'+_0x5019d1['id'],_0x5019d1);TeamEvents['emit'](_0x3664f0,_0x5019d1);_0x3b49c1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x464a('0x6')](e,emitEvent(event));}}module[_0x464a('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 f8a71b7..b2c470e 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 _0x0c85=['./team.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x4d1fa1,_0x48df12){var _0xe1fef0=function(_0x1a1008){while(--_0x1a1008){_0x4d1fa1['push'](_0x4d1fa1['shift']());}};_0xe1fef0(++_0x48df12);}(_0x0c85,0x1d9));var _0x50c8=function(_0x176b9a,_0x1874c9){_0x176b9a=_0x176b9a-0x0;var _0x1afa77=_0x0c85[_0x176b9a];return _0x1afa77;};'use strict';var _=require(_0x50c8('0x0'));var util=require(_0x50c8('0x1'));var logger=require('../../config/logger')(_0x50c8('0x2'));var moment=require(_0x50c8('0x3'));var BPromise=require('bluebird');var rp=require(_0x50c8('0x4'));var fs=require('fs');var path=require(_0x50c8('0x5'));var rimraf=require(_0x50c8('0x6'));var config=require('../../config/environment');var attributes=require(_0x50c8('0x7'));module[_0x50c8('0x8')]=function(_0x33f0a9,_0x4d0019){return _0x33f0a9[_0x50c8('0x9')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0f3c=['moment','bluebird','request-promise','path','../../config/environment','./team.attributes','define','lodash'];(function(_0x2b5339,_0x2e1410){var _0x3eb264=function(_0x1912e4){while(--_0x1912e4){_0x2b5339['push'](_0x2b5339['shift']());}};_0x3eb264(++_0x2e1410);}(_0x0f3c,0xb7));var _0xc0f3=function(_0x1c5ca4,_0x4704a9){_0x1c5ca4=_0x1c5ca4-0x0;var _0x115659=_0x0f3c[_0x1c5ca4];return _0x115659;};'use strict';var _=require(_0xc0f3('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc0f3('0x1'));var BPromise=require(_0xc0f3('0x2'));var rp=require(_0xc0f3('0x3'));var fs=require('fs');var path=require(_0xc0f3('0x4'));var rimraf=require('rimraf');var config=require(_0xc0f3('0x5'));var attributes=require(_0xc0f3('0x6'));module['exports']=function(_0x43d210,_0x1e8d03){return _0x43d210[_0xc0f3('0x7')]('Team',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 1838921..8b1c9e9 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 _0x640b=['result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','defaults','redis','socket.io-emitter','./team.socket','register','request','then','info','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xd16df9,_0x18db96){var _0x141b04=function(_0x5f44ad){while(--_0x5f44ad){_0xd16df9['push'](_0xd16df9['shift']());}};_0x141b04(++_0x18db96);}(_0x640b,0xd2));var _0xb640=function(_0x710012,_0x1e01ba){_0x710012=_0x710012-0x0;var _0x45a7b8=_0x640b[_0x710012];return _0x45a7b8;};'use strict';var _=require(_0xb640('0x0'));var util=require(_0xb640('0x1'));var moment=require(_0xb640('0x2'));var BPromise=require('bluebird');var rs=require(_0xb640('0x3'));var fs=require('fs');var Redis=require(_0xb640('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb640('0x5'));var logger=require(_0xb640('0x6'))(_0xb640('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xb640('0x8')][_0xb640('0x9')]({'port':0x232a});config['redis']=_[_0xb640('0xa')](config[_0xb640('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0xb640('0xc'))(new Redis(config[_0xb640('0xb')]));require(_0xb640('0xd'))[_0xb640('0xe')](socket);function respondWithRpcPromise(_0x228302,_0x58b54a,_0xde1ec1){return new BPromise(function(_0x2fe6b7,_0x3922bf){return client[_0xb640('0xf')](_0x228302,_0xde1ec1)[_0xb640('0x10')](function(_0x5745b8){logger[_0xb640('0x11')](_0xb640('0x12'),_0x58b54a,_0xb640('0x13'));logger['debug'](_0xb640('0x14'),_0x58b54a,_0xb640('0x13'),JSON[_0xb640('0x15')](_0x5745b8));if(_0x5745b8['error']){if(_0x5745b8[_0xb640('0x16')]['code']===0x1f4){logger['error'](_0xb640('0x12'),_0x58b54a,_0x5745b8[_0xb640('0x16')][_0xb640('0x17')]);return _0x3922bf(_0x5745b8[_0xb640('0x16')][_0xb640('0x17')]);}logger['error'](_0xb640('0x12'),_0x58b54a,_0x5745b8[_0xb640('0x16')]['message']);return _0x2fe6b7(_0x5745b8['error']['message']);}else{logger[_0xb640('0x11')](_0xb640('0x12'),_0x58b54a,_0xb640('0x13'));_0x2fe6b7(_0x5745b8[_0xb640('0x18')][_0xb640('0x17')]);}})[_0xb640('0x19')](function(_0x4c0290){logger[_0xb640('0x16')](_0xb640('0x12'),_0x58b54a,_0x4c0290);_0x3922bf(_0x4c0290);});});} \ No newline at end of file +var _0x8145=['http','redis','socket.io-emitter','./team.socket','request','info','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x286957,_0x4bc652){var _0x100e00=function(_0x1862de){while(--_0x1862de){_0x286957['push'](_0x286957['shift']());}};_0x100e00(++_0x4bc652);}(_0x8145,0x162));var _0x5814=function(_0x4a9df3,_0x3a2a7b){_0x4a9df3=_0x4a9df3-0x0;var _0x8b555d=_0x8145[_0x4a9df3];return _0x8b555d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5814('0x0'));var BPromise=require(_0x5814('0x1'));var rs=require(_0x5814('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5814('0x3'))['db'];var utils=require(_0x5814('0x4'));var logger=require(_0x5814('0x5'))(_0x5814('0x6'));var config=require(_0x5814('0x7'));var jayson=require(_0x5814('0x8'));var client=jayson[_0x5814('0x9')][_0x5814('0xa')]({'port':0x232a});config[_0x5814('0xb')]=_['defaults'](config[_0x5814('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5814('0xc'))(new Redis(config['redis']));require(_0x5814('0xd'))['register'](socket);function respondWithRpcPromise(_0x126538,_0x537d00,_0x46356e){return new BPromise(function(_0x128dd0,_0xdeebd4){return client[_0x5814('0xe')](_0x126538,_0x46356e)['then'](function(_0x4aa2b0){logger[_0x5814('0xf')](_0x5814('0x10'),_0x537d00,_0x5814('0x11'));logger[_0x5814('0x12')](_0x5814('0x13'),_0x537d00,_0x5814('0x11'),JSON[_0x5814('0x14')](_0x4aa2b0));if(_0x4aa2b0[_0x5814('0x15')]){if(_0x4aa2b0['error'][_0x5814('0x16')]===0x1f4){logger[_0x5814('0x15')](_0x5814('0x10'),_0x537d00,_0x4aa2b0['error']['message']);return _0xdeebd4(_0x4aa2b0['error']['message']);}logger[_0x5814('0x15')](_0x5814('0x10'),_0x537d00,_0x4aa2b0[_0x5814('0x15')]['message']);return _0x128dd0(_0x4aa2b0[_0x5814('0x15')][_0x5814('0x17')]);}else{logger[_0x5814('0xf')]('Team,\x20%s,\x20%s',_0x537d00,_0x5814('0x11'));_0x128dd0(_0x4aa2b0[_0x5814('0x18')][_0x5814('0x17')]);}})[_0x5814('0x19')](function(_0x102261){logger['error'](_0x5814('0x10'),_0x537d00,_0x102261);_0xdeebd4(_0x102261);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index e18ec20..69483b7 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 _0x1574=['removeListener','register','length','team:','./team.events','save','remove','update','emit'];(function(_0x3ce3c,_0x319337){var _0x55a2c9=function(_0x1568d0){while(--_0x1568d0){_0x3ce3c['push'](_0x3ce3c['shift']());}};_0x55a2c9(++_0x319337);}(_0x1574,0x148));var _0x4157=function(_0x5389da,_0x114f47){_0x5389da=_0x5389da-0x0;var _0x5f453c=_0x1574[_0x5389da];return _0x5f453c;};'use strict';var TeamEvents=require(_0x4157('0x0'));var events=[_0x4157('0x1'),_0x4157('0x2'),_0x4157('0x3')];function createListener(_0x56ee53,_0x31fa4d){return function(_0x3bdabb){_0x31fa4d[_0x4157('0x4')](_0x56ee53,_0x3bdabb);};}function removeListener(_0x1759d6,_0x2f0766){return function(){TeamEvents[_0x4157('0x5')](_0x1759d6,_0x2f0766);};}exports[_0x4157('0x6')]=function(_0x43c6dc){for(var _0xbd0cf7=0x0,_0x1ece73=events[_0x4157('0x7')];_0xbd0cf7<_0x1ece73;_0xbd0cf7++){var _0x213c67=events[_0xbd0cf7];var _0x17a9ec=createListener(_0x4157('0x8')+_0x213c67,_0x43c6dc);TeamEvents['on'](_0x213c67,_0x17a9ec);}}; \ No newline at end of file +var _0xc274=['length','team:','save','emit','register'];(function(_0x6e724,_0x49fcc6){var _0x3d678f=function(_0x49eb01){while(--_0x49eb01){_0x6e724['push'](_0x6e724['shift']());}};_0x3d678f(++_0x49fcc6);}(_0xc274,0x151));var _0x4c27=function(_0x4a02cd,_0x2f4b4e){_0x4a02cd=_0x4a02cd-0x0;var _0x2ecf5c=_0xc274[_0x4a02cd];return _0x2ecf5c;};'use strict';var TeamEvents=require('./team.events');var events=[_0x4c27('0x0'),'remove','update'];function createListener(_0x3e4b87,_0x2b9476){return function(_0xce0b00){_0x2b9476[_0x4c27('0x1')](_0x3e4b87,_0xce0b00);};}function removeListener(_0x2771df,_0x17970c){return function(){TeamEvents['removeListener'](_0x2771df,_0x17970c);};}exports[_0x4c27('0x2')]=function(_0x545647){for(var _0x1789ca=0x0,_0x18fd2c=events[_0x4c27('0x3')];_0x1789ca<_0x18fd2c;_0x1789ca++){var _0x5f5058=events[_0x1789ca];var _0x478a91=createListener(_0x4c27('0x4')+_0x5f5058,_0x545647);TeamEvents['on'](_0x5f5058,_0x478a91);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index 15ca2c7..d5f2e24 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 _0x8ed7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','isAuthenticated','get','post','create','/:id','exports','util','path','express'];(function(_0x9bacfc,_0x567c9f){var _0x3ddd2a=function(_0x44dff4){while(--_0x44dff4){_0x9bacfc['push'](_0x9bacfc['shift']());}};_0x3ddd2a(++_0x567c9f);}(_0x8ed7,0xe7));var _0x78ed=function(_0x6b39e3,_0x5e0dab){_0x6b39e3=_0x6b39e3-0x0;var _0x24dfa9=_0x8ed7[_0x6b39e3];return _0x24dfa9;};'use strict';var multer=require('multer');var util=require(_0x78ed('0x0'));var path=require(_0x78ed('0x1'));var timeout=require('connect-timeout');var express=require(_0x78ed('0x2'));var router=express['Router']();var auth=require(_0x78ed('0x3'));var interaction=require(_0x78ed('0x4'));var config=require(_0x78ed('0x5'));var controller=require(_0x78ed('0x6'));router['get']('/',auth[_0x78ed('0x7')](),controller['index']);router[_0x78ed('0x8')]('/:id',auth[_0x78ed('0x7')](),controller['show']);router[_0x78ed('0x9')]('/',auth[_0x78ed('0x7')](),controller[_0x78ed('0xa')]);router['put'](_0x78ed('0xb'),auth[_0x78ed('0x7')](),controller['update']);router['delete'](_0x78ed('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x78ed('0xc')]=router; \ No newline at end of file +var _0xc27a=['../../components/interaction/service','index','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x316a3f,_0x2647e9){var _0x53d1d7=function(_0x5ae5c5){while(--_0x5ae5c5){_0x316a3f['push'](_0x316a3f['shift']());}};_0x53d1d7(++_0x2647e9);}(_0xc27a,0xd3));var _0xac27=function(_0x35d3a8,_0x44406a){_0x35d3a8=_0x35d3a8-0x0;var _0x182378=_0xc27a[_0x35d3a8];return _0x182378;};'use strict';var multer=require('multer');var util=require(_0xac27('0x0'));var path=require('path');var timeout=require(_0xac27('0x1'));var express=require(_0xac27('0x2'));var router=express[_0xac27('0x3')]();var auth=require(_0xac27('0x4'));var interaction=require(_0xac27('0x5'));var config=require('../../config/environment');var controller=require('./template.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xac27('0x6')]);router[_0xac27('0x7')]('/:id',auth[_0xac27('0x8')](),controller[_0xac27('0x9')]);router[_0xac27('0xa')]('/',auth[_0xac27('0x8')](),controller[_0xac27('0xb')]);router[_0xac27('0xc')](_0xac27('0xd'),auth[_0xac27('0x8')](),controller[_0xac27('0xe')]);router[_0xac27('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xac27('0x10')]);module[_0xac27('0x11')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 368b0f7..e3845db 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 _0xc8d5=['TEXT','exports','STRING'];(function(_0x3a3490,_0x2448ba){var _0xec7361=function(_0x48aacf){while(--_0x48aacf){_0x3a3490['push'](_0x3a3490['shift']());}};_0xec7361(++_0x2448ba);}(_0xc8d5,0x1a8));var _0x5c8d=function(_0x2e5064,_0x2d2902){_0x2e5064=_0x2e5064-0x0;var _0x342082=_0xc8d5[_0x2e5064];return _0x342082;};'use strict';var Sequelize=require('sequelize');module[_0x5c8d('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x5c8d('0x1')]},'html':{'type':Sequelize[_0x5c8d('0x2')]}}; \ No newline at end of file +var _0xd96e=['STRING','TEXT','sequelize','exports'];(function(_0x47423c,_0xd14c46){var _0x6867bc=function(_0x1b427b){while(--_0x1b427b){_0x47423c['push'](_0x47423c['shift']());}};_0x6867bc(++_0xd14c46);}(_0xd96e,0x16e));var _0xed96=function(_0x55461b,_0x58b919){_0x55461b=_0x55461b-0x0;var _0x400a74=_0xd96e[_0x55461b];return _0x400a74;};'use strict';var Sequelize=require(_0xed96('0x0'));module[_0xed96('0x1')]={'name':{'type':Sequelize[_0xed96('0x2')]},'description':{'type':Sequelize[_0xed96('0x2')]},'html':{'type':Sequelize[_0xed96('0x3')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index 310a28c..8dd322e 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 _0xe09b=['jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','then','destroy','Templates','UserProfileResource','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','userProfileId','autoAssociation','error','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x52786f,_0x24fa18){var _0x517f5a=function(_0x4e7ab5){while(--_0x4e7ab5){_0x52786f['push'](_0x52786f['shift']());}};_0x517f5a(++_0x24fa18);}(_0xe09b,0x1eb));var _0xbe09=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe09b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xbe09('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbe09('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbe09('0x2'));var rp=require(_0xbe09('0x3'));var moment=require(_0xbe09('0x4'));var BPromise=require(_0xbe09('0x5'));var Mustache=require('mustache');var util=require(_0xbe09('0x6'));var path=require('path');var sox=require(_0xbe09('0x7'));var csv=require(_0xbe09('0x8'));var ejs=require(_0xbe09('0x9'));var fs=require('fs');var _=require(_0xbe09('0xa'));var squel=require(_0xbe09('0xb'));var crypto=require(_0xbe09('0xc'));var jsforce=require(_0xbe09('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xbe09('0x8'));var querystring=require(_0xbe09('0xe'));var Papa=require(_0xbe09('0xf'));var Redis=require(_0xbe09('0x10'));var authService=require(_0xbe09('0x11'));var qs=require(_0xbe09('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe09('0x13'));var logger=require(_0xbe09('0x14'))('api');var utils=require(_0xbe09('0x15'));var config=require(_0xbe09('0x16'));var db=require(_0xbe09('0x17'))['db'];function respondWithStatusCode(_0x55f50a,_0x4c0e13){_0x4c0e13=_0x4c0e13||0xcc;return function(_0x5cc1e1){if(_0x5cc1e1){return _0x55f50a[_0xbe09('0x18')](_0x4c0e13);}return _0x55f50a['status'](_0x4c0e13)[_0xbe09('0x19')]();};}function respondWithResult(_0x58b1b6,_0x2d0482){_0x2d0482=_0x2d0482||0xc8;return function(_0x3d0732){if(_0x3d0732){return _0x58b1b6[_0xbe09('0x1a')](_0x2d0482)[_0xbe09('0x1b')](_0x3d0732);}};}function respondWithFilteredResult(_0x8f908c,_0x48d8bb){return function(_0x51aa9f){if(_0x51aa9f){var _0x2c7dbf=_0x51aa9f[_0xbe09('0x1c')],_0x36120c=_0x48d8bb[_0xbe09('0x1d')],_0x54f5b1=_0x48d8bb[_0xbe09('0x1d')]+_0x48d8bb['limit'],_0x95f914;if(_0x54f5b1>=_0x2c7dbf){_0x54f5b1=_0x2c7dbf;_0x95f914=0xc8;}else{_0x95f914=0xce;}_0x8f908c['status'](_0x95f914);return _0x8f908c[_0xbe09('0x1e')](_0xbe09('0x1f'),_0x36120c+'-'+_0x54f5b1+'/'+_0x2c7dbf)[_0xbe09('0x1b')](_0x51aa9f);}return null;};}function patchUpdates(_0x37236c){return function(_0x16a48c){try{jsonpatch[_0xbe09('0x20')](_0x16a48c,_0x37236c,!![]);}catch(_0x32bdf7){return BPromise['reject'](_0x32bdf7);}return _0x16a48c[_0xbe09('0x21')]();};}function saveUpdates(_0x4b632d,_0x509dc1){return function(_0x1d5461){if(_0x1d5461){return _0x1d5461['update'](_0x4b632d)[_0xbe09('0x22')](function(_0x55a332){return _0x55a332;});}return null;};}function removeEntity(_0x5666b0,_0x576c35){return function(_0x1c801f){if(_0x1c801f){return _0x1c801f[_0xbe09('0x23')]()[_0xbe09('0x22')](function(){var _0x34a5fe=_0x1c801f['get']({'plain':!![]});var _0x31b148=_0xbe09('0x24');return db[_0xbe09('0x25')][_0xbe09('0x23')]({'where':{'type':_0x31b148,'resourceId':_0x34a5fe['id']}})[_0xbe09('0x22')](function(){return _0x1c801f;});})['then'](function(){_0x5666b0[_0xbe09('0x1a')](0xcc)[_0xbe09('0x19')]();});}};}function handleEntityNotFound(_0x1b4a1d,_0x19032c){return function(_0x29cbcc){if(!_0x29cbcc){_0x1b4a1d[_0xbe09('0x18')](0x194);}return _0x29cbcc;};}function handleError(_0x3d73c0,_0x1435c1){_0x1435c1=_0x1435c1||0x1f4;return function(_0x363abe){logger['error'](_0x363abe[_0xbe09('0x26')]);if(_0x363abe[_0xbe09('0x27')]){delete _0x363abe[_0xbe09('0x27')];}_0x3d73c0['status'](_0x1435c1)[_0xbe09('0x28')](_0x363abe);};}exports[_0xbe09('0x29')]=function(_0x5b87af,_0x29613a){var _0x5be8b7={},_0x322608={},_0x40a579={'count':0x0,'rows':[]};var _0x576557=_[_0xbe09('0x2a')](db[_0xbe09('0x2b')][_0xbe09('0x2c')],function(_0x3b946a){return{'name':_0x3b946a[_0xbe09('0x2d')],'type':_0x3b946a[_0xbe09('0x2e')][_0xbe09('0x2f')]};});_0x322608[_0xbe09('0x30')]=_[_0xbe09('0x2a')](_0x576557,_0xbe09('0x27'));_0x322608[_0xbe09('0x31')]=_[_0xbe09('0x32')](_0x5b87af[_0xbe09('0x31')]);_0x322608['filters']=_[_0xbe09('0x33')](_0x322608[_0xbe09('0x30')],_0x322608[_0xbe09('0x31')]);_0x5be8b7[_0xbe09('0x34')]=_[_0xbe09('0x33')](_0x322608['model'],qs[_0xbe09('0x35')](_0x5b87af[_0xbe09('0x31')]['fields']));_0x5be8b7[_0xbe09('0x34')]=_0x5be8b7[_0xbe09('0x34')][_0xbe09('0x36')]?_0x5be8b7[_0xbe09('0x34')]:_0x322608[_0xbe09('0x30')];if(!_0x5b87af[_0xbe09('0x31')][_0xbe09('0x37')](_0xbe09('0x38'))){_0x5be8b7[_0xbe09('0x39')]=qs[_0xbe09('0x39')](_0x5b87af['query'][_0xbe09('0x39')]);_0x5be8b7['offset']=qs[_0xbe09('0x1d')](_0x5b87af[_0xbe09('0x31')][_0xbe09('0x1d')]);}_0x5be8b7[_0xbe09('0x3a')]=qs['sort'](_0x5b87af[_0xbe09('0x31')][_0xbe09('0x3b')]);_0x5be8b7[_0xbe09('0x3c')]=qs[_0xbe09('0x3d')](_[_0xbe09('0x3e')](_0x5b87af[_0xbe09('0x31')],_0x322608['filters']));if(_0x5b87af[_0xbe09('0x31')][_0xbe09('0x3f')]){_0x5be8b7[_0xbe09('0x3c')]=_[_0xbe09('0x40')](_0x5be8b7['where'],{'$or':_[_0xbe09('0x2a')](_0x576557,function(_0x1195c8){if(_0x1195c8[_0xbe09('0x2e')]!==_0xbe09('0x41')){var _0x2583a6={};_0x2583a6[_0x1195c8[_0xbe09('0x27')]]={'$like':'%'+_0x5b87af[_0xbe09('0x31')][_0xbe09('0x3f')]+'%'};return _0x2583a6;}})});}_0x5be8b7=_[_0xbe09('0x40')]({},_0x5be8b7,_0x5b87af[_0xbe09('0x42')]);var _0x549ea5={'where':_0x5be8b7['where']};return db['Template'][_0xbe09('0x1c')](_0x549ea5)[_0xbe09('0x22')](function(_0x41990b){_0x40a579[_0xbe09('0x1c')]=_0x41990b;if(_0x5b87af[_0xbe09('0x31')][_0xbe09('0x43')]){_0x5be8b7[_0xbe09('0x44')]=[{'all':!![]}];}return db[_0xbe09('0x2b')][_0xbe09('0x45')](_0x5be8b7);})[_0xbe09('0x22')](function(_0x50dec2){_0x40a579[_0xbe09('0x46')]=_0x50dec2;return _0x40a579;})[_0xbe09('0x22')](respondWithFilteredResult(_0x29613a,_0x5be8b7))[_0xbe09('0x47')](handleError(_0x29613a,null));};exports[_0xbe09('0x48')]=function(_0x48d28c,_0x2121d1){var _0x3219e5={'raw':!![],'where':{'id':_0x48d28c[_0xbe09('0x49')]['id']}},_0x2ef1e8={};_0x2ef1e8['model']=_[_0xbe09('0x32')](db[_0xbe09('0x2b')][_0xbe09('0x2c')]);_0x2ef1e8[_0xbe09('0x31')]=_[_0xbe09('0x32')](_0x48d28c['query']);_0x2ef1e8[_0xbe09('0x3d')]=_['intersection'](_0x2ef1e8[_0xbe09('0x30')],_0x2ef1e8[_0xbe09('0x31')]);_0x3219e5[_0xbe09('0x34')]=_[_0xbe09('0x33')](_0x2ef1e8[_0xbe09('0x30')],qs[_0xbe09('0x35')](_0x48d28c[_0xbe09('0x31')][_0xbe09('0x35')]));_0x3219e5[_0xbe09('0x34')]=_0x3219e5['attributes'][_0xbe09('0x36')]?_0x3219e5[_0xbe09('0x34')]:_0x2ef1e8[_0xbe09('0x30')];if(_0x48d28c['query']['includeAll']){_0x3219e5[_0xbe09('0x44')]=[{'all':!![]}];}_0x3219e5=_[_0xbe09('0x40')]({},_0x3219e5,_0x48d28c[_0xbe09('0x42')]);return db['Template'][_0xbe09('0x4a')](_0x3219e5)[_0xbe09('0x22')](handleEntityNotFound(_0x2121d1,null))[_0xbe09('0x22')](respondWithResult(_0x2121d1,null))[_0xbe09('0x47')](handleError(_0x2121d1,null));};exports[_0xbe09('0x4b')]=function(_0x5beb48,_0x5348d4){return db['Template'][_0xbe09('0x4b')](_0x5beb48['body'],{})[_0xbe09('0x22')](function(_0x4f0766){var _0x4a6ef5=_0x5beb48[_0xbe09('0x4c')]['get']({'plain':!![]});if(!_0x4a6ef5)throw new Error(_0xbe09('0x4d'));if(_0x4a6ef5[_0xbe09('0x4e')]==='user'){var _0x1b6ba9=_0x4f0766[_0xbe09('0x4f')]({'plain':!![]});var _0x1a67d4=_0xbe09('0x24');return db['UserProfileSection'][_0xbe09('0x4a')]({'where':{'name':_0x1a67d4,'userProfileId':_0x4a6ef5[_0xbe09('0x50')]},'raw':!![]})['then'](function(_0x406173){if(_0x406173&&_0x406173[_0xbe09('0x51')]===0x0){return db[_0xbe09('0x25')][_0xbe09('0x4b')]({'name':_0x1b6ba9[_0xbe09('0x27')],'resourceId':_0x1b6ba9['id'],'type':_0x406173[_0xbe09('0x27')],'sectionId':_0x406173['id']},{})[_0xbe09('0x22')](function(){return _0x4f0766;});}else{return _0x4f0766;}})[_0xbe09('0x47')](function(_0x2daa2c){logger[_0xbe09('0x52')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2daa2c);throw _0x2daa2c;});}return _0x4f0766;})[_0xbe09('0x22')](respondWithResult(_0x5348d4,0xc9))[_0xbe09('0x47')](handleError(_0x5348d4,null));};exports['update']=function(_0x2c9ad0,_0x1f5f3d){if(_0x2c9ad0['body']['id']){delete _0x2c9ad0[_0xbe09('0x53')]['id'];}return db[_0xbe09('0x2b')][_0xbe09('0x4a')]({'where':{'id':_0x2c9ad0['params']['id']}})[_0xbe09('0x22')](handleEntityNotFound(_0x1f5f3d,null))['then'](saveUpdates(_0x2c9ad0[_0xbe09('0x53')],null))['then'](respondWithResult(_0x1f5f3d,null))[_0xbe09('0x47')](handleError(_0x1f5f3d,null));};exports[_0xbe09('0x23')]=function(_0x42daab,_0x495e75){return db[_0xbe09('0x2b')][_0xbe09('0x4a')]({'where':{'id':_0x42daab[_0xbe09('0x49')]['id']}})[_0xbe09('0x22')](handleEntityNotFound(_0x495e75,null))[_0xbe09('0x22')](removeEntity(_0x495e75,null))[_0xbe09('0x47')](handleError(_0x495e75,null));}; \ No newline at end of file +var _0x2843=['crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','get','Templates','destroy','error','name','Template','fieldName','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','pick','filter','where','type','VIRTUAL','options','includeAll','findAll','rows','catch','params','rawAttributes','length','include','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash'];(function(_0x5e01ec,_0x2377fd){var _0x41a55b=function(_0x1e06e2){while(--_0x1e06e2){_0x5e01ec['push'](_0x5e01ec['shift']());}};_0x41a55b(++_0x2377fd);}(_0x2843,0x94));var _0x3284=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2843[_0xb0f7c3];return _0x28ea68;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3284('0x0'));var zipdir=require(_0x3284('0x1'));var jsonpatch=require(_0x3284('0x2'));var rp=require(_0x3284('0x3'));var moment=require(_0x3284('0x4'));var BPromise=require(_0x3284('0x5'));var Mustache=require(_0x3284('0x6'));var util=require(_0x3284('0x7'));var path=require(_0x3284('0x8'));var sox=require(_0x3284('0x9'));var csv=require('to-csv');var ejs=require(_0x3284('0xa'));var fs=require('fs');var _=require(_0x3284('0xb'));var squel=require('squel');var crypto=require(_0x3284('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x3284('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3284('0xe'));var Papa=require(_0x3284('0xf'));var Redis=require(_0x3284('0x10'));var authService=require(_0x3284('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x3284('0x12'));var hardwareService=require(_0x3284('0x13'));var logger=require(_0x3284('0x14'))(_0x3284('0x15'));var utils=require(_0x3284('0x16'));var config=require(_0x3284('0x17'));var db=require(_0x3284('0x18'))['db'];function respondWithStatusCode(_0x1d17ef,_0x57eac2){_0x57eac2=_0x57eac2||0xcc;return function(_0x373ab2){if(_0x373ab2){return _0x1d17ef[_0x3284('0x19')](_0x57eac2);}return _0x1d17ef[_0x3284('0x1a')](_0x57eac2)[_0x3284('0x1b')]();};}function respondWithResult(_0x547701,_0x10b420){_0x10b420=_0x10b420||0xc8;return function(_0x300e34){if(_0x300e34){return _0x547701[_0x3284('0x1a')](_0x10b420)[_0x3284('0x1c')](_0x300e34);}};}function respondWithFilteredResult(_0xb4d8d1,_0x56bb21){return function(_0x510032){if(_0x510032){var _0x41c8ec=_0x510032[_0x3284('0x1d')],_0x4736c9=_0x56bb21[_0x3284('0x1e')],_0x54c50b=_0x56bb21[_0x3284('0x1e')]+_0x56bb21[_0x3284('0x1f')],_0xe5ba6a;if(_0x54c50b>=_0x41c8ec){_0x54c50b=_0x41c8ec;_0xe5ba6a=0xc8;}else{_0xe5ba6a=0xce;}_0xb4d8d1[_0x3284('0x1a')](_0xe5ba6a);return _0xb4d8d1[_0x3284('0x20')]('Content-Range',_0x4736c9+'-'+_0x54c50b+'/'+_0x41c8ec)[_0x3284('0x1c')](_0x510032);}return null;};}function patchUpdates(_0x29c2ea){return function(_0x50b39d){try{jsonpatch[_0x3284('0x21')](_0x50b39d,_0x29c2ea,!![]);}catch(_0x2aa61a){return BPromise['reject'](_0x2aa61a);}return _0x50b39d[_0x3284('0x22')]();};}function saveUpdates(_0x125504,_0x43d27e){return function(_0x743da0){if(_0x743da0){return _0x743da0[_0x3284('0x23')](_0x125504)[_0x3284('0x24')](function(_0x4df9f2){return _0x4df9f2;});}return null;};}function removeEntity(_0x77efce,_0x4f7106){return function(_0x38382a){if(_0x38382a){return _0x38382a['destroy']()[_0x3284('0x24')](function(){var _0x463f2f=_0x38382a[_0x3284('0x25')]({'plain':!![]});var _0x17a53a=_0x3284('0x26');return db['UserProfileResource'][_0x3284('0x27')]({'where':{'type':_0x17a53a,'resourceId':_0x463f2f['id']}})[_0x3284('0x24')](function(){return _0x38382a;});})[_0x3284('0x24')](function(){_0x77efce['status'](0xcc)[_0x3284('0x1b')]();});}};}function handleEntityNotFound(_0x1fcdb5,_0x50eece){return function(_0x360971){if(!_0x360971){_0x1fcdb5[_0x3284('0x19')](0x194);}return _0x360971;};}function handleError(_0x1c9501,_0x3c0ca5){_0x3c0ca5=_0x3c0ca5||0x1f4;return function(_0x294202){logger[_0x3284('0x28')](_0x294202['stack']);if(_0x294202[_0x3284('0x29')]){delete _0x294202[_0x3284('0x29')];}_0x1c9501[_0x3284('0x1a')](_0x3c0ca5)['send'](_0x294202);};}exports['index']=function(_0xecfd01,_0x2d801a){var _0x37540a={},_0x411f6e={},_0x23c9af={'count':0x0,'rows':[]};var _0x4f2892=_['map'](db[_0x3284('0x2a')]['rawAttributes'],function(_0x5a18a2){return{'name':_0x5a18a2[_0x3284('0x2b')],'type':_0x5a18a2['type'][_0x3284('0x2c')]};});_0x411f6e[_0x3284('0x2d')]=_[_0x3284('0x2e')](_0x4f2892,_0x3284('0x29'));_0x411f6e[_0x3284('0x2f')]=_[_0x3284('0x30')](_0xecfd01[_0x3284('0x2f')]);_0x411f6e[_0x3284('0x31')]=_[_0x3284('0x32')](_0x411f6e[_0x3284('0x2d')],_0x411f6e[_0x3284('0x2f')]);_0x37540a[_0x3284('0x33')]=_[_0x3284('0x32')](_0x411f6e[_0x3284('0x2d')],qs[_0x3284('0x34')](_0xecfd01[_0x3284('0x2f')][_0x3284('0x34')]));_0x37540a['attributes']=_0x37540a[_0x3284('0x33')]['length']?_0x37540a['attributes']:_0x411f6e[_0x3284('0x2d')];if(!_0xecfd01[_0x3284('0x2f')][_0x3284('0x35')](_0x3284('0x36'))){_0x37540a['limit']=qs[_0x3284('0x1f')](_0xecfd01[_0x3284('0x2f')][_0x3284('0x1f')]);_0x37540a[_0x3284('0x1e')]=qs['offset'](_0xecfd01['query'][_0x3284('0x1e')]);}_0x37540a['order']=qs[_0x3284('0x37')](_0xecfd01[_0x3284('0x2f')][_0x3284('0x37')]);_0x37540a['where']=qs[_0x3284('0x31')](_[_0x3284('0x38')](_0xecfd01[_0x3284('0x2f')],_0x411f6e[_0x3284('0x31')]));if(_0xecfd01['query'][_0x3284('0x39')]){_0x37540a['where']=_['merge'](_0x37540a[_0x3284('0x3a')],{'$or':_[_0x3284('0x2e')](_0x4f2892,function(_0x52283b){if(_0x52283b[_0x3284('0x3b')]!==_0x3284('0x3c')){var _0x11ab01={};_0x11ab01[_0x52283b['name']]={'$like':'%'+_0xecfd01[_0x3284('0x2f')][_0x3284('0x39')]+'%'};return _0x11ab01;}})});}_0x37540a=_['merge']({},_0x37540a,_0xecfd01[_0x3284('0x3d')]);var _0x3e10cf={'where':_0x37540a[_0x3284('0x3a')]};return db[_0x3284('0x2a')][_0x3284('0x1d')](_0x3e10cf)['then'](function(_0x345a90){_0x23c9af['count']=_0x345a90;if(_0xecfd01[_0x3284('0x2f')][_0x3284('0x3e')]){_0x37540a['include']=[{'all':!![]}];}return db[_0x3284('0x2a')][_0x3284('0x3f')](_0x37540a);})[_0x3284('0x24')](function(_0xd8b06d){_0x23c9af[_0x3284('0x40')]=_0xd8b06d;return _0x23c9af;})[_0x3284('0x24')](respondWithFilteredResult(_0x2d801a,_0x37540a))[_0x3284('0x41')](handleError(_0x2d801a,null));};exports['show']=function(_0x9edc2,_0x4a01b0){var _0x6ca2bf={'raw':!![],'where':{'id':_0x9edc2[_0x3284('0x42')]['id']}},_0x57066d={};_0x57066d[_0x3284('0x2d')]=_[_0x3284('0x30')](db[_0x3284('0x2a')][_0x3284('0x43')]);_0x57066d[_0x3284('0x2f')]=_['keys'](_0x9edc2['query']);_0x57066d['filters']=_[_0x3284('0x32')](_0x57066d[_0x3284('0x2d')],_0x57066d[_0x3284('0x2f')]);_0x6ca2bf[_0x3284('0x33')]=_[_0x3284('0x32')](_0x57066d[_0x3284('0x2d')],qs[_0x3284('0x34')](_0x9edc2['query'][_0x3284('0x34')]));_0x6ca2bf[_0x3284('0x33')]=_0x6ca2bf[_0x3284('0x33')][_0x3284('0x44')]?_0x6ca2bf['attributes']:_0x57066d[_0x3284('0x2d')];if(_0x9edc2['query'][_0x3284('0x3e')]){_0x6ca2bf[_0x3284('0x45')]=[{'all':!![]}];}_0x6ca2bf=_[_0x3284('0x46')]({},_0x6ca2bf,_0x9edc2['options']);return db[_0x3284('0x2a')][_0x3284('0x47')](_0x6ca2bf)[_0x3284('0x24')](handleEntityNotFound(_0x4a01b0,null))[_0x3284('0x24')](respondWithResult(_0x4a01b0,null))[_0x3284('0x41')](handleError(_0x4a01b0,null));};exports[_0x3284('0x48')]=function(_0x3b6a79,_0x299a73){return db[_0x3284('0x2a')][_0x3284('0x48')](_0x3b6a79[_0x3284('0x49')],{})['then'](function(_0x58017a){var _0x2125df=_0x3b6a79[_0x3284('0x4a')][_0x3284('0x25')]({'plain':!![]});if(!_0x2125df)throw new Error(_0x3284('0x4b'));if(_0x2125df[_0x3284('0x4c')]==='user'){var _0x36869a=_0x58017a[_0x3284('0x25')]({'plain':!![]});var _0x4b0e85='Templates';return db[_0x3284('0x4d')][_0x3284('0x47')]({'where':{'name':_0x4b0e85,'userProfileId':_0x2125df['userProfileId']},'raw':!![]})[_0x3284('0x24')](function(_0x1334aa){if(_0x1334aa&&_0x1334aa['autoAssociation']===0x0){return db[_0x3284('0x4e')][_0x3284('0x48')]({'name':_0x36869a[_0x3284('0x29')],'resourceId':_0x36869a['id'],'type':_0x1334aa['name'],'sectionId':_0x1334aa['id']},{})[_0x3284('0x24')](function(){return _0x58017a;});}else{return _0x58017a;}})[_0x3284('0x41')](function(_0x74e078){logger[_0x3284('0x28')](_0x3284('0x4f'),_0x74e078);throw _0x74e078;});}return _0x58017a;})['then'](respondWithResult(_0x299a73,0xc9))[_0x3284('0x41')](handleError(_0x299a73,null));};exports[_0x3284('0x23')]=function(_0x63adad,_0x54c0a0){if(_0x63adad[_0x3284('0x49')]['id']){delete _0x63adad[_0x3284('0x49')]['id'];}return db['Template'][_0x3284('0x47')]({'where':{'id':_0x63adad['params']['id']}})[_0x3284('0x24')](handleEntityNotFound(_0x54c0a0,null))['then'](saveUpdates(_0x63adad[_0x3284('0x49')],null))['then'](respondWithResult(_0x54c0a0,null))[_0x3284('0x41')](handleError(_0x54c0a0,null));};exports[_0x3284('0x27')]=function(_0x14ce2f,_0x1d58f8){return db[_0x3284('0x2a')][_0x3284('0x47')]({'where':{'id':_0x14ce2f[_0x3284('0x42')]['id']}})[_0x3284('0x24')](handleEntityNotFound(_0x1d58f8,null))[_0x3284('0x24')](removeEntity(_0x1d58f8,null))[_0x3284('0x41')](handleError(_0x1d58f8,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 08306ac..62f32b9 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 _0x5831=['request-promise','path','../../config/environment','./template.attributes','exports','define','tools_templates','lodash','util','../../config/logger','api','moment'];(function(_0x375492,_0x4ed149){var _0x18ba5b=function(_0x154a12){while(--_0x154a12){_0x375492['push'](_0x375492['shift']());}};_0x18ba5b(++_0x4ed149);}(_0x5831,0x11b));var _0x1583=function(_0x479f47,_0x3d619a){_0x479f47=_0x479f47-0x0;var _0xc3fac2=_0x5831[_0x479f47];return _0xc3fac2;};'use strict';var _=require(_0x1583('0x0'));var util=require(_0x1583('0x1'));var logger=require(_0x1583('0x2'))(_0x1583('0x3'));var moment=require(_0x1583('0x4'));var BPromise=require('bluebird');var rp=require(_0x1583('0x5'));var fs=require('fs');var path=require(_0x1583('0x6'));var rimraf=require('rimraf');var config=require(_0x1583('0x7'));var attributes=require(_0x1583('0x8'));module[_0x1583('0x9')]=function(_0x3ec467,_0x219435){return _0x3ec467[_0x1583('0xa')]('Template',attributes,{'tableName':_0x1583('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fba=['request-promise','path','rimraf','./template.attributes','exports','define','Template','lodash','util','../../config/logger','api','moment'];(function(_0x1cc8ca,_0x58b7f8){var _0x540006=function(_0x57283d){while(--_0x57283d){_0x1cc8ca['push'](_0x1cc8ca['shift']());}};_0x540006(++_0x58b7f8);}(_0x5fba,0x1cf));var _0xa5fb=function(_0x546bb2,_0xc674ab){_0x546bb2=_0x546bb2-0x0;var _0x355fec=_0x5fba[_0x546bb2];return _0x355fec;};'use strict';var _=require(_0xa5fb('0x0'));var util=require(_0xa5fb('0x1'));var logger=require(_0xa5fb('0x2'))(_0xa5fb('0x3'));var moment=require(_0xa5fb('0x4'));var BPromise=require('bluebird');var rp=require(_0xa5fb('0x5'));var fs=require('fs');var path=require(_0xa5fb('0x6'));var rimraf=require(_0xa5fb('0x7'));var config=require('../../config/environment');var attributes=require(_0xa5fb('0x8'));module[_0xa5fb('0x9')]=function(_0x5bc283,_0x29d9c2){return _0x5bc283[_0xa5fb('0xa')](_0xa5fb('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 8051ce9..b7ac383 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 _0x7c2e=['catch','findAll','options','raw','where','attributes','limit','include','map','model','GetTemplate','stringify','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','Template,\x20%s,\x20%s','message','result'];(function(_0x1a9f8b,_0x53ac1b){var _0x12a2c1=function(_0x1123fb){while(--_0x1123fb){_0x1a9f8b['push'](_0x1a9f8b['shift']());}};_0x12a2c1(++_0x53ac1b);}(_0x7c2e,0x1e8));var _0xe7c2=function(_0x1bd159,_0x184032){_0x1bd159=_0x1bd159-0x0;var _0x24c118=_0x7c2e[_0x1bd159];return _0x24c118;};'use strict';var _=require(_0xe7c2('0x0'));var util=require('util');var moment=require(_0xe7c2('0x1'));var BPromise=require('bluebird');var rs=require(_0xe7c2('0x2'));var fs=require('fs');var Redis=require(_0xe7c2('0x3'));var db=require(_0xe7c2('0x4'))['db'];var utils=require(_0xe7c2('0x5'));var logger=require(_0xe7c2('0x6'))('rpc');var config=require(_0xe7c2('0x7'));var jayson=require(_0xe7c2('0x8'));var client=jayson[_0xe7c2('0x9')][_0xe7c2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x478b74,_0x5c042d,_0x1beef2){return new BPromise(function(_0x42656b,_0xb45caf){return client[_0xe7c2('0xb')](_0x478b74,_0x1beef2)[_0xe7c2('0xc')](function(_0x5def87){logger[_0xe7c2('0xd')]('Template,\x20%s,\x20%s',_0x5c042d,_0xe7c2('0xe'));logger[_0xe7c2('0xf')](_0xe7c2('0x10'),_0x5c042d,_0xe7c2('0xe'),JSON['stringify'](_0x5def87));if(_0x5def87[_0xe7c2('0x11')]){if(_0x5def87[_0xe7c2('0x11')][_0xe7c2('0x12')]===0x1f4){logger[_0xe7c2('0x11')](_0xe7c2('0x13'),_0x5c042d,_0x5def87[_0xe7c2('0x11')]['message']);return _0xb45caf(_0x5def87[_0xe7c2('0x11')]['message']);}logger[_0xe7c2('0x11')](_0xe7c2('0x13'),_0x5c042d,_0x5def87['error'][_0xe7c2('0x14')]);return _0x42656b(_0x5def87[_0xe7c2('0x11')][_0xe7c2('0x14')]);}else{logger[_0xe7c2('0xd')](_0xe7c2('0x13'),_0x5c042d,_0xe7c2('0xe'));_0x42656b(_0x5def87[_0xe7c2('0x15')][_0xe7c2('0x14')]);}})[_0xe7c2('0x16')](function(_0xceb8eb){logger[_0xe7c2('0x11')](_0xe7c2('0x13'),_0x5c042d,_0xceb8eb);_0xb45caf(_0xceb8eb);});});}exports['GetTemplate']=function(_0x2554f7){var _0x3cee0f=this;return new Promise(function(_0x5e4f6e,_0xdb2192){return db['Template'][_0xe7c2('0x17')]({'raw':_0x2554f7['options']?_0x2554f7[_0xe7c2('0x18')][_0xe7c2('0x19')]===undefined?!![]:![]:!![],'where':_0x2554f7[_0xe7c2('0x18')]?_0x2554f7[_0xe7c2('0x18')][_0xe7c2('0x1a')]||null:null,'attributes':_0x2554f7[_0xe7c2('0x18')]?_0x2554f7[_0xe7c2('0x18')][_0xe7c2('0x1b')]||null:null,'limit':_0x2554f7[_0xe7c2('0x18')]?_0x2554f7['options'][_0xe7c2('0x1c')]||null:null,'include':_0x2554f7[_0xe7c2('0x18')]?_0x2554f7['options'][_0xe7c2('0x1d')]?_['map'](_0x2554f7['options'][_0xe7c2('0x1d')],function(_0x5be918){return{'model':db[_0x5be918['model']],'as':_0x5be918['as'],'attributes':_0x5be918[_0xe7c2('0x1b')],'include':_0x5be918[_0xe7c2('0x1d')]?_[_0xe7c2('0x1e')](_0x5be918[_0xe7c2('0x1d')],function(_0xe32f39){return{'model':db[_0xe32f39[_0xe7c2('0x1f')]],'as':_0xe32f39['as'],'attributes':_0xe32f39['attributes'],'include':_0xe32f39[_0xe7c2('0x1d')]?_[_0xe7c2('0x1e')](_0xe32f39[_0xe7c2('0x1d')],function(_0x3cc8a5){return{'model':db[_0x3cc8a5[_0xe7c2('0x1f')]],'as':_0x3cc8a5['as'],'attributes':_0x3cc8a5[_0xe7c2('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d81dc){logger[_0xe7c2('0xd')](_0xe7c2('0x20'),_0x2554f7);logger[_0xe7c2('0xf')]('GetTemplate',_0x2554f7,JSON[_0xe7c2('0x21')](_0x2d81dc));_0x5e4f6e(_0x2d81dc);})[_0xe7c2('0x16')](function(_0x5eab28){logger['error'](_0xe7c2('0x20'),_0x5eab28['message'],_0x2554f7);_0xdb2192(_0x3cee0f[_0xe7c2('0x11')](0x1f4,_0x5eab28[_0xe7c2('0x14')]));});});}; \ No newline at end of file +var _0x7176=['error','code','message','info','request\x20sent','catch','GetTemplate','Template','options','raw','where','limit','include','map','attributes','model','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Template,\x20%s,\x20%s','debug','Template,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x39e44b,_0x70b6fd){var _0x3a5a3f=function(_0x469caa){while(--_0x469caa){_0x39e44b['push'](_0x39e44b['shift']());}};_0x3a5a3f(++_0x70b6fd);}(_0x7176,0x76));var _0x6717=function(_0x43adb6,_0x3a1801){_0x43adb6=_0x43adb6-0x0;var _0x5d2c92=_0x7176[_0x43adb6];return _0x5d2c92;};'use strict';var _=require(_0x6717('0x0'));var util=require(_0x6717('0x1'));var moment=require(_0x6717('0x2'));var BPromise=require(_0x6717('0x3'));var rs=require(_0x6717('0x4'));var fs=require('fs');var Redis=require(_0x6717('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6717('0x6'));var logger=require('../../config/logger')(_0x6717('0x7'));var config=require(_0x6717('0x8'));var jayson=require(_0x6717('0x9'));var client=jayson[_0x6717('0xa')][_0x6717('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x36174a,_0x9a9111,_0x15f10c){return new BPromise(function(_0x11abd7,_0x37362d){return client[_0x6717('0xc')](_0x36174a,_0x15f10c)[_0x6717('0xd')](function(_0x140a14){logger['info'](_0x6717('0xe'),_0x9a9111,'request\x20sent');logger[_0x6717('0xf')](_0x6717('0x10'),_0x9a9111,'request\x20sent',JSON[_0x6717('0x11')](_0x140a14));if(_0x140a14[_0x6717('0x12')]){if(_0x140a14['error'][_0x6717('0x13')]===0x1f4){logger[_0x6717('0x12')](_0x6717('0xe'),_0x9a9111,_0x140a14[_0x6717('0x12')][_0x6717('0x14')]);return _0x37362d(_0x140a14[_0x6717('0x12')][_0x6717('0x14')]);}logger['error'](_0x6717('0xe'),_0x9a9111,_0x140a14[_0x6717('0x12')][_0x6717('0x14')]);return _0x11abd7(_0x140a14[_0x6717('0x12')][_0x6717('0x14')]);}else{logger[_0x6717('0x15')](_0x6717('0xe'),_0x9a9111,_0x6717('0x16'));_0x11abd7(_0x140a14['result'][_0x6717('0x14')]);}})[_0x6717('0x17')](function(_0x319069){logger['error']('Template,\x20%s,\x20%s',_0x9a9111,_0x319069);_0x37362d(_0x319069);});});}exports[_0x6717('0x18')]=function(_0x52139b){var _0x17931d=this;return new Promise(function(_0xa2aa2f,_0x79aebe){return db[_0x6717('0x19')]['findAll']({'raw':_0x52139b['options']?_0x52139b[_0x6717('0x1a')][_0x6717('0x1b')]===undefined?!![]:![]:!![],'where':_0x52139b['options']?_0x52139b[_0x6717('0x1a')][_0x6717('0x1c')]||null:null,'attributes':_0x52139b[_0x6717('0x1a')]?_0x52139b[_0x6717('0x1a')]['attributes']||null:null,'limit':_0x52139b[_0x6717('0x1a')]?_0x52139b[_0x6717('0x1a')][_0x6717('0x1d')]||null:null,'include':_0x52139b[_0x6717('0x1a')]?_0x52139b[_0x6717('0x1a')][_0x6717('0x1e')]?_[_0x6717('0x1f')](_0x52139b['options'][_0x6717('0x1e')],function(_0x2c8546){return{'model':db[_0x2c8546['model']],'as':_0x2c8546['as'],'attributes':_0x2c8546[_0x6717('0x20')],'include':_0x2c8546['include']?_[_0x6717('0x1f')](_0x2c8546[_0x6717('0x1e')],function(_0x4ed1bd){return{'model':db[_0x4ed1bd['model']],'as':_0x4ed1bd['as'],'attributes':_0x4ed1bd['attributes'],'include':_0x4ed1bd[_0x6717('0x1e')]?_['map'](_0x4ed1bd[_0x6717('0x1e')],function(_0x3991e6){return{'model':db[_0x3991e6[_0x6717('0x21')]],'as':_0x3991e6['as'],'attributes':_0x3991e6[_0x6717('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44173f){logger[_0x6717('0x15')](_0x6717('0x18'),_0x52139b);logger[_0x6717('0xf')]('GetTemplate',_0x52139b,JSON[_0x6717('0x11')](_0x44173f));_0xa2aa2f(_0x44173f);})[_0x6717('0x17')](function(_0x1fe32f){logger[_0x6717('0x12')](_0x6717('0x18'),_0x1fe32f['message'],_0x52139b);_0x79aebe(_0x17931d[_0x6717('0x12')](0x1f4,_0x1fe32f[_0x6717('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 6d42933..5041f48 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 _0x7f14=['getActions','post','create','addAnyCondition','addAction','put','update','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./trigger.controller','isAuthenticated','index','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x49ae23,_0x157fbd){var _0x1a10d9=function(_0x4590e3){while(--_0x4590e3){_0x49ae23['push'](_0x49ae23['shift']());}};_0x1a10d9(++_0x157fbd);}(_0x7f14,0x6b));var _0x47f1=function(_0x25a766,_0x489224){_0x25a766=_0x25a766-0x0;var _0x11ecf3=_0x7f14[_0x25a766];return _0x11ecf3;};'use strict';var multer=require(_0x47f1('0x0'));var util=require(_0x47f1('0x1'));var path=require(_0x47f1('0x2'));var timeout=require('connect-timeout');var express=require(_0x47f1('0x3'));var router=express[_0x47f1('0x4')]();var auth=require(_0x47f1('0x5'));var interaction=require(_0x47f1('0x6'));var config=require('../../config/environment');var controller=require(_0x47f1('0x7'));router['get']('/',auth[_0x47f1('0x8')](),controller[_0x47f1('0x9')]);router[_0x47f1('0xa')](_0x47f1('0xb'),auth[_0x47f1('0x8')](),controller[_0x47f1('0xc')]);router[_0x47f1('0xa')](_0x47f1('0xd'),auth[_0x47f1('0x8')](),controller[_0x47f1('0xe')]);router['get'](_0x47f1('0xf'),auth[_0x47f1('0x8')](),controller[_0x47f1('0x10')]);router[_0x47f1('0xa')](_0x47f1('0x11'),auth[_0x47f1('0x8')](),controller[_0x47f1('0x12')]);router[_0x47f1('0x13')]('/',auth['isAuthenticated'](),controller[_0x47f1('0x14')]);router[_0x47f1('0x13')]('/:id/all_conditions',auth[_0x47f1('0x8')](),controller['addAllCondition']);router[_0x47f1('0x13')]('/:id/any_conditions',auth[_0x47f1('0x8')](),controller[_0x47f1('0x15')]);router['post'](_0x47f1('0x11'),auth[_0x47f1('0x8')](),controller[_0x47f1('0x16')]);router[_0x47f1('0x17')](_0x47f1('0xb'),auth['isAuthenticated'](),controller[_0x47f1('0x18')]);router['delete'](_0x47f1('0xb'),auth[_0x47f1('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1927=['get','getAnyConditions','/:id/actions','getActions','post','create','addAllCondition','/:id/any_conditions','addAction','update','delete','destroy','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','index','/:id','show','/:id/all_conditions','getAllConditions'];(function(_0x501105,_0x1efe72){var _0x45c89f=function(_0xd5f096){while(--_0xd5f096){_0x501105['push'](_0x501105['shift']());}};_0x45c89f(++_0x1efe72);}(_0x1927,0x183));var _0x7192=function(_0x208f91,_0x8131c9){_0x208f91=_0x208f91-0x0;var _0xfc5b7f=_0x1927[_0x208f91];return _0xfc5b7f;};'use strict';var multer=require(_0x7192('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7192('0x1'));var express=require(_0x7192('0x2'));var router=express[_0x7192('0x3')]();var auth=require(_0x7192('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7192('0x5'));var controller=require(_0x7192('0x6'));router['get']('/',auth[_0x7192('0x7')](),controller[_0x7192('0x8')]);router['get'](_0x7192('0x9'),auth[_0x7192('0x7')](),controller[_0x7192('0xa')]);router['get'](_0x7192('0xb'),auth[_0x7192('0x7')](),controller[_0x7192('0xc')]);router[_0x7192('0xd')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0x7192('0xe')]);router['get'](_0x7192('0xf'),auth[_0x7192('0x7')](),controller[_0x7192('0x10')]);router[_0x7192('0x11')]('/',auth['isAuthenticated'](),controller[_0x7192('0x12')]);router[_0x7192('0x11')](_0x7192('0xb'),auth[_0x7192('0x7')](),controller[_0x7192('0x13')]);router[_0x7192('0x11')](_0x7192('0x14'),auth[_0x7192('0x7')](),controller['addAnyCondition']);router[_0x7192('0x11')](_0x7192('0xf'),auth[_0x7192('0x7')](),controller[_0x7192('0x15')]);router['put']('/:id',auth[_0x7192('0x7')](),controller[_0x7192('0x16')]);router[_0x7192('0x17')](_0x7192('0x9'),auth[_0x7192('0x7')](),controller[_0x7192('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b9a24fd..b7e8856 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 _0x331d=['BOOLEAN','sequelize','exports','STRING'];(function(_0x102f97,_0x5bda2f){var _0xd22058=function(_0x2ccc1f){while(--_0x2ccc1f){_0x102f97['push'](_0x102f97['shift']());}};_0xd22058(++_0x5bda2f);}(_0x331d,0x1a1));var _0xd331=function(_0x45b016,_0x21b0a2){_0x45b016=_0x45b016-0x0;var _0x4891d3=_0x331d[_0x45b016];return _0x4891d3;};'use strict';var Sequelize=require(_0xd331('0x0'));module[_0xd331('0x1')]={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xd331('0x2')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0xd331('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x84cd=['sequelize','exports','STRING','BOOLEAN'];(function(_0x1a22e7,_0xe4d078){var _0x35fb61=function(_0x48d990){while(--_0x48d990){_0x1a22e7['push'](_0x1a22e7['shift']());}};_0x35fb61(++_0xe4d078);}(_0x84cd,0x1c4));var _0xd84c=function(_0x125ffa,_0x2372f1){_0x125ffa=_0x125ffa-0x0;var _0x318977=_0x84cd[_0x125ffa];return _0x318977;};'use strict';var Sequelize=require(_0xd84c('0x0'));module[_0xd84c('0x1')]={'name':{'type':Sequelize[_0xd84c('0x2')]},'channel':{'type':Sequelize[_0xd84c('0x2')]},'description':{'type':Sequelize[_0xd84c('0x2')]},'status':{'type':Sequelize[_0xd84c('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index a114c9a..ee0b9ec 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 _0x29dd=['Action','getActions','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status','set','apply','reject','save','update','then','destroy','get','Triggers','UserProfileResource','name','index','map','Trigger','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','params','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','autoAssociation','error','body','addAllCondition','TriggerAllId','addAnyCondition','TriggerAnyId','Condition','getAllConditions','findOne','keys','pick','getAnyConditions','order','addAction','TriggerId'];(function(_0x5a8ae4,_0x3adb94){var _0x957ff7=function(_0x1b7d5d){while(--_0x1b7d5d){_0x5a8ae4['push'](_0x5a8ae4['shift']());}};_0x957ff7(++_0x3adb94);}(_0x29dd,0x1d3));var _0xd29d=function(_0x7b49c9,_0x3efca2){_0x7b49c9=_0x7b49c9-0x0;var _0x1c8370=_0x29dd[_0x7b49c9];return _0x1c8370;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd29d('0x0'));var rimraf=require(_0xd29d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd29d('0x2'));var rp=require(_0xd29d('0x3'));var moment=require(_0xd29d('0x4'));var BPromise=require(_0xd29d('0x5'));var Mustache=require('mustache');var util=require(_0xd29d('0x6'));var path=require(_0xd29d('0x7'));var sox=require(_0xd29d('0x8'));var csv=require(_0xd29d('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd29d('0xa'));var squel=require(_0xd29d('0xb'));var crypto=require(_0xd29d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd29d('0xd'));var toCsv=require(_0xd29d('0x9'));var querystring=require(_0xd29d('0xe'));var Papa=require(_0xd29d('0xf'));var Redis=require('ioredis');var authService=require(_0xd29d('0x10'));var qs=require(_0xd29d('0x11'));var as=require(_0xd29d('0x12'));var hardwareService=require(_0xd29d('0x13'));var logger=require('../../config/logger')(_0xd29d('0x14'));var utils=require(_0xd29d('0x15'));var config=require(_0xd29d('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c1b69,_0x2805fb){_0x2805fb=_0x2805fb||0xcc;return function(_0x17aa12){if(_0x17aa12){return _0x5c1b69[_0xd29d('0x17')](_0x2805fb);}return _0x5c1b69['status'](_0x2805fb)[_0xd29d('0x18')]();};}function respondWithResult(_0x33e8f1,_0x16ca04){_0x16ca04=_0x16ca04||0xc8;return function(_0x155731){if(_0x155731){return _0x33e8f1['status'](_0x16ca04)[_0xd29d('0x19')](_0x155731);}};}function respondWithFilteredResult(_0x5c229d,_0x4f74d6){return function(_0xb7a87){if(_0xb7a87){var _0x4c9eec=_0xb7a87[_0xd29d('0x1a')],_0x524833=_0x4f74d6[_0xd29d('0x1b')],_0x3c1371=_0x4f74d6[_0xd29d('0x1b')]+_0x4f74d6[_0xd29d('0x1c')],_0x50ee48;if(_0x3c1371>=_0x4c9eec){_0x3c1371=_0x4c9eec;_0x50ee48=0xc8;}else{_0x50ee48=0xce;}_0x5c229d[_0xd29d('0x1d')](_0x50ee48);return _0x5c229d[_0xd29d('0x1e')]('Content-Range',_0x524833+'-'+_0x3c1371+'/'+_0x4c9eec)[_0xd29d('0x19')](_0xb7a87);}return null;};}function patchUpdates(_0x323501){return function(_0xb9f49e){try{jsonpatch[_0xd29d('0x1f')](_0xb9f49e,_0x323501,!![]);}catch(_0x376b74){return BPromise[_0xd29d('0x20')](_0x376b74);}return _0xb9f49e[_0xd29d('0x21')]();};}function saveUpdates(_0x5b5db2,_0xb30c16){return function(_0x542c2){if(_0x542c2){return _0x542c2[_0xd29d('0x22')](_0x5b5db2)[_0xd29d('0x23')](function(_0x21350b){return _0x21350b;});}return null;};}function removeEntity(_0x5e7f86,_0x1371d3){return function(_0x23486c){if(_0x23486c){return _0x23486c[_0xd29d('0x24')]()[_0xd29d('0x23')](function(){var _0x306981=_0x23486c[_0xd29d('0x25')]({'plain':!![]});var _0x40725a=_0xd29d('0x26');return db[_0xd29d('0x27')][_0xd29d('0x24')]({'where':{'type':_0x40725a,'resourceId':_0x306981['id']}})[_0xd29d('0x23')](function(){return _0x23486c;});})['then'](function(){_0x5e7f86[_0xd29d('0x1d')](0xcc)[_0xd29d('0x18')]();});}};}function handleEntityNotFound(_0xc1b229,_0x55d73f){return function(_0x1e4fe7){if(!_0x1e4fe7){_0xc1b229[_0xd29d('0x17')](0x194);}return _0x1e4fe7;};}function handleError(_0x420f8a,_0x53ac5e){_0x53ac5e=_0x53ac5e||0x1f4;return function(_0x53bded){logger['error'](_0x53bded['stack']);if(_0x53bded[_0xd29d('0x28')]){delete _0x53bded[_0xd29d('0x28')];}_0x420f8a[_0xd29d('0x1d')](_0x53ac5e)['send'](_0x53bded);};}exports[_0xd29d('0x29')]=function(_0x1a762d,_0x47d212){var _0x466939={},_0x174b19={},_0x1d16aa={'count':0x0,'rows':[]};var _0x341344=_[_0xd29d('0x2a')](db[_0xd29d('0x2b')][_0xd29d('0x2c')],function(_0x5e4190){return{'name':_0x5e4190[_0xd29d('0x2d')],'type':_0x5e4190[_0xd29d('0x2e')][_0xd29d('0x2f')]};});_0x174b19[_0xd29d('0x30')]=_[_0xd29d('0x2a')](_0x341344,_0xd29d('0x28'));_0x174b19['query']=_['keys'](_0x1a762d[_0xd29d('0x31')]);_0x174b19[_0xd29d('0x32')]=_[_0xd29d('0x33')](_0x174b19[_0xd29d('0x30')],_0x174b19[_0xd29d('0x31')]);_0x466939[_0xd29d('0x34')]=_['intersection'](_0x174b19[_0xd29d('0x30')],qs[_0xd29d('0x35')](_0x1a762d[_0xd29d('0x31')][_0xd29d('0x35')]));_0x466939['attributes']=_0x466939[_0xd29d('0x34')][_0xd29d('0x36')]?_0x466939[_0xd29d('0x34')]:_0x174b19[_0xd29d('0x30')];if(!_0x1a762d[_0xd29d('0x31')][_0xd29d('0x37')](_0xd29d('0x38'))){_0x466939[_0xd29d('0x1c')]=qs[_0xd29d('0x1c')](_0x1a762d[_0xd29d('0x31')][_0xd29d('0x1c')]);_0x466939[_0xd29d('0x1b')]=qs[_0xd29d('0x1b')](_0x1a762d[_0xd29d('0x31')][_0xd29d('0x1b')]);}_0x466939['order']=qs[_0xd29d('0x39')](_0x1a762d[_0xd29d('0x31')][_0xd29d('0x39')]);_0x466939[_0xd29d('0x3a')]=qs[_0xd29d('0x32')](_['pick'](_0x1a762d[_0xd29d('0x31')],_0x174b19['filters']));if(_0x1a762d[_0xd29d('0x31')]['filter']){_0x466939['where']=_[_0xd29d('0x3b')](_0x466939[_0xd29d('0x3a')],{'$or':_[_0xd29d('0x2a')](_0x341344,function(_0x51cf70){if(_0x51cf70[_0xd29d('0x2e')]!==_0xd29d('0x3c')){var _0x130d75={};_0x130d75[_0x51cf70['name']]={'$like':'%'+_0x1a762d[_0xd29d('0x31')][_0xd29d('0x3d')]+'%'};return _0x130d75;}})});}_0x466939=_[_0xd29d('0x3b')]({},_0x466939,_0x1a762d[_0xd29d('0x3e')]);var _0x5e1a76={'where':_0x466939[_0xd29d('0x3a')]};return db[_0xd29d('0x2b')]['count'](_0x5e1a76)[_0xd29d('0x23')](function(_0x24e1bf){_0x1d16aa[_0xd29d('0x1a')]=_0x24e1bf;if(_0x1a762d['query'][_0xd29d('0x3f')]){_0x466939[_0xd29d('0x40')]=[{'all':!![]}];}return db[_0xd29d('0x2b')]['findAll'](_0x466939);})[_0xd29d('0x23')](function(_0x20e5ba){_0x1d16aa[_0xd29d('0x41')]=_0x20e5ba;return _0x1d16aa;})['then'](respondWithFilteredResult(_0x47d212,_0x466939))[_0xd29d('0x42')](handleError(_0x47d212,null));};exports[_0xd29d('0x43')]=function(_0x143a76,_0x2bc5d3){var _0x45af75={'raw':![],'where':{'id':_0x143a76[_0xd29d('0x44')]['id']}},_0x51e2b4={};_0x51e2b4[_0xd29d('0x30')]=_['keys'](db[_0xd29d('0x2b')]['rawAttributes']);_0x51e2b4[_0xd29d('0x31')]=_['keys'](_0x143a76[_0xd29d('0x31')]);_0x51e2b4['filters']=_[_0xd29d('0x33')](_0x51e2b4[_0xd29d('0x30')],_0x51e2b4[_0xd29d('0x31')]);_0x45af75['attributes']=_[_0xd29d('0x33')](_0x51e2b4[_0xd29d('0x30')],qs[_0xd29d('0x35')](_0x143a76[_0xd29d('0x31')][_0xd29d('0x35')]));_0x45af75[_0xd29d('0x34')]=_0x45af75[_0xd29d('0x34')][_0xd29d('0x36')]?_0x45af75[_0xd29d('0x34')]:_0x51e2b4['model'];if(_0x143a76[_0xd29d('0x31')][_0xd29d('0x3f')]){_0x45af75[_0xd29d('0x40')]=[{'all':!![]}];}_0x45af75=_['merge']({},_0x45af75,_0x143a76['options']);return db[_0xd29d('0x2b')]['find'](_0x45af75)[_0xd29d('0x23')](handleEntityNotFound(_0x2bc5d3,null))[_0xd29d('0x23')](respondWithResult(_0x2bc5d3,null))[_0xd29d('0x42')](handleError(_0x2bc5d3,null));};exports[_0xd29d('0x45')]=function(_0x4b80fc,_0x1d69ab){return db[_0xd29d('0x2b')][_0xd29d('0x45')](_0x4b80fc['body'],{})[_0xd29d('0x23')](function(_0x553a50){var _0x300951=_0x4b80fc[_0xd29d('0x46')][_0xd29d('0x25')]({'plain':!![]});if(!_0x300951)throw new Error(_0xd29d('0x47'));if(_0x300951[_0xd29d('0x48')]===_0xd29d('0x46')){var _0x2f84bb=_0x553a50[_0xd29d('0x25')]({'plain':!![]});var _0x1d8383='Triggers';return db[_0xd29d('0x49')][_0xd29d('0x4a')]({'where':{'name':_0x1d8383,'userProfileId':_0x300951['userProfileId']},'raw':!![]})[_0xd29d('0x23')](function(_0x3d6a76){if(_0x3d6a76&&_0x3d6a76[_0xd29d('0x4b')]===0x0){return db[_0xd29d('0x27')][_0xd29d('0x45')]({'name':_0x2f84bb[_0xd29d('0x28')],'resourceId':_0x2f84bb['id'],'type':_0x3d6a76[_0xd29d('0x28')],'sectionId':_0x3d6a76['id']},{})['then'](function(){return _0x553a50;});}else{return _0x553a50;}})[_0xd29d('0x42')](function(_0x45d375){logger[_0xd29d('0x4c')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x45d375);throw _0x45d375;});}return _0x553a50;})[_0xd29d('0x23')](respondWithResult(_0x1d69ab,0xc9))[_0xd29d('0x42')](handleError(_0x1d69ab,null));};exports[_0xd29d('0x22')]=function(_0x2c77e1,_0x135e63){if(_0x2c77e1['body']['id']){delete _0x2c77e1[_0xd29d('0x4d')]['id'];}return db['Trigger'][_0xd29d('0x4a')]({'where':{'id':_0x2c77e1['params']['id']}})[_0xd29d('0x23')](handleEntityNotFound(_0x135e63,null))[_0xd29d('0x23')](saveUpdates(_0x2c77e1[_0xd29d('0x4d')],null))[_0xd29d('0x23')](respondWithResult(_0x135e63,null))[_0xd29d('0x42')](handleError(_0x135e63,null));};exports['destroy']=function(_0x14434e,_0x56bbb4){return db[_0xd29d('0x2b')]['find']({'where':{'id':_0x14434e[_0xd29d('0x44')]['id']}})[_0xd29d('0x23')](handleEntityNotFound(_0x56bbb4,null))[_0xd29d('0x23')](removeEntity(_0x56bbb4,null))[_0xd29d('0x42')](handleError(_0x56bbb4,null));};exports[_0xd29d('0x4e')]=function(_0x1da0d5,_0x22d6b8,_0x514487){if(_0x1da0d5['body']['id']){delete _0x1da0d5[_0xd29d('0x4d')]['id'];}return db['Trigger'][_0xd29d('0x4a')]({'where':{'id':_0x1da0d5[_0xd29d('0x44')]['id']}})[_0xd29d('0x23')](handleEntityNotFound(_0x22d6b8,null))[_0xd29d('0x23')](function(_0x6fb4f8){if(_0x6fb4f8){_0x1da0d5[_0xd29d('0x4d')][_0xd29d('0x4f')]=_0x6fb4f8['id'];return db['Condition'][_0xd29d('0x45')](_0x1da0d5[_0xd29d('0x4d')]);}})['then'](respondWithResult(_0x22d6b8,null))[_0xd29d('0x42')](handleError(_0x22d6b8,null));};exports[_0xd29d('0x50')]=function(_0x23c54d,_0x4c40a5,_0x10f3ab){if(_0x23c54d[_0xd29d('0x4d')]['id']){delete _0x23c54d['body']['id'];}return db[_0xd29d('0x2b')][_0xd29d('0x4a')]({'where':{'id':_0x23c54d['params']['id']}})['then'](handleEntityNotFound(_0x4c40a5,null))['then'](function(_0xaf5565){if(_0xaf5565){_0x23c54d[_0xd29d('0x4d')][_0xd29d('0x51')]=_0xaf5565['id'];return db[_0xd29d('0x52')][_0xd29d('0x45')](_0x23c54d[_0xd29d('0x4d')]);}})[_0xd29d('0x23')](respondWithResult(_0x4c40a5,null))[_0xd29d('0x42')](handleError(_0x4c40a5,null));};exports[_0xd29d('0x53')]=function(_0x12c4cf,_0x15f7b3,_0x48b0bb){var _0x47ef4a={};var _0x2f07d3={};var _0xe4a513;var _0x3ffcb3;return db['Trigger'][_0xd29d('0x54')]({'where':{'id':_0x12c4cf[_0xd29d('0x44')]['id']}})[_0xd29d('0x23')](handleEntityNotFound(_0x15f7b3,null))[_0xd29d('0x23')](function(_0x31708d){if(_0x31708d){_0xe4a513=_0x31708d;_0x2f07d3['model']=_[_0xd29d('0x55')](db[_0xd29d('0x52')]['rawAttributes']);_0x2f07d3[_0xd29d('0x31')]=_[_0xd29d('0x55')](_0x12c4cf[_0xd29d('0x31')]);_0x2f07d3[_0xd29d('0x32')]=_[_0xd29d('0x33')](_0x2f07d3[_0xd29d('0x30')],_0x2f07d3['query']);_0x47ef4a[_0xd29d('0x34')]=_['intersection'](_0x2f07d3[_0xd29d('0x30')],qs[_0xd29d('0x35')](_0x12c4cf[_0xd29d('0x31')]['fields']));_0x47ef4a[_0xd29d('0x34')]=_0x47ef4a[_0xd29d('0x34')][_0xd29d('0x36')]?_0x47ef4a[_0xd29d('0x34')]:_0x2f07d3[_0xd29d('0x30')];_0x47ef4a['order']=qs['sort'](_0x12c4cf['query'][_0xd29d('0x39')]);_0x47ef4a['where']=qs[_0xd29d('0x32')](_[_0xd29d('0x56')](_0x12c4cf[_0xd29d('0x31')],_0x2f07d3[_0xd29d('0x32')]));if(_0x12c4cf[_0xd29d('0x31')][_0xd29d('0x3d')]){_0x47ef4a[_0xd29d('0x3a')]=_[_0xd29d('0x3b')](_0x47ef4a[_0xd29d('0x3a')],{'$or':_[_0xd29d('0x2a')](_0x47ef4a[_0xd29d('0x34')],function(_0x333d72){var _0x5035e3={};_0x5035e3[_0x333d72]={'$like':'%'+_0x12c4cf[_0xd29d('0x31')][_0xd29d('0x3d')]+'%'};return _0x5035e3;})});}_0x47ef4a=_['merge']({},_0x47ef4a,_0x12c4cf['options']);return _0xe4a513['getAllConditions'](_0x47ef4a);}})['then'](function(_0x12a8e8){if(_0x12a8e8){_0x3ffcb3=_0x12a8e8[_0xd29d('0x36')];if(!_0x12c4cf[_0xd29d('0x31')]['hasOwnProperty'](_0xd29d('0x38'))){_0x47ef4a[_0xd29d('0x1c')]=qs[_0xd29d('0x1c')](_0x12c4cf[_0xd29d('0x31')]['limit']);_0x47ef4a['offset']=qs[_0xd29d('0x1b')](_0x12c4cf['query'][_0xd29d('0x1b')]);}return _0xe4a513[_0xd29d('0x53')](_0x47ef4a);}})[_0xd29d('0x23')](function(_0x1efc2a){if(_0x1efc2a){return _0x1efc2a?{'count':_0x3ffcb3,'rows':_0x1efc2a}:null;}})[_0xd29d('0x23')](respondWithResult(_0x15f7b3,null))[_0xd29d('0x42')](handleError(_0x15f7b3,null));};exports[_0xd29d('0x57')]=function(_0x48e19d,_0x15b6ed,_0x5f3d54){var _0x578847={};var _0x562b51={};var _0x34ea4a;var _0x1470ad;return db[_0xd29d('0x2b')][_0xd29d('0x54')]({'where':{'id':_0x48e19d[_0xd29d('0x44')]['id']}})['then'](handleEntityNotFound(_0x15b6ed,null))[_0xd29d('0x23')](function(_0x40a6bc){if(_0x40a6bc){_0x34ea4a=_0x40a6bc;_0x562b51[_0xd29d('0x30')]=_['keys'](db[_0xd29d('0x52')][_0xd29d('0x2c')]);_0x562b51[_0xd29d('0x31')]=_[_0xd29d('0x55')](_0x48e19d[_0xd29d('0x31')]);_0x562b51[_0xd29d('0x32')]=_[_0xd29d('0x33')](_0x562b51[_0xd29d('0x30')],_0x562b51[_0xd29d('0x31')]);_0x578847[_0xd29d('0x34')]=_['intersection'](_0x562b51[_0xd29d('0x30')],qs[_0xd29d('0x35')](_0x48e19d[_0xd29d('0x31')][_0xd29d('0x35')]));_0x578847[_0xd29d('0x34')]=_0x578847[_0xd29d('0x34')][_0xd29d('0x36')]?_0x578847[_0xd29d('0x34')]:_0x562b51['model'];_0x578847[_0xd29d('0x58')]=qs[_0xd29d('0x39')](_0x48e19d['query']['sort']);_0x578847[_0xd29d('0x3a')]=qs[_0xd29d('0x32')](_['pick'](_0x48e19d['query'],_0x562b51['filters']));if(_0x48e19d[_0xd29d('0x31')][_0xd29d('0x3d')]){_0x578847[_0xd29d('0x3a')]=_[_0xd29d('0x3b')](_0x578847[_0xd29d('0x3a')],{'$or':_[_0xd29d('0x2a')](_0x578847[_0xd29d('0x34')],function(_0x2963c6){var _0x17adc5={};_0x17adc5[_0x2963c6]={'$like':'%'+_0x48e19d['query'][_0xd29d('0x3d')]+'%'};return _0x17adc5;})});}_0x578847=_['merge']({},_0x578847,_0x48e19d[_0xd29d('0x3e')]);return _0x34ea4a['getAnyConditions'](_0x578847);}})[_0xd29d('0x23')](function(_0x51a3a0){if(_0x51a3a0){_0x1470ad=_0x51a3a0['length'];if(!_0x48e19d[_0xd29d('0x31')]['hasOwnProperty'](_0xd29d('0x38'))){_0x578847[_0xd29d('0x1c')]=qs['limit'](_0x48e19d[_0xd29d('0x31')][_0xd29d('0x1c')]);_0x578847[_0xd29d('0x1b')]=qs[_0xd29d('0x1b')](_0x48e19d[_0xd29d('0x31')][_0xd29d('0x1b')]);}return _0x34ea4a['getAnyConditions'](_0x578847);}})[_0xd29d('0x23')](function(_0x258f9f){if(_0x258f9f){return _0x258f9f?{'count':_0x1470ad,'rows':_0x258f9f}:null;}})['then'](respondWithResult(_0x15b6ed,null))[_0xd29d('0x42')](handleError(_0x15b6ed,null));};exports[_0xd29d('0x59')]=function(_0x90b5f1,_0x1b91eb,_0xf335bb){if(_0x90b5f1['body']['id']){delete _0x90b5f1['body']['id'];}return db['Trigger'][_0xd29d('0x4a')]({'where':{'id':_0x90b5f1['params']['id']}})[_0xd29d('0x23')](handleEntityNotFound(_0x1b91eb,null))[_0xd29d('0x23')](function(_0x2957ca){if(_0x2957ca){_0x90b5f1[_0xd29d('0x4d')][_0xd29d('0x5a')]=_0x2957ca['id'];return db[_0xd29d('0x5b')][_0xd29d('0x45')](_0x90b5f1[_0xd29d('0x4d')]);}})[_0xd29d('0x23')](respondWithResult(_0x1b91eb,null))[_0xd29d('0x42')](handleError(_0x1b91eb,null));};exports[_0xd29d('0x5c')]=function(_0x2957d7,_0x192997,_0xcc9ba7){var _0x2e0d07={};var _0x7f129a={};var _0x4d046d;var _0x1b534b;return db[_0xd29d('0x2b')][_0xd29d('0x54')]({'where':{'id':_0x2957d7[_0xd29d('0x44')]['id']}})[_0xd29d('0x23')](handleEntityNotFound(_0x192997,null))[_0xd29d('0x23')](function(_0x209775){if(_0x209775){_0x4d046d=_0x209775;_0x7f129a[_0xd29d('0x30')]=_[_0xd29d('0x55')](db[_0xd29d('0x5b')][_0xd29d('0x2c')]);_0x7f129a[_0xd29d('0x31')]=_['keys'](_0x2957d7[_0xd29d('0x31')]);_0x7f129a[_0xd29d('0x32')]=_[_0xd29d('0x33')](_0x7f129a[_0xd29d('0x30')],_0x7f129a[_0xd29d('0x31')]);_0x2e0d07['attributes']=_[_0xd29d('0x33')](_0x7f129a[_0xd29d('0x30')],qs[_0xd29d('0x35')](_0x2957d7['query']['fields']));_0x2e0d07['attributes']=_0x2e0d07[_0xd29d('0x34')][_0xd29d('0x36')]?_0x2e0d07['attributes']:_0x7f129a[_0xd29d('0x30')];_0x2e0d07['order']=qs[_0xd29d('0x39')](_0x2957d7['query'][_0xd29d('0x39')]);_0x2e0d07[_0xd29d('0x3a')]=qs[_0xd29d('0x32')](_[_0xd29d('0x56')](_0x2957d7[_0xd29d('0x31')],_0x7f129a['filters']));if(_0x2957d7[_0xd29d('0x31')][_0xd29d('0x3d')]){_0x2e0d07[_0xd29d('0x3a')]=_[_0xd29d('0x3b')](_0x2e0d07['where'],{'$or':_[_0xd29d('0x2a')](_0x2e0d07[_0xd29d('0x34')],function(_0x525c1a){var _0x3a9cf1={};_0x3a9cf1[_0x525c1a]={'$like':'%'+_0x2957d7[_0xd29d('0x31')][_0xd29d('0x3d')]+'%'};return _0x3a9cf1;})});}_0x2e0d07=_[_0xd29d('0x3b')]({},_0x2e0d07,_0x2957d7[_0xd29d('0x3e')]);return _0x4d046d[_0xd29d('0x5c')](_0x2e0d07);}})[_0xd29d('0x23')](function(_0x18e9cb){if(_0x18e9cb){_0x1b534b=_0x18e9cb[_0xd29d('0x36')];if(!_0x2957d7[_0xd29d('0x31')][_0xd29d('0x37')](_0xd29d('0x38'))){_0x2e0d07[_0xd29d('0x1c')]=qs['limit'](_0x2957d7[_0xd29d('0x31')]['limit']);_0x2e0d07[_0xd29d('0x1b')]=qs[_0xd29d('0x1b')](_0x2957d7[_0xd29d('0x31')][_0xd29d('0x1b')]);}return _0x4d046d['getActions'](_0x2e0d07);}})['then'](function(_0xccbf74){if(_0xccbf74){return _0xccbf74?{'count':_0x1b534b,'rows':_0xccbf74}:null;}})[_0xd29d('0x23')](respondWithResult(_0x192997,null))[_0xd29d('0x42')](handleError(_0x192997,null));}; \ No newline at end of file +var _0xede7=['params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Triggers','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Condition','getAllConditions','sort','findOne','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','offset','json','apply','reject','update','then','get','destroy','end','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','where','filters','pick','filter','merge','Trigger','includeAll','include','findAll','rows','catch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xede7,0xcc));var _0x7ede=function(_0x28f4c2,_0x1479c4){_0x28f4c2=_0x28f4c2-0x0;var _0x12d573=_0xede7[_0x28f4c2];return _0x12d573;};'use strict';var pdf=require(_0x7ede('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7ede('0x1'));var zipdir=require(_0x7ede('0x2'));var jsonpatch=require(_0x7ede('0x3'));var rp=require(_0x7ede('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x7ede('0x5'));var util=require(_0x7ede('0x6'));var path=require(_0x7ede('0x7'));var sox=require(_0x7ede('0x8'));var csv=require('to-csv');var ejs=require(_0x7ede('0x9'));var fs=require('fs');var _=require(_0x7ede('0xa'));var squel=require('squel');var crypto=require(_0x7ede('0xb'));var jsforce=require(_0x7ede('0xc'));var deskjs=require(_0x7ede('0xd'));var toCsv=require(_0x7ede('0xe'));var querystring=require(_0x7ede('0xf'));var Papa=require(_0x7ede('0x10'));var Redis=require('ioredis');var authService=require(_0x7ede('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7ede('0x12'));var hardwareService=require(_0x7ede('0x13'));var logger=require(_0x7ede('0x14'))(_0x7ede('0x15'));var utils=require(_0x7ede('0x16'));var config=require('../../config/environment');var db=require(_0x7ede('0x17'))['db'];function respondWithStatusCode(_0x2153d7,_0x15bce9){_0x15bce9=_0x15bce9||0xcc;return function(_0x87f88d){if(_0x87f88d){return _0x2153d7[_0x7ede('0x18')](_0x15bce9);}return _0x2153d7[_0x7ede('0x19')](_0x15bce9)['end']();};}function respondWithResult(_0x17b12d,_0x3f3042){_0x3f3042=_0x3f3042||0xc8;return function(_0x477b4e){if(_0x477b4e){return _0x17b12d['status'](_0x3f3042)['json'](_0x477b4e);}};}function respondWithFilteredResult(_0xdac3ea,_0x297f7a){return function(_0x316489){if(_0x316489){var _0x3299bd=_0x316489[_0x7ede('0x1a')],_0x48e5fc=_0x297f7a[_0x7ede('0x1b')],_0x769cb7=_0x297f7a[_0x7ede('0x1b')]+_0x297f7a['limit'],_0x149c91;if(_0x769cb7>=_0x3299bd){_0x769cb7=_0x3299bd;_0x149c91=0xc8;}else{_0x149c91=0xce;}_0xdac3ea[_0x7ede('0x19')](_0x149c91);return _0xdac3ea['set']('Content-Range',_0x48e5fc+'-'+_0x769cb7+'/'+_0x3299bd)[_0x7ede('0x1c')](_0x316489);}return null;};}function patchUpdates(_0xee1adc){return function(_0x143aff){try{jsonpatch[_0x7ede('0x1d')](_0x143aff,_0xee1adc,!![]);}catch(_0x2cd950){return BPromise[_0x7ede('0x1e')](_0x2cd950);}return _0x143aff['save']();};}function saveUpdates(_0x3fb6ea,_0x13c9de){return function(_0x1f04e1){if(_0x1f04e1){return _0x1f04e1[_0x7ede('0x1f')](_0x3fb6ea)[_0x7ede('0x20')](function(_0x2e882f){return _0x2e882f;});}return null;};}function removeEntity(_0x337a5c,_0x5d18d1){return function(_0x2ff61b){if(_0x2ff61b){return _0x2ff61b['destroy']()[_0x7ede('0x20')](function(){var _0xbda4a5=_0x2ff61b[_0x7ede('0x21')]({'plain':!![]});var _0x3b35fd='Triggers';return db['UserProfileResource'][_0x7ede('0x22')]({'where':{'type':_0x3b35fd,'resourceId':_0xbda4a5['id']}})['then'](function(){return _0x2ff61b;});})[_0x7ede('0x20')](function(){_0x337a5c[_0x7ede('0x19')](0xcc)[_0x7ede('0x23')]();});}};}function handleEntityNotFound(_0x4a2d21,_0x4d9dde){return function(_0x438b22){if(!_0x438b22){_0x4a2d21[_0x7ede('0x18')](0x194);}return _0x438b22;};}function handleError(_0x3e6761,_0x361678){_0x361678=_0x361678||0x1f4;return function(_0x50ee18){logger['error'](_0x50ee18[_0x7ede('0x24')]);if(_0x50ee18['name']){delete _0x50ee18[_0x7ede('0x25')];}_0x3e6761[_0x7ede('0x19')](_0x361678)[_0x7ede('0x26')](_0x50ee18);};}exports['index']=function(_0x1993bb,_0x49e077){var _0x4afee6={},_0x388b1b={},_0x5e8277={'count':0x0,'rows':[]};var _0x1995e4=_[_0x7ede('0x27')](db['Trigger'][_0x7ede('0x28')],function(_0x3bd504){return{'name':_0x3bd504[_0x7ede('0x29')],'type':_0x3bd504[_0x7ede('0x2a')][_0x7ede('0x2b')]};});_0x388b1b[_0x7ede('0x2c')]=_[_0x7ede('0x27')](_0x1995e4,_0x7ede('0x25'));_0x388b1b['query']=_[_0x7ede('0x2d')](_0x1993bb['query']);_0x388b1b['filters']=_[_0x7ede('0x2e')](_0x388b1b[_0x7ede('0x2c')],_0x388b1b[_0x7ede('0x2f')]);_0x4afee6[_0x7ede('0x30')]=_[_0x7ede('0x2e')](_0x388b1b[_0x7ede('0x2c')],qs[_0x7ede('0x31')](_0x1993bb[_0x7ede('0x2f')][_0x7ede('0x31')]));_0x4afee6[_0x7ede('0x30')]=_0x4afee6[_0x7ede('0x30')][_0x7ede('0x32')]?_0x4afee6[_0x7ede('0x30')]:_0x388b1b[_0x7ede('0x2c')];if(!_0x1993bb[_0x7ede('0x2f')][_0x7ede('0x33')](_0x7ede('0x34'))){_0x4afee6['limit']=qs[_0x7ede('0x35')](_0x1993bb['query'][_0x7ede('0x35')]);_0x4afee6[_0x7ede('0x1b')]=qs['offset'](_0x1993bb['query']['offset']);}_0x4afee6[_0x7ede('0x36')]=qs['sort'](_0x1993bb[_0x7ede('0x2f')]['sort']);_0x4afee6[_0x7ede('0x37')]=qs[_0x7ede('0x38')](_[_0x7ede('0x39')](_0x1993bb['query'],_0x388b1b[_0x7ede('0x38')]));if(_0x1993bb[_0x7ede('0x2f')][_0x7ede('0x3a')]){_0x4afee6[_0x7ede('0x37')]=_['merge'](_0x4afee6[_0x7ede('0x37')],{'$or':_[_0x7ede('0x27')](_0x1995e4,function(_0x56553e){if(_0x56553e[_0x7ede('0x2a')]!=='VIRTUAL'){var _0x2f661d={};_0x2f661d[_0x56553e[_0x7ede('0x25')]]={'$like':'%'+_0x1993bb[_0x7ede('0x2f')][_0x7ede('0x3a')]+'%'};return _0x2f661d;}})});}_0x4afee6=_[_0x7ede('0x3b')]({},_0x4afee6,_0x1993bb['options']);var _0x28511a={'where':_0x4afee6[_0x7ede('0x37')]};return db[_0x7ede('0x3c')][_0x7ede('0x1a')](_0x28511a)['then'](function(_0x5569f4){_0x5e8277[_0x7ede('0x1a')]=_0x5569f4;if(_0x1993bb[_0x7ede('0x2f')][_0x7ede('0x3d')]){_0x4afee6[_0x7ede('0x3e')]=[{'all':!![]}];}return db[_0x7ede('0x3c')][_0x7ede('0x3f')](_0x4afee6);})[_0x7ede('0x20')](function(_0x16bbbd){_0x5e8277[_0x7ede('0x40')]=_0x16bbbd;return _0x5e8277;})[_0x7ede('0x20')](respondWithFilteredResult(_0x49e077,_0x4afee6))[_0x7ede('0x41')](handleError(_0x49e077,null));};exports['show']=function(_0x2d7cdf,_0x39ad76){var _0x518f72={'raw':![],'where':{'id':_0x2d7cdf[_0x7ede('0x42')]['id']}},_0x818527={};_0x818527[_0x7ede('0x2c')]=_['keys'](db['Trigger'][_0x7ede('0x28')]);_0x818527[_0x7ede('0x2f')]=_[_0x7ede('0x2d')](_0x2d7cdf['query']);_0x818527[_0x7ede('0x38')]=_[_0x7ede('0x2e')](_0x818527['model'],_0x818527[_0x7ede('0x2f')]);_0x518f72[_0x7ede('0x30')]=_['intersection'](_0x818527[_0x7ede('0x2c')],qs[_0x7ede('0x31')](_0x2d7cdf['query'][_0x7ede('0x31')]));_0x518f72['attributes']=_0x518f72[_0x7ede('0x30')][_0x7ede('0x32')]?_0x518f72[_0x7ede('0x30')]:_0x818527[_0x7ede('0x2c')];if(_0x2d7cdf[_0x7ede('0x2f')][_0x7ede('0x3d')]){_0x518f72[_0x7ede('0x3e')]=[{'all':!![]}];}_0x518f72=_[_0x7ede('0x3b')]({},_0x518f72,_0x2d7cdf[_0x7ede('0x43')]);return db[_0x7ede('0x3c')][_0x7ede('0x44')](_0x518f72)[_0x7ede('0x20')](handleEntityNotFound(_0x39ad76,null))[_0x7ede('0x20')](respondWithResult(_0x39ad76,null))[_0x7ede('0x41')](handleError(_0x39ad76,null));};exports[_0x7ede('0x45')]=function(_0x540c99,_0x580f4d){return db[_0x7ede('0x3c')]['create'](_0x540c99[_0x7ede('0x46')],{})['then'](function(_0x340436){var _0x4c2317=_0x540c99['user']['get']({'plain':!![]});if(!_0x4c2317)throw new Error(_0x7ede('0x47'));if(_0x4c2317[_0x7ede('0x48')]===_0x7ede('0x49')){var _0x871c29=_0x340436[_0x7ede('0x21')]({'plain':!![]});var _0x35ea63=_0x7ede('0x4a');return db[_0x7ede('0x4b')][_0x7ede('0x44')]({'where':{'name':_0x35ea63,'userProfileId':_0x4c2317[_0x7ede('0x4c')]},'raw':!![]})[_0x7ede('0x20')](function(_0x10e07c){if(_0x10e07c&&_0x10e07c[_0x7ede('0x4d')]===0x0){return db[_0x7ede('0x4e')]['create']({'name':_0x871c29[_0x7ede('0x25')],'resourceId':_0x871c29['id'],'type':_0x10e07c[_0x7ede('0x25')],'sectionId':_0x10e07c['id']},{})['then'](function(){return _0x340436;});}else{return _0x340436;}})['catch'](function(_0x59581e){logger[_0x7ede('0x4f')](_0x7ede('0x50'),_0x59581e);throw _0x59581e;});}return _0x340436;})[_0x7ede('0x20')](respondWithResult(_0x580f4d,0xc9))['catch'](handleError(_0x580f4d,null));};exports['update']=function(_0x15a850,_0x57460d){if(_0x15a850[_0x7ede('0x46')]['id']){delete _0x15a850[_0x7ede('0x46')]['id'];}return db[_0x7ede('0x3c')][_0x7ede('0x44')]({'where':{'id':_0x15a850[_0x7ede('0x42')]['id']}})['then'](handleEntityNotFound(_0x57460d,null))[_0x7ede('0x20')](saveUpdates(_0x15a850[_0x7ede('0x46')],null))[_0x7ede('0x20')](respondWithResult(_0x57460d,null))[_0x7ede('0x41')](handleError(_0x57460d,null));};exports['destroy']=function(_0x1d428d,_0x59cb5c){return db[_0x7ede('0x3c')][_0x7ede('0x44')]({'where':{'id':_0x1d428d[_0x7ede('0x42')]['id']}})[_0x7ede('0x20')](handleEntityNotFound(_0x59cb5c,null))[_0x7ede('0x20')](removeEntity(_0x59cb5c,null))[_0x7ede('0x41')](handleError(_0x59cb5c,null));};exports['addAllCondition']=function(_0x1d42ac,_0x176353,_0x1d3414){if(_0x1d42ac[_0x7ede('0x46')]['id']){delete _0x1d42ac['body']['id'];}return db[_0x7ede('0x3c')][_0x7ede('0x44')]({'where':{'id':_0x1d42ac[_0x7ede('0x42')]['id']}})[_0x7ede('0x20')](handleEntityNotFound(_0x176353,null))[_0x7ede('0x20')](function(_0xb95c9d){if(_0xb95c9d){_0x1d42ac[_0x7ede('0x46')]['TriggerAllId']=_0xb95c9d['id'];return db[_0x7ede('0x51')][_0x7ede('0x45')](_0x1d42ac[_0x7ede('0x46')]);}})[_0x7ede('0x20')](respondWithResult(_0x176353,null))['catch'](handleError(_0x176353,null));};exports['addAnyCondition']=function(_0x3b9b76,_0x2af172,_0x5ea17c){if(_0x3b9b76[_0x7ede('0x46')]['id']){delete _0x3b9b76[_0x7ede('0x46')]['id'];}return db[_0x7ede('0x3c')]['find']({'where':{'id':_0x3b9b76[_0x7ede('0x42')]['id']}})[_0x7ede('0x20')](handleEntityNotFound(_0x2af172,null))[_0x7ede('0x20')](function(_0x15e010){if(_0x15e010){_0x3b9b76[_0x7ede('0x46')]['TriggerAnyId']=_0x15e010['id'];return db['Condition'][_0x7ede('0x45')](_0x3b9b76['body']);}})['then'](respondWithResult(_0x2af172,null))[_0x7ede('0x41')](handleError(_0x2af172,null));};exports[_0x7ede('0x52')]=function(_0x5f569a,_0x574374,_0x2ae199){var _0x1e2501={};var _0x5dfb3a={};var _0x4daa1a;var _0x360bb;return db[_0x7ede('0x3c')]['findOne']({'where':{'id':_0x5f569a[_0x7ede('0x42')]['id']}})[_0x7ede('0x20')](handleEntityNotFound(_0x574374,null))[_0x7ede('0x20')](function(_0x1eff88){if(_0x1eff88){_0x4daa1a=_0x1eff88;_0x5dfb3a[_0x7ede('0x2c')]=_[_0x7ede('0x2d')](db[_0x7ede('0x51')]['rawAttributes']);_0x5dfb3a[_0x7ede('0x2f')]=_[_0x7ede('0x2d')](_0x5f569a[_0x7ede('0x2f')]);_0x5dfb3a[_0x7ede('0x38')]=_[_0x7ede('0x2e')](_0x5dfb3a[_0x7ede('0x2c')],_0x5dfb3a[_0x7ede('0x2f')]);_0x1e2501[_0x7ede('0x30')]=_[_0x7ede('0x2e')](_0x5dfb3a[_0x7ede('0x2c')],qs[_0x7ede('0x31')](_0x5f569a[_0x7ede('0x2f')][_0x7ede('0x31')]));_0x1e2501[_0x7ede('0x30')]=_0x1e2501[_0x7ede('0x30')][_0x7ede('0x32')]?_0x1e2501[_0x7ede('0x30')]:_0x5dfb3a[_0x7ede('0x2c')];_0x1e2501['order']=qs[_0x7ede('0x53')](_0x5f569a['query']['sort']);_0x1e2501[_0x7ede('0x37')]=qs[_0x7ede('0x38')](_[_0x7ede('0x39')](_0x5f569a[_0x7ede('0x2f')],_0x5dfb3a['filters']));if(_0x5f569a[_0x7ede('0x2f')]['filter']){_0x1e2501[_0x7ede('0x37')]=_[_0x7ede('0x3b')](_0x1e2501['where'],{'$or':_[_0x7ede('0x27')](_0x1e2501[_0x7ede('0x30')],function(_0x1abd2a){var _0x51691b={};_0x51691b[_0x1abd2a]={'$like':'%'+_0x5f569a[_0x7ede('0x2f')][_0x7ede('0x3a')]+'%'};return _0x51691b;})});}_0x1e2501=_['merge']({},_0x1e2501,_0x5f569a['options']);return _0x4daa1a[_0x7ede('0x52')](_0x1e2501);}})[_0x7ede('0x20')](function(_0x5aa795){if(_0x5aa795){_0x360bb=_0x5aa795[_0x7ede('0x32')];if(!_0x5f569a[_0x7ede('0x2f')][_0x7ede('0x33')]('nolimit')){_0x1e2501['limit']=qs[_0x7ede('0x35')](_0x5f569a[_0x7ede('0x2f')][_0x7ede('0x35')]);_0x1e2501[_0x7ede('0x1b')]=qs['offset'](_0x5f569a['query'][_0x7ede('0x1b')]);}return _0x4daa1a[_0x7ede('0x52')](_0x1e2501);}})[_0x7ede('0x20')](function(_0x2a7647){if(_0x2a7647){return _0x2a7647?{'count':_0x360bb,'rows':_0x2a7647}:null;}})[_0x7ede('0x20')](respondWithResult(_0x574374,null))[_0x7ede('0x41')](handleError(_0x574374,null));};exports['getAnyConditions']=function(_0x302782,_0x5c7bec,_0x105461){var _0x1bdd0f={};var _0x34ab2a={};var _0x5a6161;var _0x478e8e;return db[_0x7ede('0x3c')][_0x7ede('0x54')]({'where':{'id':_0x302782[_0x7ede('0x42')]['id']}})[_0x7ede('0x20')](handleEntityNotFound(_0x5c7bec,null))[_0x7ede('0x20')](function(_0x16bdb6){if(_0x16bdb6){_0x5a6161=_0x16bdb6;_0x34ab2a[_0x7ede('0x2c')]=_['keys'](db[_0x7ede('0x51')]['rawAttributes']);_0x34ab2a[_0x7ede('0x2f')]=_['keys'](_0x302782[_0x7ede('0x2f')]);_0x34ab2a[_0x7ede('0x38')]=_[_0x7ede('0x2e')](_0x34ab2a[_0x7ede('0x2c')],_0x34ab2a[_0x7ede('0x2f')]);_0x1bdd0f[_0x7ede('0x30')]=_[_0x7ede('0x2e')](_0x34ab2a[_0x7ede('0x2c')],qs[_0x7ede('0x31')](_0x302782[_0x7ede('0x2f')][_0x7ede('0x31')]));_0x1bdd0f[_0x7ede('0x30')]=_0x1bdd0f['attributes'][_0x7ede('0x32')]?_0x1bdd0f[_0x7ede('0x30')]:_0x34ab2a[_0x7ede('0x2c')];_0x1bdd0f[_0x7ede('0x36')]=qs['sort'](_0x302782[_0x7ede('0x2f')]['sort']);_0x1bdd0f[_0x7ede('0x37')]=qs[_0x7ede('0x38')](_[_0x7ede('0x39')](_0x302782[_0x7ede('0x2f')],_0x34ab2a[_0x7ede('0x38')]));if(_0x302782[_0x7ede('0x2f')][_0x7ede('0x3a')]){_0x1bdd0f[_0x7ede('0x37')]=_[_0x7ede('0x3b')](_0x1bdd0f['where'],{'$or':_[_0x7ede('0x27')](_0x1bdd0f[_0x7ede('0x30')],function(_0x436df7){var _0x40d73a={};_0x40d73a[_0x436df7]={'$like':'%'+_0x302782['query'][_0x7ede('0x3a')]+'%'};return _0x40d73a;})});}_0x1bdd0f=_['merge']({},_0x1bdd0f,_0x302782[_0x7ede('0x43')]);return _0x5a6161[_0x7ede('0x55')](_0x1bdd0f);}})[_0x7ede('0x20')](function(_0x3db979){if(_0x3db979){_0x478e8e=_0x3db979[_0x7ede('0x32')];if(!_0x302782[_0x7ede('0x2f')][_0x7ede('0x33')](_0x7ede('0x34'))){_0x1bdd0f[_0x7ede('0x35')]=qs[_0x7ede('0x35')](_0x302782[_0x7ede('0x2f')][_0x7ede('0x35')]);_0x1bdd0f[_0x7ede('0x1b')]=qs[_0x7ede('0x1b')](_0x302782['query'][_0x7ede('0x1b')]);}return _0x5a6161[_0x7ede('0x55')](_0x1bdd0f);}})[_0x7ede('0x20')](function(_0x27bc3a){if(_0x27bc3a){return _0x27bc3a?{'count':_0x478e8e,'rows':_0x27bc3a}:null;}})[_0x7ede('0x20')](respondWithResult(_0x5c7bec,null))['catch'](handleError(_0x5c7bec,null));};exports[_0x7ede('0x56')]=function(_0x204863,_0x176ea2,_0x124089){if(_0x204863[_0x7ede('0x46')]['id']){delete _0x204863[_0x7ede('0x46')]['id'];}return db['Trigger'][_0x7ede('0x44')]({'where':{'id':_0x204863[_0x7ede('0x42')]['id']}})[_0x7ede('0x20')](handleEntityNotFound(_0x176ea2,null))[_0x7ede('0x20')](function(_0x5976a4){if(_0x5976a4){_0x204863[_0x7ede('0x46')][_0x7ede('0x57')]=_0x5976a4['id'];return db[_0x7ede('0x58')][_0x7ede('0x45')](_0x204863['body']);}})[_0x7ede('0x20')](respondWithResult(_0x176ea2,null))['catch'](handleError(_0x176ea2,null));};exports['getActions']=function(_0x5ce4a4,_0x163432,_0x1d1d85){var _0x270909={};var _0x49f5c0={};var _0x5b23e0;var _0x1802e2;return db[_0x7ede('0x3c')][_0x7ede('0x54')]({'where':{'id':_0x5ce4a4['params']['id']}})[_0x7ede('0x20')](handleEntityNotFound(_0x163432,null))['then'](function(_0x16117a){if(_0x16117a){_0x5b23e0=_0x16117a;_0x49f5c0[_0x7ede('0x2c')]=_[_0x7ede('0x2d')](db[_0x7ede('0x58')][_0x7ede('0x28')]);_0x49f5c0[_0x7ede('0x2f')]=_[_0x7ede('0x2d')](_0x5ce4a4[_0x7ede('0x2f')]);_0x49f5c0[_0x7ede('0x38')]=_[_0x7ede('0x2e')](_0x49f5c0['model'],_0x49f5c0[_0x7ede('0x2f')]);_0x270909[_0x7ede('0x30')]=_[_0x7ede('0x2e')](_0x49f5c0['model'],qs[_0x7ede('0x31')](_0x5ce4a4[_0x7ede('0x2f')]['fields']));_0x270909[_0x7ede('0x30')]=_0x270909[_0x7ede('0x30')][_0x7ede('0x32')]?_0x270909[_0x7ede('0x30')]:_0x49f5c0[_0x7ede('0x2c')];_0x270909[_0x7ede('0x36')]=qs[_0x7ede('0x53')](_0x5ce4a4['query'][_0x7ede('0x53')]);_0x270909[_0x7ede('0x37')]=qs[_0x7ede('0x38')](_['pick'](_0x5ce4a4['query'],_0x49f5c0['filters']));if(_0x5ce4a4[_0x7ede('0x2f')][_0x7ede('0x3a')]){_0x270909[_0x7ede('0x37')]=_[_0x7ede('0x3b')](_0x270909[_0x7ede('0x37')],{'$or':_[_0x7ede('0x27')](_0x270909[_0x7ede('0x30')],function(_0x1bbe39){var _0x529c7d={};_0x529c7d[_0x1bbe39]={'$like':'%'+_0x5ce4a4[_0x7ede('0x2f')][_0x7ede('0x3a')]+'%'};return _0x529c7d;})});}_0x270909=_['merge']({},_0x270909,_0x5ce4a4[_0x7ede('0x43')]);return _0x5b23e0[_0x7ede('0x59')](_0x270909);}})[_0x7ede('0x20')](function(_0x3e15f3){if(_0x3e15f3){_0x1802e2=_0x3e15f3[_0x7ede('0x32')];if(!_0x5ce4a4[_0x7ede('0x2f')][_0x7ede('0x33')](_0x7ede('0x34'))){_0x270909['limit']=qs['limit'](_0x5ce4a4[_0x7ede('0x2f')][_0x7ede('0x35')]);_0x270909[_0x7ede('0x1b')]=qs['offset'](_0x5ce4a4[_0x7ede('0x2f')][_0x7ede('0x1b')]);}return _0x5b23e0[_0x7ede('0x59')](_0x270909);}})[_0x7ede('0x20')](function(_0x29cee2){if(_0x29cee2){return _0x29cee2?{'count':_0x1802e2,'rows':_0x29cee2}:null;}})['then'](respondWithResult(_0x163432,null))[_0x7ede('0x41')](handleError(_0x163432,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index ac93ccf..449769c 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 _0x0459=['bluebird','request-promise','path','../../config/environment','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','../../config/logger','api','moment'];(function(_0xf5ab49,_0x4a50c5){var _0x55deaa=function(_0x142e97){while(--_0x142e97){_0xf5ab49['push'](_0xf5ab49['shift']());}};_0x55deaa(++_0x4a50c5);}(_0x0459,0x12f));var _0x9045=function(_0x424a9a,_0x2dd9af){_0x424a9a=_0x424a9a-0x0;var _0xa7831c=_0x0459[_0x424a9a];return _0xa7831c;};'use strict';var _=require(_0x9045('0x0'));var util=require(_0x9045('0x1'));var logger=require(_0x9045('0x2'))(_0x9045('0x3'));var moment=require(_0x9045('0x4'));var BPromise=require(_0x9045('0x5'));var rp=require(_0x9045('0x6'));var fs=require('fs');var path=require(_0x9045('0x7'));var rimraf=require('rimraf');var config=require(_0x9045('0x8'));var attributes=require(_0x9045('0x9'));module[_0x9045('0xa')]=function(_0x481b7e,_0x1ac3d0){return _0x481b7e[_0x9045('0xb')](_0x9045('0xc'),attributes,{'tableName':_0x9045('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4ddf=['api','bluebird','request-promise','path','rimraf','../../config/environment','./trigger.attributes','Trigger','lodash','util','../../config/logger'];(function(_0x19c84f,_0x3e8284){var _0x4da555=function(_0x12517a){while(--_0x12517a){_0x19c84f['push'](_0x19c84f['shift']());}};_0x4da555(++_0x3e8284);}(_0x4ddf,0xe4));var _0xf4dd=function(_0x3fcd5b,_0x4bcdca){_0x3fcd5b=_0x3fcd5b-0x0;var _0x1c0a5b=_0x4ddf[_0x3fcd5b];return _0x1c0a5b;};'use strict';var _=require(_0xf4dd('0x0'));var util=require(_0xf4dd('0x1'));var logger=require(_0xf4dd('0x2'))(_0xf4dd('0x3'));var moment=require('moment');var BPromise=require(_0xf4dd('0x4'));var rp=require(_0xf4dd('0x5'));var fs=require('fs');var path=require(_0xf4dd('0x6'));var rimraf=require(_0xf4dd('0x7'));var config=require(_0xf4dd('0x8'));var attributes=require(_0xf4dd('0x9'));module['exports']=function(_0x99cda8,_0x5be506){return _0x99cda8['define'](_0xf4dd('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/trigger/trigger.rpc.js b/server/api/trigger/trigger.rpc.js index adaa778..5cc8ccb 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 _0x0565=['request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','stringify','code','message','error','GetTrigger','options','raw','where','attributes','limit','map','model','include','debug','catch','ShowTrigger','Trigger','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','Trigger,\x20%s,\x20%s'];(function(_0x275017,_0x3be7b3){var _0x3dcf00=function(_0x4ff036){while(--_0x4ff036){_0x275017['push'](_0x275017['shift']());}};_0x3dcf00(++_0x3be7b3);}(_0x0565,0xf2));var _0x5056=function(_0x432fca,_0xb0b1b5){_0x432fca=_0x432fca-0x0;var _0x3adba4=_0x0565[_0x432fca];return _0x3adba4;};'use strict';var _=require(_0x5056('0x0'));var util=require(_0x5056('0x1'));var moment=require(_0x5056('0x2'));var BPromise=require(_0x5056('0x3'));var rs=require(_0x5056('0x4'));var fs=require('fs');var Redis=require(_0x5056('0x5'));var db=require(_0x5056('0x6'))['db'];var utils=require(_0x5056('0x7'));var logger=require(_0x5056('0x8'))(_0x5056('0x9'));var config=require('../../config/environment');var jayson=require(_0x5056('0xa'));var client=jayson[_0x5056('0xb')][_0x5056('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22afb7,_0x4b8280,_0x52b01f){return new BPromise(function(_0x38f74,_0x223c92){return client[_0x5056('0xd')](_0x22afb7,_0x52b01f)[_0x5056('0xe')](function(_0x2144a9){logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));logger['debug'](_0x5056('0x12'),_0x4b8280,_0x5056('0x11'),JSON[_0x5056('0x13')](_0x2144a9));if(_0x2144a9['error']){if(_0x2144a9['error'][_0x5056('0x14')]===0x1f4){logger['error']('Trigger,\x20%s,\x20%s',_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x223c92(_0x2144a9['error'][_0x5056('0x15')]);}logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x2144a9['error'][_0x5056('0x15')]);return _0x38f74(_0x2144a9[_0x5056('0x16')][_0x5056('0x15')]);}else{logger[_0x5056('0xf')](_0x5056('0x10'),_0x4b8280,_0x5056('0x11'));_0x38f74(_0x2144a9['result'][_0x5056('0x15')]);}})['catch'](function(_0x43db77){logger[_0x5056('0x16')](_0x5056('0x10'),_0x4b8280,_0x43db77);_0x223c92(_0x43db77);});});}exports[_0x5056('0x17')]=function(_0x4056ce){var _0x51b21e=this;return new Promise(function(_0x9ea88,_0x56537e){return db['Trigger']['findAll']({'raw':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1b')]||null:null,'limit':_0x4056ce[_0x5056('0x18')]?_0x4056ce['options'][_0x5056('0x1c')]||null:null,'include':_0x4056ce[_0x5056('0x18')]?_0x4056ce[_0x5056('0x18')]['include']?_[_0x5056('0x1d')](_0x4056ce[_0x5056('0x18')]['include'],function(_0x4a64be){return{'model':db[_0x4a64be[_0x5056('0x1e')]],'as':_0x4a64be['as'],'attributes':_0x4a64be[_0x5056('0x1b')],'include':_0x4a64be[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x4a64be['include'],function(_0x267048){return{'model':db[_0x267048[_0x5056('0x1e')]],'as':_0x267048['as'],'attributes':_0x267048['attributes'],'include':_0x267048[_0x5056('0x1f')]?_['map'](_0x267048[_0x5056('0x1f')],function(_0x39d539){return{'model':db[_0x39d539[_0x5056('0x1e')]],'as':_0x39d539['as'],'attributes':_0x39d539[_0x5056('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x50f2a8){logger[_0x5056('0xf')](_0x5056('0x17'),_0x4056ce);logger[_0x5056('0x20')](_0x5056('0x17'),_0x4056ce,JSON['stringify'](_0x50f2a8));_0x9ea88(_0x50f2a8);})[_0x5056('0x21')](function(_0x5b0270){logger[_0x5056('0x16')]('GetTrigger',_0x5b0270['message'],_0x4056ce);_0x56537e(_0x51b21e['error'](0x1f4,_0x5b0270[_0x5056('0x15')]));});});};exports[_0x5056('0x22')]=function(_0x482939){var _0x27f4be=this;return new Promise(function(_0x2c5728,_0x9e2986){return db[_0x5056('0x23')][_0x5056('0x24')]({'raw':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x19')]===undefined?!![]:![]:!![],'where':_0x482939[_0x5056('0x18')]?_0x482939[_0x5056('0x18')][_0x5056('0x1a')]||null:null,'attributes':_0x482939['options']?_0x482939['options'][_0x5056('0x1b')]||null:null,'include':_0x482939[_0x5056('0x18')]?_0x482939['options'][_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x482939['options'][_0x5056('0x1f')],function(_0x378b33){return{'model':db[_0x378b33[_0x5056('0x1e')]],'as':_0x378b33['as'],'attributes':_0x378b33[_0x5056('0x1b')],'include':_0x378b33[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x378b33[_0x5056('0x1f')],function(_0x2f1d27){return{'model':db[_0x2f1d27[_0x5056('0x1e')]],'as':_0x2f1d27['as'],'attributes':_0x2f1d27[_0x5056('0x1b')],'include':_0x2f1d27[_0x5056('0x1f')]?_[_0x5056('0x1d')](_0x2f1d27[_0x5056('0x1f')],function(_0x3d7d78){return{'model':db[_0x3d7d78[_0x5056('0x1e')]],'as':_0x3d7d78['as'],'attributes':_0x3d7d78['attributes']};}):[]};}):[]};}):[]:[]})[_0x5056('0xe')](function(_0x483d1e){logger[_0x5056('0xf')](_0x5056('0x22'),_0x482939);logger[_0x5056('0x20')](_0x5056('0x22'),_0x482939,JSON['stringify'](_0x483d1e));_0x2c5728(_0x483d1e);})[_0x5056('0x21')](function(_0x32fecc){logger['error'](_0x5056('0x22'),_0x32fecc['message'],_0x482939);_0x9e2986(_0x27f4be[_0x5056('0x16')](0x1f4,_0x32fecc[_0x5056('0x15')]));});});}; \ No newline at end of file +var _0x8603=['result','catch','GetTrigger','Trigger','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrigger','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','Trigger,\x20%s,\x20%s','request\x20sent','Trigger,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x4deb78,_0x20eeef){var _0x5117a6=function(_0x498181){while(--_0x498181){_0x4deb78['push'](_0x4deb78['shift']());}};_0x5117a6(++_0x20eeef);}(_0x8603,0x190));var _0x3860=function(_0x5e3f9f,_0x5fd839){_0x5e3f9f=_0x5e3f9f-0x0;var _0x2d14f7=_0x8603[_0x5e3f9f];return _0x2d14f7;};'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']('GetTrigger',_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['ShowTrigger']=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 diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 0edfb1a..e6827de 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 _0x81bd=['put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','get','index','/:id','post','isAuthenticated','clone','create'];(function(_0x4ca3af,_0x5b500d){var _0x15fb84=function(_0x29b37a){while(--_0x29b37a){_0x4ca3af['push'](_0x4ca3af['shift']());}};_0x15fb84(++_0x5b500d);}(_0x81bd,0x7c));var _0xd81b=function(_0x496285,_0x297d87){_0x496285=_0x496285-0x0;var _0x2f7996=_0x81bd[_0x496285];return _0x2f7996;};'use strict';var multer=require(_0xd81b('0x0'));var util=require(_0xd81b('0x1'));var path=require(_0xd81b('0x2'));var timeout=require(_0xd81b('0x3'));var express=require(_0xd81b('0x4'));var router=express[_0xd81b('0x5')]();var auth=require(_0xd81b('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xd81b('0x7'));var controller=require(_0xd81b('0x8'));router[_0xd81b('0x9')]('/',auth['isAuthenticated'](),controller[_0xd81b('0xa')]);router[_0xd81b('0x9')](_0xd81b('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xd81b('0xc')]('/:id/clone',auth[_0xd81b('0xd')](),controller[_0xd81b('0xe')]);router[_0xd81b('0xc')]('/',auth[_0xd81b('0xd')](),controller[_0xd81b('0xf')]);router[_0xd81b('0x10')](_0xd81b('0xb'),auth[_0xd81b('0xd')](),controller[_0xd81b('0x11')]);router[_0xd81b('0x12')](_0xd81b('0xb'),auth[_0xd81b('0xd')](),controller[_0xd81b('0x13')]);module['exports']=router; \ No newline at end of file +var _0xac31=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trunk.controller','index','get','/:id','isAuthenticated','show','/:id/clone','clone','post','put'];(function(_0x202598,_0x57954d){var _0x52c1c6=function(_0x54fd6f){while(--_0x54fd6f){_0x202598['push'](_0x202598['shift']());}};_0x52c1c6(++_0x57954d);}(_0xac31,0xca));var _0x1ac3=function(_0x577f20,_0x49f08f){_0x577f20=_0x577f20-0x0;var _0x5b1ba5=_0xac31[_0x577f20];return _0x5b1ba5;};'use strict';var multer=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var path=require(_0x1ac3('0x2'));var timeout=require(_0x1ac3('0x3'));var express=require(_0x1ac3('0x4'));var router=express[_0x1ac3('0x5')]();var auth=require(_0x1ac3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1ac3('0x7'));var controller=require(_0x1ac3('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x1ac3('0x9')]);router[_0x1ac3('0xa')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0xd')]);router['post'](_0x1ac3('0xe'),auth['isAuthenticated'](),controller[_0x1ac3('0xf')]);router[_0x1ac3('0x10')]('/',auth[_0x1ac3('0xc')](),controller['create']);router[_0x1ac3('0x11')](_0x1ac3('0xb'),auth[_0x1ac3('0xc')](),controller[_0x1ac3('0x12')]);router[_0x1ac3('0x13')](_0x1ac3('0xb'),auth['isAuthenticated'](),controller[_0x1ac3('0x14')]);module[_0x1ac3('0x15')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 6c8bd52..26b1fda 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 _0x11c9=['always','originate','uac','uas','pai','active','passive','actpass','update','update,nonat','BOOLEAN','sequelize','friend','user','peer','STRING','from-voip-provider','ENUM','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','yes','nonat','outgoing','force_rport,comedia','setDataValue','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\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','\x22\x22\x20<>','INTEGER'];(function(_0x4000e4,_0x49791c){var _0x317f74=function(_0x34d6db){while(--_0x34d6db){_0x4000e4['push'](_0x4000e4['shift']());}};_0x317f74(++_0x49791c);}(_0x11c9,0x1d6));var _0x911c=function(_0x54ea7a,_0x19df9b){_0x54ea7a=_0x54ea7a-0x0;var _0x65a10d=_0x11c9[_0x54ea7a];return _0x65a10d;};'use strict';var Sequelize=require(_0x911c('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x911c('0x1'),_0x911c('0x2'),_0x911c('0x3')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x911c('0x4')],'allowNull':![],'defaultValue':_0x911c('0x5')},'callingpres':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x7'),_0x911c('0x8'),_0x911c('0x9'),_0x911c('0xa'),_0x911c('0xb'),_0x911c('0xc'),'PROHIB_FAILED_SCREEN',_0x911c('0xd'))},'deny':{'type':Sequelize[_0x911c('0x4')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0x911c('0x4')]},'transport':{'type':Sequelize[_0x911c('0x4')],'defaultValue':_0x911c('0xe'),'set':function(_0x5bf708){this['setDataValue'](_0x911c('0xf'),_0x5bf708?_0x5bf708[_0x911c('0x10')](','):null);},'get':function(){return this['getDataValue'](_0x911c('0xf'))?this[_0x911c('0x11')](_0x911c('0xf'))[_0x911c('0x12')](','):null;},'comment':_0x911c('0x13')},'dtmfmode':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x14'),_0x911c('0x15'),_0x911c('0x16'),'inband','auto'),'defaultValue':_0x911c('0x14')},'directmedia':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no',_0x911c('0x18'),'update',_0x911c('0x19')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x911c('0x4')]},'directmediadeny':{'type':Sequelize[_0x911c('0x4')]},'nat':{'type':Sequelize['STRING'],'defaultValue':_0x911c('0x1a'),'set':function(_0x5ae370){this[_0x911c('0x1b')](_0x911c('0x1c'),_0x5ae370?_0x5ae370['join'](','):null);},'get':function(){return this[_0x911c('0x11')](_0x911c('0x1c'))?this[_0x911c('0x11')](_0x911c('0x1c'))[_0x911c('0x12')](','):null;},'comment':_0x911c('0x1d')},'callgroup':{'type':Sequelize[_0x911c('0x4')]},'namedcallgroup':{'type':Sequelize[_0x911c('0x4')]},'pickupgroup':{'type':Sequelize[_0x911c('0x4')]},'namedpickupgroup':{'type':Sequelize[_0x911c('0x4')]},'language':{'type':Sequelize[_0x911c('0x4')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x911c('0x4')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x911c('0x4')],'defaultValue':_0x911c('0x1e')},'allow':{'type':Sequelize[_0x911c('0x4')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x18e0d6){this['setDataValue'](_0x911c('0x1f'),_0x18e0d6?_0x18e0d6[_0x911c('0x10')](';'):_0x911c('0x20'));},'get':function(){return this['getDataValue'](_0x911c('0x1f'))?this[_0x911c('0x11')](_0x911c('0x1f'))[_0x911c('0x12')](';'):null;},'comment':_0x911c('0x21')},'autoframing':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no')},'insecure':{'type':Sequelize[_0x911c('0x4')],'defaultValue':_0x911c('0x22'),'set':function(_0x1dc883){this[_0x911c('0x1b')](_0x911c('0x23'),_0x1dc883?_0x1dc883[_0x911c('0x10')](','):null);},'get':function(){return this[_0x911c('0x11')](_0x911c('0x23'))?this['getDataValue'](_0x911c('0x23'))['split'](','):null;},'comment':_0x911c('0x24')},'trustrpid':{'type':Sequelize[_0x911c('0x6')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no',_0x911c('0x25'))},'promiscredir':{'type':Sequelize[_0x911c('0x6')]('yes','no')},'useclientcode':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no')},'accountcode':{'type':Sequelize['INTEGER'](0xb)},'setvar':{'type':Sequelize[_0x911c('0x4')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x911c('0x26')},'amaflags':{'type':Sequelize[_0x911c('0x4')]},'callcounter':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no'),'defaultValue':_0x911c('0x17')},'busylevel':{'type':Sequelize[_0x911c('0x27')](0xb)},'allowoverlap':{'type':Sequelize['ENUM'](_0x911c('0x17'),'no')},'allowsubscribe':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0x911c('0x6')]('yes','no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0x911c('0x17'),'no')},'subscribecontext':{'type':Sequelize['STRING']},'template':{'type':Sequelize[_0x911c('0x4')]},'videosupport':{'type':Sequelize[_0x911c('0x6')]('yes','no',_0x911c('0x28')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x911c('0x27')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM'](_0x911c('0x17'),'no')},'mailbox':{'type':Sequelize[_0x911c('0x4')]},'session_timers':{'type':Sequelize[_0x911c('0x6')]('accept','refuse',_0x911c('0x29'))},'session_expires':{'type':Sequelize[_0x911c('0x27')](0xb)},'session_minse':{'type':Sequelize[_0x911c('0x27')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x911c('0x2a'),_0x911c('0x2b')),'defaultValue':_0x911c('0x2b')},'t38pt_usertpsource':{'type':Sequelize[_0x911c('0x4')]},'regexten':{'type':Sequelize[_0x911c('0x4')]},'fromdomain':{'type':Sequelize[_0x911c('0x4')]},'fromuser':{'type':Sequelize[_0x911c('0x4')]},'port':{'type':Sequelize[_0x911c('0x27')](0x5)},'qualify':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no'),'defaultValue':'yes'},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize['STRING']},'defaultuser':{'type':Sequelize[_0x911c('0x4')]},'rtptimeout':{'type':Sequelize[_0x911c('0x27')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0x911c('0x6')]('yes','no',_0x911c('0x2c')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x911c('0x4')]},'callbackextension':{'type':Sequelize[_0x911c('0x4')]},'timert1':{'type':Sequelize[_0x911c('0x27')](0xb)},'timerb':{'type':Sequelize[_0x911c('0x27')](0xb)},'qualifyfreq':{'type':Sequelize[_0x911c('0x27')](0xb)},'contactpermit':{'type':Sequelize[_0x911c('0x4')]},'contactdeny':{'type':Sequelize[_0x911c('0x4')]},'contactacl':{'type':Sequelize[_0x911c('0x4')]},'unsolicited_mailbox':{'type':Sequelize[_0x911c('0x4')]},'use_q850_reason':{'type':Sequelize[_0x911c('0x4')]},'maxforwards':{'type':Sequelize[_0x911c('0x27')](0xb)},'encryption':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no')},'force_avp':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no')},'icesupport':{'type':Sequelize[_0x911c('0x6')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no','fingerprint','certificate')},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb)},'dtlscertfile':{'type':Sequelize[_0x911c('0x4')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x911c('0x4')]},'dtlscafile':{'type':Sequelize[_0x911c('0x4')]},'dtlscapath':{'type':Sequelize[_0x911c('0x4')]},'dtlssetup':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x2d'),_0x911c('0x2e'),_0x911c('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x911c('0x4')]},'usereqphone':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x911c('0x27')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0x911c('0x6')]('yes','no')},'vmexten':{'type':Sequelize[_0x911c('0x4')]},'mohinterpret':{'type':Sequelize[_0x911c('0x4')]},'mohsuggest':{'type':Sequelize[_0x911c('0x4')]},'parkinglot':{'type':Sequelize[_0x911c('0x4')]},'description':{'type':Sequelize[_0x911c('0x4')]},'host':{'type':Sequelize['STRING'],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0x911c('0x6')](_0x911c('0x17'),'no',_0x911c('0x18'),_0x911c('0x30'),_0x911c('0x31')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x911c('0x4')]},'otherFields':{'type':Sequelize[_0x911c('0x4')]},'active':{'type':Sequelize[_0x911c('0x32')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x911c('0x4')],'defaultValue':'no'}}; \ No newline at end of file +var _0x78a0=['ENUM','friend','user','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_FAILED_SCREEN','udp','setDataValue','transport','rfc2833','shortinfo','inband','yes','nonat','update','outgoing','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','join','getDataValue','split','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','\x22\x22\x20<>','accept','uac','uas','pai','fingerprint','certificate','active','actpass','dynamic','update,nonat','BOOLEAN','sequelize','STRING','name'];(function(_0x5cc655,_0x4b6145){var _0x244379=function(_0x30d2c5){while(--_0x30d2c5){_0x5cc655['push'](_0x5cc655['shift']());}};_0x244379(++_0x4b6145);}(_0x78a0,0xb9));var _0x078a=function(_0x132fb6,_0x7a257b){_0x132fb6=_0x132fb6-0x0;var _0x2ca9d5=_0x78a0[_0x132fb6];return _0x2ca9d5;};'use strict';var Sequelize=require(_0x078a('0x0'));module['exports']={'name':{'type':Sequelize[_0x078a('0x1')],'allowNull':![],'unique':_0x078a('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x4'),_0x078a('0x5'),'peer'),'allowNull':![],'defaultValue':_0x078a('0x4')},'context':{'type':Sequelize[_0x078a('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize[_0x078a('0x3')]('ALLOWED_NOT_SCREENED',_0x078a('0x6'),_0x078a('0x7'),_0x078a('0x8'),_0x078a('0x9'),'PROHIB_PASSED_SCREEN',_0x078a('0xa'),'PROHIB')},'deny':{'type':Sequelize[_0x078a('0x1')]},'permit':{'type':Sequelize[_0x078a('0x1')]},'secret':{'type':Sequelize[_0x078a('0x1')]},'md5secret':{'type':Sequelize[_0x078a('0x1')]},'remotesecret':{'type':Sequelize[_0x078a('0x1')]},'transport':{'type':Sequelize[_0x078a('0x1')],'defaultValue':_0x078a('0xb'),'set':function(_0x3b4bfd){this[_0x078a('0xc')](_0x078a('0xd'),_0x3b4bfd?_0x3b4bfd['join'](','):null);},'get':function(){return this['getDataValue'](_0x078a('0xd'))?this['getDataValue'](_0x078a('0xd'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]'},'dtmfmode':{'type':Sequelize[_0x078a('0x3')](_0x078a('0xe'),'info',_0x078a('0xf'),_0x078a('0x10'),'auto'),'defaultValue':_0x078a('0xe')},'directmedia':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no',_0x078a('0x12'),_0x078a('0x13'),_0x078a('0x14')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM'](_0x078a('0x11'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x078a('0x1')]},'directmediadeny':{'type':Sequelize[_0x078a('0x1')]},'nat':{'type':Sequelize[_0x078a('0x1')],'defaultValue':_0x078a('0x15'),'set':function(_0x373f9e){this[_0x078a('0xc')](_0x078a('0x16'),_0x373f9e?_0x373f9e['join'](','):null);},'get':function(){return this['getDataValue']('nat')?this['getDataValue'](_0x078a('0x16'))['split'](','):null;},'comment':_0x078a('0x17')},'callgroup':{'type':Sequelize[_0x078a('0x1')]},'namedcallgroup':{'type':Sequelize[_0x078a('0x1')]},'pickupgroup':{'type':Sequelize['STRING']},'namedpickupgroup':{'type':Sequelize[_0x078a('0x1')]},'language':{'type':Sequelize['STRING'],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING'],'allowNull':!![]},'disallow':{'type':Sequelize[_0x078a('0x1')],'defaultValue':_0x078a('0x18')},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x078a('0x19'),'set':function(_0x11553c){this[_0x078a('0xc')](_0x078a('0x1a'),_0x11553c?_0x11553c[_0x078a('0x1b')](';'):_0x078a('0x19'));},'get':function(){return this[_0x078a('0x1c')]('allow')?this['getDataValue'](_0x078a('0x1a'))[_0x078a('0x1d')](';'):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]'},'autoframing':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'insecure':{'type':Sequelize[_0x078a('0x1')],'defaultValue':_0x078a('0x1e'),'set':function(_0x361f00){this[_0x078a('0xc')](_0x078a('0x1f'),_0x361f00?_0x361f00[_0x078a('0x1b')](','):null);},'get':function(){return this[_0x078a('0x1c')](_0x078a('0x1f'))?this['getDataValue'](_0x078a('0x1f'))['split'](','):null;},'comment':_0x078a('0x20')},'trustrpid':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no',_0x078a('0x21'))},'promiscredir':{'type':Sequelize[_0x078a('0x3')]('yes','no')},'useclientcode':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'accountcode':{'type':Sequelize[_0x078a('0x22')](0xb)},'setvar':{'type':Sequelize[_0x078a('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0x078a('0x23')},'amaflags':{'type':Sequelize[_0x078a('0x1')]},'callcounter':{'type':Sequelize[_0x078a('0x3')]('yes','no'),'defaultValue':_0x078a('0x11')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0x078a('0x3')]('yes','no')},'allowsubscribe':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'allowtransfer':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'ignoresdpversion':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'subscribecontext':{'type':Sequelize[_0x078a('0x1')]},'template':{'type':Sequelize['STRING']},'videosupport':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no','always'),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x078a('0x22')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'mailbox':{'type':Sequelize[_0x078a('0x1')]},'session_timers':{'type':Sequelize['ENUM'](_0x078a('0x24'),'refuse','originate')},'session_expires':{'type':Sequelize[_0x078a('0x22')](0xb)},'session_minse':{'type':Sequelize[_0x078a('0x22')](0xb)},'session_refresher':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x25'),_0x078a('0x26')),'defaultValue':_0x078a('0x26')},'t38pt_usertpsource':{'type':Sequelize[_0x078a('0x1')]},'regexten':{'type':Sequelize['STRING']},'fromdomain':{'type':Sequelize[_0x078a('0x1')]},'fromuser':{'type':Sequelize[_0x078a('0x1')]},'port':{'type':Sequelize[_0x078a('0x22')](0x5)},'qualify':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':_0x078a('0x11')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x078a('0x1')]},'defaultuser':{'type':Sequelize[_0x078a('0x1')]},'rtptimeout':{'type':Sequelize[_0x078a('0x22')](0xb)},'rtpholdtimeout':{'type':Sequelize[_0x078a('0x22')](0xb)},'rtpkeepalive':{'type':Sequelize[_0x078a('0x22')](0xb)},'sendrpid':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no',_0x078a('0x27')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x078a('0x1')]},'callbackextension':{'type':Sequelize['STRING']},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0x078a('0x22')](0xb)},'qualifyfreq':{'type':Sequelize[_0x078a('0x22')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0x078a('0x1')]},'contactacl':{'type':Sequelize['STRING']},'unsolicited_mailbox':{'type':Sequelize[_0x078a('0x1')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0x078a('0x22')](0xb)},'encryption':{'type':Sequelize[_0x078a('0x3')]('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x078a('0x3')]('yes','no')},'force_avp':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'icesupport':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'dtlsenable':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'dtlsverify':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no',_0x078a('0x28'),_0x078a('0x29'))},'dtlsrekey':{'type':Sequelize[_0x078a('0x22')](0xb)},'dtlscertfile':{'type':Sequelize[_0x078a('0x1')]},'dtlsprivatekey':{'type':Sequelize[_0x078a('0x1')]},'dtlscipher':{'type':Sequelize[_0x078a('0x1')]},'dtlscafile':{'type':Sequelize[_0x078a('0x1')]},'dtlscapath':{'type':Sequelize[_0x078a('0x1')]},'dtlssetup':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x2a'),'passive',_0x078a('0x2b')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x078a('0x1')]},'usereqphone':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize[_0x078a('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0x078a('0x11'),'no')},'subscribemwi':{'type':Sequelize[_0x078a('0x3')](_0x078a('0x11'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0x078a('0x1')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0x078a('0x1')]},'description':{'type':Sequelize[_0x078a('0x1')]},'host':{'type':Sequelize[_0x078a('0x1')],'defaultValue':_0x078a('0x2c')},'canreinvite':{'type':Sequelize['ENUM']('yes','no',_0x078a('0x12'),_0x078a('0x13'),_0x078a('0x2d')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x078a('0x1')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x078a('0x2e')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x078a('0x1')],'defaultValue':'no'}}; \ No newline at end of file diff --git a/server/api/trunk/trunk.controller.js b/server/api/trunk/trunk.controller.js index bffe5d9..0c35cdf 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 _0xb453=['type','key','model','keys','query','filters','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','catch','params','length','clone','omit','createdAt','body','updatedAt','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','readFileSync','utf8','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','chan_sip.so','update','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','Reload','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','Trunk,\x20%s,\x20%s','message','result','sendStatus','status','json','offset','set','Content-Range','reject','save','destroy','get','Trunks','end','name','send','index','map','Trunk','rawAttributes','fieldName'];(function(_0x5f3f88,_0x562baf){var _0xd08119=function(_0x42dbf7){while(--_0x42dbf7){_0x5f3f88['push'](_0x5f3f88['shift']());}};_0xd08119(++_0x562baf);}(_0xb453,0x198));var _0x3b45=function(_0x31fbf3,_0x7c9173){_0x31fbf3=_0x31fbf3-0x0;var _0x5eead6=_0xb453[_0x31fbf3];return _0x5eead6;};'use strict';var pdf=require(_0x3b45('0x0'));var emlformat=require(_0x3b45('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3b45('0x2'));var rp=require(_0x3b45('0x3'));var moment=require(_0x3b45('0x4'));var BPromise=require(_0x3b45('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3b45('0x6'));var sox=require(_0x3b45('0x7'));var csv=require(_0x3b45('0x8'));var ejs=require(_0x3b45('0x9'));var fs=require('fs');var _=require(_0x3b45('0xa'));var squel=require(_0x3b45('0xb'));var crypto=require(_0x3b45('0xc'));var jsforce=require(_0x3b45('0xd'));var deskjs=require(_0x3b45('0xe'));var toCsv=require(_0x3b45('0x8'));var querystring=require(_0x3b45('0xf'));var Papa=require(_0x3b45('0x10'));var Redis=require(_0x3b45('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3b45('0x12'));var hardwareService=require(_0x3b45('0x13'));var logger=require(_0x3b45('0x14'))(_0x3b45('0x15'));var utils=require(_0x3b45('0x16'));var config=require('../../config/environment');var db=require(_0x3b45('0x17'))['db'];var jayson=require(_0x3b45('0x18'));var client=jayson[_0x3b45('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x56184f,_0x42a25a,_0x2a50ce){if(_0x2a50ce){var _0x25119=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25119[_0x3b45('0x1a')](_0x42a25a)){return _0x56184f;}else{throw new db[(_0x3b45('0x1b'))][(_0x3b45('0x1c'))](_0x3b45('0x1d'));}}else{return _0x56184f;}}function respondWithRpcPromise(_0x473cfb,_0x51e84f,_0x138198,_0x41ce29){return new BPromise(function(_0x3da014,_0xbe19d3){var _0x2d912f=_0x41ce29||client;return _0x2d912f[_0x3b45('0x1e')](_0x473cfb,_0x138198)[_0x3b45('0x1f')](function(_0x3f6bdf){logger[_0x3b45('0x20')]('Trunk,\x20%s,\x20%s',_0x51e84f,_0x3b45('0x21'));logger['debug'](_0x3b45('0x22'),_0x51e84f,_0x3b45('0x21'),JSON[_0x3b45('0x23')](_0x3f6bdf));if(_0x3f6bdf[_0x3b45('0x24')]){if(_0x3f6bdf[_0x3b45('0x24')][_0x3b45('0x25')]===0x1f4){logger[_0x3b45('0x24')](_0x3b45('0x26'),_0x51e84f,_0x3f6bdf[_0x3b45('0x24')][_0x3b45('0x27')]);return _0xbe19d3(_0x3f6bdf['error'][_0x3b45('0x27')]);}logger[_0x3b45('0x24')]('Trunk,\x20%s,\x20%s',_0x51e84f,_0x3f6bdf[_0x3b45('0x24')][_0x3b45('0x27')]);return _0x3da014(_0x3f6bdf['error'][_0x3b45('0x27')]);}else{logger[_0x3b45('0x20')]('Trunk,\x20%s,\x20%s',_0x51e84f,_0x3b45('0x21'));_0x3da014(_0x3f6bdf[_0x3b45('0x28')][_0x3b45('0x27')]);}})['catch'](function(_0x64d722){logger[_0x3b45('0x24')](_0x3b45('0x26'),_0x51e84f,_0x64d722);_0xbe19d3(_0x64d722);});});}function respondWithStatusCode(_0x7b3626,_0x45b13c){_0x45b13c=_0x45b13c||0xcc;return function(_0x511cf2){if(_0x511cf2){return _0x7b3626[_0x3b45('0x29')](_0x45b13c);}return _0x7b3626[_0x3b45('0x2a')](_0x45b13c)['end']();};}function respondWithResult(_0x396b67,_0x3fa010){_0x3fa010=_0x3fa010||0xc8;return function(_0x372e52){if(_0x372e52){return _0x396b67[_0x3b45('0x2a')](_0x3fa010)[_0x3b45('0x2b')](_0x372e52);}};}function respondWithFilteredResult(_0x1945fd,_0x2d9bf2){return function(_0x300098){if(_0x300098){var _0x734774=_0x300098['count'],_0x24c078=_0x2d9bf2[_0x3b45('0x2c')],_0x5ab5ea=_0x2d9bf2['offset']+_0x2d9bf2['limit'],_0x2aed14;if(_0x5ab5ea>=_0x734774){_0x5ab5ea=_0x734774;_0x2aed14=0xc8;}else{_0x2aed14=0xce;}_0x1945fd[_0x3b45('0x2a')](_0x2aed14);return _0x1945fd[_0x3b45('0x2d')](_0x3b45('0x2e'),_0x24c078+'-'+_0x5ab5ea+'/'+_0x734774)[_0x3b45('0x2b')](_0x300098);}return null;};}function patchUpdates(_0x2ec640){return function(_0x5350c9){try{jsonpatch['apply'](_0x5350c9,_0x2ec640,!![]);}catch(_0x4f7ac6){return BPromise[_0x3b45('0x2f')](_0x4f7ac6);}return _0x5350c9[_0x3b45('0x30')]();};}function saveUpdates(_0x4c646f,_0x48a370){return function(_0x21b727){if(_0x21b727){return _0x21b727['update'](_0x4c646f)[_0x3b45('0x1f')](function(_0x3442d0){return _0x3442d0;});}return null;};}function removeEntity(_0x28dbc9,_0x324ab8){return function(_0x4379b3){if(_0x4379b3){return _0x4379b3[_0x3b45('0x31')]()[_0x3b45('0x1f')](function(){var _0x4a88d4=_0x4379b3[_0x3b45('0x32')]({'plain':!![]});var _0x2d650b=_0x3b45('0x33');return db['UserProfileResource'][_0x3b45('0x31')]({'where':{'type':_0x2d650b,'resourceId':_0x4a88d4['id']}})['then'](function(){return _0x4379b3;});})['then'](function(){_0x28dbc9[_0x3b45('0x2a')](0xcc)[_0x3b45('0x34')]();});}};}function handleEntityNotFound(_0x2ef571,_0x2c854b){return function(_0x3f46ca){if(!_0x3f46ca){_0x2ef571[_0x3b45('0x29')](0x194);}return _0x3f46ca;};}function handleError(_0x393e90,_0x5f53a1){_0x5f53a1=_0x5f53a1||0x1f4;return function(_0x3efa06){logger[_0x3b45('0x24')](_0x3efa06['stack']);if(_0x3efa06[_0x3b45('0x35')]){delete _0x3efa06[_0x3b45('0x35')];}_0x393e90['status'](_0x5f53a1)[_0x3b45('0x36')](_0x3efa06);};}exports[_0x3b45('0x37')]=function(_0x534149,_0x22731d){var _0x52fa21={},_0x77c9a4={},_0x521942={'count':0x0,'rows':[]};var _0x51a78c=_[_0x3b45('0x38')](db[_0x3b45('0x39')][_0x3b45('0x3a')],function(_0x250847){return{'name':_0x250847[_0x3b45('0x3b')],'type':_0x250847[_0x3b45('0x3c')][_0x3b45('0x3d')]};});_0x77c9a4[_0x3b45('0x3e')]=_[_0x3b45('0x38')](_0x51a78c,_0x3b45('0x35'));_0x77c9a4['query']=_[_0x3b45('0x3f')](_0x534149[_0x3b45('0x40')]);_0x77c9a4[_0x3b45('0x41')]=_['intersection'](_0x77c9a4[_0x3b45('0x3e')],_0x77c9a4['query']);_0x52fa21[_0x3b45('0x42')]=_[_0x3b45('0x43')](_0x77c9a4[_0x3b45('0x3e')],qs[_0x3b45('0x44')](_0x534149[_0x3b45('0x40')][_0x3b45('0x44')]));_0x52fa21[_0x3b45('0x42')]=_0x52fa21[_0x3b45('0x42')]['length']?_0x52fa21[_0x3b45('0x42')]:_0x77c9a4[_0x3b45('0x3e')];if(!_0x534149['query'][_0x3b45('0x45')](_0x3b45('0x46'))){_0x52fa21[_0x3b45('0x47')]=qs[_0x3b45('0x47')](_0x534149['query'][_0x3b45('0x47')]);_0x52fa21[_0x3b45('0x2c')]=qs[_0x3b45('0x2c')](_0x534149[_0x3b45('0x40')][_0x3b45('0x2c')]);}_0x52fa21[_0x3b45('0x48')]=qs[_0x3b45('0x49')](_0x534149['query'][_0x3b45('0x49')]);_0x52fa21[_0x3b45('0x4a')]=qs[_0x3b45('0x41')](_[_0x3b45('0x4b')](_0x534149[_0x3b45('0x40')],_0x77c9a4['filters']));if(_0x534149[_0x3b45('0x40')]['filter']){_0x52fa21[_0x3b45('0x4a')]=_[_0x3b45('0x4c')](_0x52fa21['where'],{'$or':_[_0x3b45('0x38')](_0x51a78c,function(_0x2a4676){if(_0x2a4676[_0x3b45('0x3c')]!==_0x3b45('0x4d')){var _0x1df553={};_0x1df553[_0x2a4676[_0x3b45('0x35')]]={'$like':'%'+_0x534149[_0x3b45('0x40')][_0x3b45('0x4e')]+'%'};return _0x1df553;}})});}_0x52fa21=_[_0x3b45('0x4c')]({},_0x52fa21,_0x534149[_0x3b45('0x4f')]);var _0x83bab0={'where':_0x52fa21[_0x3b45('0x4a')]};return db[_0x3b45('0x39')]['count'](_0x83bab0)[_0x3b45('0x1f')](function(_0x5bfd2d){_0x521942[_0x3b45('0x50')]=_0x5bfd2d;if(_0x534149[_0x3b45('0x40')][_0x3b45('0x51')]){_0x52fa21[_0x3b45('0x52')]=[{'all':!![]}];}return db[_0x3b45('0x39')][_0x3b45('0x53')](_0x52fa21);})[_0x3b45('0x1f')](function(_0x2f7c04){_0x521942[_0x3b45('0x54')]=_0x2f7c04;return _0x521942;})[_0x3b45('0x1f')](respondWithFilteredResult(_0x22731d,_0x52fa21))[_0x3b45('0x55')](handleError(_0x22731d,null));};exports['show']=function(_0x3dbdf9,_0x770d12){var _0xeff29a={'raw':![],'where':{'id':_0x3dbdf9[_0x3b45('0x56')]['id']}},_0x253237={};_0x253237[_0x3b45('0x3e')]=_[_0x3b45('0x3f')](db[_0x3b45('0x39')][_0x3b45('0x3a')]);_0x253237[_0x3b45('0x40')]=_['keys'](_0x3dbdf9[_0x3b45('0x40')]);_0x253237[_0x3b45('0x41')]=_['intersection'](_0x253237[_0x3b45('0x3e')],_0x253237[_0x3b45('0x40')]);_0xeff29a['attributes']=_[_0x3b45('0x43')](_0x253237[_0x3b45('0x3e')],qs['fields'](_0x3dbdf9[_0x3b45('0x40')][_0x3b45('0x44')]));_0xeff29a['attributes']=_0xeff29a[_0x3b45('0x42')][_0x3b45('0x57')]?_0xeff29a[_0x3b45('0x42')]:_0x253237[_0x3b45('0x3e')];if(_0x3dbdf9[_0x3b45('0x40')][_0x3b45('0x51')]){_0xeff29a[_0x3b45('0x52')]=[{'all':!![]}];}_0xeff29a=_[_0x3b45('0x4c')]({},_0xeff29a,_0x3dbdf9[_0x3b45('0x4f')]);return db[_0x3b45('0x39')]['find'](_0xeff29a)['then'](handleEntityNotFound(_0x770d12,null))[_0x3b45('0x1f')](respondWithResult(_0x770d12,null))[_0x3b45('0x55')](handleError(_0x770d12,null));};exports[_0x3b45('0x58')]=function(_0x3dd601,_0x1ae716){var _0x5d6481={'where':{'id':_0x3dd601['params']['id']}},_0xf7a30e={};_0xf7a30e['model']=_[_0x3b45('0x3f')](db['Trunk'][_0x3b45('0x3a')]);_0x5d6481[_0x3b45('0x42')]=_[_0x3b45('0x43')](_0xf7a30e[_0x3b45('0x3e')],qs['fields'](_0x3dd601[_0x3b45('0x40')][_0x3b45('0x44')]));_0x5d6481['attributes']=_0x5d6481[_0x3b45('0x42')][_0x3b45('0x57')]?_0x5d6481[_0x3b45('0x42')]:_0xf7a30e['model'];if(_0x3dd601[_0x3b45('0x40')]['includeAll']){_0x5d6481['include']=[{'all':!![]}];}_0x5d6481=_[_0x3b45('0x4c')]({},_0x5d6481,_0x3dd601[_0x3b45('0x4f')]);return db[_0x3b45('0x39')]['find'](_0x5d6481)['then'](handleEntityNotFound(_0x1ae716,null))[_0x3b45('0x1f')](function(_0x5e5643){if(_0x5e5643){var _0x27a46e=_0x5e5643[_0x3b45('0x32')]({'plain':!![]});_0x27a46e=qs[_0x3b45('0x59')](_0x27a46e,['id',_0x3b45('0x5a'),'updatedAt']);_0x3dd601[_0x3b45('0x5b')]=_[_0x3b45('0x59')](_0x3dd601[_0x3b45('0x5b')],['id','createdAt',_0x3b45('0x5c')]);return db['Trunk'][_0x3b45('0x5d')](_[_0x3b45('0x4c')](_0x27a46e,_0x3dd601[_0x3b45('0x5b')]),{'include':_0x3dd601[_0x3b45('0x40')][_0x3b45('0x51')]?[{'all':!![]}]:undefined})[_0x3b45('0x1f')](function(_0x57babe){var _0x3a46c6=_0x3dd601[_0x3b45('0x5e')]['get']({'plain':!![]});if(!_0x3a46c6)throw new Error(_0x3b45('0x5f'));if(_0x3a46c6[_0x3b45('0x60')]===_0x3b45('0x5e')){var _0x139fc1=_0x57babe[_0x3b45('0x32')]({'plain':!![]});var _0x1f2deb=_0x3b45('0x33');return db[_0x3b45('0x61')][_0x3b45('0x62')]({'where':{'name':_0x1f2deb,'userProfileId':_0x3a46c6[_0x3b45('0x63')]},'raw':!![]})[_0x3b45('0x1f')](function(_0x3d7eed){if(_0x3d7eed&&_0x3d7eed[_0x3b45('0x64')]===0x0){return db[_0x3b45('0x65')][_0x3b45('0x5d')]({'name':_0x139fc1[_0x3b45('0x35')],'resourceId':_0x139fc1['id'],'type':_0x3d7eed['name'],'sectionId':_0x3d7eed['id']},{})[_0x3b45('0x1f')](function(){return _0x57babe;});}else{return _0x57babe;}})[_0x3b45('0x55')](function(_0x1edddf){logger[_0x3b45('0x24')](_0x3b45('0x66'),_0x1edddf);throw _0x1edddf;});}return _0x57babe;});}})[_0x3b45('0x1f')](respondWithResult(_0x1ae716,0xc9))[_0x3b45('0x55')](handleError(_0x1ae716,null));};exports[_0x3b45('0x5d')]=function(_0x4d14c4,_0x33e396,_0x14e31b){var _0x2f7e6e;return db[_0x3b45('0x39')][_0x3b45('0x5d')](_0x4d14c4[_0x3b45('0x5b')],{'raw':!![]})[_0x3b45('0x1f')](function(_0x407121){_0x2f7e6e=_0x407121;return db[_0x3b45('0x39')]['findAll']({'raw':!![]});})[_0x3b45('0x1f')](function(_0x314e2a){var _0x21f098=fs['readFileSync'](path[_0x3b45('0x67')](config[_0x3b45('0x68')],'server/files/templates/trunk.ejs'),'utf8');var _0x248ba0=fs[_0x3b45('0x69')](path['join'](config[_0x3b45('0x68')],'server/files/templates/registry.ejs'),_0x3b45('0x6a'));var _0x30dd0f=ejs[_0x3b45('0x6b')](_0x21f098,{'trunks':_0x314e2a||[]});fs[_0x3b45('0x6c')](_0x3b45('0x6d'),_0x30dd0f);if(_0x2f7e6e[_0x3b45('0x6e')]){var _0x553935=ejs[_0x3b45('0x6b')](_0x248ba0,{'trunks':_0x314e2a||[]});fs[_0x3b45('0x6c')](_0x3b45('0x6f'),_0x553935);}})[_0x3b45('0x1f')](function(){return respondWithRpcPromise('Reload',_0x3b45('0x5d'),{'module':_0x3b45('0x70')});})[_0x3b45('0x1f')](function(){var _0x10962c=_0x4d14c4[_0x3b45('0x5e')][_0x3b45('0x32')]({'plain':!![]});if(!_0x10962c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x10962c[_0x3b45('0x60')]===_0x3b45('0x5e')){var _0x241723=_0x2f7e6e[_0x3b45('0x32')]({'plain':!![]});return db[_0x3b45('0x61')]['find']({'where':{'name':_0x3b45('0x33'),'userProfileId':_0x10962c[_0x3b45('0x63')]},'raw':!![]})[_0x3b45('0x1f')](function(_0xebdc86){if(_0xebdc86&&_0xebdc86[_0x3b45('0x64')]===0x0){return db['UserProfileResource'][_0x3b45('0x5d')]({'name':_0x241723['name'],'resourceId':_0x241723['id'],'type':_0xebdc86[_0x3b45('0x35')],'sectionId':_0xebdc86['id']},{})[_0x3b45('0x1f')](function(){return _0x2f7e6e;});}else{return _0x2f7e6e;}})[_0x3b45('0x55')](function(_0x26e886){logger['error'](_0x3b45('0x66'),_0x26e886);throw _0x26e886;});}return _0x2f7e6e;})[_0x3b45('0x1f')](respondWithResult(_0x33e396,0xc9))[_0x3b45('0x55')](handleError(_0x33e396,null));};exports[_0x3b45('0x71')]=function(_0x1e4c9e,_0x107c57,_0x473539){var _0x537e47;return db['Trunk'][_0x3b45('0x62')]({'where':{'id':_0x1e4c9e[_0x3b45('0x56')]['id']}})[_0x3b45('0x1f')](handleEntityNotFound(_0x107c57,null))[_0x3b45('0x1f')](saveUpdates(_0x1e4c9e[_0x3b45('0x5b')],null))[_0x3b45('0x1f')](function(_0x129381){if(_0x129381){_0x537e47=_0x129381;return db[_0x3b45('0x39')]['findAll']({'raw':!![]});}})[_0x3b45('0x1f')](function(_0x7333d0){if(_0x7333d0){var _0x265563=fs[_0x3b45('0x69')](path[_0x3b45('0x67')](config['root'],_0x3b45('0x72')),_0x3b45('0x6a'));var _0x2de1f3=fs[_0x3b45('0x69')](path['join'](config['root'],_0x3b45('0x73')),_0x3b45('0x6a'));var _0x1a138=ejs[_0x3b45('0x6b')](_0x265563,{'trunks':_0x7333d0||[]});fs[_0x3b45('0x6c')](_0x3b45('0x6d'),_0x1a138);var _0x3beb9c=ejs['render'](_0x2de1f3,{'trunks':_0x7333d0||[]});fs['writeFileSync'](_0x3b45('0x6f'),_0x3beb9c);return respondWithRpcPromise(_0x3b45('0x74'),_0x3b45('0x71'),{'module':_0x3b45('0x70')});}return null;})[_0x3b45('0x1f')](function(_0x7dcc4a){if(_0x7dcc4a){return _0x537e47;}})[_0x3b45('0x1f')](respondWithResult(_0x107c57,null))[_0x3b45('0x55')](handleError(_0x107c57,null));};exports[_0x3b45('0x31')]=function(_0x1f63e3,_0x3b15d6,_0x4e65df){var _0x23dd84;return db['Trunk'][_0x3b45('0x62')]({'where':{'id':_0x1f63e3[_0x3b45('0x56')]['id']}})[_0x3b45('0x1f')](handleEntityNotFound(_0x3b15d6,null))[_0x3b45('0x1f')](removeEntity(_0x3b15d6,null))[_0x3b45('0x1f')](function(){return db[_0x3b45('0x39')][_0x3b45('0x53')]({'raw':!![]});})[_0x3b45('0x1f')](function(_0x28a729){var _0x49652e=fs[_0x3b45('0x69')](path[_0x3b45('0x67')](config[_0x3b45('0x68')],_0x3b45('0x72')),_0x3b45('0x6a'));var _0x517744=fs[_0x3b45('0x69')](path[_0x3b45('0x67')](config[_0x3b45('0x68')],_0x3b45('0x73')),_0x3b45('0x6a'));var _0x430466=ejs[_0x3b45('0x6b')](_0x49652e,{'trunks':_0x28a729});var _0x150857=ejs[_0x3b45('0x6b')](_0x517744,{'trunks':_0x28a729});fs['writeFileSync']('/etc/asterisk/sip_xcally_trunks.conf',_0x430466);fs[_0x3b45('0x6c')](_0x3b45('0x6f'),_0x150857);return respondWithRpcPromise('Reload',_0x3b45('0x31'),{'module':_0x3b45('0x70')});})[_0x3b45('0x55')](handleError(_0x3b15d6,null));}; \ No newline at end of file +var _0x58ab=['user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','join','server/files/templates/registry.ejs','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','server/files/templates/trunk.ejs','utf8','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Trunk,\x20%s,\x20%s','debug','Trunk,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','destroy','Trunks','UserProfileResource','stack','name','send','index','Trunk','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','merge','map','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','find','clone','length','get','omit','createdAt','updatedAt','body','create'];(function(_0x4d08fe,_0x2bdfe8){var _0x471b23=function(_0x3804af){while(--_0x3804af){_0x4d08fe['push'](_0x4d08fe['shift']());}};_0x471b23(++_0x2bdfe8);}(_0x58ab,0xf8));var _0xb58a=function(_0x519f23,_0x3c16a3){_0x519f23=_0x519f23-0x0;var _0xc41c01=_0x58ab[_0x519f23];return _0xc41c01;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb58a('0x0'));var rimraf=require(_0xb58a('0x1'));var zipdir=require(_0xb58a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb58a('0x3'));var moment=require(_0xb58a('0x4'));var BPromise=require(_0xb58a('0x5'));var Mustache=require(_0xb58a('0x6'));var util=require('util');var path=require(_0xb58a('0x7'));var sox=require(_0xb58a('0x8'));var csv=require(_0xb58a('0x9'));var ejs=require(_0xb58a('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb58a('0xb'));var crypto=require(_0xb58a('0xc'));var jsforce=require(_0xb58a('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb58a('0x9'));var querystring=require(_0xb58a('0xe'));var Papa=require('papaparse');var Redis=require(_0xb58a('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xb58a('0x10'));var as=require(_0xb58a('0x11'));var hardwareService=require(_0xb58a('0x12'));var logger=require(_0xb58a('0x13'))(_0xb58a('0x14'));var utils=require(_0xb58a('0x15'));var config=require(_0xb58a('0x16'));var db=require(_0xb58a('0x17'))['db'];var jayson=require(_0xb58a('0x18'));var client=jayson[_0xb58a('0x19')][_0xb58a('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1a68cf,_0x171cce,_0x5945c3){if(_0x5945c3){var _0x2225ae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2225ae['test'](_0x171cce)){return _0x1a68cf;}else{throw new db[(_0xb58a('0x1b'))][(_0xb58a('0x1c'))](_0xb58a('0x1d'));}}else{return _0x1a68cf;}}function respondWithRpcPromise(_0x39cfc1,_0xb3ba0a,_0x464991,_0x42d3d9){return new BPromise(function(_0x48bac8,_0xf67621){var _0x453824=_0x42d3d9||client;return _0x453824[_0xb58a('0x1e')](_0x39cfc1,_0x464991)[_0xb58a('0x1f')](function(_0x4a054e){logger[_0xb58a('0x20')](_0xb58a('0x21'),_0xb3ba0a,'request\x20sent');logger[_0xb58a('0x22')](_0xb58a('0x23'),_0xb3ba0a,_0xb58a('0x24'),JSON['stringify'](_0x4a054e));if(_0x4a054e['error']){if(_0x4a054e[_0xb58a('0x25')]['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0xb3ba0a,_0x4a054e[_0xb58a('0x25')][_0xb58a('0x26')]);return _0xf67621(_0x4a054e[_0xb58a('0x25')][_0xb58a('0x26')]);}logger['error'](_0xb58a('0x21'),_0xb3ba0a,_0x4a054e['error'][_0xb58a('0x26')]);return _0x48bac8(_0x4a054e[_0xb58a('0x25')][_0xb58a('0x26')]);}else{logger[_0xb58a('0x20')](_0xb58a('0x21'),_0xb3ba0a,_0xb58a('0x24'));_0x48bac8(_0x4a054e[_0xb58a('0x27')][_0xb58a('0x26')]);}})[_0xb58a('0x28')](function(_0x4a1f5f){logger[_0xb58a('0x25')](_0xb58a('0x21'),_0xb3ba0a,_0x4a1f5f);_0xf67621(_0x4a1f5f);});});}function respondWithStatusCode(_0x543212,_0x5a2254){_0x5a2254=_0x5a2254||0xcc;return function(_0xa52543){if(_0xa52543){return _0x543212[_0xb58a('0x29')](_0x5a2254);}return _0x543212[_0xb58a('0x2a')](_0x5a2254)[_0xb58a('0x2b')]();};}function respondWithResult(_0x5d8923,_0x3e98f2){_0x3e98f2=_0x3e98f2||0xc8;return function(_0x199ce5){if(_0x199ce5){return _0x5d8923['status'](_0x3e98f2)[_0xb58a('0x2c')](_0x199ce5);}};}function respondWithFilteredResult(_0x3380c6,_0x34a3d5){return function(_0x28d062){if(_0x28d062){var _0x3ba89f=_0x28d062['count'],_0x5461bc=_0x34a3d5[_0xb58a('0x2d')],_0x2ebf78=_0x34a3d5['offset']+_0x34a3d5[_0xb58a('0x2e')],_0x14c49f;if(_0x2ebf78>=_0x3ba89f){_0x2ebf78=_0x3ba89f;_0x14c49f=0xc8;}else{_0x14c49f=0xce;}_0x3380c6['status'](_0x14c49f);return _0x3380c6[_0xb58a('0x2f')]('Content-Range',_0x5461bc+'-'+_0x2ebf78+'/'+_0x3ba89f)[_0xb58a('0x2c')](_0x28d062);}return null;};}function patchUpdates(_0x2ca030){return function(_0x2488af){try{jsonpatch[_0xb58a('0x30')](_0x2488af,_0x2ca030,!![]);}catch(_0x2c325d){return BPromise[_0xb58a('0x31')](_0x2c325d);}return _0x2488af[_0xb58a('0x32')]();};}function saveUpdates(_0x595938,_0xf24843){return function(_0x4d3c4b){if(_0x4d3c4b){return _0x4d3c4b[_0xb58a('0x33')](_0x595938)[_0xb58a('0x1f')](function(_0x28d685){return _0x28d685;});}return null;};}function removeEntity(_0x3c7206,_0x4daf0){return function(_0x316ab8){if(_0x316ab8){return _0x316ab8[_0xb58a('0x34')]()[_0xb58a('0x1f')](function(){var _0x25f618=_0x316ab8['get']({'plain':!![]});var _0x27a3bf=_0xb58a('0x35');return db[_0xb58a('0x36')]['destroy']({'where':{'type':_0x27a3bf,'resourceId':_0x25f618['id']}})[_0xb58a('0x1f')](function(){return _0x316ab8;});})['then'](function(){_0x3c7206['status'](0xcc)[_0xb58a('0x2b')]();});}};}function handleEntityNotFound(_0x14b4f2,_0x145112){return function(_0x5f40f5){if(!_0x5f40f5){_0x14b4f2[_0xb58a('0x29')](0x194);}return _0x5f40f5;};}function handleError(_0x5a7eb1,_0x276287){_0x276287=_0x276287||0x1f4;return function(_0x593771){logger['error'](_0x593771[_0xb58a('0x37')]);if(_0x593771['name']){delete _0x593771[_0xb58a('0x38')];}_0x5a7eb1[_0xb58a('0x2a')](_0x276287)[_0xb58a('0x39')](_0x593771);};}exports[_0xb58a('0x3a')]=function(_0x4509aa,_0x526fe6){var _0x5cfcb8={},_0x11bdc5={},_0x3ebc31={'count':0x0,'rows':[]};var _0x5b4d79=_['map'](db[_0xb58a('0x3b')]['rawAttributes'],function(_0x582dae){return{'name':_0x582dae[_0xb58a('0x3c')],'type':_0x582dae[_0xb58a('0x3d')]['key']};});_0x11bdc5[_0xb58a('0x3e')]=_['map'](_0x5b4d79,_0xb58a('0x38'));_0x11bdc5[_0xb58a('0x3f')]=_[_0xb58a('0x40')](_0x4509aa[_0xb58a('0x3f')]);_0x11bdc5[_0xb58a('0x41')]=_[_0xb58a('0x42')](_0x11bdc5[_0xb58a('0x3e')],_0x11bdc5['query']);_0x5cfcb8[_0xb58a('0x43')]=_[_0xb58a('0x42')](_0x11bdc5[_0xb58a('0x3e')],qs[_0xb58a('0x44')](_0x4509aa[_0xb58a('0x3f')][_0xb58a('0x44')]));_0x5cfcb8[_0xb58a('0x43')]=_0x5cfcb8[_0xb58a('0x43')]['length']?_0x5cfcb8['attributes']:_0x11bdc5[_0xb58a('0x3e')];if(!_0x4509aa[_0xb58a('0x3f')][_0xb58a('0x45')](_0xb58a('0x46'))){_0x5cfcb8[_0xb58a('0x2e')]=qs[_0xb58a('0x2e')](_0x4509aa[_0xb58a('0x3f')][_0xb58a('0x2e')]);_0x5cfcb8[_0xb58a('0x2d')]=qs['offset'](_0x4509aa['query']['offset']);}_0x5cfcb8['order']=qs[_0xb58a('0x47')](_0x4509aa[_0xb58a('0x3f')][_0xb58a('0x47')]);_0x5cfcb8[_0xb58a('0x48')]=qs[_0xb58a('0x41')](_[_0xb58a('0x49')](_0x4509aa['query'],_0x11bdc5['filters']));if(_0x4509aa[_0xb58a('0x3f')]['filter']){_0x5cfcb8[_0xb58a('0x48')]=_[_0xb58a('0x4a')](_0x5cfcb8[_0xb58a('0x48')],{'$or':_[_0xb58a('0x4b')](_0x5b4d79,function(_0x4a6dcd){if(_0x4a6dcd[_0xb58a('0x3d')]!=='VIRTUAL'){var _0x350042={};_0x350042[_0x4a6dcd[_0xb58a('0x38')]]={'$like':'%'+_0x4509aa[_0xb58a('0x3f')]['filter']+'%'};return _0x350042;}})});}_0x5cfcb8=_['merge']({},_0x5cfcb8,_0x4509aa[_0xb58a('0x4c')]);var _0x544778={'where':_0x5cfcb8['where']};return db[_0xb58a('0x3b')][_0xb58a('0x4d')](_0x544778)[_0xb58a('0x1f')](function(_0x1151f1){_0x3ebc31[_0xb58a('0x4d')]=_0x1151f1;if(_0x4509aa[_0xb58a('0x3f')][_0xb58a('0x4e')]){_0x5cfcb8[_0xb58a('0x4f')]=[{'all':!![]}];}return db['Trunk'][_0xb58a('0x50')](_0x5cfcb8);})[_0xb58a('0x1f')](function(_0x49377c){_0x3ebc31[_0xb58a('0x51')]=_0x49377c;return _0x3ebc31;})[_0xb58a('0x1f')](respondWithFilteredResult(_0x526fe6,_0x5cfcb8))[_0xb58a('0x28')](handleError(_0x526fe6,null));};exports[_0xb58a('0x52')]=function(_0xaf1fa0,_0x4087e3){var _0x22c0be={'raw':![],'where':{'id':_0xaf1fa0[_0xb58a('0x53')]['id']}},_0x3835c5={};_0x3835c5['model']=_['keys'](db[_0xb58a('0x3b')][_0xb58a('0x54')]);_0x3835c5[_0xb58a('0x3f')]=_[_0xb58a('0x40')](_0xaf1fa0['query']);_0x3835c5[_0xb58a('0x41')]=_[_0xb58a('0x42')](_0x3835c5[_0xb58a('0x3e')],_0x3835c5['query']);_0x22c0be[_0xb58a('0x43')]=_[_0xb58a('0x42')](_0x3835c5['model'],qs[_0xb58a('0x44')](_0xaf1fa0[_0xb58a('0x3f')][_0xb58a('0x44')]));_0x22c0be[_0xb58a('0x43')]=_0x22c0be[_0xb58a('0x43')]['length']?_0x22c0be[_0xb58a('0x43')]:_0x3835c5[_0xb58a('0x3e')];if(_0xaf1fa0[_0xb58a('0x3f')][_0xb58a('0x4e')]){_0x22c0be['include']=[{'all':!![]}];}_0x22c0be=_['merge']({},_0x22c0be,_0xaf1fa0[_0xb58a('0x4c')]);return db[_0xb58a('0x3b')][_0xb58a('0x55')](_0x22c0be)[_0xb58a('0x1f')](handleEntityNotFound(_0x4087e3,null))[_0xb58a('0x1f')](respondWithResult(_0x4087e3,null))[_0xb58a('0x28')](handleError(_0x4087e3,null));};exports[_0xb58a('0x56')]=function(_0x599210,_0x23dd4c){var _0x1debe4={'where':{'id':_0x599210['params']['id']}},_0x442b80={};_0x442b80[_0xb58a('0x3e')]=_['keys'](db[_0xb58a('0x3b')][_0xb58a('0x54')]);_0x1debe4[_0xb58a('0x43')]=_[_0xb58a('0x42')](_0x442b80[_0xb58a('0x3e')],qs[_0xb58a('0x44')](_0x599210[_0xb58a('0x3f')][_0xb58a('0x44')]));_0x1debe4['attributes']=_0x1debe4[_0xb58a('0x43')][_0xb58a('0x57')]?_0x1debe4[_0xb58a('0x43')]:_0x442b80[_0xb58a('0x3e')];if(_0x599210[_0xb58a('0x3f')]['includeAll']){_0x1debe4[_0xb58a('0x4f')]=[{'all':!![]}];}_0x1debe4=_[_0xb58a('0x4a')]({},_0x1debe4,_0x599210[_0xb58a('0x4c')]);return db[_0xb58a('0x3b')]['find'](_0x1debe4)[_0xb58a('0x1f')](handleEntityNotFound(_0x23dd4c,null))['then'](function(_0x19c8c1){if(_0x19c8c1){var _0xf045e9=_0x19c8c1[_0xb58a('0x58')]({'plain':!![]});_0xf045e9=qs[_0xb58a('0x59')](_0xf045e9,['id',_0xb58a('0x5a'),_0xb58a('0x5b')]);_0x599210[_0xb58a('0x5c')]=_[_0xb58a('0x59')](_0x599210[_0xb58a('0x5c')],['id',_0xb58a('0x5a'),_0xb58a('0x5b')]);return db[_0xb58a('0x3b')][_0xb58a('0x5d')](_[_0xb58a('0x4a')](_0xf045e9,_0x599210[_0xb58a('0x5c')]),{'include':_0x599210[_0xb58a('0x3f')][_0xb58a('0x4e')]?[{'all':!![]}]:undefined})[_0xb58a('0x1f')](function(_0x1f4e76){var _0x1aae72=_0x599210[_0xb58a('0x5e')][_0xb58a('0x58')]({'plain':!![]});if(!_0x1aae72)throw new Error(_0xb58a('0x5f'));if(_0x1aae72[_0xb58a('0x60')]===_0xb58a('0x5e')){var _0x1f3443=_0x1f4e76[_0xb58a('0x58')]({'plain':!![]});var _0x2e49e5=_0xb58a('0x35');return db[_0xb58a('0x61')][_0xb58a('0x55')]({'where':{'name':_0x2e49e5,'userProfileId':_0x1aae72[_0xb58a('0x62')]},'raw':!![]})[_0xb58a('0x1f')](function(_0x48368f){if(_0x48368f&&_0x48368f[_0xb58a('0x63')]===0x0){return db['UserProfileResource'][_0xb58a('0x5d')]({'name':_0x1f3443[_0xb58a('0x38')],'resourceId':_0x1f3443['id'],'type':_0x48368f['name'],'sectionId':_0x48368f['id']},{})[_0xb58a('0x1f')](function(){return _0x1f4e76;});}else{return _0x1f4e76;}})[_0xb58a('0x28')](function(_0x53d079){logger['error'](_0xb58a('0x64'),_0x53d079);throw _0x53d079;});}return _0x1f4e76;});}})[_0xb58a('0x1f')](respondWithResult(_0x23dd4c,0xc9))['catch'](handleError(_0x23dd4c,null));};exports['create']=function(_0x5cbbe9,_0x372093,_0x2a3f5a){var _0x254222;return db['Trunk'][_0xb58a('0x5d')](_0x5cbbe9['body'],{'raw':!![]})[_0xb58a('0x1f')](function(_0x3f0892){_0x254222=_0x3f0892;return db[_0xb58a('0x3b')][_0xb58a('0x50')]({'raw':!![]});})[_0xb58a('0x1f')](function(_0x2435ac){var _0x5763bb=fs[_0xb58a('0x65')](path['join'](config[_0xb58a('0x66')],'server/files/templates/trunk.ejs'),'utf8');var _0xdc75f9=fs['readFileSync'](path[_0xb58a('0x67')](config[_0xb58a('0x66')],_0xb58a('0x68')),'utf8');var _0x33fb83=ejs[_0xb58a('0x69')](_0x5763bb,{'trunks':_0x2435ac||[]});fs[_0xb58a('0x6a')](_0xb58a('0x6b'),_0x33fb83);if(_0x254222[_0xb58a('0x6c')]){var _0x8b2cc=ejs['render'](_0xdc75f9,{'trunks':_0x2435ac||[]});fs[_0xb58a('0x6a')](_0xb58a('0x6d'),_0x8b2cc);}})['then'](function(){return respondWithRpcPromise(_0xb58a('0x6e'),_0xb58a('0x5d'),{'module':_0xb58a('0x6f')});})[_0xb58a('0x1f')](function(){var _0x2c0e4b=_0x5cbbe9[_0xb58a('0x5e')][_0xb58a('0x58')]({'plain':!![]});if(!_0x2c0e4b)throw new Error(_0xb58a('0x5f'));if(_0x2c0e4b[_0xb58a('0x60')]===_0xb58a('0x5e')){var _0x3de7d4=_0x254222[_0xb58a('0x58')]({'plain':!![]});return db['UserProfileSection'][_0xb58a('0x55')]({'where':{'name':_0xb58a('0x35'),'userProfileId':_0x2c0e4b[_0xb58a('0x62')]},'raw':!![]})['then'](function(_0x38ff02){if(_0x38ff02&&_0x38ff02[_0xb58a('0x63')]===0x0){return db[_0xb58a('0x36')][_0xb58a('0x5d')]({'name':_0x3de7d4['name'],'resourceId':_0x3de7d4['id'],'type':_0x38ff02[_0xb58a('0x38')],'sectionId':_0x38ff02['id']},{})[_0xb58a('0x1f')](function(){return _0x254222;});}else{return _0x254222;}})[_0xb58a('0x28')](function(_0xe7ea5c){logger[_0xb58a('0x25')](_0xb58a('0x64'),_0xe7ea5c);throw _0xe7ea5c;});}return _0x254222;})['then'](respondWithResult(_0x372093,0xc9))[_0xb58a('0x28')](handleError(_0x372093,null));};exports['update']=function(_0x26e0fd,_0x573779,_0x2c4b93){var _0x506929;return db[_0xb58a('0x3b')][_0xb58a('0x55')]({'where':{'id':_0x26e0fd['params']['id']}})['then'](handleEntityNotFound(_0x573779,null))[_0xb58a('0x1f')](saveUpdates(_0x26e0fd[_0xb58a('0x5c')],null))[_0xb58a('0x1f')](function(_0x591311){if(_0x591311){_0x506929=_0x591311;return db[_0xb58a('0x3b')]['findAll']({'raw':!![]});}})['then'](function(_0x459100){if(_0x459100){var _0x15fa68=fs['readFileSync'](path['join'](config[_0xb58a('0x66')],_0xb58a('0x70')),_0xb58a('0x71'));var _0x11f21d=fs[_0xb58a('0x65')](path[_0xb58a('0x67')](config[_0xb58a('0x66')],_0xb58a('0x68')),_0xb58a('0x71'));var _0x2f3022=ejs['render'](_0x15fa68,{'trunks':_0x459100||[]});fs[_0xb58a('0x6a')](_0xb58a('0x6b'),_0x2f3022);var _0x35df87=ejs[_0xb58a('0x69')](_0x11f21d,{'trunks':_0x459100||[]});fs['writeFileSync']('/etc/asterisk/sip_xcally_registers.conf',_0x35df87);return respondWithRpcPromise(_0xb58a('0x6e'),_0xb58a('0x33'),{'module':_0xb58a('0x6f')});}return null;})[_0xb58a('0x1f')](function(_0x471497){if(_0x471497){return _0x506929;}})['then'](respondWithResult(_0x573779,null))['catch'](handleError(_0x573779,null));};exports[_0xb58a('0x34')]=function(_0x5b00cc,_0x48cdbd,_0x32f602){var _0x5c09df;return db[_0xb58a('0x3b')][_0xb58a('0x55')]({'where':{'id':_0x5b00cc[_0xb58a('0x53')]['id']}})[_0xb58a('0x1f')](handleEntityNotFound(_0x48cdbd,null))[_0xb58a('0x1f')](removeEntity(_0x48cdbd,null))['then'](function(){return db['Trunk'][_0xb58a('0x50')]({'raw':!![]});})[_0xb58a('0x1f')](function(_0x3ff774){var _0x235a8d=fs[_0xb58a('0x65')](path[_0xb58a('0x67')](config[_0xb58a('0x66')],_0xb58a('0x70')),_0xb58a('0x71'));var _0x3c449c=fs['readFileSync'](path['join'](config[_0xb58a('0x66')],_0xb58a('0x68')),_0xb58a('0x71'));var _0x23d55a=ejs[_0xb58a('0x69')](_0x235a8d,{'trunks':_0x3ff774});var _0x38de05=ejs[_0xb58a('0x69')](_0x3c449c,{'trunks':_0x3ff774});fs[_0xb58a('0x6a')]('/etc/asterisk/sip_xcally_trunks.conf',_0x23d55a);fs[_0xb58a('0x6a')](_0xb58a('0x6d'),_0x38de05);return respondWithRpcPromise(_0xb58a('0x6e'),'destroy',{'module':_0xb58a('0x6f')});})[_0xb58a('0x28')](handleError(_0x48cdbd,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 9969740..fca2e5b 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 _0xe737=['tools_trunks','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','./trunk.attributes','exports','define','Trunk'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0xe737,0x146));var _0x7e73=function(_0xf8adda,_0x54e6c0){_0xf8adda=_0xf8adda-0x0;var _0x59159e=_0xe737[_0xf8adda];return _0x59159e;};'use strict';var _=require(_0x7e73('0x0'));var util=require(_0x7e73('0x1'));var logger=require(_0x7e73('0x2'))('api');var moment=require(_0x7e73('0x3'));var BPromise=require(_0x7e73('0x4'));var rp=require(_0x7e73('0x5'));var fs=require('fs');var path=require(_0x7e73('0x6'));var rimraf=require(_0x7e73('0x7'));var config=require('../../config/environment');var attributes=require(_0x7e73('0x8'));module[_0x7e73('0x9')]=function(_0x3d055d,_0xf54264){return _0x3d055d[_0x7e73('0xa')](_0x7e73('0xb'),attributes,{'tableName':_0x7e73('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6ce5=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks'];(function(_0x40cb7a,_0x505484){var _0x246f9c=function(_0x3bd730){while(--_0x3bd730){_0x40cb7a['push'](_0x40cb7a['shift']());}};_0x246f9c(++_0x505484);}(_0x6ce5,0xb4));var _0x56ce=function(_0x677170,_0x1dfe5e){_0x677170=_0x677170-0x0;var _0x495c99=_0x6ce5[_0x677170];return _0x495c99;};'use strict';var _=require(_0x56ce('0x0'));var util=require(_0x56ce('0x1'));var logger=require(_0x56ce('0x2'))(_0x56ce('0x3'));var moment=require(_0x56ce('0x4'));var BPromise=require(_0x56ce('0x5'));var rp=require(_0x56ce('0x6'));var fs=require('fs');var path=require(_0x56ce('0x7'));var rimraf=require(_0x56ce('0x8'));var config=require(_0x56ce('0x9'));var attributes=require(_0x56ce('0xa'));module[_0x56ce('0xb')]=function(_0x341535,_0xba13bd){return _0x341535[_0x56ce('0xc')](_0x56ce('0xd'),attributes,{'tableName':_0x56ce('0xe'),'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 e840663..c617489 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 _0x1a85=['info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrunk','Trunk','options','raw','where','limit','include','model','map','attributes','then','ShowTrunk','find','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x1a85,0x178));var _0x51a8=function(_0x606704,_0x4a08f8){_0x606704=_0x606704-0x0;var _0x11a29d=_0x1a85[_0x606704];return _0x11a29d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x51a8('0x0'));var BPromise=require(_0x51a8('0x1'));var rs=require(_0x51a8('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x51a8('0x3'));var logger=require(_0x51a8('0x4'))(_0x51a8('0x5'));var config=require('../../config/environment');var jayson=require(_0x51a8('0x6'));var client=jayson['client'][_0x51a8('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5cf430,_0x331117,_0x16a21e){return new BPromise(function(_0x4f3919,_0x228c64){return client['request'](_0x5cf430,_0x16a21e)['then'](function(_0x39e06a){logger[_0x51a8('0x8')](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));logger[_0x51a8('0xb')](_0x51a8('0xc'),_0x331117,_0x51a8('0xa'),JSON[_0x51a8('0xd')](_0x39e06a));if(_0x39e06a[_0x51a8('0xe')]){if(_0x39e06a[_0x51a8('0xe')][_0x51a8('0xf')]===0x1f4){logger[_0x51a8('0xe')](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x228c64(_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);}logger['error'](_0x51a8('0x9'),_0x331117,_0x39e06a[_0x51a8('0xe')][_0x51a8('0x10')]);return _0x4f3919(_0x39e06a['error'][_0x51a8('0x10')]);}else{logger['info'](_0x51a8('0x9'),_0x331117,_0x51a8('0xa'));_0x4f3919(_0x39e06a[_0x51a8('0x11')][_0x51a8('0x10')]);}})[_0x51a8('0x12')](function(_0x3e0603){logger[_0x51a8('0xe')]('Trunk,\x20%s,\x20%s',_0x331117,_0x3e0603);_0x228c64(_0x3e0603);});});}exports[_0x51a8('0x13')]=function(_0x45a433){var _0xd52230=this;return new Promise(function(_0x23539e,_0x3bc1a2){return db[_0x51a8('0x14')]['findAll']({'raw':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x16')]===undefined?!![]:![]:!![],'where':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x17')]||null:null,'attributes':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')]['attributes']||null:null,'limit':_0x45a433[_0x51a8('0x15')]?_0x45a433['options'][_0x51a8('0x18')]||null:null,'include':_0x45a433[_0x51a8('0x15')]?_0x45a433[_0x51a8('0x15')][_0x51a8('0x19')]?_['map'](_0x45a433[_0x51a8('0x15')]['include'],function(_0x47f063){return{'model':db[_0x47f063[_0x51a8('0x1a')]],'as':_0x47f063['as'],'attributes':_0x47f063['attributes'],'include':_0x47f063[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x47f063[_0x51a8('0x19')],function(_0x18e2f3){return{'model':db[_0x18e2f3[_0x51a8('0x1a')]],'as':_0x18e2f3['as'],'attributes':_0x18e2f3[_0x51a8('0x1c')],'include':_0x18e2f3[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x18e2f3['include'],function(_0x273ce2){return{'model':db[_0x273ce2[_0x51a8('0x1a')]],'as':_0x273ce2['as'],'attributes':_0x273ce2[_0x51a8('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x1c150d){logger[_0x51a8('0x8')](_0x51a8('0x13'),_0x45a433);logger[_0x51a8('0xb')](_0x51a8('0x13'),_0x45a433,JSON[_0x51a8('0xd')](_0x1c150d));_0x23539e(_0x1c150d);})[_0x51a8('0x12')](function(_0x347a02){logger['error'](_0x51a8('0x13'),_0x347a02['message'],_0x45a433);_0x3bc1a2(_0xd52230[_0x51a8('0xe')](0x1f4,_0x347a02[_0x51a8('0x10')]));});});};exports[_0x51a8('0x1e')]=function(_0x41df56){var _0x2136b4=this;return new Promise(function(_0x4ea271,_0x10c19b){return db['Trunk'][_0x51a8('0x1f')]({'raw':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x17')]||null:null,'attributes':_0x41df56[_0x51a8('0x15')]?_0x41df56[_0x51a8('0x15')][_0x51a8('0x1c')]||null:null,'include':_0x41df56[_0x51a8('0x15')]?_0x41df56['options'][_0x51a8('0x19')]?_['map'](_0x41df56[_0x51a8('0x15')][_0x51a8('0x19')],function(_0x41561a){return{'model':db[_0x41561a['model']],'as':_0x41561a['as'],'attributes':_0x41561a[_0x51a8('0x1c')],'include':_0x41561a[_0x51a8('0x19')]?_[_0x51a8('0x1b')](_0x41561a[_0x51a8('0x19')],function(_0x41c020){return{'model':db[_0x41c020['model']],'as':_0x41c020['as'],'attributes':_0x41c020['attributes'],'include':_0x41c020['include']?_[_0x51a8('0x1b')](_0x41c020[_0x51a8('0x19')],function(_0x4ec1db){return{'model':db[_0x4ec1db[_0x51a8('0x1a')]],'as':_0x4ec1db['as'],'attributes':_0x4ec1db['attributes']};}):[]};}):[]};}):[]:[]})[_0x51a8('0x1d')](function(_0x38aa25){logger[_0x51a8('0x8')](_0x51a8('0x1e'),_0x41df56);logger[_0x51a8('0xb')](_0x51a8('0x1e'),_0x41df56,JSON['stringify'](_0x38aa25));_0x4ea271(_0x38aa25);})['catch'](function(_0x377b4c){logger['error']('ShowTrunk',_0x377b4c['message'],_0x41df56);_0x10c19b(_0x2136b4[_0x51a8('0xe')](0x1f4,_0x377b4c[_0x51a8('0x10')]));});});}; \ No newline at end of file +var _0x4fc2=['rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','include','model','map','GetTrunk','Trunk','find','raw','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x19c64a,_0x5de14e){var _0x1b1a06=function(_0x5dd104){while(--_0x5dd104){_0x19c64a['push'](_0x19c64a['shift']());}};_0x1b1a06(++_0x5de14e);}(_0x4fc2,0x111));var _0x24fc=function(_0x4ae578,_0x47156f){_0x4ae578=_0x4ae578-0x0;var _0x386e83=_0x4fc2[_0x4ae578];return _0x386e83;};'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')]('Trunk,\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')]('Trunk,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['GetTrunk']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['Trunk'][_0x24fc('0x17')]({'raw':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x23873c[_0x24fc('0x18')]?_0x23873c['options'][_0x24fc('0x1a')]||null:null,'limit':_0x23873c['options']?_0x23873c[_0x24fc('0x18')]['limit']||null:null,'include':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x23873c[_0x24fc('0x18')]['include'],function(_0x35a9c7){return{'model':db[_0x35a9c7[_0x24fc('0x1c')]],'as':_0x35a9c7['as'],'attributes':_0x35a9c7[_0x24fc('0x1a')],'include':_0x35a9c7[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x35a9c7[_0x24fc('0x1b')],function(_0x3f0875){return{'model':db[_0x3f0875[_0x24fc('0x1c')]],'as':_0x3f0875['as'],'attributes':_0x3f0875[_0x24fc('0x1a')],'include':_0x3f0875[_0x24fc('0x1b')]?_['map'](_0x3f0875[_0x24fc('0x1b')],function(_0x16f27f){return{'model':db[_0x16f27f[_0x24fc('0x1c')]],'as':_0x16f27f['as'],'attributes':_0x16f27f['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x3d1ec8){logger[_0x24fc('0xd')](_0x24fc('0x1e'),_0x23873c);logger[_0x24fc('0x10')](_0x24fc('0x1e'),_0x23873c,JSON['stringify'](_0x3d1ec8));_0x6cfa0a(_0x3d1ec8);})[_0x24fc('0x16')](function(_0x29a461){logger[_0x24fc('0x13')](_0x24fc('0x1e'),_0x29a461[_0x24fc('0x15')],_0x23873c);_0x8ac114(_0x1cb3d0['error'](0x1f4,_0x29a461['message']));});});};exports['ShowTrunk']=function(_0x3df6f4){var _0x574ba3=this;return new Promise(function(_0x3f2464,_0x3e6389){return db[_0x24fc('0x1f')][_0x24fc('0x20')]({'raw':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x21')]===undefined?!![]:![]:!![],'where':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x3df6f4['options']?_0x3df6f4['options'][_0x24fc('0x1a')]||null:null,'include':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')],function(_0x3b2862){return{'model':db[_0x3b2862[_0x24fc('0x1c')]],'as':_0x3b2862['as'],'attributes':_0x3b2862[_0x24fc('0x1a')],'include':_0x3b2862[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x3b2862[_0x24fc('0x1b')],function(_0x379a4a){return{'model':db[_0x379a4a['model']],'as':_0x379a4a['as'],'attributes':_0x379a4a[_0x24fc('0x1a')],'include':_0x379a4a[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x379a4a[_0x24fc('0x1b')],function(_0x242bd5){return{'model':db[_0x242bd5['model']],'as':_0x242bd5['as'],'attributes':_0x242bd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x5d48fe){logger[_0x24fc('0xd')](_0x24fc('0x22'),_0x3df6f4);logger[_0x24fc('0x10')](_0x24fc('0x22'),_0x3df6f4,JSON['stringify'](_0x5d48fe));_0x3f2464(_0x5d48fe);})[_0x24fc('0x16')](function(_0x4f4ec8){logger[_0x24fc('0x13')](_0x24fc('0x22'),_0x4f4ec8[_0x24fc('0x15')],_0x3df6f4);_0x3e6389(_0x574ba3[_0x24fc('0x13')](0x1f4,_0x4f4ec8[_0x24fc('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index c3556b4..01a16a5 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 _0x5f2f=['createApiKey','update','/:id/password','changePassword','removeQueues','removeTeams','destroy','delete','removeFaxInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/whoami','/:id','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','join','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects'];(function(_0x1ca890,_0x21d0d3){var _0x3f8e01=function(_0x4ff2e2){while(--_0x4ff2e2){_0x1ca890['push'](_0x1ca890['shift']());}};_0x3f8e01(++_0x21d0d3);}(_0x5f2f,0x73));var _0xf5f2=function(_0x9e7dbc,_0x3e3887){_0x9e7dbc=_0x9e7dbc-0x0;var _0xb2f0a7=_0x5f2f[_0x9e7dbc];return _0xb2f0a7;};'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('./user.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['whoami']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')]('/:id/avatar',controller['getAvatar']);router[_0xf5f2('0x8')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x8')](_0xf5f2('0x10'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x11')]);router[_0xf5f2('0x8')]('/:id/queues_rt',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x8')](_0xf5f2('0x13'),auth[_0xf5f2('0x9')](),controller['getGroups']);router[_0xf5f2('0x8')](_0xf5f2('0x14'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x15')]);router[_0xf5f2('0x8')](_0xf5f2('0x16'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x8')](_0xf5f2('0x18'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x19')]);router[_0xf5f2('0x8')](_0xf5f2('0x1a'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1b')]);router[_0xf5f2('0x8')]('/:id/mail/interactions',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1c')]);router['get']('/:id/sms/interactions',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1d')]);router['get'](_0xf5f2('0x1e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1f')]);router[_0xf5f2('0x8')](_0xf5f2('0x20'),auth['isAuthenticated'](),controller[_0xf5f2('0x21')]);router[_0xf5f2('0x8')](_0xf5f2('0x22'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x23')]);router['get']('/:id/agents',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x24')]);router[_0xf5f2('0x8')](_0xf5f2('0x25'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x26')]);router[_0xf5f2('0x8')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller['getFaxAccounts']);router[_0xf5f2('0x8')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x29')]);router[_0xf5f2('0x8')](_0xf5f2('0x2a'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xf5f2('0x8')](_0xf5f2('0x2b'),auth[_0xf5f2('0x9')](),controller['getSmsAccounts']);router['get'](_0xf5f2('0x2c'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x2d')]);router[_0xf5f2('0x8')](_0xf5f2('0x2e'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0xf5f2('0x8')]('/:id/scheduled_calls',auth[_0xf5f2('0x9')](),controller['getScheduledCalls']);router[_0xf5f2('0x8')](_0xf5f2('0x2f'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x30')]);router[_0xf5f2('0x31')](_0xf5f2('0x32'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x33')]);router['post'](_0xf5f2('0xe'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x34')]);router[_0xf5f2('0x31')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x35')]);router[_0xf5f2('0x31')]('/:id/queues',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3fc168,_0x4b8c42,_0x18ae07){_0x18ae07(null,path[_0xf5f2('0x37')](config[_0xf5f2('0x38')],_0xf5f2('0x39')));},'filename':function(_0x59a6dd,_0x5a98d7,_0x41088b){_0x41088b(null,util[_0xf5f2('0x3a')](_0xf5f2('0x3b'),Date['now'](),_0x5a98d7[_0xf5f2('0x3c')]));}})});router['post'](_0xf5f2('0x3d'),upload['single'](_0xf5f2('0x3e')),controller[_0xf5f2('0x3f')]);router['post'](_0xf5f2('0x40'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x41')]);router[_0xf5f2('0x31')]('/:id/logout',auth['isAuthenticated'](),controller[_0xf5f2('0x42')]);router[_0xf5f2('0x31')](_0xf5f2('0x43'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x44')]);router[_0xf5f2('0x31')](_0xf5f2('0x45'),auth['isAuthenticated'](),controller[_0xf5f2('0x46')]);router[_0xf5f2('0x31')]('/:id/teams',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x47')]);router[_0xf5f2('0x31')](_0xf5f2('0x48'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x49')]);router[_0xf5f2('0x31')](_0xf5f2('0x4a'),auth['isAuthenticated'](),controller[_0xf5f2('0x4b')]);router[_0xf5f2('0x31')](_0xf5f2('0x4c'),auth['isAuthenticated'](),controller['addFaxInteractions']);router['post'](_0xf5f2('0x4d'),auth[_0xf5f2('0x9')](),controller['addSmsInteractions']);router[_0xf5f2('0x31')](_0xf5f2('0x4e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x4f')]);router[_0xf5f2('0x31')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x50')]);router[_0xf5f2('0x31')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x51')]);router[_0xf5f2('0x31')](_0xf5f2('0x2a'),auth['isAuthenticated'](),controller[_0xf5f2('0x52')]);router['post'](_0xf5f2('0x2b'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x53')]);router[_0xf5f2('0x31')](_0xf5f2('0x2c'),auth[_0xf5f2('0x9')](),controller['addChatWebsites']);router[_0xf5f2('0x31')](_0xf5f2('0x2e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x54')]);router[_0xf5f2('0x31')](_0xf5f2('0x2f'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x55')]);router['put'](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x56')]);router['put'](_0xf5f2('0x57'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x58')]);router['delete']('/:id/queues',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x59')]);router['delete'](_0xf5f2('0x20'),auth['isAuthenticated'](),controller[_0xf5f2('0x5a')]);router['delete'](_0xf5f2('0xd'),auth['isAuthenticated'](),controller[_0xf5f2('0x5b')]);router[_0xf5f2('0x5c')](_0xf5f2('0x48'),auth[_0xf5f2('0x9')](),controller['removeChatInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x4a'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x4c'),auth['isAuthenticated'](),controller[_0xf5f2('0x5d')]);router[_0xf5f2('0x5c')](_0xf5f2('0x4d'),auth[_0xf5f2('0x9')](),controller['removeSmsInteractions']);router['delete'](_0xf5f2('0x4e'),auth[_0xf5f2('0x9')](),controller['removeOpenchannelInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x5e')]);router[_0xf5f2('0x5c')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller['removeMailAccounts']);router['delete'](_0xf5f2('0x2a'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x5f')]);router[_0xf5f2('0x5c')](_0xf5f2('0x2b'),auth['isAuthenticated'](),controller[_0xf5f2('0x60')]);router[_0xf5f2('0x5c')](_0xf5f2('0x2c'),auth['isAuthenticated'](),controller[_0xf5f2('0x61')]);router['delete'](_0xf5f2('0x2e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x62')]);router[_0xf5f2('0x5c')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xf5f2('0x63')]);module['exports']=router; \ No newline at end of file +var _0x5f2f=['createApiKey','update','/:id/password','changePassword','removeQueues','removeTeams','destroy','delete','removeFaxInteractions','removeFaxAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe','/whoami','/:id','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','/:id/api_key','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','join','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','file','addAvatar','/:id/login','login','logout','/:id/pause','pause','/:id/unpause','unpause','addTeams','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','addMailInteractions','/:id/fax_interactions','/:id/sms_interactions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addSmsAccounts','addSquareProjects'];(function(_0x1fc4e2,_0x493c3b){var _0x2ba184=function(_0x58e64f){while(--_0x58e64f){_0x1fc4e2['push'](_0x1fc4e2['shift']());}};_0x2ba184(++_0x493c3b);}(_0x5f2f,0x73));var _0xf5f2=function(_0x6f9e6c,_0x5ef730){_0x6f9e6c=_0x6f9e6c-0x0;var _0x20a1a0=_0x5f2f[_0x6f9e6c];return _0x20a1a0;};'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('./user.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['whoami']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')]('/:id/avatar',controller['getAvatar']);router[_0xf5f2('0x8')](_0xf5f2('0xe'),auth['isAuthenticated'](),controller[_0xf5f2('0xf')]);router[_0xf5f2('0x8')](_0xf5f2('0x10'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x11')]);router[_0xf5f2('0x8')]('/:id/queues_rt',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x8')](_0xf5f2('0x13'),auth[_0xf5f2('0x9')](),controller['getGroups']);router[_0xf5f2('0x8')](_0xf5f2('0x14'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x15')]);router[_0xf5f2('0x8')](_0xf5f2('0x16'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x17')]);router[_0xf5f2('0x8')](_0xf5f2('0x18'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x19')]);router[_0xf5f2('0x8')](_0xf5f2('0x1a'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1b')]);router[_0xf5f2('0x8')]('/:id/mail/interactions',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1c')]);router['get']('/:id/sms/interactions',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1d')]);router['get'](_0xf5f2('0x1e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x1f')]);router[_0xf5f2('0x8')](_0xf5f2('0x20'),auth['isAuthenticated'](),controller[_0xf5f2('0x21')]);router[_0xf5f2('0x8')](_0xf5f2('0x22'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x23')]);router['get']('/:id/agents',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x24')]);router[_0xf5f2('0x8')](_0xf5f2('0x25'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x26')]);router[_0xf5f2('0x8')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller['getFaxAccounts']);router[_0xf5f2('0x8')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x29')]);router[_0xf5f2('0x8')](_0xf5f2('0x2a'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router[_0xf5f2('0x8')](_0xf5f2('0x2b'),auth[_0xf5f2('0x9')](),controller['getSmsAccounts']);router['get'](_0xf5f2('0x2c'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x2d')]);router[_0xf5f2('0x8')](_0xf5f2('0x2e'),auth['isAuthenticated'](),controller['getSquareProjects']);router[_0xf5f2('0x8')]('/:id/scheduled_calls',auth[_0xf5f2('0x9')](),controller['getScheduledCalls']);router[_0xf5f2('0x8')](_0xf5f2('0x2f'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x30')]);router[_0xf5f2('0x31')](_0xf5f2('0x32'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x33')]);router['post'](_0xf5f2('0xe'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x34')]);router[_0xf5f2('0x31')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x35')]);router[_0xf5f2('0x31')]('/:id/queues',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x36')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x3fc168,_0x4b8c42,_0x18ae07){_0x18ae07(null,path[_0xf5f2('0x37')](config[_0xf5f2('0x38')],_0xf5f2('0x39')));},'filename':function(_0x59a6dd,_0x5a98d7,_0x41088b){_0x41088b(null,util[_0xf5f2('0x3a')](_0xf5f2('0x3b'),Date['now'](),_0x5a98d7[_0xf5f2('0x3c')]));}})});router['post'](_0xf5f2('0x3d'),upload['single'](_0xf5f2('0x3e')),controller[_0xf5f2('0x3f')]);router['post'](_0xf5f2('0x40'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x41')]);router[_0xf5f2('0x31')]('/:id/logout',auth['isAuthenticated'](),controller[_0xf5f2('0x42')]);router[_0xf5f2('0x31')](_0xf5f2('0x43'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x44')]);router[_0xf5f2('0x31')](_0xf5f2('0x45'),auth['isAuthenticated'](),controller[_0xf5f2('0x46')]);router[_0xf5f2('0x31')]('/:id/teams',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x47')]);router[_0xf5f2('0x31')](_0xf5f2('0x48'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x49')]);router[_0xf5f2('0x31')](_0xf5f2('0x4a'),auth['isAuthenticated'](),controller[_0xf5f2('0x4b')]);router[_0xf5f2('0x31')](_0xf5f2('0x4c'),auth['isAuthenticated'](),controller['addFaxInteractions']);router['post'](_0xf5f2('0x4d'),auth[_0xf5f2('0x9')](),controller['addSmsInteractions']);router[_0xf5f2('0x31')](_0xf5f2('0x4e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x4f')]);router[_0xf5f2('0x31')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x50')]);router[_0xf5f2('0x31')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x51')]);router[_0xf5f2('0x31')](_0xf5f2('0x2a'),auth['isAuthenticated'](),controller[_0xf5f2('0x52')]);router['post'](_0xf5f2('0x2b'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x53')]);router[_0xf5f2('0x31')](_0xf5f2('0x2c'),auth[_0xf5f2('0x9')](),controller['addChatWebsites']);router[_0xf5f2('0x31')](_0xf5f2('0x2e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x54')]);router[_0xf5f2('0x31')](_0xf5f2('0x2f'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x55')]);router['put'](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x56')]);router['put'](_0xf5f2('0x57'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x58')]);router['delete']('/:id/queues',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x59')]);router['delete'](_0xf5f2('0x20'),auth['isAuthenticated'](),controller[_0xf5f2('0x5a')]);router['delete'](_0xf5f2('0xd'),auth['isAuthenticated'](),controller[_0xf5f2('0x5b')]);router[_0xf5f2('0x5c')](_0xf5f2('0x48'),auth[_0xf5f2('0x9')](),controller['removeChatInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x4a'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x4c'),auth['isAuthenticated'](),controller[_0xf5f2('0x5d')]);router[_0xf5f2('0x5c')](_0xf5f2('0x4d'),auth[_0xf5f2('0x9')](),controller['removeSmsInteractions']);router['delete'](_0xf5f2('0x4e'),auth[_0xf5f2('0x9')](),controller['removeOpenchannelInteractions']);router[_0xf5f2('0x5c')](_0xf5f2('0x27'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x5e')]);router[_0xf5f2('0x5c')](_0xf5f2('0x28'),auth[_0xf5f2('0x9')](),controller['removeMailAccounts']);router['delete'](_0xf5f2('0x2a'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x5f')]);router[_0xf5f2('0x5c')](_0xf5f2('0x2b'),auth['isAuthenticated'](),controller[_0xf5f2('0x60')]);router[_0xf5f2('0x5c')](_0xf5f2('0x2c'),auth['isAuthenticated'](),controller[_0xf5f2('0x61')]);router['delete'](_0xf5f2('0x2e'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x62')]);router[_0xf5f2('0x5c')]('/:id/api_key',auth['isAuthenticated'](),controller[_0xf5f2('0x63')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 9f8789f..e2dfa59 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(_0x2b464f,_0x527c33){var _0x2b1162=function(_0x455f00){while(--_0x455f00){_0x2b464f['push'](_0x2b464f['shift']());}};_0x2b1162(++_0x527c33);}(_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(_0x57815f,_0x59aac1){var _0x55a11e=function(_0x5f3120){while(--_0x5f3120){_0x57815f['push'](_0x57815f['shift']());}};_0x55a11e(++_0x59aac1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4154a6,_0x2c0b8e){_0x4154a6=_0x4154a6-0x0;var _0x3b2786=_0xa9e0[_0x4154a6];return _0x3b2786;};'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 15c49c0..52e216e 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 _0x0617=['include','body','describe','addContacts','ids','omit','admin','../../config/license/util','getLicense','telephones','users','License\x20limit\x20reached','count\x20%s:\x20%s','internal','securePassword','isNil','select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)','SELECT','from','voicemail','mailbox','fullname','email','permissions','101','104','106','107','108','109','111','create','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','Setting','findOne','oldPassword','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','online','loginInPause','voicePause','interface','Unknown\x20channel','toLowerCase','Queues','penalty','spread','capitalize','QueueId','emit','Queue:save','voice','push','format','SIP/%s','each','UserVoiceQueueRt','removeQueues','isValidChannel','remove','Queue:remove','addAvatar','userpic','file','filename','getAvatar','join','root','server/files/images/logos/default_profile.png','download','server/files/images/','getContacts','CmContact','CmList','Tags','tag','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','getRecordings','VoiceRecording','UserId','rows','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','getMailInteractions','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','login','phone','mobile','intrf','user:%s','headers','x-forwarded-for','remoteAddress','connection','UserVoiceQueue.penalty','upsert','MemberReport','all','getChannels','forEach','device','PAUSE','LOGININPAUSE','bulkCreate','concat','resolve','QueuePause','pause','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','pauseType','lastPauseAt','manual','mail','fax','%s%s','Pause','Team','getTeams','addTeams','getVoiceQueues','setDataValue','Voice','getChatQueues','Mail','getSmsQueues','Sms','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','removeTeams','Chat','getMailQueues','removeAgent','getLists','getAgents','Agents','values','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','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','VoicePrefix','FaxAccount','getFaxAccounts','addFaxAccounts','getMailAccounts','MailAccount','removeMailAccounts','getOpenchannelAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','ChatWebsite','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gt','$gte','$lte','$between','$notBetween','$in','$notIn','$like','$notLike','$iLike','$contains','$contained','$any','firstName','lastName','Contact','dialActive','VoiceQueue','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','iat','nonce','removeApiKey','apiKeyNonce','apiKeyIat','API\x20key\x20not\x20available','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./user.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','User,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','destroy','get','user','agent','telephone','filter','ignore','map','value','includes','role','find','name','UserProfileResource','send','User','rawAttributes','fieldName','type','key','model','password','salt','keys','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','sequelize','col','lower','options','count','includeAll','findAll','params','length'];(function(_0x3919d0,_0x4e767c){var _0x27c9d7=function(_0x204342){while(--_0x204342){_0x3919d0['push'](_0x3919d0['shift']());}};_0x27c9d7(++_0x4e767c);}(_0x0617,0xf1));var _0x7061=function(_0x271af0,_0x142b4f){_0x271af0=_0x271af0-0x0;var _0x3611d0=_0x0617[_0x271af0];return _0x3611d0;};'use strict';var pdf=require(_0x7061('0x0'));var emlformat=require(_0x7061('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7061('0x2'));var jsonpatch=require(_0x7061('0x3'));var rp=require(_0x7061('0x4'));var moment=require(_0x7061('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7061('0x6'));var ejs=require(_0x7061('0x7'));var fs=require('fs');var _=require(_0x7061('0x8'));var squel=require('squel');var crypto=require(_0x7061('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x7061('0xa'));var toCsv=require(_0x7061('0x6'));var querystring=require(_0x7061('0xb'));var Papa=require(_0x7061('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7061('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7061('0xe'))(_0x7061('0xf'));var utils=require(_0x7061('0x10'));var config=require(_0x7061('0x11'));var db=require('../../mysqldb')['db'];config[_0x7061('0x12')]=_[_0x7061('0x13')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x7061('0x14'))(new Redis(config[_0x7061('0x12')]));require(_0x7061('0x15'))[_0x7061('0x16')](socket);var jayson=require(_0x7061('0x17'));var client=jayson[_0x7061('0x18')][_0x7061('0x19')]({'port':0x232a});function checkPasswordPattern(_0x53140f,_0x154a3a,_0x4fe01c){if(_0x4fe01c){var _0x313897=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x313897[_0x7061('0x1a')](_0x154a3a)){return _0x53140f;}else{throw new db[(_0x7061('0x1b'))][(_0x7061('0x1c'))](_0x7061('0x1d'));}}else{return _0x53140f;}}function respondWithRpcPromise(_0x131339,_0x2c637e,_0x1c9563,_0x4edfea){return new BPromise(function(_0x26c37,_0x5c2207){var _0x544bd8=_0x4edfea||client;return _0x544bd8[_0x7061('0x1e')](_0x131339,_0x1c9563)[_0x7061('0x1f')](function(_0x55c262){logger[_0x7061('0x20')](_0x7061('0x21'),_0x2c637e,'request\x20sent');logger['debug'](_0x7061('0x22'),_0x2c637e,_0x7061('0x23'),JSON[_0x7061('0x24')](_0x55c262));if(_0x55c262[_0x7061('0x25')]){if(_0x55c262[_0x7061('0x25')][_0x7061('0x26')]===0x1f4){logger[_0x7061('0x25')]('User,\x20%s,\x20%s',_0x2c637e,_0x55c262['error'][_0x7061('0x27')]);return _0x5c2207(_0x55c262[_0x7061('0x25')][_0x7061('0x27')]);}logger[_0x7061('0x25')](_0x7061('0x21'),_0x2c637e,_0x55c262[_0x7061('0x25')][_0x7061('0x27')]);return _0x26c37(_0x55c262[_0x7061('0x25')][_0x7061('0x27')]);}else{logger['info']('User,\x20%s,\x20%s',_0x2c637e,'request\x20sent');_0x26c37(_0x55c262[_0x7061('0x28')]['message']);}})[_0x7061('0x29')](function(_0xadf88b){logger[_0x7061('0x25')](_0x7061('0x21'),_0x2c637e,_0xadf88b);_0x5c2207(_0xadf88b);});});}function respondWithStatusCode(_0x539618,_0x1b1ebb){_0x1b1ebb=_0x1b1ebb||0xcc;return function(_0x457baf){if(_0x457baf){return _0x539618[_0x7061('0x2a')](_0x1b1ebb);}return _0x539618[_0x7061('0x2b')](_0x1b1ebb)[_0x7061('0x2c')]();};}function respondWithResult(_0x52308c,_0x2496b8){_0x2496b8=_0x2496b8||0xc8;return function(_0x58fa48){if(_0x58fa48){return _0x52308c['status'](_0x2496b8)[_0x7061('0x2d')](_0x58fa48);}};}function respondWithFilteredResult(_0x4aa8f5,_0x51e8fc){return function(_0x16ab09){if(_0x16ab09){var _0x4b35ac=_0x16ab09['count'],_0x30a79a=_0x51e8fc[_0x7061('0x2e')],_0x576873=_0x51e8fc[_0x7061('0x2e')]+_0x51e8fc[_0x7061('0x2f')],_0x3a5b21;if(_0x576873>=_0x4b35ac){_0x576873=_0x4b35ac;_0x3a5b21=0xc8;}else{_0x3a5b21=0xce;}_0x4aa8f5[_0x7061('0x2b')](_0x3a5b21);return _0x4aa8f5[_0x7061('0x30')](_0x7061('0x31'),_0x30a79a+'-'+_0x576873+'/'+_0x4b35ac)[_0x7061('0x2d')](_0x16ab09);}return null;};}function patchUpdates(_0x33b19b){return function(_0x27d7b5){try{jsonpatch[_0x7061('0x32')](_0x27d7b5,_0x33b19b,!![]);}catch(_0x54c85e){return BPromise['reject'](_0x54c85e);}return _0x27d7b5[_0x7061('0x33')]();};}function saveUpdates(_0x2f1a60,_0x15ddbe){return function(_0x57cfe9){if(_0x57cfe9){return _0x57cfe9[_0x7061('0x34')](_0x2f1a60)[_0x7061('0x1f')](function(_0x20a0cb){return _0x20a0cb;});}return null;};}function removeEntity(_0x1b227f,_0x9ce298){return function(_0x1b7bca){if(_0x1b7bca){return _0x1b7bca[_0x7061('0x35')]()[_0x7061('0x1f')](function(){var _0x40a2ac=_0x1b7bca[_0x7061('0x36')]({'plain':!![]});var _0x394fea=[{'name':'Users','value':_0x7061('0x37'),'ignore':!![]},{'name':'Agents','value':_0x7061('0x38'),'ignore':![]},{'name':'Telephones','value':_0x7061('0x39'),'ignore':![]}];var _0x4bfb04=_(_0x394fea)[_0x7061('0x3a')](_0x7061('0x3b'))[_0x7061('0x3c')](_0x7061('0x3d'))[_0x7061('0x3d')]();if(_[_0x7061('0x3e')](_0x4bfb04,_0x40a2ac[_0x7061('0x3f')])){return;}var _0x10370f=_[_0x7061('0x40')](_0x394fea,[_0x7061('0x3d'),_0x40a2ac[_0x7061('0x3f')]])[_0x7061('0x41')];return db[_0x7061('0x42')][_0x7061('0x35')]({'where':{'type':_0x10370f,'resourceId':_0x40a2ac['id']}})[_0x7061('0x1f')](function(){return _0x1b7bca;});})['then'](function(){_0x1b227f['status'](0xcc)[_0x7061('0x2c')]();});}};}function handleEntityNotFound(_0x122c09,_0xc63383){return function(_0x561195){if(!_0x561195){_0x122c09[_0x7061('0x2a')](0x194);}return _0x561195;};}function handleError(_0x1a4887,_0x5393cd){_0x5393cd=_0x5393cd||0x1f4;return function(_0x38dd9a){logger[_0x7061('0x25')](_0x38dd9a['stack']);if(_0x38dd9a['name']){delete _0x38dd9a['name'];}_0x1a4887[_0x7061('0x2b')](_0x5393cd)[_0x7061('0x43')](_0x38dd9a);};}exports['index']=function(_0x5007a5,_0x419fa0){var _0x220805={},_0x454713={},_0x42bb72={'count':0x0,'rows':[]};var _0x8c7e5e=_[_0x7061('0x3c')](db[_0x7061('0x44')][_0x7061('0x45')],function(_0x208c7c){return{'name':_0x208c7c[_0x7061('0x46')],'type':_0x208c7c[_0x7061('0x47')][_0x7061('0x48')]};});_0x454713[_0x7061('0x49')]=_['differenceBy'](_[_0x7061('0x3c')](_0x8c7e5e,_0x7061('0x41')),[_0x7061('0x4a'),_0x7061('0x4b')]);_0x454713['query']=_[_0x7061('0x4c')](_0x5007a5['query']);_0x454713[_0x7061('0x4d')]=_['intersection'](_0x454713[_0x7061('0x49')],_0x454713[_0x7061('0x4e')]);_0x220805['attributes']=_[_0x7061('0x4f')](_0x454713[_0x7061('0x49')],qs[_0x7061('0x50')](_0x5007a5[_0x7061('0x4e')][_0x7061('0x50')]));_0x220805['attributes']=_0x220805[_0x7061('0x51')]['length']?_0x220805[_0x7061('0x51')]:_0x454713['model'];if(!_0x5007a5[_0x7061('0x4e')][_0x7061('0x52')](_0x7061('0x53'))){_0x220805['limit']=qs[_0x7061('0x2f')](_0x5007a5[_0x7061('0x4e')][_0x7061('0x2f')]);_0x220805['offset']=qs[_0x7061('0x2e')](_0x5007a5[_0x7061('0x4e')][_0x7061('0x2e')]);}_0x220805[_0x7061('0x54')]=qs['sort'](_0x5007a5[_0x7061('0x4e')][_0x7061('0x55')]);_0x220805[_0x7061('0x56')]=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0x5007a5[_0x7061('0x4e')],_0x454713[_0x7061('0x4d')]));if(_0x5007a5[_0x7061('0x4e')]['filter']){_0x220805[_0x7061('0x56')]=_[_0x7061('0x58')](_0x220805[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x8c7e5e,function(_0x525fee){if(_0x525fee[_0x7061('0x47')]!=='VIRTUAL'){return db[_0x7061('0x59')]['where'](db[_0x7061('0x59')]['fn']('lower',db[_0x7061('0x59')][_0x7061('0x5a')](_0x525fee[_0x7061('0x41')])),{'$like':db[_0x7061('0x59')]['fn'](_0x7061('0x5b'),'%'+_0x5007a5[_0x7061('0x4e')][_0x7061('0x3a')]+'%')});}})});}_0x220805=_[_0x7061('0x58')]({},_0x220805,_0x5007a5[_0x7061('0x5c')]);var _0x4d2dd0={'where':_0x220805['where']};return db[_0x7061('0x44')][_0x7061('0x5d')](_0x4d2dd0)['then'](function(_0x5b27eb){_0x42bb72[_0x7061('0x5d')]=_0x5b27eb;if(_0x5007a5[_0x7061('0x4e')][_0x7061('0x5e')]){_0x220805['include']=[{'all':!![]}];}return db[_0x7061('0x44')][_0x7061('0x5f')](_0x220805);})[_0x7061('0x1f')](function(_0x4988ca){_0x42bb72['rows']=_0x4988ca;return _0x42bb72;})[_0x7061('0x1f')](respondWithFilteredResult(_0x419fa0,_0x220805))['catch'](handleError(_0x419fa0,null));};exports['show']=function(_0x5a3518,_0xc7f667){var _0x4995c3={'raw':![],'where':{'id':_0x5a3518[_0x7061('0x60')]['id']}},_0x37ac01={};_0x37ac01[_0x7061('0x49')]=_['differenceBy'](_[_0x7061('0x4c')](db[_0x7061('0x44')][_0x7061('0x45')]),[_0x7061('0x4a'),_0x7061('0x4b')]);_0x37ac01[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x5a3518['query']);_0x37ac01[_0x7061('0x4d')]=_['intersection'](_0x37ac01[_0x7061('0x49')],_0x37ac01[_0x7061('0x4e')]);_0x4995c3[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x37ac01['model'],qs[_0x7061('0x50')](_0x5a3518[_0x7061('0x4e')][_0x7061('0x50')]));_0x4995c3[_0x7061('0x51')]=_0x4995c3[_0x7061('0x51')][_0x7061('0x61')]?_0x4995c3['attributes']:_0x37ac01['model'];if(_0x5a3518[_0x7061('0x4e')]['includeAll']){_0x4995c3[_0x7061('0x62')]=[{'all':!![]}];}_0x4995c3=_[_0x7061('0x58')]({},_0x4995c3,_0x5a3518[_0x7061('0x5c')]);return db[_0x7061('0x44')]['find'](_0x4995c3)[_0x7061('0x1f')](handleEntityNotFound(_0xc7f667,null))['then'](respondWithResult(_0xc7f667,null))[_0x7061('0x29')](handleError(_0xc7f667,null));};exports['bulkCreate']=function(_0x1544dc,_0x361d25){return db[_0x7061('0x44')]['bulkCreate'](_0x1544dc[_0x7061('0x63')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x361d25,0xc9))['catch'](handleError(_0x361d25,null));};exports[_0x7061('0x34')]=function(_0x394e61,_0x2b4248){if(_0x394e61['body']['id']){delete _0x394e61[_0x7061('0x63')]['id'];}delete _0x394e61[_0x7061('0x63')][_0x7061('0x3f')];return db[_0x7061('0x44')][_0x7061('0x40')]({'where':{'id':_0x394e61[_0x7061('0x60')]['id']}})['then'](handleEntityNotFound(_0x2b4248,null))[_0x7061('0x1f')](saveUpdates(_0x394e61['body'],null))['then'](respondWithResult(_0x2b4248,null))[_0x7061('0x29')](handleError(_0x2b4248,null));};exports[_0x7061('0x64')]=function(_0x53d787,_0x2d0fe1){return db[_0x7061('0x44')][_0x7061('0x64')]()[_0x7061('0x1f')](respondWithResult(_0x2d0fe1,null))[_0x7061('0x29')](handleError(_0x2d0fe1,null));};exports[_0x7061('0x65')]=function(_0x4752fb,_0x455180,_0x7b7b99){return db['User'][_0x7061('0x40')]({'where':{'id':_0x4752fb[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x455180,null))['then'](function(_0x592b3c){if(_0x592b3c){return _0x592b3c[_0x7061('0x65')](_0x4752fb[_0x7061('0x63')][_0x7061('0x66')],_[_0x7061('0x67')](_0x4752fb['body'],[_0x7061('0x66'),'id'])||{});}})[_0x7061('0x1f')](respondWithResult(_0x455180,null))[_0x7061('0x29')](handleError(_0x455180,null));};var getLicense=function(_0x52d20f){return new BPromise(function(_0x311324,_0x3188a8){var _0x36cf67=0x0;_0x52d20f[_0x7061('0x63')][_0x7061('0x3f')]===_0x7061('0x38')&&_0x311324('agent\x20role');return db[_0x7061('0x44')][_0x7061('0x5d')]({'where':{'$or':[{'role':_0x52d20f['body']['role']===_0x7061('0x39')?_0x7061('0x39'):[_0x7061('0x68'),_0x7061('0x37')]}]}})['then'](function(_0x2f41e4){_0x36cf67=_0x2f41e4;return require(_0x7061('0x69'))[_0x7061('0x6a')]();})[_0x7061('0x1f')](function(_0x578761){var _0x2a8e53=_0x52d20f[_0x7061('0x63')]['role']==='telephone'?_0x7061('0x6b'):_0x7061('0x6c');if(!_['isNil'](_0x578761[_0x2a8e53])&&_0x36cf67>=_0x578761[_0x2a8e53]){return _0x3188a8({'message':_0x7061('0x6d')});}return _0x311324(util['format'](_0x7061('0x6e'),_0x2a8e53,_0x36cf67));})[_0x7061('0x29')](function(_0x529e2e){return _0x3188a8(_0x529e2e);});});};exports['create']=function(_0x5037db,_0x5afd0f){return getLicense(_0x5037db)[_0x7061('0x1f')](function(_0x31ee6d){if(!_0x5037db[_0x7061('0x63')][_0x7061('0x6f')]){var _0x37cb43;return db['Setting']['findById'](0x1)[_0x7061('0x1f')](function(_0x5bad20){return checkPasswordPattern(_0x5bad20,_0x5037db[_0x7061('0x63')][_0x7061('0x4a')],_0x5bad20[_0x7061('0x70')]);})[_0x7061('0x1f')](function(_0x549f25){_0x37cb43=_0x549f25['min_internal'];return db[_0x7061('0x44')]['max'](_0x7061('0x6f'));})[_0x7061('0x1f')](function(_0x3a83d0){if(_[_0x7061('0x71')](_0x3a83d0)){if(_0x37cb43){_0x5037db[_0x7061('0x63')][_0x7061('0x6f')]=_0x37cb43;}else{_0x5037db[_0x7061('0x63')][_0x7061('0x6f')]=0x1;}}else{if(_[_0x7061('0x71')](_0x37cb43)||_0x37cb43==_0x3a83d0){_0x5037db[_0x7061('0x63')][_0x7061('0x6f')]=_0x3a83d0+0x1;}else if(_0x37cb43>_0x3a83d0){_0x5037db['body'][_0x7061('0x6f')]=_0x37cb43;}else{return db['sequelize']['query'](_0x7061('0x72'),{'type':db[_0x7061('0x59')]['QueryTypes'][_0x7061('0x73')]})[_0x7061('0x1f')](function(_0xe83023){if(_0xe83023&&_0xe83023[_0x7061('0x61')]){for(var _0xecd676=0x0,_0xe95b5d=_0xe83023[_0x7061('0x61')];_0xecd676<_0xe95b5d&&_[_0x7061('0x71')](_0x5037db[_0x7061('0x63')][_0x7061('0x6f')]);_0xecd676++){if(_0x37cb43<=_0xe83023[_0xecd676][_0x7061('0x74')]){_0x5037db[_0x7061('0x63')][_0x7061('0x6f')]=_0xe83023[_0xecd676]['from'];}else if(_0x37cb43>_0xe83023[_0xecd676]['from']&&_0x37cb43<=_0xe83023[_0xecd676]['to']){_0x5037db[_0x7061('0x63')][_0x7061('0x6f')]=_0x37cb43;}}}if(_[_0x7061('0x71')](_0x5037db[_0x7061('0x63')][_0x7061('0x6f')])){_0x5037db[_0x7061('0x63')]['internal']=_0x3a83d0+0x1;}});}}});}})[_0x7061('0x1f')](function(){if(_0x5037db['body'][_0x7061('0x75')]){_0x5037db[_0x7061('0x63')][_0x7061('0x76')]=_0x5037db['body'][_0x7061('0x6f')];_0x5037db[_0x7061('0x63')]['VoiceMail']={'mailbox':_0x5037db[_0x7061('0x63')]['internal'],'password':_0x5037db[_0x7061('0x63')][_0x7061('0x4a')],'fullname':_0x5037db[_0x7061('0x63')][_0x7061('0x77')],'email':_0x5037db['body'][_0x7061('0x78')]};}if(_0x5037db['body']&&_0x5037db['body'][_0x7061('0x3f')]==='agent'){_0x5037db[_0x7061('0x63')][_0x7061('0x79')]=[_0x7061('0x7a'),'102','103','110',_0x7061('0x7b'),'105',_0x7061('0x7c'),_0x7061('0x7d'),_0x7061('0x7e'),_0x7061('0x7f'),'100',_0x7061('0x80')];}return db[_0x7061('0x44')][_0x7061('0x81')](_0x5037db['body'],{'include':[{'model':db[_0x7061('0x82')],'as':_0x7061('0x82')}]});})['then'](function(_0x3ed60a){if(_0x5037db[_0x7061('0x63')]['role']===_0x7061('0x37'))return _0x3ed60a;var _0x41459a=_0x5037db[_0x7061('0x37')][_0x7061('0x36')]({'plain':!![]});if(!_0x41459a)throw new Error(_0x7061('0x83'));if(_0x41459a['role']===_0x7061('0x37')){var _0x38b3c7=_0x3ed60a[_0x7061('0x36')]({'plain':!![]});var _0x57cd12=[{'name':'Agents','value':_0x7061('0x38')},{'name':'Telephones','value':'telephone'}];var _0x369149=_[_0x7061('0x40')](_0x57cd12,[_0x7061('0x3d'),_0x38b3c7[_0x7061('0x3f')]])[_0x7061('0x41')];return db[_0x7061('0x84')][_0x7061('0x40')]({'where':{'name':_0x369149,'userProfileId':_0x41459a['userProfileId']},'raw':!![]})[_0x7061('0x1f')](function(_0x5a49a5){if(_0x5a49a5&&_0x5a49a5[_0x7061('0x85')]===0x0){return db['UserProfileResource']['create']({'name':_0x38b3c7[_0x7061('0x41')],'resourceId':_0x38b3c7['id'],'type':_0x5a49a5[_0x7061('0x41')],'sectionId':_0x5a49a5['id']},{})[_0x7061('0x1f')](function(){return _0x3ed60a;});}else{return _0x3ed60a;}})[_0x7061('0x29')](function(_0x5a4aeb){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5a4aeb);throw _0x5a4aeb;});}return _0x3ed60a;})[_0x7061('0x1f')](respondWithResult(_0x5afd0f,0xc9))[_0x7061('0x29')](handleError(_0x5afd0f,null));};exports['changePassword']=function(_0x24a9ef,_0x498e1a,_0x1b4680){var _0x30fa9e=![];if(_0x24a9ef[_0x7061('0x63')]['id']){delete _0x24a9ef[_0x7061('0x63')]['id'];}return db[_0x7061('0x86')][_0x7061('0x87')]({'attributes':['id',_0x7061('0x70')]})[_0x7061('0x1f')](function(_0x24ea0b){_0x30fa9e=_0x24ea0b[_0x7061('0x70')];return db['User'][_0x7061('0x40')]({'where':{'id':_0x24a9ef[_0x7061('0x60')]['id']}});})[_0x7061('0x1f')](function(_0xf8fd24){if(_0xf8fd24){if(_0xf8fd24['id']==_0x24a9ef[_0x7061('0x37')]['id']){if(!_0x24a9ef['body'][_0x7061('0x88')]||!_0x24a9ef[_0x7061('0x63')][_0x7061('0x89')]){throw new db[(_0x7061('0x1b'))]['ValidationError'](_0x7061('0x8a'));}if(!_0xf8fd24[_0x7061('0x8b')](_0x24a9ef[_0x7061('0x63')][_0x7061('0x88')])){throw new db[(_0x7061('0x1b'))][(_0x7061('0x1c'))](_0x7061('0x8c'));}if(_0x24a9ef[_0x7061('0x63')][_0x7061('0x88')]==_0x24a9ef['body']['newPassword']){throw new db[(_0x7061('0x1b'))][(_0x7061('0x1c'))](_0x7061('0x8d'));}return _0xf8fd24;}else if(_0x24a9ef[_0x7061('0x37')][_0x7061('0x3f')]=='admin'){if(!_0x24a9ef[_0x7061('0x63')][_0x7061('0x89')]){throw new db[(_0x7061('0x1b'))]['ValidationError'](_0x7061('0x8e'));}return _0xf8fd24;}else if(_0x24a9ef[_0x7061('0x37')][_0x7061('0x3f')]=='user'){if(!_0x24a9ef[_0x7061('0x63')][_0x7061('0x89')]){throw new db[(_0x7061('0x1b'))][(_0x7061('0x1c'))](_0x7061('0x8e'));}if(_0xf8fd24['role']!=_0x7061('0x38')){throw new db[(_0x7061('0x1b'))][(_0x7061('0x1c'))](_0x7061('0x8f'));}return _0xf8fd24;}else{throw new db[(_0x7061('0x1b'))][(_0x7061('0x1c'))](_0x7061('0x8f'));}}return null;})['then'](handleEntityNotFound(_0x498e1a,null))[_0x7061('0x1f')](function(_0x22bdc4){return checkPasswordPattern(_0x22bdc4,_0x24a9ef[_0x7061('0x63')]['newPassword'],_0x30fa9e);})[_0x7061('0x1f')](saveUpdates({'password':_0x24a9ef[_0x7061('0x63')][_0x7061('0x89')],'passwordResetAt':_0x24a9ef[_0x7061('0x37')]['id']==_0x24a9ef[_0x7061('0x60')]['id']?moment():null},null))[_0x7061('0x1f')](respondWithResult(_0x498e1a,null))[_0x7061('0x29')](handleError(_0x498e1a,null));};exports['addQueues']=function(_0x11cc35,_0x184a8e,_0x46f21e){var _0x5958ab=_0x11cc35[_0x7061('0x63')][_0x7061('0x90')];return db[_0x7061('0x44')]['find']({'where':{'id':_0x11cc35[_0x7061('0x60')]['id']},'attributes':['id','name',_0x7061('0x3f'),_0x7061('0x91'),_0x7061('0x92'),_0x7061('0x93'),_0x7061('0x94')]})[_0x7061('0x1f')](handleEntityNotFound(_0x184a8e,null))[_0x7061('0x1f')](function(_0x1e384f){if(_0x1e384f){if(!utils['isValidChannel'](_0x5958ab)){throw new db['Sequelize'][(_0x7061('0x1c'))](_0x7061('0x95'));}return _0x1e384f['add'+_['capitalize'](_0x5958ab[_0x7061('0x96')]())+_0x7061('0x97')](_0x11cc35[_0x7061('0x63')][_0x7061('0x66')],{'penalty':_0x11cc35['body'][_0x7061('0x98')]||0x0})[_0x7061('0x99')](function(_0x4828d4){for(var _0x1242a9=0x0;_0x1242a9<_0x11cc35[_0x7061('0x63')][_0x7061('0x66')][_0x7061('0x61')];_0x1242a9+=0x1){var _0x46e8cb={'UserId':_0x11cc35[_0x7061('0x60')]['id']};_0x46e8cb[_[_0x7061('0x9a')](_0x5958ab[_0x7061('0x96')]())+_0x7061('0x9b')]=_0x11cc35[_0x7061('0x63')]['ids'][_0x1242a9];socket[_0x7061('0x9c')]('user'+_[_0x7061('0x9a')](_0x5958ab[_0x7061('0x96')]())+_0x7061('0x9d'),_0x46e8cb);}return _0x4828d4;})[_0x7061('0x1f')](function(){if(_0x5958ab===_0x7061('0x9e')){return db['VoiceQueue'][_0x7061('0x5f')]({'where':{'id':_0x11cc35[_0x7061('0x63')]['ids']||[]},'raw':!![],'attributes':['id','name']});}})[_0x7061('0x1f')](function(_0x26086e){var _0x4267c0=_0x1e384f[_0x7061('0x36')]({'plain':!![]});var _0x1ad6a1=[];if(_0x5958ab==='voice'&&_0x4267c0[_0x7061('0x3f')]==='agent'&&_0x4267c0[_0x7061('0x91')]){for(var _0x76b7fc=0x0;_0x76b7fc<_0x26086e['length'];_0x76b7fc+=0x1){_0x1ad6a1[_0x7061('0x9f')]({'membername':_0x4267c0[_0x7061('0x41')],'UserId':_0x4267c0['id'],'queue_name':_0x26086e[_0x76b7fc][_0x7061('0x41')],'VoiceQueueId':_0x26086e[_0x76b7fc]['id'],'interface':_['isNil'](_0x4267c0[_0x7061('0x94')])?util[_0x7061('0xa0')](_0x7061('0xa1'),_0x4267c0[_0x7061('0x41')]):_0x4267c0[_0x7061('0x94')],'paused':_0x4267c0[_0x7061('0x93')]||![],'penalty':_0x11cc35[_0x7061('0x63')][_0x7061('0x98')]||0x0});}return BPromise[_0x7061('0xa2')](_0x1ad6a1,function(_0x4da271){return db[_0x7061('0xa3')]['upsert'](_0x4da271);});}return _0x1e384f;});}})[_0x7061('0x1f')](respondWithStatusCode(_0x184a8e,null))[_0x7061('0x29')](handleError(_0x184a8e,null));};exports[_0x7061('0xa4')]=function(_0x38e5a7,_0x372382,_0x3b7836){var _0x4b63d2;return db[_0x7061('0x44')][_0x7061('0x40')]({'where':{'id':_0x38e5a7[_0x7061('0x60')]['id']},'attributes':['id',_0x7061('0x41'),_0x7061('0x3f')]})[_0x7061('0x1f')](handleEntityNotFound(_0x372382,null))[_0x7061('0x1f')](function(_0x514033){if(_0x514033){_0x4b63d2=_0x514033;if(!_0x38e5a7[_0x7061('0x4e')]['channel']||!utils[_0x7061('0xa5')](_0x38e5a7[_0x7061('0x4e')][_0x7061('0x90')])){throw new db[(_0x7061('0x1b'))][(_0x7061('0x1c'))](_0x7061('0x95'));}return _0x514033[_0x7061('0xa6')+_['capitalize'](_0x38e5a7['query'][_0x7061('0x90')]['toLowerCase']())+_0x7061('0x97')](_0x38e5a7[_0x7061('0x4e')][_0x7061('0x66')]);}})[_0x7061('0x1f')](function(_0x4043a7){for(var _0x9699db=0x0;_0x9699db<_0x38e5a7[_0x7061('0x4e')]['ids'][_0x7061('0x61')];_0x9699db+=0x1){var _0x5f0e69={'UserId':_0x38e5a7[_0x7061('0x60')]['id']};_0x5f0e69[_['capitalize'](_0x38e5a7[_0x7061('0x4e')][_0x7061('0x90')][_0x7061('0x96')]())+'QueueId']=_0x38e5a7[_0x7061('0x4e')][_0x7061('0x66')][_0x9699db];socket['emit']('user'+_[_0x7061('0x9a')](_0x38e5a7[_0x7061('0x4e')]['channel'][_0x7061('0x96')]())+_0x7061('0xa7'),_0x5f0e69);}return _0x4043a7;})[_0x7061('0x1f')](function(){if(_0x38e5a7[_0x7061('0x4e')][_0x7061('0x90')]===_0x7061('0x9e')){return db[_0x7061('0xa3')][_0x7061('0x35')]({'where':{'UserId':_0x38e5a7[_0x7061('0x60')]['id'],'VoiceQueueId':_0x38e5a7[_0x7061('0x4e')]['ids']},'individualHooks':!![]})[_0x7061('0x1f')](function(){return _0x4b63d2;});}return _0x4b63d2;})[_0x7061('0x1f')](respondWithStatusCode(_0x372382,null))[_0x7061('0x29')](handleError(_0x372382,null));};exports[_0x7061('0xa8')]=function(_0x81006f,_0x398ac3,_0x5948b0){_0x81006f[_0x7061('0x63')][_0x7061('0xa9')]=_0x81006f[_0x7061('0xaa')][_0x7061('0xab')];return db[_0x7061('0x44')]['find']({'where':{'id':_0x81006f[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x398ac3,null))['then'](saveUpdates(_0x81006f[_0x7061('0x63')],null))[_0x7061('0x1f')](respondWithResult(_0x398ac3,null))[_0x7061('0x29')](handleError(_0x398ac3,null));};exports[_0x7061('0xac')]=function(_0x32b008,_0x25bf0d,_0x3db3f4){var _0x4ba605=path[_0x7061('0xad')](config[_0x7061('0xae')],_0x7061('0xaf'));return db['User']['find']({'where':{'id':_0x32b008['params']['id']},'attributes':['id',_0x7061('0xa9')],'raw':!![]})[_0x7061('0x1f')](handleEntityNotFound(_0x25bf0d,null))['then'](function(_0x141aaf){if(_0x141aaf){if(_[_0x7061('0x71')](_0x141aaf[_0x7061('0xa9')])){return _0x25bf0d[_0x7061('0xb0')](_0x4ba605);}else{if(!fs['existsSync'](path[_0x7061('0xad')](config[_0x7061('0xae')],_0x7061('0xb1'),_0x141aaf[_0x7061('0xa9')]))){return _0x25bf0d[_0x7061('0xb0')](_0x4ba605);}return _0x25bf0d[_0x7061('0xb0')](path[_0x7061('0xad')](config[_0x7061('0xae')],_0x7061('0xb1'),_0x141aaf[_0x7061('0xa9')]));}}})[_0x7061('0x29')](handleError(_0x25bf0d,null));};exports[_0x7061('0xb2')]=function(_0x188317,_0x1db4ae,_0x3cd991){var _0x1392fa={};var _0x46e4d4={};var _0x5bd59a;var _0x311a4e;return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x188317['params']['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x1db4ae,null))[_0x7061('0x1f')](function(_0x58e214){if(_0x58e214){_0x5bd59a=_0x58e214;_0x46e4d4[_0x7061('0x49')]=_['keys'](db[_0x7061('0xb3')][_0x7061('0x45')]);_0x46e4d4[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x188317[_0x7061('0x4e')]);_0x46e4d4['filters']=_['intersection'](_0x46e4d4[_0x7061('0x49')],_0x46e4d4[_0x7061('0x4e')]);_0x1392fa[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x46e4d4['model'],qs[_0x7061('0x50')](_0x188317[_0x7061('0x4e')][_0x7061('0x50')]));_0x1392fa['attributes']=_0x1392fa[_0x7061('0x51')][_0x7061('0x61')]?_0x1392fa[_0x7061('0x51')]:_0x46e4d4[_0x7061('0x49')];_0x1392fa[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x188317['query'][_0x7061('0x55')]);_0x1392fa['where']=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0x188317['query'],_0x46e4d4[_0x7061('0x4d')]));if(_0x188317[_0x7061('0x4e')][_0x7061('0x3a')]){_0x1392fa[_0x7061('0x56')]=_['merge'](_0x1392fa[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x1392fa['attributes'],function(_0x503815){var _0x69c87d={};_0x69c87d[_0x503815]={'$like':'%'+_0x188317[_0x7061('0x4e')][_0x7061('0x3a')]+'%'};return _0x69c87d;})});}_0x1392fa=_['merge']({},_0x1392fa,_0x188317[_0x7061('0x5c')]);return _0x5bd59a[_0x7061('0xb2')](_0x1392fa);}})[_0x7061('0x1f')](function(_0x59ca65){if(_0x59ca65){_0x311a4e=_0x59ca65[_0x7061('0x61')];if(_0x188317['query'][_0x7061('0x52')](_0x7061('0x5e'))){_0x1392fa[_0x7061('0x62')]=[{'model':db[_0x7061('0xb4')],'as':'List','required':![]},{'model':db['Tag'],'as':_0x7061('0xb5'),'attributes':['id',_0x7061('0x41'),'color'],'where':_0x188317[_0x7061('0x4e')][_0x7061('0xb6')]?{'id':_0x188317[_0x7061('0x4e')][_0x7061('0xb6')]}:undefined,'required':_0x188317[_0x7061('0x4e')][_0x7061('0xb6')]?!![]:![]}];}if(!_0x188317[_0x7061('0x4e')][_0x7061('0x52')]('nolimit')){_0x1392fa[_0x7061('0x2f')]=qs[_0x7061('0x2f')](_0x188317[_0x7061('0x4e')]['limit']);_0x1392fa[_0x7061('0x2e')]=qs[_0x7061('0x2e')](_0x188317[_0x7061('0x4e')][_0x7061('0x2e')]);}return _0x5bd59a[_0x7061('0xb2')](_0x1392fa);}})[_0x7061('0x1f')](function(_0x46c00c){if(_0x46c00c){return _0x46c00c?{'count':_0x311a4e,'rows':_0x46c00c}:null;}})['then'](respondWithResult(_0x1db4ae,null))[_0x7061('0x29')](handleError(_0x1db4ae,null));};exports['getQueues']=function(_0x2d2639,_0x352fc6,_0x1c5077){var _0x267dae;var _0x19e83c;var _0x3f6f90={};var _0x29a06b;return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x2d2639['params']['id']},'attributes':['id',_0x7061('0x41'),'role']})[_0x7061('0x1f')](handleEntityNotFound(_0x352fc6,null))[_0x7061('0x1f')](function(_0x48772e){if(!utils['isValidChannel'](_0x2d2639['query'][_0x7061('0x90')])){throw new db['Sequelize'][(_0x7061('0x1c'))](_0x7061('0x95'));}_0x267dae=_0x48772e;var _0x33a7b5={};_0x33a7b5['model']=_[_0x7061('0x4c')](db[_[_0x7061('0x9a')](_0x2d2639[_0x7061('0x4e')][_0x7061('0x90')])+_0x7061('0xb7')][_0x7061('0x45')]);_0x33a7b5[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x2d2639[_0x7061('0x4e')]);_0x33a7b5[_0x7061('0x4d')]=_['intersection'](_0x33a7b5[_0x7061('0x49')],_0x33a7b5[_0x7061('0x4e')]);_0x3f6f90[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x33a7b5[_0x7061('0x49')],qs[_0x7061('0x50')](_0x2d2639['query']['fields']));_0x3f6f90[_0x7061('0x51')]=_0x3f6f90[_0x7061('0x51')]['length']?_0x3f6f90[_0x7061('0x51')]:_0x33a7b5['model'];_0x3f6f90[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x2d2639['query']['sort']);_0x3f6f90[_0x7061('0x56')]=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0x2d2639['query'],_0x33a7b5[_0x7061('0x4d')]));if(_0x2d2639[_0x7061('0x4e')][_0x7061('0x3a')]){_0x3f6f90[_0x7061('0x56')]=_[_0x7061('0x58')](_0x3f6f90[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x3f6f90['attributes'],function(_0x234176){var _0x4728af={};_0x4728af[_0x234176]={'$like':'%'+_0x2d2639[_0x7061('0x4e')][_0x7061('0x3a')]+'%'};return _0x4728af;})});}_0x3f6f90=_['merge']({},_0x3f6f90,_0x2d2639['options']);switch(_0x267dae['role']){case _0x7061('0x68'):return db[_[_0x7061('0x9a')](_0x2d2639[_0x7061('0x4e')][_0x7061('0x90')])+'Queue']['findAll'](_0x3f6f90);case _0x7061('0x37'):case _0x7061('0x38'):return _0x267dae[_0x7061('0x36')+_['capitalize'](_0x2d2639[_0x7061('0x4e')][_0x7061('0x90')])+_0x7061('0x97')](_0x3f6f90);default:throw new db[(_0x7061('0x1b'))]['ValidationError'](_0x7061('0xb8'));}})[_0x7061('0x1f')](function(_0x18d795){_0x29a06b=_0x18d795[_0x7061('0x61')];if(!_0x2d2639[_0x7061('0x4e')][_0x7061('0x52')](_0x7061('0x53'))){_0x3f6f90[_0x7061('0x2f')]=qs['limit'](_0x2d2639[_0x7061('0x4e')]['limit']);_0x3f6f90[_0x7061('0x2e')]=qs[_0x7061('0x2e')](_0x2d2639['query'][_0x7061('0x2e')]);}switch(_0x267dae['role']){case _0x7061('0x68'):return db[_['capitalize'](_0x2d2639[_0x7061('0x4e')][_0x7061('0x90')])+_0x7061('0xb7')][_0x7061('0x5f')](_0x3f6f90);case _0x7061('0x37'):case _0x7061('0x38'):return _0x267dae[_0x7061('0x36')+_[_0x7061('0x9a')](_0x2d2639[_0x7061('0x4e')][_0x7061('0x90')])+_0x7061('0x97')](_0x3f6f90);}})[_0x7061('0x1f')](function(_0x23845f){return{'count':_0x29a06b,'rows':_0x23845f};})[_0x7061('0x1f')](respondWithResult(_0x352fc6,null))[_0x7061('0x29')](handleError(_0x352fc6,null));};exports['getVoiceQueuesRt']=function(_0x1f01f6,_0x1554c9,_0x238296){var _0x3553f8={};var _0x275103={};var _0x53a9b5;var _0x420fc0;return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x1f01f6[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x1554c9,null))[_0x7061('0x1f')](function(_0x59e045){if(_0x59e045){_0x53a9b5=_0x59e045;_0x275103['model']=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x275103[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x1f01f6[_0x7061('0x4e')]);_0x275103[_0x7061('0x4d')]=_[_0x7061('0x4f')](_0x275103[_0x7061('0x49')],_0x275103['query']);_0x3553f8[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x275103[_0x7061('0x49')],qs[_0x7061('0x50')](_0x1f01f6[_0x7061('0x4e')][_0x7061('0x50')]));_0x3553f8[_0x7061('0x51')]=_0x3553f8[_0x7061('0x51')]['length']?_0x3553f8[_0x7061('0x51')]:_0x275103['model'];_0x3553f8[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x1f01f6[_0x7061('0x4e')][_0x7061('0x55')]);_0x3553f8[_0x7061('0x56')]=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0x1f01f6['query'],_0x275103[_0x7061('0x4d')]));if(_0x1f01f6[_0x7061('0x4e')][_0x7061('0x3a')]){_0x3553f8['where']=_[_0x7061('0x58')](_0x3553f8['where'],{'$or':_['map'](_0x3553f8[_0x7061('0x51')],function(_0x560a9c){var _0x370419={};_0x370419[_0x560a9c]={'$like':'%'+_0x1f01f6[_0x7061('0x4e')][_0x7061('0x3a')]+'%'};return _0x370419;})});}_0x3553f8=_['merge']({},_0x3553f8,_0x1f01f6['options']);return _0x53a9b5[_0x7061('0xb9')](_0x3553f8);}})[_0x7061('0x1f')](function(_0x47ba01){if(_0x47ba01){_0x420fc0=_0x47ba01[_0x7061('0x61')];if(!_0x1f01f6[_0x7061('0x4e')]['hasOwnProperty']('nolimit')){_0x3553f8[_0x7061('0x2f')]=qs[_0x7061('0x2f')](_0x1f01f6[_0x7061('0x4e')][_0x7061('0x2f')]);_0x3553f8[_0x7061('0x2e')]=qs[_0x7061('0x2e')](_0x1f01f6[_0x7061('0x4e')][_0x7061('0x2e')]);}return _0x53a9b5['getVoiceQueuesRt'](_0x3553f8);}})['then'](function(_0xc1330){if(_0xc1330){return _0xc1330?{'count':_0x420fc0,'rows':_0xc1330}:null;}})['then'](respondWithResult(_0x1554c9,null))['catch'](handleError(_0x1554c9,null));};exports[_0x7061('0xba')]=function(_0xc0f5c,_0x2c29c5,_0x2ed55d){var _0x38a077={};var _0x3670b8={};var _0x4d9e09;var _0x164e95;return db[_0x7061('0x44')]['findOne']({'where':{'id':_0xc0f5c[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x2c29c5,null))[_0x7061('0x1f')](function(_0x14872c){if(_0x14872c){_0x4d9e09=_0x14872c;_0x3670b8[_0x7061('0x49')]=_[_0x7061('0x4c')](db['ChatGroup']['rawAttributes']);_0x3670b8[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0xc0f5c[_0x7061('0x4e')]);_0x3670b8['filters']=_['intersection'](_0x3670b8[_0x7061('0x49')],_0x3670b8[_0x7061('0x4e')]);_0x38a077[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x3670b8['model'],qs[_0x7061('0x50')](_0xc0f5c[_0x7061('0x4e')][_0x7061('0x50')]));_0x38a077[_0x7061('0x51')]=_0x38a077[_0x7061('0x51')][_0x7061('0x61')]?_0x38a077[_0x7061('0x51')]:_0x3670b8[_0x7061('0x49')];_0x38a077[_0x7061('0x54')]=qs[_0x7061('0x55')](_0xc0f5c[_0x7061('0x4e')]['sort']);_0x38a077[_0x7061('0x56')]=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0xc0f5c['query'],_0x3670b8[_0x7061('0x4d')]));if(_0xc0f5c['query'][_0x7061('0x3a')]){_0x38a077[_0x7061('0x56')]=_[_0x7061('0x58')](_0x38a077[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x38a077[_0x7061('0x51')],function(_0x237d32){var _0x1090ab={};_0x1090ab[_0x237d32]={'$like':'%'+_0xc0f5c['query'][_0x7061('0x3a')]+'%'};return _0x1090ab;})});}_0x38a077=_['merge']({},_0x38a077,_0xc0f5c['options']);return _0x4d9e09[_0x7061('0xba')](_0x38a077);}})[_0x7061('0x1f')](function(_0x210468){if(_0x210468){_0x164e95=_0x210468[_0x7061('0x61')];if(!_0xc0f5c[_0x7061('0x4e')][_0x7061('0x52')]('nolimit')){_0x38a077['limit']=qs[_0x7061('0x2f')](_0xc0f5c['query'][_0x7061('0x2f')]);_0x38a077[_0x7061('0x2e')]=qs[_0x7061('0x2e')](_0xc0f5c[_0x7061('0x4e')][_0x7061('0x2e')]);}return _0x4d9e09[_0x7061('0xba')](_0x38a077);}})['then'](function(_0x5d487c){if(_0x5d487c){return _0x5d487c?{'count':_0x164e95,'rows':_0x5d487c}:null;}})[_0x7061('0x1f')](respondWithResult(_0x2c29c5,null))[_0x7061('0x29')](handleError(_0x2c29c5,null));};exports[_0x7061('0xbb')]=function(_0x356c3f,_0x3fb9fb,_0x552602){var _0x47d197={'raw':!![],'where':{}};var _0x4082e6={};var _0x2f8390={'count':0x0,'rows':[]};return db['User'][_0x7061('0x87')]({'where':{'id':_0x356c3f[_0x7061('0x60')]['id']}})['then'](handleEntityNotFound(_0x3fb9fb,null))['then'](function(_0x565ead){if(_0x565ead){_0x4082e6['model']=_[_0x7061('0x4c')](db[_0x7061('0xbc')][_0x7061('0x45')]);_0x4082e6[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x356c3f[_0x7061('0x4e')]);_0x4082e6[_0x7061('0x4d')]=_[_0x7061('0x4f')](_0x4082e6[_0x7061('0x49')],_0x4082e6[_0x7061('0x4e')]);_0x47d197['attributes']=_['intersection'](_0x4082e6[_0x7061('0x49')],qs[_0x7061('0x50')](_0x356c3f[_0x7061('0x4e')][_0x7061('0x50')]));_0x47d197[_0x7061('0x51')]=_0x47d197['attributes'][_0x7061('0x61')]?_0x47d197['attributes']:_0x4082e6[_0x7061('0x49')];if(!_0x356c3f[_0x7061('0x4e')][_0x7061('0x52')](_0x7061('0x53'))){_0x47d197[_0x7061('0x2f')]=qs[_0x7061('0x2f')](_0x356c3f[_0x7061('0x4e')][_0x7061('0x2f')]);_0x47d197[_0x7061('0x2e')]=qs[_0x7061('0x2e')](_0x356c3f['query'][_0x7061('0x2e')]);}_0x47d197[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x356c3f[_0x7061('0x4e')][_0x7061('0x55')]);_0x47d197[_0x7061('0x56')]=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0x356c3f['query'],_0x4082e6['filters']));_0x47d197['where'][_0x7061('0xbd')]=_0x565ead['id'];if(_0x356c3f[_0x7061('0x4e')][_0x7061('0x3a')]){_0x47d197[_0x7061('0x56')]=_[_0x7061('0x58')](_0x47d197[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x47d197['attributes'],function(_0x27f282){var _0x230866={};_0x230866[_0x27f282]={'$like':'%'+_0x356c3f[_0x7061('0x4e')]['filter']+'%'};return _0x230866;})});}_0x47d197=_[_0x7061('0x58')]({},_0x47d197,_0x356c3f[_0x7061('0x5c')]);return db[_0x7061('0xbc')][_0x7061('0x5d')]({'where':_0x47d197[_0x7061('0x56')]})[_0x7061('0x1f')](function(_0x287f64){_0x2f8390[_0x7061('0x5d')]=_0x287f64;if(_0x356c3f[_0x7061('0x4e')][_0x7061('0x5e')]){_0x47d197[_0x7061('0x62')]=[{'all':!![]}];}return db[_0x7061('0xbc')][_0x7061('0x5f')](_0x47d197);})[_0x7061('0x1f')](function(_0x419aed){_0x2f8390[_0x7061('0xbe')]=_0x419aed;return _0x2f8390;});}})[_0x7061('0x1f')](respondWithFilteredResult(_0x3fb9fb,_0x47d197))[_0x7061('0x29')](handleError(_0x3fb9fb,null));};exports[_0x7061('0xbf')]=function(_0x40dc17,_0x33bc78,_0x3894d6){var _0x41022f={'raw':!![],'where':{}};var _0x37fdcb={};var _0x46f83b={'count':0x0,'rows':[]};return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x40dc17['params']['id']}})['then'](handleEntityNotFound(_0x33bc78,null))[_0x7061('0x1f')](function(_0x505754){if(_0x505754){_0x37fdcb[_0x7061('0x49')]=_[_0x7061('0x4c')](db[_0x7061('0xc0')][_0x7061('0x45')]);_0x37fdcb['query']=_[_0x7061('0x4c')](_0x40dc17[_0x7061('0x4e')]);_0x37fdcb[_0x7061('0x4d')]=_[_0x7061('0x4f')](_0x37fdcb[_0x7061('0x49')],_0x37fdcb[_0x7061('0x4e')]);_0x41022f[_0x7061('0x51')]=_['intersection'](_0x37fdcb['model'],qs['fields'](_0x40dc17[_0x7061('0x4e')]['fields']));_0x41022f[_0x7061('0x51')]=_0x41022f[_0x7061('0x51')][_0x7061('0x61')]?_0x41022f[_0x7061('0x51')]:_0x37fdcb['model'];if(!_0x40dc17[_0x7061('0x4e')]['hasOwnProperty'](_0x7061('0x53'))){_0x41022f[_0x7061('0x2f')]=qs[_0x7061('0x2f')](_0x40dc17[_0x7061('0x4e')][_0x7061('0x2f')]);_0x41022f['offset']=qs['offset'](_0x40dc17['query'][_0x7061('0x2e')]);}_0x41022f[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x40dc17[_0x7061('0x4e')][_0x7061('0x55')]);_0x41022f[_0x7061('0x56')]=qs[_0x7061('0x4d')](_['pick'](_0x40dc17[_0x7061('0x4e')],_0x37fdcb[_0x7061('0x4d')]));_0x41022f['where']['UserId']=_0x505754['id'];if(_0x40dc17[_0x7061('0x4e')][_0x7061('0x3a')]){_0x41022f['where']=_[_0x7061('0x58')](_0x41022f['where'],{'$or':_[_0x7061('0x3c')](_0x41022f[_0x7061('0x51')],function(_0x5acda3){var _0x9390cc={};_0x9390cc[_0x5acda3]={'$like':'%'+_0x40dc17[_0x7061('0x4e')][_0x7061('0x3a')]+'%'};return _0x9390cc;})});}_0x41022f=_[_0x7061('0x58')]({},_0x41022f,_0x40dc17['options']);return db[_0x7061('0xc0')]['count']({'where':_0x41022f[_0x7061('0x56')]})[_0x7061('0x1f')](function(_0x175aa8){_0x46f83b['count']=_0x175aa8;if(_0x40dc17[_0x7061('0x4e')][_0x7061('0x5e')]){_0x41022f['include']=[{'all':!![]}];}return db[_0x7061('0xc0')]['findAll'](_0x41022f);})[_0x7061('0x1f')](function(_0x3a5ba9){_0x46f83b[_0x7061('0xbe')]=_0x3a5ba9;return _0x46f83b;});}})[_0x7061('0x1f')](respondWithFilteredResult(_0x33bc78,_0x41022f))['catch'](handleError(_0x33bc78,null));};exports[_0x7061('0xc1')]=function(_0x42bf3f,_0x3d0380,_0x1e3726){var _0x3b6d81={};var _0x1b2d2b={};var _0x3e3cba;var _0x63aeec;return db['User'][_0x7061('0x87')]({'where':{'id':_0x42bf3f['params']['id']}})['then'](handleEntityNotFound(_0x3d0380,null))[_0x7061('0x1f')](function(_0x329712){if(_0x329712){_0x3e3cba=_0x329712;_0x1b2d2b[_0x7061('0x49')]=_['keys'](db['ChatInteraction'][_0x7061('0x45')]);_0x1b2d2b[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x42bf3f[_0x7061('0x4e')]);_0x1b2d2b['filters']=_[_0x7061('0x4f')](_0x1b2d2b[_0x7061('0x49')],_0x1b2d2b[_0x7061('0x4e')]);_0x3b6d81[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x1b2d2b[_0x7061('0x49')],qs[_0x7061('0x50')](_0x42bf3f[_0x7061('0x4e')][_0x7061('0x50')]));_0x3b6d81[_0x7061('0x51')]=_0x3b6d81[_0x7061('0x51')][_0x7061('0x61')]?_0x3b6d81['attributes']:_0x1b2d2b[_0x7061('0x49')];_0x3b6d81[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x42bf3f[_0x7061('0x4e')][_0x7061('0x55')]);_0x3b6d81[_0x7061('0x56')]=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0x42bf3f[_0x7061('0x4e')],_0x1b2d2b['filters']));if(_0x42bf3f['query'][_0x7061('0x3a')]){_0x3b6d81[_0x7061('0x56')]=_[_0x7061('0x58')](_0x3b6d81['where'],{'$or':_[_0x7061('0x3c')](_0x3b6d81[_0x7061('0x51')],function(_0x10520f){var _0x4cc4b6={};_0x4cc4b6[_0x10520f]={'$like':'%'+_0x42bf3f['query']['filter']+'%'};return _0x4cc4b6;})});}_0x3b6d81=_['merge']({},_0x3b6d81,_0x42bf3f[_0x7061('0x5c')]);return _0x3e3cba[_0x7061('0xc1')](_0x3b6d81);}})['then'](function(_0xc577c9){if(_0xc577c9){_0x63aeec=_0xc577c9['length'];if(!_0x42bf3f['query'][_0x7061('0x52')](_0x7061('0x53'))){_0x3b6d81['limit']=qs[_0x7061('0x2f')](_0x42bf3f[_0x7061('0x4e')][_0x7061('0x2f')]);_0x3b6d81[_0x7061('0x2e')]=qs[_0x7061('0x2e')](_0x42bf3f[_0x7061('0x4e')][_0x7061('0x2e')]);}return _0x3e3cba['getChatInteractions'](_0x3b6d81);}})[_0x7061('0x1f')](function(_0x460852){if(_0x460852){return _0x460852?{'count':_0x63aeec,'rows':_0x460852}:null;}})[_0x7061('0x1f')](respondWithResult(_0x3d0380,null))[_0x7061('0x29')](handleError(_0x3d0380,null));};exports[_0x7061('0xc2')]=function(_0x228f2b,_0x374f54,_0x112f22){var _0x5ea0bb={};var _0xa89004={};var _0xa725e1;var _0x66f45e;return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x228f2b['params']['id']}})['then'](handleEntityNotFound(_0x374f54,null))[_0x7061('0x1f')](function(_0x1e7453){if(_0x1e7453){_0xa725e1=_0x1e7453;_0xa89004[_0x7061('0x49')]=_[_0x7061('0x4c')](db[_0x7061('0xc3')][_0x7061('0x45')]);_0xa89004[_0x7061('0x4e')]=_['keys'](_0x228f2b[_0x7061('0x4e')]);_0xa89004[_0x7061('0x4d')]=_[_0x7061('0x4f')](_0xa89004[_0x7061('0x49')],_0xa89004['query']);_0x5ea0bb[_0x7061('0x51')]=_[_0x7061('0x4f')](_0xa89004[_0x7061('0x49')],qs[_0x7061('0x50')](_0x228f2b[_0x7061('0x4e')][_0x7061('0x50')]));_0x5ea0bb[_0x7061('0x51')]=_0x5ea0bb[_0x7061('0x51')][_0x7061('0x61')]?_0x5ea0bb[_0x7061('0x51')]:_0xa89004['model'];_0x5ea0bb['order']=qs[_0x7061('0x55')](_0x228f2b[_0x7061('0x4e')][_0x7061('0x55')]);_0x5ea0bb[_0x7061('0x56')]=qs[_0x7061('0x4d')](_['pick'](_0x228f2b[_0x7061('0x4e')],_0xa89004[_0x7061('0x4d')]));if(_0x228f2b[_0x7061('0x4e')][_0x7061('0x3a')]){_0x5ea0bb['where']=_[_0x7061('0x58')](_0x5ea0bb['where'],{'$or':_['map'](_0x5ea0bb[_0x7061('0x51')],function(_0x127958){var _0x514467={};_0x514467[_0x127958]={'$like':'%'+_0x228f2b[_0x7061('0x4e')][_0x7061('0x3a')]+'%'};return _0x514467;})});}_0x5ea0bb=_['merge']({},_0x5ea0bb,_0x228f2b['options']);return _0xa725e1[_0x7061('0xc2')](_0x5ea0bb);}})['then'](function(_0x4360d0){if(_0x4360d0){_0x66f45e=_0x4360d0['length'];if(!_0x228f2b['query'][_0x7061('0x52')](_0x7061('0x53'))){_0x5ea0bb[_0x7061('0x2f')]=qs[_0x7061('0x2f')](_0x228f2b['query'][_0x7061('0x2f')]);_0x5ea0bb[_0x7061('0x2e')]=qs[_0x7061('0x2e')](_0x228f2b[_0x7061('0x4e')]['offset']);}return _0xa725e1['getOpenchannelInteractions'](_0x5ea0bb);}})['then'](function(_0x5a2cd7){if(_0x5a2cd7){return _0x5a2cd7?{'count':_0x66f45e,'rows':_0x5a2cd7}:null;}})[_0x7061('0x1f')](respondWithResult(_0x374f54,null))[_0x7061('0x29')](handleError(_0x374f54,null));};exports[_0x7061('0xc4')]=function(_0x483613,_0x231430,_0x34a1d1){var _0x2b0c3a={'raw':!![],'where':{}};var _0x1492ad={};var _0x348ead={'count':0x0,'rows':[]};return db['User'][_0x7061('0x87')]({'where':{'id':_0x483613[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x231430,null))['then'](function(_0x24fcb1){if(_0x24fcb1){_0x1492ad[_0x7061('0x49')]=_['keys'](db['MailInteraction'][_0x7061('0x45')]);_0x1492ad[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x483613[_0x7061('0x4e')]);_0x1492ad[_0x7061('0x4d')]=_[_0x7061('0x4f')](_0x1492ad[_0x7061('0x49')],_0x1492ad[_0x7061('0x4e')]);_0x2b0c3a[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x1492ad['model'],qs[_0x7061('0x50')](_0x483613[_0x7061('0x4e')]['fields']));_0x2b0c3a[_0x7061('0x51')]=_0x2b0c3a['attributes'][_0x7061('0x61')]?_0x2b0c3a[_0x7061('0x51')]:_0x1492ad['model'];if(!_0x483613[_0x7061('0x4e')][_0x7061('0x52')](_0x7061('0x53'))){_0x2b0c3a['limit']=qs['limit'](_0x483613[_0x7061('0x4e')][_0x7061('0x2f')]);_0x2b0c3a[_0x7061('0x2e')]=qs['offset'](_0x483613['query']['offset']);}_0x2b0c3a['order']=qs[_0x7061('0x55')](_0x483613[_0x7061('0x4e')][_0x7061('0x55')]);_0x2b0c3a[_0x7061('0x56')]=qs['filters'](_[_0x7061('0x57')](_0x483613[_0x7061('0x4e')],_0x1492ad[_0x7061('0x4d')]));_0x2b0c3a[_0x7061('0x56')][_0x7061('0xbd')]=_0x24fcb1['id'];if(_0x483613[_0x7061('0x4e')][_0x7061('0x3a')]){_0x2b0c3a[_0x7061('0x56')]=_['merge'](_0x2b0c3a['where'],{'$or':_[_0x7061('0x3c')](_0x2b0c3a['attributes'],function(_0x4f7632){var _0x162ea2={};_0x162ea2[_0x4f7632]={'$like':'%'+_0x483613['query'][_0x7061('0x3a')]+'%'};return _0x162ea2;})});}_0x2b0c3a=_[_0x7061('0x58')]({},_0x2b0c3a,_0x483613[_0x7061('0x5c')]);return db['MailInteraction']['count']({'where':_0x2b0c3a[_0x7061('0x56')]})[_0x7061('0x1f')](function(_0x3cbb16){_0x348ead['count']=_0x3cbb16;if(_0x483613[_0x7061('0x4e')]['includeAll']){_0x2b0c3a['include']=[{'all':!![]}];}return db[_0x7061('0xc5')]['findAll'](_0x2b0c3a);})[_0x7061('0x1f')](function(_0x519345){_0x348ead[_0x7061('0xbe')]=_0x519345;return _0x348ead;});}})['then'](respondWithFilteredResult(_0x231430,_0x2b0c3a))[_0x7061('0x29')](handleError(_0x231430,null));};exports[_0x7061('0xc6')]=function(_0x25a25f,_0x2db583,_0x20d93a){var _0x295e82={};var _0x28dfee={};var _0x49705b;var _0x2f47eb;return db['User'][_0x7061('0x87')]({'where':{'id':_0x25a25f[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x2db583,null))['then'](function(_0x47cd16){if(_0x47cd16){_0x49705b=_0x47cd16;_0x28dfee[_0x7061('0x49')]=_[_0x7061('0x4c')](db[_0x7061('0xc7')]['rawAttributes']);_0x28dfee['query']=_[_0x7061('0x4c')](_0x25a25f[_0x7061('0x4e')]);_0x28dfee[_0x7061('0x4d')]=_[_0x7061('0x4f')](_0x28dfee[_0x7061('0x49')],_0x28dfee[_0x7061('0x4e')]);_0x295e82[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x28dfee[_0x7061('0x49')],qs[_0x7061('0x50')](_0x25a25f[_0x7061('0x4e')][_0x7061('0x50')]));_0x295e82['attributes']=_0x295e82[_0x7061('0x51')]['length']?_0x295e82[_0x7061('0x51')]:_0x28dfee[_0x7061('0x49')];_0x295e82['order']=qs['sort'](_0x25a25f['query'][_0x7061('0x55')]);_0x295e82[_0x7061('0x56')]=qs[_0x7061('0x4d')](_['pick'](_0x25a25f['query'],_0x28dfee[_0x7061('0x4d')]));if(_0x25a25f[_0x7061('0x4e')][_0x7061('0x3a')]){_0x295e82[_0x7061('0x56')]=_[_0x7061('0x58')](_0x295e82[_0x7061('0x56')],{'$or':_['map'](_0x295e82[_0x7061('0x51')],function(_0x35c00e){var _0x3ad73b={};_0x3ad73b[_0x35c00e]={'$like':'%'+_0x25a25f[_0x7061('0x4e')][_0x7061('0x3a')]+'%'};return _0x3ad73b;})});}_0x295e82=_[_0x7061('0x58')]({},_0x295e82,_0x25a25f[_0x7061('0x5c')]);return _0x49705b[_0x7061('0xc6')](_0x295e82);}})['then'](function(_0xcca137){if(_0xcca137){_0x2f47eb=_0xcca137[_0x7061('0x61')];if(!_0x25a25f[_0x7061('0x4e')][_0x7061('0x52')](_0x7061('0x53'))){_0x295e82[_0x7061('0x2f')]=qs[_0x7061('0x2f')](_0x25a25f[_0x7061('0x4e')][_0x7061('0x2f')]);_0x295e82['offset']=qs['offset'](_0x25a25f[_0x7061('0x4e')][_0x7061('0x2e')]);}return _0x49705b[_0x7061('0xc6')](_0x295e82);}})[_0x7061('0x1f')](function(_0x345702){if(_0x345702){return _0x345702?{'count':_0x2f47eb,'rows':_0x345702}:null;}})[_0x7061('0x1f')](respondWithResult(_0x2db583,null))[_0x7061('0x29')](handleError(_0x2db583,null));};exports[_0x7061('0xc8')]=function(_0x7679ef,_0x3a068e,_0x8cfc96){var _0x5a5afb={};var _0xf9a8aa={};var _0x1710de;var _0x578100;return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x7679ef[_0x7061('0x60')]['id']}})['then'](handleEntityNotFound(_0x3a068e,null))[_0x7061('0x1f')](function(_0x183753){if(_0x183753){_0x1710de=_0x183753;_0xf9a8aa[_0x7061('0x49')]=_[_0x7061('0x4c')](db[_0x7061('0xc9')][_0x7061('0x45')]);_0xf9a8aa['query']=_[_0x7061('0x4c')](_0x7679ef[_0x7061('0x4e')]);_0xf9a8aa[_0x7061('0x4d')]=_[_0x7061('0x4f')](_0xf9a8aa[_0x7061('0x49')],_0xf9a8aa[_0x7061('0x4e')]);_0x5a5afb['attributes']=_[_0x7061('0x4f')](_0xf9a8aa[_0x7061('0x49')],qs[_0x7061('0x50')](_0x7679ef[_0x7061('0x4e')][_0x7061('0x50')]));_0x5a5afb[_0x7061('0x51')]=_0x5a5afb['attributes']['length']?_0x5a5afb['attributes']:_0xf9a8aa[_0x7061('0x49')];_0x5a5afb[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x7679ef[_0x7061('0x4e')][_0x7061('0x55')]);_0x5a5afb[_0x7061('0x56')]=qs[_0x7061('0x4d')](_['pick'](_0x7679ef[_0x7061('0x4e')],_0xf9a8aa[_0x7061('0x4d')]));if(_0x7679ef[_0x7061('0x4e')][_0x7061('0x3a')]){_0x5a5afb[_0x7061('0x56')]=_[_0x7061('0x58')](_0x5a5afb[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x5a5afb[_0x7061('0x51')],function(_0x2f9f76){var _0x224fc5={};_0x224fc5[_0x2f9f76]={'$like':'%'+_0x7679ef['query']['filter']+'%'};return _0x224fc5;})});}_0x5a5afb=_['merge']({},_0x5a5afb,_0x7679ef[_0x7061('0x5c')]);return _0x1710de[_0x7061('0xc8')](_0x5a5afb);}})[_0x7061('0x1f')](function(_0x5257a9){if(_0x5257a9){_0x578100=_0x5257a9['length'];if(!_0x7679ef['query'][_0x7061('0x52')](_0x7061('0x53'))){_0x5a5afb[_0x7061('0x2f')]=qs[_0x7061('0x2f')](_0x7679ef['query']['limit']);_0x5a5afb[_0x7061('0x2e')]=qs['offset'](_0x7679ef[_0x7061('0x4e')][_0x7061('0x2e')]);}return _0x1710de['getFaxInteractions'](_0x5a5afb);}})[_0x7061('0x1f')](function(_0x34bb8c){if(_0x34bb8c){return _0x34bb8c?{'count':_0x578100,'rows':_0x34bb8c}:null;}})[_0x7061('0x1f')](respondWithResult(_0x3a068e,null))[_0x7061('0x29')](handleError(_0x3a068e,null));};exports[_0x7061('0xca')]=function(_0x2b79d0,_0x1d5bcc,_0x364b81){var _0x54967b;var _0x313d18;var _0x2411c6;var _0x3035af=!_[_0x7061('0x71')](_0x2b79d0[_0x7061('0x60')]['id'])?_0x2b79d0['params']['id']:!_[_0x7061('0x71')](_0x2b79d0[_0x7061('0x37')]['id'])?_0x2b79d0['user']['id']:null;return db[_0x7061('0x44')][_0x7061('0x40')]({'where':{'id':_0x3035af,'role':_0x7061('0x38')},'attributes':['id',_0x7061('0x41'),_0x7061('0xcb'),_0x7061('0xcc'),_0x7061('0x3f'),_0x7061('0x6f'),'loginInPause']})[_0x7061('0x1f')](handleEntityNotFound(_0x1d5bcc,null))[_0x7061('0x1f')](function(_0xc0c72e){if(_0xc0c72e){_0x54967b=_0xc0c72e;if(_0x2b79d0[_0x7061('0x63')][_0x7061('0x94')]){_0x2411c6=util[_0x7061('0xa0')]('LOCAL/%s@from-sip/n',_0x54967b[_0x2b79d0[_0x7061('0x63')][_0x7061('0x94')]]);}else if(_0x2b79d0[_0x7061('0x63')][_0x7061('0xcd')]){_0x2411c6=util[_0x7061('0xa0')](_0x7061('0xa1'),_0x2b79d0[_0x7061('0x63')][_0x7061('0xcd')]);}else{_0x2411c6=util[_0x7061('0xa0')](_0x7061('0xa1'),_0x54967b['name']);}socket['to'](util[_0x7061('0xa0')](_0x7061('0xce'),_0x54967b[_0x7061('0x41')]))[_0x7061('0x9c')]('user:forcelogout',{'ip':_0x2b79d0[_0x7061('0xcf')][_0x7061('0xd0')]||_0x2b79d0['connection']['remoteAddress']||_0x2b79d0['socket'][_0x7061('0xd1')]||_0x2b79d0[_0x7061('0xd2')]['socket'][_0x7061('0xd1')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x54967b[_0x7061('0x41')]},'individualHooks':!![]});}})[_0x7061('0x1f')](function(_0x54d0ad){if(_0x54967b){return _0x54967b['getVoiceQueues']({'raw':!![]});}})[_0x7061('0x1f')](function(_0x2449dc){var _0x49dda4=[];if(_0x2449dc){_0x313d18=_0x2449dc;if(_0x313d18['length']){for(var _0x515396=0x0;_0x515396<_0x313d18['length'];_0x515396++){_0x49dda4[_0x7061('0x9f')]({'membername':_0x54967b[_0x7061('0x41')],'UserId':_0x54967b['id'],'queue_name':_0x313d18[_0x515396][_0x7061('0x41')],'VoiceQueueId':_0x313d18[_0x515396]['id'],'interface':_0x2411c6,'paused':_0x54967b[_0x7061('0x92')]||![],'penalty':_0x313d18[_0x515396][_0x7061('0xd3')]||0x0});}return BPromise['each'](_0x49dda4,function(_0x804fde){return db[_0x7061('0xa3')][_0x7061('0xd4')](_0x804fde);});}}})[_0x7061('0x1f')](function(){return db[_0x7061('0xd5')][_0x7061('0x5f')]({'where':{'membername':_0x54967b[_0x7061('0x41')],'exitAt':null}});})[_0x7061('0x1f')](function(_0x1377a2){var _0x35bf8b=[];_0x1377a2['forEach'](function(_0x303a10){_0x35bf8b['push'](_0x303a10['update']({'exitAt':moment()[_0x7061('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x7061('0xd6')](_0x35bf8b);})[_0x7061('0x1f')](function(){var _0x5b8c99=[];var _0x2b38f6=[];var _0x28fc06=utils[_0x7061('0xd7')]();var _0x12814c={'membername':_0x54967b[_0x7061('0x41')],'interface':_0x2411c6,'enterAt':moment()[_0x7061('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x54967b['role'],'internal':_0x54967b[_0x7061('0x6f')]};_0x28fc06[_0x7061('0xd8')](function(_0x598aac){_0x5b8c99[_0x7061('0x9f')](_[_0x7061('0x58')]({'channel':_0x598aac,'type':'LOGIN','data1':_0x2b79d0[_0x7061('0x63')][_0x7061('0xd9')],'data2':_0x2411c6},_0x12814c));if(_0x54967b[_0x7061('0x92')]){_0x2b38f6[_0x7061('0x9f')](_[_0x7061('0x58')]({'channel':_0x598aac,'type':_0x7061('0xda'),'data1':_0x7061('0xdb')},_0x12814c));}});return db[_0x7061('0xd5')][_0x7061('0xdc')](_0x5b8c99[_0x7061('0xdd')](_0x2b38f6),{'individualHooks':!![]});})[_0x7061('0x1f')](function(){return _0x54967b[_0x7061('0x34')]({'online':!![],'lastLoginAt':moment()[_0x7061('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x54967b[_0x7061('0x92')]||![],'mailPause':_0x54967b[_0x7061('0x92')]||![],'chatPause':_0x54967b['loginInPause']||![],'faxPause':_0x54967b[_0x7061('0x92')]||![],'smsPause':_0x54967b[_0x7061('0x92')]||![],'openchannelPause':_0x54967b[_0x7061('0x92')]||![],'pauseType':_0x54967b[_0x7061('0x92')]?_0x7061('0xdb'):null,'interface':_0x2411c6,'lastPauseAt':moment()[_0x7061('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x7061('0x1f')](function(_0x443b08){if(_0x2b79d0['isMiddleware']){return _0x364b81();}else{return BPromise[_0x7061('0xde')](_0x443b08)[_0x7061('0x1f')](respondWithResult(_0x1d5bcc,null));}})[_0x7061('0x29')](handleError(_0x1d5bcc,null));};exports['logout']=function(_0x571693,_0xcd6343,_0x4657a4){var _0x4851ba;return db['User']['find']({'where':{'id':_0x571693['params']['id'],'role':_0x7061('0x38')},'attributes':['id',_0x7061('0x41'),_0x7061('0x3f')]})[_0x7061('0x1f')](handleEntityNotFound(_0xcd6343,null))[_0x7061('0x1f')](function(_0x3c5532){if(_0x3c5532){_0x4851ba=_0x3c5532;return db[_0x7061('0xa3')][_0x7061('0x35')]({'where':{'membername':_0x4851ba['name']},'individualHooks':!![]});}})[_0x7061('0x1f')](function(){return db[_0x7061('0xd5')]['findAll']({'where':{'membername':_0x4851ba[_0x7061('0x41')],'exitAt':null}});})[_0x7061('0x1f')](function(_0x1073d0){var _0x665745=[];_0x1073d0[_0x7061('0xd8')](function(_0x14f082){_0x665745[_0x7061('0x9f')](_0x14f082[_0x7061('0x34')]({'exitAt':moment()[_0x7061('0xa0')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x665745);})[_0x7061('0x1f')](function(){return _0x4851ba[_0x7061('0x34')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0xcd6343,null))[_0x7061('0x29')](handleError(_0xcd6343,null));};exports['pause']=function(_0x1697ab,_0x2681a8,_0x394094){var _0x3bac46;return db[_0x7061('0xa3')][_0x7061('0x34')]({'paused':0x1},{'where':{'UserId':_0x1697ab[_0x7061('0x60')]['id']},'individualHooks':!![]})[_0x7061('0x1f')](function(){return db[_0x7061('0x44')]['find']({'where':{'id':_0x1697ab[_0x7061('0x60')]['id'],'role':_0x7061('0x38')},'attributes':['id',_0x7061('0x41'),_0x7061('0x3f'),'internal',_0x7061('0x94')]});})[_0x7061('0x1f')](handleEntityNotFound(_0x2681a8,null))[_0x7061('0x1f')](function(_0x11fb1c){if(_0x11fb1c){_0x3bac46=_0x11fb1c;return respondWithRpcPromise(_0x7061('0xdf'),_0x7061('0xe0'),{'id':_0x3bac46['id'],'name':_0x3bac46[_0x7061('0x41')],'pause':!![]});}})[_0x7061('0x1f')](function(){if(_0x3bac46){return db[_0x7061('0xd5')][_0x7061('0x5f')]({'where':{'membername':_0x3bac46[_0x7061('0x41')],'type':_0x7061('0xda'),'exitAt':null}});}})[_0x7061('0x1f')](function(_0x5ce144){if(_0x5ce144[_0x7061('0x61')]){var _0x118b78=moment()[_0x7061('0xa0')](_0x7061('0xe1'));for(var _0x22f055=0x0,_0x3fce7f=_0x5ce144[_0x7061('0x61')];_0x22f055<_0x3fce7f;_0x22f055++){_0x5ce144[_0x22f055][_0x7061('0xe2')]({'exitAt':_0x118b78});}}})[_0x7061('0x1f')](function(){var _0x13d605=[];var _0x2f11c9=utils['getChannels']();_0x2f11c9['forEach'](function(_0x1e54c8){_0x13d605[_0x7061('0x9f')]({'channel':_0x1e54c8,'membername':_0x3bac46[_0x7061('0x41')],'interface':_['isNil'](_0x3bac46['interface'])?util[_0x7061('0xa0')](_0x7061('0xa1'),_0x3bac46[_0x7061('0x41')]):_0x3bac46[_0x7061('0x94')],'type':'PAUSE','enterAt':moment()['format'](_0x7061('0xe1')),'data1':_0x1697ab[_0x7061('0x63')][_0x7061('0x47')]||_0x7061('0xe3'),'role':_0x3bac46['role'],'internal':_0x3bac46['internal']});});return db[_0x7061('0xd5')][_0x7061('0xdc')](_0x13d605,{'individualHooks':!![]});})[_0x7061('0x1f')](function(){return _0x3bac46[_0x7061('0x34')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1697ab[_0x7061('0x63')][_0x7061('0x47')]||_0x7061('0xe3'),'lastPauseAt':moment()[_0x7061('0xa0')](_0x7061('0xe1'))});})[_0x7061('0x1f')](respondWithResult(_0x2681a8,null))['catch'](handleError(_0x2681a8,null));};exports[_0x7061('0xe4')]=function(_0x20de5c,_0x13f334,_0x2fd310){var _0x133f88;return db[_0x7061('0x44')][_0x7061('0x40')]({'where':{'id':_0x20de5c[_0x7061('0x60')]['id']},'attributes':['id',_0x7061('0x41'),_0x7061('0x3f'),_0x7061('0x93'),_0x7061('0xe5'),_0x7061('0xe6'),'faxPause',_0x7061('0xe7'),'smsPause',_0x7061('0xe8'),_0x7061('0xe9')]})[_0x7061('0x1f')](handleEntityNotFound(_0x13f334,null))[_0x7061('0x1f')](function(_0x536409){if(_0x536409){_0x133f88=_0x536409;if(_0x20de5c[_0x7061('0x63')][_0x7061('0x90')]&&!utils[_0x7061('0xa5')](_0x20de5c[_0x7061('0x63')][_0x7061('0x90')])){throw new db['Sequelize'][(_0x7061('0x1c'))]('Unknown\x20channel');}switch(_0x20de5c['body'][_0x7061('0x90')]){case _0x7061('0x9e'):return respondWithRpcPromise('QueuePause','unpause',{'id':_0x133f88['id'],'name':_0x133f88[_0x7061('0x41')],'pause':![]})[_0x7061('0x1f')](function(){return db[_0x7061('0xa3')][_0x7061('0x34')]({'paused':0x0},{'where':{'UserId':_0x133f88['id']},'individualHooks':!![]});})[_0x7061('0x1f')](function(){return db[_0x7061('0xd5')][_0x7061('0x40')]({'where':{'channel':_0x20de5c[_0x7061('0x63')][_0x7061('0x90')],'membername':_0x133f88[_0x7061('0x41')],'type':_0x7061('0xda'),'exitAt':null}});})[_0x7061('0x1f')](function(_0x15bf25){if(_0x15bf25){return _0x15bf25[_0x7061('0x34')]({'exitAt':moment()['format'](_0x7061('0xe1')),'data2':_0x7061('0xea')},{'individualHooks':!![]});}return null;})[_0x7061('0x1f')](function(){return _0x133f88['update']({'voicePause':![]});});case _0x7061('0xeb'):case'chat':case _0x7061('0xec'):case'sms':case'openchannel':return db['MemberReport']['find']({'where':{'channel':_0x20de5c[_0x7061('0x63')][_0x7061('0x90')],'membername':_0x133f88[_0x7061('0x41')],'type':'PAUSE','exitAt':null}})[_0x7061('0x1f')](function(_0x2419a){if(_0x2419a){return _0x2419a[_0x7061('0x34')]({'exitAt':moment()[_0x7061('0xa0')](_0x7061('0xe1')),'data2':_0x7061('0xea')},{'individualHooks':!![]});}return null;})[_0x7061('0x1f')](function(){var _0x40d8f2={};_[_0x7061('0x30')](_0x40d8f2,util[_0x7061('0xa0')](_0x7061('0xed'),_0x20de5c[_0x7061('0x63')][_0x7061('0x90')],_0x7061('0xee')),![]);return _0x133f88[_0x7061('0x34')](_0x40d8f2);});default:return respondWithRpcPromise(_0x7061('0xdf'),_0x7061('0xe4'),{'id':_0x133f88['id'],'name':_0x133f88['name'],'pause':![]})[_0x7061('0x1f')](function(){return db[_0x7061('0xa3')]['update']({'paused':0x0},{'where':{'UserId':_0x133f88['id']}});})[_0x7061('0x1f')](function(){return db[_0x7061('0xd5')][_0x7061('0x5f')]({'where':{'membername':_0x133f88[_0x7061('0x41')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x2030cf){var _0x5ad9be=[];_0x2030cf['forEach'](function(_0x2e66e4){_0x5ad9be[_0x7061('0x9f')](_0x2e66e4[_0x7061('0x34')]({'exitAt':moment()[_0x7061('0xa0')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7061('0xea')}));});return BPromise[_0x7061('0xd6')](_0x5ad9be);})[_0x7061('0x1f')](function(){return _0x133f88[_0x7061('0x34')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x7061('0x1f')](respondWithResult(_0x13f334,null))[_0x7061('0x29')](handleError(_0x13f334,null));};exports['getTeams']=function(_0x331561,_0x79217a,_0x1656b0){var _0x526929={};var _0x57d508={};var _0x5edfeb;var _0x38f3d5;return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x331561[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x79217a,null))[_0x7061('0x1f')](function(_0x1533df){if(_0x1533df){_0x5edfeb=_0x1533df;_0x57d508[_0x7061('0x49')]=_['keys'](db[_0x7061('0xef')][_0x7061('0x45')]);_0x57d508['query']=_['keys'](_0x331561[_0x7061('0x4e')]);_0x57d508[_0x7061('0x4d')]=_[_0x7061('0x4f')](_0x57d508[_0x7061('0x49')],_0x57d508[_0x7061('0x4e')]);_0x526929[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x57d508['model'],qs['fields'](_0x331561[_0x7061('0x4e')][_0x7061('0x50')]));_0x526929['attributes']=_0x526929['attributes'][_0x7061('0x61')]?_0x526929[_0x7061('0x51')]:_0x57d508['model'];_0x526929[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x331561['query'][_0x7061('0x55')]);_0x526929[_0x7061('0x56')]=qs[_0x7061('0x4d')](_['pick'](_0x331561[_0x7061('0x4e')],_0x57d508[_0x7061('0x4d')]));if(_0x331561[_0x7061('0x4e')][_0x7061('0x3a')]){_0x526929['where']=_['merge'](_0x526929[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x526929[_0x7061('0x51')],function(_0x2a334b){var _0x37a8e1={};_0x37a8e1[_0x2a334b]={'$like':'%'+_0x331561[_0x7061('0x4e')]['filter']+'%'};return _0x37a8e1;})});}_0x526929=_[_0x7061('0x58')]({},_0x526929,_0x331561[_0x7061('0x5c')]);return _0x5edfeb[_0x7061('0xf0')](_0x526929);}})[_0x7061('0x1f')](function(_0x305400){if(_0x305400){_0x38f3d5=_0x305400[_0x7061('0x61')];if(!_0x331561[_0x7061('0x4e')][_0x7061('0x52')](_0x7061('0x53'))){_0x526929['limit']=qs[_0x7061('0x2f')](_0x331561[_0x7061('0x4e')]['limit']);_0x526929[_0x7061('0x2e')]=qs[_0x7061('0x2e')](_0x331561['query'][_0x7061('0x2e')]);}return _0x5edfeb['getTeams'](_0x526929);}})[_0x7061('0x1f')](function(_0x100dea){if(_0x100dea){return _0x100dea?{'count':_0x38f3d5,'rows':_0x100dea}:null;}})['then'](respondWithResult(_0x79217a,null))[_0x7061('0x29')](handleError(_0x79217a,null));};exports[_0x7061('0xf1')]=function(_0x543082,_0x3c24ea){return db[_0x7061('0x44')][_0x7061('0x40')]({'where':{'id':_0x543082['params']['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x3c24ea,null))[_0x7061('0x1f')](function(_0x2b27c9){if(_0x2b27c9){var _0x2f5e16=_0x2b27c9['get']({'plain':!![]});return _0x2b27c9[_0x7061('0xf1')](_0x543082[_0x7061('0x63')][_0x7061('0x66')],_[_0x7061('0x67')](_0x543082['body'],[_0x7061('0x66'),'id'])||{})[_0x7061('0x1f')](function(){for(var _0x59ab8f=0x0;_0x59ab8f<_0x543082[_0x7061('0x63')][_0x7061('0x66')][_0x7061('0x61')];_0x59ab8f++){var _0x54dde1=[];db[_0x7061('0xef')][_0x7061('0x87')]({'where':{'id':_0x543082[_0x7061('0x63')][_0x7061('0x66')][_0x59ab8f]}})['then'](function(_0x5acb68){_0x54dde1[_0x7061('0x9f')](_0x5acb68[_0x7061('0xf2')]()[_0x7061('0x1f')](function(_0x36bbb8){for(var _0x23f5a3=0x0;_0x23f5a3<_0x36bbb8[_0x7061('0x61')];_0x23f5a3++){_0x36bbb8[_0x23f5a3][_0x7061('0xf3')](_0x7061('0x90'),_0x7061('0xf4'));}return _0x36bbb8;}));_0x54dde1[_0x7061('0x9f')](_0x5acb68[_0x7061('0xf5')]()['then'](function(_0x1a31ec){for(var _0x1d7de4=0x0;_0x1d7de4<_0x1a31ec['length'];_0x1d7de4++){_0x1a31ec[_0x1d7de4][_0x7061('0xf3')](_0x7061('0x90'),'Chat');}return _0x1a31ec;}));_0x54dde1[_0x7061('0x9f')](_0x5acb68['getMailQueues']()['then'](function(_0x3cbb35){for(var _0x489942=0x0;_0x489942<_0x3cbb35['length'];_0x489942++){_0x3cbb35[_0x489942][_0x7061('0xf3')](_0x7061('0x90'),_0x7061('0xf6'));}return _0x3cbb35;}));_0x54dde1['push'](_0x5acb68[_0x7061('0xf7')]()[_0x7061('0x1f')](function(_0x8ffe75){for(var _0x49fa3b=0x0;_0x49fa3b<_0x8ffe75[_0x7061('0x61')];_0x49fa3b++){_0x8ffe75[_0x49fa3b]['setDataValue'](_0x7061('0x90'),_0x7061('0xf8'));}return _0x8ffe75;}));_0x54dde1['push'](_0x5acb68[_0x7061('0xf9')]()[_0x7061('0x1f')](function(_0xb55019){for(var _0x47d34a=0x0;_0x47d34a<_0xb55019[_0x7061('0x61')];_0x47d34a++){_0xb55019[_0x47d34a][_0x7061('0xf3')]('channel',_0x7061('0xfa'));}return _0xb55019;}));_0x54dde1[_0x7061('0x9f')](_0x5acb68[_0x7061('0xfb')]()[_0x7061('0x1f')](function(_0x1e3deb){for(var _0x383b08=0x0;_0x383b08<_0x1e3deb[_0x7061('0x61')];_0x383b08++){_0x1e3deb[_0x383b08][_0x7061('0xf3')]('channel',_0x7061('0xfc'));}return _0x1e3deb;}));return BPromise['all'](_0x54dde1);})[_0x7061('0x1f')](function(_0x472925){var _0x37a167=_[_0x7061('0xfd')](_0x472925);_0x54dde1=[];return db['sequelize'][_0x7061('0xfe')](function(_0x29ee0f){for(var _0x2ca730=0x0;_0x2ca730<_0x37a167[_0x7061('0x61')];_0x2ca730++){_0x54dde1['push'](_0x37a167[_0x2ca730][_0x7061('0xff')](_0x2f5e16['id']),{'transaction':_0x29ee0f});}return BPromise[_0x7061('0xd6')](_0x54dde1)[_0x7061('0x1f')](function(){if(_0x2f5e16[_0x7061('0x91')]){return BPromise['each'](_[_0x7061('0x3a')](_0x37a167,function(_0x193ef6){return _0x193ef6[_0x7061('0x100')](_0x7061('0x90'))===_0x7061('0xf4');}),function(_0x573cad){return db[_0x7061('0xa3')][_0x7061('0xd4')]({'membername':_0x2f5e16[_0x7061('0x41')],'UserId':_0x2f5e16['id'],'queue_name':_0x573cad[_0x7061('0x41')],'VoiceQueueId':_0x573cad['id'],'interface':_[_0x7061('0x71')](_0x2f5e16['interface'])?util[_0x7061('0xa0')](_0x7061('0xa1'),_0x2f5e16[_0x7061('0x41')]):_0x2f5e16[_0x7061('0x94')],'paused':_0x2f5e16['voicePause']||![],'penalty':_0x2f5e16[_0x7061('0x98')]},{'transaction':_0x29ee0f});});}else{return;}})[_0x7061('0x1f')](function(){for(var _0x38af8e=0x0;_0x38af8e<_0x37a167[_0x7061('0x61')];_0x38af8e++){var _0x2233e9=_0x37a167[_0x38af8e][_0x7061('0x100')]('channel');var _0x4d45fd=_0x2233e9+_0x7061('0x9b');socket[_0x7061('0x9c')](_0x7061('0x37')+_0x2233e9+_0x7061('0x9d'),{'UserId':_0x2f5e16['id'],['queueField']:_0x37a167[_0x38af8e]['id']});}});});});}});}})[_0x7061('0x1f')](respondWithStatusCode(_0x3c24ea,null))[_0x7061('0x29')](handleError(_0x3c24ea,null));};exports['removeTeams']=function(_0x4246c8,_0x754b4c){return db[_0x7061('0x44')]['findOne']({'where':{'id':_0x4246c8[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x754b4c,null))[_0x7061('0x1f')](function(_0x4d09c8){if(_0x4d09c8){var _0x43005f=_0x4d09c8[_0x7061('0x36')]({'plain':!![]});var _0x17ecb7=_0x4246c8[_0x7061('0x4e')]['ids'];return _0x4d09c8[_0x7061('0x101')](_0x17ecb7)[_0x7061('0x1f')](function(){for(var _0x4f67b6=0x0;_0x4f67b6<_0x17ecb7[_0x7061('0x61')];_0x4f67b6++){var _0xeb5392=[];db[_0x7061('0xef')][_0x7061('0x87')]({'where':{'id':_0x17ecb7[_0x4f67b6]}})['then'](function(_0x1578fd){_0xeb5392[_0x7061('0x9f')](_0x1578fd[_0x7061('0xf2')]()[_0x7061('0x1f')](function(_0xf9da3a){for(var _0x47ce9d=0x0;_0x47ce9d<_0xf9da3a[_0x7061('0x61')];_0x47ce9d++){_0xf9da3a[_0x47ce9d][_0x7061('0xf3')](_0x7061('0x90'),'Voice');}return _0xf9da3a;}));_0xeb5392[_0x7061('0x9f')](_0x1578fd[_0x7061('0xf5')]()[_0x7061('0x1f')](function(_0x7ac138){for(var _0x565427=0x0;_0x565427<_0x7ac138[_0x7061('0x61')];_0x565427++){_0x7ac138[_0x565427][_0x7061('0xf3')](_0x7061('0x90'),_0x7061('0x102'));}return _0x7ac138;}));_0xeb5392[_0x7061('0x9f')](_0x1578fd[_0x7061('0x103')]()[_0x7061('0x1f')](function(_0x2751db){for(var _0xae4f0=0x0;_0xae4f0<_0x2751db[_0x7061('0x61')];_0xae4f0++){_0x2751db[_0xae4f0][_0x7061('0xf3')](_0x7061('0x90'),_0x7061('0xf6'));}return _0x2751db;}));_0xeb5392[_0x7061('0x9f')](_0x1578fd[_0x7061('0xf7')]()[_0x7061('0x1f')](function(_0x34e081){for(var _0x4dfb9a=0x0;_0x4dfb9a<_0x34e081[_0x7061('0x61')];_0x4dfb9a++){_0x34e081[_0x4dfb9a][_0x7061('0xf3')](_0x7061('0x90'),'Sms');}return _0x34e081;}));_0xeb5392[_0x7061('0x9f')](_0x1578fd[_0x7061('0xf9')]()[_0x7061('0x1f')](function(_0x132c2a){for(var _0x350a6f=0x0;_0x350a6f<_0x132c2a[_0x7061('0x61')];_0x350a6f++){_0x132c2a[_0x350a6f]['setDataValue'](_0x7061('0x90'),_0x7061('0xfa'));}return _0x132c2a;}));_0xeb5392[_0x7061('0x9f')](_0x1578fd[_0x7061('0xfb')]()['then'](function(_0x575e31){for(var _0x3c799b=0x0;_0x3c799b<_0x575e31[_0x7061('0x61')];_0x3c799b++){_0x575e31[_0x3c799b][_0x7061('0xf3')](_0x7061('0x90'),'Openchannel');}return _0x575e31;}));return BPromise[_0x7061('0xd6')](_0xeb5392);})[_0x7061('0x1f')](function(_0x38758f){var _0x4bb264=_[_0x7061('0xfd')](_0x38758f);_0xeb5392=[];return db['sequelize'][_0x7061('0xfe')](function(_0x51ecc6){for(var _0x5748ff=0x0;_0x5748ff<_0x4bb264[_0x7061('0x61')];_0x5748ff++){_0xeb5392[_0x7061('0x9f')](_0x4bb264[_0x5748ff][_0x7061('0x104')](_0x43005f['id']),{'transaction':_0x51ecc6});}return BPromise[_0x7061('0xd6')](_0xeb5392)[_0x7061('0x1f')](function(){if(_0x43005f[_0x7061('0x91')]){return BPromise[_0x7061('0xa2')](_['filter'](_0x4bb264,function(_0x194847){return _0x194847[_0x7061('0x100')](_0x7061('0x90'))===_0x7061('0xf4');}),function(_0x59fa9d){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x59fa9d['id'],'UserId':_0x43005f['id']},'transaction':_0x51ecc6});});}else{return;}})[_0x7061('0x1f')](function(){for(var _0xf8e99d=0x0;_0xf8e99d<_0x4bb264['length'];_0xf8e99d++){var _0x211d72=_0x4bb264[_0xf8e99d][_0x7061('0x100')](_0x7061('0x90'));var _0x1efce6=_0x211d72+'QueueId';socket[_0x7061('0x9c')](_0x7061('0x37')+_0x211d72+'Queue:remove',{'UserId':_0x43005f['id'],['queueField']:_0x4bb264[_0xf8e99d]['id']});}});});});}});}})[_0x7061('0x1f')](respondWithStatusCode(_0x754b4c,null))[_0x7061('0x29')](handleError(_0x754b4c,null));};exports[_0x7061('0x105')]=function(_0x26f9e2,_0x9982b1,_0x1d7780){var _0x1ca93f={};var _0x5e335f={};var _0x28d69b;var _0x273a74;return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x26f9e2['params']['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x9982b1,null))[_0x7061('0x1f')](function(_0x28c207){if(_0x28c207){_0x28d69b=_0x28c207;_0x5e335f['model']=_[_0x7061('0x4c')](db['CmList'][_0x7061('0x45')]);_0x5e335f[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x26f9e2[_0x7061('0x4e')]);_0x5e335f[_0x7061('0x4d')]=_['intersection'](_0x5e335f[_0x7061('0x49')],_0x5e335f['query']);_0x1ca93f[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x5e335f[_0x7061('0x49')],qs[_0x7061('0x50')](_0x26f9e2[_0x7061('0x4e')]['fields']));_0x1ca93f['attributes']=_0x1ca93f[_0x7061('0x51')][_0x7061('0x61')]?_0x1ca93f[_0x7061('0x51')]:_0x5e335f[_0x7061('0x49')];_0x1ca93f[_0x7061('0x54')]=qs[_0x7061('0x55')](_0x26f9e2[_0x7061('0x4e')][_0x7061('0x55')]);_0x1ca93f['where']=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0x26f9e2[_0x7061('0x4e')],_0x5e335f['filters']));if(_0x26f9e2['query']['filter']){_0x1ca93f['where']=_['merge'](_0x1ca93f[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x1ca93f['attributes'],function(_0x41644d){var _0x41ef2c={};_0x41ef2c[_0x41644d]={'$like':'%'+_0x26f9e2[_0x7061('0x4e')]['filter']+'%'};return _0x41ef2c;})});}_0x1ca93f=_[_0x7061('0x58')]({},_0x1ca93f,_0x26f9e2[_0x7061('0x5c')]);return _0x28d69b[_0x7061('0x105')](_0x1ca93f);}})[_0x7061('0x1f')](function(_0xc9be6f){if(_0xc9be6f){_0x273a74=_0xc9be6f['length'];if(!_0x26f9e2[_0x7061('0x4e')][_0x7061('0x52')](_0x7061('0x53'))){_0x1ca93f[_0x7061('0x2f')]=qs['limit'](_0x26f9e2[_0x7061('0x4e')][_0x7061('0x2f')]);_0x1ca93f[_0x7061('0x2e')]=qs['offset'](_0x26f9e2['query'][_0x7061('0x2e')]);}return _0x28d69b['getLists'](_0x1ca93f);}})[_0x7061('0x1f')](function(_0x33854a){if(_0x33854a){return _0x33854a?{'count':_0x273a74,'rows':_0x33854a}:null;}})[_0x7061('0x1f')](respondWithResult(_0x9982b1,null))[_0x7061('0x29')](handleError(_0x9982b1,null));};exports[_0x7061('0x106')]=function(_0x53d646,_0x3a66c3,_0x3bb678){var _0x1e13d9={};var _0x823153={};var _0xfd591e;var _0x443da2;return db[_0x7061('0x44')][_0x7061('0x87')]({'where':{'id':_0x53d646[_0x7061('0x60')]['id']}})[_0x7061('0x1f')](handleEntityNotFound(_0x3a66c3,null))[_0x7061('0x1f')](function(_0x189319){if(_0x189319){_0xfd591e=_0x189319;_0x823153['model']=_[_0x7061('0x4c')](db[_0x7061('0x44')][_0x7061('0x45')]);_0x823153[_0x7061('0x4e')]=_[_0x7061('0x4c')](_0x53d646['query']);_0x823153['filters']=_[_0x7061('0x4f')](_0x823153[_0x7061('0x49')],_0x823153[_0x7061('0x4e')]);_0x1e13d9[_0x7061('0x51')]=_[_0x7061('0x4f')](_0x823153[_0x7061('0x49')],qs[_0x7061('0x50')](_0x53d646[_0x7061('0x4e')]['fields']));_0x1e13d9['attributes']=_0x1e13d9[_0x7061('0x51')]['length']?_0x1e13d9[_0x7061('0x51')]:_0x823153['model'];_0x1e13d9[_0x7061('0x54')]=qs['sort'](_0x53d646['query'][_0x7061('0x55')]);_0x1e13d9[_0x7061('0x56')]=qs[_0x7061('0x4d')](_[_0x7061('0x57')](_0x53d646[_0x7061('0x4e')],_0x823153[_0x7061('0x4d')]));if(_0x53d646['query']['filter']){_0x1e13d9[_0x7061('0x56')]=_[_0x7061('0x58')](_0x1e13d9[_0x7061('0x56')],{'$or':_[_0x7061('0x3c')](_0x1e13d9[_0x7061('0x51')],function(_0x31eeed){var _0x135bec={};_0x135bec[_0x31eeed]={'$like':'%'+_0x53d646[_0x7061('0x4e')][_0x7061('0x3a')]+'%'};return _0x135bec;})});}_0x1e13d9[_0x7061('0x49')]=db[_0x7061('0x44')];_0x1e13d9['as']=_0x7061('0x107');_0x1e13d9=_['merge']({},_0x1e13d9,_0x53d646['options']);return _0xfd591e[_0x7061('0xf2')]({'include':[_0x1e13d9]});}})[_0x7061('0x1f')](function(_0x2df773){if(_0x2df773){var _0x5d78eb={},_0x2636e0=[],_0x5441b5=0x0;for(var _0x50370f=0x0;_0x50370f<_0x2df773[_0x7061('0x61')];_0x50370f+=0x1){for(var _0xdf788b=0x0,_0x166d78;_0xdf788b<_0x2df773[_0x50370f][_0x7061('0x107')][_0x7061('0x61')];_0xdf788b+=0x1){_0x166d78=_0x2df773[_0x50370f][_0x7061('0x107')][_0xdf788b]['get']({'plain':!![]});_0x5d78eb[_0x166d78['id']]=_0x166d78;}}_0x5d78eb=_[_0x7061('0x108')](_0x5d78eb);for(var _0x2fd5fa=qs[_0x7061('0x2e')](_0x53d646[_0x7061('0x4e')]['offset']);_0x2fd5fa<_0x5d78eb[_0x7061('0x61')]&&_0x2636e0[_0x7061('0x61')]=_0x533587){_0x49acdb=_0x533587;_0x4cc2de=0xc8;}else{_0x4cc2de=0xce;}_0x44df31['status'](_0x4cc2de);return _0x44df31[_0x6566('0x33')](_0x6566('0x34'),_0x25e5c+'-'+_0x49acdb+'/'+_0x533587)[_0x6566('0x30')](_0x32fced);}return null;};}function patchUpdates(_0x3a523a){return function(_0x3846ce){try{jsonpatch[_0x6566('0x35')](_0x3846ce,_0x3a523a,!![]);}catch(_0x22da65){return BPromise[_0x6566('0x36')](_0x22da65);}return _0x3846ce[_0x6566('0x37')]();};}function saveUpdates(_0x206ebe,_0x1e1358){return function(_0x4632fc){if(_0x4632fc){return _0x4632fc[_0x6566('0x38')](_0x206ebe)[_0x6566('0x25')](function(_0x22eabe){return _0x22eabe;});}return null;};}function removeEntity(_0x19775d,_0x39d80f){return function(_0x1c4dfd){if(_0x1c4dfd){return _0x1c4dfd[_0x6566('0x39')]()[_0x6566('0x25')](function(){var _0x4cf38e=_0x1c4dfd[_0x6566('0x3a')]({'plain':!![]});var _0x43f511=[{'name':'Users','value':_0x6566('0x3b'),'ignore':!![]},{'name':_0x6566('0x3c'),'value':'agent','ignore':![]},{'name':'Telephones','value':_0x6566('0x3d'),'ignore':![]}];var _0x3cd2eb=_(_0x43f511)[_0x6566('0x3e')](_0x6566('0x3f'))[_0x6566('0x40')](_0x6566('0x41'))[_0x6566('0x41')]();if(_['includes'](_0x3cd2eb,_0x4cf38e[_0x6566('0x42')])){return;}var _0x4a8056=_[_0x6566('0x43')](_0x43f511,[_0x6566('0x41'),_0x4cf38e[_0x6566('0x42')]])[_0x6566('0x44')];return db[_0x6566('0x45')][_0x6566('0x39')]({'where':{'type':_0x4a8056,'resourceId':_0x4cf38e['id']}})[_0x6566('0x25')](function(){return _0x1c4dfd;});})['then'](function(){_0x19775d[_0x6566('0x2f')](0xcc)[_0x6566('0x46')]();});}};}function handleEntityNotFound(_0x48cf3e,_0x5d49c9){return function(_0x4b0009){if(!_0x4b0009){_0x48cf3e[_0x6566('0x2e')](0x194);}return _0x4b0009;};}function handleError(_0xf6b9e1,_0xf17174){_0xf17174=_0xf17174||0x1f4;return function(_0xda01e9){logger['error'](_0xda01e9['stack']);if(_0xda01e9[_0x6566('0x44')]){delete _0xda01e9[_0x6566('0x44')];}_0xf6b9e1[_0x6566('0x2f')](_0xf17174)['send'](_0xda01e9);};}exports['index']=function(_0x4e81bc,_0x317d20){var _0x3ad78c={},_0x3a7d45={},_0x4d9295={'count':0x0,'rows':[]};var _0x12e595=_[_0x6566('0x40')](db[_0x6566('0x47')][_0x6566('0x48')],function(_0xc50175){return{'name':_0xc50175['fieldName'],'type':_0xc50175[_0x6566('0x49')][_0x6566('0x4a')]};});_0x3a7d45[_0x6566('0x4b')]=_[_0x6566('0x4c')](_[_0x6566('0x40')](_0x12e595,_0x6566('0x44')),[_0x6566('0x4d'),_0x6566('0x4e')]);_0x3a7d45[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x4e81bc[_0x6566('0x4f')]);_0x3a7d45[_0x6566('0x51')]=_[_0x6566('0x52')](_0x3a7d45[_0x6566('0x4b')],_0x3a7d45['query']);_0x3ad78c[_0x6566('0x53')]=_['intersection'](_0x3a7d45[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x4e81bc['query']['fields']));_0x3ad78c[_0x6566('0x53')]=_0x3ad78c['attributes']['length']?_0x3ad78c[_0x6566('0x53')]:_0x3a7d45[_0x6566('0x4b')];if(!_0x4e81bc[_0x6566('0x4f')]['hasOwnProperty'](_0x6566('0x55'))){_0x3ad78c['limit']=qs[_0x6566('0x56')](_0x4e81bc['query']['limit']);_0x3ad78c['offset']=qs[_0x6566('0x32')](_0x4e81bc[_0x6566('0x4f')][_0x6566('0x32')]);}_0x3ad78c[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x4e81bc[_0x6566('0x4f')][_0x6566('0x58')]);_0x3ad78c[_0x6566('0x59')]=qs[_0x6566('0x51')](_['pick'](_0x4e81bc[_0x6566('0x4f')],_0x3a7d45[_0x6566('0x51')]));if(_0x4e81bc[_0x6566('0x4f')][_0x6566('0x3e')]){_0x3ad78c['where']=_['merge'](_0x3ad78c[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x12e595,function(_0x1e86d9){if(_0x1e86d9['type']!==_0x6566('0x5a')){return db[_0x6566('0x5b')][_0x6566('0x59')](db['sequelize']['fn']('lower',db[_0x6566('0x5b')][_0x6566('0x5c')](_0x1e86d9[_0x6566('0x44')])),{'$like':db[_0x6566('0x5b')]['fn'](_0x6566('0x5d'),'%'+_0x4e81bc[_0x6566('0x4f')][_0x6566('0x3e')]+'%')});}})});}_0x3ad78c=_['merge']({},_0x3ad78c,_0x4e81bc['options']);var _0x12581c={'where':_0x3ad78c[_0x6566('0x59')]};return db[_0x6566('0x47')][_0x6566('0x31')](_0x12581c)['then'](function(_0x58470d){_0x4d9295[_0x6566('0x31')]=_0x58470d;if(_0x4e81bc[_0x6566('0x4f')]['includeAll']){_0x3ad78c['include']=[{'all':!![]}];}return db[_0x6566('0x47')][_0x6566('0x5e')](_0x3ad78c);})[_0x6566('0x25')](function(_0x43e465){_0x4d9295[_0x6566('0x5f')]=_0x43e465;return _0x4d9295;})[_0x6566('0x25')](respondWithFilteredResult(_0x317d20,_0x3ad78c))[_0x6566('0x60')](handleError(_0x317d20,null));};exports[_0x6566('0x61')]=function(_0x2591a6,_0x31e4e7){var _0x232860={'raw':![],'where':{'id':_0x2591a6[_0x6566('0x62')]['id']}},_0x34ef64={};_0x34ef64['model']=_['differenceBy'](_[_0x6566('0x50')](db[_0x6566('0x47')]['rawAttributes']),[_0x6566('0x4d'),_0x6566('0x4e')]);_0x34ef64[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x2591a6[_0x6566('0x4f')]);_0x34ef64[_0x6566('0x51')]=_[_0x6566('0x52')](_0x34ef64[_0x6566('0x4b')],_0x34ef64['query']);_0x232860['attributes']=_['intersection'](_0x34ef64[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x2591a6[_0x6566('0x4f')]['fields']));_0x232860[_0x6566('0x53')]=_0x232860[_0x6566('0x53')][_0x6566('0x63')]?_0x232860[_0x6566('0x53')]:_0x34ef64['model'];if(_0x2591a6[_0x6566('0x4f')]['includeAll']){_0x232860[_0x6566('0x64')]=[{'all':!![]}];}_0x232860=_[_0x6566('0x65')]({},_0x232860,_0x2591a6[_0x6566('0x66')]);return db['User'][_0x6566('0x43')](_0x232860)[_0x6566('0x25')](handleEntityNotFound(_0x31e4e7,null))[_0x6566('0x25')](respondWithResult(_0x31e4e7,null))[_0x6566('0x60')](handleError(_0x31e4e7,null));};exports['bulkCreate']=function(_0x22e1d5,_0x7ca3e7){return db[_0x6566('0x47')][_0x6566('0x67')](_0x22e1d5['body'],{'raw':![],'individualHooks':!![]})[_0x6566('0x25')](respondWithResult(_0x7ca3e7,0xc9))[_0x6566('0x60')](handleError(_0x7ca3e7,null));};exports['update']=function(_0x4860ba,_0x4df2af){if(_0x4860ba['body']['id']){delete _0x4860ba[_0x6566('0x68')]['id'];}delete _0x4860ba[_0x6566('0x68')][_0x6566('0x42')];return db[_0x6566('0x47')][_0x6566('0x43')]({'where':{'id':_0x4860ba['params']['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x4df2af,null))[_0x6566('0x25')](saveUpdates(_0x4860ba['body'],null))['then'](respondWithResult(_0x4df2af,null))[_0x6566('0x60')](handleError(_0x4df2af,null));};exports[_0x6566('0x69')]=function(_0x5d136e,_0x5b2175){return db['User'][_0x6566('0x69')]()[_0x6566('0x25')](respondWithResult(_0x5b2175,null))[_0x6566('0x60')](handleError(_0x5b2175,null));};exports[_0x6566('0x6a')]=function(_0x2a1195,_0x2bc20c,_0x4037f5){return db[_0x6566('0x47')][_0x6566('0x43')]({'where':{'id':_0x2a1195[_0x6566('0x62')]['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x2bc20c,null))[_0x6566('0x25')](function(_0x2be916){if(_0x2be916){return _0x2be916['addContacts'](_0x2a1195[_0x6566('0x68')][_0x6566('0x6b')],_[_0x6566('0x6c')](_0x2a1195[_0x6566('0x68')],[_0x6566('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x2bc20c,null))[_0x6566('0x60')](handleError(_0x2bc20c,null));};var getLicense=function(_0x60bdc4){return new BPromise(function(_0x469264,_0x187646){var _0xda1594=0x0;_0x60bdc4[_0x6566('0x68')]['role']===_0x6566('0x6d')&&_0x469264('agent\x20role');return db[_0x6566('0x47')][_0x6566('0x31')]({'where':{'$or':[{'role':_0x60bdc4[_0x6566('0x68')][_0x6566('0x42')]===_0x6566('0x3d')?_0x6566('0x3d'):[_0x6566('0x6e'),'user']}]}})[_0x6566('0x25')](function(_0x14976d){_0xda1594=_0x14976d;return require('../../config/license/util')[_0x6566('0x6f')]();})[_0x6566('0x25')](function(_0x4ceeea){var _0x47c34b=_0x60bdc4[_0x6566('0x68')][_0x6566('0x42')]==='telephone'?_0x6566('0x70'):'users';if(!_[_0x6566('0x71')](_0x4ceeea[_0x47c34b])&&_0xda1594>=_0x4ceeea[_0x47c34b]){return _0x187646({'message':_0x6566('0x72')});}return _0x469264(util[_0x6566('0x73')]('count\x20%s:\x20%s',_0x47c34b,_0xda1594));})[_0x6566('0x60')](function(_0x137903){return _0x187646(_0x137903);});});};exports[_0x6566('0x74')]=function(_0x5a59cb,_0x542253){return getLicense(_0x5a59cb)[_0x6566('0x25')](function(_0x26aa9d){if(!_0x5a59cb[_0x6566('0x68')][_0x6566('0x75')]){var _0x5a357c;return db[_0x6566('0x76')]['findById'](0x1)['then'](function(_0x3e2612){return checkPasswordPattern(_0x3e2612,_0x5a59cb['body'][_0x6566('0x4d')],_0x3e2612[_0x6566('0x77')]);})[_0x6566('0x25')](function(_0x533bab){_0x5a357c=_0x533bab[_0x6566('0x78')];return db[_0x6566('0x47')][_0x6566('0x79')](_0x6566('0x75'));})['then'](function(_0xc53fb1){if(_[_0x6566('0x71')](_0xc53fb1)){if(_0x5a357c){_0x5a59cb[_0x6566('0x68')][_0x6566('0x75')]=_0x5a357c;}else{_0x5a59cb[_0x6566('0x68')][_0x6566('0x75')]=0x1;}}else{if(_[_0x6566('0x71')](_0x5a357c)||_0x5a357c==_0xc53fb1){_0x5a59cb[_0x6566('0x68')]['internal']=_0xc53fb1+0x1;}else if(_0x5a357c>_0xc53fb1){_0x5a59cb[_0x6566('0x68')][_0x6566('0x75')]=_0x5a357c;}else{return db[_0x6566('0x5b')][_0x6566('0x4f')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db['sequelize'][_0x6566('0x7a')]['SELECT']})[_0x6566('0x25')](function(_0x1e7f8f){if(_0x1e7f8f&&_0x1e7f8f[_0x6566('0x63')]){for(var _0x4040d1=0x0,_0x2bbeaf=_0x1e7f8f[_0x6566('0x63')];_0x4040d1<_0x2bbeaf&&_[_0x6566('0x71')](_0x5a59cb[_0x6566('0x68')]['internal']);_0x4040d1++){if(_0x5a357c<=_0x1e7f8f[_0x4040d1][_0x6566('0x7b')]){_0x5a59cb[_0x6566('0x68')][_0x6566('0x75')]=_0x1e7f8f[_0x4040d1][_0x6566('0x7b')];}else if(_0x5a357c>_0x1e7f8f[_0x4040d1][_0x6566('0x7b')]&&_0x5a357c<=_0x1e7f8f[_0x4040d1]['to']){_0x5a59cb[_0x6566('0x68')]['internal']=_0x5a357c;}}}if(_[_0x6566('0x71')](_0x5a59cb[_0x6566('0x68')][_0x6566('0x75')])){_0x5a59cb[_0x6566('0x68')][_0x6566('0x75')]=_0xc53fb1+0x1;}});}}});}})[_0x6566('0x25')](function(){if(_0x5a59cb[_0x6566('0x68')][_0x6566('0x7c')]){_0x5a59cb[_0x6566('0x68')][_0x6566('0x7d')]=_0x5a59cb[_0x6566('0x68')]['internal'];_0x5a59cb[_0x6566('0x68')]['VoiceMail']={'mailbox':_0x5a59cb[_0x6566('0x68')][_0x6566('0x75')],'password':_0x5a59cb[_0x6566('0x68')][_0x6566('0x4d')],'fullname':_0x5a59cb[_0x6566('0x68')][_0x6566('0x7e')],'email':_0x5a59cb['body'][_0x6566('0x7f')]};}if(_0x5a59cb[_0x6566('0x68')]&&_0x5a59cb[_0x6566('0x68')]['role']===_0x6566('0x6d')){_0x5a59cb['body'][_0x6566('0x80')]=[_0x6566('0x81'),_0x6566('0x82'),_0x6566('0x83'),'110',_0x6566('0x84'),_0x6566('0x85'),_0x6566('0x86'),_0x6566('0x87'),_0x6566('0x88'),_0x6566('0x89'),_0x6566('0x8a'),_0x6566('0x8b')];}return db[_0x6566('0x47')][_0x6566('0x74')](_0x5a59cb['body'],{'include':[{'model':db['VoiceMail'],'as':'VoiceMail'}]});})[_0x6566('0x25')](function(_0x32a8fe){if(_0x5a59cb[_0x6566('0x68')]['role']===_0x6566('0x3b'))return _0x32a8fe;var _0x3e0dad=_0x5a59cb[_0x6566('0x3b')][_0x6566('0x3a')]({'plain':!![]});if(!_0x3e0dad)throw new Error(_0x6566('0x8c'));if(_0x3e0dad[_0x6566('0x42')]===_0x6566('0x3b')){var _0x541d0a=_0x32a8fe[_0x6566('0x3a')]({'plain':!![]});var _0xe8a7ea=[{'name':_0x6566('0x3c'),'value':_0x6566('0x6d')},{'name':_0x6566('0x8d'),'value':_0x6566('0x3d')}];var _0x94ba5c=_[_0x6566('0x43')](_0xe8a7ea,[_0x6566('0x41'),_0x541d0a[_0x6566('0x42')]])[_0x6566('0x44')];return db[_0x6566('0x8e')][_0x6566('0x43')]({'where':{'name':_0x94ba5c,'userProfileId':_0x3e0dad[_0x6566('0x8f')]},'raw':!![]})[_0x6566('0x25')](function(_0x11d431){if(_0x11d431&&_0x11d431[_0x6566('0x90')]===0x0){return db[_0x6566('0x45')]['create']({'name':_0x541d0a[_0x6566('0x44')],'resourceId':_0x541d0a['id'],'type':_0x11d431[_0x6566('0x44')],'sectionId':_0x11d431['id']},{})[_0x6566('0x25')](function(){return _0x32a8fe;});}else{return _0x32a8fe;}})['catch'](function(_0x4261ef){logger[_0x6566('0x2a')](_0x6566('0x91'),_0x4261ef);throw _0x4261ef;});}return _0x32a8fe;})[_0x6566('0x25')](respondWithResult(_0x542253,0xc9))[_0x6566('0x60')](handleError(_0x542253,null));};exports[_0x6566('0x92')]=function(_0x5d2174,_0x253b0b,_0x1b872f){var _0x337deb=![];if(_0x5d2174['body']['id']){delete _0x5d2174[_0x6566('0x68')]['id'];}return db[_0x6566('0x76')][_0x6566('0x93')]({'attributes':['id',_0x6566('0x77')]})[_0x6566('0x25')](function(_0x28eeac){_0x337deb=_0x28eeac[_0x6566('0x77')];return db[_0x6566('0x47')][_0x6566('0x43')]({'where':{'id':_0x5d2174[_0x6566('0x62')]['id']}});})['then'](function(_0x10a558){if(_0x10a558){if(_0x10a558['id']==_0x5d2174[_0x6566('0x3b')]['id']){if(!_0x5d2174['body'][_0x6566('0x94')]||!_0x5d2174[_0x6566('0x68')]['newPassword']){throw new db['Sequelize'][(_0x6566('0x23'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x10a558[_0x6566('0x95')](_0x5d2174[_0x6566('0x68')][_0x6566('0x94')])){throw new db[(_0x6566('0x22'))][(_0x6566('0x23'))](_0x6566('0x96'));}if(_0x5d2174[_0x6566('0x68')][_0x6566('0x94')]==_0x5d2174[_0x6566('0x68')][_0x6566('0x97')]){throw new db[(_0x6566('0x22'))][(_0x6566('0x23'))](_0x6566('0x98'));}return _0x10a558;}else if(_0x5d2174[_0x6566('0x3b')]['role']=='admin'){if(!_0x5d2174['body'][_0x6566('0x97')]){throw new db[(_0x6566('0x22'))][(_0x6566('0x23'))](_0x6566('0x99'));}return _0x10a558;}else if(_0x5d2174[_0x6566('0x3b')][_0x6566('0x42')]=='user'){if(!_0x5d2174[_0x6566('0x68')][_0x6566('0x97')]){throw new db[(_0x6566('0x22'))][(_0x6566('0x23'))](_0x6566('0x99'));}if(_0x10a558[_0x6566('0x42')]!=_0x6566('0x6d')){throw new db[(_0x6566('0x22'))]['ValidationError'](_0x6566('0x9a'));}return _0x10a558;}else{throw new db[(_0x6566('0x22'))]['ValidationError']('Unauthorized');}}return null;})[_0x6566('0x25')](handleEntityNotFound(_0x253b0b,null))[_0x6566('0x25')](function(_0x287bd5){return checkPasswordPattern(_0x287bd5,_0x5d2174['body'][_0x6566('0x97')],_0x337deb);})['then'](saveUpdates({'password':_0x5d2174['body'][_0x6566('0x97')],'passwordResetAt':_0x5d2174['user']['id']==_0x5d2174['params']['id']?moment():null},null))[_0x6566('0x25')](respondWithResult(_0x253b0b,null))[_0x6566('0x60')](handleError(_0x253b0b,null));};exports[_0x6566('0x9b')]=function(_0x28f1e5,_0x2c60a4,_0x4363a1){var _0x17f620=_0x28f1e5[_0x6566('0x68')][_0x6566('0x9c')];return db['User'][_0x6566('0x43')]({'where':{'id':_0x28f1e5[_0x6566('0x62')]['id']},'attributes':['id',_0x6566('0x44'),_0x6566('0x42'),_0x6566('0x9d'),'loginInPause',_0x6566('0x9e'),_0x6566('0x9f')]})[_0x6566('0x25')](handleEntityNotFound(_0x2c60a4,null))[_0x6566('0x25')](function(_0x49f5af){if(_0x49f5af){if(!utils['isValidChannel'](_0x17f620)){throw new db[(_0x6566('0x22'))]['ValidationError']('Unknown\x20channel');}return _0x49f5af[_0x6566('0xa0')+_[_0x6566('0xa1')](_0x17f620['toLowerCase']())+_0x6566('0xa2')](_0x28f1e5[_0x6566('0x68')][_0x6566('0x6b')],{'penalty':_0x28f1e5[_0x6566('0x68')][_0x6566('0xa3')]||0x0})[_0x6566('0xa4')](function(_0x4883cd){for(var _0x5ed689=0x0;_0x5ed689<_0x28f1e5[_0x6566('0x68')][_0x6566('0x6b')]['length'];_0x5ed689+=0x1){var _0x3a2705={'UserId':_0x28f1e5[_0x6566('0x62')]['id']};_0x3a2705[_[_0x6566('0xa1')](_0x17f620[_0x6566('0xa5')]())+_0x6566('0xa6')]=_0x28f1e5[_0x6566('0x68')][_0x6566('0x6b')][_0x5ed689];socket['emit']('user'+_[_0x6566('0xa1')](_0x17f620['toLowerCase']())+_0x6566('0xa7'),_0x3a2705);}return _0x4883cd;})[_0x6566('0x25')](function(){if(_0x17f620==='voice'){return db[_0x6566('0xa8')]['findAll']({'where':{'id':_0x28f1e5[_0x6566('0x68')]['ids']||[]},'raw':!![],'attributes':['id',_0x6566('0x44')]});}})[_0x6566('0x25')](function(_0xb41da1){var _0x105525=_0x49f5af[_0x6566('0x3a')]({'plain':!![]});var _0x294ea9=[];if(_0x17f620===_0x6566('0xa9')&&_0x105525[_0x6566('0x42')]==='agent'&&_0x105525['online']){for(var _0x32ec4b=0x0;_0x32ec4b<_0xb41da1[_0x6566('0x63')];_0x32ec4b+=0x1){_0x294ea9['push']({'membername':_0x105525[_0x6566('0x44')],'UserId':_0x105525['id'],'queue_name':_0xb41da1[_0x32ec4b][_0x6566('0x44')],'VoiceQueueId':_0xb41da1[_0x32ec4b]['id'],'interface':_[_0x6566('0x71')](_0x105525[_0x6566('0x9f')])?util[_0x6566('0x73')](_0x6566('0xaa'),_0x105525[_0x6566('0x44')]):_0x105525[_0x6566('0x9f')],'paused':_0x105525[_0x6566('0x9e')]||![],'penalty':_0x28f1e5['body'][_0x6566('0xa3')]||0x0});}return BPromise[_0x6566('0xab')](_0x294ea9,function(_0x1fc754){return db[_0x6566('0xac')]['upsert'](_0x1fc754);});}return _0x49f5af;});}})[_0x6566('0x25')](respondWithStatusCode(_0x2c60a4,null))['catch'](handleError(_0x2c60a4,null));};exports[_0x6566('0xad')]=function(_0x6d13ec,_0x5666f5,_0x184a3f){var _0x3c5a42;return db[_0x6566('0x47')][_0x6566('0x43')]({'where':{'id':_0x6d13ec[_0x6566('0x62')]['id']},'attributes':['id',_0x6566('0x44'),_0x6566('0x42')]})[_0x6566('0x25')](handleEntityNotFound(_0x5666f5,null))[_0x6566('0x25')](function(_0x4d26d4){if(_0x4d26d4){_0x3c5a42=_0x4d26d4;if(!_0x6d13ec['query'][_0x6566('0x9c')]||!utils[_0x6566('0xae')](_0x6d13ec[_0x6566('0x4f')][_0x6566('0x9c')])){throw new db[(_0x6566('0x22'))][(_0x6566('0x23'))](_0x6566('0xaf'));}return _0x4d26d4[_0x6566('0xb0')+_[_0x6566('0xa1')](_0x6d13ec[_0x6566('0x4f')]['channel'][_0x6566('0xa5')]())+_0x6566('0xa2')](_0x6d13ec[_0x6566('0x4f')]['ids']);}})[_0x6566('0x25')](function(_0x49b6a4){for(var _0x45caa5=0x0;_0x45caa5<_0x6d13ec['query'][_0x6566('0x6b')][_0x6566('0x63')];_0x45caa5+=0x1){var _0x2b9d73={'UserId':_0x6d13ec['params']['id']};_0x2b9d73[_['capitalize'](_0x6d13ec[_0x6566('0x4f')]['channel'][_0x6566('0xa5')]())+'QueueId']=_0x6d13ec[_0x6566('0x4f')]['ids'][_0x45caa5];socket[_0x6566('0xb1')](_0x6566('0x3b')+_['capitalize'](_0x6d13ec[_0x6566('0x4f')][_0x6566('0x9c')]['toLowerCase']())+_0x6566('0xb2'),_0x2b9d73);}return _0x49b6a4;})[_0x6566('0x25')](function(){if(_0x6d13ec[_0x6566('0x4f')]['channel']===_0x6566('0xa9')){return db[_0x6566('0xac')][_0x6566('0x39')]({'where':{'UserId':_0x6d13ec[_0x6566('0x62')]['id'],'VoiceQueueId':_0x6d13ec[_0x6566('0x4f')][_0x6566('0x6b')]},'individualHooks':!![]})[_0x6566('0x25')](function(){return _0x3c5a42;});}return _0x3c5a42;})[_0x6566('0x25')](respondWithStatusCode(_0x5666f5,null))['catch'](handleError(_0x5666f5,null));};exports['addAvatar']=function(_0x503571,_0x375419,_0x4f8d8d){_0x503571[_0x6566('0x68')]['userpic']=_0x503571[_0x6566('0xb3')][_0x6566('0xb4')];return db[_0x6566('0x47')][_0x6566('0x43')]({'where':{'id':_0x503571[_0x6566('0x62')]['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x375419,null))[_0x6566('0x25')](saveUpdates(_0x503571['body'],null))[_0x6566('0x25')](respondWithResult(_0x375419,null))[_0x6566('0x60')](handleError(_0x375419,null));};exports[_0x6566('0xb5')]=function(_0x349e8c,_0x1497b3,_0x1512e4){var _0x8c785b=path[_0x6566('0xb6')](config['root'],_0x6566('0xb7'));return db[_0x6566('0x47')][_0x6566('0x43')]({'where':{'id':_0x349e8c[_0x6566('0x62')]['id']},'attributes':['id',_0x6566('0xb8')],'raw':!![]})[_0x6566('0x25')](handleEntityNotFound(_0x1497b3,null))[_0x6566('0x25')](function(_0xf47975){if(_0xf47975){if(_[_0x6566('0x71')](_0xf47975[_0x6566('0xb8')])){return _0x1497b3[_0x6566('0xb9')](_0x8c785b);}else{if(!fs[_0x6566('0xba')](path[_0x6566('0xb6')](config[_0x6566('0xbb')],_0x6566('0xbc'),_0xf47975['userpic']))){return _0x1497b3[_0x6566('0xb9')](_0x8c785b);}return _0x1497b3['download'](path[_0x6566('0xb6')](config[_0x6566('0xbb')],_0x6566('0xbc'),_0xf47975['userpic']));}}})[_0x6566('0x60')](handleError(_0x1497b3,null));};exports[_0x6566('0xbd')]=function(_0x424904,_0x489af0,_0x1d7859){var _0x490bf4={};var _0x527cc9={};var _0x5e0043;var _0x1a1d36;return db[_0x6566('0x47')][_0x6566('0x93')]({'where':{'id':_0x424904['params']['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x489af0,null))[_0x6566('0x25')](function(_0x5c3845){if(_0x5c3845){_0x5e0043=_0x5c3845;_0x527cc9[_0x6566('0x4b')]=_[_0x6566('0x50')](db['CmContact'][_0x6566('0x48')]);_0x527cc9['query']=_[_0x6566('0x50')](_0x424904[_0x6566('0x4f')]);_0x527cc9[_0x6566('0x51')]=_['intersection'](_0x527cc9[_0x6566('0x4b')],_0x527cc9[_0x6566('0x4f')]);_0x490bf4[_0x6566('0x53')]=_[_0x6566('0x52')](_0x527cc9[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x424904[_0x6566('0x4f')][_0x6566('0x54')]));_0x490bf4[_0x6566('0x53')]=_0x490bf4[_0x6566('0x53')][_0x6566('0x63')]?_0x490bf4['attributes']:_0x527cc9[_0x6566('0x4b')];_0x490bf4[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x424904[_0x6566('0x4f')]['sort']);_0x490bf4[_0x6566('0x59')]=qs[_0x6566('0x51')](_[_0x6566('0xbe')](_0x424904[_0x6566('0x4f')],_0x527cc9[_0x6566('0x51')]));if(_0x424904['query']['filter']){_0x490bf4[_0x6566('0x59')]=_[_0x6566('0x65')](_0x490bf4['where'],{'$or':_[_0x6566('0x40')](_0x490bf4['attributes'],function(_0x2cafbd){var _0x478d94={};_0x478d94[_0x2cafbd]={'$like':'%'+_0x424904['query'][_0x6566('0x3e')]+'%'};return _0x478d94;})});}_0x490bf4=_[_0x6566('0x65')]({},_0x490bf4,_0x424904[_0x6566('0x66')]);return _0x5e0043[_0x6566('0xbd')](_0x490bf4);}})[_0x6566('0x25')](function(_0x56fb2d){if(_0x56fb2d){_0x1a1d36=_0x56fb2d['length'];if(_0x424904[_0x6566('0x4f')][_0x6566('0xbf')](_0x6566('0xc0'))){_0x490bf4[_0x6566('0x64')]=[{'model':db['CmList'],'as':_0x6566('0xc1'),'required':![]},{'model':db[_0x6566('0xc2')],'as':_0x6566('0xc3'),'attributes':['id',_0x6566('0x44'),'color'],'where':_0x424904['query'][_0x6566('0xc4')]?{'id':_0x424904[_0x6566('0x4f')][_0x6566('0xc4')]}:undefined,'required':_0x424904[_0x6566('0x4f')][_0x6566('0xc4')]?!![]:![]}];}if(!_0x424904[_0x6566('0x4f')][_0x6566('0xbf')]('nolimit')){_0x490bf4[_0x6566('0x56')]=qs[_0x6566('0x56')](_0x424904[_0x6566('0x4f')][_0x6566('0x56')]);_0x490bf4[_0x6566('0x32')]=qs[_0x6566('0x32')](_0x424904[_0x6566('0x4f')][_0x6566('0x32')]);}return _0x5e0043[_0x6566('0xbd')](_0x490bf4);}})[_0x6566('0x25')](function(_0x3ea4c6){if(_0x3ea4c6){return _0x3ea4c6?{'count':_0x1a1d36,'rows':_0x3ea4c6}:null;}})[_0x6566('0x25')](respondWithResult(_0x489af0,null))[_0x6566('0x60')](handleError(_0x489af0,null));};exports[_0x6566('0xc5')]=function(_0x434037,_0x54119d,_0xfcff2a){var _0x1e8353;var _0x4607ae;var _0x51da51={};var _0x3fd8c0;return db[_0x6566('0x47')]['findOne']({'where':{'id':_0x434037[_0x6566('0x62')]['id']},'attributes':['id','name',_0x6566('0x42')]})[_0x6566('0x25')](handleEntityNotFound(_0x54119d,null))[_0x6566('0x25')](function(_0x20b9e6){if(!utils[_0x6566('0xae')](_0x434037[_0x6566('0x4f')]['channel'])){throw new db[(_0x6566('0x22'))][(_0x6566('0x23'))](_0x6566('0xaf'));}_0x1e8353=_0x20b9e6;var _0x37d7a1={};_0x37d7a1[_0x6566('0x4b')]=_['keys'](db[_[_0x6566('0xa1')](_0x434037[_0x6566('0x4f')][_0x6566('0x9c')])+_0x6566('0xc6')][_0x6566('0x48')]);_0x37d7a1['query']=_[_0x6566('0x50')](_0x434037[_0x6566('0x4f')]);_0x37d7a1[_0x6566('0x51')]=_[_0x6566('0x52')](_0x37d7a1['model'],_0x37d7a1[_0x6566('0x4f')]);_0x51da51['attributes']=_[_0x6566('0x52')](_0x37d7a1[_0x6566('0x4b')],qs['fields'](_0x434037['query']['fields']));_0x51da51[_0x6566('0x53')]=_0x51da51[_0x6566('0x53')][_0x6566('0x63')]?_0x51da51['attributes']:_0x37d7a1[_0x6566('0x4b')];_0x51da51[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x434037['query'][_0x6566('0x58')]);_0x51da51['where']=qs[_0x6566('0x51')](_[_0x6566('0xbe')](_0x434037[_0x6566('0x4f')],_0x37d7a1[_0x6566('0x51')]));if(_0x434037[_0x6566('0x4f')][_0x6566('0x3e')]){_0x51da51[_0x6566('0x59')]=_[_0x6566('0x65')](_0x51da51[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x51da51[_0x6566('0x53')],function(_0x4ea8d1){var _0x9c3858={};_0x9c3858[_0x4ea8d1]={'$like':'%'+_0x434037['query'][_0x6566('0x3e')]+'%'};return _0x9c3858;})});}_0x51da51=_[_0x6566('0x65')]({},_0x51da51,_0x434037[_0x6566('0x66')]);switch(_0x1e8353[_0x6566('0x42')]){case _0x6566('0x6e'):return db[_[_0x6566('0xa1')](_0x434037[_0x6566('0x4f')]['channel'])+'Queue'][_0x6566('0x5e')](_0x51da51);case _0x6566('0x3b'):case _0x6566('0x6d'):return _0x1e8353[_0x6566('0x3a')+_['capitalize'](_0x434037[_0x6566('0x4f')][_0x6566('0x9c')])+_0x6566('0xa2')](_0x51da51);default:throw new db[(_0x6566('0x22'))][(_0x6566('0x23'))]('Unknown\x20role');}})[_0x6566('0x25')](function(_0x250e77){_0x3fd8c0=_0x250e77[_0x6566('0x63')];if(!_0x434037[_0x6566('0x4f')][_0x6566('0xbf')](_0x6566('0x55'))){_0x51da51[_0x6566('0x56')]=qs[_0x6566('0x56')](_0x434037[_0x6566('0x4f')]['limit']);_0x51da51[_0x6566('0x32')]=qs[_0x6566('0x32')](_0x434037[_0x6566('0x4f')][_0x6566('0x32')]);}switch(_0x1e8353[_0x6566('0x42')]){case'admin':return db[_[_0x6566('0xa1')](_0x434037['query'][_0x6566('0x9c')])+_0x6566('0xc6')][_0x6566('0x5e')](_0x51da51);case _0x6566('0x3b'):case'agent':return _0x1e8353[_0x6566('0x3a')+_[_0x6566('0xa1')](_0x434037[_0x6566('0x4f')][_0x6566('0x9c')])+_0x6566('0xa2')](_0x51da51);}})[_0x6566('0x25')](function(_0x104942){return{'count':_0x3fd8c0,'rows':_0x104942};})[_0x6566('0x25')](respondWithResult(_0x54119d,null))[_0x6566('0x60')](handleError(_0x54119d,null));};exports[_0x6566('0xc7')]=function(_0x4b5589,_0x300e35,_0x4e1f02){var _0x511270={};var _0xe0a172={};var _0x4036dd;var _0x377e68;return db[_0x6566('0x47')][_0x6566('0x93')]({'where':{'id':_0x4b5589['params']['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x300e35,null))[_0x6566('0x25')](function(_0x5d8c5d){if(_0x5d8c5d){_0x4036dd=_0x5d8c5d;_0xe0a172[_0x6566('0x4b')]=_[_0x6566('0x50')](db['UserVoiceQueueRt'][_0x6566('0x48')]);_0xe0a172[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x4b5589[_0x6566('0x4f')]);_0xe0a172[_0x6566('0x51')]=_[_0x6566('0x52')](_0xe0a172[_0x6566('0x4b')],_0xe0a172[_0x6566('0x4f')]);_0x511270[_0x6566('0x53')]=_[_0x6566('0x52')](_0xe0a172[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x4b5589[_0x6566('0x4f')]['fields']));_0x511270[_0x6566('0x53')]=_0x511270[_0x6566('0x53')][_0x6566('0x63')]?_0x511270['attributes']:_0xe0a172[_0x6566('0x4b')];_0x511270[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x4b5589[_0x6566('0x4f')][_0x6566('0x58')]);_0x511270[_0x6566('0x59')]=qs['filters'](_[_0x6566('0xbe')](_0x4b5589[_0x6566('0x4f')],_0xe0a172[_0x6566('0x51')]));if(_0x4b5589['query']['filter']){_0x511270['where']=_[_0x6566('0x65')](_0x511270[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x511270[_0x6566('0x53')],function(_0x2b3fec){var _0x5728e8={};_0x5728e8[_0x2b3fec]={'$like':'%'+_0x4b5589[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x5728e8;})});}_0x511270=_[_0x6566('0x65')]({},_0x511270,_0x4b5589['options']);return _0x4036dd[_0x6566('0xc7')](_0x511270);}})[_0x6566('0x25')](function(_0x1b2549){if(_0x1b2549){_0x377e68=_0x1b2549[_0x6566('0x63')];if(!_0x4b5589['query'][_0x6566('0xbf')](_0x6566('0x55'))){_0x511270['limit']=qs['limit'](_0x4b5589[_0x6566('0x4f')][_0x6566('0x56')]);_0x511270[_0x6566('0x32')]=qs[_0x6566('0x32')](_0x4b5589[_0x6566('0x4f')][_0x6566('0x32')]);}return _0x4036dd[_0x6566('0xc7')](_0x511270);}})['then'](function(_0x19ca78){if(_0x19ca78){return _0x19ca78?{'count':_0x377e68,'rows':_0x19ca78}:null;}})['then'](respondWithResult(_0x300e35,null))[_0x6566('0x60')](handleError(_0x300e35,null));};exports['getGroups']=function(_0x29f416,_0x328daa,_0x316020){var _0x2a49bd={};var _0x49a841={};var _0x1a8587;var _0x4f3c9a;return db['User']['findOne']({'where':{'id':_0x29f416[_0x6566('0x62')]['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x328daa,null))[_0x6566('0x25')](function(_0x3b60a5){if(_0x3b60a5){_0x1a8587=_0x3b60a5;_0x49a841[_0x6566('0x4b')]=_[_0x6566('0x50')](db[_0x6566('0xc8')]['rawAttributes']);_0x49a841[_0x6566('0x4f')]=_['keys'](_0x29f416[_0x6566('0x4f')]);_0x49a841[_0x6566('0x51')]=_[_0x6566('0x52')](_0x49a841['model'],_0x49a841[_0x6566('0x4f')]);_0x2a49bd['attributes']=_['intersection'](_0x49a841[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x29f416[_0x6566('0x4f')][_0x6566('0x54')]));_0x2a49bd[_0x6566('0x53')]=_0x2a49bd['attributes'][_0x6566('0x63')]?_0x2a49bd[_0x6566('0x53')]:_0x49a841[_0x6566('0x4b')];_0x2a49bd[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x29f416[_0x6566('0x4f')]['sort']);_0x2a49bd[_0x6566('0x59')]=qs['filters'](_[_0x6566('0xbe')](_0x29f416[_0x6566('0x4f')],_0x49a841[_0x6566('0x51')]));if(_0x29f416[_0x6566('0x4f')]['filter']){_0x2a49bd[_0x6566('0x59')]=_[_0x6566('0x65')](_0x2a49bd[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x2a49bd[_0x6566('0x53')],function(_0x248a4f){var _0x204f73={};_0x204f73[_0x248a4f]={'$like':'%'+_0x29f416[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x204f73;})});}_0x2a49bd=_['merge']({},_0x2a49bd,_0x29f416['options']);return _0x1a8587[_0x6566('0xc9')](_0x2a49bd);}})['then'](function(_0x306532){if(_0x306532){_0x4f3c9a=_0x306532[_0x6566('0x63')];if(!_0x29f416[_0x6566('0x4f')][_0x6566('0xbf')](_0x6566('0x55'))){_0x2a49bd[_0x6566('0x56')]=qs[_0x6566('0x56')](_0x29f416[_0x6566('0x4f')]['limit']);_0x2a49bd[_0x6566('0x32')]=qs[_0x6566('0x32')](_0x29f416['query'][_0x6566('0x32')]);}return _0x1a8587['getGroups'](_0x2a49bd);}})[_0x6566('0x25')](function(_0xe9e5a6){if(_0xe9e5a6){return _0xe9e5a6?{'count':_0x4f3c9a,'rows':_0xe9e5a6}:null;}})[_0x6566('0x25')](respondWithResult(_0x328daa,null))[_0x6566('0x60')](handleError(_0x328daa,null));};exports[_0x6566('0xca')]=function(_0x57d8ec,_0x2e6719,_0x352439){var _0x35fe9e={'raw':!![],'where':{}};var _0x1efec6={};var _0x423375={'count':0x0,'rows':[]};return db[_0x6566('0x47')][_0x6566('0x93')]({'where':{'id':_0x57d8ec[_0x6566('0x62')]['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x2e6719,null))[_0x6566('0x25')](function(_0x53e322){if(_0x53e322){_0x1efec6['model']=_[_0x6566('0x50')](db[_0x6566('0xcb')][_0x6566('0x48')]);_0x1efec6[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x57d8ec[_0x6566('0x4f')]);_0x1efec6[_0x6566('0x51')]=_[_0x6566('0x52')](_0x1efec6[_0x6566('0x4b')],_0x1efec6[_0x6566('0x4f')]);_0x35fe9e[_0x6566('0x53')]=_[_0x6566('0x52')](_0x1efec6['model'],qs[_0x6566('0x54')](_0x57d8ec[_0x6566('0x4f')][_0x6566('0x54')]));_0x35fe9e['attributes']=_0x35fe9e[_0x6566('0x53')][_0x6566('0x63')]?_0x35fe9e['attributes']:_0x1efec6[_0x6566('0x4b')];if(!_0x57d8ec[_0x6566('0x4f')][_0x6566('0xbf')]('nolimit')){_0x35fe9e['limit']=qs[_0x6566('0x56')](_0x57d8ec[_0x6566('0x4f')][_0x6566('0x56')]);_0x35fe9e[_0x6566('0x32')]=qs[_0x6566('0x32')](_0x57d8ec[_0x6566('0x4f')][_0x6566('0x32')]);}_0x35fe9e[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x57d8ec[_0x6566('0x4f')][_0x6566('0x58')]);_0x35fe9e['where']=qs['filters'](_[_0x6566('0xbe')](_0x57d8ec[_0x6566('0x4f')],_0x1efec6[_0x6566('0x51')]));_0x35fe9e[_0x6566('0x59')][_0x6566('0xcc')]=_0x53e322['id'];if(_0x57d8ec[_0x6566('0x4f')][_0x6566('0x3e')]){_0x35fe9e[_0x6566('0x59')]=_[_0x6566('0x65')](_0x35fe9e[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x35fe9e['attributes'],function(_0x451b4d){var _0x48ae7a={};_0x48ae7a[_0x451b4d]={'$like':'%'+_0x57d8ec[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x48ae7a;})});}_0x35fe9e=_[_0x6566('0x65')]({},_0x35fe9e,_0x57d8ec[_0x6566('0x66')]);return db[_0x6566('0xcb')][_0x6566('0x31')]({'where':_0x35fe9e[_0x6566('0x59')]})[_0x6566('0x25')](function(_0x48afd1){_0x423375[_0x6566('0x31')]=_0x48afd1;if(_0x57d8ec[_0x6566('0x4f')][_0x6566('0xc0')]){_0x35fe9e[_0x6566('0x64')]=[{'all':!![]}];}return db[_0x6566('0xcb')][_0x6566('0x5e')](_0x35fe9e);})[_0x6566('0x25')](function(_0x1e1091){_0x423375[_0x6566('0x5f')]=_0x1e1091;return _0x423375;});}})[_0x6566('0x25')](respondWithFilteredResult(_0x2e6719,_0x35fe9e))[_0x6566('0x60')](handleError(_0x2e6719,null));};exports[_0x6566('0xcd')]=function(_0x4e9417,_0x1c9161,_0xd6186d){var _0x31ece3={'raw':!![],'where':{}};var _0x584c63={};var _0xbf5dc9={'count':0x0,'rows':[]};return db[_0x6566('0x47')]['findOne']({'where':{'id':_0x4e9417['params']['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x1c9161,null))[_0x6566('0x25')](function(_0xf1e584){if(_0xf1e584){_0x584c63[_0x6566('0x4b')]=_['keys'](db[_0x6566('0xce')][_0x6566('0x48')]);_0x584c63[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x4e9417['query']);_0x584c63['filters']=_['intersection'](_0x584c63['model'],_0x584c63[_0x6566('0x4f')]);_0x31ece3[_0x6566('0x53')]=_[_0x6566('0x52')](_0x584c63[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x4e9417['query'][_0x6566('0x54')]));_0x31ece3[_0x6566('0x53')]=_0x31ece3[_0x6566('0x53')][_0x6566('0x63')]?_0x31ece3[_0x6566('0x53')]:_0x584c63[_0x6566('0x4b')];if(!_0x4e9417['query'][_0x6566('0xbf')](_0x6566('0x55'))){_0x31ece3[_0x6566('0x56')]=qs[_0x6566('0x56')](_0x4e9417[_0x6566('0x4f')][_0x6566('0x56')]);_0x31ece3['offset']=qs[_0x6566('0x32')](_0x4e9417[_0x6566('0x4f')][_0x6566('0x32')]);}_0x31ece3[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x4e9417['query'][_0x6566('0x58')]);_0x31ece3[_0x6566('0x59')]=qs[_0x6566('0x51')](_[_0x6566('0xbe')](_0x4e9417[_0x6566('0x4f')],_0x584c63[_0x6566('0x51')]));_0x31ece3['where'][_0x6566('0xcc')]=_0xf1e584['id'];if(_0x4e9417[_0x6566('0x4f')][_0x6566('0x3e')]){_0x31ece3[_0x6566('0x59')]=_[_0x6566('0x65')](_0x31ece3[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x31ece3[_0x6566('0x53')],function(_0x1cf9e1){var _0x47a81a={};_0x47a81a[_0x1cf9e1]={'$like':'%'+_0x4e9417[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x47a81a;})});}_0x31ece3=_[_0x6566('0x65')]({},_0x31ece3,_0x4e9417[_0x6566('0x66')]);return db['ScreenRecording'][_0x6566('0x31')]({'where':_0x31ece3['where']})[_0x6566('0x25')](function(_0x387216){_0xbf5dc9['count']=_0x387216;if(_0x4e9417[_0x6566('0x4f')][_0x6566('0xc0')]){_0x31ece3['include']=[{'all':!![]}];}return db[_0x6566('0xce')]['findAll'](_0x31ece3);})[_0x6566('0x25')](function(_0x457712){_0xbf5dc9[_0x6566('0x5f')]=_0x457712;return _0xbf5dc9;});}})[_0x6566('0x25')](respondWithFilteredResult(_0x1c9161,_0x31ece3))[_0x6566('0x60')](handleError(_0x1c9161,null));};exports['getChatInteractions']=function(_0x37f3ef,_0x2e86b6,_0x18d76f){var _0x6f3fa7={};var _0x3a9cee={};var _0x529250;var _0x278dcb;return db[_0x6566('0x47')][_0x6566('0x93')]({'where':{'id':_0x37f3ef['params']['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x2e86b6,null))['then'](function(_0x4aae10){if(_0x4aae10){_0x529250=_0x4aae10;_0x3a9cee[_0x6566('0x4b')]=_[_0x6566('0x50')](db[_0x6566('0xcf')][_0x6566('0x48')]);_0x3a9cee[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x37f3ef['query']);_0x3a9cee[_0x6566('0x51')]=_[_0x6566('0x52')](_0x3a9cee[_0x6566('0x4b')],_0x3a9cee['query']);_0x6f3fa7[_0x6566('0x53')]=_[_0x6566('0x52')](_0x3a9cee[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x37f3ef['query'][_0x6566('0x54')]));_0x6f3fa7[_0x6566('0x53')]=_0x6f3fa7[_0x6566('0x53')]['length']?_0x6f3fa7[_0x6566('0x53')]:_0x3a9cee[_0x6566('0x4b')];_0x6f3fa7[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x37f3ef[_0x6566('0x4f')][_0x6566('0x58')]);_0x6f3fa7[_0x6566('0x59')]=qs[_0x6566('0x51')](_[_0x6566('0xbe')](_0x37f3ef['query'],_0x3a9cee[_0x6566('0x51')]));if(_0x37f3ef[_0x6566('0x4f')][_0x6566('0x3e')]){_0x6f3fa7['where']=_[_0x6566('0x65')](_0x6f3fa7[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x6f3fa7[_0x6566('0x53')],function(_0x436636){var _0x3b0609={};_0x3b0609[_0x436636]={'$like':'%'+_0x37f3ef[_0x6566('0x4f')]['filter']+'%'};return _0x3b0609;})});}_0x6f3fa7=_[_0x6566('0x65')]({},_0x6f3fa7,_0x37f3ef[_0x6566('0x66')]);return _0x529250[_0x6566('0xd0')](_0x6f3fa7);}})[_0x6566('0x25')](function(_0x431eeb){if(_0x431eeb){_0x278dcb=_0x431eeb[_0x6566('0x63')];if(!_0x37f3ef[_0x6566('0x4f')][_0x6566('0xbf')](_0x6566('0x55'))){_0x6f3fa7[_0x6566('0x56')]=qs[_0x6566('0x56')](_0x37f3ef[_0x6566('0x4f')][_0x6566('0x56')]);_0x6f3fa7[_0x6566('0x32')]=qs[_0x6566('0x32')](_0x37f3ef[_0x6566('0x4f')][_0x6566('0x32')]);}return _0x529250['getChatInteractions'](_0x6f3fa7);}})['then'](function(_0x5ee69a){if(_0x5ee69a){return _0x5ee69a?{'count':_0x278dcb,'rows':_0x5ee69a}:null;}})['then'](respondWithResult(_0x2e86b6,null))[_0x6566('0x60')](handleError(_0x2e86b6,null));};exports[_0x6566('0xd1')]=function(_0xc6a0cc,_0x737fdd,_0x20056b){var _0x3fae1e={};var _0x467b6e={};var _0x1f6e15;var _0x133340;return db[_0x6566('0x47')][_0x6566('0x93')]({'where':{'id':_0xc6a0cc[_0x6566('0x62')]['id']}})['then'](handleEntityNotFound(_0x737fdd,null))['then'](function(_0x5f451a){if(_0x5f451a){_0x1f6e15=_0x5f451a;_0x467b6e['model']=_['keys'](db[_0x6566('0xd2')][_0x6566('0x48')]);_0x467b6e[_0x6566('0x4f')]=_[_0x6566('0x50')](_0xc6a0cc[_0x6566('0x4f')]);_0x467b6e[_0x6566('0x51')]=_[_0x6566('0x52')](_0x467b6e['model'],_0x467b6e[_0x6566('0x4f')]);_0x3fae1e[_0x6566('0x53')]=_[_0x6566('0x52')](_0x467b6e[_0x6566('0x4b')],qs[_0x6566('0x54')](_0xc6a0cc[_0x6566('0x4f')][_0x6566('0x54')]));_0x3fae1e[_0x6566('0x53')]=_0x3fae1e['attributes'][_0x6566('0x63')]?_0x3fae1e[_0x6566('0x53')]:_0x467b6e[_0x6566('0x4b')];_0x3fae1e['order']=qs['sort'](_0xc6a0cc[_0x6566('0x4f')][_0x6566('0x58')]);_0x3fae1e[_0x6566('0x59')]=qs[_0x6566('0x51')](_[_0x6566('0xbe')](_0xc6a0cc[_0x6566('0x4f')],_0x467b6e[_0x6566('0x51')]));if(_0xc6a0cc[_0x6566('0x4f')][_0x6566('0x3e')]){_0x3fae1e[_0x6566('0x59')]=_[_0x6566('0x65')](_0x3fae1e['where'],{'$or':_['map'](_0x3fae1e[_0x6566('0x53')],function(_0x527bea){var _0x59b5cb={};_0x59b5cb[_0x527bea]={'$like':'%'+_0xc6a0cc[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x59b5cb;})});}_0x3fae1e=_[_0x6566('0x65')]({},_0x3fae1e,_0xc6a0cc[_0x6566('0x66')]);return _0x1f6e15[_0x6566('0xd1')](_0x3fae1e);}})[_0x6566('0x25')](function(_0x43c01b){if(_0x43c01b){_0x133340=_0x43c01b[_0x6566('0x63')];if(!_0xc6a0cc['query'][_0x6566('0xbf')](_0x6566('0x55'))){_0x3fae1e['limit']=qs[_0x6566('0x56')](_0xc6a0cc[_0x6566('0x4f')][_0x6566('0x56')]);_0x3fae1e[_0x6566('0x32')]=qs[_0x6566('0x32')](_0xc6a0cc['query'][_0x6566('0x32')]);}return _0x1f6e15['getOpenchannelInteractions'](_0x3fae1e);}})[_0x6566('0x25')](function(_0x57dc8a){if(_0x57dc8a){return _0x57dc8a?{'count':_0x133340,'rows':_0x57dc8a}:null;}})['then'](respondWithResult(_0x737fdd,null))[_0x6566('0x60')](handleError(_0x737fdd,null));};exports[_0x6566('0xd3')]=function(_0x4676c7,_0x285893,_0x3a4036){var _0x318ee7={'raw':!![],'where':{}};var _0x21202c={};var _0x28a37c={'count':0x0,'rows':[]};return db[_0x6566('0x47')]['findOne']({'where':{'id':_0x4676c7[_0x6566('0x62')]['id']}})['then'](handleEntityNotFound(_0x285893,null))[_0x6566('0x25')](function(_0x159fac){if(_0x159fac){_0x21202c[_0x6566('0x4b')]=_[_0x6566('0x50')](db[_0x6566('0xd4')][_0x6566('0x48')]);_0x21202c[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x4676c7[_0x6566('0x4f')]);_0x21202c['filters']=_[_0x6566('0x52')](_0x21202c['model'],_0x21202c[_0x6566('0x4f')]);_0x318ee7[_0x6566('0x53')]=_['intersection'](_0x21202c[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x4676c7[_0x6566('0x4f')][_0x6566('0x54')]));_0x318ee7[_0x6566('0x53')]=_0x318ee7['attributes']['length']?_0x318ee7[_0x6566('0x53')]:_0x21202c[_0x6566('0x4b')];if(!_0x4676c7[_0x6566('0x4f')]['hasOwnProperty']('nolimit')){_0x318ee7[_0x6566('0x56')]=qs[_0x6566('0x56')](_0x4676c7['query']['limit']);_0x318ee7['offset']=qs['offset'](_0x4676c7[_0x6566('0x4f')][_0x6566('0x32')]);}_0x318ee7[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x4676c7[_0x6566('0x4f')][_0x6566('0x58')]);_0x318ee7[_0x6566('0x59')]=qs[_0x6566('0x51')](_[_0x6566('0xbe')](_0x4676c7[_0x6566('0x4f')],_0x21202c[_0x6566('0x51')]));_0x318ee7[_0x6566('0x59')]['UserId']=_0x159fac['id'];if(_0x4676c7['query'][_0x6566('0x3e')]){_0x318ee7['where']=_['merge'](_0x318ee7[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x318ee7['attributes'],function(_0x12c4b2){var _0x1761d6={};_0x1761d6[_0x12c4b2]={'$like':'%'+_0x4676c7[_0x6566('0x4f')]['filter']+'%'};return _0x1761d6;})});}_0x318ee7=_[_0x6566('0x65')]({},_0x318ee7,_0x4676c7['options']);return db[_0x6566('0xd4')]['count']({'where':_0x318ee7[_0x6566('0x59')]})[_0x6566('0x25')](function(_0x260f7a){_0x28a37c[_0x6566('0x31')]=_0x260f7a;if(_0x4676c7[_0x6566('0x4f')]['includeAll']){_0x318ee7[_0x6566('0x64')]=[{'all':!![]}];}return db[_0x6566('0xd4')][_0x6566('0x5e')](_0x318ee7);})[_0x6566('0x25')](function(_0x38994f){_0x28a37c['rows']=_0x38994f;return _0x28a37c;});}})[_0x6566('0x25')](respondWithFilteredResult(_0x285893,_0x318ee7))[_0x6566('0x60')](handleError(_0x285893,null));};exports['getSmsInteractions']=function(_0xe94029,_0xdd1cc9,_0x3da125){var _0x2f8234={};var _0x5044dd={};var _0x1fdc44;var _0x15e200;return db['User']['findOne']({'where':{'id':_0xe94029[_0x6566('0x62')]['id']}})[_0x6566('0x25')](handleEntityNotFound(_0xdd1cc9,null))[_0x6566('0x25')](function(_0x1e0873){if(_0x1e0873){_0x1fdc44=_0x1e0873;_0x5044dd['model']=_[_0x6566('0x50')](db[_0x6566('0xd5')][_0x6566('0x48')]);_0x5044dd[_0x6566('0x4f')]=_[_0x6566('0x50')](_0xe94029[_0x6566('0x4f')]);_0x5044dd['filters']=_[_0x6566('0x52')](_0x5044dd[_0x6566('0x4b')],_0x5044dd[_0x6566('0x4f')]);_0x2f8234[_0x6566('0x53')]=_[_0x6566('0x52')](_0x5044dd[_0x6566('0x4b')],qs[_0x6566('0x54')](_0xe94029[_0x6566('0x4f')][_0x6566('0x54')]));_0x2f8234[_0x6566('0x53')]=_0x2f8234['attributes'][_0x6566('0x63')]?_0x2f8234['attributes']:_0x5044dd[_0x6566('0x4b')];_0x2f8234[_0x6566('0x57')]=qs['sort'](_0xe94029[_0x6566('0x4f')][_0x6566('0x58')]);_0x2f8234['where']=qs[_0x6566('0x51')](_[_0x6566('0xbe')](_0xe94029[_0x6566('0x4f')],_0x5044dd['filters']));if(_0xe94029[_0x6566('0x4f')][_0x6566('0x3e')]){_0x2f8234[_0x6566('0x59')]=_[_0x6566('0x65')](_0x2f8234[_0x6566('0x59')],{'$or':_['map'](_0x2f8234[_0x6566('0x53')],function(_0x1a04d9){var _0x3cf199={};_0x3cf199[_0x1a04d9]={'$like':'%'+_0xe94029[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x3cf199;})});}_0x2f8234=_['merge']({},_0x2f8234,_0xe94029[_0x6566('0x66')]);return _0x1fdc44[_0x6566('0xd6')](_0x2f8234);}})[_0x6566('0x25')](function(_0x29d137){if(_0x29d137){_0x15e200=_0x29d137[_0x6566('0x63')];if(!_0xe94029[_0x6566('0x4f')][_0x6566('0xbf')](_0x6566('0x55'))){_0x2f8234[_0x6566('0x56')]=qs[_0x6566('0x56')](_0xe94029['query'][_0x6566('0x56')]);_0x2f8234[_0x6566('0x32')]=qs['offset'](_0xe94029[_0x6566('0x4f')][_0x6566('0x32')]);}return _0x1fdc44['getSmsInteractions'](_0x2f8234);}})[_0x6566('0x25')](function(_0x4926ce){if(_0x4926ce){return _0x4926ce?{'count':_0x15e200,'rows':_0x4926ce}:null;}})[_0x6566('0x25')](respondWithResult(_0xdd1cc9,null))[_0x6566('0x60')](handleError(_0xdd1cc9,null));};exports[_0x6566('0xd7')]=function(_0x363253,_0x3e8931,_0x5e18eb){var _0x4daa34={};var _0x284bd0={};var _0x446f77;var _0x3571a6;return db[_0x6566('0x47')][_0x6566('0x93')]({'where':{'id':_0x363253[_0x6566('0x62')]['id']}})['then'](handleEntityNotFound(_0x3e8931,null))[_0x6566('0x25')](function(_0x569ab3){if(_0x569ab3){_0x446f77=_0x569ab3;_0x284bd0[_0x6566('0x4b')]=_[_0x6566('0x50')](db[_0x6566('0xd8')][_0x6566('0x48')]);_0x284bd0[_0x6566('0x4f')]=_['keys'](_0x363253['query']);_0x284bd0[_0x6566('0x51')]=_[_0x6566('0x52')](_0x284bd0[_0x6566('0x4b')],_0x284bd0[_0x6566('0x4f')]);_0x4daa34['attributes']=_['intersection'](_0x284bd0[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x363253['query']['fields']));_0x4daa34[_0x6566('0x53')]=_0x4daa34[_0x6566('0x53')][_0x6566('0x63')]?_0x4daa34[_0x6566('0x53')]:_0x284bd0[_0x6566('0x4b')];_0x4daa34['order']=qs[_0x6566('0x58')](_0x363253[_0x6566('0x4f')]['sort']);_0x4daa34[_0x6566('0x59')]=qs[_0x6566('0x51')](_['pick'](_0x363253[_0x6566('0x4f')],_0x284bd0[_0x6566('0x51')]));if(_0x363253[_0x6566('0x4f')][_0x6566('0x3e')]){_0x4daa34[_0x6566('0x59')]=_[_0x6566('0x65')](_0x4daa34[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x4daa34['attributes'],function(_0x11c5ca){var _0x5a0d6f={};_0x5a0d6f[_0x11c5ca]={'$like':'%'+_0x363253[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x5a0d6f;})});}_0x4daa34=_[_0x6566('0x65')]({},_0x4daa34,_0x363253['options']);return _0x446f77[_0x6566('0xd7')](_0x4daa34);}})['then'](function(_0x5da4cc){if(_0x5da4cc){_0x3571a6=_0x5da4cc['length'];if(!_0x363253[_0x6566('0x4f')][_0x6566('0xbf')]('nolimit')){_0x4daa34['limit']=qs['limit'](_0x363253['query'][_0x6566('0x56')]);_0x4daa34[_0x6566('0x32')]=qs[_0x6566('0x32')](_0x363253[_0x6566('0x4f')][_0x6566('0x32')]);}return _0x446f77['getFaxInteractions'](_0x4daa34);}})[_0x6566('0x25')](function(_0x332517){if(_0x332517){return _0x332517?{'count':_0x3571a6,'rows':_0x332517}:null;}})['then'](respondWithResult(_0x3e8931,null))[_0x6566('0x60')](handleError(_0x3e8931,null));};exports[_0x6566('0xd9')]=function(_0x7349e2,_0x84be58,_0x2f25a1){var _0xfd9f14;var _0x3e1895;var _0x38a953;var _0x5e8a57=!_[_0x6566('0x71')](_0x7349e2[_0x6566('0x62')]['id'])?_0x7349e2[_0x6566('0x62')]['id']:!_['isNil'](_0x7349e2['user']['id'])?_0x7349e2['user']['id']:null;return db['User'][_0x6566('0x43')]({'where':{'id':_0x5e8a57,'role':_0x6566('0x6d')},'attributes':['id','name',_0x6566('0xda'),_0x6566('0xdb'),'role','internal',_0x6566('0xdc')]})[_0x6566('0x25')](handleEntityNotFound(_0x84be58,null))['then'](function(_0x243dec){if(_0x243dec){_0xfd9f14=_0x243dec;if(_0x7349e2['body'][_0x6566('0x9f')]){_0x38a953=util[_0x6566('0x73')](_0x6566('0xdd'),_0xfd9f14[_0x7349e2['body'][_0x6566('0x9f')]]);}else if(_0x7349e2[_0x6566('0x68')][_0x6566('0xde')]){_0x38a953=util[_0x6566('0x73')](_0x6566('0xaa'),_0x7349e2[_0x6566('0x68')]['intrf']);}else{_0x38a953=util[_0x6566('0x73')](_0x6566('0xaa'),_0xfd9f14[_0x6566('0x44')]);}socket['to'](util[_0x6566('0x73')](_0x6566('0xdf'),_0xfd9f14[_0x6566('0x44')]))[_0x6566('0xb1')](_0x6566('0xe0'),{'ip':_0x7349e2[_0x6566('0xe1')][_0x6566('0xe2')]||_0x7349e2['connection'][_0x6566('0xe3')]||_0x7349e2[_0x6566('0xe4')]['remoteAddress']||_0x7349e2[_0x6566('0xe5')][_0x6566('0xe4')][_0x6566('0xe3')]});return db[_0x6566('0xac')][_0x6566('0x39')]({'where':{'membername':_0xfd9f14[_0x6566('0x44')]},'individualHooks':!![]});}})[_0x6566('0x25')](function(_0x3bfee3){if(_0xfd9f14){return _0xfd9f14[_0x6566('0xe6')]({'raw':!![]});}})[_0x6566('0x25')](function(_0x2417ea){var _0x2a60a3=[];if(_0x2417ea){_0x3e1895=_0x2417ea;if(_0x3e1895['length']){for(var _0x55399a=0x0;_0x55399a<_0x3e1895['length'];_0x55399a++){_0x2a60a3[_0x6566('0xe7')]({'membername':_0xfd9f14[_0x6566('0x44')],'UserId':_0xfd9f14['id'],'queue_name':_0x3e1895[_0x55399a][_0x6566('0x44')],'VoiceQueueId':_0x3e1895[_0x55399a]['id'],'interface':_0x38a953,'paused':_0xfd9f14[_0x6566('0xdc')]||![],'penalty':_0x3e1895[_0x55399a][_0x6566('0xe8')]||0x0});}return BPromise['each'](_0x2a60a3,function(_0x2de121){return db[_0x6566('0xac')][_0x6566('0xe9')](_0x2de121);});}}})[_0x6566('0x25')](function(){return db[_0x6566('0xea')]['findAll']({'where':{'membername':_0xfd9f14[_0x6566('0x44')],'exitAt':null}});})[_0x6566('0x25')](function(_0x2379c7){var _0x5a5c65=[];_0x2379c7['forEach'](function(_0x8e8546){_0x5a5c65[_0x6566('0xe7')](_0x8e8546['update']({'exitAt':moment()[_0x6566('0x73')](_0x6566('0xeb'))}));});return BPromise[_0x6566('0xec')](_0x5a5c65);})[_0x6566('0x25')](function(){var _0x6644a8=[];var _0x3fb442=[];var _0x29d461=utils[_0x6566('0xed')]();var _0x398cd1={'membername':_0xfd9f14[_0x6566('0x44')],'interface':_0x38a953,'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'role':_0xfd9f14[_0x6566('0x42')],'internal':_0xfd9f14[_0x6566('0x75')]};_0x29d461[_0x6566('0xee')](function(_0x539aaf){_0x6644a8[_0x6566('0xe7')](_[_0x6566('0x65')]({'channel':_0x539aaf,'type':_0x6566('0xef'),'data1':_0x7349e2[_0x6566('0x68')][_0x6566('0xf0')],'data2':_0x38a953},_0x398cd1));if(_0xfd9f14[_0x6566('0xdc')]){_0x3fb442[_0x6566('0xe7')](_[_0x6566('0x65')]({'channel':_0x539aaf,'type':_0x6566('0xf1'),'data1':_0x6566('0xf2')},_0x398cd1));}});return db[_0x6566('0xea')][_0x6566('0x67')](_0x6644a8[_0x6566('0xf3')](_0x3fb442),{'individualHooks':!![]});})[_0x6566('0x25')](function(){return _0xfd9f14[_0x6566('0x38')]({'online':!![],'lastLoginAt':moment()[_0x6566('0x73')](_0x6566('0xeb')),'voicePause':_0xfd9f14['loginInPause']||![],'mailPause':_0xfd9f14['loginInPause']||![],'chatPause':_0xfd9f14[_0x6566('0xdc')]||![],'faxPause':_0xfd9f14[_0x6566('0xdc')]||![],'smsPause':_0xfd9f14[_0x6566('0xdc')]||![],'openchannelPause':_0xfd9f14[_0x6566('0xdc')]||![],'pauseType':_0xfd9f14[_0x6566('0xdc')]?_0x6566('0xf2'):null,'interface':_0x38a953,'lastPauseAt':moment()[_0x6566('0x73')](_0x6566('0xeb'))});})[_0x6566('0x25')](function(_0x27940d){if(_0x7349e2[_0x6566('0xf4')]){return _0x2f25a1();}else{return BPromise[_0x6566('0xf5')](_0x27940d)['then'](respondWithResult(_0x84be58,null));}})['catch'](handleError(_0x84be58,null));};exports[_0x6566('0xf6')]=function(_0x592fd0,_0x1f8ca6,_0x5728af){var _0x6bb9a0;return db['User'][_0x6566('0x43')]({'where':{'id':_0x592fd0[_0x6566('0x62')]['id'],'role':'agent'},'attributes':['id',_0x6566('0x44'),_0x6566('0x42')]})[_0x6566('0x25')](handleEntityNotFound(_0x1f8ca6,null))[_0x6566('0x25')](function(_0x31a231){if(_0x31a231){_0x6bb9a0=_0x31a231;return db[_0x6566('0xac')][_0x6566('0x39')]({'where':{'membername':_0x6bb9a0[_0x6566('0x44')]},'individualHooks':!![]});}})[_0x6566('0x25')](function(){return db[_0x6566('0xea')][_0x6566('0x5e')]({'where':{'membername':_0x6bb9a0[_0x6566('0x44')],'exitAt':null}});})[_0x6566('0x25')](function(_0x23eba0){var _0x4b7b6a=[];_0x23eba0[_0x6566('0xee')](function(_0x425b62){_0x4b7b6a[_0x6566('0xe7')](_0x425b62['update']({'exitAt':moment()[_0x6566('0x73')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x6566('0xec')](_0x4b7b6a);})[_0x6566('0x25')](function(){return _0x6bb9a0[_0x6566('0x38')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})['then'](respondWithResult(_0x1f8ca6,null))[_0x6566('0x60')](handleError(_0x1f8ca6,null));};exports['pause']=function(_0x258be1,_0x3226d0,_0x4ed6bc){var _0x4719a5;return db[_0x6566('0xac')][_0x6566('0x38')]({'paused':0x1},{'where':{'UserId':_0x258be1[_0x6566('0x62')]['id']},'individualHooks':!![]})[_0x6566('0x25')](function(){return db[_0x6566('0x47')][_0x6566('0x43')]({'where':{'id':_0x258be1[_0x6566('0x62')]['id'],'role':'agent'},'attributes':['id',_0x6566('0x44'),'role','internal',_0x6566('0x9f')]});})[_0x6566('0x25')](handleEntityNotFound(_0x3226d0,null))[_0x6566('0x25')](function(_0x1a4f15){if(_0x1a4f15){_0x4719a5=_0x1a4f15;return respondWithRpcPromise('QueuePause','pause',{'id':_0x4719a5['id'],'name':_0x4719a5[_0x6566('0x44')],'pause':!![]});}})[_0x6566('0x25')](function(){if(_0x4719a5){return db[_0x6566('0xea')]['findAll']({'where':{'membername':_0x4719a5[_0x6566('0x44')],'type':_0x6566('0xf1'),'exitAt':null}});}})['then'](function(_0x424ade){if(_0x424ade[_0x6566('0x63')]){var _0x32a24e=moment()[_0x6566('0x73')](_0x6566('0xeb'));for(var _0x37c89b=0x0,_0x28aa3e=_0x424ade['length'];_0x37c89b<_0x28aa3e;_0x37c89b++){_0x424ade[_0x37c89b][_0x6566('0xf7')]({'exitAt':_0x32a24e});}}})[_0x6566('0x25')](function(){var _0x43880b=[];var _0x2b0bdd=utils[_0x6566('0xed')]();_0x2b0bdd[_0x6566('0xee')](function(_0x3dd6f7){_0x43880b[_0x6566('0xe7')]({'channel':_0x3dd6f7,'membername':_0x4719a5[_0x6566('0x44')],'interface':_['isNil'](_0x4719a5[_0x6566('0x9f')])?util[_0x6566('0x73')]('SIP/%s',_0x4719a5[_0x6566('0x44')]):_0x4719a5[_0x6566('0x9f')],'type':'PAUSE','enterAt':moment()[_0x6566('0x73')](_0x6566('0xeb')),'data1':_0x258be1[_0x6566('0x68')][_0x6566('0x49')]||_0x6566('0xf8'),'role':_0x4719a5[_0x6566('0x42')],'internal':_0x4719a5[_0x6566('0x75')]});});return db['MemberReport'][_0x6566('0x67')](_0x43880b,{'individualHooks':!![]});})[_0x6566('0x25')](function(){return _0x4719a5['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x258be1[_0x6566('0x68')][_0x6566('0x49')]||_0x6566('0xf8'),'lastPauseAt':moment()[_0x6566('0x73')](_0x6566('0xeb'))});})[_0x6566('0x25')](respondWithResult(_0x3226d0,null))[_0x6566('0x60')](handleError(_0x3226d0,null));};exports[_0x6566('0xf9')]=function(_0x51f1db,_0x4f2cda,_0x878067){var _0x275f2e;return db[_0x6566('0x47')]['find']({'where':{'id':_0x51f1db['params']['id']},'attributes':['id',_0x6566('0x44'),_0x6566('0x42'),_0x6566('0x9e'),_0x6566('0xfa'),'chatPause','faxPause','openchannelPause',_0x6566('0xfb'),'pauseType',_0x6566('0xfc')]})['then'](handleEntityNotFound(_0x4f2cda,null))[_0x6566('0x25')](function(_0x567a22){if(_0x567a22){_0x275f2e=_0x567a22;if(_0x51f1db[_0x6566('0x68')][_0x6566('0x9c')]&&!utils[_0x6566('0xae')](_0x51f1db[_0x6566('0x68')][_0x6566('0x9c')])){throw new db[(_0x6566('0x22'))][(_0x6566('0x23'))](_0x6566('0xaf'));}switch(_0x51f1db[_0x6566('0x68')]['channel']){case'voice':return respondWithRpcPromise(_0x6566('0xfd'),_0x6566('0xf9'),{'id':_0x275f2e['id'],'name':_0x275f2e[_0x6566('0x44')],'pause':![]})[_0x6566('0x25')](function(){return db[_0x6566('0xac')]['update']({'paused':0x0},{'where':{'UserId':_0x275f2e['id']},'individualHooks':!![]});})[_0x6566('0x25')](function(){return db['MemberReport'][_0x6566('0x43')]({'where':{'channel':_0x51f1db[_0x6566('0x68')][_0x6566('0x9c')],'membername':_0x275f2e[_0x6566('0x44')],'type':_0x6566('0xf1'),'exitAt':null}});})[_0x6566('0x25')](function(_0x21565f){if(_0x21565f){return _0x21565f[_0x6566('0x38')]({'exitAt':moment()['format'](_0x6566('0xeb')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0x6566('0x25')](function(){return _0x275f2e[_0x6566('0x38')]({'voicePause':![]});});case _0x6566('0xfe'):case _0x6566('0xff'):case _0x6566('0x100'):case _0x6566('0x101'):case _0x6566('0x102'):return db[_0x6566('0xea')]['find']({'where':{'channel':_0x51f1db[_0x6566('0x68')][_0x6566('0x9c')],'membername':_0x275f2e[_0x6566('0x44')],'type':_0x6566('0xf1'),'exitAt':null}})['then'](function(_0xce7e2){if(_0xce7e2){return _0xce7e2[_0x6566('0x38')]({'exitAt':moment()[_0x6566('0x73')](_0x6566('0xeb')),'data2':'manual'},{'individualHooks':!![]});}return null;})['then'](function(){var _0x117d57={};_['set'](_0x117d57,util[_0x6566('0x73')]('%s%s',_0x51f1db['body'][_0x6566('0x9c')],_0x6566('0x103')),![]);return _0x275f2e['update'](_0x117d57);});default:return respondWithRpcPromise(_0x6566('0xfd'),_0x6566('0xf9'),{'id':_0x275f2e['id'],'name':_0x275f2e[_0x6566('0x44')],'pause':![]})[_0x6566('0x25')](function(){return db[_0x6566('0xac')][_0x6566('0x38')]({'paused':0x0},{'where':{'UserId':_0x275f2e['id']}});})[_0x6566('0x25')](function(){return db[_0x6566('0xea')][_0x6566('0x5e')]({'where':{'membername':_0x275f2e['name'],'type':_0x6566('0xf1'),'exitAt':null}});})[_0x6566('0x25')](function(_0x4ed51a){var _0x334b6a=[];_0x4ed51a[_0x6566('0xee')](function(_0x447c50){_0x334b6a[_0x6566('0xe7')](_0x447c50[_0x6566('0x38')]({'exitAt':moment()['format'](_0x6566('0xeb')),'data2':_0x6566('0x104')}));});return BPromise['all'](_0x334b6a);})[_0x6566('0x25')](function(){return _0x275f2e[_0x6566('0x38')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x6566('0x25')](respondWithResult(_0x4f2cda,null))[_0x6566('0x60')](handleError(_0x4f2cda,null));};exports[_0x6566('0x105')]=function(_0x30e161,_0x395a0c,_0x1ad2dc){var _0x200bce={};var _0x17ad99={};var _0x251a16;var _0x5d253e;return db[_0x6566('0x47')][_0x6566('0x93')]({'where':{'id':_0x30e161['params']['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x395a0c,null))[_0x6566('0x25')](function(_0x1272ea){if(_0x1272ea){_0x251a16=_0x1272ea;_0x17ad99[_0x6566('0x4b')]=_[_0x6566('0x50')](db[_0x6566('0x106')][_0x6566('0x48')]);_0x17ad99[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x30e161[_0x6566('0x4f')]);_0x17ad99['filters']=_[_0x6566('0x52')](_0x17ad99[_0x6566('0x4b')],_0x17ad99[_0x6566('0x4f')]);_0x200bce[_0x6566('0x53')]=_[_0x6566('0x52')](_0x17ad99['model'],qs[_0x6566('0x54')](_0x30e161[_0x6566('0x4f')]['fields']));_0x200bce[_0x6566('0x53')]=_0x200bce[_0x6566('0x53')][_0x6566('0x63')]?_0x200bce['attributes']:_0x17ad99[_0x6566('0x4b')];_0x200bce[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x30e161[_0x6566('0x4f')]['sort']);_0x200bce['where']=qs[_0x6566('0x51')](_['pick'](_0x30e161['query'],_0x17ad99['filters']));if(_0x30e161[_0x6566('0x4f')][_0x6566('0x3e')]){_0x200bce[_0x6566('0x59')]=_[_0x6566('0x65')](_0x200bce[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x200bce[_0x6566('0x53')],function(_0x35ba09){var _0xfd804a={};_0xfd804a[_0x35ba09]={'$like':'%'+_0x30e161[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0xfd804a;})});}_0x200bce=_[_0x6566('0x65')]({},_0x200bce,_0x30e161[_0x6566('0x66')]);return _0x251a16[_0x6566('0x105')](_0x200bce);}})[_0x6566('0x25')](function(_0x407178){if(_0x407178){_0x5d253e=_0x407178[_0x6566('0x63')];if(!_0x30e161[_0x6566('0x4f')][_0x6566('0xbf')]('nolimit')){_0x200bce[_0x6566('0x56')]=qs[_0x6566('0x56')](_0x30e161[_0x6566('0x4f')]['limit']);_0x200bce[_0x6566('0x32')]=qs[_0x6566('0x32')](_0x30e161[_0x6566('0x4f')][_0x6566('0x32')]);}return _0x251a16['getTeams'](_0x200bce);}})[_0x6566('0x25')](function(_0x7d484e){if(_0x7d484e){return _0x7d484e?{'count':_0x5d253e,'rows':_0x7d484e}:null;}})[_0x6566('0x25')](respondWithResult(_0x395a0c,null))[_0x6566('0x60')](handleError(_0x395a0c,null));};exports[_0x6566('0x107')]=function(_0x7600bf,_0x43998c){return db[_0x6566('0x47')]['find']({'where':{'id':_0x7600bf[_0x6566('0x62')]['id']}})[_0x6566('0x25')](handleEntityNotFound(_0x43998c,null))[_0x6566('0x25')](function(_0x58585b){if(_0x58585b){var _0x19842a=_0x58585b[_0x6566('0x3a')]({'plain':!![]});return _0x58585b['addTeams'](_0x7600bf[_0x6566('0x68')][_0x6566('0x6b')],_[_0x6566('0x6c')](_0x7600bf[_0x6566('0x68')],[_0x6566('0x6b'),'id'])||{})['then'](function(){for(var _0x617901=0x0;_0x617901<_0x7600bf[_0x6566('0x68')][_0x6566('0x6b')]['length'];_0x617901++){var _0x5d9c55=[];db['Team']['findOne']({'where':{'id':_0x7600bf[_0x6566('0x68')][_0x6566('0x6b')][_0x617901]}})[_0x6566('0x25')](function(_0x51eebe){_0x5d9c55['push'](_0x51eebe[_0x6566('0xe6')]()[_0x6566('0x25')](function(_0x241d4c){for(var _0x2bd119=0x0;_0x2bd119<_0x241d4c['length'];_0x2bd119++){_0x241d4c[_0x2bd119][_0x6566('0x108')](_0x6566('0x9c'),_0x6566('0x109'));}return _0x241d4c;}));_0x5d9c55[_0x6566('0xe7')](_0x51eebe[_0x6566('0x10a')]()[_0x6566('0x25')](function(_0x4dfcca){for(var _0x363325=0x0;_0x363325<_0x4dfcca[_0x6566('0x63')];_0x363325++){_0x4dfcca[_0x363325][_0x6566('0x108')](_0x6566('0x9c'),'Chat');}return _0x4dfcca;}));_0x5d9c55[_0x6566('0xe7')](_0x51eebe[_0x6566('0x10b')]()[_0x6566('0x25')](function(_0x2580db){for(var _0x540f2e=0x0;_0x540f2e<_0x2580db[_0x6566('0x63')];_0x540f2e++){_0x2580db[_0x540f2e][_0x6566('0x108')](_0x6566('0x9c'),_0x6566('0x10c'));}return _0x2580db;}));_0x5d9c55[_0x6566('0xe7')](_0x51eebe[_0x6566('0x10d')]()[_0x6566('0x25')](function(_0x534aac){for(var _0x2062e0=0x0;_0x2062e0<_0x534aac[_0x6566('0x63')];_0x2062e0++){_0x534aac[_0x2062e0]['setDataValue'](_0x6566('0x9c'),_0x6566('0x10e'));}return _0x534aac;}));_0x5d9c55[_0x6566('0xe7')](_0x51eebe[_0x6566('0x10f')]()[_0x6566('0x25')](function(_0x28eb80){for(var _0x479710=0x0;_0x479710<_0x28eb80[_0x6566('0x63')];_0x479710++){_0x28eb80[_0x479710][_0x6566('0x108')](_0x6566('0x9c'),_0x6566('0x110'));}return _0x28eb80;}));_0x5d9c55[_0x6566('0xe7')](_0x51eebe[_0x6566('0x111')]()['then'](function(_0xaaa334){for(var _0x25aa26=0x0;_0x25aa26<_0xaaa334[_0x6566('0x63')];_0x25aa26++){_0xaaa334[_0x25aa26]['setDataValue']('channel',_0x6566('0x112'));}return _0xaaa334;}));return BPromise[_0x6566('0xec')](_0x5d9c55);})[_0x6566('0x25')](function(_0x1f77ff){var _0x523132=_[_0x6566('0x113')](_0x1f77ff);_0x5d9c55=[];return db[_0x6566('0x5b')][_0x6566('0x114')](function(_0x537d4c){for(var _0x20f493=0x0;_0x20f493<_0x523132[_0x6566('0x63')];_0x20f493++){_0x5d9c55[_0x6566('0xe7')](_0x523132[_0x20f493][_0x6566('0x115')](_0x19842a['id']),{'transaction':_0x537d4c});}return BPromise[_0x6566('0xec')](_0x5d9c55)[_0x6566('0x25')](function(){if(_0x19842a[_0x6566('0x9d')]){return BPromise[_0x6566('0xab')](_[_0x6566('0x3e')](_0x523132,function(_0x4a85a7){return _0x4a85a7[_0x6566('0x116')]('channel')==='Voice';}),function(_0x23ada0){return db[_0x6566('0xac')]['upsert']({'membername':_0x19842a['name'],'UserId':_0x19842a['id'],'queue_name':_0x23ada0[_0x6566('0x44')],'VoiceQueueId':_0x23ada0['id'],'interface':_[_0x6566('0x71')](_0x19842a['interface'])?util[_0x6566('0x73')](_0x6566('0xaa'),_0x19842a[_0x6566('0x44')]):_0x19842a['interface'],'paused':_0x19842a[_0x6566('0x9e')]||![],'penalty':_0x19842a[_0x6566('0xa3')]},{'transaction':_0x537d4c});});}else{return;}})[_0x6566('0x25')](function(){for(var _0x189cd9=0x0;_0x189cd9<_0x523132[_0x6566('0x63')];_0x189cd9++){var _0x4d3978=_0x523132[_0x189cd9][_0x6566('0x116')](_0x6566('0x9c'));var _0x497684=_0x4d3978+_0x6566('0xa6');socket[_0x6566('0xb1')](_0x6566('0x3b')+_0x4d3978+_0x6566('0xa7'),{'UserId':_0x19842a['id'],['queueField']:_0x523132[_0x189cd9]['id']});}});});});}});}})[_0x6566('0x25')](respondWithStatusCode(_0x43998c,null))[_0x6566('0x60')](handleError(_0x43998c,null));};exports[_0x6566('0x117')]=function(_0x2e657e,_0x200ac8){return db[_0x6566('0x47')][_0x6566('0x93')]({'where':{'id':_0x2e657e[_0x6566('0x62')]['id']}})['then'](handleEntityNotFound(_0x200ac8,null))[_0x6566('0x25')](function(_0x4ba305){if(_0x4ba305){var _0x2cad51=_0x4ba305['get']({'plain':!![]});var _0x12daed=_0x2e657e[_0x6566('0x4f')][_0x6566('0x6b')];return _0x4ba305[_0x6566('0x117')](_0x12daed)['then'](function(){for(var _0x5ba6a4=0x0;_0x5ba6a4<_0x12daed[_0x6566('0x63')];_0x5ba6a4++){var _0x36da68=[];db[_0x6566('0x106')][_0x6566('0x93')]({'where':{'id':_0x12daed[_0x5ba6a4]}})[_0x6566('0x25')](function(_0x54c230){_0x36da68[_0x6566('0xe7')](_0x54c230[_0x6566('0xe6')]()[_0x6566('0x25')](function(_0x2490e1){for(var _0x4bacb9=0x0;_0x4bacb9<_0x2490e1[_0x6566('0x63')];_0x4bacb9++){_0x2490e1[_0x4bacb9][_0x6566('0x108')](_0x6566('0x9c'),_0x6566('0x109'));}return _0x2490e1;}));_0x36da68[_0x6566('0xe7')](_0x54c230['getChatQueues']()['then'](function(_0x3d4853){for(var _0x3f79ef=0x0;_0x3f79ef<_0x3d4853['length'];_0x3f79ef++){_0x3d4853[_0x3f79ef][_0x6566('0x108')](_0x6566('0x9c'),'Chat');}return _0x3d4853;}));_0x36da68[_0x6566('0xe7')](_0x54c230[_0x6566('0x10b')]()[_0x6566('0x25')](function(_0x2548b4){for(var _0x56d6a6=0x0;_0x56d6a6<_0x2548b4[_0x6566('0x63')];_0x56d6a6++){_0x2548b4[_0x56d6a6][_0x6566('0x108')](_0x6566('0x9c'),_0x6566('0x10c'));}return _0x2548b4;}));_0x36da68['push'](_0x54c230[_0x6566('0x10d')]()[_0x6566('0x25')](function(_0x38e619){for(var _0x3e862c=0x0;_0x3e862c<_0x38e619[_0x6566('0x63')];_0x3e862c++){_0x38e619[_0x3e862c][_0x6566('0x108')](_0x6566('0x9c'),_0x6566('0x10e'));}return _0x38e619;}));_0x36da68[_0x6566('0xe7')](_0x54c230[_0x6566('0x10f')]()['then'](function(_0x40a3f4){for(var _0x3f2ec1=0x0;_0x3f2ec1<_0x40a3f4['length'];_0x3f2ec1++){_0x40a3f4[_0x3f2ec1][_0x6566('0x108')]('channel',_0x6566('0x110'));}return _0x40a3f4;}));_0x36da68['push'](_0x54c230['getOpenchannelQueues']()[_0x6566('0x25')](function(_0x161ca5){for(var _0x12d8d2=0x0;_0x12d8d2<_0x161ca5[_0x6566('0x63')];_0x12d8d2++){_0x161ca5[_0x12d8d2][_0x6566('0x108')](_0x6566('0x9c'),'Openchannel');}return _0x161ca5;}));return BPromise[_0x6566('0xec')](_0x36da68);})['then'](function(_0x4cc1d1){var _0x192683=_[_0x6566('0x113')](_0x4cc1d1);_0x36da68=[];return db[_0x6566('0x5b')][_0x6566('0x114')](function(_0x4cb2f1){for(var _0x467ae0=0x0;_0x467ae0<_0x192683[_0x6566('0x63')];_0x467ae0++){_0x36da68['push'](_0x192683[_0x467ae0]['removeAgent'](_0x2cad51['id']),{'transaction':_0x4cb2f1});}return BPromise['all'](_0x36da68)['then'](function(){if(_0x2cad51['online']){return BPromise[_0x6566('0xab')](_[_0x6566('0x3e')](_0x192683,function(_0x5cf13e){return _0x5cf13e['getDataValue'](_0x6566('0x9c'))===_0x6566('0x109');}),function(_0x393569){return db['UserVoiceQueueRt'][_0x6566('0x39')]({'where':{'VoiceQueueId':_0x393569['id'],'UserId':_0x2cad51['id']},'transaction':_0x4cb2f1});});}else{return;}})[_0x6566('0x25')](function(){for(var _0x1d9380=0x0;_0x1d9380<_0x192683[_0x6566('0x63')];_0x1d9380++){var _0x19c1b8=_0x192683[_0x1d9380][_0x6566('0x116')](_0x6566('0x9c'));var _0x5ee617=_0x19c1b8+'QueueId';socket['emit'](_0x6566('0x3b')+_0x19c1b8+'Queue:remove',{'UserId':_0x2cad51['id'],['queueField']:_0x192683[_0x1d9380]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x200ac8,null))[_0x6566('0x60')](handleError(_0x200ac8,null));};exports[_0x6566('0x118')]=function(_0x3a911c,_0x599a0b,_0x2e14bd){var _0x29672b={};var _0x292c67={};var _0x24d653;var _0x2deb27;return db[_0x6566('0x47')]['findOne']({'where':{'id':_0x3a911c['params']['id']}})['then'](handleEntityNotFound(_0x599a0b,null))[_0x6566('0x25')](function(_0x1d8cd5){if(_0x1d8cd5){_0x24d653=_0x1d8cd5;_0x292c67[_0x6566('0x4b')]=_[_0x6566('0x50')](db[_0x6566('0x119')][_0x6566('0x48')]);_0x292c67[_0x6566('0x4f')]=_[_0x6566('0x50')](_0x3a911c[_0x6566('0x4f')]);_0x292c67['filters']=_[_0x6566('0x52')](_0x292c67[_0x6566('0x4b')],_0x292c67[_0x6566('0x4f')]);_0x29672b['attributes']=_[_0x6566('0x52')](_0x292c67[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x3a911c['query'][_0x6566('0x54')]));_0x29672b[_0x6566('0x53')]=_0x29672b[_0x6566('0x53')][_0x6566('0x63')]?_0x29672b[_0x6566('0x53')]:_0x292c67[_0x6566('0x4b')];_0x29672b[_0x6566('0x57')]=qs['sort'](_0x3a911c['query'][_0x6566('0x58')]);_0x29672b['where']=qs[_0x6566('0x51')](_[_0x6566('0xbe')](_0x3a911c[_0x6566('0x4f')],_0x292c67['filters']));if(_0x3a911c[_0x6566('0x4f')]['filter']){_0x29672b[_0x6566('0x59')]=_['merge'](_0x29672b[_0x6566('0x59')],{'$or':_['map'](_0x29672b[_0x6566('0x53')],function(_0x4becc5){var _0x3f91f0={};_0x3f91f0[_0x4becc5]={'$like':'%'+_0x3a911c[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x3f91f0;})});}_0x29672b=_[_0x6566('0x65')]({},_0x29672b,_0x3a911c[_0x6566('0x66')]);return _0x24d653[_0x6566('0x118')](_0x29672b);}})['then'](function(_0x51de60){if(_0x51de60){_0x2deb27=_0x51de60[_0x6566('0x63')];if(!_0x3a911c['query'][_0x6566('0xbf')](_0x6566('0x55'))){_0x29672b[_0x6566('0x56')]=qs[_0x6566('0x56')](_0x3a911c[_0x6566('0x4f')][_0x6566('0x56')]);_0x29672b['offset']=qs['offset'](_0x3a911c[_0x6566('0x4f')][_0x6566('0x32')]);}return _0x24d653['getLists'](_0x29672b);}})[_0x6566('0x25')](function(_0x3bf168){if(_0x3bf168){return _0x3bf168?{'count':_0x2deb27,'rows':_0x3bf168}:null;}})[_0x6566('0x25')](respondWithResult(_0x599a0b,null))[_0x6566('0x60')](handleError(_0x599a0b,null));};exports['getAgents']=function(_0x4cb182,_0x4bfccb,_0x306671){var _0x3e83f5={};var _0x4eb450={};var _0x2eb399;var _0x2f2b1c;return db['User'][_0x6566('0x93')]({'where':{'id':_0x4cb182['params']['id']}})['then'](handleEntityNotFound(_0x4bfccb,null))[_0x6566('0x25')](function(_0x32a8a7){if(_0x32a8a7){_0x2eb399=_0x32a8a7;_0x4eb450[_0x6566('0x4b')]=_[_0x6566('0x50')](db[_0x6566('0x47')]['rawAttributes']);_0x4eb450['query']=_['keys'](_0x4cb182['query']);_0x4eb450[_0x6566('0x51')]=_[_0x6566('0x52')](_0x4eb450[_0x6566('0x4b')],_0x4eb450['query']);_0x3e83f5[_0x6566('0x53')]=_[_0x6566('0x52')](_0x4eb450[_0x6566('0x4b')],qs[_0x6566('0x54')](_0x4cb182[_0x6566('0x4f')][_0x6566('0x54')]));_0x3e83f5[_0x6566('0x53')]=_0x3e83f5['attributes']['length']?_0x3e83f5['attributes']:_0x4eb450[_0x6566('0x4b')];_0x3e83f5[_0x6566('0x57')]=qs[_0x6566('0x58')](_0x4cb182['query']['sort']);_0x3e83f5['where']=qs[_0x6566('0x51')](_['pick'](_0x4cb182[_0x6566('0x4f')],_0x4eb450[_0x6566('0x51')]));if(_0x4cb182[_0x6566('0x4f')]['filter']){_0x3e83f5[_0x6566('0x59')]=_[_0x6566('0x65')](_0x3e83f5[_0x6566('0x59')],{'$or':_[_0x6566('0x40')](_0x3e83f5[_0x6566('0x53')],function(_0x5489f4){var _0x6e8edf={};_0x6e8edf[_0x5489f4]={'$like':'%'+_0x4cb182[_0x6566('0x4f')][_0x6566('0x3e')]+'%'};return _0x6e8edf;})});}_0x3e83f5[_0x6566('0x4b')]=db[_0x6566('0x47')];_0x3e83f5['as']='Agents';_0x3e83f5=_[_0x6566('0x65')]({},_0x3e83f5,_0x4cb182[_0x6566('0x66')]);return _0x2eb399[_0x6566('0xe6')]({'include':[_0x3e83f5]});}})['then'](function(_0x247079){if(_0x247079){var _0x237ab6={},_0x305090=[],_0x529d44=0x0;for(var _0x4bb24f=0x0;_0x4bb24f<_0x247079[_0x6566('0x63')];_0x4bb24f+=0x1){for(var _0x20bec9=0x0,_0xa15750;_0x20bec9<_0x247079[_0x4bb24f][_0x6566('0x3c')][_0x6566('0x63')];_0x20bec9+=0x1){_0xa15750=_0x247079[_0x4bb24f][_0x6566('0x3c')][_0x20bec9][_0x6566('0x3a')]({'plain':!![]});_0x237ab6[_0xa15750['id']]=_0xa15750;}}_0x237ab6=_[_0x6566('0x11a')](_0x237ab6);for(var _0x59b72f=qs[_0x6566('0x32')](_0x4cb182[_0x6566('0x4f')][_0x6566('0x32')]);_0x59b72f<_0x237ab6[_0x6566('0x63')]&&_0x305090[_0x6566('0x63')]=_0x337760[_0x44de('0x53')]){throw new Error(_0x44de('0x54'));}})['then'](function(){if(_0x3aa92d){return db[_0x44de('0x2c')][_0x44de('0x49')]({'where':{'membername':_0x3aa92d['name']},'individualHooks':!![]});}})['then'](function(){if(_0x3aa92d){return _0x3aa92d[_0x44de('0x55')]({'raw':!![]});}})[_0x44de('0xf')](function(_0x428430){if(_0x3aa92d){if(_0x428430){var _0x3c0ded=[];_0xa86591=_0x428430;if(_0xa86591[_0x44de('0x32')]){for(var _0x17dccc=0x0;_0x17dccc<_0xa86591[_0x44de('0x32')];_0x17dccc++){_0x3c0ded[_0x44de('0x35')](db[_0x44de('0x2c')]['upsert']({'membername':_0x3aa92d[_0x44de('0x28')],'UserId':_0x3aa92d['id'],'queue_name':_0xa86591[_0x17dccc][_0x44de('0x28')],'VoiceQueueId':_0xa86591[_0x17dccc]['id'],'interface':_0x4d5fa0,'paused':_0x3aa92d['loginInPause']||![],'penalty':_0xa86591[_0x17dccc][_0x44de('0x56')]||0x0}));}return BPromise[_0x44de('0x4a')](_0x3c0ded);}}}})[_0x44de('0xf')](function(){if(_0x3aa92d){return db['MemberReport'][_0x44de('0x1b')]({'where':{'membername':_0x3aa92d[_0x44de('0x28')],'exitAt':null}});}})[_0x44de('0xf')](function(_0x4f8096){if(_0x3aa92d){if(_0x4f8096&&_0x4f8096[_0x44de('0x32')]){var _0x19fe18=[];_0x4f8096['forEach'](function(_0x105b56){_0x19fe18[_0x44de('0x35')](_0x105b56[_0x44de('0x2d')]({'exitAt':moment()[_0x44de('0x30')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x44de('0x4a')](_0x19fe18);}}})[_0x44de('0xf')](function(_0x1ca058){if(_0x3aa92d){var _0x3b43c0=[];var _0x41e716=[];var _0x2d60c9=utils[_0x44de('0x34')]();var _0x2fa953={'membername':_0x3aa92d[_0x44de('0x28')],'interface':_0x4d5fa0,'enterAt':moment()[_0x44de('0x30')](_0x44de('0x31')),'role':_0x3aa92d[_0x44de('0x29')],'internal':_0x3aa92d[_0x44de('0x2a')]};_0x2d60c9[_0x44de('0x47')](function(_0x56adc5){_0x3b43c0[_0x44de('0x35')](_[_0x44de('0x57')]({'channel':_0x56adc5,'type':_0x44de('0x58'),'data1':_0x44de('0x59'),'data2':_0x4d5fa0},_0x2fa953));if(_0x3aa92d[_0x44de('0x4e')]){_0x41e716[_0x44de('0x35')](_[_0x44de('0x57')]({'channel':_0x56adc5,'type':'PAUSE','data1':'LOGININPAUSE'},_0x2fa953));}});return db['MemberReport'][_0x44de('0x39')](_0x3b43c0['concat'](_0x41e716),{'individualHooks':!![]});}})[_0x44de('0xf')](function(){if(_0x3aa92d){return _0x3aa92d[_0x44de('0x2d')]({'online':!![],'lastLoginAt':moment()[_0x44de('0x30')]('YYYY-MM-DD\x20HH:mm:ss'),'voicePause':_0x3aa92d['loginInPause']||![],'mailPause':_0x3aa92d[_0x44de('0x4e')]||![],'chatPause':_0x3aa92d[_0x44de('0x4e')]||![],'faxPause':_0x3aa92d[_0x44de('0x4e')]||![],'smsPause':_0x3aa92d[_0x44de('0x4e')]||![],'openchannelPause':_0x3aa92d[_0x44de('0x4e')]||![],'pauseType':_0x3aa92d[_0x44de('0x4e')]?_0x44de('0x5a'):null,'lastPauseAt':moment()[_0x44de('0x30')](_0x44de('0x31')),'interface':_0x4d5fa0});}})['then'](function(_0x4f6d46){_0x15e887(_0x4f6d46);})['catch'](function(_0x1cf0b7){_0x5da738(_0x3b33ea['error'](0x1f4,_0x1cf0b7[_0x44de('0x18')]));});});}; \ No newline at end of file +var _0xef17=['findOne','channel','isValidChannel','Unknown\x20channel','voice','UserVoiceQueueRt','system','mail','chat','fax','sms','openchannel','set','%s%s','Pause','push','all','LogoutUser','destroy','length','phone','loginInPause','SIP/%s','count','agent','../../config/license/util','getLicense','agents','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','concat','LOGININPAUSE','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./user.socket','register','request','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetUser','User','findAll','options','raw','attributes','limit','include','map','model','find','where','then','ShowUser','PauseUser','name','role','internal','interface','update','PAUSE','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','forEach','isNil','body','type','uniqueid','MemberReport','bulkCreate'];(function(_0x2d76a1,_0x132342){var _0x1e1f63=function(_0x3da57b){while(--_0x3da57b){_0x2d76a1['push'](_0x2d76a1['shift']());}};_0x1e1f63(++_0x132342);}(_0xef17,0x7f));var _0x7ef1=function(_0x305ad7,_0xa52eb4){_0x305ad7=_0x305ad7-0x0;var _0x39a334=_0xef17[_0x305ad7];return _0x39a334;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7ef1('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7ef1('0x1'));var db=require(_0x7ef1('0x2'))['db'];var utils=require(_0x7ef1('0x3'));var logger=require('../../config/logger')(_0x7ef1('0x4'));var config=require(_0x7ef1('0x5'));var jayson=require(_0x7ef1('0x6'));var client=jayson['client'][_0x7ef1('0x7')]({'port':0x232a});config[_0x7ef1('0x8')]=_[_0x7ef1('0x9')](config[_0x7ef1('0x8')],{'host':_0x7ef1('0xa'),'port':0x18eb});var socket=require(_0x7ef1('0xb'))(new Redis(config[_0x7ef1('0x8')]));require(_0x7ef1('0xc'))[_0x7ef1('0xd')](socket);function respondWithRpcPromise(_0x4c0225,_0x6f3b78,_0x4493f7){return new BPromise(function(_0x477dc4,_0x43ef61){return client[_0x7ef1('0xe')](_0x4c0225,_0x4493f7)['then'](function(_0x307995){logger[_0x7ef1('0xf')](_0x7ef1('0x10'),_0x6f3b78,_0x7ef1('0x11'));logger[_0x7ef1('0x12')](_0x7ef1('0x13'),_0x6f3b78,_0x7ef1('0x11'),JSON[_0x7ef1('0x14')](_0x307995));if(_0x307995['error']){if(_0x307995[_0x7ef1('0x15')][_0x7ef1('0x16')]===0x1f4){logger[_0x7ef1('0x15')](_0x7ef1('0x10'),_0x6f3b78,_0x307995[_0x7ef1('0x15')][_0x7ef1('0x17')]);return _0x43ef61(_0x307995['error']['message']);}logger[_0x7ef1('0x15')]('User,\x20%s,\x20%s',_0x6f3b78,_0x307995[_0x7ef1('0x15')][_0x7ef1('0x17')]);return _0x477dc4(_0x307995[_0x7ef1('0x15')][_0x7ef1('0x17')]);}else{logger[_0x7ef1('0xf')](_0x7ef1('0x10'),_0x6f3b78,_0x7ef1('0x11'));_0x477dc4(_0x307995['result'][_0x7ef1('0x17')]);}})[_0x7ef1('0x18')](function(_0xe22a0b){logger[_0x7ef1('0x15')]('User,\x20%s,\x20%s',_0x6f3b78,_0xe22a0b);_0x43ef61(_0xe22a0b);});});}exports[_0x7ef1('0x19')]=function(_0x194fcb){var _0x415e30=this;return new Promise(function(_0x447587,_0x15e38f){return db[_0x7ef1('0x1a')][_0x7ef1('0x1b')]({'raw':_0x194fcb[_0x7ef1('0x1c')]?_0x194fcb[_0x7ef1('0x1c')][_0x7ef1('0x1d')]===undefined?!![]:![]:!![],'where':_0x194fcb['options']?_0x194fcb['options']['where']||null:null,'attributes':_0x194fcb[_0x7ef1('0x1c')]?_0x194fcb[_0x7ef1('0x1c')][_0x7ef1('0x1e')]||null:null,'limit':_0x194fcb['options']?_0x194fcb[_0x7ef1('0x1c')][_0x7ef1('0x1f')]||null:null,'include':_0x194fcb[_0x7ef1('0x1c')]?_0x194fcb[_0x7ef1('0x1c')][_0x7ef1('0x20')]?_[_0x7ef1('0x21')](_0x194fcb[_0x7ef1('0x1c')][_0x7ef1('0x20')],function(_0x2d6e75){return{'model':db[_0x2d6e75[_0x7ef1('0x22')]],'as':_0x2d6e75['as'],'attributes':_0x2d6e75[_0x7ef1('0x1e')],'include':_0x2d6e75['include']?_['map'](_0x2d6e75[_0x7ef1('0x20')],function(_0x32a0e2){return{'model':db[_0x32a0e2[_0x7ef1('0x22')]],'as':_0x32a0e2['as'],'attributes':_0x32a0e2[_0x7ef1('0x1e')],'include':_0x32a0e2[_0x7ef1('0x20')]?_[_0x7ef1('0x21')](_0x32a0e2[_0x7ef1('0x20')],function(_0x55c7cf){return{'model':db[_0x55c7cf['model']],'as':_0x55c7cf['as'],'attributes':_0x55c7cf[_0x7ef1('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42b6b8){logger['info'](_0x7ef1('0x19'),_0x194fcb);logger['debug']('GetUser',_0x194fcb,JSON[_0x7ef1('0x14')](_0x42b6b8));_0x447587(_0x42b6b8);})['catch'](function(_0x2832b6){logger['error'](_0x7ef1('0x19'),_0x2832b6[_0x7ef1('0x17')],_0x194fcb);_0x15e38f(_0x415e30[_0x7ef1('0x15')](0x1f4,_0x2832b6[_0x7ef1('0x17')]));});});};exports['ShowUser']=function(_0x42d0d3){var _0x10de12=this;return new Promise(function(_0x8e0452,_0x2e654c){return db['User'][_0x7ef1('0x23')]({'raw':_0x42d0d3[_0x7ef1('0x1c')]?_0x42d0d3['options'][_0x7ef1('0x1d')]===undefined?!![]:![]:!![],'where':_0x42d0d3[_0x7ef1('0x1c')]?_0x42d0d3['options'][_0x7ef1('0x24')]||null:null,'attributes':_0x42d0d3[_0x7ef1('0x1c')]?_0x42d0d3[_0x7ef1('0x1c')][_0x7ef1('0x1e')]||null:null,'include':_0x42d0d3[_0x7ef1('0x1c')]?_0x42d0d3['options'][_0x7ef1('0x20')]?_[_0x7ef1('0x21')](_0x42d0d3[_0x7ef1('0x1c')][_0x7ef1('0x20')],function(_0x7e61f3){return{'model':db[_0x7e61f3[_0x7ef1('0x22')]],'as':_0x7e61f3['as'],'attributes':_0x7e61f3['attributes'],'include':_0x7e61f3[_0x7ef1('0x20')]?_[_0x7ef1('0x21')](_0x7e61f3['include'],function(_0x5aeabd){return{'model':db[_0x5aeabd[_0x7ef1('0x22')]],'as':_0x5aeabd['as'],'attributes':_0x5aeabd[_0x7ef1('0x1e')],'include':_0x5aeabd[_0x7ef1('0x20')]?_['map'](_0x5aeabd[_0x7ef1('0x20')],function(_0x20b5a4){return{'model':db[_0x20b5a4[_0x7ef1('0x22')]],'as':_0x20b5a4['as'],'attributes':_0x20b5a4[_0x7ef1('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x7ef1('0x25')](function(_0x166d39){logger[_0x7ef1('0xf')]('ShowUser',_0x42d0d3);logger[_0x7ef1('0x12')](_0x7ef1('0x26'),_0x42d0d3,JSON[_0x7ef1('0x14')](_0x166d39));_0x8e0452(_0x166d39);})['catch'](function(_0x5a497a){logger[_0x7ef1('0x15')](_0x7ef1('0x26'),_0x5a497a[_0x7ef1('0x17')],_0x42d0d3);_0x2e654c(_0x10de12[_0x7ef1('0x15')](0x1f4,_0x5a497a[_0x7ef1('0x17')]));});});};exports[_0x7ef1('0x27')]=function(_0x22cb60){var _0x2841f0=this;return new Promise(function(_0x35b4b5,_0x11ae16){var _0x456689;return db[_0x7ef1('0x1a')][_0x7ef1('0x23')]({'where':_0x22cb60[_0x7ef1('0x1c')][_0x7ef1('0x24')]||{},'attributes':['id',_0x7ef1('0x28'),_0x7ef1('0x29'),_0x7ef1('0x2a'),_0x7ef1('0x2b')]})[_0x7ef1('0x25')](function(_0x3070c2){if(_0x3070c2){_0x456689=_0x3070c2;return db['UserVoiceQueueRt'][_0x7ef1('0x2c')]({'paused':0x1},{'where':{'UserId':_0x456689['id']},'individualHooks':!![]});}})['then'](function(){if(_0x456689){return db['MemberReport'][_0x7ef1('0x1b')]({'where':{'membername':_0x456689[_0x7ef1('0x28')],'type':_0x7ef1('0x2d'),'exitAt':null}});}})[_0x7ef1('0x25')](function(_0xfcaae2){if(_0x456689){if(_0xfcaae2&&_0xfcaae2['length']){var _0x1f651a=moment()[_0x7ef1('0x2e')](_0x7ef1('0x2f'));for(var _0x2ddcbb=0x0,_0x578194=_0xfcaae2['length'];_0x2ddcbb<_0x578194;_0x2ddcbb++){_0xfcaae2[_0x2ddcbb][_0x7ef1('0x30')]({'exitAt':_0x1f651a});}}}})['then'](function(){if(_0x456689){var _0x2deab1=[];var _0x285692=utils[_0x7ef1('0x31')]();_0x285692[_0x7ef1('0x32')](function(_0x215790){_0x2deab1['push']({'channel':_0x215790,'membername':_0x456689[_0x7ef1('0x28')],'interface':_[_0x7ef1('0x33')](_0x456689['interface'])?util[_0x7ef1('0x2e')]('SIP/%s',_0x456689['name']):_0x456689['interface'],'type':_0x7ef1('0x2d'),'enterAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x22cb60[_0x7ef1('0x34')][_0x7ef1('0x35')]||'DEFAULT\x20PAUSE','role':_0x456689['role'],'internal':_0x456689[_0x7ef1('0x2a')],'uniqueid':_0x22cb60[_0x7ef1('0x34')][_0x7ef1('0x36')]||null});});return db[_0x7ef1('0x37')][_0x7ef1('0x38')](_0x2deab1,{'individualHooks':!![]});}})[_0x7ef1('0x25')](function(){if(_0x456689){return _0x456689[_0x7ef1('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x22cb60['body']['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()['format'](_0x7ef1('0x2f'))});}})[_0x7ef1('0x25')](function(_0x2722dd){_0x35b4b5(_0x2722dd);})['catch'](function(_0x2a17b4){_0x11ae16(_0x2841f0['error'](0x1f4,_0x2a17b4['message']));});});};exports['UnpauseUser']=function(_0x1309b3){var _0x4089dd=this;return new Promise(function(_0xd35ea9,_0x38ca4b){var _0x4172bb;return db[_0x7ef1('0x1a')][_0x7ef1('0x39')]({'where':_0x1309b3[_0x7ef1('0x1c')]['where']||{},'attributes':['id',_0x7ef1('0x28')]})[_0x7ef1('0x25')](function(_0x43c53e){if(_0x43c53e){_0x4172bb=_0x43c53e;if(_0x1309b3[_0x7ef1('0x34')][_0x7ef1('0x3a')]&&!utils[_0x7ef1('0x3b')](_0x1309b3[_0x7ef1('0x34')][_0x7ef1('0x3a')])){throw new Error(_0x7ef1('0x3c'));}switch(_0x1309b3[_0x7ef1('0x34')][_0x7ef1('0x3a')]){case _0x7ef1('0x3d'):return db[_0x7ef1('0x3e')][_0x7ef1('0x2c')]({'paused':0x0},{'where':{'UserId':_0x4172bb['id']}})['then'](function(){return db[_0x7ef1('0x37')]['find']({'where':{'channel':_0x1309b3[_0x7ef1('0x34')][_0x7ef1('0x3a')],'membername':_0x4172bb[_0x7ef1('0x28')],'type':_0x7ef1('0x2d'),'exitAt':null}});})[_0x7ef1('0x25')](function(_0x544176){if(_0x544176){return _0x544176[_0x7ef1('0x2c')]({'exitAt':moment()[_0x7ef1('0x2e')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x7ef1('0x3f')},{'individualHooks':!![]});}return null;})[_0x7ef1('0x25')](function(){return _0x4172bb[_0x7ef1('0x2c')]({'voicePause':![]});});case _0x7ef1('0x40'):case _0x7ef1('0x41'):case _0x7ef1('0x42'):case _0x7ef1('0x43'):case _0x7ef1('0x44'):return db[_0x7ef1('0x37')][_0x7ef1('0x23')]({'where':{'channel':_0x1309b3[_0x7ef1('0x34')]['channel'],'membername':_0x4172bb[_0x7ef1('0x28')],'type':_0x7ef1('0x2d'),'exitAt':null}})[_0x7ef1('0x25')](function(_0x84b5d6){return _0x84b5d6[_0x7ef1('0x2c')]({'exitAt':moment()['format'](_0x7ef1('0x2f')),'data2':'system'},{'individualHooks':!![]});})[_0x7ef1('0x25')](function(){var _0x47e87a={};_[_0x7ef1('0x45')](_0x47e87a,util[_0x7ef1('0x2e')](_0x7ef1('0x46'),_0x1309b3[_0x7ef1('0x34')][_0x7ef1('0x3a')],_0x7ef1('0x47')),![]);return _0x4172bb[_0x7ef1('0x2c')](_0x47e87a);});default:return db['UserVoiceQueueRt']['update']({'paused':0x0},{'where':{'UserId':_0x4172bb['id']}})[_0x7ef1('0x25')](function(){return db[_0x7ef1('0x37')][_0x7ef1('0x1b')]({'where':{'membername':_0x4172bb[_0x7ef1('0x28')],'type':'PAUSE','exitAt':null}});})[_0x7ef1('0x25')](function(_0x2de324){var _0x20245c=[];_0x2de324[_0x7ef1('0x32')](function(_0xb5d7a8){_0x20245c[_0x7ef1('0x48')](_0xb5d7a8[_0x7ef1('0x2c')]({'exitAt':moment()[_0x7ef1('0x2e')](_0x7ef1('0x2f')),'data2':_0x7ef1('0x3f')}));});return BPromise[_0x7ef1('0x49')](_0x20245c);})[_0x7ef1('0x25')](function(){return _0x4172bb[_0x7ef1('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x7ef1('0x25')](function(_0x42985a){_0xd35ea9(_0x42985a);})[_0x7ef1('0x18')](function(_0x11f835){_0x38ca4b(_0x4089dd[_0x7ef1('0x15')](0x1f4,_0x11f835[_0x7ef1('0x17')]));});});};exports[_0x7ef1('0x4a')]=function(_0x504af9){var _0x5e9f9e=this;return new Promise(function(_0x342c97,_0x5dcdec){var _0x546990;return db[_0x7ef1('0x1a')]['findOne']({'where':_0x504af9[_0x7ef1('0x1c')]['where']||{},'attributes':['id','name']})['then'](function(_0x191b85){if(_0x191b85){_0x546990=_0x191b85;return db['UserVoiceQueueRt'][_0x7ef1('0x4b')]({'where':{'membername':_0x546990[_0x7ef1('0x28')]},'individualHooks':!![]});}})[_0x7ef1('0x25')](function(){if(_0x546990){return db[_0x7ef1('0x37')][_0x7ef1('0x1b')]({'where':{'membername':_0x546990[_0x7ef1('0x28')],'exitAt':null}});}})[_0x7ef1('0x25')](function(_0x2bd967){if(_0x546990){if(_0x2bd967&&_0x2bd967[_0x7ef1('0x4c')]){var _0x363020=[];_0x2bd967[_0x7ef1('0x32')](function(_0x20ddb1){_0x363020[_0x7ef1('0x48')](_0x20ddb1[_0x7ef1('0x2c')]({'exitAt':moment()[_0x7ef1('0x2e')](_0x7ef1('0x2f'))}));});return BPromise[_0x7ef1('0x49')](_0x363020);}}})['then'](function(){if(_0x546990){return _0x546990[_0x7ef1('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x7ef1('0x25')](function(_0x4a0f3a){_0x342c97(_0x4a0f3a);})['catch'](function(_0x414938){_0x5dcdec(_0x5e9f9e[_0x7ef1('0x15')](0x1f4,_0x414938[_0x7ef1('0x17')]));});});};exports['LoginUser']=function(_0x3f4fbd){var _0x2a688a=this;return new Promise(function(_0x9578f2,_0x2e54cb){var _0x55a027;var _0x15fb12;var _0x3bb013;var _0x30dfdc;return db['User'][_0x7ef1('0x39')]({'where':_0x3f4fbd[_0x7ef1('0x1c')][_0x7ef1('0x24')]||{},'attributes':['id',_0x7ef1('0x28'),_0x7ef1('0x29'),'mobile',_0x7ef1('0x4d'),_0x7ef1('0x2a'),_0x7ef1('0x4e'),_0x7ef1('0x2b')]})[_0x7ef1('0x25')](function(_0x8bb648){if(_0x8bb648){_0x55a027=_0x8bb648;_0x30dfdc=_0x3f4fbd[_0x7ef1('0x34')][_0x7ef1('0x2b')]?_0x3f4fbd[_0x7ef1('0x34')][_0x7ef1('0x2b')]:util['format'](_0x7ef1('0x4f'),_0x55a027[_0x7ef1('0x28')]);return db[_0x7ef1('0x1a')][_0x7ef1('0x50')]({'where':{'role':_0x7ef1('0x51'),'online':!![],'id':{'$ne':_0x55a027['id']}}});}})[_0x7ef1('0x25')](function(_0x925cd1){if(_0x925cd1){_0x3bb013=_0x925cd1;return require(_0x7ef1('0x52'))[_0x7ef1('0x53')]();}})[_0x7ef1('0x25')](function(_0x2988fa){if(_0x2988fa&&_0x2988fa[_0x7ef1('0x54')]&&_0x3bb013>=_0x2988fa[_0x7ef1('0x54')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x7ef1('0x25')](function(){if(_0x55a027){return db[_0x7ef1('0x3e')]['destroy']({'where':{'membername':_0x55a027[_0x7ef1('0x28')]},'individualHooks':!![]});}})[_0x7ef1('0x25')](function(){if(_0x55a027){return _0x55a027['getVoiceQueues']({'raw':!![]});}})[_0x7ef1('0x25')](function(_0x245520){if(_0x55a027){if(_0x245520){var _0x1ab0b3=[];_0x15fb12=_0x245520;if(_0x15fb12['length']){for(var _0x57da1f=0x0;_0x57da1f<_0x15fb12[_0x7ef1('0x4c')];_0x57da1f++){_0x1ab0b3[_0x7ef1('0x48')](db[_0x7ef1('0x3e')][_0x7ef1('0x55')]({'membername':_0x55a027[_0x7ef1('0x28')],'UserId':_0x55a027['id'],'queue_name':_0x15fb12[_0x57da1f][_0x7ef1('0x28')],'VoiceQueueId':_0x15fb12[_0x57da1f]['id'],'interface':_0x30dfdc,'paused':_0x55a027[_0x7ef1('0x4e')]||![],'penalty':_0x15fb12[_0x57da1f][_0x7ef1('0x56')]||0x0}));}return BPromise['all'](_0x1ab0b3);}}}})[_0x7ef1('0x25')](function(){if(_0x55a027){return db['MemberReport'][_0x7ef1('0x1b')]({'where':{'membername':_0x55a027[_0x7ef1('0x28')],'exitAt':null}});}})[_0x7ef1('0x25')](function(_0xfd3345){if(_0x55a027){if(_0xfd3345&&_0xfd3345[_0x7ef1('0x4c')]){var _0x17182d=[];_0xfd3345[_0x7ef1('0x32')](function(_0x50d15f){_0x17182d['push'](_0x50d15f['update']({'exitAt':moment()[_0x7ef1('0x2e')](_0x7ef1('0x2f'))}));});return BPromise['all'](_0x17182d);}}})[_0x7ef1('0x25')](function(_0x4673f3){if(_0x55a027){var _0x2d2a29=[];var _0x56c535=[];var _0x1f36c7=utils[_0x7ef1('0x31')]();var _0x51ab7f={'membername':_0x55a027[_0x7ef1('0x28')],'interface':_0x30dfdc,'enterAt':moment()[_0x7ef1('0x2e')](_0x7ef1('0x2f')),'role':_0x55a027[_0x7ef1('0x29')],'internal':_0x55a027[_0x7ef1('0x2a')]};_0x1f36c7[_0x7ef1('0x32')](function(_0x1a343e){_0x2d2a29[_0x7ef1('0x48')](_[_0x7ef1('0x57')]({'channel':_0x1a343e,'type':_0x7ef1('0x58'),'data1':_0x7ef1('0x59'),'data2':_0x30dfdc},_0x51ab7f));if(_0x55a027[_0x7ef1('0x4e')]){_0x56c535[_0x7ef1('0x48')](_['merge']({'channel':_0x1a343e,'type':_0x7ef1('0x2d'),'data1':'LOGININPAUSE'},_0x51ab7f));}});return db[_0x7ef1('0x37')][_0x7ef1('0x38')](_0x2d2a29[_0x7ef1('0x5a')](_0x56c535),{'individualHooks':!![]});}})['then'](function(){if(_0x55a027){return _0x55a027[_0x7ef1('0x2c')]({'online':!![],'lastLoginAt':moment()[_0x7ef1('0x2e')](_0x7ef1('0x2f')),'voicePause':_0x55a027[_0x7ef1('0x4e')]||![],'mailPause':_0x55a027[_0x7ef1('0x4e')]||![],'chatPause':_0x55a027[_0x7ef1('0x4e')]||![],'faxPause':_0x55a027[_0x7ef1('0x4e')]||![],'smsPause':_0x55a027['loginInPause']||![],'openchannelPause':_0x55a027['loginInPause']||![],'pauseType':_0x55a027[_0x7ef1('0x4e')]?_0x7ef1('0x5b'):null,'lastPauseAt':moment()[_0x7ef1('0x2e')](_0x7ef1('0x2f')),'interface':_0x30dfdc});}})['then'](function(_0x2af7db){_0x9578f2(_0x2af7db);})[_0x7ef1('0x18')](function(_0xa8488d){_0x2e54cb(_0x2a688a[_0x7ef1('0x15')](0x1f4,_0xa8488d[_0x7ef1('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index cfe44f8..4b238db 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 _0xf08e=['remove','update','emit','removeListener','register','length','user:','./user.events','save'];(function(_0x1b2ff7,_0x12a034){var _0x31656a=function(_0x1165a5){while(--_0x1165a5){_0x1b2ff7['push'](_0x1b2ff7['shift']());}};_0x31656a(++_0x12a034);}(_0xf08e,0x16f));var _0xef08=function(_0x8956db,_0x565a5f){_0x8956db=_0x8956db-0x0;var _0x175a41=_0xf08e[_0x8956db];return _0x175a41;};'use strict';var UserEvents=require(_0xef08('0x0'));var events=[_0xef08('0x1'),_0xef08('0x2'),_0xef08('0x3')];function createListener(_0x54e55e,_0x468d1a){return function(_0x2627f4){_0x468d1a[_0xef08('0x4')](_0x54e55e,_0x2627f4);};}function removeListener(_0x4fb2f3,_0x5e66d8){return function(){UserEvents[_0xef08('0x5')](_0x4fb2f3,_0x5e66d8);};}exports[_0xef08('0x6')]=function(_0x5ddaa8){for(var _0x207d76=0x0,_0x24a812=events[_0xef08('0x7')];_0x207d76<_0x24a812;_0x207d76++){var _0x525385=events[_0x207d76];var _0x448520=createListener(_0xef08('0x8')+_0x525385,_0x5ddaa8);UserEvents['on'](_0x525385,_0x448520);}}; \ No newline at end of file +var _0xbee6=['update','emit','removeListener','register','length','user:','./user.events','remove'];(function(_0x1c238f,_0x36012b){var _0x344288=function(_0x59127f){while(--_0x59127f){_0x1c238f['push'](_0x1c238f['shift']());}};_0x344288(++_0x36012b);}(_0xbee6,0x6e));var _0x6bee=function(_0x539cc5,_0x59ab1e){_0x539cc5=_0x539cc5-0x0;var _0x3e55f9=_0xbee6[_0x539cc5];return _0x3e55f9;};'use strict';var UserEvents=require(_0x6bee('0x0'));var events=['save',_0x6bee('0x1'),_0x6bee('0x2')];function createListener(_0x25edc9,_0x58b4de){return function(_0x96f0ee){_0x58b4de[_0x6bee('0x3')](_0x25edc9,_0x96f0ee);};}function removeListener(_0x436b02,_0x2f9ae0){return function(){UserEvents[_0x6bee('0x4')](_0x436b02,_0x2f9ae0);};}exports[_0x6bee('0x5')]=function(_0x398ed7){for(var _0xed67c6=0x0,_0x31f8c5=events[_0x6bee('0x6')];_0xed67c6<_0x31f8c5;_0xed67c6++){var _0x1c8b1f=events[_0xed67c6];var _0xf38ba=createListener(_0x6bee('0x7')+_0x1c8b1f,_0x398ed7);UserEvents['on'](_0x1c8b1f,_0xf38ba);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index ab5d743..ab427b5 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 _0x87c6=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','util'];(function(_0x43b1be,_0x344104){var _0x1e5144=function(_0x111381){while(--_0x111381){_0x43b1be['push'](_0x43b1be['shift']());}};_0x1e5144(++_0x344104);}(_0x87c6,0x186));var _0x687c=function(_0x51ae2f,_0x313ea4){_0x51ae2f=_0x51ae2f-0x0;var _0x38fbd1=_0x87c6[_0x51ae2f];return _0x38fbd1;};'use strict';var multer=require(_0x687c('0x0'));var util=require(_0x687c('0x1'));var path=require('path');var timeout=require(_0x687c('0x2'));var express=require('express');var router=express[_0x687c('0x3')]();var auth=require(_0x687c('0x4'));var interaction=require(_0x687c('0x5'));var config=require(_0x687c('0x6'));module['exports']=router; \ No newline at end of file +var _0x9e80=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','express'];(function(_0x19c03a,_0x80316e){var _0x3c8eb1=function(_0x4d8695){while(--_0x4d8695){_0x19c03a['push'](_0x19c03a['shift']());}};_0x3c8eb1(++_0x80316e);}(_0x9e80,0xbc));var _0x09e8=function(_0x12aa90,_0x4d5b60){_0x12aa90=_0x12aa90-0x0;var _0x571902=_0x9e80[_0x12aa90];return _0x571902;};'use strict';var multer=require('multer');var util=require(_0x09e8('0x0'));var path=require(_0x09e8('0x1'));var timeout=require(_0x09e8('0x2'));var express=require(_0x09e8('0x3'));var router=express['Router']();var auth=require(_0x09e8('0x4'));var interaction=require(_0x09e8('0x5'));var config=require(_0x09e8('0x6'));module[_0x09e8('0x7')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 974e3a7..50faf71 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 _0xbaf0=['exports','INTEGER'];(function(_0x3e69ae,_0x366e8d){var _0x3d7f42=function(_0x5df093){while(--_0x5df093){_0x3e69ae['push'](_0x3e69ae['shift']());}};_0x3d7f42(++_0x366e8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x35108e,_0x18965c){var _0x4b315a=function(_0x4b2b85){while(--_0x4b2b85){_0x35108e['push'](_0x35108e['shift']());}};_0x4b315a(++_0x18965c);}(_0xe706,0xa3));var _0x6e70=function(_0xbf3f74,_0x1ae4bf){_0xbf3f74=_0xbf3f74-0x0;var _0xd26ead=_0xe706[_0xbf3f74];return _0xd26ead;};'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/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index 35df7ab..087f248 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 _0xe3c2=['exports','define','UserChatQueue','lodash','util','../../config/logger','moment','bluebird','path','rimraf','./userChatQueue.attributes'];(function(_0x2b90c6,_0x285707){var _0xc3018b=function(_0x32b174){while(--_0x32b174){_0x2b90c6['push'](_0x2b90c6['shift']());}};_0xc3018b(++_0x285707);}(_0xe3c2,0x19a));var _0x2e3c=function(_0x55e08b,_0x421620){_0x55e08b=_0x55e08b-0x0;var _0xd1a7ff=_0xe3c2[_0x55e08b];return _0xd1a7ff;};'use strict';var _=require(_0x2e3c('0x0'));var util=require(_0x2e3c('0x1'));var logger=require(_0x2e3c('0x2'))('api');var moment=require(_0x2e3c('0x3'));var BPromise=require(_0x2e3c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2e3c('0x5'));var rimraf=require(_0x2e3c('0x6'));var config=require('../../config/environment');var attributes=require(_0x2e3c('0x7'));module[_0x2e3c('0x8')]=function(_0xe8aa7,_0x52bc5c){return _0xe8aa7[_0x2e3c('0x9')](_0x2e3c('0xa'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb75e=['user_has_chat_queues','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xb75e,0x161));var _0xeb75=function(_0x23259a,_0x3c3acb){_0x23259a=_0x23259a-0x0;var _0x4eba38=_0xb75e[_0x23259a];return _0x4eba38;};'use strict';var _=require(_0xeb75('0x0'));var util=require(_0xeb75('0x1'));var logger=require(_0xeb75('0x2'))(_0xeb75('0x3'));var moment=require('moment');var BPromise=require(_0xeb75('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeb75('0x5'));var rimraf=require('rimraf');var config=require(_0xeb75('0x6'));var attributes=require(_0xeb75('0x7'));module[_0xeb75('0x8')]=function(_0x1b30a8,_0x51f626){return _0x1b30a8['define'](_0xeb75('0x9'),attributes,{'tableName':_0xeb75('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 52653e9..5b31ef8 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 _0xe994=['jayson/promise','client','http','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent','error','message','catch','lodash','util','randomstring','ioredis','../../config/logger'];(function(_0x587675,_0x2489b7){var _0x3232f7=function(_0x2579ac){while(--_0x2579ac){_0x587675['push'](_0x587675['shift']());}};_0x3232f7(++_0x2489b7);}(_0xe994,0x1db));var _0x4e99=function(_0x26aaaf,_0x4e8f2a){_0x26aaaf=_0x26aaaf-0x0;var _0x24e1a8=_0xe994[_0x26aaaf];return _0x24e1a8;};'use strict';var _=require(_0x4e99('0x0'));var util=require(_0x4e99('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x4e99('0x2'));var fs=require('fs');var Redis=require(_0x4e99('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4e99('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4e99('0x5'));var client=jayson[_0x4e99('0x6')][_0x4e99('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48768d,_0x112cf4,_0x5b0644){return new BPromise(function(_0x8c7fb8,_0x3263a4){return client['request'](_0x48768d,_0x5b0644)[_0x4e99('0x8')](function(_0x14e154){logger[_0x4e99('0x9')](_0x4e99('0xa'),_0x112cf4,'request\x20sent');logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x112cf4,_0x4e99('0xb'),JSON['stringify'](_0x14e154));if(_0x14e154[_0x4e99('0xc')]){if(_0x14e154[_0x4e99('0xc')]['code']===0x1f4){logger['error'](_0x4e99('0xa'),_0x112cf4,_0x14e154[_0x4e99('0xc')][_0x4e99('0xd')]);return _0x3263a4(_0x14e154[_0x4e99('0xc')][_0x4e99('0xd')]);}logger[_0x4e99('0xc')](_0x4e99('0xa'),_0x112cf4,_0x14e154[_0x4e99('0xc')]['message']);return _0x8c7fb8(_0x14e154[_0x4e99('0xc')]['message']);}else{logger[_0x4e99('0x9')]('UserChatQueue,\x20%s,\x20%s',_0x112cf4,_0x4e99('0xb'));_0x8c7fb8(_0x14e154['result']['message']);}})[_0x4e99('0xe')](function(_0x218206){logger[_0x4e99('0xc')](_0x4e99('0xa'),_0x112cf4,_0x218206);_0x3263a4(_0x218206);});});} \ No newline at end of file +var _0xa132=['UserChatQueue,\x20%s,\x20%s,\x20%s','stringify','code','error','message','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserChatQueue,\x20%s,\x20%s','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa132,0x159));var _0x2a13=function(_0x54d74b,_0x7319f9){_0x54d74b=_0x54d74b-0x0;var _0x383749=_0xa132[_0x54d74b];return _0x383749;};'use strict';var _=require(_0x2a13('0x0'));var util=require(_0x2a13('0x1'));var moment=require('moment');var BPromise=require(_0x2a13('0x2'));var rs=require(_0x2a13('0x3'));var fs=require('fs');var Redis=require(_0x2a13('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a13('0x5'));var logger=require(_0x2a13('0x6'))(_0x2a13('0x7'));var config=require(_0x2a13('0x8'));var jayson=require(_0x2a13('0x9'));var client=jayson[_0x2a13('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4b1802,_0x4bc1cd,_0x290936){return new BPromise(function(_0x16c79e,_0x3190fa){return client['request'](_0x4b1802,_0x290936)[_0x2a13('0xb')](function(_0x34850f){logger[_0x2a13('0xc')](_0x2a13('0xd'),_0x4bc1cd,_0x2a13('0xe'));logger['debug'](_0x2a13('0xf'),_0x4bc1cd,_0x2a13('0xe'),JSON[_0x2a13('0x10')](_0x34850f));if(_0x34850f['error']){if(_0x34850f['error'][_0x2a13('0x11')]===0x1f4){logger[_0x2a13('0x12')](_0x2a13('0xd'),_0x4bc1cd,_0x34850f['error'][_0x2a13('0x13')]);return _0x3190fa(_0x34850f[_0x2a13('0x12')][_0x2a13('0x13')]);}logger['error'](_0x2a13('0xd'),_0x4bc1cd,_0x34850f[_0x2a13('0x12')]['message']);return _0x16c79e(_0x34850f[_0x2a13('0x12')][_0x2a13('0x13')]);}else{logger['info'](_0x2a13('0xd'),_0x4bc1cd,_0x2a13('0xe'));_0x16c79e(_0x34850f['result'][_0x2a13('0x13')]);}})['catch'](function(_0x2fa756){logger[_0x2a13('0x12')](_0x2a13('0xd'),_0x4bc1cd,_0x2fa756);_0x3190fa(_0x2fa756);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index b65182e..69be217 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 _0x262d=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x4b7f1c,_0x589955){var _0x518a7c=function(_0x17f93d){while(--_0x17f93d){_0x4b7f1c['push'](_0x4b7f1c['shift']());}};_0x518a7c(++_0x589955);}(_0x262d,0x14c));var _0xd262=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x262d[_0x5c351c];return _0x26f3b3;};'use strict';var multer=require(_0xd262('0x0'));var util=require(_0xd262('0x1'));var path=require(_0xd262('0x2'));var timeout=require(_0xd262('0x3'));var express=require(_0xd262('0x4'));var router=express['Router']();var auth=require(_0xd262('0x5'));var interaction=require(_0xd262('0x6'));var config=require(_0xd262('0x7'));module[_0xd262('0x8')]=router; \ No newline at end of file +var _0xace2=['util','path','connect-timeout','express','Router','../../config/environment','exports','multer'];(function(_0x50bee7,_0x60c9e){var _0x2c60f9=function(_0x394ff2){while(--_0x394ff2){_0x50bee7['push'](_0x50bee7['shift']());}};_0x2c60f9(++_0x60c9e);}(_0xace2,0x67));var _0x2ace=function(_0x47e7cb,_0x4c1b8d){_0x47e7cb=_0x47e7cb-0x0;var _0x2a8874=_0xace2[_0x47e7cb];return _0x2a8874;};'use strict';var multer=require(_0x2ace('0x0'));var util=require(_0x2ace('0x1'));var path=require(_0x2ace('0x2'));var timeout=require(_0x2ace('0x3'));var express=require(_0x2ace('0x4'));var router=express[_0x2ace('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2ace('0x6'));module[_0x2ace('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 c7bbe99..d04454d 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 _0xd4a2=['INTEGER','sequelize'];(function(_0x24a3e5,_0x129025){var _0x4d5b33=function(_0x437f8a){while(--_0x437f8a){_0x24a3e5['push'](_0x24a3e5['shift']());}};_0x4d5b33(++_0x129025);}(_0xd4a2,0x173));var _0x2d4a=function(_0x4c68e6,_0x25e308){_0x4c68e6=_0x4c68e6-0x0;var _0x233b87=_0xd4a2[_0x4c68e6];return _0x233b87;};'use strict';var Sequelize=require(_0x2d4a('0x0'));module['exports']={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x2d4a('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x9ffd=['INTEGER','STRING','sequelize','exports'];(function(_0x49ca18,_0x5e6d05){var _0x145d54=function(_0x30b9be){while(--_0x30b9be){_0x49ca18['push'](_0x49ca18['shift']());}};_0x145d54(++_0x5e6d05);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x384802,_0x31f7f5){_0x384802=_0x384802-0x0;var _0x4eabe4=_0x9ffd[_0x384802];return _0x4eabe4;};'use strict';var Sequelize=require(_0xd9ff('0x0'));module[_0xd9ff('0x1')]={'penalty':{'type':Sequelize[_0xd9ff('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'queue':{'type':Sequelize[_0xd9ff('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 7cb5bbd..7bd926c 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 _0x1049=['rimraf','../../config/environment','UserFaxQueue','user_has_fax_queues','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x19f031,_0x23c714){var _0x513fdf=function(_0x310e0e){while(--_0x310e0e){_0x19f031['push'](_0x19f031['shift']());}};_0x513fdf(++_0x23c714);}(_0x1049,0xe5));var _0x9104=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1049[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9104('0x0'));var util=require('util');var logger=require(_0x9104('0x1'))('api');var moment=require(_0x9104('0x2'));var BPromise=require(_0x9104('0x3'));var rp=require(_0x9104('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9104('0x5'));var config=require(_0x9104('0x6'));var attributes=require('./userFaxQueue.attributes');module['exports']=function(_0x3c3d25,_0x5324b8){return _0x3c3d25['define'](_0x9104('0x7'),attributes,{'tableName':_0x9104('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa600=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','UserFaxQueue','lodash','util'];(function(_0x451ed1,_0xbf44b0){var _0xbd5ada=function(_0x16723f){while(--_0x16723f){_0x451ed1['push'](_0x451ed1['shift']());}};_0xbd5ada(++_0xbf44b0);}(_0xa600,0xa6));var _0x0a60=function(_0x7185f7,_0x37065){_0x7185f7=_0x7185f7-0x0;var _0x182e45=_0xa600[_0x7185f7];return _0x182e45;};'use strict';var _=require(_0x0a60('0x0'));var util=require(_0x0a60('0x1'));var logger=require(_0x0a60('0x2'))(_0x0a60('0x3'));var moment=require(_0x0a60('0x4'));var BPromise=require(_0x0a60('0x5'));var rp=require(_0x0a60('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0a60('0x7'));var config=require(_0x0a60('0x8'));var attributes=require('./userFaxQueue.attributes');module[_0x0a60('0x9')]=function(_0x567613,_0x4109c5){return _0x567613[_0x0a60('0xa')](_0x0a60('0xb'),attributes,{'tableName':'user_has_fax_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.rpc.js b/server/api/userFaxQueue/userFaxQueue.rpc.js index 0f85107..40ac505 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 _0x2faf=['../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','UserFaxQueue,\x20%s,\x20%s','message','result','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x6186a8,_0x5385c4){var _0xf72248=function(_0x2cc46a){while(--_0x2cc46a){_0x6186a8['push'](_0x6186a8['shift']());}};_0xf72248(++_0x5385c4);}(_0x2faf,0xb0));var _0xf2fa=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2faf[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xf2fa('0x0'));var util=require(_0xf2fa('0x1'));var moment=require(_0xf2fa('0x2'));var BPromise=require('bluebird');var rs=require(_0xf2fa('0x3'));var fs=require('fs');var Redis=require(_0xf2fa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf2fa('0x5'));var logger=require(_0xf2fa('0x6'))(_0xf2fa('0x7'));var config=require(_0xf2fa('0x8'));var jayson=require(_0xf2fa('0x9'));var client=jayson[_0xf2fa('0xa')][_0xf2fa('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c7035,_0x2fcd02,_0x3287ac){return new BPromise(function(_0x28ca24,_0x19ce5a){return client['request'](_0x4c7035,_0x3287ac)[_0xf2fa('0xc')](function(_0x530819){logger[_0xf2fa('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x2fcd02,_0xf2fa('0xe'));logger[_0xf2fa('0xf')](_0xf2fa('0x10'),_0x2fcd02,_0xf2fa('0xe'),JSON[_0xf2fa('0x11')](_0x530819));if(_0x530819[_0xf2fa('0x12')]){if(_0x530819[_0xf2fa('0x12')][_0xf2fa('0x13')]===0x1f4){logger[_0xf2fa('0x12')](_0xf2fa('0x14'),_0x2fcd02,_0x530819['error'][_0xf2fa('0x15')]);return _0x19ce5a(_0x530819[_0xf2fa('0x12')][_0xf2fa('0x15')]);}logger[_0xf2fa('0x12')](_0xf2fa('0x14'),_0x2fcd02,_0x530819[_0xf2fa('0x12')][_0xf2fa('0x15')]);return _0x28ca24(_0x530819[_0xf2fa('0x12')]['message']);}else{logger[_0xf2fa('0xd')]('UserFaxQueue,\x20%s,\x20%s',_0x2fcd02,_0xf2fa('0xe'));_0x28ca24(_0x530819[_0xf2fa('0x16')]['message']);}})['catch'](function(_0x1db062){logger[_0xf2fa('0x12')](_0xf2fa('0x14'),_0x2fcd02,_0x1db062);_0x19ce5a(_0x1db062);});});} \ No newline at end of file +var _0x660e=['UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','UserFaxQueue,\x20%s,\x20%s','debug'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x660e,0xf7));var _0xe660=function(_0x165271,_0x329a13){_0x165271=_0x165271-0x0;var _0x10e333=_0x660e[_0x165271];return _0x10e333;};'use strict';var _=require(_0xe660('0x0'));var util=require('util');var moment=require(_0xe660('0x1'));var BPromise=require('bluebird');var rs=require(_0xe660('0x2'));var fs=require('fs');var Redis=require(_0xe660('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe660('0x4'))('rpc');var config=require(_0xe660('0x5'));var jayson=require(_0xe660('0x6'));var client=jayson[_0xe660('0x7')][_0xe660('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2bfbe0,_0x2d3870,_0x5832d4){return new BPromise(function(_0x24ac7e,_0xe99c94){return client['request'](_0x2bfbe0,_0x5832d4)[_0xe660('0x9')](function(_0x26378e){logger[_0xe660('0xa')](_0xe660('0xb'),_0x2d3870,'request\x20sent');logger[_0xe660('0xc')](_0xe660('0xd'),_0x2d3870,_0xe660('0xe'),JSON[_0xe660('0xf')](_0x26378e));if(_0x26378e[_0xe660('0x10')]){if(_0x26378e[_0xe660('0x10')][_0xe660('0x11')]===0x1f4){logger[_0xe660('0x10')](_0xe660('0xb'),_0x2d3870,_0x26378e[_0xe660('0x10')][_0xe660('0x12')]);return _0xe99c94(_0x26378e[_0xe660('0x10')][_0xe660('0x12')]);}logger[_0xe660('0x10')](_0xe660('0xb'),_0x2d3870,_0x26378e[_0xe660('0x10')][_0xe660('0x12')]);return _0x24ac7e(_0x26378e[_0xe660('0x10')][_0xe660('0x12')]);}else{logger['info'](_0xe660('0xb'),_0x2d3870,_0xe660('0xe'));_0x24ac7e(_0x26378e['result'][_0xe660('0x12')]);}})[_0xe660('0x13')](function(_0x2b7cbc){logger[_0xe660('0x10')](_0xe660('0xb'),_0x2d3870,_0x2b7cbc);_0xe99c94(_0x2b7cbc);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 7171074..3c84553 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 _0x14b0=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','path'];(function(_0x261c43,_0x6731e2){var _0x5f3cb5=function(_0x167819){while(--_0x167819){_0x261c43['push'](_0x261c43['shift']());}};_0x5f3cb5(++_0x6731e2);}(_0x14b0,0x75));var _0x014b=function(_0x2368e9,_0x11bb86){_0x2368e9=_0x2368e9-0x0;var _0x3edf32=_0x14b0[_0x2368e9];return _0x3edf32;};'use strict';var multer=require(_0x014b('0x0'));var util=require('util');var path=require(_0x014b('0x1'));var timeout=require(_0x014b('0x2'));var express=require(_0x014b('0x3'));var router=express['Router']();var auth=require(_0x014b('0x4'));var interaction=require(_0x014b('0x5'));var config=require(_0x014b('0x6'));module['exports']=router; \ No newline at end of file +var _0x04ed=['util','../../components/interaction/service','../../config/environment','multer'];(function(_0x1fc01a,_0x59d5b5){var _0x2fc793=function(_0x4b71cf){while(--_0x4b71cf){_0x1fc01a['push'](_0x1fc01a['shift']());}};_0x2fc793(++_0x59d5b5);}(_0x04ed,0x9f));var _0xd04e=function(_0x3a9427,_0x27078f){_0x3a9427=_0x3a9427-0x0;var _0x2f8840=_0x04ed[_0x3a9427];return _0x2f8840;};'use strict';var multer=require(_0xd04e('0x0'));var util=require(_0xd04e('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd04e('0x2'));var config=require(_0xd04e('0x3'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 24fa443..877b311 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(_0x6a6813,_0x3f7639){var _0x15875a=function(_0x5af021){while(--_0x5af021){_0x6a6813['push'](_0x6a6813['shift']());}};_0x15875a(++_0x3f7639);}(_0xe706,0xa3));var _0x6e70=function(_0x47d12e,_0x2d0ada){_0x47d12e=_0x47d12e-0x0;var _0x1250dc=_0xe706[_0x47d12e];return _0x1250dc;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x5691f9,_0x4d4a1b){var _0x7cef8d=function(_0x230cfa){while(--_0x230cfa){_0x5691f9['push'](_0x5691f9['shift']());}};_0x7cef8d(++_0x4d4a1b);}(_0xe706,0xa3));var _0x6e70=function(_0x26d6d9,_0x431cb8){_0x26d6d9=_0x26d6d9-0x0;var _0x1b4875=_0xe706[_0x26d6d9];return _0x1b4875;};'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/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index 5049377..6b115d0 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 _0x757a=['define','user_has_mail_queues','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./userMailQueue.attributes','exports'];(function(_0x5bba11,_0xe514ce){var _0xfb4bb1=function(_0x26e319){while(--_0x26e319){_0x5bba11['push'](_0x5bba11['shift']());}};_0xfb4bb1(++_0xe514ce);}(_0x757a,0xde));var _0xa757=function(_0xbda3cf,_0x471fbf){_0xbda3cf=_0xbda3cf-0x0;var _0x59d35d=_0x757a[_0xbda3cf];return _0x59d35d;};'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')]('UserMailQueue',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0713=['moment','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue','user_has_mail_queues','../../config/logger','api'];(function(_0x366712,_0xe45c38){var _0x30fbf3=function(_0x5b99b0){while(--_0x5b99b0){_0x366712['push'](_0x366712['shift']());}};_0x30fbf3(++_0xe45c38);}(_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 diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index b2a618f..f1f907a 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 _0x90b1=['message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x1e9284,_0x44b149){var _0x41204b=function(_0x289977){while(--_0x289977){_0x1e9284['push'](_0x1e9284['shift']());}};_0x41204b(++_0x44b149);}(_0x90b1,0x1bb));var _0x190b=function(_0x3e7c3c,_0x2f7123){_0x3e7c3c=_0x3e7c3c-0x0;var _0x29b128=_0x90b1[_0x3e7c3c];return _0x29b128;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('UserMailQueue,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});} \ No newline at end of file +var _0xa428=['info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','UserMailQueue,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xac9e9d,_0x768827){var _0x13a727=function(_0x21274c){while(--_0x21274c){_0xac9e9d['push'](_0xac9e9d['shift']());}};_0x13a727(++_0x768827);}(_0xa428,0xd8));var _0x8a42=function(_0x15ec43,_0x52d947){_0x15ec43=_0x15ec43-0x0;var _0x18aafc=_0xa428[_0x15ec43];return _0x18aafc;};'use strict';var _=require(_0x8a42('0x0'));var util=require('util');var moment=require(_0x8a42('0x1'));var BPromise=require(_0x8a42('0x2'));var rs=require(_0x8a42('0x3'));var fs=require('fs');var Redis=require(_0x8a42('0x4'));var db=require(_0x8a42('0x5'))['db'];var utils=require(_0x8a42('0x6'));var logger=require(_0x8a42('0x7'))('rpc');var config=require(_0x8a42('0x8'));var jayson=require(_0x8a42('0x9'));var client=jayson[_0x8a42('0xa')][_0x8a42('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4d4aba,_0x18004b,_0x454367){return new BPromise(function(_0x56d507,_0x2c3ee4){return client[_0x8a42('0xc')](_0x4d4aba,_0x454367)[_0x8a42('0xd')](function(_0x3fcfa9){logger[_0x8a42('0xe')](_0x8a42('0xf'),_0x18004b,_0x8a42('0x10'));logger[_0x8a42('0x11')](_0x8a42('0x12'),_0x18004b,_0x8a42('0x10'),JSON['stringify'](_0x3fcfa9));if(_0x3fcfa9[_0x8a42('0x13')]){if(_0x3fcfa9[_0x8a42('0x13')][_0x8a42('0x14')]===0x1f4){logger['error'](_0x8a42('0xf'),_0x18004b,_0x3fcfa9['error']['message']);return _0x2c3ee4(_0x3fcfa9[_0x8a42('0x13')][_0x8a42('0x15')]);}logger[_0x8a42('0x13')](_0x8a42('0xf'),_0x18004b,_0x3fcfa9[_0x8a42('0x13')]['message']);return _0x56d507(_0x3fcfa9[_0x8a42('0x13')]['message']);}else{logger[_0x8a42('0xe')](_0x8a42('0xf'),_0x18004b,_0x8a42('0x10'));_0x56d507(_0x3fcfa9['result'][_0x8a42('0x15')]);}})[_0x8a42('0x16')](function(_0x2fee04){logger[_0x8a42('0x13')]('UserMailQueue,\x20%s,\x20%s',_0x18004b,_0x2fee04);_0x2c3ee4(_0x2fee04);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index b77e5a6..294f425 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 _0x8bc0=['../../components/auth/service','../../config/environment','exports','multer','path','express','Router'];(function(_0x2c4454,_0x102e39){var _0x4a38c9=function(_0x2523ce){while(--_0x2523ce){_0x2c4454['push'](_0x2c4454['shift']());}};_0x4a38c9(++_0x102e39);}(_0x8bc0,0x88));var _0x08bc=function(_0x983840,_0x1e96da){_0x983840=_0x983840-0x0;var _0x9d0132=_0x8bc0[_0x983840];return _0x9d0132;};'use strict';var multer=require(_0x08bc('0x0'));var util=require('util');var path=require(_0x08bc('0x1'));var timeout=require('connect-timeout');var express=require(_0x08bc('0x2'));var router=express[_0x08bc('0x3')]();var auth=require(_0x08bc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x08bc('0x5'));module[_0x08bc('0x6')]=router; \ No newline at end of file +var _0x9591=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0x9591,0xa6));var _0x1959=function(_0x1bd6b2,_0x4a3963){_0x1bd6b2=_0x1bd6b2-0x0;var _0x5832c5=_0x9591[_0x1bd6b2];return _0x5832c5;};'use strict';var multer=require(_0x1959('0x0'));var util=require(_0x1959('0x1'));var path=require(_0x1959('0x2'));var timeout=require(_0x1959('0x3'));var express=require(_0x1959('0x4'));var router=express[_0x1959('0x5')]();var auth=require(_0x1959('0x6'));var interaction=require(_0x1959('0x7'));var config=require(_0x1959('0x8'));module[_0x1959('0x9')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index f853063..0ca6b6b 100644 --- a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js +++ b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['exports','INTEGER'];(function(_0x149083,_0x4047b6){var _0x4dc74e=function(_0x1211f9){while(--_0x1211f9){_0x149083['push'](_0x149083['shift']());}};_0x4dc74e(++_0x4047b6);}(_0xbaf0,0x12a));var _0x0baf=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0xbaf0[_0x465028];return _0xb783d4;};'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(_0x4715d2,_0x3371b2){var _0x141811=function(_0x520bc6){while(--_0x520bc6){_0x4715d2['push'](_0x4715d2['shift']());}};_0x141811(++_0x3371b2);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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/userOpenchannelQueue/userOpenchannelQueue.model.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.model.js index 4f58577..8d1bf59 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 _0x9156=['request-promise','rimraf','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','moment','bluebird'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9156,0x19e));var _0x6915=function(_0x33a7a3,_0x4b8167){_0x33a7a3=_0x33a7a3-0x0;var _0x58f58e=_0x9156[_0x33a7a3];return _0x58f58e;};'use strict';var _=require(_0x6915('0x0'));var util=require(_0x6915('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6915('0x2'));var BPromise=require(_0x6915('0x3'));var rp=require(_0x6915('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6915('0x5'));var config=require('../../config/environment');var attributes=require(_0x6915('0x6'));module[_0x6915('0x7')]=function(_0x373e08,_0x3f591c){return _0x373e08[_0x6915('0x8')](_0x6915('0x9'),attributes,{'tableName':_0x6915('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x20c4=['api','moment','request-promise','path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','util'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x20c4,0xcb));var _0x420c=function(_0x2f9f3b,_0x2280ef){_0x2f9f3b=_0x2f9f3b-0x0;var _0x483eb6=_0x20c4[_0x2f9f3b];return _0x483eb6;};'use strict';var _=require('lodash');var util=require(_0x420c('0x0'));var logger=require('../../config/logger')(_0x420c('0x1'));var moment=require(_0x420c('0x2'));var BPromise=require('bluebird');var rp=require(_0x420c('0x3'));var fs=require('fs');var path=require(_0x420c('0x4'));var rimraf=require(_0x420c('0x5'));var config=require(_0x420c('0x6'));var attributes=require(_0x420c('0x7'));module[_0x420c('0x8')]=function(_0x55937a,_0x110593){return _0x55937a[_0x420c('0x9')](_0x420c('0xa'),attributes,{'tableName':_0x420c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.rpc.js index c6e2f7d..76a8e4f 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 _0x1a46=['error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x38e9f7,_0x1f00e9){var _0x359db1=function(_0x4e6320){while(--_0x4e6320){_0x38e9f7['push'](_0x38e9f7['shift']());}};_0x359db1(++_0x1f00e9);}(_0x1a46,0x7c));var _0x61a4=function(_0x18b526,_0x5462b7){_0x18b526=_0x18b526-0x0;var _0x33667=_0x1a46[_0x18b526];return _0x33667;};'use strict';var _=require(_0x61a4('0x0'));var util=require(_0x61a4('0x1'));var moment=require('moment');var BPromise=require(_0x61a4('0x2'));var rs=require(_0x61a4('0x3'));var fs=require('fs');var Redis=require(_0x61a4('0x4'));var db=require(_0x61a4('0x5'))['db'];var utils=require(_0x61a4('0x6'));var logger=require('../../config/logger')(_0x61a4('0x7'));var config=require(_0x61a4('0x8'));var jayson=require(_0x61a4('0x9'));var client=jayson[_0x61a4('0xa')][_0x61a4('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4622c7,_0x3f057d,_0xa9389){return new BPromise(function(_0x561cba,_0x45e75f){return client[_0x61a4('0xc')](_0x4622c7,_0xa9389)[_0x61a4('0xd')](function(_0x5c9c7f){logger[_0x61a4('0xe')](_0x61a4('0xf'),_0x3f057d,_0x61a4('0x10'));logger[_0x61a4('0x11')](_0x61a4('0x12'),_0x3f057d,_0x61a4('0x10'),JSON[_0x61a4('0x13')](_0x5c9c7f));if(_0x5c9c7f[_0x61a4('0x14')]){if(_0x5c9c7f['error']['code']===0x1f4){logger[_0x61a4('0x14')](_0x61a4('0xf'),_0x3f057d,_0x5c9c7f[_0x61a4('0x14')]['message']);return _0x45e75f(_0x5c9c7f['error']['message']);}logger[_0x61a4('0x14')](_0x61a4('0xf'),_0x3f057d,_0x5c9c7f[_0x61a4('0x14')][_0x61a4('0x15')]);return _0x561cba(_0x5c9c7f['error']['message']);}else{logger[_0x61a4('0xe')](_0x61a4('0xf'),_0x3f057d,_0x61a4('0x10'));_0x561cba(_0x5c9c7f[_0x61a4('0x16')][_0x61a4('0x15')]);}})[_0x61a4('0x17')](function(_0x17569){logger[_0x61a4('0x14')](_0x61a4('0xf'),_0x3f057d,_0x17569);_0x45e75f(_0x17569);});});} \ No newline at end of file +var _0x8ceb=['info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4ded16,_0x23fcbf){var _0x4a525a=function(_0x2c6b5e){while(--_0x2c6b5e){_0x4ded16['push'](_0x4ded16['shift']());}};_0x4a525a(++_0x23fcbf);}(_0x8ceb,0x1d7));var _0xb8ce=function(_0x50ec17,_0x14d3ae){_0x50ec17=_0x50ec17-0x0;var _0x4c2dbd=_0x8ceb[_0x50ec17];return _0x4c2dbd;};'use strict';var _=require('lodash');var util=require(_0xb8ce('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb8ce('0x1'));var fs=require('fs');var Redis=require(_0xb8ce('0x2'));var db=require(_0xb8ce('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xb8ce('0x4'))(_0xb8ce('0x5'));var config=require(_0xb8ce('0x6'));var jayson=require(_0xb8ce('0x7'));var client=jayson[_0xb8ce('0x8')][_0xb8ce('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2d8e8a,_0x1f81c0,_0x1b7403){return new BPromise(function(_0x335bad,_0x56d935){return client[_0xb8ce('0xa')](_0x2d8e8a,_0x1b7403)[_0xb8ce('0xb')](function(_0x218824){logger[_0xb8ce('0xc')](_0xb8ce('0xd'),_0x1f81c0,_0xb8ce('0xe'));logger['debug']('UserOpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x1f81c0,_0xb8ce('0xe'),JSON[_0xb8ce('0xf')](_0x218824));if(_0x218824[_0xb8ce('0x10')]){if(_0x218824[_0xb8ce('0x10')][_0xb8ce('0x11')]===0x1f4){logger[_0xb8ce('0x10')](_0xb8ce('0xd'),_0x1f81c0,_0x218824['error'][_0xb8ce('0x12')]);return _0x56d935(_0x218824[_0xb8ce('0x10')]['message']);}logger[_0xb8ce('0x10')](_0xb8ce('0xd'),_0x1f81c0,_0x218824['error']['message']);return _0x335bad(_0x218824[_0xb8ce('0x10')][_0xb8ce('0x12')]);}else{logger['info']('UserOpenchannelQueue,\x20%s,\x20%s',_0x1f81c0,_0xb8ce('0xe'));_0x335bad(_0x218824[_0xb8ce('0x13')]['message']);}})[_0xb8ce('0x14')](function(_0x1d4f8a){logger[_0xb8ce('0x10')](_0xb8ce('0xd'),_0x1f81c0,_0x1d4f8a);_0x56d935(_0x1d4f8a);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index b23b362..958e7be 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 _0x4581=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/sections','getSections','getResources','post','create','/:id/clone','/:id/resources','addResources','put','update','delete','destroy','removeSections','removeResources','multer','util'];(function(_0x187401,_0x3c7153){var _0x14bcbe=function(_0x939106){while(--_0x939106){_0x187401['push'](_0x187401['shift']());}};_0x14bcbe(++_0x3c7153);}(_0x4581,0x94));var _0x1458=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x4581[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0x1458('0x0'));var util=require(_0x1458('0x1'));var path=require(_0x1458('0x2'));var timeout=require(_0x1458('0x3'));var express=require(_0x1458('0x4'));var router=express[_0x1458('0x5')]();var auth=require(_0x1458('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x1458('0x7'));var controller=require(_0x1458('0x8'));router[_0x1458('0x9')]('/',auth[_0x1458('0xa')](),controller[_0x1458('0xb')]);router[_0x1458('0x9')](_0x1458('0xc'),auth[_0x1458('0xa')](),controller[_0x1458('0xd')]);router[_0x1458('0x9')](_0x1458('0xe'),auth[_0x1458('0xa')](),controller[_0x1458('0xf')]);router[_0x1458('0x9')](_0x1458('0x10'),auth['isAuthenticated'](),controller[_0x1458('0x11')]);router[_0x1458('0x9')]('/:id/resources',auth[_0x1458('0xa')](),controller[_0x1458('0x12')]);router[_0x1458('0x13')]('/',auth[_0x1458('0xa')](),controller[_0x1458('0x14')]);router[_0x1458('0x13')](_0x1458('0x15'),auth[_0x1458('0xa')](),controller['clone']);router[_0x1458('0x13')](_0x1458('0x10'),auth[_0x1458('0xa')](),controller['addSections']);router[_0x1458('0x13')](_0x1458('0x16'),auth[_0x1458('0xa')](),controller[_0x1458('0x17')]);router[_0x1458('0x18')](_0x1458('0xe'),auth[_0x1458('0xa')](),controller[_0x1458('0x19')]);router[_0x1458('0x1a')](_0x1458('0xe'),auth['isAuthenticated'](),controller[_0x1458('0x1b')]);router[_0x1458('0x1a')](_0x1458('0x10'),auth[_0x1458('0xa')](),controller[_0x1458('0x1c')]);router[_0x1458('0x1a')]('/:id/resources',auth[_0x1458('0xa')](),controller[_0x1458('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x0f8e=['get','/describe','describe','/:id','show','/:id/sections','getResources','/:id/clone','clone','post','/:id/resources','addResources','put','update','delete','destroy','removeResources','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index'];(function(_0x3c9b8c,_0xae7a31){var _0x5a153b=function(_0x25c313){while(--_0x25c313){_0x3c9b8c['push'](_0x3c9b8c['shift']());}};_0x5a153b(++_0xae7a31);}(_0x0f8e,0x7a));var _0xe0f8=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0x0f8e[_0x9cfe28];return _0x54a1d0;};'use strict';var multer=require('multer');var util=require(_0xe0f8('0x0'));var path=require(_0xe0f8('0x1'));var timeout=require(_0xe0f8('0x2'));var express=require(_0xe0f8('0x3'));var router=express['Router']();var auth=require(_0xe0f8('0x4'));var interaction=require(_0xe0f8('0x5'));var config=require('../../config/environment');var controller=require('./userProfile.controller');router['get']('/',auth[_0xe0f8('0x6')](),controller[_0xe0f8('0x7')]);router[_0xe0f8('0x8')](_0xe0f8('0x9'),auth['isAuthenticated'](),controller[_0xe0f8('0xa')]);router['get'](_0xe0f8('0xb'),auth[_0xe0f8('0x6')](),controller[_0xe0f8('0xc')]);router[_0xe0f8('0x8')](_0xe0f8('0xd'),auth['isAuthenticated'](),controller['getSections']);router[_0xe0f8('0x8')]('/:id/resources',auth['isAuthenticated'](),controller[_0xe0f8('0xe')]);router['post']('/',auth[_0xe0f8('0x6')](),controller['create']);router['post'](_0xe0f8('0xf'),auth[_0xe0f8('0x6')](),controller[_0xe0f8('0x10')]);router[_0xe0f8('0x11')](_0xe0f8('0xd'),auth[_0xe0f8('0x6')](),controller['addSections']);router[_0xe0f8('0x11')](_0xe0f8('0x12'),auth['isAuthenticated'](),controller[_0xe0f8('0x13')]);router[_0xe0f8('0x14')](_0xe0f8('0xb'),auth['isAuthenticated'](),controller[_0xe0f8('0x15')]);router[_0xe0f8('0x16')](_0xe0f8('0xb'),auth[_0xe0f8('0x6')](),controller[_0xe0f8('0x17')]);router[_0xe0f8('0x16')](_0xe0f8('0xd'),auth[_0xe0f8('0x6')](),controller['removeSections']);router['delete']('/:id/resources',auth[_0xe0f8('0x6')](),controller[_0xe0f8('0x18')]);module[_0xe0f8('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 f9128a7..3946c2c 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 _0x6796=['setDataValue','crudPermissions','join','getDataValue','sequelize','STRING','name'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0x6796,0x66));var _0x6679=function(_0x4e5552,_0x19ec4e){_0x4e5552=_0x4e5552-0x0;var _0x60a338=_0x6796[_0x4e5552];return _0x60a338;};'use strict';var Sequelize=require(_0x6679('0x0'));module['exports']={'name':{'type':Sequelize[_0x6679('0x1')],'allowNull':![],'unique':_0x6679('0x2')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0xbe8595){this[_0x6679('0x3')](_0x6679('0x4'),_0xbe8595?_0xbe8595[_0x6679('0x5')](''):[]);},'get':function(){return this[_0x6679('0x6')](_0x6679('0x4'))?this[_0x6679('0x6')](_0x6679('0x4'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x6679('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xe56e=['sequelize','STRING','setDataValue','join','getDataValue','crudPermissions'];(function(_0x1ccb5d,_0x341da9){var _0x1fe071=function(_0x12433e){while(--_0x12433e){_0x1ccb5d['push'](_0x1ccb5d['shift']());}};_0x1fe071(++_0x341da9);}(_0xe56e,0xd8));var _0xee56=function(_0x570b12,_0x9d48b7){_0x570b12=_0x570b12-0x0;var _0x2a4dab=_0xe56e[_0x570b12];return _0x2a4dab;};'use strict';var Sequelize=require(_0xee56('0x0'));module['exports']={'name':{'type':Sequelize[_0xee56('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0xee56('0x1')],'set':function(_0x2349fb){this[_0xee56('0x2')]('crudPermissions',_0x2349fb?_0x2349fb[_0xee56('0x3')](''):[]);},'get':function(){return this[_0xee56('0x4')](_0xee56('0x5'))?this[_0xee56('0x4')](_0xee56('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0xee56('0x1')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 12e603f..e06aec8 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 _0xb2c8=['extractedreports','metrics','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','squel','desk.js','querystring','papaparse','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','name','send','index','map','UserProfile','rawAttributes','fieldName','key','query','keys','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','type','options','includeAll','findAll','rows','catch','show','params','length','include','find','create','body','clone','get','omit','createdAt','updatedAt','crudPermissions','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','describe','addSections','push','removeSections','ids','getSections','enabled','isEmpty','includes','subsections','some','findOne','Dashboard','forEach','resourceId','addResources','bulkCreate','removeResources','getResources','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','Invalid\x20section\x20\x27','parentSections','union','ignore','all','VIRTUAL','AnalyticExtractedReport','foreignKey','associatedResources','field','default','reportId','DefaultReports','custom','CustomReports','CmContact','Tag','Tags','color','tag','value','toLowerCase','squareprojects','SquareProject','odbc','SquareRecording','SquareProjects','projectName','projects','contacts','Lists','ListId','lists','CmList','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','VoiceExtension','contexts','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','agent','telephone','VoiceQueue','musiconholds','chanspies','VoiceChanSpy','ivrcampaigns','Campaign','mailqueues','MailQueue','mailaccounts','mailsubstatuses','openchannelqueues','openchannelaccounts','OpenchannelAccount','SmsQueue','smsaccounts','teams','Team','QueueCampaigns','users','agents','Users','role','admin','user','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','zohoaccounts','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','intervals','Interval','pauses','scheduler','Schedule','sounds','Sound','tags','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','Plugin'];(function(_0x265aa2,_0x220072){var _0x447a3a=function(_0x1512cc){while(--_0x1512cc){_0x265aa2['push'](_0x265aa2['shift']());}};_0x447a3a(++_0x220072);}(_0xb2c8,0xe6));var _0x8b2c=function(_0x55a5a5,_0x476f9b){_0x55a5a5=_0x55a5a5-0x0;var _0x330dfd=_0xb2c8[_0x55a5a5];return _0x330dfd;};'use strict';var pdf=require(_0x8b2c('0x0'));var emlformat=require(_0x8b2c('0x1'));var rimraf=require(_0x8b2c('0x2'));var zipdir=require(_0x8b2c('0x3'));var jsonpatch=require(_0x8b2c('0x4'));var rp=require(_0x8b2c('0x5'));var moment=require(_0x8b2c('0x6'));var BPromise=require(_0x8b2c('0x7'));var Mustache=require('mustache');var util=require(_0x8b2c('0x8'));var path=require('path');var sox=require(_0x8b2c('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8b2c('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8b2c('0xb'));var toCsv=require('to-csv');var querystring=require(_0x8b2c('0xc'));var Papa=require(_0x8b2c('0xd'));var Redis=require(_0x8b2c('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x8b2c('0xf'))(_0x8b2c('0x10'));var utils=require(_0x8b2c('0x11'));var config=require(_0x8b2c('0x12'));var db=require(_0x8b2c('0x13'))['db'];config[_0x8b2c('0x14')]=_[_0x8b2c('0x15')](config[_0x8b2c('0x14')],{'host':_0x8b2c('0x16'),'port':0x18eb});var socket=require(_0x8b2c('0x17'))(new Redis(config['redis']));require(_0x8b2c('0x18'))[_0x8b2c('0x19')](socket);function respondWithStatusCode(_0x2714ae,_0x132c68){_0x132c68=_0x132c68||0xcc;return function(_0x29b7e2){if(_0x29b7e2){return _0x2714ae['sendStatus'](_0x132c68);}return _0x2714ae[_0x8b2c('0x1a')](_0x132c68)['end']();};}function respondWithResult(_0x3ca03e,_0x54905e){_0x54905e=_0x54905e||0xc8;return function(_0x443217){if(_0x443217){return _0x3ca03e[_0x8b2c('0x1a')](_0x54905e)[_0x8b2c('0x1b')](_0x443217);}};}function respondWithFilteredResult(_0x5024a2,_0x1cb1b9){return function(_0x71b70c){if(_0x71b70c){var _0x5ac9db=_0x71b70c[_0x8b2c('0x1c')],_0x1d9701=_0x1cb1b9[_0x8b2c('0x1d')],_0x499b9d=_0x1cb1b9[_0x8b2c('0x1d')]+_0x1cb1b9[_0x8b2c('0x1e')],_0x3bf77e;if(_0x499b9d>=_0x5ac9db){_0x499b9d=_0x5ac9db;_0x3bf77e=0xc8;}else{_0x3bf77e=0xce;}_0x5024a2[_0x8b2c('0x1a')](_0x3bf77e);return _0x5024a2[_0x8b2c('0x1f')](_0x8b2c('0x20'),_0x1d9701+'-'+_0x499b9d+'/'+_0x5ac9db)['json'](_0x71b70c);}return null;};}function patchUpdates(_0x1464bd){return function(_0x459acd){try{jsonpatch['apply'](_0x459acd,_0x1464bd,!![]);}catch(_0x4f288b){return BPromise[_0x8b2c('0x21')](_0x4f288b);}return _0x459acd[_0x8b2c('0x22')]();};}function saveUpdates(_0x4798bb,_0x274037){return function(_0x107ce9){if(_0x107ce9){return _0x107ce9[_0x8b2c('0x23')](_0x4798bb)[_0x8b2c('0x24')](function(_0xefdc37){return _0xefdc37;});}return null;};}function removeEntity(_0xbaf041,_0x206363){return function(_0xc792c0){if(_0xc792c0){return _0xc792c0[_0x8b2c('0x25')]()['then'](function(){_0xbaf041['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c7b25,_0x125a4f){return function(_0x2225a1){if(!_0x2225a1){_0x2c7b25[_0x8b2c('0x26')](0x194);}return _0x2225a1;};}function handleError(_0xd3e532,_0x2ba38a){_0x2ba38a=_0x2ba38a||0x1f4;return function(_0x11ec24){logger['error'](_0x11ec24['stack']);if(_0x11ec24[_0x8b2c('0x27')]){delete _0x11ec24['name'];}_0xd3e532[_0x8b2c('0x1a')](_0x2ba38a)[_0x8b2c('0x28')](_0x11ec24);};}exports[_0x8b2c('0x29')]=function(_0x2d8c1a,_0x3663b4){var _0x24e25d={},_0x5f4610={},_0x1c723f={'count':0x0,'rows':[]};var _0xb463cc=_[_0x8b2c('0x2a')](db[_0x8b2c('0x2b')][_0x8b2c('0x2c')],function(_0x371b33){return{'name':_0x371b33[_0x8b2c('0x2d')],'type':_0x371b33['type'][_0x8b2c('0x2e')]};});_0x5f4610['model']=_['map'](_0xb463cc,_0x8b2c('0x27'));_0x5f4610[_0x8b2c('0x2f')]=_[_0x8b2c('0x30')](_0x2d8c1a[_0x8b2c('0x2f')]);_0x5f4610['filters']=_[_0x8b2c('0x31')](_0x5f4610[_0x8b2c('0x32')],_0x5f4610['query']);_0x24e25d['attributes']=_[_0x8b2c('0x31')](_0x5f4610[_0x8b2c('0x32')],qs[_0x8b2c('0x33')](_0x2d8c1a['query'][_0x8b2c('0x33')]));_0x24e25d['attributes']=_0x24e25d[_0x8b2c('0x34')]['length']?_0x24e25d[_0x8b2c('0x34')]:_0x5f4610[_0x8b2c('0x32')];if(!_0x2d8c1a['query'][_0x8b2c('0x35')](_0x8b2c('0x36'))){_0x24e25d[_0x8b2c('0x1e')]=qs['limit'](_0x2d8c1a[_0x8b2c('0x2f')][_0x8b2c('0x1e')]);_0x24e25d['offset']=qs['offset'](_0x2d8c1a[_0x8b2c('0x2f')][_0x8b2c('0x1d')]);}_0x24e25d[_0x8b2c('0x37')]=qs[_0x8b2c('0x38')](_0x2d8c1a[_0x8b2c('0x2f')][_0x8b2c('0x38')]);_0x24e25d[_0x8b2c('0x39')]=qs[_0x8b2c('0x3a')](_[_0x8b2c('0x3b')](_0x2d8c1a[_0x8b2c('0x2f')],_0x5f4610[_0x8b2c('0x3a')]));if(_0x2d8c1a[_0x8b2c('0x2f')][_0x8b2c('0x3c')]){_0x24e25d[_0x8b2c('0x39')]=_[_0x8b2c('0x3d')](_0x24e25d[_0x8b2c('0x39')],{'$or':_[_0x8b2c('0x2a')](_0xb463cc,function(_0x255760){if(_0x255760[_0x8b2c('0x3e')]!=='VIRTUAL'){var _0x4dffe5={};_0x4dffe5[_0x255760[_0x8b2c('0x27')]]={'$like':'%'+_0x2d8c1a['query']['filter']+'%'};return _0x4dffe5;}})});}_0x24e25d=_[_0x8b2c('0x3d')]({},_0x24e25d,_0x2d8c1a[_0x8b2c('0x3f')]);var _0x127cb0={'where':_0x24e25d[_0x8b2c('0x39')]};return db[_0x8b2c('0x2b')][_0x8b2c('0x1c')](_0x127cb0)[_0x8b2c('0x24')](function(_0x3244bd){_0x1c723f[_0x8b2c('0x1c')]=_0x3244bd;if(_0x2d8c1a['query'][_0x8b2c('0x40')]){_0x24e25d['include']=[{'all':!![]}];}return db[_0x8b2c('0x2b')][_0x8b2c('0x41')](_0x24e25d);})[_0x8b2c('0x24')](function(_0xcd414e){_0x1c723f[_0x8b2c('0x42')]=_0xcd414e;return _0x1c723f;})[_0x8b2c('0x24')](respondWithFilteredResult(_0x3663b4,_0x24e25d))[_0x8b2c('0x43')](handleError(_0x3663b4,null));};exports[_0x8b2c('0x44')]=function(_0x4bb7d6,_0x335540){var _0x3a0c8e={'raw':![],'where':{'id':_0x4bb7d6[_0x8b2c('0x45')]['id']}},_0x2b51d1={};_0x2b51d1[_0x8b2c('0x32')]=_[_0x8b2c('0x30')](db['UserProfile'][_0x8b2c('0x2c')]);_0x2b51d1['query']=_['keys'](_0x4bb7d6[_0x8b2c('0x2f')]);_0x2b51d1[_0x8b2c('0x3a')]=_['intersection'](_0x2b51d1[_0x8b2c('0x32')],_0x2b51d1[_0x8b2c('0x2f')]);_0x3a0c8e[_0x8b2c('0x34')]=_['intersection'](_0x2b51d1['model'],qs[_0x8b2c('0x33')](_0x4bb7d6[_0x8b2c('0x2f')][_0x8b2c('0x33')]));_0x3a0c8e[_0x8b2c('0x34')]=_0x3a0c8e['attributes'][_0x8b2c('0x46')]?_0x3a0c8e[_0x8b2c('0x34')]:_0x2b51d1['model'];if(_0x4bb7d6[_0x8b2c('0x2f')][_0x8b2c('0x40')]){_0x3a0c8e[_0x8b2c('0x47')]=[{'all':!![]}];}_0x3a0c8e=_['merge']({},_0x3a0c8e,_0x4bb7d6[_0x8b2c('0x3f')]);return db[_0x8b2c('0x2b')][_0x8b2c('0x48')](_0x3a0c8e)[_0x8b2c('0x24')](handleEntityNotFound(_0x335540,null))[_0x8b2c('0x24')](respondWithResult(_0x335540,null))[_0x8b2c('0x43')](handleError(_0x335540,null));};exports[_0x8b2c('0x49')]=function(_0x962719,_0xe2e1c0){return db['UserProfile'][_0x8b2c('0x49')](_0x962719[_0x8b2c('0x4a')],{})['then'](respondWithResult(_0xe2e1c0,0xc9))['catch'](handleError(_0xe2e1c0,null));};exports[_0x8b2c('0x4b')]=function(_0x383a8e,_0x207b47){var _0x188585={'where':{'id':_0x383a8e[_0x8b2c('0x45')]['id']}},_0x1ba52a={};_0x1ba52a[_0x8b2c('0x32')]=_[_0x8b2c('0x30')](db[_0x8b2c('0x2b')][_0x8b2c('0x2c')]);_0x188585['attributes']=_['intersection'](_0x1ba52a['model'],qs[_0x8b2c('0x33')](_0x383a8e[_0x8b2c('0x2f')][_0x8b2c('0x33')]));_0x188585[_0x8b2c('0x34')]=_0x188585['attributes'][_0x8b2c('0x46')]?_0x188585['attributes']:_0x1ba52a[_0x8b2c('0x32')];if(_0x383a8e['query']['includeAll']){_0x188585[_0x8b2c('0x47')]=[{'all':!![]}];}_0x188585=_['merge']({},_0x188585,_0x383a8e['options']);return db[_0x8b2c('0x2b')]['find'](_0x188585)[_0x8b2c('0x24')](handleEntityNotFound(_0x207b47,null))[_0x8b2c('0x24')](function(_0x315007){if(_0x315007){var _0x3d4010=_0x315007[_0x8b2c('0x4c')]({'plain':!![]});_0x3d4010=qs[_0x8b2c('0x4d')](_0x3d4010,['id',_0x8b2c('0x4e'),_0x8b2c('0x4f'),_0x8b2c('0x50')]);_0x383a8e['body']=_[_0x8b2c('0x4d')](_0x383a8e[_0x8b2c('0x4a')],['id',_0x8b2c('0x4e'),_0x8b2c('0x4f')]);return db[_0x8b2c('0x51')][_0x8b2c('0x52')](function(_0x4b5992){return db[_0x8b2c('0x2b')]['create'](_[_0x8b2c('0x3d')](_0x3d4010,_0x383a8e[_0x8b2c('0x4a')]),{'include':_0x383a8e[_0x8b2c('0x2f')][_0x8b2c('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x4b5992})[_0x8b2c('0x24')](function(_0x2bf2d3){var _0x2b3e05=_0x2bf2d3[_0x8b2c('0x4c')]({'plain':!![]});return db[_0x8b2c('0x53')][_0x8b2c('0x41')]({'where':{'userProfileId':_0x383a8e[_0x8b2c('0x45')]['id']},'raw':!![]})[_0x8b2c('0x24')](function(_0x4a82ba){if(_0x4a82ba){return BPromise[_0x8b2c('0x54')](_0x4a82ba,function(_0x495f9e){return new BPromise(function(_0x5b3cd7,_0x222305){if(_0x495f9e[_0x8b2c('0x55')]===null||_0x495f9e[_0x8b2c('0x55')]===0x1)_0x5b3cd7(null);return db[_0x8b2c('0x56')][_0x8b2c('0x41')]({'where':{'sectionId':_0x495f9e['id']},'raw':!![]})[_0x8b2c('0x24')](function(_0x1e73c6){var _0x449203=_[_0x8b2c('0x2a')](_0x1e73c6,function(_0x5415d4){return qs[_0x8b2c('0x4d')](_0x5415d4,['id',_0x8b2c('0x4e'),_0x8b2c('0x4f'),_0x8b2c('0x57')]);});_0x5b3cd7(_0x449203);})[_0x8b2c('0x43')](function(_0xf09f7e){_0x222305(_0xf09f7e);});})[_0x8b2c('0x24')](function(_0x4d8660){var _0x547a38=qs[_0x8b2c('0x4d')](_0x495f9e,['id',_0x8b2c('0x4e'),_0x8b2c('0x4f')]);_0x547a38[_0x8b2c('0x58')]=_0x2b3e05['id'];if(_0x4d8660)_0x547a38[_0x8b2c('0x59')]=_0x4d8660;return _0x547a38;})[_0x8b2c('0x24')](function(_0x560a2a){return db['UserProfileSection'][_0x8b2c('0x49')](_0x560a2a,{'include':[{'model':db['UserProfileResource'],'as':_0x8b2c('0x59')}],'raw':!![],'transaction':_0x4b5992});});})['then'](function(){return _0x2b3e05;});}});});});}})[_0x8b2c('0x24')](respondWithResult(_0x207b47,0xc9))[_0x8b2c('0x43')](handleError(_0x207b47,null));};exports[_0x8b2c('0x23')]=function(_0x2298c2,_0x452c14){if(_0x2298c2[_0x8b2c('0x4a')]['id']){delete _0x2298c2[_0x8b2c('0x4a')]['id'];}return db['UserProfile'][_0x8b2c('0x48')]({'where':{'id':_0x2298c2['params']['id']}})[_0x8b2c('0x24')](handleEntityNotFound(_0x452c14,null))['then'](saveUpdates(_0x2298c2[_0x8b2c('0x4a')],null))[_0x8b2c('0x24')](respondWithResult(_0x452c14,null))[_0x8b2c('0x43')](handleError(_0x452c14,null));};exports['destroy']=function(_0x35da2f,_0x1eb422){return db['UserProfile'][_0x8b2c('0x48')]({'where':{'id':_0x35da2f[_0x8b2c('0x45')]['id']}})[_0x8b2c('0x24')](handleEntityNotFound(_0x1eb422,null))[_0x8b2c('0x24')](removeEntity(_0x1eb422,null))[_0x8b2c('0x43')](handleError(_0x1eb422,null));};exports[_0x8b2c('0x5a')]=function(_0x3402ae,_0x17876c){return db[_0x8b2c('0x2b')][_0x8b2c('0x5a')]()[_0x8b2c('0x24')](respondWithResult(_0x17876c,null))['catch'](handleError(_0x17876c,null));};exports[_0x8b2c('0x5b')]=function(_0x1916bf,_0xa0f288){var _0x4b7418=_0x1916bf[_0x8b2c('0x4a')];return db['UserProfile'][_0x8b2c('0x48')]({'where':{'id':_0x1916bf['params']['id']}})[_0x8b2c('0x24')](handleEntityNotFound(_0xa0f288,null))[_0x8b2c('0x24')](function(_0x4fe9af){if(_0x4fe9af){return db['sequelize'][_0x8b2c('0x52')](function(_0x10ea4e){return db['UserProfileSection'][_0x8b2c('0x25')]({'where':{'userProfileId':_0x1916bf[_0x8b2c('0x45')]['id'],'sectionId':_[_0x8b2c('0x2a')](_0x4b7418,function(_0x385f09){return _0x385f09[_0x8b2c('0x57')];})},'transaction':_0x10ea4e})[_0x8b2c('0x24')](function(){var _0x2b9b11=_[_0x8b2c('0x2a')](_0x4b7418,function(_0x183229){_0x183229[_0x8b2c('0x58')]=_0x1916bf['params']['id'];return _0x183229;});var _0x442e60=[];return BPromise['each'](_0x2b9b11,function(_0x27266f){return db['UserProfileSection'][_0x8b2c('0x49')](_0x27266f,{'include':[{'model':db[_0x8b2c('0x56')],'as':_0x8b2c('0x59')}],'raw':!![],'transaction':_0x10ea4e})[_0x8b2c('0x24')](function(_0x3a073f){_0x442e60[_0x8b2c('0x5c')](_0x3a073f['get']({'plain':!![]}));});})[_0x8b2c('0x24')](function(){return _0x442e60;});});});}})[_0x8b2c('0x24')](function(_0x2fe3e7){return _0x2fe3e7;})[_0x8b2c('0x24')](respondWithResult(_0xa0f288,null))['catch'](handleError(_0xa0f288,null));};exports[_0x8b2c('0x5d')]=function(_0x187b4c,_0x54df2c){var _0x4a9945;return db[_0x8b2c('0x2b')][_0x8b2c('0x48')]({'where':{'id':_0x187b4c['params']['id']},'attributes':['id',_0x8b2c('0x27')]})[_0x8b2c('0x24')](handleEntityNotFound(_0x54df2c,null))['then'](function(_0x3b2995){if(_0x3b2995){_0x4a9945=_0x3b2995;return db[_0x8b2c('0x53')][_0x8b2c('0x25')]({'where':{'userProfileId':_0x187b4c[_0x8b2c('0x45')]['id'],'sectionId':_0x187b4c[_0x8b2c('0x2f')][_0x8b2c('0x5e')]}});}})['then'](function(){return _0x4a9945;})[_0x8b2c('0x24')](respondWithStatusCode(_0x54df2c,null))[_0x8b2c('0x43')](handleError(_0x54df2c,null));};exports[_0x8b2c('0x5f')]=function(_0xe4c41d,_0x240d62){var _0x2ff732=[];var _0x76a61d=[];return db[_0x8b2c('0x53')][_0x8b2c('0x41')]({'where':{'userProfileId':_0xe4c41d[_0x8b2c('0x45')]['id']},'raw':!![]})[_0x8b2c('0x24')](function(_0x3d115f){_0x2ff732=_['filter'](_0x3d115f,function(_0x1ceaf7){return _0x1ceaf7[_0x8b2c('0x60')]===0x1;});if(!_[_0x8b2c('0x61')](_0x2ff732)){return _[_0x8b2c('0x2a')](_0x2ff732,function(_0x4c596d){return _0x4c596d[_0x8b2c('0x57')];});}else{return;}})[_0x8b2c('0x24')](function(_0x115ddb){if(_0x115ddb)_0x76a61d=_0x115ddb;if(_[_0x8b2c('0x62')](_0x76a61d,0x64)){var _0x4db105=_['find'](_0x2ff732,{'sectionId':0x64});return hasDefaultDashboard(_0x4db105)[_0x8b2c('0x24')](function(_0x2f5a0a){return _[_0x8b2c('0x2a')](_0x2ff732,function(_0x1e4e44){if(_0x1e4e44[_0x8b2c('0x57')]===0x64){_0x1e4e44[_0x8b2c('0x63')]=_0x2f5a0a;}return _0x1e4e44;});});}else{return;}})[_0x8b2c('0x24')](function(_0x521373){if(_0x521373)_0x2ff732=_0x521373;if(_[_0x8b2c('0x62')](_0x76a61d,0x3eb)||_['some'](_0x2ff732,{'enabled':![],'sectionId':0x3eb})){var _0x56533b=_[_0x8b2c('0x48')](_0x2ff732,{'sectionId':0x3eb});return getCustomDashboards(_0x56533b)[_0x8b2c('0x24')](function(_0x3f5901){return _[_0x8b2c('0x2a')](_0x2ff732,function(_0x503f93){if(_0x503f93['sectionId']===0x3eb){_0x503f93[_0x8b2c('0x63')]=_0x3f5901;}return _0x503f93;});});}else{return;}})['then'](function(_0xf0a096){if(_0xf0a096)_0x2ff732=_0xf0a096;if(_[_0x8b2c('0x62')](_0x76a61d,0x709)||_[_0x8b2c('0x64')](_0x2ff732,{'enabled':![],'sectionId':0x709})){var _0x4c9a37=_['find'](_0x2ff732,{'sectionId':0x709});return getPlugins(_0x4c9a37)[_0x8b2c('0x24')](function(_0x34fffc){return _[_0x8b2c('0x2a')](_0x2ff732,function(_0x58eeec){if(_0x58eeec[_0x8b2c('0x57')]===0x709){_0x58eeec[_0x8b2c('0x63')]=_0x34fffc;}return _0x58eeec;});});}else{return;}})['then'](function(_0x233463){if(_0x233463)_0x2ff732=_0x233463;return _0x2ff732;})[_0x8b2c('0x24')](respondWithResult(_0x240d62,null))[_0x8b2c('0x43')](handleError(_0x240d62,null));};function hasDefaultDashboard(_0x3256c1){var _0x3ceff2=[0x65];return new BPromise(function(_0x3366d8,_0x239b8a){try{if(_0x3256c1['autoAssociation']){_0x3366d8(_0x3ceff2);}else{return db[_0x8b2c('0x56')][_0x8b2c('0x65')]({'where':{'sectionId':_0x3256c1['id']},'raw':!![]})[_0x8b2c('0x24')](function(_0x34ff97){if(_0x34ff97){_0x3366d8(_0x3ceff2);}});}}catch(_0x40ff68){_0x239b8a(_0x40ff68);}});}function getCustomDashboards(_0x36db4b){var _0x5882a9=[];return new BPromise(function(_0xc5b38,_0x23dd37){try{if(_0x36db4b[_0x8b2c('0x55')]){return db[_0x8b2c('0x66')][_0x8b2c('0x41')]({'raw':!![]})[_0x8b2c('0x24')](function(_0x3ab3aa){_0x3ab3aa[_0x8b2c('0x67')](function(_0x3f16cf){_0x5882a9[_0x8b2c('0x5c')](_0x3f16cf['id']+0x1869f);});_0xc5b38(_0x5882a9);});}else{return db['UserProfileResource'][_0x8b2c('0x41')]({'where':{'sectionId':_0x36db4b['id']},'raw':!![]})['then'](function(_0xa86f46){_0xa86f46[_0x8b2c('0x67')](function(_0x582e6d){_0x5882a9[_0x8b2c('0x5c')](_0x582e6d[_0x8b2c('0x68')]+0x1869f);});_0xc5b38(_0x5882a9);});}}catch(_0x4928de){_0x23dd37(_0x4928de);}});}function getPlugins(_0x432b1f){var _0x1cfddc=[];return new BPromise(function(_0x3e2b5b,_0x2ab6bf){try{if(_0x432b1f[_0x8b2c('0x55')]){return db['Plugin'][_0x8b2c('0x41')]({'raw':!![]})[_0x8b2c('0x24')](function(_0x36d529){_0x36d529[_0x8b2c('0x67')](function(_0x45549d){_0x1cfddc[_0x8b2c('0x5c')](_0x45549d['id']+0x15b38);});_0x3e2b5b(_0x1cfddc);});}else{return db[_0x8b2c('0x56')][_0x8b2c('0x41')]({'where':{'sectionId':_0x432b1f['id']},'raw':!![]})[_0x8b2c('0x24')](function(_0x400ce6){_0x400ce6['forEach'](function(_0x4d8257){_0x1cfddc[_0x8b2c('0x5c')](_0x4d8257[_0x8b2c('0x68')]+0x15b38);});_0x3e2b5b(_0x1cfddc);});}}catch(_0x20fe6e){_0x2ab6bf(_0x20fe6e);}});}exports[_0x8b2c('0x69')]=function(_0x539bb3,_0x38d3e8){return db['UserProfile']['find']({'where':{'id':_0x539bb3[_0x8b2c('0x45')]['id']}})[_0x8b2c('0x24')](handleEntityNotFound(_0x38d3e8,null))[_0x8b2c('0x24')](function(_0x34c94b){if(_0x34c94b){return db[_0x8b2c('0x51')][_0x8b2c('0x52')](function(_0x34d0df){return db[_0x8b2c('0x53')][_0x8b2c('0x41')]({'where':{'userProfileId':_0x539bb3['params']['id']},'attributes':['id'],'raw':!![]})[_0x8b2c('0x24')](function(_0x5b9cbb){if(_0x5b9cbb){return db[_0x8b2c('0x53')][_0x8b2c('0x25')]({'where':{'userProfileId':_0x539bb3[_0x8b2c('0x45')]['id'],'id':_[_0x8b2c('0x2a')](_0x5b9cbb,function(_0x47cd8d){return _0x47cd8d['id'];})},'transaction':_0x34d0df});}})[_0x8b2c('0x24')](function(_0x374ec7){var _0xbf0073=_[_0x8b2c('0x2a')](_0x539bb3[_0x8b2c('0x4a')],function(_0x252e41){_0x252e41[_0x8b2c('0x58')]=_0x539bb3[_0x8b2c('0x45')]['id'];return _0x252e41;});return db[_0x8b2c('0x53')]['bulkCreate'](_0xbf0073,{'raw':!![],'transaction':_0x34d0df});})[_0x8b2c('0x24')](function(_0x26a17b){var _0x529e32=_[_0x8b2c('0x3c')](_['map'](_0x26a17b,function(_0x1b8dc1){return _0x1b8dc1['get']({'plain':!![]});}),{'includeAll':![]});if(_0x529e32){return db[_0x8b2c('0x53')][_0x8b2c('0x41')]({'where':{'userProfileId':_0x539bb3[_0x8b2c('0x45')]['id'],'sectionId':_['map'](_0x529e32,function(_0x2f7125){return _0x2f7125[_0x8b2c('0x57')];})},'attributes':['id',_0x8b2c('0x57')],'raw':!![]})[_0x8b2c('0x24')](function(_0x370d00){var _0x31726e=_[_0x8b2c('0x2a')](_0x539bb3[_0x8b2c('0x4a')],function(_0x25110d){_0x25110d[_0x8b2c('0x58')]=_0x539bb3[_0x8b2c('0x45')]['id'];return _0x25110d;});return db[_0x8b2c('0x56')][_0x8b2c('0x6a')](_0x31726e,{'raw':!![],'transaction':_0x34d0df});});}})['catch'](handleError(_0x38d3e8,null));});}})[_0x8b2c('0x24')](function(_0x4b93cd){var _0x4c7ba3=_[_0x8b2c('0x2a')](_0x4b93cd,function(_0x2f92a8){return _0x2f92a8[_0x8b2c('0x4c')]({'plain':!![]});});})[_0x8b2c('0x24')](respondWithResult(_0x38d3e8,null))[_0x8b2c('0x43')](handleError(_0x38d3e8,null));};exports[_0x8b2c('0x6b')]=function(_0x15a4e3,_0x1c986f,_0x42a24d){return db['UserProfile'][_0x8b2c('0x48')]({'where':{'id':_0x15a4e3[_0x8b2c('0x45')]['id']}})[_0x8b2c('0x24')](handleEntityNotFound(_0x1c986f,null))[_0x8b2c('0x24')](function(_0x443f91){if(_0x443f91){return _0x443f91[_0x8b2c('0x6b')](_0x15a4e3[_0x8b2c('0x2f')]['ids']);}})[_0x8b2c('0x24')](respondWithStatusCode(_0x1c986f,null))['catch'](handleError(_0x1c986f,null));};exports[_0x8b2c('0x6c')]=function(_0x3a59e6,_0x330d5c){var _0x1b8444={'raw':![],'where':{}};var _0x588230={};var _0x36deb7={'count':0x0,'rows':[]};var _0x3e8758=_0x3a59e6[_0x8b2c('0x2f')]['section'];if(typeof _0x3e8758===_0x8b2c('0x6d')){throw new db[(_0x8b2c('0x6e'))][(_0x8b2c('0x6f'))](_0x8b2c('0x70'));}var _0x426c32=_0x3a59e6[_0x8b2c('0x2f')][_0x8b2c('0x71')]||![];var _0x3e9f47=getQueryModels(_0x3e8758,_0x426c32);if(typeof _0x3e9f47[_0x8b2c('0x72')]==='undefined'){throw new db['Sequelize'][(_0x8b2c('0x6f'))](_0x8b2c('0x73')+_0x3e8758+'\x27');}var _0x589425=[];if(!_['isEmpty'](_0x3e9f47[_0x8b2c('0x74')])){_0x589425=_0x3e9f47[_0x8b2c('0x74')];}else{_0x589425=[{'name':_0x3e8758}];}return db[_0x8b2c('0x2b')][_0x8b2c('0x65')]({'where':{'id':_0x3a59e6['params']['id']}})['then'](handleEntityNotFound(_0x330d5c,null))[_0x8b2c('0x24')](function(_0x4dd97b){if(_0x4dd97b){var _0x1c2a7c=[];for(var _0x16d727=0x0;_0x16d727<_0x589425['length'];_0x16d727++){_0x1c2a7c[_0x8b2c('0x5c')](db['UserProfileSection']['findOne']({'where':{'userProfileId':_0x4dd97b['id'],'name':_0x589425[_0x16d727][_0x8b2c('0x27')]},'raw':!![]}));}return BPromise['all'](_0x1c2a7c);}})[_0x8b2c('0x24')](function(_0x817fcc){var _0x5abd1a=_[_0x8b2c('0x3c')](_0x817fcc,function(_0x4d6923){return _0x4d6923?_0x4d6923:undefined;});var _0x105bc0=_[_0x8b2c('0x3c')](_0x589425,['ignore',!![]]);var _0x4a1884=_['isEmpty'](_0x5abd1a)&&_[_0x8b2c('0x61')](_0x105bc0)?null:_[_0x8b2c('0x75')](_0x105bc0,_0x5abd1a);if(_0x4a1884){var _0x4ca975=[];for(var _0x3293af=0x0;_0x3293af<_0x4a1884['length'];_0x3293af++){var _0x468c8e=_[_0x8b2c('0x48')](_0x589425,function(_0x337f76){return _0x4a1884[_0x3293af]?_0x337f76[_0x8b2c('0x27')]===_0x4a1884[_0x3293af][_0x8b2c('0x27')]:null;});if(_0x468c8e){if(_0x4a1884[_0x3293af][_0x8b2c('0x76')]){_0x4ca975[_0x8b2c('0x5c')](getAllResources(_0x3e9f47[_0x8b2c('0x72')],_0x4a1884[_0x3293af]));}else{if(!_0x4a1884[_0x3293af][_0x8b2c('0x55')]){_0x4ca975[_0x8b2c('0x5c')](getAllowedResources(_0x468c8e,_0x4a1884[_0x3293af],_0x3e9f47[_0x8b2c('0x72')]));}else{if(_0x468c8e[_0x8b2c('0x32')]){_0x4ca975['push'](getAllFilteredResources(_0x468c8e,_0x4a1884[_0x3293af]));}}}}}return BPromise[_0x8b2c('0x77')](_0x4ca975);}else{return null;}})[_0x8b2c('0x24')](function(_0x1cc46b){var _0x13b6b1=_0x1cc46b;var _0x436cc5=null;if(_0x13b6b1){_0x436cc5=_0x13b6b1[_0x8b2c('0x46')]===0x1?_0x13b6b1[0x0]:null;}if(_0x436cc5||_0x13b6b1){var _0x47e645=db[_0x3e9f47[_0x8b2c('0x72')]]['rawAttributes'];_0x588230[_0x8b2c('0x32')]=_[_0x8b2c('0x30')](_0x47e645);_0x588230[_0x8b2c('0x2f')]=_[_0x8b2c('0x30')](_0x3a59e6[_0x8b2c('0x2f')]);_0x588230[_0x8b2c('0x3a')]=_[_0x8b2c('0x31')](_0x588230['model'],_0x588230[_0x8b2c('0x2f')]);_0x1b8444[_0x8b2c('0x34')]=_['intersection'](_0x588230[_0x8b2c('0x32')],qs[_0x8b2c('0x33')](_0x3a59e6['query'][_0x8b2c('0x33')]));_0x1b8444[_0x8b2c('0x34')]=_0x1b8444[_0x8b2c('0x34')][_0x8b2c('0x46')]?_0x1b8444[_0x8b2c('0x34')]:_0x588230[_0x8b2c('0x32')];if(!_0x3a59e6[_0x8b2c('0x2f')][_0x8b2c('0x35')](_0x8b2c('0x36'))){_0x1b8444[_0x8b2c('0x1e')]=qs[_0x8b2c('0x1e')](_0x3a59e6[_0x8b2c('0x2f')][_0x8b2c('0x1e')]);_0x1b8444[_0x8b2c('0x1d')]=qs[_0x8b2c('0x1d')](_0x3a59e6[_0x8b2c('0x2f')]['offset']);}_0x1b8444[_0x8b2c('0x37')]=qs[_0x8b2c('0x38')](_0x3a59e6[_0x8b2c('0x2f')]['sort']);_0x1b8444[_0x8b2c('0x39')]=qs[_0x8b2c('0x3a')](_[_0x8b2c('0x3b')](_0x3a59e6[_0x8b2c('0x2f')],_0x588230[_0x8b2c('0x3a')]));if(_0x3a59e6[_0x8b2c('0x2f')][_0x8b2c('0x3c')]){_0x1b8444[_0x8b2c('0x39')]=_[_0x8b2c('0x3d')](_0x1b8444[_0x8b2c('0x39')],{'$or':_[_0x8b2c('0x2a')](_0x47e645,function(_0x359231){if(_0x359231[_0x8b2c('0x3e')][_0x8b2c('0x2e')]!==_0x8b2c('0x78')){var _0x1fc81c={};_0x1fc81c[_0x359231['field']]={'$like':'%'+_0x3a59e6['query'][_0x8b2c('0x3c')]+'%'};return _0x1fc81c;}})});}var _0x4315d3=[];if(_0x436cc5){var _0x42a711=_[_0x8b2c('0x48')](_0x589425,[_0x8b2c('0x27'),_0x436cc5['name']]);if(_0x42a711['field']){var _0x5a412e={};if(_0x3e9f47[_0x8b2c('0x72')]===_0x8b2c('0x79')){_0x5a412e[_0x42a711[_0x8b2c('0x7a')]]=_['map'](_0x436cc5[_0x8b2c('0x7b')],'id');}else{_0x5a412e[_0x42a711[_0x8b2c('0x7a')]]=_0x436cc5['associatedResources'];}_0x4315d3['push'](_0x5a412e);}else{_0x1b8444[_0x8b2c('0x39')]['id']=_0x436cc5[_0x8b2c('0x7b')];}}else{for(var _0x327b7a=0x0;_0x327b7a<_0x13b6b1[_0x8b2c('0x46')];_0x327b7a++){var _0x42a711=_[_0x8b2c('0x48')](_0x589425,[_0x8b2c('0x27'),_0x13b6b1[_0x327b7a]['name']]);if(_0x42a711[_0x8b2c('0x7c')]){var _0x5a412e={};_0x5a412e[_0x42a711['foreignKey']]=_0x13b6b1[_0x327b7a][_0x8b2c('0x7b')];_0x4315d3[_0x8b2c('0x5c')](_0x5a412e);}else{if(!_0x1b8444['where']['id'])_0x1b8444[_0x8b2c('0x39')]['id']=[];_0x13b6b1[_0x327b7a]['associatedResources'][_0x8b2c('0x67')](function(_0x3afb94){_0x1b8444[_0x8b2c('0x39')]['id'][_0x8b2c('0x5c')](_0x3afb94);});}}}if(!_[_0x8b2c('0x61')](_0x4315d3)){_0x1b8444['where']=_['merge'](_0x1b8444[_0x8b2c('0x39')],{'$and':{'$or':_0x4315d3}});}_0x1b8444=_['merge']({},_0x1b8444,_0x3a59e6[_0x8b2c('0x3f')]);if(_0x436cc5&&!_0x436cc5['autoAssociation']&&_0x3e9f47[_0x8b2c('0x72')]===_0x8b2c('0x79')){if(_0x3a59e6['query']['includeAll']){_0x1b8444[_0x8b2c('0x47')]=[{'all':!![]}];}return db[_0x3e9f47['childModel']]['findAll'](_0x1b8444)[_0x8b2c('0x24')](function(_0x3e0c8e){var _0x35be00=[];_0x3e0c8e['forEach'](function(_0x2c7e36){var _0x51d86b;switch(_0x2c7e36['reportType']){case _0x8b2c('0x7d'):_0x51d86b=_[_0x8b2c('0x48')](_0x436cc5[_0x8b2c('0x7b')],function(_0x3f1c3e){return _0x3f1c3e['id']===_0x2c7e36[_0x8b2c('0x7e')]&&_0x3f1c3e['type']===_0x8b2c('0x7f');});break;case _0x8b2c('0x80'):_0x51d86b=_['find'](_0x436cc5[_0x8b2c('0x7b')],function(_0x252651){return _0x252651['id']===_0x2c7e36[_0x8b2c('0x7e')]&&_0x252651['type']===_0x8b2c('0x81');});break;}if(_0x51d86b)_0x35be00[_0x8b2c('0x5c')](_0x2c7e36);});_0x36deb7[_0x8b2c('0x1c')]=_0x35be00['length'];_0x36deb7[_0x8b2c('0x42')]=_0x35be00;return _0x36deb7;});}else{return db[_0x3e9f47['childModel']][_0x8b2c('0x1c')]({'where':_0x1b8444[_0x8b2c('0x39')]})['then'](function(_0x4e950c){_0x36deb7[_0x8b2c('0x1c')]=_0x4e950c;if(_0x3a59e6[_0x8b2c('0x2f')][_0x8b2c('0x40')]){if(_0x3e9f47[_0x8b2c('0x72')]===_0x8b2c('0x82')){_0x1b8444[_0x8b2c('0x47')]=[{'model':db[_0x8b2c('0x83')],'as':_0x8b2c('0x84'),'attributes':['id',_0x8b2c('0x27'),_0x8b2c('0x85')],'required':_0x3a59e6['query'][_0x8b2c('0x86')]?!![]:![]},{'model':db[_0x8b2c('0x83')],'as':'ThroughTags','attributes':['id',_0x8b2c('0x27'),_0x8b2c('0x85')],'through':_0x3a59e6['query'][_0x8b2c('0x86')]?{'attributes':[],'where':{'TagId':_0x3a59e6['query'][_0x8b2c('0x86')]||undefined}}:{},'required':_0x3a59e6[_0x8b2c('0x2f')][_0x8b2c('0x86')]?!![]:![]}];}else{_0x1b8444['include']=[{'all':!![]}];}}return db[_0x3e9f47[_0x8b2c('0x72')]][_0x8b2c('0x41')](_0x1b8444);})[_0x8b2c('0x24')](function(_0x5453ba){_0x36deb7['rows']=_0x5453ba;return _0x36deb7;});}}else{return _0x36deb7;}})[_0x8b2c('0x24')](respondWithFilteredResult(_0x330d5c,_0x1b8444))['catch'](handleError(_0x330d5c,null));};function getAllResources(_0x5e2356,_0x4eb321){return new BPromise(function(_0x1ad2d5,_0x27bfa4){if(_0x4eb321){var _0x373ccd=_0x4eb321[_0x8b2c('0x3c')]?{[_0x4eb321['filter'][_0x8b2c('0x7c')]]:_0x4eb321[_0x8b2c('0x3c')][_0x8b2c('0x87')]}:undefined;return db[_0x5e2356][_0x8b2c('0x41')]({'where':_0x373ccd,'raw':!![]})[_0x8b2c('0x24')](function(_0x154d6){_0x4eb321[_0x8b2c('0x7b')]=_['map'](_0x154d6,'id');_0x1ad2d5(_0x4eb321);})['catch'](function(_0x2a67e4){_0x27bfa4(_0x2a67e4);});}else{_0x1ad2d5(null);}});}function getAllFilteredResources(_0x574a60,_0x55730f){return new BPromise(function(_0x2f60f8,_0x4a5d53){var _0x4a63ee=_0x574a60['filter']?{[_0x574a60[_0x8b2c('0x3c')][_0x8b2c('0x7c')]]:_0x574a60[_0x8b2c('0x3c')]['value']}:undefined;return db[_0x574a60[_0x8b2c('0x32')]][_0x8b2c('0x41')]({'where':_0x4a63ee,'raw':!![]})['then'](function(_0x3c4f84){_0x55730f['associatedResources']=_[_0x8b2c('0x2a')](_0x3c4f84,function(_0x665751){return _0x665751['name'];});_0x2f60f8(_0x55730f);})[_0x8b2c('0x43')](function(_0x239e3a){_0x4a5d53(_0x239e3a);});});}function getAllowedResources(_0x2cefb3,_0x18bf8f,_0x5dc121){return new BPromise(function(_0x511e5e,_0x28d93e){if(_0x18bf8f){return db[_0x8b2c('0x56')][_0x8b2c('0x41')]({'where':{'sectionId':_0x18bf8f['id']},'raw':!![]})[_0x8b2c('0x24')](function(_0x5d10fe){if(_0x2cefb3[_0x8b2c('0x7c')]&&_0x2cefb3[_0x8b2c('0x7c')]!=='id'){_0x18bf8f[_0x8b2c('0x7b')]=_[_0x8b2c('0x2a')](_0x5d10fe,function(_0x4d5944){return _0x4d5944[_0x2cefb3[_0x8b2c('0x7c')]];});}else{if(_0x5dc121==='AnalyticExtractedReport'){_0x18bf8f[_0x8b2c('0x7b')]=_[_0x8b2c('0x2a')](_0x5d10fe,function(_0x3b3f48){return{'id':_0x3b3f48[_0x8b2c('0x68')],'type':_0x3b3f48[_0x8b2c('0x3e')]};});}else{_0x18bf8f[_0x8b2c('0x7b')]=_[_0x8b2c('0x2a')](_0x5d10fe,function(_0x9483cd){return _0x9483cd['resourceId'];});}}_0x511e5e(_0x18bf8f);})[_0x8b2c('0x43')](function(_0x6509a9){_0x28d93e(_0x6509a9);});}else{_0x511e5e(null);}});}function getQueryModels(_0x10342e,_0x276ffd){var _0x3b7f4f=_0x10342e[_0x8b2c('0x88')]();var _0x24dc25={'childModel':undefined,'parentSections':[]};switch(_0x3b7f4f){case _0x8b2c('0x89'):_0x24dc25['childModel']=_0x8b2c('0x8a');break;case _0x8b2c('0x8b'):_0x24dc25['childModel']='SquareOdbc';break;case'squarerecordings':_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0x8c');_0x24dc25[_0x8b2c('0x74')]=[{'name':_0x8b2c('0x8d'),'field':_0x8b2c('0x27'),'foreignKey':_0x8b2c('0x8e')}];break;case _0x8b2c('0x8f'):_0x24dc25['childModel']='JscriptyProject';break;case _0x8b2c('0x90'):_0x24dc25[_0x8b2c('0x72')]='CmContact';_0x24dc25['parentSections']=[{'name':_0x8b2c('0x91'),'field':'id','foreignKey':_0x8b2c('0x92')}];break;case _0x8b2c('0x93'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0x94');break;case _0x8b2c('0x95'):_0x24dc25['childModel']=_0x8b2c('0x96');break;case'globalcustomfields':_0x24dc25[_0x8b2c('0x72')]='CmCustomField';break;case _0x8b2c('0x97'):_0x24dc25['childModel']=_0x8b2c('0x98');break;case _0x8b2c('0x99'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0x9a');break;case'faxqueues':_0x24dc25[_0x8b2c('0x72')]='FaxQueue';break;case _0x8b2c('0x9b'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0x9c');break;case _0x8b2c('0x9d'):case _0x8b2c('0x9e'):case _0x8b2c('0x9f'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xa0');break;case _0x8b2c('0xa1'):_0x24dc25[_0x8b2c('0x72')]='VoiceContext';break;case _0x8b2c('0xa2'):_0x24dc25[_0x8b2c('0x72')]='VoiceMail';break;case _0x8b2c('0xa3'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xa4');_0x24dc25[_0x8b2c('0x74')]=[{'name':_0x8b2c('0xa5'),'field':_0x8b2c('0x27'),'foreignKey':_0x8b2c('0xa6'),'model':_0x8b2c('0xa7'),'filter':{'field':'role','value':[_0x8b2c('0xa8')]}},{'name':'Telephones','field':_0x8b2c('0x27'),'foreignKey':_0x8b2c('0xa6'),'model':_0x8b2c('0xa7'),'filter':{'field':'role','value':[_0x8b2c('0xa9')]}},{'name':'VoiceQueues','field':_0x8b2c('0x27'),'foreignKey':'queue','model':_0x8b2c('0xaa'),'filter':{'field':'type','value':['inbound']}},{'name':'QueueCampaigns','field':'name','foreignKey':'queue','model':_0x8b2c('0xaa'),'filter':{'field':_0x8b2c('0x3e'),'value':['outbound']}}];break;case _0x8b2c('0xab'):_0x24dc25[_0x8b2c('0x72')]='VoiceMusicOnHold';break;case _0x8b2c('0xac'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xad');break;case'voiceprefixes':_0x24dc25[_0x8b2c('0x72')]='VoicePrefix';break;case _0x8b2c('0xae'):_0x24dc25['childModel']=_0x8b2c('0xaf');break;case _0x8b2c('0xb0'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xb1');break;case _0x8b2c('0xb2'):_0x24dc25[_0x8b2c('0x72')]='MailAccount';break;case _0x8b2c('0xb3'):_0x24dc25[_0x8b2c('0x72')]='MailSubstatus';break;case _0x8b2c('0xb4'):_0x24dc25[_0x8b2c('0x72')]='OpenchannelQueue';break;case _0x8b2c('0xb5'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xb6');break;case'smsqueues':_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xb7');break;case _0x8b2c('0xb8'):_0x24dc25['childModel']='SmsAccount';break;case _0x8b2c('0xb9'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xba');break;case'voicequeues':case'queuecampaigns':_0x24dc25[_0x8b2c('0x72')]='VoiceQueue';if(_0x276ffd){_0x24dc25['parentSections']=[{'name':'VoiceQueues'},{'name':_0x8b2c('0xbb')}];}break;case _0x8b2c('0xbc'):case _0x8b2c('0xbd'):case'telephones':_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xa7');if(_0x276ffd){_0x24dc25['parentSections']=[{'name':_0x8b2c('0xbe'),'filter':{'field':_0x8b2c('0xbf'),'value':[_0x8b2c('0xc0'),_0x8b2c('0xc1')]},'ignore':!![]},{'name':_0x8b2c('0xa5')},{'name':'Telephones'}];}break;case _0x8b2c('0xc2'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xc3');break;case _0x8b2c('0xc4'):_0x24dc25['childModel']=_0x8b2c('0xc5');break;case _0x8b2c('0xc6'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xc7');break;case _0x8b2c('0xc8'):_0x24dc25['childModel']='SugarcrmAccount';break;case _0x8b2c('0xc9'):_0x24dc25[_0x8b2c('0x72')]='DeskAccount';break;case _0x8b2c('0xca'):_0x24dc25[_0x8b2c('0x72')]='ZohoAccount';break;case _0x8b2c('0xcb'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xa7');break;case _0x8b2c('0xcc'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xcd');break;case _0x8b2c('0xce'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xcf');break;case _0x8b2c('0xd0'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0x66');break;case _0x8b2c('0xd1'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xd2');break;case _0x8b2c('0xd3'):_0x24dc25[_0x8b2c('0x72')]='Pause';break;case _0x8b2c('0xd4'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xd5');break;case _0x8b2c('0xd6'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xd7');break;case _0x8b2c('0xd8'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0x83');break;case _0x8b2c('0xd9'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xda');break;case _0x8b2c('0xdb'):_0x24dc25['childModel']='Trigger';break;case _0x8b2c('0xdc'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xdd');break;case _0x8b2c('0xde'):_0x24dc25['childModel']=_0x8b2c('0xdf');break;case _0x8b2c('0xe0'):_0x24dc25[_0x8b2c('0x72')]=_0x8b2c('0xe1');break;case _0x8b2c('0xe2'):_0x24dc25['childModel']='AnalyticExtractedReport';_0x24dc25['parentSections']=[{'name':'Reports','field':'id','foreignKey':_0x8b2c('0x7e')}];break;case _0x8b2c('0xe3'):_0x24dc25['childModel']='AnalyticMetric';break;default:return _0x24dc25;}return _0x24dc25;} \ No newline at end of file +var _0x6404=['offset','limit','set','reject','update','destroy','then','error','stack','name','send','rawAttributes','key','model','map','query','keys','filters','intersection','fields','attributes','length','order','sort','filter','where','merge','type','options','UserProfile','includeAll','include','rows','catch','params','create','body','clone','get','omit','createdAt','crudPermissions','updatedAt','sequelize','transaction','UserProfileSection','findAll','each','autoAssociation','sectionId','userProfileId','Resources','find','describe','addSections','push','removeSections','ids','enabled','isEmpty','includes','subsections','some','findOne','Dashboard','forEach','UserProfileResource','resourceId','Plugin','addResources','bulkCreate','removeResources','section','undefined','Sequelize','mergeResources','childModel','ValidationError','Invalid\x20section\x20\x27','parentSections','ignore','all','hasOwnProperty','nolimit','pick','VIRTUAL','field','AnalyticExtractedReport','associatedResources','foreignKey','reportType','default','DefaultReports','custom','CustomReports','CmContact','Tags','tag','Tag','ThroughTags','value','toLowerCase','SquareProject','odbc','SquareProjects','projectName','projects','JscriptyProject','contacts','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','FaxQueue','faxaccounts','FaxAccount','inboundroutes','internalroutes','outboundroutes','contexts','voicemails','VoiceMail','VoiceRecording','membername','User','role','agent','telephone','queue','VoiceQueue','inbound','QueueCampaigns','outbound','VoiceMusicOnHold','chanspies','voiceprefixes','ivrcampaigns','Campaign','MailQueue','MailAccount','MailSubstatus','openchannelqueues','OpenchannelQueue','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','agents','telephones','Users','admin','user','Agents','Telephones','salesforceaccounts','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','Disposition','Interval','pauses','Schedule','sounds','Sound','templates','Trigger','trunks','Variable','Reports','metrics','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','end','json','count'];(function(_0x3b17a2,_0x10012c){var _0xdf0499=function(_0x16e867){while(--_0x16e867){_0x3b17a2['push'](_0x3b17a2['shift']());}};_0xdf0499(++_0x10012c);}(_0x6404,0x19a));var _0x4640=function(_0x493c6c,_0x36396c){_0x493c6c=_0x493c6c-0x0;var _0x9dce74=_0x6404[_0x493c6c];return _0x9dce74;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4640('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x4640('0x1'));var jsonpatch=require(_0x4640('0x2'));var rp=require(_0x4640('0x3'));var moment=require('moment');var BPromise=require(_0x4640('0x4'));var Mustache=require(_0x4640('0x5'));var util=require('util');var path=require(_0x4640('0x6'));var sox=require(_0x4640('0x7'));var csv=require(_0x4640('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4640('0x9'));var squel=require('squel');var crypto=require(_0x4640('0xa'));var jsforce=require(_0x4640('0xb'));var deskjs=require(_0x4640('0xc'));var toCsv=require('to-csv');var querystring=require(_0x4640('0xd'));var Papa=require(_0x4640('0xe'));var Redis=require(_0x4640('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4640('0x10'));var as=require(_0x4640('0x11'));var hardwareService=require(_0x4640('0x12'));var logger=require(_0x4640('0x13'))(_0x4640('0x14'));var utils=require(_0x4640('0x15'));var config=require('../../config/environment');var db=require(_0x4640('0x16'))['db'];config[_0x4640('0x17')]=_[_0x4640('0x18')](config[_0x4640('0x17')],{'host':_0x4640('0x19'),'port':0x18eb});var socket=require(_0x4640('0x1a'))(new Redis(config[_0x4640('0x17')]));require(_0x4640('0x1b'))[_0x4640('0x1c')](socket);function respondWithStatusCode(_0x408312,_0xe4f75){_0xe4f75=_0xe4f75||0xcc;return function(_0x430b5a){if(_0x430b5a){return _0x408312[_0x4640('0x1d')](_0xe4f75);}return _0x408312[_0x4640('0x1e')](_0xe4f75)[_0x4640('0x1f')]();};}function respondWithResult(_0x59dd17,_0x3f1111){_0x3f1111=_0x3f1111||0xc8;return function(_0xb50b61){if(_0xb50b61){return _0x59dd17['status'](_0x3f1111)[_0x4640('0x20')](_0xb50b61);}};}function respondWithFilteredResult(_0x2ad70d,_0x3121c9){return function(_0x4e288f){if(_0x4e288f){var _0x16f914=_0x4e288f[_0x4640('0x21')],_0x179f28=_0x3121c9[_0x4640('0x22')],_0x30360b=_0x3121c9[_0x4640('0x22')]+_0x3121c9[_0x4640('0x23')],_0x25810d;if(_0x30360b>=_0x16f914){_0x30360b=_0x16f914;_0x25810d=0xc8;}else{_0x25810d=0xce;}_0x2ad70d[_0x4640('0x1e')](_0x25810d);return _0x2ad70d[_0x4640('0x24')]('Content-Range',_0x179f28+'-'+_0x30360b+'/'+_0x16f914)[_0x4640('0x20')](_0x4e288f);}return null;};}function patchUpdates(_0x5c3ffa){return function(_0x5afade){try{jsonpatch['apply'](_0x5afade,_0x5c3ffa,!![]);}catch(_0x2a125f){return BPromise[_0x4640('0x25')](_0x2a125f);}return _0x5afade['save']();};}function saveUpdates(_0x3e9665,_0x973867){return function(_0x50eda6){if(_0x50eda6){return _0x50eda6[_0x4640('0x26')](_0x3e9665)['then'](function(_0x3593a5){return _0x3593a5;});}return null;};}function removeEntity(_0x42a7d1,_0x1e8614){return function(_0x2b194c){if(_0x2b194c){return _0x2b194c[_0x4640('0x27')]()[_0x4640('0x28')](function(){_0x42a7d1['status'](0xcc)[_0x4640('0x1f')]();});}};}function handleEntityNotFound(_0x337ec9,_0x6a43f4){return function(_0x3f1b3b){if(!_0x3f1b3b){_0x337ec9['sendStatus'](0x194);}return _0x3f1b3b;};}function handleError(_0x1d080f,_0x494cc3){_0x494cc3=_0x494cc3||0x1f4;return function(_0x18bed4){logger[_0x4640('0x29')](_0x18bed4[_0x4640('0x2a')]);if(_0x18bed4[_0x4640('0x2b')]){delete _0x18bed4[_0x4640('0x2b')];}_0x1d080f[_0x4640('0x1e')](_0x494cc3)[_0x4640('0x2c')](_0x18bed4);};}exports['index']=function(_0x47df67,_0x465b89){var _0x84bc32={},_0xe5dae2={},_0x12bf29={'count':0x0,'rows':[]};var _0x35801d=_['map'](db['UserProfile'][_0x4640('0x2d')],function(_0x402f00){return{'name':_0x402f00['fieldName'],'type':_0x402f00['type'][_0x4640('0x2e')]};});_0xe5dae2[_0x4640('0x2f')]=_[_0x4640('0x30')](_0x35801d,_0x4640('0x2b'));_0xe5dae2[_0x4640('0x31')]=_[_0x4640('0x32')](_0x47df67[_0x4640('0x31')]);_0xe5dae2[_0x4640('0x33')]=_[_0x4640('0x34')](_0xe5dae2['model'],_0xe5dae2[_0x4640('0x31')]);_0x84bc32['attributes']=_[_0x4640('0x34')](_0xe5dae2[_0x4640('0x2f')],qs[_0x4640('0x35')](_0x47df67[_0x4640('0x31')][_0x4640('0x35')]));_0x84bc32[_0x4640('0x36')]=_0x84bc32[_0x4640('0x36')][_0x4640('0x37')]?_0x84bc32[_0x4640('0x36')]:_0xe5dae2[_0x4640('0x2f')];if(!_0x47df67[_0x4640('0x31')]['hasOwnProperty']('nolimit')){_0x84bc32[_0x4640('0x23')]=qs[_0x4640('0x23')](_0x47df67[_0x4640('0x31')][_0x4640('0x23')]);_0x84bc32[_0x4640('0x22')]=qs['offset'](_0x47df67[_0x4640('0x31')][_0x4640('0x22')]);}_0x84bc32[_0x4640('0x38')]=qs[_0x4640('0x39')](_0x47df67[_0x4640('0x31')]['sort']);_0x84bc32['where']=qs[_0x4640('0x33')](_['pick'](_0x47df67['query'],_0xe5dae2[_0x4640('0x33')]));if(_0x47df67['query'][_0x4640('0x3a')]){_0x84bc32[_0x4640('0x3b')]=_[_0x4640('0x3c')](_0x84bc32[_0x4640('0x3b')],{'$or':_[_0x4640('0x30')](_0x35801d,function(_0x2e9115){if(_0x2e9115[_0x4640('0x3d')]!=='VIRTUAL'){var _0x1ca50f={};_0x1ca50f[_0x2e9115[_0x4640('0x2b')]]={'$like':'%'+_0x47df67[_0x4640('0x31')]['filter']+'%'};return _0x1ca50f;}})});}_0x84bc32=_[_0x4640('0x3c')]({},_0x84bc32,_0x47df67[_0x4640('0x3e')]);var _0x2ae932={'where':_0x84bc32[_0x4640('0x3b')]};return db[_0x4640('0x3f')][_0x4640('0x21')](_0x2ae932)['then'](function(_0x3e6d2a){_0x12bf29['count']=_0x3e6d2a;if(_0x47df67[_0x4640('0x31')][_0x4640('0x40')]){_0x84bc32[_0x4640('0x41')]=[{'all':!![]}];}return db['UserProfile']['findAll'](_0x84bc32);})['then'](function(_0x583cbd){_0x12bf29[_0x4640('0x42')]=_0x583cbd;return _0x12bf29;})['then'](respondWithFilteredResult(_0x465b89,_0x84bc32))[_0x4640('0x43')](handleError(_0x465b89,null));};exports['show']=function(_0x51d27f,_0x891c7b){var _0x36f9df={'raw':![],'where':{'id':_0x51d27f[_0x4640('0x44')]['id']}},_0x15fabd={};_0x15fabd[_0x4640('0x2f')]=_[_0x4640('0x32')](db[_0x4640('0x3f')][_0x4640('0x2d')]);_0x15fabd[_0x4640('0x31')]=_[_0x4640('0x32')](_0x51d27f['query']);_0x15fabd[_0x4640('0x33')]=_['intersection'](_0x15fabd['model'],_0x15fabd[_0x4640('0x31')]);_0x36f9df[_0x4640('0x36')]=_[_0x4640('0x34')](_0x15fabd[_0x4640('0x2f')],qs['fields'](_0x51d27f[_0x4640('0x31')][_0x4640('0x35')]));_0x36f9df['attributes']=_0x36f9df['attributes']['length']?_0x36f9df['attributes']:_0x15fabd['model'];if(_0x51d27f['query']['includeAll']){_0x36f9df[_0x4640('0x41')]=[{'all':!![]}];}_0x36f9df=_['merge']({},_0x36f9df,_0x51d27f[_0x4640('0x3e')]);return db[_0x4640('0x3f')]['find'](_0x36f9df)[_0x4640('0x28')](handleEntityNotFound(_0x891c7b,null))[_0x4640('0x28')](respondWithResult(_0x891c7b,null))['catch'](handleError(_0x891c7b,null));};exports['create']=function(_0x50c305,_0x2842bb){return db[_0x4640('0x3f')][_0x4640('0x45')](_0x50c305[_0x4640('0x46')],{})['then'](respondWithResult(_0x2842bb,0xc9))[_0x4640('0x43')](handleError(_0x2842bb,null));};exports[_0x4640('0x47')]=function(_0x319e7d,_0x286dd4){var _0x4679a9={'where':{'id':_0x319e7d[_0x4640('0x44')]['id']}},_0x559905={};_0x559905[_0x4640('0x2f')]=_['keys'](db[_0x4640('0x3f')][_0x4640('0x2d')]);_0x4679a9['attributes']=_[_0x4640('0x34')](_0x559905[_0x4640('0x2f')],qs['fields'](_0x319e7d[_0x4640('0x31')][_0x4640('0x35')]));_0x4679a9[_0x4640('0x36')]=_0x4679a9[_0x4640('0x36')]['length']?_0x4679a9[_0x4640('0x36')]:_0x559905[_0x4640('0x2f')];if(_0x319e7d[_0x4640('0x31')]['includeAll']){_0x4679a9['include']=[{'all':!![]}];}_0x4679a9=_[_0x4640('0x3c')]({},_0x4679a9,_0x319e7d[_0x4640('0x3e')]);return db[_0x4640('0x3f')]['find'](_0x4679a9)[_0x4640('0x28')](handleEntityNotFound(_0x286dd4,null))['then'](function(_0x58d07d){if(_0x58d07d){var _0x437ada=_0x58d07d[_0x4640('0x48')]({'plain':!![]});_0x437ada=qs[_0x4640('0x49')](_0x437ada,['id',_0x4640('0x4a'),'updatedAt',_0x4640('0x4b')]);_0x319e7d[_0x4640('0x46')]=_['omit'](_0x319e7d[_0x4640('0x46')],['id',_0x4640('0x4a'),_0x4640('0x4c')]);return db[_0x4640('0x4d')][_0x4640('0x4e')](function(_0x4f9613){return db[_0x4640('0x3f')][_0x4640('0x45')](_['merge'](_0x437ada,_0x319e7d[_0x4640('0x46')]),{'include':_0x319e7d[_0x4640('0x31')][_0x4640('0x40')]?[{'all':!![]}]:undefined,'transaction':_0x4f9613})['then'](function(_0x461411){var _0x475b30=_0x461411[_0x4640('0x48')]({'plain':!![]});return db[_0x4640('0x4f')][_0x4640('0x50')]({'where':{'userProfileId':_0x319e7d[_0x4640('0x44')]['id']},'raw':!![]})['then'](function(_0x813c31){if(_0x813c31){return BPromise[_0x4640('0x51')](_0x813c31,function(_0x11ac5c){return new BPromise(function(_0x502422,_0x12ae59){if(_0x11ac5c[_0x4640('0x52')]===null||_0x11ac5c[_0x4640('0x52')]===0x1)_0x502422(null);return db['UserProfileResource'][_0x4640('0x50')]({'where':{'sectionId':_0x11ac5c['id']},'raw':!![]})[_0x4640('0x28')](function(_0x264e12){var _0x3ea508=_[_0x4640('0x30')](_0x264e12,function(_0x534e7c){return qs[_0x4640('0x49')](_0x534e7c,['id','createdAt',_0x4640('0x4c'),_0x4640('0x53')]);});_0x502422(_0x3ea508);})[_0x4640('0x43')](function(_0x1df9c2){_0x12ae59(_0x1df9c2);});})[_0x4640('0x28')](function(_0x342225){var _0x1b8830=qs['omit'](_0x11ac5c,['id',_0x4640('0x4a'),_0x4640('0x4c')]);_0x1b8830[_0x4640('0x54')]=_0x475b30['id'];if(_0x342225)_0x1b8830[_0x4640('0x55')]=_0x342225;return _0x1b8830;})[_0x4640('0x28')](function(_0xed48a5){return db['UserProfileSection']['create'](_0xed48a5,{'include':[{'model':db['UserProfileResource'],'as':_0x4640('0x55')}],'raw':!![],'transaction':_0x4f9613});});})[_0x4640('0x28')](function(){return _0x475b30;});}});});});}})[_0x4640('0x28')](respondWithResult(_0x286dd4,0xc9))['catch'](handleError(_0x286dd4,null));};exports[_0x4640('0x26')]=function(_0x265ce0,_0x595169){if(_0x265ce0[_0x4640('0x46')]['id']){delete _0x265ce0[_0x4640('0x46')]['id'];}return db[_0x4640('0x3f')][_0x4640('0x56')]({'where':{'id':_0x265ce0[_0x4640('0x44')]['id']}})[_0x4640('0x28')](handleEntityNotFound(_0x595169,null))[_0x4640('0x28')](saveUpdates(_0x265ce0['body'],null))[_0x4640('0x28')](respondWithResult(_0x595169,null))[_0x4640('0x43')](handleError(_0x595169,null));};exports['destroy']=function(_0x5b9ad4,_0x2db008){return db[_0x4640('0x3f')]['find']({'where':{'id':_0x5b9ad4['params']['id']}})[_0x4640('0x28')](handleEntityNotFound(_0x2db008,null))['then'](removeEntity(_0x2db008,null))['catch'](handleError(_0x2db008,null));};exports[_0x4640('0x57')]=function(_0x10b7d8,_0x50d71d){return db[_0x4640('0x3f')][_0x4640('0x57')]()[_0x4640('0x28')](respondWithResult(_0x50d71d,null))[_0x4640('0x43')](handleError(_0x50d71d,null));};exports[_0x4640('0x58')]=function(_0x282ece,_0x2df8eb){var _0x49927=_0x282ece[_0x4640('0x46')];return db[_0x4640('0x3f')][_0x4640('0x56')]({'where':{'id':_0x282ece[_0x4640('0x44')]['id']}})[_0x4640('0x28')](handleEntityNotFound(_0x2df8eb,null))['then'](function(_0x3cd5e2){if(_0x3cd5e2){return db['sequelize'][_0x4640('0x4e')](function(_0x287828){return db[_0x4640('0x4f')][_0x4640('0x27')]({'where':{'userProfileId':_0x282ece[_0x4640('0x44')]['id'],'sectionId':_['map'](_0x49927,function(_0x569674){return _0x569674[_0x4640('0x53')];})},'transaction':_0x287828})[_0x4640('0x28')](function(){var _0x256642=_[_0x4640('0x30')](_0x49927,function(_0x2e9d74){_0x2e9d74[_0x4640('0x54')]=_0x282ece['params']['id'];return _0x2e9d74;});var _0x57624c=[];return BPromise[_0x4640('0x51')](_0x256642,function(_0x423c8f){return db['UserProfileSection']['create'](_0x423c8f,{'include':[{'model':db['UserProfileResource'],'as':_0x4640('0x55')}],'raw':!![],'transaction':_0x287828})[_0x4640('0x28')](function(_0x45d6ec){_0x57624c[_0x4640('0x59')](_0x45d6ec[_0x4640('0x48')]({'plain':!![]}));});})[_0x4640('0x28')](function(){return _0x57624c;});});});}})['then'](function(_0x57ff89){return _0x57ff89;})[_0x4640('0x28')](respondWithResult(_0x2df8eb,null))[_0x4640('0x43')](handleError(_0x2df8eb,null));};exports[_0x4640('0x5a')]=function(_0xb86550,_0x4c2b65){var _0x1d183e;return db[_0x4640('0x3f')]['find']({'where':{'id':_0xb86550[_0x4640('0x44')]['id']},'attributes':['id',_0x4640('0x2b')]})[_0x4640('0x28')](handleEntityNotFound(_0x4c2b65,null))['then'](function(_0x463e93){if(_0x463e93){_0x1d183e=_0x463e93;return db[_0x4640('0x4f')][_0x4640('0x27')]({'where':{'userProfileId':_0xb86550[_0x4640('0x44')]['id'],'sectionId':_0xb86550[_0x4640('0x31')][_0x4640('0x5b')]}});}})[_0x4640('0x28')](function(){return _0x1d183e;})[_0x4640('0x28')](respondWithStatusCode(_0x4c2b65,null))['catch'](handleError(_0x4c2b65,null));};exports['getSections']=function(_0x28e8ff,_0x32b949){var _0x203ac2=[];var _0x3688c3=[];return db[_0x4640('0x4f')][_0x4640('0x50')]({'where':{'userProfileId':_0x28e8ff[_0x4640('0x44')]['id']},'raw':!![]})['then'](function(_0x2c2b3b){_0x203ac2=_[_0x4640('0x3a')](_0x2c2b3b,function(_0x59486c){return _0x59486c[_0x4640('0x5c')]===0x1;});if(!_[_0x4640('0x5d')](_0x203ac2)){return _[_0x4640('0x30')](_0x203ac2,function(_0x27953a){return _0x27953a[_0x4640('0x53')];});}else{return;}})[_0x4640('0x28')](function(_0x374c65){if(_0x374c65)_0x3688c3=_0x374c65;if(_[_0x4640('0x5e')](_0x3688c3,0x64)){var _0x53cec5=_[_0x4640('0x56')](_0x203ac2,{'sectionId':0x64});return hasDefaultDashboard(_0x53cec5)[_0x4640('0x28')](function(_0x3a9989){return _[_0x4640('0x30')](_0x203ac2,function(_0x1d1691){if(_0x1d1691[_0x4640('0x53')]===0x64){_0x1d1691[_0x4640('0x5f')]=_0x3a9989;}return _0x1d1691;});});}else{return;}})[_0x4640('0x28')](function(_0x5ae10d){if(_0x5ae10d)_0x203ac2=_0x5ae10d;if(_[_0x4640('0x5e')](_0x3688c3,0x3eb)||_[_0x4640('0x60')](_0x203ac2,{'enabled':![],'sectionId':0x3eb})){var _0x81b673=_['find'](_0x203ac2,{'sectionId':0x3eb});return getCustomDashboards(_0x81b673)['then'](function(_0x4243b1){return _[_0x4640('0x30')](_0x203ac2,function(_0x368599){if(_0x368599[_0x4640('0x53')]===0x3eb){_0x368599[_0x4640('0x5f')]=_0x4243b1;}return _0x368599;});});}else{return;}})[_0x4640('0x28')](function(_0x4ab14a){if(_0x4ab14a)_0x203ac2=_0x4ab14a;if(_[_0x4640('0x5e')](_0x3688c3,0x709)||_[_0x4640('0x60')](_0x203ac2,{'enabled':![],'sectionId':0x709})){var _0x483bf1=_['find'](_0x203ac2,{'sectionId':0x709});return getPlugins(_0x483bf1)[_0x4640('0x28')](function(_0x145074){return _[_0x4640('0x30')](_0x203ac2,function(_0x4691d6){if(_0x4691d6['sectionId']===0x709){_0x4691d6['subsections']=_0x145074;}return _0x4691d6;});});}else{return;}})[_0x4640('0x28')](function(_0x2e39c1){if(_0x2e39c1)_0x203ac2=_0x2e39c1;return _0x203ac2;})[_0x4640('0x28')](respondWithResult(_0x32b949,null))[_0x4640('0x43')](handleError(_0x32b949,null));};function hasDefaultDashboard(_0x1a704d){var _0x2845e3=[0x65];return new BPromise(function(_0x573e4e,_0x11a860){try{if(_0x1a704d[_0x4640('0x52')]){_0x573e4e(_0x2845e3);}else{return db['UserProfileResource'][_0x4640('0x61')]({'where':{'sectionId':_0x1a704d['id']},'raw':!![]})[_0x4640('0x28')](function(_0x256be0){if(_0x256be0){_0x573e4e(_0x2845e3);}});}}catch(_0x51cab1){_0x11a860(_0x51cab1);}});}function getCustomDashboards(_0x5203bb){var _0x597fac=[];return new BPromise(function(_0x2c2729,_0x1b35b7){try{if(_0x5203bb[_0x4640('0x52')]){return db[_0x4640('0x62')]['findAll']({'raw':!![]})[_0x4640('0x28')](function(_0xf88c85){_0xf88c85[_0x4640('0x63')](function(_0x1ad1bc){_0x597fac[_0x4640('0x59')](_0x1ad1bc['id']+0x1869f);});_0x2c2729(_0x597fac);});}else{return db[_0x4640('0x64')]['findAll']({'where':{'sectionId':_0x5203bb['id']},'raw':!![]})[_0x4640('0x28')](function(_0x58abb2){_0x58abb2[_0x4640('0x63')](function(_0x4ef7db){_0x597fac['push'](_0x4ef7db[_0x4640('0x65')]+0x1869f);});_0x2c2729(_0x597fac);});}}catch(_0x34285c){_0x1b35b7(_0x34285c);}});}function getPlugins(_0xf95a64){var _0x59d0fe=[];return new BPromise(function(_0x45af48,_0x2d1547){try{if(_0xf95a64[_0x4640('0x52')]){return db[_0x4640('0x66')][_0x4640('0x50')]({'raw':!![]})[_0x4640('0x28')](function(_0x40b9bb){_0x40b9bb['forEach'](function(_0x51a8da){_0x59d0fe['push'](_0x51a8da['id']+0x15b38);});_0x45af48(_0x59d0fe);});}else{return db[_0x4640('0x64')][_0x4640('0x50')]({'where':{'sectionId':_0xf95a64['id']},'raw':!![]})[_0x4640('0x28')](function(_0x293937){_0x293937[_0x4640('0x63')](function(_0x2b4aeb){_0x59d0fe[_0x4640('0x59')](_0x2b4aeb[_0x4640('0x65')]+0x15b38);});_0x45af48(_0x59d0fe);});}}catch(_0x26b8e0){_0x2d1547(_0x26b8e0);}});}exports[_0x4640('0x67')]=function(_0x848d9c,_0xa5bcff){return db['UserProfile'][_0x4640('0x56')]({'where':{'id':_0x848d9c['params']['id']}})['then'](handleEntityNotFound(_0xa5bcff,null))[_0x4640('0x28')](function(_0x2a6aea){if(_0x2a6aea){return db[_0x4640('0x4d')]['transaction'](function(_0x21370b){return db[_0x4640('0x4f')][_0x4640('0x50')]({'where':{'userProfileId':_0x848d9c[_0x4640('0x44')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x3e9b0d){if(_0x3e9b0d){return db[_0x4640('0x4f')][_0x4640('0x27')]({'where':{'userProfileId':_0x848d9c[_0x4640('0x44')]['id'],'id':_[_0x4640('0x30')](_0x3e9b0d,function(_0x25fe37){return _0x25fe37['id'];})},'transaction':_0x21370b});}})[_0x4640('0x28')](function(_0x5d4a3f){var _0x42ae41=_[_0x4640('0x30')](_0x848d9c['body'],function(_0x26ce23){_0x26ce23[_0x4640('0x54')]=_0x848d9c[_0x4640('0x44')]['id'];return _0x26ce23;});return db['UserProfileSection'][_0x4640('0x68')](_0x42ae41,{'raw':!![],'transaction':_0x21370b});})[_0x4640('0x28')](function(_0x109b8b){var _0x336595=_['filter'](_[_0x4640('0x30')](_0x109b8b,function(_0x2c626b){return _0x2c626b[_0x4640('0x48')]({'plain':!![]});}),{'includeAll':![]});if(_0x336595){return db[_0x4640('0x4f')][_0x4640('0x50')]({'where':{'userProfileId':_0x848d9c['params']['id'],'sectionId':_['map'](_0x336595,function(_0xb1bf45){return _0xb1bf45['sectionId'];})},'attributes':['id',_0x4640('0x53')],'raw':!![]})[_0x4640('0x28')](function(_0x1a7aa2){var _0x31a524=_[_0x4640('0x30')](_0x848d9c[_0x4640('0x46')],function(_0x291dbd){_0x291dbd[_0x4640('0x54')]=_0x848d9c['params']['id'];return _0x291dbd;});return db[_0x4640('0x64')][_0x4640('0x68')](_0x31a524,{'raw':!![],'transaction':_0x21370b});});}})[_0x4640('0x43')](handleError(_0xa5bcff,null));});}})[_0x4640('0x28')](function(_0x22154a){var _0x27c73d=_[_0x4640('0x30')](_0x22154a,function(_0x4b1cee){return _0x4b1cee[_0x4640('0x48')]({'plain':!![]});});})[_0x4640('0x28')](respondWithResult(_0xa5bcff,null))[_0x4640('0x43')](handleError(_0xa5bcff,null));};exports[_0x4640('0x69')]=function(_0xba2537,_0x2efb59,_0x35567f){return db[_0x4640('0x3f')][_0x4640('0x56')]({'where':{'id':_0xba2537['params']['id']}})[_0x4640('0x28')](handleEntityNotFound(_0x2efb59,null))[_0x4640('0x28')](function(_0x59ebbf){if(_0x59ebbf){return _0x59ebbf['removeResources'](_0xba2537[_0x4640('0x31')][_0x4640('0x5b')]);}})[_0x4640('0x28')](respondWithStatusCode(_0x2efb59,null))[_0x4640('0x43')](handleError(_0x2efb59,null));};exports['getResources']=function(_0x46b7af,_0x240cc1){var _0x13c6bd={'raw':![],'where':{}};var _0x488ce5={};var _0x4ac24c={'count':0x0,'rows':[]};var _0x12d13b=_0x46b7af[_0x4640('0x31')][_0x4640('0x6a')];if(typeof _0x12d13b===_0x4640('0x6b')){throw new db[(_0x4640('0x6c'))]['ValidationError']('Unknown\x20section');}var _0x5bb33b=_0x46b7af[_0x4640('0x31')][_0x4640('0x6d')]||![];var _0x1a5d64=getQueryModels(_0x12d13b,_0x5bb33b);if(typeof _0x1a5d64[_0x4640('0x6e')]===_0x4640('0x6b')){throw new db[(_0x4640('0x6c'))][(_0x4640('0x6f'))](_0x4640('0x70')+_0x12d13b+'\x27');}var _0x5901ef=[];if(!_[_0x4640('0x5d')](_0x1a5d64['parentSections'])){_0x5901ef=_0x1a5d64[_0x4640('0x71')];}else{_0x5901ef=[{'name':_0x12d13b}];}return db[_0x4640('0x3f')]['findOne']({'where':{'id':_0x46b7af['params']['id']}})[_0x4640('0x28')](handleEntityNotFound(_0x240cc1,null))['then'](function(_0x36aaf9){if(_0x36aaf9){var _0x7961f=[];for(var _0x441c12=0x0;_0x441c12<_0x5901ef[_0x4640('0x37')];_0x441c12++){_0x7961f[_0x4640('0x59')](db[_0x4640('0x4f')][_0x4640('0x61')]({'where':{'userProfileId':_0x36aaf9['id'],'name':_0x5901ef[_0x441c12][_0x4640('0x2b')]},'raw':!![]}));}return BPromise['all'](_0x7961f);}})[_0x4640('0x28')](function(_0x323c78){var _0x50deaa=_[_0x4640('0x3a')](_0x323c78,function(_0x2285c8){return _0x2285c8?_0x2285c8:undefined;});var _0x35f304=_[_0x4640('0x3a')](_0x5901ef,[_0x4640('0x72'),!![]]);var _0x42e822=_['isEmpty'](_0x50deaa)&&_[_0x4640('0x5d')](_0x35f304)?null:_['union'](_0x35f304,_0x50deaa);if(_0x42e822){var _0x20dc29=[];for(var _0x550004=0x0;_0x550004<_0x42e822[_0x4640('0x37')];_0x550004++){var _0x47cc75=_[_0x4640('0x56')](_0x5901ef,function(_0x39b09f){return _0x42e822[_0x550004]?_0x39b09f[_0x4640('0x2b')]===_0x42e822[_0x550004][_0x4640('0x2b')]:null;});if(_0x47cc75){if(_0x42e822[_0x550004][_0x4640('0x72')]){_0x20dc29[_0x4640('0x59')](getAllResources(_0x1a5d64[_0x4640('0x6e')],_0x42e822[_0x550004]));}else{if(!_0x42e822[_0x550004][_0x4640('0x52')]){_0x20dc29[_0x4640('0x59')](getAllowedResources(_0x47cc75,_0x42e822[_0x550004],_0x1a5d64['childModel']));}else{if(_0x47cc75['model']){_0x20dc29[_0x4640('0x59')](getAllFilteredResources(_0x47cc75,_0x42e822[_0x550004]));}}}}}return BPromise[_0x4640('0x73')](_0x20dc29);}else{return null;}})['then'](function(_0x33fe01){var _0x408daf=_0x33fe01;var _0xe4ba34=null;if(_0x408daf){_0xe4ba34=_0x408daf[_0x4640('0x37')]===0x1?_0x408daf[0x0]:null;}if(_0xe4ba34||_0x408daf){var _0x3a0aa3=db[_0x1a5d64[_0x4640('0x6e')]][_0x4640('0x2d')];_0x488ce5['model']=_[_0x4640('0x32')](_0x3a0aa3);_0x488ce5[_0x4640('0x31')]=_[_0x4640('0x32')](_0x46b7af[_0x4640('0x31')]);_0x488ce5[_0x4640('0x33')]=_[_0x4640('0x34')](_0x488ce5[_0x4640('0x2f')],_0x488ce5[_0x4640('0x31')]);_0x13c6bd[_0x4640('0x36')]=_[_0x4640('0x34')](_0x488ce5[_0x4640('0x2f')],qs[_0x4640('0x35')](_0x46b7af[_0x4640('0x31')][_0x4640('0x35')]));_0x13c6bd[_0x4640('0x36')]=_0x13c6bd[_0x4640('0x36')][_0x4640('0x37')]?_0x13c6bd[_0x4640('0x36')]:_0x488ce5['model'];if(!_0x46b7af[_0x4640('0x31')][_0x4640('0x74')](_0x4640('0x75'))){_0x13c6bd[_0x4640('0x23')]=qs[_0x4640('0x23')](_0x46b7af['query'][_0x4640('0x23')]);_0x13c6bd[_0x4640('0x22')]=qs['offset'](_0x46b7af[_0x4640('0x31')][_0x4640('0x22')]);}_0x13c6bd[_0x4640('0x38')]=qs[_0x4640('0x39')](_0x46b7af[_0x4640('0x31')][_0x4640('0x39')]);_0x13c6bd[_0x4640('0x3b')]=qs['filters'](_[_0x4640('0x76')](_0x46b7af[_0x4640('0x31')],_0x488ce5['filters']));if(_0x46b7af[_0x4640('0x31')][_0x4640('0x3a')]){_0x13c6bd['where']=_[_0x4640('0x3c')](_0x13c6bd[_0x4640('0x3b')],{'$or':_[_0x4640('0x30')](_0x3a0aa3,function(_0x1b2347){if(_0x1b2347[_0x4640('0x3d')][_0x4640('0x2e')]!==_0x4640('0x77')){var _0x1ce17b={};_0x1ce17b[_0x1b2347[_0x4640('0x78')]]={'$like':'%'+_0x46b7af[_0x4640('0x31')][_0x4640('0x3a')]+'%'};return _0x1ce17b;}})});}var _0x2360b1=[];if(_0xe4ba34){var _0x12101f=_[_0x4640('0x56')](_0x5901ef,[_0x4640('0x2b'),_0xe4ba34['name']]);if(_0x12101f[_0x4640('0x78')]){var _0x58d2d3={};if(_0x1a5d64[_0x4640('0x6e')]===_0x4640('0x79')){_0x58d2d3[_0x12101f['foreignKey']]=_[_0x4640('0x30')](_0xe4ba34[_0x4640('0x7a')],'id');}else{_0x58d2d3[_0x12101f[_0x4640('0x7b')]]=_0xe4ba34['associatedResources'];}_0x2360b1[_0x4640('0x59')](_0x58d2d3);}else{_0x13c6bd[_0x4640('0x3b')]['id']=_0xe4ba34[_0x4640('0x7a')];}}else{for(var _0x16364a=0x0;_0x16364a<_0x408daf['length'];_0x16364a++){var _0x12101f=_['find'](_0x5901ef,[_0x4640('0x2b'),_0x408daf[_0x16364a][_0x4640('0x2b')]]);if(_0x12101f[_0x4640('0x78')]){var _0x58d2d3={};_0x58d2d3[_0x12101f[_0x4640('0x7b')]]=_0x408daf[_0x16364a]['associatedResources'];_0x2360b1[_0x4640('0x59')](_0x58d2d3);}else{if(!_0x13c6bd[_0x4640('0x3b')]['id'])_0x13c6bd[_0x4640('0x3b')]['id']=[];_0x408daf[_0x16364a]['associatedResources'][_0x4640('0x63')](function(_0x2a203b){_0x13c6bd['where']['id'][_0x4640('0x59')](_0x2a203b);});}}}if(!_[_0x4640('0x5d')](_0x2360b1)){_0x13c6bd[_0x4640('0x3b')]=_[_0x4640('0x3c')](_0x13c6bd[_0x4640('0x3b')],{'$and':{'$or':_0x2360b1}});}_0x13c6bd=_[_0x4640('0x3c')]({},_0x13c6bd,_0x46b7af[_0x4640('0x3e')]);if(_0xe4ba34&&!_0xe4ba34[_0x4640('0x52')]&&_0x1a5d64[_0x4640('0x6e')]==='AnalyticExtractedReport'){if(_0x46b7af[_0x4640('0x31')][_0x4640('0x40')]){_0x13c6bd[_0x4640('0x41')]=[{'all':!![]}];}return db[_0x1a5d64[_0x4640('0x6e')]]['findAll'](_0x13c6bd)[_0x4640('0x28')](function(_0x118680){var _0x385272=[];_0x118680[_0x4640('0x63')](function(_0x315a9a){var _0x2981d0;switch(_0x315a9a[_0x4640('0x7c')]){case _0x4640('0x7d'):_0x2981d0=_[_0x4640('0x56')](_0xe4ba34['associatedResources'],function(_0x54b56e){return _0x54b56e['id']===_0x315a9a['reportId']&&_0x54b56e[_0x4640('0x3d')]===_0x4640('0x7e');});break;case _0x4640('0x7f'):_0x2981d0=_[_0x4640('0x56')](_0xe4ba34['associatedResources'],function(_0x4a07c7){return _0x4a07c7['id']===_0x315a9a['reportId']&&_0x4a07c7['type']===_0x4640('0x80');});break;}if(_0x2981d0)_0x385272[_0x4640('0x59')](_0x315a9a);});_0x4ac24c[_0x4640('0x21')]=_0x385272[_0x4640('0x37')];_0x4ac24c[_0x4640('0x42')]=_0x385272;return _0x4ac24c;});}else{return db[_0x1a5d64['childModel']][_0x4640('0x21')]({'where':_0x13c6bd[_0x4640('0x3b')]})[_0x4640('0x28')](function(_0x1ea60a){_0x4ac24c[_0x4640('0x21')]=_0x1ea60a;if(_0x46b7af[_0x4640('0x31')]['includeAll']){if(_0x1a5d64[_0x4640('0x6e')]===_0x4640('0x81')){_0x13c6bd['include']=[{'model':db['Tag'],'as':_0x4640('0x82'),'attributes':['id',_0x4640('0x2b'),'color'],'required':_0x46b7af[_0x4640('0x31')][_0x4640('0x83')]?!![]:![]},{'model':db[_0x4640('0x84')],'as':_0x4640('0x85'),'attributes':['id',_0x4640('0x2b'),'color'],'through':_0x46b7af[_0x4640('0x31')][_0x4640('0x83')]?{'attributes':[],'where':{'TagId':_0x46b7af[_0x4640('0x31')][_0x4640('0x83')]||undefined}}:{},'required':_0x46b7af['query'][_0x4640('0x83')]?!![]:![]}];}else{_0x13c6bd[_0x4640('0x41')]=[{'all':!![]}];}}return db[_0x1a5d64[_0x4640('0x6e')]][_0x4640('0x50')](_0x13c6bd);})[_0x4640('0x28')](function(_0x3f8174){_0x4ac24c['rows']=_0x3f8174;return _0x4ac24c;});}}else{return _0x4ac24c;}})[_0x4640('0x28')](respondWithFilteredResult(_0x240cc1,_0x13c6bd))[_0x4640('0x43')](handleError(_0x240cc1,null));};function getAllResources(_0x29bfad,_0x29c234){return new BPromise(function(_0x1fec97,_0x577a7e){if(_0x29c234){var _0x1d975f=_0x29c234[_0x4640('0x3a')]?{[_0x29c234['filter'][_0x4640('0x78')]]:_0x29c234[_0x4640('0x3a')][_0x4640('0x86')]}:undefined;return db[_0x29bfad]['findAll']({'where':_0x1d975f,'raw':!![]})['then'](function(_0x37b829){_0x29c234[_0x4640('0x7a')]=_[_0x4640('0x30')](_0x37b829,'id');_0x1fec97(_0x29c234);})[_0x4640('0x43')](function(_0x2798ab){_0x577a7e(_0x2798ab);});}else{_0x1fec97(null);}});}function getAllFilteredResources(_0x352758,_0x39b332){return new BPromise(function(_0x4c9823,_0x29c169){var _0x527e48=_0x352758['filter']?{[_0x352758['filter'][_0x4640('0x78')]]:_0x352758[_0x4640('0x3a')]['value']}:undefined;return db[_0x352758['model']]['findAll']({'where':_0x527e48,'raw':!![]})['then'](function(_0x2bd19d){_0x39b332[_0x4640('0x7a')]=_[_0x4640('0x30')](_0x2bd19d,function(_0x2ea3a1){return _0x2ea3a1['name'];});_0x4c9823(_0x39b332);})[_0x4640('0x43')](function(_0x3646ee){_0x29c169(_0x3646ee);});});}function getAllowedResources(_0x4db1fa,_0x105909,_0x18b08c){return new BPromise(function(_0x5d4234,_0x2e6ad4){if(_0x105909){return db[_0x4640('0x64')][_0x4640('0x50')]({'where':{'sectionId':_0x105909['id']},'raw':!![]})['then'](function(_0x1d7c62){if(_0x4db1fa[_0x4640('0x78')]&&_0x4db1fa['field']!=='id'){_0x105909[_0x4640('0x7a')]=_['map'](_0x1d7c62,function(_0x151371){return _0x151371[_0x4db1fa[_0x4640('0x78')]];});}else{if(_0x18b08c===_0x4640('0x79')){_0x105909[_0x4640('0x7a')]=_[_0x4640('0x30')](_0x1d7c62,function(_0x104e29){return{'id':_0x104e29['resourceId'],'type':_0x104e29[_0x4640('0x3d')]};});}else{_0x105909[_0x4640('0x7a')]=_['map'](_0x1d7c62,function(_0xa1a556){return _0xa1a556[_0x4640('0x65')];});}}_0x5d4234(_0x105909);})[_0x4640('0x43')](function(_0x1f8b7a){_0x2e6ad4(_0x1f8b7a);});}else{_0x5d4234(null);}});}function getQueryModels(_0x3625f5,_0x1407dd){var _0x1fb692=_0x3625f5[_0x4640('0x87')]();var _0x107ee5={'childModel':undefined,'parentSections':[]};switch(_0x1fb692){case'squareprojects':_0x107ee5[_0x4640('0x6e')]=_0x4640('0x88');break;case _0x4640('0x89'):_0x107ee5[_0x4640('0x6e')]='SquareOdbc';break;case'squarerecordings':_0x107ee5[_0x4640('0x6e')]='SquareRecording';_0x107ee5[_0x4640('0x71')]=[{'name':_0x4640('0x8a'),'field':_0x4640('0x2b'),'foreignKey':_0x4640('0x8b')}];break;case _0x4640('0x8c'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0x8d');break;case _0x4640('0x8e'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0x81');_0x107ee5['parentSections']=[{'name':'Lists','field':'id','foreignKey':_0x4640('0x8f')}];break;case _0x4640('0x90'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0x91');break;case _0x4640('0x92'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0x93');break;case _0x4640('0x94'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0x95');break;case _0x4640('0x96'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0x97');break;case _0x4640('0x98'):_0x107ee5['childModel']=_0x4640('0x99');break;case'faxqueues':_0x107ee5[_0x4640('0x6e')]=_0x4640('0x9a');break;case _0x4640('0x9b'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0x9c');break;case _0x4640('0x9d'):case _0x4640('0x9e'):case _0x4640('0x9f'):_0x107ee5['childModel']='VoiceExtension';break;case _0x4640('0xa0'):_0x107ee5[_0x4640('0x6e')]='VoiceContext';break;case _0x4640('0xa1'):_0x107ee5['childModel']=_0x4640('0xa2');break;case'voicerecordings':_0x107ee5['childModel']=_0x4640('0xa3');_0x107ee5[_0x4640('0x71')]=[{'name':'Agents','field':_0x4640('0x2b'),'foreignKey':_0x4640('0xa4'),'model':_0x4640('0xa5'),'filter':{'field':_0x4640('0xa6'),'value':[_0x4640('0xa7')]}},{'name':'Telephones','field':'name','foreignKey':_0x4640('0xa4'),'model':_0x4640('0xa5'),'filter':{'field':_0x4640('0xa6'),'value':[_0x4640('0xa8')]}},{'name':'VoiceQueues','field':_0x4640('0x2b'),'foreignKey':_0x4640('0xa9'),'model':_0x4640('0xaa'),'filter':{'field':'type','value':[_0x4640('0xab')]}},{'name':_0x4640('0xac'),'field':'name','foreignKey':'queue','model':_0x4640('0xaa'),'filter':{'field':_0x4640('0x3d'),'value':[_0x4640('0xad')]}}];break;case'musiconholds':_0x107ee5['childModel']=_0x4640('0xae');break;case _0x4640('0xaf'):_0x107ee5[_0x4640('0x6e')]='VoiceChanSpy';break;case _0x4640('0xb0'):_0x107ee5['childModel']='VoicePrefix';break;case _0x4640('0xb1'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xb2');break;case'mailqueues':_0x107ee5['childModel']=_0x4640('0xb3');break;case'mailaccounts':_0x107ee5[_0x4640('0x6e')]=_0x4640('0xb4');break;case'mailsubstatuses':_0x107ee5[_0x4640('0x6e')]=_0x4640('0xb5');break;case _0x4640('0xb6'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xb7');break;case'openchannelaccounts':_0x107ee5[_0x4640('0x6e')]=_0x4640('0xb8');break;case _0x4640('0xb9'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xba');break;case _0x4640('0xbb'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xbc');break;case _0x4640('0xbd'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xbe');break;case _0x4640('0xbf'):case _0x4640('0xc0'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xaa');if(_0x1407dd){_0x107ee5['parentSections']=[{'name':_0x4640('0xc1')},{'name':_0x4640('0xac')}];}break;case'users':case _0x4640('0xc2'):case _0x4640('0xc3'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xa5');if(_0x1407dd){_0x107ee5['parentSections']=[{'name':_0x4640('0xc4'),'filter':{'field':'role','value':[_0x4640('0xc5'),_0x4640('0xc6')]},'ignore':!![]},{'name':_0x4640('0xc7')},{'name':_0x4640('0xc8')}];}break;case'zendeskaccounts':_0x107ee5[_0x4640('0x6e')]='ZendeskAccount';break;case _0x4640('0xc9'):_0x107ee5['childModel']='SalesforceAccount';break;case _0x4640('0xca'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xcb');break;case _0x4640('0xcc'):_0x107ee5['childModel']='SugarcrmAccount';break;case _0x4640('0xcd'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xce');break;case _0x4640('0xcf'):_0x107ee5[_0x4640('0x6e')]='ZohoAccount';break;case _0x4640('0xd0'):_0x107ee5[_0x4640('0x6e')]='User';break;case _0x4640('0xd1'):_0x107ee5['childModel']='CannedAnswer';break;case'dispositions':_0x107ee5['childModel']=_0x4640('0xd2');break;case'customdashboards':_0x107ee5['childModel']=_0x4640('0x62');break;case'intervals':_0x107ee5[_0x4640('0x6e')]=_0x4640('0xd3');break;case _0x4640('0xd4'):_0x107ee5[_0x4640('0x6e')]='Pause';break;case'scheduler':_0x107ee5[_0x4640('0x6e')]=_0x4640('0xd5');break;case _0x4640('0xd6'):_0x107ee5[_0x4640('0x6e')]=_0x4640('0xd7');break;case'tags':_0x107ee5[_0x4640('0x6e')]=_0x4640('0x84');break;case _0x4640('0xd8'):_0x107ee5[_0x4640('0x6e')]='Template';break;case'triggers':_0x107ee5[_0x4640('0x6e')]=_0x4640('0xd9');break;case _0x4640('0xda'):_0x107ee5[_0x4640('0x6e')]='Trunk';break;case'variables':_0x107ee5[_0x4640('0x6e')]=_0x4640('0xdb');break;case'plugins':_0x107ee5[_0x4640('0x6e')]=_0x4640('0x66');break;case'extractedreports':_0x107ee5[_0x4640('0x6e')]=_0x4640('0x79');_0x107ee5[_0x4640('0x71')]=[{'name':_0x4640('0xdc'),'field':'id','foreignKey':'reportId'}];break;case _0x4640('0xdd'):_0x107ee5[_0x4640('0x6e')]='AnalyticMetric';break;default:return _0x107ee5;}return _0x107ee5;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 84730bc..449971f 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 _0x2df8=['UserProfile','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x14ad66,_0x582055){var _0x49f32e=function(_0x12eb22){while(--_0x12eb22){_0x14ad66['push'](_0x14ad66['shift']());}};_0x49f32e(++_0x582055);}(_0x2df8,0xbc));var _0x82df=function(_0x26495c,_0x4c4ecf){_0x26495c=_0x26495c-0x0;var _0x22dbc6=_0x2df8[_0x26495c];return _0x22dbc6;};'use strict';var EventEmitter=require(_0x82df('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x82df('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x82df('0x2')](0x0);var events={'afterCreate':_0x82df('0x3'),'afterUpdate':'update','afterDestroy':_0x82df('0x4')};function emitEvent(_0x103747){return function(_0x462fdc,_0x547cf0,_0x47423e){UserProfileEvents['emit'](_0x103747+':'+_0x462fdc['id'],_0x462fdc);UserProfileEvents[_0x82df('0x5')](_0x103747,_0x462fdc);_0x47423e(null);};}for(var e in events){if(events[_0x82df('0x6')](e)){var event=events[e];UserProfile[_0x82df('0x7')](e,emitEvent(event));}}module[_0x82df('0x8')]=UserProfileEvents; \ No newline at end of file +var _0x1bea=['events','../../mysqldb','UserProfile','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x3ab7d3,_0x5ddb82){var _0xc547df=function(_0x459808){while(--_0x459808){_0x3ab7d3['push'](_0x3ab7d3['shift']());}};_0xc547df(++_0x5ddb82);}(_0x1bea,0x1b8));var _0xa1be=function(_0x47f9bb,_0x12e78a){_0x47f9bb=_0x47f9bb-0x0;var _0x41cf6f=_0x1bea[_0x47f9bb];return _0x41cf6f;};'use strict';var EventEmitter=require(_0xa1be('0x0'));var UserProfile=require(_0xa1be('0x1'))['db'][_0xa1be('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xa1be('0x3')](0x0);var events={'afterCreate':_0xa1be('0x4'),'afterUpdate':_0xa1be('0x5'),'afterDestroy':_0xa1be('0x6')};function emitEvent(_0x592a78){return function(_0x2480aa,_0x5a01bb,_0x4876db){UserProfileEvents[_0xa1be('0x7')](_0x592a78+':'+_0x2480aa['id'],_0x2480aa);UserProfileEvents[_0xa1be('0x7')](_0x592a78,_0x2480aa);_0x4876db(null);};}for(var e in events){if(events[_0xa1be('0x8')](e)){var event=events[e];UserProfile[_0xa1be('0x9')](e,emitEvent(event));}}module[_0xa1be('0xa')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index 8cb6683..027736c 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 _0xc94c=['UserProfile','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','define'];(function(_0x2581f8,_0x17062e){var _0x9c58d9=function(_0x3dd707){while(--_0x3dd707){_0x2581f8['push'](_0x2581f8['shift']());}};_0x9c58d9(++_0x17062e);}(_0xc94c,0x199));var _0xcc94=function(_0x2bdf3e,_0x168bfd){_0x2bdf3e=_0x2bdf3e-0x0;var _0x74e038=_0xc94c[_0x2bdf3e];return _0x74e038;};'use strict';var _=require(_0xcc94('0x0'));var util=require('util');var logger=require(_0xcc94('0x1'))(_0xcc94('0x2'));var moment=require(_0xcc94('0x3'));var BPromise=require('bluebird');var rp=require(_0xcc94('0x4'));var fs=require('fs');var path=require(_0xcc94('0x5'));var rimraf=require(_0xcc94('0x6'));var config=require(_0xcc94('0x7'));var attributes=require(_0xcc94('0x8'));module[_0xcc94('0x9')]=function(_0x11f75b,_0x55df40){return _0x11f75b[_0xcc94('0xa')](_0xcc94('0xb'),attributes,{'tableName':'user_profiles','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5dfe=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./userProfile.attributes','exports','define','UserProfile','user_profiles'];(function(_0x657e65,_0x307cb8){var _0x24c8ea=function(_0x5e1b88){while(--_0x5e1b88){_0x657e65['push'](_0x657e65['shift']());}};_0x24c8ea(++_0x307cb8);}(_0x5dfe,0xd0));var _0xe5df=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5dfe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xe5df('0x0'));var logger=require(_0xe5df('0x1'))(_0xe5df('0x2'));var moment=require(_0xe5df('0x3'));var BPromise=require(_0xe5df('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe5df('0x5'));var rimraf=require(_0xe5df('0x6'));var config=require(_0xe5df('0x7'));var attributes=require(_0xe5df('0x8'));module[_0xe5df('0x9')]=function(_0x29630f,_0x44c2c7){return _0x29630f[_0xe5df('0xa')](_0xe5df('0xb'),attributes,{'tableName':_0xe5df('0xc'),'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 22a922f..ba81994 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 _0x6aa7=['client','redis','defaults','socket.io-emitter','./userProfile.socket','request','then','info','UserProfile,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x4d1895,_0x5a1be7){var _0x6333a4=function(_0x1f8f43){while(--_0x1f8f43){_0x4d1895['push'](_0x4d1895['shift']());}};_0x6333a4(++_0x5a1be7);}(_0x6aa7,0x178));var _0x76aa=function(_0x406489,_0x59cd72){_0x406489=_0x406489-0x0;var _0x19dc93=_0x6aa7[_0x406489];return _0x19dc93;};'use strict';var _=require(_0x76aa('0x0'));var util=require('util');var moment=require(_0x76aa('0x1'));var BPromise=require(_0x76aa('0x2'));var rs=require(_0x76aa('0x3'));var fs=require('fs');var Redis=require(_0x76aa('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x76aa('0x5'));var logger=require(_0x76aa('0x6'))(_0x76aa('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x76aa('0x8')]['http']({'port':0x232a});config[_0x76aa('0x9')]=_[_0x76aa('0xa')](config[_0x76aa('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x76aa('0xb'))(new Redis(config[_0x76aa('0x9')]));require(_0x76aa('0xc'))['register'](socket);function respondWithRpcPromise(_0xcd99aa,_0x25856d,_0x41643a){return new BPromise(function(_0x16cb50,_0x37f1ab){return client[_0x76aa('0xd')](_0xcd99aa,_0x41643a)[_0x76aa('0xe')](function(_0x8dc35c){logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,'request\x20sent');logger[_0x76aa('0x11')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x25856d,_0x76aa('0x12'),JSON[_0x76aa('0x13')](_0x8dc35c));if(_0x8dc35c[_0x76aa('0x14')]){if(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x15')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x25856d,_0x8dc35c[_0x76aa('0x14')]['message']);return _0x37f1ab(_0x8dc35c[_0x76aa('0x14')][_0x76aa('0x16')]);}logger['error'](_0x76aa('0x10'),_0x25856d,_0x8dc35c['error'][_0x76aa('0x16')]);return _0x16cb50(_0x8dc35c['error'][_0x76aa('0x16')]);}else{logger[_0x76aa('0xf')](_0x76aa('0x10'),_0x25856d,_0x76aa('0x12'));_0x16cb50(_0x8dc35c[_0x76aa('0x17')][_0x76aa('0x16')]);}})['catch'](function(_0x5d6202){logger[_0x76aa('0x14')](_0x76aa('0x10'),_0x25856d,_0x5d6202);_0x37f1ab(_0x5d6202);});});} \ No newline at end of file +var _0xac9d=['./userProfile.socket','register','request','then','info','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','defaults','socket.io-emitter'];(function(_0x3c01c9,_0x3ab96e){var _0x34187b=function(_0x2ef59d){while(--_0x2ef59d){_0x3c01c9['push'](_0x3c01c9['shift']());}};_0x34187b(++_0x3ab96e);}(_0xac9d,0x14d));var _0xdac9=function(_0xddfbdc,_0x561a0b){_0xddfbdc=_0xddfbdc-0x0;var _0x395d72=_0xac9d[_0xddfbdc];return _0x395d72;};'use strict';var _=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var moment=require(_0xdac9('0x2'));var BPromise=require(_0xdac9('0x3'));var rs=require(_0xdac9('0x4'));var fs=require('fs');var Redis=require(_0xdac9('0x5'));var db=require(_0xdac9('0x6'))['db'];var utils=require(_0xdac9('0x7'));var logger=require('../../config/logger')(_0xdac9('0x8'));var config=require('../../config/environment');var jayson=require(_0xdac9('0x9'));var client=jayson[_0xdac9('0xa')][_0xdac9('0xb')]({'port':0x232a});config[_0xdac9('0xc')]=_[_0xdac9('0xd')](config[_0xdac9('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0xdac9('0xe'))(new Redis(config['redis']));require(_0xdac9('0xf'))[_0xdac9('0x10')](socket);function respondWithRpcPromise(_0x39c92c,_0x1a4674,_0x23ec14){return new BPromise(function(_0x2859bf,_0x255627){return client[_0xdac9('0x11')](_0x39c92c,_0x23ec14)[_0xdac9('0x12')](function(_0x5514c5){logger[_0xdac9('0x13')](_0xdac9('0x14'),_0x1a4674,'request\x20sent');logger[_0xdac9('0x15')](_0xdac9('0x16'),_0x1a4674,_0xdac9('0x17'),JSON['stringify'](_0x5514c5));if(_0x5514c5[_0xdac9('0x18')]){if(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x19')]===0x1f4){logger['error']('UserProfile,\x20%s,\x20%s',_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x255627(_0x5514c5['error'][_0xdac9('0x1a')]);}logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);return _0x2859bf(_0x5514c5[_0xdac9('0x18')][_0xdac9('0x1a')]);}else{logger[_0xdac9('0x13')]('UserProfile,\x20%s,\x20%s',_0x1a4674,_0xdac9('0x17'));_0x2859bf(_0x5514c5[_0xdac9('0x1b')]['message']);}})[_0xdac9('0x1c')](function(_0xa57f2d){logger[_0xdac9('0x18')](_0xdac9('0x14'),_0x1a4674,_0xa57f2d);_0x255627(_0xa57f2d);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index b4874f5..1640231 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 _0xaffa=['emit','removeListener','register','length','userProfile:','./userProfile.events','remove','update'];(function(_0x410baa,_0x100608){var _0x59bb5d=function(_0x4c7a59){while(--_0x4c7a59){_0x410baa['push'](_0x410baa['shift']());}};_0x59bb5d(++_0x100608);}(_0xaffa,0x19d));var _0xaaff=function(_0x46668a,_0x13de00){_0x46668a=_0x46668a-0x0;var _0x4d4d4f=_0xaffa[_0x46668a];return _0x4d4d4f;};'use strict';var UserProfileEvents=require(_0xaaff('0x0'));var events=['save',_0xaaff('0x1'),_0xaaff('0x2')];function createListener(_0x539fef,_0x337cbd){return function(_0x155429){_0x337cbd[_0xaaff('0x3')](_0x539fef,_0x155429);};}function removeListener(_0x2ae7c9,_0x1376de){return function(){UserProfileEvents[_0xaaff('0x4')](_0x2ae7c9,_0x1376de);};}exports[_0xaaff('0x5')]=function(_0x147336){for(var _0x431b38=0x0,_0x5299bd=events[_0xaaff('0x6')];_0x431b38<_0x5299bd;_0x431b38++){var _0x3a2ef6=events[_0x431b38];var _0x21aa20=createListener(_0xaaff('0x7')+_0x3a2ef6,_0x147336);UserProfileEvents['on'](_0x3a2ef6,_0x21aa20);}}; \ No newline at end of file +var _0x1f00=['./userProfile.events','save','update','removeListener','register','length'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x1f00,0x6c));var _0x01f0=function(_0x42e0d6,_0x3004b7){_0x42e0d6=_0x42e0d6-0x0;var _0x2a9f88=_0x1f00[_0x42e0d6];return _0x2a9f88;};'use strict';var UserProfileEvents=require(_0x01f0('0x0'));var events=[_0x01f0('0x1'),'remove',_0x01f0('0x2')];function createListener(_0x41beb5,_0x552378){return function(_0x10f288){_0x552378['emit'](_0x41beb5,_0x10f288);};}function removeListener(_0xfae028,_0xc547e2){return function(){UserProfileEvents[_0x01f0('0x3')](_0xfae028,_0xc547e2);};}exports[_0x01f0('0x4')]=function(_0x6ed701){for(var _0x34fa12=0x0,_0x73d349=events[_0x01f0('0x5')];_0x34fa12<_0x73d349;_0x34fa12++){var _0x234b1f=events[_0x34fa12];var _0x1e647b=createListener('userProfile:'+_0x234b1f,_0x6ed701);UserProfileEvents['on'](_0x234b1f,_0x1e647b);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 07497fc..72b7b6f 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 _0x20e8=['show','post','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','index','describe'];(function(_0x18c5ff,_0x29bb6f){var _0xa0d8=function(_0x46cd1c){while(--_0x46cd1c){_0x18c5ff['push'](_0x18c5ff['shift']());}};_0xa0d8(++_0x29bb6f);}(_0x20e8,0x6b));var _0x820e=function(_0xcc449f,_0x27a405){_0xcc449f=_0xcc449f-0x0;var _0x5cefe9=_0x20e8[_0xcc449f];return _0x5cefe9;};'use strict';var multer=require(_0x820e('0x0'));var util=require(_0x820e('0x1'));var path=require(_0x820e('0x2'));var timeout=require(_0x820e('0x3'));var express=require(_0x820e('0x4'));var router=express[_0x820e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x820e('0x6'));var config=require(_0x820e('0x7'));var controller=require(_0x820e('0x8'));router[_0x820e('0x9')]('/',auth[_0x820e('0xa')](),controller[_0x820e('0xb')]);router[_0x820e('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x820e('0xc')]);router['get']('/:id',auth[_0x820e('0xa')](),controller[_0x820e('0xd')]);router[_0x820e('0xe')]('/',auth[_0x820e('0xa')](),controller['create']);router[_0x820e('0xf')](_0x820e('0x10'),auth[_0x820e('0xa')](),controller[_0x820e('0x11')]);router[_0x820e('0x12')](_0x820e('0x10'),auth[_0x820e('0xa')](),controller['destroy']);module[_0x820e('0x13')]=router; \ No newline at end of file +var _0xb3f2=['delete','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileResource.controller','get','isAuthenticated','describe','/:id','post','create','put','update'];(function(_0x31d5cb,_0x9129f7){var _0x133f73=function(_0x3bd838){while(--_0x3bd838){_0x31d5cb['push'](_0x31d5cb['shift']());}};_0x133f73(++_0x9129f7);}(_0xb3f2,0x1bb));var _0x2b3f=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0xb3f2[_0xc4001c];return _0x49f7bc;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2b3f('0x0'));var timeout=require(_0x2b3f('0x1'));var express=require(_0x2b3f('0x2'));var router=express[_0x2b3f('0x3')]();var auth=require(_0x2b3f('0x4'));var interaction=require(_0x2b3f('0x5'));var config=require(_0x2b3f('0x6'));var controller=require(_0x2b3f('0x7'));router[_0x2b3f('0x8')]('/',auth[_0x2b3f('0x9')](),controller['index']);router[_0x2b3f('0x8')]('/describe',auth[_0x2b3f('0x9')](),controller[_0x2b3f('0xa')]);router[_0x2b3f('0x8')](_0x2b3f('0xb'),auth[_0x2b3f('0x9')](),controller['show']);router[_0x2b3f('0xc')]('/',auth[_0x2b3f('0x9')](),controller[_0x2b3f('0xd')]);router[_0x2b3f('0xe')](_0x2b3f('0xb'),auth[_0x2b3f('0x9')](),controller[_0x2b3f('0xf')]);router[_0x2b3f('0x10')](_0x2b3f('0xb'),auth[_0x2b3f('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index 54e7eaf..23a2132 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 _0xde22=['INTEGER','sequelize','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xde22,0x131));var _0x2de2=function(_0x2da0f7,_0x25bb56){_0x2da0f7=_0x2da0f7-0x0;var _0x4bba87=_0xde22[_0x2da0f7];return _0x4bba87;};'use strict';var Sequelize=require(_0x2de2('0x0'));module[_0x2de2('0x1')]={'name':{'type':Sequelize[_0x2de2('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x2de2('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x2de2('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x2591=['INTEGER','STRING','sequelize','exports'];(function(_0x6bbb11,_0x44e6b5){var _0x4c4dc3=function(_0x1307e8){while(--_0x1307e8){_0x6bbb11['push'](_0x6bbb11['shift']());}};_0x4c4dc3(++_0x44e6b5);}(_0x2591,0x1b6));var _0x1259=function(_0x438166,_0x5ccd53){_0x438166=_0x438166-0x0;var _0x1baa1d=_0x2591[_0x438166];return _0x1baa1d;};'use strict';var Sequelize=require(_0x1259('0x0'));module[_0x1259('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x1259('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1259('0x3')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index e760d17..69b0c1d 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 _0x9cbe=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','name','send','map','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','UserProfileResource','includeAll','include','findAll','rows','catch','show','create','body','update','find','params','describe','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb'];(function(_0x515d97,_0x3b79bb){var _0xa4b4b8=function(_0x1ed0a6){while(--_0x1ed0a6){_0x515d97['push'](_0x515d97['shift']());}};_0xa4b4b8(++_0x3b79bb);}(_0x9cbe,0x7a));var _0xe9cb=function(_0x45783c,_0x49c56d){_0x45783c=_0x45783c-0x0;var _0x1161da=_0x9cbe[_0x45783c];return _0x1161da;};'use strict';var pdf=require(_0xe9cb('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe9cb('0x1'));var jsonpatch=require(_0xe9cb('0x2'));var rp=require(_0xe9cb('0x3'));var moment=require('moment');var BPromise=require(_0xe9cb('0x4'));var Mustache=require(_0xe9cb('0x5'));var util=require(_0xe9cb('0x6'));var path=require(_0xe9cb('0x7'));var sox=require(_0xe9cb('0x8'));var csv=require(_0xe9cb('0x9'));var ejs=require(_0xe9cb('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe9cb('0xb'));var crypto=require(_0xe9cb('0xc'));var jsforce=require(_0xe9cb('0xd'));var deskjs=require(_0xe9cb('0xe'));var toCsv=require(_0xe9cb('0x9'));var querystring=require('querystring');var Papa=require(_0xe9cb('0xf'));var Redis=require(_0xe9cb('0x10'));var authService=require(_0xe9cb('0x11'));var qs=require(_0xe9cb('0x12'));var as=require(_0xe9cb('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xe9cb('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe9cb('0x15'))['db'];function respondWithStatusCode(_0x1e3116,_0x2f77b8){_0x2f77b8=_0x2f77b8||0xcc;return function(_0x35f9d1){if(_0x35f9d1){return _0x1e3116[_0xe9cb('0x16')](_0x2f77b8);}return _0x1e3116[_0xe9cb('0x17')](_0x2f77b8)[_0xe9cb('0x18')]();};}function respondWithResult(_0x48d770,_0x273fbe){_0x273fbe=_0x273fbe||0xc8;return function(_0xc7d3d1){if(_0xc7d3d1){return _0x48d770['status'](_0x273fbe)[_0xe9cb('0x19')](_0xc7d3d1);}};}function respondWithFilteredResult(_0x17d39c,_0x5d6b19){return function(_0x878b23){if(_0x878b23){var _0x551d08=_0x878b23[_0xe9cb('0x1a')],_0x1eabe3=_0x5d6b19[_0xe9cb('0x1b')],_0x138fe9=_0x5d6b19['offset']+_0x5d6b19[_0xe9cb('0x1c')],_0x25a652;if(_0x138fe9>=_0x551d08){_0x138fe9=_0x551d08;_0x25a652=0xc8;}else{_0x25a652=0xce;}_0x17d39c[_0xe9cb('0x17')](_0x25a652);return _0x17d39c[_0xe9cb('0x1d')](_0xe9cb('0x1e'),_0x1eabe3+'-'+_0x138fe9+'/'+_0x551d08)[_0xe9cb('0x19')](_0x878b23);}return null;};}function patchUpdates(_0x3b3f2f){return function(_0x213b63){try{jsonpatch[_0xe9cb('0x1f')](_0x213b63,_0x3b3f2f,!![]);}catch(_0x2ba38c){return BPromise[_0xe9cb('0x20')](_0x2ba38c);}return _0x213b63[_0xe9cb('0x21')]();};}function saveUpdates(_0x5aded3,_0x1ca581){return function(_0x2711ab){if(_0x2711ab){return _0x2711ab['update'](_0x5aded3)[_0xe9cb('0x22')](function(_0x439ecb){return _0x439ecb;});}return null;};}function removeEntity(_0x57a354,_0x1cf7f2){return function(_0x46be1e){if(_0x46be1e){return _0x46be1e[_0xe9cb('0x23')]()[_0xe9cb('0x22')](function(){_0x57a354[_0xe9cb('0x17')](0xcc)[_0xe9cb('0x18')]();});}};}function handleEntityNotFound(_0x3da6ce,_0x4beb5d){return function(_0x1234af){if(!_0x1234af){_0x3da6ce['sendStatus'](0x194);}return _0x1234af;};}function handleError(_0x23d19c,_0x17b305){_0x17b305=_0x17b305||0x1f4;return function(_0x4b5bea){logger[_0xe9cb('0x24')](_0x4b5bea['stack']);if(_0x4b5bea['name']){delete _0x4b5bea[_0xe9cb('0x25')];}_0x23d19c['status'](_0x17b305)[_0xe9cb('0x26')](_0x4b5bea);};}exports['index']=function(_0x4d34c3,_0x293d81){var _0x858a68={},_0x8944a2={},_0x1ead88={'count':0x0,'rows':[]};var _0x1e0d61=_[_0xe9cb('0x27')](db['UserProfileResource']['rawAttributes'],function(_0x48ba3d){return{'name':_0x48ba3d[_0xe9cb('0x28')],'type':_0x48ba3d[_0xe9cb('0x29')][_0xe9cb('0x2a')]};});_0x8944a2['model']=_[_0xe9cb('0x27')](_0x1e0d61,'name');_0x8944a2['query']=_[_0xe9cb('0x2b')](_0x4d34c3['query']);_0x8944a2[_0xe9cb('0x2c')]=_[_0xe9cb('0x2d')](_0x8944a2[_0xe9cb('0x2e')],_0x8944a2[_0xe9cb('0x2f')]);_0x858a68[_0xe9cb('0x30')]=_['intersection'](_0x8944a2[_0xe9cb('0x2e')],qs['fields'](_0x4d34c3[_0xe9cb('0x2f')][_0xe9cb('0x31')]));_0x858a68[_0xe9cb('0x30')]=_0x858a68['attributes'][_0xe9cb('0x32')]?_0x858a68[_0xe9cb('0x30')]:_0x8944a2[_0xe9cb('0x2e')];if(!_0x4d34c3[_0xe9cb('0x2f')][_0xe9cb('0x33')](_0xe9cb('0x34'))){_0x858a68[_0xe9cb('0x1c')]=qs['limit'](_0x4d34c3[_0xe9cb('0x2f')][_0xe9cb('0x1c')]);_0x858a68[_0xe9cb('0x1b')]=qs[_0xe9cb('0x1b')](_0x4d34c3[_0xe9cb('0x2f')][_0xe9cb('0x1b')]);}_0x858a68[_0xe9cb('0x35')]=qs[_0xe9cb('0x36')](_0x4d34c3[_0xe9cb('0x2f')][_0xe9cb('0x36')]);_0x858a68[_0xe9cb('0x37')]=qs[_0xe9cb('0x2c')](_['pick'](_0x4d34c3[_0xe9cb('0x2f')],_0x8944a2[_0xe9cb('0x2c')]));if(_0x4d34c3[_0xe9cb('0x2f')][_0xe9cb('0x38')]){_0x858a68[_0xe9cb('0x37')]=_[_0xe9cb('0x39')](_0x858a68['where'],{'$or':_['map'](_0x1e0d61,function(_0x14e875){if(_0x14e875['type']!=='VIRTUAL'){var _0xd75bfd={};_0xd75bfd[_0x14e875[_0xe9cb('0x25')]]={'$like':'%'+_0x4d34c3[_0xe9cb('0x2f')]['filter']+'%'};return _0xd75bfd;}})});}_0x858a68=_[_0xe9cb('0x39')]({},_0x858a68,_0x4d34c3[_0xe9cb('0x3a')]);var _0x5b1b07={'where':_0x858a68[_0xe9cb('0x37')]};return db[_0xe9cb('0x3b')]['count'](_0x5b1b07)[_0xe9cb('0x22')](function(_0x779352){_0x1ead88['count']=_0x779352;if(_0x4d34c3[_0xe9cb('0x2f')][_0xe9cb('0x3c')]){_0x858a68[_0xe9cb('0x3d')]=[{'all':!![]}];}return db[_0xe9cb('0x3b')][_0xe9cb('0x3e')](_0x858a68);})[_0xe9cb('0x22')](function(_0x31dde6){_0x1ead88[_0xe9cb('0x3f')]=_0x31dde6;return _0x1ead88;})[_0xe9cb('0x22')](respondWithFilteredResult(_0x293d81,_0x858a68))[_0xe9cb('0x40')](handleError(_0x293d81,null));};exports[_0xe9cb('0x41')]=function(_0x135748,_0x27c5d4){var _0xe4ee73={'raw':![],'where':{'id':_0x135748['params']['id']}},_0x32144f={};_0x32144f[_0xe9cb('0x2e')]=_[_0xe9cb('0x2b')](db[_0xe9cb('0x3b')]['rawAttributes']);_0x32144f[_0xe9cb('0x2f')]=_[_0xe9cb('0x2b')](_0x135748[_0xe9cb('0x2f')]);_0x32144f[_0xe9cb('0x2c')]=_[_0xe9cb('0x2d')](_0x32144f['model'],_0x32144f[_0xe9cb('0x2f')]);_0xe4ee73[_0xe9cb('0x30')]=_[_0xe9cb('0x2d')](_0x32144f[_0xe9cb('0x2e')],qs[_0xe9cb('0x31')](_0x135748[_0xe9cb('0x2f')]['fields']));_0xe4ee73['attributes']=_0xe4ee73[_0xe9cb('0x30')][_0xe9cb('0x32')]?_0xe4ee73[_0xe9cb('0x30')]:_0x32144f[_0xe9cb('0x2e')];if(_0x135748[_0xe9cb('0x2f')][_0xe9cb('0x3c')]){_0xe4ee73[_0xe9cb('0x3d')]=[{'all':!![]}];}_0xe4ee73=_[_0xe9cb('0x39')]({},_0xe4ee73,_0x135748['options']);return db[_0xe9cb('0x3b')]['find'](_0xe4ee73)[_0xe9cb('0x22')](handleEntityNotFound(_0x27c5d4,null))['then'](respondWithResult(_0x27c5d4,null))[_0xe9cb('0x40')](handleError(_0x27c5d4,null));};exports[_0xe9cb('0x42')]=function(_0x504546,_0x3acc5d){return db[_0xe9cb('0x3b')][_0xe9cb('0x42')](_0x504546[_0xe9cb('0x43')],{})[_0xe9cb('0x22')](respondWithResult(_0x3acc5d,0xc9))[_0xe9cb('0x40')](handleError(_0x3acc5d,null));};exports[_0xe9cb('0x44')]=function(_0x5a7a9d,_0x805596){if(_0x5a7a9d[_0xe9cb('0x43')]['id']){delete _0x5a7a9d[_0xe9cb('0x43')]['id'];}return db['UserProfileResource'][_0xe9cb('0x45')]({'where':{'id':_0x5a7a9d[_0xe9cb('0x46')]['id']}})[_0xe9cb('0x22')](handleEntityNotFound(_0x805596,null))[_0xe9cb('0x22')](saveUpdates(_0x5a7a9d[_0xe9cb('0x43')],null))[_0xe9cb('0x22')](respondWithResult(_0x805596,null))[_0xe9cb('0x40')](handleError(_0x805596,null));};exports[_0xe9cb('0x23')]=function(_0x46da49,_0x4506b4){return db[_0xe9cb('0x3b')]['find']({'where':{'id':_0x46da49[_0xe9cb('0x46')]['id']}})[_0xe9cb('0x22')](handleEntityNotFound(_0x4506b4,null))[_0xe9cb('0x22')](removeEntity(_0x4506b4,null))[_0xe9cb('0x40')](handleError(_0x4506b4,null));};exports[_0xe9cb('0x47')]=function(_0x291083,_0x496770){return db[_0xe9cb('0x3b')]['describe']()['then'](respondWithResult(_0x496770,null))[_0xe9cb('0x40')](handleError(_0x496770,null));}; \ No newline at end of file +var _0xf623=['options','count','includeAll','include','findAll','catch','show','keys','length','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','path','sox','to-csv','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','UserProfileResource','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','order','sort','where','pick','type','VIRTUAL','filter','merge'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xf623,0xe0));var _0x3f62=function(_0x3523ff,_0x4b8413){_0x3523ff=_0x3523ff-0x0;var _0xee01c1=_0xf623[_0x3523ff];return _0xee01c1;};'use strict';var pdf=require(_0x3f62('0x0'));var emlformat=require(_0x3f62('0x1'));var rimraf=require(_0x3f62('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3f62('0x3'));var rp=require(_0x3f62('0x4'));var moment=require('moment');var BPromise=require(_0x3f62('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3f62('0x6'));var sox=require(_0x3f62('0x7'));var csv=require(_0x3f62('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3f62('0x9'));var crypto=require(_0x3f62('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3f62('0xb'));var toCsv=require(_0x3f62('0x8'));var querystring=require(_0x3f62('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x3f62('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x3f62('0xe'));var hardwareService=require(_0x3f62('0xf'));var logger=require(_0x3f62('0x10'))(_0x3f62('0x11'));var utils=require(_0x3f62('0x12'));var config=require(_0x3f62('0x13'));var db=require(_0x3f62('0x14'))['db'];function respondWithStatusCode(_0xb3a22f,_0x10ba49){_0x10ba49=_0x10ba49||0xcc;return function(_0x1f5e3e){if(_0x1f5e3e){return _0xb3a22f[_0x3f62('0x15')](_0x10ba49);}return _0xb3a22f[_0x3f62('0x16')](_0x10ba49)[_0x3f62('0x17')]();};}function respondWithResult(_0x2183b1,_0x32690c){_0x32690c=_0x32690c||0xc8;return function(_0x5b4bbf){if(_0x5b4bbf){return _0x2183b1['status'](_0x32690c)[_0x3f62('0x18')](_0x5b4bbf);}};}function respondWithFilteredResult(_0x33aac5,_0x1594db){return function(_0x308187){if(_0x308187){var _0x398d61=_0x308187['count'],_0x46aec3=_0x1594db[_0x3f62('0x19')],_0x54e7b7=_0x1594db[_0x3f62('0x19')]+_0x1594db[_0x3f62('0x1a')],_0x228d27;if(_0x54e7b7>=_0x398d61){_0x54e7b7=_0x398d61;_0x228d27=0xc8;}else{_0x228d27=0xce;}_0x33aac5['status'](_0x228d27);return _0x33aac5[_0x3f62('0x1b')]('Content-Range',_0x46aec3+'-'+_0x54e7b7+'/'+_0x398d61)[_0x3f62('0x18')](_0x308187);}return null;};}function patchUpdates(_0x2ad73d){return function(_0x354172){try{jsonpatch[_0x3f62('0x1c')](_0x354172,_0x2ad73d,!![]);}catch(_0x183505){return BPromise[_0x3f62('0x1d')](_0x183505);}return _0x354172[_0x3f62('0x1e')]();};}function saveUpdates(_0x3a8d09,_0x21fd4b){return function(_0x7dee6){if(_0x7dee6){return _0x7dee6[_0x3f62('0x1f')](_0x3a8d09)[_0x3f62('0x20')](function(_0xffe8d9){return _0xffe8d9;});}return null;};}function removeEntity(_0x384e35,_0x338673){return function(_0x5be0e6){if(_0x5be0e6){return _0x5be0e6[_0x3f62('0x21')]()[_0x3f62('0x20')](function(){_0x384e35['status'](0xcc)[_0x3f62('0x17')]();});}};}function handleEntityNotFound(_0xf22f31,_0x2b1f0b){return function(_0x126719){if(!_0x126719){_0xf22f31[_0x3f62('0x15')](0x194);}return _0x126719;};}function handleError(_0x11ab87,_0x28104d){_0x28104d=_0x28104d||0x1f4;return function(_0x108913){logger['error'](_0x108913[_0x3f62('0x22')]);if(_0x108913[_0x3f62('0x23')]){delete _0x108913[_0x3f62('0x23')];}_0x11ab87[_0x3f62('0x16')](_0x28104d)[_0x3f62('0x24')](_0x108913);};}exports[_0x3f62('0x25')]=function(_0x3fdc29,_0x1ced71){var _0x582522={},_0x3ee1d5={},_0x408aad={'count':0x0,'rows':[]};var _0x5856c7=_[_0x3f62('0x26')](db[_0x3f62('0x27')][_0x3f62('0x28')],function(_0x59ffe6){return{'name':_0x59ffe6[_0x3f62('0x29')],'type':_0x59ffe6['type']['key']};});_0x3ee1d5[_0x3f62('0x2a')]=_[_0x3f62('0x26')](_0x5856c7,_0x3f62('0x23'));_0x3ee1d5['query']=_['keys'](_0x3fdc29[_0x3f62('0x2b')]);_0x3ee1d5[_0x3f62('0x2c')]=_[_0x3f62('0x2d')](_0x3ee1d5[_0x3f62('0x2a')],_0x3ee1d5['query']);_0x582522[_0x3f62('0x2e')]=_[_0x3f62('0x2d')](_0x3ee1d5[_0x3f62('0x2a')],qs[_0x3f62('0x2f')](_0x3fdc29['query'][_0x3f62('0x2f')]));_0x582522[_0x3f62('0x2e')]=_0x582522[_0x3f62('0x2e')]['length']?_0x582522[_0x3f62('0x2e')]:_0x3ee1d5[_0x3f62('0x2a')];if(!_0x3fdc29['query']['hasOwnProperty']('nolimit')){_0x582522['limit']=qs[_0x3f62('0x1a')](_0x3fdc29[_0x3f62('0x2b')]['limit']);_0x582522['offset']=qs[_0x3f62('0x19')](_0x3fdc29[_0x3f62('0x2b')][_0x3f62('0x19')]);}_0x582522[_0x3f62('0x30')]=qs[_0x3f62('0x31')](_0x3fdc29[_0x3f62('0x2b')][_0x3f62('0x31')]);_0x582522[_0x3f62('0x32')]=qs[_0x3f62('0x2c')](_[_0x3f62('0x33')](_0x3fdc29[_0x3f62('0x2b')],_0x3ee1d5[_0x3f62('0x2c')]));if(_0x3fdc29[_0x3f62('0x2b')]['filter']){_0x582522['where']=_['merge'](_0x582522[_0x3f62('0x32')],{'$or':_[_0x3f62('0x26')](_0x5856c7,function(_0x4a4a73){if(_0x4a4a73[_0x3f62('0x34')]!==_0x3f62('0x35')){var _0x234239={};_0x234239[_0x4a4a73['name']]={'$like':'%'+_0x3fdc29[_0x3f62('0x2b')][_0x3f62('0x36')]+'%'};return _0x234239;}})});}_0x582522=_[_0x3f62('0x37')]({},_0x582522,_0x3fdc29[_0x3f62('0x38')]);var _0x27b235={'where':_0x582522[_0x3f62('0x32')]};return db[_0x3f62('0x27')][_0x3f62('0x39')](_0x27b235)[_0x3f62('0x20')](function(_0x5ae4eb){_0x408aad['count']=_0x5ae4eb;if(_0x3fdc29[_0x3f62('0x2b')][_0x3f62('0x3a')]){_0x582522[_0x3f62('0x3b')]=[{'all':!![]}];}return db[_0x3f62('0x27')][_0x3f62('0x3c')](_0x582522);})[_0x3f62('0x20')](function(_0x35e661){_0x408aad['rows']=_0x35e661;return _0x408aad;})[_0x3f62('0x20')](respondWithFilteredResult(_0x1ced71,_0x582522))[_0x3f62('0x3d')](handleError(_0x1ced71,null));};exports[_0x3f62('0x3e')]=function(_0x257791,_0x428a9e){var _0x5a3ce0={'raw':![],'where':{'id':_0x257791['params']['id']}},_0xd3fc2a={};_0xd3fc2a[_0x3f62('0x2a')]=_[_0x3f62('0x3f')](db['UserProfileResource'][_0x3f62('0x28')]);_0xd3fc2a['query']=_[_0x3f62('0x3f')](_0x257791[_0x3f62('0x2b')]);_0xd3fc2a[_0x3f62('0x2c')]=_[_0x3f62('0x2d')](_0xd3fc2a[_0x3f62('0x2a')],_0xd3fc2a[_0x3f62('0x2b')]);_0x5a3ce0[_0x3f62('0x2e')]=_['intersection'](_0xd3fc2a[_0x3f62('0x2a')],qs['fields'](_0x257791[_0x3f62('0x2b')][_0x3f62('0x2f')]));_0x5a3ce0[_0x3f62('0x2e')]=_0x5a3ce0[_0x3f62('0x2e')][_0x3f62('0x40')]?_0x5a3ce0[_0x3f62('0x2e')]:_0xd3fc2a['model'];if(_0x257791['query'][_0x3f62('0x3a')]){_0x5a3ce0[_0x3f62('0x3b')]=[{'all':!![]}];}_0x5a3ce0=_[_0x3f62('0x37')]({},_0x5a3ce0,_0x257791[_0x3f62('0x38')]);return db['UserProfileResource'][_0x3f62('0x41')](_0x5a3ce0)[_0x3f62('0x20')](handleEntityNotFound(_0x428a9e,null))[_0x3f62('0x20')](respondWithResult(_0x428a9e,null))[_0x3f62('0x3d')](handleError(_0x428a9e,null));};exports[_0x3f62('0x42')]=function(_0x53ed4e,_0x3734ac){return db[_0x3f62('0x27')][_0x3f62('0x42')](_0x53ed4e[_0x3f62('0x43')],{})[_0x3f62('0x20')](respondWithResult(_0x3734ac,0xc9))[_0x3f62('0x3d')](handleError(_0x3734ac,null));};exports[_0x3f62('0x1f')]=function(_0x15e4b1,_0x426cfc){if(_0x15e4b1[_0x3f62('0x43')]['id']){delete _0x15e4b1[_0x3f62('0x43')]['id'];}return db[_0x3f62('0x27')][_0x3f62('0x41')]({'where':{'id':_0x15e4b1[_0x3f62('0x44')]['id']}})[_0x3f62('0x20')](handleEntityNotFound(_0x426cfc,null))[_0x3f62('0x20')](saveUpdates(_0x15e4b1['body'],null))[_0x3f62('0x20')](respondWithResult(_0x426cfc,null))[_0x3f62('0x3d')](handleError(_0x426cfc,null));};exports[_0x3f62('0x21')]=function(_0x2e356c,_0x541a6a){return db['UserProfileResource'][_0x3f62('0x41')]({'where':{'id':_0x2e356c[_0x3f62('0x44')]['id']}})[_0x3f62('0x20')](handleEntityNotFound(_0x541a6a,null))[_0x3f62('0x20')](removeEntity(_0x541a6a,null))[_0x3f62('0x3d')](handleError(_0x541a6a,null));};exports[_0x3f62('0x45')]=function(_0x57bcf6,_0x5f4e17){return db['UserProfileResource']['describe']()[_0x3f62('0x20')](respondWithResult(_0x5f4e17,null))[_0x3f62('0x3d')](handleError(_0x5f4e17,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index b50f8be..9d9e86c 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 _0xde1c=['./userProfileResource.attributes','exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','lodash','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde1c,0xb0));var _0xcde1=function(_0x151d94,_0x133915){_0x151d94=_0x151d94-0x0;var _0x15fc04=_0xde1c[_0x151d94];return _0x15fc04;};'use strict';var _=require(_0xcde1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xcde1('0x1'));var moment=require('moment');var BPromise=require(_0xcde1('0x2'));var rp=require(_0xcde1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcde1('0x4'));var config=require(_0xcde1('0x5'));var attributes=require(_0xcde1('0x6'));module[_0xcde1('0x7')]=function(_0x844b33,_0x149f8d){return _0x844b33['define'](_0xcde1('0x8'),attributes,{'tableName':_0xcde1('0x9'),'paranoid':![],'indexes':[{'name':_0xcde1('0xa'),'fields':[_0xcde1('0xb'),_0xcde1('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7674=['UserProfileResource','user_profile_has_resources','sectionId','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x5a0000,_0x3879a3){var _0x4f6f6a=function(_0x4cc34c){while(--_0x4cc34c){_0x5a0000['push'](_0x5a0000['shift']());}};_0x4f6f6a(++_0x3879a3);}(_0x7674,0x150));var _0x4767=function(_0x2440fe,_0x281a11){_0x2440fe=_0x2440fe-0x0;var _0x5cf734=_0x7674[_0x2440fe];return _0x5cf734;};'use strict';var _=require('lodash');var util=require(_0x4767('0x0'));var logger=require(_0x4767('0x1'))(_0x4767('0x2'));var moment=require(_0x4767('0x3'));var BPromise=require(_0x4767('0x4'));var rp=require(_0x4767('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./userProfileResource.attributes');module['exports']=function(_0xeda459,_0x3bc343){return _0xeda459['define'](_0x4767('0x6'),attributes,{'tableName':_0x4767('0x7'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId',_0x4767('0x8')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 6ccf214..47e9bc3 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 _0x331d=['catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2fc464,_0x2936c1){var _0x1bd429=function(_0x3c8bf5){while(--_0x3c8bf5){_0x2fc464['push'](_0x2fc464['shift']());}};_0x1bd429(++_0x2936c1);}(_0x331d,0x1c9));var _0xd331=function(_0x1cdbdd,_0x4686e5){_0x1cdbdd=_0x1cdbdd-0x0;var _0x5a2c38=_0x331d[_0x1cdbdd];return _0x5a2c38;};'use strict';var _=require(_0xd331('0x0'));var util=require('util');var moment=require(_0xd331('0x1'));var BPromise=require(_0xd331('0x2'));var rs=require(_0xd331('0x3'));var fs=require('fs');var Redis=require(_0xd331('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd331('0x5'))(_0xd331('0x6'));var config=require(_0xd331('0x7'));var jayson=require(_0xd331('0x8'));var client=jayson[_0xd331('0x9')][_0xd331('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10bee5,_0xe200d3,_0x9eedea){return new BPromise(function(_0xdfa49d,_0x1ba117){return client[_0xd331('0xb')](_0x10bee5,_0x9eedea)[_0xd331('0xc')](function(_0x5a3ce3){logger[_0xd331('0xd')](_0xd331('0xe'),_0xe200d3,_0xd331('0xf'));logger[_0xd331('0x10')](_0xd331('0x11'),_0xe200d3,'request\x20sent',JSON[_0xd331('0x12')](_0x5a3ce3));if(_0x5a3ce3[_0xd331('0x13')]){if(_0x5a3ce3[_0xd331('0x13')][_0xd331('0x14')]===0x1f4){logger['error'](_0xd331('0xe'),_0xe200d3,_0x5a3ce3[_0xd331('0x13')][_0xd331('0x15')]);return _0x1ba117(_0x5a3ce3[_0xd331('0x13')][_0xd331('0x15')]);}logger[_0xd331('0x13')](_0xd331('0xe'),_0xe200d3,_0x5a3ce3[_0xd331('0x13')][_0xd331('0x15')]);return _0xdfa49d(_0x5a3ce3[_0xd331('0x13')]['message']);}else{logger[_0xd331('0xd')]('UserProfileResource,\x20%s,\x20%s',_0xe200d3,_0xd331('0xf'));_0xdfa49d(_0x5a3ce3[_0xd331('0x16')][_0xd331('0x15')]);}})[_0xd331('0x17')](function(_0x4e7501){logger[_0xd331('0x13')](_0xd331('0xe'),_0xe200d3,_0x4e7501);_0x1ba117(_0x4e7501);});});} \ No newline at end of file +var _0x2ed6=['code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s','error'];(function(_0xe62831,_0x375383){var _0x27451d=function(_0x4dce85){while(--_0x4dce85){_0xe62831['push'](_0xe62831['shift']());}};_0x27451d(++_0x375383);}(_0x2ed6,0xc9));var _0x62ed=function(_0x14ac8e,_0x2fb7ad){_0x14ac8e=_0x14ac8e-0x0;var _0x33762e=_0x2ed6[_0x14ac8e];return _0x33762e;};'use strict';var _=require(_0x62ed('0x0'));var util=require(_0x62ed('0x1'));var moment=require('moment');var BPromise=require(_0x62ed('0x2'));var rs=require(_0x62ed('0x3'));var fs=require('fs');var Redis=require(_0x62ed('0x4'));var db=require(_0x62ed('0x5'))['db'];var utils=require(_0x62ed('0x6'));var logger=require(_0x62ed('0x7'))(_0x62ed('0x8'));var config=require('../../config/environment');var jayson=require(_0x62ed('0x9'));var client=jayson['client'][_0x62ed('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3df633,_0xb959a8,_0x575421){return new BPromise(function(_0x54908a,_0x5402ed){return client[_0x62ed('0xb')](_0x3df633,_0x575421)[_0x62ed('0xc')](function(_0x27f81a){logger[_0x62ed('0xd')](_0x62ed('0xe'),_0xb959a8,_0x62ed('0xf'));logger[_0x62ed('0x10')](_0x62ed('0x11'),_0xb959a8,_0x62ed('0xf'),JSON['stringify'](_0x27f81a));if(_0x27f81a['error']){if(_0x27f81a[_0x62ed('0x12')][_0x62ed('0x13')]===0x1f4){logger[_0x62ed('0x12')](_0x62ed('0xe'),_0xb959a8,_0x27f81a[_0x62ed('0x12')]['message']);return _0x5402ed(_0x27f81a[_0x62ed('0x12')][_0x62ed('0x14')]);}logger[_0x62ed('0x12')](_0x62ed('0xe'),_0xb959a8,_0x27f81a[_0x62ed('0x12')][_0x62ed('0x14')]);return _0x54908a(_0x27f81a[_0x62ed('0x12')][_0x62ed('0x14')]);}else{logger[_0x62ed('0xd')](_0x62ed('0xe'),_0xb959a8,_0x62ed('0xf'));_0x54908a(_0x27f81a['result'][_0x62ed('0x14')]);}})[_0x62ed('0x15')](function(_0x112851){logger[_0x62ed('0x12')](_0x62ed('0xe'),_0xb959a8,_0x112851);_0x5402ed(_0x112851);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 630f747..f237c57 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 _0x8302=['show','post','put','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileSection.controller','get','isAuthenticated','index','/describe','/:id'];(function(_0x49fb1c,_0x113891){var _0x36cc02=function(_0x308d72){while(--_0x308d72){_0x49fb1c['push'](_0x49fb1c['shift']());}};_0x36cc02(++_0x113891);}(_0x8302,0x1bf));var _0x2830=function(_0x80d733,_0x266211){_0x80d733=_0x80d733-0x0;var _0x435868=_0x8302[_0x80d733];return _0x435868;};'use strict';var multer=require('multer');var util=require(_0x2830('0x0'));var path=require('path');var timeout=require(_0x2830('0x1'));var express=require(_0x2830('0x2'));var router=express[_0x2830('0x3')]();var auth=require(_0x2830('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2830('0x5'));var controller=require(_0x2830('0x6'));router[_0x2830('0x7')]('/',auth[_0x2830('0x8')](),controller[_0x2830('0x9')]);router[_0x2830('0x7')](_0x2830('0xa'),auth[_0x2830('0x8')](),controller['describe']);router[_0x2830('0x7')](_0x2830('0xb'),auth[_0x2830('0x8')](),controller[_0x2830('0xc')]);router[_0x2830('0xd')]('/',auth[_0x2830('0x8')](),controller['create']);router[_0x2830('0xe')](_0x2830('0xb'),auth[_0x2830('0x8')](),controller['update']);router[_0x2830('0xf')](_0x2830('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x2830('0x10')]=router; \ No newline at end of file +var _0x96a6=['connect-timeout','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','/describe','isAuthenticated','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x49cb71,_0x2f0149){var _0x3a50fd=function(_0x48c304){while(--_0x48c304){_0x49cb71['push'](_0x49cb71['shift']());}};_0x3a50fd(++_0x2f0149);}(_0x96a6,0xfd));var _0x696a=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0x96a6[_0x4243a3];return _0x1b2a33;};'use strict';var multer=require(_0x696a('0x0'));var util=require(_0x696a('0x1'));var path=require('path');var timeout=require(_0x696a('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x696a('0x3'));var config=require(_0x696a('0x4'));var controller=require(_0x696a('0x5'));router[_0x696a('0x6')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x696a('0x7'),auth[_0x696a('0x8')](),controller['describe']);router[_0x696a('0x6')](_0x696a('0x9'),auth[_0x696a('0x8')](),controller[_0x696a('0xa')]);router[_0x696a('0xb')]('/',auth[_0x696a('0x8')](),controller[_0x696a('0xc')]);router[_0x696a('0xd')](_0x696a('0x9'),auth['isAuthenticated'](),controller[_0x696a('0xe')]);router['delete'](_0x696a('0x9'),auth[_0x696a('0x8')](),controller[_0x696a('0xf')]);module[_0x696a('0x10')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 6b0bf71..58808bb 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 _0x22f6=['sequelize','STRING','INTEGER','BOOLEAN','setDataValue','crudPermissions','join','getDataValue','split'];(function(_0x20ce11,_0x5cc6e7){var _0x1c3a50=function(_0xb47b5f){while(--_0xb47b5f){_0x20ce11['push'](_0x20ce11['shift']());}};_0x1c3a50(++_0x5cc6e7);}(_0x22f6,0x10e));var _0x622f=function(_0x56fd06,_0x3c8f80){_0x56fd06=_0x56fd06-0x0;var _0x1515fd=_0x22f6[_0x56fd06];return _0x1515fd;};'use strict';var Sequelize=require(_0x622f('0x0'));module['exports']={'name':{'type':Sequelize[_0x622f('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x622f('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x622f('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0x622f('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x622f('0x1')],'set':function(_0x2438c8){this[_0x622f('0x4')](_0x622f('0x5'),_0x2438c8?_0x2438c8[_0x622f('0x6')](''):[]);},'get':function(){return this[_0x622f('0x7')](_0x622f('0x5'))?this['getDataValue'](_0x622f('0x5'))[_0x622f('0x8')](''):[];}}}; \ No newline at end of file +var _0x167e=['crudPermissions','sequelize','exports','STRING','INTEGER','BOOLEAN','setDataValue','join','getDataValue'];(function(_0x224e15,_0x78f120){var _0x49ed20=function(_0x37e0cd){while(--_0x37e0cd){_0x224e15['push'](_0x224e15['shift']());}};_0x49ed20(++_0x78f120);}(_0x167e,0xa3));var _0xe167=function(_0x3a88e6,_0x2de33b){_0x3a88e6=_0x3a88e6-0x0;var _0x4db5d8=_0x167e[_0x3a88e6];return _0x4db5d8;};'use strict';var Sequelize=require(_0xe167('0x0'));module[_0xe167('0x1')]={'name':{'type':Sequelize[_0xe167('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xe167('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0xe167('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0xe167('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xe167('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xe167('0x2')],'set':function(_0x5e4863){this[_0xe167('0x5')]('crudPermissions',_0x5e4863?_0x5e4863[_0xe167('0x6')](''):[]);},'get':function(){return this[_0xe167('0x7')](_0xe167('0x8'))?this[_0xe167('0x7')](_0xe167('0x8'))['split'](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index a27a181..056c81b 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 _0x0367=['querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','sendStatus','stack','name','send','index','map','UserProfileSection','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x4ed199,_0x42e046){var _0x144166=function(_0x4ec0a6){while(--_0x4ec0a6){_0x4ed199['push'](_0x4ed199['shift']());}};_0x144166(++_0x42e046);}(_0x0367,0x1a1));var _0x7036=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x0367[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7036('0x0'));var rimraf=require(_0x7036('0x1'));var zipdir=require(_0x7036('0x2'));var jsonpatch=require(_0x7036('0x3'));var rp=require('request-promise');var moment=require(_0x7036('0x4'));var BPromise=require(_0x7036('0x5'));var Mustache=require(_0x7036('0x6'));var util=require('util');var path=require(_0x7036('0x7'));var sox=require(_0x7036('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7036('0x9'));var squel=require(_0x7036('0xa'));var crypto=require(_0x7036('0xb'));var jsforce=require(_0x7036('0xc'));var deskjs=require(_0x7036('0xd'));var toCsv=require(_0x7036('0xe'));var querystring=require(_0x7036('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7036('0x10'));var as=require(_0x7036('0x11'));var hardwareService=require(_0x7036('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7036('0x13'));var db=require(_0x7036('0x14'))['db'];function respondWithStatusCode(_0x42f511,_0x45dfd7){_0x45dfd7=_0x45dfd7||0xcc;return function(_0x3c1219){if(_0x3c1219){return _0x42f511['sendStatus'](_0x45dfd7);}return _0x42f511[_0x7036('0x15')](_0x45dfd7)['end']();};}function respondWithResult(_0x5dc5db,_0x40807a){_0x40807a=_0x40807a||0xc8;return function(_0x511bfe){if(_0x511bfe){return _0x5dc5db[_0x7036('0x15')](_0x40807a)[_0x7036('0x16')](_0x511bfe);}};}function respondWithFilteredResult(_0x13b160,_0x8e2d25){return function(_0x5d8abf){if(_0x5d8abf){var _0x2118eb=_0x5d8abf[_0x7036('0x17')],_0x2d2847=_0x8e2d25[_0x7036('0x18')],_0x13189a=_0x8e2d25[_0x7036('0x18')]+_0x8e2d25[_0x7036('0x19')],_0x1bc737;if(_0x13189a>=_0x2118eb){_0x13189a=_0x2118eb;_0x1bc737=0xc8;}else{_0x1bc737=0xce;}_0x13b160['status'](_0x1bc737);return _0x13b160[_0x7036('0x1a')](_0x7036('0x1b'),_0x2d2847+'-'+_0x13189a+'/'+_0x2118eb)[_0x7036('0x16')](_0x5d8abf);}return null;};}function patchUpdates(_0x581e65){return function(_0x499937){try{jsonpatch[_0x7036('0x1c')](_0x499937,_0x581e65,!![]);}catch(_0x1137ff){return BPromise[_0x7036('0x1d')](_0x1137ff);}return _0x499937[_0x7036('0x1e')]();};}function saveUpdates(_0xefbb48,_0x114f54){return function(_0x354f95){if(_0x354f95){return _0x354f95[_0x7036('0x1f')](_0xefbb48)['then'](function(_0x37a749){return _0x37a749;});}return null;};}function removeEntity(_0x2818d6,_0x2913c2){return function(_0x6b5dcf){if(_0x6b5dcf){return _0x6b5dcf[_0x7036('0x20')]()[_0x7036('0x21')](function(){_0x2818d6[_0x7036('0x15')](0xcc)[_0x7036('0x22')]();});}};}function handleEntityNotFound(_0x4c5489,_0x26cc22){return function(_0x2ecb29){if(!_0x2ecb29){_0x4c5489[_0x7036('0x23')](0x194);}return _0x2ecb29;};}function handleError(_0x570d74,_0x3036a7){_0x3036a7=_0x3036a7||0x1f4;return function(_0x52539f){logger['error'](_0x52539f[_0x7036('0x24')]);if(_0x52539f['name']){delete _0x52539f[_0x7036('0x25')];}_0x570d74[_0x7036('0x15')](_0x3036a7)[_0x7036('0x26')](_0x52539f);};}exports[_0x7036('0x27')]=function(_0x4e08aa,_0x4f3a7f){var _0x23730b={},_0x4c7a1e={},_0x50237c={'count':0x0,'rows':[]};var _0x20605d=_[_0x7036('0x28')](db[_0x7036('0x29')][_0x7036('0x2a')],function(_0x49425d){return{'name':_0x49425d[_0x7036('0x2b')],'type':_0x49425d['type']['key']};});_0x4c7a1e['model']=_['map'](_0x20605d,_0x7036('0x25'));_0x4c7a1e[_0x7036('0x2c')]=_[_0x7036('0x2d')](_0x4e08aa[_0x7036('0x2c')]);_0x4c7a1e[_0x7036('0x2e')]=_[_0x7036('0x2f')](_0x4c7a1e[_0x7036('0x30')],_0x4c7a1e[_0x7036('0x2c')]);_0x23730b[_0x7036('0x31')]=_['intersection'](_0x4c7a1e[_0x7036('0x30')],qs[_0x7036('0x32')](_0x4e08aa[_0x7036('0x2c')][_0x7036('0x32')]));_0x23730b[_0x7036('0x31')]=_0x23730b[_0x7036('0x31')][_0x7036('0x33')]?_0x23730b['attributes']:_0x4c7a1e[_0x7036('0x30')];if(!_0x4e08aa[_0x7036('0x2c')][_0x7036('0x34')]('nolimit')){_0x23730b[_0x7036('0x19')]=qs[_0x7036('0x19')](_0x4e08aa[_0x7036('0x2c')][_0x7036('0x19')]);_0x23730b[_0x7036('0x18')]=qs[_0x7036('0x18')](_0x4e08aa['query'][_0x7036('0x18')]);}_0x23730b[_0x7036('0x35')]=qs[_0x7036('0x36')](_0x4e08aa[_0x7036('0x2c')]['sort']);_0x23730b['where']=qs['filters'](_[_0x7036('0x37')](_0x4e08aa[_0x7036('0x2c')],_0x4c7a1e['filters']));if(_0x4e08aa[_0x7036('0x2c')][_0x7036('0x38')]){_0x23730b['where']=_[_0x7036('0x39')](_0x23730b[_0x7036('0x3a')],{'$or':_[_0x7036('0x28')](_0x20605d,function(_0x2c9bc5){if(_0x2c9bc5['type']!==_0x7036('0x3b')){var _0x477ee2={};_0x477ee2[_0x2c9bc5[_0x7036('0x25')]]={'$like':'%'+_0x4e08aa[_0x7036('0x2c')][_0x7036('0x38')]+'%'};return _0x477ee2;}})});}_0x23730b=_[_0x7036('0x39')]({},_0x23730b,_0x4e08aa[_0x7036('0x3c')]);var _0x3fc157={'where':_0x23730b[_0x7036('0x3a')]};return db['UserProfileSection']['count'](_0x3fc157)[_0x7036('0x21')](function(_0x5cc264){_0x50237c['count']=_0x5cc264;if(_0x4e08aa[_0x7036('0x2c')][_0x7036('0x3d')]){_0x23730b[_0x7036('0x3e')]=[{'all':!![]}];}return db[_0x7036('0x29')][_0x7036('0x3f')](_0x23730b);})[_0x7036('0x21')](function(_0x124997){_0x50237c[_0x7036('0x40')]=_0x124997;return _0x50237c;})[_0x7036('0x21')](respondWithFilteredResult(_0x4f3a7f,_0x23730b))[_0x7036('0x41')](handleError(_0x4f3a7f,null));};exports[_0x7036('0x42')]=function(_0x216a09,_0x699e1){var _0x537423={'raw':![],'where':{'id':_0x216a09[_0x7036('0x43')]['id']}},_0x17c1dc={};_0x17c1dc['model']=_['keys'](db[_0x7036('0x29')][_0x7036('0x2a')]);_0x17c1dc['query']=_[_0x7036('0x2d')](_0x216a09[_0x7036('0x2c')]);_0x17c1dc['filters']=_[_0x7036('0x2f')](_0x17c1dc[_0x7036('0x30')],_0x17c1dc['query']);_0x537423['attributes']=_[_0x7036('0x2f')](_0x17c1dc['model'],qs['fields'](_0x216a09[_0x7036('0x2c')][_0x7036('0x32')]));_0x537423['attributes']=_0x537423['attributes'][_0x7036('0x33')]?_0x537423[_0x7036('0x31')]:_0x17c1dc['model'];if(_0x216a09[_0x7036('0x2c')][_0x7036('0x3d')]){_0x537423[_0x7036('0x3e')]=[{'all':!![]}];}_0x537423=_[_0x7036('0x39')]({},_0x537423,_0x216a09[_0x7036('0x3c')]);return db[_0x7036('0x29')]['find'](_0x537423)[_0x7036('0x21')](handleEntityNotFound(_0x699e1,null))['then'](respondWithResult(_0x699e1,null))[_0x7036('0x41')](handleError(_0x699e1,null));};exports[_0x7036('0x44')]=function(_0x63dc19,_0x1c02b3){return db['UserProfileSection'][_0x7036('0x44')](_0x63dc19[_0x7036('0x45')],{})['then'](respondWithResult(_0x1c02b3,0xc9))['catch'](handleError(_0x1c02b3,null));};exports[_0x7036('0x1f')]=function(_0xa57641,_0x2045e5){if(_0xa57641[_0x7036('0x45')]['id']){delete _0xa57641[_0x7036('0x45')]['id'];}return db['UserProfileSection']['find']({'where':{'id':_0xa57641[_0x7036('0x43')]['id']}})['then'](handleEntityNotFound(_0x2045e5,null))['then'](saveUpdates(_0xa57641[_0x7036('0x45')],null))['then'](respondWithResult(_0x2045e5,null))[_0x7036('0x41')](handleError(_0x2045e5,null));};exports[_0x7036('0x20')]=function(_0x93171,_0xf17044){return db[_0x7036('0x29')][_0x7036('0x46')]({'where':{'id':_0x93171[_0x7036('0x43')]['id']}})[_0x7036('0x21')](handleEntityNotFound(_0xf17044,null))[_0x7036('0x21')](removeEntity(_0xf17044,null))[_0x7036('0x41')](handleError(_0xf17044,null));};exports[_0x7036('0x47')]=function(_0x4e4210,_0x1e8b1f){return db['UserProfileSection'][_0x7036('0x47')]()[_0x7036('0x21')](respondWithResult(_0x1e8b1f,null))['catch'](handleError(_0x1e8b1f,null));}; \ No newline at end of file +var _0xfb3f=['map','name','query','keys','filters','intersection','fields','attributes','length','nolimit','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','find','create','body','update','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','send','UserProfileSection','rawAttributes','fieldName','key','model'];(function(_0x458516,_0x5172d5){var _0x343536=function(_0x226e08){while(--_0x226e08){_0x458516['push'](_0x458516['shift']());}};_0x343536(++_0x5172d5);}(_0xfb3f,0xb2));var _0xffb3=function(_0x44895a,_0x1c1ba6){_0x44895a=_0x44895a-0x0;var _0x16e886=_0xfb3f[_0x44895a];return _0x16e886;};'use strict';var pdf=require(_0xffb3('0x0'));var emlformat=require(_0xffb3('0x1'));var rimraf=require(_0xffb3('0x2'));var zipdir=require(_0xffb3('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xffb3('0x4'));var moment=require(_0xffb3('0x5'));var BPromise=require(_0xffb3('0x6'));var Mustache=require(_0xffb3('0x7'));var util=require('util');var path=require(_0xffb3('0x8'));var sox=require(_0xffb3('0x9'));var csv=require('to-csv');var ejs=require(_0xffb3('0xa'));var fs=require('fs');var _=require(_0xffb3('0xb'));var squel=require(_0xffb3('0xc'));var crypto=require('crypto');var jsforce=require(_0xffb3('0xd'));var deskjs=require(_0xffb3('0xe'));var toCsv=require(_0xffb3('0xf'));var querystring=require(_0xffb3('0x10'));var Papa=require('papaparse');var Redis=require(_0xffb3('0x11'));var authService=require(_0xffb3('0x12'));var qs=require(_0xffb3('0x13'));var as=require(_0xffb3('0x14'));var hardwareService=require(_0xffb3('0x15'));var logger=require(_0xffb3('0x16'))(_0xffb3('0x17'));var utils=require('../../config/utils');var config=require(_0xffb3('0x18'));var db=require(_0xffb3('0x19'))['db'];function respondWithStatusCode(_0x1b76e9,_0x205c5a){_0x205c5a=_0x205c5a||0xcc;return function(_0x4237f7){if(_0x4237f7){return _0x1b76e9[_0xffb3('0x1a')](_0x205c5a);}return _0x1b76e9[_0xffb3('0x1b')](_0x205c5a)[_0xffb3('0x1c')]();};}function respondWithResult(_0x1263b3,_0x2a39e2){_0x2a39e2=_0x2a39e2||0xc8;return function(_0x51f39f){if(_0x51f39f){return _0x1263b3[_0xffb3('0x1b')](_0x2a39e2)[_0xffb3('0x1d')](_0x51f39f);}};}function respondWithFilteredResult(_0x3a5ca3,_0x5840f3){return function(_0x128603){if(_0x128603){var _0x2b3a45=_0x128603[_0xffb3('0x1e')],_0x40e5db=_0x5840f3[_0xffb3('0x1f')],_0x501780=_0x5840f3[_0xffb3('0x1f')]+_0x5840f3[_0xffb3('0x20')],_0x477273;if(_0x501780>=_0x2b3a45){_0x501780=_0x2b3a45;_0x477273=0xc8;}else{_0x477273=0xce;}_0x3a5ca3[_0xffb3('0x1b')](_0x477273);return _0x3a5ca3[_0xffb3('0x21')](_0xffb3('0x22'),_0x40e5db+'-'+_0x501780+'/'+_0x2b3a45)[_0xffb3('0x1d')](_0x128603);}return null;};}function patchUpdates(_0x445db8){return function(_0x1201a7){try{jsonpatch[_0xffb3('0x23')](_0x1201a7,_0x445db8,!![]);}catch(_0x47cc99){return BPromise[_0xffb3('0x24')](_0x47cc99);}return _0x1201a7[_0xffb3('0x25')]();};}function saveUpdates(_0x1123fa,_0x9a3f54){return function(_0x547483){if(_0x547483){return _0x547483['update'](_0x1123fa)[_0xffb3('0x26')](function(_0x4d1823){return _0x4d1823;});}return null;};}function removeEntity(_0x5a9a50,_0x85f806){return function(_0x215082){if(_0x215082){return _0x215082[_0xffb3('0x27')]()[_0xffb3('0x26')](function(){_0x5a9a50[_0xffb3('0x1b')](0xcc)[_0xffb3('0x1c')]();});}};}function handleEntityNotFound(_0x2e1e46,_0x1f9a49){return function(_0x2b0438){if(!_0x2b0438){_0x2e1e46[_0xffb3('0x1a')](0x194);}return _0x2b0438;};}function handleError(_0x46b717,_0x1f7366){_0x1f7366=_0x1f7366||0x1f4;return function(_0x17a71e){logger[_0xffb3('0x28')](_0x17a71e['stack']);if(_0x17a71e['name']){delete _0x17a71e['name'];}_0x46b717['status'](_0x1f7366)[_0xffb3('0x29')](_0x17a71e);};}exports['index']=function(_0x380d0f,_0x1edc06){var _0x5d848a={},_0x4338a7={},_0x5c1338={'count':0x0,'rows':[]};var _0x1bceca=_['map'](db[_0xffb3('0x2a')][_0xffb3('0x2b')],function(_0x774ef8){return{'name':_0x774ef8[_0xffb3('0x2c')],'type':_0x774ef8['type'][_0xffb3('0x2d')]};});_0x4338a7[_0xffb3('0x2e')]=_[_0xffb3('0x2f')](_0x1bceca,_0xffb3('0x30'));_0x4338a7[_0xffb3('0x31')]=_[_0xffb3('0x32')](_0x380d0f['query']);_0x4338a7[_0xffb3('0x33')]=_[_0xffb3('0x34')](_0x4338a7[_0xffb3('0x2e')],_0x4338a7['query']);_0x5d848a['attributes']=_[_0xffb3('0x34')](_0x4338a7[_0xffb3('0x2e')],qs['fields'](_0x380d0f[_0xffb3('0x31')][_0xffb3('0x35')]));_0x5d848a[_0xffb3('0x36')]=_0x5d848a[_0xffb3('0x36')][_0xffb3('0x37')]?_0x5d848a[_0xffb3('0x36')]:_0x4338a7['model'];if(!_0x380d0f[_0xffb3('0x31')]['hasOwnProperty'](_0xffb3('0x38'))){_0x5d848a[_0xffb3('0x20')]=qs[_0xffb3('0x20')](_0x380d0f[_0xffb3('0x31')][_0xffb3('0x20')]);_0x5d848a[_0xffb3('0x1f')]=qs['offset'](_0x380d0f[_0xffb3('0x31')]['offset']);}_0x5d848a['order']=qs['sort'](_0x380d0f['query']['sort']);_0x5d848a[_0xffb3('0x39')]=qs[_0xffb3('0x33')](_[_0xffb3('0x3a')](_0x380d0f[_0xffb3('0x31')],_0x4338a7[_0xffb3('0x33')]));if(_0x380d0f['query']['filter']){_0x5d848a[_0xffb3('0x39')]=_[_0xffb3('0x3b')](_0x5d848a['where'],{'$or':_[_0xffb3('0x2f')](_0x1bceca,function(_0x46c719){if(_0x46c719['type']!==_0xffb3('0x3c')){var _0x3f442d={};_0x3f442d[_0x46c719[_0xffb3('0x30')]]={'$like':'%'+_0x380d0f['query'][_0xffb3('0x3d')]+'%'};return _0x3f442d;}})});}_0x5d848a=_[_0xffb3('0x3b')]({},_0x5d848a,_0x380d0f[_0xffb3('0x3e')]);var _0x36201f={'where':_0x5d848a[_0xffb3('0x39')]};return db[_0xffb3('0x2a')]['count'](_0x36201f)[_0xffb3('0x26')](function(_0x2f3efc){_0x5c1338[_0xffb3('0x1e')]=_0x2f3efc;if(_0x380d0f['query'][_0xffb3('0x3f')]){_0x5d848a[_0xffb3('0x40')]=[{'all':!![]}];}return db['UserProfileSection'][_0xffb3('0x41')](_0x5d848a);})[_0xffb3('0x26')](function(_0x3f9a8a){_0x5c1338[_0xffb3('0x42')]=_0x3f9a8a;return _0x5c1338;})['then'](respondWithFilteredResult(_0x1edc06,_0x5d848a))[_0xffb3('0x43')](handleError(_0x1edc06,null));};exports[_0xffb3('0x44')]=function(_0x2ffcee,_0x5b485a){var _0x52e705={'raw':![],'where':{'id':_0x2ffcee['params']['id']}},_0x32318f={};_0x32318f[_0xffb3('0x2e')]=_[_0xffb3('0x32')](db[_0xffb3('0x2a')][_0xffb3('0x2b')]);_0x32318f[_0xffb3('0x31')]=_[_0xffb3('0x32')](_0x2ffcee[_0xffb3('0x31')]);_0x32318f[_0xffb3('0x33')]=_[_0xffb3('0x34')](_0x32318f[_0xffb3('0x2e')],_0x32318f['query']);_0x52e705[_0xffb3('0x36')]=_[_0xffb3('0x34')](_0x32318f[_0xffb3('0x2e')],qs[_0xffb3('0x35')](_0x2ffcee[_0xffb3('0x31')][_0xffb3('0x35')]));_0x52e705[_0xffb3('0x36')]=_0x52e705[_0xffb3('0x36')][_0xffb3('0x37')]?_0x52e705['attributes']:_0x32318f[_0xffb3('0x2e')];if(_0x2ffcee['query'][_0xffb3('0x3f')]){_0x52e705[_0xffb3('0x40')]=[{'all':!![]}];}_0x52e705=_[_0xffb3('0x3b')]({},_0x52e705,_0x2ffcee[_0xffb3('0x3e')]);return db[_0xffb3('0x2a')][_0xffb3('0x45')](_0x52e705)[_0xffb3('0x26')](handleEntityNotFound(_0x5b485a,null))['then'](respondWithResult(_0x5b485a,null))[_0xffb3('0x43')](handleError(_0x5b485a,null));};exports[_0xffb3('0x46')]=function(_0x34a566,_0x5a5813){return db[_0xffb3('0x2a')][_0xffb3('0x46')](_0x34a566[_0xffb3('0x47')],{})['then'](respondWithResult(_0x5a5813,0xc9))[_0xffb3('0x43')](handleError(_0x5a5813,null));};exports[_0xffb3('0x48')]=function(_0x13cda4,_0x827cdb){if(_0x13cda4[_0xffb3('0x47')]['id']){delete _0x13cda4['body']['id'];}return db[_0xffb3('0x2a')][_0xffb3('0x45')]({'where':{'id':_0x13cda4[_0xffb3('0x49')]['id']}})[_0xffb3('0x26')](handleEntityNotFound(_0x827cdb,null))['then'](saveUpdates(_0x13cda4[_0xffb3('0x47')],null))['then'](respondWithResult(_0x827cdb,null))[_0xffb3('0x43')](handleError(_0x827cdb,null));};exports[_0xffb3('0x27')]=function(_0x2586d9,_0xc29ea3){return db[_0xffb3('0x2a')][_0xffb3('0x45')]({'where':{'id':_0x2586d9[_0xffb3('0x49')]['id']}})['then'](handleEntityNotFound(_0xc29ea3,null))[_0xffb3('0x26')](removeEntity(_0xc29ea3,null))['catch'](handleError(_0xc29ea3,null));};exports[_0xffb3('0x4a')]=function(_0x581adb,_0x35fa4b){return db[_0xffb3('0x2a')][_0xffb3('0x4a')]()[_0xffb3('0x26')](respondWithResult(_0x35fa4b,null))[_0xffb3('0x43')](handleError(_0x35fa4b,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index ef5b5af..1b2c8d2 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 _0x805f=['compositeIndex','userProfileId','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections'];(function(_0x59dae7,_0x3deeab){var _0x50a409=function(_0x386828){while(--_0x386828){_0x59dae7['push'](_0x59dae7['shift']());}};_0x50a409(++_0x3deeab);}(_0x805f,0x110));var _0xf805=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x805f[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0xf805('0x0'));var util=require(_0xf805('0x1'));var logger=require(_0xf805('0x2'))(_0xf805('0x3'));var moment=require(_0xf805('0x4'));var BPromise=require('bluebird');var rp=require(_0xf805('0x5'));var fs=require('fs');var path=require(_0xf805('0x6'));var rimraf=require(_0xf805('0x7'));var config=require('../../config/environment');var attributes=require(_0xf805('0x8'));module[_0xf805('0x9')]=function(_0x1e77a3,_0x162d99){return _0x1e77a3[_0xf805('0xa')](_0xf805('0xb'),attributes,{'tableName':_0xf805('0xc'),'paranoid':![],'indexes':[{'name':_0xf805('0xd'),'fields':['sectionId',_0xf805('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6c74=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','compositeIndex','sectionId','util','api'];(function(_0x5d618e,_0x36fbf8){var _0x499039=function(_0xec6d5a){while(--_0xec6d5a){_0x5d618e['push'](_0x5d618e['shift']());}};_0x499039(++_0x36fbf8);}(_0x6c74,0xb4));var _0x46c7=function(_0x395021,_0x23f0a0){_0x395021=_0x395021-0x0;var _0x5466f8=_0x6c74[_0x395021];return _0x5466f8;};'use strict';var _=require('lodash');var util=require(_0x46c7('0x0'));var logger=require('../../config/logger')(_0x46c7('0x1'));var moment=require(_0x46c7('0x2'));var BPromise=require(_0x46c7('0x3'));var rp=require(_0x46c7('0x4'));var fs=require('fs');var path=require(_0x46c7('0x5'));var rimraf=require(_0x46c7('0x6'));var config=require(_0x46c7('0x7'));var attributes=require(_0x46c7('0x8'));module[_0x46c7('0x9')]=function(_0x2635e2,_0x392ec9){return _0x2635e2[_0x46c7('0xa')](_0x46c7('0xb'),attributes,{'tableName':'user_profile_has_sections','paranoid':![],'indexes':[{'name':_0x46c7('0xc'),'fields':[_0x46c7('0xd'),'userProfileId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 25557f2..a9e4318 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 _0x9486=['UserProfileSection,\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','info','UserProfileSection,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x9486,0x10a));var _0x6948=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9486[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0x6948('0x0'));var util=require(_0x6948('0x1'));var moment=require(_0x6948('0x2'));var BPromise=require(_0x6948('0x3'));var rs=require(_0x6948('0x4'));var fs=require('fs');var Redis=require(_0x6948('0x5'));var db=require(_0x6948('0x6'))['db'];var utils=require(_0x6948('0x7'));var logger=require(_0x6948('0x8'))(_0x6948('0x9'));var config=require(_0x6948('0xa'));var jayson=require(_0x6948('0xb'));var client=jayson[_0x6948('0xc')][_0x6948('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x7222d9,_0x2cc4ec,_0x2a8f46){return new BPromise(function(_0x179560,_0x21c4f2){return client[_0x6948('0xe')](_0x7222d9,_0x2a8f46)[_0x6948('0xf')](function(_0x5ca293){logger[_0x6948('0x10')](_0x6948('0x11'),_0x2cc4ec,_0x6948('0x12'));logger[_0x6948('0x13')](_0x6948('0x14'),_0x2cc4ec,_0x6948('0x12'),JSON['stringify'](_0x5ca293));if(_0x5ca293['error']){if(_0x5ca293[_0x6948('0x15')][_0x6948('0x16')]===0x1f4){logger[_0x6948('0x15')](_0x6948('0x11'),_0x2cc4ec,_0x5ca293[_0x6948('0x15')][_0x6948('0x17')]);return _0x21c4f2(_0x5ca293[_0x6948('0x15')][_0x6948('0x17')]);}logger[_0x6948('0x15')](_0x6948('0x11'),_0x2cc4ec,_0x5ca293[_0x6948('0x15')][_0x6948('0x17')]);return _0x179560(_0x5ca293['error'][_0x6948('0x17')]);}else{logger[_0x6948('0x10')](_0x6948('0x11'),_0x2cc4ec,_0x6948('0x12'));_0x179560(_0x5ca293[_0x6948('0x18')]['message']);}})[_0x6948('0x19')](function(_0x4113db){logger[_0x6948('0x15')](_0x6948('0x11'),_0x2cc4ec,_0x4113db);_0x21c4f2(_0x4113db);});});} \ No newline at end of file +var _0xad69=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserProfileSection,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xad69,0x11d));var _0x9ad6=function(_0x232a64,_0x1c9b4f){_0x232a64=_0x232a64-0x0;var _0xe0469e=_0xad69[_0x232a64];return _0xe0469e;};'use strict';var _=require(_0x9ad6('0x0'));var util=require(_0x9ad6('0x1'));var moment=require(_0x9ad6('0x2'));var BPromise=require(_0x9ad6('0x3'));var rs=require(_0x9ad6('0x4'));var fs=require('fs');var Redis=require(_0x9ad6('0x5'));var db=require(_0x9ad6('0x6'))['db'];var utils=require(_0x9ad6('0x7'));var logger=require(_0x9ad6('0x8'))(_0x9ad6('0x9'));var config=require(_0x9ad6('0xa'));var jayson=require(_0x9ad6('0xb'));var client=jayson[_0x9ad6('0xc')][_0x9ad6('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x37f8be,_0x12c36c,_0x13bd89){return new BPromise(function(_0x437ecf,_0x1f61ee){return client[_0x9ad6('0xe')](_0x37f8be,_0x13bd89)[_0x9ad6('0xf')](function(_0x312691){logger[_0x9ad6('0x10')](_0x9ad6('0x11'),_0x12c36c,'request\x20sent');logger[_0x9ad6('0x12')]('UserProfileSection,\x20%s,\x20%s,\x20%s',_0x12c36c,_0x9ad6('0x13'),JSON[_0x9ad6('0x14')](_0x312691));if(_0x312691[_0x9ad6('0x15')]){if(_0x312691['error'][_0x9ad6('0x16')]===0x1f4){logger[_0x9ad6('0x15')](_0x9ad6('0x11'),_0x12c36c,_0x312691[_0x9ad6('0x15')][_0x9ad6('0x17')]);return _0x1f61ee(_0x312691[_0x9ad6('0x15')][_0x9ad6('0x17')]);}logger[_0x9ad6('0x15')]('UserProfileSection,\x20%s,\x20%s',_0x12c36c,_0x312691['error']['message']);return _0x437ecf(_0x312691[_0x9ad6('0x15')][_0x9ad6('0x17')]);}else{logger[_0x9ad6('0x10')](_0x9ad6('0x11'),_0x12c36c,_0x9ad6('0x13'));_0x437ecf(_0x312691[_0x9ad6('0x18')]['message']);}})[_0x9ad6('0x19')](function(_0x2f5488){logger['error'](_0x9ad6('0x11'),_0x12c36c,_0x2f5488);_0x1f61ee(_0x2f5488);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 1a37cde..ebd7ab8 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 _0x2318=['util','express','Router','../../components/auth/service','exports','multer'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x2318,0x149));var _0x8231=function(_0x121447,_0x20e36e){_0x121447=_0x121447-0x0;var _0x473750=_0x2318[_0x121447];return _0x473750;};'use strict';var multer=require(_0x8231('0x0'));var util=require(_0x8231('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x8231('0x2'));var router=express[_0x8231('0x3')]();var auth=require(_0x8231('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module[_0x8231('0x5')]=router; \ No newline at end of file +var _0xf72a=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x40ec84,_0x25f950){var _0x3c230c=function(_0x46f6b7){while(--_0x46f6b7){_0x40ec84['push'](_0x40ec84['shift']());}};_0x3c230c(++_0x25f950);}(_0xf72a,0x150));var _0xaf72=function(_0x8d34bf,_0x1baf10){_0x8d34bf=_0x8d34bf-0x0;var _0x2165fe=_0xf72a[_0x8d34bf];return _0x2165fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xaf72('0x0'));var timeout=require(_0xaf72('0x1'));var express=require(_0xaf72('0x2'));var router=express[_0xaf72('0x3')]();var auth=require(_0xaf72('0x4'));var interaction=require(_0xaf72('0x5'));var config=require(_0xaf72('0x6'));module[_0xaf72('0x7')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index fa9087f..e089e08 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x1b701e,_0x3d9af3){var _0x46e498=function(_0x1ecfae){while(--_0x1ecfae){_0x1b701e['push'](_0x1b701e['shift']());}};_0x46e498(++_0x3d9af3);}(_0xe706,0xa3));var _0x6e70=function(_0x32a2cf,_0x20b153){_0x32a2cf=_0x32a2cf-0x0;var _0x250e9d=_0xe706[_0x32a2cf];return _0x250e9d;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x1edf2a,_0x55c423){var _0x5698f0=function(_0x237e51){while(--_0x237e51){_0x1edf2a['push'](_0x1edf2a['shift']());}};_0x5698f0(++_0x55c423);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'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/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index f075f79..8d9de0d 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 _0xd3de=['api','moment','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','lodash','../../config/logger'];(function(_0x242e94,_0x5e7681){var _0x171f6b=function(_0x133ed1){while(--_0x133ed1){_0x242e94['push'](_0x242e94['shift']());}};_0x171f6b(++_0x5e7681);}(_0xd3de,0x106));var _0xed3d=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0xd3de[_0x465a0c];return _0x1e202e;};'use strict';var _=require(_0xed3d('0x0'));var util=require('util');var logger=require(_0xed3d('0x1'))(_0xed3d('0x2'));var moment=require(_0xed3d('0x3'));var BPromise=require(_0xed3d('0x4'));var rp=require(_0xed3d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xed3d('0x6'));var attributes=require(_0xed3d('0x7'));module[_0xed3d('0x8')]=function(_0x168e78,_0x2e6fda){return _0x168e78['define'](_0xed3d('0x9'),attributes,{'tableName':_0xed3d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdbc9=['rimraf','../../config/environment','./userSmsQueue.attributes','exports','UserSmsQueue','user_has_sms_queues','../../config/logger','api','moment','request-promise','path'];(function(_0x3c8d87,_0x4f156a){var _0x42a735=function(_0x5bbfde){while(--_0x5bbfde){_0x3c8d87['push'](_0x3c8d87['shift']());}};_0x42a735(++_0x4f156a);}(_0xdbc9,0x192));var _0x9dbc=function(_0x11e1cb,_0x27b781){_0x11e1cb=_0x11e1cb-0x0;var _0x25a4c9=_0xdbc9[_0x11e1cb];return _0x25a4c9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9dbc('0x0'))(_0x9dbc('0x1'));var moment=require(_0x9dbc('0x2'));var BPromise=require('bluebird');var rp=require(_0x9dbc('0x3'));var fs=require('fs');var path=require(_0x9dbc('0x4'));var rimraf=require(_0x9dbc('0x5'));var config=require(_0x9dbc('0x6'));var attributes=require(_0x9dbc('0x7'));module[_0x9dbc('0x8')]=function(_0x5b25b7,_0x4c447e){return _0x5b25b7['define'](_0x9dbc('0x9'),attributes,{'tableName':_0x9dbc('0xa'),'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 22eb75f..ff4f384 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 _0xe741=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','info','result','lodash'];(function(_0x35598a,_0x5cd559){var _0x3979b5=function(_0x14c0e9){while(--_0x14c0e9){_0x35598a['push'](_0x35598a['shift']());}};_0x3979b5(++_0x5cd559);}(_0xe741,0x9f));var _0x1e74=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0xe741[_0x5c2e3e];return _0x53f64a;};'use strict';var _=require(_0x1e74('0x0'));var util=require('util');var moment=require(_0x1e74('0x1'));var BPromise=require(_0x1e74('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1e74('0x3'));var db=require(_0x1e74('0x4'))['db'];var utils=require(_0x1e74('0x5'));var logger=require(_0x1e74('0x6'))('rpc');var config=require(_0x1e74('0x7'));var jayson=require(_0x1e74('0x8'));var client=jayson[_0x1e74('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f6bfe,_0x49830a,_0x5b6ae5){return new BPromise(function(_0x354544,_0x23053a){return client[_0x1e74('0xa')](_0x1f6bfe,_0x5b6ae5)['then'](function(_0x4b457f){logger['info'](_0x1e74('0xb'),_0x49830a,_0x1e74('0xc'));logger[_0x1e74('0xd')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x49830a,_0x1e74('0xc'),JSON[_0x1e74('0xe')](_0x4b457f));if(_0x4b457f['error']){if(_0x4b457f['error'][_0x1e74('0xf')]===0x1f4){logger[_0x1e74('0x10')](_0x1e74('0xb'),_0x49830a,_0x4b457f[_0x1e74('0x10')][_0x1e74('0x11')]);return _0x23053a(_0x4b457f[_0x1e74('0x10')][_0x1e74('0x11')]);}logger[_0x1e74('0x10')](_0x1e74('0xb'),_0x49830a,_0x4b457f[_0x1e74('0x10')][_0x1e74('0x11')]);return _0x354544(_0x4b457f['error'][_0x1e74('0x11')]);}else{logger[_0x1e74('0x12')](_0x1e74('0xb'),_0x49830a,_0x1e74('0xc'));_0x354544(_0x4b457f[_0x1e74('0x13')]['message']);}})['catch'](function(_0xa4345){logger['error'](_0x1e74('0xb'),_0x49830a,_0xa4345);_0x23053a(_0xa4345);});});} \ No newline at end of file +var _0x5549=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','code','message','error','result','catch','lodash','util','bluebird'];(function(_0x42531b,_0x113a1b){var _0x2b453e=function(_0x5c722a){while(--_0x5c722a){_0x42531b['push'](_0x42531b['shift']());}};_0x2b453e(++_0x113a1b);}(_0x5549,0x184));var _0x9554=function(_0x72a9ac,_0xb984f5){_0x72a9ac=_0x72a9ac-0x0;var _0x4c6c1c=_0x5549[_0x72a9ac];return _0x4c6c1c;};'use strict';var _=require(_0x9554('0x0'));var util=require(_0x9554('0x1'));var moment=require('moment');var BPromise=require(_0x9554('0x2'));var rs=require(_0x9554('0x3'));var fs=require('fs');var Redis=require(_0x9554('0x4'));var db=require(_0x9554('0x5'))['db'];var utils=require(_0x9554('0x6'));var logger=require(_0x9554('0x7'))(_0x9554('0x8'));var config=require(_0x9554('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9554('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f77cf,_0x101ffb,_0x2766d7){return new BPromise(function(_0x2d5d2b,_0x2c8515){return client[_0x9554('0xb')](_0x3f77cf,_0x2766d7)[_0x9554('0xc')](function(_0x82a529){logger[_0x9554('0xd')](_0x9554('0xe'),_0x101ffb,_0x9554('0xf'));logger[_0x9554('0x10')](_0x9554('0x11'),_0x101ffb,_0x9554('0xf'),JSON['stringify'](_0x82a529));if(_0x82a529['error']){if(_0x82a529['error'][_0x9554('0x12')]===0x1f4){logger['error']('UserSmsQueue,\x20%s,\x20%s',_0x101ffb,_0x82a529['error'][_0x9554('0x13')]);return _0x2c8515(_0x82a529[_0x9554('0x14')][_0x9554('0x13')]);}logger[_0x9554('0x14')](_0x9554('0xe'),_0x101ffb,_0x82a529['error'][_0x9554('0x13')]);return _0x2d5d2b(_0x82a529['error']['message']);}else{logger[_0x9554('0xd')]('UserSmsQueue,\x20%s,\x20%s',_0x101ffb,_0x9554('0xf'));_0x2d5d2b(_0x82a529[_0x9554('0x15')][_0x9554('0x13')]);}})[_0x9554('0x16')](function(_0x11a75e){logger[_0x9554('0x14')]('UserSmsQueue,\x20%s,\x20%s',_0x101ffb,_0x11a75e);_0x2c8515(_0x11a75e);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index a0b52c0..bc12076 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 _0x10eb=['../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x938940,_0x156936){var _0x357229=function(_0x1ea482){while(--_0x1ea482){_0x938940['push'](_0x938940['shift']());}};_0x357229(++_0x156936);}(_0x10eb,0x197));var _0xb10e=function(_0x44af70,_0x2b1f0a){_0x44af70=_0x44af70-0x0;var _0x295f34=_0x10eb[_0x44af70];return _0x295f34;};'use strict';var multer=require(_0xb10e('0x0'));var util=require(_0xb10e('0x1'));var path=require(_0xb10e('0x2'));var timeout=require(_0xb10e('0x3'));var express=require(_0xb10e('0x4'));var router=express[_0xb10e('0x5')]();var auth=require(_0xb10e('0x6'));var interaction=require(_0xb10e('0x7'));var config=require('../../config/environment');module[_0xb10e('0x8')]=router; \ No newline at end of file +var _0x2629=['exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x138879,_0x36743f){var _0x48b37b=function(_0x861b95){while(--_0x861b95){_0x138879['push'](_0x138879['shift']());}};_0x48b37b(++_0x36743f);}(_0x2629,0x119));var _0x9262=function(_0x34af74,_0x59ab9d){_0x34af74=_0x34af74-0x0;var _0x12d74b=_0x2629[_0x34af74];return _0x12d74b;};'use strict';var multer=require('multer');var util=require(_0x9262('0x0'));var path=require(_0x9262('0x1'));var timeout=require(_0x9262('0x2'));var express=require(_0x9262('0x3'));var router=express['Router']();var auth=require(_0x9262('0x4'));var interaction=require(_0x9262('0x5'));var config=require(_0x9262('0x6'));module[_0x9262('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 1d924dc..2745656 100644 --- a/server/api/userVoiceQueue/userVoiceQueue.attributes.js +++ b/server/api/userVoiceQueue/userVoiceQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe706=['INTEGER','sequelize','exports'];(function(_0x344f2e,_0x39b428){var _0x253491=function(_0x9ba8ac){while(--_0x9ba8ac){_0x344f2e['push'](_0x344f2e['shift']());}};_0x253491(++_0x39b428);}(_0xe706,0xa3));var _0x6e70=function(_0xc8bcf9,_0x30b65e){_0xc8bcf9=_0xc8bcf9-0x0;var _0x460138=_0xe706[_0xc8bcf9];return _0x460138;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x178168,_0x37c8d4){var _0x5fec63=function(_0x53dfc6){while(--_0x53dfc6){_0x178168['push'](_0x178168['shift']());}};_0x5fec63(++_0x37c8d4);}(_0xe706,0xa3));var _0x6e70=function(_0x36c0d1,_0x1d9948){_0x36c0d1=_0x36c0d1-0x0;var _0x59c859=_0xe706[_0x36c0d1];return _0x59c859;};'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/userVoiceQueue/userVoiceQueue.model.js b/server/api/userVoiceQueue/userVoiceQueue.model.js index 48654db..84f327f 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 _0xda55=['util','moment','bluebird','request-promise','path','rimraf','./userVoiceQueue.attributes','define','UserVoiceQueue','user_has_voice_queues','lodash'];(function(_0x100611,_0x4d415d){var _0x2dee52=function(_0x1e2d30){while(--_0x1e2d30){_0x100611['push'](_0x100611['shift']());}};_0x2dee52(++_0x4d415d);}(_0xda55,0x6d));var _0x5da5=function(_0x5903c9,_0x406773){_0x5903c9=_0x5903c9-0x0;var _0x40c65c=_0xda55[_0x5903c9];return _0x40c65c;};'use strict';var _=require(_0x5da5('0x0'));var util=require(_0x5da5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x5da5('0x2'));var BPromise=require(_0x5da5('0x3'));var rp=require(_0x5da5('0x4'));var fs=require('fs');var path=require(_0x5da5('0x5'));var rimraf=require(_0x5da5('0x6'));var config=require('../../config/environment');var attributes=require(_0x5da5('0x7'));module['exports']=function(_0x356a37,_0x58e7b3){return _0x356a37[_0x5da5('0x8')](_0x5da5('0x9'),attributes,{'tableName':_0x5da5('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14d=['util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueue.attributes','exports','user_has_voice_queues','lodash'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xe14d,0x1ee));var _0xde14=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xe14d[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('UserVoiceQueue',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 4b1db08..bbea2b3 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 _0x064e=['UserVoiceQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','UserVoiceQueue,\x20%s,\x20%s','message','result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','debug'];(function(_0xee2dee,_0x265450){var _0x4a8eb5=function(_0x3e06eb){while(--_0x3e06eb){_0xee2dee['push'](_0xee2dee['shift']());}};_0x4a8eb5(++_0x265450);}(_0x064e,0x110));var _0xe064=function(_0x54118c,_0x46f822){_0x54118c=_0x54118c-0x0;var _0x3fe20d=_0x064e[_0x54118c];return _0x3fe20d;};'use strict';var _=require(_0xe064('0x0'));var util=require(_0xe064('0x1'));var moment=require('moment');var BPromise=require(_0xe064('0x2'));var rs=require(_0xe064('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe064('0x4'))['db'];var utils=require(_0xe064('0x5'));var logger=require(_0xe064('0x6'))(_0xe064('0x7'));var config=require(_0xe064('0x8'));var jayson=require(_0xe064('0x9'));var client=jayson['client'][_0xe064('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3e1bfa,_0x113fa4,_0x549ec1){return new BPromise(function(_0x43f33b,_0x42336d){return client[_0xe064('0xb')](_0x3e1bfa,_0x549ec1)['then'](function(_0x504573){logger[_0xe064('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x113fa4,'request\x20sent');logger[_0xe064('0xd')](_0xe064('0xe'),_0x113fa4,_0xe064('0xf'),JSON['stringify'](_0x504573));if(_0x504573[_0xe064('0x10')]){if(_0x504573[_0xe064('0x10')][_0xe064('0x11')]===0x1f4){logger[_0xe064('0x10')](_0xe064('0x12'),_0x113fa4,_0x504573['error'][_0xe064('0x13')]);return _0x42336d(_0x504573['error'][_0xe064('0x13')]);}logger[_0xe064('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x113fa4,_0x504573[_0xe064('0x10')][_0xe064('0x13')]);return _0x43f33b(_0x504573[_0xe064('0x10')]['message']);}else{logger[_0xe064('0xc')](_0xe064('0x12'),_0x113fa4,_0xe064('0xf'));_0x43f33b(_0x504573[_0xe064('0x14')]['message']);}})[_0xe064('0x15')](function(_0x513738){logger[_0xe064('0x10')]('UserVoiceQueue,\x20%s,\x20%s',_0x113fa4,_0x513738);_0x42336d(_0x513738);});});} \ No newline at end of file +var _0xc27f=['stringify','error','code','UserVoiceQueue,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x4e658c,_0x3139a5){var _0x3a2973=function(_0x479a80){while(--_0x479a80){_0x4e658c['push'](_0x4e658c['shift']());}};_0x3a2973(++_0x3139a5);}(_0xc27f,0xb0));var _0xfc27=function(_0x5e047a,_0x272ab9){_0x5e047a=_0x5e047a-0x0;var _0x13b0d5=_0xc27f[_0x5e047a];return _0x13b0d5;};'use strict';var _=require('lodash');var util=require(_0xfc27('0x0'));var moment=require(_0xfc27('0x1'));var BPromise=require(_0xfc27('0x2'));var rs=require(_0xfc27('0x3'));var fs=require('fs');var Redis=require(_0xfc27('0x4'));var db=require(_0xfc27('0x5'))['db'];var utils=require(_0xfc27('0x6'));var logger=require(_0xfc27('0x7'))(_0xfc27('0x8'));var config=require('../../config/environment');var jayson=require(_0xfc27('0x9'));var client=jayson[_0xfc27('0xa')][_0xfc27('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x30e131,_0x18c842,_0x27f2db){return new BPromise(function(_0x109052,_0x236d06){return client[_0xfc27('0xc')](_0x30e131,_0x27f2db)[_0xfc27('0xd')](function(_0x12d68d){logger['info']('UserVoiceQueue,\x20%s,\x20%s',_0x18c842,_0xfc27('0xe'));logger['debug'](_0xfc27('0xf'),_0x18c842,'request\x20sent',JSON[_0xfc27('0x10')](_0x12d68d));if(_0x12d68d[_0xfc27('0x11')]){if(_0x12d68d[_0xfc27('0x11')][_0xfc27('0x12')]===0x1f4){logger['error'](_0xfc27('0x13'),_0x18c842,_0x12d68d[_0xfc27('0x11')][_0xfc27('0x14')]);return _0x236d06(_0x12d68d['error'][_0xfc27('0x14')]);}logger['error'](_0xfc27('0x13'),_0x18c842,_0x12d68d['error']['message']);return _0x109052(_0x12d68d[_0xfc27('0x11')][_0xfc27('0x14')]);}else{logger[_0xfc27('0x15')](_0xfc27('0x13'),_0x18c842,_0xfc27('0xe'));_0x109052(_0x12d68d[_0xfc27('0x16')][_0xfc27('0x14')]);}})[_0xfc27('0x17')](function(_0x3c4758){logger[_0xfc27('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x18c842,_0x3c4758);_0x236d06(_0x3c4758);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index e40ea28..5cab845 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 _0x145a=['../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','connect-timeout','express'];(function(_0x557aea,_0x4a228d){var _0x1f5e0c=function(_0x3a9c9b){while(--_0x3a9c9b){_0x557aea['push'](_0x557aea['shift']());}};_0x1f5e0c(++_0x4a228d);}(_0x145a,0x100));var _0xa145=function(_0x2560fb,_0x515e47){_0x2560fb=_0x2560fb-0x0;var _0x50655c=_0x145a[_0x2560fb];return _0x50655c;};'use strict';var multer=require(_0xa145('0x0'));var util=require(_0xa145('0x1'));var path=require(_0xa145('0x2'));var timeout=require(_0xa145('0x3'));var express=require(_0xa145('0x4'));var router=express['Router']();var auth=require(_0xa145('0x5'));var interaction=require(_0xa145('0x6'));var config=require(_0xa145('0x7'));module[_0xa145('0x8')]=router; \ No newline at end of file +var _0xb850=['multer','util','express','Router','../../components/interaction/service','../../config/environment'];(function(_0x20c6f1,_0x21fa65){var _0x43c3bf=function(_0x40c2dd){while(--_0x40c2dd){_0x20c6f1['push'](_0x20c6f1['shift']());}};_0x43c3bf(++_0x21fa65);}(_0xb850,0x1a4));var _0x0b85=function(_0x502c83,_0x1db15d){_0x502c83=_0x502c83-0x0;var _0x40dd62=_0xb850[_0x502c83];return _0x40dd62;};'use strict';var multer=require(_0x0b85('0x0'));var util=require(_0x0b85('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0b85('0x2'));var router=express[_0x0b85('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0b85('0x4'));var config=require(_0x0b85('0x5'));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 4e2e437..458170f 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 _0xdefa=['sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING','queue_interface'];(function(_0x31d9d7,_0x58c892){var _0x2805ca=function(_0x5083f5){while(--_0x5083f5){_0x31d9d7['push'](_0x31d9d7['shift']());}};_0x2805ca(++_0x58c892);}(_0xdefa,0xf6));var _0xadef=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xdefa[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require(_0xadef('0x0'));module[_0xadef('0x1')]={'uniqueid':{'type':Sequelize[_0xadef('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xadef('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':'Required\x20by\x20Asterisk'},'UserId':{'type':Sequelize[_0xadef('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xadef('0x4')],'allowNull':![],'unique':_0xadef('0x5'),'comment':_0xadef('0x3')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xadef('0x5'),'comment':_0xadef('0x3')},'penalty':{'type':Sequelize[_0xadef('0x2')](0xb),'defaultValue':0x0,'comment':_0xadef('0x3')},'paused':{'type':Sequelize[_0xadef('0x2')](0xb),'defaultValue':0x0,'comment':_0xadef('0x3')}}; \ No newline at end of file +var _0x9d16=['exports','Required\x20by\x20Asterisk','STRING','INTEGER','queue_interface','sequelize'];(function(_0x35f4f9,_0x4521fc){var _0x3d398a=function(_0x88d93){while(--_0x88d93){_0x35f4f9['push'](_0x35f4f9['shift']());}};_0x3d398a(++_0x4521fc);}(_0x9d16,0x119));var _0x69d1=function(_0x3227c1,_0x4318c5){_0x3227c1=_0x3227c1-0x0;var _0x31fd48=_0x9d16[_0x3227c1];return _0x31fd48;};'use strict';var Sequelize=require(_0x69d1('0x0'));module[_0x69d1('0x1')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x69d1('0x2')},'membername':{'type':Sequelize[_0x69d1('0x3')],'allowNull':![],'comment':_0x69d1('0x2')},'UserId':{'type':Sequelize[_0x69d1('0x4')],'allowNull':![]},'queue_name':{'type':Sequelize[_0x69d1('0x3')],'allowNull':![],'unique':'queue_interface','comment':_0x69d1('0x2')},'VoiceQueueId':{'type':Sequelize[_0x69d1('0x4')],'allowNull':![]},'interface':{'type':Sequelize[_0x69d1('0x3')],'allowNull':![],'unique':_0x69d1('0x5'),'comment':_0x69d1('0x2')},'penalty':{'type':Sequelize[_0x69d1('0x4')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x69d1('0x4')](0xb),'defaultValue':0x0,'comment':_0x69d1('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index de26d13..d2382d1 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 _0x4d0c=['save','update','emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners'];(function(_0x4384ea,_0x3810c6){var _0x5c4aae=function(_0x2d3fac){while(--_0x2d3fac){_0x4384ea['push'](_0x4384ea['shift']());}};_0x5c4aae(++_0x3810c6);}(_0x4d0c,0xa6));var _0xc4d0=function(_0xa28c6f,_0x1273f1){_0xa28c6f=_0xa28c6f-0x0;var _0xdb7085=_0x4d0c[_0xa28c6f];return _0xdb7085;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xc4d0('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xc4d0('0x1')](0x0);var events={'afterCreate':_0xc4d0('0x2'),'afterUpdate':_0xc4d0('0x3'),'afterDestroy':'remove'};function emitEvent(_0x42516c){return function(_0x50dcc2,_0x12433a,_0x5228ef){UserVoiceQueueRtEvents[_0xc4d0('0x4')](_0x42516c+':'+_0x50dcc2['id'],_0x50dcc2);UserVoiceQueueRtEvents[_0xc4d0('0x4')](_0x42516c,_0x50dcc2);_0x5228ef(null);};}for(var e in events){if(events[_0xc4d0('0x5')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xc4d0('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xf823=['save','emit','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x458e6c,_0x145c84){var _0x824387=function(_0x3f02d9){while(--_0x3f02d9){_0x458e6c['push'](_0x458e6c['shift']());}};_0x824387(++_0x145c84);}(_0xf823,0x7c));var _0x3f82=function(_0x392fd9,_0x29ca48){_0x392fd9=_0x392fd9-0x0;var _0x305d89=_0xf823[_0x392fd9];return _0x305d89;};'use strict';var EventEmitter=require(_0x3f82('0x0'));var UserVoiceQueueRt=require(_0x3f82('0x1'))['db'][_0x3f82('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x3f82('0x3')](0x0);var events={'afterCreate':_0x3f82('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x7aed4e){return function(_0x51d71b,_0x34606,_0x416c2b){UserVoiceQueueRtEvents['emit'](_0x7aed4e+':'+_0x51d71b['id'],_0x51d71b);UserVoiceQueueRtEvents[_0x3f82('0x5')](_0x7aed4e,_0x51d71b);_0x416c2b(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt[_0x3f82('0x6')](e,emitEvent(event));}}module[_0x3f82('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 2d9e52a..dc47541 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 _0xf74e=['moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','user_has_voice_queues_rt','util','../../config/logger','api'];(function(_0x2d6498,_0xbc7a85){var _0x7dbc9d=function(_0x59e652){while(--_0x59e652){_0x2d6498['push'](_0x2d6498['shift']());}};_0x7dbc9d(++_0xbc7a85);}(_0xf74e,0x147));var _0xef74=function(_0x4f7f65,_0x25f4f6){_0x4f7f65=_0x4f7f65-0x0;var _0xd0556f=_0xf74e[_0x4f7f65];return _0xd0556f;};'use strict';var _=require('lodash');var util=require(_0xef74('0x0'));var logger=require(_0xef74('0x1'))(_0xef74('0x2'));var moment=require(_0xef74('0x3'));var BPromise=require(_0xef74('0x4'));var rp=require(_0xef74('0x5'));var fs=require('fs');var path=require(_0xef74('0x6'));var rimraf=require('rimraf');var config=require(_0xef74('0x7'));var attributes=require(_0xef74('0x8'));module['exports']=function(_0x42069b,_0x4345fe){return _0x42069b['define']('UserVoiceQueueRt',attributes,{'tableName':_0xef74('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd9df=['user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','UserVoiceQueueRt'];(function(_0x45ee7d,_0x4d6f3d){var _0xcfb217=function(_0xd178ef){while(--_0xd178ef){_0x45ee7d['push'](_0x45ee7d['shift']());}};_0xcfb217(++_0x4d6f3d);}(_0xd9df,0xe1));var _0xfd9d=function(_0x191f94,_0x2fdb4b){_0x191f94=_0x191f94-0x0;var _0x169a70=_0xd9df[_0x191f94];return _0x169a70;};'use strict';var _=require(_0xfd9d('0x0'));var util=require(_0xfd9d('0x1'));var logger=require(_0xfd9d('0x2'))(_0xfd9d('0x3'));var moment=require(_0xfd9d('0x4'));var BPromise=require(_0xfd9d('0x5'));var rp=require(_0xfd9d('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfd9d('0x7'));var config=require(_0xfd9d('0x8'));var attributes=require(_0xfd9d('0x9'));module[_0xfd9d('0xa')]=function(_0x12c5ad,_0x4c50a5){return _0x12c5ad[_0xfd9d('0xb')](_0xfd9d('0xc'),attributes,{'tableName':_0xfd9d('0xd'),'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 307b0e9..e166b03 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 _0x04dd=['UserVoiceQueueRt','options','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','GetVoiceQueueRtPauses','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','info','request\x20sent','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','catch'];(function(_0x55de8e,_0x18829c){var _0x489ced=function(_0xb6196f){while(--_0xb6196f){_0x55de8e['push'](_0x55de8e['shift']());}};_0x489ced(++_0x18829c);}(_0x04dd,0x10c));var _0xd04d=function(_0x1ff575,_0xdba21f){_0x1ff575=_0x1ff575-0x0;var _0x48fc9e=_0x04dd[_0x1ff575];return _0x48fc9e;};'use strict';var _=require(_0xd04d('0x0'));var util=require(_0xd04d('0x1'));var moment=require(_0xd04d('0x2'));var BPromise=require(_0xd04d('0x3'));var rs=require(_0xd04d('0x4'));var fs=require('fs');var Redis=require(_0xd04d('0x5'));var db=require(_0xd04d('0x6'))['db'];var utils=require(_0xd04d('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0xd04d('0x8'));var jayson=require(_0xd04d('0x9'));var client=jayson[_0xd04d('0xa')][_0xd04d('0xb')]({'port':0x232a});config[_0xd04d('0xc')]=_[_0xd04d('0xd')](config[_0xd04d('0xc')],{'host':_0xd04d('0xe'),'port':0x18eb});var socket=require(_0xd04d('0xf'))(new Redis(config['redis']));require(_0xd04d('0x10'))[_0xd04d('0x11')](socket);function respondWithRpcPromise(_0x20bcbc,_0x3c4b83,_0xaaec46){return new BPromise(function(_0x35e818,_0x2b0575){return client['request'](_0x20bcbc,_0xaaec46)[_0xd04d('0x12')](function(_0xe43e99){logger[_0xd04d('0x13')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3c4b83,_0xd04d('0x14'));logger['debug'](_0xd04d('0x15'),_0x3c4b83,_0xd04d('0x14'),JSON[_0xd04d('0x16')](_0xe43e99));if(_0xe43e99[_0xd04d('0x17')]){if(_0xe43e99[_0xd04d('0x17')][_0xd04d('0x18')]===0x1f4){logger[_0xd04d('0x17')](_0xd04d('0x19'),_0x3c4b83,_0xe43e99[_0xd04d('0x17')][_0xd04d('0x1a')]);return _0x2b0575(_0xe43e99[_0xd04d('0x17')][_0xd04d('0x1a')]);}logger[_0xd04d('0x17')](_0xd04d('0x19'),_0x3c4b83,_0xe43e99[_0xd04d('0x17')][_0xd04d('0x1a')]);return _0x35e818(_0xe43e99[_0xd04d('0x17')][_0xd04d('0x1a')]);}else{logger[_0xd04d('0x13')](_0xd04d('0x19'),_0x3c4b83,_0xd04d('0x14'));_0x35e818(_0xe43e99['result'][_0xd04d('0x1a')]);}})[_0xd04d('0x1b')](function(_0x2cde94){logger['error']('UserVoiceQueueRt,\x20%s,\x20%s',_0x3c4b83,_0x2cde94);_0x2b0575(_0x2cde94);});});}exports['GetVoiceQueueRtPauses']=function(_0x3a5461){var _0x3deaf8=this;return new Promise(function(_0x8a7459,_0x17e094){return db[_0xd04d('0x1c')]['findAll']({'raw':_0x3a5461[_0xd04d('0x1d')]?_0x3a5461[_0xd04d('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x3a5461[_0xd04d('0x1d')]?_0x3a5461[_0xd04d('0x1d')]['where']||null:null,'attributes':[[db[_0xd04d('0x1e')]['fn'](_0xd04d('0x1f'),db[_0xd04d('0x1e')]['fn']('IF',db[_0xd04d('0x1e')][_0xd04d('0x20')](_0xd04d('0x21')))),_0xd04d('0x22')]]})['then'](function(_0x2ca71f){logger[_0xd04d('0x13')](_0xd04d('0x23'),_0x3a5461);logger[_0xd04d('0x24')](_0xd04d('0x23'),_0x3a5461,JSON[_0xd04d('0x16')](_0x2ca71f));_0x8a7459(_0x2ca71f);})[_0xd04d('0x1b')](function(_0x298e54){logger['error']('GetVoiceQueueRtPauses',_0x298e54[_0xd04d('0x1a')],_0x3a5461);_0x17e094(_0x3deaf8['error'](0x1f4,_0x298e54[_0xd04d('0x1a')]));});});}; \ No newline at end of file +var _0xfa98=['info','debug','stringify','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','error','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','options','raw','where','sequelize','COUNT','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfa98,0x18f));var _0x8fa9=function(_0x421ca9,_0x2faed3){_0x421ca9=_0x421ca9-0x0;var _0x136015=_0xfa98[_0x421ca9];return _0x136015;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8fa9('0x0'));var rs=require(_0x8fa9('0x1'));var fs=require('fs');var Redis=require(_0x8fa9('0x2'));var db=require(_0x8fa9('0x3'))['db'];var utils=require(_0x8fa9('0x4'));var logger=require(_0x8fa9('0x5'))('rpc');var config=require(_0x8fa9('0x6'));var jayson=require(_0x8fa9('0x7'));var client=jayson[_0x8fa9('0x8')]['http']({'port':0x232a});config[_0x8fa9('0x9')]=_[_0x8fa9('0xa')](config[_0x8fa9('0x9')],{'host':_0x8fa9('0xb'),'port':0x18eb});var socket=require(_0x8fa9('0xc'))(new Redis(config[_0x8fa9('0x9')]));require(_0x8fa9('0xd'))[_0x8fa9('0xe')](socket);function respondWithRpcPromise(_0x1a6eaa,_0x3ecc65,_0x3a84fd){return new BPromise(function(_0x174b76,_0x2adba3){return client['request'](_0x1a6eaa,_0x3a84fd)[_0x8fa9('0xf')](function(_0x59fd18){logger['info'](_0x8fa9('0x10'),_0x3ecc65,'request\x20sent');logger['debug']('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x3ecc65,_0x8fa9('0x11'),JSON['stringify'](_0x59fd18));if(_0x59fd18[_0x8fa9('0x12')]){if(_0x59fd18[_0x8fa9('0x12')]['code']===0x1f4){logger[_0x8fa9('0x12')](_0x8fa9('0x10'),_0x3ecc65,_0x59fd18['error'][_0x8fa9('0x13')]);return _0x2adba3(_0x59fd18[_0x8fa9('0x12')][_0x8fa9('0x13')]);}logger[_0x8fa9('0x12')](_0x8fa9('0x10'),_0x3ecc65,_0x59fd18[_0x8fa9('0x12')][_0x8fa9('0x13')]);return _0x174b76(_0x59fd18[_0x8fa9('0x12')][_0x8fa9('0x13')]);}else{logger['info'](_0x8fa9('0x10'),_0x3ecc65,'request\x20sent');_0x174b76(_0x59fd18['result'][_0x8fa9('0x13')]);}})[_0x8fa9('0x14')](function(_0x2c9495){logger[_0x8fa9('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x3ecc65,_0x2c9495);_0x2adba3(_0x2c9495);});});}exports[_0x8fa9('0x15')]=function(_0xebc9bd){var _0x85b5fe=this;return new Promise(function(_0x186842,_0x82c96f){return db[_0x8fa9('0x16')]['findAll']({'raw':_0xebc9bd[_0x8fa9('0x17')]?_0xebc9bd[_0x8fa9('0x17')][_0x8fa9('0x18')]===undefined?!![]:![]:!![],'where':_0xebc9bd[_0x8fa9('0x17')]?_0xebc9bd[_0x8fa9('0x17')][_0x8fa9('0x19')]||null:null,'attributes':[[db[_0x8fa9('0x1a')]['fn'](_0x8fa9('0x1b'),db['sequelize']['fn']('IF',db[_0x8fa9('0x1a')]['literal'](_0x8fa9('0x1c')))),_0x8fa9('0x1d')]]})['then'](function(_0x1aa71a){logger[_0x8fa9('0x1e')](_0x8fa9('0x15'),_0xebc9bd);logger[_0x8fa9('0x1f')](_0x8fa9('0x15'),_0xebc9bd,JSON[_0x8fa9('0x20')](_0x1aa71a));_0x186842(_0x1aa71a);})['catch'](function(_0x1753c7){logger[_0x8fa9('0x12')]('GetVoiceQueueRtPauses',_0x1753c7[_0x8fa9('0x13')],_0xebc9bd);_0x82c96f(_0x85b5fe[_0x8fa9('0x12')](0x1f4,_0x1753c7[_0x8fa9('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 148a8ca..6b45813 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 _0xc788=['removeListener','length','userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove'];(function(_0x406b49,_0x309b95){var _0x53330f=function(_0x5e7865){while(--_0x5e7865){_0x406b49['push'](_0x406b49['shift']());}};_0x53330f(++_0x309b95);}(_0xc788,0xab));var _0x8c78=function(_0x172747,_0x1732bd){_0x172747=_0x172747-0x0;var _0x509692=_0xc788[_0x172747];return _0x509692;};'use strict';var UserVoiceQueueRtEvents=require(_0x8c78('0x0'));var events=[_0x8c78('0x1'),_0x8c78('0x2'),'update'];function createListener(_0x5e11a9,_0x134958){return function(_0x269115){_0x134958['emit'](_0x5e11a9,_0x269115);};}function removeListener(_0x4ccb2c,_0x7fb0db){return function(){UserVoiceQueueRtEvents[_0x8c78('0x3')](_0x4ccb2c,_0x7fb0db);};}exports['register']=function(_0x3eb874){for(var _0x2efec3=0x0,_0x2327b3=events[_0x8c78('0x4')];_0x2efec3<_0x2327b3;_0x2efec3++){var _0x5c5df3=events[_0x2efec3];var _0x469406=createListener(_0x8c78('0x5')+_0x5c5df3,_0x3eb874);UserVoiceQueueRtEvents['on'](_0x5c5df3,_0x469406);}}; \ No newline at end of file +var _0x21ae=['remove','update','emit','removeListener','register','length','./userVoiceQueueRt.events'];(function(_0x576266,_0x4002b0){var _0x18234f=function(_0x4e9ad5){while(--_0x4e9ad5){_0x576266['push'](_0x576266['shift']());}};_0x18234f(++_0x4002b0);}(_0x21ae,0x109));var _0xe21a=function(_0x56d92b,_0x5a4d5e){_0x56d92b=_0x56d92b-0x0;var _0x4d7f32=_0x21ae[_0x56d92b];return _0x4d7f32;};'use strict';var UserVoiceQueueRtEvents=require(_0xe21a('0x0'));var events=['save',_0xe21a('0x1'),_0xe21a('0x2')];function createListener(_0x3f92e9,_0x37e39b){return function(_0x290159){_0x37e39b[_0xe21a('0x3')](_0x3f92e9,_0x290159);};}function removeListener(_0x5c5756,_0x837771){return function(){UserVoiceQueueRtEvents[_0xe21a('0x4')](_0x5c5756,_0x837771);};}exports[_0xe21a('0x5')]=function(_0x1466df){for(var _0x374c9e=0x0,_0x2db0ef=events[_0xe21a('0x6')];_0x374c9e<_0x2db0ef;_0x374c9e++){var _0x2c6928=events[_0x374c9e];var _0x42e726=createListener('userVoiceQueueRt:'+_0x2c6928,_0x1466df);UserVoiceQueueRtEvents['on'](_0x2c6928,_0x42e726);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 2be4fcb..cdac596 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 _0xad9b=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./variable.controller','get','isAuthenticated','index','/:id','show'];(function(_0x38a51e,_0x3c9c92){var _0x401386=function(_0x407df1){while(--_0x407df1){_0x38a51e['push'](_0x38a51e['shift']());}};_0x401386(++_0x3c9c92);}(_0xad9b,0x8b));var _0xbad9=function(_0x231b2c,_0x556d64){_0x231b2c=_0x231b2c-0x0;var _0x1c1e20=_0xad9b[_0x231b2c];return _0x1c1e20;};'use strict';var multer=require(_0xbad9('0x0'));var util=require(_0xbad9('0x1'));var path=require('path');var timeout=require(_0xbad9('0x2'));var express=require(_0xbad9('0x3'));var router=express[_0xbad9('0x4')]();var auth=require(_0xbad9('0x5'));var interaction=require(_0xbad9('0x6'));var config=require('../../config/environment');var controller=require(_0xbad9('0x7'));router[_0xbad9('0x8')]('/',auth[_0xbad9('0x9')](),controller[_0xbad9('0xa')]);router[_0xbad9('0x8')](_0xbad9('0xb'),auth[_0xbad9('0x9')](),controller[_0xbad9('0xc')]);router[_0xbad9('0xd')]('/',auth[_0xbad9('0x9')](),controller[_0xbad9('0xe')]);router[_0xbad9('0xf')](_0xbad9('0xb'),auth[_0xbad9('0x9')](),controller['update']);router[_0xbad9('0x10')](_0xbad9('0xb'),auth['isAuthenticated'](),controller[_0xbad9('0x11')]);module[_0xbad9('0x12')]=router; \ No newline at end of file +var _0x2ea4=['get','isAuthenticated','show','create','delete','destroy','util','path','express','Router','../../components/interaction/service','../../config/environment','./variable.controller'];(function(_0x12ac5e,_0x8c30f0){var _0x46ce7b=function(_0x3c6a0f){while(--_0x3c6a0f){_0x12ac5e['push'](_0x12ac5e['shift']());}};_0x46ce7b(++_0x8c30f0);}(_0x2ea4,0xbc));var _0x42ea=function(_0x104c47,_0x1656e8){_0x104c47=_0x104c47-0x0;var _0x29e84c=_0x2ea4[_0x104c47];return _0x29e84c;};'use strict';var multer=require('multer');var util=require(_0x42ea('0x0'));var path=require(_0x42ea('0x1'));var timeout=require('connect-timeout');var express=require(_0x42ea('0x2'));var router=express[_0x42ea('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x42ea('0x4'));var config=require(_0x42ea('0x5'));var controller=require(_0x42ea('0x6'));router[_0x42ea('0x7')]('/',auth[_0x42ea('0x8')](),controller['index']);router[_0x42ea('0x7')]('/:id',auth[_0x42ea('0x8')](),controller[_0x42ea('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0x42ea('0xa')]);router['put']('/:id',auth[_0x42ea('0x8')](),controller['update']);router[_0x42ea('0xb')]('/:id',auth[_0x42ea('0x8')](),controller[_0x42ea('0xc')]);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 235d9a4..c1b44c8 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 _0xca32=['exports','STRING','sequelize'];(function(_0x13b02f,_0x462a53){var _0x12e9a6=function(_0x187d57){while(--_0x187d57){_0x13b02f['push'](_0x13b02f['shift']());}};_0x12e9a6(++_0x462a53);}(_0xca32,0xc2));var _0x2ca3=function(_0x797bd6,_0x44a2ab){_0x797bd6=_0x797bd6-0x0;var _0x56a1cb=_0xca32[_0x797bd6];return _0x56a1cb;};'use strict';var Sequelize=require(_0x2ca3('0x0'));module[_0x2ca3('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x2ca3('0x2')]}}; \ No newline at end of file +var _0x34dc=['name','STRING'];(function(_0x28314c,_0x5068d2){var _0x2b7c1b=function(_0xcd8016){while(--_0xcd8016){_0x28314c['push'](_0x28314c['shift']());}};_0x2b7c1b(++_0x5068d2);}(_0x34dc,0x125));var _0xc34d=function(_0x127532,_0x489abc){_0x127532=_0x127532-0x0;var _0x5d30f7=_0x34dc[_0x127532];return _0x5d30f7;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc34d('0x0')],'unique':_0xc34d('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xc34d('0x0')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index f985a70..05d40f3 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 _0x1404=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge','VIRTUAL','Variable','includeAll','include','findAll','catch','show','params','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1404,0x1e3));var _0x4140=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x1404[_0x22f8ab];return _0x2a70e5;};'use strict';var pdf=require(_0x4140('0x0'));var emlformat=require(_0x4140('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4140('0x2'));var rp=require(_0x4140('0x3'));var moment=require(_0x4140('0x4'));var BPromise=require(_0x4140('0x5'));var Mustache=require(_0x4140('0x6'));var util=require(_0x4140('0x7'));var path=require(_0x4140('0x8'));var sox=require(_0x4140('0x9'));var csv=require(_0x4140('0xa'));var ejs=require(_0x4140('0xb'));var fs=require('fs');var _=require(_0x4140('0xc'));var squel=require('squel');var crypto=require(_0x4140('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x4140('0xa'));var querystring=require('querystring');var Papa=require(_0x4140('0xe'));var Redis=require(_0x4140('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x4140('0x10'));var as=require(_0x4140('0x11'));var hardwareService=require(_0x4140('0x12'));var logger=require(_0x4140('0x13'))(_0x4140('0x14'));var utils=require(_0x4140('0x15'));var config=require(_0x4140('0x16'));var db=require(_0x4140('0x17'))['db'];function respondWithStatusCode(_0x407b2d,_0x1c83d3){_0x1c83d3=_0x1c83d3||0xcc;return function(_0x161f58){if(_0x161f58){return _0x407b2d[_0x4140('0x18')](_0x1c83d3);}return _0x407b2d['status'](_0x1c83d3)[_0x4140('0x19')]();};}function respondWithResult(_0x298eb8,_0x26dd67){_0x26dd67=_0x26dd67||0xc8;return function(_0xc6bc46){if(_0xc6bc46){return _0x298eb8[_0x4140('0x1a')](_0x26dd67)[_0x4140('0x1b')](_0xc6bc46);}};}function respondWithFilteredResult(_0x316a4f,_0x4e74bb){return function(_0x24727e){if(_0x24727e){var _0x3f3527=_0x24727e[_0x4140('0x1c')],_0x49d91a=_0x4e74bb['offset'],_0x267f96=_0x4e74bb[_0x4140('0x1d')]+_0x4e74bb['limit'],_0x505ba4;if(_0x267f96>=_0x3f3527){_0x267f96=_0x3f3527;_0x505ba4=0xc8;}else{_0x505ba4=0xce;}_0x316a4f['status'](_0x505ba4);return _0x316a4f['set'](_0x4140('0x1e'),_0x49d91a+'-'+_0x267f96+'/'+_0x3f3527)['json'](_0x24727e);}return null;};}function patchUpdates(_0x721583){return function(_0x4a6748){try{jsonpatch[_0x4140('0x1f')](_0x4a6748,_0x721583,!![]);}catch(_0x1c1921){return BPromise[_0x4140('0x20')](_0x1c1921);}return _0x4a6748[_0x4140('0x21')]();};}function saveUpdates(_0x3de583,_0x5975e0){return function(_0x357d6c){if(_0x357d6c){return _0x357d6c['update'](_0x3de583)[_0x4140('0x22')](function(_0x34756f){return _0x34756f;});}return null;};}function removeEntity(_0x26a223,_0x13e313){return function(_0x46303a){if(_0x46303a){return _0x46303a[_0x4140('0x23')]()[_0x4140('0x22')](function(){var _0x4968e9=_0x46303a['get']({'plain':!![]});var _0x3b69ea='Variables';return db['UserProfileResource'][_0x4140('0x23')]({'where':{'type':_0x3b69ea,'resourceId':_0x4968e9['id']}})[_0x4140('0x22')](function(){return _0x46303a;});})[_0x4140('0x22')](function(){_0x26a223[_0x4140('0x1a')](0xcc)[_0x4140('0x19')]();});}};}function handleEntityNotFound(_0x2aa2fd,_0x163695){return function(_0x2863bf){if(!_0x2863bf){_0x2aa2fd['sendStatus'](0x194);}return _0x2863bf;};}function handleError(_0x4d1880,_0x32e372){_0x32e372=_0x32e372||0x1f4;return function(_0x227635){logger[_0x4140('0x24')](_0x227635[_0x4140('0x25')]);if(_0x227635[_0x4140('0x26')]){delete _0x227635[_0x4140('0x26')];}_0x4d1880['status'](_0x32e372)[_0x4140('0x27')](_0x227635);};}exports[_0x4140('0x28')]=function(_0x2934bf,_0x8adf20){var _0x170a2a={},_0x490fef={},_0x1cf728={'count':0x0,'rows':[]};var _0x31fd1b=_[_0x4140('0x29')](db['Variable'][_0x4140('0x2a')],function(_0x4afbd1){return{'name':_0x4afbd1[_0x4140('0x2b')],'type':_0x4afbd1[_0x4140('0x2c')]['key']};});_0x490fef[_0x4140('0x2d')]=_[_0x4140('0x29')](_0x31fd1b,_0x4140('0x26'));_0x490fef[_0x4140('0x2e')]=_[_0x4140('0x2f')](_0x2934bf['query']);_0x490fef[_0x4140('0x30')]=_[_0x4140('0x31')](_0x490fef[_0x4140('0x2d')],_0x490fef['query']);_0x170a2a['attributes']=_['intersection'](_0x490fef[_0x4140('0x2d')],qs[_0x4140('0x32')](_0x2934bf[_0x4140('0x2e')]['fields']));_0x170a2a[_0x4140('0x33')]=_0x170a2a['attributes'][_0x4140('0x34')]?_0x170a2a[_0x4140('0x33')]:_0x490fef[_0x4140('0x2d')];if(!_0x2934bf[_0x4140('0x2e')][_0x4140('0x35')](_0x4140('0x36'))){_0x170a2a[_0x4140('0x37')]=qs['limit'](_0x2934bf[_0x4140('0x2e')][_0x4140('0x37')]);_0x170a2a[_0x4140('0x1d')]=qs[_0x4140('0x1d')](_0x2934bf[_0x4140('0x2e')][_0x4140('0x1d')]);}_0x170a2a[_0x4140('0x38')]=qs['sort'](_0x2934bf['query'][_0x4140('0x39')]);_0x170a2a['where']=qs[_0x4140('0x30')](_['pick'](_0x2934bf[_0x4140('0x2e')],_0x490fef[_0x4140('0x30')]));if(_0x2934bf[_0x4140('0x2e')][_0x4140('0x3a')]){_0x170a2a[_0x4140('0x3b')]=_[_0x4140('0x3c')](_0x170a2a[_0x4140('0x3b')],{'$or':_['map'](_0x31fd1b,function(_0x18ba81){if(_0x18ba81['type']!==_0x4140('0x3d')){var _0xf7f30b={};_0xf7f30b[_0x18ba81[_0x4140('0x26')]]={'$like':'%'+_0x2934bf[_0x4140('0x2e')][_0x4140('0x3a')]+'%'};return _0xf7f30b;}})});}_0x170a2a=_[_0x4140('0x3c')]({},_0x170a2a,_0x2934bf['options']);var _0x125e49={'where':_0x170a2a[_0x4140('0x3b')]};return db[_0x4140('0x3e')]['count'](_0x125e49)[_0x4140('0x22')](function(_0x19acd2){_0x1cf728[_0x4140('0x1c')]=_0x19acd2;if(_0x2934bf['query'][_0x4140('0x3f')]){_0x170a2a[_0x4140('0x40')]=[{'all':!![]}];}return db['Variable'][_0x4140('0x41')](_0x170a2a);})[_0x4140('0x22')](function(_0x337fab){_0x1cf728['rows']=_0x337fab;return _0x1cf728;})[_0x4140('0x22')](respondWithFilteredResult(_0x8adf20,_0x170a2a))[_0x4140('0x42')](handleError(_0x8adf20,null));};exports[_0x4140('0x43')]=function(_0x5673b3,_0x3bc3af){var _0x3a549e={'raw':!![],'where':{'id':_0x5673b3[_0x4140('0x44')]['id']}},_0x4d3160={};_0x4d3160[_0x4140('0x2d')]=_['keys'](db[_0x4140('0x3e')]['rawAttributes']);_0x4d3160[_0x4140('0x2e')]=_['keys'](_0x5673b3['query']);_0x4d3160['filters']=_['intersection'](_0x4d3160[_0x4140('0x2d')],_0x4d3160[_0x4140('0x2e')]);_0x3a549e[_0x4140('0x33')]=_[_0x4140('0x31')](_0x4d3160[_0x4140('0x2d')],qs[_0x4140('0x32')](_0x5673b3[_0x4140('0x2e')][_0x4140('0x32')]));_0x3a549e['attributes']=_0x3a549e[_0x4140('0x33')][_0x4140('0x34')]?_0x3a549e['attributes']:_0x4d3160[_0x4140('0x2d')];if(_0x5673b3['query'][_0x4140('0x3f')]){_0x3a549e[_0x4140('0x40')]=[{'all':!![]}];}_0x3a549e=_[_0x4140('0x3c')]({},_0x3a549e,_0x5673b3[_0x4140('0x45')]);return db['Variable'][_0x4140('0x46')](_0x3a549e)[_0x4140('0x22')](handleEntityNotFound(_0x3bc3af,null))['then'](respondWithResult(_0x3bc3af,null))['catch'](handleError(_0x3bc3af,null));};exports[_0x4140('0x47')]=function(_0x4b108a,_0x3e1ca1){return db['Variable'][_0x4140('0x47')](_0x4b108a[_0x4140('0x48')],{})[_0x4140('0x22')](function(_0x25e981){var _0xa33595=_0x4b108a[_0x4140('0x49')][_0x4140('0x4a')]({'plain':!![]});if(!_0xa33595)throw new Error(_0x4140('0x4b'));if(_0xa33595[_0x4140('0x4c')]==='user'){var _0x54b79b=_0x25e981[_0x4140('0x4a')]({'plain':!![]});var _0x4ae874='Variables';return db[_0x4140('0x4d')][_0x4140('0x46')]({'where':{'name':_0x4ae874,'userProfileId':_0xa33595['userProfileId']},'raw':!![]})['then'](function(_0x57152f){if(_0x57152f&&_0x57152f[_0x4140('0x4e')]===0x0){return db['UserProfileResource']['create']({'name':_0x54b79b['name'],'resourceId':_0x54b79b['id'],'type':_0x57152f['name'],'sectionId':_0x57152f['id']},{})[_0x4140('0x22')](function(){return _0x25e981;});}else{return _0x25e981;}})[_0x4140('0x42')](function(_0x4fed96){logger['error'](_0x4140('0x4f'),_0x4fed96);throw _0x4fed96;});}return _0x25e981;})[_0x4140('0x22')](respondWithResult(_0x3e1ca1,0xc9))[_0x4140('0x42')](handleError(_0x3e1ca1,null));};exports[_0x4140('0x50')]=function(_0x22f8f9,_0x4d5e27){if(_0x22f8f9[_0x4140('0x48')]['id']){delete _0x22f8f9[_0x4140('0x48')]['id'];}return db[_0x4140('0x3e')]['find']({'where':{'id':_0x22f8f9['params']['id']}})[_0x4140('0x22')](handleEntityNotFound(_0x4d5e27,null))[_0x4140('0x22')](saveUpdates(_0x22f8f9[_0x4140('0x48')],null))[_0x4140('0x22')](respondWithResult(_0x4d5e27,null))[_0x4140('0x42')](handleError(_0x4d5e27,null));};exports[_0x4140('0x23')]=function(_0x4fad7d,_0x4ca64e){return db['Variable'][_0x4140('0x46')]({'where':{'id':_0x4fad7d[_0x4140('0x44')]['id']}})[_0x4140('0x22')](handleEntityNotFound(_0x4ca64e,null))['then'](removeEntity(_0x4ca64e,null))[_0x4140('0x42')](handleError(_0x4ca64e,null));}; \ No newline at end of file +var _0x2318=['attributes','fields','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','length','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','save','update','destroy','then','get','Variables','UserProfileResource','error','name','send','index','map','Variable','rawAttributes','fieldName','model','keys','query','filters','intersection'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2318,0x149));var _0x8231=function(_0x2d49d7,_0x333a09){_0x2d49d7=_0x2d49d7-0x0;var _0x232d64=_0x2318[_0x2d49d7];return _0x232d64;};'use strict';var pdf=require(_0x8231('0x0'));var emlformat=require(_0x8231('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x8231('0x2'));var rp=require(_0x8231('0x3'));var moment=require(_0x8231('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8231('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x8231('0x6'));var ejs=require(_0x8231('0x7'));var fs=require('fs');var _=require(_0x8231('0x8'));var squel=require(_0x8231('0x9'));var crypto=require(_0x8231('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x8231('0xb'));var toCsv=require(_0x8231('0x6'));var querystring=require(_0x8231('0xc'));var Papa=require(_0x8231('0xd'));var Redis=require(_0x8231('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x8231('0xf'));var as=require(_0x8231('0x10'));var hardwareService=require(_0x8231('0x11'));var logger=require(_0x8231('0x12'))(_0x8231('0x13'));var utils=require(_0x8231('0x14'));var config=require('../../config/environment');var db=require(_0x8231('0x15'))['db'];function respondWithStatusCode(_0x25bd6c,_0x59941a){_0x59941a=_0x59941a||0xcc;return function(_0x42aae5){if(_0x42aae5){return _0x25bd6c[_0x8231('0x16')](_0x59941a);}return _0x25bd6c[_0x8231('0x17')](_0x59941a)[_0x8231('0x18')]();};}function respondWithResult(_0x4e0877,_0x24b9a1){_0x24b9a1=_0x24b9a1||0xc8;return function(_0x1474ab){if(_0x1474ab){return _0x4e0877[_0x8231('0x17')](_0x24b9a1)['json'](_0x1474ab);}};}function respondWithFilteredResult(_0x20e8f3,_0x28c5a9){return function(_0x356876){if(_0x356876){var _0x84b7b6=_0x356876[_0x8231('0x19')],_0x5bcee9=_0x28c5a9[_0x8231('0x1a')],_0x1f575d=_0x28c5a9[_0x8231('0x1a')]+_0x28c5a9[_0x8231('0x1b')],_0x533e8a;if(_0x1f575d>=_0x84b7b6){_0x1f575d=_0x84b7b6;_0x533e8a=0xc8;}else{_0x533e8a=0xce;}_0x20e8f3[_0x8231('0x17')](_0x533e8a);return _0x20e8f3[_0x8231('0x1c')]('Content-Range',_0x5bcee9+'-'+_0x1f575d+'/'+_0x84b7b6)[_0x8231('0x1d')](_0x356876);}return null;};}function patchUpdates(_0x206959){return function(_0x2b4971){try{jsonpatch[_0x8231('0x1e')](_0x2b4971,_0x206959,!![]);}catch(_0x1a5c5c){return BPromise['reject'](_0x1a5c5c);}return _0x2b4971[_0x8231('0x1f')]();};}function saveUpdates(_0xcdcbf4,_0xe42269){return function(_0x56525d){if(_0x56525d){return _0x56525d[_0x8231('0x20')](_0xcdcbf4)['then'](function(_0x168827){return _0x168827;});}return null;};}function removeEntity(_0x25d7a6,_0x6e2c58){return function(_0x5e141e){if(_0x5e141e){return _0x5e141e[_0x8231('0x21')]()[_0x8231('0x22')](function(){var _0x5f2183=_0x5e141e[_0x8231('0x23')]({'plain':!![]});var _0x520836=_0x8231('0x24');return db[_0x8231('0x25')][_0x8231('0x21')]({'where':{'type':_0x520836,'resourceId':_0x5f2183['id']}})[_0x8231('0x22')](function(){return _0x5e141e;});})['then'](function(){_0x25d7a6[_0x8231('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2794bb,_0x14d006){return function(_0x10975d){if(!_0x10975d){_0x2794bb[_0x8231('0x16')](0x194);}return _0x10975d;};}function handleError(_0x1e9b11,_0x1065d5){_0x1065d5=_0x1065d5||0x1f4;return function(_0x55894a){logger[_0x8231('0x26')](_0x55894a['stack']);if(_0x55894a['name']){delete _0x55894a[_0x8231('0x27')];}_0x1e9b11[_0x8231('0x17')](_0x1065d5)[_0x8231('0x28')](_0x55894a);};}exports[_0x8231('0x29')]=function(_0x4e4a92,_0x41708f){var _0x400385={},_0xec24de={},_0x5a8840={'count':0x0,'rows':[]};var _0x16a79d=_[_0x8231('0x2a')](db[_0x8231('0x2b')][_0x8231('0x2c')],function(_0x58a9bd){return{'name':_0x58a9bd[_0x8231('0x2d')],'type':_0x58a9bd['type']['key']};});_0xec24de[_0x8231('0x2e')]=_[_0x8231('0x2a')](_0x16a79d,_0x8231('0x27'));_0xec24de['query']=_[_0x8231('0x2f')](_0x4e4a92[_0x8231('0x30')]);_0xec24de[_0x8231('0x31')]=_[_0x8231('0x32')](_0xec24de[_0x8231('0x2e')],_0xec24de[_0x8231('0x30')]);_0x400385[_0x8231('0x33')]=_[_0x8231('0x32')](_0xec24de[_0x8231('0x2e')],qs[_0x8231('0x34')](_0x4e4a92['query']['fields']));_0x400385['attributes']=_0x400385['attributes']['length']?_0x400385[_0x8231('0x33')]:_0xec24de[_0x8231('0x2e')];if(!_0x4e4a92[_0x8231('0x30')][_0x8231('0x35')]('nolimit')){_0x400385[_0x8231('0x1b')]=qs[_0x8231('0x1b')](_0x4e4a92['query'][_0x8231('0x1b')]);_0x400385[_0x8231('0x1a')]=qs[_0x8231('0x1a')](_0x4e4a92[_0x8231('0x30')][_0x8231('0x1a')]);}_0x400385[_0x8231('0x36')]=qs[_0x8231('0x37')](_0x4e4a92['query']['sort']);_0x400385[_0x8231('0x38')]=qs[_0x8231('0x31')](_['pick'](_0x4e4a92[_0x8231('0x30')],_0xec24de[_0x8231('0x31')]));if(_0x4e4a92[_0x8231('0x30')][_0x8231('0x39')]){_0x400385[_0x8231('0x38')]=_[_0x8231('0x3a')](_0x400385['where'],{'$or':_[_0x8231('0x2a')](_0x16a79d,function(_0x3ab4a1){if(_0x3ab4a1['type']!==_0x8231('0x3b')){var _0x6f64ea={};_0x6f64ea[_0x3ab4a1[_0x8231('0x27')]]={'$like':'%'+_0x4e4a92[_0x8231('0x30')][_0x8231('0x39')]+'%'};return _0x6f64ea;}})});}_0x400385=_['merge']({},_0x400385,_0x4e4a92['options']);var _0x13197a={'where':_0x400385[_0x8231('0x38')]};return db['Variable'][_0x8231('0x19')](_0x13197a)['then'](function(_0x4f89c1){_0x5a8840[_0x8231('0x19')]=_0x4f89c1;if(_0x4e4a92[_0x8231('0x30')][_0x8231('0x3c')]){_0x400385[_0x8231('0x3d')]=[{'all':!![]}];}return db[_0x8231('0x2b')][_0x8231('0x3e')](_0x400385);})['then'](function(_0x11a82b){_0x5a8840[_0x8231('0x3f')]=_0x11a82b;return _0x5a8840;})['then'](respondWithFilteredResult(_0x41708f,_0x400385))['catch'](handleError(_0x41708f,null));};exports[_0x8231('0x40')]=function(_0x504e62,_0x15371a){var _0x4dc777={'raw':!![],'where':{'id':_0x504e62[_0x8231('0x41')]['id']}},_0x3b348f={};_0x3b348f[_0x8231('0x2e')]=_[_0x8231('0x2f')](db[_0x8231('0x2b')][_0x8231('0x2c')]);_0x3b348f[_0x8231('0x30')]=_[_0x8231('0x2f')](_0x504e62[_0x8231('0x30')]);_0x3b348f['filters']=_[_0x8231('0x32')](_0x3b348f[_0x8231('0x2e')],_0x3b348f[_0x8231('0x30')]);_0x4dc777[_0x8231('0x33')]=_['intersection'](_0x3b348f[_0x8231('0x2e')],qs[_0x8231('0x34')](_0x504e62[_0x8231('0x30')]['fields']));_0x4dc777[_0x8231('0x33')]=_0x4dc777['attributes'][_0x8231('0x42')]?_0x4dc777[_0x8231('0x33')]:_0x3b348f[_0x8231('0x2e')];if(_0x504e62['query'][_0x8231('0x3c')]){_0x4dc777[_0x8231('0x3d')]=[{'all':!![]}];}_0x4dc777=_[_0x8231('0x3a')]({},_0x4dc777,_0x504e62['options']);return db['Variable'][_0x8231('0x43')](_0x4dc777)[_0x8231('0x22')](handleEntityNotFound(_0x15371a,null))['then'](respondWithResult(_0x15371a,null))[_0x8231('0x44')](handleError(_0x15371a,null));};exports[_0x8231('0x45')]=function(_0x2c84d5,_0x5d53d9){return db[_0x8231('0x2b')][_0x8231('0x45')](_0x2c84d5['body'],{})[_0x8231('0x22')](function(_0x50f109){var _0x18591e=_0x2c84d5[_0x8231('0x46')]['get']({'plain':!![]});if(!_0x18591e)throw new Error(_0x8231('0x47'));if(_0x18591e['role']===_0x8231('0x46')){var _0x2ce9d2=_0x50f109['get']({'plain':!![]});var _0x4c1d5c=_0x8231('0x24');return db[_0x8231('0x48')][_0x8231('0x43')]({'where':{'name':_0x4c1d5c,'userProfileId':_0x18591e[_0x8231('0x49')]},'raw':!![]})['then'](function(_0x451be0){if(_0x451be0&&_0x451be0['autoAssociation']===0x0){return db[_0x8231('0x25')]['create']({'name':_0x2ce9d2['name'],'resourceId':_0x2ce9d2['id'],'type':_0x451be0[_0x8231('0x27')],'sectionId':_0x451be0['id']},{})[_0x8231('0x22')](function(){return _0x50f109;});}else{return _0x50f109;}})[_0x8231('0x44')](function(_0x5921e6){logger[_0x8231('0x26')](_0x8231('0x4a'),_0x5921e6);throw _0x5921e6;});}return _0x50f109;})['then'](respondWithResult(_0x5d53d9,0xc9))['catch'](handleError(_0x5d53d9,null));};exports[_0x8231('0x20')]=function(_0x55113a,_0xd822f6){if(_0x55113a[_0x8231('0x4b')]['id']){delete _0x55113a[_0x8231('0x4b')]['id'];}return db[_0x8231('0x2b')][_0x8231('0x43')]({'where':{'id':_0x55113a[_0x8231('0x41')]['id']}})[_0x8231('0x22')](handleEntityNotFound(_0xd822f6,null))[_0x8231('0x22')](saveUpdates(_0x55113a[_0x8231('0x4b')],null))[_0x8231('0x22')](respondWithResult(_0xd822f6,null))[_0x8231('0x44')](handleError(_0xd822f6,null));};exports[_0x8231('0x21')]=function(_0xe28798,_0xa2afc1){return db[_0x8231('0x2b')][_0x8231('0x43')]({'where':{'id':_0xe28798[_0x8231('0x41')]['id']}})[_0x8231('0x22')](handleEntityNotFound(_0xa2afc1,null))['then'](removeEntity(_0xa2afc1,null))['catch'](handleError(_0xa2afc1,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 5f96525..b13fadc 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 _0x2b84=['moment','bluebird','path','rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash','../../config/logger','api'];(function(_0x1ccb95,_0x1b3be8){var _0x1a9725=function(_0x1a6bf7){while(--_0x1a6bf7){_0x1ccb95['push'](_0x1ccb95['shift']());}};_0x1a9725(++_0x1b3be8);}(_0x2b84,0x105));var _0x42b8=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0x2b84[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x42b8('0x0'));var util=require('util');var logger=require(_0x42b8('0x1'))(_0x42b8('0x2'));var moment=require(_0x42b8('0x3'));var BPromise=require(_0x42b8('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x42b8('0x5'));var rimraf=require(_0x42b8('0x6'));var config=require(_0x42b8('0x7'));var attributes=require(_0x42b8('0x8'));module[_0x42b8('0x9')]=function(_0x396739,_0x25b33e){return _0x396739[_0x42b8('0xa')]('Variable',attributes,{'tableName':_0x42b8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe13a=['./variable.attributes','exports','define','tools_variables','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x1423a7,_0x1dcf38){var _0x26db03=function(_0x72814b){while(--_0x72814b){_0x1423a7['push'](_0x1423a7['shift']());}};_0x26db03(++_0x1dcf38);}(_0xe13a,0x178));var _0xae13=function(_0x34b2f1,_0x170cc9){_0x34b2f1=_0x34b2f1-0x0;var _0x2302b9=_0xe13a[_0x34b2f1];return _0x2302b9;};'use strict';var _=require('lodash');var util=require(_0xae13('0x0'));var logger=require(_0xae13('0x1'))(_0xae13('0x2'));var moment=require(_0xae13('0x3'));var BPromise=require('bluebird');var rp=require(_0xae13('0x4'));var fs=require('fs');var path=require(_0xae13('0x5'));var rimraf=require(_0xae13('0x6'));var config=require(_0xae13('0x7'));var attributes=require(_0xae13('0x8'));module[_0xae13('0x9')]=function(_0x412a07,_0x3379ed){return _0x412a07[_0xae13('0xa')]('Variable',attributes,{'tableName':_0xae13('0xb'),'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 69e9956..5fd56d1 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 _0x9f53=['info','Variable,\x20%s,\x20%s','request\x20sent','Variable,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowVariable','Variable','find','options','raw','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x347352,_0x437d50){var _0x27f1f7=function(_0x5d586b){while(--_0x5d586b){_0x347352['push'](_0x347352['shift']());}};_0x27f1f7(++_0x437d50);}(_0x9f53,0x192));var _0x39f5=function(_0x3c4f25,_0x19c40d){_0x3c4f25=_0x3c4f25-0x0;var _0x2ea2de=_0x9f53[_0x3c4f25];return _0x2ea2de;};'use strict';var _=require(_0x39f5('0x0'));var util=require(_0x39f5('0x1'));var moment=require(_0x39f5('0x2'));var BPromise=require(_0x39f5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x39f5('0x5'));var logger=require(_0x39f5('0x6'))(_0x39f5('0x7'));var config=require(_0x39f5('0x8'));var jayson=require(_0x39f5('0x9'));var client=jayson[_0x39f5('0xa')][_0x39f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x526ced,_0x165e08,_0x2e06f8){return new BPromise(function(_0x5a8c80,_0x1bb9d3){return client[_0x39f5('0xc')](_0x526ced,_0x2e06f8)[_0x39f5('0xd')](function(_0x4b1bd7){logger[_0x39f5('0xe')](_0x39f5('0xf'),_0x165e08,_0x39f5('0x10'));logger['debug'](_0x39f5('0x11'),_0x165e08,_0x39f5('0x10'),JSON['stringify'](_0x4b1bd7));if(_0x4b1bd7[_0x39f5('0x12')]){if(_0x4b1bd7[_0x39f5('0x12')][_0x39f5('0x13')]===0x1f4){logger['error'](_0x39f5('0xf'),_0x165e08,_0x4b1bd7['error'][_0x39f5('0x14')]);return _0x1bb9d3(_0x4b1bd7[_0x39f5('0x12')][_0x39f5('0x14')]);}logger['error'](_0x39f5('0xf'),_0x165e08,_0x4b1bd7[_0x39f5('0x12')]['message']);return _0x5a8c80(_0x4b1bd7[_0x39f5('0x12')][_0x39f5('0x14')]);}else{logger['info'](_0x39f5('0xf'),_0x165e08,_0x39f5('0x10'));_0x5a8c80(_0x4b1bd7['result'][_0x39f5('0x14')]);}})[_0x39f5('0x15')](function(_0x46eddc){logger[_0x39f5('0x12')](_0x39f5('0xf'),_0x165e08,_0x46eddc);_0x1bb9d3(_0x46eddc);});});}exports[_0x39f5('0x16')]=function(_0xe52334){var _0x199a00=this;return new Promise(function(_0x4195cc,_0x4098a0){return db[_0x39f5('0x17')][_0x39f5('0x18')]({'raw':_0xe52334[_0x39f5('0x19')]?_0xe52334[_0x39f5('0x19')][_0x39f5('0x1a')]===undefined?!![]:![]:!![],'where':_0xe52334[_0x39f5('0x19')]?_0xe52334[_0x39f5('0x19')][_0x39f5('0x1b')]||null:null,'attributes':_0xe52334[_0x39f5('0x19')]?_0xe52334[_0x39f5('0x19')][_0x39f5('0x1c')]||null:null,'include':_0xe52334['options']?_0xe52334[_0x39f5('0x19')][_0x39f5('0x1d')]?_['map'](_0xe52334[_0x39f5('0x19')][_0x39f5('0x1d')],function(_0x213d01){return{'model':db[_0x213d01['model']],'as':_0x213d01['as'],'attributes':_0x213d01['attributes'],'include':_0x213d01['include']?_[_0x39f5('0x1e')](_0x213d01[_0x39f5('0x1d')],function(_0x4b1397){return{'model':db[_0x4b1397[_0x39f5('0x1f')]],'as':_0x4b1397['as'],'attributes':_0x4b1397[_0x39f5('0x1c')],'include':_0x4b1397[_0x39f5('0x1d')]?_[_0x39f5('0x1e')](_0x4b1397[_0x39f5('0x1d')],function(_0x4561a9){return{'model':db[_0x4561a9[_0x39f5('0x1f')]],'as':_0x4561a9['as'],'attributes':_0x4561a9[_0x39f5('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x39f5('0xd')](function(_0x5526f0){logger[_0x39f5('0xe')]('ShowVariable',_0xe52334);logger['debug']('ShowVariable',_0xe52334,JSON['stringify'](_0x5526f0));_0x4195cc(_0x5526f0);})[_0x39f5('0x15')](function(_0x5767cc){logger[_0x39f5('0x12')](_0x39f5('0x16'),_0x5767cc[_0x39f5('0x14')],_0xe52334);_0x4098a0(_0x199a00[_0x39f5('0x12')](0x1f4,_0x5767cc['message']));});});}; \ No newline at end of file +var _0x6849=['http','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','ShowVariable','Variable','options','raw','where','attributes','map','include','model','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','client'];(function(_0x34a3bc,_0x313f67){var _0x3e6943=function(_0x522324){while(--_0x522324){_0x34a3bc['push'](_0x34a3bc['shift']());}};_0x3e6943(++_0x313f67);}(_0x6849,0x6c));var _0x9684=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6849[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x9684('0x0'));var util=require(_0x9684('0x1'));var moment=require(_0x9684('0x2'));var BPromise=require('bluebird');var rs=require(_0x9684('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9684('0x4'))['db'];var utils=require(_0x9684('0x5'));var logger=require(_0x9684('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9684('0x7')][_0x9684('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3519a5,_0x6473ad,_0x3b254d){return new BPromise(function(_0x3becc1,_0xc8fe16){return client[_0x9684('0x9')](_0x3519a5,_0x3b254d)[_0x9684('0xa')](function(_0x514f39){logger[_0x9684('0xb')](_0x9684('0xc'),_0x6473ad,_0x9684('0xd'));logger['debug']('Variable,\x20%s,\x20%s,\x20%s',_0x6473ad,_0x9684('0xd'),JSON[_0x9684('0xe')](_0x514f39));if(_0x514f39['error']){if(_0x514f39[_0x9684('0xf')][_0x9684('0x10')]===0x1f4){logger['error'](_0x9684('0xc'),_0x6473ad,_0x514f39[_0x9684('0xf')][_0x9684('0x11')]);return _0xc8fe16(_0x514f39[_0x9684('0xf')][_0x9684('0x11')]);}logger[_0x9684('0xf')](_0x9684('0xc'),_0x6473ad,_0x514f39[_0x9684('0xf')][_0x9684('0x11')]);return _0x3becc1(_0x514f39[_0x9684('0xf')][_0x9684('0x11')]);}else{logger[_0x9684('0xb')](_0x9684('0xc'),_0x6473ad,_0x9684('0xd'));_0x3becc1(_0x514f39[_0x9684('0x12')]['message']);}})['catch'](function(_0x53338f){logger[_0x9684('0xf')](_0x9684('0xc'),_0x6473ad,_0x53338f);_0xc8fe16(_0x53338f);});});}exports[_0x9684('0x13')]=function(_0x471fcb){var _0x12e8dd=this;return new Promise(function(_0x1ce6bb,_0x67e460){return db[_0x9684('0x14')]['find']({'raw':_0x471fcb[_0x9684('0x15')]?_0x471fcb[_0x9684('0x15')][_0x9684('0x16')]===undefined?!![]:![]:!![],'where':_0x471fcb[_0x9684('0x15')]?_0x471fcb[_0x9684('0x15')][_0x9684('0x17')]||null:null,'attributes':_0x471fcb[_0x9684('0x15')]?_0x471fcb[_0x9684('0x15')][_0x9684('0x18')]||null:null,'include':_0x471fcb['options']?_0x471fcb['options']['include']?_[_0x9684('0x19')](_0x471fcb[_0x9684('0x15')][_0x9684('0x1a')],function(_0xa57d9d){return{'model':db[_0xa57d9d['model']],'as':_0xa57d9d['as'],'attributes':_0xa57d9d[_0x9684('0x18')],'include':_0xa57d9d[_0x9684('0x1a')]?_[_0x9684('0x19')](_0xa57d9d[_0x9684('0x1a')],function(_0x566499){return{'model':db[_0x566499[_0x9684('0x1b')]],'as':_0x566499['as'],'attributes':_0x566499[_0x9684('0x18')],'include':_0x566499[_0x9684('0x1a')]?_[_0x9684('0x19')](_0x566499['include'],function(_0x5682ff){return{'model':db[_0x5682ff[_0x9684('0x1b')]],'as':_0x5682ff['as'],'attributes':_0x5682ff[_0x9684('0x18')]};}):[]};}):[]};}):[]:[]})[_0x9684('0xa')](function(_0x10b652){logger[_0x9684('0xb')](_0x9684('0x13'),_0x471fcb);logger['debug']('ShowVariable',_0x471fcb,JSON[_0x9684('0xe')](_0x10b652));_0x1ce6bb(_0x10b652);})[_0x9684('0x1c')](function(_0x3fba67){logger[_0x9684('0xf')](_0x9684('0x13'),_0x3fba67[_0x9684('0x11')],_0x471fcb);_0x67e460(_0x12e8dd[_0x9684('0xf')](0x1f4,_0x3fba67[_0x9684('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 439c264..e8aeb5f 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 _0xfeb8=['reset','/pull','pull','/restart','isAuthenticated','restart','/migrations','migrations','exports','./version.controller','get','index','/fetch','canUpdate'];(function(_0x11b87b,_0x38f46c){var _0x5d06ec=function(_0x3f1b70){while(--_0x3f1b70){_0x11b87b['push'](_0x11b87b['shift']());}};_0x5d06ec(++_0x38f46c);}(_0xfeb8,0x167));var _0x8feb=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfeb8[_0x20a584];return _0x4b41a8;};'use strict';var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var controller=require(_0x8feb('0x0'));router[_0x8feb('0x1')]('/',controller[_0x8feb('0x2')]);router[_0x8feb('0x1')](_0x8feb('0x3'),auth['isAuthenticated'](),auth[_0x8feb('0x4')](),controller['fetch']);router['get']('/reset',auth['isAuthenticated'](),auth[_0x8feb('0x4')](),controller[_0x8feb('0x5')]);router['get'](_0x8feb('0x6'),auth['isAuthenticated'](),auth[_0x8feb('0x4')](),controller[_0x8feb('0x7')]);router[_0x8feb('0x1')](_0x8feb('0x8'),auth[_0x8feb('0x9')](),controller[_0x8feb('0xa')]);router[_0x8feb('0x1')](_0x8feb('0xb'),controller[_0x8feb('0xc')]);module[_0x8feb('0xd')]=router; \ No newline at end of file +var _0x4bdc=['/migrations','migrations','exports','express','Router','../../components/auth/service','./version.controller','index','get','isAuthenticated','canUpdate','reset','/pull'];(function(_0x257a1a,_0x29d85a){var _0x36320a=function(_0x50eb7d){while(--_0x50eb7d){_0x257a1a['push'](_0x257a1a['shift']());}};_0x36320a(++_0x29d85a);}(_0x4bdc,0x155));var _0xc4bd=function(_0x5db176,_0x3f569d){_0x5db176=_0x5db176-0x0;var _0x2d93b6=_0x4bdc[_0x5db176];return _0x2d93b6;};'use strict';var express=require(_0xc4bd('0x0'));var router=express[_0xc4bd('0x1')]();var auth=require(_0xc4bd('0x2'));var controller=require(_0xc4bd('0x3'));router['get']('/',controller[_0xc4bd('0x4')]);router[_0xc4bd('0x5')]('/fetch',auth[_0xc4bd('0x6')](),auth['canUpdate'](),controller['fetch']);router[_0xc4bd('0x5')]('/reset',auth[_0xc4bd('0x6')](),auth[_0xc4bd('0x7')](),controller[_0xc4bd('0x8')]);router[_0xc4bd('0x5')](_0xc4bd('0x9'),auth['isAuthenticated'](),auth[_0xc4bd('0x7')](),controller['pull']);router[_0xc4bd('0x5')]('/restart',auth[_0xc4bd('0x6')](),controller['restart']);router[_0xc4bd('0x5')](_0xc4bd('0xa'),controller[_0xc4bd('0xb')]);module[_0xc4bd('0xc')]=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index 361d905..e6cfe17 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 _0xc2a2=['info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','pm2\x20restart\x20motion\x20%s','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','migrations','readdirSync','join','root','server','length','replace','.js','exports','push','sort','sequelize','Migration','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','then','last','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','compare-versions','child_process','exec','../../config/environment','../../config/pm2','../../config/logger','update','version','query','latest','fetch','tags','2.0.0','status','json','master','error'];(function(_0x506e0b,_0x46074c){var _0x31941a=function(_0x2947bf){while(--_0x2947bf){_0x506e0b['push'](_0x506e0b['shift']());}};_0x31941a(++_0x46074c);}(_0xc2a2,0x84));var _0x2c2a=function(_0x1bd1c0,_0x3aa8cc){_0x1bd1c0=_0x1bd1c0-0x0;var _0x5f2a8c=_0xc2a2[_0x1bd1c0];return _0x5f2a8c;};'use strict';var Umzug=require(_0x2c2a('0x0'));var path=require(_0x2c2a('0x1'));var fs=require('fs');var _=require(_0x2c2a('0x2'));var pkginfo=require(_0x2c2a('0x3'))(module,'version');var compareVersions=require(_0x2c2a('0x4'));var exec=require(_0x2c2a('0x5'))[_0x2c2a('0x6')];var db=require('../../mysqldb')['db'];var config=require(_0x2c2a('0x7'));var pm2=require(_0x2c2a('0x8'));var logger=require(_0x2c2a('0x9'))(_0x2c2a('0xa'));var git=require('simple-git')(config['root']);exports['index']=function(_0x578a80,_0x48a901){var _0x5cc8c5={'current':module['exports'][_0x2c2a('0xb')],'phonebar':0x2};if(_0x578a80['query']&&_0x578a80[_0x2c2a('0xc')][_0x2c2a('0xd')]){return git[_0x2c2a('0xe')]()[_0x2c2a('0xf')](function(_0x221deb,_0x26bd2f){_0x5cc8c5['latest']=(_0x221deb?module['exports'][_0x2c2a('0xb')]:_0x26bd2f[_0x2c2a('0xd')])||_0x2c2a('0x10');return _0x48a901[_0x2c2a('0x11')](0xc8)[_0x2c2a('0x12')](_0x5cc8c5);});}else{return _0x48a901[_0x2c2a('0x11')](0xc8)['json'](_0x5cc8c5);}};exports[_0x2c2a('0xe')]=function(_0x3443ee,_0x50e4d0){return git[_0x2c2a('0xe')](['origin',_0x2c2a('0x13')],function(_0x4c5faa){if(_0x4c5faa){logger[_0x2c2a('0x14')](_0x4c5faa);return _0x50e4d0[_0x2c2a('0x11')](0x1f4)['json'](_0x4c5faa);}logger[_0x2c2a('0x15')](_0x2c2a('0x16'));return _0x50e4d0[_0x2c2a('0x11')](0xc8)[_0x2c2a('0x12')]({'output':_0x2c2a('0x17')});});};exports[_0x2c2a('0x18')]=function(_0x4b5724,_0x53fe55){return git[_0x2c2a('0x18')](['--hard',_0x2c2a('0x19')],function(_0x401b5e){if(_0x401b5e){logger[_0x2c2a('0x14')](_0x401b5e);return _0x53fe55[_0x2c2a('0x11')](0x1f4)[_0x2c2a('0x12')](_0x401b5e);}logger[_0x2c2a('0x15')](_0x2c2a('0x1a'));return _0x53fe55[_0x2c2a('0x11')](0xc8)[_0x2c2a('0x12')]({'output':_0x2c2a('0x1b')});});};exports['pull']=function(_0x1896f2,_0x593027){exec(_0x2c2a('0x1c'),function(_0x3bf453,_0x5c2e06,_0x36927b){logger[_0x2c2a('0x15')](_0x5c2e06);logger[_0x2c2a('0x15')](_0x36927b);if(_0x3bf453){logger['error'](_0x3bf453);return _0x593027[_0x2c2a('0x11')](0x1f4)[_0x2c2a('0x12')](_0x3bf453);}return _0x593027[_0x2c2a('0x11')](0xc8)[_0x2c2a('0x12')]({'output':_0x5c2e06});});};exports[_0x2c2a('0x1d')]=function(_0x10573c,_0x46fddf){return pm2[_0x2c2a('0x1d')]('motion2')['then'](function(_0x5afa5f){logger['info'](_0x2c2a('0x1e'),_0x5afa5f);return _0x46fddf[_0x2c2a('0x11')](0xc8)[_0x2c2a('0x12')]({'output':_0x2c2a('0x1f')});})[_0x2c2a('0x20')](function(_0x43239d){logger['error'](_0x43239d);return _0x46fddf['status'](0x1f4)[_0x2c2a('0x12')](_0x43239d);});};exports[_0x2c2a('0x21')]=function(_0x10e371,_0x27dc1b){var _0x5c2fbb=fs[_0x2c2a('0x22')](path[_0x2c2a('0x23')](config[_0x2c2a('0x24')],_0x2c2a('0x25'),_0x2c2a('0x21')));var _0x2fcd8b=[];for(var _0x49e451=0x0;_0x49e451<_0x5c2fbb[_0x2c2a('0x26')];_0x49e451++){var _0x5059b9=_0x5c2fbb[_0x49e451][_0x2c2a('0x27')](_0x2c2a('0x28'),'');if(compareVersions(module[_0x2c2a('0x29')][_0x2c2a('0xb')],_0x5059b9)===-0x1){_0x2fcd8b[_0x2c2a('0x2a')](_0x5059b9);}}if(_0x2fcd8b['length']){var _0x3327f7=_0x2fcd8b[_0x2c2a('0x2b')](compareVersions);var _0x19b86f=new Umzug({'storage':_0x2c2a('0x2c'),'storageOptions':{'model':db[_0x2c2a('0x2d')],'modelName':'Migration','columnName':_0x2c2a('0xb')},'migrations':{'params':[db[_0x2c2a('0x2c')]['getQueryInterface'](),db[_0x2c2a('0x2c')]['constructor'],function(){throw new Error(_0x2c2a('0x2e'));}],'path':path[_0x2c2a('0x23')](config[_0x2c2a('0x24')],_0x2c2a('0x25'),_0x2c2a('0x21')),'pattern':/\.js$/}});_0x19b86f['up']({'migrations':_[_0x2c2a('0x2f')](_0x3327f7,function(_0x3ff77b){return _0x3ff77b+'.js';})})[_0x2c2a('0x30')](function(){return _0x27dc1b[_0x2c2a('0x11')](0xc8)[_0x2c2a('0x12')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module['exports'][_0x2c2a('0xb')]+'\x20to\x20'+_[_0x2c2a('0x31')](_0x3327f7),'migrations':_[_0x2c2a('0x23')](_0x3327f7)});})[_0x2c2a('0x20')](function(_0x3e6b12){if(_0x3e6b12 instanceof db[_0x2c2a('0x2c')]['UniqueConstraintError']){return _0x27dc1b[_0x2c2a('0x11')](0xc8)[_0x2c2a('0x12')]({'output':_0x2c2a('0x32')});}else{return _0x27dc1b[_0x2c2a('0x11')](0x1f4)[_0x2c2a('0x12')](_0x3e6b12);}});}else{return _0x27dc1b[_0x2c2a('0x11')](0xc8)[_0x2c2a('0x12')]({'output':_0x2c2a('0x32')});}}; \ No newline at end of file +var _0x0137=['migrations','replace','.js','length','sequelize','Migration','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','map','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','path','lodash','pkginfo','version','child_process','exec','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','query','latest','tags','exports','2.0.0','status','json','fetch','origin','master','info','git\x20fetch','reset','--hard','error','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','readdirSync','join','server'];(function(_0x53d210,_0x4874c7){var _0x4ea418=function(_0x43326e){while(--_0x43326e){_0x53d210['push'](_0x53d210['shift']());}};_0x4ea418(++_0x4874c7);}(_0x0137,0x1d8));var _0x7013=function(_0x16629d,_0x492375){_0x16629d=_0x16629d-0x0;var _0x56ccee=_0x0137[_0x16629d];return _0x56ccee;};'use strict';var Umzug=require(_0x7013('0x0'));var path=require(_0x7013('0x1'));var fs=require('fs');var _=require(_0x7013('0x2'));var pkginfo=require(_0x7013('0x3'))(module,_0x7013('0x4'));var compareVersions=require('compare-versions');var exec=require(_0x7013('0x5'))[_0x7013('0x6')];var db=require(_0x7013('0x7'))['db'];var config=require(_0x7013('0x8'));var pm2=require(_0x7013('0x9'));var logger=require(_0x7013('0xa'))('update');var git=require(_0x7013('0xb'))(config[_0x7013('0xc')]);exports['index']=function(_0x16c0c8,_0x16dae3){var _0x1b748c={'current':module['exports'][_0x7013('0x4')],'phonebar':0x2};if(_0x16c0c8[_0x7013('0xd')]&&_0x16c0c8[_0x7013('0xd')][_0x7013('0xe')]){return git['fetch']()[_0x7013('0xf')](function(_0x2b74b3,_0x1a8995){_0x1b748c[_0x7013('0xe')]=(_0x2b74b3?module[_0x7013('0x10')][_0x7013('0x4')]:_0x1a8995['latest'])||_0x7013('0x11');return _0x16dae3[_0x7013('0x12')](0xc8)[_0x7013('0x13')](_0x1b748c);});}else{return _0x16dae3[_0x7013('0x12')](0xc8)[_0x7013('0x13')](_0x1b748c);}};exports[_0x7013('0x14')]=function(_0x1032c1,_0x35ee96){return git[_0x7013('0x14')]([_0x7013('0x15'),_0x7013('0x16')],function(_0x4af565){if(_0x4af565){logger['error'](_0x4af565);return _0x35ee96[_0x7013('0x12')](0x1f4)[_0x7013('0x13')](_0x4af565);}logger[_0x7013('0x17')](_0x7013('0x18'));return _0x35ee96[_0x7013('0x12')](0xc8)['json']({'output':'git\x20fetch\x20origin\x20master'});});};exports[_0x7013('0x19')]=function(_0x159a59,_0x161a19){return git[_0x7013('0x19')]([_0x7013('0x1a'),'FETCH_HEAD'],function(_0x25a64d){if(_0x25a64d){logger[_0x7013('0x1b')](_0x25a64d);return _0x161a19['status'](0x1f4)['json'](_0x25a64d);}logger[_0x7013('0x17')](_0x7013('0x1c'));return _0x161a19[_0x7013('0x12')](0xc8)['json']({'output':_0x7013('0x1d')});});};exports['pull']=function(_0x2e4177,_0x2314af){exec(_0x7013('0x1e'),function(_0x2ab843,_0x3bb319,_0x44c93a){logger[_0x7013('0x17')](_0x3bb319);logger[_0x7013('0x17')](_0x44c93a);if(_0x2ab843){logger[_0x7013('0x1b')](_0x2ab843);return _0x2314af[_0x7013('0x12')](0x1f4)[_0x7013('0x13')](_0x2ab843);}return _0x2314af[_0x7013('0x12')](0xc8)[_0x7013('0x13')]({'output':_0x3bb319});});};exports[_0x7013('0x1f')]=function(_0x35653e,_0x1e0a2d){return pm2[_0x7013('0x1f')](_0x7013('0x20'))[_0x7013('0x21')](function(_0x2e591b){logger[_0x7013('0x17')]('pm2\x20restart\x20motion\x20%s',_0x2e591b);return _0x1e0a2d[_0x7013('0x12')](0xc8)[_0x7013('0x13')]({'output':_0x7013('0x22')});})['catch'](function(_0x15c3eb){logger['error'](_0x15c3eb);return _0x1e0a2d[_0x7013('0x12')](0x1f4)[_0x7013('0x13')](_0x15c3eb);});};exports['migrations']=function(_0x1511c0,_0x5435cf){var _0xeb8cd5=fs[_0x7013('0x23')](path[_0x7013('0x24')](config['root'],_0x7013('0x25'),_0x7013('0x26')));var _0x406322=[];for(var _0xe8090=0x0;_0xe8090<_0xeb8cd5['length'];_0xe8090++){var _0x44ab0b=_0xeb8cd5[_0xe8090][_0x7013('0x27')](_0x7013('0x28'),'');if(compareVersions(module[_0x7013('0x10')]['version'],_0x44ab0b)===-0x1){_0x406322['push'](_0x44ab0b);}}if(_0x406322[_0x7013('0x29')]){var _0x133551=_0x406322['sort'](compareVersions);var _0x204c5e=new Umzug({'storage':_0x7013('0x2a'),'storageOptions':{'model':db[_0x7013('0x2b')],'modelName':_0x7013('0x2b'),'columnName':_0x7013('0x4')},'migrations':{'params':[db[_0x7013('0x2a')]['getQueryInterface'](),db['sequelize'][_0x7013('0x2c')],function(){throw new Error(_0x7013('0x2d'));}],'path':path[_0x7013('0x24')](config[_0x7013('0xc')],_0x7013('0x25'),'migrations'),'pattern':/\.js$/}});_0x204c5e['up']({'migrations':_[_0x7013('0x2e')](_0x133551,function(_0x526b3e){return _0x526b3e+'.js';})})['then'](function(){return _0x5435cf['status'](0xc8)[_0x7013('0x13')]({'output':'Database\x20migrated\x20successfully\x20from\x20version\x20'+module[_0x7013('0x10')]['version']+_0x7013('0x2f')+_[_0x7013('0x30')](_0x133551),'migrations':_[_0x7013('0x24')](_0x133551)});})['catch'](function(_0x38a6ae){if(_0x38a6ae instanceof db[_0x7013('0x2a')][_0x7013('0x31')]){return _0x5435cf[_0x7013('0x12')](0xc8)[_0x7013('0x13')]({'output':_0x7013('0x32')});}else{return _0x5435cf[_0x7013('0x12')](0x1f4)[_0x7013('0x13')](_0x38a6ae);}});}else{return _0x5435cf[_0x7013('0x12')](0xc8)['json']({'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 ee27499..72bc917 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 _0xb9f5=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show','create','put','delete','destroy','multer'];(function(_0x17f780,_0x5a0f93){var _0x5d0fa8=function(_0x4492a9){while(--_0x4492a9){_0x17f780['push'](_0x17f780['shift']());}};_0x5d0fa8(++_0x5a0f93);}(_0xb9f5,0xc5));var _0x5b9f=function(_0x2253ea,_0x6320e){_0x2253ea=_0x2253ea-0x0;var _0x2d046c=_0xb9f5[_0x2253ea];return _0x2d046c;};'use strict';var multer=require(_0x5b9f('0x0'));var util=require('util');var path=require(_0x5b9f('0x1'));var timeout=require(_0x5b9f('0x2'));var express=require(_0x5b9f('0x3'));var router=express[_0x5b9f('0x4')]();var auth=require(_0x5b9f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5b9f('0x6'));var controller=require(_0x5b9f('0x7'));router[_0x5b9f('0x8')]('/',auth[_0x5b9f('0x9')](),controller['index']);router[_0x5b9f('0x8')](_0x5b9f('0xa'),auth[_0x5b9f('0x9')](),controller[_0x5b9f('0xb')]);router[_0x5b9f('0x8')](_0x5b9f('0xc'),auth[_0x5b9f('0x9')](),controller[_0x5b9f('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x5b9f('0xe')]);router[_0x5b9f('0xf')](_0x5b9f('0xc'),auth[_0x5b9f('0x9')](),controller['update']);router[_0x5b9f('0x10')](_0x5b9f('0xc'),auth['isAuthenticated'](),controller[_0x5b9f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xe1da=['delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','describe','show','post','create','put','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe1da,0x1bb));var _0xae1d=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xe1da[_0x122ef9];return _0x42fba0;};'use strict';var multer=require(_0xae1d('0x0'));var util=require(_0xae1d('0x1'));var path=require(_0xae1d('0x2'));var timeout=require('connect-timeout');var express=require(_0xae1d('0x3'));var router=express['Router']();var auth=require(_0xae1d('0x4'));var interaction=require(_0xae1d('0x5'));var config=require(_0xae1d('0x6'));var controller=require(_0xae1d('0x7'));router[_0xae1d('0x8')]('/',auth[_0xae1d('0x9')](),controller[_0xae1d('0xa')]);router[_0xae1d('0x8')]('/describe',auth[_0xae1d('0x9')](),controller[_0xae1d('0xb')]);router[_0xae1d('0x8')]('/:id',auth[_0xae1d('0x9')](),controller[_0xae1d('0xc')]);router[_0xae1d('0xd')]('/',auth[_0xae1d('0x9')](),controller[_0xae1d('0xe')]);router[_0xae1d('0xf')](_0xae1d('0x10'),auth[_0xae1d('0x9')](),controller['update']);router[_0xae1d('0x11')](_0xae1d('0x10'),auth[_0xae1d('0x9')](),controller[_0xae1d('0x12')]);module[_0xae1d('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index adcda05..6b35559 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 _0x98a8=['sequelize','exports','STRING','DATE','INTEGER','BOOLEAN'];(function(_0x30ac3d,_0x4e09bb){var _0x18df5d=function(_0xe56e9){while(--_0xe56e9){_0x30ac3d['push'](_0x30ac3d['shift']());}};_0x18df5d(++_0x4e09bb);}(_0x98a8,0x12c));var _0x898a=function(_0x4f70c6,_0x30c72c){_0x4f70c6=_0x4f70c6-0x0;var _0x1bfa1a=_0x98a8[_0x4f70c6];return _0x1bfa1a;};'use strict';var Sequelize=require(_0x898a('0x0'));module[_0x898a('0x1')]={'type':{'type':Sequelize[_0x898a('0x2')]},'uniqueid':{'type':Sequelize[_0x898a('0x2')]},'calleridnum':{'type':Sequelize[_0x898a('0x2')]},'calleridname':{'type':Sequelize[_0x898a('0x2')]},'queue':{'type':Sequelize[_0x898a('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x898a('0x2')]},'agentcalledAt':{'type':Sequelize[_0x898a('0x3')]},'agentconnectAt':{'type':Sequelize[_0x898a('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x898a('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x898a('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x898a('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x898a('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'talktime':{'type':Sequelize[_0x898a('0x4')]},'agentacw':{'type':Sequelize[_0x898a('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x898a('0x4')]},'reason':{'type':Sequelize[_0x898a('0x2')]},'lastevent':{'type':Sequelize[_0x898a('0x2')]},'channel':{'type':Sequelize[_0x898a('0x2')]},'channelstate':{'type':Sequelize[_0x898a('0x4')]},'channelstatedesc':{'type':Sequelize[_0x898a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x898a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x898a('0x2')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x898a('0x2')]},'destchannel':{'type':Sequelize[_0x898a('0x2')]},'destchannelstate':{'type':Sequelize[_0x898a('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x898a('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x898a('0x2')]},'destlanguage':{'type':Sequelize[_0x898a('0x2')]},'destaccountcode':{'type':Sequelize[_0x898a('0x2')]},'destcontext':{'type':Sequelize[_0x898a('0x2')]},'destexten':{'type':Sequelize[_0x898a('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x898a('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x898a('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x898a('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x898a('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x898a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf2ca=['STRING','DATE','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports'];(function(_0x14afeb,_0x1d2903){var _0x7c708a=function(_0x363c25){while(--_0x363c25){_0x14afeb['push'](_0x14afeb['shift']());}};_0x7c708a(++_0x1d2903);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x57408b,_0xb7cbc5){_0x57408b=_0x57408b-0x0;var _0x31a897=_0xf2ca[_0x57408b];return _0x31a897;};'use strict';var Sequelize=require(_0xaf2c('0x0'));module[_0xaf2c('0x1')]={'type':{'type':Sequelize[_0xaf2c('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'calleridname':{'type':Sequelize[_0xaf2c('0x2')]},'queue':{'type':Sequelize[_0xaf2c('0x2')]},'interface':{'type':Sequelize[_0xaf2c('0x2')]},'membername':{'type':Sequelize[_0xaf2c('0x2')]},'agentcalledAt':{'type':Sequelize[_0xaf2c('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0xaf2c('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0xaf2c('0x3')]},'agentdumpAt':{'type':Sequelize[_0xaf2c('0x3')]},'holdtime':{'type':Sequelize[_0xaf2c('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0xaf2c('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xaf2c('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xaf2c('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xaf2c('0x2')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaf2c('0x2')]},'channelstate':{'type':Sequelize[_0xaf2c('0x4')]},'channelstatedesc':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xaf2c('0x2')]},'context':{'type':Sequelize[_0xaf2c('0x2')]},'exten':{'type':Sequelize[_0xaf2c('0x2')]},'priority':{'type':Sequelize[_0xaf2c('0x2')]},'destchannel':{'type':Sequelize[_0xaf2c('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xaf2c('0x2')]},'destcalleridname':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xaf2c('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xaf2c('0x2')]},'destlanguage':{'type':Sequelize[_0xaf2c('0x2')]},'destaccountcode':{'type':Sequelize[_0xaf2c('0x2')]},'destcontext':{'type':Sequelize[_0xaf2c('0x2')]},'destexten':{'type':Sequelize[_0xaf2c('0x2')]},'destpriority':{'type':Sequelize[_0xaf2c('0x2')]},'destuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0xaf2c('0x2')]},'transfer':{'type':Sequelize[_0xaf2c('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xaf2c('0x2')],'comment':_0xaf2c('0x6')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xaf2c('0x2')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 5ec762e..f43383e 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 _0x053b=['limit','set','Content-Range','json','apply','reject','save','then','destroy','end','error','name','VoiceAgentReport','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','map','type','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','length','merge','options','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','offset'];(function(_0x2e7b1b,_0x4b375e){var _0x167cf5=function(_0x3121c7){while(--_0x3121c7){_0x2e7b1b['push'](_0x2e7b1b['shift']());}};_0x167cf5(++_0x4b375e);}(_0x053b,0xc3));var _0xb053=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x053b[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xb053('0x0'));var emlformat=require(_0xb053('0x1'));var rimraf=require(_0xb053('0x2'));var zipdir=require(_0xb053('0x3'));var jsonpatch=require(_0xb053('0x4'));var rp=require(_0xb053('0x5'));var moment=require('moment');var BPromise=require(_0xb053('0x6'));var Mustache=require(_0xb053('0x7'));var util=require(_0xb053('0x8'));var path=require(_0xb053('0x9'));var sox=require(_0xb053('0xa'));var csv=require(_0xb053('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb053('0xc'));var squel=require(_0xb053('0xd'));var crypto=require(_0xb053('0xe'));var jsforce=require(_0xb053('0xf'));var deskjs=require(_0xb053('0x10'));var toCsv=require(_0xb053('0xb'));var querystring=require(_0xb053('0x11'));var Papa=require(_0xb053('0x12'));var Redis=require(_0xb053('0x13'));var authService=require(_0xb053('0x14'));var qs=require(_0xb053('0x15'));var as=require(_0xb053('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb053('0x17'))(_0xb053('0x18'));var utils=require(_0xb053('0x19'));var config=require('../../config/environment');var db=require(_0xb053('0x1a'))['db'];function respondWithStatusCode(_0x567fc1,_0x2da7d8){_0x2da7d8=_0x2da7d8||0xcc;return function(_0x3db229){if(_0x3db229){return _0x567fc1[_0xb053('0x1b')](_0x2da7d8);}return _0x567fc1[_0xb053('0x1c')](_0x2da7d8)['end']();};}function respondWithResult(_0x3d29ee,_0x57fec0){_0x57fec0=_0x57fec0||0xc8;return function(_0x22f677){if(_0x22f677){return _0x3d29ee[_0xb053('0x1c')](_0x57fec0)['json'](_0x22f677);}};}function respondWithFilteredResult(_0x1969e1,_0x860fee){return function(_0x17bb5f){if(_0x17bb5f){var _0x3cd4f3=_0x17bb5f['count'],_0x75d03f=_0x860fee[_0xb053('0x1d')],_0x3fd388=_0x860fee['offset']+_0x860fee[_0xb053('0x1e')],_0x2b79df;if(_0x3fd388>=_0x3cd4f3){_0x3fd388=_0x3cd4f3;_0x2b79df=0xc8;}else{_0x2b79df=0xce;}_0x1969e1[_0xb053('0x1c')](_0x2b79df);return _0x1969e1[_0xb053('0x1f')](_0xb053('0x20'),_0x75d03f+'-'+_0x3fd388+'/'+_0x3cd4f3)[_0xb053('0x21')](_0x17bb5f);}return null;};}function patchUpdates(_0x4737e6){return function(_0x486e41){try{jsonpatch[_0xb053('0x22')](_0x486e41,_0x4737e6,!![]);}catch(_0x2dae87){return BPromise[_0xb053('0x23')](_0x2dae87);}return _0x486e41[_0xb053('0x24')]();};}function saveUpdates(_0x566042,_0xdcfa36){return function(_0x180177){if(_0x180177){return _0x180177['update'](_0x566042)[_0xb053('0x25')](function(_0x44fe58){return _0x44fe58;});}return null;};}function removeEntity(_0x2e71cf,_0x1d48b1){return function(_0x5b9028){if(_0x5b9028){return _0x5b9028[_0xb053('0x26')]()[_0xb053('0x25')](function(){_0x2e71cf[_0xb053('0x1c')](0xcc)[_0xb053('0x27')]();});}};}function handleEntityNotFound(_0x58935f,_0x208045){return function(_0x2c8876){if(!_0x2c8876){_0x58935f[_0xb053('0x1b')](0x194);}return _0x2c8876;};}function handleError(_0x445319,_0x5d9087){_0x5d9087=_0x5d9087||0x1f4;return function(_0x495dac){logger[_0xb053('0x28')](_0x495dac['stack']);if(_0x495dac[_0xb053('0x29')]){delete _0x495dac[_0xb053('0x29')];}_0x445319[_0xb053('0x1c')](_0x5d9087)['send'](_0x495dac);};}exports['index']=function(_0x490a99,_0x57c5e8){var _0x748f6a={},_0x353817={},_0x3b873b={'count':0x0,'rows':[]};var _0x22fd0e=_['map'](db[_0xb053('0x2a')][_0xb053('0x2b')],function(_0x548985){return{'name':_0x548985[_0xb053('0x2c')],'type':_0x548985['type']['key']};});_0x353817[_0xb053('0x2d')]=_['map'](_0x22fd0e,_0xb053('0x29'));_0x353817[_0xb053('0x2e')]=_[_0xb053('0x2f')](_0x490a99['query']);_0x353817[_0xb053('0x30')]=_[_0xb053('0x31')](_0x353817['model'],_0x353817['query']);_0x748f6a['attributes']=_['intersection'](_0x353817[_0xb053('0x2d')],qs[_0xb053('0x32')](_0x490a99[_0xb053('0x2e')][_0xb053('0x32')]));_0x748f6a['attributes']=_0x748f6a[_0xb053('0x33')]['length']?_0x748f6a['attributes']:_0x353817[_0xb053('0x2d')];if(!_0x490a99[_0xb053('0x2e')]['hasOwnProperty'](_0xb053('0x34'))){_0x748f6a[_0xb053('0x1e')]=qs['limit'](_0x490a99['query'][_0xb053('0x1e')]);_0x748f6a['offset']=qs[_0xb053('0x1d')](_0x490a99['query'][_0xb053('0x1d')]);}_0x748f6a[_0xb053('0x35')]=qs[_0xb053('0x36')](_0x490a99[_0xb053('0x2e')][_0xb053('0x36')]);_0x748f6a[_0xb053('0x37')]=qs[_0xb053('0x30')](_[_0xb053('0x38')](_0x490a99['query'],_0x353817['filters']));if(_0x490a99['query'][_0xb053('0x39')]){_0x748f6a[_0xb053('0x37')]=_['merge'](_0x748f6a[_0xb053('0x37')],{'$or':_[_0xb053('0x3a')](_0x22fd0e,function(_0x2881f5){if(_0x2881f5[_0xb053('0x3b')]!==_0xb053('0x3c')){var _0x25f605={};_0x25f605[_0x2881f5[_0xb053('0x29')]]={'$like':'%'+_0x490a99['query'][_0xb053('0x39')]+'%'};return _0x25f605;}})});}_0x748f6a=_['merge']({},_0x748f6a,_0x490a99['options']);var _0xd9e6fa={'where':_0x748f6a[_0xb053('0x37')]};return db[_0xb053('0x2a')][_0xb053('0x3d')](_0xd9e6fa)['then'](function(_0x1d3301){_0x3b873b['count']=_0x1d3301;if(_0x490a99[_0xb053('0x2e')][_0xb053('0x3e')]){_0x748f6a[_0xb053('0x3f')]=[{'all':!![]}];}return db[_0xb053('0x2a')][_0xb053('0x40')](_0x748f6a);})[_0xb053('0x25')](function(_0x69d9c3){_0x3b873b[_0xb053('0x41')]=_0x69d9c3;return _0x3b873b;})[_0xb053('0x25')](respondWithFilteredResult(_0x57c5e8,_0x748f6a))[_0xb053('0x42')](handleError(_0x57c5e8,null));};exports['show']=function(_0x20d11f,_0x20383c){var _0x394515={'raw':![],'where':{'id':_0x20d11f[_0xb053('0x43')]['id']}},_0x39920f={};_0x39920f['model']=_[_0xb053('0x2f')](db[_0xb053('0x2a')]['rawAttributes']);_0x39920f[_0xb053('0x2e')]=_[_0xb053('0x2f')](_0x20d11f[_0xb053('0x2e')]);_0x39920f['filters']=_[_0xb053('0x31')](_0x39920f[_0xb053('0x2d')],_0x39920f['query']);_0x394515[_0xb053('0x33')]=_[_0xb053('0x31')](_0x39920f['model'],qs[_0xb053('0x32')](_0x20d11f['query'][_0xb053('0x32')]));_0x394515[_0xb053('0x33')]=_0x394515['attributes'][_0xb053('0x44')]?_0x394515['attributes']:_0x39920f[_0xb053('0x2d')];if(_0x20d11f['query'][_0xb053('0x3e')]){_0x394515['include']=[{'all':!![]}];}_0x394515=_[_0xb053('0x45')]({},_0x394515,_0x20d11f[_0xb053('0x46')]);return db['VoiceAgentReport'][_0xb053('0x47')](_0x394515)['then'](handleEntityNotFound(_0x20383c,null))[_0xb053('0x25')](respondWithResult(_0x20383c,null))[_0xb053('0x42')](handleError(_0x20383c,null));};exports[_0xb053('0x48')]=function(_0x5f51ff,_0x1c9839){return db[_0xb053('0x2a')][_0xb053('0x48')](_0x5f51ff[_0xb053('0x49')],{})[_0xb053('0x25')](respondWithResult(_0x1c9839,0xc9))['catch'](handleError(_0x1c9839,null));};exports['update']=function(_0x2ef8e7,_0x5bc68a){if(_0x2ef8e7[_0xb053('0x49')]['id']){delete _0x2ef8e7['body']['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x2ef8e7[_0xb053('0x43')]['id']}})[_0xb053('0x25')](handleEntityNotFound(_0x5bc68a,null))[_0xb053('0x25')](saveUpdates(_0x2ef8e7['body'],null))[_0xb053('0x25')](respondWithResult(_0x5bc68a,null))[_0xb053('0x42')](handleError(_0x5bc68a,null));};exports[_0xb053('0x26')]=function(_0x316381,_0x439f7f){return db[_0xb053('0x2a')][_0xb053('0x47')]({'where':{'id':_0x316381[_0xb053('0x43')]['id']}})[_0xb053('0x25')](handleEntityNotFound(_0x439f7f,null))[_0xb053('0x25')](removeEntity(_0x439f7f,null))[_0xb053('0x42')](handleError(_0x439f7f,null));};exports[_0xb053('0x4a')]=function(_0x4b23c1,_0x4d16fb){return db[_0xb053('0x2a')][_0xb053('0x4a')]()[_0xb053('0x25')](respondWithResult(_0x4d16fb,null))['catch'](handleError(_0x4d16fb,null));}; \ No newline at end of file +var _0xd0b9=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','error','name','send','index','map','VoiceAgentReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x4ab126,_0x1c4281){var _0x570ebb=function(_0x5c26c7){while(--_0x5c26c7){_0x4ab126['push'](_0x4ab126['shift']());}};_0x570ebb(++_0x1c4281);}(_0xd0b9,0x1b0));var _0x9d0b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd0b9[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x9d0b('0x0'));var emlformat=require(_0x9d0b('0x1'));var rimraf=require(_0x9d0b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d0b('0x3'));var rp=require(_0x9d0b('0x4'));var moment=require(_0x9d0b('0x5'));var BPromise=require(_0x9d0b('0x6'));var Mustache=require(_0x9d0b('0x7'));var util=require(_0x9d0b('0x8'));var path=require(_0x9d0b('0x9'));var sox=require(_0x9d0b('0xa'));var csv=require(_0x9d0b('0xb'));var ejs=require(_0x9d0b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9d0b('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9d0b('0xe'));var Redis=require(_0x9d0b('0xf'));var authService=require(_0x9d0b('0x10'));var qs=require(_0x9d0b('0x11'));var as=require(_0x9d0b('0x12'));var hardwareService=require(_0x9d0b('0x13'));var logger=require(_0x9d0b('0x14'))(_0x9d0b('0x15'));var utils=require(_0x9d0b('0x16'));var config=require(_0x9d0b('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3f019e,_0x5ed67b){_0x5ed67b=_0x5ed67b||0xcc;return function(_0x340846){if(_0x340846){return _0x3f019e[_0x9d0b('0x18')](_0x5ed67b);}return _0x3f019e['status'](_0x5ed67b)[_0x9d0b('0x19')]();};}function respondWithResult(_0x4d3a60,_0x8787f5){_0x8787f5=_0x8787f5||0xc8;return function(_0x3211e8){if(_0x3211e8){return _0x4d3a60[_0x9d0b('0x1a')](_0x8787f5)[_0x9d0b('0x1b')](_0x3211e8);}};}function respondWithFilteredResult(_0xaaaa2c,_0x6b72a8){return function(_0x52a8bd){if(_0x52a8bd){var _0x168e93=_0x52a8bd[_0x9d0b('0x1c')],_0x45e1eb=_0x6b72a8[_0x9d0b('0x1d')],_0xa69b7=_0x6b72a8['offset']+_0x6b72a8[_0x9d0b('0x1e')],_0x4cf8d5;if(_0xa69b7>=_0x168e93){_0xa69b7=_0x168e93;_0x4cf8d5=0xc8;}else{_0x4cf8d5=0xce;}_0xaaaa2c[_0x9d0b('0x1a')](_0x4cf8d5);return _0xaaaa2c[_0x9d0b('0x1f')]('Content-Range',_0x45e1eb+'-'+_0xa69b7+'/'+_0x168e93)[_0x9d0b('0x1b')](_0x52a8bd);}return null;};}function patchUpdates(_0x40bcab){return function(_0x4ad5eb){try{jsonpatch[_0x9d0b('0x20')](_0x4ad5eb,_0x40bcab,!![]);}catch(_0x6400b9){return BPromise[_0x9d0b('0x21')](_0x6400b9);}return _0x4ad5eb[_0x9d0b('0x22')]();};}function saveUpdates(_0x5cc8a3,_0x4cf86a){return function(_0x504021){if(_0x504021){return _0x504021[_0x9d0b('0x23')](_0x5cc8a3)[_0x9d0b('0x24')](function(_0xfa04e9){return _0xfa04e9;});}return null;};}function removeEntity(_0x208917,_0x5206c0){return function(_0x28526e){if(_0x28526e){return _0x28526e[_0x9d0b('0x25')]()[_0x9d0b('0x24')](function(){_0x208917[_0x9d0b('0x1a')](0xcc)[_0x9d0b('0x19')]();});}};}function handleEntityNotFound(_0x136032,_0x11f6d5){return function(_0x1b6c38){if(!_0x1b6c38){_0x136032[_0x9d0b('0x18')](0x194);}return _0x1b6c38;};}function handleError(_0x666f5c,_0x5e7ea3){_0x5e7ea3=_0x5e7ea3||0x1f4;return function(_0x370db3){logger[_0x9d0b('0x26')](_0x370db3['stack']);if(_0x370db3['name']){delete _0x370db3[_0x9d0b('0x27')];}_0x666f5c[_0x9d0b('0x1a')](_0x5e7ea3)[_0x9d0b('0x28')](_0x370db3);};}exports[_0x9d0b('0x29')]=function(_0x410d6c,_0x5a1043){var _0x131f59={},_0x56c607={},_0xdad5a1={'count':0x0,'rows':[]};var _0x317152=_[_0x9d0b('0x2a')](db[_0x9d0b('0x2b')]['rawAttributes'],function(_0x13015e){return{'name':_0x13015e[_0x9d0b('0x2c')],'type':_0x13015e[_0x9d0b('0x2d')][_0x9d0b('0x2e')]};});_0x56c607[_0x9d0b('0x2f')]=_['map'](_0x317152,_0x9d0b('0x27'));_0x56c607[_0x9d0b('0x30')]=_[_0x9d0b('0x31')](_0x410d6c[_0x9d0b('0x30')]);_0x56c607[_0x9d0b('0x32')]=_[_0x9d0b('0x33')](_0x56c607[_0x9d0b('0x2f')],_0x56c607[_0x9d0b('0x30')]);_0x131f59[_0x9d0b('0x34')]=_[_0x9d0b('0x33')](_0x56c607[_0x9d0b('0x2f')],qs[_0x9d0b('0x35')](_0x410d6c['query'][_0x9d0b('0x35')]));_0x131f59[_0x9d0b('0x34')]=_0x131f59[_0x9d0b('0x34')]['length']?_0x131f59['attributes']:_0x56c607['model'];if(!_0x410d6c[_0x9d0b('0x30')][_0x9d0b('0x36')](_0x9d0b('0x37'))){_0x131f59[_0x9d0b('0x1e')]=qs[_0x9d0b('0x1e')](_0x410d6c[_0x9d0b('0x30')]['limit']);_0x131f59[_0x9d0b('0x1d')]=qs['offset'](_0x410d6c[_0x9d0b('0x30')][_0x9d0b('0x1d')]);}_0x131f59[_0x9d0b('0x38')]=qs[_0x9d0b('0x39')](_0x410d6c['query'][_0x9d0b('0x39')]);_0x131f59[_0x9d0b('0x3a')]=qs[_0x9d0b('0x32')](_[_0x9d0b('0x3b')](_0x410d6c[_0x9d0b('0x30')],_0x56c607[_0x9d0b('0x32')]));if(_0x410d6c[_0x9d0b('0x30')][_0x9d0b('0x3c')]){_0x131f59[_0x9d0b('0x3a')]=_['merge'](_0x131f59[_0x9d0b('0x3a')],{'$or':_['map'](_0x317152,function(_0x251126){if(_0x251126[_0x9d0b('0x2d')]!==_0x9d0b('0x3d')){var _0x2f377a={};_0x2f377a[_0x251126['name']]={'$like':'%'+_0x410d6c[_0x9d0b('0x30')][_0x9d0b('0x3c')]+'%'};return _0x2f377a;}})});}_0x131f59=_[_0x9d0b('0x3e')]({},_0x131f59,_0x410d6c[_0x9d0b('0x3f')]);var _0x1d4990={'where':_0x131f59[_0x9d0b('0x3a')]};return db[_0x9d0b('0x2b')][_0x9d0b('0x1c')](_0x1d4990)[_0x9d0b('0x24')](function(_0x1b78bf){_0xdad5a1[_0x9d0b('0x1c')]=_0x1b78bf;if(_0x410d6c[_0x9d0b('0x30')][_0x9d0b('0x40')]){_0x131f59[_0x9d0b('0x41')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0x9d0b('0x42')](_0x131f59);})['then'](function(_0x4a5d9d){_0xdad5a1[_0x9d0b('0x43')]=_0x4a5d9d;return _0xdad5a1;})[_0x9d0b('0x24')](respondWithFilteredResult(_0x5a1043,_0x131f59))['catch'](handleError(_0x5a1043,null));};exports[_0x9d0b('0x44')]=function(_0x362b56,_0x3f5b46){var _0x4004c9={'raw':![],'where':{'id':_0x362b56[_0x9d0b('0x45')]['id']}},_0x342f04={};_0x342f04[_0x9d0b('0x2f')]=_['keys'](db['VoiceAgentReport'][_0x9d0b('0x46')]);_0x342f04[_0x9d0b('0x30')]=_['keys'](_0x362b56[_0x9d0b('0x30')]);_0x342f04['filters']=_['intersection'](_0x342f04[_0x9d0b('0x2f')],_0x342f04[_0x9d0b('0x30')]);_0x4004c9[_0x9d0b('0x34')]=_['intersection'](_0x342f04[_0x9d0b('0x2f')],qs[_0x9d0b('0x35')](_0x362b56[_0x9d0b('0x30')][_0x9d0b('0x35')]));_0x4004c9[_0x9d0b('0x34')]=_0x4004c9[_0x9d0b('0x34')]['length']?_0x4004c9['attributes']:_0x342f04[_0x9d0b('0x2f')];if(_0x362b56[_0x9d0b('0x30')]['includeAll']){_0x4004c9['include']=[{'all':!![]}];}_0x4004c9=_['merge']({},_0x4004c9,_0x362b56[_0x9d0b('0x3f')]);return db['VoiceAgentReport'][_0x9d0b('0x47')](_0x4004c9)[_0x9d0b('0x24')](handleEntityNotFound(_0x3f5b46,null))[_0x9d0b('0x24')](respondWithResult(_0x3f5b46,null))[_0x9d0b('0x48')](handleError(_0x3f5b46,null));};exports[_0x9d0b('0x49')]=function(_0x54b0e3,_0x5cde8b){return db[_0x9d0b('0x2b')][_0x9d0b('0x49')](_0x54b0e3[_0x9d0b('0x4a')],{})[_0x9d0b('0x24')](respondWithResult(_0x5cde8b,0xc9))[_0x9d0b('0x48')](handleError(_0x5cde8b,null));};exports[_0x9d0b('0x23')]=function(_0x1c878e,_0x214913){if(_0x1c878e[_0x9d0b('0x4a')]['id']){delete _0x1c878e[_0x9d0b('0x4a')]['id'];}return db['VoiceAgentReport']['find']({'where':{'id':_0x1c878e[_0x9d0b('0x45')]['id']}})[_0x9d0b('0x24')](handleEntityNotFound(_0x214913,null))[_0x9d0b('0x24')](saveUpdates(_0x1c878e[_0x9d0b('0x4a')],null))['then'](respondWithResult(_0x214913,null))['catch'](handleError(_0x214913,null));};exports[_0x9d0b('0x25')]=function(_0x1724bf,_0x3ab203){return db[_0x9d0b('0x2b')][_0x9d0b('0x47')]({'where':{'id':_0x1724bf[_0x9d0b('0x45')]['id']}})[_0x9d0b('0x24')](handleEntityNotFound(_0x3ab203,null))[_0x9d0b('0x24')](removeEntity(_0x3ab203,null))[_0x9d0b('0x48')](handleError(_0x3ab203,null));};exports['describe']=function(_0x2a567a,_0x3f6e1b){return db[_0x9d0b('0x2b')]['describe']()[_0x9d0b('0x24')](respondWithResult(_0x3f6e1b,null))['catch'](handleError(_0x3f6e1b,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index dcca44a..7a155bf 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 _0x21dd=['VoiceAgentReport','report_agent','destuniqueid','lodash','util','../../config/logger','bluebird','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define'];(function(_0x16b918,_0x190ee0){var _0x4e9678=function(_0xfebbd4){while(--_0xfebbd4){_0x16b918['push'](_0x16b918['shift']());}};_0x4e9678(++_0x190ee0);}(_0x21dd,0xdb));var _0xd21d=function(_0x166430,_0x1304af){_0x166430=_0x166430-0x0;var _0x257d69=_0x21dd[_0x166430];return _0x257d69;};'use strict';var _=require(_0xd21d('0x0'));var util=require(_0xd21d('0x1'));var logger=require(_0xd21d('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd21d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd21d('0x4'));var config=require(_0xd21d('0x5'));var attributes=require(_0xd21d('0x6'));module[_0xd21d('0x7')]=function(_0x55ff20,_0x2fe3e3){return _0x55ff20[_0xd21d('0x8')](_0xd21d('0x9'),attributes,{'tableName':_0xd21d('0xa'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xd21d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x3c3e=['moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','destuniqueid','lodash','../../config/logger','api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x3c3e,0xe4));var _0xe3c3=function(_0x2a9f4,_0x25c14a){_0x2a9f4=_0x2a9f4-0x0;var _0x3c39e0=_0x3c3e[_0x2a9f4];return _0x3c39e0;};'use strict';var _=require(_0xe3c3('0x0'));var util=require('util');var logger=require(_0xe3c3('0x1'))(_0xe3c3('0x2'));var moment=require(_0xe3c3('0x3'));var BPromise=require('bluebird');var rp=require(_0xe3c3('0x4'));var fs=require('fs');var path=require(_0xe3c3('0x5'));var rimraf=require(_0xe3c3('0x6'));var config=require(_0xe3c3('0x7'));var attributes=require(_0xe3c3('0x8'));module[_0xe3c3('0x9')]=function(_0x3a4ca6,_0x257db5){return _0x3a4ca6['define']('VoiceAgentReport',attributes,{'tableName':'report_agent','paranoid':![],'indexes':[{'fields':['uniqueid',_0xe3c3('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 5418af2..dc6678f 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 _0xc366=['body','where','attributes','limit','catch','lodash','util','moment','ioredis','../../config/logger','rpc','../../config/environment','client','request','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','then','UpdateVoiceAgentReport','update'];(function(_0x112d7b,_0x2f66ad){var _0xdf8237=function(_0x6ddaa8){while(--_0x6ddaa8){_0x112d7b['push'](_0x112d7b['shift']());}};_0xdf8237(++_0x2f66ad);}(_0xc366,0x1c5));var _0x6c36=function(_0x5cee88,_0x521aaf){_0x5cee88=_0x5cee88-0x0;var _0x920d79=_0xc366[_0x5cee88];return _0x920d79;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var moment=require(_0x6c36('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c36('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x6c36('0x4'))(_0x6c36('0x5'));var config=require(_0x6c36('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x6c36('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55591f,_0x1e99a1,_0x422d5d){return new BPromise(function(_0x2d0509,_0x299f3f){return client[_0x6c36('0x8')](_0x55591f,_0x422d5d)['then'](function(_0xf9076b){logger[_0x6c36('0x9')](_0x6c36('0xa'),_0x1e99a1,_0x6c36('0xb'));logger[_0x6c36('0xc')](_0x6c36('0xd'),_0x1e99a1,_0x6c36('0xb'),JSON[_0x6c36('0xe')](_0xf9076b));if(_0xf9076b[_0x6c36('0xf')]){if(_0xf9076b[_0x6c36('0xf')][_0x6c36('0x10')]===0x1f4){logger[_0x6c36('0xf')]('VoiceAgentReport,\x20%s,\x20%s',_0x1e99a1,_0xf9076b[_0x6c36('0xf')][_0x6c36('0x11')]);return _0x299f3f(_0xf9076b['error'][_0x6c36('0x11')]);}logger[_0x6c36('0xf')](_0x6c36('0xa'),_0x1e99a1,_0xf9076b[_0x6c36('0xf')][_0x6c36('0x11')]);return _0x2d0509(_0xf9076b[_0x6c36('0xf')]['message']);}else{logger[_0x6c36('0x9')](_0x6c36('0xa'),_0x1e99a1,_0x6c36('0xb'));_0x2d0509(_0xf9076b[_0x6c36('0x12')][_0x6c36('0x11')]);}})['catch'](function(_0x1e5837){logger[_0x6c36('0xf')](_0x6c36('0xa'),_0x1e99a1,_0x1e5837);_0x299f3f(_0x1e5837);});});}exports[_0x6c36('0x13')]=function(_0x153385){var _0x5180db=this;return new Promise(function(_0x47eb76,_0x57cc74){return db[_0x6c36('0x14')][_0x6c36('0x15')](_0x153385['body'],{'raw':_0x153385[_0x6c36('0x16')]?_0x153385[_0x6c36('0x16')][_0x6c36('0x17')]===undefined?!![]:![]:!![]})[_0x6c36('0x18')](function(_0xbf55fb){logger[_0x6c36('0x9')](_0x6c36('0x13'),_0x153385);logger['debug']('CreateVoiceAgentReport',_0x153385,JSON[_0x6c36('0xe')](_0xbf55fb));_0x47eb76(_0xbf55fb);})['catch'](function(_0x18d1b3){logger[_0x6c36('0xf')]('CreateVoiceAgentReport',_0x18d1b3[_0x6c36('0x11')],_0x153385);_0x57cc74(_0x5180db['error'](0x1f4,_0x18d1b3[_0x6c36('0x11')]));});});};exports[_0x6c36('0x19')]=function(_0x71d4a2){var _0x2c7c68=this;return new Promise(function(_0x301b78,_0x274521){return db[_0x6c36('0x14')][_0x6c36('0x1a')](_0x71d4a2[_0x6c36('0x1b')],{'raw':_0x71d4a2[_0x6c36('0x16')]?_0x71d4a2['options'][_0x6c36('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x71d4a2['options']?_0x71d4a2[_0x6c36('0x16')][_0x6c36('0x1c')]||null:null,'attributes':_0x71d4a2[_0x6c36('0x16')]?_0x71d4a2[_0x6c36('0x16')][_0x6c36('0x1d')]||null:null,'limit':_0x71d4a2[_0x6c36('0x16')]?_0x71d4a2[_0x6c36('0x16')][_0x6c36('0x1e')]||null:null})[_0x6c36('0x18')](function(_0x4e70aa){logger[_0x6c36('0x9')](_0x6c36('0x19'),_0x71d4a2);logger['debug']('UpdateVoiceAgentReport',_0x71d4a2,JSON[_0x6c36('0xe')](_0x4e70aa));_0x301b78(_0x4e70aa);})[_0x6c36('0x1f')](function(_0xc473d0){logger[_0x6c36('0xf')](_0x6c36('0x19'),_0xc473d0[_0x6c36('0x11')],_0x71d4a2);_0x274521(_0x2c7c68['error'](0x1f4,_0xc473d0[_0x6c36('0x11')]));});});}; \ No newline at end of file +var _0xf698=['options','raw','update','where','limit','UpdateVoiceAgentReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceAgentReport,\x20%s,\x20%s','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','body'];(function(_0x259841,_0x1e9bc1){var _0x5e165b=function(_0x3d2bb4){while(--_0x3d2bb4){_0x259841['push'](_0x259841['shift']());}};_0x5e165b(++_0x1e9bc1);}(_0xf698,0x187));var _0x8f69=function(_0x56f7e2,_0x145392){_0x56f7e2=_0x56f7e2-0x0;var _0x36240b=_0xf698[_0x56f7e2];return _0x36240b;};'use strict';var _=require(_0x8f69('0x0'));var util=require(_0x8f69('0x1'));var moment=require(_0x8f69('0x2'));var BPromise=require(_0x8f69('0x3'));var rs=require(_0x8f69('0x4'));var fs=require('fs');var Redis=require(_0x8f69('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x8f69('0x6'));var logger=require(_0x8f69('0x7'))('rpc');var config=require(_0x8f69('0x8'));var jayson=require(_0x8f69('0x9'));var client=jayson[_0x8f69('0xa')][_0x8f69('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1ee56d,_0x325087,_0x2c7b19){return new BPromise(function(_0x49e277,_0x29355b){return client[_0x8f69('0xc')](_0x1ee56d,_0x2c7b19)[_0x8f69('0xd')](function(_0x17ce03){logger[_0x8f69('0xe')]('VoiceAgentReport,\x20%s,\x20%s',_0x325087,_0x8f69('0xf'));logger[_0x8f69('0x10')](_0x8f69('0x11'),_0x325087,_0x8f69('0xf'),JSON[_0x8f69('0x12')](_0x17ce03));if(_0x17ce03[_0x8f69('0x13')]){if(_0x17ce03[_0x8f69('0x13')][_0x8f69('0x14')]===0x1f4){logger[_0x8f69('0x13')](_0x8f69('0x15'),_0x325087,_0x17ce03['error'][_0x8f69('0x16')]);return _0x29355b(_0x17ce03[_0x8f69('0x13')]['message']);}logger['error'](_0x8f69('0x15'),_0x325087,_0x17ce03[_0x8f69('0x13')][_0x8f69('0x16')]);return _0x49e277(_0x17ce03[_0x8f69('0x13')][_0x8f69('0x16')]);}else{logger['info'](_0x8f69('0x15'),_0x325087,'request\x20sent');_0x49e277(_0x17ce03[_0x8f69('0x17')][_0x8f69('0x16')]);}})[_0x8f69('0x18')](function(_0x4255a6){logger[_0x8f69('0x13')](_0x8f69('0x15'),_0x325087,_0x4255a6);_0x29355b(_0x4255a6);});});}exports[_0x8f69('0x19')]=function(_0x236e34){var _0x21e851=this;return new Promise(function(_0x56fcef,_0x5301fb){return db[_0x8f69('0x1a')][_0x8f69('0x1b')](_0x236e34[_0x8f69('0x1c')],{'raw':_0x236e34['options']?_0x236e34[_0x8f69('0x1d')][_0x8f69('0x1e')]===undefined?!![]:![]:!![]})[_0x8f69('0xd')](function(_0x180356){logger[_0x8f69('0xe')](_0x8f69('0x19'),_0x236e34);logger[_0x8f69('0x10')](_0x8f69('0x19'),_0x236e34,JSON['stringify'](_0x180356));_0x56fcef(_0x180356);})[_0x8f69('0x18')](function(_0x322b62){logger[_0x8f69('0x13')](_0x8f69('0x19'),_0x322b62[_0x8f69('0x16')],_0x236e34);_0x5301fb(_0x21e851[_0x8f69('0x13')](0x1f4,_0x322b62[_0x8f69('0x16')]));});});};exports['UpdateVoiceAgentReport']=function(_0x2ae665){var _0x37a42f=this;return new Promise(function(_0x55ccb5,_0x184d7c){return db['VoiceAgentReport'][_0x8f69('0x1f')](_0x2ae665[_0x8f69('0x1c')],{'raw':_0x2ae665['options']?_0x2ae665[_0x8f69('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2ae665[_0x8f69('0x1d')]?_0x2ae665[_0x8f69('0x1d')][_0x8f69('0x20')]||null:null,'attributes':_0x2ae665[_0x8f69('0x1d')]?_0x2ae665['options']['attributes']||null:null,'limit':_0x2ae665[_0x8f69('0x1d')]?_0x2ae665[_0x8f69('0x1d')][_0x8f69('0x21')]||null:null})[_0x8f69('0xd')](function(_0x1478fd){logger['info'](_0x8f69('0x22'),_0x2ae665);logger[_0x8f69('0x10')](_0x8f69('0x22'),_0x2ae665,JSON['stringify'](_0x1478fd));_0x55ccb5(_0x1478fd);})[_0x8f69('0x18')](function(_0x409541){logger[_0x8f69('0x13')](_0x8f69('0x22'),_0x409541['message'],_0x2ae665);_0x184d7c(_0x37a42f[_0x8f69('0x13')](0x1f4,_0x409541[_0x8f69('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index daafe0e..bee9fd1 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 _0xe77b=['isAuthenticated','/describe','describe','/:id','show','post','create','put','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../config/environment','get'];(function(_0x34a923,_0x3ce38d){var _0x46442b=function(_0x110960){while(--_0x110960){_0x34a923['push'](_0x34a923['shift']());}};_0x46442b(++_0x3ce38d);}(_0xe77b,0x65));var _0xbe77=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xe77b[_0x3947c9];return _0x2e7871;};'use strict';var multer=require(_0xbe77('0x0'));var util=require(_0xbe77('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xbe77('0x2'));var router=express[_0xbe77('0x3')]();var auth=require(_0xbe77('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbe77('0x5'));var controller=require('./voiceCallReport.controller');router[_0xbe77('0x6')]('/',auth[_0xbe77('0x7')](),controller['index']);router[_0xbe77('0x6')](_0xbe77('0x8'),auth[_0xbe77('0x7')](),controller[_0xbe77('0x9')]);router[_0xbe77('0x6')](_0xbe77('0xa'),auth['isAuthenticated'](),controller[_0xbe77('0xb')]);router[_0xbe77('0xc')]('/',auth[_0xbe77('0x7')](),controller[_0xbe77('0xd')]);router[_0xbe77('0xe')](_0xbe77('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xbe77('0xf')]('/:id',auth[_0xbe77('0x7')](),controller[_0xbe77('0x10')]);module[_0xbe77('0x11')]=router; \ No newline at end of file +var _0xd159=['exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id'];(function(_0x181d57,_0x50a145){var _0x120695=function(_0x23083c){while(--_0x23083c){_0x181d57['push'](_0x181d57['shift']());}};_0x120695(++_0x50a145);}(_0xd159,0x1c9));var _0x9d15=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xd159[_0x2c91e9];return _0x13f0ff;};'use strict';var multer=require(_0x9d15('0x0'));var util=require(_0x9d15('0x1'));var path=require(_0x9d15('0x2'));var timeout=require(_0x9d15('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9d15('0x4'));var interaction=require(_0x9d15('0x5'));var config=require(_0x9d15('0x6'));var controller=require(_0x9d15('0x7'));router[_0x9d15('0x8')]('/',auth['isAuthenticated'](),controller[_0x9d15('0x9')]);router[_0x9d15('0x8')]('/describe',auth[_0x9d15('0xa')](),controller['describe']);router[_0x9d15('0x8')]('/:id',auth[_0x9d15('0xa')](),controller[_0x9d15('0xb')]);router[_0x9d15('0xc')]('/',auth['isAuthenticated'](),controller[_0x9d15('0xd')]);router[_0x9d15('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x9d15('0xf')]);router[_0x9d15('0x10')](_0x9d15('0x11'),auth[_0x9d15('0xa')](),controller['destroy']);module[_0x9d15('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 5ab27bc..9300aa9 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(_0x540bd0,_0x50c23b){var _0x4956ff=function(_0x5cf386){while(--_0x5cf386){_0x540bd0['push'](_0x540bd0['shift']());}};_0x4956ff(++_0x50c23b);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'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 _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x2a5755,_0x17f587){var _0x1700da=function(_0x40c908){while(--_0x40c908){_0x2a5755['push'](_0x2a5755['shift']());}};_0x1700da(++_0x17f587);}(_0xa9e0,0x123));var _0x0a9e=function(_0x43d11d,_0xccff91){_0x43d11d=_0x43d11d-0x0;var _0x38cd08=_0xa9e0[_0x43d11d];return _0x38cd08;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index adadf0d..4daa098 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 _0x9e99=['VoiceCallReport','rawAttributes','fieldName','model','map','query','keys','filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','type','VIRTUAL','merge','options','include','fullname','alias','User','findAll','then','rows','catch','find','create','body','describe','uniqueid','params','user','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','send','index'];(function(_0x2d018b,_0x51244f){var _0xd7bf9c=function(_0x4717b1){while(--_0x4717b1){_0x2d018b['push'](_0x2d018b['shift']());}};_0xd7bf9c(++_0x51244f);}(_0x9e99,0x103));var _0x99e9=function(_0x53447d,_0x2b6495){_0x53447d=_0x53447d-0x0;var _0x3c105a=_0x9e99[_0x53447d];return _0x3c105a;};'use strict';var pdf=require(_0x99e9('0x0'));var emlformat=require(_0x99e9('0x1'));var rimraf=require(_0x99e9('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99e9('0x3'));var rp=require(_0x99e9('0x4'));var moment=require(_0x99e9('0x5'));var BPromise=require(_0x99e9('0x6'));var Mustache=require(_0x99e9('0x7'));var util=require(_0x99e9('0x8'));var path=require('path');var sox=require(_0x99e9('0x9'));var csv=require(_0x99e9('0xa'));var ejs=require(_0x99e9('0xb'));var fs=require('fs');var _=require(_0x99e9('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x99e9('0xd'));var Papa=require(_0x99e9('0xe'));var Redis=require(_0x99e9('0xf'));var authService=require(_0x99e9('0x10'));var qs=require(_0x99e9('0x11'));var as=require(_0x99e9('0x12'));var hardwareService=require(_0x99e9('0x13'));var logger=require(_0x99e9('0x14'))(_0x99e9('0x15'));var utils=require('../../config/utils');var config=require(_0x99e9('0x16'));var db=require(_0x99e9('0x17'))['db'];function respondWithStatusCode(_0xc526ba,_0x5c8f7d){_0x5c8f7d=_0x5c8f7d||0xcc;return function(_0x332a16){if(_0x332a16){return _0xc526ba[_0x99e9('0x18')](_0x5c8f7d);}return _0xc526ba[_0x99e9('0x19')](_0x5c8f7d)['end']();};}function respondWithResult(_0xa16ea4,_0x2ed245){_0x2ed245=_0x2ed245||0xc8;return function(_0x366acd){if(_0x366acd){return _0xa16ea4[_0x99e9('0x19')](_0x2ed245)[_0x99e9('0x1a')](_0x366acd);}};}function respondWithFilteredResult(_0x23046e,_0x2343d6){return function(_0x10e00b){if(_0x10e00b){var _0x6a3548=_0x10e00b[_0x99e9('0x1b')],_0x4c9540=_0x2343d6[_0x99e9('0x1c')],_0xdaf77=_0x2343d6[_0x99e9('0x1c')]+_0x2343d6[_0x99e9('0x1d')],_0xb9e8f5;if(_0xdaf77>=_0x6a3548){_0xdaf77=_0x6a3548;_0xb9e8f5=0xc8;}else{_0xb9e8f5=0xce;}_0x23046e[_0x99e9('0x19')](_0xb9e8f5);return _0x23046e['set'](_0x99e9('0x1e'),_0x4c9540+'-'+_0xdaf77+'/'+_0x6a3548)[_0x99e9('0x1a')](_0x10e00b);}return null;};}function patchUpdates(_0x4be7c7){return function(_0x56f96f){try{jsonpatch[_0x99e9('0x1f')](_0x56f96f,_0x4be7c7,!![]);}catch(_0x39c933){return BPromise[_0x99e9('0x20')](_0x39c933);}return _0x56f96f[_0x99e9('0x21')]();};}function saveUpdates(_0x28b8a0,_0x1787dd){return function(_0x3d7e17){if(_0x3d7e17){return _0x3d7e17[_0x99e9('0x22')](_0x28b8a0)['then'](function(_0x5bf317){return _0x5bf317;});}return null;};}function removeEntity(_0x334920,_0x3d4f5d){return function(_0xec5c4f){if(_0xec5c4f){return _0xec5c4f[_0x99e9('0x23')]()['then'](function(){_0x334920[_0x99e9('0x19')](0xcc)[_0x99e9('0x24')]();});}};}function handleEntityNotFound(_0xc920f9,_0x1b8159){return function(_0xf26ebd){if(!_0xf26ebd){_0xc920f9['sendStatus'](0x194);}return _0xf26ebd;};}function handleError(_0x3c9a1f,_0x313520){_0x313520=_0x313520||0x1f4;return function(_0x207d0c){logger['error'](_0x207d0c[_0x99e9('0x25')]);if(_0x207d0c['name']){delete _0x207d0c[_0x99e9('0x26')];}_0x3c9a1f[_0x99e9('0x19')](_0x313520)[_0x99e9('0x27')](_0x207d0c);};}exports[_0x99e9('0x28')]=function(_0x30b9b7,_0x4f188b){var _0x1ff4dc={},_0x3ecb9b={},_0x4dc0c5={'count':0x0,'rows':[]};var _0x20600d=_['map'](db[_0x99e9('0x29')][_0x99e9('0x2a')],function(_0x474618){return{'name':_0x474618[_0x99e9('0x2b')],'type':_0x474618['type']['key']};});_0x3ecb9b[_0x99e9('0x2c')]=_[_0x99e9('0x2d')](_0x20600d,_0x99e9('0x26'));_0x3ecb9b[_0x99e9('0x2e')]=_[_0x99e9('0x2f')](_0x30b9b7[_0x99e9('0x2e')]);_0x3ecb9b[_0x99e9('0x30')]=_[_0x99e9('0x31')](_0x3ecb9b[_0x99e9('0x2c')],_0x3ecb9b[_0x99e9('0x2e')]);_0x1ff4dc['attributes']=_[_0x99e9('0x31')](_0x3ecb9b[_0x99e9('0x2c')],qs['fields'](_0x30b9b7[_0x99e9('0x2e')]['fields']));_0x1ff4dc[_0x99e9('0x32')]=_0x1ff4dc[_0x99e9('0x32')]['length']?_0x1ff4dc[_0x99e9('0x32')]:_0x3ecb9b[_0x99e9('0x2c')];if(!_0x30b9b7[_0x99e9('0x2e')][_0x99e9('0x33')]('nolimit')){_0x1ff4dc['limit']=qs[_0x99e9('0x1d')](_0x30b9b7[_0x99e9('0x2e')][_0x99e9('0x1d')]);_0x1ff4dc['offset']=qs[_0x99e9('0x1c')](_0x30b9b7[_0x99e9('0x2e')]['offset']);}_0x1ff4dc['order']=qs[_0x99e9('0x34')](_0x30b9b7['query'][_0x99e9('0x34')]);_0x1ff4dc[_0x99e9('0x35')]=qs[_0x99e9('0x30')](_[_0x99e9('0x36')](_0x30b9b7[_0x99e9('0x2e')],_0x3ecb9b['filters']));if(_0x30b9b7[_0x99e9('0x2e')][_0x99e9('0x37')]){_0x1ff4dc[_0x99e9('0x35')]=_['merge'](_0x1ff4dc[_0x99e9('0x35')],{'$or':_[_0x99e9('0x2d')](_0x20600d,function(_0x3dc744){if(_0x3dc744[_0x99e9('0x38')]!==_0x99e9('0x39')){var _0x5d84e9={};_0x5d84e9[_0x3dc744[_0x99e9('0x26')]]={'$like':'%'+_0x30b9b7['query'][_0x99e9('0x37')]+'%'};return _0x5d84e9;}})});}_0x1ff4dc=_[_0x99e9('0x3a')]({},_0x1ff4dc,_0x30b9b7[_0x99e9('0x3b')]);var _0x1adf07={'where':_0x1ff4dc[_0x99e9('0x35')]};return db[_0x99e9('0x29')][_0x99e9('0x1b')](_0x1adf07)['then'](function(_0x3a036b){_0x4dc0c5[_0x99e9('0x1b')]=_0x3a036b;if(_0x30b9b7[_0x99e9('0x2e')]['includeAll']){_0x1ff4dc[_0x99e9('0x3c')]=[{'attributes':['id','name',_0x99e9('0x3d'),_0x99e9('0x3e')],'model':db[_0x99e9('0x3f')],'as':_0x99e9('0x3f')}];}return db[_0x99e9('0x29')][_0x99e9('0x40')](_0x1ff4dc);})[_0x99e9('0x41')](function(_0x50abb3){_0x4dc0c5[_0x99e9('0x42')]=_0x50abb3;return _0x4dc0c5;})[_0x99e9('0x41')](respondWithFilteredResult(_0x4f188b,_0x1ff4dc))[_0x99e9('0x43')](handleError(_0x4f188b,null));};exports['show']=function(_0x50bea4,_0x3453c0){var _0xe0943f={'raw':!![],'where':{'id':_0x50bea4['params']['id']}},_0x6ba67f={};_0x6ba67f[_0x99e9('0x2c')]=_['keys'](db[_0x99e9('0x29')]['rawAttributes']);_0x6ba67f['query']=_[_0x99e9('0x2f')](_0x50bea4['query']);_0x6ba67f['filters']=_[_0x99e9('0x31')](_0x6ba67f[_0x99e9('0x2c')],_0x6ba67f['query']);_0xe0943f[_0x99e9('0x32')]=_[_0x99e9('0x31')](_0x6ba67f[_0x99e9('0x2c')],qs['fields'](_0x50bea4[_0x99e9('0x2e')]['fields']));_0xe0943f[_0x99e9('0x32')]=_0xe0943f[_0x99e9('0x32')]['length']?_0xe0943f['attributes']:_0x6ba67f['model'];if(_0x50bea4[_0x99e9('0x2e')]['includeAll']){_0xe0943f[_0x99e9('0x3c')]=[{'all':!![]}];}_0xe0943f=_[_0x99e9('0x3a')]({},_0xe0943f,_0x50bea4[_0x99e9('0x3b')]);return db[_0x99e9('0x29')][_0x99e9('0x44')](_0xe0943f)[_0x99e9('0x41')](handleEntityNotFound(_0x3453c0,null))[_0x99e9('0x41')](respondWithResult(_0x3453c0,null))[_0x99e9('0x43')](handleError(_0x3453c0,null));};exports[_0x99e9('0x45')]=function(_0x8db0c2,_0x5b8eae){return db['VoiceCallReport'][_0x99e9('0x45')](_0x8db0c2[_0x99e9('0x46')],{})[_0x99e9('0x41')](respondWithResult(_0x5b8eae,0xc9))[_0x99e9('0x43')](handleError(_0x5b8eae,null));};exports[_0x99e9('0x23')]=function(_0x22d584,_0x193331){return db[_0x99e9('0x29')][_0x99e9('0x44')]({'where':{'id':_0x22d584['params']['id']}})[_0x99e9('0x41')](handleEntityNotFound(_0x193331,null))[_0x99e9('0x41')](removeEntity(_0x193331,null))[_0x99e9('0x43')](handleError(_0x193331,null));};exports[_0x99e9('0x47')]=function(_0x45b7c0,_0x7a697d){return db[_0x99e9('0x29')]['describe']()[_0x99e9('0x41')](respondWithResult(_0x7a697d,null))[_0x99e9('0x43')](handleError(_0x7a697d,null));};exports[_0x99e9('0x22')]=function(_0x5d2f15,_0x2ec5eb){if(_0x5d2f15[_0x99e9('0x46')][_0x99e9('0x48')]){delete _0x5d2f15['body'][_0x99e9('0x48')];}return db[_0x99e9('0x29')][_0x99e9('0x44')]({'where':{'uniqueid':_0x5d2f15[_0x99e9('0x49')]['id'],'UserId':{'$or':[null,_0x5d2f15[_0x99e9('0x4a')]['id']]}}})[_0x99e9('0x41')](handleEntityNotFound(_0x2ec5eb,null))[_0x99e9('0x41')](saveUpdates(_0x5d2f15[_0x99e9('0x46')],null))['then'](respondWithResult(_0x2ec5eb,null))[_0x99e9('0x43')](handleError(_0x2ec5eb,null));}; \ No newline at end of file +var _0xb731=['describe','body','uniqueid','user','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','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','error','stack','name','index','map','VoiceCallReport','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','fullname','User','findAll','rows','catch','show','params','length','find','create'];(function(_0x3438cf,_0x73b174){var _0x278698=function(_0xbba932){while(--_0xbba932){_0x3438cf['push'](_0x3438cf['shift']());}};_0x278698(++_0x73b174);}(_0xb731,0x1ea));var _0x1b73=function(_0x176308,_0x5b4d58){_0x176308=_0x176308-0x0;var _0x545160=_0xb731[_0x176308];return _0x545160;};'use strict';var pdf=require(_0x1b73('0x0'));var emlformat=require(_0x1b73('0x1'));var rimraf=require(_0x1b73('0x2'));var zipdir=require(_0x1b73('0x3'));var jsonpatch=require(_0x1b73('0x4'));var rp=require(_0x1b73('0x5'));var moment=require(_0x1b73('0x6'));var BPromise=require(_0x1b73('0x7'));var Mustache=require(_0x1b73('0x8'));var util=require(_0x1b73('0x9'));var path=require(_0x1b73('0xa'));var sox=require(_0x1b73('0xb'));var csv=require(_0x1b73('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1b73('0xd'));var squel=require(_0x1b73('0xe'));var crypto=require(_0x1b73('0xf'));var jsforce=require(_0x1b73('0x10'));var deskjs=require(_0x1b73('0x11'));var toCsv=require('to-csv');var querystring=require(_0x1b73('0x12'));var Papa=require(_0x1b73('0x13'));var Redis=require(_0x1b73('0x14'));var authService=require(_0x1b73('0x15'));var qs=require(_0x1b73('0x16'));var as=require(_0x1b73('0x17'));var hardwareService=require(_0x1b73('0x18'));var logger=require(_0x1b73('0x19'))('api');var utils=require(_0x1b73('0x1a'));var config=require('../../config/environment');var db=require(_0x1b73('0x1b'))['db'];function respondWithStatusCode(_0x29fb9f,_0x2e4848){_0x2e4848=_0x2e4848||0xcc;return function(_0x439ade){if(_0x439ade){return _0x29fb9f[_0x1b73('0x1c')](_0x2e4848);}return _0x29fb9f[_0x1b73('0x1d')](_0x2e4848)[_0x1b73('0x1e')]();};}function respondWithResult(_0x2a23ff,_0x1faa12){_0x1faa12=_0x1faa12||0xc8;return function(_0xc2cca4){if(_0xc2cca4){return _0x2a23ff['status'](_0x1faa12)[_0x1b73('0x1f')](_0xc2cca4);}};}function respondWithFilteredResult(_0xea002d,_0x17dbb4){return function(_0x5dac31){if(_0x5dac31){var _0xa872f5=_0x5dac31[_0x1b73('0x20')],_0x32a64e=_0x17dbb4[_0x1b73('0x21')],_0x2959c0=_0x17dbb4[_0x1b73('0x21')]+_0x17dbb4[_0x1b73('0x22')],_0x11d14a;if(_0x2959c0>=_0xa872f5){_0x2959c0=_0xa872f5;_0x11d14a=0xc8;}else{_0x11d14a=0xce;}_0xea002d['status'](_0x11d14a);return _0xea002d[_0x1b73('0x23')](_0x1b73('0x24'),_0x32a64e+'-'+_0x2959c0+'/'+_0xa872f5)[_0x1b73('0x1f')](_0x5dac31);}return null;};}function patchUpdates(_0x1f4e1b){return function(_0x399984){try{jsonpatch['apply'](_0x399984,_0x1f4e1b,!![]);}catch(_0x2f0f03){return BPromise['reject'](_0x2f0f03);}return _0x399984[_0x1b73('0x25')]();};}function saveUpdates(_0x373690,_0x5ee12b){return function(_0x4e9077){if(_0x4e9077){return _0x4e9077[_0x1b73('0x26')](_0x373690)[_0x1b73('0x27')](function(_0x2a8579){return _0x2a8579;});}return null;};}function removeEntity(_0x4cfb2c,_0x25c255){return function(_0x29ac9a){if(_0x29ac9a){return _0x29ac9a[_0x1b73('0x28')]()[_0x1b73('0x27')](function(){_0x4cfb2c[_0x1b73('0x1d')](0xcc)[_0x1b73('0x1e')]();});}};}function handleEntityNotFound(_0x30239d,_0x1696b3){return function(_0x4c3d91){if(!_0x4c3d91){_0x30239d[_0x1b73('0x1c')](0x194);}return _0x4c3d91;};}function handleError(_0x104312,_0x5c7416){_0x5c7416=_0x5c7416||0x1f4;return function(_0x4a4fb1){logger[_0x1b73('0x29')](_0x4a4fb1[_0x1b73('0x2a')]);if(_0x4a4fb1[_0x1b73('0x2b')]){delete _0x4a4fb1['name'];}_0x104312['status'](_0x5c7416)['send'](_0x4a4fb1);};}exports[_0x1b73('0x2c')]=function(_0x1d8a40,_0x4590b5){var _0x44c4a7={},_0x6f70ac={},_0x407527={'count':0x0,'rows':[]};var _0x1e9bf5=_[_0x1b73('0x2d')](db[_0x1b73('0x2e')][_0x1b73('0x2f')],function(_0x3eea7c){return{'name':_0x3eea7c['fieldName'],'type':_0x3eea7c[_0x1b73('0x30')]['key']};});_0x6f70ac[_0x1b73('0x31')]=_[_0x1b73('0x2d')](_0x1e9bf5,_0x1b73('0x2b'));_0x6f70ac[_0x1b73('0x32')]=_[_0x1b73('0x33')](_0x1d8a40[_0x1b73('0x32')]);_0x6f70ac[_0x1b73('0x34')]=_[_0x1b73('0x35')](_0x6f70ac['model'],_0x6f70ac[_0x1b73('0x32')]);_0x44c4a7[_0x1b73('0x36')]=_[_0x1b73('0x35')](_0x6f70ac[_0x1b73('0x31')],qs[_0x1b73('0x37')](_0x1d8a40[_0x1b73('0x32')][_0x1b73('0x37')]));_0x44c4a7['attributes']=_0x44c4a7['attributes']['length']?_0x44c4a7[_0x1b73('0x36')]:_0x6f70ac[_0x1b73('0x31')];if(!_0x1d8a40[_0x1b73('0x32')][_0x1b73('0x38')](_0x1b73('0x39'))){_0x44c4a7[_0x1b73('0x22')]=qs[_0x1b73('0x22')](_0x1d8a40[_0x1b73('0x32')][_0x1b73('0x22')]);_0x44c4a7['offset']=qs[_0x1b73('0x21')](_0x1d8a40[_0x1b73('0x32')][_0x1b73('0x21')]);}_0x44c4a7['order']=qs[_0x1b73('0x3a')](_0x1d8a40[_0x1b73('0x32')][_0x1b73('0x3a')]);_0x44c4a7[_0x1b73('0x3b')]=qs[_0x1b73('0x34')](_[_0x1b73('0x3c')](_0x1d8a40[_0x1b73('0x32')],_0x6f70ac[_0x1b73('0x34')]));if(_0x1d8a40['query'][_0x1b73('0x3d')]){_0x44c4a7['where']=_[_0x1b73('0x3e')](_0x44c4a7[_0x1b73('0x3b')],{'$or':_['map'](_0x1e9bf5,function(_0x501f1c){if(_0x501f1c[_0x1b73('0x30')]!==_0x1b73('0x3f')){var _0x14f9ff={};_0x14f9ff[_0x501f1c[_0x1b73('0x2b')]]={'$like':'%'+_0x1d8a40['query'][_0x1b73('0x3d')]+'%'};return _0x14f9ff;}})});}_0x44c4a7=_[_0x1b73('0x3e')]({},_0x44c4a7,_0x1d8a40[_0x1b73('0x40')]);var _0x88b0c5={'where':_0x44c4a7[_0x1b73('0x3b')]};return db[_0x1b73('0x2e')][_0x1b73('0x20')](_0x88b0c5)[_0x1b73('0x27')](function(_0x451c3b){_0x407527['count']=_0x451c3b;if(_0x1d8a40[_0x1b73('0x32')][_0x1b73('0x41')]){_0x44c4a7[_0x1b73('0x42')]=[{'attributes':['id',_0x1b73('0x2b'),_0x1b73('0x43'),'alias'],'model':db[_0x1b73('0x44')],'as':_0x1b73('0x44')}];}return db[_0x1b73('0x2e')][_0x1b73('0x45')](_0x44c4a7);})['then'](function(_0x3cf048){_0x407527[_0x1b73('0x46')]=_0x3cf048;return _0x407527;})[_0x1b73('0x27')](respondWithFilteredResult(_0x4590b5,_0x44c4a7))[_0x1b73('0x47')](handleError(_0x4590b5,null));};exports[_0x1b73('0x48')]=function(_0x1c304c,_0x348886){var _0x424755={'raw':!![],'where':{'id':_0x1c304c[_0x1b73('0x49')]['id']}},_0x44c4c1={};_0x44c4c1[_0x1b73('0x31')]=_[_0x1b73('0x33')](db[_0x1b73('0x2e')][_0x1b73('0x2f')]);_0x44c4c1['query']=_[_0x1b73('0x33')](_0x1c304c['query']);_0x44c4c1[_0x1b73('0x34')]=_[_0x1b73('0x35')](_0x44c4c1['model'],_0x44c4c1[_0x1b73('0x32')]);_0x424755['attributes']=_[_0x1b73('0x35')](_0x44c4c1[_0x1b73('0x31')],qs[_0x1b73('0x37')](_0x1c304c['query'][_0x1b73('0x37')]));_0x424755['attributes']=_0x424755[_0x1b73('0x36')][_0x1b73('0x4a')]?_0x424755['attributes']:_0x44c4c1[_0x1b73('0x31')];if(_0x1c304c[_0x1b73('0x32')][_0x1b73('0x41')]){_0x424755[_0x1b73('0x42')]=[{'all':!![]}];}_0x424755=_[_0x1b73('0x3e')]({},_0x424755,_0x1c304c[_0x1b73('0x40')]);return db[_0x1b73('0x2e')][_0x1b73('0x4b')](_0x424755)['then'](handleEntityNotFound(_0x348886,null))[_0x1b73('0x27')](respondWithResult(_0x348886,null))[_0x1b73('0x47')](handleError(_0x348886,null));};exports[_0x1b73('0x4c')]=function(_0x2435a3,_0x165510){return db[_0x1b73('0x2e')][_0x1b73('0x4c')](_0x2435a3['body'],{})[_0x1b73('0x27')](respondWithResult(_0x165510,0xc9))[_0x1b73('0x47')](handleError(_0x165510,null));};exports[_0x1b73('0x28')]=function(_0x3843d2,_0x9f137e){return db[_0x1b73('0x2e')][_0x1b73('0x4b')]({'where':{'id':_0x3843d2['params']['id']}})[_0x1b73('0x27')](handleEntityNotFound(_0x9f137e,null))[_0x1b73('0x27')](removeEntity(_0x9f137e,null))[_0x1b73('0x47')](handleError(_0x9f137e,null));};exports[_0x1b73('0x4d')]=function(_0x4dfd8f,_0x3aef87){return db['VoiceCallReport'][_0x1b73('0x4d')]()[_0x1b73('0x27')](respondWithResult(_0x3aef87,null))['catch'](handleError(_0x3aef87,null));};exports['update']=function(_0x3adc66,_0x283529){if(_0x3adc66[_0x1b73('0x4e')]['uniqueid']){delete _0x3adc66[_0x1b73('0x4e')][_0x1b73('0x4f')];}return db[_0x1b73('0x2e')]['find']({'where':{'uniqueid':_0x3adc66[_0x1b73('0x49')]['id'],'UserId':{'$or':[null,_0x3adc66[_0x1b73('0x50')]['id']]}}})[_0x1b73('0x27')](handleEntityNotFound(_0x283529,null))[_0x1b73('0x27')](saveUpdates(_0x3adc66['body'],null))['then'](respondWithResult(_0x283529,null))[_0x1b73('0x47')](handleError(_0x283529,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 37c40de..b9e0ac0 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 _0x1dc9=['util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call'];(function(_0x172133,_0x10246b){var _0x2460e5=function(_0x3c4918){while(--_0x3c4918){_0x172133['push'](_0x172133['shift']());}};_0x2460e5(++_0x10246b);}(_0x1dc9,0x15c));var _0x91dc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1dc9[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x91dc('0x0'));var logger=require(_0x91dc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x91dc('0x2'));var rp=require(_0x91dc('0x3'));var fs=require('fs');var path=require(_0x91dc('0x4'));var rimraf=require(_0x91dc('0x5'));var config=require(_0x91dc('0x6'));var attributes=require(_0x91dc('0x7'));module[_0x91dc('0x8')]=function(_0x55fdd0,_0x3a74aa){return _0x55fdd0[_0x91dc('0x9')](_0x91dc('0xa'),attributes,{'tableName':_0x91dc('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x7fe8=['report_call','lodash','util','api','request-promise','rimraf','./voiceCallReport.attributes','define','VoiceCallReport'];(function(_0xd0a418,_0x32d0f1){var _0x3a85f6=function(_0xeee870){while(--_0xeee870){_0xd0a418['push'](_0xd0a418['shift']());}};_0x3a85f6(++_0x32d0f1);}(_0x7fe8,0x13c));var _0x87fe=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0x7fe8[_0x17b6e3];return _0x3906f3;};'use strict';var _=require(_0x87fe('0x0'));var util=require(_0x87fe('0x1'));var logger=require('../../config/logger')(_0x87fe('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x87fe('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x87fe('0x4'));var config=require('../../config/environment');var attributes=require(_0x87fe('0x5'));module['exports']=function(_0x5df68a,_0x5afd4f){return _0x5df68a[_0x87fe('0x6')](_0x87fe('0x7'),attributes,{'tableName':_0x87fe('0x8'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 24c93cf..44b3232 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 _0x5751=['model','map','GetVoiceCallReport','create','body','CreateVoiceCallReport','UpdateVoiceCallReport','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','VoiceCallReport','findAll','options','raw','where','attributes','include'];(function(_0x512fb4,_0x37bbcf){var _0x479a4e=function(_0x357cfb){while(--_0x357cfb){_0x512fb4['push'](_0x512fb4['shift']());}};_0x479a4e(++_0x37bbcf);}(_0x5751,0xe6));var _0x1575=function(_0x599f41,_0x4db732){_0x599f41=_0x599f41-0x0;var _0x2e4d58=_0x5751[_0x599f41];return _0x2e4d58;};'use strict';var _=require(_0x1575('0x0'));var util=require(_0x1575('0x1'));var moment=require(_0x1575('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1575('0x3'));var db=require(_0x1575('0x4'))['db'];var utils=require(_0x1575('0x5'));var logger=require(_0x1575('0x6'))('rpc');var config=require(_0x1575('0x7'));var jayson=require(_0x1575('0x8'));var client=jayson['client'][_0x1575('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x231ec2,_0x585ba1,_0x34b717){return new BPromise(function(_0x2b1529,_0xba76dd){return client[_0x1575('0xa')](_0x231ec2,_0x34b717)[_0x1575('0xb')](function(_0xc4332f){logger[_0x1575('0xc')](_0x1575('0xd'),_0x585ba1,_0x1575('0xe'));logger[_0x1575('0xf')](_0x1575('0x10'),_0x585ba1,_0x1575('0xe'),JSON[_0x1575('0x11')](_0xc4332f));if(_0xc4332f['error']){if(_0xc4332f['error'][_0x1575('0x12')]===0x1f4){logger['error'](_0x1575('0xd'),_0x585ba1,_0xc4332f[_0x1575('0x13')][_0x1575('0x14')]);return _0xba76dd(_0xc4332f[_0x1575('0x13')]['message']);}logger[_0x1575('0x13')](_0x1575('0xd'),_0x585ba1,_0xc4332f[_0x1575('0x13')][_0x1575('0x14')]);return _0x2b1529(_0xc4332f['error']['message']);}else{logger[_0x1575('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x585ba1,_0x1575('0xe'));_0x2b1529(_0xc4332f['result'][_0x1575('0x14')]);}})[_0x1575('0x15')](function(_0x95e80f){logger[_0x1575('0x13')](_0x1575('0xd'),_0x585ba1,_0x95e80f);_0xba76dd(_0x95e80f);});});}exports['GetVoiceCallReport']=function(_0x46ea40){var _0x3aff4b=this;return new Promise(function(_0x3ab2f1,_0x5d7fc9){return db[_0x1575('0x16')][_0x1575('0x17')]({'raw':_0x46ea40[_0x1575('0x18')]?_0x46ea40[_0x1575('0x18')][_0x1575('0x19')]===undefined?!![]:![]:!![],'where':_0x46ea40[_0x1575('0x18')]?_0x46ea40['options'][_0x1575('0x1a')]||null:null,'attributes':_0x46ea40[_0x1575('0x18')]?_0x46ea40[_0x1575('0x18')][_0x1575('0x1b')]||null:null,'limit':_0x46ea40[_0x1575('0x18')]?_0x46ea40['options']['limit']||null:null,'include':_0x46ea40[_0x1575('0x18')]?_0x46ea40[_0x1575('0x18')][_0x1575('0x1c')]?_['map'](_0x46ea40[_0x1575('0x18')][_0x1575('0x1c')],function(_0x14d2ca){return{'model':db[_0x14d2ca[_0x1575('0x1d')]],'as':_0x14d2ca['as'],'attributes':_0x14d2ca[_0x1575('0x1b')],'include':_0x14d2ca[_0x1575('0x1c')]?_[_0x1575('0x1e')](_0x14d2ca[_0x1575('0x1c')],function(_0x2a7809){return{'model':db[_0x2a7809[_0x1575('0x1d')]],'as':_0x2a7809['as'],'attributes':_0x2a7809['attributes'],'include':_0x2a7809[_0x1575('0x1c')]?_[_0x1575('0x1e')](_0x2a7809['include'],function(_0x390069){return{'model':db[_0x390069['model']],'as':_0x390069['as'],'attributes':_0x390069[_0x1575('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1575('0xb')](function(_0x227b1c){logger[_0x1575('0xc')]('GetVoiceCallReport',_0x46ea40);logger['debug'](_0x1575('0x1f'),_0x46ea40,JSON[_0x1575('0x11')](_0x227b1c));_0x3ab2f1(_0x227b1c);})['catch'](function(_0x171495){logger['error'](_0x1575('0x1f'),_0x171495[_0x1575('0x14')],_0x46ea40);_0x5d7fc9(_0x3aff4b['error'](0x1f4,_0x171495['message']));});});};exports['CreateVoiceCallReport']=function(_0x43ad45){var _0x223f21=this;return new Promise(function(_0x2f9182,_0x30e14c){return db[_0x1575('0x16')][_0x1575('0x20')](_0x43ad45[_0x1575('0x21')],{'raw':_0x43ad45['options']?_0x43ad45['options'][_0x1575('0x19')]===undefined?!![]:![]:!![]})[_0x1575('0xb')](function(_0xa98e8c){logger[_0x1575('0xc')](_0x1575('0x22'),_0x43ad45);logger[_0x1575('0xf')]('CreateVoiceCallReport',_0x43ad45,JSON[_0x1575('0x11')](_0xa98e8c));_0x2f9182(_0xa98e8c);})[_0x1575('0x15')](function(_0x3a08e2){logger[_0x1575('0x13')](_0x1575('0x22'),_0x3a08e2['message'],_0x43ad45);_0x30e14c(_0x223f21[_0x1575('0x13')](0x1f4,_0x3a08e2[_0x1575('0x14')]));});});};exports[_0x1575('0x23')]=function(_0x282ec0){var _0x2bee27=this;return new Promise(function(_0x1daf51,_0xcb6188){return db[_0x1575('0x16')]['update'](_0x282ec0['body'],{'raw':_0x282ec0[_0x1575('0x18')]?_0x282ec0[_0x1575('0x18')][_0x1575('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x282ec0[_0x1575('0x18')]?_0x282ec0[_0x1575('0x18')][_0x1575('0x1a')]||null:null,'attributes':_0x282ec0[_0x1575('0x18')]?_0x282ec0[_0x1575('0x18')]['attributes']||null:null,'limit':_0x282ec0['options']?_0x282ec0[_0x1575('0x18')][_0x1575('0x24')]||null:null})[_0x1575('0xb')](function(_0x1d454b){logger[_0x1575('0xc')](_0x1575('0x23'),_0x282ec0);logger['debug']('UpdateVoiceCallReport',_0x282ec0,JSON[_0x1575('0x11')](_0x1d454b));_0x1daf51(_0x1d454b);})[_0x1575('0x15')](function(_0x4d3411){logger['error']('UpdateVoiceCallReport',_0x4d3411['message'],_0x282ec0);_0xcb6188(_0x2bee27[_0x1575('0x13')](0x1f4,_0x4d3411[_0x1575('0x14')]));});});}; \ No newline at end of file +var _0x0c80=['client','request','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','where','attributes','limit','include','map','model','then','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','update','raw','lodash','bluebird','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x4e007d,_0x296770){var _0x51145e=function(_0x22bae9){while(--_0x22bae9){_0x4e007d['push'](_0x4e007d['shift']());}};_0x51145e(++_0x296770);}(_0x0c80,0x1cd));var _0x00c8=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0x0c80[_0xfae23b];return _0x200640;};'use strict';var _=require(_0x00c8('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x00c8('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x00c8('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x00c8('0x3'));var logger=require(_0x00c8('0x4'))('rpc');var config=require(_0x00c8('0x5'));var jayson=require(_0x00c8('0x6'));var client=jayson[_0x00c8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x6f7962,_0x134345,_0x284d1d){return new BPromise(function(_0x1af611,_0x7bbe3){return client[_0x00c8('0x8')](_0x6f7962,_0x284d1d)['then'](function(_0x5477d6){logger[_0x00c8('0x9')]('VoiceCallReport,\x20%s,\x20%s',_0x134345,_0x00c8('0xa'));logger[_0x00c8('0xb')](_0x00c8('0xc'),_0x134345,_0x00c8('0xa'),JSON[_0x00c8('0xd')](_0x5477d6));if(_0x5477d6['error']){if(_0x5477d6[_0x00c8('0xe')]['code']===0x1f4){logger[_0x00c8('0xe')](_0x00c8('0xf'),_0x134345,_0x5477d6[_0x00c8('0xe')][_0x00c8('0x10')]);return _0x7bbe3(_0x5477d6[_0x00c8('0xe')][_0x00c8('0x10')]);}logger[_0x00c8('0xe')](_0x00c8('0xf'),_0x134345,_0x5477d6[_0x00c8('0xe')][_0x00c8('0x10')]);return _0x1af611(_0x5477d6['error']['message']);}else{logger[_0x00c8('0x9')]('VoiceCallReport,\x20%s,\x20%s',_0x134345,_0x00c8('0xa'));_0x1af611(_0x5477d6[_0x00c8('0x11')][_0x00c8('0x10')]);}})[_0x00c8('0x12')](function(_0x6e4d53){logger[_0x00c8('0xe')](_0x00c8('0xf'),_0x134345,_0x6e4d53);_0x7bbe3(_0x6e4d53);});});}exports[_0x00c8('0x13')]=function(_0xba3ba3){var _0x2c1f32=this;return new Promise(function(_0x21bd7b,_0x15648c){return db[_0x00c8('0x14')][_0x00c8('0x15')]({'raw':_0xba3ba3[_0x00c8('0x16')]?_0xba3ba3[_0x00c8('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xba3ba3[_0x00c8('0x16')]?_0xba3ba3[_0x00c8('0x16')][_0x00c8('0x17')]||null:null,'attributes':_0xba3ba3[_0x00c8('0x16')]?_0xba3ba3[_0x00c8('0x16')][_0x00c8('0x18')]||null:null,'limit':_0xba3ba3[_0x00c8('0x16')]?_0xba3ba3[_0x00c8('0x16')][_0x00c8('0x19')]||null:null,'include':_0xba3ba3[_0x00c8('0x16')]?_0xba3ba3['options'][_0x00c8('0x1a')]?_[_0x00c8('0x1b')](_0xba3ba3['options'][_0x00c8('0x1a')],function(_0x24624b){return{'model':db[_0x24624b[_0x00c8('0x1c')]],'as':_0x24624b['as'],'attributes':_0x24624b[_0x00c8('0x18')],'include':_0x24624b['include']?_[_0x00c8('0x1b')](_0x24624b[_0x00c8('0x1a')],function(_0x31df8d){return{'model':db[_0x31df8d[_0x00c8('0x1c')]],'as':_0x31df8d['as'],'attributes':_0x31df8d[_0x00c8('0x18')],'include':_0x31df8d['include']?_[_0x00c8('0x1b')](_0x31df8d[_0x00c8('0x1a')],function(_0xe07df0){return{'model':db[_0xe07df0[_0x00c8('0x1c')]],'as':_0xe07df0['as'],'attributes':_0xe07df0[_0x00c8('0x18')]};}):[]};}):[]};}):[]:[]})[_0x00c8('0x1d')](function(_0x7c469a){logger[_0x00c8('0x9')]('GetVoiceCallReport',_0xba3ba3);logger['debug'](_0x00c8('0x13'),_0xba3ba3,JSON[_0x00c8('0xd')](_0x7c469a));_0x21bd7b(_0x7c469a);})['catch'](function(_0x21298d){logger['error']('GetVoiceCallReport',_0x21298d[_0x00c8('0x10')],_0xba3ba3);_0x15648c(_0x2c1f32[_0x00c8('0xe')](0x1f4,_0x21298d[_0x00c8('0x10')]));});});};exports[_0x00c8('0x1e')]=function(_0x42c625){var _0x4785bf=this;return new Promise(function(_0x7c05fa,_0x46cbd3){return db[_0x00c8('0x14')][_0x00c8('0x1f')](_0x42c625[_0x00c8('0x20')],{'raw':_0x42c625[_0x00c8('0x16')]?_0x42c625['options']['raw']===undefined?!![]:![]:!![]})[_0x00c8('0x1d')](function(_0x2fcb27){logger[_0x00c8('0x9')](_0x00c8('0x1e'),_0x42c625);logger[_0x00c8('0xb')]('CreateVoiceCallReport',_0x42c625,JSON[_0x00c8('0xd')](_0x2fcb27));_0x7c05fa(_0x2fcb27);})[_0x00c8('0x12')](function(_0x2a4203){logger['error'](_0x00c8('0x1e'),_0x2a4203['message'],_0x42c625);_0x46cbd3(_0x4785bf[_0x00c8('0xe')](0x1f4,_0x2a4203[_0x00c8('0x10')]));});});};exports[_0x00c8('0x21')]=function(_0x5bc472){var _0x2e91e2=this;return new Promise(function(_0xfdca05,_0x43b6ee){return db[_0x00c8('0x14')][_0x00c8('0x22')](_0x5bc472[_0x00c8('0x20')],{'raw':_0x5bc472[_0x00c8('0x16')]?_0x5bc472[_0x00c8('0x16')][_0x00c8('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5bc472['options']?_0x5bc472[_0x00c8('0x16')][_0x00c8('0x17')]||null:null,'attributes':_0x5bc472[_0x00c8('0x16')]?_0x5bc472['options'][_0x00c8('0x18')]||null:null,'limit':_0x5bc472[_0x00c8('0x16')]?_0x5bc472['options'][_0x00c8('0x19')]||null:null})['then'](function(_0x1232eb){logger[_0x00c8('0x9')]('UpdateVoiceCallReport',_0x5bc472);logger[_0x00c8('0xb')](_0x00c8('0x21'),_0x5bc472,JSON[_0x00c8('0xd')](_0x1232eb));_0xfdca05(_0x1232eb);})[_0x00c8('0x12')](function(_0x4dda2c){logger['error']('UpdateVoiceCallReport',_0x4dda2c[_0x00c8('0x10')],_0x5bc472);_0x43b6ee(_0x2e91e2[_0x00c8('0xe')](0x1f4,_0x4dda2c[_0x00c8('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 42700c2..b9bd8ab 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 _0x04f7=['../../config/environment','index','get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x14ade6,_0x14171c){var _0x701a7d=function(_0x18402d){while(--_0x18402d){_0x14ade6['push'](_0x14ade6['shift']());}};_0x701a7d(++_0x14171c);}(_0x04f7,0x1f2));var _0x704f=function(_0x1abd14,_0x478f2e){_0x1abd14=_0x1abd14-0x0;var _0x3bf0c8=_0x04f7[_0x1abd14];return _0x3bf0c8;};'use strict';var multer=require(_0x704f('0x0'));var util=require('util');var path=require(_0x704f('0x1'));var timeout=require(_0x704f('0x2'));var express=require(_0x704f('0x3'));var router=express[_0x704f('0x4')]();var auth=require(_0x704f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x704f('0x6'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x704f('0x7')]);router[_0x704f('0x8')](_0x704f('0x9'),auth[_0x704f('0xa')](),controller[_0x704f('0xb')]);router[_0x704f('0xc')]('/',auth['isAuthenticated'](),controller[_0x704f('0xd')]);router[_0x704f('0xe')]('/:id',auth[_0x704f('0xa')](),controller[_0x704f('0xf')]);router[_0x704f('0x10')](_0x704f('0x9'),auth[_0x704f('0xa')](),controller[_0x704f('0x11')]);module['exports']=router; \ No newline at end of file +var _0xfcf7=['post','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','get'];(function(_0x1d1779,_0x284147){var _0x2377e9=function(_0x299f6f){while(--_0x299f6f){_0x1d1779['push'](_0x1d1779['shift']());}};_0x2377e9(++_0x284147);}(_0xfcf7,0x106));var _0x7fcf=function(_0x662e49,_0x44a6cc){_0x662e49=_0x662e49-0x0;var _0x5f58c0=_0xfcf7[_0x662e49];return _0x5f58c0;};'use strict';var multer=require(_0x7fcf('0x0'));var util=require(_0x7fcf('0x1'));var path=require(_0x7fcf('0x2'));var timeout=require(_0x7fcf('0x3'));var express=require(_0x7fcf('0x4'));var router=express[_0x7fcf('0x5')]();var auth=require(_0x7fcf('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7fcf('0x7'));var controller=require('./voiceChanSpy.controller');router['get']('/',auth[_0x7fcf('0x8')](),controller['index']);router[_0x7fcf('0x9')]('/:id',auth[_0x7fcf('0x8')](),controller['show']);router[_0x7fcf('0xa')]('/',auth[_0x7fcf('0x8')](),controller['create']);router[_0x7fcf('0xb')](_0x7fcf('0xc'),auth[_0x7fcf('0x8')](),controller[_0x7fcf('0xd')]);router[_0x7fcf('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x7fcf('0xf')]);module[_0x7fcf('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 20cb510..61da867 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 _0x3823=['split','BOOLEAN','sequelize','exports','STRING','name','setDataValue','join','getDataValue','options'];(function(_0x21b20a,_0x3b02c1){var _0x491e81=function(_0x53433d){while(--_0x53433d){_0x21b20a['push'](_0x21b20a['shift']());}};_0x491e81(++_0x3b02c1);}(_0x3823,0x110));var _0x3382=function(_0x4674ae,_0x53ce69){_0x4674ae=_0x4674ae-0x0;var _0x421210=_0x3823[_0x4674ae];return _0x421210;};'use strict';var Sequelize=require(_0x3382('0x0'));module[_0x3382('0x1')]={'name':{'type':Sequelize[_0x3382('0x2')]},'prefix':{'type':Sequelize[_0x3382('0x2')],'unique':_0x3382('0x3'),'allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x40420e){this[_0x3382('0x4')]('options',_0x40420e?_0x40420e[_0x3382('0x5')](''):[]);},'get':function(){return this[_0x3382('0x6')](_0x3382('0x7'))?this[_0x3382('0x6')](_0x3382('0x7'))[_0x3382('0x8')](''):[];}},'auth':{'type':Sequelize[_0x3382('0x9')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0x3382('0x9')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x3382('0x2')]},'description':{'type':Sequelize[_0x3382('0x2')]}}; \ No newline at end of file +var _0x7ca0=['options','getDataValue','split','BOOLEAN','exports','STRING','name','setDataValue'];(function(_0x87f0f9,_0x29136c){var _0x198af4=function(_0x7098ef){while(--_0x7098ef){_0x87f0f9['push'](_0x87f0f9['shift']());}};_0x198af4(++_0x29136c);}(_0x7ca0,0x84));var _0x07ca=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7ca0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x07ca('0x0')]={'name':{'type':Sequelize[_0x07ca('0x1')]},'prefix':{'type':Sequelize[_0x07ca('0x1')],'unique':_0x07ca('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x07ca('0x1')],'set':function(_0x2b0560){this[_0x07ca('0x3')](_0x07ca('0x4'),_0x2b0560?_0x2b0560['join'](''):[]);},'get':function(){return this[_0x07ca('0x5')]('options')?this[_0x07ca('0x5')]('options')[_0x07ca('0x6')](''):[];}},'auth':{'type':Sequelize[_0x07ca('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x07ca('0x1')]},'record':{'type':Sequelize[_0x07ca('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x07ca('0x1')]},'description':{'type':Sequelize[_0x07ca('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 3091b92..a72fb37 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 _0x7893=['where','VIRTUAL','merge','options','VoiceChanSpy','include','findAll','rows','catch','show','intersection','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','key','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x5c830f,_0x4ca762){var _0x3de254=function(_0x3c6e3d){while(--_0x3c6e3d){_0x5c830f['push'](_0x5c830f['shift']());}};_0x3de254(++_0x4ca762);}(_0x7893,0x1b0));var _0x3789=function(_0x21e7d6,_0x3e9d5e){_0x21e7d6=_0x21e7d6-0x0;var _0x295a72=_0x7893[_0x21e7d6];return _0x295a72;};'use strict';var pdf=require(_0x3789('0x0'));var emlformat=require(_0x3789('0x1'));var rimraf=require(_0x3789('0x2'));var zipdir=require(_0x3789('0x3'));var jsonpatch=require(_0x3789('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3789('0x5'));var Mustache=require(_0x3789('0x6'));var util=require(_0x3789('0x7'));var path=require(_0x3789('0x8'));var sox=require(_0x3789('0x9'));var csv=require(_0x3789('0xa'));var ejs=require(_0x3789('0xb'));var fs=require('fs');var _=require(_0x3789('0xc'));var squel=require(_0x3789('0xd'));var crypto=require(_0x3789('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3789('0xf'));var toCsv=require('to-csv');var querystring=require(_0x3789('0x10'));var Papa=require('papaparse');var Redis=require(_0x3789('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3789('0x12'));var hardwareService=require(_0x3789('0x13'));var logger=require(_0x3789('0x14'))(_0x3789('0x15'));var utils=require('../../config/utils');var config=require(_0x3789('0x16'));var db=require(_0x3789('0x17'))['db'];function respondWithStatusCode(_0x1374ab,_0x37a329){_0x37a329=_0x37a329||0xcc;return function(_0x4c37b5){if(_0x4c37b5){return _0x1374ab[_0x3789('0x18')](_0x37a329);}return _0x1374ab[_0x3789('0x19')](_0x37a329)[_0x3789('0x1a')]();};}function respondWithResult(_0x52e24b,_0x506fe6){_0x506fe6=_0x506fe6||0xc8;return function(_0x2cce16){if(_0x2cce16){return _0x52e24b[_0x3789('0x19')](_0x506fe6)['json'](_0x2cce16);}};}function respondWithFilteredResult(_0xdc09fa,_0x4ea628){return function(_0x316716){if(_0x316716){var _0x553f3e=_0x316716[_0x3789('0x1b')],_0x53aca3=_0x4ea628[_0x3789('0x1c')],_0x5c9ec5=_0x4ea628[_0x3789('0x1c')]+_0x4ea628[_0x3789('0x1d')],_0xd3af9c;if(_0x5c9ec5>=_0x553f3e){_0x5c9ec5=_0x553f3e;_0xd3af9c=0xc8;}else{_0xd3af9c=0xce;}_0xdc09fa[_0x3789('0x19')](_0xd3af9c);return _0xdc09fa[_0x3789('0x1e')](_0x3789('0x1f'),_0x53aca3+'-'+_0x5c9ec5+'/'+_0x553f3e)['json'](_0x316716);}return null;};}function patchUpdates(_0x4c1b5c){return function(_0x49e6fb){try{jsonpatch[_0x3789('0x20')](_0x49e6fb,_0x4c1b5c,!![]);}catch(_0x4942d6){return BPromise[_0x3789('0x21')](_0x4942d6);}return _0x49e6fb[_0x3789('0x22')]();};}function saveUpdates(_0x518af0,_0x3653d1){return function(_0x5ca921){if(_0x5ca921){return _0x5ca921['update'](_0x518af0)[_0x3789('0x23')](function(_0x3f4036){return _0x3f4036;});}return null;};}function removeEntity(_0x3c5f31,_0x180681){return function(_0x38c1df){if(_0x38c1df){return _0x38c1df[_0x3789('0x24')]()[_0x3789('0x23')](function(){var _0x4f7d22=_0x38c1df[_0x3789('0x25')]({'plain':!![]});var _0x16bcec=_0x3789('0x26');return db[_0x3789('0x27')]['destroy']({'where':{'type':_0x16bcec,'resourceId':_0x4f7d22['id']}})[_0x3789('0x23')](function(){return _0x38c1df;});})[_0x3789('0x23')](function(){_0x3c5f31[_0x3789('0x19')](0xcc)[_0x3789('0x1a')]();});}};}function handleEntityNotFound(_0x4ce081,_0x48afca){return function(_0x175242){if(!_0x175242){_0x4ce081[_0x3789('0x18')](0x194);}return _0x175242;};}function handleError(_0x4bb857,_0x2077fc){_0x2077fc=_0x2077fc||0x1f4;return function(_0x43265f){logger[_0x3789('0x28')](_0x43265f[_0x3789('0x29')]);if(_0x43265f[_0x3789('0x2a')]){delete _0x43265f[_0x3789('0x2a')];}_0x4bb857[_0x3789('0x19')](_0x2077fc)[_0x3789('0x2b')](_0x43265f);};}exports[_0x3789('0x2c')]=function(_0x17da91,_0x40ce56){var _0x22c706={},_0x185b21={},_0x118ffa={'count':0x0,'rows':[]};var _0x3fc5f=_[_0x3789('0x2d')](db['VoiceChanSpy'][_0x3789('0x2e')],function(_0x2b3a76){return{'name':_0x2b3a76[_0x3789('0x2f')],'type':_0x2b3a76['type'][_0x3789('0x30')]};});_0x185b21['model']=_[_0x3789('0x2d')](_0x3fc5f,_0x3789('0x2a'));_0x185b21[_0x3789('0x31')]=_[_0x3789('0x32')](_0x17da91[_0x3789('0x31')]);_0x185b21[_0x3789('0x33')]=_['intersection'](_0x185b21[_0x3789('0x34')],_0x185b21['query']);_0x22c706[_0x3789('0x35')]=_['intersection'](_0x185b21['model'],qs[_0x3789('0x36')](_0x17da91['query'][_0x3789('0x36')]));_0x22c706[_0x3789('0x35')]=_0x22c706[_0x3789('0x35')][_0x3789('0x37')]?_0x22c706[_0x3789('0x35')]:_0x185b21[_0x3789('0x34')];if(!_0x17da91[_0x3789('0x31')][_0x3789('0x38')](_0x3789('0x39'))){_0x22c706[_0x3789('0x1d')]=qs[_0x3789('0x1d')](_0x17da91[_0x3789('0x31')][_0x3789('0x1d')]);_0x22c706[_0x3789('0x1c')]=qs[_0x3789('0x1c')](_0x17da91[_0x3789('0x31')]['offset']);}_0x22c706[_0x3789('0x3a')]=qs[_0x3789('0x3b')](_0x17da91[_0x3789('0x31')][_0x3789('0x3b')]);_0x22c706[_0x3789('0x3c')]=qs[_0x3789('0x33')](_['pick'](_0x17da91['query'],_0x185b21['filters']));if(_0x17da91['query']['filter']){_0x22c706['where']=_['merge'](_0x22c706['where'],{'$or':_[_0x3789('0x2d')](_0x3fc5f,function(_0x31eb34){if(_0x31eb34['type']!==_0x3789('0x3d')){var _0x573330={};_0x573330[_0x31eb34[_0x3789('0x2a')]]={'$like':'%'+_0x17da91[_0x3789('0x31')]['filter']+'%'};return _0x573330;}})});}_0x22c706=_[_0x3789('0x3e')]({},_0x22c706,_0x17da91[_0x3789('0x3f')]);var _0x136832={'where':_0x22c706[_0x3789('0x3c')]};return db[_0x3789('0x40')]['count'](_0x136832)[_0x3789('0x23')](function(_0x127038){_0x118ffa[_0x3789('0x1b')]=_0x127038;if(_0x17da91['query']['includeAll']){_0x22c706[_0x3789('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy'][_0x3789('0x42')](_0x22c706);})[_0x3789('0x23')](function(_0x39ce9d){_0x118ffa[_0x3789('0x43')]=_0x39ce9d;return _0x118ffa;})[_0x3789('0x23')](respondWithFilteredResult(_0x40ce56,_0x22c706))[_0x3789('0x44')](handleError(_0x40ce56,null));};exports[_0x3789('0x45')]=function(_0x1be537,_0x56ebe3){var _0x45f6f0={'raw':![],'where':{'id':_0x1be537['params']['id']}},_0x54235e={};_0x54235e[_0x3789('0x34')]=_[_0x3789('0x32')](db['VoiceChanSpy'][_0x3789('0x2e')]);_0x54235e[_0x3789('0x31')]=_[_0x3789('0x32')](_0x1be537[_0x3789('0x31')]);_0x54235e[_0x3789('0x33')]=_[_0x3789('0x46')](_0x54235e['model'],_0x54235e[_0x3789('0x31')]);_0x45f6f0[_0x3789('0x35')]=_[_0x3789('0x46')](_0x54235e[_0x3789('0x34')],qs[_0x3789('0x36')](_0x1be537[_0x3789('0x31')]['fields']));_0x45f6f0[_0x3789('0x35')]=_0x45f6f0[_0x3789('0x35')][_0x3789('0x37')]?_0x45f6f0[_0x3789('0x35')]:_0x54235e[_0x3789('0x34')];if(_0x1be537[_0x3789('0x31')][_0x3789('0x47')]){_0x45f6f0[_0x3789('0x41')]=[{'all':!![]}];}_0x45f6f0=_['merge']({},_0x45f6f0,_0x1be537[_0x3789('0x3f')]);return db[_0x3789('0x40')]['find'](_0x45f6f0)[_0x3789('0x23')](handleEntityNotFound(_0x56ebe3,null))[_0x3789('0x23')](respondWithResult(_0x56ebe3,null))[_0x3789('0x44')](handleError(_0x56ebe3,null));};exports[_0x3789('0x48')]=function(_0x5960f9,_0x2d2b28){return db['VoiceChanSpy'][_0x3789('0x48')](_0x5960f9[_0x3789('0x49')],{})[_0x3789('0x23')](function(_0x3b14bb){var _0xf76d13=_0x5960f9[_0x3789('0x4a')][_0x3789('0x25')]({'plain':!![]});if(!_0xf76d13)throw new Error(_0x3789('0x4b'));if(_0xf76d13[_0x3789('0x4c')]===_0x3789('0x4a')){var _0x3222ea=_0x3b14bb['get']({'plain':!![]});var _0x2b46bb=_0x3789('0x26');return db['UserProfileSection'][_0x3789('0x4d')]({'where':{'name':_0x2b46bb,'userProfileId':_0xf76d13[_0x3789('0x4e')]},'raw':!![]})['then'](function(_0x4a4ddc){if(_0x4a4ddc&&_0x4a4ddc[_0x3789('0x4f')]===0x0){return db['UserProfileResource'][_0x3789('0x48')]({'name':_0x3222ea[_0x3789('0x2a')],'resourceId':_0x3222ea['id'],'type':_0x4a4ddc[_0x3789('0x2a')],'sectionId':_0x4a4ddc['id']},{})[_0x3789('0x23')](function(){return _0x3b14bb;});}else{return _0x3b14bb;}})['catch'](function(_0x31f838){logger[_0x3789('0x28')](_0x3789('0x50'),_0x31f838);throw _0x31f838;});}return _0x3b14bb;})[_0x3789('0x23')](respondWithResult(_0x2d2b28,0xc9))['catch'](handleError(_0x2d2b28,null));};exports['update']=function(_0x51a25e,_0x3f31f4){if(_0x51a25e[_0x3789('0x49')]['id']){delete _0x51a25e[_0x3789('0x49')]['id'];}return db[_0x3789('0x40')][_0x3789('0x4d')]({'where':{'id':_0x51a25e[_0x3789('0x51')]['id']}})['then'](handleEntityNotFound(_0x3f31f4,null))[_0x3789('0x23')](saveUpdates(_0x51a25e[_0x3789('0x49')],null))['then'](respondWithResult(_0x3f31f4,null))[_0x3789('0x44')](handleError(_0x3f31f4,null));};exports['destroy']=function(_0x358170,_0x257495){return db[_0x3789('0x40')]['find']({'where':{'id':_0x358170[_0x3789('0x51')]['id']}})[_0x3789('0x23')](handleEntityNotFound(_0x257495,null))[_0x3789('0x23')](removeEntity(_0x257495,null))[_0x3789('0x44')](handleError(_0x257495,null));}; \ No newline at end of file +var _0xfd8d=['VIRTUAL','merge','options','VoiceChanSpy','count','include','rows','show','params','rawAttributes','keys','includeAll','find','catch','create','role','user','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','sendStatus','end','status','offset','limit','set','Content-Range','json','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send','index','map','fieldName','type','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x1483db,_0x365c0f){var _0x44d20e=function(_0x3948a5){while(--_0x3948a5){_0x1483db['push'](_0x1483db['shift']());}};_0x44d20e(++_0x365c0f);}(_0xfd8d,0x104));var _0xdfd8=function(_0x4dc9d6,_0x3cf377){_0x4dc9d6=_0x4dc9d6-0x0;var _0xc2682a=_0xfd8d[_0x4dc9d6];return _0xc2682a;};'use strict';var pdf=require(_0xdfd8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xdfd8('0x1'));var zipdir=require(_0xdfd8('0x2'));var jsonpatch=require(_0xdfd8('0x3'));var rp=require(_0xdfd8('0x4'));var moment=require(_0xdfd8('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xdfd8('0x6'));var util=require('util');var path=require(_0xdfd8('0x7'));var sox=require(_0xdfd8('0x8'));var csv=require('to-csv');var ejs=require(_0xdfd8('0x9'));var fs=require('fs');var _=require(_0xdfd8('0xa'));var squel=require(_0xdfd8('0xb'));var crypto=require(_0xdfd8('0xc'));var jsforce=require(_0xdfd8('0xd'));var deskjs=require(_0xdfd8('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdfd8('0xf'));var Papa=require(_0xdfd8('0x10'));var Redis=require(_0xdfd8('0x11'));var authService=require(_0xdfd8('0x12'));var qs=require(_0xdfd8('0x13'));var as=require(_0xdfd8('0x14'));var hardwareService=require(_0xdfd8('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xdfd8('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5c9af2,_0xb9af63){_0xb9af63=_0xb9af63||0xcc;return function(_0x39b207){if(_0x39b207){return _0x5c9af2[_0xdfd8('0x17')](_0xb9af63);}return _0x5c9af2['status'](_0xb9af63)[_0xdfd8('0x18')]();};}function respondWithResult(_0x3cf542,_0x215bd7){_0x215bd7=_0x215bd7||0xc8;return function(_0x223988){if(_0x223988){return _0x3cf542[_0xdfd8('0x19')](_0x215bd7)['json'](_0x223988);}};}function respondWithFilteredResult(_0x6514e9,_0x5b536d){return function(_0x396039){if(_0x396039){var _0x4ac512=_0x396039['count'],_0x16d511=_0x5b536d[_0xdfd8('0x1a')],_0x320faf=_0x5b536d[_0xdfd8('0x1a')]+_0x5b536d[_0xdfd8('0x1b')],_0x53dffc;if(_0x320faf>=_0x4ac512){_0x320faf=_0x4ac512;_0x53dffc=0xc8;}else{_0x53dffc=0xce;}_0x6514e9[_0xdfd8('0x19')](_0x53dffc);return _0x6514e9[_0xdfd8('0x1c')](_0xdfd8('0x1d'),_0x16d511+'-'+_0x320faf+'/'+_0x4ac512)[_0xdfd8('0x1e')](_0x396039);}return null;};}function patchUpdates(_0x2ff165){return function(_0x5c9076){try{jsonpatch['apply'](_0x5c9076,_0x2ff165,!![]);}catch(_0x83b6cc){return BPromise[_0xdfd8('0x1f')](_0x83b6cc);}return _0x5c9076['save']();};}function saveUpdates(_0x2b7f4e,_0x556a3c){return function(_0x5a3d70){if(_0x5a3d70){return _0x5a3d70[_0xdfd8('0x20')](_0x2b7f4e)[_0xdfd8('0x21')](function(_0x20e89e){return _0x20e89e;});}return null;};}function removeEntity(_0x4eb70f,_0x6d7225){return function(_0x4f52a3){if(_0x4f52a3){return _0x4f52a3[_0xdfd8('0x22')]()[_0xdfd8('0x21')](function(){var _0x21f3e9=_0x4f52a3[_0xdfd8('0x23')]({'plain':!![]});var _0x3bb3d4=_0xdfd8('0x24');return db[_0xdfd8('0x25')][_0xdfd8('0x22')]({'where':{'type':_0x3bb3d4,'resourceId':_0x21f3e9['id']}})[_0xdfd8('0x21')](function(){return _0x4f52a3;});})['then'](function(){_0x4eb70f[_0xdfd8('0x19')](0xcc)[_0xdfd8('0x18')]();});}};}function handleEntityNotFound(_0x1cf9d4,_0x2eb6f1){return function(_0x10c22e){if(!_0x10c22e){_0x1cf9d4[_0xdfd8('0x17')](0x194);}return _0x10c22e;};}function handleError(_0x111650,_0x491921){_0x491921=_0x491921||0x1f4;return function(_0x4fb704){logger[_0xdfd8('0x26')](_0x4fb704[_0xdfd8('0x27')]);if(_0x4fb704[_0xdfd8('0x28')]){delete _0x4fb704[_0xdfd8('0x28')];}_0x111650[_0xdfd8('0x19')](_0x491921)[_0xdfd8('0x29')](_0x4fb704);};}exports[_0xdfd8('0x2a')]=function(_0x20f0e1,_0x2cd6f3){var _0x9f2287={},_0x28efaf={},_0x533c34={'count':0x0,'rows':[]};var _0x4c26df=_[_0xdfd8('0x2b')](db['VoiceChanSpy']['rawAttributes'],function(_0x8d8471){return{'name':_0x8d8471[_0xdfd8('0x2c')],'type':_0x8d8471[_0xdfd8('0x2d')]['key']};});_0x28efaf[_0xdfd8('0x2e')]=_[_0xdfd8('0x2b')](_0x4c26df,_0xdfd8('0x28'));_0x28efaf[_0xdfd8('0x2f')]=_['keys'](_0x20f0e1[_0xdfd8('0x2f')]);_0x28efaf[_0xdfd8('0x30')]=_[_0xdfd8('0x31')](_0x28efaf[_0xdfd8('0x2e')],_0x28efaf['query']);_0x9f2287[_0xdfd8('0x32')]=_['intersection'](_0x28efaf[_0xdfd8('0x2e')],qs[_0xdfd8('0x33')](_0x20f0e1[_0xdfd8('0x2f')][_0xdfd8('0x33')]));_0x9f2287['attributes']=_0x9f2287[_0xdfd8('0x32')][_0xdfd8('0x34')]?_0x9f2287[_0xdfd8('0x32')]:_0x28efaf[_0xdfd8('0x2e')];if(!_0x20f0e1[_0xdfd8('0x2f')][_0xdfd8('0x35')](_0xdfd8('0x36'))){_0x9f2287[_0xdfd8('0x1b')]=qs[_0xdfd8('0x1b')](_0x20f0e1[_0xdfd8('0x2f')][_0xdfd8('0x1b')]);_0x9f2287[_0xdfd8('0x1a')]=qs['offset'](_0x20f0e1[_0xdfd8('0x2f')][_0xdfd8('0x1a')]);}_0x9f2287[_0xdfd8('0x37')]=qs['sort'](_0x20f0e1['query'][_0xdfd8('0x38')]);_0x9f2287[_0xdfd8('0x39')]=qs[_0xdfd8('0x30')](_[_0xdfd8('0x3a')](_0x20f0e1[_0xdfd8('0x2f')],_0x28efaf[_0xdfd8('0x30')]));if(_0x20f0e1['query'][_0xdfd8('0x3b')]){_0x9f2287[_0xdfd8('0x39')]=_['merge'](_0x9f2287['where'],{'$or':_[_0xdfd8('0x2b')](_0x4c26df,function(_0x505970){if(_0x505970[_0xdfd8('0x2d')]!==_0xdfd8('0x3c')){var _0x1568b5={};_0x1568b5[_0x505970[_0xdfd8('0x28')]]={'$like':'%'+_0x20f0e1[_0xdfd8('0x2f')][_0xdfd8('0x3b')]+'%'};return _0x1568b5;}})});}_0x9f2287=_[_0xdfd8('0x3d')]({},_0x9f2287,_0x20f0e1[_0xdfd8('0x3e')]);var _0x14c899={'where':_0x9f2287['where']};return db[_0xdfd8('0x3f')][_0xdfd8('0x40')](_0x14c899)[_0xdfd8('0x21')](function(_0x4d3c64){_0x533c34[_0xdfd8('0x40')]=_0x4d3c64;if(_0x20f0e1[_0xdfd8('0x2f')]['includeAll']){_0x9f2287[_0xdfd8('0x41')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x9f2287);})[_0xdfd8('0x21')](function(_0x59f81a){_0x533c34[_0xdfd8('0x42')]=_0x59f81a;return _0x533c34;})[_0xdfd8('0x21')](respondWithFilteredResult(_0x2cd6f3,_0x9f2287))['catch'](handleError(_0x2cd6f3,null));};exports[_0xdfd8('0x43')]=function(_0x499174,_0x108f61){var _0x1501d5={'raw':![],'where':{'id':_0x499174[_0xdfd8('0x44')]['id']}},_0x593e98={};_0x593e98[_0xdfd8('0x2e')]=_['keys'](db['VoiceChanSpy'][_0xdfd8('0x45')]);_0x593e98[_0xdfd8('0x2f')]=_[_0xdfd8('0x46')](_0x499174['query']);_0x593e98['filters']=_[_0xdfd8('0x31')](_0x593e98[_0xdfd8('0x2e')],_0x593e98[_0xdfd8('0x2f')]);_0x1501d5['attributes']=_[_0xdfd8('0x31')](_0x593e98[_0xdfd8('0x2e')],qs[_0xdfd8('0x33')](_0x499174[_0xdfd8('0x2f')][_0xdfd8('0x33')]));_0x1501d5[_0xdfd8('0x32')]=_0x1501d5['attributes'][_0xdfd8('0x34')]?_0x1501d5[_0xdfd8('0x32')]:_0x593e98[_0xdfd8('0x2e')];if(_0x499174[_0xdfd8('0x2f')][_0xdfd8('0x47')]){_0x1501d5[_0xdfd8('0x41')]=[{'all':!![]}];}_0x1501d5=_[_0xdfd8('0x3d')]({},_0x1501d5,_0x499174['options']);return db[_0xdfd8('0x3f')][_0xdfd8('0x48')](_0x1501d5)[_0xdfd8('0x21')](handleEntityNotFound(_0x108f61,null))[_0xdfd8('0x21')](respondWithResult(_0x108f61,null))[_0xdfd8('0x49')](handleError(_0x108f61,null));};exports[_0xdfd8('0x4a')]=function(_0x2533ce,_0x69d0e5){return db['VoiceChanSpy'][_0xdfd8('0x4a')](_0x2533ce['body'],{})[_0xdfd8('0x21')](function(_0x384b84){var _0x539563=_0x2533ce['user'][_0xdfd8('0x23')]({'plain':!![]});if(!_0x539563)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x539563[_0xdfd8('0x4b')]===_0xdfd8('0x4c')){var _0x451bf9=_0x384b84[_0xdfd8('0x23')]({'plain':!![]});var _0x123553=_0xdfd8('0x24');return db['UserProfileSection'][_0xdfd8('0x48')]({'where':{'name':_0x123553,'userProfileId':_0x539563[_0xdfd8('0x4d')]},'raw':!![]})['then'](function(_0x3295f1){if(_0x3295f1&&_0x3295f1['autoAssociation']===0x0){return db[_0xdfd8('0x25')][_0xdfd8('0x4a')]({'name':_0x451bf9[_0xdfd8('0x28')],'resourceId':_0x451bf9['id'],'type':_0x3295f1[_0xdfd8('0x28')],'sectionId':_0x3295f1['id']},{})[_0xdfd8('0x21')](function(){return _0x384b84;});}else{return _0x384b84;}})[_0xdfd8('0x49')](function(_0x19484f){logger['error'](_0xdfd8('0x4e'),_0x19484f);throw _0x19484f;});}return _0x384b84;})[_0xdfd8('0x21')](respondWithResult(_0x69d0e5,0xc9))[_0xdfd8('0x49')](handleError(_0x69d0e5,null));};exports[_0xdfd8('0x20')]=function(_0x25bc16,_0x174859){if(_0x25bc16[_0xdfd8('0x4f')]['id']){delete _0x25bc16[_0xdfd8('0x4f')]['id'];}return db['VoiceChanSpy'][_0xdfd8('0x48')]({'where':{'id':_0x25bc16['params']['id']}})[_0xdfd8('0x21')](handleEntityNotFound(_0x174859,null))[_0xdfd8('0x21')](saveUpdates(_0x25bc16[_0xdfd8('0x4f')],null))[_0xdfd8('0x21')](respondWithResult(_0x174859,null))[_0xdfd8('0x49')](handleError(_0x174859,null));};exports[_0xdfd8('0x22')]=function(_0x312ab1,_0x25ddc8){return db[_0xdfd8('0x3f')][_0xdfd8('0x48')]({'where':{'id':_0x312ab1['params']['id']}})[_0xdfd8('0x21')](handleEntityNotFound(_0x25ddc8,null))[_0xdfd8('0x21')](removeEntity(_0x25ddc8,null))[_0xdfd8('0x49')](handleError(_0x25ddc8,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index e674e4b..3ed758d 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 _0xf021=['Set','format','CDR(type)=%s','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','ChanSpy','SIP/%s,%s','name','options','StopMixMonitor','concat','internal','User','findAll','agent','then','exports','models','define','VoiceChanSpy','voice_chanspy','length','VoiceExtension','catch','bulkCreate','destroy','lodash','bluebird','context','%s%s','prefix','system','push','merge'];(function(_0x211188,_0x1bf47a){var _0x5b477f=function(_0x1bc0ea){while(--_0x1bc0ea){_0x211188['push'](_0x211188['shift']());}};_0x5b477f(++_0x1bf47a);}(_0xf021,0x120));var _0x1f02=function(_0x97ab47,_0x5cdab2){_0x97ab47=_0x97ab47-0x0;var _0x2d291f=_0xf021[_0x97ab47];return _0x2d291f;};'use strict';var _=require(_0x1f02('0x0'));var util=require('util');var BPromise=require(_0x1f02('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x498287,_0x510c90,_0x7100d6){var _0x4f6a69=0x1;var _0x4ce1ab=[];var _0x59fe4a={'context':_0x510c90[_0x1f02('0x2')]||'from-sip','exten':util['format'](_0x1f02('0x3'),_0x498287[_0x1f02('0x4')],_0x7100d6),'type':_0x1f02('0x5'),'isApp':![],'ChanSpyId':_0x498287['id'],'UserId':_0x510c90['id']};_0x4ce1ab[_0x1f02('0x6')](_[_0x1f02('0x7')]({'app':_0x1f02('0x8'),'appdata':util[_0x1f02('0x9')](_0x1f02('0xa'),'chanspy'),'priority':_0x4f6a69++},_0x59fe4a));if(_0x498287[_0x1f02('0xb')]){_0x4ce1ab[_0x1f02('0x6')](_[_0x1f02('0x7')]({'app':_0x1f02('0xc'),'appdata':util['format'](_0x1f02('0xd'),_0x498287[_0x1f02('0xe')]),'priority':_0x4f6a69++},_0x59fe4a));}if(_0x498287[_0x1f02('0xf')]){_0x4ce1ab[_0x1f02('0x6')](_[_0x1f02('0x7')]({'app':'Authenticate','appdata':_0x498287['password'],'priority':_0x4f6a69++},_0x59fe4a));}_0x4ce1ab[_0x1f02('0x6')](_['merge']({'app':_0x1f02('0x10'),'appdata':util[_0x1f02('0x9')](_0x1f02('0x11'),_0x510c90[_0x1f02('0x12')],_0x498287[_0x1f02('0x13')]?_0x498287[_0x1f02('0x13')]['join'](''):''),'priority':_0x4f6a69++},_0x59fe4a));if(_0x498287['record']){_0x4ce1ab[_0x1f02('0x6')](_[_0x1f02('0x7')]({'app':_0x1f02('0x14'),'priority':_0x4f6a69++},_0x59fe4a));}return _0x4ce1ab;};var getChanSpyApplications=function(_0x31eed1,_0x2ff4f1){var _0x1c3880=[];for(var _0x676016=0x0,_0x24b01b=0x1;_0x676016<_0x2ff4f1['length'];_0x676016++,_0x24b01b=0x1){_0x1c3880=_0x1c3880[_0x1f02('0x15')](getUserApplications(_0x31eed1,_0x2ff4f1[_0x676016],_0x2ff4f1[_0x676016][_0x1f02('0x16')]));if(_0x2ff4f1[_0x676016][_0x1f02('0x16')]!=_0x2ff4f1[_0x676016][_0x1f02('0x12')]){_0x1c3880=_0x1c3880['concat'](getUserApplications(_0x31eed1,_0x2ff4f1[_0x676016],_0x2ff4f1[_0x676016][_0x1f02('0x12')]));}}return _0x1c3880;};var getChanSpyPromise=function(_0x309c87,_0x1faa60){return new BPromise(function(_0x29ff1a,_0x59d8ad){return _0x309c87[_0x1f02('0x17')][_0x1f02('0x18')]({'attributes':['id',_0x1f02('0x12'),'internal'],'where':{'role':_0x1f02('0x19'),'chanspy':!![]},'raw':!![]})[_0x1f02('0x1a')](function(_0x1345ed){if(_0x1345ed){return _0x29ff1a(getChanSpyApplications(_0x1faa60,_0x1345ed));}return _0x29ff1a([]);})['catch'](function(_0x5b429d){_0x59d8ad(_0x5b429d);});});};module[_0x1f02('0x1b')]=function(_0x329011,_0x4c4204){var _0x46ff13=_0x329011[_0x1f02('0x1c')];return _0x329011[_0x1f02('0x1d')](_0x1f02('0x1e'),attributes,{'tableName':_0x1f02('0x1f'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5d3e34,_0x41f7e3,_0x3826ad){return getChanSpyPromise(_0x46ff13,_0x5d3e34)[_0x1f02('0x1a')](function(_0x259b9a){if(_0x259b9a&&_0x259b9a[_0x1f02('0x20')]){return _0x46ff13[_0x1f02('0x21')]['bulkCreate'](_0x259b9a);}})[_0x1f02('0x1a')](function(){_0x3826ad();})[_0x1f02('0x22')](function(_0x1e7439){_0x3826ad(_0x1e7439);});},'afterUpdate':function(_0x22ee64,_0x4304ba,_0x5dfd45){return _0x46ff13[_0x1f02('0x21')]['destroy']({'where':{'ChanSpyId':_0x22ee64['id']}})['then'](function(){return getChanSpyPromise(_0x46ff13,_0x22ee64);})[_0x1f02('0x1a')](function(_0x5df008){if(_0x5df008&&_0x5df008['length']){return _0x46ff13[_0x1f02('0x21')][_0x1f02('0x23')](_0x5df008);}})[_0x1f02('0x1a')](function(){_0x5dfd45();})[_0x1f02('0x22')](function(_0x5c881e){_0x5dfd45(_0x5c881e);});},'afterDestroy':function(_0x3ab29f,_0x52efdd,_0x3b3825){return _0x46ff13[_0x1f02('0x21')][_0x1f02('0x24')]({'where':{'ChanSpyId':_0x3ab29f['id']}})[_0x1f02('0x1a')](function(){_0x3b3825();})[_0x1f02('0x22')](function(_0x37add9){_0x3b3825(_0x37add9);});}}});}; \ No newline at end of file +var _0xfa67=['MixMonitor','${UNIQUEID}.%s,ab','Authenticate','password','ChanSpy','SIP/%s,%s','options','join','StopMixMonitor','concat','name','User','findAll','internal','agent','then','catch','exports','models','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','%s%s','prefix','push','merge','CDR(type)=%s','chanspy','record'];(function(_0x581696,_0x5767fa){var _0x5b920f=function(_0x1629e9){while(--_0x1629e9){_0x581696['push'](_0x581696['shift']());}};_0x5b920f(++_0x5767fa);}(_0xfa67,0x1eb));var _0x7fa6=function(_0x4ea2be,_0xe32d6d){_0x4ea2be=_0x4ea2be-0x0;var _0x5e7cad=_0xfa67[_0x4ea2be];return _0x5e7cad;};'use strict';var _=require(_0x7fa6('0x0'));var util=require(_0x7fa6('0x1'));var BPromise=require(_0x7fa6('0x2'));var attributes=require(_0x7fa6('0x3'));var getUserApplications=function(_0x4b93db,_0x2cf406,_0x1ec4ca){var _0x52abfb=0x1;var _0x2b0424=[];var _0x28397e={'context':_0x2cf406['context']||_0x7fa6('0x4'),'exten':util[_0x7fa6('0x5')](_0x7fa6('0x6'),_0x4b93db[_0x7fa6('0x7')],_0x1ec4ca),'type':'system','isApp':![],'ChanSpyId':_0x4b93db['id'],'UserId':_0x2cf406['id']};_0x2b0424[_0x7fa6('0x8')](_[_0x7fa6('0x9')]({'app':'Set','appdata':util[_0x7fa6('0x5')](_0x7fa6('0xa'),_0x7fa6('0xb')),'priority':_0x52abfb++},_0x28397e));if(_0x4b93db[_0x7fa6('0xc')]){_0x2b0424[_0x7fa6('0x8')](_[_0x7fa6('0x9')]({'app':_0x7fa6('0xd'),'appdata':util[_0x7fa6('0x5')](_0x7fa6('0xe'),_0x4b93db['recordingFormat']),'priority':_0x52abfb++},_0x28397e));}if(_0x4b93db['auth']){_0x2b0424[_0x7fa6('0x8')](_[_0x7fa6('0x9')]({'app':_0x7fa6('0xf'),'appdata':_0x4b93db[_0x7fa6('0x10')],'priority':_0x52abfb++},_0x28397e));}_0x2b0424['push'](_[_0x7fa6('0x9')]({'app':_0x7fa6('0x11'),'appdata':util[_0x7fa6('0x5')](_0x7fa6('0x12'),_0x2cf406['name'],_0x4b93db['options']?_0x4b93db[_0x7fa6('0x13')][_0x7fa6('0x14')](''):''),'priority':_0x52abfb++},_0x28397e));if(_0x4b93db[_0x7fa6('0xc')]){_0x2b0424[_0x7fa6('0x8')](_['merge']({'app':_0x7fa6('0x15'),'priority':_0x52abfb++},_0x28397e));}return _0x2b0424;};var getChanSpyApplications=function(_0x341205,_0x12eca4){var _0x7df198=[];for(var _0xd5ccee=0x0,_0x155b52=0x1;_0xd5ccee<_0x12eca4['length'];_0xd5ccee++,_0x155b52=0x1){_0x7df198=_0x7df198[_0x7fa6('0x16')](getUserApplications(_0x341205,_0x12eca4[_0xd5ccee],_0x12eca4[_0xd5ccee]['internal']));if(_0x12eca4[_0xd5ccee]['internal']!=_0x12eca4[_0xd5ccee]['name']){_0x7df198=_0x7df198[_0x7fa6('0x16')](getUserApplications(_0x341205,_0x12eca4[_0xd5ccee],_0x12eca4[_0xd5ccee][_0x7fa6('0x17')]));}}return _0x7df198;};var getChanSpyPromise=function(_0x4f6a60,_0x5cbc53){return new BPromise(function(_0x1bb477,_0x3392c5){return _0x4f6a60[_0x7fa6('0x18')][_0x7fa6('0x19')]({'attributes':['id',_0x7fa6('0x17'),_0x7fa6('0x1a')],'where':{'role':_0x7fa6('0x1b'),'chanspy':!![]},'raw':!![]})[_0x7fa6('0x1c')](function(_0x76ea95){if(_0x76ea95){return _0x1bb477(getChanSpyApplications(_0x5cbc53,_0x76ea95));}return _0x1bb477([]);})[_0x7fa6('0x1d')](function(_0x5106b5){_0x3392c5(_0x5106b5);});});};module[_0x7fa6('0x1e')]=function(_0x34d4c0,_0x5ad423){var _0x4bd15d=_0x34d4c0[_0x7fa6('0x1f')];return _0x34d4c0['define']('VoiceChanSpy',attributes,{'tableName':_0x7fa6('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x125a3f,_0x74737c,_0x123edb){return getChanSpyPromise(_0x4bd15d,_0x125a3f)['then'](function(_0x17fa47){if(_0x17fa47&&_0x17fa47['length']){return _0x4bd15d[_0x7fa6('0x21')][_0x7fa6('0x22')](_0x17fa47);}})[_0x7fa6('0x1c')](function(){_0x123edb();})[_0x7fa6('0x1d')](function(_0xf5156f){_0x123edb(_0xf5156f);});},'afterUpdate':function(_0x4ac8cd,_0x1aaa19,_0x1ecd2f){return _0x4bd15d[_0x7fa6('0x21')][_0x7fa6('0x23')]({'where':{'ChanSpyId':_0x4ac8cd['id']}})[_0x7fa6('0x1c')](function(){return getChanSpyPromise(_0x4bd15d,_0x4ac8cd);})['then'](function(_0x552979){if(_0x552979&&_0x552979['length']){return _0x4bd15d[_0x7fa6('0x21')][_0x7fa6('0x22')](_0x552979);}})[_0x7fa6('0x1c')](function(){_0x1ecd2f();})[_0x7fa6('0x1d')](function(_0x148466){_0x1ecd2f(_0x148466);});},'afterDestroy':function(_0x46d2e8,_0x1ab9e1,_0x3e57ab){return _0x4bd15d[_0x7fa6('0x21')][_0x7fa6('0x23')]({'where':{'ChanSpyId':_0x46d2e8['id']}})['then'](function(){_0x3e57ab();})[_0x7fa6('0x1d')](function(_0x31060b){_0x3e57ab(_0x31060b);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 3f26f64..bdeaae5 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 _0xd4b1=['randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','moment','bluebird'];(function(_0x35789f,_0x3b6735){var _0x406aa0=function(_0x2c5cac){while(--_0x2c5cac){_0x35789f['push'](_0x35789f['shift']());}};_0x406aa0(++_0x3b6735);}(_0xd4b1,0xe3));var _0x1d4b=function(_0x2ac169,_0x43f16c){_0x2ac169=_0x2ac169-0x0;var _0xa2ab57=_0xd4b1[_0x2ac169];return _0xa2ab57;};'use strict';var _=require(_0x1d4b('0x0'));var util=require('util');var moment=require(_0x1d4b('0x1'));var BPromise=require(_0x1d4b('0x2'));var rs=require(_0x1d4b('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x1d4b('0x4'));var logger=require('../../config/logger')(_0x1d4b('0x5'));var config=require(_0x1d4b('0x6'));var jayson=require(_0x1d4b('0x7'));var client=jayson[_0x1d4b('0x8')][_0x1d4b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34eacc,_0x28eeb2,_0x19ccec){return new BPromise(function(_0x88bedf,_0x44feea){return client[_0x1d4b('0xa')](_0x34eacc,_0x19ccec)[_0x1d4b('0xb')](function(_0x3752ef){logger[_0x1d4b('0xc')](_0x1d4b('0xd'),_0x28eeb2,_0x1d4b('0xe'));logger[_0x1d4b('0xf')](_0x1d4b('0x10'),_0x28eeb2,'request\x20sent',JSON[_0x1d4b('0x11')](_0x3752ef));if(_0x3752ef[_0x1d4b('0x12')]){if(_0x3752ef[_0x1d4b('0x12')][_0x1d4b('0x13')]===0x1f4){logger['error'](_0x1d4b('0xd'),_0x28eeb2,_0x3752ef[_0x1d4b('0x12')][_0x1d4b('0x14')]);return _0x44feea(_0x3752ef['error']['message']);}logger['error'](_0x1d4b('0xd'),_0x28eeb2,_0x3752ef[_0x1d4b('0x12')][_0x1d4b('0x14')]);return _0x88bedf(_0x3752ef[_0x1d4b('0x12')][_0x1d4b('0x14')]);}else{logger[_0x1d4b('0xc')](_0x1d4b('0xd'),_0x28eeb2,_0x1d4b('0xe'));_0x88bedf(_0x3752ef[_0x1d4b('0x15')]['message']);}})[_0x1d4b('0x16')](function(_0x54813b){logger[_0x1d4b('0x12')](_0x1d4b('0xd'),_0x28eeb2,_0x54813b);_0x44feea(_0x54813b);});});} \ No newline at end of file +var _0x6351=['jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x39096d,_0x51f8a0){var _0x13da4f=function(_0x11e6b2){while(--_0x11e6b2){_0x39096d['push'](_0x39096d['shift']());}};_0x13da4f(++_0x51f8a0);}(_0x6351,0x85));var _0x1635=function(_0x4b4517,_0x5dbf6a){_0x4b4517=_0x4b4517-0x0;var _0x48278b=_0x6351[_0x4b4517];return _0x48278b;};'use strict';var _=require(_0x1635('0x0'));var util=require('util');var moment=require(_0x1635('0x1'));var BPromise=require('bluebird');var rs=require(_0x1635('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1635('0x3'))['db'];var utils=require(_0x1635('0x4'));var logger=require('../../config/logger')(_0x1635('0x5'));var config=require(_0x1635('0x6'));var jayson=require(_0x1635('0x7'));var client=jayson[_0x1635('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x939970,_0x332528,_0x220b08){return new BPromise(function(_0x2ac274,_0x31f12f){return client[_0x1635('0x9')](_0x939970,_0x220b08)[_0x1635('0xa')](function(_0x4395a4){logger[_0x1635('0xb')](_0x1635('0xc'),_0x332528,_0x1635('0xd'));logger[_0x1635('0xe')]('VoiceChanSpy,\x20%s,\x20%s,\x20%s',_0x332528,_0x1635('0xd'),JSON[_0x1635('0xf')](_0x4395a4));if(_0x4395a4[_0x1635('0x10')]){if(_0x4395a4['error'][_0x1635('0x11')]===0x1f4){logger[_0x1635('0x10')]('VoiceChanSpy,\x20%s,\x20%s',_0x332528,_0x4395a4['error']['message']);return _0x31f12f(_0x4395a4[_0x1635('0x10')]['message']);}logger['error'](_0x1635('0xc'),_0x332528,_0x4395a4[_0x1635('0x10')][_0x1635('0x12')]);return _0x2ac274(_0x4395a4[_0x1635('0x10')][_0x1635('0x12')]);}else{logger[_0x1635('0xb')](_0x1635('0xc'),_0x332528,'request\x20sent');_0x2ac274(_0x4395a4[_0x1635('0x13')]['message']);}})['catch'](function(_0x7c0a91){logger[_0x1635('0x10')](_0x1635('0xc'),_0x332528,_0x7c0a91);_0x31f12f(_0x7c0a91);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 82313b1..d7aca7e 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 _0x415c=['exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','./voiceContext.controller','isAuthenticated','index','/:id','post','create','put','update','delete','destroy'];(function(_0x4c5c42,_0x57234d){var _0x427b56=function(_0x1b2036){while(--_0x1b2036){_0x4c5c42['push'](_0x4c5c42['shift']());}};_0x427b56(++_0x57234d);}(_0x415c,0x111));var _0xc415=function(_0x244550,_0x31c0d0){_0x244550=_0x244550-0x0;var _0xfbcab3=_0x415c[_0x244550];return _0xfbcab3;};'use strict';var multer=require(_0xc415('0x0'));var util=require('util');var path=require(_0xc415('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc415('0x2')]();var auth=require(_0xc415('0x3'));var interaction=require(_0xc415('0x4'));var config=require('../../config/environment');var controller=require(_0xc415('0x5'));router['get']('/',auth[_0xc415('0x6')](),controller[_0xc415('0x7')]);router['get'](_0xc415('0x8'),auth[_0xc415('0x6')](),controller['show']);router[_0xc415('0x9')]('/',auth['isAuthenticated'](),controller[_0xc415('0xa')]);router[_0xc415('0xb')](_0xc415('0x8'),auth['isAuthenticated'](),controller[_0xc415('0xc')]);router[_0xc415('0xd')](_0xc415('0x8'),auth[_0xc415('0x6')](),controller[_0xc415('0xe')]);module[_0xc415('0xf')]=router; \ No newline at end of file +var _0xe79b=['index','get','/:id','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated'];(function(_0x3d1fda,_0x564a10){var _0xe00623=function(_0xe8119a){while(--_0xe8119a){_0x3d1fda['push'](_0x3d1fda['shift']());}};_0xe00623(++_0x564a10);}(_0xe79b,0xb2));var _0xbe79=function(_0x4de877,_0x340170){_0x4de877=_0x4de877-0x0;var _0xb2cfeb=_0xe79b[_0x4de877];return _0xb2cfeb;};'use strict';var multer=require(_0xbe79('0x0'));var util=require('util');var path=require(_0xbe79('0x1'));var timeout=require(_0xbe79('0x2'));var express=require(_0xbe79('0x3'));var router=express['Router']();var auth=require(_0xbe79('0x4'));var interaction=require(_0xbe79('0x5'));var config=require(_0xbe79('0x6'));var controller=require(_0xbe79('0x7'));router['get']('/',auth[_0xbe79('0x8')](),controller[_0xbe79('0x9')]);router[_0xbe79('0xa')](_0xbe79('0xb'),auth[_0xbe79('0x8')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe79('0xc')](_0xbe79('0xb'),auth[_0xbe79('0x8')](),controller[_0xbe79('0xd')]);router[_0xbe79('0xe')](_0xbe79('0xb'),auth['isAuthenticated'](),controller[_0xbe79('0xf')]);module[_0xbe79('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.attributes.js b/server/api/voiceContext/voiceContext.attributes.js index 4ea84ec..56a9b2b 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 _0x3e74=['name','sequelize','STRING'];(function(_0x50c4fb,_0x4d3844){var _0x4ea2f4=function(_0x5d1bbf){while(--_0x5d1bbf){_0x50c4fb['push'](_0x50c4fb['shift']());}};_0x4ea2f4(++_0x4d3844);}(_0x3e74,0x175));var _0x43e7=function(_0x42ff35,_0x4fbf72){_0x42ff35=_0x42ff35-0x0;var _0x288689=_0x3e74[_0x42ff35];return _0x288689;};'use strict';var Sequelize=require(_0x43e7('0x0'));module['exports']={'name':{'type':Sequelize[_0x43e7('0x1')],'unique':_0x43e7('0x2')},'description':{'type':Sequelize[_0x43e7('0x1')],'allowNull':!![]},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x6ecef4,_0x3cf72b){var _0x413e17=function(_0x3f4a92){while(--_0x3f4a92){_0x6ecef4['push'](_0x6ecef4['shift']());}};_0x413e17(++_0x3cf72b);}(_0x9957,0x93));var _0x7995=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9957[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 9d270c2..74f2e9c 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 _0xe236=['query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','VIRTUAL','merge','options','where','includeAll','include','findAll','rows','params','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','sendStatus','status','end','count','offset','set','apply','save','get','Contexts','UserProfileResource','destroy','stack','name','index','VoiceContext','rawAttributes','fieldName','type','key','model'];(function(_0x16a2e7,_0x18a313){var _0x11e3a2=function(_0x3dbd10){while(--_0x3dbd10){_0x16a2e7['push'](_0x16a2e7['shift']());}};_0x11e3a2(++_0x18a313);}(_0xe236,0x1cc));var _0x6e23=function(_0x4de9e8,_0x565ffa){_0x4de9e8=_0x4de9e8-0x0;var _0x4db0de=_0xe236[_0x4de9e8];return _0x4db0de;};'use strict';var pdf=require(_0x6e23('0x0'));var emlformat=require(_0x6e23('0x1'));var rimraf=require(_0x6e23('0x2'));var zipdir=require(_0x6e23('0x3'));var jsonpatch=require(_0x6e23('0x4'));var rp=require('request-promise');var moment=require(_0x6e23('0x5'));var BPromise=require(_0x6e23('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x6e23('0x7'));var csv=require('to-csv');var ejs=require(_0x6e23('0x8'));var fs=require('fs');var _=require(_0x6e23('0x9'));var squel=require(_0x6e23('0xa'));var crypto=require(_0x6e23('0xb'));var jsforce=require(_0x6e23('0xc'));var deskjs=require(_0x6e23('0xd'));var toCsv=require(_0x6e23('0xe'));var querystring=require(_0x6e23('0xf'));var Papa=require('papaparse');var Redis=require(_0x6e23('0x10'));var authService=require(_0x6e23('0x11'));var qs=require(_0x6e23('0x12'));var as=require(_0x6e23('0x13'));var hardwareService=require(_0x6e23('0x14'));var logger=require(_0x6e23('0x15'))(_0x6e23('0x16'));var utils=require(_0x6e23('0x17'));var config=require(_0x6e23('0x18'));var db=require(_0x6e23('0x19'))['db'];var jayson=require(_0x6e23('0x1a'));var client=jayson[_0x6e23('0x1b')][_0x6e23('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4f1edb,_0x47ca3e,_0x5a812e){if(_0x5a812e){var _0x2af822=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2af822[_0x6e23('0x1d')](_0x47ca3e)){return _0x4f1edb;}else{throw new db[(_0x6e23('0x1e'))][(_0x6e23('0x1f'))](_0x6e23('0x20'));}}else{return _0x4f1edb;}}function respondWithRpcPromise(_0x31d75f,_0x20ccd4,_0x5d3bac,_0x3afe1c){return new BPromise(function(_0x3cd92c,_0x355df0){var _0x573986=_0x3afe1c||client;return _0x573986[_0x6e23('0x21')](_0x31d75f,_0x5d3bac)[_0x6e23('0x22')](function(_0x4605f8){logger[_0x6e23('0x23')]('VoiceContext,\x20%s,\x20%s',_0x20ccd4,_0x6e23('0x24'));logger['debug'](_0x6e23('0x25'),_0x20ccd4,_0x6e23('0x24'),JSON['stringify'](_0x4605f8));if(_0x4605f8[_0x6e23('0x26')]){if(_0x4605f8[_0x6e23('0x26')][_0x6e23('0x27')]===0x1f4){logger[_0x6e23('0x26')]('VoiceContext,\x20%s,\x20%s',_0x20ccd4,_0x4605f8[_0x6e23('0x26')][_0x6e23('0x28')]);return _0x355df0(_0x4605f8[_0x6e23('0x26')][_0x6e23('0x28')]);}logger['error'](_0x6e23('0x29'),_0x20ccd4,_0x4605f8[_0x6e23('0x26')][_0x6e23('0x28')]);return _0x3cd92c(_0x4605f8[_0x6e23('0x26')][_0x6e23('0x28')]);}else{logger[_0x6e23('0x23')](_0x6e23('0x29'),_0x20ccd4,_0x6e23('0x24'));_0x3cd92c(_0x4605f8[_0x6e23('0x2a')][_0x6e23('0x28')]);}})[_0x6e23('0x2b')](function(_0x327fff){logger[_0x6e23('0x26')](_0x6e23('0x29'),_0x20ccd4,_0x327fff);_0x355df0(_0x327fff);});});}function respondWithStatusCode(_0x4c1b71,_0x96e875){_0x96e875=_0x96e875||0xcc;return function(_0x363fc7){if(_0x363fc7){return _0x4c1b71[_0x6e23('0x2c')](_0x96e875);}return _0x4c1b71[_0x6e23('0x2d')](_0x96e875)[_0x6e23('0x2e')]();};}function respondWithResult(_0x24a3ad,_0x22778f){_0x22778f=_0x22778f||0xc8;return function(_0x237d04){if(_0x237d04){return _0x24a3ad['status'](_0x22778f)['json'](_0x237d04);}};}function respondWithFilteredResult(_0x1e8b20,_0x4a36dc){return function(_0x44fb9f){if(_0x44fb9f){var _0x1bdf01=_0x44fb9f[_0x6e23('0x2f')],_0x46ba35=_0x4a36dc['offset'],_0x498189=_0x4a36dc[_0x6e23('0x30')]+_0x4a36dc['limit'],_0x2a281d;if(_0x498189>=_0x1bdf01){_0x498189=_0x1bdf01;_0x2a281d=0xc8;}else{_0x2a281d=0xce;}_0x1e8b20[_0x6e23('0x2d')](_0x2a281d);return _0x1e8b20[_0x6e23('0x31')]('Content-Range',_0x46ba35+'-'+_0x498189+'/'+_0x1bdf01)['json'](_0x44fb9f);}return null;};}function patchUpdates(_0x1e4856){return function(_0x547fa0){try{jsonpatch[_0x6e23('0x32')](_0x547fa0,_0x1e4856,!![]);}catch(_0x3bf0a2){return BPromise['reject'](_0x3bf0a2);}return _0x547fa0[_0x6e23('0x33')]();};}function saveUpdates(_0x2b9468,_0x162246){return function(_0xa9ec6c){if(_0xa9ec6c){return _0xa9ec6c['update'](_0x2b9468)[_0x6e23('0x22')](function(_0x3749c9){return _0x3749c9;});}return null;};}function removeEntity(_0x544b53,_0x3e1936){return function(_0x2ca126){if(_0x2ca126){return _0x2ca126['destroy']()['then'](function(){var _0x37ba43=_0x2ca126[_0x6e23('0x34')]({'plain':!![]});var _0x4cfbed=_0x6e23('0x35');return db[_0x6e23('0x36')][_0x6e23('0x37')]({'where':{'type':_0x4cfbed,'resourceId':_0x37ba43['id']}})[_0x6e23('0x22')](function(){return _0x2ca126;});})['then'](function(){_0x544b53[_0x6e23('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x18a316,_0x253601){return function(_0x355496){if(!_0x355496){_0x18a316[_0x6e23('0x2c')](0x194);}return _0x355496;};}function handleError(_0x370d73,_0x4223c8){_0x4223c8=_0x4223c8||0x1f4;return function(_0x2c8c08){logger[_0x6e23('0x26')](_0x2c8c08[_0x6e23('0x38')]);if(_0x2c8c08[_0x6e23('0x39')]){delete _0x2c8c08[_0x6e23('0x39')];}_0x370d73[_0x6e23('0x2d')](_0x4223c8)['send'](_0x2c8c08);};}exports[_0x6e23('0x3a')]=function(_0x557876,_0x294d8a){var _0x39573a={},_0x304f5d={},_0x105d2a={'count':0x0,'rows':[]};var _0x124df8=_['map'](db[_0x6e23('0x3b')][_0x6e23('0x3c')],function(_0x3c38d1){return{'name':_0x3c38d1[_0x6e23('0x3d')],'type':_0x3c38d1[_0x6e23('0x3e')][_0x6e23('0x3f')]};});_0x304f5d[_0x6e23('0x40')]=_['map'](_0x124df8,_0x6e23('0x39'));_0x304f5d[_0x6e23('0x41')]=_[_0x6e23('0x42')](_0x557876[_0x6e23('0x41')]);_0x304f5d[_0x6e23('0x43')]=_[_0x6e23('0x44')](_0x304f5d['model'],_0x304f5d['query']);_0x39573a[_0x6e23('0x45')]=_[_0x6e23('0x44')](_0x304f5d['model'],qs[_0x6e23('0x46')](_0x557876['query'][_0x6e23('0x46')]));_0x39573a['attributes']=_0x39573a['attributes'][_0x6e23('0x47')]?_0x39573a[_0x6e23('0x45')]:_0x304f5d[_0x6e23('0x40')];if(!_0x557876['query'][_0x6e23('0x48')]('nolimit')){_0x39573a[_0x6e23('0x49')]=qs['limit'](_0x557876[_0x6e23('0x41')][_0x6e23('0x49')]);_0x39573a['offset']=qs['offset'](_0x557876[_0x6e23('0x41')]['offset']);}_0x39573a[_0x6e23('0x4a')]=qs[_0x6e23('0x4b')](_0x557876['query'][_0x6e23('0x4b')]);_0x39573a['where']=qs['filters'](_['pick'](_0x557876[_0x6e23('0x41')],_0x304f5d[_0x6e23('0x43')]));if(_0x557876[_0x6e23('0x41')][_0x6e23('0x4c')]){_0x39573a['where']=_['merge'](_0x39573a['where'],{'$or':_['map'](_0x124df8,function(_0x5a3a26){if(_0x5a3a26[_0x6e23('0x3e')]!==_0x6e23('0x4d')){var _0x55f1a1={};_0x55f1a1[_0x5a3a26['name']]={'$like':'%'+_0x557876[_0x6e23('0x41')][_0x6e23('0x4c')]+'%'};return _0x55f1a1;}})});}_0x39573a=_[_0x6e23('0x4e')]({},_0x39573a,_0x557876[_0x6e23('0x4f')]);var _0x5b7e16={'where':_0x39573a[_0x6e23('0x50')]};return db[_0x6e23('0x3b')][_0x6e23('0x2f')](_0x5b7e16)['then'](function(_0x41fa96){_0x105d2a[_0x6e23('0x2f')]=_0x41fa96;if(_0x557876[_0x6e23('0x41')][_0x6e23('0x51')]){_0x39573a[_0x6e23('0x52')]=[{'all':!![]}];}return db['VoiceContext'][_0x6e23('0x53')](_0x39573a);})[_0x6e23('0x22')](function(_0x45c283){_0x105d2a[_0x6e23('0x54')]=_0x45c283;return _0x105d2a;})['then'](respondWithFilteredResult(_0x294d8a,_0x39573a))[_0x6e23('0x2b')](handleError(_0x294d8a,null));};exports['show']=function(_0x238544,_0x1090d4){var _0x224fbd={'raw':![],'where':{'id':_0x238544[_0x6e23('0x55')]['id']}},_0x400755={};_0x400755[_0x6e23('0x40')]=_[_0x6e23('0x42')](db['VoiceContext'][_0x6e23('0x3c')]);_0x400755[_0x6e23('0x41')]=_['keys'](_0x238544[_0x6e23('0x41')]);_0x400755[_0x6e23('0x43')]=_['intersection'](_0x400755[_0x6e23('0x40')],_0x400755[_0x6e23('0x41')]);_0x224fbd[_0x6e23('0x45')]=_[_0x6e23('0x44')](_0x400755[_0x6e23('0x40')],qs[_0x6e23('0x46')](_0x238544['query']['fields']));_0x224fbd[_0x6e23('0x45')]=_0x224fbd['attributes'][_0x6e23('0x47')]?_0x224fbd[_0x6e23('0x45')]:_0x400755['model'];if(_0x238544['query'][_0x6e23('0x51')]){_0x224fbd[_0x6e23('0x52')]=[{'all':!![]}];}_0x224fbd=_['merge']({},_0x224fbd,_0x238544[_0x6e23('0x4f')]);return db[_0x6e23('0x3b')][_0x6e23('0x56')](_0x224fbd)['then'](handleEntityNotFound(_0x1090d4,null))['then'](respondWithResult(_0x1090d4,null))['catch'](handleError(_0x1090d4,null));};exports['create']=function(_0x3f7bff,_0x2e6c1b,_0x33236a){var _0x2c85d9;return db[_0x6e23('0x3b')][_0x6e23('0x57')](_0x3f7bff[_0x6e23('0x58')],{'raw':!![]})[_0x6e23('0x22')](function(_0x35cca7){_0x2c85d9=_0x35cca7;return db['VoiceContext'][_0x6e23('0x53')]({'raw':!![]});})['then'](function(_0xa7ca2d){var _0x1290fd=fs[_0x6e23('0x59')](path[_0x6e23('0x5a')](config[_0x6e23('0x5b')],_0x6e23('0x5c')),_0x6e23('0x5d'));var _0x200526=ejs[_0x6e23('0x5e')](_0x1290fd,{'contexts':_0xa7ca2d||[]});fs[_0x6e23('0x5f')](_0x6e23('0x60'),_0x200526);})['then'](function(){return respondWithRpcPromise(_0x6e23('0x61'),_0x6e23('0x57'),{'module':_0x6e23('0x62')});})['then'](function(){var _0x4153fb=_0x3f7bff[_0x6e23('0x63')][_0x6e23('0x34')]({'plain':!![]});if(!_0x4153fb)throw new Error(_0x6e23('0x64'));if(_0x4153fb[_0x6e23('0x65')]===_0x6e23('0x63')){var _0x47d20d=_0x2c85d9[_0x6e23('0x34')]({'plain':!![]});return db[_0x6e23('0x66')][_0x6e23('0x56')]({'where':{'name':_0x6e23('0x35'),'userProfileId':_0x4153fb['userProfileId']},'raw':!![]})[_0x6e23('0x22')](function(_0x4c2431){if(_0x4c2431&&_0x4c2431['autoAssociation']===0x0){return db[_0x6e23('0x36')]['create']({'name':_0x47d20d['name'],'resourceId':_0x47d20d['id'],'type':_0x4c2431['name'],'sectionId':_0x4c2431['id']},{})[_0x6e23('0x22')](function(){return _0x2c85d9;});}else{return _0x2c85d9;}})[_0x6e23('0x2b')](function(_0x44d728){logger['error'](_0x6e23('0x67'),_0x44d728);throw _0x44d728;});}return _0x2c85d9;})[_0x6e23('0x22')](respondWithResult(_0x2e6c1b,0xc9))[_0x6e23('0x2b')](handleError(_0x2e6c1b,null));};exports[_0x6e23('0x68')]=function(_0x1b9523,_0x4dda2e,_0x25912a){var _0xbb69bb;return db['VoiceContext'][_0x6e23('0x56')]({'where':{'id':_0x1b9523['params']['id']}})[_0x6e23('0x22')](handleEntityNotFound(_0x4dda2e,null))[_0x6e23('0x22')](saveUpdates(_0x1b9523[_0x6e23('0x58')],null))[_0x6e23('0x22')](function(_0x1aaff3){if(_0x1aaff3){_0xbb69bb=_0x1aaff3;return db[_0x6e23('0x3b')][_0x6e23('0x53')]({'raw':!![]});}})[_0x6e23('0x22')](function(_0x25e1b9){var _0x4befea=fs[_0x6e23('0x59')](path['join'](config[_0x6e23('0x5b')],_0x6e23('0x5c')),_0x6e23('0x5d'));var _0x5267b2=ejs[_0x6e23('0x5e')](_0x4befea,{'contexts':_0x25e1b9||[]});fs[_0x6e23('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x5267b2);})[_0x6e23('0x22')](function(){return respondWithRpcPromise(_0x6e23('0x61'),_0x6e23('0x68'),{'module':_0x6e23('0x62')});})[_0x6e23('0x22')](function(){return _0xbb69bb;})[_0x6e23('0x22')](respondWithResult(_0x4dda2e,null))[_0x6e23('0x2b')](handleError(_0x4dda2e,null));};exports['destroy']=function(_0x2802dd,_0x437ff1,_0x5c92ea){var _0x402888;return db[_0x6e23('0x3b')][_0x6e23('0x56')]({'where':{'id':_0x2802dd[_0x6e23('0x55')]['id']}})[_0x6e23('0x22')](handleEntityNotFound(_0x437ff1,null))[_0x6e23('0x22')](removeEntity(_0x437ff1,null))[_0x6e23('0x22')](function(){return db[_0x6e23('0x3b')][_0x6e23('0x53')]({'raw':!![]});})['then'](function(_0x1196c3){var _0x50a102=fs[_0x6e23('0x59')](path[_0x6e23('0x5a')](config[_0x6e23('0x5b')],_0x6e23('0x5c')),_0x6e23('0x5d'));var _0x462edf=ejs[_0x6e23('0x5e')](_0x50a102,{'contexts':_0x1196c3});fs[_0x6e23('0x5f')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x462edf);return respondWithRpcPromise(_0x6e23('0x61'),'destroy',{'module':_0x6e23('0x62')});})[_0x6e23('0x2b')](handleError(_0x437ff1,null));}; \ No newline at end of file +var _0xc731=['update','destroy','get','sendStatus','stack','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','create','readFileSync','join','root','utf8','render','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Contexts','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','body','server/files/templates/context.ejs','writeFileSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','test','Sequelize','ValidationError','request','then','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','VoiceContext,\x20%s,\x20%s','message','info','request\x20sent','catch','status','end','json','offset','limit','Content-Range','reject','save'];(function(_0xd1315c,_0x2ce3a0){var _0x40565a=function(_0x3e2d51){while(--_0x3e2d51){_0xd1315c['push'](_0xd1315c['shift']());}};_0x40565a(++_0x2ce3a0);}(_0xc731,0x1e6));var _0x1c73=function(_0x49975a,_0x3c05c4){_0x49975a=_0x49975a-0x0;var _0x177fc6=_0xc731[_0x49975a];return _0x177fc6;};'use strict';var pdf=require(_0x1c73('0x0'));var emlformat=require(_0x1c73('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1c73('0x2'));var jsonpatch=require(_0x1c73('0x3'));var rp=require(_0x1c73('0x4'));var moment=require('moment');var BPromise=require(_0x1c73('0x5'));var Mustache=require('mustache');var util=require(_0x1c73('0x6'));var path=require(_0x1c73('0x7'));var sox=require(_0x1c73('0x8'));var csv=require('to-csv');var ejs=require(_0x1c73('0x9'));var fs=require('fs');var _=require(_0x1c73('0xa'));var squel=require('squel');var crypto=require(_0x1c73('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1c73('0xc'));var toCsv=require(_0x1c73('0xd'));var querystring=require(_0x1c73('0xe'));var Papa=require(_0x1c73('0xf'));var Redis=require(_0x1c73('0x10'));var authService=require(_0x1c73('0x11'));var qs=require(_0x1c73('0x12'));var as=require(_0x1c73('0x13'));var hardwareService=require(_0x1c73('0x14'));var logger=require(_0x1c73('0x15'))(_0x1c73('0x16'));var utils=require(_0x1c73('0x17'));var config=require(_0x1c73('0x18'));var db=require(_0x1c73('0x19'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0x1c73('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x1bd2f1,_0x3b4cee,_0x31519d){if(_0x31519d){var _0x6ec87=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6ec87[_0x1c73('0x1b')](_0x3b4cee)){return _0x1bd2f1;}else{throw new db[(_0x1c73('0x1c'))][(_0x1c73('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1bd2f1;}}function respondWithRpcPromise(_0x2d756f,_0x4f7f5c,_0x533416,_0x2cb7f1){return new BPromise(function(_0x22c882,_0x47797f){var _0x3e19b3=_0x2cb7f1||client;return _0x3e19b3[_0x1c73('0x1e')](_0x2d756f,_0x533416)[_0x1c73('0x1f')](function(_0x58e21e){logger['info']('VoiceContext,\x20%s,\x20%s',_0x4f7f5c,'request\x20sent');logger[_0x1c73('0x20')](_0x1c73('0x21'),_0x4f7f5c,'request\x20sent',JSON[_0x1c73('0x22')](_0x58e21e));if(_0x58e21e['error']){if(_0x58e21e[_0x1c73('0x23')]['code']===0x1f4){logger['error'](_0x1c73('0x24'),_0x4f7f5c,_0x58e21e[_0x1c73('0x23')]['message']);return _0x47797f(_0x58e21e[_0x1c73('0x23')][_0x1c73('0x25')]);}logger['error'](_0x1c73('0x24'),_0x4f7f5c,_0x58e21e['error'][_0x1c73('0x25')]);return _0x22c882(_0x58e21e[_0x1c73('0x23')]['message']);}else{logger[_0x1c73('0x26')](_0x1c73('0x24'),_0x4f7f5c,_0x1c73('0x27'));_0x22c882(_0x58e21e['result'][_0x1c73('0x25')]);}})[_0x1c73('0x28')](function(_0x557f28){logger['error'](_0x1c73('0x24'),_0x4f7f5c,_0x557f28);_0x47797f(_0x557f28);});});}function respondWithStatusCode(_0x1a739f,_0x178c61){_0x178c61=_0x178c61||0xcc;return function(_0x379f0f){if(_0x379f0f){return _0x1a739f['sendStatus'](_0x178c61);}return _0x1a739f[_0x1c73('0x29')](_0x178c61)[_0x1c73('0x2a')]();};}function respondWithResult(_0x44056c,_0x1176a5){_0x1176a5=_0x1176a5||0xc8;return function(_0x3216d8){if(_0x3216d8){return _0x44056c[_0x1c73('0x29')](_0x1176a5)[_0x1c73('0x2b')](_0x3216d8);}};}function respondWithFilteredResult(_0x2160f3,_0x14bf83){return function(_0x3d7f6f){if(_0x3d7f6f){var _0x1a8d43=_0x3d7f6f['count'],_0x3272da=_0x14bf83['offset'],_0x57da84=_0x14bf83[_0x1c73('0x2c')]+_0x14bf83[_0x1c73('0x2d')],_0x20f249;if(_0x57da84>=_0x1a8d43){_0x57da84=_0x1a8d43;_0x20f249=0xc8;}else{_0x20f249=0xce;}_0x2160f3['status'](_0x20f249);return _0x2160f3['set'](_0x1c73('0x2e'),_0x3272da+'-'+_0x57da84+'/'+_0x1a8d43)['json'](_0x3d7f6f);}return null;};}function patchUpdates(_0x58dfdd){return function(_0x5aca5d){try{jsonpatch['apply'](_0x5aca5d,_0x58dfdd,!![]);}catch(_0x690c02){return BPromise[_0x1c73('0x2f')](_0x690c02);}return _0x5aca5d[_0x1c73('0x30')]();};}function saveUpdates(_0x4bd234,_0x1a3825){return function(_0x2c2246){if(_0x2c2246){return _0x2c2246[_0x1c73('0x31')](_0x4bd234)[_0x1c73('0x1f')](function(_0x40765a){return _0x40765a;});}return null;};}function removeEntity(_0x4f4b27,_0x34cc57){return function(_0x1ec050){if(_0x1ec050){return _0x1ec050[_0x1c73('0x32')]()['then'](function(){var _0x57061e=_0x1ec050[_0x1c73('0x33')]({'plain':!![]});var _0x11d466='Contexts';return db['UserProfileResource'][_0x1c73('0x32')]({'where':{'type':_0x11d466,'resourceId':_0x57061e['id']}})[_0x1c73('0x1f')](function(){return _0x1ec050;});})['then'](function(){_0x4f4b27[_0x1c73('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48f232,_0x529469){return function(_0x52af75){if(!_0x52af75){_0x48f232[_0x1c73('0x34')](0x194);}return _0x52af75;};}function handleError(_0x3b6301,_0x5e7fc3){_0x5e7fc3=_0x5e7fc3||0x1f4;return function(_0x531095){logger[_0x1c73('0x23')](_0x531095[_0x1c73('0x35')]);if(_0x531095[_0x1c73('0x36')]){delete _0x531095['name'];}_0x3b6301[_0x1c73('0x29')](_0x5e7fc3)[_0x1c73('0x37')](_0x531095);};}exports[_0x1c73('0x38')]=function(_0x5db94f,_0x38a047){var _0x3a2475={},_0x2c51f0={},_0x25411c={'count':0x0,'rows':[]};var _0x49775a=_[_0x1c73('0x39')](db[_0x1c73('0x3a')][_0x1c73('0x3b')],function(_0x2e3d80){return{'name':_0x2e3d80[_0x1c73('0x3c')],'type':_0x2e3d80[_0x1c73('0x3d')][_0x1c73('0x3e')]};});_0x2c51f0[_0x1c73('0x3f')]=_['map'](_0x49775a,_0x1c73('0x36'));_0x2c51f0['query']=_[_0x1c73('0x40')](_0x5db94f['query']);_0x2c51f0[_0x1c73('0x41')]=_[_0x1c73('0x42')](_0x2c51f0['model'],_0x2c51f0[_0x1c73('0x43')]);_0x3a2475[_0x1c73('0x44')]=_[_0x1c73('0x42')](_0x2c51f0[_0x1c73('0x3f')],qs[_0x1c73('0x45')](_0x5db94f[_0x1c73('0x43')][_0x1c73('0x45')]));_0x3a2475[_0x1c73('0x44')]=_0x3a2475[_0x1c73('0x44')][_0x1c73('0x46')]?_0x3a2475[_0x1c73('0x44')]:_0x2c51f0['model'];if(!_0x5db94f[_0x1c73('0x43')][_0x1c73('0x47')](_0x1c73('0x48'))){_0x3a2475[_0x1c73('0x2d')]=qs[_0x1c73('0x2d')](_0x5db94f[_0x1c73('0x43')][_0x1c73('0x2d')]);_0x3a2475[_0x1c73('0x2c')]=qs['offset'](_0x5db94f[_0x1c73('0x43')][_0x1c73('0x2c')]);}_0x3a2475[_0x1c73('0x49')]=qs[_0x1c73('0x4a')](_0x5db94f[_0x1c73('0x43')][_0x1c73('0x4a')]);_0x3a2475[_0x1c73('0x4b')]=qs[_0x1c73('0x41')](_['pick'](_0x5db94f['query'],_0x2c51f0[_0x1c73('0x41')]));if(_0x5db94f[_0x1c73('0x43')][_0x1c73('0x4c')]){_0x3a2475[_0x1c73('0x4b')]=_[_0x1c73('0x4d')](_0x3a2475[_0x1c73('0x4b')],{'$or':_['map'](_0x49775a,function(_0x2808b9){if(_0x2808b9[_0x1c73('0x3d')]!==_0x1c73('0x4e')){var _0x2cbde5={};_0x2cbde5[_0x2808b9[_0x1c73('0x36')]]={'$like':'%'+_0x5db94f[_0x1c73('0x43')][_0x1c73('0x4c')]+'%'};return _0x2cbde5;}})});}_0x3a2475=_['merge']({},_0x3a2475,_0x5db94f[_0x1c73('0x4f')]);var _0x22563a={'where':_0x3a2475[_0x1c73('0x4b')]};return db[_0x1c73('0x3a')]['count'](_0x22563a)['then'](function(_0x51eb3b){_0x25411c['count']=_0x51eb3b;if(_0x5db94f['query'][_0x1c73('0x50')]){_0x3a2475[_0x1c73('0x51')]=[{'all':!![]}];}return db[_0x1c73('0x3a')][_0x1c73('0x52')](_0x3a2475);})[_0x1c73('0x1f')](function(_0x214136){_0x25411c['rows']=_0x214136;return _0x25411c;})['then'](respondWithFilteredResult(_0x38a047,_0x3a2475))[_0x1c73('0x28')](handleError(_0x38a047,null));};exports[_0x1c73('0x53')]=function(_0x103740,_0x2616a7){var _0x38961f={'raw':![],'where':{'id':_0x103740[_0x1c73('0x54')]['id']}},_0x5c926a={};_0x5c926a[_0x1c73('0x3f')]=_['keys'](db[_0x1c73('0x3a')][_0x1c73('0x3b')]);_0x5c926a[_0x1c73('0x43')]=_[_0x1c73('0x40')](_0x103740[_0x1c73('0x43')]);_0x5c926a['filters']=_['intersection'](_0x5c926a[_0x1c73('0x3f')],_0x5c926a['query']);_0x38961f[_0x1c73('0x44')]=_[_0x1c73('0x42')](_0x5c926a['model'],qs[_0x1c73('0x45')](_0x103740[_0x1c73('0x43')][_0x1c73('0x45')]));_0x38961f[_0x1c73('0x44')]=_0x38961f[_0x1c73('0x44')][_0x1c73('0x46')]?_0x38961f['attributes']:_0x5c926a[_0x1c73('0x3f')];if(_0x103740[_0x1c73('0x43')][_0x1c73('0x50')]){_0x38961f['include']=[{'all':!![]}];}_0x38961f=_[_0x1c73('0x4d')]({},_0x38961f,_0x103740[_0x1c73('0x4f')]);return db[_0x1c73('0x3a')]['find'](_0x38961f)['then'](handleEntityNotFound(_0x2616a7,null))[_0x1c73('0x1f')](respondWithResult(_0x2616a7,null))[_0x1c73('0x28')](handleError(_0x2616a7,null));};exports[_0x1c73('0x55')]=function(_0x3d515b,_0x58a892,_0x100b36){var _0x49d6aa;return db[_0x1c73('0x3a')][_0x1c73('0x55')](_0x3d515b['body'],{'raw':!![]})['then'](function(_0x3f8ddc){_0x49d6aa=_0x3f8ddc;return db[_0x1c73('0x3a')][_0x1c73('0x52')]({'raw':!![]});})[_0x1c73('0x1f')](function(_0x17b331){var _0x5bbaa3=fs[_0x1c73('0x56')](path[_0x1c73('0x57')](config[_0x1c73('0x58')],'server/files/templates/context.ejs'),_0x1c73('0x59'));var _0x1f3063=ejs[_0x1c73('0x5a')](_0x5bbaa3,{'contexts':_0x17b331||[]});fs['writeFileSync'](_0x1c73('0x5b'),_0x1f3063);})[_0x1c73('0x1f')](function(){return respondWithRpcPromise(_0x1c73('0x5c'),'create',{'module':_0x1c73('0x5d')});})[_0x1c73('0x1f')](function(){var _0xc3ca04=_0x3d515b[_0x1c73('0x5e')]['get']({'plain':!![]});if(!_0xc3ca04)throw new Error(_0x1c73('0x5f'));if(_0xc3ca04[_0x1c73('0x60')]===_0x1c73('0x5e')){var _0x1bfb08=_0x49d6aa[_0x1c73('0x33')]({'plain':!![]});return db[_0x1c73('0x61')]['find']({'where':{'name':_0x1c73('0x62'),'userProfileId':_0xc3ca04[_0x1c73('0x63')]},'raw':!![]})['then'](function(_0x45729f){if(_0x45729f&&_0x45729f[_0x1c73('0x64')]===0x0){return db[_0x1c73('0x65')][_0x1c73('0x55')]({'name':_0x1bfb08['name'],'resourceId':_0x1bfb08['id'],'type':_0x45729f[_0x1c73('0x36')],'sectionId':_0x45729f['id']},{})[_0x1c73('0x1f')](function(){return _0x49d6aa;});}else{return _0x49d6aa;}})[_0x1c73('0x28')](function(_0x1d4047){logger['error'](_0x1c73('0x66'),_0x1d4047);throw _0x1d4047;});}return _0x49d6aa;})[_0x1c73('0x1f')](respondWithResult(_0x58a892,0xc9))[_0x1c73('0x28')](handleError(_0x58a892,null));};exports[_0x1c73('0x31')]=function(_0x504d07,_0xb8d27a,_0x51a5e9){var _0x5c8d78;return db[_0x1c73('0x3a')][_0x1c73('0x67')]({'where':{'id':_0x504d07[_0x1c73('0x54')]['id']}})[_0x1c73('0x1f')](handleEntityNotFound(_0xb8d27a,null))[_0x1c73('0x1f')](saveUpdates(_0x504d07[_0x1c73('0x68')],null))[_0x1c73('0x1f')](function(_0x1346c4){if(_0x1346c4){_0x5c8d78=_0x1346c4;return db[_0x1c73('0x3a')][_0x1c73('0x52')]({'raw':!![]});}})[_0x1c73('0x1f')](function(_0x48c6e4){var _0x4577de=fs['readFileSync'](path[_0x1c73('0x57')](config[_0x1c73('0x58')],_0x1c73('0x69')),_0x1c73('0x59'));var _0x2a120a=ejs[_0x1c73('0x5a')](_0x4577de,{'contexts':_0x48c6e4||[]});fs[_0x1c73('0x6a')](_0x1c73('0x5b'),_0x2a120a);})[_0x1c73('0x1f')](function(){return respondWithRpcPromise(_0x1c73('0x5c'),_0x1c73('0x31'),{'module':'chan_sip.so'});})['then'](function(){return _0x5c8d78;})[_0x1c73('0x1f')](respondWithResult(_0xb8d27a,null))[_0x1c73('0x28')](handleError(_0xb8d27a,null));};exports['destroy']=function(_0x3b8f24,_0x144857,_0x34131d){var _0xdbc735;return db[_0x1c73('0x3a')][_0x1c73('0x67')]({'where':{'id':_0x3b8f24[_0x1c73('0x54')]['id']}})[_0x1c73('0x1f')](handleEntityNotFound(_0x144857,null))['then'](removeEntity(_0x144857,null))[_0x1c73('0x1f')](function(){return db[_0x1c73('0x3a')][_0x1c73('0x52')]({'raw':!![]});})[_0x1c73('0x1f')](function(_0x3c6bef){var _0x5df077=fs[_0x1c73('0x56')](path[_0x1c73('0x57')](config[_0x1c73('0x58')],_0x1c73('0x69')),_0x1c73('0x59'));var _0x7c29b1=ejs[_0x1c73('0x5a')](_0x5df077,{'contexts':_0x3c6bef});fs[_0x1c73('0x6a')](_0x1c73('0x5b'),_0x7c29b1);return respondWithRpcPromise(_0x1c73('0x5c'),_0x1c73('0x32'),{'module':_0x1c73('0x5d')});})[_0x1c73('0x28')](handleError(_0x144857,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 81e0d7e..887f53e 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 _0xd3bb=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts'];(function(_0x4880f7,_0x21c705){var _0x407020=function(_0x581b05){while(--_0x581b05){_0x4880f7['push'](_0x4880f7['shift']());}};_0x407020(++_0x21c705);}(_0xd3bb,0xb4));var _0xbd3b=function(_0xd8a7b1,_0x1ca01b){_0xd8a7b1=_0xd8a7b1-0x0;var _0x2669bb=_0xd3bb[_0xd8a7b1];return _0x2669bb;};'use strict';var _=require(_0xbd3b('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbd3b('0x1'));var moment=require(_0xbd3b('0x2'));var BPromise=require(_0xbd3b('0x3'));var rp=require(_0xbd3b('0x4'));var fs=require('fs');var path=require(_0xbd3b('0x5'));var rimraf=require(_0xbd3b('0x6'));var config=require(_0xbd3b('0x7'));var attributes=require(_0xbd3b('0x8'));module['exports']=function(_0x2e9920,_0x397d49){return _0x2e9920[_0xbd3b('0x9')](_0xbd3b('0xa'),attributes,{'tableName':_0xbd3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x847a=['util','../../config/logger','api','bluebird','request-promise','path','./voiceContext.attributes','exports','define','VoiceContext','voice_contexts','lodash'];(function(_0x7d62cb,_0x7622c){var _0x3a6266=function(_0x1cc5fa){while(--_0x1cc5fa){_0x7d62cb['push'](_0x7d62cb['shift']());}};_0x3a6266(++_0x7622c);}(_0x847a,0x143));var _0xa847=function(_0x37139f,_0x1fcebe){_0x37139f=_0x37139f-0x0;var _0x5390a8=_0x847a[_0x37139f];return _0x5390a8;};'use strict';var _=require(_0xa847('0x0'));var util=require(_0xa847('0x1'));var logger=require(_0xa847('0x2'))(_0xa847('0x3'));var moment=require('moment');var BPromise=require(_0xa847('0x4'));var rp=require(_0xa847('0x5'));var fs=require('fs');var path=require(_0xa847('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa847('0x7'));module[_0xa847('0x8')]=function(_0xa49f5d,_0x4b07e2){return _0xa49f5d[_0xa847('0x9')](_0xa847('0xa'),attributes,{'tableName':_0xa847('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.rpc.js b/server/api/voiceContext/voiceContext.rpc.js index 968ff87..6d2dda8 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 _0x9b42=['stringify','error','code','message','VoiceContext,\x20%s,\x20%s','result','catch','lodash','util','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','request','then','info','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0xc264bd,_0x34d680){var _0x28bcfa=function(_0x1a4ab0){while(--_0x1a4ab0){_0xc264bd['push'](_0xc264bd['shift']());}};_0x28bcfa(++_0x34d680);}(_0x9b42,0xee));var _0x29b4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9b42[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x29b4('0x0'));var util=require(_0x29b4('0x1'));var moment=require('moment');var BPromise=require(_0x29b4('0x2'));var rs=require(_0x29b4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x29b4('0x4'));var logger=require(_0x29b4('0x5'))(_0x29b4('0x6'));var config=require(_0x29b4('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x10643f,_0x3ccf54,_0x1a64ba){return new BPromise(function(_0x43b6f3,_0x52371b){return client[_0x29b4('0x8')](_0x10643f,_0x1a64ba)[_0x29b4('0x9')](function(_0x3b2279){logger[_0x29b4('0xa')]('VoiceContext,\x20%s,\x20%s',_0x3ccf54,_0x29b4('0xb'));logger[_0x29b4('0xc')](_0x29b4('0xd'),_0x3ccf54,_0x29b4('0xb'),JSON[_0x29b4('0xe')](_0x3b2279));if(_0x3b2279[_0x29b4('0xf')]){if(_0x3b2279['error'][_0x29b4('0x10')]===0x1f4){logger[_0x29b4('0xf')]('VoiceContext,\x20%s,\x20%s',_0x3ccf54,_0x3b2279[_0x29b4('0xf')]['message']);return _0x52371b(_0x3b2279[_0x29b4('0xf')][_0x29b4('0x11')]);}logger[_0x29b4('0xf')](_0x29b4('0x12'),_0x3ccf54,_0x3b2279[_0x29b4('0xf')][_0x29b4('0x11')]);return _0x43b6f3(_0x3b2279[_0x29b4('0xf')]['message']);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x3ccf54,_0x29b4('0xb'));_0x43b6f3(_0x3b2279[_0x29b4('0x13')]['message']);}})[_0x29b4('0x14')](function(_0x50dd1d){logger[_0x29b4('0xf')](_0x29b4('0x12'),_0x3ccf54,_0x50dd1d);_0x52371b(_0x50dd1d);});});} \ No newline at end of file +var _0x13ba=['stringify','error','VoiceContext,\x20%s,\x20%s','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s'];(function(_0x51b060,_0x4759e7){var _0x2aba89=function(_0x426fe8){while(--_0x426fe8){_0x51b060['push'](_0x51b060['shift']());}};_0x2aba89(++_0x4759e7);}(_0x13ba,0x1bf));var _0xa13b=function(_0x58fe86,_0x19655f){_0x58fe86=_0x58fe86-0x0;var _0x3f0732=_0x13ba[_0x58fe86];return _0x3f0732;};'use strict';var _=require(_0xa13b('0x0'));var util=require('util');var moment=require(_0xa13b('0x1'));var BPromise=require('bluebird');var rs=require(_0xa13b('0x2'));var fs=require('fs');var Redis=require(_0xa13b('0x3'));var db=require(_0xa13b('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa13b('0x5'))('rpc');var config=require(_0xa13b('0x6'));var jayson=require(_0xa13b('0x7'));var client=jayson['client'][_0xa13b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2165d7,_0x219d51,_0x87f00c){return new BPromise(function(_0x55869e,_0x52ec3c){return client['request'](_0x2165d7,_0x87f00c)[_0xa13b('0x9')](function(_0xbd0013){logger['info']('VoiceContext,\x20%s,\x20%s',_0x219d51,_0xa13b('0xa'));logger[_0xa13b('0xb')](_0xa13b('0xc'),_0x219d51,_0xa13b('0xa'),JSON[_0xa13b('0xd')](_0xbd0013));if(_0xbd0013['error']){if(_0xbd0013['error']['code']===0x1f4){logger[_0xa13b('0xe')](_0xa13b('0xf'),_0x219d51,_0xbd0013[_0xa13b('0xe')][_0xa13b('0x10')]);return _0x52ec3c(_0xbd0013[_0xa13b('0xe')][_0xa13b('0x10')]);}logger[_0xa13b('0xe')]('VoiceContext,\x20%s,\x20%s',_0x219d51,_0xbd0013[_0xa13b('0xe')][_0xa13b('0x10')]);return _0x55869e(_0xbd0013[_0xa13b('0xe')][_0xa13b('0x10')]);}else{logger[_0xa13b('0x11')]('VoiceContext,\x20%s,\x20%s',_0x219d51,'request\x20sent');_0x55869e(_0xbd0013[_0xa13b('0x12')][_0xa13b('0x10')]);}})[_0xa13b('0x13')](function(_0x1e41f2){logger['error']('VoiceContext,\x20%s,\x20%s',_0x219d51,_0x1e41f2);_0x52ec3c(_0x1e41f2);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index ba3f684..7c72222 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 _0xb0e3=['create','put','update','/:id','multer','path','connect-timeout','express','Router','./voiceDialReport.controller','get','isAuthenticated','/describe','describe','show'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0xb0e3,0x1e4));var _0x3b0e=function(_0x1ee10a,_0x5c3db6){_0x1ee10a=_0x1ee10a-0x0;var _0x1fbe3a=_0xb0e3[_0x1ee10a];return _0x1fbe3a;};'use strict';var multer=require(_0x3b0e('0x0'));var util=require('util');var path=require(_0x3b0e('0x1'));var timeout=require(_0x3b0e('0x2'));var express=require(_0x3b0e('0x3'));var router=express[_0x3b0e('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3b0e('0x5'));router[_0x3b0e('0x6')]('/',auth[_0x3b0e('0x7')](),controller['index']);router[_0x3b0e('0x6')](_0x3b0e('0x8'),auth[_0x3b0e('0x7')](),controller[_0x3b0e('0x9')]);router[_0x3b0e('0x6')]('/:id',auth[_0x3b0e('0x7')](),controller[_0x3b0e('0xa')]);router['post']('/',auth[_0x3b0e('0x7')](),controller[_0x3b0e('0xb')]);router[_0x3b0e('0xc')]('/:id',auth['isAuthenticated'](),controller[_0x3b0e('0xd')]);router['delete'](_0x3b0e('0xe'),auth[_0x3b0e('0x7')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2c05=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','index','get','/describe','describe','show','post','create','/:id','update','delete','destroy','multer','util','path'];(function(_0x2f1762,_0xab43df){var _0x8ab21=function(_0xf6c1f5){while(--_0xf6c1f5){_0x2f1762['push'](_0x2f1762['shift']());}};_0x8ab21(++_0xab43df);}(_0x2c05,0x123));var _0x52c0=function(_0x730613,_0x569cf7){_0x730613=_0x730613-0x0;var _0x4625b0=_0x2c05[_0x730613];return _0x4625b0;};'use strict';var multer=require(_0x52c0('0x0'));var util=require(_0x52c0('0x1'));var path=require(_0x52c0('0x2'));var timeout=require(_0x52c0('0x3'));var express=require('express');var router=express[_0x52c0('0x4')]();var auth=require(_0x52c0('0x5'));var interaction=require(_0x52c0('0x6'));var config=require(_0x52c0('0x7'));var controller=require(_0x52c0('0x8'));router['get']('/',auth[_0x52c0('0x9')](),controller[_0x52c0('0xa')]);router[_0x52c0('0xb')](_0x52c0('0xc'),auth['isAuthenticated'](),controller[_0x52c0('0xd')]);router[_0x52c0('0xb')]('/:id',auth[_0x52c0('0x9')](),controller[_0x52c0('0xe')]);router[_0x52c0('0xf')]('/',auth[_0x52c0('0x9')](),controller[_0x52c0('0x10')]);router['put'](_0x52c0('0x11'),auth[_0x52c0('0x9')](),controller[_0x52c0('0x12')]);router[_0x52c0('0x13')](_0x52c0('0x11'),auth[_0x52c0('0x9')](),controller[_0x52c0('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 21ec060..bfac7dc 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 _0x71fd=['DATE','called,connect,complete','sequelize','STRING','INTEGER'];(function(_0x59c1a8,_0x5cf02b){var _0x11d95a=function(_0x165232){while(--_0x165232){_0x59c1a8['push'](_0x59c1a8['shift']());}};_0x11d95a(++_0x5cf02b);}(_0x71fd,0x7f));var _0xd71f=function(_0x54a229,_0x479dd1){_0x54a229=_0x54a229-0x0;var _0x36232e=_0x71fd[_0x54a229];return _0x36232e;};'use strict';var Sequelize=require(_0xd71f('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xd71f('0x1')]},'channel':{'type':Sequelize[_0xd71f('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xd71f('0x1')]},'calleridnum':{'type':Sequelize[_0xd71f('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xd71f('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xd71f('0x1')]},'accountcode':{'type':Sequelize[_0xd71f('0x1')]},'context':{'type':Sequelize[_0xd71f('0x1')]},'exten':{'type':Sequelize[_0xd71f('0x1')]},'priority':{'type':Sequelize[_0xd71f('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xd71f('0x1')]},'destchannel':{'type':Sequelize[_0xd71f('0x1')]},'destchannelstate':{'type':Sequelize[_0xd71f('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xd71f('0x1')]},'destcalleridnum':{'type':Sequelize[_0xd71f('0x1')]},'destcalleridname':{'type':Sequelize[_0xd71f('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xd71f('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xd71f('0x1')]},'destlanguage':{'type':Sequelize[_0xd71f('0x1')]},'destaccountcode':{'type':Sequelize[_0xd71f('0x1')]},'destcontext':{'type':Sequelize[_0xd71f('0x1')]},'destexten':{'type':Sequelize[_0xd71f('0x1')]},'destpriority':{'type':Sequelize[_0xd71f('0x2')]},'destuniqueid':{'type':Sequelize[_0xd71f('0x1')]},'destlinkedid':{'type':Sequelize[_0xd71f('0x1')]},'dialstring':{'type':Sequelize[_0xd71f('0x1')]},'dialstatus':{'type':Sequelize[_0xd71f('0x1')]},'starttime':{'type':Sequelize[_0xd71f('0x3')]},'answertime':{'type':Sequelize[_0xd71f('0x3')]},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xd71f('0x1')],'comment':_0xd71f('0x4')},'routeId':{'type':Sequelize[_0xd71f('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0xd71f('0x2')]},'billableseconds':{'type':Sequelize[_0xd71f('0x2')]}}; \ No newline at end of file +var _0xa30a=['DATE','sequelize','STRING','INTEGER'];(function(_0x5580a6,_0x4b61bd){var _0xa0de3a=function(_0x54912f){while(--_0x54912f){_0x5580a6['push'](_0x5580a6['shift']());}};_0xa0de3a(++_0x4b61bd);}(_0xa30a,0x79));var _0xaa30=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa30a[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xaa30('0x0'));module['exports']={'privilege':{'type':Sequelize[_0xaa30('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xaa30('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xaa30('0x1')]},'connectedlinenum':{'type':Sequelize[_0xaa30('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0xaa30('0x1')]},'accountcode':{'type':Sequelize[_0xaa30('0x1')]},'context':{'type':Sequelize[_0xaa30('0x1')]},'exten':{'type':Sequelize[_0xaa30('0x1')]},'priority':{'type':Sequelize['INTEGER']},'uniqueid':{'type':Sequelize[_0xaa30('0x1')]},'linkedid':{'type':Sequelize[_0xaa30('0x1')]},'destchannel':{'type':Sequelize['STRING']},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xaa30('0x1')]},'destcalleridname':{'type':Sequelize[_0xaa30('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0xaa30('0x1')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0xaa30('0x1')]},'destaccountcode':{'type':Sequelize[_0xaa30('0x1')]},'destcontext':{'type':Sequelize[_0xaa30('0x1')]},'destexten':{'type':Sequelize[_0xaa30('0x1')]},'destpriority':{'type':Sequelize[_0xaa30('0x2')]},'destuniqueid':{'type':Sequelize[_0xaa30('0x1')]},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize['STRING']},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0xaa30('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0xaa30('0x1')],'comment':'called,connect,complete'},'routeId':{'type':Sequelize[_0xaa30('0x2')]},'duration':{'type':Sequelize[_0xaa30('0x2')]},'holdtime':{'type':Sequelize[_0xaa30('0x2')]},'billableseconds':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 38133ea..2450c53 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 _0xf934=['../../config/environment','../../mysqldb','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','filter','where','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils'];(function(_0x41eafb,_0x31ef14){var _0x314b13=function(_0x27b7b8){while(--_0x27b7b8){_0x41eafb['push'](_0x41eafb['shift']());}};_0x314b13(++_0x31ef14);}(_0xf934,0x1b1));var _0x4f93=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0xf934[_0x26462c];return _0x509a42;};'use strict';var pdf=require(_0x4f93('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x4f93('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x4f93('0x2'));var moment=require(_0x4f93('0x3'));var BPromise=require(_0x4f93('0x4'));var Mustache=require(_0x4f93('0x5'));var util=require(_0x4f93('0x6'));var path=require(_0x4f93('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4f93('0x8'));var fs=require('fs');var _=require(_0x4f93('0x9'));var squel=require(_0x4f93('0xa'));var crypto=require(_0x4f93('0xb'));var jsforce=require(_0x4f93('0xc'));var deskjs=require(_0x4f93('0xd'));var toCsv=require(_0x4f93('0xe'));var querystring=require(_0x4f93('0xf'));var Papa=require(_0x4f93('0x10'));var Redis=require(_0x4f93('0x11'));var authService=require(_0x4f93('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4f93('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f93('0x14'))(_0x4f93('0x15'));var utils=require(_0x4f93('0x16'));var config=require(_0x4f93('0x17'));var db=require(_0x4f93('0x18'))['db'];function respondWithStatusCode(_0x22bf38,_0x4c1cf1){_0x4c1cf1=_0x4c1cf1||0xcc;return function(_0x400971){if(_0x400971){return _0x22bf38[_0x4f93('0x19')](_0x4c1cf1);}return _0x22bf38['status'](_0x4c1cf1)[_0x4f93('0x1a')]();};}function respondWithResult(_0x285ac2,_0x5c8be4){_0x5c8be4=_0x5c8be4||0xc8;return function(_0x111ede){if(_0x111ede){return _0x285ac2[_0x4f93('0x1b')](_0x5c8be4)[_0x4f93('0x1c')](_0x111ede);}};}function respondWithFilteredResult(_0x8a405f,_0x3a9fc2){return function(_0x32d39b){if(_0x32d39b){var _0x5cfdd7=_0x32d39b['count'],_0x253fd4=_0x3a9fc2[_0x4f93('0x1d')],_0x23f738=_0x3a9fc2[_0x4f93('0x1d')]+_0x3a9fc2[_0x4f93('0x1e')],_0x3e58e2;if(_0x23f738>=_0x5cfdd7){_0x23f738=_0x5cfdd7;_0x3e58e2=0xc8;}else{_0x3e58e2=0xce;}_0x8a405f['status'](_0x3e58e2);return _0x8a405f[_0x4f93('0x1f')](_0x4f93('0x20'),_0x253fd4+'-'+_0x23f738+'/'+_0x5cfdd7)['json'](_0x32d39b);}return null;};}function patchUpdates(_0x196f5b){return function(_0x1bcb94){try{jsonpatch['apply'](_0x1bcb94,_0x196f5b,!![]);}catch(_0x173599){return BPromise[_0x4f93('0x21')](_0x173599);}return _0x1bcb94[_0x4f93('0x22')]();};}function saveUpdates(_0x3c6757,_0x45dfac){return function(_0x296628){if(_0x296628){return _0x296628[_0x4f93('0x23')](_0x3c6757)[_0x4f93('0x24')](function(_0x417681){return _0x417681;});}return null;};}function removeEntity(_0x524351,_0x4ad37f){return function(_0x5bfcd9){if(_0x5bfcd9){return _0x5bfcd9[_0x4f93('0x25')]()[_0x4f93('0x24')](function(){_0x524351[_0x4f93('0x1b')](0xcc)[_0x4f93('0x1a')]();});}};}function handleEntityNotFound(_0x4c05f6,_0x2f08b3){return function(_0x58e48c){if(!_0x58e48c){_0x4c05f6[_0x4f93('0x19')](0x194);}return _0x58e48c;};}function handleError(_0x48afd5,_0x49fd97){_0x49fd97=_0x49fd97||0x1f4;return function(_0x302b6b){logger[_0x4f93('0x26')](_0x302b6b['stack']);if(_0x302b6b[_0x4f93('0x27')]){delete _0x302b6b[_0x4f93('0x27')];}_0x48afd5[_0x4f93('0x1b')](_0x49fd97)[_0x4f93('0x28')](_0x302b6b);};}exports[_0x4f93('0x29')]=function(_0x4b15ec,_0x42b600){var _0x3e9d3e={},_0x26ef2f={},_0xd8b127={'count':0x0,'rows':[]};var _0x1dc705=_[_0x4f93('0x2a')](db[_0x4f93('0x2b')][_0x4f93('0x2c')],function(_0x3fb0d8){return{'name':_0x3fb0d8[_0x4f93('0x2d')],'type':_0x3fb0d8[_0x4f93('0x2e')][_0x4f93('0x2f')]};});_0x26ef2f[_0x4f93('0x30')]=_[_0x4f93('0x2a')](_0x1dc705,_0x4f93('0x27'));_0x26ef2f['query']=_[_0x4f93('0x31')](_0x4b15ec[_0x4f93('0x32')]);_0x26ef2f[_0x4f93('0x33')]=_[_0x4f93('0x34')](_0x26ef2f['model'],_0x26ef2f[_0x4f93('0x32')]);_0x3e9d3e[_0x4f93('0x35')]=_[_0x4f93('0x34')](_0x26ef2f['model'],qs['fields'](_0x4b15ec[_0x4f93('0x32')][_0x4f93('0x36')]));_0x3e9d3e[_0x4f93('0x35')]=_0x3e9d3e[_0x4f93('0x35')][_0x4f93('0x37')]?_0x3e9d3e[_0x4f93('0x35')]:_0x26ef2f[_0x4f93('0x30')];if(!_0x4b15ec[_0x4f93('0x32')]['hasOwnProperty'](_0x4f93('0x38'))){_0x3e9d3e['limit']=qs['limit'](_0x4b15ec[_0x4f93('0x32')]['limit']);_0x3e9d3e[_0x4f93('0x1d')]=qs[_0x4f93('0x1d')](_0x4b15ec[_0x4f93('0x32')][_0x4f93('0x1d')]);}_0x3e9d3e[_0x4f93('0x39')]=qs[_0x4f93('0x3a')](_0x4b15ec[_0x4f93('0x32')][_0x4f93('0x3a')]);_0x3e9d3e['where']=qs['filters'](_['pick'](_0x4b15ec[_0x4f93('0x32')],_0x26ef2f[_0x4f93('0x33')]));if(_0x4b15ec['query'][_0x4f93('0x3b')]){_0x3e9d3e[_0x4f93('0x3c')]=_[_0x4f93('0x3d')](_0x3e9d3e[_0x4f93('0x3c')],{'$or':_[_0x4f93('0x2a')](_0x1dc705,function(_0x867e44){if(_0x867e44['type']!==_0x4f93('0x3e')){var _0x275390={};_0x275390[_0x867e44[_0x4f93('0x27')]]={'$like':'%'+_0x4b15ec[_0x4f93('0x32')]['filter']+'%'};return _0x275390;}})});}_0x3e9d3e=_['merge']({},_0x3e9d3e,_0x4b15ec[_0x4f93('0x3f')]);var _0x43e137={'where':_0x3e9d3e[_0x4f93('0x3c')]};return db[_0x4f93('0x2b')][_0x4f93('0x40')](_0x43e137)[_0x4f93('0x24')](function(_0x451165){_0xd8b127[_0x4f93('0x40')]=_0x451165;if(_0x4b15ec[_0x4f93('0x32')]['includeAll']){_0x3e9d3e[_0x4f93('0x41')]=[{'all':!![]}];}return db[_0x4f93('0x2b')][_0x4f93('0x42')](_0x3e9d3e);})[_0x4f93('0x24')](function(_0x3b5f5f){_0xd8b127[_0x4f93('0x43')]=_0x3b5f5f;return _0xd8b127;})['then'](respondWithFilteredResult(_0x42b600,_0x3e9d3e))[_0x4f93('0x44')](handleError(_0x42b600,null));};exports[_0x4f93('0x45')]=function(_0x59d43a,_0x52befe){var _0x1bb9d2={'raw':!![],'where':{'id':_0x59d43a[_0x4f93('0x46')]['id']}},_0x5331a2={};_0x5331a2[_0x4f93('0x30')]=_[_0x4f93('0x31')](db['VoiceDialReport'][_0x4f93('0x2c')]);_0x5331a2['query']=_[_0x4f93('0x31')](_0x59d43a['query']);_0x5331a2[_0x4f93('0x33')]=_['intersection'](_0x5331a2[_0x4f93('0x30')],_0x5331a2[_0x4f93('0x32')]);_0x1bb9d2[_0x4f93('0x35')]=_[_0x4f93('0x34')](_0x5331a2[_0x4f93('0x30')],qs[_0x4f93('0x36')](_0x59d43a['query'][_0x4f93('0x36')]));_0x1bb9d2[_0x4f93('0x35')]=_0x1bb9d2[_0x4f93('0x35')][_0x4f93('0x37')]?_0x1bb9d2[_0x4f93('0x35')]:_0x5331a2['model'];if(_0x59d43a[_0x4f93('0x32')][_0x4f93('0x47')]){_0x1bb9d2[_0x4f93('0x41')]=[{'all':!![]}];}_0x1bb9d2=_[_0x4f93('0x3d')]({},_0x1bb9d2,_0x59d43a[_0x4f93('0x3f')]);return db['VoiceDialReport'][_0x4f93('0x48')](_0x1bb9d2)['then'](handleEntityNotFound(_0x52befe,null))[_0x4f93('0x24')](respondWithResult(_0x52befe,null))[_0x4f93('0x44')](handleError(_0x52befe,null));};exports[_0x4f93('0x49')]=function(_0x458f3a,_0x369748){return db[_0x4f93('0x2b')][_0x4f93('0x49')](_0x458f3a[_0x4f93('0x4a')],{})[_0x4f93('0x24')](respondWithResult(_0x369748,0xc9))['catch'](handleError(_0x369748,null));};exports['update']=function(_0x190555,_0x46f38c){if(_0x190555['body']['id']){delete _0x190555['body']['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x190555[_0x4f93('0x46')]['id']}})[_0x4f93('0x24')](handleEntityNotFound(_0x46f38c,null))[_0x4f93('0x24')](saveUpdates(_0x190555[_0x4f93('0x4a')],null))['then'](respondWithResult(_0x46f38c,null))[_0x4f93('0x44')](handleError(_0x46f38c,null));};exports[_0x4f93('0x25')]=function(_0x22d42e,_0x2cc557){return db[_0x4f93('0x2b')][_0x4f93('0x48')]({'where':{'id':_0x22d42e[_0x4f93('0x46')]['id']}})[_0x4f93('0x24')](handleEntityNotFound(_0x2cc557,null))[_0x4f93('0x24')](removeEntity(_0x2cc557,null))[_0x4f93('0x44')](handleError(_0x2cc557,null));};exports[_0x4f93('0x4b')]=function(_0x6f2101,_0x323f33){return db['VoiceDialReport']['describe']()[_0x4f93('0x24')](respondWithResult(_0x323f33,null))[_0x4f93('0x44')](handleError(_0x323f33,null));}; \ No newline at end of file +var _0x34b5=['filters','intersection','attributes','hasOwnProperty','sort','where','pick','filter','merge','type','options','VoiceDialReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','length','find','create','body','eml-format','rimraf','fast-json-patch','moment','bluebird','util','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','fieldName','key','model','query','keys'];(function(_0x16ff13,_0x574da6){var _0x167afd=function(_0x183173){while(--_0x183173){_0x16ff13['push'](_0x16ff13['shift']());}};_0x167afd(++_0x574da6);}(_0x34b5,0x1bd));var _0x534b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x34b5[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x534b('0x0'));var rimraf=require(_0x534b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x534b('0x2'));var rp=require('request-promise');var moment=require(_0x534b('0x3'));var BPromise=require(_0x534b('0x4'));var Mustache=require('mustache');var util=require(_0x534b('0x5'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x534b('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x534b('0x7'));var crypto=require(_0x534b('0x8'));var jsforce=require(_0x534b('0x9'));var deskjs=require(_0x534b('0xa'));var toCsv=require('to-csv');var querystring=require(_0x534b('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x534b('0xc'));var qs=require('../../components/parsers/qs');var as=require(_0x534b('0xd'));var hardwareService=require(_0x534b('0xe'));var logger=require(_0x534b('0xf'))(_0x534b('0x10'));var utils=require(_0x534b('0x11'));var config=require(_0x534b('0x12'));var db=require(_0x534b('0x13'))['db'];function respondWithStatusCode(_0x5122c1,_0x4cd5f1){_0x4cd5f1=_0x4cd5f1||0xcc;return function(_0x90af6d){if(_0x90af6d){return _0x5122c1['sendStatus'](_0x4cd5f1);}return _0x5122c1[_0x534b('0x14')](_0x4cd5f1)[_0x534b('0x15')]();};}function respondWithResult(_0x372c8a,_0x325c45){_0x325c45=_0x325c45||0xc8;return function(_0xaee1b7){if(_0xaee1b7){return _0x372c8a[_0x534b('0x14')](_0x325c45)[_0x534b('0x16')](_0xaee1b7);}};}function respondWithFilteredResult(_0x34b1d5,_0x587a3a){return function(_0x3bb701){if(_0x3bb701){var _0x372d01=_0x3bb701[_0x534b('0x17')],_0x2b5ab5=_0x587a3a[_0x534b('0x18')],_0x41a1a7=_0x587a3a[_0x534b('0x18')]+_0x587a3a[_0x534b('0x19')],_0x23a286;if(_0x41a1a7>=_0x372d01){_0x41a1a7=_0x372d01;_0x23a286=0xc8;}else{_0x23a286=0xce;}_0x34b1d5['status'](_0x23a286);return _0x34b1d5[_0x534b('0x1a')](_0x534b('0x1b'),_0x2b5ab5+'-'+_0x41a1a7+'/'+_0x372d01)[_0x534b('0x16')](_0x3bb701);}return null;};}function patchUpdates(_0x3d615d){return function(_0x654f10){try{jsonpatch[_0x534b('0x1c')](_0x654f10,_0x3d615d,!![]);}catch(_0x468374){return BPromise[_0x534b('0x1d')](_0x468374);}return _0x654f10[_0x534b('0x1e')]();};}function saveUpdates(_0x3180ac,_0x2b01fd){return function(_0x4da61b){if(_0x4da61b){return _0x4da61b[_0x534b('0x1f')](_0x3180ac)[_0x534b('0x20')](function(_0x9ea5af){return _0x9ea5af;});}return null;};}function removeEntity(_0x3ed9a1,_0x3e8e9c){return function(_0x1c9ea9){if(_0x1c9ea9){return _0x1c9ea9[_0x534b('0x21')]()[_0x534b('0x20')](function(){_0x3ed9a1['status'](0xcc)[_0x534b('0x15')]();});}};}function handleEntityNotFound(_0x4c51b4,_0x175e92){return function(_0x57dd02){if(!_0x57dd02){_0x4c51b4['sendStatus'](0x194);}return _0x57dd02;};}function handleError(_0x48c18d,_0x4ebe39){_0x4ebe39=_0x4ebe39||0x1f4;return function(_0x2e640a){logger[_0x534b('0x22')](_0x2e640a[_0x534b('0x23')]);if(_0x2e640a[_0x534b('0x24')]){delete _0x2e640a[_0x534b('0x24')];}_0x48c18d[_0x534b('0x14')](_0x4ebe39)[_0x534b('0x25')](_0x2e640a);};}exports[_0x534b('0x26')]=function(_0x5cc1ab,_0x49d6f3){var _0x1608fa={},_0x3aa05b={},_0xa41d9f={'count':0x0,'rows':[]};var _0x261b2f=_[_0x534b('0x27')](db['VoiceDialReport']['rawAttributes'],function(_0x40c37f){return{'name':_0x40c37f[_0x534b('0x28')],'type':_0x40c37f['type'][_0x534b('0x29')]};});_0x3aa05b[_0x534b('0x2a')]=_[_0x534b('0x27')](_0x261b2f,_0x534b('0x24'));_0x3aa05b[_0x534b('0x2b')]=_[_0x534b('0x2c')](_0x5cc1ab[_0x534b('0x2b')]);_0x3aa05b[_0x534b('0x2d')]=_[_0x534b('0x2e')](_0x3aa05b[_0x534b('0x2a')],_0x3aa05b[_0x534b('0x2b')]);_0x1608fa['attributes']=_[_0x534b('0x2e')](_0x3aa05b[_0x534b('0x2a')],qs['fields'](_0x5cc1ab[_0x534b('0x2b')]['fields']));_0x1608fa['attributes']=_0x1608fa['attributes']['length']?_0x1608fa[_0x534b('0x2f')]:_0x3aa05b[_0x534b('0x2a')];if(!_0x5cc1ab[_0x534b('0x2b')][_0x534b('0x30')]('nolimit')){_0x1608fa[_0x534b('0x19')]=qs[_0x534b('0x19')](_0x5cc1ab[_0x534b('0x2b')][_0x534b('0x19')]);_0x1608fa[_0x534b('0x18')]=qs['offset'](_0x5cc1ab[_0x534b('0x2b')][_0x534b('0x18')]);}_0x1608fa['order']=qs['sort'](_0x5cc1ab['query'][_0x534b('0x31')]);_0x1608fa[_0x534b('0x32')]=qs['filters'](_[_0x534b('0x33')](_0x5cc1ab[_0x534b('0x2b')],_0x3aa05b[_0x534b('0x2d')]));if(_0x5cc1ab['query'][_0x534b('0x34')]){_0x1608fa['where']=_[_0x534b('0x35')](_0x1608fa[_0x534b('0x32')],{'$or':_[_0x534b('0x27')](_0x261b2f,function(_0x4f9358){if(_0x4f9358[_0x534b('0x36')]!=='VIRTUAL'){var _0x1f9c7a={};_0x1f9c7a[_0x4f9358[_0x534b('0x24')]]={'$like':'%'+_0x5cc1ab['query'][_0x534b('0x34')]+'%'};return _0x1f9c7a;}})});}_0x1608fa=_[_0x534b('0x35')]({},_0x1608fa,_0x5cc1ab[_0x534b('0x37')]);var _0x3ed36c={'where':_0x1608fa[_0x534b('0x32')]};return db[_0x534b('0x38')][_0x534b('0x17')](_0x3ed36c)[_0x534b('0x20')](function(_0x16460f){_0xa41d9f[_0x534b('0x17')]=_0x16460f;if(_0x5cc1ab[_0x534b('0x2b')][_0x534b('0x39')]){_0x1608fa[_0x534b('0x3a')]=[{'all':!![]}];}return db['VoiceDialReport'][_0x534b('0x3b')](_0x1608fa);})[_0x534b('0x20')](function(_0x3c2356){_0xa41d9f[_0x534b('0x3c')]=_0x3c2356;return _0xa41d9f;})['then'](respondWithFilteredResult(_0x49d6f3,_0x1608fa))[_0x534b('0x3d')](handleError(_0x49d6f3,null));};exports[_0x534b('0x3e')]=function(_0x1c39bc,_0x27637d){var _0x93c793={'raw':!![],'where':{'id':_0x1c39bc[_0x534b('0x3f')]['id']}},_0x35bbff={};_0x35bbff[_0x534b('0x2a')]=_['keys'](db[_0x534b('0x38')][_0x534b('0x40')]);_0x35bbff[_0x534b('0x2b')]=_['keys'](_0x1c39bc['query']);_0x35bbff[_0x534b('0x2d')]=_[_0x534b('0x2e')](_0x35bbff[_0x534b('0x2a')],_0x35bbff[_0x534b('0x2b')]);_0x93c793[_0x534b('0x2f')]=_['intersection'](_0x35bbff[_0x534b('0x2a')],qs['fields'](_0x1c39bc[_0x534b('0x2b')][_0x534b('0x41')]));_0x93c793[_0x534b('0x2f')]=_0x93c793[_0x534b('0x2f')][_0x534b('0x42')]?_0x93c793[_0x534b('0x2f')]:_0x35bbff[_0x534b('0x2a')];if(_0x1c39bc[_0x534b('0x2b')][_0x534b('0x39')]){_0x93c793[_0x534b('0x3a')]=[{'all':!![]}];}_0x93c793=_[_0x534b('0x35')]({},_0x93c793,_0x1c39bc[_0x534b('0x37')]);return db[_0x534b('0x38')][_0x534b('0x43')](_0x93c793)[_0x534b('0x20')](handleEntityNotFound(_0x27637d,null))[_0x534b('0x20')](respondWithResult(_0x27637d,null))[_0x534b('0x3d')](handleError(_0x27637d,null));};exports[_0x534b('0x44')]=function(_0x49c4ec,_0x11a282){return db[_0x534b('0x38')][_0x534b('0x44')](_0x49c4ec[_0x534b('0x45')],{})[_0x534b('0x20')](respondWithResult(_0x11a282,0xc9))['catch'](handleError(_0x11a282,null));};exports[_0x534b('0x1f')]=function(_0x1b1b13,_0xc7c302){if(_0x1b1b13['body']['id']){delete _0x1b1b13[_0x534b('0x45')]['id'];}return db[_0x534b('0x38')]['find']({'where':{'id':_0x1b1b13[_0x534b('0x3f')]['id']}})[_0x534b('0x20')](handleEntityNotFound(_0xc7c302,null))[_0x534b('0x20')](saveUpdates(_0x1b1b13[_0x534b('0x45')],null))[_0x534b('0x20')](respondWithResult(_0xc7c302,null))[_0x534b('0x3d')](handleError(_0xc7c302,null));};exports['destroy']=function(_0x4a5910,_0x5d2838){return db[_0x534b('0x38')]['find']({'where':{'id':_0x4a5910[_0x534b('0x3f')]['id']}})[_0x534b('0x20')](handleEntityNotFound(_0x5d2838,null))[_0x534b('0x20')](removeEntity(_0x5d2838,null))['catch'](handleError(_0x5d2838,null));};exports['describe']=function(_0x25efb9,_0x3e3b2d){return db[_0x534b('0x38')]['describe']()[_0x534b('0x20')](respondWithResult(_0x3e3b2d,null))[_0x534b('0x3d')](handleError(_0x3e3b2d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index ca2fd7f..3fab435 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 _0x6244=['rimraf','../../config/environment','./voiceDialReport.attributes','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','api','bluebird'];(function(_0x367d4a,_0xd38461){var _0x27519f=function(_0x7f4623){while(--_0x7f4623){_0x367d4a['push'](_0x367d4a['shift']());}};_0x27519f(++_0xd38461);}(_0x6244,0x1e7));var _0x4624=function(_0x12c462,_0x397b21){_0x12c462=_0x12c462-0x0;var _0x510bc2=_0x6244[_0x12c462];return _0x510bc2;};'use strict';var _=require(_0x4624('0x0'));var util=require(_0x4624('0x1'));var logger=require(_0x4624('0x2'))(_0x4624('0x3'));var moment=require('moment');var BPromise=require(_0x4624('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4624('0x5'));var config=require(_0x4624('0x6'));var attributes=require(_0x4624('0x7'));module[_0x4624('0x8')]=function(_0xfd2886,_0x33bf18){return _0xfd2886[_0x4624('0x9')]('VoiceDialReport',attributes,{'tableName':_0x4624('0xa'),'paranoid':![],'indexes':[{'fields':[_0x4624('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd34e=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','report_dial','uniqueid'];(function(_0x2e5636,_0x2b9540){var _0x4d7371=function(_0x28e14c){while(--_0x28e14c){_0x2e5636['push'](_0x2e5636['shift']());}};_0x4d7371(++_0x2b9540);}(_0xd34e,0x8f));var _0xed34=function(_0x1d3060,_0xa4717e){_0x1d3060=_0x1d3060-0x0;var _0x197a25=_0xd34e[_0x1d3060];return _0x197a25;};'use strict';var _=require(_0xed34('0x0'));var util=require(_0xed34('0x1'));var logger=require(_0xed34('0x2'))('api');var moment=require(_0xed34('0x3'));var BPromise=require(_0xed34('0x4'));var rp=require(_0xed34('0x5'));var fs=require('fs');var path=require(_0xed34('0x6'));var rimraf=require('rimraf');var config=require(_0xed34('0x7'));var attributes=require('./voiceDialReport.attributes');module[_0xed34('0x8')]=function(_0x4916e5,_0x15ab83){return _0x4916e5['define']('VoiceDialReport',attributes,{'tableName':_0xed34('0x9'),'paranoid':![],'indexes':[{'fields':[_0xed34('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 956b082..71e6be3 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 _0x0fec=['create','body','options','raw','UpdateVoiceDialReport','where','attributes','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','VoiceDialReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport'];(function(_0x5e9888,_0x3abe60){var _0x2c8a6c=function(_0x19d6ca){while(--_0x19d6ca){_0x5e9888['push'](_0x5e9888['shift']());}};_0x2c8a6c(++_0x3abe60);}(_0x0fec,0x1ca));var _0xc0fe=function(_0x33f602,_0x3860c5){_0x33f602=_0x33f602-0x0;var _0x508ca5=_0x0fec[_0x33f602];return _0x508ca5;};'use strict';var _=require(_0xc0fe('0x0'));var util=require(_0xc0fe('0x1'));var moment=require(_0xc0fe('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc0fe('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc0fe('0x4'));var logger=require(_0xc0fe('0x5'))('rpc');var config=require(_0xc0fe('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xc0fe('0x7')][_0xc0fe('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4cc359,_0x53e410,_0x5b3f5a){return new BPromise(function(_0x326ab7,_0x2cd914){return client[_0xc0fe('0x9')](_0x4cc359,_0x5b3f5a)['then'](function(_0x5e33c4){logger['info'](_0xc0fe('0xa'),_0x53e410,'request\x20sent');logger[_0xc0fe('0xb')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x53e410,_0xc0fe('0xc'),JSON[_0xc0fe('0xd')](_0x5e33c4));if(_0x5e33c4[_0xc0fe('0xe')]){if(_0x5e33c4[_0xc0fe('0xe')][_0xc0fe('0xf')]===0x1f4){logger[_0xc0fe('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x53e410,_0x5e33c4[_0xc0fe('0xe')][_0xc0fe('0x10')]);return _0x2cd914(_0x5e33c4['error']['message']);}logger['error'](_0xc0fe('0xa'),_0x53e410,_0x5e33c4[_0xc0fe('0xe')][_0xc0fe('0x10')]);return _0x326ab7(_0x5e33c4['error'][_0xc0fe('0x10')]);}else{logger[_0xc0fe('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x53e410,'request\x20sent');_0x326ab7(_0x5e33c4[_0xc0fe('0x12')][_0xc0fe('0x10')]);}})[_0xc0fe('0x13')](function(_0x1dd571){logger[_0xc0fe('0xe')](_0xc0fe('0xa'),_0x53e410,_0x1dd571);_0x2cd914(_0x1dd571);});});}exports[_0xc0fe('0x14')]=function(_0x15fe4b){var _0x4d1dd3=this;return new Promise(function(_0x42b841,_0x2e52aa){return db[_0xc0fe('0x15')][_0xc0fe('0x16')](_0x15fe4b[_0xc0fe('0x17')],{'raw':_0x15fe4b[_0xc0fe('0x18')]?_0x15fe4b[_0xc0fe('0x18')][_0xc0fe('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3cdd16){logger[_0xc0fe('0x11')](_0xc0fe('0x14'),_0x15fe4b);logger[_0xc0fe('0xb')](_0xc0fe('0x14'),_0x15fe4b,JSON[_0xc0fe('0xd')](_0x3cdd16));_0x42b841(_0x3cdd16);})[_0xc0fe('0x13')](function(_0x13a20f){logger[_0xc0fe('0xe')]('CreateVoiceDialReport',_0x13a20f['message'],_0x15fe4b);_0x2e52aa(_0x4d1dd3[_0xc0fe('0xe')](0x1f4,_0x13a20f[_0xc0fe('0x10')]));});});};exports[_0xc0fe('0x1a')]=function(_0x525f91){var _0x2723f8=this;return new Promise(function(_0x543f55,_0x29b349){return db[_0xc0fe('0x15')]['update'](_0x525f91[_0xc0fe('0x17')],{'raw':_0x525f91['options']?_0x525f91[_0xc0fe('0x18')][_0xc0fe('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x525f91[_0xc0fe('0x18')]?_0x525f91['options'][_0xc0fe('0x1b')]||null:null,'attributes':_0x525f91['options']?_0x525f91[_0xc0fe('0x18')][_0xc0fe('0x1c')]||null:null,'limit':_0x525f91[_0xc0fe('0x18')]?_0x525f91[_0xc0fe('0x18')]['limit']||null:null})[_0xc0fe('0x1d')](function(_0x406f25){logger[_0xc0fe('0x11')]('UpdateVoiceDialReport',_0x525f91);logger['debug']('UpdateVoiceDialReport',_0x525f91,JSON[_0xc0fe('0xd')](_0x406f25));_0x543f55(_0x406f25);})['catch'](function(_0x3dc35a){logger[_0xc0fe('0xe')]('UpdateVoiceDialReport',_0x3dc35a[_0xc0fe('0x10')],_0x525f91);_0x29b349(_0x2723f8['error'](0x1f4,_0x3dc35a[_0xc0fe('0x10')]));});});}; \ No newline at end of file +var _0x3b75=['error','code','message','result','catch','VoiceDialReport','create','body','options','raw','CreateVoiceDialReport','UpdateVoiceDialReport','update','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x5d6a1d,_0x198f84){var _0x177313=function(_0xbfa45b){while(--_0xbfa45b){_0x5d6a1d['push'](_0x5d6a1d['shift']());}};_0x177313(++_0x198f84);}(_0x3b75,0xdc));var _0x53b7=function(_0x1fa759,_0x4ecdce){_0x1fa759=_0x1fa759-0x0;var _0x2da9f4=_0x3b75[_0x1fa759];return _0x2da9f4;};'use strict';var _=require(_0x53b7('0x0'));var util=require(_0x53b7('0x1'));var moment=require(_0x53b7('0x2'));var BPromise=require(_0x53b7('0x3'));var rs=require(_0x53b7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x53b7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x53b7('0x6'))('rpc');var config=require(_0x53b7('0x7'));var jayson=require(_0x53b7('0x8'));var client=jayson[_0x53b7('0x9')][_0x53b7('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x7e5139,_0x5ee630,_0x1f89b7){return new BPromise(function(_0x233482,_0x4275fe){return client['request'](_0x7e5139,_0x1f89b7)[_0x53b7('0xb')](function(_0x4b7c51){logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,_0x53b7('0xe'));logger[_0x53b7('0xf')](_0x53b7('0x10'),_0x5ee630,'request\x20sent',JSON[_0x53b7('0x11')](_0x4b7c51));if(_0x4b7c51[_0x53b7('0x12')]){if(_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x13')]===0x1f4){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51[_0x53b7('0x12')][_0x53b7('0x14')]);return _0x4275fe(_0x4b7c51[_0x53b7('0x12')]['message']);}logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0x4b7c51['error']['message']);return _0x233482(_0x4b7c51['error'][_0x53b7('0x14')]);}else{logger[_0x53b7('0xc')](_0x53b7('0xd'),_0x5ee630,'request\x20sent');_0x233482(_0x4b7c51[_0x53b7('0x15')][_0x53b7('0x14')]);}})[_0x53b7('0x16')](function(_0xe4cb1){logger[_0x53b7('0x12')](_0x53b7('0xd'),_0x5ee630,_0xe4cb1);_0x4275fe(_0xe4cb1);});});}exports['CreateVoiceDialReport']=function(_0x4eaf6a){var _0x19b100=this;return new Promise(function(_0x45b608,_0x3a049f){return db[_0x53b7('0x17')][_0x53b7('0x18')](_0x4eaf6a[_0x53b7('0x19')],{'raw':_0x4eaf6a[_0x53b7('0x1a')]?_0x4eaf6a[_0x53b7('0x1a')][_0x53b7('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x3b8187){logger[_0x53b7('0xc')](_0x53b7('0x1c'),_0x4eaf6a);logger[_0x53b7('0xf')](_0x53b7('0x1c'),_0x4eaf6a,JSON[_0x53b7('0x11')](_0x3b8187));_0x45b608(_0x3b8187);})[_0x53b7('0x16')](function(_0x237dc9){logger[_0x53b7('0x12')](_0x53b7('0x1c'),_0x237dc9[_0x53b7('0x14')],_0x4eaf6a);_0x3a049f(_0x19b100[_0x53b7('0x12')](0x1f4,_0x237dc9['message']));});});};exports[_0x53b7('0x1d')]=function(_0x54dc05){var _0x41b3a9=this;return new Promise(function(_0x18a2e4,_0x51ff47){return db['VoiceDialReport'][_0x53b7('0x1e')](_0x54dc05[_0x53b7('0x19')],{'raw':_0x54dc05[_0x53b7('0x1a')]?_0x54dc05[_0x53b7('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x54dc05[_0x53b7('0x1a')]?_0x54dc05[_0x53b7('0x1a')][_0x53b7('0x1f')]||null:null,'attributes':_0x54dc05[_0x53b7('0x1a')]?_0x54dc05[_0x53b7('0x1a')][_0x53b7('0x20')]||null:null,'limit':_0x54dc05['options']?_0x54dc05[_0x53b7('0x1a')][_0x53b7('0x21')]||null:null})[_0x53b7('0xb')](function(_0x16cd5c){logger[_0x53b7('0xc')](_0x53b7('0x1d'),_0x54dc05);logger[_0x53b7('0xf')](_0x53b7('0x1d'),_0x54dc05,JSON[_0x53b7('0x11')](_0x16cd5c));_0x18a2e4(_0x16cd5c);})[_0x53b7('0x16')](function(_0x1a6490){logger[_0x53b7('0x12')](_0x53b7('0x1d'),_0x1a6490[_0x53b7('0x14')],_0x54dc05);_0x51ff47(_0x41b3a9['error'](0x1f4,_0x1a6490[_0x53b7('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index bbb27f5..f1924fa 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 _0xdbdf=['util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','index','/:id','show','post','isAuthenticated','create','/:id/applications','addApplications','update','delete','destroy','exports','multer'];(function(_0x48fc89,_0x2541db){var _0x500b8b=function(_0x4d310a){while(--_0x4d310a){_0x48fc89['push'](_0x48fc89['shift']());}};_0x500b8b(++_0x2541db);}(_0xdbdf,0xf1));var _0xfdbd=function(_0xe540c0,_0x2d98e5){_0xe540c0=_0xe540c0-0x0;var _0x130549=_0xdbdf[_0xe540c0];return _0x130549;};'use strict';var multer=require(_0xfdbd('0x0'));var util=require(_0xfdbd('0x1'));var path=require('path');var timeout=require(_0xfdbd('0x2'));var express=require(_0xfdbd('0x3'));var router=express[_0xfdbd('0x4')]();var auth=require(_0xfdbd('0x5'));var interaction=require(_0xfdbd('0x6'));var config=require(_0xfdbd('0x7'));var controller=require(_0xfdbd('0x8'));router[_0xfdbd('0x9')]('/',auth['isAuthenticated'](),controller[_0xfdbd('0xa')]);router[_0xfdbd('0x9')](_0xfdbd('0xb'),auth['isAuthenticated'](),controller[_0xfdbd('0xc')]);router[_0xfdbd('0xd')]('/',auth[_0xfdbd('0xe')](),controller[_0xfdbd('0xf')]);router[_0xfdbd('0xd')](_0xfdbd('0x10'),auth[_0xfdbd('0xe')](),controller[_0xfdbd('0x11')]);router['put'](_0xfdbd('0xb'),auth['isAuthenticated'](),controller[_0xfdbd('0x12')]);router[_0xfdbd('0x13')]('/:id',auth[_0xfdbd('0xe')](),controller[_0xfdbd('0x14')]);module[_0xfdbd('0x15')]=router; \ No newline at end of file +var _0xbb25=['exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','create','post','/:id/applications','addApplications','put','update','destroy'];(function(_0x8eef2d,_0x542d7b){var _0x55c3a9=function(_0x559ec0){while(--_0x559ec0){_0x8eef2d['push'](_0x8eef2d['shift']());}};_0x55c3a9(++_0x542d7b);}(_0xbb25,0xf1));var _0x5bb2=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb25[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x5bb2('0x0'));var path=require('path');var timeout=require(_0x5bb2('0x1'));var express=require(_0x5bb2('0x2'));var router=express[_0x5bb2('0x3')]();var auth=require(_0x5bb2('0x4'));var interaction=require(_0x5bb2('0x5'));var config=require(_0x5bb2('0x6'));var controller=require(_0x5bb2('0x7'));router[_0x5bb2('0x8')]('/',auth[_0x5bb2('0x9')](),controller[_0x5bb2('0xa')]);router[_0x5bb2('0x8')](_0x5bb2('0xb'),auth[_0x5bb2('0x9')](),controller['show']);router['post']('/',auth[_0x5bb2('0x9')](),controller[_0x5bb2('0xc')]);router[_0x5bb2('0xd')](_0x5bb2('0xe'),auth[_0x5bb2('0x9')](),controller[_0x5bb2('0xf')]);router[_0x5bb2('0x10')](_0x5bb2('0xb'),auth[_0x5bb2('0x9')](),controller[_0x5bb2('0x11')]);router['delete'](_0x5bb2('0xb'),auth[_0x5bb2('0x9')](),controller[_0x5bb2('0x12')]);module[_0x5bb2('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 7890d72..7bbb6aa 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(_0x277a8a,_0x16cf01){var _0x531463=function(_0xa1bfac){while(--_0xa1bfac){_0x277a8a['push'](_0x277a8a['shift']());}};_0x531463(++_0x16cf01);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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(_0x15bbf8,_0x204441){var _0x4cbe4d=function(_0x2e1a57){while(--_0x2e1a57){_0x15bbf8['push'](_0x15bbf8['shift']());}};_0x4cbe4d(++_0x204441);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'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 1c12155..527ebf1 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 _0x9e05=['redis','localhost','socket.io-emitter','./voiceExtension.socket','register','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','ignore','map','value','includes','type','name','UserProfileResource','error','index','VoiceExtension','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','includeAll','find','params','startsWith','exten','concat','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','description','recordingFormat','mandatoryDisposition','context','addApplications','findOne','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x4e7c1c,_0x56eafd){var _0x47adb2=function(_0x346135){while(--_0x346135){_0x4e7c1c['push'](_0x4e7c1c['shift']());}};_0x47adb2(++_0x56eafd);}(_0x9e05,0x123));var _0x59e0=function(_0x26564a,_0x1371de){_0x26564a=_0x26564a-0x0;var _0x52c620=_0x9e05[_0x26564a];return _0x52c620;};'use strict';var pdf=require(_0x59e0('0x0'));var emlformat=require(_0x59e0('0x1'));var rimraf=require(_0x59e0('0x2'));var zipdir=require(_0x59e0('0x3'));var jsonpatch=require(_0x59e0('0x4'));var rp=require(_0x59e0('0x5'));var moment=require(_0x59e0('0x6'));var BPromise=require(_0x59e0('0x7'));var Mustache=require(_0x59e0('0x8'));var util=require(_0x59e0('0x9'));var path=require(_0x59e0('0xa'));var sox=require(_0x59e0('0xb'));var csv=require(_0x59e0('0xc'));var ejs=require(_0x59e0('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x59e0('0xe'));var crypto=require(_0x59e0('0xf'));var jsforce=require(_0x59e0('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x59e0('0xc'));var querystring=require('querystring');var Papa=require(_0x59e0('0x11'));var Redis=require(_0x59e0('0x12'));var authService=require(_0x59e0('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x59e0('0x14'));var hardwareService=require(_0x59e0('0x15'));var logger=require(_0x59e0('0x16'))(_0x59e0('0x17'));var utils=require(_0x59e0('0x18'));var config=require(_0x59e0('0x19'));var db=require(_0x59e0('0x1a'))['db'];config[_0x59e0('0x1b')]=_['defaults'](config['redis'],{'host':_0x59e0('0x1c'),'port':0x18eb});var socket=require(_0x59e0('0x1d'))(new Redis(config['redis']));require(_0x59e0('0x1e'))[_0x59e0('0x1f')](socket);function respondWithStatusCode(_0x388b39,_0x25157c){_0x25157c=_0x25157c||0xcc;return function(_0x59abe2){if(_0x59abe2){return _0x388b39[_0x59e0('0x20')](_0x25157c);}return _0x388b39['status'](_0x25157c)[_0x59e0('0x21')]();};}function respondWithResult(_0x240aff,_0x3b80af){_0x3b80af=_0x3b80af||0xc8;return function(_0x5a8294){if(_0x5a8294){return _0x240aff[_0x59e0('0x22')](_0x3b80af)[_0x59e0('0x23')](_0x5a8294);}};}function respondWithFilteredResult(_0x5e73b6,_0x4f5f13){return function(_0x44fe07){if(_0x44fe07){var _0x2922c0=_0x44fe07[_0x59e0('0x24')],_0xc294ea=_0x4f5f13[_0x59e0('0x25')],_0x1d1b65=_0x4f5f13[_0x59e0('0x25')]+_0x4f5f13[_0x59e0('0x26')],_0x4ccc91;if(_0x1d1b65>=_0x2922c0){_0x1d1b65=_0x2922c0;_0x4ccc91=0xc8;}else{_0x4ccc91=0xce;}_0x5e73b6[_0x59e0('0x22')](_0x4ccc91);return _0x5e73b6['set'](_0x59e0('0x27'),_0xc294ea+'-'+_0x1d1b65+'/'+_0x2922c0)[_0x59e0('0x23')](_0x44fe07);}return null;};}function patchUpdates(_0x48cd91){return function(_0x518528){try{jsonpatch[_0x59e0('0x28')](_0x518528,_0x48cd91,!![]);}catch(_0x412463){return BPromise[_0x59e0('0x29')](_0x412463);}return _0x518528['save']();};}function saveUpdates(_0x1058c3,_0x107d65){return function(_0x568711){if(_0x568711){return _0x568711[_0x59e0('0x2a')](_0x1058c3)['then'](function(_0xcd875d){return _0xcd875d;});}return null;};}function removeEntity(_0x501d7b,_0x341bbd){return function(_0x3575bb){if(_0x3575bb){return _0x3575bb[_0x59e0('0x2b')]()[_0x59e0('0x2c')](function(){var _0x22a41=_0x3575bb[_0x59e0('0x2d')]({'plain':!![]});var _0x475a67=[{'name':_0x59e0('0x2e'),'value':'inbound','ignore':![]},{'name':_0x59e0('0x2f'),'value':_0x59e0('0x30'),'ignore':![]},{'name':_0x59e0('0x31'),'value':_0x59e0('0x32'),'ignore':![]}];var _0x294060=_(_0x475a67)['filter'](_0x59e0('0x33'))[_0x59e0('0x34')](_0x59e0('0x35'))[_0x59e0('0x35')]();if(_[_0x59e0('0x36')](_0x294060,_0x22a41[_0x59e0('0x37')])){return;}var _0x473f35=_['find'](_0x475a67,['value',_0x22a41[_0x59e0('0x37')]])[_0x59e0('0x38')];return db[_0x59e0('0x39')][_0x59e0('0x2b')]({'where':{'type':_0x473f35,'resourceId':_0x22a41['id']}})[_0x59e0('0x2c')](function(){return _0x3575bb;});})[_0x59e0('0x2c')](function(){_0x501d7b[_0x59e0('0x22')](0xcc)[_0x59e0('0x21')]();});}};}function handleEntityNotFound(_0x2db682,_0x4c39d0){return function(_0x5a1680){if(!_0x5a1680){_0x2db682[_0x59e0('0x20')](0x194);}return _0x5a1680;};}function handleError(_0x2009f2,_0x9a0fc0){_0x9a0fc0=_0x9a0fc0||0x1f4;return function(_0x1ac53a){logger[_0x59e0('0x3a')](_0x1ac53a['stack']);if(_0x1ac53a['name']){delete _0x1ac53a[_0x59e0('0x38')];}_0x2009f2[_0x59e0('0x22')](_0x9a0fc0)['send'](_0x1ac53a);};}exports[_0x59e0('0x3b')]=function(_0x51298a,_0x5ab8b6){var _0xa54833={},_0xfc1358={},_0x4a5832={'count':0x0,'rows':[]};var _0x3f7b4d=_['map'](db[_0x59e0('0x3c')][_0x59e0('0x3d')],function(_0x102a0c){return{'name':_0x102a0c[_0x59e0('0x3e')],'type':_0x102a0c[_0x59e0('0x37')][_0x59e0('0x3f')]};});_0xfc1358[_0x59e0('0x40')]=_[_0x59e0('0x34')](_0x3f7b4d,'name');_0xfc1358[_0x59e0('0x41')]=_[_0x59e0('0x42')](_0x51298a['query']);_0xfc1358[_0x59e0('0x43')]=_[_0x59e0('0x44')](_0xfc1358['model'],_0xfc1358[_0x59e0('0x41')]);_0xa54833[_0x59e0('0x45')]=_[_0x59e0('0x44')](_0xfc1358[_0x59e0('0x40')],qs[_0x59e0('0x46')](_0x51298a[_0x59e0('0x41')][_0x59e0('0x46')]));_0xa54833[_0x59e0('0x45')]=_0xa54833['attributes'][_0x59e0('0x47')]?_0xa54833[_0x59e0('0x45')]:_0xfc1358['model'];if(!_0x51298a['query']['hasOwnProperty']('nolimit')){_0xa54833[_0x59e0('0x26')]=qs[_0x59e0('0x26')](_0x51298a[_0x59e0('0x41')][_0x59e0('0x26')]);_0xa54833[_0x59e0('0x25')]=qs[_0x59e0('0x25')](_0x51298a[_0x59e0('0x41')][_0x59e0('0x25')]);}_0xa54833[_0x59e0('0x48')]=qs[_0x59e0('0x49')](_0x51298a[_0x59e0('0x41')][_0x59e0('0x49')]);_0xa54833[_0x59e0('0x4a')]=qs[_0x59e0('0x43')](_[_0x59e0('0x4b')](_0x51298a['query'],_0xfc1358['filters']));if(_0x51298a[_0x59e0('0x41')][_0x59e0('0x4c')]){_0xa54833['where']=_[_0x59e0('0x4d')](_0xa54833[_0x59e0('0x4a')],{'$or':_['map'](_0x3f7b4d,function(_0x99e096){if(_0x99e096['type']!==_0x59e0('0x4e')){var _0x31d376={};_0x31d376[_0x99e096['name']]={'$like':'%'+_0x51298a[_0x59e0('0x41')]['filter']+'%'};return _0x31d376;}})});}_0xa54833=_[_0x59e0('0x4d')]({},_0xa54833,_0x51298a[_0x59e0('0x4f')]);var _0x531861={'where':_0xa54833['where']};return db['VoiceExtension']['count'](_0x531861)[_0x59e0('0x2c')](function(_0x77316e){_0x4a5832[_0x59e0('0x24')]=_0x77316e;if(_0x51298a['query']['includeAll']){_0xa54833[_0x59e0('0x50')]=[{'all':!![]}];}return db[_0x59e0('0x3c')][_0x59e0('0x51')](_0xa54833);})[_0x59e0('0x2c')](function(_0x12b459){_0x4a5832[_0x59e0('0x52')]=_0x12b459;return _0x4a5832;})[_0x59e0('0x2c')](respondWithFilteredResult(_0x5ab8b6,_0xa54833))[_0x59e0('0x53')](handleError(_0x5ab8b6,null));};exports[_0x59e0('0x54')]=function(_0x203464,_0x216f32){var _0x42cbd6={'raw':![],'where':{'id':_0x203464['params']['id']}},_0x2c9012={};_0x2c9012['model']=_[_0x59e0('0x42')](db[_0x59e0('0x3c')][_0x59e0('0x3d')]);_0x2c9012[_0x59e0('0x41')]=_['keys'](_0x203464[_0x59e0('0x41')]);_0x2c9012[_0x59e0('0x43')]=_[_0x59e0('0x44')](_0x2c9012[_0x59e0('0x40')],_0x2c9012[_0x59e0('0x41')]);_0x42cbd6['attributes']=_[_0x59e0('0x44')](_0x2c9012['model'],qs['fields'](_0x203464['query'][_0x59e0('0x46')]));_0x42cbd6[_0x59e0('0x45')]=_0x42cbd6[_0x59e0('0x45')]['length']?_0x42cbd6[_0x59e0('0x45')]:_0x2c9012[_0x59e0('0x40')];if(_0x203464[_0x59e0('0x41')][_0x59e0('0x55')]){_0x42cbd6[_0x59e0('0x50')]=[{'all':!![]}];}_0x42cbd6=_[_0x59e0('0x4d')]({},_0x42cbd6,_0x203464[_0x59e0('0x4f')]);return db[_0x59e0('0x3c')]['find'](_0x42cbd6)['then'](handleEntityNotFound(_0x216f32,null))[_0x59e0('0x2c')](respondWithResult(_0x216f32,null))[_0x59e0('0x53')](handleError(_0x216f32,null));};exports['destroy']=function(_0x4503b0,_0xa08a3e){return db[_0x59e0('0x3c')][_0x59e0('0x56')]({'where':{'id':_0x4503b0[_0x59e0('0x57')]['id']}})[_0x59e0('0x2c')](handleEntityNotFound(_0xa08a3e,null))['then'](removeEntity(_0xa08a3e,null))[_0x59e0('0x53')](handleError(_0xa08a3e,null));};exports['create']=function(_0xae42ac,_0x2eab1f){if(_0xae42ac['body'][_0x59e0('0x37')]===_0x59e0('0x30')&&!_[_0x59e0('0x58')](_0xae42ac['body'][_0x59e0('0x59')],'_')){_0xae42ac['body'][_0x59e0('0x59')]='_'[_0x59e0('0x5a')](_0xae42ac[_0x59e0('0x5b')][_0x59e0('0x59')]);}return db[_0x59e0('0x3c')][_0x59e0('0x5c')](_0xae42ac[_0x59e0('0x5b')],{'raw':![]})['then'](function(_0x26dcad){var _0x5e7e85=_0xae42ac['user']['get']({'plain':!![]});if(!_0x5e7e85)throw new Error(_0x59e0('0x5d'));if(_0x5e7e85['role']==='user'){var _0x2acbb0=_0x26dcad[_0x59e0('0x2d')]({'plain':!![]});var _0x21a17f=[{'name':_0x59e0('0x2e'),'value':'inbound'},{'name':_0x59e0('0x2f'),'value':_0x59e0('0x30')},{'name':_0x59e0('0x31'),'value':_0x59e0('0x32')}];var _0x17cf2a=_[_0x59e0('0x56')](_0x21a17f,['value',_0x2acbb0['type']])[_0x59e0('0x38')];return db[_0x59e0('0x5e')][_0x59e0('0x56')]({'where':{'name':_0x17cf2a,'userProfileId':_0x5e7e85['userProfileId']},'raw':!![]})['then'](function(_0x1eae09){if(_0x1eae09&&_0x1eae09[_0x59e0('0x5f')]===0x0){return db['UserProfileResource'][_0x59e0('0x5c')]({'name':_0x2acbb0[_0x59e0('0x38')],'resourceId':_0x2acbb0['id'],'type':_0x1eae09[_0x59e0('0x38')],'sectionId':_0x1eae09['id']},{})[_0x59e0('0x2c')](function(){return _0x26dcad;});}else{return _0x26dcad;}})[_0x59e0('0x53')](function(_0x28cc87){logger[_0x59e0('0x3a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x28cc87);throw _0x28cc87;});}return _0x26dcad;})['then'](respondWithResult(_0x2eab1f,0xc9))[_0x59e0('0x53')](handleError(_0x2eab1f,null));};exports['update']=function(_0x13f747,_0x20e3ee){if(_0x13f747['body']['id']){delete _0x13f747[_0x59e0('0x5b')]['id'];}return db[_0x59e0('0x3c')][_0x59e0('0x56')]({'where':{'id':_0x13f747['params']['id']}})[_0x59e0('0x2c')](handleEntityNotFound(_0x20e3ee,null))[_0x59e0('0x2c')](function(_0x1082b1){if(_0x1082b1){return db[_0x59e0('0x3c')][_0x59e0('0x2a')](_['pick'](_0x13f747[_0x59e0('0x5b')],[_0x59e0('0x59'),'context',_0x59e0('0x60'),_0x59e0('0x61'),'cutdigits',_0x59e0('0x62')]),{'where':{'context':_0x1082b1[_0x59e0('0x63')],'exten':_0x1082b1[_0x59e0('0x59')]},'individualHooks':!![]})[_0x59e0('0x2c')](function(_0x414846){return _0x414846;});}return null;})[_0x59e0('0x2c')](respondWithStatusCode(_0x20e3ee,null))[_0x59e0('0x53')](handleError(_0x20e3ee,null));};exports[_0x59e0('0x64')]=function(_0x132667,_0x45bf8a,_0xafcf9f){return db[_0x59e0('0x3c')][_0x59e0('0x65')]({'where':{'id':_0x132667[_0x59e0('0x57')]['id']}})[_0x59e0('0x2c')](handleEntityNotFound(_0x45bf8a,null))[_0x59e0('0x2c')](function(_0x274561){if(_0x274561){return db['sequelize'][_0x59e0('0x66')](function(_0x35fa95){return db[_0x59e0('0x3c')][_0x59e0('0x2b')]({'where':{'VoiceExtensionId':_0x132667[_0x59e0('0x57')]['id']},'transaction':_0x35fa95})[_0x59e0('0x2c')](function(_0x5028e3){var _0x1747d6=_[_0x59e0('0x34')](_0x132667[_0x59e0('0x5b')],function(_0x5de181){_0x5de181[_0x59e0('0x67')]=_0x132667[_0x59e0('0x57')]['id'];return _0x5de181;});return db[_0x59e0('0x3c')][_0x59e0('0x68')](_0x1747d6,{'transaction':_0x35fa95});});})[_0x59e0('0x2c')](function(){return db[_0x59e0('0x3c')]['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x132667[_0x59e0('0x57')]['id']},'order':_0x59e0('0x69')});});}})[_0x59e0('0x2c')](respondWithResult(_0x45bf8a,null))[_0x59e0('0x53')](handleError(_0x45bf8a,null));}; \ No newline at end of file +var _0xf05f=['InboundRoutes','inbound','OutboundRoutes','InternalRoutes','internal','filter','ignore','value','includes','type','name','UserProfileResource','destroy','sendStatus','error','stack','send','map','VoiceExtension','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','outbound','startsWith','exten','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','recordingFormat','cutdigits','mandatoryDisposition','addApplications','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','defaults','redis','socket.io-emitter','./voiceExtension.socket','register','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then'];(function(_0x200a6a,_0x4a33cd){var _0x17d4fd=function(_0x231abd){while(--_0x231abd){_0x200a6a['push'](_0x200a6a['shift']());}};_0x17d4fd(++_0x4a33cd);}(_0xf05f,0xae));var _0xff05=function(_0x14d94b,_0x5e554d){_0x14d94b=_0x14d94b-0x0;var _0x17296e=_0xf05f[_0x14d94b];return _0x17296e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xff05('0x0'));var rimraf=require(_0xff05('0x1'));var zipdir=require(_0xff05('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xff05('0x3'));var moment=require(_0xff05('0x4'));var BPromise=require(_0xff05('0x5'));var Mustache=require(_0xff05('0x6'));var util=require(_0xff05('0x7'));var path=require(_0xff05('0x8'));var sox=require(_0xff05('0x9'));var csv=require(_0xff05('0xa'));var ejs=require(_0xff05('0xb'));var fs=require('fs');var _=require(_0xff05('0xc'));var squel=require(_0xff05('0xd'));var crypto=require(_0xff05('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xff05('0xf'));var toCsv=require(_0xff05('0xa'));var querystring=require(_0xff05('0x10'));var Papa=require(_0xff05('0x11'));var Redis=require('ioredis');var authService=require(_0xff05('0x12'));var qs=require(_0xff05('0x13'));var as=require(_0xff05('0x14'));var hardwareService=require(_0xff05('0x15'));var logger=require(_0xff05('0x16'))(_0xff05('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xff05('0x18'))['db'];config['redis']=_[_0xff05('0x19')](config[_0xff05('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xff05('0x1b'))(new Redis(config[_0xff05('0x1a')]));require(_0xff05('0x1c'))[_0xff05('0x1d')](socket);function respondWithStatusCode(_0xb78d2c,_0x205fed){_0x205fed=_0x205fed||0xcc;return function(_0x3fbbf9){if(_0x3fbbf9){return _0xb78d2c['sendStatus'](_0x205fed);}return _0xb78d2c[_0xff05('0x1e')](_0x205fed)[_0xff05('0x1f')]();};}function respondWithResult(_0x4e97ac,_0x138f37){_0x138f37=_0x138f37||0xc8;return function(_0x182810){if(_0x182810){return _0x4e97ac[_0xff05('0x1e')](_0x138f37)[_0xff05('0x20')](_0x182810);}};}function respondWithFilteredResult(_0x4ecbac,_0x12b132){return function(_0x3cbd56){if(_0x3cbd56){var _0x13ab15=_0x3cbd56[_0xff05('0x21')],_0x263b4e=_0x12b132[_0xff05('0x22')],_0x21ea97=_0x12b132[_0xff05('0x22')]+_0x12b132[_0xff05('0x23')],_0x4ecc16;if(_0x21ea97>=_0x13ab15){_0x21ea97=_0x13ab15;_0x4ecc16=0xc8;}else{_0x4ecc16=0xce;}_0x4ecbac[_0xff05('0x1e')](_0x4ecc16);return _0x4ecbac[_0xff05('0x24')](_0xff05('0x25'),_0x263b4e+'-'+_0x21ea97+'/'+_0x13ab15)['json'](_0x3cbd56);}return null;};}function patchUpdates(_0x51effa){return function(_0x323f38){try{jsonpatch[_0xff05('0x26')](_0x323f38,_0x51effa,!![]);}catch(_0x383efe){return BPromise[_0xff05('0x27')](_0x383efe);}return _0x323f38['save']();};}function saveUpdates(_0x127ac8,_0x248cbb){return function(_0x445bf0){if(_0x445bf0){return _0x445bf0[_0xff05('0x28')](_0x127ac8)['then'](function(_0x492dd9){return _0x492dd9;});}return null;};}function removeEntity(_0xee3fdb,_0x493736){return function(_0x1be604){if(_0x1be604){return _0x1be604['destroy']()[_0xff05('0x29')](function(){var _0xbd58ed=_0x1be604['get']({'plain':!![]});var _0x281c7b=[{'name':_0xff05('0x2a'),'value':_0xff05('0x2b'),'ignore':![]},{'name':_0xff05('0x2c'),'value':'outbound','ignore':![]},{'name':_0xff05('0x2d'),'value':_0xff05('0x2e'),'ignore':![]}];var _0x5da657=_(_0x281c7b)[_0xff05('0x2f')](_0xff05('0x30'))['map'](_0xff05('0x31'))['value']();if(_[_0xff05('0x32')](_0x5da657,_0xbd58ed['type'])){return;}var _0x4e21fd=_['find'](_0x281c7b,[_0xff05('0x31'),_0xbd58ed[_0xff05('0x33')]])[_0xff05('0x34')];return db[_0xff05('0x35')][_0xff05('0x36')]({'where':{'type':_0x4e21fd,'resourceId':_0xbd58ed['id']}})[_0xff05('0x29')](function(){return _0x1be604;});})[_0xff05('0x29')](function(){_0xee3fdb[_0xff05('0x1e')](0xcc)[_0xff05('0x1f')]();});}};}function handleEntityNotFound(_0x482d5d,_0x2fc91a){return function(_0x43854b){if(!_0x43854b){_0x482d5d[_0xff05('0x37')](0x194);}return _0x43854b;};}function handleError(_0x58feb1,_0x17ad3f){_0x17ad3f=_0x17ad3f||0x1f4;return function(_0x34fc1f){logger[_0xff05('0x38')](_0x34fc1f[_0xff05('0x39')]);if(_0x34fc1f[_0xff05('0x34')]){delete _0x34fc1f['name'];}_0x58feb1[_0xff05('0x1e')](_0x17ad3f)[_0xff05('0x3a')](_0x34fc1f);};}exports['index']=function(_0x12882f,_0x132be0){var _0x540ec0={},_0x125a3e={},_0x3efe23={'count':0x0,'rows':[]};var _0x3ebfbb=_[_0xff05('0x3b')](db[_0xff05('0x3c')][_0xff05('0x3d')],function(_0x812e3c){return{'name':_0x812e3c['fieldName'],'type':_0x812e3c['type'][_0xff05('0x3e')]};});_0x125a3e[_0xff05('0x3f')]=_[_0xff05('0x3b')](_0x3ebfbb,_0xff05('0x34'));_0x125a3e[_0xff05('0x40')]=_[_0xff05('0x41')](_0x12882f[_0xff05('0x40')]);_0x125a3e[_0xff05('0x42')]=_[_0xff05('0x43')](_0x125a3e[_0xff05('0x3f')],_0x125a3e[_0xff05('0x40')]);_0x540ec0['attributes']=_[_0xff05('0x43')](_0x125a3e[_0xff05('0x3f')],qs[_0xff05('0x44')](_0x12882f[_0xff05('0x40')][_0xff05('0x44')]));_0x540ec0['attributes']=_0x540ec0['attributes']['length']?_0x540ec0[_0xff05('0x45')]:_0x125a3e[_0xff05('0x3f')];if(!_0x12882f['query']['hasOwnProperty'](_0xff05('0x46'))){_0x540ec0['limit']=qs[_0xff05('0x23')](_0x12882f[_0xff05('0x40')][_0xff05('0x23')]);_0x540ec0['offset']=qs['offset'](_0x12882f[_0xff05('0x40')][_0xff05('0x22')]);}_0x540ec0['order']=qs[_0xff05('0x47')](_0x12882f['query'][_0xff05('0x47')]);_0x540ec0[_0xff05('0x48')]=qs['filters'](_[_0xff05('0x49')](_0x12882f[_0xff05('0x40')],_0x125a3e[_0xff05('0x42')]));if(_0x12882f[_0xff05('0x40')][_0xff05('0x2f')]){_0x540ec0[_0xff05('0x48')]=_[_0xff05('0x4a')](_0x540ec0['where'],{'$or':_['map'](_0x3ebfbb,function(_0x2ae22b){if(_0x2ae22b['type']!==_0xff05('0x4b')){var _0x32a713={};_0x32a713[_0x2ae22b['name']]={'$like':'%'+_0x12882f[_0xff05('0x40')][_0xff05('0x2f')]+'%'};return _0x32a713;}})});}_0x540ec0=_['merge']({},_0x540ec0,_0x12882f[_0xff05('0x4c')]);var _0x2371f1={'where':_0x540ec0[_0xff05('0x48')]};return db['VoiceExtension'][_0xff05('0x21')](_0x2371f1)[_0xff05('0x29')](function(_0xb70387){_0x3efe23['count']=_0xb70387;if(_0x12882f[_0xff05('0x40')][_0xff05('0x4d')]){_0x540ec0['include']=[{'all':!![]}];}return db[_0xff05('0x3c')][_0xff05('0x4e')](_0x540ec0);})[_0xff05('0x29')](function(_0x38ffe0){_0x3efe23['rows']=_0x38ffe0;return _0x3efe23;})[_0xff05('0x29')](respondWithFilteredResult(_0x132be0,_0x540ec0))[_0xff05('0x4f')](handleError(_0x132be0,null));};exports[_0xff05('0x50')]=function(_0x572f27,_0x52d7db){var _0x3f4a5e={'raw':![],'where':{'id':_0x572f27[_0xff05('0x51')]['id']}},_0x3081cc={};_0x3081cc['model']=_['keys'](db[_0xff05('0x3c')][_0xff05('0x3d')]);_0x3081cc[_0xff05('0x40')]=_[_0xff05('0x41')](_0x572f27['query']);_0x3081cc[_0xff05('0x42')]=_[_0xff05('0x43')](_0x3081cc['model'],_0x3081cc['query']);_0x3f4a5e['attributes']=_['intersection'](_0x3081cc[_0xff05('0x3f')],qs[_0xff05('0x44')](_0x572f27[_0xff05('0x40')][_0xff05('0x44')]));_0x3f4a5e['attributes']=_0x3f4a5e[_0xff05('0x45')]['length']?_0x3f4a5e[_0xff05('0x45')]:_0x3081cc[_0xff05('0x3f')];if(_0x572f27[_0xff05('0x40')][_0xff05('0x4d')]){_0x3f4a5e[_0xff05('0x52')]=[{'all':!![]}];}_0x3f4a5e=_[_0xff05('0x4a')]({},_0x3f4a5e,_0x572f27[_0xff05('0x4c')]);return db[_0xff05('0x3c')][_0xff05('0x53')](_0x3f4a5e)[_0xff05('0x29')](handleEntityNotFound(_0x52d7db,null))['then'](respondWithResult(_0x52d7db,null))[_0xff05('0x4f')](handleError(_0x52d7db,null));};exports[_0xff05('0x36')]=function(_0x5d4e33,_0x2dfebb){return db[_0xff05('0x3c')][_0xff05('0x53')]({'where':{'id':_0x5d4e33[_0xff05('0x51')]['id']}})[_0xff05('0x29')](handleEntityNotFound(_0x2dfebb,null))[_0xff05('0x29')](removeEntity(_0x2dfebb,null))['catch'](handleError(_0x2dfebb,null));};exports[_0xff05('0x54')]=function(_0x100e1a,_0x3def36){if(_0x100e1a['body'][_0xff05('0x33')]===_0xff05('0x55')&&!_[_0xff05('0x56')](_0x100e1a['body'][_0xff05('0x57')],'_')){_0x100e1a[_0xff05('0x58')][_0xff05('0x57')]='_'['concat'](_0x100e1a[_0xff05('0x58')][_0xff05('0x57')]);}return db['VoiceExtension'][_0xff05('0x54')](_0x100e1a[_0xff05('0x58')],{'raw':![]})['then'](function(_0x13757d){var _0x2654c3=_0x100e1a[_0xff05('0x59')][_0xff05('0x5a')]({'plain':!![]});if(!_0x2654c3)throw new Error(_0xff05('0x5b'));if(_0x2654c3[_0xff05('0x5c')]===_0xff05('0x59')){var _0x1142d3=_0x13757d[_0xff05('0x5a')]({'plain':!![]});var _0x5dc7a7=[{'name':_0xff05('0x2a'),'value':_0xff05('0x2b')},{'name':_0xff05('0x2c'),'value':_0xff05('0x55')},{'name':'InternalRoutes','value':_0xff05('0x2e')}];var _0x452a0f=_[_0xff05('0x53')](_0x5dc7a7,['value',_0x1142d3['type']])[_0xff05('0x34')];return db[_0xff05('0x5d')][_0xff05('0x53')]({'where':{'name':_0x452a0f,'userProfileId':_0x2654c3[_0xff05('0x5e')]},'raw':!![]})[_0xff05('0x29')](function(_0x2e3d84){if(_0x2e3d84&&_0x2e3d84[_0xff05('0x5f')]===0x0){return db[_0xff05('0x35')]['create']({'name':_0x1142d3['name'],'resourceId':_0x1142d3['id'],'type':_0x2e3d84[_0xff05('0x34')],'sectionId':_0x2e3d84['id']},{})[_0xff05('0x29')](function(){return _0x13757d;});}else{return _0x13757d;}})['catch'](function(_0x1af8f6){logger['error'](_0xff05('0x60'),_0x1af8f6);throw _0x1af8f6;});}return _0x13757d;})['then'](respondWithResult(_0x3def36,0xc9))[_0xff05('0x4f')](handleError(_0x3def36,null));};exports[_0xff05('0x28')]=function(_0x475f1d,_0x598614){if(_0x475f1d[_0xff05('0x58')]['id']){delete _0x475f1d[_0xff05('0x58')]['id'];}return db[_0xff05('0x3c')][_0xff05('0x53')]({'where':{'id':_0x475f1d[_0xff05('0x51')]['id']}})[_0xff05('0x29')](handleEntityNotFound(_0x598614,null))[_0xff05('0x29')](function(_0x43e401){if(_0x43e401){return db['VoiceExtension'][_0xff05('0x28')](_['pick'](_0x475f1d[_0xff05('0x58')],[_0xff05('0x57'),_0xff05('0x61'),'description',_0xff05('0x62'),_0xff05('0x63'),_0xff05('0x64')]),{'where':{'context':_0x43e401['context'],'exten':_0x43e401[_0xff05('0x57')]},'individualHooks':!![]})[_0xff05('0x29')](function(_0x2ff057){return _0x2ff057;});}return null;})['then'](respondWithStatusCode(_0x598614,null))[_0xff05('0x4f')](handleError(_0x598614,null));};exports[_0xff05('0x65')]=function(_0x1dbfa9,_0x3a3883,_0x121324){return db[_0xff05('0x3c')][_0xff05('0x66')]({'where':{'id':_0x1dbfa9[_0xff05('0x51')]['id']}})[_0xff05('0x29')](handleEntityNotFound(_0x3a3883,null))[_0xff05('0x29')](function(_0x5e5509){if(_0x5e5509){return db[_0xff05('0x67')][_0xff05('0x68')](function(_0x694714){return db['VoiceExtension'][_0xff05('0x36')]({'where':{'VoiceExtensionId':_0x1dbfa9[_0xff05('0x51')]['id']},'transaction':_0x694714})[_0xff05('0x29')](function(_0x4e361f){var _0x417a54=_[_0xff05('0x3b')](_0x1dbfa9[_0xff05('0x58')],function(_0x128803){_0x128803[_0xff05('0x69')]=_0x1dbfa9[_0xff05('0x51')]['id'];return _0x128803;});return db[_0xff05('0x3c')][_0xff05('0x6a')](_0x417a54,{'transaction':_0x694714});});})['then'](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x1dbfa9[_0xff05('0x51')]['id']},'order':_0xff05('0x6b')});});}})[_0xff05('0x29')](respondWithResult(_0x3a3883,null))[_0xff05('0x4f')](handleError(_0x3a3883,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 237e7d4..8344394 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 _0xf688=['setMaxListeners','update','remove','emit','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x2a9b30,_0x117133){var _0x1535d2=function(_0x47151e){while(--_0x47151e){_0x2a9b30['push'](_0x2a9b30['shift']());}};_0x1535d2(++_0x117133);}(_0xf688,0x177));var _0x8f68=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf688[_0x14add3];return _0x4a174f;};'use strict';var EventEmitter=require(_0x8f68('0x0'));var VoiceExtension=require(_0x8f68('0x1'))['db'][_0x8f68('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x8f68('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x8f68('0x4'),'afterDestroy':_0x8f68('0x5')};function emitEvent(_0x2bf374){return function(_0x184428,_0x4f2709,_0x2decbc){VoiceExtensionEvents[_0x8f68('0x6')](_0x2bf374+':'+_0x184428['id'],_0x184428);VoiceExtensionEvents[_0x8f68('0x6')](_0x2bf374,_0x184428);_0x2decbc(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x8f68('0x7')](e,emitEvent(event));}}module[_0x8f68('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0xb356=['emit','hook','events','VoiceExtension','save','update'];(function(_0x47e7cb,_0x4c1b8d){var _0x2a8874=function(_0x36498f){while(--_0x36498f){_0x47e7cb['push'](_0x47e7cb['shift']());}};_0x2a8874(++_0x4c1b8d);}(_0xb356,0x134));var _0x6b35=function(_0x4b2a05,_0x1ed749){_0x4b2a05=_0x4b2a05-0x0;var _0x1c7f56=_0xb356[_0x4b2a05];return _0x1c7f56;};'use strict';var EventEmitter=require(_0x6b35('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x6b35('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6b35('0x2'),'afterUpdate':_0x6b35('0x3'),'afterDestroy':'remove'};function emitEvent(_0xe73016){return function(_0x3d7962,_0x20cacc,_0x5e4b44){VoiceExtensionEvents[_0x6b35('0x4')](_0xe73016+':'+_0x3d7962['id'],_0x3d7962);VoiceExtensionEvents[_0x6b35('0x4')](_0xe73016,_0x3d7962);_0x5e4b44(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x6b35('0x5')](e,emitEvent(event));}}module['exports']=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index f9106b0..e618add 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 _0x61e4=['voice_extensions','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','VoiceExtension'];(function(_0x57cc22,_0x2d351f){var _0x6f7bdc=function(_0x4935b5){while(--_0x4935b5){_0x57cc22['push'](_0x57cc22['shift']());}};_0x6f7bdc(++_0x2d351f);}(_0x61e4,0x1bd));var _0x461e=function(_0x22aabe,_0x1667d4){_0x22aabe=_0x22aabe-0x0;var _0x7ae05=_0x61e4[_0x22aabe];return _0x7ae05;};'use strict';var _=require(_0x461e('0x0'));var util=require(_0x461e('0x1'));var logger=require(_0x461e('0x2'))(_0x461e('0x3'));var moment=require(_0x461e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x461e('0x5'));var rimraf=require(_0x461e('0x6'));var config=require(_0x461e('0x7'));var attributes=require(_0x461e('0x8'));module[_0x461e('0x9')]=function(_0x14b2bf,_0x40c15d){return _0x14b2bf['define'](_0x461e('0xa'),attributes,{'tableName':_0x461e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd816=['voice_extensions','lodash','util','api','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','VoiceExtension'];(function(_0x3d4ef1,_0x5a957c){var _0x409423=function(_0x1ab129){while(--_0x1ab129){_0x3d4ef1['push'](_0x3d4ef1['shift']());}};_0x409423(++_0x5a957c);}(_0xd816,0x8d));var _0x6d81=function(_0x3ad0c8,_0x4d0507){_0x3ad0c8=_0x3ad0c8-0x0;var _0x86b70e=_0xd816[_0x3ad0c8];return _0x86b70e;};'use strict';var _=require(_0x6d81('0x0'));var util=require(_0x6d81('0x1'));var logger=require('../../config/logger')(_0x6d81('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6d81('0x3'));var rimraf=require(_0x6d81('0x4'));var config=require(_0x6d81('0x5'));var attributes=require(_0x6d81('0x6'));module[_0x6d81('0x7')]=function(_0x4972ba,_0x5cafb5){return _0x4972ba['define'](_0x6d81('0x8'),attributes,{'tableName':_0x6d81('0x9'),'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 747c229..8db805a 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 _0x0b52=['jayson/promise','defaults','redis','localhost','./voiceExtension.socket','register','request','then','info','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceExtension,\x20%s,\x20%s','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','attributes','limit','map','include','model','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b52,0x8b));var _0x20b5=function(_0x5eda41,_0x316356){_0x5eda41=_0x5eda41-0x0;var _0x516ea6=_0x0b52[_0x5eda41];return _0x516ea6;};'use strict';var _=require(_0x20b5('0x0'));var util=require(_0x20b5('0x1'));var moment=require(_0x20b5('0x2'));var BPromise=require('bluebird');var rs=require(_0x20b5('0x3'));var fs=require('fs');var Redis=require(_0x20b5('0x4'));var db=require(_0x20b5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x20b5('0x6'))(_0x20b5('0x7'));var config=require(_0x20b5('0x8'));var jayson=require(_0x20b5('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x20b5('0xa')](config[_0x20b5('0xb')],{'host':_0x20b5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x20b5('0xb')]));require(_0x20b5('0xd'))[_0x20b5('0xe')](socket);function respondWithRpcPromise(_0x186bda,_0xa67467,_0xc7ccc6){return new BPromise(function(_0x64b2dd,_0xeb8fa){return client[_0x20b5('0xf')](_0x186bda,_0xc7ccc6)[_0x20b5('0x10')](function(_0x46881c){logger[_0x20b5('0x11')]('VoiceExtension,\x20%s,\x20%s',_0xa67467,_0x20b5('0x12'));logger[_0x20b5('0x13')](_0x20b5('0x14'),_0xa67467,_0x20b5('0x12'),JSON[_0x20b5('0x15')](_0x46881c));if(_0x46881c['error']){if(_0x46881c[_0x20b5('0x16')][_0x20b5('0x17')]===0x1f4){logger[_0x20b5('0x16')](_0x20b5('0x18'),_0xa67467,_0x46881c['error'][_0x20b5('0x19')]);return _0xeb8fa(_0x46881c[_0x20b5('0x16')][_0x20b5('0x19')]);}logger[_0x20b5('0x16')](_0x20b5('0x18'),_0xa67467,_0x46881c[_0x20b5('0x16')][_0x20b5('0x19')]);return _0x64b2dd(_0x46881c[_0x20b5('0x16')][_0x20b5('0x19')]);}else{logger[_0x20b5('0x11')](_0x20b5('0x18'),_0xa67467,_0x20b5('0x12'));_0x64b2dd(_0x46881c[_0x20b5('0x1a')][_0x20b5('0x19')]);}})[_0x20b5('0x1b')](function(_0x22fbca){logger[_0x20b5('0x16')](_0x20b5('0x18'),_0xa67467,_0x22fbca);_0xeb8fa(_0x22fbca);});});}exports[_0x20b5('0x1c')]=function(_0x69a046){var _0x214f45=this;return new Promise(function(_0x50f0f6,_0x2e7b9d){return db[_0x20b5('0x1d')][_0x20b5('0x1e')]({'raw':_0x69a046['options']?_0x69a046['options']['raw']===undefined?!![]:![]:!![],'where':_0x69a046[_0x20b5('0x1f')]?_0x69a046[_0x20b5('0x1f')]['where']||null:null,'attributes':_0x69a046['options']?_0x69a046[_0x20b5('0x1f')][_0x20b5('0x20')]||null:null,'limit':_0x69a046['options']?_0x69a046[_0x20b5('0x1f')][_0x20b5('0x21')]||null:null,'include':_0x69a046[_0x20b5('0x1f')]?_0x69a046[_0x20b5('0x1f')]['include']?_[_0x20b5('0x22')](_0x69a046[_0x20b5('0x1f')][_0x20b5('0x23')],function(_0x8414d9){return{'model':db[_0x8414d9[_0x20b5('0x24')]],'as':_0x8414d9['as'],'attributes':_0x8414d9['attributes'],'include':_0x8414d9[_0x20b5('0x23')]?_[_0x20b5('0x22')](_0x8414d9[_0x20b5('0x23')],function(_0x366781){return{'model':db[_0x366781['model']],'as':_0x366781['as'],'attributes':_0x366781[_0x20b5('0x20')],'include':_0x366781[_0x20b5('0x23')]?_[_0x20b5('0x22')](_0x366781[_0x20b5('0x23')],function(_0x6d8577){return{'model':db[_0x6d8577[_0x20b5('0x24')]],'as':_0x6d8577['as'],'attributes':_0x6d8577[_0x20b5('0x20')]};}):[]};}):[]};}):[]:[]})[_0x20b5('0x10')](function(_0xcbaa44){logger[_0x20b5('0x11')]('GetVoiceExtension',_0x69a046);logger[_0x20b5('0x13')]('GetVoiceExtension',_0x69a046,JSON[_0x20b5('0x15')](_0xcbaa44));_0x50f0f6(_0xcbaa44);})[_0x20b5('0x1b')](function(_0x19ddc2){logger[_0x20b5('0x16')](_0x20b5('0x1c'),_0x19ddc2[_0x20b5('0x19')],_0x69a046);_0x2e7b9d(_0x214f45['error'](0x1f4,_0x19ddc2[_0x20b5('0x19')]));});});}; \ No newline at end of file +var _0x3047=['GetVoiceExtension','findAll','options','raw','attributes','include','model','map','moment','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch'];(function(_0x1aee78,_0x1f12a5){var _0x17a11c=function(_0x239db7){while(--_0x239db7){_0x1aee78['push'](_0x1aee78['shift']());}};_0x17a11c(++_0x1f12a5);}(_0x3047,0xce));var _0x7304=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3047[_0x3b380d];return _0x54502b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x7304('0x0'));var BPromise=require('bluebird');var rs=require(_0x7304('0x1'));var fs=require('fs');var Redis=require(_0x7304('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x7304('0x3'));var logger=require(_0x7304('0x4'))('rpc');var config=require(_0x7304('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x7304('0x6')][_0x7304('0x7')]({'port':0x232a});config[_0x7304('0x8')]=_[_0x7304('0x9')](config[_0x7304('0x8')],{'host':_0x7304('0xa'),'port':0x18eb});var socket=require(_0x7304('0xb'))(new Redis(config[_0x7304('0x8')]));require(_0x7304('0xc'))[_0x7304('0xd')](socket);function respondWithRpcPromise(_0x1a1c8a,_0x47a0ed,_0x42727b){return new BPromise(function(_0x54ea48,_0x306d05){return client[_0x7304('0xe')](_0x1a1c8a,_0x42727b)[_0x7304('0xf')](function(_0x2610bf){logger[_0x7304('0x10')](_0x7304('0x11'),_0x47a0ed,_0x7304('0x12'));logger[_0x7304('0x13')]('VoiceExtension,\x20%s,\x20%s,\x20%s',_0x47a0ed,'request\x20sent',JSON[_0x7304('0x14')](_0x2610bf));if(_0x2610bf[_0x7304('0x15')]){if(_0x2610bf[_0x7304('0x15')]['code']===0x1f4){logger[_0x7304('0x15')](_0x7304('0x11'),_0x47a0ed,_0x2610bf[_0x7304('0x15')]['message']);return _0x306d05(_0x2610bf[_0x7304('0x15')][_0x7304('0x16')]);}logger[_0x7304('0x15')](_0x7304('0x11'),_0x47a0ed,_0x2610bf['error'][_0x7304('0x16')]);return _0x54ea48(_0x2610bf[_0x7304('0x15')][_0x7304('0x16')]);}else{logger[_0x7304('0x10')](_0x7304('0x11'),_0x47a0ed,_0x7304('0x12'));_0x54ea48(_0x2610bf[_0x7304('0x17')][_0x7304('0x16')]);}})[_0x7304('0x18')](function(_0x1cd728){logger[_0x7304('0x15')]('VoiceExtension,\x20%s,\x20%s',_0x47a0ed,_0x1cd728);_0x306d05(_0x1cd728);});});}exports[_0x7304('0x19')]=function(_0x2e6c49){var _0x1be4a8=this;return new Promise(function(_0x286c4d,_0x4bd676){return db['VoiceExtension'][_0x7304('0x1a')]({'raw':_0x2e6c49[_0x7304('0x1b')]?_0x2e6c49[_0x7304('0x1b')][_0x7304('0x1c')]===undefined?!![]:![]:!![],'where':_0x2e6c49[_0x7304('0x1b')]?_0x2e6c49[_0x7304('0x1b')]['where']||null:null,'attributes':_0x2e6c49[_0x7304('0x1b')]?_0x2e6c49[_0x7304('0x1b')][_0x7304('0x1d')]||null:null,'limit':_0x2e6c49[_0x7304('0x1b')]?_0x2e6c49[_0x7304('0x1b')]['limit']||null:null,'include':_0x2e6c49[_0x7304('0x1b')]?_0x2e6c49[_0x7304('0x1b')][_0x7304('0x1e')]?_['map'](_0x2e6c49['options'][_0x7304('0x1e')],function(_0x6186f6){return{'model':db[_0x6186f6[_0x7304('0x1f')]],'as':_0x6186f6['as'],'attributes':_0x6186f6['attributes'],'include':_0x6186f6[_0x7304('0x1e')]?_[_0x7304('0x20')](_0x6186f6['include'],function(_0x5b7a59){return{'model':db[_0x5b7a59[_0x7304('0x1f')]],'as':_0x5b7a59['as'],'attributes':_0x5b7a59['attributes'],'include':_0x5b7a59['include']?_['map'](_0x5b7a59[_0x7304('0x1e')],function(_0x424cf6){return{'model':db[_0x424cf6[_0x7304('0x1f')]],'as':_0x424cf6['as'],'attributes':_0x424cf6[_0x7304('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x7304('0xf')](function(_0x5549e8){logger[_0x7304('0x10')]('GetVoiceExtension',_0x2e6c49);logger[_0x7304('0x13')](_0x7304('0x19'),_0x2e6c49,JSON['stringify'](_0x5549e8));_0x286c4d(_0x5549e8);})[_0x7304('0x18')](function(_0x5b5917){logger[_0x7304('0x15')](_0x7304('0x19'),_0x5b5917[_0x7304('0x16')],_0x2e6c49);_0x4bd676(_0x1be4a8['error'](0x1f4,_0x5b5917[_0x7304('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index fc78b68..c20a1eb 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 _0x94f5=['save','remove','update','emit','removeListener','register','length','voiceExtension:','./voiceExtension.events'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x94f5,0x1af));var _0x594f=function(_0x14f666,_0x1365b2){_0x14f666=_0x14f666-0x0;var _0x16a98a=_0x94f5[_0x14f666];return _0x16a98a;};'use strict';var VoiceExtensionEvents=require(_0x594f('0x0'));var events=[_0x594f('0x1'),_0x594f('0x2'),_0x594f('0x3')];function createListener(_0x3471b4,_0x2f04bd){return function(_0xfb9121){_0x2f04bd[_0x594f('0x4')](_0x3471b4,_0xfb9121);};}function removeListener(_0x29007a,_0x3665d8){return function(){VoiceExtensionEvents[_0x594f('0x5')](_0x29007a,_0x3665d8);};}exports[_0x594f('0x6')]=function(_0x4b0c49){for(var _0xe4589b=0x0,_0x542615=events[_0x594f('0x7')];_0xe4589b<_0x542615;_0xe4589b++){var _0x19072c=events[_0xe4589b];var _0x27d1ce=createListener(_0x594f('0x8')+_0x19072c,_0x4b0c49);VoiceExtensionEvents['on'](_0x19072c,_0x27d1ce);}}; \ No newline at end of file +var _0x3de5=['remove','removeListener','length','voiceExtension:','save'];(function(_0x79d45f,_0x342f62){var _0x3796a2=function(_0x5a55ae){while(--_0x5a55ae){_0x79d45f['push'](_0x79d45f['shift']());}};_0x3796a2(++_0x342f62);}(_0x3de5,0x180));var _0x53de=function(_0x2dea22,_0x10d1c3){_0x2dea22=_0x2dea22-0x0;var _0x2ad44a=_0x3de5[_0x2dea22];return _0x2ad44a;};'use strict';var VoiceExtensionEvents=require('./voiceExtension.events');var events=[_0x53de('0x0'),_0x53de('0x1'),'update'];function createListener(_0x54dc40,_0x16b644){return function(_0x27050c){_0x16b644['emit'](_0x54dc40,_0x27050c);};}function removeListener(_0xc88e0,_0x8af10b){return function(){VoiceExtensionEvents[_0x53de('0x2')](_0xc88e0,_0x8af10b);};}exports['register']=function(_0x410477){for(var _0xc373ed=0x0,_0x178ef9=events[_0x53de('0x3')];_0xc373ed<_0x178ef9;_0xc373ed++){var _0x416619=events[_0xc373ed];var _0x175329=createListener(_0x53de('0x4')+_0x416619,_0x410477);VoiceExtensionEvents['on'](_0x416619,_0x175329);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index c77243c..d03cc48 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 _0x8a5e=['../../components/interaction/service','./voiceMail.controller','isAuthenticated','get','/:id','show','/:id/messages','create','delete','exports','multer','path','connect-timeout'];(function(_0x3cb6dc,_0x120dd3){var _0x47ec89=function(_0x55150a){while(--_0x55150a){_0x3cb6dc['push'](_0x3cb6dc['shift']());}};_0x47ec89(++_0x120dd3);}(_0x8a5e,0xc0));var _0xe8a5=function(_0x17a129,_0x2372d9){_0x17a129=_0x17a129-0x0;var _0x265729=_0x8a5e[_0x17a129];return _0x265729;};'use strict';var multer=require(_0xe8a5('0x0'));var util=require('util');var path=require(_0xe8a5('0x1'));var timeout=require(_0xe8a5('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xe8a5('0x3'));var config=require('../../config/environment');var controller=require(_0xe8a5('0x4'));router['get']('/',auth[_0xe8a5('0x5')](),controller['index']);router[_0xe8a5('0x6')](_0xe8a5('0x7'),auth[_0xe8a5('0x5')](),controller[_0xe8a5('0x8')]);router[_0xe8a5('0x6')](_0xe8a5('0x9'),auth[_0xe8a5('0x5')](),controller['getMessages']);router['post']('/',auth[_0xe8a5('0x5')](),controller[_0xe8a5('0xa')]);router['put'](_0xe8a5('0x7'),auth[_0xe8a5('0x5')](),controller['update']);router[_0xe8a5('0xb')](_0xe8a5('0x7'),auth[_0xe8a5('0x5')](),controller['destroy']);module[_0xe8a5('0xc')]=router; \ No newline at end of file +var _0x5099=['../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','/:id/messages','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x1fdb40,_0x51351c){var _0x281f93=function(_0x35eebe){while(--_0x35eebe){_0x1fdb40['push'](_0x1fdb40['shift']());}};_0x281f93(++_0x51351c);}(_0x5099,0x15f));var _0x9509=function(_0x5de2f5,_0x503767){_0x5de2f5=_0x5de2f5-0x0;var _0x2aff2d=_0x5099[_0x5de2f5];return _0x2aff2d;};'use strict';var multer=require(_0x9509('0x0'));var util=require(_0x9509('0x1'));var path=require(_0x9509('0x2'));var timeout=require(_0x9509('0x3'));var express=require('express');var router=express[_0x9509('0x4')]();var auth=require(_0x9509('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x9509('0x6'));var controller=require(_0x9509('0x7'));router[_0x9509('0x8')]('/',auth[_0x9509('0x9')](),controller[_0x9509('0xa')]);router[_0x9509('0x8')](_0x9509('0xb'),auth['isAuthenticated'](),controller[_0x9509('0xc')]);router[_0x9509('0x8')](_0x9509('0xd'),auth[_0x9509('0x9')](),controller['getMessages']);router[_0x9509('0xe')]('/',auth[_0x9509('0x9')](),controller[_0x9509('0xf')]);router[_0x9509('0x10')](_0x9509('0xb'),auth[_0x9509('0x9')](),controller[_0x9509('0x11')]);router[_0x9509('0x12')](_0x9509('0xb'),auth[_0x9509('0x9')](),controller[_0x9509('0x13')]);module[_0x9509('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 79ac87c..ec2f12f 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 _0xd7d1=['\x20-\x20','getDataValue','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL'];(function(_0x2d89ce,_0x24d58d){var _0x3fad10=function(_0xad0ec){while(--_0xad0ec){_0x2d89ce['push'](_0x2d89ce['shift']());}};_0x3fad10(++_0x24d58d);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x9bfa61,_0x5d511d){_0x9bfa61=_0x9bfa61-0x0;var _0x1dd2d3=_0xd7d1[_0x9bfa61];return _0x1dd2d3;};'use strict';var Sequelize=require(_0x1d7d('0x0'));module[_0x1d7d('0x1')]={'customer_id':{'type':Sequelize[_0x1d7d('0x2')]},'context':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':_0x1d7d('0x3'),'unique':_0x1d7d('0x4')},'mailbox':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':'','allowNull':![],'unique':_0x1d7d('0x4')},'password':{'type':Sequelize[_0x1d7d('0x2')]},'fullname':{'type':Sequelize[_0x1d7d('0x2')]},'email':{'type':Sequelize[_0x1d7d('0x2')],'validate':{'isEmail':!![]},'set':function(_0x1a2564){this[_0x1d7d('0x5')]('email',typeof _0x1a2564===_0x1d7d('0x6')&&_0x1a2564[_0x1d7d('0x7')]()?_0x1a2564[_0x1d7d('0x7')]():null);}},'pager':{'type':Sequelize[_0x1d7d('0x2')]},'tz':{'type':Sequelize[_0x1d7d('0x2')],'defaultValue':_0x1d7d('0x8')},'attach':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'saycid':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x1d7d('0x2')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x1d7d('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x1d7d('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'forcename':{'type':Sequelize[_0x1d7d('0x9')]('yes','no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x1d7d('0x9')](_0x1d7d('0xa'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x1d7d('0xa'),'no'),'defaultValue':_0x1d7d('0xa'),'allowNull':![]},'stamp':{'type':_0x1d7d('0xc')},'emailsubject':{'type':Sequelize[_0x1d7d('0x2')]},'emailbody':{'type':Sequelize[_0x1d7d('0x2')]},'maxsecs':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x1d7d('0xd')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x1d7d('0xe')],'get':function(){return this['getDataValue']('fullname')+_0x1d7d('0xf')+this[_0x1d7d('0x10')](_0x1d7d('0x11'));}}}; \ No newline at end of file +var _0x4213=['trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x17a647,_0x2bbe12){var _0x219a38=function(_0x131c5d){while(--_0x131c5d){_0x17a647['push'](_0x17a647['shift']());}};_0x219a38(++_0x2bbe12);}(_0x4213,0x77));var _0x3421=function(_0x143efd,_0x1e0284){_0x143efd=_0x143efd-0x0;var _0x4204d1=_0x4213[_0x143efd];return _0x4204d1;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'customer_id':{'type':Sequelize[_0x3421('0x2')]},'context':{'type':Sequelize[_0x3421('0x2')],'defaultValue':_0x3421('0x3'),'unique':_0x3421('0x4')},'mailbox':{'type':Sequelize[_0x3421('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x3421('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3421('0x2')],'validate':{'isEmail':!![]},'set':function(_0xfe969c){this[_0x3421('0x5')](_0x3421('0x6'),typeof _0xfe969c==='string'&&_0xfe969c[_0x3421('0x7')]()?_0xfe969c[_0x3421('0x7')]():null);}},'pager':{'type':Sequelize[_0x3421('0x2')]},'tz':{'type':Sequelize[_0x3421('0x2')],'defaultValue':_0x3421('0x8')},'attach':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x3421('0x2')]},'callback':{'type':Sequelize[_0x3421('0x2')]},'review':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3421('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3421('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':_0x3421('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x3421('0x2')]},'emailbody':{'type':Sequelize[_0x3421('0x2')]},'maxsecs':{'type':Sequelize[_0x3421('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3421('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3421('0xd')],'get':function(){return this[_0x3421('0xe')](_0x3421('0xf'))+_0x3421('0x10')+this[_0x3421('0xe')](_0x3421('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 0943496..01f13e7 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 _0xd5b9=['stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','query','filters','model','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','VoiceMail','includeAll','include','catch','show','params','find','create','body','user','role','Voicemails','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','findOne','nolimit','mailbox','VoiceMailMessage','findAndCountAll','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','json','count','offset','limit','status','set','reject','save','update','then','get','UserProfileResource','destroy','end','sendStatus','error'];(function(_0x223ea1,_0xcafd3f){var _0x572e3e=function(_0x52c5e7){while(--_0x52c5e7){_0x223ea1['push'](_0x223ea1['shift']());}};_0x572e3e(++_0xcafd3f);}(_0xd5b9,0xe0));var _0x9d5b=function(_0x2bdfc6,_0x3d55fd){_0x2bdfc6=_0x2bdfc6-0x0;var _0xbb0d10=_0xd5b9[_0x2bdfc6];return _0xbb0d10;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9d5b('0x0'));var rimraf=require(_0x9d5b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x9d5b('0x2'));var rp=require(_0x9d5b('0x3'));var moment=require(_0x9d5b('0x4'));var BPromise=require(_0x9d5b('0x5'));var Mustache=require(_0x9d5b('0x6'));var util=require(_0x9d5b('0x7'));var path=require(_0x9d5b('0x8'));var sox=require(_0x9d5b('0x9'));var csv=require('to-csv');var ejs=require(_0x9d5b('0xa'));var fs=require('fs');var _=require(_0x9d5b('0xb'));var squel=require(_0x9d5b('0xc'));var crypto=require(_0x9d5b('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9d5b('0xe'));var toCsv=require(_0x9d5b('0xf'));var querystring=require(_0x9d5b('0x10'));var Papa=require(_0x9d5b('0x11'));var Redis=require(_0x9d5b('0x12'));var authService=require(_0x9d5b('0x13'));var qs=require(_0x9d5b('0x14'));var as=require(_0x9d5b('0x15'));var hardwareService=require(_0x9d5b('0x16'));var logger=require('../../config/logger')(_0x9d5b('0x17'));var utils=require(_0x9d5b('0x18'));var config=require(_0x9d5b('0x19'));var db=require(_0x9d5b('0x1a'))['db'];function respondWithStatusCode(_0x371074,_0x458292){_0x458292=_0x458292||0xcc;return function(_0x5600a7){if(_0x5600a7){return _0x371074['sendStatus'](_0x458292);}return _0x371074['status'](_0x458292)['end']();};}function respondWithResult(_0x3f687f,_0x1df8ce){_0x1df8ce=_0x1df8ce||0xc8;return function(_0x1ae185){if(_0x1ae185){return _0x3f687f['status'](_0x1df8ce)[_0x9d5b('0x1b')](_0x1ae185);}};}function respondWithFilteredResult(_0x43000a,_0x28a472){return function(_0x46f798){if(_0x46f798){var _0x2d10e3=_0x46f798[_0x9d5b('0x1c')],_0x80bb2e=_0x28a472[_0x9d5b('0x1d')],_0x56cc3c=_0x28a472[_0x9d5b('0x1d')]+_0x28a472[_0x9d5b('0x1e')],_0x11c9fb;if(_0x56cc3c>=_0x2d10e3){_0x56cc3c=_0x2d10e3;_0x11c9fb=0xc8;}else{_0x11c9fb=0xce;}_0x43000a[_0x9d5b('0x1f')](_0x11c9fb);return _0x43000a[_0x9d5b('0x20')]('Content-Range',_0x80bb2e+'-'+_0x56cc3c+'/'+_0x2d10e3)[_0x9d5b('0x1b')](_0x46f798);}return null;};}function patchUpdates(_0x420a50){return function(_0x12ae09){try{jsonpatch['apply'](_0x12ae09,_0x420a50,!![]);}catch(_0x330257){return BPromise[_0x9d5b('0x21')](_0x330257);}return _0x12ae09[_0x9d5b('0x22')]();};}function saveUpdates(_0x5405a4,_0x4a9203){return function(_0x42fbdb){if(_0x42fbdb){return _0x42fbdb[_0x9d5b('0x23')](_0x5405a4)['then'](function(_0x2a6f5a){return _0x2a6f5a;});}return null;};}function removeEntity(_0x5ae53c,_0xb6560e){return function(_0x36bbbd){if(_0x36bbbd){return _0x36bbbd['destroy']()[_0x9d5b('0x24')](function(){var _0x5d8e5a=_0x36bbbd[_0x9d5b('0x25')]({'plain':!![]});var _0x36d282='Voicemails';return db[_0x9d5b('0x26')][_0x9d5b('0x27')]({'where':{'type':_0x36d282,'resourceId':_0x5d8e5a['id']}})[_0x9d5b('0x24')](function(){return _0x36bbbd;});})[_0x9d5b('0x24')](function(){_0x5ae53c[_0x9d5b('0x1f')](0xcc)[_0x9d5b('0x28')]();});}};}function handleEntityNotFound(_0x374fe5,_0x50845e){return function(_0x4fad33){if(!_0x4fad33){_0x374fe5[_0x9d5b('0x29')](0x194);}return _0x4fad33;};}function handleError(_0x5ab7ac,_0x46e10b){_0x46e10b=_0x46e10b||0x1f4;return function(_0x2db9ee){logger[_0x9d5b('0x2a')](_0x2db9ee[_0x9d5b('0x2b')]);if(_0x2db9ee[_0x9d5b('0x2c')]){delete _0x2db9ee[_0x9d5b('0x2c')];}_0x5ab7ac[_0x9d5b('0x1f')](_0x46e10b)[_0x9d5b('0x2d')](_0x2db9ee);};}exports[_0x9d5b('0x2e')]=function(_0x2ddb51,_0x2354c1){var _0x477263={},_0x553aa2={},_0x48cc85={'count':0x0,'rows':[]};var _0xe3dbd0=_[_0x9d5b('0x2f')](db['VoiceMail'][_0x9d5b('0x30')],function(_0x47c7b3){return{'name':_0x47c7b3[_0x9d5b('0x31')],'type':_0x47c7b3[_0x9d5b('0x32')][_0x9d5b('0x33')]};});_0x553aa2['model']=_[_0x9d5b('0x2f')](_0xe3dbd0,_0x9d5b('0x2c'));_0x553aa2['query']=_[_0x9d5b('0x34')](_0x2ddb51[_0x9d5b('0x35')]);_0x553aa2[_0x9d5b('0x36')]=_['intersection'](_0x553aa2[_0x9d5b('0x37')],_0x553aa2[_0x9d5b('0x35')]);_0x477263['attributes']=_[_0x9d5b('0x38')](_0x553aa2[_0x9d5b('0x37')],qs[_0x9d5b('0x39')](_0x2ddb51[_0x9d5b('0x35')][_0x9d5b('0x39')]));_0x477263[_0x9d5b('0x3a')]=_0x477263[_0x9d5b('0x3a')][_0x9d5b('0x3b')]?_0x477263[_0x9d5b('0x3a')]:_0x553aa2[_0x9d5b('0x37')];if(!_0x2ddb51['query'][_0x9d5b('0x3c')]('nolimit')){_0x477263[_0x9d5b('0x1e')]=qs[_0x9d5b('0x1e')](_0x2ddb51[_0x9d5b('0x35')][_0x9d5b('0x1e')]);_0x477263[_0x9d5b('0x1d')]=qs[_0x9d5b('0x1d')](_0x2ddb51[_0x9d5b('0x35')][_0x9d5b('0x1d')]);}_0x477263[_0x9d5b('0x3d')]=qs[_0x9d5b('0x3e')](_0x2ddb51[_0x9d5b('0x35')][_0x9d5b('0x3e')]);_0x477263[_0x9d5b('0x3f')]=qs[_0x9d5b('0x36')](_['pick'](_0x2ddb51['query'],_0x553aa2[_0x9d5b('0x36')]));if(_0x2ddb51[_0x9d5b('0x35')][_0x9d5b('0x40')]){_0x477263[_0x9d5b('0x3f')]=_[_0x9d5b('0x41')](_0x477263['where'],{'$or':_[_0x9d5b('0x2f')](_0xe3dbd0,function(_0x28c49f){if(_0x28c49f[_0x9d5b('0x32')]!==_0x9d5b('0x42')){var _0x7f425d={};_0x7f425d[_0x28c49f['name']]={'$like':'%'+_0x2ddb51[_0x9d5b('0x35')][_0x9d5b('0x40')]+'%'};return _0x7f425d;}})});}_0x477263=_['merge']({},_0x477263,_0x2ddb51[_0x9d5b('0x43')]);var _0x23771b={'where':_0x477263[_0x9d5b('0x3f')]};return db[_0x9d5b('0x44')][_0x9d5b('0x1c')](_0x23771b)[_0x9d5b('0x24')](function(_0x14a873){_0x48cc85[_0x9d5b('0x1c')]=_0x14a873;if(_0x2ddb51[_0x9d5b('0x35')][_0x9d5b('0x45')]){_0x477263[_0x9d5b('0x46')]=[{'all':!![]}];}return db[_0x9d5b('0x44')]['findAll'](_0x477263);})['then'](function(_0x5c9662){_0x48cc85['rows']=_0x5c9662;return _0x48cc85;})['then'](respondWithFilteredResult(_0x2354c1,_0x477263))[_0x9d5b('0x47')](handleError(_0x2354c1,null));};exports[_0x9d5b('0x48')]=function(_0x2ab2eb,_0xb99eff){var _0x22492b={'raw':!![],'where':{'id':_0x2ab2eb[_0x9d5b('0x49')]['id']}},_0x18718a={};_0x18718a[_0x9d5b('0x37')]=_[_0x9d5b('0x34')](db[_0x9d5b('0x44')][_0x9d5b('0x30')]);_0x18718a[_0x9d5b('0x35')]=_['keys'](_0x2ab2eb['query']);_0x18718a[_0x9d5b('0x36')]=_[_0x9d5b('0x38')](_0x18718a[_0x9d5b('0x37')],_0x18718a[_0x9d5b('0x35')]);_0x22492b['attributes']=_['intersection'](_0x18718a['model'],qs['fields'](_0x2ab2eb[_0x9d5b('0x35')][_0x9d5b('0x39')]));_0x22492b[_0x9d5b('0x3a')]=_0x22492b['attributes']['length']?_0x22492b['attributes']:_0x18718a['model'];if(_0x2ab2eb[_0x9d5b('0x35')][_0x9d5b('0x45')]){_0x22492b['include']=[{'all':!![]}];}_0x22492b=_[_0x9d5b('0x41')]({},_0x22492b,_0x2ab2eb[_0x9d5b('0x43')]);return db[_0x9d5b('0x44')][_0x9d5b('0x4a')](_0x22492b)['then'](handleEntityNotFound(_0xb99eff,null))[_0x9d5b('0x24')](respondWithResult(_0xb99eff,null))[_0x9d5b('0x47')](handleError(_0xb99eff,null));};exports['create']=function(_0x5c176d,_0xde68b8){return db[_0x9d5b('0x44')][_0x9d5b('0x4b')](_0x5c176d[_0x9d5b('0x4c')],{})['then'](function(_0x2df9b3){var _0x3bfce0=_0x5c176d[_0x9d5b('0x4d')][_0x9d5b('0x25')]({'plain':!![]});if(!_0x3bfce0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3bfce0[_0x9d5b('0x4e')]===_0x9d5b('0x4d')){var _0x3c005a=_0x2df9b3[_0x9d5b('0x25')]({'plain':!![]});var _0x110789=_0x9d5b('0x4f');return db[_0x9d5b('0x50')][_0x9d5b('0x4a')]({'where':{'name':_0x110789,'userProfileId':_0x3bfce0['userProfileId']},'raw':!![]})['then'](function(_0x3a6dcf){if(_0x3a6dcf&&_0x3a6dcf[_0x9d5b('0x51')]===0x0){return db[_0x9d5b('0x26')][_0x9d5b('0x4b')]({'name':_0x3c005a[_0x9d5b('0x2c')],'resourceId':_0x3c005a['id'],'type':_0x3a6dcf[_0x9d5b('0x2c')],'sectionId':_0x3a6dcf['id']},{})[_0x9d5b('0x24')](function(){return _0x2df9b3;});}else{return _0x2df9b3;}})[_0x9d5b('0x47')](function(_0x238b2e){logger[_0x9d5b('0x2a')](_0x9d5b('0x52'),_0x238b2e);throw _0x238b2e;});}return _0x2df9b3;})[_0x9d5b('0x24')](respondWithResult(_0xde68b8,0xc9))['catch'](handleError(_0xde68b8,null));};exports['update']=function(_0x868ed,_0x1f728f){if(_0x868ed['body']['id']){delete _0x868ed[_0x9d5b('0x4c')]['id'];}return db[_0x9d5b('0x44')][_0x9d5b('0x4a')]({'where':{'id':_0x868ed[_0x9d5b('0x49')]['id']}})[_0x9d5b('0x24')](handleEntityNotFound(_0x1f728f,null))[_0x9d5b('0x24')](saveUpdates(_0x868ed[_0x9d5b('0x4c')],null))[_0x9d5b('0x24')](respondWithResult(_0x1f728f,null))[_0x9d5b('0x47')](handleError(_0x1f728f,null));};exports[_0x9d5b('0x27')]=function(_0x3f3aea,_0x524e28){return db[_0x9d5b('0x44')][_0x9d5b('0x4a')]({'where':{'id':_0x3f3aea[_0x9d5b('0x49')]['id']}})['then'](handleEntityNotFound(_0x524e28,null))[_0x9d5b('0x24')](removeEntity(_0x524e28,null))[_0x9d5b('0x47')](handleError(_0x524e28,null));};exports[_0x9d5b('0x53')]=function(_0x59215d,_0x500fa3,_0x43b743){return db['VoiceMail'][_0x9d5b('0x54')]({'where':{'id':_0x59215d[_0x9d5b('0x49')]['id']}})[_0x9d5b('0x24')](handleEntityNotFound(_0x500fa3,null))['then'](function(_0x1d060b){var _0x546639;var _0x83fb36={},_0x227e57={};_0x227e57[_0x9d5b('0x37')]=_[_0x9d5b('0x34')](db['VoiceMailMessage'][_0x9d5b('0x30')]);_0x227e57[_0x9d5b('0x35')]=_['keys'](_0x59215d[_0x9d5b('0x35')]);_0x227e57[_0x9d5b('0x36')]=_[_0x9d5b('0x38')](_0x227e57[_0x9d5b('0x37')],_0x227e57['query']);_0x83fb36[_0x9d5b('0x3a')]=_[_0x9d5b('0x38')](_0x227e57[_0x9d5b('0x37')],qs['fields'](_0x59215d[_0x9d5b('0x35')]['fields']));_0x83fb36[_0x9d5b('0x3a')]=_0x83fb36[_0x9d5b('0x3a')][_0x9d5b('0x3b')]?_0x83fb36[_0x9d5b('0x3a')]:_0x227e57[_0x9d5b('0x37')];if(!_0x59215d[_0x9d5b('0x35')][_0x9d5b('0x3c')](_0x9d5b('0x55'))){_0x83fb36[_0x9d5b('0x1e')]=qs[_0x9d5b('0x1e')](_0x59215d[_0x9d5b('0x35')][_0x9d5b('0x1e')]);_0x83fb36[_0x9d5b('0x1d')]=qs[_0x9d5b('0x1d')](_0x59215d[_0x9d5b('0x35')][_0x9d5b('0x1d')]);}_0x83fb36[_0x9d5b('0x3d')]=qs[_0x9d5b('0x3e')](_0x59215d['query'][_0x9d5b('0x3e')]);_0x83fb36[_0x9d5b('0x3f')]=qs['filters'](_['pick'](_0x59215d[_0x9d5b('0x35')],_0x227e57['filters']));if(_0x59215d['query'][_0x9d5b('0x40')]){_0x83fb36[_0x9d5b('0x3f')]=_[_0x9d5b('0x41')](_0x83fb36[_0x9d5b('0x3f')],{'$or':_['map'](_0x83fb36['attributes'],function(_0x4677d2){var _0xf4f389={};_0xf4f389[_0x4677d2]={'$like':'%'+_0x59215d['query'][_0x9d5b('0x40')]+'%'};return _0xf4f389;})});}_0x83fb36[_0x9d5b('0x3f')]=_[_0x9d5b('0x41')](_0x83fb36[_0x9d5b('0x3f')],{'mailboxuser':_0x1d060b[_0x9d5b('0x56')]});_0x83fb36=_[_0x9d5b('0x41')]({},_0x83fb36,_0x59215d['options']);return db[_0x9d5b('0x57')][_0x9d5b('0x58')](_0x83fb36)[_0x9d5b('0x24')](respondWithFilteredResult(_0x500fa3,_0x83fb36));})['catch'](handleError(_0x500fa3,null));}; \ No newline at end of file +var _0xb8fb=['zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','end','status','json','count','limit','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMail','includeAll','include','findAll','rows','catch','params','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','getMessages','VoiceMailMessage','findAndCountAll','html-pdf','eml-format'];(function(_0x39352,_0x262006){var _0x50c4f8=function(_0x228947){while(--_0x228947){_0x39352['push'](_0x39352['shift']());}};_0x50c4f8(++_0x262006);}(_0xb8fb,0xa4));var _0xbb8f=function(_0x4a878b,_0x47078d){_0x4a878b=_0x4a878b-0x0;var _0x13d337=_0xb8fb[_0x4a878b];return _0x13d337;};'use strict';var pdf=require(_0xbb8f('0x0'));var emlformat=require(_0xbb8f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xbb8f('0x2'));var jsonpatch=require(_0xbb8f('0x3'));var rp=require(_0xbb8f('0x4'));var moment=require(_0xbb8f('0x5'));var BPromise=require(_0xbb8f('0x6'));var Mustache=require(_0xbb8f('0x7'));var util=require(_0xbb8f('0x8'));var path=require(_0xbb8f('0x9'));var sox=require('sox');var csv=require(_0xbb8f('0xa'));var ejs=require(_0xbb8f('0xb'));var fs=require('fs');var _=require(_0xbb8f('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xbb8f('0xd'));var deskjs=require(_0xbb8f('0xe'));var toCsv=require(_0xbb8f('0xa'));var querystring=require(_0xbb8f('0xf'));var Papa=require(_0xbb8f('0x10'));var Redis=require(_0xbb8f('0x11'));var authService=require(_0xbb8f('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb8f('0x13'));var logger=require(_0xbb8f('0x14'))(_0xbb8f('0x15'));var utils=require(_0xbb8f('0x16'));var config=require(_0xbb8f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x51451f,_0x17dc8e){_0x17dc8e=_0x17dc8e||0xcc;return function(_0xd1ed57){if(_0xd1ed57){return _0x51451f['sendStatus'](_0x17dc8e);}return _0x51451f['status'](_0x17dc8e)[_0xbb8f('0x18')]();};}function respondWithResult(_0x4cac51,_0x580e59){_0x580e59=_0x580e59||0xc8;return function(_0x27dfc7){if(_0x27dfc7){return _0x4cac51[_0xbb8f('0x19')](_0x580e59)[_0xbb8f('0x1a')](_0x27dfc7);}};}function respondWithFilteredResult(_0x348d5c,_0x3b1319){return function(_0xcb28dc){if(_0xcb28dc){var _0x3d8bf9=_0xcb28dc[_0xbb8f('0x1b')],_0x59a50b=_0x3b1319['offset'],_0x1e4528=_0x3b1319['offset']+_0x3b1319[_0xbb8f('0x1c')],_0xef0652;if(_0x1e4528>=_0x3d8bf9){_0x1e4528=_0x3d8bf9;_0xef0652=0xc8;}else{_0xef0652=0xce;}_0x348d5c['status'](_0xef0652);return _0x348d5c['set'](_0xbb8f('0x1d'),_0x59a50b+'-'+_0x1e4528+'/'+_0x3d8bf9)[_0xbb8f('0x1a')](_0xcb28dc);}return null;};}function patchUpdates(_0x52521f){return function(_0x4e1e0b){try{jsonpatch[_0xbb8f('0x1e')](_0x4e1e0b,_0x52521f,!![]);}catch(_0x2aec50){return BPromise[_0xbb8f('0x1f')](_0x2aec50);}return _0x4e1e0b[_0xbb8f('0x20')]();};}function saveUpdates(_0x2171bb,_0x17af11){return function(_0xe44ce6){if(_0xe44ce6){return _0xe44ce6[_0xbb8f('0x21')](_0x2171bb)[_0xbb8f('0x22')](function(_0x11724d){return _0x11724d;});}return null;};}function removeEntity(_0xa06980,_0x168cc9){return function(_0x3694e6){if(_0x3694e6){return _0x3694e6[_0xbb8f('0x23')]()[_0xbb8f('0x22')](function(){var _0x4019d8=_0x3694e6[_0xbb8f('0x24')]({'plain':!![]});var _0x1ed971='Voicemails';return db[_0xbb8f('0x25')][_0xbb8f('0x23')]({'where':{'type':_0x1ed971,'resourceId':_0x4019d8['id']}})[_0xbb8f('0x22')](function(){return _0x3694e6;});})['then'](function(){_0xa06980['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xf9413a,_0x383c4e){return function(_0x3ea918){if(!_0x3ea918){_0xf9413a['sendStatus'](0x194);}return _0x3ea918;};}function handleError(_0x4cb75a,_0x38f7a5){_0x38f7a5=_0x38f7a5||0x1f4;return function(_0xa301b3){logger[_0xbb8f('0x26')](_0xa301b3[_0xbb8f('0x27')]);if(_0xa301b3[_0xbb8f('0x28')]){delete _0xa301b3[_0xbb8f('0x28')];}_0x4cb75a[_0xbb8f('0x19')](_0x38f7a5)['send'](_0xa301b3);};}exports[_0xbb8f('0x29')]=function(_0x111ba3,_0x5382a1){var _0x5101a1={},_0x28220e={},_0x258020={'count':0x0,'rows':[]};var _0x271c84=_[_0xbb8f('0x2a')](db['VoiceMail'][_0xbb8f('0x2b')],function(_0x18d24f){return{'name':_0x18d24f[_0xbb8f('0x2c')],'type':_0x18d24f['type']['key']};});_0x28220e[_0xbb8f('0x2d')]=_['map'](_0x271c84,_0xbb8f('0x28'));_0x28220e[_0xbb8f('0x2e')]=_[_0xbb8f('0x2f')](_0x111ba3['query']);_0x28220e[_0xbb8f('0x30')]=_[_0xbb8f('0x31')](_0x28220e[_0xbb8f('0x2d')],_0x28220e['query']);_0x5101a1['attributes']=_[_0xbb8f('0x31')](_0x28220e[_0xbb8f('0x2d')],qs[_0xbb8f('0x32')](_0x111ba3[_0xbb8f('0x2e')][_0xbb8f('0x32')]));_0x5101a1[_0xbb8f('0x33')]=_0x5101a1[_0xbb8f('0x33')]['length']?_0x5101a1['attributes']:_0x28220e[_0xbb8f('0x2d')];if(!_0x111ba3[_0xbb8f('0x2e')][_0xbb8f('0x34')](_0xbb8f('0x35'))){_0x5101a1[_0xbb8f('0x1c')]=qs['limit'](_0x111ba3['query']['limit']);_0x5101a1[_0xbb8f('0x36')]=qs[_0xbb8f('0x36')](_0x111ba3['query'][_0xbb8f('0x36')]);}_0x5101a1[_0xbb8f('0x37')]=qs[_0xbb8f('0x38')](_0x111ba3['query'][_0xbb8f('0x38')]);_0x5101a1[_0xbb8f('0x39')]=qs[_0xbb8f('0x30')](_[_0xbb8f('0x3a')](_0x111ba3[_0xbb8f('0x2e')],_0x28220e[_0xbb8f('0x30')]));if(_0x111ba3[_0xbb8f('0x2e')][_0xbb8f('0x3b')]){_0x5101a1[_0xbb8f('0x39')]=_[_0xbb8f('0x3c')](_0x5101a1[_0xbb8f('0x39')],{'$or':_['map'](_0x271c84,function(_0xd6ef74){if(_0xd6ef74['type']!==_0xbb8f('0x3d')){var _0x3735a0={};_0x3735a0[_0xd6ef74[_0xbb8f('0x28')]]={'$like':'%'+_0x111ba3[_0xbb8f('0x2e')]['filter']+'%'};return _0x3735a0;}})});}_0x5101a1=_[_0xbb8f('0x3c')]({},_0x5101a1,_0x111ba3[_0xbb8f('0x3e')]);var _0x41d020={'where':_0x5101a1[_0xbb8f('0x39')]};return db[_0xbb8f('0x3f')][_0xbb8f('0x1b')](_0x41d020)[_0xbb8f('0x22')](function(_0x21469e){_0x258020[_0xbb8f('0x1b')]=_0x21469e;if(_0x111ba3[_0xbb8f('0x2e')][_0xbb8f('0x40')]){_0x5101a1[_0xbb8f('0x41')]=[{'all':!![]}];}return db['VoiceMail'][_0xbb8f('0x42')](_0x5101a1);})[_0xbb8f('0x22')](function(_0x279c61){_0x258020[_0xbb8f('0x43')]=_0x279c61;return _0x258020;})[_0xbb8f('0x22')](respondWithFilteredResult(_0x5382a1,_0x5101a1))[_0xbb8f('0x44')](handleError(_0x5382a1,null));};exports['show']=function(_0x426ecc,_0x271ce4){var _0x35d82a={'raw':!![],'where':{'id':_0x426ecc[_0xbb8f('0x45')]['id']}},_0x1f5e2c={};_0x1f5e2c[_0xbb8f('0x2d')]=_[_0xbb8f('0x2f')](db[_0xbb8f('0x3f')][_0xbb8f('0x2b')]);_0x1f5e2c['query']=_['keys'](_0x426ecc['query']);_0x1f5e2c[_0xbb8f('0x30')]=_[_0xbb8f('0x31')](_0x1f5e2c['model'],_0x1f5e2c[_0xbb8f('0x2e')]);_0x35d82a['attributes']=_[_0xbb8f('0x31')](_0x1f5e2c[_0xbb8f('0x2d')],qs[_0xbb8f('0x32')](_0x426ecc[_0xbb8f('0x2e')][_0xbb8f('0x32')]));_0x35d82a[_0xbb8f('0x33')]=_0x35d82a[_0xbb8f('0x33')]['length']?_0x35d82a[_0xbb8f('0x33')]:_0x1f5e2c['model'];if(_0x426ecc[_0xbb8f('0x2e')][_0xbb8f('0x40')]){_0x35d82a['include']=[{'all':!![]}];}_0x35d82a=_[_0xbb8f('0x3c')]({},_0x35d82a,_0x426ecc[_0xbb8f('0x3e')]);return db[_0xbb8f('0x3f')]['find'](_0x35d82a)['then'](handleEntityNotFound(_0x271ce4,null))[_0xbb8f('0x22')](respondWithResult(_0x271ce4,null))[_0xbb8f('0x44')](handleError(_0x271ce4,null));};exports[_0xbb8f('0x46')]=function(_0x206265,_0x15cc32){return db[_0xbb8f('0x3f')][_0xbb8f('0x46')](_0x206265['body'],{})[_0xbb8f('0x22')](function(_0x5d2fca){var _0x3769dc=_0x206265[_0xbb8f('0x47')]['get']({'plain':!![]});if(!_0x3769dc)throw new Error(_0xbb8f('0x48'));if(_0x3769dc[_0xbb8f('0x49')]===_0xbb8f('0x47')){var _0xbcb01f=_0x5d2fca[_0xbb8f('0x24')]({'plain':!![]});var _0x30cc2e='Voicemails';return db[_0xbb8f('0x4a')][_0xbb8f('0x4b')]({'where':{'name':_0x30cc2e,'userProfileId':_0x3769dc[_0xbb8f('0x4c')]},'raw':!![]})[_0xbb8f('0x22')](function(_0x551e4e){if(_0x551e4e&&_0x551e4e[_0xbb8f('0x4d')]===0x0){return db[_0xbb8f('0x25')][_0xbb8f('0x46')]({'name':_0xbcb01f[_0xbb8f('0x28')],'resourceId':_0xbcb01f['id'],'type':_0x551e4e[_0xbb8f('0x28')],'sectionId':_0x551e4e['id']},{})[_0xbb8f('0x22')](function(){return _0x5d2fca;});}else{return _0x5d2fca;}})[_0xbb8f('0x44')](function(_0xa3bd67){logger[_0xbb8f('0x26')](_0xbb8f('0x4e'),_0xa3bd67);throw _0xa3bd67;});}return _0x5d2fca;})[_0xbb8f('0x22')](respondWithResult(_0x15cc32,0xc9))[_0xbb8f('0x44')](handleError(_0x15cc32,null));};exports[_0xbb8f('0x21')]=function(_0x20271a,_0x3c78ad){if(_0x20271a[_0xbb8f('0x4f')]['id']){delete _0x20271a[_0xbb8f('0x4f')]['id'];}return db[_0xbb8f('0x3f')][_0xbb8f('0x4b')]({'where':{'id':_0x20271a['params']['id']}})[_0xbb8f('0x22')](handleEntityNotFound(_0x3c78ad,null))[_0xbb8f('0x22')](saveUpdates(_0x20271a[_0xbb8f('0x4f')],null))['then'](respondWithResult(_0x3c78ad,null))[_0xbb8f('0x44')](handleError(_0x3c78ad,null));};exports[_0xbb8f('0x23')]=function(_0x53c95f,_0x35839c){return db['VoiceMail']['find']({'where':{'id':_0x53c95f['params']['id']}})[_0xbb8f('0x22')](handleEntityNotFound(_0x35839c,null))[_0xbb8f('0x22')](removeEntity(_0x35839c,null))[_0xbb8f('0x44')](handleError(_0x35839c,null));};exports[_0xbb8f('0x50')]=function(_0x3022bb,_0x498acb,_0x244bc4){return db[_0xbb8f('0x3f')]['findOne']({'where':{'id':_0x3022bb[_0xbb8f('0x45')]['id']}})[_0xbb8f('0x22')](handleEntityNotFound(_0x498acb,null))['then'](function(_0x20e5fb){var _0x49f36a;var _0x57cb63={},_0x11d1b1={};_0x11d1b1[_0xbb8f('0x2d')]=_['keys'](db[_0xbb8f('0x51')]['rawAttributes']);_0x11d1b1[_0xbb8f('0x2e')]=_[_0xbb8f('0x2f')](_0x3022bb['query']);_0x11d1b1['filters']=_[_0xbb8f('0x31')](_0x11d1b1[_0xbb8f('0x2d')],_0x11d1b1['query']);_0x57cb63[_0xbb8f('0x33')]=_[_0xbb8f('0x31')](_0x11d1b1[_0xbb8f('0x2d')],qs[_0xbb8f('0x32')](_0x3022bb['query'][_0xbb8f('0x32')]));_0x57cb63[_0xbb8f('0x33')]=_0x57cb63['attributes']['length']?_0x57cb63['attributes']:_0x11d1b1[_0xbb8f('0x2d')];if(!_0x3022bb['query'][_0xbb8f('0x34')]('nolimit')){_0x57cb63[_0xbb8f('0x1c')]=qs[_0xbb8f('0x1c')](_0x3022bb[_0xbb8f('0x2e')][_0xbb8f('0x1c')]);_0x57cb63[_0xbb8f('0x36')]=qs[_0xbb8f('0x36')](_0x3022bb['query'][_0xbb8f('0x36')]);}_0x57cb63[_0xbb8f('0x37')]=qs[_0xbb8f('0x38')](_0x3022bb[_0xbb8f('0x2e')][_0xbb8f('0x38')]);_0x57cb63[_0xbb8f('0x39')]=qs['filters'](_[_0xbb8f('0x3a')](_0x3022bb[_0xbb8f('0x2e')],_0x11d1b1[_0xbb8f('0x30')]));if(_0x3022bb['query']['filter']){_0x57cb63[_0xbb8f('0x39')]=_[_0xbb8f('0x3c')](_0x57cb63[_0xbb8f('0x39')],{'$or':_[_0xbb8f('0x2a')](_0x57cb63[_0xbb8f('0x33')],function(_0x4fc9d7){var _0xd76966={};_0xd76966[_0x4fc9d7]={'$like':'%'+_0x3022bb[_0xbb8f('0x2e')][_0xbb8f('0x3b')]+'%'};return _0xd76966;})});}_0x57cb63[_0xbb8f('0x39')]=_[_0xbb8f('0x3c')](_0x57cb63['where'],{'mailboxuser':_0x20e5fb['mailbox']});_0x57cb63=_[_0xbb8f('0x3c')]({},_0x57cb63,_0x3022bb['options']);return db[_0xbb8f('0x51')][_0xbb8f('0x52')](_0x57cb63)['then'](respondWithFilteredResult(_0x498acb,_0x57cb63));})[_0xbb8f('0x44')](handleError(_0x498acb,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index f2b410c..3d66df7 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 _0x333e=['path','rimraf','./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox','context','lodash','util','moment','bluebird','request-promise'];(function(_0x2412e0,_0x25533a){var _0x43f141=function(_0x2f1d86){while(--_0x2f1d86){_0x2412e0['push'](_0x2412e0['shift']());}};_0x43f141(++_0x25533a);}(_0x333e,0x113));var _0xe333=function(_0x40f0b8,_0x1fec2d){_0x40f0b8=_0x40f0b8-0x0;var _0x13f15d=_0x333e[_0x40f0b8];return _0x13f15d;};'use strict';var _=require(_0xe333('0x0'));var util=require(_0xe333('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xe333('0x2'));var BPromise=require(_0xe333('0x3'));var rp=require(_0xe333('0x4'));var fs=require('fs');var path=require(_0xe333('0x5'));var rimraf=require(_0xe333('0x6'));var config=require('../../config/environment');var attributes=require(_0xe333('0x7'));module[_0xe333('0x8')]=function(_0x2c9650,_0x5a7165){return _0x2c9650[_0xe333('0x9')](_0xe333('0xa'),attributes,{'tableName':_0xe333('0xb'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':[_0xe333('0xc'),_0xe333('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7d90=['./voiceMail.attributes','exports','define','VoiceMail','voice_voicemail','mailbox_context','mailbox','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x39a285,_0x513471){var _0x18d9cf=function(_0x2f5c3a){while(--_0x2f5c3a){_0x39a285['push'](_0x39a285['shift']());}};_0x18d9cf(++_0x513471);}(_0x7d90,0x1ab));var _0x07d9=function(_0x1fc3af,_0x15dc6e){_0x1fc3af=_0x1fc3af-0x0;var _0x5770c1=_0x7d90[_0x1fc3af];return _0x5770c1;};'use strict';var _=require(_0x07d9('0x0'));var util=require(_0x07d9('0x1'));var logger=require(_0x07d9('0x2'))('api');var moment=require(_0x07d9('0x3'));var BPromise=require(_0x07d9('0x4'));var rp=require(_0x07d9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x07d9('0x6'));var config=require(_0x07d9('0x7'));var attributes=require(_0x07d9('0x8'));module[_0x07d9('0x9')]=function(_0x10651e,_0x1ae9ac){return _0x10651e[_0x07d9('0xa')](_0x07d9('0xb'),attributes,{'tableName':_0x07d9('0xc'),'paranoid':![],'indexes':[{'name':_0x07d9('0xd'),'fields':[_0x07d9('0xe'),'context']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index 7addb81..11fe673 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 _0xee9c=['VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent'];(function(_0x329101,_0x1eb476){var _0x1641d6=function(_0x11b80f){while(--_0x11b80f){_0x329101['push'](_0x329101['shift']());}};_0x1641d6(++_0x1eb476);}(_0xee9c,0x19f));var _0xcee9=function(_0x10852d,_0x4cdcc6){_0x10852d=_0x10852d-0x0;var _0x13a8d6=_0xee9c[_0x10852d];return _0x13a8d6;};'use strict';var _=require(_0xcee9('0x0'));var util=require(_0xcee9('0x1'));var moment=require(_0xcee9('0x2'));var BPromise=require(_0xcee9('0x3'));var rs=require(_0xcee9('0x4'));var fs=require('fs');var Redis=require(_0xcee9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xcee9('0x6'));var logger=require(_0xcee9('0x7'))(_0xcee9('0x8'));var config=require(_0xcee9('0x9'));var jayson=require(_0xcee9('0xa'));var client=jayson['client'][_0xcee9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4825f5,_0x290b86,_0x7d4acd){return new BPromise(function(_0x41fc22,_0x3af97e){return client[_0xcee9('0xc')](_0x4825f5,_0x7d4acd)[_0xcee9('0xd')](function(_0x57c402){logger[_0xcee9('0xe')](_0xcee9('0xf'),_0x290b86,_0xcee9('0x10'));logger['debug'](_0xcee9('0x11'),_0x290b86,_0xcee9('0x10'),JSON[_0xcee9('0x12')](_0x57c402));if(_0x57c402[_0xcee9('0x13')]){if(_0x57c402[_0xcee9('0x13')][_0xcee9('0x14')]===0x1f4){logger[_0xcee9('0x13')](_0xcee9('0xf'),_0x290b86,_0x57c402['error'][_0xcee9('0x15')]);return _0x3af97e(_0x57c402[_0xcee9('0x13')][_0xcee9('0x15')]);}logger[_0xcee9('0x13')](_0xcee9('0xf'),_0x290b86,_0x57c402[_0xcee9('0x13')]['message']);return _0x41fc22(_0x57c402[_0xcee9('0x13')]['message']);}else{logger[_0xcee9('0xe')](_0xcee9('0xf'),_0x290b86,_0xcee9('0x10'));_0x41fc22(_0x57c402[_0xcee9('0x16')][_0xcee9('0x15')]);}})[_0xcee9('0x17')](function(_0x5f52b7){logger[_0xcee9('0x13')](_0xcee9('0xf'),_0x290b86,_0x5f52b7);_0x3af97e(_0x5f52b7);});});} \ No newline at end of file +var _0xb80b=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMail,\x20%s,\x20%s','message','result','lodash','bluebird','randomstring','ioredis'];(function(_0x20ef64,_0x4a8fe9){var _0x3707d8=function(_0x5b9a88){while(--_0x5b9a88){_0x20ef64['push'](_0x20ef64['shift']());}};_0x3707d8(++_0x4a8fe9);}(_0xb80b,0x104));var _0xbb80=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xb80b[_0x4565bf];return _0x5610ba;};'use strict';var _=require(_0xbb80('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xbb80('0x1'));var rs=require(_0xbb80('0x2'));var fs=require('fs');var Redis=require(_0xbb80('0x3'));var db=require(_0xbb80('0x4'))['db'];var utils=require(_0xbb80('0x5'));var logger=require(_0xbb80('0x6'))(_0xbb80('0x7'));var config=require('../../config/environment');var jayson=require(_0xbb80('0x8'));var client=jayson[_0xbb80('0x9')][_0xbb80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32cb8a,_0x510231,_0x1a0714){return new BPromise(function(_0x4179d2,_0x54f6f){return client[_0xbb80('0xb')](_0x32cb8a,_0x1a0714)[_0xbb80('0xc')](function(_0x4a6cad){logger[_0xbb80('0xd')]('VoiceMail,\x20%s,\x20%s',_0x510231,_0xbb80('0xe'));logger[_0xbb80('0xf')](_0xbb80('0x10'),_0x510231,_0xbb80('0xe'),JSON[_0xbb80('0x11')](_0x4a6cad));if(_0x4a6cad[_0xbb80('0x12')]){if(_0x4a6cad[_0xbb80('0x12')]['code']===0x1f4){logger[_0xbb80('0x12')](_0xbb80('0x13'),_0x510231,_0x4a6cad[_0xbb80('0x12')]['message']);return _0x54f6f(_0x4a6cad[_0xbb80('0x12')]['message']);}logger[_0xbb80('0x12')]('VoiceMail,\x20%s,\x20%s',_0x510231,_0x4a6cad['error']['message']);return _0x4179d2(_0x4a6cad['error'][_0xbb80('0x14')]);}else{logger[_0xbb80('0xd')](_0xbb80('0x13'),_0x510231,_0xbb80('0xe'));_0x4179d2(_0x4a6cad[_0xbb80('0x15')][_0xbb80('0x14')]);}})['catch'](function(_0x4d1d3b){logger['error'](_0xbb80('0x13'),_0x510231,_0x4d1d3b);_0x54f6f(_0x4d1d3b);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 2e23322..6e90271 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 _0x5fab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','show','download','post','put','/:id','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x5c4d7a,_0x239d40){var _0x586ecc=function(_0xdeb0e){while(--_0xdeb0e){_0x5c4d7a['push'](_0x5c4d7a['shift']());}};_0x586ecc(++_0x239d40);}(_0x5fab,0x177));var _0xb5fa=function(_0x3a99f4,_0x2a81c1){_0x3a99f4=_0x3a99f4-0x0;var _0xea0b42=_0x5fab[_0x3a99f4];return _0xea0b42;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')]('/',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xb')]);router['get']('/:id',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0x9')]('/:id/download',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xd')]);router[_0xb5fa('0xe')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb5fa('0xf')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x11')]);router[_0xb5fa('0x12')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x13')]);module[_0xb5fa('0x14')]=router; \ No newline at end of file +var _0x687b=['../../config/environment','./voiceMailMessage.controller','get','isAuthenticated','index','/:id','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x687b,0x14a));var _0xb687=function(_0x22ac5b,_0x2ef85c){_0x22ac5b=_0x22ac5b-0x0;var _0x4b5cc4=_0x687b[_0x22ac5b];return _0x4b5cc4;};'use strict';var multer=require(_0xb687('0x0'));var util=require(_0xb687('0x1'));var path=require(_0xb687('0x2'));var timeout=require(_0xb687('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb687('0x4'));var interaction=require(_0xb687('0x5'));var config=require(_0xb687('0x6'));var controller=require(_0xb687('0x7'));router[_0xb687('0x8')]('/',auth[_0xb687('0x9')](),controller[_0xb687('0xa')]);router[_0xb687('0x8')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller['show']);router[_0xb687('0x8')](_0xb687('0xc'),auth['isAuthenticated'](),controller[_0xb687('0xd')]);router[_0xb687('0xe')]('/',auth[_0xb687('0x9')](),controller[_0xb687('0xf')]);router[_0xb687('0x10')](_0xb687('0xb'),auth[_0xb687('0x9')](),controller[_0xb687('0x11')]);router[_0xb687('0x12')]('/:id',auth[_0xb687('0x9')](),controller[_0xb687('0x13')]);module[_0xb687('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 9a3889d..4e40948 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 _0x0727=['TIMESTAMP','sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING'];(function(_0x301148,_0x25b884){var _0x42ce24=function(_0x44ba51){while(--_0x44ba51){_0x301148['push'](_0x301148['shift']());}};_0x42ce24(++_0x25b884);}(_0x0727,0x6a));var _0x7072=function(_0x283127,_0x54d4d5){_0x283127=_0x283127-0x0;var _0x43da5d=_0x0727[_0x283127];return _0x43da5d;};'use strict';var Sequelize=require(_0x7072('0x0'));module[_0x7072('0x1')]={'name':{'type':Sequelize[_0x7072('0x2')],'get':function(_0xa72eb5){return this[_0x7072('0x3')]('id');}},'msgnum':{'type':Sequelize[_0x7072('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x7072('0x5')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize[_0x7072('0x5')],'defaultValue':''},'origtime':{'type':Sequelize[_0x7072('0x5')],'defaultValue':''},'duration':{'type':Sequelize[_0x7072('0x5')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x7072('0x5')],'defaultValue':''},'recording':{'type':Sequelize['BLOB']('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x7072('0x5')],'defaultValue':''},'stamp':{'type':_0x7072('0x6'),'allowNull':![]}}; \ No newline at end of file +var _0xbb23=['getDataValue','STRING','BLOB','long','TIMESTAMP','sequelize','exports'];(function(_0x818500,_0xe7620c){var _0x342023=function(_0x17c939){while(--_0x17c939){_0x818500['push'](_0x818500['shift']());}};_0x342023(++_0xe7620c);}(_0xbb23,0x83));var _0x3bb2=function(_0x169c86,_0x367565){_0x169c86=_0x169c86-0x0;var _0x2871f6=_0xbb23[_0x169c86];return _0x2871f6;};'use strict';var Sequelize=require(_0x3bb2('0x0'));module[_0x3bb2('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x4ee378){return this[_0x3bb2('0x2')]('id');}},'msgnum':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3bb2('0x3')],'defaultValue':''},'context':{'type':Sequelize['STRING'],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3bb2('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3bb2('0x3')],'defaultValue':''},'origtime':{'type':Sequelize['STRING'],'defaultValue':''},'duration':{'type':Sequelize[_0x3bb2('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3bb2('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3bb2('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x3bb2('0x4')](_0x3bb2('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x3bb2('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3bb2('0x3')],'defaultValue':''},'stamp':{'type':_0x3bb2('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 fc80b06..fabf1e1 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 _0xaba6=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','save','update','then','destroy','end','error','stack','name','send','map','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceMailMessage','includeAll','include','findAll','show','params','keys','find','create','body','catch','download','recording','msg_id','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','html-pdf','eml-format','moment','bluebird','util','path','lodash','crypto','jsforce','to-csv','querystring'];(function(_0x1dc72f,_0x19fdc7){var _0x4c30bc=function(_0x321930){while(--_0x321930){_0x1dc72f['push'](_0x1dc72f['shift']());}};_0x4c30bc(++_0x19fdc7);}(_0xaba6,0xe2));var _0x6aba=function(_0x3231ee,_0x44e1ef){_0x3231ee=_0x3231ee-0x0;var _0x2092f1=_0xaba6[_0x3231ee];return _0x2092f1;};'use strict';var pdf=require(_0x6aba('0x0'));var emlformat=require(_0x6aba('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6aba('0x2'));var BPromise=require(_0x6aba('0x3'));var Mustache=require('mustache');var util=require(_0x6aba('0x4'));var path=require(_0x6aba('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6aba('0x6'));var squel=require('squel');var crypto=require(_0x6aba('0x7'));var jsforce=require(_0x6aba('0x8'));var deskjs=require('desk.js');var toCsv=require(_0x6aba('0x9'));var querystring=require(_0x6aba('0xa'));var Papa=require('papaparse');var Redis=require(_0x6aba('0xb'));var authService=require(_0x6aba('0xc'));var qs=require(_0x6aba('0xd'));var as=require(_0x6aba('0xe'));var hardwareService=require(_0x6aba('0xf'));var logger=require(_0x6aba('0x10'))(_0x6aba('0x11'));var utils=require('../../config/utils');var config=require(_0x6aba('0x12'));var db=require(_0x6aba('0x13'))['db'];function respondWithStatusCode(_0x43867b,_0x254007){_0x254007=_0x254007||0xcc;return function(_0x53e604){if(_0x53e604){return _0x43867b[_0x6aba('0x14')](_0x254007);}return _0x43867b[_0x6aba('0x15')](_0x254007)['end']();};}function respondWithResult(_0x123575,_0x2934c3){_0x2934c3=_0x2934c3||0xc8;return function(_0x252574){if(_0x252574){return _0x123575['status'](_0x2934c3)[_0x6aba('0x16')](_0x252574);}};}function respondWithFilteredResult(_0x1f3035,_0x15d236){return function(_0x4ae616){if(_0x4ae616){var _0x117235=_0x4ae616[_0x6aba('0x17')],_0xe0c63f=_0x15d236[_0x6aba('0x18')],_0xa3cb32=_0x15d236[_0x6aba('0x18')]+_0x15d236['limit'],_0x21921d;if(_0xa3cb32>=_0x117235){_0xa3cb32=_0x117235;_0x21921d=0xc8;}else{_0x21921d=0xce;}_0x1f3035[_0x6aba('0x15')](_0x21921d);return _0x1f3035[_0x6aba('0x19')](_0x6aba('0x1a'),_0xe0c63f+'-'+_0xa3cb32+'/'+_0x117235)['json'](_0x4ae616);}return null;};}function patchUpdates(_0x1d6ad4){return function(_0x4b0ed4){try{jsonpatch['apply'](_0x4b0ed4,_0x1d6ad4,!![]);}catch(_0x23762e){return BPromise['reject'](_0x23762e);}return _0x4b0ed4[_0x6aba('0x1b')]();};}function saveUpdates(_0x1881ae,_0x37b275){return function(_0xb2f624){if(_0xb2f624){return _0xb2f624[_0x6aba('0x1c')](_0x1881ae)[_0x6aba('0x1d')](function(_0x362a10){return _0x362a10;});}return null;};}function removeEntity(_0x5953f2,_0x2e5f65){return function(_0x41464f){if(_0x41464f){return _0x41464f[_0x6aba('0x1e')]()[_0x6aba('0x1d')](function(){_0x5953f2[_0x6aba('0x15')](0xcc)[_0x6aba('0x1f')]();});}};}function handleEntityNotFound(_0x44f723,_0x67ba6e){return function(_0x2b02c5){if(!_0x2b02c5){_0x44f723[_0x6aba('0x14')](0x194);}return _0x2b02c5;};}function handleError(_0x31ec71,_0x3e18e3){_0x3e18e3=_0x3e18e3||0x1f4;return function(_0x24d1ad){logger[_0x6aba('0x20')](_0x24d1ad[_0x6aba('0x21')]);if(_0x24d1ad[_0x6aba('0x22')]){delete _0x24d1ad[_0x6aba('0x22')];}_0x31ec71[_0x6aba('0x15')](_0x3e18e3)[_0x6aba('0x23')](_0x24d1ad);};}exports['index']=function(_0x50e864,_0x335e82){var _0x5b0845={},_0x30ecf9={},_0x108ff1={'count':0x0,'rows':[]};var _0x3ca593=_[_0x6aba('0x24')](db['VoiceMailMessage'][_0x6aba('0x25')],function(_0x1fcec2){return{'name':_0x1fcec2[_0x6aba('0x26')],'type':_0x1fcec2[_0x6aba('0x27')][_0x6aba('0x28')]};});_0x30ecf9['model']=_[_0x6aba('0x29')](_['map'](_0x3ca593,_0x6aba('0x22')),[_0x6aba('0x22')]);_0x30ecf9['query']=_['keys'](_0x50e864[_0x6aba('0x2a')]);_0x30ecf9[_0x6aba('0x2b')]=_[_0x6aba('0x2c')](_0x30ecf9[_0x6aba('0x2d')],_0x30ecf9[_0x6aba('0x2a')]);_0x5b0845[_0x6aba('0x2e')]=_[_0x6aba('0x2c')](_0x30ecf9['model'],qs[_0x6aba('0x2f')](_0x50e864[_0x6aba('0x2a')][_0x6aba('0x2f')]));_0x5b0845['attributes']=_0x5b0845[_0x6aba('0x2e')][_0x6aba('0x30')]?_0x5b0845[_0x6aba('0x2e')]:_0x30ecf9['model'];if(!_0x50e864[_0x6aba('0x2a')][_0x6aba('0x31')]('nolimit')){_0x5b0845[_0x6aba('0x32')]=qs['limit'](_0x50e864[_0x6aba('0x2a')]['limit']);_0x5b0845[_0x6aba('0x18')]=qs[_0x6aba('0x18')](_0x50e864['query']['offset']);}_0x5b0845[_0x6aba('0x33')]=qs['sort'](_0x50e864[_0x6aba('0x2a')][_0x6aba('0x34')]);_0x5b0845['where']=qs[_0x6aba('0x2b')](_[_0x6aba('0x35')](_0x50e864[_0x6aba('0x2a')],_0x30ecf9[_0x6aba('0x2b')]));if(_0x50e864[_0x6aba('0x2a')][_0x6aba('0x36')]){_0x5b0845[_0x6aba('0x37')]=_['merge'](_0x5b0845['where'],{'$or':_[_0x6aba('0x24')](_0x3ca593,function(_0x4880a3){if(_0x4880a3[_0x6aba('0x27')]!==_0x6aba('0x38')){var _0x3b6276={};_0x3b6276[_0x4880a3['name']]={'$like':'%'+_0x50e864[_0x6aba('0x2a')][_0x6aba('0x36')]+'%'};return _0x3b6276;}})});}_0x5b0845=_[_0x6aba('0x39')]({},_0x5b0845,_0x50e864[_0x6aba('0x3a')]);var _0x1bd3f3={'where':_0x5b0845[_0x6aba('0x37')]};return db[_0x6aba('0x3b')][_0x6aba('0x17')](_0x1bd3f3)[_0x6aba('0x1d')](function(_0x550d00){_0x108ff1[_0x6aba('0x17')]=_0x550d00;if(_0x50e864[_0x6aba('0x2a')][_0x6aba('0x3c')]){_0x5b0845[_0x6aba('0x3d')]=[{'all':!![]}];}return db['VoiceMailMessage'][_0x6aba('0x3e')](_0x5b0845);})['then'](function(_0x34f899){_0x108ff1['rows']=_0x34f899;return _0x108ff1;})['then'](respondWithFilteredResult(_0x335e82,_0x5b0845))['catch'](handleError(_0x335e82,null));};exports[_0x6aba('0x3f')]=function(_0x5a8b22,_0x197f0f){var _0x3263a9={'raw':!![],'where':{'id':_0x5a8b22[_0x6aba('0x40')]['id']}},_0x291983={};_0x291983[_0x6aba('0x2d')]=_[_0x6aba('0x41')](db[_0x6aba('0x3b')]['rawAttributes']);_0x291983[_0x6aba('0x2a')]=_[_0x6aba('0x41')](_0x5a8b22[_0x6aba('0x2a')]);_0x291983['filters']=_['intersection'](_0x291983[_0x6aba('0x2d')],_0x291983[_0x6aba('0x2a')]);_0x3263a9[_0x6aba('0x2e')]=_[_0x6aba('0x2c')](_0x291983[_0x6aba('0x2d')],qs['fields'](_0x5a8b22[_0x6aba('0x2a')][_0x6aba('0x2f')]));_0x3263a9[_0x6aba('0x2e')]=_0x3263a9[_0x6aba('0x2e')][_0x6aba('0x30')]?_0x3263a9[_0x6aba('0x2e')]:_0x291983[_0x6aba('0x2d')];if(_0x5a8b22['query'][_0x6aba('0x3c')]){_0x3263a9[_0x6aba('0x3d')]=[{'all':!![]}];}_0x3263a9=_[_0x6aba('0x39')]({},_0x3263a9,_0x5a8b22[_0x6aba('0x3a')]);return db[_0x6aba('0x3b')][_0x6aba('0x42')](_0x3263a9)['then'](handleEntityNotFound(_0x197f0f,null))[_0x6aba('0x1d')](respondWithResult(_0x197f0f,null))['catch'](handleError(_0x197f0f,null));};exports['create']=function(_0x2609d4,_0x25d6a4){return db[_0x6aba('0x3b')][_0x6aba('0x43')](_0x2609d4[_0x6aba('0x44')],{})[_0x6aba('0x1d')](respondWithResult(_0x25d6a4,0xc9))[_0x6aba('0x45')](handleError(_0x25d6a4,null));};exports[_0x6aba('0x1c')]=function(_0x109b5d,_0x1b0601){if(_0x109b5d['body']['id']){delete _0x109b5d[_0x6aba('0x44')]['id'];}return db[_0x6aba('0x3b')][_0x6aba('0x42')]({'where':{'id':_0x109b5d[_0x6aba('0x40')]['id']}})[_0x6aba('0x1d')](handleEntityNotFound(_0x1b0601,null))[_0x6aba('0x1d')](saveUpdates(_0x109b5d[_0x6aba('0x44')],null))[_0x6aba('0x1d')](respondWithResult(_0x1b0601,null))[_0x6aba('0x45')](handleError(_0x1b0601,null));};exports[_0x6aba('0x1e')]=function(_0x24f87c,_0xd4afa2){return db[_0x6aba('0x3b')]['find']({'where':{'id':_0x24f87c[_0x6aba('0x40')]['id']}})[_0x6aba('0x1d')](handleEntityNotFound(_0xd4afa2,null))[_0x6aba('0x1d')](removeEntity(_0xd4afa2,null))['catch'](handleError(_0xd4afa2,null));};exports[_0x6aba('0x46')]=function(_0x5476ec,_0x56737e,_0x24f0c3){return db[_0x6aba('0x3b')][_0x6aba('0x42')]({'where':{'id':_0x5476ec['params']['id']},'attributes':['id',_0x6aba('0x47'),_0x6aba('0x48')]})[_0x6aba('0x1d')](handleEntityNotFound(_0x56737e,null))[_0x6aba('0x1d')](function(_0x2cd83d){if(_0x2cd83d){if(!_0x2cd83d[_0x6aba('0x47')]){throw new db['Sequelize'][(_0x6aba('0x49'))](_0x6aba('0x4a'));}var _0x48145d={'Content-Type':_0x6aba('0x4b'),'Content-Disposition':_0x6aba('0x4c')};if(_0x2cd83d[_0x6aba('0x48')]){_0x48145d[_0x6aba('0x4d')]=_0x6aba('0x4e')+_0x2cd83d[_0x6aba('0x48')]+'.wav\x22';}_0x56737e['set'](_0x48145d);return _0x56737e[_0x6aba('0x23')](new Buffer(_0x2cd83d[_0x6aba('0x47')]));}})['catch'](handleError(_0x56737e,null));}; \ No newline at end of file +var _0xca9e=['../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','offset','Content-Range','apply','save','then','destroy','stack','name','send','index','map','VoiceMailMessage','rawAttributes','fieldName','differenceBy','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','type','merge','count','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','update','download','recording','Sequelize','VoiceMailMessage\x20not\x20found','audio/wav','Content-Disposition','attachment;\x20filename=\x22','msg_id','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x4f22a3,_0x1c4c7c){var _0x1f7a09=function(_0x13413f){while(--_0x13413f){_0x4f22a3['push'](_0x4f22a3['shift']());}};_0x1f7a09(++_0x1c4c7c);}(_0xca9e,0x136));var _0xeca9=function(_0x162d0a,_0x10f2c4){_0x162d0a=_0x162d0a-0x0;var _0x3d4fe0=_0xca9e[_0x162d0a];return _0x3d4fe0;};'use strict';var pdf=require(_0xeca9('0x0'));var emlformat=require(_0xeca9('0x1'));var rimraf=require(_0xeca9('0x2'));var zipdir=require(_0xeca9('0x3'));var jsonpatch=require(_0xeca9('0x4'));var rp=require(_0xeca9('0x5'));var moment=require(_0xeca9('0x6'));var BPromise=require(_0xeca9('0x7'));var Mustache=require(_0xeca9('0x8'));var util=require(_0xeca9('0x9'));var path=require(_0xeca9('0xa'));var sox=require(_0xeca9('0xb'));var csv=require(_0xeca9('0xc'));var ejs=require(_0xeca9('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0xeca9('0xe'));var crypto=require(_0xeca9('0xf'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xeca9('0xc'));var querystring=require(_0xeca9('0x10'));var Papa=require(_0xeca9('0x11'));var Redis=require('ioredis');var authService=require(_0xeca9('0x12'));var qs=require(_0xeca9('0x13'));var as=require(_0xeca9('0x14'));var hardwareService=require(_0xeca9('0x15'));var logger=require(_0xeca9('0x16'))(_0xeca9('0x17'));var utils=require('../../config/utils');var config=require(_0xeca9('0x18'));var db=require(_0xeca9('0x19'))['db'];function respondWithStatusCode(_0x4f8839,_0x27ca6f){_0x27ca6f=_0x27ca6f||0xcc;return function(_0x4b2ae1){if(_0x4b2ae1){return _0x4f8839[_0xeca9('0x1a')](_0x27ca6f);}return _0x4f8839[_0xeca9('0x1b')](_0x27ca6f)['end']();};}function respondWithResult(_0x3e9377,_0x384ae2){_0x384ae2=_0x384ae2||0xc8;return function(_0x1ba9e9){if(_0x1ba9e9){return _0x3e9377['status'](_0x384ae2)[_0xeca9('0x1c')](_0x1ba9e9);}};}function respondWithFilteredResult(_0x4422a6,_0x910814){return function(_0x6e9fd4){if(_0x6e9fd4){var _0x551393=_0x6e9fd4['count'],_0x520411=_0x910814[_0xeca9('0x1d')],_0x964e05=_0x910814[_0xeca9('0x1d')]+_0x910814['limit'],_0x77cb;if(_0x964e05>=_0x551393){_0x964e05=_0x551393;_0x77cb=0xc8;}else{_0x77cb=0xce;}_0x4422a6['status'](_0x77cb);return _0x4422a6['set'](_0xeca9('0x1e'),_0x520411+'-'+_0x964e05+'/'+_0x551393)[_0xeca9('0x1c')](_0x6e9fd4);}return null;};}function patchUpdates(_0x3525ee){return function(_0x5dde5f){try{jsonpatch[_0xeca9('0x1f')](_0x5dde5f,_0x3525ee,!![]);}catch(_0x5a5c52){return BPromise['reject'](_0x5a5c52);}return _0x5dde5f[_0xeca9('0x20')]();};}function saveUpdates(_0x5df8e9,_0x31720b){return function(_0x1c4dd6){if(_0x1c4dd6){return _0x1c4dd6['update'](_0x5df8e9)[_0xeca9('0x21')](function(_0x356321){return _0x356321;});}return null;};}function removeEntity(_0x55cd76,_0x3647ed){return function(_0x5279d0){if(_0x5279d0){return _0x5279d0[_0xeca9('0x22')]()[_0xeca9('0x21')](function(){_0x55cd76[_0xeca9('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fcfb8,_0x466883){return function(_0x515e63){if(!_0x515e63){_0x3fcfb8[_0xeca9('0x1a')](0x194);}return _0x515e63;};}function handleError(_0x8b7409,_0x2b2c70){_0x2b2c70=_0x2b2c70||0x1f4;return function(_0x26bb0c){logger['error'](_0x26bb0c[_0xeca9('0x23')]);if(_0x26bb0c['name']){delete _0x26bb0c[_0xeca9('0x24')];}_0x8b7409[_0xeca9('0x1b')](_0x2b2c70)[_0xeca9('0x25')](_0x26bb0c);};}exports[_0xeca9('0x26')]=function(_0x25eac6,_0x2f63dc){var _0x85cbd4={},_0x7fcf4b={},_0x467979={'count':0x0,'rows':[]};var _0x271720=_[_0xeca9('0x27')](db[_0xeca9('0x28')][_0xeca9('0x29')],function(_0x1436d0){return{'name':_0x1436d0[_0xeca9('0x2a')],'type':_0x1436d0['type']['key']};});_0x7fcf4b['model']=_[_0xeca9('0x2b')](_['map'](_0x271720,_0xeca9('0x24')),[_0xeca9('0x24')]);_0x7fcf4b[_0xeca9('0x2c')]=_[_0xeca9('0x2d')](_0x25eac6[_0xeca9('0x2c')]);_0x7fcf4b[_0xeca9('0x2e')]=_['intersection'](_0x7fcf4b[_0xeca9('0x2f')],_0x7fcf4b['query']);_0x85cbd4[_0xeca9('0x30')]=_[_0xeca9('0x31')](_0x7fcf4b[_0xeca9('0x2f')],qs['fields'](_0x25eac6[_0xeca9('0x2c')][_0xeca9('0x32')]));_0x85cbd4[_0xeca9('0x30')]=_0x85cbd4[_0xeca9('0x30')]['length']?_0x85cbd4[_0xeca9('0x30')]:_0x7fcf4b['model'];if(!_0x25eac6[_0xeca9('0x2c')][_0xeca9('0x33')](_0xeca9('0x34'))){_0x85cbd4[_0xeca9('0x35')]=qs[_0xeca9('0x35')](_0x25eac6[_0xeca9('0x2c')]['limit']);_0x85cbd4[_0xeca9('0x1d')]=qs[_0xeca9('0x1d')](_0x25eac6[_0xeca9('0x2c')][_0xeca9('0x1d')]);}_0x85cbd4[_0xeca9('0x36')]=qs[_0xeca9('0x37')](_0x25eac6[_0xeca9('0x2c')]['sort']);_0x85cbd4[_0xeca9('0x38')]=qs[_0xeca9('0x2e')](_[_0xeca9('0x39')](_0x25eac6[_0xeca9('0x2c')],_0x7fcf4b[_0xeca9('0x2e')]));if(_0x25eac6[_0xeca9('0x2c')]['filter']){_0x85cbd4[_0xeca9('0x38')]=_['merge'](_0x85cbd4[_0xeca9('0x38')],{'$or':_['map'](_0x271720,function(_0x30d9d4){if(_0x30d9d4[_0xeca9('0x3a')]!=='VIRTUAL'){var _0x3af05f={};_0x3af05f[_0x30d9d4['name']]={'$like':'%'+_0x25eac6[_0xeca9('0x2c')]['filter']+'%'};return _0x3af05f;}})});}_0x85cbd4=_[_0xeca9('0x3b')]({},_0x85cbd4,_0x25eac6['options']);var _0x1bab33={'where':_0x85cbd4[_0xeca9('0x38')]};return db['VoiceMailMessage'][_0xeca9('0x3c')](_0x1bab33)[_0xeca9('0x21')](function(_0x4e8080){_0x467979[_0xeca9('0x3c')]=_0x4e8080;if(_0x25eac6[_0xeca9('0x2c')][_0xeca9('0x3d')]){_0x85cbd4[_0xeca9('0x3e')]=[{'all':!![]}];}return db[_0xeca9('0x28')][_0xeca9('0x3f')](_0x85cbd4);})[_0xeca9('0x21')](function(_0x3f4581){_0x467979[_0xeca9('0x40')]=_0x3f4581;return _0x467979;})['then'](respondWithFilteredResult(_0x2f63dc,_0x85cbd4))[_0xeca9('0x41')](handleError(_0x2f63dc,null));};exports[_0xeca9('0x42')]=function(_0x15ef4e,_0x35ac2f){var _0x118f53={'raw':!![],'where':{'id':_0x15ef4e[_0xeca9('0x43')]['id']}},_0x3798cc={};_0x3798cc['model']=_[_0xeca9('0x2d')](db[_0xeca9('0x28')][_0xeca9('0x29')]);_0x3798cc[_0xeca9('0x2c')]=_[_0xeca9('0x2d')](_0x15ef4e['query']);_0x3798cc[_0xeca9('0x2e')]=_[_0xeca9('0x31')](_0x3798cc[_0xeca9('0x2f')],_0x3798cc[_0xeca9('0x2c')]);_0x118f53['attributes']=_[_0xeca9('0x31')](_0x3798cc[_0xeca9('0x2f')],qs['fields'](_0x15ef4e[_0xeca9('0x2c')][_0xeca9('0x32')]));_0x118f53[_0xeca9('0x30')]=_0x118f53[_0xeca9('0x30')][_0xeca9('0x44')]?_0x118f53[_0xeca9('0x30')]:_0x3798cc[_0xeca9('0x2f')];if(_0x15ef4e[_0xeca9('0x2c')][_0xeca9('0x3d')]){_0x118f53[_0xeca9('0x3e')]=[{'all':!![]}];}_0x118f53=_[_0xeca9('0x3b')]({},_0x118f53,_0x15ef4e[_0xeca9('0x45')]);return db[_0xeca9('0x28')][_0xeca9('0x46')](_0x118f53)[_0xeca9('0x21')](handleEntityNotFound(_0x35ac2f,null))['then'](respondWithResult(_0x35ac2f,null))[_0xeca9('0x41')](handleError(_0x35ac2f,null));};exports[_0xeca9('0x47')]=function(_0x12da50,_0x33515a){return db['VoiceMailMessage'][_0xeca9('0x47')](_0x12da50[_0xeca9('0x48')],{})['then'](respondWithResult(_0x33515a,0xc9))['catch'](handleError(_0x33515a,null));};exports[_0xeca9('0x49')]=function(_0x41be43,_0x31d8d6){if(_0x41be43[_0xeca9('0x48')]['id']){delete _0x41be43['body']['id'];}return db[_0xeca9('0x28')][_0xeca9('0x46')]({'where':{'id':_0x41be43[_0xeca9('0x43')]['id']}})[_0xeca9('0x21')](handleEntityNotFound(_0x31d8d6,null))[_0xeca9('0x21')](saveUpdates(_0x41be43[_0xeca9('0x48')],null))[_0xeca9('0x21')](respondWithResult(_0x31d8d6,null))[_0xeca9('0x41')](handleError(_0x31d8d6,null));};exports[_0xeca9('0x22')]=function(_0x5cb943,_0x5d1a0e){return db[_0xeca9('0x28')][_0xeca9('0x46')]({'where':{'id':_0x5cb943['params']['id']}})[_0xeca9('0x21')](handleEntityNotFound(_0x5d1a0e,null))[_0xeca9('0x21')](removeEntity(_0x5d1a0e,null))[_0xeca9('0x41')](handleError(_0x5d1a0e,null));};exports[_0xeca9('0x4a')]=function(_0x3dca91,_0x377ffc,_0x1b77c1){return db[_0xeca9('0x28')][_0xeca9('0x46')]({'where':{'id':_0x3dca91['params']['id']},'attributes':['id','recording','msg_id']})['then'](handleEntityNotFound(_0x377ffc,null))[_0xeca9('0x21')](function(_0x5cc6de){if(_0x5cc6de){if(!_0x5cc6de[_0xeca9('0x4b')]){throw new db[(_0xeca9('0x4c'))]['ValidationError'](_0xeca9('0x4d'));}var _0x1713df={'Content-Type':_0xeca9('0x4e'),'Content-Disposition':'attachment'};if(_0x5cc6de['msg_id']){_0x1713df[_0xeca9('0x4f')]=_0xeca9('0x50')+_0x5cc6de[_0xeca9('0x51')]+_0xeca9('0x52');}_0x377ffc['set'](_0x1713df);return _0x377ffc[_0xeca9('0x25')](new Buffer(_0x5cc6de[_0xeca9('0x4b')]));}})[_0xeca9('0x41')](handleError(_0x377ffc,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index c391912..824f9b7 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 _0x04c2=['voice_voicemail_messages','dir','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage'];(function(_0x13b3f2,_0x1f230e){var _0x476495=function(_0x34670c){while(--_0x34670c){_0x13b3f2['push'](_0x13b3f2['shift']());}};_0x476495(++_0x1f230e);}(_0x04c2,0x1a2));var _0x204c=function(_0x518635,_0x453393){_0x518635=_0x518635-0x0;var _0x1de62d=_0x04c2[_0x518635];return _0x1de62d;};'use strict';var _=require(_0x204c('0x0'));var util=require(_0x204c('0x1'));var logger=require('../../config/logger')(_0x204c('0x2'));var moment=require(_0x204c('0x3'));var BPromise=require(_0x204c('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x204c('0x5'));var config=require(_0x204c('0x6'));var attributes=require(_0x204c('0x7'));module[_0x204c('0x8')]=function(_0x4efb58,_0x1a85ca){return _0x4efb58[_0x204c('0x9')](_0x204c('0xa'),attributes,{'tableName':_0x204c('0xb'),'paranoid':![],'indexes':[{'name':_0x204c('0xc'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0xee6b=['../../config/logger','api','moment','request-promise','rimraf','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','util'];(function(_0x21efc0,_0x834ae1){var _0x336c4f=function(_0xa40b4b){while(--_0xa40b4b){_0x21efc0['push'](_0x21efc0['shift']());}};_0x336c4f(++_0x834ae1);}(_0xee6b,0xa3));var _0xbee6=function(_0x5b7a4a,_0x54c362){_0x5b7a4a=_0x5b7a4a-0x0;var _0x5feaf9=_0xee6b[_0x5b7a4a];return _0x5feaf9;};'use strict';var _=require(_0xbee6('0x0'));var util=require(_0xbee6('0x1'));var logger=require(_0xbee6('0x2'))(_0xbee6('0x3'));var moment=require(_0xbee6('0x4'));var BPromise=require('bluebird');var rp=require(_0xbee6('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xbee6('0x6'));var config=require('../../config/environment');var attributes=require('./voiceMailMessage.attributes');module[_0xbee6('0x7')]=function(_0x8d9019,_0x3d6ba0){return _0x8d9019['define'](_0xbee6('0x8'),attributes,{'tableName':_0xbee6('0x9'),'paranoid':![],'indexes':[{'name':_0xbee6('0xa'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index 91f6c76..24b94eb 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 _0x2032=['ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','util','moment','bluebird'];(function(_0x3eec01,_0x138f5a){var _0x41af0c=function(_0xbbdcd9){while(--_0xbbdcd9){_0x3eec01['push'](_0x3eec01['shift']());}};_0x41af0c(++_0x138f5a);}(_0x2032,0xd9));var _0x2203=function(_0x1b7f99,_0x54288a){_0x1b7f99=_0x1b7f99-0x0;var _0x304812=_0x2032[_0x1b7f99];return _0x304812;};'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')]('VoiceMailMessage,\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')]('VoiceMailMessage,\x20%s,\x20%s',_0x2676aa,_0x10f055['error']['message']);return _0x2999ed(_0x10f055['error']['message']);}logger[_0x2203('0xe')]('VoiceMailMessage,\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 +var _0x66fa=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','then','info','VoiceMailMessage,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','VoiceMailMessage,\x20%s,\x20%s','message','catch','lodash'];(function(_0x4499ad,_0x4d8994){var _0x579354=function(_0x5e522c){while(--_0x5e522c){_0x4499ad['push'](_0x4499ad['shift']());}};_0x579354(++_0x4d8994);}(_0x66fa,0x117));var _0xa66f=function(_0x22b849,_0x4732c7){_0x22b849=_0x22b849-0x0;var _0x4b6b4c=_0x66fa[_0x22b849];return _0x4b6b4c;};'use strict';var _=require(_0xa66f('0x0'));var util=require(_0xa66f('0x1'));var moment=require('moment');var BPromise=require(_0xa66f('0x2'));var rs=require(_0xa66f('0x3'));var fs=require('fs');var Redis=require(_0xa66f('0x4'));var db=require(_0xa66f('0x5'))['db'];var utils=require(_0xa66f('0x6'));var logger=require(_0xa66f('0x7'))(_0xa66f('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa66f('0x9')][_0xa66f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f0b78,_0x1d02fc,_0x38b58b){return new BPromise(function(_0x5096bf,_0x39c1ef){return client['request'](_0x2f0b78,_0x38b58b)[_0xa66f('0xb')](function(_0x597c7c){logger[_0xa66f('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d02fc,'request\x20sent');logger['debug'](_0xa66f('0xd'),_0x1d02fc,_0xa66f('0xe'),JSON['stringify'](_0x597c7c));if(_0x597c7c[_0xa66f('0xf')]){if(_0x597c7c['error'][_0xa66f('0x10')]===0x1f4){logger['error'](_0xa66f('0x11'),_0x1d02fc,_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);return _0x39c1ef(_0x597c7c['error']['message']);}logger[_0xa66f('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x1d02fc,_0x597c7c['error']['message']);return _0x5096bf(_0x597c7c[_0xa66f('0xf')][_0xa66f('0x12')]);}else{logger[_0xa66f('0xc')](_0xa66f('0x11'),_0x1d02fc,_0xa66f('0xe'));_0x5096bf(_0x597c7c['result']['message']);}})[_0xa66f('0x13')](function(_0x32d338){logger[_0xa66f('0xf')](_0xa66f('0x11'),_0x1d02fc,_0x32d338);_0x39c1ef(_0x32d338);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 5711c9e..c068717 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 _0x3a35=['removeSound','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','isAuthenticated','index','get','show','getSounds','post','create','/:id/sounds','addSound','put','/:id','update','delete','/:id/sounds/:id2'];(function(_0x276c9c,_0x255278){var _0x34bf41=function(_0xc98be6){while(--_0xc98be6){_0x276c9c['push'](_0x276c9c['shift']());}};_0x34bf41(++_0x255278);}(_0x3a35,0x1ce));var _0x53a3=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0x3a35[_0x92c450];return _0x2a9599;};'use strict';var multer=require(_0x53a3('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x53a3('0x1'));var express=require(_0x53a3('0x2'));var router=express[_0x53a3('0x3')]();var auth=require(_0x53a3('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x53a3('0x5'));var controller=require(_0x53a3('0x6'));router['get']('/',auth[_0x53a3('0x7')](),controller[_0x53a3('0x8')]);router[_0x53a3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x53a3('0xa')]);router[_0x53a3('0x9')]('/:id/sounds',auth['isAuthenticated'](),controller[_0x53a3('0xb')]);router[_0x53a3('0xc')]('/',auth[_0x53a3('0x7')](),controller[_0x53a3('0xd')]);router[_0x53a3('0xc')](_0x53a3('0xe'),auth[_0x53a3('0x7')](),controller[_0x53a3('0xf')]);router[_0x53a3('0x10')](_0x53a3('0x11'),auth['isAuthenticated'](),controller[_0x53a3('0x12')]);router[_0x53a3('0x13')](_0x53a3('0x11'),auth[_0x53a3('0x7')](),controller['destroy']);router[_0x53a3('0x13')](_0x53a3('0x14'),auth[_0x53a3('0x7')](),controller[_0x53a3('0x15')]);module[_0x53a3('0x16')]=router; \ No newline at end of file +var _0x76dd=['path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','isAuthenticated','index','/:id','show','post','create','/:id/sounds','put','update','delete','destroy','/:id/sounds/:id2','exports','util'];(function(_0x45d56b,_0x3b99e4){var _0xd62e37=function(_0x12f150){while(--_0x12f150){_0x45d56b['push'](_0x45d56b['shift']());}};_0xd62e37(++_0x3b99e4);}(_0x76dd,0x164));var _0xd76d=function(_0x526c59,_0x59b237){_0x526c59=_0x526c59-0x0;var _0x4aa998=_0x76dd[_0x526c59];return _0x4aa998;};'use strict';var multer=require('multer');var util=require(_0xd76d('0x0'));var path=require(_0xd76d('0x1'));var timeout=require(_0xd76d('0x2'));var express=require('express');var router=express[_0xd76d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd76d('0x4'));var config=require(_0xd76d('0x5'));var controller=require(_0xd76d('0x6'));router[_0xd76d('0x7')]('/',auth[_0xd76d('0x8')](),controller[_0xd76d('0x9')]);router[_0xd76d('0x7')](_0xd76d('0xa'),auth[_0xd76d('0x8')](),controller[_0xd76d('0xb')]);router[_0xd76d('0x7')]('/:id/sounds',auth['isAuthenticated'](),controller['getSounds']);router[_0xd76d('0xc')]('/',auth['isAuthenticated'](),controller[_0xd76d('0xd')]);router[_0xd76d('0xc')](_0xd76d('0xe'),auth[_0xd76d('0x8')](),controller['addSound']);router[_0xd76d('0xf')](_0xd76d('0xa'),auth[_0xd76d('0x8')](),controller[_0xd76d('0x10')]);router[_0xd76d('0x11')](_0xd76d('0xa'),auth[_0xd76d('0x8')](),controller[_0xd76d('0x12')]);router[_0xd76d('0x11')](_0xd76d('0x13'),auth[_0xd76d('0x8')](),controller['removeSound']);module[_0xd76d('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 52ec59d..37681c1 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 _0xfcf7=['TIMESTAMP','sequelize','exports','STRING','name','ENUM','custom','files','quietmp3nb'];(function(_0x160d07,_0x301c33){var _0xebc1a2=function(_0x3aba3d){while(--_0x3aba3d){_0x160d07['push'](_0x160d07['shift']());}};_0xebc1a2(++_0x301c33);}(_0xfcf7,0x106));var _0x7fcf=function(_0x4dc726,_0x49a756){_0x4dc726=_0x4dc726-0x0;var _0x322101=_0xfcf7[_0x4dc726];return _0x322101;};'use strict';var Sequelize=require(_0x7fcf('0x0'));module[_0x7fcf('0x1')]={'name':{'type':Sequelize[_0x7fcf('0x2')],'allowNull':![],'unique':_0x7fcf('0x3')},'mode':{'type':Sequelize[_0x7fcf('0x4')](_0x7fcf('0x5'),_0x7fcf('0x6'),'mp3nb',_0x7fcf('0x7'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x7fcf('0x6')},'directory':{'type':Sequelize['STRING'],'allowNull':!![]},'application':{'type':Sequelize[_0x7fcf('0x2')],'allowNull':!![]},'digit':{'type':Sequelize['STRING'],'allowNull':!![]},'sort':{'type':Sequelize[_0x7fcf('0x2')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize[_0x7fcf('0x2')],'allowNull':!![]},'stamp':{'type':_0x7fcf('0x8')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x2916=['custom','files','mp3nb','quietmp3nb','alpha','TIMESTAMP','BOOLEAN','sequelize','exports','STRING','name','ENUM'];(function(_0x409deb,_0x2b731){var _0x15a4f7=function(_0x556510){while(--_0x556510){_0x409deb['push'](_0x409deb['shift']());}};_0x15a4f7(++_0x2b731);}(_0x2916,0x8b));var _0x6291=function(_0x30b145,_0x5b1406){_0x30b145=_0x30b145-0x0;var _0x5acce4=_0x2916[_0x30b145];return _0x5acce4;};'use strict';var Sequelize=require(_0x6291('0x0'));module[_0x6291('0x1')]={'name':{'type':Sequelize[_0x6291('0x2')],'allowNull':![],'unique':_0x6291('0x3')},'mode':{'type':Sequelize[_0x6291('0x4')](_0x6291('0x5'),_0x6291('0x6'),_0x6291('0x7'),_0x6291('0x8'),'quietmp3','mp3'),'allowNull':!![],'defaultValue':_0x6291('0x6')},'directory':{'type':Sequelize[_0x6291('0x2')],'allowNull':!![]},'application':{'type':Sequelize[_0x6291('0x2')],'allowNull':!![]},'digit':{'type':Sequelize[_0x6291('0x2')],'allowNull':!![]},'sort':{'type':Sequelize[_0x6291('0x2')],'allowNull':!![],'defaultValue':_0x6291('0x9')},'format':{'type':Sequelize[_0x6291('0x2')],'allowNull':!![]},'stamp':{'type':_0x6291('0xa')},'defaultEntry':{'type':Sequelize[_0x6291('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 03ed9ae..2f67a11 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 _0x169b=['limit','set','Content-Range','json','apply','reject','save','update','then','destroy','MusicOnHolds','end','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceMusicOnHold','include','rows','catch','includeAll','body','find','params','create','sequelize','transaction','mode','files','server/files/moh','mkdirSync','directory','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','join','Sequelize','ValidationError','addSound','Sound','findOne','save_name','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','extname','symlinkSync','removeSound','id2','message','order','getSounds','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','count','offset'];(function(_0x304687,_0x475bf4){var _0x48d363=function(_0x3285bd){while(--_0x3285bd){_0x304687['push'](_0x304687['shift']());}};_0x48d363(++_0x475bf4);}(_0x169b,0x19b));var _0xb169=function(_0x1bfbf2,_0x3ff72a){_0x1bfbf2=_0x1bfbf2-0x0;var _0x10c5d9=_0x169b[_0x1bfbf2];return _0x10c5d9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb169('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb169('0x1'));var jsonpatch=require(_0xb169('0x2'));var rp=require('request-promise');var moment=require(_0xb169('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xb169('0x4'));var util=require('util');var path=require(_0xb169('0x5'));var sox=require('sox');var csv=require(_0xb169('0x6'));var ejs=require(_0xb169('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb169('0x8'));var crypto=require(_0xb169('0x9'));var jsforce=require(_0xb169('0xa'));var deskjs=require(_0xb169('0xb'));var toCsv=require(_0xb169('0x6'));var querystring=require(_0xb169('0xc'));var Papa=require(_0xb169('0xd'));var Redis=require(_0xb169('0xe'));var authService=require(_0xb169('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xb169('0x10'));var hardwareService=require(_0xb169('0x11'));var logger=require(_0xb169('0x12'))('api');var utils=require(_0xb169('0x13'));var config=require(_0xb169('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1251be,_0x3d5c48){_0x3d5c48=_0x3d5c48||0xcc;return function(_0x189093){if(_0x189093){return _0x1251be[_0xb169('0x15')](_0x3d5c48);}return _0x1251be[_0xb169('0x16')](_0x3d5c48)['end']();};}function respondWithResult(_0x1be6fb,_0x49c3ca){_0x49c3ca=_0x49c3ca||0xc8;return function(_0x5ccfa7){if(_0x5ccfa7){return _0x1be6fb[_0xb169('0x16')](_0x49c3ca)['json'](_0x5ccfa7);}};}function respondWithFilteredResult(_0x2b2320,_0x353f30){return function(_0x2d83ee){if(_0x2d83ee){var _0x3b80fd=_0x2d83ee[_0xb169('0x17')],_0x56b466=_0x353f30[_0xb169('0x18')],_0xe39f5=_0x353f30[_0xb169('0x18')]+_0x353f30[_0xb169('0x19')],_0x548064;if(_0xe39f5>=_0x3b80fd){_0xe39f5=_0x3b80fd;_0x548064=0xc8;}else{_0x548064=0xce;}_0x2b2320['status'](_0x548064);return _0x2b2320[_0xb169('0x1a')](_0xb169('0x1b'),_0x56b466+'-'+_0xe39f5+'/'+_0x3b80fd)[_0xb169('0x1c')](_0x2d83ee);}return null;};}function patchUpdates(_0x1cba65){return function(_0x5ed860){try{jsonpatch[_0xb169('0x1d')](_0x5ed860,_0x1cba65,!![]);}catch(_0x45e0cd){return BPromise[_0xb169('0x1e')](_0x45e0cd);}return _0x5ed860[_0xb169('0x1f')]();};}function saveUpdates(_0x4ae39e,_0x30fac1){return function(_0x48fed9){if(_0x48fed9){return _0x48fed9[_0xb169('0x20')](_0x4ae39e)[_0xb169('0x21')](function(_0xeeedb6){return _0xeeedb6;});}return null;};}function removeEntity(_0xb21e1,_0xc0abb2){return function(_0x4dc950){if(_0x4dc950){return _0x4dc950[_0xb169('0x22')]()[_0xb169('0x21')](function(){var _0x417daf=_0x4dc950['get']({'plain':!![]});var _0x41be89=_0xb169('0x23');return db['UserProfileResource'][_0xb169('0x22')]({'where':{'type':_0x41be89,'resourceId':_0x417daf['id']}})['then'](function(){return _0x4dc950;});})[_0xb169('0x21')](function(){_0xb21e1[_0xb169('0x16')](0xcc)[_0xb169('0x24')]();});}};}function handleEntityNotFound(_0x308d9b,_0xdcaabc){return function(_0xac2edd){if(!_0xac2edd){_0x308d9b[_0xb169('0x15')](0x194);}return _0xac2edd;};}function handleError(_0x488f3f,_0xaa5d50){_0xaa5d50=_0xaa5d50||0x1f4;return function(_0x3c13be){logger['error'](_0x3c13be['stack']);if(_0x3c13be['name']){delete _0x3c13be[_0xb169('0x25')];}_0x488f3f[_0xb169('0x16')](_0xaa5d50)[_0xb169('0x26')](_0x3c13be);};}exports[_0xb169('0x27')]=function(_0x1456c8,_0x2ee2c3){var _0x49674b={},_0x35f5c9={},_0x2d71e6={'count':0x0,'rows':[]};var _0x208c4c=_[_0xb169('0x28')](db['VoiceMusicOnHold'][_0xb169('0x29')],function(_0xe550f0){return{'name':_0xe550f0['fieldName'],'type':_0xe550f0[_0xb169('0x2a')][_0xb169('0x2b')]};});_0x35f5c9[_0xb169('0x2c')]=_[_0xb169('0x28')](_0x208c4c,_0xb169('0x25'));_0x35f5c9[_0xb169('0x2d')]=_[_0xb169('0x2e')](_0x1456c8[_0xb169('0x2d')]);_0x35f5c9[_0xb169('0x2f')]=_[_0xb169('0x30')](_0x35f5c9[_0xb169('0x2c')],_0x35f5c9[_0xb169('0x2d')]);_0x49674b[_0xb169('0x31')]=_['intersection'](_0x35f5c9[_0xb169('0x2c')],qs[_0xb169('0x32')](_0x1456c8['query'][_0xb169('0x32')]));_0x49674b['attributes']=_0x49674b[_0xb169('0x31')][_0xb169('0x33')]?_0x49674b[_0xb169('0x31')]:_0x35f5c9[_0xb169('0x2c')];if(!_0x1456c8[_0xb169('0x2d')][_0xb169('0x34')](_0xb169('0x35'))){_0x49674b[_0xb169('0x19')]=qs[_0xb169('0x19')](_0x1456c8[_0xb169('0x2d')]['limit']);_0x49674b['offset']=qs[_0xb169('0x18')](_0x1456c8[_0xb169('0x2d')][_0xb169('0x18')]);}_0x49674b['order']=qs[_0xb169('0x36')](_0x1456c8[_0xb169('0x2d')][_0xb169('0x36')]);_0x49674b[_0xb169('0x37')]=qs[_0xb169('0x2f')](_[_0xb169('0x38')](_0x1456c8['query'],_0x35f5c9[_0xb169('0x2f')]));if(_0x1456c8['query'][_0xb169('0x39')]){_0x49674b[_0xb169('0x37')]=_[_0xb169('0x3a')](_0x49674b[_0xb169('0x37')],{'$or':_[_0xb169('0x28')](_0x208c4c,function(_0x9e8c9b){if(_0x9e8c9b[_0xb169('0x2a')]!==_0xb169('0x3b')){var _0x3e6ed7={};_0x3e6ed7[_0x9e8c9b['name']]={'$like':'%'+_0x1456c8['query'][_0xb169('0x39')]+'%'};return _0x3e6ed7;}})});}_0x49674b=_['merge']({},_0x49674b,_0x1456c8[_0xb169('0x3c')]);var _0x5dc14f={'where':_0x49674b[_0xb169('0x37')]};return db[_0xb169('0x3d')][_0xb169('0x17')](_0x5dc14f)[_0xb169('0x21')](function(_0x42ab0e){_0x2d71e6['count']=_0x42ab0e;if(_0x1456c8[_0xb169('0x2d')]['includeAll']){_0x49674b[_0xb169('0x3e')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x49674b);})[_0xb169('0x21')](function(_0x19e268){_0x2d71e6[_0xb169('0x3f')]=_0x19e268;return _0x2d71e6;})[_0xb169('0x21')](respondWithFilteredResult(_0x2ee2c3,_0x49674b))[_0xb169('0x40')](handleError(_0x2ee2c3,null));};exports['show']=function(_0x2b5559,_0x4ba50e){var _0x30e5c2={'raw':![],'where':{'id':_0x2b5559['params']['id']}},_0x15e6e5={};_0x15e6e5[_0xb169('0x2c')]=_[_0xb169('0x2e')](db['VoiceMusicOnHold'][_0xb169('0x29')]);_0x15e6e5[_0xb169('0x2d')]=_[_0xb169('0x2e')](_0x2b5559[_0xb169('0x2d')]);_0x15e6e5[_0xb169('0x2f')]=_['intersection'](_0x15e6e5[_0xb169('0x2c')],_0x15e6e5['query']);_0x30e5c2['attributes']=_[_0xb169('0x30')](_0x15e6e5[_0xb169('0x2c')],qs[_0xb169('0x32')](_0x2b5559[_0xb169('0x2d')][_0xb169('0x32')]));_0x30e5c2[_0xb169('0x31')]=_0x30e5c2[_0xb169('0x31')]['length']?_0x30e5c2[_0xb169('0x31')]:_0x15e6e5[_0xb169('0x2c')];if(_0x2b5559['query'][_0xb169('0x41')]){_0x30e5c2[_0xb169('0x3e')]=[{'all':!![]}];}_0x30e5c2=_['merge']({},_0x30e5c2,_0x2b5559[_0xb169('0x3c')]);return db[_0xb169('0x3d')]['find'](_0x30e5c2)[_0xb169('0x21')](handleEntityNotFound(_0x4ba50e,null))[_0xb169('0x21')](respondWithResult(_0x4ba50e,null))['catch'](handleError(_0x4ba50e,null));};exports[_0xb169('0x20')]=function(_0x317824,_0x50ea4f){if(_0x317824['body']['id']){delete _0x317824[_0xb169('0x42')]['id'];}return db[_0xb169('0x3d')][_0xb169('0x43')]({'where':{'id':_0x317824[_0xb169('0x44')]['id']}})[_0xb169('0x21')](handleEntityNotFound(_0x50ea4f,null))['then'](saveUpdates(_0x317824[_0xb169('0x42')],null))[_0xb169('0x21')](respondWithResult(_0x50ea4f,null))['catch'](handleError(_0x50ea4f,null));};exports[_0xb169('0x45')]=function(_0x34d62d,_0x526692,_0x3b5408){return db[_0xb169('0x46')][_0xb169('0x47')](function(_0x4a58a8){if(_0x34d62d[_0xb169('0x42')][_0xb169('0x48')]===_0xb169('0x49')){_0x34d62d[_0xb169('0x42')]['directory']=path['join'](config['root'],_0xb169('0x4a'),_0x34d62d['body'][_0xb169('0x25')]);}return db['VoiceMusicOnHold'][_0xb169('0x45')](_0x34d62d['body'],{'transaction':_0x4a58a8})['then'](function(_0x57b474){if(_0x34d62d['body']['mode']==='files'){fs[_0xb169('0x4b')](_0x57b474[_0xb169('0x4c')],parseInt(_0xb169('0x4d'),0x8));}var _0x3f440c=_0x34d62d[_0xb169('0x4e')][_0xb169('0x4f')]({'plain':!![]});if(!_0x3f440c)throw new Error(_0xb169('0x50'));if(_0x3f440c[_0xb169('0x51')]===_0xb169('0x4e')){var _0x5ed266=_0x57b474[_0xb169('0x4f')]({'plain':!![]});return db['UserProfileSection'][_0xb169('0x43')]({'where':{'name':'MusicOnHolds','userProfileId':_0x3f440c[_0xb169('0x52')]},'raw':!![]})['then'](function(_0x4e7108){if(_0x4e7108&&_0x4e7108[_0xb169('0x53')]===0x0){return db[_0xb169('0x54')][_0xb169('0x45')]({'name':_0x5ed266[_0xb169('0x25')],'resourceId':_0x5ed266['id'],'type':_0x4e7108[_0xb169('0x25')],'sectionId':_0x4e7108['id']},{})[_0xb169('0x21')](function(){return _0x57b474;});}else{return _0x57b474;}})[_0xb169('0x40')](function(_0x5e2955){logger['error'](_0xb169('0x55'),_0x5e2955);});}return _0x57b474;});})[_0xb169('0x21')](respondWithResult(_0x526692,0xc9))['catch'](handleError(_0x526692,null));};exports[_0xb169('0x22')]=function(_0xed1320,_0xbb0be6,_0x239c07){var _0x125c5c;return db['VoiceMusicOnHold'][_0xb169('0x43')]({'where':{'id':_0xed1320[_0xb169('0x44')]['id']}})[_0xb169('0x21')](function(_0x3687c2){if(_0x3687c2){return db[_0xb169('0x46')][_0xb169('0x47')](function(_0x144712){return _0x3687c2[_0xb169('0x22')]({'transaction':_0x144712,'raw':!![]})[_0xb169('0x21')](function(_0x500393){if(_0x500393['directory']){fs[_0xb169('0x56')](_0x500393[_0xb169('0x4c')])[_0xb169('0x57')](function(_0x29ee85){fs[_0xb169('0x58')](path[_0xb169('0x59')](_0x500393['directory'],_0x29ee85));});fs['rmdirSync'](_0x500393[_0xb169('0x4c')]);}return _0x500393;});})['catch'](function(_0x471a53){throw new db[(_0xb169('0x5a'))][(_0xb169('0x5b'))](_0x471a53['message']);});}})[_0xb169('0x21')](handleEntityNotFound(_0xbb0be6,null))['then'](removeEntity(_0xbb0be6,null))['catch'](handleError(_0xbb0be6,null));};exports[_0xb169('0x5c')]=function(_0x43ac04,_0xa31726,_0x503bb5){return db[_0xb169('0x46')]['transaction'](function(_0x5e7ee2){var _0x3369d0;return db[_0xb169('0x3d')][_0xb169('0x43')]({'where':{'id':_0x43ac04[_0xb169('0x44')]['id']}})[_0xb169('0x21')](function(_0x54aaa0){if(_0x54aaa0){_0x3369d0=_0x54aaa0;return _0x54aaa0[_0xb169('0x5c')](_0x43ac04['body']['id'],{'transaction':_0x5e7ee2});}})[_0xb169('0x21')](function(_0x283353){if(_0x283353){return db[_0xb169('0x5d')][_0xb169('0x5e')]({'where':{'id':_0x43ac04[_0xb169('0x42')]['id']},'attributes':['id',_0xb169('0x25'),_0xb169('0x5f'),_0xb169('0x60'),_0xb169('0x61')],'raw':!![]});}})[_0xb169('0x21')](function(_0x5d033b){if(_0x5d033b){var _0x47cb30=path[_0xb169('0x59')](config[_0xb169('0x62')],_0xb169('0x63'),util[_0xb169('0x64')](_0xb169('0x65'),path['basename'](_0x5d033b[_0xb169('0x5f')],path[_0xb169('0x66')](_0x5d033b[_0xb169('0x5f')])),_0x5d033b['converted_format']));var _0xed5487=path[_0xb169('0x59')](config['root'],'server/files/moh',_0x3369d0[_0xb169('0x25')],util[_0xb169('0x64')](_0xb169('0x65'),_0x5d033b[_0xb169('0x25')],_0x5d033b[_0xb169('0x60')]));fs[_0xb169('0x67')](_0x47cb30,_0xed5487);return _0x5d033b;}})[_0xb169('0x40')](function(_0x452026){throw new db[(_0xb169('0x5a'))]['ValidationError'](_0x452026['message']);});})[_0xb169('0x21')](handleEntityNotFound(_0xa31726,null))[_0xb169('0x21')](respondWithResult(_0xa31726,0xc9))[_0xb169('0x40')](handleError(_0xa31726,null));};exports[_0xb169('0x68')]=function(_0x6314ff,_0x154742,_0x57554c){return db[_0xb169('0x46')]['transaction'](function(_0x40327f){var _0xd4d421;return db[_0xb169('0x3d')][_0xb169('0x5e')]({'where':{'id':_0x6314ff[_0xb169('0x44')]['id']}})[_0xb169('0x21')](handleEntityNotFound(_0x154742,null))['then'](function(_0x3f9e8c){if(_0x3f9e8c){_0xd4d421=_0x3f9e8c;return _0x3f9e8c[_0xb169('0x68')](_0x6314ff[_0xb169('0x44')][_0xb169('0x69')]);}})[_0xb169('0x21')](function(_0x171f47){if(_0x171f47){return db['Sound'][_0xb169('0x5e')]({'where':{'id':_0x6314ff[_0xb169('0x44')][_0xb169('0x69')]},'attributes':['id','name',_0xb169('0x5f'),'converted_format',_0xb169('0x61')],'raw':!![]});}})[_0xb169('0x21')](function(_0x3811d6){if(_0x3811d6){fs[_0xb169('0x58')](path[_0xb169('0x59')](_0xd4d421['directory'],util[_0xb169('0x64')](_0xb169('0x65'),_0x3811d6[_0xb169('0x25')],_0x3811d6[_0xb169('0x60')])));return _0x3811d6;}})[_0xb169('0x40')](function(_0x9a35df){throw new db[(_0xb169('0x5a'))]['ValidationError'](_0x9a35df[_0xb169('0x6a')]);});})['then'](handleEntityNotFound(_0x154742,null))[_0xb169('0x21')](respondWithStatusCode(_0x154742,0xcc))[_0xb169('0x40')](handleError(_0x154742,null));};exports['getSounds']=function(_0x59f79a,_0x4f9926,_0x2a0930){var _0x5eb549={};var _0x6de9c2={};var _0xf5d8ce;var _0x40a6c;return db[_0xb169('0x3d')][_0xb169('0x5e')]({'where':{'id':_0x59f79a[_0xb169('0x44')]['id']}})[_0xb169('0x21')](handleEntityNotFound(_0x4f9926,null))[_0xb169('0x21')](function(_0x2cd0ba){if(_0x2cd0ba){_0xf5d8ce=_0x2cd0ba;_0x6de9c2[_0xb169('0x2c')]=_[_0xb169('0x2e')](db[_0xb169('0x5d')]['rawAttributes']);_0x6de9c2['query']=_[_0xb169('0x2e')](_0x59f79a[_0xb169('0x2d')]);_0x6de9c2[_0xb169('0x2f')]=_[_0xb169('0x30')](_0x6de9c2[_0xb169('0x2c')],_0x6de9c2[_0xb169('0x2d')]);_0x5eb549[_0xb169('0x31')]=_[_0xb169('0x30')](_0x6de9c2[_0xb169('0x2c')],qs[_0xb169('0x32')](_0x59f79a['query'][_0xb169('0x32')]));_0x5eb549[_0xb169('0x31')]=_0x5eb549[_0xb169('0x31')][_0xb169('0x33')]?_0x5eb549[_0xb169('0x31')]:_0x6de9c2[_0xb169('0x2c')];_0x5eb549[_0xb169('0x6b')]=qs[_0xb169('0x36')](_0x59f79a['query'][_0xb169('0x36')]);_0x5eb549[_0xb169('0x37')]=qs[_0xb169('0x2f')](_[_0xb169('0x38')](_0x59f79a[_0xb169('0x2d')],_0x6de9c2[_0xb169('0x2f')]));if(_0x59f79a['query'][_0xb169('0x39')]){_0x5eb549[_0xb169('0x37')]=_[_0xb169('0x3a')](_0x5eb549['where'],{'$or':_[_0xb169('0x28')](_0x5eb549[_0xb169('0x31')],function(_0xa7e6b7){var _0x1efc31={};_0x1efc31[_0xa7e6b7]={'$like':'%'+_0x59f79a[_0xb169('0x2d')][_0xb169('0x39')]+'%'};return _0x1efc31;})});}_0x5eb549=_['merge']({},_0x5eb549,_0x59f79a['options']);return _0xf5d8ce['getSounds'](_0x5eb549);}})[_0xb169('0x21')](function(_0x2f60e4){if(_0x2f60e4){_0x40a6c=_0x2f60e4[_0xb169('0x33')];if(!_0x59f79a[_0xb169('0x2d')][_0xb169('0x34')]('nolimit')){_0x5eb549[_0xb169('0x19')]=qs['limit'](_0x59f79a[_0xb169('0x2d')][_0xb169('0x19')]);_0x5eb549[_0xb169('0x18')]=qs['offset'](_0x59f79a[_0xb169('0x2d')][_0xb169('0x18')]);}return _0xf5d8ce[_0xb169('0x6c')](_0x5eb549);}})['then'](function(_0x1ba3e2){if(_0x1ba3e2){return _0x1ba3e2?{'count':_0x40a6c,'rows':_0x1ba3e2}:null;}})['then'](respondWithResult(_0x4f9926,null))['catch'](handleError(_0x4f9926,null));}; \ No newline at end of file +var _0x1961=['querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','end','error','stack','name','send','index','map','VoiceMusicOnHold','rawAttributes','fieldName','key','query','keys','filters','model','fields','attributes','length','hasOwnProperty','sort','where','filter','merge','options','includeAll','include','findAll','show','params','intersection','find','catch','body','sequelize','transaction','mode','files','directory','join','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Sequelize','ValidationError','message','addSound','Sound','findOne','converted_format','createdAt','root','server/files/sounds/converted','format','%s.%s','basename','save_name','server/files/moh','symlinkSync','removeSound','id2','getSounds','pick','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js'];(function(_0xba0c2,_0x54cc50){var _0x5a9fa0=function(_0x577bcb){while(--_0x577bcb){_0xba0c2['push'](_0xba0c2['shift']());}};_0x5a9fa0(++_0x54cc50);}(_0x1961,0x1a5));var _0x1196=function(_0x2fd7d6,_0x24f95c){_0x2fd7d6=_0x2fd7d6-0x0;var _0x464588=_0x1961[_0x2fd7d6];return _0x464588;};'use strict';var pdf=require(_0x1196('0x0'));var emlformat=require(_0x1196('0x1'));var rimraf=require(_0x1196('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1196('0x3'));var rp=require(_0x1196('0x4'));var moment=require('moment');var BPromise=require(_0x1196('0x5'));var Mustache=require(_0x1196('0x6'));var util=require(_0x1196('0x7'));var path=require('path');var sox=require(_0x1196('0x8'));var csv=require(_0x1196('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1196('0xa'));var squel=require(_0x1196('0xb'));var crypto=require(_0x1196('0xc'));var jsforce=require(_0x1196('0xd'));var deskjs=require(_0x1196('0xe'));var toCsv=require(_0x1196('0x9'));var querystring=require(_0x1196('0xf'));var Papa=require(_0x1196('0x10'));var Redis=require(_0x1196('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1196('0x12'));var as=require(_0x1196('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1196('0x14'))('api');var utils=require(_0x1196('0x15'));var config=require(_0x1196('0x16'));var db=require(_0x1196('0x17'))['db'];function respondWithStatusCode(_0x13f418,_0x191d1f){_0x191d1f=_0x191d1f||0xcc;return function(_0x572922){if(_0x572922){return _0x13f418[_0x1196('0x18')](_0x191d1f);}return _0x13f418[_0x1196('0x19')](_0x191d1f)['end']();};}function respondWithResult(_0x2d29e9,_0x4166ad){_0x4166ad=_0x4166ad||0xc8;return function(_0x3c4175){if(_0x3c4175){return _0x2d29e9['status'](_0x4166ad)[_0x1196('0x1a')](_0x3c4175);}};}function respondWithFilteredResult(_0x352b58,_0x389827){return function(_0x55a6b1){if(_0x55a6b1){var _0x4bcc54=_0x55a6b1[_0x1196('0x1b')],_0x4b2812=_0x389827['offset'],_0x318b4d=_0x389827[_0x1196('0x1c')]+_0x389827[_0x1196('0x1d')],_0x12e25b;if(_0x318b4d>=_0x4bcc54){_0x318b4d=_0x4bcc54;_0x12e25b=0xc8;}else{_0x12e25b=0xce;}_0x352b58['status'](_0x12e25b);return _0x352b58[_0x1196('0x1e')]('Content-Range',_0x4b2812+'-'+_0x318b4d+'/'+_0x4bcc54)[_0x1196('0x1a')](_0x55a6b1);}return null;};}function patchUpdates(_0x1322af){return function(_0x245a2c){try{jsonpatch[_0x1196('0x1f')](_0x245a2c,_0x1322af,!![]);}catch(_0x37c7fe){return BPromise[_0x1196('0x20')](_0x37c7fe);}return _0x245a2c[_0x1196('0x21')]();};}function saveUpdates(_0x5da1f4,_0x1f3044){return function(_0x40df08){if(_0x40df08){return _0x40df08[_0x1196('0x22')](_0x5da1f4)[_0x1196('0x23')](function(_0x1a54af){return _0x1a54af;});}return null;};}function removeEntity(_0x558cee,_0x9e5851){return function(_0x2c041d){if(_0x2c041d){return _0x2c041d[_0x1196('0x24')]()['then'](function(){var _0x555e79=_0x2c041d['get']({'plain':!![]});var _0x4ea1ee=_0x1196('0x25');return db[_0x1196('0x26')][_0x1196('0x24')]({'where':{'type':_0x4ea1ee,'resourceId':_0x555e79['id']}})[_0x1196('0x23')](function(){return _0x2c041d;});})[_0x1196('0x23')](function(){_0x558cee['status'](0xcc)[_0x1196('0x27')]();});}};}function handleEntityNotFound(_0xa99983,_0x603e35){return function(_0x35bcb7){if(!_0x35bcb7){_0xa99983['sendStatus'](0x194);}return _0x35bcb7;};}function handleError(_0x30fea2,_0x2b6b96){_0x2b6b96=_0x2b6b96||0x1f4;return function(_0x41a62e){logger[_0x1196('0x28')](_0x41a62e[_0x1196('0x29')]);if(_0x41a62e[_0x1196('0x2a')]){delete _0x41a62e['name'];}_0x30fea2['status'](_0x2b6b96)[_0x1196('0x2b')](_0x41a62e);};}exports[_0x1196('0x2c')]=function(_0x3d66cb,_0x530309){var _0xd3e1ac={},_0x1e6926={},_0x368819={'count':0x0,'rows':[]};var _0x29b99a=_[_0x1196('0x2d')](db[_0x1196('0x2e')][_0x1196('0x2f')],function(_0x53c2c0){return{'name':_0x53c2c0[_0x1196('0x30')],'type':_0x53c2c0['type'][_0x1196('0x31')]};});_0x1e6926['model']=_['map'](_0x29b99a,'name');_0x1e6926[_0x1196('0x32')]=_[_0x1196('0x33')](_0x3d66cb[_0x1196('0x32')]);_0x1e6926[_0x1196('0x34')]=_['intersection'](_0x1e6926[_0x1196('0x35')],_0x1e6926[_0x1196('0x32')]);_0xd3e1ac['attributes']=_['intersection'](_0x1e6926[_0x1196('0x35')],qs[_0x1196('0x36')](_0x3d66cb[_0x1196('0x32')][_0x1196('0x36')]));_0xd3e1ac[_0x1196('0x37')]=_0xd3e1ac['attributes'][_0x1196('0x38')]?_0xd3e1ac[_0x1196('0x37')]:_0x1e6926[_0x1196('0x35')];if(!_0x3d66cb[_0x1196('0x32')][_0x1196('0x39')]('nolimit')){_0xd3e1ac[_0x1196('0x1d')]=qs[_0x1196('0x1d')](_0x3d66cb[_0x1196('0x32')][_0x1196('0x1d')]);_0xd3e1ac[_0x1196('0x1c')]=qs[_0x1196('0x1c')](_0x3d66cb[_0x1196('0x32')][_0x1196('0x1c')]);}_0xd3e1ac['order']=qs['sort'](_0x3d66cb['query'][_0x1196('0x3a')]);_0xd3e1ac[_0x1196('0x3b')]=qs['filters'](_['pick'](_0x3d66cb[_0x1196('0x32')],_0x1e6926[_0x1196('0x34')]));if(_0x3d66cb[_0x1196('0x32')][_0x1196('0x3c')]){_0xd3e1ac['where']=_[_0x1196('0x3d')](_0xd3e1ac['where'],{'$or':_[_0x1196('0x2d')](_0x29b99a,function(_0x290e2c){if(_0x290e2c['type']!=='VIRTUAL'){var _0x10a349={};_0x10a349[_0x290e2c[_0x1196('0x2a')]]={'$like':'%'+_0x3d66cb[_0x1196('0x32')][_0x1196('0x3c')]+'%'};return _0x10a349;}})});}_0xd3e1ac=_[_0x1196('0x3d')]({},_0xd3e1ac,_0x3d66cb[_0x1196('0x3e')]);var _0x156475={'where':_0xd3e1ac[_0x1196('0x3b')]};return db[_0x1196('0x2e')][_0x1196('0x1b')](_0x156475)[_0x1196('0x23')](function(_0x3984cf){_0x368819[_0x1196('0x1b')]=_0x3984cf;if(_0x3d66cb['query'][_0x1196('0x3f')]){_0xd3e1ac[_0x1196('0x40')]=[{'all':!![]}];}return db[_0x1196('0x2e')][_0x1196('0x41')](_0xd3e1ac);})['then'](function(_0x18d23b){_0x368819['rows']=_0x18d23b;return _0x368819;})['then'](respondWithFilteredResult(_0x530309,_0xd3e1ac))['catch'](handleError(_0x530309,null));};exports[_0x1196('0x42')]=function(_0x27f05e,_0x398ddd){var _0x37696c={'raw':![],'where':{'id':_0x27f05e[_0x1196('0x43')]['id']}},_0x185bfb={};_0x185bfb[_0x1196('0x35')]=_[_0x1196('0x33')](db[_0x1196('0x2e')][_0x1196('0x2f')]);_0x185bfb['query']=_['keys'](_0x27f05e[_0x1196('0x32')]);_0x185bfb[_0x1196('0x34')]=_[_0x1196('0x44')](_0x185bfb['model'],_0x185bfb[_0x1196('0x32')]);_0x37696c[_0x1196('0x37')]=_['intersection'](_0x185bfb[_0x1196('0x35')],qs['fields'](_0x27f05e[_0x1196('0x32')][_0x1196('0x36')]));_0x37696c[_0x1196('0x37')]=_0x37696c[_0x1196('0x37')]['length']?_0x37696c['attributes']:_0x185bfb[_0x1196('0x35')];if(_0x27f05e[_0x1196('0x32')][_0x1196('0x3f')]){_0x37696c['include']=[{'all':!![]}];}_0x37696c=_[_0x1196('0x3d')]({},_0x37696c,_0x27f05e[_0x1196('0x3e')]);return db[_0x1196('0x2e')][_0x1196('0x45')](_0x37696c)[_0x1196('0x23')](handleEntityNotFound(_0x398ddd,null))[_0x1196('0x23')](respondWithResult(_0x398ddd,null))[_0x1196('0x46')](handleError(_0x398ddd,null));};exports[_0x1196('0x22')]=function(_0x209db6,_0x15e31c){if(_0x209db6[_0x1196('0x47')]['id']){delete _0x209db6[_0x1196('0x47')]['id'];}return db[_0x1196('0x2e')][_0x1196('0x45')]({'where':{'id':_0x209db6[_0x1196('0x43')]['id']}})[_0x1196('0x23')](handleEntityNotFound(_0x15e31c,null))[_0x1196('0x23')](saveUpdates(_0x209db6['body'],null))[_0x1196('0x23')](respondWithResult(_0x15e31c,null))[_0x1196('0x46')](handleError(_0x15e31c,null));};exports['create']=function(_0x50b46b,_0x4f3707,_0x2e868d){return db[_0x1196('0x48')][_0x1196('0x49')](function(_0x1d4754){if(_0x50b46b[_0x1196('0x47')][_0x1196('0x4a')]===_0x1196('0x4b')){_0x50b46b[_0x1196('0x47')][_0x1196('0x4c')]=path[_0x1196('0x4d')](config['root'],'server/files/moh',_0x50b46b[_0x1196('0x47')][_0x1196('0x2a')]);}return db[_0x1196('0x2e')]['create'](_0x50b46b[_0x1196('0x47')],{'transaction':_0x1d4754})[_0x1196('0x23')](function(_0x3050b1){if(_0x50b46b[_0x1196('0x47')]['mode']===_0x1196('0x4b')){fs[_0x1196('0x4e')](_0x3050b1['directory'],parseInt(_0x1196('0x4f'),0x8));}var _0x494619=_0x50b46b[_0x1196('0x50')][_0x1196('0x51')]({'plain':!![]});if(!_0x494619)throw new Error(_0x1196('0x52'));if(_0x494619[_0x1196('0x53')]===_0x1196('0x50')){var _0x2a315e=_0x3050b1[_0x1196('0x51')]({'plain':!![]});return db[_0x1196('0x54')][_0x1196('0x45')]({'where':{'name':_0x1196('0x25'),'userProfileId':_0x494619['userProfileId']},'raw':!![]})[_0x1196('0x23')](function(_0x50a22e){if(_0x50a22e&&_0x50a22e[_0x1196('0x55')]===0x0){return db['UserProfileResource'][_0x1196('0x56')]({'name':_0x2a315e[_0x1196('0x2a')],'resourceId':_0x2a315e['id'],'type':_0x50a22e['name'],'sectionId':_0x50a22e['id']},{})['then'](function(){return _0x3050b1;});}else{return _0x3050b1;}})[_0x1196('0x46')](function(_0x372dec){logger['error'](_0x1196('0x57'),_0x372dec);});}return _0x3050b1;});})['then'](respondWithResult(_0x4f3707,0xc9))['catch'](handleError(_0x4f3707,null));};exports[_0x1196('0x24')]=function(_0x5949c9,_0x1a3994,_0x570b6a){var _0x385ec0;return db[_0x1196('0x2e')]['find']({'where':{'id':_0x5949c9['params']['id']}})[_0x1196('0x23')](function(_0x3ab2c0){if(_0x3ab2c0){return db[_0x1196('0x48')][_0x1196('0x49')](function(_0x4d9ca4){return _0x3ab2c0[_0x1196('0x24')]({'transaction':_0x4d9ca4,'raw':!![]})['then'](function(_0x71ce5a){if(_0x71ce5a['directory']){fs['readdirSync'](_0x71ce5a[_0x1196('0x4c')])['forEach'](function(_0x4d3a95){fs[_0x1196('0x58')](path['join'](_0x71ce5a[_0x1196('0x4c')],_0x4d3a95));});fs['rmdirSync'](_0x71ce5a[_0x1196('0x4c')]);}return _0x71ce5a;});})['catch'](function(_0x22bdee){throw new db[(_0x1196('0x59'))][(_0x1196('0x5a'))](_0x22bdee[_0x1196('0x5b')]);});}})[_0x1196('0x23')](handleEntityNotFound(_0x1a3994,null))['then'](removeEntity(_0x1a3994,null))[_0x1196('0x46')](handleError(_0x1a3994,null));};exports[_0x1196('0x5c')]=function(_0x36f1b7,_0x1c7bfe,_0x158332){return db[_0x1196('0x48')]['transaction'](function(_0x13fc65){var _0x4069f3;return db[_0x1196('0x2e')][_0x1196('0x45')]({'where':{'id':_0x36f1b7[_0x1196('0x43')]['id']}})['then'](function(_0x54d189){if(_0x54d189){_0x4069f3=_0x54d189;return _0x54d189[_0x1196('0x5c')](_0x36f1b7[_0x1196('0x47')]['id'],{'transaction':_0x13fc65});}})[_0x1196('0x23')](function(_0x5efcd0){if(_0x5efcd0){return db[_0x1196('0x5d')][_0x1196('0x5e')]({'where':{'id':_0x36f1b7[_0x1196('0x47')]['id']},'attributes':['id','name','save_name',_0x1196('0x5f'),_0x1196('0x60')],'raw':!![]});}})['then'](function(_0x2c9012){if(_0x2c9012){var _0x235795=path[_0x1196('0x4d')](config[_0x1196('0x61')],_0x1196('0x62'),util[_0x1196('0x63')](_0x1196('0x64'),path[_0x1196('0x65')](_0x2c9012[_0x1196('0x66')],path['extname'](_0x2c9012[_0x1196('0x66')])),_0x2c9012['converted_format']));var _0x310eb1=path['join'](config[_0x1196('0x61')],_0x1196('0x67'),_0x4069f3['name'],util[_0x1196('0x63')](_0x1196('0x64'),_0x2c9012[_0x1196('0x2a')],_0x2c9012[_0x1196('0x5f')]));fs[_0x1196('0x68')](_0x235795,_0x310eb1);return _0x2c9012;}})[_0x1196('0x46')](function(_0x321730){throw new db[(_0x1196('0x59'))][(_0x1196('0x5a'))](_0x321730[_0x1196('0x5b')]);});})[_0x1196('0x23')](handleEntityNotFound(_0x1c7bfe,null))['then'](respondWithResult(_0x1c7bfe,0xc9))[_0x1196('0x46')](handleError(_0x1c7bfe,null));};exports[_0x1196('0x69')]=function(_0x45f3a2,_0x4a73c5,_0x237a29){return db[_0x1196('0x48')][_0x1196('0x49')](function(_0x1d9982){var _0x1a6a0a;return db[_0x1196('0x2e')][_0x1196('0x5e')]({'where':{'id':_0x45f3a2[_0x1196('0x43')]['id']}})[_0x1196('0x23')](handleEntityNotFound(_0x4a73c5,null))['then'](function(_0x5d8aa0){if(_0x5d8aa0){_0x1a6a0a=_0x5d8aa0;return _0x5d8aa0['removeSound'](_0x45f3a2[_0x1196('0x43')][_0x1196('0x6a')]);}})[_0x1196('0x23')](function(_0x3fba8e){if(_0x3fba8e){return db['Sound']['findOne']({'where':{'id':_0x45f3a2['params'][_0x1196('0x6a')]},'attributes':['id',_0x1196('0x2a'),'save_name',_0x1196('0x5f'),_0x1196('0x60')],'raw':!![]});}})[_0x1196('0x23')](function(_0x5c89e9){if(_0x5c89e9){fs[_0x1196('0x58')](path['join'](_0x1a6a0a[_0x1196('0x4c')],util['format']('%s.%s',_0x5c89e9[_0x1196('0x2a')],_0x5c89e9[_0x1196('0x5f')])));return _0x5c89e9;}})[_0x1196('0x46')](function(_0x35848f){throw new db['Sequelize'][(_0x1196('0x5a'))](_0x35848f[_0x1196('0x5b')]);});})[_0x1196('0x23')](handleEntityNotFound(_0x4a73c5,null))['then'](respondWithStatusCode(_0x4a73c5,0xcc))['catch'](handleError(_0x4a73c5,null));};exports[_0x1196('0x6b')]=function(_0xbfa3d2,_0x2a8d4a,_0x50975f){var _0x50f40c={};var _0x18cdf3={};var _0x57bc0c;var _0x1feaf2;return db['VoiceMusicOnHold']['findOne']({'where':{'id':_0xbfa3d2[_0x1196('0x43')]['id']}})['then'](handleEntityNotFound(_0x2a8d4a,null))[_0x1196('0x23')](function(_0x439538){if(_0x439538){_0x57bc0c=_0x439538;_0x18cdf3[_0x1196('0x35')]=_[_0x1196('0x33')](db['Sound'][_0x1196('0x2f')]);_0x18cdf3[_0x1196('0x32')]=_[_0x1196('0x33')](_0xbfa3d2[_0x1196('0x32')]);_0x18cdf3[_0x1196('0x34')]=_[_0x1196('0x44')](_0x18cdf3[_0x1196('0x35')],_0x18cdf3[_0x1196('0x32')]);_0x50f40c[_0x1196('0x37')]=_[_0x1196('0x44')](_0x18cdf3[_0x1196('0x35')],qs[_0x1196('0x36')](_0xbfa3d2[_0x1196('0x32')][_0x1196('0x36')]));_0x50f40c[_0x1196('0x37')]=_0x50f40c[_0x1196('0x37')][_0x1196('0x38')]?_0x50f40c[_0x1196('0x37')]:_0x18cdf3['model'];_0x50f40c['order']=qs[_0x1196('0x3a')](_0xbfa3d2[_0x1196('0x32')]['sort']);_0x50f40c[_0x1196('0x3b')]=qs[_0x1196('0x34')](_[_0x1196('0x6c')](_0xbfa3d2[_0x1196('0x32')],_0x18cdf3['filters']));if(_0xbfa3d2[_0x1196('0x32')][_0x1196('0x3c')]){_0x50f40c[_0x1196('0x3b')]=_['merge'](_0x50f40c[_0x1196('0x3b')],{'$or':_['map'](_0x50f40c[_0x1196('0x37')],function(_0x26899d){var _0xbea920={};_0xbea920[_0x26899d]={'$like':'%'+_0xbfa3d2[_0x1196('0x32')][_0x1196('0x3c')]+'%'};return _0xbea920;})});}_0x50f40c=_[_0x1196('0x3d')]({},_0x50f40c,_0xbfa3d2[_0x1196('0x3e')]);return _0x57bc0c[_0x1196('0x6b')](_0x50f40c);}})[_0x1196('0x23')](function(_0x590459){if(_0x590459){_0x1feaf2=_0x590459[_0x1196('0x38')];if(!_0xbfa3d2['query'][_0x1196('0x39')]('nolimit')){_0x50f40c['limit']=qs[_0x1196('0x1d')](_0xbfa3d2[_0x1196('0x32')]['limit']);_0x50f40c['offset']=qs[_0x1196('0x1c')](_0xbfa3d2['query']['offset']);}return _0x57bc0c[_0x1196('0x6b')](_0x50f40c);}})['then'](function(_0xc50e0c){if(_0xc50e0c){return _0xc50e0c?{'count':_0x1feaf2,'rows':_0xc50e0c}:null;}})[_0x1196('0x23')](respondWithResult(_0x2a8d4a,null))[_0x1196('0x46')](handleError(_0x2a8d4a,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 6e34151..9adc6b4 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 _0x5695=['define','voice_musiconhold','lodash','util','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x334fea,_0x1f1e18){var _0x3c5829=function(_0x4fd6ac){while(--_0x4fd6ac){_0x334fea['push'](_0x334fea['shift']());}};_0x3c5829(++_0x1f1e18);}(_0x5695,0xd4));var _0x5569=function(_0x1c951c,_0x1f6839){_0x1c951c=_0x1c951c-0x0;var _0x879b04=_0x5695[_0x1c951c];return _0x879b04;};'use strict';var _=require(_0x5569('0x0'));var util=require(_0x5569('0x1'));var logger=require(_0x5569('0x2'))(_0x5569('0x3'));var moment=require(_0x5569('0x4'));var BPromise=require(_0x5569('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5569('0x6'));var config=require(_0x5569('0x7'));var attributes=require('./voiceMusicOnHold.attributes');module['exports']=function(_0x2c8d16,_0x8555f6){return _0x2c8d16[_0x5569('0x8')]('VoiceMusicOnHold',attributes,{'tableName':_0x5569('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x48f6=['./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold','util','../../config/logger','api','moment','request-promise','rimraf','../../config/environment'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x48f6,0x1d9));var _0x648f=function(_0x20c70c,_0x12db97){_0x20c70c=_0x20c70c-0x0;var _0x4c79e3=_0x48f6[_0x20c70c];return _0x4c79e3;};'use strict';var _=require('lodash');var util=require(_0x648f('0x0'));var logger=require(_0x648f('0x1'))(_0x648f('0x2'));var moment=require(_0x648f('0x3'));var BPromise=require('bluebird');var rp=require(_0x648f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x648f('0x5'));var config=require(_0x648f('0x6'));var attributes=require(_0x648f('0x7'));module[_0x648f('0x8')]=function(_0x21b14c,_0x613f0a){return _0x21b14c[_0x648f('0x9')](_0x648f('0xa'),attributes,{'tableName':_0x648f('0xb'),'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 d91394a..73289d9 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 _0xe8a7=['result','catch','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','rpc','http','request','then','info','VoiceMusicOnHold,\x20%s,\x20%s','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message'];(function(_0x456032,_0x1a799d){var _0x1a53cd=function(_0x162cc8){while(--_0x162cc8){_0x456032['push'](_0x456032['shift']());}};_0x1a53cd(++_0x1a799d);}(_0xe8a7,0xf2));var _0x7e8a=function(_0x3687df,_0xc4fa55){_0x3687df=_0x3687df-0x0;var _0x4959ad=_0xe8a7[_0x3687df];return _0x4959ad;};'use strict';var _=require(_0x7e8a('0x0'));var util=require(_0x7e8a('0x1'));var moment=require(_0x7e8a('0x2'));var BPromise=require(_0x7e8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7e8a('0x4'))['db'];var utils=require(_0x7e8a('0x5'));var logger=require('../../config/logger')(_0x7e8a('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x7e8a('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x3d0565,_0x56b3f6,_0x4ded36){return new BPromise(function(_0x243d10,_0x4dd111){return client[_0x7e8a('0x8')](_0x3d0565,_0x4ded36)[_0x7e8a('0x9')](function(_0x223d3b){logger[_0x7e8a('0xa')](_0x7e8a('0xb'),_0x56b3f6,'request\x20sent');logger[_0x7e8a('0xc')](_0x7e8a('0xd'),_0x56b3f6,_0x7e8a('0xe'),JSON[_0x7e8a('0xf')](_0x223d3b));if(_0x223d3b[_0x7e8a('0x10')]){if(_0x223d3b[_0x7e8a('0x10')]['code']===0x1f4){logger[_0x7e8a('0x10')](_0x7e8a('0xb'),_0x56b3f6,_0x223d3b['error']['message']);return _0x4dd111(_0x223d3b['error'][_0x7e8a('0x11')]);}logger[_0x7e8a('0x10')](_0x7e8a('0xb'),_0x56b3f6,_0x223d3b['error'][_0x7e8a('0x11')]);return _0x243d10(_0x223d3b['error'][_0x7e8a('0x11')]);}else{logger['info'](_0x7e8a('0xb'),_0x56b3f6,'request\x20sent');_0x243d10(_0x223d3b[_0x7e8a('0x12')][_0x7e8a('0x11')]);}})[_0x7e8a('0x13')](function(_0x2c7fff){logger[_0x7e8a('0x10')](_0x7e8a('0xb'),_0x56b3f6,_0x2c7fff);_0x4dd111(_0x2c7fff);});});} \ No newline at end of file +var _0x6b46=['../../config/environment','jayson/promise','client','http','request','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','randomstring','../../mysqldb','../../config/utils','rpc'];(function(_0x5bf6b8,_0xb5530a){var _0x186d32=function(_0xc99f9d){while(--_0xc99f9d){_0x5bf6b8['push'](_0x5bf6b8['shift']());}};_0x186d32(++_0xb5530a);}(_0x6b46,0xf3));var _0x66b4=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x6b46[_0x397e5f];return _0x5302b8;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x66b4('0x0'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x66b4('0x1'))['db'];var utils=require(_0x66b4('0x2'));var logger=require('../../config/logger')(_0x66b4('0x3'));var config=require(_0x66b4('0x4'));var jayson=require(_0x66b4('0x5'));var client=jayson[_0x66b4('0x6')][_0x66b4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x23036e,_0x5df264,_0x1e03a9){return new BPromise(function(_0xa854cd,_0xe66cb3){return client[_0x66b4('0x8')](_0x23036e,_0x1e03a9)['then'](function(_0x1302e2){logger[_0x66b4('0x9')](_0x66b4('0xa'),_0x5df264,_0x66b4('0xb'));logger[_0x66b4('0xc')](_0x66b4('0xd'),_0x5df264,'request\x20sent',JSON[_0x66b4('0xe')](_0x1302e2));if(_0x1302e2[_0x66b4('0xf')]){if(_0x1302e2[_0x66b4('0xf')][_0x66b4('0x10')]===0x1f4){logger[_0x66b4('0xf')](_0x66b4('0xa'),_0x5df264,_0x1302e2[_0x66b4('0xf')]['message']);return _0xe66cb3(_0x1302e2[_0x66b4('0xf')][_0x66b4('0x11')]);}logger[_0x66b4('0xf')](_0x66b4('0xa'),_0x5df264,_0x1302e2[_0x66b4('0xf')]['message']);return _0xa854cd(_0x1302e2['error'][_0x66b4('0x11')]);}else{logger[_0x66b4('0x9')](_0x66b4('0xa'),_0x5df264,'request\x20sent');_0xa854cd(_0x1302e2[_0x66b4('0x12')][_0x66b4('0x11')]);}})['catch'](function(_0x5782f1){logger[_0x66b4('0xf')](_0x66b4('0xa'),_0x5df264,_0x5782f1);_0xe66cb3(_0x5782f1);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index be8fc1e..4df1a44 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 _0xa6ce=['./voicePrefix.controller','get','isAuthenticated','/describe','/:id','show','getAgents','post','create','/:id/users','addAgents','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x9cd4c3,_0x1c9b2c){var _0x4c9025=function(_0x25b3c6){while(--_0x25b3c6){_0x9cd4c3['push'](_0x9cd4c3['shift']());}};_0x4c9025(++_0x1c9b2c);}(_0xa6ce,0x1c4));var _0xea6c=function(_0x386c3e,_0x44a375){_0x386c3e=_0x386c3e-0x0;var _0x4b8e13=_0xa6ce[_0x386c3e];return _0x4b8e13;};'use strict';var multer=require(_0xea6c('0x0'));var util=require(_0xea6c('0x1'));var path=require('path');var timeout=require(_0xea6c('0x2'));var express=require(_0xea6c('0x3'));var router=express[_0xea6c('0x4')]();var auth=require(_0xea6c('0x5'));var interaction=require(_0xea6c('0x6'));var config=require(_0xea6c('0x7'));var controller=require(_0xea6c('0x8'));router[_0xea6c('0x9')]('/',auth[_0xea6c('0xa')](),controller['index']);router[_0xea6c('0x9')](_0xea6c('0xb'),auth[_0xea6c('0xa')](),controller['describe']);router['get'](_0xea6c('0xc'),auth[_0xea6c('0xa')](),controller[_0xea6c('0xd')]);router['get']('/:id/users',auth[_0xea6c('0xa')](),controller[_0xea6c('0xe')]);router[_0xea6c('0xf')]('/',auth[_0xea6c('0xa')](),controller[_0xea6c('0x10')]);router[_0xea6c('0xf')](_0xea6c('0x11'),auth['isAuthenticated'](),controller[_0xea6c('0x12')]);router['put'](_0xea6c('0xc'),auth[_0xea6c('0xa')](),controller[_0xea6c('0x13')]);router[_0xea6c('0x14')](_0xea6c('0xc'),auth[_0xea6c('0xa')](),controller[_0xea6c('0x15')]);router[_0xea6c('0x14')](_0xea6c('0x11'),auth[_0xea6c('0xa')](),controller['removeAgents']);module[_0xea6c('0x16')]=router; \ No newline at end of file +var _0x9483=['update','destroy','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/:id','/:id/users','getAgents','post','put'];(function(_0x5c23af,_0x58bf1a){var _0x5bf553=function(_0x320a5a){while(--_0x320a5a){_0x5c23af['push'](_0x5c23af['shift']());}};_0x5bf553(++_0x58bf1a);}(_0x9483,0x154));var _0x3948=function(_0x6e5140,_0x5dd03f){_0x6e5140=_0x6e5140-0x0;var _0x4c9b17=_0x9483[_0x6e5140];return _0x4c9b17;};'use strict';var multer=require(_0x3948('0x0'));var util=require('util');var path=require(_0x3948('0x1'));var timeout=require(_0x3948('0x2'));var express=require(_0x3948('0x3'));var router=express[_0x3948('0x4')]();var auth=require(_0x3948('0x5'));var interaction=require(_0x3948('0x6'));var config=require(_0x3948('0x7'));var controller=require(_0x3948('0x8'));router[_0x3948('0x9')]('/',auth[_0x3948('0xa')](),controller[_0x3948('0xb')]);router[_0x3948('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x3948('0x9')](_0x3948('0xc'),auth[_0x3948('0xa')](),controller['show']);router[_0x3948('0x9')](_0x3948('0xd'),auth[_0x3948('0xa')](),controller[_0x3948('0xe')]);router[_0x3948('0xf')]('/',auth[_0x3948('0xa')](),controller['create']);router[_0x3948('0xf')](_0x3948('0xd'),auth[_0x3948('0xa')](),controller['addAgents']);router[_0x3948('0x10')](_0x3948('0xc'),auth['isAuthenticated'](),controller[_0x3948('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x3948('0x12')]);router[_0x3948('0x13')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x3948('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 659e6f7..8ed86ed 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 _0xd202=['system-','getDataValue','INTEGER','sequelize','exports','STRING','name'];(function(_0x480484,_0x2749d7){var _0x348ae9=function(_0x5d8eda){while(--_0x5d8eda){_0x480484['push'](_0x480484['shift']());}};_0x348ae9(++_0x2749d7);}(_0xd202,0x6c));var _0x2d20=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd202[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x2d20('0x0'));module[_0x2d20('0x1')]={'name':{'type':Sequelize[_0x2d20('0x2')],'allowNull':![],'unique':_0x2d20('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x3d0011){return _0x2d20('0x4')+this[_0x2d20('0x5')]('name')+'-';}},'description':{'type':Sequelize[_0x2d20('0x2')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x2d20('0x6')]}}; \ No newline at end of file +var _0x6aa4=['STRING','name','getDataValue','INTEGER','sequelize','exports'];(function(_0x4ad720,_0xb7e3eb){var _0x3b7593=function(_0xef76c9){while(--_0xef76c9){_0x4ad720['push'](_0x4ad720['shift']());}};_0x3b7593(++_0xb7e3eb);}(_0x6aa4,0x1f0));var _0x46aa=function(_0x36a811,_0x14a4ad){_0x36a811=_0x36a811-0x0;var _0x24c8a9=_0x6aa4[_0x36a811];return _0x24c8a9;};'use strict';var Sequelize=require(_0x46aa('0x0'));module[_0x46aa('0x1')]={'name':{'type':Sequelize[_0x46aa('0x2')],'allowNull':![],'unique':_0x46aa('0x3')},'prefix':{'type':Sequelize['VIRTUAL'],'get':function(_0x2a3954){return'system-'+this[_0x46aa('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x46aa('0x2')]},'callerIdAll':{'type':Sequelize[_0x46aa('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0x46aa('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 1efbba4..18f90f4 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 _0xd9b6=['ids','omit','emit','removeAgents','isArray','userVoicePrefix:remove','getAgents','User','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','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','set','Content-Range','apply','save','update','then','destroy','get','VoicePrefixes','name','send','index','map','VoicePrefix','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','show','params','rawAttributes','includeAll','find','catch','describe','create','transaction','body','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','app','system','description','Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','Set','CDR(prefix)=','push','PREFIX-CALLERIDALL=','callerIdAll','No\x20callerid\x20available','goto','${EXTEN:','charAt','system-','sequelize','findById','addAgents'];(function(_0x6106d8,_0x67937c){var _0x8a8fe8=function(_0x77027d){while(--_0x77027d){_0x6106d8['push'](_0x6106d8['shift']());}};_0x8a8fe8(++_0x67937c);}(_0xd9b6,0x83));var _0x6d9b=function(_0x526298,_0x2ec3ba){_0x526298=_0x526298-0x0;var _0x467835=_0xd9b6[_0x526298];return _0x467835;};'use strict';var pdf=require(_0x6d9b('0x0'));var emlformat=require(_0x6d9b('0x1'));var rimraf=require(_0x6d9b('0x2'));var zipdir=require(_0x6d9b('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6d9b('0x4'));var Mustache=require(_0x6d9b('0x5'));var util=require('util');var path=require(_0x6d9b('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x6d9b('0x7'));var fs=require('fs');var _=require(_0x6d9b('0x8'));var squel=require(_0x6d9b('0x9'));var crypto=require(_0x6d9b('0xa'));var jsforce=require(_0x6d9b('0xb'));var deskjs=require(_0x6d9b('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6d9b('0xd'));var Redis=require(_0x6d9b('0xe'));var authService=require(_0x6d9b('0xf'));var qs=require(_0x6d9b('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6d9b('0x11'));var logger=require('../../config/logger')(_0x6d9b('0x12'));var utils=require(_0x6d9b('0x13'));var config=require(_0x6d9b('0x14'));var db=require(_0x6d9b('0x15'))['db'];config[_0x6d9b('0x16')]=_[_0x6d9b('0x17')](config['redis'],{'host':_0x6d9b('0x18'),'port':0x18eb});var socket=require(_0x6d9b('0x19'))(new Redis(config[_0x6d9b('0x16')]));require('./voicePrefix.socket')[_0x6d9b('0x1a')](socket);function respondWithStatusCode(_0x34999b,_0x214d97){_0x214d97=_0x214d97||0xcc;return function(_0x5737cf){if(_0x5737cf){return _0x34999b[_0x6d9b('0x1b')](_0x214d97);}return _0x34999b[_0x6d9b('0x1c')](_0x214d97)[_0x6d9b('0x1d')]();};}function respondWithResult(_0x2b4b99,_0x585ab9){_0x585ab9=_0x585ab9||0xc8;return function(_0x56c9c3){if(_0x56c9c3){return _0x2b4b99[_0x6d9b('0x1c')](_0x585ab9)[_0x6d9b('0x1e')](_0x56c9c3);}};}function respondWithFilteredResult(_0x34d544,_0x3c0f48){return function(_0x5fe918){if(_0x5fe918){var _0x1565d2=_0x5fe918[_0x6d9b('0x1f')],_0x45a69b=_0x3c0f48[_0x6d9b('0x20')],_0x592532=_0x3c0f48['offset']+_0x3c0f48['limit'],_0x32ce82;if(_0x592532>=_0x1565d2){_0x592532=_0x1565d2;_0x32ce82=0xc8;}else{_0x32ce82=0xce;}_0x34d544[_0x6d9b('0x1c')](_0x32ce82);return _0x34d544[_0x6d9b('0x21')](_0x6d9b('0x22'),_0x45a69b+'-'+_0x592532+'/'+_0x1565d2)['json'](_0x5fe918);}return null;};}function patchUpdates(_0x47488a){return function(_0x3e0c7a){try{jsonpatch[_0x6d9b('0x23')](_0x3e0c7a,_0x47488a,!![]);}catch(_0x54e129){return BPromise['reject'](_0x54e129);}return _0x3e0c7a[_0x6d9b('0x24')]();};}function saveUpdates(_0x345ef1,_0x11e838){return function(_0x2556e9){if(_0x2556e9){return _0x2556e9[_0x6d9b('0x25')](_0x345ef1)[_0x6d9b('0x26')](function(_0x258d39){return _0x258d39;});}return null;};}function removeEntity(_0x2c3ddc,_0x4e93c5){return function(_0x253ecb){if(_0x253ecb){return _0x253ecb[_0x6d9b('0x27')]()[_0x6d9b('0x26')](function(){var _0x1f7711=_0x253ecb[_0x6d9b('0x28')]({'plain':!![]});var _0x5ca49c=_0x6d9b('0x29');return db['UserProfileResource']['destroy']({'where':{'type':_0x5ca49c,'resourceId':_0x1f7711['id']}})[_0x6d9b('0x26')](function(){return _0x253ecb;});})[_0x6d9b('0x26')](function(){_0x2c3ddc[_0x6d9b('0x1c')](0xcc)[_0x6d9b('0x1d')]();});}};}function handleEntityNotFound(_0x294182,_0x282f97){return function(_0x23a76a){if(!_0x23a76a){_0x294182['sendStatus'](0x194);}return _0x23a76a;};}function handleError(_0x47e124,_0x2abeda){_0x2abeda=_0x2abeda||0x1f4;return function(_0x1791a8){logger['error'](_0x1791a8['stack']);if(_0x1791a8[_0x6d9b('0x2a')]){delete _0x1791a8['name'];}_0x47e124[_0x6d9b('0x1c')](_0x2abeda)[_0x6d9b('0x2b')](_0x1791a8);};}exports[_0x6d9b('0x2c')]=function(_0x2ed97e,_0x6f24df){var _0x19e2c0={},_0x3646b3={},_0x10e1e6={'count':0x0,'rows':[]};var _0x3a7ddc=_[_0x6d9b('0x2d')](db[_0x6d9b('0x2e')]['rawAttributes'],function(_0x57e2fd){return{'name':_0x57e2fd['fieldName'],'type':_0x57e2fd[_0x6d9b('0x2f')][_0x6d9b('0x30')]};});_0x3646b3['model']=_[_0x6d9b('0x2d')](_0x3a7ddc,_0x6d9b('0x2a'));_0x3646b3[_0x6d9b('0x31')]=_[_0x6d9b('0x32')](_0x2ed97e['query']);_0x3646b3[_0x6d9b('0x33')]=_[_0x6d9b('0x34')](_0x3646b3['model'],_0x3646b3['query']);_0x19e2c0[_0x6d9b('0x35')]=_['intersection'](_0x3646b3[_0x6d9b('0x36')],qs[_0x6d9b('0x37')](_0x2ed97e[_0x6d9b('0x31')][_0x6d9b('0x37')]));_0x19e2c0['attributes']=_0x19e2c0[_0x6d9b('0x35')][_0x6d9b('0x38')]?_0x19e2c0[_0x6d9b('0x35')]:_0x3646b3['model'];if(!_0x2ed97e[_0x6d9b('0x31')][_0x6d9b('0x39')](_0x6d9b('0x3a'))){_0x19e2c0[_0x6d9b('0x3b')]=qs[_0x6d9b('0x3b')](_0x2ed97e[_0x6d9b('0x31')][_0x6d9b('0x3b')]);_0x19e2c0[_0x6d9b('0x20')]=qs[_0x6d9b('0x20')](_0x2ed97e['query'][_0x6d9b('0x20')]);}_0x19e2c0[_0x6d9b('0x3c')]=qs[_0x6d9b('0x3d')](_0x2ed97e[_0x6d9b('0x31')]['sort']);_0x19e2c0['where']=qs[_0x6d9b('0x33')](_[_0x6d9b('0x3e')](_0x2ed97e[_0x6d9b('0x31')],_0x3646b3[_0x6d9b('0x33')]));if(_0x2ed97e['query'][_0x6d9b('0x3f')]){_0x19e2c0[_0x6d9b('0x40')]=_[_0x6d9b('0x41')](_0x19e2c0['where'],{'$or':_[_0x6d9b('0x2d')](_0x3a7ddc,function(_0x5205f7){if(_0x5205f7['type']!==_0x6d9b('0x42')){var _0x53d2fc={};_0x53d2fc[_0x5205f7['name']]={'$like':'%'+_0x2ed97e[_0x6d9b('0x31')][_0x6d9b('0x3f')]+'%'};return _0x53d2fc;}})});}_0x19e2c0=_[_0x6d9b('0x41')]({},_0x19e2c0,_0x2ed97e[_0x6d9b('0x43')]);var _0x36dd0a={'where':_0x19e2c0['where']};return db[_0x6d9b('0x2e')][_0x6d9b('0x1f')](_0x36dd0a)[_0x6d9b('0x26')](function(_0x2c7ab2){_0x10e1e6[_0x6d9b('0x1f')]=_0x2c7ab2;if(_0x2ed97e[_0x6d9b('0x31')]['includeAll']){_0x19e2c0[_0x6d9b('0x44')]=[{'all':!![]}];}return db['VoicePrefix'][_0x6d9b('0x45')](_0x19e2c0);})['then'](function(_0x4696e1){_0x10e1e6['rows']=_0x4696e1;return _0x10e1e6;})['then'](respondWithFilteredResult(_0x6f24df,_0x19e2c0))['catch'](handleError(_0x6f24df,null));};exports[_0x6d9b('0x46')]=function(_0x3bdff8,_0x1adf26){var _0x23b3e6={'raw':![],'where':{'id':_0x3bdff8[_0x6d9b('0x47')]['id']}},_0x1e8715={};_0x1e8715[_0x6d9b('0x36')]=_[_0x6d9b('0x32')](db[_0x6d9b('0x2e')][_0x6d9b('0x48')]);_0x1e8715[_0x6d9b('0x31')]=_[_0x6d9b('0x32')](_0x3bdff8['query']);_0x1e8715[_0x6d9b('0x33')]=_[_0x6d9b('0x34')](_0x1e8715[_0x6d9b('0x36')],_0x1e8715['query']);_0x23b3e6[_0x6d9b('0x35')]=_[_0x6d9b('0x34')](_0x1e8715[_0x6d9b('0x36')],qs[_0x6d9b('0x37')](_0x3bdff8[_0x6d9b('0x31')][_0x6d9b('0x37')]));_0x23b3e6[_0x6d9b('0x35')]=_0x23b3e6['attributes'][_0x6d9b('0x38')]?_0x23b3e6[_0x6d9b('0x35')]:_0x1e8715[_0x6d9b('0x36')];if(_0x3bdff8[_0x6d9b('0x31')][_0x6d9b('0x49')]){_0x23b3e6[_0x6d9b('0x44')]=[{'all':!![]}];}_0x23b3e6=_['merge']({},_0x23b3e6,_0x3bdff8['options']);return db[_0x6d9b('0x2e')][_0x6d9b('0x4a')](_0x23b3e6)[_0x6d9b('0x26')](handleEntityNotFound(_0x1adf26,null))[_0x6d9b('0x26')](respondWithResult(_0x1adf26,null))['catch'](handleError(_0x1adf26,null));};exports['destroy']=function(_0x277d00,_0x40c4c6){return db[_0x6d9b('0x2e')]['find']({'where':{'id':_0x277d00[_0x6d9b('0x47')]['id']}})['then'](handleEntityNotFound(_0x40c4c6,null))[_0x6d9b('0x26')](removeEntity(_0x40c4c6,null))[_0x6d9b('0x4b')](handleError(_0x40c4c6,null));};exports[_0x6d9b('0x4c')]=function(_0x43c74a,_0x8b27c7){return db[_0x6d9b('0x2e')]['describe']()[_0x6d9b('0x26')](respondWithResult(_0x8b27c7,null))[_0x6d9b('0x4b')](handleError(_0x8b27c7,null));};exports[_0x6d9b('0x4d')]=function(_0x414234,_0x44b56c){var _0x4fd45b;return db['sequelize'][_0x6d9b('0x4e')](function(_0x278359){return db['VoicePrefix']['create'](_0x414234[_0x6d9b('0x4f')],{'transaction':_0x278359})[_0x6d9b('0x26')](function(_0x5ee829){_0x4fd45b=_0x5ee829[_0x6d9b('0x28')]({'plain':!![]});return db['VoiceExtension']['find']({'where':{'id':_0x4fd45b[_0x6d9b('0x50')]},'raw':!![]})[_0x6d9b('0x26')](function(_0x15ba15){return createVoicePrefixExtensions(_0x4fd45b,_0x15ba15,_0x278359);});});})[_0x6d9b('0x26')](function(){var _0x5ae111=_0x414234[_0x6d9b('0x51')][_0x6d9b('0x28')]({'plain':!![]});if(!_0x5ae111)throw new Error(_0x6d9b('0x52'));if(_0x5ae111[_0x6d9b('0x53')]===_0x6d9b('0x51')){var _0x15cbcd=_0x4fd45b;return db[_0x6d9b('0x54')][_0x6d9b('0x4a')]({'where':{'name':'VoicePrefixes','userProfileId':_0x5ae111[_0x6d9b('0x55')]},'raw':!![]})['then'](function(_0x5a277e){if(_0x5a277e&&_0x5a277e['autoAssociation']===0x0){return db['UserProfileResource'][_0x6d9b('0x4d')]({'name':_0x15cbcd[_0x6d9b('0x2a')],'resourceId':_0x15cbcd['id'],'type':_0x5a277e['name'],'sectionId':_0x5a277e['id']},{})['then'](function(){return _0x4fd45b;});}else{return _0x4fd45b;}})['catch'](function(_0x550dd3){logger[_0x6d9b('0x56')](_0x6d9b('0x57'),_0x550dd3);throw _0x550dd3;});}return _0x4fd45b;})[_0x6d9b('0x26')](respondWithResult(_0x44b56c,null))[_0x6d9b('0x4b')](handleError(_0x44b56c,null));};function Extension(_0x36b6e3,_0x23d4aa,_0x1839c5,_0x27e404){this[_0x6d9b('0x58')]=_0x6d9b('0x59');this['exten']=_0x36b6e3;this[_0x6d9b('0x5a')]=_0x1839c5;this['type']=_0x6d9b('0x5b');this[_0x6d9b('0x5c')]=_0x6d9b('0x5d');this[_0x6d9b('0x5e')]=_0x23d4aa;this[_0x6d9b('0x5f')]=_0x27e404;}function createVoicePrefixExtensions(_0x3b9695,_0x1006e2,_0x26218e){return new BPromise(function(_0x136bf1,_0x334d2d){var _0x57acaa=new Extension(formatPrefixName(_0x3b9695[_0x6d9b('0x60')]),0x1,_0x6d9b('0x61'),'Voice\x20Prefix');_0x57acaa['VoicePrefixId']=_0x3b9695['id'];return db[_0x6d9b('0x62')][_0x6d9b('0x4d')](_0x57acaa,{'transaction':_0x26218e})['then'](function(_0xc7773b){var _0x2705a3=_0xc7773b[_0x6d9b('0x28')]({'plain':!![]});var _0x2f3522=_['map'](addVoicePrefixExtensions(_0x3b9695,_0x1006e2),function(_0x2f4e3f){_0x2f4e3f[_0x6d9b('0x50')]=_0x2705a3['id'];_0x2f4e3f[_0x6d9b('0x63')]=_0x3b9695['id'];return _0x2f4e3f;});return db[_0x6d9b('0x62')][_0x6d9b('0x64')](_0x2f3522,{'transaction':_0x26218e})[_0x6d9b('0x26')](function(_0x550c65){if(!_0x550c65){return _0x334d2d(_0x6d9b('0x65'));}else{return _0x136bf1(_0x550c65);}})[_0x6d9b('0x4b')](function(_0x4fb3a8){return _0x334d2d(_0x4fb3a8);});});;});};function addVoicePrefixExtensions(_0x2cc548,_0x2b5b31){var _0x5afa90=[];var _0x1c6523=formatPrefixName(_0x2cc548[_0x6d9b('0x60')]);_0x5afa90['push'](new Extension(_0x1c6523,0x2,_0x6d9b('0x66'),_0x6d9b('0x67')+_0x2cc548[_0x6d9b('0x2a')]));if(_0x2cc548['callerIdAll']){_0x5afa90[_0x6d9b('0x68')](new Extension(_0x1c6523,0x3,_0x6d9b('0x66'),_0x6d9b('0x69')+_0x2cc548[_0x6d9b('0x6a')]));}else{_0x5afa90[_0x6d9b('0x68')](new Extension(_0x1c6523,0x3,_0x6d9b('0x61'),_0x6d9b('0x6b')));}_0x5afa90[_0x6d9b('0x68')](new Extension(_0x1c6523,0x4,_0x6d9b('0x6c'),_0x2b5b31['context']+','+_0x6d9b('0x6d')+(0x8+_0x2cc548[_0x6d9b('0x2a')][_0x6d9b('0x38')])+'}'+','+0x1));return _0x5afa90;}function formatPrefixName(_0x261f18){var _0x24577d='_';for(var _0x55a5f=0x0;_0x55a5f<_0x261f18[_0x6d9b('0x38')];_0x55a5f++){if(_0x261f18['charAt'](_0x55a5f)=='-'){_0x24577d+=_0x261f18[_0x6d9b('0x6e')](_0x55a5f);}else{_0x24577d+='['+_0x261f18[_0x6d9b('0x6e')](_0x55a5f)+']';}}_0x24577d+='.';return _0x24577d;}exports['update']=function(_0x538247,_0x1e16cd,_0x2014f9){var _0x1a21f8=_0x538247[_0x6d9b('0x4f')];_0x1a21f8[_0x6d9b('0x60')]=_0x6d9b('0x6f')+_0x1a21f8['name']+'-';return db[_0x6d9b('0x70')][_0x6d9b('0x4e')](function(_0x513efd){return db[_0x6d9b('0x2e')][_0x6d9b('0x25')](_0x1a21f8,{'where':{'id':_0x1a21f8['id']},'transaction':_0x513efd})['then'](function(){return db[_0x6d9b('0x62')]['destroy']({'where':{'VoicePrefixId':_0x1a21f8['id']},'transaction':_0x513efd})[_0x6d9b('0x26')](function(){return db[_0x6d9b('0x62')][_0x6d9b('0x4a')]({'where':{'id':_0x1a21f8['VoiceExtensionId']},'raw':!![]})[_0x6d9b('0x26')](function(_0x1ce766){return createVoicePrefixExtensions(_0x1a21f8,_0x1ce766,_0x513efd);});});});})[_0x6d9b('0x26')](function(){return db['VoicePrefix'][_0x6d9b('0x71')](_0x1a21f8['id']);})[_0x6d9b('0x26')](respondWithResult(_0x1e16cd,null))[_0x6d9b('0x4b')](handleError(_0x1e16cd,null));};exports[_0x6d9b('0x72')]=function(_0x33b284,_0x34eb40,_0x4e7d8a){return db[_0x6d9b('0x2e')][_0x6d9b('0x4a')]({'where':{'id':_0x33b284['params']['id']}})['then'](handleEntityNotFound(_0x34eb40,null))['then'](function(_0x597958){if(_0x597958){return _0x597958[_0x6d9b('0x72')](_0x33b284[_0x6d9b('0x4f')][_0x6d9b('0x73')],_[_0x6d9b('0x74')](_0x33b284['body'],[_0x6d9b('0x73'),'id'])||{})['spread'](function(_0x4576a6){for(var _0x567d95=0x0;_0x567d95<_0x33b284[_0x6d9b('0x4f')]['ids']['length'];_0x567d95+=0x1){socket[_0x6d9b('0x75')]('userVoicePrefix:save',{'UserId':_0x33b284['body']['ids'][_0x567d95],'VoicePrefixId':_0x33b284['params']['id']});}return _0x4576a6;});}})['then'](respondWithResult(_0x34eb40,null))[_0x6d9b('0x4b')](handleError(_0x34eb40,null));};exports[_0x6d9b('0x76')]=function(_0x37ccca,_0x56d07f,_0x5d475c){return db[_0x6d9b('0x2e')][_0x6d9b('0x4a')]({'where':{'id':_0x37ccca[_0x6d9b('0x47')]['id']}})[_0x6d9b('0x26')](handleEntityNotFound(_0x56d07f,null))[_0x6d9b('0x26')](function(_0x2f3605){if(_0x2f3605){return _0x2f3605[_0x6d9b('0x76')](_0x37ccca[_0x6d9b('0x31')]['ids'])[_0x6d9b('0x26')](function(){if(_[_0x6d9b('0x77')](_0x37ccca[_0x6d9b('0x31')][_0x6d9b('0x73')])){for(var _0x401db0=0x0;_0x401db0<_0x37ccca[_0x6d9b('0x31')][_0x6d9b('0x73')][_0x6d9b('0x38')];_0x401db0+=0x1){socket[_0x6d9b('0x75')]('userVoicePrefix:remove',{'UserId':Number(_0x37ccca[_0x6d9b('0x31')][_0x6d9b('0x73')][_0x401db0]),'VoicePrefixId':Number(_0x37ccca[_0x6d9b('0x47')]['id'])});}}else{socket[_0x6d9b('0x75')](_0x6d9b('0x78'),{'UserId':Number(_0x37ccca[_0x6d9b('0x31')][_0x6d9b('0x73')]),'VoicePrefixId':Number(_0x37ccca[_0x6d9b('0x47')]['id'])});}});}})[_0x6d9b('0x26')](respondWithStatusCode(_0x56d07f,null))['catch'](handleError(_0x56d07f,null));};exports[_0x6d9b('0x79')]=function(_0x15ebd8,_0xee65b0,_0x4ebada){var _0x557ecb={};var _0x18a4c0={};var _0x3cbd1a;var _0x5bb011;return db['VoicePrefix']['findOne']({'where':{'id':_0x15ebd8[_0x6d9b('0x47')]['id']}})[_0x6d9b('0x26')](handleEntityNotFound(_0xee65b0,null))['then'](function(_0x12fda0){if(_0x12fda0){_0x3cbd1a=_0x12fda0;_0x18a4c0[_0x6d9b('0x36')]=_[_0x6d9b('0x32')](db[_0x6d9b('0x7a')][_0x6d9b('0x48')]);_0x18a4c0[_0x6d9b('0x31')]=_['keys'](_0x15ebd8['query']);_0x18a4c0[_0x6d9b('0x33')]=_['intersection'](_0x18a4c0[_0x6d9b('0x36')],_0x18a4c0[_0x6d9b('0x31')]);_0x557ecb[_0x6d9b('0x35')]=_[_0x6d9b('0x34')](_0x18a4c0[_0x6d9b('0x36')],qs[_0x6d9b('0x37')](_0x15ebd8[_0x6d9b('0x31')][_0x6d9b('0x37')]));_0x557ecb[_0x6d9b('0x35')]=_0x557ecb['attributes'][_0x6d9b('0x38')]?_0x557ecb['attributes']:_0x18a4c0['model'];_0x557ecb[_0x6d9b('0x3c')]=qs[_0x6d9b('0x3d')](_0x15ebd8['query'][_0x6d9b('0x3d')]);_0x557ecb[_0x6d9b('0x40')]=qs[_0x6d9b('0x33')](_['pick'](_0x15ebd8[_0x6d9b('0x31')],_0x18a4c0['filters']));if(_0x15ebd8[_0x6d9b('0x31')][_0x6d9b('0x3f')]){_0x557ecb['where']=_[_0x6d9b('0x41')](_0x557ecb[_0x6d9b('0x40')],{'$or':_[_0x6d9b('0x2d')](_0x557ecb[_0x6d9b('0x35')],function(_0x2f0f1d){var _0x23572d={};_0x23572d[_0x2f0f1d]={'$like':'%'+_0x15ebd8['query'][_0x6d9b('0x3f')]+'%'};return _0x23572d;})});}_0x557ecb=_['merge']({},_0x557ecb,_0x15ebd8[_0x6d9b('0x43')]);return _0x3cbd1a[_0x6d9b('0x79')](_0x557ecb);}})[_0x6d9b('0x26')](function(_0x367e3c){if(_0x367e3c){_0x5bb011=_0x367e3c[_0x6d9b('0x38')];if(!_0x15ebd8[_0x6d9b('0x31')][_0x6d9b('0x39')](_0x6d9b('0x3a'))){_0x557ecb[_0x6d9b('0x3b')]=qs[_0x6d9b('0x3b')](_0x15ebd8[_0x6d9b('0x31')][_0x6d9b('0x3b')]);_0x557ecb['offset']=qs[_0x6d9b('0x20')](_0x15ebd8['query'][_0x6d9b('0x20')]);}return _0x3cbd1a[_0x6d9b('0x79')](_0x557ecb);}})[_0x6d9b('0x26')](function(_0x4e130d){if(_0x4e130d){return _0x4e130d?{'count':_0x5bb011,'rows':_0x4e130d}:null;}})[_0x6d9b('0x26')](respondWithResult(_0xee65b0,null))[_0x6d9b('0x4b')](handleError(_0xee65b0,null));}; \ No newline at end of file +var _0x2555=['show','keys','find','describe','catch','create','sequelize','transaction','body','VoiceExtension','VoiceExtensionId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','context','from-sip','app','Voice\x20Prefix\x20Extension','priority','appdata','NoOp','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','${EXTEN:','charAt','update','system-','params','addAgents','ids','spread','emit','removeAgents','userVoicePrefix:remove','getAgents','User','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','sendStatus','status','end','count','offset','limit','json','apply','reject','save','then','destroy','get','VoicePrefixes','UserProfileResource','error','stack','name','send','index','map','VoicePrefix','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x2555,0x11a));var _0x5255=function(_0xc9a290,_0xe9f2e9){_0xc9a290=_0xc9a290-0x0;var _0x45a6ba=_0x2555[_0xc9a290];return _0x45a6ba;};'use strict';var pdf=require(_0x5255('0x0'));var emlformat=require(_0x5255('0x1'));var rimraf=require(_0x5255('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5255('0x3'));var rp=require(_0x5255('0x4'));var moment=require(_0x5255('0x5'));var BPromise=require(_0x5255('0x6'));var Mustache=require('mustache');var util=require(_0x5255('0x7'));var path=require(_0x5255('0x8'));var sox=require('sox');var csv=require(_0x5255('0x9'));var ejs=require(_0x5255('0xa'));var fs=require('fs');var _=require(_0x5255('0xb'));var squel=require(_0x5255('0xc'));var crypto=require(_0x5255('0xd'));var jsforce=require(_0x5255('0xe'));var deskjs=require(_0x5255('0xf'));var toCsv=require(_0x5255('0x9'));var querystring=require('querystring');var Papa=require(_0x5255('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5255('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5255('0x12'));var utils=require(_0x5255('0x13'));var config=require(_0x5255('0x14'));var db=require(_0x5255('0x15'))['db'];config[_0x5255('0x16')]=_[_0x5255('0x17')](config[_0x5255('0x16')],{'host':_0x5255('0x18'),'port':0x18eb});var socket=require(_0x5255('0x19'))(new Redis(config[_0x5255('0x16')]));require(_0x5255('0x1a'))['register'](socket);function respondWithStatusCode(_0x10e787,_0xe742d1){_0xe742d1=_0xe742d1||0xcc;return function(_0x4d405b){if(_0x4d405b){return _0x10e787[_0x5255('0x1b')](_0xe742d1);}return _0x10e787[_0x5255('0x1c')](_0xe742d1)[_0x5255('0x1d')]();};}function respondWithResult(_0x1c9009,_0x5b283b){_0x5b283b=_0x5b283b||0xc8;return function(_0x4ad782){if(_0x4ad782){return _0x1c9009[_0x5255('0x1c')](_0x5b283b)['json'](_0x4ad782);}};}function respondWithFilteredResult(_0x163024,_0x3b8d27){return function(_0xb6b71a){if(_0xb6b71a){var _0x1f3097=_0xb6b71a[_0x5255('0x1e')],_0x4606cc=_0x3b8d27[_0x5255('0x1f')],_0x4b5cb0=_0x3b8d27[_0x5255('0x1f')]+_0x3b8d27[_0x5255('0x20')],_0x4b7d5c;if(_0x4b5cb0>=_0x1f3097){_0x4b5cb0=_0x1f3097;_0x4b7d5c=0xc8;}else{_0x4b7d5c=0xce;}_0x163024['status'](_0x4b7d5c);return _0x163024['set']('Content-Range',_0x4606cc+'-'+_0x4b5cb0+'/'+_0x1f3097)[_0x5255('0x21')](_0xb6b71a);}return null;};}function patchUpdates(_0x435703){return function(_0x1d9034){try{jsonpatch[_0x5255('0x22')](_0x1d9034,_0x435703,!![]);}catch(_0x9f20d7){return BPromise[_0x5255('0x23')](_0x9f20d7);}return _0x1d9034[_0x5255('0x24')]();};}function saveUpdates(_0xb01632,_0x17e313){return function(_0x4e9ff1){if(_0x4e9ff1){return _0x4e9ff1['update'](_0xb01632)[_0x5255('0x25')](function(_0x37cfe9){return _0x37cfe9;});}return null;};}function removeEntity(_0x17280e,_0x167e5b){return function(_0x3f0a94){if(_0x3f0a94){return _0x3f0a94[_0x5255('0x26')]()[_0x5255('0x25')](function(){var _0xc5db18=_0x3f0a94[_0x5255('0x27')]({'plain':!![]});var _0x39f00f=_0x5255('0x28');return db[_0x5255('0x29')]['destroy']({'where':{'type':_0x39f00f,'resourceId':_0xc5db18['id']}})[_0x5255('0x25')](function(){return _0x3f0a94;});})[_0x5255('0x25')](function(){_0x17280e[_0x5255('0x1c')](0xcc)[_0x5255('0x1d')]();});}};}function handleEntityNotFound(_0x597e69,_0x32e977){return function(_0x19ed55){if(!_0x19ed55){_0x597e69[_0x5255('0x1b')](0x194);}return _0x19ed55;};}function handleError(_0x2ed819,_0x9e375f){_0x9e375f=_0x9e375f||0x1f4;return function(_0x5575f3){logger[_0x5255('0x2a')](_0x5575f3[_0x5255('0x2b')]);if(_0x5575f3[_0x5255('0x2c')]){delete _0x5575f3[_0x5255('0x2c')];}_0x2ed819[_0x5255('0x1c')](_0x9e375f)[_0x5255('0x2d')](_0x5575f3);};}exports[_0x5255('0x2e')]=function(_0x1ae792,_0x742d77){var _0x271374={},_0x4ed96c={},_0x26b716={'count':0x0,'rows':[]};var _0x3c9afe=_[_0x5255('0x2f')](db[_0x5255('0x30')][_0x5255('0x31')],function(_0xce21fb){return{'name':_0xce21fb[_0x5255('0x32')],'type':_0xce21fb[_0x5255('0x33')]['key']};});_0x4ed96c['model']=_[_0x5255('0x2f')](_0x3c9afe,_0x5255('0x2c'));_0x4ed96c[_0x5255('0x34')]=_['keys'](_0x1ae792['query']);_0x4ed96c[_0x5255('0x35')]=_[_0x5255('0x36')](_0x4ed96c[_0x5255('0x37')],_0x4ed96c[_0x5255('0x34')]);_0x271374[_0x5255('0x38')]=_[_0x5255('0x36')](_0x4ed96c[_0x5255('0x37')],qs[_0x5255('0x39')](_0x1ae792[_0x5255('0x34')][_0x5255('0x39')]));_0x271374[_0x5255('0x38')]=_0x271374[_0x5255('0x38')][_0x5255('0x3a')]?_0x271374['attributes']:_0x4ed96c[_0x5255('0x37')];if(!_0x1ae792[_0x5255('0x34')][_0x5255('0x3b')](_0x5255('0x3c'))){_0x271374[_0x5255('0x20')]=qs[_0x5255('0x20')](_0x1ae792['query'][_0x5255('0x20')]);_0x271374[_0x5255('0x1f')]=qs[_0x5255('0x1f')](_0x1ae792[_0x5255('0x34')][_0x5255('0x1f')]);}_0x271374[_0x5255('0x3d')]=qs[_0x5255('0x3e')](_0x1ae792[_0x5255('0x34')][_0x5255('0x3e')]);_0x271374[_0x5255('0x3f')]=qs['filters'](_[_0x5255('0x40')](_0x1ae792[_0x5255('0x34')],_0x4ed96c[_0x5255('0x35')]));if(_0x1ae792[_0x5255('0x34')][_0x5255('0x41')]){_0x271374[_0x5255('0x3f')]=_[_0x5255('0x42')](_0x271374[_0x5255('0x3f')],{'$or':_[_0x5255('0x2f')](_0x3c9afe,function(_0x1149ee){if(_0x1149ee[_0x5255('0x33')]!==_0x5255('0x43')){var _0x315400={};_0x315400[_0x1149ee[_0x5255('0x2c')]]={'$like':'%'+_0x1ae792[_0x5255('0x34')][_0x5255('0x41')]+'%'};return _0x315400;}})});}_0x271374=_['merge']({},_0x271374,_0x1ae792[_0x5255('0x44')]);var _0x5d486c={'where':_0x271374['where']};return db['VoicePrefix'][_0x5255('0x1e')](_0x5d486c)['then'](function(_0x1bb759){_0x26b716[_0x5255('0x1e')]=_0x1bb759;if(_0x1ae792['query'][_0x5255('0x45')]){_0x271374[_0x5255('0x46')]=[{'all':!![]}];}return db[_0x5255('0x30')][_0x5255('0x47')](_0x271374);})[_0x5255('0x25')](function(_0x2dda15){_0x26b716['rows']=_0x2dda15;return _0x26b716;})[_0x5255('0x25')](respondWithFilteredResult(_0x742d77,_0x271374))['catch'](handleError(_0x742d77,null));};exports[_0x5255('0x48')]=function(_0x52b48e,_0xcbf9ae){var _0x27be6d={'raw':![],'where':{'id':_0x52b48e['params']['id']}},_0x2a3555={};_0x2a3555[_0x5255('0x37')]=_[_0x5255('0x49')](db[_0x5255('0x30')][_0x5255('0x31')]);_0x2a3555[_0x5255('0x34')]=_[_0x5255('0x49')](_0x52b48e['query']);_0x2a3555[_0x5255('0x35')]=_[_0x5255('0x36')](_0x2a3555[_0x5255('0x37')],_0x2a3555[_0x5255('0x34')]);_0x27be6d[_0x5255('0x38')]=_[_0x5255('0x36')](_0x2a3555[_0x5255('0x37')],qs[_0x5255('0x39')](_0x52b48e[_0x5255('0x34')][_0x5255('0x39')]));_0x27be6d[_0x5255('0x38')]=_0x27be6d[_0x5255('0x38')][_0x5255('0x3a')]?_0x27be6d[_0x5255('0x38')]:_0x2a3555[_0x5255('0x37')];if(_0x52b48e[_0x5255('0x34')][_0x5255('0x45')]){_0x27be6d[_0x5255('0x46')]=[{'all':!![]}];}_0x27be6d=_[_0x5255('0x42')]({},_0x27be6d,_0x52b48e[_0x5255('0x44')]);return db['VoicePrefix'][_0x5255('0x4a')](_0x27be6d)[_0x5255('0x25')](handleEntityNotFound(_0xcbf9ae,null))[_0x5255('0x25')](respondWithResult(_0xcbf9ae,null))['catch'](handleError(_0xcbf9ae,null));};exports['destroy']=function(_0x508d9f,_0x5661a3){return db[_0x5255('0x30')][_0x5255('0x4a')]({'where':{'id':_0x508d9f['params']['id']}})['then'](handleEntityNotFound(_0x5661a3,null))[_0x5255('0x25')](removeEntity(_0x5661a3,null))['catch'](handleError(_0x5661a3,null));};exports[_0x5255('0x4b')]=function(_0x10caa3,_0x258f32){return db[_0x5255('0x30')][_0x5255('0x4b')]()[_0x5255('0x25')](respondWithResult(_0x258f32,null))[_0x5255('0x4c')](handleError(_0x258f32,null));};exports[_0x5255('0x4d')]=function(_0x5f1463,_0x363cad){var _0x5cbc61;return db[_0x5255('0x4e')][_0x5255('0x4f')](function(_0x4ba994){return db['VoicePrefix'][_0x5255('0x4d')](_0x5f1463[_0x5255('0x50')],{'transaction':_0x4ba994})[_0x5255('0x25')](function(_0x364afd){_0x5cbc61=_0x364afd[_0x5255('0x27')]({'plain':!![]});return db[_0x5255('0x51')][_0x5255('0x4a')]({'where':{'id':_0x5cbc61[_0x5255('0x52')]},'raw':!![]})['then'](function(_0x3f75b1){return createVoicePrefixExtensions(_0x5cbc61,_0x3f75b1,_0x4ba994);});});})[_0x5255('0x25')](function(){var _0x1ba86e=_0x5f1463['user'][_0x5255('0x27')]({'plain':!![]});if(!_0x1ba86e)throw new Error(_0x5255('0x53'));if(_0x1ba86e[_0x5255('0x54')]===_0x5255('0x55')){var _0x438982=_0x5cbc61;return db[_0x5255('0x56')][_0x5255('0x4a')]({'where':{'name':'VoicePrefixes','userProfileId':_0x1ba86e['userProfileId']},'raw':!![]})[_0x5255('0x25')](function(_0x4ca303){if(_0x4ca303&&_0x4ca303[_0x5255('0x57')]===0x0){return db[_0x5255('0x29')][_0x5255('0x4d')]({'name':_0x438982['name'],'resourceId':_0x438982['id'],'type':_0x4ca303['name'],'sectionId':_0x4ca303['id']},{})[_0x5255('0x25')](function(){return _0x5cbc61;});}else{return _0x5cbc61;}})[_0x5255('0x4c')](function(_0x4e42ca){logger[_0x5255('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4e42ca);throw _0x4e42ca;});}return _0x5cbc61;})['then'](respondWithResult(_0x363cad,null))[_0x5255('0x4c')](handleError(_0x363cad,null));};function Extension(_0x11ff57,_0x2e36dd,_0x3af597,_0x48dbcc){this[_0x5255('0x58')]=_0x5255('0x59');this['exten']=_0x11ff57;this[_0x5255('0x5a')]=_0x3af597;this[_0x5255('0x33')]='system';this['description']=_0x5255('0x5b');this[_0x5255('0x5c')]=_0x2e36dd;this[_0x5255('0x5d')]=_0x48dbcc;}function createVoicePrefixExtensions(_0x320b25,_0x2a7031,_0x1093a0){return new BPromise(function(_0x7baec0,_0x28c6b6){var _0x5294ec=new Extension(formatPrefixName(_0x320b25['prefix']),0x1,_0x5255('0x5e'),'Voice\x20Prefix');_0x5294ec[_0x5255('0x5f')]=_0x320b25['id'];return db['VoiceExtension'][_0x5255('0x4d')](_0x5294ec,{'transaction':_0x1093a0})[_0x5255('0x25')](function(_0x54ac5f){var _0x289011=_0x54ac5f[_0x5255('0x27')]({'plain':!![]});var _0x7b8909=_[_0x5255('0x2f')](addVoicePrefixExtensions(_0x320b25,_0x2a7031),function(_0x506364){_0x506364[_0x5255('0x52')]=_0x289011['id'];_0x506364[_0x5255('0x5f')]=_0x320b25['id'];return _0x506364;});return db['VoiceExtension'][_0x5255('0x60')](_0x7b8909,{'transaction':_0x1093a0})[_0x5255('0x25')](function(_0x30ce8a){if(!_0x30ce8a){return _0x28c6b6(_0x5255('0x61'));}else{return _0x7baec0(_0x30ce8a);}})['catch'](function(_0xac1065){return _0x28c6b6(_0xac1065);});});;});};function addVoicePrefixExtensions(_0x37df78,_0x571e0a){var _0x518be0=[];var _0x556319=formatPrefixName(_0x37df78[_0x5255('0x62')]);_0x518be0[_0x5255('0x63')](new Extension(_0x556319,0x2,_0x5255('0x64'),_0x5255('0x65')+_0x37df78['name']));if(_0x37df78[_0x5255('0x66')]){_0x518be0[_0x5255('0x63')](new Extension(_0x556319,0x3,_0x5255('0x64'),_0x5255('0x67')+_0x37df78[_0x5255('0x66')]));}else{_0x518be0[_0x5255('0x63')](new Extension(_0x556319,0x3,_0x5255('0x5e'),_0x5255('0x68')));}_0x518be0[_0x5255('0x63')](new Extension(_0x556319,0x4,'goto',_0x571e0a[_0x5255('0x58')]+','+_0x5255('0x69')+(0x8+_0x37df78[_0x5255('0x2c')][_0x5255('0x3a')])+'}'+','+0x1));return _0x518be0;}function formatPrefixName(_0xe6df4f){var _0x584a78='_';for(var _0x42d885=0x0;_0x42d885<_0xe6df4f[_0x5255('0x3a')];_0x42d885++){if(_0xe6df4f[_0x5255('0x6a')](_0x42d885)=='-'){_0x584a78+=_0xe6df4f[_0x5255('0x6a')](_0x42d885);}else{_0x584a78+='['+_0xe6df4f[_0x5255('0x6a')](_0x42d885)+']';}}_0x584a78+='.';return _0x584a78;}exports[_0x5255('0x6b')]=function(_0xbc1c00,_0x332f1e,_0x2e7957){var _0x3a4c4e=_0xbc1c00[_0x5255('0x50')];_0x3a4c4e['prefix']=_0x5255('0x6c')+_0x3a4c4e[_0x5255('0x2c')]+'-';return db[_0x5255('0x4e')][_0x5255('0x4f')](function(_0x13e49c){return db['VoicePrefix']['update'](_0x3a4c4e,{'where':{'id':_0x3a4c4e['id']},'transaction':_0x13e49c})[_0x5255('0x25')](function(){return db['VoiceExtension'][_0x5255('0x26')]({'where':{'VoicePrefixId':_0x3a4c4e['id']},'transaction':_0x13e49c})[_0x5255('0x25')](function(){return db[_0x5255('0x51')][_0x5255('0x4a')]({'where':{'id':_0x3a4c4e['VoiceExtensionId']},'raw':!![]})[_0x5255('0x25')](function(_0x3b5e94){return createVoicePrefixExtensions(_0x3a4c4e,_0x3b5e94,_0x13e49c);});});});})['then'](function(){return db['VoicePrefix']['findById'](_0x3a4c4e['id']);})[_0x5255('0x25')](respondWithResult(_0x332f1e,null))[_0x5255('0x4c')](handleError(_0x332f1e,null));};exports['addAgents']=function(_0x2939eb,_0x4e4b46,_0x1e3c90){return db[_0x5255('0x30')][_0x5255('0x4a')]({'where':{'id':_0x2939eb[_0x5255('0x6d')]['id']}})['then'](handleEntityNotFound(_0x4e4b46,null))['then'](function(_0x2da2b1){if(_0x2da2b1){return _0x2da2b1[_0x5255('0x6e')](_0x2939eb[_0x5255('0x50')][_0x5255('0x6f')],_['omit'](_0x2939eb[_0x5255('0x50')],[_0x5255('0x6f'),'id'])||{})[_0x5255('0x70')](function(_0x28217d){for(var _0x259fb8=0x0;_0x259fb8<_0x2939eb[_0x5255('0x50')]['ids']['length'];_0x259fb8+=0x1){socket[_0x5255('0x71')]('userVoicePrefix:save',{'UserId':_0x2939eb[_0x5255('0x50')][_0x5255('0x6f')][_0x259fb8],'VoicePrefixId':_0x2939eb[_0x5255('0x6d')]['id']});}return _0x28217d;});}})[_0x5255('0x25')](respondWithResult(_0x4e4b46,null))[_0x5255('0x4c')](handleError(_0x4e4b46,null));};exports[_0x5255('0x72')]=function(_0x3d39fe,_0x583dd8,_0x1daca7){return db['VoicePrefix'][_0x5255('0x4a')]({'where':{'id':_0x3d39fe[_0x5255('0x6d')]['id']}})[_0x5255('0x25')](handleEntityNotFound(_0x583dd8,null))[_0x5255('0x25')](function(_0x56e3b5){if(_0x56e3b5){return _0x56e3b5[_0x5255('0x72')](_0x3d39fe['query'][_0x5255('0x6f')])[_0x5255('0x25')](function(){if(_['isArray'](_0x3d39fe[_0x5255('0x34')][_0x5255('0x6f')])){for(var _0x3b57e0=0x0;_0x3b57e0<_0x3d39fe[_0x5255('0x34')][_0x5255('0x6f')][_0x5255('0x3a')];_0x3b57e0+=0x1){socket[_0x5255('0x71')]('userVoicePrefix:remove',{'UserId':Number(_0x3d39fe[_0x5255('0x34')][_0x5255('0x6f')][_0x3b57e0]),'VoicePrefixId':Number(_0x3d39fe[_0x5255('0x6d')]['id'])});}}else{socket[_0x5255('0x71')](_0x5255('0x73'),{'UserId':Number(_0x3d39fe['query'][_0x5255('0x6f')]),'VoicePrefixId':Number(_0x3d39fe[_0x5255('0x6d')]['id'])});}});}})[_0x5255('0x25')](respondWithStatusCode(_0x583dd8,null))[_0x5255('0x4c')](handleError(_0x583dd8,null));};exports[_0x5255('0x74')]=function(_0x52b8f5,_0x4790ee,_0x11c38b){var _0x2f8172={};var _0x723304={};var _0x3c1298;var _0x2cb5ae;return db[_0x5255('0x30')]['findOne']({'where':{'id':_0x52b8f5[_0x5255('0x6d')]['id']}})[_0x5255('0x25')](handleEntityNotFound(_0x4790ee,null))[_0x5255('0x25')](function(_0x4b6067){if(_0x4b6067){_0x3c1298=_0x4b6067;_0x723304['model']=_[_0x5255('0x49')](db[_0x5255('0x75')][_0x5255('0x31')]);_0x723304[_0x5255('0x34')]=_[_0x5255('0x49')](_0x52b8f5['query']);_0x723304[_0x5255('0x35')]=_[_0x5255('0x36')](_0x723304['model'],_0x723304[_0x5255('0x34')]);_0x2f8172[_0x5255('0x38')]=_[_0x5255('0x36')](_0x723304[_0x5255('0x37')],qs[_0x5255('0x39')](_0x52b8f5[_0x5255('0x34')][_0x5255('0x39')]));_0x2f8172[_0x5255('0x38')]=_0x2f8172[_0x5255('0x38')][_0x5255('0x3a')]?_0x2f8172[_0x5255('0x38')]:_0x723304[_0x5255('0x37')];_0x2f8172['order']=qs[_0x5255('0x3e')](_0x52b8f5[_0x5255('0x34')][_0x5255('0x3e')]);_0x2f8172[_0x5255('0x3f')]=qs[_0x5255('0x35')](_[_0x5255('0x40')](_0x52b8f5['query'],_0x723304[_0x5255('0x35')]));if(_0x52b8f5[_0x5255('0x34')][_0x5255('0x41')]){_0x2f8172['where']=_['merge'](_0x2f8172[_0x5255('0x3f')],{'$or':_[_0x5255('0x2f')](_0x2f8172[_0x5255('0x38')],function(_0xf25d5e){var _0xe858db={};_0xe858db[_0xf25d5e]={'$like':'%'+_0x52b8f5['query'][_0x5255('0x41')]+'%'};return _0xe858db;})});}_0x2f8172=_[_0x5255('0x42')]({},_0x2f8172,_0x52b8f5['options']);return _0x3c1298[_0x5255('0x74')](_0x2f8172);}})[_0x5255('0x25')](function(_0x7a1b21){if(_0x7a1b21){_0x2cb5ae=_0x7a1b21['length'];if(!_0x52b8f5[_0x5255('0x34')][_0x5255('0x3b')](_0x5255('0x3c'))){_0x2f8172[_0x5255('0x20')]=qs['limit'](_0x52b8f5[_0x5255('0x34')][_0x5255('0x20')]);_0x2f8172[_0x5255('0x1f')]=qs[_0x5255('0x1f')](_0x52b8f5[_0x5255('0x34')]['offset']);}return _0x3c1298[_0x5255('0x74')](_0x2f8172);}})[_0x5255('0x25')](function(_0x334396){if(_0x334396){return _0x334396?{'count':_0x2cb5ae,'rows':_0x334396}:null;}})[_0x5255('0x25')](respondWithResult(_0x4790ee,null))[_0x5255('0x4c')](handleError(_0x4790ee,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index 254dbbc..cb3e6b5 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 _0xedd9=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xedd9,0xfc));var _0x9edd=function(_0x3c63d6,_0x144da3){_0x3c63d6=_0x3c63d6-0x0;var _0x5b77fb=_0xedd9[_0x3c63d6];return _0x5b77fb;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0xedd9=['../../mysqldb','VoicePrefix','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xedd9,0xfc));var _0x9edd=function(_0x4a9bdd,_0x5098f5){_0x4a9bdd=_0x4a9bdd-0x0;var _0x1ba3a4=_0xedd9[_0x4a9bdd];return _0x1ba3a4;};'use strict';var EventEmitter=require('events');var VoicePrefix=require(_0x9edd('0x0'))['db'][_0x9edd('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x9edd('0x2')](0x0);var events={'afterCreate':_0x9edd('0x3'),'afterUpdate':_0x9edd('0x4'),'afterDestroy':_0x9edd('0x5')};function emitEvent(_0x3e6d3a){return function(_0x36b53f,_0x5943b3,_0x33679f){VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a+':'+_0x36b53f['id'],_0x36b53f);VoicePrefixEvents[_0x9edd('0x6')](_0x3e6d3a,_0x36b53f);_0x33679f(null);};}for(var e in events){if(events[_0x9edd('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x9edd('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 662efa3..0e95408 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 _0x49e5=['define','VoicePrefix','lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes'];(function(_0x2d5520,_0x39fc94){var _0x1f20dd=function(_0x107420){while(--_0x107420){_0x2d5520['push'](_0x2d5520['shift']());}};_0x1f20dd(++_0x39fc94);}(_0x49e5,0x1e6));var _0x549e=function(_0xbd7498,_0x417297){_0xbd7498=_0xbd7498-0x0;var _0x22920a=_0x49e5[_0xbd7498];return _0x22920a;};'use strict';var _=require(_0x549e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x549e('0x1'));var moment=require(_0x549e('0x2'));var BPromise=require(_0x549e('0x3'));var rp=require(_0x549e('0x4'));var fs=require('fs');var path=require(_0x549e('0x5'));var rimraf=require(_0x549e('0x6'));var config=require(_0x549e('0x7'));var attributes=require(_0x549e('0x8'));module['exports']=function(_0x4cad64,_0x5ab6a0){return _0x4cad64[_0x549e('0x9')](_0x549e('0xa'),attributes,{'tableName':'voice_prefixes','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb741=['bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','define','VoicePrefix','voice_prefixes','lodash','util','../../config/logger'];(function(_0xb11544,_0x79d425){var _0x502073=function(_0x5bc518){while(--_0x5bc518){_0xb11544['push'](_0xb11544['shift']());}};_0x502073(++_0x79d425);}(_0xb741,0xa5));var _0x1b74=function(_0x5451d6,_0x58ed6a){_0x5451d6=_0x5451d6-0x0;var _0x5ccbd4=_0xb741[_0x5451d6];return _0x5ccbd4;};'use strict';var _=require(_0x1b74('0x0'));var util=require(_0x1b74('0x1'));var logger=require(_0x1b74('0x2'))('api');var moment=require('moment');var BPromise=require(_0x1b74('0x3'));var rp=require(_0x1b74('0x4'));var fs=require('fs');var path=require(_0x1b74('0x5'));var rimraf=require(_0x1b74('0x6'));var config=require(_0x1b74('0x7'));var attributes=require(_0x1b74('0x8'));module['exports']=function(_0x3f5573,_0x2088a8){return _0x3f5573[_0x1b74('0x9')](_0x1b74('0xa'),attributes,{'tableName':_0x1b74('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.rpc.js b/server/api/voicePrefix/voicePrefix.rpc.js index e1ff46a..36cdf65 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 _0xe28c=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','request','info','VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe28c,0x110));var _0xce28=function(_0x2134b2,_0x5a82aa){_0x2134b2=_0x2134b2-0x0;var _0x4e4bc8=_0xe28c[_0x2134b2];return _0x4e4bc8;};'use strict';var _=require(_0xce28('0x0'));var util=require(_0xce28('0x1'));var moment=require(_0xce28('0x2'));var BPromise=require(_0xce28('0x3'));var rs=require(_0xce28('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce28('0x5'))['db'];var utils=require(_0xce28('0x6'));var logger=require('../../config/logger')(_0xce28('0x7'));var config=require('../../config/environment');var jayson=require(_0xce28('0x8'));var client=jayson['client'][_0xce28('0x9')]({'port':0x232a});config[_0xce28('0xa')]=_[_0xce28('0xb')](config['redis'],{'host':_0xce28('0xc'),'port':0x18eb});var socket=require(_0xce28('0xd'))(new Redis(config[_0xce28('0xa')]));require(_0xce28('0xe'))['register'](socket);function respondWithRpcPromise(_0x4ae230,_0x33f3d2,_0x4f9573){return new BPromise(function(_0x4508cd,_0x230dc0){return client[_0xce28('0xf')](_0x4ae230,_0x4f9573)['then'](function(_0x1a998b){logger[_0xce28('0x10')](_0xce28('0x11'),_0x33f3d2,'request\x20sent');logger[_0xce28('0x12')](_0xce28('0x13'),_0x33f3d2,'request\x20sent',JSON[_0xce28('0x14')](_0x1a998b));if(_0x1a998b[_0xce28('0x15')]){if(_0x1a998b[_0xce28('0x15')][_0xce28('0x16')]===0x1f4){logger[_0xce28('0x15')](_0xce28('0x11'),_0x33f3d2,_0x1a998b[_0xce28('0x15')][_0xce28('0x17')]);return _0x230dc0(_0x1a998b[_0xce28('0x15')][_0xce28('0x17')]);}logger['error']('VoicePrefix,\x20%s,\x20%s',_0x33f3d2,_0x1a998b['error'][_0xce28('0x17')]);return _0x4508cd(_0x1a998b[_0xce28('0x15')][_0xce28('0x17')]);}else{logger[_0xce28('0x10')](_0xce28('0x11'),_0x33f3d2,_0xce28('0x18'));_0x4508cd(_0x1a998b[_0xce28('0x19')]['message']);}})[_0xce28('0x1a')](function(_0x5be893){logger[_0xce28('0x15')](_0xce28('0x11'),_0x33f3d2,_0x5be893);_0x230dc0(_0x5be893);});});} \ No newline at end of file +var _0x77b0=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','./voicePrefix.socket','register','request','info','VoicePrefix,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result'];(function(_0x343e45,_0x16d628){var _0x42ba70=function(_0x1cf77d){while(--_0x1cf77d){_0x343e45['push'](_0x343e45['shift']());}};_0x42ba70(++_0x16d628);}(_0x77b0,0x8d));var _0x077b=function(_0x809b74,_0x36bf1d){_0x809b74=_0x809b74-0x0;var _0x3cf408=_0x77b0[_0x809b74];return _0x3cf408;};'use strict';var _=require(_0x077b('0x0'));var util=require(_0x077b('0x1'));var moment=require(_0x077b('0x2'));var BPromise=require(_0x077b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x077b('0x4'));var db=require(_0x077b('0x5'))['db'];var utils=require(_0x077b('0x6'));var logger=require(_0x077b('0x7'))(_0x077b('0x8'));var config=require(_0x077b('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x077b('0xa')]['http']({'port':0x232a});config[_0x077b('0xb')]=_[_0x077b('0xc')](config['redis'],{'host':_0x077b('0xd'),'port':0x18eb});var socket=require(_0x077b('0xe'))(new Redis(config[_0x077b('0xb')]));require(_0x077b('0xf'))[_0x077b('0x10')](socket);function respondWithRpcPromise(_0x3f0ba9,_0x5ecb96,_0x3932ab){return new BPromise(function(_0x61a6ea,_0x424fd2){return client[_0x077b('0x11')](_0x3f0ba9,_0x3932ab)['then'](function(_0x4fafd5){logger[_0x077b('0x12')](_0x077b('0x13'),_0x5ecb96,'request\x20sent');logger[_0x077b('0x14')]('VoicePrefix,\x20%s,\x20%s,\x20%s',_0x5ecb96,'request\x20sent',JSON[_0x077b('0x15')](_0x4fafd5));if(_0x4fafd5['error']){if(_0x4fafd5[_0x077b('0x16')][_0x077b('0x17')]===0x1f4){logger[_0x077b('0x16')](_0x077b('0x13'),_0x5ecb96,_0x4fafd5[_0x077b('0x16')][_0x077b('0x18')]);return _0x424fd2(_0x4fafd5[_0x077b('0x16')]['message']);}logger[_0x077b('0x16')](_0x077b('0x13'),_0x5ecb96,_0x4fafd5['error']['message']);return _0x61a6ea(_0x4fafd5[_0x077b('0x16')][_0x077b('0x18')]);}else{logger[_0x077b('0x12')](_0x077b('0x13'),_0x5ecb96,_0x077b('0x19'));_0x61a6ea(_0x4fafd5[_0x077b('0x1a')][_0x077b('0x18')]);}})[_0x077b('0x1b')](function(_0x3032e5){logger[_0x077b('0x16')](_0x077b('0x13'),_0x5ecb96,_0x3032e5);_0x424fd2(_0x3032e5);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 2172f6f..0bd7c16 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 _0x5100=['save','remove','update','emit','removeListener','length','voicePrefix:','./voicePrefix.events'];(function(_0x2d21c3,_0x141740){var _0x1e8310=function(_0x207d68){while(--_0x207d68){_0x2d21c3['push'](_0x2d21c3['shift']());}};_0x1e8310(++_0x141740);}(_0x5100,0x6f));var _0x0510=function(_0xdaf200,_0x575329){_0xdaf200=_0xdaf200-0x0;var _0x41db04=_0x5100[_0xdaf200];return _0x41db04;};'use strict';var VoicePrefixEvents=require(_0x0510('0x0'));var events=[_0x0510('0x1'),_0x0510('0x2'),_0x0510('0x3')];function createListener(_0x1627d9,_0x2329ef){return function(_0x4a0c81){_0x2329ef[_0x0510('0x4')](_0x1627d9,_0x4a0c81);};}function removeListener(_0x1827cf,_0x186126){return function(){VoicePrefixEvents[_0x0510('0x5')](_0x1827cf,_0x186126);};}exports['register']=function(_0x6bc9cd){for(var _0x41956a=0x0,_0x528db4=events[_0x0510('0x6')];_0x41956a<_0x528db4;_0x41956a++){var _0x466430=events[_0x41956a];var _0x3f77ee=createListener(_0x0510('0x7')+_0x466430,_0x6bc9cd);VoicePrefixEvents['on'](_0x466430,_0x3f77ee);}}; \ No newline at end of file +var _0x6a59=['removeListener','register','length','remove','update','emit'];(function(_0x1ebd9f,_0x19868c){var _0x508ff2=function(_0x469b2a){while(--_0x469b2a){_0x1ebd9f['push'](_0x1ebd9f['shift']());}};_0x508ff2(++_0x19868c);}(_0x6a59,0x123));var _0x96a5=function(_0x11ce46,_0x177a85){_0x11ce46=_0x11ce46-0x0;var _0x368a1e=_0x6a59[_0x11ce46];return _0x368a1e;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=['save',_0x96a5('0x0'),_0x96a5('0x1')];function createListener(_0x1f3e65,_0x65bad){return function(_0x383137){_0x65bad[_0x96a5('0x2')](_0x1f3e65,_0x383137);};}function removeListener(_0x494246,_0x18203f){return function(){VoicePrefixEvents[_0x96a5('0x3')](_0x494246,_0x18203f);};}exports[_0x96a5('0x4')]=function(_0x5e5777){for(var _0x480a77=0x0,_0x36197f=events[_0x96a5('0x5')];_0x480a77<_0x36197f;_0x480a77++){var _0x1f99f1=events[_0x480a77];var _0x129a78=createListener('voicePrefix:'+_0x1f99f1,_0x5e5777);VoicePrefixEvents['on'](_0x1f99f1,_0x129a78);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 912d389..2a1b202 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 _0x6a7b=['show','/:id/hoppers','isAuthenticated','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addTeams','addLists','addBlackLists','put','update','delete','destroy','/:id/teams','removeTeams','removeBlackLists','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0x6a7b,0x93));var _0xb6a7=function(_0x480689,_0x1c6e02){_0x480689=_0x480689-0x0;var _0x22905f=_0x6a7b[_0x480689];return _0x22905f;};'use strict';var multer=require(_0xb6a7('0x0'));var util=require(_0xb6a7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb6a7('0x2'));var router=express[_0xb6a7('0x3')]();var auth=require(_0xb6a7('0x4'));var interaction=require(_0xb6a7('0x5'));var config=require(_0xb6a7('0x6'));var controller=require('./voiceQueue.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0xb6a7('0x7')](_0xb6a7('0x8'),auth['isAuthenticated'](),controller[_0xb6a7('0x9')]);router[_0xb6a7('0x7')](_0xb6a7('0xa'),auth[_0xb6a7('0xb')](),controller[_0xb6a7('0xc')]);router[_0xb6a7('0x7')](_0xb6a7('0xd'),auth['isAuthenticated'](),controller[_0xb6a7('0xe')]);router[_0xb6a7('0x7')](_0xb6a7('0xf'),auth['isAuthenticated'](),controller[_0xb6a7('0x10')]);router['get']('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xb6a7('0x11')]);router[_0xb6a7('0x7')]('/:id/teams',auth['isAuthenticated'](),controller['getTeams']);router[_0xb6a7('0x7')](_0xb6a7('0x12'),auth[_0xb6a7('0xb')](),controller[_0xb6a7('0x13')]);router[_0xb6a7('0x7')](_0xb6a7('0x14'),auth['isAuthenticated'](),controller[_0xb6a7('0x15')]);router[_0xb6a7('0x7')](_0xb6a7('0x16'),auth['isAuthenticated'](),controller[_0xb6a7('0x17')]);router[_0xb6a7('0x7')](_0xb6a7('0x18'),auth['isAuthenticated'](),controller[_0xb6a7('0x19')]);router['post']('/',auth[_0xb6a7('0xb')](),controller[_0xb6a7('0x1a')]);router[_0xb6a7('0x1b')](_0xb6a7('0x1c'),auth[_0xb6a7('0xb')](),controller['clone']);router[_0xb6a7('0x1b')]('/:id/teams',auth[_0xb6a7('0xb')](),controller[_0xb6a7('0x1d')]);router['post']('/:id/users',auth[_0xb6a7('0xb')](),controller['addAgents']);router[_0xb6a7('0x1b')](_0xb6a7('0x16'),auth['isAuthenticated'](),controller[_0xb6a7('0x1e')]);router[_0xb6a7('0x1b')](_0xb6a7('0x18'),auth[_0xb6a7('0xb')](),controller[_0xb6a7('0x1f')]);router[_0xb6a7('0x20')](_0xb6a7('0x8'),auth[_0xb6a7('0xb')](),controller[_0xb6a7('0x21')]);router[_0xb6a7('0x22')](_0xb6a7('0x8'),auth[_0xb6a7('0xb')](),controller[_0xb6a7('0x23')]);router['delete'](_0xb6a7('0x24'),auth['isAuthenticated'](),controller[_0xb6a7('0x25')]);router[_0xb6a7('0x22')]('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);router['delete'](_0xb6a7('0x16'),auth['isAuthenticated'](),controller['removeLists']);router[_0xb6a7('0x22')]('/:id/blacklists',auth[_0xb6a7('0xb')](),controller[_0xb6a7('0x26')]);module['exports']=router; \ No newline at end of file +var _0x1e90=['util','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','/:id/hopper_finals','getHopperBlacks','/:id/teams','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addTeams','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer'];(function(_0x17180f,_0x394454){var _0x8f5683=function(_0x3da7a1){while(--_0x3da7a1){_0x17180f['push'](_0x17180f['shift']());}};_0x8f5683(++_0x394454);}(_0x1e90,0x185));var _0x01e9=function(_0x1b8cbd,_0x4eae44){_0x1b8cbd=_0x1b8cbd-0x0;var _0x3fcdfa=_0x1e90[_0x1b8cbd];return _0x3fcdfa;};'use strict';var multer=require(_0x01e9('0x0'));var util=require(_0x01e9('0x1'));var path=require('path');var timeout=require(_0x01e9('0x2'));var express=require('express');var router=express[_0x01e9('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x01e9('0x4'));var config=require(_0x01e9('0x5'));var controller=require(_0x01e9('0x6'));router[_0x01e9('0x7')]('/',auth[_0x01e9('0x8')](),controller['index']);router[_0x01e9('0x7')](_0x01e9('0x9'),auth[_0x01e9('0x8')](),controller[_0x01e9('0xa')]);router[_0x01e9('0x7')](_0x01e9('0xb'),auth[_0x01e9('0x8')](),controller['getHoppers']);router[_0x01e9('0x7')](_0x01e9('0xc'),auth[_0x01e9('0x8')](),controller['getHopperHistories']);router['get'](_0x01e9('0xd'),auth['isAuthenticated'](),controller['getHopperFinals']);router[_0x01e9('0x7')]('/:id/hopper_black',auth[_0x01e9('0x8')](),controller[_0x01e9('0xe')]);router['get'](_0x01e9('0xf'),auth['isAuthenticated'](),controller['getTeams']);router['get'](_0x01e9('0x10'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x11')]);router[_0x01e9('0x7')](_0x01e9('0x12'),auth['isAuthenticated'](),controller[_0x01e9('0x13')]);router[_0x01e9('0x7')](_0x01e9('0x14'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x15')]);router[_0x01e9('0x7')](_0x01e9('0x16'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x17')]);router[_0x01e9('0x18')]('/',auth[_0x01e9('0x8')](),controller[_0x01e9('0x19')]);router['post'](_0x01e9('0x1a'),auth['isAuthenticated'](),controller[_0x01e9('0x1b')]);router[_0x01e9('0x18')](_0x01e9('0xf'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x1c')]);router['post'](_0x01e9('0x10'),auth[_0x01e9('0x8')](),controller['addAgents']);router[_0x01e9('0x18')](_0x01e9('0x14'),auth[_0x01e9('0x8')](),controller['addLists']);router['post'](_0x01e9('0x16'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x1d')]);router[_0x01e9('0x1e')]('/:id',auth[_0x01e9('0x8')](),controller[_0x01e9('0x1f')]);router[_0x01e9('0x20')](_0x01e9('0x9'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x21')]);router[_0x01e9('0x20')]('/:id/teams',auth[_0x01e9('0x8')](),controller[_0x01e9('0x22')]);router[_0x01e9('0x20')](_0x01e9('0x10'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x23')]);router[_0x01e9('0x20')](_0x01e9('0x14'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x24')]);router[_0x01e9('0x20')](_0x01e9('0x16'),auth[_0x01e9('0x8')](),controller[_0x01e9('0x25')]);module[_0x01e9('0x26')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 0d7d48a..96e805a 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 _0xdae3=['Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','#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)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','Active/Disactive\x20Recall\x20In\x20Queue','DESC','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','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','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','fewestcalls','random','linear','wrandom','rrordered','setDataValue','strategy','rrmemory','getDataValue','type','booked','roundrobin','progressive','predictive','INTEGER','yes','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','preview','power','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'];(function(_0xcbac85,_0x2a8a23){var _0x196e45=function(_0x5a00cb){while(--_0x5a00cb){_0xcbac85['push'](_0xcbac85['shift']());}};_0x196e45(++_0x2a8a23);}(_0xdae3,0x19f));var _0x3dae=function(_0x3b3861,_0x5850c1){_0x3b3861=_0x3b3861-0x0;var _0x37e0c1=_0xdae3[_0x3b3861];return _0x37e0c1;};'use strict';var Sequelize=require(_0x3dae('0x0'));module[_0x3dae('0x1')]={'name':{'type':Sequelize[_0x3dae('0x2')],'allowNull':![],'unique':_0x3dae('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x5'),_0x3dae('0x6')),'allowNull':![],'defaultValue':_0x3dae('0x5')},'musiconhold':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':_0x3dae('0x7')},'announce':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x3dae('0x4')]('rr',_0x3dae('0x8'),_0x3dae('0x9'),_0x3dae('0xa'),_0x3dae('0xb'),'rrmemory',_0x3dae('0xc'),_0x3dae('0xd'),_0x3dae('0xe')),'allowNull':![],'defaultValue':'ringall','set':function(_0x492517){this[_0x3dae('0xf')](_0x3dae('0x10'),_0x492517?_0x492517:_0x3dae('0x11'));},'get':function(){var _0x4133c4=this[_0x3dae('0x12')](_0x3dae('0x13'));var _0x2424d1=this[_0x3dae('0x12')]('dialMethod');var _0x5870bd=this[_0x3dae('0x12')]('strategy');if(_0x4133c4===_0x3dae('0x5')){return _0x5870bd;}if(_0x2424d1===_0x3dae('0x14')&&_0x5870bd===_0x3dae('0x11')||_0x2424d1===_0x3dae('0x14')&&_0x5870bd===_0x3dae('0x15')){return _0x5870bd;}if(_0x2424d1===_0x3dae('0x16')||_0x2424d1===_0x3dae('0x17')||_0x2424d1==='power'){return _0x5870bd;}return null;}},'servicelevel':{'type':Sequelize[_0x3dae('0x18')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x3dae('0x2')]},'weight':{'type':Sequelize[_0x3dae('0x18')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x3dae('0x4')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x3dae('0x4')]('yes','no','all'),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x3dae('0x18')](0xb)},'autopausebusy':{'type':Sequelize[_0x3dae('0x4')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x3dae('0x19'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x3dae('0x18')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize['ENUM'](_0x3dae('0x19'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x3dae('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x3dae('0x18')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x3dae('0x18')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no'),'defaultValue':_0x3dae('0x19')},'announce_holdtime':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no',_0x3dae('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no')},'announce_position_limit':{'type':Sequelize[_0x3dae('0x18')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x3dae('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize['STRING']},'queue_youarenext':{'type':Sequelize['STRING'],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize['STRING'],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize['STRING']},'queue_quantity1':{'type':Sequelize['STRING']},'queue_quantity2':{'type':Sequelize[_0x3dae('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x3dae('0x2')]},'queue_less_than':{'type':Sequelize[_0x3dae('0x2')]},'periodic_announce':{'type':Sequelize[_0x3dae('0x1b')],'set':function(_0x568613){this[_0x3dae('0xf')](_0x3dae('0x1c'),_0x568613?_0x568613[_0x3dae('0x1d')](','):[]);},'get':function(){return this[_0x3dae('0x12')](_0x3dae('0x1c'))?this['getDataValue'](_0x3dae('0x1c'))[_0x3dae('0x1e')](','):[];}},'joinempty':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':'yes','set':function(_0x14b01e){this[_0x3dae('0xf')]('joinempty',_0x14b01e?_0x14b01e[_0x3dae('0x1d')](','):[]);},'get':function(){return this[_0x3dae('0x12')](_0x3dae('0x1f'))?this[_0x3dae('0x12')](_0x3dae('0x1f'))[_0x3dae('0x1e')](','):[];}},'leavewhenempty':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':'no','set':function(_0x4924c7){this[_0x3dae('0xf')](_0x3dae('0x20'),_0x4924c7?_0x4924c7[_0x3dae('0x1d')](','):[]);},'get':function(){return this[_0x3dae('0x12')]('leavewhenempty')?this[_0x3dae('0x12')](_0x3dae('0x20'))['split'](','):[];}},'reportholdtime':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x19'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x3dae('0x2')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x8b992e){this[_0x3dae('0xf')](_0x3dae('0x21'),_0x8b992e);if(_0x8b992e){if(this[_0x3dae('0x12')](_0x3dae('0x22'))<0x2){this[_0x3dae('0xf')](_0x3dae('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize[_0x3dae('0x18')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x3dae('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'dialMethod':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x24'),_0x3dae('0x16'),_0x3dae('0x25'),_0x3dae('0x17'),_0x3dae('0x14')),'defaultValue':'progressive','comment':_0x3dae('0x26')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)[_0x3dae('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x3dae('0x27')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x3dae('0x28')},'dialPowerLevel':{'type':Sequelize[_0x3dae('0x29')](0x2)[_0x3dae('0x27')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x3dae('0x2a')},'dialPredictiveOptimization':{'type':Sequelize[_0x3dae('0x4')](_0x3dae('0x2b'),_0x3dae('0x2c')),'defaultValue':_0x3dae('0x2c'),'comment':_0x3dae('0x2d')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x3dae('0x29')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':'Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)'},'dialPredictiveInterval':{'type':Sequelize[_0x3dae('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x3dae('0x2e')},'dialOriginateCallerIdName':{'type':Sequelize[_0x3dae('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x3dae('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x3dae('0x27')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3dae('0x2f')},'dialQueueOptions':{'type':Sequelize['STRING'],'defaultValue':_0x3dae('0x30'),'comment':'https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue'},'dialQueueTimeout':{'type':Sequelize[_0x3dae('0x18')](0x3)[_0x3dae('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x3dae('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x3dae('0x18')](0x3)[_0x3dae('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3dae('0x31')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x3dae('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3dae('0x32')},'dialBusyMaxRetry':{'type':Sequelize[_0x3dae('0x18')](0x3)[_0x3dae('0x27')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x3dae('0x33')},'dialBusyRetryFrequency':{'type':Sequelize[_0x3dae('0x18')](0x5)[_0x3dae('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x3dae('0x18')](0x3)[_0x3dae('0x27')],'defaultValue':0x3,'comment':_0x3dae('0x34')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x3dae('0x18')](0x5)[_0x3dae('0x27')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x3dae('0x35')},'dialGlobalMaxRetry':{'type':Sequelize[_0x3dae('0x18')](0x3)[_0x3dae('0x27')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x3dae('0x36')},'dialTimezone':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':_0x3dae('0x37')},'dialPrefix':{'type':Sequelize[_0x3dae('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x3dae('0x38'),_0x3dae('0x39'),_0x3dae('0x3a')),'defaultValue':_0x3dae('0x38')},'dialAMDActive':{'type':Sequelize[_0x3dae('0x23')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x3dae('0x18')](0x9)[_0x3dae('0x27')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x3dae('0x3b')},'dialAMDGreeting':{'type':Sequelize[_0x3dae('0x18')](0x9)[_0x3dae('0x27')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x3dae('0x3c')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x3dae('0x18')](0x9)[_0x3dae('0x27')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x3dae('0x3d')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x3dae('0x18')](0x9)[_0x3dae('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3dae('0x3e')},'dialAMDMinWordLength':{'type':Sequelize[_0x3dae('0x18')](0x9)[_0x3dae('0x27')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x3dae('0x3f')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x3dae('0x18')](0x9)[_0x3dae('0x27')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x3dae('0x40')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x3dae('0x41')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x3dae('0x27')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x3dae('0x42')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x3dae('0x18')](0x9)[_0x3dae('0x27')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x3dae('0x43')},'dialRecallMeTimeout':{'type':Sequelize[_0x3dae('0x18')](0x5)[_0x3dae('0x27')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x3dae('0x44')},'dialRecallInQueue':{'type':Sequelize[_0x3dae('0x23')],'defaultValue':0x0,'comment':_0x3dae('0x45')},'dialOrderByScheduledAt':{'type':Sequelize[_0x3dae('0x4')]('DESC','ASC'),'defaultValue':_0x3dae('0x46')},'dialQueueProject2':{'type':Sequelize[_0x3dae('0x2')],'comment':_0x3dae('0x47')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x3dae('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x3dae('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x3dae('0x18')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x3dae('0x48')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x3dae('0x18')],'allowNull':!![],'comment':_0x3dae('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x3dae('0x23')],'defaultValue':![],'comment':_0x3dae('0x4a'),'set':function(_0x41915b){if(!_0x41915b)this['setDataValue'](_0x3dae('0x4b'),null);this[_0x3dae('0xf')](_0x3dae('0x4c'),_0x41915b);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x3dae('0x27')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x3dae('0x18')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x9c91=['predictive','Dial\x20Method.','UNSIGNED','Max\x209999\x20channels,\x200\x20means\x20unlimited.','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','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)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','DESC','ASC','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','exports','name','inbound','STRING','default','ringall','fewestcalls','random','rrmemory','wrandom','strategy','getDataValue','dialMethod','booked','roundrobin','progressive','power','INTEGER','ENUM','yes','all','TEXT','setDataValue','periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','wrapuptime','Active/Disactive\x20Campaign','preview'];(function(_0x549384,_0x39c37e){var _0x4c6fe3=function(_0x36c0cf){while(--_0x36c0cf){_0x549384['push'](_0x549384['shift']());}};_0x4c6fe3(++_0x39c37e);}(_0x9c91,0x1a1));var _0x19c9=function(_0x13d6d2,_0x1e7cc0){_0x13d6d2=_0x13d6d2-0x0;var _0x5e470b=_0x9c91[_0x13d6d2];return _0x5e470b;};'use strict';var Sequelize=require('sequelize');module[_0x19c9('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x19c9('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x19c9('0x2'),'outbound'),'allowNull':![],'defaultValue':_0x19c9('0x2')},'musiconhold':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':_0x19c9('0x4')},'announce':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x19c9('0x5'),'leastrecent',_0x19c9('0x6'),_0x19c9('0x7'),_0x19c9('0x8'),'linear',_0x19c9('0x9'),'rrordered'),'allowNull':![],'defaultValue':_0x19c9('0x5'),'set':function(_0x2630e1){this['setDataValue'](_0x19c9('0xa'),_0x2630e1?_0x2630e1:'rrmemory');},'get':function(){var _0x1ebb8c=this[_0x19c9('0xb')]('type');var _0x5f3e01=this[_0x19c9('0xb')](_0x19c9('0xc'));var _0x5db5d6=this['getDataValue'](_0x19c9('0xa'));if(_0x1ebb8c==='inbound'){return _0x5db5d6;}if(_0x5f3e01===_0x19c9('0xd')&&_0x5db5d6===_0x19c9('0x8')||_0x5f3e01===_0x19c9('0xd')&&_0x5db5d6===_0x19c9('0xe')){return _0x5db5d6;}if(_0x5f3e01===_0x19c9('0xf')||_0x5f3e01==='predictive'||_0x5f3e01===_0x19c9('0x10')){return _0x5db5d6;}return null;}},'servicelevel':{'type':Sequelize[_0x19c9('0x11')](0xb),'defaultValue':0x0},'context':{'type':Sequelize['STRING'],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0x19c9('0x11')](0xb)},'timeout':{'type':Sequelize[_0x19c9('0x11')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x19c9('0x11')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x19c9('0x3')]},'weight':{'type':Sequelize[_0x19c9('0x11')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x19c9('0x11')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x13'),'no'),'defaultValue':_0x19c9('0x13')},'autopause':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x13'),'no',_0x19c9('0x14')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x19c9('0x11')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x19c9('0x13'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x13'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x19c9('0x11')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x13'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x19c9('0x13'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x13'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x13'),'no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x19c9('0x3')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0x19c9('0x3')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x19c9('0x11')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x19c9('0x11')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x19c9('0x12')]('yes','no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize[_0x19c9('0x12')]('yes','no'),'defaultValue':'yes'},'announce_holdtime':{'type':Sequelize['ENUM']('yes','no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x19c9('0x12')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x19c9('0x12')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x19c9('0x3')]},'queue_youarenext':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x19c9('0x3')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x19c9('0x3')]},'queue_quantity1':{'type':Sequelize[_0x19c9('0x3')]},'queue_quantity2':{'type':Sequelize[_0x19c9('0x3')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize[_0x19c9('0x3')]},'periodic_announce':{'type':Sequelize[_0x19c9('0x15')],'set':function(_0x1a3dfc){this[_0x19c9('0x16')](_0x19c9('0x17'),_0x1a3dfc?_0x1a3dfc[_0x19c9('0x18')](','):[]);},'get':function(){return this[_0x19c9('0xb')](_0x19c9('0x17'))?this['getDataValue'](_0x19c9('0x17'))[_0x19c9('0x19')](','):[];}},'joinempty':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':_0x19c9('0x13'),'set':function(_0x5d5899){this[_0x19c9('0x16')](_0x19c9('0x1a'),_0x5d5899?_0x5d5899[_0x19c9('0x18')](','):[]);},'get':function(){return this[_0x19c9('0xb')](_0x19c9('0x1a'))?this[_0x19c9('0xb')](_0x19c9('0x1a'))[_0x19c9('0x19')](','):[];}},'leavewhenempty':{'type':Sequelize['STRING'],'defaultValue':'no','set':function(_0x3eca11){this['setDataValue'](_0x19c9('0x1b'),_0x3eca11?_0x3eca11[_0x19c9('0x18')](','):[]);},'get':function(){return this[_0x19c9('0xb')](_0x19c9('0x1b'))?this[_0x19c9('0xb')]('leavewhenempty')[_0x19c9('0x19')](','):[];}},'reportholdtime':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x13'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x19c9('0x13'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x19c9('0x12')]('yes','no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x19c9('0x3')]},'description':{'type':Sequelize['STRING']},'acw':{'type':Sequelize[_0x19c9('0x1c')],'defaultValue':0x0,'set':function(_0x529aab){this[_0x19c9('0x16')](_0x19c9('0x1d'),_0x529aab);if(_0x529aab){if(this[_0x19c9('0xb')]('wrapuptime')<0x2){this['setDataValue'](_0x19c9('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x19c9('0x1c')],'defaultValue':0x0,'comment':_0x19c9('0x1f')},'dialMethod':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x20'),_0x19c9('0xf'),_0x19c9('0x10'),_0x19c9('0x21'),_0x19c9('0xd')),'defaultValue':'progressive','comment':_0x19c9('0x22')},'dialLimitChannel':{'type':Sequelize[_0x19c9('0x11')](0x4)[_0x19c9('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x19c9('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x19c9('0x25')},'dialPowerLevel':{'type':Sequelize[_0x19c9('0x26')](0x2)[_0x19c9('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x19c9('0x27')},'dialPredictiveOptimization':{'type':Sequelize['ENUM']('agentBusyFactor','dropRate'),'defaultValue':_0x19c9('0x28'),'comment':_0x19c9('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize['FLOAT'](0x2)[_0x19c9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x19c9('0x2a')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x19c9('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x19c9('0x11')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x19c9('0x2c')},'dialQueueOptions':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':_0x19c9('0x2d'),'comment':_0x19c9('0x2e')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x19c9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x19c9('0x3')],'comment':_0x19c9('0x2f')},'dialCongestionMaxRetry':{'type':Sequelize[_0x19c9('0x11')](0x3)[_0x19c9('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x19c9('0x30')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x19c9('0x11')](0x5)[_0x19c9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x19c9('0x31')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x19c9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x19c9('0x11')](0x3)[_0x19c9('0x23')],'defaultValue':0x3,'comment':'#NoAnswer\x20Retry\x20(min:1,\x20max:999)'},'dialNoAnswerRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x19c9('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x19c9('0x32')},'dialGlobalMaxRetry':{'type':Sequelize[_0x19c9('0x11')](0x3)[_0x19c9('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x19c9('0x33')},'dialTimezone':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':_0x19c9('0x34')},'dialPrefix':{'type':Sequelize[_0x19c9('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x19c9('0x12')](_0x19c9('0x35'),_0x19c9('0x36'),_0x19c9('0x37')),'defaultValue':_0x19c9('0x35')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x19c9('0x38')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x19c9('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x19c9('0x39')},'dialAMDGreeting':{'type':Sequelize[_0x19c9('0x11')](0x9)[_0x19c9('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x19c9('0x3a')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x19c9('0x11')](0x9)[_0x19c9('0x23')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x19c9('0x3b')},'dialAMDTotalAnalysisTime':{'type':Sequelize['INTEGER'](0x9)[_0x19c9('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x19c9('0x3c')},'dialAMDMinWordLength':{'type':Sequelize[_0x19c9('0x11')](0x9)[_0x19c9('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x19c9('0x3d')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x19c9('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x19c9('0x3e')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x19c9('0x11')](0x9)[_0x19c9('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x19c9('0x3f')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x19c9('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x19c9('0x40')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x19c9('0x11')](0x9)[_0x19c9('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x19c9('0x41')},'dialRecallMeTimeout':{'type':Sequelize[_0x19c9('0x11')](0x5)[_0x19c9('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x19c9('0x42')},'dialRecallInQueue':{'type':Sequelize[_0x19c9('0x1c')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0x19c9('0x43'),_0x19c9('0x44')),'defaultValue':_0x19c9('0x43')},'dialQueueProject2':{'type':Sequelize[_0x19c9('0x3')],'comment':_0x19c9('0x2f')},'dialAgiAfterHangupClient':{'type':Sequelize[_0x19c9('0x1c')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x19c9('0x1c')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x19c9('0x11')](0x3)[_0x19c9('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x19c9('0x45')},'dialCutDigit':{'type':Sequelize[_0x19c9('0x11')](0x3)[_0x19c9('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x19c9('0x46')},'mandatoryDispositionPauseId':{'type':Sequelize[_0x19c9('0x11')],'allowNull':!![],'comment':_0x19c9('0x47')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x19c9('0x48'),'set':function(_0x10477c){if(!_0x10477c)this[_0x19c9('0x16')](_0x19c9('0x49'),null);this[_0x19c9('0x16')](_0x19c9('0x4a'),_0x10477c);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize[_0x19c9('0x11')](0x3)[_0x19c9('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x19c9('0x11')](0x3)[_0x19c9('0x23')],'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 2931230..e874cc2 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 _0x3d4b=['each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','forEach','userVoiceQueue:save','ids','User','field','tq.TeamId','from','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','TeamId','all','union','compact','removeTeams','isEmpty','userVoiceQueue:remove','addAgents','spread','removeAgents','isArray','emit','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','select','NOW()','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','insert','CmListId','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./voiceQueue.socket','register','sendStatus','status','count','offset','Content-Range','apply','reject','save','update','then','destroy','VoiceQueues','inbound','map','value','includes','find','type','name','error','send','index','VoiceQueue','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','include','findAll','rows','show','params','includeAll','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','QueueCampaigns','outbound','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','rawAttributes','omit','createdAt','updatedAt','UserProfileSection','getHoppers','findOne','CmHopper','VoiceQueueId','filter','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','addTeams','teams','Agents','online','voicePause','flatMap','penalty','sequelize','transaction'];(function(_0x32ef57,_0x18457c){var _0x289a8c=function(_0x4d8d7b){while(--_0x4d8d7b){_0x32ef57['push'](_0x32ef57['shift']());}};_0x289a8c(++_0x18457c);}(_0x3d4b,0xfc));var _0xb3d4=function(_0x2bf329,_0x3e87d5){_0x2bf329=_0x2bf329-0x0;var _0x410bab=_0x3d4b[_0x2bf329];return _0x410bab;};'use strict';var pdf=require(_0xb3d4('0x0'));var emlformat=require(_0xb3d4('0x1'));var rimraf=require(_0xb3d4('0x2'));var zipdir=require(_0xb3d4('0x3'));var jsonpatch=require(_0xb3d4('0x4'));var rp=require('request-promise');var moment=require(_0xb3d4('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xb3d4('0x6'));var util=require(_0xb3d4('0x7'));var path=require('path');var sox=require(_0xb3d4('0x8'));var csv=require(_0xb3d4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb3d4('0xa'));var squel=require(_0xb3d4('0xb'));var crypto=require(_0xb3d4('0xc'));var jsforce=require(_0xb3d4('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xb3d4('0x9'));var querystring=require(_0xb3d4('0xe'));var Papa=require('papaparse');var Redis=require(_0xb3d4('0xf'));var authService=require(_0xb3d4('0x10'));var qs=require(_0xb3d4('0x11'));var as=require(_0xb3d4('0x12'));var hardwareService=require(_0xb3d4('0x13'));var logger=require(_0xb3d4('0x14'))(_0xb3d4('0x15'));var utils=require(_0xb3d4('0x16'));var config=require(_0xb3d4('0x17'));var db=require(_0xb3d4('0x18'))['db'];config['redis']=_[_0xb3d4('0x19')](config['redis'],{'host':_0xb3d4('0x1a'),'port':0x18eb});var socket=require(_0xb3d4('0x1b'))(new Redis(config[_0xb3d4('0x1c')]));require(_0xb3d4('0x1d'))[_0xb3d4('0x1e')](socket);function respondWithStatusCode(_0x1ff9be,_0xd87ac9){_0xd87ac9=_0xd87ac9||0xcc;return function(_0x2deba9){if(_0x2deba9){return _0x1ff9be[_0xb3d4('0x1f')](_0xd87ac9);}return _0x1ff9be[_0xb3d4('0x20')](_0xd87ac9)['end']();};}function respondWithResult(_0x17cb97,_0x5d2f87){_0x5d2f87=_0x5d2f87||0xc8;return function(_0x18ea17){if(_0x18ea17){return _0x17cb97[_0xb3d4('0x20')](_0x5d2f87)['json'](_0x18ea17);}};}function respondWithFilteredResult(_0x5ec58b,_0x50c176){return function(_0x15c7c9){if(_0x15c7c9){var _0x44e50b=_0x15c7c9[_0xb3d4('0x21')],_0x3d8ab8=_0x50c176[_0xb3d4('0x22')],_0x5d9453=_0x50c176[_0xb3d4('0x22')]+_0x50c176['limit'],_0x58d764;if(_0x5d9453>=_0x44e50b){_0x5d9453=_0x44e50b;_0x58d764=0xc8;}else{_0x58d764=0xce;}_0x5ec58b[_0xb3d4('0x20')](_0x58d764);return _0x5ec58b['set'](_0xb3d4('0x23'),_0x3d8ab8+'-'+_0x5d9453+'/'+_0x44e50b)['json'](_0x15c7c9);}return null;};}function patchUpdates(_0x18f3ef){return function(_0x4e7da3){try{jsonpatch[_0xb3d4('0x24')](_0x4e7da3,_0x18f3ef,!![]);}catch(_0x1c4bce){return BPromise[_0xb3d4('0x25')](_0x1c4bce);}return _0x4e7da3[_0xb3d4('0x26')]();};}function saveUpdates(_0x22a9da,_0x530d5d){return function(_0x497fb1){if(_0x497fb1){return _0x497fb1[_0xb3d4('0x27')](_0x22a9da)[_0xb3d4('0x28')](function(_0x1ec553){return _0x1ec553;});}return null;};}function removeEntity(_0x1a4e44,_0x3f8951){return function(_0x1e6408){if(_0x1e6408){return _0x1e6408[_0xb3d4('0x29')]()['then'](function(){var _0x21bfb6=_0x1e6408['get']({'plain':!![]});var _0x3684e5=[{'name':_0xb3d4('0x2a'),'value':_0xb3d4('0x2b'),'ignore':![]},{'name':'QueueCampaigns','value':'outbound','ignore':![]}];var _0x3121a0=_(_0x3684e5)['filter']('ignore')[_0xb3d4('0x2c')](_0xb3d4('0x2d'))[_0xb3d4('0x2d')]();if(_[_0xb3d4('0x2e')](_0x3121a0,_0x21bfb6['type'])){return;}var _0x22e3ff=_[_0xb3d4('0x2f')](_0x3684e5,[_0xb3d4('0x2d'),_0x21bfb6[_0xb3d4('0x30')]])[_0xb3d4('0x31')];return db['UserProfileResource'][_0xb3d4('0x29')]({'where':{'type':_0x22e3ff,'resourceId':_0x21bfb6['id']}})['then'](function(){return _0x1e6408;});})['then'](function(){_0x1a4e44['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d7c8e,_0x218ae8){return function(_0x2393e4){if(!_0x2393e4){_0x1d7c8e['sendStatus'](0x194);}return _0x2393e4;};}function handleError(_0x4e5601,_0x1a73fa){_0x1a73fa=_0x1a73fa||0x1f4;return function(_0x3f0e03){logger[_0xb3d4('0x32')](_0x3f0e03['stack']);if(_0x3f0e03[_0xb3d4('0x31')]){delete _0x3f0e03[_0xb3d4('0x31')];}_0x4e5601['status'](_0x1a73fa)[_0xb3d4('0x33')](_0x3f0e03);};}exports[_0xb3d4('0x34')]=function(_0x235457,_0x1cf410){var _0x5d2e3d={},_0x2a4675={},_0x1bf7f3={'count':0x0,'rows':[]};var _0x361954=_['map'](db[_0xb3d4('0x35')]['rawAttributes'],function(_0x3fe7dd){return{'name':_0x3fe7dd[_0xb3d4('0x36')],'type':_0x3fe7dd[_0xb3d4('0x30')]['key']};});_0x2a4675[_0xb3d4('0x37')]=_[_0xb3d4('0x2c')](_0x361954,_0xb3d4('0x31'));_0x2a4675[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x235457[_0xb3d4('0x38')]);_0x2a4675[_0xb3d4('0x3a')]=_[_0xb3d4('0x3b')](_0x2a4675[_0xb3d4('0x37')],_0x2a4675[_0xb3d4('0x38')]);_0x5d2e3d[_0xb3d4('0x3c')]=_[_0xb3d4('0x3b')](_0x2a4675[_0xb3d4('0x37')],qs[_0xb3d4('0x3d')](_0x235457[_0xb3d4('0x38')][_0xb3d4('0x3d')]));_0x5d2e3d[_0xb3d4('0x3c')]=_0x5d2e3d[_0xb3d4('0x3c')][_0xb3d4('0x3e')]?_0x5d2e3d['attributes']:_0x2a4675[_0xb3d4('0x37')];if(!_0x235457[_0xb3d4('0x38')][_0xb3d4('0x3f')](_0xb3d4('0x40'))){_0x5d2e3d[_0xb3d4('0x41')]=qs[_0xb3d4('0x41')](_0x235457['query'][_0xb3d4('0x41')]);_0x5d2e3d[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x235457[_0xb3d4('0x38')][_0xb3d4('0x22')]);}_0x5d2e3d[_0xb3d4('0x42')]=qs[_0xb3d4('0x43')](_0x235457[_0xb3d4('0x38')][_0xb3d4('0x43')]);_0x5d2e3d[_0xb3d4('0x44')]=qs[_0xb3d4('0x3a')](_[_0xb3d4('0x45')](_0x235457[_0xb3d4('0x38')],_0x2a4675[_0xb3d4('0x3a')]));if(_0x235457[_0xb3d4('0x38')]['filter']){_0x5d2e3d['where']=_['merge'](_0x5d2e3d[_0xb3d4('0x44')],{'$or':_[_0xb3d4('0x2c')](_0x361954,function(_0x1fa592){if(_0x1fa592[_0xb3d4('0x30')]!==_0xb3d4('0x46')){var _0x33eecf={};_0x33eecf[_0x1fa592[_0xb3d4('0x31')]]={'$like':'%'+_0x235457[_0xb3d4('0x38')]['filter']+'%'};return _0x33eecf;}})});}_0x5d2e3d=_[_0xb3d4('0x47')]({},_0x5d2e3d,_0x235457[_0xb3d4('0x48')]);var _0x4996df={'where':_0x5d2e3d['where']};return db[_0xb3d4('0x35')]['count'](_0x4996df)[_0xb3d4('0x28')](function(_0x4ad49a){_0x1bf7f3[_0xb3d4('0x21')]=_0x4ad49a;if(_0x235457[_0xb3d4('0x38')]['includeAll']){_0x5d2e3d[_0xb3d4('0x49')]=[{'all':!![]}];}return db['VoiceQueue'][_0xb3d4('0x4a')](_0x5d2e3d);})[_0xb3d4('0x28')](function(_0x1da7f7){_0x1bf7f3[_0xb3d4('0x4b')]=_0x1da7f7;return _0x1bf7f3;})['then'](respondWithFilteredResult(_0x1cf410,_0x5d2e3d))['catch'](handleError(_0x1cf410,null));};exports[_0xb3d4('0x4c')]=function(_0x184c2e,_0x2c7d05){var _0x32a8a2={'raw':![],'where':{'id':_0x184c2e[_0xb3d4('0x4d')]['id']}},_0x228379={};_0x228379['model']=_[_0xb3d4('0x39')](db[_0xb3d4('0x35')]['rawAttributes']);_0x228379[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x184c2e[_0xb3d4('0x38')]);_0x228379[_0xb3d4('0x3a')]=_[_0xb3d4('0x3b')](_0x228379[_0xb3d4('0x37')],_0x228379[_0xb3d4('0x38')]);_0x32a8a2[_0xb3d4('0x3c')]=_[_0xb3d4('0x3b')](_0x228379['model'],qs[_0xb3d4('0x3d')](_0x184c2e['query']['fields']));_0x32a8a2[_0xb3d4('0x3c')]=_0x32a8a2['attributes']['length']?_0x32a8a2['attributes']:_0x228379[_0xb3d4('0x37')];if(_0x184c2e[_0xb3d4('0x38')][_0xb3d4('0x4e')]){_0x32a8a2[_0xb3d4('0x49')]=[{'all':!![]}];}_0x32a8a2=_[_0xb3d4('0x47')]({},_0x32a8a2,_0x184c2e['options']);return db[_0xb3d4('0x35')][_0xb3d4('0x2f')](_0x32a8a2)['then'](handleEntityNotFound(_0x2c7d05,null))[_0xb3d4('0x28')](respondWithResult(_0x2c7d05,null))[_0xb3d4('0x4f')](handleError(_0x2c7d05,null));};exports[_0xb3d4('0x50')]=function(_0x2eba86,_0xf4e423){return db[_0xb3d4('0x35')][_0xb3d4('0x50')](_0x2eba86[_0xb3d4('0x51')],{})[_0xb3d4('0x28')](function(_0x3f8248){var _0x103357=_0x2eba86[_0xb3d4('0x52')][_0xb3d4('0x53')]({'plain':!![]});if(!_0x103357)throw new Error(_0xb3d4('0x54'));if(_0x103357[_0xb3d4('0x55')]===_0xb3d4('0x52')){var _0x14229e=_0x3f8248[_0xb3d4('0x53')]({'plain':!![]});var _0x1963c9=[{'name':_0xb3d4('0x2a'),'value':_0xb3d4('0x2b')},{'name':_0xb3d4('0x56'),'value':_0xb3d4('0x57')}];var _0x3d2515=_['find'](_0x1963c9,[_0xb3d4('0x2d'),_0x14229e[_0xb3d4('0x30')]])[_0xb3d4('0x31')];return db['UserProfileSection'][_0xb3d4('0x2f')]({'where':{'name':_0x3d2515,'userProfileId':_0x103357[_0xb3d4('0x58')]},'raw':!![]})['then'](function(_0xf783e8){if(_0xf783e8&&_0xf783e8[_0xb3d4('0x59')]===0x0){return db[_0xb3d4('0x5a')][_0xb3d4('0x50')]({'name':_0x14229e[_0xb3d4('0x31')],'resourceId':_0x14229e['id'],'type':_0xf783e8[_0xb3d4('0x31')],'sectionId':_0xf783e8['id']},{})['then'](function(){return _0x3f8248;});}else{return _0x3f8248;}})[_0xb3d4('0x4f')](function(_0x14ac5d){logger[_0xb3d4('0x32')](_0xb3d4('0x5b'),_0x14ac5d);throw _0x14ac5d;});}return _0x3f8248;})['then'](respondWithResult(_0xf4e423,0xc9))[_0xb3d4('0x4f')](handleError(_0xf4e423,null));};exports['clone']=function(_0xa34b54,_0x74b7e3){var _0x32093a={'where':{'id':_0xa34b54['params']['id']}},_0x39ab14={};_0x39ab14[_0xb3d4('0x37')]=_[_0xb3d4('0x39')](db[_0xb3d4('0x35')][_0xb3d4('0x5c')]);_0x32093a['attributes']=_[_0xb3d4('0x3b')](_0x39ab14['model'],qs['fields'](_0xa34b54[_0xb3d4('0x38')]['fields']));_0x32093a[_0xb3d4('0x3c')]=_0x32093a[_0xb3d4('0x3c')]['length']?_0x32093a[_0xb3d4('0x3c')]:_0x39ab14[_0xb3d4('0x37')];if(_0xa34b54['query'][_0xb3d4('0x4e')]){_0x32093a[_0xb3d4('0x49')]=[{'all':!![]}];}_0x32093a=_[_0xb3d4('0x47')]({},_0x32093a,_0xa34b54[_0xb3d4('0x48')]);return db[_0xb3d4('0x35')][_0xb3d4('0x2f')](_0x32093a)[_0xb3d4('0x28')](handleEntityNotFound(_0x74b7e3,null))[_0xb3d4('0x28')](function(_0x4c8c36){if(_0x4c8c36){var _0x50190f=_0x4c8c36[_0xb3d4('0x53')]({'plain':!![]});_0x50190f=qs[_0xb3d4('0x5d')](_0x50190f,['id',_0xb3d4('0x5e'),_0xb3d4('0x5f')]);_0xa34b54['body']=_[_0xb3d4('0x5d')](_0xa34b54[_0xb3d4('0x51')],['id',_0xb3d4('0x5e'),_0xb3d4('0x5f')]);return db[_0xb3d4('0x35')][_0xb3d4('0x50')](_[_0xb3d4('0x47')](_0x50190f,_0xa34b54['body']),{'include':_0xa34b54[_0xb3d4('0x38')][_0xb3d4('0x4e')]?[{'all':!![]}]:undefined})[_0xb3d4('0x28')](function(_0x46a422){var _0x544b3f=_0xa34b54[_0xb3d4('0x52')][_0xb3d4('0x53')]({'plain':!![]});if(!_0x544b3f)throw new Error(_0xb3d4('0x54'));if(_0x544b3f['role']===_0xb3d4('0x52')){var _0x575a2b=_0x46a422['get']({'plain':!![]});var _0x231a24=[{'name':_0xb3d4('0x2a'),'value':_0xb3d4('0x2b')},{'name':_0xb3d4('0x56'),'value':_0xb3d4('0x57')}];var _0x411477=_['find'](_0x231a24,[_0xb3d4('0x2d'),_0x575a2b[_0xb3d4('0x30')]])[_0xb3d4('0x31')];return db[_0xb3d4('0x60')]['find']({'where':{'name':_0x411477,'userProfileId':_0x544b3f[_0xb3d4('0x58')]},'raw':!![]})[_0xb3d4('0x28')](function(_0x4dc71e){if(_0x4dc71e&&_0x4dc71e['autoAssociation']===0x0){return db[_0xb3d4('0x5a')][_0xb3d4('0x50')]({'name':_0x575a2b['name'],'resourceId':_0x575a2b['id'],'type':_0x4dc71e[_0xb3d4('0x31')],'sectionId':_0x4dc71e['id']},{})[_0xb3d4('0x28')](function(){return _0x46a422;});}else{return _0x46a422;}})[_0xb3d4('0x4f')](function(_0x5b28e3){logger[_0xb3d4('0x32')](_0xb3d4('0x5b'),_0x5b28e3);throw _0x5b28e3;});}return _0x46a422;});}})['then'](respondWithResult(_0x74b7e3,0xc9))[_0xb3d4('0x4f')](handleError(_0x74b7e3,null));};exports['update']=function(_0x499ff2,_0x5f339d){if(_0x499ff2[_0xb3d4('0x51')]['id']){delete _0x499ff2[_0xb3d4('0x51')]['id'];}return db[_0xb3d4('0x35')][_0xb3d4('0x2f')]({'where':{'id':_0x499ff2[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x5f339d,null))[_0xb3d4('0x28')](saveUpdates(_0x499ff2[_0xb3d4('0x51')],null))['then'](respondWithResult(_0x5f339d,null))[_0xb3d4('0x4f')](handleError(_0x5f339d,null));};exports[_0xb3d4('0x29')]=function(_0x3c43a,_0x194ab0){return db[_0xb3d4('0x35')][_0xb3d4('0x2f')]({'where':{'id':_0x3c43a['params']['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x194ab0,null))['then'](removeEntity(_0x194ab0,null))['catch'](handleError(_0x194ab0,null));};exports[_0xb3d4('0x61')]=function(_0x39550f,_0x4ffd40,_0xc2a724){var _0x41bfec={'raw':![],'where':{}};var _0x4b8488={};var _0x19e5a2={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xb3d4('0x62')]({'where':{'id':_0x39550f['params']['id']}})['then'](handleEntityNotFound(_0x4ffd40,null))['then'](function(_0x47d0c0){if(_0x47d0c0){_0x4b8488[_0xb3d4('0x37')]=_[_0xb3d4('0x39')](db[_0xb3d4('0x63')][_0xb3d4('0x5c')]);_0x4b8488[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x39550f[_0xb3d4('0x38')]);_0x4b8488[_0xb3d4('0x3a')]=_[_0xb3d4('0x3b')](_0x4b8488[_0xb3d4('0x37')],_0x4b8488['query']);_0x41bfec[_0xb3d4('0x3c')]=_[_0xb3d4('0x3b')](_0x4b8488[_0xb3d4('0x37')],qs[_0xb3d4('0x3d')](_0x39550f[_0xb3d4('0x38')][_0xb3d4('0x3d')]));_0x41bfec[_0xb3d4('0x3c')]=_0x41bfec[_0xb3d4('0x3c')]['length']?_0x41bfec[_0xb3d4('0x3c')]:_0x4b8488[_0xb3d4('0x37')];if(!_0x39550f['query'][_0xb3d4('0x3f')](_0xb3d4('0x40'))){_0x41bfec['limit']=qs[_0xb3d4('0x41')](_0x39550f[_0xb3d4('0x38')][_0xb3d4('0x41')]);_0x41bfec[_0xb3d4('0x22')]=qs['offset'](_0x39550f[_0xb3d4('0x38')][_0xb3d4('0x22')]);}_0x41bfec[_0xb3d4('0x42')]=qs[_0xb3d4('0x43')](_0x39550f[_0xb3d4('0x38')]['sort']);_0x41bfec[_0xb3d4('0x44')]=qs[_0xb3d4('0x3a')](_[_0xb3d4('0x45')](_0x39550f[_0xb3d4('0x38')],_0x4b8488[_0xb3d4('0x3a')]));_0x41bfec[_0xb3d4('0x44')][_0xb3d4('0x64')]=_0x47d0c0['id'];if(_0x39550f['query'][_0xb3d4('0x65')]){_0x41bfec[_0xb3d4('0x44')]=_[_0xb3d4('0x47')](_0x41bfec[_0xb3d4('0x44')],{'$or':_[_0xb3d4('0x2c')](_0x41bfec[_0xb3d4('0x3c')],function(_0x1129a3){var _0x3ce1fe={};_0x3ce1fe[_0x1129a3]={'$like':'%'+_0x39550f[_0xb3d4('0x38')]['filter']+'%'};return _0x3ce1fe;})});}_0x41bfec=_[_0xb3d4('0x47')]({},_0x41bfec,_0x39550f['options']);return db[_0xb3d4('0x63')][_0xb3d4('0x21')]({'where':_0x41bfec[_0xb3d4('0x44')]})[_0xb3d4('0x28')](function(_0x2f239f){_0x19e5a2[_0xb3d4('0x21')]=_0x2f239f;if(_0x39550f[_0xb3d4('0x38')][_0xb3d4('0x4e')]){_0x41bfec['include']=[{'all':!![]}];}return db[_0xb3d4('0x63')][_0xb3d4('0x4a')](_0x41bfec);})[_0xb3d4('0x28')](function(_0x4c4048){_0x19e5a2[_0xb3d4('0x4b')]=_0x4c4048;return _0x19e5a2;});}})[_0xb3d4('0x28')](respondWithFilteredResult(_0x4ffd40,_0x41bfec))[_0xb3d4('0x4f')](handleError(_0x4ffd40,null));};exports[_0xb3d4('0x66')]=function(_0x295ca2,_0x5c139f,_0x1ea782){var _0x5461f6={'raw':!![],'where':{}};var _0x34eba2={};var _0x2520d5={'count':0x0,'rows':[]};return db[_0xb3d4('0x35')][_0xb3d4('0x62')]({'where':{'id':_0x295ca2[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x5c139f,null))[_0xb3d4('0x28')](function(_0x5a415d){if(_0x5a415d){_0x34eba2[_0xb3d4('0x37')]=_['keys'](db[_0xb3d4('0x67')][_0xb3d4('0x5c')]);_0x34eba2[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x295ca2[_0xb3d4('0x38')]);_0x34eba2[_0xb3d4('0x3a')]=_['intersection'](_0x34eba2[_0xb3d4('0x37')],_0x34eba2['query']);_0x5461f6[_0xb3d4('0x3c')]=_[_0xb3d4('0x3b')](_0x34eba2[_0xb3d4('0x37')],qs[_0xb3d4('0x3d')](_0x295ca2[_0xb3d4('0x38')][_0xb3d4('0x3d')]));_0x5461f6['attributes']=_0x5461f6[_0xb3d4('0x3c')][_0xb3d4('0x3e')]?_0x5461f6[_0xb3d4('0x3c')]:_0x34eba2[_0xb3d4('0x37')];if(!_0x295ca2[_0xb3d4('0x38')][_0xb3d4('0x3f')](_0xb3d4('0x40'))){_0x5461f6[_0xb3d4('0x41')]=qs[_0xb3d4('0x41')](_0x295ca2['query']['limit']);_0x5461f6['offset']=qs[_0xb3d4('0x22')](_0x295ca2[_0xb3d4('0x38')][_0xb3d4('0x22')]);}_0x5461f6[_0xb3d4('0x42')]=qs[_0xb3d4('0x43')](_0x295ca2[_0xb3d4('0x38')]['sort']);_0x5461f6['where']=qs[_0xb3d4('0x3a')](_[_0xb3d4('0x45')](_0x295ca2['query'],_0x34eba2[_0xb3d4('0x3a')]));_0x5461f6['where']['VoiceQueueId']=_0x5a415d['id'];if(_0x295ca2[_0xb3d4('0x38')][_0xb3d4('0x65')]){_0x5461f6['where']=_[_0xb3d4('0x47')](_0x5461f6[_0xb3d4('0x44')],{'$or':_['map'](_0x5461f6[_0xb3d4('0x3c')],function(_0x23f993){var _0x352742={};_0x352742[_0x23f993]={'$like':'%'+_0x295ca2['query'][_0xb3d4('0x65')]+'%'};return _0x352742;})});}_0x5461f6=_[_0xb3d4('0x47')]({},_0x5461f6,_0x295ca2['options']);return db['CmHopperHistory'][_0xb3d4('0x21')]({'where':_0x5461f6[_0xb3d4('0x44')]})[_0xb3d4('0x28')](function(_0x4e8a68){_0x2520d5[_0xb3d4('0x21')]=_0x4e8a68;if(_0x295ca2[_0xb3d4('0x38')][_0xb3d4('0x4e')]){_0x5461f6[_0xb3d4('0x49')]=[{'all':!![]}];}return db[_0xb3d4('0x67')]['findAll'](_0x5461f6);})[_0xb3d4('0x28')](function(_0x2ae130){_0x2520d5[_0xb3d4('0x4b')]=_0x2ae130;return _0x2520d5;});}})['then'](respondWithFilteredResult(_0x5c139f,_0x5461f6))[_0xb3d4('0x4f')](handleError(_0x5c139f,null));};exports[_0xb3d4('0x68')]=function(_0x309e4b,_0xb0e854,_0x4d7e9e){var _0x4b8a99={'raw':!![],'where':{}};var _0x1eb214={};var _0x470c99={'count':0x0,'rows':[]};return db[_0xb3d4('0x35')]['findOne']({'where':{'id':_0x309e4b[_0xb3d4('0x4d')]['id']}})['then'](handleEntityNotFound(_0xb0e854,null))['then'](function(_0x468bf1){if(_0x468bf1){_0x1eb214['model']=_[_0xb3d4('0x39')](db[_0xb3d4('0x69')]['rawAttributes']);_0x1eb214[_0xb3d4('0x38')]=_['keys'](_0x309e4b[_0xb3d4('0x38')]);_0x1eb214[_0xb3d4('0x3a')]=_['intersection'](_0x1eb214['model'],_0x1eb214[_0xb3d4('0x38')]);_0x4b8a99['attributes']=_['intersection'](_0x1eb214[_0xb3d4('0x37')],qs[_0xb3d4('0x3d')](_0x309e4b[_0xb3d4('0x38')][_0xb3d4('0x3d')]));_0x4b8a99[_0xb3d4('0x3c')]=_0x4b8a99[_0xb3d4('0x3c')]['length']?_0x4b8a99[_0xb3d4('0x3c')]:_0x1eb214[_0xb3d4('0x37')];if(!_0x309e4b['query'][_0xb3d4('0x3f')](_0xb3d4('0x40'))){_0x4b8a99[_0xb3d4('0x41')]=qs[_0xb3d4('0x41')](_0x309e4b[_0xb3d4('0x38')][_0xb3d4('0x41')]);_0x4b8a99[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x309e4b[_0xb3d4('0x38')][_0xb3d4('0x22')]);}_0x4b8a99[_0xb3d4('0x42')]=qs[_0xb3d4('0x43')](_0x309e4b['query'][_0xb3d4('0x43')]);_0x4b8a99[_0xb3d4('0x44')]=qs['filters'](_[_0xb3d4('0x45')](_0x309e4b[_0xb3d4('0x38')],_0x1eb214[_0xb3d4('0x3a')]));_0x4b8a99[_0xb3d4('0x44')][_0xb3d4('0x64')]=_0x468bf1['id'];if(_0x309e4b['query'][_0xb3d4('0x65')]){_0x4b8a99[_0xb3d4('0x44')]=_[_0xb3d4('0x47')](_0x4b8a99[_0xb3d4('0x44')],{'$or':_[_0xb3d4('0x2c')](_0x4b8a99[_0xb3d4('0x3c')],function(_0x153a14){var _0x461b28={};_0x461b28[_0x153a14]={'$like':'%'+_0x309e4b[_0xb3d4('0x38')]['filter']+'%'};return _0x461b28;})});}_0x4b8a99=_['merge']({},_0x4b8a99,_0x309e4b[_0xb3d4('0x48')]);return db['CmHopperFinal'][_0xb3d4('0x21')]({'where':_0x4b8a99['where']})[_0xb3d4('0x28')](function(_0x2d21b5){_0x470c99['count']=_0x2d21b5;if(_0x309e4b[_0xb3d4('0x38')][_0xb3d4('0x4e')]){_0x4b8a99[_0xb3d4('0x49')]=[{'all':!![]}];}return db[_0xb3d4('0x69')][_0xb3d4('0x4a')](_0x4b8a99);})[_0xb3d4('0x28')](function(_0x171c0a){_0x470c99[_0xb3d4('0x4b')]=_0x171c0a;return _0x470c99;});}})['then'](respondWithFilteredResult(_0xb0e854,_0x4b8a99))[_0xb3d4('0x4f')](handleError(_0xb0e854,null));};exports[_0xb3d4('0x6a')]=function(_0x40dee8,_0x3af777,_0x1b0015){var _0x2674e1={'raw':!![],'where':{}};var _0x39bc51={};var _0x144e72={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xb3d4('0x62')]({'where':{'id':_0x40dee8[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x3af777,null))['then'](function(_0x1e763e){if(_0x1e763e){_0x39bc51[_0xb3d4('0x37')]=_[_0xb3d4('0x39')](db[_0xb3d4('0x6b')]['rawAttributes']);_0x39bc51[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x40dee8[_0xb3d4('0x38')]);_0x39bc51[_0xb3d4('0x3a')]=_[_0xb3d4('0x3b')](_0x39bc51[_0xb3d4('0x37')],_0x39bc51['query']);_0x2674e1[_0xb3d4('0x3c')]=_['intersection'](_0x39bc51[_0xb3d4('0x37')],qs[_0xb3d4('0x3d')](_0x40dee8[_0xb3d4('0x38')]['fields']));_0x2674e1[_0xb3d4('0x3c')]=_0x2674e1[_0xb3d4('0x3c')]['length']?_0x2674e1['attributes']:_0x39bc51[_0xb3d4('0x37')];if(!_0x40dee8[_0xb3d4('0x38')][_0xb3d4('0x3f')](_0xb3d4('0x40'))){_0x2674e1['limit']=qs[_0xb3d4('0x41')](_0x40dee8['query']['limit']);_0x2674e1[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x40dee8['query'][_0xb3d4('0x22')]);}_0x2674e1[_0xb3d4('0x42')]=qs[_0xb3d4('0x43')](_0x40dee8['query'][_0xb3d4('0x43')]);_0x2674e1[_0xb3d4('0x44')]=qs[_0xb3d4('0x3a')](_[_0xb3d4('0x45')](_0x40dee8[_0xb3d4('0x38')],_0x39bc51[_0xb3d4('0x3a')]));_0x2674e1[_0xb3d4('0x44')][_0xb3d4('0x64')]=_0x1e763e['id'];if(_0x40dee8[_0xb3d4('0x38')]['filter']){_0x2674e1[_0xb3d4('0x44')]=_['merge'](_0x2674e1[_0xb3d4('0x44')],{'$or':_['map'](_0x2674e1[_0xb3d4('0x3c')],function(_0x36e801){var _0x4aa13a={};_0x4aa13a[_0x36e801]={'$like':'%'+_0x40dee8[_0xb3d4('0x38')]['filter']+'%'};return _0x4aa13a;})});}_0x2674e1=_[_0xb3d4('0x47')]({},_0x2674e1,_0x40dee8['options']);return db[_0xb3d4('0x6b')][_0xb3d4('0x21')]({'where':_0x2674e1[_0xb3d4('0x44')]})['then'](function(_0x14d42c){_0x144e72[_0xb3d4('0x21')]=_0x14d42c;if(_0x40dee8[_0xb3d4('0x38')]['includeAll']){_0x2674e1[_0xb3d4('0x49')]=[{'all':!![]}];}return db[_0xb3d4('0x6b')][_0xb3d4('0x4a')](_0x2674e1);})[_0xb3d4('0x28')](function(_0x5de9d5){_0x144e72['rows']=_0x5de9d5;return _0x144e72;});}})[_0xb3d4('0x28')](respondWithFilteredResult(_0x3af777,_0x2674e1))[_0xb3d4('0x4f')](handleError(_0x3af777,null));};exports[_0xb3d4('0x6c')]=function(_0xdca0,_0xefd831,_0x40388f){var _0x586b82={};var _0x3ace31={};var _0x10c37f;var _0x451b39;return db[_0xb3d4('0x35')][_0xb3d4('0x62')]({'where':{'id':_0xdca0[_0xb3d4('0x4d')]['id']}})['then'](handleEntityNotFound(_0xefd831,null))[_0xb3d4('0x28')](function(_0x1fd230){if(_0x1fd230){_0x10c37f=_0x1fd230;_0x3ace31[_0xb3d4('0x37')]=_[_0xb3d4('0x39')](db['Team'][_0xb3d4('0x5c')]);_0x3ace31[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0xdca0[_0xb3d4('0x38')]);_0x3ace31[_0xb3d4('0x3a')]=_[_0xb3d4('0x3b')](_0x3ace31[_0xb3d4('0x37')],_0x3ace31[_0xb3d4('0x38')]);_0x586b82['attributes']=_['intersection'](_0x3ace31[_0xb3d4('0x37')],qs[_0xb3d4('0x3d')](_0xdca0['query'][_0xb3d4('0x3d')]));_0x586b82[_0xb3d4('0x3c')]=_0x586b82[_0xb3d4('0x3c')][_0xb3d4('0x3e')]?_0x586b82[_0xb3d4('0x3c')]:_0x3ace31[_0xb3d4('0x37')];_0x586b82['order']=qs[_0xb3d4('0x43')](_0xdca0[_0xb3d4('0x38')]['sort']);_0x586b82[_0xb3d4('0x44')]=qs[_0xb3d4('0x3a')](_[_0xb3d4('0x45')](_0xdca0['query'],_0x3ace31[_0xb3d4('0x3a')]));if(_0xdca0[_0xb3d4('0x38')][_0xb3d4('0x65')]){_0x586b82[_0xb3d4('0x44')]=_[_0xb3d4('0x47')](_0x586b82[_0xb3d4('0x44')],{'$or':_[_0xb3d4('0x2c')](_0x586b82[_0xb3d4('0x3c')],function(_0x913103){var _0x14e5ce={};_0x14e5ce[_0x913103]={'$like':'%'+_0xdca0['query'][_0xb3d4('0x65')]+'%'};return _0x14e5ce;})});}_0x586b82=_[_0xb3d4('0x47')]({},_0x586b82,_0xdca0[_0xb3d4('0x48')]);return _0x10c37f['getTeams'](_0x586b82);}})[_0xb3d4('0x28')](function(_0x5874bd){if(_0x5874bd){_0x451b39=_0x5874bd[_0xb3d4('0x3e')];if(!_0xdca0[_0xb3d4('0x38')][_0xb3d4('0x3f')](_0xb3d4('0x40'))){_0x586b82[_0xb3d4('0x41')]=qs[_0xb3d4('0x41')](_0xdca0['query'][_0xb3d4('0x41')]);_0x586b82[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0xdca0[_0xb3d4('0x38')][_0xb3d4('0x22')]);}return _0x10c37f[_0xb3d4('0x6c')](_0x586b82);}})[_0xb3d4('0x28')](function(_0x5a0583){if(_0x5a0583){return _0x5a0583?{'count':_0x451b39,'rows':_0x5a0583}:null;}})[_0xb3d4('0x28')](respondWithResult(_0xefd831,null))[_0xb3d4('0x4f')](handleError(_0xefd831,null));};exports[_0xb3d4('0x6d')]=function(_0x4b0041,_0x454260,_0x3833b5){var _0x2eac8c=_0x4b0041[_0xb3d4('0x51')][_0xb3d4('0x6e')];var _0x10cbed=_[_0xb3d4('0x2c')](_0x2eac8c,'id');return db['Team'][_0xb3d4('0x4a')]({'where':{'id':_0x10cbed},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb3d4('0x6f'),'attributes':['id',_0xb3d4('0x31'),_0xb3d4('0x70'),_0xb3d4('0x71'),'interface'],'raw':!![]}]})[_0xb3d4('0x28')](function(_0xf9e504){if(_0xf9e504){var _0x1a44c7=_[_0xb3d4('0x72')](_0xf9e504,function(_0x116089){var _0x22efd0=_0x116089[_0xb3d4('0x53')]({'plain':!![]});_0x22efd0['Agents']['forEach'](function(_0x3d12b6){_0x3d12b6[_0xb3d4('0x73')]=_[_0xb3d4('0x2f')](_0x2eac8c,{'id':_0x22efd0['id']})['penalty'];});return _0x22efd0['Agents'];});return db[_0xb3d4('0x35')][_0xb3d4('0x2f')]({'where':{'id':_0x4b0041[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](function(_0x1e94be){return db[_0xb3d4('0x74')][_0xb3d4('0x75')](function(_0x1b03fe){return _0x1e94be[_0xb3d4('0x6d')](_0x10cbed,{'transaction':_0x1b03fe})['then'](function(){return BPromise[_0xb3d4('0x76')](_0x1a44c7,function(_0x527628){return db[_0xb3d4('0x77')]['findOrCreate']({'where':{'UserId':_0x527628['id'],'VoiceQueueId':_0x4b0041['params']['id']},'defaults':{'penalty':_0x527628[_0xb3d4('0x73')]},'transaction':_0x1b03fe});});})[_0xb3d4('0x28')](function(){return BPromise[_0xb3d4('0x76')](_[_0xb3d4('0x65')](_0x1a44c7,{'online':!![]}),function(_0x568a79){return db[_0xb3d4('0x78')][_0xb3d4('0x79')]({'membername':_0x568a79[_0xb3d4('0x31')],'UserId':_0x568a79['id'],'queue_name':_0x1e94be[_0xb3d4('0x31')],'VoiceQueueId':_0x1e94be['id'],'interface':_[_0xb3d4('0x7a')](_0x568a79['interface'])?util[_0xb3d4('0x7b')](_0xb3d4('0x7c'),_0x568a79[_0xb3d4('0x31')]):_0x568a79[_0xb3d4('0x7d')],'paused':_0x568a79['voicePause']||![],'penalty':_0x568a79[_0xb3d4('0x73')]},{'transaction':_0x1b03fe});});})['then'](function(){_0x1a44c7[_0xb3d4('0x7e')](function(_0x14bc1f){socket['emit'](_0xb3d4('0x7f'),{'UserId':_0x14bc1f['id'],'VoiceQueueId':_0x1e94be['id']});});});});});}})[_0xb3d4('0x28')](respondWithStatusCode(_0x454260,null))[_0xb3d4('0x4f')](handleError(_0x454260,null));};exports['removeTeams']=function(_0x38d128,_0x3b3952,_0x77f05a){return db['Team']['findAll']({'where':{'id':_0x38d128[_0xb3d4('0x38')][_0xb3d4('0x80')]},'attributes':['id'],'include':[{'model':db[_0xb3d4('0x81')],'as':_0xb3d4('0x6f'),'attributes':['id'],'raw':!![]}]})[_0xb3d4('0x28')](handleEntityNotFound(_0x3b3952,null))[_0xb3d4('0x28')](function(_0xcaeacd){var _0x12f7c6=_[_0xb3d4('0x2c')](_0xcaeacd,'id');var _0x50f04c=[];var _0x2eb1a6=[];var _0x4cb750=squel['select']();_0x4cb750[_0xb3d4('0x82')](_0xb3d4('0x83'))[_0xb3d4('0x84')]('team_has_voice_queues','tq')[_0xb3d4('0x85')](_0xb3d4('0x86'),'ut',_0xb3d4('0x87'))[_0xb3d4('0x44')](_0xb3d4('0x88'),_0x38d128[_0xb3d4('0x4d')]['id']);for(var _0x20dc66=0x0;_0x20dc66<_0xcaeacd[_0xb3d4('0x3e')];_0x20dc66+=0x1){let _0x1c9255=_0xcaeacd[_0x20dc66];for(var _0x385c9d=0x0;_0x385c9d<_0x1c9255[_0xb3d4('0x6f')][_0xb3d4('0x3e')];_0x385c9d+=0x1){let _0x5d090a=_0x1c9255[_0xb3d4('0x6f')][_0x385c9d];var _0x2ddd28=_0x4cb750['clone']();_0x2ddd28[_0xb3d4('0x44')](_0xb3d4('0x89'),_0x5d090a['id']);_0x2eb1a6[_0xb3d4('0x8a')](db['sequelize']['query'](_0x2ddd28[_0xb3d4('0x8b')](),{'type':db['sequelize'][_0xb3d4('0x8c')][_0xb3d4('0x8d')]})[_0xb3d4('0x28')](function(_0x1ede1c){if(_0x1ede1c[_0xb3d4('0x3e')]===0x1){return _0x5d090a['id'];}else{var _0x866b10=_[_0xb3d4('0x8e')](_[_0xb3d4('0x2c')](_0x1ede1c,_0xb3d4('0x8f')),function(_0x4ff0ae){return _[_0xb3d4('0x2e')](_0x12f7c6,_0x4ff0ae);});if(_0x866b10){return _0x5d090a['id'];}}}));}}return BPromise[_0xb3d4('0x90')](_0x2eb1a6)[_0xb3d4('0x28')](function(_0x1a36ac){_0x50f04c=_(_0x50f04c)[_0xb3d4('0x91')](_0x1a36ac)[_0xb3d4('0x92')]()[_0xb3d4('0x2d')]();return db[_0xb3d4('0x35')]['find']({'where':{'id':_0x38d128[_0xb3d4('0x4d')]['id']}})['then'](function(_0x17d759){return db[_0xb3d4('0x74')][_0xb3d4('0x75')](function(_0x40745a){return _0x17d759[_0xb3d4('0x93')](_0x38d128[_0xb3d4('0x38')][_0xb3d4('0x80')],{'transaction':_0x40745a})[_0xb3d4('0x28')](function(){if(!_[_0xb3d4('0x94')](_0x50f04c)){return _0x17d759['removeAgents'](_0x50f04c,{'transaction':_0x40745a})[_0xb3d4('0x28')](function(){return db[_0xb3d4('0x78')]['destroy']({'where':{'VoiceQueueId':_0x38d128['params']['id'],'UserId':_0x50f04c},'transaction':_0x40745a});});}})[_0xb3d4('0x28')](function(){_0x50f04c[_0xb3d4('0x7e')](function(_0x3bc8df){socket['emit'](_0xb3d4('0x95'),{'UserId':_0x3bc8df,'VoiceQueueId':_0x17d759['id']});});});});});});})[_0xb3d4('0x28')](respondWithStatusCode(_0x3b3952,null))[_0xb3d4('0x4f')](handleError(_0x3b3952,null));};exports[_0xb3d4('0x96')]=function(_0x276e4a,_0x2d2682,_0xaf927b){var _0x3836c3,_0x20e483;return db['VoiceQueue'][_0xb3d4('0x2f')]({'where':{'id':_0x276e4a[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x2d2682,null))['then'](function(_0x175e20){if(_0x175e20){_0x20e483=_0x175e20;return _0x175e20[_0xb3d4('0x96')](_0x276e4a[_0xb3d4('0x51')][_0xb3d4('0x80')],_[_0xb3d4('0x5d')](_0x276e4a[_0xb3d4('0x51')],[_0xb3d4('0x80'),'id'])||{})[_0xb3d4('0x97')](function(_0x4a20c3){for(var _0x55fc14=0x0;_0x55fc14<_0x276e4a[_0xb3d4('0x51')][_0xb3d4('0x80')][_0xb3d4('0x3e')];_0x55fc14+=0x1){socket['emit'](_0xb3d4('0x7f'),{'UserId':_0x276e4a['body'][_0xb3d4('0x80')][_0x55fc14],'VoiceQueueId':_0x276e4a['params']['id']});}return _0x4a20c3;});}})['then'](function(_0x3e47ff){_0x3836c3=_0x3e47ff||[];if(_0x20e483){return db[_0xb3d4('0x81')][_0xb3d4('0x4a')]({'where':{'id':_0x276e4a[_0xb3d4('0x51')][_0xb3d4('0x80')]},'attributes':['id',_0xb3d4('0x31'),'online',_0xb3d4('0x71'),'interface'],'raw':!![]});}})[_0xb3d4('0x28')](function(_0x314c88){if(!_['isEmpty'](_0x314c88)){var _0x91a351=[];for(var _0x4a6830=0x0;_0x4a6830<_0x314c88[_0xb3d4('0x3e')];_0x4a6830++){if(_0x314c88[_0x4a6830][_0xb3d4('0x70')]){_0x91a351['push'](db[_0xb3d4('0x78')]['upsert']({'membername':_0x314c88[_0x4a6830][_0xb3d4('0x31')],'UserId':_0x314c88[_0x4a6830]['id'],'queue_name':_0x20e483[_0xb3d4('0x31')],'VoiceQueueId':_0x20e483['id'],'interface':_[_0xb3d4('0x7a')](_0x314c88[_0x4a6830][_0xb3d4('0x7d')])?util[_0xb3d4('0x7b')](_0xb3d4('0x7c'),_0x314c88[_0x4a6830][_0xb3d4('0x31')]):_0x314c88[_0x4a6830][_0xb3d4('0x7d')],'paused':_0x314c88[_0x4a6830]['voicePause']||![],'penalty':_0x276e4a['body'][_0xb3d4('0x73')]||0x0}));}}return BPromise[_0xb3d4('0x90')](_0x91a351);}})[_0xb3d4('0x28')](function(){return _0x3836c3;})['then'](respondWithResult(_0x2d2682,null))[_0xb3d4('0x4f')](handleError(_0x2d2682,null));};exports[_0xb3d4('0x98')]=function(_0x35ce8f,_0x1f928d,_0x5efd04){return db['VoiceQueue'][_0xb3d4('0x2f')]({'where':{'id':_0x35ce8f['params']['id']}})['then'](handleEntityNotFound(_0x1f928d,null))[_0xb3d4('0x28')](function(_0x55a161){if(_0x55a161){return _0x55a161[_0xb3d4('0x98')](_0x35ce8f[_0xb3d4('0x38')]['ids'])['then'](function(){if(_[_0xb3d4('0x99')](_0x35ce8f['query'][_0xb3d4('0x80')])){for(var _0x48ca0f=0x0;_0x48ca0f<_0x35ce8f[_0xb3d4('0x38')][_0xb3d4('0x80')][_0xb3d4('0x3e')];_0x48ca0f+=0x1){socket['emit'](_0xb3d4('0x95'),{'UserId':Number(_0x35ce8f[_0xb3d4('0x38')]['ids'][_0x48ca0f]),'VoiceQueueId':Number(_0x35ce8f[_0xb3d4('0x4d')]['id'])});}}else{socket[_0xb3d4('0x9a')](_0xb3d4('0x95'),{'UserId':Number(_0x35ce8f[_0xb3d4('0x38')]['ids']),'VoiceQueueId':Number(_0x35ce8f[_0xb3d4('0x4d')]['id'])});}});}})['then'](function(_0x21610a){return db[_0xb3d4('0x78')][_0xb3d4('0x29')]({'where':{'VoiceQueueId':_0x35ce8f['params']['id'],'UserId':_0x35ce8f[_0xb3d4('0x38')]['ids']}})[_0xb3d4('0x28')](function(){return _0x21610a;});})[_0xb3d4('0x28')](respondWithStatusCode(_0x1f928d,null))[_0xb3d4('0x4f')](handleError(_0x1f928d,null));};exports[_0xb3d4('0x9b')]=function(_0x54401b,_0x553f81,_0x501c35){var _0xff1dfc={};var _0x3898ba={};var _0x29e02e;var _0x3218e7;return db['VoiceQueue'][_0xb3d4('0x62')]({'where':{'id':_0x54401b['params']['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x553f81,null))[_0xb3d4('0x28')](function(_0x500d3e){if(_0x500d3e){_0x29e02e=_0x500d3e;_0x3898ba[_0xb3d4('0x37')]=_[_0xb3d4('0x39')](db['User'][_0xb3d4('0x5c')]);_0x3898ba[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x54401b[_0xb3d4('0x38')]);_0x3898ba['filters']=_[_0xb3d4('0x3b')](_0x3898ba['model'],_0x3898ba[_0xb3d4('0x38')]);_0xff1dfc[_0xb3d4('0x3c')]=_[_0xb3d4('0x3b')](_0x3898ba[_0xb3d4('0x37')],qs[_0xb3d4('0x3d')](_0x54401b[_0xb3d4('0x38')][_0xb3d4('0x3d')]));_0xff1dfc[_0xb3d4('0x3c')]=_0xff1dfc[_0xb3d4('0x3c')][_0xb3d4('0x3e')]?_0xff1dfc[_0xb3d4('0x3c')]:_0x3898ba[_0xb3d4('0x37')];_0xff1dfc['order']=qs[_0xb3d4('0x43')](_0x54401b[_0xb3d4('0x38')][_0xb3d4('0x43')]);_0xff1dfc[_0xb3d4('0x44')]=qs[_0xb3d4('0x3a')](_['pick'](_0x54401b[_0xb3d4('0x38')],_0x3898ba[_0xb3d4('0x3a')]));if(_0x54401b[_0xb3d4('0x38')][_0xb3d4('0x65')]){_0xff1dfc['where']=_[_0xb3d4('0x47')](_0xff1dfc[_0xb3d4('0x44')],{'$or':_[_0xb3d4('0x2c')](_0xff1dfc[_0xb3d4('0x3c')],function(_0x10c70a){var _0x161874={};_0x161874[_0x10c70a]={'$like':'%'+_0x54401b[_0xb3d4('0x38')][_0xb3d4('0x65')]+'%'};return _0x161874;})});}_0xff1dfc=_[_0xb3d4('0x47')]({},_0xff1dfc,_0x54401b[_0xb3d4('0x48')]);return _0x29e02e['getAgents'](_0xff1dfc);}})[_0xb3d4('0x28')](function(_0x1ac46a){if(_0x1ac46a){_0x3218e7=_0x1ac46a[_0xb3d4('0x3e')];if(!_0x54401b['query']['hasOwnProperty'](_0xb3d4('0x40'))){_0xff1dfc['limit']=qs['limit'](_0x54401b[_0xb3d4('0x38')][_0xb3d4('0x41')]);_0xff1dfc[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x54401b['query'][_0xb3d4('0x22')]);}return _0x29e02e[_0xb3d4('0x9b')](_0xff1dfc);}})[_0xb3d4('0x28')](function(_0x58c211){if(_0x58c211){return _0x58c211?{'count':_0x3218e7,'rows':_0x58c211}:null;}})[_0xb3d4('0x28')](respondWithResult(_0x553f81,null))['catch'](handleError(_0x553f81,null));};exports[_0xb3d4('0x9c')]=function(_0x47ec2a,_0x362f31,_0x43890d){var _0xe5a2bc={};var _0x3fb47f={};var _0x838f41;var _0x151379;return db[_0xb3d4('0x35')][_0xb3d4('0x62')]({'where':{'id':_0x47ec2a[_0xb3d4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x362f31,null))['then'](function(_0x7f6386){if(_0x7f6386){_0x838f41=_0x7f6386;_0x3fb47f['model']=_[_0xb3d4('0x39')](db[_0xb3d4('0x78')][_0xb3d4('0x5c')]);_0x3fb47f[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x47ec2a[_0xb3d4('0x38')]);_0x3fb47f[_0xb3d4('0x3a')]=_[_0xb3d4('0x3b')](_0x3fb47f[_0xb3d4('0x37')],_0x3fb47f['query']);_0xe5a2bc[_0xb3d4('0x3c')]=_[_0xb3d4('0x3b')](_0x3fb47f[_0xb3d4('0x37')],qs[_0xb3d4('0x3d')](_0x47ec2a[_0xb3d4('0x38')][_0xb3d4('0x3d')]));_0xe5a2bc['attributes']=_0xe5a2bc[_0xb3d4('0x3c')][_0xb3d4('0x3e')]?_0xe5a2bc[_0xb3d4('0x3c')]:_0x3fb47f[_0xb3d4('0x37')];_0xe5a2bc[_0xb3d4('0x42')]=qs['sort'](_0x47ec2a['query'][_0xb3d4('0x43')]);_0xe5a2bc[_0xb3d4('0x44')]=qs[_0xb3d4('0x3a')](_[_0xb3d4('0x45')](_0x47ec2a['query'],_0x3fb47f[_0xb3d4('0x3a')]));if(_0x47ec2a[_0xb3d4('0x38')]['filter']){_0xe5a2bc[_0xb3d4('0x44')]=_[_0xb3d4('0x47')](_0xe5a2bc[_0xb3d4('0x44')],{'$or':_[_0xb3d4('0x2c')](_0xe5a2bc['attributes'],function(_0x15d527){var _0x3ea29e={};_0x3ea29e[_0x15d527]={'$like':'%'+_0x47ec2a[_0xb3d4('0x38')][_0xb3d4('0x65')]+'%'};return _0x3ea29e;})});}_0xe5a2bc=_[_0xb3d4('0x47')]({},_0xe5a2bc,_0x47ec2a[_0xb3d4('0x48')]);return _0x838f41[_0xb3d4('0x9c')](_0xe5a2bc);}})[_0xb3d4('0x28')](function(_0x3d0f84){if(_0x3d0f84){_0x151379=_0x3d0f84['length'];if(!_0x47ec2a[_0xb3d4('0x38')][_0xb3d4('0x3f')]('nolimit')){_0xe5a2bc['limit']=qs['limit'](_0x47ec2a[_0xb3d4('0x38')][_0xb3d4('0x41')]);_0xe5a2bc[_0xb3d4('0x22')]=qs['offset'](_0x47ec2a['query'][_0xb3d4('0x22')]);}return _0x838f41[_0xb3d4('0x9c')](_0xe5a2bc);}})[_0xb3d4('0x28')](function(_0x5600b7){return _0x5600b7?{'count':_0x151379,'rows':_0x5600b7}:null;})[_0xb3d4('0x28')](respondWithResult(_0x362f31,null))[_0xb3d4('0x4f')](handleError(_0x362f31,null));};exports['getLists']=function(_0x3a20ce,_0x1b87b3,_0x55360b){var _0x5efbb1={};var _0x47993d={};var _0x19f8bf;var _0x2a5fb1;return db[_0xb3d4('0x35')]['findOne']({'where':{'id':_0x3a20ce[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x1b87b3,null))[_0xb3d4('0x28')](function(_0x28520a){if(_0x28520a){_0x19f8bf=_0x28520a;_0x47993d['model']=_[_0xb3d4('0x39')](db['CmList'][_0xb3d4('0x5c')]);_0x47993d[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x3a20ce[_0xb3d4('0x38')]);_0x47993d[_0xb3d4('0x3a')]=_['intersection'](_0x47993d[_0xb3d4('0x37')],_0x47993d['query']);_0x5efbb1[_0xb3d4('0x3c')]=_[_0xb3d4('0x3b')](_0x47993d['model'],qs[_0xb3d4('0x3d')](_0x3a20ce[_0xb3d4('0x38')][_0xb3d4('0x3d')]));_0x5efbb1[_0xb3d4('0x3c')]=_0x5efbb1[_0xb3d4('0x3c')][_0xb3d4('0x3e')]?_0x5efbb1[_0xb3d4('0x3c')]:_0x47993d[_0xb3d4('0x37')];_0x5efbb1[_0xb3d4('0x42')]=qs[_0xb3d4('0x43')](_0x3a20ce[_0xb3d4('0x38')][_0xb3d4('0x43')]);_0x5efbb1[_0xb3d4('0x44')]=qs[_0xb3d4('0x3a')](_[_0xb3d4('0x45')](_0x3a20ce[_0xb3d4('0x38')],_0x47993d['filters']));if(_0x3a20ce[_0xb3d4('0x38')][_0xb3d4('0x65')]){_0x5efbb1[_0xb3d4('0x44')]=_[_0xb3d4('0x47')](_0x5efbb1[_0xb3d4('0x44')],{'$or':_['map'](_0x5efbb1[_0xb3d4('0x3c')],function(_0x321239){var _0x1c698f={};_0x1c698f[_0x321239]={'$like':'%'+_0x3a20ce[_0xb3d4('0x38')][_0xb3d4('0x65')]+'%'};return _0x1c698f;})});}_0x5efbb1=_[_0xb3d4('0x47')]({},_0x5efbb1,_0x3a20ce[_0xb3d4('0x48')]);return _0x19f8bf[_0xb3d4('0x9d')](_0x5efbb1);}})['then'](function(_0x57b104){if(_0x57b104){_0x2a5fb1=_0x57b104[_0xb3d4('0x3e')];if(!_0x3a20ce[_0xb3d4('0x38')][_0xb3d4('0x3f')](_0xb3d4('0x40'))){_0x5efbb1['limit']=qs[_0xb3d4('0x41')](_0x3a20ce[_0xb3d4('0x38')]['limit']);_0x5efbb1[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x3a20ce[_0xb3d4('0x38')][_0xb3d4('0x22')]);}return _0x19f8bf[_0xb3d4('0x9d')](_0x5efbb1);}})['then'](function(_0x478cc8){if(_0x478cc8){return _0x478cc8?{'count':_0x2a5fb1,'rows':_0x478cc8}:null;}})[_0xb3d4('0x28')](respondWithResult(_0x1b87b3,null))[_0xb3d4('0x4f')](handleError(_0x1b87b3,null));};exports[_0xb3d4('0x9e')]=function(_0x2d0812,_0x529194,_0x25db92){var _0x7c6008,_0x51b679;return db[_0xb3d4('0x35')][_0xb3d4('0x2f')]({'where':{'id':_0x2d0812[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x529194,null))['then'](function(_0x3b7946){if(_0x3b7946){_0x51b679=_0x3b7946;return _0x3b7946['addLists'](_0x2d0812[_0xb3d4('0x51')][_0xb3d4('0x80')],_[_0xb3d4('0x5d')](_0x2d0812[_0xb3d4('0x51')],[_0xb3d4('0x80'),'id'])||{});}return null;})[_0xb3d4('0x97')](function(_0x342c49){var _0x3a9bfd;_0x7c6008=_0x342c49||[];var _0x3b340c=[];if(_0x342c49){for(var _0x5cd2c8=0x0;_0x5cd2c8<_0x342c49[_0xb3d4('0x3e')];_0x5cd2c8+=0x1){var _0x3cfa85=_0x342c49[_0x5cd2c8]['get']({'plain':!![]});_0x51b679[_0xb3d4('0x9f')]=_0x2d0812[_0xb3d4('0x51')][_0xb3d4('0x9f')]?_0x2d0812['body'][_0xb3d4('0x9f')]:_0x51b679[_0xb3d4('0x9f')];switch(_0x51b679[_0xb3d4('0x9f')]){case'always':_0x3a9bfd=squel['insert']()[_0xb3d4('0xa0')](_0xb3d4('0xa1'))[_0xb3d4('0xa2')]([_0xb3d4('0xa3'),_0xb3d4('0xa4'),_0xb3d4('0xa5'),_0xb3d4('0xa6'),_0xb3d4('0x64'),'createdAt',_0xb3d4('0x5f')],squel[_0xb3d4('0xa7')]()[_0xb3d4('0x82')](_0xb3d4('0xa3'),_0xb3d4('0xa3'))[_0xb3d4('0x82')](_0xb3d4('0xa8'),'scheduledAt')[_0xb3d4('0x82')]('id',_0xb3d4('0xa5'))[_0xb3d4('0x82')](_0x3cfa85['CmListId'][_0xb3d4('0x8b')](),_0xb3d4('0xa6'))[_0xb3d4('0x82')](_0x2d0812[_0xb3d4('0x4d')]['id'][_0xb3d4('0x8b')](),_0xb3d4('0x64'))[_0xb3d4('0x82')](_0xb3d4('0xa8'),'createdAt')[_0xb3d4('0x82')]('NOW()',_0xb3d4('0x5f'))['from'](_0xb3d4('0xa9'))['where'](_0xb3d4('0xaa'))[_0xb3d4('0x44')](_0xb3d4('0xab'),_0x3cfa85['CmListId'][_0xb3d4('0x8b')]())['where'](_0xb3d4('0xac'))[_0xb3d4('0x44')](_0xb3d4('0xad'),squel[_0xb3d4('0xa7')]()[_0xb3d4('0x82')](_0xb3d4('0xae'))[_0xb3d4('0x84')](_0xb3d4('0xaf'))[_0xb3d4('0x44')]('VoiceQueueId\x20=\x20?',_0x2d0812['params']['id'][_0xb3d4('0x8b')]()))[_0xb3d4('0x44')](_0xb3d4('0xad'),squel[_0xb3d4('0xa7')]()[_0xb3d4('0x82')](_0xb3d4('0xb0'))[_0xb3d4('0x84')](_0xb3d4('0xa1'))[_0xb3d4('0x44')](_0xb3d4('0x88'),_0x2d0812[_0xb3d4('0x4d')]['id']['toString']())))[_0xb3d4('0x8b')]();break;case _0xb3d4('0xb1'):_0x3a9bfd=squel[_0xb3d4('0xb2')]()[_0xb3d4('0xa0')](_0xb3d4('0xa1'))[_0xb3d4('0xa2')](['phone','scheduledAt',_0xb3d4('0xa5'),'ListId',_0xb3d4('0x64'),_0xb3d4('0x5e'),'updatedAt'],squel[_0xb3d4('0xa7')]()[_0xb3d4('0x82')](_0xb3d4('0xa3'),'phone')[_0xb3d4('0x82')](_0xb3d4('0xa8'),_0xb3d4('0xa4'))[_0xb3d4('0x82')]('id',_0xb3d4('0xa5'))['field'](_0x3cfa85['CmListId'][_0xb3d4('0x8b')](),_0xb3d4('0xa6'))[_0xb3d4('0x82')](_0x2d0812['params']['id'][_0xb3d4('0x8b')](),_0xb3d4('0x64'))[_0xb3d4('0x82')](_0xb3d4('0xa8'),_0xb3d4('0x5e'))[_0xb3d4('0x82')](_0xb3d4('0xa8'),_0xb3d4('0x5f'))[_0xb3d4('0x84')](_0xb3d4('0xa9'))[_0xb3d4('0x44')](_0xb3d4('0xaa'))[_0xb3d4('0x44')]('ListId\x20=\x20?',_0x3cfa85[_0xb3d4('0xb3')][_0xb3d4('0x8b')]())[_0xb3d4('0x44')](_0xb3d4('0xac'))[_0xb3d4('0x44')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xb3d4('0x82')](_0xb3d4('0xb0'))['from']('cm_hopper')[_0xb3d4('0x44')](_0xb3d4('0x88'),_0x2d0812['params']['id'][_0xb3d4('0x8b')]())))[_0xb3d4('0x8b')]();break;default:_0x3a9bfd=squel['insert']()[_0xb3d4('0xa0')](_0xb3d4('0xa1'))['fromQuery']([_0xb3d4('0xa3'),_0xb3d4('0xa4'),_0xb3d4('0xa5'),'ListId','VoiceQueueId',_0xb3d4('0x5e'),_0xb3d4('0x5f')],squel[_0xb3d4('0xa7')]()['field'](_0xb3d4('0xa3'),_0xb3d4('0xa3'))[_0xb3d4('0x82')](_0xb3d4('0xa8'),_0xb3d4('0xa4'))[_0xb3d4('0x82')]('id',_0xb3d4('0xa5'))[_0xb3d4('0x82')](_0x3cfa85['CmListId'][_0xb3d4('0x8b')](),'ListId')[_0xb3d4('0x82')](_0x2d0812[_0xb3d4('0x4d')]['id'][_0xb3d4('0x8b')](),_0xb3d4('0x64'))[_0xb3d4('0x82')]('NOW()',_0xb3d4('0x5e'))[_0xb3d4('0x82')](_0xb3d4('0xa8'),_0xb3d4('0x5f'))[_0xb3d4('0x84')]('cm_contacts')['where'](_0xb3d4('0xaa'))[_0xb3d4('0x44')](_0xb3d4('0xab'),_0x3cfa85['CmListId'][_0xb3d4('0x8b')]())[_0xb3d4('0x44')](_0xb3d4('0xac')))['toString']();}_0x3b340c[_0xb3d4('0x8a')](db[_0xb3d4('0x74')][_0xb3d4('0x38')](_0x3a9bfd));}return BPromise['all'](_0x3b340c);}})['then'](function(){return _0x7c6008;})[_0xb3d4('0x28')](respondWithResult(_0x529194,null))[_0xb3d4('0x4f')](handleError(_0x529194,null));};exports[_0xb3d4('0xb4')]=function(_0x5088ff,_0x11d1ca,_0x53147e){return db[_0xb3d4('0x35')][_0xb3d4('0x2f')]({'where':{'id':_0x5088ff[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x11d1ca,null))[_0xb3d4('0x28')](function(_0x553dec){if(_0x553dec){return _0x553dec[_0xb3d4('0xb4')](_0x5088ff['query'][_0xb3d4('0x80')]);}})['then'](function(_0x526ebe){if(_0x526ebe){return db[_0xb3d4('0x63')][_0xb3d4('0x29')]({'where':{'ListId':_0x5088ff['query'][_0xb3d4('0x80')],'VoiceQueueId':_0x5088ff[_0xb3d4('0x4d')]['id']}})['then'](function(){return _0x526ebe;});}})[_0xb3d4('0x28')](respondWithStatusCode(_0x11d1ca,null))[_0xb3d4('0x4f')](handleError(_0x11d1ca,null));};exports[_0xb3d4('0xb5')]=function(_0x218705,_0x36bad7,_0x339c16){var _0x2b41ad={};var _0x360e2b={};var _0x1d85fe;var _0x38d774;return db[_0xb3d4('0x35')][_0xb3d4('0x62')]({'where':{'id':_0x218705[_0xb3d4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x36bad7,null))['then'](function(_0x52f823){if(_0x52f823){_0x1d85fe=_0x52f823;_0x360e2b[_0xb3d4('0x37')]=_[_0xb3d4('0x39')](db['CmList'][_0xb3d4('0x5c')]);_0x360e2b[_0xb3d4('0x38')]=_[_0xb3d4('0x39')](_0x218705['query']);_0x360e2b['filters']=_[_0xb3d4('0x3b')](_0x360e2b['model'],_0x360e2b[_0xb3d4('0x38')]);_0x2b41ad[_0xb3d4('0x3c')]=_['intersection'](_0x360e2b['model'],qs[_0xb3d4('0x3d')](_0x218705['query']['fields']));_0x2b41ad[_0xb3d4('0x3c')]=_0x2b41ad['attributes'][_0xb3d4('0x3e')]?_0x2b41ad['attributes']:_0x360e2b[_0xb3d4('0x37')];_0x2b41ad[_0xb3d4('0x42')]=qs['sort'](_0x218705[_0xb3d4('0x38')][_0xb3d4('0x43')]);_0x2b41ad['where']=qs[_0xb3d4('0x3a')](_[_0xb3d4('0x45')](_0x218705[_0xb3d4('0x38')],_0x360e2b['filters']));if(_0x218705[_0xb3d4('0x38')][_0xb3d4('0x65')]){_0x2b41ad['where']=_[_0xb3d4('0x47')](_0x2b41ad[_0xb3d4('0x44')],{'$or':_[_0xb3d4('0x2c')](_0x2b41ad[_0xb3d4('0x3c')],function(_0x3dd7dc){var _0x527c3e={};_0x527c3e[_0x3dd7dc]={'$like':'%'+_0x218705[_0xb3d4('0x38')][_0xb3d4('0x65')]+'%'};return _0x527c3e;})});}_0x2b41ad=_[_0xb3d4('0x47')]({},_0x2b41ad,_0x218705['options']);return _0x1d85fe['getBlackLists'](_0x2b41ad);}})['then'](function(_0x40ba8a){if(_0x40ba8a){_0x38d774=_0x40ba8a[_0xb3d4('0x3e')];if(!_0x218705[_0xb3d4('0x38')]['hasOwnProperty'](_0xb3d4('0x40'))){_0x2b41ad[_0xb3d4('0x41')]=qs['limit'](_0x218705['query'][_0xb3d4('0x41')]);_0x2b41ad[_0xb3d4('0x22')]=qs[_0xb3d4('0x22')](_0x218705[_0xb3d4('0x38')][_0xb3d4('0x22')]);}return _0x1d85fe[_0xb3d4('0xb5')](_0x2b41ad);}})['then'](function(_0x350274){if(_0x350274){return _0x350274?{'count':_0x38d774,'rows':_0x350274}:null;}})['then'](respondWithResult(_0x36bad7,null))[_0xb3d4('0x4f')](handleError(_0x36bad7,null));};exports[_0xb3d4('0xb6')]=function(_0x261f2b,_0x1ce3d4,_0x3152ca){var _0xa8c1b6,_0x1803a7;return db[_0xb3d4('0x35')]['find']({'where':{'id':_0x261f2b[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](handleEntityNotFound(_0x1ce3d4,null))['then'](function(_0x5d8c77){if(_0x5d8c77){_0x1803a7=_0x5d8c77;return _0x5d8c77[_0xb3d4('0xb6')](_0x261f2b[_0xb3d4('0x51')]['ids'],_[_0xb3d4('0x5d')](_0x261f2b[_0xb3d4('0x51')],[_0xb3d4('0x80'),'id'])||{});}return null;})['spread'](function(_0xd5526d){var _0x4b8e0c;_0xa8c1b6=_0xd5526d||[];var _0x3a2eec=[];if(_0xd5526d){for(var _0x553586=0x0;_0x553586<_0xd5526d['length'];_0x553586+=0x1){var _0x38d673=_0xd5526d[_0x553586][_0xb3d4('0x53')]({'plain':!![]});_0x4b8e0c=squel[_0xb3d4('0xb2')]()[_0xb3d4('0xa0')](_0xb3d4('0xb7'))[_0xb3d4('0xa2')]([_0xb3d4('0xa3'),'ContactId','ListId',_0xb3d4('0x64'),'createdAt','updatedAt'],squel[_0xb3d4('0xa7')]()[_0xb3d4('0x82')](_0xb3d4('0xa3'),_0xb3d4('0xa3'))[_0xb3d4('0x82')]('id',_0xb3d4('0xa5'))[_0xb3d4('0x82')](_0x38d673[_0xb3d4('0xb3')][_0xb3d4('0x8b')](),'ListId')[_0xb3d4('0x82')](_0x261f2b[_0xb3d4('0x4d')]['id']['toString'](),_0xb3d4('0x64'))[_0xb3d4('0x82')]('NOW()',_0xb3d4('0x5e'))[_0xb3d4('0x82')](_0xb3d4('0xa8'),_0xb3d4('0x5f'))[_0xb3d4('0x84')]('cm_contacts')[_0xb3d4('0x44')](_0xb3d4('0xaa'))[_0xb3d4('0x44')](_0xb3d4('0xab'),_0x38d673[_0xb3d4('0xb3')]['toString']())[_0xb3d4('0x44')]('phone\x20IS\x20NOT\x20NULL'))[_0xb3d4('0x8b')]();_0x3a2eec[_0xb3d4('0x8a')](db['sequelize']['query'](_0x4b8e0c));}return BPromise[_0xb3d4('0x90')](_0x3a2eec);}})['then'](function(){return _0xa8c1b6;})['then'](respondWithResult(_0x1ce3d4,null))[_0xb3d4('0x4f')](handleError(_0x1ce3d4,null));};exports[_0xb3d4('0xb8')]=function(_0x506bde,_0x378880,_0x8de736){return db['VoiceQueue'][_0xb3d4('0x2f')]({'where':{'id':_0x506bde[_0xb3d4('0x4d')]['id']}})['then'](handleEntityNotFound(_0x378880,null))[_0xb3d4('0x28')](function(_0x4b8a66){if(_0x4b8a66){return _0x4b8a66[_0xb3d4('0xb8')](_0x506bde[_0xb3d4('0x38')][_0xb3d4('0x80')]);}})['then'](function(_0x51cee6){if(_0x51cee6){return db[_0xb3d4('0x6b')][_0xb3d4('0x29')]({'where':{'ListId':_0x506bde[_0xb3d4('0x38')]['ids'],'VoiceQueueId':_0x506bde[_0xb3d4('0x4d')]['id']}})[_0xb3d4('0x28')](function(){return _0x51cee6;});}})[_0xb3d4('0x28')](respondWithStatusCode(_0x378880,null))[_0xb3d4('0x4f')](handleError(_0x378880,null));}; \ No newline at end of file +var _0x1776=['flatMap','forEach','penalty','sequelize','transaction','each','UserVoiceQueue','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','voicePause','emit','userVoiceQueue:save','ids','User','field','tq.TeamId','from','team_has_voice_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','QueryTypes','TeamId','includes','all','union','compact','userVoiceQueue:remove','addAgents','spread','isEmpty','removeAgents','isArray','getAgents','getMembers','getLists','addLists','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','ListId','NOW()','toString','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','CmListId','phone\x20NOT\x20IN\x20(?)','select','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','onlyIfOpen','cm_hopper','cm_contacts','phone\x20IS\x20NOT\x20NULL','into','push','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','json','count','limit','Content-Range','save','then','destroy','VoiceQueues','inbound','QueueCampaigns','outbound','filter','ignore','map','value','find','type','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','offset','order','sort','where','merge','VIRTUAL','includeAll','include','findAll','catch','show','params','create','body','get','role','user','UserProfileSection','userProfileId','autoAssociation','clone','keys','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','update','findOne','CmHopper','pick','options','rows','CmHopperHistory','VoiceQueueId','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','interface'];(function(_0x11957d,_0x8b495d){var _0x142633=function(_0x4b8a05){while(--_0x4b8a05){_0x11957d['push'](_0x11957d['shift']());}};_0x142633(++_0x8b495d);}(_0x1776,0xff));var _0x6177=function(_0x10e04d,_0x4b88fe){_0x10e04d=_0x10e04d-0x0;var _0x20ff79=_0x1776[_0x10e04d];return _0x20ff79;};'use strict';var pdf=require(_0x6177('0x0'));var emlformat=require(_0x6177('0x1'));var rimraf=require(_0x6177('0x2'));var zipdir=require(_0x6177('0x3'));var jsonpatch=require(_0x6177('0x4'));var rp=require(_0x6177('0x5'));var moment=require(_0x6177('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x6177('0x7'));var util=require(_0x6177('0x8'));var path=require('path');var sox=require(_0x6177('0x9'));var csv=require(_0x6177('0xa'));var ejs=require(_0x6177('0xb'));var fs=require('fs');var _=require(_0x6177('0xc'));var squel=require(_0x6177('0xd'));var crypto=require(_0x6177('0xe'));var jsforce=require(_0x6177('0xf'));var deskjs=require(_0x6177('0x10'));var toCsv=require(_0x6177('0xa'));var querystring=require(_0x6177('0x11'));var Papa=require(_0x6177('0x12'));var Redis=require(_0x6177('0x13'));var authService=require(_0x6177('0x14'));var qs=require(_0x6177('0x15'));var as=require(_0x6177('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6177('0x17'))(_0x6177('0x18'));var utils=require(_0x6177('0x19'));var config=require('../../config/environment');var db=require(_0x6177('0x1a'))['db'];config[_0x6177('0x1b')]=_[_0x6177('0x1c')](config[_0x6177('0x1b')],{'host':_0x6177('0x1d'),'port':0x18eb});var socket=require(_0x6177('0x1e'))(new Redis(config['redis']));require('./voiceQueue.socket')[_0x6177('0x1f')](socket);function respondWithStatusCode(_0x4b491c,_0x86896){_0x86896=_0x86896||0xcc;return function(_0xeb9707){if(_0xeb9707){return _0x4b491c[_0x6177('0x20')](_0x86896);}return _0x4b491c['status'](_0x86896)['end']();};}function respondWithResult(_0x4ca448,_0x30cbe8){_0x30cbe8=_0x30cbe8||0xc8;return function(_0x32a3ca){if(_0x32a3ca){return _0x4ca448[_0x6177('0x21')](_0x30cbe8)[_0x6177('0x22')](_0x32a3ca);}};}function respondWithFilteredResult(_0x5ca5db,_0x464c27){return function(_0x24a4d6){if(_0x24a4d6){var _0x45d799=_0x24a4d6[_0x6177('0x23')],_0x5a976f=_0x464c27['offset'],_0x3f415c=_0x464c27['offset']+_0x464c27[_0x6177('0x24')],_0x41f86d;if(_0x3f415c>=_0x45d799){_0x3f415c=_0x45d799;_0x41f86d=0xc8;}else{_0x41f86d=0xce;}_0x5ca5db[_0x6177('0x21')](_0x41f86d);return _0x5ca5db['set'](_0x6177('0x25'),_0x5a976f+'-'+_0x3f415c+'/'+_0x45d799)[_0x6177('0x22')](_0x24a4d6);}return null;};}function patchUpdates(_0x33031b){return function(_0x23e7d2){try{jsonpatch['apply'](_0x23e7d2,_0x33031b,!![]);}catch(_0x5b0a2e){return BPromise['reject'](_0x5b0a2e);}return _0x23e7d2[_0x6177('0x26')]();};}function saveUpdates(_0x53e12a,_0x1b6db6){return function(_0xb9c1bb){if(_0xb9c1bb){return _0xb9c1bb['update'](_0x53e12a)[_0x6177('0x27')](function(_0x32cda1){return _0x32cda1;});}return null;};}function removeEntity(_0x3ab74f,_0x12fb09){return function(_0x29b327){if(_0x29b327){return _0x29b327[_0x6177('0x28')]()[_0x6177('0x27')](function(){var _0xcfa30d=_0x29b327['get']({'plain':!![]});var _0x1a6e73=[{'name':_0x6177('0x29'),'value':_0x6177('0x2a'),'ignore':![]},{'name':_0x6177('0x2b'),'value':_0x6177('0x2c'),'ignore':![]}];var _0x345444=_(_0x1a6e73)[_0x6177('0x2d')](_0x6177('0x2e'))[_0x6177('0x2f')]('value')[_0x6177('0x30')]();if(_['includes'](_0x345444,_0xcfa30d['type'])){return;}var _0x544e58=_[_0x6177('0x31')](_0x1a6e73,[_0x6177('0x30'),_0xcfa30d[_0x6177('0x32')]])[_0x6177('0x33')];return db[_0x6177('0x34')][_0x6177('0x28')]({'where':{'type':_0x544e58,'resourceId':_0xcfa30d['id']}})[_0x6177('0x27')](function(){return _0x29b327;});})[_0x6177('0x27')](function(){_0x3ab74f['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4f2f11,_0x1e4ebd){return function(_0x2b482f){if(!_0x2b482f){_0x4f2f11[_0x6177('0x20')](0x194);}return _0x2b482f;};}function handleError(_0x545975,_0x125b36){_0x125b36=_0x125b36||0x1f4;return function(_0x5dc420){logger[_0x6177('0x35')](_0x5dc420[_0x6177('0x36')]);if(_0x5dc420[_0x6177('0x33')]){delete _0x5dc420[_0x6177('0x33')];}_0x545975[_0x6177('0x21')](_0x125b36)[_0x6177('0x37')](_0x5dc420);};}exports[_0x6177('0x38')]=function(_0x1961f4,_0xd2f016){var _0x3e1f43={},_0x2d25c4={},_0x4a9743={'count':0x0,'rows':[]};var _0x2b2538=_[_0x6177('0x2f')](db[_0x6177('0x39')][_0x6177('0x3a')],function(_0xbea7d9){return{'name':_0xbea7d9[_0x6177('0x3b')],'type':_0xbea7d9['type'][_0x6177('0x3c')]};});_0x2d25c4[_0x6177('0x3d')]=_['map'](_0x2b2538,_0x6177('0x33'));_0x2d25c4[_0x6177('0x3e')]=_['keys'](_0x1961f4['query']);_0x2d25c4[_0x6177('0x3f')]=_['intersection'](_0x2d25c4[_0x6177('0x3d')],_0x2d25c4[_0x6177('0x3e')]);_0x3e1f43['attributes']=_[_0x6177('0x40')](_0x2d25c4[_0x6177('0x3d')],qs[_0x6177('0x41')](_0x1961f4[_0x6177('0x3e')][_0x6177('0x41')]));_0x3e1f43[_0x6177('0x42')]=_0x3e1f43['attributes'][_0x6177('0x43')]?_0x3e1f43['attributes']:_0x2d25c4[_0x6177('0x3d')];if(!_0x1961f4[_0x6177('0x3e')][_0x6177('0x44')](_0x6177('0x45'))){_0x3e1f43[_0x6177('0x24')]=qs[_0x6177('0x24')](_0x1961f4['query'][_0x6177('0x24')]);_0x3e1f43[_0x6177('0x46')]=qs['offset'](_0x1961f4[_0x6177('0x3e')][_0x6177('0x46')]);}_0x3e1f43[_0x6177('0x47')]=qs[_0x6177('0x48')](_0x1961f4[_0x6177('0x3e')][_0x6177('0x48')]);_0x3e1f43[_0x6177('0x49')]=qs[_0x6177('0x3f')](_['pick'](_0x1961f4[_0x6177('0x3e')],_0x2d25c4[_0x6177('0x3f')]));if(_0x1961f4[_0x6177('0x3e')][_0x6177('0x2d')]){_0x3e1f43['where']=_[_0x6177('0x4a')](_0x3e1f43['where'],{'$or':_[_0x6177('0x2f')](_0x2b2538,function(_0x550b96){if(_0x550b96[_0x6177('0x32')]!==_0x6177('0x4b')){var _0x15f0ca={};_0x15f0ca[_0x550b96[_0x6177('0x33')]]={'$like':'%'+_0x1961f4[_0x6177('0x3e')][_0x6177('0x2d')]+'%'};return _0x15f0ca;}})});}_0x3e1f43=_[_0x6177('0x4a')]({},_0x3e1f43,_0x1961f4['options']);var _0x4bf9e4={'where':_0x3e1f43[_0x6177('0x49')]};return db[_0x6177('0x39')][_0x6177('0x23')](_0x4bf9e4)[_0x6177('0x27')](function(_0x201386){_0x4a9743[_0x6177('0x23')]=_0x201386;if(_0x1961f4['query'][_0x6177('0x4c')]){_0x3e1f43[_0x6177('0x4d')]=[{'all':!![]}];}return db[_0x6177('0x39')][_0x6177('0x4e')](_0x3e1f43);})[_0x6177('0x27')](function(_0x27df99){_0x4a9743['rows']=_0x27df99;return _0x4a9743;})[_0x6177('0x27')](respondWithFilteredResult(_0xd2f016,_0x3e1f43))[_0x6177('0x4f')](handleError(_0xd2f016,null));};exports[_0x6177('0x50')]=function(_0x163b02,_0x2f610c){var _0x4c0155={'raw':![],'where':{'id':_0x163b02[_0x6177('0x51')]['id']}},_0x77bb72={};_0x77bb72[_0x6177('0x3d')]=_['keys'](db[_0x6177('0x39')][_0x6177('0x3a')]);_0x77bb72[_0x6177('0x3e')]=_['keys'](_0x163b02['query']);_0x77bb72[_0x6177('0x3f')]=_[_0x6177('0x40')](_0x77bb72[_0x6177('0x3d')],_0x77bb72[_0x6177('0x3e')]);_0x4c0155['attributes']=_['intersection'](_0x77bb72[_0x6177('0x3d')],qs[_0x6177('0x41')](_0x163b02[_0x6177('0x3e')][_0x6177('0x41')]));_0x4c0155[_0x6177('0x42')]=_0x4c0155[_0x6177('0x42')][_0x6177('0x43')]?_0x4c0155[_0x6177('0x42')]:_0x77bb72[_0x6177('0x3d')];if(_0x163b02[_0x6177('0x3e')][_0x6177('0x4c')]){_0x4c0155[_0x6177('0x4d')]=[{'all':!![]}];}_0x4c0155=_[_0x6177('0x4a')]({},_0x4c0155,_0x163b02['options']);return db[_0x6177('0x39')]['find'](_0x4c0155)[_0x6177('0x27')](handleEntityNotFound(_0x2f610c,null))[_0x6177('0x27')](respondWithResult(_0x2f610c,null))[_0x6177('0x4f')](handleError(_0x2f610c,null));};exports['create']=function(_0x286ac2,_0x1256fc){return db['VoiceQueue'][_0x6177('0x52')](_0x286ac2[_0x6177('0x53')],{})[_0x6177('0x27')](function(_0x1d4a8a){var _0x4e0519=_0x286ac2['user'][_0x6177('0x54')]({'plain':!![]});if(!_0x4e0519)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4e0519[_0x6177('0x55')]===_0x6177('0x56')){var _0x3aa379=_0x1d4a8a[_0x6177('0x54')]({'plain':!![]});var _0x55b7e7=[{'name':_0x6177('0x29'),'value':_0x6177('0x2a')},{'name':'QueueCampaigns','value':_0x6177('0x2c')}];var _0xcec78d=_[_0x6177('0x31')](_0x55b7e7,[_0x6177('0x30'),_0x3aa379[_0x6177('0x32')]])[_0x6177('0x33')];return db[_0x6177('0x57')]['find']({'where':{'name':_0xcec78d,'userProfileId':_0x4e0519[_0x6177('0x58')]},'raw':!![]})[_0x6177('0x27')](function(_0x50d1dd){if(_0x50d1dd&&_0x50d1dd[_0x6177('0x59')]===0x0){return db[_0x6177('0x34')][_0x6177('0x52')]({'name':_0x3aa379[_0x6177('0x33')],'resourceId':_0x3aa379['id'],'type':_0x50d1dd[_0x6177('0x33')],'sectionId':_0x50d1dd['id']},{})[_0x6177('0x27')](function(){return _0x1d4a8a;});}else{return _0x1d4a8a;}})[_0x6177('0x4f')](function(_0x20d760){logger[_0x6177('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x20d760);throw _0x20d760;});}return _0x1d4a8a;})[_0x6177('0x27')](respondWithResult(_0x1256fc,0xc9))[_0x6177('0x4f')](handleError(_0x1256fc,null));};exports[_0x6177('0x5a')]=function(_0xf442e0,_0xb3962c){var _0x2e0c03={'where':{'id':_0xf442e0['params']['id']}},_0x181d09={};_0x181d09[_0x6177('0x3d')]=_[_0x6177('0x5b')](db['VoiceQueue'][_0x6177('0x3a')]);_0x2e0c03[_0x6177('0x42')]=_[_0x6177('0x40')](_0x181d09['model'],qs[_0x6177('0x41')](_0xf442e0[_0x6177('0x3e')][_0x6177('0x41')]));_0x2e0c03[_0x6177('0x42')]=_0x2e0c03['attributes'][_0x6177('0x43')]?_0x2e0c03['attributes']:_0x181d09[_0x6177('0x3d')];if(_0xf442e0[_0x6177('0x3e')][_0x6177('0x4c')]){_0x2e0c03[_0x6177('0x4d')]=[{'all':!![]}];}_0x2e0c03=_[_0x6177('0x4a')]({},_0x2e0c03,_0xf442e0['options']);return db[_0x6177('0x39')][_0x6177('0x31')](_0x2e0c03)[_0x6177('0x27')](handleEntityNotFound(_0xb3962c,null))[_0x6177('0x27')](function(_0x593c0d){if(_0x593c0d){var _0x49869e=_0x593c0d['get']({'plain':!![]});_0x49869e=qs[_0x6177('0x5c')](_0x49869e,['id','createdAt',_0x6177('0x5d')]);_0xf442e0['body']=_['omit'](_0xf442e0['body'],['id',_0x6177('0x5e'),_0x6177('0x5d')]);return db['VoiceQueue'][_0x6177('0x52')](_['merge'](_0x49869e,_0xf442e0[_0x6177('0x53')]),{'include':_0xf442e0[_0x6177('0x3e')][_0x6177('0x4c')]?[{'all':!![]}]:undefined})['then'](function(_0x26580f){var _0x212f23=_0xf442e0['user'][_0x6177('0x54')]({'plain':!![]});if(!_0x212f23)throw new Error(_0x6177('0x5f'));if(_0x212f23['role']===_0x6177('0x56')){var _0x40c88a=_0x26580f[_0x6177('0x54')]({'plain':!![]});var _0x30e3bf=[{'name':_0x6177('0x29'),'value':_0x6177('0x2a')},{'name':_0x6177('0x2b'),'value':'outbound'}];var _0x5ecc59=_[_0x6177('0x31')](_0x30e3bf,[_0x6177('0x30'),_0x40c88a[_0x6177('0x32')]])[_0x6177('0x33')];return db[_0x6177('0x57')][_0x6177('0x31')]({'where':{'name':_0x5ecc59,'userProfileId':_0x212f23[_0x6177('0x58')]},'raw':!![]})[_0x6177('0x27')](function(_0x1494a3){if(_0x1494a3&&_0x1494a3['autoAssociation']===0x0){return db[_0x6177('0x34')]['create']({'name':_0x40c88a[_0x6177('0x33')],'resourceId':_0x40c88a['id'],'type':_0x1494a3[_0x6177('0x33')],'sectionId':_0x1494a3['id']},{})[_0x6177('0x27')](function(){return _0x26580f;});}else{return _0x26580f;}})[_0x6177('0x4f')](function(_0x210433){logger[_0x6177('0x35')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x210433);throw _0x210433;});}return _0x26580f;});}})['then'](respondWithResult(_0xb3962c,0xc9))[_0x6177('0x4f')](handleError(_0xb3962c,null));};exports[_0x6177('0x60')]=function(_0x3b36ee,_0x3e3e1f){if(_0x3b36ee['body']['id']){delete _0x3b36ee['body']['id'];}return db[_0x6177('0x39')]['find']({'where':{'id':_0x3b36ee['params']['id']}})['then'](handleEntityNotFound(_0x3e3e1f,null))['then'](saveUpdates(_0x3b36ee['body'],null))[_0x6177('0x27')](respondWithResult(_0x3e3e1f,null))[_0x6177('0x4f')](handleError(_0x3e3e1f,null));};exports['destroy']=function(_0x164312,_0x560b2c){return db[_0x6177('0x39')][_0x6177('0x31')]({'where':{'id':_0x164312[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x560b2c,null))['then'](removeEntity(_0x560b2c,null))[_0x6177('0x4f')](handleError(_0x560b2c,null));};exports['getHoppers']=function(_0x269b8c,_0x33440b,_0x4083a2){var _0x319a08={'raw':![],'where':{}};var _0x3805a6={};var _0x21a2bd={'count':0x0,'rows':[]};return db[_0x6177('0x39')][_0x6177('0x61')]({'where':{'id':_0x269b8c[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x33440b,null))[_0x6177('0x27')](function(_0x5c9ae5){if(_0x5c9ae5){_0x3805a6['model']=_[_0x6177('0x5b')](db[_0x6177('0x62')][_0x6177('0x3a')]);_0x3805a6[_0x6177('0x3e')]=_[_0x6177('0x5b')](_0x269b8c[_0x6177('0x3e')]);_0x3805a6[_0x6177('0x3f')]=_[_0x6177('0x40')](_0x3805a6[_0x6177('0x3d')],_0x3805a6[_0x6177('0x3e')]);_0x319a08[_0x6177('0x42')]=_['intersection'](_0x3805a6[_0x6177('0x3d')],qs['fields'](_0x269b8c['query'][_0x6177('0x41')]));_0x319a08[_0x6177('0x42')]=_0x319a08[_0x6177('0x42')][_0x6177('0x43')]?_0x319a08[_0x6177('0x42')]:_0x3805a6[_0x6177('0x3d')];if(!_0x269b8c[_0x6177('0x3e')][_0x6177('0x44')](_0x6177('0x45'))){_0x319a08['limit']=qs[_0x6177('0x24')](_0x269b8c[_0x6177('0x3e')][_0x6177('0x24')]);_0x319a08[_0x6177('0x46')]=qs[_0x6177('0x46')](_0x269b8c[_0x6177('0x3e')][_0x6177('0x46')]);}_0x319a08[_0x6177('0x47')]=qs['sort'](_0x269b8c[_0x6177('0x3e')]['sort']);_0x319a08['where']=qs[_0x6177('0x3f')](_[_0x6177('0x63')](_0x269b8c['query'],_0x3805a6['filters']));_0x319a08[_0x6177('0x49')]['VoiceQueueId']=_0x5c9ae5['id'];if(_0x269b8c[_0x6177('0x3e')][_0x6177('0x2d')]){_0x319a08[_0x6177('0x49')]=_['merge'](_0x319a08[_0x6177('0x49')],{'$or':_[_0x6177('0x2f')](_0x319a08[_0x6177('0x42')],function(_0x4cc3ee){var _0x169f07={};_0x169f07[_0x4cc3ee]={'$like':'%'+_0x269b8c[_0x6177('0x3e')][_0x6177('0x2d')]+'%'};return _0x169f07;})});}_0x319a08=_['merge']({},_0x319a08,_0x269b8c[_0x6177('0x64')]);return db['CmHopper'][_0x6177('0x23')]({'where':_0x319a08[_0x6177('0x49')]})[_0x6177('0x27')](function(_0x46a508){_0x21a2bd['count']=_0x46a508;if(_0x269b8c[_0x6177('0x3e')][_0x6177('0x4c')]){_0x319a08[_0x6177('0x4d')]=[{'all':!![]}];}return db[_0x6177('0x62')][_0x6177('0x4e')](_0x319a08);})[_0x6177('0x27')](function(_0xbcf639){_0x21a2bd[_0x6177('0x65')]=_0xbcf639;return _0x21a2bd;});}})[_0x6177('0x27')](respondWithFilteredResult(_0x33440b,_0x319a08))[_0x6177('0x4f')](handleError(_0x33440b,null));};exports['getHopperHistories']=function(_0x399843,_0x1ee3ba,_0xabad35){var _0x1ce884={'raw':!![],'where':{}};var _0x514864={};var _0x33fdab={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x6177('0x61')]({'where':{'id':_0x399843[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x1ee3ba,null))[_0x6177('0x27')](function(_0x281d9b){if(_0x281d9b){_0x514864[_0x6177('0x3d')]=_[_0x6177('0x5b')](db[_0x6177('0x66')][_0x6177('0x3a')]);_0x514864[_0x6177('0x3e')]=_['keys'](_0x399843[_0x6177('0x3e')]);_0x514864[_0x6177('0x3f')]=_[_0x6177('0x40')](_0x514864[_0x6177('0x3d')],_0x514864['query']);_0x1ce884[_0x6177('0x42')]=_[_0x6177('0x40')](_0x514864[_0x6177('0x3d')],qs[_0x6177('0x41')](_0x399843[_0x6177('0x3e')][_0x6177('0x41')]));_0x1ce884[_0x6177('0x42')]=_0x1ce884['attributes'][_0x6177('0x43')]?_0x1ce884[_0x6177('0x42')]:_0x514864['model'];if(!_0x399843[_0x6177('0x3e')][_0x6177('0x44')]('nolimit')){_0x1ce884['limit']=qs[_0x6177('0x24')](_0x399843[_0x6177('0x3e')][_0x6177('0x24')]);_0x1ce884[_0x6177('0x46')]=qs[_0x6177('0x46')](_0x399843[_0x6177('0x3e')][_0x6177('0x46')]);}_0x1ce884[_0x6177('0x47')]=qs[_0x6177('0x48')](_0x399843['query'][_0x6177('0x48')]);_0x1ce884[_0x6177('0x49')]=qs[_0x6177('0x3f')](_[_0x6177('0x63')](_0x399843['query'],_0x514864[_0x6177('0x3f')]));_0x1ce884[_0x6177('0x49')]['VoiceQueueId']=_0x281d9b['id'];if(_0x399843['query'][_0x6177('0x2d')]){_0x1ce884['where']=_[_0x6177('0x4a')](_0x1ce884[_0x6177('0x49')],{'$or':_['map'](_0x1ce884['attributes'],function(_0xaab140){var _0x33c3cf={};_0x33c3cf[_0xaab140]={'$like':'%'+_0x399843[_0x6177('0x3e')][_0x6177('0x2d')]+'%'};return _0x33c3cf;})});}_0x1ce884=_['merge']({},_0x1ce884,_0x399843['options']);return db[_0x6177('0x66')][_0x6177('0x23')]({'where':_0x1ce884[_0x6177('0x49')]})[_0x6177('0x27')](function(_0x1c443d){_0x33fdab[_0x6177('0x23')]=_0x1c443d;if(_0x399843[_0x6177('0x3e')][_0x6177('0x4c')]){_0x1ce884[_0x6177('0x4d')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x1ce884);})[_0x6177('0x27')](function(_0x804822){_0x33fdab['rows']=_0x804822;return _0x33fdab;});}})['then'](respondWithFilteredResult(_0x1ee3ba,_0x1ce884))['catch'](handleError(_0x1ee3ba,null));};exports['getHopperFinals']=function(_0xc1a33e,_0x34b00c,_0x483e94){var _0xca6a26={'raw':!![],'where':{}};var _0x328d00={};var _0x257045={'count':0x0,'rows':[]};return db['VoiceQueue'][_0x6177('0x61')]({'where':{'id':_0xc1a33e['params']['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x34b00c,null))[_0x6177('0x27')](function(_0x4da68e){if(_0x4da68e){_0x328d00[_0x6177('0x3d')]=_[_0x6177('0x5b')](db['CmHopperFinal'][_0x6177('0x3a')]);_0x328d00['query']=_[_0x6177('0x5b')](_0xc1a33e[_0x6177('0x3e')]);_0x328d00[_0x6177('0x3f')]=_[_0x6177('0x40')](_0x328d00['model'],_0x328d00[_0x6177('0x3e')]);_0xca6a26[_0x6177('0x42')]=_[_0x6177('0x40')](_0x328d00[_0x6177('0x3d')],qs[_0x6177('0x41')](_0xc1a33e[_0x6177('0x3e')]['fields']));_0xca6a26[_0x6177('0x42')]=_0xca6a26[_0x6177('0x42')][_0x6177('0x43')]?_0xca6a26[_0x6177('0x42')]:_0x328d00[_0x6177('0x3d')];if(!_0xc1a33e[_0x6177('0x3e')]['hasOwnProperty']('nolimit')){_0xca6a26[_0x6177('0x24')]=qs[_0x6177('0x24')](_0xc1a33e['query'][_0x6177('0x24')]);_0xca6a26[_0x6177('0x46')]=qs[_0x6177('0x46')](_0xc1a33e[_0x6177('0x3e')][_0x6177('0x46')]);}_0xca6a26[_0x6177('0x47')]=qs[_0x6177('0x48')](_0xc1a33e[_0x6177('0x3e')]['sort']);_0xca6a26[_0x6177('0x49')]=qs[_0x6177('0x3f')](_[_0x6177('0x63')](_0xc1a33e['query'],_0x328d00['filters']));_0xca6a26[_0x6177('0x49')][_0x6177('0x67')]=_0x4da68e['id'];if(_0xc1a33e[_0x6177('0x3e')]['filter']){_0xca6a26[_0x6177('0x49')]=_['merge'](_0xca6a26[_0x6177('0x49')],{'$or':_[_0x6177('0x2f')](_0xca6a26['attributes'],function(_0xb5d341){var _0x27e681={};_0x27e681[_0xb5d341]={'$like':'%'+_0xc1a33e[_0x6177('0x3e')][_0x6177('0x2d')]+'%'};return _0x27e681;})});}_0xca6a26=_[_0x6177('0x4a')]({},_0xca6a26,_0xc1a33e['options']);return db[_0x6177('0x68')][_0x6177('0x23')]({'where':_0xca6a26[_0x6177('0x49')]})['then'](function(_0x412b51){_0x257045['count']=_0x412b51;if(_0xc1a33e[_0x6177('0x3e')][_0x6177('0x4c')]){_0xca6a26[_0x6177('0x4d')]=[{'all':!![]}];}return db[_0x6177('0x68')][_0x6177('0x4e')](_0xca6a26);})['then'](function(_0x1fc1d5){_0x257045['rows']=_0x1fc1d5;return _0x257045;});}})[_0x6177('0x27')](respondWithFilteredResult(_0x34b00c,_0xca6a26))[_0x6177('0x4f')](handleError(_0x34b00c,null));};exports['getHopperBlacks']=function(_0x2d9b8b,_0x55d7a8,_0x4ae3c0){var _0x3a0a8e={'raw':!![],'where':{}};var _0x442df1={};var _0x11ceb0={'count':0x0,'rows':[]};return db[_0x6177('0x39')][_0x6177('0x61')]({'where':{'id':_0x2d9b8b[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x55d7a8,null))[_0x6177('0x27')](function(_0x8956eb){if(_0x8956eb){_0x442df1[_0x6177('0x3d')]=_[_0x6177('0x5b')](db['CmHopperBlack'][_0x6177('0x3a')]);_0x442df1[_0x6177('0x3e')]=_[_0x6177('0x5b')](_0x2d9b8b[_0x6177('0x3e')]);_0x442df1[_0x6177('0x3f')]=_[_0x6177('0x40')](_0x442df1['model'],_0x442df1[_0x6177('0x3e')]);_0x3a0a8e['attributes']=_[_0x6177('0x40')](_0x442df1[_0x6177('0x3d')],qs['fields'](_0x2d9b8b['query'][_0x6177('0x41')]));_0x3a0a8e[_0x6177('0x42')]=_0x3a0a8e[_0x6177('0x42')][_0x6177('0x43')]?_0x3a0a8e['attributes']:_0x442df1[_0x6177('0x3d')];if(!_0x2d9b8b[_0x6177('0x3e')][_0x6177('0x44')]('nolimit')){_0x3a0a8e[_0x6177('0x24')]=qs[_0x6177('0x24')](_0x2d9b8b[_0x6177('0x3e')][_0x6177('0x24')]);_0x3a0a8e['offset']=qs[_0x6177('0x46')](_0x2d9b8b[_0x6177('0x3e')]['offset']);}_0x3a0a8e[_0x6177('0x47')]=qs[_0x6177('0x48')](_0x2d9b8b[_0x6177('0x3e')][_0x6177('0x48')]);_0x3a0a8e[_0x6177('0x49')]=qs['filters'](_['pick'](_0x2d9b8b[_0x6177('0x3e')],_0x442df1[_0x6177('0x3f')]));_0x3a0a8e[_0x6177('0x49')]['VoiceQueueId']=_0x8956eb['id'];if(_0x2d9b8b[_0x6177('0x3e')][_0x6177('0x2d')]){_0x3a0a8e[_0x6177('0x49')]=_['merge'](_0x3a0a8e['where'],{'$or':_[_0x6177('0x2f')](_0x3a0a8e[_0x6177('0x42')],function(_0x43f719){var _0x3d99e1={};_0x3d99e1[_0x43f719]={'$like':'%'+_0x2d9b8b[_0x6177('0x3e')]['filter']+'%'};return _0x3d99e1;})});}_0x3a0a8e=_[_0x6177('0x4a')]({},_0x3a0a8e,_0x2d9b8b[_0x6177('0x64')]);return db['CmHopperBlack']['count']({'where':_0x3a0a8e[_0x6177('0x49')]})[_0x6177('0x27')](function(_0x553f15){_0x11ceb0[_0x6177('0x23')]=_0x553f15;if(_0x2d9b8b['query'][_0x6177('0x4c')]){_0x3a0a8e[_0x6177('0x4d')]=[{'all':!![]}];}return db[_0x6177('0x69')][_0x6177('0x4e')](_0x3a0a8e);})[_0x6177('0x27')](function(_0x5ec91e){_0x11ceb0[_0x6177('0x65')]=_0x5ec91e;return _0x11ceb0;});}})[_0x6177('0x27')](respondWithFilteredResult(_0x55d7a8,_0x3a0a8e))[_0x6177('0x4f')](handleError(_0x55d7a8,null));};exports[_0x6177('0x6a')]=function(_0x39d6c1,_0x37c71b,_0x59e4b0){var _0x5aa0dc={};var _0x48ed83={};var _0x27392e;var _0x21f61c;return db[_0x6177('0x39')][_0x6177('0x61')]({'where':{'id':_0x39d6c1[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x37c71b,null))[_0x6177('0x27')](function(_0x28d8b6){if(_0x28d8b6){_0x27392e=_0x28d8b6;_0x48ed83[_0x6177('0x3d')]=_[_0x6177('0x5b')](db[_0x6177('0x6b')][_0x6177('0x3a')]);_0x48ed83[_0x6177('0x3e')]=_['keys'](_0x39d6c1['query']);_0x48ed83[_0x6177('0x3f')]=_[_0x6177('0x40')](_0x48ed83['model'],_0x48ed83[_0x6177('0x3e')]);_0x5aa0dc[_0x6177('0x42')]=_[_0x6177('0x40')](_0x48ed83['model'],qs[_0x6177('0x41')](_0x39d6c1[_0x6177('0x3e')][_0x6177('0x41')]));_0x5aa0dc['attributes']=_0x5aa0dc[_0x6177('0x42')][_0x6177('0x43')]?_0x5aa0dc[_0x6177('0x42')]:_0x48ed83[_0x6177('0x3d')];_0x5aa0dc['order']=qs[_0x6177('0x48')](_0x39d6c1[_0x6177('0x3e')][_0x6177('0x48')]);_0x5aa0dc[_0x6177('0x49')]=qs[_0x6177('0x3f')](_['pick'](_0x39d6c1[_0x6177('0x3e')],_0x48ed83[_0x6177('0x3f')]));if(_0x39d6c1[_0x6177('0x3e')][_0x6177('0x2d')]){_0x5aa0dc[_0x6177('0x49')]=_[_0x6177('0x4a')](_0x5aa0dc['where'],{'$or':_['map'](_0x5aa0dc[_0x6177('0x42')],function(_0x3748a6){var _0x321962={};_0x321962[_0x3748a6]={'$like':'%'+_0x39d6c1[_0x6177('0x3e')][_0x6177('0x2d')]+'%'};return _0x321962;})});}_0x5aa0dc=_['merge']({},_0x5aa0dc,_0x39d6c1[_0x6177('0x64')]);return _0x27392e[_0x6177('0x6a')](_0x5aa0dc);}})[_0x6177('0x27')](function(_0x1b09a6){if(_0x1b09a6){_0x21f61c=_0x1b09a6['length'];if(!_0x39d6c1[_0x6177('0x3e')]['hasOwnProperty']('nolimit')){_0x5aa0dc[_0x6177('0x24')]=qs['limit'](_0x39d6c1[_0x6177('0x3e')][_0x6177('0x24')]);_0x5aa0dc[_0x6177('0x46')]=qs[_0x6177('0x46')](_0x39d6c1[_0x6177('0x3e')]['offset']);}return _0x27392e[_0x6177('0x6a')](_0x5aa0dc);}})[_0x6177('0x27')](function(_0x38bf27){if(_0x38bf27){return _0x38bf27?{'count':_0x21f61c,'rows':_0x38bf27}:null;}})[_0x6177('0x27')](respondWithResult(_0x37c71b,null))[_0x6177('0x4f')](handleError(_0x37c71b,null));};exports[_0x6177('0x6c')]=function(_0x182738,_0x23a28c,_0x34eb5){var _0x2f0aaf=_0x182738[_0x6177('0x53')][_0x6177('0x6d')];var _0x9cf0fd=_[_0x6177('0x2f')](_0x2f0aaf,'id');return db[_0x6177('0x6b')][_0x6177('0x4e')]({'where':{'id':_0x9cf0fd},'attributes':['id'],'include':[{'model':db['User'],'as':_0x6177('0x6e'),'attributes':['id',_0x6177('0x33'),_0x6177('0x6f'),'voicePause',_0x6177('0x70')],'raw':!![]}]})[_0x6177('0x27')](function(_0x4cbdd7){if(_0x4cbdd7){var _0x58616f=_[_0x6177('0x71')](_0x4cbdd7,function(_0x2148c5){var _0x5182aa=_0x2148c5[_0x6177('0x54')]({'plain':!![]});_0x5182aa[_0x6177('0x6e')][_0x6177('0x72')](function(_0x52c67b){_0x52c67b[_0x6177('0x73')]=_[_0x6177('0x31')](_0x2f0aaf,{'id':_0x5182aa['id']})[_0x6177('0x73')];});return _0x5182aa[_0x6177('0x6e')];});return db[_0x6177('0x39')]['find']({'where':{'id':_0x182738[_0x6177('0x51')]['id']}})['then'](function(_0x5ab019){return db[_0x6177('0x74')][_0x6177('0x75')](function(_0x2dd043){return _0x5ab019['addTeams'](_0x9cf0fd,{'transaction':_0x2dd043})['then'](function(){return BPromise[_0x6177('0x76')](_0x58616f,function(_0x27360d){return db[_0x6177('0x77')]['findOrCreate']({'where':{'UserId':_0x27360d['id'],'VoiceQueueId':_0x182738['params']['id']},'defaults':{'penalty':_0x27360d[_0x6177('0x73')]},'transaction':_0x2dd043});});})[_0x6177('0x27')](function(){return BPromise['each'](_['filter'](_0x58616f,{'online':!![]}),function(_0x23db45){return db[_0x6177('0x78')][_0x6177('0x79')]({'membername':_0x23db45[_0x6177('0x33')],'UserId':_0x23db45['id'],'queue_name':_0x5ab019[_0x6177('0x33')],'VoiceQueueId':_0x5ab019['id'],'interface':_[_0x6177('0x7a')](_0x23db45[_0x6177('0x70')])?util[_0x6177('0x7b')](_0x6177('0x7c'),_0x23db45[_0x6177('0x33')]):_0x23db45[_0x6177('0x70')],'paused':_0x23db45[_0x6177('0x7d')]||![],'penalty':_0x23db45[_0x6177('0x73')]},{'transaction':_0x2dd043});});})[_0x6177('0x27')](function(){_0x58616f[_0x6177('0x72')](function(_0x2f6e02){socket[_0x6177('0x7e')](_0x6177('0x7f'),{'UserId':_0x2f6e02['id'],'VoiceQueueId':_0x5ab019['id']});});});});});}})[_0x6177('0x27')](respondWithStatusCode(_0x23a28c,null))[_0x6177('0x4f')](handleError(_0x23a28c,null));};exports['removeTeams']=function(_0x3439d6,_0x354e63,_0x2dca6d){return db['Team'][_0x6177('0x4e')]({'where':{'id':_0x3439d6[_0x6177('0x3e')][_0x6177('0x80')]},'attributes':['id'],'include':[{'model':db[_0x6177('0x81')],'as':_0x6177('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x6177('0x27')](handleEntityNotFound(_0x354e63,null))[_0x6177('0x27')](function(_0x39e9f3){var _0x3472cc=_[_0x6177('0x2f')](_0x39e9f3,'id');var _0x49858e=[];var _0x27217f=[];var _0x25625e=squel['select']();_0x25625e[_0x6177('0x82')](_0x6177('0x83'))[_0x6177('0x84')](_0x6177('0x85'),'tq')['join'](_0x6177('0x86'),'ut',_0x6177('0x87'))['where'](_0x6177('0x88'),_0x3439d6['params']['id']);for(var _0x4c507d=0x0;_0x4c507d<_0x39e9f3[_0x6177('0x43')];_0x4c507d+=0x1){let _0x10d89e=_0x39e9f3[_0x4c507d];for(var _0x3cfac2=0x0;_0x3cfac2<_0x10d89e[_0x6177('0x6e')][_0x6177('0x43')];_0x3cfac2+=0x1){let _0x2a24d4=_0x10d89e[_0x6177('0x6e')][_0x3cfac2];var _0x134c91=_0x25625e['clone']();_0x134c91[_0x6177('0x49')](_0x6177('0x89'),_0x2a24d4['id']);_0x27217f['push'](db[_0x6177('0x74')]['query'](_0x134c91['toString'](),{'type':db[_0x6177('0x74')][_0x6177('0x8a')]['SELECT']})['then'](function(_0x186908){if(_0x186908['length']===0x1){return _0x2a24d4['id'];}else{var _0x5c9e1e=_['every'](_[_0x6177('0x2f')](_0x186908,_0x6177('0x8b')),function(_0x2b6871){return _[_0x6177('0x8c')](_0x3472cc,_0x2b6871);});if(_0x5c9e1e){return _0x2a24d4['id'];}}}));}}return BPromise[_0x6177('0x8d')](_0x27217f)[_0x6177('0x27')](function(_0x204c43){_0x49858e=_(_0x49858e)[_0x6177('0x8e')](_0x204c43)[_0x6177('0x8f')]()[_0x6177('0x30')]();return db[_0x6177('0x39')][_0x6177('0x31')]({'where':{'id':_0x3439d6['params']['id']}})[_0x6177('0x27')](function(_0x3307ae){return db[_0x6177('0x74')][_0x6177('0x75')](function(_0x5bbda6){return _0x3307ae['removeTeams'](_0x3439d6['query']['ids'],{'transaction':_0x5bbda6})['then'](function(){if(!_['isEmpty'](_0x49858e)){return _0x3307ae['removeAgents'](_0x49858e,{'transaction':_0x5bbda6})[_0x6177('0x27')](function(){return db[_0x6177('0x78')]['destroy']({'where':{'VoiceQueueId':_0x3439d6[_0x6177('0x51')]['id'],'UserId':_0x49858e},'transaction':_0x5bbda6});});}})[_0x6177('0x27')](function(){_0x49858e[_0x6177('0x72')](function(_0x14650f){socket[_0x6177('0x7e')](_0x6177('0x90'),{'UserId':_0x14650f,'VoiceQueueId':_0x3307ae['id']});});});});});});})[_0x6177('0x27')](respondWithStatusCode(_0x354e63,null))[_0x6177('0x4f')](handleError(_0x354e63,null));};exports[_0x6177('0x91')]=function(_0x3afb3b,_0x462481,_0x2e12ce){var _0x227308,_0x26f2d7;return db[_0x6177('0x39')]['find']({'where':{'id':_0x3afb3b['params']['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x462481,null))['then'](function(_0x49e565){if(_0x49e565){_0x26f2d7=_0x49e565;return _0x49e565['addAgents'](_0x3afb3b[_0x6177('0x53')][_0x6177('0x80')],_[_0x6177('0x5c')](_0x3afb3b[_0x6177('0x53')],['ids','id'])||{})[_0x6177('0x92')](function(_0x4c4f78){for(var _0x2da8b3=0x0;_0x2da8b3<_0x3afb3b[_0x6177('0x53')][_0x6177('0x80')][_0x6177('0x43')];_0x2da8b3+=0x1){socket['emit'](_0x6177('0x7f'),{'UserId':_0x3afb3b[_0x6177('0x53')][_0x6177('0x80')][_0x2da8b3],'VoiceQueueId':_0x3afb3b[_0x6177('0x51')]['id']});}return _0x4c4f78;});}})['then'](function(_0xf82d61){_0x227308=_0xf82d61||[];if(_0x26f2d7){return db[_0x6177('0x81')]['findAll']({'where':{'id':_0x3afb3b[_0x6177('0x53')][_0x6177('0x80')]},'attributes':['id',_0x6177('0x33'),_0x6177('0x6f'),_0x6177('0x7d'),'interface'],'raw':!![]});}})[_0x6177('0x27')](function(_0x4e9bd6){if(!_[_0x6177('0x93')](_0x4e9bd6)){var _0x6158bd=[];for(var _0x48c09a=0x0;_0x48c09a<_0x4e9bd6['length'];_0x48c09a++){if(_0x4e9bd6[_0x48c09a][_0x6177('0x6f')]){_0x6158bd['push'](db['UserVoiceQueueRt'][_0x6177('0x79')]({'membername':_0x4e9bd6[_0x48c09a]['name'],'UserId':_0x4e9bd6[_0x48c09a]['id'],'queue_name':_0x26f2d7['name'],'VoiceQueueId':_0x26f2d7['id'],'interface':_[_0x6177('0x7a')](_0x4e9bd6[_0x48c09a][_0x6177('0x70')])?util[_0x6177('0x7b')]('SIP/%s',_0x4e9bd6[_0x48c09a][_0x6177('0x33')]):_0x4e9bd6[_0x48c09a][_0x6177('0x70')],'paused':_0x4e9bd6[_0x48c09a][_0x6177('0x7d')]||![],'penalty':_0x3afb3b[_0x6177('0x53')]['penalty']||0x0}));}}return BPromise[_0x6177('0x8d')](_0x6158bd);}})[_0x6177('0x27')](function(){return _0x227308;})['then'](respondWithResult(_0x462481,null))[_0x6177('0x4f')](handleError(_0x462481,null));};exports['removeAgents']=function(_0xf62f5,_0x5a69f4,_0x4d932b){return db['VoiceQueue'][_0x6177('0x31')]({'where':{'id':_0xf62f5[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x5a69f4,null))[_0x6177('0x27')](function(_0x3caab9){if(_0x3caab9){return _0x3caab9[_0x6177('0x94')](_0xf62f5[_0x6177('0x3e')][_0x6177('0x80')])[_0x6177('0x27')](function(){if(_[_0x6177('0x95')](_0xf62f5[_0x6177('0x3e')][_0x6177('0x80')])){for(var _0x536227=0x0;_0x536227<_0xf62f5[_0x6177('0x3e')][_0x6177('0x80')][_0x6177('0x43')];_0x536227+=0x1){socket[_0x6177('0x7e')](_0x6177('0x90'),{'UserId':Number(_0xf62f5[_0x6177('0x3e')]['ids'][_0x536227]),'VoiceQueueId':Number(_0xf62f5[_0x6177('0x51')]['id'])});}}else{socket[_0x6177('0x7e')](_0x6177('0x90'),{'UserId':Number(_0xf62f5[_0x6177('0x3e')][_0x6177('0x80')]),'VoiceQueueId':Number(_0xf62f5[_0x6177('0x51')]['id'])});}});}})[_0x6177('0x27')](function(_0x3d6142){return db[_0x6177('0x78')]['destroy']({'where':{'VoiceQueueId':_0xf62f5['params']['id'],'UserId':_0xf62f5[_0x6177('0x3e')][_0x6177('0x80')]}})[_0x6177('0x27')](function(){return _0x3d6142;});})[_0x6177('0x27')](respondWithStatusCode(_0x5a69f4,null))[_0x6177('0x4f')](handleError(_0x5a69f4,null));};exports['getAgents']=function(_0x2aa88a,_0x322588,_0x3bbbc5){var _0x23daea={};var _0x1a3952={};var _0x51685a;var _0x5cfe92;return db['VoiceQueue'][_0x6177('0x61')]({'where':{'id':_0x2aa88a[_0x6177('0x51')]['id']}})['then'](handleEntityNotFound(_0x322588,null))[_0x6177('0x27')](function(_0x47cf2c){if(_0x47cf2c){_0x51685a=_0x47cf2c;_0x1a3952['model']=_[_0x6177('0x5b')](db['User'][_0x6177('0x3a')]);_0x1a3952['query']=_['keys'](_0x2aa88a[_0x6177('0x3e')]);_0x1a3952['filters']=_[_0x6177('0x40')](_0x1a3952[_0x6177('0x3d')],_0x1a3952[_0x6177('0x3e')]);_0x23daea[_0x6177('0x42')]=_[_0x6177('0x40')](_0x1a3952['model'],qs[_0x6177('0x41')](_0x2aa88a['query']['fields']));_0x23daea[_0x6177('0x42')]=_0x23daea['attributes'][_0x6177('0x43')]?_0x23daea['attributes']:_0x1a3952[_0x6177('0x3d')];_0x23daea[_0x6177('0x47')]=qs['sort'](_0x2aa88a['query']['sort']);_0x23daea[_0x6177('0x49')]=qs['filters'](_[_0x6177('0x63')](_0x2aa88a[_0x6177('0x3e')],_0x1a3952[_0x6177('0x3f')]));if(_0x2aa88a[_0x6177('0x3e')][_0x6177('0x2d')]){_0x23daea[_0x6177('0x49')]=_[_0x6177('0x4a')](_0x23daea[_0x6177('0x49')],{'$or':_['map'](_0x23daea[_0x6177('0x42')],function(_0x3d5c77){var _0x2f1a79={};_0x2f1a79[_0x3d5c77]={'$like':'%'+_0x2aa88a['query'][_0x6177('0x2d')]+'%'};return _0x2f1a79;})});}_0x23daea=_[_0x6177('0x4a')]({},_0x23daea,_0x2aa88a['options']);return _0x51685a[_0x6177('0x96')](_0x23daea);}})[_0x6177('0x27')](function(_0x206ada){if(_0x206ada){_0x5cfe92=_0x206ada['length'];if(!_0x2aa88a[_0x6177('0x3e')]['hasOwnProperty']('nolimit')){_0x23daea[_0x6177('0x24')]=qs[_0x6177('0x24')](_0x2aa88a['query'][_0x6177('0x24')]);_0x23daea['offset']=qs['offset'](_0x2aa88a[_0x6177('0x3e')]['offset']);}return _0x51685a[_0x6177('0x96')](_0x23daea);}})[_0x6177('0x27')](function(_0x28b1cb){if(_0x28b1cb){return _0x28b1cb?{'count':_0x5cfe92,'rows':_0x28b1cb}:null;}})[_0x6177('0x27')](respondWithResult(_0x322588,null))['catch'](handleError(_0x322588,null));};exports[_0x6177('0x97')]=function(_0x406491,_0x55dad5,_0xa25397){var _0x568b26={};var _0x39a96b={};var _0x3a635c;var _0x4b444b;return db[_0x6177('0x39')][_0x6177('0x61')]({'where':{'id':_0x406491[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x55dad5,null))[_0x6177('0x27')](function(_0x54969a){if(_0x54969a){_0x3a635c=_0x54969a;_0x39a96b[_0x6177('0x3d')]=_[_0x6177('0x5b')](db[_0x6177('0x78')]['rawAttributes']);_0x39a96b['query']=_['keys'](_0x406491[_0x6177('0x3e')]);_0x39a96b[_0x6177('0x3f')]=_['intersection'](_0x39a96b[_0x6177('0x3d')],_0x39a96b['query']);_0x568b26['attributes']=_[_0x6177('0x40')](_0x39a96b[_0x6177('0x3d')],qs['fields'](_0x406491['query'][_0x6177('0x41')]));_0x568b26[_0x6177('0x42')]=_0x568b26[_0x6177('0x42')][_0x6177('0x43')]?_0x568b26[_0x6177('0x42')]:_0x39a96b[_0x6177('0x3d')];_0x568b26[_0x6177('0x47')]=qs['sort'](_0x406491[_0x6177('0x3e')][_0x6177('0x48')]);_0x568b26[_0x6177('0x49')]=qs['filters'](_[_0x6177('0x63')](_0x406491[_0x6177('0x3e')],_0x39a96b['filters']));if(_0x406491['query'][_0x6177('0x2d')]){_0x568b26['where']=_['merge'](_0x568b26[_0x6177('0x49')],{'$or':_[_0x6177('0x2f')](_0x568b26[_0x6177('0x42')],function(_0x358dd5){var _0x143120={};_0x143120[_0x358dd5]={'$like':'%'+_0x406491['query']['filter']+'%'};return _0x143120;})});}_0x568b26=_['merge']({},_0x568b26,_0x406491['options']);return _0x3a635c[_0x6177('0x97')](_0x568b26);}})[_0x6177('0x27')](function(_0x1a4d6b){if(_0x1a4d6b){_0x4b444b=_0x1a4d6b[_0x6177('0x43')];if(!_0x406491[_0x6177('0x3e')]['hasOwnProperty'](_0x6177('0x45'))){_0x568b26['limit']=qs['limit'](_0x406491[_0x6177('0x3e')][_0x6177('0x24')]);_0x568b26[_0x6177('0x46')]=qs[_0x6177('0x46')](_0x406491[_0x6177('0x3e')][_0x6177('0x46')]);}return _0x3a635c['getMembers'](_0x568b26);}})[_0x6177('0x27')](function(_0x4d0476){return _0x4d0476?{'count':_0x4b444b,'rows':_0x4d0476}:null;})[_0x6177('0x27')](respondWithResult(_0x55dad5,null))[_0x6177('0x4f')](handleError(_0x55dad5,null));};exports[_0x6177('0x98')]=function(_0x1a8504,_0xc96926,_0x7d666b){var _0x57f8c9={};var _0x952609={};var _0x231f41;var _0x14d5e7;return db[_0x6177('0x39')][_0x6177('0x61')]({'where':{'id':_0x1a8504[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0xc96926,null))[_0x6177('0x27')](function(_0x176d81){if(_0x176d81){_0x231f41=_0x176d81;_0x952609[_0x6177('0x3d')]=_['keys'](db['CmList']['rawAttributes']);_0x952609['query']=_[_0x6177('0x5b')](_0x1a8504['query']);_0x952609[_0x6177('0x3f')]=_[_0x6177('0x40')](_0x952609[_0x6177('0x3d')],_0x952609[_0x6177('0x3e')]);_0x57f8c9[_0x6177('0x42')]=_['intersection'](_0x952609[_0x6177('0x3d')],qs['fields'](_0x1a8504[_0x6177('0x3e')][_0x6177('0x41')]));_0x57f8c9[_0x6177('0x42')]=_0x57f8c9[_0x6177('0x42')]['length']?_0x57f8c9[_0x6177('0x42')]:_0x952609[_0x6177('0x3d')];_0x57f8c9[_0x6177('0x47')]=qs[_0x6177('0x48')](_0x1a8504[_0x6177('0x3e')][_0x6177('0x48')]);_0x57f8c9['where']=qs[_0x6177('0x3f')](_['pick'](_0x1a8504[_0x6177('0x3e')],_0x952609[_0x6177('0x3f')]));if(_0x1a8504[_0x6177('0x3e')][_0x6177('0x2d')]){_0x57f8c9[_0x6177('0x49')]=_['merge'](_0x57f8c9[_0x6177('0x49')],{'$or':_['map'](_0x57f8c9[_0x6177('0x42')],function(_0x49fa1c){var _0x297e0b={};_0x297e0b[_0x49fa1c]={'$like':'%'+_0x1a8504[_0x6177('0x3e')][_0x6177('0x2d')]+'%'};return _0x297e0b;})});}_0x57f8c9=_['merge']({},_0x57f8c9,_0x1a8504[_0x6177('0x64')]);return _0x231f41[_0x6177('0x98')](_0x57f8c9);}})[_0x6177('0x27')](function(_0x5b1760){if(_0x5b1760){_0x14d5e7=_0x5b1760['length'];if(!_0x1a8504[_0x6177('0x3e')][_0x6177('0x44')](_0x6177('0x45'))){_0x57f8c9[_0x6177('0x24')]=qs[_0x6177('0x24')](_0x1a8504[_0x6177('0x3e')][_0x6177('0x24')]);_0x57f8c9[_0x6177('0x46')]=qs[_0x6177('0x46')](_0x1a8504[_0x6177('0x3e')]['offset']);}return _0x231f41[_0x6177('0x98')](_0x57f8c9);}})[_0x6177('0x27')](function(_0x421b5f){if(_0x421b5f){return _0x421b5f?{'count':_0x14d5e7,'rows':_0x421b5f}:null;}})[_0x6177('0x27')](respondWithResult(_0xc96926,null))[_0x6177('0x4f')](handleError(_0xc96926,null));};exports[_0x6177('0x99')]=function(_0xe1bd97,_0x570cd9,_0x4f795b){var _0x6f7051,_0x673bf;return db[_0x6177('0x39')][_0x6177('0x31')]({'where':{'id':_0xe1bd97['params']['id']}})['then'](handleEntityNotFound(_0x570cd9,null))[_0x6177('0x27')](function(_0x4f7991){if(_0x4f7991){_0x673bf=_0x4f7991;return _0x4f7991[_0x6177('0x99')](_0xe1bd97[_0x6177('0x53')]['ids'],_[_0x6177('0x5c')](_0xe1bd97['body'],[_0x6177('0x80'),'id'])||{});}return null;})[_0x6177('0x92')](function(_0x2ba7ff){var _0x5cdfaf;_0x6f7051=_0x2ba7ff||[];var _0x18d56a=[];if(_0x2ba7ff){for(var _0x230d05=0x0;_0x230d05<_0x2ba7ff[_0x6177('0x43')];_0x230d05+=0x1){var _0x6a8f51=_0x2ba7ff[_0x230d05][_0x6177('0x54')]({'plain':!![]});_0x673bf[_0x6177('0x9a')]=_0xe1bd97[_0x6177('0x53')]['dialCheckDuplicateType']?_0xe1bd97[_0x6177('0x53')][_0x6177('0x9a')]:_0x673bf[_0x6177('0x9a')];switch(_0x673bf[_0x6177('0x9a')]){case _0x6177('0x9b'):_0x5cdfaf=squel[_0x6177('0x9c')]()['into']('cm_hopper')[_0x6177('0x9d')]([_0x6177('0x9e'),_0x6177('0x9f'),_0x6177('0xa0'),_0x6177('0xa1'),_0x6177('0x67'),_0x6177('0x5e'),'updatedAt'],squel['select']()[_0x6177('0x82')](_0x6177('0x9e'),_0x6177('0x9e'))[_0x6177('0x82')](_0x6177('0xa2'),_0x6177('0x9f'))[_0x6177('0x82')]('id',_0x6177('0xa0'))['field'](_0x6a8f51['CmListId'][_0x6177('0xa3')](),'ListId')[_0x6177('0x82')](_0xe1bd97['params']['id'][_0x6177('0xa3')](),_0x6177('0x67'))['field'](_0x6177('0xa2'),_0x6177('0x5e'))[_0x6177('0x82')](_0x6177('0xa2'),_0x6177('0x5d'))[_0x6177('0x84')]('cm_contacts')[_0x6177('0x49')](_0x6177('0xa4'))[_0x6177('0x49')](_0x6177('0xa5'),_0x6a8f51[_0x6177('0xa6')][_0x6177('0xa3')]())[_0x6177('0x49')]('phone\x20IS\x20NOT\x20NULL')[_0x6177('0x49')](_0x6177('0xa7'),squel[_0x6177('0xa8')]()[_0x6177('0x82')](_0x6177('0xa9'))[_0x6177('0x84')](_0x6177('0xaa'))[_0x6177('0x49')]('VoiceQueueId\x20=\x20?',_0xe1bd97[_0x6177('0x51')]['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x6177('0x82')](_0x6177('0xab'))[_0x6177('0x84')]('cm_hopper')[_0x6177('0x49')](_0x6177('0x88'),_0xe1bd97[_0x6177('0x51')]['id'][_0x6177('0xa3')]())))[_0x6177('0xa3')]();break;case _0x6177('0xac'):_0x5cdfaf=squel['insert']()['into'](_0x6177('0xad'))[_0x6177('0x9d')]([_0x6177('0x9e'),_0x6177('0x9f'),'ContactId',_0x6177('0xa1'),'VoiceQueueId',_0x6177('0x5e'),_0x6177('0x5d')],squel['select']()[_0x6177('0x82')]('phone',_0x6177('0x9e'))['field'](_0x6177('0xa2'),_0x6177('0x9f'))[_0x6177('0x82')]('id',_0x6177('0xa0'))[_0x6177('0x82')](_0x6a8f51[_0x6177('0xa6')]['toString'](),_0x6177('0xa1'))[_0x6177('0x82')](_0xe1bd97[_0x6177('0x51')]['id'][_0x6177('0xa3')](),_0x6177('0x67'))[_0x6177('0x82')](_0x6177('0xa2'),_0x6177('0x5e'))[_0x6177('0x82')](_0x6177('0xa2'),_0x6177('0x5d'))[_0x6177('0x84')](_0x6177('0xae'))[_0x6177('0x49')](_0x6177('0xa4'))['where'](_0x6177('0xa5'),_0x6a8f51[_0x6177('0xa6')][_0x6177('0xa3')]())['where'](_0x6177('0xaf'))['where'](_0x6177('0xa7'),squel[_0x6177('0xa8')]()['field']('COALESCE(phone,\x27\x27)')[_0x6177('0x84')](_0x6177('0xad'))[_0x6177('0x49')](_0x6177('0x88'),_0xe1bd97[_0x6177('0x51')]['id']['toString']())))[_0x6177('0xa3')]();break;default:_0x5cdfaf=squel[_0x6177('0x9c')]()[_0x6177('0xb0')]('cm_hopper')['fromQuery']([_0x6177('0x9e'),_0x6177('0x9f'),_0x6177('0xa0'),_0x6177('0xa1'),_0x6177('0x67'),'createdAt',_0x6177('0x5d')],squel[_0x6177('0xa8')]()['field'](_0x6177('0x9e'),'phone')[_0x6177('0x82')](_0x6177('0xa2'),'scheduledAt')[_0x6177('0x82')]('id','ContactId')[_0x6177('0x82')](_0x6a8f51[_0x6177('0xa6')][_0x6177('0xa3')](),_0x6177('0xa1'))[_0x6177('0x82')](_0xe1bd97[_0x6177('0x51')]['id'][_0x6177('0xa3')](),_0x6177('0x67'))[_0x6177('0x82')](_0x6177('0xa2'),_0x6177('0x5e'))['field'](_0x6177('0xa2'),_0x6177('0x5d'))[_0x6177('0x84')](_0x6177('0xae'))[_0x6177('0x49')](_0x6177('0xa4'))[_0x6177('0x49')](_0x6177('0xa5'),_0x6a8f51[_0x6177('0xa6')][_0x6177('0xa3')]())[_0x6177('0x49')]('phone\x20IS\x20NOT\x20NULL'))['toString']();}_0x18d56a[_0x6177('0xb1')](db['sequelize'][_0x6177('0x3e')](_0x5cdfaf));}return BPromise['all'](_0x18d56a);}})[_0x6177('0x27')](function(){return _0x6f7051;})[_0x6177('0x27')](respondWithResult(_0x570cd9,null))[_0x6177('0x4f')](handleError(_0x570cd9,null));};exports['removeLists']=function(_0x251496,_0x3fc2e4,_0x1e5eb7){return db['VoiceQueue'][_0x6177('0x31')]({'where':{'id':_0x251496[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x3fc2e4,null))[_0x6177('0x27')](function(_0x10d151){if(_0x10d151){return _0x10d151[_0x6177('0xb2')](_0x251496[_0x6177('0x3e')][_0x6177('0x80')]);}})['then'](function(_0x38c04d){if(_0x38c04d){return db['CmHopper'][_0x6177('0x28')]({'where':{'ListId':_0x251496['query'][_0x6177('0x80')],'VoiceQueueId':_0x251496[_0x6177('0x51')]['id']}})[_0x6177('0x27')](function(){return _0x38c04d;});}})[_0x6177('0x27')](respondWithStatusCode(_0x3fc2e4,null))[_0x6177('0x4f')](handleError(_0x3fc2e4,null));};exports[_0x6177('0xb3')]=function(_0xb9d6de,_0x2c65eb,_0x27cbb9){var _0x30dcf4={};var _0x4407f2={};var _0xd07f15;var _0x27a31d;return db[_0x6177('0x39')]['findOne']({'where':{'id':_0xb9d6de[_0x6177('0x51')]['id']}})['then'](handleEntityNotFound(_0x2c65eb,null))[_0x6177('0x27')](function(_0x3c515b){if(_0x3c515b){_0xd07f15=_0x3c515b;_0x4407f2[_0x6177('0x3d')]=_[_0x6177('0x5b')](db[_0x6177('0xb4')]['rawAttributes']);_0x4407f2[_0x6177('0x3e')]=_[_0x6177('0x5b')](_0xb9d6de[_0x6177('0x3e')]);_0x4407f2[_0x6177('0x3f')]=_[_0x6177('0x40')](_0x4407f2['model'],_0x4407f2[_0x6177('0x3e')]);_0x30dcf4[_0x6177('0x42')]=_[_0x6177('0x40')](_0x4407f2['model'],qs['fields'](_0xb9d6de[_0x6177('0x3e')][_0x6177('0x41')]));_0x30dcf4['attributes']=_0x30dcf4[_0x6177('0x42')][_0x6177('0x43')]?_0x30dcf4[_0x6177('0x42')]:_0x4407f2[_0x6177('0x3d')];_0x30dcf4['order']=qs['sort'](_0xb9d6de['query'][_0x6177('0x48')]);_0x30dcf4[_0x6177('0x49')]=qs[_0x6177('0x3f')](_[_0x6177('0x63')](_0xb9d6de[_0x6177('0x3e')],_0x4407f2[_0x6177('0x3f')]));if(_0xb9d6de[_0x6177('0x3e')][_0x6177('0x2d')]){_0x30dcf4['where']=_[_0x6177('0x4a')](_0x30dcf4['where'],{'$or':_[_0x6177('0x2f')](_0x30dcf4['attributes'],function(_0x1b917d){var _0x54a405={};_0x54a405[_0x1b917d]={'$like':'%'+_0xb9d6de[_0x6177('0x3e')][_0x6177('0x2d')]+'%'};return _0x54a405;})});}_0x30dcf4=_[_0x6177('0x4a')]({},_0x30dcf4,_0xb9d6de[_0x6177('0x64')]);return _0xd07f15[_0x6177('0xb3')](_0x30dcf4);}})[_0x6177('0x27')](function(_0x492693){if(_0x492693){_0x27a31d=_0x492693[_0x6177('0x43')];if(!_0xb9d6de[_0x6177('0x3e')][_0x6177('0x44')](_0x6177('0x45'))){_0x30dcf4['limit']=qs[_0x6177('0x24')](_0xb9d6de[_0x6177('0x3e')][_0x6177('0x24')]);_0x30dcf4[_0x6177('0x46')]=qs[_0x6177('0x46')](_0xb9d6de[_0x6177('0x3e')][_0x6177('0x46')]);}return _0xd07f15[_0x6177('0xb3')](_0x30dcf4);}})[_0x6177('0x27')](function(_0x50199c){if(_0x50199c){return _0x50199c?{'count':_0x27a31d,'rows':_0x50199c}:null;}})['then'](respondWithResult(_0x2c65eb,null))[_0x6177('0x4f')](handleError(_0x2c65eb,null));};exports['addBlackLists']=function(_0x56826a,_0x4494f8,_0x1d9c87){var _0x4fbdec,_0x2a016e;return db[_0x6177('0x39')]['find']({'where':{'id':_0x56826a[_0x6177('0x51')]['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x4494f8,null))[_0x6177('0x27')](function(_0x2f9e8a){if(_0x2f9e8a){_0x2a016e=_0x2f9e8a;return _0x2f9e8a[_0x6177('0xb5')](_0x56826a[_0x6177('0x53')][_0x6177('0x80')],_[_0x6177('0x5c')](_0x56826a[_0x6177('0x53')],[_0x6177('0x80'),'id'])||{});}return null;})[_0x6177('0x92')](function(_0x3d1553){var _0x4bf2fa;_0x4fbdec=_0x3d1553||[];var _0x5d749f=[];if(_0x3d1553){for(var _0x3c8c41=0x0;_0x3c8c41<_0x3d1553[_0x6177('0x43')];_0x3c8c41+=0x1){var _0x599246=_0x3d1553[_0x3c8c41][_0x6177('0x54')]({'plain':!![]});_0x4bf2fa=squel[_0x6177('0x9c')]()[_0x6177('0xb0')](_0x6177('0xb6'))[_0x6177('0x9d')]([_0x6177('0x9e'),_0x6177('0xa0'),'ListId','VoiceQueueId',_0x6177('0x5e'),_0x6177('0x5d')],squel['select']()[_0x6177('0x82')](_0x6177('0x9e'),'phone')['field']('id',_0x6177('0xa0'))[_0x6177('0x82')](_0x599246[_0x6177('0xa6')][_0x6177('0xa3')](),_0x6177('0xa1'))['field'](_0x56826a[_0x6177('0x51')]['id'][_0x6177('0xa3')](),_0x6177('0x67'))[_0x6177('0x82')](_0x6177('0xa2'),_0x6177('0x5e'))[_0x6177('0x82')](_0x6177('0xa2'),_0x6177('0x5d'))[_0x6177('0x84')](_0x6177('0xae'))[_0x6177('0x49')](_0x6177('0xa4'))[_0x6177('0x49')](_0x6177('0xa5'),_0x599246[_0x6177('0xa6')][_0x6177('0xa3')]())[_0x6177('0x49')]('phone\x20IS\x20NOT\x20NULL'))[_0x6177('0xa3')]();_0x5d749f[_0x6177('0xb1')](db[_0x6177('0x74')]['query'](_0x4bf2fa));}return BPromise[_0x6177('0x8d')](_0x5d749f);}})[_0x6177('0x27')](function(){return _0x4fbdec;})[_0x6177('0x27')](respondWithResult(_0x4494f8,null))['catch'](handleError(_0x4494f8,null));};exports[_0x6177('0xb7')]=function(_0x5d6258,_0x5dc74,_0x3c7420){return db[_0x6177('0x39')][_0x6177('0x31')]({'where':{'id':_0x5d6258['params']['id']}})[_0x6177('0x27')](handleEntityNotFound(_0x5dc74,null))['then'](function(_0x2609c1){if(_0x2609c1){return _0x2609c1['removeBlackLists'](_0x5d6258[_0x6177('0x3e')][_0x6177('0x80')]);}})['then'](function(_0x40df36){if(_0x40df36){return db[_0x6177('0x69')][_0x6177('0x28')]({'where':{'ListId':_0x5d6258['query'][_0x6177('0x80')],'VoiceQueueId':_0x5d6258[_0x6177('0x51')]['id']}})[_0x6177('0x27')](function(){return _0x40df36;});}})['then'](respondWithStatusCode(_0x5dc74,null))['catch'](handleError(_0x5dc74,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index 0f4df7e..29c43d6 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 _0xd5c4=['../../mysqldb','setMaxListeners','save','remove','emit','hook','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd5c4,0x19d));var _0x4d5c=function(_0x223c06,_0x3326f8){_0x223c06=_0x223c06-0x0;var _0x15630e=_0xd5c4[_0x223c06];return _0x15630e;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x4d5c('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4d5c('0x1')](0x0);var events={'afterCreate':_0x4d5c('0x2'),'afterUpdate':'update','afterDestroy':_0x4d5c('0x3')};function emitEvent(_0x127b53){return function(_0x7f6314,_0x73a662,_0x11026c){VoiceQueueEvents[_0x4d5c('0x4')](_0x127b53+':'+_0x7f6314['id'],_0x7f6314);VoiceQueueEvents[_0x4d5c('0x4')](_0x127b53,_0x7f6314);_0x11026c(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x4d5c('0x5')](e,emitEvent(event));}}module[_0x4d5c('0x6')]=VoiceQueueEvents; \ No newline at end of file +var _0xcac9=['save','hasOwnProperty','hook','exports','../../mysqldb','VoiceQueue'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0xcac9,0x9a));var _0x9cac=function(_0x4ac60a,_0x503a99){_0x4ac60a=_0x4ac60a-0x0;var _0x4b22e8=_0xcac9[_0x4ac60a];return _0x4b22e8;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x9cac('0x0'))['db'][_0x9cac('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x9cac('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x28310a){return function(_0x5e1e30,_0x299ab9,_0x3defec){VoiceQueueEvents['emit'](_0x28310a+':'+_0x5e1e30['id'],_0x5e1e30);VoiceQueueEvents['emit'](_0x28310a,_0x5e1e30);_0x3defec(null);};}for(var e in events){if(events[_0x9cac('0x3')](e)){var event=events[e];VoiceQueue[_0x9cac('0x4')](e,emitEvent(event));}}module[_0x9cac('0x5')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index 295b25b..4b8973d 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 _0x0752=['moment','request-promise','path','rimraf','../../config/environment','exports','define','VoiceQueue','lodash','util','api'];(function(_0x212a69,_0x4fa35b){var _0x4dabe0=function(_0x45066c){while(--_0x45066c){_0x212a69['push'](_0x212a69['shift']());}};_0x4dabe0(++_0x4fa35b);}(_0x0752,0x1d6));var _0x2075=function(_0x92c94d,_0x2a7d91){_0x92c94d=_0x92c94d-0x0;var _0x387155=_0x0752[_0x92c94d];return _0x387155;};'use strict';var _=require(_0x2075('0x0'));var util=require(_0x2075('0x1'));var logger=require('../../config/logger')(_0x2075('0x2'));var moment=require(_0x2075('0x3'));var BPromise=require('bluebird');var rp=require(_0x2075('0x4'));var fs=require('fs');var path=require(_0x2075('0x5'));var rimraf=require(_0x2075('0x6'));var config=require(_0x2075('0x7'));var attributes=require('./voiceQueue.attributes');module[_0x2075('0x8')]=function(_0x4ff5a7,_0x9b30e4){return _0x4ff5a7[_0x2075('0x9')](_0x2075('0xa'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8a1=['../../config/logger','api','moment','bluebird','request-promise','path','exports','define','VoiceQueue','util'];(function(_0x261f7f,_0x2b9c2d){var _0x362925=function(_0x5459f7){while(--_0x5459f7){_0x261f7f['push'](_0x261f7f['shift']());}};_0x362925(++_0x2b9c2d);}(_0xe8a1,0x1f3));var _0x1e8a=function(_0x13d49e,_0x2935ed){_0x13d49e=_0x13d49e-0x0;var _0x20052e=_0xe8a1[_0x13d49e];return _0x20052e;};'use strict';var _=require('lodash');var util=require(_0x1e8a('0x0'));var logger=require(_0x1e8a('0x1'))(_0x1e8a('0x2'));var moment=require(_0x1e8a('0x3'));var BPromise=require(_0x1e8a('0x4'));var rp=require(_0x1e8a('0x5'));var fs=require('fs');var path=require(_0x1e8a('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./voiceQueue.attributes');module[_0x1e8a('0x7')]=function(_0x3728e7,_0x30b19c){return _0x3728e7[_0x1e8a('0x8')](_0x1e8a('0x9'),attributes,{'tableName':'voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.rpc.js b/server/api/voiceQueue/voiceQueue.rpc.js index 9e05c89..ecf310d 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 _0xc3df=['code','message','result','catch','GetVoiceQueue','VoiceQueue','options','raw','where','attributes','limit','include','map','model','debug','find','ShowVoiceQueue','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','socket.io-emitter','redis','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x33b34e,_0x5f2983){var _0x205ba2=function(_0x538981){while(--_0x538981){_0x33b34e['push'](_0x33b34e['shift']());}};_0x205ba2(++_0x5f2983);}(_0xc3df,0xf5));var _0xfc3d=function(_0x500374,_0x19a238){_0x500374=_0x500374-0x0;var _0x23b3a0=_0xc3df[_0x500374];return _0x23b3a0;};'use strict';var _=require('lodash');var util=require(_0xfc3d('0x0'));var moment=require(_0xfc3d('0x1'));var BPromise=require('bluebird');var rs=require(_0xfc3d('0x2'));var fs=require('fs');var Redis=require(_0xfc3d('0x3'));var db=require(_0xfc3d('0x4'))['db'];var utils=require(_0xfc3d('0x5'));var logger=require(_0xfc3d('0x6'))(_0xfc3d('0x7'));var config=require('../../config/environment');var jayson=require(_0xfc3d('0x8'));var client=jayson[_0xfc3d('0x9')][_0xfc3d('0xa')]({'port':0x232a});config['redis']=_[_0xfc3d('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xfc3d('0xc'))(new Redis(config[_0xfc3d('0xd')]));require('./voiceQueue.socket')[_0xfc3d('0xe')](socket);function respondWithRpcPromise(_0xd4aa94,_0x282262,_0x1897f4){return new BPromise(function(_0x5d3e9c,_0x4bc66c){return client['request'](_0xd4aa94,_0x1897f4)['then'](function(_0x47165e){logger[_0xfc3d('0xf')](_0xfc3d('0x10'),_0x282262,_0xfc3d('0x11'));logger['debug'](_0xfc3d('0x12'),_0x282262,_0xfc3d('0x11'),JSON[_0xfc3d('0x13')](_0x47165e));if(_0x47165e[_0xfc3d('0x14')]){if(_0x47165e[_0xfc3d('0x14')][_0xfc3d('0x15')]===0x1f4){logger['error'](_0xfc3d('0x10'),_0x282262,_0x47165e[_0xfc3d('0x14')][_0xfc3d('0x16')]);return _0x4bc66c(_0x47165e[_0xfc3d('0x14')][_0xfc3d('0x16')]);}logger[_0xfc3d('0x14')]('VoiceQueue,\x20%s,\x20%s',_0x282262,_0x47165e[_0xfc3d('0x14')][_0xfc3d('0x16')]);return _0x5d3e9c(_0x47165e[_0xfc3d('0x14')]['message']);}else{logger[_0xfc3d('0xf')](_0xfc3d('0x10'),_0x282262,'request\x20sent');_0x5d3e9c(_0x47165e[_0xfc3d('0x17')][_0xfc3d('0x16')]);}})[_0xfc3d('0x18')](function(_0x257d2d){logger[_0xfc3d('0x14')](_0xfc3d('0x10'),_0x282262,_0x257d2d);_0x4bc66c(_0x257d2d);});});}exports[_0xfc3d('0x19')]=function(_0xb2fe6d){var _0x3930a5=this;return new Promise(function(_0x1eee88,_0x48cb07){return db[_0xfc3d('0x1a')]['findAll']({'raw':_0xb2fe6d[_0xfc3d('0x1b')]?_0xb2fe6d[_0xfc3d('0x1b')][_0xfc3d('0x1c')]===undefined?!![]:![]:!![],'where':_0xb2fe6d[_0xfc3d('0x1b')]?_0xb2fe6d[_0xfc3d('0x1b')][_0xfc3d('0x1d')]||null:null,'attributes':_0xb2fe6d[_0xfc3d('0x1b')]?_0xb2fe6d[_0xfc3d('0x1b')][_0xfc3d('0x1e')]||null:null,'limit':_0xb2fe6d[_0xfc3d('0x1b')]?_0xb2fe6d['options'][_0xfc3d('0x1f')]||null:null,'include':_0xb2fe6d['options']?_0xb2fe6d[_0xfc3d('0x1b')][_0xfc3d('0x20')]?_[_0xfc3d('0x21')](_0xb2fe6d['options']['include'],function(_0x114301){return{'model':db[_0x114301[_0xfc3d('0x22')]],'as':_0x114301['as'],'attributes':_0x114301['attributes'],'include':_0x114301['include']?_[_0xfc3d('0x21')](_0x114301[_0xfc3d('0x20')],function(_0x4c8a45){return{'model':db[_0x4c8a45[_0xfc3d('0x22')]],'as':_0x4c8a45['as'],'attributes':_0x4c8a45[_0xfc3d('0x1e')],'include':_0x4c8a45[_0xfc3d('0x20')]?_['map'](_0x4c8a45[_0xfc3d('0x20')],function(_0x431af3){return{'model':db[_0x431af3[_0xfc3d('0x22')]],'as':_0x431af3['as'],'attributes':_0x431af3[_0xfc3d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x315ea1){logger[_0xfc3d('0xf')](_0xfc3d('0x19'),_0xb2fe6d);logger[_0xfc3d('0x23')](_0xfc3d('0x19'),_0xb2fe6d,JSON[_0xfc3d('0x13')](_0x315ea1));_0x1eee88(_0x315ea1);})['catch'](function(_0x1c5da3){logger[_0xfc3d('0x14')]('GetVoiceQueue',_0x1c5da3[_0xfc3d('0x16')],_0xb2fe6d);_0x48cb07(_0x3930a5['error'](0x1f4,_0x1c5da3[_0xfc3d('0x16')]));});});};exports['ShowVoiceQueue']=function(_0x230f14){var _0x17439c=this;return new Promise(function(_0x16a209,_0x2825bd){return db[_0xfc3d('0x1a')][_0xfc3d('0x24')]({'raw':_0x230f14[_0xfc3d('0x1b')]?_0x230f14[_0xfc3d('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x230f14[_0xfc3d('0x1b')]?_0x230f14['options'][_0xfc3d('0x1d')]||null:null,'attributes':_0x230f14[_0xfc3d('0x1b')]?_0x230f14[_0xfc3d('0x1b')][_0xfc3d('0x1e')]||null:null,'include':_0x230f14['options']?_0x230f14[_0xfc3d('0x1b')][_0xfc3d('0x20')]?_[_0xfc3d('0x21')](_0x230f14[_0xfc3d('0x1b')][_0xfc3d('0x20')],function(_0x1059eb){return{'model':db[_0x1059eb[_0xfc3d('0x22')]],'as':_0x1059eb['as'],'attributes':_0x1059eb['attributes'],'include':_0x1059eb[_0xfc3d('0x20')]?_['map'](_0x1059eb[_0xfc3d('0x20')],function(_0x3a5a7c){return{'model':db[_0x3a5a7c[_0xfc3d('0x22')]],'as':_0x3a5a7c['as'],'attributes':_0x3a5a7c[_0xfc3d('0x1e')],'include':_0x3a5a7c[_0xfc3d('0x20')]?_[_0xfc3d('0x21')](_0x3a5a7c[_0xfc3d('0x20')],function(_0x10a5d2){return{'model':db[_0x10a5d2[_0xfc3d('0x22')]],'as':_0x10a5d2['as'],'attributes':_0x10a5d2[_0xfc3d('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xd0acad){logger[_0xfc3d('0xf')](_0xfc3d('0x25'),_0x230f14);logger[_0xfc3d('0x23')](_0xfc3d('0x25'),_0x230f14,JSON[_0xfc3d('0x13')](_0xd0acad));_0x16a209(_0xd0acad);})[_0xfc3d('0x18')](function(_0x2eb7f4){logger[_0xfc3d('0x14')](_0xfc3d('0x25'),_0x2eb7f4[_0xfc3d('0x16')],_0x230f14);_0x2825bd(_0x17439c['error'](0x1f4,_0x2eb7f4[_0xfc3d('0x16')]));});});}; \ No newline at end of file +var _0x7dac=['redis','localhost','socket.io-emitter','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','VoiceQueue,\x20%s,\x20%s,\x20%s','error','message','result','catch','GetVoiceQueue','VoiceQueue','options','where','include','map','attributes','model','debug','stringify','ShowVoiceQueue','find','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x7dac,0x153));var _0xc7da=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x7dac[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var util=require(_0xc7da('0x0'));var moment=require(_0xc7da('0x1'));var BPromise=require(_0xc7da('0x2'));var rs=require(_0xc7da('0x3'));var fs=require('fs');var Redis=require(_0xc7da('0x4'));var db=require(_0xc7da('0x5'))['db'];var utils=require(_0xc7da('0x6'));var logger=require(_0xc7da('0x7'))(_0xc7da('0x8'));var config=require(_0xc7da('0x9'));var jayson=require(_0xc7da('0xa'));var client=jayson[_0xc7da('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0xc7da('0xc')],{'host':_0xc7da('0xd'),'port':0x18eb});var socket=require(_0xc7da('0xe'))(new Redis(config[_0xc7da('0xc')]));require('./voiceQueue.socket')[_0xc7da('0xf')](socket);function respondWithRpcPromise(_0x4014fe,_0x47d47a,_0x5e021a){return new BPromise(function(_0x1b0eab,_0x2f4055){return client[_0xc7da('0x10')](_0x4014fe,_0x5e021a)[_0xc7da('0x11')](function(_0x5a1e){logger[_0xc7da('0x12')](_0xc7da('0x13'),_0x47d47a,_0xc7da('0x14'));logger['debug'](_0xc7da('0x15'),_0x47d47a,_0xc7da('0x14'),JSON['stringify'](_0x5a1e));if(_0x5a1e[_0xc7da('0x16')]){if(_0x5a1e[_0xc7da('0x16')]['code']===0x1f4){logger[_0xc7da('0x16')](_0xc7da('0x13'),_0x47d47a,_0x5a1e[_0xc7da('0x16')][_0xc7da('0x17')]);return _0x2f4055(_0x5a1e[_0xc7da('0x16')][_0xc7da('0x17')]);}logger[_0xc7da('0x16')](_0xc7da('0x13'),_0x47d47a,_0x5a1e[_0xc7da('0x16')]['message']);return _0x1b0eab(_0x5a1e[_0xc7da('0x16')][_0xc7da('0x17')]);}else{logger[_0xc7da('0x12')]('VoiceQueue,\x20%s,\x20%s',_0x47d47a,_0xc7da('0x14'));_0x1b0eab(_0x5a1e[_0xc7da('0x18')][_0xc7da('0x17')]);}})[_0xc7da('0x19')](function(_0x515b3a){logger[_0xc7da('0x16')](_0xc7da('0x13'),_0x47d47a,_0x515b3a);_0x2f4055(_0x515b3a);});});}exports[_0xc7da('0x1a')]=function(_0x432208){var _0x4f04e6=this;return new Promise(function(_0x9e5c82,_0x346e2d){return db[_0xc7da('0x1b')]['findAll']({'raw':_0x432208[_0xc7da('0x1c')]?_0x432208[_0xc7da('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x432208['options']?_0x432208[_0xc7da('0x1c')][_0xc7da('0x1d')]||null:null,'attributes':_0x432208[_0xc7da('0x1c')]?_0x432208['options']['attributes']||null:null,'limit':_0x432208[_0xc7da('0x1c')]?_0x432208['options']['limit']||null:null,'include':_0x432208[_0xc7da('0x1c')]?_0x432208[_0xc7da('0x1c')][_0xc7da('0x1e')]?_[_0xc7da('0x1f')](_0x432208['options'][_0xc7da('0x1e')],function(_0x5a6f6a){return{'model':db[_0x5a6f6a['model']],'as':_0x5a6f6a['as'],'attributes':_0x5a6f6a['attributes'],'include':_0x5a6f6a['include']?_[_0xc7da('0x1f')](_0x5a6f6a[_0xc7da('0x1e')],function(_0x20d5fa){return{'model':db[_0x20d5fa['model']],'as':_0x20d5fa['as'],'attributes':_0x20d5fa[_0xc7da('0x20')],'include':_0x20d5fa[_0xc7da('0x1e')]?_[_0xc7da('0x1f')](_0x20d5fa[_0xc7da('0x1e')],function(_0x4ea31a){return{'model':db[_0x4ea31a[_0xc7da('0x21')]],'as':_0x4ea31a['as'],'attributes':_0x4ea31a['attributes']};}):[]};}):[]};}):[]:[]})[_0xc7da('0x11')](function(_0x4eb346){logger['info'](_0xc7da('0x1a'),_0x432208);logger[_0xc7da('0x22')](_0xc7da('0x1a'),_0x432208,JSON[_0xc7da('0x23')](_0x4eb346));_0x9e5c82(_0x4eb346);})[_0xc7da('0x19')](function(_0x40968b){logger[_0xc7da('0x16')](_0xc7da('0x1a'),_0x40968b['message'],_0x432208);_0x346e2d(_0x4f04e6[_0xc7da('0x16')](0x1f4,_0x40968b['message']));});});};exports[_0xc7da('0x24')]=function(_0x3ca340){var _0x183e53=this;return new Promise(function(_0x11f551,_0x18f670){return db['VoiceQueue'][_0xc7da('0x25')]({'raw':_0x3ca340[_0xc7da('0x1c')]?_0x3ca340[_0xc7da('0x1c')][_0xc7da('0x26')]===undefined?!![]:![]:!![],'where':_0x3ca340[_0xc7da('0x1c')]?_0x3ca340[_0xc7da('0x1c')][_0xc7da('0x1d')]||null:null,'attributes':_0x3ca340[_0xc7da('0x1c')]?_0x3ca340['options'][_0xc7da('0x20')]||null:null,'include':_0x3ca340[_0xc7da('0x1c')]?_0x3ca340[_0xc7da('0x1c')][_0xc7da('0x1e')]?_[_0xc7da('0x1f')](_0x3ca340[_0xc7da('0x1c')][_0xc7da('0x1e')],function(_0x4724d5){return{'model':db[_0x4724d5[_0xc7da('0x21')]],'as':_0x4724d5['as'],'attributes':_0x4724d5[_0xc7da('0x20')],'include':_0x4724d5[_0xc7da('0x1e')]?_[_0xc7da('0x1f')](_0x4724d5[_0xc7da('0x1e')],function(_0x2aa149){return{'model':db[_0x2aa149[_0xc7da('0x21')]],'as':_0x2aa149['as'],'attributes':_0x2aa149['attributes'],'include':_0x2aa149[_0xc7da('0x1e')]?_[_0xc7da('0x1f')](_0x2aa149[_0xc7da('0x1e')],function(_0x11d577){return{'model':db[_0x11d577[_0xc7da('0x21')]],'as':_0x11d577['as'],'attributes':_0x11d577[_0xc7da('0x20')]};}):[]};}):[]};}):[]:[]})[_0xc7da('0x11')](function(_0x7f3368){logger[_0xc7da('0x12')](_0xc7da('0x24'),_0x3ca340);logger[_0xc7da('0x22')](_0xc7da('0x24'),_0x3ca340,JSON[_0xc7da('0x23')](_0x7f3368));_0x11f551(_0x7f3368);})['catch'](function(_0x2af7e7){logger[_0xc7da('0x16')](_0xc7da('0x24'),_0x2af7e7[_0xc7da('0x17')],_0x3ca340);_0x18f670(_0x183e53[_0xc7da('0x16')](0x1f4,_0x2af7e7[_0xc7da('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index c858fb5..eb60600 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 _0x3114=['voiceQueue:','save','remove','removeListener','length'];(function(_0x5be888,_0x8c04fc){var _0x8173e9=function(_0x2324f9){while(--_0x2324f9){_0x5be888['push'](_0x5be888['shift']());}};_0x8173e9(++_0x8c04fc);}(_0x3114,0xdd));var _0x4311=function(_0xfec05,_0x1c6603){_0xfec05=_0xfec05-0x0;var _0x3646ac=_0x3114[_0xfec05];return _0x3646ac;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x4311('0x0'),_0x4311('0x1'),'update'];function createListener(_0x42b9e2,_0x50ca0d){return function(_0x215ee4){_0x50ca0d['emit'](_0x42b9e2,_0x215ee4);};}function removeListener(_0x37a30d,_0x429b72){return function(){VoiceQueueEvents[_0x4311('0x2')](_0x37a30d,_0x429b72);};}exports['register']=function(_0x30f093){for(var _0x5d4846=0x0,_0x12ecb3=events[_0x4311('0x3')];_0x5d4846<_0x12ecb3;_0x5d4846++){var _0x29efe8=events[_0x5d4846];var _0x2c3c58=createListener(_0x4311('0x4')+_0x29efe8,_0x30f093);VoiceQueueEvents['on'](_0x29efe8,_0x2c3c58);}}; \ No newline at end of file +var _0x05c2=['./voiceQueue.events','save','update','emit','removeListener','register','voiceQueue:'];(function(_0x117821,_0xaa1933){var _0x4ae9ff=function(_0x253662){while(--_0x253662){_0x117821['push'](_0x117821['shift']());}};_0x4ae9ff(++_0xaa1933);}(_0x05c2,0x1ab));var _0x205c=function(_0x34282b,_0x3c7668){_0x34282b=_0x34282b-0x0;var _0x1f9ea3=_0x05c2[_0x34282b];return _0x1f9ea3;};'use strict';var VoiceQueueEvents=require(_0x205c('0x0'));var events=[_0x205c('0x1'),'remove',_0x205c('0x2')];function createListener(_0x290463,_0x2a6ad8){return function(_0x388956){_0x2a6ad8[_0x205c('0x3')](_0x290463,_0x388956);};}function removeListener(_0x552c6c,_0x5864e9){return function(){VoiceQueueEvents[_0x205c('0x4')](_0x552c6c,_0x5864e9);};}exports[_0x205c('0x5')]=function(_0x4167b1){for(var _0x1d636a=0x0,_0x841976=events['length'];_0x1d636a<_0x841976;_0x1d636a++){var _0x22f180=events[_0x1d636a];var _0x463ad9=createListener(_0x205c('0x6')+_0x22f180,_0x4167b1);VoiceQueueEvents['on'](_0x22f180,_0x463ad9);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 3dc9a9d..aea88af 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 _0x6a55=['express','../../components/interaction/service','./voiceQueueReport.controller','isAuthenticated','index','get','/describe','describe','/index','getVoiceQueuesReport','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x263b0e,_0xc6479f){var _0x113fee=function(_0x803881){while(--_0x803881){_0x263b0e['push'](_0x263b0e['shift']());}};_0x113fee(++_0xc6479f);}(_0x6a55,0xdb));var _0x56a5=function(_0x170941,_0x38d105){_0x170941=_0x170941-0x0;var _0x50e48d=_0x6a55[_0x170941];return _0x50e48d;};'use strict';var multer=require(_0x56a5('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x56a5('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x56a5('0x2'));var config=require('../../config/environment');var controller=require(_0x56a5('0x3'));router['get']('/',auth[_0x56a5('0x4')](),controller[_0x56a5('0x5')]);router[_0x56a5('0x6')](_0x56a5('0x7'),auth[_0x56a5('0x4')](),controller[_0x56a5('0x8')]);router[_0x56a5('0x6')](_0x56a5('0x9'),auth['isAuthenticated'](),controller[_0x56a5('0xa')]);router[_0x56a5('0x6')](_0x56a5('0xb'),auth[_0x56a5('0x4')](),controller[_0x56a5('0xc')]);router[_0x56a5('0xd')]('/',auth[_0x56a5('0x4')](),controller[_0x56a5('0xe')]);router[_0x56a5('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x56a5('0x10')]);router[_0x56a5('0x11')](_0x56a5('0xb'),auth[_0x56a5('0x4')](),controller[_0x56a5('0x12')]);module[_0x56a5('0x13')]=router; \ No newline at end of file +var _0x7c09=['create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id'];(function(_0x169685,_0x3f1155){var _0x5bd4a8=function(_0x30edda){while(--_0x30edda){_0x169685['push'](_0x169685['shift']());}};_0x5bd4a8(++_0x3f1155);}(_0x7c09,0x102));var _0x97c0=function(_0x3a4cb5,_0x289d84){_0x3a4cb5=_0x3a4cb5-0x0;var _0x931453=_0x7c09[_0x3a4cb5];return _0x931453;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var auth=require(_0x97c0('0x4'));var interaction=require(_0x97c0('0x5'));var config=require(_0x97c0('0x6'));var controller=require(_0x97c0('0x7'));router[_0x97c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x97c0('0x9'),auth[_0x97c0('0xa')](),controller[_0x97c0('0xb')]);router[_0x97c0('0x8')](_0x97c0('0xc'),auth['isAuthenticated'](),controller[_0x97c0('0xd')]);router['get'](_0x97c0('0xe'),auth[_0x97c0('0xa')](),controller['show']);router['post']('/',auth[_0x97c0('0xa')](),controller[_0x97c0('0xf')]);router[_0x97c0('0x10')](_0x97c0('0xe'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x11')]);router[_0x97c0('0x12')](_0x97c0('0xe'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x13')]);module[_0x97c0('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index f079fa7..c94fff8 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 _0x76da=['DATE','diff','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING'];(function(_0x3af7d7,_0x1fbac5){var _0x3f43e2=function(_0x381f5a){while(--_0x381f5a){_0x3af7d7['push'](_0x3af7d7['shift']());}};_0x3f43e2(++_0x1fbac5);}(_0x76da,0x111));var _0xa76d=function(_0x93f00,_0x5e3e1b){_0x93f00=_0x93f00-0x0;var _0x5c0fd6=_0x76da[_0x93f00];return _0x5c0fd6;};'use strict';var Sequelize=require(_0xa76d('0x0'));var moment=require('moment');module[_0xa76d('0x1')]={'type':{'type':Sequelize[_0xa76d('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xa76d('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0xa76d('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xa76d('0x3')],'set':function(_0x15e728){var _0x5363ff=moment(_0x15e728);var _0x45fe23=moment(this['getDataValue']('queuecallerjoinAt'))['format']('YYYY-MM-DD\x20HH:mm:ss');var _0x2f0140=_0x5363ff[_0xa76d('0x4')](_0x45fe23,_0xa76d('0x5'));this[_0xa76d('0x6')](_0xa76d('0x7'),_0x15e728);this[_0xa76d('0x6')](_0xa76d('0x8'),_0x2f0140||null);}},'position':{'type':Sequelize[_0xa76d('0x9')]},'count':{'type':Sequelize[_0xa76d('0x9')]},'queuecallerabandon':{'type':Sequelize[_0xa76d('0xa')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0xa76d('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xa76d('0x3')]},'queuecallerexit':{'type':Sequelize[_0xa76d('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xa76d('0x3')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':'COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT'},'originalposition':{'type':Sequelize[_0xa76d('0x9')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0xa76d('0x2')]},'connectedlinename':{'type':Sequelize[_0xa76d('0x2')]},'accountcode':{'type':Sequelize[_0xa76d('0x2')]},'context':{'type':Sequelize[_0xa76d('0x2')]},'exten':{'type':Sequelize[_0xa76d('0x2')]},'priority':{'type':Sequelize[_0xa76d('0x2')]},'holdtime':{'type':Sequelize[_0xa76d('0x9')]},'mohtime':{'type':Sequelize[_0xa76d('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xa76d('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa76d('0x2')],'comment':_0xa76d('0xb')},'transferexten':{'type':Sequelize[_0xa76d('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xa76d('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0xa76d('0x9')],'defaultValue':0x0}}; \ No newline at end of file +var _0xf0b0=['exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','moment'];(function(_0x558e5a,_0x5e9a85){var _0x717a46=function(_0x786d8){while(--_0x786d8){_0x558e5a['push'](_0x558e5a['shift']());}};_0x717a46(++_0x5e9a85);}(_0xf0b0,0x143));var _0x0f0b=function(_0x1f2944,_0x278b0b){_0x1f2944=_0x1f2944-0x0;var _0x2556fe=_0xf0b0[_0x1f2944];return _0x2556fe;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0f0b('0x0'));module[_0x0f0b('0x1')]={'type':{'type':Sequelize[_0x0f0b('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x0f0b('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x0f0b('0x2')]},'queuecallerjoinAt':{'type':Sequelize['DATE']},'queuecallerleaveAt':{'type':Sequelize[_0x0f0b('0x3')],'set':function(_0x2b2c46){var _0x4628d3=moment(_0x2b2c46);var _0x56e2db=moment(this[_0x0f0b('0x4')](_0x0f0b('0x5')))['format'](_0x0f0b('0x6'));var _0x449f1b=_0x4628d3[_0x0f0b('0x7')](_0x56e2db,_0x0f0b('0x8'));this['setDataValue']('queuecallerleaveAt',_0x2b2c46);this['setDataValue']('holdtime',_0x449f1b||null);}},'position':{'type':Sequelize[_0x0f0b('0x9')]},'count':{'type':Sequelize[_0x0f0b('0x9')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x0f0b('0xa')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x0f0b('0x3')]},'queuecallerexit':{'type':Sequelize[_0x0f0b('0xa')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x0f0b('0x3')]},'queuecallerexitreason':{'type':Sequelize[_0x0f0b('0x2')],'comment':_0x0f0b('0xb')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x0f0b('0x2')]},'connectedlinenum':{'type':Sequelize[_0x0f0b('0x2')]},'connectedlinename':{'type':Sequelize[_0x0f0b('0x2')]},'accountcode':{'type':Sequelize[_0x0f0b('0x2')]},'context':{'type':Sequelize[_0x0f0b('0x2')]},'exten':{'type':Sequelize[_0x0f0b('0x2')]},'priority':{'type':Sequelize[_0x0f0b('0x2')]},'holdtime':{'type':Sequelize[_0x0f0b('0x9')]},'mohtime':{'type':Sequelize[_0x0f0b('0x9')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x0f0b('0xa')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x0f0b('0x2')]},'transfer':{'type':Sequelize[_0x0f0b('0xa')],'defaultValue':![]},'transfertype':{'type':Sequelize['STRING'],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x0f0b('0x2')]},'transferuniqueid':{'type':Sequelize[_0x0f0b('0x2')]},'disposition':{'type':Sequelize[_0x0f0b('0x2')]},'queuecallerenterreason':{'type':Sequelize[_0x0f0b('0x9')],'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 7bf0655..9fb50dd 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 _0x1261=['includeAll','find','catch','create','body','describe','getVoiceQueuesReport','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','set','Content-Range','reject','save','update','destroy','then','end','error','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','filter','merge','where','type','options','VoiceQueueReport','count','include','findAll','rows','params'];(function(_0x5385ec,_0x11eef5){var _0x4753cb=function(_0x3e949d){while(--_0x3e949d){_0x5385ec['push'](_0x5385ec['shift']());}};_0x4753cb(++_0x11eef5);}(_0x1261,0x144));var _0x1126=function(_0x455555,_0x2147fd){_0x455555=_0x455555-0x0;var _0x3cb183=_0x1261[_0x455555];return _0x3cb183;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var db=require(_0x1126('0x16'))['db'];config[_0x1126('0x17')]=_[_0x1126('0x18')](config[_0x1126('0x17')],{'host':_0x1126('0x19'),'port':0x18eb});var socket=require(_0x1126('0x1a'))(new Redis(config[_0x1126('0x17')]));require(_0x1126('0x1b'))[_0x1126('0x1c')](socket);function respondWithStatusCode(_0x53a8f0,_0x5de9a7){_0x5de9a7=_0x5de9a7||0xcc;return function(_0x1af673){if(_0x1af673){return _0x53a8f0[_0x1126('0x1d')](_0x5de9a7);}return _0x53a8f0[_0x1126('0x1e')](_0x5de9a7)['end']();};}function respondWithResult(_0x45149c,_0x4794a7){_0x4794a7=_0x4794a7||0xc8;return function(_0x35fe9f){if(_0x35fe9f){return _0x45149c[_0x1126('0x1e')](_0x4794a7)[_0x1126('0x1f')](_0x35fe9f);}};}function respondWithFilteredResult(_0x4e1c97,_0x245cd7){return function(_0x1695f6){if(_0x1695f6){var _0x4a7b49=_0x1695f6['count'],_0x4d2b38=_0x245cd7['offset'],_0x22ae0b=_0x245cd7[_0x1126('0x20')]+_0x245cd7['limit'],_0x2b2487;if(_0x22ae0b>=_0x4a7b49){_0x22ae0b=_0x4a7b49;_0x2b2487=0xc8;}else{_0x2b2487=0xce;}_0x4e1c97[_0x1126('0x1e')](_0x2b2487);return _0x4e1c97[_0x1126('0x21')](_0x1126('0x22'),_0x4d2b38+'-'+_0x22ae0b+'/'+_0x4a7b49)['json'](_0x1695f6);}return null;};}function patchUpdates(_0x2a08ba){return function(_0x49d209){try{jsonpatch['apply'](_0x49d209,_0x2a08ba,!![]);}catch(_0x30f6b3){return BPromise[_0x1126('0x23')](_0x30f6b3);}return _0x49d209[_0x1126('0x24')]();};}function saveUpdates(_0x36d254,_0x526ca1){return function(_0x29ab60){if(_0x29ab60){return _0x29ab60[_0x1126('0x25')](_0x36d254)['then'](function(_0x2175fa){return _0x2175fa;});}return null;};}function removeEntity(_0x59cd8e,_0x529dd9){return function(_0x4b57ab){if(_0x4b57ab){return _0x4b57ab[_0x1126('0x26')]()[_0x1126('0x27')](function(){_0x59cd8e[_0x1126('0x1e')](0xcc)[_0x1126('0x28')]();});}};}function handleEntityNotFound(_0x566c09,_0x1b07a7){return function(_0xea0971){if(!_0xea0971){_0x566c09[_0x1126('0x1d')](0x194);}return _0xea0971;};}function handleError(_0x589725,_0x35eec3){_0x35eec3=_0x35eec3||0x1f4;return function(_0x375e59){logger[_0x1126('0x29')](_0x375e59['stack']);if(_0x375e59['name']){delete _0x375e59[_0x1126('0x2a')];}_0x589725[_0x1126('0x1e')](_0x35eec3)['send'](_0x375e59);};}exports[_0x1126('0x2b')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={},_0x4bf807={},_0xc62460={'count':0x0,'rows':[]};var _0x4bd50b=_[_0x1126('0x2c')](db['VoiceQueueReport'][_0x1126('0x2d')],function(_0x5f2611){return{'name':_0x5f2611['fieldName'],'type':_0x5f2611['type'][_0x1126('0x2e')]};});_0x4bf807[_0x1126('0x2f')]=_[_0x1126('0x2c')](_0x4bd50b,'name');_0x4bf807[_0x1126('0x30')]=_[_0x1126('0x31')](_0x23d2bc['query']);_0x4bf807[_0x1126('0x32')]=_[_0x1126('0x33')](_0x4bf807[_0x1126('0x2f')],_0x4bf807[_0x1126('0x30')]);_0x3fa694['attributes']=_['intersection'](_0x4bf807[_0x1126('0x2f')],qs[_0x1126('0x34')](_0x23d2bc[_0x1126('0x30')][_0x1126('0x34')]));_0x3fa694['attributes']=_0x3fa694[_0x1126('0x35')][_0x1126('0x36')]?_0x3fa694[_0x1126('0x35')]:_0x4bf807[_0x1126('0x2f')];if(!_0x23d2bc[_0x1126('0x30')]['hasOwnProperty'](_0x1126('0x37'))){_0x3fa694[_0x1126('0x38')]=qs[_0x1126('0x38')](_0x23d2bc[_0x1126('0x30')]['limit']);_0x3fa694['offset']=qs[_0x1126('0x20')](_0x23d2bc[_0x1126('0x30')]['offset']);}_0x3fa694[_0x1126('0x39')]=qs[_0x1126('0x3a')](_0x23d2bc[_0x1126('0x30')]['sort']);_0x3fa694['where']=qs[_0x1126('0x32')](_[_0x1126('0x3b')](_0x23d2bc[_0x1126('0x30')],_0x4bf807[_0x1126('0x32')]));if(_0x23d2bc['query'][_0x1126('0x3c')]){_0x3fa694['where']=_[_0x1126('0x3d')](_0x3fa694[_0x1126('0x3e')],{'$or':_[_0x1126('0x2c')](_0x4bd50b,function(_0x1ea702){if(_0x1ea702[_0x1126('0x3f')]!=='VIRTUAL'){var _0x1da59f={};_0x1da59f[_0x1ea702[_0x1126('0x2a')]]={'$like':'%'+_0x23d2bc[_0x1126('0x30')][_0x1126('0x3c')]+'%'};return _0x1da59f;}})});}_0x3fa694=_[_0x1126('0x3d')]({},_0x3fa694,_0x23d2bc[_0x1126('0x40')]);var _0x3052f9={'where':_0x3fa694['where']};return db[_0x1126('0x41')][_0x1126('0x42')](_0x3052f9)[_0x1126('0x27')](function(_0xf3a0bd){_0xc62460[_0x1126('0x42')]=_0xf3a0bd;if(_0x23d2bc['query']['includeAll']){_0x3fa694[_0x1126('0x43')]=[{'all':!![]}];}return db[_0x1126('0x41')][_0x1126('0x44')](_0x3fa694);})[_0x1126('0x27')](function(_0x18b496){_0xc62460[_0x1126('0x45')]=_0x18b496;return _0xc62460;})['then'](respondWithFilteredResult(_0x4a334a,_0x3fa694))['catch'](handleError(_0x4a334a,null));};exports['show']=function(_0xb8054e,_0x5d4194){var _0xf84005={'raw':![],'where':{'id':_0xb8054e[_0x1126('0x46')]['id']}},_0x462da8={};_0x462da8[_0x1126('0x2f')]=_['keys'](db['VoiceQueueReport'][_0x1126('0x2d')]);_0x462da8[_0x1126('0x30')]=_[_0x1126('0x31')](_0xb8054e['query']);_0x462da8[_0x1126('0x32')]=_['intersection'](_0x462da8[_0x1126('0x2f')],_0x462da8['query']);_0xf84005[_0x1126('0x35')]=_[_0x1126('0x33')](_0x462da8[_0x1126('0x2f')],qs['fields'](_0xb8054e[_0x1126('0x30')][_0x1126('0x34')]));_0xf84005[_0x1126('0x35')]=_0xf84005['attributes']['length']?_0xf84005['attributes']:_0x462da8[_0x1126('0x2f')];if(_0xb8054e['query'][_0x1126('0x47')]){_0xf84005['include']=[{'all':!![]}];}_0xf84005=_[_0x1126('0x3d')]({},_0xf84005,_0xb8054e[_0x1126('0x40')]);return db[_0x1126('0x41')][_0x1126('0x48')](_0xf84005)[_0x1126('0x27')](handleEntityNotFound(_0x5d4194,null))['then'](respondWithResult(_0x5d4194,null))[_0x1126('0x49')](handleError(_0x5d4194,null));};exports[_0x1126('0x4a')]=function(_0x5111d3,_0x1a15f8){return db[_0x1126('0x41')]['create'](_0x5111d3[_0x1126('0x4b')],{})[_0x1126('0x27')](respondWithResult(_0x1a15f8,0xc9))['catch'](handleError(_0x1a15f8,null));};exports[_0x1126('0x25')]=function(_0xbdde58,_0x213a76){if(_0xbdde58['body']['id']){delete _0xbdde58[_0x1126('0x4b')]['id'];}return db[_0x1126('0x41')][_0x1126('0x48')]({'where':{'id':_0xbdde58[_0x1126('0x46')]['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x213a76,null))[_0x1126('0x27')](saveUpdates(_0xbdde58[_0x1126('0x4b')],null))[_0x1126('0x27')](respondWithResult(_0x213a76,null))['catch'](handleError(_0x213a76,null));};exports[_0x1126('0x26')]=function(_0x5a2287,_0x40168e){return db[_0x1126('0x41')]['find']({'where':{'id':_0x5a2287['params']['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x40168e,null))[_0x1126('0x27')](removeEntity(_0x40168e,null))[_0x1126('0x49')](handleError(_0x40168e,null));};exports['describe']=function(_0x3cb44c,_0x3506d7){return db[_0x1126('0x41')][_0x1126('0x4c')]()['then'](respondWithResult(_0x3506d7,null))[_0x1126('0x49')](handleError(_0x3506d7,null));};exports[_0x1126('0x4d')]=function(_0x5c36b9,_0x4bcc08){var _0x4abb4d={},_0x526b07={},_0x386c10={'count':0x0,'rows':[]};_0x526b07[_0x1126('0x2f')]=_['keys'](db[_0x1126('0x41')][_0x1126('0x2d')]);_0x526b07[_0x1126('0x30')]=_[_0x1126('0x31')](_0x5c36b9[_0x1126('0x30')]);_0x526b07['filters']=_[_0x1126('0x33')](_0x526b07[_0x1126('0x2f')],_0x526b07['query']);_0x4abb4d[_0x1126('0x35')]=_[_0x1126('0x33')](_0x526b07[_0x1126('0x2f')],qs[_0x1126('0x34')](_0x5c36b9[_0x1126('0x30')]['fields']));_0x4abb4d[_0x1126('0x35')]=_0x4abb4d['attributes'][_0x1126('0x36')]?_0x4abb4d[_0x1126('0x35')]:_0x526b07[_0x1126('0x2f')];if(!_0x5c36b9['query'][_0x1126('0x4e')](_0x1126('0x37'))){_0x4abb4d['limit']=qs[_0x1126('0x38')](_0x5c36b9[_0x1126('0x30')][_0x1126('0x38')]);_0x4abb4d['offset']=qs[_0x1126('0x20')](_0x5c36b9[_0x1126('0x30')][_0x1126('0x20')]);}_0x4abb4d[_0x1126('0x39')]=qs[_0x1126('0x3a')](_0x5c36b9[_0x1126('0x30')][_0x1126('0x3a')]);_0x4abb4d[_0x1126('0x3e')]=qs['filters'](_[_0x1126('0x3b')](_0x5c36b9[_0x1126('0x30')],_0x526b07[_0x1126('0x32')]));if(_0x5c36b9[_0x1126('0x30')][_0x1126('0x3c')]){_0x4abb4d['where']=_[_0x1126('0x3d')](_0x4abb4d[_0x1126('0x3e')],{'$or':_['map'](_0x4abb4d[_0x1126('0x35')],function(_0x5246aa){var _0x272274={};_0x272274[_0x5246aa]={'$like':'%'+_0x5c36b9[_0x1126('0x30')]['filter']+'%'};return _0x272274;})});}_0x4abb4d=_[_0x1126('0x3d')]({},_0x4abb4d,_0x5c36b9[_0x1126('0x40')]);var _0x375b76={'where':_0x4abb4d['where']};return db[_0x1126('0x41')]['count'](_0x375b76)['then'](function(_0xbdc58){_0x386c10[_0x1126('0x42')]=_0xbdc58;if(_0x5c36b9[_0x1126('0x30')][_0x1126('0x47')]){_0x4abb4d[_0x1126('0x43')]=[{'all':!![]}];}return db[_0x1126('0x41')][_0x1126('0x44')](_0x4abb4d);})['then'](function(_0x191307){_0x386c10[_0x1126('0x45')]=_0x191307;return _0x386c10;})[_0x1126('0x27')](respondWithFilteredResult(_0x4bcc08,_0x4abb4d,_0x1126('0x4d')))[_0x1126('0x49')](handleError(_0x4bcc08,null,_0x1126('0x4d')));}; \ No newline at end of file +var _0x7a54=['hasOwnProperty','order','sort','where','pick','filter','merge','type','VIRTUAL','VoiceQueueReport','includeAll','include','findAll','rows','catch','show','keys','options','find','create','body','params','describe','getVoiceQueuesReport','intersection','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','count','offset','limit','set','json','apply','reject','update','destroy','then','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','filters','attributes','fields','length'];(function(_0x19b3f9,_0xade753){var _0x18c3f6=function(_0x21439f){while(--_0x21439f){_0x19b3f9['push'](_0x19b3f9['shift']());}};_0x18c3f6(++_0xade753);}(_0x7a54,0x106));var _0x47a5=function(_0x58d55c,_0x24767b){_0x58d55c=_0x58d55c-0x0;var _0x4d5746=_0x7a54[_0x58d55c];return _0x4d5746;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];config[_0x47a5('0x15')]=_[_0x47a5('0x16')](config[_0x47a5('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0x47a5('0x17'))(new Redis(config[_0x47a5('0x15')]));require(_0x47a5('0x18'))[_0x47a5('0x19')](socket);function respondWithStatusCode(_0x139f25,_0x620ee9){_0x620ee9=_0x620ee9||0xcc;return function(_0x3c6c46){if(_0x3c6c46){return _0x139f25[_0x47a5('0x1a')](_0x620ee9);}return _0x139f25['status'](_0x620ee9)[_0x47a5('0x1b')]();};}function respondWithResult(_0x11faf5,_0x3b001e){_0x3b001e=_0x3b001e||0xc8;return function(_0x2a2cbb){if(_0x2a2cbb){return _0x11faf5[_0x47a5('0x1c')](_0x3b001e)['json'](_0x2a2cbb);}};}function respondWithFilteredResult(_0x549de3,_0x138bc0){return function(_0x4b966e){if(_0x4b966e){var _0x5247fd=_0x4b966e[_0x47a5('0x1d')],_0x423a81=_0x138bc0[_0x47a5('0x1e')],_0xaf70a6=_0x138bc0[_0x47a5('0x1e')]+_0x138bc0[_0x47a5('0x1f')],_0x2ce454;if(_0xaf70a6>=_0x5247fd){_0xaf70a6=_0x5247fd;_0x2ce454=0xc8;}else{_0x2ce454=0xce;}_0x549de3[_0x47a5('0x1c')](_0x2ce454);return _0x549de3[_0x47a5('0x20')]('Content-Range',_0x423a81+'-'+_0xaf70a6+'/'+_0x5247fd)[_0x47a5('0x21')](_0x4b966e);}return null;};}function patchUpdates(_0xf160ba){return function(_0x47cf3c){try{jsonpatch[_0x47a5('0x22')](_0x47cf3c,_0xf160ba,!![]);}catch(_0x1f03f7){return BPromise[_0x47a5('0x23')](_0x1f03f7);}return _0x47cf3c['save']();};}function saveUpdates(_0xb8ae6c,_0x2f142b){return function(_0x23db32){if(_0x23db32){return _0x23db32[_0x47a5('0x24')](_0xb8ae6c)['then'](function(_0xe2dea9){return _0xe2dea9;});}return null;};}function removeEntity(_0x385687,_0x513981){return function(_0x28747d){if(_0x28747d){return _0x28747d[_0x47a5('0x25')]()[_0x47a5('0x26')](function(){_0x385687[_0x47a5('0x1c')](0xcc)[_0x47a5('0x1b')]();});}};}function handleEntityNotFound(_0x50bf17,_0x53078a){return function(_0x136745){if(!_0x136745){_0x50bf17['sendStatus'](0x194);}return _0x136745;};}function handleError(_0x1ea9c8,_0x5b6c4e){_0x5b6c4e=_0x5b6c4e||0x1f4;return function(_0x23cb77){logger[_0x47a5('0x27')](_0x23cb77[_0x47a5('0x28')]);if(_0x23cb77[_0x47a5('0x29')]){delete _0x23cb77[_0x47a5('0x29')];}_0x1ea9c8[_0x47a5('0x1c')](_0x5b6c4e)[_0x47a5('0x2a')](_0x23cb77);};}exports[_0x47a5('0x2b')]=function(_0x16631f,_0x361bfa){var _0x1127f8={},_0x11a4fa={},_0x3ad507={'count':0x0,'rows':[]};var _0x528582=_[_0x47a5('0x2c')](db['VoiceQueueReport'][_0x47a5('0x2d')],function(_0x9ac908){return{'name':_0x9ac908[_0x47a5('0x2e')],'type':_0x9ac908['type'][_0x47a5('0x2f')]};});_0x11a4fa[_0x47a5('0x30')]=_[_0x47a5('0x2c')](_0x528582,_0x47a5('0x29'));_0x11a4fa['query']=_['keys'](_0x16631f[_0x47a5('0x31')]);_0x11a4fa[_0x47a5('0x32')]=_['intersection'](_0x11a4fa['model'],_0x11a4fa[_0x47a5('0x31')]);_0x1127f8[_0x47a5('0x33')]=_['intersection'](_0x11a4fa[_0x47a5('0x30')],qs['fields'](_0x16631f[_0x47a5('0x31')][_0x47a5('0x34')]));_0x1127f8['attributes']=_0x1127f8['attributes'][_0x47a5('0x35')]?_0x1127f8['attributes']:_0x11a4fa[_0x47a5('0x30')];if(!_0x16631f[_0x47a5('0x31')][_0x47a5('0x36')]('nolimit')){_0x1127f8[_0x47a5('0x1f')]=qs['limit'](_0x16631f['query'][_0x47a5('0x1f')]);_0x1127f8['offset']=qs[_0x47a5('0x1e')](_0x16631f['query'][_0x47a5('0x1e')]);}_0x1127f8[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0x16631f[_0x47a5('0x31')][_0x47a5('0x38')]);_0x1127f8[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0x16631f[_0x47a5('0x31')],_0x11a4fa['filters']));if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x1127f8['where']=_[_0x47a5('0x3c')](_0x1127f8[_0x47a5('0x39')],{'$or':_[_0x47a5('0x2c')](_0x528582,function(_0x49c4b5){if(_0x49c4b5[_0x47a5('0x3d')]!==_0x47a5('0x3e')){var _0x596097={};_0x596097[_0x49c4b5[_0x47a5('0x29')]]={'$like':'%'+_0x16631f[_0x47a5('0x31')]['filter']+'%'};return _0x596097;}})});}_0x1127f8=_['merge']({},_0x1127f8,_0x16631f['options']);var _0x12d9f2={'where':_0x1127f8['where']};return db[_0x47a5('0x3f')][_0x47a5('0x1d')](_0x12d9f2)[_0x47a5('0x26')](function(_0x111f0d){_0x3ad507[_0x47a5('0x1d')]=_0x111f0d;if(_0x16631f[_0x47a5('0x31')][_0x47a5('0x40')]){_0x1127f8[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x1127f8);})[_0x47a5('0x26')](function(_0x1658e8){_0x3ad507[_0x47a5('0x43')]=_0x1658e8;return _0x3ad507;})['then'](respondWithFilteredResult(_0x361bfa,_0x1127f8))[_0x47a5('0x44')](handleError(_0x361bfa,null));};exports[_0x47a5('0x45')]=function(_0x331474,_0x23bd8d){var _0x586f4f={'raw':![],'where':{'id':_0x331474['params']['id']}},_0x7de536={};_0x7de536['model']=_['keys'](db['VoiceQueueReport'][_0x47a5('0x2d')]);_0x7de536['query']=_[_0x47a5('0x46')](_0x331474[_0x47a5('0x31')]);_0x7de536[_0x47a5('0x32')]=_['intersection'](_0x7de536[_0x47a5('0x30')],_0x7de536[_0x47a5('0x31')]);_0x586f4f['attributes']=_['intersection'](_0x7de536[_0x47a5('0x30')],qs['fields'](_0x331474[_0x47a5('0x31')][_0x47a5('0x34')]));_0x586f4f[_0x47a5('0x33')]=_0x586f4f[_0x47a5('0x33')][_0x47a5('0x35')]?_0x586f4f[_0x47a5('0x33')]:_0x7de536[_0x47a5('0x30')];if(_0x331474[_0x47a5('0x31')][_0x47a5('0x40')]){_0x586f4f[_0x47a5('0x41')]=[{'all':!![]}];}_0x586f4f=_[_0x47a5('0x3c')]({},_0x586f4f,_0x331474[_0x47a5('0x47')]);return db[_0x47a5('0x3f')][_0x47a5('0x48')](_0x586f4f)[_0x47a5('0x26')](handleEntityNotFound(_0x23bd8d,null))[_0x47a5('0x26')](respondWithResult(_0x23bd8d,null))['catch'](handleError(_0x23bd8d,null));};exports[_0x47a5('0x49')]=function(_0x23bb04,_0x49eab1){return db['VoiceQueueReport'][_0x47a5('0x49')](_0x23bb04['body'],{})[_0x47a5('0x26')](respondWithResult(_0x49eab1,0xc9))[_0x47a5('0x44')](handleError(_0x49eab1,null));};exports['update']=function(_0x4f62d3,_0x3d85cc){if(_0x4f62d3['body']['id']){delete _0x4f62d3[_0x47a5('0x4a')]['id'];}return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x4f62d3[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x3d85cc,null))[_0x47a5('0x26')](saveUpdates(_0x4f62d3[_0x47a5('0x4a')],null))['then'](respondWithResult(_0x3d85cc,null))['catch'](handleError(_0x3d85cc,null));};exports[_0x47a5('0x25')]=function(_0x411230,_0x1163e3){return db[_0x47a5('0x3f')][_0x47a5('0x48')]({'where':{'id':_0x411230[_0x47a5('0x4b')]['id']}})[_0x47a5('0x26')](handleEntityNotFound(_0x1163e3,null))['then'](removeEntity(_0x1163e3,null))[_0x47a5('0x44')](handleError(_0x1163e3,null));};exports[_0x47a5('0x4c')]=function(_0x5f6a,_0x5c3c75){return db[_0x47a5('0x3f')]['describe']()[_0x47a5('0x26')](respondWithResult(_0x5c3c75,null))[_0x47a5('0x44')](handleError(_0x5c3c75,null));};exports[_0x47a5('0x4d')]=function(_0xf03bd5,_0x588551){var _0x3adf14={},_0x1e6de3={},_0x2f66e9={'count':0x0,'rows':[]};_0x1e6de3[_0x47a5('0x30')]=_[_0x47a5('0x46')](db[_0x47a5('0x3f')][_0x47a5('0x2d')]);_0x1e6de3['query']=_[_0x47a5('0x46')](_0xf03bd5[_0x47a5('0x31')]);_0x1e6de3[_0x47a5('0x32')]=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],_0x1e6de3[_0x47a5('0x31')]);_0x3adf14['attributes']=_[_0x47a5('0x4e')](_0x1e6de3[_0x47a5('0x30')],qs[_0x47a5('0x34')](_0xf03bd5['query'][_0x47a5('0x34')]));_0x3adf14[_0x47a5('0x33')]=_0x3adf14[_0x47a5('0x33')]['length']?_0x3adf14['attributes']:_0x1e6de3[_0x47a5('0x30')];if(!_0xf03bd5[_0x47a5('0x31')]['hasOwnProperty']('nolimit')){_0x3adf14[_0x47a5('0x1f')]=qs['limit'](_0xf03bd5[_0x47a5('0x31')]['limit']);_0x3adf14['offset']=qs[_0x47a5('0x1e')](_0xf03bd5[_0x47a5('0x31')]['offset']);}_0x3adf14[_0x47a5('0x37')]=qs[_0x47a5('0x38')](_0xf03bd5['query']['sort']);_0x3adf14[_0x47a5('0x39')]=qs[_0x47a5('0x32')](_[_0x47a5('0x3a')](_0xf03bd5[_0x47a5('0x31')],_0x1e6de3['filters']));if(_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]){_0x3adf14[_0x47a5('0x39')]=_['merge'](_0x3adf14[_0x47a5('0x39')],{'$or':_['map'](_0x3adf14[_0x47a5('0x33')],function(_0x470da6){var _0x943a15={};_0x943a15[_0x470da6]={'$like':'%'+_0xf03bd5[_0x47a5('0x31')][_0x47a5('0x3b')]+'%'};return _0x943a15;})});}_0x3adf14=_['merge']({},_0x3adf14,_0xf03bd5[_0x47a5('0x47')]);var _0x5d1550={'where':_0x3adf14['where']};return db['VoiceQueueReport']['count'](_0x5d1550)[_0x47a5('0x26')](function(_0x6cd4ea){_0x2f66e9[_0x47a5('0x1d')]=_0x6cd4ea;if(_0xf03bd5['query']['includeAll']){_0x3adf14[_0x47a5('0x41')]=[{'all':!![]}];}return db[_0x47a5('0x3f')][_0x47a5('0x42')](_0x3adf14);})[_0x47a5('0x26')](function(_0xc45e25){_0x2f66e9['rows']=_0xc45e25;return _0x2f66e9;})[_0x47a5('0x26')](respondWithFilteredResult(_0x588551,_0x3adf14,'getVoiceQueuesReport'))[_0x47a5('0x44')](handleError(_0x588551,null,_0x47a5('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 0a47e9c..a31ca43 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 _0xa374=['emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x641afe,_0x22d726){var _0x2dfe9a=function(_0x33a370){while(--_0x33a370){_0x641afe['push'](_0x641afe['shift']());}};_0x2dfe9a(++_0x22d726);}(_0xa374,0x16b));var _0x4a37=function(_0x27b9d1,_0x207bfe){_0x27b9d1=_0x27b9d1-0x0;var _0x3f9cca=_0xa374[_0x27b9d1];return _0x3f9cca;};'use strict';var EventEmitter=require(_0x4a37('0x0'));var VoiceQueueReport=require(_0x4a37('0x1'))['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x4a37('0x2')](0x0);var events={'afterCreate':_0x4a37('0x3'),'afterUpdate':_0x4a37('0x4'),'afterDestroy':_0x4a37('0x5')};function emitEvent(_0x1d250b){return function(_0x669182,_0x3e228e,_0x474a8d){VoiceQueueReportEvents[_0x4a37('0x6')](_0x1d250b+':'+_0x669182['id'],_0x669182);VoiceQueueReportEvents[_0x4a37('0x6')](_0x1d250b,_0x669182);_0x474a8d(null);};}for(var e in events){if(events[_0x4a37('0x7')](e)){var event=events[e];VoiceQueueReport['hook'](e,emitEvent(event));}}module[_0x4a37('0x8')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x3c7e=['events','save','update','emit','hasOwnProperty','hook','exports'];(function(_0x4282cd,_0x2a3eb3){var _0x521637=function(_0x2ad772){while(--_0x2ad772){_0x4282cd['push'](_0x4282cd['shift']());}};_0x521637(++_0x2a3eb3);}(_0x3c7e,0x1e3));var _0xe3c7=function(_0x33ab79,_0x4f7c50){_0x33ab79=_0x33ab79-0x0;var _0x10ac00=_0x3c7e[_0x33ab79];return _0x10ac00;};'use strict';var EventEmitter=require(_0xe3c7('0x0'));var VoiceQueueReport=require('../../mysqldb')['db']['VoiceQueueReport'];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe3c7('0x1'),'afterUpdate':_0xe3c7('0x2'),'afterDestroy':'remove'};function emitEvent(_0x348fe0){return function(_0x3d8bd6,_0x5eb3f3,_0x3691eb){VoiceQueueReportEvents['emit'](_0x348fe0+':'+_0x3d8bd6['id'],_0x3d8bd6);VoiceQueueReportEvents[_0xe3c7('0x3')](_0x348fe0,_0x3d8bd6);_0x3691eb(null);};}for(var e in events){if(events[_0xe3c7('0x4')](e)){var event=events[e];VoiceQueueReport[_0xe3c7('0x5')](e,emitEvent(event));}}module[_0xe3c7('0x6')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 584b1e2..66b6dad 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(_0x867c03,_0x5f532d){var _0x760969=function(_0xd23675){while(--_0xd23675){_0x867c03['push'](_0x867c03['shift']());}};_0x760969(++_0x5f532d);}(_0xb10b,0x12a));var _0xbb10=function(_0x34bff6,_0x36f01d){_0x34bff6=_0x34bff6-0x0;var _0x2704ee=_0xb10b[_0x34bff6];return _0x2704ee;};'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 _0x2032=['./voiceQueueReport.attributes','exports','define','VoiceQueueReport','report_queue','uniqueid','calleridnum','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0xda6ad1,_0x5f09e3){var _0xedc3a5=function(_0x5459d7){while(--_0x5459d7){_0xda6ad1['push'](_0xda6ad1['shift']());}};_0xedc3a5(++_0x5f09e3);}(_0x2032,0xd9));var _0x2203=function(_0x273de4,_0x465127){_0x273de4=_0x273de4-0x0;var _0x4f601e=_0x2032[_0x273de4];return _0x4f601e;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[{'fields':[_0x2203('0xc')]},{'fields':[_0x2203('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 3992a15..5ff45ec 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 _0xbbc7=['VoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','socket.io-emitter','./voiceQueueReport.socket','register','request','then','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueueReport,\x20%s,\x20%s','message','info','catch','GetVoiceQueueReport'];(function(_0x571578,_0xf9c2c2){var _0x20f500=function(_0x540f46){while(--_0x540f46){_0x571578['push'](_0x571578['shift']());}};_0x20f500(++_0xf9c2c2);}(_0xbbc7,0xb2));var _0x7bbc=function(_0x26ce77,_0x5b0150){_0x26ce77=_0x26ce77-0x0;var _0x5cb3f6=_0xbbc7[_0x26ce77];return _0x5cb3f6;};'use strict';var _=require(_0x7bbc('0x0'));var util=require(_0x7bbc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7bbc('0x2'));var fs=require('fs');var Redis=require(_0x7bbc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7bbc('0x4'));var logger=require(_0x7bbc('0x5'))(_0x7bbc('0x6'));var config=require(_0x7bbc('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7bbc('0x8')][_0x7bbc('0x9')]({'port':0x232a});config[_0x7bbc('0xa')]=_['defaults'](config[_0x7bbc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x7bbc('0xb'))(new Redis(config[_0x7bbc('0xa')]));require(_0x7bbc('0xc'))[_0x7bbc('0xd')](socket);function respondWithRpcPromise(_0x97b64b,_0x37237d,_0x188970){return new BPromise(function(_0x3f5204,_0x1a0d7a){return client[_0x7bbc('0xe')](_0x97b64b,_0x188970)[_0x7bbc('0xf')](function(_0x172f24){logger['info']('VoiceQueueReport,\x20%s,\x20%s',_0x37237d,_0x7bbc('0x10'));logger[_0x7bbc('0x11')](_0x7bbc('0x12'),_0x37237d,_0x7bbc('0x10'),JSON[_0x7bbc('0x13')](_0x172f24));if(_0x172f24['error']){if(_0x172f24[_0x7bbc('0x14')][_0x7bbc('0x15')]===0x1f4){logger[_0x7bbc('0x14')](_0x7bbc('0x16'),_0x37237d,_0x172f24[_0x7bbc('0x14')]['message']);return _0x1a0d7a(_0x172f24['error'][_0x7bbc('0x17')]);}logger[_0x7bbc('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x37237d,_0x172f24[_0x7bbc('0x14')][_0x7bbc('0x17')]);return _0x3f5204(_0x172f24['error'][_0x7bbc('0x17')]);}else{logger[_0x7bbc('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x37237d,_0x7bbc('0x10'));_0x3f5204(_0x172f24['result']['message']);}})[_0x7bbc('0x19')](function(_0x377a8f){logger[_0x7bbc('0x14')](_0x7bbc('0x16'),_0x37237d,_0x377a8f);_0x1a0d7a(_0x377a8f);});});}exports[_0x7bbc('0x1a')]=function(_0x5bb1e5){var _0x5afe4b=this;return new Promise(function(_0x43443c,_0x224d4c){return db[_0x7bbc('0x1b')][_0x7bbc('0x1c')]({'raw':_0x5bb1e5[_0x7bbc('0x1d')]?_0x5bb1e5['options'][_0x7bbc('0x1e')]===undefined?!![]:![]:!![],'where':_0x5bb1e5[_0x7bbc('0x1d')]?_0x5bb1e5[_0x7bbc('0x1d')][_0x7bbc('0x1f')]||null:null,'attributes':_0x5bb1e5[_0x7bbc('0x1d')]?_0x5bb1e5[_0x7bbc('0x1d')][_0x7bbc('0x20')]||null:null,'limit':_0x5bb1e5['options']?_0x5bb1e5[_0x7bbc('0x1d')][_0x7bbc('0x21')]||null:null,'include':_0x5bb1e5[_0x7bbc('0x1d')]?_0x5bb1e5[_0x7bbc('0x1d')][_0x7bbc('0x22')]?_[_0x7bbc('0x23')](_0x5bb1e5[_0x7bbc('0x1d')][_0x7bbc('0x22')],function(_0x345ba4){return{'model':db[_0x345ba4['model']],'as':_0x345ba4['as'],'attributes':_0x345ba4['attributes'],'include':_0x345ba4[_0x7bbc('0x22')]?_[_0x7bbc('0x23')](_0x345ba4[_0x7bbc('0x22')],function(_0x48badd){return{'model':db[_0x48badd[_0x7bbc('0x24')]],'as':_0x48badd['as'],'attributes':_0x48badd[_0x7bbc('0x20')],'include':_0x48badd[_0x7bbc('0x22')]?_[_0x7bbc('0x23')](_0x48badd[_0x7bbc('0x22')],function(_0x1c975e){return{'model':db[_0x1c975e[_0x7bbc('0x24')]],'as':_0x1c975e['as'],'attributes':_0x1c975e[_0x7bbc('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2403cd){logger[_0x7bbc('0x18')](_0x7bbc('0x1a'),_0x5bb1e5);logger[_0x7bbc('0x11')](_0x7bbc('0x1a'),_0x5bb1e5,JSON[_0x7bbc('0x13')](_0x2403cd));_0x43443c(_0x2403cd);})[_0x7bbc('0x19')](function(_0x136a9a){logger[_0x7bbc('0x14')](_0x7bbc('0x1a'),_0x136a9a[_0x7bbc('0x17')],_0x5bb1e5);_0x224d4c(_0x5afe4b[_0x7bbc('0x14')](0x1f4,_0x136a9a[_0x7bbc('0x17')]));});});};exports[_0x7bbc('0x25')]=function(_0x247ef2){var _0x21aefe=this;return new Promise(function(_0x586ab1,_0x579b65){return db[_0x7bbc('0x1b')][_0x7bbc('0x26')](_0x247ef2[_0x7bbc('0x27')],{'raw':_0x247ef2[_0x7bbc('0x1d')]?_0x247ef2[_0x7bbc('0x1d')][_0x7bbc('0x1e')]===undefined?!![]:![]:!![]})[_0x7bbc('0xf')](function(_0x519e37){logger[_0x7bbc('0x18')](_0x7bbc('0x25'),_0x247ef2);logger[_0x7bbc('0x11')]('CreateVoiceQueueReport',_0x247ef2,JSON['stringify'](_0x519e37));_0x586ab1(_0x519e37);})[_0x7bbc('0x19')](function(_0x1ee0ce){logger[_0x7bbc('0x14')](_0x7bbc('0x25'),_0x1ee0ce[_0x7bbc('0x17')],_0x247ef2);_0x579b65(_0x21aefe[_0x7bbc('0x14')](0x1f4,_0x1ee0ce[_0x7bbc('0x17')]));});});};exports[_0x7bbc('0x28')]=function(_0x28b7c2){var _0x165c2d=this;return new Promise(function(_0x5f25e6,_0x1c5dcb){return db[_0x7bbc('0x1b')]['update'](_0x28b7c2[_0x7bbc('0x27')],{'raw':_0x28b7c2['options']?_0x28b7c2[_0x7bbc('0x1d')][_0x7bbc('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28b7c2['options']?_0x28b7c2[_0x7bbc('0x1d')]['where']||null:null,'attributes':_0x28b7c2['options']?_0x28b7c2[_0x7bbc('0x1d')][_0x7bbc('0x20')]||null:null,'limit':_0x28b7c2[_0x7bbc('0x1d')]?_0x28b7c2['options'][_0x7bbc('0x21')]||null:null})[_0x7bbc('0xf')](function(_0x545acd){logger[_0x7bbc('0x18')](_0x7bbc('0x28'),_0x28b7c2);logger[_0x7bbc('0x11')](_0x7bbc('0x28'),_0x28b7c2,JSON[_0x7bbc('0x13')](_0x545acd));_0x5f25e6(_0x545acd);})[_0x7bbc('0x19')](function(_0x27c3c9){logger[_0x7bbc('0x14')](_0x7bbc('0x28'),_0x27c3c9[_0x7bbc('0x17')],_0x28b7c2);_0x1c5dcb(_0x165c2d[_0x7bbc('0x14')](0x1f4,_0x27c3c9['message']));});});}; \ No newline at end of file +var _0x539e=['redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','where','attributes','map','include','model','VoiceQueueReport','create','body','raw','CreateVoiceQueueReport','stringify','update','UpdateVoiceQueueReport','lodash','util','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);}(_0x539e,0xa6));var _0xe539=function(_0x139c5a,_0x25e213){_0x139c5a=_0x139c5a-0x0;var _0xeb821b=_0x539e[_0x139c5a];return _0xeb821b;};'use strict';var _=require(_0xe539('0x0'));var util=require(_0xe539('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe539('0x2'));var db=require(_0xe539('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xe539('0x4'))(_0xe539('0x5'));var config=require(_0xe539('0x6'));var jayson=require(_0xe539('0x7'));var client=jayson[_0xe539('0x8')][_0xe539('0x9')]({'port':0x232a});config[_0xe539('0xa')]=_[_0xe539('0xb')](config[_0xe539('0xa')],{'host':_0xe539('0xc'),'port':0x18eb});var socket=require(_0xe539('0xd'))(new Redis(config[_0xe539('0xa')]));require(_0xe539('0xe'))[_0xe539('0xf')](socket);function respondWithRpcPromise(_0x54bd71,_0x5ddc6b,_0x57c8d9){return new BPromise(function(_0x40123e,_0x5c33c5){return client[_0xe539('0x10')](_0x54bd71,_0x57c8d9)[_0xe539('0x11')](function(_0x5a010b){logger[_0xe539('0x12')](_0xe539('0x13'),_0x5ddc6b,'request\x20sent');logger[_0xe539('0x14')](_0xe539('0x15'),_0x5ddc6b,_0xe539('0x16'),JSON['stringify'](_0x5a010b));if(_0x5a010b[_0xe539('0x17')]){if(_0x5a010b[_0xe539('0x17')][_0xe539('0x18')]===0x1f4){logger[_0xe539('0x17')](_0xe539('0x13'),_0x5ddc6b,_0x5a010b[_0xe539('0x17')][_0xe539('0x19')]);return _0x5c33c5(_0x5a010b['error'][_0xe539('0x19')]);}logger['error'](_0xe539('0x13'),_0x5ddc6b,_0x5a010b[_0xe539('0x17')]['message']);return _0x40123e(_0x5a010b['error'][_0xe539('0x19')]);}else{logger[_0xe539('0x12')]('VoiceQueueReport,\x20%s,\x20%s',_0x5ddc6b,_0xe539('0x16'));_0x40123e(_0x5a010b[_0xe539('0x1a')][_0xe539('0x19')]);}})[_0xe539('0x1b')](function(_0x6043db){logger['error'](_0xe539('0x13'),_0x5ddc6b,_0x6043db);_0x5c33c5(_0x6043db);});});}exports[_0xe539('0x1c')]=function(_0x322ffc){var _0x3a75a9=this;return new Promise(function(_0x4e1957,_0x3ca27c){return db['VoiceQueueReport'][_0xe539('0x1d')]({'raw':_0x322ffc[_0xe539('0x1e')]?_0x322ffc[_0xe539('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x322ffc[_0xe539('0x1e')]?_0x322ffc[_0xe539('0x1e')][_0xe539('0x1f')]||null:null,'attributes':_0x322ffc[_0xe539('0x1e')]?_0x322ffc['options'][_0xe539('0x20')]||null:null,'limit':_0x322ffc['options']?_0x322ffc['options']['limit']||null:null,'include':_0x322ffc[_0xe539('0x1e')]?_0x322ffc[_0xe539('0x1e')]['include']?_[_0xe539('0x21')](_0x322ffc['options'][_0xe539('0x22')],function(_0x3b6384){return{'model':db[_0x3b6384['model']],'as':_0x3b6384['as'],'attributes':_0x3b6384[_0xe539('0x20')],'include':_0x3b6384[_0xe539('0x22')]?_[_0xe539('0x21')](_0x3b6384[_0xe539('0x22')],function(_0x45d1ee){return{'model':db[_0x45d1ee[_0xe539('0x23')]],'as':_0x45d1ee['as'],'attributes':_0x45d1ee[_0xe539('0x20')],'include':_0x45d1ee[_0xe539('0x22')]?_[_0xe539('0x21')](_0x45d1ee[_0xe539('0x22')],function(_0x59f1ea){return{'model':db[_0x59f1ea['model']],'as':_0x59f1ea['as'],'attributes':_0x59f1ea[_0xe539('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe539('0x11')](function(_0x4b919a){logger[_0xe539('0x12')](_0xe539('0x1c'),_0x322ffc);logger[_0xe539('0x14')](_0xe539('0x1c'),_0x322ffc,JSON['stringify'](_0x4b919a));_0x4e1957(_0x4b919a);})[_0xe539('0x1b')](function(_0x3f50d6){logger[_0xe539('0x17')]('GetVoiceQueueReport',_0x3f50d6[_0xe539('0x19')],_0x322ffc);_0x3ca27c(_0x3a75a9[_0xe539('0x17')](0x1f4,_0x3f50d6[_0xe539('0x19')]));});});};exports['CreateVoiceQueueReport']=function(_0x2ed647){var _0x4d693e=this;return new Promise(function(_0xaa026a,_0x281099){return db[_0xe539('0x24')][_0xe539('0x25')](_0x2ed647[_0xe539('0x26')],{'raw':_0x2ed647[_0xe539('0x1e')]?_0x2ed647[_0xe539('0x1e')][_0xe539('0x27')]===undefined?!![]:![]:!![]})[_0xe539('0x11')](function(_0x58b370){logger['info'](_0xe539('0x28'),_0x2ed647);logger[_0xe539('0x14')]('CreateVoiceQueueReport',_0x2ed647,JSON[_0xe539('0x29')](_0x58b370));_0xaa026a(_0x58b370);})[_0xe539('0x1b')](function(_0x3ff4f1){logger[_0xe539('0x17')](_0xe539('0x28'),_0x3ff4f1['message'],_0x2ed647);_0x281099(_0x4d693e[_0xe539('0x17')](0x1f4,_0x3ff4f1['message']));});});};exports['UpdateVoiceQueueReport']=function(_0x12cb17){var _0x4e0a51=this;return new Promise(function(_0x4ddc19,_0x13659f){return db[_0xe539('0x24')][_0xe539('0x2a')](_0x12cb17[_0xe539('0x26')],{'raw':_0x12cb17['options']?_0x12cb17[_0xe539('0x1e')][_0xe539('0x27')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x12cb17[_0xe539('0x1e')]?_0x12cb17[_0xe539('0x1e')][_0xe539('0x1f')]||null:null,'attributes':_0x12cb17[_0xe539('0x1e')]?_0x12cb17[_0xe539('0x1e')][_0xe539('0x20')]||null:null,'limit':_0x12cb17[_0xe539('0x1e')]?_0x12cb17[_0xe539('0x1e')]['limit']||null:null})['then'](function(_0x53a803){logger[_0xe539('0x12')]('UpdateVoiceQueueReport',_0x12cb17);logger[_0xe539('0x14')](_0xe539('0x2b'),_0x12cb17,JSON[_0xe539('0x29')](_0x53a803));_0x4ddc19(_0x53a803);})[_0xe539('0x1b')](function(_0x3c3beb){logger['error']('UpdateVoiceQueueReport',_0x3c3beb[_0xe539('0x19')],_0x12cb17);_0x13659f(_0x4e0a51[_0xe539('0x17')](0x1f4,_0x3c3beb[_0xe539('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 55b31ba..e5f0794 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 _0xf53f=['remove','update','emit','removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','save'];(function(_0x4c528d,_0x38a3c4){var _0x63eb92=function(_0x533a38){while(--_0x533a38){_0x4c528d['push'](_0x4c528d['shift']());}};_0x63eb92(++_0x38a3c4);}(_0xf53f,0x142));var _0xff53=function(_0x23a03a,_0x15ffa6){_0x23a03a=_0x23a03a-0x0;var _0xd6fe72=_0xf53f[_0x23a03a];return _0xd6fe72;};'use strict';var VoiceQueueReportEvents=require(_0xff53('0x0'));var events=[_0xff53('0x1'),_0xff53('0x2'),_0xff53('0x3')];function createListener(_0x34bd4d,_0x31149b){return function(_0x25fdf8){_0x31149b[_0xff53('0x4')](_0x34bd4d,_0x25fdf8);};}function removeListener(_0x3b7670,_0x91b1d9){return function(){VoiceQueueReportEvents[_0xff53('0x5')](_0x3b7670,_0x91b1d9);};}exports[_0xff53('0x6')]=function(_0x50e67a){for(var _0x2c953c=0x0,_0x4152c2=events[_0xff53('0x7')];_0x2c953c<_0x4152c2;_0x2c953c++){var _0x3d48ca=events[_0x2c953c];var _0x3ed4a4=createListener(_0xff53('0x8')+_0x3d48ca,_0x50e67a);VoiceQueueReportEvents['on'](_0x3d48ca,_0x3ed4a4);}}; \ No newline at end of file +var _0x295d=['register','save','remove','emit'];(function(_0x592df4,_0x4e719b){var _0x3b4fe4=function(_0x5ebf53){while(--_0x5ebf53){_0x592df4['push'](_0x592df4['shift']());}};_0x3b4fe4(++_0x4e719b);}(_0x295d,0xcd));var _0xd295=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0x295d[_0x30ae5e];return _0x1f2e93;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0xd295('0x0'),_0xd295('0x1'),'update'];function createListener(_0x2720c3,_0x439b66){return function(_0x28a85b){_0x439b66[_0xd295('0x2')](_0x2720c3,_0x28a85b);};}function removeListener(_0x8cfc6c,_0x335def){return function(){VoiceQueueReportEvents['removeListener'](_0x8cfc6c,_0x335def);};}exports[_0xd295('0x3')]=function(_0x524ca8){for(var _0x23c6ed=0x0,_0x4a58b2=events['length'];_0x23c6ed<_0x4a58b2;_0x23c6ed++){var _0x26597d=events[_0x23c6ed];var _0x4a15b9=createListener('voiceQueueReport:'+_0x26597d,_0x524ca8);VoiceQueueReportEvents['on'](_0x26597d,_0x4a15b9);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index be9550f..c873ad7 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 _0x95b2=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x48a475,_0x510ef2){var _0xd22a73=function(_0x4dbbe0){while(--_0x4dbbe0){_0x48a475['push'](_0x48a475['shift']());}};_0xd22a73(++_0x510ef2);}(_0x95b2,0x144));var _0x295b=function(_0x3b955b,_0x2122d6){_0x3b955b=_0x3b955b-0x0;var _0x2a8278=_0x95b2[_0x3b955b];return _0x2a8278;};'use strict';var multer=require(_0x295b('0x0'));var util=require(_0x295b('0x1'));var path=require(_0x295b('0x2'));var timeout=require(_0x295b('0x3'));var express=require(_0x295b('0x4'));var router=express[_0x295b('0x5')]();var auth=require(_0x295b('0x6'));var interaction=require(_0x295b('0x7'));var config=require(_0x295b('0x8'));var controller=require('./voiceQueuesLog.controller');router[_0x295b('0x9')]('/',auth[_0x295b('0xa')](),controller[_0x295b('0xb')]);router[_0x295b('0x9')](_0x295b('0xc'),auth['isAuthenticated'](),controller[_0x295b('0xd')]);router[_0x295b('0xe')]('/',auth[_0x295b('0xa')](),controller[_0x295b('0xf')]);router[_0x295b('0x10')](_0x295b('0xc'),auth[_0x295b('0xa')](),controller[_0x295b('0x11')]);router[_0x295b('0x12')]('/:id',auth[_0x295b('0xa')](),controller[_0x295b('0x13')]);module[_0x295b('0x14')]=router; \ No newline at end of file +var _0x064e=['post','create','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./voiceQueuesLog.controller','get','isAuthenticated','/:id'];(function(_0x4578eb,_0x1c0a07){var _0x1b1e53=function(_0x69d2eb){while(--_0x69d2eb){_0x4578eb['push'](_0x4578eb['shift']());}};_0x1b1e53(++_0x1c0a07);}(_0x064e,0xd2));var _0xe064=function(_0x33bd84,_0x483aaa){_0x33bd84=_0x33bd84-0x0;var _0x56f4cd=_0x064e[_0x33bd84];return _0x56f4cd;};'use strict';var multer=require(_0xe064('0x0'));var util=require(_0xe064('0x1'));var path=require(_0xe064('0x2'));var timeout=require(_0xe064('0x3'));var express=require('express');var router=express[_0xe064('0x4')]();var auth=require(_0xe064('0x5'));var interaction=require(_0xe064('0x6'));var config=require('../../config/environment');var controller=require(_0xe064('0x7'));router[_0xe064('0x8')]('/',auth[_0xe064('0x9')](),controller['index']);router[_0xe064('0x8')](_0xe064('0xa'),auth[_0xe064('0x9')](),controller['show']);router[_0xe064('0xb')]('/',auth[_0xe064('0x9')](),controller[_0xe064('0xc')]);router[_0xe064('0xd')](_0xe064('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xe064('0xe')](_0xe064('0xa'),auth[_0xe064('0x9')](),controller[_0xe064('0xf')]);module[_0xe064('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 df6fce2..ccd5423 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 _0x26c9=['exports','STRING','DATE','YYYY-MM-DD\x20HH:mm:ss','sequelize'];(function(_0x189086,_0xcb4261){var _0x53dc96=function(_0x84a01f){while(--_0x84a01f){_0x189086['push'](_0x189086['shift']());}};_0x53dc96(++_0xcb4261);}(_0x26c9,0x199));var _0x926c=function(_0x445d04,_0x25bc98){_0x445d04=_0x445d04-0x0;var _0x6463af=_0x26c9[_0x445d04];return _0x6463af;};'use strict';var Sequelize=require(_0x926c('0x0'));var moment=require('moment');module[_0x926c('0x1')]={'time':{'type':Sequelize[_0x926c('0x2')]},'callid':{'type':Sequelize[_0x926c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x926c('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x926c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x926c('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x926c('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x926c('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x926c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x926c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x926c('0x3')],'allowNull':![],'defaultValue':moment()['format'](_0x926c('0x4'))}}; \ No newline at end of file +var _0x21c0=['exports','STRING','DATE','format','moment'];(function(_0x4efd3d,_0x2b9694){var _0x1293f2=function(_0x14b90f){while(--_0x14b90f){_0x4efd3d['push'](_0x4efd3d['shift']());}};_0x1293f2(++_0x2b9694);}(_0x21c0,0x1a8));var _0x021c=function(_0x4be81d,_0x4949b7){_0x4be81d=_0x4be81d-0x0;var _0x2cce98=_0x21c0[_0x4be81d];return _0x2cce98;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x021c('0x0'));module[_0x021c('0x1')]={'time':{'type':Sequelize[_0x021c('0x2')]},'callid':{'type':Sequelize[_0x021c('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x021c('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x021c('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x021c('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x021c('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x021c('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x021c('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x021c('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x021c('0x3')],'allowNull':![],'defaultValue':moment()[_0x021c('0x4')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index cbabd08..4e0e225 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 _0xa3da=['find','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','then','destroy','error','stack','name','map','VoiceQueuesLog','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','rawAttributes','intersection'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0xa3da,0xdd));var _0xaa3d=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xa3da[_0x501510];return _0x1e6ee5;};'use strict';var pdf=require(_0xaa3d('0x0'));var emlformat=require(_0xaa3d('0x1'));var rimraf=require(_0xaa3d('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa3d('0x3'));var rp=require(_0xaa3d('0x4'));var moment=require(_0xaa3d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaa3d('0x6'));var util=require(_0xaa3d('0x7'));var path=require(_0xaa3d('0x8'));var sox=require(_0xaa3d('0x9'));var csv=require(_0xaa3d('0xa'));var ejs=require(_0xaa3d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa3d('0xc'));var jsforce=require(_0xaa3d('0xd'));var deskjs=require(_0xaa3d('0xe'));var toCsv=require(_0xaa3d('0xa'));var querystring=require(_0xaa3d('0xf'));var Papa=require(_0xaa3d('0x10'));var Redis=require(_0xaa3d('0x11'));var authService=require(_0xaa3d('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xaa3d('0x13'));var hardwareService=require(_0xaa3d('0x14'));var logger=require(_0xaa3d('0x15'))(_0xaa3d('0x16'));var utils=require(_0xaa3d('0x17'));var config=require(_0xaa3d('0x18'));var db=require(_0xaa3d('0x19'))['db'];function respondWithStatusCode(_0x27d63d,_0x1c8537){_0x1c8537=_0x1c8537||0xcc;return function(_0x1a961c){if(_0x1a961c){return _0x27d63d[_0xaa3d('0x1a')](_0x1c8537);}return _0x27d63d[_0xaa3d('0x1b')](_0x1c8537)[_0xaa3d('0x1c')]();};}function respondWithResult(_0x994694,_0x187d40){_0x187d40=_0x187d40||0xc8;return function(_0xcaa97e){if(_0xcaa97e){return _0x994694['status'](_0x187d40)[_0xaa3d('0x1d')](_0xcaa97e);}};}function respondWithFilteredResult(_0x2b5357,_0x1bc7d6){return function(_0x4536a1){if(_0x4536a1){var _0x2de594=_0x4536a1['count'],_0x3b7a6f=_0x1bc7d6['offset'],_0x5cf5d1=_0x1bc7d6[_0xaa3d('0x1e')]+_0x1bc7d6[_0xaa3d('0x1f')],_0x3bb4fb;if(_0x5cf5d1>=_0x2de594){_0x5cf5d1=_0x2de594;_0x3bb4fb=0xc8;}else{_0x3bb4fb=0xce;}_0x2b5357[_0xaa3d('0x1b')](_0x3bb4fb);return _0x2b5357['set'](_0xaa3d('0x20'),_0x3b7a6f+'-'+_0x5cf5d1+'/'+_0x2de594)[_0xaa3d('0x1d')](_0x4536a1);}return null;};}function patchUpdates(_0x28ad47){return function(_0x1f4298){try{jsonpatch[_0xaa3d('0x21')](_0x1f4298,_0x28ad47,!![]);}catch(_0x5c93e5){return BPromise['reject'](_0x5c93e5);}return _0x1f4298[_0xaa3d('0x22')]();};}function saveUpdates(_0x42dade,_0x43b45d){return function(_0x92d2a4){if(_0x92d2a4){return _0x92d2a4[_0xaa3d('0x23')](_0x42dade)[_0xaa3d('0x24')](function(_0xf5b2e8){return _0xf5b2e8;});}return null;};}function removeEntity(_0x154e1c,_0x34f287){return function(_0x3162b8){if(_0x3162b8){return _0x3162b8[_0xaa3d('0x25')]()[_0xaa3d('0x24')](function(){_0x154e1c[_0xaa3d('0x1b')](0xcc)[_0xaa3d('0x1c')]();});}};}function handleEntityNotFound(_0x2cddf5,_0xe2a348){return function(_0x5d01ce){if(!_0x5d01ce){_0x2cddf5[_0xaa3d('0x1a')](0x194);}return _0x5d01ce;};}function handleError(_0x19b4c2,_0x2a473e){_0x2a473e=_0x2a473e||0x1f4;return function(_0x20e969){logger[_0xaa3d('0x26')](_0x20e969[_0xaa3d('0x27')]);if(_0x20e969[_0xaa3d('0x28')]){delete _0x20e969['name'];}_0x19b4c2['status'](_0x2a473e)['send'](_0x20e969);};}exports['index']=function(_0x32839c,_0x42633e){var _0x10d66d={},_0x2d25b8={},_0x57203d={'count':0x0,'rows':[]};var _0xf712c0=_[_0xaa3d('0x29')](db[_0xaa3d('0x2a')]['rawAttributes'],function(_0x2edb0c){return{'name':_0x2edb0c[_0xaa3d('0x2b')],'type':_0x2edb0c[_0xaa3d('0x2c')][_0xaa3d('0x2d')]};});_0x2d25b8[_0xaa3d('0x2e')]=_[_0xaa3d('0x29')](_0xf712c0,_0xaa3d('0x28'));_0x2d25b8[_0xaa3d('0x2f')]=_[_0xaa3d('0x30')](_0x32839c['query']);_0x2d25b8[_0xaa3d('0x31')]=_['intersection'](_0x2d25b8['model'],_0x2d25b8[_0xaa3d('0x2f')]);_0x10d66d[_0xaa3d('0x32')]=_['intersection'](_0x2d25b8[_0xaa3d('0x2e')],qs['fields'](_0x32839c[_0xaa3d('0x2f')][_0xaa3d('0x33')]));_0x10d66d[_0xaa3d('0x32')]=_0x10d66d[_0xaa3d('0x32')][_0xaa3d('0x34')]?_0x10d66d[_0xaa3d('0x32')]:_0x2d25b8['model'];if(!_0x32839c[_0xaa3d('0x2f')][_0xaa3d('0x35')](_0xaa3d('0x36'))){_0x10d66d[_0xaa3d('0x1f')]=qs['limit'](_0x32839c[_0xaa3d('0x2f')][_0xaa3d('0x1f')]);_0x10d66d[_0xaa3d('0x1e')]=qs['offset'](_0x32839c['query'][_0xaa3d('0x1e')]);}_0x10d66d[_0xaa3d('0x37')]=qs[_0xaa3d('0x38')](_0x32839c[_0xaa3d('0x2f')][_0xaa3d('0x38')]);_0x10d66d[_0xaa3d('0x39')]=qs[_0xaa3d('0x31')](_['pick'](_0x32839c[_0xaa3d('0x2f')],_0x2d25b8[_0xaa3d('0x31')]));if(_0x32839c[_0xaa3d('0x2f')][_0xaa3d('0x3a')]){_0x10d66d['where']=_['merge'](_0x10d66d[_0xaa3d('0x39')],{'$or':_[_0xaa3d('0x29')](_0xf712c0,function(_0x177bd2){if(_0x177bd2[_0xaa3d('0x2c')]!==_0xaa3d('0x3b')){var _0x42d574={};_0x42d574[_0x177bd2[_0xaa3d('0x28')]]={'$like':'%'+_0x32839c[_0xaa3d('0x2f')][_0xaa3d('0x3a')]+'%'};return _0x42d574;}})});}_0x10d66d=_[_0xaa3d('0x3c')]({},_0x10d66d,_0x32839c[_0xaa3d('0x3d')]);var _0x5153ab={'where':_0x10d66d[_0xaa3d('0x39')]};return db[_0xaa3d('0x2a')]['count'](_0x5153ab)['then'](function(_0x5a8324){_0x57203d[_0xaa3d('0x3e')]=_0x5a8324;if(_0x32839c[_0xaa3d('0x2f')][_0xaa3d('0x3f')]){_0x10d66d[_0xaa3d('0x40')]=[{'all':!![]}];}return db['VoiceQueuesLog'][_0xaa3d('0x41')](_0x10d66d);})[_0xaa3d('0x24')](function(_0x2c17b0){_0x57203d['rows']=_0x2c17b0;return _0x57203d;})['then'](respondWithFilteredResult(_0x42633e,_0x10d66d))[_0xaa3d('0x42')](handleError(_0x42633e,null));};exports[_0xaa3d('0x43')]=function(_0x4f5938,_0x4df2e7){var _0x227fc4={'raw':!![],'where':{'id':_0x4f5938[_0xaa3d('0x44')]['id']}},_0x3de6fc={};_0x3de6fc['model']=_[_0xaa3d('0x30')](db[_0xaa3d('0x2a')][_0xaa3d('0x45')]);_0x3de6fc[_0xaa3d('0x2f')]=_[_0xaa3d('0x30')](_0x4f5938[_0xaa3d('0x2f')]);_0x3de6fc[_0xaa3d('0x31')]=_['intersection'](_0x3de6fc[_0xaa3d('0x2e')],_0x3de6fc[_0xaa3d('0x2f')]);_0x227fc4[_0xaa3d('0x32')]=_[_0xaa3d('0x46')](_0x3de6fc[_0xaa3d('0x2e')],qs['fields'](_0x4f5938['query'][_0xaa3d('0x33')]));_0x227fc4['attributes']=_0x227fc4[_0xaa3d('0x32')][_0xaa3d('0x34')]?_0x227fc4[_0xaa3d('0x32')]:_0x3de6fc[_0xaa3d('0x2e')];if(_0x4f5938[_0xaa3d('0x2f')][_0xaa3d('0x3f')]){_0x227fc4[_0xaa3d('0x40')]=[{'all':!![]}];}_0x227fc4=_[_0xaa3d('0x3c')]({},_0x227fc4,_0x4f5938[_0xaa3d('0x3d')]);return db['VoiceQueuesLog'][_0xaa3d('0x47')](_0x227fc4)[_0xaa3d('0x24')](handleEntityNotFound(_0x4df2e7,null))[_0xaa3d('0x24')](respondWithResult(_0x4df2e7,null))[_0xaa3d('0x42')](handleError(_0x4df2e7,null));};exports['create']=function(_0x17a3d4,_0x38a4e4){return db[_0xaa3d('0x2a')]['create'](_0x17a3d4[_0xaa3d('0x48')],{})[_0xaa3d('0x24')](respondWithResult(_0x38a4e4,0xc9))[_0xaa3d('0x42')](handleError(_0x38a4e4,null));};exports['update']=function(_0x4b00f7,_0x409ac2){if(_0x4b00f7[_0xaa3d('0x48')]['id']){delete _0x4b00f7[_0xaa3d('0x48')]['id'];}return db['VoiceQueuesLog'][_0xaa3d('0x47')]({'where':{'id':_0x4b00f7[_0xaa3d('0x44')]['id']}})[_0xaa3d('0x24')](handleEntityNotFound(_0x409ac2,null))['then'](saveUpdates(_0x4b00f7[_0xaa3d('0x48')],null))[_0xaa3d('0x24')](respondWithResult(_0x409ac2,null))[_0xaa3d('0x42')](handleError(_0x409ac2,null));};exports['destroy']=function(_0x426900,_0x35d96e){return db[_0xaa3d('0x2a')][_0xaa3d('0x47')]({'where':{'id':_0x426900[_0xaa3d('0x44')]['id']}})[_0xaa3d('0x24')](handleEntityNotFound(_0x35d96e,null))[_0xaa3d('0x24')](removeEntity(_0x35d96e,null))[_0xaa3d('0x42')](handleError(_0x35d96e,null));}; \ No newline at end of file +var _0xa37a=['pick','filter','merge','options','includeAll','rows','catch','show','params','include','find','create','body','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','update','then','destroy','error','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where'];(function(_0x279d37,_0x14de3f){var _0x530173=function(_0x37fc79){while(--_0x37fc79){_0x279d37['push'](_0x279d37['shift']());}};_0x530173(++_0x14de3f);}(_0xa37a,0xe5));var _0xaa37=function(_0x187010,_0x5c7d61){_0x187010=_0x187010-0x0;var _0x4e8430=_0xa37a[_0x187010];return _0x4e8430;};'use strict';var pdf=require(_0xaa37('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaa37('0x1'));var zipdir=require(_0xaa37('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xaa37('0x3'));var BPromise=require(_0xaa37('0x4'));var Mustache=require(_0xaa37('0x5'));var util=require(_0xaa37('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xaa37('0x7'));var ejs=require(_0xaa37('0x8'));var fs=require('fs');var _=require(_0xaa37('0x9'));var squel=require(_0xaa37('0xa'));var crypto=require(_0xaa37('0xb'));var jsforce=require(_0xaa37('0xc'));var deskjs=require(_0xaa37('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa37('0xe'));var Papa=require(_0xaa37('0xf'));var Redis=require(_0xaa37('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xaa37('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xaa37('0x12'))(_0xaa37('0x13'));var utils=require(_0xaa37('0x14'));var config=require(_0xaa37('0x15'));var db=require(_0xaa37('0x16'))['db'];function respondWithStatusCode(_0x18620f,_0x1508b4){_0x1508b4=_0x1508b4||0xcc;return function(_0x29de29){if(_0x29de29){return _0x18620f[_0xaa37('0x17')](_0x1508b4);}return _0x18620f[_0xaa37('0x18')](_0x1508b4)[_0xaa37('0x19')]();};}function respondWithResult(_0x28179f,_0x11143c){_0x11143c=_0x11143c||0xc8;return function(_0x119e8e){if(_0x119e8e){return _0x28179f[_0xaa37('0x18')](_0x11143c)[_0xaa37('0x1a')](_0x119e8e);}};}function respondWithFilteredResult(_0xff403c,_0x49d8bf){return function(_0x5ef53d){if(_0x5ef53d){var _0x193cb8=_0x5ef53d[_0xaa37('0x1b')],_0x5eb63f=_0x49d8bf['offset'],_0x302edc=_0x49d8bf[_0xaa37('0x1c')]+_0x49d8bf['limit'],_0x5cddc2;if(_0x302edc>=_0x193cb8){_0x302edc=_0x193cb8;_0x5cddc2=0xc8;}else{_0x5cddc2=0xce;}_0xff403c[_0xaa37('0x18')](_0x5cddc2);return _0xff403c[_0xaa37('0x1d')]('Content-Range',_0x5eb63f+'-'+_0x302edc+'/'+_0x193cb8)[_0xaa37('0x1a')](_0x5ef53d);}return null;};}function patchUpdates(_0x476932){return function(_0x28b816){try{jsonpatch[_0xaa37('0x1e')](_0x28b816,_0x476932,!![]);}catch(_0x4e45ce){return BPromise[_0xaa37('0x1f')](_0x4e45ce);}return _0x28b816['save']();};}function saveUpdates(_0x107619,_0x66078e){return function(_0x20add9){if(_0x20add9){return _0x20add9[_0xaa37('0x20')](_0x107619)[_0xaa37('0x21')](function(_0x301a46){return _0x301a46;});}return null;};}function removeEntity(_0x1e2a78,_0x58af3c){return function(_0x1c1945){if(_0x1c1945){return _0x1c1945[_0xaa37('0x22')]()[_0xaa37('0x21')](function(){_0x1e2a78[_0xaa37('0x18')](0xcc)[_0xaa37('0x19')]();});}};}function handleEntityNotFound(_0x10dca5,_0x22daa6){return function(_0x4bed51){if(!_0x4bed51){_0x10dca5[_0xaa37('0x17')](0x194);}return _0x4bed51;};}function handleError(_0x321336,_0x15a0d3){_0x15a0d3=_0x15a0d3||0x1f4;return function(_0x156ae7){logger[_0xaa37('0x23')](_0x156ae7[_0xaa37('0x24')]);if(_0x156ae7[_0xaa37('0x25')]){delete _0x156ae7[_0xaa37('0x25')];}_0x321336[_0xaa37('0x18')](_0x15a0d3)[_0xaa37('0x26')](_0x156ae7);};}exports['index']=function(_0x559292,_0x385a3c){var _0x897812={},_0xf0bf38={},_0x15962a={'count':0x0,'rows':[]};var _0x3c1ef6=_[_0xaa37('0x27')](db[_0xaa37('0x28')][_0xaa37('0x29')],function(_0x3a858d){return{'name':_0x3a858d[_0xaa37('0x2a')],'type':_0x3a858d[_0xaa37('0x2b')][_0xaa37('0x2c')]};});_0xf0bf38[_0xaa37('0x2d')]=_['map'](_0x3c1ef6,'name');_0xf0bf38[_0xaa37('0x2e')]=_[_0xaa37('0x2f')](_0x559292[_0xaa37('0x2e')]);_0xf0bf38[_0xaa37('0x30')]=_[_0xaa37('0x31')](_0xf0bf38[_0xaa37('0x2d')],_0xf0bf38['query']);_0x897812[_0xaa37('0x32')]=_[_0xaa37('0x31')](_0xf0bf38[_0xaa37('0x2d')],qs[_0xaa37('0x33')](_0x559292[_0xaa37('0x2e')]['fields']));_0x897812[_0xaa37('0x32')]=_0x897812[_0xaa37('0x32')][_0xaa37('0x34')]?_0x897812[_0xaa37('0x32')]:_0xf0bf38['model'];if(!_0x559292[_0xaa37('0x2e')][_0xaa37('0x35')](_0xaa37('0x36'))){_0x897812[_0xaa37('0x37')]=qs[_0xaa37('0x37')](_0x559292[_0xaa37('0x2e')]['limit']);_0x897812[_0xaa37('0x1c')]=qs[_0xaa37('0x1c')](_0x559292['query']['offset']);}_0x897812[_0xaa37('0x38')]=qs[_0xaa37('0x39')](_0x559292[_0xaa37('0x2e')][_0xaa37('0x39')]);_0x897812[_0xaa37('0x3a')]=qs['filters'](_[_0xaa37('0x3b')](_0x559292['query'],_0xf0bf38['filters']));if(_0x559292[_0xaa37('0x2e')][_0xaa37('0x3c')]){_0x897812['where']=_[_0xaa37('0x3d')](_0x897812[_0xaa37('0x3a')],{'$or':_[_0xaa37('0x27')](_0x3c1ef6,function(_0x15c650){if(_0x15c650[_0xaa37('0x2b')]!=='VIRTUAL'){var _0x2f2ea4={};_0x2f2ea4[_0x15c650[_0xaa37('0x25')]]={'$like':'%'+_0x559292[_0xaa37('0x2e')][_0xaa37('0x3c')]+'%'};return _0x2f2ea4;}})});}_0x897812=_[_0xaa37('0x3d')]({},_0x897812,_0x559292[_0xaa37('0x3e')]);var _0x265e9a={'where':_0x897812['where']};return db['VoiceQueuesLog']['count'](_0x265e9a)[_0xaa37('0x21')](function(_0x104962){_0x15962a[_0xaa37('0x1b')]=_0x104962;if(_0x559292[_0xaa37('0x2e')][_0xaa37('0x3f')]){_0x897812['include']=[{'all':!![]}];}return db[_0xaa37('0x28')]['findAll'](_0x897812);})[_0xaa37('0x21')](function(_0x75bd7e){_0x15962a[_0xaa37('0x40')]=_0x75bd7e;return _0x15962a;})[_0xaa37('0x21')](respondWithFilteredResult(_0x385a3c,_0x897812))[_0xaa37('0x41')](handleError(_0x385a3c,null));};exports[_0xaa37('0x42')]=function(_0x19285e,_0x186baf){var _0x3188c7={'raw':!![],'where':{'id':_0x19285e[_0xaa37('0x43')]['id']}},_0x2cb96c={};_0x2cb96c[_0xaa37('0x2d')]=_[_0xaa37('0x2f')](db['VoiceQueuesLog']['rawAttributes']);_0x2cb96c['query']=_['keys'](_0x19285e[_0xaa37('0x2e')]);_0x2cb96c[_0xaa37('0x30')]=_['intersection'](_0x2cb96c[_0xaa37('0x2d')],_0x2cb96c[_0xaa37('0x2e')]);_0x3188c7[_0xaa37('0x32')]=_['intersection'](_0x2cb96c['model'],qs[_0xaa37('0x33')](_0x19285e[_0xaa37('0x2e')][_0xaa37('0x33')]));_0x3188c7[_0xaa37('0x32')]=_0x3188c7['attributes']['length']?_0x3188c7[_0xaa37('0x32')]:_0x2cb96c['model'];if(_0x19285e[_0xaa37('0x2e')][_0xaa37('0x3f')]){_0x3188c7[_0xaa37('0x44')]=[{'all':!![]}];}_0x3188c7=_[_0xaa37('0x3d')]({},_0x3188c7,_0x19285e[_0xaa37('0x3e')]);return db[_0xaa37('0x28')][_0xaa37('0x45')](_0x3188c7)[_0xaa37('0x21')](handleEntityNotFound(_0x186baf,null))[_0xaa37('0x21')](respondWithResult(_0x186baf,null))[_0xaa37('0x41')](handleError(_0x186baf,null));};exports[_0xaa37('0x46')]=function(_0x447e98,_0x20ece5){return db[_0xaa37('0x28')][_0xaa37('0x46')](_0x447e98['body'],{})['then'](respondWithResult(_0x20ece5,0xc9))[_0xaa37('0x41')](handleError(_0x20ece5,null));};exports[_0xaa37('0x20')]=function(_0x231420,_0xd17047){if(_0x231420[_0xaa37('0x47')]['id']){delete _0x231420[_0xaa37('0x47')]['id'];}return db['VoiceQueuesLog'][_0xaa37('0x45')]({'where':{'id':_0x231420[_0xaa37('0x43')]['id']}})[_0xaa37('0x21')](handleEntityNotFound(_0xd17047,null))[_0xaa37('0x21')](saveUpdates(_0x231420[_0xaa37('0x47')],null))[_0xaa37('0x21')](respondWithResult(_0xd17047,null))[_0xaa37('0x41')](handleError(_0xd17047,null));};exports[_0xaa37('0x22')]=function(_0x3725e2,_0x95401c){return db[_0xaa37('0x28')][_0xaa37('0x45')]({'where':{'id':_0x3725e2[_0xaa37('0x43')]['id']}})['then'](handleEntityNotFound(_0x95401c,null))[_0xaa37('0x21')](removeEntity(_0x95401c,null))[_0xaa37('0x41')](handleError(_0x95401c,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index 5b7a2d2..ef76ad0 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 _0x162f=['exports','define','voice_queues_log','lodash','api','moment','bluebird','path','rimraf','../../config/environment','./voiceQueuesLog.attributes'];(function(_0x58725a,_0x389d19){var _0x2e6e65=function(_0x2f034e){while(--_0x2f034e){_0x58725a['push'](_0x58725a['shift']());}};_0x2e6e65(++_0x389d19);}(_0x162f,0x1e7));var _0xf162=function(_0x5fb420,_0x41a6ee){_0x5fb420=_0x5fb420-0x0;var _0x22c89e=_0x162f[_0x5fb420];return _0x22c89e;};'use strict';var _=require(_0xf162('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf162('0x1'));var moment=require(_0xf162('0x2'));var BPromise=require(_0xf162('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf162('0x4'));var rimraf=require(_0xf162('0x5'));var config=require(_0xf162('0x6'));var attributes=require(_0xf162('0x7'));module[_0xf162('0x8')]=function(_0x40819a,_0x593cd2){return _0x40819a[_0xf162('0x9')]('VoiceQueuesLog',attributes,{'tableName':_0xf162('0xa'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x1f4a=['VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','api','moment','request-promise','./voiceQueuesLog.attributes'];(function(_0x1257d1,_0x2f5b9c){var _0x3138b3=function(_0x2d43ac){while(--_0x2d43ac){_0x1257d1['push'](_0x1257d1['shift']());}};_0x3138b3(++_0x2f5b9c);}(_0x1f4a,0x170));var _0xa1f4=function(_0x174bcc,_0x449ec9){_0x174bcc=_0x174bcc-0x0;var _0x2421f1=_0x1f4a[_0x174bcc];return _0x2421f1;};'use strict';var _=require(_0xa1f4('0x0'));var util=require(_0xa1f4('0x1'));var logger=require('../../config/logger')(_0xa1f4('0x2'));var moment=require(_0xa1f4('0x3'));var BPromise=require('bluebird');var rp=require(_0xa1f4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa1f4('0x5'));module['exports']=function(_0x3d667f,_0x23cec0){return _0x3d667f['define'](_0xa1f4('0x6'),attributes,{'tableName':_0xa1f4('0x7'),'paranoid':![],'indexes':[{'name':_0xa1f4('0x8'),'fields':[_0xa1f4('0x9'),_0xa1f4('0xa')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index aec5d44..4877890 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 _0xe3d4=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','request','then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch'];(function(_0x37655e,_0x5a883e){var _0x43d79b=function(_0x580524){while(--_0x580524){_0x37655e['push'](_0x37655e['shift']());}};_0x43d79b(++_0x5a883e);}(_0xe3d4,0xc6));var _0x4e3d=function(_0x53b22e,_0x5e248f){_0x53b22e=_0x53b22e-0x0;var _0x14a0a4=_0xe3d4[_0x53b22e];return _0x14a0a4;};'use strict';var _=require('lodash');var util=require(_0x4e3d('0x0'));var moment=require(_0x4e3d('0x1'));var BPromise=require(_0x4e3d('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e3d('0x3'));var db=require(_0x4e3d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4e3d('0x5'))('rpc');var config=require(_0x4e3d('0x6'));var jayson=require(_0x4e3d('0x7'));var client=jayson['client'][_0x4e3d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d5c04,_0x5b544d,_0x40b814){return new BPromise(function(_0x4275b0,_0x436075){return client[_0x4e3d('0x9')](_0x1d5c04,_0x40b814)[_0x4e3d('0xa')](function(_0x2968cd){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x5b544d,_0x4e3d('0xb'));logger[_0x4e3d('0xc')](_0x4e3d('0xd'),_0x5b544d,_0x4e3d('0xb'),JSON[_0x4e3d('0xe')](_0x2968cd));if(_0x2968cd[_0x4e3d('0xf')]){if(_0x2968cd['error'][_0x4e3d('0x10')]===0x1f4){logger[_0x4e3d('0xf')](_0x4e3d('0x11'),_0x5b544d,_0x2968cd[_0x4e3d('0xf')][_0x4e3d('0x12')]);return _0x436075(_0x2968cd[_0x4e3d('0xf')][_0x4e3d('0x12')]);}logger[_0x4e3d('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5b544d,_0x2968cd[_0x4e3d('0xf')][_0x4e3d('0x12')]);return _0x4275b0(_0x2968cd[_0x4e3d('0xf')]['message']);}else{logger[_0x4e3d('0x13')](_0x4e3d('0x11'),_0x5b544d,_0x4e3d('0xb'));_0x4275b0(_0x2968cd[_0x4e3d('0x14')][_0x4e3d('0x12')]);}})[_0x4e3d('0x15')](function(_0x28979d){logger[_0x4e3d('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5b544d,_0x28979d);_0x436075(_0x28979d);});});} \ No newline at end of file +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(_0x562f3b,_0x4c65ae){var _0x1edd55=function(_0xe67e06){while(--_0xe67e06){_0x562f3b['push'](_0x562f3b['shift']());}};_0x1edd55(++_0x4c65ae);}(_0x4fc2,0x111));var _0x24fc=function(_0xd70344,_0x304eac){_0xd70344=_0xd70344-0x0;var _0x338d4b=_0x4fc2[_0xd70344];return _0x338d4b;};'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 diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 2f4c275..3e6c003 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 _0x531d=['index','/describe','/:id','show','/:id/download','download','/:id/downloads','downloads','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated'];(function(_0x2fc872,_0x41c108){var _0x819718=function(_0x48ae12){while(--_0x48ae12){_0x2fc872['push'](_0x2fc872['shift']());}};_0x819718(++_0x41c108);}(_0x531d,0x1c3));var _0xd531=function(_0x5cf000,_0xe73853){_0x5cf000=_0x5cf000-0x0;var _0x704261=_0x531d[_0x5cf000];return _0x704261;};'use strict';var multer=require(_0xd531('0x0'));var util=require(_0xd531('0x1'));var path=require(_0xd531('0x2'));var timeout=require(_0xd531('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xd531('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xd531('0x5'));var controller=require(_0xd531('0x6'));router[_0xd531('0x7')]('/',auth[_0xd531('0x8')](),controller[_0xd531('0x9')]);router['get'](_0xd531('0xa'),auth[_0xd531('0x8')](),controller['describe']);router[_0xd531('0x7')](_0xd531('0xb'),auth[_0xd531('0x8')](),controller[_0xd531('0xc')]);router[_0xd531('0x7')](_0xd531('0xd'),auth['isAuthenticated'](),controller[_0xd531('0xe')]);router[_0xd531('0x7')](_0xd531('0xf'),controller[_0xd531('0x10')]);router[_0xd531('0x11')]('/',auth[_0xd531('0x8')](),controller['create']);router[_0xd531('0x12')](_0xd531('0xb'),auth[_0xd531('0x8')](),controller[_0xd531('0x13')]);router[_0xd531('0x14')](_0xd531('0xb'),auth['isAuthenticated'](),controller[_0xd531('0x15')]);module[_0xd531('0x16')]=router; \ No newline at end of file +var _0xb047=['/:id/download','download','/:id/downloads','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','/describe','isAuthenticated','describe','show'];(function(_0x2aa0e7,_0x4e5145){var _0x1472c0=function(_0x4deaeb){while(--_0x4deaeb){_0x2aa0e7['push'](_0x2aa0e7['shift']());}};_0x1472c0(++_0x4e5145);}(_0xb047,0x6a));var _0x7b04=function(_0x4c3f7d,_0x56ce39){_0x4c3f7d=_0x4c3f7d-0x0;var _0x48c013=_0xb047[_0x4c3f7d];return _0x48c013;};'use strict';var multer=require(_0x7b04('0x0'));var util=require(_0x7b04('0x1'));var path=require(_0x7b04('0x2'));var timeout=require(_0x7b04('0x3'));var express=require(_0x7b04('0x4'));var router=express[_0x7b04('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7b04('0x6'));var config=require(_0x7b04('0x7'));var controller=require(_0x7b04('0x8'));router[_0x7b04('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7b04('0xa'),auth[_0x7b04('0xb')](),controller[_0x7b04('0xc')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x7b04('0xd')]);router[_0x7b04('0x9')](_0x7b04('0xe'),auth[_0x7b04('0xb')](),controller[_0x7b04('0xf')]);router['get'](_0x7b04('0x10'),controller['downloads']);router['post']('/',auth['isAuthenticated'](),controller[_0x7b04('0x11')]);router[_0x7b04('0x12')](_0x7b04('0x13'),auth[_0x7b04('0xb')](),controller[_0x7b04('0x14')]);router[_0x7b04('0x15')](_0x7b04('0x13'),auth['isAuthenticated'](),controller[_0x7b04('0x16')]);module[_0x7b04('0x17')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 0387c26..25da450 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 _0xb016=['channel','membername','split','getDataValue','createdAt','format','DATE','updatedAt','toString','sequelize','moment','path','exports','VIRTUAL','value','extname','STRING','setDataValue'];(function(_0x38129b,_0x126b98){var _0x32a61a=function(_0x24be17){while(--_0x24be17){_0x38129b['push'](_0x38129b['shift']());}};_0x32a61a(++_0x126b98);}(_0xb016,0x14d));var _0x6b01=function(_0x5726d1,_0x2739dd){_0x5726d1=_0x5726d1-0x0;var _0x98b311=_0xb016[_0x5726d1];return _0x98b311;};'use strict';var Sequelize=require(_0x6b01('0x0'));var moment=require(_0x6b01('0x1'));var path=require(_0x6b01('0x2'));module[_0x6b01('0x3')]={'format':{'type':Sequelize[_0x6b01('0x4')],'get':function(){return this['getDataValue'](_0x6b01('0x5'))?path[_0x6b01('0x6')](this['getDataValue'](_0x6b01('0x5'))):undefined;}},'uniqueid':{'type':Sequelize[_0x6b01('0x7')]},'channel':{'type':Sequelize[_0x6b01('0x7')],'set':function(_0x23a1bc){if(_0x23a1bc){this[_0x6b01('0x8')](_0x6b01('0x9'),_0x23a1bc);this[_0x6b01('0x8')](_0x6b01('0xa'),_0x23a1bc[_0x6b01('0xb')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x6b01('0x7')]},'calleridnum':{'type':Sequelize[_0x6b01('0x7')]},'calleridname':{'type':Sequelize[_0x6b01('0x7')]},'connectedlinenum':{'type':Sequelize[_0x6b01('0x7')]},'connectedlinename':{'type':Sequelize[_0x6b01('0x7')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6b01('0x7')]},'exten':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x6b01('0x7')]},'userDisposition':{'type':Sequelize[_0x6b01('0x7')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x6b01('0xc')](_0x6b01('0xd')))[_0x6b01('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize[_0x6b01('0xf')],'get':function(){return moment(this[_0x6b01('0xc')](_0x6b01('0x10')))[_0x6b01('0xe')]('MM-DD-YYYY\x20HH:mm')[_0x6b01('0x11')]();}}}; \ No newline at end of file +var _0xc9de=['setDataValue','channel','split','INTEGER','DATE','createdAt','format','toString','updatedAt','MM-DD-YYYY\x20HH:mm','moment','path','exports','getDataValue','value','STRING'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0xc9de,0xea));var _0xec9d=function(_0x26abcc,_0x41828f){_0x26abcc=_0x26abcc-0x0;var _0x2dc134=_0xc9de[_0x26abcc];return _0x2dc134;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xec9d('0x0'));var path=require(_0xec9d('0x1'));module[_0xec9d('0x2')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xec9d('0x3')](_0xec9d('0x4'))?path['extname'](this[_0xec9d('0x3')](_0xec9d('0x4'))):undefined;}},'uniqueid':{'type':Sequelize[_0xec9d('0x5')]},'channel':{'type':Sequelize[_0xec9d('0x5')],'set':function(_0x56f236){if(_0x56f236){this[_0xec9d('0x6')](_0xec9d('0x7'),_0x56f236);this[_0xec9d('0x6')]('membername',_0x56f236[_0xec9d('0x8')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xec9d('0x5')]},'calleridnum':{'type':Sequelize[_0xec9d('0x5')]},'calleridname':{'type':Sequelize[_0xec9d('0x5')]},'connectedlinenum':{'type':Sequelize[_0xec9d('0x5')]},'connectedlinename':{'type':Sequelize[_0xec9d('0x5')]},'accountcode':{'type':Sequelize[_0xec9d('0x5')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xec9d('0x5')]},'value':{'type':Sequelize[_0xec9d('0x5')]},'type':{'type':Sequelize[_0xec9d('0x5')]},'rating':{'type':Sequelize[_0xec9d('0x9')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xec9d('0x5')]},'userDisposition':{'type':Sequelize[_0xec9d('0x5')]},'createdAt':{'type':Sequelize[_0xec9d('0xa')],'get':function(){return moment(this[_0xec9d('0x3')](_0xec9d('0xb')))[_0xec9d('0xc')]('MM-DD-YYYY\x20HH:mm')[_0xec9d('0xd')]();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xec9d('0x3')](_0xec9d('0xe')))['format'](_0xec9d('0xf'))[_0xec9d('0xd')]();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 5507ed6..5892afd 100644 --- a/server/api/voiceRecording/voiceRecording.controller.js +++ b/server/api/voiceRecording/voiceRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd7d1=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','VoiceRecording','includeAll','findAll','show','include','find','create','body','catch','params','describe','download','../../components/encryptor','type','uniqueid','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','value','ValidationError','VoiceRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','stack','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x44b5bf,_0x45a5c3){var _0xa30029=function(_0x3fe608){while(--_0x3fe608){_0x44b5bf['push'](_0x44b5bf['shift']());}};_0xa30029(++_0x45a5c3);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x29d925,_0x4133df){_0x29d925=_0x29d925-0x0;var _0x27b956=_0xd7d1[_0x29d925];return _0x27b956;};'use strict';var pdf=require(_0x1d7d('0x0'));var emlformat=require(_0x1d7d('0x1'));var rimraf=require(_0x1d7d('0x2'));var zipdir=require(_0x1d7d('0x3'));var jsonpatch=require(_0x1d7d('0x4'));var rp=require(_0x1d7d('0x5'));var moment=require(_0x1d7d('0x6'));var BPromise=require(_0x1d7d('0x7'));var Mustache=require(_0x1d7d('0x8'));var util=require(_0x1d7d('0x9'));var path=require(_0x1d7d('0xa'));var sox=require(_0x1d7d('0xb'));var csv=require(_0x1d7d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xc'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var db=require(_0x1d7d('0x1b'))['db'];function respondWithStatusCode(_0x5c7445,_0x11b83f){_0x11b83f=_0x11b83f||0xcc;return function(_0x5ae1c9){if(_0x5ae1c9){return _0x5c7445['sendStatus'](_0x11b83f);}return _0x5c7445[_0x1d7d('0x1c')](_0x11b83f)[_0x1d7d('0x1d')]();};}function respondWithResult(_0x5dd438,_0x55dba7){_0x55dba7=_0x55dba7||0xc8;return function(_0x1d3822){if(_0x1d3822){return _0x5dd438[_0x1d7d('0x1c')](_0x55dba7)[_0x1d7d('0x1e')](_0x1d3822);}};}function respondWithFilteredResult(_0x183fc6,_0xeb05b3){return function(_0x53423f){if(_0x53423f){var _0x28adf3=_0x53423f[_0x1d7d('0x1f')],_0x1de6cc=_0xeb05b3[_0x1d7d('0x20')],_0x51cbca=_0xeb05b3[_0x1d7d('0x20')]+_0xeb05b3[_0x1d7d('0x21')],_0xb90a8c;if(_0x51cbca>=_0x28adf3){_0x51cbca=_0x28adf3;_0xb90a8c=0xc8;}else{_0xb90a8c=0xce;}_0x183fc6['status'](_0xb90a8c);return _0x183fc6[_0x1d7d('0x22')](_0x1d7d('0x23'),_0x1de6cc+'-'+_0x51cbca+'/'+_0x28adf3)['json'](_0x53423f);}return null;};}function patchUpdates(_0x495212){return function(_0x2406dd){try{jsonpatch[_0x1d7d('0x24')](_0x2406dd,_0x495212,!![]);}catch(_0x2a9f2b){return BPromise[_0x1d7d('0x25')](_0x2a9f2b);}return _0x2406dd[_0x1d7d('0x26')]();};}function saveUpdates(_0x275d3c,_0x54d401){return function(_0x225f85){if(_0x225f85){return _0x225f85[_0x1d7d('0x27')](_0x275d3c)[_0x1d7d('0x28')](function(_0x5692d9){return _0x5692d9;});}return null;};}function removeEntity(_0x29caf4,_0x12c54b){return function(_0x4a1cdc){if(_0x4a1cdc){return _0x4a1cdc['destroy']()[_0x1d7d('0x28')](function(){_0x29caf4[_0x1d7d('0x1c')](0xcc)[_0x1d7d('0x1d')]();});}};}function handleEntityNotFound(_0x5097b8,_0x377653){return function(_0x106376){if(!_0x106376){_0x5097b8[_0x1d7d('0x29')](0x194);}return _0x106376;};}function handleError(_0x21e59,_0x4fa346){_0x4fa346=_0x4fa346||0x1f4;return function(_0x233463){logger[_0x1d7d('0x2a')](_0x233463['stack']);if(_0x233463['name']){delete _0x233463[_0x1d7d('0x2b')];}_0x21e59['status'](_0x4fa346)[_0x1d7d('0x2c')](_0x233463);};}exports[_0x1d7d('0x2d')]=function(_0x3bc6e8,_0x22c40d){var _0x465938={},_0x59f827={},_0x1c2616={'count':0x0,'rows':[]};var _0x98c1ad=_[_0x1d7d('0x2e')](db['VoiceRecording'][_0x1d7d('0x2f')],function(_0x1a935a){return{'name':_0x1a935a[_0x1d7d('0x30')],'type':_0x1a935a['type']['key']};});_0x59f827['model']=_[_0x1d7d('0x31')](_[_0x1d7d('0x2e')](_0x98c1ad,'name'),[_0x1d7d('0x32')]);_0x59f827[_0x1d7d('0x33')]=_[_0x1d7d('0x34')](_0x3bc6e8[_0x1d7d('0x33')]);_0x59f827[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x59f827[_0x1d7d('0x37')],_0x59f827[_0x1d7d('0x33')]);_0x465938[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0x59f827['model'],qs['fields'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x39')]));_0x465938[_0x1d7d('0x38')]=_0x465938[_0x1d7d('0x38')][_0x1d7d('0x3a')]?_0x465938[_0x1d7d('0x38')]:_0x59f827[_0x1d7d('0x37')];if(!_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3b')]('nolimit')){_0x465938[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x21')]);_0x465938['offset']=qs['offset'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x20')]);}_0x465938['order']=qs[_0x1d7d('0x3c')](_0x3bc6e8[_0x1d7d('0x33')]['sort']);_0x465938['where']=qs[_0x1d7d('0x35')](_[_0x1d7d('0x3d')](_0x3bc6e8[_0x1d7d('0x33')],_0x59f827[_0x1d7d('0x35')]));if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3e')]){_0x465938[_0x1d7d('0x3f')]=_[_0x1d7d('0x40')](_0x465938[_0x1d7d('0x3f')],{'$or':_[_0x1d7d('0x2e')](_0x98c1ad,function(_0x4fcdcc){if(_0x4fcdcc['type']!=='VIRTUAL'){var _0x5cab41={};_0x5cab41[_0x4fcdcc[_0x1d7d('0x2b')]]={'$like':'%'+_0x3bc6e8['query'][_0x1d7d('0x3e')]+'%'};return _0x5cab41;}})});}_0x465938=_[_0x1d7d('0x40')]({},_0x465938,_0x3bc6e8[_0x1d7d('0x41')]);var _0x515199={'where':_0x465938[_0x1d7d('0x3f')]};return db[_0x1d7d('0x42')][_0x1d7d('0x1f')](_0x515199)['then'](function(_0x1a6a8c){_0x1c2616[_0x1d7d('0x1f')]=_0x1a6a8c;if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x465938['include']=[{'all':!![]}];}return db[_0x1d7d('0x42')][_0x1d7d('0x44')](_0x465938);})[_0x1d7d('0x28')](function(_0x456d51){_0x1c2616['rows']=_0x456d51;return _0x1c2616;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x22c40d,_0x465938))['catch'](handleError(_0x22c40d,null));};exports[_0x1d7d('0x45')]=function(_0x31b850,_0x671580){var _0x1106d1={'raw':![],'where':{'id':_0x31b850['params']['id']}},_0xf667a1={};_0xf667a1['model']=_[_0x1d7d('0x34')](db[_0x1d7d('0x42')][_0x1d7d('0x2f')]);_0xf667a1['query']=_['keys'](_0x31b850[_0x1d7d('0x33')]);_0xf667a1['filters']=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],_0xf667a1[_0x1d7d('0x33')]);_0x1106d1[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],qs[_0x1d7d('0x39')](_0x31b850['query'][_0x1d7d('0x39')]));_0x1106d1[_0x1d7d('0x38')]=_0x1106d1['attributes'][_0x1d7d('0x3a')]?_0x1106d1[_0x1d7d('0x38')]:_0xf667a1[_0x1d7d('0x37')];if(_0x31b850[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x1106d1[_0x1d7d('0x46')]=[{'all':!![]}];}_0x1106d1=_[_0x1d7d('0x40')]({},_0x1106d1,_0x31b850[_0x1d7d('0x41')]);return db[_0x1d7d('0x42')][_0x1d7d('0x47')](_0x1106d1)[_0x1d7d('0x28')](handleEntityNotFound(_0x671580,null))[_0x1d7d('0x28')](respondWithResult(_0x671580,null))['catch'](handleError(_0x671580,null));};exports[_0x1d7d('0x48')]=function(_0x5904e0,_0xbfe60){return db['VoiceRecording'][_0x1d7d('0x48')](_0x5904e0[_0x1d7d('0x49')],{})[_0x1d7d('0x28')](respondWithResult(_0xbfe60,0xc9))[_0x1d7d('0x4a')](handleError(_0xbfe60,null));};exports['update']=function(_0x2dbb61,_0x5535d4){if(_0x2dbb61['body']['id']){delete _0x2dbb61[_0x1d7d('0x49')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x2dbb61[_0x1d7d('0x4b')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x5535d4,null))['then'](saveUpdates(_0x2dbb61[_0x1d7d('0x49')],null))[_0x1d7d('0x28')](respondWithResult(_0x5535d4,null))['catch'](handleError(_0x5535d4,null));};exports[_0x1d7d('0x4c')]=function(_0x2b9faa,_0xa64dbe){return db[_0x1d7d('0x42')]['describe']()['then'](respondWithResult(_0xa64dbe,null))[_0x1d7d('0x4a')](handleError(_0xa64dbe,null));};exports[_0x1d7d('0x4d')]=function(_0x35ff5d,_0x3938d0,_0x3cc5b7){var _0x550c9f=require(_0x1d7d('0x4e'));var _0x24e0b7=![];var _0x344b66={};if(_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]===_0x1d7d('0x50')){_0x344b66[_0x1d7d('0x50')]=_0x35ff5d['params']['id'];}else{_0x344b66['id']=_0x35ff5d[_0x1d7d('0x4b')]['id'];}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x344b66,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3938d0,null))[_0x1d7d('0x28')](function(_0x2d4cc3){if(_0x2d4cc3){var _0x3f5434=_0x2d4cc3['value'];var _0x7f41e=util[_0x1d7d('0x32')]('%s.cypher',_0x3f5434);if(fs[_0x1d7d('0x51')](_0x7f41e)){_0x24e0b7=!![];return _0x550c9f[_0x1d7d('0x52')](_0x7f41e,_0x3f5434,config[_0x1d7d('0x53')][_0x1d7d('0x54')])['then'](function(){return _0x2d4cc3;});}return _0x2d4cc3;}})[_0x1d7d('0x28')](function(_0x202af4){if(_0x202af4){var _0x4ba6ec=_0x202af4['value'];if(!fs[_0x1d7d('0x51')](_0x4ba6ec)){throw new db[(_0x1d7d('0x55'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x202af4[_0x1d7d('0x56')]){return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,_0x202af4[_0x1d7d('0x56')]+path[_0x1d7d('0x57')](_0x4ba6ec),function(){if(_0x24e0b7){fs['unlink'](_0x4ba6ec);}});}else{return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,function(_0x4b7a81){if(_0x24e0b7){fs[_0x1d7d('0x58')](_0x4ba6ec);}});}}})[_0x1d7d('0x4a')](function(_0x14078d){if(_0x14078d[_0x1d7d('0x59')]==='VoiceRecording\x20not\x20found'){_0x3938d0[_0x1d7d('0x1c')](0x194)[_0x1d7d('0x2c')](_0x1d7d('0x5a'));}else{return handleError(_0x3938d0,null);}});};exports[_0x1d7d('0x5b')]=function(_0x28ec14,_0x1cafd4,_0x17a365){var _0x2bd2a0=require(_0x1d7d('0x4e'));var _0x17c967=![];var _0x44a187={'$and':[db[_0x1d7d('0x5c')][_0x1d7d('0x3f')](db[_0x1d7d('0x5c')]['fn'](_0x1d7d('0x5d'),db['sequelize'][_0x1d7d('0x5e')]('uniqueid')),_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x5f')])]};if(_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]==='uniqueid'){_0x44a187[_0x1d7d('0x60')][_0x1d7d('0x61')]({'uniqueid':_0x28ec14['params']['id']});}else{_0x44a187[_0x1d7d('0x60')]['push']({'id':_0x28ec14[_0x1d7d('0x4b')]['id']});}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x44a187,'attributes':['id',_0x1d7d('0x62')],'raw':!![]})[_0x1d7d('0x28')](handleEntityNotFound(_0x1cafd4,null))[_0x1d7d('0x28')](function(_0x516aa0){if(_0x516aa0){var _0x3768a7=util[_0x1d7d('0x32')]('%s.cypher',_0x516aa0[_0x1d7d('0x62')]);if(fs[_0x1d7d('0x51')](_0x3768a7)){_0x17c967=!![];return _0x2bd2a0[_0x1d7d('0x52')](_0x3768a7,_0x516aa0['value'],config[_0x1d7d('0x53')][_0x1d7d('0x54')])[_0x1d7d('0x28')](function(){return _0x516aa0;});}return _0x516aa0;}})[_0x1d7d('0x28')](function(_0x5f15b7){if(_0x5f15b7){if(!fs[_0x1d7d('0x51')](_0x5f15b7[_0x1d7d('0x62')])){throw new db[(_0x1d7d('0x55'))][(_0x1d7d('0x63'))](_0x1d7d('0x64'));}if(_0x5f15b7['filename']){return _0x1cafd4[_0x1d7d('0x4d')](_0x5f15b7[_0x1d7d('0x62')],_0x5f15b7['filename']+path[_0x1d7d('0x57')](_0x5f15b7[_0x1d7d('0x62')]),function(){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}else{return _0x1cafd4['download'](_0x5f15b7[_0x1d7d('0x62')],function(_0x4a3159){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}}})[_0x1d7d('0x4a')](handleError(_0x1cafd4,null));};exports['destroy']=function(_0x4de5ee,_0x3818f4){return db[_0x1d7d('0x42')]['find']({'where':{'id':_0x4de5ee[_0x1d7d('0x4b')]['id']}})['then'](function(_0x6e9ee6){if(!_0x6e9ee6)throw new ReferenceError(_0x1d7d('0x65'));return _0x6e9ee6;})[_0x1d7d('0x28')](function(_0x446d39){var _0x30cf98=_0x446d39[_0x1d7d('0x62')];logger[_0x1d7d('0x66')](_0x1d7d('0x67'),_0x30cf98);if(!_[_0x1d7d('0x68')](_0x446d39[_0x1d7d('0x62')])&&fs[_0x1d7d('0x51')](_0x30cf98)){logger['info']('File:\x20\x22'+_0x30cf98+_0x1d7d('0x69'));fs[_0x1d7d('0x6a')](_0x30cf98);}_0x30cf98=_0x30cf98+_0x1d7d('0x6b');if(!_['isNil'](_0x446d39[_0x1d7d('0x62')])&&fs['existsSync'](_0x30cf98)){logger[_0x1d7d('0x66')](_0x1d7d('0x6c')+_0x30cf98+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1d7d('0x6a')](_0x30cf98);}return _0x446d39;})[_0x1d7d('0x28')](function(_0x4a8f1f){if(!_0x4a8f1f)throw new InternalError();return _0x4a8f1f[_0x1d7d('0x6d')]();})[_0x1d7d('0x28')](function(){_0x3818f4[_0x1d7d('0x1c')](0xcc)['end']();})['catch'](function(_0x2f774f){var _0x87e6aa=0x1f4;if(e instanceof ReferenceError){_0x87e6aa=0x194;}else if(e instanceof InternalError){_0x87e6aa=0x1f4;}logger['error'](_0x2f774f[_0x1d7d('0x6e')]);if(_0x2f774f[_0x1d7d('0x2b')]){delete _0x2f774f[_0x1d7d('0x2b')];}_0x3818f4[_0x1d7d('0x1c')](_0x87e6aa)['send'](_0x2f774f);});}; \ No newline at end of file +var _0x0b0e=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject','update','then','destroy','end','error','name','index','map','VoiceRecording','fieldName','type','key','model','differenceBy','format','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','merge','options','count','includeAll','findAll','catch','show','params','keys','find','create','body','describe','download','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','Not\x20found','downloads','sequelize','MD5','token','$and','push','Entity\x20not\x20found','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','stack','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis'];(function(_0xb87061,_0x5d2711){var _0x236ee4=function(_0x1ab5be){while(--_0x1ab5be){_0xb87061['push'](_0xb87061['shift']());}};_0x236ee4(++_0x5d2711);}(_0x0b0e,0x187));var _0xe0b0=function(_0x529f1c,_0x437ed1){_0x529f1c=_0x529f1c-0x0;var _0x4d57ab=_0x0b0e[_0x529f1c];return _0x4d57ab;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](_[_0xe0b0('0x24')](_0x5200a6,'name'),[_0xe0b0('0x2b')]);_0x3ec2[_0xe0b0('0x2c')]=_['keys'](_0x3c3bc2['query']);_0x3ec2[_0xe0b0('0x2d')]=_[_0xe0b0('0x2e')](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2c')]);_0x1d91ad[_0xe0b0('0x2f')]=_['intersection'](_0x3ec2[_0xe0b0('0x29')],qs[_0xe0b0('0x30')](_0x3c3bc2[_0xe0b0('0x2c')][_0xe0b0('0x30')]));_0x1d91ad[_0xe0b0('0x2f')]=_0x1d91ad['attributes'][_0xe0b0('0x31')]?_0x1d91ad[_0xe0b0('0x2f')]:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2c')][_0xe0b0('0x32')](_0xe0b0('0x33'))){_0x1d91ad[_0xe0b0('0x34')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2c')][_0xe0b0('0x34')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2c')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x35')]=qs['sort'](_0x3c3bc2[_0xe0b0('0x2c')][_0xe0b0('0x36')]);_0x1d91ad[_0xe0b0('0x37')]=qs[_0xe0b0('0x2d')](_[_0xe0b0('0x38')](_0x3c3bc2[_0xe0b0('0x2c')],_0x3ec2[_0xe0b0('0x2d')]));if(_0x3c3bc2['query']['filter']){_0x1d91ad['where']=_['merge'](_0x1d91ad[_0xe0b0('0x37')],{'$or':_[_0xe0b0('0x24')](_0x5200a6,function(_0xe6f635){if(_0xe6f635['type']!==_0xe0b0('0x39')){var _0x352c09={};_0x352c09[_0xe6f635[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2c')]['filter']+'%'};return _0x352c09;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2[_0xe0b0('0x3b')]);var _0x43d352={'where':_0x1d91ad[_0xe0b0('0x37')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3c')](_0x43d352)[_0xe0b0('0x1e')](function(_0x115a69){_0x10745d[_0xe0b0('0x3c')]=_0x115a69;if(_0x3c3bc2['query'][_0xe0b0('0x3d')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')][_0xe0b0('0x3e')](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x74f3fa){_0x10745d['rows']=_0x74f3fa;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))[_0xe0b0('0x3f')](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x40')]=function(_0x402a0e,_0x19c80e){var _0x1c12bd={'raw':![],'where':{'id':_0x402a0e[_0xe0b0('0x41')]['id']}},_0x3ad564={};_0x3ad564['model']=_[_0xe0b0('0x42')](db[_0xe0b0('0x25')]['rawAttributes']);_0x3ad564['query']=_[_0xe0b0('0x42')](_0x402a0e[_0xe0b0('0x2c')]);_0x3ad564['filters']=_[_0xe0b0('0x2e')](_0x3ad564[_0xe0b0('0x29')],_0x3ad564[_0xe0b0('0x2c')]);_0x1c12bd[_0xe0b0('0x2f')]=_[_0xe0b0('0x2e')](_0x3ad564['model'],qs['fields'](_0x402a0e['query'][_0xe0b0('0x30')]));_0x1c12bd[_0xe0b0('0x2f')]=_0x1c12bd['attributes'][_0xe0b0('0x31')]?_0x1c12bd[_0xe0b0('0x2f')]:_0x3ad564[_0xe0b0('0x29')];if(_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x3d')]){_0x1c12bd['include']=[{'all':!![]}];}_0x1c12bd=_['merge']({},_0x1c12bd,_0x402a0e[_0xe0b0('0x3b')]);return db[_0xe0b0('0x25')][_0xe0b0('0x43')](_0x1c12bd)[_0xe0b0('0x1e')](handleEntityNotFound(_0x19c80e,null))[_0xe0b0('0x1e')](respondWithResult(_0x19c80e,null))['catch'](handleError(_0x19c80e,null));};exports[_0xe0b0('0x44')]=function(_0x11d4fd,_0x534340){return db['VoiceRecording']['create'](_0x11d4fd[_0xe0b0('0x45')],{})[_0xe0b0('0x1e')](respondWithResult(_0x534340,0xc9))[_0xe0b0('0x3f')](handleError(_0x534340,null));};exports[_0xe0b0('0x1d')]=function(_0x5b1756,_0x2e2b10){if(_0x5b1756[_0xe0b0('0x45')]['id']){delete _0x5b1756['body']['id'];}return db['VoiceRecording'][_0xe0b0('0x43')]({'where':{'id':_0x5b1756[_0xe0b0('0x41')]['id']}})['then'](handleEntityNotFound(_0x2e2b10,null))[_0xe0b0('0x1e')](saveUpdates(_0x5b1756[_0xe0b0('0x45')],null))['then'](respondWithResult(_0x2e2b10,null))['catch'](handleError(_0x2e2b10,null));};exports[_0xe0b0('0x46')]=function(_0x511679,_0x165dc8){return db[_0xe0b0('0x25')][_0xe0b0('0x46')]()[_0xe0b0('0x1e')](respondWithResult(_0x165dc8,null))[_0xe0b0('0x3f')](handleError(_0x165dc8,null));};exports[_0xe0b0('0x47')]=function(_0x5f5486,_0x5d018d,_0x2ef908){var _0x5d380a=require('../../components/encryptor');var _0x249d9a=![];var _0x222174={};if(_0x5f5486['query']['type']&&_0x5f5486[_0xe0b0('0x2c')][_0xe0b0('0x27')]===_0xe0b0('0x48')){_0x222174[_0xe0b0('0x48')]=_0x5f5486[_0xe0b0('0x41')]['id'];}else{_0x222174['id']=_0x5f5486[_0xe0b0('0x41')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':_0x222174,'attributes':['id',_0xe0b0('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x5d018d,null))[_0xe0b0('0x1e')](function(_0x54106c){if(_0x54106c){var _0x5b2055=_0x54106c[_0xe0b0('0x49')];var _0x237e8c=util[_0xe0b0('0x2b')](_0xe0b0('0x4a'),_0x5b2055);if(fs[_0xe0b0('0x4b')](_0x237e8c)){_0x249d9a=!![];return _0x5d380a[_0xe0b0('0x4c')](_0x237e8c,_0x5b2055,config[_0xe0b0('0x4d')][_0xe0b0('0x4e')])[_0xe0b0('0x1e')](function(){return _0x54106c;});}return _0x54106c;}})['then'](function(_0x253ab0){if(_0x253ab0){var _0x57ccc9=_0x253ab0[_0xe0b0('0x49')];if(!fs[_0xe0b0('0x4b')](_0x57ccc9)){throw new db[(_0xe0b0('0x4f'))][(_0xe0b0('0x50'))](_0xe0b0('0x51'));}if(_0x253ab0[_0xe0b0('0x52')]){return _0x5d018d['download'](_0x57ccc9,_0x253ab0[_0xe0b0('0x52')]+path[_0xe0b0('0x53')](_0x57ccc9),function(){if(_0x249d9a){fs[_0xe0b0('0x54')](_0x57ccc9);}});}else{return _0x5d018d[_0xe0b0('0x47')](_0x57ccc9,function(_0x3bb6d6){if(_0x249d9a){fs[_0xe0b0('0x54')](_0x57ccc9);}});}}})[_0xe0b0('0x3f')](function(_0x1a60d2){if(_0x1a60d2[_0xe0b0('0x55')]===_0xe0b0('0x51')){_0x5d018d[_0xe0b0('0x18')](0x194)[_0xe0b0('0x56')](_0xe0b0('0x57'));}else{return handleError(_0x5d018d,null);}});};exports[_0xe0b0('0x58')]=function(_0xcdf97,_0x34c642,_0x4c7661){var _0x155738=require('../../components/encryptor');var _0x46627e=![];var _0xe7fbac={'$and':[db[_0xe0b0('0x59')][_0xe0b0('0x37')](db[_0xe0b0('0x59')]['fn'](_0xe0b0('0x5a'),db[_0xe0b0('0x59')]['col']('uniqueid')),_0xcdf97[_0xe0b0('0x2c')][_0xe0b0('0x5b')])]};if(_0xcdf97[_0xe0b0('0x2c')]['type']&&_0xcdf97[_0xe0b0('0x2c')][_0xe0b0('0x27')]===_0xe0b0('0x48')){_0xe7fbac[_0xe0b0('0x5c')][_0xe0b0('0x5d')]({'uniqueid':_0xcdf97['params']['id']});}else{_0xe7fbac[_0xe0b0('0x5c')][_0xe0b0('0x5d')]({'id':_0xcdf97[_0xe0b0('0x41')]['id']});}return db['VoiceRecording'][_0xe0b0('0x43')]({'where':_0xe7fbac,'attributes':['id',_0xe0b0('0x49')],'raw':!![]})['then'](handleEntityNotFound(_0x34c642,null))[_0xe0b0('0x1e')](function(_0x4c5478){if(_0x4c5478){var _0x5bb697=util[_0xe0b0('0x2b')]('%s.cypher',_0x4c5478['value']);if(fs[_0xe0b0('0x4b')](_0x5bb697)){_0x46627e=!![];return _0x155738[_0xe0b0('0x4c')](_0x5bb697,_0x4c5478[_0xe0b0('0x49')],config[_0xe0b0('0x4d')]['recording'])[_0xe0b0('0x1e')](function(){return _0x4c5478;});}return _0x4c5478;}})[_0xe0b0('0x1e')](function(_0x3e7fb4){if(_0x3e7fb4){if(!fs[_0xe0b0('0x4b')](_0x3e7fb4[_0xe0b0('0x49')])){throw new db[(_0xe0b0('0x4f'))][(_0xe0b0('0x50'))](_0xe0b0('0x51'));}if(_0x3e7fb4['filename']){return _0x34c642['download'](_0x3e7fb4[_0xe0b0('0x49')],_0x3e7fb4[_0xe0b0('0x52')]+path[_0xe0b0('0x53')](_0x3e7fb4['value']),function(){if(_0x46627e){fs['unlink'](_0x3e7fb4[_0xe0b0('0x49')]);}});}else{return _0x34c642[_0xe0b0('0x47')](_0x3e7fb4['value'],function(_0x5eca3d){if(_0x46627e){fs[_0xe0b0('0x54')](_0x3e7fb4[_0xe0b0('0x49')]);}});}}})[_0xe0b0('0x3f')](handleError(_0x34c642,null));};exports[_0xe0b0('0x1f')]=function(_0x3b263f,_0x15f0f8){return db[_0xe0b0('0x25')][_0xe0b0('0x43')]({'where':{'id':_0x3b263f['params']['id']}})[_0xe0b0('0x1e')](function(_0x12e245){if(!_0x12e245)throw new ReferenceError(_0xe0b0('0x5e'));return _0x12e245;})['then'](function(_0x4fbf44){var _0x4f4b45=_0x4fbf44['value'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x4f4b45);if(!_[_0xe0b0('0x5f')](_0x4fbf44['value'])&&fs['existsSync'](_0x4f4b45)){logger[_0xe0b0('0x60')](_0xe0b0('0x61')+_0x4f4b45+_0xe0b0('0x62'));fs[_0xe0b0('0x63')](_0x4f4b45);}_0x4f4b45=_0x4f4b45+_0xe0b0('0x64');if(!_[_0xe0b0('0x5f')](_0x4fbf44[_0xe0b0('0x49')])&&fs[_0xe0b0('0x4b')](_0x4f4b45)){logger['info'](_0xe0b0('0x61')+_0x4f4b45+_0xe0b0('0x62'));fs[_0xe0b0('0x63')](_0x4f4b45);}return _0x4fbf44;})[_0xe0b0('0x1e')](function(_0x173ed8){if(!_0x173ed8)throw new InternalError();return _0x173ed8[_0xe0b0('0x1f')]();})[_0xe0b0('0x1e')](function(){_0x15f0f8['status'](0xcc)[_0xe0b0('0x20')]();})['catch'](function(_0x2c9147){var _0x28b927=0x1f4;if(e instanceof ReferenceError){_0x28b927=0x194;}else if(e instanceof InternalError){_0x28b927=0x1f4;}logger[_0xe0b0('0x21')](_0x2c9147[_0xe0b0('0x65')]);if(_0x2c9147['name']){delete _0x2c9147[_0xe0b0('0x22')];}_0x15f0f8[_0xe0b0('0x18')](_0x28b927)['send'](_0x2c9147);});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index 7306804..72d842c 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 _0x80bd=['lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording','uniqueid'];(function(_0xe89d5c,_0x19c854){var _0x1ce92c=function(_0x5988e1){while(--_0x5988e1){_0xe89d5c['push'](_0xe89d5c['shift']());}};_0x1ce92c(++_0x19c854);}(_0x80bd,0x1a0));var _0xd80b=function(_0x3ffac8,_0x424217){_0x3ffac8=_0x3ffac8-0x0;var _0x3ce667=_0x80bd[_0x3ffac8];return _0x3ce667;};'use strict';var _=require(_0xd80b('0x0'));var util=require(_0xd80b('0x1'));var logger=require(_0xd80b('0x2'))('api');var moment=require(_0xd80b('0x3'));var BPromise=require(_0xd80b('0x4'));var rp=require(_0xd80b('0x5'));var fs=require('fs');var path=require(_0xd80b('0x6'));var rimraf=require(_0xd80b('0x7'));var config=require(_0xd80b('0x8'));var attributes=require(_0xd80b('0x9'));module[_0xd80b('0xa')]=function(_0x1303bf,_0x3389b0){return _0x1303bf['define'](_0xd80b('0xb'),attributes,{'tableName':'voice_recordings','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xd80b('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5a5c=['../../config/environment','./voiceRecording.attributes','exports','define','voice_recordings','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2f912a,_0x65d6d2){var _0x8bb9f4=function(_0x2b9bd7){while(--_0x2b9bd7){_0x2f912a['push'](_0x2f912a['shift']());}};_0x8bb9f4(++_0x65d6d2);}(_0x5a5c,0x110));var _0xc5a5=function(_0x336376,_0xe4b28d){_0x336376=_0x336376-0x0;var _0x1d2a8e=_0x5a5c[_0x336376];return _0x1d2a8e;};'use strict';var _=require(_0xc5a5('0x0'));var util=require(_0xc5a5('0x1'));var logger=require(_0xc5a5('0x2'))(_0xc5a5('0x3'));var moment=require(_0xc5a5('0x4'));var BPromise=require(_0xc5a5('0x5'));var rp=require(_0xc5a5('0x6'));var fs=require('fs');var path=require(_0xc5a5('0x7'));var rimraf=require('rimraf');var config=require(_0xc5a5('0x8'));var attributes=require(_0xc5a5('0x9'));module[_0xc5a5('0xa')]=function(_0x4f3a30,_0x1a8ede){return _0x4f3a30[_0xc5a5('0xb')]('VoiceRecording',attributes,{'tableName':_0xc5a5('0xc'),'paranoid':![],'indexes':[{'name':_0xc5a5('0xd'),'fields':[_0xc5a5('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index b9f4d34..82a835b 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(_0x512980,_0x401e50){var _0x571f0a=function(_0x456237){while(--_0x456237){_0x512980['push'](_0x512980['shift']());}};_0x571f0a(++_0x401e50);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5037ab,_0x43209e){_0x5037ab=_0x5037ab-0x0;var _0x512adb=_0xa9e0[_0x5037ab];return _0x512adb;};'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(_0x4f0c2b,_0x2c9d14){var _0x526436=function(_0x2e13b6){while(--_0x2e13b6){_0x4f0c2b['push'](_0x4f0c2b['shift']());}};_0x526436(++_0x2c9d14);}(_0xa9e0,0x123));var _0x0a9e=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xa9e0[_0x92c450];return _0x2a9599;};'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 a167a8d..cc8a86f 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 _0x9536=['connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x3d9eac,_0x39e16a){var _0x35d022=function(_0x33819d){while(--_0x33819d){_0x3d9eac['push'](_0x3d9eac['shift']());}};_0x35d022(++_0x39e16a);}(_0x9536,0x179));var _0x6953=function(_0x478414,_0xcf142d){_0x478414=_0x478414-0x0;var _0x5eb6b9=_0x9536[_0x478414];return _0x5eb6b9;};'use strict';var multer=require(_0x6953('0x0'));var util=require(_0x6953('0x1'));var path=require(_0x6953('0x2'));var timeout=require(_0x6953('0x3'));var express=require('express');var router=express[_0x6953('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6953('0x5'));var config=require(_0x6953('0x6'));var controller=require(_0x6953('0x7'));router[_0x6953('0x8')]('/',auth[_0x6953('0x9')](),controller['index']);router[_0x6953('0x8')](_0x6953('0xa'),auth[_0x6953('0x9')](),controller[_0x6953('0xb')]);router[_0x6953('0xc')]('/',auth['isAuthenticated'](),controller[_0x6953('0xd')]);router[_0x6953('0xe')](_0x6953('0xa'),auth['isAuthenticated'](),controller[_0x6953('0xf')]);router[_0x6953('0x10')](_0x6953('0xa'),auth[_0x6953('0x9')](),controller[_0x6953('0x11')]);module[_0x6953('0x12')]=router; \ No newline at end of file +var _0x5fab=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','index','show','post','create','put','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router'];(function(_0x2f3cf4,_0x4b6258){var _0x6174ed=function(_0x37ae88){while(--_0x37ae88){_0x2f3cf4['push'](_0x2f3cf4['shift']());}};_0x6174ed(++_0x4b6258);}(_0x5fab,0x177));var _0xb5fa=function(_0x17928f,_0x4ad33f){_0x17928f=_0x17928f-0x0;var _0x500b63=_0x5fab[_0x17928f];return _0x500b63;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')]('/',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xb')]);router['get']('/:id',auth[_0xb5fa('0xa')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0xd')]('/',auth['isAuthenticated'](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xf')](_0xb5fa('0x10'),auth['isAuthenticated'](),controller['update']);router[_0xb5fa('0x11')](_0xb5fa('0x10'),auth[_0xb5fa('0xa')](),controller[_0xb5fa('0x12')]);module[_0xb5fa('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 9c9e894..22c9441 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 _0xaea6=['moment','exports','ENUM','blind','attended','STRING','sequelize'];(function(_0x30466c,_0x3e7957){var _0x3b4ea2=function(_0x469fe1){while(--_0x469fe1){_0x30466c['push'](_0x30466c['shift']());}};_0x3b4ea2(++_0x3e7957);}(_0xaea6,0x6f));var _0x6aea=function(_0xd6adb2,_0xcecc2b){_0xd6adb2=_0xd6adb2-0x0;var _0x1590ef=_0xaea6[_0xd6adb2];return _0x1590ef;};'use strict';var Sequelize=require(_0x6aea('0x0'));var moment=require(_0x6aea('0x1'));module[_0x6aea('0x2')]={'type':{'type':Sequelize[_0x6aea('0x3')](_0x6aea('0x4'),_0x6aea('0x5'))},'result':{'type':Sequelize['STRING']},'transfererchannel':{'type':Sequelize[_0x6aea('0x6')]},'transferercalleridnum':{'type':Sequelize[_0x6aea('0x6')]},'transferercalleridname':{'type':Sequelize[_0x6aea('0x6')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x6aea('0x6')]},'transfereraccountcode':{'type':Sequelize[_0x6aea('0x6')]},'transferercontext':{'type':Sequelize[_0x6aea('0x6')]},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x6aea('0x6')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x6aea('0x6')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x6aea('0x6')]},'transfereeconnectedlinename':{'type':Sequelize[_0x6aea('0x6')]},'transfereeaccountcode':{'type':Sequelize['STRING']},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x6aea('0x6')]},'transfereelinkedid':{'type':Sequelize[_0x6aea('0x6')]},'isexternal':{'type':Sequelize[_0x6aea('0x3')]('Yes','No')},'context':{'type':Sequelize[_0x6aea('0x6')]},'extension':{'type':Sequelize[_0x6aea('0x6')]}}; \ No newline at end of file +var _0xcb71=['Yes','sequelize','moment','ENUM','blind','attended','STRING'];(function(_0xe8e91,_0x401ca3){var _0x1258fe=function(_0x45ac8a){while(--_0x45ac8a){_0xe8e91['push'](_0xe8e91['shift']());}};_0x1258fe(++_0x401ca3);}(_0xcb71,0xf6));var _0x1cb7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcb71[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x1cb7('0x0'));var moment=require(_0x1cb7('0x1'));module['exports']={'type':{'type':Sequelize[_0x1cb7('0x2')](_0x1cb7('0x3'),_0x1cb7('0x4'))},'result':{'type':Sequelize[_0x1cb7('0x5')]},'transfererchannel':{'type':Sequelize[_0x1cb7('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x1cb7('0x5')]},'transferercalleridname':{'type':Sequelize[_0x1cb7('0x5')]},'transfererconnectedlinenum':{'type':Sequelize[_0x1cb7('0x5')]},'transfererconnectedlinename':{'type':Sequelize[_0x1cb7('0x5')]},'transfereraccountcode':{'type':Sequelize['STRING']},'transferercontext':{'type':Sequelize[_0x1cb7('0x5')]},'transfererexten':{'type':Sequelize[_0x1cb7('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x1cb7('0x5')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x1cb7('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x1cb7('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x1cb7('0x5')]},'transfereeconnectedlinename':{'type':Sequelize[_0x1cb7('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x1cb7('0x5')]},'transfereecontext':{'type':Sequelize[_0x1cb7('0x5')]},'transfereeexten':{'type':Sequelize[_0x1cb7('0x5')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x1cb7('0x6'),'No')},'context':{'type':Sequelize[_0x1cb7('0x5')]},'extension':{'type':Sequelize[_0x1cb7('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index 30ed34f..58a43d6 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 _0x5c00=['catch','show','params','rawAttributes','create','body','find','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','map','VoiceTransferReport','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x5c00,0x17e));var _0x05c0=function(_0x466e6b,_0x4053fd){_0x466e6b=_0x466e6b-0x0;var _0x118deb=_0x5c00[_0x466e6b];return _0x118deb;};'use strict';var pdf=require(_0x05c0('0x0'));var emlformat=require(_0x05c0('0x1'));var rimraf=require(_0x05c0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x05c0('0x3'));var rp=require('request-promise');var moment=require(_0x05c0('0x4'));var BPromise=require(_0x05c0('0x5'));var Mustache=require(_0x05c0('0x6'));var util=require(_0x05c0('0x7'));var path=require('path');var sox=require(_0x05c0('0x8'));var csv=require(_0x05c0('0x9'));var ejs=require(_0x05c0('0xa'));var fs=require('fs');var _=require(_0x05c0('0xb'));var squel=require('squel');var crypto=require(_0x05c0('0xc'));var jsforce=require(_0x05c0('0xd'));var deskjs=require(_0x05c0('0xe'));var toCsv=require('to-csv');var querystring=require(_0x05c0('0xf'));var Papa=require(_0x05c0('0x10'));var Redis=require(_0x05c0('0x11'));var authService=require(_0x05c0('0x12'));var qs=require(_0x05c0('0x13'));var as=require(_0x05c0('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x05c0('0x15'));var utils=require('../../config/utils');var config=require(_0x05c0('0x16'));var db=require(_0x05c0('0x17'))['db'];function respondWithStatusCode(_0xa50678,_0x5a3e65){_0x5a3e65=_0x5a3e65||0xcc;return function(_0x4e39d4){if(_0x4e39d4){return _0xa50678['sendStatus'](_0x5a3e65);}return _0xa50678[_0x05c0('0x18')](_0x5a3e65)[_0x05c0('0x19')]();};}function respondWithResult(_0x20ff48,_0x12deeb){_0x12deeb=_0x12deeb||0xc8;return function(_0x25764b){if(_0x25764b){return _0x20ff48[_0x05c0('0x18')](_0x12deeb)[_0x05c0('0x1a')](_0x25764b);}};}function respondWithFilteredResult(_0xd7b487,_0x4c3e54){return function(_0x238e25){if(_0x238e25){var _0x161a5f=_0x238e25[_0x05c0('0x1b')],_0x4bb164=_0x4c3e54[_0x05c0('0x1c')],_0x29e6b0=_0x4c3e54[_0x05c0('0x1c')]+_0x4c3e54[_0x05c0('0x1d')],_0x27c7bd;if(_0x29e6b0>=_0x161a5f){_0x29e6b0=_0x161a5f;_0x27c7bd=0xc8;}else{_0x27c7bd=0xce;}_0xd7b487['status'](_0x27c7bd);return _0xd7b487[_0x05c0('0x1e')](_0x05c0('0x1f'),_0x4bb164+'-'+_0x29e6b0+'/'+_0x161a5f)[_0x05c0('0x1a')](_0x238e25);}return null;};}function patchUpdates(_0x54fef0){return function(_0x40d905){try{jsonpatch[_0x05c0('0x20')](_0x40d905,_0x54fef0,!![]);}catch(_0x10685b){return BPromise[_0x05c0('0x21')](_0x10685b);}return _0x40d905[_0x05c0('0x22')]();};}function saveUpdates(_0x5e4742,_0x407c1f){return function(_0x1014ef){if(_0x1014ef){return _0x1014ef['update'](_0x5e4742)['then'](function(_0x5e4b80){return _0x5e4b80;});}return null;};}function removeEntity(_0x1c448b,_0x2055a3){return function(_0x83f29){if(_0x83f29){return _0x83f29[_0x05c0('0x23')]()[_0x05c0('0x24')](function(){_0x1c448b[_0x05c0('0x18')](0xcc)[_0x05c0('0x19')]();});}};}function handleEntityNotFound(_0x5b4eef,_0x9b4930){return function(_0x1abbf3){if(!_0x1abbf3){_0x5b4eef['sendStatus'](0x194);}return _0x1abbf3;};}function handleError(_0x530966,_0x4da6d6){_0x4da6d6=_0x4da6d6||0x1f4;return function(_0x5dc2b7){logger['error'](_0x5dc2b7[_0x05c0('0x25')]);if(_0x5dc2b7[_0x05c0('0x26')]){delete _0x5dc2b7['name'];}_0x530966[_0x05c0('0x18')](_0x4da6d6)[_0x05c0('0x27')](_0x5dc2b7);};}exports[_0x05c0('0x28')]=function(_0x889c75,_0x58769a){var _0x7d5ccd={},_0x1c14b1={},_0x2ceaed={'count':0x0,'rows':[]};var _0x200e80=_[_0x05c0('0x29')](db[_0x05c0('0x2a')]['rawAttributes'],function(_0x56ba64){return{'name':_0x56ba64[_0x05c0('0x2b')],'type':_0x56ba64[_0x05c0('0x2c')][_0x05c0('0x2d')]};});_0x1c14b1[_0x05c0('0x2e')]=_[_0x05c0('0x29')](_0x200e80,_0x05c0('0x26'));_0x1c14b1[_0x05c0('0x2f')]=_[_0x05c0('0x30')](_0x889c75[_0x05c0('0x2f')]);_0x1c14b1[_0x05c0('0x31')]=_[_0x05c0('0x32')](_0x1c14b1[_0x05c0('0x2e')],_0x1c14b1['query']);_0x7d5ccd['attributes']=_[_0x05c0('0x32')](_0x1c14b1[_0x05c0('0x2e')],qs[_0x05c0('0x33')](_0x889c75['query'][_0x05c0('0x33')]));_0x7d5ccd[_0x05c0('0x34')]=_0x7d5ccd['attributes'][_0x05c0('0x35')]?_0x7d5ccd['attributes']:_0x1c14b1[_0x05c0('0x2e')];if(!_0x889c75[_0x05c0('0x2f')][_0x05c0('0x36')](_0x05c0('0x37'))){_0x7d5ccd[_0x05c0('0x1d')]=qs[_0x05c0('0x1d')](_0x889c75[_0x05c0('0x2f')][_0x05c0('0x1d')]);_0x7d5ccd[_0x05c0('0x1c')]=qs[_0x05c0('0x1c')](_0x889c75[_0x05c0('0x2f')][_0x05c0('0x1c')]);}_0x7d5ccd[_0x05c0('0x38')]=qs[_0x05c0('0x39')](_0x889c75[_0x05c0('0x2f')][_0x05c0('0x39')]);_0x7d5ccd[_0x05c0('0x3a')]=qs[_0x05c0('0x31')](_[_0x05c0('0x3b')](_0x889c75[_0x05c0('0x2f')],_0x1c14b1[_0x05c0('0x31')]));if(_0x889c75[_0x05c0('0x2f')][_0x05c0('0x3c')]){_0x7d5ccd[_0x05c0('0x3a')]=_[_0x05c0('0x3d')](_0x7d5ccd[_0x05c0('0x3a')],{'$or':_[_0x05c0('0x29')](_0x200e80,function(_0x3bc6cc){if(_0x3bc6cc[_0x05c0('0x2c')]!==_0x05c0('0x3e')){var _0x1f493c={};_0x1f493c[_0x3bc6cc[_0x05c0('0x26')]]={'$like':'%'+_0x889c75[_0x05c0('0x2f')]['filter']+'%'};return _0x1f493c;}})});}_0x7d5ccd=_[_0x05c0('0x3d')]({},_0x7d5ccd,_0x889c75[_0x05c0('0x3f')]);var _0x41fa50={'where':_0x7d5ccd[_0x05c0('0x3a')]};return db['VoiceTransferReport']['count'](_0x41fa50)[_0x05c0('0x24')](function(_0x2540db){_0x2ceaed[_0x05c0('0x1b')]=_0x2540db;if(_0x889c75['query'][_0x05c0('0x40')]){_0x7d5ccd[_0x05c0('0x41')]=[{'all':!![]}];}return db[_0x05c0('0x2a')][_0x05c0('0x42')](_0x7d5ccd);})['then'](function(_0x152c6a){_0x2ceaed[_0x05c0('0x43')]=_0x152c6a;return _0x2ceaed;})['then'](respondWithFilteredResult(_0x58769a,_0x7d5ccd))[_0x05c0('0x44')](handleError(_0x58769a,null));};exports[_0x05c0('0x45')]=function(_0x4557db,_0xcbd98){var _0x164e3a={'raw':!![],'where':{'id':_0x4557db[_0x05c0('0x46')]['id']}},_0x398a6e={};_0x398a6e['model']=_['keys'](db[_0x05c0('0x2a')][_0x05c0('0x47')]);_0x398a6e[_0x05c0('0x2f')]=_[_0x05c0('0x30')](_0x4557db[_0x05c0('0x2f')]);_0x398a6e['filters']=_[_0x05c0('0x32')](_0x398a6e[_0x05c0('0x2e')],_0x398a6e[_0x05c0('0x2f')]);_0x164e3a[_0x05c0('0x34')]=_[_0x05c0('0x32')](_0x398a6e[_0x05c0('0x2e')],qs[_0x05c0('0x33')](_0x4557db['query'][_0x05c0('0x33')]));_0x164e3a[_0x05c0('0x34')]=_0x164e3a[_0x05c0('0x34')][_0x05c0('0x35')]?_0x164e3a[_0x05c0('0x34')]:_0x398a6e[_0x05c0('0x2e')];if(_0x4557db[_0x05c0('0x2f')][_0x05c0('0x40')]){_0x164e3a[_0x05c0('0x41')]=[{'all':!![]}];}_0x164e3a=_[_0x05c0('0x3d')]({},_0x164e3a,_0x4557db[_0x05c0('0x3f')]);return db['VoiceTransferReport']['find'](_0x164e3a)[_0x05c0('0x24')](handleEntityNotFound(_0xcbd98,null))[_0x05c0('0x24')](respondWithResult(_0xcbd98,null))[_0x05c0('0x44')](handleError(_0xcbd98,null));};exports[_0x05c0('0x48')]=function(_0x2a1339,_0x856372){return db['VoiceTransferReport'][_0x05c0('0x48')](_0x2a1339[_0x05c0('0x49')],{})[_0x05c0('0x24')](respondWithResult(_0x856372,0xc9))[_0x05c0('0x44')](handleError(_0x856372,null));};exports['update']=function(_0x34e94e,_0x2440e8){if(_0x34e94e[_0x05c0('0x49')]['id']){delete _0x34e94e[_0x05c0('0x49')]['id'];}return db['VoiceTransferReport'][_0x05c0('0x4a')]({'where':{'id':_0x34e94e[_0x05c0('0x46')]['id']}})[_0x05c0('0x24')](handleEntityNotFound(_0x2440e8,null))[_0x05c0('0x24')](saveUpdates(_0x34e94e['body'],null))[_0x05c0('0x24')](respondWithResult(_0x2440e8,null))[_0x05c0('0x44')](handleError(_0x2440e8,null));};exports['destroy']=function(_0x27f69e,_0x57f979){return db['VoiceTransferReport'][_0x05c0('0x4a')]({'where':{'id':_0x27f69e['params']['id']}})[_0x05c0('0x24')](handleEntityNotFound(_0x57f979,null))[_0x05c0('0x24')](removeEntity(_0x57f979,null))[_0x05c0('0x44')](handleError(_0x57f979,null));}; \ No newline at end of file +var _0xbaf0=['to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','end','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','create','body','find','destroy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xbaf0[_0x2f5ac5];return _0x37c9a8;};'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 as=require(_0x0baf('0x15'));var hardwareService=require(_0x0baf('0x16'));var logger=require(_0x0baf('0x17'))(_0x0baf('0x18'));var utils=require(_0x0baf('0x19'));var config=require(_0x0baf('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a53e2,_0x465dd7){_0x465dd7=_0x465dd7||0xcc;return function(_0xe4378c){if(_0xe4378c){return _0x5a53e2[_0x0baf('0x1b')](_0x465dd7);}return _0x5a53e2[_0x0baf('0x1c')](_0x465dd7)['end']();};}function respondWithResult(_0x2ab33e,_0x49e44b){_0x49e44b=_0x49e44b||0xc8;return function(_0x1c76a8){if(_0x1c76a8){return _0x2ab33e[_0x0baf('0x1c')](_0x49e44b)[_0x0baf('0x1d')](_0x1c76a8);}};}function respondWithFilteredResult(_0x2bc381,_0xb8339e){return function(_0x469599){if(_0x469599){var _0x4f80a8=_0x469599[_0x0baf('0x1e')],_0x4cd79d=_0xb8339e[_0x0baf('0x1f')],_0x2312c7=_0xb8339e[_0x0baf('0x1f')]+_0xb8339e[_0x0baf('0x20')],_0x38395b;if(_0x2312c7>=_0x4f80a8){_0x2312c7=_0x4f80a8;_0x38395b=0xc8;}else{_0x38395b=0xce;}_0x2bc381['status'](_0x38395b);return _0x2bc381[_0x0baf('0x21')](_0x0baf('0x22'),_0x4cd79d+'-'+_0x2312c7+'/'+_0x4f80a8)[_0x0baf('0x1d')](_0x469599);}return null;};}function patchUpdates(_0x3e9cb4){return function(_0x47070d){try{jsonpatch[_0x0baf('0x23')](_0x47070d,_0x3e9cb4,!![]);}catch(_0x4ff793){return BPromise['reject'](_0x4ff793);}return _0x47070d[_0x0baf('0x24')]();};}function saveUpdates(_0x154f48,_0x32e839){return function(_0x1848e8){if(_0x1848e8){return _0x1848e8[_0x0baf('0x25')](_0x154f48)[_0x0baf('0x26')](function(_0x210cd8){return _0x210cd8;});}return null;};}function removeEntity(_0x636a13,_0x2c42e2){return function(_0x15a2c3){if(_0x15a2c3){return _0x15a2c3['destroy']()[_0x0baf('0x26')](function(){_0x636a13['status'](0xcc)[_0x0baf('0x27')]();});}};}function handleEntityNotFound(_0x5dbf00,_0x4de74c){return function(_0x2ef0aa){if(!_0x2ef0aa){_0x5dbf00['sendStatus'](0x194);}return _0x2ef0aa;};}function handleError(_0x4be1b9,_0x47c4b){_0x47c4b=_0x47c4b||0x1f4;return function(_0x27b59c){logger[_0x0baf('0x28')](_0x27b59c[_0x0baf('0x29')]);if(_0x27b59c[_0x0baf('0x2a')]){delete _0x27b59c['name'];}_0x4be1b9[_0x0baf('0x1c')](_0x47c4b)[_0x0baf('0x2b')](_0x27b59c);};}exports[_0x0baf('0x2c')]=function(_0x366e71,_0x3843b8){var _0x3b9b31={},_0x453525={},_0x549fd0={'count':0x0,'rows':[]};var _0x1590b4=_[_0x0baf('0x2d')](db[_0x0baf('0x2e')][_0x0baf('0x2f')],function(_0x55c715){return{'name':_0x55c715[_0x0baf('0x30')],'type':_0x55c715[_0x0baf('0x31')]['key']};});_0x453525[_0x0baf('0x32')]=_[_0x0baf('0x2d')](_0x1590b4,_0x0baf('0x2a'));_0x453525[_0x0baf('0x33')]=_[_0x0baf('0x34')](_0x366e71[_0x0baf('0x33')]);_0x453525[_0x0baf('0x35')]=_['intersection'](_0x453525[_0x0baf('0x32')],_0x453525[_0x0baf('0x33')]);_0x3b9b31[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x453525[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x38')]));_0x3b9b31[_0x0baf('0x36')]=_0x3b9b31[_0x0baf('0x36')][_0x0baf('0x39')]?_0x3b9b31[_0x0baf('0x36')]:_0x453525[_0x0baf('0x32')];if(!_0x366e71[_0x0baf('0x33')]['hasOwnProperty'](_0x0baf('0x3a'))){_0x3b9b31['limit']=qs[_0x0baf('0x20')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x20')]);_0x3b9b31[_0x0baf('0x1f')]=qs['offset'](_0x366e71[_0x0baf('0x33')][_0x0baf('0x1f')]);}_0x3b9b31['order']=qs[_0x0baf('0x3b')](_0x366e71[_0x0baf('0x33')][_0x0baf('0x3b')]);_0x3b9b31[_0x0baf('0x3c')]=qs[_0x0baf('0x35')](_[_0x0baf('0x3d')](_0x366e71[_0x0baf('0x33')],_0x453525[_0x0baf('0x35')]));if(_0x366e71['query'][_0x0baf('0x3e')]){_0x3b9b31[_0x0baf('0x3c')]=_['merge'](_0x3b9b31[_0x0baf('0x3c')],{'$or':_['map'](_0x1590b4,function(_0x5c545f){if(_0x5c545f[_0x0baf('0x31')]!==_0x0baf('0x3f')){var _0x5d3ad1={};_0x5d3ad1[_0x5c545f['name']]={'$like':'%'+_0x366e71[_0x0baf('0x33')][_0x0baf('0x3e')]+'%'};return _0x5d3ad1;}})});}_0x3b9b31=_[_0x0baf('0x40')]({},_0x3b9b31,_0x366e71[_0x0baf('0x41')]);var _0x15eb5c={'where':_0x3b9b31[_0x0baf('0x3c')]};return db[_0x0baf('0x2e')][_0x0baf('0x1e')](_0x15eb5c)[_0x0baf('0x26')](function(_0x36c6d2){_0x549fd0[_0x0baf('0x1e')]=_0x36c6d2;if(_0x366e71[_0x0baf('0x33')][_0x0baf('0x42')]){_0x3b9b31[_0x0baf('0x43')]=[{'all':!![]}];}return db['VoiceTransferReport'][_0x0baf('0x44')](_0x3b9b31);})[_0x0baf('0x26')](function(_0x4f1de9){_0x549fd0[_0x0baf('0x45')]=_0x4f1de9;return _0x549fd0;})[_0x0baf('0x26')](respondWithFilteredResult(_0x3843b8,_0x3b9b31))[_0x0baf('0x46')](handleError(_0x3843b8,null));};exports[_0x0baf('0x47')]=function(_0x2e20c8,_0x456d0b){var _0x57b581={'raw':!![],'where':{'id':_0x2e20c8[_0x0baf('0x48')]['id']}},_0x23ad34={};_0x23ad34['model']=_[_0x0baf('0x34')](db[_0x0baf('0x2e')][_0x0baf('0x2f')]);_0x23ad34[_0x0baf('0x33')]=_['keys'](_0x2e20c8[_0x0baf('0x33')]);_0x23ad34[_0x0baf('0x35')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],_0x23ad34[_0x0baf('0x33')]);_0x57b581[_0x0baf('0x36')]=_[_0x0baf('0x37')](_0x23ad34[_0x0baf('0x32')],qs[_0x0baf('0x38')](_0x2e20c8[_0x0baf('0x33')]['fields']));_0x57b581[_0x0baf('0x36')]=_0x57b581[_0x0baf('0x36')][_0x0baf('0x39')]?_0x57b581[_0x0baf('0x36')]:_0x23ad34[_0x0baf('0x32')];if(_0x2e20c8['query'][_0x0baf('0x42')]){_0x57b581[_0x0baf('0x43')]=[{'all':!![]}];}_0x57b581=_[_0x0baf('0x40')]({},_0x57b581,_0x2e20c8[_0x0baf('0x41')]);return db[_0x0baf('0x2e')]['find'](_0x57b581)[_0x0baf('0x26')](handleEntityNotFound(_0x456d0b,null))[_0x0baf('0x26')](respondWithResult(_0x456d0b,null))[_0x0baf('0x46')](handleError(_0x456d0b,null));};exports[_0x0baf('0x49')]=function(_0x41599f,_0x22d10f){return db[_0x0baf('0x2e')]['create'](_0x41599f[_0x0baf('0x4a')],{})[_0x0baf('0x26')](respondWithResult(_0x22d10f,0xc9))[_0x0baf('0x46')](handleError(_0x22d10f,null));};exports['update']=function(_0x3c9de3,_0x2222b6){if(_0x3c9de3[_0x0baf('0x4a')]['id']){delete _0x3c9de3[_0x0baf('0x4a')]['id'];}return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0x3c9de3[_0x0baf('0x48')]['id']}})['then'](handleEntityNotFound(_0x2222b6,null))[_0x0baf('0x26')](saveUpdates(_0x3c9de3[_0x0baf('0x4a')],null))[_0x0baf('0x26')](respondWithResult(_0x2222b6,null))[_0x0baf('0x46')](handleError(_0x2222b6,null));};exports[_0x0baf('0x4c')]=function(_0xc427b2,_0x40d4a6){return db[_0x0baf('0x2e')][_0x0baf('0x4b')]({'where':{'id':_0xc427b2[_0x0baf('0x48')]['id']}})[_0x0baf('0x26')](handleEntityNotFound(_0x40d4a6,null))['then'](removeEntity(_0x40d4a6,null))['catch'](handleError(_0x40d4a6,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index 206f89e..2a2fcb5 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 _0x35b1=['report_call_transfer','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','VoiceTransferReport'];(function(_0x4ba379,_0x5da19d){var _0x1a1ff8=function(_0x5c709f){while(--_0x5c709f){_0x4ba379['push'](_0x4ba379['shift']());}};_0x1a1ff8(++_0x5da19d);}(_0x35b1,0x1e5));var _0x135b=function(_0x50f392,_0x1d8441){_0x50f392=_0x50f392-0x0;var _0x5926f2=_0x35b1[_0x50f392];return _0x5926f2;};'use strict';var _=require(_0x135b('0x0'));var util=require(_0x135b('0x1'));var logger=require('../../config/logger')(_0x135b('0x2'));var moment=require(_0x135b('0x3'));var BPromise=require(_0x135b('0x4'));var rp=require(_0x135b('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x135b('0x6'));var config=require(_0x135b('0x7'));var attributes=require('./voiceTransferReport.attributes');module[_0x135b('0x8')]=function(_0x35651e,_0x1a8a61){return _0x35651e['define'](_0x135b('0x9'),attributes,{'tableName':_0x135b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe0bf=['api','moment','bluebird','request-promise','./voiceTransferReport.attributes','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger'];(function(_0x314c6f,_0x1b5edf){var _0xa1d241=function(_0x5e3a5f){while(--_0x5e3a5f){_0x314c6f['push'](_0x314c6f['shift']());}};_0xa1d241(++_0x1b5edf);}(_0xe0bf,0x75));var _0xfe0b=function(_0x33c70e,_0xd8cb0b){_0x33c70e=_0x33c70e-0x0;var _0x5a33e5=_0xe0bf[_0x33c70e];return _0x5a33e5;};'use strict';var _=require(_0xfe0b('0x0'));var util=require(_0xfe0b('0x1'));var logger=require(_0xfe0b('0x2'))(_0xfe0b('0x3'));var moment=require(_0xfe0b('0x4'));var BPromise=require(_0xfe0b('0x5'));var rp=require(_0xfe0b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfe0b('0x7'));module['exports']=function(_0x2cb051,_0x224b5e){return _0x2cb051['define'](_0xfe0b('0x8'),attributes,{'tableName':_0xfe0b('0x9'),'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 6348efa..50c42f7 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 _0x4f4d=['VoiceTransferReport,\x20%s,\x20%s','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','create','body','options','CreateVoiceTransferReport','debug','lodash','util','bluebird','randomstring','../../config/logger','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x2534cf,_0x545be6){var _0x221461=function(_0x379e83){while(--_0x379e83){_0x2534cf['push'](_0x2534cf['shift']());}};_0x221461(++_0x545be6);}(_0x4f4d,0x85));var _0xd4f4=function(_0x53b6ae,_0x3cb9f4){_0x53b6ae=_0x53b6ae-0x0;var _0x34f4b2=_0x4f4d[_0x53b6ae];return _0x34f4b2;};'use strict';var _=require(_0xd4f4('0x0'));var util=require(_0xd4f4('0x1'));var moment=require('moment');var BPromise=require(_0xd4f4('0x2'));var rs=require(_0xd4f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd4f4('0x4'))('rpc');var config=require(_0xd4f4('0x5'));var jayson=require(_0xd4f4('0x6'));var client=jayson[_0xd4f4('0x7')][_0xd4f4('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x448898,_0x1a1c6a,_0x2439be){return new BPromise(function(_0x144d44,_0x2c0eaa){return client['request'](_0x448898,_0x2439be)[_0xd4f4('0x9')](function(_0x145580){logger[_0xd4f4('0xa')](_0xd4f4('0xb'),_0x1a1c6a,'request\x20sent');logger['debug'](_0xd4f4('0xc'),_0x1a1c6a,'request\x20sent',JSON[_0xd4f4('0xd')](_0x145580));if(_0x145580[_0xd4f4('0xe')]){if(_0x145580[_0xd4f4('0xe')][_0xd4f4('0xf')]===0x1f4){logger['error'](_0xd4f4('0xb'),_0x1a1c6a,_0x145580[_0xd4f4('0xe')][_0xd4f4('0x10')]);return _0x2c0eaa(_0x145580['error'][_0xd4f4('0x10')]);}logger[_0xd4f4('0xe')](_0xd4f4('0xb'),_0x1a1c6a,_0x145580['error'][_0xd4f4('0x10')]);return _0x144d44(_0x145580[_0xd4f4('0xe')][_0xd4f4('0x10')]);}else{logger[_0xd4f4('0xa')](_0xd4f4('0xb'),_0x1a1c6a,_0xd4f4('0x11'));_0x144d44(_0x145580['result'][_0xd4f4('0x10')]);}})[_0xd4f4('0x12')](function(_0x3920ca){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x1a1c6a,_0x3920ca);_0x2c0eaa(_0x3920ca);});});}exports['CreateVoiceTransferReport']=function(_0x3bdafe){var _0x2fbf73=this;return new Promise(function(_0x27a741,_0x39e535){return db['VoiceTransferReport'][_0xd4f4('0x13')](_0x3bdafe[_0xd4f4('0x14')],{'raw':_0x3bdafe[_0xd4f4('0x15')]?_0x3bdafe[_0xd4f4('0x15')]['raw']===undefined?!![]:![]:!![]})[_0xd4f4('0x9')](function(_0x3a95b0){logger[_0xd4f4('0xa')](_0xd4f4('0x16'),_0x3bdafe);logger[_0xd4f4('0x17')](_0xd4f4('0x16'),_0x3bdafe,JSON[_0xd4f4('0xd')](_0x3a95b0));_0x27a741(_0x3a95b0);})[_0xd4f4('0x12')](function(_0x142738){logger[_0xd4f4('0xe')](_0xd4f4('0x16'),_0x142738['message'],_0x3bdafe);_0x39e535(_0x2fbf73['error'](0x1f4,_0x142738[_0xd4f4('0x10')]));});});}; \ No newline at end of file +var _0x35ea=['../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','then','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','error','code','VoiceTransferReport,\x20%s,\x20%s','message','info','result','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','debug','stringify','lodash','util','bluebird','randomstring'];(function(_0x3d8797,_0x559254){var _0x23d26a=function(_0x501752){while(--_0x501752){_0x3d8797['push'](_0x3d8797['shift']());}};_0x23d26a(++_0x559254);}(_0x35ea,0x114));var _0xa35e=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x35ea[_0x3a6efd];return _0x487b9a;};'use strict';var _=require(_0xa35e('0x0'));var util=require(_0xa35e('0x1'));var moment=require('moment');var BPromise=require(_0xa35e('0x2'));var rs=require(_0xa35e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa35e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa35e('0x5'))(_0xa35e('0x6'));var config=require('../../config/environment');var jayson=require(_0xa35e('0x7'));var client=jayson[_0xa35e('0x8')][_0xa35e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x47d282,_0x131f0f,_0x256cd2){return new BPromise(function(_0xca2495,_0x4c2b3e){return client['request'](_0x47d282,_0x256cd2)[_0xa35e('0xa')](function(_0x40361a){logger['info']('VoiceTransferReport,\x20%s,\x20%s',_0x131f0f,_0xa35e('0xb'));logger['debug'](_0xa35e('0xc'),_0x131f0f,_0xa35e('0xb'),JSON['stringify'](_0x40361a));if(_0x40361a[_0xa35e('0xd')]){if(_0x40361a[_0xa35e('0xd')][_0xa35e('0xe')]===0x1f4){logger['error'](_0xa35e('0xf'),_0x131f0f,_0x40361a[_0xa35e('0xd')][_0xa35e('0x10')]);return _0x4c2b3e(_0x40361a['error'][_0xa35e('0x10')]);}logger[_0xa35e('0xd')](_0xa35e('0xf'),_0x131f0f,_0x40361a[_0xa35e('0xd')][_0xa35e('0x10')]);return _0xca2495(_0x40361a[_0xa35e('0xd')][_0xa35e('0x10')]);}else{logger[_0xa35e('0x11')](_0xa35e('0xf'),_0x131f0f,'request\x20sent');_0xca2495(_0x40361a[_0xa35e('0x12')][_0xa35e('0x10')]);}})[_0xa35e('0x13')](function(_0x3166fe){logger['error'](_0xa35e('0xf'),_0x131f0f,_0x3166fe);_0x4c2b3e(_0x3166fe);});});}exports[_0xa35e('0x14')]=function(_0xf913ab){var _0x9d132c=this;return new Promise(function(_0x8fecd0,_0x183424){return db[_0xa35e('0x15')][_0xa35e('0x16')](_0xf913ab[_0xa35e('0x17')],{'raw':_0xf913ab[_0xa35e('0x18')]?_0xf913ab[_0xa35e('0x18')][_0xa35e('0x19')]===undefined?!![]:![]:!![]})[_0xa35e('0xa')](function(_0x20719c){logger[_0xa35e('0x11')](_0xa35e('0x14'),_0xf913ab);logger[_0xa35e('0x1a')](_0xa35e('0x14'),_0xf913ab,JSON[_0xa35e('0x1b')](_0x20719c));_0x8fecd0(_0x20719c);})[_0xa35e('0x13')](function(_0x3f9cc9){logger[_0xa35e('0xd')](_0xa35e('0x14'),_0x3f9cc9[_0xa35e('0x10')],_0xf913ab);_0x183424(_0x9d132c[_0xa35e('0xd')](0x1f4,_0x3f9cc9[_0xa35e('0x10')]));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index e477d5b..9691ab5 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7384=['./config/schedule/chat','sequelize','sync','then','info','start','Online\x20apps:','map','filter','online','name','Offline\x20apps:','status','join','None','default','error','exit','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule'];(function(_0x4e75af,_0xecc2be){var _0x1954dd=function(_0x12d5b1){while(--_0x12d5b1){_0x4e75af['push'](_0x4e75af['shift']());}};_0x1954dd(++_0xecc2be);}(_0x7384,0x1ed));var _0x4738=function(_0x422cc1,_0x40d1ec){_0x422cc1=_0x422cc1-0x0;var _0x246b85=_0x7384[_0x422cc1];return _0x246b85;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x4738('0x0'));var config=require(_0x4738('0x1'));var logger=require(_0x4738('0x2'))(_0x4738('0x3'));var pm2=require(_0x4738('0x4'));var pm2Config=require(_0x4738('0x5'));var schedule=require(_0x4738('0x6'));var chat=require(_0x4738('0x7'));function main(){return mysqldb['db'][_0x4738('0x8')][_0x4738('0x9')]()[_0x4738('0xa')](function(){return rpc['listen']();})['then'](function(_0x2d700b){logger[_0x4738('0xb')](_0x2d700b);return chat[_0x4738('0xc')]();})[_0x4738('0xa')](function(){return schedule[_0x4738('0xc')]();})['then'](function(_0x289a32){logger[_0x4738('0xb')](_0x289a32);return pm2['start'](pm2Config);})[_0x4738('0xa')](function(_0x463f5c){logger[_0x4738('0xb')](_0x4738('0xd'),_[_0x4738('0xe')](_[_0x4738('0xf')](_0x463f5c,{'status':_0x4738('0x10')}),_0x4738('0x11'))['join']());logger[_0x4738('0xb')](_0x4738('0x12'),_[_0x4738('0xe')](_[_0x4738('0xf')](_0x463f5c,function(_0xe9eb3e){return _0xe9eb3e[_0x4738('0x13')]!==_0x4738('0x10');}),_0x4738('0x11'))[_0x4738('0x14')]()||_0x4738('0x15'));config['seedDB']&&require('./config/seedDB')[_0x4738('0x16')]();require('./config/license')[_0x4738('0x16')]();})['catch'](function(_0x44115c){logger[_0x4738('0x17')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x44115c);process[_0x4738('0x18')](0x1);});}main(); \ No newline at end of file +var _0x1bd6=['None','seedDB','./config/seedDB','default','./config/license','catch','error','exit','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','sequelize','sync','listen','start','then','info','Online\x20apps:','filter','online','name','join','map'];(function(_0x417f8d,_0x41f7b1){var _0x267654=function(_0x109965){while(--_0x109965){_0x417f8d['push'](_0x417f8d['shift']());}};_0x267654(++_0x41f7b1);}(_0x1bd6,0x158));var _0x61bd=function(_0x33e973,_0x230854){_0x33e973=_0x33e973-0x0;var _0x4e80ca=_0x1bd6[_0x33e973];return _0x4e80ca;};'use strict';var _=require(_0x61bd('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x61bd('0x1'));var config=require(_0x61bd('0x2'));var logger=require(_0x61bd('0x3'))(_0x61bd('0x4'));var pm2=require(_0x61bd('0x5'));var pm2Config=require(_0x61bd('0x6'));var schedule=require('./config/schedule');var chat=require(_0x61bd('0x7'));function main(){return mysqldb['db'][_0x61bd('0x8')][_0x61bd('0x9')]()['then'](function(){return rpc[_0x61bd('0xa')]();})['then'](function(_0x84c237){logger['info'](_0x84c237);return chat[_0x61bd('0xb')]();})['then'](function(){return schedule[_0x61bd('0xb')]();})[_0x61bd('0xc')](function(_0xd89f1){logger[_0x61bd('0xd')](_0xd89f1);return pm2[_0x61bd('0xb')](pm2Config);})[_0x61bd('0xc')](function(_0x2e1e09){logger[_0x61bd('0xd')](_0x61bd('0xe'),_['map'](_[_0x61bd('0xf')](_0x2e1e09,{'status':_0x61bd('0x10')}),_0x61bd('0x11'))[_0x61bd('0x12')]());logger[_0x61bd('0xd')]('Offline\x20apps:',_[_0x61bd('0x13')](_[_0x61bd('0xf')](_0x2e1e09,function(_0x3ee5f6){return _0x3ee5f6['status']!==_0x61bd('0x10');}),'name')[_0x61bd('0x12')]()||_0x61bd('0x14'));config[_0x61bd('0x15')]&&require(_0x61bd('0x16'))[_0x61bd('0x17')]();require(_0x61bd('0x18'))['default']();})[_0x61bd('0x19')](function(_0x3a34ec){logger[_0x61bd('0x1a')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3a34ec);process[_0x61bd('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 975696f..f2f0a48 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 _0x4006=['../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','basic-auth','bluebird','role','name','internal','email','userpic','md5secret','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarRemoteControl','phoneBarRemoteControlPort','interface','isChatInteractionAuthorized','use','ChatInteraction','findOne','params','disposition','then','closed','status','json','unmanaged','Unmanaged.','Forbidden.','catch','isAuthenticated','authorization','startsWith','headers','find','pass','user','Bearer','apikey','getUuid','query','User','isEqual','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','update','isMiddleware','signToken','cookie','motion.token','redirect','send','retrieveApiKey','apiKeyNonce','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','session','options','secrets','randomBytes','toString','hex','floor','now','HS512'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4006,0x1c7));var _0x6400=function(_0x175f88,_0x40528d){_0x175f88=_0x175f88-0x0;var _0x4265a6=_0x4006[_0x175f88];return _0x4265a6;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x6400('0x0'));var hardwareConf=require(_0x6400('0x1'));var _=require(_0x6400('0x2'));var jwt=require(_0x6400('0x3'));var expressJwt=require('express-jwt');var compose=require('composable-middleware');var basicAuth=require(_0x6400('0x4'));var crypto=require('crypto');var BPromise=require(_0x6400('0x5'));var validateJwt=expressJwt({'secret':config['secrets']['session']});var userAttributes=['id',_0x6400('0x6'),'fullname',_0x6400('0x7'),_0x6400('0x8'),_0x6400('0x9'),_0x6400('0xa'),'permissions',_0x6400('0xb'),_0x6400('0xc'),_0x6400('0xd'),_0x6400('0xe'),_0x6400('0xf'),_0x6400('0x10'),_0x6400('0x11'),_0x6400('0x12'),_0x6400('0x13'),_0x6400('0x14'),_0x6400('0x15'),'crudPermissions',_0x6400('0x16'),_0x6400('0x17'),_0x6400('0x18'),_0x6400('0x19'),'phoneBarAutoAnswerDelay',_0x6400('0x1a'),_0x6400('0x1b'),'phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired',_0x6400('0x1c'),_0x6400('0x1d'),'hotdesk',_0x6400('0x1e'),'userProfileId'];exports[_0x6400('0x1f')]=function(){return this['isAuthenticated'](!![])[_0x6400('0x20')](function(_0x430cb4,_0x276fb2,_0x3babdc){if(_0x430cb4['user']){_0x3babdc();}else{return db[_0x6400('0x21')][_0x6400('0x22')]({'where':{'id':_0x430cb4[_0x6400('0x23')]['id']},'attributes':['id','closed',_0x6400('0x24')],'raw':!![]})[_0x6400('0x25')](function(_0x4b22f9){if(_0x4b22f9&&_0x4b22f9[_0x6400('0x26')]){return _0x276fb2[_0x6400('0x27')](_0x4b22f9[_0x6400('0x24')]==='unmanaged'?0x195:0x193)[_0x6400('0x28')]({'message':_0x4b22f9[_0x6400('0x24')]===_0x6400('0x29')?_0x6400('0x2a'):_0x6400('0x2b')});}else{_0x3babdc();}})[_0x6400('0x2c')](function(_0x8eb4ac){_0x3babdc(_0x8eb4ac);});}});};exports[_0x6400('0x2d')]=function isAuthenticated(_0x22eb63){return compose()[_0x6400('0x20')](function(_0x59cdd4,_0x465c68,_0x50c29e){if(_0x59cdd4['headers'][_0x6400('0x2e')]){if(_[_0x6400('0x2f')](_0x59cdd4[_0x6400('0x30')][_0x6400('0x2e')],'Basic')){var _0x2184b5=basicAuth(_0x59cdd4);db['User'][_0x6400('0x31')]({'where':{'name':_0x2184b5['name']}})[_0x6400('0x25')](function(_0x246433){if(!_0x246433||!_0x246433['authenticate'](_0x2184b5[_0x6400('0x32')])){return _0x465c68[_0x6400('0x27')](0x191)[_0x6400('0x28')]({'message':'Wrong\x20credentials.'});}_0x59cdd4[_0x6400('0x33')]={'id':_0x246433['id']};_0x50c29e();})['catch'](function(_0x5f06ae){_0x50c29e(_0x5f06ae);});}else if(_[_0x6400('0x2f')](_0x59cdd4['headers'][_0x6400('0x2e')],_0x6400('0x34'))){validateJwt(_0x59cdd4,_0x465c68,_0x50c29e);}else{if(_0x22eb63){_0x50c29e();}else{return _0x465c68['status'](0x193)[_0x6400('0x28')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0x59cdd4['query'][_0x6400('0x35')]){var _0x165170={'audience':hardwareConf[_0x6400('0x36')](),'issuer':hardwareConf[_0x6400('0x36')]()};verifyJwt(_0x59cdd4[_0x6400('0x37')]['apikey'],_0x165170)[_0x6400('0x25')](function(_0x21a324){return db[_0x6400('0x38')][_0x6400('0x31')]({'where':{'id':_0x21a324['sub']}})[_0x6400('0x25')](function(_0x356f4d){if(!_0x356f4d||!_[_0x6400('0x39')](_0x356f4d['apiKeyNonce'],_0x21a324[_0x6400('0x3a')])){return _0x465c68[_0x6400('0x27')](0x193)[_0x6400('0x28')]({'message':_0x6400('0x3b')});}_0x59cdd4['user']={'id':_0x356f4d['id']};_0x50c29e();});})[_0x6400('0x2c')](function(_0x111676){_0x50c29e(_0x111676);});}else if(_0x22eb63){_0x50c29e();}else{return _0x465c68['status'](0x193)[_0x6400('0x28')]({'message':_0x6400('0x3c')});}})['use'](function(_0x4d7c7e,_0x2796ee,_0x23b15b){if(_0x4d7c7e[_0x6400('0x33')]){db['User']['find']({'where':{'id':_0x4d7c7e['user']['id']},'attributes':userAttributes})[_0x6400('0x25')](function(_0x3873e0){if(!_0x3873e0){return _0x2796ee[_0x6400('0x27')](0x194)[_0x6400('0x28')]({'message':_0x6400('0x3d')});}_0x4d7c7e['user']=_0x3873e0;_0x23b15b();})[_0x6400('0x2c')](function(_0x36f2a5){_0x23b15b(_0x36f2a5);});}else if(_0x22eb63){_0x23b15b();}else{return _0x2796ee['status'](0x194)['json']({'message':_0x6400('0x3e')});}});};exports[_0x6400('0x3f')]=function canUpdate(){return compose()[_0x6400('0x20')](function(_0x51a7c0,_0x2693a5,_0x1f60fd){return require(_0x6400('0x40'))['getLicense']()[_0x6400('0x25')](function(_0x374378){if(_0x374378[_0x6400('0x41')]){_0x1f60fd();}else{return _0x2693a5['status'](0x193)['json']({'message':'Forbidden'});}})[_0x6400('0x2c')](function(_0x5c4845){_0x1f60fd(_0x5c4845);});});};exports['isMiddleware']=function(_0x473cef,_0x139145,_0x565942){_0x473cef[_0x6400('0x42')]=!![];return _0x565942();};exports[_0x6400('0x43')]=function signToken(_0x43b7bb){return signJwt(_0x43b7bb);};exports['setTokenCookie']=function(_0x9536e5,_0x443ff0){if(!_0x9536e5[_0x6400('0x33')]){return _0x443ff0[_0x6400('0x27')](0x194)['json']({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x32dc71={'payload':{'id':_0x9536e5[_0x6400('0x33')]['id'],'role':_0x9536e5[_0x6400('0x33')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x32dc71)[_0x6400('0x25')](function(_0x1703f5){_0x443ff0[_0x6400('0x44')](_0x6400('0x45'),_0x1703f5);_0x443ff0[_0x6400('0x46')]('/dashboards/general');})[_0x6400('0x2c')](function(_0x5bd24c){return _0x443ff0[_0x6400('0x27')](0x1f4)[_0x6400('0x47')](_0x5bd24c);});};exports[_0x6400('0x48')]=function(_0x29401d){if(_['isNil'](_0x29401d[_0x6400('0x49')])||_[_0x6400('0x4a')](_0x29401d[_0x6400('0x4b')])){return null;}else{return createJwt(_0x29401d);}};exports[_0x6400('0x4c')]=function(_0x5d3d1c){_0x5d3d1c[_0x6400('0x49')]=generateNonce();_0x5d3d1c['apiKeyIat']=generateIssuedAt();return createJwt(_0x5d3d1c);};exports[_0x6400('0x4d')]=function(_0x52cc77,_0x416307){var _0x1fdb02=_0x52cc77[_0x6400('0x37')]['apikey'];if(_0x1fdb02){var _0x2c62c4={'nonce':_0x416307['apiKeyNonce'],'iat':_0x416307[_0x6400('0x4b')],'audience':hardwareConf[_0x6400('0x36')](),'issuer':hardwareConf[_0x6400('0x36')]()};return verifyJwt(_0x1fdb02,_0x2c62c4)[_0x6400('0x25')](function(){return generateApiKey(_0x416307);});}else{throw{'message':_0x6400('0x4e')};}};function signJwt(_0xaa356b){var _0xc7812c=BPromise[_0x6400('0x4f')](jwt[_0x6400('0x50')],{'context':jwt});var _0x25a2c1=_0xaa356b[_0x6400('0x51')]||config['secrets'][_0x6400('0x52')];return new BPromise(function(_0x3340c7,_0x59a8f2){_0xc7812c(_0xaa356b['payload'],_0x25a2c1,_0xaa356b[_0x6400('0x53')])[_0x6400('0x25')](function(_0x34a49f){_0x3340c7(_0x34a49f);})['catch'](function(_0x412b48){_0x59a8f2(_0x412b48);});});}function verifyJwt(_0x54cbfb,_0x518ee4,_0x539a5f){var _0x32c3d0=BPromise[_0x6400('0x4f')](jwt['verify'],{'context':jwt});var _0x3b659b=_0x539a5f||config[_0x6400('0x54')]['session'];return new BPromise(function(_0x48bc20,_0x35cd68){_0x32c3d0(_0x54cbfb,_0x3b659b,_0x518ee4)[_0x6400('0x25')](function(_0x4891c3){_0x48bc20(_0x4891c3);})[_0x6400('0x2c')](function(_0x205233){_0x35cd68(_0x205233);});});}function generateNonce(){return crypto[_0x6400('0x55')](0x10)[_0x6400('0x56')](_0x6400('0x57'));}function generateIssuedAt(){return Math[_0x6400('0x58')](Date[_0x6400('0x59')]()/0x3e8)['toString']();}function createJwt(_0x46c582){var _0x801179={'payload':{'iat':_0x46c582[_0x6400('0x4b')],'nonce':_0x46c582[_0x6400('0x49')]},'options':{'algorithm':_0x6400('0x5a'),'subject':_0x46c582['id'][_0x6400('0x56')](),'issuer':hardwareConf[_0x6400('0x36')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x801179)[_0x6400('0x25')](function(_0x513f31){return{'iat':_0x46c582['apiKeyIat'],'nonce':_0x46c582[_0x6400('0x49')],'token':_0x513f31};});} \ No newline at end of file +var _0xfc76=['fullname','name','email','userpic','permissions','md5secret','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','interface','userProfileId','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','status','unmanaged','Forbidden.','authorization','startsWith','headers','Basic','User','find','then','authenticate','pass','json','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','isEqual','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','../../config/license/util','getLicense','update','Forbidden','isMiddleware','signToken','cookie','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','getUuid','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','secret','session','payload','options','verify','randomBytes','toString','hex','floor','now','HS512','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','secrets','role'];(function(_0x1dc121,_0x9b8f40){var _0x34125b=function(_0x43f53a){while(--_0x43f53a){_0x1dc121['push'](_0x1dc121['shift']());}};_0x34125b(++_0x9b8f40);}(_0xfc76,0xb5));var _0x6fc7=function(_0x499bb8,_0x521283){_0x499bb8=_0x499bb8-0x0;var _0x31a29c=_0xfc76[_0x499bb8];return _0x31a29c;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0x6fc7('0x0'));var hardwareConf=require(_0x6fc7('0x1'));var _=require(_0x6fc7('0x2'));var jwt=require(_0x6fc7('0x3'));var expressJwt=require(_0x6fc7('0x4'));var compose=require('composable-middleware');var basicAuth=require(_0x6fc7('0x5'));var crypto=require(_0x6fc7('0x6'));var BPromise=require('bluebird');var validateJwt=expressJwt({'secret':config[_0x6fc7('0x7')]['session']});var userAttributes=['id',_0x6fc7('0x8'),_0x6fc7('0x9'),_0x6fc7('0xa'),'internal',_0x6fc7('0xb'),_0x6fc7('0xc'),_0x6fc7('0xd'),_0x6fc7('0xe'),_0x6fc7('0xf'),_0x6fc7('0x10'),'mailPause',_0x6fc7('0x11'),_0x6fc7('0x12'),_0x6fc7('0x13'),_0x6fc7('0x14'),_0x6fc7('0x15'),_0x6fc7('0x16'),'lastPauseAt',_0x6fc7('0x17'),_0x6fc7('0x18'),'passwordResetAt',_0x6fc7('0x19'),_0x6fc7('0x1a'),'phoneBarAutoAnswerDelay',_0x6fc7('0x1b'),_0x6fc7('0x1c'),'phoneBarEnableSettings',_0x6fc7('0x1d'),_0x6fc7('0x1e'),_0x6fc7('0x1f'),'phoneBarRemoteControlPort','hotdesk',_0x6fc7('0x20'),_0x6fc7('0x21')];exports['isChatInteractionAuthorized']=function(){return this[_0x6fc7('0x22')](!![])[_0x6fc7('0x23')](function(_0x124cd6,_0x41269a,_0x51a886){if(_0x124cd6[_0x6fc7('0x24')]){_0x51a886();}else{return db[_0x6fc7('0x25')][_0x6fc7('0x26')]({'where':{'id':_0x124cd6[_0x6fc7('0x27')]['id']},'attributes':['id',_0x6fc7('0x28'),_0x6fc7('0x29')],'raw':!![]})['then'](function(_0x109c84){if(_0x109c84&&_0x109c84[_0x6fc7('0x28')]){return _0x41269a[_0x6fc7('0x2a')](_0x109c84[_0x6fc7('0x29')]===_0x6fc7('0x2b')?0x195:0x193)['json']({'message':_0x109c84[_0x6fc7('0x29')]===_0x6fc7('0x2b')?'Unmanaged.':_0x6fc7('0x2c')});}else{_0x51a886();}})['catch'](function(_0x453bae){_0x51a886(_0x453bae);});}});};exports['isAuthenticated']=function isAuthenticated(_0x11b359){return compose()[_0x6fc7('0x23')](function(_0x1bfa75,_0x5c83ad,_0x45e53e){if(_0x1bfa75['headers'][_0x6fc7('0x2d')]){if(_[_0x6fc7('0x2e')](_0x1bfa75[_0x6fc7('0x2f')][_0x6fc7('0x2d')],_0x6fc7('0x30'))){var _0x222b53=basicAuth(_0x1bfa75);db[_0x6fc7('0x31')][_0x6fc7('0x32')]({'where':{'name':_0x222b53[_0x6fc7('0xa')]}})[_0x6fc7('0x33')](function(_0xaa2687){if(!_0xaa2687||!_0xaa2687[_0x6fc7('0x34')](_0x222b53[_0x6fc7('0x35')])){return _0x5c83ad[_0x6fc7('0x2a')](0x191)[_0x6fc7('0x36')]({'message':'Wrong\x20credentials.'});}_0x1bfa75[_0x6fc7('0x24')]={'id':_0xaa2687['id']};_0x45e53e();})[_0x6fc7('0x37')](function(_0x168c87){_0x45e53e(_0x168c87);});}else if(_[_0x6fc7('0x2e')](_0x1bfa75['headers'][_0x6fc7('0x2d')],_0x6fc7('0x38'))){validateJwt(_0x1bfa75,_0x5c83ad,_0x45e53e);}else{if(_0x11b359){_0x45e53e();}else{return _0x5c83ad[_0x6fc7('0x2a')](0x193)[_0x6fc7('0x36')]({'message':_0x6fc7('0x39')});}}}else if(_0x1bfa75[_0x6fc7('0x3a')][_0x6fc7('0x3b')]){var _0x2428c9={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x1bfa75[_0x6fc7('0x3a')][_0x6fc7('0x3b')],_0x2428c9)[_0x6fc7('0x33')](function(_0x2ce491){return db[_0x6fc7('0x31')][_0x6fc7('0x32')]({'where':{'id':_0x2ce491['sub']}})[_0x6fc7('0x33')](function(_0xbf7528){if(!_0xbf7528||!_[_0x6fc7('0x3c')](_0xbf7528[_0x6fc7('0x3d')],_0x2ce491['nonce'])){return _0x5c83ad['status'](0x193)['json']({'message':_0x6fc7('0x3e')});}_0x1bfa75[_0x6fc7('0x24')]={'id':_0xbf7528['id']};_0x45e53e();});})[_0x6fc7('0x37')](function(_0x4673d9){_0x45e53e(_0x4673d9);});}else if(_0x11b359){_0x45e53e();}else{return _0x5c83ad[_0x6fc7('0x2a')](0x193)[_0x6fc7('0x36')]({'message':_0x6fc7('0x39')});}})[_0x6fc7('0x23')](function(_0x3325bb,_0x54e5d5,_0x13c800){if(_0x3325bb['user']){db[_0x6fc7('0x31')][_0x6fc7('0x32')]({'where':{'id':_0x3325bb[_0x6fc7('0x24')]['id']},'attributes':userAttributes})[_0x6fc7('0x33')](function(_0x52aea5){if(!_0x52aea5){return _0x54e5d5[_0x6fc7('0x2a')](0x194)[_0x6fc7('0x36')]({'message':_0x6fc7('0x3f')});}_0x3325bb[_0x6fc7('0x24')]=_0x52aea5;_0x13c800();})['catch'](function(_0x11167e){_0x13c800(_0x11167e);});}else if(_0x11b359){_0x13c800();}else{return _0x54e5d5['status'](0x194)[_0x6fc7('0x36')]({'message':'User\x20object\x20not\x20found.'});}});};exports['canUpdate']=function canUpdate(){return compose()['use'](function(_0x40f328,_0x516580,_0x2f04d9){return require(_0x6fc7('0x40'))[_0x6fc7('0x41')]()[_0x6fc7('0x33')](function(_0xdc3cb5){if(_0xdc3cb5[_0x6fc7('0x42')]){_0x2f04d9();}else{return _0x516580[_0x6fc7('0x2a')](0x193)[_0x6fc7('0x36')]({'message':_0x6fc7('0x43')});}})[_0x6fc7('0x37')](function(_0x718182){_0x2f04d9(_0x718182);});});};exports[_0x6fc7('0x44')]=function(_0x3c652e,_0xe46d5,_0x3ac76e){_0x3c652e[_0x6fc7('0x44')]=!![];return _0x3ac76e();};exports[_0x6fc7('0x45')]=function signToken(_0x18ed25){return signJwt(_0x18ed25);};exports['setTokenCookie']=function(_0x490f2e,_0xd2025c){if(!_0x490f2e[_0x6fc7('0x24')]){return _0xd2025c[_0x6fc7('0x2a')](0x194)[_0x6fc7('0x36')]({'message':'It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.'});}var _0x43aadf={'payload':{'id':_0x490f2e[_0x6fc7('0x24')]['id'],'role':_0x490f2e[_0x6fc7('0x24')][_0x6fc7('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x43aadf)[_0x6fc7('0x33')](function(_0x4786ee){_0xd2025c[_0x6fc7('0x46')](_0x6fc7('0x47'),_0x4786ee);_0xd2025c[_0x6fc7('0x48')](_0x6fc7('0x49'));})[_0x6fc7('0x37')](function(_0x2c68f6){return _0xd2025c['status'](0x1f4)[_0x6fc7('0x4a')](_0x2c68f6);});};exports[_0x6fc7('0x4b')]=function(_0x576a46){if(_[_0x6fc7('0x4c')](_0x576a46[_0x6fc7('0x3d')])||_[_0x6fc7('0x4c')](_0x576a46[_0x6fc7('0x4d')])){return null;}else{return createJwt(_0x576a46);}};exports[_0x6fc7('0x4e')]=function(_0x20d662){_0x20d662[_0x6fc7('0x3d')]=generateNonce();_0x20d662[_0x6fc7('0x4d')]=generateIssuedAt();return createJwt(_0x20d662);};exports[_0x6fc7('0x4f')]=function(_0x1a727d,_0x49bfe6){var _0x4726df=_0x1a727d[_0x6fc7('0x3a')]['apikey'];if(_0x4726df){var _0x5c8b3c={'nonce':_0x49bfe6[_0x6fc7('0x3d')],'iat':_0x49bfe6[_0x6fc7('0x4d')],'audience':hardwareConf[_0x6fc7('0x50')](),'issuer':hardwareConf['getUuid']()};return verifyJwt(_0x4726df,_0x5c8b3c)[_0x6fc7('0x33')](function(){return generateApiKey(_0x49bfe6);});}else{throw{'message':_0x6fc7('0x51')};}};function signJwt(_0x53e631){var _0x12d65f=BPromise[_0x6fc7('0x52')](jwt[_0x6fc7('0x53')],{'context':jwt});var _0x36f67c=_0x53e631[_0x6fc7('0x54')]||config[_0x6fc7('0x7')][_0x6fc7('0x55')];return new BPromise(function(_0xb6cf9b,_0x357d7a){_0x12d65f(_0x53e631[_0x6fc7('0x56')],_0x36f67c,_0x53e631[_0x6fc7('0x57')])['then'](function(_0x4a7ce1){_0xb6cf9b(_0x4a7ce1);})['catch'](function(_0x5734d8){_0x357d7a(_0x5734d8);});});}function verifyJwt(_0x22a0c5,_0x5d4d40,_0x3357f9){var _0x25e671=BPromise[_0x6fc7('0x52')](jwt[_0x6fc7('0x58')],{'context':jwt});var _0x31f905=_0x3357f9||config[_0x6fc7('0x7')]['session'];return new BPromise(function(_0x228b26,_0x2ac05d){_0x25e671(_0x22a0c5,_0x31f905,_0x5d4d40)['then'](function(_0x2acd1f){_0x228b26(_0x2acd1f);})[_0x6fc7('0x37')](function(_0x3b2506){_0x2ac05d(_0x3b2506);});});}function generateNonce(){return crypto[_0x6fc7('0x59')](0x10)[_0x6fc7('0x5a')](_0x6fc7('0x5b'));}function generateIssuedAt(){return Math[_0x6fc7('0x5c')](Date[_0x6fc7('0x5d')]()/0x3e8)[_0x6fc7('0x5a')]();}function createJwt(_0x8a56fa){var _0x4ced40={'payload':{'iat':_0x8a56fa[_0x6fc7('0x4d')],'nonce':_0x8a56fa[_0x6fc7('0x3d')]},'options':{'algorithm':_0x6fc7('0x5e'),'subject':_0x8a56fa['id']['toString'](),'issuer':hardwareConf[_0x6fc7('0x50')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x4ced40)[_0x6fc7('0x33')](function(_0x59773d){return{'iat':_0x8a56fa[_0x6fc7('0x4d')],'nonce':_0x8a56fa[_0x6fc7('0x3d')],'token':_0x59773d};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 5fb8c09..ef1a1a5 100644 --- a/server/components/encryptor/index.js +++ b/server/components/encryptor/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0713=['aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','data','binary','write','end','final','close','decryptFile','createDecipher','update','unlink'];(function(_0x246b99,_0x54566d){var _0x327e35=function(_0x507166){while(--_0x507166){_0x246b99['push'](_0x246b99['shift']());}};_0x327e35(++_0x54566d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x3071('0x0')};function combineOptions(_0x2afa91){var _0x27405a={};for(var _0x305d85 in defaultOptions){if(defaultOptions[_0x3071('0x1')](_0x305d85)){_0x27405a[_0x305d85]=defaultOptions[_0x305d85];}}if(_0x2afa91){for(var _0x52b5fb in _0x2afa91){if(_0x2afa91[_0x3071('0x1')](_0x52b5fb)){_0x27405a[_0x52b5fb]=_0x2afa91[_0x52b5fb];}}}return _0x27405a;}exports[_0x3071('0x2')]=function(_0x33a70c,_0x3137c8,_0xabd7b6,_0x41cf76){return new BPromise(function(_0x1d3dd6,_0x2f1e87){_0x41cf76=combineOptions(_0x41cf76);var _0xbd737f=new Buffer(_0xabd7b6);var _0x22274c=fs[_0x3071('0x3')](_0x33a70c);var _0x2fce7a=fs[_0x3071('0x4')](_0x3137c8);var _0x4a36ec=crypto[_0x3071('0x5')](_0x41cf76[_0x3071('0x6')],_0xbd737f);_0x22274c['on'](_0x3071('0x7'),function(_0xff9a29){var _0x1ce844=new Buffer(_0x4a36ec['update'](_0xff9a29),_0x3071('0x8'));_0x2fce7a[_0x3071('0x9')](_0x1ce844);});_0x22274c['on'](_0x3071('0xa'),function(){try{var _0x3ed4a0=new Buffer(_0x4a36ec[_0x3071('0xb')]('binary'),'binary');_0x2fce7a[_0x3071('0x9')](_0x3ed4a0);_0x2fce7a['end']();_0x2fce7a['on'](_0x3071('0xc'),function(){return _0x1d3dd6(_0x3137c8);});}catch(_0x44fbae){fs['unlink'](_0x3137c8);return _0x2f1e87(_0x44fbae);}});});};exports[_0x3071('0xd')]=function(_0x4e1219,_0x2fc15d,_0x45c93b,_0x1271d0){return new BPromise(function(_0x1f14e1,_0x1caa5d){_0x1271d0=combineOptions(_0x1271d0);var _0x2a6a4b=new Buffer(_0x45c93b);var _0x157a47=fs[_0x3071('0x3')](_0x4e1219);var _0x21aad3=fs[_0x3071('0x4')](_0x2fc15d);var _0x5f3c22=crypto[_0x3071('0xe')](_0x1271d0[_0x3071('0x6')],_0x2a6a4b);_0x157a47['on'](_0x3071('0x7'),function(_0x108a83){var _0x3acf0e=new Buffer(_0x5f3c22[_0x3071('0xf')](_0x108a83),_0x3071('0x8'));_0x21aad3[_0x3071('0x9')](_0x3acf0e);});_0x157a47['on']('end',function(){try{var _0x359e66=new Buffer(_0x5f3c22[_0x3071('0xb')](_0x3071('0x8')),'binary');_0x21aad3[_0x3071('0x9')](_0x359e66);_0x21aad3['end']();_0x21aad3['on'](_0x3071('0xc'),function(){return _0x1f14e1(_0x2fc15d);});}catch(_0x43128c){fs[_0x3071('0x10')](_0x2fc15d);return _0x1caa5d(_0x43128c);}});});}; \ No newline at end of file +var _0xcb91=['unlink','createReadStream','createWriteStream','createDecipher','update','aes192','hasOwnProperty','createCipher','algorithm','data','binary','write','end','final','close'];(function(_0x59a7fc,_0x26ecd9){var _0x4a16a2=function(_0x432cf1){while(--_0x432cf1){_0x59a7fc['push'](_0x59a7fc['shift']());}};_0x4a16a2(++_0x26ecd9);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x548627,_0x4ec392){_0x548627=_0x548627-0x0;var _0x844a84=_0xcb91[_0x548627];return _0x844a84;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x1cb9('0x0')};function combineOptions(_0xe4a5bf){var _0x17d4ec={};for(var _0x22c4b8 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x22c4b8)){_0x17d4ec[_0x22c4b8]=defaultOptions[_0x22c4b8];}}if(_0xe4a5bf){for(var _0x8c392f in _0xe4a5bf){if(_0xe4a5bf[_0x1cb9('0x1')](_0x8c392f)){_0x17d4ec[_0x8c392f]=_0xe4a5bf[_0x8c392f];}}}return _0x17d4ec;}exports['encryptFile']=function(_0x13d5fd,_0x1b26cd,_0x53ffbd,_0x226b69){return new BPromise(function(_0x3f7deb,_0x4ffe20){_0x226b69=combineOptions(_0x226b69);var _0x38737d=new Buffer(_0x53ffbd);var _0x12567c=fs['createReadStream'](_0x13d5fd);var _0x3ae0f1=fs['createWriteStream'](_0x1b26cd);var _0x567139=crypto[_0x1cb9('0x2')](_0x226b69[_0x1cb9('0x3')],_0x38737d);_0x12567c['on'](_0x1cb9('0x4'),function(_0x1f0eca){var _0x2fc627=new Buffer(_0x567139['update'](_0x1f0eca),_0x1cb9('0x5'));_0x3ae0f1[_0x1cb9('0x6')](_0x2fc627);});_0x12567c['on'](_0x1cb9('0x7'),function(){try{var _0x3fdd83=new Buffer(_0x567139[_0x1cb9('0x8')]('binary'),'binary');_0x3ae0f1['write'](_0x3fdd83);_0x3ae0f1[_0x1cb9('0x7')]();_0x3ae0f1['on'](_0x1cb9('0x9'),function(){return _0x3f7deb(_0x1b26cd);});}catch(_0x384496){fs[_0x1cb9('0xa')](_0x1b26cd);return _0x4ffe20(_0x384496);}});});};exports['decryptFile']=function(_0x397727,_0x6ef389,_0x1b3cd7,_0x8dfa55){return new BPromise(function(_0x3e2d11,_0x5806d8){_0x8dfa55=combineOptions(_0x8dfa55);var _0x5572cb=new Buffer(_0x1b3cd7);var _0xd446a3=fs[_0x1cb9('0xb')](_0x397727);var _0x3904b7=fs[_0x1cb9('0xc')](_0x6ef389);var _0x3e21e0=crypto[_0x1cb9('0xd')](_0x8dfa55[_0x1cb9('0x3')],_0x5572cb);_0xd446a3['on']('data',function(_0x479d43){var _0x1b2fa6=new Buffer(_0x3e21e0[_0x1cb9('0xe')](_0x479d43),_0x1cb9('0x5'));_0x3904b7[_0x1cb9('0x6')](_0x1b2fa6);});_0xd446a3['on'](_0x1cb9('0x7'),function(){try{var _0x4014de=new Buffer(_0x3e21e0[_0x1cb9('0x8')]('binary'),'binary');_0x3904b7[_0x1cb9('0x6')](_0x4014de);_0x3904b7['end']();_0x3904b7['on'](_0x1cb9('0x9'),function(){return _0x3e2d11(_0x6ef389);});}catch(_0x2265ea){fs['unlink'](_0x6ef389);return _0x5806d8(_0x2265ea);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 6adc523..121efff 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 _0x2dae=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','Setting','find','split','then','splitSizeCsv','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv','existsSync','mkdirSync','join','each','%s%d.%s','csv','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','zip','catch'];(function(_0x160c73,_0x2ee678){var _0xd9302=function(_0x169454){while(--_0x169454){_0x160c73['push'](_0x160c73['shift']());}};_0xd9302(++_0x2ee678);}(_0x2dae,0xc3));var _0xe2da=function(_0x13cab0,_0x14d825){_0x13cab0=_0x13cab0-0x0;var _0x38804f=_0x2dae[_0x13cab0];return _0x38804f;};'use strict';var util=require(_0xe2da('0x0'));var path=require('path');var _=require(_0xe2da('0x1'));var csv=require(_0xe2da('0x2'));var fs=require('fs');var BPromise=require(_0xe2da('0x3'));var zipdir=require(_0xe2da('0x4'));var rimraf=require(_0xe2da('0x5'));var db=require('../../mysqldb')['db'];var dbH=require(_0xe2da('0x6'))[_0xe2da('0x7')];var logger=require(_0xe2da('0x8'))(_0xe2da('0x9'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xe2da('0xa')][0x3];var PATH=process[_0xe2da('0xa')][0x4];function analyticExtractedReport(_0x34cc98,_0x2efbd8){var _0x238da3={'status':_0x34cc98};var _0x1c71ea={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2efbd8){_0x238da3[_0xe2da('0xb')]=_0x2efbd8;}return db[_0xe2da('0xc')][_0xe2da('0xd')](_0x238da3,_0x1c71ea);}function main(){var _0x5a2fc5=0x1388;var _0x52e650;logger[_0xe2da('0xe')](util[_0xe2da('0xf')](_0xe2da('0x10'),EXTRACTED_REPORT_ID,_0xe2da('0x11')));return db[_0xe2da('0x12')][_0xe2da('0x13')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xe2da('0x14'),'splitSizeCsv']})[_0xe2da('0x15')](function(_0x5200b1){if(_0x5200b1){_0x52e650=_0x5200b1;_0x5a2fc5=_0x52e650[_0xe2da('0x16')]||0x1388;}})[_0xe2da('0x15')](function(){return dbH[_0xe2da('0x17')][_0xe2da('0x18')](util[_0xe2da('0xf')](_0xe2da('0x19'),QUERY),{'type':dbH[_0xe2da('0x17')]['QueryTypes'][_0xe2da('0x1a')]});})['then'](function(_0x586b27){if(!_0x586b27[0x0][_0xe2da('0x1b')]){return analyticExtractedReport(_0xe2da('0x1c'));}var _0x33f919=[];var _0x4dc58b=0x0;var _0x25d4fa=!![];if(_0x586b27&&_0x586b27[_0xe2da('0x1d')]){var _0x2ea60e=_0x586b27[0x0][_0xe2da('0x1b')]%(_0x4dc58b+_0x5a2fc5);if(_0x52e650['split']){for(;_0x25d4fa;_0x4dc58b+=_0x5a2fc5,_0x2ea60e=_0x586b27[0x0][_0xe2da('0x1b')]%(_0x4dc58b+_0x5a2fc5)){if(_0x2ea60e==0x0||_0x2ea60e==_0x586b27[0x0][_0xe2da('0x1b')]){_0x25d4fa=![];}_0x33f919[_0xe2da('0x1e')](dbH[_0xe2da('0x17')][_0xe2da('0x18')](util['format'](_0xe2da('0x1f'),QUERY,_0x5a2fc5,_0x4dc58b),{'type':dbH[_0xe2da('0x17')]['QueryTypes'][_0xe2da('0x1a')]}));}}else{_0x33f919[_0xe2da('0x1e')](dbH[_0xe2da('0x17')][_0xe2da('0x18')](QUERY,{'type':dbH[_0xe2da('0x17')][_0xe2da('0x20')]['SELECT']}));}}var _0x467cd6=path['dirname'](PATH);var _0x30efdc=path[_0xe2da('0x21')](PATH,_0xe2da('0x22'));var _0x28f1d3=_0x52e650[_0xe2da('0x14')]&&_0x33f919[_0xe2da('0x1d')]>0x1;var _0x38f2c4=[];if(!fs[_0xe2da('0x23')](path['join'](_0x467cd6,_0x30efdc))&&_0x28f1d3){fs[_0xe2da('0x24')](path[_0xe2da('0x25')](_0x467cd6,_0x30efdc));}return BPromise[_0xe2da('0x26')](_0x33f919,function(_0x14704d){_0x38f2c4[_0xe2da('0x1e')](_0x14704d);})[_0xe2da('0x15')](function(){for(var _0x124d93=0x0;_0x124d93<_0x38f2c4['length'];_0x124d93+=0x1){var _0x2adc49;var _0x3e23d7=_0x38f2c4[_0x124d93];if(_0x28f1d3){_0x2adc49=path[_0xe2da('0x25')](_0x467cd6,_0x30efdc,util[_0xe2da('0xf')](_0xe2da('0x27'),_0x30efdc,_0x124d93,_0xe2da('0x28')));}else{_0x2adc49=path[_0xe2da('0x25')](_0x467cd6,util[_0xe2da('0xf')]('%s.%s',_0x30efdc,'csv'));}fs['writeFileSync'](_0x2adc49,csv(_0x3e23d7));}})[_0xe2da('0x15')](function(){if(_0x28f1d3){zipdir(path[_0xe2da('0x25')](_0x467cd6,_0x30efdc),{'saveTo':path[_0xe2da('0x25')](_0x467cd6,util[_0xe2da('0xf')]('%s.%s',_0x30efdc,'zip'))},function(_0x356ab4,_0x1ec8ca){});rimraf(path[_0xe2da('0x25')](_0x467cd6,_0x30efdc),function(){});}})[_0xe2da('0x15')](function(){logger[_0xe2da('0xe')](util[_0xe2da('0xf')](_0xe2da('0x29'),EXTRACTED_REPORT_ID,_0xe2da('0x11')));return analyticExtractedReport(_0xe2da('0x2a'),_0x28f1d3?util['format']('%s.%s',_0x30efdc,_0x28f1d3?_0xe2da('0x2b'):_0xe2da('0x28')):null);});})[_0xe2da('0x2c')](function(_0x34f5fe){logger[_0xe2da('0xe')](util[_0xe2da('0xf')](_0xe2da('0x2d'),EXTRACTED_REPORT_ID,_0xe2da('0x11')),util[_0xe2da('0x2e')](_0x34f5fe,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xe2da('0x2f'));});}main(); \ No newline at end of file +var _0xfd28=['%s.%s','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','path','lodash','bluebird','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','update','format','CSV','find','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','split','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','length','existsSync','join','mkdirSync','each','csv','writeFileSync'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0xfd28,0x148));var _0x8fd2=function(_0x51c819,_0xd812db){_0x51c819=_0x51c819-0x0;var _0x15c5d2=_0xfd28[_0x51c819];return _0x15c5d2;};'use strict';var util=require('util');var path=require(_0x8fd2('0x0'));var _=require(_0x8fd2('0x1'));var csv=require('to-csv');var fs=require('fs');var BPromise=require(_0x8fd2('0x2'));var zipdir=require('zip-dir');var rimraf=require(_0x8fd2('0x3'));var db=require(_0x8fd2('0x4'))['db'];var dbH=require(_0x8fd2('0x4'))['dbH'];var logger=require(_0x8fd2('0x5'))(_0x8fd2('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x8fd2('0x7')][0x2]);var QUERY=process[_0x8fd2('0x7')][0x3];var PATH=process[_0x8fd2('0x7')][0x4];function analyticExtractedReport(_0x4bdc1a,_0x53d938){var _0x10fccf={'status':_0x4bdc1a};var _0x466c3d={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x53d938){_0x10fccf[_0x8fd2('0x8')]=_0x53d938;}return db['AnalyticExtractedReport'][_0x8fd2('0x9')](_0x10fccf,_0x466c3d);}function main(){var _0x49ca87=0x1388;var _0x2842f3;logger['info'](util[_0x8fd2('0xa')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0x8fd2('0xb')));return db['Setting'][_0x8fd2('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x8fd2('0xd')]})[_0x8fd2('0xe')](function(_0xfd78d){if(_0xfd78d){_0x2842f3=_0xfd78d;_0x49ca87=_0x2842f3[_0x8fd2('0xd')]||0x1388;}})[_0x8fd2('0xe')](function(){return dbH[_0x8fd2('0xf')][_0x8fd2('0x10')](util[_0x8fd2('0xa')](_0x8fd2('0x11'),QUERY),{'type':dbH[_0x8fd2('0xf')][_0x8fd2('0x12')][_0x8fd2('0x13')]});})[_0x8fd2('0xe')](function(_0x40712c){if(!_0x40712c[0x0][_0x8fd2('0x14')]){return analyticExtractedReport('Empty');}var _0x20daca=[];var _0x5ef478=0x0;var _0x4f0b17=!![];if(_0x40712c&&_0x40712c['length']){var _0x3b79f3=_0x40712c[0x0][_0x8fd2('0x14')]%(_0x5ef478+_0x49ca87);if(_0x2842f3[_0x8fd2('0x15')]){for(;_0x4f0b17;_0x5ef478+=_0x49ca87,_0x3b79f3=_0x40712c[0x0][_0x8fd2('0x14')]%(_0x5ef478+_0x49ca87)){if(_0x3b79f3==0x0||_0x3b79f3==_0x40712c[0x0]['num']){_0x4f0b17=![];}_0x20daca[_0x8fd2('0x16')](dbH[_0x8fd2('0xf')][_0x8fd2('0x10')](util[_0x8fd2('0xa')](_0x8fd2('0x17'),QUERY,_0x49ca87,_0x5ef478),{'type':dbH['sequelize']['QueryTypes'][_0x8fd2('0x13')]}));}}else{_0x20daca['push'](dbH[_0x8fd2('0xf')]['query'](QUERY,{'type':dbH[_0x8fd2('0xf')][_0x8fd2('0x12')]['SELECT']}));}}var _0x122b60=path['dirname'](PATH);var _0xd3981f=path[_0x8fd2('0x18')](PATH,'.csv');var _0x1c925c=_0x2842f3[_0x8fd2('0x15')]&&_0x20daca[_0x8fd2('0x19')]>0x1;var _0x490ea5=[];if(!fs[_0x8fd2('0x1a')](path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f))&&_0x1c925c){fs[_0x8fd2('0x1c')](path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f));}return BPromise[_0x8fd2('0x1d')](_0x20daca,function(_0x25db4e){_0x490ea5[_0x8fd2('0x16')](_0x25db4e);})[_0x8fd2('0xe')](function(){for(var _0x1456b4=0x0;_0x1456b4<_0x490ea5[_0x8fd2('0x19')];_0x1456b4+=0x1){var _0x3392fb;var _0x1f3237=_0x490ea5[_0x1456b4];if(_0x1c925c){_0x3392fb=path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f,util['format']('%s%d.%s',_0xd3981f,_0x1456b4,_0x8fd2('0x1e')));}else{_0x3392fb=path[_0x8fd2('0x1b')](_0x122b60,util[_0x8fd2('0xa')]('%s.%s',_0xd3981f,_0x8fd2('0x1e')));}fs[_0x8fd2('0x1f')](_0x3392fb,csv(_0x1f3237));}})[_0x8fd2('0xe')](function(){if(_0x1c925c){zipdir(path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f),{'saveTo':path[_0x8fd2('0x1b')](_0x122b60,util[_0x8fd2('0xa')](_0x8fd2('0x20'),_0xd3981f,'zip'))},function(_0xe76676,_0x13c9b9){});rimraf(path[_0x8fd2('0x1b')](_0x122b60,_0xd3981f),function(){});}})[_0x8fd2('0xe')](function(){logger[_0x8fd2('0x21')](util[_0x8fd2('0xa')](_0x8fd2('0x22'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x1c925c?util['format'](_0x8fd2('0x20'),_0xd3981f,_0x1c925c?_0x8fd2('0x23'):_0x8fd2('0x1e')):null);});})[_0x8fd2('0x24')](function(_0x5a0b3b){logger['info'](util[_0x8fd2('0xa')](_0x8fd2('0x25'),EXTRACTED_REPORT_ID,_0x8fd2('0xb')),util[_0x8fd2('0x26')](_0x5a0b3b,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x8fd2('0x27'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index 4614260..ffb34f9 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 _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x4e85b8,_0x50240e){var _0x193cf9=function(_0x540606){while(--_0x540606){_0x4e85b8['push'](_0x4e85b8['shift']());}};_0x193cf9(++_0x50240e);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}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(_0x26836c,_0x366502){var _0x16367e=function(_0x241384){while(--_0x241384){_0x26836c['push'](_0x26836c['shift']());}};_0x16367e(++_0x366502);}(_0xb10b,0x12a));var _0xbb10=function(_0x10c4f9,_0x100fb4){_0x10c4f9=_0x10c4f9-0x0;var _0x522b09=_0xb10b[_0x10c4f9];return _0x522b09;};'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 c8cf1df..4ae1886 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 _0x18ba=['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','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','basename','existsSync','join','mkdirSync','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','json2xls','bluebird'];(function(_0x2750a0,_0x53d176){var _0x47a794=function(_0x409c24){while(--_0x409c24){_0x2750a0['push'](_0x2750a0['shift']());}};_0x47a794(++_0x53d176);}(_0x18ba,0x1a3));var _0xa18b=function(_0x36339d,_0xc34405){_0x36339d=_0x36339d-0x0;var _0x158516=_0x18ba[_0x36339d];return _0x158516;};'use strict';var util=require(_0xa18b('0x0'));var path=require(_0xa18b('0x1'));var _=require('lodash');var fs=require('fs');var json2xls=require(_0xa18b('0x2'));var BPromise=require(_0xa18b('0x3'));var zipdir=require(_0xa18b('0x4'));var rimraf=require(_0xa18b('0x5'));var db=require(_0xa18b('0x6'))['db'];var dbH=require('../../mysqldb')[_0xa18b('0x7')];var logger=require(_0xa18b('0x8'))(_0xa18b('0x9'));var EXTRACTED_REPORT_ID=Number(process[_0xa18b('0xa')][0x2]);var QUERY=process[_0xa18b('0xa')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x5d47ed,_0x48bcd4){var _0x46d228={'status':_0x5d47ed};var _0x2ec3c4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x48bcd4){_0x46d228[_0xa18b('0xb')]=_0x48bcd4;}return db['AnalyticExtractedReport'][_0xa18b('0xc')](_0x46d228,_0x2ec3c4);}function main(){var _0xce327a=0x1388;var _0x4509fa;logger[_0xa18b('0xd')](util[_0xa18b('0xe')](_0xa18b('0xf'),EXTRACTED_REPORT_ID,_0xa18b('0x10')));return db['Setting'][_0xa18b('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa18b('0x12'),_0xa18b('0x13')]})[_0xa18b('0x14')](function(_0xd640){if(_0xd640){_0x4509fa=_0xd640;_0xce327a=_0x4509fa[_0xa18b('0x13')]||0x1388;}})[_0xa18b('0x14')](function(){return dbH[_0xa18b('0x15')][_0xa18b('0x16')](util[_0xa18b('0xe')](_0xa18b('0x17'),QUERY),{'type':dbH['sequelize'][_0xa18b('0x18')][_0xa18b('0x19')]});})[_0xa18b('0x14')](function(_0xf5f537){if(!_0xf5f537[0x0][_0xa18b('0x1a')]){return analyticExtractedReport(_0xa18b('0x1b'));}var _0x242920=[];var _0x330c14=0x0;var _0x5b72f9=!![];if(_0x4509fa[_0xa18b('0x12')]){if(_0xf5f537&&_0xf5f537[_0xa18b('0x1c')]){var _0x539a36=_0xf5f537[0x0][_0xa18b('0x1a')]%(_0x330c14+_0xce327a);for(;_0x5b72f9;_0x330c14+=_0xce327a,_0x539a36=_0xf5f537[0x0][_0xa18b('0x1a')]%(_0x330c14+_0xce327a)){if(_0x539a36==0x0||_0x539a36==_0xf5f537[0x0][_0xa18b('0x1a')]){_0x5b72f9=![];}_0x242920[_0xa18b('0x1d')](dbH[_0xa18b('0x15')][_0xa18b('0x16')](util[_0xa18b('0xe')](_0xa18b('0x1e'),QUERY,_0xce327a,_0x330c14),{'type':dbH[_0xa18b('0x15')]['QueryTypes'][_0xa18b('0x19')]}));}}}else{_0x242920[_0xa18b('0x1d')](dbH[_0xa18b('0x15')]['query'](QUERY,{'type':dbH[_0xa18b('0x15')][_0xa18b('0x18')][_0xa18b('0x19')]}));}var _0x29b6fb=path['dirname'](PATH);var _0x15e3cb=path[_0xa18b('0x1f')](PATH,'.xlsx');var _0x42d777=_0x4509fa['split']&&_0x242920[_0xa18b('0x1c')]>0x1;var _0x539a87=[];if(!fs[_0xa18b('0x20')](path[_0xa18b('0x21')](_0x29b6fb,_0x15e3cb))&&_0x42d777){fs[_0xa18b('0x22')](path[_0xa18b('0x21')](_0x29b6fb,_0x15e3cb));}return BPromise['each'](_0x242920,function(_0x23d799){_0x539a87[_0xa18b('0x1d')](_0x23d799);})['then'](function(){for(var _0x1bfedb=0x0;_0x1bfedb<_0x539a87[_0xa18b('0x1c')];_0x1bfedb+=0x1){var _0x9e0550;var _0x1ba277=_0x539a87[_0x1bfedb];if(_0x42d777){_0x9e0550=path[_0xa18b('0x21')](_0x29b6fb,_0x15e3cb,util[_0xa18b('0xe')](_0xa18b('0x23'),_0x15e3cb,_0x1bfedb,_0xa18b('0x24')));}else{_0x9e0550=path[_0xa18b('0x21')](_0x29b6fb,util['format']('%s.%s',_0x15e3cb,_0xa18b('0x24')));}fs[_0xa18b('0x25')](_0x9e0550,json2xls(_0x1ba277),_0xa18b('0x26'));}})[_0xa18b('0x14')](function(){if(_0x42d777){zipdir(path[_0xa18b('0x21')](_0x29b6fb,_0x15e3cb),{'saveTo':path['join'](_0x29b6fb,util['format'](_0xa18b('0x27'),_0x15e3cb,_0xa18b('0x28')))},function(_0x372ad6,_0x3b00d1){});rimraf(path['join'](_0x29b6fb,_0x15e3cb),function(){});}})[_0xa18b('0x14')](function(){logger[_0xa18b('0xd')](util[_0xa18b('0xe')](_0xa18b('0x29'),EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0xa18b('0x2a'),_0x42d777?util[_0xa18b('0xe')](_0xa18b('0x27'),_0x15e3cb,_0x42d777?'zip':_0xa18b('0x24')):null);});})[_0xa18b('0x2b')](function(_0x2de575){logger[_0xa18b('0xd')](util[_0xa18b('0xe')](_0xa18b('0x2c'),EXTRACTED_REPORT_ID,_0xa18b('0x10')),util[_0xa18b('0x2d')](_0x2de575,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xa18b('0x2e'));});}main(); \ No newline at end of file +var _0xae24=['analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','sequelize','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','then','num','Empty','split','length','%s\x20limit\x20%d\x20OFFSET\x20%d','push','query','dirname','basename','existsSync','mkdirSync','each','%s%d.%s','xlsx','join','%s.%s','writeFileSync','binary','zip','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger'];(function(_0x46daef,_0x65d227){var _0x2138b1=function(_0x3a9153){while(--_0x3a9153){_0x46daef['push'](_0x46daef['shift']());}};_0x2138b1(++_0x65d227);}(_0xae24,0x180));var _0x4ae2=function(_0x1b3660,_0x2b69fd){_0x1b3660=_0x1b3660-0x0;var _0x31859b=_0xae24[_0x1b3660];return _0x31859b;};'use strict';var util=require('util');var path=require('path');var _=require(_0x4ae2('0x0'));var fs=require('fs');var json2xls=require(_0x4ae2('0x1'));var BPromise=require(_0x4ae2('0x2'));var zipdir=require(_0x4ae2('0x3'));var rimraf=require(_0x4ae2('0x4'));var db=require(_0x4ae2('0x5'))['db'];var dbH=require(_0x4ae2('0x5'))[_0x4ae2('0x6')];var logger=require(_0x4ae2('0x7'))(_0x4ae2('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x4ae2('0x9')][0x3];var PATH=process[_0x4ae2('0x9')][0x4];function analyticExtractedReport(_0xda7751,_0x596c50){var _0x583af6={'status':_0xda7751};var _0x1533d0={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x596c50){_0x583af6[_0x4ae2('0xa')]=_0x596c50;}return db[_0x4ae2('0xb')][_0x4ae2('0xc')](_0x583af6,_0x1533d0);}function main(){var _0x26de8b=0x1388;var _0xf85fbf;logger[_0x4ae2('0xd')](util[_0x4ae2('0xe')](_0x4ae2('0xf'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0x4ae2('0x10')][_0x4ae2('0x11')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x4ae2('0x12')]})['then'](function(_0x19ac8c){if(_0x19ac8c){_0xf85fbf=_0x19ac8c;_0x26de8b=_0xf85fbf[_0x4ae2('0x12')]||0x1388;}})['then'](function(){return dbH[_0x4ae2('0x13')]['query'](util[_0x4ae2('0xe')](_0x4ae2('0x14'),QUERY),{'type':dbH['sequelize'][_0x4ae2('0x15')][_0x4ae2('0x16')]});})[_0x4ae2('0x17')](function(_0x2765aa){if(!_0x2765aa[0x0][_0x4ae2('0x18')]){return analyticExtractedReport(_0x4ae2('0x19'));}var _0x4939dd=[];var _0x2d356e=0x0;var _0x311af9=!![];if(_0xf85fbf[_0x4ae2('0x1a')]){if(_0x2765aa&&_0x2765aa[_0x4ae2('0x1b')]){var _0x5b92ae=_0x2765aa[0x0][_0x4ae2('0x18')]%(_0x2d356e+_0x26de8b);for(;_0x311af9;_0x2d356e+=_0x26de8b,_0x5b92ae=_0x2765aa[0x0][_0x4ae2('0x18')]%(_0x2d356e+_0x26de8b)){if(_0x5b92ae==0x0||_0x5b92ae==_0x2765aa[0x0][_0x4ae2('0x18')]){_0x311af9=![];}_0x4939dd['push'](dbH[_0x4ae2('0x13')]['query'](util[_0x4ae2('0xe')](_0x4ae2('0x1c'),QUERY,_0x26de8b,_0x2d356e),{'type':dbH[_0x4ae2('0x13')]['QueryTypes'][_0x4ae2('0x16')]}));}}}else{_0x4939dd[_0x4ae2('0x1d')](dbH[_0x4ae2('0x13')][_0x4ae2('0x1e')](QUERY,{'type':dbH[_0x4ae2('0x13')][_0x4ae2('0x15')][_0x4ae2('0x16')]}));}var _0x4ed053=path[_0x4ae2('0x1f')](PATH);var _0x496936=path[_0x4ae2('0x20')](PATH,'.xlsx');var _0xa05c62=_0xf85fbf[_0x4ae2('0x1a')]&&_0x4939dd['length']>0x1;var _0x2002ae=[];if(!fs[_0x4ae2('0x21')](path['join'](_0x4ed053,_0x496936))&&_0xa05c62){fs[_0x4ae2('0x22')](path['join'](_0x4ed053,_0x496936));}return BPromise[_0x4ae2('0x23')](_0x4939dd,function(_0x47c965){_0x2002ae[_0x4ae2('0x1d')](_0x47c965);})[_0x4ae2('0x17')](function(){for(var _0x13c2e0=0x0;_0x13c2e0<_0x2002ae[_0x4ae2('0x1b')];_0x13c2e0+=0x1){var _0x3780b3;var _0x26f40c=_0x2002ae[_0x13c2e0];if(_0xa05c62){_0x3780b3=path['join'](_0x4ed053,_0x496936,util[_0x4ae2('0xe')](_0x4ae2('0x24'),_0x496936,_0x13c2e0,_0x4ae2('0x25')));}else{_0x3780b3=path[_0x4ae2('0x26')](_0x4ed053,util['format'](_0x4ae2('0x27'),_0x496936,_0x4ae2('0x25')));}fs[_0x4ae2('0x28')](_0x3780b3,json2xls(_0x26f40c),_0x4ae2('0x29'));}})['then'](function(){if(_0xa05c62){zipdir(path[_0x4ae2('0x26')](_0x4ed053,_0x496936),{'saveTo':path[_0x4ae2('0x26')](_0x4ed053,util[_0x4ae2('0xe')](_0x4ae2('0x27'),_0x496936,_0x4ae2('0x2a')))},function(_0x274f8b,_0x10ac73){});rimraf(path[_0x4ae2('0x26')](_0x4ed053,_0x496936),function(){});}})['then'](function(){logger['info'](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0x4ae2('0x2b')));return analyticExtractedReport(_0x4ae2('0x2c'),_0xa05c62?util[_0x4ae2('0xe')](_0x4ae2('0x27'),_0x496936,_0xa05c62?'zip':_0x4ae2('0x25')):null);});})[_0x4ae2('0x2d')](function(_0x2aee02){logger['info'](util[_0x4ae2('0xe')](_0x4ae2('0x2e'),EXTRACTED_REPORT_ID,_0x4ae2('0x2b')),util[_0x4ae2('0x2f')](_0x2aee02,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x4ae2('0x30'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index d955111..b052751 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 _0x90d7=['uniq','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','playback','priority','extensions','push','context','exten','VoiceExtensionId','type','Set','CDR(destination)=','${EXTEN:','extension','cutdigits','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','toLowerCase','updatedAt','interval','*,*,*,*','map','hasOwnProperty','tag','CDR(tag)=','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','error','lodash','util','Interval','findAll','then','intervals','models','VoiceExtension','IntervalId'];(function(_0x2a9887,_0xd9ca41){var _0x56c803=function(_0x583e86){while(--_0x583e86){_0x2a9887['push'](_0x2a9887['shift']());}};_0x56c803(++_0xd9ca41);}(_0x90d7,0x1be));var _0x790d=function(_0x128e41,_0x2808d6){_0x128e41=_0x128e41-0x0;var _0x544908=_0x90d7[_0x128e41];return _0x544908;};'use strict';var _=require(_0x790d('0x0'));var util=require(_0x790d('0x1'));function rewrite(_0x1d96ec,_0x26eb32){var _0x1261ac=this;return _0x1d96ec['models'][_0x790d('0x2')][_0x790d('0x3')]({'raw':!![]})[_0x790d('0x4')](function(_0x467b2c){_0x1261ac[_0x790d('0x5')]=_0x467b2c;return _0x1d96ec[_0x790d('0x6')][_0x790d('0x7')]['findAll']({'where':{'IntervalId':_0x26eb32[_0x790d('0x8')]},'raw':!![]});})[_0x790d('0x4')](function(_0x5b9cc3){return _0x1d96ec[_0x790d('0x6')][_0x790d('0x7')][_0x790d('0x3')]({'where':{'exten':{'$in':_[_0x790d('0x9')](_['map'](_0x5b9cc3,'exten'))}},'order':[{'raw':_0x790d('0xa')}],'raw':!![]});})[_0x790d('0x4')](function(_0x2be2eb){var _0x420e97=_[_0x790d('0xb')](_0x2be2eb,{'priority':'1'});var _0x53df24=_[_0x790d('0xb')](_0x2be2eb,{'isApp':0x1});var _0x4aac7f=_['groupBy'](_0x53df24,'exten');var _0x4e8d8c=[_0x790d('0xc'),_0x790d('0xd')];var _0x566ba5=[];var _0x5b4efe=[];for(var _0x4f1576 in _0x4aac7f){if(_0x4aac7f['hasOwnProperty'](_0x4f1576)){_0x1261ac[_0x790d('0xe')]=0x2;_0x1261ac[_0x790d('0xf')]=[];_0x1261ac['extension']=_['find'](_0x420e97,{'exten':_0x4aac7f[_0x4f1576][0x0]['exten']});_0x1261ac[_0x790d('0xf')][_0x790d('0x10')]({'type':_0x4aac7f[_0x4f1576][0x0]['type'],'app':'Set','appdata':util['format']('CDR(type)=%s',_0x4aac7f[_0x4f1576][0x0]['type']),'context':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x11')],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac[_0x790d('0xe')]++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});if(_0x4aac7f[_0x4f1576][0x0][_0x790d('0x14')]==='outbound'){if(_0x1261ac['extension']){_0x1261ac[_0x790d('0xf')][_0x790d('0x10')]({'type':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':_0x790d('0x16')+(_0x1261ac['extension']['cutdigits']?_0x790d('0x17')+_0x1261ac[_0x790d('0x18')][_0x790d('0x19')]+'}':'${EXTEN}'),'context':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x11')],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac[_0x790d('0xe')]++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0]['VoiceExtensionId']});}_0x1261ac[_0x790d('0xf')]['push']({'type':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':'CDR(routeid)='+_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')],'context':_0x4aac7f[_0x4f1576][0x0]['context'],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac[_0x790d('0xe')]++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});var _0x4ad24a=_0x1261ac[_0x790d('0xe')]++;_0x1261ac[_0x790d('0xf')][_0x790d('0x10')]({'type':_0x4aac7f[_0x4f1576][0x0]['type'],'app':_0x790d('0x1a'),'appdata':_0x790d('0x1b')+(_0x4ad24a+0x2)+_0x790d('0x1c')+(_0x4ad24a+0x1)+')','context':_0x4aac7f[_0x4f1576][0x0]['context'],'exten':_0x4aac7f[_0x4f1576][0x0]['exten'],'priority':_0x4ad24a,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});if(_0x1261ac['extension']){_0x1261ac[_0x790d('0xf')]['push']({'type':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':_0x1261ac[_0x790d('0x18')][_0x790d('0x19')]?_0x790d('0x1d')+_0x1261ac[_0x790d('0x18')]['cutdigits']+'}':'CDR(prefix)=noprefix','context':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x11')],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac[_0x790d('0xe')]++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0]['VoiceExtensionId']});}_0x1261ac[_0x790d('0xf')][_0x790d('0x10')]({'type':_0x4aac7f[_0x4f1576][0x0]['type'],'app':'Set','appdata':_0x790d('0x1e')+_0x4aac7f[_0x4f1576][0x0]['VoiceExtensionId'],'context':_0x4aac7f[_0x4f1576][0x0]['context'],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac[_0x790d('0xe')]++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});if(_0x1261ac[_0x790d('0x18')]&&_0x1261ac[_0x790d('0x18')]['hasOwnProperty'](_0x790d('0x1f'))&&_0x1261ac[_0x790d('0x18')][_0x790d('0x1f')]!==_0x790d('0x20')){_0x1261ac[_0x790d('0xf')][_0x790d('0x10')]({'type':_0x4aac7f[_0x4f1576][0x0]['type'],'app':_0x790d('0x15'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x11')],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac['priority']++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});_0x1261ac[_0x790d('0xf')]['push']({'type':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':_0x790d('0x21')+_0x1261ac['extension']['recordingFormat']||_0x790d('0x22'),'context':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x11')],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac[_0x790d('0xe')]++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});}}_0x1261ac[_0x790d('0xf')]['push']({'type':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':_0x790d('0x23'),'context':_0x4aac7f[_0x4f1576][0x0]['context'],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac[_0x790d('0xe')]++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});_0x1261ac[_0x790d('0xf')][_0x790d('0x10')]({'type':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x4aac7f[_0x4f1576][0x0]['context'],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac['priority']++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});_0x1261ac[_0x790d('0xf')][_0x790d('0x10')]({'type':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':_0x790d('0x24'),'context':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x11')],'exten':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x12')],'priority':_0x1261ac[_0x790d('0xe')]++,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});for(var _0x229e59=0x0,_0x5f29df=0x0;_0x229e59<_0x4aac7f[_0x4f1576][_0x790d('0x25')];_0x229e59+=0x1,_0x5f29df=0x0){var _0x28a4e2=_0x4aac7f[_0x4f1576][_0x229e59];if(_0x28a4e2[_0x790d('0x14')]){_0x28a4e2[_0x790d('0x14')]=_0x28a4e2[_0x790d('0x14')][_0x790d('0x26')]();}var _0x3c15cd=[];var _0x1b7adc=[];delete _0x28a4e2['id'];delete _0x28a4e2['createdAt'];delete _0x28a4e2[_0x790d('0x27')];var _0x133bd3=_0x28a4e2[_0x790d('0x28')]!==_0x790d('0x29')?[_0x28a4e2[_0x790d('0x28')]]:_0x28a4e2[_0x790d('0x8')]?_[_0x790d('0x2a')](_['filter'](_0x1261ac[_0x790d('0x5')],{'IntervalId':_0x28a4e2['IntervalId']}),_0x790d('0x28')):[];if(_0x28a4e2[_0x790d('0x2b')]('tag')){if(_0x28a4e2[_0x790d('0x2c')]&&_0x28a4e2[_0x790d('0x2c')]!=='--'){_0x3c15cd['push']({'type':_0x28a4e2[_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':_0x790d('0x2d')+_0x28a4e2[_0x790d('0x2c')],'context':_0x28a4e2['context'],'exten':_0x28a4e2['exten'],'priority':_0x133bd3['length']+_0x1261ac[_0x790d('0xe')]+_0x5f29df++,'VoiceExtensionId':_0x28a4e2['VoiceExtensionId']});}}if(_0x28a4e2['type']===_0x790d('0x2e')&&_0x28a4e2[_0x790d('0x2b')](_0x790d('0x2f'))){if(_0x28a4e2['callerID']){_0x3c15cd[_0x790d('0x10')]({'type':_0x28a4e2[_0x790d('0x14')],'app':_0x790d('0x1a'),'appdata':_0x790d('0x30')+_0x28a4e2[_0x790d('0x2f')]+')','context':_0x28a4e2[_0x790d('0x11')],'exten':_0x28a4e2[_0x790d('0x12')],'priority':_0x133bd3['length']+_0x1261ac['priority']+_0x5f29df++,'VoiceExtensionId':_0x28a4e2[_0x790d('0x13')]});}else{_0x3c15cd[_0x790d('0x10')]({'type':_0x28a4e2[_0x790d('0x14')],'app':_0x790d('0x1a'),'appdata':_0x790d('0x31'),'context':_0x28a4e2[_0x790d('0x11')],'exten':_0x28a4e2['exten'],'priority':_0x133bd3[_0x790d('0x25')]+_0x1261ac[_0x790d('0xe')]+_0x5f29df++,'VoiceExtensionId':_0x28a4e2[_0x790d('0x13')]});}}if(_0x28a4e2[_0x790d('0x2b')]('answer')){if(_0x4e8d8c[_0x790d('0x32')](_0x28a4e2[_0x790d('0x33')]['toLowerCase']())>=0x0&&_0x28a4e2['appType']!=='custom'){if(_0x28a4e2[_0x790d('0x34')]){_0x3c15cd['push']({'type':_0x28a4e2['type'],'app':'ExecIf','appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x28a4e2['context'],'exten':_0x28a4e2['exten'],'priority':_0x133bd3[_0x790d('0x25')]+_0x1261ac[_0x790d('0xe')]+_0x5f29df++,'VoiceExtensionId':_0x28a4e2[_0x790d('0x13')]});_0x3c15cd['push']({'type':_0x28a4e2['type'],'app':'Set','appdata':_0x790d('0x35'),'context':_0x28a4e2['context'],'exten':_0x28a4e2['exten'],'priority':_0x133bd3[_0x790d('0x25')]+_0x1261ac[_0x790d('0xe')]+_0x5f29df++,'VoiceExtensionId':_0x28a4e2[_0x790d('0x13')]});}else{_0x3c15cd['push']({'type':_0x28a4e2['type'],'app':_0x790d('0x1a'),'appdata':_0x790d('0x36'),'context':_0x28a4e2['context'],'exten':_0x28a4e2[_0x790d('0x12')],'priority':_0x133bd3['length']+_0x1261ac[_0x790d('0xe')]+_0x5f29df++,'VoiceExtensionId':_0x28a4e2[_0x790d('0x13')]});_0x3c15cd[_0x790d('0x10')]({'type':_0x28a4e2[_0x790d('0x14')],'app':_0x790d('0x15'),'appdata':_0x790d('0x37'),'context':_0x28a4e2['context'],'exten':_0x28a4e2[_0x790d('0x12')],'priority':_0x133bd3[_0x790d('0x25')]+_0x1261ac[_0x790d('0xe')]+_0x5f29df++,'VoiceExtensionId':_0x28a4e2[_0x790d('0x13')]});}}}for(var _0xc60909=0x0;_0xc60909<_0x133bd3['length'];_0xc60909+=0x1){var _0xc92457=_0x1261ac['priority']+_0x133bd3['length'];var _0x3fb473=_0xc60909===_0x133bd3[_0x790d('0x25')]-0x1?_0x1261ac[_0x790d('0xe')]+_0x3c15cd[_0x790d('0x25')]+_0x1b7adc[_0x790d('0x25')]+0x2:_0x1261ac[_0x790d('0xe')]+_0xc60909+0x1;_0x3c15cd[_0x790d('0x38')](_0xc60909,0x0,{'type':_0x28a4e2[_0x790d('0x14')],'app':_0x790d('0x39'),'appdata':_0x133bd3[_0xc60909]+'?'+_0x28a4e2[_0x790d('0x11')]+',${EXTEN},'+_0xc92457+':'+_0x28a4e2['context']+_0x790d('0x3a')+_0x3fb473,'exten':_0x28a4e2[_0x790d('0x12')],'context':_0x28a4e2[_0x790d('0x11')],'priority':_0x1261ac[_0x790d('0xe')]+_0xc60909,'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});}_0x28a4e2[_0x790d('0xe')]=_0x3c15cd['length']?_[_0x790d('0x3b')](_0x3c15cd)[_0x790d('0xe')]+0x1:_0x1261ac['priority'];_0x1261ac[_0x790d('0xe')]=(_0x1b7adc['length']?_[_0x790d('0x3b')](_0x1b7adc)[_0x790d('0xe')]:_0x28a4e2[_0x790d('0xe')])+0x1;_0x1261ac[_0x790d('0xf')]=_[_0x790d('0x3c')](_0x1261ac[_0x790d('0xf')],_0x3c15cd,[_0x28a4e2],_0x1b7adc);}_0x1261ac[_0x790d('0xf')]['push']({'type':_0x4aac7f[_0x4f1576][0x0]['type'],'app':_0x790d('0x3d'),'exten':_0x4aac7f[_0x4f1576][0x0]['exten'],'context':_0x4aac7f[_0x4f1576][0x0]['context'],'priority':_0x1261ac[_0x790d('0xe')],'VoiceExtensionId':_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]});_0x566ba5[_0x790d('0x10')](_0x4aac7f[_0x4f1576][0x0][_0x790d('0x13')]);_0x5b4efe=_[_0x790d('0x3c')](_0x5b4efe,_0x1261ac[_0x790d('0xf')]);}}return _0x1d96ec[_0x790d('0x3e')](function(_0x3beaeb){return _0x1d96ec[_0x790d('0x6')][_0x790d('0x7')][_0x790d('0x3f')]({'where':{'VoiceExtensionId':{'$in':_0x566ba5}},'transaction':_0x3beaeb})[_0x790d('0x4')](function(_0x11bc6a){return _0x1d96ec['models'][_0x790d('0x7')]['bulkCreate'](_['sortBy'](_0x5b4efe,_0x790d('0xe')),{'transaction':_0x3beaeb});});});})['catch'](function(_0x39d4da){console[_0x790d('0x40')](_0x39d4da);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x32f8=['updatedAt','interval','tag','CDR(tag)=','outbound','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','toLowerCase','appType','custom','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice','GotoIfTime',',${EXTEN},','last','concat','transaction','destroy','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extension','find','push','Set','format','context','extensions','type','CDR(destination)=','${EXTEN:','${EXTEN}','CDR(routeid)=','VoiceExtensionId','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','cutdigits','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','length','createdAt'];(function(_0x425969,_0x5efd79){var _0x56b57f=function(_0x19cb61){while(--_0x19cb61){_0x425969['push'](_0x425969['shift']());}};_0x56b57f(++_0x5efd79);}(_0x32f8,0xaf));var _0x832f=function(_0x17f1fa,_0x3f9082){_0x17f1fa=_0x17f1fa-0x0;var _0x8aebf7=_0x32f8[_0x17f1fa];return _0x8aebf7;};'use strict';var _=require(_0x832f('0x0'));var util=require(_0x832f('0x1'));function rewrite(_0x5b9858,_0x506ede){var _0x27dcf0=this;return _0x5b9858[_0x832f('0x2')]['Interval'][_0x832f('0x3')]({'raw':!![]})[_0x832f('0x4')](function(_0x3052bd){_0x27dcf0[_0x832f('0x5')]=_0x3052bd;return _0x5b9858['models'][_0x832f('0x6')][_0x832f('0x3')]({'where':{'IntervalId':_0x506ede[_0x832f('0x7')]},'raw':!![]});})['then'](function(_0x418e83){return _0x5b9858[_0x832f('0x2')]['VoiceExtension'][_0x832f('0x3')]({'where':{'exten':{'$in':_[_0x832f('0x8')](_[_0x832f('0x9')](_0x418e83,_0x832f('0xa')))}},'order':[{'raw':_0x832f('0xb')}],'raw':!![]});})['then'](function(_0x2f53e2){var _0x511773=_[_0x832f('0xc')](_0x2f53e2,{'priority':'1'});var _0x40b1cb=_['filter'](_0x2f53e2,{'isApp':0x1});var _0xde09d9=_[_0x832f('0xd')](_0x40b1cb,_0x832f('0xa'));var _0x5bd31d=[_0x832f('0xe'),_0x832f('0xf')];var _0x2890b9=[];var _0x21a44c=[];for(var _0x3956ea in _0xde09d9){if(_0xde09d9[_0x832f('0x10')](_0x3956ea)){_0x27dcf0[_0x832f('0x11')]=0x2;_0x27dcf0['extensions']=[];_0x27dcf0[_0x832f('0x12')]=_[_0x832f('0x13')](_0x511773,{'exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')]});_0x27dcf0['extensions'][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0]['type'],'app':_0x832f('0x15'),'appdata':util[_0x832f('0x16')]('CDR(type)=%s',_0xde09d9[_0x3956ea][0x0]['type']),'context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')],'priority':_0x27dcf0[_0x832f('0x11')]++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0]['VoiceExtensionId']});if(_0xde09d9[_0x3956ea][0x0]['type']==='outbound'){if(_0x27dcf0['extension']){_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0][_0x832f('0x19')],'app':_0x832f('0x15'),'appdata':_0x832f('0x1a')+(_0x27dcf0[_0x832f('0x12')]['cutdigits']?_0x832f('0x1b')+_0x27dcf0[_0x832f('0x12')]['cutdigits']+'}':_0x832f('0x1c')),'context':_0xde09d9[_0x3956ea][0x0]['context'],'exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')],'priority':_0x27dcf0['priority']++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0]['VoiceExtensionId']});}_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0][_0x832f('0x19')],'app':_0x832f('0x15'),'appdata':_0x832f('0x1d')+_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')],'context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')],'priority':_0x27dcf0[_0x832f('0x11')]++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0]['VoiceExtensionId']});var _0x401670=_0x27dcf0['priority']++;_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0][_0x832f('0x19')],'app':'ExecIf','appdata':_0x832f('0x1f')+(_0x401670+0x2)+_0x832f('0x20')+(_0x401670+0x1)+')','context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')],'priority':_0x401670,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]});if(_0x27dcf0[_0x832f('0x12')]){_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0][_0x832f('0x19')],'app':_0x832f('0x15'),'appdata':_0x27dcf0['extension'][_0x832f('0x21')]?_0x832f('0x22')+_0x27dcf0[_0x832f('0x12')][_0x832f('0x21')]+'}':_0x832f('0x23'),'context':_0xde09d9[_0x3956ea][0x0]['context'],'exten':_0xde09d9[_0x3956ea][0x0]['exten'],'priority':_0x27dcf0['priority']++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]});}_0x27dcf0[_0x832f('0x18')]['push']({'type':_0xde09d9[_0x3956ea][0x0]['type'],'app':_0x832f('0x15'),'appdata':_0x832f('0x24')+_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')],'context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'exten':_0xde09d9[_0x3956ea][0x0]['exten'],'priority':_0x27dcf0[_0x832f('0x11')]++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0]['VoiceExtensionId']});if(_0x27dcf0[_0x832f('0x12')]&&_0x27dcf0[_0x832f('0x12')][_0x832f('0x10')](_0x832f('0x25'))&&_0x27dcf0[_0x832f('0x12')][_0x832f('0x25')]!=='none'){_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0]['type'],'app':_0x832f('0x15'),'appdata':'_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')],'priority':_0x27dcf0[_0x832f('0x11')]++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]});_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0]['type'],'app':_0x832f('0x15'),'appdata':_0x832f('0x26')+_0x27dcf0[_0x832f('0x12')][_0x832f('0x25')]||_0x832f('0x27'),'context':_0xde09d9[_0x3956ea][0x0]['context'],'exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')],'priority':_0x27dcf0[_0x832f('0x11')]++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]});}}_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0]['type'],'app':_0x832f('0x15'),'appdata':_0x832f('0x28'),'context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'exten':_0xde09d9[_0x3956ea][0x0]['exten'],'priority':_0x27dcf0[_0x832f('0x11')]++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]});_0x27dcf0['extensions'][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0]['type'],'app':_0x832f('0x15'),'appdata':_0x832f('0x29'),'context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')],'priority':_0x27dcf0[_0x832f('0x11')]++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]});_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0][_0x832f('0x19')],'app':_0x832f('0x15'),'appdata':'MONITOR_OPTIONS=ab','context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'exten':_0xde09d9[_0x3956ea][0x0]['exten'],'priority':_0x27dcf0[_0x832f('0x11')]++,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0]['VoiceExtensionId']});for(var _0x3bb355=0x0,_0x2c0ad7=0x0;_0x3bb355<_0xde09d9[_0x3956ea][_0x832f('0x2a')];_0x3bb355+=0x1,_0x2c0ad7=0x0){var _0x5ce014=_0xde09d9[_0x3956ea][_0x3bb355];if(_0x5ce014[_0x832f('0x19')]){_0x5ce014[_0x832f('0x19')]=_0x5ce014[_0x832f('0x19')]['toLowerCase']();}var _0x203f62=[];var _0x351c55=[];delete _0x5ce014['id'];delete _0x5ce014[_0x832f('0x2b')];delete _0x5ce014[_0x832f('0x2c')];var _0x525a88=_0x5ce014[_0x832f('0x2d')]!=='*,*,*,*'?[_0x5ce014[_0x832f('0x2d')]]:_0x5ce014[_0x832f('0x7')]?_[_0x832f('0x9')](_[_0x832f('0xc')](_0x27dcf0[_0x832f('0x5')],{'IntervalId':_0x5ce014[_0x832f('0x7')]}),_0x832f('0x2d')):[];if(_0x5ce014[_0x832f('0x10')](_0x832f('0x2e'))){if(_0x5ce014['tag']&&_0x5ce014[_0x832f('0x2e')]!=='--'){_0x203f62['push']({'type':_0x5ce014['type'],'app':_0x832f('0x15'),'appdata':_0x832f('0x2f')+_0x5ce014['tag'],'context':_0x5ce014[_0x832f('0x17')],'exten':_0x5ce014[_0x832f('0xa')],'priority':_0x525a88[_0x832f('0x2a')]+_0x27dcf0[_0x832f('0x11')]+_0x2c0ad7++,'VoiceExtensionId':_0x5ce014['VoiceExtensionId']});}}if(_0x5ce014[_0x832f('0x19')]===_0x832f('0x30')&&_0x5ce014['hasOwnProperty'](_0x832f('0x31'))){if(_0x5ce014[_0x832f('0x31')]){_0x203f62[_0x832f('0x14')]({'type':_0x5ce014[_0x832f('0x19')],'app':_0x832f('0x32'),'appdata':_0x832f('0x33')+_0x5ce014[_0x832f('0x31')]+')','context':_0x5ce014[_0x832f('0x17')],'exten':_0x5ce014[_0x832f('0xa')],'priority':_0x525a88[_0x832f('0x2a')]+_0x27dcf0[_0x832f('0x11')]+_0x2c0ad7++,'VoiceExtensionId':_0x5ce014[_0x832f('0x1e')]});}else{_0x203f62[_0x832f('0x14')]({'type':_0x5ce014[_0x832f('0x19')],'app':'ExecIf','appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x5ce014[_0x832f('0x17')],'exten':_0x5ce014['exten'],'priority':_0x525a88['length']+_0x27dcf0[_0x832f('0x11')]+_0x2c0ad7++,'VoiceExtensionId':_0x5ce014[_0x832f('0x1e')]});}}if(_0x5ce014[_0x832f('0x10')](_0x832f('0x34'))){if(_0x5bd31d[_0x832f('0x35')](_0x5ce014[_0x832f('0x36')][_0x832f('0x37')]())>=0x0&&_0x5ce014[_0x832f('0x38')]!==_0x832f('0x39')){if(_0x5ce014[_0x832f('0x34')]){_0x203f62['push']({'type':_0x5ce014[_0x832f('0x19')],'app':_0x832f('0x32'),'appdata':'$[${XCALLY-MOTION-ANSWER}=0]?Answer','context':_0x5ce014[_0x832f('0x17')],'exten':_0x5ce014[_0x832f('0xa')],'priority':_0x525a88[_0x832f('0x2a')]+_0x27dcf0[_0x832f('0x11')]+_0x2c0ad7++,'VoiceExtensionId':_0x5ce014[_0x832f('0x1e')]});_0x203f62[_0x832f('0x14')]({'type':_0x5ce014['type'],'app':'Set','appdata':_0x832f('0x3a'),'context':_0x5ce014[_0x832f('0x17')],'exten':_0x5ce014['exten'],'priority':_0x525a88[_0x832f('0x2a')]+_0x27dcf0[_0x832f('0x11')]+_0x2c0ad7++,'VoiceExtensionId':_0x5ce014['VoiceExtensionId']});}else{_0x203f62['push']({'type':_0x5ce014[_0x832f('0x19')],'app':_0x832f('0x32'),'appdata':_0x832f('0x3b'),'context':_0x5ce014['context'],'exten':_0x5ce014[_0x832f('0xa')],'priority':_0x525a88['length']+_0x27dcf0[_0x832f('0x11')]+_0x2c0ad7++,'VoiceExtensionId':_0x5ce014[_0x832f('0x1e')]});_0x203f62[_0x832f('0x14')]({'type':_0x5ce014[_0x832f('0x19')],'app':_0x832f('0x15'),'appdata':_0x832f('0x3c'),'context':_0x5ce014[_0x832f('0x17')],'exten':_0x5ce014[_0x832f('0xa')],'priority':_0x525a88['length']+_0x27dcf0['priority']+_0x2c0ad7++,'VoiceExtensionId':_0x5ce014['VoiceExtensionId']});}}}for(var _0x3f32f1=0x0;_0x3f32f1<_0x525a88['length'];_0x3f32f1+=0x1){var _0x30a445=_0x27dcf0[_0x832f('0x11')]+_0x525a88['length'];var _0xc20fbf=_0x3f32f1===_0x525a88['length']-0x1?_0x27dcf0[_0x832f('0x11')]+_0x203f62[_0x832f('0x2a')]+_0x351c55['length']+0x2:_0x27dcf0['priority']+_0x3f32f1+0x1;_0x203f62[_0x832f('0x3d')](_0x3f32f1,0x0,{'type':_0x5ce014[_0x832f('0x19')],'app':_0x832f('0x3e'),'appdata':_0x525a88[_0x3f32f1]+'?'+_0x5ce014['context']+_0x832f('0x3f')+_0x30a445+':'+_0x5ce014[_0x832f('0x17')]+_0x832f('0x3f')+_0xc20fbf,'exten':_0x5ce014[_0x832f('0xa')],'context':_0x5ce014[_0x832f('0x17')],'priority':_0x27dcf0[_0x832f('0x11')]+_0x3f32f1,'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]});}_0x5ce014['priority']=_0x203f62[_0x832f('0x2a')]?_[_0x832f('0x40')](_0x203f62)[_0x832f('0x11')]+0x1:_0x27dcf0[_0x832f('0x11')];_0x27dcf0[_0x832f('0x11')]=(_0x351c55[_0x832f('0x2a')]?_[_0x832f('0x40')](_0x351c55)[_0x832f('0x11')]:_0x5ce014[_0x832f('0x11')])+0x1;_0x27dcf0[_0x832f('0x18')]=_[_0x832f('0x41')](_0x27dcf0[_0x832f('0x18')],_0x203f62,[_0x5ce014],_0x351c55);}_0x27dcf0[_0x832f('0x18')][_0x832f('0x14')]({'type':_0xde09d9[_0x3956ea][0x0][_0x832f('0x19')],'app':'Hangup','exten':_0xde09d9[_0x3956ea][0x0][_0x832f('0xa')],'context':_0xde09d9[_0x3956ea][0x0][_0x832f('0x17')],'priority':_0x27dcf0['priority'],'VoiceExtensionId':_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]});_0x2890b9[_0x832f('0x14')](_0xde09d9[_0x3956ea][0x0][_0x832f('0x1e')]);_0x21a44c=_[_0x832f('0x41')](_0x21a44c,_0x27dcf0[_0x832f('0x18')]);}}return _0x5b9858[_0x832f('0x42')](function(_0x45fdac){return _0x5b9858[_0x832f('0x2')][_0x832f('0x6')][_0x832f('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x2890b9}},'transaction':_0x45fdac})[_0x832f('0x4')](function(_0x5e2766){return _0x5b9858[_0x832f('0x2')][_0x832f('0x6')][_0x832f('0x44')](_[_0x832f('0x45')](_0x21a44c,'priority'),{'transaction':_0x45fdac});});});})[_0x832f('0x46')](function(_0x1d6313){console[_0x832f('0x47')](_0x1d6313);});}exports[_0x832f('0x48')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 3d814d2..6553692 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 _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(_0x1f6db5,_0x43fa28){var _0x25e81a=function(_0x2fbaba){while(--_0x2fbaba){_0x1f6db5['push'](_0x1f6db5['shift']());}};_0x25e81a(++_0x43fa28);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'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 +var _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x5049f5,_0x85bc27){var _0x4b964c=function(_0x38d935){while(--_0x38d935){_0x5049f5['push'](_0x5049f5['shift']());}};_0x4b964c(++_0x85bc27);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5280f4,_0x3c36d0){_0x5280f4=_0x5280f4-0x0;var _0xba93e7=_0xcb91[_0x5280f4];return _0xba93e7;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);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(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){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))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index d53dab8..aa0b191 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 _0x833f=['errors','push','catch','stringify','start','binding','socket_timestamp','root','server/files/tmp','.csv','header','writeFileSync','parse','createReadStream','data','length','rows','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','includes','email','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','appendFileSync','emit','contact:import:','Abort\x20parser','SystemError','error','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','voice_queues_has_cm_blacklists','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','then','finish','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','map','No\x20agent\x20available','path','lodash','papaparse','bluebird','moment','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','join','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','priority','UserId','recallme','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22onlyIfOpen\x22','\x22always\x22','toString','cm_contacts.phone','cm_contacts.ListId','updatedAt','from','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','message','exit'];(function(_0x1602fb,_0x20b6b3){var _0x461831=function(_0x4a19f1){while(--_0x4a19f1){_0x1602fb['push'](_0x1602fb['shift']());}};_0x461831(++_0x20b6b3);}(_0x833f,0xcb));var _0xf833=function(_0x24e0c9,_0x284109){_0x24e0c9=_0x24e0c9-0x0;var _0x4448f0=_0x833f[_0x24e0c9];return _0x4448f0;};'use strict';var fs=require('fs');var path=require(_0xf833('0x0'));var _=require(_0xf833('0x1'));var Papa=require(_0xf833('0x2'));var util=require('util');var BPromise=require(_0xf833('0x3'));var moment=require(_0xf833('0x4'));var squel=require('squel');var Redis=require(_0xf833('0x5'));var db=require(_0xf833('0x6'))['db'];var config=require(_0xf833('0x7'));var logger=require(_0xf833('0x8'))('import');config[_0xf833('0x9')]=_[_0xf833('0xa')](config[_0xf833('0x9')],{'host':_0xf833('0xb'),'port':0x18eb});var socket=require(_0xf833('0xc'))(new Redis(config[_0xf833('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xf833('0xd')](_0xf833('0xe'));function isEmail(_0x47a143){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))*$/[_0xf833('0xf')](_0x47a143);}function selectNotIn(_0xe667,_0x5d0fca,_0x230d3d,_0x1ff269,_0x309955){return squel[_0xf833('0x10')]()[_0xf833('0x11')](_0xf833('0x12'))['from'](_0x1ff269)[_0xf833('0x13')](_0x5d0fca,null,_0x5d0fca+'.id\x20=\x20'+_0x1ff269+'.'+_0x230d3d)[_0xf833('0x14')](_0x1ff269+'.'+_0x230d3d+_0xf833('0x15')+_0xe667+'.'+_0x230d3d)['where'](_0x5d0fca+_0xf833('0x16')+_0x309955[_0xf833('0x13')]()+')');}function insertCmHopper(_0x54d196,_0x1b9826,_0x57b139,_0x527ee4,_0x42068d){var _0x3c9b67=['cm_contacts.phone',_0xf833('0x17'),_0xf833('0x18'),'cm_contacts.ListId',_0x1b9826+'.'+_0x527ee4,_0xf833('0x19'),_0xf833('0x1a'),_0xf833('0x1b'),_0xf833('0x1c'),'\x22'+_0x42068d+'\x22'];return squel[_0xf833('0x1d')]()[_0xf833('0x1e')](_0xf833('0x1f'))[_0xf833('0x20')]([_0xf833('0x12'),_0xf833('0x21'),_0xf833('0x22'),_0xf833('0x23'),_0x527ee4,_0xf833('0x24'),'updatedAt',_0xf833('0x25'),_0xf833('0x26'),_0xf833('0x27')],squel[_0xf833('0x10')]()[_0xf833('0x28')](_0x3c9b67)['from'](_0x1b9826)[_0xf833('0x13')](_0xf833('0x29'),null,_0xf833('0x2a')+_0x1b9826+_0xf833('0x2b'))[_0xf833('0x13')](_0x57b139,null,_0x57b139+_0xf833('0x2c')+_0x1b9826+'.'+_0x527ee4)[_0xf833('0x14')](_0x1b9826+_0xf833('0x2d'),_0x54d196)['where'](_0xf833('0x2e'),NOW)[_0xf833('0x14')](_0xf833('0x2f'),selectNotIn(_0x1b9826,_0x57b139,_0x527ee4,'cm_hopper',['\x22always\x22',_0xf833('0x30')]))[_0xf833('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x1b9826,_0x57b139,_0x527ee4,_0xf833('0x1f'),[_0xf833('0x31')])))[_0xf833('0x32')]();}function insertCmHopperBlack(_0x211b85,_0x1db34c,_0x45ff59,_0x263954){var _0x3960c9=[_0xf833('0x33'),_0xf833('0x18'),_0xf833('0x34'),_0x1db34c+'.'+_0x263954,'cm_contacts.createdAt',_0xf833('0x1a')];return squel[_0xf833('0x1d')]()[_0xf833('0x1e')]('cm_hopper_black')[_0xf833('0x20')](['phone','ContactId',_0xf833('0x23'),_0x263954,_0xf833('0x24'),_0xf833('0x35')],squel['select']()[_0xf833('0x28')](_0x3960c9)[_0xf833('0x36')](_0x1db34c)[_0xf833('0x13')](_0xf833('0x29'),null,_0xf833('0x2a')+_0x1db34c+_0xf833('0x2b'))[_0xf833('0x13')](_0x45ff59,null,_0x45ff59+'.id\x20=\x20'+_0x1db34c+'.'+_0x263954)[_0xf833('0x14')](_0x1db34c+_0xf833('0x2d'),_0x211b85)[_0xf833('0x14')](_0xf833('0x2e'),NOW)[_0xf833('0x14')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',squel[_0xf833('0x10')]()[_0xf833('0x11')]('phone')['from'](_0xf833('0x37'))['where'](_0xf833('0x38'),_0x211b85)[_0xf833('0x14')](_0x263954+_0xf833('0x39'),_0x1db34c+'.'+_0x263954)))['toString']();}function insertCmContact(_0x21afdc,_0x421d96,_0x518f06,_0x1470da){var _0x46d505=_[_0xf833('0x3a')](_[_0xf833('0x3b')](_0x1470da),[_0xf833('0x23'),_0xf833('0x3c'),_0xf833('0x24'),_0xf833('0x35')]);return squel[_0xf833('0x1d')]()[_0xf833('0x1e')](_0xf833('0x29'))[_0xf833('0x20')](_0x46d505,squel[_0xf833('0x10')]()[_0xf833('0x28')](_0x46d505)['from'](_0x421d96)['where']('('+_0x518f06[_0xf833('0x13')](',')+')\x20NOT\x20IN\x20?',squel[_0xf833('0x10')]()[_0xf833('0x28')](_0x518f06)['from'](_0xf833('0x29'))[_0xf833('0x14')](_0xf833('0x38'),_0x21afdc))[_0xf833('0x14')](_0xf833('0x3d'),squel['select']()['field'](_0xf833('0x3e'),_0xf833('0x3f'))[_0xf833('0x36')](_0x421d96)[_0xf833('0x40')](_0x518f06['join'](','))))[_0xf833('0x32')]();}function handleStop(){logger[_0xf833('0x41')](_0xf833('0x42'));stopped=!![];}function handleUncaughtException(_0x1d5c62){logger['error'](_0x1d5c62[_0xf833('0x43')]);process[_0xf833('0x44')](0x1);}function handleError(_0x289431,_0x9be52b){stats[_0xf833('0x45')][_0xf833('0x46')]({'name':_0x9be52b['code'],'message':_0x9be52b[_0xf833('0x43')],'row':_0x289431});}function handleQuery(_0x3346f2){logger[_0xf833('0x41')](_0x3346f2);return db['sequelize']['query'](_0x3346f2)['spread'](function(_0x282ba1){results[_0xf833('0x46')](_0x282ba1);})[_0xf833('0x47')](function(_0x334f1b){logger['error'](_0x334f1b[_0xf833('0x43')]);});}function main(_0x3b5557,_0x220f4b,_0x46fe8a,_0x3a9c39){logger[_0xf833('0x41')]('main',_0x3b5557,JSON[_0xf833('0x48')](_0x220f4b));process['send'](_0xf833('0x49'));var _0x4102ad=_0x220f4b[_0xf833('0x4a')];var _0x305abe=_0x220f4b[_0xf833('0x4b')];var _0x44ed63=path['join'](config[_0xf833('0x4c')],_0xf833('0x4d'),_0x305abe+_0xf833('0x4e'));var _0x549a5a=_['keys'](_0x4102ad)['join']();logger[_0xf833('0x41')](_0xf833('0x4f'),_0x549a5a);fs[_0xf833('0x50')](_0x44ed63,_0x549a5a+'\x0a');Papa[_0xf833('0x51')](fs[_0xf833('0x52')](_0x3b5557),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1afd75,_0x1a5950){try{for(var _0x121c3e=0x0,_0x2ab99a=[];_0x121c3e<_0x1afd75[_0xf833('0x53')][_0xf833('0x54')];_0x121c3e++){stats[_0xf833('0x55')]+=0x1;if(_0x1afd75[_0xf833('0x45')][_0x121c3e]){handleError(_0x1afd75['data'][_0x121c3e],_0x1afd75[_0xf833('0x45')][_0x121c3e]);}else{var _0x5ba5ca=[];for(var _0xf21b9d in _0x4102ad){if(_0x4102ad['hasOwnProperty'](_0xf21b9d)){if(_0x1afd75[_0xf833('0x53')][_0x121c3e][_0x4102ad[_0xf21b9d]]){var _0x1deb2c=_[_0xf833('0x56')](_0x1afd75['data'][_0x121c3e][_0x4102ad[_0xf21b9d]][_0xf833('0x57')](/"/g,'\x27'));switch(_0xf21b9d){case _0xf833('0x21'):var _0x2b65e3=moment(_0x1deb2c,_0xf833('0xe'),!![]);if(_0x2b65e3[_0xf833('0x58')]()){_0x2ab99a[_0xf833('0x46')]('\x22'+_0x1deb2c+'\x22');}else{_0x5ba5ca[_0xf833('0x46')](_0xf833('0x59'));}break;case _0xf833('0x25'):var _0x5b1634=parseInt(_0x1deb2c);_0x1deb2c=_['isNaN'](_0x5b1634)||_0x5b1634<0x0||_0x5b1634>0x4?_0x3a9c39?0x3:0x2:_0x5b1634;_0x2ab99a[_0xf833('0x46')]('\x22'+_0x1deb2c+'\x22');break;case _0xf833('0x26'):var _0x44c1e4=parseInt(_0x1deb2c);if(_[_0xf833('0x5a')](_0x44c1e4)&&_[_0xf833('0x5b')](_0x46fe8a,_0x44c1e4)){_0x2ab99a[_0xf833('0x46')]('\x22'+_0x44c1e4+'\x22');}else{_0x5ba5ca['push']('agent\x20not\x20exists');}break;case _0xf833('0x5c'):if(isEmail(_0x1deb2c)){_0x2ab99a['push']('\x22'+_0x1deb2c+'\x22');}else{_0x5ba5ca['push'](_0xf833('0x5d'));}break;case _0xf833('0x5e'):var _0x1d0e2d=moment(_0x1deb2c,_0xf833('0x5f'),!![]);if(_0x1d0e2d[_0xf833('0x58')]()){_0x2ab99a[_0xf833('0x46')]('\x22'+_0x1deb2c+'\x22');}else{_0x5ba5ca[_0xf833('0x46')](_0xf833('0x60'));}break;default:_0x2ab99a[_0xf833('0x46')]('\x22'+_0x1deb2c+'\x22');}}else{switch(_0xf21b9d){case _0xf833('0x61'):case _0xf833('0x12'):_0x5ba5ca[_0xf833('0x46')](_0xf21b9d+_0xf833('0x62'));break;default:_0x2ab99a[_0xf833('0x46')]('\x22\x22');}}}}if(_0x5ba5ca[_0xf833('0x54')]){handleError(_0x1afd75[_0xf833('0x53')][_0x121c3e],{'code':'SystemRow','message':_0x5ba5ca[_0xf833('0x13')]()});}else{fs[_0xf833('0x63')](_0x44ed63,_0x2ab99a[_0xf833('0x13')]()+'\x0a');}_0x2ab99a=[];}if(!(stats[_0xf833('0x55')]%0xc8)){socket[_0xf833('0x64')](_0xf833('0x65')+_0x305abe,stats);stats['errors']=[];}}if(stopped){logger[_0xf833('0x41')](_0xf833('0x66'));_0x1a5950['abort']();}}catch(_0x5beecf){handleError(_0x1afd75[_0xf833('0x53')][_0x121c3e],{'code':_0xf833('0x67'),'message':_0x5beecf[_0xf833('0x43')]});logger[_0xf833('0x68')](_0xf833('0x69'),_0x5beecf[_0xf833('0x43')]);}},'complete':function(){try{var _0x1b5bad=[];var _0x38aa8a=_0xf833('0x29');if(_0x220f4b[_0xf833('0x6a')]&&_0x220f4b[_0xf833('0x6a')][_0xf833('0x54')]){_0x38aa8a=_0xf833('0x6b')+_0x305abe;_0x1b5bad['push'](_0xf833('0x6c')+_0x38aa8a+_0xf833('0x6d'));}var _0x357153=util[_0xf833('0xd')]('LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27',_0x44ed63,_0x38aa8a,_0x549a5a,_0x220f4b['ListId'],_0x220f4b[_0xf833('0x3c')]||null,NOW,NOW);if(_[_0xf833('0x6e')](_0x4102ad[_0xf833('0x21')])){_0x357153+=_0xf833('0x6f');}_0x1b5bad[_0xf833('0x46')](_0x357153);if(_0x220f4b['duplicates']&&_0x220f4b[_0xf833('0x6a')][_0xf833('0x54')]){_0x1b5bad[_0xf833('0x46')](insertCmContact(_0x220f4b[_0xf833('0x23')],_0x38aa8a,_0x220f4b[_0xf833('0x6a')],_0x4102ad));_0x1b5bad[_0xf833('0x46')](_0xf833('0x70')+_0x38aa8a+';');}_0x1b5bad[_0xf833('0x46')](insertCmHopper(_0x220f4b[_0xf833('0x23')],_0xf833('0x71'),_0xf833('0x72'),'VoiceQueueId',_0x3a9c39));_0x1b5bad[_0xf833('0x46')](insertCmHopperBlack(_0x220f4b[_0xf833('0x23')],_0xf833('0x73'),_0xf833('0x72'),_0xf833('0x74')));_0x1b5bad[_0xf833('0x46')](insertCmHopper(_0x220f4b[_0xf833('0x23')],_0xf833('0x75'),_0xf833('0x76'),_0xf833('0x77'),_0x3a9c39));_0x1b5bad[_0xf833('0x46')](insertCmHopperBlack(_0x220f4b['ListId'],_0xf833('0x78'),_0xf833('0x76'),'CampaignId'));BPromise[_0xf833('0x79')](_0x1b5bad,handleQuery)[_0xf833('0x7a')](function(_0x251ea2){stats[_0xf833('0x7b')]=!![];stats['affectedRows']=_0x220f4b[_0xf833('0x6a')]&&_0x220f4b['duplicates'][_0xf833('0x54')]?results[0x2][_0xf833('0x7c')]:results[0x0][_0xf833('0x7c')];socket['emit'](_0xf833('0x65')+_0x305abe,stats);fs['unlink'](_0x3b5557);fs[_0xf833('0x7d')](_0x44ed63);process[_0xf833('0x44')](0x0);})['catch'](function(_0x30dc12){logger[_0xf833('0x68')](_0x30dc12[_0xf833('0x43')]);process[_0xf833('0x44')](0x1);});}catch(_0x58119d){logger[_0xf833('0x68')](_0xf833('0x7e'),_0x58119d[_0xf833('0x43')]);process[_0xf833('0x44')](0x1);}},'error':function(_0x3fe764,_0xd82ce4,_0x2d74b,_0x18245f){throw new Error(_0x18245f);}});}function validate(){if(process['argv']&&process[_0xf833('0x7f')][_0xf833('0x54')]<0x4){throw new Error(_0xf833('0x80'));}var _0x3b387e=path['join'](config[_0xf833('0x4c')],_0xf833('0x4d'),process['argv'][0x2]);if(!fs[_0xf833('0x81')](_0x3b387e)){throw new Error(_0xf833('0x82'));}var _0x5ee892={};try{_0x5ee892=JSON['parse'](process['argv'][0x3]);if(!_0x5ee892[_0xf833('0x4a')]){throw new Error(_0xf833('0x83'));}if(!_0x5ee892[_0xf833('0x4a')][_0xf833('0x12')]){throw new Error(_0xf833('0x84'));}if(!_0x5ee892[_0xf833('0x4a')][_0xf833('0x61')]){throw new Error(_0xf833('0x85'));}var _0x33c739=0x0;if(_0x5ee892['binding']['UserId']){_0x33c739=0x1;}if(!_0x5ee892[_0xf833('0x23')]){throw new Error('ListId\x20is\x20mandatory');}}catch(_0xab97d6){throw new Error('body\x20id\x20mandatory');}var _0x2fbdf2=[];try{_0x2fbdf2=_[_0xf833('0x86')](JSON[_0xf833('0x51')](process[_0xf833('0x7f')][0x4]),'id');}catch(_0x18c083){logger['info'](_0xf833('0x87'));}main(_0x3b387e,_0x5ee892,_0x2fbdf2,_0x33c739);}validate();process['on']('SIGINT',handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file +var _0xa8fd=['voice_queues_has_cm_blacklists','campaigns','campaigns_has_cm_blacklists','CampaignId','then','finish','affectedRows','contact:import:','argv','arguments\x20\x20\x20','existsSync','binding','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','No\x20agent\x20available','SIGINT','uncaughtException','path','lodash','bluebird','ioredis','../../../config/environment','import','redis','defaults','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','field','phone','from','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.phone','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.UserId','insert','fromQuery','ListId','createdAt','updatedAt','priority','UserId','recallme','select','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_hopper','\x22always\x22','\x22onlyIfOpen\x22','toString','into','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId',')\x20NOT\x20IN\x20?','id\x20IN\x20?','MIN(id)','group','info','message','exit','errors','push','query','spread','catch','error','main','stringify','send','socket_timestamp','root','server/files/tmp','.csv','header','parse','length','rows','data','hasOwnProperty','trim','replace','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','SystemRow','appendFileSync','emit','Abort\x20parser','abort','SystemError','step','duplicates','cm_contacts_','CREATE\x20TABLE\x20','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','scheduledat',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId'];(function(_0x792af1,_0x195f04){var _0x2691fe=function(_0x37853a){while(--_0x37853a){_0x792af1['push'](_0x792af1['shift']());}};_0x2691fe(++_0x195f04);}(_0xa8fd,0x115));var _0xda8f=function(_0x15e207,_0x157e50){_0x15e207=_0x15e207-0x0;var _0x5acb39=_0xa8fd[_0x15e207];return _0x5acb39;};'use strict';var fs=require('fs');var path=require(_0xda8f('0x0'));var _=require(_0xda8f('0x1'));var Papa=require('papaparse');var util=require('util');var BPromise=require(_0xda8f('0x2'));var moment=require('moment');var squel=require('squel');var Redis=require(_0xda8f('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0xda8f('0x4'));var logger=require('../../../config/logger')(_0xda8f('0x5'));config[_0xda8f('0x6')]=_[_0xda8f('0x7')](config[_0xda8f('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xda8f('0x8'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0xda8f('0x9')](_0xda8f('0xa'));function isEmail(_0x440f59){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))*$/[_0xda8f('0xb')](_0x440f59);}function selectNotIn(_0x54b344,_0x28e3e0,_0x35eef7,_0x1f8036,_0x18a000){return squel['select']()[_0xda8f('0xc')](_0xda8f('0xd'))[_0xda8f('0xe')](_0x1f8036)['join'](_0x28e3e0,null,_0x28e3e0+_0xda8f('0xf')+_0x1f8036+'.'+_0x35eef7)[_0xda8f('0x10')](_0x1f8036+'.'+_0x35eef7+_0xda8f('0x11')+_0x54b344+'.'+_0x35eef7)['where'](_0x28e3e0+_0xda8f('0x12')+_0x18a000[_0xda8f('0x13')]()+')');}function insertCmHopper(_0x4f1475,_0x10e366,_0x594c94,_0x4d4bda,_0x50618a){var _0x86f15b=[_0xda8f('0x14'),'cm_contacts.scheduledat','cm_contacts.id',_0xda8f('0x15'),_0x10e366+'.'+_0x4d4bda,_0xda8f('0x16'),_0xda8f('0x17'),'cm_contacts.priority',_0xda8f('0x18'),'\x22'+_0x50618a+'\x22'];return squel[_0xda8f('0x19')]()['into']('cm_hopper')[_0xda8f('0x1a')]([_0xda8f('0xd'),'scheduledat','ContactId',_0xda8f('0x1b'),_0x4d4bda,_0xda8f('0x1c'),_0xda8f('0x1d'),_0xda8f('0x1e'),_0xda8f('0x1f'),_0xda8f('0x20')],squel[_0xda8f('0x21')]()[_0xda8f('0x22')](_0x86f15b)[_0xda8f('0xe')](_0x10e366)[_0xda8f('0x13')](_0xda8f('0x23'),null,_0xda8f('0x24')+_0x10e366+_0xda8f('0x25'))[_0xda8f('0x13')](_0x594c94,null,_0x594c94+_0xda8f('0xf')+_0x10e366+'.'+_0x4d4bda)['where'](_0x10e366+_0xda8f('0x26'),_0x4f1475)[_0xda8f('0x10')](_0xda8f('0x27'),NOW)[_0xda8f('0x10')](_0xda8f('0x28'),selectNotIn(_0x10e366,_0x594c94,_0x4d4bda,_0xda8f('0x29'),[_0xda8f('0x2a'),_0xda8f('0x2b')]))[_0xda8f('0x10')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x10e366,_0x594c94,_0x4d4bda,_0xda8f('0x29'),[_0xda8f('0x2a')])))[_0xda8f('0x2c')]();}function insertCmHopperBlack(_0x3b0084,_0x2c9d8a,_0x4b34b7,_0x44f8eb){var _0x4adc8e=[_0xda8f('0x14'),'cm_contacts.id','cm_contacts.ListId',_0x2c9d8a+'.'+_0x44f8eb,'cm_contacts.createdAt','cm_contacts.updatedAt'];return squel['insert']()[_0xda8f('0x2d')](_0xda8f('0x2e'))['fromQuery']([_0xda8f('0xd'),'ContactId',_0xda8f('0x1b'),_0x44f8eb,'createdAt',_0xda8f('0x1d')],squel[_0xda8f('0x21')]()[_0xda8f('0x22')](_0x4adc8e)['from'](_0x2c9d8a)[_0xda8f('0x13')]('cm_contacts',null,_0xda8f('0x24')+_0x2c9d8a+_0xda8f('0x25'))[_0xda8f('0x13')](_0x4b34b7,null,_0x4b34b7+_0xda8f('0xf')+_0x2c9d8a+'.'+_0x44f8eb)['where'](_0x2c9d8a+_0xda8f('0x26'),_0x3b0084)[_0xda8f('0x10')](_0xda8f('0x27'),NOW)[_0xda8f('0x10')](_0xda8f('0x28'),squel[_0xda8f('0x21')]()[_0xda8f('0xc')](_0xda8f('0xd'))[_0xda8f('0xe')](_0xda8f('0x2e'))[_0xda8f('0x10')](_0xda8f('0x2f'),_0x3b0084)[_0xda8f('0x10')](_0x44f8eb+_0xda8f('0x30'),_0x2c9d8a+'.'+_0x44f8eb)))[_0xda8f('0x2c')]();}function insertCmContact(_0x426c60,_0x5044b4,_0x5410a1,_0x515c2d){var _0x344f5c=_[_0xda8f('0x31')](_[_0xda8f('0x32')](_0x515c2d),[_0xda8f('0x1b'),_0xda8f('0x33'),_0xda8f('0x1c'),'updatedAt']);return squel[_0xda8f('0x19')]()[_0xda8f('0x2d')](_0xda8f('0x23'))[_0xda8f('0x1a')](_0x344f5c,squel[_0xda8f('0x21')]()['fields'](_0x344f5c)[_0xda8f('0xe')](_0x5044b4)['where']('('+_0x5410a1[_0xda8f('0x13')](',')+_0xda8f('0x34'),squel[_0xda8f('0x21')]()[_0xda8f('0x22')](_0x5410a1)[_0xda8f('0xe')]('cm_contacts')[_0xda8f('0x10')]('ListId\x20=\x20?',_0x426c60))[_0xda8f('0x10')](_0xda8f('0x35'),squel['select']()[_0xda8f('0xc')](_0xda8f('0x36'),'min_id')[_0xda8f('0xe')](_0x5044b4)[_0xda8f('0x37')](_0x5410a1[_0xda8f('0x13')](','))))[_0xda8f('0x2c')]();}function handleStop(){logger[_0xda8f('0x38')]('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x300ef0){logger['error'](_0x300ef0[_0xda8f('0x39')]);process[_0xda8f('0x3a')](0x1);}function handleError(_0x3dbe5b,_0x2e79cb){stats[_0xda8f('0x3b')][_0xda8f('0x3c')]({'name':_0x2e79cb['code'],'message':_0x2e79cb[_0xda8f('0x39')],'row':_0x3dbe5b});}function handleQuery(_0x5e74ca){logger[_0xda8f('0x38')](_0x5e74ca);return db['sequelize'][_0xda8f('0x3d')](_0x5e74ca)[_0xda8f('0x3e')](function(_0x3c32ac){results[_0xda8f('0x3c')](_0x3c32ac);})[_0xda8f('0x3f')](function(_0x3647be){logger[_0xda8f('0x40')](_0x3647be[_0xda8f('0x39')]);});}function main(_0x51da40,_0x1136dd,_0x5987a8,_0x3907a8){logger[_0xda8f('0x38')](_0xda8f('0x41'),_0x51da40,JSON[_0xda8f('0x42')](_0x1136dd));process[_0xda8f('0x43')]('start');var _0x206c42=_0x1136dd['binding'];var _0x3ba5b4=_0x1136dd[_0xda8f('0x44')];var _0x831569=path[_0xda8f('0x13')](config[_0xda8f('0x45')],_0xda8f('0x46'),_0x3ba5b4+_0xda8f('0x47'));var _0xb0bba7=_[_0xda8f('0x32')](_0x206c42)['join']();logger['info'](_0xda8f('0x48'),_0xb0bba7);fs['writeFileSync'](_0x831569,_0xb0bba7+'\x0a');Papa[_0xda8f('0x49')](fs['createReadStream'](_0x51da40),{'header':!![],'skipEmptyLines':!![],'step':function(_0x444a65,_0x126263){try{for(var _0x246173=0x0,_0x4dae89=[];_0x246173<_0x444a65['data'][_0xda8f('0x4a')];_0x246173++){stats[_0xda8f('0x4b')]+=0x1;if(_0x444a65[_0xda8f('0x3b')][_0x246173]){handleError(_0x444a65[_0xda8f('0x4c')][_0x246173],_0x444a65[_0xda8f('0x3b')][_0x246173]);}else{var _0x3ea708=[];for(var _0x26c2c5 in _0x206c42){if(_0x206c42[_0xda8f('0x4d')](_0x26c2c5)){if(_0x444a65[_0xda8f('0x4c')][_0x246173][_0x206c42[_0x26c2c5]]){var _0x3617e5=_[_0xda8f('0x4e')](_0x444a65[_0xda8f('0x4c')][_0x246173][_0x206c42[_0x26c2c5]][_0xda8f('0x4f')](/"/g,'\x27'));switch(_0x26c2c5){case'scheduledat':var _0x478e24=moment(_0x3617e5,_0xda8f('0xa'),!![]);if(_0x478e24[_0xda8f('0x50')]()){_0x4dae89['push']('\x22'+_0x3617e5+'\x22');}else{_0x3ea708[_0xda8f('0x3c')](_0xda8f('0x51'));}break;case _0xda8f('0x1e'):var _0x186a80=parseInt(_0x3617e5);_0x3617e5=_['isNaN'](_0x186a80)||_0x186a80<0x0||_0x186a80>0x4?_0x3907a8?0x3:0x2:_0x186a80;_0x4dae89[_0xda8f('0x3c')]('\x22'+_0x3617e5+'\x22');break;case _0xda8f('0x1f'):var _0x35450f=parseInt(_0x3617e5);if(_[_0xda8f('0x52')](_0x35450f)&&_['includes'](_0x5987a8,_0x35450f)){_0x4dae89[_0xda8f('0x3c')]('\x22'+_0x35450f+'\x22');}else{_0x3ea708[_0xda8f('0x3c')](_0xda8f('0x53'));}break;case'email':if(isEmail(_0x3617e5)){_0x4dae89[_0xda8f('0x3c')]('\x22'+_0x3617e5+'\x22');}else{_0x3ea708[_0xda8f('0x3c')](_0xda8f('0x54'));}break;case _0xda8f('0x55'):var _0x53930d=moment(_0x3617e5,_0xda8f('0x56'),!![]);if(_0x53930d[_0xda8f('0x50')]()){_0x4dae89[_0xda8f('0x3c')]('\x22'+_0x3617e5+'\x22');}else{_0x3ea708['push'](_0xda8f('0x57'));}break;default:_0x4dae89[_0xda8f('0x3c')]('\x22'+_0x3617e5+'\x22');}}else{switch(_0x26c2c5){case _0xda8f('0x58'):case _0xda8f('0xd'):_0x3ea708[_0xda8f('0x3c')](_0x26c2c5+'\x20not\x20specified');break;default:_0x4dae89[_0xda8f('0x3c')]('\x22\x22');}}}}if(_0x3ea708[_0xda8f('0x4a')]){handleError(_0x444a65['data'][_0x246173],{'code':_0xda8f('0x59'),'message':_0x3ea708['join']()});}else{fs[_0xda8f('0x5a')](_0x831569,_0x4dae89[_0xda8f('0x13')]()+'\x0a');}_0x4dae89=[];}if(!(stats[_0xda8f('0x4b')]%0xc8)){socket[_0xda8f('0x5b')]('contact:import:'+_0x3ba5b4,stats);stats[_0xda8f('0x3b')]=[];}}if(stopped){logger[_0xda8f('0x38')](_0xda8f('0x5c'));_0x126263[_0xda8f('0x5d')]();}}catch(_0x7f1d87){handleError(_0x444a65['data'][_0x246173],{'code':_0xda8f('0x5e'),'message':_0x7f1d87[_0xda8f('0x39')]});logger[_0xda8f('0x40')](_0xda8f('0x5f'),_0x7f1d87[_0xda8f('0x39')]);}},'complete':function(){try{var _0x112cfa=[];var _0x4c9764=_0xda8f('0x23');if(_0x1136dd[_0xda8f('0x60')]&&_0x1136dd[_0xda8f('0x60')][_0xda8f('0x4a')]){_0x4c9764=_0xda8f('0x61')+_0x3ba5b4;_0x112cfa['push'](_0xda8f('0x62')+_0x4c9764+'\x20LIKE\x20cm_contacts;');}var _0x67406d=util[_0xda8f('0x9')](_0xda8f('0x63'),_0x831569,_0x4c9764,_0xb0bba7,_0x1136dd[_0xda8f('0x1b')],_0x1136dd['CompanyId']||null,NOW,NOW);if(_[_0xda8f('0x64')](_0x206c42[_0xda8f('0x65')])){_0x67406d+=_0xda8f('0x66');}_0x112cfa['push'](_0x67406d);if(_0x1136dd[_0xda8f('0x60')]&&_0x1136dd['duplicates'][_0xda8f('0x4a')]){_0x112cfa[_0xda8f('0x3c')](insertCmContact(_0x1136dd[_0xda8f('0x1b')],_0x4c9764,_0x1136dd[_0xda8f('0x60')],_0x206c42));_0x112cfa[_0xda8f('0x3c')](_0xda8f('0x67')+_0x4c9764+';');}_0x112cfa[_0xda8f('0x3c')](insertCmHopper(_0x1136dd[_0xda8f('0x1b')],_0xda8f('0x68'),_0xda8f('0x69'),_0xda8f('0x6a'),_0x3907a8));_0x112cfa[_0xda8f('0x3c')](insertCmHopperBlack(_0x1136dd[_0xda8f('0x1b')],_0xda8f('0x6b'),_0xda8f('0x69'),_0xda8f('0x6a')));_0x112cfa[_0xda8f('0x3c')](insertCmHopper(_0x1136dd[_0xda8f('0x1b')],'campaigns_has_cm_lists',_0xda8f('0x6c'),'CampaignId',_0x3907a8));_0x112cfa[_0xda8f('0x3c')](insertCmHopperBlack(_0x1136dd[_0xda8f('0x1b')],_0xda8f('0x6d'),'campaigns',_0xda8f('0x6e')));BPromise['each'](_0x112cfa,handleQuery)[_0xda8f('0x6f')](function(_0x2d83bc){stats[_0xda8f('0x70')]=!![];stats[_0xda8f('0x71')]=_0x1136dd[_0xda8f('0x60')]&&_0x1136dd['duplicates'][_0xda8f('0x4a')]?results[0x2][_0xda8f('0x71')]:results[0x0]['affectedRows'];socket['emit'](_0xda8f('0x72')+_0x3ba5b4,stats);fs['unlink'](_0x51da40);fs['unlink'](_0x831569);process[_0xda8f('0x3a')](0x0);})[_0xda8f('0x3f')](function(_0x3f5a10){logger[_0xda8f('0x40')](_0x3f5a10['message']);process[_0xda8f('0x3a')](0x1);});}catch(_0x55fb9a){logger['error']('complete',_0x55fb9a[_0xda8f('0x39')]);process['exit'](0x1);}},'error':function(_0x1897d6,_0x429f36,_0x21d07a,_0x49442a){throw new Error(_0x49442a);}});}function validate(){if(process[_0xda8f('0x73')]&&process[_0xda8f('0x73')][_0xda8f('0x4a')]<0x4){throw new Error(_0xda8f('0x74'));}var _0x24a5da=path[_0xda8f('0x13')](config[_0xda8f('0x45')],_0xda8f('0x46'),process[_0xda8f('0x73')][0x2]);if(!fs[_0xda8f('0x75')](_0x24a5da)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x5d95d2={};try{_0x5d95d2=JSON[_0xda8f('0x49')](process[_0xda8f('0x73')][0x3]);if(!_0x5d95d2[_0xda8f('0x76')]){throw new Error(_0xda8f('0x77'));}if(!_0x5d95d2['binding'][_0xda8f('0xd')]){throw new Error(_0xda8f('0x78'));}if(!_0x5d95d2['binding'][_0xda8f('0x58')]){throw new Error(_0xda8f('0x79'));}var _0x232005=0x0;if(_0x5d95d2[_0xda8f('0x76')][_0xda8f('0x1f')]){_0x232005=0x1;}if(!_0x5d95d2[_0xda8f('0x1b')]){throw new Error(_0xda8f('0x7a'));}}catch(_0x502b36){throw new Error(_0xda8f('0x7b'));}var _0x53c8bc=[];try{_0x53c8bc=_[_0xda8f('0x7c')](JSON[_0xda8f('0x49')](process[_0xda8f('0x73')][0x4]),'id');}catch(_0x413925){logger[_0xda8f('0x38')](_0xda8f('0x7d'));}main(_0x24a5da,_0x5d95d2,_0x53c8bc,_0x232005);}validate();process['on'](_0xda8f('0x7e'),handleStop);process['on'](_0xda8f('0x7f'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 6fd1dd7..260a89f 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 _0xde9f=['toLowerCase','voice','inbound','push','variable','queue','calleridnum','outbound','Outbound\x20Call','destcalleridnum','getDescriptions','Caller\x20Number','keyValue','calleridname','Call\x20To','destexten','Queue','UniqueId','uniqueid','***\x20Agent\x20Info\x20***','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','agentcalledAt','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','holdtime','Talk\x20Time','talktime','***\x20Call\x20Info\x20***','Called\x20Number','Member\x20Name','Date','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0xde9f,0x118));var _0xfde9=function(_0x1fdb40,_0x51351c){_0x1fdb40=_0x1fdb40-0x0;var _0x281f93=_0xde9f[_0x1fdb40];return _0x281f93;};'use strict';exports[_0xfde9('0x0')]=function(_0x4a32fc,_0x4c970b){var _0x1cf599=[{'type':_0xfde9('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x4a32fc[_0xfde9('0x2')]()){case _0xfde9('0x3'):switch(_0x4c970b['toLowerCase']()){case _0xfde9('0x4'):_0x1cf599[_0xfde9('0x5')]({'type':_0xfde9('0x6'),'content':'','variableName':_0xfde9('0x7')});_0x1cf599['push']({'type':'variable','content':'','variableName':_0xfde9('0x8')});break;case _0xfde9('0x9'):_0x1cf599['push']({'type':_0xfde9('0x1'),'content':_0xfde9('0xa'),'variableName':null});_0x1cf599[_0xfde9('0x5')]({'type':_0xfde9('0x6'),'content':'','variableName':_0xfde9('0xb')});break;}}return _0x1cf599;};exports[_0xfde9('0xc')]=function(_0x3f29cd,_0xc5cc99){var _0x3fa916=[];switch(_0x3f29cd[_0xfde9('0x2')]()){case _0xfde9('0x3'):switch(_0xc5cc99[_0xfde9('0x2')]()){case _0xfde9('0x4'):_0x3fa916=[{'type':_0xfde9('0x1'),'content':'***\x20Call\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xfde9('0xd'),'keyType':_0xfde9('0x6'),'variableName':_0xfde9('0x8')},{'type':_0xfde9('0xe'),'content':'','key':'Caller\x20Name','keyType':'variable','variableName':_0xfde9('0xf')},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x10'),'keyType':_0xfde9('0x6'),'variableName':_0xfde9('0x11')},{'type':'keyValue','content':'','key':_0xfde9('0x12'),'keyType':_0xfde9('0x6'),'variableName':_0xfde9('0x7')},{'type':'keyValue','content':'','key':_0xfde9('0x13'),'keyType':_0xfde9('0x6'),'variableName':_0xfde9('0x14')},{'type':'keyValue','content':'','key':'Date','keyType':'variable','variableName':'agentcalledAt'},{'type':_0xfde9('0x1'),'content':_0xfde9('0x15'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Agent\x20Name','keyType':_0xfde9('0x6'),'variableName':_0xfde9('0x16')},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x17'),'keyType':_0xfde9('0x6'),'variableName':_0xfde9('0xb')},{'type':_0xfde9('0x1'),'content':_0xfde9('0x18'),'key':null,'keyType':null,'variableName':null},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x19'),'keyType':_0xfde9('0x6'),'variableName':_0xfde9('0x1a')},{'type':'keyValue','content':'','key':_0xfde9('0x1b'),'keyType':'variable','variableName':_0xfde9('0x1c')},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x1d'),'keyType':'variable','variableName':_0xfde9('0x1e')},{'type':_0xfde9('0xe'),'content':'','key':'Hold\x20Time','keyType':_0xfde9('0x6'),'variableName':_0xfde9('0x1f')},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x20'),'keyType':_0xfde9('0x6'),'variableName':_0xfde9('0x21')}];break;case _0xfde9('0x9'):_0x3fa916=[{'type':_0xfde9('0x1'),'content':_0xfde9('0x22'),'variableName':null},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x23'),'keyType':_0xfde9('0x6'),'keyContent':'','variableName':_0xfde9('0xb')},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x24'),'keyType':_0xfde9('0x6'),'keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0xfde9('0x13'),'keyType':_0xfde9('0x6'),'keyContent':'','variableName':'uniqueid'},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x25'),'keyType':_0xfde9('0x6'),'keyContent':'','variableName':_0xfde9('0x26')},{'type':_0xfde9('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x27'),'keyType':'variable','keyContent':'','variableName':_0xfde9('0x28')},{'type':_0xfde9('0xe'),'content':'','key':_0xfde9('0x29'),'keyType':_0xfde9('0x6'),'keyContent':'','variableName':_0xfde9('0x2a')},{'type':'keyValue','content':'','key':_0xfde9('0x2b'),'keyType':'variable','keyContent':'','variableName':_0xfde9('0x2c')},{'type':'keyValue','content':'','key':_0xfde9('0x2d'),'keyType':'variable','keyContent':'','variableName':_0xfde9('0x2e')}];break;}}return _0x3fa916;}; \ No newline at end of file +var _0x056b=['Hold\x20Time','holdtime','talktime','Called\x20Number','membername','uniqueid','starttime','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','string','[xCALLY\x20Ticket]','toLowerCase','voice','inbound','push','variable','calleridnum','outbound','destcalleridnum','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Name','calleridname','keyValue','Call\x20To','destexten','Queue','queue','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt'];(function(_0x467488,_0x38c7ae){var _0x56107f=function(_0x4992b3){while(--_0x4992b3){_0x467488['push'](_0x467488['shift']());}};_0x56107f(++_0x38c7ae);}(_0x056b,0xb6));var _0xb056=function(_0x41ddf3,_0x4c5db7){_0x41ddf3=_0x41ddf3-0x0;var _0x2adac3=_0x056b[_0x41ddf3];return _0x2adac3;};'use strict';exports['getSubjects']=function(_0x2989ab,_0x556e84){var _0xed6810=[{'type':_0xb056('0x0'),'content':_0xb056('0x1'),'variableName':null}];switch(_0x2989ab[_0xb056('0x2')]()){case _0xb056('0x3'):switch(_0x556e84[_0xb056('0x2')]()){case _0xb056('0x4'):_0xed6810[_0xb056('0x5')]({'type':_0xb056('0x6'),'content':'','variableName':'queue'});_0xed6810[_0xb056('0x5')]({'type':_0xb056('0x6'),'content':'','variableName':_0xb056('0x7')});break;case _0xb056('0x8'):_0xed6810[_0xb056('0x5')]({'type':_0xb056('0x0'),'content':'Outbound\x20Call','variableName':null});_0xed6810['push']({'type':_0xb056('0x6'),'content':'','variableName':_0xb056('0x9')});break;}}return _0xed6810;};exports[_0xb056('0xa')]=function(_0x290c9e,_0x5ddddb){var _0x170e1a=[];switch(_0x290c9e['toLowerCase']()){case _0xb056('0x3'):switch(_0x5ddddb[_0xb056('0x2')]()){case _0xb056('0x4'):_0x170e1a=[{'type':_0xb056('0x0'),'content':_0xb056('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':'Caller\x20Number','keyType':_0xb056('0x6'),'variableName':_0xb056('0x7')},{'type':'keyValue','content':'','key':_0xb056('0xc'),'keyType':_0xb056('0x6'),'variableName':_0xb056('0xd')},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0xf'),'keyType':_0xb056('0x6'),'variableName':_0xb056('0x10')},{'type':'keyValue','content':'','key':_0xb056('0x11'),'keyType':_0xb056('0x6'),'variableName':_0xb056('0x12')},{'type':_0xb056('0xe'),'content':'','key':'UniqueId','keyType':_0xb056('0x6'),'variableName':'uniqueid'},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0x13'),'keyType':'variable','variableName':_0xb056('0x14')},{'type':'string','content':_0xb056('0x15'),'key':null,'keyType':null,'variableName':null},{'type':_0xb056('0xe'),'content':'','key':'Agent\x20Name','keyType':_0xb056('0x6'),'variableName':'destcalleridname'},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0x16'),'keyType':_0xb056('0x6'),'variableName':_0xb056('0x9')},{'type':'string','content':_0xb056('0x17'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb056('0x18'),'keyType':'variable','variableName':_0xb056('0x14')},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0x19'),'keyType':_0xb056('0x6'),'variableName':_0xb056('0x1a')},{'type':_0xb056('0xe'),'content':'','key':'Agent\x20Complete','keyType':_0xb056('0x6'),'variableName':_0xb056('0x1b')},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0x1c'),'keyType':'variable','variableName':_0xb056('0x1d')},{'type':_0xb056('0xe'),'content':'','key':'Talk\x20Time','keyType':_0xb056('0x6'),'variableName':_0xb056('0x1e')}];break;case _0xb056('0x8'):_0x170e1a=[{'type':_0xb056('0x0'),'content':_0xb056('0xb'),'variableName':null},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0x1f'),'keyType':_0xb056('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xb056('0xe'),'content':'','key':'Member\x20Name','keyType':_0xb056('0x6'),'keyContent':'','variableName':_0xb056('0x20')},{'type':_0xb056('0xe'),'content':'','key':'UniqueId','keyType':_0xb056('0x6'),'keyContent':'','variableName':_0xb056('0x21')},{'type':'keyValue','content':'','key':_0xb056('0x13'),'keyType':_0xb056('0x6'),'keyContent':'','variableName':_0xb056('0x22')},{'type':_0xb056('0x0'),'content':_0xb056('0x17')},{'type':'keyValue','content':'','key':_0xb056('0x23'),'keyType':_0xb056('0x6'),'keyContent':'','variableName':_0xb056('0x24')},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0x25'),'keyType':'variable','keyContent':'','variableName':_0xb056('0x26')},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0x27'),'keyType':_0xb056('0x6'),'keyContent':'','variableName':_0xb056('0x28')},{'type':_0xb056('0xe'),'content':'','key':_0xb056('0x29'),'keyType':_0xb056('0x6'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x170e1a;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 54a53b6..6bec2b0 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 _0x484f=['stringify','null','Interaction','then','info','catch','clone','body','html','phone','mobile','../../mysqldb','../../config/logger','fax-interactions','sms-interactions','upperFirst','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name'];(function(_0x36eaaa,_0x326732){var _0x461349=function(_0x4e4180){while(--_0x4e4180){_0x36eaaa['push'](_0x36eaaa['shift']());}};_0x461349(++_0x326732);}(_0x484f,0x115));var _0xf484=function(_0xcda377,_0x1e2678){_0xcda377=_0xcda377-0x0;var _0x1c024f=_0x484f[_0xcda377];return _0x1c024f;};'use strict';var _=require('lodash');var db=require(_0xf484('0x0'))['db'];var loggers={'openchannel':require(_0xf484('0x1'))('openchannel-interactions'),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')(_0xf484('0x2')),'sms':require('../../config/logger')(_0xf484('0x3')),'chat':require('../../config/logger')('chat-interactions')};function getInteractionId(_0x39f92e,_0xcdec8a,_0xbc9cd1){if(_0x39f92e&&_0x39f92e[_['upperFirst'](_0xbc9cd1)+'InteractionId']){return _0x39f92e[_[_0xf484('0x4')](_0xbc9cd1)+'InteractionId'];}else if(_0x39f92e&&_0x39f92e['id']){return _0x39f92e['id'];}else if(_0xcdec8a&&_0xcdec8a['id']){return _0xcdec8a['id'];}else{return'unknown';}}function log(_0x4e67d6,_0xf895ce,_0x43d33f,_0x461173,_0xa0c97d,_0x27a64a){loggers[_0xa0c97d['toLowerCase']()][_0x4e67d6](_0xf484('0x5'),_0x27a64a[_0xf484('0x6')](),_0xf895ce?_0xf895ce['id']:null,_0xf895ce?_0xf895ce[_0xf484('0x7')]:null,_0xf895ce?_0xf895ce['role']:null,getInteractionId(_0x43d33f,_0x461173,_0xa0c97d),_0x43d33f?JSON[_0xf484('0x8')](_0x43d33f):_0xf484('0x9'));}function updateUser(_0x562137,_0x333184,_0x612a41,_0x2d6966,_0x412c57){db[_['upperFirst'](_0x2d6966)+_0xf484('0xa')]['findOne']({'where':{'id':getInteractionId(_0x333184,_0x612a41,_0x2d6966)}})['then'](function(_0x10710c){if(_0x10710c){return _0x10710c['update']({'UserId':_0x562137?_0x562137['id']:null});}})[_0xf484('0xb')](function(_0x23d575){if(_0x23d575){log(_0xf484('0xc'),_0x562137,_0x333184,_0x612a41,_0x2d6966,_0x412c57);}})[_0xf484('0xd')](function(){log('error',_0x562137,_0x333184,_0x612a41,_0x2d6966,_0x412c57);});}exports['tracked']=function(_0x2d98c0,_0x111d63){return function(_0xd1ce5,_0x4cfafe,_0x21d73a){var _0x4a5453=_0xd1ce5['user'];var _0x518f9e={};var _0x3452af=_0xd1ce5['query'];if(_0x518f9e){_0x518f9e=_[_0xf484('0xe')](_0xd1ce5['body']);_0x518f9e=_['omit'](_0x518f9e,[_0xf484('0xf'),_0xf484('0x10'),_0xf484('0x11'),'fax',_0xf484('0x12')]);}updateUser(_0x4a5453,_0x518f9e,_0x3452af,_0x2d98c0,_0x111d63);_0x21d73a(null);};}; \ No newline at end of file +var _0x6db2=['findOne','then','info','catch','error','tracked','query','clone','body','omit','phone','fax','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','sms-interactions','upperFirst','InteractionId','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','name','role','stringify','null'];(function(_0xde9059,_0x750aab){var _0x23197d=function(_0x457724){while(--_0x457724){_0xde9059['push'](_0xde9059['shift']());}};_0x23197d(++_0x750aab);}(_0x6db2,0x15e));var _0x26db=function(_0x514260,_0x1891e1){_0x514260=_0x514260-0x0;var _0x4ac81b=_0x6db2[_0x514260];return _0x4ac81b;};'use strict';var _=require('lodash');var db=require(_0x26db('0x0'))['db'];var loggers={'openchannel':require(_0x26db('0x1'))(_0x26db('0x2')),'mail':require('../../config/logger')(_0x26db('0x3')),'fax':require(_0x26db('0x1'))('fax-interactions'),'sms':require(_0x26db('0x1'))(_0x26db('0x4')),'chat':require(_0x26db('0x1'))('chat-interactions')};function getInteractionId(_0x4a6a03,_0x3e2f8f,_0x2010c1){if(_0x4a6a03&&_0x4a6a03[_[_0x26db('0x5')](_0x2010c1)+'InteractionId']){return _0x4a6a03[_['upperFirst'](_0x2010c1)+_0x26db('0x6')];}else if(_0x4a6a03&&_0x4a6a03['id']){return _0x4a6a03['id'];}else if(_0x3e2f8f&&_0x3e2f8f['id']){return _0x3e2f8f['id'];}else{return _0x26db('0x7');}}function log(_0x4d7adb,_0x42366e,_0x4e8d15,_0x26c781,_0x19212e,_0x192a78){loggers[_0x19212e[_0x26db('0x8')]()][_0x4d7adb](_0x26db('0x9'),_0x192a78['toUpperCase'](),_0x42366e?_0x42366e['id']:null,_0x42366e?_0x42366e[_0x26db('0xa')]:null,_0x42366e?_0x42366e[_0x26db('0xb')]:null,getInteractionId(_0x4e8d15,_0x26c781,_0x19212e),_0x4e8d15?JSON[_0x26db('0xc')](_0x4e8d15):_0x26db('0xd'));}function updateUser(_0x521d43,_0x59b699,_0x31539d,_0x2a6fe9,_0x3832df){db[_['upperFirst'](_0x2a6fe9)+'Interaction'][_0x26db('0xe')]({'where':{'id':getInteractionId(_0x59b699,_0x31539d,_0x2a6fe9)}})[_0x26db('0xf')](function(_0x5c69cb){if(_0x5c69cb){return _0x5c69cb['update']({'UserId':_0x521d43?_0x521d43['id']:null});}})[_0x26db('0xf')](function(_0x388cd5){if(_0x388cd5){log(_0x26db('0x10'),_0x521d43,_0x59b699,_0x31539d,_0x2a6fe9,_0x3832df);}})[_0x26db('0x11')](function(){log(_0x26db('0x12'),_0x521d43,_0x59b699,_0x31539d,_0x2a6fe9,_0x3832df);});}exports[_0x26db('0x13')]=function(_0x383323,_0x4b5be2){return function(_0x568ed3,_0x62d4ad,_0x1c8e45){var _0x517bba=_0x568ed3['user'];var _0x607f07={};var _0x44d3c4=_0x568ed3[_0x26db('0x14')];if(_0x607f07){_0x607f07=_[_0x26db('0x15')](_0x568ed3[_0x26db('0x16')]);_0x607f07=_[_0x26db('0x17')](_0x607f07,[_0x26db('0x16'),'html',_0x26db('0x18'),_0x26db('0x19'),'mobile']);}updateUser(_0x517bba,_0x607f07,_0x44d3c4,_0x383323,_0x4b5be2);_0x1c8e45(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index b92b1c6..d7f9ba8 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 _0x17e1=['parse','use','License','findOne','then','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','User','isUserLimit','crypto','composable-middleware','../../mysqldb','data1','split','createDecipher','aes-256-ctr','format','utf8'];(function(_0x56a962,_0x404128){var _0x43b7f1=function(_0x14b97e){while(--_0x14b97e){_0x56a962['push'](_0x56a962['shift']());}};_0x43b7f1(++_0x404128);}(_0x17e1,0x127));var _0x117e=function(_0x13a8de,_0x35dcec){_0x13a8de=_0x13a8de-0x0;var _0x5a1e61=_0x17e1[_0x13a8de];return _0x5a1e61;};'use strict';var crypto=require(_0x117e('0x0'));var util=require('util');var compose=require(_0x117e('0x1'));var db=require(_0x117e('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x486ed6,_0x1bd5b4){if(_0x486ed6&&_0x1bd5b4){if(_0x1bd5b4[_0x117e('0x3')]&&_0x1bd5b4['license']){var _0x3e1c88=_0x1bd5b4[_0x117e('0x3')];var _0x558959=_0x1bd5b4['license'];var _0x12d9ec=_0x3e1c88[_0x117e('0x4')]('-')[0x4];var _0x4f698a=_0x3e1c88['split']('-')[0x0];var _0x405f29=crypto[_0x117e('0x5')](_0x117e('0x6'),util[_0x117e('0x7')]('%s:%s:%s',_0x12d9ec,_0x3e1c88,_0x4f698a));var _0xe6b931=_0x405f29['update'](_0x558959,'base64',_0x117e('0x8'));_0xe6b931+=_0x405f29['final'](_0x117e('0x8'));var _0x399b14=JSON[_0x117e('0x9')](_0xe6b931);return _0x399b14['hasOwnProperty'](_0x486ed6)?_0x399b14[_0x486ed6]:null;}}return null;}function isLimit(_0x5a048a,_0x4f1855,_0x94b9c3,_0x435a4){var _0x1326f3=_0x4f1855;return compose()[_0x117e('0xa')](function(_0x340a2e,_0x46676f,_0x4383f7){return db[_0x117e('0xb')][_0x117e('0xc')]({'where':{'id':0x1},'raw':!![]})[_0x117e('0xd')](function(_0x5d73a8){var _0x4e1aad=getValueFromLicense(_0x5a048a,_0x5d73a8);return _0x4e1aad?_0x4e1aad:_0x1326f3;})['then'](function(_0x523080){_0x1326f3=_0x523080;return _0x94b9c3['count'](_0x435a4);})[_0x117e('0xd')](function(_0x3b1ffa){if(_0x3b1ffa>=_0x1326f3){return _0x46676f['status'](0x193)[_0x117e('0xe')]({'message':util[_0x117e('0x7')](_0x117e('0xf'),_0x5a048a)});}_0x4383f7();})[_0x117e('0x10')](function(_0xc7605a){_0x4383f7(_0xc7605a);});});}function isUserLimit(){return isLimit('users',0x1,db[_0x117e('0x11')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x117e('0x12')]=isUserLimit; \ No newline at end of file +var _0x0e4e=['then','count','json','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','users','User','admin','isUserLimit','util','composable-middleware','../../mysqldb','data1','license','split','aes-256-ctr','%s:%s:%s','final','utf8','hasOwnProperty','use','License','findOne'];(function(_0x25f23f,_0x41302c){var _0x19562c=function(_0x4082df){while(--_0x4082df){_0x25f23f['push'](_0x25f23f['shift']());}};_0x19562c(++_0x41302c);}(_0x0e4e,0xaa));var _0xe0e4=function(_0x5c918d,_0x1ca4a7){_0x5c918d=_0x5c918d-0x0;var _0x3c4d98=_0x0e4e[_0x5c918d];return _0x3c4d98;};'use strict';var crypto=require('crypto');var util=require(_0xe0e4('0x0'));var compose=require(_0xe0e4('0x1'));var db=require(_0xe0e4('0x2'))['db'];var config=require('../../config/environment');function getValueFromLicense(_0x557a3f,_0x3efc03){if(_0x557a3f&&_0x3efc03){if(_0x3efc03[_0xe0e4('0x3')]&&_0x3efc03[_0xe0e4('0x4')]){var _0x35ec32=_0x3efc03['data1'];var _0xf0e6d3=_0x3efc03[_0xe0e4('0x4')];var _0x60a7d9=_0x35ec32['split']('-')[0x4];var _0x1827d4=_0x35ec32[_0xe0e4('0x5')]('-')[0x0];var _0x128951=crypto['createDecipher'](_0xe0e4('0x6'),util['format'](_0xe0e4('0x7'),_0x60a7d9,_0x35ec32,_0x1827d4));var _0x2f37c0=_0x128951['update'](_0xf0e6d3,'base64','utf8');_0x2f37c0+=_0x128951[_0xe0e4('0x8')](_0xe0e4('0x9'));var _0x200a12=JSON['parse'](_0x2f37c0);return _0x200a12[_0xe0e4('0xa')](_0x557a3f)?_0x200a12[_0x557a3f]:null;}}return null;}function isLimit(_0x1e4e94,_0x199300,_0x11f508,_0x234d0e){var _0x529572=_0x199300;return compose()[_0xe0e4('0xb')](function(_0x426366,_0x2fb546,_0x18d2be){return db[_0xe0e4('0xc')][_0xe0e4('0xd')]({'where':{'id':0x1},'raw':!![]})[_0xe0e4('0xe')](function(_0x29c542){var _0x4a6e2c=getValueFromLicense(_0x1e4e94,_0x29c542);return _0x4a6e2c?_0x4a6e2c:_0x529572;})['then'](function(_0x298f41){_0x529572=_0x298f41;return _0x11f508[_0xe0e4('0xf')](_0x234d0e);})[_0xe0e4('0xe')](function(_0x25dbda){if(_0x25dbda>=_0x529572){return _0x2fb546['status'](0x193)[_0xe0e4('0x10')]({'message':util[_0xe0e4('0x11')](_0xe0e4('0x12'),_0x1e4e94)});}_0x18d2be();})['catch'](function(_0x59ee64){_0x18d2be(_0x59ee64);});});}function isUserLimit(){return isLimit(_0xe0e4('0x13'),0x1,db[_0xe0e4('0x14')],{'where':{'$or':[{'role':_0xe0e4('0x15')},{'role':'user'}]}});}exports[_0xe0e4('0x16')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index a8b9a72..871bb56 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4830=['NOT\x20IN\x20?','$ne','<>\x20?','$substring','$startsWith','LIKE\x20?','$lt','$gt','>\x20?','$lte','<=\x20?','$gte','$between','BETWEEN\x20?\x20AND\x20?','start','$endsWith','format','add','hours','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','[$and]','replace','split','length','slice','shift','match','forEach','filter','indexOf','conditions','buildExpression','DATE','operator','$eq','value','castTo','text','CAST(','field','\x20AS\x20','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?'];(function(_0x31cb5f,_0x2df766){var _0x586042=function(_0x53c807){while(--_0x53c807){_0x31cb5f['push'](_0x31cb5f['shift']());}};_0x586042(++_0x2df766);}(_0x4830,0x1c5));var _0x0483=function(_0x53c33d,_0x10b010){_0x53c33d=_0x53c33d-0x0;var _0x1aa6ea=_0x4830[_0x53c33d];return _0x1aa6ea;};'use strict';var _=require(_0x0483('0x0'));var moment=require(_0x0483('0x1'));exports[_0x0483('0x2')]=function(_0x148529){var _0x23d4ee={'conditions':[]};_0x23d4ee[_0x0483('0x3')]=_[_0x0483('0x4')](_0x148529,_0x0483('0x5'))?'or':_0x0483('0x6');var _0x48c8fd=_0x148529['replace'](_0x0483('0x7'),'')[_0x0483('0x8')]('[$or]','')[_0x0483('0x9')]('||');for(var _0x255593=0x0;_0x255593<_0x48c8fd[_0x0483('0xa')];_0x255593++){var _0x351fed=_0x48c8fd[_0x255593][_0x0483('0x9')](':=');var _0x3720f6=_0x351fed[0x0];var _0x2aae34=_0x351fed[_0x0483('0xb')](0x1);_0x2aae34['forEach'](function(_0x1a3e9c){var _0x4ba854=_0x1a3e9c[_0x0483('0x9')]('[')[_0x0483('0xc')]();var _0x3f7d34=_0x1a3e9c[_0x0483('0xd')](/\[(.*?)\]/g);_0x3f7d34[_0x0483('0xe')](function(_0x3b6341){var _0x3f2f6d=_0x3b6341[_0x0483('0x9')]('[')[_0x0483('0xf')](function(_0x5690d0){return _0x5690d0[_0x0483('0x10')](']')>-0x1;})['map'](function(_0x6a12e){return _0x6a12e[_0x0483('0x9')](']')[0x0];})[0x0];_0x23d4ee[_0x0483('0x11')]['push']({'field':_0x3720f6,'operator':_0x4ba854,'value':_0x3f2f6d});});});}return _0x23d4ee;};exports[_0x0483('0x12')]=function(_0x1056b0,_0x3dd2c9,_0x1e53c8){var _0x16bf73={};if(_0x3dd2c9===_0x0483('0x13')&&_0x1e53c8[_0x0483('0x14')]===_0x0483('0x15')){_0x1e53c8[_0x0483('0x14')]='$between';_0x1e53c8[_0x0483('0x16')]+=','+_0x1e53c8[_0x0483('0x16')];}if(_0x1e53c8['castTo']){_0x3dd2c9=_0x1e53c8[_0x0483('0x17')];_0x16bf73[_0x0483('0x18')]=_0x0483('0x19')+_0x1056b0+'.'+_0x1e53c8[_0x0483('0x1a')]+_0x0483('0x1b')+_0x1e53c8[_0x0483('0x17')]+')\x20'+parseOperator(_0x1e53c8[_0x0483('0x14')]);}else{_0x16bf73[_0x0483('0x18')]=_0x1056b0+'.'+_0x1e53c8[_0x0483('0x1a')]+'\x20'+parseOperator(_0x1e53c8['operator']);}if(_0x1e53c8[_0x0483('0x14')]===_0x0483('0x1c'))_0x16bf73['text']='('+_0x16bf73['text']+_0x0483('0x1d')+_0x1056b0+'.'+_0x1e53c8[_0x0483('0x1a')]+_0x0483('0x1e');_0x16bf73[_0x0483('0x16')]=parseValue(_0x3dd2c9,_0x1e53c8['operator'],_0x1e53c8['value']);return _0x16bf73;};function parseOperator(_0x3cfdb2){var _0x5f02a3;switch(_0x3cfdb2){case _0x0483('0x1f'):_0x5f02a3=_0x0483('0x20');break;case'$notIn':_0x5f02a3=_0x0483('0x21');break;case _0x0483('0x15'):_0x5f02a3='=\x20?';break;case _0x0483('0x22'):_0x5f02a3=_0x0483('0x23');break;case _0x0483('0x24'):case _0x0483('0x25'):case'$endsWith':_0x5f02a3=_0x0483('0x26');break;case _0x0483('0x27'):_0x5f02a3='<\x20?';break;case _0x0483('0x28'):_0x5f02a3=_0x0483('0x29');break;case _0x0483('0x2a'):_0x5f02a3=_0x0483('0x2b');break;case _0x0483('0x2c'):_0x5f02a3='>=\x20?';break;case _0x0483('0x2d'):_0x5f02a3=_0x0483('0x2e');break;}return _0x5f02a3;}function parseValue(_0x270d75,_0x4339e3,_0x3b9504){var _0x2b5399={'start':undefined,'end':undefined};switch(_0x4339e3){case _0x0483('0x1f'):case _0x0483('0x1c'):_0x2b5399[_0x0483('0x2f')]=_0x3b9504['split'](',');break;case _0x0483('0x24'):_0x2b5399['start']='%'+_0x3b9504+'%';break;case _0x0483('0x25'):_0x2b5399[_0x0483('0x2f')]=_0x3b9504+'%';break;case _0x0483('0x30'):_0x2b5399[_0x0483('0x2f')]='%'+_0x3b9504;break;case _0x0483('0x2d'):var _0x39ecfe=_0x3b9504[_0x0483('0x9')](',');var _0x3b9504=_0x39ecfe[_0x0483('0xc')]();var _0x1a3ed7=_0x39ecfe['pop']();if(_0x270d75==='DATE'){_0x3b9504=moment(_0x3b9504)['utcOffset'](0x0,!![])[_0x0483('0x31')]();_0x1a3ed7=moment(_0x1a3ed7)['utcOffset'](0x0,!![])[_0x0483('0x32')](0x17,_0x0483('0x33'))[_0x0483('0x32')](0x3b,_0x0483('0x34'))[_0x0483('0x32')](0x3b,_0x0483('0x35'))[_0x0483('0x31')]();}_0x2b5399={'start':_0x3b9504,'end':_0x1a3ed7};break;default:_0x2b5399[_0x0483('0x2f')]=_0x3b9504;break;}return _0x2b5399;} \ No newline at end of file +var _0x6896=['castTo','text','CAST(','field','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','$eq','$ne','<>\x20?','$substring','$startsWith','$endsWith','$lt','<\x20?','$gt','>\x20?','>=\x20?','$between','BETWEEN\x20?\x20AND\x20?','start','pop','utcOffset','format','add','hours','minutes','lodash','moment','[$or]','and','replace','[$and]','split','slice','forEach','shift','map','conditions','push','buildExpression','DATE','operator','value'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0x6896,0x109));var _0x6689=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x6896[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x6689('0x0'));var moment=require(_0x6689('0x1'));exports['parseSearch']=function(_0x232205){var _0x534489={'conditions':[]};_0x534489['sqlOperator']=_['startsWith'](_0x232205,_0x6689('0x2'))?'or':_0x6689('0x3');var _0x4d492b=_0x232205[_0x6689('0x4')](_0x6689('0x5'),'')[_0x6689('0x4')](_0x6689('0x2'),'')[_0x6689('0x6')]('||');for(var _0xab3bca=0x0;_0xab3bca<_0x4d492b['length'];_0xab3bca++){var _0x5841a1=_0x4d492b[_0xab3bca][_0x6689('0x6')](':=');var _0x2d4407=_0x5841a1[0x0];var _0x399642=_0x5841a1[_0x6689('0x7')](0x1);_0x399642[_0x6689('0x8')](function(_0x2ac744){var _0x2789d5=_0x2ac744[_0x6689('0x6')]('[')[_0x6689('0x9')]();var _0x48989=_0x2ac744['match'](/\[(.*?)\]/g);_0x48989[_0x6689('0x8')](function(_0x48e9ac){var _0x38c526=_0x48e9ac[_0x6689('0x6')]('[')['filter'](function(_0xf0162d){return _0xf0162d['indexOf'](']')>-0x1;})[_0x6689('0xa')](function(_0x1ae11f){return _0x1ae11f[_0x6689('0x6')](']')[0x0];})[0x0];_0x534489[_0x6689('0xb')][_0x6689('0xc')]({'field':_0x2d4407,'operator':_0x2789d5,'value':_0x38c526});});});}return _0x534489;};exports[_0x6689('0xd')]=function(_0x22360e,_0x2726d4,_0x402058){var _0x16b12b={};if(_0x2726d4===_0x6689('0xe')&&_0x402058['operator']==='$eq'){_0x402058[_0x6689('0xf')]='$between';_0x402058['value']+=','+_0x402058[_0x6689('0x10')];}if(_0x402058[_0x6689('0x11')]){_0x2726d4=_0x402058[_0x6689('0x11')];_0x16b12b[_0x6689('0x12')]=_0x6689('0x13')+_0x22360e+'.'+_0x402058[_0x6689('0x14')]+'\x20AS\x20'+_0x402058[_0x6689('0x11')]+')\x20'+parseOperator(_0x402058[_0x6689('0xf')]);}else{_0x16b12b['text']=_0x22360e+'.'+_0x402058[_0x6689('0x14')]+'\x20'+parseOperator(_0x402058['operator']);}if(_['includes'](['$ne',_0x6689('0x15')],_0x402058[_0x6689('0xf')]))_0x16b12b['text']='('+_0x16b12b[_0x6689('0x12')]+_0x6689('0x16')+_0x22360e+'.'+_0x402058['field']+_0x6689('0x17');_0x16b12b[_0x6689('0x10')]=parseValue(_0x2726d4,_0x402058[_0x6689('0xf')],_0x402058[_0x6689('0x10')]);return _0x16b12b;};function parseOperator(_0x26d3ed){var _0xde7eaa;switch(_0x26d3ed){case _0x6689('0x18'):_0xde7eaa=_0x6689('0x19');break;case _0x6689('0x15'):_0xde7eaa=_0x6689('0x1a');break;case _0x6689('0x1b'):_0xde7eaa='=\x20?';break;case _0x6689('0x1c'):_0xde7eaa=_0x6689('0x1d');break;case _0x6689('0x1e'):case _0x6689('0x1f'):case _0x6689('0x20'):_0xde7eaa='LIKE\x20?';break;case _0x6689('0x21'):_0xde7eaa=_0x6689('0x22');break;case _0x6689('0x23'):_0xde7eaa=_0x6689('0x24');break;case'$lte':_0xde7eaa='<=\x20?';break;case'$gte':_0xde7eaa=_0x6689('0x25');break;case _0x6689('0x26'):_0xde7eaa=_0x6689('0x27');break;}return _0xde7eaa;}function parseValue(_0x12aa03,_0x2c93d7,_0x3b2330){var _0xbc734d={'start':undefined,'end':undefined};switch(_0x2c93d7){case _0x6689('0x18'):case _0x6689('0x15'):_0xbc734d['start']=_0x3b2330['split'](',');break;case'$substring':_0xbc734d[_0x6689('0x28')]='%'+_0x3b2330+'%';break;case'$startsWith':_0xbc734d[_0x6689('0x28')]=_0x3b2330+'%';break;case _0x6689('0x20'):_0xbc734d[_0x6689('0x28')]='%'+_0x3b2330;break;case'$between':var _0x12facf=_0x3b2330['split'](',');var _0x3b2330=_0x12facf[_0x6689('0x9')]();var _0xfd78f0=_0x12facf[_0x6689('0x29')]();if(_0x12aa03===_0x6689('0xe')){_0x3b2330=moment(_0x3b2330)[_0x6689('0x2a')](0x0,!![])[_0x6689('0x2b')]();_0xfd78f0=moment(_0xfd78f0)[_0x6689('0x2a')](0x0,!![])[_0x6689('0x2c')](0x17,_0x6689('0x2d'))[_0x6689('0x2c')](0x3b,_0x6689('0x2e'))[_0x6689('0x2c')](0x3b,'seconds')[_0x6689('0x2b')]();}_0xbc734d={'start':_0x3b2330,'end':_0xfd78f0};break;default:_0xbc734d[_0x6689('0x28')]=_0x3b2330;break;}return _0xbc734d;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 6c779dc..7619072 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 _0xfe40=['sort','split','indexOf','priority','cast','col','unsigned','DESC','omit','length','isObject','isString','unset','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','push','toString','lodash','fields','filters','isEmpty','forOwn','isArray','parse','limit','offset'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xfe40,0xdf));var _0x0fe4=function(_0x3557a5,_0x33a19b){_0x3557a5=_0x3557a5-0x0;var _0x21f8f6=_0xfe40[_0x3557a5];return _0x21f8f6;};'use strict';var _=require(_0x0fe4('0x0'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0x0fe4('0x1')]=function(_0x28717f){var _0x44d35b=null;if(_0x28717f){_0x44d35b=_0x28717f['split'](',');}return _0x44d35b;};exports[_0x0fe4('0x2')]=function(_0x4340ca){var _0x3af6cf={};if(!_[_0x0fe4('0x3')](_0x4340ca)){_0x3af6cf={};_[_0x0fe4('0x4')](_0x4340ca,function(_0x5256de,_0x3bf5f4){try{_0x3af6cf[_0x3bf5f4]=_[_0x0fe4('0x5')](_0x5256de)?_0x5256de:JSON[_0x0fe4('0x6')](_0x5256de);}catch(_0xe88dc9){_0x3af6cf[_0x3bf5f4]=_0x5256de['split'](',');}});}return _0x3af6cf;};exports[_0x0fe4('0x7')]=function(_0x2ee197){_0x2ee197=parseInt(_0x2ee197,0xa);if(!_0x2ee197||_0x2ee197<0x0){_0x2ee197=LIMIT_VALUE;}return _0x2ee197;};exports[_0x0fe4('0x8')]=function(_0x2c9a74){_0x2c9a74=parseInt(_0x2c9a74,0xa);if(!_0x2c9a74||_0x2c9a74<0x0){_0x2c9a74=0x0;}return _0x2c9a74;};exports[_0x0fe4('0x9')]=function(_0x47c64e){var _0x3acb3a,_0x3003a2=null;if(_0x47c64e){_0x3acb3a=_0x47c64e[_0x0fe4('0xa')](',');_0x3003a2=_['map'](_0x3acb3a,function(_0x5b25aa){if(_0x5b25aa[_0x0fe4('0xb')]('-')===0x0){return[_0x5b25aa===_0x0fe4('0xc')?sequelize[_0x0fe4('0xd')](sequelize[_0x0fe4('0xe')]('priority'),_0x0fe4('0xf')):_0x5b25aa['substr'](0x1),_0x0fe4('0x10')];}else{return[_0x5b25aa==='priority'?sequelize['cast'](sequelize['col']('priority'),'unsigned'):_0x5b25aa,'ASC'];}});}return _0x3003a2;};exports[_0x0fe4('0x11')]=function(_0x3640cf,_0x30ef59){if(_[_0x0fe4('0x3')](_0x3640cf)){return _0x3640cf;}if(_[_0x0fe4('0x5')](_0x3640cf)){for(var _0x1902c1=0x0;_0x1902c1<_0x3640cf[_0x0fe4('0x12')];_0x1902c1+=0x1){_0x3640cf[_0x1902c1]=this['omit'](_0x3640cf[_0x1902c1],_0x30ef59);}return _0x3640cf;}if(!_[_0x0fe4('0x13')](_0x3640cf)){return _0x3640cf;}if(_[_0x0fe4('0x14')](_0x30ef59)){_0x30ef59=[_0x30ef59];}if(!_['isArray'](_0x30ef59)){return _0x3640cf;}for(var _0x5cc4fe=0x0;_0x5cc4fe<_0x30ef59['length'];_0x5cc4fe+=0x1){_[_0x0fe4('0x15')](_0x3640cf,_0x30ef59[_0x5cc4fe]);}for(var _0x179ba2 in _0x3640cf){if(_0x3640cf[_0x0fe4('0x16')](_0x179ba2)){_0x3640cf[_0x179ba2]=this[_0x0fe4('0x11')](_0x3640cf[_0x179ba2],_0x30ef59);}}return _0x3640cf;};exports[_0x0fe4('0x17')]=function(_0x21ed70){return _0x21ed70[_0x0fe4('0x18')](RegExp(_0x0fe4('0x19')))?!![]:![];};exports[_0x0fe4('0x1a')]=function(_0x2963ba){return _0x2963ba[_0x0fe4('0x18')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0x215453){var _0x5f387b=[];_0x215453[_0x0fe4('0xa')]('\x20')['forEach'](function(_0x371882){_0x5f387b[_0x0fe4('0x1b')]('+'+_0x371882[_0x0fe4('0x1c')]()+'*');});return _0x5f387b['join']('\x20');}; \ No newline at end of file +var _0x231b=['isObject','isString','unset','hasOwnProperty','isNumeric','isEmail','getFullTextValue','push','toString','join','lodash','fields','split','forOwn','isArray','parse','offset','sort','map','indexOf','priority','unsigned','substr','DESC','cast','col','ASC','omit','isEmpty'];(function(_0x1d1d09,_0x504d77){var _0x8827e=function(_0x4f3128){while(--_0x4f3128){_0x1d1d09['push'](_0x1d1d09['shift']());}};_0x8827e(++_0x504d77);}(_0x231b,0x166));var _0xb231=function(_0x500419,_0x549162){_0x500419=_0x500419-0x0;var _0x241c1a=_0x231b[_0x500419];return _0x241c1a;};'use strict';var _=require(_0xb231('0x0'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0xb231('0x1')]=function(_0x49627b){var _0x4bc53c=null;if(_0x49627b){_0x4bc53c=_0x49627b[_0xb231('0x2')](',');}return _0x4bc53c;};exports['filters']=function(_0x24f17d){var _0x47bcf7={};if(!_['isEmpty'](_0x24f17d)){_0x47bcf7={};_[_0xb231('0x3')](_0x24f17d,function(_0x39e6bd,_0x6e126a){try{_0x47bcf7[_0x6e126a]=_[_0xb231('0x4')](_0x39e6bd)?_0x39e6bd:JSON[_0xb231('0x5')](_0x39e6bd);}catch(_0x86f5a3){_0x47bcf7[_0x6e126a]=_0x39e6bd['split'](',');}});}return _0x47bcf7;};exports['limit']=function(_0x26104a){_0x26104a=parseInt(_0x26104a,0xa);if(!_0x26104a||_0x26104a<0x0){_0x26104a=LIMIT_VALUE;}return _0x26104a;};exports[_0xb231('0x6')]=function(_0x103e60){_0x103e60=parseInt(_0x103e60,0xa);if(!_0x103e60||_0x103e60<0x0){_0x103e60=0x0;}return _0x103e60;};exports[_0xb231('0x7')]=function(_0x361407){var _0x1cb96d,_0x139eec=null;if(_0x361407){_0x1cb96d=_0x361407[_0xb231('0x2')](',');_0x139eec=_[_0xb231('0x8')](_0x1cb96d,function(_0x5bea06){if(_0x5bea06[_0xb231('0x9')]('-')===0x0){return[_0x5bea06===_0xb231('0xa')?sequelize['cast'](sequelize['col']('priority'),_0xb231('0xb')):_0x5bea06[_0xb231('0xc')](0x1),_0xb231('0xd')];}else{return[_0x5bea06===_0xb231('0xa')?sequelize[_0xb231('0xe')](sequelize[_0xb231('0xf')](_0xb231('0xa')),_0xb231('0xb')):_0x5bea06,_0xb231('0x10')];}});}return _0x139eec;};exports[_0xb231('0x11')]=function(_0x1c83bd,_0x2d274e){if(_[_0xb231('0x12')](_0x1c83bd)){return _0x1c83bd;}if(_['isArray'](_0x1c83bd)){for(var _0xa2f3c6=0x0;_0xa2f3c6<_0x1c83bd['length'];_0xa2f3c6+=0x1){_0x1c83bd[_0xa2f3c6]=this[_0xb231('0x11')](_0x1c83bd[_0xa2f3c6],_0x2d274e);}return _0x1c83bd;}if(!_[_0xb231('0x13')](_0x1c83bd)){return _0x1c83bd;}if(_[_0xb231('0x14')](_0x2d274e)){_0x2d274e=[_0x2d274e];}if(!_['isArray'](_0x2d274e)){return _0x1c83bd;}for(var _0x4d23cd=0x0;_0x4d23cd<_0x2d274e['length'];_0x4d23cd+=0x1){_[_0xb231('0x15')](_0x1c83bd,_0x2d274e[_0x4d23cd]);}for(var _0x3ffe9c in _0x1c83bd){if(_0x1c83bd[_0xb231('0x16')](_0x3ffe9c)){_0x1c83bd[_0x3ffe9c]=this[_0xb231('0x11')](_0x1c83bd[_0x3ffe9c],_0x2d274e);}}return _0x1c83bd;};exports[_0xb231('0x17')]=function(_0x5575f1){return _0x5575f1['match'](RegExp('^[0-9]*$'))?!![]:![];};exports[_0xb231('0x18')]=function(_0x2d825e){return _0x2d825e['match'](/^\S+@\S+$/)?!![]:![];};exports[_0xb231('0x19')]=function(_0x2efacc){var _0x132774=[];_0x2efacc[_0xb231('0x2')]('\x20')['forEach'](function(_0x56b51e){_0x132774[_0xb231('0x1a')]('+'+_0x56b51e[_0xb231('0x1b')]()+'*');});return _0x132774[_0xb231('0x1c')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index bca8db0..0a317ac 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb461=['passport','cors','../mysqldb','default','get','env','set','appPath','join','development','test','root','json\x20replacer','toISOString','split','use','static','/server/views','engine','html','ejs','renderFile','view\x20engine','urlencoded','50mb','json','initialize','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path'];(function(_0x2e5477,_0x4b3a9b){var _0x254faf=function(_0x2263ab){while(--_0x2263ab){_0x2e5477['push'](_0x2e5477['shift']());}};_0x254faf(++_0x4b3a9b);}(_0xb461,0x123));var _0x1b46=function(_0xadb225,_0x45579d){_0xadb225=_0xadb225-0x0;var _0x21ee61=_0xb461[_0xadb225];return _0x21ee61;};'use strict';var express=require('express');var favicon=require(_0x1b46('0x0'));var bodyParser=require(_0x1b46('0x1'));var methodOverride=require(_0x1b46('0x2'));var cookieParser=require(_0x1b46('0x3'));var errorHandler=require(_0x1b46('0x4'));var path=require(_0x1b46('0x5'));var passport=require(_0x1b46('0x6'));var cors=require(_0x1b46('0x7'));var moment=require('moment');var config=require('./environment');var db=require(_0x1b46('0x8'))['db'];exports[_0x1b46('0x9')]=function(_0xff5ace){var _0x1c4b94=_0xff5ace[_0x1b46('0xa')](_0x1b46('0xb'));if(_0x1c4b94==='production'){_0xff5ace[_0x1b46('0xc')](_0x1b46('0xd'),path[_0x1b46('0xe')](config['root'],'public'));}if(_0x1c4b94===_0x1b46('0xf')||_0x1c4b94===_0x1b46('0x10')){_0xff5ace[_0x1b46('0xc')]('appPath',path[_0x1b46('0xe')](config[_0x1b46('0x11')],'client'));_0xff5ace['use'](errorHandler());}_0xff5ace[_0x1b46('0xc')](_0x1b46('0x12'),function(_0x72f57c,_0x5e45bb){if(this[_0x72f57c]instanceof Date){_0x5e45bb=this[_0x72f57c][_0x1b46('0x13')]()[_0x1b46('0x14')]('.')[0x0]+'Z';}return _0x5e45bb;});_0xff5ace[_0x1b46('0x15')](express[_0x1b46('0x16')](_0xff5ace[_0x1b46('0xa')]('appPath')));_0xff5ace['set']('views',config['root']+_0x1b46('0x17'));_0xff5ace[_0x1b46('0x18')](_0x1b46('0x19'),require(_0x1b46('0x1a'))[_0x1b46('0x1b')]);_0xff5ace[_0x1b46('0xc')](_0x1b46('0x1c'),_0x1b46('0x19'));_0xff5ace[_0x1b46('0x15')](bodyParser[_0x1b46('0x1d')]({'limit':_0x1b46('0x1e'),'extended':!![]}));_0xff5ace[_0x1b46('0x15')](bodyParser[_0x1b46('0x1f')]({'limit':_0x1b46('0x1e')}));_0xff5ace[_0x1b46('0x15')](cors());_0xff5ace[_0x1b46('0x15')](methodOverride());_0xff5ace[_0x1b46('0x15')](cookieParser());_0xff5ace[_0x1b46('0x15')](passport[_0x1b46('0x20')]());}; \ No newline at end of file +var _0x3443=['test','use','json\x20replacer','toISOString','split','get','views','/server/views','engine','html','ejs','renderFile','urlencoded','50mb','json','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','passport','cors','./environment','../mysqldb','default','env','set','appPath','join','root','public','development'];(function(_0x26140f,_0xbaeb1c){var _0x597085=function(_0x5bc3e8){while(--_0x5bc3e8){_0x26140f['push'](_0x26140f['shift']());}};_0x597085(++_0xbaeb1c);}(_0x3443,0x14b));var _0x3344=function(_0x5e7b6c,_0x4916d0){_0x5e7b6c=_0x5e7b6c-0x0;var _0x3afdbd=_0x3443[_0x5e7b6c];return _0x3afdbd;};'use strict';var express=require(_0x3344('0x0'));var favicon=require(_0x3344('0x1'));var bodyParser=require(_0x3344('0x2'));var methodOverride=require(_0x3344('0x3'));var cookieParser=require(_0x3344('0x4'));var errorHandler=require(_0x3344('0x5'));var path=require(_0x3344('0x6'));var passport=require(_0x3344('0x7'));var cors=require(_0x3344('0x8'));var moment=require('moment');var config=require(_0x3344('0x9'));var db=require(_0x3344('0xa'))['db'];exports[_0x3344('0xb')]=function(_0x245d47){var _0x46f14e=_0x245d47['get'](_0x3344('0xc'));if(_0x46f14e==='production'){_0x245d47[_0x3344('0xd')](_0x3344('0xe'),path[_0x3344('0xf')](config[_0x3344('0x10')],_0x3344('0x11')));}if(_0x46f14e===_0x3344('0x12')||_0x46f14e===_0x3344('0x13')){_0x245d47[_0x3344('0xd')](_0x3344('0xe'),path['join'](config[_0x3344('0x10')],'client'));_0x245d47[_0x3344('0x14')](errorHandler());}_0x245d47[_0x3344('0xd')](_0x3344('0x15'),function(_0x54a42d,_0x37fb44){if(this[_0x54a42d]instanceof Date){_0x37fb44=this[_0x54a42d][_0x3344('0x16')]()[_0x3344('0x17')]('.')[0x0]+'Z';}return _0x37fb44;});_0x245d47['use'](express['static'](_0x245d47[_0x3344('0x18')](_0x3344('0xe'))));_0x245d47['set'](_0x3344('0x19'),config[_0x3344('0x10')]+_0x3344('0x1a'));_0x245d47[_0x3344('0x1b')](_0x3344('0x1c'),require(_0x3344('0x1d'))[_0x3344('0x1e')]);_0x245d47['set']('view\x20engine',_0x3344('0x1c'));_0x245d47['use'](bodyParser[_0x3344('0x1f')]({'limit':_0x3344('0x20'),'extended':!![]}));_0x245d47[_0x3344('0x14')](bodyParser[_0x3344('0x21')]({'limit':_0x3344('0x20')}));_0x245d47['use'](cors());_0x245d47['use'](methodOverride());_0x245d47[_0x3344('0x14')](cookieParser());_0x245d47['use'](passport[_0x3344('0x22')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index b1aa62c..cf3207f 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 _0xe181=['digest','substring','lodash','bimedia-machine-uuid','child_process','execSync','networkInterfaces','keys','filter','family','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','orderBy','cpus','map','model','createHash','update','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress','ipAddress'];(function(_0x27cfff,_0x26ca29){var _0x1c030f=function(_0x533ac0){while(--_0x533ac0){_0x27cfff['push'](_0x27cfff['shift']());}};_0x1c030f(++_0x26ca29);}(_0xe181,0x68));var _0x1e18=function(_0x352e09,_0x37a7da){_0x352e09=_0x352e09-0x0;var _0x1b7094=_0xe181[_0x352e09];return _0x1b7094;};'use strict';var _=require(_0x1e18('0x0'));var os=require('os');var crypto=require('crypto');var machine=require(_0x1e18('0x1'));var exec=require(_0x1e18('0x2'))[_0x1e18('0x3')];function getInterfaces(){var _0x42ca76=[];var _0x4206ba=os[_0x1e18('0x4')]();var _0x3ec619=_['orderBy'](_[_0x1e18('0x5')](_0x4206ba));for(var _0x50253a=0x0;_0x50253a<_0x3ec619['length'];_0x50253a++){var _0x18fabb=_0x4206ba[_0x3ec619[_0x50253a]][_0x1e18('0x6')](function(_0x46ba95){return _0x46ba95[_0x1e18('0x7')]===_0x1e18('0x8')&&_0x46ba95[_0x1e18('0x9')]===![];});_0x42ca76=_0x42ca76['concat'](_0x18fabb);}return _0x42ca76;}function getFirstInterface(){var _0x2c95a2=_[_0x1e18('0xa')](getInterfaces());return{'macAddress':_0x2c95a2&&_0x2c95a2[_0x1e18('0xb')]?_0x2c95a2[_0x1e18('0xb')]:_0x1e18('0xc'),'ipAddress':_0x2c95a2&&_0x2c95a2[_0x1e18('0xd')]?_0x2c95a2['address']:_0x1e18('0xe')};}exports[_0x1e18('0xf')]=getFirstInterface;function getCPUhash(){var _0xa3eecd=_[_0x1e18('0x10')](os[_0x1e18('0x11')]()[_0x1e18('0x12')](function(_0x1743c3){return _0x1743c3[_0x1e18('0x13')];}))['join'](':');return crypto[_0x1e18('0x14')]('md5')[_0x1e18('0x15')](_0xa3eecd)['digest'](_0x1e18('0x16'));}exports[_0x1e18('0x17')]=function(){switch(os[_0x1e18('0x18')]()){case _0x1e18('0x19'):return exec(_0x1e18('0x1a'),{'encoding':_0x1e18('0x1b')})[_0x1e18('0x1c')]('\x0d\x0a','');default:var _0x33fea1=getFirstInterface();var _0x134863=getCPUhash();var _0x3f5f61=_0x134863+'|'+os[_0x1e18('0x1d')]()+'|'+_0x33fea1[_0x1e18('0x1e')]+'|'+_0x33fea1[_0x1e18('0x1f')];var _0x4033da=crypto[_0x1e18('0x14')]('md5')[_0x1e18('0x15')](_0x3f5f61)[_0x1e18('0x20')](_0x1e18('0x16'));return _0x4033da[_0x1e18('0x21')](0x0,0x8)+'-'+_0x4033da[_0x1e18('0x21')](0x8,0xc)+'-'+_0x4033da[_0x1e18('0x21')](0xc,0x10)+'-'+_0x4033da[_0x1e18('0x21')](0x10,0x14)+'-'+_0x4033da[_0x1e18('0x21')](0x14);}}; \ No newline at end of file +var _0x0d4d=['digest','hex','win32','dmidecode\x20--string\x20system-uuid','replace','hostname','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','keys','length','filter','family','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','getFirstInterface','cpus','map','model','join','createHash','update'];(function(_0xda9609,_0x531fbb){var _0x1e209e=function(_0x1bd5d1){while(--_0x1bd5d1){_0xda9609['push'](_0xda9609['shift']());}};_0x1e209e(++_0x531fbb);}(_0x0d4d,0x132));var _0xd0d4=function(_0x1ff797,_0x40e99c){_0x1ff797=_0x1ff797-0x0;var _0x47fbf2=_0x0d4d[_0x1ff797];return _0x47fbf2;};'use strict';var _=require(_0xd0d4('0x0'));var os=require('os');var crypto=require(_0xd0d4('0x1'));var machine=require(_0xd0d4('0x2'));var exec=require(_0xd0d4('0x3'))[_0xd0d4('0x4')];function getInterfaces(){var _0x1515e0=[];var _0x4d5c19=os[_0xd0d4('0x5')]();var _0x58909f=_[_0xd0d4('0x6')](_[_0xd0d4('0x7')](_0x4d5c19));for(var _0x582aaa=0x0;_0x582aaa<_0x58909f[_0xd0d4('0x8')];_0x582aaa++){var _0x3db5ab=_0x4d5c19[_0x58909f[_0x582aaa]][_0xd0d4('0x9')](function(_0x5c8c7b){return _0x5c8c7b[_0xd0d4('0xa')]==='IPv4'&&_0x5c8c7b[_0xd0d4('0xb')]===![];});_0x1515e0=_0x1515e0['concat'](_0x3db5ab);}return _0x1515e0;}function getFirstInterface(){var _0xdf6916=_[_0xd0d4('0xc')](getInterfaces());return{'macAddress':_0xdf6916&&_0xdf6916[_0xd0d4('0xd')]?_0xdf6916['mac']:_0xd0d4('0xe'),'ipAddress':_0xdf6916&&_0xdf6916[_0xd0d4('0xf')]?_0xdf6916[_0xd0d4('0xf')]:_0xd0d4('0x10')};}exports[_0xd0d4('0x11')]=getFirstInterface;function getCPUhash(){var _0xbf4c47=_['orderBy'](os[_0xd0d4('0x12')]()[_0xd0d4('0x13')](function(_0x29ee49){return _0x29ee49[_0xd0d4('0x14')];}))[_0xd0d4('0x15')](':');return crypto[_0xd0d4('0x16')]('md5')[_0xd0d4('0x17')](_0xbf4c47)[_0xd0d4('0x18')](_0xd0d4('0x19'));}exports['getUuid']=function(){switch(os['platform']()){case _0xd0d4('0x1a'):return exec(_0xd0d4('0x1b'),{'encoding':'utf8'})[_0xd0d4('0x1c')]('\x0d\x0a','');default:var _0x1e8608=getFirstInterface();var _0x57028c=getCPUhash();var _0x5d7e66=_0x57028c+'|'+os[_0xd0d4('0x1d')]()+'|'+_0x1e8608[_0xd0d4('0x1e')]+'|'+_0x1e8608[_0xd0d4('0x1f')];var _0x5079d5=crypto['createHash']('md5')[_0xd0d4('0x17')](_0x5d7e66)[_0xd0d4('0x18')](_0xd0d4('0x19'));return _0x5079d5['substring'](0x0,0x8)+'-'+_0x5079d5['substring'](0x8,0xc)+'-'+_0x5079d5[_0xd0d4('0x20')](0xc,0x10)+'-'+_0x5079d5['substring'](0x10,0x14)+'-'+_0x5079d5[_0xd0d4('0x20')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index badb73a..ba32bac 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 _0x794b=['GET','then','catch','createCipher','aes-256-ctr','secrets','session','utf8','base64','final','update','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','|uuid|','|machineUuid|','|name|','|email|','email','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Alert','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','info','data1','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','error','message','getUuid','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','default','util','crypto','request-promise','bluebird','../../mysqldb','../environment','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s'];(function(_0x59f040,_0x1e2a68){var _0x200dc3=function(_0x2449fb){while(--_0x2449fb){_0x59f040['push'](_0x59f040['shift']());}};_0x200dc3(++_0x1e2a68);}(_0x794b,0x1c2));var _0xb794=function(_0x4f776e,_0x6b5b8f){_0x4f776e=_0x4f776e-0x0;var _0x4ba9dc=_0x794b[_0x4f776e];return _0x4ba9dc;};'use strict';var util=require(_0xb794('0x0'));var crypto=require(_0xb794('0x1'));var moment=require('moment');var rp=require(_0xb794('0x2'));var BPromise=require(_0xb794('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require(_0xb794('0x4'))['db'];var config=require(_0xb794('0x5'));var hardware=require('./hardware');var logger=require('../logger')(_0xb794('0x6'));var jira=require(_0xb794('0x7'));var HOST=_0xb794('0x8');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x20e4d4){return new BPromise(function(_0x231206,_0x340863){var _0x5d099b=util[_0xb794('0x9')](_0xb794('0xa'),HOST,_0x20e4d4,module[_0xb794('0xb')][_0xb794('0xc')]);if(oldToken){_0x5d099b=util[_0xb794('0x9')](_0xb794('0xd'),HOST,_0x20e4d4,module[_0xb794('0xb')][_0xb794('0xc')],oldToken);}var _0x19cfa0={'uri':_0x5d099b,'method':_0xb794('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x19cfa0)[_0xb794('0xf')](function(_0x1b1cee){_0x231206(_0x1b1cee);})[_0xb794('0x10')](function(_0x780c5b){_0x340863(_0x780c5b);});});}function encryptDate(_0x12b09e){var _0xe8442a=crypto[_0xb794('0x11')](_0xb794('0x12'),config[_0xb794('0x13')][_0xb794('0x14')]);var _0x20f84a=_0xe8442a['update'](_0x12b09e,_0xb794('0x15'),_0xb794('0x16'));_0x20f84a+=_0xe8442a[_0xb794('0x17')](_0xb794('0x16'));return _0x20f84a;}function decryptDate(_0xac1f87){var _0x469618=crypto['createDecipher'](_0xb794('0x12'),config[_0xb794('0x13')]['session']);var _0x408766=_0x469618[_0xb794('0x18')](_0xac1f87,'base64',_0xb794('0x15'));_0x408766+=_0x469618[_0xb794('0x17')](_0xb794('0x15'));return _0x408766;}function sendJiraAlert(_0x518d3d,_0x722b1b,_0xa0c655){var _0x5494e7=_0xb794('0x19');return db[_0xb794('0x1a')][_0xb794('0x1b')]({'where':{'role':_0xb794('0x1c')},'attributes':[_0xb794('0x1d'),'email'],'raw':!![]})[_0xb794('0xf')](function(_0x8daded){ADMIN=_0x8daded;_0x5494e7+='|reason|'+_0xa0c655+'|\x0a';_0x5494e7+=_0xb794('0x1e')+_0x518d3d+'|\x0a';_0x5494e7+=_0xb794('0x1f')+_0x722b1b+'|\x0a';_0x5494e7+=_0xb794('0x20')+ADMIN[_0xb794('0x1d')]+'|\x0a';_0x5494e7+=_0xb794('0x21')+ADMIN[_0xb794('0x22')]+'|\x0a';return _0x5494e7;})[_0xb794('0xf')](function(_0x45ddac){var _0x425a47=hardware[_0xb794('0x23')]()[_0xb794('0x24')];return jira[_0xb794('0x25')]({'key':_0xb794('0x26'),'summary':'Motion\x20License\x20Alert','description':_0x45ddac,'issuetype':_0xb794('0x27'),'oldToken':_0x518d3d,'newToken':_0x722b1b,'email':ADMIN[_0xb794('0x22')],'name':ADMIN[_0xb794('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x425a47});});}function manageLicense(_0x47e38c,_0x4bebc9){var _0x1675ea=_0x4bebc9['get']({'plain':!![]});httpRequest(_0x47e38c)[_0xb794('0xf')](function(_0x1cd655){if(oldToken){oldToken=undefined;}if(_0x1cd655['active']){if(!_0x1675ea['license']&&_0x1675ea[_0xb794('0x6')]!=_0x1cd655[_0xb794('0x6')]||_0x1675ea[_0xb794('0x6')]&&_0x1675ea['data2']){logger['info'](_0xb794('0x28'));}if(_0x1675ea[_0xb794('0x6')]&&!_0x1675ea[_0xb794('0x29')]&&_0x1675ea[_0xb794('0x6')]!=_0x1cd655[_0xb794('0x6')]){logger[_0xb794('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x1675ea['license']&&!_0x1675ea['data2']&&_0x1675ea[_0xb794('0x6')]==_0x1cd655[_0xb794('0x6')]){return _0x4bebc9;}return _0x4bebc9[_0xb794('0x18')]({'data1':_0x47e38c,'data2':null,'license':_0x1cd655['license']});}else{if(_0x1cd655[_0xb794('0x6')]||_0x1675ea['license']){if(!_0x1675ea[_0xb794('0x29')]){if(_0x1675ea[_0xb794('0x2b')]==_0x47e38c){GRAY_PERIOD_REASON='Disabled';logger[_0xb794('0x2a')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0xb794('0x2c');oldToken=_0x1675ea[_0xb794('0x2b')];logger['info'](_0xb794('0x2d'),_0x1675ea[_0xb794('0x2b')],_0x47e38c);}sendJiraAlert(_0x1675ea[_0xb794('0x2b')],_0x1cd655[_0xb794('0x2e')],GRAY_PERIOD_REASON);logger[_0xb794('0x2a')](_0xb794('0x2f'),GRAY_PERIOD_REASON[_0xb794('0x30')](),moment()['format'](_0xb794('0x31')));return _0x4bebc9['update']({'data2':encryptDate(moment()[_0xb794('0x9')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()[_0xb794('0x32')](decryptDate(_0x1675ea[_0xb794('0x29')]),_0xb794('0x33'))>DAYS){logger['info']('DEMO\x20START\x20AT\x20%s',moment()[_0xb794('0x9')](_0xb794('0x31')));return _0x4bebc9[_0xb794('0x18')]({'data1':_0x47e38c,'data2':null,'license':null});}}}else{if(_0x1675ea['data1']!=_0x47e38c){logger[_0xb794('0x2a')](_0xb794('0x2d'),_0x1675ea[_0xb794('0x2b')],_0x47e38c);return _0x4bebc9[_0xb794('0x18')]({'data1':_0x47e38c,'data2':null,'license':null});}}}return _0x4bebc9;})[_0xb794('0xf')](function(_0x4c1137){_0x4bebc9=_0x4c1137;})[_0xb794('0x10')](function(_0x18d872){logger[_0xb794('0x34')](_0x18d872[_0xb794('0x35')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware[_0xb794('0x36')](),_0x4bebc9);},TIME);});}function defaultLicense(){var _0x2d585b=hardware[_0xb794('0x36')]();if(_0x2d585b){return db['License']['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0x2d585b}})[_0xb794('0x37')](function(_0x403127,_0x4928b9){logger[_0xb794('0x2a')](_0xb794('0x38'),_0x2d585b);manageLicense(_0x2d585b,_0x403127);})[_0xb794('0x10')](function(_0x5d7158){logger[_0xb794('0x34')](_0x5d7158[_0xb794('0x35')]);});}}exports[_0xb794('0x39')]=defaultLicense; \ No newline at end of file +var _0x9ccd=['fullname','|reason|','|uuid|','|machineUuid|','|name|','|email|','email','getFirstInterface','ipAddress','openIssue','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','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','diff','days','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','util','moment','request-promise','version','../environment','./hardware','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','utf8','base64','final','createDecipher','secrets','session','update','||FIELD||VALUE||\x0a','User','findOne','admin'];(function(_0x397521,_0x49503f){var _0x53616e=function(_0x471cc8){while(--_0x471cc8){_0x397521['push'](_0x397521['shift']());}};_0x53616e(++_0x49503f);}(_0x9ccd,0x1a3));var _0xd9cc=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x9ccd[_0x14add3];return _0x4a174f;};'use strict';var util=require(_0xd9cc('0x0'));var crypto=require('crypto');var moment=require(_0xd9cc('0x1'));var rp=require(_0xd9cc('0x2'));var BPromise=require('bluebird');var pkginfo=require('pkginfo')(module,_0xd9cc('0x3'));var db=require('../../mysqldb')['db'];var config=require(_0xd9cc('0x4'));var hardware=require(_0xd9cc('0x5'));var logger=require(_0xd9cc('0x6'))(_0xd9cc('0x7'));var jira=require(_0xd9cc('0x8'));var HOST=_0xd9cc('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x1f7b2b){return new BPromise(function(_0x23b70a,_0x9e1e10){var _0x1a1bd1=util[_0xd9cc('0xa')](_0xd9cc('0xb'),HOST,_0x1f7b2b,module[_0xd9cc('0xc')][_0xd9cc('0x3')]);if(oldToken){_0x1a1bd1=util[_0xd9cc('0xa')](_0xd9cc('0xd'),HOST,_0x1f7b2b,module['exports'][_0xd9cc('0x3')],oldToken);}var _0x2b17db={'uri':_0x1a1bd1,'method':_0xd9cc('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x2b17db)[_0xd9cc('0xf')](function(_0x2e8a08){_0x23b70a(_0x2e8a08);})[_0xd9cc('0x10')](function(_0x1641a0){_0x9e1e10(_0x1641a0);});});}function encryptDate(_0x2afe71){var _0x5432d3=crypto[_0xd9cc('0x11')]('aes-256-ctr',config['secrets']['session']);var _0x58791d=_0x5432d3['update'](_0x2afe71,_0xd9cc('0x12'),_0xd9cc('0x13'));_0x58791d+=_0x5432d3[_0xd9cc('0x14')](_0xd9cc('0x13'));return _0x58791d;}function decryptDate(_0x863d0b){var _0x425cd1=crypto[_0xd9cc('0x15')]('aes-256-ctr',config[_0xd9cc('0x16')][_0xd9cc('0x17')]);var _0x513635=_0x425cd1[_0xd9cc('0x18')](_0x863d0b,_0xd9cc('0x13'),_0xd9cc('0x12'));_0x513635+=_0x425cd1[_0xd9cc('0x14')]('utf8');return _0x513635;}function sendJiraAlert(_0x37b745,_0x32df89,_0x4fa645){var _0x7d8977=_0xd9cc('0x19');return db[_0xd9cc('0x1a')][_0xd9cc('0x1b')]({'where':{'role':_0xd9cc('0x1c')},'attributes':[_0xd9cc('0x1d'),'email'],'raw':!![]})['then'](function(_0x292015){ADMIN=_0x292015;_0x7d8977+=_0xd9cc('0x1e')+_0x4fa645+'|\x0a';_0x7d8977+=_0xd9cc('0x1f')+_0x37b745+'|\x0a';_0x7d8977+=_0xd9cc('0x20')+_0x32df89+'|\x0a';_0x7d8977+=_0xd9cc('0x21')+ADMIN[_0xd9cc('0x1d')]+'|\x0a';_0x7d8977+=_0xd9cc('0x22')+ADMIN[_0xd9cc('0x23')]+'|\x0a';return _0x7d8977;})[_0xd9cc('0xf')](function(_0x3686b7){var _0x43f91c=hardware[_0xd9cc('0x24')]()[_0xd9cc('0x25')];return jira[_0xd9cc('0x26')]({'key':'MOTLICENSE','summary':_0xd9cc('0x27'),'description':_0x3686b7,'issuetype':_0xd9cc('0x28'),'oldToken':_0x37b745,'newToken':_0x32df89,'email':ADMIN['email'],'name':ADMIN[_0xd9cc('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x43f91c});});}function manageLicense(_0x1f2727,_0xe78722){var _0xd7789d=_0xe78722[_0xd9cc('0x29')]({'plain':!![]});httpRequest(_0x1f2727)[_0xd9cc('0xf')](function(_0x13a163){if(oldToken){oldToken=undefined;}if(_0x13a163[_0xd9cc('0x2a')]){if(!_0xd7789d[_0xd9cc('0x7')]&&_0xd7789d['license']!=_0x13a163[_0xd9cc('0x7')]||_0xd7789d[_0xd9cc('0x7')]&&_0xd7789d[_0xd9cc('0x2b')]){logger[_0xd9cc('0x2c')](_0xd9cc('0x2d'));}if(_0xd7789d[_0xd9cc('0x7')]&&!_0xd7789d[_0xd9cc('0x2b')]&&_0xd7789d[_0xd9cc('0x7')]!=_0x13a163['license']){logger[_0xd9cc('0x2c')](_0xd9cc('0x2e'));}if(_0xd7789d[_0xd9cc('0x7')]&&!_0xd7789d[_0xd9cc('0x2b')]&&_0xd7789d[_0xd9cc('0x7')]==_0x13a163[_0xd9cc('0x7')]){return _0xe78722;}return _0xe78722['update']({'data1':_0x1f2727,'data2':null,'license':_0x13a163[_0xd9cc('0x7')]});}else{if(_0x13a163['license']||_0xd7789d['license']){if(!_0xd7789d[_0xd9cc('0x2b')]){if(_0xd7789d[_0xd9cc('0x2f')]==_0x1f2727){GRAY_PERIOD_REASON=_0xd9cc('0x30');logger['info'](_0xd9cc('0x31'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0xd7789d[_0xd9cc('0x2f')];logger[_0xd9cc('0x2c')](_0xd9cc('0x32'),_0xd7789d['data1'],_0x1f2727);}sendJiraAlert(_0xd7789d[_0xd9cc('0x2f')],_0x13a163[_0xd9cc('0x33')],GRAY_PERIOD_REASON);logger[_0xd9cc('0x2c')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0xd9cc('0x34')](),moment()[_0xd9cc('0xa')](_0xd9cc('0x35')));return _0xe78722[_0xd9cc('0x18')]({'data2':encryptDate(moment()[_0xd9cc('0xa')](_0xd9cc('0x35')))});}else{if(moment()[_0xd9cc('0x36')](decryptDate(_0xd7789d['data2']),_0xd9cc('0x37'))>DAYS){logger[_0xd9cc('0x2c')](_0xd9cc('0x38'),moment()['format'](_0xd9cc('0x35')));return _0xe78722[_0xd9cc('0x18')]({'data1':_0x1f2727,'data2':null,'license':null});}}}else{if(_0xd7789d[_0xd9cc('0x2f')]!=_0x1f2727){logger[_0xd9cc('0x2c')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xd7789d[_0xd9cc('0x2f')],_0x1f2727);return _0xe78722[_0xd9cc('0x18')]({'data1':_0x1f2727,'data2':null,'license':null});}}}return _0xe78722;})[_0xd9cc('0xf')](function(_0x6b3eca){_0xe78722=_0x6b3eca;})[_0xd9cc('0x10')](function(_0x120887){logger[_0xd9cc('0x39')](_0x120887[_0xd9cc('0x3a')]);})[_0xd9cc('0x3b')](function(){setTimeout(function(){manageLicense(hardware[_0xd9cc('0x3c')](),_0xe78722);},TIME);});}function defaultLicense(){var _0x438ad2=hardware['getUuid']();if(_0x438ad2){return db[_0xd9cc('0x3d')][_0xd9cc('0x3e')]({'where':{'id':0x1},'defaults':{'data1':_0x438ad2}})[_0xd9cc('0x3f')](function(_0x1667c3,_0x171e49){logger[_0xd9cc('0x2c')]('SERVICE\x20LICENSE\x20STARTED\x20%s',_0x438ad2);manageLicense(_0x438ad2,_0x1667c3);})[_0xd9cc('0x10')](function(_0x31fe93){logger[_0xd9cc('0x39')](_0x31fe93[_0xd9cc('0x3a')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 980c453..aeae6b3 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 _0x70a5=['util','lodash','./hardware','../environment','license','isEmpty','data1','data2','split','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','final','demo','uuid','machineUuid','getUuid','createDecipher','session','gray','deadline','add','grayReason','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','getLicense','defaults','then','checkLicense'];(function(_0xcd2f16,_0x2af5a5){var _0x1e190e=function(_0x4b11d2){while(--_0x4b11d2){_0xcd2f16['push'](_0xcd2f16['shift']());}};_0x1e190e(++_0x2af5a5);}(_0x70a5,0x1ea));var _0x570a=function(_0x320fff,_0x4fb168){_0x320fff=_0x320fff-0x0;var _0x19cee2=_0x70a5[_0x320fff];return _0x19cee2;};'use strict';var crypto=require('crypto');var util=require(_0x570a('0x0'));var _=require(_0x570a('0x1'));var moment=require('moment');var hardware=require(_0x570a('0x2'));var config=require(_0x570a('0x3'));var db=require('../../mysqldb')['db'];function checkLicense(_0x36d249,_0x3b20d2){if(_0x36d249){try{var _0x37957c=_0x3b20d2||_0x36d249[_0x570a('0x4')];if(_[_0x570a('0x5')](_0x37957c)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x34713f=_0x36d249[_0x570a('0x6')];var _0x31d72b=_0x36d249[_0x570a('0x7')];var _0x2ef0f2=_0x34713f[_0x570a('0x8')]('-')[0x4];var _0x478276=_0x34713f['split']('-')[0x0];var _0x2773c7=crypto['createDecipher'](_0x570a('0x9'),util[_0x570a('0xa')](_0x570a('0xb'),_0x2ef0f2,_0x34713f,_0x478276));var _0x4ef1b3=_0x2773c7[_0x570a('0xc')](_0x37957c,_0x570a('0xd'),_0x570a('0xe'));_0x4ef1b3+=_0x2773c7[_0x570a('0xf')]('utf8');var _0x4431fd=JSON['parse'](_0x4ef1b3);_0x4431fd[_0x570a('0x10')]=![];_0x4431fd[_0x570a('0x11')]=_0x34713f;_0x4431fd[_0x570a('0x12')]=hardware[_0x570a('0x13')]();if(_0x31d72b){var _0x35e3fb=crypto[_0x570a('0x14')]('aes-256-ctr',config['secrets'][_0x570a('0x15')]);var _0x129ddd=_0x35e3fb[_0x570a('0xc')](_0x31d72b,_0x570a('0xd'),_0x570a('0xe'));_0x129ddd+=_0x35e3fb[_0x570a('0xf')](_0x570a('0xe'));_0x4431fd[_0x570a('0x16')]=_0x129ddd;_0x4431fd[_0x570a('0x17')]=moment(_0x129ddd)[_0x570a('0x18')](0x7,'days')[_0x570a('0xa')]();_0x4431fd[_0x570a('0x19')]=_0x4431fd[_0x570a('0x11')]!=_0x4431fd[_0x570a('0x12')]?'changed':_0x570a('0x1a');}return _0x4431fd;}catch(_0x51a173){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x570a('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x570a('0x1c'),'uuid':_0x36d249[_0x570a('0x6')],'machineUuid':hardware[_0x570a('0x13')](),'message':_0x51a173[_0x570a('0x1d')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x570a('0x1b'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x570a('0x1e'),'uuid':_0x36d249[_0x570a('0x6')],'machineUuid':hardware[_0x570a('0x13')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x570a('0x1f')]=function(_0x5c8a72){return db['License']['find'](_[_0x570a('0x20')](_0x5c8a72,{'raw':!![],'where':{'id':0x1}}))[_0x570a('0x21')](function(_0x5066d1){return checkLicense(_0x5066d1,null);});};exports[_0x570a('0x22')]=checkLicense; \ No newline at end of file +var _0x1b92=['secrets','session','base64','gray','add','days','grayReason','changed','disabled','2027-01-01T00:00:00.000Z','Breaking\x20license','message','Demo\x20license','License','defaults','then','checkLicense','crypto','util','moment','../environment','../../mysqldb','license','data1','data2','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','utf8','final','parse','uuid','machineUuid','getUuid'];(function(_0x8ff149,_0x506584){var _0x167a0c=function(_0x1009c3){while(--_0x1009c3){_0x8ff149['push'](_0x8ff149['shift']());}};_0x167a0c(++_0x506584);}(_0x1b92,0x114));var _0x21b9=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x1b92[_0x19950b];return _0x3c6b41;};'use strict';var crypto=require(_0x21b9('0x0'));var util=require(_0x21b9('0x1'));var _=require('lodash');var moment=require(_0x21b9('0x2'));var hardware=require('./hardware');var config=require(_0x21b9('0x3'));var db=require(_0x21b9('0x4'))['db'];function checkLicense(_0x59a55e,_0x453ff2){if(_0x59a55e){try{var _0x2b8120=_0x453ff2||_0x59a55e[_0x21b9('0x5')];if(_['isEmpty'](_0x2b8120)){throw new Error('License\x20key\x20value\x20not\x20found');}var _0x22a04e=_0x59a55e[_0x21b9('0x6')];var _0x1f2649=_0x59a55e[_0x21b9('0x7')];var _0x1ef0d7=_0x22a04e[_0x21b9('0x8')]('-')[0x4];var _0x564317=_0x22a04e['split']('-')[0x0];var _0x3e4072=crypto[_0x21b9('0x9')](_0x21b9('0xa'),util[_0x21b9('0xb')](_0x21b9('0xc'),_0x1ef0d7,_0x22a04e,_0x564317));var _0x20a85f=_0x3e4072[_0x21b9('0xd')](_0x2b8120,'base64',_0x21b9('0xe'));_0x20a85f+=_0x3e4072[_0x21b9('0xf')](_0x21b9('0xe'));var _0x36944d=JSON[_0x21b9('0x10')](_0x20a85f);_0x36944d['demo']=![];_0x36944d[_0x21b9('0x11')]=_0x22a04e;_0x36944d[_0x21b9('0x12')]=hardware[_0x21b9('0x13')]();if(_0x1f2649){var _0xbeff3f=crypto[_0x21b9('0x9')](_0x21b9('0xa'),config[_0x21b9('0x14')][_0x21b9('0x15')]);var _0x39bff0=_0xbeff3f['update'](_0x1f2649,_0x21b9('0x16'),_0x21b9('0xe'));_0x39bff0+=_0xbeff3f[_0x21b9('0xf')]('utf8');_0x36944d[_0x21b9('0x17')]=_0x39bff0;_0x36944d['deadline']=moment(_0x39bff0)[_0x21b9('0x18')](0x7,_0x21b9('0x19'))['format']();_0x36944d[_0x21b9('0x1a')]=_0x36944d[_0x21b9('0x11')]!=_0x36944d[_0x21b9('0x12')]?_0x21b9('0x1b'):_0x21b9('0x1c');}return _0x36944d;}catch(_0x31459b){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x21b9('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0x21b9('0x1e'),'uuid':_0x59a55e[_0x21b9('0x6')],'machineUuid':hardware[_0x21b9('0x13')](),'message':_0x31459b[_0x21b9('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x21b9('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x21b9('0x20'),'uuid':_0x59a55e[_0x21b9('0x6')],'machineUuid':hardware[_0x21b9('0x13')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x1770d4){return db[_0x21b9('0x21')]['find'](_[_0x21b9('0x22')](_0x1770d4,{'raw':!![],'where':{'id':0x1}}))[_0x21b9('0x23')](function(_0x30be23){return checkLicense(_0x30be23,null);});};exports[_0x21b9('0x24')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index edaaefd..86f8e18 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 _0xc0d8=['myappanuglar-secret','app-id','exports','http://localhost:9000'];(function(_0x4d0296,_0x4a7336){var _0x431efe=function(_0x585ca4){while(--_0x585ca4){_0x4d0296['push'](_0x4d0296['shift']());}};_0x431efe(++_0x4a7336);}(_0xc0d8,0x6e));var _0x8c0d=function(_0x4090d0,_0x5021f3){_0x4090d0=_0x4090d0-0x0;var _0x4a18ed=_0xc0d8[_0x4090d0];return _0x4a18ed;};'use strict';module[_0x8c0d('0x0')]={'DOMAIN':_0x8c0d('0x1'),'SESSION_SECRET':_0x8c0d('0x2'),'GOOGLE_ID':_0x8c0d('0x3'),'GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0xd3f5=['http://localhost:9000','app-id','secret','exports'];(function(_0x18e3ce,_0x2df81f){var _0x468f38=function(_0x4ac672){while(--_0x4ac672){_0x18e3ce['push'](_0x18e3ce['shift']());}};_0x468f38(++_0x2df81f);}(_0xd3f5,0x147));var _0x5d3f=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xd3f5[_0x3b380d];return _0x54502b;};'use strict';module[_0x5d3f('0x0')]={'DOMAIN':_0x5d3f('0x1'),'SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':_0x5d3f('0x2'),'GOOGLE_SECRET':_0x5d3f('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index d20d58b..34fd2dc 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x45bd=['format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','debugLevel','moment','winston','util','path','INFO','join','/var','xcally','%s-%s.log'];(function(_0x487a93,_0x371b7e){var _0x4d798b=function(_0x54c046){while(--_0x54c046){_0x487a93['push'](_0x487a93['shift']());}};_0x4d798b(++_0x371b7e);}(_0x45bd,0x1af));var _0xd45b=function(_0x4e6bc6,_0x250d85){_0x4e6bc6=_0x4e6bc6-0x0;var _0x11d2ba=_0x45bd[_0x4e6bc6];return _0x11d2ba;};'use strict';var moment=require(_0xd45b('0x0'));var winston=require(_0xd45b('0x1'));var util=require(_0xd45b('0x2'));var path=require(_0xd45b('0x3'));var debugLevel=_0xd45b('0x4');function filename(_0x59dbf0,_0x51c72e){return path[_0xd45b('0x5')](_0xd45b('0x6'),'log',_0xd45b('0x7'),util['format'](_0xd45b('0x8'),_0x59dbf0,_0x51c72e));}function formatter(_0x428dba,_0x9b69c9){return util[_0xd45b('0x9')](_0xd45b('0xa'),moment()[_0xd45b('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),_0x9b69c9[_0xd45b('0xb')][_0xd45b('0xc')](),_0x428dba,_0x9b69c9['message']);}module[_0xd45b('0xd')]=function(_0x47c84b){return new winston[(_0xd45b('0xe'))]({'transports':[new winston[(_0xd45b('0xf'))][(_0xd45b('0x10'))]({'name':util[_0xd45b('0x9')](_0xd45b('0x11'),_0x47c84b,_0xd45b('0x12')),'filename':filename(_0x47c84b,_0xd45b('0x12')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1baac6){return formatter(_0x47c84b,_0x1baac6);}}),new winston[(_0xd45b('0xf'))][(_0xd45b('0x10'))]({'name':util[_0xd45b('0x9')]('%s-%s',_0x47c84b,_0xd45b('0x13')),'filename':filename(_0x47c84b,'info'),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x4313a8){return formatter(_0x47c84b,_0x4313a8);}}),new winston['transports'][(_0xd45b('0x14'))]({'level':process['env'][_0xd45b('0x15')]||debugLevel,'json':![],'formatter':function(_0xbdf374){return formatter(_0x47c84b,_0xbdf374);}})]});}; \ No newline at end of file +var _0xf7af=['%s-%s','error','info','Console','env','debugLevel','winston','util','path','INFO','/var','log','xcally','format','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','level','toUpperCase','message','exports','Logger','transports','File'];(function(_0x2cb848,_0x5be274){var _0x369cb4=function(_0x496c88){while(--_0x496c88){_0x2cb848['push'](_0x2cb848['shift']());}};_0x369cb4(++_0x5be274);}(_0xf7af,0x148));var _0xff7a=function(_0x253f62,_0x553f88){_0x253f62=_0x253f62-0x0;var _0x157422=_0xf7af[_0x253f62];return _0x157422;};'use strict';var moment=require('moment');var winston=require(_0xff7a('0x0'));var util=require(_0xff7a('0x1'));var path=require(_0xff7a('0x2'));var debugLevel=_0xff7a('0x3');function filename(_0x5b53ac,_0x229e1c){return path['join'](_0xff7a('0x4'),_0xff7a('0x5'),_0xff7a('0x6'),util[_0xff7a('0x7')](_0xff7a('0x8'),_0x5b53ac,_0x229e1c));}function formatter(_0x489182,_0x35c1b2){return util[_0xff7a('0x7')]('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0xff7a('0x9')),_0x35c1b2[_0xff7a('0xa')][_0xff7a('0xb')](),_0x489182,_0x35c1b2[_0xff7a('0xc')]);}module[_0xff7a('0xd')]=function(_0x41b198){return new winston[(_0xff7a('0xe'))]({'transports':[new winston[(_0xff7a('0xf'))][(_0xff7a('0x10'))]({'name':util[_0xff7a('0x7')](_0xff7a('0x11'),_0x41b198,'error'),'filename':filename(_0x41b198,_0xff7a('0x12')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xd8ef97){return formatter(_0x41b198,_0xd8ef97);}}),new winston[(_0xff7a('0xf'))]['File']({'name':util[_0xff7a('0x7')]('%s-%s',_0x41b198,'info'),'filename':filename(_0x41b198,_0xff7a('0x13')),'level':_0xff7a('0x13'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0xccc09d){return formatter(_0x41b198,_0xccc09d);}}),new winston[(_0xff7a('0xf'))][(_0xff7a('0x14'))]({'level':process[_0xff7a('0x15')][_0xff7a('0x16')]||debugLevel,'json':![],'formatter':function(_0x3e0f44){return formatter(_0x41b198,_0x3e0f44);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index cf25f71..b22e9b8 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 _0x4d5d=['join','../../services/express/index.js','ami','../../services/ami/index.js','agi','email','../../services/email/index.js','routing','../../services/xdr/index.js','path','express'];(function(_0x337aa0,_0x24a9af){var _0x288ef6=function(_0x21ee73){while(--_0x21ee73){_0x337aa0['push'](_0x337aa0['shift']());}};_0x288ef6(++_0x24a9af);}(_0x4d5d,0x111));var _0xd4d5=function(_0x5d184b,_0x1b04c5){_0x5d184b=_0x5d184b-0x0;var _0x5cee64=_0x4d5d[_0x5d184b];return _0x5cee64;};'use strict';var path=require(_0xd4d5('0x0'));var os=require('os');var config={'apps':[{'name':_0xd4d5('0x1'),'script':path[_0xd4d5('0x2')](__dirname,_0xd4d5('0x3'))},{'name':_0xd4d5('0x4'),'script':path['join'](__dirname,_0xd4d5('0x5'))},{'name':_0xd4d5('0x6'),'script':path['join'](__dirname,'../../services/agi/index.js')},{'name':_0xd4d5('0x7'),'script':path[_0xd4d5('0x2')](__dirname,_0xd4d5('0x8'))},{'name':_0xd4d5('0x9'),'script':path[_0xd4d5('0x2')](__dirname,'../../services/routing/index.js')},{'name':'xdr','script':path[_0xd4d5('0x2')](__dirname,_0xd4d5('0xa'))}]};module['exports']=config; \ No newline at end of file +var _0x8f69=['ami','../../services/ami/index.js','../../services/agi/index.js','../../services/email/index.js','routing','xdr','../../services/xdr/index.js','exports','path','express','join'];(function(_0x54ea6a,_0xe9cc51){var _0x479b07=function(_0x2cee5e){while(--_0x2cee5e){_0x54ea6a['push'](_0x54ea6a['shift']());}};_0x479b07(++_0xe9cc51);}(_0x8f69,0xfa));var _0x98f6=function(_0x48e1ec,_0x35f468){_0x48e1ec=_0x48e1ec-0x0;var _0x3b33eb=_0x8f69[_0x48e1ec];return _0x3b33eb;};'use strict';var path=require(_0x98f6('0x0'));var os=require('os');var config={'apps':[{'name':_0x98f6('0x1'),'script':path[_0x98f6('0x2')](__dirname,'../../services/express/index.js')},{'name':_0x98f6('0x3'),'script':path[_0x98f6('0x2')](__dirname,_0x98f6('0x4'))},{'name':'agi','script':path['join'](__dirname,_0x98f6('0x5'))},{'name':'email','script':path[_0x98f6('0x2')](__dirname,_0x98f6('0x6'))},{'name':_0x98f6('0x7'),'script':path[_0x98f6('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x98f6('0x8'),'script':path[_0x98f6('0x2')](__dirname,_0x98f6('0x9'))}]};module[_0x98f6('0xa')]=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 10f4a2c..dc0dbb1 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 _0xdcf0=['describe','delete','dump','saved','pm2','bluebird','then','start','stop','disconnect','restart','list'];(function(_0x21aec3,_0x5c97e9){var _0x288bbc=function(_0x2283fe){while(--_0x2283fe){_0x21aec3['push'](_0x21aec3['shift']());}};_0x288bbc(++_0x5c97e9);}(_0xdcf0,0xb8));var _0x0dcf=function(_0x4bce00,_0x534bbe){_0x4bce00=_0x4bce00-0x0;var _0x8b51fd=_0xdcf0[_0x4bce00];return _0x8b51fd;};'use strict';var pm2=require(_0x0dcf('0x0'));var BPromise=require(_0x0dcf('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x11183d,_0x4390bb){return pm2['connect'](function(_0x41aea7){if(_0x41aea7){return _0x4390bb(_0x41aea7);}return _0x11183d('connected');});});};exports['start']=function(_0x388fc3){return connect()[_0x0dcf('0x2')](function(){return new BPromise(function(_0x235ad2,_0x2586c8){return pm2[_0x0dcf('0x3')](_0x388fc3,function(_0x598cf5,_0x9809c2){if(_0x598cf5){return _0x2586c8(_0x598cf5);}pm2['disconnect']();return _0x235ad2(_0x9809c2);});});});};exports[_0x0dcf('0x4')]=function(_0x222ffa){return connect()[_0x0dcf('0x2')](function(){return new BPromise(function(_0x2e7582,_0x17e8d6){return pm2[_0x0dcf('0x4')](_0x222ffa,function(_0xdf6576,_0x54cf11){if(_0xdf6576){return _0x17e8d6(_0xdf6576);}pm2[_0x0dcf('0x5')]();return _0x2e7582(_0x54cf11);});});});};exports[_0x0dcf('0x6')]=function(_0x1a7a1a){return connect()[_0x0dcf('0x2')](function(){return new BPromise(function(_0x13edc1,_0x4eeb2a){return pm2['restart'](_0x1a7a1a,function(_0x4106cf,_0x56b665){if(_0x4106cf){return _0x4eeb2a(_0x4106cf);}pm2['disconnect']();return _0x13edc1(_0x56b665);});});});};exports[_0x0dcf('0x7')]=function(){return connect()[_0x0dcf('0x2')](function(){return new BPromise(function(_0x740f1e,_0x1e5cb1){return pm2[_0x0dcf('0x7')](function(_0x250ee8,_0x2f7443){if(_0x250ee8){return _0x1e5cb1(_0x250ee8);}pm2[_0x0dcf('0x5')]();return _0x740f1e(_0x2f7443);});});});};exports['describe']=function(_0xf8c74e){return connect()['then'](function(){return new BPromise(function(_0x522ce5,_0x27df28){return pm2[_0x0dcf('0x8')](_0xf8c74e,function(_0x33327a,_0x37f3b0){if(_0x33327a){return _0x27df28(_0x33327a);}pm2['disconnect']();return _0x522ce5(_0x37f3b0);});});});};exports[_0x0dcf('0x9')]=function(_0x32f1a0){return connect()[_0x0dcf('0x2')](function(){return new BPromise(function(_0x70ade7,_0x161188){return pm2[_0x0dcf('0x9')](_0x32f1a0,function(_0x20fda2,_0x3b4e0c){if(_0x20fda2){return _0x161188(_0x20fda2);}pm2[_0x0dcf('0x5')]();return _0x70ade7(_0x3b4e0c);});});});};exports[_0x0dcf('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x236502,_0x399c47){return pm2['dump'](function(_0x45df54){if(_0x45df54){return _0x399c47(_0x45df54);}return _0x236502(_0x0dcf('0xb'));});});});}; \ No newline at end of file +var _0x0c75=['dump','saved','bluebird','connect','connected','start','disconnect','stop','restart','list','then','describe','delete'];(function(_0x2e2857,_0x2c8066){var _0x294569=function(_0x439aba){while(--_0x439aba){_0x2e2857['push'](_0x2e2857['shift']());}};_0x294569(++_0x2c8066);}(_0x0c75,0x6a));var _0x50c7=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0c75[_0x2641f9];return _0x585741;};'use strict';var pm2=require('pm2');var BPromise=require(_0x50c7('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x2d00bd,_0x14220a){return pm2[_0x50c7('0x1')](function(_0x23b0ec){if(_0x23b0ec){return _0x14220a(_0x23b0ec);}return _0x2d00bd(_0x50c7('0x2'));});});};exports[_0x50c7('0x3')]=function(_0x3c0314){return connect()['then'](function(){return new BPromise(function(_0x4b982e,_0x4c062f){return pm2[_0x50c7('0x3')](_0x3c0314,function(_0x594830,_0x34a297){if(_0x594830){return _0x4c062f(_0x594830);}pm2[_0x50c7('0x4')]();return _0x4b982e(_0x34a297);});});});};exports[_0x50c7('0x5')]=function(_0x53ef83){return connect()['then'](function(){return new BPromise(function(_0xbd0521,_0x474dc0){return pm2[_0x50c7('0x5')](_0x53ef83,function(_0x3fba1a,_0x3dcf76){if(_0x3fba1a){return _0x474dc0(_0x3fba1a);}pm2[_0x50c7('0x4')]();return _0xbd0521(_0x3dcf76);});});});};exports[_0x50c7('0x6')]=function(_0x4fde1f){return connect()['then'](function(){return new BPromise(function(_0x1b68f3,_0x6f2486){return pm2[_0x50c7('0x6')](_0x4fde1f,function(_0x5d07b8,_0x2a6ef2){if(_0x5d07b8){return _0x6f2486(_0x5d07b8);}pm2[_0x50c7('0x4')]();return _0x1b68f3(_0x2a6ef2);});});});};exports[_0x50c7('0x7')]=function(){return connect()[_0x50c7('0x8')](function(){return new BPromise(function(_0x1e2dc5,_0x50c690){return pm2['list'](function(_0x2d27dc,_0x303a64){if(_0x2d27dc){return _0x50c690(_0x2d27dc);}pm2['disconnect']();return _0x1e2dc5(_0x303a64);});});});};exports[_0x50c7('0x9')]=function(_0x1f1db1){return connect()[_0x50c7('0x8')](function(){return new BPromise(function(_0x4f092a,_0x552ffe){return pm2[_0x50c7('0x9')](_0x1f1db1,function(_0x150095,_0xc4d7f5){if(_0x150095){return _0x552ffe(_0x150095);}pm2['disconnect']();return _0x4f092a(_0xc4d7f5);});});});};exports[_0x50c7('0xa')]=function(_0x41024d){return connect()[_0x50c7('0x8')](function(){return new BPromise(function(_0x5d30db,_0xd5b365){return pm2['delete'](_0x41024d,function(_0xd67dee,_0x415f45){if(_0xd67dee){return _0xd5b365(_0xd67dee);}pm2[_0x50c7('0x4')]();return _0x5d30db(_0x415f45);});});});};exports[_0x50c7('0xb')]=function(){return connect()['then'](function(){return new BPromise(function(_0x59bbba,_0x526053){return pm2[_0x50c7('0xb')](function(_0xdea1fd){if(_0xdea1fd){return _0x526053(_0xdea1fd);}return _0x59bbba(_0x50c7('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index effc688..964d2c3 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 _0x1f10=['ioredis','../../mysqldb','../../config/environment','defaults','localhost','socket.io-emitter','redis','Setting','find','chatTimeout','then','ChatInteraction','findAll','minutes','system','timeout','format','map','length','emit','chatInteraction:update','catch','error','lodash','moment'];(function(_0x31125a,_0xe259e3){var _0x24a969=function(_0x36d685){while(--_0x36d685){_0x31125a['push'](_0x31125a['shift']());}};_0x24a969(++_0xe259e3);}(_0x1f10,0x1c0));var _0x01f1=function(_0x211186,_0x1c4fdd){_0x211186=_0x211186-0x0;var _0x3d812c=_0x1f10[_0x211186];return _0x3d812c;};'use strict';var _=require(_0x01f1('0x0'));var moment=require(_0x01f1('0x1'));var Redis=require(_0x01f1('0x2'));var db=require(_0x01f1('0x3'))['db'];var config=require(_0x01f1('0x4'));config['redis']=_[_0x01f1('0x5')](config['redis'],{'host':_0x01f1('0x6'),'port':0x18eb});var io=require(_0x01f1('0x7'))(new Redis(config[_0x01f1('0x8')]));function closeInteractions(){var _0x1ba281=0x0;var _0x2411ae=[];return db[_0x01f1('0x9')][_0x01f1('0xa')]({'raw':!![],'attributes':['id',_0x01f1('0xb')],'where':{'id':0x1}})[_0x01f1('0xc')](function(_0x53bd53){_0x1ba281=_0x53bd53[_0x01f1('0xb')];if(_0x1ba281){return db[_0x01f1('0xd')][_0x01f1('0xe')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()['subtract'](_0x53bd53[_0x01f1('0xb')],_0x01f1('0xf'))}}});}else{return[];}})[_0x01f1('0xc')](function(_0x44d66b){_0x2411ae=_0x44d66b;if(_0x1ba281){return db['ChatInteraction']['update']({'closeReason':_0x01f1('0x10'),'disposition':_0x01f1('0x11'),'closed':!![],'closedAt':moment()[_0x01f1('0x12')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0x01f1('0x13')](_0x2411ae||[],'id')}});}})[_0x01f1('0xc')](function(_0x1ad7c9){for(var _0x36fa4f=0x0;_0x36fa4f<_0x2411ae[_0x01f1('0x14')];_0x36fa4f++){io[_0x01f1('0x15')](_0x01f1('0x16'),{'id':_0x2411ae[_0x36fa4f]['id'],'closed':!![]});}})[_0x01f1('0x17')](function(_0x33438e){console[_0x01f1('0x18')](_0x33438e);});}exports['start']=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0x8a47=['localhost','socket.io-emitter','Setting','find','chatTimeout','then','findAll','lastMsgAt','subtract','ChatInteraction','update','system','timeout','format','map','length','emit','catch','error','start','lodash','moment','ioredis','../../mysqldb','../../config/environment','defaults','redis'];(function(_0x59e611,_0xd33a21){var _0x491ad7=function(_0x421ee9){while(--_0x421ee9){_0x59e611['push'](_0x59e611['shift']());}};_0x491ad7(++_0xd33a21);}(_0x8a47,0xd1));var _0x78a4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x8a47[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x78a4('0x0'));var moment=require(_0x78a4('0x1'));var Redis=require(_0x78a4('0x2'));var db=require(_0x78a4('0x3'))['db'];var config=require(_0x78a4('0x4'));config['redis']=_[_0x78a4('0x5')](config[_0x78a4('0x6')],{'host':_0x78a4('0x7'),'port':0x18eb});var io=require(_0x78a4('0x8'))(new Redis(config['redis']));function closeInteractions(){var _0x1ed7ea=0x0;var _0x413364=[];return db[_0x78a4('0x9')][_0x78a4('0xa')]({'raw':!![],'attributes':['id',_0x78a4('0xb')],'where':{'id':0x1}})[_0x78a4('0xc')](function(_0x5325a8){_0x1ed7ea=_0x5325a8['chatTimeout'];if(_0x1ed7ea){return db['ChatInteraction'][_0x78a4('0xd')]({'raw':!![],'attributes':['id',_0x78a4('0xe')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x78a4('0xf')](_0x5325a8[_0x78a4('0xb')],'minutes')}}});}else{return[];}})['then'](function(_0x51d754){_0x413364=_0x51d754;if(_0x1ed7ea){return db[_0x78a4('0x10')][_0x78a4('0x11')]({'closeReason':_0x78a4('0x12'),'disposition':_0x78a4('0x13'),'closed':!![],'closedAt':moment()[_0x78a4('0x14')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0x78a4('0x15')](_0x413364||[],'id')}});}})[_0x78a4('0xc')](function(_0xe6555e){for(var _0x57884a=0x0;_0x57884a<_0x413364[_0x78a4('0x16')];_0x57884a++){io[_0x78a4('0x17')]('chatInteraction:update',{'id':_0x413364[_0x57884a]['id'],'closed':!![]});}})[_0x78a4('0x18')](function(_0x21250a){console[_0x78a4('0x19')](_0x21250a);});}exports[_0x78a4('0x1a')]=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 bf9ae14..1c0408b 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 _0x51e3=['intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','run\x20job','cron','active','isBetween','startAt','add','start','add\x20cron','stop\x20cron','endAt','run','util','path','lodash','moment','cron-job-manager','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','service','Smtp','host','port','secure','authentication','auth','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','join','../../files/reports','savename','%s.%s','basename','zip','existsSync','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','empty\x20file,\x20email\x20not\x20sent','request','error','catch','error\x20mail','data','isNil','subtractNumber','subtractNumber\x20null\x20or\x20undefined','subtractUnit\x20null\x20or\x20undefined','subtract','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','then','no\x20report\x20id','Schedule','keys','jobs','map','toString','difference'];(function(_0x2c62da,_0x520694){var _0x21e77f=function(_0x9d8765){while(--_0x9d8765){_0x2c62da['push'](_0x2c62da['shift']());}};_0x21e77f(++_0x520694);}(_0x51e3,0x174));var _0x351e=function(_0x5639c7,_0x458071){_0x5639c7=_0x5639c7-0x0;var _0x300ba1=_0x51e3[_0x5639c7];return _0x300ba1;};'use strict';var fs=require('fs');var util=require(_0x351e('0x0'));var path=require(_0x351e('0x1'));var _=require(_0x351e('0x2'));var moment=require(_0x351e('0x3'));var CronJobManager=require(_0x351e('0x4'));var jayson=require('jayson/promise');var BPromise=require(_0x351e('0x5'));var logger=require(_0x351e('0x6'))(_0x351e('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0x351e('0x8'));var analyticDefaultReportController=require(_0x351e('0x9'));var client=jayson[_0x351e('0xa')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x3253a1,_0x109eaf){return function(){logger[_0x351e('0xb')](_0x351e('0xc'),_0x3253a1[_0x351e('0xd')]);var _0x219a8e=!![];var _0x30ea1d={'tls':{'rejectUnauthorized':![]}};if(_0x3253a1[_0x351e('0xe')]['Smtp']['service']){_0x30ea1d[_0x351e('0xf')]=_0x3253a1['MailAccount'][_0x351e('0x10')][_0x351e('0xf')];}else{_0x30ea1d[_0x351e('0x11')]=_0x3253a1['MailAccount'][_0x351e('0x10')][_0x351e('0x11')];_0x30ea1d[_0x351e('0x12')]=_0x3253a1[_0x351e('0xe')]['Smtp'][_0x351e('0x12')];_0x30ea1d['secure']=_0x3253a1[_0x351e('0xe')]['Smtp'][_0x351e('0x13')];}if(_0x3253a1[_0x351e('0xe')][_0x351e('0x10')][_0x351e('0x14')]){_0x30ea1d[_0x351e('0x15')]={'user':_0x3253a1[_0x351e('0xe')][_0x351e('0x10')]['user'],'pass':_0x3253a1[_0x351e('0xe')][_0x351e('0x10')]['pass']};}var _0x3d9811={'account':_0x30ea1d,'message':{'from':util[_0x351e('0x16')](_0x351e('0x17'),_0x3253a1[_0x351e('0xe')][_0x351e('0x18')],_0x3253a1['MailAccount']['email']||_0x3253a1[_0x351e('0xe')][_0x351e('0x10')][_0x351e('0x19')]),'to':_0x3253a1[_0x351e('0xd')],'cc':_0x3253a1['cc'],'bcc':_0x3253a1[_0x351e('0x1a')],'subject':util[_0x351e('0x16')](_0x351e('0x1b'),_0x109eaf[_0x351e('0x18')],_0x3253a1['subtractNumber'],_0x3253a1[_0x351e('0x1c')])}};var _0x34eaf6=path[_0x351e('0x1d')](__dirname,_0x351e('0x1e'));var _0x28cca9=_0x109eaf[_0x351e('0x1f')];var _0x11fff3=util[_0x351e('0x16')](_0x351e('0x20'),path[_0x351e('0x21')](_0x109eaf['savename'],path['extname'](_0x109eaf[_0x351e('0x1f')])),_0x351e('0x22'));var _0x3eed73=path[_0x351e('0x1d')](_0x34eaf6,_0x28cca9);var _0x613af6=path['join'](_0x34eaf6,_0x11fff3);if(fs[_0x351e('0x23')](_0x3eed73)){_0x109eaf['status']=_0x351e('0x24');_0x3d9811[_0x351e('0x25')][_0x351e('0x26')]=[{'filename':_0x28cca9,'path':_0x3eed73}];_0x3d9811[_0x351e('0x25')][_0x351e('0x27')]=util[_0x351e('0x16')](_0x351e('0x28'),JSON[_0x351e('0x29')](_0x109eaf,null,0x2));}else if(fs[_0x351e('0x23')](_0x613af6)){_0x109eaf['status']='Sent';_0x3d9811[_0x351e('0x25')][_0x351e('0x26')]=[{'filename':_0x11fff3,'path':_0x613af6}];}else{_0x3d9811[_0x351e('0x25')][_0x351e('0x27')]=_0x351e('0x2a');if(!_0x3253a1['sendIfEmpty']){_0x219a8e=![];logger[_0x351e('0xb')](_0x351e('0x2b'));}}if(_0x219a8e){return client[_0x351e('0x2c')]('SendMail',_0x3d9811)['then'](function(_0x562c9e){if(_0x562c9e[_0x351e('0x2d')]){return logger[_0x351e('0x2d')]('error\x20mail',JSON['stringify'](_0x562c9e));}return logger[_0x351e('0xb')]('email\x20sent');})[_0x351e('0x2e')](function(_0x1e3cb5){return logger[_0x351e('0x2d')](_0x351e('0x2f'),JSON[_0x351e('0x29')](_0x1e3cb5));});}};}function handleError(){return function(_0x2c5799){return logger[_0x351e('0x2d')](JSON[_0x351e('0x29')](_0x2c5799));};}function handleResult(_0x4ec925){return function(_0xd4a77e){logger[_0x351e('0xb')](_0x351e('0x30'),JSON[_0x351e('0x29')](_0xd4a77e));if(_0x4ec925[_0x351e('0xe')]&&_0x4ec925[_0x351e('0xe')][_0x351e('0x10')]&&!_[_0x351e('0x31')](_0x4ec925[_0x351e('0xd')])){setTimeout(handleSendEmail(_0x4ec925,_0xd4a77e),0x3c*0x3e8);}};}function handleJob(_0x59d86f){return function(){try{if(_[_0x351e('0x31')](_0x59d86f[_0x351e('0x32')])){return logger[_0x351e('0xb')](_0x351e('0x33'));}if(_['isNil'](_0x59d86f[_0x351e('0x1c')])){return logger[_0x351e('0xb')](_0x351e('0x34'));}var _0x36f984={'startDate':moment()[_0x351e('0x35')](_0x59d86f[_0x351e('0x32')],_0x59d86f[_0x351e('0x1c')])[_0x351e('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x351e('0x16')]('YYYY-MM-DD\x20HH:mm:ss'),'type':'scheduled','output':_0x59d86f[_0x351e('0x36')],'name':_0x59d86f['name']};if(!_['isNil'](_0x59d86f[_0x351e('0x37')])){logger[_0x351e('0xb')](_0x351e('0x38'),_0x59d86f[_0x351e('0x37')]);return analyticDefaultReportController[_0x351e('0x39')]({'id':_0x59d86f[_0x351e('0x37')]},_0x36f984)['then'](handleResult(_0x59d86f))['catch'](handleError());}if(!_[_0x351e('0x31')](_0x59d86f[_0x351e('0x3a')])){logger[_0x351e('0xb')](_0x351e('0x3b'),_0x59d86f[_0x351e('0x3a')]);return analyticCustomReportController[_0x351e('0x39')]({'id':_0x59d86f[_0x351e('0x3a')]},_0x36f984)[_0x351e('0x3c')](handleResult(_0x59d86f))[_0x351e('0x2e')](handleError());}}catch(_0x35ebc9){logger[_0x351e('0x2d')](JSON[_0x351e('0x29')](_0x35ebc9));}return logger[_0x351e('0xb')](_0x351e('0x3d'));};}function getJobs(_0x1009cd){var _0x4a0747={};if(_0x1009cd){_0x4a0747['id']=_0x1009cd;}return db[_0x351e('0x3e')]['findAll']({'where':_0x4a0747,'include':[{'model':db[_0x351e('0xe')],'attributes':['id',_0x351e('0x18'),_0x351e('0xd')],'include':[{'model':db['MailServerOut'],'as':_0x351e('0x10')}]}]})[_0x351e('0x3c')](function(_0x3c47b2){var _0x3fffe3=_[_0x351e('0x3f')](manager[_0x351e('0x40')]);var _0x495ba9=_[_0x351e('0x41')](_0x3c47b2,function(_0x4d18f8){return _0x4d18f8['id'][_0x351e('0x42')]();});var _0x2e3532=_['keyBy'](_0x3c47b2,function(_0x355e71){return _0x355e71['id'][_0x351e('0x42')]();});var _0xcf7edf=_0x1009cd?_0x495ba9:_[_0x351e('0x43')](_0x495ba9,_0x3fffe3);var _0x1b3d3d=_[_0x351e('0x44')](_0x495ba9,_0x3fffe3);var _0x4aaa36=_[_0x351e('0x43')](_0x3fffe3,_0x495ba9);var _0x5c332d;var _0x3c66be;for(_0x5c332d=0x0;_0x5c332d<_0x4aaa36[_0x351e('0x45')]&&!_0x1009cd;_0x5c332d+=0x1){_0x3c66be=_0x4aaa36[_0x5c332d][_0x351e('0x42')]();if(manager[_0x351e('0x46')](_0x3c66be)){manager[_0x351e('0x47')](_0x3c66be);manager[_0x351e('0x48')](_0x3c66be);logger[_0x351e('0xb')](_0x351e('0x49'),_0x3c66be);}}logger['info'](_0x351e('0x4a'),JSON[_0x351e('0x29')](_0xcf7edf));for(_0x5c332d=0x0;_0x5c332d<_0xcf7edf[_0x351e('0x45')];_0x5c332d+=0x1){_0x3c66be=_0xcf7edf[_0x5c332d][_0x351e('0x42')]();logger['info'](_0x351e('0x4b'),_0x3c66be);if(_0x1009cd){logger[_0x351e('0xb')](_0x351e('0x4c'),_0x1009cd);logger[_0x351e('0xb')](JSON[_0x351e('0x29')](_0x2e3532[_0x3c66be]));BPromise['resolve']()[_0x351e('0x3c')](handleJob(_0x2e3532[_0x3c66be]));logger[_0x351e('0xb')](_0x351e('0x4d'),_0x2e3532[_0x3c66be][_0x351e('0x18')],_0x2e3532[_0x3c66be][_0x351e('0x4e')]);}else if(_0x2e3532[_0x3c66be][_0x351e('0x4e')]&&_0x2e3532[_0x3c66be][_0x351e('0x4f')]&&moment()[_0x351e('0x50')](_0x2e3532[_0x3c66be][_0x351e('0x51')],_0x2e3532[_0x3c66be]['endAt'])){manager[_0x351e('0x52')](_0x3c66be,_0x2e3532[_0x3c66be][_0x351e('0x4e')],handleJob(_0x2e3532[_0x3c66be]));manager[_0x351e('0x53')](_0x3c66be);logger['info'](_0x351e('0x54'),_0x2e3532[_0x3c66be][_0x351e('0x18')],_0x2e3532[_0x3c66be][_0x351e('0x4e')]);}else if(manager[_0x351e('0x46')](_0x3c66be)){manager[_0x351e('0x47')](_0x3c66be);manager[_0x351e('0x48')](_0x3c66be);logger[_0x351e('0xb')](_0x351e('0x55'),_0x2e3532[_0x3c66be][_0x351e('0x18')],_0x2e3532[_0x3c66be]['cron']);}}for(_0x5c332d=0x0,_0x3c66be;_0x5c332d<_0x1b3d3d[_0x351e('0x45')]&&!_0x1009cd;_0x5c332d+=0x1){_0x3c66be=_0x1b3d3d[_0x5c332d][_0x351e('0x42')]();if(manager['exists'](_0x3c66be)){if(_0x2e3532[_0x3c66be]['cron']&&_0x2e3532[_0x3c66be][_0x351e('0x4f')]&&moment()[_0x351e('0x50')](_0x2e3532[_0x3c66be][_0x351e('0x51')],_0x2e3532[_0x3c66be][_0x351e('0x56')])){manager['update'](_0x3c66be,_0x2e3532[_0x3c66be]['cron'],handleJob(_0x2e3532[_0x3c66be]));logger[_0x351e('0xb')]('update\x20cron',_0x2e3532[_0x3c66be][_0x351e('0x18')],_0x2e3532[_0x3c66be][_0x351e('0x4e')]);}else{manager['stop'](_0x3c66be);manager[_0x351e('0x48')](_0x3c66be);logger[_0x351e('0xb')](_0x351e('0x55'),_0x2e3532[_0x3c66be][_0x351e('0x18')],_0x2e3532[_0x3c66be][_0x351e('0x4e')]);}}}})[_0x351e('0x2e')](function(_0xd4853a){logger[_0x351e('0x2d')](JSON['stringify'](_0xd4853a));});}exports[_0x351e('0x57')]=function(_0x4be6f1){return getJobs(_0x4be6f1);};exports[_0x351e('0x53')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x7c1d=['subtractNumber\x20null\x20or\x20undefined','subtractUnit','subtractUnit\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','scheduled','exec\x20defaul\x20report\x20id:%s','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','intersection','difference','length','exists','delete\x20cron','run\x20job','active','startAt','endAt','add','cron','start','add\x20cron','deleteJob','isBetween','update\x20cron','stop\x20cron','run','util','path','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','pass','name','user','subtractNumber','join','../../files/reports','savename','basename','extname','zip','existsSync','status','Sent','attachments','message','text','format','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','request','then','error','error\x20mail','email\x20sent','catch','data','isNil'];(function(_0x3e1099,_0x17a744){var _0x212153=function(_0x4c78e4){while(--_0x4c78e4){_0x3e1099['push'](_0x3e1099['shift']());}};_0x212153(++_0x17a744);}(_0x7c1d,0xce));var _0xd7c1=function(_0x5d892b,_0x2ec5ff){_0x5d892b=_0x5d892b-0x0;var _0x32d199=_0x7c1d[_0x5d892b];return _0x32d199;};'use strict';var fs=require('fs');var util=require(_0xd7c1('0x0'));var path=require(_0xd7c1('0x1'));var _=require('lodash');var moment=require(_0xd7c1('0x2'));var CronJobManager=require(_0xd7c1('0x3'));var jayson=require(_0xd7c1('0x4'));var BPromise=require(_0xd7c1('0x5'));var logger=require(_0xd7c1('0x6'))(_0xd7c1('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require(_0xd7c1('0x8'));var analyticDefaultReportController=require(_0xd7c1('0x9'));var client=jayson['client'][_0xd7c1('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x5a6921,_0x587131){return function(){logger[_0xd7c1('0xb')](_0xd7c1('0xc'),_0x5a6921[_0xd7c1('0xd')]);var _0x417716=!![];var _0x5be9f4={'tls':{'rejectUnauthorized':![]}};if(_0x5a6921[_0xd7c1('0xe')][_0xd7c1('0xf')][_0xd7c1('0x10')]){_0x5be9f4[_0xd7c1('0x10')]=_0x5a6921[_0xd7c1('0xe')][_0xd7c1('0xf')][_0xd7c1('0x10')];}else{_0x5be9f4[_0xd7c1('0x11')]=_0x5a6921['MailAccount'][_0xd7c1('0xf')][_0xd7c1('0x11')];_0x5be9f4['port']=_0x5a6921[_0xd7c1('0xe')]['Smtp'][_0xd7c1('0x12')];_0x5be9f4[_0xd7c1('0x13')]=_0x5a6921[_0xd7c1('0xe')][_0xd7c1('0xf')][_0xd7c1('0x13')];}if(_0x5a6921[_0xd7c1('0xe')][_0xd7c1('0xf')][_0xd7c1('0x14')]){_0x5be9f4['auth']={'user':_0x5a6921[_0xd7c1('0xe')][_0xd7c1('0xf')]['user'],'pass':_0x5a6921[_0xd7c1('0xe')][_0xd7c1('0xf')][_0xd7c1('0x15')]};}var _0x233958={'account':_0x5be9f4,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x5a6921[_0xd7c1('0xe')][_0xd7c1('0x16')],_0x5a6921['MailAccount'][_0xd7c1('0xd')]||_0x5a6921['MailAccount'][_0xd7c1('0xf')][_0xd7c1('0x17')]),'to':_0x5a6921[_0xd7c1('0xd')],'cc':_0x5a6921['cc'],'bcc':_0x5a6921['bcc'],'subject':util['format']('Report\x20%s\x20last\x20%s\x20%s',_0x587131[_0xd7c1('0x16')],_0x5a6921[_0xd7c1('0x18')],_0x5a6921['subtractUnit'])}};var _0x2bda80=path[_0xd7c1('0x19')](__dirname,_0xd7c1('0x1a'));var _0x5af4f1=_0x587131[_0xd7c1('0x1b')];var _0x51c117=util['format']('%s.%s',path[_0xd7c1('0x1c')](_0x587131[_0xd7c1('0x1b')],path[_0xd7c1('0x1d')](_0x587131[_0xd7c1('0x1b')])),_0xd7c1('0x1e'));var _0x14f40a=path[_0xd7c1('0x19')](_0x2bda80,_0x5af4f1);var _0x2cc347=path[_0xd7c1('0x19')](_0x2bda80,_0x51c117);if(fs[_0xd7c1('0x1f')](_0x14f40a)){_0x587131[_0xd7c1('0x20')]=_0xd7c1('0x21');_0x233958['message'][_0xd7c1('0x22')]=[{'filename':_0x5af4f1,'path':_0x14f40a}];_0x233958[_0xd7c1('0x23')][_0xd7c1('0x24')]=util[_0xd7c1('0x25')](_0xd7c1('0x26'),JSON[_0xd7c1('0x27')](_0x587131,null,0x2));}else if(fs[_0xd7c1('0x1f')](_0x2cc347)){_0x587131['status']=_0xd7c1('0x21');_0x233958[_0xd7c1('0x23')]['attachments']=[{'filename':_0x51c117,'path':_0x2cc347}];}else{_0x233958[_0xd7c1('0x23')][_0xd7c1('0x24')]=_0xd7c1('0x28');if(!_0x5a6921['sendIfEmpty']){_0x417716=![];logger[_0xd7c1('0xb')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x417716){return client[_0xd7c1('0x29')]('SendMail',_0x233958)[_0xd7c1('0x2a')](function(_0x4cc987){if(_0x4cc987[_0xd7c1('0x2b')]){return logger[_0xd7c1('0x2b')](_0xd7c1('0x2c'),JSON['stringify'](_0x4cc987));}return logger[_0xd7c1('0xb')](_0xd7c1('0x2d'));})[_0xd7c1('0x2e')](function(_0x165f11){return logger[_0xd7c1('0x2b')](_0xd7c1('0x2c'),JSON[_0xd7c1('0x27')](_0x165f11));});}};}function handleError(){return function(_0x420415){return logger['error'](JSON[_0xd7c1('0x27')](_0x420415));};}function handleResult(_0x2a53f2){return function(_0x5e3df2){logger[_0xd7c1('0xb')](_0xd7c1('0x2f'),JSON[_0xd7c1('0x27')](_0x5e3df2));if(_0x2a53f2['MailAccount']&&_0x2a53f2[_0xd7c1('0xe')][_0xd7c1('0xf')]&&!_[_0xd7c1('0x30')](_0x2a53f2['email'])){setTimeout(handleSendEmail(_0x2a53f2,_0x5e3df2),0x3c*0x3e8);}};}function handleJob(_0xe1817e){return function(){try{if(_[_0xd7c1('0x30')](_0xe1817e[_0xd7c1('0x18')])){return logger[_0xd7c1('0xb')](_0xd7c1('0x31'));}if(_['isNil'](_0xe1817e[_0xd7c1('0x32')])){return logger[_0xd7c1('0xb')](_0xd7c1('0x33'));}var _0x2c02a0={'startDate':moment()['subtract'](_0xe1817e[_0xd7c1('0x18')],_0xe1817e[_0xd7c1('0x32')])[_0xd7c1('0x25')](_0xd7c1('0x34')),'endDate':moment()[_0xd7c1('0x25')](_0xd7c1('0x34')),'type':_0xd7c1('0x35'),'output':_0xe1817e['output'],'name':_0xe1817e['name']};if(!_[_0xd7c1('0x30')](_0xe1817e['DefaultReportId'])){logger[_0xd7c1('0xb')](_0xd7c1('0x36'),_0xe1817e[_0xd7c1('0x37')]);return analyticDefaultReportController[_0xd7c1('0x38')]({'id':_0xe1817e[_0xd7c1('0x37')]},_0x2c02a0)[_0xd7c1('0x2a')](handleResult(_0xe1817e))[_0xd7c1('0x2e')](handleError());}if(!_[_0xd7c1('0x30')](_0xe1817e[_0xd7c1('0x39')])){logger[_0xd7c1('0xb')](_0xd7c1('0x3a'),_0xe1817e[_0xd7c1('0x39')]);return analyticCustomReportController['runReport']({'id':_0xe1817e[_0xd7c1('0x39')]},_0x2c02a0)[_0xd7c1('0x2a')](handleResult(_0xe1817e))[_0xd7c1('0x2e')](handleError());}}catch(_0x35b971){logger['error'](JSON['stringify'](_0x35b971));}return logger[_0xd7c1('0xb')]('no\x20report\x20id');};}function getJobs(_0x234df1){var _0x3358e7={};if(_0x234df1){_0x3358e7['id']=_0x234df1;}return db[_0xd7c1('0x3b')][_0xd7c1('0x3c')]({'where':_0x3358e7,'include':[{'model':db[_0xd7c1('0xe')],'attributes':['id',_0xd7c1('0x16'),_0xd7c1('0xd')],'include':[{'model':db[_0xd7c1('0x3d')],'as':_0xd7c1('0xf')}]}]})['then'](function(_0x1c1fca){var _0x3b43ba=_[_0xd7c1('0x3e')](manager[_0xd7c1('0x3f')]);var _0x13e355=_[_0xd7c1('0x40')](_0x1c1fca,function(_0x42b1df){return _0x42b1df['id'][_0xd7c1('0x41')]();});var _0x8a9714=_[_0xd7c1('0x42')](_0x1c1fca,function(_0x2ae2a8){return _0x2ae2a8['id'][_0xd7c1('0x41')]();});var _0x5a4561=_0x234df1?_0x13e355:_['difference'](_0x13e355,_0x3b43ba);var _0x2a5e5f=_[_0xd7c1('0x43')](_0x13e355,_0x3b43ba);var _0x582ebe=_[_0xd7c1('0x44')](_0x3b43ba,_0x13e355);var _0x1d731e;var _0x410645;for(_0x1d731e=0x0;_0x1d731e<_0x582ebe[_0xd7c1('0x45')]&&!_0x234df1;_0x1d731e+=0x1){_0x410645=_0x582ebe[_0x1d731e][_0xd7c1('0x41')]();if(manager[_0xd7c1('0x46')](_0x410645)){manager['stop'](_0x410645);manager['deleteJob'](_0x410645);logger[_0xd7c1('0xb')](_0xd7c1('0x47'),_0x410645);}}logger['info']('toRun',JSON[_0xd7c1('0x27')](_0x5a4561));for(_0x1d731e=0x0;_0x1d731e<_0x5a4561[_0xd7c1('0x45')];_0x1d731e+=0x1){_0x410645=_0x5a4561[_0x1d731e][_0xd7c1('0x41')]();logger[_0xd7c1('0xb')]('index',_0x410645);if(_0x234df1){logger[_0xd7c1('0xb')]('my\x20id',_0x234df1);logger[_0xd7c1('0xb')](JSON['stringify'](_0x8a9714[_0x410645]));BPromise['resolve']()[_0xd7c1('0x2a')](handleJob(_0x8a9714[_0x410645]));logger[_0xd7c1('0xb')](_0xd7c1('0x48'),_0x8a9714[_0x410645][_0xd7c1('0x16')],_0x8a9714[_0x410645]['cron']);}else if(_0x8a9714[_0x410645]['cron']&&_0x8a9714[_0x410645][_0xd7c1('0x49')]&&moment()['isBetween'](_0x8a9714[_0x410645][_0xd7c1('0x4a')],_0x8a9714[_0x410645][_0xd7c1('0x4b')])){manager[_0xd7c1('0x4c')](_0x410645,_0x8a9714[_0x410645][_0xd7c1('0x4d')],handleJob(_0x8a9714[_0x410645]));manager[_0xd7c1('0x4e')](_0x410645);logger[_0xd7c1('0xb')](_0xd7c1('0x4f'),_0x8a9714[_0x410645][_0xd7c1('0x16')],_0x8a9714[_0x410645][_0xd7c1('0x4d')]);}else if(manager[_0xd7c1('0x46')](_0x410645)){manager['stop'](_0x410645);manager[_0xd7c1('0x50')](_0x410645);logger[_0xd7c1('0xb')]('stop\x20cron',_0x8a9714[_0x410645][_0xd7c1('0x16')],_0x8a9714[_0x410645][_0xd7c1('0x4d')]);}}for(_0x1d731e=0x0,_0x410645;_0x1d731e<_0x2a5e5f[_0xd7c1('0x45')]&&!_0x234df1;_0x1d731e+=0x1){_0x410645=_0x2a5e5f[_0x1d731e][_0xd7c1('0x41')]();if(manager['exists'](_0x410645)){if(_0x8a9714[_0x410645][_0xd7c1('0x4d')]&&_0x8a9714[_0x410645]['active']&&moment()[_0xd7c1('0x51')](_0x8a9714[_0x410645][_0xd7c1('0x4a')],_0x8a9714[_0x410645]['endAt'])){manager['update'](_0x410645,_0x8a9714[_0x410645]['cron'],handleJob(_0x8a9714[_0x410645]));logger[_0xd7c1('0xb')](_0xd7c1('0x52'),_0x8a9714[_0x410645][_0xd7c1('0x16')],_0x8a9714[_0x410645][_0xd7c1('0x4d')]);}else{manager['stop'](_0x410645);manager[_0xd7c1('0x50')](_0x410645);logger[_0xd7c1('0xb')](_0xd7c1('0x53'),_0x8a9714[_0x410645]['name'],_0x8a9714[_0x410645][_0xd7c1('0x4d')]);}}}})[_0xd7c1('0x2e')](function(_0x327f75){logger[_0xd7c1('0x2b')](JSON[_0xd7c1('0x27')](_0x327f75));});}exports[_0xd7c1('0x54')]=function(_0x26679e){return getJobs(_0x26679e);};exports[_0xd7c1('0x4e')]=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 997bde1..3d6b9ed 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x038d=['@xcally.com','now','destroy','bulkCreate','then','log','contacts1','CmHopper','finished\x20populating','hopper1','CmContact','util','../mysqldb','push','Innocenzo','innocenzo.biondo'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x038d,0x6b));var _0xd038=function(_0x46a301,_0x38cccc){_0x46a301=_0x46a301-0x0;var _0x206fd2=_0x038d[_0x46a301];return _0x206fd2;};'use strict';var util=require(_0xd038('0x0'));var db=require(_0xd038('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xd038('0x2')]({'id':i,'firstName':_0xd038('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0xd038('0x4')+i+_0xd038('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xd038('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xd038('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xd038('0x2')]({'id':i,'firstName':_0xd038('0x3')+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+_0xd038('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xd038('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['now']()});}db['CmContact'][_0xd038('0x7')]({'where':{}})['then'](function(){return db['CmContact'][_0xd038('0x8')](contacts);})[_0xd038('0x9')](function(){console[_0xd038('0xa')]('finished\x20populating',_0xd038('0xb'));return db[_0xd038('0xc')]['destroy']({'where':{}});})[_0xd038('0x9')](function(){return db[_0xd038('0xc')]['bulkCreate'](hopper);})[_0xd038('0x9')](function(){console[_0xd038('0xa')](_0xd038('0xd'),_0xd038('0xe'));return db[_0xd038('0xf')][_0xd038('0x8')](contacts2);})[_0xd038('0x9')](function(){console['log']('finished\x20populating','contacts2');return db[_0xd038('0xc')]['bulkCreate'](hopper2);})[_0xd038('0x9')](function(){console['log'](_0xd038('0xd'),'hopper2');})['catch'](function(_0x457e93){console[_0xd038('0xa')](_0x457e93);}); \ No newline at end of file +var _0xee59=['innocenzo.biondo','@xcally.com','push','now','CmContact','destroy','then','bulkCreate','log','finished\x20populating','contacts2','hopper2','catch','../mysqldb','Innocenzo','Biondo'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xee59,0xdd));var _0x9ee5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xee59[_0x3dd15e];return _0x231fd0;};'use strict';var util=require('util');var db=require(_0x9ee5('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts['push']({'id':i,'firstName':_0x9ee5('0x1')+i,'lastName':_0x9ee5('0x2')+i,'phone':0xf879fb460+i,'email':_0x9ee5('0x3')+i+_0x9ee5('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x9ee5('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x9ee5('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x9ee5('0x6')](),'updatedAt':Date[_0x9ee5('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x9ee5('0x5')]({'id':i,'firstName':_0x9ee5('0x1')+i,'lastName':_0x9ee5('0x2')+i,'phone':0xf879fb460+i,'email':'innocenzo.biondo'+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x9ee5('0x5')]({'id':i,'active':![],'scheduledat':Date[_0x9ee5('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x9ee5('0x6')]()});}db[_0x9ee5('0x7')][_0x9ee5('0x8')]({'where':{}})[_0x9ee5('0x9')](function(){return db[_0x9ee5('0x7')][_0x9ee5('0xa')](contacts);})[_0x9ee5('0x9')](function(){console[_0x9ee5('0xb')]('finished\x20populating','contacts1');return db['CmHopper'][_0x9ee5('0x8')]({'where':{}});})[_0x9ee5('0x9')](function(){return db['CmHopper']['bulkCreate'](hopper);})[_0x9ee5('0x9')](function(){console['log'](_0x9ee5('0xc'),'hopper1');return db[_0x9ee5('0x7')][_0x9ee5('0xa')](contacts2);})[_0x9ee5('0x9')](function(){console[_0x9ee5('0xb')]('finished\x20populating',_0x9ee5('0xd'));return db['CmHopper'][_0x9ee5('0xa')](hopper2);})[_0x9ee5('0x9')](function(){console[_0x9ee5('0xb')]('finished\x20populating',_0x9ee5('0xe'));})[_0x9ee5('0xf')](function(_0x4675d1){console[_0x9ee5('0xb')](_0x4675d1);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 544a4d2..71cea50 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9feb=['format','%s%s','agent','%s%s@xcally.com','friend','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','then','log','util','../mysqldb','push'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x9feb,0x1eb));var _0xb9fe=function(_0x5e3fc7,_0x341090){_0x5e3fc7=_0x5e3fc7-0x0;var _0x23e6d6=_0x9feb[_0x5e3fc7];return _0x23e6d6;};'use strict';var util=require(_0xb9fe('0x0'));var db=require(_0xb9fe('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xb9fe('0x2')]({'name':util[_0xb9fe('0x3')](_0xb9fe('0x4'),_0xb9fe('0x5'),i),'fullname':util[_0xb9fe('0x3')]('%s%s','agent',i),'email':util['format'](_0xb9fe('0x6'),_0xb9fe('0x5'),i),'role':'agent','password':'password','internal':0xfa0+i,'type':_0xb9fe('0x7'),'transport':[_0xb9fe('0x8'),'ws','wss'],'disallow':[_0xb9fe('0x9')],'allow':[_0xb9fe('0xa')],'defaultuser':util[_0xb9fe('0x3')](_0xb9fe('0x4'),_0xb9fe('0x5'),i),'encryption':_0xb9fe('0xb'),'avpf':_0xb9fe('0xb'),'force_avp':_0xb9fe('0xb'),'icesupport':'yes','dtlsenable':'yes','dtlsverify':'no','dtlscertfile':_0xb9fe('0xc'),'dtlsprivatekey':_0xb9fe('0xd'),'dtlssetup':_0xb9fe('0xe'),'callerid':util['format'](_0xb9fe('0xf'),util[_0xb9fe('0x3')](_0xb9fe('0x4'),_0xb9fe('0x5'),i),0xfa0+i)});}db[_0xb9fe('0x10')]['bulkCreate'](users)[_0xb9fe('0x11')](function(){console[_0xb9fe('0x12')]('add\x20user');})['catch'](function(_0x426b58){console[_0xb9fe('0x12')](_0x426b58);}); \ No newline at end of file +var _0xa1c2=['catch','../mysqldb','format','%s%s','agent','password','udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user'];(function(_0x3e0ffc,_0x455a0e){var _0x58119f=function(_0x8f2fa){while(--_0x8f2fa){_0x3e0ffc['push'](_0x3e0ffc['shift']());}};_0x58119f(++_0x455a0e);}(_0xa1c2,0xeb));var _0x2a1c=function(_0x57b54c,_0x54ce0d){_0x57b54c=_0x57b54c-0x0;var _0x59cc19=_0xa1c2[_0x57b54c];return _0x59cc19;};'use strict';var util=require('util');var db=require(_0x2a1c('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util[_0x2a1c('0x1')](_0x2a1c('0x2'),_0x2a1c('0x3'),i),'fullname':util['format']('%s%s',_0x2a1c('0x3'),i),'email':util[_0x2a1c('0x1')]('%s%s@xcally.com',_0x2a1c('0x3'),i),'role':_0x2a1c('0x3'),'password':_0x2a1c('0x4'),'internal':0xfa0+i,'type':'friend','transport':[_0x2a1c('0x5'),'ws','wss'],'disallow':[_0x2a1c('0x6')],'allow':[_0x2a1c('0x7')],'defaultuser':util[_0x2a1c('0x1')]('%s%s',_0x2a1c('0x3'),i),'encryption':'yes','avpf':_0x2a1c('0x8'),'force_avp':_0x2a1c('0x8'),'icesupport':_0x2a1c('0x8'),'dtlsenable':_0x2a1c('0x8'),'dtlsverify':'no','dtlscertfile':_0x2a1c('0x9'),'dtlsprivatekey':_0x2a1c('0xa'),'dtlssetup':_0x2a1c('0xb'),'callerid':util['format'](_0x2a1c('0xc'),util['format'](_0x2a1c('0x2'),_0x2a1c('0x3'),i),0xfa0+i)});}db[_0x2a1c('0xd')][_0x2a1c('0xe')](users)['then'](function(){console[_0x2a1c('0xf')](_0x2a1c('0x10'));})[_0x2a1c('0x11')](function(_0x577650){console[_0x2a1c('0xf')](_0x577650);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 2d3a17f..3e771cb 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x022b=['autoAssociation','FaxQueues','MailQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','User','where','Campaign','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','ChatInteractions','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','userProfileId','ChatQueues','ChatQueue','SmsQueues','OpenchannelQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','voice','chat','fax','sms','mail','openchannel','telephone:%s','campaign:%s:%s','removeChatInteractions','emit','user_has_chat_interactions:remove','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','leave','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','default','setMaxListeners','address','remoteAddress','request','connection','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','role','telephone','agent','type','ivr','UserProfileSection','then'];(function(_0x13ec2b,_0x40b664){var _0x1fb3f4=function(_0x3e91e9){while(--_0x3e91e9){_0x13ec2b['push'](_0x13ec2b['shift']());}};_0x1fb3f4(++_0x40b664);}(_0x022b,0x170));var _0xb022=function(_0x38e226,_0x3beee1){_0x38e226=_0x38e226-0x0;var _0x85d1dd=_0x022b[_0x38e226];return _0x85d1dd;};'use strict';var _=require(_0xb022('0x0'));var util=require(_0xb022('0x1'));var BPromise=require(_0xb022('0x2'));var db=require('../mysqldb')['db'];var config=require(_0xb022('0x3'));var queryQueues={'attributes':['id',_0xb022('0x4')],'include':[{'as':'Agents','model':db['User'],'attributes':['id','name',_0xb022('0x5')],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xb022('0x6')}};var queryTrunks={'raw':!![],'attributes':['id',_0xb022('0x4')]};var queryAgents={'raw':!![],'attributes':['id',_0xb022('0x4')],'where':{'role':_0xb022('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xb022('0x8')],'where':{'type':_0xb022('0x9')}};function getAssociatedResources(_0x9a218e,_0xa038c3,_0x3efdd2){return db[_0xb022('0xa')]['findOne']({'where':{'name':_0x9a218e,'userProfileId':_0xa038c3},'raw':!![]})[_0xb022('0xb')](function(_0xe1d612){if(_0xe1d612){if(_0xe1d612[_0xb022('0xc')]){switch(_0x9a218e){case'VoiceQueues':case'ChatQueues':case _0xb022('0xd'):case'SmsQueues':case _0xb022('0xe'):case'OpenchannelQueues':return db[_0x3efdd2][_0xb022('0xf')](queryQueues);case _0xb022('0x10'):return db[_0x3efdd2][_0xb022('0xf')](queryTelephones);case'Trunks':return db[_0x3efdd2]['findAll'](queryTrunks);case _0xb022('0x11'):return db[_0x3efdd2]['findAll'](queryCampaigns);}}else{return db[_0xb022('0x12')][_0xb022('0xf')]({'attributes':[_0xb022('0x13')],'where':{'sectionId':_0xe1d612['id']},'raw':!![]})['then'](function(_0x248ae4){if(_0x248ae4){var _0x5404d6={'where':{'id':_[_0xb022('0x14')](_0x248ae4,'resourceId')},'raw':!![]};switch(_0x3efdd2){case _0xb022('0x15'):_0x5404d6[_0xb022('0x16')]['role']='telephone';break;case _0xb022('0x17'):_0x5404d6[_0xb022('0x16')][_0xb022('0x8')]=_0xb022('0x9');break;}return db[_0x3efdd2][_0xb022('0xf')](_0x5404d6);}else{return[];}});}}else{return[];}})[_0xb022('0xb')](function(_0x4d904f){return _0x4d904f;});}function joinOrLeaveQueues(_0x598b1e,_0x3deab3,_0x263a60,_0x418e33){_0x598b1e[_0x3deab3](util[_0xb022('0x18')](_0xb022('0x19'),_0x263a60,_0x418e33[_0xb022('0x4')]));if(_0x418e33[_0xb022('0x1a')]){for(var _0xab00d4=0x0;_0xab00d4<_0x418e33['Agents'][_0xb022('0x1b')];_0xab00d4+=0x1){_0x598b1e[_0x3deab3](util[_0xb022('0x18')](_0xb022('0x1c'),_0x418e33[_0xb022('0x1a')][_0xab00d4]['name']));}}}function joinOrLeave(_0x593a34,_0x1460d0,_0x187aed){var _0x45db84;if(_0x593a34[_0xb022('0x1d')][_0xb022('0x1e')]['id']){db[_0xb022('0x15')][_0xb022('0x1f')]({'attributes':['id','name',_0xb022('0x5'),'userProfileId'],'where':{'id':_0x593a34[_0xb022('0x1d')][_0xb022('0x1e')]['id']},'include':[{'model':db['ChatInteraction'],'as':_0xb022('0x20'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0xb022('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0xb022('0x22')],'as':_0xb022('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0xb022('0x24')],'as':_0xb022('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xb022('0x26')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0xb022('0xb')](function(_0x478b9e){if(_0x478b9e){_0x45db84=_0x478b9e;_0x593a34[_0x1460d0](util[_0xb022('0x18')](_0xb022('0x1c'),_0x478b9e['name']));var _0x23eab0=[];switch(_0x478b9e['role']){case _0xb022('0x27'):_0x593a34[_0x1460d0](_0xb022('0x28'));_0x593a34[_0x1460d0](_0xb022('0x29'));if(queryQueues[_0xb022('0x2a')](_0xb022('0x2b'))){delete queryQueues['include'];}_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x2d')][_0xb022('0xf')](queryQueues));_0x23eab0[_0xb022('0x2c')](db['ChatQueue'][_0xb022('0xf')](queryQueues));_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x2e')][_0xb022('0xf')](queryQueues));_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x2f')][_0xb022('0xf')](queryQueues));_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x30')][_0xb022('0xf')](queryQueues));_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x31')][_0xb022('0xf')](queryQueues));_0x23eab0[_0xb022('0x2c')](db['User'][_0xb022('0xf')](queryTelephones));_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x32')][_0xb022('0xf')](queryTrunks));_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x17')]['findAll'](queryCampaigns));_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x15')][_0xb022('0xf')](queryAgents));break;case _0xb022('0x33'):_0x593a34[_0x1460d0](_0xb022('0x28'));_0x593a34[_0x1460d0]('voice:outbound');_0x23eab0[_0xb022('0x2c')](getAssociatedResources('VoiceQueues',_0x478b9e[_0xb022('0x34')],_0xb022('0x2d')));_0x23eab0[_0xb022('0x2c')](getAssociatedResources(_0xb022('0x35'),_0x478b9e[_0xb022('0x34')],_0xb022('0x36')));_0x23eab0['push'](getAssociatedResources(_0xb022('0xd'),_0x478b9e['userProfileId'],_0xb022('0x2e')));_0x23eab0[_0xb022('0x2c')](getAssociatedResources(_0xb022('0x37'),_0x478b9e['userProfileId'],_0xb022('0x2f')));_0x23eab0[_0xb022('0x2c')](getAssociatedResources(_0xb022('0xe'),_0x478b9e[_0xb022('0x34')],_0xb022('0x30')));_0x23eab0[_0xb022('0x2c')](getAssociatedResources(_0xb022('0x38'),_0x478b9e['userProfileId'],_0xb022('0x31')));_0x23eab0[_0xb022('0x2c')](getAssociatedResources(_0xb022('0x10'),_0x478b9e[_0xb022('0x34')],_0xb022('0x15')));_0x23eab0[_0xb022('0x2c')](getAssociatedResources('Trunks',_0x478b9e[_0xb022('0x34')],_0xb022('0x32')));_0x23eab0[_0xb022('0x2c')](getAssociatedResources('IvrCampaigns',_0x478b9e['userProfileId'],_0xb022('0x17')));_0x23eab0[_0xb022('0x2c')](db[_0xb022('0x15')][_0xb022('0xf')](queryAgents));break;case _0xb022('0x7'):_0x593a34[_0x1460d0]('voice:inbound');_0x593a34[_0x1460d0](_0xb022('0x29'));_0x23eab0[_0xb022('0x2c')](_0x478b9e['getVoiceQueues']({'attributes':['id','name']}));_0x23eab0[_0xb022('0x2c')](_0x478b9e['getChatQueues']({'attributes':['id',_0xb022('0x4')]}));_0x23eab0[_0xb022('0x2c')](_0x478b9e[_0xb022('0x39')]({'attributes':['id',_0xb022('0x4')]}));_0x23eab0[_0xb022('0x2c')](_0x478b9e[_0xb022('0x3a')]({'attributes':['id',_0xb022('0x4')]}));_0x23eab0[_0xb022('0x2c')](_0x478b9e[_0xb022('0x3b')]({'attributes':['id',_0xb022('0x4')]}));_0x23eab0[_0xb022('0x2c')](_0x478b9e[_0xb022('0x3c')]({'attributes':['id',_0xb022('0x4')]}));break;}return BPromise[_0xb022('0x3d')](_0x23eab0);}})[_0xb022('0xb')](function(_0xd271f8){if(_0xd271f8&&_0xd271f8['length']){for(var _0x4da357=0x0;_0x4da357<_0xd271f8[_0xb022('0x1b')];_0x4da357+=0x1){for(var _0xb0f579=0x0;_0xb0f579<_0xd271f8[_0x4da357][_0xb022('0x1b')];_0xb0f579+=0x1){switch(_0x4da357){case 0x0:joinOrLeaveQueues(_0x593a34,_0x1460d0,_0xb022('0x3e'),_0xd271f8[_0x4da357][_0xb0f579]);break;case 0x1:joinOrLeaveQueues(_0x593a34,_0x1460d0,_0xb022('0x3f'),_0xd271f8[_0x4da357][_0xb0f579]);break;case 0x2:joinOrLeaveQueues(_0x593a34,_0x1460d0,_0xb022('0x40'),_0xd271f8[_0x4da357][_0xb0f579]);break;case 0x3:joinOrLeaveQueues(_0x593a34,_0x1460d0,_0xb022('0x41'),_0xd271f8[_0x4da357][_0xb0f579]);break;case 0x4:joinOrLeaveQueues(_0x593a34,_0x1460d0,_0xb022('0x42'),_0xd271f8[_0x4da357][_0xb0f579]);break;case 0x5:joinOrLeaveQueues(_0x593a34,_0x1460d0,_0xb022('0x43'),_0xd271f8[_0x4da357][_0xb0f579]);break;case 0x6:_0x593a34[_0x1460d0](util[_0xb022('0x18')](_0xb022('0x44'),_0xd271f8[_0x4da357][_0xb0f579][_0xb022('0x4')]));break;case 0x7:_0x593a34[_0x1460d0](util['format']('trunk:%s',_0xd271f8[_0x4da357][_0xb0f579][_0xb022('0x4')]));break;case 0x8:_0x593a34[_0x1460d0](util[_0xb022('0x18')](_0xb022('0x45'),_0xd271f8[_0x4da357][_0xb0f579][_0xb022('0x8')],_0xd271f8[_0x4da357][_0xb0f579][_0xb022('0x4')]));break;case 0x9:_0x593a34[_0x1460d0](util['format'](_0xb022('0x1c'),_0xd271f8[_0x4da357][_0xb0f579][_0xb022('0x4')]));break;}}}}})[_0xb022('0xb')](function(){if(_0x1460d0==='leave'){var _0x253a11=_[_0xb022('0x14')](_0x45db84[_0xb022('0x20')],'id');return _0x45db84[_0xb022('0x46')](_0x253a11)[_0xb022('0xb')](function(){for(var _0x1e99cc=0x0;_0x1e99cc<_0x253a11[_0xb022('0x1b')];_0x1e99cc+=0x1){_0x187aed[_0xb022('0x47')](_0xb022('0x48'),{'ChatInteractionId':Number(_0x253a11[_0x1e99cc]),'UserId':Number(_0x45db84['id'])});}});}})[_0xb022('0xb')](function(){if(_0x1460d0==='leave'){var _0x5a9aba=_[_0xb022('0x14')](_0x45db84[_0xb022('0x21')],'id');return _0x45db84[_0xb022('0x49')](_0x5a9aba)[_0xb022('0xb')](function(){for(var _0x4ba198=0x0;_0x4ba198<_0x5a9aba['length'];_0x4ba198+=0x1){_0x187aed[_0xb022('0x47')](_0xb022('0x4a'),{'MailInteractionId':Number(_0x5a9aba[_0x4ba198]),'UserId':Number(_0x45db84['id'])});}});}})[_0xb022('0xb')](function(){if(_0x1460d0==='leave'){var _0x2374e3=_[_0xb022('0x14')](_0x45db84['FaxInteractions'],'id');return _0x45db84[_0xb022('0x4b')](_0x2374e3)[_0xb022('0xb')](function(){for(var _0x556984=0x0;_0x556984<_0x2374e3[_0xb022('0x1b')];_0x556984+=0x1){_0x187aed['emit']('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0x2374e3[_0x556984]),'UserId':Number(_0x45db84['id'])});}});}})['then'](function(){if(_0x1460d0===_0xb022('0x4c')){var _0x224b46=_['map'](_0x45db84[_0xb022('0x25')],'id');return _0x45db84['removeSmsInteractions'](_0x224b46)[_0xb022('0xb')](function(){for(var _0x43faf5=0x0;_0x43faf5<_0x224b46[_0xb022('0x1b')];_0x43faf5+=0x1){_0x187aed['emit'](_0xb022('0x4d'),{'SmsInteractionId':Number(_0x224b46[_0x43faf5]),'UserId':Number(_0x45db84['id'])});}});}})[_0xb022('0xb')](function(){if(_0x1460d0===_0xb022('0x4c')){var _0x5aa1e8=_[_0xb022('0x14')](_0x45db84[_0xb022('0x4e')],'id');return _0x45db84[_0xb022('0x4f')](_0x5aa1e8)[_0xb022('0xb')](function(){for(var _0x3be257=0x0;_0x3be257<_0x5aa1e8[_0xb022('0x1b')];_0x3be257+=0x1){_0x187aed[_0xb022('0x47')](_0xb022('0x50'),{'OpenchannelInteractionId':Number(_0x5aa1e8[_0x3be257]),'UserId':Number(_0x45db84['id'])});}});}})[_0xb022('0x51')](function(_0xdb1fb4){_0x593a34[_0xb022('0x52')](_0xdb1fb4);});}}function onDisconnect(_0x36285e,_0x18571a){joinOrLeave(_0x36285e,_0xb022('0x4c'),_0x18571a);}function onConnect(_0x1a4d28){joinOrLeave(_0x1a4d28,'join');}exports[_0xb022('0x53')]=function(_0x381451){_0x381451['on']('connection',function(_0x116af6){_0x116af6[_0xb022('0x54')](0x0);_0x116af6[_0xb022('0x55')]=_0x116af6['request']['connection'][_0xb022('0x56')]+':'+_0x116af6[_0xb022('0x57')][_0xb022('0x58')][_0xb022('0x59')];_0x116af6[_0xb022('0x5a')]=new Date();_0x116af6[_0xb022('0x52')]=function(_0x49cbe9){console[_0xb022('0x52')](_0xb022('0x5b')+_0x116af6[_0xb022('0x5c')]['name']+'['+_0x116af6[_0xb022('0x55')]+']',_0x49cbe9);};_0x116af6['on']('disconnect',function(){onDisconnect(_0x116af6,_0x381451);_0x116af6[_0xb022('0x52')](_0xb022('0x5d'));});onConnect(_0x116af6);_0x116af6[_0xb022('0x52')](_0xb022('0x5e'));});}; \ No newline at end of file +var _0xa464=['connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','disconnect','DISCONNECTED','CONNECTED','lodash','util','bluebird','./environment','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','FaxQueues','SmsQueues','Telephones','findAll','Trunks','IvrCampaigns','UserProfileResource','resourceId','where','telephone','format','length','user:%s','query','find','handshake','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','OpenchannelInteraction','OpenchannelInteractions','voice:inbound','voice:outbound','hasOwnProperty','include','VoiceQueue','push','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueues','userProfileId','ChatQueue','SmsQueue','MailQueues','OpenchannelQueues','Campaign','getVoiceQueues','getChatQueues','getSmsQueues','all','voice','chat','fax','sms','telephone:%s','campaign:%s:%s','leave','map','ChatInteractions','emit','user_has_chat_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','join','default','setMaxListeners','address','request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa464,0x1d4));var _0x4a46=function(_0x962727,_0x3bea8a){_0x962727=_0x962727-0x0;var _0x54b8b9=_0xa464[_0x962727];return _0x54b8b9;};'use strict';var _=require(_0x4a46('0x0'));var util=require(_0x4a46('0x1'));var BPromise=require(_0x4a46('0x2'));var db=require('../mysqldb')['db'];var config=require(_0x4a46('0x3'));var queryQueues={'attributes':['id',_0x4a46('0x4')],'include':[{'as':_0x4a46('0x5'),'model':db[_0x4a46('0x6')],'attributes':['id','name',_0x4a46('0x7')],'raw':!![],'where':{'role':_0x4a46('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x4a46('0x4')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id',_0x4a46('0x4')]};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0x4a46('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x4a46('0x9')],'where':{'type':_0x4a46('0xa')}};function getAssociatedResources(_0x9c673e,_0x22aa41,_0xe30e76){return db[_0x4a46('0xb')][_0x4a46('0xc')]({'where':{'name':_0x9c673e,'userProfileId':_0x22aa41},'raw':!![]})[_0x4a46('0xd')](function(_0x1e99a5){if(_0x1e99a5){if(_0x1e99a5[_0x4a46('0xe')]){switch(_0x9c673e){case'VoiceQueues':case _0x4a46('0xf'):case _0x4a46('0x10'):case _0x4a46('0x11'):case'MailQueues':case'OpenchannelQueues':return db[_0xe30e76]['findAll'](queryQueues);case _0x4a46('0x12'):return db[_0xe30e76][_0x4a46('0x13')](queryTelephones);case _0x4a46('0x14'):return db[_0xe30e76][_0x4a46('0x13')](queryTrunks);case _0x4a46('0x15'):return db[_0xe30e76][_0x4a46('0x13')](queryCampaigns);}}else{return db[_0x4a46('0x16')][_0x4a46('0x13')]({'attributes':['resourceId'],'where':{'sectionId':_0x1e99a5['id']},'raw':!![]})[_0x4a46('0xd')](function(_0x5889da){if(_0x5889da){var _0x4d5cc1={'where':{'id':_['map'](_0x5889da,_0x4a46('0x17'))},'raw':!![]};switch(_0xe30e76){case _0x4a46('0x6'):_0x4d5cc1[_0x4a46('0x18')][_0x4a46('0x7')]=_0x4a46('0x19');break;case'Campaign':_0x4d5cc1[_0x4a46('0x18')][_0x4a46('0x9')]=_0x4a46('0xa');break;}return db[_0xe30e76][_0x4a46('0x13')](_0x4d5cc1);}else{return[];}});}}else{return[];}})[_0x4a46('0xd')](function(_0x154ef9){return _0x154ef9;});}function joinOrLeaveQueues(_0x43f576,_0x4efdef,_0x41562d,_0x53752a){_0x43f576[_0x4efdef](util[_0x4a46('0x1a')]('%s:queue:%s',_0x41562d,_0x53752a[_0x4a46('0x4')]));if(_0x53752a[_0x4a46('0x5')]){for(var _0x10dbeb=0x0;_0x10dbeb<_0x53752a['Agents'][_0x4a46('0x1b')];_0x10dbeb+=0x1){_0x43f576[_0x4efdef](util['format'](_0x4a46('0x1c'),_0x53752a[_0x4a46('0x5')][_0x10dbeb][_0x4a46('0x4')]));}}}function joinOrLeave(_0x5223eb,_0x574c7c,_0x5950bf){var _0x52bf21;if(_0x5223eb['handshake'][_0x4a46('0x1d')]['id']){db['User'][_0x4a46('0x1e')]({'attributes':['id','name',_0x4a46('0x7'),'userProfileId'],'where':{'id':_0x5223eb[_0x4a46('0x1f')]['query']['id']},'include':[{'model':db['ChatInteraction'],'as':'ChatInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x4a46('0x20')],'as':_0x4a46('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x4a46('0x22')],'as':_0x4a46('0x23'),'attributes':['id'],'raw':!![]},{'model':db[_0x4a46('0x24')],'as':_0x4a46('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x4a46('0x26')],'as':_0x4a46('0x27'),'attributes':['id'],'raw':!![]}]})['then'](function(_0x4a27e3){if(_0x4a27e3){_0x52bf21=_0x4a27e3;_0x5223eb[_0x574c7c](util['format']('user:%s',_0x4a27e3[_0x4a46('0x4')]));var _0x1f39b6=[];switch(_0x4a27e3[_0x4a46('0x7')]){case'admin':_0x5223eb[_0x574c7c](_0x4a46('0x28'));_0x5223eb[_0x574c7c](_0x4a46('0x29'));if(queryQueues[_0x4a46('0x2a')](_0x4a46('0x2b'))){delete queryQueues[_0x4a46('0x2b')];}_0x1f39b6['push'](db[_0x4a46('0x2c')][_0x4a46('0x13')](queryQueues));_0x1f39b6[_0x4a46('0x2d')](db['ChatQueue']['findAll'](queryQueues));_0x1f39b6[_0x4a46('0x2d')](db[_0x4a46('0x2e')][_0x4a46('0x13')](queryQueues));_0x1f39b6[_0x4a46('0x2d')](db['SmsQueue']['findAll'](queryQueues));_0x1f39b6[_0x4a46('0x2d')](db[_0x4a46('0x2f')][_0x4a46('0x13')](queryQueues));_0x1f39b6[_0x4a46('0x2d')](db[_0x4a46('0x30')]['findAll'](queryQueues));_0x1f39b6[_0x4a46('0x2d')](db[_0x4a46('0x6')][_0x4a46('0x13')](queryTelephones));_0x1f39b6[_0x4a46('0x2d')](db[_0x4a46('0x31')][_0x4a46('0x13')](queryTrunks));_0x1f39b6[_0x4a46('0x2d')](db['Campaign'][_0x4a46('0x13')](queryCampaigns));_0x1f39b6['push'](db[_0x4a46('0x6')][_0x4a46('0x13')](queryAgents));break;case _0x4a46('0x32'):_0x5223eb[_0x574c7c]('voice:inbound');_0x5223eb[_0x574c7c](_0x4a46('0x29'));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources(_0x4a46('0x33'),_0x4a27e3[_0x4a46('0x34')],_0x4a46('0x2c')));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources(_0x4a46('0xf'),_0x4a27e3[_0x4a46('0x34')],_0x4a46('0x35')));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources('FaxQueues',_0x4a27e3[_0x4a46('0x34')],'FaxQueue'));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources('SmsQueues',_0x4a27e3[_0x4a46('0x34')],_0x4a46('0x36')));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources(_0x4a46('0x37'),_0x4a27e3[_0x4a46('0x34')],_0x4a46('0x2f')));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources(_0x4a46('0x38'),_0x4a27e3[_0x4a46('0x34')],'OpenchannelQueue'));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources(_0x4a46('0x12'),_0x4a27e3[_0x4a46('0x34')],_0x4a46('0x6')));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources(_0x4a46('0x14'),_0x4a27e3[_0x4a46('0x34')],'Trunk'));_0x1f39b6[_0x4a46('0x2d')](getAssociatedResources(_0x4a46('0x15'),_0x4a27e3[_0x4a46('0x34')],_0x4a46('0x39')));_0x1f39b6[_0x4a46('0x2d')](db[_0x4a46('0x6')][_0x4a46('0x13')](queryAgents));break;case _0x4a46('0x8'):_0x5223eb[_0x574c7c](_0x4a46('0x28'));_0x5223eb[_0x574c7c]('voice:outbound');_0x1f39b6[_0x4a46('0x2d')](_0x4a27e3[_0x4a46('0x3a')]({'attributes':['id',_0x4a46('0x4')]}));_0x1f39b6[_0x4a46('0x2d')](_0x4a27e3[_0x4a46('0x3b')]({'attributes':['id',_0x4a46('0x4')]}));_0x1f39b6[_0x4a46('0x2d')](_0x4a27e3['getFaxQueues']({'attributes':['id','name']}));_0x1f39b6[_0x4a46('0x2d')](_0x4a27e3[_0x4a46('0x3c')]({'attributes':['id',_0x4a46('0x4')]}));_0x1f39b6[_0x4a46('0x2d')](_0x4a27e3['getMailQueues']({'attributes':['id',_0x4a46('0x4')]}));_0x1f39b6[_0x4a46('0x2d')](_0x4a27e3['getOpenchannelQueues']({'attributes':['id',_0x4a46('0x4')]}));break;}return BPromise[_0x4a46('0x3d')](_0x1f39b6);}})[_0x4a46('0xd')](function(_0x57d0a5){if(_0x57d0a5&&_0x57d0a5[_0x4a46('0x1b')]){for(var _0x13fb78=0x0;_0x13fb78<_0x57d0a5[_0x4a46('0x1b')];_0x13fb78+=0x1){for(var _0xad0d28=0x0;_0xad0d28<_0x57d0a5[_0x13fb78][_0x4a46('0x1b')];_0xad0d28+=0x1){switch(_0x13fb78){case 0x0:joinOrLeaveQueues(_0x5223eb,_0x574c7c,_0x4a46('0x3e'),_0x57d0a5[_0x13fb78][_0xad0d28]);break;case 0x1:joinOrLeaveQueues(_0x5223eb,_0x574c7c,_0x4a46('0x3f'),_0x57d0a5[_0x13fb78][_0xad0d28]);break;case 0x2:joinOrLeaveQueues(_0x5223eb,_0x574c7c,_0x4a46('0x40'),_0x57d0a5[_0x13fb78][_0xad0d28]);break;case 0x3:joinOrLeaveQueues(_0x5223eb,_0x574c7c,_0x4a46('0x41'),_0x57d0a5[_0x13fb78][_0xad0d28]);break;case 0x4:joinOrLeaveQueues(_0x5223eb,_0x574c7c,'mail',_0x57d0a5[_0x13fb78][_0xad0d28]);break;case 0x5:joinOrLeaveQueues(_0x5223eb,_0x574c7c,'openchannel',_0x57d0a5[_0x13fb78][_0xad0d28]);break;case 0x6:_0x5223eb[_0x574c7c](util['format'](_0x4a46('0x42'),_0x57d0a5[_0x13fb78][_0xad0d28][_0x4a46('0x4')]));break;case 0x7:_0x5223eb[_0x574c7c](util[_0x4a46('0x1a')]('trunk:%s',_0x57d0a5[_0x13fb78][_0xad0d28][_0x4a46('0x4')]));break;case 0x8:_0x5223eb[_0x574c7c](util['format'](_0x4a46('0x43'),_0x57d0a5[_0x13fb78][_0xad0d28]['type'],_0x57d0a5[_0x13fb78][_0xad0d28]['name']));break;case 0x9:_0x5223eb[_0x574c7c](util['format'](_0x4a46('0x1c'),_0x57d0a5[_0x13fb78][_0xad0d28][_0x4a46('0x4')]));break;}}}}})[_0x4a46('0xd')](function(){if(_0x574c7c===_0x4a46('0x44')){var _0x451cf8=_[_0x4a46('0x45')](_0x52bf21[_0x4a46('0x46')],'id');return _0x52bf21['removeChatInteractions'](_0x451cf8)[_0x4a46('0xd')](function(){for(var _0x472124=0x0;_0x472124<_0x451cf8['length'];_0x472124+=0x1){_0x5950bf[_0x4a46('0x47')](_0x4a46('0x48'),{'ChatInteractionId':Number(_0x451cf8[_0x472124]),'UserId':Number(_0x52bf21['id'])});}});}})['then'](function(){if(_0x574c7c===_0x4a46('0x44')){var _0x100cc4=_[_0x4a46('0x45')](_0x52bf21[_0x4a46('0x21')],'id');return _0x52bf21['removeMailInteractions'](_0x100cc4)[_0x4a46('0xd')](function(){for(var _0x3654c9=0x0;_0x3654c9<_0x100cc4[_0x4a46('0x1b')];_0x3654c9+=0x1){_0x5950bf[_0x4a46('0x47')]('user_has_mail_interactions:remove',{'MailInteractionId':Number(_0x100cc4[_0x3654c9]),'UserId':Number(_0x52bf21['id'])});}});}})[_0x4a46('0xd')](function(){if(_0x574c7c===_0x4a46('0x44')){var _0x492f55=_[_0x4a46('0x45')](_0x52bf21[_0x4a46('0x23')],'id');return _0x52bf21[_0x4a46('0x49')](_0x492f55)[_0x4a46('0xd')](function(){for(var _0x20152=0x0;_0x20152<_0x492f55[_0x4a46('0x1b')];_0x20152+=0x1){_0x5950bf[_0x4a46('0x47')](_0x4a46('0x4a'),{'FaxInteractionId':Number(_0x492f55[_0x20152]),'UserId':Number(_0x52bf21['id'])});}});}})[_0x4a46('0xd')](function(){if(_0x574c7c===_0x4a46('0x44')){var _0x2ca669=_[_0x4a46('0x45')](_0x52bf21[_0x4a46('0x25')],'id');return _0x52bf21['removeSmsInteractions'](_0x2ca669)['then'](function(){for(var _0x11be9e=0x0;_0x11be9e<_0x2ca669['length'];_0x11be9e+=0x1){_0x5950bf[_0x4a46('0x47')]('user_has_sms_interactions:remove',{'SmsInteractionId':Number(_0x2ca669[_0x11be9e]),'UserId':Number(_0x52bf21['id'])});}});}})[_0x4a46('0xd')](function(){if(_0x574c7c==='leave'){var _0x27967f=_[_0x4a46('0x45')](_0x52bf21[_0x4a46('0x27')],'id');return _0x52bf21[_0x4a46('0x4b')](_0x27967f)[_0x4a46('0xd')](function(){for(var _0x3beb51=0x0;_0x3beb51<_0x27967f[_0x4a46('0x1b')];_0x3beb51+=0x1){_0x5950bf[_0x4a46('0x47')](_0x4a46('0x4c'),{'OpenchannelInteractionId':Number(_0x27967f[_0x3beb51]),'UserId':Number(_0x52bf21['id'])});}});}})[_0x4a46('0x4d')](function(_0x495c2c){_0x5223eb[_0x4a46('0x4e')](_0x495c2c);});}}function onDisconnect(_0x40d9f1,_0x5ae56f){joinOrLeave(_0x40d9f1,'leave',_0x5ae56f);}function onConnect(_0xdffa24){joinOrLeave(_0xdffa24,_0x4a46('0x4f'));}exports[_0x4a46('0x50')]=function(_0xdda368){_0xdda368['on']('connection',function(_0xaa21cb){_0xaa21cb[_0x4a46('0x51')](0x0);_0xaa21cb[_0x4a46('0x52')]=_0xaa21cb[_0x4a46('0x53')][_0x4a46('0x54')][_0x4a46('0x55')]+':'+_0xaa21cb['request']['connection'][_0x4a46('0x56')];_0xaa21cb[_0x4a46('0x57')]=new Date();_0xaa21cb['log']=function(_0x461d06){console['log'](_0x4a46('0x58')+_0xaa21cb['nsp'][_0x4a46('0x4')]+'['+_0xaa21cb[_0x4a46('0x52')]+']',_0x461d06);};_0xaa21cb['on'](_0x4a46('0x59'),function(){onDisconnect(_0xaa21cb,_0xdda368);_0xaa21cb[_0x4a46('0x4e')](_0x4a46('0x5a'));});onConnect(_0xaa21cb);_0xaa21cb['log'](_0x4a46('0x5b'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 5581b72..d3569e2 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 _0xf087=['newinteraction','afterUpdate','closedinteraction','ChatMessage','newmessage','Sms','SmsInteraction','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','info','Trigger,\x20%s','error','code','catch','get','channel','event','direction','UserId','User','find','name','interface','format','incomingmessage','opened','changed','closed','then','SIP/%s','default','length','hasOwnProperty','model','toLowerCase','condition','util','../../mysqldb','jayson/promise','../logger','client','Chat','ChatInteraction','afterCreate'];(function(_0x1254c8,_0x34e836){var _0x4c2496=function(_0x2e84ad){while(--_0x2e84ad){_0x1254c8['push'](_0x1254c8['shift']());}};_0x4c2496(++_0x34e836);}(_0xf087,0x198));var _0x7f08=function(_0x471e3d,_0x1105da){_0x471e3d=_0x471e3d-0x0;var _0x20130e=_0xf087[_0x471e3d];return _0x20130e;};'use strict';var util=require(_0x7f08('0x0'));var db=require(_0x7f08('0x1'))['db'];var jayson=require(_0x7f08('0x2'));var logger=require(_0x7f08('0x3'))('triggers');var client=jayson[_0x7f08('0x4')]['http']({'port':0x232a});var triggers=[{'channel':_0x7f08('0x5'),'model':_0x7f08('0x6'),'event':_0x7f08('0x7'),'condition':_0x7f08('0x8'),'callback':afterCreate},{'channel':'Chat','model':_0x7f08('0x6'),'event':_0x7f08('0x9'),'condition':_0x7f08('0xa'),'callback':afterUpdate},{'channel':_0x7f08('0x5'),'model':_0x7f08('0xb'),'event':_0x7f08('0x7'),'condition':_0x7f08('0xc'),'callback':afterCreateMessage},{'channel':_0x7f08('0xd'),'model':'SmsInteraction','event':_0x7f08('0x7'),'condition':'newinteraction','callback':afterCreate},{'channel':_0x7f08('0xd'),'model':_0x7f08('0xe'),'event':_0x7f08('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7f08('0xd'),'model':_0x7f08('0xf'),'event':'afterCreate','condition':'newmessage','callback':afterCreateMessage},{'channel':_0x7f08('0x10'),'model':_0x7f08('0x11'),'event':_0x7f08('0x7'),'condition':_0x7f08('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0x7f08('0x11'),'event':_0x7f08('0x9'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7f08('0x10'),'model':_0x7f08('0x12'),'event':_0x7f08('0x7'),'condition':_0x7f08('0xc'),'callback':afterCreateMessage},{'channel':_0x7f08('0x13'),'model':'MailInteraction','event':'afterCreate','condition':_0x7f08('0x8'),'callback':afterCreate},{'channel':_0x7f08('0x13'),'model':'MailInteraction','event':_0x7f08('0x9'),'condition':_0x7f08('0xa'),'callback':afterUpdate},{'channel':_0x7f08('0x13'),'model':_0x7f08('0x14'),'event':_0x7f08('0x7'),'condition':'newmessage','callback':afterCreateMessage},{'channel':'Openchannel','model':'OpenchannelInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0x7f08('0x15'),'model':_0x7f08('0x16'),'event':'afterUpdate','condition':'closedinteraction','callback':afterUpdate},{'channel':_0x7f08('0x15'),'model':'OpenchannelMessage','event':_0x7f08('0x7'),'condition':_0x7f08('0xc'),'callback':afterCreateMessage}];function request(_0x175d92){return client[_0x7f08('0x17')](_0x7f08('0x18'),_0x175d92)['then'](function(_0x34280a){logger[_0x7f08('0x19')](_0x7f08('0x1a'),_0x7f08('0x18'),_0x34280a);if(_0x34280a['error']){if(_0x34280a[_0x7f08('0x1b')][_0x7f08('0x1c')]===0x1f4){logger['error'](_0x7f08('0x1a'),'EventManager',_0x34280a[_0x7f08('0x1b')]);}}})[_0x7f08('0x1d')](function(_0x509bca){logger['error'](_0x7f08('0x1a'),_0x7f08('0x18'),_0x509bca);});}function afterCreateMessage(_0x8d80a7,_0x3fc508){return function(_0x5d5a1e,_0x58f769){_0x5d5a1e=_0x5d5a1e[_0x7f08('0x1e')]({'plain':!![]});_0x5d5a1e[_0x7f08('0x1f')]=_0x8d80a7;_0x5d5a1e[_0x7f08('0x20')]=_0x5d5a1e[_0x7f08('0x21')];if(_0x5d5a1e[_0x7f08('0x22')]){return db[_0x7f08('0x23')][_0x7f08('0x24')]({'where':{'id':_0x5d5a1e[_0x7f08('0x22')]},'attributes':['id',_0x7f08('0x25')],'raw':!![]})['then'](function(_0x168693){_0x5d5a1e[_0x7f08('0x26')]=util[_0x7f08('0x27')]('SIP/%s',_0x168693[_0x7f08('0x25')]);_0x5d5a1e['channel']=_0x8d80a7;return request({'event':_0x7f08('0x28'),'message':_0x5d5a1e});})[_0x7f08('0x1d')](function(_0x4bf519){console[_0x7f08('0x1b')](_0x4bf519);});}else{return request({'event':'outgoingmessage','message':_0x5d5a1e});}};}function afterCreate(_0x3ecd2a,_0x261b2b){return function(_0x2d704e,_0x21cc9a){_0x2d704e=_0x2d704e[_0x7f08('0x1e')]({'plain':!![]});_0x2d704e[_0x7f08('0x1f')]=_0x3ecd2a;_0x2d704e[_0x7f08('0x20')]=_0x7f08('0x29');return request({'event':_0x261b2b,'message':_0x2d704e});};}function afterUpdate(_0x46c7c,_0xf5c2cf){return function(_0x10179c,_0x38c359){if(_0x10179c[_0x7f08('0x2a')](_0x7f08('0x2b'))&&_0x10179c[_0x7f08('0x2b')]){_0x10179c=_0x10179c[_0x7f08('0x1e')]({'plain':!![]});_0x10179c[_0x7f08('0x1f')]=_0x46c7c;_0x10179c[_0x7f08('0x20')]=_0x7f08('0x2b');if(_0x10179c['UserId']){return db[_0x7f08('0x23')][_0x7f08('0x24')]({'where':{'id':_0x10179c['UserId']},'attributes':['id','name'],'raw':!![]})[_0x7f08('0x2c')](function(_0x356f50){_0x10179c[_0x7f08('0x26')]=util[_0x7f08('0x27')](_0x7f08('0x2d'),_0x356f50[_0x7f08('0x25')]);return request({'event':_0xf5c2cf,'message':_0x10179c});})[_0x7f08('0x1d')](function(_0x519b90){console['error'](_0x519b90);});}else{return request({'event':_0xf5c2cf,'message':_0x10179c});}}};}exports[_0x7f08('0x2e')]=function(){for(var _0x235dfd=0x0;_0x235dfd=_0xf652d1[_0xbd28('0x14')]){throw Error(_0xbd28('0x15'));}_0x29754d(_0xcd017e);})[_0xbd28('0x16')](function(_0x5af03b){_0xf93895(_0x5af03b);});});}; \ No newline at end of file +var _0x643d=['Maximum\x20login\x20has\x20been\x20reached','catch','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','openchannel','isValidChannel','toLowerCase','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents'];(function(_0x35116d,_0x30c8c7){var _0x16b2ab=function(_0x34301b){while(--_0x34301b){_0x35116d['push'](_0x35116d['shift']());}};_0x16b2ab(++_0x30c8c7);}(_0x643d,0x147));var _0xd643=function(_0x439b29,_0x21f296){_0x439b29=_0x439b29-0x0;var _0xf1bdd4=_0x643d[_0x439b29];return _0xf1bdd4;};'use strict';var _=require(_0xd643('0x0'));var BPromise=require(_0xd643('0x1'));var db=require(_0xd643('0x2'))['db'];var util=require(_0xd643('0x3'));var channels=[_0xd643('0x4'),_0xd643('0x5'),_0xd643('0x6'),_0xd643('0x7'),'sms',_0xd643('0x8')];exports['getChannels']=function(){return channels;};exports[_0xd643('0x9')]=function(_0x2eea38){_0x2eea38=_0x2eea38[_0xd643('0xa')]();return _[_0xd643('0xb')](channels,_0x2eea38);};exports[_0xd643('0xc')]=function(_0x362385,_0x24eee1,_0x37fe2f,_0x4744ee){var _0x432dc3={'loginAttempts':_0x24eee1,'blocked':_0x37fe2f};if(!_[_0xd643('0xd')](_0x4744ee)){_0x432dc3[_0xd643('0xe')]=_0x4744ee;}return _0x362385[_0xd643('0xf')](_0x432dc3);};exports[_0xd643('0x10')]=function(_0x4b2b15){return new BPromise(function(_0x48388a,_0x3129b0){var _0x535761=0x0;if(_0x4b2b15[_0xd643('0x11')]!==_0xd643('0x12')){_0x48388a(_0x4b2b15);}db[_0xd643('0x13')][_0xd643('0x14')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4b2b15['id']}}})[_0xd643('0x15')](function(_0x48c0cf){_0x535761=_0x48c0cf;return util[_0xd643('0x10')]();})[_0xd643('0x15')](function(_0x4dce1a){if(_0x4dce1a&&_0x4dce1a['agents']&&_0x535761>=_0x4dce1a[_0xd643('0x16')]){throw Error(_0xd643('0x17'));}_0x48388a(_0x4b2b15);})[_0xd643('0x18')](function(_0x1bbaa8){_0x3129b0(_0x1bbaa8);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index ec626d0..f05d9fd 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x608f=['status','render','json','exports','404'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x608f,0x13e));var _0xf608=function(_0x4b4dbd,_0x341276){_0x4b4dbd=_0x4b4dbd-0x0;var _0x5df992=_0x608f[_0x4b4dbd];return _0x5df992;};'use strict';module[_0xf608('0x0')][0x194]=function pageNotFound(_0x494a00,_0x81b7a7){var _0x302082=_0xf608('0x1');var _0x67dbc=0x194;var _0x16d842={'status':_0x67dbc};_0x81b7a7[_0xf608('0x2')](_0x16d842[_0xf608('0x2')]);_0x81b7a7[_0xf608('0x3')](_0x302082,{},function(_0x935a44,_0x110b2b){if(_0x935a44){return _0x81b7a7[_0xf608('0x2')](_0x16d842[_0xf608('0x2')])[_0xf608('0x4')](_0x16d842);}_0x81b7a7['send'](_0x110b2b);});}; \ No newline at end of file +var _0xa7c4=['404','status','render','send'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0xa7c4,0x174));var _0x4a7c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa7c4[_0x3dd15e];return _0x231fd0;};'use strict';module['exports'][0x194]=function pageNotFound(_0x33d01b,_0x1e9188){var _0x7b6723=_0x4a7c('0x0');var _0x1890d8=0x194;var _0x50e422={'status':_0x1890d8};_0x1e9188[_0x4a7c('0x1')](_0x50e422[_0x4a7c('0x1')]);_0x1e9188[_0x4a7c('0x2')](_0x7b6723,{},function(_0x51a318,_0x2f2f72){if(_0x51a318){return _0x1e9188[_0x4a7c('0x1')](_0x50e422[_0x4a7c('0x1')])['json'](_0x50e422);}_0x1e9188[_0x4a7c('0x3')](_0x2f2f72);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 97c5f91..c1163d0 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x3f5d=['Cdr','../api/cdr/cdr.model','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','Variable','Integration','IntegrationReport','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskField/intZendeskField.model','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowField','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','SquareOdbc','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','hasOne','VoiceMail','cascade','UserId','hasMany','Recordings','VoiceQueuesRt','Extensions','CmHopperFinal','CmHopperHistory','HopperHistory','ReportAgentPreview','ChatInteractions','MailInteractions','belongsTo','userProfileId','Groups','chat_group_has_users','belongsToMany','Contacts','CmList','Lists','cm_user_has_lists','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteractions','user_has_sms_interactions','OpenchannelInteractions','user_has_openchannel_interactions','VoiceQueues','MailQueues','ChatQueues','FaxQueues','SmsQueues','UserSmsQueue','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','Applications','Sounds','UserVoiceQueueRt','VoiceQueueId','CmHopperBlack','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','mailboxuser','QueueCalls','uniqueid','VoiceAgentReport','AgentReports','Contact','MailAccountId','MailServerOut','MailServerIn','Imap','Smtp','Dispositions','Interactions','MailApplication','List','ListId','TemplateId','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachments','Interaction','restrict','MailQueueReport','ContactId','Items','FaxAccountId','Answers','Exntensions','FaxMessage','TagId','FaxInteractionId','fax_interaction_has_tags','team_has_fax_queues','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','AttachmentId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Agent','ChatQueue','Queue','ChatQueueId','chat_interaction_has_tags','ChatInteractionId','ChatOfflineMessage','team_has_chat_queues','ChatGroupId','CompanyId','HopperFinals','JscriptySessionReport','cm_user_has_contacts','cm_contact_has_tags','AutomationAllId','OneAny','AutomationAnyId','Action','Actions','Intervals','MailApplications','ChatApplications','FaxApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','AllConditions','TriggerAllId','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','DescriptionId','FieldId','Subject','Field','VariableId','SugarcrmConfiguration','SugarcrmField','DeskConfiguration','Descriptions','int_desk_configuration_has_tags','Description','ZendeskAccount','ZendeskField','int_zendesk_configuration_has_tags','FreshdeskAccount','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','ServicenowConfiguration','Dynamics365Configuration','ToId','SessionId','JscriptyProject','ProjectId','OpenchannelQueues','Hoppers','CampaignId','HopperHistories','SquareProjectId','campaigns_has_cm_blacklists','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','FromAccount','ToChatQueueId','ToChatWebsiteId','ToAccount','FaxTransferReport','ToFaxQueueId','ToFaxAccountId','ToOpenchannelQueueId','ToOpenchannelAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','UserProfile','UserProfileSections','Resources','sectionId','exports','path','../config/environment','jstz','sequelize','defaultsDeep','xC@LL1234','127.0.0.1','mysql','utf8mb4','name','utf8','sequelizeHistory','motion2','xcall','utf8_general_ci','username','password','database','options','User','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailQueue','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailApplication/mailApplication.model','../api/mailQueueReport/mailQueueReport.model','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','ChatApplication','../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/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','CmContact','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','../api/reportAgentPreview/reportAgentPreview.model','../api/action/action.model','Automation','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','../api/pause/pause.model'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x3f5d,0x14f));var _0xd3f5=function(_0xabb53a,_0x223c2b){_0xabb53a=_0xabb53a-0x0;var _0x12e9fd=_0x3f5d[_0xabb53a];return _0x12e9fd;};'use strict';var path=require(_0xd3f5('0x0'));var config=require(_0xd3f5('0x1'));var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xd3f5('0x2'));var timezone=jstz['determine']();config[_0xd3f5('0x3')]=_[_0xd3f5('0x4')](config[_0xd3f5('0x3')],{'database':'motion2','username':'xcall','password':_0xd3f5('0x5'),'options':{'host':_0xd3f5('0x6'),'port':0xcea,'dialect':_0xd3f5('0x7'),'dialectOptions':{'charset':_0xd3f5('0x8')},'logging':![],'timezone':timezone[_0xd3f5('0x9')](),'define':{'charset':_0xd3f5('0xa'),'collate':'utf8_general_ci'}}});config[_0xd3f5('0xb')]=_[_0xd3f5('0x4')](config['sequelizeHistory'],{'database':_0xd3f5('0xc'),'username':_0xd3f5('0xd'),'password':_0xd3f5('0x5'),'options':{'host':_0xd3f5('0x6'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':_0xd3f5('0x8')},'logging':![],'timezone':timezone[_0xd3f5('0x9')](),'define':{'charset':_0xd3f5('0xa'),'collate':_0xd3f5('0xe')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd3f5('0x3')]['database'],config[_0xd3f5('0x3')][_0xd3f5('0xf')],config[_0xd3f5('0x3')][_0xd3f5('0x10')],config['sequelize']['options'])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xd3f5('0xb')][_0xd3f5('0x11')],config['sequelizeHistory']['username'],config[_0xd3f5('0xb')]['password'],config[_0xd3f5('0xb')][_0xd3f5('0x12')])};db[_0xd3f5('0x13')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x15'));db[_0xd3f5('0x16')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x17'));db[_0xd3f5('0x18')]=db[_0xd3f5('0x3')]['import']('../api/voiceContext/voiceContext.model');db[_0xd3f5('0x19')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/voiceExtension/voiceExtension.model');db[_0xd3f5('0x1a')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x1b'));db[_0xd3f5('0x1c')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x1d'));db[_0xd3f5('0x1e')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x1f'));db[_0xd3f5('0x20')]=db['sequelize'][_0xd3f5('0x14')]('../api/screenRecording/screenRecording.model');db['VoiceMail']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x21'));db[_0xd3f5('0x22')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x23'));db[_0xd3f5('0x24')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x25'));db[_0xd3f5('0x26')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/voiceDialReport/voiceDialReport.model');db['VoiceAgentReport']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x27'));db[_0xd3f5('0x28')]=db['sequelize'][_0xd3f5('0x14')]('../api/voiceQueueReport/voiceQueueReport.model');db['MemberReport']=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/memberReport/memberReport.model');db[_0xd3f5('0x29')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x2a'));db[_0xd3f5('0x2b')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x2c'));db['UserVoiceQueueRt']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x2d'));db[_0xd3f5('0x2e')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x2f'));db[_0xd3f5('0x30')]=db['sequelize'][_0xd3f5('0x14')]('../api/userChatQueue/userChatQueue.model');db[_0xd3f5('0x31')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x32'));db[_0xd3f5('0x33')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x34'));db['UserSmsQueue']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x35'));db[_0xd3f5('0x36')]=db[_0xd3f5('0x3')]['import']('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['MailServerIn']=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x37'));db[_0xd3f5('0x38')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x39'));db[_0xd3f5('0x3a')]=db['sequelize']['import'](_0xd3f5('0x3b'));db['MailSubstatus']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x3c'));db[_0xd3f5('0x3d')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x3e'));db[_0xd3f5('0x3f')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x40'));db['MailApplication']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x41'));db['MailQueueReport']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x42'));db['Dashboard']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x43'));db[_0xd3f5('0x44')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x45'));db['FaxAccount']=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x46'));db[_0xd3f5('0x47')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x48'));db[_0xd3f5('0x49')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x4a'));db['FaxMessage']=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x4b'));db[_0xd3f5('0x4c')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x4d'));db[_0xd3f5('0x4e')]=db['sequelize'][_0xd3f5('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0xd3f5('0x4f')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x50'));db[_0xd3f5('0x51')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x52'));db[_0xd3f5('0x53')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x54'));db[_0xd3f5('0x55')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x56'));db[_0xd3f5('0x57')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x58'));db[_0xd3f5('0x59')]=db['sequelize'][_0xd3f5('0x14')]('../api/openchannelAccount/openchannelAccount.model');db[_0xd3f5('0x5a')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x5b'));db[_0xd3f5('0x5c')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x5d'));db[_0xd3f5('0x5e')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x5f'));db[_0xd3f5('0x60')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x61'));db[_0xd3f5('0x62')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x63'));db['OpenchannelQueueReport']=db[_0xd3f5('0x3')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db[_0xd3f5('0x64')]=db['sequelize']['import'](_0xd3f5('0x65'));db[_0xd3f5('0x66')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x67'));db[_0xd3f5('0x68')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x69'));db['ChatOfflineMessage']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x6a'));db['ChatQueue']=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x6b'));db[_0xd3f5('0x6c')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x6d'));db[_0xd3f5('0x6e')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x6f'));db[_0xd3f5('0x70')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x71'));db[_0xd3f5('0x72')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/cmContact/cmContact.model');db[_0xd3f5('0x73')]=db['sequelize']['import'](_0xd3f5('0x74'));db['CmHopperBlack']=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x75'));db['CmHopperFinal']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x76'));db['CmHopperHistory']=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x77'));db['ReportAgentPreview']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x78'));db['CmCustomField']=db['sequelize']['import']('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x79'));db[_0xd3f5('0x7a')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x7b'));db[_0xd3f5('0x7c')]=db['sequelize']['import'](_0xd3f5('0x7d'));db[_0xd3f5('0x7e')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x7f'));db[_0xd3f5('0x80')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x81'));db[_0xd3f5('0x82')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x83'));db[_0xd3f5('0x84')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x85'));db[_0xd3f5('0x86')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x87'));db['VoiceQueuesLog']=db[_0xd3f5('0x3')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xd3f5('0x88')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0x89'));db[_0xd3f5('0x8a')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x8b'));db[_0xd3f5('0x8c')]=db['sequelize']['import'](_0xd3f5('0x8d'));db[_0xd3f5('0x8e')]=db['sequelize']['import'](_0xd3f5('0x8f'));db[_0xd3f5('0x90')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/trigger/trigger.model');db[_0xd3f5('0x91')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/variable/variable.model');db[_0xd3f5('0x92')]=db['sequelize'][_0xd3f5('0x14')]('../api/integration/integration.model');db[_0xd3f5('0x93')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/integrationReport/integrationReport.model');db[_0xd3f5('0x94')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0x95'));db[_0xd3f5('0x96')]=db[_0xd3f5('0x3')]['import']('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x97'));db[_0xd3f5('0x98')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x99'));db[_0xd3f5('0x9a')]=db['sequelize']['import'](_0xd3f5('0x9b'));db[_0xd3f5('0x9c')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x9d'));db[_0xd3f5('0x9e')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0x9f'));db[_0xd3f5('0xa0')]=db['sequelize']['import']('../api/intSalesforceConfiguration/intSalesforceConfiguration.model');db[_0xd3f5('0xa1')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xa2'));db[_0xd3f5('0xa3')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xa4'));db['SugarcrmConfiguration']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xa5'));db['SugarcrmField']=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xa6'));db[_0xd3f5('0xa7')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0xa8'));db['DeskConfiguration']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xa9'));db[_0xd3f5('0xaa')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xab'));db[_0xd3f5('0xac')]=db['sequelize']['import'](_0xd3f5('0xad'));db[_0xd3f5('0xae')]=db['sequelize'][_0xd3f5('0x14')]('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0xd3f5('0xaf')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xb0'));db['ZendeskAccount']=db[_0xd3f5('0x3')]['import'](_0xd3f5('0xb1'));db[_0xd3f5('0xb2')]=db['sequelize']['import']('../api/intZendeskConfiguration/intZendeskConfiguration.model');db['ZendeskField']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xb3'));db['FreshdeskAccount']=db[_0xd3f5('0x3')]['import'](_0xd3f5('0xb4'));db['FreshdeskConfiguration']=db[_0xd3f5('0x3')]['import']('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xd3f5('0xb5')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0xb6'));db[_0xd3f5('0xb7')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xb8'));db[_0xd3f5('0xb9')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xba'));db[_0xd3f5('0xbb')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/intVtigerField/intVtigerField.model');db[_0xd3f5('0xbc')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xbd'));db['ServicenowConfiguration']=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0xd3f5('0xbe')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/intServicenowField/intServicenowField.model');db[_0xd3f5('0xbf')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0xc0'));db['Dynamics365Configuration']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xc1'));db[_0xd3f5('0xc2')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0xc3'));db[_0xd3f5('0x92')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/integration/integration.model');db[_0xd3f5('0xc4')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xc5'));db[_0xd3f5('0xc6')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xc7'));db[_0xd3f5('0xc8')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xc9'));db[_0xd3f5('0xca')]=db[_0xd3f5('0x3')]['import'](_0xd3f5('0xcb'));db[_0xd3f5('0xcc')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xcd'));db['JscriptySessionReport']=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xce'));db[_0xd3f5('0xcf')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xd0'));db[_0xd3f5('0xd1')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xd2'));db[_0xd3f5('0xd3')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xd4'));db['JscriptyProject']=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/jscriptyProject/jscriptyProject.model');db[_0xd3f5('0xd5')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xd6'));db[_0xd3f5('0xd7')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xd8'));db[_0xd3f5('0xd9')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xda'));db['SquareRecording']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xdb'));db[_0xd3f5('0xdc')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xdd'));db[_0xd3f5('0xde')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xdf'));db[_0xd3f5('0xe0')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/license/license.model');db[_0xd3f5('0xe1')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xe2'));db['Migration']=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/migration/migration.model');db[_0xd3f5('0xe3')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xe4'));db[_0xd3f5('0xe5')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xe6'));db[_0xd3f5('0xe7')]=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xe8'));db[_0xd3f5('0xe9')]=db['sequelize']['import'](_0xd3f5('0xea'));db['FaxTransferReport']=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xeb'));db[_0xd3f5('0xec')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xed'));db['SmsTransferReport']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xee'));db['CmList']=db['sequelize'][_0xd3f5('0x14')](_0xd3f5('0xef'));db[_0xd3f5('0xf0')]=db[_0xd3f5('0x3')]['import']('../api/voicePrefix/voicePrefix.model');db['UserProfile']=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xf1'));db[_0xd3f5('0xf2')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')](_0xd3f5('0xf3'));db[_0xd3f5('0xf4')]=db[_0xd3f5('0x3')][_0xd3f5('0x14')]('../api/userProfileResource/userProfileResource.model');db[_0xd3f5('0x13')][_0xd3f5('0xf5')](db[_0xd3f5('0xf6')],{'as':_0xd3f5('0xf6'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x13')][_0xd3f5('0xf9')](db[_0xd3f5('0x1e')],{'as':_0xd3f5('0xfa'),'foreignKey':'UserId'});db[_0xd3f5('0x13')][_0xd3f5('0xf9')](db['UserVoiceQueueRt'],{'as':_0xd3f5('0xfb'),'foreignKey':'UserId'});db['User'][_0xd3f5('0xf9')](db[_0xd3f5('0x19')],{'as':_0xd3f5('0xfc'),'onDelete':_0xd3f5('0xf7'),'hooks':!![]});db[_0xd3f5('0x13')][_0xd3f5('0xf9')](db[_0xd3f5('0xfd')],{'as':'HopperFinals','foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x13')]['hasMany'](db[_0xd3f5('0xfe')],{'as':_0xd3f5('0xff'),'foreignKey':'UserId'});db[_0xd3f5('0x13')][_0xd3f5('0xf9')](db[_0xd3f5('0x100')],{'as':'ReportAgentPreview','foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x13')][_0xd3f5('0xf9')](db[_0xd3f5('0x5c')],{'as':'OpenchannelInteractions','foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x13')][_0xd3f5('0xf9')](db[_0xd3f5('0x66')],{'as':_0xd3f5('0x101'),'foreignKey':_0xd3f5('0xf8')});db['User'][_0xd3f5('0xf9')](db[_0xd3f5('0x53')],{'as':'SmsInteractions','foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x13')][_0xd3f5('0xf9')](db[_0xd3f5('0x49')],{'as':'FaxInteractions','foreignKey':'UserId'});db['User'][_0xd3f5('0xf9')](db[_0xd3f5('0x3d')],{'as':_0xd3f5('0x102'),'foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x13')][_0xd3f5('0x103')](db['UserProfile'],{'as':'UserProfile','foreignKey':_0xd3f5('0x104')});db['User']['belongsToMany'](db['ChatGroup'],{'as':_0xd3f5('0x105'),'through':_0xd3f5('0x106')});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db['CmContact'],{'as':_0xd3f5('0x108'),'through':'cm_user_has_contacts'});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x10a'),'through':_0xd3f5('0x10b')});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0xde')],{'through':_0xd3f5('0x10c')});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x3d')],{'as':'MailInteractions','through':_0xd3f5('0x10d')});db['User'][_0xd3f5('0x107')](db[_0xd3f5('0x66')],{'as':'ChatInteractions','through':_0xd3f5('0x10e')});db[_0xd3f5('0x13')]['belongsToMany'](db[_0xd3f5('0x49')],{'as':_0xd3f5('0x10f'),'through':_0xd3f5('0x110')});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x53')],{'as':_0xd3f5('0x111'),'through':_0xd3f5('0x112')});db['User'][_0xd3f5('0x107')](db['OpenchannelInteraction'],{'as':_0xd3f5('0x113'),'through':_0xd3f5('0x114')});db['User'][_0xd3f5('0x107')](db[_0xd3f5('0x1c')],{'as':_0xd3f5('0x115'),'through':_0xd3f5('0x2e'),'required':![]});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x3a')],{'as':_0xd3f5('0x116'),'through':_0xd3f5('0x31'),'required':![]});db['User'][_0xd3f5('0x107')](db['ChatQueue'],{'as':_0xd3f5('0x117'),'through':_0xd3f5('0x30'),'required':![],'hooks':!![]});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db['FaxQueue'],{'as':_0xd3f5('0x118'),'through':'UserFaxQueue','required':![]});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x57')],{'as':_0xd3f5('0x119'),'through':_0xd3f5('0x11a'),'required':![]});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db['OpenchannelQueue'],{'as':'OpenchannelQueues','through':'UserOpenchannelQueue','required':![]});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x109')],{'through':_0xd3f5('0x10b')});db[_0xd3f5('0x13')]['belongsToMany'](db[_0xd3f5('0xf0')],{'as':_0xd3f5('0x11b'),'through':_0xd3f5('0x11c'),'required':![]});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x62')],{'as':_0xd3f5('0x11d'),'through':_0xd3f5('0x11e')});db['User'][_0xd3f5('0x107')](db[_0xd3f5('0x11f')],{'as':_0xd3f5('0x120'),'through':_0xd3f5('0x121')});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x38')],{'as':'MailAccounts','through':_0xd3f5('0x122')});db[_0xd3f5('0x13')]['belongsToMany'](db[_0xd3f5('0x59')],{'as':_0xd3f5('0x123'),'through':_0xd3f5('0x124')});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db[_0xd3f5('0x4f')],{'as':_0xd3f5('0x125'),'through':_0xd3f5('0x126')});db[_0xd3f5('0x13')][_0xd3f5('0x107')](db['SquareProject'],{'as':_0xd3f5('0x127'),'through':_0xd3f5('0x128')});db[_0xd3f5('0x16')]['hasMany'](db[_0xd3f5('0x19')],{'as':_0xd3f5('0x129'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x12a')});db[_0xd3f5('0x18')][_0xd3f5('0xf9')](db[_0xd3f5('0x19')],{'onDelete':_0xd3f5('0xf7')});db['VoiceExtension'][_0xd3f5('0xf9')](db['VoiceExtension'],{'as':_0xd3f5('0x12b'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x1a')][_0xd3f5('0x107')](db[_0xd3f5('0x8a')],{'as':_0xd3f5('0x12c'),'through':'moh_has_sounds'});db[_0xd3f5('0x1c')]['hasMany'](db[_0xd3f5('0x12d')],{'as':'Members','foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db['CmHopper'],{'as':'Hoppers','foreignKey':_0xd3f5('0x12e')});db[_0xd3f5('0x1c')][_0xd3f5('0xf9')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xd3f5('0x12e')});db[_0xd3f5('0x1c')][_0xd3f5('0xf9')](db[_0xd3f5('0xfe')],{'as':'HopperHistories','foreignKey':_0xd3f5('0x12e')});db[_0xd3f5('0x1c')]['hasMany'](db['ReportAgentPreview'],{'as':_0xd3f5('0x100'),'foreignKey':_0xd3f5('0x12e')});db['VoiceQueue'][_0xd3f5('0xf9')](db[_0xd3f5('0x12f')],{'as':_0xd3f5('0x130'),'foreignKey':_0xd3f5('0x12e')});db[_0xd3f5('0x1c')]['hasMany'](db['JscriptySessionReport'],{'as':_0xd3f5('0x131'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0xd3f5('0x103')](db['Trunk'],{'as':'Trunk','foreignKey':_0xd3f5('0x132')});db[_0xd3f5('0x1c')]['belongsTo'](db[_0xd3f5('0x29')],{'as':_0xd3f5('0x133'),'foreignKey':_0xd3f5('0x134')});db[_0xd3f5('0x1c')][_0xd3f5('0x103')](db[_0xd3f5('0x82')],{'as':_0xd3f5('0x82'),'foreignKey':_0xd3f5('0x135')});db[_0xd3f5('0x1c')][_0xd3f5('0x103')](db[_0xd3f5('0x84')],{'as':_0xd3f5('0x136'),'foreignKey':_0xd3f5('0x137')});db[_0xd3f5('0x1c')]['belongsToMany'](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x10a'),'through':_0xd3f5('0x138')});db[_0xd3f5('0x1c')]['belongsToMany'](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x139'),'through':_0xd3f5('0x2e')});db['VoiceQueue'][_0xd3f5('0x107')](db['Team'],{'as':_0xd3f5('0x13a'),'through':_0xd3f5('0x13b')});db[_0xd3f5('0x1c')][_0xd3f5('0x107')](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x13c'),'through':_0xd3f5('0x13d')});db[_0xd3f5('0x1e')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x13'),'foreignKey':'UserId'});db[_0xd3f5('0x20')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x13'),'foreignKey':'UserId'});db[_0xd3f5('0xf6')][_0xd3f5('0xf9')](db[_0xd3f5('0x22')],{'as':_0xd3f5('0x13e'),'onDelete':_0xd3f5('0xf7'),'foreignKey':'mailboxuser','sourceKey':_0xd3f5('0x13f')});db[_0xd3f5('0x22')]['belongsTo'](db[_0xd3f5('0xf6')],{'foreignKey':_0xd3f5('0x140'),'targetKey':'mailbox'});db[_0xd3f5('0x24')][_0xd3f5('0xf9')](db['VoiceQueueReport'],{'as':_0xd3f5('0x141'),'foreignKey':_0xd3f5('0x142'),'constraints':![]});db[_0xd3f5('0x24')][_0xd3f5('0xf9')](db[_0xd3f5('0x143')],{'as':_0xd3f5('0x144'),'foreignKey':_0xd3f5('0x142'),'constraints':![]});db[_0xd3f5('0x24')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x13'),'foreignKey':_0xd3f5('0xf8')});db['VoiceCallReport'][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'as':_0xd3f5('0x145'),'foreignKey':'ContactId'});db['MailServerIn'][_0xd3f5('0x103')](db[_0xd3f5('0x38')],{'as':_0xd3f5('0x38'),'foreignKey':_0xd3f5('0x146')});db[_0xd3f5('0x147')][_0xd3f5('0x103')](db[_0xd3f5('0x38')],{'as':_0xd3f5('0x38'),'foreignKey':_0xd3f5('0x146')});db[_0xd3f5('0x38')][_0xd3f5('0xf5')](db[_0xd3f5('0x148')],{'as':_0xd3f5('0x149'),'onDelete':'cascade'});db[_0xd3f5('0x38')]['hasOne'](db[_0xd3f5('0x147')],{'as':_0xd3f5('0x14a'),'onDelete':'cascade'});db[_0xd3f5('0x38')][_0xd3f5('0xf9')](db['Disposition'],{'as':_0xd3f5('0x14b'),'foreignKey':_0xd3f5('0x146')});db[_0xd3f5('0x38')][_0xd3f5('0xf9')](db[_0xd3f5('0x7c')],{'as':'Answers','foreignKey':_0xd3f5('0x146')});db['MailAccount'][_0xd3f5('0xf9')](db['MailMessage'],{'as':_0xd3f5('0x13e'),'foreignKey':'MailAccountId'});db[_0xd3f5('0x38')]['hasMany'](db[_0xd3f5('0x3d')],{'as':_0xd3f5('0x14c')});db[_0xd3f5('0x38')][_0xd3f5('0xf9')](db[_0xd3f5('0x14d')],{'as':_0xd3f5('0x12b')});db[_0xd3f5('0x38')][_0xd3f5('0x103')](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db['MailAccount'][_0xd3f5('0x103')](db[_0xd3f5('0x8e')],{'as':_0xd3f5('0x8e'),'foreignKey':_0xd3f5('0x150')});db['MailAccount'][_0xd3f5('0x103')](db['Pause'],{'as':'mandatoryDispositionPause','foreignKey':_0xd3f5('0x137')});db[_0xd3f5('0x38')][_0xd3f5('0x107')](db['User'],{'as':'Agents','through':_0xd3f5('0x122')});db['MailQueue'][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x139'),'through':_0xd3f5('0x31')});db[_0xd3f5('0x3a')]['belongsToMany'](db[_0xd3f5('0xde')],{'through':_0xd3f5('0x151'),'as':_0xd3f5('0x13a')});db[_0xd3f5('0x3d')][_0xd3f5('0xf9')](db[_0xd3f5('0x3f')],{'as':_0xd3f5('0x13e'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x152')});db[_0xd3f5('0x3d')][_0xd3f5('0x103')](db[_0xd3f5('0x38')],{'as':_0xd3f5('0x153'),'foreignKey':'MailAccountId'});db[_0xd3f5('0x3d')]['belongsTo'](db[_0xd3f5('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0xd3f5('0x3d')][_0xd3f5('0x103')](db['User'],{'as':_0xd3f5('0x154'),'foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x3d')][_0xd3f5('0x107')](db['Tag'],{'through':_0xd3f5('0x155'),'as':_0xd3f5('0x156')});db[_0xd3f5('0x3d')]['belongsToMany'](db[_0xd3f5('0x8c')],{'through':_0xd3f5('0x155'),'as':_0xd3f5('0x157')});db[_0xd3f5('0x3d')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x158'),'through':_0xd3f5('0x10d'),'foreignKey':_0xd3f5('0x152')});db[_0xd3f5('0x3f')]['hasMany'](db[_0xd3f5('0xe3')],{'as':_0xd3f5('0x159'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x3f')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x13')});db[_0xd3f5('0x3f')][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'onDelete':_0xd3f5('0xf7'),'as':'Contact'});db[_0xd3f5('0x3f')]['belongsTo'](db[_0xd3f5('0x3d')],{'as':_0xd3f5('0x15a'),'foreignKey':'MailInteractionId'});db[_0xd3f5('0x3f')][_0xd3f5('0x103')](db['MailAccount'],{'as':_0xd3f5('0x153'),'foreignKey':'MailAccountId'});db[_0xd3f5('0x14d')][_0xd3f5('0x103')](db['User'],{'onDelete':_0xd3f5('0x15b')});db['MailApplication']['belongsTo'](db[_0xd3f5('0x3a')],{'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x14d')]['belongsTo'](db[_0xd3f5('0x38')],{'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x14d')][_0xd3f5('0x103')](db['Interval'],{'onDelete':_0xd3f5('0x15b'),'foreignKey':_0xd3f5('0x135')});db[_0xd3f5('0x14d')][_0xd3f5('0x103')](db[_0xd3f5('0x8c')],{'onDelete':'restrict','foreignKey':'TagId'});db['MailQueueReport'][_0xd3f5('0x103')](db['MailAccount'],{});db[_0xd3f5('0x15c')]['belongsTo'](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0x15c')][_0xd3f5('0x103')](db['CmContact'],{'as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d')});db['MailQueueReport']['belongsTo'](db[_0xd3f5('0x3d')],{});db[_0xd3f5('0x15c')][_0xd3f5('0x103')](db[_0xd3f5('0x3f')],{});db[_0xd3f5('0x15c')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{});db['MailQueueReport']['belongsTo'](db[_0xd3f5('0x3a')],{});db['Dashboard']['hasMany'](db['DashboardItem'],{'as':_0xd3f5('0x15e'),'onDelete':'cascade'});db[_0xd3f5('0x11f')][_0xd3f5('0xf9')](db[_0xd3f5('0x7e')],{'as':_0xd3f5('0x14b'),'foreignKey':_0xd3f5('0x15f')});db[_0xd3f5('0x11f')]['hasMany'](db[_0xd3f5('0x7c')],{'as':_0xd3f5('0x160'),'foreignKey':_0xd3f5('0x15f')});db[_0xd3f5('0x11f')][_0xd3f5('0xf9')](db['FaxInteraction'],{'as':_0xd3f5('0x14c')});db[_0xd3f5('0x11f')][_0xd3f5('0xf9')](db[_0xd3f5('0x47')],{'as':_0xd3f5('0x12b')});db['FaxAccount']['hasMany'](db['VoiceExtension'],{'as':_0xd3f5('0x161'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x11f')][_0xd3f5('0xf9')](db[_0xd3f5('0x162')],{'as':_0xd3f5('0x13e')});db['FaxAccount'][_0xd3f5('0x103')](db['Trunk'],{'as':'Trunk'});db['FaxAccount'][_0xd3f5('0x103')](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0x11f')][_0xd3f5('0x103')](db[_0xd3f5('0x84')],{'as':_0xd3f5('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd3f5('0x11f')]['belongsToMany'](db['User'],{'as':'Agents','through':'user_has_fax_accounts'});db[_0xd3f5('0x47')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x47')][_0xd3f5('0x103')](db[_0xd3f5('0x4c')],{'onDelete':'restrict'});db[_0xd3f5('0x47')][_0xd3f5('0x103')](db[_0xd3f5('0x11f')],{'onDelete':'restrict'});db[_0xd3f5('0x47')][_0xd3f5('0x103')](db['Tag'],{'onDelete':_0xd3f5('0x15b'),'foreignKey':_0xd3f5('0x163')});db[_0xd3f5('0x49')][_0xd3f5('0xf9')](db['FaxMessage'],{'as':_0xd3f5('0x13e'),'onDelete':'cascade','foreignKey':_0xd3f5('0x164')});db['FaxInteraction'][_0xd3f5('0x103')](db[_0xd3f5('0x11f')],{'as':_0xd3f5('0x153'),'foreignKey':'FaxAccountId'});db[_0xd3f5('0x49')]['belongsTo'](db[_0xd3f5('0x72')],{'as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x49')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x154'),'foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x49')][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0xd3f5('0x49')][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':_0xd3f5('0x165'),'as':'ThroughTags'});db[_0xd3f5('0x49')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':'Users','through':_0xd3f5('0x110'),'foreignKey':_0xd3f5('0x164')});db[_0xd3f5('0x162')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'onDelete':_0xd3f5('0xf7'),'as':_0xd3f5('0x13')});db[_0xd3f5('0x162')][_0xd3f5('0x103')](db[_0xd3f5('0x49')],{'as':_0xd3f5('0x15a'),'foreignKey':'FaxInteractionId'});db['FaxMessage']['belongsTo'](db[_0xd3f5('0x72')],{'onDelete':_0xd3f5('0xf7'),'as':_0xd3f5('0x145')});db['FaxMessage'][_0xd3f5('0x103')](db[_0xd3f5('0xe3')],{'as':_0xd3f5('0xe3'),'foreignKey':'AttachmentId'});db[_0xd3f5('0x162')][_0xd3f5('0x103')](db[_0xd3f5('0x11f')],{'as':'Account','foreignKey':'FaxAccountId'});db['FaxQueue'][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x139'),'through':_0xd3f5('0x33')});db['FaxQueue'][_0xd3f5('0x107')](db[_0xd3f5('0xde')],{'through':_0xd3f5('0x166'),'as':_0xd3f5('0x13a')});db[_0xd3f5('0x4e')]['belongsTo'](db[_0xd3f5('0x11f')],{});db[_0xd3f5('0x4e')]['belongsTo'](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db['FaxQueueReport']['belongsTo'](db[_0xd3f5('0x72')],{'as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x4e')]['belongsTo'](db[_0xd3f5('0x49')],{});db[_0xd3f5('0x4e')][_0xd3f5('0x103')](db[_0xd3f5('0x162')],{});db[_0xd3f5('0x4e')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{});db[_0xd3f5('0x4e')][_0xd3f5('0x103')](db[_0xd3f5('0x4c')],{});db[_0xd3f5('0x4f')][_0xd3f5('0xf9')](db[_0xd3f5('0x7e')],{'as':_0xd3f5('0x14b'),'foreignKey':'SmsAccountId'});db[_0xd3f5('0x4f')][_0xd3f5('0xf9')](db['CannedAnswer'],{'as':_0xd3f5('0x160'),'foreignKey':'SmsAccountId'});db[_0xd3f5('0x4f')]['hasMany'](db[_0xd3f5('0x55')],{'as':'Messages','foreignKey':'SmsAccountId'});db[_0xd3f5('0x4f')]['hasMany'](db[_0xd3f5('0x53')],{'as':'Interactions'});db[_0xd3f5('0x4f')]['hasMany'](db['SmsApplication'],{'as':'Applications'});db[_0xd3f5('0x4f')][_0xd3f5('0x103')](db['CmList'],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0x4f')]['belongsTo'](db[_0xd3f5('0x84')],{'as':'mandatoryDispositionPause','foreignKey':_0xd3f5('0x137')});db[_0xd3f5('0x4f')][_0xd3f5('0x107')](db['User'],{'as':_0xd3f5('0x139'),'through':'user_has_sms_accounts'});db['SmsApplication'][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x51')][_0xd3f5('0x103')](db[_0xd3f5('0x57')],{'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x51')][_0xd3f5('0x103')](db[_0xd3f5('0x4f')],{'onDelete':'restrict'});db['SmsApplication'][_0xd3f5('0x103')](db['Interval'],{'onDelete':_0xd3f5('0x15b'),'foreignKey':_0xd3f5('0x135')});db[_0xd3f5('0x51')][_0xd3f5('0x103')](db[_0xd3f5('0x8c')],{'onDelete':'restrict','foreignKey':_0xd3f5('0x163')});db['SmsInteraction'][_0xd3f5('0xf9')](db[_0xd3f5('0x55')],{'as':_0xd3f5('0x13e'),'onDelete':_0xd3f5('0xf7'),'foreignKey':'SmsInteractionId'});db[_0xd3f5('0x53')]['belongsTo'](db[_0xd3f5('0x4f')],{'as':_0xd3f5('0x153'),'foreignKey':'SmsAccountId'});db[_0xd3f5('0x53')]['belongsTo'](db[_0xd3f5('0x72')],{'as':_0xd3f5('0x145'),'foreignKey':'ContactId'});db[_0xd3f5('0x53')][_0xd3f5('0x103')](db['User'],{'as':'Owner','foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x53')]['belongsToMany'](db[_0xd3f5('0x8c')],{'through':_0xd3f5('0x167'),'as':_0xd3f5('0x156')});db['SmsInteraction'][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db['SmsInteraction']['belongsToMany'](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x158'),'through':'user_has_sms_interactions','foreignKey':'SmsInteractionId'});db[_0xd3f5('0x55')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x13')});db[_0xd3f5('0x55')][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'onDelete':'cascade','as':'Contact'});db[_0xd3f5('0x55')]['belongsTo'](db[_0xd3f5('0x53')],{'onDelete':'cascade','as':_0xd3f5('0x15a'),'foreignKey':'SmsInteractionId'});db[_0xd3f5('0x55')][_0xd3f5('0x103')](db['SmsAccount'],{'as':_0xd3f5('0x153'),'foreignKey':'SmsAccountId'});db['SmsQueue']['belongsToMany'](db['User'],{'as':'Agents','through':'UserSmsQueue','foreignKey':_0xd3f5('0x168')});db[_0xd3f5('0x57')][_0xd3f5('0x107')](db[_0xd3f5('0xde')],{'through':_0xd3f5('0x169'),'as':_0xd3f5('0x13a')});db[_0xd3f5('0x59')][_0xd3f5('0xf9')](db[_0xd3f5('0x7e')],{'as':_0xd3f5('0x14b'),'foreignKey':_0xd3f5('0x16a')});db[_0xd3f5('0x59')]['hasMany'](db[_0xd3f5('0x7c')],{'as':_0xd3f5('0x160'),'foreignKey':_0xd3f5('0x16a')});db[_0xd3f5('0x59')]['hasMany'](db[_0xd3f5('0x5c')],{'as':_0xd3f5('0x14c'),'foreignKey':_0xd3f5('0x16a')});db[_0xd3f5('0x59')][_0xd3f5('0xf9')](db[_0xd3f5('0x5e')],{'as':_0xd3f5('0x13e'),'foreignKey':_0xd3f5('0x16a')});db[_0xd3f5('0x59')]['hasMany'](db[_0xd3f5('0x5a')],{'as':_0xd3f5('0x12b'),'foreignKey':_0xd3f5('0x16a')});db[_0xd3f5('0x59')][_0xd3f5('0x103')](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db['OpenchannelAccount'][_0xd3f5('0x103')](db[_0xd3f5('0x84')],{'as':_0xd3f5('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd3f5('0x59')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x139'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x5a')][_0xd3f5('0x103')](db['OpenchannelQueue'],{'onDelete':_0xd3f5('0x15b'),'foreignKey':_0xd3f5('0x16b')});db['OpenchannelApplication'][_0xd3f5('0x103')](db['OpenchannelAccount'],{'onDelete':_0xd3f5('0x15b'),'foreignKey':_0xd3f5('0x16a')});db[_0xd3f5('0x5a')][_0xd3f5('0x103')](db[_0xd3f5('0x82')],{'onDelete':'restrict','foreignKey':_0xd3f5('0x135')});db[_0xd3f5('0x5a')][_0xd3f5('0x103')](db[_0xd3f5('0x8c')],{'onDelete':_0xd3f5('0x15b'),'foreignKey':_0xd3f5('0x163')});db[_0xd3f5('0x5c')][_0xd3f5('0xf9')](db['OpenchannelMessage'],{'as':_0xd3f5('0x13e'),'onDelete':_0xd3f5('0xf7'),'foreignKey':'OpenchannelInteractionId'});db[_0xd3f5('0x5c')]['belongsTo'](db['OpenchannelAccount'],{'as':'Account','foreignKey':_0xd3f5('0x16a')});db['OpenchannelInteraction'][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x5c')][_0xd3f5('0x103')](db['User'],{'as':'Owner','foreignKey':'UserId'});db[_0xd3f5('0x5c')][_0xd3f5('0x107')](db['Tag'],{'through':_0xd3f5('0x16c'),'as':'Tags'});db['OpenchannelInteraction'][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':_0xd3f5('0x16c'),'as':'ThroughTags'});db[_0xd3f5('0x5c')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x158'),'through':_0xd3f5('0x114'),'foreignKey':_0xd3f5('0x16d')});db['OpenchannelMessage'][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'onDelete':_0xd3f5('0xf7'),'as':'User'});db[_0xd3f5('0x5e')][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'onDelete':_0xd3f5('0xf7'),'as':_0xd3f5('0x145')});db[_0xd3f5('0x5e')][_0xd3f5('0x103')](db[_0xd3f5('0x5c')],{'onDelete':'cascade','as':_0xd3f5('0x15a'),'foreignKey':_0xd3f5('0x16d')});db[_0xd3f5('0x5e')]['belongsTo'](db[_0xd3f5('0xe3')],{'as':'Attachment','foreignKey':_0xd3f5('0x16e')});db[_0xd3f5('0x5e')][_0xd3f5('0x103')](db[_0xd3f5('0x59')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xd3f5('0x60')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x139'),'through':_0xd3f5('0x36'),'foreignKey':_0xd3f5('0x16b')});db['OpenchannelQueue'][_0xd3f5('0x107')](db[_0xd3f5('0xde')],{'through':_0xd3f5('0x16f'),'as':'Teams'});db[_0xd3f5('0x62')]['hasMany'](db[_0xd3f5('0x7e')],{'as':_0xd3f5('0x14b'),'foreignKey':_0xd3f5('0x170')});db[_0xd3f5('0x62')][_0xd3f5('0xf9')](db[_0xd3f5('0x7c')],{'as':_0xd3f5('0x160'),'foreignKey':_0xd3f5('0x170')});db[_0xd3f5('0x62')][_0xd3f5('0xf9')](db[_0xd3f5('0x6e')],{'as':_0xd3f5('0x171')});db[_0xd3f5('0x62')][_0xd3f5('0xf9')](db[_0xd3f5('0x66')],{'as':_0xd3f5('0x14c')});db[_0xd3f5('0x62')][_0xd3f5('0xf9')](db[_0xd3f5('0x64')],{'as':_0xd3f5('0x12b')});db['ChatWebsite'][_0xd3f5('0xf9')](db[_0xd3f5('0x68')],{'as':_0xd3f5('0x13e')});db['ChatWebsite'][_0xd3f5('0x103')](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0x62')]['belongsTo'](db[_0xd3f5('0x82')],{'as':_0xd3f5('0x82'),'foreignKey':'IntervalId'});db[_0xd3f5('0x62')][_0xd3f5('0x103')](db[_0xd3f5('0x84')],{'as':_0xd3f5('0x136'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xd3f5('0x62')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':'Agents','through':'user_has_chat_websites'});db['OpenchannelQueueReport'][_0xd3f5('0x103')](db[_0xd3f5('0x59')],{});db[_0xd3f5('0x172')][_0xd3f5('0x103')](db['CmList'],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0x172')][_0xd3f5('0x103')](db['CmContact'],{'as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x172')][_0xd3f5('0x103')](db[_0xd3f5('0x5c')],{});db['OpenchannelQueueReport']['belongsTo'](db[_0xd3f5('0x5e')],{});db[_0xd3f5('0x172')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{});db[_0xd3f5('0x172')][_0xd3f5('0x103')](db[_0xd3f5('0x60')],{});db[_0xd3f5('0x64')]['belongsTo'](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x173'),'foreignKey':_0xd3f5('0xf8'),'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x64')][_0xd3f5('0x103')](db[_0xd3f5('0x174')],{'as':_0xd3f5('0x175'),'foreignKey':_0xd3f5('0x176'),'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x64')][_0xd3f5('0x103')](db[_0xd3f5('0x62')],{'as':'Website','foreignKey':_0xd3f5('0x170'),'onDelete':_0xd3f5('0x15b')});db['ChatApplication'][_0xd3f5('0x103')](db['Tag'],{'onDelete':_0xd3f5('0x15b'),'foreignKey':_0xd3f5('0x163')});db[_0xd3f5('0x66')][_0xd3f5('0xf9')](db[_0xd3f5('0x68')],{'as':_0xd3f5('0x13e'),'onDelete':'cascade','foreignKey':'ChatInteractionId'});db[_0xd3f5('0x66')]['belongsTo'](db[_0xd3f5('0x62')],{'as':_0xd3f5('0x153'),'foreignKey':_0xd3f5('0x170')});db[_0xd3f5('0x66')][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x66')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':'Owner','foreignKey':_0xd3f5('0xf8')});db[_0xd3f5('0x66')][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':_0xd3f5('0x177'),'as':'Tags'});db[_0xd3f5('0x66')][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':_0xd3f5('0x177'),'as':_0xd3f5('0x157')});db['ChatInteraction'][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x158'),'through':_0xd3f5('0x10e'),'foreignKey':'ChatInteractionId'});db[_0xd3f5('0x68')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'onDelete':_0xd3f5('0xf7'),'as':_0xd3f5('0x13')});db[_0xd3f5('0x68')][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'onDelete':'cascade','as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x68')][_0xd3f5('0x103')](db[_0xd3f5('0x66')],{'onDelete':_0xd3f5('0xf7'),'as':_0xd3f5('0x15a'),'foreignKey':_0xd3f5('0x178')});db[_0xd3f5('0x68')][_0xd3f5('0x103')](db['Attachment'],{'as':_0xd3f5('0xe3'),'foreignKey':_0xd3f5('0x16e')});db[_0xd3f5('0x68')][_0xd3f5('0x103')](db[_0xd3f5('0x62')],{'as':_0xd3f5('0x153'),'foreignKey':_0xd3f5('0x170')});db['ChatOfflineMessage']['belongsTo'](db[_0xd3f5('0x72')],{'onDelete':_0xd3f5('0xf7'),'as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x179')][_0xd3f5('0x103')](db[_0xd3f5('0x62')],{'as':'Account','foreignKey':_0xd3f5('0x170')});db[_0xd3f5('0x174')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':'Agents','through':_0xd3f5('0x30'),'hooks':!![]});db[_0xd3f5('0x174')][_0xd3f5('0x107')](db[_0xd3f5('0xde')],{'through':_0xd3f5('0x17a'),'as':_0xd3f5('0x13a')});db['ChatGroup'][_0xd3f5('0xf9')](db[_0xd3f5('0xc8')],{'as':_0xd3f5('0x13e'),'foreignKey':_0xd3f5('0x17b'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x6c')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':'Members','through':_0xd3f5('0x106')});db[_0xd3f5('0x6e')]['belongsTo'](db[_0xd3f5('0x62')],{'as':'Website','foreignKey':_0xd3f5('0x170')});db['CmCompany']['hasMany'](db[_0xd3f5('0x72')],{'as':_0xd3f5('0x108'),'foreignKey':_0xd3f5('0x17c')});db[_0xd3f5('0x72')][_0xd3f5('0xf9')](db[_0xd3f5('0x73')],{'as':'Hoppers','foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x72')]['hasMany'](db[_0xd3f5('0xfd')],{'as':_0xd3f5('0x17d'),'foreignKey':'ContactId'});db[_0xd3f5('0x72')]['hasMany'](db[_0xd3f5('0xfe')],{'as':'HopperHistories','foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x72')][_0xd3f5('0xf9')](db[_0xd3f5('0x100')],{'as':_0xd3f5('0x100'),'foreignKey':'ContactId'});db[_0xd3f5('0x72')]['hasMany'](db[_0xd3f5('0x17e')],{'as':_0xd3f5('0x131'),'foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0x72')][_0xd3f5('0xf9')](db[_0xd3f5('0x5c')],{'as':_0xd3f5('0x113'),'foreignKey':_0xd3f5('0x15d'),'onDelete':'restrict'});db['CmContact'][_0xd3f5('0xf9')](db[_0xd3f5('0x66')],{'as':'ChatInteractions','foreignKey':_0xd3f5('0x15d'),'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x72')][_0xd3f5('0xf9')](db[_0xd3f5('0x53')],{'as':_0xd3f5('0x111'),'foreignKey':_0xd3f5('0x15d'),'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x72')][_0xd3f5('0xf9')](db[_0xd3f5('0x49')],{'as':'FaxInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0xd3f5('0x72')]['hasMany'](db[_0xd3f5('0x3d')],{'as':_0xd3f5('0x102'),'foreignKey':_0xd3f5('0x15d'),'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x72')][_0xd3f5('0x103')](db[_0xd3f5('0x70')],{'as':'Company','foreignKey':'CompanyId'});db[_0xd3f5('0x72')][_0xd3f5('0x103')](db['CmList'],{'as':'List','foreignKey':_0xd3f5('0x14f'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x72')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x158'),'through':_0xd3f5('0x17f')});db['CmContact'][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'as':_0xd3f5('0x156'),'through':_0xd3f5('0x180')});db[_0xd3f5('0x72')]['belongsToMany'](db['Tag'],{'through':'cm_contact_has_tags','as':_0xd3f5('0x157')});db[_0xd3f5('0x73')][_0xd3f5('0x103')](db['CmContact'],{'as':_0xd3f5('0x145'),'foreignKey':_0xd3f5('0x15d'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x73')]['belongsTo'](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x73')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':'Agent','foreignKey':'UserId'});db[_0xd3f5('0x73')][_0xd3f5('0x103')](db[_0xd3f5('0x1c')],{'as':_0xd3f5('0x175'),'foreignKey':_0xd3f5('0x12e'),'onDelete':_0xd3f5('0xf7')});db['CmHopper']['belongsTo'](db['Campaign'],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x73')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x154'),'foreignKey':'OwnerId'});db[_0xd3f5('0x12f')][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'as':'Contact','foreignKey':_0xd3f5('0x15d'),'onDelete':_0xd3f5('0xf7')});db['CmHopperBlack']['belongsTo'](db['CmList'],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f'),'onDelete':'cascade'});db[_0xd3f5('0x12f')][_0xd3f5('0x103')](db['VoiceQueue'],{'as':_0xd3f5('0x175'),'foreignKey':'VoiceQueueId','onDelete':'cascade'});db['CmHopperBlack'][_0xd3f5('0x103')](db[_0xd3f5('0xe1')],{'as':_0xd3f5('0xe1'),'foreignKey':'CampaignId','onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0x7a')][_0xd3f5('0xf9')](db[_0xd3f5('0x80')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':_0xd3f5('0x181'),'onDelete':_0xd3f5('0xf7'),'hooks':!![]});db[_0xd3f5('0x7a')][_0xd3f5('0xf9')](db['Condition'],{'as':{'plural':'Any','singular':_0xd3f5('0x182')},'foreignKey':_0xd3f5('0x183'),'onDelete':'cascade','hooks':!![]});db[_0xd3f5('0x7a')][_0xd3f5('0xf9')](db[_0xd3f5('0x184')],{'as':_0xd3f5('0x185'),'foreignKey':'AutomationId','onDelete':_0xd3f5('0xf7'),'hooks':!![]});db[_0xd3f5('0x82')][_0xd3f5('0xf9')](db['Interval'],{'as':_0xd3f5('0x186'),'foreignKey':_0xd3f5('0x135'),'onDelete':_0xd3f5('0xf7'),'hooks':!![],'required':![]});db['Interval'][_0xd3f5('0xf9')](db[_0xd3f5('0x19')],{'as':'Extensions','foreignKey':_0xd3f5('0x135'),'onDelete':_0xd3f5('0x15b')});db[_0xd3f5('0x82')][_0xd3f5('0xf9')](db[_0xd3f5('0x14d')],{'as':_0xd3f5('0x187'),'foreignKey':_0xd3f5('0x135')});db['Interval']['hasMany'](db[_0xd3f5('0x64')],{'as':_0xd3f5('0x188'),'foreignKey':_0xd3f5('0x135')});db[_0xd3f5('0x82')][_0xd3f5('0xf9')](db[_0xd3f5('0x47')],{'as':_0xd3f5('0x189'),'foreignKey':_0xd3f5('0x135')});db[_0xd3f5('0x82')]['hasMany'](db[_0xd3f5('0x51')],{'as':'SmsApplications','foreignKey':_0xd3f5('0x135')});db['Schedule'][_0xd3f5('0x103')](db[_0xd3f5('0x38')],{});db[_0xd3f5('0x88')][_0xd3f5('0x103')](db[_0xd3f5('0x96')],{'foreignKey':_0xd3f5('0x18a')});db[_0xd3f5('0x88')][_0xd3f5('0x103')](db['AnalyticCustomReport'],{'foreignKey':_0xd3f5('0x18b')});db['Sound'][_0xd3f5('0x107')](db[_0xd3f5('0x1a')],{'as':_0xd3f5('0x18c'),'through':_0xd3f5('0x18d'),'onDelete':'restrict'});db[_0xd3f5('0x8c')]['belongsToMany'](db[_0xd3f5('0x72')],{'through':_0xd3f5('0x180')});db[_0xd3f5('0x8c')][_0xd3f5('0x107')](db[_0xd3f5('0x66')],{'through':_0xd3f5('0x177')});db[_0xd3f5('0x8c')][_0xd3f5('0x107')](db[_0xd3f5('0x3d')],{'through':_0xd3f5('0x155')});db['Tag'][_0xd3f5('0x107')](db[_0xd3f5('0x53')],{'through':_0xd3f5('0x167')});db[_0xd3f5('0x8c')]['belongsToMany'](db['FaxInteraction'],{'through':_0xd3f5('0x165')});db[_0xd3f5('0x8c')][_0xd3f5('0x107')](db[_0xd3f5('0x5c')],{'through':_0xd3f5('0x16c')});db[_0xd3f5('0x90')]['hasMany'](db[_0xd3f5('0x80')],{'as':{'plural':_0xd3f5('0x18e'),'singular':'AllCondition'},'foreignKey':_0xd3f5('0x18f'),'onDelete':'cascade','hooks':!![]});db[_0xd3f5('0x90')][_0xd3f5('0xf9')](db[_0xd3f5('0x80')],{'as':{'plural':_0xd3f5('0x190'),'singular':_0xd3f5('0x191')},'foreignKey':_0xd3f5('0x192'),'onDelete':_0xd3f5('0xf7'),'hooks':!![]});db[_0xd3f5('0x90')][_0xd3f5('0xf9')](db[_0xd3f5('0x184')],{'as':_0xd3f5('0x185'),'foreignKey':_0xd3f5('0x193'),'onDelete':_0xd3f5('0xf7'),'hooks':!![]});db[_0xd3f5('0x94')]['hasMany'](db[_0xd3f5('0x9a')],{'as':_0xd3f5('0x194'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x18b'),'hooks':!![]});db[_0xd3f5('0x96')][_0xd3f5('0xf9')](db[_0xd3f5('0x9a')],{'as':'Fields','onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x18a')});db[_0xd3f5('0x98')]['hasMany'](db[_0xd3f5('0x9a')],{'as':_0xd3f5('0x194'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x195')});db['AnalyticFieldReport'][_0xd3f5('0x103')](db[_0xd3f5('0x98')],{'foreignKey':_0xd3f5('0x195')});db['SalesforceAccount'][_0xd3f5('0xf9')](db['SalesforceConfiguration'],{'as':_0xd3f5('0x196'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0xa0')][_0xd3f5('0xf9')](db[_0xd3f5('0xa1')],{'as':_0xd3f5('0x198'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0xa0')][_0xd3f5('0xf9')](db[_0xd3f5('0xa1')],{'as':'Descriptions','onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19a')});db['SalesforceConfiguration'][_0xd3f5('0xf9')](db[_0xd3f5('0xa1')],{'as':_0xd3f5('0x194'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0xa0')]['belongsTo'](db[_0xd3f5('0x9e')],{'as':_0xd3f5('0x153'),'foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0xa1')][_0xd3f5('0xf9')](db['SalesforceField'],{'as':_0xd3f5('0x19c'),'foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0xa1')]['hasMany'](db[_0xd3f5('0xa1')],{'as':'Description','foreignKey':_0xd3f5('0x19a')});db['SalesforceField'][_0xd3f5('0xf9')](db[_0xd3f5('0xa1')],{'as':_0xd3f5('0x19d'),'foreignKey':'FieldId'});db['SalesforceField'][_0xd3f5('0x103')](db[_0xd3f5('0x91')],{'as':'Variable','foreignKey':_0xd3f5('0x19e')});db[_0xd3f5('0xa3')][_0xd3f5('0xf9')](db['SugarcrmConfiguration'],{'as':_0xd3f5('0x196'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0x19f')][_0xd3f5('0xf9')](db[_0xd3f5('0x1a0')],{'as':_0xd3f5('0x198'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x199')});db['SugarcrmConfiguration'][_0xd3f5('0xf9')](db[_0xd3f5('0x1a0')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0x19f')][_0xd3f5('0xf9')](db[_0xd3f5('0x1a0')],{'as':'Fields','onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0x19f')]['belongsTo'](db[_0xd3f5('0xa3')],{'as':_0xd3f5('0x153'),'foreignKey':'AccountId'});db[_0xd3f5('0x1a0')][_0xd3f5('0xf9')](db[_0xd3f5('0x1a0')],{'as':_0xd3f5('0x19c'),'foreignKey':'SubjectId'});db[_0xd3f5('0x1a0')]['hasMany'](db[_0xd3f5('0x1a0')],{'as':'Description','foreignKey':'DescriptionId'});db['SugarcrmField'][_0xd3f5('0xf9')](db[_0xd3f5('0x1a0')],{'as':_0xd3f5('0x19d'),'foreignKey':'FieldId'});db[_0xd3f5('0x1a0')][_0xd3f5('0x103')](db[_0xd3f5('0x91')],{'as':_0xd3f5('0x91'),'foreignKey':'VariableId'});db['DeskAccount'][_0xd3f5('0xf9')](db[_0xd3f5('0x1a1')],{'as':_0xd3f5('0x196'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0x1a1')][_0xd3f5('0xf9')](db[_0xd3f5('0xaa')],{'as':_0xd3f5('0x198'),'onDelete':'cascade','foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0x1a1')][_0xd3f5('0xf9')](db[_0xd3f5('0xaa')],{'as':_0xd3f5('0x1a2'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19a')});db['DeskConfiguration'][_0xd3f5('0xf9')](db[_0xd3f5('0xaa')],{'as':_0xd3f5('0x194'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0x1a1')][_0xd3f5('0x103')](db[_0xd3f5('0xa7')],{'as':_0xd3f5('0x153'),'foreignKey':_0xd3f5('0x197')});db['DeskConfiguration'][_0xd3f5('0x107')](db['Tag'],{'through':_0xd3f5('0x1a3')});db[_0xd3f5('0xaa')][_0xd3f5('0xf9')](db[_0xd3f5('0xaa')],{'as':_0xd3f5('0x19c'),'foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0xaa')]['hasMany'](db['DeskField'],{'as':'Description','foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0xaa')][_0xd3f5('0xf9')](db[_0xd3f5('0xaa')],{'as':_0xd3f5('0x19d'),'foreignKey':_0xd3f5('0x19b')});db['DeskField'][_0xd3f5('0x103')](db[_0xd3f5('0x91')],{'as':_0xd3f5('0x91'),'foreignKey':_0xd3f5('0x19e')});db[_0xd3f5('0xac')][_0xd3f5('0xf9')](db[_0xd3f5('0xae')],{'as':_0xd3f5('0x196'),'onDelete':'cascade','foreignKey':_0xd3f5('0x197')});db['ZohoConfiguration'][_0xd3f5('0xf9')](db[_0xd3f5('0xaf')],{'as':_0xd3f5('0x198'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x199')});db['ZohoConfiguration'][_0xd3f5('0xf9')](db['ZohoField'],{'as':'Descriptions','onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0xae')][_0xd3f5('0xf9')](db['ZohoField'],{'as':'Fields','onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0xae')][_0xd3f5('0x103')](db[_0xd3f5('0xac')],{'as':'Account','foreignKey':'AccountId'});db[_0xd3f5('0xaf')][_0xd3f5('0xf9')](db['ZohoField'],{'as':_0xd3f5('0x19c'),'foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0xaf')][_0xd3f5('0xf9')](db['ZohoField'],{'as':_0xd3f5('0x1a4'),'foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0xaf')][_0xd3f5('0xf9')](db[_0xd3f5('0xaf')],{'as':_0xd3f5('0x19d'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0xaf')]['belongsTo'](db[_0xd3f5('0x91')],{'as':_0xd3f5('0x91'),'foreignKey':_0xd3f5('0x19e')});db[_0xd3f5('0x1a5')]['hasMany'](db[_0xd3f5('0xb2')],{'as':_0xd3f5('0x196'),'onDelete':'cascade','foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0xb2')][_0xd3f5('0xf9')](db['ZendeskField'],{'as':'Subjects','foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0xb2')][_0xd3f5('0xf9')](db[_0xd3f5('0x1a6')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xd3f5('0xb2')]['hasMany'](db['ZendeskField'],{'as':'Fields','foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0xb2')][_0xd3f5('0x103')](db[_0xd3f5('0x1a5')],{'as':_0xd3f5('0x153'),'foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0xb2')][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':_0xd3f5('0x1a7')});db[_0xd3f5('0x1a6')][_0xd3f5('0xf9')](db[_0xd3f5('0x1a6')],{'as':'Subject','foreignKey':_0xd3f5('0x199')});db['ZendeskField']['hasMany'](db[_0xd3f5('0x1a6')],{'as':_0xd3f5('0x1a4'),'foreignKey':'DescriptionId'});db[_0xd3f5('0x1a6')]['hasMany'](db[_0xd3f5('0x1a6')],{'as':_0xd3f5('0x19d'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0x1a6')][_0xd3f5('0x103')](db[_0xd3f5('0x91')],{'as':'Variable','foreignKey':_0xd3f5('0x19e')});db[_0xd3f5('0x1a8')][_0xd3f5('0xf9')](db[_0xd3f5('0x1a9')],{'as':_0xd3f5('0x196'),'onDelete':_0xd3f5('0xf7'),'foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0xd3f5('0xf9')](db['FreshdeskField'],{'as':_0xd3f5('0x198'),'onDelete':_0xd3f5('0xf7'),'foreignKey':'SubjectId'});db[_0xd3f5('0x1a9')][_0xd3f5('0xf9')](db[_0xd3f5('0xb5')],{'as':_0xd3f5('0x1a2'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0x1a9')][_0xd3f5('0xf9')](db[_0xd3f5('0xb5')],{'as':_0xd3f5('0x194'),'onDelete':_0xd3f5('0xf7'),'foreignKey':'FieldId'});db[_0xd3f5('0x1a9')][_0xd3f5('0x103')](db['FreshdeskAccount'],{'as':_0xd3f5('0x153'),'foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0x1a9')][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':_0xd3f5('0x1aa')});db[_0xd3f5('0xb5')][_0xd3f5('0xf9')](db[_0xd3f5('0xb5')],{'as':_0xd3f5('0x19c'),'foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0xb5')]['hasMany'](db[_0xd3f5('0xb5')],{'as':_0xd3f5('0x1a4'),'foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0xb5')]['hasMany'](db[_0xd3f5('0xb5')],{'as':_0xd3f5('0x19d'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0xb5')][_0xd3f5('0x103')](db[_0xd3f5('0x91')],{'as':_0xd3f5('0x91'),'foreignKey':'VariableId'});db[_0xd3f5('0xb7')][_0xd3f5('0xf9')](db[_0xd3f5('0xb9')],{'as':_0xd3f5('0x196'),'onDelete':'cascade','foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0xb9')][_0xd3f5('0xf9')](db['VtigerField'],{'as':_0xd3f5('0x198'),'foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0xb9')][_0xd3f5('0xf9')](db['VtigerField'],{'as':_0xd3f5('0x1a2'),'foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0xb9')]['hasMany'](db[_0xd3f5('0xbb')],{'as':_0xd3f5('0x194'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0xb9')][_0xd3f5('0x103')](db[_0xd3f5('0xb7')],{'as':_0xd3f5('0x153'),'foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0xb9')][_0xd3f5('0x107')](db[_0xd3f5('0x8c')],{'through':'int_vtiger_configuration_has_tags'});db[_0xd3f5('0xbb')][_0xd3f5('0xf9')](db[_0xd3f5('0xbb')],{'as':'Subject','foreignKey':_0xd3f5('0x199')});db['VtigerField']['hasMany'](db[_0xd3f5('0xbb')],{'as':_0xd3f5('0x1a4'),'foreignKey':_0xd3f5('0x19a')});db['VtigerField'][_0xd3f5('0xf9')](db[_0xd3f5('0xbb')],{'as':_0xd3f5('0x19d'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0xbb')][_0xd3f5('0x103')](db[_0xd3f5('0x91')],{'as':'Variable','foreignKey':_0xd3f5('0x19e')});db['ServicenowAccount']['hasMany'](db[_0xd3f5('0x1ab')],{'as':_0xd3f5('0x196'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xd3f5('0x1ab')][_0xd3f5('0xf9')](db['ServicenowField'],{'as':'Subjects','foreignKey':_0xd3f5('0x199')});db['ServicenowConfiguration'][_0xd3f5('0xf9')](db[_0xd3f5('0xbe')],{'as':_0xd3f5('0x1a2'),'foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0x1ab')][_0xd3f5('0xf9')](db[_0xd3f5('0xbe')],{'as':_0xd3f5('0x194'),'foreignKey':_0xd3f5('0x19b')});db['ServicenowConfiguration'][_0xd3f5('0x103')](db[_0xd3f5('0xbc')],{'as':_0xd3f5('0x153'),'foreignKey':_0xd3f5('0x197')});db['ServicenowField']['hasMany'](db[_0xd3f5('0xbe')],{'as':_0xd3f5('0x19c'),'foreignKey':_0xd3f5('0x199')});db['ServicenowField'][_0xd3f5('0xf9')](db[_0xd3f5('0xbe')],{'as':_0xd3f5('0x1a4'),'foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0xbe')][_0xd3f5('0xf9')](db['ServicenowField'],{'as':_0xd3f5('0x19d'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0xbe')][_0xd3f5('0x103')](db['Variable'],{'as':_0xd3f5('0x91'),'foreignKey':_0xd3f5('0x19e')});db[_0xd3f5('0xbf')][_0xd3f5('0xf9')](db[_0xd3f5('0x1ac')],{'as':'Configurations','onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x197')});db['Dynamics365Configuration'][_0xd3f5('0xf9')](db['Dynamics365Field'],{'as':_0xd3f5('0x198'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x199')});db[_0xd3f5('0x1ac')]['hasMany'](db[_0xd3f5('0xc2')],{'as':'Descriptions','onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19a')});db[_0xd3f5('0x1ac')][_0xd3f5('0xf9')](db[_0xd3f5('0xc2')],{'as':_0xd3f5('0x194'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x19b')});db[_0xd3f5('0x1ac')][_0xd3f5('0x103')](db[_0xd3f5('0xbf')],{'as':'Account','foreignKey':_0xd3f5('0x197')});db[_0xd3f5('0xc2')][_0xd3f5('0xf9')](db[_0xd3f5('0xc2')],{'as':_0xd3f5('0x19c'),'foreignKey':'SubjectId'});db[_0xd3f5('0xc2')][_0xd3f5('0xf9')](db[_0xd3f5('0xc2')],{'as':_0xd3f5('0x1a4'),'foreignKey':'DescriptionId'});db['Dynamics365Field']['hasMany'](db[_0xd3f5('0xc2')],{'as':_0xd3f5('0x19d'),'foreignKey':_0xd3f5('0x19b')});db['Dynamics365Field']['belongsTo'](db[_0xd3f5('0x91')],{'as':_0xd3f5('0x91'),'foreignKey':_0xd3f5('0x19e')});db['ChatQueueReport']['belongsTo'](db['ChatWebsite'],{});db[_0xd3f5('0xc6')]['belongsTo'](db[_0xd3f5('0x109')],{'as':_0xd3f5('0x14e'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0xc6')][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'as':'Contact','foreignKey':'ContactId'});db[_0xd3f5('0xc6')][_0xd3f5('0x103')](db[_0xd3f5('0x66')],{});db[_0xd3f5('0xc6')]['belongsTo'](db[_0xd3f5('0x68')],{});db[_0xd3f5('0xc6')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{});db[_0xd3f5('0xc6')][_0xd3f5('0x103')](db[_0xd3f5('0x174')],{});db[_0xd3f5('0xc8')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'onDelete':_0xd3f5('0xf7'),'foreignKey':'FromId'});db['ChatInternalMessage'][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x1ad')});db[_0xd3f5('0x17e')][_0xd3f5('0xf9')](db[_0xd3f5('0xcc')],{'foreignKey':_0xd3f5('0x1ae'),'onDelete':'cascade'});db['JscriptySessionReport'][_0xd3f5('0xf9')](db['JscriptyAnswerReport'],{'foreignKey':_0xd3f5('0x1ae'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0xcf')][_0xd3f5('0x103')](db[_0xd3f5('0x4f')],{});db[_0xd3f5('0xcf')][_0xd3f5('0x103')](db['CmList'],{'as':'List','foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0xcf')][_0xd3f5('0x103')](db[_0xd3f5('0x72')],{'as':'Contact','foreignKey':_0xd3f5('0x15d')});db[_0xd3f5('0xcf')][_0xd3f5('0x103')](db['SmsInteraction'],{});db['SmsQueueReport'][_0xd3f5('0x103')](db[_0xd3f5('0x55')],{});db['SmsQueueReport'][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{});db[_0xd3f5('0xcf')][_0xd3f5('0x103')](db[_0xd3f5('0x57')],{});db[_0xd3f5('0x1af')][_0xd3f5('0xf9')](db[_0xd3f5('0x17e')],{'foreignKey':_0xd3f5('0x1b0')});db[_0xd3f5('0x1af')][_0xd3f5('0xf9')](db[_0xd3f5('0xcc')],{'foreignKey':_0xd3f5('0x1b0')});db[_0xd3f5('0x1af')][_0xd3f5('0xf9')](db[_0xd3f5('0xca')],{'foreignKey':_0xd3f5('0x1b0')});db[_0xd3f5('0xd9')][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':'Users','through':_0xd3f5('0x128')});db[_0xd3f5('0xde')]['belongsToMany'](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x139'),'through':_0xd3f5('0x10c')});db[_0xd3f5('0xde')][_0xd3f5('0x107')](db['VoiceQueue'],{'through':_0xd3f5('0x13b'),'as':_0xd3f5('0x115')});db[_0xd3f5('0xde')]['belongsToMany'](db[_0xd3f5('0x3a')],{'through':_0xd3f5('0x151'),'as':_0xd3f5('0x116')});db[_0xd3f5('0xde')]['belongsToMany'](db[_0xd3f5('0x174')],{'through':_0xd3f5('0x17a'),'as':_0xd3f5('0x117')});db[_0xd3f5('0xde')][_0xd3f5('0x107')](db['FaxQueue'],{'through':_0xd3f5('0x166'),'as':_0xd3f5('0x118')});db[_0xd3f5('0xde')][_0xd3f5('0x107')](db[_0xd3f5('0x57')],{'through':_0xd3f5('0x169'),'as':_0xd3f5('0x119')});db[_0xd3f5('0xde')][_0xd3f5('0x107')](db[_0xd3f5('0x60')],{'through':'team_has_openchannel_queues','as':_0xd3f5('0x1b1')});db['Campaign'][_0xd3f5('0xf9')](db[_0xd3f5('0x73')],{'as':_0xd3f5('0x1b2'),'foreignKey':_0xd3f5('0x1b3')});db[_0xd3f5('0xe1')][_0xd3f5('0xf9')](db[_0xd3f5('0xfd')],{'as':_0xd3f5('0x17d'),'foreignKey':_0xd3f5('0x1b3')});db['Campaign']['hasMany'](db[_0xd3f5('0xfe')],{'as':_0xd3f5('0x1b4'),'foreignKey':'CampaignId'});db[_0xd3f5('0xe1')][_0xd3f5('0xf9')](db[_0xd3f5('0x12f')],{'as':_0xd3f5('0x130'),'foreignKey':'CampaignId'});db['Campaign'][_0xd3f5('0x103')](db[_0xd3f5('0x29')],{'as':'Trunk','foreignKey':_0xd3f5('0x132')});db[_0xd3f5('0xe1')][_0xd3f5('0x103')](db[_0xd3f5('0x29')],{'as':_0xd3f5('0x133'),'foreignKey':_0xd3f5('0x134')});db[_0xd3f5('0xe1')][_0xd3f5('0x103')](db[_0xd3f5('0x82')],{'as':_0xd3f5('0x82'),'foreignKey':_0xd3f5('0x135')});db[_0xd3f5('0xe1')]['belongsTo'](db[_0xd3f5('0xd9')],{'as':_0xd3f5('0xd9'),'foreignKey':_0xd3f5('0x1b5')});db[_0xd3f5('0xe1')][_0xd3f5('0x107')](db[_0xd3f5('0x109')],{'as':'Lists','through':'campaigns_has_cm_lists'});db[_0xd3f5('0xe1')][_0xd3f5('0x107')](db[_0xd3f5('0x109')],{'as':'BlackLists','through':_0xd3f5('0x1b6')});db[_0xd3f5('0xe7')][_0xd3f5('0x103')](db[_0xd3f5('0x3f')],{});db[_0xd3f5('0xe7')][_0xd3f5('0x103')](db[_0xd3f5('0x3d')],{});db[_0xd3f5('0xe7')]['belongsTo'](db[_0xd3f5('0x38')],{'foreignKey':_0xd3f5('0x1b7'),'as':'FromAccount'});db[_0xd3f5('0xe7')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'foreignKey':_0xd3f5('0x1b8'),'as':_0xd3f5('0x1b9')});db[_0xd3f5('0xe7')]['belongsTo'](db[_0xd3f5('0x13')],{'foreignKey':_0xd3f5('0x1ba'),'as':_0xd3f5('0x1bb')});db[_0xd3f5('0xe7')][_0xd3f5('0x103')](db[_0xd3f5('0x3a')],{'foreignKey':_0xd3f5('0x1bc'),'as':_0xd3f5('0x1bd')});db[_0xd3f5('0xe7')][_0xd3f5('0x103')](db[_0xd3f5('0x38')],{'foreignKey':_0xd3f5('0x1be'),'as':'ToAccount'});db[_0xd3f5('0xe9')][_0xd3f5('0x103')](db['ChatMessage'],{});db[_0xd3f5('0xe9')][_0xd3f5('0x103')](db[_0xd3f5('0x66')],{});db[_0xd3f5('0xe9')]['belongsTo'](db[_0xd3f5('0x62')],{'foreignKey':_0xd3f5('0x1bf'),'as':_0xd3f5('0x1c0')});db[_0xd3f5('0xe9')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'foreignKey':_0xd3f5('0x1b8'),'as':_0xd3f5('0x1b9')});db[_0xd3f5('0xe9')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'foreignKey':_0xd3f5('0x1ba'),'as':_0xd3f5('0x1bb')});db[_0xd3f5('0xe9')][_0xd3f5('0x103')](db[_0xd3f5('0x174')],{'foreignKey':_0xd3f5('0x1c1'),'as':_0xd3f5('0x1bd')});db[_0xd3f5('0xe9')][_0xd3f5('0x103')](db[_0xd3f5('0x62')],{'foreignKey':_0xd3f5('0x1c2'),'as':_0xd3f5('0x1c3')});db[_0xd3f5('0x1c4')][_0xd3f5('0x103')](db[_0xd3f5('0x162')],{});db['FaxTransferReport'][_0xd3f5('0x103')](db[_0xd3f5('0x49')],{});db['FaxTransferReport'][_0xd3f5('0x103')](db['FaxAccount'],{'foreignKey':'FromFaxAccountId','as':_0xd3f5('0x1c0')});db[_0xd3f5('0x1c4')]['belongsTo'](db[_0xd3f5('0x13')],{'foreignKey':_0xd3f5('0x1b8'),'as':_0xd3f5('0x1b9')});db[_0xd3f5('0x1c4')][_0xd3f5('0x103')](db['User'],{'foreignKey':_0xd3f5('0x1ba'),'as':_0xd3f5('0x1bb')});db[_0xd3f5('0x1c4')][_0xd3f5('0x103')](db[_0xd3f5('0x4c')],{'foreignKey':_0xd3f5('0x1c5'),'as':_0xd3f5('0x1bd')});db[_0xd3f5('0x1c4')][_0xd3f5('0x103')](db[_0xd3f5('0x11f')],{'foreignKey':_0xd3f5('0x1c6'),'as':'ToAccount'});db[_0xd3f5('0xec')]['belongsTo'](db['OpenchannelMessage'],{});db[_0xd3f5('0xec')]['belongsTo'](db[_0xd3f5('0x5c')],{});db['OpenchannelTransferReport'][_0xd3f5('0x103')](db[_0xd3f5('0x59')],{'foreignKey':'FromOpenchannelAccountId','as':'FromAccount'});db[_0xd3f5('0xec')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'foreignKey':_0xd3f5('0x1b8'),'as':_0xd3f5('0x1b9')});db[_0xd3f5('0xec')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'foreignKey':_0xd3f5('0x1ba'),'as':_0xd3f5('0x1bb')});db[_0xd3f5('0xec')][_0xd3f5('0x103')](db[_0xd3f5('0x60')],{'foreignKey':_0xd3f5('0x1c7'),'as':_0xd3f5('0x1bd')});db['OpenchannelTransferReport'][_0xd3f5('0x103')](db[_0xd3f5('0x59')],{'foreignKey':_0xd3f5('0x1c8'),'as':'ToAccount'});db[_0xd3f5('0x1c9')][_0xd3f5('0x103')](db['SmsMessage'],{});db['SmsTransferReport'][_0xd3f5('0x103')](db[_0xd3f5('0x53')],{});db['SmsTransferReport'][_0xd3f5('0x103')](db['SmsAccount'],{'foreignKey':_0xd3f5('0x1ca'),'as':_0xd3f5('0x1c0')});db[_0xd3f5('0x1c9')]['belongsTo'](db['User'],{'foreignKey':_0xd3f5('0x1b8'),'as':_0xd3f5('0x1b9')});db[_0xd3f5('0x1c9')][_0xd3f5('0x103')](db[_0xd3f5('0x13')],{'foreignKey':_0xd3f5('0x1ba'),'as':_0xd3f5('0x1bb')});db[_0xd3f5('0x1c9')][_0xd3f5('0x103')](db['SmsQueue'],{'foreignKey':_0xd3f5('0x1cb'),'as':_0xd3f5('0x1bd')});db['SmsTransferReport']['belongsTo'](db[_0xd3f5('0x4f')],{'foreignKey':_0xd3f5('0x1cc'),'as':_0xd3f5('0x1c3')});db[_0xd3f5('0x109')][_0xd3f5('0xf9')](db[_0xd3f5('0x7e')],{'as':_0xd3f5('0x14b'),'foreignKey':'ListId'});db['CmList'][_0xd3f5('0xf9')](db[_0xd3f5('0x1cd')],{'as':_0xd3f5('0x1ce'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0x109')][_0xd3f5('0xf9')](db[_0xd3f5('0x72')],{'as':_0xd3f5('0x108'),'onDelete':_0xd3f5('0xf7'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0x109')][_0xd3f5('0xf9')](db[_0xd3f5('0xfd')],{'as':'HopperFinals','foreignKey':_0xd3f5('0x14f')});db['CmList'][_0xd3f5('0xf9')](db[_0xd3f5('0xfe')],{'as':_0xd3f5('0xff'),'foreignKey':'ListId'});db['CmList'][_0xd3f5('0xf9')](db[_0xd3f5('0x100')],{'as':_0xd3f5('0x100'),'foreignKey':_0xd3f5('0x14f')});db[_0xd3f5('0x109')][_0xd3f5('0x107')](db[_0xd3f5('0x1c')],{'as':_0xd3f5('0x1cf'),'through':_0xd3f5('0x138')});db['CmList'][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x139'),'through':_0xd3f5('0x10b')});db['VoicePrefix']['hasMany'](db['VoiceExtension'],{'as':_0xd3f5('0xfc'),'onDelete':_0xd3f5('0x15b')});db['VoicePrefix'][_0xd3f5('0x107')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x139'),'through':_0xd3f5('0x11c')});db[_0xd3f5('0x1d0')][_0xd3f5('0xf9')](db[_0xd3f5('0x13')],{'as':_0xd3f5('0x158'),'foreignKey':_0xd3f5('0x104')});db[_0xd3f5('0x1d0')][_0xd3f5('0xf9')](db[_0xd3f5('0xf2')],{'as':_0xd3f5('0x1d1'),'foreignKey':_0xd3f5('0x104'),'onDelete':_0xd3f5('0xf7')});db[_0xd3f5('0xf2')][_0xd3f5('0xf9')](db[_0xd3f5('0xf4')],{'as':_0xd3f5('0x1d2'),'foreignKey':_0xd3f5('0x1d3'),'onDelete':'cascade'});module[_0xd3f5('0x1d4')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xc5a2=['ReportAgentPreview','../api/cmCustomField/cmCustomField.model','Action','CannedAnswer','Disposition','../api/disposition/disposition.model','Condition','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','../api/integration/integration.model','IntegrationReport','../api/analyticCustomReport/analyticCustomReport.model','../api/analyticDefaultReport/analyticDefaultReport.model','../api/analyticExtractedReport/analyticExtractedReport.model','../api/analyticMetric/analyticMetric.model','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','ZohoAccount','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','../api/network/network.model','ChatQueueReport','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','SquareOdbc','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','../api/userProfileSection/userProfileSection.model','../api/userProfileResource/userProfileResource.model','hasOne','VoiceMail','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','Extensions','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteractions','FaxInteraction','FaxInteractions','MailInteractions','belongsTo','UserProfile','userProfileId','belongsToMany','chat_group_has_users','CmContact','Contacts','cm_user_has_lists','Team','user_has_teams','user_has_mail_interactions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_openchannel_interactions','MailQueue','ChatQueues','FaxQueues','UserSmsQueue','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','VoiceChanSpy','SpiedAgents','ChanSpyId','Sound','Sounds','moh_has_sounds','Members','VoiceQueueId','Hoppers','HopperFinals','HopperHistories','HopperBlacks','JscriptySessionReport','TrunkId','TrunkBackupId','IntervalId','mandatoryDispositionPauseId','Lists','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','uniqueid','AgentReports','ContactId','MailServerIn','MailAccountId','Imap','Dispositions','Messages','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','user_has_mail_accounts','Agents','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','Tags','ThroughTags','Contact','Interaction','MailApplication','restrict','TagId','MailQueueReport','Items','FaxAccountId','Answers','Applications','Exntensions','FaxQueue','FaxInteractionId','fax_interaction_has_tags','Users','AttachmentId','team_has_fax_queues','SmsAccountId','sms_interaction_has_tags','SmsInteractionId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','openchannel_interaction_has_tags','OpenchannelInteractionId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','OpenchannelQueueReport','Queue','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','user_has_chat_interactions','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','CmCompany','Company','CompanyId','cm_user_has_contacts','cm_contact_has_tags','Agent','Automation','All','AutomationAllId','Any','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','AnalyticDefaultReport','DefaultReportId','CustomReportId','Mohs','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerAnyId','TriggerId','AnalyticCustomReport','AnalyticFieldReport','Fields','AnalyticMetric','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Field','Variable','VariableId','Description','DeskAccount','int_desk_configuration_has_tags','ZohoConfiguration','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','int_vtiger_configuration_has_tags','ServicenowConfiguration','Dynamics365Account','ToId','SessionId','ProjectId','MailQueues','SmsQueues','OpenchannelQueues','CampaignId','TrunkBackup','campaigns_has_cm_blacklists','FromMailAccountId','ToAgent','ToMailQueueId','ToMailAccountId','FromChatWebsiteId','FromAgent','ToUserId','ToChatQueueId','ToQueue','ToAccount','FromFaxAccountId','FromAccount','ToFaxQueueId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','FromUserId','ToOpenchannelQueueId','ToOpenchannelAccountId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CmCustomField','CustomFields','Queues','voice_queues_has_cm_lists','UserProfileSections','UserProfileResource','Resources','exports','path','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xC@LL1234','127.0.0.1','mysql','name','utf8','utf8_general_ci','sequelizeHistory','database','username','options','password','User','import','../api/user/user.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','UserFaxQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','../api/mailQueueReport/mailQueueReport.model','Dashboard','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsInteraction/smsInteraction.model','SmsMessage','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/openchannelQueueReport/openchannelQueueReport.model','ChatApplication','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','ChatProactiveAction','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperHistory/cmHopperHistory.model'];(function(_0xad9b8,_0x534b84){var _0x2a179d=function(_0x3fb189){while(--_0x3fb189){_0xad9b8['push'](_0xad9b8['shift']());}};_0x2a179d(++_0x534b84);}(_0xc5a2,0x158));var _0x2c5a=function(_0x4ec4ed,_0x3d1db2){_0x4ec4ed=_0x4ec4ed-0x0;var _0xe2733e=_0xc5a2[_0x4ec4ed];return _0xe2733e;};'use strict';var path=require(_0x2c5a('0x0'));var config=require(_0x2c5a('0x1'));var Sequelize=require(_0x2c5a('0x2'));var _=require(_0x2c5a('0x3'));var jstz=require(_0x2c5a('0x4'));var timezone=jstz[_0x2c5a('0x5')]();config[_0x2c5a('0x2')]=_[_0x2c5a('0x6')](config[_0x2c5a('0x2')],{'database':_0x2c5a('0x7'),'username':'xcall','password':_0x2c5a('0x8'),'options':{'host':_0x2c5a('0x9'),'port':0xcea,'dialect':_0x2c5a('0xa'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x2c5a('0xb')](),'define':{'charset':_0x2c5a('0xc'),'collate':_0x2c5a('0xd')}}});config['sequelizeHistory']=_[_0x2c5a('0x6')](config[_0x2c5a('0xe')],{'database':'motion2','username':'xcall','password':_0x2c5a('0x8'),'options':{'host':_0x2c5a('0x9'),'port':0xcea,'dialect':'mysql','dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x2c5a('0xb')](),'define':{'charset':_0x2c5a('0xc'),'collate':_0x2c5a('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2c5a('0x2')][_0x2c5a('0xf')],config[_0x2c5a('0x2')][_0x2c5a('0x10')],config['sequelize']['password'],config[_0x2c5a('0x2')][_0x2c5a('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2c5a('0xe')]['database'],config[_0x2c5a('0xe')][_0x2c5a('0x10')],config[_0x2c5a('0xe')][_0x2c5a('0x12')],config[_0x2c5a('0xe')][_0x2c5a('0x11')])};db[_0x2c5a('0x13')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x15'));db['VoiceChanSpy']=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0x2c5a('0x16')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x17'));db[_0x2c5a('0x18')]=db['sequelize']['import']('../api/voiceExtension/voiceExtension.model');db[_0x2c5a('0x19')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x1a'));db[_0x2c5a('0x1b')]=db['sequelize'][_0x2c5a('0x14')]('../api/voiceQueue/voiceQueue.model');db[_0x2c5a('0x1c')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/voiceRecording/voiceRecording.model');db[_0x2c5a('0x1d')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0x1e'));db['VoiceMail']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x1f'));db[_0x2c5a('0x20')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x21'));db[_0x2c5a('0x22')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x23'));db['VoiceDialReport']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x24'));db[_0x2c5a('0x25')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x26'));db[_0x2c5a('0x27')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x28'));db[_0x2c5a('0x29')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/memberReport/memberReport.model');db[_0x2c5a('0x2a')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x2b'));db[_0x2c5a('0x2c')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x2d'));db[_0x2c5a('0x2e')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db['sequelize'][_0x2c5a('0x14')]('../api/userVoiceQueue/userVoiceQueue.model');db[_0x2c5a('0x2f')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x30'));db[_0x2c5a('0x31')]=db['sequelize']['import']('../api/userMailQueue/userMailQueue.model');db[_0x2c5a('0x32')]=db[_0x2c5a('0x2')]['import']('../api/userFaxQueue/userFaxQueue.model');db['UserSmsQueue']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x33'));db[_0x2c5a('0x34')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db['MailServerIn']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x35'));db[_0x2c5a('0x36')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x37'));db[_0x2c5a('0x38')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0x39'));db['MailQueue']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x3a'));db['MailSubstatus']=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x3b'));db[_0x2c5a('0x3c')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x3d'));db[_0x2c5a('0x3e')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x3f'));db['MailApplication']=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/mailApplication/mailApplication.model');db['MailQueueReport']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x40'));db[_0x2c5a('0x41')]=db[_0x2c5a('0x2')]['import']('../api/dashboard/dashboard.model');db[_0x2c5a('0x42')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x43'));db[_0x2c5a('0x44')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x45'));db[_0x2c5a('0x46')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x47'));db['FaxInteraction']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x48'));db[_0x2c5a('0x49')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x4a'));db['FaxQueue']=db[_0x2c5a('0x2')]['import'](_0x2c5a('0x4b'));db[_0x2c5a('0x4c')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/faxQueueReport/faxQueueReport.model');db[_0x2c5a('0x4d')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x4e'));db[_0x2c5a('0x4f')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x50'));db[_0x2c5a('0x51')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/smsMessage/smsMessage.model');db[_0x2c5a('0x52')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x53'));db[_0x2c5a('0x54')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x55'));db[_0x2c5a('0x56')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x57'));db[_0x2c5a('0x58')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/openchannelInteraction/openchannelInteraction.model');db[_0x2c5a('0x59')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x5a'));db[_0x2c5a('0x5b')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x5c'));db[_0x2c5a('0x5d')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/chatWebsite/chatWebsite.model');db['OpenchannelQueueReport']=db[_0x2c5a('0x2')]['import'](_0x2c5a('0x5e'));db[_0x2c5a('0x5f')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/chatApplication/chatApplication.model');db[_0x2c5a('0x60')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x61'));db[_0x2c5a('0x62')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/chatMessage/chatMessage.model');db[_0x2c5a('0x63')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x64'));db[_0x2c5a('0x65')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x66'));db[_0x2c5a('0x67')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/chatGroup/chatGroup.model');db[_0x2c5a('0x68')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/chatProactiveAction/chatProactiveAction.model');db['CmCompany']=db[_0x2c5a('0x2')]['import'](_0x2c5a('0x69'));db['CmContact']=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x6a'));db[_0x2c5a('0x6b')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x6c'));db[_0x2c5a('0x6d')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x6e'));db[_0x2c5a('0x6f')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/cmHopperFinal/cmHopperFinal.model');db['CmHopperHistory']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x70'));db[_0x2c5a('0x71')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x72'));db[_0x2c5a('0x73')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/action/action.model');db['Automation']=db[_0x2c5a('0x2')]['import']('../api/automation/automation.model');db[_0x2c5a('0x74')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/cannedAnswer/cannedAnswer.model');db[_0x2c5a('0x75')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x76'));db[_0x2c5a('0x77')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/condition/condition.model');db[_0x2c5a('0x78')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x79'));db[_0x2c5a('0x7a')]=db[_0x2c5a('0x2')]['import']('../api/pause/pause.model');db[_0x2c5a('0x7b')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x7c'));db[_0x2c5a('0x7d')]=db['sequelize'][_0x2c5a('0x14')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x2c5a('0x7e')]=db['sequelize'][_0x2c5a('0x14')]('../api/schedule/schedule.model');db['Sound']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x7f'));db[_0x2c5a('0x80')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x81'));db[_0x2c5a('0x82')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x83'));db[_0x2c5a('0x84')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x85'));db['Variable']=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/variable/variable.model');db['Integration']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x86'));db[_0x2c5a('0x87')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/integrationReport/integrationReport.model');db['AnalyticCustomReport']=db['sequelize']['import'](_0x2c5a('0x88'));db['AnalyticDefaultReport']=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x89'));db['AnalyticExtractedReport']=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x8a'));db['AnalyticMetric']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x8b'));db['AnalyticFieldReport']=db['sequelize']['import'](_0x2c5a('0x8c'));db[_0x2c5a('0x8d')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0x8e'));db[_0x2c5a('0x8f')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0x90'));db[_0x2c5a('0x91')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0x92'));db[_0x2c5a('0x93')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x94'));db[_0x2c5a('0x95')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x96'));db[_0x2c5a('0x97')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x98'));db[_0x2c5a('0x99')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/intSugarcrmField/intSugarcrmField.model');db['DeskAccount']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x9a'));db[_0x2c5a('0x9b')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x2c5a('0x9c')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/intDeskField/intDeskField.model');db[_0x2c5a('0x9d')]=db[_0x2c5a('0x2')]['import']('../api/intZohoAccount/intZohoAccount.model');db['ZohoConfiguration']=db['sequelize']['import']('../api/intZohoConfiguration/intZohoConfiguration.model');db[_0x2c5a('0x9e')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0x9f'));db[_0x2c5a('0xa0')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xa1'));db['ZendeskConfiguration']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xa2'));db[_0x2c5a('0xa3')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xa4'));db[_0x2c5a('0xa5')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xa6'));db[_0x2c5a('0xa7')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xa8'));db[_0x2c5a('0xa9')]=db['sequelize'][_0x2c5a('0x14')]('../api/intFreshdeskField/intFreshdeskField.model');db[_0x2c5a('0xaa')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xab'));db[_0x2c5a('0xac')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xad'));db['VtigerField']=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xae'));db[_0x2c5a('0xaf')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xb0'));db['ServicenowConfiguration']=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xb1'));db[_0x2c5a('0xb2')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/intServicenowField/intServicenowField.model');db['Dynamics365Account']=db['sequelize'][_0x2c5a('0x14')]('../api/intDynamics365Account/intDynamics365Account.model');db[_0x2c5a('0xb3')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xb4'));db[_0x2c5a('0xb5')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xb6'));db['Integration']=db['sequelize']['import'](_0x2c5a('0x86'));db['Network']=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xb7'));db[_0x2c5a('0xb8')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/chatQueueReport/chatQueueReport.model');db['ChatInternalMessage']=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xb9'));db[_0x2c5a('0xba')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xbb'));db[_0x2c5a('0xbc')]=db['sequelize'][_0x2c5a('0x14')]('../api/jscriptyQuestionReport/jscriptyQuestionReport.model');db['JscriptySessionReport']=db[_0x2c5a('0x2')]['import']('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0x2c5a('0xbd')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xbe'));db[_0x2c5a('0xbf')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xc0'));db[_0x2c5a('0xc1')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xc2'));db[_0x2c5a('0xc3')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xc4'));db[_0x2c5a('0xc5')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xc6'));db[_0x2c5a('0xc7')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/squareOdbc/squareOdbc.model');db[_0x2c5a('0xc8')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xc9'));db[_0x2c5a('0xca')]=db['sequelize']['import'](_0x2c5a('0xcb'));db[_0x2c5a('0xcc')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xcd'));db['Team']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xce'));db[_0x2c5a('0xcf')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xd0'));db[_0x2c5a('0xd1')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')]('../api/campaign/campaign.model');db[_0x2c5a('0xd2')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xd3'));db[_0x2c5a('0xd4')]=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xd5'));db[_0x2c5a('0xd6')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xd7'));db[_0x2c5a('0xd8')]=db['sequelize'][_0x2c5a('0x14')]('../api/mailTransferReport/mailTransferReport.model');db[_0x2c5a('0xd9')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xda'));db[_0x2c5a('0xdb')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xdc'));db['OpenchannelTransferReport']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xdd'));db[_0x2c5a('0xde')]=db['sequelize'][_0x2c5a('0x14')]('../api/smsTransferReport/smsTransferReport.model');db[_0x2c5a('0xdf')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xe0'));db[_0x2c5a('0xe1')]=db[_0x2c5a('0x2')]['import'](_0x2c5a('0xe2'));db['UserProfile']=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xe3'));db[_0x2c5a('0xe4')]=db[_0x2c5a('0x2')][_0x2c5a('0x14')](_0x2c5a('0xe5'));db['UserProfileResource']=db['sequelize'][_0x2c5a('0x14')](_0x2c5a('0xe6'));db['User'][_0x2c5a('0xe7')](db[_0x2c5a('0xe8')],{'as':_0x2c5a('0xe8'),'onDelete':_0x2c5a('0xe9'),'foreignKey':'UserId'});db['User'][_0x2c5a('0xea')](db[_0x2c5a('0x1c')],{'as':_0x2c5a('0xeb'),'foreignKey':_0x2c5a('0xec')});db['User'][_0x2c5a('0xea')](db[_0x2c5a('0x2e')],{'as':_0x2c5a('0xed'),'foreignKey':_0x2c5a('0xec')});db['User'][_0x2c5a('0xea')](db[_0x2c5a('0x18')],{'as':_0x2c5a('0xee'),'onDelete':_0x2c5a('0xe9'),'hooks':!![]});db[_0x2c5a('0x13')][_0x2c5a('0xea')](db[_0x2c5a('0x6f')],{'as':'HopperFinals','foreignKey':_0x2c5a('0xec')});db[_0x2c5a('0x13')][_0x2c5a('0xea')](db[_0x2c5a('0xef')],{'as':_0x2c5a('0xf0'),'foreignKey':_0x2c5a('0xec')});db[_0x2c5a('0x13')][_0x2c5a('0xea')](db[_0x2c5a('0x71')],{'as':_0x2c5a('0x71'),'foreignKey':'UserId'});db[_0x2c5a('0x13')]['hasMany'](db[_0x2c5a('0x58')],{'as':_0x2c5a('0xf1'),'foreignKey':_0x2c5a('0xec')});db[_0x2c5a('0x13')][_0x2c5a('0xea')](db[_0x2c5a('0x60')],{'as':_0x2c5a('0xf2'),'foreignKey':'UserId'});db[_0x2c5a('0x13')][_0x2c5a('0xea')](db['SmsInteraction'],{'as':_0x2c5a('0xf3'),'foreignKey':'UserId'});db[_0x2c5a('0x13')][_0x2c5a('0xea')](db[_0x2c5a('0xf4')],{'as':_0x2c5a('0xf5'),'foreignKey':_0x2c5a('0xec')});db['User'][_0x2c5a('0xea')](db[_0x2c5a('0x3c')],{'as':_0x2c5a('0xf6'),'foreignKey':_0x2c5a('0xec')});db[_0x2c5a('0x13')][_0x2c5a('0xf7')](db['UserProfile'],{'as':_0x2c5a('0xf8'),'foreignKey':_0x2c5a('0xf9')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db['ChatGroup'],{'as':'Groups','through':_0x2c5a('0xfb')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0xfd'),'through':'cm_user_has_contacts'});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0xdf')],{'as':'Lists','through':_0x2c5a('0xfe')});db['User'][_0x2c5a('0xfa')](db[_0x2c5a('0xff')],{'through':_0x2c5a('0x100')});db['User'][_0x2c5a('0xfa')](db['MailInteraction'],{'as':_0x2c5a('0xf6'),'through':_0x2c5a('0x101')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0x60')],{'as':'ChatInteractions','through':'user_has_chat_interactions'});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0xf4')],{'as':_0x2c5a('0xf5'),'through':_0x2c5a('0x102')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0x103')],{'as':_0x2c5a('0xf3'),'through':_0x2c5a('0x104')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0x58')],{'as':_0x2c5a('0xf1'),'through':_0x2c5a('0x105')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0x1b')],{'as':'VoiceQueues','through':'UserVoiceQueue','required':![]});db['User']['belongsToMany'](db[_0x2c5a('0x106')],{'as':'MailQueues','through':_0x2c5a('0x31'),'required':![]});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0x65')],{'as':_0x2c5a('0x107'),'through':_0x2c5a('0x2f'),'required':![],'hooks':!![]});db[_0x2c5a('0x13')]['belongsToMany'](db['FaxQueue'],{'as':_0x2c5a('0x108'),'through':_0x2c5a('0x32'),'required':![]});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0x52')],{'as':'SmsQueues','through':_0x2c5a('0x109'),'required':![]});db[_0x2c5a('0x13')]['belongsToMany'](db[_0x2c5a('0x5b')],{'as':'OpenchannelQueues','through':_0x2c5a('0x34'),'required':![]});db['User']['belongsToMany'](db[_0x2c5a('0xdf')],{'through':_0x2c5a('0xfe')});db[_0x2c5a('0x13')]['belongsToMany'](db[_0x2c5a('0xe1')],{'as':_0x2c5a('0x10a'),'through':_0x2c5a('0x10b'),'required':![]});db[_0x2c5a('0x13')]['belongsToMany'](db['ChatWebsite'],{'as':_0x2c5a('0x10c'),'through':_0x2c5a('0x10d')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db['FaxAccount'],{'as':_0x2c5a('0x10e'),'through':_0x2c5a('0x10f')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0x38')],{'as':_0x2c5a('0x110'),'through':'user_has_mail_accounts'});db[_0x2c5a('0x13')]['belongsToMany'](db[_0x2c5a('0x54')],{'as':_0x2c5a('0x111'),'through':_0x2c5a('0x112')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db['SmsAccount'],{'as':_0x2c5a('0x113'),'through':_0x2c5a('0x114')});db[_0x2c5a('0x13')][_0x2c5a('0xfa')](db[_0x2c5a('0xc8')],{'as':_0x2c5a('0x115'),'through':'user_has_square_projects'});db[_0x2c5a('0x116')][_0x2c5a('0xea')](db[_0x2c5a('0x18')],{'as':_0x2c5a('0x117'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x118')});db['VoiceContext'][_0x2c5a('0xea')](db[_0x2c5a('0x18')],{'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x18')][_0x2c5a('0xea')](db[_0x2c5a('0x18')],{'as':'Applications','onDelete':'cascade'});db[_0x2c5a('0x19')][_0x2c5a('0xfa')](db[_0x2c5a('0x119')],{'as':_0x2c5a('0x11a'),'through':_0x2c5a('0x11b')});db[_0x2c5a('0x1b')][_0x2c5a('0xea')](db[_0x2c5a('0x2e')],{'as':_0x2c5a('0x11c'),'foreignKey':_0x2c5a('0x11d')});db['VoiceQueue'][_0x2c5a('0xea')](db[_0x2c5a('0x6b')],{'as':_0x2c5a('0x11e'),'foreignKey':_0x2c5a('0x11d')});db[_0x2c5a('0x1b')][_0x2c5a('0xea')](db[_0x2c5a('0x6f')],{'as':_0x2c5a('0x11f'),'foreignKey':_0x2c5a('0x11d')});db[_0x2c5a('0x1b')]['hasMany'](db[_0x2c5a('0xef')],{'as':_0x2c5a('0x120'),'foreignKey':_0x2c5a('0x11d')});db[_0x2c5a('0x1b')]['hasMany'](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0x2c5a('0x11d')});db[_0x2c5a('0x1b')][_0x2c5a('0xea')](db[_0x2c5a('0x6d')],{'as':_0x2c5a('0x121'),'foreignKey':'VoiceQueueId'});db[_0x2c5a('0x1b')][_0x2c5a('0xea')](db[_0x2c5a('0x122')],{'as':'JscriptySessions','foreignKey':_0x2c5a('0x11d')});db[_0x2c5a('0x1b')][_0x2c5a('0xf7')](db[_0x2c5a('0x2a')],{'as':_0x2c5a('0x2a'),'foreignKey':_0x2c5a('0x123')});db[_0x2c5a('0x1b')]['belongsTo'](db[_0x2c5a('0x2a')],{'as':'TrunkBackup','foreignKey':_0x2c5a('0x124')});db['VoiceQueue'][_0x2c5a('0xf7')](db[_0x2c5a('0x78')],{'as':_0x2c5a('0x78'),'foreignKey':_0x2c5a('0x125')});db['VoiceQueue']['belongsTo'](db[_0x2c5a('0x7a')],{'as':'mandatoryDispositionPause','foreignKey':_0x2c5a('0x126')});db[_0x2c5a('0x1b')][_0x2c5a('0xfa')](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x127'),'through':'voice_queues_has_cm_lists'});db[_0x2c5a('0x1b')]['belongsToMany'](db[_0x2c5a('0x13')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x2c5a('0x1b')][_0x2c5a('0xfa')](db[_0x2c5a('0xff')],{'as':_0x2c5a('0x128'),'through':_0x2c5a('0x129')});db['VoiceQueue']['belongsToMany'](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x12a'),'through':_0x2c5a('0x12b')});db['VoiceRecording']['belongsTo'](db['User'],{'as':'User','foreignKey':'UserId'});db[_0x2c5a('0x1d')]['belongsTo'](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13'),'foreignKey':'UserId'});db[_0x2c5a('0xe8')]['hasMany'](db[_0x2c5a('0x20')],{'as':'Messages','onDelete':'cascade','foreignKey':_0x2c5a('0x12c'),'sourceKey':_0x2c5a('0x12d')});db['VoiceMailMessage']['belongsTo'](db['VoiceMail'],{'foreignKey':'mailboxuser','targetKey':_0x2c5a('0x12d')});db[_0x2c5a('0x22')][_0x2c5a('0xea')](db['VoiceQueueReport'],{'as':'QueueCalls','foreignKey':_0x2c5a('0x12e'),'constraints':![]});db['VoiceCallReport']['hasMany'](db['VoiceAgentReport'],{'as':_0x2c5a('0x12f'),'foreignKey':_0x2c5a('0x12e'),'constraints':![]});db[_0x2c5a('0x22')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'as':'User','foreignKey':'UserId'});db[_0x2c5a('0x22')][_0x2c5a('0xf7')](db['CmContact'],{'as':'Contact','foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0x131')]['belongsTo'](db[_0x2c5a('0x38')],{'as':'MailAccount','foreignKey':_0x2c5a('0x132')});db[_0x2c5a('0x36')][_0x2c5a('0xf7')](db[_0x2c5a('0x38')],{'as':_0x2c5a('0x38'),'foreignKey':_0x2c5a('0x132')});db[_0x2c5a('0x38')][_0x2c5a('0xe7')](db[_0x2c5a('0x131')],{'as':_0x2c5a('0x133'),'onDelete':'cascade'});db[_0x2c5a('0x38')][_0x2c5a('0xe7')](db['MailServerOut'],{'as':'Smtp','onDelete':_0x2c5a('0xe9')});db['MailAccount'][_0x2c5a('0xea')](db[_0x2c5a('0x75')],{'as':_0x2c5a('0x134'),'foreignKey':_0x2c5a('0x132')});db[_0x2c5a('0x38')]['hasMany'](db['CannedAnswer'],{'as':'Answers','foreignKey':_0x2c5a('0x132')});db[_0x2c5a('0x38')][_0x2c5a('0xea')](db[_0x2c5a('0x3e')],{'as':_0x2c5a('0x135'),'foreignKey':'MailAccountId'});db[_0x2c5a('0x38')]['hasMany'](db[_0x2c5a('0x3c')],{'as':_0x2c5a('0x136')});db[_0x2c5a('0x38')][_0x2c5a('0xea')](db['MailApplication'],{'as':'Applications'});db[_0x2c5a('0x38')][_0x2c5a('0xf7')](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138')});db['MailAccount'][_0x2c5a('0xf7')](db[_0x2c5a('0x82')],{'as':_0x2c5a('0x82'),'foreignKey':_0x2c5a('0x139')});db['MailAccount']['belongsTo'](db['Pause'],{'as':_0x2c5a('0x13a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2c5a('0x38')]['belongsToMany'](db[_0x2c5a('0x13')],{'as':'Agents','through':_0x2c5a('0x13b')});db['MailQueue'][_0x2c5a('0xfa')](db['User'],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0x31')});db[_0x2c5a('0x106')]['belongsToMany'](db[_0x2c5a('0xff')],{'through':_0x2c5a('0x13d'),'as':_0x2c5a('0x128')});db[_0x2c5a('0x3c')][_0x2c5a('0xea')](db['MailMessage'],{'as':'Messages','onDelete':'cascade','foreignKey':_0x2c5a('0x13e')});db[_0x2c5a('0x3c')][_0x2c5a('0xf7')](db[_0x2c5a('0x38')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x132')});db['MailInteraction'][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'as':'Contact','foreignKey':'ContactId'});db[_0x2c5a('0x3c')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x140'),'foreignKey':'UserId'});db['MailInteraction']['belongsToMany'](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x141'),'as':_0x2c5a('0x142')});db[_0x2c5a('0x3c')]['belongsToMany'](db['Tag'],{'through':_0x2c5a('0x141'),'as':_0x2c5a('0x143')});db[_0x2c5a('0x3c')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':'Users','through':'user_has_mail_interactions','foreignKey':_0x2c5a('0x13e')});db[_0x2c5a('0x3e')]['hasMany'](db[_0x2c5a('0xd4')],{'as':'Attachments','onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x3e')][_0x2c5a('0xf7')](db['User'],{'as':'User'});db[_0x2c5a('0x3e')]['belongsTo'](db[_0x2c5a('0xfc')],{'onDelete':_0x2c5a('0xe9'),'as':_0x2c5a('0x144')});db['MailMessage'][_0x2c5a('0xf7')](db['MailInteraction'],{'as':_0x2c5a('0x145'),'foreignKey':_0x2c5a('0x13e')});db[_0x2c5a('0x3e')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':_0x2c5a('0x132')});db[_0x2c5a('0x146')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'onDelete':_0x2c5a('0x147')});db['MailApplication']['belongsTo'](db['MailQueue'],{'onDelete':_0x2c5a('0x147')});db['MailApplication']['belongsTo'](db[_0x2c5a('0x38')],{'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0x146')][_0x2c5a('0xf7')](db[_0x2c5a('0x78')],{'onDelete':_0x2c5a('0x147'),'foreignKey':'IntervalId'});db['MailApplication'][_0x2c5a('0xf7')](db['Tag'],{'onDelete':_0x2c5a('0x147'),'foreignKey':_0x2c5a('0x148')});db['MailQueueReport'][_0x2c5a('0xf7')](db[_0x2c5a('0x38')],{});db['MailQueueReport'][_0x2c5a('0xf7')](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138')});db[_0x2c5a('0x149')][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'as':'Contact','foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0x149')][_0x2c5a('0xf7')](db['MailInteraction'],{});db['MailQueueReport'][_0x2c5a('0xf7')](db[_0x2c5a('0x3e')],{});db[_0x2c5a('0x149')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{});db[_0x2c5a('0x149')]['belongsTo'](db[_0x2c5a('0x106')],{});db['Dashboard'][_0x2c5a('0xea')](db['DashboardItem'],{'as':_0x2c5a('0x14a'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x44')]['hasMany'](db[_0x2c5a('0x75')],{'as':_0x2c5a('0x134'),'foreignKey':_0x2c5a('0x14b')});db['FaxAccount'][_0x2c5a('0xea')](db[_0x2c5a('0x74')],{'as':_0x2c5a('0x14c'),'foreignKey':_0x2c5a('0x14b')});db['FaxAccount'][_0x2c5a('0xea')](db[_0x2c5a('0xf4')],{'as':_0x2c5a('0x136')});db[_0x2c5a('0x44')]['hasMany'](db[_0x2c5a('0x46')],{'as':_0x2c5a('0x14d')});db['FaxAccount'][_0x2c5a('0xea')](db['VoiceExtension'],{'as':_0x2c5a('0x14e'),'onDelete':'cascade'});db['FaxAccount'][_0x2c5a('0xea')](db[_0x2c5a('0x49')],{'as':_0x2c5a('0x135')});db[_0x2c5a('0x44')][_0x2c5a('0xf7')](db[_0x2c5a('0x2a')],{'as':_0x2c5a('0x2a')});db[_0x2c5a('0x44')][_0x2c5a('0xf7')](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x137'),'foreignKey':'ListId'});db[_0x2c5a('0x44')][_0x2c5a('0xf7')](db[_0x2c5a('0x7a')],{'as':_0x2c5a('0x13a'),'foreignKey':_0x2c5a('0x126')});db[_0x2c5a('0x44')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0x10f')});db[_0x2c5a('0x46')]['belongsTo'](db[_0x2c5a('0x13')],{'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0x46')]['belongsTo'](db[_0x2c5a('0x14f')],{'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0x46')][_0x2c5a('0xf7')](db['FaxAccount'],{'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0x46')]['belongsTo'](db[_0x2c5a('0x80')],{'onDelete':_0x2c5a('0x147'),'foreignKey':_0x2c5a('0x148')});db[_0x2c5a('0xf4')][_0x2c5a('0xea')](db[_0x2c5a('0x49')],{'as':_0x2c5a('0x135'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x150')});db[_0x2c5a('0xf4')]['belongsTo'](db[_0x2c5a('0x44')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x14b')});db[_0x2c5a('0xf4')]['belongsTo'](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0x144'),'foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0xf4')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x140'),'foreignKey':_0x2c5a('0xec')});db['FaxInteraction'][_0x2c5a('0xfa')](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x151'),'as':_0x2c5a('0x142')});db[_0x2c5a('0xf4')][_0x2c5a('0xfa')](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x151'),'as':_0x2c5a('0x143')});db[_0x2c5a('0xf4')][_0x2c5a('0xfa')](db['User'],{'as':_0x2c5a('0x152'),'through':_0x2c5a('0x102'),'foreignKey':_0x2c5a('0x150')});db['FaxMessage'][_0x2c5a('0xf7')](db['User'],{'onDelete':_0x2c5a('0xe9'),'as':'User'});db[_0x2c5a('0x49')][_0x2c5a('0xf7')](db[_0x2c5a('0xf4')],{'as':_0x2c5a('0x145'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'onDelete':'cascade','as':_0x2c5a('0x144')});db['FaxMessage'][_0x2c5a('0xf7')](db['Attachment'],{'as':_0x2c5a('0xd4'),'foreignKey':_0x2c5a('0x153')});db[_0x2c5a('0x49')][_0x2c5a('0xf7')](db[_0x2c5a('0x44')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x14b')});db[_0x2c5a('0x14f')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':'Agents','through':_0x2c5a('0x32')});db[_0x2c5a('0x14f')][_0x2c5a('0xfa')](db[_0x2c5a('0xff')],{'through':_0x2c5a('0x154'),'as':_0x2c5a('0x128')});db[_0x2c5a('0x4c')][_0x2c5a('0xf7')](db[_0x2c5a('0x44')],{});db[_0x2c5a('0x4c')][_0x2c5a('0xf7')](db['CmList'],{'as':'List','foreignKey':_0x2c5a('0x138')});db[_0x2c5a('0x4c')][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0x144'),'foreignKey':'ContactId'});db[_0x2c5a('0x4c')][_0x2c5a('0xf7')](db[_0x2c5a('0xf4')],{});db[_0x2c5a('0x4c')][_0x2c5a('0xf7')](db[_0x2c5a('0x49')],{});db[_0x2c5a('0x4c')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{});db[_0x2c5a('0x4c')][_0x2c5a('0xf7')](db[_0x2c5a('0x14f')],{});db[_0x2c5a('0x4d')][_0x2c5a('0xea')](db[_0x2c5a('0x75')],{'as':'Dispositions','foreignKey':_0x2c5a('0x155')});db[_0x2c5a('0x4d')][_0x2c5a('0xea')](db['CannedAnswer'],{'as':_0x2c5a('0x14c'),'foreignKey':_0x2c5a('0x155')});db[_0x2c5a('0x4d')][_0x2c5a('0xea')](db[_0x2c5a('0x51')],{'as':_0x2c5a('0x135'),'foreignKey':_0x2c5a('0x155')});db[_0x2c5a('0x4d')][_0x2c5a('0xea')](db[_0x2c5a('0x103')],{'as':'Interactions'});db[_0x2c5a('0x4d')][_0x2c5a('0xea')](db[_0x2c5a('0x4f')],{'as':'Applications'});db[_0x2c5a('0x4d')][_0x2c5a('0xf7')](db['CmList'],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138')});db[_0x2c5a('0x4d')][_0x2c5a('0xf7')](db[_0x2c5a('0x7a')],{'as':_0x2c5a('0x13a'),'foreignKey':_0x2c5a('0x126')});db['SmsAccount'][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0x114')});db[_0x2c5a('0x4f')][_0x2c5a('0xf7')](db['User'],{'onDelete':_0x2c5a('0x147')});db['SmsApplication'][_0x2c5a('0xf7')](db['SmsQueue'],{'onDelete':_0x2c5a('0x147')});db['SmsApplication']['belongsTo'](db['SmsAccount'],{'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0x4f')]['belongsTo'](db[_0x2c5a('0x78')],{'onDelete':_0x2c5a('0x147'),'foreignKey':_0x2c5a('0x125')});db['SmsApplication']['belongsTo'](db[_0x2c5a('0x80')],{'onDelete':'restrict','foreignKey':_0x2c5a('0x148')});db['SmsInteraction'][_0x2c5a('0xea')](db[_0x2c5a('0x51')],{'as':_0x2c5a('0x135'),'onDelete':_0x2c5a('0xe9'),'foreignKey':'SmsInteractionId'});db[_0x2c5a('0x103')]['belongsTo'](db['SmsAccount'],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x155')});db[_0x2c5a('0x103')][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0x144'),'foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0x103')][_0x2c5a('0xf7')](db['User'],{'as':'Owner','foreignKey':_0x2c5a('0xec')});db['SmsInteraction']['belongsToMany'](db['Tag'],{'through':_0x2c5a('0x156'),'as':_0x2c5a('0x142')});db['SmsInteraction'][_0x2c5a('0xfa')](db['Tag'],{'through':_0x2c5a('0x156'),'as':_0x2c5a('0x143')});db['SmsInteraction'][_0x2c5a('0xfa')](db['User'],{'as':_0x2c5a('0x152'),'through':_0x2c5a('0x104'),'foreignKey':_0x2c5a('0x157')});db['SmsMessage']['belongsTo'](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13')});db[_0x2c5a('0x51')]['belongsTo'](db['CmContact'],{'onDelete':_0x2c5a('0xe9'),'as':'Contact'});db[_0x2c5a('0x51')][_0x2c5a('0xf7')](db[_0x2c5a('0x103')],{'onDelete':_0x2c5a('0xe9'),'as':'Interaction','foreignKey':'SmsInteractionId'});db[_0x2c5a('0x51')][_0x2c5a('0xf7')](db[_0x2c5a('0x4d')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x155')});db[_0x2c5a('0x52')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0x109'),'foreignKey':'SmsQueueId'});db['SmsQueue'][_0x2c5a('0xfa')](db['Team'],{'through':_0x2c5a('0x158'),'as':_0x2c5a('0x128')});db[_0x2c5a('0x54')][_0x2c5a('0xea')](db['Disposition'],{'as':_0x2c5a('0x134'),'foreignKey':_0x2c5a('0x159')});db['OpenchannelAccount'][_0x2c5a('0xea')](db[_0x2c5a('0x74')],{'as':'Answers','foreignKey':_0x2c5a('0x159')});db[_0x2c5a('0x54')][_0x2c5a('0xea')](db[_0x2c5a('0x58')],{'as':_0x2c5a('0x136'),'foreignKey':_0x2c5a('0x159')});db[_0x2c5a('0x54')][_0x2c5a('0xea')](db[_0x2c5a('0x59')],{'as':_0x2c5a('0x135'),'foreignKey':_0x2c5a('0x159')});db[_0x2c5a('0x54')][_0x2c5a('0xea')](db[_0x2c5a('0x56')],{'as':_0x2c5a('0x14d'),'foreignKey':_0x2c5a('0x159')});db['OpenchannelAccount'][_0x2c5a('0xf7')](db['CmList'],{'as':_0x2c5a('0x137'),'foreignKey':'ListId'});db[_0x2c5a('0x54')]['belongsTo'](db[_0x2c5a('0x7a')],{'as':_0x2c5a('0x13a'),'foreignKey':_0x2c5a('0x126')});db['OpenchannelAccount'][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0x112')});db[_0x2c5a('0x56')]['belongsTo'](db[_0x2c5a('0x13')],{'onDelete':'restrict'});db['OpenchannelApplication'][_0x2c5a('0xf7')](db[_0x2c5a('0x5b')],{'onDelete':_0x2c5a('0x147'),'foreignKey':_0x2c5a('0x15a')});db[_0x2c5a('0x56')][_0x2c5a('0xf7')](db['OpenchannelAccount'],{'onDelete':_0x2c5a('0x147'),'foreignKey':_0x2c5a('0x159')});db[_0x2c5a('0x56')][_0x2c5a('0xf7')](db[_0x2c5a('0x78')],{'onDelete':_0x2c5a('0x147'),'foreignKey':_0x2c5a('0x125')});db['OpenchannelApplication'][_0x2c5a('0xf7')](db[_0x2c5a('0x80')],{'onDelete':_0x2c5a('0x147'),'foreignKey':_0x2c5a('0x148')});db[_0x2c5a('0x58')][_0x2c5a('0xea')](db[_0x2c5a('0x59')],{'as':_0x2c5a('0x135'),'onDelete':_0x2c5a('0xe9'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelInteraction'][_0x2c5a('0xf7')](db[_0x2c5a('0x54')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x159')});db[_0x2c5a('0x58')][_0x2c5a('0xf7')](db['CmContact'],{'as':'Contact','foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0x58')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x140'),'foreignKey':_0x2c5a('0xec')});db[_0x2c5a('0x58')][_0x2c5a('0xfa')](db[_0x2c5a('0x80')],{'through':'openchannel_interaction_has_tags','as':_0x2c5a('0x142')});db[_0x2c5a('0x58')]['belongsToMany'](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x15b'),'as':_0x2c5a('0x143')});db[_0x2c5a('0x58')]['belongsToMany'](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x152'),'through':_0x2c5a('0x105'),'foreignKey':'OpenchannelInteractionId'});db[_0x2c5a('0x59')][_0x2c5a('0xf7')](db['User'],{'onDelete':_0x2c5a('0xe9'),'as':_0x2c5a('0x13')});db[_0x2c5a('0x59')][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'onDelete':_0x2c5a('0xe9'),'as':'Contact'});db['OpenchannelMessage'][_0x2c5a('0xf7')](db[_0x2c5a('0x58')],{'onDelete':'cascade','as':'Interaction','foreignKey':_0x2c5a('0x15c')});db[_0x2c5a('0x59')][_0x2c5a('0xf7')](db[_0x2c5a('0xd4')],{'as':_0x2c5a('0xd4'),'foreignKey':'AttachmentId'});db[_0x2c5a('0x59')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x159')});db['OpenchannelQueue'][_0x2c5a('0xfa')](db['User'],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0x34'),'foreignKey':_0x2c5a('0x15a')});db['OpenchannelQueue'][_0x2c5a('0xfa')](db[_0x2c5a('0xff')],{'through':_0x2c5a('0x15d'),'as':_0x2c5a('0x128')});db['ChatWebsite'][_0x2c5a('0xea')](db[_0x2c5a('0x75')],{'as':_0x2c5a('0x134'),'foreignKey':'ChatWebsiteId'});db['ChatWebsite'][_0x2c5a('0xea')](db[_0x2c5a('0x74')],{'as':_0x2c5a('0x14c'),'foreignKey':_0x2c5a('0x15e')});db['ChatWebsite'][_0x2c5a('0xea')](db[_0x2c5a('0x68')],{'as':_0x2c5a('0x15f')});db[_0x2c5a('0x5d')][_0x2c5a('0xea')](db['ChatInteraction'],{'as':_0x2c5a('0x136')});db[_0x2c5a('0x5d')][_0x2c5a('0xea')](db[_0x2c5a('0x5f')],{'as':'Applications'});db[_0x2c5a('0x5d')][_0x2c5a('0xea')](db[_0x2c5a('0x62')],{'as':_0x2c5a('0x135')});db[_0x2c5a('0x5d')][_0x2c5a('0xf7')](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138')});db[_0x2c5a('0x5d')][_0x2c5a('0xf7')](db[_0x2c5a('0x78')],{'as':_0x2c5a('0x78'),'foreignKey':'IntervalId'});db[_0x2c5a('0x5d')][_0x2c5a('0xf7')](db[_0x2c5a('0x7a')],{'as':_0x2c5a('0x13a'),'foreignKey':_0x2c5a('0x126')});db[_0x2c5a('0x5d')][_0x2c5a('0xfa')](db['User'],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0x10d')});db[_0x2c5a('0x160')]['belongsTo'](db['OpenchannelAccount'],{});db['OpenchannelQueueReport']['belongsTo'](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138')});db[_0x2c5a('0x160')][_0x2c5a('0xf7')](db['CmContact'],{'as':_0x2c5a('0x144'),'foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0x160')][_0x2c5a('0xf7')](db[_0x2c5a('0x58')],{});db[_0x2c5a('0x160')][_0x2c5a('0xf7')](db['OpenchannelMessage'],{});db[_0x2c5a('0x160')][_0x2c5a('0xf7')](db['User'],{});db[_0x2c5a('0x160')]['belongsTo'](db[_0x2c5a('0x5b')],{});db['ChatApplication'][_0x2c5a('0xf7')](db['User'],{'as':'Agent','foreignKey':_0x2c5a('0xec'),'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0x5f')][_0x2c5a('0xf7')](db[_0x2c5a('0x65')],{'as':_0x2c5a('0x161'),'foreignKey':_0x2c5a('0x162'),'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0x5f')][_0x2c5a('0xf7')](db[_0x2c5a('0x5d')],{'as':'Website','foreignKey':'ChatWebsiteId','onDelete':_0x2c5a('0x147')});db['ChatApplication']['belongsTo'](db[_0x2c5a('0x80')],{'onDelete':_0x2c5a('0x147'),'foreignKey':_0x2c5a('0x148')});db[_0x2c5a('0x60')][_0x2c5a('0xea')](db['ChatMessage'],{'as':_0x2c5a('0x135'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x163')});db[_0x2c5a('0x60')]['belongsTo'](db[_0x2c5a('0x5d')],{'as':_0x2c5a('0x13f'),'foreignKey':'ChatWebsiteId'});db['ChatInteraction'][_0x2c5a('0xf7')](db['CmContact'],{'as':_0x2c5a('0x144'),'foreignKey':'ContactId'});db['ChatInteraction'][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x140'),'foreignKey':_0x2c5a('0xec')});db[_0x2c5a('0x60')][_0x2c5a('0xfa')](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x164'),'as':_0x2c5a('0x142')});db[_0x2c5a('0x60')][_0x2c5a('0xfa')](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x164'),'as':'ThroughTags'});db[_0x2c5a('0x60')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x152'),'through':_0x2c5a('0x165'),'foreignKey':'ChatInteractionId'});db[_0x2c5a('0x62')][_0x2c5a('0xf7')](db['User'],{'onDelete':_0x2c5a('0xe9'),'as':_0x2c5a('0x13')});db[_0x2c5a('0x62')][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'onDelete':'cascade','as':_0x2c5a('0x144'),'foreignKey':_0x2c5a('0x130')});db['ChatMessage'][_0x2c5a('0xf7')](db[_0x2c5a('0x60')],{'onDelete':_0x2c5a('0xe9'),'as':_0x2c5a('0x145'),'foreignKey':_0x2c5a('0x163')});db[_0x2c5a('0x62')][_0x2c5a('0xf7')](db[_0x2c5a('0xd4')],{'as':_0x2c5a('0xd4'),'foreignKey':_0x2c5a('0x153')});db['ChatMessage'][_0x2c5a('0xf7')](db[_0x2c5a('0x5d')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x15e')});db[_0x2c5a('0x63')]['belongsTo'](db[_0x2c5a('0xfc')],{'onDelete':_0x2c5a('0xe9'),'as':_0x2c5a('0x144'),'foreignKey':'ContactId'});db[_0x2c5a('0x63')][_0x2c5a('0xf7')](db[_0x2c5a('0x5d')],{'as':_0x2c5a('0x13f'),'foreignKey':'ChatWebsiteId'});db[_0x2c5a('0x65')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13c'),'through':'UserChatQueue','hooks':!![]});db[_0x2c5a('0x65')]['belongsToMany'](db[_0x2c5a('0xff')],{'through':_0x2c5a('0x166'),'as':'Teams'});db['ChatGroup'][_0x2c5a('0xea')](db[_0x2c5a('0x167')],{'as':_0x2c5a('0x135'),'foreignKey':_0x2c5a('0x168'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x67')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x11c'),'through':'chat_group_has_users'});db[_0x2c5a('0x68')]['belongsTo'](db['ChatWebsite'],{'as':_0x2c5a('0x169'),'foreignKey':_0x2c5a('0x15e')});db[_0x2c5a('0x16a')][_0x2c5a('0xea')](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0xfd'),'foreignKey':'CompanyId'});db[_0x2c5a('0xfc')][_0x2c5a('0xea')](db['CmHopper'],{'as':_0x2c5a('0x11e'),'foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0xfc')][_0x2c5a('0xea')](db[_0x2c5a('0x6f')],{'as':_0x2c5a('0x11f'),'foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0xfc')][_0x2c5a('0xea')](db[_0x2c5a('0xef')],{'as':_0x2c5a('0x120'),'foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0xfc')][_0x2c5a('0xea')](db['ReportAgentPreview'],{'as':_0x2c5a('0x71'),'foreignKey':'ContactId'});db[_0x2c5a('0xfc')][_0x2c5a('0xea')](db[_0x2c5a('0x122')],{'as':'JscriptySessions','foreignKey':'ContactId'});db[_0x2c5a('0xfc')][_0x2c5a('0xea')](db[_0x2c5a('0x58')],{'as':'OpenchannelInteractions','foreignKey':_0x2c5a('0x130'),'onDelete':_0x2c5a('0x147')});db['CmContact'][_0x2c5a('0xea')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0x2c5a('0x147')});db['CmContact']['hasMany'](db[_0x2c5a('0x103')],{'as':'SmsInteractions','foreignKey':_0x2c5a('0x130'),'onDelete':'restrict'});db[_0x2c5a('0xfc')]['hasMany'](db[_0x2c5a('0xf4')],{'as':_0x2c5a('0xf5'),'foreignKey':_0x2c5a('0x130'),'onDelete':'restrict'});db[_0x2c5a('0xfc')][_0x2c5a('0xea')](db[_0x2c5a('0x3c')],{'as':_0x2c5a('0xf6'),'foreignKey':_0x2c5a('0x130'),'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0xfc')][_0x2c5a('0xf7')](db[_0x2c5a('0x16a')],{'as':_0x2c5a('0x16b'),'foreignKey':_0x2c5a('0x16c')});db[_0x2c5a('0xfc')][_0x2c5a('0xf7')](db['CmList'],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0xfc')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x152'),'through':_0x2c5a('0x16d')});db[_0x2c5a('0xfc')][_0x2c5a('0xfa')](db['Tag'],{'as':_0x2c5a('0x142'),'through':'cm_contact_has_tags'});db[_0x2c5a('0xfc')][_0x2c5a('0xfa')](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x16e'),'as':_0x2c5a('0x143')});db[_0x2c5a('0x6b')][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0x144'),'foreignKey':_0x2c5a('0x130'),'onDelete':'cascade'});db['CmHopper'][_0x2c5a('0xf7')](db['CmList'],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x6b')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x16f'),'foreignKey':'UserId'});db[_0x2c5a('0x6b')][_0x2c5a('0xf7')](db[_0x2c5a('0x1b')],{'as':_0x2c5a('0x161'),'foreignKey':_0x2c5a('0x11d'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x6b')]['belongsTo'](db[_0x2c5a('0xd1')],{'as':_0x2c5a('0xd1'),'foreignKey':'CampaignId','onDelete':_0x2c5a('0xe9')});db['CmHopper'][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x140'),'foreignKey':'OwnerId'});db[_0x2c5a('0x6d')][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0x144'),'foreignKey':_0x2c5a('0x130'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x6d')][_0x2c5a('0xf7')](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x6d')][_0x2c5a('0xf7')](db[_0x2c5a('0x1b')],{'as':_0x2c5a('0x161'),'foreignKey':_0x2c5a('0x11d'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x6d')][_0x2c5a('0xf7')](db[_0x2c5a('0xd1')],{'as':_0x2c5a('0xd1'),'foreignKey':'CampaignId','onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0x170')][_0x2c5a('0xea')](db[_0x2c5a('0x77')],{'as':{'plural':_0x2c5a('0x171'),'singular':'OneAll'},'foreignKey':_0x2c5a('0x172'),'onDelete':_0x2c5a('0xe9'),'hooks':!![]});db[_0x2c5a('0x170')][_0x2c5a('0xea')](db[_0x2c5a('0x77')],{'as':{'plural':_0x2c5a('0x173'),'singular':_0x2c5a('0x174')},'foreignKey':_0x2c5a('0x175'),'onDelete':_0x2c5a('0xe9'),'hooks':!![]});db[_0x2c5a('0x170')][_0x2c5a('0xea')](db[_0x2c5a('0x73')],{'as':_0x2c5a('0x176'),'foreignKey':_0x2c5a('0x177'),'onDelete':'cascade','hooks':!![]});db[_0x2c5a('0x78')]['hasMany'](db[_0x2c5a('0x78')],{'as':_0x2c5a('0x178'),'foreignKey':_0x2c5a('0x125'),'onDelete':_0x2c5a('0xe9'),'hooks':!![],'required':![]});db[_0x2c5a('0x78')][_0x2c5a('0xea')](db['VoiceExtension'],{'as':_0x2c5a('0xee'),'foreignKey':_0x2c5a('0x125'),'onDelete':_0x2c5a('0x147')});db['Interval'][_0x2c5a('0xea')](db['MailApplication'],{'as':_0x2c5a('0x179'),'foreignKey':_0x2c5a('0x125')});db[_0x2c5a('0x78')][_0x2c5a('0xea')](db['ChatApplication'],{'as':_0x2c5a('0x17a'),'foreignKey':_0x2c5a('0x125')});db[_0x2c5a('0x78')]['hasMany'](db[_0x2c5a('0x46')],{'as':_0x2c5a('0x17b'),'foreignKey':_0x2c5a('0x125')});db['Interval'][_0x2c5a('0xea')](db[_0x2c5a('0x4f')],{'as':_0x2c5a('0x17c'),'foreignKey':_0x2c5a('0x125')});db['Schedule']['belongsTo'](db['MailAccount'],{});db[_0x2c5a('0x7e')][_0x2c5a('0xf7')](db[_0x2c5a('0x17d')],{'foreignKey':_0x2c5a('0x17e')});db[_0x2c5a('0x7e')]['belongsTo'](db['AnalyticCustomReport'],{'foreignKey':_0x2c5a('0x17f')});db[_0x2c5a('0x119')]['belongsToMany'](db[_0x2c5a('0x19')],{'as':_0x2c5a('0x180'),'through':_0x2c5a('0x11b'),'onDelete':_0x2c5a('0x147')});db['Tag'][_0x2c5a('0xfa')](db[_0x2c5a('0xfc')],{'through':_0x2c5a('0x16e')});db[_0x2c5a('0x80')][_0x2c5a('0xfa')](db['ChatInteraction'],{'through':'chat_interaction_has_tags'});db['Tag'][_0x2c5a('0xfa')](db['MailInteraction'],{'through':'mail_interaction_has_tags'});db[_0x2c5a('0x80')][_0x2c5a('0xfa')](db[_0x2c5a('0x103')],{'through':_0x2c5a('0x156')});db[_0x2c5a('0x80')][_0x2c5a('0xfa')](db[_0x2c5a('0xf4')],{'through':_0x2c5a('0x151')});db[_0x2c5a('0x80')][_0x2c5a('0xfa')](db[_0x2c5a('0x58')],{'through':_0x2c5a('0x15b')});db[_0x2c5a('0x84')][_0x2c5a('0xea')](db[_0x2c5a('0x77')],{'as':{'plural':_0x2c5a('0x181'),'singular':_0x2c5a('0x182')},'foreignKey':'TriggerAllId','onDelete':_0x2c5a('0xe9'),'hooks':!![]});db[_0x2c5a('0x84')][_0x2c5a('0xea')](db[_0x2c5a('0x77')],{'as':{'plural':_0x2c5a('0x183'),'singular':_0x2c5a('0x184')},'foreignKey':_0x2c5a('0x185'),'onDelete':_0x2c5a('0xe9'),'hooks':!![]});db[_0x2c5a('0x84')][_0x2c5a('0xea')](db['Action'],{'as':_0x2c5a('0x176'),'foreignKey':_0x2c5a('0x186'),'onDelete':'cascade','hooks':!![]});db[_0x2c5a('0x187')][_0x2c5a('0xea')](db[_0x2c5a('0x188')],{'as':_0x2c5a('0x189'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x17f'),'hooks':!![]});db[_0x2c5a('0x17d')]['hasMany'](db[_0x2c5a('0x188')],{'as':_0x2c5a('0x189'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x17e')});db['AnalyticMetric']['hasMany'](db[_0x2c5a('0x188')],{'as':_0x2c5a('0x189'),'onDelete':_0x2c5a('0xe9'),'foreignKey':'MetricId'});db[_0x2c5a('0x188')][_0x2c5a('0xf7')](db[_0x2c5a('0x18a')],{'foreignKey':_0x2c5a('0x18b')});db[_0x2c5a('0x8f')]['hasMany'](db['SalesforceConfiguration'],{'as':_0x2c5a('0x18c'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0x91')][_0x2c5a('0xea')](db[_0x2c5a('0x93')],{'as':_0x2c5a('0x18e'),'onDelete':'cascade','foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0x91')]['hasMany'](db[_0x2c5a('0x93')],{'as':_0x2c5a('0x190'),'onDelete':'cascade','foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0x91')][_0x2c5a('0xea')](db[_0x2c5a('0x93')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0x91')]['belongsTo'](db[_0x2c5a('0x8f')],{'as':_0x2c5a('0x13f'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db['SalesforceField'],{'as':_0x2c5a('0x193'),'foreignKey':'SubjectId'});db[_0x2c5a('0x93')]['hasMany'](db[_0x2c5a('0x93')],{'as':'Description','foreignKey':_0x2c5a('0x191')});db['SalesforceField'][_0x2c5a('0xea')](db['SalesforceField'],{'as':_0x2c5a('0x194'),'foreignKey':'FieldId'});db[_0x2c5a('0x93')]['belongsTo'](db['Variable'],{'as':_0x2c5a('0x195'),'foreignKey':_0x2c5a('0x196')});db[_0x2c5a('0x95')][_0x2c5a('0xea')](db[_0x2c5a('0x97')],{'as':_0x2c5a('0x18c'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0x97')][_0x2c5a('0xea')](db['SugarcrmField'],{'as':_0x2c5a('0x18e'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x18f')});db['SugarcrmConfiguration'][_0x2c5a('0xea')](db['SugarcrmField'],{'as':'Descriptions','onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0x97')][_0x2c5a('0xea')](db[_0x2c5a('0x99')],{'as':_0x2c5a('0x189'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0x97')][_0x2c5a('0xf7')](db['SugarcrmAccount'],{'as':_0x2c5a('0x13f'),'foreignKey':'AccountId'});db['SugarcrmField'][_0x2c5a('0xea')](db[_0x2c5a('0x99')],{'as':'Subject','foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0x99')]['hasMany'](db[_0x2c5a('0x99')],{'as':_0x2c5a('0x197'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0x99')]['hasMany'](db[_0x2c5a('0x99')],{'as':_0x2c5a('0x194'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0x99')][_0x2c5a('0xf7')](db['Variable'],{'as':_0x2c5a('0x195'),'foreignKey':_0x2c5a('0x196')});db[_0x2c5a('0x198')][_0x2c5a('0xea')](db[_0x2c5a('0x9b')],{'as':_0x2c5a('0x18c'),'onDelete':_0x2c5a('0xe9'),'foreignKey':'AccountId'});db[_0x2c5a('0x9b')][_0x2c5a('0xea')](db[_0x2c5a('0x9c')],{'as':_0x2c5a('0x18e'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0x9b')][_0x2c5a('0xea')](db[_0x2c5a('0x9c')],{'as':_0x2c5a('0x190'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0x9b')][_0x2c5a('0xea')](db[_0x2c5a('0x9c')],{'as':_0x2c5a('0x189'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0x9b')][_0x2c5a('0xf7')](db['DeskAccount'],{'as':_0x2c5a('0x13f'),'foreignKey':'AccountId'});db['DeskConfiguration'][_0x2c5a('0xfa')](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x199')});db[_0x2c5a('0x9c')][_0x2c5a('0xea')](db['DeskField'],{'as':'Subject','foreignKey':_0x2c5a('0x18f')});db['DeskField'][_0x2c5a('0xea')](db[_0x2c5a('0x9c')],{'as':'Description','foreignKey':_0x2c5a('0x191')});db['DeskField'][_0x2c5a('0xea')](db[_0x2c5a('0x9c')],{'as':_0x2c5a('0x194'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0x9c')]['belongsTo'](db[_0x2c5a('0x195')],{'as':_0x2c5a('0x195'),'foreignKey':_0x2c5a('0x196')});db[_0x2c5a('0x9d')][_0x2c5a('0xea')](db[_0x2c5a('0x19a')],{'as':_0x2c5a('0x18c'),'onDelete':'cascade','foreignKey':'AccountId'});db['ZohoConfiguration'][_0x2c5a('0xea')](db[_0x2c5a('0x9e')],{'as':_0x2c5a('0x18e'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x18f')});db['ZohoConfiguration'][_0x2c5a('0xea')](db['ZohoField'],{'as':_0x2c5a('0x190'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0x19a')][_0x2c5a('0xea')](db['ZohoField'],{'as':_0x2c5a('0x189'),'onDelete':'cascade','foreignKey':'FieldId'});db[_0x2c5a('0x19a')]['belongsTo'](db[_0x2c5a('0x9d')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0x9e')][_0x2c5a('0xea')](db[_0x2c5a('0x9e')],{'as':_0x2c5a('0x193'),'foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0x9e')][_0x2c5a('0xea')](db[_0x2c5a('0x9e')],{'as':'Description','foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0x9e')][_0x2c5a('0xea')](db['ZohoField'],{'as':_0x2c5a('0x194'),'foreignKey':'FieldId'});db[_0x2c5a('0x9e')][_0x2c5a('0xf7')](db[_0x2c5a('0x195')],{'as':_0x2c5a('0x195'),'foreignKey':_0x2c5a('0x196')});db[_0x2c5a('0xa0')]['hasMany'](db[_0x2c5a('0x19b')],{'as':_0x2c5a('0x18c'),'onDelete':'cascade','foreignKey':_0x2c5a('0x18d')});db['ZendeskConfiguration'][_0x2c5a('0xea')](db[_0x2c5a('0xa3')],{'as':_0x2c5a('0x18e'),'foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0x19b')][_0x2c5a('0xea')](db['ZendeskField'],{'as':_0x2c5a('0x190'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0x19b')][_0x2c5a('0xea')](db['ZendeskField'],{'as':_0x2c5a('0x189'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0x19b')][_0x2c5a('0xf7')](db[_0x2c5a('0xa0')],{'as':'Account','foreignKey':_0x2c5a('0x18d')});db['ZendeskConfiguration']['belongsToMany'](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x19c')});db[_0x2c5a('0xa3')]['hasMany'](db['ZendeskField'],{'as':'Subject','foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0xa3')]['hasMany'](db[_0x2c5a('0xa3')],{'as':_0x2c5a('0x197'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0xa3')][_0x2c5a('0xea')](db[_0x2c5a('0xa3')],{'as':'Field','foreignKey':'FieldId'});db[_0x2c5a('0xa3')]['belongsTo'](db[_0x2c5a('0x195')],{'as':_0x2c5a('0x195'),'foreignKey':_0x2c5a('0x196')});db[_0x2c5a('0xa5')][_0x2c5a('0xea')](db['FreshdeskConfiguration'],{'as':_0x2c5a('0x18c'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0xa7')][_0x2c5a('0xea')](db[_0x2c5a('0xa9')],{'as':_0x2c5a('0x18e'),'onDelete':_0x2c5a('0xe9'),'foreignKey':'SubjectId'});db[_0x2c5a('0xa7')][_0x2c5a('0xea')](db[_0x2c5a('0xa9')],{'as':_0x2c5a('0x190'),'onDelete':'cascade','foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0xa7')]['hasMany'](db[_0x2c5a('0xa9')],{'as':_0x2c5a('0x189'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0xa7')][_0x2c5a('0xf7')](db[_0x2c5a('0xa5')],{'as':'Account','foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0xa7')][_0x2c5a('0xfa')](db[_0x2c5a('0x80')],{'through':_0x2c5a('0x19d')});db['FreshdeskField']['hasMany'](db[_0x2c5a('0xa9')],{'as':_0x2c5a('0x193'),'foreignKey':_0x2c5a('0x18f')});db['FreshdeskField']['hasMany'](db['FreshdeskField'],{'as':_0x2c5a('0x197'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0xa9')]['hasMany'](db[_0x2c5a('0xa9')],{'as':_0x2c5a('0x194'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0xa9')][_0x2c5a('0xf7')](db[_0x2c5a('0x195')],{'as':'Variable','foreignKey':_0x2c5a('0x196')});db[_0x2c5a('0xaa')][_0x2c5a('0xea')](db[_0x2c5a('0xac')],{'as':_0x2c5a('0x18c'),'onDelete':'cascade','foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0xac')]['hasMany'](db[_0x2c5a('0x19e')],{'as':_0x2c5a('0x18e'),'foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0xac')][_0x2c5a('0xea')](db[_0x2c5a('0x19e')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0x2c5a('0xac')][_0x2c5a('0xea')](db[_0x2c5a('0x19e')],{'as':_0x2c5a('0x189'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0xac')][_0x2c5a('0xf7')](db[_0x2c5a('0xaa')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0xac')][_0x2c5a('0xfa')](db['Tag'],{'through':_0x2c5a('0x19f')});db[_0x2c5a('0x19e')][_0x2c5a('0xea')](db['VtigerField'],{'as':'Subject','foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0x19e')][_0x2c5a('0xea')](db['VtigerField'],{'as':_0x2c5a('0x197'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0x19e')]['hasMany'](db[_0x2c5a('0x19e')],{'as':_0x2c5a('0x194'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0x19e')][_0x2c5a('0xf7')](db[_0x2c5a('0x195')],{'as':_0x2c5a('0x195'),'foreignKey':'VariableId'});db['ServicenowAccount']['hasMany'](db[_0x2c5a('0x1a0')],{'as':_0x2c5a('0x18c'),'onDelete':'cascade','foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0x1a0')][_0x2c5a('0xea')](db[_0x2c5a('0xb2')],{'as':_0x2c5a('0x18e'),'foreignKey':_0x2c5a('0x18f')});db['ServicenowConfiguration'][_0x2c5a('0xea')](db[_0x2c5a('0xb2')],{'as':_0x2c5a('0x190'),'foreignKey':'DescriptionId'});db[_0x2c5a('0x1a0')][_0x2c5a('0xea')](db['ServicenowField'],{'as':_0x2c5a('0x189'),'foreignKey':'FieldId'});db[_0x2c5a('0x1a0')][_0x2c5a('0xf7')](db['ServicenowAccount'],{'as':_0x2c5a('0x13f'),'foreignKey':'AccountId'});db[_0x2c5a('0xb2')]['hasMany'](db[_0x2c5a('0xb2')],{'as':'Subject','foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0xb2')]['hasMany'](db['ServicenowField'],{'as':_0x2c5a('0x197'),'foreignKey':_0x2c5a('0x191')});db['ServicenowField']['hasMany'](db[_0x2c5a('0xb2')],{'as':_0x2c5a('0x194'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0xb2')][_0x2c5a('0xf7')](db['Variable'],{'as':_0x2c5a('0x195'),'foreignKey':'VariableId'});db[_0x2c5a('0x1a1')][_0x2c5a('0xea')](db['Dynamics365Configuration'],{'as':_0x2c5a('0x18c'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0xb3')][_0x2c5a('0xea')](db['Dynamics365Field'],{'as':_0x2c5a('0x18e'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x18f')});db[_0x2c5a('0xb3')][_0x2c5a('0xea')](db[_0x2c5a('0xb5')],{'as':_0x2c5a('0x190'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x191')});db['Dynamics365Configuration'][_0x2c5a('0xea')](db[_0x2c5a('0xb5')],{'as':_0x2c5a('0x189'),'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x192')});db[_0x2c5a('0xb3')][_0x2c5a('0xf7')](db[_0x2c5a('0x1a1')],{'as':_0x2c5a('0x13f'),'foreignKey':_0x2c5a('0x18d')});db[_0x2c5a('0xb5')][_0x2c5a('0xea')](db[_0x2c5a('0xb5')],{'as':_0x2c5a('0x193'),'foreignKey':'SubjectId'});db[_0x2c5a('0xb5')]['hasMany'](db[_0x2c5a('0xb5')],{'as':_0x2c5a('0x197'),'foreignKey':_0x2c5a('0x191')});db[_0x2c5a('0xb5')]['hasMany'](db[_0x2c5a('0xb5')],{'as':_0x2c5a('0x194'),'foreignKey':'FieldId'});db[_0x2c5a('0xb5')][_0x2c5a('0xf7')](db[_0x2c5a('0x195')],{'as':'Variable','foreignKey':_0x2c5a('0x196')});db[_0x2c5a('0xb8')][_0x2c5a('0xf7')](db['ChatWebsite'],{});db[_0x2c5a('0xb8')]['belongsTo'](db[_0x2c5a('0xdf')],{'as':_0x2c5a('0x137'),'foreignKey':_0x2c5a('0x138')});db[_0x2c5a('0xb8')][_0x2c5a('0xf7')](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0x144'),'foreignKey':_0x2c5a('0x130')});db[_0x2c5a('0xb8')][_0x2c5a('0xf7')](db[_0x2c5a('0x60')],{});db[_0x2c5a('0xb8')][_0x2c5a('0xf7')](db[_0x2c5a('0x62')],{});db[_0x2c5a('0xb8')]['belongsTo'](db[_0x2c5a('0x13')],{});db[_0x2c5a('0xb8')][_0x2c5a('0xf7')](db[_0x2c5a('0x65')],{});db[_0x2c5a('0x167')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'onDelete':_0x2c5a('0xe9'),'foreignKey':'FromId'});db[_0x2c5a('0x167')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'onDelete':_0x2c5a('0xe9'),'foreignKey':_0x2c5a('0x1a2')});db['JscriptySessionReport'][_0x2c5a('0xea')](db[_0x2c5a('0xbc')],{'foreignKey':_0x2c5a('0x1a3'),'onDelete':_0x2c5a('0xe9')});db['JscriptySessionReport'][_0x2c5a('0xea')](db[_0x2c5a('0xba')],{'foreignKey':_0x2c5a('0x1a3'),'onDelete':_0x2c5a('0xe9')});db[_0x2c5a('0xbd')][_0x2c5a('0xf7')](db[_0x2c5a('0x4d')],{});db[_0x2c5a('0xbd')][_0x2c5a('0xf7')](db[_0x2c5a('0xdf')],{'as':'List','foreignKey':'ListId'});db[_0x2c5a('0xbd')]['belongsTo'](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0x144'),'foreignKey':_0x2c5a('0x130')});db['SmsQueueReport']['belongsTo'](db['SmsInteraction'],{});db[_0x2c5a('0xbd')]['belongsTo'](db[_0x2c5a('0x51')],{});db[_0x2c5a('0xbd')][_0x2c5a('0xf7')](db['User'],{});db[_0x2c5a('0xbd')][_0x2c5a('0xf7')](db[_0x2c5a('0x52')],{});db['JscriptyProject'][_0x2c5a('0xea')](db['JscriptySessionReport'],{'foreignKey':_0x2c5a('0x1a4')});db[_0x2c5a('0xc3')][_0x2c5a('0xea')](db[_0x2c5a('0xbc')],{'foreignKey':_0x2c5a('0x1a4')});db[_0x2c5a('0xc3')][_0x2c5a('0xea')](db[_0x2c5a('0xba')],{'foreignKey':_0x2c5a('0x1a4')});db[_0x2c5a('0xc8')][_0x2c5a('0xfa')](db['User'],{'as':_0x2c5a('0x152'),'through':'user_has_square_projects'});db[_0x2c5a('0xff')]['belongsToMany'](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0x100')});db[_0x2c5a('0xff')]['belongsToMany'](db[_0x2c5a('0x1b')],{'through':_0x2c5a('0x129'),'as':'VoiceQueues'});db['Team'][_0x2c5a('0xfa')](db[_0x2c5a('0x106')],{'through':_0x2c5a('0x13d'),'as':_0x2c5a('0x1a5')});db['Team'][_0x2c5a('0xfa')](db['ChatQueue'],{'through':_0x2c5a('0x166'),'as':'ChatQueues'});db['Team']['belongsToMany'](db[_0x2c5a('0x14f')],{'through':_0x2c5a('0x154'),'as':_0x2c5a('0x108')});db[_0x2c5a('0xff')]['belongsToMany'](db[_0x2c5a('0x52')],{'through':'team_has_sms_queues','as':_0x2c5a('0x1a6')});db[_0x2c5a('0xff')][_0x2c5a('0xfa')](db[_0x2c5a('0x5b')],{'through':_0x2c5a('0x15d'),'as':_0x2c5a('0x1a7')});db[_0x2c5a('0xd1')][_0x2c5a('0xea')](db[_0x2c5a('0x6b')],{'as':_0x2c5a('0x11e'),'foreignKey':_0x2c5a('0x1a8')});db[_0x2c5a('0xd1')][_0x2c5a('0xea')](db[_0x2c5a('0x6f')],{'as':'HopperFinals','foreignKey':'CampaignId'});db[_0x2c5a('0xd1')][_0x2c5a('0xea')](db[_0x2c5a('0xef')],{'as':'HopperHistories','foreignKey':_0x2c5a('0x1a8')});db[_0x2c5a('0xd1')][_0x2c5a('0xea')](db[_0x2c5a('0x6d')],{'as':_0x2c5a('0x121'),'foreignKey':_0x2c5a('0x1a8')});db[_0x2c5a('0xd1')][_0x2c5a('0xf7')](db[_0x2c5a('0x2a')],{'as':_0x2c5a('0x2a'),'foreignKey':'TrunkId'});db[_0x2c5a('0xd1')]['belongsTo'](db[_0x2c5a('0x2a')],{'as':_0x2c5a('0x1a9'),'foreignKey':_0x2c5a('0x124')});db[_0x2c5a('0xd1')]['belongsTo'](db[_0x2c5a('0x78')],{'as':_0x2c5a('0x78'),'foreignKey':_0x2c5a('0x125')});db[_0x2c5a('0xd1')][_0x2c5a('0xf7')](db[_0x2c5a('0xc8')],{'as':_0x2c5a('0xc8'),'foreignKey':'SquareProjectId'});db[_0x2c5a('0xd1')][_0x2c5a('0xfa')](db['CmList'],{'as':_0x2c5a('0x127'),'through':'campaigns_has_cm_lists'});db[_0x2c5a('0xd1')][_0x2c5a('0xfa')](db['CmList'],{'as':_0x2c5a('0x12a'),'through':_0x2c5a('0x1aa')});db[_0x2c5a('0xd8')]['belongsTo'](db['MailMessage'],{});db[_0x2c5a('0xd8')][_0x2c5a('0xf7')](db[_0x2c5a('0x3c')],{});db['MailTransferReport'][_0x2c5a('0xf7')](db['MailAccount'],{'foreignKey':_0x2c5a('0x1ab'),'as':'FromAccount'});db[_0x2c5a('0xd8')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':'ToUserId','as':_0x2c5a('0x1ac')});db['MailTransferReport']['belongsTo'](db['MailQueue'],{'foreignKey':_0x2c5a('0x1ad'),'as':'ToQueue'});db[_0x2c5a('0xd8')][_0x2c5a('0xf7')](db[_0x2c5a('0x38')],{'foreignKey':_0x2c5a('0x1ae'),'as':'ToAccount'});db[_0x2c5a('0xd9')]['belongsTo'](db['ChatMessage'],{});db[_0x2c5a('0xd9')][_0x2c5a('0xf7')](db[_0x2c5a('0x60')],{});db[_0x2c5a('0xd9')][_0x2c5a('0xf7')](db['ChatWebsite'],{'foreignKey':_0x2c5a('0x1af'),'as':'FromAccount'});db[_0x2c5a('0xd9')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':_0x2c5a('0x1b0')});db[_0x2c5a('0xd9')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'foreignKey':_0x2c5a('0x1b1'),'as':_0x2c5a('0x1ac')});db[_0x2c5a('0xd9')][_0x2c5a('0xf7')](db[_0x2c5a('0x65')],{'foreignKey':_0x2c5a('0x1b2'),'as':_0x2c5a('0x1b3')});db[_0x2c5a('0xd9')][_0x2c5a('0xf7')](db[_0x2c5a('0x5d')],{'foreignKey':'ToChatWebsiteId','as':_0x2c5a('0x1b4')});db[_0x2c5a('0xdb')][_0x2c5a('0xf7')](db[_0x2c5a('0x49')],{});db['FaxTransferReport']['belongsTo'](db['FaxInteraction'],{});db[_0x2c5a('0xdb')][_0x2c5a('0xf7')](db[_0x2c5a('0x44')],{'foreignKey':_0x2c5a('0x1b5'),'as':_0x2c5a('0x1b6')});db[_0x2c5a('0xdb')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x2c5a('0xdb')]['belongsTo'](db[_0x2c5a('0x13')],{'foreignKey':_0x2c5a('0x1b1'),'as':_0x2c5a('0x1ac')});db[_0x2c5a('0xdb')][_0x2c5a('0xf7')](db[_0x2c5a('0x14f')],{'foreignKey':_0x2c5a('0x1b7'),'as':_0x2c5a('0x1b3')});db[_0x2c5a('0xdb')]['belongsTo'](db[_0x2c5a('0x44')],{'foreignKey':_0x2c5a('0x1b8'),'as':_0x2c5a('0x1b4')});db[_0x2c5a('0x1b9')][_0x2c5a('0xf7')](db[_0x2c5a('0x59')],{});db[_0x2c5a('0x1b9')][_0x2c5a('0xf7')](db[_0x2c5a('0x58')],{});db[_0x2c5a('0x1b9')][_0x2c5a('0xf7')](db[_0x2c5a('0x54')],{'foreignKey':_0x2c5a('0x1ba'),'as':_0x2c5a('0x1b6')});db[_0x2c5a('0x1b9')]['belongsTo'](db['User'],{'foreignKey':_0x2c5a('0x1bb'),'as':'FromAgent'});db[_0x2c5a('0x1b9')][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'foreignKey':_0x2c5a('0x1b1'),'as':'ToAgent'});db[_0x2c5a('0x1b9')]['belongsTo'](db[_0x2c5a('0x5b')],{'foreignKey':_0x2c5a('0x1bc'),'as':_0x2c5a('0x1b3')});db[_0x2c5a('0x1b9')]['belongsTo'](db[_0x2c5a('0x54')],{'foreignKey':_0x2c5a('0x1bd'),'as':_0x2c5a('0x1b4')});db['SmsTransferReport'][_0x2c5a('0xf7')](db[_0x2c5a('0x51')],{});db[_0x2c5a('0xde')][_0x2c5a('0xf7')](db[_0x2c5a('0x103')],{});db[_0x2c5a('0xde')]['belongsTo'](db[_0x2c5a('0x4d')],{'foreignKey':_0x2c5a('0x1be'),'as':_0x2c5a('0x1b6')});db['SmsTransferReport'][_0x2c5a('0xf7')](db['User'],{'foreignKey':_0x2c5a('0x1bb'),'as':_0x2c5a('0x1b0')});db['SmsTransferReport'][_0x2c5a('0xf7')](db[_0x2c5a('0x13')],{'foreignKey':_0x2c5a('0x1b1'),'as':_0x2c5a('0x1ac')});db[_0x2c5a('0xde')][_0x2c5a('0xf7')](db[_0x2c5a('0x52')],{'foreignKey':_0x2c5a('0x1bf'),'as':_0x2c5a('0x1b3')});db['SmsTransferReport']['belongsTo'](db['SmsAccount'],{'foreignKey':_0x2c5a('0x1c0'),'as':_0x2c5a('0x1b4')});db[_0x2c5a('0xdf')]['hasMany'](db['Disposition'],{'as':_0x2c5a('0x134'),'foreignKey':_0x2c5a('0x138')});db[_0x2c5a('0xdf')]['hasMany'](db[_0x2c5a('0x1c1')],{'as':_0x2c5a('0x1c2'),'foreignKey':'ListId'});db[_0x2c5a('0xdf')][_0x2c5a('0xea')](db[_0x2c5a('0xfc')],{'as':_0x2c5a('0xfd'),'onDelete':_0x2c5a('0xe9'),'foreignKey':'ListId'});db['CmList'][_0x2c5a('0xea')](db[_0x2c5a('0x6f')],{'as':'HopperFinals','foreignKey':_0x2c5a('0x138')});db['CmList'][_0x2c5a('0xea')](db[_0x2c5a('0xef')],{'as':'HopperHistory','foreignKey':_0x2c5a('0x138')});db[_0x2c5a('0xdf')][_0x2c5a('0xea')](db[_0x2c5a('0x71')],{'as':'ReportAgentPreview','foreignKey':'ListId'});db[_0x2c5a('0xdf')][_0x2c5a('0xfa')](db[_0x2c5a('0x1b')],{'as':_0x2c5a('0x1c3'),'through':_0x2c5a('0x1c4')});db[_0x2c5a('0xdf')]['belongsToMany'](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13c'),'through':_0x2c5a('0xfe')});db[_0x2c5a('0xe1')][_0x2c5a('0xea')](db[_0x2c5a('0x18')],{'as':_0x2c5a('0xee'),'onDelete':_0x2c5a('0x147')});db[_0x2c5a('0xe1')][_0x2c5a('0xfa')](db[_0x2c5a('0x13')],{'as':_0x2c5a('0x13c'),'through':'user_has_voice_prefixes'});db['UserProfile'][_0x2c5a('0xea')](db['User'],{'as':_0x2c5a('0x152'),'foreignKey':_0x2c5a('0xf9')});db[_0x2c5a('0xf8')]['hasMany'](db[_0x2c5a('0xe4')],{'as':_0x2c5a('0x1c5'),'foreignKey':_0x2c5a('0xf9'),'onDelete':'cascade'});db[_0x2c5a('0xe4')][_0x2c5a('0xea')](db[_0x2c5a('0x1c6')],{'as':_0x2c5a('0x1c7'),'foreignKey':'sectionId','onDelete':_0x2c5a('0xe9')});module[_0x2c5a('0x1c8')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index 0150f84..ab0b14a 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf83d=['./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','./api/intSalesforceConfiguration','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/servicenow/accounts','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','/api/networks','./api/network','/api/chat/reports/queue','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/smsQueueReport','/api/square/reports','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','/api/teams','./api/team','/api/license','./api/license','./api/campaign','/api/migrations','./api/migration','/api/attachments','/api/plugins','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileSection','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','/api/jira','./api/jira','/api/rpc','./api/rpc','./api/version','/api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','1.0.15','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','path','express-winston','./errors','./config/environment','./config/logger','api','default','use','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','headers','x-forwarded-for','remoteAddress','url','statusCode','user','logger','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','connection','responseTime','name','role','device','other','agent_name','test','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','./api/voiceQueueReport','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','/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/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','/api/openchannel/queues','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','./api/chatQueue','./api/chatGroup','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper_black','/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/disposition','./api/condition','/api/intervals','./api/interval'];(function(_0x1b9080,_0x25d543){var _0x4ce6ee=function(_0x4cccf8){while(--_0x4cccf8){_0x1b9080['push'](_0x1b9080['shift']());}};_0x4ce6ee(++_0x25d543);}(_0xf83d,0x8c));var _0xdf83=function(_0x394abb,_0x8a4756){_0x394abb=_0x394abb-0x0;var _0x1b9690=_0xf83d[_0x394abb];return _0x1b9690;};'use strict';var path=require(_0xdf83('0x0'));var express=require('express');var ewinston=require(_0xdf83('0x1'));var util=require('util');var errors=require(_0xdf83('0x2'));var config=require(_0xdf83('0x3'));var logger=require(_0xdf83('0x4'))(_0xdf83('0x5'));var authLogger=require(_0xdf83('0x4'))('auth');exports[_0xdf83('0x6')]=function(_0x4be121){_0x4be121[_0xdf83('0x7')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xd5d22a,_0x24e0ee){return util[_0xdf83('0x8')](_0xdf83('0x9'),_0xd5d22a['method'],_0xd5d22a[_0xdf83('0xa')][_0xdf83('0xb')]?_0xd5d22a[_0xdf83('0xa')][_0xdf83('0xb')]:_0xd5d22a['connection'][_0xdf83('0xc')]||_0xd5d22a['ip'],_0xd5d22a[_0xdf83('0xd')],_0x24e0ee[_0xdf83('0xe')],_0x24e0ee['responseTime'],_0xd5d22a['user']?_0xd5d22a[_0xdf83('0xf')]['id']:null,_0xd5d22a[_0xdf83('0xf')]?_0xd5d22a[_0xdf83('0xf')]['name']:null,_0xd5d22a[_0xdf83('0xf')]?_0xd5d22a[_0xdf83('0xf')]['role']:null);}}));_0x4be121[_0xdf83('0x7')](ewinston[_0xdf83('0x10')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x4fc85f,_0x3e65fe){var _0x2cc058='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x4fc85f[_0xdf83('0x11')]&&_0x4fc85f['body']['device']&&_0x4fc85f[_0xdf83('0x11')][_0xdf83('0x12')]){_0x2cc058=_0xdf83('0x13');}return util[_0xdf83('0x8')](_0x2cc058,_0x4fc85f[_0xdf83('0x14')],_0x4fc85f[_0xdf83('0xa')]['x-forwarded-for']?_0x4fc85f[_0xdf83('0xa')][_0xdf83('0xb')]:_0x4fc85f[_0xdf83('0x15')][_0xdf83('0xc')]||_0x4fc85f['ip'],_0x4fc85f[_0xdf83('0xd')],_0x3e65fe['statusCode'],_0x3e65fe[_0xdf83('0x16')],_0x4fc85f[_0xdf83('0xf')]?_0x4fc85f[_0xdf83('0xf')]['id']:null,_0x4fc85f[_0xdf83('0xf')]?_0x4fc85f[_0xdf83('0xf')][_0xdf83('0x17')]:null,_0x4fc85f[_0xdf83('0xf')]?_0x4fc85f[_0xdf83('0xf')][_0xdf83('0x18')]:null,_0x4fc85f[_0xdf83('0x11')]&&_0x4fc85f[_0xdf83('0x11')][_0xdf83('0x19')]?_0x4fc85f[_0xdf83('0x11')][_0xdf83('0x19')]:_0xdf83('0x1a'),_0x4fc85f[_0xdf83('0x11')]&&_0x4fc85f[_0xdf83('0x11')]['agent_id']?_0x4fc85f['body'][_0xdf83('0x12')]:'',_0x4fc85f[_0xdf83('0x11')]&&_0x4fc85f[_0xdf83('0x11')][_0xdf83('0x1b')]?_0x4fc85f[_0xdf83('0x11')][_0xdf83('0x1b')]:'');},'ignoreRoute':function(_0x1dbf7b){var _0x5bd12e=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x5bd12e[_0xdf83('0x1c')](_0x1dbf7b[_0xdf83('0xd')]);}}));_0x4be121[_0xdf83('0x7')](_0xdf83('0x1d'),require(_0xdf83('0x1e')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x1f'),require(_0xdf83('0x20')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x21'),require(_0xdf83('0x22')));_0x4be121['use']('/api/voice/extensions',require('./api/voiceExtension'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x23'),require(_0xdf83('0x24')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x25'),require(_0xdf83('0x26')));_0x4be121['use'](_0xdf83('0x27'),require(_0xdf83('0x28')));_0x4be121[_0xdf83('0x7')]('/api/screen/recordings',require(_0xdf83('0x29')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x2a'),require('./api/voiceMail'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x2b'),require(_0xdf83('0x2c')));_0x4be121[_0xdf83('0x7')]('/api/voice/calls/reports',require('./api/voiceCallReport'));_0x4be121['use'](_0xdf83('0x2d'),require(_0xdf83('0x2e')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x2f'),require(_0xdf83('0x30')));_0x4be121['use']('/api/voice/queues/reports',require(_0xdf83('0x31')));_0x4be121[_0xdf83('0x7')]('/api/members/reports',require(_0xdf83('0x32')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x33'),require(_0xdf83('0x34')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x35'),require(_0xdf83('0x36')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x37'),require(_0xdf83('0x38')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x39'),require(_0xdf83('0x3a')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x3b'),require(_0xdf83('0x3c')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x3d'),require(_0xdf83('0x3e')));_0x4be121['use']('/api/mail/interactions',require(_0xdf83('0x3f')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x40'),require(_0xdf83('0x41')));_0x4be121[_0xdf83('0x7')]('/api/mail/applications',require('./api/mailApplication'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x42'),require(_0xdf83('0x43')));_0x4be121['use'](_0xdf83('0x44'),require('./api/dashboard'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x45'),require(_0xdf83('0x46')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x47'),require(_0xdf83('0x48')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x49'),require(_0xdf83('0x4a')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x4b'),require('./api/faxInteraction'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x4c'),require(_0xdf83('0x4d')));_0x4be121['use'](_0xdf83('0x4e'),require(_0xdf83('0x4f')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x50'),require('./api/faxQueueReport'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x51'),require(_0xdf83('0x52')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x53'),require(_0xdf83('0x54')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x55'),require(_0xdf83('0x56')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x57'),require(_0xdf83('0x58')));_0x4be121['use'](_0xdf83('0x59'),require('./api/smsQueue'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x5a'),require(_0xdf83('0x5b')));_0x4be121[_0xdf83('0x7')]('/api/openchannel/applications',require(_0xdf83('0x5c')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x5d'),require(_0xdf83('0x5e')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x5f'),require('./api/openchannelMessage'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x60'),require('./api/openchannelQueue'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x61'),require(_0xdf83('0x62')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x63'),require(_0xdf83('0x64')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x65'),require('./api/chatApplication'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x66'),require(_0xdf83('0x67')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x68'),require(_0xdf83('0x69')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x6a'),require(_0xdf83('0x6b')));_0x4be121['use']('/api/chat/queues',require(_0xdf83('0x6c')));_0x4be121[_0xdf83('0x7')]('/api/chat/groups',require(_0xdf83('0x6d')));_0x4be121[_0xdf83('0x7')]('/api/chat/proactive_actions',require(_0xdf83('0x6e')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x6f'),require(_0xdf83('0x70')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x71'),require('./api/cmContact'));_0x4be121[_0xdf83('0x7')]('/api/cm/hopper',require('./api/cmHopper'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x72'),require('./api/cmHopperBlack'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x73'),require(_0xdf83('0x74')));_0x4be121['use'](_0xdf83('0x75'),require(_0xdf83('0x76')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x77'),require(_0xdf83('0x78')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x79'),require(_0xdf83('0x7a')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x7b'),require(_0xdf83('0x7c')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x7d'),require(_0xdf83('0x7e')));_0x4be121[_0xdf83('0x7')]('/api/dispositions',require(_0xdf83('0x7f')));_0x4be121['use']('/api/conditions',require(_0xdf83('0x80')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x81'),require(_0xdf83('0x82')));_0x4be121['use']('/api/pauses',require(_0xdf83('0x83')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x84'),require(_0xdf83('0x85')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x86'),require(_0xdf83('0x87')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x88'),require(_0xdf83('0x89')));_0x4be121[_0xdf83('0x7')]('/api/sounds',require(_0xdf83('0x8a')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x8b'),require('./api/tag'));_0x4be121[_0xdf83('0x7')]('/api/templates',require(_0xdf83('0x8c')));_0x4be121['use'](_0xdf83('0x8d'),require(_0xdf83('0x8e')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x8f'),require(_0xdf83('0x90')));_0x4be121['use']('/api/integrations',require(_0xdf83('0x91')));_0x4be121['use'](_0xdf83('0x92'),require(_0xdf83('0x93')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x94'),require(_0xdf83('0x95')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x96'),require(_0xdf83('0x97')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x98'),require(_0xdf83('0x99')));_0x4be121['use'](_0xdf83('0x9a'),require(_0xdf83('0x9b')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x9c'),require('./api/analyticFieldReport'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x9d'),require(_0xdf83('0x9e')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x9f'),require(_0xdf83('0xa0')));_0x4be121[_0xdf83('0x7')]('/api/integrations/salesforce/configurations',require(_0xdf83('0xa1')));_0x4be121['use']('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xa2'),require(_0xdf83('0xa3')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xa4'),require(_0xdf83('0xa5')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xa6'),require('./api/intSugarcrmField'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xa7'),require('./api/intDeskAccount'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xa8'),require('./api/intDeskConfiguration'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xa9'),require(_0xdf83('0xaa')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xab'),require(_0xdf83('0xac')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xad'),require(_0xdf83('0xae')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xaf'),require(_0xdf83('0xb0')));_0x4be121['use'](_0xdf83('0xb1'),require(_0xdf83('0xb2')));_0x4be121[_0xdf83('0x7')]('/api/integrations/zendesk/configurations',require(_0xdf83('0xb3')));_0x4be121['use'](_0xdf83('0xb4'),require(_0xdf83('0xb5')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xb6'),require(_0xdf83('0xb7')));_0x4be121['use'](_0xdf83('0xb8'),require(_0xdf83('0xb9')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xba'),require(_0xdf83('0xbb')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xbc'),require('./api/intVtigerAccount'));_0x4be121['use'](_0xdf83('0xbd'),require(_0xdf83('0xbe')));_0x4be121[_0xdf83('0x7')]('/api/integrations/vtiger/fields',require('./api/intVtigerField'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xbf'),require('./api/intServicenowAccount'));_0x4be121['use']('/api/integrations/servicenow/configurations',require('./api/intServicenowConfiguration'));_0x4be121[_0xdf83('0x7')]('/api/integrations/servicenow/fields',require(_0xdf83('0xc0')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xc1'),require('./api/intDynamics365Account'));_0x4be121['use'](_0xdf83('0xc2'),require(_0xdf83('0xc3')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xc4'),require('./api/intDynamics365Field'));_0x4be121['use'](_0xdf83('0xc5'),require(_0xdf83('0xc6')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xc7'),require('./api/chatQueueReport'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xc8'),require(_0xdf83('0xc9')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xca'),require(_0xdf83('0xcb')));_0x4be121[_0xdf83('0x7')]('/api/jscripty/questions/reports',require(_0xdf83('0xcc')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xcd'),require('./api/jscriptySessionReport'));_0x4be121[_0xdf83('0x7')]('/api/sms/reports/queue',require(_0xdf83('0xce')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xcf'),require('./api/squareReport'));_0x4be121['use'](_0xdf83('0xd0'),require(_0xdf83('0xd1')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xd2'),require(_0xdf83('0xd3')));_0x4be121[_0xdf83('0x7')]('/api/settings',require('./api/setting'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xd4'),require(_0xdf83('0xd5')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xd6'),require(_0xdf83('0xd7')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xd8'),require(_0xdf83('0xd9')));_0x4be121['use'](_0xdf83('0xda'),require('./api/squareMessage'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xdb'),require(_0xdf83('0xdc')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xdd'),require(_0xdf83('0xde')));_0x4be121[_0xdf83('0x7')]('/api/campaigns',require(_0xdf83('0xdf')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xe0'),require(_0xdf83('0xe1')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xe2'),require('./api/attachment'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xe3'),require('./api/plugin'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xe4'),require(_0xdf83('0xe5')));_0x4be121[_0xdf83('0x7')]('/api/chat/reports/transfer',require(_0xdf83('0xe6')));_0x4be121['use'](_0xdf83('0xe7'),require(_0xdf83('0xe8')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xe9'),require(_0xdf83('0xea')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xeb'),require(_0xdf83('0xec')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xed'),require(_0xdf83('0xee')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xef'),require(_0xdf83('0xf0')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xf1'),require(_0xdf83('0xf2')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xf3'),require(_0xdf83('0xf4')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xf5'),require(_0xdf83('0xf6')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xf7'),require(_0xdf83('0xf8')));_0x4be121[_0xdf83('0x7')](_0xdf83('0xf9'),require('./api/authGoogle'));_0x4be121[_0xdf83('0x7')](_0xdf83('0xfa'),require(_0xdf83('0xfb')));_0x4be121['use'](_0xdf83('0xfc'),require(_0xdf83('0xfd')));_0x4be121[_0xdf83('0x7')]('/api/version',require(_0xdf83('0xfe')));_0x4be121['use'](_0xdf83('0xff'),require('./api/system'));_0x4be121[_0xdf83('0x7')](_0xdf83('0x100'),require(_0xdf83('0x101')));_0x4be121[_0xdf83('0x7')](_0xdf83('0x102'),express[_0xdf83('0x103')](path[_0xdf83('0x104')](config[_0xdf83('0x105')],_0xdf83('0x102'))));_0x4be121[_0xdf83('0x7')](_0xdf83('0x106'),express[_0xdf83('0x103')](path['join'](config[_0xdf83('0x105')],_0xdf83('0x106'))));_0x4be121[_0xdf83('0x7')](_0xdf83('0x107'),express[_0xdf83('0x103')](path['join'](config['root'],_0xdf83('0x107'))));_0x4be121[_0xdf83('0x7')]('/snippet',express[_0xdf83('0x103')](path[_0xdf83('0x104')](config['root'],'snippet',_0xdf83('0x108'))));_0x4be121[_0xdf83('0x7')]('/plugins',express[_0xdf83('0x103')](path[_0xdf83('0x104')](config[_0xdf83('0x105')],_0xdf83('0x109'))));_0x4be121[_0xdf83('0x10a')](_0xdf83('0x10b'))[_0xdf83('0x10c')](errors[0x194]);_0x4be121['route']('/*')[_0xdf83('0x10c')](function(_0x5b9063,_0xca204c){_0xca204c[_0xdf83('0x10d')](path[_0xdf83('0x10e')](_0x4be121[_0xdf83('0x10c')]('appPath')+'/index.html'));});}; \ No newline at end of file +var _0xf8fe=['./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','./api/intSugarcrmField','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','./api/jscriptySessionReport','./api/smsQueueReport','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','/api/jscripty/projects','/api/settings','/api/square/odbc','./api/squareProject','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','./api/license','/api/campaigns','./api/campaign','./api/migration','/api/attachments','./api/attachment','./api/plugin','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','./api/faxTransferReport','/api/openchannel/reports/transfer','./api/smsTransferReport','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','/api/userProfiles','/api/userProfile/sections','/api/userProfile/resources','./api/userProfileResource','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','/api/rpc','./api/rpc','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','root','/www','/demo','/snippet','snippet','/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','resolve','appPath','express','express-winston','util','./errors','./config/environment','./config/logger','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','headers','remoteAddress','url','statusCode','responseTime','user','role','use','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','method','x-forwarded-for','device','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceAgentReport','/api/members/reports','./api/memberReport','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/interactions','./api/faxInteraction','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','/api/sms/applications','./api/smsApplication','/api/sms/interactions','/api/sms/messages','/api/sms/queues','./api/smsQueue','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','/api/openchannel/interactions','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/tags','./api/template','/api/triggers','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_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'];(function(_0x5646d3,_0x21cb2d){var _0x41c528=function(_0x31f3d1){while(--_0x31f3d1){_0x5646d3['push'](_0x5646d3['shift']());}};_0x41c528(++_0x21cb2d);}(_0xf8fe,0x6d));var _0xef8f=function(_0x4faf54,_0x3d1218){_0x4faf54=_0x4faf54-0x0;var _0x24b986=_0xf8fe[_0x4faf54];return _0x24b986;};'use strict';var path=require('path');var express=require(_0xef8f('0x0'));var ewinston=require(_0xef8f('0x1'));var util=require(_0xef8f('0x2'));var errors=require(_0xef8f('0x3'));var config=require(_0xef8f('0x4'));var logger=require('./config/logger')('api');var authLogger=require(_0xef8f('0x5'))('auth');exports['default']=function(_0x338ae8){_0x338ae8['use'](ewinston[_0xef8f('0x6')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x27e8dd,_0x44667b){return util[_0xef8f('0x7')](_0xef8f('0x8'),_0x27e8dd['method'],_0x27e8dd[_0xef8f('0x9')]['x-forwarded-for']?_0x27e8dd[_0xef8f('0x9')]['x-forwarded-for']:_0x27e8dd['connection'][_0xef8f('0xa')]||_0x27e8dd['ip'],_0x27e8dd[_0xef8f('0xb')],_0x44667b[_0xef8f('0xc')],_0x44667b[_0xef8f('0xd')],_0x27e8dd['user']?_0x27e8dd['user']['id']:null,_0x27e8dd[_0xef8f('0xe')]?_0x27e8dd[_0xef8f('0xe')]['name']:null,_0x27e8dd[_0xef8f('0xe')]?_0x27e8dd[_0xef8f('0xe')][_0xef8f('0xf')]:null);}}));_0x338ae8[_0xef8f('0x10')](ewinston[_0xef8f('0x6')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x5c2520,_0x157921){var _0x3c7cb9=_0xef8f('0x11');if(_0x5c2520[_0xef8f('0x12')]&&_0x5c2520['body']['device']&&_0x5c2520[_0xef8f('0x12')][_0xef8f('0x13')]){_0x3c7cb9=_0xef8f('0x14');}return util[_0xef8f('0x7')](_0x3c7cb9,_0x5c2520[_0xef8f('0x15')],_0x5c2520['headers'][_0xef8f('0x16')]?_0x5c2520[_0xef8f('0x9')]['x-forwarded-for']:_0x5c2520['connection'][_0xef8f('0xa')]||_0x5c2520['ip'],_0x5c2520['url'],_0x157921[_0xef8f('0xc')],_0x157921['responseTime'],_0x5c2520['user']?_0x5c2520[_0xef8f('0xe')]['id']:null,_0x5c2520['user']?_0x5c2520[_0xef8f('0xe')]['name']:null,_0x5c2520[_0xef8f('0xe')]?_0x5c2520[_0xef8f('0xe')][_0xef8f('0xf')]:null,_0x5c2520[_0xef8f('0x12')]&&_0x5c2520[_0xef8f('0x12')][_0xef8f('0x17')]?_0x5c2520[_0xef8f('0x12')][_0xef8f('0x17')]:'other',_0x5c2520[_0xef8f('0x12')]&&_0x5c2520[_0xef8f('0x12')]['agent_id']?_0x5c2520[_0xef8f('0x12')][_0xef8f('0x13')]:'',_0x5c2520['body']&&_0x5c2520[_0xef8f('0x12')][_0xef8f('0x18')]?_0x5c2520[_0xef8f('0x12')][_0xef8f('0x18')]:'');},'ignoreRoute':function(_0x26282a){var _0xab706d=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0xab706d[_0xef8f('0x19')](_0x26282a[_0xef8f('0xb')]);}}));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x1a'),require(_0xef8f('0x1b')));_0x338ae8[_0xef8f('0x10')]('/api/voice/chanspy',require(_0xef8f('0x1c')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x1d'),require(_0xef8f('0x1e')));_0x338ae8['use']('/api/voice/extensions',require(_0xef8f('0x1f')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x20'),require(_0xef8f('0x21')));_0x338ae8['use'](_0xef8f('0x22'),require(_0xef8f('0x23')));_0x338ae8['use'](_0xef8f('0x24'),require('./api/voiceRecording'));_0x338ae8[_0xef8f('0x10')]('/api/screen/recordings',require(_0xef8f('0x25')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x26'),require(_0xef8f('0x27')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x28'),require(_0xef8f('0x29')));_0x338ae8[_0xef8f('0x10')]('/api/voice/calls/reports',require(_0xef8f('0x2a')));_0x338ae8['use'](_0xef8f('0x2b'),require('./api/voiceDialReport'));_0x338ae8[_0xef8f('0x10')]('/api/voice/agents/reports',require(_0xef8f('0x2c')));_0x338ae8[_0xef8f('0x10')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x338ae8['use'](_0xef8f('0x2d'),require(_0xef8f('0x2e')));_0x338ae8[_0xef8f('0x10')]('/api/trunks',require(_0xef8f('0x2f')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x30'),require(_0xef8f('0x31')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x32'),require('./api/mailServerOut'));_0x338ae8['use'](_0xef8f('0x33'),require(_0xef8f('0x34')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x35'),require('./api/mailQueue'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x36'),require(_0xef8f('0x37')));_0x338ae8[_0xef8f('0x10')]('/api/mail/interactions',require(_0xef8f('0x38')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x39'),require(_0xef8f('0x3a')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x3b'),require(_0xef8f('0x3c')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x3d'),require(_0xef8f('0x3e')));_0x338ae8['use'](_0xef8f('0x3f'),require('./api/dashboard'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x40'),require(_0xef8f('0x41')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x42'),require(_0xef8f('0x43')));_0x338ae8[_0xef8f('0x10')]('/api/fax/applications',require('./api/faxApplication'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x44'),require(_0xef8f('0x45')));_0x338ae8[_0xef8f('0x10')]('/api/fax/messages',require(_0xef8f('0x46')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x47'),require(_0xef8f('0x48')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x49'),require(_0xef8f('0x4a')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x4b'),require('./api/smsAccount'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x4c'),require(_0xef8f('0x4d')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x4e'),require('./api/smsInteraction'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x4f'),require('./api/smsMessage'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x50'),require(_0xef8f('0x51')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x52'),require(_0xef8f('0x53')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x54'),require('./api/openchannelApplication'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x55'),require(_0xef8f('0x56')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x57'),require(_0xef8f('0x58')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x59'),require(_0xef8f('0x5a')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x5b'),require(_0xef8f('0x5c')));_0x338ae8['use'](_0xef8f('0x5d'),require(_0xef8f('0x5e')));_0x338ae8['use'](_0xef8f('0x5f'),require('./api/chatApplication'));_0x338ae8[_0xef8f('0x10')]('/api/chat/interactions',require(_0xef8f('0x60')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x61'),require(_0xef8f('0x62')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x63'),require(_0xef8f('0x64')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x65'),require(_0xef8f('0x66')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x67'),require(_0xef8f('0x68')));_0x338ae8['use'](_0xef8f('0x69'),require('./api/chatProactiveAction'));_0x338ae8[_0xef8f('0x10')]('/api/cm/companies',require(_0xef8f('0x6a')));_0x338ae8['use'](_0xef8f('0x6b'),require('./api/cmContact'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x6c'),require('./api/cmHopper'));_0x338ae8[_0xef8f('0x10')]('/api/cm/hopper_black',require(_0xef8f('0x6d')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x6e'),require(_0xef8f('0x6f')));_0x338ae8[_0xef8f('0x10')]('/api/cm/hopper_history',require(_0xef8f('0x70')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x71'),require(_0xef8f('0x72')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x73'),require(_0xef8f('0x74')));_0x338ae8['use']('/api/automations',require('./api/automation'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x75'),require(_0xef8f('0x76')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x77'),require(_0xef8f('0x78')));_0x338ae8['use'](_0xef8f('0x79'),require(_0xef8f('0x7a')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x7b'),require('./api/interval'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x7c'),require(_0xef8f('0x7d')));_0x338ae8['use'](_0xef8f('0x7e'),require(_0xef8f('0x7f')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x80'),require(_0xef8f('0x81')));_0x338ae8['use'](_0xef8f('0x82'),require(_0xef8f('0x83')));_0x338ae8['use'](_0xef8f('0x84'),require(_0xef8f('0x85')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x86'),require('./api/tag'));_0x338ae8[_0xef8f('0x10')]('/api/templates',require(_0xef8f('0x87')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x88'),require('./api/trigger'));_0x338ae8[_0xef8f('0x10')]('/api/variables',require('./api/variable'));_0x338ae8['use'](_0xef8f('0x89'),require('./api/integration'));_0x338ae8['use'](_0xef8f('0x8a'),require(_0xef8f('0x8b')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x8c'),require(_0xef8f('0x8d')));_0x338ae8[_0xef8f('0x10')]('/api/analytics/default_reports',require(_0xef8f('0x8e')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x8f'),require(_0xef8f('0x90')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x91'),require(_0xef8f('0x92')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x93'),require(_0xef8f('0x94')));_0x338ae8['use'](_0xef8f('0x95'),require(_0xef8f('0x96')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x97'),require(_0xef8f('0x98')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x99'),require('./api/intSalesforceConfiguration'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x9a'),require(_0xef8f('0x9b')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x9c'),require(_0xef8f('0x9d')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0x9e'),require(_0xef8f('0x9f')));_0x338ae8[_0xef8f('0x10')]('/api/integrations/sugarcrm/fields',require(_0xef8f('0xa0')));_0x338ae8['use']('/api/integrations/desk/accounts',require(_0xef8f('0xa1')));_0x338ae8['use']('/api/integrations/desk/configurations',require(_0xef8f('0xa2')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xa3'),require(_0xef8f('0xa4')));_0x338ae8[_0xef8f('0x10')]('/api/integrations/zoho/accounts',require('./api/intZohoAccount'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xa5'),require(_0xef8f('0xa6')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xa7'),require('./api/intZohoField'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xa8'),require(_0xef8f('0xa9')));_0x338ae8[_0xef8f('0x10')]('/api/integrations/zendesk/configurations',require('./api/intZendeskConfiguration'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xaa'),require(_0xef8f('0xab')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xac'),require(_0xef8f('0xad')));_0x338ae8['use'](_0xef8f('0xae'),require(_0xef8f('0xaf')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xb0'),require(_0xef8f('0xb1')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xb2'),require(_0xef8f('0xb3')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xb4'),require('./api/intVtigerConfiguration'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xb5'),require(_0xef8f('0xb6')));_0x338ae8[_0xef8f('0x10')]('/api/integrations/servicenow/accounts',require(_0xef8f('0xb7')));_0x338ae8[_0xef8f('0x10')]('/api/integrations/servicenow/configurations',require(_0xef8f('0xb8')));_0x338ae8['use'](_0xef8f('0xb9'),require('./api/intServicenowField'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xba'),require(_0xef8f('0xbb')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xbc'),require(_0xef8f('0xbd')));_0x338ae8[_0xef8f('0x10')]('/api/integrations/dynamics365/fields',require('./api/intDynamics365Field'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xbe'),require(_0xef8f('0xbf')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xc0'),require(_0xef8f('0xc1')));_0x338ae8['use'](_0xef8f('0xc2'),require('./api/chatInternalMessage'));_0x338ae8['use'](_0xef8f('0xc3'),require(_0xef8f('0xc4')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xc5'),require(_0xef8f('0xc6')));_0x338ae8['use'](_0xef8f('0xc7'),require(_0xef8f('0xc8')));_0x338ae8[_0xef8f('0x10')]('/api/sms/reports/queue',require(_0xef8f('0xc9')));_0x338ae8[_0xef8f('0x10')]('/api/square/reports',require(_0xef8f('0xca')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xcb'),require(_0xef8f('0xcc')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xcd'),require('./api/jscriptyProject'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xce'),require('./api/setting'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xcf'),require('./api/squareOdbc'));_0x338ae8['use']('/api/square/projects',require(_0xef8f('0xd0')));_0x338ae8['use']('/api/square/recordings',require(_0xef8f('0xd1')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xd2'),require(_0xef8f('0xd3')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xd4'),require(_0xef8f('0xd5')));_0x338ae8['use']('/api/license',require(_0xef8f('0xd6')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xd7'),require(_0xef8f('0xd8')));_0x338ae8[_0xef8f('0x10')]('/api/migrations',require(_0xef8f('0xd9')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xda'),require(_0xef8f('0xdb')));_0x338ae8[_0xef8f('0x10')]('/api/plugins',require(_0xef8f('0xdc')));_0x338ae8[_0xef8f('0x10')]('/api/mail/reports/transfer',require('./api/mailTransferReport'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xdd'),require(_0xef8f('0xde')));_0x338ae8['use'](_0xef8f('0xdf'),require(_0xef8f('0xe0')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xe1'),require('./api/openchannelTransferReport'));_0x338ae8[_0xef8f('0x10')]('/api/sms/reports/transfer',require(_0xef8f('0xe2')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xe3'),require(_0xef8f('0xe4')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xe5'),require(_0xef8f('0xe6')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xe7'),require('./api/userProfile'));_0x338ae8['use'](_0xef8f('0xe8'),require('./api/userProfileSection'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xe9'),require(_0xef8f('0xea')));_0x338ae8[_0xef8f('0x10')]('/api/auth/local',require(_0xef8f('0xeb')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xec'),require(_0xef8f('0xed')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xee'),require('./api/jira'));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xef'),require(_0xef8f('0xf0')));_0x338ae8['use']('/api/version',require('./api/version'));_0x338ae8[_0xef8f('0x10')]('/api/system',require(_0xef8f('0xf1')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xf2'),require(_0xef8f('0xf3')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xf4'),express[_0xef8f('0xf5')](path[_0xef8f('0xf6')](config[_0xef8f('0xf7')],_0xef8f('0xf4'))));_0x338ae8['use'](_0xef8f('0xf8'),express[_0xef8f('0xf5')](path[_0xef8f('0xf6')](config[_0xef8f('0xf7')],_0xef8f('0xf8'))));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xf9'),express[_0xef8f('0xf5')](path[_0xef8f('0xf6')](config[_0xef8f('0xf7')],'/demo')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xfa'),express['static'](path[_0xef8f('0xf6')](config[_0xef8f('0xf7')],_0xef8f('0xfb'),'1.0.15')));_0x338ae8[_0xef8f('0x10')](_0xef8f('0xfc'),express['static'](path[_0xef8f('0xf6')](config[_0xef8f('0xf7')],'/server/files/plugins')));_0x338ae8[_0xef8f('0xfd')](_0xef8f('0xfe'))[_0xef8f('0xff')](errors[0x194]);_0x338ae8[_0xef8f('0xfd')]('/*')[_0xef8f('0xff')](function(_0x223286,_0x16d582){_0x16d582[_0xef8f('0x100')](path[_0xef8f('0x101')](_0x338ae8[_0xef8f('0xff')](_0xef8f('0x102'))+'/index.html'));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 76be1f8..0ec2271 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2bcc=['../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/campaign/campaign.rpc','../api/plugin/plugin.rpc','rpc','port','listen','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','RPC\x20listening\x20on\x20','lodash','../config/environment','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/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/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc'];(function(_0x39d81f,_0x3df0ba){var _0x1b80f0=function(_0x32171b){while(--_0x32171b){_0x39d81f['push'](_0x39d81f['shift']());}};_0x1b80f0(++_0x3df0ba);}(_0x2bcc,0x183));var _0xc2bc=function(_0x1f7255,_0x2ca49f){_0x1f7255=_0x1f7255-0x0;var _0x233a92=_0x2bcc[_0x1f7255];return _0x233a92;};'use strict';var jayson=require('jayson/promise');var BPromise=require('bluebird');var _=require(_0xc2bc('0x0'));var config=require(_0xc2bc('0x1'));exports['listen']=function(){return new BPromise(function(_0x39bc94,_0x4a3cc6){var _0x263408={};_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/user/user.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x3')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x4')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x5')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x6')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x7')));_0x263408=_['merge'](_0x263408,require('../api/voiceAgentReport/voiceAgentReport.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x8')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x9')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0xa')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0xb')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0xc')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0xd')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0xe')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0xf')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x10')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x11')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x12')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/faxInteraction/faxInteraction.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/faxMessage/faxMessage.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x13')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x14')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/smsInteraction/smsInteraction.rpc'));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x15')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x16')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x17')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x18')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x19')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x1a')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x1b')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x1c')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/chatMessage/chatMessage.rpc'));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x1d')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x1e')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x1f')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x20')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x21')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x22')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x23')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x24')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x25')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/template/template.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/trigger/trigger.rpc'));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x26')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x27')));_0x263408=_['merge'](_0x263408,require('../api/intSugarcrmAccount/intSugarcrmAccount.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x28')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x29')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x2a')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x2b')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x2c')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x2d')));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x2e')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x2f')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x30')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x31')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x32')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x33')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/squareRecording/squareRecording.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/squareMessage/squareMessage.rpc'));_0x263408=_[_0xc2bc('0x2')](_0x263408,require(_0xc2bc('0x34')));_0x263408=_[_0xc2bc('0x2')](_0x263408,require('../api/attachment/attachment.rpc'));_0x263408=_['merge'](_0x263408,require(_0xc2bc('0x35')));var _0x388249=jayson['server'](_0x263408)['http']();var _0x1a4a38=config[_0xc2bc('0x36')][_0xc2bc('0x37')]||config[_0xc2bc('0x37')]+0x1;var _0x1a8a88=config[_0xc2bc('0x36')]['ip']||'localhost';_0x388249['on']('error',function(_0x1af67f){return _0x4a3cc6(_0x1af67f);});_0x388249[_0xc2bc('0x38')](_0x1a4a38,_0x1a8a88,function(){console[_0xc2bc('0x39')](_0xc2bc('0x3a'),_0x1a8a88,_0x1a4a38);require(_0xc2bc('0x3b'))[_0xc2bc('0x3c')]();return _0x39bc94(_0xc2bc('0x3d')+_0x1a8a88+':'+_0x1a4a38);});});}; \ No newline at end of file +var _0xb6df=['http','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','default','jayson/promise','bluebird','../config/environment','listen','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailMessage/mailMessage.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc'];(function(_0x7e884c,_0x3f3cf5){var _0x130f3f=function(_0x3a2e45){while(--_0x3a2e45){_0x7e884c['push'](_0x7e884c['shift']());}};_0x130f3f(++_0x3f3cf5);}(_0xb6df,0x1bb));var _0xfb6d=function(_0xab144,_0xac5e94){_0xab144=_0xab144-0x0;var _0x4ec834=_0xb6df[_0xab144];return _0x4ec834;};'use strict';var jayson=require(_0xfb6d('0x0'));var BPromise=require(_0xfb6d('0x1'));var _=require('lodash');var config=require(_0xfb6d('0x2'));exports[_0xfb6d('0x3')]=function(){return new BPromise(function(_0x79f1e1,_0x22c477){var _0x1cc7fe={};_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/user/user.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x5')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x6')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x7')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x8')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x9')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0xa')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0xb')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0xc')));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0xd')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x1cc7fe=_['merge'](_0x1cc7fe,require('../api/userVoiceQueueRt/userVoiceQueueRt.rpc'));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0xe')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0xf')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/mailQueue/mailQueue.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/mailInteraction/mailInteraction.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x10')));_0x1cc7fe=_['merge'](_0x1cc7fe,require('../api/mailApplication/mailApplication.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x11')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x12')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x13')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x14')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x15')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x16')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x17')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x18')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x19')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/smsQueue/smsQueue.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x1a')));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x1b')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x1c')));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x1d')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x1e')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x1f')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x20')));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x21')));_0x1cc7fe=_['merge'](_0x1cc7fe,require('../api/cmContact/cmContact.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x22')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x23')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x24')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x25')));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x26')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/template/template.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x27')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x28')));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x29')));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x2a')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x2b')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x2c')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/intFreshdeskAccount/intFreshdeskAccount.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x2d')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x2e')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x2f')));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x30')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x31')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x32')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/squareProject/squareProject.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/squareRecording/squareRecording.rpc'));_0x1cc7fe=_['merge'](_0x1cc7fe,require(_0xfb6d('0x33')));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require(_0xfb6d('0x34')));_0x1cc7fe=_['merge'](_0x1cc7fe,require('../api/attachment/attachment.rpc'));_0x1cc7fe=_[_0xfb6d('0x4')](_0x1cc7fe,require('../api/plugin/plugin.rpc'));var _0x1f19e0=jayson['server'](_0x1cc7fe)[_0xfb6d('0x35')]();var _0x447dd6=config[_0xfb6d('0x36')][_0xfb6d('0x37')]||config[_0xfb6d('0x37')]+0x1;var _0xa22256=config['rpc']['ip']||_0xfb6d('0x38');_0x1f19e0['on'](_0xfb6d('0x39'),function(_0x55896a){return _0x22c477(_0x55896a);});_0x1f19e0[_0xfb6d('0x3')](_0x447dd6,_0xa22256,function(){console[_0xfb6d('0x3a')](_0xfb6d('0x3b'),_0xa22256,_0x447dd6);require(_0xfb6d('0x3c'))[_0xfb6d('0x3d')]();return _0x79f1e1('RPC\x20listening\x20on\x20'+_0xa22256+':'+_0x447dd6);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index 58223fc..daae2ed 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 _0xe218=['getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','EXEC\x20%s\x20%s','join','setContext','SET\x20EXTENSION\x20%s','setPriority','SET\x20PRIORITY\x20%s','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','SAY\x20NUMBER\x20%s\x20%s','SAY\x20DIGITS\x20%s\x20%s','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','setExtension','GOTO\x20%s\x20%s\x20%s','recordFile','wav','BEEP','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','util','lodash','events','EventEmitter','./reply','setEncoding','setTimeout','headers','emit','toLowerCase','hangup','substring','search','520\x20End\x20of\x20proper','function','no\x20code','replace','result=','indexOf','substr','startsWith','length','error','E_AGI_SOCKET_ERROR','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','command','write','inherits','prototype','sendRequest','answer','ANSWER'];(function(_0x5e21fe,_0x24b2cf){var _0x4651d4=function(_0x1ecb4b){while(--_0x1ecb4b){_0x5e21fe['push'](_0x5e21fe['shift']());}};_0x4651d4(++_0x24b2cf);}(_0xe218,0x185));var _0x8e21=function(_0x553621,_0x18ff21){_0x553621=_0x553621-0x0;var _0x30d42f=_0xe218[_0x553621];return _0x30d42f;};'use strict';var util=require(_0x8e21('0x0'));var _=require(_0x8e21('0x1'));var EventEmitter=require(_0x8e21('0x2'))[_0x8e21('0x3')];var AGIReply=require(_0x8e21('0x4'));var AGIError=require('./error');function AGIChannel(_0x275913){var _0x1dd27a=this,_0x1585e9=new AGIReply(),_0x55e908=![],_0x538342={};EventEmitter['call'](_0x1dd27a);_0x275913[_0x8e21('0x5')]('utf8');_0x275913[_0x8e21('0x6')](0x8*0x3c*0x3c*0x3e8);_0x1585e9['setEncoding']('utf8');_0x1585e9['on'](_0x8e21('0x7'),function(_0x17ec6d){for(var _0x10d72f in _0x17ec6d){_0x1dd27a[_0x10d72f]=_0x17ec6d[_0x10d72f];}_0x1dd27a[_0x8e21('0x8')]('ready');});_0x1585e9['on']('line',function(_0x428ae0){if(_0x428ae0[_0x8e21('0x9')]()==_0x8e21('0xa')){_0x1dd27a['emit']('hangup');return;}if(_0x428ae0[_0x8e21('0xb')](0x0,0xb)=='520-Invalid'){_0x55e908=!![];}if(_0x55e908){_0x538342['rx']+=_0x428ae0+'\x0a';if(_0x428ae0[_0x8e21('0xc')](_0x8e21('0xd'))!=-0x1){_0x55e908=![];}}else{_0x538342['rx']=_0x428ae0;}if(_0x55e908){return;}if(typeof _0x538342['cb']==_0x8e21('0xe')){var _0x34a73b=_0x538342['rx']['substring'](0x0,0x3),_0x3c4630=null,_0x1b03d4=null;_0x34a73b=parseInt(_0x34a73b);if(isNaN(_0x34a73b)){_0x538342['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x8e21('0xf')});return;}if(_0x34a73b!=0xc8){_0x538342['cb'](null,{'code':_0x34a73b,'result':-0x1,'extra':'KO'});return;}_0x3c4630=_0x538342['rx'][_0x8e21('0xb')](0x4)[_0x8e21('0x10')](_0x8e21('0x11'),'');if(_0x3c4630[_0x8e21('0x12')]('\x20')!=-0x1){_0x3c4630=_0x3c4630[_0x8e21('0x13')](0x0,_0x3c4630[_0x8e21('0x12')]('\x20'));}if(_[_0x8e21('0x14')](_0x3c4630,'-1')){_0x3c4630=parseInt(_0x3c4630);}_0x1b03d4=_0x538342['rx']['split']('\x20');if(_0x1b03d4[_0x8e21('0x15')]==0x3){_0x1b03d4=_0x1b03d4[0x2][_0x8e21('0xb')](0x1,_0x1b03d4[0x2][_0x8e21('0x15')]-0x1);}else if(_0x1b03d4[_0x8e21('0x15')]>0x3){var _0x4dda04=/\((.+)\)/;var _0x1d7879=_0x538342['rx']['match'](_0x4dda04);if(_0x1d7879){_0x1b03d4=_0x1d7879[0x1];}else{_0x1b03d4=null;}}else{_0x1b03d4=null;}_0x538342['cb'](null,{'code':_0x34a73b,'result':_0x3c4630,'extra':_0x1b03d4});}});_0x275913['on'](_0x8e21('0x16'),function(_0x2cfd48){_0x1dd27a['emit'](_0x8e21('0x16'),new AGIError(_0x8e21('0x17'),_0x2cfd48['code']));});_0x275913['on'](_0x8e21('0x18'),function(){_0x1dd27a[_0x8e21('0x8')](_0x8e21('0x18'),new AGIError(_0x8e21('0x19')));});_0x275913['on'](_0x8e21('0x1a'),function(){_0x1dd27a[_0x8e21('0x8')](_0x8e21('0x1a'),new AGIError(_0x8e21('0x1b')));_0x275913[_0x8e21('0x1c')]();});_0x275913[_0x8e21('0x1d')](_0x1585e9);this[_0x8e21('0x1e')]=function(_0x4d0d64,_0x1c286){var _0x4d0d64=_0x4d0d64||'',_0x1c286=typeof _0x1c286==_0x8e21('0xe')?_0x1c286:new Function();_0x538342={'tx':_0x4d0d64,'rx':'','cb':_0x1c286};_0x275913[_0x8e21('0x1f')](_0x4d0d64+'\x0a');},this[_0x8e21('0x18')]=function(){_0x275913[_0x8e21('0x1c')]();};}util[_0x8e21('0x20')](AGIChannel,EventEmitter);AGIChannel[_0x8e21('0x21')][_0x8e21('0x22')]=function(_0x2d31f7){return this['command']['sync'](this,_0x2d31f7);};AGIChannel[_0x8e21('0x21')][_0x8e21('0x23')]=function(){return this[_0x8e21('0x22')](_0x8e21('0x24'));};AGIChannel[_0x8e21('0x21')][_0x8e21('0x25')]=function(_0x253893,_0x4ce8eb,_0x1d8f8d){_0x253893=_0x253893===undefined?_0x8e21('0x26'):_0x253893;_0x4ce8eb=_0x4ce8eb===undefined?'5':_0x4ce8eb;_0x1d8f8d=_0x1d8f8d===undefined?'1':_0x1d8f8d;return this[_0x8e21('0x22')](util[_0x8e21('0x27')](_0x8e21('0x28'),_0x253893,_0x4ce8eb*0x3e8,_0x1d8f8d));};AGIChannel[_0x8e21('0x21')][_0x8e21('0x29')]=function(_0x48c61a){_0x48c61a=_0x48c61a||'NO\x20MESSAGE';return this['sendRequest'](util['format'](_0x8e21('0x2a'),_0x48c61a));};AGIChannel[_0x8e21('0x21')][_0x8e21('0x2b')]=function(_0x4326d4,_0xf6602){if(_[_0x8e21('0x2c')](_0xf6602)){return this[_0x8e21('0x22')](util['format'](_0x8e21('0x2d'),_0x4326d4,_0xf6602[_0x8e21('0x2e')](',')));}return this['sendRequest'](util[_0x8e21('0x27')](_0x8e21('0x2d'),_0x4326d4,_0xf6602));};AGIChannel['prototype'][_0x8e21('0x2f')]=function(_0x5a9aa8){return this[_0x8e21('0x22')](util[_0x8e21('0x27')]('SET\x20CONTEXT\x20%s',_0x5a9aa8));};AGIChannel[_0x8e21('0x21')]['setExtension']=function(_0x571c4f){return this[_0x8e21('0x22')](util[_0x8e21('0x27')](_0x8e21('0x30'),_0x571c4f));};AGIChannel[_0x8e21('0x21')][_0x8e21('0x31')]=function(_0x7de7e5){return this[_0x8e21('0x22')](util['format'](_0x8e21('0x32'),_0x7de7e5));};AGIChannel['prototype'][_0x8e21('0xa')]=function(){return this[_0x8e21('0x22')]('HANGUP');};AGIChannel[_0x8e21('0x21')][_0x8e21('0x33')]=function(_0x44cc58,_0x4b8fde){return this[_0x8e21('0x22')](util[_0x8e21('0x27')](_0x8e21('0x34'),_0x44cc58,_0x4b8fde?_0x4b8fde[_0x8e21('0x35')]()[_0x8e21('0x10')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype']['sayNumber']=function(_0x226e7f,_0x409d38){return this[_0x8e21('0x22')](util[_0x8e21('0x27')](_0x8e21('0x36'),_0x226e7f,_0x409d38));};AGIChannel['prototype']['sayDigits']=function(_0x2abb4f,_0x23a1e6){return this['sendRequest'](util[_0x8e21('0x27')](_0x8e21('0x37'),_0x2abb4f,_0x23a1e6));};AGIChannel[_0x8e21('0x21')]['sayPhonetic']=function(_0x570349,_0xf022ba){return this[_0x8e21('0x22')](util[_0x8e21('0x27')](_0x8e21('0x38'),_0x570349,_0xf022ba));};AGIChannel['prototype']['continueAt']=function(_0x396cfb,_0x2d1d25,_0x3363e8){_0x2d1d25=_0x2d1d25||this[_0x8e21('0x39')];_0x3363e8=_0x3363e8||0x1;this[_0x8e21('0x2f')](_0x396cfb);this[_0x8e21('0x3a')](_0x2d1d25);this[_0x8e21('0x31')](_0x3363e8);return this['noop'](util[_0x8e21('0x27')](_0x8e21('0x3b'),_0x396cfb,_0x2d1d25,_0x3363e8));};AGIChannel[_0x8e21('0x21')]['getVariable']=function(_0x4bac85){return this[_0x8e21('0x22')](util[_0x8e21('0x27')]('GET\x20VARIABLE\x20\x22%s\x22',_0x4bac85));};AGIChannel[_0x8e21('0x21')][_0x8e21('0x3c')]=function(_0x2579da,_0x54df51,_0x361f6d,_0xc94ed9,_0x250c00,_0x5438da){_0x54df51=_0x54df51||_0x8e21('0x3d');_0x361f6d=_0x361f6d||'';_0xc94ed9=_0xc94ed9===undefined?-0x1:_0xc94ed9==='-1'?-0x1:_0xc94ed9*0x3e8;_0x250c00=_0x250c00===undefined?'':'s='+_0x250c00;_0x5438da=_0x5438da?_0x8e21('0x3e'):'';return this[_0x8e21('0x22')](util[_0x8e21('0x27')](_0x8e21('0x3f'),_0x2579da,_0x54df51,_0x361f6d,_0xc94ed9,_0x5438da,_0x250c00));};AGIChannel[_0x8e21('0x21')]['streamFile']=function(_0x3918d4,_0x32d213){_0x32d213=_0x32d213||'';return this['sendRequest'](util[_0x8e21('0x27')](_0x8e21('0x40'),_0x3918d4,_0x32d213));};AGIChannel[_0x8e21('0x21')][_0x8e21('0x41')]=function(_0xceb8c3){return this[_0x8e21('0x2b')](_0x8e21('0x42'),_0xceb8c3);};AGIChannel[_0x8e21('0x21')][_0x8e21('0x43')]=function(_0x4f4fae){return this[_0x8e21('0x2b')](_0x8e21('0x44'),_0x4f4fae);};AGIChannel[_0x8e21('0x21')]['error']=function(_0x420ed9,_0x3a713d){this[_0x8e21('0x29')](util[_0x8e21('0x27')](_0x8e21('0x45'),_0x420ed9['id'],_0x420ed9[_0x8e21('0x46')],_0x3a713d));return{'code':0x1f4,'result':'-1','extra':''};};module['exports']=AGIChannel; \ No newline at end of file +var _0x9818=['toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','continueAt','GOTO\x20%s\x20%s\x20%s','getVariable','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','AGI','WAIT','label','exports','util','lodash','events','EventEmitter','./error','setEncoding','utf8','headers','ready','line','toLowerCase','hangup','emit','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','replace','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','inherits','prototype','command','sync','answer','sendRequest','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','VERBOSE\x20\x22%s\x22','exec','isArray','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20EXTENSION\x20%s','setPriority'];(function(_0x1a108f,_0x4ddf12){var _0x1293a4=function(_0x4a3a88){while(--_0x4a3a88){_0x1a108f['push'](_0x1a108f['shift']());}};_0x1293a4(++_0x4ddf12);}(_0x9818,0x1b7));var _0x8981=function(_0x42d528,_0x2b5e70){_0x42d528=_0x42d528-0x0;var _0x2271cf=_0x9818[_0x42d528];return _0x2271cf;};'use strict';var util=require(_0x8981('0x0'));var _=require(_0x8981('0x1'));var EventEmitter=require(_0x8981('0x2'))[_0x8981('0x3')];var AGIReply=require('./reply');var AGIError=require(_0x8981('0x4'));function AGIChannel(_0x4c9f2a){var _0xb4cf83=this,_0x3697d9=new AGIReply(),_0x1830f6=![],_0x46270a={};EventEmitter['call'](_0xb4cf83);_0x4c9f2a[_0x8981('0x5')](_0x8981('0x6'));_0x4c9f2a['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x3697d9['setEncoding'](_0x8981('0x6'));_0x3697d9['on'](_0x8981('0x7'),function(_0x55fa83){for(var _0x4eac2a in _0x55fa83){_0xb4cf83[_0x4eac2a]=_0x55fa83[_0x4eac2a];}_0xb4cf83['emit'](_0x8981('0x8'));});_0x3697d9['on'](_0x8981('0x9'),function(_0x24b658){if(_0x24b658[_0x8981('0xa')]()==_0x8981('0xb')){_0xb4cf83[_0x8981('0xc')](_0x8981('0xb'));return;}if(_0x24b658[_0x8981('0xd')](0x0,0xb)==_0x8981('0xe')){_0x1830f6=!![];}if(_0x1830f6){_0x46270a['rx']+=_0x24b658+'\x0a';if(_0x24b658[_0x8981('0xf')](_0x8981('0x10'))!=-0x1){_0x1830f6=![];}}else{_0x46270a['rx']=_0x24b658;}if(_0x1830f6){return;}if(typeof _0x46270a['cb']==_0x8981('0x11')){var _0x4a0466=_0x46270a['rx'][_0x8981('0xd')](0x0,0x3),_0x5d6ad2=null,_0xfba44f=null;_0x4a0466=parseInt(_0x4a0466);if(isNaN(_0x4a0466)){_0x46270a['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x4a0466!=0xc8){_0x46270a['cb'](null,{'code':_0x4a0466,'result':-0x1,'extra':'KO'});return;}_0x5d6ad2=_0x46270a['rx']['substring'](0x4)[_0x8981('0x12')]('result=','');if(_0x5d6ad2['indexOf']('\x20')!=-0x1){_0x5d6ad2=_0x5d6ad2['substr'](0x0,_0x5d6ad2['indexOf']('\x20'));}if(_[_0x8981('0x13')](_0x5d6ad2,'-1')){_0x5d6ad2=parseInt(_0x5d6ad2);}_0xfba44f=_0x46270a['rx'][_0x8981('0x14')]('\x20');if(_0xfba44f[_0x8981('0x15')]==0x3){_0xfba44f=_0xfba44f[0x2][_0x8981('0xd')](0x1,_0xfba44f[0x2][_0x8981('0x15')]-0x1);}else if(_0xfba44f[_0x8981('0x15')]>0x3){var _0x2f07b4=/\((.+)\)/;var _0xf7062f=_0x46270a['rx'][_0x8981('0x16')](_0x2f07b4);if(_0xf7062f){_0xfba44f=_0xf7062f[0x1];}else{_0xfba44f=null;}}else{_0xfba44f=null;}_0x46270a['cb'](null,{'code':_0x4a0466,'result':_0x5d6ad2,'extra':_0xfba44f});}});_0x4c9f2a['on'](_0x8981('0x17'),function(_0xcb4b9f){_0xb4cf83[_0x8981('0xc')]('error',new AGIError(_0x8981('0x18'),_0xcb4b9f[_0x8981('0x19')]));});_0x4c9f2a['on']('close',function(){_0xb4cf83[_0x8981('0xc')](_0x8981('0x1a'),new AGIError('E_AGI_SOCKET_CLOSE'));});_0x4c9f2a['on'](_0x8981('0x1b'),function(){_0xb4cf83[_0x8981('0xc')](_0x8981('0x1b'),new AGIError(_0x8981('0x1c')));_0x4c9f2a[_0x8981('0x1d')]();});_0x4c9f2a[_0x8981('0x1e')](_0x3697d9);this['command']=function(_0x412c7b,_0x15986c){var _0x412c7b=_0x412c7b||'',_0x15986c=typeof _0x15986c=='function'?_0x15986c:new Function();_0x46270a={'tx':_0x412c7b,'rx':'','cb':_0x15986c};_0x4c9f2a['write'](_0x412c7b+'\x0a');},this[_0x8981('0x1a')]=function(){_0x4c9f2a[_0x8981('0x1d')]();};}util[_0x8981('0x1f')](AGIChannel,EventEmitter);AGIChannel[_0x8981('0x20')]['sendRequest']=function(_0x462c64){return this[_0x8981('0x21')][_0x8981('0x22')](this,_0x462c64);};AGIChannel[_0x8981('0x20')][_0x8981('0x23')]=function(){return this[_0x8981('0x24')](_0x8981('0x25'));};AGIChannel[_0x8981('0x20')][_0x8981('0x26')]=function(_0x162e1f,_0x1e1064,_0x752b8b){_0x162e1f=_0x162e1f===undefined?_0x8981('0x27'):_0x162e1f;_0x1e1064=_0x1e1064===undefined?'5':_0x1e1064;_0x752b8b=_0x752b8b===undefined?'1':_0x752b8b;return this['sendRequest'](util[_0x8981('0x28')](_0x8981('0x29'),_0x162e1f,_0x1e1064*0x3e8,_0x752b8b));};AGIChannel[_0x8981('0x20')][_0x8981('0x2a')]=function(_0x24114d){_0x24114d=_0x24114d||'NO\x20MESSAGE';return this[_0x8981('0x24')](util[_0x8981('0x28')](_0x8981('0x2b'),_0x24114d));};AGIChannel[_0x8981('0x20')][_0x8981('0x2c')]=function(_0x4e3b9c,_0x1e1982){if(_[_0x8981('0x2d')](_0x1e1982)){return this[_0x8981('0x24')](util[_0x8981('0x28')]('EXEC\x20%s\x20%s',_0x4e3b9c,_0x1e1982[_0x8981('0x2e')](',')));}return this[_0x8981('0x24')](util[_0x8981('0x28')]('EXEC\x20%s\x20%s',_0x4e3b9c,_0x1e1982));};AGIChannel[_0x8981('0x20')]['setContext']=function(_0x292793){return this[_0x8981('0x24')](util[_0x8981('0x28')](_0x8981('0x2f'),_0x292793));};AGIChannel['prototype'][_0x8981('0x30')]=function(_0x1a620c){return this[_0x8981('0x24')](util[_0x8981('0x28')](_0x8981('0x31'),_0x1a620c));};AGIChannel[_0x8981('0x20')][_0x8981('0x32')]=function(_0x2634cb){return this[_0x8981('0x24')](util['format']('SET\x20PRIORITY\x20%s',_0x2634cb));};AGIChannel[_0x8981('0x20')][_0x8981('0xb')]=function(){return this[_0x8981('0x24')]('HANGUP');};AGIChannel[_0x8981('0x20')]['setVariable']=function(_0x3c8867,_0x3777fd){return this[_0x8981('0x24')](util[_0x8981('0x28')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x3c8867,_0x3777fd?_0x3777fd[_0x8981('0x33')]()[_0x8981('0x12')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x8981('0x20')][_0x8981('0x34')]=function(_0x391b22,_0x54d297){return this['sendRequest'](util[_0x8981('0x28')](_0x8981('0x35'),_0x391b22,_0x54d297));};AGIChannel['prototype'][_0x8981('0x36')]=function(_0x5a2902,_0x4354de){return this[_0x8981('0x24')](util[_0x8981('0x28')]('SAY\x20DIGITS\x20%s\x20%s',_0x5a2902,_0x4354de));};AGIChannel[_0x8981('0x20')][_0x8981('0x37')]=function(_0x35a596,_0x186670){return this['sendRequest'](util['format']('SAY\x20PHONETIC\x20\x22%s\x22\x20%s',_0x35a596,_0x186670));};AGIChannel[_0x8981('0x20')][_0x8981('0x38')]=function(_0xb43d5e,_0x41a7d0,_0x221f11){_0x41a7d0=_0x41a7d0||this['extension'];_0x221f11=_0x221f11||0x1;this['setContext'](_0xb43d5e);this[_0x8981('0x30')](_0x41a7d0);this['setPriority'](_0x221f11);return this[_0x8981('0x2a')](util[_0x8981('0x28')](_0x8981('0x39'),_0xb43d5e,_0x41a7d0,_0x221f11));};AGIChannel['prototype'][_0x8981('0x3a')]=function(_0x3e4389){return this[_0x8981('0x24')](util[_0x8981('0x28')](_0x8981('0x3b'),_0x3e4389));};AGIChannel[_0x8981('0x20')][_0x8981('0x3c')]=function(_0x793633,_0x1e0676,_0x29df9b,_0xbabfa4,_0x3b458b,_0x3b6a1d){_0x1e0676=_0x1e0676||_0x8981('0x3d');_0x29df9b=_0x29df9b||'';_0xbabfa4=_0xbabfa4===undefined?-0x1:_0xbabfa4==='-1'?-0x1:_0xbabfa4*0x3e8;_0x3b458b=_0x3b458b===undefined?'':'s='+_0x3b458b;_0x3b6a1d=_0x3b6a1d?'BEEP':'';return this[_0x8981('0x24')](util[_0x8981('0x28')](_0x8981('0x3e'),_0x793633,_0x1e0676,_0x29df9b,_0xbabfa4,_0x3b6a1d,_0x3b458b));};AGIChannel['prototype'][_0x8981('0x3f')]=function(_0x2f9f19,_0x23b48e){_0x23b48e=_0x23b48e||'';return this[_0x8981('0x24')](util[_0x8981('0x28')](_0x8981('0x40'),_0x2f9f19,_0x23b48e));};AGIChannel[_0x8981('0x20')][_0x8981('0x41')]=function(_0xd4fb2b){return this[_0x8981('0x2c')](_0x8981('0x42'),_0xd4fb2b);};AGIChannel['prototype']['wait']=function(_0x3930fe){return this[_0x8981('0x2c')](_0x8981('0x43'),_0x3930fe);};AGIChannel[_0x8981('0x20')][_0x8981('0x17')]=function(_0x45196d,_0x10b3ac){this[_0x8981('0x2a')](util[_0x8981('0x28')]('ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s',_0x45196d['id'],_0x45196d[_0x8981('0x44')],_0x10b3ac));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x8981('0x45')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7586f30..0786854 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 _0x89b2=['[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','push','format','apply','message','name','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.'];(function(_0x185ae5,_0x44a620){var _0x359d86=function(_0x39d519){while(--_0x39d519){_0x185ae5['push'](_0x185ae5['shift']());}};_0x359d86(++_0x44a620);}(_0x89b2,0xc6));var _0x289b=function(_0x5d3550,_0x107033){_0x5d3550=_0x5d3550-0x0;var _0x5d1299=_0x89b2[_0x5d3550];return _0x5d1299;};'use strict';var util=require(_0x289b('0x0'));var error={'E_AGI_UNDEFINED':_0x289b('0x1'),'E_AGI_ARGUMENT_PORT':_0x289b('0x2'),'E_AGI_SERVER_ERROR':_0x289b('0x3'),'E_AGI_SERVER_CLOSE':_0x289b('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x289b('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x289b('0x6'),'E_AGI_SOCKET_ERROR':_0x289b('0x7'),'E_AGI_SOCKET_CLOSE':_0x289b('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x289b('0x9'),'E_AGI_COMMAND_EMPTY':_0x289b('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x289b('0xb'),'E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x1f7062){var _0x1f7062=_0x1f7062||null,_0x4dd1de=_0x4dd1de||[],_0x2376f0=0x1,_0x4ab7ba='';if(!error[_0x1f7062]){_0x1f7062='E_AGI_UNDEFINED';}_0x4dd1de['push'](error[_0x1f7062]);while(arguments[_0x2376f0]){_0x4dd1de[_0x289b('0xc')](arguments[_0x2376f0]);_0x2376f0++;}_0x4ab7ba=util[_0x289b('0xd')][_0x289b('0xe')](util,_0x4dd1de);this[_0x289b('0xf')]=_0x4ab7ba;this[_0x289b('0x10')]=_0x1f7062;}module['exports']=AGIError; \ No newline at end of file +var _0x367c=['format','apply','name','exports','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[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(_0xd7db9c,_0x3db320){var _0x1f68f7=function(_0x45a17f){while(--_0x45a17f){_0xd7db9c['push'](_0xd7db9c['shift']());}};_0x1f68f7(++_0x3db320);}(_0x367c,0x1b4));var _0xc367=function(_0x569caa,_0x5174ce){_0x569caa=_0x569caa-0x0;var _0x44cb5a=_0x367c[_0x569caa];return _0x44cb5a;};'use strict';var util=require('util');var error={'E_AGI_UNDEFINED':_0xc367('0x0'),'E_AGI_ARGUMENT_PORT':_0xc367('0x1'),'E_AGI_SERVER_ERROR':_0xc367('0x2'),'E_AGI_SERVER_CLOSE':_0xc367('0x3'),'E_AGI_SERVER_MAXCONNECTION':_0xc367('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0xc367('0x5'),'E_AGI_SOCKET_ERROR':_0xc367('0x6'),'E_AGI_SOCKET_CLOSE':_0xc367('0x7'),'E_AGI_SOCKET_TIMEOUT':_0xc367('0x8'),'E_AGI_COMMAND_EMPTY':_0xc367('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0xc367('0xa'),'E_AGI_IVR_ENTRY':_0xc367('0xb')};function AGIError(_0x4f8967){var _0x4f8967=_0x4f8967||null,_0x422a99=_0x422a99||[],_0x42c2d2=0x1,_0x18abbd='';if(!error[_0x4f8967]){_0x4f8967=_0xc367('0xc');}_0x422a99[_0xc367('0xd')](error[_0x4f8967]);while(arguments[_0x42c2d2]){_0x422a99[_0xc367('0xd')](arguments[_0x42c2d2]);_0x42c2d2++;}_0x18abbd=util[_0xc367('0xe')][_0xc367('0xf')](util,_0x422a99);this['message']=_0x18abbd;this[_0xc367('0x10')]=_0x4f8967;}module[_0xc367('0x11')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 2e30ae6..edf87da 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 _0x6017=['vswitch','target','menu','invalid','includes','max\x20retry\x20reach','lodash','../../../config/logger','agi','getdigits','getsecretdigits','edges','prototype','vertices','addEdge','push','numberOfEdges','size','relations','getVertex','traverseBFS','info','stop\x20traverse','length','no\x20edge/s\x20available','condition','split','agicommand'];(function(_0x47a768,_0x3357cc){var _0x5d756d=function(_0x3d89b4){while(--_0x3d89b4){_0x47a768['push'](_0x47a768['shift']());}};_0x5d756d(++_0x3357cc);}(_0x6017,0xae));var _0x7601=function(_0x1a76a7,_0x4e7dba){_0x1a76a7=_0x1a76a7-0x0;var _0x104c1e=_0x6017[_0x1a76a7];return _0x104c1e;};'use strict';var _=require(_0x7601('0x0'));var logger=require(_0x7601('0x1'))(_0x7601('0x2'));var verticesWithRetry=['menu',_0x7601('0x3'),_0x7601('0x4')];var Graph=function(){this['vertices']={};this[_0x7601('0x5')]={};this['numberOfEdges']=0x0;};Graph[_0x7601('0x6')]['addVertex']=function(_0x5080a3){this[_0x7601('0x7')][_0x5080a3['id']]=_0x5080a3;this[_0x7601('0x5')][_0x5080a3['id']]=[];};Graph[_0x7601('0x6')][_0x7601('0x8')]=function(_0x2bc643,_0xe6e524,_0x4ff3e4){this[_0x7601('0x5')][_0x2bc643][_0x7601('0x9')]({'target':_0xe6e524,'condition':_0x4ff3e4});this[_0x7601('0xa')]+=0x1;};Graph['prototype'][_0x7601('0xb')]=function(){return _[_0x7601('0xb')](this[_0x7601('0x7')]);};Graph['prototype'][_0x7601('0xc')]=function(){return this[_0x7601('0xa')];};Graph[_0x7601('0x6')][_0x7601('0xd')]=function(_0x33658f){return this[_0x7601('0x7')][_0x33658f];};Graph[_0x7601('0x6')][_0x7601('0xe')]=function(_0x2f5dbf,_0x40fc89){if(!this['vertices'][_0x2f5dbf]){return logger[_0x7601('0xf')]('no\x20vertex\x20found');}var _0x4be36a=_0x40fc89(this[_0x7601('0x7')][_0x2f5dbf]);if(!_0x4be36a){return logger[_0x7601('0xf')](_0x7601('0x10'));}if(this[_0x7601('0x5')][_0x2f5dbf][_0x7601('0x11')]===0x0){return logger[_0x7601('0xf')](_0x7601('0x12'));}for(var _0xdfb58a=0x0,_0x5e99b9=[],_0xa0e556=![];_0xdfb58a\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','dnid','uniqueid','info','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','createSquareReport','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','evtHangup','hangup','production','start','root','joinAt','YYYY-MM-DD\x20HH:mm:ss','traverseBFS','clear','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','code','response','isUndefined','result','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','getLicense','then','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','catch','connection','xml2json','syncho','util','moment','../../config/logger'];(function(_0xba26c0,_0x419725){var _0x22dcb1=function(_0x43e4dd){while(--_0x43e4dd){_0xba26c0['push'](_0xba26c0['shift']());}};_0x22dcb1(++_0x419725);}(_0xbeea,0xb1));var _0xabee=function(_0x153e55,_0x2b8d63){_0x153e55=_0x153e55-0x0;var _0x2b6813=_0xbeea[_0x153e55];return _0x2b6813;};'use strict';var parser=require(_0xabee('0x0'));var _=require('lodash');var syncho=require(_0xabee('0x1'));var util=require(_0xabee('0x2'));var moment=require(_0xabee('0x3'));var config=require('../../config/environment');var logger=require(_0xabee('0x4'))('agi');var utilLicense=require(_0xabee('0x5'));var rpc=require(_0xabee('0x6'));var mailRpc=require(_0xabee('0x7'));var Graph=require(_0xabee('0x8'));var Vertices=require(_0xabee('0x9'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_['defaults'](config[_0xabee('0xa')],{'ip':_0xabee('0xb'),'port':0x11dd});function connectionHandler(_0x4a2999){process[_0xabee('0xc')](function(){syncho(function(){try{setChannelVariables(_0x4a2999);agiHandler(_0x4a2999);}catch(_0x507deb){logger[_0xabee('0xd')](_0x507deb[_0xabee('0xe')]);}});});}function listeningHandler(){console[_0xabee('0xf')](_0xabee('0x10'),config[_0xabee('0xa')][_0xabee('0x11')]);logger['info'](util[_0xabee('0x12')](_0xabee('0x13'),config[_0xabee('0xa')]['ip'],config['agi'][_0xabee('0x11')]));}function errorHandler(_0x168202){if(_0x168202&&_0x168202[_0xabee('0x14')]&&_0x168202['message']){logger['error'](util['format']('[%s]\x20%s',_0x168202['name'],_0x168202[_0xabee('0x15')]));}else{logger[_0xabee('0xd')](util[_0xabee('0x12')](_0xabee('0x16'),_0x168202[_0xabee('0xe')]));}}function closeHandler(){logger['info'](util[_0xabee('0x12')](_0xabee('0x17'),this[_0xabee('0x18')],this[_0xabee('0x19')],this[_0xabee('0x1a')],this[_0xabee('0x1b')],this[_0xabee('0x1c')]));try{createSquareReport(this);}catch(_0x5a9562){logger[_0xabee('0xd')](_0x5a9562[_0xabee('0xe')]);}}function timeoutHandler(){logger[_0xabee('0x1d')](util[_0xabee('0x12')](_0xabee('0x1e'),this[_0xabee('0x18')],this['calleridname'],this['callerid'],this[_0xabee('0x1b')],this['uniqueid']));}function hangupHandler(){logger['info'](util[_0xabee('0x12')](_0xabee('0x1f'),this[_0xabee('0x18')],this[_0xabee('0x19')],this[_0xabee('0x1a')],this['dnid'],this[_0xabee('0x1c')]));this['evtHangup']=!![];}function getRoot(_0x4f5501){return parser['toJson'](_0x4f5501,{'object':!![]})[_0xabee('0x20')]['root'];}function addVertex(_0x870569,_0x2834e3,_0x520bc){_0x2834e3[_0xabee('0x21')]=_0x520bc;if(_0x2834e3[_0xabee('0x22')](_0xabee('0x23'))){_0x2834e3[_0xabee('0x24')]=parseInt(_0x2834e3['retry'],0xa);}_0x870569[_0xabee('0x25')](_[_0xabee('0x26')](_0x2834e3,_0xabee('0x27')));}function initGraph(_0x21e4fd,_0x4ae65e){var _0x2aa470=new Graph();for(var _0x123d58 in _0x21e4fd){if(_0x21e4fd['hasOwnProperty'](_0x123d58)){if(_[_0xabee('0x28')](_0x21e4fd[_0x123d58])){for(var _0x232144=0x0;_0x232144<_0x21e4fd[_0x123d58][_0xabee('0x29')];_0x232144+=0x1){addVertex(_0x2aa470,_0x21e4fd[_0x123d58][_0x232144],_0x123d58);}}else{addVertex(_0x2aa470,_0x21e4fd[_0x123d58],_0x123d58);}}}for(var _0x26a5d1=0x0;_0x26a5d1<_0x4ae65e['length'];_0x26a5d1+=0x1){if(_0x4ae65e[_0x26a5d1][_0xabee('0x2a')]&&_0x4ae65e[_0x26a5d1][_0xabee('0x2b')]){_0x2aa470[_0xabee('0x2c')](_0x4ae65e[_0x26a5d1][_0xabee('0x2a')],_0x4ae65e[_0x26a5d1][_0xabee('0x2b')],_0x4ae65e[_0x26a5d1][_0xabee('0x2d')]);}}return _0x2aa470;}function getSquareProject(_0x3df00d,_0x42368d){rpc[_0xabee('0x2e')](_0x3df00d)['then'](function(_0x2a2441){_0x42368d(null,_0x2a2441);})['catch'](function(_0x1afe17){_0x42368d(null,_0x1afe17);});}function createSquareReport(_0x1ebc01,_0xe0b7bd){rpc[_0xabee('0x2f')](_0x1ebc01)['then'](function(_0x297180){if(_0xe0b7bd){_0xe0b7bd(null,_0x297180);}})['catch'](function(_0x4098ec){if(_0xe0b7bd){_0xe0b7bd(null,_0x4098ec);}});}function setChannelVariables(_0x525e85){for(var _0x123a34 in _0x525e85){if(_0x525e85['hasOwnProperty'](_0x123a34)){if(_0x123a34['indexOf'](_0xabee('0x30'))===0x0){_0x525e85[_0x123a34[_0xabee('0x31')](0x4)]=_0x525e85[_0x123a34];delete _0x525e85[_0x123a34];}}}}function getLogFromObject(_0x3c839e){return util[_0xabee('0x32')](_0x3c839e,{'showHidden':![],'depth':null});}function agiHandler(_0x42e434){var _0xaefbc3,_0x199929,_0x2a67fb,_0x55a27b,_0x261bfb;logger[_0xabee('0x33')](_0xabee('0x34'),JSON[_0xabee('0x35')](_0x42e434,null,0x2));logger[_0xabee('0x1d')](util[_0xabee('0x12')](_0xabee('0x36'),_0x42e434[_0xabee('0x18')],_0x42e434[_0xabee('0x19')],_0x42e434[_0xabee('0x1a')],_0x42e434[_0xabee('0x1b')],_0x42e434[_0xabee('0x1c')]));_0x42e434['on'](_0xabee('0xd'),errorHandler);_0x42e434['on'](_0xabee('0x37'),closeHandler);_0x42e434['on'](_0xabee('0x38'),timeoutHandler);_0x42e434[_0xabee('0x39')]=![];_0x42e434['on'](_0xabee('0x3a'),hangupHandler);var _0x491279=getSquareProject['sync'](null,_0x42e434[_0xabee('0x18')]);if(_0x491279){if(_0x491279[_0xabee('0x3b')]){_0xaefbc3=getRoot(_0x491279[_0xabee('0x3b')]);if(_0xaefbc3&&_0xaefbc3[_0xabee('0x3c')]){logger['debug'](_0xabee('0x3d'),JSON[_0xabee('0x35')](_0xaefbc3,null,0x2));_0x42e434[_0xabee('0x3e')]=moment()['format'](_0xabee('0x3f'));_0x199929=initGraph(_['omit'](_0xaefbc3,_0xabee('0x27')),_0xaefbc3[_0xabee('0x27')]);_0x2a67fb=new Vertices(_0x42e434,rpc,mailRpc);logger[_0xabee('0x1d')](util[_0xabee('0x12')]('[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x42e434['arg_1'],_0x42e434[_0xabee('0x19')],_0x42e434[_0xabee('0x1a')],_0x42e434[_0xabee('0x1b')],_0x42e434[_0xabee('0x1c')]));_0x199929[_0xabee('0x40')](_0xaefbc3['start']['id'],function(_0x229b00){try{_0x229b00=_0x2a67fb[_0xabee('0x41')](_0x229b00);logger['debug'](_0xabee('0x42'),JSON[_0xabee('0x35')](_0x229b00,null,0x2));if(_0x229b00['agicommand']===_0xabee('0x43')){logger[_0xabee('0x1d')](_0xabee('0x44'));_0x42e434[_0xabee('0x45')]=_0x229b00[_0xabee('0x45')]||_0x42e434[_0xabee('0x45')];_0x42e434[_0xabee('0x46')]=_0x229b00['extension'];_0x42e434[_0xabee('0x47')]=_0x229b00[_0xabee('0x47')]?_0x229b00[_0xabee('0x47')]-0x1:0x1;return null;}else if(_0x229b00&&_0x2a67fb[_0x229b00['agicommand']]){_0x261bfb=_0x2a67fb[_0x229b00[_0xabee('0x21')]](_0x229b00);logger[_0xabee('0x1d')]('response',JSON[_0xabee('0x35')](_0x261bfb,null,0x2));if(_0x261bfb&&_0x261bfb[_0xabee('0x48')]===AGI_CODE_SUCCESS&&_0x261bfb['result']!==AGI_RESULT_ERROR&&!_0x42e434[_0xabee('0x39')]){logger[_0xabee('0x33')](_0xabee('0x49'),getLogFromObject(_0x261bfb));return _[_0xabee('0x4a')](_0x261bfb[_0xabee('0x4b')])?null:_0x261bfb[_0xabee('0x4b')][_0xabee('0x4c')]();}else{logger['error'](_0xabee('0x49'),getLogFromObject(_0x261bfb));return null;}}else{logger[_0xabee('0xd')](_0xabee('0x4d'));return null;}}catch(_0x5e1879){logger[_0xabee('0xd')](_0x5e1879[_0xabee('0xe')]);return null;}});if(_0xaefbc3['finally']){logger['info'](util['format'](_0xabee('0x4e'),_0x42e434[_0xabee('0x18')],_0x42e434['calleridname'],_0x42e434['callerid'],_0x42e434[_0xabee('0x1b')],_0x42e434[_0xabee('0x1c')]));_0x199929[_0xabee('0x40')](_0xaefbc3[_0xabee('0x4f')]['id'],function(_0x184058){try{_0x184058=_0x2a67fb[_0xabee('0x41')](_0x184058);logger[_0xabee('0x33')](_0xabee('0x42'),JSON[_0xabee('0x35')](_0x184058,null,0x2));if(_0x184058&&_0x2a67fb[_0x184058[_0xabee('0x21')]]){_0x261bfb=_0x2a67fb[_0x184058[_0xabee('0x21')]](_0x184058);if(_0x261bfb){logger[_0xabee('0x33')](_0xabee('0x49'),getLogFromObject(_0x261bfb));return _[_0xabee('0x4a')](_0x261bfb[_0xabee('0x4b')])?null:_0x261bfb[_0xabee('0x4b')][_0xabee('0x4c')]();}else{logger[_0xabee('0xd')]('response',getLogFromObject(_0x261bfb));return null;}}else{logger[_0xabee('0xd')](_0xabee('0x4d'));return null;}}catch(_0x4bee06){logger['error'](_0x4bee06[_0xabee('0xe')]);return null;}});}logger[_0xabee('0x1d')](util[_0xabee('0x12')](_0xabee('0x50'),_0x42e434[_0xabee('0x18')],_0x42e434[_0xabee('0x19')],_0x42e434[_0xabee('0x1a')],_0x42e434['dnid'],_0x42e434[_0xabee('0x1c')]));logger['info'](util[_0xabee('0x12')](_0xabee('0x51'),_0x42e434['context'],_0x42e434[_0xabee('0x46')],parseInt(_0x42e434[_0xabee('0x47')],0xa)+0x1));_0x42e434[_0xabee('0x52')](_0x42e434['context'],_0x42e434[_0xabee('0x46')],parseInt(_0x42e434['priority'],0xa)+0x1);_0x42e434[_0xabee('0x37')]();}}else{logger[_0xabee('0xd')](util[_0xabee('0x12')]('Project\x20%s\x20not\x20published',_0x42e434[_0xabee('0x18')]));_0x42e434[_0xabee('0x52')](_0x42e434[_0xabee('0x45')],_0x42e434['extension'],parseInt(_0x42e434[_0xabee('0x47')],0xa)+0x1);_0x42e434[_0xabee('0x37')]();}}else{logger[_0xabee('0xd')](util[_0xabee('0x12')]('Project\x20%s\x20not\x20found',_0x42e434[_0xabee('0x18')]));_0x42e434[_0xabee('0x52')](_0x42e434[_0xabee('0x45')],_0x42e434['extension'],parseInt(_0x42e434[_0xabee('0x47')],0xa)+0x1);_0x42e434[_0xabee('0x37')]();}}function main(){var _0x92baa3;return utilLicense[_0xabee('0x53')]()[_0xabee('0x54')](function(_0x105130){if(_0x105130){if(_0x105130[_0xabee('0x55')]){if(_0x105130[_0xabee('0x56')]&&_0x105130[_0xabee('0x56')]>0x0){logger['info'](util['format'](_0xabee('0x57'),_0x105130[_0xabee('0x56')]));_0x92baa3=_0x105130[_0xabee('0x56')];}else{logger[_0xabee('0x1d')](_0xabee('0x58'));}}else{logger[_0xabee('0x1d')]('[LICENSE]\x20VOICE\x20IS\x20DISABLED');_0x92baa3=-0x1;}}})[_0xabee('0x59')](function(_0x269fed){logger[_0xabee('0xd')]('[LICENSE]',_0x269fed['stack']);})[_0xabee('0x4f')](function(){var _0x4b1448=require('./server')(config['agi'][_0xabee('0x11')],config['agi']['ip'],_0x92baa3);_0x4b1448['on'](_0xabee('0xd'),errorHandler);_0x4b1448['on']('listening',listeningHandler);_0x4b1448['on'](_0xabee('0x5a'),connectionHandler);_0x4b1448['on']('close',closeHandler);});}main(); \ No newline at end of file +var _0x7579=['context','extension','priority','response','result','evtHangup','isUndefined','toString','agicommand\x20not\x20found','finally','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','listening','xml2json','lodash','syncho','util','moment','../../config/environment','agi','../../config/license/util','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','error','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','message','name','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','calleridname','callerid','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','length','source','target','addEdge','value','getSquareProject','then','createSquareReport','catch','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','sync','production','start','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','vertex','gotoc'];(function(_0x1278bb,_0x5627b8){var _0x3bd733=function(_0x206053){while(--_0x206053){_0x1278bb['push'](_0x1278bb['shift']());}};_0x3bd733(++_0x5627b8);}(_0x7579,0x1e2));var _0x9757=function(_0x18132f,_0x34923a){_0x18132f=_0x18132f-0x0;var _0x3fc120=_0x7579[_0x18132f];return _0x3fc120;};'use strict';var parser=require(_0x9757('0x0'));var _=require(_0x9757('0x1'));var syncho=require(_0x9757('0x2'));var util=require(_0x9757('0x3'));var moment=require(_0x9757('0x4'));var config=require(_0x9757('0x5'));var logger=require('../../config/logger')(_0x9757('0x6'));var utilLicense=require(_0x9757('0x7'));var rpc=require(_0x9757('0x8'));var mailRpc=require(_0x9757('0x9'));var Graph=require('./graph');var Vertices=require(_0x9757('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x9757('0x6')]=_[_0x9757('0xb')](config['agi'],{'ip':_0x9757('0xc'),'port':0x11dd});function connectionHandler(_0x51a1c8){process[_0x9757('0xd')](function(){syncho(function(){try{setChannelVariables(_0x51a1c8);agiHandler(_0x51a1c8);}catch(_0x2f9867){logger[_0x9757('0xe')](_0x2f9867['stack']);}});});}function listeningHandler(){console[_0x9757('0xf')](_0x9757('0x10'),config[_0x9757('0x6')][_0x9757('0x11')]);logger[_0x9757('0x12')](util[_0x9757('0x13')](_0x9757('0x14'),config[_0x9757('0x6')]['ip'],config[_0x9757('0x6')][_0x9757('0x11')]));}function errorHandler(_0x7491ea){if(_0x7491ea&&_0x7491ea['name']&&_0x7491ea[_0x9757('0x15')]){logger[_0x9757('0xe')](util[_0x9757('0x13')]('[%s]\x20%s',_0x7491ea[_0x9757('0x16')],_0x7491ea[_0x9757('0x15')]));}else{logger[_0x9757('0xe')](util[_0x9757('0x13')](_0x9757('0x17'),_0x7491ea[_0x9757('0x18')]));}}function closeHandler(){logger[_0x9757('0x12')](util['format'](_0x9757('0x19'),this['arg_1'],this[_0x9757('0x1a')],this[_0x9757('0x1b')],this[_0x9757('0x1c')],this[_0x9757('0x1d')]));try{createSquareReport(this);}catch(_0x3f6be9){logger[_0x9757('0xe')](_0x3f6be9['stack']);}}function timeoutHandler(){logger[_0x9757('0x12')](util[_0x9757('0x13')](_0x9757('0x1e'),this[_0x9757('0x1f')],this[_0x9757('0x1a')],this[_0x9757('0x1b')],this[_0x9757('0x1c')],this['uniqueid']));}function hangupHandler(){logger[_0x9757('0x12')](util['format']('[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this[_0x9757('0x1f')],this[_0x9757('0x1a')],this[_0x9757('0x1b')],this[_0x9757('0x1c')],this['uniqueid']));this['evtHangup']=!![];}function getRoot(_0x53d21c){return parser[_0x9757('0x20')](_0x53d21c,{'object':!![]})[_0x9757('0x21')][_0x9757('0x22')];}function addVertex(_0x21435e,_0x5dc2fa,_0x11f5ac){_0x5dc2fa[_0x9757('0x23')]=_0x11f5ac;if(_0x5dc2fa['hasOwnProperty'](_0x9757('0x24'))){_0x5dc2fa[_0x9757('0x25')]=parseInt(_0x5dc2fa['retry'],0xa);}_0x21435e[_0x9757('0x26')](_[_0x9757('0x27')](_0x5dc2fa,_0x9757('0x28')));}function initGraph(_0x14b614,_0x115e33){var _0x19588f=new Graph();for(var _0x4e6b86 in _0x14b614){if(_0x14b614[_0x9757('0x29')](_0x4e6b86)){if(_['isArray'](_0x14b614[_0x4e6b86])){for(var _0x2f2fe7=0x0;_0x2f2fe7<_0x14b614[_0x4e6b86][_0x9757('0x2a')];_0x2f2fe7+=0x1){addVertex(_0x19588f,_0x14b614[_0x4e6b86][_0x2f2fe7],_0x4e6b86);}}else{addVertex(_0x19588f,_0x14b614[_0x4e6b86],_0x4e6b86);}}}for(var _0x58ae5e=0x0;_0x58ae5e<_0x115e33['length'];_0x58ae5e+=0x1){if(_0x115e33[_0x58ae5e][_0x9757('0x2b')]&&_0x115e33[_0x58ae5e][_0x9757('0x2c')]){_0x19588f[_0x9757('0x2d')](_0x115e33[_0x58ae5e][_0x9757('0x2b')],_0x115e33[_0x58ae5e]['target'],_0x115e33[_0x58ae5e][_0x9757('0x2e')]);}}return _0x19588f;}function getSquareProject(_0xecf119,_0x83037b){rpc[_0x9757('0x2f')](_0xecf119)[_0x9757('0x30')](function(_0xa471a9){_0x83037b(null,_0xa471a9);})['catch'](function(_0x13fa8a){_0x83037b(null,_0x13fa8a);});}function createSquareReport(_0x3aebbe,_0x36eb37){rpc[_0x9757('0x31')](_0x3aebbe)[_0x9757('0x30')](function(_0x328c9e){if(_0x36eb37){_0x36eb37(null,_0x328c9e);}})[_0x9757('0x32')](function(_0x586e71){if(_0x36eb37){_0x36eb37(null,_0x586e71);}});}function setChannelVariables(_0x335212){for(var _0x22d196 in _0x335212){if(_0x335212[_0x9757('0x29')](_0x22d196)){if(_0x22d196[_0x9757('0x33')](_0x9757('0x34'))===0x0){_0x335212[_0x22d196[_0x9757('0x35')](0x4)]=_0x335212[_0x22d196];delete _0x335212[_0x22d196];}}}}function getLogFromObject(_0x1c0a88){return util[_0x9757('0x36')](_0x1c0a88,{'showHidden':![],'depth':null});}function agiHandler(_0x56c2a2){var _0x2c24af,_0x52e9f2,_0x59dd42,_0x14fb73,_0x5022b4;logger[_0x9757('0x37')](_0x9757('0x38'),JSON[_0x9757('0x39')](_0x56c2a2,null,0x2));logger[_0x9757('0x12')](util[_0x9757('0x13')](_0x9757('0x3a'),_0x56c2a2[_0x9757('0x1f')],_0x56c2a2[_0x9757('0x1a')],_0x56c2a2[_0x9757('0x1b')],_0x56c2a2[_0x9757('0x1c')],_0x56c2a2['uniqueid']));_0x56c2a2['on'](_0x9757('0xe'),errorHandler);_0x56c2a2['on'](_0x9757('0x3b'),closeHandler);_0x56c2a2['on'](_0x9757('0x3c'),timeoutHandler);_0x56c2a2['evtHangup']=![];_0x56c2a2['on'](_0x9757('0x3d'),hangupHandler);var _0x2c2e5f=getSquareProject[_0x9757('0x3e')](null,_0x56c2a2[_0x9757('0x1f')]);if(_0x2c2e5f){if(_0x2c2e5f[_0x9757('0x3f')]){_0x2c24af=getRoot(_0x2c2e5f[_0x9757('0x3f')]);if(_0x2c24af&&_0x2c24af[_0x9757('0x40')]){logger[_0x9757('0x37')](_0x9757('0x22'),JSON['stringify'](_0x2c24af,null,0x2));_0x56c2a2['joinAt']=moment()[_0x9757('0x13')](_0x9757('0x41'));_0x52e9f2=initGraph(_[_0x9757('0x27')](_0x2c24af,_0x9757('0x28')),_0x2c24af['mxCell']);_0x59dd42=new Vertices(_0x56c2a2,rpc,mailRpc);logger[_0x9757('0x12')](util['format'](_0x9757('0x42'),_0x56c2a2[_0x9757('0x1f')],_0x56c2a2[_0x9757('0x1a')],_0x56c2a2['callerid'],_0x56c2a2[_0x9757('0x1c')],_0x56c2a2[_0x9757('0x1d')]));_0x52e9f2[_0x9757('0x43')](_0x2c24af['start']['id'],function(_0x37b223){try{_0x37b223=_0x59dd42['clear'](_0x37b223);logger['debug'](_0x9757('0x44'),JSON[_0x9757('0x39')](_0x37b223,null,0x2));if(_0x37b223[_0x9757('0x23')]===_0x9757('0x45')){logger[_0x9757('0x12')]('gotoc\x20block\x20stop\x20traverse\x20BFS');_0x56c2a2['context']=_0x37b223['context']||_0x56c2a2[_0x9757('0x46')];_0x56c2a2[_0x9757('0x47')]=_0x37b223[_0x9757('0x47')];_0x56c2a2['priority']=_0x37b223[_0x9757('0x48')]?_0x37b223[_0x9757('0x48')]-0x1:0x1;return null;}else if(_0x37b223&&_0x59dd42[_0x37b223['agicommand']]){_0x5022b4=_0x59dd42[_0x37b223[_0x9757('0x23')]](_0x37b223);logger[_0x9757('0x12')](_0x9757('0x49'),JSON[_0x9757('0x39')](_0x5022b4,null,0x2));if(_0x5022b4&&_0x5022b4['code']===AGI_CODE_SUCCESS&&_0x5022b4[_0x9757('0x4a')]!==AGI_RESULT_ERROR&&!_0x56c2a2[_0x9757('0x4b')]){logger[_0x9757('0x37')](_0x9757('0x49'),getLogFromObject(_0x5022b4));return _[_0x9757('0x4c')](_0x5022b4[_0x9757('0x4a')])?null:_0x5022b4[_0x9757('0x4a')][_0x9757('0x4d')]();}else{logger[_0x9757('0xe')]('response',getLogFromObject(_0x5022b4));return null;}}else{logger['error'](_0x9757('0x4e'));return null;}}catch(_0x45ff44){logger[_0x9757('0xe')](_0x45ff44['stack']);return null;}});if(_0x2c24af[_0x9757('0x4f')]){logger[_0x9757('0x12')](util[_0x9757('0x13')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x56c2a2[_0x9757('0x1f')],_0x56c2a2[_0x9757('0x1a')],_0x56c2a2['callerid'],_0x56c2a2['dnid'],_0x56c2a2['uniqueid']));_0x52e9f2[_0x9757('0x43')](_0x2c24af[_0x9757('0x4f')]['id'],function(_0x1bb233){try{_0x1bb233=_0x59dd42['clear'](_0x1bb233);logger[_0x9757('0x37')]('vertex',JSON[_0x9757('0x39')](_0x1bb233,null,0x2));if(_0x1bb233&&_0x59dd42[_0x1bb233[_0x9757('0x23')]]){_0x5022b4=_0x59dd42[_0x1bb233['agicommand']](_0x1bb233);if(_0x5022b4){logger[_0x9757('0x37')](_0x9757('0x49'),getLogFromObject(_0x5022b4));return _[_0x9757('0x4c')](_0x5022b4[_0x9757('0x4a')])?null:_0x5022b4[_0x9757('0x4a')]['toString']();}else{logger[_0x9757('0xe')](_0x9757('0x49'),getLogFromObject(_0x5022b4));return null;}}else{logger[_0x9757('0xe')](_0x9757('0x4e'));return null;}}catch(_0x3bff1d){logger[_0x9757('0xe')](_0x3bff1d[_0x9757('0x18')]);return null;}});}logger['info'](util['format'](_0x9757('0x50'),_0x56c2a2['arg_1'],_0x56c2a2['calleridname'],_0x56c2a2[_0x9757('0x1b')],_0x56c2a2['dnid'],_0x56c2a2[_0x9757('0x1d')]));logger[_0x9757('0x12')](util['format']('[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s',_0x56c2a2[_0x9757('0x46')],_0x56c2a2['extension'],parseInt(_0x56c2a2[_0x9757('0x48')],0xa)+0x1));_0x56c2a2['continueAt'](_0x56c2a2[_0x9757('0x46')],_0x56c2a2['extension'],parseInt(_0x56c2a2[_0x9757('0x48')],0xa)+0x1);_0x56c2a2[_0x9757('0x3b')]();}}else{logger[_0x9757('0xe')](util[_0x9757('0x13')](_0x9757('0x51'),_0x56c2a2[_0x9757('0x1f')]));_0x56c2a2[_0x9757('0x52')](_0x56c2a2[_0x9757('0x46')],_0x56c2a2['extension'],parseInt(_0x56c2a2[_0x9757('0x48')],0xa)+0x1);_0x56c2a2[_0x9757('0x3b')]();}}else{logger[_0x9757('0xe')](util[_0x9757('0x13')](_0x9757('0x53'),_0x56c2a2[_0x9757('0x1f')]));_0x56c2a2[_0x9757('0x52')](_0x56c2a2[_0x9757('0x46')],_0x56c2a2[_0x9757('0x47')],parseInt(_0x56c2a2[_0x9757('0x48')],0xa)+0x1);_0x56c2a2[_0x9757('0x3b')]();}}function main(){var _0x18a9d1;return utilLicense[_0x9757('0x54')]()['then'](function(_0x4f831a){if(_0x4f831a){if(_0x4f831a[_0x9757('0x55')]){if(_0x4f831a['callysquare']&&_0x4f831a[_0x9757('0x56')]>0x0){logger[_0x9757('0x12')](util[_0x9757('0x13')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4f831a[_0x9757('0x56')]));_0x18a9d1=_0x4f831a[_0x9757('0x56')];}else{logger[_0x9757('0x12')](_0x9757('0x57'));}}else{logger[_0x9757('0x12')](_0x9757('0x58'));_0x18a9d1=-0x1;}}})[_0x9757('0x32')](function(_0x19ca63){logger[_0x9757('0xe')](_0x9757('0x59'),_0x19ca63[_0x9757('0x18')]);})['finally'](function(){var _0x2aa462=require(_0x9757('0x5a'))(config[_0x9757('0x6')][_0x9757('0x11')],config[_0x9757('0x6')]['ip'],_0x18a9d1);_0x2aa462['on'](_0x9757('0xe'),errorHandler);_0x2aa462['on'](_0x9757('0x5b'),listeningHandler);_0x2aa462['on']('connection',connectionHandler);_0x2aa462['on'](_0x9757('0x3b'),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 e8e9867..51acce6 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(_0xe276d4,_0xf1da57){var _0xd77842=function(_0x3455d0){while(--_0x3455d0){_0xe276d4['push'](_0xe276d4['shift']());}};_0xd77842(++_0xf1da57);}(_0x9957,0x93));var _0x7995=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x9957[_0x4cf98e];return _0x1623ac;};'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(_0x38500,_0x43cc1a){var _0x2ab338=function(_0x4b32d2){while(--_0x4b32d2){_0x38500['push'](_0x38500['shift']());}};_0x2ab338(++_0x43cc1a);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'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 bab71bf..971e8be 100644 --- a/server/services/agi/reply.js +++ b/server/services/agi/reply.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x90e575,_0x48c2ec){var _0x1aae60=function(_0x4e40cf){while(--_0x4e40cf){_0x90e575['push'](_0x90e575['shift']());}};_0x1aae60(++_0x48c2ec);}(_0xb10b,0x12a));var _0xbb10=function(_0x37bd0d,_0x1b3079){_0x37bd0d=_0x37bd0d-0x0;var _0x33f81d=_0xb10b[_0x37bd0d];return _0x33f81d;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _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(_0x1863be,_0x3fb18f){var _0x5835e1=function(_0xaa0e92){while(--_0xaa0e92){_0x1863be['push'](_0x1863be['shift']());}};_0x5835e1(++_0x3fb18f);}(_0xb10b,0x12a));var _0xbb10=function(_0x12ef9a,_0x5dfbf7){_0x12ef9a=_0x12ef9a-0x0;var _0x3a6833=_0xb10b[_0x12ef9a];return _0x3a6833;};'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 0e845ec..2bb63df 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 _0x655c=['dsn','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','format','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','ShowCmHopper','CreateCmContact','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','agentUnpause','UnpauseUser','agentLogout','bluebird','moment','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','production','getMailAccountById','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','ShowSquareProject','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc'];(function(_0x2dc5b7,_0x3837ba){var _0x4edb5b=function(_0x3ed644){while(--_0x3ed644){_0x2dc5b7['push'](_0x2dc5b7['shift']());}};_0x4edb5b(++_0x3837ba);}(_0x655c,0x15e));var _0xc655=function(_0xf281e7,_0x470775){_0xf281e7=_0xf281e7-0x0;var _0x2b6b22=_0x655c[_0xf281e7];return _0x2b6b22;};'use strict';var BPromise=require(_0xc655('0x0'));var moment=require(_0xc655('0x1'));var _=require('lodash');var util=require(_0xc655('0x2'));var jayson=require(_0xc655('0x3'));var client=jayson[_0xc655('0x4')][_0xc655('0x5')]({'port':0x2329});function request(_0x58c7e2,_0x380ab7){return new BPromise(function(_0x27f4fe,_0x1ae7f8){return client[_0xc655('0x6')](_0x58c7e2,_0x380ab7)[_0xc655('0x7')](function(_0x23af74){if(_0x23af74[_0xc655('0x8')]){return _0x1ae7f8(_0x23af74[_0xc655('0x8')][_0xc655('0x9')]);}else{return _0x27f4fe(_0x23af74[_0xc655('0xa')]);}})[_0xc655('0xb')](function(_0x6b9eed){return _0x1ae7f8(_0x6b9eed);});});}exports[_0xc655('0xc')]=function(_0x4051d1){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0x4051d1},'attributes':[_0xc655('0xd')]}});};exports[_0xc655('0xe')]=function(_0x3c7d28){return request(_0xc655('0xf'),{'options':{'raw':![],'where':{'id':_0x3c7d28},'include':[{'model':_0xc655('0x10'),'as':_0xc655('0x11')}],'attributes':['id',_0xc655('0x12'),_0xc655('0x13')]}});};exports[_0xc655('0x14')]=function(_0x3f9052){return request(_0xc655('0x15'),{'options':{'where':{'id':_0x3f9052},'attributes':[_0xc655('0x12')]}});};exports[_0xc655('0x16')]=function(_0x5da889){return request(_0xc655('0x17'),{'options':{'where':{'id':_0x5da889},'attributes':[_0xc655('0x12')]}});};exports[_0xc655('0x18')]=function(_0x2d85fc){return request(_0xc655('0x19'),{'options':{'where':{'id':_0x2d85fc},'attributes':[_0xc655('0x12')]}});};exports[_0xc655('0x1a')]=function(_0x3cc11c){return request(_0xc655('0x1b'),{'options':{'where':{'id':_0x3cc11c},'attributes':[_0xc655('0x1c')]}});};exports[_0xc655('0x1d')]=function(_0x254c70){return request(_0xc655('0x1e'),{'options':{'where':{'id':_0x254c70},'attributes':[_0xc655('0x12')]}});};exports['getTrunkById']=function(_0x3a6266){return request(_0xc655('0x1f'),{'options':{'where':{'id':_0x3a6266},'attributes':[_0xc655('0x12')]}});};exports[_0xc655('0x20')]=function(_0x3351bd){return request(_0xc655('0x21'),{'options':{'where':{'id':_0x3351bd},'attributes':['save_name']}});};exports[_0xc655('0x22')]=function(_0x3c5d9f){return request(_0xc655('0x23'),{'options':{'raw':![],'where':{'id':_0x3c5d9f},'include':[{'model':'Interval','as':_0xc655('0x24')}]}});};exports[_0xc655('0x25')]=function(_0x2c8983){return request(_0xc655('0x26'),{'options':{'where':{'id':_0x2c8983},'attributes':['id',_0xc655('0x12')]}});};exports[_0xc655('0x27')]=function(_0x2204a1){return request(_0xc655('0x28'),{'body':_0x2204a1});};exports[_0xc655('0x29')]=function(_0x41619f){return request(_0xc655('0x2a'),{'body':_0x41619f});};exports[_0xc655('0x2b')]=function(_0x2b6346){return request(_0xc655('0x2c'),{'body':_[_0xc655('0x2d')](_0x2b6346,{'project_name':_0x2b6346[_0xc655('0x2e')],'prev_project_name':_0x2b6346['arg_2']||'','is_subproject':_0x2b6346[_0xc655('0x2f')]?!![]:![],'leaveAt':moment()[_0xc655('0x30')](_0xc655('0x31'))})});};exports[_0xc655('0x32')]=function(_0x38fa96){return request(_0xc655('0x33'),{'body':_0x38fa96});};exports[_0xc655('0x34')]=function(_0x1f3ca2){return request('CreateSquareMessage',{'body':_0x1f3ca2});};exports['createCmContact']=function(_0x19f52d){return request(_0xc655('0x35'),{'options':{'raw':![],'where':{'phone':_0x19f52d['phone'],'ListId':_0x19f52d['ListId']}}})[_0xc655('0x7')](function(_0x1d4168){if(_0x1d4168){return _0x1d4168;}return request(_0xc655('0x36'),{'body':_0x19f52d});});};exports['getPauseById']=function(_0x31730c){return request(_0xc655('0x37'),{'options':{'where':{'id':_0x31730c},'attributes':[_0xc655('0x12')]}});};exports[_0xc655('0x38')]=function(_0x25f2ae,_0x5e8145){return request(_0xc655('0x39'),{'body':{'interface':_0x5e8145},'options':{'where':_0x25f2ae}});};exports[_0xc655('0x3a')]=function(_0x728f79,_0x1cf894,_0x312e72){return request(_0xc655('0x3b'),{'body':{'type':_0x1cf894,'uniqueid':_0x312e72},'options':{'where':_0x728f79}});};exports[_0xc655('0x3c')]=function(_0x239370){return request(_0xc655('0x3d'),{'body':{},'options':{'where':_0x239370}});};exports[_0xc655('0x3e')]=function(_0x426a81){return request('LogoutUser',{'body':{},'options':{'where':_0x426a81}});}; \ No newline at end of file +var _0xd5c1=['getVoiceQueueById','getVariableById','getSquareOdbcById','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','CreateSquareRecording','CreateSquareMessage','createCmContact','ShowCmHopper','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','LogoutUser','lodash','util','client','http','then','result','catch','ShowSquareProject','production','getMailAccountById','ShowMailAccount','Smtp','name','email','getSquareProjectById'];(function(_0x3eaf1d,_0x3c0d2a){var _0x35b471=function(_0x1d3e48){while(--_0x1d3e48){_0x3eaf1d['push'](_0x3eaf1d['shift']());}};_0x35b471(++_0x3c0d2a);}(_0xd5c1,0xc1));var _0x1d5c=function(_0x5a311e,_0x9ef75){_0x5a311e=_0x5a311e-0x0;var _0x1671e6=_0xd5c1[_0x5a311e];return _0x1671e6;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require(_0x1d5c('0x0'));var util=require(_0x1d5c('0x1'));var jayson=require('jayson/promise');var client=jayson[_0x1d5c('0x2')][_0x1d5c('0x3')]({'port':0x2329});function request(_0x3fc7b1,_0x5dbca5){return new BPromise(function(_0x963ddd,_0x3cfc00){return client['request'](_0x3fc7b1,_0x5dbca5)[_0x1d5c('0x4')](function(_0x527c84){if(_0x527c84['error']){return _0x3cfc00(_0x527c84['error']['message']);}else{return _0x963ddd(_0x527c84[_0x1d5c('0x5')]);}})[_0x1d5c('0x6')](function(_0x261afe){return _0x3cfc00(_0x261afe);});});}exports['getSquareProject']=function(_0x1d80c0){return request(_0x1d5c('0x7'),{'options':{'raw':![],'where':{'name':_0x1d80c0},'attributes':[_0x1d5c('0x8')]}});};exports[_0x1d5c('0x9')]=function(_0x21e939){return request(_0x1d5c('0xa'),{'options':{'raw':![],'where':{'id':_0x21e939},'include':[{'model':'MailServerOut','as':_0x1d5c('0xb')}],'attributes':['id',_0x1d5c('0xc'),_0x1d5c('0xd')]}});};exports[_0x1d5c('0xe')]=function(_0x105637){return request('ShowSquareProject',{'options':{'where':{'id':_0x105637},'attributes':[_0x1d5c('0xc')]}});};exports[_0x1d5c('0xf')]=function(_0x182d0e){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x182d0e},'attributes':[_0x1d5c('0xc')]}});};exports[_0x1d5c('0x10')]=function(_0x25d811){return request('ShowVariable',{'options':{'where':{'id':_0x25d811},'attributes':[_0x1d5c('0xc')]}});};exports[_0x1d5c('0x11')]=function(_0x33098a){return request(_0x1d5c('0x12'),{'options':{'where':{'id':_0x33098a},'attributes':['dsn']}});};exports[_0x1d5c('0x13')]=function(_0x3dc5a2){return request(_0x1d5c('0x14'),{'options':{'where':{'id':_0x3dc5a2},'attributes':[_0x1d5c('0xc')]}});};exports['getTrunkById']=function(_0x24a990){return request(_0x1d5c('0x15'),{'options':{'where':{'id':_0x24a990},'attributes':[_0x1d5c('0xc')]}});};exports[_0x1d5c('0x16')]=function(_0xa3f1b3){return request(_0x1d5c('0x17'),{'options':{'where':{'id':_0xa3f1b3},'attributes':[_0x1d5c('0x18')]}});};exports[_0x1d5c('0x19')]=function(_0x5839fb){return request(_0x1d5c('0x1a'),{'options':{'raw':![],'where':{'id':_0x5839fb},'include':[{'model':_0x1d5c('0x1b'),'as':_0x1d5c('0x1c')}]}});};exports[_0x1d5c('0x1d')]=function(_0x81f79b){return request(_0x1d5c('0x1e'),{'options':{'where':{'id':_0x81f79b},'attributes':['id',_0x1d5c('0xc')]}});};exports[_0x1d5c('0x1f')]=function(_0x2dff4a){return request(_0x1d5c('0x20'),{'body':_0x2dff4a});};exports['createSquareDetailsReport']=function(_0x2d7a12){return request(_0x1d5c('0x21'),{'body':_0x2d7a12});};exports[_0x1d5c('0x22')]=function(_0x3727ab){return request(_0x1d5c('0x23'),{'body':_[_0x1d5c('0x24')](_0x3727ab,{'project_name':_0x3727ab[_0x1d5c('0x25')],'prev_project_name':_0x3727ab[_0x1d5c('0x26')]||'','is_subproject':_0x3727ab[_0x1d5c('0x26')]?!![]:![],'leaveAt':moment()['format'](_0x1d5c('0x27'))})});};exports['createSquareRecording']=function(_0x15c146){return request(_0x1d5c('0x28'),{'body':_0x15c146});};exports['createSquareMessage']=function(_0x285512){return request(_0x1d5c('0x29'),{'body':_0x285512});};exports[_0x1d5c('0x2a')]=function(_0x3637f9){return request(_0x1d5c('0x2b'),{'options':{'raw':![],'where':{'phone':_0x3637f9['phone'],'ListId':_0x3637f9['ListId']}}})[_0x1d5c('0x4')](function(_0x328259){if(_0x328259){return _0x328259;}return request('CreateCmContact',{'body':_0x3637f9});});};exports[_0x1d5c('0x2c')]=function(_0x5ba003){return request(_0x1d5c('0x2d'),{'options':{'where':{'id':_0x5ba003},'attributes':[_0x1d5c('0xc')]}});};exports[_0x1d5c('0x2e')]=function(_0x5ccb9d,_0x45cb03){return request(_0x1d5c('0x2f'),{'body':{'interface':_0x45cb03},'options':{'where':_0x5ccb9d}});};exports[_0x1d5c('0x30')]=function(_0xf8832b,_0x57c5c7,_0x44a474){return request(_0x1d5c('0x31'),{'body':{'type':_0x57c5c7,'uniqueid':_0x44a474},'options':{'where':_0xf8832b}});};exports['agentUnpause']=function(_0x4d963a){return request(_0x1d5c('0x32'),{'body':{},'options':{'where':_0x4d963a}});};exports['agentLogout']=function(_0x3918f9){return request(_0x1d5c('0x33'),{'body':{},'options':{'where':_0x3918f9}});}; \ 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 674d75a..0fbfb39 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 _0xca66=['./polly'];(function(_0x4ed1d4,_0x512d9a){var _0x28e363=function(_0x2bdfb7){while(--_0x2bdfb7){_0x4ed1d4['push'](_0x4ed1d4['shift']());}};_0x28e363(++_0x512d9a);}(_0xca66,0x8b));var _0x6ca6=function(_0x57d18c,_0x582506){_0x57d18c=_0x57d18c-0x0;var _0x3fddd1=_0xca66[_0x57d18c];return _0x3fddd1;};var polly=require(_0x6ca6('0x0'));var lex=require('./lex');module['exports']={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xc978=['exports','./polly','./lex'];(function(_0x132f12,_0x265cf6){var _0x323021=function(_0x3200f3){while(--_0x3200f3){_0x132f12['push'](_0x132f12['shift']());}};_0x323021(++_0x265cf6);}(_0xc978,0xcd));var _0x8c97=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc978[_0x20a584];return _0x4b41a8;};var polly=require(_0x8c97('0x0'));var lex=require(_0x8c97('0x1'));module[_0x8c97('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file diff --git a/server/services/agi/scripts/aws/lex/index.js b/server/services/agi/scripts/aws/lex/index.js index 524a6f0..844bb0e 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. * // * * // ************************************************************************* -'use strict';var lex=require('./lib/api');module['exports']=function(_0x412fb1,_0x5ba407,_0x2b8a76,_0x2a0b30,_0x24f912,_0x1bf88c){return lex(_0x412fb1,_0x5ba407,_0x2b8a76,_0x2a0b30,_0x24f912,_0x1bf88c);}; \ No newline at end of file +var _0x4f29=['exports'];(function(_0x31f65c,_0x218f6d){var _0x5c2a6e=function(_0x3f0bb8){while(--_0x3f0bb8){_0x31f65c['push'](_0x31f65c['shift']());}};_0x5c2a6e(++_0x218f6d);}(_0x4f29,0xfd));var _0x94f2=function(_0x4623ea,_0x364831){_0x4623ea=_0x4623ea-0x0;var _0x43e7f7=_0x4f29[_0x4623ea];return _0x43e7f7;};'use strict';var lex=require('./lib/api');module[_0x94f2('0x0')]=function(_0x37e667,_0x3a07c6,_0x2a6804,_0xc16ee3,_0x36e06e,_0x338fe2){return lex(_0x37e667,_0x3a07c6,_0x2a6804,_0xc16ee3,_0x36e06e,_0x338fe2);}; \ 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 135fc35..5dfd97c 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 _0x0a91=['slot_','LexRuntime','$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty'];(function(_0x4efd69,_0x29696b){var _0x12bdc3=function(_0x2cfb82){while(--_0x2cfb82){_0x4efd69['push'](_0x4efd69['shift']());}};_0x12bdc3(++_0x29696b);}(_0x0a91,0x193));var _0x10a9=function(_0x24697b,_0x2eb072){_0x24697b=_0x24697b-0x0;var _0x585b99=_0x0a91[_0x24697b];return _0x585b99;};'use strict';var BPromise=require(_0x10a9('0x0'));var AWS=require(_0x10a9('0x1'));function lexResult(_0x511575,_0x3fea01){return new BPromise(function(_0x2b1ecb,_0x33e8c3){_0x511575[_0x10a9('0x2')](_0x3fea01,function(_0x50efe5,_0x58486c){if(_0x50efe5){_0x33e8c3(_0x50efe5);}if(_0x58486c['slots']){for(const _0x4d78d7 in _0x58486c[_0x10a9('0x3')]){if(_0x58486c[_0x10a9('0x3')][_0x10a9('0x4')](_0x4d78d7)){var _0xfd77d3=_0x58486c[_0x10a9('0x3')][_0x4d78d7];_0x58486c[_0x10a9('0x5')+_0x4d78d7]=_0xfd77d3;}}}_0x2b1ecb(_0x58486c);});});}module['exports']=function(_0x45855a,_0x5523ce,_0x1a64da,_0x118b81,_0x1d604a,_0x5d15fd){var _0x2b6cc2=new AWS[(_0x10a9('0x6'))]({'accessKeyId':_0x5523ce,'secretAccessKey':_0x1a64da,'region':_0x118b81});var _0x13e854={'botAlias':_0x10a9('0x7'),'botName':_0x5d15fd,'inputText':_0x1d604a,'userId':_0x45855a};return lexResult(_0x2b6cc2,_0x13e854);}; \ No newline at end of file +var _0xd072=['exports','LexRuntime','$LATEST','bluebird','aws-sdk','slots','slot_'];(function(_0x2ba5cb,_0x3afb32){var _0x3ea469=function(_0x281bda){while(--_0x281bda){_0x2ba5cb['push'](_0x2ba5cb['shift']());}};_0x3ea469(++_0x3afb32);}(_0xd072,0xd5));var _0x2d07=function(_0x40c2ea,_0x4db161){_0x40c2ea=_0x40c2ea-0x0;var _0x5b6563=_0xd072[_0x40c2ea];return _0x5b6563;};'use strict';var BPromise=require(_0x2d07('0x0'));var AWS=require(_0x2d07('0x1'));function lexResult(_0x2c15a3,_0x337090){return new BPromise(function(_0x5dc503,_0x3d588d){_0x2c15a3['postText'](_0x337090,function(_0xd36616,_0x16f576){if(_0xd36616){_0x3d588d(_0xd36616);}if(_0x16f576[_0x2d07('0x2')]){for(const _0x20763a in _0x16f576['slots']){if(_0x16f576['slots']['hasOwnProperty'](_0x20763a)){var _0x48f6c1=_0x16f576[_0x2d07('0x2')][_0x20763a];_0x16f576[_0x2d07('0x3')+_0x20763a]=_0x48f6c1;}}}_0x5dc503(_0x16f576);});});}module[_0x2d07('0x4')]=function(_0x366716,_0x5bf6b1,_0x2d3645,_0x5b3f31,_0x1af4ba,_0x221cbe){var _0x3c875a=new AWS[(_0x2d07('0x5'))]({'accessKeyId':_0x5bf6b1,'secretAccessKey':_0x2d3645,'region':_0x5b3f31});var _0x4fdc06={'botAlias':_0x2d07('0x6'),'botName':_0x221cbe,'inputText':_0x1af4ba,'userId':_0x366716};return lexResult(_0x3c875a,_0x4fdc06);}; \ 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 43299a9..b6588c5 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 _0x30d0=['./lib/api'];(function(_0x469146,_0x5b911e){var _0xebb69c=function(_0xef74bb){while(--_0xef74bb){_0x469146['push'](_0x469146['shift']());}};_0xebb69c(++_0x5b911e);}(_0x30d0,0xd7));var _0x030d=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x30d0[_0xbf8ebe];return _0x1e25e8;};'use strict';var polly=require(_0x030d('0x0'));module['exports']=function(_0x14c6ae,_0xca49a0,_0x23a9a9,_0x43e9f0,_0xa4c5e2,_0x4b50d9,_0x39c192){return polly(_0x14c6ae,_0xca49a0,_0x23a9a9,_0x43e9f0,_0xa4c5e2,_0x4b50d9,_0x39c192);}; \ No newline at end of file +var _0xd6e0=['./lib/api','exports'];(function(_0x30ebe5,_0x136f6d){var _0x241883=function(_0x103d1f){while(--_0x103d1f){_0x30ebe5['push'](_0x30ebe5['shift']());}};_0x241883(++_0x136f6d);}(_0xd6e0,0x154));var _0x0d6e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xd6e0[_0x484e36];return _0xafc85d;};'use strict';var polly=require(_0x0d6e('0x0'));module[_0x0d6e('0x1')]=function(_0x514421,_0x211be9,_0x51f128,_0x5d72ab,_0x4b85c7,_0x1356fb,_0x5d9fb5){return polly(_0x514421,_0x211be9,_0x51f128,_0x5d72ab,_0x4b85c7,_0x1356fb,_0x5d9fb5);}; \ 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 603c945..3129e30 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 _0x002f=['AudioStream','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','text','mp3','bluebird','randomstring','synthesizeSpeech','writeFile'];(function(_0x155fbd,_0x2d0c5f){var _0x7ec488=function(_0x41fde0){while(--_0x41fde0){_0x155fbd['push'](_0x155fbd['shift']());}};_0x7ec488(++_0x2d0c5f);}(_0x002f,0x137));var _0xf002=function(_0x171e4d,_0x4f2493){_0x171e4d=_0x171e4d-0x0;var _0x2d2bf4=_0x002f[_0x171e4d];return _0x2d2bf4;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0xf002('0x0'));var rs=require(_0xf002('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x52df49,_0x8ef1d1,_0x2554db){return new BPromise(function(_0x45e202,_0x2251e6){_0x52df49[_0xf002('0x2')](_0x8ef1d1,function(_0x13568d,_0x1656a6){if(_0x13568d){_0x2251e6(_0x13568d);}else if(_0x1656a6){if(_0x1656a6['AudioStream']instanceof Buffer){fs[_0xf002('0x3')](_0x2554db,_0x1656a6[_0xf002('0x4')],function(_0x1c607a){if(_0x1c607a){_0x2251e6(_0x1c607a);}else{_0x45e202();}});}else{_0x2251e6(new Error('Invalid\x20data\x20response\x20from\x20aws\x20Polly!'));}}else{_0x2251e6(new Error(_0xf002('0x5')));}});});}module[_0xf002('0x6')]=function(_0x51aaf8,_0x1dcb20,_0x5d7478,_0x4cabfa,_0x392a0d,_0x2ac3e0,_0x413c27){var _0x5c4d23=new AWS['Polly']({'accessKeyId':_0x51aaf8,'secretAccessKey':_0x1dcb20,'region':_0x5d7478});var _0x4df082={'Text':_0x392a0d,'TextType':_0x2ac3e0||_0xf002('0x7'),'OutputFormat':_0xf002('0x8'),'VoiceId':_0x4cabfa};return pollyResult(_0x5c4d23,_0x4df082,_0x413c27);}; \ No newline at end of file +var _0x5de3=['Polly','mp3','path','randomstring','aws-sdk','AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5de3,0xda));var _0x35de=function(_0x40171b,_0x3f9fb2){_0x40171b=_0x40171b-0x0;var _0x847390=_0x5de3[_0x40171b];return _0x847390;};'use strict';var fs=require('fs');var path=require(_0x35de('0x0'));var BPromise=require('bluebird');var rs=require(_0x35de('0x1'));var AWS=require(_0x35de('0x2'));function pollyResult(_0x618195,_0x5d511d,_0x45b0ea){return new BPromise(function(_0x29fa14,_0x45e94d){_0x618195['synthesizeSpeech'](_0x5d511d,function(_0x1de2c3,_0x2ea83f){if(_0x1de2c3){_0x45e94d(_0x1de2c3);}else if(_0x2ea83f){if(_0x2ea83f[_0x35de('0x3')]instanceof Buffer){fs['writeFile'](_0x45b0ea,_0x2ea83f[_0x35de('0x3')],function(_0x39f887){if(_0x39f887){_0x45e94d(_0x39f887);}else{_0x29fa14();}});}else{_0x45e94d(new Error(_0x35de('0x4')));}}else{_0x45e94d(new Error(_0x35de('0x5')));}});});}module[_0x35de('0x6')]=function(_0x3df307,_0x124323,_0x385e71,_0x59a9f7,_0x26e44c,_0x203464,_0x2ff6dd){var _0x521201=new AWS[(_0x35de('0x7'))]({'accessKeyId':_0x3df307,'secretAccessKey':_0x124323,'region':_0x385e71});var _0x2a6d20={'Text':_0x26e44c,'TextType':_0x203464||'text','OutputFormat':_0x35de('0x8'),'VoiceId':_0x59a9f7};return pollyResult(_0x521201,_0x2a6d20,_0x2ff6dd);}; \ 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 0d21543..f081c96 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 _0x194c=['exports'];(function(_0x2e7f1e,_0x32f286){var _0x3dffa5=function(_0x920dc5){while(--_0x920dc5){_0x2e7f1e['push'](_0x2e7f1e['shift']());}};_0x3dffa5(++_0x32f286);}(_0x194c,0x148));var _0xc194=function(_0x15dca4,_0x581b16){_0x15dca4=_0x15dca4-0x0;var _0x2a5d0e=_0x194c[_0x15dca4];return _0x2a5d0e;};'use strict';var asr=require('./lib/api');module[_0xc194('0x0')]=function(_0x150186,_0x2d8033,_0xda5fe6,_0x181e67){return asr(_0x150186,_0x2d8033,_0xda5fe6);}; \ No newline at end of file +var _0x5553=['./lib/api','exports'];(function(_0x643b2,_0x14e495){var _0x2e5346=function(_0x3ed065){while(--_0x3ed065){_0x643b2['push'](_0x643b2['shift']());}};_0x2e5346(++_0x14e495);}(_0x5553,0x132));var _0x3555=function(_0x439fcb,_0x534a20){_0x439fcb=_0x439fcb-0x0;var _0x1b4d03=_0x5553[_0x439fcb];return _0x1b4d03;};'use strict';var asr=require(_0x3555('0x0'));module[_0x3555('0x1')]=function(_0x6343a1,_0x5790a3,_0x64ea6a,_0x264272){return asr(_0x6343a1,_0x5790a3,_0x64ea6a);}; \ 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 8df3c57..6410109 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 _0x0ea9=['exports','string','length','filepath\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','readFileSync','toString','LINEAR16','8000','url','bluebird','https://speech.googleapis.com'];(function(_0x303064,_0x12f0c2){var _0x5a1d3d=function(_0x5b9d81){while(--_0x5b9d81){_0x303064['push'](_0x303064['shift']());}};_0x5a1d3d(++_0x12f0c2);}(_0x0ea9,0xe7));var _0x90ea=function(_0x329a23,_0x447cfc){_0x329a23=_0x329a23-0x0;var _0x17b383=_0x0ea9[_0x329a23];return _0x17b383;};'use strict';var url=require(_0x90ea('0x0'));var BPromise=require(_0x90ea('0x1'));var fs=require('fs');var host=_0x90ea('0x2');module[_0x90ea('0x3')]=function(_0x20ef88,_0x479442,_0xe60bc7){return new BPromise(function(_0x58789d,_0x3be032){var _0x23c2a9;if(typeof _0x20ef88!==_0x90ea('0x4')||_0x20ef88[_0x90ea('0x5')]===0x0){return _0x3be032(_0x90ea('0x6'));}if(typeof _0x479442!==_0x90ea('0x4')||_0x479442[_0x90ea('0x5')]===0x0){return _0x3be032('key\x20should\x20be\x20a\x20string');}if(typeof _0xe60bc7!==_0x90ea('0x7')&&(typeof _0xe60bc7!==_0x90ea('0x4')||_0xe60bc7['length']===0x0)){return _0x3be032(_0x90ea('0x8'));}try{_0x23c2a9=fs[_0x90ea('0x9')](_0x20ef88)[_0x90ea('0xa')]('base64');}catch(_0x4b58db){return _0x3be032(_0x4b58db);}return _0x58789d({'method':'POST','uri':host+'/v1/speech:recognize?key='+_0x479442,'body':{'config':{'encoding':_0x90ea('0xb'),'sampleRateHertz':_0x90ea('0xc'),'languageCode':_0xe60bc7},'audio':{'content':_0x23c2a9}},'json':!![]});});}; \ No newline at end of file +var _0x9b00=['undefined','readFileSync','base64','POST','/v1/speech:recognize?key=','url','bluebird','exports','length','filepath\x20should\x20be\x20a\x20string','string','key\x20should\x20be\x20a\x20string'];(function(_0x5d6456,_0x58ecc7){var _0x4d66c1=function(_0x4335e3){while(--_0x4335e3){_0x5d6456['push'](_0x5d6456['shift']());}};_0x4d66c1(++_0x58ecc7);}(_0x9b00,0x13d));var _0x09b0=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x9b00[_0x465028];return _0xb783d4;};'use strict';var url=require(_0x09b0('0x0'));var BPromise=require(_0x09b0('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0x09b0('0x2')]=function(_0xc10b,_0x331fc3,_0x9d3ea2){return new BPromise(function(_0x53e450,_0x2f4e65){var _0x266d05;if(typeof _0xc10b!=='string'||_0xc10b[_0x09b0('0x3')]===0x0){return _0x2f4e65(_0x09b0('0x4'));}if(typeof _0x331fc3!==_0x09b0('0x5')||_0x331fc3[_0x09b0('0x3')]===0x0){return _0x2f4e65(_0x09b0('0x6'));}if(typeof _0x9d3ea2!==_0x09b0('0x7')&&(typeof _0x9d3ea2!=='string'||_0x9d3ea2[_0x09b0('0x3')]===0x0)){return _0x2f4e65('lang\x20should\x20be\x20a\x20string');}try{_0x266d05=fs[_0x09b0('0x8')](_0xc10b)['toString'](_0x09b0('0x9'));}catch(_0x4284c3){return _0x2f4e65(_0x4284c3);}return _0x53e450({'method':_0x09b0('0xa'),'uri':host+_0x09b0('0xb')+_0x331fc3,'body':{'config':{'encoding':'LINEAR16','sampleRateHertz':'8000','languageCode':_0x9d3ea2},'audio':{'content':_0x266d05}},'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 d097e75..62a5eae 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 _0x6a32=['./asr'];(function(_0x13843f,_0x50422d){var _0x1063ae=function(_0x12fd6b){while(--_0x12fd6b){_0x13843f['push'](_0x13843f['shift']());}};_0x1063ae(++_0x50422d);}(_0x6a32,0xd7));var _0x26a3=function(_0x660237,_0x465a6f){_0x660237=_0x660237-0x0;var _0x218abd=_0x6a32[_0x660237];return _0x218abd;};var asr=require(_0x26a3('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0x87ad=['./asr','exports'];(function(_0x49c204,_0xd7e4c5){var _0x43cca3=function(_0x5dd167){while(--_0x5dd167){_0x49c204['push'](_0x49c204['shift']());}};_0x43cca3(++_0xd7e4c5);}(_0x87ad,0x76));var _0xd87a=function(_0x26ac69,_0x305ae3){_0x26ac69=_0x26ac69-0x0;var _0x46a53b=_0x87ad[_0x26ac69];return _0x46a53b;};var asr=require(_0xd87a('0x0'));module[_0xd87a('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 16414a6..3905be0 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 _0x24a0=['unlink','pipe','data','end','wav','finish\x20to\x20convert','start','resolve','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','?key=','ssml','input','voice','audioConfig','MP3','text:synthesize','from','writeFile','googleTTS','tmp','.mp3','goggleTTS\x20path','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','result','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','asr','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','stringify','ispeechTTS','format','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','text','channelData','CustomAction','AudioFromTts','Data','audiofile','path','http','url','parse','bluebird','randomstring','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','error','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close'];(function(_0x52cfab,_0x1034b5){var _0x58f135=function(_0x430b73){while(--_0x430b73){_0x52cfab['push'](_0x52cfab['shift']());}};_0x58f135(++_0x1034b5);}(_0x24a0,0x11e));var _0x024a=function(_0x41f290,_0x2d9a76){_0x41f290=_0x41f290-0x0;var _0x4fb9bf=_0x24a0[_0x41f290];return _0x4fb9bf;};'use strict';var fs=require('fs');var path=require(_0x024a('0x0'));var http=require(_0x024a('0x1'));var https=require('https');var urlParse=require(_0x024a('0x2'))[_0x024a('0x3')];var BPromise=require(_0x024a('0x4'));var rs=require(_0x024a('0x5'));var sox=require('sox');var rp=require('request-promise');var util=require('util');var querystring=require(_0x024a('0x6'));var tts=require(_0x024a('0x7'));var apiai=require(_0x024a('0x8'));var md5=require(_0x024a('0x9'));var google=require(_0x024a('0xa'));var aws=require(_0x024a('0xb'));var tilde=require(_0x024a('0xc'));var sestek=require(_0x024a('0xd'));var logger=require(_0x024a('0xe'))(_0x024a('0xf'));var ISPEECH_API=_0x024a('0x10');function downloadFile(_0x4e87a7,_0x3a9113){return new BPromise(function(_0x243632,_0x4763d8){var _0x292d1=urlParse(_0x4e87a7);var _0x48d9da=_0x292d1[_0x024a('0x11')]===_0x024a('0x12')?https:http;var _0x35477b={'host':_0x292d1[_0x024a('0x13')],'path':_0x292d1[_0x024a('0x0')],'headers':{'user-agent':_0x024a('0x14')}};_0x48d9da[_0x024a('0x15')](_0x35477b,function(_0x3b7fea){if(_0x3b7fea['statusCode']!==0xc8){logger[_0x024a('0x16')]('request\x20to\x20'+_0x4e87a7+'\x20failed,\x20status\x20code\x20=\x20'+_0x3b7fea[_0x024a('0x17')]+'\x20('+_0x3b7fea['statusMessage']+')');_0x4763d8(new Error(_0x024a('0x18')+_0x4e87a7+_0x024a('0x19')+_0x3b7fea[_0x024a('0x17')]+'\x20('+_0x3b7fea[_0x024a('0x1a')]+')'));return;}var _0x251d5d=fs[_0x024a('0x1b')](_0x3a9113);_0x251d5d['on'](_0x024a('0x1c'),function(){logger[_0x024a('0x1d')](_0x024a('0x1e'));_0x251d5d[_0x024a('0x1f')](_0x243632);});_0x251d5d['on'](_0x024a('0x16'),function(_0x145562){fs[_0x024a('0x20')](_0x3a9113);logger[_0x024a('0x16')]('download\x20error',_0x145562);_0x4763d8(_0x145562);});_0x3b7fea[_0x024a('0x21')](_0x251d5d);})['on'](_0x024a('0x16'),function(_0x545a84){logger[_0x024a('0x16')](_0x545a84);_0x4763d8(_0x545a84);})['end']();});}function uploadFile(_0xaf44d1){return new BPromise(function(_0x2f05fe,_0x2bdabb){var _0x1442f6=urlParse(_0xaf44d1);var _0xc8e65e=_0x1442f6[_0x024a('0x11')]==='https:'?https:http;var _0x4896f5={'host':_0x1442f6[_0x024a('0x13')],'path':_0x1442f6['path'],'headers':{'user-agent':_0x024a('0x14')}};_0xc8e65e['get'](_0x4896f5,function(_0x45ceaf){if(_0x45ceaf['statusCode']!==0xc8){_0x2bdabb(new Error(_0x024a('0x18')+_0xaf44d1+_0x024a('0x19')+_0x45ceaf[_0x024a('0x17')]+'\x20('+_0x45ceaf[_0x024a('0x1a')]+')'));return;}var _0xad7242='';_0x45ceaf['on'](_0x024a('0x22'),function(_0x443ef6){_0xad7242+=_0x443ef6;});_0x45ceaf['on'](_0x024a('0x23'),function(){_0x2f05fe(_0xad7242);});})['on'](_0x024a('0x16'),function(_0x4f712f){_0x2bdabb(_0x4f712f);})[_0x024a('0x23')]();});}function convertFile(_0x516a0c,_0x189995){return new BPromise(function(_0x14ea2c,_0x50d7d8){var _0x437835=sox['transcode'](_0x516a0c,_0x189995,{'sampleRate':0x1f40,'format':_0x024a('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x437835['on'](_0x024a('0x16'),function(_0xe251b4){logger['error']('error\x20convert',_0xe251b4);_0x50d7d8(_0xe251b4);});_0x437835['on'](_0x024a('0x23'),function(){logger[_0x024a('0x1d')](_0x024a('0x25'));_0x14ea2c();});_0x437835[_0x024a('0x26')]();});}function base64Decode(_0x8c299b,_0x320ba9){var _0x4dc14b=path[_0x024a('0x27')](__dirname,'tmp',rs[_0x024a('0x28')](0x4)+_0x024a('0x29'));fs[_0x024a('0x2a')](_0x4dc14b,_0x8c299b,_0x024a('0x2b'));return convertFile(_0x4dc14b,_0x320ba9)[_0x024a('0x2c')](function(){try{fs[_0x024a('0x20')](_0x4dc14b);fs[_0x024a('0x2d')](_0x320ba9,_0x024a('0x2e'));}catch(_0x477bd9){logger['error'](_0x477bd9);}return _0x320ba9[_0x024a('0x2f')]('.')[0x0];});}function base64Encode(_0x1262ab){var _0x373bea=fs[_0x024a('0x30')](_0x1262ab);return new Buffer(_0x373bea)[_0x024a('0x31')](_0x024a('0x2b'));}exports['googleCloudTTS']=function(_0x2a6dd5,_0x5d29ef,_0x40b8dd,_0x239f88,_0x4e625a,_0x362c6a){var _0x2b2226,_0x3b961a;var _0x5dd266='https://texttospeech.googleapis.com/v1/';var _0x2b9e71=_0x024a('0x32')+_0x2a6dd5;var _0x5d7bb8={};if(_0x5d29ef===_0x024a('0x33')){_0x5d7bb8['input']={'ssml':_0x40b8dd};}else{_0x5d7bb8[_0x024a('0x34')]={'text':_0x40b8dd};};_0x5d7bb8[_0x024a('0x35')]={'languageCode':_0x239f88,'ssmlGender':_0x4e625a};_0x5d7bb8[_0x024a('0x36')]={'audioEncoding':_0x024a('0x37'),'sampleRateHertz':0x1f40};var _0xac5199={'url':_0x5dd266+_0x024a('0x38')+_0x2b9e71,'method':'POST','json':!![],'body':_0x5d7bb8};return rp(_0xac5199)[_0x024a('0x2c')](function(_0x1b2d0e){return new BPromise(function(_0x2c0698,_0x3fcbcd){_0x2b2226=path[_0x024a('0x27')](__dirname,'tmp',rs[_0x024a('0x28')](0x4)+'.mp3');var _0x30c42e=Buffer[_0x024a('0x39')](_0x1b2d0e['audioContent'],_0x024a('0x2b'));return fs[_0x024a('0x3a')](_0x2b2226,_0x30c42e,function(_0x3a9a24){_0x3fcbcd(_0x3a9a24);},function(_0x358f18){fs[_0x024a('0x2d')](_0x2b2226,_0x024a('0x2e'));_0x2c0698(_0x358f18);});});})[_0x024a('0x2c')](function(_0x50e17f){_0x3b961a=path[_0x024a('0x27')](__dirname,'tmp',rs[_0x024a('0x28')](0x4)+'.wav');return convertFile(_0x2b2226,_0x3b961a);})[_0x024a('0x2c')](function(){try{fs[_0x024a('0x20')](_0x2b2226);fs[_0x024a('0x2d')](_0x3b961a,_0x024a('0x2e'));}catch(_0x248c18){logger[_0x024a('0x16')](_0x248c18);}logger[_0x024a('0x1d')]('googleCloudTTS\x20path',_0x3b961a['split']('.')[0x0]);return _0x3b961a[_0x024a('0x2f')]('.')[0x0];});};exports[_0x024a('0x3b')]=function(_0x169f38,_0x57e9ee){var _0xac43e9,_0xd5def0;return tts(_0x169f38,_0x57e9ee||'en',0x1)[_0x024a('0x2c')](function(_0xcbbcbf){logger[_0x024a('0x1d')](_0xcbbcbf);_0xac43e9=path[_0x024a('0x27')](__dirname,_0x024a('0x3c'),rs['generate'](0x4)+_0x024a('0x3d'));return downloadFile(_0xcbbcbf,_0xac43e9);})[_0x024a('0x2c')](function(){_0xd5def0=path[_0x024a('0x27')](__dirname,_0x024a('0x3c'),rs[_0x024a('0x28')](0x4)+_0x024a('0x29'));return convertFile(_0xac43e9,_0xd5def0);})['then'](function(){try{fs[_0x024a('0x20')](_0xac43e9);fs[_0x024a('0x2d')](_0xd5def0,'777');}catch(_0x46fa54){logger[_0x024a('0x16')](_0x46fa54);}logger[_0x024a('0x1d')](_0x024a('0x3e'),_0xd5def0[_0x024a('0x2f')]('.')[0x0]);return _0xd5def0[_0x024a('0x2f')]('.')[0x0];});};exports['googleASR']=function(_0x2fb4d5,_0x32e810,_0x4bb498){return google['asr'](_0x2fb4d5,_0x32e810,_0x4bb498)[_0x024a('0x2c')](function(_0x2db528){logger[_0x024a('0x1d')](_0x2db528['uri']);return rp(_0x2db528);})[_0x024a('0x2c')](function(_0x22b6f){var _0x4a169b='';var _0x2fefff=0x0;try{fs[_0x024a('0x20')](_0x2fb4d5);}catch(_0x3a2af2){logger[_0x024a('0x16')](_0x3a2af2);}if(_0x22b6f&&_0x22b6f['results']){_0x4a169b=_0x22b6f[_0x024a('0x3f')]['map'](function(_0x19211e){return _0x19211e&&_0x19211e[_0x024a('0x40')][0x0]&&_0x19211e[_0x024a('0x40')][0x0][_0x024a('0x41')]?_0x19211e[_0x024a('0x40')][0x0][_0x024a('0x41')]:'';})[_0x024a('0x42')]('\x0a');_0x2fefff=_0x22b6f[_0x024a('0x3f')]['map'](function(_0x173c7b){return _0x173c7b&&_0x173c7b[_0x024a('0x40')][0x0]&&_0x173c7b[_0x024a('0x40')][0x0][_0x024a('0x43')]?_0x173c7b['alternatives'][0x0][_0x024a('0x43')]:0x0;})[_0x024a('0x42')]('\x0a');}logger[_0x024a('0x1d')](_0x024a('0x44'),_0x4a169b);logger['info'](_0x024a('0x45'),_0x2fefff);return{'transcript':_0x4a169b,'confidence':_0x2fefff};})[_0x024a('0x46')](function(_0x4b010a){logger[_0x024a('0x16')](_0x024a('0x47'),_0x4b010a[_0x024a('0x17')],_0x4b010a[_0x024a('0x48')],_0x4b010a[_0x024a('0x49')]);});};exports[_0x024a('0x4a')]=function(_0x492525,_0x583229,_0x3a1eb0,_0x1cb744){var _0x31cad3=apiai(_0x583229,{'language':_0x1cb744||'en'});return _0x31cad3[_0x024a('0x4b')](_0x3a1eb0,{'sessionId':md5(_0x492525)})[_0x024a('0x2c')](function(_0x15969a){logger[_0x024a('0x1d')](JSON['stringify'](_0x15969a));return{'source':_0x15969a['result']['source'],'resolvedQuery':_0x15969a[_0x024a('0x4c')][_0x024a('0x4d')],'action':_0x15969a[_0x024a('0x4c')]['action'],'actionIncomplete':_0x15969a[_0x024a('0x4c')][_0x024a('0x4e')],'speech':_0x15969a[_0x024a('0x4c')][_0x024a('0x4f')][_0x024a('0x50')],'score':_0x15969a[_0x024a('0x4c')][_0x024a('0x51')],'statusCode':_0x15969a[_0x024a('0x52')][_0x024a('0x53')],'endConversation':_0x15969a[_0x024a('0x4c')][_0x024a('0x54')][_0x024a('0x55')]||![],'isFallbackIntent':_0x15969a[_0x024a('0x4c')][_0x024a('0x54')][_0x024a('0x56')]};});};exports['tildeASR']=function(_0x136a49,_0x1b9bee,_0x19d989,_0x465eb3){return tilde[_0x024a('0x57')](_0x136a49,_0x1b9bee,_0x19d989,_0x465eb3)['then'](function(_0x346546){try{fs[_0x024a('0x20')](_0x136a49);}catch(_0x4ce504){logger[_0x024a('0x16')](_0x4ce504);}logger['info']('Tilde\x20ASR\x20transcription',_0x346546[_0x024a('0x41')]);logger['info'](_0x024a('0x58'),_0x346546[_0x024a('0x43')]);return _0x346546;});};exports[_0x024a('0x59')]=function(_0x444905,_0x3a940c,_0x20db5c,_0x5c106c,_0x43e64f,_0x5d1a56){var _0x37366e=path[_0x024a('0x27')](__dirname,_0x024a('0x3c'),rs[_0x024a('0x28')](0x4)+_0x024a('0x3d'));var _0x30dcf6;return aws[_0x024a('0x5a')](_0x444905,_0x3a940c,_0x20db5c,_0x5c106c,_0x43e64f,_0x5d1a56,_0x37366e)[_0x024a('0x2c')](function(){_0x30dcf6=path['resolve'](__dirname,'tmp',rs[_0x024a('0x28')](0x4)+_0x024a('0x29'));return convertFile(_0x37366e,_0x30dcf6);})[_0x024a('0x2c')](function(){try{fs['unlink'](_0x37366e);fs['chmodSync'](_0x30dcf6,_0x024a('0x2e'));}catch(_0x315319){logger[_0x024a('0x16')](_0x315319);}return _0x30dcf6[_0x024a('0x2f')]('.')[0x0];});};exports[_0x024a('0x5b')]=function(_0x2127b4,_0x573032,_0x4f9caa,_0x3b5d01,_0x3dbf83,_0x313c36){return aws[_0x024a('0x5c')](_0x2127b4,_0x573032,_0x4f9caa,_0x3b5d01,_0x3dbf83,_0x313c36)[_0x024a('0x2c')](function(_0x46a7b3){logger[_0x024a('0x1d')](JSON[_0x024a('0x5d')](_0x46a7b3));return _0x46a7b3;});};exports[_0x024a('0x5e')]=function(_0x5ee77f,_0x573af7,_0x54730e,_0x434771){var _0x2db167=util[_0x024a('0x5f')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x5ee77f,encodeURIComponent(_0x573af7),_0x54730e,_0x434771);var _0x1932b1=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x024a('0x3d'));var _0x52d26b;return downloadFile(_0x2db167,_0x1932b1)[_0x024a('0x2c')](function(){_0x52d26b=path['resolve'](__dirname,_0x024a('0x3c'),rs[_0x024a('0x28')](0x4)+'.wav');return convertFile(_0x1932b1,_0x52d26b);})[_0x024a('0x2c')](function(){try{fs[_0x024a('0x20')](_0x1932b1);fs[_0x024a('0x2d')](_0x52d26b,_0x024a('0x2e'));}catch(_0xe911aa){logger[_0x024a('0x16')](_0xe911aa);}return _0x52d26b[_0x024a('0x2f')]('.')[0x0];});};exports['ispeechASR']=function(_0x239e19,_0xebf805,_0x17b641,_0x139aac){var _0x328b4c=util[_0x024a('0x5f')](_0x024a('0x60'),ISPEECH_API,_0xebf805,_0x17b641,base64Encode(_0x239e19),_0x139aac?util['format'](_0x024a('0x61'),encodeURIComponent(_0x139aac)):_0x024a('0x62'));return uploadFile(_0x328b4c)[_0x024a('0x2c')](function(_0x587aad){return querystring['parse'](_0x587aad);});};exports[_0x024a('0x63')]=function(_0x83c813,_0x3948c5){return sestek['nda'](_0x83c813,_0x3948c5)[_0x024a('0x2c')](function(_0x51e8c9){logger['info'](JSON['stringify'](_0x51e8c9));var _0x57b506={'speech':_0x51e8c9[_0x024a('0x64')],'action':_0x51e8c9[_0x024a('0x65')]?_0x51e8c9[_0x024a('0x65')][_0x024a('0x66')]:undefined,'actiondata':_0x51e8c9[_0x024a('0x65')]?_0x51e8c9[_0x024a('0x65')]['CustomActionData']:undefined};if(_0x51e8c9[_0x024a('0x65')]&&_0x51e8c9[_0x024a('0x65')][_0x024a('0x67')]){return base64Decode(_0x51e8c9[_0x024a('0x65')][_0x024a('0x67')][_0x024a('0x68')],path[_0x024a('0x27')](__dirname,_0x024a('0x3c'),rs[_0x024a('0x28')](0x4)+'.wav'))['then'](function(_0x17bb5c){_0x57b506[_0x024a('0x69')]=_0x17bb5c;return _0x57b506;});}return _0x57b506;});};exports['dirName']=function(){return __dirname;}; \ No newline at end of file +var _0xb015=['createWriteStream','finish','info','close','unlink','download\x20error','pipe','end','transcode','finish\x20to\x20convert','start','resolve','tmp','generate','.wav','writeFileSync','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','input','audioConfig','text:synthesize','.mp3','from','audioContent','goggleTTS\x20path','googleASR','uri','map','alternatives','transcript','join','results','confidence','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment','speech','score','status','code','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','awsLex','lex','format','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','sestekNDA','text','channelData','CustomActionData','Data','audiofile','dirName','path','http','https','url','bluebird','querystring','google-tts-api','apiai-promise','md5','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','error','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage'];(function(_0x451792,_0x42ba54){var _0x4dbbe0=function(_0x394263){while(--_0x394263){_0x451792['push'](_0x451792['shift']());}};_0x4dbbe0(++_0x42ba54);}(_0xb015,0x1ef));var _0x5b01=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0xb015[_0x16d10f];return _0x50c823;};'use strict';var fs=require('fs');var path=require(_0x5b01('0x0'));var http=require(_0x5b01('0x1'));var https=require(_0x5b01('0x2'));var urlParse=require(_0x5b01('0x3'))['parse'];var BPromise=require(_0x5b01('0x4'));var rs=require('randomstring');var sox=require('sox');var rp=require('request-promise');var util=require('util');var querystring=require(_0x5b01('0x5'));var tts=require(_0x5b01('0x6'));var apiai=require(_0x5b01('0x7'));var md5=require(_0x5b01('0x8'));var google=require('./google');var aws=require(_0x5b01('0x9'));var tilde=require(_0x5b01('0xa'));var sestek=require(_0x5b01('0xb'));var logger=require(_0x5b01('0xc'))(_0x5b01('0xd'));var ISPEECH_API=_0x5b01('0xe');function downloadFile(_0x12c70b,_0xfe6712){return new BPromise(function(_0x2f4f42,_0x5c68c3){var _0xedb664=urlParse(_0x12c70b);var _0x250357=_0xedb664[_0x5b01('0xf')]===_0x5b01('0x10')?https:http;var _0x52ca46={'host':_0xedb664[_0x5b01('0x11')],'path':_0xedb664[_0x5b01('0x0')],'headers':{'user-agent':_0x5b01('0x12')}};_0x250357[_0x5b01('0x13')](_0x52ca46,function(_0x4bd77a){if(_0x4bd77a[_0x5b01('0x14')]!==0xc8){logger[_0x5b01('0x15')](_0x5b01('0x16')+_0x12c70b+_0x5b01('0x17')+_0x4bd77a[_0x5b01('0x14')]+'\x20('+_0x4bd77a[_0x5b01('0x18')]+')');_0x5c68c3(new Error(_0x5b01('0x16')+_0x12c70b+_0x5b01('0x17')+_0x4bd77a[_0x5b01('0x14')]+'\x20('+_0x4bd77a['statusMessage']+')'));return;}var _0x4c6b62=fs[_0x5b01('0x19')](_0xfe6712);_0x4c6b62['on'](_0x5b01('0x1a'),function(){logger[_0x5b01('0x1b')]('finish\x20download\x20file');_0x4c6b62[_0x5b01('0x1c')](_0x2f4f42);});_0x4c6b62['on'](_0x5b01('0x15'),function(_0x69649b){fs[_0x5b01('0x1d')](_0xfe6712);logger[_0x5b01('0x15')](_0x5b01('0x1e'),_0x69649b);_0x5c68c3(_0x69649b);});_0x4bd77a[_0x5b01('0x1f')](_0x4c6b62);})['on'](_0x5b01('0x15'),function(_0x36deaf){logger[_0x5b01('0x15')](_0x36deaf);_0x5c68c3(_0x36deaf);})[_0x5b01('0x20')]();});}function uploadFile(_0x10b5fa){return new BPromise(function(_0xde57ff,_0x5083d7){var _0x4b8406=urlParse(_0x10b5fa);var _0x25344b=_0x4b8406[_0x5b01('0xf')]==='https:'?https:http;var _0x97a5b9={'host':_0x4b8406['host'],'path':_0x4b8406[_0x5b01('0x0')],'headers':{'user-agent':_0x5b01('0x12')}};_0x25344b['get'](_0x97a5b9,function(_0x518f8c){if(_0x518f8c[_0x5b01('0x14')]!==0xc8){_0x5083d7(new Error(_0x5b01('0x16')+_0x10b5fa+_0x5b01('0x17')+_0x518f8c[_0x5b01('0x14')]+'\x20('+_0x518f8c[_0x5b01('0x18')]+')'));return;}var _0x316112='';_0x518f8c['on']('data',function(_0x3cc15b){_0x316112+=_0x3cc15b;});_0x518f8c['on'](_0x5b01('0x20'),function(){_0xde57ff(_0x316112);});})['on']('error',function(_0x3f801a){_0x5083d7(_0x3f801a);})[_0x5b01('0x20')]();});}function convertFile(_0x257e7b,_0x4d226c){return new BPromise(function(_0x34db31,_0x4a23d2){var _0x533f76=sox[_0x5b01('0x21')](_0x257e7b,_0x4d226c,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x533f76['on']('error',function(_0x476c20){logger[_0x5b01('0x15')]('error\x20convert',_0x476c20);_0x4a23d2(_0x476c20);});_0x533f76['on'](_0x5b01('0x20'),function(){logger[_0x5b01('0x1b')](_0x5b01('0x22'));_0x34db31();});_0x533f76[_0x5b01('0x23')]();});}function base64Decode(_0x3bbdee,_0x9c9b0a){var _0x152d4d=path[_0x5b01('0x24')](__dirname,_0x5b01('0x25'),rs[_0x5b01('0x26')](0x4)+_0x5b01('0x27'));fs[_0x5b01('0x28')](_0x152d4d,_0x3bbdee,_0x5b01('0x29'));return convertFile(_0x152d4d,_0x9c9b0a)[_0x5b01('0x2a')](function(){try{fs[_0x5b01('0x1d')](_0x152d4d);fs[_0x5b01('0x2b')](_0x9c9b0a,_0x5b01('0x2c'));}catch(_0x1b78a3){logger[_0x5b01('0x15')](_0x1b78a3);}return _0x9c9b0a[_0x5b01('0x2d')]('.')[0x0];});}function base64Encode(_0x55621){var _0x443e28=fs[_0x5b01('0x2e')](_0x55621);return new Buffer(_0x443e28)[_0x5b01('0x2f')]('base64');}exports[_0x5b01('0x30')]=function(_0x223e06,_0x2edf43,_0x10bd15,_0x4bb651,_0x5630ad,_0x581ab9){var _0x496daa,_0x4cf8ba;var _0x245b65=_0x5b01('0x31');var _0x5d84d4=_0x5b01('0x32')+_0x223e06;var _0x30800b={};if(_0x2edf43===_0x5b01('0x33')){_0x30800b[_0x5b01('0x34')]={'ssml':_0x10bd15};}else{_0x30800b['input']={'text':_0x10bd15};};_0x30800b['voice']={'languageCode':_0x4bb651,'ssmlGender':_0x5630ad};_0x30800b[_0x5b01('0x35')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x33cb7e={'url':_0x245b65+_0x5b01('0x36')+_0x5d84d4,'method':'POST','json':!![],'body':_0x30800b};return rp(_0x33cb7e)[_0x5b01('0x2a')](function(_0x2b09ac){return new BPromise(function(_0x443e93,_0x458b8a){_0x496daa=path['resolve'](__dirname,_0x5b01('0x25'),rs[_0x5b01('0x26')](0x4)+_0x5b01('0x37'));var _0x257601=Buffer[_0x5b01('0x38')](_0x2b09ac[_0x5b01('0x39')],'base64');return fs['writeFile'](_0x496daa,_0x257601,function(_0x180894){_0x458b8a(_0x180894);},function(_0x47a736){fs[_0x5b01('0x2b')](_0x496daa,_0x5b01('0x2c'));_0x443e93(_0x47a736);});});})[_0x5b01('0x2a')](function(_0x2afb56){_0x4cf8ba=path[_0x5b01('0x24')](__dirname,_0x5b01('0x25'),rs[_0x5b01('0x26')](0x4)+_0x5b01('0x27'));return convertFile(_0x496daa,_0x4cf8ba);})[_0x5b01('0x2a')](function(){try{fs[_0x5b01('0x1d')](_0x496daa);fs['chmodSync'](_0x4cf8ba,'777');}catch(_0x5c479d){logger[_0x5b01('0x15')](_0x5c479d);}logger[_0x5b01('0x1b')]('googleCloudTTS\x20path',_0x4cf8ba[_0x5b01('0x2d')]('.')[0x0]);return _0x4cf8ba[_0x5b01('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x39c105,_0x356b46){var _0x2217c4,_0x26b302;return tts(_0x39c105,_0x356b46||'en',0x1)[_0x5b01('0x2a')](function(_0x1ca4e9){logger[_0x5b01('0x1b')](_0x1ca4e9);_0x2217c4=path['resolve'](__dirname,_0x5b01('0x25'),rs['generate'](0x4)+_0x5b01('0x37'));return downloadFile(_0x1ca4e9,_0x2217c4);})[_0x5b01('0x2a')](function(){_0x26b302=path[_0x5b01('0x24')](__dirname,_0x5b01('0x25'),rs[_0x5b01('0x26')](0x4)+_0x5b01('0x27'));return convertFile(_0x2217c4,_0x26b302);})[_0x5b01('0x2a')](function(){try{fs[_0x5b01('0x1d')](_0x2217c4);fs[_0x5b01('0x2b')](_0x26b302,_0x5b01('0x2c'));}catch(_0x31124c){logger[_0x5b01('0x15')](_0x31124c);}logger[_0x5b01('0x1b')](_0x5b01('0x3a'),_0x26b302[_0x5b01('0x2d')]('.')[0x0]);return _0x26b302[_0x5b01('0x2d')]('.')[0x0];});};exports[_0x5b01('0x3b')]=function(_0x3a9d6a,_0x950601,_0x8ea902){return google['asr'](_0x3a9d6a,_0x950601,_0x8ea902)[_0x5b01('0x2a')](function(_0x2edf84){logger[_0x5b01('0x1b')](_0x2edf84[_0x5b01('0x3c')]);return rp(_0x2edf84);})[_0x5b01('0x2a')](function(_0x39febb){var _0x369a65='';var _0x569720=0x0;try{fs[_0x5b01('0x1d')](_0x3a9d6a);}catch(_0x507a94){logger[_0x5b01('0x15')](_0x507a94);}if(_0x39febb&&_0x39febb['results']){_0x369a65=_0x39febb['results'][_0x5b01('0x3d')](function(_0x1509ec){return _0x1509ec&&_0x1509ec[_0x5b01('0x3e')][0x0]&&_0x1509ec['alternatives'][0x0][_0x5b01('0x3f')]?_0x1509ec[_0x5b01('0x3e')][0x0][_0x5b01('0x3f')]:'';})[_0x5b01('0x40')]('\x0a');_0x569720=_0x39febb[_0x5b01('0x41')]['map'](function(_0x4de336){return _0x4de336&&_0x4de336[_0x5b01('0x3e')][0x0]&&_0x4de336['alternatives'][0x0][_0x5b01('0x42')]?_0x4de336[_0x5b01('0x3e')][0x0][_0x5b01('0x42')]:0x0;})[_0x5b01('0x40')]('\x0a');}logger[_0x5b01('0x1b')](_0x5b01('0x43'),_0x369a65);logger[_0x5b01('0x1b')]('googleASR\x20confidence',_0x569720);return{'transcript':_0x369a65,'confidence':_0x569720};})[_0x5b01('0x44')](function(_0x5e64ae){logger[_0x5b01('0x15')](_0x5b01('0x45'),_0x5e64ae[_0x5b01('0x14')],_0x5e64ae[_0x5b01('0x46')],_0x5e64ae[_0x5b01('0x47')]);});};exports[_0x5b01('0x48')]=function(_0x4e7bee,_0x33a968,_0x5ee865,_0x2d0f1b){var _0x3a6859=apiai(_0x33a968,{'language':_0x2d0f1b||'en'});return _0x3a6859[_0x5b01('0x49')](_0x5ee865,{'sessionId':md5(_0x4e7bee)})[_0x5b01('0x2a')](function(_0x24e73d){logger['info'](JSON[_0x5b01('0x4a')](_0x24e73d));return{'source':_0x24e73d[_0x5b01('0x4b')][_0x5b01('0x4c')],'resolvedQuery':_0x24e73d[_0x5b01('0x4b')][_0x5b01('0x4d')],'action':_0x24e73d[_0x5b01('0x4b')]['action'],'actionIncomplete':_0x24e73d[_0x5b01('0x4b')][_0x5b01('0x4e')],'speech':_0x24e73d['result'][_0x5b01('0x4f')][_0x5b01('0x50')],'score':_0x24e73d[_0x5b01('0x4b')][_0x5b01('0x51')],'statusCode':_0x24e73d[_0x5b01('0x52')][_0x5b01('0x53')],'endConversation':_0x24e73d[_0x5b01('0x4b')]['metadata'][_0x5b01('0x54')]||![],'isFallbackIntent':_0x24e73d[_0x5b01('0x4b')]['metadata'][_0x5b01('0x55')]};});};exports[_0x5b01('0x56')]=function(_0x141b21,_0x14abbf,_0x1aeb9e,_0x342ac5){return tilde['asr'](_0x141b21,_0x14abbf,_0x1aeb9e,_0x342ac5)[_0x5b01('0x2a')](function(_0x38965b){try{fs[_0x5b01('0x1d')](_0x141b21);}catch(_0x3d9499){logger[_0x5b01('0x15')](_0x3d9499);}logger[_0x5b01('0x1b')](_0x5b01('0x57'),_0x38965b[_0x5b01('0x3f')]);logger[_0x5b01('0x1b')](_0x5b01('0x58'),_0x38965b[_0x5b01('0x42')]);return _0x38965b;});};exports[_0x5b01('0x59')]=function(_0x2bdf94,_0x3b5a29,_0x38aa90,_0x2987a8,_0x1c663c,_0x1ffc60){var _0x1748a9=path[_0x5b01('0x24')](__dirname,_0x5b01('0x25'),rs[_0x5b01('0x26')](0x4)+_0x5b01('0x37'));var _0x46d5c8;return aws[_0x5b01('0x5a')](_0x2bdf94,_0x3b5a29,_0x38aa90,_0x2987a8,_0x1c663c,_0x1ffc60,_0x1748a9)[_0x5b01('0x2a')](function(){_0x46d5c8=path[_0x5b01('0x24')](__dirname,_0x5b01('0x25'),rs['generate'](0x4)+_0x5b01('0x27'));return convertFile(_0x1748a9,_0x46d5c8);})[_0x5b01('0x2a')](function(){try{fs[_0x5b01('0x1d')](_0x1748a9);fs[_0x5b01('0x2b')](_0x46d5c8,_0x5b01('0x2c'));}catch(_0x16e3b3){logger[_0x5b01('0x15')](_0x16e3b3);}return _0x46d5c8['split']('.')[0x0];});};exports[_0x5b01('0x5b')]=function(_0x4f280c,_0x30ce1a,_0x1114f4,_0x144ccc,_0x21c2f6,_0x34fd16){return aws[_0x5b01('0x5c')](_0x4f280c,_0x30ce1a,_0x1114f4,_0x144ccc,_0x21c2f6,_0x34fd16)[_0x5b01('0x2a')](function(_0x546759){logger[_0x5b01('0x1b')](JSON[_0x5b01('0x4a')](_0x546759));return _0x546759;});};exports['ispeechTTS']=function(_0x6cad29,_0x2685df,_0x41caa4,_0x117261){var _0x2ab92a=util[_0x5b01('0x5d')]('%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3',ISPEECH_API,_0x6cad29,encodeURIComponent(_0x2685df),_0x41caa4,_0x117261);var _0x1fab7c=path[_0x5b01('0x24')](__dirname,_0x5b01('0x25'),rs[_0x5b01('0x26')](0x4)+_0x5b01('0x37'));var _0x4db9ab;return downloadFile(_0x2ab92a,_0x1fab7c)[_0x5b01('0x2a')](function(){_0x4db9ab=path[_0x5b01('0x24')](__dirname,'tmp',rs['generate'](0x4)+_0x5b01('0x27'));return convertFile(_0x1fab7c,_0x4db9ab);})[_0x5b01('0x2a')](function(){try{fs[_0x5b01('0x1d')](_0x1fab7c);fs[_0x5b01('0x2b')](_0x4db9ab,_0x5b01('0x2c'));}catch(_0x5836f4){logger[_0x5b01('0x15')](_0x5836f4);}return _0x4db9ab[_0x5b01('0x2d')]('.')[0x0];});};exports[_0x5b01('0x5e')]=function(_0x3b2564,_0xb4fa47,_0x50b989,_0x47267b){var _0x43dc36=util['format'](_0x5b01('0x5f'),ISPEECH_API,_0xb4fa47,_0x50b989,base64Encode(_0x3b2564),_0x47267b?util[_0x5b01('0x5d')](_0x5b01('0x60'),encodeURIComponent(_0x47267b)):'freeform=3');return uploadFile(_0x43dc36)['then'](function(_0x119964){return querystring['parse'](_0x119964);});};exports[_0x5b01('0x61')]=function(_0x5d9abd,_0x5e18ef){return sestek['nda'](_0x5d9abd,_0x5e18ef)[_0x5b01('0x2a')](function(_0x3db33e){logger[_0x5b01('0x1b')](JSON['stringify'](_0x3db33e));var _0xc4fec7={'speech':_0x3db33e[_0x5b01('0x62')],'action':_0x3db33e[_0x5b01('0x63')]?_0x3db33e[_0x5b01('0x63')]['CustomAction']:undefined,'actiondata':_0x3db33e['channelData']?_0x3db33e[_0x5b01('0x63')][_0x5b01('0x64')]:undefined};if(_0x3db33e['channelData']&&_0x3db33e[_0x5b01('0x63')]['AudioFromTts']){return base64Decode(_0x3db33e[_0x5b01('0x63')]['AudioFromTts'][_0x5b01('0x65')],path['resolve'](__dirname,_0x5b01('0x25'),rs['generate'](0x4)+_0x5b01('0x27')))[_0x5b01('0x2a')](function(_0x58d499){_0xc4fec7[_0x5b01('0x66')]=_0x58d499;return _0xc4fec7;});}return _0xc4fec7;});};exports[_0x5b01('0x67')]=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 429f05f..6af5ff9 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 _0x1bea=['exports','./nda'];(function(_0x3be43b,_0x3c10b3){var _0x2dc567=function(_0x2c33e8){while(--_0x2c33e8){_0x3be43b['push'](_0x3be43b['shift']());}};_0x2dc567(++_0x3c10b3);}(_0x1bea,0x18f));var _0xa1be=function(_0x5e429d,_0x2aad4e){_0x5e429d=_0x5e429d-0x0;var _0x2c962e=_0x1bea[_0x5e429d];return _0x2c962e;};var nda=require(_0xa1be('0x0'));module[_0xa1be('0x1')]={'nda':nda}; \ No newline at end of file +var _0xc59e=['exports'];(function(_0x55cfc6,_0x25efbf){var _0x18ba95=function(_0x13ab15){while(--_0x13ab15){_0x55cfc6['push'](_0x55cfc6['shift']());}};_0x18ba95(++_0x25efbf);}(_0xc59e,0xee));var _0xec59=function(_0x37f00d,_0x5bbe7a){_0x37f00d=_0x37f00d-0x0;var _0x1b96b0=_0xc59e[_0x37f00d];return _0x1b96b0;};var nda=require('./nda');module[_0xec59('0x0')]={'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 efc8844..71f4237 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 _0xc84a=['Bearer\x20','access_token','body','channelData','project','ndagenerate_audio','AudioOutputSettings','audio/wav','CustomAction','custom_action','custom_action_data','CustomActionData','info','stringify','request-promise','../../../../../config/logger','agi','exports','ndauth_url','/token','password','POST','resolve','ndassistant_url','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension'];(function(_0x24f31b,_0x44b8f3){var _0x488401=function(_0x204caf){while(--_0x204caf){_0x24f31b['push'](_0x24f31b['shift']());}};_0x488401(++_0x44b8f3);}(_0xc84a,0x106));var _0xac84=function(_0x350619,_0x43e341){_0x350619=_0x350619-0x0;var _0x45682c=_0xc84a[_0x350619];return _0x45682c;};'use strict';var rp=require(_0xac84('0x0'));var url=require('url');var logger=require(_0xac84('0x1'))(_0xac84('0x2'));module[_0xac84('0x3')]=function(_0x9a6381,_0x15697f){var _0x7a9a7f={'method':'POST','uri':url['resolve'](_0x15697f[_0xac84('0x4')],_0xac84('0x5')),'form':{'grant_type':_0xac84('0x6'),'username':_0x15697f['username'],'password':_0x15697f[_0xac84('0x6')]},'json':!![]};return rp(_0x7a9a7f)['then'](function(_0x3297aa){var _0x4cb7e5={'method':_0xac84('0x7'),'uri':url[_0xac84('0x8')](_0x15697f[_0xac84('0x9')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x15697f[_0xac84('0xa')]||_0xac84('0xb'),'channelId':_0xac84('0xc'),'conversation':{'id':_0x9a6381[_0xac84('0xd')]},'from':{'id':_0x9a6381[_0xac84('0xe')],'name':_0x9a6381[_0xac84('0xf')]},'recipient':{'id':_0x9a6381['dnid'],'name':_0x9a6381[_0xac84('0x10')]},'text':_0x15697f['text'],'channelData':{}},'headers':{'Authorization':_0xac84('0x11')+_0x3297aa[_0xac84('0x12')]},'json':!![]};if(_0x15697f['project']){_0x4cb7e5[_0xac84('0x13')][_0xac84('0x14')]['ProjectName']=_0x15697f[_0xac84('0x15')];}if(_0x15697f[_0xac84('0x16')]=='1'){_0x4cb7e5[_0xac84('0x13')][_0xac84('0x14')][_0xac84('0x17')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0xac84('0x18')};}if(_0x15697f['custom_action']){_0x4cb7e5[_0xac84('0x13')][_0xac84('0x14')][_0xac84('0x19')]=_0x15697f[_0xac84('0x1a')];if(_0x15697f[_0xac84('0x1b')]){_0x4cb7e5[_0xac84('0x13')][_0xac84('0x14')][_0xac84('0x1c')]=_0x15697f[_0xac84('0x1b')];}}logger[_0xac84('0x1d')](JSON[_0xac84('0x1e')](_0x4cb7e5));return rp(_0x4cb7e5);});}; \ No newline at end of file +var _0xa8f2=['project','channelData','ndagenerate_audio','custom_action','body','custom_action_data','info','request-promise','url','../../../../../config/logger','agi','POST','/token','password','username','then','resolve','ndassistant_url','/api/NaturalDialogAssistant/v1/Run','Nda','uniqueid','callerid','calleridname','dnid','extension'];(function(_0x477575,_0xf4784b){var _0x3b3751=function(_0x7074d6){while(--_0x7074d6){_0x477575['push'](_0x477575['shift']());}};_0x3b3751(++_0xf4784b);}(_0xa8f2,0xe8));var _0x2a8f=function(_0x34f86d,_0x29e8a2){_0x34f86d=_0x34f86d-0x0;var _0x202cc1=_0xa8f2[_0x34f86d];return _0x202cc1;};'use strict';var rp=require(_0x2a8f('0x0'));var url=require(_0x2a8f('0x1'));var logger=require(_0x2a8f('0x2'))(_0x2a8f('0x3'));module['exports']=function(_0x150212,_0x16eb3d){var _0x5bb510={'method':_0x2a8f('0x4'),'uri':url['resolve'](_0x16eb3d['ndauth_url'],_0x2a8f('0x5')),'form':{'grant_type':_0x2a8f('0x6'),'username':_0x16eb3d[_0x2a8f('0x7')],'password':_0x16eb3d['password']},'json':!![]};return rp(_0x5bb510)[_0x2a8f('0x8')](function(_0x6128c7){var _0x5dbf19={'method':'POST','uri':url[_0x2a8f('0x9')](_0x16eb3d[_0x2a8f('0xa')],_0x2a8f('0xb')),'body':{'type':_0x16eb3d['ndaactivity_type']||'message','channelId':_0x2a8f('0xc'),'conversation':{'id':_0x150212[_0x2a8f('0xd')]},'from':{'id':_0x150212[_0x2a8f('0xe')],'name':_0x150212[_0x2a8f('0xf')]},'recipient':{'id':_0x150212[_0x2a8f('0x10')],'name':_0x150212[_0x2a8f('0x11')]},'text':_0x16eb3d['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x6128c7['access_token']},'json':!![]};if(_0x16eb3d[_0x2a8f('0x12')]){_0x5dbf19['body'][_0x2a8f('0x13')]['ProjectName']=_0x16eb3d['project'];}if(_0x16eb3d[_0x2a8f('0x14')]=='1'){_0x5dbf19['body'][_0x2a8f('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x16eb3d[_0x2a8f('0x15')]){_0x5dbf19[_0x2a8f('0x16')]['channelData']['CustomAction']=_0x16eb3d['custom_action'];if(_0x16eb3d[_0x2a8f('0x17')]){_0x5dbf19[_0x2a8f('0x16')][_0x2a8f('0x13')]['CustomActionData']=_0x16eb3d[_0x2a8f('0x17')];}}logger[_0x2a8f('0x18')](JSON['stringify'](_0x5dbf19));return rp(_0x5dbf19);});}; \ 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 f9bf1b4..c5164c0 100644 --- a/server/services/agi/scripts/tilde/asr/index.js +++ b/server/services/agi/scripts/tilde/asr/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8964=['./lib/api','exports'];(function(_0x33a354,_0x1fefb6){var _0x26dd09=function(_0x4c7fae){while(--_0x4c7fae){_0x33a354['push'](_0x33a354['shift']());}};_0x26dd09(++_0x1fefb6);}(_0x8964,0xc0));var _0x4896=function(_0x313b9a,_0x24d10d){_0x313b9a=_0x313b9a-0x0;var _0x29672c=_0x8964[_0x313b9a];return _0x29672c;};'use strict';var asr=require(_0x4896('0x0'));module[_0x4896('0x1')]=function(_0x538ca5,_0x3bab57,_0xb1ab05,_0x4ddc46){return asr(_0x538ca5,_0x3bab57,_0xb1ab05,_0x4ddc46);}; \ No newline at end of file +var _0xc827=['./lib/api','exports'];(function(_0x3e16eb,_0xf9695d){var _0x4d6b19=function(_0x3ef8e5){while(--_0x3ef8e5){_0x3e16eb['push'](_0x3e16eb['shift']());}};_0x4d6b19(++_0xf9695d);}(_0xc827,0x172));var _0x7c82=function(_0x27e316,_0x163279){_0x27e316=_0x27e316-0x0;var _0x7a92d4=_0xc827[_0x27e316];return _0x7a92d4;};'use strict';var asr=require(_0x7c82('0x0'));module[_0x7c82('0x1')]=function(_0x43b247,_0x141acb,_0x52796a,_0x3a74d2){return asr(_0x43b247,_0x141acb,_0x52796a,_0x3a74d2);}; \ 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 f350e67..f0ce69d 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 _0xe4ad=['transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','error','Error\x20Tilde\x20ASR\x20socket','isNil','open','bluebird','../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','sha1','update','digest','hex','unix','send','stringify','data','close','EOS','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','Tilde\x20ASR\x20hypoteses','hypotheses'];(function(_0x26ad01,_0x3bb13b){var _0x488ad2=function(_0x55486b){while(--_0x55486b){_0x26ad01['push'](_0x26ad01['shift']());}};_0x488ad2(++_0x3bb13b);}(_0xe4ad,0x164));var _0xde4a=function(_0x13d46e,_0xb71980){_0x13d46e=_0x13d46e-0x0;var _0x30e59b=_0xe4ad[_0x13d46e];return _0x30e59b;};'use strict';var BPromise=require(_0xde4a('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require('moment');var crypto=require('crypto');var logger=require(_0xde4a('0x1'))(_0xde4a('0x2'));module[_0xde4a('0x3')]=function(_0x16df70,_0x4a114b,_0x303c3b,_0x2c769d){return new BPromise(function(_0x2a0317,_0x45d1f7){logger[_0xde4a('0x4')](_0xde4a('0x5'),_0x2c769d||_0xde4a('0x6'));var _0x1e7216=new WebSocket(_0x2c769d||_0xde4a('0x6'),{'perMessageDeflate':![]});var _0x2f019c='';var _0x5d61d4='0';var _0x227462='1';var _0x22743b='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x4a9705(_0x115538){var _0x3618d9=crypto['createHash'](_0xde4a('0x7'));_0x3618d9[_0xde4a('0x8')](_0x115538);return _0x3618d9[_0xde4a('0x9')](_0xde4a('0xa'));}function _0x55cca4(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x39cf72=moment()[_0xde4a('0xb')]();var _0x14967b=_0x4a9705(_0x39cf72+_0x4a114b+_0x303c3b);_0x1e7216[_0xde4a('0xc')](JSON[_0xde4a('0xd')]({'appID':_0x4a114b,'timestamp':_0x39cf72,'appKey':_0x14967b}));var _0x3599be=fs['createReadStream'](_0x16df70);_0x3599be['on'](_0xde4a('0xe'),function(_0x374756){_0x1e7216[_0xde4a('0xc')](_0x374756);});_0x3599be['on'](_0xde4a('0xf'),function(){_0x1e7216[_0xde4a('0xc')](_0xde4a('0x10'));});}catch(_0x44afe5){logger['error'](_0xde4a('0x11'),JSON['stringify'](_0x44afe5));_0x1e7216[_0xde4a('0x12')]();}}function _0x5d4ea9(_0x132cd9){try{if(_0x132cd9){var _0x23f3d2=JSON[_0xde4a('0x13')](_0x132cd9);switch(_0x23f3d2[_0xde4a('0x14')]){case 0x0:if(_0x23f3d2[_0xde4a('0x15')]){if(_0x23f3d2[_0xde4a('0x15')]['final']){logger[_0xde4a('0x4')](_0xde4a('0x16'),JSON['stringify'](_0x23f3d2['result']['hypotheses']));_0x2f019c=_0x23f3d2[_0xde4a('0x15')][_0xde4a('0x17')][0x0][_0xde4a('0x18')];_0x5d61d4=_0x23f3d2['result'][_0xde4a('0x17')][0x0][_0xde4a('0x19')];_0x227462='0';_0x22743b=_0xde4a('0x1a');_0x1e7216[_0xde4a('0x12')]();}}break;case 0x1:logger[_0xde4a('0x4')](_0xde4a('0x1b'));_0x227462='1';_0x22743b=_0xde4a('0x1b');break;case 0x2:logger['info'](_0xde4a('0x1c'));_0x227462='2';_0x22743b=_0xde4a('0x1c');break;case 0x9:logger[_0xde4a('0x4')](_0xde4a('0x1d'));_0x227462='9';_0x22743b=_0xde4a('0x1d');break;case 0xa:logger['info'](_0xde4a('0x1e'));_0x227462='10';_0x22743b=_0xde4a('0x1e');break;case 0xb:logger[_0xde4a('0x4')](_0xde4a('0x1f'));_0x227462='11';_0x22743b=_0xde4a('0x1f');}}}catch(_0xb6d339){logger['error'](_0xde4a('0x20'),JSON['stringify'](_0xb6d339));_0x1e7216[_0xde4a('0x12')]();}}function _0xf59515(){logger[_0xde4a('0x4')](_0xde4a('0x21'));_0x2a0317({'transcript':_0x2f019c,'confidence':_0x5d61d4,'status':_0x227462,'status_message':_0x22743b});}function _0x5752a8(_0x580dfb){logger[_0xde4a('0x22')](_0xde4a('0x23'));if(!_[_0xde4a('0x24')](_0x580dfb)){logger[_0xde4a('0x22')](_['isObject'](_0x580dfb)?JSON[_0xde4a('0xd')](_0x580dfb):_0x580dfb);}}_0x1e7216['on'](_0xde4a('0x25'),_0x55cca4);_0x1e7216['on']('message',_0x5d4ea9);_0x1e7216['on'](_0xde4a('0xf'),_0xf59515);_0x1e7216['on'](_0xde4a('0x22'),_0x5752a8);});}; \ No newline at end of file +var _0xe1eb=['stringify','createReadStream','close','send','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','exports','Tilde\x20URI','createHash','sha1','update','info','Open\x20Tilde\x20ASR\x20socket'];(function(_0x1e1082,_0x264907){var _0x10a267=function(_0x4055ff){while(--_0x4055ff){_0x1e1082['push'](_0x1e1082['shift']());}};_0x10a267(++_0x264907);}(_0xe1eb,0x1bd));var _0xbe1e=function(_0x55a8cf,_0x27ef42){_0x55a8cf=_0x55a8cf-0x0;var _0x7a1bc9=_0xe1eb[_0x55a8cf];return _0x7a1bc9;};'use strict';var BPromise=require(_0xbe1e('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xbe1e('0x1'));var crypto=require(_0xbe1e('0x2'));var logger=require(_0xbe1e('0x3'))('agi');module[_0xbe1e('0x4')]=function(_0xf88b1d,_0x101efe,_0x3f9d5f,_0x56e2a5){return new BPromise(function(_0x5c731c,_0x1cfaf5){logger['info'](_0xbe1e('0x5'),_0x56e2a5||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE');var _0x4a1735=new WebSocket(_0x56e2a5||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x41d8f1='';var _0x4b807a='0';var _0x2e8716='1';var _0x26e605='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x45285a(_0x3bdfde){var _0x55f9b8=crypto[_0xbe1e('0x6')](_0xbe1e('0x7'));_0x55f9b8[_0xbe1e('0x8')](_0x3bdfde);return _0x55f9b8['digest']('hex');}function _0x553322(){try{logger[_0xbe1e('0x9')](_0xbe1e('0xa'));var _0x5b4f6c=moment()['unix']();var _0x329a8e=_0x45285a(_0x5b4f6c+_0x101efe+_0x3f9d5f);_0x4a1735['send'](JSON[_0xbe1e('0xb')]({'appID':_0x101efe,'timestamp':_0x5b4f6c,'appKey':_0x329a8e}));var _0x1a3a05=fs[_0xbe1e('0xc')](_0xf88b1d);_0x1a3a05['on']('data',function(_0x1cf803){_0x4a1735['send'](_0x1cf803);});_0x1a3a05['on'](_0xbe1e('0xd'),function(){_0x4a1735[_0xbe1e('0xe')]('EOS');});}catch(_0x42eba7){logger[_0xbe1e('0xf')](_0xbe1e('0x10'),JSON[_0xbe1e('0xb')](_0x42eba7));_0x4a1735[_0xbe1e('0x11')]();}}function _0x40c936(_0x10a4bf){try{if(_0x10a4bf){var _0x366099=JSON[_0xbe1e('0x12')](_0x10a4bf);switch(_0x366099[_0xbe1e('0x13')]){case 0x0:if(_0x366099[_0xbe1e('0x14')]){if(_0x366099[_0xbe1e('0x14')][_0xbe1e('0x15')]){logger[_0xbe1e('0x9')](_0xbe1e('0x16'),JSON[_0xbe1e('0xb')](_0x366099[_0xbe1e('0x14')][_0xbe1e('0x17')]));_0x41d8f1=_0x366099['result'][_0xbe1e('0x17')][0x0][_0xbe1e('0x18')];_0x4b807a=_0x366099[_0xbe1e('0x14')]['hypotheses'][0x0][_0xbe1e('0x19')];_0x2e8716='0';_0x26e605=_0xbe1e('0x1a');_0x4a1735['terminate']();}}break;case 0x1:logger[_0xbe1e('0x9')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x2e8716='1';_0x26e605=_0xbe1e('0x1b');break;case 0x2:logger[_0xbe1e('0x9')](_0xbe1e('0x1c'));_0x2e8716='2';_0x26e605=_0xbe1e('0x1c');break;case 0x9:logger[_0xbe1e('0x9')](_0xbe1e('0x1d'));_0x2e8716='9';_0x26e605=_0xbe1e('0x1d');break;case 0xa:logger['info'](_0xbe1e('0x1e'));_0x2e8716='10';_0x26e605=_0xbe1e('0x1e');break;case 0xb:logger['info']('All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.');_0x2e8716='11';_0x26e605=_0xbe1e('0x1f');}}}catch(_0x5e2940){logger[_0xbe1e('0xf')](_0xbe1e('0x20'),JSON[_0xbe1e('0xb')](_0x5e2940));_0x4a1735['terminate']();}}function _0x1370ba(){logger['info']('Close\x20Tilde\x20ASR\x20socket');_0x5c731c({'transcript':_0x41d8f1,'confidence':_0x4b807a,'status':_0x2e8716,'status_message':_0x26e605});}function _0x574fac(_0xbe4945){logger[_0xbe1e('0xf')](_0xbe1e('0x21'));if(!_[_0xbe1e('0x22')](_0xbe4945)){logger[_0xbe1e('0xf')](_[_0xbe1e('0x23')](_0xbe4945)?JSON[_0xbe1e('0xb')](_0xbe4945):_0xbe4945);}}_0x4a1735['on'](_0xbe1e('0x24'),_0x553322);_0x4a1735['on'](_0xbe1e('0x25'),_0x40c936);_0x4a1735['on'](_0xbe1e('0xd'),_0x1370ba);_0x4a1735['on'](_0xbe1e('0xf'),_0x574fac);});}; \ 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 43ab098..04a6346 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 _0x0608=['./asr','exports'];(function(_0x58bec1,_0x42c53f){var _0x16439f=function(_0x19b7ec){while(--_0x19b7ec){_0x58bec1['push'](_0x58bec1['shift']());}};_0x16439f(++_0x42c53f);}(_0x0608,0x1d6));var _0x8060=function(_0x3375eb,_0x351cba){_0x3375eb=_0x3375eb-0x0;var _0x210577=_0x0608[_0x3375eb];return _0x210577;};var asr=require(_0x8060('0x0'));module[_0x8060('0x1')]={'asr':asr}; \ No newline at end of file +var _0x6d7b=['./asr'];(function(_0x154712,_0x389a25){var _0x37bfc6=function(_0x14bb47){while(--_0x14bb47){_0x154712['push'](_0x154712['shift']());}};_0x37bfc6(++_0x389a25);}(_0x6d7b,0x13a));var _0xb6d7=function(_0x515cff,_0x27d4a5){_0x515cff=_0x515cff-0x0;var _0x419c0e=_0x6d7b[_0x515cff];return _0x419c0e;};var asr=require(_0xb6d7('0x0'));module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index bc6c4bc..8bef979 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 _0x1280=['connection','getConnections','error','E_AGI_SERVER_ERROR','destroy','E_AGI_SERVER_MAXCONNECTION','ready','close','E_AGI_SERVER_CLOSE','exports','util','net','events','EventEmitter','./error','./channel','127.0.0.1','call','emit','createServer','listen','listening'];(function(_0xb36ccf,_0x24c93b){var _0x37b01e=function(_0x5d188a){while(--_0x5d188a){_0xb36ccf['push'](_0xb36ccf['shift']());}};_0x37b01e(++_0x24c93b);}(_0x1280,0xba));var _0x0128=function(_0x1d558c,_0x1e497c){_0x1d558c=_0x1d558c-0x0;var _0x15767d=_0x1280[_0x1d558c];return _0x15767d;};'use strict';var util=require(_0x0128('0x0'));var net=require(_0x0128('0x1'));var EventEmitter=require(_0x0128('0x2'))[_0x0128('0x3')];var AGIError=require(_0x0128('0x4'));var AGIChannel=require(_0x0128('0x5'));var AGIServer=function(_0x2334b5,_0x3a3112,_0x403dd9){var _0x551461=this,_0x2334b5=_0x2334b5||0x11dd,_0x3a3112=_0x3a3112||_0x0128('0x6'),_0x59959a=null,_0x589536=0x0;EventEmitter[_0x0128('0x7')](_0x551461);function _0x79484c(){if(!_0x2334b5){_0x551461[_0x0128('0x8')]('error',new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x59959a=net[_0x0128('0x9')]();_0x59959a[_0x0128('0xa')](_0x2334b5,_0x3a3112);_0x59959a['on']('listening',function(){_0x551461[_0x0128('0x8')](_0x0128('0xb'));});_0x59959a['on'](_0x0128('0xc'),function(_0x4cc655){_0x59959a[_0x0128('0xd')](function(_0x32d5d2,_0x1faf8c){if(_0x32d5d2){_0x551461[_0x0128('0x8')](_0x0128('0xe'),new AGIError(_0x0128('0xf'),_0x32d5d2));}else if(_0x403dd9&&_0x403dd9<0x0){_0x551461[_0x0128('0x8')](_0x0128('0xe'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x4cc655[_0x0128('0x10')]();}else if(_0x403dd9&&_0x403dd9>0x0&&_0x403dd9<_0x1faf8c){_0x589536+=0x1;_0x551461['emit']('error',new AGIError(_0x0128('0x11'),_0x589536));_0x4cc655[_0x0128('0x10')]();}else{var _0x4467ae=new AGIChannel(_0x4cc655);_0x4467ae['on'](_0x0128('0x12'),function(){_0x551461[_0x0128('0x8')]('connection',_0x4467ae);});}});});_0x59959a['on'](_0x0128('0xe'),function(_0x2b4c26){_0x551461[_0x0128('0x8')]('error',new AGIError('E_AGI_SERVER_ERROR',_0x2b4c26['code']));});_0x59959a['on'](_0x0128('0x13'),function(){_0x551461[_0x0128('0x8')](_0x0128('0x13'),new AGIError(_0x0128('0x14')));});}process['nextTick'](function(){_0x79484c();});};util['inherits'](AGIServer,EventEmitter);module[_0x0128('0x15')]=function(_0xdc1ed7,_0xcd45bf,_0x11f76e){return new AGIServer(_0xdc1ed7,_0xcd45bf,_0x11f76e);}; \ No newline at end of file +var _0x3685=['destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','nextTick','util','events','EventEmitter','./error','./channel','127.0.0.1','call','error','E_AGI_ARGUMENT_PORT','createServer','listen','listening','emit','connection','getConnections','E_AGI_SERVER_ERROR'];(function(_0x2d607b,_0x455193){var _0x5be31d=function(_0xd56691){while(--_0xd56691){_0x2d607b['push'](_0x2d607b['shift']());}};_0x5be31d(++_0x455193);}(_0x3685,0xf8));var _0x5368=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3685[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0x5368('0x0'));var net=require('net');var EventEmitter=require(_0x5368('0x1'))[_0x5368('0x2')];var AGIError=require(_0x5368('0x3'));var AGIChannel=require(_0x5368('0x4'));var AGIServer=function(_0x38e06c,_0xf0428a,_0x271e21){var _0x2c9c35=this,_0x38e06c=_0x38e06c||0x11dd,_0xf0428a=_0xf0428a||_0x5368('0x5'),_0x4fc6ed=null,_0x1a4450=0x0;EventEmitter[_0x5368('0x6')](_0x2c9c35);function _0xaf4549(){if(!_0x38e06c){_0x2c9c35['emit'](_0x5368('0x7'),new AGIError(_0x5368('0x8')));return![];}_0x4fc6ed=net[_0x5368('0x9')]();_0x4fc6ed[_0x5368('0xa')](_0x38e06c,_0xf0428a);_0x4fc6ed['on'](_0x5368('0xb'),function(){_0x2c9c35[_0x5368('0xc')](_0x5368('0xb'));});_0x4fc6ed['on'](_0x5368('0xd'),function(_0x521e25){_0x4fc6ed[_0x5368('0xe')](function(_0x24b9ec,_0x27fc4f){if(_0x24b9ec){_0x2c9c35['emit'](_0x5368('0x7'),new AGIError(_0x5368('0xf'),_0x24b9ec));}else if(_0x271e21&&_0x271e21<0x0){_0x2c9c35['emit']('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x521e25[_0x5368('0x10')]();}else if(_0x271e21&&_0x271e21>0x0&&_0x271e21<_0x27fc4f){_0x1a4450+=0x1;_0x2c9c35[_0x5368('0xc')](_0x5368('0x7'),new AGIError(_0x5368('0x11'),_0x1a4450));_0x521e25[_0x5368('0x10')]();}else{var _0x2f18dd=new AGIChannel(_0x521e25);_0x2f18dd['on'](_0x5368('0x12'),function(){_0x2c9c35[_0x5368('0xc')](_0x5368('0xd'),_0x2f18dd);});}});});_0x4fc6ed['on'](_0x5368('0x7'),function(_0x524fbf){_0x2c9c35[_0x5368('0xc')](_0x5368('0x7'),new AGIError('E_AGI_SERVER_ERROR',_0x524fbf[_0x5368('0x13')]));});_0x4fc6ed['on'](_0x5368('0x14'),function(){_0x2c9c35[_0x5368('0xc')](_0x5368('0x14'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x5368('0x15')](function(){_0xaf4549();});};util['inherits'](AGIServer,EventEmitter);module['exports']=function(_0x996434,_0x5e1398,_0x52afa9){return new AGIServer(_0x996434,_0x5e1398,_0x52afa9);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index f9d0967..b9cde39 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 _0x70e0=['label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','trim','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','PUT','method','toUpperCase','body','rawBody','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','saveRestApiResult','%s.%s','split','length','replaceAll','extra','getAndSetVariable','setVariable','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','noop','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','no\x20grammar\x20configured','RECOG_CONFIDENCE()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','generate','hiddendigitspos','first','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','gotoc','continueAt','context','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','XMCS-QUEUE','QUEUE','url','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','Smtp','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','streamFile','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','randomstring','moment','mustache','request-promise','agi','./scripts','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','name','catch','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','IntervalId','interval','map','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x70e0,0x17b));var _0x070e=function(_0x540f50,_0x3e0d64){_0x540f50=_0x540f50-0x0;var _0x170ea5=_0x70e0[_0x540f50];return _0x170ea5;};'use strict';var fs=require('fs');var path=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var _=require(_0x070e('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var rp=require(_0x070e('0x6'));var logger=require('../../config/logger')(_0x070e('0x7'));var config=require('../../config/environment');var scripts=require(_0x070e('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x070e('0x9'),_0x070e('0xa'),_0x070e('0xb')];var AGIVertices=function(_0x2611e6,_0x111743,_0x68a09e){this[_0x070e('0xc')]=_0x2611e6;this['rpc']=_0x111743;this['mailRpc']=_0x68a09e;};AGIVertices[_0x070e('0xd')][_0x070e('0xe')]=function(_0x12bb37,_0xb8d819){this[_0x070e('0xf')][_0x070e('0x10')](_0x12bb37)[_0x070e('0x11')](function(_0x1baa12){_0xb8d819(null,_0x1baa12?_0x1baa12[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x2930b8){_0xb8d819(_0x2930b8);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x24baba,_0x56c7ba){this['rpc']['getVoiceQueueById'](_0x24baba)[_0x070e('0x11')](function(_0x14c3fd){_0x56c7ba(null,_0x14c3fd?_0x14c3fd['name']:![]);})['catch'](function(_0x373d86){_0x56c7ba(_0x373d86);});};AGIVertices[_0x070e('0xd')][_0x070e('0x14')]=function(_0x19d9da,_0x5bc71e){this['rpc'][_0x070e('0x15')](_0x19d9da)[_0x070e('0x11')](function(_0x38f6e6){_0x5bc71e(null,_0x38f6e6?_0x38f6e6[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x5037eb){_0x5bc71e(_0x5037eb);});};AGIVertices[_0x070e('0xd')][_0x070e('0x16')]=function(_0x1ad3de,_0x3ea105){this[_0x070e('0xf')]['getSquareOdbcById'](_0x1ad3de)['then'](function(_0x4e958f){_0x3ea105(null,_0x4e958f?_0x4e958f[_0x070e('0x17')]:![]);})[_0x070e('0x13')](function(_0x20dc60){_0x3ea105(_0x20dc60);});};AGIVertices['prototype'][_0x070e('0x18')]=function(_0x5dc5d2,_0xf8dd5d){this[_0x070e('0xf')][_0x070e('0x19')](_0x5dc5d2)[_0x070e('0x11')](function(_0x28a1c3){_0xf8dd5d(null,_0x28a1c3?_0x28a1c3[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x164cdf){_0xf8dd5d(_0x164cdf);});};AGIVertices['prototype'][_0x070e('0x1a')]=function(_0x270061,_0x4790eb){this['rpc'][_0x070e('0x1b')](_0x270061)['then'](function(_0x4a2dbd){_0x4790eb(null,_0x4a2dbd?_0x4a2dbd[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x41deb1){_0x4790eb(_0x41deb1);});};AGIVertices[_0x070e('0xd')][_0x070e('0x1c')]=function(_0x497f58,_0x374c54){var _0x219e48=this;this[_0x070e('0xf')][_0x070e('0x1d')](_0x497f58)[_0x070e('0x11')](function(_0x28d7f2){_0x374c54(null,_0x28d7f2?_0x219e48[_0x070e('0x1e')](_0x28d7f2[_0x070e('0x1f')]):![]);})['catch'](function(_0x282344){_0x374c54(_0x282344);});};AGIVertices[_0x070e('0xd')][_0x070e('0x20')]=function(_0x56fc12,_0x5c5f0d){this[_0x070e('0xf')][_0x070e('0x21')](_0x56fc12)[_0x070e('0x11')](function(_0x51402c){_0x5c5f0d(null,_0x51402c?_0x51402c:![]);})[_0x070e('0x13')](function(_0x1741a1){_0x5c5f0d(_0x1741a1);});};AGIVertices[_0x070e('0xd')][_0x070e('0x22')]=function(_0x53d473,_0x5bf522,_0x523b75){this['mailRpc'][_0x070e('0x22')](_0x53d473,_0x5bf522)['then'](function(){_0x523b75(null);})[_0x070e('0x13')](function(_0x323cf1){_0x523b75(_0x323cf1);});};AGIVertices['prototype']['getIntervals']=function(_0x699739,_0x3454c7){this['rpc']['getIntervalById'](_0x699739)[_0x070e('0x11')](function(_0x27dd1f){if(_0x27dd1f){if(_0x27dd1f[_0x070e('0x23')]){_0x3454c7(null,[_0x27dd1f[_0x070e('0x24')]]);}else{_0x3454c7(null,_[_0x070e('0x25')](_0x27dd1f['Intervals'],'interval'));}}else{_0x3454c7(null,![]);}})[_0x070e('0x13')](function(_0x3011c4){_0x3454c7(_0x3011c4);});};AGIVertices[_0x070e('0xd')][_0x070e('0x1e')]=function(_0xf11439){return util['format'](_0x070e('0x26'),FILES_PATH,_0xf11439);};AGIVertices[_0x070e('0xd')]['getQueryOdbc']=function(_0x2d6bb6,_0x34746e,_0x4ba6f0){odbc['open'](_0x2d6bb6,function(_0x5ddbe9){if(_0x5ddbe9){logger[_0x070e('0x27')](_0x070e('0x28'),_0x5ddbe9);_0x4ba6f0(_0x5ddbe9);}else{logger[_0x070e('0x29')](_0x070e('0x2a'));odbc[_0x070e('0x2b')](_0x34746e,function(_0x5e3827,_0x104048){if(_0x5e3827){logger[_0x070e('0x29')](_0x070e('0x2c'),_0x34746e);_0x4ba6f0(_0x5e3827);}else{logger['info'](_0x070e('0x2d'),_0x34746e);odbc[_0x070e('0x2e')](function(_0x165c16){if(_0x165c16){logger['error'](_0x070e('0x2f'),_0x165c16);}_0x4ba6f0(null,_0x104048);});}});}});};AGIVertices[_0x070e('0xd')]['getSmsAccount']=function(_0x173602,_0x5d689b){this[_0x070e('0xf')][_0x070e('0x30')](_0x173602)[_0x070e('0x11')](function(_0x30319c){_0x5d689b(null,_0x30319c?_0x30319c:![]);})[_0x070e('0x13')](function(_0x47b929){_0x5d689b(_0x47b929);});};AGIVertices[_0x070e('0xd')]['createSmsMessage']=function(_0x5bd39a,_0x398168){this[_0x070e('0xf')][_0x070e('0x31')](_0x5bd39a)['then'](function(_0x2ad56c){_0x398168(null,_0x2ad56c);})[_0x070e('0x13')](function(_0x556bf3){_0x398168(_0x556bf3);});};AGIVertices[_0x070e('0xd')]['createSquareDetailsReport']=function(_0x13e4e0,_0x5851ab,_0x544b53){this['rpc'][_0x070e('0x32')]({'uniqueid':this[_0x070e('0xc')][_0x070e('0x33')],'node':_0x13e4e0[_0x070e('0x34')],'application':_0x13e4e0[_0x070e('0x35')],'data':_0x5851ab||null,'project_name':this['channel'][_0x070e('0x36')],'callerid':this['channel'][_0x070e('0x37')]})[_0x070e('0x11')](function(_0xff760c){if(_0x544b53){_0x544b53(null,_0xff760c);}})['catch'](function(_0x54285a){if(_0x544b53){_0x544b53(_0x54285a);}});};AGIVertices[_0x070e('0xd')]['createSquareRecording']=function(_0x35349f,_0x3fdb75,_0x139820,_0x5f5675){this[_0x070e('0xf')][_0x070e('0x38')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x070e('0xc')][_0x070e('0x37')],'calleridname':this[_0x070e('0xc')][_0x070e('0x39')],'context':this[_0x070e('0xc')]['context'],'extension':this[_0x070e('0xc')][_0x070e('0x3a')],'priority':this[_0x070e('0xc')][_0x070e('0x3b')],'accountcode':this[_0x070e('0xc')][_0x070e('0x3c')],'dnid':this[_0x070e('0xc')][_0x070e('0x3d')],'projectName':this[_0x070e('0xc')][_0x070e('0x36')],'saveName':_0x3fdb75,'filename':_0x35349f[_0x070e('0x3e')]||_0x3fdb75,'savePath':_0x139820})[_0x070e('0x11')](function(_0x5254f8){_0x5f5675(null,_0x5254f8);})[_0x070e('0x13')](function(_0x402c82){_0x5f5675(_0x402c82);});};AGIVertices['prototype'][_0x070e('0x3f')]=function(_0xa7a41b,_0x40298a,_0x249e3f){this[_0x070e('0xf')][_0x070e('0x3f')]({'uniqueid':this[_0x070e('0xc')][_0x070e('0x33')],'body':_0xa7a41b,'direction':_0x40298a})[_0x070e('0x11')](function(_0x5744c5){if(_0x249e3f){_0x249e3f(null,_0x5744c5);}})[_0x070e('0x13')](function(_0x4c22da){if(_0x249e3f){_0x249e3f(_0x4c22da);}});};AGIVertices[_0x070e('0xd')][_0x070e('0x40')]=function(_0x4abbe9,_0x991d23){this[_0x070e('0xf')][_0x070e('0x40')]({'firstName':_[_0x070e('0x41')](_0x4abbe9[_0x070e('0x12')])||_[_0x070e('0x42')](_0x4abbe9[_0x070e('0x12')])?'callback_'+Math[_0x070e('0x43')]():_0x4abbe9['name'],'lastName':_['isEmpty'](_0x4abbe9[_0x070e('0x44')])||_[_0x070e('0x42')](_0x4abbe9[_0x070e('0x44')])?null:_0x4abbe9[_0x070e('0x44')],'phone':_0x4abbe9[_0x070e('0x45')],'ListId':_0x4abbe9[_0x070e('0x46')],'scheduledAt':_0x4abbe9[_0x070e('0x47')],'callbackUniqueid':this[_0x070e('0xc')]['uniqueid'],'tags':_0x070e('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x4abbe9['scheduledAt'][_0x070e('0x49')](),'priority':_0x4abbe9[_0x070e('0x4a')]})['then'](function(_0x26af08){_0x991d23(null,_0x26af08);})[_0x070e('0x13')](function(_0x210f4a){_0x991d23(_0x210f4a);});};AGIVertices[_0x070e('0xd')][_0x070e('0x4b')]=function(_0x382ce3,_0x1b36cd){this['rpc']['getPauseById'](_0x382ce3)['then'](function(_0x3087e5){_0x1b36cd(null,_0x3087e5?_0x3087e5[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x2f8fcb){_0x1b36cd(_0x2f8fcb);});};AGIVertices['prototype'][_0x070e('0x4c')]=function(_0x5d3c3a,_0x212710,_0x1cbb7e){var _0x476804={'role':_0x070e('0x4d')};_0x476804[_0x5d3c3a]=this[_0x070e('0xc')][_0x070e('0x37')];this['rpc'][_0x070e('0x4c')](_0x476804,_0x212710,this[_0x070e('0xc')][_0x070e('0x33')])['then'](function(_0x1d7873){_0x1cbb7e(null,_[_0x070e('0x42')](_0x1d7873)?![]:!![]);})['catch'](function(_0x1f1df5){logger['error'](_0x1f1df5);_0x1cbb7e(null,![]);});};AGIVertices[_0x070e('0xd')]['agentUnpause']=function(_0x4cb86f,_0x4b354d){var _0xbaf43e={'role':_0x070e('0x4d')};_0xbaf43e[_0x4cb86f]=this[_0x070e('0xc')][_0x070e('0x37')];this[_0x070e('0xf')][_0x070e('0x4e')](_0xbaf43e)['then'](function(_0x841c89){_0x4b354d(null,_['isNil'](_0x841c89)?![]:!![]);})[_0x070e('0x13')](function(_0x52becf){logger[_0x070e('0x27')](_0x52becf);_0x4b354d(null,![]);});};AGIVertices[_0x070e('0xd')]['agentLogout']=function(_0x1bcdc3,_0x50399e){var _0x1a9e25={'role':_0x070e('0x4d')};_0x1a9e25[_0x1bcdc3]=this[_0x070e('0xc')][_0x070e('0x37')];this[_0x070e('0xf')][_0x070e('0x4f')](_0x1a9e25)[_0x070e('0x11')](function(_0x148f1d){_0x50399e(null,_[_0x070e('0x42')](_0x148f1d)?![]:!![]);})[_0x070e('0x13')](function(_0x40c560){logger[_0x070e('0x27')](_0x40c560);_0x50399e(null,![]);});};AGIVertices[_0x070e('0xd')][_0x070e('0x50')]=function(_0x5a5521,_0x45bf20){var _0x19d78c={'role':_0x070e('0x4d')};_0x19d78c[_0x5a5521]=this[_0x070e('0xc')]['callerid'];var _0x2ccd8d=_0x5a5521!=_0x070e('0x51')?util[_0x070e('0x52')](_0x070e('0x53'),_0x070e('0x54'),this[_0x070e('0xc')]['callerid']):undefined;this[_0x070e('0xf')][_0x070e('0x50')](_0x19d78c,_0x2ccd8d)[_0x070e('0x11')](function(_0x2fe202){_0x45bf20(null,_['isNil'](_0x2fe202)?![]:!![]);})[_0x070e('0x13')](function(_0x52804d){logger[_0x070e('0x27')](_0x52804d);_0x45bf20(null,![]);});};AGIVertices[_0x070e('0xd')][_0x070e('0x55')]=function(_0x150bf6,_0x2a20d4){sh['exec'](_[_0x070e('0x56')](_0x150bf6),function(_0x2e38c6,_0x8cc913){var _0x114bcf=_0x8cc913['replace'](/(\r\n|\n|\r)/gm,'');_0x2a20d4(null,_0x114bcf);});};AGIVertices[_0x070e('0xd')]['googleCloudTTS']=function(_0x399055,_0x44e465){scripts[_0x070e('0x57')](_0x399055['apiKey'],_0x399055[_0x070e('0x58')]||'text',_0x399055[_0x070e('0x59')],_0x399055['languageCode']||_0x070e('0x5a'),_0x399055[_0x070e('0x5b')]||'MALE',_0x399055[_0x070e('0x5c')]||'MP3')[_0x070e('0x11')](function(_0x39ff7d){_0x44e465(null,_0x39ff7d);})['catch'](function(_0x4ca374){_0x44e465(_0x4ca374);});};AGIVertices[_0x070e('0xd')][_0x070e('0x5d')]=function(_0xf67cfd,_0x17cf15){scripts[_0x070e('0x5d')](_0xf67cfd[_0x070e('0x59')],_0xf67cfd[_0x070e('0x5e')]||'en',0x1)[_0x070e('0x11')](function(_0x25b599){_0x17cf15(null,_0x25b599);})[_0x070e('0x13')](function(_0x72077d){_0x17cf15(_0x72077d);});};AGIVertices[_0x070e('0xd')][_0x070e('0x5f')]=function(_0x5c88fe,_0x3308b5){var _0x549979={'uri':_0x5c88fe['url'],'method':_0x5c88fe['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5c88fe[_0x070e('0x60')])===_0x070e('0x61')&&parseInt(_0x5c88fe[_0x070e('0x60')])>=0x1?parseInt(_0x5c88fe[_0x070e('0x60')])*0x3e8:0x5*0x3e8};if(_[_0x070e('0x62')]([_0x070e('0x63'),_0x070e('0x64')],_0x549979[_0x070e('0x65')][_0x070e('0x66')]())){try{_0x549979[_0x070e('0x67')]=_0x5c88fe[_0x070e('0x68')]?JSON[_0x070e('0x69')](_0x5c88fe[_0x070e('0x68')]):{};}catch(_0x595e2e){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x595e2e);}}try{_0x549979[_0x070e('0x6a')]=_0x5c88fe[_0x070e('0x6b')]?JSON[_0x070e('0x69')](_0x5c88fe[_0x070e('0x6b')]):{};}catch(_0x5a7df2){logger[_0x070e('0x27')](_0x070e('0x6c'),_0x5a7df2);}if(_0x5c88fe[_0x070e('0x6d')]){try{var _0xd74f9c=require(_0x5c88fe[_0x070e('0x6d')])[_0x070e('0x6e')](this,_0x549979);_0x549979['uri']=Mustache[_0x070e('0x6f')](_0x5c88fe['url'],_0xd74f9c,{},['$$','$$']);if(_0x549979[_0x070e('0x6a')]){_0x549979[_0x070e('0x6a')]=JSON[_0x070e('0x69')](Mustache[_0x070e('0x6f')](JSON[_0x070e('0x70')](_0x549979['headers']),_0xd74f9c,{},['$$','$$']));}if(_0x549979[_0x070e('0x67')]){_0x549979[_0x070e('0x67')]=JSON['parse'](Mustache[_0x070e('0x6f')](JSON[_0x070e('0x70')](_0x549979['body']),_0xd74f9c,{},['$$','$$']));}}catch(_0xb8ae48){logger[_0x070e('0x27')](_0x070e('0x71'),_0xb8ae48);}}rp(_0x549979)['then'](function(_0x40d7e6){var _0xe8c476={'statusCode':_0x40d7e6[_0x070e('0x72')]||0xc8,'statusMessage':_0x40d7e6[_0x070e('0x73')]||'OK','headers':_0x40d7e6[_0x070e('0x6a')]||{},'body':_0x40d7e6[_0x070e('0x67')]||{}};_0x3308b5(null,_0xe8c476);})[_0x070e('0x13')](function(_0xf90516){var _0x206b97={'statusCode':_0xf90516[_0x070e('0x72')]||0x1f4,'statusMessage':_0xf90516[_0x070e('0x74')]||_0x070e('0x75'),'headers':_0xf90516[_0x070e('0x76')]['headers']||{},'body':_0xf90516[_0x070e('0x76')][_0x070e('0x67')]||{}};_0x3308b5(null,_0x206b97);});};AGIVertices[_0x070e('0xd')][_0x070e('0x77')]=function(_0x1dceda,_0x1d1aa2){scripts['googleDialogflow'](this['channel']['uniqueid'],_0x1dceda[_0x070e('0x78')],_0x1dceda[_0x070e('0x59')],_0x1dceda[_0x070e('0x79')]||'en')[_0x070e('0x11')](function(_0x4b4b9a){_0x1d1aa2(null,_0x4b4b9a);})[_0x070e('0x13')](function(_0x20cd8a){_0x1d1aa2(_0x20cd8a);});};AGIVertices[_0x070e('0xd')]['sestekNDA']=function(_0x9d81a9,_0x48c011){scripts[_0x070e('0x7a')](this[_0x070e('0xc')],_0x9d81a9)['then'](function(_0x59fe3e){_0x48c011(null,_0x59fe3e);})[_0x070e('0x13')](function(_0x1fa499){_0x48c011(_0x1fa499);});};AGIVertices['prototype'][_0x070e('0x7b')]=function(_0x596beb,_0x4e8af1){scripts['ispeechTTS'](_0x596beb[_0x070e('0x78')],_0x596beb[_0x070e('0x59')],_0x596beb[_0x070e('0x7c')]||_0x070e('0x5a'),_0x596beb[_0x070e('0x7d')])[_0x070e('0x11')](function(_0x2a12a1){_0x4e8af1(null,_0x2a12a1);})[_0x070e('0x13')](function(_0x3bc925){_0x4e8af1(_0x3bc925);});};AGIVertices[_0x070e('0xd')][_0x070e('0x7e')]=function(_0x1306e6,_0x296008,_0x767dcc){scripts[_0x070e('0x7e')](_0x296008,_0x1306e6[_0x070e('0x78')],_0x1306e6[_0x070e('0x7f')]||_0x070e('0x5a'),this[_0x070e('0x80')](_0x1306e6[_0x070e('0x81')])?_0x1306e6[_0x070e('0x81')]:undefined)[_0x070e('0x11')](function(_0x58f2e8){_0x767dcc(null,_0x58f2e8);})[_0x070e('0x13')](function(_0x276e6e){_0x767dcc(_0x276e6e);});};AGIVertices[_0x070e('0xd')][_0x070e('0x82')]=function(_0x495403,_0x2f26d1){scripts[_0x070e('0x82')](_0x495403[_0x070e('0x83')],_0x495403[_0x070e('0x84')],_0x495403[_0x070e('0x85')],_0x495403[_0x070e('0x86')]||'Amy',_0x495403['text'],_0x495403['aws_text_type']||_0x070e('0x59'))['then'](function(_0x26e9c1){_0x2f26d1(null,_0x26e9c1);})[_0x070e('0x13')](function(_0x4dba5f){_0x2f26d1(_0x4dba5f);});};AGIVertices[_0x070e('0xd')][_0x070e('0x87')]=function(_0x4f9a95,_0x56f389){scripts[_0x070e('0x87')](this[_0x070e('0xc')][_0x070e('0x33')],_0x4f9a95[_0x070e('0x83')],_0x4f9a95[_0x070e('0x84')],_0x4f9a95['aws_lex_region'],_0x4f9a95[_0x070e('0x59')],_0x4f9a95['aws_bot_name'])[_0x070e('0x11')](function(_0x1219b4){_0x56f389(null,_0x1219b4);})['catch'](function(_0x22cbfb){_0x56f389(_0x22cbfb);});};AGIVertices[_0x070e('0xd')][_0x070e('0x88')]=function(_0x16e190,_0x174ca6,_0x32b286){scripts['googleASR'](_0x174ca6,_0x16e190[_0x070e('0x78')],_0x16e190[_0x070e('0x89')]||_0x070e('0x5a'))[_0x070e('0x11')](function(_0x259ac4){_0x32b286(null,_0x259ac4);})['catch'](function(_0x2531f7){_0x32b286(_0x2531f7);});};AGIVertices[_0x070e('0xd')][_0x070e('0x8a')]=function(_0x350c28,_0x224223,_0x31ceee){scripts[_0x070e('0x8a')](_0x224223,_0x350c28[_0x070e('0x8b')],_0x350c28[_0x070e('0x8c')],_0x350c28[_0x070e('0x8d')])[_0x070e('0x11')](function(_0x2614b2){_0x31ceee(null,_0x2614b2);})[_0x070e('0x13')](function(_0xf1edc1){_0x31ceee(_0xf1edc1);});};AGIVertices[_0x070e('0xd')][_0x070e('0x8e')]=function(_0x4df50c){var _0x48fe1d=_[_0x070e('0x62')](verticesWithRetry,_0x4df50c[_0x070e('0x35')])?_0x4df50c:_['clone'](_0x4df50c);for(var _0x5d8c9f in _0x48fe1d){if(_0x48fe1d['hasOwnProperty'](_0x5d8c9f)){if(_0x48fe1d[_0x5d8c9f]&&_['isString'](_0x48fe1d[_0x5d8c9f])){if(_[_0x070e('0x62')](recursiveMapAttributes,_0x5d8c9f)){_0x48fe1d[_0x5d8c9f]=this[_0x070e('0x8f')](_0x48fe1d[_0x5d8c9f]);}else{_0x48fe1d[_0x5d8c9f]=this[_0x070e('0x90')](_0x48fe1d[_0x5d8c9f]);}}}}return _0x48fe1d;};AGIVertices[_0x070e('0xd')][_0x070e('0x91')]=function(_0x3973e8){for(var _0x32cfe3 in _0x3973e8){if(_0x3973e8[_0x070e('0x92')](_0x32cfe3)){if(_[_0x070e('0x93')](_0x3973e8[_0x32cfe3])){return this[_0x070e('0x91')](_0x3973e8[_0x32cfe3]);}_0x3973e8[_0x32cfe3]=this['replaceAllVariables'](_0x3973e8[_0x32cfe3]);}}};AGIVertices[_0x070e('0xd')][_0x070e('0x94')]=function(_0x49c66a,_0x30db4a){for(var _0x2890ba in _0x49c66a){if(_0x49c66a[_0x070e('0x92')](_0x2890ba)){if(_[_0x070e('0x93')](_0x49c66a[_0x2890ba])){if(!_['isEmpty'](_0x49c66a[_0x2890ba])){this[_0x070e('0x94')](_0x49c66a[_0x2890ba],util[_0x070e('0x52')](_0x070e('0x95'),_0x30db4a,_0x2890ba));}}else{if(_0x49c66a[_0x2890ba]){this[_0x070e('0xc')]['setVariable'](util[_0x070e('0x52')](_0x070e('0x95'),_0x30db4a,_0x2890ba),_0x49c66a[_0x2890ba]);}}}}};AGIVertices[_0x070e('0xd')][_0x070e('0x8f')]=function(_0xdb8036){try{var _0x27b51c=JSON[_0x070e('0x69')](_0xdb8036);this[_0x070e('0x91')](_0x27b51c);return JSON[_0x070e('0x70')](_0x27b51c);}catch(_0x1a41f2){return this[_0x070e('0x90')](_0xdb8036);}};AGIVertices['prototype'][_0x070e('0x90')]=function(_0x2b5210){var _0x5e3263=_0x2b5210['split']('{');for(var _0x6ac3c9=0x1;_0x6ac3c9<_0x5e3263['length'];_0x6ac3c9+=0x1){var _0x2c759a=_0x5e3263[_0x6ac3c9][_0x070e('0x96')]('}');if(_0x2c759a[_0x070e('0x97')]>0x1){_0x2b5210=_0x2b5210[_0x070e('0x98')]('{'+_0x2c759a[0x0]+'}',this[_0x070e('0xc')][_0x070e('0xe')](_0x2c759a[0x0])[_0x070e('0x99')]||_0x2c759a[0x0]);}}if(_0x5e3263['length']===0x1){return _0x2b5210[_0x070e('0x49')]();}return this[_0x070e('0x90')](_0x2b5210);};AGIVertices[_0x070e('0xd')][_0x070e('0x9a')]=function(_0x4a9c99,_0x4e4065){var _0x113faa=this[_0x070e('0xc')][_0x070e('0xe')](_0x4a9c99);if(_0x113faa['result']===-0x1){return _0x113faa;}logger[_0x070e('0x29')](util[_0x070e('0x52')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4e4065,_0x113faa[_0x070e('0x99')]));return this[_0x070e('0xc')][_0x070e('0x9b')](_0x4e4065,_0x113faa[_0x070e('0x99')]);};AGIVertices[_0x070e('0xd')][_0x070e('0x80')]=function(_0x56169b){return _0x56169b&&_0x56169b!=='0'&&_0x56169b!=='-1'&&_0x56169b!=='';};AGIVertices['prototype'][_0x070e('0x9c')]=function(_0x54b6af){this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x54b6af,'-');_0x54b6af['retry']=_0x54b6af[_0x070e('0x9c')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x070e('0x7')]=function(_0x31ccef){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x9d'),_0x31ccef[_0x070e('0x34')]));return this['channel'][_0x070e('0x7')]([_0x31ccef[_0x070e('0x9e')],_0x31ccef['args']]);};AGIVertices['prototype'][_0x070e('0x9f')]=function(_0x8e9b5c){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xa0'),_0x8e9b5c[_0x070e('0x34')]));if(this[_0x070e('0x80')](_0x8e9b5c[_0x070e('0x60')])){logger['info'](util[_0x070e('0x52')](_0x070e('0xa1'),_0x8e9b5c[_0x070e('0x60')]));var _0x2f5597=this[_0x070e('0xc')][_0x070e('0xa2')](_0x8e9b5c[_0x070e('0x60')]);if(_0x2f5597[_0x070e('0xa3')]===-0x1){return _0x2f5597;}}return this['channel'][_0x070e('0x9f')]();};AGIVertices[_0x070e('0xd')][_0x070e('0x48')]=function(_0xbc61f2){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xa4'),_0xbc61f2[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0xbc61f2[_0x070e('0x46')])){return this['channel']['error'](_0xbc61f2,_0x070e('0xa5'));}_0xbc61f2[_0x070e('0x47')]=moment();if(this[_0x070e('0x80')](_0xbc61f2['delay'])){_0xbc61f2[_0x070e('0x47')]=moment()[_0x070e('0xa6')](_0xbc61f2['delay'],_0x070e('0xa7'));}if(!this[_0x070e('0x80')](_0xbc61f2[_0x070e('0x4a')])){_0xbc61f2[_0x070e('0x4a')]=0x2;}this[_0x070e('0x40')][_0x070e('0x6e')](this,_0xbc61f2);return this['channel']['noop'](util[_0x070e('0x52')](_0x070e('0xa8'),_0xbc61f2['phone'],_0xbc61f2[_0x070e('0x46')],_0xbc61f2[_0x070e('0x47')]));};AGIVertices[_0x070e('0xd')][_0x070e('0xa9')]=function(_0x38e448){logger[_0x070e('0x29')](util['format'](_0x070e('0xaa'),_0x38e448[_0x070e('0x34')]));var _0x5d7a66=this[_0x070e('0xc')][_0x070e('0xab')](_0x38e448[_0x070e('0xac')],_0x38e448[_0x070e('0x76')]);if(_0x5d7a66['result']===-0x1){return _0x5d7a66;}return this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xae'),_0x38e448[_0x070e('0xac')],_0x38e448[_0x070e('0x76')]));};AGIVertices[_0x070e('0xd')][_0x070e('0xaf')]=function(_0x2e1753){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2e1753[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x2e1753[_0x070e('0x59')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xb0'));}var _0x35ddab='\x22'+_0x2e1753['text']+'\x22';if(this['isConfigured'](_0x2e1753[_0x070e('0x76')])){_0x35ddab+=','+_0x2e1753[_0x070e('0x76')];}var _0x1abf03=this['channel'][_0x070e('0xab')](_0x070e('0xb1'),_0x35ddab);if(_0x1abf03[_0x070e('0xa3')]===-0x1){return _0x1abf03;}return this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0xb2'),_0x35ddab));};AGIVertices[_0x070e('0xd')]['sestektts']=function(_0x2a94f9){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x2a94f9[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x2a94f9[_0x070e('0x59')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xb0'));}var _0x1ed436='\x22'+_0x2a94f9['text']+'\x22';if(this[_0x070e('0x80')](_0x2a94f9[_0x070e('0x76')])){_0x1ed436+=','+_0x2a94f9[_0x070e('0x76')];}var _0x41afe5=this[_0x070e('0xc')][_0x070e('0xab')]('MRCPSynth',_0x1ed436);if(_0x41afe5[_0x070e('0xa3')]===-0x1){return _0x41afe5;}return this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xb2'),_0x1ed436));};AGIVertices['prototype'][_0x070e('0xb3')]=function(_0x458f92){logger[_0x070e('0x29')](util['format'](_0x070e('0xb4'),_0x458f92[_0x070e('0x34')]));if(!this['isConfigured'](_0x458f92[_0x070e('0xb5')])){return this[_0x070e('0xc')]['noop']('no\x20grammar\x20configured');}var _0x4e85ee=_0x458f92['grammar'];if(this[_0x070e('0x80')](_0x458f92[_0x070e('0x76')])){_0x4e85ee+=','+_0x458f92[_0x070e('0x76')];}var _0x277ca5=this[_0x070e('0xc')][_0x070e('0xab')](_0x070e('0xb6'),_0x4e85ee);if(_0x277ca5[_0x070e('0xa3')]===-0x1){return _0x277ca5;}var _0x569425=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x569425[_0x070e('0xa3')]===-0x1){return _0x569425;}var _0x41e59b=this[_0x070e('0x9a')](_0x070e('0xb7'),_0x070e('0xb8'));if(_0x41e59b['result']===-0x1){return _0x41e59b;}var _0x528946=this[_0x070e('0x9a')](_0x070e('0xb9'),'LUMENVOX_ASR_INSTANCE');if(_0x528946[_0x070e('0xa3')]===-0x1){return _0x528946;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xba'),_0x4e85ee));};AGIVertices[_0x070e('0xd')]['sestekasr']=function(_0x202ebf){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x202ebf[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x202ebf[_0x070e('0xb5')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xbb'));}var _0x2beaa8=_0x202ebf['grammar'];if(this[_0x070e('0x80')](_0x202ebf[_0x070e('0x76')])){_0x2beaa8+=','+_0x202ebf['options'];}var _0x369de9=this['channel'][_0x070e('0xab')]('MRCPRecog',_0x2beaa8);if(_0x369de9[_0x070e('0xa3')]===-0x1){return _0x369de9;}var _0x49f218=this['getAndSetVariable'](_0x070e('0xbc'),'SESTEK_ASR_CONFIDENCE');if(_0x49f218['result']===-0x1){return _0x49f218;}var _0x7966d4=this[_0x070e('0x9a')](_0x070e('0xb7'),_0x070e('0xbd'));if(_0x7966d4[_0x070e('0xa3')]===-0x1){return _0x7966d4;}var _0x5413dc=this[_0x070e('0x9a')](_0x070e('0xb9'),_0x070e('0xbe'));if(_0x5413dc[_0x070e('0xa3')]===-0x1){return _0x5413dc;}return this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0xba'),_0x2beaa8));};AGIVertices[_0x070e('0xd')][_0x070e('0xbf')]=function(_0x44c780){logger['info'](util['format'](_0x070e('0xc0'),_0x44c780[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x44c780[_0x070e('0xc1')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x44c780,'no\x20database\x20selected');}var _0x354257=this[_0x070e('0x16')][_0x070e('0x6e')](this,_0x44c780[_0x070e('0xc1')]);if(!_0x354257){return this[_0x070e('0xc')][_0x070e('0x27')](_0x44c780,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x44c780[_0x070e('0x2b')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x44c780,_0x070e('0xc2'));}var _0x3a8dd7=_0x44c780[_0x070e('0x2b')][_0x070e('0xc3')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x070e('0xad')](util['format'](_0x070e('0xc4'),_0x3a8dd7));var _0x5dc059=this['getQueryOdbc']['sync'](this,_0x354257,_0x3a8dd7);this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x44c780,_0x3a8dd7);if(!this[_0x070e('0x80')](_0x44c780[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xc6'));}var _0x37285d=this[_0x070e('0xe')]['sync'](this,_0x44c780[_0x070e('0xc5')]);if(!_0x37285d){return this[_0x070e('0xc')][_0x070e('0x27')](_0x44c780,_0x070e('0xc7'));}var _0x243fc7=this;_0x5dc059[_0x070e('0xc8')](function(_0x32ebf1,_0x13f234){Object[_0x070e('0xc9')](_0x32ebf1)['forEach'](function(_0x538f0c){_0x243fc7[_0x070e('0xc')][_0x070e('0x9b')](util['format'](_0x070e('0xca'),_0x37285d,_0x13f234,_0x538f0c),_0x32ebf1[_0x538f0c]);});});this['channel']['setVariable'](util[_0x070e('0x52')](_0x070e('0xcb'),_0x37285d),_0x5dc059['length']);return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('variable\x20%s\x20set',_0x37285d));};AGIVertices['prototype'][_0x070e('0xcc')]=function(_0x33bd72){logger[_0x070e('0xcd')](util['format'](_0x070e('0xce'),_0x33bd72[_0x070e('0x34')]));if(!this['isConfigured'](_0x33bd72[_0x070e('0xcf')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x33bd72,_0x070e('0xd0'));}var _0x3f7b2c=this[_0x070e('0x18')][_0x070e('0x6e')](this,_0x33bd72[_0x070e('0xcf')]);if(!_0x3f7b2c){return this[_0x070e('0xc')][_0x070e('0x27')](_0x33bd72,_0x070e('0xd1'));}var _0x2b45d5=this[_0x070e('0xc')][_0x070e('0xab')](_0x070e('0xd2'),[util[_0x070e('0x52')](_0x070e('0xd3'),_0x3f7b2c),_0x33bd72['timeout'],_0x33bd72['opts'],_0x33bd72['url']]);if(_0x2b45d5['result']===-0x1){return _0x2b45d5;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('Executed\x20command\x20%s',_0x070e('0xd2')));};AGIVertices[_0x070e('0xd')][_0x070e('0xd4')]=function(_0x4a20dc){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xd5'),_0x4a20dc[_0x070e('0x34')]));if(!this['isConfigured'](_0x4a20dc[_0x070e('0x78')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20key\x20configured');}if(!this[_0x070e('0x80')](_0x4a20dc[_0x070e('0x59')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xb0'));}this[_0x070e('0xc')][_0x070e('0xd6')]=!![];this[_0x070e('0x32')](_0x4a20dc);this[_0x070e('0x3f')](_0x4a20dc['text'],'in');this['channel'][_0x070e('0xad')](util['format']('Trying\x20Dialogflow:\x20%s',_0x4a20dc[_0x070e('0x59')]));var _0x6479e4=this[_0x070e('0x77')][_0x070e('0x6e')](this,_0x4a20dc);if(_0x6479e4){for(var _0x7cf78b in _0x6479e4){if(_0x6479e4[_0x070e('0x92')](_0x7cf78b)){this['channel'][_0x070e('0x9b')](util[_0x070e('0x52')](_0x070e('0xd7'),_0x7cf78b[_0x070e('0x66')]()),_0x6479e4[_0x7cf78b]);}}this['createSquareMessage'](_0x6479e4[_0x070e('0xd8')],'out');return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xd9'),_0x6479e4[_0x070e('0xd8')]));}return this[_0x070e('0xc')][_0x070e('0x27')](_0x4a20dc,_0x070e('0xda'));};AGIVertices[_0x070e('0xd')]['sesteknda']=function(_0xc35037){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xdb'),_0xc35037[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0xc35037[_0x070e('0xdc')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xdd'));}if(!this[_0x070e('0x80')](_0xc35037['username'])){return this['channel'][_0x070e('0xad')](_0x070e('0xde'));}if(!this[_0x070e('0x80')](_0xc35037[_0x070e('0xdf')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20password\x20configured');}if(!this['isConfigured'](_0xc35037[_0x070e('0xe0')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xb0'));}this['channel'][_0x070e('0xd6')]=!![];this[_0x070e('0x32')](_0xc35037);this['createSquareMessage'](_0xc35037[_0x070e('0x59')],'in');this[_0x070e('0xc')]['noop'](util['format'](_0x070e('0xe1'),_0xc35037['text']));var _0x1ebec9=this[_0x070e('0x7a')][_0x070e('0x6e')](this,_0xc35037);if(_0x1ebec9){for(var _0x5ef06f in _0x1ebec9){if(_0x1ebec9[_0x070e('0x92')](_0x5ef06f)){this[_0x070e('0xc')]['setVariable'](util[_0x070e('0x52')](_0x070e('0xe2'),_0x5ef06f[_0x070e('0x66')]()),_0x1ebec9[_0x5ef06f]);}}this[_0x070e('0x3f')](_0x1ebec9[_0x070e('0xd8')],_0x070e('0xe3'));if(_0x1ebec9[_0x070e('0xe4')]){this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1ebec9[_0x070e('0xe4')]));var _0x11a111=this[_0x070e('0xc')]['streamFile'](_0x1ebec9['audiofile']);try{fs[_0x070e('0xe5')](_0x1ebec9[_0x070e('0xe4')]+_0x070e('0xe6'));}catch(_0x2f237f){logger['error'](_0x2f237f);}return _0x11a111;}else{return this[_0x070e('0xc')]['noop'](util['format'](_0x070e('0xe7'),_0x1ebec9['speech']));}}return this[_0x070e('0xc')][_0x070e('0x27')](_0xc35037,_0x070e('0xe8'));};AGIVertices[_0x070e('0xd')]['end']=function(_0x2e104b){logger['info'](util[_0x070e('0x52')](_0x070e('0xe9'),_0x2e104b[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xea'));};AGIVertices[_0x070e('0xd')][_0x070e('0xeb')]=function(_0xa4fe4e){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xec'),_0xa4fe4e[_0x070e('0x34')]));var _0x11e768='';if(_0xa4fe4e[_0x070e('0xed')]){if(!this[_0x070e('0x80')](_0xa4fe4e['trunk_id'])){return this['channel'][_0x070e('0x27')](_0xa4fe4e,_0x070e('0xee'));}else{var _0x4f6dab=parseInt(_0xa4fe4e[_0x070e('0xed')],0xa);if(isNaN(_0x4f6dab)){_0x11e768=_0xa4fe4e[_0x070e('0xed')];}else{_0x11e768=this['getTrunk'][_0x070e('0x6e')](this,_0xa4fe4e[_0x070e('0xed')]);if(!_0x11e768){return this['channel'][_0x070e('0x27')](_0xa4fe4e,_0x070e('0xef'));}}}}else if(_0xa4fe4e[_0x070e('0xf0')]){_0x11e768=_0xa4fe4e[_0x070e('0xf0')];}else{return this[_0x070e('0xc')][_0x070e('0x27')](_0xa4fe4e,'no\x20trunk\x20selected');}var _0x3a01db=this[_0x070e('0xc')][_0x070e('0xab')]('DIAL',[util[_0x070e('0x52')](_0x070e('0xf1'),_0x11e768,_0xa4fe4e[_0x070e('0x45')]),_0xa4fe4e[_0x070e('0x60')],_0xa4fe4e['opts'],_0xa4fe4e['url']]);if(_0x3a01db[_0x070e('0xa3')]===-0x1){return _0x3a01db;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xf2'),_0x070e('0xd2')));};AGIVertices[_0x070e('0xd')]['finally']=function(_0xb14da8){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xf3'),_0xb14da8[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xf4'));};AGIVertices[_0x070e('0xd')][_0x070e('0xa')]=function(_0x15966e){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xf5'),_0x15966e[_0x070e('0x34')]));if(_0x15966e['retry']===0x0){return this[_0x070e('0x9c')](_0x15966e);}_0x15966e[_0x070e('0xf6')]-=0x1;if(!this[_0x070e('0x80')](_0x15966e[_0x070e('0xf7')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x15966e,_0x070e('0xf8'));}var _0x5a002d=this[_0x070e('0x1c')][_0x070e('0x6e')](this,_0x15966e[_0x070e('0xf7')]);if(!_0x5a002d){return this[_0x070e('0xc')][_0x070e('0x27')](_0x15966e,_0x070e('0xf9'));}if(!this[_0x070e('0x80')](_0x15966e[_0x070e('0xc5')])){return this[_0x070e('0xc')]['error'](_0x070e('0xc6'));}var _0x3b5379=this[_0x070e('0xc')][_0x070e('0xfa')](_0x5a002d,_0x15966e[_0x070e('0xfb')],_0x15966e[_0x070e('0xfc')]);var _0x3736ca=_0x3b5379[_0x070e('0xa3')]?_0x3b5379[_0x070e('0xa3')][_0x070e('0x49')]():'';logger[_0x070e('0x29')](_0x070e('0xfd'),JSON[_0x070e('0x70')](_0x3b5379));if(_0x3b5379[_0x070e('0xa3')]===-0x1){this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x15966e,_0x3736ca);return _0x3b5379;}else if(_0x3b5379[_0x070e('0x99')]===_0x070e('0x60')){_0x3b5379[_0x070e('0xa3')]=_0x3736ca[_0x070e('0x97')]>=parseInt(_0x15966e[_0x070e('0xfe')])?'x':'i';}else{_0x3b5379[_0x070e('0xa3')]=_0x3736ca['length']>=parseInt(_0x15966e[_0x070e('0xfe')])&&_0x3736ca[_0x070e('0x97')]<=parseInt(_0x15966e[_0x070e('0xfc')])?'x':'i';}var _0x35242d=this['getVariable'][_0x070e('0x6e')](this,_0x15966e['variable_id']);if(!_0x35242d){return this[_0x070e('0xc')]['error'](_0x15966e,'no\x20variable\x20found');}this[_0x070e('0xc')][_0x070e('0x9b')](_0x35242d,_0x3736ca);if(this[_0x070e('0x80')](_0x15966e['hiddendigitsnum'])){var _0x11e90d=parseInt(_0x15966e['hiddendigitsnum'],0xa);var _0x120acd=rs[_0x070e('0xff')]({'charset':'*','length':_0x11e90d});var _0x4f11dc=_0x3736ca[_0x070e('0x97')];if(_0x4f11dc>0x0){if(_0x4f11dc>_0x11e90d){this['createSquareDetailsReport'][_0x070e('0x6e')](this,_0x15966e,_0x15966e[_0x070e('0x100')]===_0x070e('0x101')?_0x120acd+_0x3736ca['substr'](_0x11e90d):_0x3736ca['substr'](0x0,_0x4f11dc-_0x11e90d)+_0x120acd);}else{this[_0x070e('0x32')]['sync'](this,_0x15966e,rs[_0x070e('0xff')]({'charset':'*','length':_0x4f11dc}));}}else{this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x15966e,'');}}else{this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x15966e,_0x3736ca);}return _0x3b5379;};AGIVertices[_0x070e('0xd')]['getsecretdigits']=function(_0x58d330){logger[_0x070e('0x29')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x58d330[_0x070e('0x34')]));return this[_0x070e('0xa')](_0x58d330);};AGIVertices[_0x070e('0xd')]['goal']=function(_0x241d86){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x241d86['label']));this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x241d86,_0x241d86[_0x070e('0x102')]);return this['channel'][_0x070e('0xad')](util['format'](_0x070e('0x103'),_0x241d86['goalname']));};AGIVertices[_0x070e('0xd')][_0x070e('0x104')]=function(_0x530311){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x105'),_0x530311[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x530311[_0x070e('0x83')])||!this[_0x070e('0x80')](_0x530311[_0x070e('0x84')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x106'));}if(!this[_0x070e('0x80')](_0x530311[_0x070e('0x59')])){return this['channel'][_0x070e('0xad')](_0x070e('0xb0'));}this[_0x070e('0xc')]['noop'](util['format'](_0x070e('0x107'),_0x530311[_0x070e('0x59')]));var _0x5ab97b=this[_0x070e('0x82')][_0x070e('0x6e')](this,_0x530311);if(_0x5ab97b){this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')]('aws\x20Polly\x20%s\x20file\x20created',_0x5ab97b));var _0x27fc1f=this[_0x070e('0xc')]['streamFile'](_0x5ab97b);try{fs[_0x070e('0xe5')](_0x5ab97b+_0x070e('0xe6'));}catch(_0x3dac08){logger[_0x070e('0x27')](_0x3dac08);}return _0x27fc1f;}return this[_0x070e('0xc')][_0x070e('0x27')](_0x530311,_0x070e('0x108'));};AGIVertices[_0x070e('0xd')][_0x070e('0x109')]=function(_0x5d8b98){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x10a'),_0x5d8b98[_0x070e('0x34')]));if(!this['isConfigured'](_0x5d8b98['aws_access_key_id'])||!this['isConfigured'](_0x5d8b98[_0x070e('0x84')])){return this['channel'][_0x070e('0xad')](_0x070e('0x106'));}if(!this['isConfigured'](_0x5d8b98[_0x070e('0x10b')])){return this['channel']['noop'](_0x070e('0x10c'));}if(!this[_0x070e('0x80')](_0x5d8b98[_0x070e('0x59')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xb0'));}this[_0x070e('0xc')][_0x070e('0xd6')]=!![];this[_0x070e('0x32')](_0x5d8b98);this[_0x070e('0x3f')](_0x5d8b98[_0x070e('0x59')],'in');this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x10d'),_0x5d8b98[_0x070e('0x59')]));var _0x3f8bb0=this[_0x070e('0x87')][_0x070e('0x6e')](this,_0x5d8b98);if(_0x3f8bb0){for(var _0x4d2b60 in _0x3f8bb0){if(_0x3f8bb0['hasOwnProperty'](_0x4d2b60)&&_['isString'](_0x3f8bb0[_0x4d2b60])){this[_0x070e('0xc')][_0x070e('0x9b')](util[_0x070e('0x52')]('AWS_LEX_%s',_0x4d2b60[_0x070e('0x66')]()),_0x3f8bb0[_0x4d2b60]);}}if(_[_0x070e('0x42')](_0x3f8bb0['message'])){return this['channel'][_0x070e('0xad')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x070e('0x3f')](_0x3f8bb0[_0x070e('0x74')],_0x070e('0xe3'));return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('Amazon\x20Lex\x20Result\x20%s',_0x3f8bb0[_0x070e('0x74')]));}}return this[_0x070e('0xc')][_0x070e('0x27')](_0x5d8b98,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x070e('0xd')]['googleasr']=function(_0x56c577){logger[_0x070e('0x29')](util['format'](_0x070e('0x10e'),_0x56c577['label'],_0x56c577[_0x070e('0x60')]));if(!this[_0x070e('0x80')](_0x56c577['key'])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x10f'));}var _0x293fdd=_0x070e('0x110');var _0x2e7302=util[_0x070e('0x52')](_0x070e('0x111'),FILES_PATH,rs[_0x070e('0xff')](0x4));var _0x161986=util['format'](_0x070e('0x95'),_0x2e7302,_0x293fdd);var _0x58530a=!![];if(_0x56c577[_0x070e('0x112')]===_0x070e('0x113')){_0x58530a=![];}var _0x58052b=this[_0x070e('0xc')]['recordFile'](_0x2e7302,_0x293fdd,_0x56c577[_0x070e('0x114')],_0x56c577['timeout'],undefined,_0x58530a);if(_0x58052b[_0x070e('0xa3')]!==-0x1){this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x115'),_0x161986));var _0x2f4102=this[_0x070e('0x88')][_0x070e('0x6e')](this,_0x56c577,_0x161986);if(_0x2f4102){for(var _0x5cbcf6 in _0x2f4102){if(_0x2f4102[_0x070e('0x92')](_0x5cbcf6)){this['channel']['setVariable'](util[_0x070e('0x52')]('GOOGLE_ASR_%s',_0x5cbcf6['toUpperCase']()),_0x2f4102[_0x5cbcf6]);}}return this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x116'),JSON[_0x070e('0x70')](_0x2f4102)));}}return _0x58052b;};AGIVertices['prototype'][_0x070e('0x117')]=function(_0xb2eb99){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x118'),_0xb2eb99['label']));if(!this[_0x070e('0x80')](_0xb2eb99[_0x070e('0x8b')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x119'));}if(!this[_0x070e('0x80')](_0xb2eb99[_0x070e('0x8c')])){return this['channel'][_0x070e('0xad')](_0x070e('0x11a'));}var _0x231e23=_0x070e('0x110');var _0x4f8b92=util[_0x070e('0x52')](_0x070e('0x111'),FILES_PATH,rs[_0x070e('0xff')](0x4));var _0x4b190e=util[_0x070e('0x52')](_0x070e('0x95'),_0x4f8b92,_0x231e23);var _0x73e3f4=!![];if(_0xb2eb99['beep']===_0x070e('0x113')){_0x73e3f4=![];}var _0x581b04=this[_0x070e('0xc')][_0x070e('0x11b')](_0x4f8b92,_0x231e23,_0xb2eb99[_0x070e('0x114')],_0xb2eb99[_0x070e('0x60')],undefined,_0x73e3f4);if(_0x581b04['result']!==-0x1){this[_0x070e('0xc')][_0x070e('0xad')](util['format']('tilde\x20%s\x20file\x20created',_0x4b190e));var _0x163bd1=this[_0x070e('0x8a')][_0x070e('0x6e')](this,_0xb2eb99,_0x4b190e);if(_0x163bd1){for(var _0x188811 in _0x163bd1){if(_0x163bd1['hasOwnProperty'](_0x188811)){this[_0x070e('0xc')][_0x070e('0x9b')](util[_0x070e('0x52')]('TILDE_ASR_%s',_0x188811[_0x070e('0x66')]()),_0x163bd1[_0x188811]);}}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x163bd1)));}}return _0x581b04;};AGIVertices[_0x070e('0xd')][_0x070e('0x11c')]=function(_0x58c7e1){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x58c7e1['label']));return this[_0x070e('0xc')][_0x070e('0x11d')](_0x58c7e1[_0x070e('0x11e')],_0x58c7e1[_0x070e('0x3a')],_0x58c7e1['priority']);};AGIVertices['prototype'][_0x070e('0x11f')]=function(_0x20d4ba){logger['info'](util[_0x070e('0x52')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x20d4ba[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x20d4ba[_0x070e('0x120')])){return this['channel'][_0x070e('0x27')](_0x20d4ba,'no\x20condition\x20configured');}try{var _0x500281=eval(_0x20d4ba['condition'])?_0x070e('0x121'):_0x070e('0x122');this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x123'),_0x20d4ba[_0x070e('0x120')],_0x500281));return{'code':0xc8,'result':_0x500281};}catch(_0x1a9fb6){return{'code':0xc8,'result':_0x070e('0x122')};}};AGIVertices[_0x070e('0xd')][_0x070e('0x124')]=function(_0x5f31f8){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5f31f8['label']));if(!this[_0x070e('0x80')](_0x5f31f8[_0x070e('0x125')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x5f31f8,'no\x20interval\x20configured');}var _0x1935cb=this[_0x070e('0x126')][_0x070e('0x6e')](this,_0x5f31f8[_0x070e('0x125')]);if(!_0x1935cb){return this[_0x070e('0xc')][_0x070e('0x27')](_0x5f31f8,'no\x20intervals\x20found');}for(var _0x312b21=0x0;_0x312b21<_0x1935cb['length'];_0x312b21+=0x1){var _0x260eb9=this[_0x070e('0xc')][_0x070e('0xe')](util[_0x070e('0x52')](_0x070e('0x127'),_0x1935cb[_0x312b21]));if(_0x260eb9[_0x070e('0xa3')]===-0x1){return _0x260eb9;}logger[_0x070e('0x29')](util['format'](_0x070e('0x128'),_0x1935cb[_0x312b21],_0x260eb9[_0x070e('0x99')]));if(_0x260eb9[_0x070e('0x99')]===_0x070e('0x121')){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x128'),_0x1935cb[_0x312b21],_0x070e('0x121')));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x128'),_0x1935cb[_0x312b21],_0x070e('0x121')));return{'code':0xc8,'result':_0x070e('0x121')};}else{logger['info'](util[_0x070e('0x52')](_0x070e('0x128'),_0x1935cb[_0x312b21],'false'));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x128'),_0x1935cb[_0x312b21],'false'));}}return{'code':0xc8,'result':_0x070e('0x122')};};AGIVertices[_0x070e('0xd')]['hangup']=function(_0x1ba1ea){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x129'),_0x1ba1ea[_0x070e('0x34')]));return this['channel'][_0x070e('0x12a')]();};AGIVertices[_0x070e('0xd')][_0x070e('0x12b')]=function(_0x1d2b7a){logger['info'](util[_0x070e('0x52')](_0x070e('0x12c'),_0x1d2b7a[_0x070e('0x34')]));if(!this['isConfigured'](_0x1d2b7a[_0x070e('0x78')])){return this[_0x070e('0xc')]['noop'](_0x070e('0x10f'));}var _0x30a7ca=_0x070e('0x110');var _0x4264d0=util['format'](_0x070e('0x111'),FILES_PATH,rs['generate'](0x4));var _0x2570b6=util[_0x070e('0x52')](_0x070e('0x95'),_0x4264d0,_0x30a7ca);var _0x57110b=!![];if(_0x1d2b7a['beep']==='NOBEEP'){_0x57110b=![];}var _0x2fc59f=this[_0x070e('0xc')]['recordFile'](_0x4264d0,_0x30a7ca,_0x1d2b7a[_0x070e('0x114')],_0x1d2b7a[_0x070e('0x60')],undefined,_0x57110b);if(_0x2fc59f[_0x070e('0xa3')]!==-0x1){this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x12d'),_0x2570b6));var _0x5b5fea=this[_0x070e('0x7e')]['sync'](this,_0x1d2b7a,_0x2570b6);if(_0x5b5fea){for(var _0x418e44 in _0x5b5fea){if(_0x5b5fea[_0x070e('0x92')](_0x418e44)){this[_0x070e('0xc')][_0x070e('0x9b')](util['format'](_0x070e('0x12e'),_0x418e44[_0x070e('0x66')]()),_0x5b5fea[_0x418e44]);}}return this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')]('IspeechASR\x20Result\x20%s',JSON[_0x070e('0x70')](_0x5b5fea)));}}return _0x2fc59f;};AGIVertices[_0x070e('0xd')][_0x070e('0x12f')]=function(_0x4d4f9e){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x130'),_0x4d4f9e[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x4d4f9e[_0x070e('0x78')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x10f'));}if(!this[_0x070e('0x80')](_0x4d4f9e[_0x070e('0x59')])){return this['channel'][_0x070e('0xad')](_0x070e('0xb0'));}this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x131'),_0x4d4f9e[_0x070e('0x59')]));var _0xd1b431=this[_0x070e('0x7b')][_0x070e('0x6e')](this,_0x4d4f9e);if(_0xd1b431){this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0x12d'),_0xd1b431));var _0x2f8f75=this[_0x070e('0xc')]['streamFile'](_0xd1b431,_0x4d4f9e[_0x070e('0x114')]);try{fs[_0x070e('0xe5')](_0xd1b431+_0x070e('0xe6'));}catch(_0x42c8b3){logger[_0x070e('0x27')](_0x42c8b3);}return _0x2f8f75;}return this[_0x070e('0xc')][_0x070e('0x27')](_0x4d4f9e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x070e('0xd')][_0x070e('0x132')]=function(_0x32aa30){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x32aa30[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x32aa30['findBy'])){return this['channel']['error'](_0x32aa30,_0x070e('0x133'));}logger[_0x070e('0x29')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x070e('0xc')]['callerid'],_0x32aa30[_0x070e('0x134')]));var _0x5fcc97=this[_0x070e('0x50')][_0x070e('0x6e')](this,_0x32aa30[_0x070e('0x134')]);if(_0x5fcc97){logger[_0x070e('0x29')](util[_0x070e('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x070e('0xc')][_0x070e('0x37')],_0x32aa30[_0x070e('0x134')]));this[_0x070e('0xc')]['noop'](util['format'](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x32aa30['findBy']));return{'code':0xc8,'result':_0x070e('0x136')};}else{logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x137'),this['channel']['callerid'],_0x32aa30[_0x070e('0x134')]));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x137'),this['channel']['callerid'],_0x32aa30['findBy']));return{'code':0xc8,'result':_0x070e('0x138')};}};AGIVertices[_0x070e('0xd')][_0x070e('0x139')]=function(_0x3b9780){logger['info'](util[_0x070e('0x52')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3b9780['label']));if(!this[_0x070e('0x80')](_0x3b9780[_0x070e('0x134')])){return this['channel'][_0x070e('0x27')](_0x3b9780,_0x070e('0x133'));}logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x13a'),this[_0x070e('0xc')]['callerid'],_0x3b9780[_0x070e('0x134')]));var _0x2e9e03=this[_0x070e('0x4f')]['sync'](this,_0x3b9780[_0x070e('0x134')]);if(_0x2e9e03){logger[_0x070e('0x29')](util[_0x070e('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x070e('0xc')][_0x070e('0x37')],_0x3b9780[_0x070e('0x134')]));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x3b9780[_0x070e('0x134')]));return{'code':0xc8,'result':_0x070e('0x136')};}else{logger['info'](util[_0x070e('0x52')](_0x070e('0x137'),this[_0x070e('0xc')][_0x070e('0x37')],_0x3b9780['findBy']));this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0x137'),this[_0x070e('0xc')]['callerid'],_0x3b9780[_0x070e('0x134')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x070e('0xd')]['math']=function(_0x5b85be){logger[_0x070e('0x29')](util['format'](_0x070e('0x13b'),_0x5b85be[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x5b85be[_0x070e('0x13c')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x5b85be,'no\x20operation\x20configured');}this['channel']['noop'](util['format'](_0x070e('0x13d'),_0x5b85be['operation']));var _0x295e24=eval(_0x5b85be[_0x070e('0x13c')]);if(!this[_0x070e('0x80')](_0x5b85be[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2ba494=this[_0x070e('0xe')][_0x070e('0x6e')](this,_0x5b85be[_0x070e('0xc5')]);if(!_0x2ba494){return this[_0x070e('0xc')][_0x070e('0x27')](_0x5b85be,'no\x20variable\x20found');}if(_[_0x070e('0x13e')](_0x295e24)){var _0x10bc10=this;_0x295e24[_0x070e('0xc8')](function(_0x52f5bd,_0x1f1885){_0x10bc10[_0x070e('0xc')][_0x070e('0x9b')](util[_0x070e('0x52')](_0x070e('0x13f'),_0x2ba494,_0x1f1885),_0x52f5bd);});return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x140'),_0x2ba494));}else{return this[_0x070e('0xc')][_0x070e('0x9b')](_0x2ba494,_0x295e24);}};AGIVertices[_0x070e('0xd')][_0x070e('0x9')]=function(_0x74805){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x141'),_0x74805[_0x070e('0x34')]));if(_0x74805[_0x070e('0xf6')]===0x0){return this[_0x070e('0x9c')](_0x74805);}_0x74805['retry']-=0x1;if(!this[_0x070e('0x80')](_0x74805['file_id'])){return this['channel'][_0x070e('0x27')](_0x74805,'no\x20file\x20audio\x20selected');}var _0x5ab7a3=this[_0x070e('0x1c')][_0x070e('0x6e')](this,_0x74805[_0x070e('0xf7')]);if(!_0x5ab7a3){return this[_0x070e('0xc')][_0x070e('0x27')](_0x74805,_0x070e('0xf9'));}var _0x432007=this[_0x070e('0xc')][_0x070e('0xfa')](_0x5ab7a3,_0x74805['response'],_0x74805[_0x070e('0x142')]);var _0x14db06=_0x432007[_0x070e('0xa3')];if(_0x432007[_0x070e('0xa3')]===-0x1){this[_0x070e('0x32')]['sync'](this,_0x74805,'-1');return _0x432007;}else if(_0x432007[_0x070e('0x99')]===_0x070e('0x60')){_0x432007[_0x070e('0xa3')]=_0x432007[_0x070e('0xa3')]['length']>0x0?_0x432007[_0x070e('0xa3')]:'t';}else if(_[_0x070e('0x41')](_0x432007['result'])){_0x432007[_0x070e('0xa3')]='#';_0x14db06='#';}if(!this[_0x070e('0x80')](_0x74805[_0x070e('0xc5')])){this[_0x070e('0xc')]['noop'](_0x070e('0xc6'));}else{var _0xf622a9=this[_0x070e('0xe')]['sync'](this,_0x74805[_0x070e('0xc5')]);if(!_0xf622a9){return this['channel'][_0x070e('0x27')](_0x74805,_0x070e('0xc7'));}this['channel'][_0x070e('0x9b')](_0xf622a9,_0x14db06);}this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x74805,_0x14db06);return _0x432007;};AGIVertices[_0x070e('0xd')][_0x070e('0xad')]=function(_0x87589c){logger[_0x070e('0x29')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x87589c[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0xad')](_0x87589c['output']||_0x87589c['label']);};AGIVertices[_0x070e('0xd')]['pause']=function(_0x4dae62){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x143'),_0x4dae62[_0x070e('0x34')]));if(!this['isConfigured'](_0x4dae62['findBy'])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x4dae62,_0x070e('0x133'));}logger[_0x070e('0x29')](util[_0x070e('0x52')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62[_0x070e('0x134')]));var _0x50c3a9=this[_0x070e('0x4b')]['sync'](this,_0x4dae62[_0x070e('0x144')]);var _0x1969fe=this[_0x070e('0x4c')][_0x070e('0x6e')](this,_0x4dae62[_0x070e('0x134')],_0x50c3a9);if(_0x1969fe){logger['info'](util['format'](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62['findBy']));this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62[_0x070e('0x134')]));return{'code':0xc8,'result':_0x070e('0x136')};}else{logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x137'),this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62[_0x070e('0x134')]));this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['playback']=function(_0x430d96){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x145'),_0x430d96[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x430d96[_0x070e('0xf7')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x430d96,'no\x20file\x20audio\x20selected');}var _0x5d4371=this['getSound']['sync'](this,_0x430d96[_0x070e('0xf7')]);if(!_0x5d4371){return this['channel'][_0x070e('0x27')](_0x430d96,_0x070e('0xf9'));}var _0x2b80c2=this[_0x070e('0xc')][_0x070e('0xab')](_0x070e('0x146'),[_0x5d4371,_0x430d96[_0x070e('0x147')]]);if(_0x2b80c2[_0x070e('0xa3')]===-0x1){return _0x2b80c2;}return this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xae'),_0x070e('0x146'),_0x5d4371));};AGIVertices[_0x070e('0xd')][_0x070e('0x148')]=function(_0x28215c){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x149'),_0x28215c[_0x070e('0x34')]));if(!this['isConfigured'](_0x28215c[_0x070e('0x14a')])){return this[_0x070e('0xc')]['error'](_0x28215c,_0x070e('0x14b'));}var _0x551a5f='';var _0x4cba0f=parseInt(_0x28215c[_0x070e('0x14a')],0xa);if(isNaN(_0x4cba0f)){_0x551a5f=_0x28215c['queue_id'];}else{_0x551a5f=this[_0x070e('0x14c')][_0x070e('0x6e')](this,_0x28215c[_0x070e('0x14a')]);if(!_0x551a5f){return this['channel'][_0x070e('0x27')](_0x28215c,'no\x20queue\x20found');}}var _0x43f3f6='';if(this['isConfigured'](_0x28215c[_0x070e('0xf7')])){var _0x2190ad=this[_0x070e('0x1c')]['sync'](this,_0x28215c['file_id']);if(_0x2190ad){_0x43f3f6=_0x2190ad;}}this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x28215c,_0x551a5f);if(_0x28215c[_0x070e('0x147')][_0x070e('0x14d')]('x')<0x0){_0x28215c['opts']+='x';}if(_0x28215c[_0x070e('0x147')][_0x070e('0x14d')]('X')<0x0){_0x28215c[_0x070e('0x147')]+='X';}this[_0x070e('0xc')][_0x070e('0x9b')](_0x070e('0x14e'),_0x551a5f?_0x551a5f['toLowerCase']():'');var _0xf57865=this[_0x070e('0xc')]['exec'](_0x070e('0x14f'),[_0x551a5f,_0x28215c[_0x070e('0x147')],_0x28215c[_0x070e('0x150')],_0x43f3f6,_0x28215c[_0x070e('0x60')],_0x28215c['agi'],_0x28215c['macro'],_0x28215c[_0x070e('0x151')],'',_0x28215c[_0x070e('0x152')]]);if(_0xf57865[_0x070e('0xa3')]===-0x1){return _0xf57865;}return this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0xae'),_0x070e('0x14f'),_0x551a5f));};AGIVertices[_0x070e('0xd')][_0x070e('0x153')]=function(_0x1f048d){logger['info'](util[_0x070e('0x52')](_0x070e('0x154'),_0x1f048d[_0x070e('0x34')]));var _0x341b84=_0x1f048d['recordingFormat']||_0x070e('0x110');var _0x3e5622=util['format'](_0x070e('0x155'),this[_0x070e('0xc')][_0x070e('0x33')],rs[_0x070e('0xff')](0x5));var _0xc73764=util[_0x070e('0x52')](_0x070e('0x156'),FILES_PATH,_0x3e5622,_0x341b84);var _0x1b3e90=util[_0x070e('0x52')]('%s/recordings/%s',FILES_PATH,_0x3e5622);this[_0x070e('0x38')][_0x070e('0x6e')](this,_0x1f048d,_0x3e5622,_0xc73764);this[_0x070e('0xc')][_0x070e('0x9b')](_0x070e('0x157'),_0x3e5622);logger[_0x070e('0x29')](_0x070e('0x158'),_0x1b3e90,_0x341b84,_0x1f048d['escape_digits'],_0x1f048d[_0x070e('0x60')]);return this[_0x070e('0xc')][_0x070e('0x11b')](_0x1b3e90,_0x341b84,_0x1f048d['escape_digits'],_0x1f048d[_0x070e('0x60')],undefined,!![]);};AGIVertices[_0x070e('0xd')][_0x070e('0x159')]=function(_0x12d53a){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x15a'),_0x12d53a[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x12d53a[_0x070e('0x150')])){return this['channel']['noop'](_0x070e('0x15b'));}var _0xb5b920=this[_0x070e('0x5f')]['sync'](this,_0x12d53a);logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x15c'),util['inspect'](_0xb5b920,{'showHidden':![],'depth':null})));if(!this[_0x070e('0x80')](_0x12d53a[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x7b081b=this[_0x070e('0xe')][_0x070e('0x6e')](this,_0x12d53a[_0x070e('0xc5')]);if(!_0x7b081b){return this[_0x070e('0xc')][_0x070e('0x27')](_0x12d53a,'no\x20variable\x20found');}this['channel'][_0x070e('0x9b')](util['format'](_0x070e('0x15d'),_0x7b081b),_0xb5b920[_0x070e('0x72')]?_0xb5b920['statusCode']:_0x070e('0x15e'));this[_0x070e('0xc')][_0x070e('0x9b')](util['format'](_0x070e('0x15f'),_0x7b081b),_0xb5b920['statusMessage']?_0xb5b920['statusMessage']:'OK');if(_0xb5b920[_0x070e('0x67')]){try{this[_0x070e('0x94')](_0xb5b920['body'],_0x7b081b);}catch(_0x210004){logger[_0x070e('0x27')](util['format'](_0x070e('0x160'),_0x7b081b));}}return this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x161'),_0x7b081b));};AGIVertices[_0x070e('0xd')]['saydigits']=function(_0x588ef6){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x162'),_0x588ef6[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0x163')](_0x588ef6[_0x070e('0x164')][_0x070e('0xc3')](/\s+/g,''),_0x588ef6[_0x070e('0x165')]);};AGIVertices['prototype'][_0x070e('0x166')]=function(_0x482296){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x167'),_0x482296[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0x168')](_0x482296[_0x070e('0x61')]['replace'](/\s+/g,''),_0x482296[_0x070e('0x165')]);};AGIVertices[_0x070e('0xd')]['sayphonetic']=function(_0x29b2a3){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x169'),_0x29b2a3[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0x16a')](_0x29b2a3[_0x070e('0x59')],_0x29b2a3[_0x070e('0x165')]);};AGIVertices['prototype']['sendMail']=function(_0x3fbee5){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x16b'),_0x3fbee5[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x3fbee5[_0x070e('0x16c')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x16d'));}var _0x39440f=this[_0x070e('0x20')][_0x070e('0x6e')](this,_0x3fbee5['account_id']);if(!_0x39440f||!_0x39440f['Smtp']){return this[_0x070e('0xc')][_0x070e('0x27')](_0x3fbee5,_0x070e('0x16e'));}var _0x516d34={'from':util[_0x070e('0x52')](_0x070e('0x16f'),_0x39440f[_0x070e('0x12')],_0x39440f[_0x070e('0x170')]||_0x39440f['Smtp'][_0x070e('0x171')]),'to':_0x3fbee5['to']||'','cc':_0x3fbee5['cc']||'','bcc':_0x3fbee5['bcc']||'','subject':_0x3fbee5[_0x070e('0x172')],'html':_0x3fbee5[_0x070e('0x59')],'text':_0x3fbee5[_0x070e('0x59')]};var _0x4ef713={'tls':{'rejectUnauthorized':![]}};if(_0x39440f[_0x070e('0x173')][_0x070e('0x174')]){_0x4ef713[_0x070e('0x174')]=_0x39440f[_0x070e('0x173')]['service'];}else{_0x4ef713['host']=_0x39440f[_0x070e('0x173')][_0x070e('0x175')];_0x4ef713[_0x070e('0x176')]=_0x39440f[_0x070e('0x173')]['port'];_0x4ef713[_0x070e('0x177')]=_0x39440f[_0x070e('0x173')][_0x070e('0x177')];}if(_0x39440f[_0x070e('0x173')][_0x070e('0x178')]){_0x4ef713['auth']={'user':_0x39440f['Smtp'][_0x070e('0x171')],'pass':_0x39440f[_0x070e('0x173')][_0x070e('0x179')]};}if(this[_0x070e('0x80')](_0x3fbee5[_0x070e('0x17a')])){}logger[_0x070e('0xcd')](_0x070e('0x17b'),JSON[_0x070e('0x70')](_0x516d34));this[_0x070e('0x32')]['sync'](this,_0x3fbee5,_0x3fbee5[_0x070e('0x16c')]);this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x17c'),_0x39440f['name']));this['sendMailMessage'][_0x070e('0x6e')](this,_0x4ef713,_0x516d34);return this[_0x070e('0xc')]['noop'](_0x070e('0x17d'));};AGIVertices[_0x070e('0xd')][_0x070e('0x17e')]=function(_0x268789){logger[_0x070e('0x29')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x268789['label']));return this[_0x070e('0xc')][_0x070e('0xad')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x070e('0xd')][_0x070e('0x17f')]=function(_0x1bf822){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1bf822[_0x070e('0x34')]));if(!this['isConfigured'](_0x1bf822[_0x070e('0x180')])){return this['channel'][_0x070e('0xad')](_0x070e('0x181'));}var _0x4fcb73=this['getSmsAccount'][_0x070e('0x6e')](this,_0x1bf822['sms_account_id']);if(!_0x4fcb73){return this['channel'][_0x070e('0x27')](_0x1bf822,_0x070e('0x182'));}var _0x7df802={'body':_0x1bf822[_0x070e('0x183')],'phone':_0x1bf822['to']||'','SmsAccountId':_0x4fcb73['id']};logger[_0x070e('0xcd')](_0x070e('0x184'),JSON[_0x070e('0x70')](_0x7df802));this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x1bf822,_0x1bf822['sms_account_id']);this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x185'),_0x4fcb73[_0x070e('0x12')]));this[_0x070e('0x31')][_0x070e('0x6e')](this,_0x7df802);return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x186'));};AGIVertices[_0x070e('0xd')][_0x070e('0x187')]=function(_0x3c42f1){logger['info'](util[_0x070e('0x52')](_0x070e('0x188'),_0x3c42f1['label']));if(!this[_0x070e('0x80')](_0x3c42f1[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x3c42f1,_0x070e('0x189'));}var _0x2b563a=this['getVariable'][_0x070e('0x6e')](this,_0x3c42f1[_0x070e('0xc5')]);if(!_0x2b563a){return this[_0x070e('0xc')][_0x070e('0x27')](_0x3c42f1,'no\x20variable\x20found');}return this[_0x070e('0xc')][_0x070e('0x9b')](_0x2b563a,_0x3c42f1[_0x070e('0x18a')]);};AGIVertices[_0x070e('0xd')][_0x070e('0x18b')]=function(_0x3cfaec){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x18c'),_0x3cfaec[_0x070e('0x34')]));this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x18d'));if(_0x3cfaec[_0x070e('0x9f')]===_0x070e('0x18e')){this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x18f'));return this[_0x070e('0xc')][_0x070e('0x9f')]();}return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x190'));};AGIVertices[_0x070e('0xd')][_0x070e('0x191')]=function(_0xc87ce8){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x192'),_0xc87ce8[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0xc87ce8['project_id'])){return this['channel']['error'](_0xc87ce8,_0x070e('0x193'));}var _0x3d07e1=this[_0x070e('0x14')][_0x070e('0x6e')](this,_0xc87ce8[_0x070e('0x194')]);if(!this['isConfigured'](_0x3d07e1)){return this[_0x070e('0xc')]['error'](_0xc87ce8,util['format'](_0x070e('0x195'),_0xc87ce8[_0x070e('0x194')]));}if(_0x3d07e1===this[_0x070e('0xc')][_0x070e('0x36')]){return this[_0x070e('0xc')][_0x070e('0x27')](_0xc87ce8,_0x070e('0x196'));}this['createSquareDetailsReport'][_0x070e('0x6e')](this,_0xc87ce8,_0x3d07e1);var _0x32f943=this['channel'][_0x070e('0xab')](_0x070e('0x197'),util[_0x070e('0x52')](_0x070e('0x198'),config[_0x070e('0x7')][_0x070e('0x175')]||_0x070e('0x199'),_0x3d07e1,this[_0x070e('0xc')]['arg_1']));if(_0x32f943[_0x070e('0xa3')]===-0x1){return _0x32f943;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xae'),_0x070e('0x197'),_0x3d07e1));};AGIVertices[_0x070e('0xd')][_0x070e('0x19a')]=function(_0x2f0603){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x19b'),_0x2f0603['label']));var _0x1886e6=this['shellCommand'][_0x070e('0x6e')](this,_0x2f0603[_0x070e('0x9e')]);this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x2f0603,_0x2f0603[_0x070e('0x9e')]);if(this[_0x070e('0x80')](_0x2f0603[_0x070e('0xc5')])){var _0x25860d=this[_0x070e('0xe')][_0x070e('0x6e')](this,_0x2f0603[_0x070e('0xc5')]);if(_0x25860d){this[_0x070e('0xc')][_0x070e('0x9b')](_0x25860d,_0x1886e6);return this['channel'][_0x070e('0xad')](util['format'](_0x070e('0x19c'),_0x2f0603[_0x070e('0x9e')],_0x25860d));}}return this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x19d'),_0x2f0603[_0x070e('0x9e')]));};AGIVertices[_0x070e('0xd')][_0x070e('0x19e')]=function(_0x2c72d6){logger['info'](util[_0x070e('0x52')](_0x070e('0x19f'),_0x2c72d6[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x2c72d6['apiKey'])){return this['channel'][_0x070e('0xad')](_0x070e('0x1a0'));}if(!this[_0x070e('0x80')](_0x2c72d6[_0x070e('0x59')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xb0'));}this['channel']['noop'](util[_0x070e('0x52')](_0x070e('0x1a1'),_0x2c72d6[_0x070e('0x59')]));var _0x5e281f=this[_0x070e('0x57')][_0x070e('0x6e')](this,_0x2c72d6);if(_0x5e281f){this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x1a2'),_0x5e281f));var _0xb7e563=this['channel'][_0x070e('0x1a3')](_0x5e281f);try{fs['unlink'](_0x5e281f+_0x070e('0xe6'));}catch(_0x285744){logger[_0x070e('0x27')](_0x285744);}return _0xb7e563;}return this[_0x070e('0xc')]['error'](_0x2c72d6,_0x070e('0x1a4'));};AGIVertices[_0x070e('0xd')][_0x070e('0x1a5')]=function(_0x4b2e61){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4b2e61['label']));if(!this['isConfigured'](_0x4b2e61[_0x070e('0x59')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20text\x20configured');}this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x1a6'),_0x4b2e61[_0x070e('0x59')]));var _0x17aca1=this[_0x070e('0x5d')][_0x070e('0x6e')](this,_0x4b2e61);if(_0x17aca1){this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x1a7'),_0x17aca1));var _0x37a1a2=this[_0x070e('0xc')][_0x070e('0x1a3')](_0x17aca1);try{fs[_0x070e('0xe5')](_0x17aca1+'.wav');}catch(_0x40e9b7){logger[_0x070e('0x27')](_0x40e9b7);}return _0x37a1a2;}return this[_0x070e('0xc')][_0x070e('0x27')](_0x4b2e61,_0x070e('0x1a8'));};AGIVertices['prototype'][_0x070e('0x1a9')]=function(_0x47ab0c){logger[_0x070e('0x29')](util['format'](_0x070e('0x1aa'),_0x47ab0c[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x47ab0c[_0x070e('0x134')])){return this[_0x070e('0xc')]['error'](_0x47ab0c,'no\x20find\x20by\x20configured');}logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x13a'),this[_0x070e('0xc')][_0x070e('0x37')],_0x47ab0c[_0x070e('0x134')]));var _0x5a1299=this[_0x070e('0x4e')][_0x070e('0x6e')](this,_0x47ab0c[_0x070e('0x134')]);if(_0x5a1299){logger[_0x070e('0x29')](util['format'](_0x070e('0x135'),this[_0x070e('0xc')]['callerid'],_0x47ab0c['findBy']));this[_0x070e('0xc')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x070e('0x37')],_0x47ab0c[_0x070e('0x134')]));return{'code':0xc8,'result':_0x070e('0x136')};}else{logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x137'),this[_0x070e('0xc')][_0x070e('0x37')],_0x47ab0c[_0x070e('0x134')]));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x137'),this[_0x070e('0xc')][_0x070e('0x37')],_0x47ab0c[_0x070e('0x134')]));return{'code':0xc8,'result':_0x070e('0x138')};}};AGIVertices[_0x070e('0xd')][_0x070e('0x1ab')]=function(_0x515baa){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x515baa[_0x070e('0x34')]));var _0x226f5c=this[_0x070e('0xc')][_0x070e('0xab')]('VOICEMAIL',[_0x515baa['mailbox'],_0x515baa[_0x070e('0x76')]]);if(_0x226f5c[_0x070e('0xa3')]===-0x1){return _0x226f5c;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x515baa[_0x070e('0x1ac')]));};AGIVertices['prototype']['vswitch']=function(_0x480daa){logger[_0x070e('0x29')](util['format'](_0x070e('0x1ad'),_0x480daa[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x480daa[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x480daa,_0x070e('0x189'));}var _0x57fc31=this[_0x070e('0xe')][_0x070e('0x6e')](this,_0x480daa[_0x070e('0xc5')]);if(!_0x57fc31){return this[_0x070e('0xc')][_0x070e('0x27')](_0x480daa,'no\x20variable\x20found');}var _0x1b3737=this[_0x070e('0xc')][_0x070e('0xe')](_0x57fc31);return{'code':0xc8,'result':_0x1b3737[_0x070e('0x99')]?_0x1b3737[_0x070e('0x99')]:'-'};};String[_0x070e('0xd')]['replaceAll']=function(_0x12a8d8,_0x577e02){return this[_0x070e('0x96')](_0x12a8d8)['join'](_0x577e02);};module[_0x070e('0x1ae')]=AGIVertices; \ No newline at end of file +var _0x70e0=['label','agicommand','arg_1','callerid','createSquareRecording','calleridname','extension','priority','accountcode','dnid','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','format','%s/%s@from-sip/n','LOCAL','shellCommand','trim','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','audioEncoding','googleTTS','google_tts_language','restAPI','timeout','number','includes','POST','PUT','method','toUpperCase','body','rawBody','parse','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','isConfigured','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','awsLex','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','clear','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','hasOwnProperty','isPlainObject','saveRestApiResult','%s.%s','split','length','replaceAll','extra','getAndSetVariable','setVariable','maxRetry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','result','Enter\x20in\x20CALLBACK\x20(%s)\x20block','no\x20list\x20selected','add','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','exec','application','noop','Executed\x20command\x20%s\x20%s','lumenvoxtts','no\x20text\x20configured','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','Executed\x20command\x20MRCPRecog\x20%s','no\x20grammar\x20configured','RECOG_CONFIDENCE()','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20query\x20configured','replace','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','no\x20username\x20configured','password','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','SestekNDA\x20is\x20unreachable','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','Executed\x20command\x20%s','Enter\x20in\x20FINALLY\x20(%s)\x20block','finally','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','retry','file_id','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','getData','response','maxdigit','test','mindigit','generate','hiddendigitspos','first','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GoogleASR\x20Result\x20%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','recordFile','gotoc','continueAt','context','gotoif','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','interval_id','getIntervals','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','login','no\x20find\x20by\x20configured','findBy','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','FIND\x20AGENT\x20%s\x20BY\x20%s','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','digit','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','opts','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','indexOf','XMCS-QUEUE','QUEUE','url','gosub','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','no\x20url\x20configured','Response:','%s_STATUS_CODE','200','%s_STATUS_MESSAGE','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','Smtp','service','host','port','secure','authentication','pass','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','sendSMS','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','yes','Answer','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','no\x20subproject\x20selected','project_id','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block','no\x20apiKey\x20configured','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','streamFile','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','mailbox','Enter\x20in\x20SWITCH\x20(%s)\x20block','exports','path','util','lodash','randomstring','moment','mustache','request-promise','agi','./scripts','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','name','catch','getSquareProject','getSquareProjectById','getSquareOdbc','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','save_name','getMailAccount','getMailAccountById','sendMailMessage','IntervalId','interval','map','%s/sounds/converted/%s','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x70e0,0x17b));var _0x070e=function(_0x1ac57f,_0x402bf6){_0x1ac57f=_0x1ac57f-0x0;var _0x19a274=_0x70e0[_0x1ac57f];return _0x19a274;};'use strict';var fs=require('fs');var path=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var _=require(_0x070e('0x2'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var Mustache=require(_0x070e('0x5'));var rp=require(_0x070e('0x6'));var logger=require('../../config/logger')(_0x070e('0x7'));var config=require('../../config/environment');var scripts=require(_0x070e('0x8'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders','rawBody'];var verticesWithRetry=[_0x070e('0x9'),_0x070e('0xa'),_0x070e('0xb')];var AGIVertices=function(_0x2611e6,_0x111743,_0x68a09e){this[_0x070e('0xc')]=_0x2611e6;this['rpc']=_0x111743;this['mailRpc']=_0x68a09e;};AGIVertices[_0x070e('0xd')][_0x070e('0xe')]=function(_0x12bb37,_0xb8d819){this[_0x070e('0xf')][_0x070e('0x10')](_0x12bb37)[_0x070e('0x11')](function(_0x1baa12){_0xb8d819(null,_0x1baa12?_0x1baa12[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x2930b8){_0xb8d819(_0x2930b8);});};AGIVertices['prototype']['getVoiceQueue']=function(_0x24baba,_0x56c7ba){this['rpc']['getVoiceQueueById'](_0x24baba)[_0x070e('0x11')](function(_0x14c3fd){_0x56c7ba(null,_0x14c3fd?_0x14c3fd['name']:![]);})['catch'](function(_0x373d86){_0x56c7ba(_0x373d86);});};AGIVertices[_0x070e('0xd')][_0x070e('0x14')]=function(_0x19d9da,_0x5bc71e){this['rpc'][_0x070e('0x15')](_0x19d9da)[_0x070e('0x11')](function(_0x38f6e6){_0x5bc71e(null,_0x38f6e6?_0x38f6e6[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x5037eb){_0x5bc71e(_0x5037eb);});};AGIVertices[_0x070e('0xd')][_0x070e('0x16')]=function(_0x1ad3de,_0x3ea105){this[_0x070e('0xf')]['getSquareOdbcById'](_0x1ad3de)['then'](function(_0x4e958f){_0x3ea105(null,_0x4e958f?_0x4e958f[_0x070e('0x17')]:![]);})[_0x070e('0x13')](function(_0x20dc60){_0x3ea105(_0x20dc60);});};AGIVertices['prototype'][_0x070e('0x18')]=function(_0x5dc5d2,_0xf8dd5d){this[_0x070e('0xf')][_0x070e('0x19')](_0x5dc5d2)[_0x070e('0x11')](function(_0x28a1c3){_0xf8dd5d(null,_0x28a1c3?_0x28a1c3[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x164cdf){_0xf8dd5d(_0x164cdf);});};AGIVertices['prototype'][_0x070e('0x1a')]=function(_0x270061,_0x4790eb){this['rpc'][_0x070e('0x1b')](_0x270061)['then'](function(_0x4a2dbd){_0x4790eb(null,_0x4a2dbd?_0x4a2dbd[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x41deb1){_0x4790eb(_0x41deb1);});};AGIVertices[_0x070e('0xd')][_0x070e('0x1c')]=function(_0x497f58,_0x374c54){var _0x219e48=this;this[_0x070e('0xf')][_0x070e('0x1d')](_0x497f58)[_0x070e('0x11')](function(_0x28d7f2){_0x374c54(null,_0x28d7f2?_0x219e48[_0x070e('0x1e')](_0x28d7f2[_0x070e('0x1f')]):![]);})['catch'](function(_0x282344){_0x374c54(_0x282344);});};AGIVertices[_0x070e('0xd')][_0x070e('0x20')]=function(_0x56fc12,_0x5c5f0d){this[_0x070e('0xf')][_0x070e('0x21')](_0x56fc12)[_0x070e('0x11')](function(_0x51402c){_0x5c5f0d(null,_0x51402c?_0x51402c:![]);})[_0x070e('0x13')](function(_0x1741a1){_0x5c5f0d(_0x1741a1);});};AGIVertices[_0x070e('0xd')][_0x070e('0x22')]=function(_0x53d473,_0x5bf522,_0x523b75){this['mailRpc'][_0x070e('0x22')](_0x53d473,_0x5bf522)['then'](function(){_0x523b75(null);})[_0x070e('0x13')](function(_0x323cf1){_0x523b75(_0x323cf1);});};AGIVertices['prototype']['getIntervals']=function(_0x699739,_0x3454c7){this['rpc']['getIntervalById'](_0x699739)[_0x070e('0x11')](function(_0x27dd1f){if(_0x27dd1f){if(_0x27dd1f[_0x070e('0x23')]){_0x3454c7(null,[_0x27dd1f[_0x070e('0x24')]]);}else{_0x3454c7(null,_[_0x070e('0x25')](_0x27dd1f['Intervals'],'interval'));}}else{_0x3454c7(null,![]);}})[_0x070e('0x13')](function(_0x3011c4){_0x3454c7(_0x3011c4);});};AGIVertices[_0x070e('0xd')][_0x070e('0x1e')]=function(_0xf11439){return util['format'](_0x070e('0x26'),FILES_PATH,_0xf11439);};AGIVertices[_0x070e('0xd')]['getQueryOdbc']=function(_0x2d6bb6,_0x34746e,_0x4ba6f0){odbc['open'](_0x2d6bb6,function(_0x5ddbe9){if(_0x5ddbe9){logger[_0x070e('0x27')](_0x070e('0x28'),_0x5ddbe9);_0x4ba6f0(_0x5ddbe9);}else{logger[_0x070e('0x29')](_0x070e('0x2a'));odbc[_0x070e('0x2b')](_0x34746e,function(_0x5e3827,_0x104048){if(_0x5e3827){logger[_0x070e('0x29')](_0x070e('0x2c'),_0x34746e);_0x4ba6f0(_0x5e3827);}else{logger['info'](_0x070e('0x2d'),_0x34746e);odbc[_0x070e('0x2e')](function(_0x165c16){if(_0x165c16){logger['error'](_0x070e('0x2f'),_0x165c16);}_0x4ba6f0(null,_0x104048);});}});}});};AGIVertices[_0x070e('0xd')]['getSmsAccount']=function(_0x173602,_0x5d689b){this[_0x070e('0xf')][_0x070e('0x30')](_0x173602)[_0x070e('0x11')](function(_0x30319c){_0x5d689b(null,_0x30319c?_0x30319c:![]);})[_0x070e('0x13')](function(_0x47b929){_0x5d689b(_0x47b929);});};AGIVertices[_0x070e('0xd')]['createSmsMessage']=function(_0x5bd39a,_0x398168){this[_0x070e('0xf')][_0x070e('0x31')](_0x5bd39a)['then'](function(_0x2ad56c){_0x398168(null,_0x2ad56c);})[_0x070e('0x13')](function(_0x556bf3){_0x398168(_0x556bf3);});};AGIVertices[_0x070e('0xd')]['createSquareDetailsReport']=function(_0x13e4e0,_0x5851ab,_0x544b53){this['rpc'][_0x070e('0x32')]({'uniqueid':this[_0x070e('0xc')][_0x070e('0x33')],'node':_0x13e4e0[_0x070e('0x34')],'application':_0x13e4e0[_0x070e('0x35')],'data':_0x5851ab||null,'project_name':this['channel'][_0x070e('0x36')],'callerid':this['channel'][_0x070e('0x37')]})[_0x070e('0x11')](function(_0xff760c){if(_0x544b53){_0x544b53(null,_0xff760c);}})['catch'](function(_0x54285a){if(_0x544b53){_0x544b53(_0x54285a);}});};AGIVertices[_0x070e('0xd')]['createSquareRecording']=function(_0x35349f,_0x3fdb75,_0x139820,_0x5f5675){this[_0x070e('0xf')][_0x070e('0x38')]({'uniqueid':this['channel']['uniqueid'],'callerid':this[_0x070e('0xc')][_0x070e('0x37')],'calleridname':this[_0x070e('0xc')][_0x070e('0x39')],'context':this[_0x070e('0xc')]['context'],'extension':this[_0x070e('0xc')][_0x070e('0x3a')],'priority':this[_0x070e('0xc')][_0x070e('0x3b')],'accountcode':this[_0x070e('0xc')][_0x070e('0x3c')],'dnid':this[_0x070e('0xc')][_0x070e('0x3d')],'projectName':this[_0x070e('0xc')][_0x070e('0x36')],'saveName':_0x3fdb75,'filename':_0x35349f[_0x070e('0x3e')]||_0x3fdb75,'savePath':_0x139820})[_0x070e('0x11')](function(_0x5254f8){_0x5f5675(null,_0x5254f8);})[_0x070e('0x13')](function(_0x402c82){_0x5f5675(_0x402c82);});};AGIVertices['prototype'][_0x070e('0x3f')]=function(_0xa7a41b,_0x40298a,_0x249e3f){this[_0x070e('0xf')][_0x070e('0x3f')]({'uniqueid':this[_0x070e('0xc')][_0x070e('0x33')],'body':_0xa7a41b,'direction':_0x40298a})[_0x070e('0x11')](function(_0x5744c5){if(_0x249e3f){_0x249e3f(null,_0x5744c5);}})[_0x070e('0x13')](function(_0x4c22da){if(_0x249e3f){_0x249e3f(_0x4c22da);}});};AGIVertices[_0x070e('0xd')][_0x070e('0x40')]=function(_0x4abbe9,_0x991d23){this[_0x070e('0xf')][_0x070e('0x40')]({'firstName':_[_0x070e('0x41')](_0x4abbe9[_0x070e('0x12')])||_[_0x070e('0x42')](_0x4abbe9[_0x070e('0x12')])?'callback_'+Math[_0x070e('0x43')]():_0x4abbe9['name'],'lastName':_['isEmpty'](_0x4abbe9[_0x070e('0x44')])||_[_0x070e('0x42')](_0x4abbe9[_0x070e('0x44')])?null:_0x4abbe9[_0x070e('0x44')],'phone':_0x4abbe9[_0x070e('0x45')],'ListId':_0x4abbe9[_0x070e('0x46')],'scheduledAt':_0x4abbe9[_0x070e('0x47')],'callbackUniqueid':this[_0x070e('0xc')]['uniqueid'],'tags':_0x070e('0x48'),'description':'Callback\x20scheduled\x20at\x20'+_0x4abbe9['scheduledAt'][_0x070e('0x49')](),'priority':_0x4abbe9[_0x070e('0x4a')]})['then'](function(_0x26af08){_0x991d23(null,_0x26af08);})[_0x070e('0x13')](function(_0x210f4a){_0x991d23(_0x210f4a);});};AGIVertices[_0x070e('0xd')][_0x070e('0x4b')]=function(_0x382ce3,_0x1b36cd){this['rpc']['getPauseById'](_0x382ce3)['then'](function(_0x3087e5){_0x1b36cd(null,_0x3087e5?_0x3087e5[_0x070e('0x12')]:![]);})[_0x070e('0x13')](function(_0x2f8fcb){_0x1b36cd(_0x2f8fcb);});};AGIVertices['prototype'][_0x070e('0x4c')]=function(_0x5d3c3a,_0x212710,_0x1cbb7e){var _0x476804={'role':_0x070e('0x4d')};_0x476804[_0x5d3c3a]=this[_0x070e('0xc')][_0x070e('0x37')];this['rpc'][_0x070e('0x4c')](_0x476804,_0x212710,this[_0x070e('0xc')][_0x070e('0x33')])['then'](function(_0x1d7873){_0x1cbb7e(null,_[_0x070e('0x42')](_0x1d7873)?![]:!![]);})['catch'](function(_0x1f1df5){logger['error'](_0x1f1df5);_0x1cbb7e(null,![]);});};AGIVertices[_0x070e('0xd')]['agentUnpause']=function(_0x4cb86f,_0x4b354d){var _0xbaf43e={'role':_0x070e('0x4d')};_0xbaf43e[_0x4cb86f]=this[_0x070e('0xc')][_0x070e('0x37')];this[_0x070e('0xf')][_0x070e('0x4e')](_0xbaf43e)['then'](function(_0x841c89){_0x4b354d(null,_['isNil'](_0x841c89)?![]:!![]);})[_0x070e('0x13')](function(_0x52becf){logger[_0x070e('0x27')](_0x52becf);_0x4b354d(null,![]);});};AGIVertices[_0x070e('0xd')]['agentLogout']=function(_0x1bcdc3,_0x50399e){var _0x1a9e25={'role':_0x070e('0x4d')};_0x1a9e25[_0x1bcdc3]=this[_0x070e('0xc')][_0x070e('0x37')];this[_0x070e('0xf')][_0x070e('0x4f')](_0x1a9e25)[_0x070e('0x11')](function(_0x148f1d){_0x50399e(null,_[_0x070e('0x42')](_0x148f1d)?![]:!![]);})[_0x070e('0x13')](function(_0x40c560){logger[_0x070e('0x27')](_0x40c560);_0x50399e(null,![]);});};AGIVertices[_0x070e('0xd')][_0x070e('0x50')]=function(_0x5a5521,_0x45bf20){var _0x19d78c={'role':_0x070e('0x4d')};_0x19d78c[_0x5a5521]=this[_0x070e('0xc')]['callerid'];var _0x2ccd8d=_0x5a5521!=_0x070e('0x51')?util[_0x070e('0x52')](_0x070e('0x53'),_0x070e('0x54'),this[_0x070e('0xc')]['callerid']):undefined;this[_0x070e('0xf')][_0x070e('0x50')](_0x19d78c,_0x2ccd8d)[_0x070e('0x11')](function(_0x2fe202){_0x45bf20(null,_['isNil'](_0x2fe202)?![]:!![]);})[_0x070e('0x13')](function(_0x52804d){logger[_0x070e('0x27')](_0x52804d);_0x45bf20(null,![]);});};AGIVertices[_0x070e('0xd')][_0x070e('0x55')]=function(_0x150bf6,_0x2a20d4){sh['exec'](_[_0x070e('0x56')](_0x150bf6),function(_0x2e38c6,_0x8cc913){var _0x114bcf=_0x8cc913['replace'](/(\r\n|\n|\r)/gm,'');_0x2a20d4(null,_0x114bcf);});};AGIVertices[_0x070e('0xd')]['googleCloudTTS']=function(_0x399055,_0x44e465){scripts[_0x070e('0x57')](_0x399055['apiKey'],_0x399055[_0x070e('0x58')]||'text',_0x399055[_0x070e('0x59')],_0x399055['languageCode']||_0x070e('0x5a'),_0x399055[_0x070e('0x5b')]||'MALE',_0x399055[_0x070e('0x5c')]||'MP3')[_0x070e('0x11')](function(_0x39ff7d){_0x44e465(null,_0x39ff7d);})['catch'](function(_0x4ca374){_0x44e465(_0x4ca374);});};AGIVertices[_0x070e('0xd')][_0x070e('0x5d')]=function(_0xf67cfd,_0x17cf15){scripts[_0x070e('0x5d')](_0xf67cfd[_0x070e('0x59')],_0xf67cfd[_0x070e('0x5e')]||'en',0x1)[_0x070e('0x11')](function(_0x25b599){_0x17cf15(null,_0x25b599);})[_0x070e('0x13')](function(_0x72077d){_0x17cf15(_0x72077d);});};AGIVertices[_0x070e('0xd')][_0x070e('0x5f')]=function(_0x5c88fe,_0x3308b5){var _0x549979={'uri':_0x5c88fe['url'],'method':_0x5c88fe['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x5c88fe[_0x070e('0x60')])===_0x070e('0x61')&&parseInt(_0x5c88fe[_0x070e('0x60')])>=0x1?parseInt(_0x5c88fe[_0x070e('0x60')])*0x3e8:0x5*0x3e8};if(_[_0x070e('0x62')]([_0x070e('0x63'),_0x070e('0x64')],_0x549979[_0x070e('0x65')][_0x070e('0x66')]())){try{_0x549979[_0x070e('0x67')]=_0x5c88fe[_0x070e('0x68')]?JSON[_0x070e('0x69')](_0x5c88fe[_0x070e('0x68')]):{};}catch(_0x595e2e){logger['error']('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x595e2e);}}try{_0x549979[_0x070e('0x6a')]=_0x5c88fe[_0x070e('0x6b')]?JSON[_0x070e('0x69')](_0x5c88fe[_0x070e('0x6b')]):{};}catch(_0x5a7df2){logger[_0x070e('0x27')](_0x070e('0x6c'),_0x5a7df2);}if(_0x5c88fe[_0x070e('0x6d')]){try{var _0xd74f9c=require(_0x5c88fe[_0x070e('0x6d')])[_0x070e('0x6e')](this,_0x549979);_0x549979['uri']=Mustache[_0x070e('0x6f')](_0x5c88fe['url'],_0xd74f9c,{},['$$','$$']);if(_0x549979[_0x070e('0x6a')]){_0x549979[_0x070e('0x6a')]=JSON[_0x070e('0x69')](Mustache[_0x070e('0x6f')](JSON[_0x070e('0x70')](_0x549979['headers']),_0xd74f9c,{},['$$','$$']));}if(_0x549979[_0x070e('0x67')]){_0x549979[_0x070e('0x67')]=JSON['parse'](Mustache[_0x070e('0x6f')](JSON[_0x070e('0x70')](_0x549979['body']),_0xd74f9c,{},['$$','$$']));}}catch(_0xb8ae48){logger[_0x070e('0x27')](_0x070e('0x71'),_0xb8ae48);}}rp(_0x549979)['then'](function(_0x40d7e6){var _0xe8c476={'statusCode':_0x40d7e6[_0x070e('0x72')]||0xc8,'statusMessage':_0x40d7e6[_0x070e('0x73')]||'OK','headers':_0x40d7e6[_0x070e('0x6a')]||{},'body':_0x40d7e6[_0x070e('0x67')]||{}};_0x3308b5(null,_0xe8c476);})[_0x070e('0x13')](function(_0xf90516){var _0x206b97={'statusCode':_0xf90516[_0x070e('0x72')]||0x1f4,'statusMessage':_0xf90516[_0x070e('0x74')]||_0x070e('0x75'),'headers':_0xf90516[_0x070e('0x76')]['headers']||{},'body':_0xf90516[_0x070e('0x76')][_0x070e('0x67')]||{}};_0x3308b5(null,_0x206b97);});};AGIVertices[_0x070e('0xd')][_0x070e('0x77')]=function(_0x1dceda,_0x1d1aa2){scripts['googleDialogflow'](this['channel']['uniqueid'],_0x1dceda[_0x070e('0x78')],_0x1dceda[_0x070e('0x59')],_0x1dceda[_0x070e('0x79')]||'en')[_0x070e('0x11')](function(_0x4b4b9a){_0x1d1aa2(null,_0x4b4b9a);})[_0x070e('0x13')](function(_0x20cd8a){_0x1d1aa2(_0x20cd8a);});};AGIVertices[_0x070e('0xd')]['sestekNDA']=function(_0x9d81a9,_0x48c011){scripts[_0x070e('0x7a')](this[_0x070e('0xc')],_0x9d81a9)['then'](function(_0x59fe3e){_0x48c011(null,_0x59fe3e);})[_0x070e('0x13')](function(_0x1fa499){_0x48c011(_0x1fa499);});};AGIVertices['prototype'][_0x070e('0x7b')]=function(_0x596beb,_0x4e8af1){scripts['ispeechTTS'](_0x596beb[_0x070e('0x78')],_0x596beb[_0x070e('0x59')],_0x596beb[_0x070e('0x7c')]||_0x070e('0x5a'),_0x596beb[_0x070e('0x7d')])[_0x070e('0x11')](function(_0x2a12a1){_0x4e8af1(null,_0x2a12a1);})[_0x070e('0x13')](function(_0x3bc925){_0x4e8af1(_0x3bc925);});};AGIVertices[_0x070e('0xd')][_0x070e('0x7e')]=function(_0x1306e6,_0x296008,_0x767dcc){scripts[_0x070e('0x7e')](_0x296008,_0x1306e6[_0x070e('0x78')],_0x1306e6[_0x070e('0x7f')]||_0x070e('0x5a'),this[_0x070e('0x80')](_0x1306e6[_0x070e('0x81')])?_0x1306e6[_0x070e('0x81')]:undefined)[_0x070e('0x11')](function(_0x58f2e8){_0x767dcc(null,_0x58f2e8);})[_0x070e('0x13')](function(_0x276e6e){_0x767dcc(_0x276e6e);});};AGIVertices[_0x070e('0xd')][_0x070e('0x82')]=function(_0x495403,_0x2f26d1){scripts[_0x070e('0x82')](_0x495403[_0x070e('0x83')],_0x495403[_0x070e('0x84')],_0x495403[_0x070e('0x85')],_0x495403[_0x070e('0x86')]||'Amy',_0x495403['text'],_0x495403['aws_text_type']||_0x070e('0x59'))['then'](function(_0x26e9c1){_0x2f26d1(null,_0x26e9c1);})[_0x070e('0x13')](function(_0x4dba5f){_0x2f26d1(_0x4dba5f);});};AGIVertices[_0x070e('0xd')][_0x070e('0x87')]=function(_0x4f9a95,_0x56f389){scripts[_0x070e('0x87')](this[_0x070e('0xc')][_0x070e('0x33')],_0x4f9a95[_0x070e('0x83')],_0x4f9a95[_0x070e('0x84')],_0x4f9a95['aws_lex_region'],_0x4f9a95[_0x070e('0x59')],_0x4f9a95['aws_bot_name'])[_0x070e('0x11')](function(_0x1219b4){_0x56f389(null,_0x1219b4);})['catch'](function(_0x22cbfb){_0x56f389(_0x22cbfb);});};AGIVertices[_0x070e('0xd')][_0x070e('0x88')]=function(_0x16e190,_0x174ca6,_0x32b286){scripts['googleASR'](_0x174ca6,_0x16e190[_0x070e('0x78')],_0x16e190[_0x070e('0x89')]||_0x070e('0x5a'))[_0x070e('0x11')](function(_0x259ac4){_0x32b286(null,_0x259ac4);})['catch'](function(_0x2531f7){_0x32b286(_0x2531f7);});};AGIVertices[_0x070e('0xd')][_0x070e('0x8a')]=function(_0x350c28,_0x224223,_0x31ceee){scripts[_0x070e('0x8a')](_0x224223,_0x350c28[_0x070e('0x8b')],_0x350c28[_0x070e('0x8c')],_0x350c28[_0x070e('0x8d')])[_0x070e('0x11')](function(_0x2614b2){_0x31ceee(null,_0x2614b2);})[_0x070e('0x13')](function(_0xf1edc1){_0x31ceee(_0xf1edc1);});};AGIVertices[_0x070e('0xd')][_0x070e('0x8e')]=function(_0x4df50c){var _0x48fe1d=_[_0x070e('0x62')](verticesWithRetry,_0x4df50c[_0x070e('0x35')])?_0x4df50c:_['clone'](_0x4df50c);for(var _0x5d8c9f in _0x48fe1d){if(_0x48fe1d['hasOwnProperty'](_0x5d8c9f)){if(_0x48fe1d[_0x5d8c9f]&&_['isString'](_0x48fe1d[_0x5d8c9f])){if(_[_0x070e('0x62')](recursiveMapAttributes,_0x5d8c9f)){_0x48fe1d[_0x5d8c9f]=this[_0x070e('0x8f')](_0x48fe1d[_0x5d8c9f]);}else{_0x48fe1d[_0x5d8c9f]=this[_0x070e('0x90')](_0x48fe1d[_0x5d8c9f]);}}}}return _0x48fe1d;};AGIVertices[_0x070e('0xd')][_0x070e('0x91')]=function(_0x3973e8){for(var _0x32cfe3 in _0x3973e8){if(_0x3973e8[_0x070e('0x92')](_0x32cfe3)){if(_[_0x070e('0x93')](_0x3973e8[_0x32cfe3])){return this[_0x070e('0x91')](_0x3973e8[_0x32cfe3]);}_0x3973e8[_0x32cfe3]=this['replaceAllVariables'](_0x3973e8[_0x32cfe3]);}}};AGIVertices[_0x070e('0xd')][_0x070e('0x94')]=function(_0x49c66a,_0x30db4a){for(var _0x2890ba in _0x49c66a){if(_0x49c66a[_0x070e('0x92')](_0x2890ba)){if(_[_0x070e('0x93')](_0x49c66a[_0x2890ba])){if(!_['isEmpty'](_0x49c66a[_0x2890ba])){this[_0x070e('0x94')](_0x49c66a[_0x2890ba],util[_0x070e('0x52')](_0x070e('0x95'),_0x30db4a,_0x2890ba));}}else{if(_0x49c66a[_0x2890ba]){this[_0x070e('0xc')]['setVariable'](util[_0x070e('0x52')](_0x070e('0x95'),_0x30db4a,_0x2890ba),_0x49c66a[_0x2890ba]);}}}}};AGIVertices[_0x070e('0xd')][_0x070e('0x8f')]=function(_0xdb8036){try{var _0x27b51c=JSON[_0x070e('0x69')](_0xdb8036);this[_0x070e('0x91')](_0x27b51c);return JSON[_0x070e('0x70')](_0x27b51c);}catch(_0x1a41f2){return this[_0x070e('0x90')](_0xdb8036);}};AGIVertices['prototype'][_0x070e('0x90')]=function(_0x2b5210){var _0x5e3263=_0x2b5210['split']('{');for(var _0x6ac3c9=0x1;_0x6ac3c9<_0x5e3263['length'];_0x6ac3c9+=0x1){var _0x2c759a=_0x5e3263[_0x6ac3c9][_0x070e('0x96')]('}');if(_0x2c759a[_0x070e('0x97')]>0x1){_0x2b5210=_0x2b5210[_0x070e('0x98')]('{'+_0x2c759a[0x0]+'}',this[_0x070e('0xc')][_0x070e('0xe')](_0x2c759a[0x0])[_0x070e('0x99')]||_0x2c759a[0x0]);}}if(_0x5e3263['length']===0x1){return _0x2b5210[_0x070e('0x49')]();}return this[_0x070e('0x90')](_0x2b5210);};AGIVertices[_0x070e('0xd')][_0x070e('0x9a')]=function(_0x4a9c99,_0x4e4065){var _0x113faa=this[_0x070e('0xc')][_0x070e('0xe')](_0x4a9c99);if(_0x113faa['result']===-0x1){return _0x113faa;}logger[_0x070e('0x29')](util[_0x070e('0x52')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x4e4065,_0x113faa[_0x070e('0x99')]));return this[_0x070e('0xc')][_0x070e('0x9b')](_0x4e4065,_0x113faa[_0x070e('0x99')]);};AGIVertices[_0x070e('0xd')][_0x070e('0x80')]=function(_0x56169b){return _0x56169b&&_0x56169b!=='0'&&_0x56169b!=='-1'&&_0x56169b!=='';};AGIVertices['prototype'][_0x070e('0x9c')]=function(_0x54b6af){this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x54b6af,'-');_0x54b6af['retry']=_0x54b6af[_0x070e('0x9c')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0x070e('0x7')]=function(_0x31ccef){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x9d'),_0x31ccef[_0x070e('0x34')]));return this['channel'][_0x070e('0x7')]([_0x31ccef[_0x070e('0x9e')],_0x31ccef['args']]);};AGIVertices['prototype'][_0x070e('0x9f')]=function(_0x8e9b5c){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xa0'),_0x8e9b5c[_0x070e('0x34')]));if(this[_0x070e('0x80')](_0x8e9b5c[_0x070e('0x60')])){logger['info'](util[_0x070e('0x52')](_0x070e('0xa1'),_0x8e9b5c[_0x070e('0x60')]));var _0x2f5597=this[_0x070e('0xc')][_0x070e('0xa2')](_0x8e9b5c[_0x070e('0x60')]);if(_0x2f5597[_0x070e('0xa3')]===-0x1){return _0x2f5597;}}return this['channel'][_0x070e('0x9f')]();};AGIVertices[_0x070e('0xd')][_0x070e('0x48')]=function(_0xbc61f2){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xa4'),_0xbc61f2[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0xbc61f2[_0x070e('0x46')])){return this['channel']['error'](_0xbc61f2,_0x070e('0xa5'));}_0xbc61f2[_0x070e('0x47')]=moment();if(this[_0x070e('0x80')](_0xbc61f2['delay'])){_0xbc61f2[_0x070e('0x47')]=moment()[_0x070e('0xa6')](_0xbc61f2['delay'],_0x070e('0xa7'));}if(!this[_0x070e('0x80')](_0xbc61f2[_0x070e('0x4a')])){_0xbc61f2[_0x070e('0x4a')]=0x2;}this[_0x070e('0x40')][_0x070e('0x6e')](this,_0xbc61f2);return this['channel']['noop'](util[_0x070e('0x52')](_0x070e('0xa8'),_0xbc61f2['phone'],_0xbc61f2[_0x070e('0x46')],_0xbc61f2[_0x070e('0x47')]));};AGIVertices[_0x070e('0xd')][_0x070e('0xa9')]=function(_0x38e448){logger[_0x070e('0x29')](util['format'](_0x070e('0xaa'),_0x38e448[_0x070e('0x34')]));var _0x5d7a66=this[_0x070e('0xc')][_0x070e('0xab')](_0x38e448[_0x070e('0xac')],_0x38e448[_0x070e('0x76')]);if(_0x5d7a66['result']===-0x1){return _0x5d7a66;}return this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xae'),_0x38e448[_0x070e('0xac')],_0x38e448[_0x070e('0x76')]));};AGIVertices[_0x070e('0xd')][_0x070e('0xaf')]=function(_0x2e1753){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x2e1753[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x2e1753[_0x070e('0x59')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xb0'));}var _0x35ddab='\x22'+_0x2e1753['text']+'\x22';if(this['isConfigured'](_0x2e1753[_0x070e('0x76')])){_0x35ddab+=','+_0x2e1753[_0x070e('0x76')];}var _0x1abf03=this['channel'][_0x070e('0xab')](_0x070e('0xb1'),_0x35ddab);if(_0x1abf03[_0x070e('0xa3')]===-0x1){return _0x1abf03;}return this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0xb2'),_0x35ddab));};AGIVertices[_0x070e('0xd')]['sestektts']=function(_0x2a94f9){logger['info'](util['format']('Enter\x20in\x20SESTEKTTS\x20(%s)\x20block',_0x2a94f9[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x2a94f9[_0x070e('0x59')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xb0'));}var _0x1ed436='\x22'+_0x2a94f9['text']+'\x22';if(this[_0x070e('0x80')](_0x2a94f9[_0x070e('0x76')])){_0x1ed436+=','+_0x2a94f9[_0x070e('0x76')];}var _0x41afe5=this[_0x070e('0xc')][_0x070e('0xab')]('MRCPSynth',_0x1ed436);if(_0x41afe5[_0x070e('0xa3')]===-0x1){return _0x41afe5;}return this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xb2'),_0x1ed436));};AGIVertices['prototype'][_0x070e('0xb3')]=function(_0x458f92){logger[_0x070e('0x29')](util['format'](_0x070e('0xb4'),_0x458f92[_0x070e('0x34')]));if(!this['isConfigured'](_0x458f92[_0x070e('0xb5')])){return this[_0x070e('0xc')]['noop']('no\x20grammar\x20configured');}var _0x4e85ee=_0x458f92['grammar'];if(this[_0x070e('0x80')](_0x458f92[_0x070e('0x76')])){_0x4e85ee+=','+_0x458f92[_0x070e('0x76')];}var _0x277ca5=this[_0x070e('0xc')][_0x070e('0xab')](_0x070e('0xb6'),_0x4e85ee);if(_0x277ca5[_0x070e('0xa3')]===-0x1){return _0x277ca5;}var _0x569425=this['getAndSetVariable']('RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE');if(_0x569425[_0x070e('0xa3')]===-0x1){return _0x569425;}var _0x41e59b=this[_0x070e('0x9a')](_0x070e('0xb7'),_0x070e('0xb8'));if(_0x41e59b['result']===-0x1){return _0x41e59b;}var _0x528946=this[_0x070e('0x9a')](_0x070e('0xb9'),'LUMENVOX_ASR_INSTANCE');if(_0x528946[_0x070e('0xa3')]===-0x1){return _0x528946;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xba'),_0x4e85ee));};AGIVertices[_0x070e('0xd')]['sestekasr']=function(_0x202ebf){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x202ebf[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x202ebf[_0x070e('0xb5')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xbb'));}var _0x2beaa8=_0x202ebf['grammar'];if(this[_0x070e('0x80')](_0x202ebf[_0x070e('0x76')])){_0x2beaa8+=','+_0x202ebf['options'];}var _0x369de9=this['channel'][_0x070e('0xab')]('MRCPRecog',_0x2beaa8);if(_0x369de9[_0x070e('0xa3')]===-0x1){return _0x369de9;}var _0x49f218=this['getAndSetVariable'](_0x070e('0xbc'),'SESTEK_ASR_CONFIDENCE');if(_0x49f218['result']===-0x1){return _0x49f218;}var _0x7966d4=this[_0x070e('0x9a')](_0x070e('0xb7'),_0x070e('0xbd'));if(_0x7966d4[_0x070e('0xa3')]===-0x1){return _0x7966d4;}var _0x5413dc=this[_0x070e('0x9a')](_0x070e('0xb9'),_0x070e('0xbe'));if(_0x5413dc[_0x070e('0xa3')]===-0x1){return _0x5413dc;}return this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0xba'),_0x2beaa8));};AGIVertices[_0x070e('0xd')][_0x070e('0xbf')]=function(_0x44c780){logger['info'](util['format'](_0x070e('0xc0'),_0x44c780[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x44c780[_0x070e('0xc1')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x44c780,'no\x20database\x20selected');}var _0x354257=this[_0x070e('0x16')][_0x070e('0x6e')](this,_0x44c780[_0x070e('0xc1')]);if(!_0x354257){return this[_0x070e('0xc')][_0x070e('0x27')](_0x44c780,'no\x20odbc\x20database\x20found');}if(!this['isConfigured'](_0x44c780[_0x070e('0x2b')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x44c780,_0x070e('0xc2'));}var _0x3a8dd7=_0x44c780[_0x070e('0x2b')][_0x070e('0xc3')](/(\r\n|\n|\r)/gm,'\x20');this['channel'][_0x070e('0xad')](util['format'](_0x070e('0xc4'),_0x3a8dd7));var _0x5dc059=this['getQueryOdbc']['sync'](this,_0x354257,_0x3a8dd7);this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x44c780,_0x3a8dd7);if(!this[_0x070e('0x80')](_0x44c780[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xc6'));}var _0x37285d=this[_0x070e('0xe')]['sync'](this,_0x44c780[_0x070e('0xc5')]);if(!_0x37285d){return this[_0x070e('0xc')][_0x070e('0x27')](_0x44c780,_0x070e('0xc7'));}var _0x243fc7=this;_0x5dc059[_0x070e('0xc8')](function(_0x32ebf1,_0x13f234){Object[_0x070e('0xc9')](_0x32ebf1)['forEach'](function(_0x538f0c){_0x243fc7[_0x070e('0xc')][_0x070e('0x9b')](util['format'](_0x070e('0xca'),_0x37285d,_0x13f234,_0x538f0c),_0x32ebf1[_0x538f0c]);});});this['channel']['setVariable'](util[_0x070e('0x52')](_0x070e('0xcb'),_0x37285d),_0x5dc059['length']);return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('variable\x20%s\x20set',_0x37285d));};AGIVertices['prototype'][_0x070e('0xcc')]=function(_0x33bd72){logger[_0x070e('0xcd')](util['format'](_0x070e('0xce'),_0x33bd72[_0x070e('0x34')]));if(!this['isConfigured'](_0x33bd72[_0x070e('0xcf')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x33bd72,_0x070e('0xd0'));}var _0x3f7b2c=this[_0x070e('0x18')][_0x070e('0x6e')](this,_0x33bd72[_0x070e('0xcf')]);if(!_0x3f7b2c){return this[_0x070e('0xc')][_0x070e('0x27')](_0x33bd72,_0x070e('0xd1'));}var _0x2b45d5=this[_0x070e('0xc')][_0x070e('0xab')](_0x070e('0xd2'),[util[_0x070e('0x52')](_0x070e('0xd3'),_0x3f7b2c),_0x33bd72['timeout'],_0x33bd72['opts'],_0x33bd72['url']]);if(_0x2b45d5['result']===-0x1){return _0x2b45d5;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('Executed\x20command\x20%s',_0x070e('0xd2')));};AGIVertices[_0x070e('0xd')][_0x070e('0xd4')]=function(_0x4a20dc){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xd5'),_0x4a20dc[_0x070e('0x34')]));if(!this['isConfigured'](_0x4a20dc[_0x070e('0x78')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20key\x20configured');}if(!this[_0x070e('0x80')](_0x4a20dc[_0x070e('0x59')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xb0'));}this[_0x070e('0xc')][_0x070e('0xd6')]=!![];this[_0x070e('0x32')](_0x4a20dc);this[_0x070e('0x3f')](_0x4a20dc['text'],'in');this['channel'][_0x070e('0xad')](util['format']('Trying\x20Dialogflow:\x20%s',_0x4a20dc[_0x070e('0x59')]));var _0x6479e4=this[_0x070e('0x77')][_0x070e('0x6e')](this,_0x4a20dc);if(_0x6479e4){for(var _0x7cf78b in _0x6479e4){if(_0x6479e4[_0x070e('0x92')](_0x7cf78b)){this['channel'][_0x070e('0x9b')](util[_0x070e('0x52')](_0x070e('0xd7'),_0x7cf78b[_0x070e('0x66')]()),_0x6479e4[_0x7cf78b]);}}this['createSquareMessage'](_0x6479e4[_0x070e('0xd8')],'out');return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xd9'),_0x6479e4[_0x070e('0xd8')]));}return this[_0x070e('0xc')][_0x070e('0x27')](_0x4a20dc,_0x070e('0xda'));};AGIVertices[_0x070e('0xd')]['sesteknda']=function(_0xc35037){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xdb'),_0xc35037[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0xc35037[_0x070e('0xdc')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xdd'));}if(!this[_0x070e('0x80')](_0xc35037['username'])){return this['channel'][_0x070e('0xad')](_0x070e('0xde'));}if(!this[_0x070e('0x80')](_0xc35037[_0x070e('0xdf')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20password\x20configured');}if(!this['isConfigured'](_0xc35037[_0x070e('0xe0')])){return this[_0x070e('0xc')]['noop'](_0x070e('0xb0'));}this['channel'][_0x070e('0xd6')]=!![];this[_0x070e('0x32')](_0xc35037);this['createSquareMessage'](_0xc35037[_0x070e('0x59')],'in');this[_0x070e('0xc')]['noop'](util['format'](_0x070e('0xe1'),_0xc35037['text']));var _0x1ebec9=this[_0x070e('0x7a')][_0x070e('0x6e')](this,_0xc35037);if(_0x1ebec9){for(var _0x5ef06f in _0x1ebec9){if(_0x1ebec9[_0x070e('0x92')](_0x5ef06f)){this[_0x070e('0xc')]['setVariable'](util[_0x070e('0x52')](_0x070e('0xe2'),_0x5ef06f[_0x070e('0x66')]()),_0x1ebec9[_0x5ef06f]);}}this[_0x070e('0x3f')](_0x1ebec9[_0x070e('0xd8')],_0x070e('0xe3'));if(_0x1ebec9[_0x070e('0xe4')]){this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('Sestek\x20NDA\x20%s\x20file\x20created',_0x1ebec9[_0x070e('0xe4')]));var _0x11a111=this[_0x070e('0xc')]['streamFile'](_0x1ebec9['audiofile']);try{fs[_0x070e('0xe5')](_0x1ebec9[_0x070e('0xe4')]+_0x070e('0xe6'));}catch(_0x2f237f){logger['error'](_0x2f237f);}return _0x11a111;}else{return this[_0x070e('0xc')]['noop'](util['format'](_0x070e('0xe7'),_0x1ebec9['speech']));}}return this[_0x070e('0xc')][_0x070e('0x27')](_0xc35037,_0x070e('0xe8'));};AGIVertices[_0x070e('0xd')]['end']=function(_0x2e104b){logger['info'](util[_0x070e('0x52')](_0x070e('0xe9'),_0x2e104b[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xea'));};AGIVertices[_0x070e('0xd')][_0x070e('0xeb')]=function(_0xa4fe4e){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xec'),_0xa4fe4e[_0x070e('0x34')]));var _0x11e768='';if(_0xa4fe4e[_0x070e('0xed')]){if(!this[_0x070e('0x80')](_0xa4fe4e['trunk_id'])){return this['channel'][_0x070e('0x27')](_0xa4fe4e,_0x070e('0xee'));}else{var _0x4f6dab=parseInt(_0xa4fe4e[_0x070e('0xed')],0xa);if(isNaN(_0x4f6dab)){_0x11e768=_0xa4fe4e[_0x070e('0xed')];}else{_0x11e768=this['getTrunk'][_0x070e('0x6e')](this,_0xa4fe4e[_0x070e('0xed')]);if(!_0x11e768){return this['channel'][_0x070e('0x27')](_0xa4fe4e,_0x070e('0xef'));}}}}else if(_0xa4fe4e[_0x070e('0xf0')]){_0x11e768=_0xa4fe4e[_0x070e('0xf0')];}else{return this[_0x070e('0xc')][_0x070e('0x27')](_0xa4fe4e,'no\x20trunk\x20selected');}var _0x3a01db=this[_0x070e('0xc')][_0x070e('0xab')]('DIAL',[util[_0x070e('0x52')](_0x070e('0xf1'),_0x11e768,_0xa4fe4e[_0x070e('0x45')]),_0xa4fe4e[_0x070e('0x60')],_0xa4fe4e['opts'],_0xa4fe4e['url']]);if(_0x3a01db[_0x070e('0xa3')]===-0x1){return _0x3a01db;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xf2'),_0x070e('0xd2')));};AGIVertices[_0x070e('0xd')]['finally']=function(_0xb14da8){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xf3'),_0xb14da8[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xf4'));};AGIVertices[_0x070e('0xd')][_0x070e('0xa')]=function(_0x15966e){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0xf5'),_0x15966e[_0x070e('0x34')]));if(_0x15966e['retry']===0x0){return this[_0x070e('0x9c')](_0x15966e);}_0x15966e[_0x070e('0xf6')]-=0x1;if(!this[_0x070e('0x80')](_0x15966e[_0x070e('0xf7')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x15966e,_0x070e('0xf8'));}var _0x5a002d=this[_0x070e('0x1c')][_0x070e('0x6e')](this,_0x15966e[_0x070e('0xf7')]);if(!_0x5a002d){return this[_0x070e('0xc')][_0x070e('0x27')](_0x15966e,_0x070e('0xf9'));}if(!this[_0x070e('0x80')](_0x15966e[_0x070e('0xc5')])){return this[_0x070e('0xc')]['error'](_0x070e('0xc6'));}var _0x3b5379=this[_0x070e('0xc')][_0x070e('0xfa')](_0x5a002d,_0x15966e[_0x070e('0xfb')],_0x15966e[_0x070e('0xfc')]);var _0x3736ca=_0x3b5379[_0x070e('0xa3')]?_0x3b5379[_0x070e('0xa3')][_0x070e('0x49')]():'';logger[_0x070e('0x29')](_0x070e('0xfd'),JSON[_0x070e('0x70')](_0x3b5379));if(_0x3b5379[_0x070e('0xa3')]===-0x1){this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x15966e,_0x3736ca);return _0x3b5379;}else if(_0x3b5379[_0x070e('0x99')]===_0x070e('0x60')){_0x3b5379[_0x070e('0xa3')]=_0x3736ca[_0x070e('0x97')]>=parseInt(_0x15966e[_0x070e('0xfe')])?'x':'i';}else{_0x3b5379[_0x070e('0xa3')]=_0x3736ca['length']>=parseInt(_0x15966e[_0x070e('0xfe')])&&_0x3736ca[_0x070e('0x97')]<=parseInt(_0x15966e[_0x070e('0xfc')])?'x':'i';}var _0x35242d=this['getVariable'][_0x070e('0x6e')](this,_0x15966e['variable_id']);if(!_0x35242d){return this[_0x070e('0xc')]['error'](_0x15966e,'no\x20variable\x20found');}this[_0x070e('0xc')][_0x070e('0x9b')](_0x35242d,_0x3736ca);if(this[_0x070e('0x80')](_0x15966e['hiddendigitsnum'])){var _0x11e90d=parseInt(_0x15966e['hiddendigitsnum'],0xa);var _0x120acd=rs[_0x070e('0xff')]({'charset':'*','length':_0x11e90d});var _0x4f11dc=_0x3736ca[_0x070e('0x97')];if(_0x4f11dc>0x0){if(_0x4f11dc>_0x11e90d){this['createSquareDetailsReport'][_0x070e('0x6e')](this,_0x15966e,_0x15966e[_0x070e('0x100')]===_0x070e('0x101')?_0x120acd+_0x3736ca['substr'](_0x11e90d):_0x3736ca['substr'](0x0,_0x4f11dc-_0x11e90d)+_0x120acd);}else{this[_0x070e('0x32')]['sync'](this,_0x15966e,rs[_0x070e('0xff')]({'charset':'*','length':_0x4f11dc}));}}else{this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x15966e,'');}}else{this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x15966e,_0x3736ca);}return _0x3b5379;};AGIVertices[_0x070e('0xd')]['getsecretdigits']=function(_0x58d330){logger[_0x070e('0x29')](util['format']('Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block',_0x58d330[_0x070e('0x34')]));return this[_0x070e('0xa')](_0x58d330);};AGIVertices[_0x070e('0xd')]['goal']=function(_0x241d86){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20GOAL\x20(%s)\x20block',_0x241d86['label']));this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x241d86,_0x241d86[_0x070e('0x102')]);return this['channel'][_0x070e('0xad')](util['format'](_0x070e('0x103'),_0x241d86['goalname']));};AGIVertices[_0x070e('0xd')][_0x070e('0x104')]=function(_0x530311){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x105'),_0x530311[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x530311[_0x070e('0x83')])||!this[_0x070e('0x80')](_0x530311[_0x070e('0x84')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x106'));}if(!this[_0x070e('0x80')](_0x530311[_0x070e('0x59')])){return this['channel'][_0x070e('0xad')](_0x070e('0xb0'));}this[_0x070e('0xc')]['noop'](util['format'](_0x070e('0x107'),_0x530311[_0x070e('0x59')]));var _0x5ab97b=this[_0x070e('0x82')][_0x070e('0x6e')](this,_0x530311);if(_0x5ab97b){this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')]('aws\x20Polly\x20%s\x20file\x20created',_0x5ab97b));var _0x27fc1f=this[_0x070e('0xc')]['streamFile'](_0x5ab97b);try{fs[_0x070e('0xe5')](_0x5ab97b+_0x070e('0xe6'));}catch(_0x3dac08){logger[_0x070e('0x27')](_0x3dac08);}return _0x27fc1f;}return this[_0x070e('0xc')][_0x070e('0x27')](_0x530311,_0x070e('0x108'));};AGIVertices[_0x070e('0xd')][_0x070e('0x109')]=function(_0x5d8b98){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x10a'),_0x5d8b98[_0x070e('0x34')]));if(!this['isConfigured'](_0x5d8b98['aws_access_key_id'])||!this['isConfigured'](_0x5d8b98[_0x070e('0x84')])){return this['channel'][_0x070e('0xad')](_0x070e('0x106'));}if(!this['isConfigured'](_0x5d8b98[_0x070e('0x10b')])){return this['channel']['noop'](_0x070e('0x10c'));}if(!this[_0x070e('0x80')](_0x5d8b98[_0x070e('0x59')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xb0'));}this[_0x070e('0xc')][_0x070e('0xd6')]=!![];this[_0x070e('0x32')](_0x5d8b98);this[_0x070e('0x3f')](_0x5d8b98[_0x070e('0x59')],'in');this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x10d'),_0x5d8b98[_0x070e('0x59')]));var _0x3f8bb0=this[_0x070e('0x87')][_0x070e('0x6e')](this,_0x5d8b98);if(_0x3f8bb0){for(var _0x4d2b60 in _0x3f8bb0){if(_0x3f8bb0['hasOwnProperty'](_0x4d2b60)&&_['isString'](_0x3f8bb0[_0x4d2b60])){this[_0x070e('0xc')][_0x070e('0x9b')](util[_0x070e('0x52')]('AWS_LEX_%s',_0x4d2b60[_0x070e('0x66')]()),_0x3f8bb0[_0x4d2b60]);}}if(_[_0x070e('0x42')](_0x3f8bb0['message'])){return this['channel'][_0x070e('0xad')]('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0x070e('0x3f')](_0x3f8bb0[_0x070e('0x74')],_0x070e('0xe3'));return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('Amazon\x20Lex\x20Result\x20%s',_0x3f8bb0[_0x070e('0x74')]));}}return this[_0x070e('0xc')][_0x070e('0x27')](_0x5d8b98,'Amazon\x20Lex\x20is\x20unreachable');};AGIVertices[_0x070e('0xd')]['googleasr']=function(_0x56c577){logger[_0x070e('0x29')](util['format'](_0x070e('0x10e'),_0x56c577['label'],_0x56c577[_0x070e('0x60')]));if(!this[_0x070e('0x80')](_0x56c577['key'])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x10f'));}var _0x293fdd=_0x070e('0x110');var _0x2e7302=util[_0x070e('0x52')](_0x070e('0x111'),FILES_PATH,rs[_0x070e('0xff')](0x4));var _0x161986=util['format'](_0x070e('0x95'),_0x2e7302,_0x293fdd);var _0x58530a=!![];if(_0x56c577[_0x070e('0x112')]===_0x070e('0x113')){_0x58530a=![];}var _0x58052b=this[_0x070e('0xc')]['recordFile'](_0x2e7302,_0x293fdd,_0x56c577[_0x070e('0x114')],_0x56c577['timeout'],undefined,_0x58530a);if(_0x58052b[_0x070e('0xa3')]!==-0x1){this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x115'),_0x161986));var _0x2f4102=this[_0x070e('0x88')][_0x070e('0x6e')](this,_0x56c577,_0x161986);if(_0x2f4102){for(var _0x5cbcf6 in _0x2f4102){if(_0x2f4102[_0x070e('0x92')](_0x5cbcf6)){this['channel']['setVariable'](util[_0x070e('0x52')]('GOOGLE_ASR_%s',_0x5cbcf6['toUpperCase']()),_0x2f4102[_0x5cbcf6]);}}return this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x116'),JSON[_0x070e('0x70')](_0x2f4102)));}}return _0x58052b;};AGIVertices['prototype'][_0x070e('0x117')]=function(_0xb2eb99){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x118'),_0xb2eb99['label']));if(!this[_0x070e('0x80')](_0xb2eb99[_0x070e('0x8b')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x119'));}if(!this[_0x070e('0x80')](_0xb2eb99[_0x070e('0x8c')])){return this['channel'][_0x070e('0xad')](_0x070e('0x11a'));}var _0x231e23=_0x070e('0x110');var _0x4f8b92=util[_0x070e('0x52')](_0x070e('0x111'),FILES_PATH,rs[_0x070e('0xff')](0x4));var _0x4b190e=util[_0x070e('0x52')](_0x070e('0x95'),_0x4f8b92,_0x231e23);var _0x73e3f4=!![];if(_0xb2eb99['beep']===_0x070e('0x113')){_0x73e3f4=![];}var _0x581b04=this[_0x070e('0xc')][_0x070e('0x11b')](_0x4f8b92,_0x231e23,_0xb2eb99[_0x070e('0x114')],_0xb2eb99[_0x070e('0x60')],undefined,_0x73e3f4);if(_0x581b04['result']!==-0x1){this[_0x070e('0xc')][_0x070e('0xad')](util['format']('tilde\x20%s\x20file\x20created',_0x4b190e));var _0x163bd1=this[_0x070e('0x8a')][_0x070e('0x6e')](this,_0xb2eb99,_0x4b190e);if(_0x163bd1){for(var _0x188811 in _0x163bd1){if(_0x163bd1['hasOwnProperty'](_0x188811)){this[_0x070e('0xc')][_0x070e('0x9b')](util[_0x070e('0x52')]('TILDE_ASR_%s',_0x188811[_0x070e('0x66')]()),_0x163bd1[_0x188811]);}}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('TildeASR\x20Result\x20%s',JSON['stringify'](_0x163bd1)));}}return _0x581b04;};AGIVertices[_0x070e('0xd')][_0x070e('0x11c')]=function(_0x58c7e1){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x58c7e1['label']));return this[_0x070e('0xc')][_0x070e('0x11d')](_0x58c7e1[_0x070e('0x11e')],_0x58c7e1[_0x070e('0x3a')],_0x58c7e1['priority']);};AGIVertices['prototype'][_0x070e('0x11f')]=function(_0x20d4ba){logger['info'](util[_0x070e('0x52')]('Enter\x20in\x20GOTOIF\x20(%s)\x20block',_0x20d4ba[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x20d4ba[_0x070e('0x120')])){return this['channel'][_0x070e('0x27')](_0x20d4ba,'no\x20condition\x20configured');}try{var _0x500281=eval(_0x20d4ba['condition'])?_0x070e('0x121'):_0x070e('0x122');this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x123'),_0x20d4ba[_0x070e('0x120')],_0x500281));return{'code':0xc8,'result':_0x500281};}catch(_0x1a9fb6){return{'code':0xc8,'result':_0x070e('0x122')};}};AGIVertices[_0x070e('0xd')][_0x070e('0x124')]=function(_0x5f31f8){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block',_0x5f31f8['label']));if(!this[_0x070e('0x80')](_0x5f31f8[_0x070e('0x125')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x5f31f8,'no\x20interval\x20configured');}var _0x1935cb=this[_0x070e('0x126')][_0x070e('0x6e')](this,_0x5f31f8[_0x070e('0x125')]);if(!_0x1935cb){return this[_0x070e('0xc')][_0x070e('0x27')](_0x5f31f8,'no\x20intervals\x20found');}for(var _0x312b21=0x0;_0x312b21<_0x1935cb['length'];_0x312b21+=0x1){var _0x260eb9=this[_0x070e('0xc')][_0x070e('0xe')](util[_0x070e('0x52')](_0x070e('0x127'),_0x1935cb[_0x312b21]));if(_0x260eb9[_0x070e('0xa3')]===-0x1){return _0x260eb9;}logger[_0x070e('0x29')](util['format'](_0x070e('0x128'),_0x1935cb[_0x312b21],_0x260eb9[_0x070e('0x99')]));if(_0x260eb9[_0x070e('0x99')]===_0x070e('0x121')){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x128'),_0x1935cb[_0x312b21],_0x070e('0x121')));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x128'),_0x1935cb[_0x312b21],_0x070e('0x121')));return{'code':0xc8,'result':_0x070e('0x121')};}else{logger['info'](util[_0x070e('0x52')](_0x070e('0x128'),_0x1935cb[_0x312b21],'false'));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x128'),_0x1935cb[_0x312b21],'false'));}}return{'code':0xc8,'result':_0x070e('0x122')};};AGIVertices[_0x070e('0xd')]['hangup']=function(_0x1ba1ea){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x129'),_0x1ba1ea[_0x070e('0x34')]));return this['channel'][_0x070e('0x12a')]();};AGIVertices[_0x070e('0xd')][_0x070e('0x12b')]=function(_0x1d2b7a){logger['info'](util[_0x070e('0x52')](_0x070e('0x12c'),_0x1d2b7a[_0x070e('0x34')]));if(!this['isConfigured'](_0x1d2b7a[_0x070e('0x78')])){return this[_0x070e('0xc')]['noop'](_0x070e('0x10f'));}var _0x30a7ca=_0x070e('0x110');var _0x4264d0=util['format'](_0x070e('0x111'),FILES_PATH,rs['generate'](0x4));var _0x2570b6=util[_0x070e('0x52')](_0x070e('0x95'),_0x4264d0,_0x30a7ca);var _0x57110b=!![];if(_0x1d2b7a['beep']==='NOBEEP'){_0x57110b=![];}var _0x2fc59f=this[_0x070e('0xc')]['recordFile'](_0x4264d0,_0x30a7ca,_0x1d2b7a[_0x070e('0x114')],_0x1d2b7a[_0x070e('0x60')],undefined,_0x57110b);if(_0x2fc59f[_0x070e('0xa3')]!==-0x1){this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x12d'),_0x2570b6));var _0x5b5fea=this[_0x070e('0x7e')]['sync'](this,_0x1d2b7a,_0x2570b6);if(_0x5b5fea){for(var _0x418e44 in _0x5b5fea){if(_0x5b5fea[_0x070e('0x92')](_0x418e44)){this[_0x070e('0xc')][_0x070e('0x9b')](util['format'](_0x070e('0x12e'),_0x418e44[_0x070e('0x66')]()),_0x5b5fea[_0x418e44]);}}return this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')]('IspeechASR\x20Result\x20%s',JSON[_0x070e('0x70')](_0x5b5fea)));}}return _0x2fc59f;};AGIVertices[_0x070e('0xd')][_0x070e('0x12f')]=function(_0x4d4f9e){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x130'),_0x4d4f9e[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x4d4f9e[_0x070e('0x78')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x10f'));}if(!this[_0x070e('0x80')](_0x4d4f9e[_0x070e('0x59')])){return this['channel'][_0x070e('0xad')](_0x070e('0xb0'));}this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x131'),_0x4d4f9e[_0x070e('0x59')]));var _0xd1b431=this[_0x070e('0x7b')][_0x070e('0x6e')](this,_0x4d4f9e);if(_0xd1b431){this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0x12d'),_0xd1b431));var _0x2f8f75=this[_0x070e('0xc')]['streamFile'](_0xd1b431,_0x4d4f9e[_0x070e('0x114')]);try{fs[_0x070e('0xe5')](_0xd1b431+_0x070e('0xe6'));}catch(_0x42c8b3){logger[_0x070e('0x27')](_0x42c8b3);}return _0x2f8f75;}return this[_0x070e('0xc')][_0x070e('0x27')](_0x4d4f9e,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0x070e('0xd')][_0x070e('0x132')]=function(_0x32aa30){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x32aa30[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x32aa30['findBy'])){return this['channel']['error'](_0x32aa30,_0x070e('0x133'));}logger[_0x070e('0x29')](util['format']('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x070e('0xc')]['callerid'],_0x32aa30[_0x070e('0x134')]));var _0x5fcc97=this[_0x070e('0x50')][_0x070e('0x6e')](this,_0x32aa30[_0x070e('0x134')]);if(_0x5fcc97){logger[_0x070e('0x29')](util[_0x070e('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x070e('0xc')][_0x070e('0x37')],_0x32aa30[_0x070e('0x134')]));this[_0x070e('0xc')]['noop'](util['format'](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x32aa30['findBy']));return{'code':0xc8,'result':_0x070e('0x136')};}else{logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x137'),this['channel']['callerid'],_0x32aa30[_0x070e('0x134')]));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x137'),this['channel']['callerid'],_0x32aa30['findBy']));return{'code':0xc8,'result':_0x070e('0x138')};}};AGIVertices[_0x070e('0xd')][_0x070e('0x139')]=function(_0x3b9780){logger['info'](util[_0x070e('0x52')]('Enter\x20in\x20LOGOUT\x20(%s)\x20block',_0x3b9780['label']));if(!this[_0x070e('0x80')](_0x3b9780[_0x070e('0x134')])){return this['channel'][_0x070e('0x27')](_0x3b9780,_0x070e('0x133'));}logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x13a'),this[_0x070e('0xc')]['callerid'],_0x3b9780[_0x070e('0x134')]));var _0x2e9e03=this[_0x070e('0x4f')]['sync'](this,_0x3b9780[_0x070e('0x134')]);if(_0x2e9e03){logger[_0x070e('0x29')](util[_0x070e('0x52')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x070e('0xc')][_0x070e('0x37')],_0x3b9780[_0x070e('0x134')]));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x3b9780[_0x070e('0x134')]));return{'code':0xc8,'result':_0x070e('0x136')};}else{logger['info'](util[_0x070e('0x52')](_0x070e('0x137'),this[_0x070e('0xc')][_0x070e('0x37')],_0x3b9780['findBy']));this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0x137'),this[_0x070e('0xc')]['callerid'],_0x3b9780[_0x070e('0x134')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x070e('0xd')]['math']=function(_0x5b85be){logger[_0x070e('0x29')](util['format'](_0x070e('0x13b'),_0x5b85be[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x5b85be[_0x070e('0x13c')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x5b85be,'no\x20operation\x20configured');}this['channel']['noop'](util['format'](_0x070e('0x13d'),_0x5b85be['operation']));var _0x295e24=eval(_0x5b85be[_0x070e('0x13c')]);if(!this[_0x070e('0x80')](_0x5b85be[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2ba494=this[_0x070e('0xe')][_0x070e('0x6e')](this,_0x5b85be[_0x070e('0xc5')]);if(!_0x2ba494){return this[_0x070e('0xc')][_0x070e('0x27')](_0x5b85be,'no\x20variable\x20found');}if(_[_0x070e('0x13e')](_0x295e24)){var _0x10bc10=this;_0x295e24[_0x070e('0xc8')](function(_0x52f5bd,_0x1f1885){_0x10bc10[_0x070e('0xc')][_0x070e('0x9b')](util[_0x070e('0x52')](_0x070e('0x13f'),_0x2ba494,_0x1f1885),_0x52f5bd);});return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x140'),_0x2ba494));}else{return this[_0x070e('0xc')][_0x070e('0x9b')](_0x2ba494,_0x295e24);}};AGIVertices[_0x070e('0xd')][_0x070e('0x9')]=function(_0x74805){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x141'),_0x74805[_0x070e('0x34')]));if(_0x74805[_0x070e('0xf6')]===0x0){return this[_0x070e('0x9c')](_0x74805);}_0x74805['retry']-=0x1;if(!this[_0x070e('0x80')](_0x74805['file_id'])){return this['channel'][_0x070e('0x27')](_0x74805,'no\x20file\x20audio\x20selected');}var _0x5ab7a3=this[_0x070e('0x1c')][_0x070e('0x6e')](this,_0x74805[_0x070e('0xf7')]);if(!_0x5ab7a3){return this[_0x070e('0xc')][_0x070e('0x27')](_0x74805,_0x070e('0xf9'));}var _0x432007=this[_0x070e('0xc')][_0x070e('0xfa')](_0x5ab7a3,_0x74805['response'],_0x74805[_0x070e('0x142')]);var _0x14db06=_0x432007[_0x070e('0xa3')];if(_0x432007[_0x070e('0xa3')]===-0x1){this[_0x070e('0x32')]['sync'](this,_0x74805,'-1');return _0x432007;}else if(_0x432007[_0x070e('0x99')]===_0x070e('0x60')){_0x432007[_0x070e('0xa3')]=_0x432007[_0x070e('0xa3')]['length']>0x0?_0x432007[_0x070e('0xa3')]:'t';}else if(_[_0x070e('0x41')](_0x432007['result'])){_0x432007[_0x070e('0xa3')]='#';_0x14db06='#';}if(!this[_0x070e('0x80')](_0x74805[_0x070e('0xc5')])){this[_0x070e('0xc')]['noop'](_0x070e('0xc6'));}else{var _0xf622a9=this[_0x070e('0xe')]['sync'](this,_0x74805[_0x070e('0xc5')]);if(!_0xf622a9){return this['channel'][_0x070e('0x27')](_0x74805,_0x070e('0xc7'));}this['channel'][_0x070e('0x9b')](_0xf622a9,_0x14db06);}this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x74805,_0x14db06);return _0x432007;};AGIVertices[_0x070e('0xd')][_0x070e('0xad')]=function(_0x87589c){logger[_0x070e('0x29')](util['format']('Enter\x20in\x20NOOP\x20(%s)\x20block',_0x87589c[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0xad')](_0x87589c['output']||_0x87589c['label']);};AGIVertices[_0x070e('0xd')]['pause']=function(_0x4dae62){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x143'),_0x4dae62[_0x070e('0x34')]));if(!this['isConfigured'](_0x4dae62['findBy'])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x4dae62,_0x070e('0x133'));}logger[_0x070e('0x29')](util[_0x070e('0x52')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62[_0x070e('0x134')]));var _0x50c3a9=this[_0x070e('0x4b')]['sync'](this,_0x4dae62[_0x070e('0x144')]);var _0x1969fe=this[_0x070e('0x4c')][_0x070e('0x6e')](this,_0x4dae62[_0x070e('0x134')],_0x50c3a9);if(_0x1969fe){logger['info'](util['format'](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62['findBy']));this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62[_0x070e('0x134')]));return{'code':0xc8,'result':_0x070e('0x136')};}else{logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x137'),this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62[_0x070e('0x134')]));this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0x135'),this[_0x070e('0xc')][_0x070e('0x37')],_0x4dae62['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['playback']=function(_0x430d96){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x145'),_0x430d96[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x430d96[_0x070e('0xf7')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x430d96,'no\x20file\x20audio\x20selected');}var _0x5d4371=this['getSound']['sync'](this,_0x430d96[_0x070e('0xf7')]);if(!_0x5d4371){return this['channel'][_0x070e('0x27')](_0x430d96,_0x070e('0xf9'));}var _0x2b80c2=this[_0x070e('0xc')][_0x070e('0xab')](_0x070e('0x146'),[_0x5d4371,_0x430d96[_0x070e('0x147')]]);if(_0x2b80c2[_0x070e('0xa3')]===-0x1){return _0x2b80c2;}return this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xae'),_0x070e('0x146'),_0x5d4371));};AGIVertices[_0x070e('0xd')][_0x070e('0x148')]=function(_0x28215c){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x149'),_0x28215c[_0x070e('0x34')]));if(!this['isConfigured'](_0x28215c[_0x070e('0x14a')])){return this[_0x070e('0xc')]['error'](_0x28215c,_0x070e('0x14b'));}var _0x551a5f='';var _0x4cba0f=parseInt(_0x28215c[_0x070e('0x14a')],0xa);if(isNaN(_0x4cba0f)){_0x551a5f=_0x28215c['queue_id'];}else{_0x551a5f=this[_0x070e('0x14c')][_0x070e('0x6e')](this,_0x28215c[_0x070e('0x14a')]);if(!_0x551a5f){return this['channel'][_0x070e('0x27')](_0x28215c,'no\x20queue\x20found');}}var _0x43f3f6='';if(this['isConfigured'](_0x28215c[_0x070e('0xf7')])){var _0x2190ad=this[_0x070e('0x1c')]['sync'](this,_0x28215c['file_id']);if(_0x2190ad){_0x43f3f6=_0x2190ad;}}this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x28215c,_0x551a5f);if(_0x28215c[_0x070e('0x147')][_0x070e('0x14d')]('x')<0x0){_0x28215c['opts']+='x';}if(_0x28215c[_0x070e('0x147')][_0x070e('0x14d')]('X')<0x0){_0x28215c[_0x070e('0x147')]+='X';}this[_0x070e('0xc')][_0x070e('0x9b')](_0x070e('0x14e'),_0x551a5f?_0x551a5f['toLowerCase']():'');var _0xf57865=this[_0x070e('0xc')]['exec'](_0x070e('0x14f'),[_0x551a5f,_0x28215c[_0x070e('0x147')],_0x28215c[_0x070e('0x150')],_0x43f3f6,_0x28215c[_0x070e('0x60')],_0x28215c['agi'],_0x28215c['macro'],_0x28215c[_0x070e('0x151')],'',_0x28215c[_0x070e('0x152')]]);if(_0xf57865[_0x070e('0xa3')]===-0x1){return _0xf57865;}return this[_0x070e('0xc')][_0x070e('0xad')](util['format'](_0x070e('0xae'),_0x070e('0x14f'),_0x551a5f));};AGIVertices[_0x070e('0xd')][_0x070e('0x153')]=function(_0x1f048d){logger['info'](util[_0x070e('0x52')](_0x070e('0x154'),_0x1f048d[_0x070e('0x34')]));var _0x341b84=_0x1f048d['recordingFormat']||_0x070e('0x110');var _0x3e5622=util['format'](_0x070e('0x155'),this[_0x070e('0xc')][_0x070e('0x33')],rs[_0x070e('0xff')](0x5));var _0xc73764=util[_0x070e('0x52')](_0x070e('0x156'),FILES_PATH,_0x3e5622,_0x341b84);var _0x1b3e90=util[_0x070e('0x52')]('%s/recordings/%s',FILES_PATH,_0x3e5622);this[_0x070e('0x38')][_0x070e('0x6e')](this,_0x1f048d,_0x3e5622,_0xc73764);this[_0x070e('0xc')][_0x070e('0x9b')](_0x070e('0x157'),_0x3e5622);logger[_0x070e('0x29')](_0x070e('0x158'),_0x1b3e90,_0x341b84,_0x1f048d['escape_digits'],_0x1f048d[_0x070e('0x60')]);return this[_0x070e('0xc')][_0x070e('0x11b')](_0x1b3e90,_0x341b84,_0x1f048d['escape_digits'],_0x1f048d[_0x070e('0x60')],undefined,!![]);};AGIVertices[_0x070e('0xd')][_0x070e('0x159')]=function(_0x12d53a){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x15a'),_0x12d53a[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x12d53a[_0x070e('0x150')])){return this['channel']['noop'](_0x070e('0x15b'));}var _0xb5b920=this[_0x070e('0x5f')]['sync'](this,_0x12d53a);logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x15c'),util['inspect'](_0xb5b920,{'showHidden':![],'depth':null})));if(!this[_0x070e('0x80')](_0x12d53a[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x7b081b=this[_0x070e('0xe')][_0x070e('0x6e')](this,_0x12d53a[_0x070e('0xc5')]);if(!_0x7b081b){return this[_0x070e('0xc')][_0x070e('0x27')](_0x12d53a,'no\x20variable\x20found');}this['channel'][_0x070e('0x9b')](util['format'](_0x070e('0x15d'),_0x7b081b),_0xb5b920[_0x070e('0x72')]?_0xb5b920['statusCode']:_0x070e('0x15e'));this[_0x070e('0xc')][_0x070e('0x9b')](util['format'](_0x070e('0x15f'),_0x7b081b),_0xb5b920['statusMessage']?_0xb5b920['statusMessage']:'OK');if(_0xb5b920[_0x070e('0x67')]){try{this[_0x070e('0x94')](_0xb5b920['body'],_0x7b081b);}catch(_0x210004){logger[_0x070e('0x27')](util['format'](_0x070e('0x160'),_0x7b081b));}}return this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x161'),_0x7b081b));};AGIVertices[_0x070e('0xd')]['saydigits']=function(_0x588ef6){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x162'),_0x588ef6[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0x163')](_0x588ef6[_0x070e('0x164')][_0x070e('0xc3')](/\s+/g,''),_0x588ef6[_0x070e('0x165')]);};AGIVertices['prototype'][_0x070e('0x166')]=function(_0x482296){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x167'),_0x482296[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0x168')](_0x482296[_0x070e('0x61')]['replace'](/\s+/g,''),_0x482296[_0x070e('0x165')]);};AGIVertices[_0x070e('0xd')]['sayphonetic']=function(_0x29b2a3){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x169'),_0x29b2a3[_0x070e('0x34')]));return this[_0x070e('0xc')][_0x070e('0x16a')](_0x29b2a3[_0x070e('0x59')],_0x29b2a3[_0x070e('0x165')]);};AGIVertices['prototype']['sendMail']=function(_0x3fbee5){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x16b'),_0x3fbee5[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x3fbee5[_0x070e('0x16c')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x16d'));}var _0x39440f=this[_0x070e('0x20')][_0x070e('0x6e')](this,_0x3fbee5['account_id']);if(!_0x39440f||!_0x39440f['Smtp']){return this[_0x070e('0xc')][_0x070e('0x27')](_0x3fbee5,_0x070e('0x16e'));}var _0x516d34={'from':util[_0x070e('0x52')](_0x070e('0x16f'),_0x39440f[_0x070e('0x12')],_0x39440f[_0x070e('0x170')]||_0x39440f['Smtp'][_0x070e('0x171')]),'to':_0x3fbee5['to']||'','cc':_0x3fbee5['cc']||'','bcc':_0x3fbee5['bcc']||'','subject':_0x3fbee5[_0x070e('0x172')],'html':_0x3fbee5[_0x070e('0x59')],'text':_0x3fbee5[_0x070e('0x59')]};var _0x4ef713={'tls':{'rejectUnauthorized':![]}};if(_0x39440f[_0x070e('0x173')][_0x070e('0x174')]){_0x4ef713[_0x070e('0x174')]=_0x39440f[_0x070e('0x173')]['service'];}else{_0x4ef713['host']=_0x39440f[_0x070e('0x173')][_0x070e('0x175')];_0x4ef713[_0x070e('0x176')]=_0x39440f[_0x070e('0x173')]['port'];_0x4ef713[_0x070e('0x177')]=_0x39440f[_0x070e('0x173')][_0x070e('0x177')];}if(_0x39440f[_0x070e('0x173')][_0x070e('0x178')]){_0x4ef713['auth']={'user':_0x39440f['Smtp'][_0x070e('0x171')],'pass':_0x39440f[_0x070e('0x173')][_0x070e('0x179')]};}if(this[_0x070e('0x80')](_0x3fbee5[_0x070e('0x17a')])){}logger[_0x070e('0xcd')](_0x070e('0x17b'),JSON[_0x070e('0x70')](_0x516d34));this[_0x070e('0x32')]['sync'](this,_0x3fbee5,_0x3fbee5[_0x070e('0x16c')]);this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x17c'),_0x39440f['name']));this['sendMailMessage'][_0x070e('0x6e')](this,_0x4ef713,_0x516d34);return this[_0x070e('0xc')]['noop'](_0x070e('0x17d'));};AGIVertices[_0x070e('0xd')][_0x070e('0x17e')]=function(_0x268789){logger[_0x070e('0x29')](util['format']('Enter\x20in\x20SENDFAX\x20(%s)\x20block',_0x268789['label']));return this[_0x070e('0xc')][_0x070e('0xad')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x070e('0xd')][_0x070e('0x17f')]=function(_0x1bf822){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20SENDSMS\x20(%s)\x20block',_0x1bf822[_0x070e('0x34')]));if(!this['isConfigured'](_0x1bf822[_0x070e('0x180')])){return this['channel'][_0x070e('0xad')](_0x070e('0x181'));}var _0x4fcb73=this['getSmsAccount'][_0x070e('0x6e')](this,_0x1bf822['sms_account_id']);if(!_0x4fcb73){return this['channel'][_0x070e('0x27')](_0x1bf822,_0x070e('0x182'));}var _0x7df802={'body':_0x1bf822[_0x070e('0x183')],'phone':_0x1bf822['to']||'','SmsAccountId':_0x4fcb73['id']};logger[_0x070e('0xcd')](_0x070e('0x184'),JSON[_0x070e('0x70')](_0x7df802));this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x1bf822,_0x1bf822['sms_account_id']);this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x185'),_0x4fcb73[_0x070e('0x12')]));this[_0x070e('0x31')][_0x070e('0x6e')](this,_0x7df802);return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x186'));};AGIVertices[_0x070e('0xd')][_0x070e('0x187')]=function(_0x3c42f1){logger['info'](util[_0x070e('0x52')](_0x070e('0x188'),_0x3c42f1['label']));if(!this[_0x070e('0x80')](_0x3c42f1[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x3c42f1,_0x070e('0x189'));}var _0x2b563a=this['getVariable'][_0x070e('0x6e')](this,_0x3c42f1[_0x070e('0xc5')]);if(!_0x2b563a){return this[_0x070e('0xc')][_0x070e('0x27')](_0x3c42f1,'no\x20variable\x20found');}return this[_0x070e('0xc')][_0x070e('0x9b')](_0x2b563a,_0x3c42f1[_0x070e('0x18a')]);};AGIVertices[_0x070e('0xd')][_0x070e('0x18b')]=function(_0x3cfaec){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x18c'),_0x3cfaec[_0x070e('0x34')]));this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x18d'));if(_0x3cfaec[_0x070e('0x9f')]===_0x070e('0x18e')){this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x18f'));return this[_0x070e('0xc')][_0x070e('0x9f')]();}return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0x190'));};AGIVertices[_0x070e('0xd')][_0x070e('0x191')]=function(_0xc87ce8){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x192'),_0xc87ce8[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0xc87ce8['project_id'])){return this['channel']['error'](_0xc87ce8,_0x070e('0x193'));}var _0x3d07e1=this[_0x070e('0x14')][_0x070e('0x6e')](this,_0xc87ce8[_0x070e('0x194')]);if(!this['isConfigured'](_0x3d07e1)){return this[_0x070e('0xc')]['error'](_0xc87ce8,util['format'](_0x070e('0x195'),_0xc87ce8[_0x070e('0x194')]));}if(_0x3d07e1===this[_0x070e('0xc')][_0x070e('0x36')]){return this[_0x070e('0xc')][_0x070e('0x27')](_0xc87ce8,_0x070e('0x196'));}this['createSquareDetailsReport'][_0x070e('0x6e')](this,_0xc87ce8,_0x3d07e1);var _0x32f943=this['channel'][_0x070e('0xab')](_0x070e('0x197'),util[_0x070e('0x52')](_0x070e('0x198'),config[_0x070e('0x7')][_0x070e('0x175')]||_0x070e('0x199'),_0x3d07e1,this[_0x070e('0xc')]['arg_1']));if(_0x32f943[_0x070e('0xa3')]===-0x1){return _0x32f943;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0xae'),_0x070e('0x197'),_0x3d07e1));};AGIVertices[_0x070e('0xd')][_0x070e('0x19a')]=function(_0x2f0603){logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x19b'),_0x2f0603['label']));var _0x1886e6=this['shellCommand'][_0x070e('0x6e')](this,_0x2f0603[_0x070e('0x9e')]);this[_0x070e('0x32')][_0x070e('0x6e')](this,_0x2f0603,_0x2f0603[_0x070e('0x9e')]);if(this[_0x070e('0x80')](_0x2f0603[_0x070e('0xc5')])){var _0x25860d=this[_0x070e('0xe')][_0x070e('0x6e')](this,_0x2f0603[_0x070e('0xc5')]);if(_0x25860d){this[_0x070e('0xc')][_0x070e('0x9b')](_0x25860d,_0x1886e6);return this['channel'][_0x070e('0xad')](util['format'](_0x070e('0x19c'),_0x2f0603[_0x070e('0x9e')],_0x25860d));}}return this[_0x070e('0xc')]['noop'](util[_0x070e('0x52')](_0x070e('0x19d'),_0x2f0603[_0x070e('0x9e')]));};AGIVertices[_0x070e('0xd')][_0x070e('0x19e')]=function(_0x2c72d6){logger['info'](util[_0x070e('0x52')](_0x070e('0x19f'),_0x2c72d6[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x2c72d6['apiKey'])){return this['channel'][_0x070e('0xad')](_0x070e('0x1a0'));}if(!this[_0x070e('0x80')](_0x2c72d6[_0x070e('0x59')])){return this[_0x070e('0xc')][_0x070e('0xad')](_0x070e('0xb0'));}this['channel']['noop'](util[_0x070e('0x52')](_0x070e('0x1a1'),_0x2c72d6[_0x070e('0x59')]));var _0x5e281f=this[_0x070e('0x57')][_0x070e('0x6e')](this,_0x2c72d6);if(_0x5e281f){this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x1a2'),_0x5e281f));var _0xb7e563=this['channel'][_0x070e('0x1a3')](_0x5e281f);try{fs['unlink'](_0x5e281f+_0x070e('0xe6'));}catch(_0x285744){logger[_0x070e('0x27')](_0x285744);}return _0xb7e563;}return this[_0x070e('0xc')]['error'](_0x2c72d6,_0x070e('0x1a4'));};AGIVertices[_0x070e('0xd')][_0x070e('0x1a5')]=function(_0x4b2e61){logger[_0x070e('0x29')](util[_0x070e('0x52')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x4b2e61['label']));if(!this['isConfigured'](_0x4b2e61[_0x070e('0x59')])){return this[_0x070e('0xc')][_0x070e('0xad')]('no\x20text\x20configured');}this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x1a6'),_0x4b2e61[_0x070e('0x59')]));var _0x17aca1=this[_0x070e('0x5d')][_0x070e('0x6e')](this,_0x4b2e61);if(_0x17aca1){this['channel'][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x1a7'),_0x17aca1));var _0x37a1a2=this[_0x070e('0xc')][_0x070e('0x1a3')](_0x17aca1);try{fs[_0x070e('0xe5')](_0x17aca1+'.wav');}catch(_0x40e9b7){logger[_0x070e('0x27')](_0x40e9b7);}return _0x37a1a2;}return this[_0x070e('0xc')][_0x070e('0x27')](_0x4b2e61,_0x070e('0x1a8'));};AGIVertices['prototype'][_0x070e('0x1a9')]=function(_0x47ab0c){logger[_0x070e('0x29')](util['format'](_0x070e('0x1aa'),_0x47ab0c[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x47ab0c[_0x070e('0x134')])){return this[_0x070e('0xc')]['error'](_0x47ab0c,'no\x20find\x20by\x20configured');}logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x13a'),this[_0x070e('0xc')][_0x070e('0x37')],_0x47ab0c[_0x070e('0x134')]));var _0x5a1299=this[_0x070e('0x4e')][_0x070e('0x6e')](this,_0x47ab0c[_0x070e('0x134')]);if(_0x5a1299){logger[_0x070e('0x29')](util['format'](_0x070e('0x135'),this[_0x070e('0xc')]['callerid'],_0x47ab0c['findBy']));this[_0x070e('0xc')]['noop'](util['format']('AGENT\x20%s\x20FOUND\x20BY',this['channel'][_0x070e('0x37')],_0x47ab0c[_0x070e('0x134')]));return{'code':0xc8,'result':_0x070e('0x136')};}else{logger[_0x070e('0x29')](util[_0x070e('0x52')](_0x070e('0x137'),this[_0x070e('0xc')][_0x070e('0x37')],_0x47ab0c[_0x070e('0x134')]));this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')](_0x070e('0x137'),this[_0x070e('0xc')][_0x070e('0x37')],_0x47ab0c[_0x070e('0x134')]));return{'code':0xc8,'result':_0x070e('0x138')};}};AGIVertices[_0x070e('0xd')][_0x070e('0x1ab')]=function(_0x515baa){logger['info'](util['format']('Enter\x20in\x20VOICEMAIL\x20(%s)\x20block',_0x515baa[_0x070e('0x34')]));var _0x226f5c=this[_0x070e('0xc')][_0x070e('0xab')]('VOICEMAIL',[_0x515baa['mailbox'],_0x515baa[_0x070e('0x76')]]);if(_0x226f5c[_0x070e('0xa3')]===-0x1){return _0x226f5c;}return this[_0x070e('0xc')][_0x070e('0xad')](util[_0x070e('0x52')]('Executed\x20command\x20%s\x20%s','VOICEMAIL',_0x515baa[_0x070e('0x1ac')]));};AGIVertices['prototype']['vswitch']=function(_0x480daa){logger[_0x070e('0x29')](util['format'](_0x070e('0x1ad'),_0x480daa[_0x070e('0x34')]));if(!this[_0x070e('0x80')](_0x480daa[_0x070e('0xc5')])){return this[_0x070e('0xc')][_0x070e('0x27')](_0x480daa,_0x070e('0x189'));}var _0x57fc31=this[_0x070e('0xe')][_0x070e('0x6e')](this,_0x480daa[_0x070e('0xc5')]);if(!_0x57fc31){return this[_0x070e('0xc')][_0x070e('0x27')](_0x480daa,'no\x20variable\x20found');}var _0x1b3737=this[_0x070e('0xc')][_0x070e('0xe')](_0x57fc31);return{'code':0xc8,'result':_0x1b3737[_0x070e('0x99')]?_0x1b3737[_0x070e('0x99')]:'-'};};String[_0x070e('0xd')]['replaceAll']=function(_0x12a8d8,_0x577e02){return this[_0x070e('0x96')](_0x12a8d8)['join'](_0x577e02);};module[_0x070e('0x1ae')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index 4c5860e..a5872eb 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 _0xb821=['[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','savePause','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','lodash','moment','acw','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','diff','seconds','startAcw','interface','ACW','mandatoryDisposition','name','mandatoryDispositionPause','Action','QueuePause','getAgent','then','voicePause','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','info','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][UPDATE][ERRORS:%s]','[ACW][START]\x20%s','prototype','[TIMER][STOP][AGENT:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnect]\x20%s','[%s][HANGUP:UNIQUEID]','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','stringify','transfererlinkedid'];(function(_0x4fd109,_0x33c503){var _0x30f0a6=function(_0xc11c0d){while(--_0xc11c0d){_0x4fd109['push'](_0x4fd109['shift']());}};_0x30f0a6(++_0x33c503);}(_0xb821,0xa7));var _0x1b82=function(_0x394afc,_0x138007){_0x394afc=_0x394afc-0x0;var _0x2a72f0=_0xb821[_0x394afc];return _0x2a72f0;};'use strict';var util=require('util');var _=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var ami=require('../ami');var logger=require('../../../config/logger')(_0x1b82('0x2'));var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x3b1d14){this[_0x1b82('0x3')]=_0x3b1d14[_0x1b82('0x3')];this[_0x1b82('0x4')]=_0x3b1d14['agents'];this[_0x1b82('0x5')]=_0x3b1d14[_0x1b82('0x5')];this[_0x1b82('0x6')]={};ami['on'](_0x1b82('0x7'),this[_0x1b82('0x8')][_0x1b82('0x9')](this));ami['on'](_0x1b82('0xa'),this[_0x1b82('0xb')][_0x1b82('0x9')](this));ami['on']('hangup',this[_0x1b82('0xc')][_0x1b82('0x9')](this));ami['on'](_0x1b82('0xd'),this[_0x1b82('0xe')][_0x1b82('0x9')](this));ami['on'](_0x1b82('0xf'),this[_0x1b82('0x10')][_0x1b82('0x9')](this));ami['on']('blindtransfer',this[_0x1b82('0x11')][_0x1b82('0x9')](this));ami['on'](_0x1b82('0x12'),this[_0x1b82('0x13')]['bind'](this));}function getDiff(_0x1a6285){var _0x5767aa=moment()['milliseconds'](0x0);var _0x1e553a=moment(_0x1a6285)['milliseconds'](0x0);return _0x5767aa[_0x1b82('0x14')](_0x1e553a,_0x1b82('0x15'));}Acw['prototype'][_0x1b82('0x16')]=function(_0x5dab7d){try{var _0x563261=this;var _0x1b115b=this['channels'][_0x5dab7d][_0x1b82('0x17')];var _0x25228b=this[_0x1b82('0x6')][_0x5dab7d]['queue'];var _0x514082=this[_0x1b82('0x3')][_0x25228b];var _0x5d66c3=![];var _0x3def2d=_0x1b82('0x18');if(_0x514082[_0x1b82('0x19')]){if(_0x514082['mandatoryDispositionPause'][_0x1b82('0x1a')]){_0x5d66c3=!![];_0x3def2d=_0x514082[_0x1b82('0x1b')][_0x1b82('0x1a')];}}ami[_0x1b82('0x1c')]({'action':_0x1b82('0x1d'),'interface':_0x1b115b,'paused':!![],'reason':_0x3def2d})['then'](function(_0x35a2c8){if(_0x563261[_0x1b82('0x4')][_0x1b115b]){return RpcUser[_0x1b82('0x1e')](_0x563261[_0x1b82('0x4')][_0x1b115b]['id'])[_0x1b82('0x1f')](function(_0x31fd64){if(_0x31fd64&&!_0x31fd64[_0x1b82('0x20')]){logger['info'](_0x1b82('0x21'),_0x5dab7d,_0x1b115b,_0x25228b);var _0x233740=_0x563261['channels'][_0x5dab7d][_0x1b82('0x22')]&&_0x563261[_0x1b82('0x6')][_0x5dab7d][_0x1b82('0x23')]?_0x563261['channels'][_0x5dab7d][_0x1b82('0x23')]:_0x5dab7d;return RpcUser['savePause'](_0x563261['agents'][_0x1b115b],_0x3def2d,_0x233740)['then'](function(_0xf2e556){if(!_0x5d66c3){_0x563261[_0x1b82('0x5')][_0x1b115b]={};logger[_0x1b82('0x24')](_0x1b82('0x25'),_0x5dab7d,_0x563261['voiceQueues'][_0x25228b][_0x1b82('0x26')],_0x1b115b,_0x25228b);_0x563261[_0x1b82('0x5')][_0x1b115b][_0x1b82('0x27')]=setTimeout(_0x563261[_0x1b82('0x28')][_0x1b82('0x9')](_0x563261,_0x1b115b),_0x563261[_0x1b82('0x3')][_0x25228b][_0x1b82('0x26')]*0x3e8);_0x563261[_0x1b82('0x5')][_0x1b115b][_0x1b82('0x29')]=moment()[_0x1b82('0x2a')](_0x1b82('0x2b'));_0x563261[_0x1b82('0x5')][_0x1b115b][_0x1b82('0x2c')]=_0x5dab7d;_0x563261['timers'][_0x1b115b][_0x1b82('0x2d')]=_0x25228b;_0x563261[_0x1b82('0x5')][_0x1b115b][_0x1b82('0x2e')]=function(){var _0x457dbb=getDiff(_0x563261[_0x1b82('0x5')][_0x1b115b][_0x1b82('0x29')]);clearTimeout(_0x563261[_0x1b82('0x5')][_0x1b115b][_0x1b82('0x27')]);_0x563261[_0x1b82('0x5')][_0x1b115b][_0x1b82('0x27')]=![];RpcVoiceAgentReport['update']({'acwtime':_0x457dbb},_0x563261[_0x1b82('0x5')][_0x1b115b][_0x1b82('0x2c')],_0x1b115b)[_0x1b82('0x1f')](function(_0xc98ee2){logger['info'](_0x1b82('0x2f'),_0x5dab7d,_0x457dbb,_0xc98ee2);})[_0x1b82('0x30')](function(_0x544bd5){logger[_0x1b82('0x31')](_0x1b82('0x32'),_0x5dab7d,_0x544bd5);});delete _0x563261[_0x1b82('0x5')][_0x1b115b];};}});}else{logger['info']('[%s][INPAUSE][AGENT:%s][QUEUE:%s]',_0x5dab7d,_0x1b115b,_0x25228b);}});}})[_0x1b82('0x30')](function(_0x4c98e0){logger['error'](_0x1b82('0x25'),_0x5dab7d,_0x563261[_0x1b82('0x3')][_0x25228b][_0x1b82('0x26')],_0x1b115b,_0x25228b);})['finally'](function(){delete _0x563261[_0x1b82('0x6')][_0x5dab7d];});}catch(_0x366db3){logger[_0x1b82('0x31')](_0x1b82('0x33'),_0x366db3['message']);}};Acw[_0x1b82('0x34')][_0x1b82('0x28')]=function(_0x2ee9ac){try{var _0x5ebf6c=this;if(_0x5ebf6c['timers'][_0x2ee9ac]){_0x5ebf6c[_0x1b82('0x5')][_0x2ee9ac]['timer']=![];var _0x1d3e68=_0x5ebf6c[_0x1b82('0x5')][_0x2ee9ac][_0x1b82('0x2c')];var _0x348880=_0x5ebf6c[_0x1b82('0x5')][_0x2ee9ac][_0x1b82('0x2d')];var _0x39fe4a=_0x5ebf6c[_0x1b82('0x3')][_0x348880]['acwTimeout'];logger['info'](_0x1b82('0x35'),_0x2ee9ac);RpcUser['saveUnpause'](this[_0x1b82('0x4')][_0x2ee9ac]);RpcVoiceAgentReport['update']({'acwtime':_0x39fe4a,'agentacw':!![]},_0x1d3e68,_0x2ee9ac)[_0x1b82('0x1f')](function(_0x331379){logger[_0x1b82('0x24')](_0x1b82('0x2f'),_0x1d3e68,_0x39fe4a,_0x331379);})[_0x1b82('0x30')](function(_0x202bb4){logger['error'](_0x1b82('0x32'),_0x1d3e68,_0x202bb4);});}else{logger['error'](_0x1b82('0x36'),_0x2ee9ac);if(_0x5ebf6c['timers']){logger[_0x1b82('0x24')]('[ACW][TIMERS]',JSON['stringify'](_0x5ebf6c[_0x1b82('0x5')]));}}}catch(_0x388d14){logger[_0x1b82('0x31')](_0x1b82('0x37'),_0x388d14[_0x1b82('0x38')]);}};Acw['prototype'][_0x1b82('0x8')]=function(_0x4ffa9e){try{if(this[_0x1b82('0x3')][_0x4ffa9e[_0x1b82('0x2d')]]&&(this[_0x1b82('0x3')][_0x4ffa9e[_0x1b82('0x2d')]][_0x1b82('0x2')]||this['voiceQueues'][_0x4ffa9e[_0x1b82('0x2d')]]['mandatoryDisposition'])){if(this[_0x1b82('0x4')][_0x4ffa9e[_0x1b82('0x17')]]){this['channels'][_0x4ffa9e[_0x1b82('0x2c')]]={'queue':_0x4ffa9e[_0x1b82('0x2d')],'interface':_0x4ffa9e[_0x1b82('0x17')],'destlinkedid':_0x4ffa9e[_0x1b82('0x23')]};}}}catch(_0x39f6ef){logger[_0x1b82('0x31')](_0x1b82('0x39'),_0x39f6ef['message']);}};Acw[_0x1b82('0x34')]['syncAgentConnectPreview']=function(_0xb02ec3){try{if(this[_0x1b82('0x3')][_0xb02ec3[_0x1b82('0x2d')]]&&(this[_0x1b82('0x3')][_0xb02ec3[_0x1b82('0x2d')]][_0x1b82('0x2')]||this[_0x1b82('0x3')][_0xb02ec3[_0x1b82('0x2d')]][_0x1b82('0x19')])){if(this[_0x1b82('0x4')][_0xb02ec3[_0x1b82('0x17')]]){this[_0x1b82('0x6')][_0xb02ec3[_0x1b82('0x2c')]]={'queue':_0xb02ec3[_0x1b82('0x2d')],'interface':_0xb02ec3['interface']};}}}catch(_0x59afed){logger[_0x1b82('0x31')]('[ACW][syncAgentConnectPreview]\x20%s',_0x59afed[_0x1b82('0x38')]);}};Acw[_0x1b82('0x34')][_0x1b82('0xb')]=function(_0x5710f4){try{if(this[_0x1b82('0x6')][_0x5710f4['uniqueid']]&&_['isUndefined'](this[_0x1b82('0x6')][_0x5710f4[_0x1b82('0x2c')]][_0x1b82('0x22')])){logger['info'](_0x1b82('0x3a'),_0x5710f4[_0x1b82('0x2c')]);this['startAcw'](_0x5710f4['uniqueid']);}else if(this[_0x1b82('0x6')][_0x5710f4[_0x1b82('0x3b')]]&&_[_0x1b82('0x3c')](this['channels'][_0x5710f4[_0x1b82('0x3b')]][_0x1b82('0x22')])){logger[_0x1b82('0x24')](_0x1b82('0x3d'),_0x5710f4[_0x1b82('0x3b')]);this[_0x1b82('0x16')](_0x5710f4['linkedid']);}}catch(_0x3914aa){logger['error'](_0x1b82('0x3e'),_0x3914aa[_0x1b82('0x38')]);}};Acw['prototype'][_0x1b82('0xc')]=function(_0x5de11b){try{if(this[_0x1b82('0x6')][_0x5de11b[_0x1b82('0x2c')]]&&this[_0x1b82('0x6')][_0x5de11b[_0x1b82('0x2c')]][_0x1b82('0x22')]){logger[_0x1b82('0x24')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x5de11b['uniqueid']);this[_0x1b82('0x16')](_0x5de11b[_0x1b82('0x2c')]);}else if(this[_0x1b82('0x6')][_0x5de11b[_0x1b82('0x3b')]]&&this[_0x1b82('0x6')][_0x5de11b[_0x1b82('0x3b')]][_0x1b82('0x22')]){logger[_0x1b82('0x24')]('[%s][HANGUPATTENDEDTRANSFER:LINKEDID]',_0x5de11b['linkedid']);this['startAcw'](_0x5de11b[_0x1b82('0x3b')]);}}catch(_0x2a95d2){logger[_0x1b82('0x31')](_0x1b82('0x3f'),_0x2a95d2[_0x1b82('0x38')]);}};Acw[_0x1b82('0x34')][_0x1b82('0x10')]=function(_0x53f7a4){try{if(!_[_0x1b82('0x40')](this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x41')]])){this[_0x1b82('0x16')](_0x53f7a4[_0x1b82('0x41')]);if(this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x42')]]){this[_0x1b82('0x6')][_0x53f7a4['secondtransfereruniqueid']][_0x1b82('0x22')]=!![];this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x43')]]=this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x42')]];delete this['channels'][_0x53f7a4['secondtransfereruniqueid']];}}else if(!_[_0x1b82('0x40')](this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x43')]])){this[_0x1b82('0x16')](_0x53f7a4['transfertargetuniqueid']);if(this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x44')]]){this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x44')]][_0x1b82('0x22')]=!![];this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x41')]]=this[_0x1b82('0x6')][_0x53f7a4[_0x1b82('0x44')]];delete this[_0x1b82('0x6')][_0x53f7a4['origtransfereruniqueid']];}}}catch(_0xde1d73){logger[_0x1b82('0x31')]('[ACW][syncAttendedTransfer]\x20%s',_0xde1d73[_0x1b82('0x38')]);}};Acw[_0x1b82('0x34')][_0x1b82('0x11')]=function(_0x2a5435){try{if(this['channels'][_0x2a5435[_0x1b82('0x45')]]){logger[_0x1b82('0x24')](_0x1b82('0x46'),JSON[_0x1b82('0x47')](_0x2a5435[_0x1b82('0x45')]));this[_0x1b82('0x16')](_0x2a5435['transfereruniqueid']);}else if(this[_0x1b82('0x6')][_0x2a5435['transfererlinkedid']]){logger[_0x1b82('0x24')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0x1b82('0x47')](_0x2a5435[_0x1b82('0x48')]));this[_0x1b82('0x16')](_0x2a5435[_0x1b82('0x48')]);}}catch(_0x412073){logger[_0x1b82('0x31')](_0x1b82('0x49'),_0x412073['message']);}};Acw[_0x1b82('0x34')][_0x1b82('0xe')]=function(_0x1435a2){try{if(this[_0x1b82('0x3')][_0x1435a2[_0x1b82('0x2d')]]&&this[_0x1b82('0x3')][_0x1435a2[_0x1b82('0x2d')]][_0x1b82('0x4a')]===_0x1b82('0x4b')){if(this[_0x1b82('0x4')][_0x1435a2[_0x1b82('0x17')]]){logger[_0x1b82('0x24')](_0x1b82('0x4c'),_0x1435a2['uniqueid'],_0x1435a2[_0x1b82('0x17')],_0x1435a2[_0x1b82('0x2d')]);return RpcUser[_0x1b82('0x4d')](this['agents'][_0x1435a2[_0x1b82('0x17')]],_0x1b82('0x4e'),_0x1435a2['uniqueid']);}}}catch(_0x3bf106){logger[_0x1b82('0x31')](_0x1b82('0x4f'),_0x3bf106['message']);}};module['exports']=Acw; \ No newline at end of file +var _0x54ef=['isUndefined','attended','[%s][HANGUP:UNIQUEID]','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','stringify','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','util','lodash','moment','../../../config/logger','acw','../rpc/user','../rpc/voiceAgentReport','voiceQueues','timers','channels','syncAgentConnect','hanguprequest','syncHangupRequest','hangup','syncHangup','bind','agentringnoanswer','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','syncAgentConnectPreview','milliseconds','diff','seconds','startAcw','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','name','QueuePause','then','agents','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','updateAcw','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','prototype','stopAcw','[TIMER][STOP][AGENT:%s]','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','[ACW][STOP]\x20%s','message','[ACW][syncAgentConnectPreview]\x20%s'];(function(_0x12d0ec,_0x2eae56){var _0x3988a5=function(_0x11b648){while(--_0x11b648){_0x12d0ec['push'](_0x12d0ec['shift']());}};_0x3988a5(++_0x2eae56);}(_0x54ef,0x112));var _0xf54e=function(_0x30f369,_0x203ccb){_0x30f369=_0x30f369-0x0;var _0x11ae4c=_0x54ef[_0x30f369];return _0x11ae4c;};'use strict';var util=require(_0xf54e('0x0'));var _=require(_0xf54e('0x1'));var moment=require(_0xf54e('0x2'));var ami=require('../ami');var logger=require(_0xf54e('0x3'))(_0xf54e('0x4'));var RpcUser=require(_0xf54e('0x5'));var RpcVoiceAgentReport=require(_0xf54e('0x6'));function Acw(_0x8b6bb6){this[_0xf54e('0x7')]=_0x8b6bb6[_0xf54e('0x7')];this['agents']=_0x8b6bb6['agents'];this[_0xf54e('0x8')]=_0x8b6bb6[_0xf54e('0x8')];this[_0xf54e('0x9')]={};ami['on']('agentconnect',this[_0xf54e('0xa')]['bind'](this));ami['on'](_0xf54e('0xb'),this[_0xf54e('0xc')]['bind'](this));ami['on'](_0xf54e('0xd'),this[_0xf54e('0xe')][_0xf54e('0xf')](this));ami['on'](_0xf54e('0x10'),this['syncAgentRingNoAnswer'][_0xf54e('0xf')](this));ami['on'](_0xf54e('0x11'),this[_0xf54e('0x12')][_0xf54e('0xf')](this));ami['on']('blindtransfer',this[_0xf54e('0x13')]['bind'](this));ami['on']('custom:agentConnectPreview',this[_0xf54e('0x14')][_0xf54e('0xf')](this));}function getDiff(_0x28f776){var _0x380f26=moment()['milliseconds'](0x0);var _0x331732=moment(_0x28f776)[_0xf54e('0x15')](0x0);return _0x380f26[_0xf54e('0x16')](_0x331732,_0xf54e('0x17'));}Acw['prototype'][_0xf54e('0x18')]=function(_0x389abc){try{var _0x3eb415=this;var _0x5c5d00=this['channels'][_0x389abc][_0xf54e('0x19')];var _0x41fb35=this[_0xf54e('0x9')][_0x389abc][_0xf54e('0x1a')];var _0x15cc48=this[_0xf54e('0x7')][_0x41fb35];var _0x2e27b6=![];var _0x1ef06e=_0xf54e('0x1b');if(_0x15cc48[_0xf54e('0x1c')]){if(_0x15cc48[_0xf54e('0x1d')]['name']){_0x2e27b6=!![];_0x1ef06e=_0x15cc48['mandatoryDispositionPause'][_0xf54e('0x1e')];}}ami['Action']({'action':_0xf54e('0x1f'),'interface':_0x5c5d00,'paused':!![],'reason':_0x1ef06e})[_0xf54e('0x20')](function(_0x106362){if(_0x3eb415[_0xf54e('0x21')][_0x5c5d00]){return RpcUser[_0xf54e('0x22')](_0x3eb415[_0xf54e('0x21')][_0x5c5d00]['id'])[_0xf54e('0x20')](function(_0x11985e){if(_0x11985e&&!_0x11985e[_0xf54e('0x23')]){logger[_0xf54e('0x24')](_0xf54e('0x25'),_0x389abc,_0x5c5d00,_0x41fb35);var _0x5b83df=_0x3eb415[_0xf54e('0x9')][_0x389abc]['attended']&&_0x3eb415[_0xf54e('0x9')][_0x389abc][_0xf54e('0x26')]?_0x3eb415[_0xf54e('0x9')][_0x389abc][_0xf54e('0x26')]:_0x389abc;return RpcUser[_0xf54e('0x27')](_0x3eb415[_0xf54e('0x21')][_0x5c5d00],_0x1ef06e,_0x5b83df)[_0xf54e('0x20')](function(_0x43488d){if(!_0x2e27b6){_0x3eb415[_0xf54e('0x8')][_0x5c5d00]={};logger[_0xf54e('0x24')](_0xf54e('0x28'),_0x389abc,_0x3eb415[_0xf54e('0x7')][_0x41fb35][_0xf54e('0x29')],_0x5c5d00,_0x41fb35);_0x3eb415['timers'][_0x5c5d00][_0xf54e('0x2a')]=setTimeout(_0x3eb415['stopAcw'][_0xf54e('0xf')](_0x3eb415,_0x5c5d00),_0x3eb415['voiceQueues'][_0x41fb35][_0xf54e('0x29')]*0x3e8);_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2b')]=moment()[_0xf54e('0x2c')](_0xf54e('0x2d'));_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2e')]=_0x389abc;_0x3eb415['timers'][_0x5c5d00]['queue']=_0x41fb35;_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2f')]=function(){var _0x2ec92e=getDiff(_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2b')]);clearTimeout(_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2a')]);_0x3eb415[_0xf54e('0x8')][_0x5c5d00][_0xf54e('0x2a')]=![];RpcVoiceAgentReport[_0xf54e('0x30')]({'acwtime':_0x2ec92e},_0x3eb415['timers'][_0x5c5d00]['uniqueid'],_0x5c5d00)[_0xf54e('0x20')](function(_0x3169dd){logger['info'](_0xf54e('0x31'),_0x389abc,_0x2ec92e,_0x3169dd);})[_0xf54e('0x32')](function(_0x379110){logger[_0xf54e('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x389abc,_0x379110);});delete _0x3eb415['timers'][_0x5c5d00];};}});}else{logger['info'](_0xf54e('0x34'),_0x389abc,_0x5c5d00,_0x41fb35);}});}})[_0xf54e('0x32')](function(_0x210d6d){logger[_0xf54e('0x33')](_0xf54e('0x28'),_0x389abc,_0x3eb415[_0xf54e('0x7')][_0x41fb35]['acwTimeout'],_0x5c5d00,_0x41fb35);})['finally'](function(){delete _0x3eb415['channels'][_0x389abc];});}catch(_0xc04e04){logger[_0xf54e('0x33')]('[ACW][START]\x20%s',_0xc04e04['message']);}};Acw[_0xf54e('0x35')][_0xf54e('0x36')]=function(_0x173e6c){try{var _0x4a347a=this;if(_0x4a347a[_0xf54e('0x8')][_0x173e6c]){_0x4a347a[_0xf54e('0x8')][_0x173e6c]['timer']=![];var _0x38d7a0=_0x4a347a[_0xf54e('0x8')][_0x173e6c][_0xf54e('0x2e')];var _0x1eeeb4=_0x4a347a[_0xf54e('0x8')][_0x173e6c][_0xf54e('0x1a')];var _0x4e00b7=_0x4a347a['voiceQueues'][_0x1eeeb4][_0xf54e('0x29')];logger[_0xf54e('0x24')](_0xf54e('0x37'),_0x173e6c);RpcUser['saveUnpause'](this[_0xf54e('0x21')][_0x173e6c]);RpcVoiceAgentReport[_0xf54e('0x30')]({'acwtime':_0x4e00b7,'agentacw':!![]},_0x38d7a0,_0x173e6c)[_0xf54e('0x20')](function(_0x1ee884){logger[_0xf54e('0x24')](_0xf54e('0x31'),_0x38d7a0,_0x4e00b7,_0x1ee884);})[_0xf54e('0x32')](function(_0x1345b0){logger[_0xf54e('0x33')](_0xf54e('0x38'),_0x38d7a0,_0x1345b0);});}else{logger[_0xf54e('0x33')](_0xf54e('0x39'),_0x173e6c);if(_0x4a347a[_0xf54e('0x8')]){logger[_0xf54e('0x24')](_0xf54e('0x3a'),JSON['stringify'](_0x4a347a['timers']));}}}catch(_0x533423){logger[_0xf54e('0x33')](_0xf54e('0x3b'),_0x533423['message']);}};Acw[_0xf54e('0x35')][_0xf54e('0xa')]=function(_0x381c03){try{if(this['voiceQueues'][_0x381c03[_0xf54e('0x1a')]]&&(this[_0xf54e('0x7')][_0x381c03[_0xf54e('0x1a')]][_0xf54e('0x4')]||this[_0xf54e('0x7')][_0x381c03[_0xf54e('0x1a')]][_0xf54e('0x1c')])){if(this[_0xf54e('0x21')][_0x381c03[_0xf54e('0x19')]]){this['channels'][_0x381c03[_0xf54e('0x2e')]]={'queue':_0x381c03[_0xf54e('0x1a')],'interface':_0x381c03[_0xf54e('0x19')],'destlinkedid':_0x381c03[_0xf54e('0x26')]};}}}catch(_0x2aac11){logger[_0xf54e('0x33')]('[ACW][syncAgentConnect]\x20%s',_0x2aac11[_0xf54e('0x3c')]);}};Acw['prototype'][_0xf54e('0x14')]=function(_0x4a7e3b){try{if(this[_0xf54e('0x7')][_0x4a7e3b[_0xf54e('0x1a')]]&&(this[_0xf54e('0x7')][_0x4a7e3b['queue']][_0xf54e('0x4')]||this[_0xf54e('0x7')][_0x4a7e3b[_0xf54e('0x1a')]][_0xf54e('0x1c')])){if(this[_0xf54e('0x21')][_0x4a7e3b['interface']]){this[_0xf54e('0x9')][_0x4a7e3b[_0xf54e('0x2e')]]={'queue':_0x4a7e3b[_0xf54e('0x1a')],'interface':_0x4a7e3b[_0xf54e('0x19')]};}}}catch(_0x5f3438){logger[_0xf54e('0x33')](_0xf54e('0x3d'),_0x5f3438['message']);}};Acw[_0xf54e('0x35')][_0xf54e('0xc')]=function(_0x3d24c7){try{if(this[_0xf54e('0x9')][_0x3d24c7['uniqueid']]&&_[_0xf54e('0x3e')](this[_0xf54e('0x9')][_0x3d24c7[_0xf54e('0x2e')]][_0xf54e('0x3f')])){logger[_0xf54e('0x24')](_0xf54e('0x40'),_0x3d24c7[_0xf54e('0x2e')]);this[_0xf54e('0x18')](_0x3d24c7[_0xf54e('0x2e')]);}else if(this[_0xf54e('0x9')][_0x3d24c7[_0xf54e('0x41')]]&&_[_0xf54e('0x3e')](this[_0xf54e('0x9')][_0x3d24c7[_0xf54e('0x41')]][_0xf54e('0x3f')])){logger[_0xf54e('0x24')](_0xf54e('0x42'),_0x3d24c7[_0xf54e('0x41')]);this[_0xf54e('0x18')](_0x3d24c7[_0xf54e('0x41')]);}}catch(_0x4e25e4){logger['error'](_0xf54e('0x43'),_0x4e25e4[_0xf54e('0x3c')]);}};Acw[_0xf54e('0x35')][_0xf54e('0xe')]=function(_0xba297c){try{if(this[_0xf54e('0x9')][_0xba297c[_0xf54e('0x2e')]]&&this[_0xf54e('0x9')][_0xba297c[_0xf54e('0x2e')]][_0xf54e('0x3f')]){logger[_0xf54e('0x24')]('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0xba297c[_0xf54e('0x2e')]);this[_0xf54e('0x18')](_0xba297c[_0xf54e('0x2e')]);}else if(this[_0xf54e('0x9')][_0xba297c[_0xf54e('0x41')]]&&this[_0xf54e('0x9')][_0xba297c[_0xf54e('0x41')]]['attended']){logger[_0xf54e('0x24')](_0xf54e('0x44'),_0xba297c[_0xf54e('0x41')]);this['startAcw'](_0xba297c[_0xf54e('0x41')]);}}catch(_0x54ac1a){logger[_0xf54e('0x33')](_0xf54e('0x45'),_0x54ac1a[_0xf54e('0x3c')]);}};Acw['prototype'][_0xf54e('0x12')]=function(_0x30d10d){try{if(!_[_0xf54e('0x46')](this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x47')]])){this[_0xf54e('0x18')](_0x30d10d[_0xf54e('0x47')]);if(this['channels'][_0x30d10d['secondtransfereruniqueid']]){this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x48')]]['attended']=!![];this[_0xf54e('0x9')][_0x30d10d['transfertargetuniqueid']]=this[_0xf54e('0x9')][_0x30d10d['secondtransfereruniqueid']];delete this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x48')]];}}else if(!_[_0xf54e('0x46')](this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x49')]])){this[_0xf54e('0x18')](_0x30d10d['transfertargetuniqueid']);if(this['channels'][_0x30d10d[_0xf54e('0x4a')]]){this[_0xf54e('0x9')][_0x30d10d['origtransfereruniqueid']]['attended']=!![];this[_0xf54e('0x9')][_0x30d10d['transfereeuniqueid']]=this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x4a')]];delete this[_0xf54e('0x9')][_0x30d10d[_0xf54e('0x4a')]];}}}catch(_0x1d7c52){logger[_0xf54e('0x33')](_0xf54e('0x4b'),_0x1d7c52[_0xf54e('0x3c')]);}};Acw[_0xf54e('0x35')][_0xf54e('0x13')]=function(_0x1f9dad){try{if(this[_0xf54e('0x9')][_0x1f9dad[_0xf54e('0x4c')]]){logger[_0xf54e('0x24')]('[%s][BLINDTRANSFER:UNIQUEID]',JSON[_0xf54e('0x4d')](_0x1f9dad[_0xf54e('0x4c')]));this[_0xf54e('0x18')](_0x1f9dad[_0xf54e('0x4c')]);}else if(this[_0xf54e('0x9')][_0x1f9dad['transfererlinkedid']]){logger[_0xf54e('0x24')](_0xf54e('0x4e'),JSON['stringify'](_0x1f9dad['transfererlinkedid']));this[_0xf54e('0x18')](_0x1f9dad['transfererlinkedid']);}}catch(_0x26322a){logger[_0xf54e('0x33')](_0xf54e('0x4f'),_0x26322a[_0xf54e('0x3c')]);}};Acw['prototype'][_0xf54e('0x50')]=function(_0x5cdb8c){try{if(this[_0xf54e('0x7')][_0x5cdb8c[_0xf54e('0x1a')]]&&this[_0xf54e('0x7')][_0x5cdb8c['queue']][_0xf54e('0x51')]==='all'){if(this[_0xf54e('0x21')][_0x5cdb8c[_0xf54e('0x19')]]){logger['info'](_0xf54e('0x52'),_0x5cdb8c['uniqueid'],_0x5cdb8c[_0xf54e('0x19')],_0x5cdb8c[_0xf54e('0x1a')]);return RpcUser[_0xf54e('0x27')](this[_0xf54e('0x21')][_0x5cdb8c[_0xf54e('0x19')]],'Auto-Pause',_0x5cdb8c[_0xf54e('0x2e')]);}}}catch(_0x1d18d3){logger['error'](_0xf54e('0x53'),_0x1d18d3[_0xf54e('0x3c')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 530180e..9beea40 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 _0x8c12=['shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','then','actionCoreShowChannels','log','exports','bluebird','util','lodash','../../config/logger','ami','../../config/environment','asterisk','username','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','port','inspect','format','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','coreshowchannels','info','once','close','connect'];(function(_0x5f56ee,_0xba33c5){var _0x1ce9e2=function(_0x36f8c5){while(--_0x36f8c5){_0x5f56ee['push'](_0x5f56ee['shift']());}};_0x1ce9e2(++_0xba33c5);}(_0x8c12,0xe5));var _0x28c1=function(_0x45b06b,_0x2499af){_0x45b06b=_0x45b06b-0x0;var _0x3c7593=_0x8c12[_0x45b06b];return _0x3c7593;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x28c1('0x0'));var moment=require('moment');var util=require(_0x28c1('0x1'));var _=require(_0x28c1('0x2'));var logger=require(_0x28c1('0x3'))(_0x28c1('0x4'));var config=require(_0x28c1('0x5'));var ami=new Manager(config['asterisk']['port'],config[_0x28c1('0x6')]['ip'],config['asterisk'][_0x28c1('0x7')],config[_0x28c1('0x6')][_0x28c1('0x8')],!![]);ami[_0x28c1('0x9')]();ami[_0x28c1('0xa')]=BPromise[_0x28c1('0xb')](ami[_0x28c1('0xc')]);function error(_0x35e982){logger[_0x28c1('0xd')](util['format'](_0x28c1('0xe'),config[_0x28c1('0x6')][_0x28c1('0x7')],config[_0x28c1('0x6')]['ip'],config['asterisk'][_0x28c1('0xf')],util[_0x28c1('0x10')](_0x35e982,![],null)));}function close(){logger[_0x28c1('0xd')](util[_0x28c1('0x11')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x28c1('0x6')][_0x28c1('0x7')],config[_0x28c1('0x6')]['ip'],config[_0x28c1('0x6')][_0x28c1('0xf')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x28c1('0xa')]({'action':_0x28c1('0x12')});};};ami[_0x28c1('0x13')]=function(){return function(){return ami['Action']({'action':_0x28c1('0x14')});};};ami[_0x28c1('0x15')]=function(){return function(){return ami['Action']({'action':_0x28c1('0x16')});};};ami[_0x28c1('0x17')]=function(){return function(){return ami[_0x28c1('0xa')]({'action':_0x28c1('0x18')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x28c1('0x19')});};};function connect(_0x9b7195){logger[_0x28c1('0x1a')](util[_0x28c1('0x11')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config['asterisk']['username'],config[_0x28c1('0x6')]['ip'],config[_0x28c1('0x6')][_0x28c1('0xf')]));ami['once'](_0x28c1('0xd'),error);ami[_0x28c1('0x1b')](_0x28c1('0x1c'),close);}ami['on'](_0x28c1('0x1d'),connect);ami['on'](_0x28c1('0x1e'),function(_0x44682a){logger[_0x28c1('0x1a')](util[_0x28c1('0x11')](_0x28c1('0x1f'),config[_0x28c1('0x6')][_0x28c1('0x7')],config[_0x28c1('0x6')]['ip'],config[_0x28c1('0x6')]['port'],util['inspect'](_0x44682a,![],null)));});ami['on'](_0x28c1('0x20'),function(_0x3ebcf4){logger[_0x28c1('0x1a')](util[_0x28c1('0x11')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x28c1('0x6')][_0x28c1('0x7')],config[_0x28c1('0x6')]['ip'],config[_0x28c1('0x6')]['port']));return BPromise['resolve']()[_0x28c1('0x21')](ami['actionSipShowRegistry']())[_0x28c1('0x21')](ami[_0x28c1('0x13')]())[_0x28c1('0x21')](ami[_0x28c1('0x15')]())[_0x28c1('0x21')](ami[_0x28c1('0x17')]())['then'](ami[_0x28c1('0x22')]())['catch'](function(_0x534526){console[_0x28c1('0x23')](_0x534526);});});ami[_0x28c1('0x1b')](_0x28c1('0xd'),error);ami[_0x28c1('0x1b')]('close',close);module[_0x28c1('0x24')]=ami; \ No newline at end of file +var _0x9d84=['then','actionCoreShowChannels','catch','log','exports','asterisk-manager','moment','util','lodash','../../config/logger','ami','asterisk','username','keepConnected','Action','promisify','format','port','inspect','error','actionDeviceStateList','devicestatelist','actionSipPeerStatus','actionQueueSummary','queuesummary','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','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s'];(function(_0x33dcb9,_0x467f5c){var _0x173359=function(_0x2bf71e){while(--_0x2bf71e){_0x33dcb9['push'](_0x33dcb9['shift']());}};_0x173359(++_0x467f5c);}(_0x9d84,0x11d));var _0x49d8=function(_0x260703,_0x283a79){_0x260703=_0x260703-0x0;var _0x396429=_0x9d84[_0x260703];return _0x396429;};'use strict';var Manager=require(_0x49d8('0x0'));var BPromise=require('bluebird');var moment=require(_0x49d8('0x1'));var util=require(_0x49d8('0x2'));var _=require(_0x49d8('0x3'));var logger=require(_0x49d8('0x4'))(_0x49d8('0x5'));var config=require('../../config/environment');var ami=new Manager(config[_0x49d8('0x6')]['port'],config[_0x49d8('0x6')]['ip'],config[_0x49d8('0x6')][_0x49d8('0x7')],config[_0x49d8('0x6')]['password'],!![]);ami[_0x49d8('0x8')]();ami[_0x49d8('0x9')]=BPromise[_0x49d8('0xa')](ami['action']);function error(_0x1b39b5){logger['error'](util[_0x49d8('0xb')]('Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s',config[_0x49d8('0x6')][_0x49d8('0x7')],config[_0x49d8('0x6')]['ip'],config[_0x49d8('0x6')][_0x49d8('0xc')],util[_0x49d8('0xd')](_0x1b39b5,![],null)));}function close(){logger[_0x49d8('0xe')](util['format']('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x49d8('0x6')][_0x49d8('0x7')],config[_0x49d8('0x6')]['ip'],config[_0x49d8('0x6')]['port']));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x49d8('0x9')]({'action':'sipshowregistry'});};};ami[_0x49d8('0xf')]=function(){return function(){return ami[_0x49d8('0x9')]({'action':_0x49d8('0x10')});};};ami[_0x49d8('0x11')]=function(){return function(){return ami[_0x49d8('0x9')]({'action':'sippeerstatus'});};};ami[_0x49d8('0x12')]=function(){return function(){return ami[_0x49d8('0x9')]({'action':_0x49d8('0x13')});};};ami['actionCoreShowChannels']=function(){return function(){return ami['Action']({'action':_0x49d8('0x14')});};};function connect(_0x4c3072){logger[_0x49d8('0x15')](util[_0x49d8('0xb')](_0x49d8('0x16'),config[_0x49d8('0x6')][_0x49d8('0x7')],config[_0x49d8('0x6')]['ip'],config[_0x49d8('0x6')][_0x49d8('0xc')]));ami[_0x49d8('0x17')](_0x49d8('0xe'),error);ami[_0x49d8('0x17')](_0x49d8('0x18'),close);}ami['on'](_0x49d8('0x19'),connect);ami['on'](_0x49d8('0x1a'),function(_0x550291){logger[_0x49d8('0x15')](util[_0x49d8('0xb')](_0x49d8('0x1b'),config[_0x49d8('0x6')][_0x49d8('0x7')],config[_0x49d8('0x6')]['ip'],config[_0x49d8('0x6')]['port'],util[_0x49d8('0xd')](_0x550291,![],null)));});ami['on'](_0x49d8('0x1c'),function(_0x55ec91){logger[_0x49d8('0x15')](util[_0x49d8('0xb')](_0x49d8('0x1d'),config[_0x49d8('0x6')][_0x49d8('0x7')],config['asterisk']['ip'],config[_0x49d8('0x6')][_0x49d8('0xc')]));return BPromise['resolve']()['then'](ami['actionSipShowRegistry']())[_0x49d8('0x1e')](ami[_0x49d8('0xf')]())[_0x49d8('0x1e')](ami['actionSipPeerStatus']())[_0x49d8('0x1e')](ami[_0x49d8('0x12')]())[_0x49d8('0x1e')](ami[_0x49d8('0x1f')]())[_0x49d8('0x20')](function(_0x48d662){console[_0x49d8('0x21')](_0x48d662);});});ami[_0x49d8('0x17')](_0x49d8('0xe'),error);ami['once'](_0x49d8('0x18'),close);module[_0x49d8('0x22')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 5cd722a..f16359e 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 _0x3198=['memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','client','Request','then','debug','rpc'];(function(_0x4fa392,_0x47daad){var _0x20781a=function(_0x579ac0){while(--_0x579ac0){_0x4fa392['push'](_0x4fa392['shift']());}};_0x20781a(++_0x47daad);}(_0x3198,0x1b9));var _0x8319=function(_0x11fefd,_0x4adcf4){_0x11fefd=_0x11fefd-0x0;var _0x2c452d=_0x3198[_0x11fefd];return _0x2c452d;};'use strict';var jayson=require(_0x8319('0x0'));var BPromise=require(_0x8319('0x1'));var logger=require(_0x8319('0x2'))(_0x8319('0x3'));var client=jayson[_0x8319('0x4')]['http']({'port':0x2329});client[_0x8319('0x5')]=function(_0x5bd3b1,_0x252efb){return new BPromise(function(_0x598cbb,_0x4eb387){return client['request'](_0x5bd3b1,_0x252efb)[_0x8319('0x6')](function(_0x568488){logger[_0x8319('0x7')](_0x8319('0x8'),_0x8319('0x9'),_0x5bd3b1,_0x252efb,_0x568488);if(_0x568488[_0x8319('0xa')]){logger[_0x8319('0xa')](_0x8319('0x8'),_0x8319('0x9'),_0x5bd3b1,_0x568488[_0x8319('0xa')]['message'],_0x252efb);return _0x4eb387(_0x568488[_0x8319('0xa')][_0x8319('0xb')]);}else{return _0x598cbb(_0x568488[_0x8319('0xc')]);}})[_0x8319('0xd')](function(_0x2e1d77){logger[_0x8319('0xa')](_0x8319('0x8'),'memberReport',_0x5bd3b1,_0x2e1d77,_0x252efb);return _0x4eb387(_0x2e1d77);});});};module[_0x8319('0xe')]=client; \ No newline at end of file +var _0xf610=['request','debug','rpc','memberReport','error','message','result','catch','exports','jayson/promise','bluebird','../../config/logger','ami','client','http','Request'];(function(_0x2fdfd7,_0x877d){var _0x5d6b4b=function(_0x53d791){while(--_0x53d791){_0x2fdfd7['push'](_0x2fdfd7['shift']());}};_0x5d6b4b(++_0x877d);}(_0xf610,0x139));var _0x0f61=function(_0x18cf9a,_0x4190ac){_0x18cf9a=_0x18cf9a-0x0;var _0x5d50e7=_0xf610[_0x18cf9a];return _0x5d50e7;};'use strict';var jayson=require(_0x0f61('0x0'));var BPromise=require(_0x0f61('0x1'));var logger=require(_0x0f61('0x2'))(_0x0f61('0x3'));var client=jayson[_0x0f61('0x4')][_0x0f61('0x5')]({'port':0x2329});client[_0x0f61('0x6')]=function(_0x21953f,_0x2d28d0){return new BPromise(function(_0x28a2c8,_0x20f12d){return client[_0x0f61('0x7')](_0x21953f,_0x2d28d0)['then'](function(_0xe7f5f5){logger[_0x0f61('0x8')](_0x0f61('0x9'),_0x0f61('0xa'),_0x21953f,_0x2d28d0,_0xe7f5f5);if(_0xe7f5f5['error']){logger['error'](_0x0f61('0x9'),_0x0f61('0xa'),_0x21953f,_0xe7f5f5[_0x0f61('0xb')]['message'],_0x2d28d0);return _0x20f12d(_0xe7f5f5[_0x0f61('0xb')][_0x0f61('0xc')]);}else{return _0x28a2c8(_0xe7f5f5[_0x0f61('0xd')]);}})[_0x0f61('0xe')](function(_0x58b5a4){logger[_0x0f61('0xb')](_0x0f61('0x9'),_0x0f61('0xa'),_0x21953f,_0x58b5a4,_0x2d28d0);return _0x20f12d(_0x58b5a4);});});};module[_0x0f61('0xf')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index bf4a033..dfbede5 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 _0x7dee=['uniqueid','name','phone','Contact','firstName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','starttime','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','getQueue','exports','util','moment','isNil','voiceQueue'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0x7dee,0xb0));var _0xe7de=function(_0x573fad,_0x3f6a31){_0x573fad=_0x573fad-0x0;var _0x13711d=_0x7dee[_0x573fad];return _0x13711d;};'use strict';var util=require(_0xe7de('0x0'));var _=require('lodash');var moment=require(_0xe7de('0x1'));function checkNameSurname(_0x51419e,_0x3aade6,_0x1ab333){var _0x168f3b='';if(!_[_0xe7de('0x2')](_0x3aade6)&&'string'===typeof _0x3aade6){_0x168f3b+=_0x3aade6;}if(!_[_0xe7de('0x2')](_0x1ab333)&&'string'===typeof _0x1ab333){_0x168f3b+='\x20'+_0x1ab333;}if(_0x168f3b!==''){return _0x168f3b;}return _0x51419e;}function Action(_0x38d39e,_0x19f79d,_0x26a524){this[_0xe7de('0x3')]=_0x38d39e;this[_0xe7de('0x4')]=_0x26a524||undefined;this[_0xe7de('0x5')]=checkNameSurname(_0x19f79d['Contact'][_0xe7de('0x6')],_0x19f79d[_0xe7de('0x7')][_0xe7de('0x8')],_0x19f79d[_0xe7de('0x7')]['lastName']);this[_0xe7de('0x9')]=_0x19f79d[_0xe7de('0x7')][_0xe7de('0x6')];this[_0xe7de('0xa')]=_0x38d39e[_0xe7de('0x5')];this[_0xe7de('0xb')]=_0x19f79d[_0xe7de('0xb')]||![];this['type']=_0x38d39e[_0xe7de('0xc')];this[_0xe7de('0xd')]=_0x38d39e[_0xe7de('0xd')]||0x3;this[_0xe7de('0xe')]=_0x19f79d[_0xe7de('0xe')];this['countbusyretry']=_0x19f79d[_0xe7de('0xf')];this[_0xe7de('0x10')]=_0x19f79d[_0xe7de('0x10')];this[_0xe7de('0x11')]=_0x19f79d[_0xe7de('0x11')];this[_0xe7de('0x12')]=_0x19f79d['ContactId'];this['ListId']=_0x19f79d[_0xe7de('0x13')];this[_0xe7de('0x14')]=_0x19f79d[_0xe7de('0x14')];this[_0xe7de('0x15')]=_0x19f79d[_0xe7de('0x15')];this['CampaignId']=_0x19f79d[_0xe7de('0x16')];this['idHopper']=_0x19f79d['id'];this['ContactFirstName']=_0x19f79d['Contact'][_0xe7de('0x8')]||'';this[_0xe7de('0x17')]=moment()['format'](_0xe7de('0x18'));this[_0xe7de('0x19')]=_0x19f79d[_0xe7de('0x19')];this[_0xe7de('0x1a')]=_0x19f79d[_0xe7de('0x1a')];this[_0xe7de('0x1b')]=_0x19f79d[_0xe7de('0x1b')];this[_0xe7de('0x1c')]=_0x19f79d[_0xe7de('0x1c')];this['originatecalleridnum']='';this[_0xe7de('0x1d')]='';}Action[_0xe7de('0x1e')][_0xe7de('0x1f')]=function(){return util['format'](_0xe7de('0x20'),this['name'],this[_0xe7de('0x3')][_0xe7de('0x21')]>0x0?this[_0xe7de('0x9')]['substring'](this[_0xe7de('0x3')][_0xe7de('0x21')]):this[_0xe7de('0x9')]);};Action[_0xe7de('0x1e')][_0xe7de('0x22')]=function(){return this[_0xe7de('0xa')];};module[_0xe7de('0x23')]=Action; \ No newline at end of file +var _0x5342=['callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','getQueue','util','lodash','moment','isNil','string','voiceQueue','uniqueid','Contact','firstName','lastName','phone','queue','name','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','YYYY-MM-DD\x20HH:mm:ss','callback','callbackuniqueid'];(function(_0x303ba0,_0x5137ca){var _0x41a38d=function(_0x43aadf){while(--_0x43aadf){_0x303ba0['push'](_0x303ba0['shift']());}};_0x41a38d(++_0x5137ca);}(_0x5342,0xb2));var _0x2534=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x5342[_0x376b45];return _0x2341b3;};'use strict';var util=require(_0x2534('0x0'));var _=require(_0x2534('0x1'));var moment=require(_0x2534('0x2'));function checkNameSurname(_0x4b5c7b,_0x24dae8,_0x254452){var _0x21b42f='';if(!_[_0x2534('0x3')](_0x24dae8)&&_0x2534('0x4')===typeof _0x24dae8){_0x21b42f+=_0x24dae8;}if(!_[_0x2534('0x3')](_0x254452)&&_0x2534('0x4')===typeof _0x254452){_0x21b42f+='\x20'+_0x254452;}if(_0x21b42f!==''){return _0x21b42f;}return _0x4b5c7b;}function Action(_0xb46334,_0x5a424f,_0x4c875d){this[_0x2534('0x5')]=_0xb46334;this[_0x2534('0x6')]=_0x4c875d||undefined;this['name']=checkNameSurname(_0x5a424f[_0x2534('0x7')]['phone'],_0x5a424f['Contact'][_0x2534('0x8')],_0x5a424f['Contact'][_0x2534('0x9')]);this['number']=_0x5a424f[_0x2534('0x7')][_0x2534('0xa')];this[_0x2534('0xb')]=_0xb46334[_0x2534('0xc')];this[_0x2534('0xd')]=_0x5a424f[_0x2534('0xd')]||![];this[_0x2534('0xe')]=_0xb46334[_0x2534('0xe')];this[_0x2534('0xf')]=_0xb46334['dialQueueTimeout']||0x3;this[_0x2534('0x10')]=_0x5a424f[_0x2534('0x10')];this[_0x2534('0x11')]=_0x5a424f[_0x2534('0x11')];this[_0x2534('0x12')]=_0x5a424f[_0x2534('0x12')];this[_0x2534('0x13')]=_0x5a424f[_0x2534('0x13')];this[_0x2534('0x14')]=_0x5a424f[_0x2534('0x14')];this[_0x2534('0x15')]=_0x5a424f[_0x2534('0x15')];this[_0x2534('0x16')]=_0x5a424f[_0x2534('0x16')];this[_0x2534('0x17')]=_0x5a424f[_0x2534('0x17')];this[_0x2534('0x18')]=_0x5a424f[_0x2534('0x18')];this[_0x2534('0x19')]=_0x5a424f['id'];this[_0x2534('0x1a')]=_0x5a424f[_0x2534('0x7')][_0x2534('0x8')]||'';this[_0x2534('0x1b')]=moment()[_0x2534('0x1c')](_0x2534('0x1d'));this['callback']=_0x5a424f[_0x2534('0x1e')];this[_0x2534('0x1f')]=_0x5a424f[_0x2534('0x1f')];this[_0x2534('0x20')]=_0x5a424f['callbackat'];this[_0x2534('0x21')]=_0x5a424f[_0x2534('0x21')];this[_0x2534('0x22')]='';this[_0x2534('0x23')]='';}Action[_0x2534('0x24')][_0x2534('0x25')]=function(){return util[_0x2534('0x1c')](_0x2534('0x26'),this['name'],this[_0x2534('0x5')][_0x2534('0x27')]>0x0?this[_0x2534('0x28')]['substring'](this['voiceQueue']['dialCutDigit']):this[_0x2534('0x28')]);};Action['prototype'][_0x2534('0x29')]=function(){return this[_0x2534('0xb')];};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index f99d45c..8210b74 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 _0x10af=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','exports','util','lodash','moment','milliseconds','diff','state','statedesc','Answer','scheduledat','type','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','number','starttime','responsetime','answertime','format','holdtime','talktime','endtime','queue','membername','reason'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x10af,0x123));var _0xf10a=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x10af[_0x13b8f3];return _0x1a6d06;};'use strict';var util=require(_0xf10a('0x0'));var _=require(_0xf10a('0x1'));var moment=require(_0xf10a('0x2'));function getSeconds(_0x4a95b2,_0x574276){var _0x5df1e4=moment(_0x4a95b2)[_0xf10a('0x3')](0x0);var _0x229767=moment(_0x574276)['milliseconds'](0x0);return _0x5df1e4[_0xf10a('0x4')](_0x229767,'seconds');}function AgentComplete(_0x20f74e,_0x2f4202){this[_0xf10a('0x5')]=0x4;this[_0xf10a('0x6')]=_0xf10a('0x7');this['scheduledat']=_0x20f74e[_0xf10a('0x8')];this[_0xf10a('0x9')]=_0x20f74e[_0xf10a('0x9')];this['campaigntype']=_0x20f74e['type']===_0xf10a('0xa')?'queue':_0x20f74e[_0xf10a('0x9')];this[_0xf10a('0xb')]=_0x20f74e[_0xf10a('0xb')];this[_0xf10a('0xc')]=_0x20f74e[_0xf10a('0xc')];this[_0xf10a('0xd')]=_0x20f74e[_0xf10a('0xd')];this[_0xf10a('0xe')]=_0x20f74e[_0xf10a('0xb')]+_0x20f74e[_0xf10a('0xc')]+_0x20f74e[_0xf10a('0xd')];this[_0xf10a('0xf')]=_0x2f4202['uniqueid'];this[_0xf10a('0x10')]=_0x20f74e[_0xf10a('0x11')];this['calleridnum']=_0x20f74e[_0xf10a('0x12')];this[_0xf10a('0x13')]=_0x20f74e[_0xf10a('0x13')];this[_0xf10a('0x14')]=_0x20f74e[_0xf10a('0x14')];this[_0xf10a('0x15')]=_0x20f74e[_0xf10a('0x15')];this['endtime']=moment()[_0xf10a('0x16')]('YYYY-MM-DD\x20HH:mm:ss');this['ringtime']=getSeconds(_0x20f74e[_0xf10a('0x14')],_0x20f74e['starttime']);this[_0xf10a('0x17')]=getSeconds(_0x20f74e[_0xf10a('0x15')],_0x20f74e[_0xf10a('0x14')]);this[_0xf10a('0x18')]=getSeconds(this[_0xf10a('0x19')],_0x20f74e[_0xf10a('0x15')]);this[_0xf10a('0x1a')]=_0x2f4202[_0xf10a('0x1a')];this['membername']=_0x2f4202[_0xf10a('0x1b')];this[_0xf10a('0x1c')]=_0x2f4202[_0xf10a('0x1c')];this['callback']=_0x20f74e[_0xf10a('0x1d')];this['callbackuniqueid']=_0x20f74e[_0xf10a('0x1e')];this[_0xf10a('0x1f')]=_0x20f74e['callbackat'];this[_0xf10a('0x20')]=_0x20f74e[_0xf10a('0x20')];this[_0xf10a('0x21')]=_0x20f74e['ContactId'];this[_0xf10a('0x22')]=_0x20f74e['ListId'];this[_0xf10a('0x23')]=_0x20f74e[_0xf10a('0x23')];this['VoiceQueueId']=_0x20f74e[_0xf10a('0x24')];this['CampaignId']=_0x20f74e[_0xf10a('0x25')];this[_0xf10a('0x26')]=_0x20f74e[_0xf10a('0x26')]||'';this['originatecalleridname']=_0x20f74e['originatecalleridname']||'';}module[_0xf10a('0x27')]=AgentComplete; \ No newline at end of file +var _0x8027=['countbusyretry','countnoanswerretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','statedesc','Answer','scheduledat','type','queue','countcongestionretry','countglobal'];(function(_0x58d6f1,_0x1c3944){var _0x269bbe=function(_0x39a423){while(--_0x39a423){_0x58d6f1['push'](_0x58d6f1['shift']());}};_0x269bbe(++_0x1c3944);}(_0x8027,0x67));var _0x7802=function(_0x48271f,_0xc4f6d3){_0x48271f=_0x48271f-0x0;var _0x13eb5c=_0x8027[_0x48271f];return _0x13eb5c;};'use strict';var util=require(_0x7802('0x0'));var _=require(_0x7802('0x1'));var moment=require('moment');function getSeconds(_0x58bcf9,_0x46eeb6){var _0xb8cf84=moment(_0x58bcf9)[_0x7802('0x2')](0x0);var _0x2cebc9=moment(_0x46eeb6)['milliseconds'](0x0);return _0xb8cf84[_0x7802('0x3')](_0x2cebc9,'seconds');}function AgentComplete(_0x53558f,_0x3afff5){this['state']=0x4;this[_0x7802('0x4')]=_0x7802('0x5');this[_0x7802('0x6')]=_0x53558f['scheduledat'];this[_0x7802('0x7')]=_0x53558f[_0x7802('0x7')];this['campaigntype']=_0x53558f[_0x7802('0x7')]==='outbound'?_0x7802('0x8'):_0x53558f[_0x7802('0x7')];this['countbusyretry']=_0x53558f['countbusyretry'];this[_0x7802('0x9')]=_0x53558f[_0x7802('0x9')];this['countnoanswerretry']=_0x53558f['countnoanswerretry'];this[_0x7802('0xa')]=_0x53558f[_0x7802('0xb')]+_0x53558f[_0x7802('0x9')]+_0x53558f[_0x7802('0xc')];this['uniqueid']=_0x3afff5[_0x7802('0xd')];this[_0x7802('0xe')]=_0x53558f[_0x7802('0xf')];this[_0x7802('0x10')]=_0x53558f['number'];this[_0x7802('0x11')]=_0x53558f[_0x7802('0x11')];this[_0x7802('0x12')]=_0x53558f[_0x7802('0x12')];this[_0x7802('0x13')]=_0x53558f[_0x7802('0x13')];this[_0x7802('0x14')]=moment()[_0x7802('0x15')](_0x7802('0x16'));this['ringtime']=getSeconds(_0x53558f[_0x7802('0x12')],_0x53558f[_0x7802('0x11')]);this['holdtime']=getSeconds(_0x53558f[_0x7802('0x13')],_0x53558f[_0x7802('0x12')]);this[_0x7802('0x17')]=getSeconds(this[_0x7802('0x14')],_0x53558f[_0x7802('0x13')]);this[_0x7802('0x8')]=_0x3afff5[_0x7802('0x8')];this[_0x7802('0x18')]=_0x3afff5[_0x7802('0x18')];this[_0x7802('0x19')]=_0x3afff5[_0x7802('0x19')];this[_0x7802('0x1a')]=_0x53558f[_0x7802('0x1a')];this[_0x7802('0x1b')]=_0x53558f['callbackuniqueid'];this[_0x7802('0x1c')]=_0x53558f[_0x7802('0x1c')];this[_0x7802('0x1d')]=_0x53558f[_0x7802('0x1d')];this[_0x7802('0x1e')]=_0x53558f['ContactId'];this[_0x7802('0x1f')]=_0x53558f[_0x7802('0x1f')];this[_0x7802('0x20')]=_0x53558f[_0x7802('0x20')];this[_0x7802('0x21')]=_0x53558f[_0x7802('0x21')];this[_0x7802('0x22')]=_0x53558f[_0x7802('0x22')];this[_0x7802('0x23')]=_0x53558f[_0x7802('0x23')]||'';this['originatecalleridname']=_0x53558f[_0x7802('0x24')]||'';}module[_0x7802('0x25')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 61a0964..3569260 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 _0xcfcb=['countnoanswerretry','countglobal','countbusyretry','queue','calleridname','calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridname','exports','util','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','countcongestionretry'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0xcfcb,0x7a));var _0xbcfc=function(_0xe65ac8,_0x2691be){_0xe65ac8=_0xe65ac8-0x0;var _0x202ba1=_0xcfcb[_0xe65ac8];return _0x202ba1;};'use strict';var util=require(_0xbcfc('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x4e8cff,_0x4515b8){var _0x1c5821=moment(_0x4e8cff)[_0xbcfc('0x1')](0x0);var _0x16bde0=moment(_0x4515b8)[_0xbcfc('0x1')](0x0);return _0x1c5821[_0xbcfc('0x2')](_0x16bde0,_0xbcfc('0x3'));}function Final(_0x22b416){this[_0xbcfc('0x4')]=_0x22b416[_0xbcfc('0x4')];this[_0xbcfc('0x5')]=_0x22b416[_0xbcfc('0x5')];this[_0xbcfc('0x6')]=_0x22b416[_0xbcfc('0x6')];this[_0xbcfc('0x7')]=_0x22b416[_0xbcfc('0x6')]===_0xbcfc('0x8')?'queue':_0x22b416['type'];this['countbusyretry']=_0x22b416['countbusyretry'];this[_0xbcfc('0x9')]=_0x22b416[_0xbcfc('0x9')];this[_0xbcfc('0xa')]=_0x22b416[_0xbcfc('0xa')];this[_0xbcfc('0xb')]=_0x22b416[_0xbcfc('0xc')]+_0x22b416[_0xbcfc('0x9')]+_0x22b416['countnoanswerretry'];this['queue']=_0x22b416[_0xbcfc('0xd')];this[_0xbcfc('0xe')]=_0x22b416['calleridname'];this[_0xbcfc('0xf')]=_0x22b416['calleridnum'];this[_0xbcfc('0x10')]=_0x22b416[_0xbcfc('0x10')];this['responsetime']=_0x22b416[_0xbcfc('0x11')];this[_0xbcfc('0x12')]=_0x22b416[_0xbcfc('0x11')];this[_0xbcfc('0x13')]=_0x22b416[_0xbcfc('0x13')]||0x0;this[_0xbcfc('0x14')]=_0x22b416['holdtime']||0x0;this[_0xbcfc('0x15')]=_0x22b416[_0xbcfc('0x15')]||0x0;this['callback']=_0x22b416[_0xbcfc('0x16')];this[_0xbcfc('0x17')]=_0x22b416['callbackuniqueid'];this['callbackat']=_0x22b416[_0xbcfc('0x18')];this[_0xbcfc('0x19')]=_0x22b416[_0xbcfc('0x19')];this['ContactId']=_0x22b416[_0xbcfc('0x1a')];this[_0xbcfc('0x1b')]=_0x22b416[_0xbcfc('0x1b')];this[_0xbcfc('0x1c')]=_0x22b416[_0xbcfc('0x1c')];this['VoiceQueueId']=_0x22b416[_0xbcfc('0x1d')];this[_0xbcfc('0x1e')]=_0x22b416[_0xbcfc('0x1e')];this['originatecalleridnum']=_0x22b416['originatecalleridnum']||'';this[_0xbcfc('0x1f')]=_0x22b416[_0xbcfc('0x1f')]||'';}module[_0xbcfc('0x20')]=Final; \ No newline at end of file +var _0x9e69=['seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countnoanswerretry','countglobal','countcongestionretry','calleridname','calleridnum','starttime','responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff'];(function(_0x3c8d4a,_0x3be4e3){var _0x71ca9c=function(_0x52b345){while(--_0x52b345){_0x3c8d4a['push'](_0x3c8d4a['shift']());}};_0x71ca9c(++_0x3be4e3);}(_0x9e69,0x150));var _0x99e6=function(_0x4f5f9b,_0x519dc5){_0x4f5f9b=_0x4f5f9b-0x0;var _0x3cc753=_0x9e69[_0x4f5f9b];return _0x3cc753;};'use strict';var util=require('util');var _=require(_0x99e6('0x0'));var moment=require(_0x99e6('0x1'));function getSeconds(_0x10387b,_0x56fa){var _0x560e06=moment(_0x10387b)[_0x99e6('0x2')](0x0);var _0x3b02ff=moment(_0x56fa)['milliseconds'](0x0);return _0x560e06[_0x99e6('0x3')](_0x3b02ff,_0x99e6('0x4'));}function Final(_0x75a74f){this['uniqueid']=_0x75a74f[_0x99e6('0x5')];this[_0x99e6('0x6')]=_0x75a74f[_0x99e6('0x6')];this['type']=_0x75a74f[_0x99e6('0x7')];this[_0x99e6('0x8')]=_0x75a74f['type']===_0x99e6('0x9')?_0x99e6('0xa'):_0x75a74f['type'];this[_0x99e6('0xb')]=_0x75a74f[_0x99e6('0xb')];this['countcongestionretry']=_0x75a74f['countcongestionretry'];this[_0x99e6('0xc')]=_0x75a74f[_0x99e6('0xc')];this[_0x99e6('0xd')]=_0x75a74f[_0x99e6('0xb')]+_0x75a74f[_0x99e6('0xe')]+_0x75a74f[_0x99e6('0xc')];this['queue']=_0x75a74f[_0x99e6('0xa')];this[_0x99e6('0xf')]=_0x75a74f[_0x99e6('0xf')];this['calleridnum']=_0x75a74f[_0x99e6('0x10')];this[_0x99e6('0x11')]=_0x75a74f[_0x99e6('0x11')];this['responsetime']=_0x75a74f['responsetime'];this['endtime']=_0x75a74f[_0x99e6('0x12')];this[_0x99e6('0x13')]=_0x75a74f[_0x99e6('0x13')]||0x0;this['holdtime']=_0x75a74f[_0x99e6('0x14')]||0x0;this[_0x99e6('0x15')]=_0x75a74f[_0x99e6('0x15')]||0x0;this[_0x99e6('0x16')]=_0x75a74f[_0x99e6('0x16')];this['callbackuniqueid']=_0x75a74f[_0x99e6('0x17')];this['callbackat']=_0x75a74f[_0x99e6('0x18')];this[_0x99e6('0x19')]=_0x75a74f['recallme'];this[_0x99e6('0x1a')]=_0x75a74f[_0x99e6('0x1a')];this[_0x99e6('0x1b')]=_0x75a74f[_0x99e6('0x1b')];this[_0x99e6('0x1c')]=_0x75a74f[_0x99e6('0x1c')];this[_0x99e6('0x1d')]=_0x75a74f[_0x99e6('0x1d')];this[_0x99e6('0x1e')]=_0x75a74f[_0x99e6('0x1e')];this['originatecalleridnum']=_0x75a74f[_0x99e6('0x1f')]||'';this[_0x99e6('0x20')]=_0x75a74f[_0x99e6('0x20')]||'';}module[_0x99e6('0x21')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 187ab6d..e6889ec 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(_0x5c2590,_0x3227ba){var _0x4f3d2a=function(_0x2bdf5c){while(--_0x2bdf5c){_0x5c2590['push'](_0x5c2590['shift']());}};_0x4f3d2a(++_0x3227ba);}(_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(_0x2918d8,_0x2fb4ec){var _0x5eed13=function(_0x126663){while(--_0x126663){_0x2918d8['push'](_0x2918d8['shift']());}};_0x5eed13(++_0x2fb4ec);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'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 781ea8f..1d1f7d1 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 _0x2c3e=['queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','name','number','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound'];(function(_0x46c2a8,_0x4058f9){var _0x46026a=function(_0x52c6f0){while(--_0x52c6f0){_0x46c2a8['push'](_0x46c2a8['shift']());}};_0x46026a(++_0x4058f9);}(_0x2c3e,0x1ba));var _0xe2c3=function(_0x21d3d5,_0x38163c){_0x21d3d5=_0x21d3d5-0x0;var _0xf0057b=_0x2c3e[_0x21d3d5];return _0xf0057b;};'use strict';var util=require('util');var _=require(_0xe2c3('0x0'));var moment=require('moment');function getSeconds(_0x1418a3,_0x433bda){var _0x4c3301=moment(_0x1418a3)[_0xe2c3('0x1')](0x0);var _0x595d9c=moment(_0x433bda)[_0xe2c3('0x1')](0x0);return _0x4c3301['diff'](_0x595d9c,_0xe2c3('0x2'));}function History(_0x4cb6f7){this[_0xe2c3('0x3')]=_0x4cb6f7['uniqueid'];this[_0xe2c3('0x4')]=_0x4cb6f7[_0xe2c3('0x4')]||undefined;this[_0xe2c3('0x5')]=_0x4cb6f7[_0xe2c3('0x5')];this[_0xe2c3('0x6')]=_0x4cb6f7[_0xe2c3('0x5')]===_0xe2c3('0x7')?_0xe2c3('0x8'):_0x4cb6f7[_0xe2c3('0x5')];this[_0xe2c3('0x9')]=_0x4cb6f7[_0xe2c3('0x9')];this[_0xe2c3('0xa')]=_0x4cb6f7[_0xe2c3('0xa')];this[_0xe2c3('0xb')]=_0x4cb6f7[_0xe2c3('0xb')];this[_0xe2c3('0xc')]=_0x4cb6f7[_0xe2c3('0x9')]+_0x4cb6f7[_0xe2c3('0xa')]+_0x4cb6f7['countnoanswerretry'];this[_0xe2c3('0x8')]=_0x4cb6f7[_0xe2c3('0x8')];this['calleridname']=_0x4cb6f7[_0xe2c3('0xd')];this['calleridnum']=_0x4cb6f7[_0xe2c3('0xe')];this['starttime']=_0x4cb6f7[_0xe2c3('0xf')];this[_0xe2c3('0x10')]=_0x4cb6f7['responsetime'];this['endtime']=_0x4cb6f7[_0xe2c3('0x10')];this[_0xe2c3('0x11')]=getSeconds(_0x4cb6f7['responsetime'],_0x4cb6f7[_0xe2c3('0xf')]);this[_0xe2c3('0x12')]=0x0;this['talktime']=0x0;this[_0xe2c3('0x13')]=_0x4cb6f7[_0xe2c3('0x13')];this[_0xe2c3('0x14')]=_0x4cb6f7['callbackuniqueid'];this[_0xe2c3('0x15')]=_0x4cb6f7['callbackat'];this[_0xe2c3('0x16')]=_0x4cb6f7['recallme'];this[_0xe2c3('0x17')]=_0x4cb6f7[_0xe2c3('0x17')];this[_0xe2c3('0x18')]=_0x4cb6f7[_0xe2c3('0x18')];this[_0xe2c3('0x19')]=_0x4cb6f7[_0xe2c3('0x19')];this['VoiceQueueId']=_0x4cb6f7[_0xe2c3('0x1a')];this['CampaignId']=_0x4cb6f7[_0xe2c3('0x1b')];this[_0xe2c3('0x1c')]=_0x4cb6f7[_0xe2c3('0x1c')]||'';this['originatecalleridname']=_0x4cb6f7[_0xe2c3('0x1d')]||'';}module['exports']=History; \ No newline at end of file +var _0x0339=['ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','seconds','uniqueid','scheduledat','type','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme'];(function(_0x5b561d,_0x422b7c){var _0x431060=function(_0x401409){while(--_0x401409){_0x5b561d['push'](_0x5b561d['shift']());}};_0x431060(++_0x422b7c);}(_0x0339,0x107));var _0x9033=function(_0x1487be,_0x58cab1){_0x1487be=_0x1487be-0x0;var _0x193dfa=_0x0339[_0x1487be];return _0x193dfa;};'use strict';var util=require(_0x9033('0x0'));var _=require('lodash');var moment=require(_0x9033('0x1'));function getSeconds(_0x5c1026,_0x5c507d){var _0x2257e2=moment(_0x5c1026)[_0x9033('0x2')](0x0);var _0x737ccc=moment(_0x5c507d)['milliseconds'](0x0);return _0x2257e2['diff'](_0x737ccc,_0x9033('0x3'));}function History(_0x39772c){this[_0x9033('0x4')]=_0x39772c['uniqueid'];this['scheduledat']=_0x39772c[_0x9033('0x5')]||undefined;this[_0x9033('0x6')]=_0x39772c[_0x9033('0x6')];this['campaigntype']=_0x39772c['type']==='outbound'?_0x9033('0x7'):_0x39772c[_0x9033('0x6')];this[_0x9033('0x8')]=_0x39772c['countbusyretry'];this[_0x9033('0x9')]=_0x39772c[_0x9033('0x9')];this[_0x9033('0xa')]=_0x39772c[_0x9033('0xa')];this[_0x9033('0xb')]=_0x39772c['countbusyretry']+_0x39772c[_0x9033('0x9')]+_0x39772c[_0x9033('0xa')];this['queue']=_0x39772c['queue'];this[_0x9033('0xc')]=_0x39772c['name'];this[_0x9033('0xd')]=_0x39772c[_0x9033('0xe')];this[_0x9033('0xf')]=_0x39772c[_0x9033('0xf')];this[_0x9033('0x10')]=_0x39772c[_0x9033('0x10')];this[_0x9033('0x11')]=_0x39772c[_0x9033('0x10')];this[_0x9033('0x12')]=getSeconds(_0x39772c[_0x9033('0x10')],_0x39772c['starttime']);this[_0x9033('0x13')]=0x0;this[_0x9033('0x14')]=0x0;this[_0x9033('0x15')]=_0x39772c[_0x9033('0x15')];this[_0x9033('0x16')]=_0x39772c[_0x9033('0x16')];this['callbackat']=_0x39772c[_0x9033('0x17')];this[_0x9033('0x18')]=_0x39772c[_0x9033('0x18')];this[_0x9033('0x19')]=_0x39772c['ContactId'];this[_0x9033('0x1a')]=_0x39772c[_0x9033('0x1a')];this[_0x9033('0x1b')]=_0x39772c['UserId'];this[_0x9033('0x1c')]=_0x39772c['VoiceQueueId'];this[_0x9033('0x1d')]=_0x39772c['CampaignId'];this['originatecalleridnum']=_0x39772c[_0x9033('0x1e')]||'';this[_0x9033('0x1f')]=_0x39772c[_0x9033('0x1f')]||'';}module['exports']=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 1c05f80..aa28666 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 _0x3b1c=['Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCallToSecond','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','merge','milliseconds','startProgressive','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','AVAILABLE_CONTACTS_FINISHED','sendMessageOneNotActive','NOT_ACTIVE','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','starttime','clearZombieChannels','[actions]','enqueue','Action','status','catch','No\x20such\x20channel','ivr','updateOriginated','queue','[Dialer][checkChannel]','then','countReScheduled','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','createHistory','loggerHandler','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','SIP/%s','unmonitored','uniqueid','isNil','variable','amdstatus','xcally-motion-dialer','dialAMDActive','HANGUP','HangupInAMD','[syncHangupInAMD][createHistory]','value','MACHINE','Machine','membername','AMD','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','dialQueueProject','AGI','[syncHangupIvr]','cause-txt','Unknow','syncAgentComplete','reason','agent','agiafterat','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','answertime','queueCallerAbandonCreateState','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','Abandoned','dropreason','CALLEREXIT','channel','strategy','actionid','stateinterface','locked','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','[booked][unlock]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','push','command','iftime\x20%s,%s','content','indexOf','timezones','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','Queue','method\x20not\x20recognized','dialTimezone','syncCampaigns','dialGlobalInterval','launchHandleIvr','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','NONE','\x22agi://%s/square,%s\x22','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','createdAt','updatedAt','%s%s','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','originatecalleridnum','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','from-sip','dialOriginateTimeout','[originateError]:\x20%s','OriginateError','endtime','[originate][error]','originate\x20action\x20Error','isSuccess','response','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','add','dialBusyRetryFrequency','minutes','countcongestionretry','dialCongestionMaxRetry','[callProgressDetecting]','evt\x20is\x20undefine','[syncAgentComplete][createHistory][0]','createStateFinal','NoAnswer','countglobal','reason\x203\x20ringing\x20no\x20answer','stateGlobal','Busy','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','Success','contact\x20not\x20moved','round','predictiveIntervalAvailable','predictiveIntervalMinThreshold','floor','predictiveIntervalMultiplicativeFactor','[startMethodPredictive][StartProgressive]','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','Dropped\x20calls\x20day','predictiveIntervalErlangCallsDroppedCalls','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','scheduledat','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','emptyContact','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','reachable','[countReScheduled]\x20','[handlePredictive][limitChannel]','tryOriginatePredictive','not_inuse','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','busyFactor','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','defaults','socket.io-emitter','redis','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','rrmemory','roundrobin','prototype','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','uniqueId','optionPredictive','startPredictive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','Intervals','[ifTime][Action]','Error','diff','seconds','emit','outbound','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalPauses','originated','erlangCalls','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','stringify','format','voice:queue:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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'];(function(_0x369534,_0x5557c4){var _0x524bf9=function(_0x24c6fb){while(--_0x24c6fb){_0x369534['push'](_0x369534['shift']());}};_0x524bf9(++_0x5557c4);}(_0x3b1c,0x165));var _0xc3b1=function(_0x2f0861,_0xd25d64){_0x2f0861=_0x2f0861-0x0;var _0x6b1c69=_0x3b1c[_0x2f0861];return _0x6b1c69;};'use strict';var util=require(_0xc3b1('0x0'));var _=require('lodash');var BPromise=require(_0xc3b1('0x1'));var uuid=require(_0xc3b1('0x2'));var moment=require(_0xc3b1('0x3'));var rr=require('rr');var md5=require(_0xc3b1('0x4'));var Redis=require(_0xc3b1('0x5'));var config=require(_0xc3b1('0x6'));var logger=require(_0xc3b1('0x7'))(_0xc3b1('0x8'));var loggerBooked=require(_0xc3b1('0x7'))(_0xc3b1('0x9'));var loggerPredictive=require(_0xc3b1('0x7'))(_0xc3b1('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0xc3b1('0xb'));var loggerSyncQueueSummary=require(_0xc3b1('0x7'))(_0xc3b1('0xc'));var ami=require(_0xc3b1('0xd'));config['redis']=_[_0xc3b1('0xe')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xc3b1('0xf'))(new Redis(config[_0xc3b1('0x10')]));var cmHopper=require(_0xc3b1('0x11'));var cmHopperFinal=require(_0xc3b1('0x12'));var cmHopperHistory=require(_0xc3b1('0x13'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0xc3b1('0x14'));var Action=require(_0xc3b1('0x15'));var History=require(_0xc3b1('0x16'));var Final=require(_0xc3b1('0x17'));var AgentComplete=require(_0xc3b1('0x18'));var QueueCallerAbandon=require(_0xc3b1('0x19'));var Hangup=require(_0xc3b1('0x1a'));var ipAgi=process[_0xc3b1('0x1b')]['XCALLY_IP_AGI']||'127.0.0.1';var strategy={'rrmemory':_0xc3b1('0x1c'),'roundrobin':_0xc3b1('0x1d')};var Sequence=function(){};Sequence[_0xc3b1('0x1e')]['enqueue']=function(_0xc6c8a2){this[_0xc3b1('0x1f')]=this[_0xc3b1('0x1f')]?this['tail'][_0xc3b1('0x20')](_0xc6c8a2):_0xc6c8a2();};function Dialer(_0x5a6a20,_0x162426){this[_0xc3b1('0x21')]=new Sequence();this[_0xc3b1('0x22')]=_0x162426;this[_0xc3b1('0x23')]=_0x5a6a20['voiceQueues'];this[_0xc3b1('0x24')]=_0x5a6a20[_0xc3b1('0x24')];this[_0xc3b1('0x25')]=_0x5a6a20[_0xc3b1('0x25')];this[_0xc3b1('0x26')]=_0x5a6a20[_0xc3b1('0x26')];this['maxNumberOriginate']=config[_0xc3b1('0x27')]||0x2;this[_0xc3b1('0x28')]={};this[_0xc3b1('0x29')]={};this['contactsId']={};this[_0xc3b1('0x2a')]={};this[_0xc3b1('0x2b')]={};this[_0xc3b1('0x2c')]={};this['startProgressive']={};this[_0xc3b1('0x2d')]={};this[_0xc3b1('0x2e')]={};this[_0xc3b1('0x2f')]={};ami['on'](_0xc3b1('0x30'),this[_0xc3b1('0x31')][_0xc3b1('0x32')](this));ami['on'](_0xc3b1('0x33'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xc3b1('0x34'),this[_0xc3b1('0x35')][_0xc3b1('0x32')](this));ami['on'](_0xc3b1('0x36'),this['syncAgentComplete'][_0xc3b1('0x32')](this));ami['on'](_0xc3b1('0x37'),this[_0xc3b1('0xc')][_0xc3b1('0x32')](this));ami['on'](_0xc3b1('0x38'),this[_0xc3b1('0x39')][_0xc3b1('0x32')](this));ami['on'](_0xc3b1('0x3a'),this[_0xc3b1('0x3b')][_0xc3b1('0x32')](this));ami['on'](_0xc3b1('0x3c'),this[_0xc3b1('0x3d')][_0xc3b1('0x32')](this));ami['on']('queuemember',this[_0xc3b1('0x3e')][_0xc3b1('0x32')](this));ami['on'](_0xc3b1('0x3f'),this[_0xc3b1('0x40')]['bind'](this));this[_0xc3b1('0x41')]();this[_0xc3b1('0x42')]();}function isNotNull(_0xfe7b42){return _0xfe7b42!==null&&!_[_0xc3b1('0x43')](_0xfe7b42);}function checkIsLoggedIn(_0x285e76,_0xdd3684){return function(){if(_0xdd3684<=0x0){_0x285e76[_0xc3b1('0x44')]=_0xc3b1('0x45');throw _0x285e76[_0xc3b1('0x46')]+_0xc3b1('0x47');}};}function isActive(_0xe8db89){return _0xe8db89;}function checkIsActive(_0x3833af,_0x3b81f3){return function(){if(!isActive(_0x3b81f3)){_0x3833af[_0xc3b1('0x44')]='NOT_ACTIVE';throw _0x3833af['name']+_0xc3b1('0x48');}};}function checkInterval(_0x206c97){return function(){if(!isNotNull(_0x206c97[_0xc3b1('0x49')])){_0x206c97[_0xc3b1('0x44')]=_0xc3b1('0x4a');throw _0x206c97[_0xc3b1('0x46')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x206c97[_0xc3b1('0x49')]['Intervals'])){_0x206c97[_0xc3b1('0x44')]='INTERVAL_IS_NULL';throw _0x206c97[_0xc3b1('0x46')]+_0xc3b1('0x4b');}if(!isNotNull(_[_0xc3b1('0x4c')](_0x206c97['Interval'][_0xc3b1('0x4d')]))){_0x206c97[_0xc3b1('0x44')]=_0xc3b1('0x4a');throw _0x206c97[_0xc3b1('0x46')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x10099e,_0x25ebcf,_0x450e6f){return{'action':_0x10099e,'response':_0x25ebcf,'message':_0x450e6f,'stack':_0x450e6f};}function myreject(_0x5aed36){return function(_0x5723a2){return _0x5aed36(msgResponse(_0xc3b1('0x4e'),_0xc3b1('0x4f'),JSON['stringify'](_0x5723a2)));};}function getSeconds(_0x5a9188,_0x2b0482){var _0x5c2f9b=moment(_0x5a9188)['milliseconds'](0x0);var _0x27d5e5=moment(_0x2b0482)['milliseconds'](0x0);return _0x5c2f9b[_0xc3b1('0x50')](_0x27d5e5,_0xc3b1('0x51'));}function emit(_0x2c4b90,_0x270c39,_0x3a2d90){io['to'](_0x2c4b90)[_0xc3b1('0x52')](_0x270c39,_0x3a2d90);}function emitVoiceQueueSummary(_0x12e733){if(_0x12e733['type']===_0xc3b1('0x53')){var _0x3ff342={'id':_0x12e733['id'],'name':_0x12e733['name'],'strategy':_0x12e733['strategy'],'answered':_0x12e733[_0xc3b1('0x54')],'available':_0x12e733[_0xc3b1('0x55')],'loggedIn':_0x12e733[_0xc3b1('0x56')],'pTalking':_0x12e733[_0xc3b1('0x57')],'sumBillable':_0x12e733['sumBillable'],'sumDuration':_0x12e733[_0xc3b1('0x58')],'sumHoldTime':_0x12e733[_0xc3b1('0x59')]||0x0,'talking':_0x12e733[_0xc3b1('0x5a')],'total':_0x12e733[_0xc3b1('0x5b')],'type':_0x12e733[_0xc3b1('0x5c')],'unmanaged':_0x12e733['unmanaged'],'abandoned':_0x12e733[_0xc3b1('0x5d')],'waiting':_0x12e733[_0xc3b1('0x5e')],'loggedInDb':_0x12e733[_0xc3b1('0x5f')],'dialActive':_0x12e733[_0xc3b1('0x60')],'dialMethod':_0x12e733[_0xc3b1('0x61')],'dialOriginateCallerIdName':_0x12e733[_0xc3b1('0x62')],'dialOriginateCallerIdNumber':_0x12e733['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x12e733['dialOriginateTimeout'],'dialPrefix':_0x12e733['dialPrefix'],'outboundAnswerAgiCallsDay':_0x12e733[_0xc3b1('0x63')],'outboundAnswerCallsDay':_0x12e733[_0xc3b1('0x64')],'outboundBlacklistCallsDay':_0x12e733['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x12e733[_0xc3b1('0x65')],'outboundCongestionCallsDay':_0x12e733['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x12e733[_0xc3b1('0x66')],'outboundDropCallsDayCallersExit':_0x12e733[_0xc3b1('0x67')],'outboundDropCallsDayTimeout':_0x12e733['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x12e733[_0xc3b1('0x68')],'outboundNoSuchCallsDay':_0x12e733[_0xc3b1('0x69')],'outboundOriginateFailureCallsDay':_0x12e733[_0xc3b1('0x6a')],'outboundReCallsDay':_0x12e733[_0xc3b1('0x6b')],'outboundRejectCallsDay':_0x12e733[_0xc3b1('0x6c')],'outboundUnknownCallsDay':_0x12e733[_0xc3b1('0x6d')],'predictiveIntervalAnsweredCalls':_0x12e733[_0xc3b1('0x6e')],'predictiveIntervalAvgHoldtime':_0x12e733[_0xc3b1('0x6f')],'predictiveIntervalAvgTalktime':_0x12e733[_0xc3b1('0x70')],'predictiveIntervalDroppedCallsCallersExit':_0x12e733['predictiveIntervalDroppedCallsCallersExit'],'predictiveIntervalDroppedCallsTimeout':_0x12e733[_0xc3b1('0x71')],'predictiveIntervalErlangCalls':_0x12e733[_0xc3b1('0x72')],'predictiveIntervalErlangCallsDroppedCalls':_0x12e733['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x12e733[_0xc3b1('0x73')],'predictiveIntervalMultiplicativeFactor':_0x12e733['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x12e733[_0xc3b1('0x74')],'predictiveIntervalAvailable':_0x12e733['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x12e733['predictiveIntervalTotalCalls'],'message':_0x12e733[_0xc3b1('0x44')],'originated':_0x12e733[_0xc3b1('0x75')],'erlangCalls':_0x12e733[_0xc3b1('0x76')],'erlangCallToSecond':_0x12e733['erlangCallToSecond'],'erlangAbandonmentRate':_0x12e733[_0xc3b1('0x77')],'erlangBusyFactor':_0x12e733[_0xc3b1('0x78')],'startPredictive':_0x12e733['startPredictive'],'startProgressive':_0x12e733['startProgressive']};if(_0x12e733[_0xc3b1('0x79')]){_0x3ff342[_0xc3b1('0x79')]={'id':_0x12e733['Trunk']['id'],'name':_0x12e733[_0xc3b1('0x79')][_0xc3b1('0x46')],'active':_0x12e733[_0xc3b1('0x79')][_0xc3b1('0x7a')],'callerid':_0x12e733[_0xc3b1('0x79')][_0xc3b1('0x7b')]};}if(_0x12e733[_0xc3b1('0x49')]){_0x3ff342[_0xc3b1('0x49')]={'id':_0x12e733[_0xc3b1('0x49')]['id'],'name':_0x12e733[_0xc3b1('0x49')][_0xc3b1('0x46')]};}var _0x6731ff=md5(JSON[_0xc3b1('0x7c')](_0x3ff342));if(_0x12e733[_0xc3b1('0x4')]!==_0x6731ff){_0x12e733[_0xc3b1('0x4')]=_0x6731ff;emit(util[_0xc3b1('0x7d')](_0xc3b1('0x7e'),_0x3ff342[_0xc3b1('0x46')]),'voice_queue:save',_0x3ff342);}}}function emitCampaignSummary(_0x118526){if(_0x118526[_0xc3b1('0x5c')]==='ivr'){emit(util[_0xc3b1('0x7d')]('campaign:ivr:%s',_0x118526[_0xc3b1('0x46')]),_0xc3b1('0x7f'),_0x118526);}}function checkGetDataPredictive(_0x321c61){if(isNotNull(_0x321c61)){if(!_[_0xc3b1('0x4c')](_0x321c61)){loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x81'));loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x82'),_0x321c61[_0xc3b1('0x83')]);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x84'),_0x321c61[_0xc3b1('0x6e')]);loggerPredictive[_0xc3b1('0x80')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x321c61[_0xc3b1('0x71')]);loggerPredictive['info']('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x321c61[_0xc3b1('0x85')]);loggerPredictive['info'](_0xc3b1('0x86'),_0x321c61['predictiveIntervalAvgHoldtime']);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x87'),_0x321c61[_0xc3b1('0x70')]);loggerPredictive[_0xc3b1('0x80')]('---------------------------');if(_0x321c61[_0xc3b1('0x83')]>0x0){if(!_[_0xc3b1('0x43')](_0x321c61[_0xc3b1('0x70')])&&_0x321c61[_0xc3b1('0x70')]>0x0){return!![];}else{loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x88'));}if(!_[_0xc3b1('0x43')](_0x321c61[_0xc3b1('0x6f')])&&_0x321c61[_0xc3b1('0x6f')]>0x0){return!![];}else{loggerPredictive['info'](_0xc3b1('0x89'));}}else{loggerPredictive['info'](_0xc3b1('0x8a'));}}else{loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x8b'));}}else{loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x8b'));}return![];}function mergeDataErlangB(_0x363b7c){return function(_0x4e88dc){loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x8c'));loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x8d'),_0x4e88dc[_0xc3b1('0x76')]);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x8e'),_0x4e88dc[_0xc3b1('0x8f')]);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x90'),_0x4e88dc['erlangAbandonmentRate']);loggerPredictive['info'](_0xc3b1('0x91'),_0x4e88dc[_0xc3b1('0x78')]);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x90'),_0x4e88dc['erlangAbandonmentRate']);loggerPredictive['info'](_0xc3b1('0x92'));_[_0xc3b1('0x93')](_0x363b7c,_0x4e88dc);};}function getDiff(_0x2e20d9){var _0x37068e=moment()['milliseconds'](0x0);var _0x1bb0f3=moment(_0x2e20d9)[_0xc3b1('0x94')](0x0);return _0x37068e[_0xc3b1('0x50')](_0x1bb0f3,_0xc3b1('0x51'));}function ifInterval(_0x14ab07,_0x4b43b1){if(_[_0xc3b1('0x43')](_0x4b43b1)){return![];}if(getDiff(_0x4b43b1)<_0x14ab07*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x1ecb59){if(isNotNull(_0x1ecb59)){if(!_[_0xc3b1('0x43')](_0x1ecb59[_0xc3b1('0x95')])){_0x1ecb59[_0xc3b1('0x95')]=undefined;loggerPredictive['info'](_0x1ecb59['name'],_0xc3b1('0x96'));}if(!_[_0xc3b1('0x43')](_0x1ecb59[_0xc3b1('0x2c')])){_0x1ecb59['startPredictive']=undefined;loggerPredictive[_0xc3b1('0x80')](_0x1ecb59[_0xc3b1('0x46')],_0xc3b1('0x97'));}if(!_[_0xc3b1('0x43')](_0x1ecb59[_0xc3b1('0x98')])){clearInterval(_0x1ecb59[_0xc3b1('0x98')]);_0x1ecb59[_0xc3b1('0x98')]=undefined;loggerPredictive[_0xc3b1('0x80')](_0x1ecb59['name'],_0xc3b1('0x99'));}}}function erlangb(_0x4201f7,_0x59fe5f){if(_0x59fe5f===0x0){return 0x0;}var _0x4a0fff=0x1;for(var _0x29716f=0x1;_0x29716f<=_0x59fe5f;_0x29716f+=0x1){_0x4a0fff=0x1+_0x4a0fff*_0x29716f/_0x4201f7;}return 0x1/_0x4a0fff;}function isVoiceQueueOutbound(_0x31ab37){return _0x31ab37===_0xc3b1('0x53');}function isNotPreview(_0x55e467){return _0x55e467!==_0xc3b1('0x22');}function isCampaignIvr(_0x4bc738){return _0x4bc738==='ivr';}function getCallerId(_0x4b5cfe,_0x233ed1,_0x345f54){if(!_['isUndefined'](_0x345f54)&&_0xc3b1('0x9a')===typeof _0x345f54&&!_[_0xc3b1('0x4c')](_0x345f54)){if(!_['isUndefined'](_0x233ed1)&&_0xc3b1('0x9a')===typeof _0x233ed1&&!_[_0xc3b1('0x4c')](_0x233ed1)){return util[_0xc3b1('0x7d')](_0xc3b1('0x9b'),_0x233ed1,_0x345f54);}return util[_0xc3b1('0x7d')]('\x22%s\x22\x20<%s>',_0x345f54,_0x345f54);}if(!_[_0xc3b1('0x43')](_0x4b5cfe)&&'string'===typeof _0x4b5cfe&&!_[_0xc3b1('0x4c')](_0x4b5cfe)){return _0x4b5cfe;}return _0xc3b1('0x9c');}function loggerCatchQueueSummary(_0x423e09,_0x3d5d80){return function(_0x4bcb69){freeVariablesPredictive(_0x3d5d80);emitVoiceQueueSummary(_0x3d5d80);emitCampaignSummary(_0x3d5d80);loggerSyncQueueSummary[_0xc3b1('0x9d')](_0x423e09,util[_0xc3b1('0x9e')](_0x4bcb69,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x493236,_0x980060){return function(_0x2eb0c5){loggerPredictive[_0xc3b1('0x9d')](_0x980060['name'],_0x493236);loggerPredictive[_0xc3b1('0x9d')](_0x2eb0c5[_0xc3b1('0x9f')]);freeVariablesPredictive(_0x980060);};}function loggerCatch(_0x33424b){return function(_0x561f5f){logger[_0xc3b1('0x9d')](_0x33424b,util[_0xc3b1('0x9e')](_0x561f5f,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0xbd83a2){return _0xbd83a2&&!_[_0xc3b1('0x43')](_0xbd83a2)&&_0xbd83a2[_0xc3b1('0xa0')]>0x0;}function decremetOriginate(_0x153b5b){if(!_[_0xc3b1('0x43')](_0x153b5b)&&_0x153b5b!==null){if(_0x153b5b[_0xc3b1('0xa1')](_0xc3b1('0x75'))){if(_0x153b5b[_0xc3b1('0x75')]>0x0){_0x153b5b[_0xc3b1('0x75')]-=0x1;}else{logger[_0xc3b1('0x9d')](_0xc3b1('0xa2'));}}}else{logger[_0xc3b1('0x9d')](_0xc3b1('0xa3'));}}function checkContactLowerLimitOriginate(_0x2b888c,_0x2df02b,_0x22e714){if(_0x2df02b>_0x22e714){for(var _0x5ca5a2=0x0;_0x5ca5a2<_0x2df02b-_0x22e714;_0x5ca5a2+=0x1){decremetOriginate(_0x2b888c);}}}function loggerGetContactDialer(_0x37a70a,_0x5b4567,_0x4baa58){return function(_0x14e3a9){checkContactLowerLimitOriginate(_0x5b4567,_0x4baa58,0x0);logger[_0xc3b1('0x9d')](_0x37a70a,util['inspect'](_0x14e3a9,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x558977){return function(_0x566d34){if(isNotNull(_0x566d34)&&isNotNull(_0x566d34[0x0])){if(_0x566d34[0x0][_0xc3b1('0xa4')]>0x0){_0x558977[_0xc3b1('0x44')]=_0xc3b1('0xa5');logger[_0xc3b1('0x80')](_0xc3b1('0xa6')+_0x558977['name'],_0x566d34[0x0][_0xc3b1('0xa4')],_0xc3b1('0xa7'));}else{_0x558977['message']=_0xc3b1('0xa8');logger['info']('[getContactDialer2][Empty]'+_0x558977[_0xc3b1('0x46')]);}}};}function notSendMessagesQueue(_0x23d4dd){if(_0x23d4dd[_0xc3b1('0xa9')]){freeVariablesPredictive(_0x23d4dd);if(_0x23d4dd['originated']===0x0&&_0x23d4dd[_0xc3b1('0x5a')]===0x0&&_0x23d4dd[_0xc3b1('0x5e')]===0x0&&(_0x23d4dd[_0xc3b1('0x57')]||0x0)===0x0){_0x23d4dd[_0xc3b1('0xa9')]=![];_0x23d4dd[_0xc3b1('0x55')]=0x0;_0x23d4dd[_0xc3b1('0x44')]=_0xc3b1('0xaa');loggerSyncQueueSummary[_0xc3b1('0x9d')](_0xc3b1('0xab'),_0x23d4dd['name'],_0xc3b1('0xac'));}else{_0x23d4dd[_0xc3b1('0x44')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc3b1('0x9d')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x23d4dd[_0xc3b1('0x46')],_0xc3b1('0xad'));}emitVoiceQueueSummary(_0x23d4dd);}}function notSendMessagesCampaign(_0x3ea05e){if(_0x3ea05e[_0xc3b1('0xa9')]){if(_0x3ea05e[_0xc3b1('0x75')]===0x0){_0x3ea05e[_0xc3b1('0xa9')]=![];_0x3ea05e[_0xc3b1('0x44')]=_0xc3b1('0xaa');loggerSyncQueueSummary[_0xc3b1('0x9d')](_0xc3b1('0xae'),_0x3ea05e[_0xc3b1('0x46')],'is\x20not\x20active');}else{_0x3ea05e[_0xc3b1('0x44')]=_0xc3b1('0xaf');loggerSyncQueueSummary[_0xc3b1('0x9d')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x3ea05e[_0xc3b1('0x46')],_0xc3b1('0xad'));}emitCampaignSummary(_0x3ea05e);}}function createObjHistory(_0x5ae2f4,_0x21a09b,_0x162297,_0x1124cb,_0x325397){_0x5ae2f4[_0xc3b1('0x44')]=_0x162297;var _0x3c5b36=new Action(_0x5ae2f4,_0x21a09b);var _0x4cd9a5=new History(_0x3c5b36);_0x4cd9a5[_0xc3b1('0xb0')]=_0x1124cb;_0x4cd9a5[_0xc3b1('0xb1')]=_0x325397;_0x4cd9a5['endtime']=_0x3c5b36[_0xc3b1('0xb2')];return _0x4cd9a5;}Dialer[_0xc3b1('0x1e')]['loopClearZombieChannels']=function(){var _0x43e2aa=this;setInterval(function(){_0x43e2aa[_0xc3b1('0xb3')](_0x43e2aa['uniqueId'],'[uniqueid]');_0x43e2aa['clearZombieChannels'](_0x43e2aa['actions'],_0xc3b1('0xb4'));},0x32c8);};Dialer[_0xc3b1('0x1e')]['clearZombieChannels']=function(_0x3b63f5,_0x37afe5){var _0x3f3b92=this;for(var _0x3d554a in _0x3b63f5){if(_0x3b63f5['hasOwnProperty'](_0x3d554a)){this[_0xc3b1('0x21')][_0xc3b1('0xb5')](function(){if(!_['isNil'](_0x3b63f5[_0x3d554a])){return ami[_0xc3b1('0xb6')]({'action':_0xc3b1('0xb7'),'channel':_0x3b63f5[_0x3d554a]['channel']})[_0xc3b1('0xb8')](function(_0x1c86fa){if(_0x1c86fa[_0xc3b1('0x44')]===_0xc3b1('0xb9')){setTimeout(function(){if(_0x3b63f5[_0x3d554a]&&_0x3b63f5[_0x3d554a]['type']!==_0xc3b1('0xba')){_0x3f3b92[_0xc3b1('0xbb')](_0x3f3b92[_0xc3b1('0x23')][_0x3b63f5[_0x3d554a][_0xc3b1('0xbc')]]);logger[_0xc3b1('0x9d')](_0xc3b1('0xbd'),_0x37afe5,_0x3d554a,_0x3b63f5[_0x3d554a][_0xc3b1('0xbc')]);delete _0x3b63f5[_0x3d554a];}if(_0x3b63f5[_0x3d554a]&&_0x3b63f5[_0x3d554a][_0xc3b1('0x5c')]===_0xc3b1('0xba')){_0x3f3b92[_0xc3b1('0xbb')](_0x3f3b92[_0xc3b1('0x24')][_0x3b63f5[_0x3d554a][_0xc3b1('0xbc')]]);logger[_0xc3b1('0x9d')]('[Dialer][checkChannel][ivr]',_0x37afe5,_0x3d554a,_0x3b63f5[_0x3d554a]['queue']);delete _0x3b63f5[_0x3d554a];}},0x2328);}});}});}}};Dialer[_0xc3b1('0x1e')]['countReScheduled']=function(_0x3c1936){return BPromise['resolve']()[_0xc3b1('0xbe')](cmHopper[_0xc3b1('0xbf')](_0x3c1936))[_0xc3b1('0xb8')](loggerCatch('[countReScheduled]\x20'));};Dialer['prototype'][_0xc3b1('0xc0')]=function(_0x1faffc){return BPromise[_0xc3b1('0xc1')]()[_0xc3b1('0xbe')](cmHopperBlack[_0xc3b1('0xc0')](_0x1faffc))['catch'](loggerCatch(_0xc3b1('0xc2')));};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xc3')]=function(_0x2141ad){return BPromise[_0xc3b1('0xc1')]()[_0xc3b1('0xbe')](cmHopperBlack['checkIsBlackListIvr'](_0x2141ad))[_0xc3b1('0xb8')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xc4')]=function(_0x3fa8bb){return BPromise[_0xc3b1('0xc1')]()[_0xc3b1('0xbe')](cmHopperHistory[_0xc3b1('0xc5')](_0x3fa8bb))['catch'](loggerCatch(_0xc3b1('0xc6')));};Dialer['prototype'][_0xc3b1('0xc7')]=function(_0x2b511b){return BPromise['resolve']()[_0xc3b1('0xbe')](cmHopper['rescheduleContact'](_0x2b511b))[_0xc3b1('0xb8')](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xc8')]=function(_0x57d2fd,_0x52078c,_0x35e243,_0x28afe1){return BPromise[_0xc3b1('0xc1')]()[_0xc3b1('0xbe')](cmHopper[_0xc3b1('0xc8')](_0x57d2fd,_0x52078c,_0x35e243,_0x28afe1))[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0xc9')));};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xca')]=function(_0x357764,_0x40e348,_0x57108f){return BPromise['resolve']()[_0xc3b1('0xbe')](cmHopper['getContactDialerIvr'](_0x357764,_0x40e348,_0x57108f))[_0xc3b1('0xb8')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xcb')]=function(_0x200c38){return BPromise[_0xc3b1('0xc1')]()['then'](voiceQueueRt[_0xc3b1('0xcb')](_0x200c38))[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0xcc')));};Dialer['prototype']['moveContactManagedDialer']=function(_0x3219e4){return BPromise[_0xc3b1('0xc1')]()[_0xc3b1('0xbe')](cmHopper[_0xc3b1('0xcd')](_0x3219e4))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xce')]=function(_0x2bbc38){return BPromise[_0xc3b1('0xc1')]()[_0xc3b1('0xbe')](cmHopperHistory['createHistory'](_0x2bbc38))[_0xc3b1('0xb8')](loggerCatch('[createHistory]\x20'));};Dialer[_0xc3b1('0x1e')]['updateOriginated']=function(_0x261ab7){if(!_[_0xc3b1('0x43')](_0x261ab7)&&_0x261ab7!==null){if(_0x261ab7['hasOwnProperty']('originated')){if(_0x261ab7[_0xc3b1('0x75')]>0x0){_0x261ab7[_0xc3b1('0x75')]-=0x1;}else{logger[_0xc3b1('0x9d')]('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xc3b1('0x9d')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xcf')]=function(_0x1edf11,_0xf834ec){var _0x5cabdf=this;return function(_0x44f420){_0x5cabdf[_0xc3b1('0xbb')](_0xf834ec);logger[_0xc3b1('0x9d')](_0x1edf11,util[_0xc3b1('0x9e')](_0x44f420,{'showHidden':![],'depth':null}));};};Dialer[_0xc3b1('0x1e')]['emptyContact']=function(_0x50afad,_0x1b580e,_0x29892b){var _0x23446b={'state':0x19,'statedesc':'notFound'};this[_0xc3b1('0xbb')](_0x1b580e);this[_0xc3b1('0xd0')](_[_0xc3b1('0x93')](_0x23446b,_[_0xc3b1('0xd1')](_0x29892b,[_0xc3b1('0xd2'),_0xc3b1('0xd3'),_0xc3b1('0xd4'),_0xc3b1('0xd5'),_0xc3b1('0xd6')])),'[emptyContact][createHistory]','[emptyContact]');logger[_0xc3b1('0x9d')](_0x50afad);};Dialer[_0xc3b1('0x1e')]['isSuccess']=function(_0x14a2e1){return _0x14a2e1==='Success';};Dialer[_0xc3b1('0x1e')]['isTrunkReachable']=function(_0x4f2051){return!_[_0xc3b1('0x43')](_0x4f2051)&&_0x4f2051&&!_[_0xc3b1('0x43')](_0x4f2051[_0xc3b1('0x46')])&&!_[_0xc3b1('0x43')](_0x4f2051[_0xc3b1('0x7a')])&&_0x4f2051[_0xc3b1('0x7a')]&&(this['trunks'][util[_0xc3b1('0x7d')](_0xc3b1('0xd7'),_0x4f2051[_0xc3b1('0x46')])]['status']==='reachable'||this[_0xc3b1('0x26')][util['format'](_0xc3b1('0xd7'),_0x4f2051[_0xc3b1('0x46')])]['status']===_0xc3b1('0xd8'));};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xd0')]=function(_0x56ed75,_0x47a0d5,_0x248740){this[_0xc3b1('0xce')](_0x56ed75)['catch'](loggerCatch(_0x47a0d5));this[_0xc3b1('0xcd')](_0x56ed75)[_0xc3b1('0xb8')](loggerCatch(_0x248740));};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x3d')]=function(_0x2c5950){var _0x24f762=this[_0xc3b1('0x2a')][_0x2c5950[_0xc3b1('0xd9')]];var _0x17a08f;if(!_[_0xc3b1('0xda')](_0x2c5950)&&!_['isNil'](_0x2c5950[_0xc3b1('0xdb')])&&!_[_0xc3b1('0xda')](_0x2c5950[_0xc3b1('0xdb')][_0xc3b1('0xdc')])&&_0x2c5950['exten']===_0xc3b1('0xdd')&&_0x24f762){if(_0x24f762[_0xc3b1('0x5c')]!==_0xc3b1('0xba')&&this[_0xc3b1('0x23')][_0x24f762[_0xc3b1('0xbc')]][_0xc3b1('0xde')]&&_0x2c5950['value']===_0xc3b1('0xdf')){delete this[_0xc3b1('0x2a')][_0x2c5950[_0xc3b1('0xd9')]];this['updateOriginated'](this['voiceQueues'][_0x24f762[_0xc3b1('0xbc')]]);this[_0xc3b1('0x23')][_0x24f762[_0xc3b1('0xbc')]]['outboundAnswerCallsDay']+=0x1;this[_0xc3b1('0x23')][_0x24f762[_0xc3b1('0xbc')]][_0xc3b1('0x63')]+=0x1;_0x17a08f=new Hangup(_0x24f762,_0x2c5950);_0x17a08f[_0xc3b1('0xb0')]=0x12;_0x17a08f['statedesc']=_0xc3b1('0xe0');_0x17a08f['membername']='AMD';this[_0xc3b1('0xd0')](_0x17a08f,_0xc3b1('0xe1'),'[syncHangupInAMD]');}if(_0x24f762[_0xc3b1('0x5c')]!=='ivr'&&this[_0xc3b1('0x23')][_0x24f762[_0xc3b1('0xbc')]][_0xc3b1('0xde')]&&_0x2c5950[_0xc3b1('0xe2')]===_0xc3b1('0xe3')){delete this[_0xc3b1('0x2a')][_0x2c5950[_0xc3b1('0xd9')]];this[_0xc3b1('0xbb')](this[_0xc3b1('0x23')][_0x24f762[_0xc3b1('0xbc')]]);this[_0xc3b1('0x23')][_0x24f762[_0xc3b1('0xbc')]][_0xc3b1('0x64')]+=0x1;this[_0xc3b1('0x23')][_0x24f762[_0xc3b1('0xbc')]][_0xc3b1('0x63')]+=0x1;_0x17a08f=new Hangup(_0x24f762,_0x2c5950);_0x17a08f[_0xc3b1('0xb0')]=0x13;_0x17a08f[_0xc3b1('0xb1')]=_0xc3b1('0xe4');_0x17a08f[_0xc3b1('0xe5')]=_0xc3b1('0xe6');_0x17a08f[_0xc3b1('0xe7')]=!![];this[_0xc3b1('0xd0')](_0x17a08f,_0xc3b1('0xe8'),_0xc3b1('0xe9'));}if(_0x24f762[_0xc3b1('0x5c')]==='ivr'&&this[_0xc3b1('0x24')][_0x24f762[_0xc3b1('0xbc')]][_0xc3b1('0xde')]&&_0x2c5950[_0xc3b1('0xe2')]===_0xc3b1('0xdf')){delete this[_0xc3b1('0x2a')][_0x2c5950['uniqueid']];this[_0xc3b1('0xbb')](this[_0xc3b1('0x24')][_0x24f762['queue']]);_0x17a08f=new Hangup(_0x24f762,_0x2c5950);_0x17a08f[_0xc3b1('0xb0')]=0x12;_0x17a08f['statedesc']=_0xc3b1('0xe0');_0x17a08f[_0xc3b1('0xe5')]=_0xc3b1('0xe6');this[_0xc3b1('0xd0')](_0x17a08f,_0xc3b1('0xea'),_0xc3b1('0xeb'));}if(_0x24f762[_0xc3b1('0x5c')]==='ivr'&&this[_0xc3b1('0x24')][_0x24f762['queue']][_0xc3b1('0xde')]&&_0x2c5950[_0xc3b1('0xe2')]===_0xc3b1('0xe3')){delete this['uniqueId'][_0x2c5950[_0xc3b1('0xd9')]];this[_0xc3b1('0xbb')](this[_0xc3b1('0x24')][_0x24f762[_0xc3b1('0xbc')]]);_0x17a08f=new Hangup(_0x24f762,_0x2c5950);_0x17a08f[_0xc3b1('0xb0')]=0x13;_0x17a08f[_0xc3b1('0xb1')]=_0xc3b1('0xe4');_0x17a08f[_0xc3b1('0xe5')]=_0xc3b1('0xe6');_0x17a08f[_0xc3b1('0xe7')]=!![];this[_0xc3b1('0xd0')](_0x17a08f,'[syncMachineIvr][createHistory]','[syncMachineIvr]');}}};Dialer[_0xc3b1('0x1e')]['syncHangup']=function(_0x49fe60){var _0x29eb95=this[_0xc3b1('0x2a')][_0x49fe60['uniqueid']];var _0x4ee281=this;var _0x4604de;if(_0x29eb95&&_0x29eb95[_0xc3b1('0x5c')]===_0xc3b1('0xba')){delete this[_0xc3b1('0x2a')][_0x49fe60[_0xc3b1('0xd9')]];this[_0xc3b1('0xbb')](this['campaigns'][_0x29eb95['queue']]);this[_0xc3b1('0x24')][_0x29eb95['queue']][_0xc3b1('0xec')]+=0x1;_0x4604de=new Hangup(_0x29eb95,_0x49fe60);this['createHistory'](_0x4604de)[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0xed')));this['moveContactManagedDialer'](_0x4604de)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x29eb95&&_0x29eb95['type']!==_0xc3b1('0xba')&&isNotNull(this[_0xc3b1('0x23')][_0x29eb95[_0xc3b1('0xbc')]][_0xc3b1('0xee')])){delete this[_0xc3b1('0x2a')][_0x49fe60['uniqueid']];this[_0xc3b1('0xbb')](this[_0xc3b1('0x23')][_0x29eb95[_0xc3b1('0xbc')]]);this[_0xc3b1('0x23')][_0x29eb95[_0xc3b1('0xbc')]][_0xc3b1('0x64')]+=0x1;this['voiceQueues'][_0x29eb95[_0xc3b1('0xbc')]][_0xc3b1('0x63')]+=0x1;_0x4604de=new Hangup(_0x29eb95,_0x49fe60);_0x4604de[_0xc3b1('0xb0')]=0x10;_0x4604de[_0xc3b1('0xb1')]='AnswerAGI';_0x4604de[_0xc3b1('0xe5')]=_0xc3b1('0xef');this[_0xc3b1('0xce')](_0x4604de)['catch'](loggerCatch(_0xc3b1('0xed')));this[_0xc3b1('0xcd')](_0x4604de)['catch'](loggerCatch(_0xc3b1('0xf0')));}if(_0x29eb95&&_0x29eb95[_0xc3b1('0x5c')]!==_0xc3b1('0xba')&&!isNotNull(this['voiceQueues'][_0x29eb95[_0xc3b1('0xbc')]]['dialQueueProject'])){delete this[_0xc3b1('0x2a')][_0x49fe60[_0xc3b1('0xd9')]];this[_0xc3b1('0xbb')](this[_0xc3b1('0x23')][_0x29eb95[_0xc3b1('0xbc')]]);this[_0xc3b1('0x23')][_0x29eb95['queue']][_0xc3b1('0x6d')]+=0x1;_0x4604de=new Hangup(_0x29eb95,_0x49fe60);_0x4604de[_0xc3b1('0xb0')]=0xc;_0x4604de[_0xc3b1('0xb1')]=_0x49fe60[_0xc3b1('0xf1')];_0x4604de[_0xc3b1('0xe5')]=_0xc3b1('0xf2');this[_0xc3b1('0xce')](_0x4604de)[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0xed')));this[_0xc3b1('0xcd')](_0x4604de)[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0xf0')));}};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xf3')]=function(_0x44eff3){var _0x332179=this[_0xc3b1('0x2a')][_0x44eff3[_0xc3b1('0xd9')]];var _0x39f7cd=this;if(this[_0xc3b1('0x23')][_0x44eff3[_0xc3b1('0xbc')]]){if(_0x332179&&_0x332179['type']!==_0xc3b1('0xba')){delete this['uniqueId'][_0x44eff3['uniqueid']];this[_0xc3b1('0x23')][_0x44eff3[_0xc3b1('0xbc')]][_0xc3b1('0x64')]+=0x1;var _0x2cc099=new AgentComplete(_0x332179,_0x44eff3);if(_0x44eff3[_0xc3b1('0xf4')]===_0xc3b1('0xf5')){_0x2cc099[_0xc3b1('0xf6')]=this[_0xc3b1('0x23')][_0x44eff3[_0xc3b1('0xbc')]][_0xc3b1('0xf7')]&&this[_0xc3b1('0x23')][_0x44eff3[_0xc3b1('0xbc')]][_0xc3b1('0xf8')]?moment()[_0xc3b1('0x7d')](_0xc3b1('0xf9')):undefined;}this[_0xc3b1('0xce')](_0x2cc099)[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0xfa')));this[_0xc3b1('0xcd')](_0x2cc099)[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0xfb')));}}};Dialer[_0xc3b1('0x1e')]['syncAgentConnect']=function(_0x24b8f9){if(this[_0xc3b1('0x23')][_0x24b8f9[_0xc3b1('0xbc')]]){if(this[_0xc3b1('0x2a')][_0x24b8f9[_0xc3b1('0xd9')]]&&this[_0xc3b1('0x2a')][_0x24b8f9[_0xc3b1('0xd9')]][_0xc3b1('0x5c')]!==_0xc3b1('0xba')){this['updateOriginated'](this[_0xc3b1('0x23')][_0x24b8f9[_0xc3b1('0xbc')]]);this[_0xc3b1('0x2a')][_0x24b8f9['uniqueid']][_0xc3b1('0xfc')]=moment()[_0xc3b1('0x7d')](_0xc3b1('0xf9'));}}};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xfd')]=function(_0x4b0d51){this[_0xc3b1('0xce')](_0x4b0d51)[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0xfa')));this[_0xc3b1('0xcd')](_0x4b0d51)[_0xc3b1('0xb8')](loggerCatch('[syncQueueCallerAbandon]\x20[Drop]'));};Dialer['prototype'][_0xc3b1('0xfe')]=function(_0xfb7d75){var _0x1729d5=this[_0xc3b1('0x2a')][_0xfb7d75[_0xc3b1('0xd9')]];var _0x49fcb2=this;if(this[_0xc3b1('0x23')][_0xfb7d75[_0xc3b1('0xbc')]]){if(_0x1729d5&&_0x1729d5[_0xc3b1('0x5c')]!==_0xc3b1('0xba')){delete this[_0xc3b1('0x2a')][_0xfb7d75[_0xc3b1('0xd9')]];this['updateOriginated'](this['voiceQueues'][_0xfb7d75[_0xc3b1('0xbc')]]);_0x1729d5[_0xc3b1('0xff')]=moment()[_0xc3b1('0x7d')](_0xc3b1('0xf9'));var _0x160032=new QueueCallerAbandon(_0x1729d5,_0xfb7d75);if(getSeconds(_0x1729d5['droptime'],_0x1729d5[_0xc3b1('0x100')])>=_0x1729d5[_0xc3b1('0x101')]){this[_0xc3b1('0x23')][_0xfb7d75[_0xc3b1('0xbc')]][_0xc3b1('0x71')]+=0x1;this[_0xc3b1('0x23')][_0xfb7d75['queue']][_0xc3b1('0x102')]+=0x1;this['voiceQueues'][_0xfb7d75[_0xc3b1('0xbc')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x160032['state']=0xa;_0x160032[_0xc3b1('0xb1')]=_0xc3b1('0x103');_0x160032['dropreason']='TIMEOUT';_0x160032[_0xc3b1('0xf6')]=this[_0xc3b1('0x23')][_0xfb7d75[_0xc3b1('0xbc')]][_0xc3b1('0xf7')]?moment()[_0xc3b1('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'):undefined;this['queueCallerAbandonCreateState'](_0x160032);}else{this['voiceQueues'][_0xfb7d75['queue']][_0xc3b1('0x85')]+=0x1;this[_0xc3b1('0x23')][_0xfb7d75[_0xc3b1('0xbc')]][_0xc3b1('0x67')]+=0x1;_0x160032['state']=0xb;_0x160032[_0xc3b1('0xb1')]=_0xc3b1('0x104');_0x160032[_0xc3b1('0x105')]=_0xc3b1('0x106');this[_0xc3b1('0xfd')](_0x160032);}}}};Dialer[_0xc3b1('0x1e')]['syncNewExten']=function(_0x274247){if(this[_0xc3b1('0x29')][_0x274247['uniqueid']]){this[_0xc3b1('0x29')][_0x274247['uniqueid']]['channel']=_0x274247[_0xc3b1('0x107')];}if(this[_0xc3b1('0x2a')][_0x274247[_0xc3b1('0xd9')]]){this[_0xc3b1('0x2a')][_0x274247['uniqueid']][_0xc3b1('0x107')]=_0x274247['channel'];}};Dialer[_0xc3b1('0x1e')]['syncQueueMember']=function(_0x2c7e17){if(strategy[this[_0xc3b1('0x23')][this['actions'][_0x2c7e17['actionid']][_0xc3b1('0xbc')]][_0xc3b1('0x108')]]==='roundrobin'){if(this[_0xc3b1('0x29')][_0x2c7e17[_0xc3b1('0x109')]]&&_[_0xc3b1('0xda')](this['actions'][_0x2c7e17[_0xc3b1('0x109')]]['locked'])&&_0x2c7e17[_0xc3b1('0xb7')]==='1'&&_0x2c7e17['paused']==='0'){if(this[_0xc3b1('0x25')][_0x2c7e17[_0xc3b1('0x10a')]]){if(!this[_0xc3b1('0x25')][_0x2c7e17['stateinterface']][_0xc3b1('0x10b')]){this['agents'][_0x2c7e17[_0xc3b1('0x10a')]]['locked']=!![];this[_0xc3b1('0x29')][_0x2c7e17[_0xc3b1('0x109')]][_0xc3b1('0x10b')]=!![];this['actions'][_0x2c7e17[_0xc3b1('0x109')]]['stateinterface']=_0x2c7e17[_0xc3b1('0x10a')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x2c7e17[_0xc3b1('0x109')]]['queue']][_0xc3b1('0x108')]]||_0xc3b1('0x1c'))===_0xc3b1('0x1c')){if(this[_0xc3b1('0x29')][_0x2c7e17['actionid']]){if(this[_0xc3b1('0x25')][_0x2c7e17[_0xc3b1('0x10a')]]){this[_0xc3b1('0x29')][_0x2c7e17['actionid']][_0xc3b1('0x10a')]=_0x2c7e17['stateinterface'];if(_[_0xc3b1('0xda')](this[_0xc3b1('0x2e')][this['actions'][_0x2c7e17[_0xc3b1('0x109')]][_0xc3b1('0xbc')]])){this[_0xc3b1('0x2e')][this['actions'][_0x2c7e17['actionid']][_0xc3b1('0xbc')]]=[];}this['queueBooked'][this[_0xc3b1('0x29')][_0x2c7e17[_0xc3b1('0x109')]][_0xc3b1('0xbc')]]['push'](_[_0xc3b1('0x93')](_[_0xc3b1('0xd1')](this[_0xc3b1('0x29')][_0x2c7e17[_0xc3b1('0x109')]],[_0xc3b1('0x10c'),_0xc3b1('0x10a')]),{'status':_0x2c7e17[_0xc3b1('0xb7')],'paused':_0x2c7e17['paused']}));}}}};function unlockQueueStatus(_0x111067,_0x215418){setTimeout(function(){if(_[_0xc3b1('0x43')](_0x111067[_0xc3b1('0x10d')])){loggerBooked[_0xc3b1('0x9d')](_0xc3b1('0x10e'),_0x215418);}_0x111067[_0xc3b1('0x10d')]=!![];loggerBooked[_0xc3b1('0x80')](_0xc3b1('0x10f'),_0x215418,JSON[_0xc3b1('0x7c')](_[_0xc3b1('0xd1')](_0x111067,[_0xc3b1('0x46'),_0xc3b1('0x10d')])));},0x1f3);}Dialer[_0xc3b1('0x1e')][_0xc3b1('0x40')]=function(_0xc694df){var _0x14ae62=this;var _0x174475=_0x14ae62[_0xc3b1('0x23')][_0x14ae62[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0xbc')]];if(strategy[this[_0xc3b1('0x23')][this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]]['queue']]['strategy']]===_0xc3b1('0x1d')){if(this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]]&&this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]]['stateinterface']){this[_0xc3b1('0x22')][_0xc3b1('0x110')](this[_0xc3b1('0x29')][_0xc694df['actionid']][_0xc3b1('0x10c')],this[_0xc3b1('0x29')][_0xc694df['actionid']]['stateinterface'])[_0xc3b1('0xb8')](function(_0x1596e5){logger[_0xc3b1('0x9d')](_0xc3b1('0x111'),util['inspect'](_0x1596e5,{'showHidden':![],'depth':null}));})['finally'](function(){_0x14ae62[_0xc3b1('0xbb')](_0x14ae62[_0xc3b1('0x23')][_0x14ae62[_0xc3b1('0x29')][_0xc694df['actionid']]['queue']]);_0x14ae62[_0xc3b1('0x25')][_0x14ae62[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0x10a')]][_0xc3b1('0x10b')]=![];delete _0x14ae62[_0xc3b1('0x29')][_0xc694df['actionid']];unlockQueueStatus(_0x174475);});}else{this[_0xc3b1('0xbb')](this[_0xc3b1('0x23')][this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]]['queue']]);this[_0xc3b1('0xc7')]({'active':![],'ContactId':this[_0xc3b1('0x29')][_0xc694df['actionid']][_0xc3b1('0xd2')],'ListId':this['actions'][_0xc694df['actionid']][_0xc3b1('0xd3')],'VoiceQueueId':this['actions'][_0xc694df[_0xc3b1('0x109')]]['VoiceQueueId']||undefined,'CampaignId':this['actions'][_0xc694df['actionid']][_0xc3b1('0xd6')]||undefined})[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0x112')));delete this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]];unlockQueueStatus(_0x174475);}}else if((strategy[this[_0xc3b1('0x23')][this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0xbc')]][_0xc3b1('0x108')]]||_0xc3b1('0x1c'))===_0xc3b1('0x1c')){var _0x55f99d;if(this['actions'][_0xc694df['actionid']]&&!_['isEmpty'](this['queueBooked'][this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0xbc')]])){if(this[_0xc3b1('0x2f')][_0x14ae62[_0xc3b1('0x29')][_0xc694df['actionid']][_0xc3b1('0xbc')]]){this['queueBookedRR'][_0x14ae62[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]]['queue']]=this[_0xc3b1('0x2f')][this['actions'][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0xbc')]]?this[_0xc3b1('0x2f')][this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0xbc')]]:this[_0xc3b1('0x2e')][this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]]['queue']]?this[_0xc3b1('0x2e')][this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0xbc')]][_0xc3b1('0x113')]||0x0:0x0;}this[_0xc3b1('0x2e')][this[_0xc3b1('0x29')][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0xbc')]][_0xc3b1('0x113')]=this['queueBookedRR'][this['actions'][_0xc694df[_0xc3b1('0x109')]][_0xc3b1('0xbc')]];for(var _0x18dc52=0x0;_0x18dc52=0x0?!![]:![];})[_0xc3b1('0xb8')](myreject(_0xc91101)));}}else{_0x861d67[_0xc3b1('0x129')](ami[_0xc3b1('0xb6')]({'action':_0xc3b1('0x12a'),'command':util[_0xc3b1('0x7d')]('iftime\x20%s,%s',_0x326f68,!_[_0xc3b1('0x43')](config[_0xc3b1('0x12e')][_0x5a37f0])?_0x5a37f0:'')})[_0xc3b1('0xbe')](function(_0x561926){return _0x561926['content']['indexOf'](_0xc3b1('0x12f'))>=0x0?!![]:![];})['catch'](myreject(_0xc91101)));}BPromise[_0xc3b1('0x130')](_0x861d67)[_0xc3b1('0xbe')](function(_0x2e00ad){var _0x46154c=_[_0xc3b1('0x131')](_0x2e00ad);if(_0x46154c){return _0x2d939c(_0x46154c);}else{_0x224edc[_0xc3b1('0x44')]=_0x1757f8?_0xc3b1('0x132'):_0xc3b1('0x133');return _0xc91101(msgResponse(_0xc3b1('0x134'),_0xc3b1('0x124'),_0xc3b1('0x135')+_0x1757f8+'\x20'+_0x227b57+'\x20Interval\x20is\x20overtime:\x20'+util[_0xc3b1('0x9e')](_0x326f68,{'showHidden':![],'depth':null})+_0xc3b1('0x136')+_0x5a37f0));}})['catch'](function(_0x1f920e){return _0xc91101(msgResponse(_0xc3b1('0x122'),'Failure',JSON[_0xc3b1('0x7c')](_0x1f920e)));});});};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x137')]=function(_0x170086){var _0x7d6c78=this;return function(){switch(_0x170086[_0xc3b1('0x61')]){case _0xc3b1('0x138'):freeVariablesPredictive(_0x170086);_0x7d6c78[_0xc3b1('0x139')](_0x170086,0x1);break;case'power':freeVariablesPredictive(_0x170086);_0x7d6c78['handlePower'](_0x170086,_0x170086[_0xc3b1('0x13a')]);break;case _0xc3b1('0xa'):_0x7d6c78[_0xc3b1('0xa')](_0x170086);break;case'booked':freeVariablesPredictive(_0x170086);_0x7d6c78['handlePower'](_0x170086,0x1);break;default:freeVariablesPredictive(_0x170086);logger[_0xc3b1('0x9d')](_0xc3b1('0x13b'),_0x170086[_0xc3b1('0x46')],_0xc3b1('0x13c'));}};};Dialer[_0xc3b1('0x1e')]['launchHandleIvr']=function(_0x543682){var _0x5f300e=this;return function(){_0x5f300e['handleIvr'](_0x543682);};};Dialer[_0xc3b1('0x1e')][_0xc3b1('0xc')]=function(_0x5b4db0){var _0x306afa=this;if(isNotPreview(_0x5b4db0[_0xc3b1('0x61')])){if(isVoiceQueueOutbound(_0x5b4db0[_0xc3b1('0x5c')])&&isActive(_0x5b4db0[_0xc3b1('0x60')])){_0x5b4db0['sendMessageOneNotActive']=!![];BPromise[_0xc3b1('0xc1')]()[_0xc3b1('0xbe')](checkIsLoggedIn(_0x5b4db0,_0x5b4db0['loggedIn']))[_0xc3b1('0xbe')](checkIsActive(_0x5b4db0,_0x5b4db0[_0xc3b1('0x60')]))['then'](checkInterval(_0x5b4db0))[_0xc3b1('0xbe')](_0x306afa[_0xc3b1('0x11d')](_0x5b4db0))[_0xc3b1('0xbe')](_0x306afa['checkIfTime'](_0x5b4db0['dialGlobalInterval'],_0x5b4db0['dialTimezone'],_0x5b4db0[_0xc3b1('0x46')],_0x5b4db0))[_0xc3b1('0xbe')](_0x306afa[_0xc3b1('0x123')](_0x5b4db0[_0xc3b1('0x49')],_0x5b4db0[_0xc3b1('0x13d')],_0x5b4db0[_0xc3b1('0x46')],_0x5b4db0))['then'](_0x306afa[_0xc3b1('0x137')](_0x5b4db0))['catch'](loggerCatchQueueSummary('[syncQueueSummary]',_0x5b4db0));}else{notSendMessagesQueue(_0x5b4db0);}}else{freeVariablesPredictive(_0x5b4db0);}};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x13e')]=function(){var _0x3790d8=this;var _0x463609;for(var _0x490aea in this[_0xc3b1('0x24')]){if(this[_0xc3b1('0x24')][_0xc3b1('0xa1')](_0x490aea)){_0x463609=this['campaigns'][_0x490aea];if(isCampaignIvr(_0x463609[_0xc3b1('0x5c')])&&isActive(_0x463609[_0xc3b1('0x7a')])){_0x463609[_0xc3b1('0xa9')]=!![];BPromise[_0xc3b1('0xc1')]()['then'](checkIsActive(_0x463609,_0x463609[_0xc3b1('0x7a')]))['then'](checkInterval(_0x463609))[_0xc3b1('0xbe')](_0x3790d8['checkIsTrunkReachable'](_0x463609))[_0xc3b1('0xbe')](_0x3790d8[_0xc3b1('0x121')](_0x463609[_0xc3b1('0x13f')],_0x463609[_0xc3b1('0x13d')],_0x463609[_0xc3b1('0x46')],_0x463609))[_0xc3b1('0xbe')](_0x3790d8[_0xc3b1('0x123')](_0x463609[_0xc3b1('0x49')],_0x463609['dialTimezone'],_0x463609[_0xc3b1('0x46')],_0x463609))[_0xc3b1('0xbe')](_0x3790d8[_0xc3b1('0x140')](_0x463609))[_0xc3b1('0xb8')](loggerCatchQueueSummary(_0xc3b1('0x141'),_0x463609));}else{notSendMessagesCampaign(_0x463609);}}}};function getCallerIdRandom(_0x2c4596,_0x473703){var _0x34078f,_0x16ea3f,_0x52d13a;if(_0x473703<=0x0){_0x473703=0x1;}_0x34078f=new RegExp(_0xc3b1('0x142')+_0x473703+'}$');_0x16ea3f=Math[_0xc3b1('0x143')](0xa,_0x473703-0x1);_0x52d13a=Math[_0xc3b1('0x143')](0xa,_0x473703)-0x1;return util[_0xc3b1('0x7d')]('%s',_[_0xc3b1('0x144')](_0x2c4596,_0x34078f,_[_0xc3b1('0x145')](_0x16ea3f,_0x52d13a)));}function extractCalleridName(_0x4a05c6){var _0x58cacc=_0x4a05c6[_0xc3b1('0x146')](/"(.*?)"/);return _0x58cacc?_0x58cacc[0x1]:_0x4a05c6;}function extractCalleridNumber(_0x4ef336){var _0x494b3a=_0x4ef336[_0xc3b1('0x146')](/<(.*?)>/);return _0x494b3a?_0x494b3a[0x1]:_0x4ef336;}Dialer['prototype'][_0xc3b1('0x147')]=function(_0x42145a,_0x26c1fe){var _0x5498d4=this;var _0x5aef1e=uuid['v4']();this[_0xc3b1('0x29')][_0x5aef1e]=new Action(_0x42145a,_0x26c1fe,_0x5aef1e);return new BPromise(function(_0x4b403e,_0x28ba6c){if(_[_0xc3b1('0x43')](_0x42145a)&&_0xc3b1('0x148')!==typeof _0x42145a){return _0x28ba6c(msgResponse(_0xc3b1('0x149'),'Failure',_0xc3b1('0x14a')));}if(_[_0xc3b1('0x43')](_0x26c1fe[_0xc3b1('0x14b')][_0xc3b1('0x14c')])||_0x26c1fe[_0xc3b1('0x14b')]['phone']===null){return _0x28ba6c(msgResponse(_0xc3b1('0x149'),_0xc3b1('0x124'),'contact\x20is\x20undefine'));}var _0x4cee12={'XMD-CALLERID':_0x5498d4[_0xc3b1('0x29')][_0x5aef1e][_0xc3b1('0x14d')](),'XMD-AGI':_0x42145a[_0xc3b1('0xee')]?util[_0xc3b1('0x7d')]('\x22agi://%s/square,%s\x22',ipAgi,_0x42145a[_0xc3b1('0xee')]):_0xc3b1('0x14e'),'XMD-AGIAFTER':_0x42145a[_0xc3b1('0xf7')]?util[_0xc3b1('0x7d')](_0xc3b1('0x14f'),ipAgi,_0x42145a[_0xc3b1('0xf7')]):_0xc3b1('0x14e'),'XMD-QUEUE':_0x42145a[_0xc3b1('0x5c')]===_0xc3b1('0x53')?util[_0xc3b1('0x7d')](_0xc3b1('0x150'),_0x42145a[_0xc3b1('0x46')],_0x42145a[_0xc3b1('0x151')]||'',_0x42145a[_0xc3b1('0xf8')]?'c':'',_0x42145a[_0xc3b1('0x101')]||0x3):_0xc3b1('0x14e'),'XMD-CONTACTID':_0x26c1fe[_0xc3b1('0xd2')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x5498d4[_0xc3b1('0x29')][_0x5aef1e][_0xc3b1('0x14d')](),'XMD-AMD':_0x42145a['dialAMDActive']?_0xc3b1('0x152'):_0xc3b1('0x14e'),'XMD-DESTINATION':_0xc3b1('0xdd')};if(_0x42145a[_0xc3b1('0xde')]){_0x4cee12['XMD-AMDINITIALSILENCE']=_0x42145a['dialAMDInitialSilence']||0x9c4;_0x4cee12['XMD-AMDGREETING']=_0x42145a[_0xc3b1('0x153')]||0x5dc;_0x4cee12[_0xc3b1('0x154')]=_0x42145a[_0xc3b1('0x155')]||0x320;_0x4cee12['XMD-AMDTOTALANALYSISTIME']=_0x42145a[_0xc3b1('0x156')]||0x1388;_0x4cee12[_0xc3b1('0x157')]=_0x42145a[_0xc3b1('0x158')]||0x64;_0x4cee12['XMD-AMDBETWEENWORDSSILENCE']=_0x42145a[_0xc3b1('0x159')]||0x32;_0x4cee12[_0xc3b1('0x15a')]=_0x42145a[_0xc3b1('0x15b')]||0x3;_0x4cee12[_0xc3b1('0x15c')]=_0x42145a['dialAMDSilenceThreshold']||0x100;_0x4cee12['XMD-AMDMAXIMUMWORDLENGTH']=_0x42145a[_0xc3b1('0x15d')]||0x1388;}if(_0x42145a[_0xc3b1('0x5c')]===_0xc3b1('0x53')){_0x4cee12[_0xc3b1('0x15e')]=_0x26c1fe[_0xc3b1('0xd5')];}else{_0x4cee12[_0xc3b1('0x15f')]=_0x26c1fe['CampaignId'];}for(var _0x15cc83 in _0x26c1fe[_0xc3b1('0x14b')]){if(_0x26c1fe['Contact'][_0xc3b1('0xa1')](_0x15cc83)){if(isNotNull(_0x26c1fe['Contact'][_0x15cc83])&&_0x15cc83!=='id'&&_0x15cc83!=='tags'&&_0x15cc83!==_0xc3b1('0x160')&&_0x15cc83!==_0xc3b1('0x161')){_0x4cee12[util[_0xc3b1('0x7d')](_0xc3b1('0x162'),'XMD-',_[_0xc3b1('0x163')](_0x15cc83))]=_0x26c1fe[_0xc3b1('0x14b')][_0x15cc83];}}}var _0x4dc3ca=_0x5498d4[_0xc3b1('0x11e')](_0x42145a[_0xc3b1('0x79')])?getCallerId(_0x42145a['Trunk']['callerid'],_0x42145a[_0xc3b1('0x62')],_0x42145a[_0xc3b1('0x164')]>0x0?getCallerIdRandom(_0x42145a[_0xc3b1('0x165')],_0x42145a[_0xc3b1('0x164')]):_0x42145a[_0xc3b1('0x165')]):getCallerId(_[_0xc3b1('0xda')](_0x42145a['TrunkBackup'])?_0x42145a[_0xc3b1('0x79')][_0xc3b1('0x7b')]:_0x42145a[_0xc3b1('0x11f')][_0xc3b1('0x7b')],_0x42145a['dialOriginateCallerIdName'],_0x42145a['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x42145a['dialOriginateCallerIdNumber'],_0x42145a[_0xc3b1('0x164')]):_0x42145a[_0xc3b1('0x165')]);if(_0x4dc3ca){_0x4cee12[_0xc3b1('0x166')]=_0x5498d4[_0xc3b1('0x29')][_0x5aef1e][_0xc3b1('0x167')]=extractCalleridName(_0x4dc3ca);_0x4cee12['XMD-ORIGINATECALLERIDNUM']=_0x5498d4[_0xc3b1('0x29')][_0x5aef1e][_0xc3b1('0x168')]=extractCalleridNumber(_0x4dc3ca);}return ami[_0xc3b1('0xb6')]({'actionid':_0x5aef1e,'action':_0xc3b1('0x149'),'channel':_0x5498d4[_0xc3b1('0x11e')](_0x42145a[_0xc3b1('0x79')])?util[_0xc3b1('0x7d')](_0xc3b1('0x169'),_0x42145a[_0xc3b1('0x79')][_0xc3b1('0x46')],isNotNull(_0x42145a[_0xc3b1('0x16a')])?_0x42145a[_0xc3b1('0x16a')][_0xc3b1('0x16b')]()||'':'',_0x42145a[_0xc3b1('0x16c')]>0x0?_0x26c1fe[_0xc3b1('0x14b')]['phone'][_0xc3b1('0x16d')](_0x42145a[_0xc3b1('0x16c')]):_0x26c1fe[_0xc3b1('0x14b')]['phone']):util[_0xc3b1('0x7d')](_0xc3b1('0x169'),_[_0xc3b1('0xda')](_0x42145a[_0xc3b1('0x11f')])?_0x42145a[_0xc3b1('0x79')][_0xc3b1('0x46')]:_0x42145a[_0xc3b1('0x11f')][_0xc3b1('0x46')],isNotNull(_0x42145a[_0xc3b1('0x16a')])?_0x42145a['dialPrefix'][_0xc3b1('0x16b')]()||'':'',_0x42145a[_0xc3b1('0x16c')]>0x0?_0x26c1fe[_0xc3b1('0x14b')][_0xc3b1('0x14c')][_0xc3b1('0x16d')](_0x42145a[_0xc3b1('0x16c')]):_0x26c1fe[_0xc3b1('0x14b')][_0xc3b1('0x14c')]),'callerid':_0x4dc3ca,'Exten':'xcally-motion-dialer','Context':_0xc3b1('0x16e'),'Priority':'1','variable':_0x4cee12,'timeout':(_0x42145a[_0xc3b1('0x16f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x5aef1e})[_0xc3b1('0xbe')](function(_0x3d3a63){return _0x4b403e(_0x3d3a63);})[_0xc3b1('0xb8')](function(_0x379a77){_0x42145a[_0xc3b1('0x6a')]+=0x1;var _0x2097ae=new History(_0x5498d4['actions'][_0x5aef1e]);logger[_0xc3b1('0x9d')](util[_0xc3b1('0x7d')](_0xc3b1('0x170'),JSON[_0xc3b1('0x7c')](_0x379a77)));_0x2097ae[_0xc3b1('0xb0')]=0xe;_0x2097ae[_0xc3b1('0xb1')]=_0xc3b1('0x171');_0x2097ae[_0xc3b1('0xb2')]=moment()[_0xc3b1('0x7d')](_0xc3b1('0xf9'));_0x2097ae[_0xc3b1('0x172')]=_0x2097ae[_0xc3b1('0xb2')];_0x5498d4[_0xc3b1('0xce')](_0x2097ae)[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0x173')));_0x5498d4[_0xc3b1('0xcd')](_0x2097ae)[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0x173')))[_0xc3b1('0x20')](function(){delete _0x5498d4['actions'][_0x5aef1e];return _0x28ba6c(msgResponse(_0xc3b1('0x149'),_0xc3b1('0x4f'),_0xc3b1('0x174')));});});});};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x35')]=function(_0x300cb8){var _0x3b6952=this['actions'][_0x300cb8[_0xc3b1('0x109')]];var _0x348031=this;if(_0x3b6952){delete this[_0xc3b1('0x29')][_0x300cb8[_0xc3b1('0x109')]];_0x3b6952[_0xc3b1('0x100')]=moment()['format'](_0xc3b1('0xf9'));var _0x3268ca=_0x3b6952[_0xc3b1('0x5c')]===_0xc3b1('0xba')?this['campaigns'][_0x3b6952[_0xc3b1('0xbc')]]:this[_0xc3b1('0x23')][_0x3b6952['getQueue']()];if(!this[_0xc3b1('0x175')](_0x300cb8[_0xc3b1('0x176')])){this[_0xc3b1('0xbb')](_0x3268ca);return this[_0xc3b1('0x177')](_0x3b6952,_0x3268ca,_0x300cb8)[_0xc3b1('0xbe')](function(_0x137806){})[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0x178')));}else{this[_0xc3b1('0x2a')][_0x300cb8[_0xc3b1('0xd9')]]=_0x3b6952;}}};Dialer['prototype'][_0xc3b1('0x179')]=function(_0x311a72,_0x24ed53,_0x210486){var _0x21ea7f=new History(_0x24ed53);if(_0x21ea7f[_0xc3b1('0x17a')]+_0x21ea7f['countcongestionretry']+_0x21ea7f['countnoanswerretry']>=_0x210486['dialGlobalMaxRetry']-0x1){return!![];}switch(_0x311a72){case 0x3:if(_0x21ea7f[_0xc3b1('0x17b')]>=_0x210486[_0xc3b1('0x17c')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x21ea7f[_0xc3b1('0x17b')]+=0x1,'scheduledat':moment()['add'](_0x210486[_0xc3b1('0x17d')],'minutes')[_0xc3b1('0x7d')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x21ea7f[_0xc3b1('0xd2')],'ListId':_0x21ea7f[_0xc3b1('0xd3')],'VoiceQueueId':_0x21ea7f[_0xc3b1('0xd5')]||undefined,'CampaignId':_0x21ea7f[_0xc3b1('0xd6')]||undefined})[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0x17e')));}break;case 0x5:if(_0x21ea7f['countbusyretry']>=_0x210486[_0xc3b1('0x17f')]-0x1){return!![];}else{this[_0xc3b1('0xc7')]({'active':![],'countbusyretry':_0x21ea7f[_0xc3b1('0x17a')]+=0x1,'scheduledat':moment()[_0xc3b1('0x180')](_0x210486[_0xc3b1('0x181')],_0xc3b1('0x182'))['format'](_0xc3b1('0xf9')),'ContactId':_0x21ea7f[_0xc3b1('0xd2')],'ListId':_0x21ea7f[_0xc3b1('0xd3')],'VoiceQueueId':_0x21ea7f[_0xc3b1('0xd5')]||undefined,'CampaignId':_0x21ea7f['CampaignId']||undefined})[_0xc3b1('0xb8')](loggerCatch('[rescheduleContact]\x20[Busy]'));}break;case 0x8:if(_0x21ea7f[_0xc3b1('0x183')]>=_0x210486[_0xc3b1('0x184')]-0x1){return!![];}else{this[_0xc3b1('0xc7')]({'active':![],'countcongestionretry':_0x21ea7f['countcongestionretry']+=0x1,'scheduledat':moment()['add'](_0x210486['dialCongestionRetryFrequency'],'minutes')[_0xc3b1('0x7d')](_0xc3b1('0xf9')),'ContactId':_0x21ea7f[_0xc3b1('0xd2')],'ListId':_0x21ea7f['ListId'],'VoiceQueueId':_0x21ea7f[_0xc3b1('0xd5')]||undefined,'CampaignId':_0x21ea7f['CampaignId']||undefined})['catch'](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;default:return!![];}};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x177')]=function(_0x311f87,_0x178075,_0x15a040){var _0x3c2ff8=this;var _0x571612=new History(_0x311f87);return new BPromise(function(_0x3bedf4,_0x2b67bb){if(_[_0xc3b1('0x43')](_0x178075)&&_0xc3b1('0x148')!==typeof _0x178075){return _0x2b67bb(msgResponse(_0xc3b1('0x185'),'Failure','entity\x20is\x20undefine'));}if(_['isUndefined'](_0x15a040)&&'object'!==typeof _0x15a040){return _0x2b67bb(msgResponse(_0xc3b1('0x185'),'Failure',_0xc3b1('0x186')));}switch(_0x15a040[_0xc3b1('0xf4')]){case'0':_0x178075[_0xc3b1('0x69')]+=0x1;_0x571612['state']=0x0;_0x571612[_0xc3b1('0xb1')]='NoSuchNumber';_0x3c2ff8[_0xc3b1('0xce')](_0x571612)['catch'](loggerCatch(_0xc3b1('0x187')));if(_0x3c2ff8['checkRetriveMax'](0x0,_0x311f87,_0x178075)){if(_0x571612[_0xc3b1('0x17a')]+_0x571612[_0xc3b1('0x183')]+_0x571612['countnoanswerretry']>=_0x178075['dialGlobalMaxRetry']){_0x3c2ff8['stateGlobal'](_0x571612,_0x3bedf4,_0x2b67bb,'reason\x200\x20no\x20such\x20number....');}else{_0x3c2ff8[_0xc3b1('0x188')](_0x571612,_0x3bedf4,_0x2b67bb,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x178075[_0xc3b1('0x68')]+=0x1;_0x571612['state']=0x3;_0x571612[_0xc3b1('0xb1')]=_0xc3b1('0x189');_0x571612[_0xc3b1('0x17b')]+=0x1;_0x571612[_0xc3b1('0x18a')]+=0x1;_0x3c2ff8[_0xc3b1('0xce')](_0x571612)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x3c2ff8[_0xc3b1('0x179')](0x3,_0x311f87,_0x178075)){if(_0x571612[_0xc3b1('0x17b')]>=_0x178075[_0xc3b1('0x17c')]){_0x3c2ff8[_0xc3b1('0x188')](_0x571612,_0x3bedf4,_0x2b67bb,_0xc3b1('0x18b'));}else{_0x3c2ff8[_0xc3b1('0x18c')](_0x571612,_0x3bedf4,_0x2b67bb,_0xc3b1('0x18b'));}}break;case'5':_0x178075[_0xc3b1('0x65')]+=0x1;_0x571612[_0xc3b1('0xb0')]=0x5;_0x571612[_0xc3b1('0xb1')]=_0xc3b1('0x18d');_0x571612[_0xc3b1('0x17a')]+=0x1;_0x571612[_0xc3b1('0x18a')]+=0x1;_0x3c2ff8[_0xc3b1('0xce')](_0x571612)[_0xc3b1('0xb8')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x3c2ff8['checkRetriveMax'](0x5,_0x311f87,_0x178075)){if(_0x571612[_0xc3b1('0x17a')]>=_0x178075[_0xc3b1('0x17f')]){_0x3c2ff8[_0xc3b1('0x188')](_0x571612,_0x3bedf4,_0x2b67bb,'reason\x205\x20busy');}else{_0x3c2ff8[_0xc3b1('0x18c')](_0x571612,_0x3bedf4,_0x2b67bb,_0xc3b1('0x18e'));}}break;case'8':_0x178075[_0xc3b1('0x18f')]+=0x1;_0x571612['state']=0x8;_0x571612[_0xc3b1('0xb1')]=_0xc3b1('0x190');_0x571612[_0xc3b1('0x183')]+=0x1;_0x571612[_0xc3b1('0x18a')]+=0x1;_0x3c2ff8[_0xc3b1('0xce')](_0x571612)['catch'](loggerCatch(_0xc3b1('0x191')));if(_0x3c2ff8['checkRetriveMax'](0x8,_0x311f87,_0x178075)){if(_0x571612['countcongestionretry']>=_0x178075['dialCongestionMaxRetry']){_0x3c2ff8[_0xc3b1('0x188')](_0x571612,_0x3bedf4,_0x2b67bb,_0xc3b1('0x192'));}else{_0x3c2ff8[_0xc3b1('0x18c')](_0x571612,_0x3bedf4,_0x2b67bb,_0xc3b1('0x192'));}}break;default:_0x178075[_0xc3b1('0x6d')]+=0x1;_0x571612[_0xc3b1('0xb0')]=0xc;_0x571612[_0xc3b1('0xb1')]=_0x15a040['reason'];_0x3c2ff8[_0xc3b1('0xce')](_0x571612)['catch'](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x3c2ff8[_0xc3b1('0x179')](_0x15a040[_0xc3b1('0xf4')],_0x311f87,_0x178075)){if(_0x571612['countbusyretry']+_0x571612[_0xc3b1('0x183')]+_0x571612[_0xc3b1('0x17b')]>=_0x178075['dialGlobalMaxRetry']){_0x3c2ff8[_0xc3b1('0x18c')](_0x571612,_0x3bedf4,_0x2b67bb,_0x15a040[_0xc3b1('0xf4')]);}else{_0x3c2ff8['createStateFinal'](_0x571612,_0x3bedf4,_0x2b67bb,_0x15a040[_0xc3b1('0xf4')]);}}}});};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x18c')]=function(_0x4862b6,_0x124185,_0x30cd6c,_0x11eaf3){var _0x1c1257=new Final(_0x4862b6);_0x1c1257[_0xc3b1('0xb0')]=0xf;_0x1c1257[_0xc3b1('0xb1')]='Global';this[_0xc3b1('0x188')](_0x1c1257,_0x124185,_0x30cd6c,_0x11eaf3);};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x188')]=function(_0x1aea16,_0x721265,_0x41bf8b,_0x2b3c91){this[_0xc3b1('0xcd')](_0x1aea16)['then'](function(_0x497772){return _0x721265(msgResponse('[callProgressDetecting]',_0xc3b1('0x193'),_0x2b3c91));})['catch'](function(_0x465e26){return _0x41bf8b(msgResponse('[moveContactManagedDialer][0]',_0xc3b1('0x124'),_0xc3b1('0x194')));});};Dialer[_0xc3b1('0x1e')]['predictive']=function(_0x157fd2){var _0x1e3b7e=this;var _0x301667=_0x157fd2['dialPredictiveOptimizationPercentage']/0x64;var _0xaa4dde=_0x157fd2[_0xc3b1('0x102')]/(_0x157fd2[_0xc3b1('0x102')]+_0x157fd2['outboundAnswerCallsDay']);var _0x5df65=Math[_0xc3b1('0x195')](_0x157fd2['predictiveIntervalAvailable']*(_0x157fd2['predictiveIntervalMaxThreshold']/0x64));var _0x2564b8=Math[_0xc3b1('0x195')](_0x157fd2[_0xc3b1('0x196')]*(_0x157fd2[_0xc3b1('0x197')]/0x64));var _0x388f9d=_0x157fd2[_0xc3b1('0x55')]+_0x157fd2['talking'];var _0xb2493a=Math[_0xc3b1('0x198')](_0x157fd2[_0xc3b1('0x76')]*_0x157fd2[_0xc3b1('0x77')]*_0x157fd2[_0xc3b1('0x73')]*_0x157fd2[_0xc3b1('0x199')]);if(_[_0xc3b1('0x43')](_0x157fd2[_0xc3b1('0x95')])){if(!_[_0xc3b1('0x43')](_0x157fd2[_0xc3b1('0x2c')])){_0x157fd2[_0xc3b1('0x2c')]=undefined;loggerPredictive['error'](_0xc3b1('0x19a'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xc3b1('0x43')](_0x157fd2[_0xc3b1('0x98')])){loggerPredictive[_0xc3b1('0x9d')](_0xc3b1('0x19a'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x157fd2[_0xc3b1('0x98')]);_0x157fd2[_0xc3b1('0x98')]=undefined;}_0x157fd2['startProgressive']=moment()[_0xc3b1('0x7d')](_0xc3b1('0xf9'));loggerPredictive[_0xc3b1('0x80')](_0x157fd2['name'],_0xc3b1('0x19b'),_0x157fd2['startProgressive']);this['handlePower'](_0x157fd2,0x1);}else if(ifInterval(_0x157fd2[_0xc3b1('0x19c')],_0x157fd2[_0xc3b1('0x95')])){this[_0xc3b1('0x139')](_0x157fd2,0x1);loggerPredictiveCalls[_0xc3b1('0x80')]('[startMethodPredictive][StartProgressive][Loop]',_0x157fd2[_0xc3b1('0x95')],_0x157fd2['name']);_0x157fd2['erlangCalls']=0x0;_0x157fd2['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x301667<_0xaa4dde&&_0x157fd2[_0xc3b1('0x19d')]===_0xc3b1('0x19e')){freeVariablesPredictive(_0x157fd2);loggerPredictive[_0xc3b1('0x80')]('[stopMethodPredictive][ReStartProgressive][ExceededDropDay]',_0xc3b1('0x19f'),_0xaa4dde,_0xc3b1('0x95'),_0x157fd2['name']);}else if(_0xb2493a<_0x157fd2[_0xc3b1('0x1a0')]&&_0x157fd2[_0xc3b1('0x19d')]===_0xc3b1('0x19e')){freeVariablesPredictive(_0x157fd2);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x1a1'),_0xc3b1('0x1a2'),_0xb2493a,'Drop\x20in\x20this\x20interval',_0x157fd2['predictiveIntervalErlangCallsDroppedCalls'],_0xc3b1('0x95'),_0x157fd2['name']);}else if(!ifInterval(_0x157fd2[_0xc3b1('0x19c')],_0x157fd2[_0xc3b1('0x95')])&&_[_0xc3b1('0x43')](_0x157fd2['startPredictive'])&&!_[_0xc3b1('0x43')](_0x157fd2[_0xc3b1('0x95')])){_0x157fd2['startPredictive']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc3b1('0x80')](_0x157fd2[_0xc3b1('0x46')],_0xc3b1('0x1a3'),_0x157fd2[_0xc3b1('0x2c')]);this[_0xc3b1('0xc4')](_0x157fd2[_0xc3b1('0x19c')])[_0xc3b1('0xbe')](this[_0xc3b1('0x1a4')](_0x157fd2))[_0xc3b1('0xbe')](mergeDataErlangB(_0x157fd2))[_0xc3b1('0xbe')](this[_0xc3b1('0x1a5')](_0x157fd2))['catch'](loggerCatchPredictive(_0xc3b1('0x1a6'),_0x157fd2));}else if(!ifInterval(_0x157fd2['dialPredictiveInterval'],_0x157fd2[_0xc3b1('0x2c')])){_0x157fd2[_0xc3b1('0x1a0')]=0x0;_0x157fd2[_0xc3b1('0x2c')]=moment()[_0xc3b1('0x7d')](_0xc3b1('0xf9'));loggerPredictive[_0xc3b1('0x80')](_0x157fd2[_0xc3b1('0x46')],_0xc3b1('0x1a7'),_0x157fd2['startPredictive']);clearInterval(_0x157fd2[_0xc3b1('0x98')]);_0x157fd2[_0xc3b1('0x98')]=undefined;this[_0xc3b1('0xc4')](_0x157fd2['dialPredictiveInterval'])[_0xc3b1('0xbe')](this[_0xc3b1('0x1a4')](_0x157fd2))['then'](mergeDataErlangB(_0x157fd2))[_0xc3b1('0xbe')](this[_0xc3b1('0x1a5')](_0x157fd2))[_0xc3b1('0xb8')](loggerCatchPredictive(_0xc3b1('0x1a8'),_0x157fd2));}else if(_0x157fd2['predictiveIntervalAvailable']&&_0x388f9d<_0x157fd2[_0xc3b1('0x196')]-_0x2564b8){freeVariablesPredictive(_0x157fd2);loggerPredictive[_0xc3b1('0x80')](_0x157fd2[_0xc3b1('0x46')],_0xc3b1('0x1a9'),_0x388f9d,_0xc3b1('0x1aa'),_0x157fd2[_0xc3b1('0x196')],'-',_0x2564b8,'=',_0x157fd2[_0xc3b1('0x196')]-_0x2564b8,')');}else if(_0x157fd2[_0xc3b1('0x196')]&&_0x388f9d>_0x157fd2[_0xc3b1('0x196')]+_0x5df65){freeVariablesPredictive(_0x157fd2);loggerPredictive['info'](_0x157fd2[_0xc3b1('0x46')],_0xc3b1('0x1a9'),_0x388f9d,_0xc3b1('0x1ab'),_0x157fd2[_0xc3b1('0x196')],'+',_0x5df65,'=',_0x157fd2['predictiveIntervalAvailable']+_0x5df65,')');}};Dialer[_0xc3b1('0x1e')]['getDataPredictive']=function(_0x478e53){var _0x2280f9=this;return function(_0x1b7058){return new BPromise(function(_0x2c3ed4,_0x597394){_[_0xc3b1('0x93')](_0x478e53,_0x1b7058[0x0]);if(checkGetDataPredictive(_0x1b7058[0x0])){var _0x2e6706=_0x478e53['predictiveIntervalAvailable']=_0x478e53[_0xc3b1('0x5a')]+_0x478e53[_0xc3b1('0x55')];var _0x514be2=_0x478e53[_0xc3b1('0x19c')]*0x3c;var _0x562cf9=_0x1b7058[0x0][_0xc3b1('0x70')]+_0x1b7058[0x0]['predictiveIntervalAvgHoldtime'];var _0x3bf090=(_0x1b7058[0x0][_0xc3b1('0x6e')]+_0x1b7058[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x1b7058[0x0][_0xc3b1('0x85')])/_0x1b7058[0x0][_0xc3b1('0x83')];_0x478e53[_0xc3b1('0x73')]=_0x3bf090>0x0?_0x3bf090:0x1;switch(_0x478e53[_0xc3b1('0x19d')]){case _0xc3b1('0x19e'):var _0x34b37c=_0x478e53[_0xc3b1('0x1ac')]/0x64;return _0x2280f9[_0xc3b1('0x1ad')](_0x2e6706,_0x514be2,_0x562cf9,_0x3bf090,_0x34b37c)[_0xc3b1('0xbe')](function(_0x1458cd){return _0x2c3ed4(_0x1458cd);});case _0xc3b1('0x1ae'):var _0x582f7b=_0x478e53[_0xc3b1('0x1ac')]/0x64;return _0x2280f9['busyFactor'](_0x2e6706,_0x514be2,_0x562cf9,_0x3bf090,_0x582f7b)[_0xc3b1('0xbe')](function(_0x2122ac){return _0x2c3ed4(_0x2122ac);});default:return _0x597394(msgResponse('[getDataPredictive]',_0xc3b1('0x124'),'Unknown\x20Predictive'));}}else{return _0x597394(msgResponse(_0xc3b1('0x1af'),_0xc3b1('0x124'),_0xc3b1('0x1b0')));}});};};Dialer['prototype'][_0xc3b1('0x1b1')]=function(_0x2edc62){var _0x207e10=this;return function(_0x507679){return new BPromise(function(_0x11bff0,_0x2c8d14){_[_0xc3b1('0x93')](_0x2edc62,_0x507679[0x0]);if(checkGetDataPredictive(_0x507679[0x0])){loggerPredictive[_0xc3b1('0x80')](JSON['stringify'](_0x507679[0x0]));if(_0x2edc62[_0xc3b1('0x19d')]===_0xc3b1('0x19e')){return _0x207e10[_0xc3b1('0xcb')](_0x2edc62['id'])['then'](function(_0x4fb290){var _0x465bf9=_0x2edc62[_0xc3b1('0x56')]-_0x4fb290[0x0]['outboundQueuePauses'];var _0x221b9e=_0x2edc62[_0xc3b1('0x19c')]*0x3c;var _0x1b883d=_0x507679[0x0]['predictiveIntervalAvgTalktime']+_0x507679[0x0][_0xc3b1('0x6f')];var _0x59c99b=(_0x507679[0x0][_0xc3b1('0x6e')]+_0x507679[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x507679[0x0][_0xc3b1('0x85')])/_0x507679[0x0]['predictiveIntervalTotalCalls'];var _0x59ea04=_0x2edc62[_0xc3b1('0x1ac')]/0x64;_0x2edc62[_0xc3b1('0x74')]=_0x4fb290[0x0]['outboundQueuePauses']||0x0;_0x2edc62[_0xc3b1('0x73')]=_0x59c99b>0x0?_0x59c99b:0x1;return _0x207e10[_0xc3b1('0x1ad')](_0x465bf9,_0x221b9e,_0x1b883d,_0x59c99b,_0x59ea04);})[_0xc3b1('0xbe')](function(_0x3387b7){return _0x11bff0(_0x3387b7);})[_0xc3b1('0xb8')](function(_0x24aab3){return _0x2c8d14(msgResponse('[CatchErlangB]','Failure',JSON[_0xc3b1('0x7c')](_0x24aab3)));});}if(_0x2edc62[_0xc3b1('0x19d')]===_0xc3b1('0x1ae')){return _0x207e10[_0xc3b1('0xcb')](_0x2edc62['id'])[_0xc3b1('0xbe')](function(_0x21b71b){var _0x5b92bb=_0x2edc62['loggedIn']-_0x21b71b[0x0][_0xc3b1('0x1b2')];var _0x4c945a=_0x2edc62['dialPredictiveInterval']*0x3c;var _0xaea4b9=_0x507679[0x0][_0xc3b1('0x70')]+_0x507679[0x0]['predictiveIntervalAvgHoldtime'];var _0x42190c=(_0x507679[0x0]['predictiveIntervalAnsweredCalls']+_0x507679[0x0][_0xc3b1('0x71')]+_0x507679[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x507679[0x0][_0xc3b1('0x83')];var _0x5715d5=_0x2edc62[_0xc3b1('0x1ac')]/0x64;_0x2edc62[_0xc3b1('0x74')]=_0x21b71b[0x0][_0xc3b1('0x1b2')]||0x0;_0x2edc62[_0xc3b1('0x73')]=_0x42190c>0x0?_0x42190c:0x1;return _0x207e10['busyFactor'](_0x5b92bb,_0x4c945a,_0xaea4b9,_0x42190c,_0x5715d5);})[_0xc3b1('0xbe')](function(_0x4f7388){return _0x11bff0(_0x4f7388);})['catch'](function(_0xddc5bc){return _0x2c8d14(msgResponse('[CatchErlangB]','Failure',JSON[_0xc3b1('0x7c')](_0xddc5bc)));});}}else{return _0x2c8d14(msgResponse('[getDataPredictive]',_0xc3b1('0x124'),_0xc3b1('0x1b0')));}});};};Dialer[_0xc3b1('0x1e')]['startMethodPredictive']=function(_0x86216b){var _0x2d53ee=this;return function(){var _0x1a8578=0x0;var _0x50cb81=Math[_0xc3b1('0x198')](_0x86216b[_0xc3b1('0x8f')]*0x3e8);if(_0x50cb81>0x0){_0x50cb81=_0x50cb81<0x64?0x64:_0x50cb81;loggerPredictive[_0xc3b1('0x80')](_0x86216b[_0xc3b1('0x46')],_0xc3b1('0x1b3'),_0x50cb81,'milliseconds');_0x86216b[_0xc3b1('0x98')]=setInterval(function(){_0x2d53ee[_0xc3b1('0x98')](_0x86216b);loggerPredictiveCalls['info'](_0xc3b1('0x1b4'),_0x1a8578+=0x1);},_0x50cb81);}else{loggerPredictive[_0xc3b1('0x80')](_0x86216b['name'],_0xc3b1('0x1b5'));}};};Dialer['prototype'][_0xc3b1('0x1b6')]=function(_0x3f3df6,_0x5dacfd){var _0xb6a479=this;return function(_0x4f77e5){if(_[_0xc3b1('0x4c')](_0x4f77e5)){if(_['isNil'](_0x5dacfd[_0xc3b1('0xd4')])||!_0x5dacfd[_0xc3b1('0x1b7')]){if(_0x3f3df6[_0xc3b1('0x61')]===_0xc3b1('0x9')){_0x3f3df6['queueStatusComplete']=_['isUndefined'](_0x3f3df6[_0xc3b1('0x10d')])?!![]:_0x3f3df6['queueStatusComplete'];var _0x9ba5fa=uuid['v4']();_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa]=new Action(_0x3f3df6,_0x5dacfd,_0x9ba5fa);loggerBooked[_0xc3b1('0x80')](_0xc3b1('0x1b8'),_0x9ba5fa,_0xc3b1('0x1b9'),JSON[_0xc3b1('0x7c')](_0x3f3df6[_0xc3b1('0x10d')]),_0xc3b1('0x1ba'),_0x3f3df6[_0xc3b1('0x46')]);if(_0x3f3df6['queueStatusComplete']){_0x3f3df6[_0xc3b1('0x10d')]=![];_0xb6a479['queueBooked'][_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa][_0xc3b1('0xbc')]]=[];ami[_0xc3b1('0xb6')]({'actionid':_0x9ba5fa,'action':_0xc3b1('0x1bb'),'queue':_0x3f3df6[_0xc3b1('0x46')]})[_0xc3b1('0xb8')](function(_0x54cf93){_0xb6a479['updateOriginated'](_0x3f3df6);_0xb6a479[_0xc3b1('0xc7')]({'active':![],'ContactId':_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa][_0xc3b1('0xd2')],'ListId':_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa][_0xc3b1('0xd3')],'VoiceQueueId':_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa][_0xc3b1('0xd5')]||undefined,'CampaignId':_0xb6a479['actions'][_0x9ba5fa][_0xc3b1('0xd6')]||undefined})[_0xc3b1('0xb8')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xb6a479[_0xc3b1('0x29')][_0x9ba5fa];});}else{loggerBooked[_0xc3b1('0x80')](_0xc3b1('0x1bc'),JSON[_0xc3b1('0x7c')](_0x3f3df6[_0xc3b1('0x10d')]),'Queue:\x20',_0x3f3df6[_0xc3b1('0x46')]);_0xb6a479[_0xc3b1('0xbb')](_0x3f3df6);_0xb6a479['rescheduleContact']({'active':![],'ContactId':_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa]['ContactId'],'ListId':_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa][_0xc3b1('0xd3')],'VoiceQueueId':_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa]['VoiceQueueId']||undefined,'CampaignId':_0xb6a479[_0xc3b1('0x29')][_0x9ba5fa]['CampaignId']||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0xb6a479['actions'][_0x9ba5fa];}}else{return _0xb6a479[_0xc3b1('0x147')](_0x3f3df6,_0x5dacfd);}}else{if(getDiff(_0x5dacfd[_0xc3b1('0x1bd')])<_0x3f3df6['dialRecallMeTimeout']*0x3c){_0xb6a479[_0xc3b1('0x22')]['run'](_0x5dacfd['id'])['finally'](function(){_0xb6a479[_0xc3b1('0xbb')](_0x3f3df6);});}else{_0x3f3df6[_0xc3b1('0x6b')]+=0x1;_0xb6a479[_0xc3b1('0xbb')](_0x3f3df6);if(_0x3f3df6[_0xc3b1('0x1be')]){_0xb6a479['rescheduleContact']({'active':![],'recallme':![],'UserId':null,'ContactId':_0x5dacfd['ContactId'],'ListId':_0x5dacfd[_0xc3b1('0xd3')],'VoiceQueueId':_0x5dacfd['VoiceQueueId']||undefined,'CampaignId':_0x5dacfd[_0xc3b1('0xd6')]||undefined})[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0x1bf')));_0xb6a479['createHistory'](createObjHistory(_0x3f3df6,_0x5dacfd,_0xc3b1('0x1c0'),0x17,_0xc3b1('0x1c1')))['catch'](loggerCatch(_0xc3b1('0x1c2')));}else{_0xb6a479[_0xc3b1('0xd0')](createObjHistory(_0x3f3df6,_0x5dacfd,_0xc3b1('0x1c3'),0x16,'RecallFailedTimeout'),_0xc3b1('0x1c4'),_0xc3b1('0x1c5'));}}}}else{_0x3f3df6[_0xc3b1('0x1c6')]+=0x1;_0xb6a479[_0xc3b1('0xd0')](createObjHistory(_0x3f3df6,_0x5dacfd,_0xc3b1('0x1c7'),0xd,_0xc3b1('0x1c8')),'[Originate][historyBlacklist]',_0xc3b1('0x1c9'));throw _0xc3b1('0x1ca');}};};Dialer['prototype'][_0xc3b1('0x1cb')]=function(_0x24fcd4){var _0x2a5f59=this;var _0x20b262=[];var _0x4f1b9c=_0x24fcd4[_0xc3b1('0x1cc')]-_0x24fcd4[_0xc3b1('0x75')]-_0x24fcd4[_0xc3b1('0x1cd')];emitCampaignSummary(_0x24fcd4);if(_0x4f1b9c>0x0){if(_0x4f1b9c>this[_0xc3b1('0x27')]){_0x4f1b9c=this[_0xc3b1('0x27')];}_0x24fcd4[_0xc3b1('0x1cd')]+=_0x4f1b9c;this['getContactDialerIvr'](_0x24fcd4['id'],_0x4f1b9c,_0x24fcd4[_0xc3b1('0x1ce')])['then'](function(_0x2305d4){_0x24fcd4[_0xc3b1('0x1cd')]-=_0x4f1b9c;_0x24fcd4[_0xc3b1('0x1cd')]=_0x24fcd4[_0xc3b1('0x1cd')]>0x0?_0x24fcd4[_0xc3b1('0x1cd')]:0x0;if(!checkContactEmpty(_0x2305d4)){_0x24fcd4[_0xc3b1('0x44')]=_0xc3b1('0xa8');logger[_0xc3b1('0x80')]('[getContactCampaign2][Empty]'+_0x24fcd4[_0xc3b1('0x46')]);}else{_0x24fcd4[_0xc3b1('0x75')]+=_0x2305d4[_0xc3b1('0xa0')];_0x24fcd4[_0xc3b1('0x44')]=_0xc3b1('0x1cf');for(var _0x195b37=0x0;_0x195b37<_0x2305d4[_0xc3b1('0xa0')];_0x195b37+=0x1){_0x24fcd4[_0xc3b1('0x1d0')]+=0x1;if(_[_0xc3b1('0xda')](_0x2305d4[_0x195b37])||_[_0xc3b1('0xda')](_0x2305d4[_0x195b37]['Contact'])||_[_0xc3b1('0xda')](_0x2305d4[_0x195b37][_0xc3b1('0x14b')][_0xc3b1('0x14c')])){_0x2a5f59[_0xc3b1('0x1d1')](_0xc3b1('0x1d2'),_0x24fcd4,_0x2305d4[_0x195b37]);}else{_0x2a5f59[_0xc3b1('0xc3')](_[_0xc3b1('0xd1')](_0x2305d4[_0x195b37],['CampaignId',_0xc3b1('0x1d3')]))['then'](_0x2a5f59['checkContactBlack'](_0x24fcd4,_0x2305d4[_0x195b37]))[_0xc3b1('0xb8')](_0x2a5f59[_0xc3b1('0xcf')](_0xc3b1('0x1d4'),_0x24fcd4));}}}})['catch'](loggerGetContactDialer(_0xc3b1('0x1d5'),_0x24fcd4,_0x4f1b9c));}};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x139')]=function(_0x34011e,_0x424032){var _0x21ff1b=this;var _0x292056=[];var _0x335f52=_0x424032>=0x1?_0x424032:0x1;var _0x24e28d=[];if(_0x34011e[_0xc3b1('0x61')]===_0xc3b1('0x9')){_0x335f52=0x1;}var _0x17f38c=Math[_0xc3b1('0x198')](_0x34011e['available']*_0x335f52)-_0x34011e['originated']-_0x34011e[_0xc3b1('0x1cd')];emitVoiceQueueSummary(_0x34011e);if(_0x34011e['dialLimitQueue']>0x0){var _0x2c78d6=_0x34011e[_0xc3b1('0x1d6')]-_0x34011e[_0xc3b1('0x75')]-_0x34011e[_0xc3b1('0x5a')]-_0x34011e[_0xc3b1('0x1cd')]-_0x34011e[_0xc3b1('0x57')];if(_0x17f38c>_0x2c78d6){_0x17f38c=_0x2c78d6;}}if(_0x17f38c>0x0){if(_0x34011e[_0xc3b1('0x61')]===_0xc3b1('0x9')){_0x17f38c=0x1;}if(_0x17f38c>this[_0xc3b1('0x27')]){_0x17f38c=this[_0xc3b1('0x27')];}_0x34011e[_0xc3b1('0x1cd')]+=_0x17f38c;for(var _0x12b6a8 in this[_0xc3b1('0x25')]){if(this[_0xc3b1('0x25')][_0xc3b1('0xa1')](_0x12b6a8)){if(this[_0xc3b1('0x25')][_0x12b6a8][_0xc3b1('0xb0')]==='not_inuse'&&this[_0xc3b1('0x25')][_0x12b6a8][_0xc3b1('0xb7')]===_0xc3b1('0x1d7')){_0x292056['push'](this['agents'][_0x12b6a8]['id']);}}}this[_0xc3b1('0xc8')](_0x34011e['id'],_0x292056,_0x17f38c,_0x34011e[_0xc3b1('0x1ce')])[_0xc3b1('0xbe')](function(_0x35ae0f){_0x34011e[_0xc3b1('0x1cd')]-=_0x17f38c;_0x34011e['temp']=_0x34011e[_0xc3b1('0x1cd')]>0x0?_0x34011e[_0xc3b1('0x1cd')]:0x0;if(!checkContactEmpty(_0x35ae0f)){_0x21ff1b[_0xc3b1('0xbf')](_0x34011e)[_0xc3b1('0xbe')](sendMessageReschedule(_0x34011e))[_0xc3b1('0xb8')](loggerCatch(_0xc3b1('0x1d8')));}else{_0x34011e[_0xc3b1('0x75')]+=_0x35ae0f[_0xc3b1('0xa0')];_0x34011e[_0xc3b1('0x44')]=_0x34011e[_0xc3b1('0x61')]===_0xc3b1('0x9')?'ACTIVE':_0xc3b1('0x1cf');for(var _0x345f5d=0x0;_0x345f5d<_0x35ae0f[_0xc3b1('0xa0')];_0x345f5d+=0x1){if(_[_0xc3b1('0xda')](_0x35ae0f[_0x345f5d])||_[_0xc3b1('0xda')](_0x35ae0f[_0x345f5d][_0xc3b1('0x14b')])||_[_0xc3b1('0xda')](_0x35ae0f[_0x345f5d][_0xc3b1('0x14b')][_0xc3b1('0x14c')])){_0x21ff1b[_0xc3b1('0x1d1')](_0xc3b1('0x1d2'),_0x34011e,_0x35ae0f[_0x345f5d]);}else{_0x21ff1b[_0xc3b1('0xc0')](_[_0xc3b1('0xd1')](_0x35ae0f[_0x345f5d],['VoiceQueueId','Contact.phone']))[_0xc3b1('0xbe')](_0x21ff1b[_0xc3b1('0x1b6')](_0x34011e,_0x35ae0f[_0x345f5d]))[_0xc3b1('0xb8')](_0x21ff1b[_0xc3b1('0xcf')]('[actionOriginate]\x20',_0x34011e));}}}})[_0xc3b1('0xb8')](loggerGetContactDialer('[getContactDialer2]',_0x34011e,_0x17f38c));}};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x98')]=function(_0x31b8ec){var _0xccaa08=this;if(_0x31b8ec[_0xc3b1('0x1d6')]>0x0){var _0x594944=_0x31b8ec[_0xc3b1('0x1d6')]-_0x31b8ec['originated']-_0x31b8ec['talking'];if(_0x594944>0x0){this['tryOriginatePredictive'](_0x31b8ec);}else{loggerPredictiveCalls[_0xc3b1('0x80')](_0xc3b1('0x1d9'));}}else{this[_0xc3b1('0x1da')](_0x31b8ec);}};Dialer[_0xc3b1('0x1e')]['tryOriginatePredictive']=function(_0xd37fcf){var _0x36f880=this;var _0x52ce0c=[];_0xd37fcf[_0xc3b1('0x75')]+=0x1;for(var _0x13dcfe in this['agents']){if(this[_0xc3b1('0x25')][_0xc3b1('0xa1')](_0x13dcfe)){if(this[_0xc3b1('0x25')][_0x13dcfe][_0xc3b1('0xb0')]===_0xc3b1('0x1db')&&this[_0xc3b1('0x25')][_0x13dcfe][_0xc3b1('0xb7')]==='reachable'){_0x52ce0c[_0xc3b1('0x129')](this[_0xc3b1('0x25')][_0x13dcfe]['id']);}}}this[_0xc3b1('0xc8')](_0xd37fcf['id'],_0x52ce0c,0x1,_0xd37fcf[_0xc3b1('0x1ce')])[_0xc3b1('0xbe')](function(_0x4aef5f){if(!checkContactEmpty(_0x4aef5f)){checkContactLowerLimitOriginate(_0xd37fcf,0x1,0x0);_0x36f880[_0xc3b1('0xbf')](_0xd37fcf)[_0xc3b1('0xbe')](sendMessageReschedule(_0xd37fcf))[_0xc3b1('0xb8')](loggerCatch('[countReScheduled]\x20'));}else{_0xd37fcf['message']=_0xc3b1('0x1cf');if(_[_0xc3b1('0xda')](_0x4aef5f[0x0])||_[_0xc3b1('0xda')](_0x4aef5f[0x0]['Contact'])||_[_0xc3b1('0xda')](_0x4aef5f[0x0]['Contact']['phone'])){_0x36f880[_0xc3b1('0x1d1')](_0xc3b1('0x1d2'),_0xd37fcf,_0x4aef5f[0x0]);}else{_0x36f880[_0xc3b1('0xc0')](_[_0xc3b1('0xd1')](_0x4aef5f[0x0],['VoiceQueueId','Contact.phone']))[_0xc3b1('0xbe')](_0x36f880[_0xc3b1('0x1b6')](_0xd37fcf,_0x4aef5f[0x0]))[_0xc3b1('0xb8')](_0x36f880[_0xc3b1('0xcf')](_0xc3b1('0x1dc'),_0xd37fcf));}}})[_0xc3b1('0xb8')](loggerGetContactDialer(_0xc3b1('0x1dd'),_0xd37fcf,0x1));emitVoiceQueueSummary(_0xd37fcf);};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x1ad')]=function(_0x119276,_0x5016c9,_0x5ae436,_0x436c1e,_0x564cfd,_0x276648){loggerPredictive[_0xc3b1('0x80')]('--------\x20Drop\x20Rate\x20--------');loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x1de'),_0x119276);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x1df'),_0x5016c9);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x1e0'),_0x5ae436);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x1e1'),_0x436c1e);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x1e2'),_0x564cfd);loggerPredictive['info'](_0xc3b1('0x92'));return new BPromise(function(_0x58bc84,_0x1abde1){if(_0x119276<=0x0||isNaN(_0x119276)){return _0x1abde1(msgResponse(_0xc3b1('0x1e3'),'Error',_0xc3b1('0x1e4')+_0x119276));}if(_0x5ae436<=0x0||isNaN(_0x5ae436)){return _0x1abde1(msgResponse(_0xc3b1('0x1e3'),_0xc3b1('0x4f'),_0xc3b1('0x1e5')+_0x5ae436));}if(_0x436c1e<=0x0||isNaN(_0x436c1e)){return _0x1abde1(msgResponse(_0xc3b1('0x1e3'),_0xc3b1('0x4f'),_0xc3b1('0x1e6')+_0x436c1e));}if(_0x5016c9<=0x0||isNaN(_0x5016c9)){return _0x1abde1(msgResponse(_0xc3b1('0x1e3'),_0xc3b1('0x4f'),_0xc3b1('0x1e7')+_0x5016c9));}if(_0x564cfd<=0x0||isNaN(_0x564cfd)){return _0x1abde1(msgResponse('[abandonmentRate]','Error',_0xc3b1('0x1e8')+_0x564cfd));}_0x276648=_0x276648||0x0;var _0x44a830=0x1/_0x5ae436;var _0x259386=0x0;var _0x3c2396=0x0;var _0x3429db=0x0;var _0x204d07=0x0;for(var _0x3dcf2a=0x0;_0x3429db<_0x564cfd;_0x3dcf2a+=0x1){_0x3c2396=_0x3dcf2a/_0x5016c9;_0x259386=(_0x436c1e*_0x3c2396+_0x276648)/_0x44a830;_0x3429db=erlangb(_0x259386,_0x119276);_0x204d07=_0x259386/_0x119276*(0x1-erlangb(_0x259386,_0x119276));}return _0x58bc84({'erlangCalls':_0x3dcf2a,'erlangCallToSecond':_0x5016c9/_0x3dcf2a,'erlangAbandonmentRate':_0x3429db,'erlangBusyFactor':_0x204d07});});};Dialer[_0xc3b1('0x1e')][_0xc3b1('0x1e9')]=function(_0x11bd7f,_0x20c3e1,_0xc4bb32,_0x39766c,_0x4e0b36,_0x1bedcd){loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x1ea'));loggerPredictive['info'](_0xc3b1('0x1de'),_0x11bd7f);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x1df'),_0x20c3e1);loggerPredictive['info'](_0xc3b1('0x1e0'),_0xc4bb32);loggerPredictive['info'](_0xc3b1('0x1e1'),_0x39766c);loggerPredictive['info']('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4e0b36);loggerPredictive[_0xc3b1('0x80')](_0xc3b1('0x92'));return new BPromise(function(_0x350036,_0x2c2f99){if(_0x11bd7f<=0x0||isNaN(_0x11bd7f)){return _0x2c2f99(msgResponse(_0xc3b1('0x1eb'),_0xc3b1('0x4f'),_0xc3b1('0x1e4')+_0x11bd7f));}if(_0xc4bb32<=0x0||isNaN(_0xc4bb32)){return _0x2c2f99(msgResponse(_0xc3b1('0x1eb'),_0xc3b1('0x4f'),_0xc3b1('0x1e5')+_0xc4bb32));}if(_0x39766c<=0x0||isNaN(_0x39766c)){return _0x2c2f99(msgResponse(_0xc3b1('0x1eb'),'Error','p\x20=\x20'+_0x39766c));}if(_0x20c3e1<=0x0||isNaN(_0x20c3e1)){return _0x2c2f99(msgResponse(_0xc3b1('0x1eb'),_0xc3b1('0x4f'),_0xc3b1('0x1e7')+_0x20c3e1));}if(_0x4e0b36<=0x0||isNaN(_0x4e0b36)){return _0x2c2f99(msgResponse('[busyFactor]',_0xc3b1('0x4f'),_0xc3b1('0x1ec')+_0x4e0b36));}_0x1bedcd=_0x1bedcd||0x0;var _0xf775a6=0x1/_0xc4bb32;var _0x4cc6fd=0x0;var _0x208229=0x0;var _0x4321c4=0x0;var _0x444ceb=0x0;for(var _0x387f0e=0x0;_0x444ceb<_0x4e0b36;_0x387f0e+=0x1){_0x208229=_0x387f0e/_0x20c3e1;_0x4cc6fd=(_0x39766c*_0x208229+_0x1bedcd)/_0xf775a6;_0x4321c4=erlangb(_0x4cc6fd,_0x11bd7f);_0x444ceb=_0x4cc6fd/_0x11bd7f*(0x1-erlangb(_0x4cc6fd,_0x11bd7f));}return _0x350036({'erlangCalls':_0x387f0e,'erlangCallToSecond':_0x20c3e1/_0x387f0e,'erlangAbandonmentRate':_0x4321c4,'erlangBusyFactor':_0x444ceb});});};module[_0xc3b1('0x1ed')]=Dialer; \ No newline at end of file +var _0x6b6c=['[syncAgentComplete][createHistory]','answertime','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','responsetime','outboundDropCallsDayTimeout','dropreason','TIMEOUT','dialQueueProject2','outboundDropCallsDayCallersExit','Abandoned','CALLEREXIT','actions','actionid','locked','stateinterface','queueBooked','push','pick','idHopper','paused','queueStatusComplete','[booked][unlockQueueStatus]','[Catch][Preview][syncQueueStatusComplete]','finally','CampaignId','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','Failure','INTERVAL_IS_EMPTY','\x20Intervals\x20is\x20empty\x20','\x20Timezone\x20unknow\x20','isArray','command','iftime\x20%s,%s','interval','timezones','indexOf','true','all','INTERVAL_IS_OVERTIME','Global:\x20','Timezone:\x20','checkDialMethod','dialMethod','handlePower','dialPowerLevel','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialTimezone','[syncQueueSummary]','dialGlobalInterval','[syncCampaigns]','\x5cw{0,','pow','replace','random','actionOriginate','object','Contact','phone','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','xcally-motion-dialer','dialAMDInitialSilence','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','callerid','dialRandomLastDigitCallerIdNumber','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','originate','SIP/%s/%s%s','trim','dialCutDigit','substring','from-sip','OriginateError','endtime','[originate][error]','Error','originate\x20action\x20Error','callProgressDetecting','[callProgressDetecting]\x20','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','[rescheduleContact][NoAnswer]','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','checkRetriveMax','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','outboundNoAnswerCallsDay','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','countglobal','[syncAgentComplete][createHistory][5]','dialBusyMaxRetry','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(','getDataPredictive','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','agentBusyFactor','[CatchErlangB]','erlangCallToSecond','one\x20call\x20every:','[handlePredictive]','checkContactBlack','recallme','[booked][checkContactBlack]','Queue:\x20','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','RUNNING','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[getContactCampaign2]','dialLimitQueue','not_inuse','[getContactDialer2]','[handlePredictive][limitChannel]','tryOriginatePredictive','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','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','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','ioredis','../../../config/environment/','../../../config/logger','dialer','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','./action','./history','./final','./agentComplete','./queueCallerAbandon','./hangup','env','XCALLY_IP_AGI','127.0.0.1','rrmemory','roundrobin','enqueue','tail','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','syncVarSet','queuemember','syncQueueMember','queuestatuscomplete','syncQueueStatusComplete','loopCampaigns','isUndefined','message','AGENTS_NOT_LOGGED','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','name','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','stringify','milliseconds','diff','emit','type','outbound','strategy','answered','available','loggedIn','pTalking','sumDuration','talking','total','unmanaged','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','originated','erlangCalls','erlangAbandonmentRate','Trunk','active','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalDroppedCallsTimeout','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','---------------------------','predictiveIntervalTotalCalls','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangBusyFactor','merge','seconds','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','string','\x22%s\x22\x20<%s>','error','inspect','stack','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','IS_DISACTIVED','state','statedesc','starttime','prototype','loopClearZombieChannels','clearZombieChannels','[actions]','Action','channel','queue','[Dialer][checkChannel]','updateOriginated','[Dialer][checkChannel][ivr]','countReScheduled','then','catch','[countReScheduled]\x20','checkIsBlackList','resolve','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','rescheduleContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','moveContactManagedDialer','createHistory','[createHistory]\x20','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','ContactId','ListId','UserId','VoiceQueueId','[emptyContact]','isSuccess','Success','isTrunkReachable','status','reachable','unmonitored','uniqueId','isNil','variable','exten','dialAMDActive','HANGUP','uniqueid','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','value','Machine','amd','[syncMachine][createHistory]','[syncMachine]','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','outboundUnknownCallsDay','cause-txt','Unknow','reason','agent','agiafterat','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x2d2e60,_0x174813){var _0x29960b=function(_0x29feca){while(--_0x29feca){_0x2d2e60['push'](_0x2d2e60['shift']());}};_0x29960b(++_0x174813);}(_0x6b6c,0xf6));var _0xc6b6=function(_0x58b1cc,_0x2ff87a){_0x58b1cc=_0x58b1cc-0x0;var _0x1ff9ba=_0x6b6c[_0x58b1cc];return _0x1ff9ba;};'use strict';var util=require(_0xc6b6('0x0'));var _=require('lodash');var BPromise=require(_0xc6b6('0x1'));var uuid=require(_0xc6b6('0x2'));var moment=require(_0xc6b6('0x3'));var rr=require('rr');var md5=require(_0xc6b6('0x4'));var Redis=require(_0xc6b6('0x5'));var config=require(_0xc6b6('0x6'));var logger=require(_0xc6b6('0x7'))(_0xc6b6('0x8'));var loggerBooked=require(_0xc6b6('0x7'))(_0xc6b6('0x9'));var loggerPredictive=require(_0xc6b6('0x7'))(_0xc6b6('0xa'));var loggerPredictiveCalls=require('../../../config/logger')(_0xc6b6('0xb'));var loggerSyncQueueSummary=require(_0xc6b6('0x7'))(_0xc6b6('0xc'));var ami=require(_0xc6b6('0xd'));config[_0xc6b6('0xe')]=_['defaults'](config[_0xc6b6('0xe')],{'host':_0xc6b6('0xf'),'port':0x18eb});var io=require(_0xc6b6('0x10'))(new Redis(config[_0xc6b6('0xe')]));var cmHopper=require(_0xc6b6('0x11'));var cmHopperFinal=require(_0xc6b6('0x12'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xc6b6('0x13'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xc6b6('0x14'));var History=require(_0xc6b6('0x15'));var Final=require(_0xc6b6('0x16'));var AgentComplete=require(_0xc6b6('0x17'));var QueueCallerAbandon=require(_0xc6b6('0x18'));var Hangup=require(_0xc6b6('0x19'));var ipAgi=process[_0xc6b6('0x1a')][_0xc6b6('0x1b')]||_0xc6b6('0x1c');var strategy={'rrmemory':_0xc6b6('0x1d'),'roundrobin':_0xc6b6('0x1e')};var Sequence=function(){};Sequence['prototype'][_0xc6b6('0x1f')]=function(_0x43f4df){this['tail']=this[_0xc6b6('0x20')]?this[_0xc6b6('0x20')]['finally'](_0x43f4df):_0x43f4df();};function Dialer(_0x106eb3,_0x3797df){this['sequence']=new Sequence();this[_0xc6b6('0x21')]=_0x3797df;this[_0xc6b6('0x22')]=_0x106eb3[_0xc6b6('0x22')];this[_0xc6b6('0x23')]=_0x106eb3['campaigns'];this['agents']=_0x106eb3[_0xc6b6('0x24')];this[_0xc6b6('0x25')]=_0x106eb3['trunks'];this[_0xc6b6('0x26')]=config['maxNumberOriginate']||0x2;this[_0xc6b6('0x27')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this['optionPredictive']={};this[_0xc6b6('0x28')]={};this[_0xc6b6('0x29')]={};this[_0xc6b6('0x2a')]={};this['queueBooked']={};this[_0xc6b6('0x2b')]={};ami['on'](_0xc6b6('0x2c'),this['syncAgentConnect'][_0xc6b6('0x2d')](this));ami['on'](_0xc6b6('0x2e'),this[_0xc6b6('0x2f')]['bind'](this));ami['on'](_0xc6b6('0x30'),this[_0xc6b6('0x31')][_0xc6b6('0x2d')](this));ami['on'](_0xc6b6('0x32'),this['syncAgentComplete'][_0xc6b6('0x2d')](this));ami['on'](_0xc6b6('0x33'),this[_0xc6b6('0xc')][_0xc6b6('0x2d')](this));ami['on'](_0xc6b6('0x34'),this[_0xc6b6('0x35')]['bind'](this));ami['on'](_0xc6b6('0x36'),this[_0xc6b6('0x37')][_0xc6b6('0x2d')](this));ami['on'](_0xc6b6('0x38'),this[_0xc6b6('0x39')]['bind'](this));ami['on'](_0xc6b6('0x3a'),this[_0xc6b6('0x3b')][_0xc6b6('0x2d')](this));ami['on'](_0xc6b6('0x3c'),this[_0xc6b6('0x3d')][_0xc6b6('0x2d')](this));this[_0xc6b6('0x3e')]();this['loopClearZombieChannels']();}function isNotNull(_0x234d4d){return _0x234d4d!==null&&!_[_0xc6b6('0x3f')](_0x234d4d);}function checkIsLoggedIn(_0x1cf9c2,_0x51a204){return function(){if(_0x51a204<=0x0){_0x1cf9c2[_0xc6b6('0x40')]=_0xc6b6('0x41');throw _0x1cf9c2['name']+_0xc6b6('0x42');}};}function isActive(_0x33df5a){return _0x33df5a;}function checkIsActive(_0x3b881b,_0x49698e){return function(){if(!isActive(_0x49698e)){_0x3b881b[_0xc6b6('0x40')]=_0xc6b6('0x43');throw _0x3b881b[_0xc6b6('0x44')]+_0xc6b6('0x45');}};}function checkInterval(_0x9b02f9){return function(){if(!isNotNull(_0x9b02f9[_0xc6b6('0x46')])){_0x9b02f9['message']=_0xc6b6('0x47');throw _0x9b02f9[_0xc6b6('0x44')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x9b02f9[_0xc6b6('0x46')][_0xc6b6('0x48')])){_0x9b02f9[_0xc6b6('0x40')]=_0xc6b6('0x47');throw _0x9b02f9[_0xc6b6('0x44')]+_0xc6b6('0x49');}if(!isNotNull(_[_0xc6b6('0x4a')](_0x9b02f9[_0xc6b6('0x46')][_0xc6b6('0x48')]))){_0x9b02f9[_0xc6b6('0x40')]=_0xc6b6('0x47');throw _0x9b02f9[_0xc6b6('0x44')]+_0xc6b6('0x49');}};}function msgResponse(_0x2d88b2,_0x561a33,_0x2d3e7a){return{'action':_0x2d88b2,'response':_0x561a33,'message':_0x2d3e7a,'stack':_0x2d3e7a};}function myreject(_0x7f8bf6){return function(_0x214faa){return _0x7f8bf6(msgResponse(_0xc6b6('0x4b'),'Error',JSON[_0xc6b6('0x4c')](_0x214faa)));};}function getSeconds(_0x1c6dd4,_0x1796b5){var _0x2b7354=moment(_0x1c6dd4)[_0xc6b6('0x4d')](0x0);var _0x5d2f20=moment(_0x1796b5)[_0xc6b6('0x4d')](0x0);return _0x2b7354[_0xc6b6('0x4e')](_0x5d2f20,'seconds');}function emit(_0x53191b,_0x6a6360,_0x1c193a){io['to'](_0x53191b)[_0xc6b6('0x4f')](_0x6a6360,_0x1c193a);}function emitVoiceQueueSummary(_0x5680bf){if(_0x5680bf[_0xc6b6('0x50')]===_0xc6b6('0x51')){var _0x46cef0={'id':_0x5680bf['id'],'name':_0x5680bf[_0xc6b6('0x44')],'strategy':_0x5680bf[_0xc6b6('0x52')],'answered':_0x5680bf[_0xc6b6('0x53')],'available':_0x5680bf[_0xc6b6('0x54')],'loggedIn':_0x5680bf[_0xc6b6('0x55')],'pTalking':_0x5680bf[_0xc6b6('0x56')],'sumBillable':_0x5680bf['sumBillable'],'sumDuration':_0x5680bf[_0xc6b6('0x57')],'sumHoldTime':_0x5680bf['sumHoldTime']||0x0,'talking':_0x5680bf[_0xc6b6('0x58')],'total':_0x5680bf[_0xc6b6('0x59')],'type':_0x5680bf[_0xc6b6('0x50')],'unmanaged':_0x5680bf[_0xc6b6('0x5a')],'abandoned':_0x5680bf['abandoned'],'waiting':_0x5680bf['waiting'],'loggedInDb':_0x5680bf['loggedInDb'],'dialActive':_0x5680bf[_0xc6b6('0x5b')],'dialMethod':_0x5680bf['dialMethod'],'dialOriginateCallerIdName':_0x5680bf[_0xc6b6('0x5c')],'dialOriginateCallerIdNumber':_0x5680bf[_0xc6b6('0x5d')],'dialOriginateTimeout':_0x5680bf[_0xc6b6('0x5e')],'dialPrefix':_0x5680bf[_0xc6b6('0x5f')],'outboundAnswerAgiCallsDay':_0x5680bf[_0xc6b6('0x60')],'outboundAnswerCallsDay':_0x5680bf[_0xc6b6('0x61')],'outboundBlacklistCallsDay':_0x5680bf['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x5680bf['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x5680bf[_0xc6b6('0x62')],'outboundDropCallsDayACS':_0x5680bf[_0xc6b6('0x63')],'outboundDropCallsDayCallersExit':_0x5680bf['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x5680bf['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x5680bf['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x5680bf['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x5680bf[_0xc6b6('0x64')],'outboundReCallsDay':_0x5680bf[_0xc6b6('0x65')],'outboundRejectCallsDay':_0x5680bf[_0xc6b6('0x66')],'outboundUnknownCallsDay':_0x5680bf['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x5680bf[_0xc6b6('0x67')],'predictiveIntervalAvgHoldtime':_0x5680bf[_0xc6b6('0x68')],'predictiveIntervalAvgTalktime':_0x5680bf[_0xc6b6('0x69')],'predictiveIntervalDroppedCallsCallersExit':_0x5680bf[_0xc6b6('0x6a')],'predictiveIntervalDroppedCallsTimeout':_0x5680bf['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5680bf[_0xc6b6('0x6b')],'predictiveIntervalErlangCallsDroppedCalls':_0x5680bf[_0xc6b6('0x6c')],'predictiveIntervalHitRate':_0x5680bf[_0xc6b6('0x6d')],'predictiveIntervalMultiplicativeFactor':_0x5680bf[_0xc6b6('0x6e')],'predictiveIntervalPauses':_0x5680bf[_0xc6b6('0x6f')],'predictiveIntervalAvailable':_0x5680bf[_0xc6b6('0x70')],'predictiveIntervalTotalCalls':_0x5680bf['predictiveIntervalTotalCalls'],'message':_0x5680bf[_0xc6b6('0x40')],'originated':_0x5680bf[_0xc6b6('0x71')],'erlangCalls':_0x5680bf[_0xc6b6('0x72')],'erlangCallToSecond':_0x5680bf['erlangCallToSecond'],'erlangAbandonmentRate':_0x5680bf[_0xc6b6('0x73')],'erlangBusyFactor':_0x5680bf['erlangBusyFactor'],'startPredictive':_0x5680bf[_0xc6b6('0x28')],'startProgressive':_0x5680bf['startProgressive']};if(_0x5680bf['Trunk']){_0x46cef0[_0xc6b6('0x74')]={'id':_0x5680bf[_0xc6b6('0x74')]['id'],'name':_0x5680bf[_0xc6b6('0x74')]['name'],'active':_0x5680bf[_0xc6b6('0x74')][_0xc6b6('0x75')],'callerid':_0x5680bf[_0xc6b6('0x74')]['callerid']};}if(_0x5680bf[_0xc6b6('0x46')]){_0x46cef0[_0xc6b6('0x46')]={'id':_0x5680bf[_0xc6b6('0x46')]['id'],'name':_0x5680bf[_0xc6b6('0x46')][_0xc6b6('0x44')]};}var _0x120e72=md5(JSON[_0xc6b6('0x4c')](_0x46cef0));if(_0x5680bf[_0xc6b6('0x4')]!==_0x120e72){_0x5680bf[_0xc6b6('0x4')]=_0x120e72;emit(util[_0xc6b6('0x76')](_0xc6b6('0x77'),_0x46cef0['name']),'voice_queue:save',_0x46cef0);}}}function emitCampaignSummary(_0x1b6404){if(_0x1b6404[_0xc6b6('0x50')]===_0xc6b6('0x78')){emit(util[_0xc6b6('0x76')](_0xc6b6('0x79'),_0x1b6404[_0xc6b6('0x44')]),_0xc6b6('0x7a'),_0x1b6404);}}function checkGetDataPredictive(_0x13447b){if(isNotNull(_0x13447b)){if(!_[_0xc6b6('0x4a')](_0x13447b)){loggerPredictive['info'](_0xc6b6('0x7b'));loggerPredictive[_0xc6b6('0x7c')]('Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x13447b['predictiveIntervalTotalCalls']);loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x7d'),_0x13447b['predictiveIntervalAnsweredCalls']);loggerPredictive[_0xc6b6('0x7c')]('Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x13447b[_0xc6b6('0x7e')]);loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x7f'),_0x13447b['predictiveIntervalDroppedCallsCallersExit']);loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x80'),_0x13447b[_0xc6b6('0x68')]);loggerPredictive['info'](_0xc6b6('0x81'),_0x13447b[_0xc6b6('0x69')]);loggerPredictive['info'](_0xc6b6('0x82'));if(_0x13447b[_0xc6b6('0x83')]>0x0){if(!_[_0xc6b6('0x3f')](_0x13447b[_0xc6b6('0x69')])&&_0x13447b[_0xc6b6('0x69')]>0x0){return!![];}else{loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x84'));}if(!_[_0xc6b6('0x3f')](_0x13447b[_0xc6b6('0x68')])&&_0x13447b[_0xc6b6('0x68')]>0x0){return!![];}else{loggerPredictive['info'](_0xc6b6('0x85'));}}else{loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x86'));}}else{loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x87'));}}else{loggerPredictive[_0xc6b6('0x7c')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x53cf40){return function(_0x5c80e1){loggerPredictive['info'](_0xc6b6('0x88'));loggerPredictive['info'](_0xc6b6('0x89'),_0x5c80e1[_0xc6b6('0x72')]);loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x8a'),_0x5c80e1['erlangCallToSecond']);loggerPredictive[_0xc6b6('0x7c')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c80e1[_0xc6b6('0x73')]);loggerPredictive['info'](_0xc6b6('0x8b'),_0x5c80e1[_0xc6b6('0x8c')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5c80e1[_0xc6b6('0x73')]);loggerPredictive['info'](_0xc6b6('0x82'));_[_0xc6b6('0x8d')](_0x53cf40,_0x5c80e1);};}function getDiff(_0x90bf30){var _0x57dbaf=moment()[_0xc6b6('0x4d')](0x0);var _0x5a3438=moment(_0x90bf30)['milliseconds'](0x0);return _0x57dbaf[_0xc6b6('0x4e')](_0x5a3438,_0xc6b6('0x8e'));}function ifInterval(_0x49408c,_0x5d7554){if(_['isUndefined'](_0x5d7554)){return![];}if(getDiff(_0x5d7554)<_0x49408c*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x5c0ec6){if(isNotNull(_0x5c0ec6)){if(!_[_0xc6b6('0x3f')](_0x5c0ec6[_0xc6b6('0x29')])){_0x5c0ec6[_0xc6b6('0x29')]=undefined;loggerPredictive['info'](_0x5c0ec6['name'],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xc6b6('0x3f')](_0x5c0ec6[_0xc6b6('0x28')])){_0x5c0ec6['startPredictive']=undefined;loggerPredictive[_0xc6b6('0x7c')](_0x5c0ec6[_0xc6b6('0x44')],_0xc6b6('0x8f'));}if(!_['isUndefined'](_0x5c0ec6[_0xc6b6('0x90')])){clearInterval(_0x5c0ec6['handlePredictive']);_0x5c0ec6[_0xc6b6('0x90')]=undefined;loggerPredictive[_0xc6b6('0x7c')](_0x5c0ec6[_0xc6b6('0x44')],_0xc6b6('0x91'));}}}function erlangb(_0x1c7cad,_0x5813fa){if(_0x5813fa===0x0){return 0x0;}var _0x3a6a73=0x1;for(var _0x3358dc=0x1;_0x3358dc<=_0x5813fa;_0x3358dc+=0x1){_0x3a6a73=0x1+_0x3a6a73*_0x3358dc/_0x1c7cad;}return 0x1/_0x3a6a73;}function isVoiceQueueOutbound(_0x5834e3){return _0x5834e3===_0xc6b6('0x51');}function isNotPreview(_0x397d8f){return _0x397d8f!==_0xc6b6('0x21');}function isCampaignIvr(_0x2e1af0){return _0x2e1af0==='ivr';}function getCallerId(_0x3396f0,_0x93dc53,_0x1bd45b){if(!_[_0xc6b6('0x3f')](_0x1bd45b)&&_0xc6b6('0x92')===typeof _0x1bd45b&&!_[_0xc6b6('0x4a')](_0x1bd45b)){if(!_[_0xc6b6('0x3f')](_0x93dc53)&&'string'===typeof _0x93dc53&&!_[_0xc6b6('0x4a')](_0x93dc53)){return util['format'](_0xc6b6('0x93'),_0x93dc53,_0x1bd45b);}return util['format']('\x22%s\x22\x20<%s>',_0x1bd45b,_0x1bd45b);}if(!_[_0xc6b6('0x3f')](_0x3396f0)&&'string'===typeof _0x3396f0&&!_[_0xc6b6('0x4a')](_0x3396f0)){return _0x3396f0;}return'\x22\x22\x20<>';}function loggerCatchQueueSummary(_0x670899,_0x147412){return function(_0x15dae0){freeVariablesPredictive(_0x147412);emitVoiceQueueSummary(_0x147412);emitCampaignSummary(_0x147412);loggerSyncQueueSummary[_0xc6b6('0x94')](_0x670899,util[_0xc6b6('0x95')](_0x15dae0,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x52ed4a,_0x387592){return function(_0x4566b1){loggerPredictive[_0xc6b6('0x94')](_0x387592[_0xc6b6('0x44')],_0x52ed4a);loggerPredictive[_0xc6b6('0x94')](_0x4566b1[_0xc6b6('0x96')]);freeVariablesPredictive(_0x387592);};}function loggerCatch(_0xfc866){return function(_0x467167){logger['error'](_0xfc866,util['inspect'](_0x467167,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x43e899){return _0x43e899&&!_[_0xc6b6('0x3f')](_0x43e899)&&_0x43e899['length']>0x0;}function decremetOriginate(_0x2bc125){if(!_[_0xc6b6('0x3f')](_0x2bc125)&&_0x2bc125!==null){if(_0x2bc125[_0xc6b6('0x97')](_0xc6b6('0x71'))){if(_0x2bc125[_0xc6b6('0x71')]>0x0){_0x2bc125[_0xc6b6('0x71')]-=0x1;}else{logger[_0xc6b6('0x94')](_0xc6b6('0x98'));}}}else{logger[_0xc6b6('0x94')](_0xc6b6('0x99'));}}function checkContactLowerLimitOriginate(_0x2e7b1d,_0x1ea9fe,_0x4e8868){if(_0x1ea9fe>_0x4e8868){for(var _0x23bc9a=0x0;_0x23bc9a<_0x1ea9fe-_0x4e8868;_0x23bc9a+=0x1){decremetOriginate(_0x2e7b1d);}}}function loggerGetContactDialer(_0x440cb1,_0x3c6eac,_0xdaa6a8){return function(_0x539393){checkContactLowerLimitOriginate(_0x3c6eac,_0xdaa6a8,0x0);logger[_0xc6b6('0x94')](_0x440cb1,util['inspect'](_0x539393,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x120ef1){return function(_0x1d75a6){if(isNotNull(_0x1d75a6)&&isNotNull(_0x1d75a6[0x0])){if(_0x1d75a6[0x0][_0xc6b6('0x9a')]>0x0){_0x120ef1[_0xc6b6('0x40')]=_0xc6b6('0x9b');logger[_0xc6b6('0x7c')]('[getContactDialer2][ReScheduled]'+_0x120ef1[_0xc6b6('0x44')],_0x1d75a6[0x0]['contactsRescheduled'],_0xc6b6('0x9c'));}else{_0x120ef1[_0xc6b6('0x40')]=_0xc6b6('0x9d');logger[_0xc6b6('0x7c')](_0xc6b6('0x9e')+_0x120ef1['name']);}}};}function notSendMessagesQueue(_0x570c45){if(_0x570c45[_0xc6b6('0x9f')]){freeVariablesPredictive(_0x570c45);if(_0x570c45[_0xc6b6('0x71')]===0x0&&_0x570c45[_0xc6b6('0x58')]===0x0&&_0x570c45[_0xc6b6('0xa0')]===0x0&&(_0x570c45['pTalking']||0x0)===0x0){_0x570c45['sendMessageOneNotActive']=![];_0x570c45[_0xc6b6('0x54')]=0x0;_0x570c45[_0xc6b6('0x40')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x570c45[_0xc6b6('0x44')],'is\x20not\x20active');}else{_0x570c45[_0xc6b6('0x40')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xc6b6('0x94')](_0xc6b6('0xa1'),_0x570c45[_0xc6b6('0x44')],_0xc6b6('0xa2'));}emitVoiceQueueSummary(_0x570c45);}}function notSendMessagesCampaign(_0x40f511){if(_0x40f511[_0xc6b6('0x9f')]){if(_0x40f511[_0xc6b6('0x71')]===0x0){_0x40f511[_0xc6b6('0x9f')]=![];_0x40f511[_0xc6b6('0x40')]=_0xc6b6('0x43');loggerSyncQueueSummary[_0xc6b6('0x94')](_0xc6b6('0xa3'),_0x40f511[_0xc6b6('0x44')],_0xc6b6('0xa4'));}else{_0x40f511[_0xc6b6('0x40')]=_0xc6b6('0xa5');loggerSyncQueueSummary[_0xc6b6('0x94')](_0xc6b6('0xa3'),_0x40f511['name'],_0xc6b6('0xa2'));}emitCampaignSummary(_0x40f511);}}function createObjHistory(_0x3a7782,_0x3de4e6,_0x535f02,_0x2e3ff7,_0x450093){_0x3a7782[_0xc6b6('0x40')]=_0x535f02;var _0x393369=new Action(_0x3a7782,_0x3de4e6);var _0x500c6e=new History(_0x393369);_0x500c6e[_0xc6b6('0xa6')]=_0x2e3ff7;_0x500c6e[_0xc6b6('0xa7')]=_0x450093;_0x500c6e['endtime']=_0x393369[_0xc6b6('0xa8')];return _0x500c6e;}Dialer[_0xc6b6('0xa9')][_0xc6b6('0xaa')]=function(){var _0x4e4f4c=this;setInterval(function(){_0x4e4f4c[_0xc6b6('0xab')](_0x4e4f4c['uniqueId'],'[uniqueid]');_0x4e4f4c[_0xc6b6('0xab')](_0x4e4f4c['actions'],_0xc6b6('0xac'));},0x32c8);};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xab')]=function(_0x123ac1,_0x11f42e){var _0x5def03=this;for(var _0x3eb0b9 in _0x123ac1){if(_0x123ac1['hasOwnProperty'](_0x3eb0b9)){this['sequence'][_0xc6b6('0x1f')](function(){if(!_['isNil'](_0x123ac1[_0x3eb0b9])){return ami[_0xc6b6('0xad')]({'action':'status','channel':_0x123ac1[_0x3eb0b9][_0xc6b6('0xae')]})['catch'](function(_0x39e2cd){if(_0x39e2cd[_0xc6b6('0x40')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x123ac1[_0x3eb0b9]&&_0x123ac1[_0x3eb0b9][_0xc6b6('0x50')]!==_0xc6b6('0x78')){_0x5def03['updateOriginated'](_0x5def03['voiceQueues'][_0x123ac1[_0x3eb0b9][_0xc6b6('0xaf')]]);logger['error'](_0xc6b6('0xb0'),_0x11f42e,_0x3eb0b9,_0x123ac1[_0x3eb0b9][_0xc6b6('0xaf')]);delete _0x123ac1[_0x3eb0b9];}if(_0x123ac1[_0x3eb0b9]&&_0x123ac1[_0x3eb0b9]['type']===_0xc6b6('0x78')){_0x5def03[_0xc6b6('0xb1')](_0x5def03[_0xc6b6('0x23')][_0x123ac1[_0x3eb0b9]['queue']]);logger[_0xc6b6('0x94')](_0xc6b6('0xb2'),_0x11f42e,_0x3eb0b9,_0x123ac1[_0x3eb0b9]['queue']);delete _0x123ac1[_0x3eb0b9];}},0x2328);}});}});}}};Dialer['prototype'][_0xc6b6('0xb3')]=function(_0x2dd4d6){return BPromise['resolve']()[_0xc6b6('0xb4')](cmHopper[_0xc6b6('0xb3')](_0x2dd4d6))[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xb6')));};Dialer['prototype'][_0xc6b6('0xb7')]=function(_0x14aa2e){return BPromise[_0xc6b6('0xb8')]()[_0xc6b6('0xb4')](cmHopperBlack['checkIsBlackList'](_0x14aa2e))[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xb9')));};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xba')]=function(_0x2d0a75){return BPromise[_0xc6b6('0xb8')]()[_0xc6b6('0xb4')](cmHopperBlack['checkIsBlackListIvr'](_0x2d0a75))['catch'](loggerCatch(_0xc6b6('0xbb')));};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xbc')]=function(_0x1cef69){return BPromise['resolve']()[_0xc6b6('0xb4')](cmHopperHistory[_0xc6b6('0xbd')](_0x1cef69))[_0xc6b6('0xb5')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xbe')]=function(_0x59853b){return BPromise[_0xc6b6('0xb8')]()['then'](cmHopper[_0xc6b6('0xbe')](_0x59853b))['catch'](loggerCatch('[rescheduleContact]\x20'));};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xbf')]=function(_0x249b55,_0x2e8018,_0x1a9945,_0xe42921){return BPromise['resolve']()['then'](cmHopper[_0xc6b6('0xbf')](_0x249b55,_0x2e8018,_0x1a9945,_0xe42921))[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xc0')));};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xc1')]=function(_0x37850e,_0x116ab4,_0x4308f8){return BPromise[_0xc6b6('0xb8')]()['then'](cmHopper[_0xc6b6('0xc1')](_0x37850e,_0x116ab4,_0x4308f8))['catch'](loggerCatch(_0xc6b6('0xc0')));};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xc2')]=function(_0x20a182){return BPromise[_0xc6b6('0xb8')]()[_0xc6b6('0xb4')](voiceQueueRt[_0xc6b6('0xc2')](_0x20a182))['catch'](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer['prototype'][_0xc6b6('0xc3')]=function(_0x45b80c){return BPromise['resolve']()[_0xc6b6('0xb4')](cmHopper['moveContactManagedDialer'](_0x45b80c))[_0xc6b6('0xb5')](loggerCatch('[moveContactManagedDialer]\x20'));};Dialer[_0xc6b6('0xa9')]['createHistory']=function(_0x57540e){return BPromise[_0xc6b6('0xb8')]()[_0xc6b6('0xb4')](cmHopperHistory[_0xc6b6('0xc4')](_0x57540e))[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xc5')));};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xb1')]=function(_0x2382b0){if(!_[_0xc6b6('0x3f')](_0x2382b0)&&_0x2382b0!==null){if(_0x2382b0[_0xc6b6('0x97')]('originated')){if(_0x2382b0[_0xc6b6('0x71')]>0x0){_0x2382b0[_0xc6b6('0x71')]-=0x1;}else{logger[_0xc6b6('0x94')](_0xc6b6('0xc6'));}}}else{logger[_0xc6b6('0x94')](_0xc6b6('0xc7'));}};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xc8')]=function(_0x2ce513,_0x361f44){var _0x19f560=this;return function(_0x52746e){_0x19f560[_0xc6b6('0xb1')](_0x361f44);logger[_0xc6b6('0x94')](_0x2ce513,util[_0xc6b6('0x95')](_0x52746e,{'showHidden':![],'depth':null}));};};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xc9')]=function(_0x3f91d6,_0x300968,_0x424df9){var _0x4b8556={'state':0x19,'statedesc':_0xc6b6('0xca')};this['updateOriginated'](_0x300968);this[_0xc6b6('0xcb')](_[_0xc6b6('0x8d')](_0x4b8556,_['pick'](_0x424df9,[_0xc6b6('0xcc'),_0xc6b6('0xcd'),_0xc6b6('0xce'),_0xc6b6('0xcf'),'CampaignId'])),'[emptyContact][createHistory]',_0xc6b6('0xd0'));logger[_0xc6b6('0x94')](_0x3f91d6);};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xd1')]=function(_0x51a23e){return _0x51a23e===_0xc6b6('0xd2');};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xd3')]=function(_0x309067){return!_[_0xc6b6('0x3f')](_0x309067)&&_0x309067&&!_[_0xc6b6('0x3f')](_0x309067[_0xc6b6('0x44')])&&!_[_0xc6b6('0x3f')](_0x309067['active'])&&_0x309067[_0xc6b6('0x75')]&&(this['trunks'][util[_0xc6b6('0x76')]('SIP/%s',_0x309067['name'])][_0xc6b6('0xd4')]===_0xc6b6('0xd5')||this[_0xc6b6('0x25')][util[_0xc6b6('0x76')]('SIP/%s',_0x309067[_0xc6b6('0x44')])][_0xc6b6('0xd4')]===_0xc6b6('0xd6'));};Dialer[_0xc6b6('0xa9')]['saveInDb']=function(_0x119c5a,_0x31a26a,_0x4f5b2b){this[_0xc6b6('0xc4')](_0x119c5a)['catch'](loggerCatch(_0x31a26a));this[_0xc6b6('0xc3')](_0x119c5a)[_0xc6b6('0xb5')](loggerCatch(_0x4f5b2b));};Dialer['prototype'][_0xc6b6('0x39')]=function(_0x37efd3){var _0x39ac3e=this[_0xc6b6('0xd7')][_0x37efd3['uniqueid']];var _0x5e870f;if(!_[_0xc6b6('0xd8')](_0x37efd3)&&!_['isNil'](_0x37efd3[_0xc6b6('0xd9')])&&!_[_0xc6b6('0xd8')](_0x37efd3[_0xc6b6('0xd9')]['amdstatus'])&&_0x37efd3[_0xc6b6('0xda')]==='xcally-motion-dialer'&&_0x39ac3e){if(_0x39ac3e[_0xc6b6('0x50')]!==_0xc6b6('0x78')&&this['voiceQueues'][_0x39ac3e['queue']][_0xc6b6('0xdb')]&&_0x37efd3['value']===_0xc6b6('0xdc')){delete this[_0xc6b6('0xd7')][_0x37efd3[_0xc6b6('0xdd')]];this['updateOriginated'](this['voiceQueues'][_0x39ac3e[_0xc6b6('0xaf')]]);this[_0xc6b6('0x22')][_0x39ac3e[_0xc6b6('0xaf')]][_0xc6b6('0x61')]+=0x1;this[_0xc6b6('0x22')][_0x39ac3e[_0xc6b6('0xaf')]][_0xc6b6('0x60')]+=0x1;_0x5e870f=new Hangup(_0x39ac3e,_0x37efd3);_0x5e870f[_0xc6b6('0xa6')]=0x12;_0x5e870f['statedesc']=_0xc6b6('0xde');_0x5e870f[_0xc6b6('0xdf')]=_0xc6b6('0xe0');this['saveInDb'](_0x5e870f,_0xc6b6('0xe1'),_0xc6b6('0xe2'));}if(_0x39ac3e['type']!==_0xc6b6('0x78')&&this[_0xc6b6('0x22')][_0x39ac3e[_0xc6b6('0xaf')]][_0xc6b6('0xdb')]&&_0x37efd3[_0xc6b6('0xe3')]==='MACHINE'){delete this[_0xc6b6('0xd7')][_0x37efd3[_0xc6b6('0xdd')]];this['updateOriginated'](this['voiceQueues'][_0x39ac3e[_0xc6b6('0xaf')]]);this['voiceQueues'][_0x39ac3e[_0xc6b6('0xaf')]][_0xc6b6('0x61')]+=0x1;this[_0xc6b6('0x22')][_0x39ac3e[_0xc6b6('0xaf')]][_0xc6b6('0x60')]+=0x1;_0x5e870f=new Hangup(_0x39ac3e,_0x37efd3);_0x5e870f[_0xc6b6('0xa6')]=0x13;_0x5e870f[_0xc6b6('0xa7')]=_0xc6b6('0xe4');_0x5e870f['membername']='AMD';_0x5e870f[_0xc6b6('0xe5')]=!![];this[_0xc6b6('0xcb')](_0x5e870f,_0xc6b6('0xe6'),_0xc6b6('0xe7'));}if(_0x39ac3e[_0xc6b6('0x50')]===_0xc6b6('0x78')&&this['campaigns'][_0x39ac3e[_0xc6b6('0xaf')]][_0xc6b6('0xdb')]&&_0x37efd3[_0xc6b6('0xe3')]===_0xc6b6('0xdc')){delete this[_0xc6b6('0xd7')][_0x37efd3[_0xc6b6('0xdd')]];this['updateOriginated'](this['campaigns'][_0x39ac3e[_0xc6b6('0xaf')]]);_0x5e870f=new Hangup(_0x39ac3e,_0x37efd3);_0x5e870f[_0xc6b6('0xa6')]=0x12;_0x5e870f[_0xc6b6('0xa7')]=_0xc6b6('0xde');_0x5e870f[_0xc6b6('0xdf')]=_0xc6b6('0xe0');this[_0xc6b6('0xcb')](_0x5e870f,_0xc6b6('0xe8'),_0xc6b6('0xe9'));}if(_0x39ac3e['type']===_0xc6b6('0x78')&&this['campaigns'][_0x39ac3e[_0xc6b6('0xaf')]][_0xc6b6('0xdb')]&&_0x37efd3[_0xc6b6('0xe3')]==='MACHINE'){delete this[_0xc6b6('0xd7')][_0x37efd3[_0xc6b6('0xdd')]];this[_0xc6b6('0xb1')](this[_0xc6b6('0x23')][_0x39ac3e[_0xc6b6('0xaf')]]);_0x5e870f=new Hangup(_0x39ac3e,_0x37efd3);_0x5e870f[_0xc6b6('0xa6')]=0x13;_0x5e870f[_0xc6b6('0xa7')]=_0xc6b6('0xe4');_0x5e870f['membername']=_0xc6b6('0xe0');_0x5e870f[_0xc6b6('0xe5')]=!![];this[_0xc6b6('0xcb')](_0x5e870f,'[syncMachineIvr][createHistory]','[syncMachineIvr]');}}};Dialer['prototype']['syncHangup']=function(_0x323eca){var _0x24faf5=this[_0xc6b6('0xd7')][_0x323eca[_0xc6b6('0xdd')]];var _0x55d039=this;var _0x3821be;if(_0x24faf5&&_0x24faf5[_0xc6b6('0x50')]===_0xc6b6('0x78')){delete this[_0xc6b6('0xd7')][_0x323eca[_0xc6b6('0xdd')]];this[_0xc6b6('0xb1')](this[_0xc6b6('0x23')][_0x24faf5[_0xc6b6('0xaf')]]);this[_0xc6b6('0x23')][_0x24faf5[_0xc6b6('0xaf')]][_0xc6b6('0xea')]+=0x1;_0x3821be=new Hangup(_0x24faf5,_0x323eca);this[_0xc6b6('0xc4')](_0x3821be)['catch'](loggerCatch(_0xc6b6('0xeb')));this[_0xc6b6('0xc3')](_0x3821be)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xec')));}if(_0x24faf5&&_0x24faf5[_0xc6b6('0x50')]!==_0xc6b6('0x78')&&isNotNull(this['voiceQueues'][_0x24faf5[_0xc6b6('0xaf')]][_0xc6b6('0xed')])){delete this['uniqueId'][_0x323eca[_0xc6b6('0xdd')]];this[_0xc6b6('0xb1')](this[_0xc6b6('0x22')][_0x24faf5[_0xc6b6('0xaf')]]);this['voiceQueues'][_0x24faf5['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xc6b6('0x22')][_0x24faf5[_0xc6b6('0xaf')]][_0xc6b6('0x60')]+=0x1;_0x3821be=new Hangup(_0x24faf5,_0x323eca);_0x3821be[_0xc6b6('0xa6')]=0x10;_0x3821be[_0xc6b6('0xa7')]=_0xc6b6('0xee');_0x3821be[_0xc6b6('0xdf')]=_0xc6b6('0xef');this[_0xc6b6('0xc4')](_0x3821be)[_0xc6b6('0xb5')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0xc6b6('0xc3')](_0x3821be)[_0xc6b6('0xb5')](loggerCatch('[syncHangupIvr]'));}if(_0x24faf5&&_0x24faf5[_0xc6b6('0x50')]!==_0xc6b6('0x78')&&!isNotNull(this[_0xc6b6('0x22')][_0x24faf5['queue']][_0xc6b6('0xed')])){delete this['uniqueId'][_0x323eca[_0xc6b6('0xdd')]];this['updateOriginated'](this[_0xc6b6('0x22')][_0x24faf5[_0xc6b6('0xaf')]]);this['voiceQueues'][_0x24faf5[_0xc6b6('0xaf')]][_0xc6b6('0xf0')]+=0x1;_0x3821be=new Hangup(_0x24faf5,_0x323eca);_0x3821be[_0xc6b6('0xa6')]=0xc;_0x3821be[_0xc6b6('0xa7')]=_0x323eca[_0xc6b6('0xf1')];_0x3821be[_0xc6b6('0xdf')]=_0xc6b6('0xf2');this['createHistory'](_0x3821be)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xeb')));this['moveContactManagedDialer'](_0x3821be)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xec')));}};Dialer[_0xc6b6('0xa9')]['syncAgentComplete']=function(_0x166d54){var _0x3b6d5b=this[_0xc6b6('0xd7')][_0x166d54[_0xc6b6('0xdd')]];var _0x39c776=this;if(this[_0xc6b6('0x22')][_0x166d54[_0xc6b6('0xaf')]]){if(_0x3b6d5b&&_0x3b6d5b['type']!==_0xc6b6('0x78')){delete this[_0xc6b6('0xd7')][_0x166d54[_0xc6b6('0xdd')]];this[_0xc6b6('0x22')][_0x166d54[_0xc6b6('0xaf')]][_0xc6b6('0x61')]+=0x1;var _0x180178=new AgentComplete(_0x3b6d5b,_0x166d54);if(_0x166d54[_0xc6b6('0xf3')]===_0xc6b6('0xf4')){_0x180178[_0xc6b6('0xf5')]=this[_0xc6b6('0x22')][_0x166d54[_0xc6b6('0xaf')]]['dialQueueProject2']&&this['voiceQueues'][_0x166d54[_0xc6b6('0xaf')]]['dialAgiAfterHangupAgent']?moment()[_0xc6b6('0x76')](_0xc6b6('0xf6')):undefined;}this['createHistory'](_0x180178)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xf7')));this['moveContactManagedDialer'](_0x180178)[_0xc6b6('0xb5')](loggerCatch('[syncAgentComplete]'));}}};Dialer['prototype']['syncAgentConnect']=function(_0x23dde9){if(this['voiceQueues'][_0x23dde9[_0xc6b6('0xaf')]]){if(this[_0xc6b6('0xd7')][_0x23dde9[_0xc6b6('0xdd')]]&&this['uniqueId'][_0x23dde9[_0xc6b6('0xdd')]][_0xc6b6('0x50')]!==_0xc6b6('0x78')){this[_0xc6b6('0xb1')](this[_0xc6b6('0x22')][_0x23dde9['queue']]);this[_0xc6b6('0xd7')][_0x23dde9[_0xc6b6('0xdd')]][_0xc6b6('0xf8')]=moment()[_0xc6b6('0x76')](_0xc6b6('0xf6'));}}};Dialer['prototype'][_0xc6b6('0xf9')]=function(_0x41cb2a){this[_0xc6b6('0xc4')](_0x41cb2a)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xf7')));this[_0xc6b6('0xc3')](_0x41cb2a)['catch'](loggerCatch(_0xc6b6('0xfa')));};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x2f')]=function(_0x545fc8){var _0x50d2e8=this[_0xc6b6('0xd7')][_0x545fc8['uniqueid']];var _0xd8a0e7=this;if(this[_0xc6b6('0x22')][_0x545fc8['queue']]){if(_0x50d2e8&&_0x50d2e8[_0xc6b6('0x50')]!=='ivr'){delete this[_0xc6b6('0xd7')][_0x545fc8[_0xc6b6('0xdd')]];this[_0xc6b6('0xb1')](this['voiceQueues'][_0x545fc8['queue']]);_0x50d2e8['droptime']=moment()[_0xc6b6('0x76')](_0xc6b6('0xf6'));var _0x634144=new QueueCallerAbandon(_0x50d2e8,_0x545fc8);if(getSeconds(_0x50d2e8['droptime'],_0x50d2e8[_0xc6b6('0xfb')])>=_0x50d2e8['dialQueueTimeout']){this['voiceQueues'][_0x545fc8['queue']][_0xc6b6('0x7e')]+=0x1;this[_0xc6b6('0x22')][_0x545fc8[_0xc6b6('0xaf')]][_0xc6b6('0xfc')]+=0x1;this[_0xc6b6('0x22')][_0x545fc8['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x634144['state']=0xa;_0x634144[_0xc6b6('0xa7')]='Drop';_0x634144[_0xc6b6('0xfd')]=_0xc6b6('0xfe');_0x634144[_0xc6b6('0xf5')]=this[_0xc6b6('0x22')][_0x545fc8[_0xc6b6('0xaf')]][_0xc6b6('0xff')]?moment()[_0xc6b6('0x76')](_0xc6b6('0xf6')):undefined;this['queueCallerAbandonCreateState'](_0x634144);}else{this[_0xc6b6('0x22')][_0x545fc8[_0xc6b6('0xaf')]][_0xc6b6('0x6a')]+=0x1;this[_0xc6b6('0x22')][_0x545fc8[_0xc6b6('0xaf')]][_0xc6b6('0x100')]+=0x1;_0x634144[_0xc6b6('0xa6')]=0xb;_0x634144[_0xc6b6('0xa7')]=_0xc6b6('0x101');_0x634144[_0xc6b6('0xfd')]=_0xc6b6('0x102');this[_0xc6b6('0xf9')](_0x634144);}}}};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x37')]=function(_0x349161){if(this[_0xc6b6('0x103')][_0x349161[_0xc6b6('0xdd')]]){this[_0xc6b6('0x103')][_0x349161[_0xc6b6('0xdd')]][_0xc6b6('0xae')]=_0x349161[_0xc6b6('0xae')];}if(this[_0xc6b6('0xd7')][_0x349161[_0xc6b6('0xdd')]]){this[_0xc6b6('0xd7')][_0x349161[_0xc6b6('0xdd')]][_0xc6b6('0xae')]=_0x349161[_0xc6b6('0xae')];}};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x3b')]=function(_0x330c87){if(strategy[this[_0xc6b6('0x22')][this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]][_0xc6b6('0xaf')]][_0xc6b6('0x52')]]==='roundrobin'){if(this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]]&&_[_0xc6b6('0xd8')](this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]]['locked'])&&_0x330c87[_0xc6b6('0xd4')]==='1'&&_0x330c87['paused']==='0'){if(this[_0xc6b6('0x24')][_0x330c87['stateinterface']]){if(!this[_0xc6b6('0x24')][_0x330c87['stateinterface']][_0xc6b6('0x105')]){this[_0xc6b6('0x24')][_0x330c87['stateinterface']]['locked']=!![];this['actions'][_0x330c87[_0xc6b6('0x104')]][_0xc6b6('0x105')]=!![];this['actions'][_0x330c87[_0xc6b6('0x104')]][_0xc6b6('0x106')]=_0x330c87[_0xc6b6('0x106')];}}}}else if((strategy[this[_0xc6b6('0x22')][this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]['strategy']]||_0xc6b6('0x1d'))===_0xc6b6('0x1d')){if(this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]]){if(this[_0xc6b6('0x24')][_0x330c87[_0xc6b6('0x106')]]){this['actions'][_0x330c87['actionid']]['stateinterface']=_0x330c87[_0xc6b6('0x106')];if(_['isNil'](this[_0xc6b6('0x107')][this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]]['queue']])){this[_0xc6b6('0x107')][this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]=[];}this[_0xc6b6('0x107')][this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]][_0xc6b6('0xaf')]][_0xc6b6('0x108')](_[_0xc6b6('0x8d')](_[_0xc6b6('0x109')](this[_0xc6b6('0x103')][_0x330c87[_0xc6b6('0x104')]],[_0xc6b6('0x10a'),_0xc6b6('0x106')]),{'status':_0x330c87[_0xc6b6('0xd4')],'paused':_0x330c87[_0xc6b6('0x10b')]}));}}}};function unlockQueueStatus(_0x1d766b,_0x1e2917){setTimeout(function(){if(_['isUndefined'](_0x1d766b[_0xc6b6('0x10c')])){loggerBooked[_0xc6b6('0x94')]('[unlockQueueStatus][undefined]',_0x1e2917);}_0x1d766b['queueStatusComplete']=!![];loggerBooked[_0xc6b6('0x7c')](_0xc6b6('0x10d'),_0x1e2917,JSON[_0xc6b6('0x4c')](_['pick'](_0x1d766b,[_0xc6b6('0x44'),'queueStatusComplete'])));},0x1f3);}Dialer[_0xc6b6('0xa9')]['syncQueueStatusComplete']=function(_0x19ccfb){var _0x9b1a97=this;var _0x3e7dd1=_0x9b1a97[_0xc6b6('0x22')][_0x9b1a97[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]];if(strategy[this[_0xc6b6('0x22')][this['actions'][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]['strategy']]==='roundrobin'){if(this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]]&&this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0x106')]){this[_0xc6b6('0x21')]['run'](this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0x10a')],this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0x106')])[_0xc6b6('0xb5')](function(_0x55cd26){logger['error'](_0xc6b6('0x10e'),util[_0xc6b6('0x95')](_0x55cd26,{'showHidden':![],'depth':null}));})[_0xc6b6('0x10f')](function(){_0x9b1a97['updateOriginated'](_0x9b1a97['voiceQueues'][_0x9b1a97[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]);_0x9b1a97[_0xc6b6('0x24')][_0x9b1a97['actions'][_0x19ccfb['actionid']][_0xc6b6('0x106')]][_0xc6b6('0x105')]=![];delete _0x9b1a97['actions'][_0x19ccfb[_0xc6b6('0x104')]];unlockQueueStatus(_0x3e7dd1);});}else{this[_0xc6b6('0xb1')](this[_0xc6b6('0x22')][this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]);this['rescheduleContact']({'active':![],'ContactId':this['actions'][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xcc')],'ListId':this['actions'][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xcd')],'VoiceQueueId':this[_0xc6b6('0x103')][_0x19ccfb['actionid']][_0xc6b6('0xcf')]||undefined,'CampaignId':this[_0xc6b6('0x103')][_0x19ccfb['actionid']][_0xc6b6('0x110')]||undefined})[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x111')));delete this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]];unlockQueueStatus(_0x3e7dd1);}}else if((strategy[this['voiceQueues'][this['actions'][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]][_0xc6b6('0x52')]]||'rrmemory')===_0xc6b6('0x1d')){var _0x542114;if(this['actions'][_0x19ccfb[_0xc6b6('0x104')]]&&!_[_0xc6b6('0x4a')](this[_0xc6b6('0x107')][this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]])){if(this[_0xc6b6('0x2b')][_0x9b1a97[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]){this['queueBookedRR'][_0x9b1a97[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]=this[_0xc6b6('0x2b')][this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]?this[_0xc6b6('0x2b')][this['actions'][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]:this[_0xc6b6('0x107')][this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]?this[_0xc6b6('0x107')][this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]][_0xc6b6('0x112')]||0x0:0x0;}this[_0xc6b6('0x107')][this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]]['_rr']=this[_0xc6b6('0x2b')][this[_0xc6b6('0x103')][_0x19ccfb[_0xc6b6('0x104')]][_0xc6b6('0xaf')]];for(var _0xfaa67a=0x0;_0xfaa67a=0x0?!![]:![];})[_0xc6b6('0xb5')](myreject(_0x28c1d0)));}}else{_0x304d45[_0xc6b6('0x108')](ami['Action']({'action':'command','command':util[_0xc6b6('0x76')](_0xc6b6('0x12d'),_0x3fcc8a,!_[_0xc6b6('0x3f')](config[_0xc6b6('0x12f')][_0x3e8214])?_0x3e8214:'')})[_0xc6b6('0xb4')](function(_0x47face){return _0x47face['content'][_0xc6b6('0x130')](_0xc6b6('0x131'))>=0x0?!![]:![];})[_0xc6b6('0xb5')](myreject(_0x28c1d0)));}BPromise[_0xc6b6('0x132')](_0x304d45)[_0xc6b6('0xb4')](function(_0xda595e){var _0x526b1c=_['some'](_0xda595e);if(_0x526b1c){return _0x96252e(_0x526b1c);}else{_0x5c3ca0['message']=_0x58c149?'GLOBAL_INTERVAL_IS_OVERTIME':_0xc6b6('0x133');return _0x28c1d0(msgResponse('[ifTime][promiseAll]',_0xc6b6('0x127'),_0xc6b6('0x134')+_0x58c149+'\x20'+_0x110fdd+'\x20Interval\x20is\x20overtime:\x20'+util[_0xc6b6('0x95')](_0x3fcc8a,{'showHidden':![],'depth':null})+_0xc6b6('0x135')+_0x3e8214));}})['catch'](function(_0x45c430){return _0x28c1d0(msgResponse(_0xc6b6('0x125'),_0xc6b6('0x127'),JSON[_0xc6b6('0x4c')](_0x45c430)));});});};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x136')]=function(_0x5046b3){var _0x5ea90d=this;return function(){switch(_0x5046b3[_0xc6b6('0x137')]){case'progressive':freeVariablesPredictive(_0x5046b3);_0x5ea90d[_0xc6b6('0x138')](_0x5046b3,0x1);break;case'power':freeVariablesPredictive(_0x5046b3);_0x5ea90d[_0xc6b6('0x138')](_0x5046b3,_0x5046b3[_0xc6b6('0x139')]);break;case _0xc6b6('0xa'):_0x5ea90d[_0xc6b6('0xa')](_0x5046b3);break;case'booked':freeVariablesPredictive(_0x5046b3);_0x5ea90d[_0xc6b6('0x138')](_0x5046b3,0x1);break;default:freeVariablesPredictive(_0x5046b3);logger[_0xc6b6('0x94')]('Queue',_0x5046b3['name'],_0xc6b6('0x13a'));}};};Dialer['prototype'][_0xc6b6('0x13b')]=function(_0x8656ea){var _0xdacc2=this;return function(){_0xdacc2[_0xc6b6('0x13c')](_0x8656ea);};};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xc')]=function(_0x264338){var _0x2621de=this;if(isNotPreview(_0x264338[_0xc6b6('0x137')])){if(isVoiceQueueOutbound(_0x264338[_0xc6b6('0x50')])&&isActive(_0x264338[_0xc6b6('0x5b')])){_0x264338['sendMessageOneNotActive']=!![];BPromise[_0xc6b6('0xb8')]()[_0xc6b6('0xb4')](checkIsLoggedIn(_0x264338,_0x264338['loggedIn']))[_0xc6b6('0xb4')](checkIsActive(_0x264338,_0x264338[_0xc6b6('0x5b')]))[_0xc6b6('0xb4')](checkInterval(_0x264338))[_0xc6b6('0xb4')](_0x2621de['checkIsTrunkReachable'](_0x264338))[_0xc6b6('0xb4')](_0x2621de[_0xc6b6('0x124')](_0x264338['dialGlobalInterval'],_0x264338[_0xc6b6('0x13d')],_0x264338['name'],_0x264338))[_0xc6b6('0xb4')](_0x2621de[_0xc6b6('0x126')](_0x264338[_0xc6b6('0x46')],_0x264338[_0xc6b6('0x13d')],_0x264338[_0xc6b6('0x44')],_0x264338))[_0xc6b6('0xb4')](_0x2621de[_0xc6b6('0x136')](_0x264338))['catch'](loggerCatchQueueSummary(_0xc6b6('0x13e'),_0x264338));}else{notSendMessagesQueue(_0x264338);}}else{freeVariablesPredictive(_0x264338);}};Dialer['prototype'][_0xc6b6('0x11f')]=function(){var _0x14295c=this;var _0x17df00;for(var _0x59b602 in this[_0xc6b6('0x23')]){if(this[_0xc6b6('0x23')]['hasOwnProperty'](_0x59b602)){_0x17df00=this[_0xc6b6('0x23')][_0x59b602];if(isCampaignIvr(_0x17df00['type'])&&isActive(_0x17df00[_0xc6b6('0x75')])){_0x17df00[_0xc6b6('0x9f')]=!![];BPromise[_0xc6b6('0xb8')]()['then'](checkIsActive(_0x17df00,_0x17df00[_0xc6b6('0x75')]))[_0xc6b6('0xb4')](checkInterval(_0x17df00))[_0xc6b6('0xb4')](_0x14295c[_0xc6b6('0x120')](_0x17df00))['then'](_0x14295c[_0xc6b6('0x124')](_0x17df00[_0xc6b6('0x13f')],_0x17df00[_0xc6b6('0x13d')],_0x17df00[_0xc6b6('0x44')],_0x17df00))['then'](_0x14295c[_0xc6b6('0x126')](_0x17df00[_0xc6b6('0x46')],_0x17df00[_0xc6b6('0x13d')],_0x17df00[_0xc6b6('0x44')],_0x17df00))['then'](_0x14295c[_0xc6b6('0x13b')](_0x17df00))[_0xc6b6('0xb5')](loggerCatchQueueSummary(_0xc6b6('0x140'),_0x17df00));}else{notSendMessagesCampaign(_0x17df00);}}}};function getCallerIdRandom(_0x465a5e,_0x22c691){var _0x13c6d7,_0x3bdc72,_0x410de3;if(_0x22c691<=0x0){_0x22c691=0x1;}_0x13c6d7=new RegExp(_0xc6b6('0x141')+_0x22c691+'}$');_0x3bdc72=Math[_0xc6b6('0x142')](0xa,_0x22c691-0x1);_0x410de3=Math[_0xc6b6('0x142')](0xa,_0x22c691)-0x1;return util['format']('%s',_[_0xc6b6('0x143')](_0x465a5e,_0x13c6d7,_[_0xc6b6('0x144')](_0x3bdc72,_0x410de3)));}function extractCalleridName(_0x51ec81){var _0x5628a7=_0x51ec81['match'](/"(.*?)"/);return _0x5628a7?_0x5628a7[0x1]:_0x51ec81;}function extractCalleridNumber(_0x470c85){var _0x4c7252=_0x470c85['match'](/<(.*?)>/);return _0x4c7252?_0x4c7252[0x1]:_0x470c85;}Dialer['prototype'][_0xc6b6('0x145')]=function(_0x236929,_0x43dfad){var _0x1e47e2=this;var _0x45c8fc=uuid['v4']();this[_0xc6b6('0x103')][_0x45c8fc]=new Action(_0x236929,_0x43dfad,_0x45c8fc);return new BPromise(function(_0xdf0ec6,_0x3ed016){if(_[_0xc6b6('0x3f')](_0x236929)&&_0xc6b6('0x146')!==typeof _0x236929){return _0x3ed016(msgResponse('originate',_0xc6b6('0x127'),'voiceQueue\x20is\x20undefine'));}if(_[_0xc6b6('0x3f')](_0x43dfad[_0xc6b6('0x147')]['phone'])||_0x43dfad[_0xc6b6('0x147')][_0xc6b6('0x148')]===null){return _0x3ed016(msgResponse('originate',_0xc6b6('0x127'),_0xc6b6('0x149')));}var _0x10bcba={'XMD-CALLERID':_0x1e47e2[_0xc6b6('0x103')][_0x45c8fc][_0xc6b6('0x14a')](),'XMD-AGI':_0x236929['dialQueueProject']?util[_0xc6b6('0x76')]('\x22agi://%s/square,%s\x22',ipAgi,_0x236929[_0xc6b6('0xed')]):'NONE','XMD-AGIAFTER':_0x236929[_0xc6b6('0xff')]?util[_0xc6b6('0x76')](_0xc6b6('0x14b'),ipAgi,_0x236929[_0xc6b6('0xff')]):_0xc6b6('0x14c'),'XMD-QUEUE':_0x236929[_0xc6b6('0x50')]===_0xc6b6('0x51')?util[_0xc6b6('0x76')](_0xc6b6('0x14d'),_0x236929['name'],_0x236929[_0xc6b6('0x14e')]||'',_0x236929[_0xc6b6('0x14f')]?'c':'',_0x236929['dialQueueTimeout']||0x3):_0xc6b6('0x14c'),'XMD-CONTACTID':_0x43dfad[_0xc6b6('0xcc')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x1e47e2[_0xc6b6('0x103')][_0x45c8fc][_0xc6b6('0x14a')](),'XMD-AMD':_0x236929[_0xc6b6('0xdb')]?_0xc6b6('0x150'):_0xc6b6('0x14c'),'XMD-DESTINATION':_0xc6b6('0x151')};if(_0x236929[_0xc6b6('0xdb')]){_0x10bcba['XMD-AMDINITIALSILENCE']=_0x236929[_0xc6b6('0x152')]||0x9c4;_0x10bcba['XMD-AMDGREETING']=_0x236929['dialAMDGreeting']||0x5dc;_0x10bcba[_0xc6b6('0x153')]=_0x236929[_0xc6b6('0x154')]||0x320;_0x10bcba['XMD-AMDTOTALANALYSISTIME']=_0x236929['dialAMDTotalAnalysisTime']||0x1388;_0x10bcba['XMD-AMDMINWORDLENGTH']=_0x236929[_0xc6b6('0x155')]||0x64;_0x10bcba[_0xc6b6('0x156')]=_0x236929[_0xc6b6('0x157')]||0x32;_0x10bcba[_0xc6b6('0x158')]=_0x236929[_0xc6b6('0x159')]||0x3;_0x10bcba[_0xc6b6('0x15a')]=_0x236929['dialAMDSilenceThreshold']||0x100;_0x10bcba['XMD-AMDMAXIMUMWORDLENGTH']=_0x236929[_0xc6b6('0x15b')]||0x1388;}if(_0x236929[_0xc6b6('0x50')]==='outbound'){_0x10bcba[_0xc6b6('0x15c')]=_0x43dfad[_0xc6b6('0xcf')];}else{_0x10bcba[_0xc6b6('0x15d')]=_0x43dfad[_0xc6b6('0x110')];}for(var _0x2f9a0a in _0x43dfad['Contact']){if(_0x43dfad['Contact'][_0xc6b6('0x97')](_0x2f9a0a)){if(isNotNull(_0x43dfad['Contact'][_0x2f9a0a])&&_0x2f9a0a!=='id'&&_0x2f9a0a!==_0xc6b6('0x15e')&&_0x2f9a0a!==_0xc6b6('0x15f')&&_0x2f9a0a!==_0xc6b6('0x160')){_0x10bcba[util[_0xc6b6('0x76')](_0xc6b6('0x161'),_0xc6b6('0x162'),_['toUpper'](_0x2f9a0a))]=_0x43dfad[_0xc6b6('0x147')][_0x2f9a0a];}}}var _0x32eb38=_0x1e47e2[_0xc6b6('0xd3')](_0x236929['Trunk'])?getCallerId(_0x236929[_0xc6b6('0x74')][_0xc6b6('0x163')],_0x236929[_0xc6b6('0x5c')],_0x236929['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x236929[_0xc6b6('0x5d')],_0x236929[_0xc6b6('0x164')]):_0x236929[_0xc6b6('0x5d')]):getCallerId(_[_0xc6b6('0xd8')](_0x236929[_0xc6b6('0x121')])?_0x236929[_0xc6b6('0x74')][_0xc6b6('0x163')]:_0x236929[_0xc6b6('0x121')][_0xc6b6('0x163')],_0x236929[_0xc6b6('0x5c')],_0x236929[_0xc6b6('0x164')]>0x0?getCallerIdRandom(_0x236929[_0xc6b6('0x5d')],_0x236929[_0xc6b6('0x164')]):_0x236929[_0xc6b6('0x5d')]);if(_0x32eb38){_0x10bcba['XMD-ORIGINATECALLERIDNAME']=_0x1e47e2[_0xc6b6('0x103')][_0x45c8fc][_0xc6b6('0x165')]=extractCalleridName(_0x32eb38);_0x10bcba[_0xc6b6('0x166')]=_0x1e47e2[_0xc6b6('0x103')][_0x45c8fc][_0xc6b6('0x167')]=extractCalleridNumber(_0x32eb38);}return ami[_0xc6b6('0xad')]({'actionid':_0x45c8fc,'action':_0xc6b6('0x168'),'channel':_0x1e47e2[_0xc6b6('0xd3')](_0x236929[_0xc6b6('0x74')])?util[_0xc6b6('0x76')](_0xc6b6('0x169'),_0x236929['Trunk'][_0xc6b6('0x44')],isNotNull(_0x236929[_0xc6b6('0x5f')])?_0x236929[_0xc6b6('0x5f')][_0xc6b6('0x16a')]()||'':'',_0x236929['dialCutDigit']>0x0?_0x43dfad[_0xc6b6('0x147')][_0xc6b6('0x148')]['substring'](_0x236929[_0xc6b6('0x16b')]):_0x43dfad[_0xc6b6('0x147')][_0xc6b6('0x148')]):util['format'](_0xc6b6('0x169'),_[_0xc6b6('0xd8')](_0x236929[_0xc6b6('0x121')])?_0x236929[_0xc6b6('0x74')][_0xc6b6('0x44')]:_0x236929[_0xc6b6('0x121')][_0xc6b6('0x44')],isNotNull(_0x236929[_0xc6b6('0x5f')])?_0x236929[_0xc6b6('0x5f')][_0xc6b6('0x16a')]()||'':'',_0x236929[_0xc6b6('0x16b')]>0x0?_0x43dfad[_0xc6b6('0x147')][_0xc6b6('0x148')][_0xc6b6('0x16c')](_0x236929['dialCutDigit']):_0x43dfad['Contact'][_0xc6b6('0x148')]),'callerid':_0x32eb38,'Exten':_0xc6b6('0x151'),'Context':_0xc6b6('0x16d'),'Priority':'1','variable':_0x10bcba,'timeout':(_0x236929[_0xc6b6('0x5e')]||0x1e)*0x3e8,'async':!![],'channelid':_0x45c8fc})[_0xc6b6('0xb4')](function(_0x20d5c1){return _0xdf0ec6(_0x20d5c1);})[_0xc6b6('0xb5')](function(_0xa80b85){_0x236929[_0xc6b6('0x64')]+=0x1;var _0x5c7bc9=new History(_0x1e47e2['actions'][_0x45c8fc]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0xc6b6('0x4c')](_0xa80b85)));_0x5c7bc9[_0xc6b6('0xa6')]=0xe;_0x5c7bc9[_0xc6b6('0xa7')]=_0xc6b6('0x16e');_0x5c7bc9[_0xc6b6('0xa8')]=moment()[_0xc6b6('0x76')]('YYYY-MM-DD\x20HH:mm:ss');_0x5c7bc9[_0xc6b6('0x16f')]=_0x5c7bc9['starttime'];_0x1e47e2[_0xc6b6('0xc4')](_0x5c7bc9)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x170')));_0x1e47e2[_0xc6b6('0xc3')](_0x5c7bc9)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x170')))['finally'](function(){delete _0x1e47e2[_0xc6b6('0x103')][_0x45c8fc];return _0x3ed016(msgResponse('originate',_0xc6b6('0x171'),_0xc6b6('0x172')));});});});};Dialer['prototype']['syncOriginateResponse']=function(_0x4a377a){var _0x1fba41=this[_0xc6b6('0x103')][_0x4a377a[_0xc6b6('0x104')]];var _0x1849f1=this;if(_0x1fba41){delete this[_0xc6b6('0x103')][_0x4a377a[_0xc6b6('0x104')]];_0x1fba41['responsetime']=moment()[_0xc6b6('0x76')](_0xc6b6('0xf6'));var _0x264f30=_0x1fba41[_0xc6b6('0x50')]===_0xc6b6('0x78')?this[_0xc6b6('0x23')][_0x1fba41[_0xc6b6('0xaf')]]:this[_0xc6b6('0x22')][_0x1fba41['getQueue']()];if(!this[_0xc6b6('0xd1')](_0x4a377a['response'])){this['updateOriginated'](_0x264f30);return this[_0xc6b6('0x173')](_0x1fba41,_0x264f30,_0x4a377a)[_0xc6b6('0xb4')](function(_0x13c6dc){})[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x174')));}else{this['uniqueId'][_0x4a377a[_0xc6b6('0xdd')]]=_0x1fba41;}}};Dialer[_0xc6b6('0xa9')]['checkRetriveMax']=function(_0x43a4a9,_0x5d5b1e,_0x202440){var _0x2f961f=new History(_0x5d5b1e);if(_0x2f961f[_0xc6b6('0x175')]+_0x2f961f[_0xc6b6('0x176')]+_0x2f961f[_0xc6b6('0x177')]>=_0x202440[_0xc6b6('0x178')]-0x1){return!![];}switch(_0x43a4a9){case 0x3:if(_0x2f961f[_0xc6b6('0x177')]>=_0x202440[_0xc6b6('0x179')]-0x1){return!![];}else{this[_0xc6b6('0xbe')]({'active':![],'countnoanswerretry':_0x2f961f['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xc6b6('0x17a')](_0x202440[_0xc6b6('0x17b')],_0xc6b6('0x17c'))[_0xc6b6('0x76')](_0xc6b6('0xf6')),'ContactId':_0x2f961f[_0xc6b6('0xcc')],'ListId':_0x2f961f[_0xc6b6('0xcd')],'VoiceQueueId':_0x2f961f[_0xc6b6('0xcf')]||undefined,'CampaignId':_0x2f961f['CampaignId']||undefined})['catch'](loggerCatch(_0xc6b6('0x17d')));}break;case 0x5:if(_0x2f961f['countbusyretry']>=_0x202440['dialBusyMaxRetry']-0x1){return!![];}else{this[_0xc6b6('0xbe')]({'active':![],'countbusyretry':_0x2f961f[_0xc6b6('0x175')]+=0x1,'scheduledat':moment()[_0xc6b6('0x17a')](_0x202440[_0xc6b6('0x17e')],_0xc6b6('0x17c'))['format'](_0xc6b6('0xf6')),'ContactId':_0x2f961f[_0xc6b6('0xcc')],'ListId':_0x2f961f[_0xc6b6('0xcd')],'VoiceQueueId':_0x2f961f[_0xc6b6('0xcf')]||undefined,'CampaignId':_0x2f961f[_0xc6b6('0x110')]||undefined})[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x17f')));}break;case 0x8:if(_0x2f961f[_0xc6b6('0x176')]>=_0x202440[_0xc6b6('0x180')]-0x1){return!![];}else{this[_0xc6b6('0xbe')]({'active':![],'countcongestionretry':_0x2f961f[_0xc6b6('0x176')]+=0x1,'scheduledat':moment()[_0xc6b6('0x17a')](_0x202440[_0xc6b6('0x181')],_0xc6b6('0x17c'))[_0xc6b6('0x76')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f961f['ContactId'],'ListId':_0x2f961f[_0xc6b6('0xcd')],'VoiceQueueId':_0x2f961f[_0xc6b6('0xcf')]||undefined,'CampaignId':_0x2f961f[_0xc6b6('0x110')]||undefined})['catch'](loggerCatch(_0xc6b6('0x182')));}break;default:return!![];}};Dialer['prototype'][_0xc6b6('0x173')]=function(_0x150194,_0x483016,_0x29716f){var _0x489b0a=this;var _0x3cfcb0=new History(_0x150194);return new BPromise(function(_0x4e1076,_0x73a4b1){if(_[_0xc6b6('0x3f')](_0x483016)&&'object'!==typeof _0x483016){return _0x73a4b1(msgResponse(_0xc6b6('0x183'),'Failure',_0xc6b6('0x184')));}if(_[_0xc6b6('0x3f')](_0x29716f)&&_0xc6b6('0x146')!==typeof _0x29716f){return _0x73a4b1(msgResponse(_0xc6b6('0x183'),_0xc6b6('0x127'),_0xc6b6('0x185')));}switch(_0x29716f['reason']){case'0':_0x483016['outboundNoSuchCallsDay']+=0x1;_0x3cfcb0['state']=0x0;_0x3cfcb0[_0xc6b6('0xa7')]=_0xc6b6('0x186');_0x489b0a[_0xc6b6('0xc4')](_0x3cfcb0)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x187')));if(_0x489b0a[_0xc6b6('0x188')](0x0,_0x150194,_0x483016)){if(_0x3cfcb0[_0xc6b6('0x175')]+_0x3cfcb0[_0xc6b6('0x176')]+_0x3cfcb0[_0xc6b6('0x177')]>=_0x483016[_0xc6b6('0x178')]){_0x489b0a[_0xc6b6('0x189')](_0x3cfcb0,_0x4e1076,_0x73a4b1,_0xc6b6('0x18a'));}else{_0x489b0a[_0xc6b6('0x18b')](_0x3cfcb0,_0x4e1076,_0x73a4b1,_0xc6b6('0x18a'));}}break;case'3':_0x483016[_0xc6b6('0x18c')]+=0x1;_0x3cfcb0[_0xc6b6('0xa6')]=0x3;_0x3cfcb0[_0xc6b6('0xa7')]='NoAnswer';_0x3cfcb0[_0xc6b6('0x177')]+=0x1;_0x3cfcb0['countglobal']+=0x1;_0x489b0a[_0xc6b6('0xc4')](_0x3cfcb0)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x18d')));if(_0x489b0a[_0xc6b6('0x188')](0x3,_0x150194,_0x483016)){if(_0x3cfcb0[_0xc6b6('0x177')]>=_0x483016[_0xc6b6('0x179')]){_0x489b0a['createStateFinal'](_0x3cfcb0,_0x4e1076,_0x73a4b1,_0xc6b6('0x18e'));}else{_0x489b0a[_0xc6b6('0x189')](_0x3cfcb0,_0x4e1076,_0x73a4b1,'reason\x203\x20ringing\x20no\x20answer');}}break;case'5':_0x483016[_0xc6b6('0x18f')]+=0x1;_0x3cfcb0[_0xc6b6('0xa6')]=0x5;_0x3cfcb0[_0xc6b6('0xa7')]=_0xc6b6('0x190');_0x3cfcb0[_0xc6b6('0x175')]+=0x1;_0x3cfcb0[_0xc6b6('0x191')]+=0x1;_0x489b0a[_0xc6b6('0xc4')](_0x3cfcb0)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x192')));if(_0x489b0a['checkRetriveMax'](0x5,_0x150194,_0x483016)){if(_0x3cfcb0['countbusyretry']>=_0x483016[_0xc6b6('0x193')]){_0x489b0a[_0xc6b6('0x18b')](_0x3cfcb0,_0x4e1076,_0x73a4b1,_0xc6b6('0x194'));}else{_0x489b0a[_0xc6b6('0x189')](_0x3cfcb0,_0x4e1076,_0x73a4b1,'reason\x205\x20busy');}}break;case'8':_0x483016[_0xc6b6('0x62')]+=0x1;_0x3cfcb0[_0xc6b6('0xa6')]=0x8;_0x3cfcb0[_0xc6b6('0xa7')]=_0xc6b6('0x195');_0x3cfcb0[_0xc6b6('0x176')]+=0x1;_0x3cfcb0[_0xc6b6('0x191')]+=0x1;_0x489b0a[_0xc6b6('0xc4')](_0x3cfcb0)['catch'](loggerCatch(_0xc6b6('0x196')));if(_0x489b0a[_0xc6b6('0x188')](0x8,_0x150194,_0x483016)){if(_0x3cfcb0[_0xc6b6('0x176')]>=_0x483016['dialCongestionMaxRetry']){_0x489b0a['createStateFinal'](_0x3cfcb0,_0x4e1076,_0x73a4b1,_0xc6b6('0x197'));}else{_0x489b0a[_0xc6b6('0x189')](_0x3cfcb0,_0x4e1076,_0x73a4b1,'reason\x208\x20congestion');}}break;default:_0x483016['outboundUnknownCallsDay']+=0x1;_0x3cfcb0[_0xc6b6('0xa6')]=0xc;_0x3cfcb0[_0xc6b6('0xa7')]=_0x29716f[_0xc6b6('0xf3')];_0x489b0a['createHistory'](_0x3cfcb0)[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x198')));if(_0x489b0a['checkRetriveMax'](_0x29716f[_0xc6b6('0xf3')],_0x150194,_0x483016)){if(_0x3cfcb0[_0xc6b6('0x175')]+_0x3cfcb0[_0xc6b6('0x176')]+_0x3cfcb0[_0xc6b6('0x177')]>=_0x483016['dialGlobalMaxRetry']){_0x489b0a[_0xc6b6('0x189')](_0x3cfcb0,_0x4e1076,_0x73a4b1,_0x29716f['reason']);}else{_0x489b0a[_0xc6b6('0x18b')](_0x3cfcb0,_0x4e1076,_0x73a4b1,_0x29716f['reason']);}}}});};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x189')]=function(_0x55ab31,_0x5c8e97,_0x2b6385,_0x28fb35){var _0x4b42d4=new Final(_0x55ab31);_0x4b42d4['state']=0xf;_0x4b42d4[_0xc6b6('0xa7')]=_0xc6b6('0x199');this['createStateFinal'](_0x4b42d4,_0x5c8e97,_0x2b6385,_0x28fb35);};Dialer['prototype'][_0xc6b6('0x18b')]=function(_0x555397,_0x8338a8,_0x37ceea,_0x1fef46){this[_0xc6b6('0xc3')](_0x555397)[_0xc6b6('0xb4')](function(_0x55e4ac){return _0x8338a8(msgResponse(_0xc6b6('0x183'),_0xc6b6('0xd2'),_0x1fef46));})[_0xc6b6('0xb5')](function(_0xc26ee9){return _0x37ceea(msgResponse(_0xc6b6('0x19a'),_0xc6b6('0x127'),_0xc6b6('0x19b')));});};Dialer[_0xc6b6('0xa9')][_0xc6b6('0xa')]=function(_0x544d13){var _0x31500b=this;var _0x13e9ee=_0x544d13[_0xc6b6('0x19c')]/0x64;var _0x5dcc8c=_0x544d13[_0xc6b6('0xfc')]/(_0x544d13[_0xc6b6('0xfc')]+_0x544d13['outboundAnswerCallsDay']);var _0xb801cf=Math[_0xc6b6('0x19d')](_0x544d13[_0xc6b6('0x70')]*(_0x544d13[_0xc6b6('0x19e')]/0x64));var _0x12297a=Math[_0xc6b6('0x19d')](_0x544d13['predictiveIntervalAvailable']*(_0x544d13[_0xc6b6('0x19f')]/0x64));var _0x56bc2e=_0x544d13[_0xc6b6('0x54')]+_0x544d13[_0xc6b6('0x58')];var _0x4d244b=Math[_0xc6b6('0x1a0')](_0x544d13['erlangCalls']*_0x544d13[_0xc6b6('0x73')]*_0x544d13['predictiveIntervalHitRate']*_0x544d13[_0xc6b6('0x6e')]);if(_[_0xc6b6('0x3f')](_0x544d13['startProgressive'])){if(!_['isUndefined'](_0x544d13[_0xc6b6('0x28')])){_0x544d13[_0xc6b6('0x28')]=undefined;loggerPredictive[_0xc6b6('0x94')](_0xc6b6('0x1a1'),_0xc6b6('0x1a2'));}if(!_[_0xc6b6('0x3f')](_0x544d13['handlePredictive'])){loggerPredictive[_0xc6b6('0x94')]('[startMethodPredictive][StartProgressive]',_0xc6b6('0x1a3'));clearInterval(_0x544d13['handlePredictive']);_0x544d13[_0xc6b6('0x90')]=undefined;}_0x544d13['startProgressive']=moment()['format'](_0xc6b6('0xf6'));loggerPredictive['info'](_0x544d13[_0xc6b6('0x44')],'collection\x20data\x20in\x20progressive\x20at',_0x544d13[_0xc6b6('0x29')]);this[_0xc6b6('0x138')](_0x544d13,0x1);}else if(ifInterval(_0x544d13[_0xc6b6('0x1a4')],_0x544d13[_0xc6b6('0x29')])){this[_0xc6b6('0x138')](_0x544d13,0x1);loggerPredictiveCalls[_0xc6b6('0x7c')](_0xc6b6('0x1a5'),_0x544d13[_0xc6b6('0x29')],_0x544d13['name']);_0x544d13[_0xc6b6('0x72')]=0x0;_0x544d13['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x13e9ee<_0x5dcc8c&&_0x544d13[_0xc6b6('0x1a6')]===_0xc6b6('0x1a7')){freeVariablesPredictive(_0x544d13);loggerPredictive['info'](_0xc6b6('0x1a8'),'Dropped\x20calls\x20day',_0x5dcc8c,_0xc6b6('0x29'),_0x544d13['name']);}else if(_0x4d244b<_0x544d13[_0xc6b6('0x6c')]&&_0x544d13[_0xc6b6('0x1a6')]===_0xc6b6('0x1a7')){freeVariablesPredictive(_0x544d13);loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x1a9'),_0xc6b6('0x1aa'),_0x4d244b,_0xc6b6('0x1ab'),_0x544d13[_0xc6b6('0x6c')],'startProgressive',_0x544d13[_0xc6b6('0x44')]);}else if(!ifInterval(_0x544d13[_0xc6b6('0x1a4')],_0x544d13[_0xc6b6('0x29')])&&_[_0xc6b6('0x3f')](_0x544d13[_0xc6b6('0x28')])&&!_['isUndefined'](_0x544d13[_0xc6b6('0x29')])){_0x544d13['startPredictive']=moment()['format'](_0xc6b6('0xf6'));loggerPredictive['info'](_0x544d13['name'],_0xc6b6('0x1ac'),_0x544d13[_0xc6b6('0x28')]);this['averageHandleTime'](_0x544d13['dialPredictiveInterval'])[_0xc6b6('0xb4')](this['getDataPredictive'](_0x544d13))[_0xc6b6('0xb4')](mergeDataErlangB(_0x544d13))[_0xc6b6('0xb4')](this[_0xc6b6('0x1ad')](_0x544d13))[_0xc6b6('0xb5')](loggerCatchPredictive(_0xc6b6('0x1ae'),_0x544d13));}else if(!ifInterval(_0x544d13[_0xc6b6('0x1a4')],_0x544d13[_0xc6b6('0x28')])){_0x544d13[_0xc6b6('0x6c')]=0x0;_0x544d13[_0xc6b6('0x28')]=moment()['format'](_0xc6b6('0xf6'));loggerPredictive[_0xc6b6('0x7c')](_0x544d13[_0xc6b6('0x44')],_0xc6b6('0x1af'),_0x544d13[_0xc6b6('0x28')]);clearInterval(_0x544d13[_0xc6b6('0x90')]);_0x544d13[_0xc6b6('0x90')]=undefined;this[_0xc6b6('0xbc')](_0x544d13[_0xc6b6('0x1a4')])[_0xc6b6('0xb4')](this['getDataPredictive'](_0x544d13))[_0xc6b6('0xb4')](mergeDataErlangB(_0x544d13))[_0xc6b6('0xb4')](this['startMethodPredictive'](_0x544d13))[_0xc6b6('0xb5')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x544d13));}else if(_0x544d13['predictiveIntervalAvailable']&&_0x56bc2e<_0x544d13[_0xc6b6('0x70')]-_0x12297a){freeVariablesPredictive(_0x544d13);loggerPredictive['info'](_0x544d13[_0xc6b6('0x44')],_0xc6b6('0x1b0'),_0x56bc2e,')\x20are\x20less\x20than\x20threshold\x20(',_0x544d13['predictiveIntervalAvailable'],'-',_0x12297a,'=',_0x544d13['predictiveIntervalAvailable']-_0x12297a,')');}else if(_0x544d13[_0xc6b6('0x70')]&&_0x56bc2e>_0x544d13['predictiveIntervalAvailable']+_0xb801cf){freeVariablesPredictive(_0x544d13);loggerPredictive[_0xc6b6('0x7c')](_0x544d13[_0xc6b6('0x44')],_0xc6b6('0x1b0'),_0x56bc2e,')\x20are\x20more\x20than\x20threshold\x20(',_0x544d13[_0xc6b6('0x70')],'+',_0xb801cf,'=',_0x544d13[_0xc6b6('0x70')]+_0xb801cf,')');}};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x1b1')]=function(_0x39c1a3){var _0x5395b4=this;return function(_0x2bdb16){return new BPromise(function(_0x97559,_0x1598cb){_[_0xc6b6('0x8d')](_0x39c1a3,_0x2bdb16[0x0]);if(checkGetDataPredictive(_0x2bdb16[0x0])){var _0x494f43=_0x39c1a3[_0xc6b6('0x70')]=_0x39c1a3[_0xc6b6('0x58')]+_0x39c1a3[_0xc6b6('0x54')];var _0x1dc318=_0x39c1a3[_0xc6b6('0x1a4')]*0x3c;var _0x449a45=_0x2bdb16[0x0]['predictiveIntervalAvgTalktime']+_0x2bdb16[0x0][_0xc6b6('0x68')];var _0x13f08f=(_0x2bdb16[0x0][_0xc6b6('0x67')]+_0x2bdb16[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2bdb16[0x0][_0xc6b6('0x6a')])/_0x2bdb16[0x0][_0xc6b6('0x83')];_0x39c1a3[_0xc6b6('0x6d')]=_0x13f08f>0x0?_0x13f08f:0x1;switch(_0x39c1a3[_0xc6b6('0x1a6')]){case _0xc6b6('0x1a7'):var _0x39f1bb=_0x39c1a3[_0xc6b6('0x19c')]/0x64;return _0x5395b4['abandonmentRate'](_0x494f43,_0x1dc318,_0x449a45,_0x13f08f,_0x39f1bb)[_0xc6b6('0xb4')](function(_0x29973c){return _0x97559(_0x29973c);});case'agentBusyFactor':var _0x508ca4=_0x39c1a3[_0xc6b6('0x19c')]/0x64;return _0x5395b4[_0xc6b6('0x1b2')](_0x494f43,_0x1dc318,_0x449a45,_0x13f08f,_0x508ca4)[_0xc6b6('0xb4')](function(_0x1c3421){return _0x97559(_0x1c3421);});default:return _0x1598cb(msgResponse(_0xc6b6('0x1b3'),_0xc6b6('0x127'),_0xc6b6('0x1b4')));}}else{return _0x1598cb(msgResponse(_0xc6b6('0x1b3'),_0xc6b6('0x127'),_0xc6b6('0x1b5')));}});};};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x1b6')]=function(_0x4cadc3){var _0x44c8e3=this;return function(_0x4ad0e2){return new BPromise(function(_0x340687,_0x20bd0c){_[_0xc6b6('0x8d')](_0x4cadc3,_0x4ad0e2[0x0]);if(checkGetDataPredictive(_0x4ad0e2[0x0])){loggerPredictive[_0xc6b6('0x7c')](JSON[_0xc6b6('0x4c')](_0x4ad0e2[0x0]));if(_0x4cadc3[_0xc6b6('0x1a6')]==='dropRate'){return _0x44c8e3[_0xc6b6('0xc2')](_0x4cadc3['id'])[_0xc6b6('0xb4')](function(_0x51b6bf){var _0x313196=_0x4cadc3[_0xc6b6('0x55')]-_0x51b6bf[0x0]['outboundQueuePauses'];var _0x26b87a=_0x4cadc3[_0xc6b6('0x1a4')]*0x3c;var _0x3603c7=_0x4ad0e2[0x0]['predictiveIntervalAvgTalktime']+_0x4ad0e2[0x0]['predictiveIntervalAvgHoldtime'];var _0x348ab5=(_0x4ad0e2[0x0][_0xc6b6('0x67')]+_0x4ad0e2[0x0][_0xc6b6('0x7e')]+_0x4ad0e2[0x0][_0xc6b6('0x6a')])/_0x4ad0e2[0x0]['predictiveIntervalTotalCalls'];var _0x326165=_0x4cadc3['dialPredictiveOptimizationPercentage']/0x64;_0x4cadc3[_0xc6b6('0x6f')]=_0x51b6bf[0x0][_0xc6b6('0x1b7')]||0x0;_0x4cadc3[_0xc6b6('0x6d')]=_0x348ab5>0x0?_0x348ab5:0x1;return _0x44c8e3[_0xc6b6('0x1b8')](_0x313196,_0x26b87a,_0x3603c7,_0x348ab5,_0x326165);})[_0xc6b6('0xb4')](function(_0x57f6d1){return _0x340687(_0x57f6d1);})[_0xc6b6('0xb5')](function(_0x9c0e3e){return _0x20bd0c(msgResponse('[CatchErlangB]',_0xc6b6('0x127'),JSON[_0xc6b6('0x4c')](_0x9c0e3e)));});}if(_0x4cadc3[_0xc6b6('0x1a6')]===_0xc6b6('0x1b9')){return _0x44c8e3[_0xc6b6('0xc2')](_0x4cadc3['id'])[_0xc6b6('0xb4')](function(_0x371a54){var _0x5aa520=_0x4cadc3[_0xc6b6('0x55')]-_0x371a54[0x0][_0xc6b6('0x1b7')];var _0x4fdbe3=_0x4cadc3['dialPredictiveInterval']*0x3c;var _0xcc6310=_0x4ad0e2[0x0][_0xc6b6('0x69')]+_0x4ad0e2[0x0]['predictiveIntervalAvgHoldtime'];var _0x1c3655=(_0x4ad0e2[0x0][_0xc6b6('0x67')]+_0x4ad0e2[0x0][_0xc6b6('0x7e')]+_0x4ad0e2[0x0][_0xc6b6('0x6a')])/_0x4ad0e2[0x0][_0xc6b6('0x83')];var _0x33b0c4=_0x4cadc3['dialPredictiveOptimizationPercentage']/0x64;_0x4cadc3[_0xc6b6('0x6f')]=_0x371a54[0x0][_0xc6b6('0x1b7')]||0x0;_0x4cadc3[_0xc6b6('0x6d')]=_0x1c3655>0x0?_0x1c3655:0x1;return _0x44c8e3[_0xc6b6('0x1b2')](_0x5aa520,_0x4fdbe3,_0xcc6310,_0x1c3655,_0x33b0c4);})[_0xc6b6('0xb4')](function(_0x25758f){return _0x340687(_0x25758f);})[_0xc6b6('0xb5')](function(_0x2f5332){return _0x20bd0c(msgResponse(_0xc6b6('0x1ba'),_0xc6b6('0x127'),JSON[_0xc6b6('0x4c')](_0x2f5332)));});}}else{return _0x20bd0c(msgResponse(_0xc6b6('0x1b3'),_0xc6b6('0x127'),'check\x20failure'));}});};};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x1ad')]=function(_0x181401){var _0x14c524=this;return function(){var _0xc4a438=0x0;var _0x493402=Math[_0xc6b6('0x1a0')](_0x181401[_0xc6b6('0x1bb')]*0x3e8);if(_0x493402>0x0){_0x493402=_0x493402<0x64?0x64:_0x493402;loggerPredictive['info'](_0x181401[_0xc6b6('0x44')],_0xc6b6('0x1bc'),_0x493402,_0xc6b6('0x4d'));_0x181401[_0xc6b6('0x90')]=setInterval(function(){_0x14c524['handlePredictive'](_0x181401);loggerPredictiveCalls[_0xc6b6('0x7c')](_0xc6b6('0x1bd'),_0xc4a438+=0x1);},_0x493402);}else{loggerPredictive['info'](_0x181401[_0xc6b6('0x44')],'fail\x20to\x20scheduled\x20calls');}};};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x1be')]=function(_0x1dd9ac,_0x40b63e){var _0x2f9c2b=this;return function(_0x419f8a){if(_[_0xc6b6('0x4a')](_0x419f8a)){if(_['isNil'](_0x40b63e[_0xc6b6('0xce')])||!_0x40b63e[_0xc6b6('0x1bf')]){if(_0x1dd9ac['dialMethod']===_0xc6b6('0x9')){_0x1dd9ac[_0xc6b6('0x10c')]=_[_0xc6b6('0x3f')](_0x1dd9ac['queueStatusComplete'])?!![]:_0x1dd9ac[_0xc6b6('0x10c')];var _0xddf717=uuid['v4']();_0x2f9c2b[_0xc6b6('0x103')][_0xddf717]=new Action(_0x1dd9ac,_0x40b63e,_0xddf717);loggerBooked[_0xc6b6('0x7c')](_0xc6b6('0x1c0'),_0xddf717,'queueStatusComplete:\x20',JSON[_0xc6b6('0x4c')](_0x1dd9ac[_0xc6b6('0x10c')]),'Queue:\x20',_0x1dd9ac[_0xc6b6('0x44')]);if(_0x1dd9ac[_0xc6b6('0x10c')]){_0x1dd9ac['queueStatusComplete']=![];_0x2f9c2b[_0xc6b6('0x107')][_0x2f9c2b[_0xc6b6('0x103')][_0xddf717]['queue']]=[];ami['Action']({'actionid':_0xddf717,'action':'queuestatus','queue':_0x1dd9ac[_0xc6b6('0x44')]})[_0xc6b6('0xb5')](function(_0x2126a0){_0x2f9c2b[_0xc6b6('0xb1')](_0x1dd9ac);_0x2f9c2b[_0xc6b6('0xbe')]({'active':![],'ContactId':_0x2f9c2b[_0xc6b6('0x103')][_0xddf717][_0xc6b6('0xcc')],'ListId':_0x2f9c2b['actions'][_0xddf717][_0xc6b6('0xcd')],'VoiceQueueId':_0x2f9c2b[_0xc6b6('0x103')][_0xddf717][_0xc6b6('0xcf')]||undefined,'CampaignId':_0x2f9c2b[_0xc6b6('0x103')][_0xddf717][_0xc6b6('0x110')]||undefined})[_0xc6b6('0xb5')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x2f9c2b['actions'][_0xddf717];});}else{loggerBooked[_0xc6b6('0x7c')]('[booked][checkContactBlack][else]',JSON[_0xc6b6('0x4c')](_0x1dd9ac[_0xc6b6('0x10c')]),_0xc6b6('0x1c1'),_0x1dd9ac[_0xc6b6('0x44')]);_0x2f9c2b[_0xc6b6('0xb1')](_0x1dd9ac);_0x2f9c2b[_0xc6b6('0xbe')]({'active':![],'ContactId':_0x2f9c2b['actions'][_0xddf717][_0xc6b6('0xcc')],'ListId':_0x2f9c2b[_0xc6b6('0x103')][_0xddf717][_0xc6b6('0xcd')],'VoiceQueueId':_0x2f9c2b[_0xc6b6('0x103')][_0xddf717]['VoiceQueueId']||undefined,'CampaignId':_0x2f9c2b[_0xc6b6('0x103')][_0xddf717][_0xc6b6('0x110')]||undefined})[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x1c2')));delete _0x2f9c2b[_0xc6b6('0x103')][_0xddf717];}}else{return _0x2f9c2b[_0xc6b6('0x145')](_0x1dd9ac,_0x40b63e);}}else{if(getDiff(_0x40b63e[_0xc6b6('0x1c3')])<_0x1dd9ac[_0xc6b6('0x1c4')]*0x3c){_0x2f9c2b['preview'][_0xc6b6('0x118')](_0x40b63e['id'])['finally'](function(){_0x2f9c2b[_0xc6b6('0xb1')](_0x1dd9ac);});}else{_0x1dd9ac['outboundReCallsDay']+=0x1;_0x2f9c2b[_0xc6b6('0xb1')](_0x1dd9ac);if(_0x1dd9ac[_0xc6b6('0x1c5')]){_0x2f9c2b[_0xc6b6('0xbe')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x40b63e[_0xc6b6('0xcc')],'ListId':_0x40b63e[_0xc6b6('0xcd')],'VoiceQueueId':_0x40b63e['VoiceQueueId']||undefined,'CampaignId':_0x40b63e[_0xc6b6('0x110')]||undefined})[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x1c6')));_0x2f9c2b[_0xc6b6('0xc4')](createObjHistory(_0x1dd9ac,_0x40b63e,_0xc6b6('0x1c7'),0x17,'RecallInQueue'))[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0x1c8')));}else{_0x2f9c2b[_0xc6b6('0xcb')](createObjHistory(_0x1dd9ac,_0x40b63e,_0xc6b6('0x1c9'),0x16,'RecallFailedTimeout'),'[Originate][HistoryRecallClose][historyCatch]',_0xc6b6('0x1ca'));}}}}else{_0x1dd9ac[_0xc6b6('0x1cb')]+=0x1;_0x2f9c2b[_0xc6b6('0xcb')](createObjHistory(_0x1dd9ac,_0x40b63e,_0xc6b6('0x1cc'),0xd,'Blacklist'),_0xc6b6('0x1cd'),_0xc6b6('0x1ce'));throw _0xc6b6('0x1cf');}};};Dialer['prototype']['handleIvr']=function(_0x29d032){var _0x507b07=this;var _0x1fe229=[];var _0xbed205=_0x29d032[_0xc6b6('0x1d0')]-_0x29d032[_0xc6b6('0x71')]-_0x29d032[_0xc6b6('0x1d1')];emitCampaignSummary(_0x29d032);if(_0xbed205>0x0){if(_0xbed205>this[_0xc6b6('0x26')]){_0xbed205=this[_0xc6b6('0x26')];}_0x29d032['temp']+=_0xbed205;this[_0xc6b6('0xc1')](_0x29d032['id'],_0xbed205,_0x29d032[_0xc6b6('0x1d2')])[_0xc6b6('0xb4')](function(_0x5580c3){_0x29d032[_0xc6b6('0x1d1')]-=_0xbed205;_0x29d032[_0xc6b6('0x1d1')]=_0x29d032['temp']>0x0?_0x29d032[_0xc6b6('0x1d1')]:0x0;if(!checkContactEmpty(_0x5580c3)){_0x29d032['message']=_0xc6b6('0x9d');logger[_0xc6b6('0x7c')]('[getContactCampaign2][Empty]'+_0x29d032[_0xc6b6('0x44')]);}else{_0x29d032[_0xc6b6('0x71')]+=_0x5580c3['length'];_0x29d032['message']=_0xc6b6('0x1d3');for(var _0x23d29e=0x0;_0x23d29e<_0x5580c3[_0xc6b6('0x113')];_0x23d29e+=0x1){_0x29d032[_0xc6b6('0x1d4')]+=0x1;if(_[_0xc6b6('0xd8')](_0x5580c3[_0x23d29e])||_[_0xc6b6('0xd8')](_0x5580c3[_0x23d29e][_0xc6b6('0x147')])||_['isNil'](_0x5580c3[_0x23d29e][_0xc6b6('0x147')]['phone'])){_0x507b07[_0xc6b6('0xc9')](_0xc6b6('0x1d5'),_0x29d032,_0x5580c3[_0x23d29e]);}else{_0x507b07[_0xc6b6('0xba')](_[_0xc6b6('0x109')](_0x5580c3[_0x23d29e],[_0xc6b6('0x110'),_0xc6b6('0x1d6')]))[_0xc6b6('0xb4')](_0x507b07['checkContactBlack'](_0x29d032,_0x5580c3[_0x23d29e]))[_0xc6b6('0xb5')](_0x507b07['loggerHandler']('[actionOriginateIvr]\x20',_0x29d032));}}}})[_0xc6b6('0xb5')](loggerGetContactDialer(_0xc6b6('0x1d7'),_0x29d032,_0xbed205));}};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x138')]=function(_0x1b7aea,_0x495098){var _0x4b61bd=this;var _0x2cccd0=[];var _0x15e1ec=_0x495098>=0x1?_0x495098:0x1;var _0x9e9a3f=[];if(_0x1b7aea['dialMethod']==='booked'){_0x15e1ec=0x1;}var _0x320612=Math['floor'](_0x1b7aea[_0xc6b6('0x54')]*_0x15e1ec)-_0x1b7aea[_0xc6b6('0x71')]-_0x1b7aea[_0xc6b6('0x1d1')];emitVoiceQueueSummary(_0x1b7aea);if(_0x1b7aea[_0xc6b6('0x1d8')]>0x0){var _0x37a855=_0x1b7aea[_0xc6b6('0x1d8')]-_0x1b7aea[_0xc6b6('0x71')]-_0x1b7aea[_0xc6b6('0x58')]-_0x1b7aea['temp']-_0x1b7aea[_0xc6b6('0x56')];if(_0x320612>_0x37a855){_0x320612=_0x37a855;}}if(_0x320612>0x0){if(_0x1b7aea['dialMethod']==='booked'){_0x320612=0x1;}if(_0x320612>this[_0xc6b6('0x26')]){_0x320612=this[_0xc6b6('0x26')];}_0x1b7aea[_0xc6b6('0x1d1')]+=_0x320612;for(var _0x3469ab in this[_0xc6b6('0x24')]){if(this['agents'][_0xc6b6('0x97')](_0x3469ab)){if(this[_0xc6b6('0x24')][_0x3469ab][_0xc6b6('0xa6')]===_0xc6b6('0x1d9')&&this[_0xc6b6('0x24')][_0x3469ab][_0xc6b6('0xd4')]===_0xc6b6('0xd5')){_0x2cccd0['push'](this[_0xc6b6('0x24')][_0x3469ab]['id']);}}}this[_0xc6b6('0xbf')](_0x1b7aea['id'],_0x2cccd0,_0x320612,_0x1b7aea[_0xc6b6('0x1d2')])[_0xc6b6('0xb4')](function(_0x84e101){_0x1b7aea[_0xc6b6('0x1d1')]-=_0x320612;_0x1b7aea[_0xc6b6('0x1d1')]=_0x1b7aea['temp']>0x0?_0x1b7aea[_0xc6b6('0x1d1')]:0x0;if(!checkContactEmpty(_0x84e101)){_0x4b61bd[_0xc6b6('0xb3')](_0x1b7aea)[_0xc6b6('0xb4')](sendMessageReschedule(_0x1b7aea))[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xb6')));}else{_0x1b7aea[_0xc6b6('0x71')]+=_0x84e101['length'];_0x1b7aea[_0xc6b6('0x40')]=_0x1b7aea[_0xc6b6('0x137')]===_0xc6b6('0x9')?_0xc6b6('0x150'):_0xc6b6('0x1d3');for(var _0x198b74=0x0;_0x198b74<_0x84e101[_0xc6b6('0x113')];_0x198b74+=0x1){if(_[_0xc6b6('0xd8')](_0x84e101[_0x198b74])||_[_0xc6b6('0xd8')](_0x84e101[_0x198b74][_0xc6b6('0x147')])||_[_0xc6b6('0xd8')](_0x84e101[_0x198b74][_0xc6b6('0x147')][_0xc6b6('0x148')])){_0x4b61bd[_0xc6b6('0xc9')](_0xc6b6('0x1d5'),_0x1b7aea,_0x84e101[_0x198b74]);}else{_0x4b61bd[_0xc6b6('0xb7')](_[_0xc6b6('0x109')](_0x84e101[_0x198b74],[_0xc6b6('0xcf'),_0xc6b6('0x1d6')]))[_0xc6b6('0xb4')](_0x4b61bd[_0xc6b6('0x1be')](_0x1b7aea,_0x84e101[_0x198b74]))[_0xc6b6('0xb5')](_0x4b61bd[_0xc6b6('0xc8')]('[actionOriginate]\x20',_0x1b7aea));}}}})['catch'](loggerGetContactDialer(_0xc6b6('0x1da'),_0x1b7aea,_0x320612));}};Dialer[_0xc6b6('0xa9')]['handlePredictive']=function(_0x1caca3){var _0x445188=this;if(_0x1caca3[_0xc6b6('0x1d8')]>0x0){var _0x1da124=_0x1caca3[_0xc6b6('0x1d8')]-_0x1caca3[_0xc6b6('0x71')]-_0x1caca3[_0xc6b6('0x58')];if(_0x1da124>0x0){this['tryOriginatePredictive'](_0x1caca3);}else{loggerPredictiveCalls[_0xc6b6('0x7c')](_0xc6b6('0x1db'));}}else{this[_0xc6b6('0x1dc')](_0x1caca3);}};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x1dc')]=function(_0x4f67a0){var _0x4bcda9=this;var _0x5aa472=[];_0x4f67a0[_0xc6b6('0x71')]+=0x1;for(var _0x29e08b in this['agents']){if(this['agents'][_0xc6b6('0x97')](_0x29e08b)){if(this[_0xc6b6('0x24')][_0x29e08b][_0xc6b6('0xa6')]===_0xc6b6('0x1d9')&&this[_0xc6b6('0x24')][_0x29e08b][_0xc6b6('0xd4')]===_0xc6b6('0xd5')){_0x5aa472[_0xc6b6('0x108')](this[_0xc6b6('0x24')][_0x29e08b]['id']);}}}this['getContactDialer'](_0x4f67a0['id'],_0x5aa472,0x1,_0x4f67a0[_0xc6b6('0x1d2')])[_0xc6b6('0xb4')](function(_0x13a09d){if(!checkContactEmpty(_0x13a09d)){checkContactLowerLimitOriginate(_0x4f67a0,0x1,0x0);_0x4bcda9[_0xc6b6('0xb3')](_0x4f67a0)[_0xc6b6('0xb4')](sendMessageReschedule(_0x4f67a0))[_0xc6b6('0xb5')](loggerCatch(_0xc6b6('0xb6')));}else{_0x4f67a0['message']='RUNNING';if(_[_0xc6b6('0xd8')](_0x13a09d[0x0])||_[_0xc6b6('0xd8')](_0x13a09d[0x0][_0xc6b6('0x147')])||_['isNil'](_0x13a09d[0x0][_0xc6b6('0x147')][_0xc6b6('0x148')])){_0x4bcda9[_0xc6b6('0xc9')](_0xc6b6('0x1d5'),_0x4f67a0,_0x13a09d[0x0]);}else{_0x4bcda9[_0xc6b6('0xb7')](_['pick'](_0x13a09d[0x0],['VoiceQueueId',_0xc6b6('0x1d6')]))[_0xc6b6('0xb4')](_0x4bcda9[_0xc6b6('0x1be')](_0x4f67a0,_0x13a09d[0x0]))[_0xc6b6('0xb5')](_0x4bcda9['loggerHandler'](_0xc6b6('0x1dd'),_0x4f67a0));}}})[_0xc6b6('0xb5')](loggerGetContactDialer(_0xc6b6('0x1de'),_0x4f67a0,0x1));emitVoiceQueueSummary(_0x4f67a0);};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x1b8')]=function(_0x385e44,_0x438872,_0x3aee8f,_0x4bc50e,_0x39c3d6,_0x47e7d3){loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x1df'));loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x1e0'),_0x385e44);loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x1e1'),_0x438872);loggerPredictive['info'](_0xc6b6('0x1e2'),_0x3aee8f);loggerPredictive[_0xc6b6('0x7c')]('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',_0x4bc50e);loggerPredictive[_0xc6b6('0x7c')]('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x39c3d6);loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x82'));return new BPromise(function(_0x305bae,_0x5c43bb){if(_0x385e44<=0x0||isNaN(_0x385e44)){return _0x5c43bb(msgResponse(_0xc6b6('0x1e3'),_0xc6b6('0x171'),_0xc6b6('0x1e4')+_0x385e44));}if(_0x3aee8f<=0x0||isNaN(_0x3aee8f)){return _0x5c43bb(msgResponse(_0xc6b6('0x1e3'),'Error',_0xc6b6('0x1e5')+_0x3aee8f));}if(_0x4bc50e<=0x0||isNaN(_0x4bc50e)){return _0x5c43bb(msgResponse('[abandonmentRate]',_0xc6b6('0x171'),_0xc6b6('0x1e6')+_0x4bc50e));}if(_0x438872<=0x0||isNaN(_0x438872)){return _0x5c43bb(msgResponse(_0xc6b6('0x1e3'),'Error',_0xc6b6('0x1e7')+_0x438872));}if(_0x39c3d6<=0x0||isNaN(_0x39c3d6)){return _0x5c43bb(msgResponse(_0xc6b6('0x1e3'),_0xc6b6('0x171'),_0xc6b6('0x1e8')+_0x39c3d6));}_0x47e7d3=_0x47e7d3||0x0;var _0x528f3a=0x1/_0x3aee8f;var _0x237acf=0x0;var _0x428690=0x0;var _0x19b8f1=0x0;var _0x58ea9f=0x0;for(var _0x180d38=0x0;_0x19b8f1<_0x39c3d6;_0x180d38+=0x1){_0x428690=_0x180d38/_0x438872;_0x237acf=(_0x4bc50e*_0x428690+_0x47e7d3)/_0x528f3a;_0x19b8f1=erlangb(_0x237acf,_0x385e44);_0x58ea9f=_0x237acf/_0x385e44*(0x1-erlangb(_0x237acf,_0x385e44));}return _0x305bae({'erlangCalls':_0x180d38,'erlangCallToSecond':_0x438872/_0x180d38,'erlangAbandonmentRate':_0x19b8f1,'erlangBusyFactor':_0x58ea9f});});};Dialer[_0xc6b6('0xa9')][_0xc6b6('0x1b2')]=function(_0x288d35,_0x358355,_0x170765,_0x1d109a,_0x22da7d,_0x2dc856){loggerPredictive[_0xc6b6('0x7c')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x1e0'),_0x288d35);loggerPredictive[_0xc6b6('0x7c')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x358355);loggerPredictive['info'](_0xc6b6('0x1e2'),_0x170765);loggerPredictive[_0xc6b6('0x7c')]('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',_0x1d109a);loggerPredictive[_0xc6b6('0x7c')](_0xc6b6('0x1e9'),_0x22da7d);loggerPredictive[_0xc6b6('0x7c')]('---------------------------');return new BPromise(function(_0x18f8be,_0x3fbcac){if(_0x288d35<=0x0||isNaN(_0x288d35)){return _0x3fbcac(msgResponse('[busyFactor]','Error',_0xc6b6('0x1e4')+_0x288d35));}if(_0x170765<=0x0||isNaN(_0x170765)){return _0x3fbcac(msgResponse('[busyFactor]',_0xc6b6('0x171'),_0xc6b6('0x1e5')+_0x170765));}if(_0x1d109a<=0x0||isNaN(_0x1d109a)){return _0x3fbcac(msgResponse(_0xc6b6('0x1ea'),_0xc6b6('0x171'),_0xc6b6('0x1e6')+_0x1d109a));}if(_0x358355<=0x0||isNaN(_0x358355)){return _0x3fbcac(msgResponse(_0xc6b6('0x1ea'),'Error',_0xc6b6('0x1e7')+_0x358355));}if(_0x22da7d<=0x0||isNaN(_0x22da7d)){return _0x3fbcac(msgResponse(_0xc6b6('0x1ea'),_0xc6b6('0x171'),_0xc6b6('0x1eb')+_0x22da7d));}_0x2dc856=_0x2dc856||0x0;var _0x1f9502=0x1/_0x170765;var _0x292b9e=0x0;var _0x532eab=0x0;var _0x189275=0x0;var _0x1eaaee=0x0;for(var _0x492a57=0x0;_0x1eaaee<_0x22da7d;_0x492a57+=0x1){_0x532eab=_0x492a57/_0x358355;_0x292b9e=(_0x1d109a*_0x532eab+_0x2dc856)/_0x1f9502;_0x189275=erlangb(_0x292b9e,_0x288d35);_0x1eaaee=_0x292b9e/_0x288d35*(0x1-erlangb(_0x292b9e,_0x288d35));}return _0x18f8be({'erlangCalls':_0x492a57,'erlangCallToSecond':_0x358355/_0x492a57,'erlangAbandonmentRate':_0x189275,'erlangBusyFactor':_0x1eaaee});});};module[_0xc6b6('0x1ec')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index bdf17c6..3fc00f6 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 _0x016e=['countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','scheduledat','type','campaigntype','queue'];(function(_0x28fbbf,_0x11f896){var _0x543af6=function(_0x27fa74){while(--_0x27fa74){_0x28fbbf['push'](_0x28fbbf['shift']());}};_0x543af6(++_0x11f896);}(_0x016e,0x1b5));var _0xe016=function(_0x33e558,_0xfe0cc4){_0x33e558=_0x33e558-0x0;var _0x408de9=_0x016e[_0x33e558];return _0x408de9;};'use strict';var util=require(_0xe016('0x0'));var _=require(_0xe016('0x1'));var moment=require('moment');function getSeconds(_0x62378c,_0x34f29c){var _0x1f211f=moment(_0x62378c)[_0xe016('0x2')](0x0);var _0x510e02=moment(_0x34f29c)[_0xe016('0x2')](0x0);return _0x1f211f['diff'](_0x510e02,'seconds');}function QueueCallerAbandon(_0x2e843e,_0x141403){this[_0xe016('0x3')]=_0x2e843e[_0xe016('0x3')];this[_0xe016('0x4')]=_0x2e843e[_0xe016('0x4')];this[_0xe016('0x5')]=_0x2e843e['type']==='outbound'?_0xe016('0x6'):_0x2e843e[_0xe016('0x4')];this[_0xe016('0x7')]=_0x2e843e[_0xe016('0x7')];this[_0xe016('0x8')]=_0x2e843e[_0xe016('0x8')];this[_0xe016('0x9')]=_0x2e843e[_0xe016('0x9')];this[_0xe016('0xa')]=_0x2e843e[_0xe016('0x7')]+_0x2e843e[_0xe016('0x8')]+_0x2e843e['countnoanswerretry'];this[_0xe016('0xb')]=_0x141403[_0xe016('0xb')];this[_0xe016('0xc')]=_0x2e843e[_0xe016('0xd')];this[_0xe016('0xe')]=_0x2e843e['number'];this[_0xe016('0xf')]=_0x2e843e[_0xe016('0xf')];this['responsetime']=_0x2e843e[_0xe016('0x10')];this[_0xe016('0x11')]=_0x2e843e[_0xe016('0x11')];this[_0xe016('0x12')]=this[_0xe016('0x11')];this[_0xe016('0x13')]=getSeconds(_0x2e843e[_0xe016('0x10')],_0x2e843e[_0xe016('0xf')]);this[_0xe016('0x14')]=getSeconds(this[_0xe016('0x11')],_0x2e843e[_0xe016('0x10')]);this[_0xe016('0x15')]=0x0;this[_0xe016('0x6')]=_0x141403['queue'];this[_0xe016('0x16')]=_0x141403[_0xe016('0x17')];this['reason']=_0x141403[_0xe016('0x18')];this[_0xe016('0x19')]=_0x2e843e['callback'];this[_0xe016('0x1a')]=_0x2e843e[_0xe016('0x1a')];this[_0xe016('0x1b')]=_0x2e843e[_0xe016('0x1b')];this[_0xe016('0x1c')]=_0x2e843e['recallme'];this[_0xe016('0x1d')]=_0x2e843e[_0xe016('0x1d')];this[_0xe016('0x1e')]=_0x2e843e[_0xe016('0x1e')];this[_0xe016('0x1f')]=_0x2e843e[_0xe016('0x1f')];this[_0xe016('0x20')]=_0x2e843e['VoiceQueueId'];this[_0xe016('0x21')]=_0x2e843e[_0xe016('0x21')];this[_0xe016('0x22')]=_0x2e843e[_0xe016('0x22')]||'';this[_0xe016('0x23')]=_0x2e843e['originatecalleridname']||'';}module[_0xe016('0x24')]=QueueCallerAbandon; \ No newline at end of file +var _0x2a78=['countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','scheduledat','type','campaigntype','queue'];(function(_0x44c23a,_0x95aba7){var _0x1ce6f8=function(_0x3f4065){while(--_0x3f4065){_0x44c23a['push'](_0x44c23a['shift']());}};_0x1ce6f8(++_0x95aba7);}(_0x2a78,0x67));var _0x82a7=function(_0x5898cd,_0x30bf84){_0x5898cd=_0x5898cd-0x0;var _0x3ae503=_0x2a78[_0x5898cd];return _0x3ae503;};'use strict';var util=require(_0x82a7('0x0'));var _=require(_0x82a7('0x1'));var moment=require('moment');function getSeconds(_0x142611,_0x3cadc5){var _0x1ba4c8=moment(_0x142611)[_0x82a7('0x2')](0x0);var _0x5f4c01=moment(_0x3cadc5)['milliseconds'](0x0);return _0x1ba4c8[_0x82a7('0x3')](_0x5f4c01,'seconds');}function QueueCallerAbandon(_0x2ceb7d,_0x1f71da){this[_0x82a7('0x4')]=_0x2ceb7d[_0x82a7('0x4')];this[_0x82a7('0x5')]=_0x2ceb7d[_0x82a7('0x5')];this[_0x82a7('0x6')]=_0x2ceb7d[_0x82a7('0x5')]==='outbound'?_0x82a7('0x7'):_0x2ceb7d[_0x82a7('0x5')];this[_0x82a7('0x8')]=_0x2ceb7d[_0x82a7('0x8')];this[_0x82a7('0x9')]=_0x2ceb7d[_0x82a7('0x9')];this[_0x82a7('0xa')]=_0x2ceb7d['countnoanswerretry'];this['countglobal']=_0x2ceb7d[_0x82a7('0x8')]+_0x2ceb7d['countcongestionretry']+_0x2ceb7d[_0x82a7('0xa')];this[_0x82a7('0xb')]=_0x1f71da[_0x82a7('0xb')];this[_0x82a7('0xc')]=_0x2ceb7d['name'];this[_0x82a7('0xd')]=_0x2ceb7d[_0x82a7('0xe')];this[_0x82a7('0xf')]=_0x2ceb7d[_0x82a7('0xf')];this[_0x82a7('0x10')]=_0x2ceb7d['responsetime'];this[_0x82a7('0x11')]=_0x2ceb7d['droptime'];this[_0x82a7('0x12')]=this[_0x82a7('0x11')];this[_0x82a7('0x13')]=getSeconds(_0x2ceb7d[_0x82a7('0x10')],_0x2ceb7d[_0x82a7('0xf')]);this[_0x82a7('0x14')]=getSeconds(this[_0x82a7('0x11')],_0x2ceb7d[_0x82a7('0x10')]);this[_0x82a7('0x15')]=0x0;this['queue']=_0x1f71da[_0x82a7('0x7')];this[_0x82a7('0x16')]=_0x1f71da[_0x82a7('0x17')];this[_0x82a7('0x18')]=_0x1f71da[_0x82a7('0x18')];this[_0x82a7('0x19')]=_0x2ceb7d[_0x82a7('0x19')];this['callbackuniqueid']=_0x2ceb7d[_0x82a7('0x1a')];this[_0x82a7('0x1b')]=_0x2ceb7d[_0x82a7('0x1b')];this[_0x82a7('0x1c')]=_0x2ceb7d[_0x82a7('0x1c')];this[_0x82a7('0x1d')]=_0x2ceb7d[_0x82a7('0x1d')];this['ListId']=_0x2ceb7d[_0x82a7('0x1e')];this[_0x82a7('0x1f')]=_0x2ceb7d['UserId'];this[_0x82a7('0x20')]=_0x2ceb7d[_0x82a7('0x20')];this[_0x82a7('0x21')]=_0x2ceb7d[_0x82a7('0x21')];this[_0x82a7('0x22')]=_0x2ceb7d[_0x82a7('0x22')]||'';this[_0x82a7('0x23')]=_0x2ceb7d['originatecalleridname']||'';}module[_0x82a7('0x24')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index ed3cd0d..63f9959 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 _0x3f28=['%s/%s/%s','Trunk','name','fax','localstationid','headerinfo','path','AttachmentId','lodash','moment','format'];(function(_0x13f693,_0x49f342){var _0x12fea5=function(_0x3dbb46){while(--_0x3dbb46){_0x13f693['push'](_0x13f693['shift']());}};_0x12fea5(++_0x49f342);}(_0x3f28,0x1cb));var _0x83f2=function(_0x40f145,_0x25c1b2){_0x40f145=_0x40f145-0x0;var _0x531722=_0x3f28[_0x40f145];return _0x531722;};'use strict';var util=require('util');var _=require(_0x83f2('0x0'));var moment=require(_0x83f2('0x1'));function Action(_0x52e28b,_0x2afc02,_0x11d137){this['uniqueid']=_0x52e28b||undefined;this['channel']=util[_0x83f2('0x2')](_0x83f2('0x3'),_0x2afc02['tech'],_0x2afc02[_0x83f2('0x4')][_0x83f2('0x5')],_0x11d137[_0x83f2('0x6')]);this[_0x83f2('0x7')]=_0x2afc02[_0x83f2('0x7')];this['headerinfo']=_0x2afc02[_0x83f2('0x8')];this[_0x83f2('0x9')]=_0x11d137['path'];this[_0x83f2('0xa')]=_0x11d137[_0x83f2('0xa')];}module['exports']=Action; \ No newline at end of file +var _0xe710=['format','%s/%s/%s','tech','name','fax','localstationid','headerinfo','path','AttachmentId','util','moment','uniqueid','channel'];(function(_0x1025f6,_0x57597c){var _0x1b163a=function(_0x285eb0){while(--_0x285eb0){_0x1025f6['push'](_0x1025f6['shift']());}};_0x1b163a(++_0x57597c);}(_0xe710,0xb2));var _0x0e71=function(_0x4bd902,_0x281624){_0x4bd902=_0x4bd902-0x0;var _0x402011=_0xe710[_0x4bd902];return _0x402011;};'use strict';var util=require(_0x0e71('0x0'));var _=require('lodash');var moment=require(_0x0e71('0x1'));function Action(_0x142178,_0x2ebe83,_0x2045cc){this[_0x0e71('0x2')]=_0x142178||undefined;this[_0x0e71('0x3')]=util[_0x0e71('0x4')](_0x0e71('0x5'),_0x2ebe83[_0x0e71('0x6')],_0x2ebe83['Trunk'][_0x0e71('0x7')],_0x2045cc[_0x0e71('0x8')]);this[_0x0e71('0x9')]=_0x2ebe83[_0x0e71('0x9')];this[_0x0e71('0xa')]=_0x2ebe83[_0x0e71('0xa')];this[_0x0e71('0xb')]=_0x2045cc[_0x0e71('0xb')];this[_0x0e71('0xc')]=_0x2045cc[_0x0e71('0xc')];}module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/fax/index.js b/server/services/ami/fax/index.js index 963a432..2b203ec 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 _0x121f=['pagestransferred','resolution','transferrate','calleridnum','message','create','parse','.pdf','application/pdf','notify','error','stringify','catch','\x20receiveFax\x20','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','then','[Fax][Message][Error][Updated]','logger','[Fax][Message][Error][NoUpdate2]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','checkTrunk','Trunk','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','ext','isNil','active','SIP/%s','reachable','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','moment','path','./util/gs','fax','../ami','./channel','./util/util','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','bind','varset','syncVarSet','faxstatus','syncFaxStatus','hangup','syncHangup','syncOriginateResponse','prototype','syncNewchannel','context','from-voip-provider','exten','channel','uniqueid','name','info','\x20syncNewchannel\x20','variable','hasOwnProperty','value','syncNewState','channelstate','channelstatedesc','syncNewExten','operation','status','localstationid','filename','\x20syncFaxStatus\x20','syncReceiveFax','remotestationid'];(function(_0x52575a,_0x3b3293){var _0x120af8=function(_0x15cc1d){while(--_0x15cc1d){_0x52575a['push'](_0x52575a['shift']());}};_0x120af8(++_0x3b3293);}(_0x121f,0x120));var _0xf121=function(_0x2d89ce,_0x24d58d){_0x2d89ce=_0x2d89ce-0x0;var _0x3fad10=_0x121f[_0x2d89ce];return _0x3fad10;};'use strict';var util=require(_0xf121('0x0'));var _=require(_0xf121('0x1'));var BPromise=require(_0xf121('0x2'));var uuid=require('uuid');var moment=require(_0xf121('0x3'));var path=require(_0xf121('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xf121('0x5'));var logger=require('../../../config/logger')(_0xf121('0x6'));var ami=require(_0xf121('0x7'));var rpcDb=require('./rpcDb');var Channel=require(_0xf121('0x8'));var ut=require(_0xf121('0x9'));var Action=require('./action');var faxAccount=require('../rpc/faxAccount');var attachment=require(_0xf121('0xa'));var faxMessage=require(_0xf121('0xb'));function Fax(_0xdca03){this[_0xf121('0xc')]={};this['faxAccounts']=_0xdca03[_0xf121('0xd')];this[_0xf121('0xe')]=_0xdca03[_0xf121('0xe')];this[_0xf121('0xf')]={};ami['on']('newchannel',this['syncNewchannel'][_0xf121('0x10')](this));ami['on'](_0xf121('0x11'),this[_0xf121('0x12')][_0xf121('0x10')](this));ami['on']('newstate',this['syncNewState'][_0xf121('0x10')](this));ami['on']('newexten',this['syncNewExten'][_0xf121('0x10')](this));ami['on'](_0xf121('0x13'),this[_0xf121('0x14')][_0xf121('0x10')](this));ami['on']('receivefax',this['syncReceiveFax'][_0xf121('0x10')](this));ami['on'](_0xf121('0x15'),this[_0xf121('0x16')][_0xf121('0x10')](this));ami['on']('originateresponse',this[_0xf121('0x17')][_0xf121('0x10')](this));}Fax[_0xf121('0x18')][_0xf121('0x19')]=function(_0x409dd5){if(_0x409dd5[_0xf121('0x1a')]===_0xf121('0x1b')){for(var _0x48ddff in this[_0xf121('0xd')]){if(this[_0xf121('0xd')]['hasOwnProperty'](_0x48ddff)){if(_0x409dd5[_0xf121('0x1c')]===this[_0xf121('0xd')][_0x48ddff]['localstationid']){this[_0xf121('0xc')][_0x409dd5['uniqueid']]={};this[_0xf121('0xc')][_0x409dd5['uniqueid']][_0xf121('0x1d')]=_0x409dd5[_0xf121('0x1d')];this[_0xf121('0xc')][_0x409dd5[_0xf121('0x1e')]]['id']=this['faxAccounts'][_0x48ddff]['id'];this[_0xf121('0xc')][_0x409dd5[_0xf121('0x1e')]]['name']=this[_0xf121('0xd')][_0x48ddff][_0xf121('0x1f')];logger[_0xf121('0x20')](_0x409dd5['uniqueid'],_0xf121('0x21'));}}}}if(this[_0xf121('0xf')][_0x409dd5[_0xf121('0x1e')]]){this['channels'][_0x409dd5[_0xf121('0x1e')]]={};this[_0xf121('0xc')][_0x409dd5[_0xf121('0x1e')]]['channel']=_0x409dd5[_0xf121('0x1d')];logger[_0xf121('0x20')](_0x409dd5[_0xf121('0x1e')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0xf121('0x12')]=function(_0x45b9c1){if(this[_0xf121('0xc')][_0x45b9c1[_0xf121('0x1e')]]){for(var _0x33e0f0 in _0x45b9c1[_0xf121('0x22')]){if(_0x45b9c1['variable'][_0xf121('0x23')](_0x33e0f0)){this[_0xf121('0xc')][_0x45b9c1['uniqueid']][_0x33e0f0]=_0x45b9c1[_0xf121('0x24')];}}}};Fax[_0xf121('0x18')][_0xf121('0x25')]=function(_0x3fe745){if(this[_0xf121('0xc')][_0x3fe745[_0xf121('0x1e')]]){this[_0xf121('0xc')][_0x3fe745[_0xf121('0x1e')]][_0xf121('0x26')]=_0x3fe745['channelstate'];this[_0xf121('0xc')][_0x3fe745['uniqueid']][_0xf121('0x27')]=_0x3fe745[_0xf121('0x27')];}};Fax[_0xf121('0x18')][_0xf121('0x28')]=function(_0x46cc33){if(this[_0xf121('0xc')][_0x46cc33[_0xf121('0x1e')]]){for(var _0x1c743e in _0x46cc33['variable']){if(_0x46cc33[_0xf121('0x22')][_0xf121('0x23')](_0x1c743e)){this[_0xf121('0xc')][_0x46cc33[_0xf121('0x1e')]][_0x1c743e]=_0x46cc33[_0xf121('0x24')];}}}};Fax[_0xf121('0x18')][_0xf121('0x14')]=function(_0x2d5dd0){if(this[_0xf121('0xc')][_0x2d5dd0[_0xf121('0x1e')]]){this[_0xf121('0xc')][_0x2d5dd0[_0xf121('0x1e')]][_0xf121('0x29')]=_0x2d5dd0[_0xf121('0x29')];this[_0xf121('0xc')][_0x2d5dd0[_0xf121('0x1e')]][_0xf121('0x2a')]=_0x2d5dd0[_0xf121('0x2a')];this[_0xf121('0xc')][_0x2d5dd0['uniqueid']][_0xf121('0x2b')]=_0x2d5dd0[_0xf121('0x2b')];this[_0xf121('0xc')][_0x2d5dd0[_0xf121('0x1e')]][_0xf121('0x2c')]=_0x2d5dd0[_0xf121('0x2c')];logger[_0xf121('0x20')](_0x2d5dd0['uniqueid'],_0xf121('0x2d'));}};Fax[_0xf121('0x18')][_0xf121('0x2e')]=function(_0x13d59a){var _0x4c2880=this;if(this[_0xf121('0xc')][_0x13d59a[_0xf121('0x1e')]]){var _0x2e4c0f=this[_0xf121('0xc')][_0x13d59a[_0xf121('0x1e')]]['id'];this[_0xf121('0xc')][_0x13d59a[_0xf121('0x1e')]][_0xf121('0x2f')]=_0x13d59a['remotestationid'];this[_0xf121('0xc')][_0x13d59a[_0xf121('0x1e')]][_0xf121('0x30')]=_0x13d59a['pagestransferred'];this['channels'][_0x13d59a['uniqueid']][_0xf121('0x2b')]=_0x13d59a[_0xf121('0x2b')];this[_0xf121('0xc')][_0x13d59a[_0xf121('0x1e')]][_0xf121('0x31')]=_0x13d59a['resolution'];this[_0xf121('0xc')][_0x13d59a['uniqueid']][_0xf121('0x32')]=_0x13d59a[_0xf121('0x32')];this['channels'][_0x13d59a[_0xf121('0x1e')]][_0xf121('0x2c')]=_0x13d59a[_0xf121('0x2c')];this[_0xf121('0xc')][_0x13d59a[_0xf121('0x1e')]]['calleridnum']=_0x13d59a[_0xf121('0x33')];if(this[_0xf121('0xc')][_0x13d59a[_0xf121('0x1e')]][_0xf121('0x30')]>0x0){tiff2pdf(_0x13d59a[_0xf121('0x2c')],'/var/opt/motion2/server/files/attachments/',function(_0x30ad2a){logger[_0xf121('0x20')](_0x13d59a[_0xf121('0x1e')],'\x20result\x20conversion\x20file\x20',_0x30ad2a[_0xf121('0x34')]);attachment[_0xf121('0x35')]({'name':path[_0xf121('0x36')](_0x13d59a[_0xf121('0x2c')])[_0xf121('0x1f')],'basename':path['parse'](_0x13d59a['filename'])[_0xf121('0x1f')]+_0xf121('0x37'),'type':_0xf121('0x38')})['then'](function(_0x40fcd4){faxAccount[_0xf121('0x39')](_0x2e4c0f,{'from':_0x13d59a[_0xf121('0x33')],'mapKey':_0xf121('0x6'),'body':path[_0xf121('0x36')](_0x13d59a[_0xf121('0x2c')])[_0xf121('0x1f')]+_0xf121('0x37'),'AttachmentId':_0x40fcd4['id']})['catch'](function(_0x57f551){logger[_0xf121('0x3a')](_0x13d59a[_0xf121('0x1e')],'\x20notify\x20',JSON[_0xf121('0x3b')](_0x57f551));});})[_0xf121('0x3c')](function(_0x555ca6){logger[_0xf121('0x3a')](_0x13d59a[_0xf121('0x1e')],_0xf121('0x3d'),JSON[_0xf121('0x3b')](_0x555ca6));});});}logger[_0xf121('0x20')](_0x13d59a[_0xf121('0x1e')],_0xf121('0x3d'));}};Fax['prototype'][_0xf121('0x17')]=function(_0x105808){if(this['actions'][_0x105808['uniqueid']]){_['merge'](this[_0xf121('0xc')][_0x105808[_0xf121('0x1e')]],_[_0xf121('0x3e')](_0x105808,[_0xf121('0x3f'),_0xf121('0x40')]));}};function updateStatus(_0x5dcba2){if(_0x5dcba2['AttachmentId']){faxMessage[_0xf121('0x41')](_0x5dcba2[_0xf121('0x42')],{'failMessage':_0xf121('0x43')})[_0xf121('0x44')](function(_0x495f7e){ut['logger'](_0xf121('0x45'),_0x495f7e);})[_0xf121('0x3c')](function(_0x432d89){ut[_0xf121('0x46')]('[Fax][Message][Error][NoUpdate1]',_0x432d89);});}else{ut[_0xf121('0x46')](_0xf121('0x47'));}}Fax[_0xf121('0x18')]['updateStatus']=function(_0x1238e3,_0x3a5785,_0x57275a){var _0x53e0de=this;var _0xbaeb12={};if(_0x3a5785){_0xbaeb12={'read':_0x3a5785};}else{_0xbaeb12={'failMessage':_0x57275a};}if(this[_0xf121('0xf')][_0x1238e3][_0xf121('0x42')]){faxMessage[_0xf121('0x41')](this[_0xf121('0xf')][_0x1238e3][_0xf121('0x42')],_0xbaeb12)[_0xf121('0x44')](function(_0x292629){ut['logger']('[Fax][Message][Updated]',_0x292629);})['catch'](function(_0x6f8bc6){ut['logger'](_0xf121('0x48'),_0x6f8bc6);})['finally'](function(){delete _0x53e0de[_0xf121('0xc')][_0x1238e3];delete _0x53e0de['actions'][_0x1238e3];});}else{ut[_0xf121('0x46')](_0xf121('0x49'));delete this[_0xf121('0xc')][_0x1238e3];delete this[_0xf121('0xf')][_0x1238e3];}};Fax['prototype'][_0xf121('0x16')]=function(_0x12b5c4){var _0x44a461=this;if(this['channels'][_0x12b5c4[_0xf121('0x1e')]]){if(this['actions'][_0x12b5c4[_0xf121('0x1e')]]){this[_0xf121('0xc')][_0x12b5c4[_0xf121('0x1e')]]['id']=this[_0xf121('0xf')][_0x12b5c4['uniqueid']]['id'];this[_0xf121('0xc')][_0x12b5c4[_0xf121('0x1e')]][_0xf121('0x1f')]=this[_0xf121('0xf')][_0x12b5c4[_0xf121('0x1e')]]['name'];}logger[_0xf121('0x20')](_0x12b5c4[_0xf121('0x1e')],this[_0xf121('0xf')][_0x12b5c4[_0xf121('0x1e')]]?_0xf121('0x4a'):_0xf121('0x4b'),JSON[_0xf121('0x3b')](this[_0xf121('0xc')][_0x12b5c4['uniqueid']]));if(this['actions'][_0x12b5c4[_0xf121('0x1e')]]){if(this[_0xf121('0xc')][_0x12b5c4[_0xf121('0x1e')]][_0xf121('0x4c')]>0x0&&this[_0xf121('0xc')][_0x12b5c4[_0xf121('0x1e')]][_0xf121('0x13')]===_0xf121('0x4d')){this[_0xf121('0x4e')](_0x12b5c4[_0xf121('0x1e')],!![]);}else{this[_0xf121('0x4e')](_0x12b5c4['uniqueid'],![],this['channels'][_0x12b5c4[_0xf121('0x1e')]][_0xf121('0x4f')]?_0xf121('0x50')+this[_0xf121('0xc')][_0x12b5c4[_0xf121('0x1e')]][_0xf121('0x4f')]:_0xf121('0x51'));}}}};Fax['prototype'][_0xf121('0x52')]=function(_0x4d9c63){var _0x8d2a90=this;return new BPromise(function(_0x4fa09e,_0x5551aa){_0x8d2a90[_0xf121('0x53')](_0x4d9c63,_0x8d2a90[_0xf121('0xd')][_0x4d9c63[_0xf121('0x54')]])[_0xf121('0x44')](function(_0x103394){ut[_0xf121('0x46')]('[Fax][execOriginate][success]',_0x103394);_0x4fa09e(ut['message'](_0xf121('0x55')));})[_0xf121('0x3c')](function(_0x3b1ef4){ut[_0xf121('0x46')](_0xf121('0x56'),_0x3b1ef4);updateStatus(_0x4d9c63);_0x5551aa(ut[_0xf121('0x34')]('Fax\x20failed'));});});};Fax[_0xf121('0x18')][_0xf121('0x57')]=function(_0x904ffa){var _0x84f2b=this;return new BPromise(function(_0x4d9d31,_0x24253c){var _0x15e942=_0x84f2b[_0xf121('0x58')](_0x84f2b[_0xf121('0xd')][_0x904ffa[_0xf121('0x54')]][_0xf121('0x59')],_0x904ffa);if(_0x15e942['isValid']){_0x4d9d31(ut[_0xf121('0x34')]('Trunk\x20Reachable'));}else{_0x24253c(ut[_0xf121('0x34')](_0x15e942[_0xf121('0x34')]));}});};function originate(_0x16574c,_0x3609c4,_0x2b3ac3){return new BPromise(function(_0x3d5f78,_0x4ba400){if(_0x2b3ac3){var _0x587ebb=util[_0xf121('0x5a')](_0xf121('0x5b'),path['parse'](_0x16574c[_0xf121('0x4')])[_0xf121('0x1f')],_0x16574c[_0xf121('0x4')]);gs[_0xf121('0x5c')](_0x587ebb)['then'](function(){_0x16574c[_0xf121('0x4')]=util[_0xf121('0x5a')](_0xf121('0x5d'),path['parse'](_0x16574c[_0xf121('0x4')])[_0xf121('0x5e')],path[_0xf121('0x36')](_0x16574c[_0xf121('0x4')])[_0xf121('0x1f')]);_0x3609c4[_0xf121('0x5f')]=_0x16574c['path'];ut[_0xf121('0x46')](_0xf121('0x60'),'');ami[_0xf121('0x61')](ut[_0xf121('0x62')](_0x16574c,_0x3609c4))[_0xf121('0x44')](function(_0x365cca){_0x3d5f78(_0x365cca);})['catch'](function(_0x722c59){_0x4ba400(_0x722c59);});})['catch'](function(_0x4ab2fd){_0x4ba400(_0x4ab2fd);});}else{ami[_0xf121('0x61')](ut[_0xf121('0x62')](_0x16574c,_0x3609c4))[_0xf121('0x44')](function(_0x1eea67){_0x3d5f78(_0x1eea67);})['catch'](function(_0x418e1f){_0x4ba400(_0x418e1f);});}});}Fax['prototype'][_0xf121('0x53')]=function(_0x2d2c7b,_0x3142df){var _0x17df18=this;return new BPromise(function(_0x7e0b12,_0xd05353){var _0x38b353=uuid['v4']();var _0x447f9b=ut['addVariables'](_0x2d2c7b,_0x3142df);_0x17df18['actions'][_0x38b353]=new Action(_0x38b353,_0x3142df,_0x2d2c7b);var _0x1f37ab=_0x17df18['actions'][_0x38b353];if(path[_0xf121('0x36')](_0x2d2c7b[_0xf121('0x4')])[_0xf121('0x63')]===_0xf121('0x37')){originate(_0x1f37ab,_0x447f9b,!![])[_0xf121('0x44')](function(_0x247d45){_0x7e0b12(_0x247d45);})[_0xf121('0x3c')](function(_0x2926f9){_0xd05353(_0x2926f9);});}else{originate(_0x1f37ab,_0x447f9b,![])[_0xf121('0x44')](function(_0x2e287b){_0x7e0b12(_0x2e287b);})[_0xf121('0x3c')](function(_0x30689d){_0xd05353(_0x30689d);});}});};Fax[_0xf121('0x18')]['isTrunkReachable']=function(_0x5d2f6e){return!_['isNil'](_0x5d2f6e)&&!_[_0xf121('0x64')](_0x5d2f6e[_0xf121('0x1f')])&&!_[_0xf121('0x64')](_0x5d2f6e[_0xf121('0x65')])&&_0x5d2f6e['active']&&!_[_0xf121('0x64')](this[_0xf121('0xe')][util[_0xf121('0x5a')]('SIP/%s',_0x5d2f6e[_0xf121('0x1f')])])&&!_[_0xf121('0x64')](this['trunks'][util[_0xf121('0x5a')]('SIP/%s',_0x5d2f6e[_0xf121('0x1f')])][_0xf121('0x2a')])&&(this[_0xf121('0xe')][util[_0xf121('0x5a')](_0xf121('0x66'),_0x5d2f6e[_0xf121('0x1f')])][_0xf121('0x2a')]===_0xf121('0x67')||this[_0xf121('0xe')][util[_0xf121('0x5a')]('SIP/%s',_0x5d2f6e[_0xf121('0x1f')])][_0xf121('0x2a')]==='unmonitored');};Fax[_0xf121('0x18')][_0xf121('0x58')]=function(_0x427ccb,_0x25f70f){if(!this['isTrunkReachable'](_0x427ccb)){ut[_0xf121('0x46')](_0xf121('0x68'),_[_0xf121('0x64')](_0x427ccb)?'':_0x427ccb[_0xf121('0x1f')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0xf121('0x69')};}if(_[_0xf121('0x64')](_0x25f70f[_0xf121('0x6')])){ut[_0xf121('0x46')](_0xf121('0x6a'),JSON[_0xf121('0x3b')](_0x25f70f));return{'isValid':![],'message':_0xf121('0x6b')};}if(_[_0xf121('0x64')](_0x25f70f[_0xf121('0x4')])){ut['logger'](_0xf121('0x6c'),JSON[_0xf121('0x3b')](_0x25f70f));return{'isValid':![],'message':_0xf121('0x6d')};}return{'isValid':!![],'message':_0xf121('0x6e')};};module[_0xf121('0x6f')]=Fax; \ No newline at end of file +var _0x296c=['format','reachable','unmonitored','isTrunkReachable','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','\x20syncNewchannel\x20','info','syncVarSet','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','application/pdf','then','notify','catch','error','stringify','\x20receiveFax\x20','merge','pick','response','reason','update','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','updateStatus','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','SENDING\x20FAILED:\x20','faxstatusstring','execOriginate','FaxAccountId','[Fax][execOriginate][success]','Fax\x20received','Fax\x20failed','checkTrunk','Trunk','isValid','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','dir','XMF-PATH','Action','variablesAction','addVariables','isNil','active','SIP/%s'];(function(_0x37c955,_0x32ac55){var _0x1c9c47=function(_0x6fd5bd){while(--_0x6fd5bd){_0x37c955['push'](_0x37c955['shift']());}};_0x1c9c47(++_0x32ac55);}(_0x296c,0x1ea));var _0xc296=function(_0x4c1f4c,_0x2a1024){_0x4c1f4c=_0x4c1f4c-0x0;var _0x3f5610=_0x296c[_0x4c1f4c];return _0x3f5610;};'use strict';var util=require(_0xc296('0x0'));var _=require(_0xc296('0x1'));var BPromise=require(_0xc296('0x2'));var uuid=require(_0xc296('0x3'));var moment=require('moment');var path=require(_0xc296('0x4'));var tiff2pdf=require('tiff2pdf');var gs=require(_0xc296('0x5'));var logger=require(_0xc296('0x6'))(_0xc296('0x7'));var ami=require(_0xc296('0x8'));var rpcDb=require(_0xc296('0x9'));var Channel=require(_0xc296('0xa'));var ut=require(_0xc296('0xb'));var Action=require('./action');var faxAccount=require(_0xc296('0xc'));var attachment=require(_0xc296('0xd'));var faxMessage=require(_0xc296('0xe'));function Fax(_0x23e1c0){this[_0xc296('0xf')]={};this[_0xc296('0x10')]=_0x23e1c0[_0xc296('0x10')];this[_0xc296('0x11')]=_0x23e1c0[_0xc296('0x11')];this[_0xc296('0x12')]={};ami['on'](_0xc296('0x13'),this[_0xc296('0x14')]['bind'](this));ami['on']('varset',this['syncVarSet'][_0xc296('0x15')](this));ami['on'](_0xc296('0x16'),this[_0xc296('0x17')][_0xc296('0x15')](this));ami['on'](_0xc296('0x18'),this[_0xc296('0x19')][_0xc296('0x15')](this));ami['on'](_0xc296('0x1a'),this[_0xc296('0x1b')][_0xc296('0x15')](this));ami['on'](_0xc296('0x1c'),this[_0xc296('0x1d')][_0xc296('0x15')](this));ami['on'](_0xc296('0x1e'),this[_0xc296('0x1f')][_0xc296('0x15')](this));ami['on']('originateresponse',this[_0xc296('0x20')][_0xc296('0x15')](this));}Fax[_0xc296('0x21')]['syncNewchannel']=function(_0x55a7c2){if(_0x55a7c2[_0xc296('0x22')]===_0xc296('0x23')){for(var _0x245584 in this[_0xc296('0x10')]){if(this['faxAccounts'][_0xc296('0x24')](_0x245584)){if(_0x55a7c2[_0xc296('0x25')]===this[_0xc296('0x10')][_0x245584][_0xc296('0x26')]){this[_0xc296('0xf')][_0x55a7c2[_0xc296('0x27')]]={};this['channels'][_0x55a7c2[_0xc296('0x27')]][_0xc296('0x28')]=_0x55a7c2['channel'];this[_0xc296('0xf')][_0x55a7c2['uniqueid']]['id']=this[_0xc296('0x10')][_0x245584]['id'];this[_0xc296('0xf')][_0x55a7c2['uniqueid']][_0xc296('0x29')]=this[_0xc296('0x10')][_0x245584][_0xc296('0x29')];logger['info'](_0x55a7c2['uniqueid'],_0xc296('0x2a'));}}}}if(this['actions'][_0x55a7c2[_0xc296('0x27')]]){this[_0xc296('0xf')][_0x55a7c2[_0xc296('0x27')]]={};this[_0xc296('0xf')][_0x55a7c2['uniqueid']][_0xc296('0x28')]=_0x55a7c2[_0xc296('0x28')];logger[_0xc296('0x2b')](_0x55a7c2[_0xc296('0x27')],'\x20syncNewchannel\x20');}};Fax[_0xc296('0x21')][_0xc296('0x2c')]=function(_0x1300e6){if(this[_0xc296('0xf')][_0x1300e6[_0xc296('0x27')]]){for(var _0x44385d in _0x1300e6[_0xc296('0x2d')]){if(_0x1300e6[_0xc296('0x2d')][_0xc296('0x24')](_0x44385d)){this[_0xc296('0xf')][_0x1300e6[_0xc296('0x27')]][_0x44385d]=_0x1300e6[_0xc296('0x2e')];}}}};Fax['prototype']['syncNewState']=function(_0xc9c59f){if(this[_0xc296('0xf')][_0xc9c59f[_0xc296('0x27')]]){this[_0xc296('0xf')][_0xc9c59f[_0xc296('0x27')]]['channelstate']=_0xc9c59f[_0xc296('0x2f')];this[_0xc296('0xf')][_0xc9c59f[_0xc296('0x27')]][_0xc296('0x30')]=_0xc9c59f[_0xc296('0x30')];}};Fax[_0xc296('0x21')][_0xc296('0x19')]=function(_0x1ae2b9){if(this['channels'][_0x1ae2b9[_0xc296('0x27')]]){for(var _0x59c713 in _0x1ae2b9[_0xc296('0x2d')]){if(_0x1ae2b9[_0xc296('0x2d')]['hasOwnProperty'](_0x59c713)){this['channels'][_0x1ae2b9[_0xc296('0x27')]][_0x59c713]=_0x1ae2b9[_0xc296('0x2e')];}}}};Fax[_0xc296('0x21')]['syncFaxStatus']=function(_0x172e88){if(this[_0xc296('0xf')][_0x172e88[_0xc296('0x27')]]){this[_0xc296('0xf')][_0x172e88[_0xc296('0x27')]][_0xc296('0x31')]=_0x172e88['operation'];this['channels'][_0x172e88[_0xc296('0x27')]][_0xc296('0x32')]=_0x172e88['status'];this['channels'][_0x172e88['uniqueid']][_0xc296('0x26')]=_0x172e88[_0xc296('0x26')];this[_0xc296('0xf')][_0x172e88[_0xc296('0x27')]]['filename']=_0x172e88[_0xc296('0x33')];logger['info'](_0x172e88[_0xc296('0x27')],_0xc296('0x34'));}};Fax[_0xc296('0x21')]['syncReceiveFax']=function(_0x48d619){var _0x4af744=this;if(this[_0xc296('0xf')][_0x48d619['uniqueid']]){var _0x40f72b=this[_0xc296('0xf')][_0x48d619['uniqueid']]['id'];this[_0xc296('0xf')][_0x48d619[_0xc296('0x27')]][_0xc296('0x35')]=_0x48d619[_0xc296('0x35')];this[_0xc296('0xf')][_0x48d619[_0xc296('0x27')]][_0xc296('0x36')]=_0x48d619[_0xc296('0x36')];this[_0xc296('0xf')][_0x48d619[_0xc296('0x27')]][_0xc296('0x26')]=_0x48d619['localstationid'];this[_0xc296('0xf')][_0x48d619[_0xc296('0x27')]]['resolution']=_0x48d619[_0xc296('0x37')];this[_0xc296('0xf')][_0x48d619[_0xc296('0x27')]][_0xc296('0x38')]=_0x48d619['transferrate'];this[_0xc296('0xf')][_0x48d619['uniqueid']][_0xc296('0x33')]=_0x48d619[_0xc296('0x33')];this[_0xc296('0xf')][_0x48d619['uniqueid']][_0xc296('0x39')]=_0x48d619['calleridnum'];if(this[_0xc296('0xf')][_0x48d619['uniqueid']]['pagestransferred']>0x0){tiff2pdf(_0x48d619[_0xc296('0x33')],_0xc296('0x3a'),function(_0x6184d2){logger[_0xc296('0x2b')](_0x48d619[_0xc296('0x27')],_0xc296('0x3b'),_0x6184d2[_0xc296('0x3c')]);attachment[_0xc296('0x3d')]({'name':path[_0xc296('0x3e')](_0x48d619[_0xc296('0x33')])['name'],'basename':path['parse'](_0x48d619[_0xc296('0x33')])['name']+_0xc296('0x3f'),'type':_0xc296('0x40')})[_0xc296('0x41')](function(_0x462eac){faxAccount[_0xc296('0x42')](_0x40f72b,{'from':_0x48d619[_0xc296('0x39')],'mapKey':'fax','body':path['parse'](_0x48d619[_0xc296('0x33')])['name']+'.pdf','AttachmentId':_0x462eac['id']})[_0xc296('0x43')](function(_0x12e416){logger[_0xc296('0x44')](_0x48d619[_0xc296('0x27')],'\x20notify\x20',JSON[_0xc296('0x45')](_0x12e416));});})['catch'](function(_0x18fb0b){logger[_0xc296('0x44')](_0x48d619['uniqueid'],_0xc296('0x46'),JSON['stringify'](_0x18fb0b));});});}logger['info'](_0x48d619[_0xc296('0x27')],'\x20receiveFax\x20');}};Fax[_0xc296('0x21')]['syncOriginateResponse']=function(_0x39ebc9){if(this[_0xc296('0x12')][_0x39ebc9[_0xc296('0x27')]]){_[_0xc296('0x47')](this['channels'][_0x39ebc9[_0xc296('0x27')]],_[_0xc296('0x48')](_0x39ebc9,[_0xc296('0x49'),_0xc296('0x4a')]));}};function updateStatus(_0x2f8726){if(_0x2f8726['AttachmentId']){faxMessage[_0xc296('0x4b')](_0x2f8726[_0xc296('0x4c')],{'failMessage':_0xc296('0x4d')})[_0xc296('0x41')](function(_0x261094){ut[_0xc296('0x4e')]('[Fax][Message][Error][Updated]',_0x261094);})[_0xc296('0x43')](function(_0xb8b483){ut[_0xc296('0x4e')](_0xc296('0x4f'),_0xb8b483);});}else{ut['logger'](_0xc296('0x50'));}}Fax[_0xc296('0x21')][_0xc296('0x51')]=function(_0x24e602,_0xe0d69c,_0x5c005c){var _0x48bdfe=this;var _0x32cd15={};if(_0xe0d69c){_0x32cd15={'read':_0xe0d69c};}else{_0x32cd15={'failMessage':_0x5c005c};}if(this['actions'][_0x24e602]['AttachmentId']){faxMessage[_0xc296('0x4b')](this['actions'][_0x24e602][_0xc296('0x4c')],_0x32cd15)[_0xc296('0x41')](function(_0x5d45fc){ut[_0xc296('0x4e')](_0xc296('0x52'),_0x5d45fc);})[_0xc296('0x43')](function(_0x2a7092){ut[_0xc296('0x4e')](_0xc296('0x53'),_0x2a7092);})[_0xc296('0x54')](function(){delete _0x48bdfe[_0xc296('0xf')][_0x24e602];delete _0x48bdfe[_0xc296('0x12')][_0x24e602];});}else{ut[_0xc296('0x4e')]('[Fax][Message][NoUpdate2]');delete this[_0xc296('0xf')][_0x24e602];delete this['actions'][_0x24e602];}};Fax[_0xc296('0x21')][_0xc296('0x1f')]=function(_0x3794c3){var _0x481633=this;if(this[_0xc296('0xf')][_0x3794c3[_0xc296('0x27')]]){if(this[_0xc296('0x12')][_0x3794c3['uniqueid']]){this['channels'][_0x3794c3['uniqueid']]['id']=this[_0xc296('0x12')][_0x3794c3[_0xc296('0x27')]]['id'];this[_0xc296('0xf')][_0x3794c3['uniqueid']][_0xc296('0x29')]=this[_0xc296('0x12')][_0x3794c3[_0xc296('0x27')]]['name'];}logger[_0xc296('0x2b')](_0x3794c3[_0xc296('0x27')],this[_0xc296('0x12')][_0x3794c3['uniqueid']]?_0xc296('0x55'):_0xc296('0x56'),JSON[_0xc296('0x45')](this[_0xc296('0xf')][_0x3794c3[_0xc296('0x27')]]));if(this[_0xc296('0x12')][_0x3794c3[_0xc296('0x27')]]){if(this[_0xc296('0xf')][_0x3794c3[_0xc296('0x27')]][_0xc296('0x57')]>0x0&&this[_0xc296('0xf')][_0x3794c3[_0xc296('0x27')]][_0xc296('0x1a')]===_0xc296('0x58')){this['updateStatus'](_0x3794c3[_0xc296('0x27')],!![]);}else{this[_0xc296('0x51')](_0x3794c3[_0xc296('0x27')],![],this[_0xc296('0xf')][_0x3794c3[_0xc296('0x27')]]['faxstatusstring']?_0xc296('0x59')+this[_0xc296('0xf')][_0x3794c3['uniqueid']][_0xc296('0x5a')]:'SENDING\x20FAILED');}}}};Fax[_0xc296('0x21')]['send']=function(_0x21e22e){var _0x483adb=this;return new BPromise(function(_0x5b05e2,_0x188fd6){_0x483adb[_0xc296('0x5b')](_0x21e22e,_0x483adb[_0xc296('0x10')][_0x21e22e[_0xc296('0x5c')]])[_0xc296('0x41')](function(_0x2b89d1){ut[_0xc296('0x4e')](_0xc296('0x5d'),_0x2b89d1);_0x5b05e2(ut[_0xc296('0x3c')](_0xc296('0x5e')));})['catch'](function(_0x54e3f4){ut[_0xc296('0x4e')]('[Fax][execOriginate][failure]',_0x54e3f4);updateStatus(_0x21e22e);_0x188fd6(ut[_0xc296('0x3c')](_0xc296('0x5f')));});});};Fax[_0xc296('0x21')]['checkAfterSend']=function(_0x54cf0e){var _0x3a2f26=this;return new BPromise(function(_0x53ef0c,_0x32ef71){var _0x7ae410=_0x3a2f26[_0xc296('0x60')](_0x3a2f26[_0xc296('0x10')][_0x54cf0e[_0xc296('0x5c')]][_0xc296('0x61')],_0x54cf0e);if(_0x7ae410[_0xc296('0x62')]){_0x53ef0c(ut[_0xc296('0x3c')]('Trunk\x20Reachable'));}else{_0x32ef71(ut[_0xc296('0x3c')](_0x7ae410[_0xc296('0x3c')]));}});};function originate(_0x383ac7,_0x26a4ff,_0xdb7e01){return new BPromise(function(_0x469ca1,_0x358d56){if(_0xdb7e01){var _0x433d31=util['format'](_0xc296('0x63'),path[_0xc296('0x3e')](_0x383ac7['path'])[_0xc296('0x29')],_0x383ac7[_0xc296('0x4')]);gs[_0xc296('0x64')](_0x433d31)['then'](function(){_0x383ac7['path']=util['format'](_0xc296('0x65'),path[_0xc296('0x3e')](_0x383ac7[_0xc296('0x4')])[_0xc296('0x66')],path['parse'](_0x383ac7[_0xc296('0x4')])['name']);_0x26a4ff[_0xc296('0x67')]=_0x383ac7[_0xc296('0x4')];ut[_0xc296('0x4e')]('Convert\x20pdf\x20to\x20tif','');ami[_0xc296('0x68')](ut[_0xc296('0x69')](_0x383ac7,_0x26a4ff))[_0xc296('0x41')](function(_0x416228){_0x469ca1(_0x416228);})[_0xc296('0x43')](function(_0x39c4ff){_0x358d56(_0x39c4ff);});})[_0xc296('0x43')](function(_0x26bc98){_0x358d56(_0x26bc98);});}else{ami['Action'](ut[_0xc296('0x69')](_0x383ac7,_0x26a4ff))[_0xc296('0x41')](function(_0x3b3de8){_0x469ca1(_0x3b3de8);})[_0xc296('0x43')](function(_0x5b3768){_0x358d56(_0x5b3768);});}});}Fax[_0xc296('0x21')][_0xc296('0x5b')]=function(_0x486b54,_0x3bb8ea){var _0x59e9f6=this;return new BPromise(function(_0x59d129,_0x453297){var _0x4d06de=uuid['v4']();var _0x41f4cd=ut[_0xc296('0x6a')](_0x486b54,_0x3bb8ea);_0x59e9f6[_0xc296('0x12')][_0x4d06de]=new Action(_0x4d06de,_0x3bb8ea,_0x486b54);var _0x16b913=_0x59e9f6['actions'][_0x4d06de];if(path[_0xc296('0x3e')](_0x486b54[_0xc296('0x4')])['ext']===_0xc296('0x3f')){originate(_0x16b913,_0x41f4cd,!![])[_0xc296('0x41')](function(_0x25a6d7){_0x59d129(_0x25a6d7);})[_0xc296('0x43')](function(_0x2183bd){_0x453297(_0x2183bd);});}else{originate(_0x16b913,_0x41f4cd,![])['then'](function(_0x179cce){_0x59d129(_0x179cce);})['catch'](function(_0x1ea063){_0x453297(_0x1ea063);});}});};Fax['prototype']['isTrunkReachable']=function(_0x5dae6d){return!_['isNil'](_0x5dae6d)&&!_[_0xc296('0x6b')](_0x5dae6d['name'])&&!_[_0xc296('0x6b')](_0x5dae6d[_0xc296('0x6c')])&&_0x5dae6d[_0xc296('0x6c')]&&!_[_0xc296('0x6b')](this['trunks'][util['format'](_0xc296('0x6d'),_0x5dae6d[_0xc296('0x29')])])&&!_['isNil'](this[_0xc296('0x11')][util['format'](_0xc296('0x6d'),_0x5dae6d['name'])][_0xc296('0x32')])&&(this['trunks'][util[_0xc296('0x6e')](_0xc296('0x6d'),_0x5dae6d[_0xc296('0x29')])][_0xc296('0x32')]===_0xc296('0x6f')||this[_0xc296('0x11')][util['format'](_0xc296('0x6d'),_0x5dae6d[_0xc296('0x29')])][_0xc296('0x32')]===_0xc296('0x70'));};Fax['prototype'][_0xc296('0x60')]=function(_0x2bf386,_0x569ceb){if(!this[_0xc296('0x71')](_0x2bf386)){ut['logger'](_0xc296('0x72'),_[_0xc296('0x6b')](_0x2bf386)?'':_0x2bf386[_0xc296('0x29')]+_0xc296('0x73'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0xc296('0x6b')](_0x569ceb[_0xc296('0x7')])){ut[_0xc296('0x4e')]('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xc296('0x45')](_0x569ceb));return{'isValid':![],'message':_0xc296('0x74')};}if(_[_0xc296('0x6b')](_0x569ceb[_0xc296('0x4')])){ut[_0xc296('0x4e')](_0xc296('0x75'),JSON[_0xc296('0x45')](_0x569ceb));return{'isValid':![],'message':'Empty\x20path'};}return{'isValid':!![],'message':_0xc296('0x76')};};module[_0xc296('0x77')]=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 0652023..e1cddd4 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 _0x8b25=['preview','lodash','../rpc/faxAccount','error','notify','resolve','then','catch','[Notify]\x20','util','bluebird','../../../config/logger'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x8b25,0xb1));var _0x58b2=function(_0x120111,_0x37844d){_0x120111=_0x120111-0x0;var _0x111d4d=_0x8b25[_0x120111];return _0x111d4d;};'use strict';var util=require(_0x58b2('0x0'));var BPromise=require(_0x58b2('0x1'));var logger=require(_0x58b2('0x2'))(_0x58b2('0x3'));var _=require(_0x58b2('0x4'));var faxAccount=require(_0x58b2('0x5'));function loggerCatch(_0x1c7fd9){return function(_0xee24a3){logger[_0x58b2('0x6')](_0x1c7fd9,util['inspect'](_0xee24a3,{'showHidden':![],'depth':null}));};}exports[_0x58b2('0x7')]=function(_0x5b9bda,_0x9c5d8e){return BPromise[_0x58b2('0x8')]()[_0x58b2('0x9')](faxAccount[_0x58b2('0x7')](_0x5b9bda,_0x9c5d8e))[_0x58b2('0xa')](loggerCatch(_0x58b2('0xb')));}; \ No newline at end of file +var _0x2901=['notify','resolve','catch','[Notify]\x20','../../../config/logger','preview','error','inspect'];(function(_0x710815,_0x520da8){var _0x5b3b89=function(_0x2e1a8e){while(--_0x2e1a8e){_0x710815['push'](_0x710815['shift']());}};_0x5b3b89(++_0x520da8);}(_0x2901,0x9c));var _0x1290=function(_0x4c4e6b,_0x2cc829){_0x4c4e6b=_0x4c4e6b-0x0;var _0x42d68a=_0x2901[_0x4c4e6b];return _0x42d68a;};'use strict';var util=require('util');var BPromise=require('bluebird');var logger=require(_0x1290('0x0'))(_0x1290('0x1'));var _=require('lodash');var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x5b0fe2){return function(_0x47cf73){logger[_0x1290('0x2')](_0x5b0fe2,util[_0x1290('0x3')](_0x47cf73,{'showHidden':![],'depth':null}));};}exports[_0x1290('0x4')]=function(_0x816814,_0x574a24){return BPromise[_0x1290('0x5')]()['then'](faxAccount['notify'](_0x816814,_0x574a24))[_0x1290('0x6')](loggerCatch(_0x1290('0x7')));}; \ 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 bfd22f7..189ce55 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 _0x015d=['\x20Error\x20:','inspect','util','fax','bluebird','child_process','exec','Exec\x20gs','info'];(function(_0x5e76f2,_0xf5cbbd){var _0xb815cb=function(_0x21a5f0){while(--_0x21a5f0){_0x5e76f2['push'](_0x5e76f2['shift']());}};_0xb815cb(++_0xf5cbbd);}(_0x015d,0x134));var _0xd015=function(_0x4d35f3,_0x19ba66){_0x4d35f3=_0x4d35f3-0x0;var _0x382fea=_0x015d[_0x4d35f3];return _0x382fea;};'use strict';var util=require(_0xd015('0x0'));var logger=require('../../../../config/logger')(_0xd015('0x1'));var BPromise=require(_0xd015('0x2'));var exec=require(_0xd015('0x3'))[_0xd015('0x4')];exports['execute']=function(_0x4c7bf2){return new BPromise(function(_0xbd64a8,_0x29cb74){exec(_0x4c7bf2,function(_0x2ba755,_0x2244f1,_0x3f5b78){logger['info'](_0xd015('0x5'),_0x2244f1);if(_0x2ba755){logger[_0xd015('0x6')](_0xd015('0x5'),_0xd015('0x7'),util[_0xd015('0x8')](_0x2ba755,{'showHidden':![],'depth':null}),_0x2244f1,_0x3f5b78);_0x29cb74(_0x2ba755);}_0xbd64a8(_0x2244f1);});});}; \ No newline at end of file +var _0x57b7=['exec','info','Exec\x20gs','\x20Error\x20:','util','../../../../config/logger','fax','bluebird','child_process'];(function(_0x5a5ad8,_0x34911c){var _0x5512e5=function(_0x18cbe6){while(--_0x18cbe6){_0x5a5ad8['push'](_0x5a5ad8['shift']());}};_0x5512e5(++_0x34911c);}(_0x57b7,0xb8));var _0x757b=function(_0x1d952b,_0x3d9feb){_0x1d952b=_0x1d952b-0x0;var _0x3a8977=_0x57b7[_0x1d952b];return _0x3a8977;};'use strict';var util=require(_0x757b('0x0'));var logger=require(_0x757b('0x1'))(_0x757b('0x2'));var BPromise=require(_0x757b('0x3'));var exec=require(_0x757b('0x4'))[_0x757b('0x5')];exports['execute']=function(_0x2d3379){return new BPromise(function(_0x131fdc,_0x3d8a0c){exec(_0x2d3379,function(_0x2e1f3a,_0xefb5d0,_0x5063a6){logger[_0x757b('0x6')](_0x757b('0x7'),_0xefb5d0);if(_0x2e1f3a){logger['info'](_0x757b('0x7'),_0x757b('0x8'),util['inspect'](_0x2e1f3a,{'showHidden':![],'depth':null}),_0xefb5d0,_0x5063a6);_0x3d8a0c(_0x2e1f3a);}_0x131fdc(_0xefb5d0);});});}; \ 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 ee3fe4f..b49e6e8 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 _0xb821=['format','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','originate','channel','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','lodash','moment','message','info','inspect','ecm','headerinfo','minrate','maxrate'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0xb821,0xa7));var _0x1b82=function(_0x1528d7,_0x50578b){_0x1528d7=_0x1528d7-0x0;var _0x3173d5=_0xb821[_0x1528d7];return _0x3173d5;};'use strict';var util=require('util');var _=require(_0x1b82('0x0'));var moment=require(_0x1b82('0x1'));var logger=require('../../../../config/logger')('fax');exports[_0x1b82('0x2')]=function(_0x578a10){return{'message':_0x578a10};};exports['logger']=function(_0x3b1d14,_0x1403ab){logger[_0x1b82('0x3')](_0x3b1d14,util[_0x1b82('0x4')](_0x1403ab,{'showHidden':![],'depth':null}));};exports['addVariables']=function(_0x3e27c4,_0x192434){var _0x202a5f={'XMF-ECM':_0x192434[_0x1b82('0x5')],'XMF-HEADERINFO':_0x192434[_0x1b82('0x6')],'XMF-MINRATE':_0x192434[_0x1b82('0x7')],'XMF-MAXRATE':_0x192434[_0x1b82('0x8')],'XMF-MODEM':util[_0x1b82('0x9')](_0x1b82('0xa'),_0x192434['modem']),'XMF-GATEWAY':_0x192434[_0x1b82('0xb')],'XMF-FAXDETECT':_0x192434[_0x1b82('0xc')],'XMF-T38TIMEOUT':_0x192434[_0x1b82('0xd')],'XMF-LOCALSTATIONID':_0x192434[_0x1b82('0xe')],'XMF-PATH':_0x3e27c4[_0x1b82('0xf')]};return _0x202a5f;};exports[_0x1b82('0x10')]=function(_0x739f99,_0x1ce719){return{'actionid':_0x739f99['uniqueid'],'action':_0x1b82('0x11'),'channel':_0x739f99[_0x1b82('0x12')],'Exten':_0x1b82('0x13'),'Context':_0x1b82('0x14'),'Priority':'1','callerid':util['format'](_0x1b82('0x15'),_0x739f99['headerinfo']?_0x739f99['headerinfo']:'',_0x739f99[_0x1b82('0xe')]),'variable':_0x1ce719,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x739f99['uniqueid']};}; \ No newline at end of file +var _0xb469=['util','lodash','moment','../../../../config/logger','fax','message','inspect','addVariables','headerinfo','maxrate','format','\x22%s\x22','gateway','t38timeout','path','originate','channel','from-sip','\x22%s\x22\x20<%s>','localstationid','uniqueid'];(function(_0x1a5ecf,_0x1ee958){var _0x3eee6e=function(_0x4535c0){while(--_0x4535c0){_0x1a5ecf['push'](_0x1a5ecf['shift']());}};_0x3eee6e(++_0x1ee958);}(_0xb469,0x13b));var _0x9b46=function(_0x4d14a4,_0x13625d){_0x4d14a4=_0x4d14a4-0x0;var _0x30ed32=_0xb469[_0x4d14a4];return _0x30ed32;};'use strict';var util=require(_0x9b46('0x0'));var _=require(_0x9b46('0x1'));var moment=require(_0x9b46('0x2'));var logger=require(_0x9b46('0x3'))(_0x9b46('0x4'));exports[_0x9b46('0x5')]=function(_0x9212ae){return{'message':_0x9212ae};};exports['logger']=function(_0x31f853,_0x45322f){logger['info'](_0x31f853,util[_0x9b46('0x6')](_0x45322f,{'showHidden':![],'depth':null}));};exports[_0x9b46('0x7')]=function(_0x50b49e,_0x1b2dd3){var _0x5bd834={'XMF-ECM':_0x1b2dd3['ecm'],'XMF-HEADERINFO':_0x1b2dd3[_0x9b46('0x8')],'XMF-MINRATE':_0x1b2dd3['minrate'],'XMF-MAXRATE':_0x1b2dd3[_0x9b46('0x9')],'XMF-MODEM':util[_0x9b46('0xa')](_0x9b46('0xb'),_0x1b2dd3['modem']),'XMF-GATEWAY':_0x1b2dd3[_0x9b46('0xc')],'XMF-FAXDETECT':_0x1b2dd3['faxdetect'],'XMF-T38TIMEOUT':_0x1b2dd3[_0x9b46('0xd')],'XMF-LOCALSTATIONID':_0x1b2dd3['localstationid'],'XMF-PATH':_0x50b49e[_0x9b46('0xe')]};return _0x5bd834;};exports['variablesAction']=function(_0x672157,_0x233b6b){return{'actionid':_0x672157['uniqueid'],'action':_0x9b46('0xf'),'channel':_0x672157[_0x9b46('0x10')],'Exten':'xcally-motion-fax','Context':_0x9b46('0x11'),'Priority':'1','callerid':util[_0x9b46('0xa')](_0x9b46('0x12'),_0x672157[_0x9b46('0x8')]?_0x672157[_0x9b46('0x8')]:'',_0x672157[_0x9b46('0x13')]),'variable':_0x233b6b,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x672157[_0x9b46('0x14')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 353ad97..1df5bbe 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 _0x374c=['getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','initVoiceCallReports','catch','log','bluebird','util','moment','./server','./realtime','./acw','./trigger','./preview','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trigger','./rpc/template','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initDeskAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','initDynamics365Accounts','initCampaigns'];(function(_0x3d92d3,_0x1647b3){var _0x3c6c67=function(_0x51be78){while(--_0x51be78){_0x3d92d3['push'](_0x3d92d3['shift']());}};_0x3c6c67(++_0x1647b3);}(_0x374c,0xcf));var _0xc374=function(_0xc4001c,_0x1bf8f0){_0xc4001c=_0xc4001c-0x0;var _0x49f7bc=_0x374c[_0xc4001c];return _0x49f7bc;};'use strict';var BPromise=require(_0xc374('0x0'));var util=require(_0xc374('0x1'));var moment=require(_0xc374('0x2'));var server=require(_0xc374('0x3'));var Realtime=require(_0xc374('0x4'));var Report=require('./report');var Acw=require(_0xc374('0x5'));var Trigger=require(_0xc374('0x6'));var Dialer=require('./dialer');var Preview=require(_0xc374('0x7'));var Fax=require('./fax');var user=require(_0xc374('0x8'));var voiceQueue=require(_0xc374('0x9'));var voiceQueueReport=require(_0xc374('0xa'));var voiceCallReport=require(_0xc374('0xb'));var trunk=require('./rpc/trunk');var trigger=require(_0xc374('0xc'));var template=require(_0xc374('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require(_0xc374('0xe'));var voiceExtension=require(_0xc374('0xf'));var faxAccount=require(_0xc374('0x10'));var zendesk=require(_0xc374('0x11'));var salesforce=require(_0xc374('0x12'));var sugarcrm=require(_0xc374('0x13'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xc374('0x14'));var zoho=require(_0xc374('0x15'));var vtiger=require(_0xc374('0x16'));var servicenow=require(_0xc374('0x17'));var dynamics365=require(_0xc374('0x18'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get']('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0xc374('0x19')](_0xc374('0x1a'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xc374('0x1b')]()[_0xc374('0x1c')](user[_0xc374('0x1d')]())['then'](realtime[_0xc374('0x1e')]())[_0xc374('0x1c')](user[_0xc374('0x1f')]())[_0xc374('0x1c')](realtime[_0xc374('0x20')]())[_0xc374('0x1c')](trunk[_0xc374('0x21')]())[_0xc374('0x1c')](realtime['initTrunks']())[_0xc374('0x1c')](voiceQueue[_0xc374('0x22')]())[_0xc374('0x1c')](realtime[_0xc374('0x23')]())[_0xc374('0x1c')](trigger[_0xc374('0x24')]())[_0xc374('0x1c')](realtime[_0xc374('0x25')]())[_0xc374('0x1c')](template[_0xc374('0x26')]())[_0xc374('0x1c')](realtime[_0xc374('0x27')]())[_0xc374('0x1c')](zendesk[_0xc374('0x28')]())[_0xc374('0x1c')](realtime['initZendeskAccounts']())[_0xc374('0x1c')](salesforce['getSalesforceAccounts']())[_0xc374('0x1c')](realtime['initSalesforceAccounts']())['then'](sugarcrm[_0xc374('0x29')]())[_0xc374('0x1c')](realtime[_0xc374('0x2a')]())[_0xc374('0x1c')](freshdesk[_0xc374('0x2b')]())[_0xc374('0x1c')](realtime['initFreshdeskAccounts']())['then'](desk[_0xc374('0x2c')]())[_0xc374('0x1c')](realtime[_0xc374('0x2d')]())[_0xc374('0x1c')](zoho['getZohoAccounts']())[_0xc374('0x1c')](realtime[_0xc374('0x2e')]())[_0xc374('0x1c')](vtiger[_0xc374('0x2f')]())[_0xc374('0x1c')](realtime[_0xc374('0x30')]())['then'](servicenow[_0xc374('0x31')]())[_0xc374('0x1c')](realtime[_0xc374('0x32')]())[_0xc374('0x1c')](dynamics365['getDynamics365Accounts']())[_0xc374('0x1c')](realtime[_0xc374('0x33')]())[_0xc374('0x1c')](campaign['getCampaigns']())[_0xc374('0x1c')](realtime[_0xc374('0x34')]())[_0xc374('0x1c')](voiceExtension[_0xc374('0x35')]())['then'](realtime[_0xc374('0x36')]())['then'](faxAccount[_0xc374('0x37')]())[_0xc374('0x1c')](realtime[_0xc374('0x38')]())[_0xc374('0x1c')](function(){return realtime;});}function initParams(){return BPromise['resolve']()[_0xc374('0x1c')](voiceQueueReport[_0xc374('0x39')]())[_0xc374('0x1c')](realtime[_0xc374('0x3a')]())[_0xc374('0x1c')](cmHopperHistory[_0xc374('0x3b')]())[_0xc374('0x1c')](realtime['initVoiceQueueHopperHistory']())[_0xc374('0x1c')](cmHopperHistory[_0xc374('0x3c')]())[_0xc374('0x1c')](realtime[_0xc374('0x3d')]())[_0xc374('0x1c')](voiceCallReport['getVoiceCallReports']())['then'](realtime[_0xc374('0x3e')]())['then'](function(_0x1c5b6a){})[_0xc374('0x3f')](function(_0x5175ae){console['log'](_0x5175ae);});}function main(){return server['listen'](realtime,preview,fax)['then'](function(_0x2d96cb){return initRealtime();})[_0xc374('0x1c')](function(){return initParams();})[_0xc374('0x1c')](function(){report['sync']();setInterval(initRealtime,0x1388);})[_0xc374('0x3f')](function(_0x795196){console[_0xc374('0x40')](_0x795196);});}main(); \ No newline at end of file +var _0x770f=['then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','getZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','listen','sync','catch','log','bluebird','moment','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/campaign','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve'];(function(_0x2f5244,_0x16c0a5){var _0x5f039b=function(_0x4af31c){while(--_0x4af31c){_0x2f5244['push'](_0x2f5244['shift']());}};_0x5f039b(++_0x16c0a5);}(_0x770f,0x15d));var _0xf770=function(_0x50aea5,_0x5dd077){_0x50aea5=_0x50aea5-0x0;var _0x4657f1=_0x770f[_0x50aea5];return _0x4657f1;};'use strict';var BPromise=require(_0xf770('0x0'));var util=require('util');var moment=require(_0xf770('0x1'));var server=require('./server');var Realtime=require(_0xf770('0x2'));var Report=require(_0xf770('0x3'));var Acw=require(_0xf770('0x4'));var Trigger=require(_0xf770('0x5'));var Dialer=require(_0xf770('0x6'));var Preview=require('./preview');var Fax=require(_0xf770('0x7'));var user=require(_0xf770('0x8'));var voiceQueue=require('./rpc/voiceQueue');var voiceQueueReport=require(_0xf770('0x9'));var voiceCallReport=require(_0xf770('0xa'));var trunk=require(_0xf770('0xb'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0xf770('0xc'));var campaign=require(_0xf770('0xd'));var voiceExtension=require('./rpc/voiceExtension');var faxAccount=require(_0xf770('0xe'));var zendesk=require(_0xf770('0xf'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0xf770('0x10'));var freshdesk=require(_0xf770('0x11'));var desk=require('./rpc/integrations/desk');var zoho=require('./rpc/integrations/zoho');var vtiger=require('./rpc/integrations/vtiger');var servicenow=require(_0xf770('0x12'));var dynamics365=require(_0xf770('0x13'));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()[_0xf770('0x14')](_0xf770('0x15'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xf770('0x15'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0xf770('0x16')]()[_0xf770('0x17')](user[_0xf770('0x18')]())[_0xf770('0x17')](realtime[_0xf770('0x19')]())[_0xf770('0x17')](user['getTelephones']())[_0xf770('0x17')](realtime[_0xf770('0x1a')]())[_0xf770('0x17')](trunk[_0xf770('0x1b')]())[_0xf770('0x17')](realtime[_0xf770('0x1c')]())[_0xf770('0x17')](voiceQueue[_0xf770('0x1d')]())[_0xf770('0x17')](realtime[_0xf770('0x1e')]())[_0xf770('0x17')](trigger[_0xf770('0x1f')]())[_0xf770('0x17')](realtime[_0xf770('0x20')]())['then'](template[_0xf770('0x21')]())['then'](realtime[_0xf770('0x22')]())[_0xf770('0x17')](zendesk[_0xf770('0x23')]())[_0xf770('0x17')](realtime['initZendeskAccounts']())[_0xf770('0x17')](salesforce[_0xf770('0x24')]())[_0xf770('0x17')](realtime[_0xf770('0x25')]())[_0xf770('0x17')](sugarcrm[_0xf770('0x26')]())[_0xf770('0x17')](realtime[_0xf770('0x27')]())[_0xf770('0x17')](freshdesk['getFreshdeskAccounts']())['then'](realtime['initFreshdeskAccounts']())[_0xf770('0x17')](desk['getDeskAccounts']())[_0xf770('0x17')](realtime['initDeskAccounts']())['then'](zoho[_0xf770('0x28')]())['then'](realtime[_0xf770('0x29')]())['then'](vtiger[_0xf770('0x2a')]())[_0xf770('0x17')](realtime[_0xf770('0x2b')]())['then'](servicenow[_0xf770('0x2c')]())[_0xf770('0x17')](realtime[_0xf770('0x2d')]())['then'](dynamics365['getDynamics365Accounts']())['then'](realtime['initDynamics365Accounts']())['then'](campaign[_0xf770('0x2e')]())[_0xf770('0x17')](realtime[_0xf770('0x2f')]())[_0xf770('0x17')](voiceExtension[_0xf770('0x30')]())[_0xf770('0x17')](realtime['initVoiceExtensions']())[_0xf770('0x17')](faxAccount[_0xf770('0x31')]())[_0xf770('0x17')](realtime[_0xf770('0x32')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0xf770('0x16')]()[_0xf770('0x17')](voiceQueueReport['getVoiceQueueReports']())[_0xf770('0x17')](realtime[_0xf770('0x33')]())['then'](cmHopperHistory[_0xf770('0x34')]())[_0xf770('0x17')](realtime[_0xf770('0x35')]())[_0xf770('0x17')](cmHopperHistory[_0xf770('0x36')]())['then'](realtime[_0xf770('0x37')]())[_0xf770('0x17')](voiceCallReport[_0xf770('0x38')]())['then'](realtime[_0xf770('0x39')]())[_0xf770('0x17')](function(_0x55285c){})['catch'](function(_0x16c0f3){console['log'](_0x16c0f3);});}function main(){return server[_0xf770('0x3a')](realtime,preview,fax)[_0xf770('0x17')](function(_0x1bf378){return initRealtime();})[_0xf770('0x17')](function(){return initParams();})[_0xf770('0x17')](function(){report[_0xf770('0x3b')]();setInterval(initRealtime,0x1388);})[_0xf770('0x3c')](function(_0xf8d5ed){console[_0xf770('0x3d')](_0xf8d5ed);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 25a95ee..d626f92 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 _0x805b=['user:save','lodash','util','moment','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','stateTime','status','unknown','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','prototype','updateStatusRealtime','toLowerCase','not_inuse','inuse','talking','statePause','toNumber','onhold','stringify','md5','format','user:%s','emit'];(function(_0x5dfd26,_0x21c554){var _0x5ae482=function(_0x543cff){while(--_0x543cff){_0x5dfd26['push'](_0x5dfd26['shift']());}};_0x5ae482(++_0x21c554);}(_0x805b,0x1e1));var _0xb805=function(_0x221ee5,_0x427d0e){_0x221ee5=_0x221ee5-0x0;var _0x218b1d=_0x805b[_0x221ee5];return _0x218b1d;};'use strict';var _=require(_0xb805('0x0'));var util=require(_0xb805('0x1'));var moment=require(_0xb805('0x2'));var md5=require('md5');var Redis=require(_0xb805('0x3'));var config=require(_0xb805('0x4'));config[_0xb805('0x5')]=_[_0xb805('0x6')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xb805('0x7'))(new Redis(config['redis']));function Agent(_0xd78621){this['id']=_0xd78621['id']||0x0;this[_0xb805('0x8')]=_0xd78621[_0xb805('0x8')]||'';this[_0xb805('0x9')]=_0xd78621[_0xb805('0x9')]||'';this[_0xb805('0xa')]=_0xd78621[_0xb805('0xa')]||'';this[_0xb805('0xb')]=_0xd78621[_0xb805('0xb')]||'';this[_0xb805('0xc')]='unknown';this[_0xb805('0xd')]=0x0;this[_0xb805('0xe')]=_0xb805('0xf');this[_0xb805('0x10')]='';this[_0xb805('0x11')]='';this[_0xb805('0x12')]='';this[_0xb805('0x13')]='';this[_0xb805('0x14')]=_0xd78621['online']||![];this[_0xb805('0x15')]='unknown';this[_0xb805('0x16')]=0x0;this[_0xb805('0x17')]='';this[_0xb805('0x18')]='';this['onhold']=![];this['local']=![];this['md5']='';}Agent[_0xb805('0x19')][_0xb805('0x1a')]=function(_0x18aa18){var _0x4187c4;if(_0x18aa18&&_0x18aa18[_0xb805('0xc')]){_0x4187c4=_0x18aa18[_0xb805('0xc')][_0xb805('0x1b')]();switch(_0x4187c4){case _0xb805('0x1c'):_0x4187c4='idle';break;case _0xb805('0x1d'):_0x4187c4=_0xb805('0x1e');break;}}if(_0x4187c4&&this[_0xb805('0x15')]!==_0x4187c4||_0x18aa18[_0xb805('0x1f')]){this[_0xb805('0x16')]=_[_0xb805('0x20')](moment()['format']('x'));}if(_0x4187c4){this[_0xb805('0x15')]=_0x4187c4;}var _0x562560={'id':this['id'],'name':this[_0xb805('0x8')],'email':this[_0xb805('0x9')],'accountcode':this[_0xb805('0xa')],'fullname':this[_0xb805('0xb')],'state':this['state'],'stateTime':this[_0xb805('0xd')],'status':this['status'],'address':this[_0xb805('0x10')],'online':this[_0xb805('0x14')],'voiceStatus':this[_0xb805('0x15')],'voiceStatusTime':this[_0xb805('0x16')],'voiceStatusCallerIdNumber':this[_0xb805('0x17')],'voiceStatusQueue':this[_0xb805('0x18')],'interface':this[_0xb805('0x13')],'onhold':this[_0xb805('0x21')]};var _0x328738=md5(JSON[_0xb805('0x22')](_0x562560));if(this[_0xb805('0x23')]!==_0x328738){this[_0xb805('0x23')]=_0x328738;io['to'](util[_0xb805('0x24')](_0xb805('0x25'),_0x562560['name']))[_0xb805('0x26')](_0xb805('0x27'),_0x562560);}};module['exports']=Agent; \ No newline at end of file +var _0x6aa0=['interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','local','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','talking','statePause','toNumber','format','accountcode','address','user:%s','name','emit','exports','lodash','util','md5','ioredis','redis','defaults','socket.io-emitter','email','fullname','state','unknown','stateTime','status','phone'];(function(_0x28941b,_0x47603b){var _0x5d7a6b=function(_0x4ba646){while(--_0x4ba646){_0x28941b['push'](_0x28941b['shift']());}};_0x5d7a6b(++_0x47603b);}(_0x6aa0,0xee));var _0x06aa=function(_0x2892da,_0x191a40){_0x2892da=_0x2892da-0x0;var _0x28cff2=_0x6aa0[_0x2892da];return _0x28cff2;};'use strict';var _=require(_0x06aa('0x0'));var util=require(_0x06aa('0x1'));var moment=require('moment');var md5=require(_0x06aa('0x2'));var Redis=require(_0x06aa('0x3'));var config=require('../../../config/environment');config[_0x06aa('0x4')]=_[_0x06aa('0x5')](config[_0x06aa('0x4')],{'host':'localhost','port':0x18eb});var io=require(_0x06aa('0x6'))(new Redis(config[_0x06aa('0x4')]));function Agent(_0x364438){this['id']=_0x364438['id']||0x0;this['name']=_0x364438['name']||'';this[_0x06aa('0x7')]=_0x364438[_0x06aa('0x7')]||'';this['accountcode']=_0x364438['accountcode']||'';this[_0x06aa('0x8')]=_0x364438[_0x06aa('0x8')]||'';this[_0x06aa('0x9')]=_0x06aa('0xa');this[_0x06aa('0xb')]=0x0;this[_0x06aa('0xc')]=_0x06aa('0xa');this['address']='';this[_0x06aa('0xd')]='';this['mobile']='';this[_0x06aa('0xe')]='';this[_0x06aa('0xf')]=_0x364438[_0x06aa('0xf')]||![];this[_0x06aa('0x10')]='unknown';this[_0x06aa('0x11')]=0x0;this[_0x06aa('0x12')]='';this[_0x06aa('0x13')]='';this['onhold']=![];this[_0x06aa('0x14')]=![];this[_0x06aa('0x2')]='';}Agent[_0x06aa('0x15')][_0x06aa('0x16')]=function(_0x966c38){var _0x42d4fc;if(_0x966c38&&_0x966c38[_0x06aa('0x9')]){_0x42d4fc=_0x966c38[_0x06aa('0x9')][_0x06aa('0x17')]();switch(_0x42d4fc){case _0x06aa('0x18'):_0x42d4fc=_0x06aa('0x19');break;case'inuse':_0x42d4fc=_0x06aa('0x1a');break;}}if(_0x42d4fc&&this['voiceStatus']!==_0x42d4fc||_0x966c38[_0x06aa('0x1b')]){this[_0x06aa('0x11')]=_[_0x06aa('0x1c')](moment()[_0x06aa('0x1d')]('x'));}if(_0x42d4fc){this['voiceStatus']=_0x42d4fc;}var _0x1927ef={'id':this['id'],'name':this['name'],'email':this[_0x06aa('0x7')],'accountcode':this[_0x06aa('0x1e')],'fullname':this[_0x06aa('0x8')],'state':this[_0x06aa('0x9')],'stateTime':this['stateTime'],'status':this[_0x06aa('0xc')],'address':this[_0x06aa('0x1f')],'online':this[_0x06aa('0xf')],'voiceStatus':this[_0x06aa('0x10')],'voiceStatusTime':this[_0x06aa('0x11')],'voiceStatusCallerIdNumber':this[_0x06aa('0x12')],'voiceStatusQueue':this['voiceStatusQueue'],'interface':this[_0x06aa('0xe')],'onhold':this['onhold']};var _0x160c12=md5(JSON['stringify'](_0x1927ef));if(this[_0x06aa('0x2')]!==_0x160c12){this[_0x06aa('0x2')]=_0x160c12;io['to'](util[_0x06aa('0x1d')](_0x06aa('0x20'),_0x1927ef[_0x06aa('0x21')]))[_0x06aa('0x22')]('user:save',_0x1927ef);}};module[_0x06aa('0x23')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 472b736..f032f14 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','type','campaign','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk'];(function(_0x37afd1,_0x42a8e1){var _0x1f0397=function(_0x367c08){while(--_0x367c08){_0x37afd1['push'](_0x37afd1['shift']());}};_0x1f0397(++_0x42a8e1);}(_0x0b0e,0x187));var _0xe0b0=function(_0x54d49e,_0x5d9911){_0x54d49e=_0x54d49e-0x0;var _0x4af0f1=_0x0b0e[_0x54d49e];return _0x4af0f1;};'use strict';function Campaign(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['type']=_0x29cd1e[_0xe0b0('0x1')]||_0xe0b0('0x2');this[_0xe0b0('0x3')]=0x0;this[_0xe0b0('0x4')]=0x0;this[_0xe0b0('0x5')]=0x0;this[_0xe0b0('0x6')]=0x0;this[_0xe0b0('0x7')]='';this[_0xe0b0('0x8')]=!![];this[_0xe0b0('0x9')]=_0x29cd1e[_0xe0b0('0x9')];this[_0xe0b0('0xa')]=_0x29cd1e['limitCalls'];this['dialTimezone']=_0x29cd1e[_0xe0b0('0xb')]||null;this[_0xe0b0('0xc')]=_0x29cd1e[_0xe0b0('0xc')]?_0x29cd1e[_0xe0b0('0xc')]:null;this['dialOriginateCallerIdName']=_0x29cd1e[_0xe0b0('0xd')];this[_0xe0b0('0xe')]=_0x29cd1e['dialOriginateCallerIdNumber'];this[_0xe0b0('0xf')]=_0x29cd1e[_0xe0b0('0xf')]||0x1e;this['dialCongestionMaxRetry']=_0x29cd1e[_0xe0b0('0x10')];this[_0xe0b0('0x11')]=_0x29cd1e[_0xe0b0('0x11')];this['dialBusyMaxRetry']=_0x29cd1e[_0xe0b0('0x12')];this[_0xe0b0('0x13')]=_0x29cd1e[_0xe0b0('0x13')];this[_0xe0b0('0x14')]=_0x29cd1e[_0xe0b0('0x14')];this['dialNoAnswerRetryFrequency']=_0x29cd1e[_0xe0b0('0x15')];this[_0xe0b0('0x16')]=_0x29cd1e[_0xe0b0('0x16')];this[_0xe0b0('0x17')]=_0x29cd1e[_0xe0b0('0x17')]||'DESC';this[_0xe0b0('0x18')]=_0x29cd1e['dialPrefix']||undefined;this[_0xe0b0('0x19')]=_0x29cd1e[_0xe0b0('0x19')]||undefined;this['dialCutDigit']=_0x29cd1e[_0xe0b0('0x1a')]||undefined;this['TrunkBackup']=_0x29cd1e[_0xe0b0('0x1b')]?_0x29cd1e[_0xe0b0('0x1b')]:undefined;this['Trunk']=_0x29cd1e['Trunk']?_0x29cd1e[_0xe0b0('0x1c')]:undefined;this['Interval']=_0x29cd1e['Interval']?_0x29cd1e['Interval']:undefined;this[_0xe0b0('0x1d')]=_0x29cd1e['SquareProject']?_0x29cd1e['SquareProject']:undefined;this[_0xe0b0('0x1e')]=_0x29cd1e['SquareProject']?_0x29cd1e[_0xe0b0('0x1d')]['name']:undefined;this[_0xe0b0('0x1f')]=_0x29cd1e[_0xe0b0('0x1f')]||![];this[_0xe0b0('0x20')]=_0x29cd1e[_0xe0b0('0x20')];this[_0xe0b0('0x21')]=_0x29cd1e['dialAMDGreeting'];this['dialAMDAfterGreetingSilence']=_0x29cd1e[_0xe0b0('0x22')];this['dialAMDTotalAnalysisTime']=_0x29cd1e[_0xe0b0('0x23')];this[_0xe0b0('0x24')]=_0x29cd1e['dialAMDMinWordLength'];this[_0xe0b0('0x25')]=_0x29cd1e['dialAMDBetweenWordsSilence'];this[_0xe0b0('0x26')]=_0x29cd1e['dialAMDMaximumNumberOfWords'];this[_0xe0b0('0x27')]=_0x29cd1e['dialAMDSilenceThreshold'];this[_0xe0b0('0x28')]=_0x29cd1e['dialAMDMaximumWordLength'];}module[_0xe0b0('0x29')]=Campaign; \ No newline at end of file +var _0xb7e7=['dialAMDSilenceThreshold','name','type','originated','ivrAnswerCallsDay','ivrTotalCallsDays','message','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialOrderByScheduledAt','DESC','dialPrefix','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords'];(function(_0x55a320,_0x52e66a){var _0x2ef6c4=function(_0xf4adb8){while(--_0xf4adb8){_0x55a320['push'](_0x55a320['shift']());}};_0x2ef6c4(++_0x52e66a);}(_0xb7e7,0x121));var _0x7b7e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb7e7[_0x122096];return _0x3d1966;};'use strict';function Campaign(_0x2e5e07){this['id']=_0x2e5e07['id']||0x0;this['name']=_0x2e5e07[_0x7b7e('0x0')]||'';this['type']=_0x2e5e07[_0x7b7e('0x1')]||'campaign';this[_0x7b7e('0x2')]=0x0;this['temp']=0x0;this[_0x7b7e('0x3')]=0x0;this[_0x7b7e('0x4')]=0x0;this[_0x7b7e('0x5')]='';this['sendMessageOneNotActive']=!![];this['active']=_0x2e5e07[_0x7b7e('0x6')];this[_0x7b7e('0x7')]=_0x2e5e07[_0x7b7e('0x7')];this['dialTimezone']=_0x2e5e07[_0x7b7e('0x8')]||null;this[_0x7b7e('0x9')]=_0x2e5e07[_0x7b7e('0x9')]?_0x2e5e07[_0x7b7e('0x9')]:null;this[_0x7b7e('0xa')]=_0x2e5e07[_0x7b7e('0xa')];this[_0x7b7e('0xb')]=_0x2e5e07['dialOriginateCallerIdNumber'];this[_0x7b7e('0xc')]=_0x2e5e07[_0x7b7e('0xc')]||0x1e;this[_0x7b7e('0xd')]=_0x2e5e07[_0x7b7e('0xd')];this[_0x7b7e('0xe')]=_0x2e5e07[_0x7b7e('0xe')];this[_0x7b7e('0xf')]=_0x2e5e07[_0x7b7e('0xf')];this[_0x7b7e('0x10')]=_0x2e5e07['dialBusyRetryFrequency'];this[_0x7b7e('0x11')]=_0x2e5e07[_0x7b7e('0x11')];this['dialNoAnswerRetryFrequency']=_0x2e5e07[_0x7b7e('0x12')];this['dialGlobalMaxRetry']=_0x2e5e07['dialGlobalMaxRetry'];this[_0x7b7e('0x13')]=_0x2e5e07[_0x7b7e('0x13')]||_0x7b7e('0x14');this[_0x7b7e('0x15')]=_0x2e5e07[_0x7b7e('0x15')]||undefined;this['dialRandomLastDigitCallerIdNumber']=_0x2e5e07['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x7b7e('0x16')]=_0x2e5e07[_0x7b7e('0x16')]||undefined;this[_0x7b7e('0x17')]=_0x2e5e07[_0x7b7e('0x17')]?_0x2e5e07[_0x7b7e('0x17')]:undefined;this[_0x7b7e('0x18')]=_0x2e5e07[_0x7b7e('0x18')]?_0x2e5e07[_0x7b7e('0x18')]:undefined;this[_0x7b7e('0x19')]=_0x2e5e07[_0x7b7e('0x19')]?_0x2e5e07[_0x7b7e('0x19')]:undefined;this[_0x7b7e('0x1a')]=_0x2e5e07[_0x7b7e('0x1a')]?_0x2e5e07[_0x7b7e('0x1a')]:undefined;this[_0x7b7e('0x1b')]=_0x2e5e07[_0x7b7e('0x1a')]?_0x2e5e07[_0x7b7e('0x1a')]['name']:undefined;this[_0x7b7e('0x1c')]=_0x2e5e07[_0x7b7e('0x1c')]||![];this[_0x7b7e('0x1d')]=_0x2e5e07['dialAMDInitialSilence'];this[_0x7b7e('0x1e')]=_0x2e5e07[_0x7b7e('0x1e')];this[_0x7b7e('0x1f')]=_0x2e5e07[_0x7b7e('0x1f')];this[_0x7b7e('0x20')]=_0x2e5e07[_0x7b7e('0x20')];this[_0x7b7e('0x21')]=_0x2e5e07[_0x7b7e('0x21')];this['dialAMDBetweenWordsSilence']=_0x2e5e07['dialAMDBetweenWordsSilence'];this['dialAMDMaximumNumberOfWords']=_0x2e5e07[_0x7b7e('0x22')];this[_0x7b7e('0x23')]=_0x2e5e07[_0x7b7e('0x23')];this['dialAMDMaximumWordLength']=_0x2e5e07['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 27bf98c..536a899 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 _0xb53e=['tag','monitor','monitorFilename','queue','monitors','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','calleridnum','calleridname','connectedlinename','accountcode','uniqueid','linkedid','answertime','endtime','unmanaged','lastapplication','billableseconds','holdtime','type'];(function(_0xa25a3b,_0xa397f2){var _0x1c07d4=function(_0x445f17){while(--_0x445f17){_0xa25a3b['push'](_0xa25a3b['shift']());}};_0x1c07d4(++_0xa397f2);}(_0xb53e,0xa9));var _0xeb53=function(_0x5bbab1,_0x21b657){_0x5bbab1=_0x5bbab1-0x0;var _0x5a348d=_0xb53e[_0x5bbab1];return _0x5a348d;};'use strict';function Channel(){this[_0xeb53('0x0')]=null;this[_0xeb53('0x1')]='';this['destinationchannel']='';this[_0xeb53('0x2')]=0x0;this[_0xeb53('0x3')]='';this['connectedlinenum']=undefined;this[_0xeb53('0x4')]=undefined;this[_0xeb53('0x5')]=0x0;this['context']='';this[_0xeb53('0x6')]=0x0;this[_0xeb53('0x7')]=0x0;this['exten']=0x0;this['answered']=![];this[_0xeb53('0x8')]=null;this[_0xeb53('0x9')]=null;this[_0xeb53('0xa')]=![];this['abandoned']=![];this[_0xeb53('0xb')]='';this['lastdata']='';this['duration']=0x0;this[_0xeb53('0xc')]=0x0;this[_0xeb53('0xd')]=0x0;this[_0xeb53('0xe')]=null;this[_0xeb53('0xf')]=null;this['disposition']=null;this[_0xeb53('0x10')]=![];this[_0xeb53('0x11')]=null;this[_0xeb53('0x12')]=null;this[_0xeb53('0x13')]=[];this[_0xeb53('0x14')]=undefined;this[_0xeb53('0x15')]=undefined;this[_0xeb53('0x16')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0xf0f1=['destinationchannel','calleridnum','connectedlinename','context','linkedid','exten','answered','endtime','unmanaged','abandoned','lastapplication','lastdata','duration','billableseconds','tag','disposition','monitorFilename','queue','monitors','mohtime','channel'];(function(_0x1573e7,_0x18b256){var _0x3923f8=function(_0x18ee55){while(--_0x18ee55){_0x1573e7['push'](_0x1573e7['shift']());}};_0x3923f8(++_0x18b256);}(_0xf0f1,0x110));var _0x1f0f=function(_0x36b037,_0x2b234e){_0x36b037=_0x36b037-0x0;var _0x409194=_0xf0f1[_0x36b037];return _0x409194;};'use strict';function Channel(){this['starttime']=null;this[_0x1f0f('0x0')]='';this[_0x1f0f('0x1')]='';this[_0x1f0f('0x2')]=0x0;this['calleridname']='';this['connectedlinenum']=undefined;this[_0x1f0f('0x3')]=undefined;this['accountcode']=0x0;this[_0x1f0f('0x4')]='';this['uniqueid']=0x0;this[_0x1f0f('0x5')]=0x0;this[_0x1f0f('0x6')]=0x0;this[_0x1f0f('0x7')]=![];this['answertime']=null;this[_0x1f0f('0x8')]=null;this[_0x1f0f('0x9')]=![];this[_0x1f0f('0xa')]=![];this[_0x1f0f('0xb')]='';this[_0x1f0f('0xc')]='';this[_0x1f0f('0xd')]=0x0;this[_0x1f0f('0xe')]=0x0;this['holdtime']=0x0;this['type']=null;this[_0x1f0f('0xf')]=null;this[_0x1f0f('0x10')]=null;this['monitor']=![];this[_0x1f0f('0x11')]=null;this[_0x1f0f('0x12')]=null;this[_0x1f0f('0x13')]=[];this['transfercalleridnum']=undefined;this['transferconnectedlinenum']=undefined;this[_0x1f0f('0x14')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index d894860..c37617f 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 _0x8819=['tokenSecret','serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token'];(function(_0x3b3b80,_0x46a96e){var _0x36b196=function(_0x1941d6){while(--_0x1941d6){_0x3b3b80['push'](_0x3b3b80['shift']());}};_0x36b196(++_0x46a96e);}(_0x8819,0x94));var _0x9881=function(_0x17b4f7,_0x5275e3){_0x17b4f7=_0x17b4f7-0x0;var _0x40b26d=_0x8819[_0x17b4f7];return _0x40b26d;};'use strict';function DeskAccount(_0x46ac3c){this['id']=_0x46ac3c['id']||0x0;this['name']=_0x46ac3c[_0x9881('0x0')]||'';this[_0x9881('0x1')]=_0x46ac3c[_0x9881('0x1')]||'';this[_0x9881('0x2')]=_0x46ac3c[_0x9881('0x2')]||'';this['authType']=_0x46ac3c[_0x9881('0x3')]||'';this[_0x9881('0x4')]=_0x46ac3c[_0x9881('0x4')]||'';this[_0x9881('0x5')]=_0x46ac3c[_0x9881('0x5')]||'';this[_0x9881('0x6')]=_0x46ac3c['consumerSecret']||'';this[_0x9881('0x7')]=_0x46ac3c['token']||'';this['tokenSecret']=_0x46ac3c[_0x9881('0x8')]||'';this['type']=_0x46ac3c['type']||'';this[_0x9881('0x9')]=_0x46ac3c['serverUrl']||'';this[_0x9881('0xa')]=_0x46ac3c[_0x9881('0xa')]||{};}module[_0x9881('0xb')]=DeskAccount; \ No newline at end of file +var _0x5a52=['exports','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','Configurations'];(function(_0x1477ef,_0x54a5d6){var _0x164acd=function(_0x139149){while(--_0x139149){_0x1477ef['push'](_0x1477ef['shift']());}};_0x164acd(++_0x54a5d6);}(_0x5a52,0x18d));var _0x25a5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5a52[_0x3dd15e];return _0x231fd0;};'use strict';function DeskAccount(_0x529b41){this['id']=_0x529b41['id']||0x0;this['name']=_0x529b41['name']||'';this['username']=_0x529b41[_0x25a5('0x0')]||'';this[_0x25a5('0x1')]=_0x529b41[_0x25a5('0x1')]||'';this[_0x25a5('0x2')]=_0x529b41[_0x25a5('0x2')]||'';this[_0x25a5('0x3')]=_0x529b41[_0x25a5('0x3')]||'';this[_0x25a5('0x4')]=_0x529b41['consumerKey']||'';this[_0x25a5('0x5')]=_0x529b41['consumerSecret']||'';this[_0x25a5('0x6')]=_0x529b41[_0x25a5('0x6')]||'';this[_0x25a5('0x7')]=_0x529b41[_0x25a5('0x7')]||'';this[_0x25a5('0x8')]=_0x529b41[_0x25a5('0x8')]||'';this['serverUrl']=_0x529b41['serverUrl']||'';this[_0x25a5('0x9')]=_0x529b41[_0x25a5('0x9')]||{};}module[_0x25a5('0xa')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 48ec56b..bf4910b 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 _0x0ae3=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','exports'];(function(_0x4e356a,_0x2b955a){var _0x5ebac1=function(_0xcb1909){while(--_0xcb1909){_0x4e356a['push'](_0x4e356a['shift']());}};_0x5ebac1(++_0x2b955a);}(_0x0ae3,0xe1));var _0x30ae=function(_0x56e4fc,_0x1f9a87){_0x56e4fc=_0x56e4fc-0x0;var _0x3d177b=_0x0ae3[_0x56e4fc];return _0x3d177b;};'use strict';function Dynamics365Account(_0x26b644){this['id']=_0x26b644['id']||0x0;this['name']=_0x26b644[_0x30ae('0x0')]||'';this[_0x30ae('0x1')]=_0x26b644[_0x30ae('0x1')]||'';this[_0x30ae('0x2')]=_0x26b644[_0x30ae('0x2')]||'';this[_0x30ae('0x3')]=_0x26b644['remoteUri']||'';this['tenantId']=_0x26b644[_0x30ae('0x4')]||'';this['clientId']=_0x26b644[_0x30ae('0x5')]||'';this[_0x30ae('0x6')]=_0x26b644[_0x30ae('0x6')]||{};this['serverUrl']=_0x26b644[_0x30ae('0x7')]||'';this['Configurations']=_0x26b644['Configurations']||{};}module[_0x30ae('0x8')]=Dynamics365Account; \ No newline at end of file +var _0xa61d=['clientId','clientSecret','serverUrl','Configurations','name','username','password','remoteUri','tenantId'];(function(_0x16bec4,_0x519692){var _0x60abe2=function(_0x13c4dc){while(--_0x13c4dc){_0x16bec4['push'](_0x16bec4['shift']());}};_0x60abe2(++_0x519692);}(_0xa61d,0x1ea));var _0xda61=function(_0x463a03,_0x13914f){_0x463a03=_0x463a03-0x0;var _0x5baa30=_0xa61d[_0x463a03];return _0x5baa30;};'use strict';function Dynamics365Account(_0x38ea9f){this['id']=_0x38ea9f['id']||0x0;this['name']=_0x38ea9f[_0xda61('0x0')]||'';this[_0xda61('0x1')]=_0x38ea9f[_0xda61('0x1')]||'';this[_0xda61('0x2')]=_0x38ea9f[_0xda61('0x2')]||'';this['remoteUri']=_0x38ea9f[_0xda61('0x3')]||'';this[_0xda61('0x4')]=_0x38ea9f[_0xda61('0x4')]||'';this[_0xda61('0x5')]=_0x38ea9f[_0xda61('0x5')]||'';this[_0xda61('0x6')]=_0x38ea9f[_0xda61('0x6')]||{};this[_0xda61('0x7')]=_0x38ea9f['serverUrl']||'';this['Configurations']=_0x38ea9f[_0xda61('0x8')]||{};}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 1408830..d80b5e3 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 _0xa292=['description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','SIP','Trunk','ListId','key','name'];(function(_0x11054b,_0x59b6e9){var _0x436574=function(_0x396130){while(--_0x396130){_0x11054b['push'](_0x11054b['shift']());}};_0x436574(++_0x59b6e9);}(_0xa292,0x7f));var _0x2a29=function(_0x162383,_0x392edf){_0x162383=_0x162383-0x0;var _0x116012=_0xa292[_0x162383];return _0x116012;};'use strict';function FaxAccount(_0x48dca0){this['id']=_0x48dca0['id']||0x0;this['name']=_0x48dca0[_0x2a29('0x0')]||'';this[_0x2a29('0x1')]=_0x48dca0[_0x2a29('0x1')];this[_0x2a29('0x2')]=_0x48dca0[_0x2a29('0x2')];this[_0x2a29('0x3')]=_0x48dca0[_0x2a29('0x3')];this[_0x2a29('0x4')]=_0x48dca0[_0x2a29('0x4')];this['minrate']=_0x48dca0[_0x2a29('0x5')]||0x960;this[_0x2a29('0x6')]=_0x48dca0[_0x2a29('0x6')]||0x3840;this[_0x2a29('0x7')]=_0x48dca0[_0x2a29('0x7')]||_0x2a29('0x8');this[_0x2a29('0x9')]=_0x48dca0[_0x2a29('0x9')]||'no';this['faxdetect']=_0x48dca0[_0x2a29('0xa')]||'no';this[_0x2a29('0xb')]=_0x48dca0['t38timeout']||0x1388;this['tech']=_0x48dca0['tech']||_0x2a29('0xc');this[_0x2a29('0xd')]=_0x48dca0[_0x2a29('0xd')]?_0x48dca0[_0x2a29('0xd')]:undefined;this[_0x2a29('0xe')]=_0x48dca0[_0x2a29('0xe')];this['key']=_0x48dca0[_0x2a29('0xf')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x8976=['ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x278040,_0x46119d){var _0x4dba4f=function(_0x4fd0af){while(--_0x4fd0af){_0x278040['push'](_0x278040['shift']());}};_0x4dba4f(++_0x46119d);}(_0x8976,0x1e9));var _0x6897=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8976[_0x2641f9];return _0x585741;};'use strict';function FaxAccount(_0x5cd9f4){this['id']=_0x5cd9f4['id']||0x0;this['name']=_0x5cd9f4[_0x6897('0x0')]||'';this[_0x6897('0x1')]=_0x5cd9f4['description'];this[_0x6897('0x2')]=_0x5cd9f4['ecm'];this[_0x6897('0x3')]=_0x5cd9f4[_0x6897('0x3')];this[_0x6897('0x4')]=_0x5cd9f4['localstationid'];this[_0x6897('0x5')]=_0x5cd9f4[_0x6897('0x5')]||0x960;this[_0x6897('0x6')]=_0x5cd9f4[_0x6897('0x6')]||0x3840;this[_0x6897('0x7')]=_0x5cd9f4[_0x6897('0x7')]||_0x6897('0x8');this[_0x6897('0x9')]=_0x5cd9f4['gateway']||'no';this[_0x6897('0xa')]=_0x5cd9f4['faxdetect']||'no';this[_0x6897('0xb')]=_0x5cd9f4[_0x6897('0xb')]||0x1388;this[_0x6897('0xc')]=_0x5cd9f4[_0x6897('0xc')]||_0x6897('0xd');this[_0x6897('0xe')]=_0x5cd9f4['Trunk']?_0x5cd9f4[_0x6897('0xe')]:undefined;this[_0x6897('0xf')]=_0x5cd9f4[_0x6897('0xf')];this['key']=_0x5cd9f4[_0x6897('0x10')];}module[_0x6897('0x11')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ec122dd..bf39eee 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 _0xb50d=['apiKey','token','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0x2b71da,_0x1a6441){var _0x314281=function(_0x492f51){while(--_0x492f51){_0x2b71da['push'](_0x2b71da['shift']());}};_0x314281(++_0x1a6441);}(_0xb50d,0x1b6));var _0xdb50=function(_0x20bb29,_0x8061db){_0x20bb29=_0x20bb29-0x0;var _0x3f4d4a=_0xb50d[_0x20bb29];return _0x3f4d4a;};'use strict';function FreshdeskAccount(_0x4fae27){this['id']=_0x4fae27['id']||0x0;this[_0xdb50('0x0')]=_0x4fae27['name']||'';this[_0xdb50('0x1')]=_0x4fae27['username']||'';this[_0xdb50('0x2')]=_0x4fae27[_0xdb50('0x3')]||'';this[_0xdb50('0x4')]=_0x4fae27[_0xdb50('0x4')]||'';this[_0xdb50('0x5')]=_0x4fae27[_0xdb50('0x5')]||'';this[_0xdb50('0x6')]=_0x4fae27[_0xdb50('0x6')]||{};}module[_0xdb50('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x1404=['Configurations','exports','name','username','apiKey','token','remoteUri','serverUrl'];(function(_0x474bd1,_0x3b8bbd){var _0x17a343=function(_0x170054){while(--_0x170054){_0x474bd1['push'](_0x474bd1['shift']());}};_0x17a343(++_0x3b8bbd);}(_0x1404,0xb2));var _0x4140=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0x1404[_0x6cf19c];return _0xce14f3;};'use strict';function FreshdeskAccount(_0xcc0478){this['id']=_0xcc0478['id']||0x0;this['name']=_0xcc0478[_0x4140('0x0')]||'';this[_0x4140('0x1')]=_0xcc0478['username']||'';this[_0x4140('0x2')]=_0xcc0478[_0x4140('0x3')]||'';this[_0x4140('0x4')]=_0xcc0478[_0x4140('0x4')]||'';this[_0x4140('0x5')]=_0xcc0478[_0x4140('0x5')]||'';this[_0x4140('0x6')]=_0xcc0478[_0x4140('0x6')]||{};}module[_0x4140('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 dd428ca..d84080a 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 _0x34d7=['type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','connectedlinenum','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','exports'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0x34d7,0xea));var _0x734d=function(_0x540654,_0x2de73e){_0x540654=_0x540654-0x0;var _0x50427f=_0x34d7[_0x540654];return _0x50427f;};'use strict';function QueueReport(){this[_0x734d('0x0')]=_0x734d('0x1');this['uniqueid']='';this[_0x734d('0x2')]='';this[_0x734d('0x3')]='';this[_0x734d('0x4')]='';this[_0x734d('0x5')]=null;this[_0x734d('0x6')]=null;this[_0x734d('0x7')]=0x1;this[_0x734d('0x8')]=0x1;this[_0x734d('0x9')]=![];this[_0x734d('0xa')]=null;this[_0x734d('0xb')]=![];this[_0x734d('0xc')]=null;this[_0x734d('0xd')]=![];this[_0x734d('0xe')]=null;this[_0x734d('0xf')]=0x1;this['channel']='';this[_0x734d('0x10')]='';this['connectedlinename']='';this[_0x734d('0x11')]='';this['context']='';this[_0x734d('0x12')]='';this[_0x734d('0x13')]='';this[_0x734d('0x14')]=0x0;this[_0x734d('0x15')]=![];this[_0x734d('0x16')]='';this[_0x734d('0x17')]=0x0;this[_0x734d('0x18')]={};}module[_0x734d('0x19')]=QueueReport; \ No newline at end of file +var _0xb78d=['channel','connectedlinenum','connectedlinename','accountcode','exten','priority','holdtime','assigned','lastAssignedTo','variables','exports','type','calleridnum','calleridname','queue','queuecallerleaveAt','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','originalposition'];(function(_0x1e6ed7,_0x547958){var _0x57952f=function(_0x86eef){while(--_0x86eef){_0x1e6ed7['push'](_0x1e6ed7['shift']());}};_0x57952f(++_0x547958);}(_0xb78d,0x14d));var _0xdb78=function(_0x47a57f,_0x43fa21){_0x47a57f=_0x47a57f-0x0;var _0x1a1a02=_0xb78d[_0x47a57f];return _0x1a1a02;};'use strict';function QueueReport(){this[_0xdb78('0x0')]='inbound';this['uniqueid']='';this[_0xdb78('0x1')]='';this[_0xdb78('0x2')]='';this[_0xdb78('0x3')]='';this['queuecallerjoinAt']=null;this[_0xdb78('0x4')]=null;this['position']=0x1;this[_0xdb78('0x5')]=0x1;this[_0xdb78('0x6')]=![];this[_0xdb78('0x7')]=null;this[_0xdb78('0x8')]=![];this[_0xdb78('0x9')]=null;this[_0xdb78('0xa')]=![];this['queuecallerexitAt']=null;this[_0xdb78('0xb')]=0x1;this[_0xdb78('0xc')]='';this[_0xdb78('0xd')]='';this[_0xdb78('0xe')]='';this[_0xdb78('0xf')]='';this['context']='';this[_0xdb78('0x10')]='';this[_0xdb78('0x11')]='';this[_0xdb78('0x12')]=0x0;this[_0xdb78('0x13')]=![];this[_0xdb78('0x14')]='';this['mohtime']=0x0;this[_0xdb78('0x15')]={};}module[_0xdb78('0x16')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index d5ea773..21e7c09 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 _0x1a21=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0xafa225,_0xd29c03){var _0x4f546a=function(_0x565b3f){while(--_0x565b3f){_0xafa225['push'](_0xafa225['shift']());}};_0x4f546a(++_0xd29c03);}(_0x1a21,0x1d9));var _0x11a2=function(_0x4a0f16,_0x21ba18){_0x4a0f16=_0x4a0f16-0x0;var _0x45d653=_0x1a21[_0x4a0f16];return _0x45d653;};'use strict';function SalesforceAccount(_0x33f5ef){this['id']=_0x33f5ef['id']||0x0;this[_0x11a2('0x0')]=_0x33f5ef[_0x11a2('0x0')]||'';this[_0x11a2('0x1')]=_0x33f5ef[_0x11a2('0x1')]||'';this[_0x11a2('0x2')]=_0x33f5ef[_0x11a2('0x2')]||'';this[_0x11a2('0x3')]=_0x33f5ef[_0x11a2('0x3')]||'';this[_0x11a2('0x4')]=_0x33f5ef[_0x11a2('0x4')]||'';this['clientSecret']=_0x33f5ef[_0x11a2('0x5')]||'';this[_0x11a2('0x6')]=_0x33f5ef[_0x11a2('0x6')]||'';this[_0x11a2('0x7')]=_0x33f5ef[_0x11a2('0x7')]||_0x11a2('0x8');this['serverUrl']=_0x33f5ef[_0x11a2('0x9')]||'';this[_0x11a2('0xa')]=_0x33f5ef[_0x11a2('0xa')]||{};}module[_0x11a2('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x5a3a=['name','username','remoteUri','password','clientId','securityToken','type','integrationTab','serverUrl','Configurations','exports'];(function(_0x3b141a,_0xc8dd67){var _0x2fcb95=function(_0x5311bb){while(--_0x5311bb){_0x3b141a['push'](_0x3b141a['shift']());}};_0x2fcb95(++_0xc8dd67);}(_0x5a3a,0x9a));var _0xa5a3=function(_0xc20da1,_0x1aa1ef){_0xc20da1=_0xc20da1-0x0;var _0x10aa89=_0x5a3a[_0xc20da1];return _0x10aa89;};'use strict';function SalesforceAccount(_0x38d497){this['id']=_0x38d497['id']||0x0;this[_0xa5a3('0x0')]=_0x38d497['name']||'';this[_0xa5a3('0x1')]=_0x38d497[_0xa5a3('0x1')]||'';this[_0xa5a3('0x2')]=_0x38d497[_0xa5a3('0x2')]||'';this[_0xa5a3('0x3')]=_0x38d497[_0xa5a3('0x3')]||'';this[_0xa5a3('0x4')]=_0x38d497['clientId']||'';this['clientSecret']=_0x38d497['clientSecret']||'';this[_0xa5a3('0x5')]=_0x38d497[_0xa5a3('0x5')]||'';this[_0xa5a3('0x6')]=_0x38d497[_0xa5a3('0x6')]||_0xa5a3('0x7');this['serverUrl']=_0x38d497[_0xa5a3('0x8')]||'';this[_0xa5a3('0x9')]=_0x38d497[_0xa5a3('0x9')]||{};}module[_0xa5a3('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 382d24b..1961e7d 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 _0x0da8=['remoteUri','serverUrl','Configurations','name','username','password'];(function(_0x22ea59,_0x387ed1){var _0x444611=function(_0x5b2fea){while(--_0x5b2fea){_0x22ea59['push'](_0x22ea59['shift']());}};_0x444611(++_0x387ed1);}(_0x0da8,0x1ef));var _0x80da=function(_0x3f0577,_0x13d404){_0x3f0577=_0x3f0577-0x0;var _0x3c70dc=_0x0da8[_0x3f0577];return _0x3c70dc;};'use strict';function ServicenowAccount(_0xe40b2a){this['id']=_0xe40b2a['id']||0x0;this[_0x80da('0x0')]=_0xe40b2a[_0x80da('0x0')]||'';this[_0x80da('0x1')]=_0xe40b2a[_0x80da('0x1')]||'';this['password']=_0xe40b2a[_0x80da('0x2')]||'';this[_0x80da('0x3')]=_0xe40b2a['remoteUri']||'';this[_0x80da('0x4')]=_0xe40b2a[_0x80da('0x4')]||'';this[_0x80da('0x5')]=_0xe40b2a[_0x80da('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file +var _0x5aa1=['serverUrl','Configurations','name','username','password','remoteUri'];(function(_0x33f77e,_0x37aeee){var _0x206b83=function(_0x34b3bc){while(--_0x34b3bc){_0x33f77e['push'](_0x33f77e['shift']());}};_0x206b83(++_0x37aeee);}(_0x5aa1,0x158));var _0x15aa=function(_0xc6c883,_0x134a5e){_0xc6c883=_0xc6c883-0x0;var _0x11cbb0=_0x5aa1[_0xc6c883];return _0x11cbb0;};'use strict';function ServicenowAccount(_0x2df5d1){this['id']=_0x2df5d1['id']||0x0;this[_0x15aa('0x0')]=_0x2df5d1[_0x15aa('0x0')]||'';this[_0x15aa('0x1')]=_0x2df5d1[_0x15aa('0x1')]||'';this['password']=_0x2df5d1[_0x15aa('0x2')]||'';this[_0x15aa('0x3')]=_0x2df5d1['remoteUri']||'';this[_0x15aa('0x4')]=_0x2df5d1[_0x15aa('0x4')]||'';this[_0x15aa('0x5')]=_0x2df5d1[_0x15aa('0x5')]||{};}module['exports']=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 9f56a19..ab058cd 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 _0xeab4=['remoteUri','serverUrl','Configurations','name','password'];(function(_0x13ea17,_0x59c534){var _0x200561=function(_0x3b3f53){while(--_0x3b3f53){_0x13ea17['push'](_0x13ea17['shift']());}};_0x200561(++_0x59c534);}(_0xeab4,0x152));var _0x4eab=function(_0x4a440c,_0x5531b1){_0x4a440c=_0x4a440c-0x0;var _0x8bd0b1=_0xeab4[_0x4a440c];return _0x8bd0b1;};'use strict';function SugarcrmAccount(_0x3ce277){this['id']=_0x3ce277['id']||0x0;this['name']=_0x3ce277[_0x4eab('0x0')]||'';this['username']=_0x3ce277['username']||'';this[_0x4eab('0x1')]=_0x3ce277[_0x4eab('0x1')]||'';this['remoteUri']=_0x3ce277[_0x4eab('0x2')]||'';this[_0x4eab('0x3')]=_0x3ce277['serverUrl']||'';this[_0x4eab('0x4')]=_0x3ce277['Configurations']||{};}module['exports']=SugarcrmAccount; \ No newline at end of file +var _0xf1d7=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x23cee9,_0x57b8c6){var _0x1db829=function(_0x28b4f2){while(--_0x28b4f2){_0x23cee9['push'](_0x23cee9['shift']());}};_0x1db829(++_0x57b8c6);}(_0xf1d7,0xa7));var _0x7f1d=function(_0x2e394e,_0x107484){_0x2e394e=_0x2e394e-0x0;var _0x5e305b=_0xf1d7[_0x2e394e];return _0x5e305b;};'use strict';function SugarcrmAccount(_0x49e86f){this['id']=_0x49e86f['id']||0x0;this[_0x7f1d('0x0')]=_0x49e86f[_0x7f1d('0x0')]||'';this[_0x7f1d('0x1')]=_0x49e86f[_0x7f1d('0x1')]||'';this['password']=_0x49e86f[_0x7f1d('0x2')]||'';this[_0x7f1d('0x3')]=_0x49e86f['remoteUri']||'';this[_0x7f1d('0x4')]=_0x49e86f[_0x7f1d('0x4')]||'';this['Configurations']=_0x49e86f[_0x7f1d('0x5')]||{};}module[_0x7f1d('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 14f3268..e588e23 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 _0x525f=['name','accountcode','state','stateTime','status','unknown','address'];(function(_0x346eea,_0x3fcf23){var _0x276a57=function(_0x1763a0){while(--_0x1763a0){_0x346eea['push'](_0x346eea['shift']());}};_0x276a57(++_0x3fcf23);}(_0x525f,0x11f));var _0xf525=function(_0x1fc2a7,_0x421e37){_0x1fc2a7=_0x1fc2a7-0x0;var _0x54481a=_0x525f[_0x1fc2a7];return _0x54481a;};'use strict';function Telephone(_0x440397){this['id']=_0x440397['id']||0x0;this[_0xf525('0x0')]=_0x440397[_0xf525('0x0')]||'';this[_0xf525('0x1')]=_0x440397['accountcode']||'';this[_0xf525('0x2')]='unknown';this[_0xf525('0x3')]=0x0;this[_0xf525('0x4')]=_0xf525('0x5');this[_0xf525('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xc1f6=['exports','accountcode','state','unknown','stateTime','status','address'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xc1f6,0x189));var _0x6c1f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc1f6[_0x3dd15e];return _0x231fd0;};'use strict';function Telephone(_0x38921c){this['id']=_0x38921c['id']||0x0;this['name']=_0x38921c['name']||'';this[_0x6c1f('0x0')]=_0x38921c[_0x6c1f('0x0')]||'';this[_0x6c1f('0x1')]=_0x6c1f('0x2');this[_0x6c1f('0x3')]=0x0;this[_0x6c1f('0x4')]='unknown';this[_0x6c1f('0x5')]='';}module[_0x6c1f('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index a6b787c..cbb1e32 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 _0x3102=['html','name'];(function(_0x6c4255,_0x25e1c8){var _0x3ae10d=function(_0x3eff63){while(--_0x3eff63){_0x6c4255['push'](_0x6c4255['shift']());}};_0x3ae10d(++_0x25e1c8);}(_0x3102,0x119));var _0x2310=function(_0x2aea9e,_0x1f587f){_0x2aea9e=_0x2aea9e-0x0;var _0x430b92=_0x3102[_0x2aea9e];return _0x430b92;};'use strict';function template(_0x436e69){this['id']=_0x436e69['id']||0x0;this[_0x2310('0x0')]=_0x436e69[_0x2310('0x0')]||'';this[_0x2310('0x1')]=_0x436e69[_0x2310('0x1')]||'';}module['exports']=template; \ No newline at end of file +var _0x045f=['name','html'];(function(_0x5efb33,_0x190fb7){var _0xe94402=function(_0xa704a8){while(--_0xa704a8){_0x5efb33['push'](_0x5efb33['shift']());}};_0xe94402(++_0x190fb7);}(_0x045f,0x150));var _0xf045=function(_0x4c91ad,_0x4be2ea){_0x4c91ad=_0x4c91ad-0x0;var _0x527cb7=_0x045f[_0x4c91ad];return _0x527cb7;};'use strict';function template(_0xeebbdf){this['id']=_0xeebbdf['id']||0x0;this[_0xf045('0x0')]=_0xeebbdf[_0xf045('0x0')]||'';this[_0xf045('0x1')]=_0xeebbdf[_0xf045('0x1')]||'';}module['exports']=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index e96174b..8629a36 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 _0x8ef6=['status','AllConditions','AnyConditions','exports','name','channel','voice'];(function(_0x109ced,_0x47e318){var _0x139757=function(_0x3b9d21){while(--_0x3b9d21){_0x109ced['push'](_0x109ced['shift']());}};_0x139757(++_0x47e318);}(_0x8ef6,0xf2));var _0x68ef=function(_0x1d123d,_0x57bf56){_0x1d123d=_0x1d123d-0x0;var _0x45473e=_0x8ef6[_0x1d123d];return _0x45473e;};'use strict';function Trigger(_0x58ecc7){this['id']=_0x58ecc7['id']||0x0;this[_0x68ef('0x0')]=_0x58ecc7[_0x68ef('0x0')]||'';this[_0x68ef('0x1')]=_0x58ecc7[_0x68ef('0x1')]||_0x68ef('0x2');this[_0x68ef('0x3')]=_0x58ecc7['status']||![];this[_0x68ef('0x4')]=_0x58ecc7[_0x68ef('0x4')]||[];this[_0x68ef('0x5')]=_0x58ecc7[_0x68ef('0x5')]||[];this['Actions']=_0x58ecc7['Actions']||[];}module[_0x68ef('0x6')]=Trigger; \ No newline at end of file +var _0x6aa7=['voice','status','AllConditions','Actions','exports','name','channel'];(function(_0x150fc8,_0x14f156){var _0x4dbe12=function(_0xc7414e){while(--_0xc7414e){_0x150fc8['push'](_0x150fc8['shift']());}};_0x4dbe12(++_0x14f156);}(_0x6aa7,0x178));var _0x76aa=function(_0x5f581b,_0x179fa6){_0x5f581b=_0x5f581b-0x0;var _0x8ab362=_0x6aa7[_0x5f581b];return _0x8ab362;};'use strict';function Trigger(_0x8de1e4){this['id']=_0x8de1e4['id']||0x0;this['name']=_0x8de1e4[_0x76aa('0x0')]||'';this[_0x76aa('0x1')]=_0x8de1e4[_0x76aa('0x1')]||_0x76aa('0x2');this['status']=_0x8de1e4[_0x76aa('0x3')]||![];this[_0x76aa('0x4')]=_0x8de1e4[_0x76aa('0x4')]||[];this['AnyConditions']=_0x8de1e4['AnyConditions']||[];this[_0x76aa('0x5')]=_0x8de1e4['Actions']||[];}module[_0x76aa('0x6')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 29ab876..2300b11 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 _0xbe49=['domainport','refresh','registrationtime','address','exports','active','name','unknown','stateTime','status','registry','indexOf','split','domain'];(function(_0x461b4e,_0x306b2f){var _0x1b1606=function(_0x5eba39){while(--_0x5eba39){_0x461b4e['push'](_0x461b4e['shift']());}};_0x1b1606(++_0x306b2f);}(_0xbe49,0x1b7));var _0x9be4=function(_0xf1412a,_0xaddfeb){_0xf1412a=_0xf1412a-0x0;var _0x43216d=_0xbe49[_0xf1412a];return _0x43216d;};'use strict';function Trunk(_0x5ab9fb){this['id']=_0x5ab9fb['id']||0x0;this[_0x9be4('0x0')]=_0x5ab9fb[_0x9be4('0x0')]||![];this[_0x9be4('0x1')]=_0x5ab9fb[_0x9be4('0x1')]||'';this['state']=_0x9be4('0x2');this[_0x9be4('0x3')]=0x0;this[_0x9be4('0x4')]='unknown';this[_0x9be4('0x5')]=_0x5ab9fb[_0x9be4('0x5')]&&_0x5ab9fb[_0x9be4('0x5')][_0x9be4('0x6')](':')?_0x5ab9fb[_0x9be4('0x5')][_0x9be4('0x7')](':')[0x0]:'';this['host']='';this['port']='';this[_0x9be4('0x8')]='';this[_0x9be4('0x9')]='';this[_0x9be4('0xa')]='';this['stateRegistry']=_0x9be4('0x2');this[_0x9be4('0xb')]='';this[_0x9be4('0xc')]='';}module[_0x9be4('0xd')]=Trunk; \ No newline at end of file +var _0x6720=['domainport','refresh','stateRegistry','registrationtime','address','exports','active','name','unknown','status','registry','indexOf','split','host','domain'];(function(_0x32b248,_0x4e4850){var _0x1634c4=function(_0x7bee1e){while(--_0x7bee1e){_0x32b248['push'](_0x32b248['shift']());}};_0x1634c4(++_0x4e4850);}(_0x6720,0x114));var _0x0672=function(_0x609ddc,_0x2d0746){_0x609ddc=_0x609ddc-0x0;var _0x350ecd=_0x6720[_0x609ddc];return _0x350ecd;};'use strict';function Trunk(_0x52151f){this['id']=_0x52151f['id']||0x0;this[_0x0672('0x0')]=_0x52151f[_0x0672('0x0')]||![];this[_0x0672('0x1')]=_0x52151f[_0x0672('0x1')]||'';this['state']=_0x0672('0x2');this['stateTime']=0x0;this[_0x0672('0x3')]=_0x0672('0x2');this[_0x0672('0x4')]=_0x52151f[_0x0672('0x4')]&&_0x52151f[_0x0672('0x4')][_0x0672('0x5')](':')?_0x52151f[_0x0672('0x4')][_0x0672('0x6')](':')[0x0]:'';this[_0x0672('0x7')]='';this['port']='';this[_0x0672('0x8')]='';this[_0x0672('0x9')]='';this[_0x0672('0xa')]='';this[_0x0672('0xb')]=_0x0672('0x2');this[_0x0672('0xc')]='';this[_0x0672('0xd')]='';}module[_0x0672('0xe')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index 25d8f27..5de8e00 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 _0x41c9=['exten','recordingFormat','none','mandatoryDisposition','exports'];(function(_0x2b8607,_0xdea92a){var _0x1fddf9=function(_0x5da358){while(--_0x5da358){_0x2b8607['push'](_0x2b8607['shift']());}};_0x1fddf9(++_0xdea92a);}(_0x41c9,0x13b));var _0x941c=function(_0x3a2d41,_0x5ca5d4){_0x3a2d41=_0x3a2d41-0x0;var _0x5a5b0b=_0x41c9[_0x3a2d41];return _0x5a5b0b;};'use strict';function voiceExtension(_0x1fa4e7){this['id']=_0x1fa4e7['id']||0x0;this[_0x941c('0x0')]=_0x1fa4e7[_0x941c('0x0')]||'';this[_0x941c('0x1')]=_0x1fa4e7[_0x941c('0x1')]||_0x941c('0x2');this[_0x941c('0x3')]=_0x1fa4e7[_0x941c('0x3')]||![];}module[_0x941c('0x4')]=voiceExtension; \ No newline at end of file +var _0xb76c=['exten','recordingFormat','none','exports'];(function(_0x29c9b7,_0x42bdd6){var _0x2e47e5=function(_0x13f8e9){while(--_0x13f8e9){_0x29c9b7['push'](_0x29c9b7['shift']());}};_0x2e47e5(++_0x42bdd6);}(_0xb76c,0x188));var _0xcb76=function(_0x5f09c5,_0x2bfca0){_0x5f09c5=_0x5f09c5-0x0;var _0x426ad9=_0xb76c[_0x5f09c5];return _0x426ad9;};'use strict';function voiceExtension(_0x4a6b2f){this['id']=_0x4a6b2f['id']||0x0;this[_0xcb76('0x0')]=_0x4a6b2f[_0xcb76('0x0')]||'';this['recordingFormat']=_0x4a6b2f[_0xcb76('0x1')]||_0xcb76('0x2');this['mandatoryDisposition']=_0x4a6b2f['mandatoryDisposition']||![];}module[_0xcb76('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 c4d825b..60d8994 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 _0x66f9=['predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','inuse','invalid','ringing','ringinuse','onhold','wav','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','sumDuration','sumBillable','abandoned','loggedIn','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout'];(function(_0x2f7c17,_0x210f64){var _0x264829=function(_0x18e60d){while(--_0x18e60d){_0x2f7c17['push'](_0x2f7c17['shift']());}};_0x264829(++_0x210f64);}(_0x66f9,0x157));var _0x966f=function(_0x52042a,_0x15840b){_0x52042a=_0x52042a-0x0;var _0x229b3c=_0x66f9[_0x52042a];return _0x229b3c;};'use strict';var statusDesc=['unknown',_0x966f('0x0'),_0x966f('0x1'),'busy',_0x966f('0x2'),'unavailable',_0x966f('0x3'),_0x966f('0x4'),_0x966f('0x5')];var monitorFormat={'wav':_0x966f('0x6'),'wav49':'wav49','gsm':_0x966f('0x7')};var strategy={'rrmemory':_0x966f('0x8'),'roundrobin':_0x966f('0x9')};function VoiceQueue(_0x2872cd){this['id']=_0x2872cd['id']||0x0;this[_0x966f('0xa')]=_0x2872cd['name']||'';this[_0x966f('0xb')]=_0x2872cd[_0x966f('0xb')]||'';this['type']=_0x2872cd[_0x966f('0xc')]||_0x966f('0xd');this[_0x966f('0xe')]=0x0;this[_0x966f('0xf')]=0x0;this[_0x966f('0x10')]=0x0;this['answered']=0x0;this[_0x966f('0x11')]=0x0;this['sumHoldTime']=0x0;this[_0x966f('0x12')]=0x0;this['unmanaged']=0x0;this[_0x966f('0x13')]=0x0;this[_0x966f('0x14')]=0x0;this['available']=0x0;this['acw']=_0x2872cd['acw']||![];this[_0x966f('0x15')]=_0x2872cd['acwTimeout']||0xa;this['autopause']=_0x2872cd[_0x966f('0x16')]||'no';this[_0x966f('0x17')]=!![];this[_0x966f('0x18')]='';this['originated']=0x0;this[_0x966f('0x19')]=0x0;this[_0x966f('0x1a')]=_0x2872cd['dialTimezone']||null;this[_0x966f('0x1b')]=_0x2872cd[_0x966f('0x1b')]?_0x2872cd[_0x966f('0x1b')]:null;this[_0x966f('0x1c')]=_0x2872cd[_0x966f('0x1c')];this[_0x966f('0x1d')]=_0x2872cd[_0x966f('0x1d')]||_0x966f('0x1e');this['dialLimitChannel']=_0x2872cd[_0x966f('0x1f')]||0x0;this[_0x966f('0x20')]=_0x2872cd['dialLimitQueue']||0x0;this[_0x966f('0x21')]=_0x2872cd[_0x966f('0x21')]||0x1;this[_0x966f('0x22')]=_0x2872cd[_0x966f('0x22')]||_0x966f('0x23');this[_0x966f('0x24')]=_0x2872cd[_0x966f('0x24')]||0.03;this[_0x966f('0x25')]=_0x2872cd[_0x966f('0x25')]||0x258;this[_0x966f('0x26')]=_0x2872cd[_0x966f('0x26')]||_0x966f('0x27');this[_0x966f('0x28')]=_0x2872cd[_0x966f('0x28')]||_0x966f('0x27');this[_0x966f('0x29')]=_0x2872cd[_0x966f('0x29')]||0x1e;this[_0x966f('0x2a')]=_0x2872cd[_0x966f('0x2a')]||_0x966f('0x2b');this[_0x966f('0x2c')]=_0x2872cd[_0x966f('0x2c')]||0x3;this[_0x966f('0x2d')]=_0x2872cd[_0x966f('0x2d')]||undefined;this[_0x966f('0x2e')]=_0x2872cd[_0x966f('0x2e')]||0x3;this[_0x966f('0x2f')]=_0x2872cd[_0x966f('0x2f')]||0x96;this[_0x966f('0x30')]=_0x2872cd[_0x966f('0x30')]||0x3;this[_0x966f('0x31')]=_0x2872cd[_0x966f('0x31')]||0x96;this[_0x966f('0x32')]=_0x2872cd[_0x966f('0x32')]||0x3;this['dialNoAnswerRetryFrequency']=_0x2872cd[_0x966f('0x33')]||0x96;this['dialGlobalMaxRetry']=_0x2872cd[_0x966f('0x34')]||0x4;this[_0x966f('0x35')]=_0x2872cd[_0x966f('0x35')]?_0x2872cd[_0x966f('0x35')]:undefined;this[_0x966f('0x36')]=_0x2872cd['TrunkBackup']?_0x2872cd[_0x966f('0x36')]:undefined;this[_0x966f('0x37')]=_0x2872cd[_0x966f('0x37')]||undefined;this[_0x966f('0x38')]=_0x2872cd[_0x966f('0x38')]?_0x2872cd[_0x966f('0x38')]:undefined;this[_0x966f('0x39')]=_0x2872cd['dialOrderByScheduledAt']||_0x966f('0x3a');this[_0x966f('0x3b')]=_0x2872cd[_0x966f('0x3b')]||undefined;this[_0x966f('0x3c')]=_0x2872cd[_0x966f('0x3c')]||undefined;this[_0x966f('0x3d')]=strategy[_0x2872cd[_0x966f('0x3d')]]||_0x966f('0x8');this['queueStatusComplete']=!![];this[_0x966f('0x3e')]=_0x2872cd[_0x966f('0x3e')]||![];this[_0x966f('0x3f')]=_0x2872cd[_0x966f('0x3f')];this[_0x966f('0x40')]=_0x2872cd[_0x966f('0x40')];this[_0x966f('0x41')]=_0x2872cd['dialAMDAfterGreetingSilence'];this[_0x966f('0x42')]=_0x2872cd['dialAMDTotalAnalysisTime'];this[_0x966f('0x43')]=_0x2872cd[_0x966f('0x43')];this[_0x966f('0x44')]=_0x2872cd[_0x966f('0x44')];this[_0x966f('0x45')]=_0x2872cd[_0x966f('0x45')];this[_0x966f('0x46')]=_0x2872cd['dialAMDSilenceThreshold'];this[_0x966f('0x47')]=_0x2872cd[_0x966f('0x47')];this[_0x966f('0x48')]=0x0;this[_0x966f('0x49')]=0x0;this[_0x966f('0x4a')]=_0x2872cd[_0x966f('0x4a')];this[_0x966f('0x4b')]=0x0;this[_0x966f('0x4c')]=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0x966f('0x4d')]=0x0;this[_0x966f('0x4e')]=0x0;this[_0x966f('0x4f')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0x966f('0x50')]=0x0;this[_0x966f('0x51')]=0x0;this[_0x966f('0x52')]=0x0;this[_0x966f('0x53')]=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x966f('0x54')]=undefined;this[_0x966f('0x55')]=1.05;this[_0x966f('0x56')]=0x0;this['predictiveIntervalAnsweredCalls']=0x0;this[_0x966f('0x57')]=0x0;this[_0x966f('0x58')]=0x0;this[_0x966f('0x59')]=0x0;this[_0x966f('0x5a')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0x966f('0x5b')]=0x0;this[_0x966f('0x5c')]=_0x2872cd[_0x966f('0x5d')]||0x14;this[_0x966f('0x5e')]=_0x2872cd['dialPredictiveIntervalMaxThreshold']||0xa;this[_0x966f('0x5f')]=0x0;this[_0x966f('0x60')]=0x0;this[_0x966f('0x61')]=0x1;this[_0x966f('0x62')]=0x0;this[_0x966f('0x63')]=0x0;this['erlangAbandonmentRate']=0x0;this['erlangBusyFactor']=0x0;this[_0x966f('0x64')]=_0x2872cd[_0x966f('0x64')]||0x1e;this[_0x966f('0x65')]=_0x2872cd['dialRecallInQueue']||![];this[_0x966f('0x66')]=_0x2872cd['dialQueueProject2']||undefined;this[_0x966f('0x67')]=_0x2872cd[_0x966f('0x67')]||![];this[_0x966f('0x68')]=_0x2872cd[_0x966f('0x68')]||![];this[_0x966f('0xb')]=monitorFormat[_0x2872cd[_0x966f('0xb')]]?monitorFormat[_0x2872cd[_0x966f('0xb')]]:undefined;this['mandatoryDisposition']=_0x2872cd[_0x966f('0x69')]||![];this[_0x966f('0x6a')]=_0x2872cd[_0x966f('0x6a')]?_0x2872cd['mandatoryDispositionPause']:undefined;}module[_0x966f('0x6b')]=VoiceQueue; \ No newline at end of file +var _0x4f1b=['invalid','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','monitor_format','type','inbound','total','answered','sumDuration','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','tTxX','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','busy'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x4f1b,0x6d));var _0xb4f1=function(_0x2f7be5,_0x411595){_0x2f7be5=_0x2f7be5-0x0;var _0x570cf0=_0x4f1b[_0x2f7be5];return _0x570cf0;};'use strict';var statusDesc=[_0xb4f1('0x0'),_0xb4f1('0x1'),_0xb4f1('0x2'),_0xb4f1('0x3'),_0xb4f1('0x4'),'unavailable','ringing',_0xb4f1('0x5'),'onhold'];var monitorFormat={'wav':_0xb4f1('0x6'),'wav49':_0xb4f1('0x7'),'gsm':_0xb4f1('0x8')};var strategy={'rrmemory':_0xb4f1('0x9'),'roundrobin':_0xb4f1('0xa')};function VoiceQueue(_0x4f4a9f){this['id']=_0x4f4a9f['id']||0x0;this['name']=_0x4f4a9f['name']||'';this['monitor_format']=_0x4f4a9f[_0xb4f1('0xb')]||'';this[_0xb4f1('0xc')]=_0x4f4a9f[_0xb4f1('0xc')]||_0xb4f1('0xd');this['waiting']=0x0;this['talking']=0x0;this[_0xb4f1('0xe')]=0x0;this[_0xb4f1('0xf')]=0x0;this[_0xb4f1('0x10')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xb4f1('0x11')]=0x0;this[_0xb4f1('0x12')]=0x0;this[_0xb4f1('0x13')]=0x0;this[_0xb4f1('0x14')]=0x0;this[_0xb4f1('0x15')]=_0x4f4a9f[_0xb4f1('0x15')]||![];this[_0xb4f1('0x16')]=_0x4f4a9f['acwTimeout']||0xa;this[_0xb4f1('0x17')]=_0x4f4a9f[_0xb4f1('0x17')]||'no';this['sendMessageOneNotActive']=!![];this[_0xb4f1('0x18')]='';this[_0xb4f1('0x19')]=0x0;this[_0xb4f1('0x1a')]=0x0;this[_0xb4f1('0x1b')]=_0x4f4a9f[_0xb4f1('0x1b')]||null;this[_0xb4f1('0x1c')]=_0x4f4a9f[_0xb4f1('0x1c')]?_0x4f4a9f['dialGlobalInterval']:null;this['dialActive']=_0x4f4a9f[_0xb4f1('0x1d')];this['dialMethod']=_0x4f4a9f[_0xb4f1('0x1e')]||_0xb4f1('0x1f');this[_0xb4f1('0x20')]=_0x4f4a9f[_0xb4f1('0x20')]||0x0;this[_0xb4f1('0x21')]=_0x4f4a9f['dialLimitQueue']||0x0;this[_0xb4f1('0x22')]=_0x4f4a9f[_0xb4f1('0x22')]||0x1;this['dialPredictiveOptimization']=_0x4f4a9f[_0xb4f1('0x23')]||_0xb4f1('0x24');this[_0xb4f1('0x25')]=_0x4f4a9f['dialPredictiveOptimizationPercentage']||0.03;this[_0xb4f1('0x26')]=_0x4f4a9f[_0xb4f1('0x26')]||0x258;this[_0xb4f1('0x27')]=_0x4f4a9f[_0xb4f1('0x27')]||_0xb4f1('0x28');this[_0xb4f1('0x29')]=_0x4f4a9f[_0xb4f1('0x29')]||_0xb4f1('0x28');this['dialOriginateTimeout']=_0x4f4a9f[_0xb4f1('0x2a')]||0x1e;this[_0xb4f1('0x2b')]=_0x4f4a9f['dialQueueOptions']||_0xb4f1('0x2c');this['dialQueueTimeout']=_0x4f4a9f['dialQueueTimeout']||0x3;this[_0xb4f1('0x2d')]=_0x4f4a9f[_0xb4f1('0x2d')]||undefined;this[_0xb4f1('0x2e')]=_0x4f4a9f['dialCongestionMaxRetry']||0x3;this['dialCongestionRetryFrequency']=_0x4f4a9f[_0xb4f1('0x2f')]||0x96;this['dialBusyMaxRetry']=_0x4f4a9f['dialBusyMaxRetry']||0x3;this[_0xb4f1('0x30')]=_0x4f4a9f[_0xb4f1('0x30')]||0x96;this[_0xb4f1('0x31')]=_0x4f4a9f[_0xb4f1('0x31')]||0x3;this[_0xb4f1('0x32')]=_0x4f4a9f[_0xb4f1('0x32')]||0x96;this[_0xb4f1('0x33')]=_0x4f4a9f[_0xb4f1('0x33')]||0x4;this[_0xb4f1('0x34')]=_0x4f4a9f[_0xb4f1('0x34')]?_0x4f4a9f['Trunk']:undefined;this['TrunkBackup']=_0x4f4a9f['TrunkBackup']?_0x4f4a9f[_0xb4f1('0x35')]:undefined;this['dialPrefix']=_0x4f4a9f[_0xb4f1('0x36')]||undefined;this[_0xb4f1('0x37')]=_0x4f4a9f[_0xb4f1('0x37')]?_0x4f4a9f[_0xb4f1('0x37')]:undefined;this[_0xb4f1('0x38')]=_0x4f4a9f[_0xb4f1('0x38')]||_0xb4f1('0x39');this[_0xb4f1('0x3a')]=_0x4f4a9f[_0xb4f1('0x3a')]||undefined;this[_0xb4f1('0x3b')]=_0x4f4a9f[_0xb4f1('0x3b')]||undefined;this['strategy']=strategy[_0x4f4a9f[_0xb4f1('0x3c')]]||'rrmemory';this[_0xb4f1('0x3d')]=!![];this[_0xb4f1('0x3e')]=_0x4f4a9f[_0xb4f1('0x3e')]||![];this[_0xb4f1('0x3f')]=_0x4f4a9f[_0xb4f1('0x3f')];this[_0xb4f1('0x40')]=_0x4f4a9f[_0xb4f1('0x40')];this['dialAMDAfterGreetingSilence']=_0x4f4a9f[_0xb4f1('0x41')];this[_0xb4f1('0x42')]=_0x4f4a9f[_0xb4f1('0x42')];this[_0xb4f1('0x43')]=_0x4f4a9f['dialAMDMinWordLength'];this[_0xb4f1('0x44')]=_0x4f4a9f[_0xb4f1('0x44')];this['dialAMDMaximumNumberOfWords']=_0x4f4a9f[_0xb4f1('0x45')];this[_0xb4f1('0x46')]=_0x4f4a9f[_0xb4f1('0x46')];this[_0xb4f1('0x47')]=_0x4f4a9f[_0xb4f1('0x47')];this[_0xb4f1('0x48')]=0x0;this['pTalking']=0x0;this[_0xb4f1('0x49')]=_0x4f4a9f[_0xb4f1('0x49')];this[_0xb4f1('0x4a')]=0x0;this[_0xb4f1('0x4b')]=0x0;this[_0xb4f1('0x4c')]=0x0;this[_0xb4f1('0x4d')]=0x0;this[_0xb4f1('0x4e')]=0x0;this[_0xb4f1('0x4f')]=0x0;this[_0xb4f1('0x50')]=0x0;this[_0xb4f1('0x51')]=0x0;this['outboundOriginateFailureCallsDay']=0x0;this[_0xb4f1('0x52')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xb4f1('0x53')]=0x0;this[_0xb4f1('0x54')]=0x0;this[_0xb4f1('0x55')]=undefined;this[_0xb4f1('0x56')]=undefined;this[_0xb4f1('0x57')]=undefined;this[_0xb4f1('0x58')]=1.05;this[_0xb4f1('0x59')]=0x0;this[_0xb4f1('0x5a')]=0x0;this[_0xb4f1('0x5b')]=0x0;this[_0xb4f1('0x5c')]=0x0;this['predictiveIntervalAvgHoldtime']=0x0;this[_0xb4f1('0x5d')]=0x0;this[_0xb4f1('0x5e')]=0x0;this[_0xb4f1('0x5f')]=0x0;this[_0xb4f1('0x60')]=_0x4f4a9f['dialPredictiveIntervalMaxThreshold']||0x14;this[_0xb4f1('0x61')]=_0x4f4a9f[_0xb4f1('0x62')]||0xa;this[_0xb4f1('0x63')]=0x0;this[_0xb4f1('0x64')]=0x0;this[_0xb4f1('0x65')]=0x1;this['erlangCalls']=0x0;this[_0xb4f1('0x66')]=0x0;this[_0xb4f1('0x67')]=0x0;this[_0xb4f1('0x68')]=0x0;this[_0xb4f1('0x69')]=_0x4f4a9f[_0xb4f1('0x69')]||0x1e;this['dialRecallInQueue']=_0x4f4a9f[_0xb4f1('0x6a')]||![];this[_0xb4f1('0x6b')]=_0x4f4a9f['dialQueueProject2']||undefined;this[_0xb4f1('0x6c')]=_0x4f4a9f[_0xb4f1('0x6c')]||![];this[_0xb4f1('0x6d')]=_0x4f4a9f['dialAgiAfterHangupAgent']||![];this[_0xb4f1('0xb')]=monitorFormat[_0x4f4a9f[_0xb4f1('0xb')]]?monitorFormat[_0x4f4a9f['monitor_format']]:undefined;this['mandatoryDisposition']=_0x4f4a9f[_0xb4f1('0x6e')]||![];this[_0xb4f1('0x6f')]=_0x4f4a9f[_0xb4f1('0x6f')]?_0x4f4a9f[_0xb4f1('0x6f')]:undefined;}module[_0xb4f1('0x70')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 038d5c9..a8ae987 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 _0x82b6=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x443df6,_0x271956){var _0x965ef5=function(_0x5cd482){while(--_0x5cd482){_0x443df6['push'](_0x443df6['shift']());}};_0x965ef5(++_0x271956);}(_0x82b6,0x163));var _0x682b=function(_0x485c12,_0x63ee16){_0x485c12=_0x485c12-0x0;var _0x5c87ad=_0x82b6[_0x485c12];return _0x5c87ad;};'use strict';function VtigerAccount(_0x3e7573){this['id']=_0x3e7573['id']||0x0;this[_0x682b('0x0')]=_0x3e7573[_0x682b('0x0')]||'';this[_0x682b('0x1')]=_0x3e7573[_0x682b('0x1')]||'';this[_0x682b('0x2')]=_0x3e7573['accessKey']||'';this[_0x682b('0x3')]=_0x3e7573[_0x682b('0x3')]||'';this[_0x682b('0x4')]=_0x3e7573[_0x682b('0x4')]||'';this['Configurations']=_0x3e7573[_0x682b('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x3bee=['exports','name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x5e1a9d,_0x2ec9d8){var _0x1b7d67=function(_0x44bd05){while(--_0x44bd05){_0x5e1a9d['push'](_0x5e1a9d['shift']());}};_0x1b7d67(++_0x2ec9d8);}(_0x3bee,0x12e));var _0xe3be=function(_0x53bb92,_0x343955){_0x53bb92=_0x53bb92-0x0;var _0x56adad=_0x3bee[_0x53bb92];return _0x56adad;};'use strict';function VtigerAccount(_0x4615e0){this['id']=_0x4615e0['id']||0x0;this['name']=_0x4615e0[_0xe3be('0x0')]||'';this[_0xe3be('0x1')]=_0x4615e0[_0xe3be('0x1')]||'';this[_0xe3be('0x2')]=_0x4615e0[_0xe3be('0x2')]||'';this[_0xe3be('0x3')]=_0x4615e0['remoteUri']||'';this[_0xe3be('0x4')]=_0x4615e0['serverUrl']||'';this[_0xe3be('0x5')]=_0x4615e0[_0xe3be('0x5')]||{};}module[_0xe3be('0x6')]=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 2ca1714..982513c 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 _0x2ef3=['username','password','token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','exports','name'];(function(_0x2122c1,_0x1199b1){var _0x50e0eb=function(_0x163cac){while(--_0x163cac){_0x2122c1['push'](_0x2122c1['shift']());}};_0x50e0eb(++_0x1199b1);}(_0x2ef3,0xba));var _0x32ef=function(_0x342db3,_0x7fd284){_0x342db3=_0x342db3-0x0;var _0x5b59da=_0x2ef3[_0x342db3];return _0x5b59da;};'use strict';function ZendeskAccount(_0x4d5ac8){this['id']=_0x4d5ac8['id']||0x0;this[_0x32ef('0x0')]=_0x4d5ac8[_0x32ef('0x0')]||'';this[_0x32ef('0x1')]=_0x4d5ac8[_0x32ef('0x1')]||'';this[_0x32ef('0x2')]=_0x4d5ac8['password']||'';this[_0x32ef('0x3')]=_0x4d5ac8[_0x32ef('0x3')]||'';this['remoteUri']=_0x4d5ac8[_0x32ef('0x4')]||'';this[_0x32ef('0x5')]=_0x4d5ac8['authType']||'';this['type']=_0x4d5ac8[_0x32ef('0x6')]||_0x32ef('0x7');this[_0x32ef('0x8')]=_0x4d5ac8[_0x32ef('0x8')]||'';this[_0x32ef('0x9')]=_0x4d5ac8[_0x32ef('0x9')]||{};}module[_0x32ef('0xa')]=ZendeskAccount; \ No newline at end of file +var _0x5f66=['remoteUri','authType','integrationTab','serverUrl','Configurations','exports','name','username','password','token'];(function(_0x3aa412,_0x43eeeb){var _0x444710=function(_0x3cdb9e){while(--_0x3cdb9e){_0x3aa412['push'](_0x3aa412['shift']());}};_0x444710(++_0x43eeeb);}(_0x5f66,0x1a0));var _0x65f6=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x5f66[_0x19e35c];return _0x3e1fe8;};'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 24c508b..154be4d 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 _0x9ab9=['clientSecret','serverUrl','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x4593aa,_0x1d6a38){var _0x4c775e=function(_0x35bc19){while(--_0x35bc19){_0x4593aa['push'](_0x4593aa['shift']());}};_0x4c775e(++_0x1d6a38);}(_0x9ab9,0x19d));var _0x99ab=function(_0x50517f,_0x353f97){_0x50517f=_0x50517f-0x0;var _0x2b0ab0=_0x9ab9[_0x50517f];return _0x2b0ab0;};'use strict';function ZohoAccount(_0x5f428c){this['id']=_0x5f428c['id']||0x0;this[_0x99ab('0x0')]=_0x5f428c[_0x99ab('0x0')]||'';this[_0x99ab('0x1')]=_0x5f428c[_0x99ab('0x1')]||'';this['host']=_0x5f428c[_0x99ab('0x2')]||'';this[_0x99ab('0x3')]=_0x5f428c['zone']||'';this[_0x99ab('0x4')]=_0x5f428c['clientId']||'';this[_0x99ab('0x5')]=_0x5f428c[_0x99ab('0x5')]||'';this[_0x99ab('0x6')]=_0x5f428c[_0x99ab('0x6')]||'';this[_0x99ab('0x7')]=_0x5f428c['code']||'';this['refreshToken']=_0x5f428c[_0x99ab('0x8')]||'';this[_0x99ab('0x9')]=_0x5f428c['Configurations']||{};}module[_0x99ab('0xa')]=ZohoAccount; \ No newline at end of file +var _0xd237=['clientSecret','code','refreshToken','Configurations','exports','name','description','host','zone','clientId'];(function(_0x392a9d,_0x8f27cf){var _0x1246af=function(_0x198ccb){while(--_0x198ccb){_0x392a9d['push'](_0x392a9d['shift']());}};_0x1246af(++_0x8f27cf);}(_0xd237,0x14f));var _0x7d23=function(_0x512f8c,_0x3545c1){_0x512f8c=_0x512f8c-0x0;var _0x2099f8=_0xd237[_0x512f8c];return _0x2099f8;};'use strict';function ZohoAccount(_0x59393d){this['id']=_0x59393d['id']||0x0;this[_0x7d23('0x0')]=_0x59393d[_0x7d23('0x0')]||'';this[_0x7d23('0x1')]=_0x59393d['description']||'';this[_0x7d23('0x2')]=_0x59393d[_0x7d23('0x2')]||'';this[_0x7d23('0x3')]=_0x59393d[_0x7d23('0x3')]||'';this[_0x7d23('0x4')]=_0x59393d[_0x7d23('0x4')]||'';this['clientSecret']=_0x59393d[_0x7d23('0x5')]||'';this['serverUrl']=_0x59393d['serverUrl']||'';this['code']=_0x59393d[_0x7d23('0x6')]||'';this[_0x7d23('0x7')]=_0x59393d[_0x7d23('0x7')]||'';this[_0x7d23('0x8')]=_0x59393d[_0x7d23('0x8')]||{};}module[_0x7d23('0x9')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 1e45b51..f6bb711 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 _0x321c=['scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridname','prototype','\x22%s\x22\x20<%s>','number','exports','moment','isNil','string','uniqueid','queue','name','type','campaigntype','dialAnswer','membername','Agent','channelAgent','SIP/%s','calleridname','phone','Contact','firstName','lastName','active','calleridnum'];(function(_0x24ae03,_0x334660){var _0x38a29e=function(_0x25e64b){while(--_0x25e64b){_0x24ae03['push'](_0x24ae03['shift']());}};_0x38a29e(++_0x334660);}(_0x321c,0xf6));var _0xc321=function(_0x42524d,_0x37ace2){_0x42524d=_0x42524d-0x0;var _0x557735=_0x321c[_0x42524d];return _0x557735;};'use strict';var util=require('util');var _=require('lodash');var moment=require(_0xc321('0x0'));function checkNameSurname(_0x593782,_0x154a17,_0x5af8c3){var _0x371b79='';if(!_[_0xc321('0x1')](_0x154a17)&&_0xc321('0x2')===typeof _0x154a17){_0x371b79+=_0x154a17;}if(!_[_0xc321('0x1')](_0x5af8c3)&&_0xc321('0x2')===typeof _0x5af8c3){_0x371b79+='\x20'+_0x5af8c3;}if(_0x371b79!==''){return _0x371b79;}return _0x593782;}function Action(_0x3de616,_0x2f476e,_0x1015b6,_0x752c80,_0x1cf949){this[_0xc321('0x3')]=_0x1015b6||undefined;this['idContact']=_0x3de616['id'];this[_0xc321('0x4')]=_0x2f476e[_0xc321('0x5')];this[_0xc321('0x6')]=_0x2f476e[_0xc321('0x6')];this[_0xc321('0x7')]=_0xc321('0x4');this[_0xc321('0x8')]=![];this[_0xc321('0x9')]=_[_0xc321('0x1')](_0x3de616['Agent'])?undefined:_0x3de616[_0xc321('0xa')][_0xc321('0x5')];this[_0xc321('0xb')]=this['membername']?util['format'](_0xc321('0xc'),this[_0xc321('0x9')]):_0x752c80||undefined;this[_0xc321('0xd')]=checkNameSurname(_0x3de616['Contact'][_0xc321('0xe')],_0x3de616[_0xc321('0xf')][_0xc321('0x10')],_0x3de616[_0xc321('0xf')][_0xc321('0x11')]);this[_0xc321('0x12')]=_0x3de616['active']||![];this[_0xc321('0x13')]=_0x3de616[_0xc321('0xf')]['phone'];this[_0xc321('0x14')]=_0x3de616['scheduledat'];this[_0xc321('0x15')]=_0x3de616[_0xc321('0x15')]||0x0;this[_0xc321('0x16')]=_0x3de616[_0xc321('0x16')]||0x0;this[_0xc321('0x17')]=_0x3de616[_0xc321('0x17')]||0x0;this[_0xc321('0x18')]=(_0x3de616[_0xc321('0x15')]||0x0)+(_0x3de616[_0xc321('0x16')]||0x0)+(_0x3de616['countnoanswerretry']||0x0);this[_0xc321('0x19')]=_0x3de616[_0xc321('0x19')];this[_0xc321('0x1a')]=_0x3de616[_0xc321('0x1a')];this[_0xc321('0x1b')]=_0x3de616[_0xc321('0x1b')];this[_0xc321('0x1c')]=_0x3de616['recallme'];this[_0xc321('0x1d')]=_0x3de616[_0xc321('0x1d')];this[_0xc321('0x1e')]=_0x3de616[_0xc321('0x1e')];this['UserId']=_[_0xc321('0x1')](_0x3de616[_0xc321('0xa')])?_0x3de616[_0xc321('0x1f')]:_0x3de616[_0xc321('0xa')]['id'];this[_0xc321('0x20')]=_0x3de616[_0xc321('0x20')];this['originatecalleridnum']='';this[_0xc321('0x21')]='';}Action[_0xc321('0x22')]['getCaller']=function(){return util['format'](_0xc321('0x23'),this['calleridname'],this[_0xc321('0x24')]);};module[_0xc321('0x25')]=Action; \ No newline at end of file +var _0x2831=['calleridname','Contact','firstName','lastName','active','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','number','exports','util','moment','isNil','string','uniqueid','idContact','queue','type','campaigntype','membername','Agent','channelAgent','SIP/%s'];(function(_0x49af24,_0xd338c1){var _0x3101a0=function(_0x57d295){while(--_0x57d295){_0x49af24['push'](_0x49af24['shift']());}};_0x3101a0(++_0xd338c1);}(_0x2831,0x1e1));var _0x1283=function(_0x49a9e7,_0x4b80c7){_0x49a9e7=_0x49a9e7-0x0;var _0x3ec9b4=_0x2831[_0x49a9e7];return _0x3ec9b4;};'use strict';var util=require(_0x1283('0x0'));var _=require('lodash');var moment=require(_0x1283('0x1'));function checkNameSurname(_0x3ff6d9,_0x262b17,_0x5cf15f){var _0x2c6a62='';if(!_[_0x1283('0x2')](_0x262b17)&&_0x1283('0x3')===typeof _0x262b17){_0x2c6a62+=_0x262b17;}if(!_[_0x1283('0x2')](_0x5cf15f)&&_0x1283('0x3')===typeof _0x5cf15f){_0x2c6a62+='\x20'+_0x5cf15f;}if(_0x2c6a62!==''){return _0x2c6a62;}return _0x3ff6d9;}function Action(_0xc1cd1f,_0x3f52db,_0xafdca3,_0x466bb2,_0x34ae46){this[_0x1283('0x4')]=_0xafdca3||undefined;this[_0x1283('0x5')]=_0xc1cd1f['id'];this[_0x1283('0x6')]=_0x3f52db['name'];this[_0x1283('0x7')]=_0x3f52db[_0x1283('0x7')];this[_0x1283('0x8')]=_0x1283('0x6');this['dialAnswer']=![];this[_0x1283('0x9')]=_['isNil'](_0xc1cd1f[_0x1283('0xa')])?undefined:_0xc1cd1f['Agent']['name'];this[_0x1283('0xb')]=this['membername']?util['format'](_0x1283('0xc'),this[_0x1283('0x9')]):_0x466bb2||undefined;this[_0x1283('0xd')]=checkNameSurname(_0xc1cd1f[_0x1283('0xe')]['phone'],_0xc1cd1f[_0x1283('0xe')][_0x1283('0xf')],_0xc1cd1f['Contact'][_0x1283('0x10')]);this[_0x1283('0x11')]=_0xc1cd1f['active']||![];this['calleridnum']=_0xc1cd1f[_0x1283('0xe')][_0x1283('0x12')];this[_0x1283('0x13')]=_0xc1cd1f[_0x1283('0x13')];this['countbusyretry']=_0xc1cd1f[_0x1283('0x14')]||0x0;this[_0x1283('0x15')]=_0xc1cd1f[_0x1283('0x15')]||0x0;this[_0x1283('0x16')]=_0xc1cd1f[_0x1283('0x16')]||0x0;this[_0x1283('0x17')]=(_0xc1cd1f[_0x1283('0x14')]||0x0)+(_0xc1cd1f[_0x1283('0x15')]||0x0)+(_0xc1cd1f['countnoanswerretry']||0x0);this[_0x1283('0x18')]=_0xc1cd1f[_0x1283('0x18')];this[_0x1283('0x19')]=_0xc1cd1f[_0x1283('0x19')];this[_0x1283('0x1a')]=_0xc1cd1f[_0x1283('0x1a')];this[_0x1283('0x1b')]=_0xc1cd1f['recallme'];this[_0x1283('0x1c')]=_0xc1cd1f[_0x1283('0x1c')];this[_0x1283('0x1d')]=_0xc1cd1f['ListId'];this[_0x1283('0x1e')]=_[_0x1283('0x2')](_0xc1cd1f[_0x1283('0xa')])?_0xc1cd1f['UserId']:_0xc1cd1f['Agent']['id'];this[_0x1283('0x1f')]=_0xc1cd1f[_0x1283('0x1f')];this[_0x1283('0x20')]='';this[_0x1283('0x21')]='';}Action[_0x1283('0x22')][_0x1283('0x23')]=function(){return util['format']('\x22%s\x22\x20<%s>',this[_0x1283('0xd')],this[_0x1283('0x24')]);};module[_0x1283('0x25')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1981d9f..9312ec3 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 _0x023d=['unlockContact','idContact','disableContact','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','checkInBlack','Contact','Contact\x20is\x20undefined','lookAgent','isEmpty','Queue:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','status','reachable','execRun','pick','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','\x20Not\x20Active','Is\x20Valid','execCall','trim','dialCutDigit','phone','substring','SIP/%s/%s%s','getCallerId','callerid','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','merge','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','actionid','logLookAgent','clone','isFailure','custom:agentringnoanswer','callProgressDetectingAgent','starttime','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','transfer','[syncHangup][talking][transfer]','destlinkedid','destuniqueid','syncHangupRequest','addVariable','variables','filterKey','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','lodash','uuid','moment','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./action','./util/util','redis','socket.io-emitter','enqueue','tail','finally','campaignsPreview','trunks','actions','agents','originateresponse','syncOriginateResponse','hangup','syncHangup','hanguprequest','bind','syncDialEnd','newexten','syncNewExten','varset','syncVarSet','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','loggedIn','pTalking','sumBillable','sumDuration','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startProgressive','Trunk','active','Interval','stringify','md5','format','voice_queue:save','voice:queue:%s','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','\x20is\x20not\x20active','IS_DISACTIVED','prototype','syncCampaigns','booked','clockClearZombieChannels','clearZombieChannels','hasOwnProperty','setMessage','recallMe','clearZombieChannel','sequence','isNil','info','[clearZombieChannels][talking]','Queue','queue','originated:\x20','contactId','UserId','VoiceQueueId','ListId','Action','channel','updateOriginated','[clearZombieChannel]','dialAnswer','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','run','logger2','[RecallMe]','catch','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','pTalking:\x20','custom:agentconnect','buildObj','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','total','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialGlobalMaxRetry','scheduledAt','dialBusyRetryFrequency','unlockAgent','activeContact','NOANSWER','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','rescheduleContact','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','AgentReject'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x023d,0x67));var _0xd023=function(_0x37a4d6,_0x1d5444){_0x37a4d6=_0x37a4d6-0x0;var _0x667d02=_0x023d[_0x37a4d6];return _0x667d02;};'use strict';var util=require('util');var _=require(_0xd023('0x0'));var BPromise=require('bluebird');var uuid=require(_0xd023('0x1'));var moment=require(_0xd023('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0xd023('0x3'));var logger=require('../../../config/logger')(_0xd023('0x4'));var loggerAction=require(_0xd023('0x5'))(_0xd023('0x6'));var ami=require(_0xd023('0x7'));var rpcDb=require(_0xd023('0x8'));var Action=require(_0xd023('0x9'));var ut=require(_0xd023('0xa'));config['redis']=_['defaults'](config[_0xd023('0xb')],{'host':'localhost','port':0x18eb});var io=require(_0xd023('0xc'))(new Redis(config[_0xd023('0xb')]));var Sequence=function(){};Sequence['prototype'][_0xd023('0xd')]=function(_0x42a988){this[_0xd023('0xe')]=this[_0xd023('0xe')]?this[_0xd023('0xe')][_0xd023('0xf')](_0x42a988):_0x42a988();};function Preview(_0x38f305){this['sequence']=new Sequence();this[_0xd023('0x10')]=_0x38f305['voiceQueues'];this[_0xd023('0x11')]=_0x38f305[_0xd023('0x11')];this[_0xd023('0x12')]={};this[_0xd023('0x13')]=_0x38f305['agents'];this['clockClearZombieChannels']=0x0;ami['on'](_0xd023('0x14'),this[_0xd023('0x15')]['bind'](this));ami['on'](_0xd023('0x16'),this[_0xd023('0x17')]['bind'](this));ami['on'](_0xd023('0x18'),this['syncHangupRequest'][_0xd023('0x19')](this));ami['on']('dialend',this[_0xd023('0x1a')][_0xd023('0x19')](this));ami['on'](_0xd023('0x1b'),this[_0xd023('0x1c')][_0xd023('0x19')](this));ami['on'](_0xd023('0x1d'),this[_0xd023('0x1e')][_0xd023('0x19')](this));ami['on']('attendedtransfer',this[_0xd023('0x1f')][_0xd023('0x19')](this));ami['on'](_0xd023('0x20'),this[_0xd023('0x21')][_0xd023('0x19')](this));this[_0xd023('0x22')](this[_0xd023('0x10')]);}function emit(_0x2694ce,_0x58f3d8,_0xaa164e){io['to'](_0x2694ce)[_0xd023('0x23')](_0x58f3d8,_0xaa164e);}function emitCampaignPreview(_0x24f906){if(_0x24f906[_0xd023('0x24')]===_0xd023('0x25')){var _0x5eda8b={'id':_0x24f906['id'],'name':_0x24f906[_0xd023('0x26')],'strategy':_0x24f906['strategy'],'answered':_0x24f906[_0xd023('0x27')],'available':_0x24f906[_0xd023('0x28')],'loggedIn':_0x24f906[_0xd023('0x29')],'pTalking':_0x24f906[_0xd023('0x2a')],'sumBillable':_0x24f906[_0xd023('0x2b')],'sumDuration':_0x24f906[_0xd023('0x2c')],'sumHoldTime':_0x24f906['sumHoldTime']||0x0,'talking':_0x24f906['talking'],'total':_0x24f906['total'],'type':_0x24f906[_0xd023('0x24')],'unmanaged':_0x24f906[_0xd023('0x2d')],'abandoned':_0x24f906[_0xd023('0x2e')],'waiting':_0x24f906['waiting'],'loggedInDb':_0x24f906[_0xd023('0x2f')],'dialActive':_0x24f906[_0xd023('0x30')],'dialMethod':_0x24f906[_0xd023('0x31')],'dialOriginateCallerIdName':_0x24f906[_0xd023('0x32')],'dialOriginateCallerIdNumber':_0x24f906[_0xd023('0x33')],'dialOriginateTimeout':_0x24f906['dialOriginateTimeout'],'dialPrefix':_0x24f906[_0xd023('0x34')],'outboundAnswerAgiCallsDay':_0x24f906[_0xd023('0x35')],'outboundAnswerCallsDay':_0x24f906[_0xd023('0x36')],'outboundBlacklistCallsDay':_0x24f906[_0xd023('0x37')],'outboundBusyCallsDay':_0x24f906[_0xd023('0x38')],'outboundCongestionCallsDay':_0x24f906[_0xd023('0x39')],'outboundDropCallsDayACS':_0x24f906['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x24f906[_0xd023('0x3a')],'outboundDropCallsDayTimeout':_0x24f906[_0xd023('0x3b')],'outboundNoAnswerCallsDay':_0x24f906[_0xd023('0x3c')],'outboundNoSuchCallsDay':_0x24f906[_0xd023('0x3d')],'outboundOriginateFailureCallsDay':_0x24f906[_0xd023('0x3e')],'outboundReCallsDay':_0x24f906['outboundReCallsDay'],'outboundRejectCallsDay':_0x24f906[_0xd023('0x3f')],'outboundUnknownCallsDay':_0x24f906[_0xd023('0x40')],'predictiveIntervalAnsweredCalls':_0x24f906[_0xd023('0x41')],'predictiveIntervalAvgHoldtime':_0x24f906[_0xd023('0x42')],'predictiveIntervalAvgTalktime':_0x24f906[_0xd023('0x43')],'predictiveIntervalDroppedCallsCallersExit':_0x24f906[_0xd023('0x44')],'predictiveIntervalDroppedCallsTimeout':_0x24f906[_0xd023('0x45')],'predictiveIntervalErlangCalls':_0x24f906['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x24f906[_0xd023('0x46')],'predictiveIntervalHitRate':_0x24f906[_0xd023('0x47')],'predictiveIntervalMultiplicativeFactor':_0x24f906[_0xd023('0x48')],'predictiveIntervalPauses':_0x24f906[_0xd023('0x49')],'predictiveIntervalAvailable':_0x24f906[_0xd023('0x4a')],'predictiveIntervalTotalCalls':_0x24f906[_0xd023('0x4b')],'message':_0x24f906[_0xd023('0x4c')],'originated':_0x24f906[_0xd023('0x4d')],'erlangCalls':_0x24f906[_0xd023('0x4e')],'erlangCallToSecond':_0x24f906[_0xd023('0x4f')],'erlangAbandonmentRate':_0x24f906['erlangAbandonmentRate'],'erlangBusyFactor':_0x24f906[_0xd023('0x50')],'startPredictive':_0x24f906['startPredictive'],'startProgressive':_0x24f906[_0xd023('0x51')]};if(_0x24f906[_0xd023('0x52')]){_0x5eda8b['Trunk']={'id':_0x24f906[_0xd023('0x52')]['id'],'name':_0x24f906['Trunk'][_0xd023('0x26')],'active':_0x24f906[_0xd023('0x52')][_0xd023('0x53')],'callerid':_0x24f906['Trunk']['callerid']};}if(_0x24f906[_0xd023('0x54')]){_0x5eda8b['Interval']={'id':_0x24f906[_0xd023('0x54')]['id'],'name':_0x24f906['Interval'][_0xd023('0x26')]};}var _0x550ddc=md5(JSON[_0xd023('0x55')](_0x5eda8b));if(_0x24f906[_0xd023('0x56')]!==_0x550ddc){_0x24f906['md5']=_0x550ddc;emit(util[_0xd023('0x57')]('voice:queue:%s',_0x5eda8b[_0xd023('0x26')]),_0xd023('0x58'),_0x5eda8b);}}}function emitVoiceQueueChannelRemove(_0xf31d80){emit(util['format'](_0xd023('0x59'),_0xf31d80[_0xd023('0x26')]),'voice_queue_channel:remove',_0xf31d80);}function notSendMessagesQueue(_0x11ede0){if(_0x11ede0[_0xd023('0x5a')]){if(_0x11ede0[_0xd023('0x4d')]===0x0&&_0x11ede0[_0xd023('0x2a')]===0x0){_0x11ede0['sendMessageOneNotActive']=![];_0x11ede0['available']=0x0;_0x11ede0[_0xd023('0x5b')]=0x0;_0x11ede0[_0xd023('0x4c')]=_0xd023('0x5c');ut[_0xd023('0x5d')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x11ede0[_0xd023('0x26')]+_0xd023('0x5e'));}else{_0x11ede0[_0xd023('0x4c')]=_0xd023('0x5f');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x11ede0['name']+'\x20is\x20disactive');}emitCampaignPreview(_0x11ede0);}}Preview[_0xd023('0x60')][_0xd023('0x22')]=function(){var _0x39cbdd=this;setInterval(function(){_0x39cbdd[_0xd023('0x61')]();},0x7cf);};Preview[_0xd023('0x60')][_0xd023('0x61')]=function(){var _0x2d4caa=this[_0xd023('0x10')];this['clockClearZombieChannels']+=0x1;for(var _0x3b6219 in _0x2d4caa){if(_0x2d4caa['hasOwnProperty'](_0x3b6219)&&(_0x2d4caa[_0x3b6219][_0xd023('0x31')]===_0xd023('0x4')||_0x2d4caa[_0x3b6219][_0xd023('0x31')]===_0xd023('0x62'))&&_0x2d4caa[_0x3b6219][_0xd023('0x24')]==='outbound'){if(this[_0xd023('0x63')]>0x7){this[_0xd023('0x63')]=0x0;this[_0xd023('0x64')]();}}if(_0x2d4caa[_0xd023('0x65')](_0x3b6219)&&_0x2d4caa[_0x3b6219]['dialMethod']===_0xd023('0x4')&&_0x2d4caa[_0x3b6219]['type']===_0xd023('0x25')){if(_0x2d4caa[_0x3b6219][_0xd023('0x30')]){this[_0xd023('0x66')](_0x2d4caa[_0x3b6219]);this[_0xd023('0x67')](_0x2d4caa[_0x3b6219]);}else{notSendMessagesQueue(_0x2d4caa[_0x3b6219]);}}}};Preview[_0xd023('0x60')][_0xd023('0x68')]=function(_0x411f19){var _0x2fccdc=this;this[_0xd023('0x69')]['enqueue'](function(){if(!_[_0xd023('0x6a')](_0x2fccdc[_0xd023('0x12')][_0x411f19])){loggerAction[_0xd023('0x6b')](_0xd023('0x6c'),_0x411f19,_0xd023('0x6d'),_0x2fccdc[_0xd023('0x12')][_0x411f19][_0xd023('0x6e')],_0xd023('0x6f'),JSON[_0xd023('0x55')](_0x2fccdc[_0xd023('0x10')][_0x2fccdc['actions'][_0x411f19][_0xd023('0x6e')]][_0xd023('0x4d')]),'pTalking:\x20',JSON['stringify'](_0x2fccdc[_0xd023('0x10')][_0x2fccdc[_0xd023('0x12')][_0x411f19]['queue']]['pTalking']),JSON[_0xd023('0x55')](_0x2fccdc[_0xd023('0x12')][_0x411f19]['dialAnswer']),JSON[_0xd023('0x55')](_['pick'](_0x2fccdc[_0xd023('0x12')][_0x411f19],[_0xd023('0x70'),_0xd023('0x71'),_0xd023('0x72'),_0xd023('0x73')])));return ami[_0xd023('0x74')]({'action':'status','channel':_0x2fccdc['actions'][_0x411f19][_0xd023('0x75')]})['catch'](function(_0x30ea22){if(_0x30ea22[_0xd023('0x4c')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x2fccdc['actions'][_0x411f19]){ut[_0xd023('0x76')](_0x2fccdc[_0xd023('0x10')][_0x2fccdc['actions'][_0x411f19][_0xd023('0x6e')]],_0xd023('0x77'));if(_0x2fccdc['actions'][_0x411f19][_0xd023('0x78')]===!![]){ut[_0xd023('0x79')](_0x2fccdc['campaignsPreview'][_0x2fccdc[_0xd023('0x12')][_0x411f19]['queue']],_0xd023('0x77'));ut[_0xd023('0x7a')](_0xd023('0x7b')+_0x411f19,_0x2fccdc['actions'][_0x411f19][_0xd023('0x6e')]);}ut[_0xd023('0x7a')](_0xd023('0x7c')+_0x411f19,_0x2fccdc[_0xd023('0x12')][_0x411f19][_0xd023('0x6e')]);delete _0x2fccdc[_0xd023('0x12')][_0x411f19];}},0x2328);}});}});};Preview[_0xd023('0x60')][_0xd023('0x64')]=function(){var _0x2fbc87=this;loggerAction[_0xd023('0x6b')](_0xd023('0x7d'),_[_0xd023('0x7e')](this[_0xd023('0x12')]));for(var _0xb25deb in this[_0xd023('0x12')]){if(_0x2fbc87[_0xd023('0x12')][_0xd023('0x65')](_0xb25deb)){_0x2fbc87[_0xd023('0x68')](_0xb25deb);}}};Preview[_0xd023('0x60')][_0xd023('0x67')]=function(_0x3c7d27){var _0x14bd6e=this;rpcDb[_0xd023('0x7f')](_0x3c7d27['id'],ut[_0xd023('0x80')](this[_0xd023('0x13')]))[_0xd023('0x81')](function(_0x2de603){if(!_['isNil'](_0x2de603)){for(var _0x1589af=0x0;_0x1589af<_0x2de603[_0xd023('0x82')];_0x1589af+=0x1){if(ut[_0xd023('0x83')](_0x2de603[_0x1589af][_0xd023('0x84')])<_0x3c7d27[_0xd023('0x85')]*0x3c){_0x14bd6e[_0xd023('0x86')](_0x2de603[_0x1589af]['id'])[_0xd023('0x81')](ut[_0xd023('0x87')](_0xd023('0x88')))[_0xd023('0x89')](ut[_0xd023('0x87')](_0xd023('0x88')));}else{var _0xc867de=new Action(_0x2de603[_0x1589af],_0x3c7d27);_0xc867de['starttime']=moment()['format'](_0xd023('0x8a'));_0x3c7d27[_0xd023('0x8b')]+=0x1;ut[_0xd023('0x8c')](_0xc867de,0x17,_0xd023('0x8d'));if(_0x3c7d27[_0xd023('0x8e')]){rpcDb[_0xd023('0x8f')](ut[_0xd023('0x90')](_0x2de603[_0x1589af]));rpcDb[_0xd023('0x91')](_0xc867de,_0xd023('0x92'));}else{ut['logCustomer'](_0xc867de,0x16,_0xd023('0x93'));rpcDb['createCustomerHistory'](_0xc867de,_0xd023('0x94'));rpcDb[_0xd023('0x95')](_0xc867de,_0xd023('0x94'));}}}}})[_0xd023('0x89')](ut[_0xd023('0x87')](_0xd023('0x96')));};Preview[_0xd023('0x60')][_0xd023('0x66')]=function(_0x5897a3){_0x5897a3[_0xd023('0x5a')]=!![];if(ut[_0xd023('0x97')](_0x5897a3[_0xd023('0x29')])){_0x5897a3['message']=_0xd023('0x98');}else if(!ut[_0xd023('0x99')](_0x5897a3[_0xd023('0x30')])){_0x5897a3[_0xd023('0x4c')]=_0xd023('0x5c');}else if(!this['isTrunkReachable'](_0x5897a3['Trunk'])){if(!this[_0xd023('0x9a')](_0x5897a3[_0xd023('0x9b')])){_0x5897a3[_0xd023('0x4c')]=_0xd023('0x9c');}else{_0x5897a3[_0xd023('0x4c')]='ACTIVE';}}else{_0x5897a3[_0xd023('0x4c')]=_0xd023('0x9d');}emitCampaignPreview(_0x5897a3);};Preview[_0xd023('0x60')][_0xd023('0x9e')]=function(_0x4e4685,_0x2be492,_0x4f6438){var _0x3eac3d=this;var _0x42da36=this[_0xd023('0x12')][_0x2be492];var _0xc70a46=this['campaignsPreview'][_0x42da36[_0xd023('0x6e')]];var _0xa9dc9f;if(_0xc70a46){switch(_0x4f6438){case'1':_0xc70a46[_0xd023('0x3d')]+=0x1;_0x42da36[_0xd023('0x9f')]=ut[_0xd023('0xa0')](_0x42da36);ut['logCustomer'](_0x42da36,0x0,'NoSuchNumber');rpcDb['createCustomerHistory'](_0x42da36,_0xd023('0xa1'));if(ut[_0xd023('0xa0')](_0x42da36)>=_0xc70a46['dialGlobalMaxRetry']){_0xa9dc9f=ut[_0xd023('0xa2')](_0x42da36,0xf,_0xd023('0xa3'));rpcDb[_0xd023('0x95')](_0xa9dc9f,_0xd023('0xa4'));}else{rpcDb[_0xd023('0x95')](_0x42da36,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0xd023('0x12')][_0x4e4685[_0xd023('0xa5')]];break;case _0xd023('0xa6'):var _0xce3f86=moment()[_0xd023('0x57')](_0xd023('0x8a'));_0x42da36[_0xd023('0xa7')]=_0xce3f86;_0x42da36[_0xd023('0xa8')]=_0xce3f86;_0x42da36[_0xd023('0x78')]=!![];_0xc70a46[_0xd023('0x2a')]+=0x1;logger['info'](_0xd023('0xa9'),_0x42da36[_0xd023('0xaa')],_0xd023('0xab'),_0xc70a46[_0xd023('0x26')],_0xd023('0xac'),_0xc70a46[_0xd023('0x2a')]);ami['emit'](_0xd023('0xad'),ut[_0xd023('0xae')](_0x42da36,_0xd023('0xaf')));if(_0xc70a46['acw']){ami['emit'](_0xd023('0xb0'),ut[_0xd023('0xb1')](_0x42da36));}break;case'16':ami[_0xd023('0x23')](_0xd023('0xb2'),ut[_0xd023('0xae')](_0x42da36,_0xd023('0xb3')));emitVoiceQueueChannelRemove(ut[_0xd023('0xae')](_0x42da36,_0xd023('0xb3')));_0xc70a46[_0xd023('0x36')]+=0x1;_0xc70a46[_0xd023('0xb4')]+=0x1;_0xc70a46[_0xd023('0x27')]+=0x1;ut[_0xd023('0x79')](_0xc70a46,_0xd023('0xb5'));_0x42da36[_0xd023('0x9f')]=ut[_0xd023('0xa0')](_0x42da36);ut[_0xd023('0x8c')](_0x42da36,0x4,_0xd023('0xb6'));rpcDb['createCustomerHistory'](_0x42da36,_0xd023('0xb7'));rpcDb[_0xd023('0x95')](_0x42da36,_0xd023('0xb8'));rpcDb['crateCustomerReportQueue'](_0x42da36);_0xc70a46['sumDuration']+=_0x42da36[_0xd023('0xb9')];_0xc70a46['sumBillable']+=_0x42da36[_0xd023('0xb9')];logger[_0xd023('0x6b')]('[syncHangup][talking][decrement]',_0x42da36[_0xd023('0xaa')],_0xd023('0xab'),_0xc70a46[_0xd023('0x26')],_0xd023('0xac'),_0xc70a46[_0xd023('0x2a')]);delete this['actions'][_0x4e4685[_0xd023('0xa5')]];break;case _0xd023('0xba'):_0xc70a46[_0xd023('0x38')]+=0x1;_0x42da36[_0xd023('0xbb')]+=0x1;_0x42da36[_0xd023('0x9f')]=ut[_0xd023('0xa0')](_0x42da36);ut[_0xd023('0x8c')](_0x42da36,0x5,_0xd023('0xbc'));rpcDb['createCustomerHistory'](_0x42da36,_0xd023('0xbd'));if(ut[_0xd023('0xa0')](_0x42da36)>=_0xc70a46[_0xd023('0xbe')]){_0xa9dc9f=ut[_0xd023('0xa2')](_0x42da36,0xf,_0xd023('0xa3'));rpcDb['createCustomerFinal'](_0xa9dc9f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x42da36[_0xd023('0xbb')]>=_0xc70a46['dialBusyMaxRetry']){rpcDb['createCustomerFinal'](_0x42da36,_0xd023('0xbd'));}else{rpcDb['rescheduleContact'](ut[_0xd023('0xbf')](_0x42da36,_0xd023('0xbb'),_0xc70a46[_0xd023('0xc0')]),_0x42da36[_0xd023('0xc1')],_0x42da36[_0xd023('0xc2')]);}}break;case _0xd023('0xc3'):_0xc70a46[_0xd023('0x3c')]+=0x1;_0x42da36[_0xd023('0xc4')]+=0x1;_0x42da36['countglobal']=ut[_0xd023('0xa0')](_0x42da36);ut[_0xd023('0x8c')](_0x42da36,0x3,'NoAnswer');rpcDb[_0xd023('0x91')](_0x42da36,_0xd023('0xc5'));if(ut[_0xd023('0xa0')](_0x42da36)>=_0xc70a46[_0xd023('0xbe')]){_0xa9dc9f=ut[_0xd023('0xa2')](_0x42da36,0xf,_0xd023('0xa3'));rpcDb[_0xd023('0x95')](_0xa9dc9f,_0xd023('0xc6'));}else{if(_0x42da36[_0xd023('0xc4')]>=_0xc70a46['dialNoAnswerMaxRetry']){rpcDb['createCustomerFinal'](_0x42da36,_0xd023('0xc5'));}else{rpcDb[_0xd023('0xc7')](ut[_0xd023('0xbf')](_0x42da36,_0xd023('0xc4'),_0xc70a46[_0xd023('0xc8')]),_0x42da36['unlockAgent'],_0x42da36[_0xd023('0xc2')]);}}break;case _0xd023('0xc9'):_0xc70a46[_0xd023('0x39')]+=0x1;_0x42da36[_0xd023('0xca')]+=0x1;_0x42da36[_0xd023('0x9f')]=ut['totalGlobal'](_0x42da36);ut[_0xd023('0x8c')](_0x42da36,0x8,'Congestion');rpcDb[_0xd023('0x91')](_0x42da36,_0xd023('0xcb'));if(ut['totalGlobal'](_0x42da36)>=_0xc70a46['dialGlobalMaxRetry']){_0xa9dc9f=ut[_0xd023('0xa2')](_0x42da36,0xf,_0xd023('0xa3'));rpcDb['createCustomerFinal'](_0xa9dc9f,_0xd023('0xcc'));}else{if(_0x42da36[_0xd023('0xca')]>=_0xc70a46['dialCongestionMaxRetry']){rpcDb[_0xd023('0x95')](_0x42da36,_0xd023('0xcb'));}else{rpcDb[_0xd023('0xc7')](ut['scheduledAt'](_0x42da36,'countcongestionretry',_0xc70a46['dialBusyRetryFrequency']),_0x42da36[_0xd023('0xc1')],_0x42da36[_0xd023('0xc2')]);}}break;case'CANCEL':_0xc70a46[_0xd023('0x3f')]+=0x1;_0x42da36[_0xd023('0x9f')]=ut[_0xd023('0xa0')](_0x42da36);ut[_0xd023('0x8c')](_0x42da36,0x14,_0xd023('0xcd'));rpcDb[_0xd023('0x91')](_0x42da36,'[syncHangupRequest][logAgentReject]');if(_0x42da36[_0xd023('0xc1')]){rpcDb[_0xd023('0xce')](_0x42da36[_0xd023('0xcf')]);}if(_0x42da36[_0xd023('0xc2')]){rpcDb[_0xd023('0xd0')](_0x42da36[_0xd023('0xcf')]);}break;default:if(_0x42da36[_0xd023('0x78')]){ut[_0xd023('0x79')](_0xc70a46,'[default]');ut[_0xd023('0x7a')](_0xd023('0xd1')+_0xc70a46[_0xd023('0x26')],_0x4e4685);}_0xc70a46[_0xd023('0x40')]+=0x1;_0x42da36[_0xd023('0x9f')]=ut[_0xd023('0xa0')](_0x42da36);ut[_0xd023('0x8c')](_0x42da36,0xc,_0x4e4685[_0xd023('0xd2')]||_0x4e4685[_0xd023('0xd3')]);rpcDb['createCustomerHistory'](_0x42da36,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xd023('0xa0')](_0x42da36)>=_0xc70a46[_0xd023('0xbe')]){_0xa9dc9f=ut[_0xd023('0xa2')](_0x42da36,0xf,'Global');rpcDb[_0xd023('0x95')](_0xa9dc9f,_0xd023('0xd4'));}else{rpcDb['createCustomerFinal'](_0x42da36,_0xd023('0xd4'));}delete this['actions'][_0x4e4685['linkedid']];}if(!(_0x42da36[_0xd023('0x78')]&&_0x4f6438==='16')){ut[_0xd023('0x76')](_0xc70a46,_0xd023('0xd5'));logger['info'](_0xd023('0xd6'),_0x42da36[_0xd023('0xaa')],_0xd023('0xab'),_0xc70a46['name'],_0xd023('0x6f'),_0xc70a46[_0xd023('0x4d')]);}if(_0x4f6438!==_0xd023('0xa6')){delete this['actions'][_0x4e4685['linkedid']];delete this['actions'][_0x4e4685['destlinkedid']];}}};Preview[_0xd023('0x60')]['callProgressDetectingAgent']=function(_0x35deec,_0x423a51,_0x230e0c){if(_[_0xd023('0xd7')](_0x423a51)&&_0xd023('0xd8')!==typeof _0x423a51){return;}if(_[_0xd023('0xd7')](_0x230e0c)&&_0xd023('0xd8')!==typeof _0x230e0c){return;}switch(_0x230e0c[_0xd023('0xd9')]){case'0':ut[_0xd023('0xda')](_0x35deec,0x0,'NoSuchNumber');rpcDb[_0xd023('0xdb')](_0x35deec,_0xd023('0xdc'));break;case'3':ut[_0xd023('0xda')](_0x35deec,0x3,_0xd023('0xdd'));rpcDb[_0xd023('0xdb')](_0x35deec,'[callProgressDetectingAgent][logNoAnswer]');break;case'5':ut[_0xd023('0xda')](_0x35deec,0x5,_0xd023('0xbc'));rpcDb[_0xd023('0xdb')](_0x35deec,_0xd023('0xde'));break;case'8':ut[_0xd023('0xda')](_0x35deec,0x8,_0xd023('0xdf'));rpcDb[_0xd023('0xdb')](_0x35deec,_0xd023('0xe0'));break;case'22':ut[_0xd023('0xda')](_0x35deec,0x16,_0xd023('0xe1'));rpcDb[_0xd023('0xdb')](_0x35deec,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut['logAgent'](_0x35deec,0xc,_0x230e0c['reason']);rpcDb[_0xd023('0xdb')](_0x35deec,_0xd023('0xe0'));}ut[_0xd023('0x76')](_0x423a51,'[callProgressDetectingAgent]');logger['info']('[originated][decrement][callProgressDetectingAgent]',_0x35deec[_0xd023('0xaa')],_0xd023('0xab'),_0x423a51[_0xd023('0x26')],'originated:\x20',_0x423a51[_0xd023('0x4d')]);delete this[_0xd023('0x12')][_0x35deec[_0xd023('0xaa')]];};Preview[_0xd023('0x60')][_0xd023('0xe2')]=function(_0x3b19a6,_0x3c9d6d,_0x4f44b2,_0x5c0ab0,_0x3dd76f){var _0x29eb7e=this;return new BPromise(function(_0x43ec0e,_0x1470a7){if(_[_0xd023('0x6a')](_0x3c9d6d)||_[_0xd023('0x6a')](_0x3c9d6d[_0xd023('0xe3')])||_[_0xd023('0x6a')](_0x3c9d6d[_0xd023('0xe3')]['phone'])||_[_0xd023('0x6a')](_0x3c9d6d[_0xd023('0x72')])){_0x1470a7(ut[_0xd023('0x4c')](_0xd023('0xe4'),_0x5c0ab0,_0x3dd76f));return;}var _0x5b36ea=uuid['v4']();var _0x4e7191=_0x29eb7e[_0xd023('0x10')][_0x3c9d6d[_0xd023('0x6d')][_0xd023('0x26')]];var _0x308a60=_0x4f44b2?_0x29eb7e['agents'][_0x4f44b2]['id']:undefined;_0x29eb7e[_0xd023('0x12')][_0x5b36ea]=new Action(_0x3c9d6d,_0x4e7191,_0x5b36ea,_0x4f44b2,_0x308a60);var _0x28142a=_0x29eb7e['actions'][_0x5b36ea];_0x28142a[_0xd023('0xc1')]=_0x5c0ab0;_0x28142a[_0xd023('0xc2')]=_0x3dd76f;_0x28142a[_0xd023('0xe5')]=_0x4f44b2;if(_[_0xd023('0xe6')](_0x3b19a6)){_0x29eb7e['execCall'](_0x28142a,_0x4e7191,_0x3c9d6d,_0x4f44b2)['then'](function(_0x47a520){logger['info']('[Preview][execCall][success]',_0xd023('0xe7')+_0x28142a[_0xd023('0x6e')]+'\x20IdHopper:\x20'+_0x28142a['idContact'],JSON[_0xd023('0x55')](_0x47a520));ami['emit'](_0xd023('0xe8'),ut[_0xd023('0xae')](_0x28142a,'called'));_0x43ec0e(ut[_0xd023('0x4c')](_0xd023('0xe9')));})[_0xd023('0x89')](function(_0x59dd3e){ut[_0xd023('0x5d')](_0xd023('0xea'),_0x59dd3e);_0x1470a7(ut[_0xd023('0x4c')]('Call\x20failed',_0x5c0ab0,_0x3dd76f));});}else{_0x4e7191[_0xd023('0x37')]+=0x1;ut['logBlacklist'](_0x28142a);rpcDb[_0xd023('0xeb')](_0x28142a,_0xd023('0xec'));delete _0x29eb7e[_0xd023('0x12')][_0x5b36ea];_0x1470a7(ut[_0xd023('0x4c')](_0xd023('0xed'),_0x5c0ab0,_0x3dd76f));}});};Preview[_0xd023('0x60')][_0xd023('0x9a')]=function(_0xcdd786){return!_[_0xd023('0x6a')](_0xcdd786)&&!_[_0xd023('0x6a')](_0xcdd786['name'])&&!_[_0xd023('0x6a')](_0xcdd786[_0xd023('0x53')])&&_0xcdd786[_0xd023('0x53')]&&!_[_0xd023('0x6a')](this[_0xd023('0x11')][util[_0xd023('0x57')]('SIP/%s',_0xcdd786[_0xd023('0x26')])])&&!_[_0xd023('0x6a')](this[_0xd023('0x11')][util[_0xd023('0x57')](_0xd023('0xee'),_0xcdd786[_0xd023('0x26')])][_0xd023('0xef')])&&(this[_0xd023('0x11')][util['format']('SIP/%s',_0xcdd786[_0xd023('0x26')])][_0xd023('0xef')]===_0xd023('0xf0')||this[_0xd023('0x11')][util[_0xd023('0x57')](_0xd023('0xee'),_0xcdd786[_0xd023('0x26')])][_0xd023('0xef')]==='unmonitored');};Preview['prototype'][_0xd023('0x86')]=function(_0x2a9950,_0x44f175){var _0x289af1=this;return new BPromise(function(_0xa21374,_0x13a6ea){_0x289af1[_0xd023('0xf1')](_0x2a9950,_0x44f175)['then'](function(_0x272c77){_0xa21374(_[_0xd023('0xf2')](_0x272c77,[_0xd023('0x4c')]));})['catch'](function(_0x29b31a){if(_0x29b31a[_0xd023('0xf3')]){rpcDb[_0xd023('0xce')](_0x2a9950);}if(_0x29b31a[_0xd023('0x53')]){rpcDb[_0xd023('0xd0')](_0x2a9950);}_0x13a6ea(_['pick'](_0x29b31a,[_0xd023('0x4c')]));});});};Preview[_0xd023('0x60')][_0xd023('0xf1')]=function(_0x57b968,_0x1aed20){var _0x590634=this;return new BPromise(function(_0x179cdc,_0x61bd35){var _0x32f209,_0x29d27d;rpcDb[_0xd023('0xf4')](_0x57b968)['then'](function(_0x5eeea3){if(!_['isNil'](_0x5eeea3[0x0])){_0x29d27d=_0x5eeea3[0x0][_0xd023('0xf5')]?![]:!![];_0x32f209=_0x5eeea3[0x0]['recallme']?!![]:![];_0x32f209=_0x1aed20?!![]:_0x32f209;}var _0x1171de=_0x590634[_0xd023('0xf6')](_0x5eeea3);if(_0x1171de[_0xd023('0xf7')]){rpcDb[_0xd023('0xf8')](_[_0xd023('0xf2')](_0x5eeea3[0x0],[_0xd023('0x72'),_0xd023('0xf9')]))[_0xd023('0x81')](function(_0x1bdeb9){_0x590634[_0xd023('0xe2')](_0x1bdeb9,_0x5eeea3[0x0],_0x1aed20,_0x29d27d,_0x32f209)['then'](function(_0x20133f){_0x179cdc(_0x20133f);})[_0xd023('0x89')](function(_0x16b4aa){_0x61bd35(_0x16b4aa);});})[_0xd023('0x89')](function(_0x4a5c7f){ut[_0xd023('0x5d')]('[Preview][checkIsBlackList]',_0x4a5c7f);_0x61bd35(ut[_0xd023('0x4c')](_0xd023('0xfa'),_0x29d27d,_0x32f209));});}else{_0x61bd35(ut[_0xd023('0x4c')](_0x1171de[_0xd023('0x4c')],_0x29d27d,_0x32f209));}})[_0xd023('0x89')](function(_0x5752d5){ut[_0xd023('0x5d')](_0xd023('0xfb'),_0x5752d5);_0x61bd35(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview[_0xd023('0x60')][_0xd023('0xf6')]=function(_0x373f3b){if(_[_0xd023('0x6a')](_0x373f3b)||_[_0xd023('0xe6')](_0x373f3b)||!_[_0xd023('0x6a')](_0x373f3b[0x0][_0xd023('0xfc')])&&_['isNil'](_0x373f3b[0x0][_0xd023('0xfc')]['name'])){ut[_0xd023('0x5d')](_0xd023('0xfd'),_0x373f3b);return{'isValid':![],'message':_0xd023('0xfe')};}var _0x4e0889=this['campaignsPreview'][_0x373f3b[0x0][_0xd023('0x6d')][_0xd023('0x26')]];_0x4e0889[_0xd023('0x4c')]='ACTIVE';if(_[_0xd023('0x6a')](_0x4e0889)){ut[_0xd023('0x5d')](_0xd023('0xff'),_0x4e0889);return{'isValid':![],'message':_0xd023('0x100')};}if(!this[_0xd023('0x9a')](_0x4e0889[_0xd023('0x52')])){ut[_0xd023('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0xd023('0x101')+_0x4e0889[_0xd023('0x26')]+_0xd023('0x102'));if(!this[_0xd023('0x9a')](_0x4e0889['TrunkBackup'])){ut[_0xd023('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x4e0889[_0xd023('0x26')]+_0xd023('0x103'));return{'isValid':![],'message':_0xd023('0x104')};}}if(!ut[_0xd023('0x99')](_0x4e0889[_0xd023('0x30')])){ut[_0xd023('0x5d')]('[Preview][validateContact][Campaign\x20Active]',_0x4e0889['name']+_0xd023('0x105'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x4e0889[_0xd023('0x26')]+'\x20Not\x20Active'};}return{'isValid':!![],'message':_0xd023('0x106')};};Preview[_0xd023('0x60')][_0xd023('0x107')]=function(_0xc834,_0x43796f,_0xce92c6,_0x229d7b){var _0x9a49e9=this;return new BPromise(function(_0x5bb25b,_0x1d5ba5){var _0x218078=_0xc834[_0xd023('0xaa')];var _0x4a8889=_0x9a49e9[_0xd023('0x9a')](_0x43796f['Trunk'])?util[_0xd023('0x57')]('SIP/%s/%s%s',_0x43796f[_0xd023('0x52')][_0xd023('0x26')],_[_0xd023('0x6a')](_0x43796f[_0xd023('0x34')])?'':_0x43796f[_0xd023('0x34')][_0xd023('0x108')]()||'',_0x43796f[_0xd023('0x109')]>0x0?_0xce92c6[_0xd023('0xe3')][_0xd023('0x10a')][_0xd023('0x10b')](_0x43796f[_0xd023('0x109')]):_0xce92c6[_0xd023('0xe3')]['phone']):util[_0xd023('0x57')](_0xd023('0x10c'),_['isNil'](_0x43796f[_0xd023('0x9b')])?_0x43796f[_0xd023('0x52')][_0xd023('0x26')]:_0x43796f['TrunkBackup']['name'],_[_0xd023('0x6a')](_0x43796f[_0xd023('0x34')])?'':_0x43796f[_0xd023('0x34')][_0xd023('0x108')]()||'',_0x43796f['dialCutDigit']>0x0?_0xce92c6[_0xd023('0xe3')]['phone'][_0xd023('0x10b')](_0x43796f['dialCutDigit']):_0xce92c6[_0xd023('0xe3')][_0xd023('0x10a')]);var _0x382b71=_0x9a49e9['isTrunkReachable'](_0x43796f[_0xd023('0x52')])?ut[_0xd023('0x10d')](_0x43796f[_0xd023('0x52')][_0xd023('0x10e')],_0x43796f[_0xd023('0x32')],_0x43796f[_0xd023('0x10f')]>0x0?ut[_0xd023('0x110')](_0x43796f[_0xd023('0x33')],_0x43796f[_0xd023('0x10f')]):_0x43796f[_0xd023('0x33')]):ut[_0xd023('0x10d')](_[_0xd023('0x6a')](_0x43796f[_0xd023('0x9b')])?_0x43796f[_0xd023('0x52')][_0xd023('0x10e')]:_0x43796f['TrunkBackup'][_0xd023('0x10e')],_0x43796f[_0xd023('0x32')],_0x43796f[_0xd023('0x10f')]>0x0?ut['getCallerIdRandom'](_0x43796f[_0xd023('0x33')],_0x43796f['dialRandomLastDigitCallerIdNumber']):_0x43796f[_0xd023('0x33')]);if(_0x382b71){_0xc834[_0xd023('0x111')]=ut['extractCalleridName'](_0x382b71);_0xc834[_0xd023('0x112')]=ut[_0xd023('0x113')](_0x382b71);}var _0x1f3dc8=ut['addVariables'](_0x43796f,_0xce92c6,_0x4a8889,_0x382b71,_0x218078,_0xc834);_[_0xd023('0x114')](_0xc834,ut[_0xd023('0x115')](_0x1f3dc8));_0xc834['starttime']=moment()['format'](_0xd023('0x8a'));ami[_0xd023('0x74')](ut[_0xd023('0x116')](_0xc834,_0x43796f,_0x1f3dc8,_0xc834[_0xd023('0xc2')],_0x229d7b))[_0xd023('0x81')](function(_0x3622a9){_0x43796f[_0xd023('0x4d')]+=0x1;logger['info'](_0xd023('0x117'),_0x218078,_0xd023('0xab'),_0x43796f[_0xd023('0x26')],_0xd023('0x6f'),_0x43796f['originated']);_0x5bb25b(_0x3622a9);})['catch'](function(_0x1d4e40){ut[_0xd023('0xda')](_0xc834,0xe,_0xd023('0x118'));rpcDb[_0xd023('0xdb')](_0xc834,_0xd023('0x119'));_0x1d5ba5(_0x1d4e40);});});};Preview[_0xd023('0x60')][_0xd023('0x1c')]=function(_0xcac796){if(this[_0xd023('0x12')][_0xcac796[_0xd023('0xa5')]]){this[_0xd023('0x12')][_0xcac796[_0xd023('0xa5')]][_0xd023('0x75')]=_0xcac796[_0xd023('0x75')];}};Preview[_0xd023('0x60')][_0xd023('0x15')]=function(_0x414e34){var _0x1ecf91=this;var _0x3dd2b5=this[_0xd023('0x12')][_0x414e34[_0xd023('0x11a')]];if(_0x3dd2b5){if(_0x3dd2b5[_0xd023('0xe5')]&&this[_0xd023('0x13')][_0x3dd2b5[_0xd023('0xe5')]]){ut[_0xd023('0x11b')](_0x3dd2b5,this[_0xd023('0x13')][_0x3dd2b5['lookAgent']]['name'],this[_0xd023('0x13')][_0x3dd2b5['lookAgent']]['id']);}var _0xe0a4cd=_[_0xd023('0x11c')](_0x3dd2b5);_0xe0a4cd['responsetime']=moment()[_0xd023('0x57')](_0xd023('0x8a'));var _0x3921cf=_0x1ecf91['campaignsPreview'][_0x3dd2b5[_0xd023('0x6e')]];if(ut[_0xd023('0x11d')](_0x414e34['response'])){if(_0x3dd2b5[_0xd023('0xc1')]){rpcDb[_0xd023('0xce')](_0x3dd2b5[_0xd023('0xcf')]);}if(_0x3dd2b5[_0xd023('0xc2')]){rpcDb['disableContact'](_0x3dd2b5[_0xd023('0xcf')]);}ami[_0xd023('0x23')](_0xd023('0x11e'),ut[_0xd023('0xae')](_0x3dd2b5,'rejected'));this[_0xd023('0x11f')](_0xe0a4cd,_0x3921cf,_0x414e34);}else{_0x3dd2b5[_0xd023('0x120')]=moment()[_0xd023('0x57')](_0xd023('0x8a'));ut[_0xd023('0xda')](_0xe0a4cd,0x4,_0xd023('0xb6'));rpcDb['createAgentHistory'](_0xe0a4cd,_0xd023('0x121'));}}};Preview[_0xd023('0x60')][_0xd023('0x17')]=function(_0x509005){var _0x47aa8e=this;var _0xe25466=this[_0xd023('0x12')][_0x509005[_0xd023('0xa5')]];var _0x3f4940;if(_0xe25466){_0x3f4940=this['campaignsPreview'][_0xe25466[_0xd023('0x6e')]];logger['info'](_0xd023('0x122'),_0x509005[_0xd023('0xa5')],_0xd023('0xab'),_0x3f4940[_0xd023('0x26')],'pTalking:\x20',_0x3f4940[_0xd023('0x2a')]);}if(this[_0xd023('0x12')][_0x509005[_0xd023('0xa5')]]&&_0x509005[_0xd023('0xa5')]!==_0x509005['uniqueid']){if(_0x509005[_0xd023('0x123')]==='16'&&this[_0xd023('0x12')][_0x509005[_0xd023('0xa5')]][_0xd023('0x78')]){this[_0xd023('0x9e')](_0x509005,_0x509005[_0xd023('0xa5')],_0x509005[_0xd023('0x123')]);}else if(this[_0xd023('0x12')][_0x509005['linkedid']]['dialAnswer']){logger[_0xd023('0x6b')](_0xd023('0x124'),_0x509005['linkedid'],_0x509005[_0xd023('0x123')],_0xd023('0xab'),_0x3f4940[_0xd023('0x26')],'pTalking:\x20',_0x3f4940[_0xd023('0x2a')]);this[_0xd023('0x9e')](_0x509005,_0x509005['linkedid'],_0x509005[_0xd023('0x123')]);}}else if(_0xe25466&&_[_0xd023('0x6a')](_0xe25466[_0xd023('0x125')])&&_0x3f4940[_0xd023('0x126')]&&_0x509005[_0xd023('0xa5')]===_0x509005[_0xd023('0xaa')]&&_['isNil'](_0x509005['reason'])&&_0x509005[_0xd023('0x123')]==='16'&&_0x509005['channelstate']==='6'&&_[_0xd023('0xd7')](_0xe25466[_0xd023('0x127')])){if(_0xe25466[_0xd023('0xc1')]){rpcDb['unlockContact'](_0xe25466[_0xd023('0xcf')]);}if(_0xe25466[_0xd023('0xc2')]){rpcDb[_0xd023('0xd0')](_0xe25466[_0xd023('0xcf')]);}_0x509005['reason']='22';this[_0xd023('0x11f')](_0xe25466,_0x3f4940,_0x509005);}else if(_0xe25466&&_0xe25466[_0xd023('0x127')]){if(_0x509005['cause']==='16'&&this[_0xd023('0x12')][_0x509005['linkedid']]['dialAnswer']){logger[_0xd023('0x6b')](_0xd023('0x128'),_0x509005[_0xd023('0xa5')],_0x509005[_0xd023('0x123')],_0xd023('0xab'),_0x3f4940[_0xd023('0x26')],_0xd023('0xac'),_0x3f4940['pTalking']);this['callProgressDetectingCustomer'](_0x509005,_0x509005['linkedid'],_0x509005[_0xd023('0x123')]);}else if(this['actions'][_0x509005[_0xd023('0xa5')]]['dialAnswer']){logger[_0xd023('0x6b')](_0xd023('0x124'),_0x509005[_0xd023('0xa5')],_0x509005[_0xd023('0x123')],_0xd023('0xab'),_0x3f4940[_0xd023('0x26')],_0xd023('0xac'),_0x3f4940['pTalking']);this[_0xd023('0x9e')](_0x509005,_0x509005[_0xd023('0xa5')],_0x509005[_0xd023('0x123')]);}}};Preview[_0xd023('0x60')]['syncDialEnd']=function(_0x230882){if(this[_0xd023('0x12')][_0x230882[_0xd023('0x129')]]&&_0x230882[_0xd023('0x129')]!==_0x230882[_0xd023('0x12a')]){this[_0xd023('0x9e')](_0x230882,_0x230882['destlinkedid'],_0x230882[_0xd023('0xd3')]);}};Preview['prototype'][_0xd023('0x12b')]=function(_0x2020c0){if(this['actions'][_0x2020c0['linkedid']]&&_0x2020c0[_0xd023('0xa5')]!==_0x2020c0['uniqueid']&&!this[_0xd023('0x12')][_0x2020c0['linkedid']]['dialAnswer']){if(_0x2020c0[_0xd023('0x123')]==='1'){this[_0xd023('0x9e')](_0x2020c0,_0x2020c0[_0xd023('0xa5')],_0x2020c0[_0xd023('0x123')]);}}};Preview[_0xd023('0x60')][_0xd023('0x12c')]=function(_0x30e142,_0x3129e2,_0x3f643a){if(this[_0xd023('0x12')][_0x30e142]){if(_[_0xd023('0x6a')](this[_0xd023('0x12')][_0x30e142][_0xd023('0x12d')])){this[_0xd023('0x12')][_0x30e142][_0xd023('0x12d')]={};}this[_0xd023('0x12')][_0x30e142][_0xd023('0x12d')][_0x3129e2]=_0x3f643a;}};Preview[_0xd023('0x60')][_0xd023('0x1e')]=function(_0x5b2f30){try{if(!_['isNil'](_0x5b2f30)){if(ut[_0xd023('0x12e')](_['keys'](_0x5b2f30[_0xd023('0x12f')])[0x0])){this[_0xd023('0x12c')](_0x5b2f30[_0xd023('0xaa')],_['keys'](_0x5b2f30[_0xd023('0x12f')])[0x0],_0x5b2f30[_0xd023('0x130')]);}}}catch(_0xd74f69){logger['error'](_0xd023('0x131'),util[_0xd023('0x132')](_0xd74f69,{'showHidden':![],'depth':null}));}};Preview['prototype'][_0xd023('0x1f')]=function(_0xc3c132){if(_0xc3c132){if(this[_0xd023('0x12')][_0xc3c132['transfertargetlinkedid']]){this[_0xd023('0x12')][_0xc3c132[_0xd023('0x133')]][_0xd023('0x127')]=!![];}}};Preview[_0xd023('0x60')][_0xd023('0x21')]=function(_0x34b2ea){if(_0x34b2ea){if(this['actions'][_0x34b2ea[_0xd023('0x134')]]){this['actions'][_0x34b2ea[_0xd023('0x134')]][_0xd023('0x127')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x46ff=['[syncHangup][talking][decrement]','countglobal','Busy','[callProgressDetectingCustomer][logBusy]','cloneAction','[callProgressDetectingCustomer][logBusyGlobal]','countbusyretry','dialBusyMaxRetry','rescheduleContact','scheduledAt','activeContact','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','unlockAgent','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','dialGlobalMaxRetry','[callProgressDetectingCustomer][logCongestionGlobal]','dialBusyRetryFrequency','AgentReject','unlockContact','idContact','disableContact','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[originated][decrement][callProgressDetectingCustomer]','originated:\x20','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','custom:agentcalled','called','logger','[Preview][execCall][failure]','outboundBlacklistCallsDay','logBlacklist','createHistory','[Blacklist][error]','SIP/%s','reachable','unmonitored','run','execRun','pick','unlock','recallme','isValid','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','Trunk\x20not\x20work','isActive','\x20Not\x20Active','Is\x20Valid','execCall','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','trim','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','channel','syncOriginateResponse','actionid','logLookAgent','clone','isFailure','response','custom:agentringnoanswer','rejected','syncHangup','[syncHangup][talking]','pTalking:\x20','cause','[syncHangup][talking][cause]','statedesc','dialQueueProject','channelstate','transfer','variables','keys','variable','value','error','inspect','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','ioredis','preview','../../../config/logger','actionPreview','../ami','./action','redis','defaults','localhost','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','bind','hangup','syncHangupRequest','dialend','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','outbound','name','strategy','answered','pTalking','sumBillable','sumDuration','talking','total','type','unmanaged','abandoned','waiting','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerAgiCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangAbandonmentRate','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','format','voice:queue:%s','voice_queue_channel:remove','sendMessageOneNotActive','available','NOT_ACTIVE','[CampaignPreview]\x20Campaign\x20Queue:\x20','IS_DISACTIVED','\x20is\x20disactive','prototype','loopCampaigns','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','dialActive','setMessage','recallMe','enqueue','isNil','info','[clearZombieChannels][talking]','Queue','queue','dialAnswer','contactId','VoiceQueueId','ListId','Action','status','catch','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][pTalking][Preview]','[Dialer][checkChannel][Preview]','size','clearZombieChannel','agentReadyId','then','length','getDiff','scheduledat','dialRecallMeTimeout','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','[getContactRecallMe]','IsNotLoggedIn','AGENTS_NOT_LOGGED','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','custom:agentconnect','buildObj','connect','acw','emit','custom:agentConnectPreview','buildAcw','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime'];(function(_0x2c73c6,_0x384a60){var _0x4c01c6=function(_0x18b5b9){while(--_0x18b5b9){_0x2c73c6['push'](_0x2c73c6['shift']());}};_0x4c01c6(++_0x384a60);}(_0x46ff,0x87));var _0xf46f=function(_0x15b5ce,_0x136582){_0x15b5ce=_0x15b5ce-0x0;var _0x11dec5=_0x46ff[_0x15b5ce];return _0x11dec5;};'use strict';var util=require(_0xf46f('0x0'));var _=require(_0xf46f('0x1'));var BPromise=require(_0xf46f('0x2'));var uuid=require(_0xf46f('0x3'));var moment=require(_0xf46f('0x4'));var md5=require(_0xf46f('0x5'));var Redis=require(_0xf46f('0x6'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xf46f('0x7'));var loggerAction=require(_0xf46f('0x8'))(_0xf46f('0x9'));var ami=require(_0xf46f('0xa'));var rpcDb=require('./rpcDb');var Action=require(_0xf46f('0xb'));var ut=require('./util/util');config[_0xf46f('0xc')]=_[_0xf46f('0xd')](config[_0xf46f('0xc')],{'host':_0xf46f('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xf46f('0xc')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x3c8efe){this[_0xf46f('0xf')]=this[_0xf46f('0xf')]?this[_0xf46f('0xf')][_0xf46f('0x10')](_0x3c8efe):_0x3c8efe();};function Preview(_0x577208){this[_0xf46f('0x11')]=new Sequence();this[_0xf46f('0x12')]=_0x577208[_0xf46f('0x13')];this[_0xf46f('0x14')]=_0x577208[_0xf46f('0x14')];this[_0xf46f('0x15')]={};this[_0xf46f('0x16')]=_0x577208[_0xf46f('0x16')];this[_0xf46f('0x17')]=0x0;ami['on'](_0xf46f('0x18'),this['syncOriginateResponse'][_0xf46f('0x19')](this));ami['on'](_0xf46f('0x1a'),this['syncHangup']['bind'](this));ami['on']('hanguprequest',this[_0xf46f('0x1b')][_0xf46f('0x19')](this));ami['on'](_0xf46f('0x1c'),this[_0xf46f('0x1d')]['bind'](this));ami['on'](_0xf46f('0x1e'),this['syncNewExten'][_0xf46f('0x19')](this));ami['on'](_0xf46f('0x1f'),this[_0xf46f('0x20')][_0xf46f('0x19')](this));ami['on'](_0xf46f('0x21'),this[_0xf46f('0x22')][_0xf46f('0x19')](this));ami['on'](_0xf46f('0x23'),this[_0xf46f('0x24')][_0xf46f('0x19')](this));this['loopCampaigns'](this[_0xf46f('0x12')]);}function emit(_0x2a3eb5,_0x4b6ab0,_0x2a7bba){io['to'](_0x2a3eb5)['emit'](_0x4b6ab0,_0x2a7bba);}function emitCampaignPreview(_0x27f0cd){if(_0x27f0cd['type']===_0xf46f('0x25')){var _0x517b8f={'id':_0x27f0cd['id'],'name':_0x27f0cd[_0xf46f('0x26')],'strategy':_0x27f0cd[_0xf46f('0x27')],'answered':_0x27f0cd[_0xf46f('0x28')],'available':_0x27f0cd['available'],'loggedIn':_0x27f0cd['loggedIn'],'pTalking':_0x27f0cd[_0xf46f('0x29')],'sumBillable':_0x27f0cd[_0xf46f('0x2a')],'sumDuration':_0x27f0cd[_0xf46f('0x2b')],'sumHoldTime':_0x27f0cd['sumHoldTime']||0x0,'talking':_0x27f0cd[_0xf46f('0x2c')],'total':_0x27f0cd[_0xf46f('0x2d')],'type':_0x27f0cd[_0xf46f('0x2e')],'unmanaged':_0x27f0cd[_0xf46f('0x2f')],'abandoned':_0x27f0cd[_0xf46f('0x30')],'waiting':_0x27f0cd[_0xf46f('0x31')],'loggedInDb':_0x27f0cd['loggedInDb'],'dialActive':_0x27f0cd['dialActive'],'dialMethod':_0x27f0cd[_0xf46f('0x32')],'dialOriginateCallerIdName':_0x27f0cd[_0xf46f('0x33')],'dialOriginateCallerIdNumber':_0x27f0cd[_0xf46f('0x34')],'dialOriginateTimeout':_0x27f0cd['dialOriginateTimeout'],'dialPrefix':_0x27f0cd['dialPrefix'],'outboundAnswerAgiCallsDay':_0x27f0cd[_0xf46f('0x35')],'outboundAnswerCallsDay':_0x27f0cd['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x27f0cd['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x27f0cd['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x27f0cd[_0xf46f('0x36')],'outboundDropCallsDayACS':_0x27f0cd[_0xf46f('0x37')],'outboundDropCallsDayCallersExit':_0x27f0cd[_0xf46f('0x38')],'outboundDropCallsDayTimeout':_0x27f0cd[_0xf46f('0x39')],'outboundNoAnswerCallsDay':_0x27f0cd['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x27f0cd[_0xf46f('0x3a')],'outboundOriginateFailureCallsDay':_0x27f0cd[_0xf46f('0x3b')],'outboundReCallsDay':_0x27f0cd[_0xf46f('0x3c')],'outboundRejectCallsDay':_0x27f0cd['outboundRejectCallsDay'],'outboundUnknownCallsDay':_0x27f0cd[_0xf46f('0x3d')],'predictiveIntervalAnsweredCalls':_0x27f0cd[_0xf46f('0x3e')],'predictiveIntervalAvgHoldtime':_0x27f0cd[_0xf46f('0x3f')],'predictiveIntervalAvgTalktime':_0x27f0cd[_0xf46f('0x40')],'predictiveIntervalDroppedCallsCallersExit':_0x27f0cd[_0xf46f('0x41')],'predictiveIntervalDroppedCallsTimeout':_0x27f0cd[_0xf46f('0x42')],'predictiveIntervalErlangCalls':_0x27f0cd['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x27f0cd[_0xf46f('0x43')],'predictiveIntervalHitRate':_0x27f0cd[_0xf46f('0x44')],'predictiveIntervalMultiplicativeFactor':_0x27f0cd['predictiveIntervalMultiplicativeFactor'],'predictiveIntervalPauses':_0x27f0cd[_0xf46f('0x45')],'predictiveIntervalAvailable':_0x27f0cd['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x27f0cd[_0xf46f('0x46')],'message':_0x27f0cd[_0xf46f('0x47')],'originated':_0x27f0cd[_0xf46f('0x48')],'erlangCalls':_0x27f0cd[_0xf46f('0x49')],'erlangCallToSecond':_0x27f0cd['erlangCallToSecond'],'erlangAbandonmentRate':_0x27f0cd[_0xf46f('0x4a')],'erlangBusyFactor':_0x27f0cd['erlangBusyFactor'],'startPredictive':_0x27f0cd[_0xf46f('0x4b')],'startProgressive':_0x27f0cd[_0xf46f('0x4c')]};if(_0x27f0cd[_0xf46f('0x4d')]){_0x517b8f[_0xf46f('0x4d')]={'id':_0x27f0cd['Trunk']['id'],'name':_0x27f0cd[_0xf46f('0x4d')]['name'],'active':_0x27f0cd[_0xf46f('0x4d')][_0xf46f('0x4e')],'callerid':_0x27f0cd[_0xf46f('0x4d')][_0xf46f('0x4f')]};}if(_0x27f0cd[_0xf46f('0x50')]){_0x517b8f[_0xf46f('0x50')]={'id':_0x27f0cd[_0xf46f('0x50')]['id'],'name':_0x27f0cd[_0xf46f('0x50')][_0xf46f('0x26')]};}var _0x54155a=md5(JSON[_0xf46f('0x51')](_0x517b8f));if(_0x27f0cd['md5']!==_0x54155a){_0x27f0cd[_0xf46f('0x5')]=_0x54155a;emit(util[_0xf46f('0x52')](_0xf46f('0x53'),_0x517b8f[_0xf46f('0x26')]),'voice_queue:save',_0x517b8f);}}}function emitVoiceQueueChannelRemove(_0x22e9c0){emit(util[_0xf46f('0x52')](_0xf46f('0x53'),_0x22e9c0[_0xf46f('0x26')]),_0xf46f('0x54'),_0x22e9c0);}function notSendMessagesQueue(_0xa66ee9){if(_0xa66ee9['sendMessageOneNotActive']){if(_0xa66ee9[_0xf46f('0x48')]===0x0&&_0xa66ee9[_0xf46f('0x29')]===0x0){_0xa66ee9[_0xf46f('0x55')]=![];_0xa66ee9[_0xf46f('0x56')]=0x0;_0xa66ee9['paused']=0x0;_0xa66ee9['message']=_0xf46f('0x57');ut['logger'](_0xf46f('0x58'),_0xa66ee9[_0xf46f('0x26')]+'\x20is\x20not\x20active');}else{_0xa66ee9[_0xf46f('0x47')]=_0xf46f('0x59');ut['logger']('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0xa66ee9[_0xf46f('0x26')]+_0xf46f('0x5a'));}emitCampaignPreview(_0xa66ee9);}}Preview[_0xf46f('0x5b')][_0xf46f('0x5c')]=function(){var _0x22f6e6=this;setInterval(function(){_0x22f6e6[_0xf46f('0x5d')]();},0x7cf);};Preview[_0xf46f('0x5b')][_0xf46f('0x5d')]=function(){var _0x268a11=this[_0xf46f('0x12')];this[_0xf46f('0x17')]+=0x1;for(var _0x5c0095 in _0x268a11){if(_0x268a11[_0xf46f('0x5e')](_0x5c0095)&&(_0x268a11[_0x5c0095][_0xf46f('0x32')]===_0xf46f('0x7')||_0x268a11[_0x5c0095][_0xf46f('0x32')]===_0xf46f('0x5f'))&&_0x268a11[_0x5c0095]['type']===_0xf46f('0x25')){if(this[_0xf46f('0x17')]>0x7){this['clockClearZombieChannels']=0x0;this[_0xf46f('0x60')]();}}if(_0x268a11[_0xf46f('0x5e')](_0x5c0095)&&_0x268a11[_0x5c0095][_0xf46f('0x32')]===_0xf46f('0x7')&&_0x268a11[_0x5c0095]['type']===_0xf46f('0x25')){if(_0x268a11[_0x5c0095][_0xf46f('0x61')]){this[_0xf46f('0x62')](_0x268a11[_0x5c0095]);this[_0xf46f('0x63')](_0x268a11[_0x5c0095]);}else{notSendMessagesQueue(_0x268a11[_0x5c0095]);}}}};Preview[_0xf46f('0x5b')]['clearZombieChannel']=function(_0x277b0c){var _0x1f9e66=this;this[_0xf46f('0x11')][_0xf46f('0x64')](function(){if(!_[_0xf46f('0x65')](_0x1f9e66['actions'][_0x277b0c])){loggerAction[_0xf46f('0x66')](_0xf46f('0x67'),_0x277b0c,_0xf46f('0x68'),_0x1f9e66['actions'][_0x277b0c][_0xf46f('0x69')],'originated:\x20',JSON['stringify'](_0x1f9e66['campaignsPreview'][_0x1f9e66[_0xf46f('0x15')][_0x277b0c]['queue']][_0xf46f('0x48')]),'pTalking:\x20',JSON['stringify'](_0x1f9e66['campaignsPreview'][_0x1f9e66['actions'][_0x277b0c][_0xf46f('0x69')]]['pTalking']),JSON[_0xf46f('0x51')](_0x1f9e66[_0xf46f('0x15')][_0x277b0c][_0xf46f('0x6a')]),JSON[_0xf46f('0x51')](_['pick'](_0x1f9e66[_0xf46f('0x15')][_0x277b0c],[_0xf46f('0x6b'),'UserId',_0xf46f('0x6c'),_0xf46f('0x6d')])));return ami[_0xf46f('0x6e')]({'action':_0xf46f('0x6f'),'channel':_0x1f9e66['actions'][_0x277b0c]['channel']})[_0xf46f('0x70')](function(_0x2f5ae3){if(_0x2f5ae3[_0xf46f('0x47')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x1f9e66[_0xf46f('0x15')][_0x277b0c]){ut[_0xf46f('0x71')](_0x1f9e66[_0xf46f('0x12')][_0x1f9e66[_0xf46f('0x15')][_0x277b0c]['queue']],_0xf46f('0x72'));if(_0x1f9e66[_0xf46f('0x15')][_0x277b0c][_0xf46f('0x6a')]===!![]){ut[_0xf46f('0x73')](_0x1f9e66[_0xf46f('0x12')][_0x1f9e66[_0xf46f('0x15')][_0x277b0c]['queue']],_0xf46f('0x72'));ut[_0xf46f('0x74')](_0xf46f('0x75')+_0x277b0c,_0x1f9e66[_0xf46f('0x15')][_0x277b0c][_0xf46f('0x69')]);}ut[_0xf46f('0x74')](_0xf46f('0x76')+_0x277b0c,_0x1f9e66['actions'][_0x277b0c][_0xf46f('0x69')]);delete _0x1f9e66[_0xf46f('0x15')][_0x277b0c];}},0x2328);}});}});};Preview[_0xf46f('0x5b')][_0xf46f('0x60')]=function(){var _0xabda70=this;loggerAction['info']('[action]',_[_0xf46f('0x77')](this['actions']));for(var _0x5e2be6 in this[_0xf46f('0x15')]){if(_0xabda70[_0xf46f('0x15')][_0xf46f('0x5e')](_0x5e2be6)){_0xabda70[_0xf46f('0x78')](_0x5e2be6);}}};Preview['prototype'][_0xf46f('0x63')]=function(_0x680857){var _0x41fca0=this;rpcDb['getContactRecallMe'](_0x680857['id'],ut[_0xf46f('0x79')](this['agents']))[_0xf46f('0x7a')](function(_0x111446){if(!_[_0xf46f('0x65')](_0x111446)){for(var _0x10cacb=0x0;_0x10cacb<_0x111446[_0xf46f('0x7b')];_0x10cacb+=0x1){if(ut[_0xf46f('0x7c')](_0x111446[_0x10cacb][_0xf46f('0x7d')])<_0x680857[_0xf46f('0x7e')]*0x3c){_0x41fca0['run'](_0x111446[_0x10cacb]['id'])[_0xf46f('0x7a')](ut[_0xf46f('0x7f')](_0xf46f('0x80')))[_0xf46f('0x70')](ut[_0xf46f('0x7f')]('[RecallMe]'));}else{var _0x164516=new Action(_0x111446[_0x10cacb],_0x680857);_0x164516[_0xf46f('0x81')]=moment()['format'](_0xf46f('0x82'));_0x680857['outboundReCallsDay']+=0x1;ut[_0xf46f('0x83')](_0x164516,0x17,_0xf46f('0x84'));if(_0x680857[_0xf46f('0x85')]){rpcDb[_0xf46f('0x86')](ut[_0xf46f('0x87')](_0x111446[_0x10cacb]));rpcDb['createCustomerHistory'](_0x164516,_0xf46f('0x88'));}else{ut[_0xf46f('0x83')](_0x164516,0x16,_0xf46f('0x89'));rpcDb[_0xf46f('0x8a')](_0x164516,_0xf46f('0x8b'));rpcDb['createCustomerFinal'](_0x164516,_0xf46f('0x8b'));}}}}})[_0xf46f('0x70')](ut[_0xf46f('0x7f')](_0xf46f('0x8c')));};Preview[_0xf46f('0x5b')]['setMessage']=function(_0x41d364){_0x41d364[_0xf46f('0x55')]=!![];if(ut[_0xf46f('0x8d')](_0x41d364['loggedIn'])){_0x41d364[_0xf46f('0x47')]=_0xf46f('0x8e');}else if(!ut['isActive'](_0x41d364[_0xf46f('0x61')])){_0x41d364[_0xf46f('0x47')]='NOT_ACTIVE';}else if(!this[_0xf46f('0x8f')](_0x41d364[_0xf46f('0x4d')])){if(!this['isTrunkReachable'](_0x41d364[_0xf46f('0x90')])){_0x41d364[_0xf46f('0x47')]=_0xf46f('0x91');}else{_0x41d364[_0xf46f('0x47')]=_0xf46f('0x92');}}else{_0x41d364['message']=_0xf46f('0x92');}emitCampaignPreview(_0x41d364);};Preview[_0xf46f('0x5b')][_0xf46f('0x93')]=function(_0x54fb3a,_0x56433c,_0x54cd59){var _0x42d114=this;var _0x1f0d26=this['actions'][_0x56433c];var _0x55a4d1=this[_0xf46f('0x12')][_0x1f0d26['queue']];var _0x12cfea;if(_0x55a4d1){switch(_0x54cd59){case'1':_0x55a4d1['outboundNoSuchCallsDay']+=0x1;_0x1f0d26['countglobal']=ut['totalGlobal'](_0x1f0d26);ut[_0xf46f('0x83')](_0x1f0d26,0x0,_0xf46f('0x94'));rpcDb[_0xf46f('0x8a')](_0x1f0d26,_0xf46f('0x95'));if(ut[_0xf46f('0x96')](_0x1f0d26)>=_0x55a4d1['dialGlobalMaxRetry']){_0x12cfea=ut['cloneAction'](_0x1f0d26,0xf,_0xf46f('0x97'));rpcDb[_0xf46f('0x98')](_0x12cfea,_0xf46f('0x99'));}else{rpcDb[_0xf46f('0x98')](_0x1f0d26,'[callProgressDetectingCustomer][logNoSuchGlobal]');}delete this[_0xf46f('0x15')][_0x54fb3a[_0xf46f('0x9a')]];break;case _0xf46f('0x9b'):var _0x536d8a=moment()[_0xf46f('0x52')](_0xf46f('0x82'));_0x1f0d26[_0xf46f('0x9c')]=_0x536d8a;_0x1f0d26[_0xf46f('0x9d')]=_0x536d8a;_0x1f0d26['dialAnswer']=!![];_0x55a4d1[_0xf46f('0x29')]+=0x1;logger[_0xf46f('0x66')](_0xf46f('0x9e'),_0x1f0d26[_0xf46f('0x9f')],_0xf46f('0xa0'),_0x55a4d1[_0xf46f('0x26')],'pTalking:\x20',_0x55a4d1['pTalking']);ami['emit'](_0xf46f('0xa1'),ut[_0xf46f('0xa2')](_0x1f0d26,_0xf46f('0xa3')));if(_0x55a4d1[_0xf46f('0xa4')]){ami[_0xf46f('0xa5')](_0xf46f('0xa6'),ut[_0xf46f('0xa7')](_0x1f0d26));}break;case'16':ami[_0xf46f('0xa5')]('custom:agentcomplete',ut[_0xf46f('0xa2')](_0x1f0d26,'complete'));emitVoiceQueueChannelRemove(ut[_0xf46f('0xa2')](_0x1f0d26,'complete'));_0x55a4d1['outboundAnswerCallsDay']+=0x1;_0x55a4d1[_0xf46f('0x2d')]+=0x1;_0x55a4d1['answered']+=0x1;ut['decrementTalkink'](_0x55a4d1,_0xf46f('0xa8'));_0x1f0d26['countglobal']=ut[_0xf46f('0x96')](_0x1f0d26);ut[_0xf46f('0x83')](_0x1f0d26,0x4,_0xf46f('0xa9'));rpcDb[_0xf46f('0x8a')](_0x1f0d26,_0xf46f('0xaa'));rpcDb['createCustomerFinal'](_0x1f0d26,_0xf46f('0xab'));rpcDb[_0xf46f('0xac')](_0x1f0d26);_0x55a4d1[_0xf46f('0x2b')]+=_0x1f0d26[_0xf46f('0xad')];_0x55a4d1[_0xf46f('0x2a')]+=_0x1f0d26[_0xf46f('0xad')];logger[_0xf46f('0x66')](_0xf46f('0xae'),_0x1f0d26[_0xf46f('0x9f')],_0xf46f('0xa0'),_0x55a4d1[_0xf46f('0x26')],'pTalking:\x20',_0x55a4d1[_0xf46f('0x29')]);delete this[_0xf46f('0x15')][_0x54fb3a[_0xf46f('0x9a')]];break;case'BUSY':_0x55a4d1['outboundBusyCallsDay']+=0x1;_0x1f0d26['countbusyretry']+=0x1;_0x1f0d26[_0xf46f('0xaf')]=ut[_0xf46f('0x96')](_0x1f0d26);ut[_0xf46f('0x83')](_0x1f0d26,0x5,_0xf46f('0xb0'));rpcDb[_0xf46f('0x8a')](_0x1f0d26,_0xf46f('0xb1'));if(ut[_0xf46f('0x96')](_0x1f0d26)>=_0x55a4d1['dialGlobalMaxRetry']){_0x12cfea=ut[_0xf46f('0xb2')](_0x1f0d26,0xf,_0xf46f('0x97'));rpcDb[_0xf46f('0x98')](_0x12cfea,_0xf46f('0xb3'));}else{if(_0x1f0d26[_0xf46f('0xb4')]>=_0x55a4d1[_0xf46f('0xb5')]){rpcDb[_0xf46f('0x98')](_0x1f0d26,_0xf46f('0xb1'));}else{rpcDb[_0xf46f('0xb6')](ut[_0xf46f('0xb7')](_0x1f0d26,_0xf46f('0xb4'),_0x55a4d1['dialBusyRetryFrequency']),_0x1f0d26['unlockAgent'],_0x1f0d26[_0xf46f('0xb8')]);}}break;case _0xf46f('0xb9'):_0x55a4d1[_0xf46f('0xba')]+=0x1;_0x1f0d26[_0xf46f('0xbb')]+=0x1;_0x1f0d26[_0xf46f('0xaf')]=ut[_0xf46f('0x96')](_0x1f0d26);ut[_0xf46f('0x83')](_0x1f0d26,0x3,_0xf46f('0xbc'));rpcDb[_0xf46f('0x8a')](_0x1f0d26,_0xf46f('0xbd'));if(ut[_0xf46f('0x96')](_0x1f0d26)>=_0x55a4d1['dialGlobalMaxRetry']){_0x12cfea=ut[_0xf46f('0xb2')](_0x1f0d26,0xf,_0xf46f('0x97'));rpcDb[_0xf46f('0x98')](_0x12cfea,_0xf46f('0xbe'));}else{if(_0x1f0d26[_0xf46f('0xbb')]>=_0x55a4d1[_0xf46f('0xbf')]){rpcDb[_0xf46f('0x98')](_0x1f0d26,'[callProgressDetectingCustomer][logNoAnswer]');}else{rpcDb[_0xf46f('0xb6')](ut[_0xf46f('0xb7')](_0x1f0d26,_0xf46f('0xbb'),_0x55a4d1[_0xf46f('0xc0')]),_0x1f0d26[_0xf46f('0xc1')],_0x1f0d26[_0xf46f('0xb8')]);}}break;case'CONGESTION':_0x55a4d1[_0xf46f('0x36')]+=0x1;_0x1f0d26[_0xf46f('0xc2')]+=0x1;_0x1f0d26['countglobal']=ut['totalGlobal'](_0x1f0d26);ut[_0xf46f('0x83')](_0x1f0d26,0x8,'Congestion');rpcDb[_0xf46f('0x8a')](_0x1f0d26,_0xf46f('0xc3'));if(ut['totalGlobal'](_0x1f0d26)>=_0x55a4d1[_0xf46f('0xc4')]){_0x12cfea=ut['cloneAction'](_0x1f0d26,0xf,'Global');rpcDb[_0xf46f('0x98')](_0x12cfea,_0xf46f('0xc5'));}else{if(_0x1f0d26['countcongestionretry']>=_0x55a4d1['dialCongestionMaxRetry']){rpcDb[_0xf46f('0x98')](_0x1f0d26,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0xf46f('0xb6')](ut['scheduledAt'](_0x1f0d26,_0xf46f('0xc2'),_0x55a4d1[_0xf46f('0xc6')]),_0x1f0d26[_0xf46f('0xc1')],_0x1f0d26['activeContact']);}}break;case'CANCEL':_0x55a4d1['outboundRejectCallsDay']+=0x1;_0x1f0d26[_0xf46f('0xaf')]=ut[_0xf46f('0x96')](_0x1f0d26);ut[_0xf46f('0x83')](_0x1f0d26,0x14,_0xf46f('0xc7'));rpcDb[_0xf46f('0x8a')](_0x1f0d26,'[syncHangupRequest][logAgentReject]');if(_0x1f0d26['unlockAgent']){rpcDb[_0xf46f('0xc8')](_0x1f0d26[_0xf46f('0xc9')]);}if(_0x1f0d26[_0xf46f('0xb8')]){rpcDb[_0xf46f('0xca')](_0x1f0d26['idContact']);}break;default:if(_0x1f0d26['dialAnswer']){ut[_0xf46f('0x73')](_0x55a4d1,_0xf46f('0xcb'));ut[_0xf46f('0x74')](_0xf46f('0xcc')+_0x55a4d1[_0xf46f('0x26')],_0x54fb3a);}_0x55a4d1[_0xf46f('0x3d')]+=0x1;_0x1f0d26[_0xf46f('0xaf')]=ut[_0xf46f('0x96')](_0x1f0d26);ut[_0xf46f('0x83')](_0x1f0d26,0xc,_0x54fb3a[_0xf46f('0xcd')]||_0x54fb3a[_0xf46f('0xce')]);rpcDb['createCustomerHistory'](_0x1f0d26,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0xf46f('0x96')](_0x1f0d26)>=_0x55a4d1[_0xf46f('0xc4')]){_0x12cfea=ut[_0xf46f('0xb2')](_0x1f0d26,0xf,_0xf46f('0x97'));rpcDb[_0xf46f('0x98')](_0x12cfea,_0xf46f('0xcf'));}else{rpcDb['createCustomerFinal'](_0x1f0d26,_0xf46f('0xcf'));}delete this[_0xf46f('0x15')][_0x54fb3a[_0xf46f('0x9a')]];}if(!(_0x1f0d26[_0xf46f('0x6a')]&&_0x54cd59==='16')){ut['updateOriginated'](_0x55a4d1,'[callProgressDetectingCustomer]');logger[_0xf46f('0x66')](_0xf46f('0xd0'),_0x1f0d26[_0xf46f('0x9f')],'\x20Queue',_0x55a4d1[_0xf46f('0x26')],_0xf46f('0xd1'),_0x55a4d1[_0xf46f('0x48')]);}if(_0x54cd59!==_0xf46f('0x9b')){delete this[_0xf46f('0x15')][_0x54fb3a[_0xf46f('0x9a')]];delete this[_0xf46f('0x15')][_0x54fb3a[_0xf46f('0xd2')]];}}};Preview[_0xf46f('0x5b')][_0xf46f('0xd3')]=function(_0x3a08b3,_0x40e41c,_0x577815){if(_[_0xf46f('0xd4')](_0x40e41c)&&_0xf46f('0xd5')!==typeof _0x40e41c){return;}if(_['isUndefined'](_0x577815)&&_0xf46f('0xd5')!==typeof _0x577815){return;}switch(_0x577815[_0xf46f('0xd6')]){case'0':ut['logAgent'](_0x3a08b3,0x0,_0xf46f('0x94'));rpcDb[_0xf46f('0xd7')](_0x3a08b3,_0xf46f('0xd8'));break;case'3':ut['logAgent'](_0x3a08b3,0x3,_0xf46f('0xbc'));rpcDb[_0xf46f('0xd7')](_0x3a08b3,_0xf46f('0xd9'));break;case'5':ut[_0xf46f('0xda')](_0x3a08b3,0x5,_0xf46f('0xb0'));rpcDb['createAgentHistory'](_0x3a08b3,_0xf46f('0xdb'));break;case'8':ut[_0xf46f('0xda')](_0x3a08b3,0x8,_0xf46f('0xdc'));rpcDb[_0xf46f('0xd7')](_0x3a08b3,_0xf46f('0xdd'));break;case'22':ut['logAgent'](_0x3a08b3,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x3a08b3,'[callProgressDetectingAgent][logAnswerAGI]');break;default:ut[_0xf46f('0xda')](_0x3a08b3,0xc,_0x577815[_0xf46f('0xd6')]);rpcDb['createAgentHistory'](_0x3a08b3,'[callProgressDetectingAgent][logCongestion]');}ut[_0xf46f('0x71')](_0x40e41c,'[callProgressDetectingAgent]');logger['info'](_0xf46f('0xde'),_0x3a08b3[_0xf46f('0x9f')],_0xf46f('0xa0'),_0x40e41c[_0xf46f('0x26')],_0xf46f('0xd1'),_0x40e41c[_0xf46f('0x48')]);delete this[_0xf46f('0x15')][_0x3a08b3[_0xf46f('0x9f')]];};Preview[_0xf46f('0x5b')][_0xf46f('0xdf')]=function(_0x557fb7,_0x44365c,_0x4d1bc9,_0x4a1994,_0x42c8f1){var _0xe7310a=this;return new BPromise(function(_0x5ef660,_0x5a025e){if(_[_0xf46f('0x65')](_0x44365c)||_[_0xf46f('0x65')](_0x44365c[_0xf46f('0xe0')])||_[_0xf46f('0x65')](_0x44365c[_0xf46f('0xe0')][_0xf46f('0xe1')])||_[_0xf46f('0x65')](_0x44365c['VoiceQueueId'])){_0x5a025e(ut['message'](_0xf46f('0xe2'),_0x4a1994,_0x42c8f1));return;}var _0x33e0a5=uuid['v4']();var _0x570848=_0xe7310a[_0xf46f('0x12')][_0x44365c[_0xf46f('0x68')][_0xf46f('0x26')]];var _0xb9a63=_0x4d1bc9?_0xe7310a['agents'][_0x4d1bc9]['id']:undefined;_0xe7310a[_0xf46f('0x15')][_0x33e0a5]=new Action(_0x44365c,_0x570848,_0x33e0a5,_0x4d1bc9,_0xb9a63);var _0x5ac60a=_0xe7310a[_0xf46f('0x15')][_0x33e0a5];_0x5ac60a[_0xf46f('0xc1')]=_0x4a1994;_0x5ac60a['activeContact']=_0x42c8f1;_0x5ac60a[_0xf46f('0xe3')]=_0x4d1bc9;if(_[_0xf46f('0xe4')](_0x557fb7)){_0xe7310a['execCall'](_0x5ac60a,_0x570848,_0x44365c,_0x4d1bc9)['then'](function(_0x5906ff){logger[_0xf46f('0x66')](_0xf46f('0xe5'),_0xf46f('0xe6')+_0x5ac60a[_0xf46f('0x69')]+_0xf46f('0xe7')+_0x5ac60a[_0xf46f('0xc9')],JSON[_0xf46f('0x51')](_0x5906ff));ami[_0xf46f('0xa5')](_0xf46f('0xe8'),ut[_0xf46f('0xa2')](_0x5ac60a,_0xf46f('0xe9')));_0x5ef660(ut[_0xf46f('0x47')]('Calling'));})[_0xf46f('0x70')](function(_0x5c8f46){ut[_0xf46f('0xea')](_0xf46f('0xeb'),_0x5c8f46);_0x5a025e(ut[_0xf46f('0x47')]('Call\x20failed',_0x4a1994,_0x42c8f1));});}else{_0x570848[_0xf46f('0xec')]+=0x1;ut[_0xf46f('0xed')](_0x5ac60a);rpcDb[_0xf46f('0xee')](_0x5ac60a,_0xf46f('0xef'));delete _0xe7310a[_0xf46f('0x15')][_0x33e0a5];_0x5a025e(ut['message']('Contact\x20in\x20black\x20List',_0x4a1994,_0x42c8f1));}});};Preview[_0xf46f('0x5b')][_0xf46f('0x8f')]=function(_0x113a5f){return!_[_0xf46f('0x65')](_0x113a5f)&&!_[_0xf46f('0x65')](_0x113a5f[_0xf46f('0x26')])&&!_[_0xf46f('0x65')](_0x113a5f[_0xf46f('0x4e')])&&_0x113a5f['active']&&!_[_0xf46f('0x65')](this['trunks'][util[_0xf46f('0x52')](_0xf46f('0xf0'),_0x113a5f[_0xf46f('0x26')])])&&!_[_0xf46f('0x65')](this['trunks'][util[_0xf46f('0x52')](_0xf46f('0xf0'),_0x113a5f[_0xf46f('0x26')])]['status'])&&(this[_0xf46f('0x14')][util[_0xf46f('0x52')](_0xf46f('0xf0'),_0x113a5f[_0xf46f('0x26')])]['status']===_0xf46f('0xf1')||this[_0xf46f('0x14')][util[_0xf46f('0x52')](_0xf46f('0xf0'),_0x113a5f[_0xf46f('0x26')])][_0xf46f('0x6f')]===_0xf46f('0xf2'));};Preview[_0xf46f('0x5b')][_0xf46f('0xf3')]=function(_0x3184d3,_0x4ceca0){var _0x4ad7e4=this;return new BPromise(function(_0xd07a93,_0x129295){_0x4ad7e4[_0xf46f('0xf4')](_0x3184d3,_0x4ceca0)[_0xf46f('0x7a')](function(_0x5c65d7){_0xd07a93(_[_0xf46f('0xf5')](_0x5c65d7,[_0xf46f('0x47')]));})['catch'](function(_0x461921){if(_0x461921[_0xf46f('0xf6')]){rpcDb['unlockContact'](_0x3184d3);}if(_0x461921[_0xf46f('0x4e')]){rpcDb['disableContact'](_0x3184d3);}_0x129295(_['pick'](_0x461921,[_0xf46f('0x47')]));});});};Preview['prototype'][_0xf46f('0xf4')]=function(_0x12c9bc,_0xa254cf){var _0x36ace8=this;return new BPromise(function(_0x7729b6,_0x384275){var _0x3198ad,_0x3d6934;rpcDb['getContactPreview'](_0x12c9bc)[_0xf46f('0x7a')](function(_0x48e7c7){if(!_[_0xf46f('0x65')](_0x48e7c7[0x0])){_0x3d6934=_0x48e7c7[0x0][_0xf46f('0xf7')]?![]:!![];_0x3198ad=_0x48e7c7[0x0][_0xf46f('0xf7')]?!![]:![];_0x3198ad=_0xa254cf?!![]:_0x3198ad;}var _0x1023de=_0x36ace8['validateContact'](_0x48e7c7);if(_0x1023de[_0xf46f('0xf8')]){rpcDb[_0xf46f('0xf9')](_[_0xf46f('0xf5')](_0x48e7c7[0x0],[_0xf46f('0x6c'),_0xf46f('0xfa')]))[_0xf46f('0x7a')](function(_0x352b9e){_0x36ace8['checkInBlack'](_0x352b9e,_0x48e7c7[0x0],_0xa254cf,_0x3d6934,_0x3198ad)[_0xf46f('0x7a')](function(_0x4eaa71){_0x7729b6(_0x4eaa71);})[_0xf46f('0x70')](function(_0x1b2fd3){_0x384275(_0x1b2fd3);});})[_0xf46f('0x70')](function(_0x56aaaa){ut[_0xf46f('0xea')](_0xf46f('0xfb'),_0x56aaaa);_0x384275(ut[_0xf46f('0x47')](_0xf46f('0xfc'),_0x3d6934,_0x3198ad));});}else{_0x384275(ut[_0xf46f('0x47')](_0x1023de[_0xf46f('0x47')],_0x3d6934,_0x3198ad));}})[_0xf46f('0x70')](function(_0x5d9459){ut['logger'](_0xf46f('0xfd'),_0x5d9459);_0x384275(ut[_0xf46f('0x47')](_0xf46f('0xfc'),![],!![]));});});};Preview[_0xf46f('0x5b')]['validateContact']=function(_0x434bf3){if(_[_0xf46f('0x65')](_0x434bf3)||_[_0xf46f('0xe4')](_0x434bf3)||!_[_0xf46f('0x65')](_0x434bf3[0x0][_0xf46f('0xfe')])&&_[_0xf46f('0x65')](_0x434bf3[0x0][_0xf46f('0xfe')][_0xf46f('0x26')])){ut['logger'](_0xf46f('0xff'),_0x434bf3);return{'isValid':![],'message':_0xf46f('0x100')};}var _0x5bac94=this['campaignsPreview'][_0x434bf3[0x0][_0xf46f('0x68')][_0xf46f('0x26')]];_0x5bac94['message']=_0xf46f('0x92');if(_[_0xf46f('0x65')](_0x5bac94)){ut[_0xf46f('0xea')]('[Preview][validateContact][Empty\x20Campaign]',_0x5bac94);return{'isValid':![],'message':_0xf46f('0x101')};}if(!this[_0xf46f('0x8f')](_0x5bac94['Trunk'])){ut[_0xf46f('0xea')](_0xf46f('0x102'),_0xf46f('0x103')+_0x5bac94[_0xf46f('0x26')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0xf46f('0x8f')](_0x5bac94[_0xf46f('0x90')])){ut[_0xf46f('0xea')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x5bac94[_0xf46f('0x26')]+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0xf46f('0x104')};}}if(!ut[_0xf46f('0x105')](_0x5bac94['dialActive'])){ut[_0xf46f('0xea')]('[Preview][validateContact][Campaign\x20Active]',_0x5bac94[_0xf46f('0x26')]+_0xf46f('0x106'));return{'isValid':![],'message':_0xf46f('0x103')+_0x5bac94['name']+_0xf46f('0x106')};}return{'isValid':!![],'message':_0xf46f('0x107')};};Preview[_0xf46f('0x5b')][_0xf46f('0x108')]=function(_0xa47ba,_0x211e02,_0x43cd0b,_0x1a7881){var _0x4ef2ff=this;return new BPromise(function(_0x3ccbc8,_0x14befb){var _0x5a97e8=_0xa47ba[_0xf46f('0x9f')];var _0x1fe17b=_0x4ef2ff[_0xf46f('0x8f')](_0x211e02[_0xf46f('0x4d')])?util[_0xf46f('0x52')]('SIP/%s/%s%s',_0x211e02[_0xf46f('0x4d')][_0xf46f('0x26')],_[_0xf46f('0x65')](_0x211e02[_0xf46f('0x109')])?'':_0x211e02[_0xf46f('0x109')]['trim']()||'',_0x211e02[_0xf46f('0x10a')]>0x0?_0x43cd0b['Contact'][_0xf46f('0xe1')][_0xf46f('0x10b')](_0x211e02[_0xf46f('0x10a')]):_0x43cd0b[_0xf46f('0xe0')]['phone']):util[_0xf46f('0x52')](_0xf46f('0x10c'),_['isNil'](_0x211e02[_0xf46f('0x90')])?_0x211e02[_0xf46f('0x4d')][_0xf46f('0x26')]:_0x211e02[_0xf46f('0x90')][_0xf46f('0x26')],_[_0xf46f('0x65')](_0x211e02[_0xf46f('0x109')])?'':_0x211e02[_0xf46f('0x109')][_0xf46f('0x10d')]()||'',_0x211e02[_0xf46f('0x10a')]>0x0?_0x43cd0b[_0xf46f('0xe0')]['phone']['substring'](_0x211e02[_0xf46f('0x10a')]):_0x43cd0b['Contact']['phone']);var _0x57c376=_0x4ef2ff['isTrunkReachable'](_0x211e02[_0xf46f('0x4d')])?ut[_0xf46f('0x10e')](_0x211e02['Trunk'][_0xf46f('0x4f')],_0x211e02[_0xf46f('0x33')],_0x211e02[_0xf46f('0x10f')]>0x0?ut[_0xf46f('0x110')](_0x211e02[_0xf46f('0x34')],_0x211e02['dialRandomLastDigitCallerIdNumber']):_0x211e02['dialOriginateCallerIdNumber']):ut[_0xf46f('0x10e')](_[_0xf46f('0x65')](_0x211e02[_0xf46f('0x90')])?_0x211e02[_0xf46f('0x4d')][_0xf46f('0x4f')]:_0x211e02[_0xf46f('0x90')][_0xf46f('0x4f')],_0x211e02['dialOriginateCallerIdName'],_0x211e02[_0xf46f('0x10f')]>0x0?ut[_0xf46f('0x110')](_0x211e02[_0xf46f('0x34')],_0x211e02[_0xf46f('0x10f')]):_0x211e02[_0xf46f('0x34')]);if(_0x57c376){_0xa47ba['originatecalleridname']=ut[_0xf46f('0x111')](_0x57c376);_0xa47ba[_0xf46f('0x112')]=ut[_0xf46f('0x113')](_0x57c376);}var _0x4d6d0f=ut[_0xf46f('0x114')](_0x211e02,_0x43cd0b,_0x1fe17b,_0x57c376,_0x5a97e8,_0xa47ba);_['merge'](_0xa47ba,ut[_0xf46f('0x115')](_0x4d6d0f));_0xa47ba[_0xf46f('0x81')]=moment()[_0xf46f('0x52')](_0xf46f('0x82'));ami[_0xf46f('0x6e')](ut['variablesAction'](_0xa47ba,_0x211e02,_0x4d6d0f,_0xa47ba[_0xf46f('0xb8')],_0x1a7881))[_0xf46f('0x7a')](function(_0x3a5916){_0x211e02[_0xf46f('0x48')]+=0x1;logger[_0xf46f('0x66')](_0xf46f('0x116'),_0x5a97e8,'\x20Queue',_0x211e02[_0xf46f('0x26')],_0xf46f('0xd1'),_0x211e02['originated']);_0x3ccbc8(_0x3a5916);})[_0xf46f('0x70')](function(_0x46fe54){ut['logAgent'](_0xa47ba,0xe,_0xf46f('0x117'));rpcDb['createAgentHistory'](_0xa47ba,_0xf46f('0x118'));_0x14befb(_0x46fe54);});});};Preview[_0xf46f('0x5b')][_0xf46f('0x119')]=function(_0x234c78){if(this[_0xf46f('0x15')][_0x234c78[_0xf46f('0x9a')]]){this[_0xf46f('0x15')][_0x234c78[_0xf46f('0x9a')]]['channel']=_0x234c78[_0xf46f('0x11a')];}};Preview[_0xf46f('0x5b')][_0xf46f('0x11b')]=function(_0x184e3e){var _0x417949=this;var _0x2c2940=this[_0xf46f('0x15')][_0x184e3e[_0xf46f('0x11c')]];if(_0x2c2940){if(_0x2c2940[_0xf46f('0xe3')]&&this[_0xf46f('0x16')][_0x2c2940[_0xf46f('0xe3')]]){ut[_0xf46f('0x11d')](_0x2c2940,this['agents'][_0x2c2940[_0xf46f('0xe3')]]['name'],this[_0xf46f('0x16')][_0x2c2940['lookAgent']]['id']);}var _0x55854c=_[_0xf46f('0x11e')](_0x2c2940);_0x55854c[_0xf46f('0x9c')]=moment()['format'](_0xf46f('0x82'));var _0x4c14cd=_0x417949[_0xf46f('0x12')][_0x2c2940[_0xf46f('0x69')]];if(ut[_0xf46f('0x11f')](_0x184e3e[_0xf46f('0x120')])){if(_0x2c2940['unlockAgent']){rpcDb[_0xf46f('0xc8')](_0x2c2940[_0xf46f('0xc9')]);}if(_0x2c2940[_0xf46f('0xb8')]){rpcDb[_0xf46f('0xca')](_0x2c2940[_0xf46f('0xc9')]);}ami[_0xf46f('0xa5')](_0xf46f('0x121'),ut[_0xf46f('0xa2')](_0x2c2940,_0xf46f('0x122')));this['callProgressDetectingAgent'](_0x55854c,_0x4c14cd,_0x184e3e);}else{_0x2c2940['starttime']=moment()[_0xf46f('0x52')]('YYYY-MM-DD\x20HH:mm:ss');ut[_0xf46f('0xda')](_0x55854c,0x4,_0xf46f('0xa9'));rpcDb['createAgentHistory'](_0x55854c,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0xf46f('0x5b')][_0xf46f('0x123')]=function(_0x12c351){var _0x23c72c=this;var _0x5bb8a5=this['actions'][_0x12c351[_0xf46f('0x9a')]];var _0x576624;if(_0x5bb8a5){_0x576624=this[_0xf46f('0x12')][_0x5bb8a5[_0xf46f('0x69')]];logger['info'](_0xf46f('0x124'),_0x12c351['linkedid'],_0xf46f('0xa0'),_0x576624[_0xf46f('0x26')],_0xf46f('0x125'),_0x576624[_0xf46f('0x29')]);}if(this[_0xf46f('0x15')][_0x12c351[_0xf46f('0x9a')]]&&_0x12c351[_0xf46f('0x9a')]!==_0x12c351['uniqueid']){if(_0x12c351[_0xf46f('0x126')]==='16'&&this[_0xf46f('0x15')][_0x12c351['linkedid']][_0xf46f('0x6a')]){this['callProgressDetectingCustomer'](_0x12c351,_0x12c351['linkedid'],_0x12c351[_0xf46f('0x126')]);}else if(this['actions'][_0x12c351['linkedid']][_0xf46f('0x6a')]){logger['info'](_0xf46f('0x127'),_0x12c351['linkedid'],_0x12c351[_0xf46f('0x126')],'\x20Queue',_0x576624[_0xf46f('0x26')],_0xf46f('0x125'),_0x576624[_0xf46f('0x29')]);this[_0xf46f('0x93')](_0x12c351,_0x12c351['linkedid'],_0x12c351[_0xf46f('0x126')]);}}else if(_0x5bb8a5&&_[_0xf46f('0x65')](_0x5bb8a5[_0xf46f('0x128')])&&_0x576624[_0xf46f('0x129')]&&_0x12c351[_0xf46f('0x9a')]===_0x12c351[_0xf46f('0x9f')]&&_[_0xf46f('0x65')](_0x12c351['reason'])&&_0x12c351[_0xf46f('0x126')]==='16'&&_0x12c351[_0xf46f('0x12a')]==='6'&&_[_0xf46f('0xd4')](_0x5bb8a5['transfer'])){if(_0x5bb8a5[_0xf46f('0xc1')]){rpcDb[_0xf46f('0xc8')](_0x5bb8a5[_0xf46f('0xc9')]);}if(_0x5bb8a5[_0xf46f('0xb8')]){rpcDb[_0xf46f('0xca')](_0x5bb8a5[_0xf46f('0xc9')]);}_0x12c351[_0xf46f('0xd6')]='22';this[_0xf46f('0xd3')](_0x5bb8a5,_0x576624,_0x12c351);}else if(_0x5bb8a5&&_0x5bb8a5[_0xf46f('0x12b')]){if(_0x12c351['cause']==='16'&&this[_0xf46f('0x15')][_0x12c351['linkedid']][_0xf46f('0x6a')]){logger[_0xf46f('0x66')]('[syncHangup][talking][transfer]',_0x12c351[_0xf46f('0x9a')],_0x12c351[_0xf46f('0x126')],_0xf46f('0xa0'),_0x576624[_0xf46f('0x26')],'pTalking:\x20',_0x576624['pTalking']);this[_0xf46f('0x93')](_0x12c351,_0x12c351[_0xf46f('0x9a')],_0x12c351['cause']);}else if(this[_0xf46f('0x15')][_0x12c351[_0xf46f('0x9a')]][_0xf46f('0x6a')]){logger[_0xf46f('0x66')](_0xf46f('0x127'),_0x12c351['linkedid'],_0x12c351[_0xf46f('0x126')],_0xf46f('0xa0'),_0x576624['name'],_0xf46f('0x125'),_0x576624['pTalking']);this['callProgressDetectingCustomer'](_0x12c351,_0x12c351[_0xf46f('0x9a')],_0x12c351[_0xf46f('0x126')]);}}};Preview[_0xf46f('0x5b')][_0xf46f('0x1d')]=function(_0x11dec4){if(this[_0xf46f('0x15')][_0x11dec4[_0xf46f('0xd2')]]&&_0x11dec4[_0xf46f('0xd2')]!==_0x11dec4['destuniqueid']){this[_0xf46f('0x93')](_0x11dec4,_0x11dec4[_0xf46f('0xd2')],_0x11dec4[_0xf46f('0xce')]);}};Preview[_0xf46f('0x5b')]['syncHangupRequest']=function(_0x59a21a){if(this[_0xf46f('0x15')][_0x59a21a[_0xf46f('0x9a')]]&&_0x59a21a[_0xf46f('0x9a')]!==_0x59a21a[_0xf46f('0x9f')]&&!this[_0xf46f('0x15')][_0x59a21a[_0xf46f('0x9a')]][_0xf46f('0x6a')]){if(_0x59a21a[_0xf46f('0x126')]==='1'){this[_0xf46f('0x93')](_0x59a21a,_0x59a21a[_0xf46f('0x9a')],_0x59a21a[_0xf46f('0x126')]);}}};Preview['prototype']['addVariable']=function(_0x2646ec,_0x14c4e3,_0x3cb8a2){if(this[_0xf46f('0x15')][_0x2646ec]){if(_['isNil'](this[_0xf46f('0x15')][_0x2646ec][_0xf46f('0x12c')])){this[_0xf46f('0x15')][_0x2646ec][_0xf46f('0x12c')]={};}this[_0xf46f('0x15')][_0x2646ec][_0xf46f('0x12c')][_0x14c4e3]=_0x3cb8a2;}};Preview[_0xf46f('0x5b')][_0xf46f('0x20')]=function(_0x3e71a7){try{if(!_[_0xf46f('0x65')](_0x3e71a7)){if(ut['filterKey'](_[_0xf46f('0x12d')](_0x3e71a7[_0xf46f('0x12e')])[0x0])){this['addVariable'](_0x3e71a7[_0xf46f('0x9f')],_[_0xf46f('0x12d')](_0x3e71a7[_0xf46f('0x12e')])[0x0],_0x3e71a7[_0xf46f('0x12f')]);}}}catch(_0x270565){logger[_0xf46f('0x130')]('[syncVarSet][Preview]',util[_0xf46f('0x131')](_0x270565,{'showHidden':![],'depth':null}));}};Preview[_0xf46f('0x5b')][_0xf46f('0x22')]=function(_0x578057){if(_0x578057){if(this[_0xf46f('0x15')][_0x578057[_0xf46f('0x132')]]){this[_0xf46f('0x15')][_0x578057[_0xf46f('0x132')]][_0xf46f('0x12b')]=!![];}}};Preview['prototype'][_0xf46f('0x24')]=function(_0x4c4d6c){if(_0x4c4d6c){if(this['actions'][_0x4c4d6c[_0xf46f('0x133')]]){this['actions'][_0x4c4d6c[_0xf46f('0x133')]]['transfer']=!![];}}};module[_0xf46f('0x134')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 62b57d9..3ebd09a 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 _0xa630=['getContactPreview','createAgentHistory','createCustomerHistory','rescheduleContact','UserId','active','[rescheduleContact]\x20','countReScheduled','[unlockContact]\x20','disableContact','unlockContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercompleteAt','endtime','connectedlinename','membername','from-sip','exten','assigned','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','bluebird','lodash','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','[createHistory]\x20','catch','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20'];(function(_0x3219e9,_0x31aa4e){var _0x1fbe22=function(_0x59d5aa){while(--_0x59d5aa){_0x3219e9['push'](_0x3219e9['shift']());}};_0x1fbe22(++_0x31aa4e);}(_0xa630,0xbe));var _0x0a63=function(_0x3e687d,_0x299d21){_0x3e687d=_0x3e687d-0x0;var _0x156cf1=_0xa630[_0x3e687d];return _0x156cf1;};'use strict';var util=require(_0x0a63('0x0'));var BPromise=require(_0x0a63('0x1'));var logger=require('../../../config/logger')('preview');var _=require(_0x0a63('0x2'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x0a63('0x3'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x0a63('0x4'));var voiceQueueRt=require(_0x0a63('0x5'));var agentReportPreview=require(_0x0a63('0x6'));var voiceQueueReport=require(_0x0a63('0x7'));function loggerCatch(_0x37b4c9){return function(_0x4b7474){logger[_0x0a63('0x8')](_0x37b4c9,util[_0x0a63('0x9')](_0x4b7474,{'showHidden':![],'depth':null}));};}function create(_0xc2dcd7){return BPromise[_0x0a63('0xa')]()[_0x0a63('0xb')](cmHopperHistory[_0x0a63('0xc')](_0xc2dcd7))['catch'](loggerCatch(_0x0a63('0xd')));}function createAgent(_0xb714c7){return BPromise[_0x0a63('0xa')]()[_0x0a63('0xb')](agentReportPreview[_0x0a63('0xc')](_0xb714c7))[_0x0a63('0xe')](loggerCatch(_0x0a63('0xd')));}function moveContact(_0x22f340){return BPromise[_0x0a63('0xa')]()[_0x0a63('0xb')](cmHopper['moveContactManagedDialer'](_0x22f340,!![]))[_0x0a63('0xe')](loggerCatch(_0x0a63('0xf')));}exports[_0x0a63('0x10')]=function(_0x3d6323){return BPromise['resolve']()[_0x0a63('0xb')](cmHopperBlack['checkIsBlackList'](_0x3d6323))[_0x0a63('0xe')](loggerCatch(_0x0a63('0x11')));};exports[_0x0a63('0x12')]=function(_0x23f8b5){return BPromise[_0x0a63('0xa')]()[_0x0a63('0xb')](cmHopper[_0x0a63('0x12')](_0x23f8b5))[_0x0a63('0xe')](loggerCatch('[getContactPreview]\x20'));};exports[_0x0a63('0xc')]=function(_0x56b314,_0x282856){create(_0x56b314)[_0x0a63('0xe')](loggerCatch(_0x282856));moveContact(_0x56b314)[_0x0a63('0xe')](loggerCatch(_0x282856));};exports[_0x0a63('0x13')]=function(_0x1f7481,_0x181507){createAgent(_0x1f7481)[_0x0a63('0xe')](loggerCatch(_0x181507));};exports[_0x0a63('0x14')]=function(_0x2fd06c,_0x3cc74d){create(_0x2fd06c)[_0x0a63('0xe')](loggerCatch(_0x3cc74d));};exports['createCustomerFinal']=function(_0x550568,_0x7b2ccd){moveContact(_0x550568)['catch'](loggerCatch(_0x7b2ccd));};exports[_0x0a63('0x15')]=function(_0x5937df,_0x58513d,_0x41d6b8){if(_0x58513d){_0x5937df[_0x0a63('0x16')]=null;}if(_0x41d6b8){_0x5937df[_0x0a63('0x17')]=![];}return BPromise['resolve']()[_0x0a63('0xb')](cmHopper['rescheduleContact'](_0x5937df))[_0x0a63('0xe')](loggerCatch(_0x0a63('0x18')));};exports[_0x0a63('0x19')]=function(_0x20c114){return BPromise[_0x0a63('0xa')]()[_0x0a63('0xb')](cmHopper[_0x0a63('0x19')](_0x20c114))[_0x0a63('0xe')](loggerCatch('[countReScheduled]\x20'));};exports['unlockContact']=function(_0x55fb70){return BPromise['resolve']()[_0x0a63('0xb')](cmHopper['unlockContact']({'UserId':null},_0x55fb70,0x1))['catch'](loggerCatch(_0x0a63('0x1a')));};exports[_0x0a63('0x1b')]=function(_0x362d6a){return BPromise[_0x0a63('0xa')]()['then'](cmHopper[_0x0a63('0x1c')]({'active':![]},_0x362d6a,0x1))[_0x0a63('0xe')](loggerCatch(_0x0a63('0x1d')));};exports['crateCustomerReportQueue']=function(_0x34239b){var _0xcf409={};_0xcf409[_0x0a63('0x1e')]=_0x34239b[_0x0a63('0x1e')];_0xcf409[_0x0a63('0x1f')]=_0x34239b[_0x0a63('0x1f')];_0xcf409[_0x0a63('0x20')]=_0x34239b[_0x0a63('0x20')];_0xcf409['calleridname']=_0x34239b[_0x0a63('0x21')];_0xcf409['queue']=_0x34239b[_0x0a63('0x22')];_0xcf409[_0x0a63('0x23')]=_0x34239b[_0x0a63('0x24')];_0xcf409[_0x0a63('0x25')]=_0x34239b[_0x0a63('0x24')];_0xcf409['queuecallercomplete']=0x1;_0xcf409[_0x0a63('0x26')]=_0x34239b[_0x0a63('0x27')];_0xcf409[_0x0a63('0x28')]=_0x34239b[_0x0a63('0x29')];_0xcf409['context']=_0x0a63('0x2a');_0xcf409[_0x0a63('0x2b')]='xcally-motion-preview';_0xcf409['holdtime']=0x0;_0xcf409[_0x0a63('0x2c')]=0x1;_0xcf409['lastAssignedTo']=_0x34239b['membername'];_0xcf409[_0x0a63('0x2d')]=_0x0a63('0x2e');return BPromise['resolve']()[_0x0a63('0xb')](voiceQueueReport[_0x0a63('0x2f')](_0xcf409))[_0x0a63('0xe')](loggerCatch(_0x0a63('0x30')));};exports[_0x0a63('0x31')]=function(_0x4dcacb,_0x5c7b56){return BPromise[_0x0a63('0xa')]()[_0x0a63('0xb')](cmHopper[_0x0a63('0x31')](_0x4dcacb,_0x5c7b56))[_0x0a63('0xe')](loggerCatch(_0x0a63('0x32')));};exports[_0x0a63('0x33')]=function(_0x59912d){return BPromise[_0x0a63('0xa')]()[_0x0a63('0xb')](cmHopper['rescheduleContact'](_0x59912d,!![],!![]))[_0x0a63('0xe')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file +var _0xb66c=['countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','context','from-sip','exten','holdtime','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','util','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','catch','[createHistory]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','createHistory','createAgentHistory','createCustomerHistory','createCustomerFinal','UserId','rescheduleContact','[rescheduleContact]\x20'];(function(_0x2b93d7,_0x34d841){var _0x57000b=function(_0x52c9c0){while(--_0x52c9c0){_0x2b93d7['push'](_0x2b93d7['shift']());}};_0x57000b(++_0x34d841);}(_0xb66c,0x175));var _0xcb66=function(_0x541cc6,_0x3a1f12){_0x541cc6=_0x541cc6-0x0;var _0x1ac83f=_0xb66c[_0x541cc6];return _0x1ac83f;};'use strict';var util=require(_0xcb66('0x0'));var BPromise=require('bluebird');var logger=require(_0xcb66('0x1'))('preview');var _=require(_0xcb66('0x2'));var cmHopper=require(_0xcb66('0x3'));var cmHopperFinal=require(_0xcb66('0x4'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0xcb66('0x5'));var voiceQueueRt=require(_0xcb66('0x6'));var agentReportPreview=require(_0xcb66('0x7'));var voiceQueueReport=require(_0xcb66('0x8'));function loggerCatch(_0x5d766d){return function(_0x518163){logger[_0xcb66('0x9')](_0x5d766d,util[_0xcb66('0xa')](_0x518163,{'showHidden':![],'depth':null}));};}function create(_0xa3993){return BPromise[_0xcb66('0xb')]()[_0xcb66('0xc')](cmHopperHistory['createHistory'](_0xa3993))[_0xcb66('0xd')](loggerCatch(_0xcb66('0xe')));}function createAgent(_0x174969){return BPromise[_0xcb66('0xb')]()[_0xcb66('0xc')](agentReportPreview['createHistory'](_0x174969))[_0xcb66('0xd')](loggerCatch(_0xcb66('0xe')));}function moveContact(_0xf12828){return BPromise[_0xcb66('0xb')]()['then'](cmHopper[_0xcb66('0xf')](_0xf12828,!![]))[_0xcb66('0xd')](loggerCatch(_0xcb66('0x10')));}exports[_0xcb66('0x11')]=function(_0x582523){return BPromise[_0xcb66('0xb')]()[_0xcb66('0xc')](cmHopperBlack[_0xcb66('0x11')](_0x582523))[_0xcb66('0xd')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xcb66('0x12')]=function(_0x540e7e){return BPromise[_0xcb66('0xb')]()['then'](cmHopper[_0xcb66('0x12')](_0x540e7e))['catch'](loggerCatch('[getContactPreview]\x20'));};exports[_0xcb66('0x13')]=function(_0x13cfea,_0x681ce3){create(_0x13cfea)[_0xcb66('0xd')](loggerCatch(_0x681ce3));moveContact(_0x13cfea)['catch'](loggerCatch(_0x681ce3));};exports[_0xcb66('0x14')]=function(_0x42ad03,_0x8a0f3f){createAgent(_0x42ad03)['catch'](loggerCatch(_0x8a0f3f));};exports[_0xcb66('0x15')]=function(_0x496d12,_0x4165ea){create(_0x496d12)[_0xcb66('0xd')](loggerCatch(_0x4165ea));};exports[_0xcb66('0x16')]=function(_0x1ccb71,_0x540782){moveContact(_0x1ccb71)['catch'](loggerCatch(_0x540782));};exports['rescheduleContact']=function(_0xb39b87,_0x4b13d4,_0x5e07e8){if(_0x4b13d4){_0xb39b87[_0xcb66('0x17')]=null;}if(_0x5e07e8){_0xb39b87['active']=![];}return BPromise[_0xcb66('0xb')]()[_0xcb66('0xc')](cmHopper[_0xcb66('0x18')](_0xb39b87))[_0xcb66('0xd')](loggerCatch(_0xcb66('0x19')));};exports[_0xcb66('0x1a')]=function(_0x3391a0){return BPromise['resolve']()[_0xcb66('0xc')](cmHopper['countReScheduled'](_0x3391a0))['catch'](loggerCatch(_0xcb66('0x1b')));};exports[_0xcb66('0x1c')]=function(_0x19da3b){return BPromise['resolve']()[_0xcb66('0xc')](cmHopper[_0xcb66('0x1c')]({'UserId':null},_0x19da3b,0x1))[_0xcb66('0xd')](loggerCatch(_0xcb66('0x1d')));};exports['disableContact']=function(_0x6661c4){return BPromise[_0xcb66('0xb')]()[_0xcb66('0xc')](cmHopper[_0xcb66('0x1c')]({'active':![]},_0x6661c4,0x1))[_0xcb66('0xd')](loggerCatch(_0xcb66('0x1e')));};exports[_0xcb66('0x1f')]=function(_0x967710){var _0x28fc0b={};_0x28fc0b[_0xcb66('0x20')]=_0x967710['type'];_0x28fc0b[_0xcb66('0x21')]=_0x967710['uniqueid'];_0x28fc0b['calleridnum']=_0x967710['calleridnum'];_0x28fc0b[_0xcb66('0x22')]=_0x967710['calleridname'];_0x28fc0b[_0xcb66('0x23')]=_0x967710[_0xcb66('0x23')];_0x28fc0b[_0xcb66('0x24')]=_0x967710['answertime'];_0x28fc0b[_0xcb66('0x25')]=_0x967710[_0xcb66('0x26')];_0x28fc0b[_0xcb66('0x27')]=0x1;_0x28fc0b[_0xcb66('0x28')]=_0x967710[_0xcb66('0x29')];_0x28fc0b[_0xcb66('0x2a')]=_0x967710[_0xcb66('0x2b')];_0x28fc0b[_0xcb66('0x2c')]=_0xcb66('0x2d');_0x28fc0b[_0xcb66('0x2e')]='xcally-motion-preview';_0x28fc0b[_0xcb66('0x2f')]=0x0;_0x28fc0b[_0xcb66('0x30')]=0x1;_0x28fc0b[_0xcb66('0x31')]=_0x967710[_0xcb66('0x2b')];_0x28fc0b[_0xcb66('0x32')]=_0xcb66('0x33');return BPromise[_0xcb66('0xb')]()['then'](voiceQueueReport[_0xcb66('0x34')](_0x28fc0b))[_0xcb66('0xd')](loggerCatch(_0xcb66('0x35')));};exports[_0xcb66('0x36')]=function(_0x4c97b4,_0x1a9545){return BPromise[_0xcb66('0xb')]()[_0xcb66('0xc')](cmHopper[_0xcb66('0x36')](_0x4c97b4,_0x1a9545))[_0xcb66('0xd')](loggerCatch(_0xcb66('0x37')));};exports[_0xcb66('0x38')]=function(_0x108898){return BPromise[_0xcb66('0xb')]()[_0xcb66('0xc')](cmHopper[_0xcb66('0x18')](_0x108898,!![],!![]))[_0xcb66('0xd')](loggerCatch('[rescheduleContactInQueue]\x20'));}; \ No newline at end of file diff --git a/server/services/ami/preview/util/util.js b/server/services/ami/preview/util/util.js index a2facc2..7d3fc30 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 _0xd634=['add','minutes','ContactId','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','buildAcw','interface','agentReadyId','not_inuse','status','reachable','push','CampaignId','filterKey','idContact','type','campaigntype','dialAnswer','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialtimeout','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosloss','bridgepeer','bridgepvtcallid','getCallerIdRandom','pow','random','extractCalleridName','match','extractCalleridNumber','util','lodash','moment','../../../../config/logger','preview','env','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','logger','info','inspect','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','Queue','name','calleridname','calleridnum','dialer','VoiceQueueId','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','monitor_format','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','createdAt','%s%s','XMD-','toUpper','toLowerVariables','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','error','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','starttime','responsetime','endtime','logAgent','logLookAgent','membername','logCustomer','talktime','answertime','isFailure','Failure','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','Global','scheduledAt','active','scheduledat'];(function(_0x4fa291,_0x56e289){var _0x506d9b=function(_0x24c31f){while(--_0x24c31f){_0x4fa291['push'](_0x4fa291['shift']());}};_0x506d9b(++_0x56e289);}(_0xd634,0x151));var _0x4d63=function(_0x34b87f,_0x28aef2){_0x34b87f=_0x34b87f-0x0;var _0x449805=_0xd634[_0x34b87f];return _0x449805;};'use strict';var util=require(_0x4d63('0x0'));var _=require(_0x4d63('0x1'));var moment=require(_0x4d63('0x2'));var logger=require(_0x4d63('0x3'))(_0x4d63('0x4'));var ipAgi=process[_0x4d63('0x5')][_0x4d63('0x6')]||_0x4d63('0x7');function getSeconds(_0x222f1a,_0x2a6971){var _0x5d61ca=moment(_0x222f1a)[_0x4d63('0x8')](0x0);var _0x2c5bc6=moment(_0x2a6971)[_0x4d63('0x8')](0x0);return _0x5d61ca[_0x4d63('0x9')](_0x2c5bc6,_0x4d63('0xa'));}exports[_0x4d63('0xb')]=function(_0x269b6b){return function(_0x1421d0){logger['error'](_0x269b6b,util['inspect'](_0x1421d0,{'showHidden':![],'depth':null}));};};exports[_0x4d63('0xc')]=function(_0x5b6421,_0x14175d){logger[_0x4d63('0xd')](_0x5b6421,util[_0x4d63('0xe')](_0x14175d,{'showHidden':![],'depth':null}));};exports[_0x4d63('0xf')]=function(_0x52af18,_0x998674){logger['error'](_0x52af18,util[_0x4d63('0xe')](_0x998674,{'showHidden':![],'depth':null}));};exports[_0x4d63('0x10')]=function(_0x5a90fe){return function(_0x4722e9){logger[_0x4d63('0xd')](_0x5a90fe,util[_0x4d63('0xe')](_0x4722e9,{'showHidden':![],'depth':null}));};};exports[_0x4d63('0x11')]=function(_0x8912bf,_0x6b3ae,_0x20485c){return{'message':_0x8912bf,'unlock':_0x6b3ae,'active':_0x20485c};};exports[_0x4d63('0x12')]=function(_0x215990,_0x8798f4,_0xe4e28f){if(!_[_0x4d63('0x13')](_0xe4e28f)&&_0x4d63('0x14')===typeof _0xe4e28f&&!_['isEmpty'](_0xe4e28f)){if(!_[_0x4d63('0x13')](_0x8798f4)&&_0x4d63('0x14')===typeof _0x8798f4&&!_[_0x4d63('0x15')](_0x8798f4)){return util[_0x4d63('0x16')](_0x4d63('0x17'),_0x8798f4,_0xe4e28f);}return util[_0x4d63('0x16')](_0x4d63('0x17'),_0xe4e28f,_0xe4e28f);}if(!_[_0x4d63('0x13')](_0x215990)&&_0x4d63('0x14')===typeof _0x215990&&!_[_0x4d63('0x15')](_0x215990)){return _0x215990;}return _0x4d63('0x18');};exports['isActive']=function(_0x3b2695){if(_['isNil'](_0x3b2695)){return![];}return _0x3b2695;};exports['addVariables']=function(_0x5a430c,_0x56e31d,_0x3d74b4,_0x230af4,_0x1f8ac1,_0x422de0){var _0x4d7dc4={'XMD-QUEUE':_0x56e31d[_0x4d63('0x19')]?_0x56e31d[_0x4d63('0x19')][_0x4d63('0x1a')]:'','XMD-CALLERID':_0x230af4,'XMD-CALLERID-PREVIEW':_0x422de0?util[_0x4d63('0x16')](_0x4d63('0x17'),_0x422de0[_0x4d63('0x1b')],_0x422de0[_0x4d63('0x1c')]):_0x230af4,'XMD-DIALID':_0x1f8ac1,'XMD-CONTACTID':_0x56e31d['ContactId'],'XMD-CDRTYPE':_0x4d63('0x1d'),'CALLERID(all)':_0x230af4,'XMD-VOICEQUEUEID':_0x56e31d[_0x4d63('0x1e')],'XMD-DIALCHANNEL':_0x3d74b4,'XMD-DIALTIMEOUT':_0x5a430c['dialOriginateTimeout']||0x1e,'XMD-DIALOPTIONS':util[_0x4d63('0x16')](_0x4d63('0x1f'),_0x5a430c[_0x4d63('0x20')]?'g':'',_['isEmpty'](_0x5a430c['monitor_format'])?'':_0x4d63('0x21')),'XMD-DIALURL':_0x5a430c[_0x4d63('0x22')]||'','XMD-AGI':_0x5a430c['dialQueueProject']?util[_0x4d63('0x16')](_0x4d63('0x23'),ipAgi,_0x5a430c['dialQueueProject']):_0x4d63('0x24'),'XMD-AGIAFTER':_0x5a430c[_0x4d63('0x20')]?util[_0x4d63('0x16')](_0x4d63('0x23'),ipAgi,_0x5a430c[_0x4d63('0x20')]):_0x4d63('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x422de0?_0x422de0[_0x4d63('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x422de0?_0x422de0[_0x4d63('0x26')]:'','XMD-DESTINATION':_0x4d63('0x27')};if(!_[_0x4d63('0x15')](_0x5a430c['monitor_format'])){_0x4d7dc4[util[_0x4d63('0x16')]('%s',_0x4d63('0x28'))]=_0x5a430c[_0x4d63('0x29')];_0x4d7dc4[util[_0x4d63('0x16')]('%s',_0x4d63('0x2a'))]=_0x1f8ac1;}if(_0x56e31d&&_0x56e31d[_0x4d63('0x2b')]){for(var _0x4ee7a5 in _0x56e31d[_0x4d63('0x2b')]){if(_0x56e31d['Contact'][_0x4d63('0x2c')](_0x4ee7a5)){if(!_[_0x4d63('0x2d')](_0x56e31d[_0x4d63('0x2b')][_0x4ee7a5])&&_0x4ee7a5!=='id'&&_0x4ee7a5!=='tags'&&_0x4ee7a5!==_0x4d63('0x2e')&&_0x4ee7a5!=='updatedAt'){_0x4d7dc4[util[_0x4d63('0x16')](_0x4d63('0x2f'),_0x4d63('0x30'),_[_0x4d63('0x31')](_0x4ee7a5))]=_0x56e31d['Contact'][_0x4ee7a5];}}}}return _0x4d7dc4;};exports[_0x4d63('0x32')]=function(_0xfab631){var _0x3480ce={};for(var _0x4ee12c in _0xfab631){if(_0xfab631[_0x4d63('0x2c')](_0x4ee12c)){_0x3480ce[util['format']('%s',_['toLower'](_0x4ee12c))]=_0xfab631[_0x4ee12c];}}return{'variables':_0x3480ce};};exports[_0x4d63('0x33')]=function(_0xe4ae35,_0x4f2f1e){if(!_[_0x4d63('0x2d')](_0xe4ae35)){if(_0xe4ae35[_0x4d63('0x2c')](_0x4d63('0x34'))){if(_0xe4ae35[_0x4d63('0x34')]>0x0){_0xe4ae35[_0x4d63('0x34')]-=0x1;}else{logger['error'](_0x4d63('0x35'),_0x4f2f1e);}}}else{logger[_0x4d63('0x36')](_0x4d63('0x37'),_0x4f2f1e);}};exports['logBlacklist']=function(_0x2dba14){var _0x2a73bd=moment()['format'](_0x4d63('0x38'));_0x2dba14[_0x4d63('0x39')]=0xd;_0x2dba14[_0x4d63('0x3a')]='Blacklist';_0x2dba14[_0x4d63('0x3b')]=_0x2a73bd;_0x2dba14[_0x4d63('0x3c')]=_0x2a73bd;_0x2dba14[_0x4d63('0x3d')]=_0x2a73bd;};exports[_0x4d63('0x3e')]=function(_0x4aa5b2,_0x3a4893,_0x2fc0fe){var _0x59b19a=moment()['format'](_0x4d63('0x38'));_0x4aa5b2['state']=_0x3a4893;_0x4aa5b2[_0x4d63('0x3a')]=_0x2fc0fe;_0x4aa5b2['responsetime']=_0x59b19a;_0x4aa5b2['ringtime']=getSeconds(_0x4aa5b2[_0x4d63('0x3c')],_0x4aa5b2[_0x4d63('0x3b')]);};exports[_0x4d63('0x3f')]=function(_0xb761ee,_0x135e89,_0x3451f7){_0xb761ee[_0x4d63('0x40')]=_0x135e89;_0xb761ee['UserId']=_0x3451f7;};exports[_0x4d63('0x41')]=function(_0x3f2c29,_0x37b2ac,_0x4cc52a){var _0x58df6c=moment()['format'](_0x4d63('0x38'));_0x3f2c29[_0x4d63('0x39')]=_0x37b2ac;_0x3f2c29[_0x4d63('0x3a')]=_0x4cc52a;_0x3f2c29[_0x4d63('0x3c')]=_0x3f2c29['responsetime']?_0x3f2c29[_0x4d63('0x3c')]:_0x58df6c;_0x3f2c29[_0x4d63('0x3d')]=_0x3f2c29[_0x4d63('0x3d')]?_0x3f2c29[_0x4d63('0x3d')]:_0x58df6c;_0x3f2c29['ringtime']=getSeconds(_0x3f2c29[_0x4d63('0x3c')]||0x0,_0x3f2c29[_0x4d63('0x3b')]||0x0);_0x3f2c29[_0x4d63('0x42')]=_0x3f2c29[_0x4d63('0x43')]?getSeconds(_0x3f2c29['endtime'],_0x3f2c29[_0x4d63('0x43')]):0x0;};exports[_0x4d63('0x44')]=function(_0xb55881){return _0xb55881===_0x4d63('0x45');};exports['variablesAction']=function(_0x215d7e,_0x300058,_0x247488,_0x2ce251,_0x34a6d3){var _0x43af19=_0x2ce251?_0x4d63('0x46'):_0x215d7e[_0x4d63('0x1b')];_0x43af19=_0x34a6d3?_0x4d63('0x47'):_0x43af19;return{'actionid':_0x215d7e[_0x4d63('0x48')],'action':_0x4d63('0x49'),'channel':_0x215d7e[_0x4d63('0x4a')],'callerid':util[_0x4d63('0x16')](_0x4d63('0x17'),_0x43af19,_0x215d7e['calleridnum']),'Exten':_0x4d63('0x27'),'Context':_0x4d63('0x4b'),'Priority':'1','variable':_0x247488,'timeout':(_0x300058[_0x4d63('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x215d7e[_0x4d63('0x48')]};};exports[_0x4d63('0x4d')]=function(_0x30ace9){return _0x30ace9[_0x4d63('0x4e')]+_0x30ace9[_0x4d63('0x4f')]+_0x30ace9[_0x4d63('0x50')];};exports[_0x4d63('0x51')]=function(_0x2ddf4a){var _0x31de25=_['clone'](_0x2ddf4a);_0x31de25[_0x4d63('0x39')]=0xf;_0x31de25[_0x4d63('0x3a')]=_0x4d63('0x52');return _0x31de25;};exports[_0x4d63('0x53')]=function(_0x1816b1,_0x17da4a,_0x3daaae){var _0x3e3a6b={};_0x3e3a6b[_0x17da4a]=_0x1816b1[_0x17da4a];_0x3e3a6b[_0x4d63('0x54')]=![];_0x3e3a6b[_0x4d63('0x55')]=moment()[_0x4d63('0x56')](_0x3daaae,_0x4d63('0x57'))[_0x4d63('0x16')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e3a6b['ContactId']=_0x1816b1[_0x4d63('0x58')];_0x3e3a6b[_0x4d63('0x59')]=_0x1816b1[_0x4d63('0x59')];_0x3e3a6b[_0x4d63('0x1e')]=_0x1816b1[_0x4d63('0x1e')]||undefined;return _0x3e3a6b;};exports[_0x4d63('0x5a')]=function(_0x35adb2,_0x5d4380){if(!_[_0x4d63('0x2d')](_0x35adb2)){if(_0x35adb2[_0x4d63('0x5b')]>0x0){_0x35adb2['pTalking']-=0x1;}else{logger[_0x4d63('0x36')](_0x5d4380,_0x4d63('0x5c'));}}else{logger[_0x4d63('0x36')](_0x5d4380,_0x4d63('0x5d'));}};exports[_0x4d63('0x5e')]=function(_0xdaa4f5){if(_0xdaa4f5<=0x0){return!![];}return![];};exports['buildObj']=function(_0x14bbcc,_0x267956){_0x14bbcc[_0x4d63('0x5f')]=_0x267956;_0x14bbcc['name']=_0x14bbcc[_0x4d63('0x60')];_0x14bbcc['interface']=_0x14bbcc['channelAgent'];return _0x14bbcc;};exports[_0x4d63('0x61')]=function(_0x386a23){var _0x24160f={};_0x24160f[_0x4d63('0x60')]=_0x386a23[_0x4d63('0x60')];_0x24160f[_0x4d63('0x62')]=_0x386a23[_0x4d63('0x4a')];_0x24160f[_0x4d63('0x48')]=_0x386a23[_0x4d63('0x48')];return _0x24160f;};exports[_0x4d63('0x63')]=function(_0x15c5af){var _0x370fea=[];for(var _0x244150 in _0x15c5af){if(_0x15c5af[_0x4d63('0x2c')](_0x244150)){if(!_[_0x4d63('0x2d')](_0x15c5af[_0x244150])&&_0x15c5af[_0x244150][_0x4d63('0x39')]===_0x4d63('0x64')&&_0x15c5af[_0x244150][_0x4d63('0x65')]===_0x4d63('0x66')){_0x370fea[_0x4d63('0x67')](_0x15c5af[_0x244150]['id']);}}}return _0x370fea;};exports['getDiff']=function(_0x1e0b29){var _0x1761d0=moment()[_0x4d63('0x8')](0x0);var _0xc33eb3=moment(_0x1e0b29)[_0x4d63('0x8')](0x0);return _0x1761d0[_0x4d63('0x9')](_0xc33eb3,'seconds');};exports['createBody']=function(_0x567c6d){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x567c6d[_0x4d63('0x58')],'ListId':_0x567c6d['ListId'],'VoiceQueueId':_0x567c6d['VoiceQueueId']||undefined,'CampaignId':_0x567c6d[_0x4d63('0x68')]||undefined};};exports[_0x4d63('0x69')]=function(_0x10f2fa){if(_0x10f2fa==='uniqueid'||_0x10f2fa===_0x4d63('0x6a')||_0x10f2fa===_0x4d63('0x60')||_0x10f2fa===_0x4d63('0x6b')||_0x10f2fa===_0x4d63('0x6c')||_0x10f2fa===_0x4d63('0x6d')||_0x10f2fa==='membername'||_0x10f2fa===_0x4d63('0x4a')||_0x10f2fa===_0x4d63('0x1b')||_0x10f2fa===_0x4d63('0x54')||_0x10f2fa===_0x4d63('0x1c')||_0x10f2fa===_0x4d63('0x55')||_0x10f2fa==='countbusyretry'||_0x10f2fa==='countcongestionretry'||_0x10f2fa===_0x4d63('0x50')||_0x10f2fa===_0x4d63('0x6e')||_0x10f2fa===_0x4d63('0x6f')||_0x10f2fa===_0x4d63('0x70')||_0x10f2fa===_0x4d63('0x71')||_0x10f2fa===_0x4d63('0x72')||_0x10f2fa==='ContactId'||_0x10f2fa==='ListId'||_0x10f2fa==='UserId'||_0x10f2fa===_0x4d63('0x1e')||_0x10f2fa===_0x4d63('0x73')||_0x10f2fa===_0x4d63('0x74')||_0x10f2fa==='xmd-queue'||_0x10f2fa===_0x4d63('0x75')||_0x10f2fa===_0x4d63('0x76')||_0x10f2fa==='xmd-dialurl'||_0x10f2fa===_0x4d63('0x77')||_0x10f2fa==='xmd-dialoptions'||_0x10f2fa==='xmd-dialid'||_0x10f2fa===_0x4d63('0x78')||_0x10f2fa===_0x4d63('0x79')||_0x10f2fa===_0x4d63('0x7a')||_0x10f2fa==='xmd-callerid'||_0x10f2fa===_0x4d63('0x7b')||_0x10f2fa===_0x4d63('0x7c')||_0x10f2fa==='rtpaudioqos'||_0x10f2fa===_0x4d63('0x7d')||_0x10f2fa==='rtpaudioqosjitter'||_0x10f2fa===_0x4d63('0x7e')||_0x10f2fa==='rtpaudioqosloss'||_0x10f2fa===_0x4d63('0x7f')||_0x10f2fa===_0x4d63('0x80')||_0x10f2fa===_0x4d63('0x81')||_0x10f2fa===_0x4d63('0x82')||_0x10f2fa===_0x4d63('0x7d')||_0x10f2fa===_0x4d63('0x83')||_0x10f2fa===_0x4d63('0x7e')||_0x10f2fa===_0x4d63('0x84')||_0x10f2fa===_0x4d63('0x7f')||_0x10f2fa===_0x4d63('0x80')||_0x10f2fa===_0x4d63('0x81')||_0x10f2fa===_0x4d63('0x85')||_0x10f2fa===_0x4d63('0x86')||_0x10f2fa===_0x4d63('0x39')||_0x10f2fa===_0x4d63('0x3a')){return![];}return!![];};exports[_0x4d63('0x87')]=function(_0x3939dc,_0x33985b){var _0x2c6df4,_0x2e5fb0,_0x20b8c4;if(_0x33985b<=0x0){_0x33985b=0x1;}_0x2c6df4=new RegExp('\x5cw{0,'+_0x33985b+'}$');_0x2e5fb0=Math[_0x4d63('0x88')](0xa,_0x33985b-0x1);_0x20b8c4=Math[_0x4d63('0x88')](0xa,_0x33985b)-0x1;return util['format']('%s',_['replace'](_0x3939dc,_0x2c6df4,_[_0x4d63('0x89')](_0x2e5fb0,_0x20b8c4)));};exports[_0x4d63('0x8a')]=function(_0x46c414){var _0x539264=_0x46c414[_0x4d63('0x8b')](/"(.*?)"/);return _0x539264?_0x539264[0x1]:_0x46c414;};exports[_0x4d63('0x8c')]=function(_0x55a1e5){var _0x38260c=_0x55a1e5[_0x4d63('0x8b')](/<(.*?)>/);return _0x38260c?_0x38260c[0x1]:_0x55a1e5;}; \ No newline at end of file +var _0xae53=['name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','U(xcally-mixmonitor-context)','dialPreviewUrl','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','monitor_format','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','tags','updatedAt','%s%s','toUpper','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','ringtime','logLookAgent','membername','UserId','logCustomer','responsetime','talktime','answertime','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','timeout','totalGlobal','countcongestionretry','clone','Global','scheduledAt','active','scheduledat','add','minutes','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','buildObj','lastevent','channelAgent','buildAcw','queue','interface','agentReadyId','not_inuse','reachable','push','milliseconds','filterKey','campaigntype','dialAnswer','countbusyretry','countnoanswerretry','countglobal','callback','callbackuniqueid','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','\x5cw{0,','pow','replace','extractCalleridName','match','util','moment','../../../../config/logger','preview','XCALLY_IP_AGI','127.0.0.1','diff','seconds','loggerCatch','error','inspect','logger','loggerError','logger2','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','isNil','addVariables','Queue'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0xae53,0x16e));var _0x3ae5=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0xae53[_0x29d94e];return _0x106237;};'use strict';var util=require(_0x3ae5('0x0'));var _=require('lodash');var moment=require(_0x3ae5('0x1'));var logger=require(_0x3ae5('0x2'))(_0x3ae5('0x3'));var ipAgi=process['env'][_0x3ae5('0x4')]||_0x3ae5('0x5');function getSeconds(_0x293589,_0x476756){var _0x2ce09f=moment(_0x293589)['milliseconds'](0x0);var _0x1ca6ea=moment(_0x476756)['milliseconds'](0x0);return _0x2ce09f[_0x3ae5('0x6')](_0x1ca6ea,_0x3ae5('0x7'));}exports[_0x3ae5('0x8')]=function(_0x3fdf89){return function(_0x246603){logger[_0x3ae5('0x9')](_0x3fdf89,util[_0x3ae5('0xa')](_0x246603,{'showHidden':![],'depth':null}));};};exports[_0x3ae5('0xb')]=function(_0x4c77b5,_0xbd3c3e){logger['info'](_0x4c77b5,util[_0x3ae5('0xa')](_0xbd3c3e,{'showHidden':![],'depth':null}));};exports[_0x3ae5('0xc')]=function(_0x315476,_0x11bc49){logger[_0x3ae5('0x9')](_0x315476,util['inspect'](_0x11bc49,{'showHidden':![],'depth':null}));};exports[_0x3ae5('0xd')]=function(_0x2000ac){return function(_0x426238){logger['info'](_0x2000ac,util['inspect'](_0x426238,{'showHidden':![],'depth':null}));};};exports[_0x3ae5('0xe')]=function(_0x5943e6,_0x8627d8,_0x28c265){return{'message':_0x5943e6,'unlock':_0x8627d8,'active':_0x28c265};};exports[_0x3ae5('0xf')]=function(_0x45175c,_0x352f36,_0x5d2564){if(!_[_0x3ae5('0x10')](_0x5d2564)&&_0x3ae5('0x11')===typeof _0x5d2564&&!_[_0x3ae5('0x12')](_0x5d2564)){if(!_['isUndefined'](_0x352f36)&&'string'===typeof _0x352f36&&!_[_0x3ae5('0x12')](_0x352f36)){return util[_0x3ae5('0x13')](_0x3ae5('0x14'),_0x352f36,_0x5d2564);}return util[_0x3ae5('0x13')](_0x3ae5('0x14'),_0x5d2564,_0x5d2564);}if(!_[_0x3ae5('0x10')](_0x45175c)&&_0x3ae5('0x11')===typeof _0x45175c&&!_['isEmpty'](_0x45175c)){return _0x45175c;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x150ff1){if(_[_0x3ae5('0x15')](_0x150ff1)){return![];}return _0x150ff1;};exports[_0x3ae5('0x16')]=function(_0x42357e,_0xb81b98,_0x211dff,_0x1ae5e1,_0x533971,_0xd4e7c5){var _0x1078a0={'XMD-QUEUE':_0xb81b98[_0x3ae5('0x17')]?_0xb81b98[_0x3ae5('0x17')][_0x3ae5('0x18')]:'','XMD-CALLERID':_0x1ae5e1,'XMD-CALLERID-PREVIEW':_0xd4e7c5?util[_0x3ae5('0x13')]('\x22%s\x22\x20<%s>',_0xd4e7c5['calleridname'],_0xd4e7c5[_0x3ae5('0x19')]):_0x1ae5e1,'XMD-DIALID':_0x533971,'XMD-CONTACTID':_0xb81b98[_0x3ae5('0x1a')],'XMD-CDRTYPE':_0x3ae5('0x1b'),'CALLERID(all)':_0x1ae5e1,'XMD-VOICEQUEUEID':_0xb81b98[_0x3ae5('0x1c')],'XMD-DIALCHANNEL':_0x211dff,'XMD-DIALTIMEOUT':_0x42357e[_0x3ae5('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0x3ae5('0x13')](_0x3ae5('0x1e'),_0x42357e[_0x3ae5('0x1f')]?'g':'',_[_0x3ae5('0x12')](_0x42357e['monitor_format'])?'':_0x3ae5('0x20')),'XMD-DIALURL':_0x42357e[_0x3ae5('0x21')]||'','XMD-AGI':_0x42357e[_0x3ae5('0x22')]?util['format'](_0x3ae5('0x23'),ipAgi,_0x42357e[_0x3ae5('0x22')]):_0x3ae5('0x24'),'XMD-AGIAFTER':_0x42357e[_0x3ae5('0x1f')]?util[_0x3ae5('0x13')]('\x22agi://%s/square,%s\x22',ipAgi,_0x42357e[_0x3ae5('0x1f')]):_0x3ae5('0x24'),'XMD-ORIGINATECALLERIDNUM':_0xd4e7c5?_0xd4e7c5[_0x3ae5('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0xd4e7c5?_0xd4e7c5[_0x3ae5('0x26')]:'','XMD-DESTINATION':_0x3ae5('0x27')};if(!_[_0x3ae5('0x12')](_0x42357e[_0x3ae5('0x28')])){_0x1078a0[util['format']('%s',_0x3ae5('0x29'))]=_0x42357e[_0x3ae5('0x28')];_0x1078a0[util[_0x3ae5('0x13')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x533971;}if(_0xb81b98&&_0xb81b98[_0x3ae5('0x2a')]){for(var _0xfda404 in _0xb81b98[_0x3ae5('0x2a')]){if(_0xb81b98[_0x3ae5('0x2a')][_0x3ae5('0x2b')](_0xfda404)){if(!_[_0x3ae5('0x15')](_0xb81b98[_0x3ae5('0x2a')][_0xfda404])&&_0xfda404!=='id'&&_0xfda404!==_0x3ae5('0x2c')&&_0xfda404!=='createdAt'&&_0xfda404!==_0x3ae5('0x2d')){_0x1078a0[util[_0x3ae5('0x13')](_0x3ae5('0x2e'),'XMD-',_[_0x3ae5('0x2f')](_0xfda404))]=_0xb81b98['Contact'][_0xfda404];}}}}return _0x1078a0;};exports['toLowerVariables']=function(_0x5bf789){var _0x40d60a={};for(var _0x2a509a in _0x5bf789){if(_0x5bf789[_0x3ae5('0x2b')](_0x2a509a)){_0x40d60a[util[_0x3ae5('0x13')]('%s',_['toLower'](_0x2a509a))]=_0x5bf789[_0x2a509a];}}return{'variables':_0x40d60a};};exports['updateOriginated']=function(_0x3de961,_0x48e347){if(!_[_0x3ae5('0x15')](_0x3de961)){if(_0x3de961[_0x3ae5('0x2b')](_0x3ae5('0x30'))){if(_0x3de961['originated']>0x0){_0x3de961[_0x3ae5('0x30')]-=0x1;}else{logger[_0x3ae5('0x9')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x48e347);}}}else{logger['error'](_0x3ae5('0x31'),_0x48e347);}};exports['logBlacklist']=function(_0x424743){var _0x457e8d=moment()[_0x3ae5('0x13')](_0x3ae5('0x32'));_0x424743[_0x3ae5('0x33')]=0xd;_0x424743[_0x3ae5('0x34')]=_0x3ae5('0x35');_0x424743[_0x3ae5('0x36')]=_0x457e8d;_0x424743['responsetime']=_0x457e8d;_0x424743[_0x3ae5('0x37')]=_0x457e8d;};exports['logAgent']=function(_0x2428a9,_0x4417d5,_0x283b4e){var _0x5f6616=moment()[_0x3ae5('0x13')](_0x3ae5('0x32'));_0x2428a9[_0x3ae5('0x33')]=_0x4417d5;_0x2428a9['statedesc']=_0x283b4e;_0x2428a9['responsetime']=_0x5f6616;_0x2428a9[_0x3ae5('0x38')]=getSeconds(_0x2428a9['responsetime'],_0x2428a9[_0x3ae5('0x36')]);};exports[_0x3ae5('0x39')]=function(_0x4003e5,_0xf64929,_0x4cfbb8){_0x4003e5[_0x3ae5('0x3a')]=_0xf64929;_0x4003e5[_0x3ae5('0x3b')]=_0x4cfbb8;};exports[_0x3ae5('0x3c')]=function(_0x1d5ced,_0x329ff9,_0x377095){var _0x258961=moment()[_0x3ae5('0x13')](_0x3ae5('0x32'));_0x1d5ced[_0x3ae5('0x33')]=_0x329ff9;_0x1d5ced[_0x3ae5('0x34')]=_0x377095;_0x1d5ced['responsetime']=_0x1d5ced[_0x3ae5('0x3d')]?_0x1d5ced[_0x3ae5('0x3d')]:_0x258961;_0x1d5ced[_0x3ae5('0x37')]=_0x1d5ced[_0x3ae5('0x37')]?_0x1d5ced[_0x3ae5('0x37')]:_0x258961;_0x1d5ced[_0x3ae5('0x38')]=getSeconds(_0x1d5ced['responsetime']||0x0,_0x1d5ced[_0x3ae5('0x36')]||0x0);_0x1d5ced[_0x3ae5('0x3e')]=_0x1d5ced['answertime']?getSeconds(_0x1d5ced[_0x3ae5('0x37')],_0x1d5ced[_0x3ae5('0x3f')]):0x0;};exports['isFailure']=function(_0x212979){return _0x212979===_0x3ae5('0x40');};exports[_0x3ae5('0x41')]=function(_0x1c25c4,_0xff69f3,_0x2cbc59,_0x5d6fb8,_0x59eccb){var _0x3ba9f9=_0x5d6fb8?_0x3ae5('0x42'):_0x1c25c4['calleridname'];_0x3ba9f9=_0x59eccb?_0x3ae5('0x43'):_0x3ba9f9;return{'actionid':_0x1c25c4[_0x3ae5('0x44')],'action':_0x3ae5('0x45'),'channel':_0x1c25c4['channelAgent'],'callerid':util[_0x3ae5('0x13')](_0x3ae5('0x14'),_0x3ba9f9,_0x1c25c4[_0x3ae5('0x19')]),'Exten':_0x3ae5('0x27'),'Context':'from-sip','Priority':'1','variable':_0x2cbc59,'timeout':(_0xff69f3[_0x3ae5('0x46')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1c25c4[_0x3ae5('0x44')]};};exports[_0x3ae5('0x47')]=function(_0x379683){return _0x379683['countbusyretry']+_0x379683[_0x3ae5('0x48')]+_0x379683['countnoanswerretry'];};exports['cloneAction']=function(_0x1ee925){var _0x264dea=_[_0x3ae5('0x49')](_0x1ee925);_0x264dea['state']=0xf;_0x264dea[_0x3ae5('0x34')]=_0x3ae5('0x4a');return _0x264dea;};exports[_0x3ae5('0x4b')]=function(_0x71d0d6,_0x2b899c,_0x34beee){var _0x304182={};_0x304182[_0x2b899c]=_0x71d0d6[_0x2b899c];_0x304182[_0x3ae5('0x4c')]=![];_0x304182[_0x3ae5('0x4d')]=moment()[_0x3ae5('0x4e')](_0x34beee,_0x3ae5('0x4f'))[_0x3ae5('0x13')](_0x3ae5('0x32'));_0x304182[_0x3ae5('0x1a')]=_0x71d0d6['ContactId'];_0x304182[_0x3ae5('0x50')]=_0x71d0d6[_0x3ae5('0x50')];_0x304182[_0x3ae5('0x1c')]=_0x71d0d6[_0x3ae5('0x1c')]||undefined;return _0x304182;};exports[_0x3ae5('0x51')]=function(_0x3735d7,_0x3ddb15){if(!_[_0x3ae5('0x15')](_0x3735d7)){if(_0x3735d7[_0x3ae5('0x52')]>0x0){_0x3735d7['pTalking']-=0x1;}else{logger[_0x3ae5('0x9')](_0x3ddb15,_0x3ae5('0x53'));}}else{logger[_0x3ae5('0x9')](_0x3ddb15,_0x3ae5('0x54'));}};exports['IsNotLoggedIn']=function(_0x1b3826){if(_0x1b3826<=0x0){return!![];}return![];};exports[_0x3ae5('0x55')]=function(_0x286f98,_0x4a7320){_0x286f98[_0x3ae5('0x56')]=_0x4a7320;_0x286f98[_0x3ae5('0x18')]=_0x286f98['queue'];_0x286f98['interface']=_0x286f98[_0x3ae5('0x57')];return _0x286f98;};exports[_0x3ae5('0x58')]=function(_0x34be3d){var _0x5808b3={};_0x5808b3[_0x3ae5('0x59')]=_0x34be3d[_0x3ae5('0x59')];_0x5808b3[_0x3ae5('0x5a')]=_0x34be3d[_0x3ae5('0x57')];_0x5808b3[_0x3ae5('0x44')]=_0x34be3d[_0x3ae5('0x44')];return _0x5808b3;};exports[_0x3ae5('0x5b')]=function(_0x23e9fa){var _0x3e3f73=[];for(var _0x32ecac in _0x23e9fa){if(_0x23e9fa[_0x3ae5('0x2b')](_0x32ecac)){if(!_['isNil'](_0x23e9fa[_0x32ecac])&&_0x23e9fa[_0x32ecac][_0x3ae5('0x33')]===_0x3ae5('0x5c')&&_0x23e9fa[_0x32ecac]['status']===_0x3ae5('0x5d')){_0x3e3f73[_0x3ae5('0x5e')](_0x23e9fa[_0x32ecac]['id']);}}}return _0x3e3f73;};exports['getDiff']=function(_0x340b42){var _0x4cf4b3=moment()[_0x3ae5('0x5f')](0x0);var _0x4f463a=moment(_0x340b42)['milliseconds'](0x0);return _0x4cf4b3['diff'](_0x4f463a,'seconds');};exports['createBody']=function(_0x5e7d97){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5e7d97[_0x3ae5('0x1a')],'ListId':_0x5e7d97[_0x3ae5('0x50')],'VoiceQueueId':_0x5e7d97[_0x3ae5('0x1c')]||undefined,'CampaignId':_0x5e7d97['CampaignId']||undefined};};exports[_0x3ae5('0x60')]=function(_0x219ac5){if(_0x219ac5===_0x3ae5('0x44')||_0x219ac5==='idContact'||_0x219ac5==='queue'||_0x219ac5==='type'||_0x219ac5===_0x3ae5('0x61')||_0x219ac5===_0x3ae5('0x62')||_0x219ac5===_0x3ae5('0x3a')||_0x219ac5==='channelAgent'||_0x219ac5==='calleridname'||_0x219ac5===_0x3ae5('0x4c')||_0x219ac5===_0x3ae5('0x19')||_0x219ac5==='scheduledat'||_0x219ac5===_0x3ae5('0x63')||_0x219ac5==='countcongestionretry'||_0x219ac5===_0x3ae5('0x64')||_0x219ac5===_0x3ae5('0x65')||_0x219ac5===_0x3ae5('0x66')||_0x219ac5===_0x3ae5('0x67')||_0x219ac5==='callbackat'||_0x219ac5==='recallme'||_0x219ac5===_0x3ae5('0x1a')||_0x219ac5===_0x3ae5('0x50')||_0x219ac5===_0x3ae5('0x3b')||_0x219ac5===_0x3ae5('0x1c')||_0x219ac5===_0x3ae5('0x68')||_0x219ac5===_0x3ae5('0x69')||_0x219ac5===_0x3ae5('0x6a')||_0x219ac5===_0x3ae5('0x6b')||_0x219ac5===_0x3ae5('0x6c')||_0x219ac5===_0x3ae5('0x6d')||_0x219ac5===_0x3ae5('0x6e')||_0x219ac5==='xmd-dialoptions'||_0x219ac5===_0x3ae5('0x6f')||_0x219ac5===_0x3ae5('0x70')||_0x219ac5===_0x3ae5('0x71')||_0x219ac5==='xmd-cdrtype'||_0x219ac5===_0x3ae5('0x72')||_0x219ac5===_0x3ae5('0x73')||_0x219ac5===_0x3ae5('0x74')||_0x219ac5===_0x3ae5('0x75')||_0x219ac5===_0x3ae5('0x76')||_0x219ac5===_0x3ae5('0x77')||_0x219ac5===_0x3ae5('0x78')||_0x219ac5===_0x3ae5('0x79')||_0x219ac5===_0x3ae5('0x7a')||_0x219ac5===_0x3ae5('0x7b')||_0x219ac5===_0x3ae5('0x7c')||_0x219ac5===_0x3ae5('0x75')||_0x219ac5===_0x3ae5('0x76')||_0x219ac5===_0x3ae5('0x77')||_0x219ac5===_0x3ae5('0x78')||_0x219ac5==='rtpaudioqosloss'||_0x219ac5===_0x3ae5('0x7a')||_0x219ac5===_0x3ae5('0x7b')||_0x219ac5==='rtpaudioqosrttbridged'||_0x219ac5==='bridgepeer'||_0x219ac5==='bridgepvtcallid'||_0x219ac5===_0x3ae5('0x33')||_0x219ac5===_0x3ae5('0x34')){return![];}return!![];};exports['getCallerIdRandom']=function(_0x3a274c,_0x42c071){var _0x43af6a,_0x479b73,_0x4ef630;if(_0x42c071<=0x0){_0x42c071=0x1;}_0x43af6a=new RegExp(_0x3ae5('0x7d')+_0x42c071+'}$');_0x479b73=Math['pow'](0xa,_0x42c071-0x1);_0x4ef630=Math[_0x3ae5('0x7e')](0xa,_0x42c071)-0x1;return util['format']('%s',_[_0x3ae5('0x7f')](_0x3a274c,_0x43af6a,_['random'](_0x479b73,_0x4ef630)));};exports[_0x3ae5('0x80')]=function(_0x52d3a0){var _0x51b644=_0x52d3a0[_0x3ae5('0x81')](/"(.*?)"/);return _0x51b644?_0x51b644[0x1]:_0x52d3a0;};exports['extractCalleridNumber']=function(_0xee4a75){var _0x7d6587=_0xee4a75[_0x3ae5('0x81')](/<(.*?)>/);return _0x7d6587?_0x7d6587[0x1]:_0xee4a75;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index cbd413f..7cdfc55 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(_0x4413a2,_0x343691){var _0xf7cc0e=function(_0x3b7022){while(--_0x3b7022){_0x4413a2['push'](_0x4413a2['shift']());}};_0xf7cc0e(++_0x343691);}(_0x5f2f,0x73));var _0xf5f2=function(_0x10ceef,_0x290db3){_0x10ceef=_0x10ceef-0x0;var _0x1eb48d=_0x5f2f[_0x10ceef];return _0x1eb48d;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0xb10b=['voicequeuechannelhangup','queueadd','string','number','queueremove','queuepause','boolean','reload','voicechannel'];(function(_0x3447d5,_0x4250ac){var _0x20250b=function(_0x4864de){while(--_0x4864de){_0x3447d5['push'](_0x3447d5['shift']());}};_0x20250b(++_0x4250ac);}(_0xb10b,0x12a));var _0xbb10=function(_0x3bb21a,_0x353b56){_0x3bb21a=_0x3bb21a-0x0;var _0x5f3983=_0xb10b[_0x3bb21a];return _0x5f3983;};'use strict';exports[_0xbb10('0x0')]={'queue':{'type':'string','required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]},'membername':{'type':_0xbb10('0x1'),'required':!![]},'penalty':{'type':_0xbb10('0x2'),'required':![]},'paused':{'type':'boolean','required':![]}};exports[_0xbb10('0x3')]={'queue':{'type':_0xbb10('0x1'),'required':!![]},'interface':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x4')]={'interface':{'type':_0xbb10('0x1'),'required':!![]},'paused':{'type':_0xbb10('0x5')},'reason':{'type':'string','required':![]}};exports[_0xbb10('0x6')]={'module':{'type':_0xbb10('0x1'),'required':![]}};exports['voicequeuechannel']={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports[_0xbb10('0x7')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]},'filename':{'type':_0xbb10('0x1')},'format':{'type':_0xbb10('0x1')},'mixmonitorid':{'type':_0xbb10('0x1')}};exports[_0xbb10('0x8')]={'uniqueid':{'type':_0xbb10('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':'string','required':!![]},'exten':{'type':_0xbb10('0x1'),'required':!![]},'context':{'type':_0xbb10('0x1')}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index fb561fa..1cdb5aa 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 _0xa8d8=['../model/template','../model/campaign','../model/voiceExtension','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','telephones','trunks','triggers','campaigns','voiceExtensions','channels','queueChannels','outboundChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','servicenowAccounts','dynamics365Accounts','mapKeys','hasOwnProperty','format','name','interface','SIP/%s','total','answered','sumDuration','sumBillable','isEmpty','ivrAnswerCallsDay','unmanaged','sumHoldTime','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','agents','isNil','initTelephones','isUndefined','length','initVoiceQueues','voiceQueues','initTriggers','templates','initZendeskAccounts','initSalesforceAccounts','initFreshdeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initSugarcrmAccounts','vtigerAccounts','initServicenowAccounts','initDynamics365Accounts','initVoiceQueueHopperHistory','initVoiceQueueReports','groupBy','uniqueid','queuecallerexit','queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','diff','queuecallercomplete','outbound','duration','disposition','billableseconds','initCampaigns','initVoiceExtensions','initCampaignHopperHistory','faxAccounts','exports','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0xa8d8,0xc1));var _0x8a8d=function(_0x2d2c16,_0x4e88b6){_0x2d2c16=_0x2d2c16-0x0;var _0x53f2fb=_0xa8d8[_0x2d2c16];return _0x53f2fb;};'use strict';var BPromise=require('bluebird');var util=require(_0x8a8d('0x0'));var _=require(_0x8a8d('0x1'));var moment=require(_0x8a8d('0x2'));var Agent=require(_0x8a8d('0x3'));var Telephone=require(_0x8a8d('0x4'));var Trunk=require(_0x8a8d('0x5'));var VoiceQueue=require(_0x8a8d('0x6'));var Trigger=require('../model/trigger');var Template=require(_0x8a8d('0x7'));var Campaign=require(_0x8a8d('0x8'));var VoiceExtension=require(_0x8a8d('0x9'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0x8a8d('0xa'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0x8a8d('0xb'));var DeskAccount=require(_0x8a8d('0xc'));var VtigerAccount=require(_0x8a8d('0xd'));var ServicenowAccount=require(_0x8a8d('0xe'));var Dynamics365Account=require(_0x8a8d('0xf'));var FaxAccount=require(_0x8a8d('0x10'));var Realtime=function(){this['agents']={};this[_0x8a8d('0x11')]={};this[_0x8a8d('0x12')]={};this['voiceQueues']={};this[_0x8a8d('0x13')]={};this[_0x8a8d('0x14')]={};this['templates']={};this['outbound']={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0x8a8d('0x15')]={};this[_0x8a8d('0x16')]={};this[_0x8a8d('0x17')]={};this[_0x8a8d('0x18')]={};this['timers']={};this[_0x8a8d('0x19')]={};this[_0x8a8d('0x1a')]={};this[_0x8a8d('0x1b')]={};this['freshdeskAccounts']={};this[_0x8a8d('0x1c')]={};this[_0x8a8d('0x1d')]={};this['vtigerAccounts']={};this[_0x8a8d('0x1e')]={};this[_0x8a8d('0x1f')]={};this['faxAccounts']={};};function freeIsNotKey(_0x2fc1cd,_0x2eb955,_0x2a4028){var _0x82703d=_[_0x8a8d('0x20')](_0x2fc1cd,function(_0xa31c06,_0xfcfbed){return _0xa31c06[_0x2a4028];});for(var _0x222c67 in _0x2eb955){if(_0x2eb955[_0x8a8d('0x21')](_0x222c67)){if(!_0x82703d[_0x222c67]){delete _0x2eb955[_0x222c67];}}}}function freeIsNotKeySip(_0x381d6e,_0x4e4bf2){var _0x16570f=_[_0x8a8d('0x20')](_0x381d6e,function(_0x191932,_0x3cf4d2){return util[_0x8a8d('0x22')]('SIP/%s',_0x191932[_0x8a8d('0x23')]);});for(var _0x582ca6 in _0x4e4bf2){if(_0x4e4bf2[_0x8a8d('0x21')](_0x582ca6)){if(!_0x16570f[_0x582ca6]){delete _0x4e4bf2[_0x582ca6];}}}}function freeIsNotKeyAgent(_0x40ef5f,_0x287df4){var _0x58bfd3=_[_0x8a8d('0x20')](_0x40ef5f,function(_0x46d819,_0x5538ff){var _0x270108=_['isNil'](_0x46d819[_0x8a8d('0x24')])?util[_0x8a8d('0x22')](_0x8a8d('0x25'),_0x46d819[_0x8a8d('0x23')]):_0x46d819[_0x8a8d('0x24')];return _0x270108;});for(var _0x550b8b in _0x287df4){if(_0x287df4['hasOwnProperty'](_0x550b8b)){if(!_0x58bfd3[_0x550b8b]){delete _0x287df4[_0x550b8b];}}}}function clearVoiceCallReports(_0x667d1d){_0x667d1d[_0x8a8d('0x26')]=0x0;_0x667d1d[_0x8a8d('0x27')]=0x0;_0x667d1d['sumHoldTime']=0x0;_0x667d1d[_0x8a8d('0x28')]=0x0;_0x667d1d[_0x8a8d('0x29')]=0x0;}function clearCampaigns(_0x1b037c){if(!_[_0x8a8d('0x2a')](_0x1b037c)){for(var _0x32e32e in _0x1b037c){if(_0x1b037c[_0x8a8d('0x21')](_0x32e32e)){_0x1b037c[_0x32e32e]['ivrTotalCallsDays']=0x0;_0x1b037c[_0x32e32e][_0x8a8d('0x2b')]=0x0;}}}}function clearVoiceQueues(_0x195dc9){if(!_[_0x8a8d('0x2a')](_0x195dc9)){for(var _0x51f1c7 in _0x195dc9){if(_0x195dc9[_0x8a8d('0x21')](_0x51f1c7)){_0x195dc9[_0x51f1c7]['total']=0x0;_0x195dc9[_0x51f1c7]['answered']=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x2c')]=0x0;_0x195dc9[_0x51f1c7]['abandoned']=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x2d')]=0x0;_0x195dc9[_0x51f1c7]['sumDuration']=0x0;_0x195dc9[_0x51f1c7]['sumBillable']=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x2e')]=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x2f')]=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x30')]=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x31')]=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x32')]=0x0;_0x195dc9[_0x51f1c7]['outboundUnknownCallsDay']=0x0;_0x195dc9[_0x51f1c7]['outboundDropCallsDayTimeout']=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x33')]=0x0;_0x195dc9[_0x51f1c7]['outboundBlacklistCallsDay']=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x34')]=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x35')]=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x36')]=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x2e')]=0x0;_0x195dc9[_0x51f1c7]['outboundAnswerCallsDay']=0x0;_0x195dc9[_0x51f1c7][_0x8a8d('0x37')]=!![];}}}}Realtime[_0x8a8d('0x38')][_0x8a8d('0x39')]=function(_0x5e6cd8,_0x5d7c3b){for(var _0x2c60d8 in _0x5d7c3b){if(_0x5e6cd8[_0x8a8d('0x21')](_0x2c60d8)){_0x5e6cd8[_0x2c60d8]=_0x5d7c3b[_0x2c60d8];}}};Realtime[_0x8a8d('0x38')][_0x8a8d('0x3a')]=function(){var _0x2ac507=this;return function(_0x37c0e9){if(_0x37c0e9){freeIsNotKeyAgent(_0x37c0e9,_0x2ac507[_0x8a8d('0x3b')]);for(var _0x206941=0x0,_0x12d7f1={},_0xf8eb4a={};_0x206941<_0x37c0e9['length'];_0x206941+=0x1){_0x12d7f1=_0x37c0e9[_0x206941];var _0x1d46a1=_[_0x8a8d('0x3c')](_0x12d7f1[_0x8a8d('0x24')])?util[_0x8a8d('0x22')](_0x8a8d('0x25'),_0x12d7f1['name']):_0x12d7f1['interface'];if(_['isUndefined'](_0x2ac507[_0x8a8d('0x3b')][_0x1d46a1])){_0x2ac507['agents'][_0x1d46a1]=new Agent(_0x12d7f1);}else{_0x2ac507[_0x8a8d('0x39')](_0x2ac507[_0x8a8d('0x3b')][_0x1d46a1],_0x12d7f1);}}}return _0x2ac507[_0x8a8d('0x3b')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x3d')]=function(){var _0x2512a9=this;return function(_0x5642d1){if(_0x5642d1){freeIsNotKeySip(_0x5642d1,_0x2512a9[_0x8a8d('0x11')]);for(var _0x20075e=0x0,_0x8e0d14={},_0x1dd13e={};_0x20075e<_0x5642d1['length'];_0x20075e+=0x1){_0x8e0d14=_0x5642d1[_0x20075e];if(_[_0x8a8d('0x3e')](_0x2512a9[_0x8a8d('0x11')][util[_0x8a8d('0x22')](_0x8a8d('0x25'),_0x8e0d14[_0x8a8d('0x23')])])){_0x2512a9[_0x8a8d('0x11')][util[_0x8a8d('0x22')](_0x8a8d('0x25'),_0x8e0d14[_0x8a8d('0x23')])]=new Telephone(_0x8e0d14);}else{_0x2512a9['mergeFromDatabase'](_0x2512a9[_0x8a8d('0x11')][util[_0x8a8d('0x22')](_0x8a8d('0x25'),_0x8e0d14[_0x8a8d('0x23')])],_0x8e0d14);}}}return _0x2512a9[_0x8a8d('0x11')];};};Realtime[_0x8a8d('0x38')]['initTrunks']=function(){var _0x436f1f=this;return function(_0x248779){if(_0x248779){freeIsNotKeySip(_0x248779,_0x436f1f[_0x8a8d('0x12')]);for(var _0x4beeda=0x0,_0x360a79={},_0x5c54a6={};_0x4beeda<_0x248779[_0x8a8d('0x3f')];_0x4beeda+=0x1){_0x360a79=_0x248779[_0x4beeda];if(_[_0x8a8d('0x3e')](_0x436f1f[_0x8a8d('0x12')][util[_0x8a8d('0x22')]('SIP/%s',_0x360a79[_0x8a8d('0x23')])])){_0x436f1f[_0x8a8d('0x12')][util['format'](_0x8a8d('0x25'),_0x360a79['name'])]=new Trunk(_0x360a79);}else{_0x436f1f[_0x8a8d('0x39')](_0x436f1f[_0x8a8d('0x12')][util[_0x8a8d('0x22')](_0x8a8d('0x25'),_0x360a79[_0x8a8d('0x23')])],_0x360a79);}}}return _0x436f1f[_0x8a8d('0x12')];};};Realtime['prototype'][_0x8a8d('0x40')]=function(){var _0x559541=this;return function(_0x1e1f82){if(_0x1e1f82){freeIsNotKey(_0x1e1f82,_0x559541[_0x8a8d('0x41')],_0x8a8d('0x23'));for(var _0x32d1a7=0x0,_0x4c99a9={},_0x159af2={};_0x32d1a7<_0x1e1f82['length'];_0x32d1a7+=0x1){_0x4c99a9=_0x1e1f82[_0x32d1a7];if(_[_0x8a8d('0x3e')](_0x559541[_0x8a8d('0x41')][_0x4c99a9[_0x8a8d('0x23')]])){_0x559541['voiceQueues'][_0x4c99a9['name']]=new VoiceQueue(_0x4c99a9);}else{_0x559541[_0x8a8d('0x39')](_0x559541[_0x8a8d('0x41')][_0x4c99a9[_0x8a8d('0x23')]],_0x4c99a9);}}}return _0x559541['voiceQueues'];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x42')]=function(){var _0x4535cd=this;return function(_0x657ad9){if(_0x657ad9){freeIsNotKey(_0x657ad9,_0x4535cd[_0x8a8d('0x13')],'id');for(var _0x105f8e=0x0,_0x58acb9={},_0x335c16={};_0x105f8e<_0x657ad9[_0x8a8d('0x3f')];_0x105f8e+=0x1){_0x58acb9=_0x657ad9[_0x105f8e];if(_['isUndefined'](_0x4535cd[_0x8a8d('0x13')][_0x58acb9['id']])){_0x4535cd[_0x8a8d('0x13')][_0x58acb9['id']]=new Trigger(_0x58acb9);}else{_0x4535cd[_0x8a8d('0x39')](_0x4535cd[_0x8a8d('0x13')][_0x58acb9['id']],_0x58acb9);}}}return _0x4535cd[_0x8a8d('0x13')];};};Realtime['prototype']['initTemplates']=function(){var _0x5cabb0=this;return function(_0x3284c2){if(_0x3284c2){freeIsNotKey(_0x3284c2,_0x5cabb0[_0x8a8d('0x43')],'id');for(var _0x4d87bd=0x0,_0x186d48={},_0x2013b4={};_0x4d87bd<_0x3284c2[_0x8a8d('0x3f')];_0x4d87bd+=0x1){_0x186d48=_0x3284c2[_0x4d87bd];if(_['isUndefined'](_0x5cabb0['templates'][_0x186d48['id']])){_0x5cabb0[_0x8a8d('0x43')][_0x186d48['id']]=new Template(_0x186d48);}else{_0x5cabb0['mergeFromDatabase'](_0x5cabb0['templates'][_0x186d48['id']],_0x186d48);}}}return _0x5cabb0[_0x8a8d('0x43')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x44')]=function(){var _0x541604=this;return function(_0x208758){if(_0x208758){freeIsNotKey(_0x208758,_0x541604[_0x8a8d('0x19')],'id');for(var _0x5efe19=0x0,_0x1ea1d6={},_0x18a9f6={};_0x5efe19<_0x208758[_0x8a8d('0x3f')];_0x5efe19+=0x1){_0x1ea1d6=_0x208758[_0x5efe19];if(_[_0x8a8d('0x3e')](_0x541604['zendeskAccounts'][_0x1ea1d6['id']])){_0x541604[_0x8a8d('0x19')][_0x1ea1d6['id']]=new ZendeskAccount(_0x1ea1d6);}else{_0x541604[_0x8a8d('0x39')](_0x541604[_0x8a8d('0x19')][_0x1ea1d6['id']],_0x1ea1d6);}}}return _0x541604['zendeskAccounts'];};};Realtime['prototype'][_0x8a8d('0x45')]=function(){var _0x3aa8a4=this;return function(_0x2728c9){if(_0x2728c9){freeIsNotKey(_0x2728c9,_0x3aa8a4[_0x8a8d('0x1a')],'id');for(var _0x4b828e=0x0,_0x8b2215={},_0x4dcda7={};_0x4b828e<_0x2728c9[_0x8a8d('0x3f')];_0x4b828e+=0x1){_0x8b2215=_0x2728c9[_0x4b828e];if(_[_0x8a8d('0x3e')](_0x3aa8a4[_0x8a8d('0x1a')][_0x8b2215['id']])){_0x3aa8a4['salesforceAccounts'][_0x8b2215['id']]=new SalesforceAccount(_0x8b2215);}else{_0x3aa8a4[_0x8a8d('0x39')](_0x3aa8a4[_0x8a8d('0x1a')][_0x8b2215['id']],_0x8b2215);}}}return _0x3aa8a4[_0x8a8d('0x1a')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x46')]=function(){var _0x1a9591=this;return function(_0x204f88){if(_0x204f88){freeIsNotKey(_0x204f88,_0x1a9591[_0x8a8d('0x47')],'id');for(var _0x1f4410=0x0,_0x4d9468={},_0x24f182={};_0x1f4410<_0x204f88[_0x8a8d('0x3f')];_0x1f4410+=0x1){_0x4d9468=_0x204f88[_0x1f4410];if(_[_0x8a8d('0x3e')](_0x1a9591[_0x8a8d('0x47')][_0x4d9468['id']])){_0x1a9591['freshdeskAccounts'][_0x4d9468['id']]=new FreshdeskAccount(_0x4d9468);}else{_0x1a9591['mergeFromDatabase'](_0x1a9591[_0x8a8d('0x47')][_0x4d9468['id']],_0x4d9468);}}}return _0x1a9591[_0x8a8d('0x47')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x48')]=function(){var _0x43be73=this;return function(_0x89f017){if(_0x89f017){freeIsNotKey(_0x89f017,_0x43be73['zohoAccounts'],'id');for(var _0x4e9c09=0x0,_0x3c1ce5={},_0x1766cc={};_0x4e9c09<_0x89f017['length'];_0x4e9c09+=0x1){_0x3c1ce5=_0x89f017[_0x4e9c09];if(_['isUndefined'](_0x43be73[_0x8a8d('0x1c')][_0x3c1ce5['id']])){_0x43be73['zohoAccounts'][_0x3c1ce5['id']]=new ZohoAccount(_0x3c1ce5);}else{_0x43be73[_0x8a8d('0x39')](_0x43be73[_0x8a8d('0x1c')][_0x3c1ce5['id']],_0x3c1ce5);}}}return _0x43be73[_0x8a8d('0x1c')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x49')]=function(){var _0x594c1a=this;return function(_0xef98e5){if(_0xef98e5){freeIsNotKey(_0xef98e5,_0x594c1a[_0x8a8d('0x1d')],'id');for(var _0x4abc1a=0x0,_0x30e40b={},_0x156534={};_0x4abc1a<_0xef98e5[_0x8a8d('0x3f')];_0x4abc1a+=0x1){_0x30e40b=_0xef98e5[_0x4abc1a];if(_['isUndefined'](_0x594c1a[_0x8a8d('0x1d')][_0x30e40b['id']])){_0x594c1a[_0x8a8d('0x1d')][_0x30e40b['id']]=new DeskAccount(_0x30e40b);}else{_0x594c1a[_0x8a8d('0x39')](_0x594c1a[_0x8a8d('0x1d')][_0x30e40b['id']],_0x30e40b);}}}return _0x594c1a[_0x8a8d('0x1d')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x4a')]=function(){var _0x6b0794=this;return function(_0xf3cd3b){if(_0xf3cd3b){freeIsNotKey(_0xf3cd3b,_0x6b0794['sugarcrmAccounts'],'id');for(var _0x2a8cb8=0x0,_0x4d4d9a={},_0x88ded4={};_0x2a8cb8<_0xf3cd3b[_0x8a8d('0x3f')];_0x2a8cb8+=0x1){_0x4d4d9a=_0xf3cd3b[_0x2a8cb8];if(_[_0x8a8d('0x3e')](_0x6b0794[_0x8a8d('0x1b')][_0x4d4d9a['id']])){_0x6b0794['sugarcrmAccounts'][_0x4d4d9a['id']]=new SugarcrmAccount(_0x4d4d9a);}else{_0x6b0794[_0x8a8d('0x39')](_0x6b0794[_0x8a8d('0x1b')][_0x4d4d9a['id']],_0x4d4d9a);}}}return _0x6b0794[_0x8a8d('0x1b')];};};Realtime[_0x8a8d('0x38')]['initVtigerAccounts']=function(){var _0x4fe7cc=this;return function(_0x5b789b){if(_0x5b789b){freeIsNotKey(_0x5b789b,_0x4fe7cc[_0x8a8d('0x4b')],'id');for(var _0x9dc311=0x0,_0x3a906f={},_0x35a4a7={};_0x9dc311<_0x5b789b['length'];_0x9dc311+=0x1){_0x3a906f=_0x5b789b[_0x9dc311];if(_[_0x8a8d('0x3e')](_0x4fe7cc[_0x8a8d('0x4b')][_0x3a906f['id']])){_0x4fe7cc['vtigerAccounts'][_0x3a906f['id']]=new VtigerAccount(_0x3a906f);}else{_0x4fe7cc[_0x8a8d('0x39')](_0x4fe7cc['vtigerAccounts'][_0x3a906f['id']],_0x3a906f);}}}return _0x4fe7cc['vtigerAccounts'];};};Realtime['prototype'][_0x8a8d('0x4c')]=function(){var _0x3f8dd6=this;return function(_0x10c376){if(_0x10c376){freeIsNotKey(_0x10c376,_0x3f8dd6[_0x8a8d('0x1e')],'id');for(var _0x15de20=0x0,_0x6d14d4={},_0x54e865={};_0x15de20<_0x10c376['length'];_0x15de20+=0x1){_0x6d14d4=_0x10c376[_0x15de20];if(_[_0x8a8d('0x3e')](_0x3f8dd6[_0x8a8d('0x1e')][_0x6d14d4['id']])){_0x3f8dd6[_0x8a8d('0x1e')][_0x6d14d4['id']]=new ServicenowAccount(_0x6d14d4);}else{_0x3f8dd6[_0x8a8d('0x39')](_0x3f8dd6[_0x8a8d('0x1e')][_0x6d14d4['id']],_0x6d14d4);}}}return _0x3f8dd6[_0x8a8d('0x1e')];};};Realtime['prototype'][_0x8a8d('0x4d')]=function(){var _0x9cfdd3=this;return function(_0x21a4f7){if(_0x21a4f7){freeIsNotKey(_0x21a4f7,_0x9cfdd3[_0x8a8d('0x1f')],'id');for(var _0x2f11c1=0x0,_0x3857f1={},_0x1322d6={};_0x2f11c1<_0x21a4f7['length'];_0x2f11c1+=0x1){_0x3857f1=_0x21a4f7[_0x2f11c1];if(_[_0x8a8d('0x3e')](_0x9cfdd3['dynamics365Accounts'][_0x3857f1['id']])){_0x9cfdd3[_0x8a8d('0x1f')][_0x3857f1['id']]=new Dynamics365Account(_0x3857f1);}else{_0x9cfdd3['mergeFromDatabase'](_0x9cfdd3[_0x8a8d('0x1f')][_0x3857f1['id']],_0x3857f1);}}}return _0x9cfdd3[_0x8a8d('0x1f')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x4e')]=function(){var _0x4997d6=this;return function(_0x3a157d){for(var _0x1327d5=0x0;_0x1327d5<_0x3a157d[_0x8a8d('0x3f')];_0x1327d5+=0x1){_['merge'](_0x4997d6[_0x8a8d('0x41')][_0x3a157d[_0x1327d5][_0x8a8d('0x23')]],_0x3a157d[_0x1327d5]);}return _0x4997d6[_0x8a8d('0x41')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x4f')]=function(){var _0x84b853=this;return function(_0x349937){clearVoiceQueues(_0x84b853['voiceQueues']);if(_0x349937){_0x349937=_[_0x8a8d('0x50')](_0x349937,_0x8a8d('0x51'));for(var _0x3335ba in _0x349937){if(_0x349937[_0x8a8d('0x21')](_0x3335ba)){var _0x5ec4fc={};for(var _0x2973a3=0x0;_0x2973a3<_0x349937[_0x3335ba][_0x8a8d('0x3f')];_0x2973a3+=0x1){var _0x2ecf11=_0x349937[_0x3335ba][_0x2973a3]['queue'];if(_0x84b853[_0x8a8d('0x41')][_0x2ecf11]){if(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x52')]){_0x84b853[_0x8a8d('0x41')][_0x2ecf11]['unmanaged']+=0x1;}if(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x53')]){_0x84b853[_0x8a8d('0x41')][_0x2ecf11]['abandoned']+=0x1;}_0x84b853[_0x8a8d('0x41')][_0x2ecf11][_0x8a8d('0x2d')]+=moment(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x54')])['diff'](moment(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x55')]),_0x8a8d('0x56'))||0x0;if(_0x2973a3===_0x349937[_0x3335ba][_0x8a8d('0x3f')]-0x1){_0x84b853[_0x8a8d('0x41')][_0x2ecf11][_0x8a8d('0x28')]+=moment(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x57')]||_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x58')]||_0x349937[_0x3335ba][_0x2973a3]['queuecallerexitAt'])[_0x8a8d('0x59')](moment(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x55')]),_0x8a8d('0x56'))||0x0;_0x84b853[_0x8a8d('0x41')][_0x2ecf11][_0x8a8d('0x26')]+=0x1;if(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x5a')]){_0x84b853[_0x8a8d('0x41')][_0x2ecf11][_0x8a8d('0x27')]+=0x1;_0x84b853[_0x8a8d('0x41')][_0x2ecf11][_0x8a8d('0x29')]+=moment(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x57')])[_0x8a8d('0x59')](moment(_0x349937[_0x3335ba][_0x2973a3][_0x8a8d('0x54')]),_0x8a8d('0x56'))||0x0;}}else{_0x84b853[_0x8a8d('0x41')][_0x2ecf11][_0x8a8d('0x28')]+=_0x84b853['voiceQueues'][_0x2ecf11][_0x8a8d('0x2d')]||0x0;}}}}}}return _0x84b853[_0x8a8d('0x41')];};};Realtime[_0x8a8d('0x38')]['initVoiceCallReports']=function(){var _0x48a643=this;return function(_0x374261){clearVoiceCallReports(_0x48a643[_0x8a8d('0x5b')]);if(_0x374261){for(var _0x5cf004=0x0;_0x5cf004<_0x374261['length'];_0x5cf004+=0x1){_0x48a643[_0x8a8d('0x5b')][_0x8a8d('0x26')]+=0x1;_0x48a643[_0x8a8d('0x5b')][_0x8a8d('0x28')]+=_0x374261[_0x5cf004][_0x8a8d('0x5c')];if(_0x374261[_0x5cf004][_0x8a8d('0x5d')]==='ANSWERED'){_0x48a643['outbound']['answered']+=0x1;_0x48a643[_0x8a8d('0x5b')]['sumHoldTime']+=_0x374261[_0x5cf004][_0x8a8d('0x5c')]-_0x374261[_0x5cf004][_0x8a8d('0x5e')]||0x0;_0x48a643[_0x8a8d('0x5b')][_0x8a8d('0x29')]+=_0x374261[_0x5cf004]['billableseconds'];}}}return _0x48a643[_0x8a8d('0x5b')];};};Realtime['prototype'][_0x8a8d('0x5f')]=function(){var _0x4d6067=this;return function(_0x3ff17b){if(_0x3ff17b){freeIsNotKey(_0x3ff17b,_0x4d6067[_0x8a8d('0x14')],_0x8a8d('0x23'));for(var _0x921313=0x0,_0x2a2abe={};_0x921313<_0x3ff17b[_0x8a8d('0x3f')];_0x921313+=0x1){_0x2a2abe=_0x3ff17b[_0x921313];if(_['isUndefined'](_0x4d6067['campaigns'][_0x2a2abe[_0x8a8d('0x23')]])){_0x4d6067[_0x8a8d('0x14')][_0x2a2abe['name']]=new Campaign(_0x2a2abe);}else{_0x4d6067[_0x8a8d('0x39')](_0x4d6067[_0x8a8d('0x14')][_0x2a2abe[_0x8a8d('0x23')]],_0x2a2abe);}}}return _0x4d6067[_0x8a8d('0x14')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x60')]=function(){var _0x4c11de=this;return function(_0x3f368b){if(_0x3f368b){freeIsNotKey(_0x3f368b,_0x4c11de[_0x8a8d('0x15')],'id');for(var _0x3d451e=0x0,_0x58796f={};_0x3d451e<_0x3f368b[_0x8a8d('0x3f')];_0x3d451e+=0x1){_0x58796f=_0x3f368b[_0x3d451e];if(_[_0x8a8d('0x3e')](_0x4c11de[_0x8a8d('0x15')][_0x58796f['id']])){_0x4c11de[_0x8a8d('0x15')][_0x58796f['id']]=new VoiceExtension(_0x58796f);}else{_0x4c11de[_0x8a8d('0x39')](_0x4c11de[_0x8a8d('0x15')][_0x58796f['id']],_0x58796f);}}}return _0x4c11de[_0x8a8d('0x15')];};};Realtime[_0x8a8d('0x38')][_0x8a8d('0x61')]=function(){var _0x485ddf=this;return function(_0x5e69ce){clearCampaigns(_0x485ddf['campaigns']);for(var _0x57bf4f=0x0;_0x57bf4f<_0x5e69ce[_0x8a8d('0x3f')];_0x57bf4f+=0x1){_['merge'](_0x485ddf['campaigns'][_0x5e69ce[_0x57bf4f][_0x8a8d('0x23')]],_0x5e69ce[_0x57bf4f]);}return _0x485ddf['campaigns'];};};Realtime[_0x8a8d('0x38')]['initFaxAccounts']=function(){var _0x8dc837=this;return function(_0x1c8619){if(_0x1c8619){freeIsNotKey(_0x1c8619,_0x8dc837[_0x8a8d('0x62')],'id');for(var _0xddaf3d=0x0,_0x5d0ce9={},_0x4c10f5={};_0xddaf3d<_0x1c8619[_0x8a8d('0x3f')];_0xddaf3d+=0x1){_0x5d0ce9=_0x1c8619[_0xddaf3d];if(_['isUndefined'](_0x8dc837[_0x8a8d('0x62')][_0x5d0ce9['id']])){_0x8dc837[_0x8a8d('0x62')][_0x5d0ce9['id']]=new FaxAccount(_0x5d0ce9);}else{_0x8dc837[_0x8a8d('0x39')](_0x8dc837['faxAccounts'][_0x5d0ce9['id']],_0x5d0ce9);}}}return _0x8dc837[_0x8a8d('0x62')];};};module[_0x8a8d('0x63')]=Realtime; \ No newline at end of file +var _0xbf1a=['salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','faxAccounts','mapKeys','hasOwnProperty','format','name','isNil','SIP/%s','interface','total','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','abandoned','sumBillable','outboundAnswerAgiCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','initAgents','isUndefined','mergeFromDatabase','initTelephones','initTrunks','length','initTriggers','triggers','initTemplates','initZendeskAccounts','zendeskAccounts','freshdeskAccounts','initZohoAccounts','initDeskAccounts','initServicenowAccounts','initDynamics365Accounts','dynamics365Accounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','queue','unmanaged','queuecallerleaveAt','diff','queuecallerjoinAt','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','initVoiceCallReports','duration','billableseconds','initCampaigns','initVoiceExtensions','initFaxAccounts','bluebird','util','lodash','moment','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/vtigerAccount','../model/servicenowAccount','../model/dynamics365Account','../model/faxAccount','agents','telephones','trunks','voiceQueues','campaigns','templates','outbound','voiceExtensions','channels','queueChannels','outboundChannels'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xbf1a,0x113));var _0xabf1=function(_0xbd227c,_0x4c8b2f){_0xbd227c=_0xbd227c-0x0;var _0x215b04=_0xbf1a[_0xbd227c];return _0x215b04;};'use strict';var BPromise=require(_0xabf1('0x0'));var util=require(_0xabf1('0x1'));var _=require(_0xabf1('0x2'));var moment=require(_0xabf1('0x3'));var Agent=require(_0xabf1('0x4'));var Telephone=require(_0xabf1('0x5'));var Trunk=require(_0xabf1('0x6'));var VoiceQueue=require(_0xabf1('0x7'));var Trigger=require('../model/trigger');var Template=require(_0xabf1('0x8'));var Campaign=require(_0xabf1('0x9'));var VoiceExtension=require(_0xabf1('0xa'));var ZendeskAccount=require(_0xabf1('0xb'));var SalesforceAccount=require(_0xabf1('0xc'));var FreshdeskAccount=require(_0xabf1('0xd'));var SugarcrmAccount=require(_0xabf1('0xe'));var ZohoAccount=require(_0xabf1('0xf'));var DeskAccount=require('../model/deskAccount');var VtigerAccount=require(_0xabf1('0x10'));var ServicenowAccount=require(_0xabf1('0x11'));var Dynamics365Account=require(_0xabf1('0x12'));var FaxAccount=require(_0xabf1('0x13'));var Realtime=function(){this[_0xabf1('0x14')]={};this[_0xabf1('0x15')]={};this[_0xabf1('0x16')]={};this[_0xabf1('0x17')]={};this['triggers']={};this[_0xabf1('0x18')]={};this[_0xabf1('0x19')]={};this[_0xabf1('0x1a')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xabf1('0x1b')]={};this[_0xabf1('0x1c')]={};this[_0xabf1('0x1d')]={};this[_0xabf1('0x1e')]={};this['timers']={};this['zendeskAccounts']={};this[_0xabf1('0x1f')]={};this[_0xabf1('0x20')]={};this['freshdeskAccounts']={};this[_0xabf1('0x21')]={};this[_0xabf1('0x22')]={};this[_0xabf1('0x23')]={};this[_0xabf1('0x24')]={};this['dynamics365Accounts']={};this[_0xabf1('0x25')]={};};function freeIsNotKey(_0x1dba3d,_0x40d29d,_0x5c9519){var _0x3262db=_[_0xabf1('0x26')](_0x1dba3d,function(_0x3110b0,_0x35f4cc){return _0x3110b0[_0x5c9519];});for(var _0x46e14e in _0x40d29d){if(_0x40d29d[_0xabf1('0x27')](_0x46e14e)){if(!_0x3262db[_0x46e14e]){delete _0x40d29d[_0x46e14e];}}}}function freeIsNotKeySip(_0x19d43f,_0x259448){var _0x404b9f=_[_0xabf1('0x26')](_0x19d43f,function(_0x57eb74,_0x5d4bdc){return util[_0xabf1('0x28')]('SIP/%s',_0x57eb74[_0xabf1('0x29')]);});for(var _0x26e32f in _0x259448){if(_0x259448[_0xabf1('0x27')](_0x26e32f)){if(!_0x404b9f[_0x26e32f]){delete _0x259448[_0x26e32f];}}}}function freeIsNotKeyAgent(_0x419cdb,_0x54682a){var _0xcb52bf=_[_0xabf1('0x26')](_0x419cdb,function(_0x4e2101,_0x3c5701){var _0x209120=_[_0xabf1('0x2a')](_0x4e2101['interface'])?util[_0xabf1('0x28')](_0xabf1('0x2b'),_0x4e2101[_0xabf1('0x29')]):_0x4e2101[_0xabf1('0x2c')];return _0x209120;});for(var _0x3a13b2 in _0x54682a){if(_0x54682a[_0xabf1('0x27')](_0x3a13b2)){if(!_0xcb52bf[_0x3a13b2]){delete _0x54682a[_0x3a13b2];}}}}function clearVoiceCallReports(_0x47d1bd){_0x47d1bd[_0xabf1('0x2d')]=0x0;_0x47d1bd[_0xabf1('0x2e')]=0x0;_0x47d1bd[_0xabf1('0x2f')]=0x0;_0x47d1bd[_0xabf1('0x30')]=0x0;_0x47d1bd['sumBillable']=0x0;}function clearCampaigns(_0x4f203e){if(!_[_0xabf1('0x31')](_0x4f203e)){for(var _0xf45b0d in _0x4f203e){if(_0x4f203e['hasOwnProperty'](_0xf45b0d)){_0x4f203e[_0xf45b0d][_0xabf1('0x32')]=0x0;_0x4f203e[_0xf45b0d][_0xabf1('0x33')]=0x0;}}}}function clearVoiceQueues(_0x3faf1a){if(!_[_0xabf1('0x31')](_0x3faf1a)){for(var _0x1f93ed in _0x3faf1a){if(_0x3faf1a['hasOwnProperty'](_0x1f93ed)){_0x3faf1a[_0x1f93ed][_0xabf1('0x2d')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x2e')]=0x0;_0x3faf1a[_0x1f93ed]['unmanaged']=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x34')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x2f')]=0x0;_0x3faf1a[_0x1f93ed]['sumDuration']=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x35')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x36')]=0x0;_0x3faf1a[_0x1f93ed]['outboundNoAnswerCallsDay']=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x37')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x38')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x39')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x3a')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x3b')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x3c')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x3d')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x3e')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x3f')]=0x0;_0x3faf1a[_0x1f93ed]['outboundReCallsDay']=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x36')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x40')]=0x0;_0x3faf1a[_0x1f93ed][_0xabf1('0x41')]=!![];}}}}Realtime[_0xabf1('0x42')]['mergeFromDatabase']=function(_0x52a908,_0x312d5e){for(var _0x4ebac0 in _0x312d5e){if(_0x52a908[_0xabf1('0x27')](_0x4ebac0)){_0x52a908[_0x4ebac0]=_0x312d5e[_0x4ebac0];}}};Realtime['prototype'][_0xabf1('0x43')]=function(){var _0x129197=this;return function(_0x58500e){if(_0x58500e){freeIsNotKeyAgent(_0x58500e,_0x129197[_0xabf1('0x14')]);for(var _0x25f4da=0x0,_0x11771b={},_0x1e4a1c={};_0x25f4da<_0x58500e['length'];_0x25f4da+=0x1){_0x11771b=_0x58500e[_0x25f4da];var _0x4e48d9=_['isNil'](_0x11771b[_0xabf1('0x2c')])?util[_0xabf1('0x28')](_0xabf1('0x2b'),_0x11771b[_0xabf1('0x29')]):_0x11771b['interface'];if(_[_0xabf1('0x44')](_0x129197[_0xabf1('0x14')][_0x4e48d9])){_0x129197[_0xabf1('0x14')][_0x4e48d9]=new Agent(_0x11771b);}else{_0x129197[_0xabf1('0x45')](_0x129197[_0xabf1('0x14')][_0x4e48d9],_0x11771b);}}}return _0x129197[_0xabf1('0x14')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x46')]=function(){var _0x43beac=this;return function(_0x110c16){if(_0x110c16){freeIsNotKeySip(_0x110c16,_0x43beac[_0xabf1('0x15')]);for(var _0x1d8447=0x0,_0x3a5617={},_0x4b47da={};_0x1d8447<_0x110c16['length'];_0x1d8447+=0x1){_0x3a5617=_0x110c16[_0x1d8447];if(_[_0xabf1('0x44')](_0x43beac['telephones'][util[_0xabf1('0x28')](_0xabf1('0x2b'),_0x3a5617['name'])])){_0x43beac[_0xabf1('0x15')][util[_0xabf1('0x28')](_0xabf1('0x2b'),_0x3a5617['name'])]=new Telephone(_0x3a5617);}else{_0x43beac[_0xabf1('0x45')](_0x43beac[_0xabf1('0x15')][util['format'](_0xabf1('0x2b'),_0x3a5617[_0xabf1('0x29')])],_0x3a5617);}}}return _0x43beac[_0xabf1('0x15')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x47')]=function(){var _0x4a115c=this;return function(_0x318888){if(_0x318888){freeIsNotKeySip(_0x318888,_0x4a115c[_0xabf1('0x16')]);for(var _0x13a42d=0x0,_0x5d09d3={},_0x339cce={};_0x13a42d<_0x318888[_0xabf1('0x48')];_0x13a42d+=0x1){_0x5d09d3=_0x318888[_0x13a42d];if(_['isUndefined'](_0x4a115c[_0xabf1('0x16')][util[_0xabf1('0x28')](_0xabf1('0x2b'),_0x5d09d3[_0xabf1('0x29')])])){_0x4a115c[_0xabf1('0x16')][util[_0xabf1('0x28')](_0xabf1('0x2b'),_0x5d09d3['name'])]=new Trunk(_0x5d09d3);}else{_0x4a115c['mergeFromDatabase'](_0x4a115c[_0xabf1('0x16')][util['format'](_0xabf1('0x2b'),_0x5d09d3[_0xabf1('0x29')])],_0x5d09d3);}}}return _0x4a115c[_0xabf1('0x16')];};};Realtime[_0xabf1('0x42')]['initVoiceQueues']=function(){var _0xbc3cf7=this;return function(_0x384050){if(_0x384050){freeIsNotKey(_0x384050,_0xbc3cf7[_0xabf1('0x17')],'name');for(var _0x4ab9e4=0x0,_0x3b6944={},_0x42fcef={};_0x4ab9e4<_0x384050[_0xabf1('0x48')];_0x4ab9e4+=0x1){_0x3b6944=_0x384050[_0x4ab9e4];if(_['isUndefined'](_0xbc3cf7[_0xabf1('0x17')][_0x3b6944[_0xabf1('0x29')]])){_0xbc3cf7[_0xabf1('0x17')][_0x3b6944['name']]=new VoiceQueue(_0x3b6944);}else{_0xbc3cf7[_0xabf1('0x45')](_0xbc3cf7[_0xabf1('0x17')][_0x3b6944[_0xabf1('0x29')]],_0x3b6944);}}}return _0xbc3cf7['voiceQueues'];};};Realtime[_0xabf1('0x42')][_0xabf1('0x49')]=function(){var _0x533011=this;return function(_0x729d82){if(_0x729d82){freeIsNotKey(_0x729d82,_0x533011[_0xabf1('0x4a')],'id');for(var _0x468f03=0x0,_0x27d670={},_0x5bb18c={};_0x468f03<_0x729d82[_0xabf1('0x48')];_0x468f03+=0x1){_0x27d670=_0x729d82[_0x468f03];if(_['isUndefined'](_0x533011['triggers'][_0x27d670['id']])){_0x533011['triggers'][_0x27d670['id']]=new Trigger(_0x27d670);}else{_0x533011['mergeFromDatabase'](_0x533011[_0xabf1('0x4a')][_0x27d670['id']],_0x27d670);}}}return _0x533011['triggers'];};};Realtime[_0xabf1('0x42')][_0xabf1('0x4b')]=function(){var _0x344452=this;return function(_0x5d7a67){if(_0x5d7a67){freeIsNotKey(_0x5d7a67,_0x344452[_0xabf1('0x19')],'id');for(var _0x4cacb2=0x0,_0x26fae6={},_0x3c330e={};_0x4cacb2<_0x5d7a67['length'];_0x4cacb2+=0x1){_0x26fae6=_0x5d7a67[_0x4cacb2];if(_[_0xabf1('0x44')](_0x344452[_0xabf1('0x19')][_0x26fae6['id']])){_0x344452['templates'][_0x26fae6['id']]=new Template(_0x26fae6);}else{_0x344452[_0xabf1('0x45')](_0x344452[_0xabf1('0x19')][_0x26fae6['id']],_0x26fae6);}}}return _0x344452[_0xabf1('0x19')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x4c')]=function(){var _0x226103=this;return function(_0xed4dd5){if(_0xed4dd5){freeIsNotKey(_0xed4dd5,_0x226103[_0xabf1('0x4d')],'id');for(var _0x377ffb=0x0,_0x1f8f14={},_0x3bfb46={};_0x377ffb<_0xed4dd5[_0xabf1('0x48')];_0x377ffb+=0x1){_0x1f8f14=_0xed4dd5[_0x377ffb];if(_[_0xabf1('0x44')](_0x226103[_0xabf1('0x4d')][_0x1f8f14['id']])){_0x226103[_0xabf1('0x4d')][_0x1f8f14['id']]=new ZendeskAccount(_0x1f8f14);}else{_0x226103[_0xabf1('0x45')](_0x226103[_0xabf1('0x4d')][_0x1f8f14['id']],_0x1f8f14);}}}return _0x226103[_0xabf1('0x4d')];};};Realtime['prototype']['initSalesforceAccounts']=function(){var _0x289d12=this;return function(_0x4d44a6){if(_0x4d44a6){freeIsNotKey(_0x4d44a6,_0x289d12[_0xabf1('0x1f')],'id');for(var _0x466c1a=0x0,_0x3a8b6d={},_0x30f3f9={};_0x466c1a<_0x4d44a6[_0xabf1('0x48')];_0x466c1a+=0x1){_0x3a8b6d=_0x4d44a6[_0x466c1a];if(_[_0xabf1('0x44')](_0x289d12[_0xabf1('0x1f')][_0x3a8b6d['id']])){_0x289d12[_0xabf1('0x1f')][_0x3a8b6d['id']]=new SalesforceAccount(_0x3a8b6d);}else{_0x289d12['mergeFromDatabase'](_0x289d12[_0xabf1('0x1f')][_0x3a8b6d['id']],_0x3a8b6d);}}}return _0x289d12[_0xabf1('0x1f')];};};Realtime[_0xabf1('0x42')]['initFreshdeskAccounts']=function(){var _0x3eb358=this;return function(_0x49cd4b){if(_0x49cd4b){freeIsNotKey(_0x49cd4b,_0x3eb358[_0xabf1('0x4e')],'id');for(var _0x4cb76e=0x0,_0x158d5f={},_0x4a188b={};_0x4cb76e<_0x49cd4b['length'];_0x4cb76e+=0x1){_0x158d5f=_0x49cd4b[_0x4cb76e];if(_[_0xabf1('0x44')](_0x3eb358['freshdeskAccounts'][_0x158d5f['id']])){_0x3eb358[_0xabf1('0x4e')][_0x158d5f['id']]=new FreshdeskAccount(_0x158d5f);}else{_0x3eb358[_0xabf1('0x45')](_0x3eb358[_0xabf1('0x4e')][_0x158d5f['id']],_0x158d5f);}}}return _0x3eb358[_0xabf1('0x4e')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x4f')]=function(){var _0x4b6466=this;return function(_0x3e34d6){if(_0x3e34d6){freeIsNotKey(_0x3e34d6,_0x4b6466['zohoAccounts'],'id');for(var _0x419c7d=0x0,_0x1fdcfd={},_0x5b9a3b={};_0x419c7d<_0x3e34d6[_0xabf1('0x48')];_0x419c7d+=0x1){_0x1fdcfd=_0x3e34d6[_0x419c7d];if(_[_0xabf1('0x44')](_0x4b6466[_0xabf1('0x21')][_0x1fdcfd['id']])){_0x4b6466[_0xabf1('0x21')][_0x1fdcfd['id']]=new ZohoAccount(_0x1fdcfd);}else{_0x4b6466['mergeFromDatabase'](_0x4b6466[_0xabf1('0x21')][_0x1fdcfd['id']],_0x1fdcfd);}}}return _0x4b6466[_0xabf1('0x21')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x50')]=function(){var _0x442b65=this;return function(_0xbceca7){if(_0xbceca7){freeIsNotKey(_0xbceca7,_0x442b65[_0xabf1('0x22')],'id');for(var _0x53618a=0x0,_0x3d5fe4={},_0x3f2313={};_0x53618a<_0xbceca7[_0xabf1('0x48')];_0x53618a+=0x1){_0x3d5fe4=_0xbceca7[_0x53618a];if(_[_0xabf1('0x44')](_0x442b65[_0xabf1('0x22')][_0x3d5fe4['id']])){_0x442b65[_0xabf1('0x22')][_0x3d5fe4['id']]=new DeskAccount(_0x3d5fe4);}else{_0x442b65[_0xabf1('0x45')](_0x442b65[_0xabf1('0x22')][_0x3d5fe4['id']],_0x3d5fe4);}}}return _0x442b65[_0xabf1('0x22')];};};Realtime[_0xabf1('0x42')]['initSugarcrmAccounts']=function(){var _0x4e4cee=this;return function(_0x2310eb){if(_0x2310eb){freeIsNotKey(_0x2310eb,_0x4e4cee[_0xabf1('0x20')],'id');for(var _0x509487=0x0,_0x1df686={},_0x115fab={};_0x509487<_0x2310eb['length'];_0x509487+=0x1){_0x1df686=_0x2310eb[_0x509487];if(_[_0xabf1('0x44')](_0x4e4cee[_0xabf1('0x20')][_0x1df686['id']])){_0x4e4cee[_0xabf1('0x20')][_0x1df686['id']]=new SugarcrmAccount(_0x1df686);}else{_0x4e4cee[_0xabf1('0x45')](_0x4e4cee[_0xabf1('0x20')][_0x1df686['id']],_0x1df686);}}}return _0x4e4cee['sugarcrmAccounts'];};};Realtime[_0xabf1('0x42')]['initVtigerAccounts']=function(){var _0x529226=this;return function(_0x449b57){if(_0x449b57){freeIsNotKey(_0x449b57,_0x529226[_0xabf1('0x23')],'id');for(var _0x3716e2=0x0,_0x119ef5={},_0x6ffb44={};_0x3716e2<_0x449b57[_0xabf1('0x48')];_0x3716e2+=0x1){_0x119ef5=_0x449b57[_0x3716e2];if(_[_0xabf1('0x44')](_0x529226[_0xabf1('0x23')][_0x119ef5['id']])){_0x529226[_0xabf1('0x23')][_0x119ef5['id']]=new VtigerAccount(_0x119ef5);}else{_0x529226[_0xabf1('0x45')](_0x529226[_0xabf1('0x23')][_0x119ef5['id']],_0x119ef5);}}}return _0x529226[_0xabf1('0x23')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x51')]=function(){var _0x23b8ab=this;return function(_0x10e97f){if(_0x10e97f){freeIsNotKey(_0x10e97f,_0x23b8ab[_0xabf1('0x24')],'id');for(var _0x33daff=0x0,_0x484d6f={},_0x350de7={};_0x33daff<_0x10e97f[_0xabf1('0x48')];_0x33daff+=0x1){_0x484d6f=_0x10e97f[_0x33daff];if(_['isUndefined'](_0x23b8ab['servicenowAccounts'][_0x484d6f['id']])){_0x23b8ab[_0xabf1('0x24')][_0x484d6f['id']]=new ServicenowAccount(_0x484d6f);}else{_0x23b8ab['mergeFromDatabase'](_0x23b8ab['servicenowAccounts'][_0x484d6f['id']],_0x484d6f);}}}return _0x23b8ab['servicenowAccounts'];};};Realtime['prototype'][_0xabf1('0x52')]=function(){var _0x1e8b2f=this;return function(_0x362f1f){if(_0x362f1f){freeIsNotKey(_0x362f1f,_0x1e8b2f[_0xabf1('0x53')],'id');for(var _0x4c83d0=0x0,_0x20c479={},_0x232d19={};_0x4c83d0<_0x362f1f[_0xabf1('0x48')];_0x4c83d0+=0x1){_0x20c479=_0x362f1f[_0x4c83d0];if(_['isUndefined'](_0x1e8b2f[_0xabf1('0x53')][_0x20c479['id']])){_0x1e8b2f[_0xabf1('0x53')][_0x20c479['id']]=new Dynamics365Account(_0x20c479);}else{_0x1e8b2f['mergeFromDatabase'](_0x1e8b2f[_0xabf1('0x53')][_0x20c479['id']],_0x20c479);}}}return _0x1e8b2f[_0xabf1('0x53')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x54')]=function(){var _0xa14ea5=this;return function(_0x80b29f){for(var _0x38dbfd=0x0;_0x38dbfd<_0x80b29f[_0xabf1('0x48')];_0x38dbfd+=0x1){_[_0xabf1('0x55')](_0xa14ea5[_0xabf1('0x17')][_0x80b29f[_0x38dbfd][_0xabf1('0x29')]],_0x80b29f[_0x38dbfd]);}return _0xa14ea5[_0xabf1('0x17')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x56')]=function(){var _0x5a3fcc=this;return function(_0x2ce5ec){clearVoiceQueues(_0x5a3fcc['voiceQueues']);if(_0x2ce5ec){_0x2ce5ec=_['groupBy'](_0x2ce5ec,'uniqueid');for(var _0x9100a9 in _0x2ce5ec){if(_0x2ce5ec[_0xabf1('0x27')](_0x9100a9)){var _0x145563={};for(var _0x331512=0x0;_0x331512<_0x2ce5ec[_0x9100a9]['length'];_0x331512+=0x1){var _0x38085d=_0x2ce5ec[_0x9100a9][_0x331512][_0xabf1('0x57')];if(_0x5a3fcc[_0xabf1('0x17')][_0x38085d]){if(_0x2ce5ec[_0x9100a9][_0x331512]['queuecallerexit']){_0x5a3fcc[_0xabf1('0x17')][_0x38085d][_0xabf1('0x58')]+=0x1;}if(_0x2ce5ec[_0x9100a9][_0x331512]['queuecallerabandon']){_0x5a3fcc[_0xabf1('0x17')][_0x38085d][_0xabf1('0x34')]+=0x1;}_0x5a3fcc[_0xabf1('0x17')][_0x38085d][_0xabf1('0x2f')]+=moment(_0x2ce5ec[_0x9100a9][_0x331512][_0xabf1('0x59')])[_0xabf1('0x5a')](moment(_0x2ce5ec[_0x9100a9][_0x331512][_0xabf1('0x5b')]),_0xabf1('0x5c'))||0x0;if(_0x331512===_0x2ce5ec[_0x9100a9]['length']-0x1){_0x5a3fcc[_0xabf1('0x17')][_0x38085d][_0xabf1('0x30')]+=moment(_0x2ce5ec[_0x9100a9][_0x331512][_0xabf1('0x5d')]||_0x2ce5ec[_0x9100a9][_0x331512][_0xabf1('0x5e')]||_0x2ce5ec[_0x9100a9][_0x331512][_0xabf1('0x5f')])['diff'](moment(_0x2ce5ec[_0x9100a9][_0x331512][_0xabf1('0x5b')]),_0xabf1('0x5c'))||0x0;_0x5a3fcc['voiceQueues'][_0x38085d][_0xabf1('0x2d')]+=0x1;if(_0x2ce5ec[_0x9100a9][_0x331512]['queuecallercomplete']){_0x5a3fcc[_0xabf1('0x17')][_0x38085d][_0xabf1('0x2e')]+=0x1;_0x5a3fcc[_0xabf1('0x17')][_0x38085d][_0xabf1('0x35')]+=moment(_0x2ce5ec[_0x9100a9][_0x331512]['queuecallercompleteAt'])['diff'](moment(_0x2ce5ec[_0x9100a9][_0x331512][_0xabf1('0x59')]),_0xabf1('0x5c'))||0x0;}}else{_0x5a3fcc[_0xabf1('0x17')][_0x38085d][_0xabf1('0x30')]+=_0x5a3fcc['voiceQueues'][_0x38085d]['sumHoldTime']||0x0;}}}}}}return _0x5a3fcc[_0xabf1('0x17')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x60')]=function(){var _0x45fae7=this;return function(_0x3d243d){clearVoiceCallReports(_0x45fae7[_0xabf1('0x1a')]);if(_0x3d243d){for(var _0x4d10ff=0x0;_0x4d10ff<_0x3d243d[_0xabf1('0x48')];_0x4d10ff+=0x1){_0x45fae7['outbound'][_0xabf1('0x2d')]+=0x1;_0x45fae7['outbound'][_0xabf1('0x30')]+=_0x3d243d[_0x4d10ff][_0xabf1('0x61')];if(_0x3d243d[_0x4d10ff]['disposition']==='ANSWERED'){_0x45fae7[_0xabf1('0x1a')][_0xabf1('0x2e')]+=0x1;_0x45fae7['outbound'][_0xabf1('0x2f')]+=_0x3d243d[_0x4d10ff]['duration']-_0x3d243d[_0x4d10ff][_0xabf1('0x62')]||0x0;_0x45fae7[_0xabf1('0x1a')][_0xabf1('0x35')]+=_0x3d243d[_0x4d10ff]['billableseconds'];}}}return _0x45fae7[_0xabf1('0x1a')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x63')]=function(){var _0x5e196a=this;return function(_0x3d64f8){if(_0x3d64f8){freeIsNotKey(_0x3d64f8,_0x5e196a['campaigns'],'name');for(var _0x4941bd=0x0,_0x4084d9={};_0x4941bd<_0x3d64f8[_0xabf1('0x48')];_0x4941bd+=0x1){_0x4084d9=_0x3d64f8[_0x4941bd];if(_[_0xabf1('0x44')](_0x5e196a['campaigns'][_0x4084d9[_0xabf1('0x29')]])){_0x5e196a[_0xabf1('0x18')][_0x4084d9[_0xabf1('0x29')]]=new Campaign(_0x4084d9);}else{_0x5e196a[_0xabf1('0x45')](_0x5e196a['campaigns'][_0x4084d9[_0xabf1('0x29')]],_0x4084d9);}}}return _0x5e196a[_0xabf1('0x18')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x64')]=function(){var _0x27be1e=this;return function(_0x115218){if(_0x115218){freeIsNotKey(_0x115218,_0x27be1e['voiceExtensions'],'id');for(var _0x999f43=0x0,_0xc4fd6b={};_0x999f43<_0x115218[_0xabf1('0x48')];_0x999f43+=0x1){_0xc4fd6b=_0x115218[_0x999f43];if(_['isUndefined'](_0x27be1e[_0xabf1('0x1b')][_0xc4fd6b['id']])){_0x27be1e[_0xabf1('0x1b')][_0xc4fd6b['id']]=new VoiceExtension(_0xc4fd6b);}else{_0x27be1e[_0xabf1('0x45')](_0x27be1e[_0xabf1('0x1b')][_0xc4fd6b['id']],_0xc4fd6b);}}}return _0x27be1e[_0xabf1('0x1b')];};};Realtime[_0xabf1('0x42')]['initCampaignHopperHistory']=function(){var _0x2bc6e2=this;return function(_0x528c50){clearCampaigns(_0x2bc6e2[_0xabf1('0x18')]);for(var _0x474f0b=0x0;_0x474f0b<_0x528c50['length'];_0x474f0b+=0x1){_[_0xabf1('0x55')](_0x2bc6e2[_0xabf1('0x18')][_0x528c50[_0x474f0b][_0xabf1('0x29')]],_0x528c50[_0x474f0b]);}return _0x2bc6e2[_0xabf1('0x18')];};};Realtime[_0xabf1('0x42')][_0xabf1('0x65')]=function(){var _0x5507cf=this;return function(_0x2ba3d3){if(_0x2ba3d3){freeIsNotKey(_0x2ba3d3,_0x5507cf[_0xabf1('0x25')],'id');for(var _0x52c59e=0x0,_0x3b72c3={},_0x3e58f2={};_0x52c59e<_0x2ba3d3[_0xabf1('0x48')];_0x52c59e+=0x1){_0x3b72c3=_0x2ba3d3[_0x52c59e];if(_[_0xabf1('0x44')](_0x5507cf[_0xabf1('0x25')][_0x3b72c3['id']])){_0x5507cf[_0xabf1('0x25')][_0x3b72c3['id']]=new FaxAccount(_0x3b72c3);}else{_0x5507cf[_0xabf1('0x45')](_0x5507cf[_0xabf1('0x25')][_0x3b72c3['id']],_0x3b72c3);}}}return _0x5507cf['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index e4afebf..e4bca61 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 _0x4220=['format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','isNil','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','YYYY-MM-DD\x20HH:mm:ss','create','destination','exten','type','dialer','lastapplication','queue','context','from-voip-provider','callerid','from-sip','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','startsWith','Local','indexOf','phone','lastIndexOf','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceQueueReport','../rpc/voiceTransferReport','./voiceQueueReport','./voiceCallReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','custom:voiceCallReport','voiceCallReport','bind','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','name','find','accountcode','interface'];(function(_0x2649e2,_0x3e73be){var _0x4797d4=function(_0xfa2d8b){while(--_0xfa2d8b){_0x2649e2['push'](_0x2649e2['shift']());}};_0x4797d4(++_0x3e73be);}(_0x4220,0x7f));var _0x0422=function(_0x148451,_0xb71527){_0x148451=_0x148451-0x0;var _0x312d1e=_0x4220[_0x148451];return _0x312d1e;};'use strict';var BPromise=require(_0x0422('0x0'));var _=require(_0x0422('0x1'));var moment=require(_0x0422('0x2'));var util=require(_0x0422('0x3'));var config=require(_0x0422('0x4'));var logger=require(_0x0422('0x5'))(_0x0422('0x6'));var ami=require('../ami');var RpcVoiceAgentReport=require(_0x0422('0x7'));var RpcVoiceCallReport=require(_0x0422('0x8'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x0422('0x9'));var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require(_0x0422('0xa'));var VoiceQueueReport=require(_0x0422('0xb'));var VoiceCallReport=require(_0x0422('0xc'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require('./voiceDialReport');var UserReport=require(_0x0422('0xd'));function Report(_0x1073e2){this[_0x0422('0xe')]=_0x1073e2;this[_0x0422('0xf')]=_0x1073e2[_0x0422('0xf')];this['telephones']=_0x1073e2[_0x0422('0x10')];}Report[_0x0422('0x11')][_0x0422('0x12')]=function(_0x46d479){var _0x588bca=new VoiceQueueReport(this[_0x0422('0xe')]);var _0x4b11bb=new VoiceAgentReport(this[_0x0422('0xe')]);var _0x5321d1=new VoiceDialReport(this[_0x0422('0xe')]);var _0x214350=new VoiceCallReport(this['realtime']);var _0x4cf24a=new UserReport(this[_0x0422('0xe')]);if(config[_0x0422('0x13')]&&config[_0x0422('0x13')][_0x0422('0x14')]){ami['on'](_0x0422('0x15'),this[_0x0422('0x16')]['bind'](this));ami['on'](_0x0422('0x17'),this[_0x0422('0x18')][_0x0422('0x19')](this));ami['on']('custom:voiceAgentReport',this[_0x0422('0x1a')]['bind'](this));ami['on'](_0x0422('0x1b'),this[_0x0422('0x1c')]['bind'](this));ami['on']('blindtransfer',this[_0x0422('0x1d')]['bind'](this));ami['on'](_0x0422('0x1e'),this[_0x0422('0x1f')][_0x0422('0x19')](this));}};Report[_0x0422('0x11')][_0x0422('0x20')]=function(_0x356316){var _0x3ef07f=undefined;_0x3ef07f=_['find'](this[_0x0422('0xf')],function(_0x531496){return _0x531496['accountcode']==_0x356316||_0x531496[_0x0422('0x21')]==_0x356316;});if(_['isNil'](_0x3ef07f)){var _0x435769=_[_0x0422('0x22')](this[_0x0422('0x10')],function(_0x3dea04){return _0x3dea04[_0x0422('0x23')]==_0x356316||_0x3dea04[_0x0422('0x21')]==_0x356316;});if(_0x435769){_0x3ef07f=_[_0x0422('0x22')](this[_0x0422('0xf')],function(_0x1652c4){return _0x1652c4[_0x0422('0x24')]==util[_0x0422('0x25')](_0x0422('0x26'),_0x435769['name']);});}}return _0x3ef07f;};Report['prototype'][_0x0422('0x16')]=function(_0x471b6c){for(var _0x4719bd=0x0;_0x4719bd<_0x471b6c[_0x0422('0x27')];_0x4719bd+=0x1){var _0x2dc940=this['findAgent'](_0x471b6c[_0x4719bd][_0x0422('0x28')]);if(_0x2dc940){_0x471b6c[_0x4719bd][_0x0422('0x23')]=_0x2dc940[_0x0422('0x23')];_0x471b6c[_0x4719bd][_0x0422('0x29')]=!![];_0x471b6c[_0x4719bd][_0x0422('0x2a')]=_0x2dc940[_0x0422('0x21')];_0x471b6c[_0x4719bd][_0x0422('0x24')]=_[_0x0422('0x2b')](_0x2dc940['interface'])?util['format'](_0x0422('0x26'),_0x2dc940['name']):_0x2dc940[_0x0422('0x24')];if(_0x471b6c[_0x4719bd][_0x0422('0x2c')]){_0x471b6c[_0x4719bd][_0x0422('0x2d')]=moment()[_0x0422('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x471b6c[_0x4719bd][_0x0422('0x2e')]){_0x471b6c[_0x4719bd][_0x0422('0x2f')]=moment()[_0x0422('0x25')](_0x0422('0x30'));}RpcMemberReport[_0x0422('0x16')](_0x471b6c[_0x4719bd]);}RpcVoiceQueueReport[_0x0422('0x31')](_0x471b6c[_0x4719bd]);}};function extractCalleridNumber(_0x5b27a2){var _0x2b9be1=_0x5b27a2['match'](/<(.*?)>/);return _0x2b9be1?_0x2b9be1[0x1]:_0x5b27a2;}Report[_0x0422('0x11')]['voiceCallReport']=function(_0x305886){_0x305886[_0x0422('0x32')]=_0x305886['destination']||_0x305886[_0x0422('0x33')];if(_0x305886[_0x0422('0x34')]==_0x0422('0x35')){_0x305886[_0x0422('0x36')]=_0x0422('0x37');_0x305886['lastdata']=_0x305886[_0x0422('0x37')];if(_0x305886[_0x0422('0x38')]==_0x0422('0x39')){_0x305886[_0x0422('0x23')]='';_0x305886[_0x0422('0x32')]=extractCalleridNumber(_0x305886[_0x0422('0x3a')]);}else if(_0x305886[_0x0422('0x38')]==_0x0422('0x3b')){if(_0x305886['destination']=='xcally-motion-preview'){_0x305886[_0x0422('0x32')]=extractCalleridNumber(_0x305886[_0x0422('0x3c')]);_0x305886[_0x0422('0x3d')]=_0x305886[_0x0422('0x3e')];_0x305886[_0x0422('0x3f')]=[_0x305886[_0x0422('0x40')],_0x305886[_0x0422('0x40')]=_0x305886[_0x0422('0x3f')]][0x0];_0x305886[_0x0422('0x3a')]=_0x305886[_0x0422('0x3c')];}else{_0x305886[_0x0422('0x32')]=_0x305886[_0x0422('0x3d')];_0x305886[_0x0422('0x3d')]=_0x305886['originatecalleridnum'];if(_0x305886['disposition']=='ANSWERED'){_0x305886[_0x0422('0x23')]=_0x305886[_0x0422('0x28')];}else{_0x305886[_0x0422('0x23')]='';}}}}else{_0x305886['callerid']=util[_0x0422('0x25')](_0x0422('0x41'),_0x305886[_0x0422('0x42')],_0x305886[_0x0422('0x3d')]);}RpcVoiceCallReport[_0x0422('0x31')](_0x305886);if(_0x305886[_0x0422('0x43')]){for(var _0x27f804=0x0;_0x27f804<_0x305886[_0x0422('0x44')][_0x0422('0x27')];_0x27f804+=0x1){_0x305886[_0x0422('0x45')]=_0x305886[_0x0422('0x44')][_0x27f804]['filename'];_0x305886[_0x0422('0x46')]=_0x305886['monitors'][_0x27f804][_0x0422('0x46')];if(_0x305886[_0x0422('0x33')]==_0x0422('0x47')){_0x305886[_0x0422('0x3d')]=_0x305886[_0x0422('0x28')];_0x305886[_0x0422('0x42')]=_0x305886['connectedlinename'];_0x305886[_0x0422('0x28')]=_0x305886['accountcode'];_0x305886[_0x0422('0x48')]=_0x305886[_0x0422('0x49')];_0x305886[_0x0422('0x33')]=_0x305886[_0x0422('0x3e')];}else if(_0x305886[_0x0422('0x33')]==_0x0422('0x4a')){_0x305886[_0x0422('0x3d')]=_0x305886['destination'];_0x305886[_0x0422('0x33')]=_0x305886[_0x0422('0x3e')];}RpcVoiceRecording['create'](_0x305886);}}};Report[_0x0422('0x11')][_0x0422('0x1a')]=function(_0x3d6005){if(_[_0x0422('0x4b')](_0x3d6005)){_0x3d6005['forEach'](function(_0x452c8f){RpcVoiceAgentReport[_0x0422('0x31')](_0x452c8f);});}else{RpcVoiceAgentReport[_0x0422('0x31')](_0x3d6005);}};Report[_0x0422('0x11')]['voiceDialReport']=function(_0x132dbe){RpcVoiceDialReport[_0x0422('0x31')](_0x132dbe);var _0x461a17=undefined;var _0x3f6122=_0x132dbe[_0x0422('0x40')];if(_[_0x0422('0x4c')](_0x3f6122,_0x0422('0x4d'))){var _0x6d4d08=_0x3f6122['substring'](_0x3f6122[_0x0422('0x4e')]('/')+0x1,_0x3f6122['indexOf']('@'));_0x461a17=_['find'](this[_0x0422('0xf')],function(_0x47a80b){return _0x47a80b['mobile']==_0x6d4d08||_0x47a80b[_0x0422('0x4f')]==_0x6d4d08||_0x47a80b['accountcode']==_0x6d4d08;});}else{var _0x6d4d08=_0x3f6122['substring'](_0x3f6122[_0x0422('0x4e')]('/')+0x1,_0x3f6122[_0x0422('0x50')]('-'));_0x461a17=this[_0x0422('0x20')](_0x6d4d08);}if(_0x461a17){_0x132dbe['interface']=_[_0x0422('0x2b')](_0x461a17[_0x0422('0x24')])?util[_0x0422('0x25')](_0x0422('0x26'),_0x461a17['name']):_0x461a17[_0x0422('0x24')];_0x132dbe[_0x0422('0x49')]=_0x461a17[_0x0422('0x21')];_0x132dbe[_0x0422('0x23')]=_0x461a17['accountcode'];RpcMemberReport[_0x0422('0x1c')](_0x132dbe);}};Report[_0x0422('0x11')]['blindTransfer']=function(_0x303e5a){RpcVoiceTransferReport['blindTransfer'](_0x303e5a);};Report[_0x0422('0x11')][_0x0422('0x1f')]=function(_0x25e23c){RpcVoiceTransferReport['attendedTransfer'](_0x25e23c);};module[_0x0422('0x51')]=Report; \ No newline at end of file +var _0x3561=['moment','../../../config/environment','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','../rpc/voiceTransferReport','./voiceQueueReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','name','isNil','interface','SIP/%s','connectedlinenum','assigned','lastAssignedTo','format','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','create','match','destination','type','lastapplication','queue','lastdata','context','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','monitors','length','filename','createdAt','connectedlinename','membername','exten','xcally-motion-dialer','forEach','startsWith','Local','substring','mobile','bluebird','lodash'];(function(_0x1e5323,_0x34b5ae){var _0x3b5bc5=function(_0x1f715e){while(--_0x1f715e){_0x1e5323['push'](_0x1e5323['shift']());}};_0x3b5bc5(++_0x34b5ae);}(_0x3561,0x9c));var _0x1356=function(_0xa2b6c1,_0x121a00){_0xa2b6c1=_0xa2b6c1-0x0;var _0x19a5d0=_0x3561[_0xa2b6c1];return _0x19a5d0;};'use strict';var BPromise=require(_0x1356('0x0'));var _=require(_0x1356('0x1'));var moment=require(_0x1356('0x2'));var util=require('util');var config=require(_0x1356('0x3'));var logger=require('../../../config/logger')(_0x1356('0x4'));var ami=require(_0x1356('0x5'));var RpcVoiceAgentReport=require(_0x1356('0x6'));var RpcVoiceCallReport=require(_0x1356('0x7'));var RpcVoiceDialReport=require(_0x1356('0x8'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0x1356('0x9'));var RpcVoiceRecording=require(_0x1356('0xa'));var RpcVoiceTransferReport=require(_0x1356('0xb'));var VoiceQueueReport=require(_0x1356('0xc'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x1356('0xd'));var UserReport=require(_0x1356('0xe'));function Report(_0x57517a){this[_0x1356('0xf')]=_0x57517a;this[_0x1356('0x10')]=_0x57517a['agents'];this[_0x1356('0x11')]=_0x57517a['telephones'];}Report[_0x1356('0x12')][_0x1356('0x13')]=function(_0x109663){var _0x3120fc=new VoiceQueueReport(this[_0x1356('0xf')]);var _0x31259b=new VoiceAgentReport(this[_0x1356('0xf')]);var _0x3c264c=new VoiceDialReport(this[_0x1356('0xf')]);var _0x27d47b=new VoiceCallReport(this[_0x1356('0xf')]);var _0x17a7b8=new UserReport(this['realtime']);if(config[_0x1356('0x14')]&&config['xdr'][_0x1356('0x15')]){ami['on'](_0x1356('0x16'),this[_0x1356('0x17')][_0x1356('0x18')](this));ami['on']('custom:voiceCallReport',this[_0x1356('0x19')][_0x1356('0x18')](this));ami['on'](_0x1356('0x1a'),this[_0x1356('0x1b')][_0x1356('0x18')](this));ami['on'](_0x1356('0x1c'),this[_0x1356('0x1d')][_0x1356('0x18')](this));ami['on']('blindtransfer',this[_0x1356('0x1e')][_0x1356('0x18')](this));ami['on'](_0x1356('0x1f'),this[_0x1356('0x20')][_0x1356('0x18')](this));}};Report[_0x1356('0x12')][_0x1356('0x21')]=function(_0x51b6cf){var _0x583775=undefined;_0x583775=_[_0x1356('0x22')](this['agents'],function(_0x29e750){return _0x29e750[_0x1356('0x23')]==_0x51b6cf||_0x29e750[_0x1356('0x24')]==_0x51b6cf;});if(_[_0x1356('0x25')](_0x583775)){var _0x282ab1=_[_0x1356('0x22')](this[_0x1356('0x11')],function(_0x492797){return _0x492797[_0x1356('0x23')]==_0x51b6cf||_0x492797[_0x1356('0x24')]==_0x51b6cf;});if(_0x282ab1){_0x583775=_['find'](this[_0x1356('0x10')],function(_0x840460){return _0x840460[_0x1356('0x26')]==util['format'](_0x1356('0x27'),_0x282ab1[_0x1356('0x24')]);});}}return _0x583775;};Report['prototype'][_0x1356('0x17')]=function(_0x4ae3a7){for(var _0x5253d6=0x0;_0x5253d6<_0x4ae3a7['length'];_0x5253d6+=0x1){var _0x3308f6=this[_0x1356('0x21')](_0x4ae3a7[_0x5253d6][_0x1356('0x28')]);if(_0x3308f6){_0x4ae3a7[_0x5253d6][_0x1356('0x23')]=_0x3308f6['accountcode'];_0x4ae3a7[_0x5253d6][_0x1356('0x29')]=!![];_0x4ae3a7[_0x5253d6][_0x1356('0x2a')]=_0x3308f6['name'];_0x4ae3a7[_0x5253d6][_0x1356('0x26')]=_[_0x1356('0x25')](_0x3308f6[_0x1356('0x26')])?util[_0x1356('0x2b')](_0x1356('0x27'),_0x3308f6[_0x1356('0x24')]):_0x3308f6['interface'];if(_0x4ae3a7[_0x5253d6][_0x1356('0x2c')]){_0x4ae3a7[_0x5253d6][_0x1356('0x2d')]=moment()[_0x1356('0x2b')](_0x1356('0x2e'));}if(_0x4ae3a7[_0x5253d6][_0x1356('0x2f')]){_0x4ae3a7[_0x5253d6]['queuecallerexitAt']=moment()['format'](_0x1356('0x2e'));}RpcMemberReport['voiceQueueReport'](_0x4ae3a7[_0x5253d6]);}RpcVoiceQueueReport[_0x1356('0x30')](_0x4ae3a7[_0x5253d6]);}};function extractCalleridNumber(_0x58735a){var _0x11f02d=_0x58735a[_0x1356('0x31')](/<(.*?)>/);return _0x11f02d?_0x11f02d[0x1]:_0x58735a;}Report[_0x1356('0x12')][_0x1356('0x19')]=function(_0x45256e){_0x45256e[_0x1356('0x32')]=_0x45256e[_0x1356('0x32')]||_0x45256e['exten'];if(_0x45256e[_0x1356('0x33')]=='dialer'){_0x45256e[_0x1356('0x34')]=_0x1356('0x35');_0x45256e[_0x1356('0x36')]=_0x45256e[_0x1356('0x35')];if(_0x45256e[_0x1356('0x37')]=='from-voip-provider'){_0x45256e[_0x1356('0x23')]='';_0x45256e[_0x1356('0x32')]=extractCalleridNumber(_0x45256e['callerid']);}else if(_0x45256e[_0x1356('0x37')]=='from-sip'){if(_0x45256e[_0x1356('0x32')]==_0x1356('0x38')){_0x45256e[_0x1356('0x32')]=extractCalleridNumber(_0x45256e[_0x1356('0x39')]);_0x45256e[_0x1356('0x3a')]=_0x45256e[_0x1356('0x3b')];_0x45256e[_0x1356('0x3c')]=[_0x45256e['channel'],_0x45256e[_0x1356('0x3d')]=_0x45256e[_0x1356('0x3c')]][0x0];_0x45256e[_0x1356('0x3e')]=_0x45256e[_0x1356('0x39')];}else{_0x45256e[_0x1356('0x32')]=_0x45256e[_0x1356('0x3a')];_0x45256e[_0x1356('0x3a')]=_0x45256e[_0x1356('0x3b')];if(_0x45256e[_0x1356('0x3f')]==_0x1356('0x40')){_0x45256e[_0x1356('0x23')]=_0x45256e[_0x1356('0x28')];}else{_0x45256e[_0x1356('0x23')]='';}}}}else{_0x45256e[_0x1356('0x3e')]=util[_0x1356('0x2b')](_0x1356('0x41'),_0x45256e['calleridname'],_0x45256e[_0x1356('0x3a')]);}RpcVoiceCallReport[_0x1356('0x30')](_0x45256e);if(_0x45256e['monitor']){for(var _0x4fac49=0x0;_0x4fac49<_0x45256e[_0x1356('0x42')][_0x1356('0x43')];_0x4fac49+=0x1){_0x45256e['monitorFilename']=_0x45256e['monitors'][_0x4fac49][_0x1356('0x44')];_0x45256e[_0x1356('0x45')]=_0x45256e[_0x1356('0x42')][_0x4fac49][_0x1356('0x45')];if(_0x45256e['exten']==_0x1356('0x38')){_0x45256e[_0x1356('0x3a')]=_0x45256e[_0x1356('0x28')];_0x45256e['calleridname']=_0x45256e['connectedlinename'];_0x45256e['connectedlinenum']=_0x45256e[_0x1356('0x23')];_0x45256e[_0x1356('0x46')]=_0x45256e[_0x1356('0x47')];_0x45256e[_0x1356('0x48')]=_0x45256e[_0x1356('0x3b')];}else if(_0x45256e[_0x1356('0x48')]==_0x1356('0x49')){_0x45256e[_0x1356('0x3a')]=_0x45256e['destination'];_0x45256e['exten']=_0x45256e['originatecalleridnum'];}RpcVoiceRecording['create'](_0x45256e);}}};Report[_0x1356('0x12')]['voiceAgentReport']=function(_0x1ebc21){if(_['isArray'](_0x1ebc21)){_0x1ebc21[_0x1356('0x4a')](function(_0x57d2f3){RpcVoiceAgentReport[_0x1356('0x30')](_0x57d2f3);});}else{RpcVoiceAgentReport[_0x1356('0x30')](_0x1ebc21);}};Report[_0x1356('0x12')]['voiceDialReport']=function(_0x20987f){RpcVoiceDialReport[_0x1356('0x30')](_0x20987f);var _0x4d5650=undefined;var _0x25b0dc=_0x20987f[_0x1356('0x3d')];if(_[_0x1356('0x4b')](_0x25b0dc,_0x1356('0x4c'))){var _0x5c6283=_0x25b0dc[_0x1356('0x4d')](_0x25b0dc['indexOf']('/')+0x1,_0x25b0dc['indexOf']('@'));_0x4d5650=_[_0x1356('0x22')](this[_0x1356('0x10')],function(_0x2889aa){return _0x2889aa[_0x1356('0x4e')]==_0x5c6283||_0x2889aa['phone']==_0x5c6283||_0x2889aa[_0x1356('0x23')]==_0x5c6283;});}else{var _0x5c6283=_0x25b0dc[_0x1356('0x4d')](_0x25b0dc['indexOf']('/')+0x1,_0x25b0dc['lastIndexOf']('-'));_0x4d5650=this[_0x1356('0x21')](_0x5c6283);}if(_0x4d5650){_0x20987f[_0x1356('0x26')]=_[_0x1356('0x25')](_0x4d5650[_0x1356('0x26')])?util[_0x1356('0x2b')]('SIP/%s',_0x4d5650[_0x1356('0x24')]):_0x4d5650['interface'];_0x20987f['membername']=_0x4d5650[_0x1356('0x24')];_0x20987f[_0x1356('0x23')]=_0x4d5650[_0x1356('0x23')];RpcMemberReport[_0x1356('0x1d')](_0x20987f);}};Report[_0x1356('0x12')][_0x1356('0x1e')]=function(_0x4bb5d8){RpcVoiceTransferReport[_0x1356('0x1e')](_0x4bb5d8);};Report['prototype'][_0x1356('0x20')]=function(_0x2fc6a5){RpcVoiceTransferReport[_0x1356('0x20')](_0x2fc6a5);};module['exports']=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 275b45a..40f38a8 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 _0x222f=['syncRegistry','registry','devicestatechange','bind','peerstatus','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','isUndefined','emit','find','username','stateRegistry','state','merge','event','actionid','format','name','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','local','toLowerCase','inuse','stateTime','updateStatusRealtime','toNumber','trunk:%s','startsWith','Local','substring','indexOf','mobile','accountcode','[syncDeviceState][UserReport]','peer','registered','address','status','telephone:%s','telephone:save','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones'];(function(_0x254dbd,_0x12696f){var _0x2a3436=function(_0x256fa0){while(--_0x256fa0){_0x254dbd['push'](_0x254dbd['shift']());}};_0x2a3436(++_0x12696f);}(_0x222f,0x103));var _0xf222=function(_0x40c62b,_0x2c2efe){_0x40c62b=_0x40c62b-0x0;var _0x568cf0=_0x222f[_0x40c62b];return _0x568cf0;};'use strict';var _=require(_0xf222('0x0'));var moment=require(_0xf222('0x1'));var BPromise=require(_0xf222('0x2'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xf222('0x3'))(_0xf222('0x4'));var ami=require(_0xf222('0x5'));config[_0xf222('0x6')]=_[_0xf222('0x7')](config[_0xf222('0x6')],{'host':_0xf222('0x8'),'port':0x18eb});var io=require(_0xf222('0x9'))(new Redis(config[_0xf222('0x6')]));function UserReport(_0x3b7c54){this[_0xf222('0xa')]=_0x3b7c54[_0xf222('0xa')];this[_0xf222('0xb')]=_0x3b7c54[_0xf222('0xb')];this[_0xf222('0xc')]=_0x3b7c54[_0xf222('0xc')];ami['on']('registryentry',this[_0xf222('0xd')]['bind'](this));ami['on'](_0xf222('0xe'),this[_0xf222('0xd')]['bind'](this));ami['on'](_0xf222('0xf'),this['syncDeviceState'][_0xf222('0x10')](this));ami['on'](_0xf222('0x11'),this[_0xf222('0x12')][_0xf222('0x10')](this));this[_0xf222('0x13')]();return BPromise[_0xf222('0x14')]()[_0xf222('0x15')](ami[_0xf222('0x16')]())['then'](ami[_0xf222('0x17')]())[_0xf222('0x15')](ami[_0xf222('0x18')]())[_0xf222('0x19')](loggerCatch(_0xf222('0x1a')));}function loggerCatch(_0x1e5066){return function(_0x11c5bb){logger[_0xf222('0x1b')](_0x1e5066,util[_0xf222('0x1c')](_0x11c5bb,{'showHidden':![],'depth':null}));};}UserReport[_0xf222('0x1d')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0xf222('0x15')](ami[_0xf222('0x16')]())[_0xf222('0x15')](ami[_0xf222('0x17')]())[_0xf222('0x15')](ami[_0xf222('0x18')]())[_0xf222('0x19')](loggerCatch(_0xf222('0x1a')));},0x32c8);};UserReport[_0xf222('0x1d')][_0xf222('0x1e')]=function(_0x14c553){return _0x14c553!==null&&!_[_0xf222('0x1f')](_0x14c553);};UserReport[_0xf222('0x1d')]['emit']=function(_0x57f187,_0x433d31,_0x2ed6d3){io['to'](_0x57f187)[_0xf222('0x20')](_0x433d31,_0x2ed6d3);};UserReport[_0xf222('0x1d')][_0xf222('0xd')]=function(_0x3da7e2){try{if(this['isNotNull'](_0x3da7e2)){var _0x35cd07=_[_0xf222('0x21')](this[_0xf222('0xa')],{'registry':_0x3da7e2[_0xf222('0x22')]});if(_0x35cd07){_0x3da7e2[_0xf222('0x23')]=_0x3da7e2[_0xf222('0x24')];_[_0xf222('0x25')](_0x35cd07,_['omit'](_0x3da7e2,[_0xf222('0x26'),_0xf222('0x27'),_0xf222('0x22'),_0xf222('0x24')]));this[_0xf222('0x20')](util[_0xf222('0x28')]('trunk:%s',_0x35cd07[_0xf222('0x29')]),_0xf222('0x2a'),_0x35cd07);}}}catch(_0xaadbb2){logger[_0xf222('0x1b')](_0xf222('0x2b'),util[_0xf222('0x1c')](_0xaadbb2,{'showHidden':![],'depth':null}));}};UserReport[_0xf222('0x1d')][_0xf222('0x2c')]=function(_0x35b704){try{if(this[_0xf222('0x1e')](_0x35b704)){if(this[_0xf222('0xb')][_0x35b704[_0xf222('0x2d')]]){if(!this[_0xf222('0xb')][_0x35b704[_0xf222('0x2d')]][_0xf222('0x2e')]||_0x35b704['state'][_0xf222('0x2f')]()==_0xf222('0x30')){this['agents'][_0x35b704[_0xf222('0x2d')]][_0xf222('0x2e')]=![];if(this[_0xf222('0xb')][_0x35b704[_0xf222('0x2d')]]['state']!==_0x35b704[_0xf222('0x24')]['toLowerCase']()){this['agents'][_0x35b704[_0xf222('0x2d')]][_0xf222('0x31')]=_['toNumber'](moment()[_0xf222('0x28')]('x'));}this[_0xf222('0xb')][_0x35b704['device']][_0xf222('0x24')]=_0x35b704[_0xf222('0x24')][_0xf222('0x2f')]();this[_0xf222('0xb')][_0x35b704[_0xf222('0x2d')]][_0xf222('0x32')](_0x35b704);}}else if(this[_0xf222('0xc')][_0x35b704[_0xf222('0x2d')]]){if(this[_0xf222('0xc')][_0x35b704[_0xf222('0x2d')]][_0xf222('0x24')]!==_0x35b704[_0xf222('0x24')][_0xf222('0x2f')]()){this[_0xf222('0xc')][_0x35b704[_0xf222('0x2d')]][_0xf222('0x31')]=_['toNumber'](moment()[_0xf222('0x28')]('x'));}this[_0xf222('0xc')][_0x35b704[_0xf222('0x2d')]][_0xf222('0x24')]=_0x35b704[_0xf222('0x24')]['toLowerCase']();this['emit'](util[_0xf222('0x28')]('telephone:%s',this[_0xf222('0xc')][_0x35b704[_0xf222('0x2d')]][_0xf222('0x29')]),'telephone:save',this[_0xf222('0xc')][_0x35b704[_0xf222('0x2d')]]);}else if(this['trunks'][_0x35b704[_0xf222('0x2d')]]){if(this[_0xf222('0xa')][_0x35b704[_0xf222('0x2d')]][_0xf222('0x24')]!==_0x35b704[_0xf222('0x24')]['toLowerCase']()){this[_0xf222('0xa')][_0x35b704[_0xf222('0x2d')]][_0xf222('0x31')]=_[_0xf222('0x33')](moment()['format']('x'));}this['trunks'][_0x35b704[_0xf222('0x2d')]]['state']=_0x35b704['state'][_0xf222('0x2f')]();this['emit'](util[_0xf222('0x28')](_0xf222('0x34'),this['trunks'][_0x35b704[_0xf222('0x2d')]][_0xf222('0x29')]),_0xf222('0x2a'),this[_0xf222('0xa')][_0x35b704[_0xf222('0x2d')]]);}else if(_[_0xf222('0x35')](_0x35b704[_0xf222('0x2d')],'Queue')){}else if(_[_0xf222('0x35')](_0x35b704['device'],_0xf222('0x36'))){var _0x4e1b35=_0x35b704[_0xf222('0x2d')];var _0x5e0026=_0x4e1b35[_0xf222('0x37')](_0x4e1b35['indexOf']('/')+0x1,_0x4e1b35[_0xf222('0x38')]('@'));var _0x4c29d6=_['find'](this['agents'],function(_0x55f16a){return _0x55f16a[_0xf222('0x39')]==_0x5e0026||_0x55f16a['phone']==_0x5e0026||_0x55f16a[_0xf222('0x3a')]==_0x5e0026;});if(_0x4c29d6){if(_0x4c29d6[_0xf222('0x24')]!==_0x35b704[_0xf222('0x24')]['toLowerCase']()){_0x4c29d6[_0xf222('0x31')]=_[_0xf222('0x33')](moment()[_0xf222('0x28')]('x'));}_0x4c29d6[_0xf222('0x24')]=_0x35b704[_0xf222('0x24')]['toLowerCase']();_0x4c29d6[_0xf222('0x2e')]=!![];_0x4c29d6[_0xf222('0x32')](_0x35b704);}}else{}}}catch(_0x11f9d1){logger['error'](_0xf222('0x3b'),util[_0xf222('0x1c')](_0x11f9d1,{'showHidden':![],'depth':null}));}};UserReport[_0xf222('0x1d')][_0xf222('0x12')]=function(_0x427f0a){try{if(this[_0xf222('0x1e')](_0x427f0a)&&this[_0xf222('0x1e')](_0x427f0a[_0xf222('0x11')])){if(this['agents'][_0x427f0a['peer']]){if(!this[_0xf222('0xb')][_0x427f0a[_0xf222('0x3c')]][_0xf222('0x2e')]||_0x427f0a[_0xf222('0x11')][_0xf222('0x2f')]()==_0xf222('0x3d')){this[_0xf222('0xb')][_0x427f0a['peer']][_0xf222('0x2e')]=![];this['agents'][_0x427f0a[_0xf222('0x3c')]]['status']=_0x427f0a[_0xf222('0x11')][_0xf222('0x2f')]();this['agents'][_0x427f0a[_0xf222('0x3c')]][_0xf222('0x3e')]=_0x427f0a[_0xf222('0x3e')];this[_0xf222('0xb')][_0x427f0a[_0xf222('0x3c')]][_0xf222('0x32')](_0x427f0a);}}else if(this[_0xf222('0xc')][_0x427f0a[_0xf222('0x3c')]]){this[_0xf222('0xc')][_0x427f0a['peer']][_0xf222('0x3f')]=_0x427f0a[_0xf222('0x11')][_0xf222('0x2f')]();this[_0xf222('0xc')][_0x427f0a[_0xf222('0x3c')]][_0xf222('0x3e')]=_0x427f0a[_0xf222('0x3e')];this[_0xf222('0x20')](util[_0xf222('0x28')](_0xf222('0x40'),this[_0xf222('0xc')][_0x427f0a[_0xf222('0x3c')]][_0xf222('0x29')]),_0xf222('0x41'),this[_0xf222('0xc')][_0x427f0a[_0xf222('0x3c')]]);}else if(this['trunks'][_0x427f0a[_0xf222('0x3c')]]){this['trunks'][_0x427f0a[_0xf222('0x3c')]][_0xf222('0x3f')]=_0x427f0a[_0xf222('0x11')][_0xf222('0x2f')]();this[_0xf222('0xa')][_0x427f0a[_0xf222('0x3c')]][_0xf222('0x3e')]=_0x427f0a['address'];this[_0xf222('0x20')](util[_0xf222('0x28')]('trunk:%s',this[_0xf222('0xa')][_0x427f0a[_0xf222('0x3c')]][_0xf222('0x29')]),_0xf222('0x2a'),this[_0xf222('0xa')][_0x427f0a[_0xf222('0x3c')]]);}else{}}}catch(_0x6b1331){logger[_0xf222('0x1b')](_0xf222('0x42'),util[_0xf222('0x1c')](_0x6b1331,{'showHidden':![],'depth':null}));}};module[_0xf222('0x43')]=UserReport; \ No newline at end of file +var _0xfd9d=['../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','registry','syncRegistry','bind','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','catch','[loopSyncRealTimeShow]','error','inspect','prototype','isNotNull','emit','username','stateRegistry','state','merge','omit','event','actionid','name','trunk:save','[syncRegistry][UserReport]','syncDeviceState','device','local','inuse','toLowerCase','toNumber','format','updateStatusRealtime','stateTime','telephone:%s','telephone:save','trunk:%s','startsWith','Local','substring','indexOf','find','mobile','phone','[syncDeviceState][UserReport]','peerstatus','peer','registered','address','status','[syncPeerStatus][UserReport]','exports','moment','bluebird','util','ioredis','../../../config/environment'];(function(_0x20c75c,_0x3b0944){var _0x10f98b=function(_0x3f140d){while(--_0x3f140d){_0x20c75c['push'](_0x20c75c['shift']());}};_0x10f98b(++_0x3b0944);}(_0xfd9d,0xc4));var _0xdfd9=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0xfd9d[_0x231a47];return _0x48d7c9;};'use strict';var _=require('lodash');var moment=require(_0xdfd9('0x0'));var BPromise=require(_0xdfd9('0x1'));var util=require(_0xdfd9('0x2'));var Redis=require(_0xdfd9('0x3'));var config=require(_0xdfd9('0x4'));var logger=require('../../../config/logger')('ami');var ami=require(_0xdfd9('0x5'));config[_0xdfd9('0x6')]=_[_0xdfd9('0x7')](config[_0xdfd9('0x6')],{'host':_0xdfd9('0x8'),'port':0x18eb});var io=require(_0xdfd9('0x9'))(new Redis(config['redis']));function UserReport(_0x16bdd6){this['trunks']=_0x16bdd6[_0xdfd9('0xa')];this[_0xdfd9('0xb')]=_0x16bdd6[_0xdfd9('0xb')];this[_0xdfd9('0xc')]=_0x16bdd6[_0xdfd9('0xc')];ami['on']('registryentry',this['syncRegistry']['bind'](this));ami['on'](_0xdfd9('0xd'),this[_0xdfd9('0xe')][_0xdfd9('0xf')](this));ami['on']('devicestatechange',this['syncDeviceState'][_0xdfd9('0xf')](this));ami['on']('peerstatus',this[_0xdfd9('0x10')][_0xdfd9('0xf')](this));this[_0xdfd9('0x11')]();return BPromise[_0xdfd9('0x12')]()[_0xdfd9('0x13')](ami[_0xdfd9('0x14')]())[_0xdfd9('0x13')](ami[_0xdfd9('0x15')]())['then'](ami[_0xdfd9('0x16')]())[_0xdfd9('0x17')](loggerCatch(_0xdfd9('0x18')));}function loggerCatch(_0x373429){return function(_0x1f9718){logger[_0xdfd9('0x19')](_0x373429,util[_0xdfd9('0x1a')](_0x1f9718,{'showHidden':![],'depth':null}));};}UserReport[_0xdfd9('0x1b')][_0xdfd9('0x11')]=function(){setInterval(function(){BPromise[_0xdfd9('0x12')]()[_0xdfd9('0x13')](ami['actionSipShowRegistry']())[_0xdfd9('0x13')](ami[_0xdfd9('0x15')]())['then'](ami[_0xdfd9('0x16')]())[_0xdfd9('0x17')](loggerCatch('[loopSyncRealTimeShow]'));},0x32c8);};UserReport[_0xdfd9('0x1b')][_0xdfd9('0x1c')]=function(_0x50d68b){return _0x50d68b!==null&&!_['isUndefined'](_0x50d68b);};UserReport[_0xdfd9('0x1b')]['emit']=function(_0x1f985d,_0x1203c3,_0x5443ad){io['to'](_0x1f985d)[_0xdfd9('0x1d')](_0x1203c3,_0x5443ad);};UserReport[_0xdfd9('0x1b')][_0xdfd9('0xe')]=function(_0x1889df){try{if(this[_0xdfd9('0x1c')](_0x1889df)){var _0x261094=_['find'](this[_0xdfd9('0xa')],{'registry':_0x1889df[_0xdfd9('0x1e')]});if(_0x261094){_0x1889df[_0xdfd9('0x1f')]=_0x1889df[_0xdfd9('0x20')];_[_0xdfd9('0x21')](_0x261094,_[_0xdfd9('0x22')](_0x1889df,[_0xdfd9('0x23'),_0xdfd9('0x24'),_0xdfd9('0x1e'),_0xdfd9('0x20')]));this[_0xdfd9('0x1d')](util['format']('trunk:%s',_0x261094[_0xdfd9('0x25')]),_0xdfd9('0x26'),_0x261094);}}}catch(_0xf60ccb){logger[_0xdfd9('0x19')](_0xdfd9('0x27'),util[_0xdfd9('0x1a')](_0xf60ccb,{'showHidden':![],'depth':null}));}};UserReport[_0xdfd9('0x1b')][_0xdfd9('0x28')]=function(_0x215a1d){try{if(this[_0xdfd9('0x1c')](_0x215a1d)){if(this[_0xdfd9('0xb')][_0x215a1d[_0xdfd9('0x29')]]){if(!this['agents'][_0x215a1d[_0xdfd9('0x29')]][_0xdfd9('0x2a')]||_0x215a1d[_0xdfd9('0x20')]['toLowerCase']()==_0xdfd9('0x2b')){this[_0xdfd9('0xb')][_0x215a1d[_0xdfd9('0x29')]][_0xdfd9('0x2a')]=![];if(this[_0xdfd9('0xb')][_0x215a1d[_0xdfd9('0x29')]][_0xdfd9('0x20')]!==_0x215a1d[_0xdfd9('0x20')][_0xdfd9('0x2c')]()){this[_0xdfd9('0xb')][_0x215a1d[_0xdfd9('0x29')]]['stateTime']=_[_0xdfd9('0x2d')](moment()[_0xdfd9('0x2e')]('x'));}this[_0xdfd9('0xb')][_0x215a1d['device']][_0xdfd9('0x20')]=_0x215a1d['state']['toLowerCase']();this['agents'][_0x215a1d[_0xdfd9('0x29')]][_0xdfd9('0x2f')](_0x215a1d);}}else if(this['telephones'][_0x215a1d[_0xdfd9('0x29')]]){if(this[_0xdfd9('0xc')][_0x215a1d['device']][_0xdfd9('0x20')]!==_0x215a1d[_0xdfd9('0x20')][_0xdfd9('0x2c')]()){this[_0xdfd9('0xc')][_0x215a1d['device']][_0xdfd9('0x30')]=_[_0xdfd9('0x2d')](moment()[_0xdfd9('0x2e')]('x'));}this[_0xdfd9('0xc')][_0x215a1d[_0xdfd9('0x29')]][_0xdfd9('0x20')]=_0x215a1d[_0xdfd9('0x20')][_0xdfd9('0x2c')]();this[_0xdfd9('0x1d')](util[_0xdfd9('0x2e')](_0xdfd9('0x31'),this[_0xdfd9('0xc')][_0x215a1d[_0xdfd9('0x29')]][_0xdfd9('0x25')]),_0xdfd9('0x32'),this[_0xdfd9('0xc')][_0x215a1d['device']]);}else if(this['trunks'][_0x215a1d[_0xdfd9('0x29')]]){if(this[_0xdfd9('0xa')][_0x215a1d[_0xdfd9('0x29')]][_0xdfd9('0x20')]!==_0x215a1d[_0xdfd9('0x20')][_0xdfd9('0x2c')]()){this[_0xdfd9('0xa')][_0x215a1d[_0xdfd9('0x29')]]['stateTime']=_['toNumber'](moment()[_0xdfd9('0x2e')]('x'));}this[_0xdfd9('0xa')][_0x215a1d[_0xdfd9('0x29')]]['state']=_0x215a1d[_0xdfd9('0x20')][_0xdfd9('0x2c')]();this[_0xdfd9('0x1d')](util['format'](_0xdfd9('0x33'),this[_0xdfd9('0xa')][_0x215a1d[_0xdfd9('0x29')]]['name']),'trunk:save',this[_0xdfd9('0xa')][_0x215a1d[_0xdfd9('0x29')]]);}else if(_[_0xdfd9('0x34')](_0x215a1d[_0xdfd9('0x29')],'Queue')){}else if(_['startsWith'](_0x215a1d['device'],_0xdfd9('0x35'))){var _0x3f3c55=_0x215a1d['device'];var _0x3f1d01=_0x3f3c55[_0xdfd9('0x36')](_0x3f3c55[_0xdfd9('0x37')]('/')+0x1,_0x3f3c55[_0xdfd9('0x37')]('@'));var _0x5077c9=_[_0xdfd9('0x38')](this['agents'],function(_0x551ef6){return _0x551ef6[_0xdfd9('0x39')]==_0x3f1d01||_0x551ef6[_0xdfd9('0x3a')]==_0x3f1d01||_0x551ef6['accountcode']==_0x3f1d01;});if(_0x5077c9){if(_0x5077c9[_0xdfd9('0x20')]!==_0x215a1d[_0xdfd9('0x20')][_0xdfd9('0x2c')]()){_0x5077c9['stateTime']=_[_0xdfd9('0x2d')](moment()[_0xdfd9('0x2e')]('x'));}_0x5077c9['state']=_0x215a1d[_0xdfd9('0x20')]['toLowerCase']();_0x5077c9[_0xdfd9('0x2a')]=!![];_0x5077c9[_0xdfd9('0x2f')](_0x215a1d);}}else{}}}catch(_0x160e08){logger[_0xdfd9('0x19')](_0xdfd9('0x3b'),util[_0xdfd9('0x1a')](_0x160e08,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0xdfd9('0x10')]=function(_0x1545cf){try{if(this[_0xdfd9('0x1c')](_0x1545cf)&&this['isNotNull'](_0x1545cf[_0xdfd9('0x3c')])){if(this[_0xdfd9('0xb')][_0x1545cf['peer']]){if(!this[_0xdfd9('0xb')][_0x1545cf[_0xdfd9('0x3d')]][_0xdfd9('0x2a')]||_0x1545cf[_0xdfd9('0x3c')][_0xdfd9('0x2c')]()==_0xdfd9('0x3e')){this[_0xdfd9('0xb')][_0x1545cf[_0xdfd9('0x3d')]]['local']=![];this['agents'][_0x1545cf[_0xdfd9('0x3d')]]['status']=_0x1545cf['peerstatus'][_0xdfd9('0x2c')]();this['agents'][_0x1545cf[_0xdfd9('0x3d')]]['address']=_0x1545cf[_0xdfd9('0x3f')];this['agents'][_0x1545cf['peer']][_0xdfd9('0x2f')](_0x1545cf);}}else if(this['telephones'][_0x1545cf['peer']]){this[_0xdfd9('0xc')][_0x1545cf[_0xdfd9('0x3d')]][_0xdfd9('0x40')]=_0x1545cf['peerstatus'][_0xdfd9('0x2c')]();this[_0xdfd9('0xc')][_0x1545cf['peer']][_0xdfd9('0x3f')]=_0x1545cf['address'];this[_0xdfd9('0x1d')](util[_0xdfd9('0x2e')](_0xdfd9('0x31'),this[_0xdfd9('0xc')][_0x1545cf[_0xdfd9('0x3d')]][_0xdfd9('0x25')]),'telephone:save',this[_0xdfd9('0xc')][_0x1545cf['peer']]);}else if(this[_0xdfd9('0xa')][_0x1545cf[_0xdfd9('0x3d')]]){this[_0xdfd9('0xa')][_0x1545cf[_0xdfd9('0x3d')]][_0xdfd9('0x40')]=_0x1545cf[_0xdfd9('0x3c')]['toLowerCase']();this['trunks'][_0x1545cf['peer']]['address']=_0x1545cf['address'];this[_0xdfd9('0x1d')](util[_0xdfd9('0x2e')]('trunk:%s',this[_0xdfd9('0xa')][_0x1545cf['peer']][_0xdfd9('0x25')]),_0xdfd9('0x26'),this[_0xdfd9('0xa')][_0x1545cf[_0xdfd9('0x3d')]]);}else{}}}catch(_0x16c7c9){logger[_0xdfd9('0x19')](_0xdfd9('0x41'),util[_0xdfd9('0x1a')](_0x16c7c9,{'showHidden':![],'depth':null}));}};module[_0xdfd9('0x42')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 68a2ebd..0e92fcf 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 _0x4435=['syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','destuniqueid','format','called','queue','type','inbound','merge','omit','custom:agentcalled','user:%s','error','[syncAgentCalled][VoiceAgentReport]','inspect','syncAgentConnect','hasOwnProperty','agentconnectAt','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','destconnectedlinenum','membername','user:agentconnect','custom:agentconnect','agentringnoanswer','agentringnoanswerAt','YYYY-MM-DD\x20HH:mm:ss','reason','lastevent','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','talktime','transfer','agent','agentacw','acwtime','acwTimeout','user:agentcomplete','[syncAgentComplete][VoiceAgentReport]','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','memberdynamic','memberlastcall','memberpenalty','memberrealtime','isNil','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','syncAttendedTransfer','transfereeuniqueid','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','blindtransfer'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x4435,0xcd));var _0x5443=function(_0x5f1391,_0x19c132){_0x5f1391=_0x5f1391-0x0;var _0x50ebe3=_0x4435[_0x5f1391];return _0x50ebe3;};'use strict';var _=require(_0x5443('0x0'));var moment=require(_0x5443('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x5443('0x2'))(_0x5443('0x3'));var ami=require(_0x5443('0x4'));config[_0x5443('0x5')]=_[_0x5443('0x6')](config[_0x5443('0x5')],{'host':_0x5443('0x7'),'port':0x18eb});var io=require(_0x5443('0x8'))(new Redis(config[_0x5443('0x5')]));function VoiceAgentReport(_0x1c0cfe){this[_0x5443('0x9')]={};this[_0x5443('0xa')]=_0x1c0cfe[_0x5443('0xa')];this[_0x5443('0xb')]=_0x1c0cfe[_0x5443('0xb')];this[_0x5443('0xc')]={};ami['on'](_0x5443('0xd'),this['syncAgentCalled'][_0x5443('0xe')](this));ami['on'](_0x5443('0xf'),this['syncAgentConnect']['bind'](this));ami['on']('agentringnoanswer',this[_0x5443('0x10')]['bind'](this));ami['on'](_0x5443('0x11'),this[_0x5443('0x12')][_0x5443('0xe')](this));ami['on'](_0x5443('0x13'),this[_0x5443('0x14')]['bind'](this));ami['on'](_0x5443('0x15'),this[_0x5443('0x16')][_0x5443('0xe')](this));ami['on'](_0x5443('0x17'),this[_0x5443('0x18')][_0x5443('0xe')](this));ami['on'](_0x5443('0x19'),this[_0x5443('0x1a')]['bind'](this));ami['on'](_0x5443('0x1b'),this[_0x5443('0x1c')][_0x5443('0xe')](this));ami['on'](_0x5443('0x1d'),this['syncAttendedTransfer'][_0x5443('0xe')](this));ami['on'](_0x5443('0x1e'),this[_0x5443('0x1f')][_0x5443('0xe')](this));}VoiceAgentReport[_0x5443('0x20')][_0x5443('0x21')]=function(_0x12365c,_0x550040,_0x584549){io['to'](_0x12365c)[_0x5443('0x21')](_0x550040,_0x584549);};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x22')]=function(_0x5d1ced){return _0x5d1ced!==null&&!_[_0x5443('0x23')](_0x5d1ced);};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x24')]=function(_0x4a89b0){try{if(this[_0x5443('0x22')](_0x4a89b0)){if(_[_0x5443('0x23')](this[_0x5443('0x9')][_0x4a89b0[_0x5443('0x25')]])){this[_0x5443('0x9')][_0x4a89b0[_0x5443('0x25')]]={};}if(_[_0x5443('0x23')](this['channels'][_0x4a89b0['uniqueid']][_0x4a89b0['destuniqueid']])){this['channels'][_0x4a89b0['uniqueid']][_0x4a89b0[_0x5443('0x26')]]={'agentcalledAt':moment()[_0x5443('0x27')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x5443('0x28'),'variables':this['variables'][_0x4a89b0[_0x5443('0x25')]],'type':this[_0x5443('0xa')][_0x4a89b0[_0x5443('0x29')]]?this[_0x5443('0xa')][_0x4a89b0['queue']][_0x5443('0x2a')]||_0x5443('0x2b'):_0x5443('0x2b')};}_[_0x5443('0x2c')](this['channels'][_0x4a89b0['uniqueid']][_0x4a89b0[_0x5443('0x26')]],_[_0x5443('0x2d')](_0x4a89b0,['event','privilege']));ami[_0x5443('0x21')](_0x5443('0x2e'),this[_0x5443('0x9')][_0x4a89b0[_0x5443('0x25')]][_0x4a89b0[_0x5443('0x26')]]);this['emit'](util[_0x5443('0x27')](_0x5443('0x2f'),_0x4a89b0['membername']),'user:called',this[_0x5443('0x9')][_0x4a89b0[_0x5443('0x25')]][_0x4a89b0[_0x5443('0x26')]]);}}catch(_0xa14d63){logger[_0x5443('0x30')](_0x5443('0x31'),util[_0x5443('0x32')](_0xa14d63,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x33')]=function(_0x3b4e45){try{if(this[_0x5443('0x22')](_0x3b4e45)){if(this['channels'][_0x3b4e45[_0x5443('0x25')]]){for(var _0x204bce in this['channels'][_0x3b4e45[_0x5443('0x25')]]){if(this['channels'][_0x3b4e45[_0x5443('0x25')]][_0x5443('0x34')](_0x204bce)){if(_0x3b4e45[_0x5443('0x26')]===_0x204bce){this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x35')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x3b4e45['uniqueid']][_0x204bce]['lastevent']='connect';this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x36')]=_0x3b4e45[_0x5443('0x36')];this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x37')]=_0x3b4e45[_0x5443('0x37')];this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x38')]=_0x3b4e45[_0x5443('0x38')];this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce]['destchannelstate']=_0x3b4e45[_0x5443('0x39')];this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x3a')]=_0x3b4e45[_0x5443('0x3a')];_[_0x5443('0x2c')](this[_0x5443('0xb')][_0x3b4e45[_0x5443('0x3b')]],_['pick'](_0x3b4e45,[_0x5443('0x29'),_0x5443('0x3c')]));this[_0x5443('0x21')](util[_0x5443('0x27')](_0x5443('0x2f'),_0x3b4e45[_0x5443('0x3d')]),_0x5443('0x3e'),this['channels'][_0x3b4e45[_0x5443('0x25')]][_0x3b4e45[_0x5443('0x26')]]);ami[_0x5443('0x21')](_0x5443('0x3f'),this['channels'][_0x3b4e45[_0x5443('0x25')]][_0x204bce]);}else if(!this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x40')]&&!this[_0x5443('0x9')][_0x3b4e45['uniqueid']][_0x204bce][_0x5443('0x13')]){this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x40')]=!![];this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x41')]=moment()[_0x5443('0x27')](_0x5443('0x42'));this['channels'][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x43')]='answered_elsewhere';this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x44')]=_0x5443('0x45');this[_0x5443('0x9')][_0x3b4e45[_0x5443('0x25')]][_0x204bce][_0x5443('0x46')]=_0x3b4e45[_0x5443('0x26')];this[_0x5443('0x9')][_0x3b4e45['uniqueid']][_0x204bce]['answeredelsewheremembername']=_0x3b4e45[_0x5443('0x3d')];ami[_0x5443('0x21')](_0x5443('0x47'),this['channels'][_0x3b4e45['uniqueid']][_0x204bce]);}}}}}}catch(_0x160beb){logger['error'](_0x5443('0x48'),util[_0x5443('0x32')](_0x160beb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x10')]=function(_0x4bed5d){try{if(this[_0x5443('0x22')](_0x4bed5d)){if(this[_0x5443('0x9')][_0x4bed5d[_0x5443('0x25')]]&&this['channels'][_0x4bed5d[_0x5443('0x25')]][_0x4bed5d[_0x5443('0x26')]]){this[_0x5443('0x9')][_0x4bed5d[_0x5443('0x25')]][_0x4bed5d[_0x5443('0x26')]][_0x5443('0x40')]=!![];this[_0x5443('0x9')][_0x4bed5d[_0x5443('0x25')]][_0x4bed5d['destuniqueid']]['agentringnoanswerAt']=moment()['format'](_0x5443('0x42'));this[_0x5443('0x9')][_0x4bed5d[_0x5443('0x25')]][_0x4bed5d['destuniqueid']][_0x5443('0x43')]=_0x5443('0x49');this['channels'][_0x4bed5d[_0x5443('0x25')]][_0x4bed5d[_0x5443('0x26')]][_0x5443('0x44')]=_0x5443('0x49');ami['emit'](_0x5443('0x4a'),this[_0x5443('0x9')][_0x4bed5d[_0x5443('0x25')]][_0x4bed5d[_0x5443('0x26')]]);}}}catch(_0x4ab7b8){logger[_0x5443('0x30')](_0x5443('0x4b'),util[_0x5443('0x32')](_0x4ab7b8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x12')]=function(_0x1aad28){try{if(this[_0x5443('0x22')](_0x1aad28)){if(this[_0x5443('0x9')][_0x1aad28[_0x5443('0x25')]]){for(var _0x521aef in this[_0x5443('0x9')][_0x1aad28[_0x5443('0x25')]]){if(this[_0x5443('0x9')][_0x1aad28[_0x5443('0x25')]][_0x5443('0x34')](_0x521aef)&&!this[_0x5443('0x9')][_0x1aad28[_0x5443('0x25')]][_0x521aef][_0x5443('0x40')]&&!this['channels'][_0x1aad28[_0x5443('0x25')]][_0x521aef][_0x5443('0x13')]){this[_0x5443('0x9')][_0x1aad28[_0x5443('0x25')]][_0x521aef]['agentringnoanswer']=!![];this[_0x5443('0x9')][_0x1aad28[_0x5443('0x25')]][_0x521aef]['agentringnoanswerAt']=moment()['format'](_0x5443('0x42'));this[_0x5443('0x9')][_0x1aad28[_0x5443('0x25')]][_0x521aef][_0x5443('0x43')]=_0x5443('0x4c');this[_0x5443('0x9')][_0x1aad28[_0x5443('0x25')]][_0x521aef][_0x5443('0x44')]='abandoned';ami[_0x5443('0x21')]('custom:agentqueuecallerabandon',this['channels'][_0x1aad28[_0x5443('0x25')]][_0x521aef]);}}}}}catch(_0x3d0fac){logger['error'](_0x5443('0x4d'),util[_0x5443('0x32')](_0x3d0fac,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5443('0x14')]=function(_0x17b3ae){try{if(this['isNotNull'](_0x17b3ae)){if(this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]]){for(var _0x294ea9 in this['channels'][_0x17b3ae[_0x5443('0x25')]]){if(this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]][_0x5443('0x34')](_0x294ea9)){if(this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]][_0x294ea9][_0x5443('0x35')]&&!this[_0x5443('0x9')][_0x17b3ae['uniqueid']][_0x294ea9][_0x5443('0x13')]){this[_0x5443('0x9')][_0x17b3ae['uniqueid']][_0x294ea9][_0x5443('0x13')]=!![];this['channels'][_0x17b3ae['uniqueid']][_0x294ea9][_0x5443('0x4e')]=moment()[_0x5443('0x27')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x5443('0x9')][_0x17b3ae['uniqueid']][_0x294ea9][_0x5443('0x44')]='complete';this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]][_0x294ea9]['talktime']=_0x17b3ae[_0x5443('0x4f')];this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]][_0x294ea9][_0x5443('0x43')]=_0x17b3ae[_0x5443('0x43')]==_0x5443('0x50')?_0x5443('0x51'):_0x17b3ae[_0x5443('0x43')];if(this[_0x5443('0xa')][_0x17b3ae[_0x5443('0x29')]]&&this[_0x5443('0xa')][_0x17b3ae[_0x5443('0x29')]]['acw']){this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]][_0x294ea9][_0x5443('0x52')]=!![];this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]][_0x294ea9][_0x5443('0x53')]=this[_0x5443('0xa')][_0x17b3ae[_0x5443('0x29')]][_0x5443('0x54')];}this[_0x5443('0xb')][_0x17b3ae[_0x5443('0x3b')]]=_[_0x5443('0x2d')](this[_0x5443('0xb')][_0x17b3ae[_0x5443('0x3b')]],[_0x5443('0x29'),'destconnectedlinenum']);this['emit'](util[_0x5443('0x27')]('user:%s',_0x17b3ae['membername']),_0x5443('0x55'),this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]][_0x294ea9]);ami[_0x5443('0x21')]('custom:agentcomplete',this[_0x5443('0x9')][_0x17b3ae[_0x5443('0x25')]][_0x294ea9]);}}}}}}catch(_0x3504ef){logger[_0x5443('0x30')](_0x5443('0x56'),util[_0x5443('0x32')](_0x3504ef,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x5443('0x16')]=function(_0x2e59f6){try{if(this[_0x5443('0x22')](_0x2e59f6)){this['addVariable'](_0x2e59f6[_0x5443('0x25')],_[_0x5443('0x57')](_0x2e59f6[_0x5443('0x58')])[0x0],_0x2e59f6[_0x5443('0x59')]);if(this[_0x5443('0x9')][_0x2e59f6[_0x5443('0x25')]]){for(var _0x564b5d in this[_0x5443('0x9')][_0x2e59f6['uniqueid']]){if(this[_0x5443('0x9')][_0x2e59f6[_0x5443('0x25')]][_0x5443('0x34')](_0x564b5d)){if(_['isUndefined'](this[_0x5443('0x9')][_0x2e59f6[_0x5443('0x25')]][_0x564b5d][_0x5443('0xc')])){this[_0x5443('0x9')][_0x2e59f6[_0x5443('0x25')]][_0x564b5d]['variables']={};}this['channels'][_0x2e59f6['uniqueid']][_0x564b5d][_0x5443('0xc')]=this['variables'][_0x2e59f6['uniqueid']];}}}}}catch(_0x15be54){logger[_0x5443('0x30')](_0x5443('0x5a'),util[_0x5443('0x32')](_0x15be54,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5443('0x20')]['addVariable']=function(_0x22a7aa,_0x352f20,_0x4b9152){var _0xfb9dac=['rtpaudioqos',_0x5443('0x5b'),_0x5443('0x5c'),'rtpaudioqosjitterbridged',_0x5443('0x5d'),_0x5443('0x5e'),_0x5443('0x5f'),'rtpaudioqosrttbridged',_0x5443('0x60'),_0x5443('0x61'),'bridgepeer','bridgepvtcallid','membercalls',_0x5443('0x62'),'memberinterface',_0x5443('0x63'),_0x5443('0x3d'),_0x5443('0x64'),_0x5443('0x65')];if(!_[_0x5443('0x66')](_0x352f20)&&!_['includes'](_0xfb9dac,_0x352f20)){if(_['isUndefined'](this[_0x5443('0xc')][_0x22a7aa])){this[_0x5443('0xc')][_0x22a7aa]={};}this[_0x5443('0xc')][_0x22a7aa][_0x352f20]=_0x4b9152;}};VoiceAgentReport['prototype']['syncHangup']=function(_0x2b51f3){try{if(this[_0x5443('0x22')](_0x2b51f3)){if(this[_0x5443('0x9')][_0x2b51f3[_0x5443('0x25')]]){for(var _0x43e775 in this[_0x5443('0x9')][_0x2b51f3[_0x5443('0x25')]]){if(this[_0x5443('0x9')][_0x2b51f3[_0x5443('0x25')]]['hasOwnProperty'](_0x43e775)){if(this[_0x5443('0x9')][_0x2b51f3[_0x5443('0x25')]][_0x43e775]['reason']=='transfer'&&this[_0x5443('0x9')][_0x2b51f3[_0x5443('0x25')]][_0x43e775][_0x5443('0x13')]){this[_0x5443('0x9')][_0x2b51f3[_0x5443('0x25')]][_0x43e775][_0x5443('0x4e')]=moment()[_0x5443('0x27')](_0x5443('0x42'));}}}ami[_0x5443('0x21')](_0x5443('0x67'),_[_0x5443('0x68')](this['channels'][_0x2b51f3[_0x5443('0x25')]]));delete this['channels'][_0x2b51f3['uniqueid']];}if(this[_0x5443('0xc')][_0x2b51f3[_0x5443('0x25')]]){delete this['variables'][_0x2b51f3[_0x5443('0x25')]];}}}catch(_0x235367){logger[_0x5443('0x30')](_0x5443('0x69'),util[_0x5443('0x32')](_0x235367,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x6a')]=function(_0x3aa583){try{if(this[_0x5443('0x22')](_0x3aa583)){if(this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6b')]]){for(var _0x5e9846 in this[_0x5443('0x9')][_0x3aa583['transfereeuniqueid']]){if(this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6b')]][_0x5443('0x34')](_0x5e9846)){if(_0x3aa583['origtransfereruniqueid']===_0x5e9846){var _0x540cc1=moment();this['channels'][_0x3aa583['transfereeuniqueid']][_0x5e9846][_0x5443('0x13')]=!![];this['channels'][_0x3aa583[_0x5443('0x6b')]][_0x5e9846][_0x5443('0x4e')]=moment()[_0x5443('0x27')](_0x5443('0x42'));this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6b')]][_0x5e9846]['reason']=_0x5443('0x50');this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6b')]][_0x5e9846][_0x5443('0x44')]='complete';this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6b')]][_0x5e9846]['talktime']=_0x540cc1[_0x5443('0x6c')](this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6b')]][_0x5e9846][_0x5443('0x35')],_0x5443('0x6d'));}}}}if(this[_0x5443('0x9')][_0x3aa583['secondtransfereruniqueid']]){var _0x2c3027=this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6e')]];this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6e')]]=this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6b')]];this[_0x5443('0x9')][_0x3aa583[_0x5443('0x6b')]]=_0x2c3027;}}}catch(_0x5e1762){logger[_0x5443('0x30')](_0x5443('0x6f'),util[_0x5443('0x32')](_0x5e1762,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x1f')]=function(_0x43607b){try{if(this[_0x5443('0x22')](_0x43607b)){if(this['channels'][_0x43607b['transfereeuniqueid']]){for(var _0x437838 in this[_0x5443('0x9')][_0x43607b[_0x5443('0x6b')]]){if(this['channels'][_0x43607b['transfereeuniqueid']][_0x5443('0x34')](_0x437838)){if(_0x43607b['transfereruniqueid']===_0x437838){var _0x4ccd09=moment();this[_0x5443('0x9')][_0x43607b['transfereeuniqueid']][_0x437838]['agentcomplete']=!![];this[_0x5443('0x9')][_0x43607b[_0x5443('0x6b')]][_0x437838][_0x5443('0x4e')]=_0x4ccd09;this[_0x5443('0x9')][_0x43607b[_0x5443('0x6b')]][_0x437838]['reason']=_0x5443('0x50');this['channels'][_0x43607b[_0x5443('0x6b')]][_0x437838]['lastevent']='complete';this[_0x5443('0x9')][_0x43607b['transfereeuniqueid']][_0x437838][_0x5443('0x4f')]=_0x4ccd09[_0x5443('0x6c')](this['channels'][_0x43607b[_0x5443('0x6b')]][_0x437838][_0x5443('0x35')],'seconds');}}}}}}catch(_0x125f82){logger['error']('[syncBlindTransfer][VoiceAgentReport]',util[_0x5443('0x32')](_0x125f82,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x1a')]=function(_0x13732d){var _0x497c08='';try{if(this[_0x5443('0x22')](_0x13732d)){if(_0x13732d['channel']){_0x497c08=_0x13732d[_0x5443('0x70')][_0x5443('0x71')](0x0,_0x13732d[_0x5443('0x70')][_0x5443('0x72')]('-'));if(this['agents'][_0x497c08]){this[_0x5443('0xb')][_0x497c08][_0x5443('0x73')]=!![];}}}}catch(_0x2c72df){logger[_0x5443('0x30')]('[syncMusicOnHoldStart][VoiceAgentReport]',util[_0x5443('0x32')](_0x2c72df,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x5443('0x20')][_0x5443('0x1c')]=function(_0x1fa0cd){var _0x50d6c9='';try{if(this['isNotNull'](_0x1fa0cd)){if(_0x1fa0cd[_0x5443('0x70')]){_0x50d6c9=_0x1fa0cd[_0x5443('0x70')][_0x5443('0x71')](0x0,_0x1fa0cd[_0x5443('0x70')][_0x5443('0x72')]('-'));if(this[_0x5443('0xb')][_0x50d6c9]){this['agents'][_0x50d6c9][_0x5443('0x73')]=![];}}}}catch(_0x5e3dc9){logger[_0x5443('0x30')](_0x5443('0x74'),util[_0x5443('0x32')](_0x5e3dc9,{'showHidden':![],'depth':null}));}};module[_0x5443('0x75')]=VoiceAgentReport; \ No newline at end of file +var _0xefed=['musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','prototype','isNotNull','isUndefined','uniqueid','destuniqueid','YYYY-MM-DD\x20HH:mm:ss','called','queue','inbound','merge','event','privilege','custom:agentcalled','user:called','error','inspect','hasOwnProperty','agentconnectAt','format','lastevent','connect','holdtime','connectedlinenum','destchannelstate','destchannelstatedesc','interface','pick','membername','user:agentconnect','custom:agentconnect','agentringnoanswer','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','syncAgentComplete','agentcompleteAt','talktime','transfer','agent','agentacw','acwTimeout','omit','destconnectedlinenum','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberpenalty','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','complete','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','syncMusicOnHoldStart','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','agentcalled','syncAgentCalled','bind','syncAgentConnect','syncAgentRingNoAnswer','syncQueueCallerAbandon','agentcomplete','syncVarSet','hangup','syncHangup','musiconholdstart'];(function(_0x3c226c,_0x1f696f){var _0x5657e2=function(_0x1c6f13){while(--_0x1c6f13){_0x3c226c['push'](_0x3c226c['shift']());}};_0x5657e2(++_0x1f696f);}(_0xefed,0x1d6));var _0xdefe=function(_0x4c2bdc,_0x5915d7){_0x4c2bdc=_0x4c2bdc-0x0;var _0x5a3222=_0xefed[_0x4c2bdc];return _0x5a3222;};'use strict';var _=require(_0xdefe('0x0'));var moment=require(_0xdefe('0x1'));var util=require('util');var Redis=require(_0xdefe('0x2'));var config=require(_0xdefe('0x3'));var logger=require(_0xdefe('0x4'))(_0xdefe('0x5'));var ami=require(_0xdefe('0x6'));config[_0xdefe('0x7')]=_[_0xdefe('0x8')](config[_0xdefe('0x7')],{'host':_0xdefe('0x9'),'port':0x18eb});var io=require(_0xdefe('0xa'))(new Redis(config[_0xdefe('0x7')]));function VoiceAgentReport(_0x3f4fb3){this[_0xdefe('0xb')]={};this['voiceQueues']=_0x3f4fb3[_0xdefe('0xc')];this[_0xdefe('0xd')]=_0x3f4fb3['agents'];this[_0xdefe('0xe')]={};ami['on'](_0xdefe('0xf'),this[_0xdefe('0x10')][_0xdefe('0x11')](this));ami['on']('agentconnect',this[_0xdefe('0x12')][_0xdefe('0x11')](this));ami['on']('agentringnoanswer',this[_0xdefe('0x13')][_0xdefe('0x11')](this));ami['on']('queuecallerabandon',this[_0xdefe('0x14')]['bind'](this));ami['on'](_0xdefe('0x15'),this['syncAgentComplete']['bind'](this));ami['on']('varset',this[_0xdefe('0x16')]['bind'](this));ami['on'](_0xdefe('0x17'),this[_0xdefe('0x18')][_0xdefe('0x11')](this));ami['on'](_0xdefe('0x19'),this['syncMusicOnHoldStart'][_0xdefe('0x11')](this));ami['on'](_0xdefe('0x1a'),this[_0xdefe('0x1b')][_0xdefe('0x11')](this));ami['on'](_0xdefe('0x1c'),this[_0xdefe('0x1d')][_0xdefe('0x11')](this));ami['on'](_0xdefe('0x1e'),this[_0xdefe('0x1f')][_0xdefe('0x11')](this));}VoiceAgentReport['prototype']['emit']=function(_0x4e4927,_0x55caac,_0x45c3e5){io['to'](_0x4e4927)[_0xdefe('0x20')](_0x55caac,_0x45c3e5);};VoiceAgentReport[_0xdefe('0x21')][_0xdefe('0x22')]=function(_0x184223){return _0x184223!==null&&!_[_0xdefe('0x23')](_0x184223);};VoiceAgentReport[_0xdefe('0x21')][_0xdefe('0x10')]=function(_0x29b157){try{if(this[_0xdefe('0x22')](_0x29b157)){if(_['isUndefined'](this['channels'][_0x29b157[_0xdefe('0x24')]])){this['channels'][_0x29b157[_0xdefe('0x24')]]={};}if(_['isUndefined'](this['channels'][_0x29b157[_0xdefe('0x24')]][_0x29b157[_0xdefe('0x25')]])){this[_0xdefe('0xb')][_0x29b157[_0xdefe('0x24')]][_0x29b157[_0xdefe('0x25')]]={'agentcalledAt':moment()['format'](_0xdefe('0x26')),'lastevent':_0xdefe('0x27'),'variables':this[_0xdefe('0xe')][_0x29b157['uniqueid']],'type':this['voiceQueues'][_0x29b157[_0xdefe('0x28')]]?this[_0xdefe('0xc')][_0x29b157[_0xdefe('0x28')]]['type']||_0xdefe('0x29'):'inbound'};}_[_0xdefe('0x2a')](this[_0xdefe('0xb')][_0x29b157[_0xdefe('0x24')]][_0x29b157[_0xdefe('0x25')]],_['omit'](_0x29b157,[_0xdefe('0x2b'),_0xdefe('0x2c')]));ami[_0xdefe('0x20')](_0xdefe('0x2d'),this[_0xdefe('0xb')][_0x29b157[_0xdefe('0x24')]][_0x29b157[_0xdefe('0x25')]]);this[_0xdefe('0x20')](util['format']('user:%s',_0x29b157['membername']),_0xdefe('0x2e'),this[_0xdefe('0xb')][_0x29b157[_0xdefe('0x24')]][_0x29b157[_0xdefe('0x25')]]);}}catch(_0x47e079){logger[_0xdefe('0x2f')]('[syncAgentCalled][VoiceAgentReport]',util[_0xdefe('0x30')](_0x47e079,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xdefe('0x12')]=function(_0x391f6f){try{if(this[_0xdefe('0x22')](_0x391f6f)){if(this['channels'][_0x391f6f['uniqueid']]){for(var _0x3d1658 in this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]]){if(this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0xdefe('0x31')](_0x3d1658)){if(_0x391f6f['destuniqueid']===_0x3d1658){this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0x3d1658][_0xdefe('0x32')]=moment()[_0xdefe('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0x3d1658][_0xdefe('0x34')]=_0xdefe('0x35');this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0x3d1658][_0xdefe('0x36')]=_0x391f6f[_0xdefe('0x36')];this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0x3d1658]['connectedlinenum']=_0x391f6f[_0xdefe('0x37')];this['channels'][_0x391f6f[_0xdefe('0x24')]][_0x3d1658]['connectedlinename']=_0x391f6f['connectedlinename'];this['channels'][_0x391f6f['uniqueid']][_0x3d1658][_0xdefe('0x38')]=_0x391f6f[_0xdefe('0x38')];this[_0xdefe('0xb')][_0x391f6f['uniqueid']][_0x3d1658]['destchannelstatedesc']=_0x391f6f[_0xdefe('0x39')];_[_0xdefe('0x2a')](this[_0xdefe('0xd')][_0x391f6f[_0xdefe('0x3a')]],_[_0xdefe('0x3b')](_0x391f6f,['queue','destconnectedlinenum']));this[_0xdefe('0x20')](util['format']('user:%s',_0x391f6f[_0xdefe('0x3c')]),_0xdefe('0x3d'),this['channels'][_0x391f6f[_0xdefe('0x24')]][_0x391f6f[_0xdefe('0x25')]]);ami[_0xdefe('0x20')](_0xdefe('0x3e'),this['channels'][_0x391f6f[_0xdefe('0x24')]][_0x3d1658]);}else if(!this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0x3d1658][_0xdefe('0x3f')]&&!this[_0xdefe('0xb')][_0x391f6f['uniqueid']][_0x3d1658]['agentcomplete']){this[_0xdefe('0xb')][_0x391f6f['uniqueid']][_0x3d1658]['agentringnoanswer']=!![];this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0x3d1658][_0xdefe('0x40')]=moment()[_0xdefe('0x33')](_0xdefe('0x26'));this['channels'][_0x391f6f['uniqueid']][_0x3d1658][_0xdefe('0x41')]=_0xdefe('0x42');this['channels'][_0x391f6f['uniqueid']][_0x3d1658][_0xdefe('0x34')]=_0xdefe('0x42');this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0x3d1658][_0xdefe('0x43')]=_0x391f6f[_0xdefe('0x25')];this[_0xdefe('0xb')][_0x391f6f[_0xdefe('0x24')]][_0x3d1658]['answeredelsewheremembername']=_0x391f6f['membername'];ami['emit'](_0xdefe('0x44'),this['channels'][_0x391f6f[_0xdefe('0x24')]][_0x3d1658]);}}}}}}catch(_0x5424ce){logger[_0xdefe('0x2f')](_0xdefe('0x45'),util[_0xdefe('0x30')](_0x5424ce,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdefe('0x21')][_0xdefe('0x13')]=function(_0x3e1663){try{if(this[_0xdefe('0x22')](_0x3e1663)){if(this[_0xdefe('0xb')][_0x3e1663[_0xdefe('0x24')]]&&this[_0xdefe('0xb')][_0x3e1663[_0xdefe('0x24')]][_0x3e1663[_0xdefe('0x25')]]){this[_0xdefe('0xb')][_0x3e1663[_0xdefe('0x24')]][_0x3e1663[_0xdefe('0x25')]][_0xdefe('0x3f')]=!![];this[_0xdefe('0xb')][_0x3e1663[_0xdefe('0x24')]][_0x3e1663[_0xdefe('0x25')]][_0xdefe('0x40')]=moment()[_0xdefe('0x33')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xdefe('0xb')][_0x3e1663[_0xdefe('0x24')]][_0x3e1663[_0xdefe('0x25')]][_0xdefe('0x41')]=_0xdefe('0x46');this['channels'][_0x3e1663[_0xdefe('0x24')]][_0x3e1663[_0xdefe('0x25')]]['lastevent']='rejected';ami[_0xdefe('0x20')](_0xdefe('0x47'),this['channels'][_0x3e1663[_0xdefe('0x24')]][_0x3e1663[_0xdefe('0x25')]]);}}}catch(_0x522773){logger['error'](_0xdefe('0x48'),util[_0xdefe('0x30')](_0x522773,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdefe('0x21')][_0xdefe('0x14')]=function(_0x3de81b){try{if(this[_0xdefe('0x22')](_0x3de81b)){if(this[_0xdefe('0xb')][_0x3de81b[_0xdefe('0x24')]]){for(var _0x525bd3 in this[_0xdefe('0xb')][_0x3de81b[_0xdefe('0x24')]]){if(this[_0xdefe('0xb')][_0x3de81b['uniqueid']][_0xdefe('0x31')](_0x525bd3)&&!this[_0xdefe('0xb')][_0x3de81b[_0xdefe('0x24')]][_0x525bd3][_0xdefe('0x3f')]&&!this['channels'][_0x3de81b['uniqueid']][_0x525bd3][_0xdefe('0x15')]){this[_0xdefe('0xb')][_0x3de81b['uniqueid']][_0x525bd3][_0xdefe('0x3f')]=!![];this[_0xdefe('0xb')][_0x3de81b['uniqueid']][_0x525bd3][_0xdefe('0x40')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0xdefe('0xb')][_0x3de81b['uniqueid']][_0x525bd3][_0xdefe('0x41')]=_0xdefe('0x49');this['channels'][_0x3de81b[_0xdefe('0x24')]][_0x525bd3]['lastevent']=_0xdefe('0x49');ami[_0xdefe('0x20')](_0xdefe('0x4a'),this[_0xdefe('0xb')][_0x3de81b[_0xdefe('0x24')]][_0x525bd3]);}}}}}catch(_0xa206cd){logger['error']('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0xdefe('0x30')](_0xa206cd,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdefe('0x21')][_0xdefe('0x4b')]=function(_0x34f4dd){try{if(this[_0xdefe('0x22')](_0x34f4dd)){if(this[_0xdefe('0xb')][_0x34f4dd['uniqueid']]){for(var _0x553b15 in this[_0xdefe('0xb')][_0x34f4dd[_0xdefe('0x24')]]){if(this[_0xdefe('0xb')][_0x34f4dd[_0xdefe('0x24')]][_0xdefe('0x31')](_0x553b15)){if(this[_0xdefe('0xb')][_0x34f4dd[_0xdefe('0x24')]][_0x553b15]['agentconnectAt']&&!this[_0xdefe('0xb')][_0x34f4dd[_0xdefe('0x24')]][_0x553b15][_0xdefe('0x15')]){this[_0xdefe('0xb')][_0x34f4dd['uniqueid']][_0x553b15][_0xdefe('0x15')]=!![];this[_0xdefe('0xb')][_0x34f4dd['uniqueid']][_0x553b15][_0xdefe('0x4c')]=moment()[_0xdefe('0x33')](_0xdefe('0x26'));this[_0xdefe('0xb')][_0x34f4dd[_0xdefe('0x24')]][_0x553b15]['lastevent']='complete';this[_0xdefe('0xb')][_0x34f4dd[_0xdefe('0x24')]][_0x553b15][_0xdefe('0x4d')]=_0x34f4dd[_0xdefe('0x4d')];this['channels'][_0x34f4dd[_0xdefe('0x24')]][_0x553b15]['reason']=_0x34f4dd[_0xdefe('0x41')]==_0xdefe('0x4e')?_0xdefe('0x4f'):_0x34f4dd['reason'];if(this[_0xdefe('0xc')][_0x34f4dd[_0xdefe('0x28')]]&&this[_0xdefe('0xc')][_0x34f4dd[_0xdefe('0x28')]]['acw']){this[_0xdefe('0xb')][_0x34f4dd[_0xdefe('0x24')]][_0x553b15][_0xdefe('0x50')]=!![];this['channels'][_0x34f4dd[_0xdefe('0x24')]][_0x553b15]['acwtime']=this[_0xdefe('0xc')][_0x34f4dd[_0xdefe('0x28')]][_0xdefe('0x51')];}this[_0xdefe('0xd')][_0x34f4dd['interface']]=_[_0xdefe('0x52')](this[_0xdefe('0xd')][_0x34f4dd['interface']],[_0xdefe('0x28'),_0xdefe('0x53')]);this[_0xdefe('0x20')](util[_0xdefe('0x33')]('user:%s',_0x34f4dd[_0xdefe('0x3c')]),_0xdefe('0x54'),this[_0xdefe('0xb')][_0x34f4dd[_0xdefe('0x24')]][_0x553b15]);ami[_0xdefe('0x20')](_0xdefe('0x55'),this[_0xdefe('0xb')][_0x34f4dd['uniqueid']][_0x553b15]);}}}}}}catch(_0x169a65){logger['error'](_0xdefe('0x56'),util[_0xdefe('0x30')](_0x169a65,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdefe('0x21')]['syncVarSet']=function(_0x3ab448){try{if(this[_0xdefe('0x22')](_0x3ab448)){this[_0xdefe('0x57')](_0x3ab448['uniqueid'],_[_0xdefe('0x58')](_0x3ab448[_0xdefe('0x59')])[0x0],_0x3ab448['value']);if(this[_0xdefe('0xb')][_0x3ab448[_0xdefe('0x24')]]){for(var _0x59daf6 in this[_0xdefe('0xb')][_0x3ab448[_0xdefe('0x24')]]){if(this[_0xdefe('0xb')][_0x3ab448[_0xdefe('0x24')]]['hasOwnProperty'](_0x59daf6)){if(_['isUndefined'](this[_0xdefe('0xb')][_0x3ab448[_0xdefe('0x24')]][_0x59daf6][_0xdefe('0xe')])){this[_0xdefe('0xb')][_0x3ab448[_0xdefe('0x24')]][_0x59daf6][_0xdefe('0xe')]={};}this['channels'][_0x3ab448[_0xdefe('0x24')]][_0x59daf6]['variables']=this[_0xdefe('0xe')][_0x3ab448[_0xdefe('0x24')]];}}}}}catch(_0x12f0c6){logger[_0xdefe('0x2f')]('[syncVarSet][VoiceAgentReport]',util[_0xdefe('0x30')](_0x12f0c6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdefe('0x21')]['addVariable']=function(_0x22b34a,_0x1e20df,_0x7b54f9){var _0x3b63ed=[_0xdefe('0x5a'),_0xdefe('0x5b'),_0xdefe('0x5c'),_0xdefe('0x5d'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0xdefe('0x5e'),_0xdefe('0x5f'),_0xdefe('0x60'),_0xdefe('0x61'),_0xdefe('0x62'),_0xdefe('0x63'),_0xdefe('0x64'),_0xdefe('0x65'),_0xdefe('0x66'),'memberlastcall',_0xdefe('0x3c'),_0xdefe('0x67'),'memberrealtime'];if(!_['isNil'](_0x1e20df)&&!_[_0xdefe('0x68')](_0x3b63ed,_0x1e20df)){if(_[_0xdefe('0x23')](this[_0xdefe('0xe')][_0x22b34a])){this[_0xdefe('0xe')][_0x22b34a]={};}this[_0xdefe('0xe')][_0x22b34a][_0x1e20df]=_0x7b54f9;}};VoiceAgentReport[_0xdefe('0x21')]['syncHangup']=function(_0x144185){try{if(this[_0xdefe('0x22')](_0x144185)){if(this[_0xdefe('0xb')][_0x144185[_0xdefe('0x24')]]){for(var _0x30faed in this[_0xdefe('0xb')][_0x144185[_0xdefe('0x24')]]){if(this[_0xdefe('0xb')][_0x144185[_0xdefe('0x24')]][_0xdefe('0x31')](_0x30faed)){if(this['channels'][_0x144185[_0xdefe('0x24')]][_0x30faed]['reason']==_0xdefe('0x4e')&&this[_0xdefe('0xb')][_0x144185[_0xdefe('0x24')]][_0x30faed][_0xdefe('0x15')]){this[_0xdefe('0xb')][_0x144185[_0xdefe('0x24')]][_0x30faed][_0xdefe('0x4c')]=moment()[_0xdefe('0x33')](_0xdefe('0x26'));}}}ami[_0xdefe('0x20')](_0xdefe('0x69'),_[_0xdefe('0x6a')](this['channels'][_0x144185['uniqueid']]));delete this['channels'][_0x144185[_0xdefe('0x24')]];}if(this[_0xdefe('0xe')][_0x144185['uniqueid']]){delete this['variables'][_0x144185[_0xdefe('0x24')]];}}}catch(_0x27e44e){logger['error'](_0xdefe('0x6b'),util[_0xdefe('0x30')](_0x27e44e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdefe('0x21')][_0xdefe('0x1d')]=function(_0xf35a73){try{if(this[_0xdefe('0x22')](_0xf35a73)){if(this[_0xdefe('0xb')][_0xf35a73[_0xdefe('0x6c')]]){for(var _0x361ec3 in this[_0xdefe('0xb')][_0xf35a73[_0xdefe('0x6c')]]){if(this[_0xdefe('0xb')][_0xf35a73[_0xdefe('0x6c')]][_0xdefe('0x31')](_0x361ec3)){if(_0xf35a73[_0xdefe('0x6d')]===_0x361ec3){var _0x55fe44=moment();this['channels'][_0xf35a73[_0xdefe('0x6c')]][_0x361ec3]['agentcomplete']=!![];this[_0xdefe('0xb')][_0xf35a73['transfereeuniqueid']][_0x361ec3][_0xdefe('0x4c')]=moment()[_0xdefe('0x33')](_0xdefe('0x26'));this[_0xdefe('0xb')][_0xf35a73[_0xdefe('0x6c')]][_0x361ec3][_0xdefe('0x41')]=_0xdefe('0x4e');this[_0xdefe('0xb')][_0xf35a73['transfereeuniqueid']][_0x361ec3][_0xdefe('0x34')]=_0xdefe('0x6e');this[_0xdefe('0xb')][_0xf35a73[_0xdefe('0x6c')]][_0x361ec3][_0xdefe('0x4d')]=_0x55fe44[_0xdefe('0x6f')](this[_0xdefe('0xb')][_0xf35a73['transfereeuniqueid']][_0x361ec3][_0xdefe('0x32')],_0xdefe('0x70'));}}}}if(this['channels'][_0xf35a73[_0xdefe('0x71')]]){var _0x1f36d8=this[_0xdefe('0xb')][_0xf35a73['secondtransfereruniqueid']];this[_0xdefe('0xb')][_0xf35a73[_0xdefe('0x71')]]=this[_0xdefe('0xb')][_0xf35a73['transfereeuniqueid']];this[_0xdefe('0xb')][_0xf35a73[_0xdefe('0x6c')]]=_0x1f36d8;}}}catch(_0x1366ce){logger['error'](_0xdefe('0x72'),util[_0xdefe('0x30')](_0x1366ce,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0xdefe('0x21')]['syncBlindTransfer']=function(_0x564232){try{if(this[_0xdefe('0x22')](_0x564232)){if(this[_0xdefe('0xb')][_0x564232['transfereeuniqueid']]){for(var _0x1dd0cb in this['channels'][_0x564232[_0xdefe('0x6c')]]){if(this['channels'][_0x564232[_0xdefe('0x6c')]][_0xdefe('0x31')](_0x1dd0cb)){if(_0x564232[_0xdefe('0x73')]===_0x1dd0cb){var _0x8a11b5=moment();this[_0xdefe('0xb')][_0x564232[_0xdefe('0x6c')]][_0x1dd0cb][_0xdefe('0x15')]=!![];this['channels'][_0x564232[_0xdefe('0x6c')]][_0x1dd0cb][_0xdefe('0x4c')]=_0x8a11b5;this[_0xdefe('0xb')][_0x564232[_0xdefe('0x6c')]][_0x1dd0cb][_0xdefe('0x41')]=_0xdefe('0x4e');this[_0xdefe('0xb')][_0x564232[_0xdefe('0x6c')]][_0x1dd0cb][_0xdefe('0x34')]=_0xdefe('0x6e');this[_0xdefe('0xb')][_0x564232[_0xdefe('0x6c')]][_0x1dd0cb][_0xdefe('0x4d')]=_0x8a11b5['diff'](this['channels'][_0x564232[_0xdefe('0x6c')]][_0x1dd0cb]['agentconnectAt'],'seconds');}}}}}}catch(_0x5d8c49){logger[_0xdefe('0x2f')]('[syncBlindTransfer][VoiceAgentReport]',util[_0xdefe('0x30')](_0x5d8c49,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0xdefe('0x74')]=function(_0x445080){var _0x365ce3='';try{if(this[_0xdefe('0x22')](_0x445080)){if(_0x445080[_0xdefe('0x75')]){_0x365ce3=_0x445080[_0xdefe('0x75')][_0xdefe('0x76')](0x0,_0x445080[_0xdefe('0x75')][_0xdefe('0x77')]('-'));if(this[_0xdefe('0xd')][_0x365ce3]){this[_0xdefe('0xd')][_0x365ce3][_0xdefe('0x78')]=!![];}}}}catch(_0x5c0257){logger[_0xdefe('0x2f')](_0xdefe('0x79'),util['inspect'](_0x5c0257,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncMusicOnHoldStop']=function(_0x45cefe){var _0x195b07='';try{if(this[_0xdefe('0x22')](_0x45cefe)){if(_0x45cefe[_0xdefe('0x75')]){_0x195b07=_0x45cefe[_0xdefe('0x75')][_0xdefe('0x76')](0x0,_0x45cefe['channel']['lastIndexOf']('-'));if(this['agents'][_0x195b07]){this[_0xdefe('0xd')][_0x195b07][_0xdefe('0x78')]=![];}}}}catch(_0x3e58b5){logger['error'](_0xdefe('0x7a'),util[_0xdefe('0x30')](_0x3e58b5,{'showHidden':![],'depth':null}));}};module[_0xdefe('0x7b')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 97fc6d2..fc2f925 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 _0x2629=['[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','milliseconds','bluebird','lodash','ioredis','../../../config/environment','../../../config/logger','ami','../ami','unknown','not_inuse','busy','unavailable','ringing','ringinuse','set','queue','dial','playback','FAILED','NO\x20ANSWER','ANSWERED','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','newchannel','syncNewChannel','newstate','syncNewState','varset','syncVarSet','bind','hangup','syncHangup','newcallerid','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','resolve','catch','log','prototype','isNotNull','isUndefined','emit','uniqueid','merge','pick','keys','[syncNewCallerId][VoiceCallReport]','inspect','linkedid','channel','OutgoingSpoolFailed','starttime','format','toNumber','context','from-sip','split','destconnectedlinenum','name','user:agentconnect','accountcode','exten','error','[syncNewChannel][VoiceCallReport]','application','toLowerCase','appdata','applicationdata','duration','seconds','YYYY-MM-DD\x20HH:mm:ss','includes','lastapplication','lastdata','startsWith','cdr(','[syncNewExten][VoiceCallReport]','channelstate','answered','answertime','holdtime','diff','xcally-motion-preview','calleridnum','connectedlinename','calleridname','destinationchannel','disposition','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','.wav49','.WAV','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','type','xmd-queue','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','xmcs-queue','sipcallid','parse','sipcalllinkedid','[syncVarSet][VoiceCallReport]','endtime','omit','user:%s','user:agentcomplete','custom:voiceCallReport'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0x2629,0x1c7));var _0x9262=function(_0x2b3a40,_0x386ecd){_0x2b3a40=_0x2b3a40-0x0;var _0x2ad588=_0x2629[_0x2b3a40];return _0x2ad588;};'use strict';var BPromise=require(_0x9262('0x0'));var _=require(_0x9262('0x1'));var moment=require('moment');var util=require('util');var path=require('path');var Redis=require(_0x9262('0x2'));var config=require(_0x9262('0x3'));var logger=require(_0x9262('0x4'))(_0x9262('0x5'));var ami=require(_0x9262('0x6'));var Channel=require('../model/channel');var statusDesc=[_0x9262('0x7'),_0x9262('0x8'),'inuse',_0x9262('0x9'),'invalid',_0x9262('0xa'),_0x9262('0xb'),_0x9262('0xc'),'onhold'];var applications=[_0x9262('0xd'),_0x9262('0xe'),'agi',_0x9262('0xf'),_0x9262('0x10'),'voicemail'];var dispositions=['NO\x20ANSWER','FAILED',_0x9262('0x11'),_0x9262('0x12'),_0x9262('0x12'),_0x9262('0x12'),_0x9262('0x13'),'BUSY',_0x9262('0x11'),_0x9262('0x11'),_0x9262('0x11')];var actions={};config['redis']=_['defaults'](config['redis'],{'host':_0x9262('0x14'),'port':0x18eb});var io=require(_0x9262('0x15'))(new Redis(config['redis']));function VoiceCallReport(_0x4e4f84){this['channels']=_0x4e4f84[_0x9262('0x16')];this[_0x9262('0x17')]=_0x4e4f84['agents'];ami['on'](_0x9262('0x18'),this[_0x9262('0x19')]['bind'](this));ami['on'](_0x9262('0x1a'),this[_0x9262('0x19')]['bind'](this));ami['on'](_0x9262('0x1b'),this[_0x9262('0x1c')]['bind'](this));ami['on'](_0x9262('0x1d'),this[_0x9262('0x1e')]['bind'](this));ami['on'](_0x9262('0x1f'),this[_0x9262('0x20')][_0x9262('0x21')](this));ami['on'](_0x9262('0x22'),this[_0x9262('0x23')][_0x9262('0x21')](this));ami['on'](_0x9262('0x24'),this['syncNewCallerId'][_0x9262('0x21')](this));ami['on'](_0x9262('0x25'),this[_0x9262('0x26')][_0x9262('0x21')](this));ami['on'](_0x9262('0x27'),this[_0x9262('0x28')][_0x9262('0x21')](this));ami['on'](_0x9262('0x29'),this[_0x9262('0x2a')][_0x9262('0x21')](this));ami['on']('musiconholdstop',this[_0x9262('0x2b')][_0x9262('0x21')](this));return BPromise[_0x9262('0x2c')]()['then'](ami['actionCoreShowChannels']())[_0x9262('0x2d')](function(_0x1df77a){console[_0x9262('0x2e')](_0x1df77a);});}VoiceCallReport[_0x9262('0x2f')][_0x9262('0x30')]=function(_0x58013f){return _0x58013f!==null&&!_[_0x9262('0x31')](_0x58013f);};VoiceCallReport['prototype'][_0x9262('0x32')]=function(_0xbd7328,_0xda511b,_0x47bb93){io['to'](_0xbd7328)[_0x9262('0x32')](_0xda511b,_0x47bb93);};VoiceCallReport[_0x9262('0x2f')]['syncNewCallerId']=function(_0x2ab2fa){try{if(this[_0x9262('0x30')](_0x2ab2fa)){if(_0x2ab2fa[_0x9262('0x33')]===_0x2ab2fa['linkedid']){if(!_[_0x9262('0x31')](this[_0x9262('0x16')][_0x2ab2fa[_0x9262('0x33')]])){_[_0x9262('0x34')](this[_0x9262('0x16')][_0x2ab2fa[_0x9262('0x33')]],_[_0x9262('0x35')](_0x2ab2fa,_[_0x9262('0x36')](this[_0x9262('0x16')][_0x2ab2fa[_0x9262('0x33')]])));}}}}catch(_0x58c00f){logger['error'](_0x9262('0x37'),util[_0x9262('0x38')](_0x58c00f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9262('0x2f')][_0x9262('0x1c')]=function(_0x35bcc3){try{if(this[_0x9262('0x30')](_0x35bcc3)){if(_0x35bcc3[_0x9262('0x33')]===_0x35bcc3[_0x9262('0x39')]&&_0x35bcc3[_0x9262('0x3a')]!=_0x9262('0x3b')){if(_[_0x9262('0x31')](this[_0x9262('0x16')][_0x35bcc3[_0x9262('0x33')]])){this[_0x9262('0x16')][_0x35bcc3[_0x9262('0x33')]]=new Channel();this[_0x9262('0x16')][_0x35bcc3[_0x9262('0x33')]][_0x9262('0x3c')]=moment()[_0x9262('0x3d')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x9262('0x16')][_0x35bcc3[_0x9262('0x33')]]['disposition']=dispositions[_[_0x9262('0x3e')](_0x35bcc3['channelstate'])];_[_0x9262('0x34')](this[_0x9262('0x16')][_0x35bcc3[_0x9262('0x33')]],_['pick'](_0x35bcc3,_[_0x9262('0x36')](this[_0x9262('0x16')][_0x35bcc3[_0x9262('0x33')]])));if(_0x35bcc3[_0x9262('0x3f')]===_0x9262('0x40')){if(this[_0x9262('0x17')][_0x35bcc3[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]]){this[_0x9262('0x17')][_0x35bcc3['channel'][_0x9262('0x41')]('-')[0x0]][_0x9262('0x42')]=_0x35bcc3['exten'];this[_0x9262('0x32')](util[_0x9262('0x3d')]('user:%s',this[_0x9262('0x17')][_0x35bcc3[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]][_0x9262('0x43')]),_0x9262('0x44'),{'destaccountcode':this[_0x9262('0x17')][_0x35bcc3[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]][_0x9262('0x45')],'destconnectedlinenum':_0x35bcc3[_0x9262('0x46')]});}}}}}}catch(_0x562087){logger[_0x9262('0x47')](_0x9262('0x48'),util['inspect'](_0x562087,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9262('0x2f')][_0x9262('0x19')]=function(_0x552c20){try{if(this[_0x9262('0x30')](_0x552c20)){if(_0x552c20['uniqueid']===_0x552c20[_0x9262('0x39')]&&_0x552c20[_0x9262('0x46')]!='h'&&_0x552c20['channel']!=_0x9262('0x3b')){_0x552c20[_0x9262('0x49')]=_0x552c20['application'][_0x9262('0x4a')]();_0x552c20['applicationdata']=(_0x552c20[_0x9262('0x4b')]||_0x552c20[_0x9262('0x4c')])['toLowerCase']();if(_[_0x9262('0x31')](this['channels'][_0x552c20[_0x9262('0x33')]])){this[_0x9262('0x16')][_0x552c20[_0x9262('0x33')]]=new Channel();this[_0x9262('0x16')][_0x552c20['uniqueid']][_0x9262('0x3c')]=_0x552c20['duration']?moment()['subtract'](moment[_0x9262('0x4d')](_0x552c20['duration'])[_0x9262('0x4e')](),_0x9262('0x4e'))[_0x9262('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'):moment()[_0x9262('0x3d')](_0x9262('0x4f'));this[_0x9262('0x16')][_0x552c20['uniqueid']]['disposition']=_0x9262('0x12');}_[_0x9262('0x34')](this[_0x9262('0x16')][_0x552c20[_0x9262('0x33')]],_[_0x9262('0x35')](_0x552c20,_['keys'](this['channels'][_0x552c20['uniqueid']])));if(_[_0x9262('0x50')](applications,_0x552c20[_0x9262('0x49')])){this[_0x9262('0x16')][_0x552c20['uniqueid']][_0x9262('0x51')]=_0x552c20['application'];this[_0x9262('0x16')][_0x552c20[_0x9262('0x33')]][_0x9262('0x52')]=_0x552c20[_0x9262('0x4c')];if(_0x552c20[_0x9262('0x49')]==='set'&&_[_0x9262('0x53')](_0x552c20[_0x9262('0x4c')],_0x9262('0x54'))){var _0x329381=_0x552c20[_0x9262('0x4c')][_0x9262('0x41')]('=');var _0x261869=_0x329381[0x0]['match'](/cdr\((.*)\)/);if(_0x261869){this[_0x9262('0x16')][_0x552c20['uniqueid']][_0x261869[0x1]]=_0x329381[0x1];}}else if(_0x552c20[_0x9262('0x49')]===_0x9262('0xe')){this[_0x9262('0x16')][_0x552c20['uniqueid']][_0x9262('0xe')]=_0x552c20[_0x9262('0x4c')]['split'](',')[0x0];}}}}}catch(_0x33c8df){logger[_0x9262('0x47')](_0x9262('0x55'),util[_0x9262('0x38')](_0x33c8df,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9262('0x2f')][_0x9262('0x1e')]=function(_0x44a189){try{if(this[_0x9262('0x30')](_0x44a189)){if(_0x44a189[_0x9262('0x33')]!==_0x44a189[_0x9262('0x39')]){if(this[_0x9262('0x16')][_0x44a189[_0x9262('0x39')]]){if(_0x44a189[_0x9262('0x56')]==='6'){if(!this[_0x9262('0x16')][_0x44a189[_0x9262('0x39')]][_0x9262('0x57')]){var _0x3dcd7f=moment();this[_0x9262('0x16')][_0x44a189[_0x9262('0x39')]][_0x9262('0x57')]=!![];this[_0x9262('0x16')][_0x44a189[_0x9262('0x39')]][_0x9262('0x58')]=_0x3dcd7f[_0x9262('0x3d')](_0x9262('0x4f'));if(this[_0x9262('0x16')][_0x44a189[_0x9262('0x39')]][_0x9262('0x3c')]){this['channels'][_0x44a189[_0x9262('0x39')]][_0x9262('0x59')]=_0x3dcd7f[_0x9262('0x5a')](this['channels'][_0x44a189[_0x9262('0x39')]][_0x9262('0x3c')],_0x9262('0x4e'));}}this['channels'][_0x44a189['linkedid']][_0x9262('0x39')]=_0x44a189[_0x9262('0x33')];if(_0x44a189['calleridnum']!==_0x9262('0x5b')){this[_0x9262('0x16')][_0x44a189[_0x9262('0x39')]]['connectedlinenum']=_0x44a189[_0x9262('0x5c')];}this[_0x9262('0x16')][_0x44a189['linkedid']][_0x9262('0x5d')]=_0x44a189[_0x9262('0x5e')];this[_0x9262('0x16')][_0x44a189['linkedid']][_0x9262('0x5f')]=_0x44a189[_0x9262('0x3a')];this['channels'][_0x44a189[_0x9262('0x39')]][_0x9262('0x60')]=dispositions[_[_0x9262('0x3e')](_0x44a189[_0x9262('0x56')])];if(this[_0x9262('0x17')][_0x44a189[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]]){this[_0x9262('0x16')][_0x44a189['linkedid']][_0x9262('0x61')]=this['agents'][_0x44a189[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]]['id'];this[_0x9262('0x16')][_0x44a189['linkedid']][_0x9262('0x62')]=this[_0x9262('0x17')][_0x44a189['channel']['split']('-')[0x0]][_0x9262('0x43')];}}}}else{if(this[_0x9262('0x16')][_0x44a189[_0x9262('0x33')]]){if(_0x44a189['channelstate']==='6'){if(this[_0x9262('0x17')][_0x44a189[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]]){this[_0x9262('0x16')][_0x44a189[_0x9262('0x33')]]['UserId']=this[_0x9262('0x17')][_0x44a189[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]]['id'];this[_0x9262('0x16')][_0x44a189[_0x9262('0x33')]][_0x9262('0x62')]=this[_0x9262('0x17')][_0x44a189[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]][_0x9262('0x43')];}}}}}}catch(_0x59ab5c){logger[_0x9262('0x47')](_0x9262('0x63'),util[_0x9262('0x38')](_0x59ab5c,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9262('0x64')]=function(_0x4c01f2,_0x412108){if(this['channels'][_0x4c01f2]){this[_0x9262('0x16')][_0x4c01f2]['monitor']=!![];if(_[_0x9262('0x65')](_0x412108,_0x9262('0x66'))){_0x412108=_0x412108['replace'](_0x9262('0x66'),_0x9262('0x67'));}this[_0x9262('0x16')][_0x4c01f2][_0x9262('0x68')]=_0x412108;var _0x14f194=_[_0x9262('0x69')](this[_0x9262('0x16')][_0x4c01f2][_0x9262('0x6a')],{'filename':_0x412108});if(_[_0x9262('0x6b')](_0x14f194)){this[_0x9262('0x16')][_0x4c01f2]['monitors'][_0x9262('0x6c')]({'filename':_0x412108,'createdAt':moment()[_0x9262('0x3d')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x9262('0x6d')});}}};VoiceCallReport[_0x9262('0x2f')][_0x9262('0x20')]=function(_0x1d2a41){try{if(this[_0x9262('0x30')](_0x1d2a41)){if(this['channels'][_0x1d2a41[_0x9262('0x33')]]&&_0x1d2a41[_0x9262('0x3a')]!=_0x9262('0x3b')){if(this['isNotNull'](_0x1d2a41[_0x9262('0x6e')])){if(this[_0x9262('0x30')](_0x1d2a41[_0x9262('0x6e')][_0x9262('0x6f')])){this[_0x9262('0x64')](_0x1d2a41[_0x9262('0x33')],_0x1d2a41[_0x9262('0x70')]);}else if(this[_0x9262('0x30')](_0x1d2a41[_0x9262('0x6e')][_0x9262('0x71')])){this[_0x9262('0x16')][_0x1d2a41['uniqueid']][_0x9262('0x5c')]=_0x1d2a41['value'];}else if(this['isNotNull'](_0x1d2a41['variable'][_0x9262('0x72')])){this['channels'][_0x1d2a41[_0x9262('0x33')]][_0x9262('0x73')]=_0x1d2a41[_0x9262('0x70')];}else if(this[_0x9262('0x30')](_0x1d2a41[_0x9262('0x6e')]['xmd-cdrtype'])){this[_0x9262('0x16')][_0x1d2a41[_0x9262('0x33')]][_0x9262('0x74')]=_0x1d2a41[_0x9262('0x70')];}else if(this[_0x9262('0x30')](_0x1d2a41[_0x9262('0x6e')][_0x9262('0x75')])){this[_0x9262('0x16')][_0x1d2a41[_0x9262('0x33')]]['queue']=_0x1d2a41[_0x9262('0x70')][_0x9262('0x41')](',')[0x0];}else if(this[_0x9262('0x30')](_0x1d2a41['variable']['xmd-originatecalleridnum'])){this[_0x9262('0x16')][_0x1d2a41[_0x9262('0x33')]][_0x9262('0x76')]=_0x1d2a41['value'];}else if(this[_0x9262('0x30')](_0x1d2a41['variable'][_0x9262('0x77')])){this[_0x9262('0x16')][_0x1d2a41[_0x9262('0x33')]][_0x9262('0x78')]=_0x1d2a41['value'];}else if(this[_0x9262('0x30')](_0x1d2a41[_0x9262('0x6e')][_0x9262('0x79')])){this[_0x9262('0x16')][_0x1d2a41[_0x9262('0x33')]][_0x9262('0x7a')]=_0x1d2a41[_0x9262('0x70')];}else if(this[_0x9262('0x30')](_0x1d2a41[_0x9262('0x6e')][_0x9262('0x7b')])){this[_0x9262('0x16')][_0x1d2a41[_0x9262('0x33')]][_0x9262('0xe')]=_0x1d2a41[_0x9262('0x70')];}else if(this[_0x9262('0x30')](_0x1d2a41['variable'][_0x9262('0x7c')])){this[_0x9262('0x16')][_0x1d2a41[_0x9262('0x33')]]['sipcalluniqueid']=_0x1d2a41[_0x9262('0x70')];}}}else if(this[_0x9262('0x30')](_0x1d2a41[_0x9262('0x6e')][_0x9262('0x6f')])){if(_0x1d2a41[_0x9262('0x70')]){var _0x3f9fba=path[_0x9262('0x7d')](_0x1d2a41[_0x9262('0x70')])[_0x9262('0x43')];this['syncMixMonitorFilename'](_0x3f9fba,_0x1d2a41[_0x9262('0x70')]);}}else if(this['channels'][_0x1d2a41[_0x9262('0x39')]]){if(this[_0x9262('0x30')](_0x1d2a41[_0x9262('0x6e')])){if(this['isNotNull'](_0x1d2a41['variable']['sipcallid'])){this[_0x9262('0x16')][_0x1d2a41[_0x9262('0x39')]][_0x9262('0x7e')]=_0x1d2a41[_0x9262('0x70')];}}}}}catch(_0x36f3b1){logger[_0x9262('0x47')](_0x9262('0x7f'),util[_0x9262('0x38')](_0x36f3b1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9262('0x2f')][_0x9262('0x23')]=function(_0x45a448){try{if(this['isNotNull'](_0x45a448)){if(this[_0x9262('0x16')][_0x45a448[_0x9262('0x33')]]){var _0x2ea4f7=moment();this[_0x9262('0x16')][_0x45a448[_0x9262('0x33')]][_0x9262('0x80')]=_0x2ea4f7['format'](_0x9262('0x4f'));this['channels'][_0x45a448[_0x9262('0x33')]][_0x9262('0x4d')]=_0x2ea4f7[_0x9262('0x5a')](this[_0x9262('0x16')][_0x45a448[_0x9262('0x33')]]['starttime'],_0x9262('0x4e'));if(this['channels'][_0x45a448[_0x9262('0x33')]]['answered']){this[_0x9262('0x16')][_0x45a448['uniqueid']]['billableseconds']=_0x2ea4f7[_0x9262('0x5a')](this[_0x9262('0x16')][_0x45a448['uniqueid']][_0x9262('0x58')],'seconds');this[_0x9262('0x16')][_0x45a448[_0x9262('0x33')]]['holdtime']=this[_0x9262('0x16')][_0x45a448[_0x9262('0x33')]][_0x9262('0x4d')]-this[_0x9262('0x16')][_0x45a448['uniqueid']]['billableseconds'];}if(_0x45a448[_0x9262('0x3f')]==='from-sip'){if(this[_0x9262('0x17')][_0x45a448[_0x9262('0x3a')]['split']('-')[0x0]]){this[_0x9262('0x17')][_0x45a448['channel']['split']('-')[0x0]]=_[_0x9262('0x81')](this[_0x9262('0x17')][_0x45a448[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]],[_0x9262('0x42')]);this['emit'](util[_0x9262('0x3d')](_0x9262('0x82'),this[_0x9262('0x17')][_0x45a448[_0x9262('0x3a')]['split']('-')[0x0]]['name']),_0x9262('0x83'),{'destaccountcode':this[_0x9262('0x17')][_0x45a448[_0x9262('0x3a')][_0x9262('0x41')]('-')[0x0]][_0x9262('0x45')]});}}ami[_0x9262('0x32')](_0x9262('0x84'),this[_0x9262('0x16')][_0x45a448[_0x9262('0x33')]]);delete this[_0x9262('0x16')][_0x45a448['uniqueid']];}}}catch(_0x43a729){logger['error'](_0x9262('0x85'),util[_0x9262('0x38')](_0x43a729,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x9262('0x2f')][_0x9262('0x26')]=function(_0x10b096){try{if(this[_0x9262('0x30')](_0x10b096)){if(this[_0x9262('0x16')][_0x10b096[_0x9262('0x86')]]){this['channels'][_0x10b096[_0x9262('0x86')]][_0x9262('0x87')]=_0x10b096[_0x9262('0x88')];this[_0x9262('0x16')][_0x10b096['transfereeuniqueid']][_0x9262('0x89')]=_0x10b096[_0x9262('0x8a')];if(this['channels'][_0x10b096['secondtransfereruniqueid']]){var _0x2ae411=this['channels'][_0x10b096['secondtransfereruniqueid']];this['channels'][_0x10b096[_0x9262('0x8b')]]=this[_0x9262('0x16')][_0x10b096[_0x9262('0x86')]];this[_0x9262('0x16')][_0x10b096[_0x9262('0x86')]]=_0x2ae411;}}else if(this[_0x9262('0x16')][_0x10b096[_0x9262('0x8c')]]){this[_0x9262('0x16')][_0x10b096[_0x9262('0x8c')]][_0x9262('0x87')]=_0x10b096[_0x9262('0x88')];this[_0x9262('0x16')][_0x10b096[_0x9262('0x8c')]][_0x9262('0x89')]=_0x10b096[_0x9262('0x8a')];if(this[_0x9262('0x16')][_0x10b096[_0x9262('0x8d')]]){var _0x2ae411=this[_0x9262('0x16')][_0x10b096[_0x9262('0x8d')]];this['channels'][_0x10b096[_0x9262('0x8d')]]=this['channels'][_0x10b096[_0x9262('0x8c')]];this['channels'][_0x10b096[_0x9262('0x8c')]]=_0x2ae411;}}}}catch(_0x235483){logger[_0x9262('0x47')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x9262('0x38')](_0x235483,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9262('0x28')]=function(_0x47c9cf){try{if(this[_0x9262('0x30')](_0x47c9cf)){if(this['channels'][_0x47c9cf[_0x9262('0x86')]]){this[_0x9262('0x16')][_0x47c9cf['transfereeuniqueid']][_0x9262('0x87')]=_0x47c9cf['transfereecalleridnum'];this[_0x9262('0x16')][_0x47c9cf[_0x9262('0x86')]][_0x9262('0x89')]=_0x47c9cf['extension'];this[_0x9262('0x23')]({'event':'BlindTransfer','uniqueid':_0x47c9cf['transfereeuniqueid'],'context':_0x47c9cf[_0x9262('0x3f')],'channel':_0x47c9cf[_0x9262('0x8e')]});}}}catch(_0x479073){logger[_0x9262('0x47')](_0x9262('0x8f'),util[_0x9262('0x38')](_0x479073,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype']['syncMusicOnHoldStart']=function(_0x1621f8){try{if(this['isNotNull'](_0x1621f8)){if(this[_0x9262('0x16')][_0x1621f8['uniqueid']]){if(!_[_0x9262('0x6b')](this['channels'][_0x1621f8[_0x9262('0x33')]][_0x9262('0x58')])){this['channels'][_0x1621f8['uniqueid']][_0x9262('0x90')]=moment()[_0x9262('0x3d')](_0x9262('0x4f'));}}}}catch(_0x3ba3ef){logger[_0x9262('0x47')](_0x9262('0x91'),util[_0x9262('0x38')](_0x3ba3ef,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x9262('0x2b')]=function(_0x1cac43){try{if(this[_0x9262('0x30')](_0x1cac43)){if(this[_0x9262('0x16')][_0x1cac43['uniqueid']]){if(!_[_0x9262('0x6b')](this['channels'][_0x1cac43['uniqueid']][_0x9262('0x90')])){this[_0x9262('0x16')][_0x1cac43['uniqueid']]['mohtime']+=moment()[_0x9262('0x92')](0x0)['diff'](this[_0x9262('0x16')][_0x1cac43[_0x9262('0x33')]][_0x9262('0x90')],'seconds');delete this[_0x9262('0x16')][_0x1cac43[_0x9262('0x33')]]['mohstarttime'];}}}}catch(_0x206d69){logger['error']('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x9262('0x38')](_0x206d69,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0xdf02=['subtract','includes','lastapplication','lastdata','cdr(','match','[syncNewExten][VoiceCallReport]','channelstate','answered','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','disposition','membername','name','UserId','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','.wav49','.WAV','monitorFilename','find','monitors','isNil','syncVarSet','OutgoingSpoolFailed','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','callerid','xmd-originatecalleridnum','destination','xmd-callerid-preview','calleridpreview','sipcalluniqueid','sipcallid','sipcalllinkedid','endtime','seconds','billableseconds','answertime','holdtime','context','from-sip','user:%s','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','syncBlindTransfer','transfereecalleridnum','extension','transfererchannel','[syncBlindTransfer][VoiceCallReport]','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','milliseconds','[syncMusicOnHoldStop][VoiceCallReport]','exports','bluebird','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','../model/channel','unknown','inuse','busy','invalid','unavailable','ringing','ringinuse','onhold','set','queue','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','syncNewState','varset','hangup','syncHangup','attendedtransfer','syncAttendedTransfer','blindtransfer','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','log','prototype','isNotNull','isUndefined','emit','syncNewCallerId','linkedid','uniqueid','merge','pick','keys','error','inspect','channel','YYYY-MM-DD\x20HH:mm:ss','toNumber','split','destconnectedlinenum','exten','format','user:agentconnect','application','toLowerCase','appdata','applicationdata','starttime','duration'];(function(_0x5a7112,_0x1f9492){var _0x3147f7=function(_0x4d2329){while(--_0x4d2329){_0x5a7112['push'](_0x5a7112['shift']());}};_0x3147f7(++_0x1f9492);}(_0xdf02,0xde));var _0x2df0=function(_0x1beef3,_0x57c4b8){_0x1beef3=_0x1beef3-0x0;var _0x5af964=_0xdf02[_0x1beef3];return _0x5af964;};'use strict';var BPromise=require(_0x2df0('0x0'));var _=require(_0x2df0('0x1'));var moment=require('moment');var util=require(_0x2df0('0x2'));var path=require('path');var Redis=require(_0x2df0('0x3'));var config=require(_0x2df0('0x4'));var logger=require(_0x2df0('0x5'))(_0x2df0('0x6'));var ami=require(_0x2df0('0x7'));var Channel=require(_0x2df0('0x8'));var statusDesc=[_0x2df0('0x9'),'not_inuse',_0x2df0('0xa'),_0x2df0('0xb'),_0x2df0('0xc'),_0x2df0('0xd'),_0x2df0('0xe'),_0x2df0('0xf'),_0x2df0('0x10')];var applications=[_0x2df0('0x11'),_0x2df0('0x12'),'agi','dial',_0x2df0('0x13'),_0x2df0('0x14')];var dispositions=[_0x2df0('0x15'),_0x2df0('0x16'),_0x2df0('0x16'),_0x2df0('0x15'),'NO\x20ANSWER',_0x2df0('0x15'),_0x2df0('0x17'),_0x2df0('0x18'),'FAILED',_0x2df0('0x16'),_0x2df0('0x16')];var actions={};config[_0x2df0('0x19')]=_[_0x2df0('0x1a')](config[_0x2df0('0x19')],{'host':'localhost','port':0x18eb});var io=require(_0x2df0('0x1b'))(new Redis(config['redis']));function VoiceCallReport(_0x3e3f6a){this[_0x2df0('0x1c')]=_0x3e3f6a[_0x2df0('0x1c')];this[_0x2df0('0x1d')]=_0x3e3f6a[_0x2df0('0x1d')];ami['on'](_0x2df0('0x1e'),this[_0x2df0('0x1f')][_0x2df0('0x20')](this));ami['on'](_0x2df0('0x21'),this[_0x2df0('0x1f')]['bind'](this));ami['on'](_0x2df0('0x22'),this['syncNewChannel'][_0x2df0('0x20')](this));ami['on'](_0x2df0('0x23'),this[_0x2df0('0x24')][_0x2df0('0x20')](this));ami['on'](_0x2df0('0x25'),this['syncVarSet'][_0x2df0('0x20')](this));ami['on'](_0x2df0('0x26'),this[_0x2df0('0x27')][_0x2df0('0x20')](this));ami['on']('newcallerid',this['syncNewCallerId'][_0x2df0('0x20')](this));ami['on'](_0x2df0('0x28'),this[_0x2df0('0x29')][_0x2df0('0x20')](this));ami['on'](_0x2df0('0x2a'),this['syncBlindTransfer'][_0x2df0('0x20')](this));ami['on']('musiconholdstart',this[_0x2df0('0x2b')][_0x2df0('0x20')](this));ami['on'](_0x2df0('0x2c'),this[_0x2df0('0x2d')]['bind'](this));return BPromise[_0x2df0('0x2e')]()['then'](ami['actionCoreShowChannels']())['catch'](function(_0x363c30){console[_0x2df0('0x2f')](_0x363c30);});}VoiceCallReport[_0x2df0('0x30')][_0x2df0('0x31')]=function(_0x2d0974){return _0x2d0974!==null&&!_[_0x2df0('0x32')](_0x2d0974);};VoiceCallReport['prototype'][_0x2df0('0x33')]=function(_0x283700,_0x4128a0,_0x3970fa){io['to'](_0x283700)[_0x2df0('0x33')](_0x4128a0,_0x3970fa);};VoiceCallReport[_0x2df0('0x30')][_0x2df0('0x34')]=function(_0xa68c9e){try{if(this['isNotNull'](_0xa68c9e)){if(_0xa68c9e['uniqueid']===_0xa68c9e[_0x2df0('0x35')]){if(!_[_0x2df0('0x32')](this[_0x2df0('0x1c')][_0xa68c9e[_0x2df0('0x36')]])){_[_0x2df0('0x37')](this[_0x2df0('0x1c')][_0xa68c9e[_0x2df0('0x36')]],_[_0x2df0('0x38')](_0xa68c9e,_[_0x2df0('0x39')](this[_0x2df0('0x1c')][_0xa68c9e[_0x2df0('0x36')]])));}}}}catch(_0x1d6399){logger[_0x2df0('0x3a')]('[syncNewCallerId][VoiceCallReport]',util[_0x2df0('0x3b')](_0x1d6399,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')]['syncNewChannel']=function(_0x2c2f14){try{if(this[_0x2df0('0x31')](_0x2c2f14)){if(_0x2c2f14[_0x2df0('0x36')]===_0x2c2f14[_0x2df0('0x35')]&&_0x2c2f14[_0x2df0('0x3c')]!='OutgoingSpoolFailed'){if(_['isUndefined'](this[_0x2df0('0x1c')][_0x2c2f14[_0x2df0('0x36')]])){this[_0x2df0('0x1c')][_0x2c2f14['uniqueid']]=new Channel();this['channels'][_0x2c2f14['uniqueid']]['starttime']=moment()['format'](_0x2df0('0x3d'));this['channels'][_0x2c2f14[_0x2df0('0x36')]]['disposition']=dispositions[_[_0x2df0('0x3e')](_0x2c2f14['channelstate'])];_[_0x2df0('0x37')](this[_0x2df0('0x1c')][_0x2c2f14[_0x2df0('0x36')]],_[_0x2df0('0x38')](_0x2c2f14,_[_0x2df0('0x39')](this[_0x2df0('0x1c')][_0x2c2f14[_0x2df0('0x36')]])));if(_0x2c2f14['context']==='from-sip'){if(this[_0x2df0('0x1d')][_0x2c2f14[_0x2df0('0x3c')][_0x2df0('0x3f')]('-')[0x0]]){this['agents'][_0x2c2f14['channel'][_0x2df0('0x3f')]('-')[0x0]][_0x2df0('0x40')]=_0x2c2f14[_0x2df0('0x41')];this['emit'](util[_0x2df0('0x42')]('user:%s',this[_0x2df0('0x1d')][_0x2c2f14[_0x2df0('0x3c')][_0x2df0('0x3f')]('-')[0x0]]['name']),_0x2df0('0x43'),{'destaccountcode':this[_0x2df0('0x1d')][_0x2c2f14[_0x2df0('0x3c')]['split']('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x2c2f14[_0x2df0('0x41')]});}}}}}}catch(_0x34e2ec){logger['error']('[syncNewChannel][VoiceCallReport]',util[_0x2df0('0x3b')](_0x34e2ec,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')][_0x2df0('0x1f')]=function(_0x9b5942){try{if(this[_0x2df0('0x31')](_0x9b5942)){if(_0x9b5942['uniqueid']===_0x9b5942[_0x2df0('0x35')]&&_0x9b5942[_0x2df0('0x41')]!='h'&&_0x9b5942[_0x2df0('0x3c')]!='OutgoingSpoolFailed'){_0x9b5942['application']=_0x9b5942[_0x2df0('0x44')][_0x2df0('0x45')]();_0x9b5942['applicationdata']=(_0x9b5942[_0x2df0('0x46')]||_0x9b5942[_0x2df0('0x47')])[_0x2df0('0x45')]();if(_[_0x2df0('0x32')](this['channels'][_0x9b5942[_0x2df0('0x36')]])){this[_0x2df0('0x1c')][_0x9b5942[_0x2df0('0x36')]]=new Channel();this['channels'][_0x9b5942[_0x2df0('0x36')]][_0x2df0('0x48')]=_0x9b5942[_0x2df0('0x49')]?moment()[_0x2df0('0x4a')](moment[_0x2df0('0x49')](_0x9b5942[_0x2df0('0x49')])['seconds'](),'seconds')[_0x2df0('0x42')](_0x2df0('0x3d')):moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x2df0('0x1c')][_0x9b5942[_0x2df0('0x36')]]['disposition']=_0x2df0('0x15');}_[_0x2df0('0x37')](this[_0x2df0('0x1c')][_0x9b5942[_0x2df0('0x36')]],_[_0x2df0('0x38')](_0x9b5942,_[_0x2df0('0x39')](this['channels'][_0x9b5942[_0x2df0('0x36')]])));if(_[_0x2df0('0x4b')](applications,_0x9b5942['application'])){this[_0x2df0('0x1c')][_0x9b5942[_0x2df0('0x36')]][_0x2df0('0x4c')]=_0x9b5942[_0x2df0('0x44')];this[_0x2df0('0x1c')][_0x9b5942[_0x2df0('0x36')]][_0x2df0('0x4d')]=_0x9b5942[_0x2df0('0x47')];if(_0x9b5942[_0x2df0('0x44')]===_0x2df0('0x11')&&_['startsWith'](_0x9b5942[_0x2df0('0x47')],_0x2df0('0x4e'))){var _0x28d73c=_0x9b5942['applicationdata'][_0x2df0('0x3f')]('=');var _0x2f68c6=_0x28d73c[0x0][_0x2df0('0x4f')](/cdr\((.*)\)/);if(_0x2f68c6){this[_0x2df0('0x1c')][_0x9b5942['uniqueid']][_0x2f68c6[0x1]]=_0x28d73c[0x1];}}else if(_0x9b5942[_0x2df0('0x44')]==='queue'){this[_0x2df0('0x1c')][_0x9b5942['uniqueid']]['queue']=_0x9b5942['applicationdata'][_0x2df0('0x3f')](',')[0x0];}}}}}catch(_0x1f0ed0){logger[_0x2df0('0x3a')](_0x2df0('0x50'),util[_0x2df0('0x3b')](_0x1f0ed0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')]['syncNewState']=function(_0x42a6ec){try{if(this['isNotNull'](_0x42a6ec)){if(_0x42a6ec['uniqueid']!==_0x42a6ec[_0x2df0('0x35')]){if(this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]]){if(_0x42a6ec[_0x2df0('0x51')]==='6'){if(!this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]]['answered']){var _0x2b7dce=moment();this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]][_0x2df0('0x52')]=!![];this[_0x2df0('0x1c')][_0x42a6ec['linkedid']]['answertime']=_0x2b7dce[_0x2df0('0x42')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]][_0x2df0('0x48')]){this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]]['holdtime']=_0x2b7dce[_0x2df0('0x53')](this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]][_0x2df0('0x48')],'seconds');}}this['channels'][_0x42a6ec['linkedid']][_0x2df0('0x35')]=_0x42a6ec['uniqueid'];if(_0x42a6ec[_0x2df0('0x54')]!==_0x2df0('0x55')){this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]][_0x2df0('0x56')]=_0x42a6ec[_0x2df0('0x54')];}this['channels'][_0x42a6ec[_0x2df0('0x35')]][_0x2df0('0x57')]=_0x42a6ec[_0x2df0('0x58')];this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]][_0x2df0('0x59')]=_0x42a6ec[_0x2df0('0x3c')];this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]][_0x2df0('0x5a')]=dispositions[_[_0x2df0('0x3e')](_0x42a6ec[_0x2df0('0x51')])];if(this['agents'][_0x42a6ec['channel'][_0x2df0('0x3f')]('-')[0x0]]){this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]]['UserId']=this['agents'][_0x42a6ec[_0x2df0('0x3c')][_0x2df0('0x3f')]('-')[0x0]]['id'];this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x35')]][_0x2df0('0x5b')]=this[_0x2df0('0x1d')][_0x42a6ec['channel'][_0x2df0('0x3f')]('-')[0x0]][_0x2df0('0x5c')];}}}}else{if(this[_0x2df0('0x1c')][_0x42a6ec[_0x2df0('0x36')]]){if(_0x42a6ec[_0x2df0('0x51')]==='6'){if(this[_0x2df0('0x1d')][_0x42a6ec[_0x2df0('0x3c')][_0x2df0('0x3f')]('-')[0x0]]){this[_0x2df0('0x1c')][_0x42a6ec['uniqueid']][_0x2df0('0x5d')]=this[_0x2df0('0x1d')][_0x42a6ec[_0x2df0('0x3c')][_0x2df0('0x3f')]('-')[0x0]]['id'];this[_0x2df0('0x1c')][_0x42a6ec['uniqueid']][_0x2df0('0x5b')]=this[_0x2df0('0x1d')][_0x42a6ec['channel'][_0x2df0('0x3f')]('-')[0x0]][_0x2df0('0x5c')];}}}}}}catch(_0xd9a5c2){logger[_0x2df0('0x3a')](_0x2df0('0x5e'),util['inspect'](_0xd9a5c2,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')][_0x2df0('0x5f')]=function(_0x1d1985,_0x443a1b){if(this[_0x2df0('0x1c')][_0x1d1985]){this[_0x2df0('0x1c')][_0x1d1985][_0x2df0('0x60')]=!![];if(_['endsWith'](_0x443a1b,_0x2df0('0x61'))){_0x443a1b=_0x443a1b['replace'](_0x2df0('0x61'),_0x2df0('0x62'));}this[_0x2df0('0x1c')][_0x1d1985][_0x2df0('0x63')]=_0x443a1b;var _0x1580c=_[_0x2df0('0x64')](this[_0x2df0('0x1c')][_0x1d1985][_0x2df0('0x65')],{'filename':_0x443a1b});if(_[_0x2df0('0x66')](_0x1580c)){this[_0x2df0('0x1c')][_0x1d1985][_0x2df0('0x65')]['push']({'filename':_0x443a1b,'createdAt':moment()[_0x2df0('0x42')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x2df0('0x30')][_0x2df0('0x67')]=function(_0x24d068){try{if(this['isNotNull'](_0x24d068)){if(this[_0x2df0('0x1c')][_0x24d068['uniqueid']]&&_0x24d068[_0x2df0('0x3c')]!=_0x2df0('0x68')){if(this['isNotNull'](_0x24d068[_0x2df0('0x69')])){if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')][_0x2df0('0x6a')])){this[_0x2df0('0x5f')](_0x24d068[_0x2df0('0x36')],_0x24d068['value']);}else if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')][_0x2df0('0x6b')])){this['channels'][_0x24d068[_0x2df0('0x36')]][_0x2df0('0x54')]=_0x24d068[_0x2df0('0x6c')];}else if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')][_0x2df0('0x6d')])){this[_0x2df0('0x1c')][_0x24d068[_0x2df0('0x36')]][_0x2df0('0x6e')]=_0x24d068[_0x2df0('0x6c')];}else if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')]['xmd-cdrtype'])){this[_0x2df0('0x1c')][_0x24d068['uniqueid']]['type']=_0x24d068[_0x2df0('0x6c')];}else if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')]['xmd-queue'])){this[_0x2df0('0x1c')][_0x24d068[_0x2df0('0x36')]][_0x2df0('0x12')]=_0x24d068[_0x2df0('0x6c')][_0x2df0('0x3f')](',')[0x0];}else if(this[_0x2df0('0x31')](_0x24d068['variable'][_0x2df0('0x6f')])){this[_0x2df0('0x1c')][_0x24d068[_0x2df0('0x36')]]['originatecalleridnum']=_0x24d068[_0x2df0('0x6c')];}else if(this['isNotNull'](_0x24d068[_0x2df0('0x69')]['xmd-destination'])){this[_0x2df0('0x1c')][_0x24d068['uniqueid']][_0x2df0('0x70')]=_0x24d068[_0x2df0('0x6c')];}else if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')][_0x2df0('0x71')])){this[_0x2df0('0x1c')][_0x24d068[_0x2df0('0x36')]][_0x2df0('0x72')]=_0x24d068[_0x2df0('0x6c')];}else if(this[_0x2df0('0x31')](_0x24d068['variable']['xmcs-queue'])){this[_0x2df0('0x1c')][_0x24d068[_0x2df0('0x36')]]['queue']=_0x24d068[_0x2df0('0x6c')];}else if(this['isNotNull'](_0x24d068[_0x2df0('0x69')]['sipcallid'])){this[_0x2df0('0x1c')][_0x24d068[_0x2df0('0x36')]][_0x2df0('0x73')]=_0x24d068[_0x2df0('0x6c')];}}}else if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')][_0x2df0('0x6a')])){if(_0x24d068[_0x2df0('0x6c')]){var _0x2eeb05=path['parse'](_0x24d068[_0x2df0('0x6c')])[_0x2df0('0x5c')];this[_0x2df0('0x5f')](_0x2eeb05,_0x24d068[_0x2df0('0x6c')]);}}else if(this[_0x2df0('0x1c')][_0x24d068[_0x2df0('0x35')]]){if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')])){if(this[_0x2df0('0x31')](_0x24d068[_0x2df0('0x69')][_0x2df0('0x74')])){this[_0x2df0('0x1c')][_0x24d068['linkedid']][_0x2df0('0x75')]=_0x24d068['value'];}}}}}catch(_0x161ff1){logger[_0x2df0('0x3a')]('[syncVarSet][VoiceCallReport]',util[_0x2df0('0x3b')](_0x161ff1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')][_0x2df0('0x27')]=function(_0xb548e8){try{if(this['isNotNull'](_0xb548e8)){if(this[_0x2df0('0x1c')][_0xb548e8['uniqueid']]){var _0x490560=moment();this[_0x2df0('0x1c')][_0xb548e8[_0x2df0('0x36')]][_0x2df0('0x76')]=_0x490560[_0x2df0('0x42')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2df0('0x1c')][_0xb548e8[_0x2df0('0x36')]][_0x2df0('0x49')]=_0x490560[_0x2df0('0x53')](this[_0x2df0('0x1c')][_0xb548e8[_0x2df0('0x36')]][_0x2df0('0x48')],_0x2df0('0x77'));if(this[_0x2df0('0x1c')][_0xb548e8[_0x2df0('0x36')]][_0x2df0('0x52')]){this[_0x2df0('0x1c')][_0xb548e8[_0x2df0('0x36')]][_0x2df0('0x78')]=_0x490560[_0x2df0('0x53')](this[_0x2df0('0x1c')][_0xb548e8['uniqueid']][_0x2df0('0x79')],_0x2df0('0x77'));this[_0x2df0('0x1c')][_0xb548e8[_0x2df0('0x36')]][_0x2df0('0x7a')]=this[_0x2df0('0x1c')][_0xb548e8[_0x2df0('0x36')]][_0x2df0('0x49')]-this['channels'][_0xb548e8[_0x2df0('0x36')]][_0x2df0('0x78')];}if(_0xb548e8[_0x2df0('0x7b')]===_0x2df0('0x7c')){if(this[_0x2df0('0x1d')][_0xb548e8[_0x2df0('0x3c')][_0x2df0('0x3f')]('-')[0x0]]){this[_0x2df0('0x1d')][_0xb548e8[_0x2df0('0x3c')][_0x2df0('0x3f')]('-')[0x0]]=_['omit'](this[_0x2df0('0x1d')][_0xb548e8[_0x2df0('0x3c')][_0x2df0('0x3f')]('-')[0x0]],[_0x2df0('0x40')]);this['emit'](util[_0x2df0('0x42')](_0x2df0('0x7d'),this['agents'][_0xb548e8['channel'][_0x2df0('0x3f')]('-')[0x0]][_0x2df0('0x5c')]),_0x2df0('0x7e'),{'destaccountcode':this[_0x2df0('0x1d')][_0xb548e8[_0x2df0('0x3c')]['split']('-')[0x0]]['accountcode']});}}ami[_0x2df0('0x33')](_0x2df0('0x7f'),this[_0x2df0('0x1c')][_0xb548e8[_0x2df0('0x36')]]);delete this['channels'][_0xb548e8[_0x2df0('0x36')]];}}}catch(_0x56f86a){logger[_0x2df0('0x3a')](_0x2df0('0x80'),util[_0x2df0('0x3b')](_0x56f86a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')]['syncAttendedTransfer']=function(_0x30369e){try{if(this[_0x2df0('0x31')](_0x30369e)){if(this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x81')]]){this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x81')]][_0x2df0('0x82')]=_0x30369e[_0x2df0('0x83')];this['channels'][_0x30369e['transfereeuniqueid']][_0x2df0('0x84')]=_0x30369e[_0x2df0('0x85')];if(this['channels'][_0x30369e[_0x2df0('0x86')]]){var _0x134bea=this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x86')]];this['channels'][_0x30369e[_0x2df0('0x86')]]=this['channels'][_0x30369e[_0x2df0('0x81')]];this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x81')]]=_0x134bea;}}else if(this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x87')]]){this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x87')]][_0x2df0('0x82')]=_0x30369e[_0x2df0('0x83')];this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x87')]][_0x2df0('0x84')]=_0x30369e[_0x2df0('0x85')];if(this[_0x2df0('0x1c')][_0x30369e['origtransfereruniqueid']]){var _0x134bea=this[_0x2df0('0x1c')][_0x30369e['origtransfereruniqueid']];this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x88')]]=this[_0x2df0('0x1c')][_0x30369e['transfertargetuniqueid']];this[_0x2df0('0x1c')][_0x30369e[_0x2df0('0x87')]]=_0x134bea;}}}}catch(_0x5b20c0){logger[_0x2df0('0x3a')](_0x2df0('0x89'),util[_0x2df0('0x3b')](_0x5b20c0,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')][_0x2df0('0x8a')]=function(_0x5c4571){try{if(this[_0x2df0('0x31')](_0x5c4571)){if(this[_0x2df0('0x1c')][_0x5c4571[_0x2df0('0x81')]]){this[_0x2df0('0x1c')][_0x5c4571['transfereeuniqueid']]['transfercalleridnum']=_0x5c4571[_0x2df0('0x8b')];this[_0x2df0('0x1c')][_0x5c4571[_0x2df0('0x81')]]['transferconnectedlinenum']=_0x5c4571[_0x2df0('0x8c')];this[_0x2df0('0x27')]({'event':'BlindTransfer','uniqueid':_0x5c4571[_0x2df0('0x81')],'context':_0x5c4571['context'],'channel':_0x5c4571[_0x2df0('0x8d')]});}}}catch(_0x3d9fd8){logger['error'](_0x2df0('0x8e'),util['inspect'](_0x3d9fd8,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')]['syncMusicOnHoldStart']=function(_0x126848){try{if(this[_0x2df0('0x31')](_0x126848)){if(this['channels'][_0x126848['uniqueid']]){if(!_['isNil'](this[_0x2df0('0x1c')][_0x126848[_0x2df0('0x36')]][_0x2df0('0x79')])){this[_0x2df0('0x1c')][_0x126848[_0x2df0('0x36')]]['mohstarttime']=moment()[_0x2df0('0x42')](_0x2df0('0x3d'));}}}}catch(_0x18f5c3){logger[_0x2df0('0x3a')](_0x2df0('0x8f'),util['inspect'](_0x18f5c3,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x2df0('0x30')]['syncMusicOnHoldStop']=function(_0x594267){try{if(this['isNotNull'](_0x594267)){if(this[_0x2df0('0x1c')][_0x594267[_0x2df0('0x36')]]){if(!_[_0x2df0('0x66')](this[_0x2df0('0x1c')][_0x594267[_0x2df0('0x36')]]['mohstarttime'])){this[_0x2df0('0x1c')][_0x594267[_0x2df0('0x36')]][_0x2df0('0x90')]+=moment()[_0x2df0('0x91')](0x0)[_0x2df0('0x53')](this[_0x2df0('0x1c')][_0x594267[_0x2df0('0x36')]]['mohstarttime'],'seconds');delete this[_0x2df0('0x1c')][_0x594267[_0x2df0('0x36')]]['mohstarttime'];}}}}catch(_0x2e38a4){logger['error'](_0x2df0('0x92'),util[_0x2df0('0x3b')](_0x2e38a4,{'showHidden':![],'depth':null}));}};module[_0x2df0('0x93')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index f42bc2e..67875f1 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 _0xaa88=['inspect','dialstatus','connectedlinenum','connectedlinename','answertime','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','custom:dialconnect','[syncDialEnd][VoiceDialReport]','keys','variable','value','outboundrouteid','variables','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','isUndefined','endtime','duration','diff','seconds','complete','total','answered','holdtime','starttime','billableseconds','sumHoldTime','sumBillable','sumDuration','custom:dialend','voice_outbound:save','[syncHangup][VoiceDialReport]','lodash','moment','util','ioredis','../../../config/logger','ami','../ami','redis','defaults','channels','outboundChannels','outbound','dialbegin','syncDialBegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','emit','uniqueid','merge','format','channel','lastIndexOf','substring','omit','event','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]'];(function(_0x439d59,_0x11ccdf){var _0x3670c7=function(_0x11cfcb){while(--_0x11cfcb){_0x439d59['push'](_0x439d59['shift']());}};_0x3670c7(++_0x11ccdf);}(_0xaa88,0x137));var _0x8aa8=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0xaa88[_0x580576];return _0x3f55a0;};'use strict';var _=require(_0x8aa8('0x0'));var moment=require(_0x8aa8('0x1'));var util=require(_0x8aa8('0x2'));var Redis=require(_0x8aa8('0x3'));var config=require('../../../config/environment');var logger=require(_0x8aa8('0x4'))(_0x8aa8('0x5'));var ami=require(_0x8aa8('0x6'));config[_0x8aa8('0x7')]=_[_0x8aa8('0x8')](config[_0x8aa8('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x8aa8('0x7')]));function VoiceDialReport(_0x5264ff){this[_0x8aa8('0x9')]=_0x5264ff[_0x8aa8('0xa')];this[_0x8aa8('0xb')]=_0x5264ff[_0x8aa8('0xb')];this['variables']={};ami['on'](_0x8aa8('0xc'),this[_0x8aa8('0xd')][_0x8aa8('0xe')](this));ami['on']('dialend',this[_0x8aa8('0xf')][_0x8aa8('0xe')](this));ami['on'](_0x8aa8('0x10'),this[_0x8aa8('0x11')]['bind'](this));ami['on'](_0x8aa8('0x12'),this[_0x8aa8('0x13')]['bind'](this));}VoiceDialReport[_0x8aa8('0x14')][_0x8aa8('0x15')]=function(_0x28132f){return _0x28132f!==null&&!_['isUndefined'](_0x28132f);};VoiceDialReport[_0x8aa8('0x14')][_0x8aa8('0x16')]=function(_0x2fa66f,_0x4b686e,_0x391642){io['to'](_0x2fa66f)['emit'](_0x4b686e,_0x391642);};VoiceDialReport['prototype'][_0x8aa8('0xd')]=function(_0x200662){try{if(this[_0x8aa8('0x15')](_0x200662)){if(this[_0x8aa8('0x9')][_0x200662[_0x8aa8('0x17')]]){_[_0x8aa8('0x18')](this[_0x8aa8('0x9')][_0x200662[_0x8aa8('0x17')]],{'starttime':moment()[_0x8aa8('0x19')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':'called','interface':_0x200662[_0x8aa8('0x1a')]['substring'](0x0,_0x200662['channel'][_0x8aa8('0x1b')]('-')),'membername':_0x200662['channel'][_0x8aa8('0x1c')](_0x200662[_0x8aa8('0x1a')][_0x8aa8('0x1b')]('/')+0x1,_0x200662[_0x8aa8('0x1a')]['lastIndexOf']('-'))},_[_0x8aa8('0x1d')](_0x200662,[_0x8aa8('0x1e'),_0x8aa8('0x1f')]));this[_0x8aa8('0x16')](_0x8aa8('0x20'),_0x8aa8('0x21'),this['channels'][_0x200662[_0x8aa8('0x17')]]);ami['emit'](_0x8aa8('0x22'),this['channels'][_0x200662[_0x8aa8('0x17')]]);}}}catch(_0x557e4e){logger[_0x8aa8('0x23')](_0x8aa8('0x24'),util[_0x8aa8('0x25')](_0x557e4e,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x8aa8('0xf')]=function(_0xe978ab){try{if(this[_0x8aa8('0x15')](_0xe978ab)){if(this['channels'][_0xe978ab['uniqueid']]){this[_0x8aa8('0x9')][_0xe978ab[_0x8aa8('0x17')]][_0x8aa8('0x26')]=_0xe978ab[_0x8aa8('0x26')];if(_0xe978ab[_0x8aa8('0x26')]==='ANSWER'){this[_0x8aa8('0x9')][_0xe978ab['uniqueid']][_0x8aa8('0x27')]=_0xe978ab[_0x8aa8('0x27')];this[_0x8aa8('0x9')][_0xe978ab['uniqueid']]['connectedlinename']=_0xe978ab[_0x8aa8('0x28')];this['channels'][_0xe978ab[_0x8aa8('0x17')]][_0x8aa8('0x29')]=moment()[_0x8aa8('0x19')](_0x8aa8('0x2a'));this[_0x8aa8('0x9')][_0xe978ab['uniqueid']][_0x8aa8('0x2b')]=_0x8aa8('0x2c');ami['emit'](_0x8aa8('0x2d'),this[_0x8aa8('0x9')][_0xe978ab[_0x8aa8('0x17')]]);}this['emit'](_0x8aa8('0x20'),_0x8aa8('0x21'),this[_0x8aa8('0x9')][_0xe978ab[_0x8aa8('0x17')]]);}}}catch(_0x1313f8){logger[_0x8aa8('0x23')](_0x8aa8('0x2e'),util[_0x8aa8('0x25')](_0x1313f8,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x8aa8('0x14')][_0x8aa8('0x11')]=function(_0x3e069a){try{if(this['isNotNull'](_0x3e069a)){this['addVariable'](_0x3e069a[_0x8aa8('0x17')],_[_0x8aa8('0x2f')](_0x3e069a[_0x8aa8('0x30')])[0x0],_0x3e069a[_0x8aa8('0x31')]);if(this[_0x8aa8('0x15')](_0x3e069a[_0x8aa8('0x30')])&&this['isNotNull'](_0x3e069a['variable'][_0x8aa8('0x32')])){if(_['isUndefined'](this[_0x8aa8('0x9')][_0x3e069a[_0x8aa8('0x17')]])){this[_0x8aa8('0x9')][_0x3e069a['uniqueid']]={'routeId':_0x3e069a[_0x8aa8('0x31')],'variables':this[_0x8aa8('0x33')][_0x3e069a[_0x8aa8('0x17')]]};this['emit']('voice:outbound',_0x8aa8('0x21'),this[_0x8aa8('0x9')][_0x3e069a['uniqueid']]);}}}}catch(_0x24eb18){logger[_0x8aa8('0x23')]('[syncVarSet][VoiceDialReport]',util[_0x8aa8('0x25')](_0x24eb18,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['addVariable']=function(_0x2f8f19,_0x5537ff,_0x4161e5){var _0x944927=[_0x8aa8('0x34'),_0x8aa8('0x35'),'rtpaudioqosjitter',_0x8aa8('0x36'),_0x8aa8('0x37'),'rtpaudioqoslossbridged',_0x8aa8('0x38'),_0x8aa8('0x39'),'sipcallid',_0x8aa8('0x3a'),_0x8aa8('0x3b'),_0x8aa8('0x3c'),_0x8aa8('0x3d'),_0x8aa8('0x3e'),_0x8aa8('0x3f'),_0x8aa8('0x40'),_0x8aa8('0x41'),_0x8aa8('0x42'),_0x8aa8('0x43')];if(!_[_0x8aa8('0x44')](_0x5537ff)&&!_[_0x8aa8('0x45')](_0x944927,_0x5537ff)){if(_[_0x8aa8('0x46')](this[_0x8aa8('0x33')][_0x2f8f19])){this[_0x8aa8('0x33')][_0x2f8f19]={};}this[_0x8aa8('0x33')][_0x2f8f19][_0x5537ff]=_0x4161e5;}};VoiceDialReport['prototype'][_0x8aa8('0x13')]=function(_0x5cdba4){try{if(this['isNotNull'](_0x5cdba4)){if(this['channels'][_0x5cdba4[_0x8aa8('0x17')]]){this['channels'][_0x5cdba4['uniqueid']][_0x8aa8('0x47')]=moment()['format'](_0x8aa8('0x2a'));this['channels'][_0x5cdba4['uniqueid']][_0x8aa8('0x48')]=moment(this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]][_0x8aa8('0x47')])[_0x8aa8('0x49')](this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]]['starttime'],_0x8aa8('0x4a'));this['channels'][_0x5cdba4[_0x8aa8('0x17')]][_0x8aa8('0x2b')]=_0x8aa8('0x4b');this[_0x8aa8('0xb')][_0x8aa8('0x4c')]+=0x1;if(this[_0x8aa8('0x9')][_0x5cdba4['uniqueid']]['answertime']){this[_0x8aa8('0xb')][_0x8aa8('0x4d')]+=0x1;this['channels'][_0x5cdba4[_0x8aa8('0x17')]][_0x8aa8('0x4e')]=moment(this[_0x8aa8('0x9')][_0x5cdba4['uniqueid']]['answertime'])['diff'](this['channels'][_0x5cdba4[_0x8aa8('0x17')]][_0x8aa8('0x4f')],'seconds');this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]][_0x8aa8('0x50')]=moment(this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]][_0x8aa8('0x47')])['diff'](this['channels'][_0x5cdba4[_0x8aa8('0x17')]]['answertime'],_0x8aa8('0x4a'));this['outbound'][_0x8aa8('0x51')]+=this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]][_0x8aa8('0x4e')]||0x0;this[_0x8aa8('0xb')][_0x8aa8('0x52')]+=this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]][_0x8aa8('0x50')];}this[_0x8aa8('0xb')][_0x8aa8('0x53')]+=this[_0x8aa8('0x9')][_0x5cdba4['uniqueid']][_0x8aa8('0x48')];ami['emit']('custom:voiceDialReport',this['channels'][_0x5cdba4[_0x8aa8('0x17')]]);ami['emit'](_0x8aa8('0x54'),this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]]);this['emit'](_0x8aa8('0x20'),_0x8aa8('0x55'),this[_0x8aa8('0xb')]);this[_0x8aa8('0x16')]('voice:outbound','voice_outbound_channel:remove',this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]]);delete this[_0x8aa8('0x9')][_0x5cdba4[_0x8aa8('0x17')]];}if(this['variables'][_0x5cdba4['uniqueid']]){delete this[_0x8aa8('0x33')][_0x5cdba4[_0x8aa8('0x17')]];}}}catch(_0x26eb56){logger['error'](_0x8aa8('0x56'),util[_0x8aa8('0x25')](_0x26eb56,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x55e0=['isUndefined','emit','syncDialBegin','channels','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','substring','channel','lastIndexOf','omit','event','privilege','voice:outbound','error','inspect','dialstatus','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','variable','value','outboundrouteid','[syncVarSet][VoiceDialReport]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','syncHangup','endtime','duration','starttime','complete','total','answered','holdtime','seconds','diff','sumBillable','billableseconds','voice_outbound:save','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','moment','util','ioredis','ami','../ami','redis','defaults','localhost','outboundChannels','outbound','variables','dialbegin','bind','dialend','syncDialEnd','varset','hangup','prototype','isNotNull'];(function(_0x1317fd,_0x512537){var _0x3bbb50=function(_0x56a694){while(--_0x56a694){_0x1317fd['push'](_0x1317fd['shift']());}};_0x3bbb50(++_0x512537);}(_0x55e0,0xdc));var _0x055e=function(_0x121f72,_0x299f72){_0x121f72=_0x121f72-0x0;var _0x3ef898=_0x55e0[_0x121f72];return _0x3ef898;};'use strict';var _=require(_0x055e('0x0'));var moment=require(_0x055e('0x1'));var util=require(_0x055e('0x2'));var Redis=require(_0x055e('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x055e('0x4'));var ami=require(_0x055e('0x5'));config[_0x055e('0x6')]=_[_0x055e('0x7')](config[_0x055e('0x6')],{'host':_0x055e('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x4384ff){this['channels']=_0x4384ff[_0x055e('0x9')];this[_0x055e('0xa')]=_0x4384ff[_0x055e('0xa')];this[_0x055e('0xb')]={};ami['on'](_0x055e('0xc'),this['syncDialBegin'][_0x055e('0xd')](this));ami['on'](_0x055e('0xe'),this[_0x055e('0xf')][_0x055e('0xd')](this));ami['on'](_0x055e('0x10'),this['syncVarSet']['bind'](this));ami['on'](_0x055e('0x11'),this['syncHangup'][_0x055e('0xd')](this));}VoiceDialReport[_0x055e('0x12')][_0x055e('0x13')]=function(_0x101bc3){return _0x101bc3!==null&&!_[_0x055e('0x14')](_0x101bc3);};VoiceDialReport[_0x055e('0x12')][_0x055e('0x15')]=function(_0x4bca5d,_0x14064d,_0xb80d83){io['to'](_0x4bca5d)[_0x055e('0x15')](_0x14064d,_0xb80d83);};VoiceDialReport[_0x055e('0x12')][_0x055e('0x16')]=function(_0x56af18){try{if(this[_0x055e('0x13')](_0x56af18)){if(this[_0x055e('0x17')][_0x56af18[_0x055e('0x18')]]){_['merge'](this[_0x055e('0x17')][_0x56af18[_0x055e('0x18')]],{'starttime':moment()[_0x055e('0x19')](_0x055e('0x1a')),'lastevent':_0x055e('0x1b'),'interface':_0x56af18['channel'][_0x055e('0x1c')](0x0,_0x56af18[_0x055e('0x1d')][_0x055e('0x1e')]('-')),'membername':_0x56af18[_0x055e('0x1d')]['substring'](_0x56af18[_0x055e('0x1d')][_0x055e('0x1e')]('/')+0x1,_0x56af18['channel'][_0x055e('0x1e')]('-'))},_[_0x055e('0x1f')](_0x56af18,[_0x055e('0x20'),_0x055e('0x21')]));this[_0x055e('0x15')](_0x055e('0x22'),'voice_outbound_channel:save',this[_0x055e('0x17')][_0x56af18[_0x055e('0x18')]]);ami[_0x055e('0x15')]('custom:dialbegin',this[_0x055e('0x17')][_0x56af18[_0x055e('0x18')]]);}}}catch(_0x32c64e){logger[_0x055e('0x23')]('[syncDialBegin][VoiceDialReport]',util[_0x055e('0x24')](_0x32c64e,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype'][_0x055e('0xf')]=function(_0x42a6aa){try{if(this[_0x055e('0x13')](_0x42a6aa)){if(this[_0x055e('0x17')][_0x42a6aa[_0x055e('0x18')]]){this[_0x055e('0x17')][_0x42a6aa['uniqueid']][_0x055e('0x25')]=_0x42a6aa[_0x055e('0x25')];if(_0x42a6aa[_0x055e('0x25')]==='ANSWER'){this[_0x055e('0x17')][_0x42a6aa[_0x055e('0x18')]][_0x055e('0x26')]=_0x42a6aa[_0x055e('0x26')];this['channels'][_0x42a6aa[_0x055e('0x18')]]['connectedlinename']=_0x42a6aa[_0x055e('0x27')];this[_0x055e('0x17')][_0x42a6aa[_0x055e('0x18')]][_0x055e('0x28')]=moment()[_0x055e('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x055e('0x17')][_0x42a6aa[_0x055e('0x18')]][_0x055e('0x29')]=_0x055e('0x2a');ami[_0x055e('0x15')](_0x055e('0x2b'),this[_0x055e('0x17')][_0x42a6aa[_0x055e('0x18')]]);}this['emit'](_0x055e('0x22'),_0x055e('0x2c'),this['channels'][_0x42a6aa[_0x055e('0x18')]]);}}}catch(_0x1319bd){logger[_0x055e('0x23')](_0x055e('0x2d'),util[_0x055e('0x24')](_0x1319bd,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x055e('0x12')]['syncVarSet']=function(_0x5ddf59){try{if(this[_0x055e('0x13')](_0x5ddf59)){this['addVariable'](_0x5ddf59['uniqueid'],_['keys'](_0x5ddf59[_0x055e('0x2e')])[0x0],_0x5ddf59[_0x055e('0x2f')]);if(this[_0x055e('0x13')](_0x5ddf59[_0x055e('0x2e')])&&this[_0x055e('0x13')](_0x5ddf59[_0x055e('0x2e')][_0x055e('0x30')])){if(_[_0x055e('0x14')](this[_0x055e('0x17')][_0x5ddf59[_0x055e('0x18')]])){this[_0x055e('0x17')][_0x5ddf59[_0x055e('0x18')]]={'routeId':_0x5ddf59['value'],'variables':this['variables'][_0x5ddf59[_0x055e('0x18')]]};this[_0x055e('0x15')](_0x055e('0x22'),_0x055e('0x2c'),this[_0x055e('0x17')][_0x5ddf59[_0x055e('0x18')]]);}}}}catch(_0xb08e29){logger['error'](_0x055e('0x31'),util[_0x055e('0x24')](_0xb08e29,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x055e('0x12')][_0x055e('0x32')]=function(_0x44dbd1,_0x585b8a,_0x1b9945){var _0x3017f4=['rtpaudioqos',_0x055e('0x33'),_0x055e('0x34'),'rtpaudioqosjitterbridged',_0x055e('0x35'),_0x055e('0x36'),'rtpaudioqosrtt',_0x055e('0x37'),_0x055e('0x38'),'sipuri',_0x055e('0x39'),_0x055e('0x3a'),_0x055e('0x3b'),'memberdynamic',_0x055e('0x3c'),_0x055e('0x3d'),'membername',_0x055e('0x3e'),_0x055e('0x3f')];if(!_[_0x055e('0x40')](_0x585b8a)&&!_['includes'](_0x3017f4,_0x585b8a)){if(_[_0x055e('0x14')](this[_0x055e('0xb')][_0x44dbd1])){this[_0x055e('0xb')][_0x44dbd1]={};}this['variables'][_0x44dbd1][_0x585b8a]=_0x1b9945;}};VoiceDialReport['prototype'][_0x055e('0x41')]=function(_0x237318){try{if(this['isNotNull'](_0x237318)){if(this[_0x055e('0x17')][_0x237318['uniqueid']]){this[_0x055e('0x17')][_0x237318['uniqueid']][_0x055e('0x42')]=moment()[_0x055e('0x19')](_0x055e('0x1a'));this['channels'][_0x237318['uniqueid']][_0x055e('0x43')]=moment(this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]][_0x055e('0x42')])['diff'](this['channels'][_0x237318[_0x055e('0x18')]][_0x055e('0x44')],'seconds');this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]][_0x055e('0x29')]=_0x055e('0x45');this[_0x055e('0xa')][_0x055e('0x46')]+=0x1;if(this['channels'][_0x237318[_0x055e('0x18')]][_0x055e('0x28')]){this['outbound'][_0x055e('0x47')]+=0x1;this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]][_0x055e('0x48')]=moment(this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]][_0x055e('0x28')])['diff'](this[_0x055e('0x17')][_0x237318['uniqueid']][_0x055e('0x44')],_0x055e('0x49'));this[_0x055e('0x17')][_0x237318['uniqueid']]['billableseconds']=moment(this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]][_0x055e('0x42')])[_0x055e('0x4a')](this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]][_0x055e('0x28')],_0x055e('0x49'));this[_0x055e('0xa')]['sumHoldTime']+=this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]][_0x055e('0x48')]||0x0;this[_0x055e('0xa')][_0x055e('0x4b')]+=this['channels'][_0x237318[_0x055e('0x18')]][_0x055e('0x4c')];}this[_0x055e('0xa')]['sumDuration']+=this[_0x055e('0x17')][_0x237318['uniqueid']][_0x055e('0x43')];ami[_0x055e('0x15')]('custom:voiceDialReport',this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]]);ami[_0x055e('0x15')]('custom:dialend',this['channels'][_0x237318[_0x055e('0x18')]]);this[_0x055e('0x15')](_0x055e('0x22'),_0x055e('0x4d'),this[_0x055e('0xa')]);this[_0x055e('0x15')](_0x055e('0x22'),_0x055e('0x4e'),this[_0x055e('0x17')][_0x237318[_0x055e('0x18')]]);delete this['channels'][_0x237318[_0x055e('0x18')]];}if(this[_0x055e('0xb')][_0x237318[_0x055e('0x18')]]){delete this[_0x055e('0xb')][_0x237318['uniqueid']];}}}catch(_0x3dc39c){logger[_0x055e('0x23')](_0x055e('0x4f'),util[_0x055e('0x24')](_0x3dc39c,{'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 c96e7e4..73e45ab 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 _0xb787=['loopQueueShow','clearZombieChannels','Action','queues','isNotNull','queue','countBy','callers','loggedIn','toNumber','loggedin','available','[syncQueueSummary][VoiceQueueReport]','uniqueid','queuecallerjoinAt','position','count','pick','keys','last','queuecallercompleteAt','holdtime','originalposition','queuecallerabandonAt','YYYY-MM-DD\x20HH:mm:ss','ABANDONED','connectedlinenum','connectedlinename','[syncQueueCallerLeave][VoiceQueueReport]','queuecallercomplete','[syncAgentConnect][VoiceQueueReport]','lastAssignedTo','queuecallerexit','queuecallerexitAt','transfer','queuecallerexitreason','COMPLETED','startsWith','toLowerCase','local/','linkedid','add','seconds','transferexten','destexten','transferuniqueid','COMPLETEDBY','reason','toUpperCase','[syncAgentComplete][VoiceQueueReport]','addVariable','variable','value','CONTINUE','queuecallerleaveAt','queueposition','[syncVarSet][VoiceQueueReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','includes','length','diff','total','milliseconds','unmanaged','custom:queuecallerunmanaged','abandoned','custom:queuecallerabandon','syncAttendedTransfer','transfereeuniqueid','secondtransfererexten','secondtransfereruniqueid','ATTENDEDTRANSFER','transfertype','ATTENDED','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','transfererchannel','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','bluebird','md5','ioredis','../../../config/logger','ami','../ami','../model/queueReport','redis','defaults','socket.io-emitter','prototype','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','queuesummary','syncQueueSummary','bind','queuesummarycomplete','syncQueueCallerJoin','queuecallerabandon','syncQueueCallerAbandon','queuecallerleave','syncQueueCallerLeave','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup','syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncBlindTransfer','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','switch','isNil','status','channel','catch','message','[voiceQueueReport][checkChannel]','error','variables','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','inspect','emit','emitVoiceQueueChannelSave','format','voice:queue:%s','name','emitVoiceQueueChannelRemove','voice_queue_channel:remove','emitVoiceQueueSummary','type','inbound','sumBillable','sumDuration','sumHoldTime','Trunk','Interval','voice_queue:save','isUndefined'];(function(_0x1da1a2,_0x34004a){var _0x2185ef=function(_0x46c91e){while(--_0x46c91e){_0x1da1a2['push'](_0x1da1a2['shift']());}};_0x2185ef(++_0x34004a);}(_0xb787,0x1d6));var _0x7b78=function(_0x2fa5fd,_0xeda062){_0x2fa5fd=_0x2fa5fd-0x0;var _0x33a79b=_0xb787[_0x2fa5fd];return _0x33a79b;};'use strict';var _=require(_0x7b78('0x0'));var moment=require('moment');var BPromise=require(_0x7b78('0x1'));var util=require('util');var md5=require(_0x7b78('0x2'));var Redis=require(_0x7b78('0x3'));var config=require('../../../config/environment');var logger=require(_0x7b78('0x4'))(_0x7b78('0x5'));var ami=require(_0x7b78('0x6'));var QueueReport=require(_0x7b78('0x7'));config[_0x7b78('0x8')]=_[_0x7b78('0x9')](config[_0x7b78('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x7b78('0xa'))(new Redis(config[_0x7b78('0x8')]));var Sequence=function(){};Sequence[_0x7b78('0xb')][_0x7b78('0xc')]=function(_0x48db4b){this[_0x7b78('0xd')]=this[_0x7b78('0xd')]?this[_0x7b78('0xd')][_0x7b78('0xe')](_0x48db4b):_0x48db4b();};function VoiceQueueReport(_0x28c2df){this[_0x7b78('0xf')]=new Sequence();this[_0x7b78('0x10')]={};this[_0x7b78('0x11')]=_0x28c2df[_0x7b78('0x11')];this[_0x7b78('0x12')]=_0x28c2df[_0x7b78('0x13')];this[_0x7b78('0x14')]=_0x28c2df[_0x7b78('0x14')];this[_0x7b78('0x15')]=!![];this[_0x7b78('0x16')]=_0x28c2df['campaigns'];this['variables']={};ami['on'](_0x7b78('0x17'),this[_0x7b78('0x18')][_0x7b78('0x19')](this));ami['on'](_0x7b78('0x1a'),this['syncQueueSummaryComplete'][_0x7b78('0x19')](this));ami['on']('queuecallerjoin',this[_0x7b78('0x1b')][_0x7b78('0x19')](this));ami['on'](_0x7b78('0x1c'),this[_0x7b78('0x1d')][_0x7b78('0x19')](this));ami['on'](_0x7b78('0x1e'),this[_0x7b78('0x1f')]['bind'](this));ami['on']('agentcomplete',this[_0x7b78('0x20')][_0x7b78('0x19')](this));ami['on'](_0x7b78('0x21'),this[_0x7b78('0x22')][_0x7b78('0x19')](this));ami['on'](_0x7b78('0x23'),this[_0x7b78('0x24')][_0x7b78('0x19')](this));ami['on'](_0x7b78('0x25'),this[_0x7b78('0x26')]['bind'](this));ami['on'](_0x7b78('0x27'),this[_0x7b78('0x28')][_0x7b78('0x19')](this));ami['on'](_0x7b78('0x29'),this[_0x7b78('0x2a')]['bind'](this));ami['on']('musiconholdstop',this[_0x7b78('0x2b')]['bind'](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7b78('0x19')](this));ami['on']('blindtransfer',this[_0x7b78('0x2c')]['bind'](this));this['loopQueueSummary']();this['loopQueueShow']();}function isNotNull(_0x168359){return _0x168359!==null&&!_['isUndefined'](_0x168359);}function clearChannels(_0xd50046){if(!_[_0x7b78('0x2d')](_0xd50046)){for(var _0x3a80d3 in _0xd50046){if(_0xd50046[_0x7b78('0x2e')](_0x3a80d3)){delete _0xd50046[_0x3a80d3];}}}}function clearCampaigns(_0x5dac31){if(!_[_0x7b78('0x2d')](_0x5dac31)){for(var _0x1ed3ba in _0x5dac31){if(_0x5dac31[_0x7b78('0x2e')](_0x1ed3ba)){_0x5dac31[_0x1ed3ba][_0x7b78('0x2f')]=0x0;}}}}function clearVoiceQueues(_0x2fcf54){if(!_[_0x7b78('0x2d')](_0x2fcf54)){for(var _0x10ec28 in _0x2fcf54){if(_0x2fcf54[_0x7b78('0x2e')](_0x10ec28)){_0x2fcf54[_0x10ec28][_0x7b78('0x2f')]=0x0;_0x2fcf54[_0x10ec28][_0x7b78('0x30')]=0x0;_0x2fcf54[_0x10ec28][_0x7b78('0x31')]=0x0;_0x2fcf54[_0x10ec28][_0x7b78('0x32')]=0x0;_0x2fcf54[_0x10ec28][_0x7b78('0x33')]=!![];}}}}function clearAgentBooked(_0x59aab1){if(!_[_0x7b78('0x2d')](_0x59aab1)){for(var _0x405b14 in _0x59aab1){if(_0x59aab1[_0x7b78('0x2e')](_0x405b14)){_0x59aab1[_0x405b14]['unlockRR']=!![];}}}}VoiceQueueReport[_0x7b78('0xb')]['clearZombieChannels']=function(){var _0x46dd02=this;for(var _0x2d3418 in this['channels']){if(this[_0x7b78('0x12')][_0x7b78('0x2e')](_0x2d3418)&&!this['channels'][_0x2d3418][_0x7b78('0x34')]){this[_0x7b78('0xf')][_0x7b78('0xc')](function(){if(!_[_0x7b78('0x35')](_0x46dd02[_0x7b78('0x12')][_0x2d3418])){return ami['Action']({'action':_0x7b78('0x36'),'channel':_0x46dd02[_0x7b78('0x12')][_0x2d3418][_0x7b78('0x37')]})[_0x7b78('0x38')](function(_0x1d9841){if(_0x1d9841[_0x7b78('0x39')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x46dd02[_0x7b78('0x12')][_0x2d3418]){delete _0x46dd02[_0x7b78('0x12')][_0x2d3418];logger['error'](_0x7b78('0x3a'),_0x2d3418);}if(_0x46dd02[_0x7b78('0x10')][_0x2d3418]){delete _0x46dd02['queueReports'][_0x2d3418];logger[_0x7b78('0x3b')]('[voiceQueueReport][checkQueueReport]',_0x2d3418);}if(_0x46dd02[_0x7b78('0x3c')][_0x2d3418]){delete _0x46dd02[_0x7b78('0x3c')][_0x2d3418];logger[_0x7b78('0x3b')](_0x7b78('0x3d'),_0x2d3418);}},0x1f40);}});}});}}};VoiceQueueReport[_0x7b78('0xb')][_0x7b78('0x28')]=function(){logger[_0x7b78('0x3b')](_0x7b78('0x3e'));clearChannels(this[_0x7b78('0x12')]);this['clearQueueReport'](this[_0x7b78('0x10')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0x7b78('0x16')]);};VoiceQueueReport['prototype'][_0x7b78('0x3f')]=function(_0x1599ca){var _0x5e80c6=this;if(!_[_0x7b78('0x2d')](_0x1599ca)){for(var _0xc18d06 in _0x1599ca){if(_0x1599ca[_0x7b78('0x2e')](_0xc18d06)){_0x5e80c6['emitVoiceQueueChannelRemove'](_0x1599ca[_0xc18d06]);delete _0x1599ca[_0xc18d06];}}}};function loggerCatch(_0x3500a8){return function(_0x1956ef){logger[_0x7b78('0x3b')](_0x3500a8,util[_0x7b78('0x40')](_0x1956ef,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0x7b78('0xb')][_0x7b78('0x41')]=function(_0x4fe2d0,_0x35869f,_0x1ace7c){io['to'](_0x4fe2d0)[_0x7b78('0x41')](_0x35869f,_0x1ace7c);};VoiceQueueReport['prototype'][_0x7b78('0x42')]=function(_0x3025a7){this[_0x7b78('0x41')](util[_0x7b78('0x43')](_0x7b78('0x44'),_0x3025a7[_0x7b78('0x45')]),'voice_queue_channel:save',_0x3025a7);};VoiceQueueReport[_0x7b78('0xb')][_0x7b78('0x46')]=function(_0x2bbd4a){this[_0x7b78('0x41')](util[_0x7b78('0x43')](_0x7b78('0x44'),_0x2bbd4a[_0x7b78('0x45')]),_0x7b78('0x47'),_0x2bbd4a);};VoiceQueueReport[_0x7b78('0xb')][_0x7b78('0x48')]=function(_0x5654a4){if(_0x5654a4[_0x7b78('0x49')]===_0x7b78('0x4a')){var _0x529594={'id':_0x5654a4['id'],'name':_0x5654a4['name'],'strategy':_0x5654a4['strategy'],'answered':_0x5654a4['answered'],'available':_0x5654a4['available'],'loggedIn':_0x5654a4['loggedIn'],'pTalking':_0x5654a4[_0x7b78('0x31')],'sumBillable':_0x5654a4[_0x7b78('0x4b')],'sumDuration':_0x5654a4[_0x7b78('0x4c')],'sumHoldTime':_0x5654a4[_0x7b78('0x4d')]||0x0,'talking':_0x5654a4['talking'],'total':_0x5654a4['total'],'type':_0x5654a4[_0x7b78('0x49')],'unmanaged':_0x5654a4['unmanaged'],'abandoned':_0x5654a4['abandoned'],'waiting':_0x5654a4[_0x7b78('0x32')]};if(_0x5654a4['Trunk']){_0x529594[_0x7b78('0x4e')]={'id':_0x5654a4[_0x7b78('0x4e')]['id'],'name':_0x5654a4[_0x7b78('0x4e')][_0x7b78('0x45')],'active':_0x5654a4[_0x7b78('0x4e')]['active'],'callerid':_0x5654a4[_0x7b78('0x4e')]['callerid']};}if(_0x5654a4[_0x7b78('0x4f')]){_0x529594['Interval']={'id':_0x5654a4[_0x7b78('0x4f')]['id'],'name':_0x5654a4[_0x7b78('0x4f')]['name']};}var _0x594075=md5(JSON['stringify'](_0x529594));if(_0x5654a4[_0x7b78('0x2')]!==_0x594075){_0x5654a4[_0x7b78('0x2')]=_0x594075;this['emit'](util['format'](_0x7b78('0x44'),_0x529594[_0x7b78('0x45')]),_0x7b78('0x50'),_0x529594);}}};VoiceQueueReport[_0x7b78('0xb')]['isNotNull']=function(_0x5209eb){return _0x5209eb!==null&&!_[_0x7b78('0x51')](_0x5209eb);};VoiceQueueReport[_0x7b78('0xb')][_0x7b78('0x52')]=function(){var _0x260e52=this;setInterval(function(){_0x260e52[_0x7b78('0x53')]();ami[_0x7b78('0x54')]({'action':_0x7b78('0x55')})[_0x7b78('0x38')](loggerCatch('[queues]'));},0x2710);};VoiceQueueReport[_0x7b78('0xb')]['loopQueueSummary']=function(){var _0x341cea=this;setInterval(function(){if(_0x341cea[_0x7b78('0x15')]){return ami[_0x7b78('0x54')]({'action':'queuesummary'})['then'](function(_0xbc38ca){_0x341cea['flagQueueSummary']=![];})[_0x7b78('0x38')](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport['prototype'][_0x7b78('0x18')]=function(_0x2d4563){try{if(this[_0x7b78('0x56')](_0x2d4563)&&this['isNotNull'](_0x2d4563[_0x7b78('0x57')])){if(this[_0x7b78('0x14')][_0x2d4563['queue']]){var _0x312210=_[_0x7b78('0x58')](this[_0x7b78('0x12')],_0x7b78('0x57'))[_0x2d4563['queue']]||0x0;var _0x4b6394=_0x312210-_0x2d4563[_0x7b78('0x59')];if(this[_0x7b78('0x14')][_0x2d4563['queue']][_0x7b78('0x32')]!==_['toNumber'](_0x2d4563[_0x7b78('0x59')])||this['voiceQueues'][_0x2d4563[_0x7b78('0x57')]][_0x7b78('0x5a')]!==_[_0x7b78('0x5b')](_0x2d4563[_0x7b78('0x5c')])||this[_0x7b78('0x14')][_0x2d4563['queue']][_0x7b78('0x5d')]!==_[_0x7b78('0x5b')](_0x2d4563[_0x7b78('0x5d')])||this[_0x7b78('0x14')][_0x2d4563['queue']]['talking']!==_0x4b6394){this[_0x7b78('0x14')][_0x2d4563[_0x7b78('0x57')]]['waiting']=_[_0x7b78('0x5b')](_0x2d4563[_0x7b78('0x59')]);this['voiceQueues'][_0x2d4563[_0x7b78('0x57')]][_0x7b78('0x5a')]=_['toNumber'](_0x2d4563[_0x7b78('0x5c')]);this[_0x7b78('0x14')][_0x2d4563[_0x7b78('0x57')]]['available']=_[_0x7b78('0x5b')](_0x2d4563[_0x7b78('0x5d')]);this['voiceQueues'][_0x2d4563[_0x7b78('0x57')]]['talking']=_0x4b6394>0x0?_0x4b6394:0x0;this[_0x7b78('0x14')][_0x2d4563[_0x7b78('0x57')]][_0x7b78('0x30')]=this[_0x7b78('0x14')][_0x2d4563['queue']][_0x7b78('0x30')]>_['toNumber'](_0x2d4563[_0x7b78('0x5c')])?_['toNumber'](_0x2d4563[_0x7b78('0x5c')]):this[_0x7b78('0x14')][_0x2d4563[_0x7b78('0x57')]]['talking'];this[_0x7b78('0x48')](this['voiceQueues'][_0x2d4563[_0x7b78('0x57')]]);}ami[_0x7b78('0x41')]('custom:queuesummary',this[_0x7b78('0x14')][_0x2d4563[_0x7b78('0x57')]]);}}}catch(_0xc522d5){logger[_0x7b78('0x3b')](_0x7b78('0x5e'),util['inspect'](_0xc522d5,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b78('0xb')]['syncQueueSummaryComplete']=function(_0xd80b0c){this['flagQueueSummary']=!![];};VoiceQueueReport[_0x7b78('0xb')]['syncNewExten']=function(_0x3648a4){};VoiceQueueReport['prototype'][_0x7b78('0x1b')]=function(_0x5b1a78){try{if(this[_0x7b78('0x56')](_0x5b1a78)){if(_[_0x7b78('0x51')](this[_0x7b78('0x10')][_0x5b1a78[_0x7b78('0x5f')]])){this['queueReports'][_0x5b1a78[_0x7b78('0x5f')]]=[];this['channels'][_0x5b1a78[_0x7b78('0x5f')]]={};}var _0x505f93=new QueueReport();_0x505f93[_0x7b78('0x45')]=_0x5b1a78[_0x7b78('0x57')];_0x505f93[_0x7b78('0x49')]=this[_0x7b78('0x14')][_0x505f93[_0x7b78('0x45')]]&&this[_0x7b78('0x14')][_0x505f93[_0x7b78('0x45')]][_0x7b78('0x49')]?this[_0x7b78('0x14')][_0x505f93[_0x7b78('0x45')]][_0x7b78('0x49')]||_0x7b78('0x4a'):_0x7b78('0x4a');_0x505f93['queue']=_0x5b1a78[_0x7b78('0x57')];_0x505f93[_0x7b78('0x60')]=moment()[_0x7b78('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x505f93[_0x7b78('0x61')]=_0x5b1a78['position'];_0x505f93[_0x7b78('0x62')]=_0x5b1a78['count'];_['merge'](_0x505f93,_[_0x7b78('0x63')](_0x5b1a78,_[_0x7b78('0x64')](_0x505f93)));this['queueReports'][_0x5b1a78[_0x7b78('0x5f')]]['push'](_0x505f93);this[_0x7b78('0x12')][_0x5b1a78[_0x7b78('0x5f')]]=_0x505f93;this[_0x7b78('0x42')](_0x505f93);}}catch(_0x1c49eb){logger[_0x7b78('0x3b')]('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x7b78('0x40')](_0x1c49eb,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b78('0xb')]['syncQueueCallerAbandon']=function(_0x31d467){try{if(this['isNotNull'](_0x31d467)){if(this[_0x7b78('0x10')][_0x31d467['uniqueid']]){var _0x2f8d52=_[_0x7b78('0x65')](this[_0x7b78('0x10')][_0x31d467[_0x7b78('0x5f')]]);_0x2f8d52['queuecallercomplete']=![];_0x2f8d52[_0x7b78('0x66')]=null;_0x2f8d52[_0x7b78('0x67')]=_0x31d467['holdtime'];_0x2f8d52[_0x7b78('0x68')]=_0x31d467[_0x7b78('0x68')];_0x2f8d52[_0x7b78('0x1c')]=!![];_0x2f8d52[_0x7b78('0x69')]=moment()[_0x7b78('0x43')](_0x7b78('0x6a'));_0x2f8d52['queuecallerexitreason']=_0x7b78('0x6b');_0x2f8d52['lastAssignedTo']=null;this['channels'][_0x31d467[_0x7b78('0x5f')]]=_0x2f8d52;this['emitVoiceQueueChannelRemove'](_0x2f8d52);}}}catch(_0x1f111d){logger[_0x7b78('0x3b')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x7b78('0x40')](_0x1f111d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b78('0xb')][_0x7b78('0x1f')]=function(_0x26ba19){try{if(this[_0x7b78('0x56')](_0x26ba19)){if(this[_0x7b78('0x10')][_0x26ba19[_0x7b78('0x5f')]]){var _0x3eee7d=_[_0x7b78('0x65')](this[_0x7b78('0x10')][_0x26ba19['uniqueid']]);_0x3eee7d['queuecallerleaveAt']=moment()[_0x7b78('0x43')](_0x7b78('0x6a'));_0x3eee7d[_0x7b78('0x6c')]=_0x26ba19[_0x7b78('0x6c')];_0x3eee7d[_0x7b78('0x6d')]=_0x26ba19[_0x7b78('0x6d')];this[_0x7b78('0x12')][_0x26ba19['uniqueid']]=_0x3eee7d;this[_0x7b78('0x42')](_0x3eee7d);}}}catch(_0x225b02){logger[_0x7b78('0x3b')](_0x7b78('0x6e'),util['inspect'](_0x225b02,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b78('0xb')]['syncAgentConnect']=function(_0x12e3c2){try{if(this[_0x7b78('0x56')](_0x12e3c2)){if(this[_0x7b78('0x10')][_0x12e3c2[_0x7b78('0x5f')]]){var _0x400ea8=_['last'](this[_0x7b78('0x10')][_0x12e3c2[_0x7b78('0x5f')]]);_0x400ea8[_0x7b78('0x6f')]=!![];_0x400ea8['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x2f2916){logger[_0x7b78('0x3b')](_0x7b78('0x70'),util[_0x7b78('0x40')](_0x2f2916,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b78('0xb')][_0x7b78('0x20')]=function(_0x382fe1){try{if(this[_0x7b78('0x56')](_0x382fe1)){if(this[_0x7b78('0x10')][_0x382fe1[_0x7b78('0x5f')]]){var _0x5c62ac=_[_0x7b78('0x65')](this[_0x7b78('0x10')][_0x382fe1['uniqueid']]);_0x5c62ac[_0x7b78('0x1c')]=![];_0x5c62ac[_0x7b78('0x69')]=null;_0x5c62ac['assigned']=!![];_0x5c62ac[_0x7b78('0x71')]=_0x382fe1['membername'];_0x5c62ac[_0x7b78('0x67')]=_0x382fe1[_0x7b78('0x67')];_0x5c62ac[_0x7b78('0x6f')]=!![];_0x5c62ac[_0x7b78('0x72')]=![];_0x5c62ac[_0x7b78('0x73')]=null;if(!_0x5c62ac[_0x7b78('0x74')]){if(_0x382fe1['reason']==_0x7b78('0x74')){_0x5c62ac[_0x7b78('0x75')]=_0x7b78('0x76');}else{if(_[_0x7b78('0x77')](_0x382fe1['channel'][_0x7b78('0x78')](),_0x7b78('0x79'))){if(this[_0x7b78('0x10')][_0x382fe1[_0x7b78('0x7a')]]){var _0x5247a1=_[_0x7b78('0x65')](this['queueReports'][_0x382fe1['linkedid']]);_0x5247a1[_0x7b78('0x6f')]=![];_0x5247a1[_0x7b78('0x72')]=!![];_0x5247a1[_0x7b78('0x73')]=moment(_0x5c62ac[_0x7b78('0x60')])[_0x7b78('0x7b')](_0x382fe1[_0x7b78('0x67')],_0x7b78('0x7c'))[_0x7b78('0x43')]('YYYY-MM-DD\x20HH:mm:ss');_0x5247a1['queuecallerexitreason']='FORWARDTRANSFER';_0x5247a1['transfer']=!![];_0x5247a1['transfertype']='FORWARD';_0x5247a1[_0x7b78('0x7d')]=_0x382fe1[_0x7b78('0x7e')];_0x5247a1[_0x7b78('0x7f')]=_0x382fe1[_0x7b78('0x5f')];var _0xfba1cf=this[_0x7b78('0x10')][_0x382fe1[_0x7b78('0x7a')]];this[_0x7b78('0x10')][_0x382fe1['linkedid']]=this['queueReports'][_0x382fe1[_0x7b78('0x5f')]];this[_0x7b78('0x10')][_0x382fe1['uniqueid']]=_0xfba1cf;}}else{_0x5c62ac[_0x7b78('0x75')]=_0x7b78('0x80')+_0x382fe1[_0x7b78('0x81')][_0x7b78('0x82')]();}}}this[_0x7b78('0x12')][_0x382fe1['uniqueid']]=_0x5c62ac;this[_0x7b78('0x46')](_0x5c62ac);}}}catch(_0x1d83f7){logger[_0x7b78('0x3b')](_0x7b78('0x83'),util['inspect'](_0x1d83f7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b78('0xb')][_0x7b78('0x24')]=function(_0x286fd8){try{if(this[_0x7b78('0x56')](_0x286fd8)){this[_0x7b78('0x84')](_0x286fd8[_0x7b78('0x5f')],_[_0x7b78('0x64')](_0x286fd8[_0x7b78('0x85')])[0x0],_0x286fd8[_0x7b78('0x86')]);if(this[_0x7b78('0x10')][_0x286fd8[_0x7b78('0x5f')]]){var _0x29815f=_[_0x7b78('0x65')](this[_0x7b78('0x10')][_0x286fd8[_0x7b78('0x5f')]]);if(_0x29815f){if(this[_0x7b78('0x56')](_0x286fd8[_0x7b78('0x85')])&&this[_0x7b78('0x56')](_0x286fd8[_0x7b78('0x85')]['queuestatus'])){switch(_0x286fd8['value']){case _0x7b78('0x87'):_0x29815f[_0x7b78('0x72')]=![];_0x29815f[_0x7b78('0x73')]=null;break;default:_0x29815f['queuecallerexit']=!![];_0x29815f[_0x7b78('0x73')]=moment()[_0x7b78('0x43')](_0x7b78('0x6a'));_0x29815f[_0x7b78('0x88')]=moment()[_0x7b78('0x43')](_0x7b78('0x6a'));}_0x29815f[_0x7b78('0x1c')]=![];_0x29815f[_0x7b78('0x69')]=null;_0x29815f[_0x7b78('0x75')]=_0x286fd8[_0x7b78('0x86')];this[_0x7b78('0x12')][_0x286fd8['uniqueid']]=_0x29815f;this[_0x7b78('0x46')](_0x29815f);}else if(this[_0x7b78('0x56')](_0x286fd8['variable'])&&this['isNotNull'](_0x286fd8[_0x7b78('0x85')][_0x7b78('0x89')])){if(!_0x29815f['queuecallerabandon']){_0x29815f[_0x7b78('0x72')]=!![];_0x29815f[_0x7b78('0x73')]=moment()[_0x7b78('0x43')](_0x7b78('0x6a'));_0x29815f[_0x7b78('0x75')]='EXITWITHKEY';_0x29815f[_0x7b78('0x88')]=moment()[_0x7b78('0x43')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x7b78('0x12')][_0x286fd8[_0x7b78('0x5f')]]=_0x29815f;}}_0x29815f['variables']=this[_0x7b78('0x3c')][_0x286fd8[_0x7b78('0x5f')]];}}}}catch(_0x3fdbfd){logger[_0x7b78('0x3b')](_0x7b78('0x8a'),util[_0x7b78('0x40')](_0x3fdbfd,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x7b78('0xb')]['addVariable']=function(_0x511991,_0x4fbe85,_0x419ea9){var _0x57b361=[_0x7b78('0x8b'),_0x7b78('0x8c'),'rtpaudioqosjitter',_0x7b78('0x8d'),_0x7b78('0x8e'),_0x7b78('0x8f'),_0x7b78('0x90'),'rtpaudioqosrttbridged',_0x7b78('0x91'),_0x7b78('0x92'),_0x7b78('0x93'),_0x7b78('0x94'),'membercalls',_0x7b78('0x95'),_0x7b78('0x96'),_0x7b78('0x97'),_0x7b78('0x98'),_0x7b78('0x99'),'memberrealtime'];if(!_[_0x7b78('0x35')](_0x4fbe85)&&!_[_0x7b78('0x9a')](_0x57b361,_0x4fbe85)){if(_[_0x7b78('0x51')](this[_0x7b78('0x3c')][_0x511991])){this[_0x7b78('0x3c')][_0x511991]={};}this[_0x7b78('0x3c')][_0x511991][_0x4fbe85]=_0x419ea9;}};VoiceQueueReport['prototype']['syncHangup']=function(_0x4ccf91){try{if(this[_0x7b78('0x56')](_0x4ccf91)){if(this['queueReports'][_0x4ccf91['uniqueid']]){for(var _0x4f9ec7=0x0,_0x51aec0={};_0x4f9ec70x0?_0x196d34:0x0;this[_0x1175('0x15')][_0x2f532e[_0x1175('0x66')]]['talking']=this[_0x1175('0x15')][_0x2f532e[_0x1175('0x66')]][_0x1175('0x38')]>_['toNumber'](_0x2f532e[_0x1175('0x69')])?_[_0x1175('0x68')](_0x2f532e['loggedin']):this[_0x1175('0x15')][_0x2f532e[_0x1175('0x66')]][_0x1175('0x38')];this['emitVoiceQueueSummary'](this[_0x1175('0x15')][_0x2f532e[_0x1175('0x66')]]);}ami[_0x1175('0x4b')](_0x1175('0x6a'),this[_0x1175('0x15')][_0x2f532e[_0x1175('0x66')]]);}}}catch(_0x41a140){logger['error'](_0x1175('0x6b'),util[_0x1175('0x4a')](_0x41a140,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1175('0x1b')]=function(_0x5bc817){this[_0x1175('0x16')]=!![];};VoiceQueueReport[_0x1175('0xd')][_0x1175('0x6c')]=function(_0x53053e){};VoiceQueueReport['prototype'][_0x1175('0x1e')]=function(_0x5012e0){try{if(this['isNotNull'](_0x5012e0)){if(_[_0x1175('0x62')](this[_0x1175('0x11')][_0x5012e0[_0x1175('0x6d')]])){this[_0x1175('0x11')][_0x5012e0[_0x1175('0x6d')]]=[];this[_0x1175('0x13')][_0x5012e0[_0x1175('0x6d')]]={};}var _0x4bbf80=new QueueReport();_0x4bbf80[_0x1175('0x4f')]=_0x5012e0['queue'];_0x4bbf80[_0x1175('0x51')]=this[_0x1175('0x15')][_0x4bbf80[_0x1175('0x4f')]]&&this['voiceQueues'][_0x4bbf80[_0x1175('0x4f')]][_0x1175('0x51')]?this[_0x1175('0x15')][_0x4bbf80[_0x1175('0x4f')]]['type']||_0x1175('0x6e'):_0x1175('0x6e');_0x4bbf80[_0x1175('0x66')]=_0x5012e0[_0x1175('0x66')];_0x4bbf80[_0x1175('0x6f')]=moment()[_0x1175('0x4d')]('YYYY-MM-DD\x20HH:mm:ss');_0x4bbf80[_0x1175('0x70')]=_0x5012e0['position'];_0x4bbf80[_0x1175('0x71')]=_0x5012e0[_0x1175('0x71')];_[_0x1175('0x72')](_0x4bbf80,_[_0x1175('0x73')](_0x5012e0,_[_0x1175('0x74')](_0x4bbf80)));this[_0x1175('0x11')][_0x5012e0[_0x1175('0x6d')]]['push'](_0x4bbf80);this[_0x1175('0x13')][_0x5012e0[_0x1175('0x6d')]]=_0x4bbf80;this[_0x1175('0x4c')](_0x4bbf80);}}catch(_0x1f3f81){logger['error'](_0x1175('0x75'),util['inspect'](_0x1f3f81,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1175('0xd')]['syncQueueCallerAbandon']=function(_0xb1605f){try{if(this[_0x1175('0x61')](_0xb1605f)){if(this[_0x1175('0x11')][_0xb1605f[_0x1175('0x6d')]]){var _0xd2cd5b=_[_0x1175('0x76')](this[_0x1175('0x11')][_0xb1605f[_0x1175('0x6d')]]);_0xd2cd5b[_0x1175('0x77')]=![];_0xd2cd5b[_0x1175('0x78')]=null;_0xd2cd5b['holdtime']=_0xb1605f[_0x1175('0x79')];_0xd2cd5b[_0x1175('0x7a')]=_0xb1605f[_0x1175('0x7a')];_0xd2cd5b['queuecallerabandon']=!![];_0xd2cd5b['queuecallerabandonAt']=moment()[_0x1175('0x4d')](_0x1175('0x7b'));_0xd2cd5b[_0x1175('0x7c')]=_0x1175('0x7d');_0xd2cd5b['lastAssignedTo']=null;this[_0x1175('0x13')][_0xb1605f[_0x1175('0x6d')]]=_0xd2cd5b;this[_0x1175('0x49')](_0xd2cd5b);}}}catch(_0x45d1cf){logger[_0x1175('0x44')]('[syncQueueCallerAbandon][VoiceQueueReport]',util[_0x1175('0x4a')](_0x45d1cf,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1175('0xd')][_0x1175('0x22')]=function(_0x4cd061){try{if(this[_0x1175('0x61')](_0x4cd061)){if(this[_0x1175('0x11')][_0x4cd061[_0x1175('0x6d')]]){var _0x59b39f=_[_0x1175('0x76')](this[_0x1175('0x11')][_0x4cd061[_0x1175('0x6d')]]);_0x59b39f[_0x1175('0x7e')]=moment()[_0x1175('0x4d')](_0x1175('0x7b'));_0x59b39f['connectedlinenum']=_0x4cd061[_0x1175('0x7f')];_0x59b39f[_0x1175('0x80')]=_0x4cd061[_0x1175('0x80')];this['channels'][_0x4cd061['uniqueid']]=_0x59b39f;this[_0x1175('0x4c')](_0x59b39f);}}}catch(_0x2aede7){logger[_0x1175('0x44')](_0x1175('0x81'),util['inspect'](_0x2aede7,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x1175('0x25')]=function(_0x35f86b){try{if(this[_0x1175('0x61')](_0x35f86b)){if(this[_0x1175('0x11')][_0x35f86b[_0x1175('0x6d')]]){var _0x5c3a15=_[_0x1175('0x76')](this[_0x1175('0x11')][_0x35f86b[_0x1175('0x6d')]]);_0x5c3a15[_0x1175('0x77')]=!![];_0x5c3a15[_0x1175('0x7c')]='COMPLETEDBYAGENT';}}}catch(_0x3b602c){logger[_0x1175('0x44')](_0x1175('0x82'),util[_0x1175('0x4a')](_0x3b602c,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1175('0xd')][_0x1175('0x83')]=function(_0xe3579b){try{if(this['isNotNull'](_0xe3579b)){if(this[_0x1175('0x11')][_0xe3579b[_0x1175('0x6d')]]){var _0x4045cc=_['last'](this[_0x1175('0x11')][_0xe3579b[_0x1175('0x6d')]]);_0x4045cc[_0x1175('0x1f')]=![];_0x4045cc[_0x1175('0x84')]=null;_0x4045cc[_0x1175('0x85')]=!![];_0x4045cc['lastAssignedTo']=_0xe3579b[_0x1175('0x86')];_0x4045cc[_0x1175('0x79')]=_0xe3579b[_0x1175('0x79')];_0x4045cc[_0x1175('0x77')]=!![];_0x4045cc[_0x1175('0x87')]=![];_0x4045cc[_0x1175('0x88')]=null;if(!_0x4045cc['transfer']){if(_0xe3579b[_0x1175('0x89')]=='transfer'){_0x4045cc[_0x1175('0x7c')]='COMPLETED';}else{if(_[_0x1175('0x8a')](_0xe3579b[_0x1175('0x41')]['toLowerCase'](),'local/')){if(this[_0x1175('0x11')][_0xe3579b[_0x1175('0x8b')]]){var _0xa27002=_[_0x1175('0x76')](this[_0x1175('0x11')][_0xe3579b['linkedid']]);_0xa27002[_0x1175('0x77')]=![];_0xa27002[_0x1175('0x87')]=!![];_0xa27002['queuecallerexitAt']=moment(_0x4045cc[_0x1175('0x6f')])[_0x1175('0x8c')](_0xe3579b[_0x1175('0x79')],_0x1175('0x8d'))['format'](_0x1175('0x7b'));_0xa27002[_0x1175('0x7c')]='FORWARDTRANSFER';_0xa27002['transfer']=!![];_0xa27002[_0x1175('0x8e')]=_0x1175('0x8f');_0xa27002[_0x1175('0x90')]=_0xe3579b[_0x1175('0x91')];_0xa27002['transferuniqueid']=_0xe3579b[_0x1175('0x6d')];var _0x23875e=this[_0x1175('0x11')][_0xe3579b[_0x1175('0x8b')]];this[_0x1175('0x11')][_0xe3579b[_0x1175('0x8b')]]=this['queueReports'][_0xe3579b[_0x1175('0x6d')]];this['queueReports'][_0xe3579b[_0x1175('0x6d')]]=_0x23875e;}}else{_0x4045cc[_0x1175('0x7c')]=_0x1175('0x92')+_0xe3579b[_0x1175('0x89')]['toUpperCase']();}}}this[_0x1175('0x13')][_0xe3579b['uniqueid']]=_0x4045cc;this[_0x1175('0x49')](_0x4045cc);}}}catch(_0xfc7c74){logger[_0x1175('0x44')](_0x1175('0x93'),util[_0x1175('0x4a')](_0xfc7c74,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1175('0xd')][_0x1175('0x27')]=function(_0x38f150){try{if(this[_0x1175('0x61')](_0x38f150)){this[_0x1175('0x94')](_0x38f150[_0x1175('0x6d')],_['keys'](_0x38f150[_0x1175('0x95')])[0x0],_0x38f150[_0x1175('0x96')]);if(this[_0x1175('0x11')][_0x38f150[_0x1175('0x6d')]]){var _0x2004d1=_[_0x1175('0x76')](this[_0x1175('0x11')][_0x38f150[_0x1175('0x6d')]]);if(_0x2004d1){if(this[_0x1175('0x61')](_0x38f150[_0x1175('0x95')])&&this['isNotNull'](_0x38f150[_0x1175('0x95')]['queuestatus'])){switch(_0x38f150[_0x1175('0x96')]){case _0x1175('0x97'):_0x2004d1[_0x1175('0x87')]=![];_0x2004d1['queuecallerexitAt']=null;break;default:_0x2004d1[_0x1175('0x87')]=!![];_0x2004d1[_0x1175('0x88')]=moment()['format'](_0x1175('0x7b'));_0x2004d1[_0x1175('0x7e')]=moment()[_0x1175('0x4d')](_0x1175('0x7b'));}_0x2004d1['queuecallerabandon']=![];_0x2004d1[_0x1175('0x84')]=null;_0x2004d1[_0x1175('0x7c')]=_0x38f150[_0x1175('0x96')];this[_0x1175('0x13')][_0x38f150[_0x1175('0x6d')]]=_0x2004d1;this[_0x1175('0x49')](_0x2004d1);}else if(this[_0x1175('0x61')](_0x38f150[_0x1175('0x95')])&&this[_0x1175('0x61')](_0x38f150['variable']['queueposition'])){if(!_0x2004d1[_0x1175('0x1f')]){_0x2004d1[_0x1175('0x87')]=!![];_0x2004d1[_0x1175('0x88')]=moment()[_0x1175('0x4d')](_0x1175('0x7b'));_0x2004d1[_0x1175('0x7c')]='EXITWITHKEY';_0x2004d1['queuecallerleaveAt']=moment()[_0x1175('0x4d')](_0x1175('0x7b'));this[_0x1175('0x13')][_0x38f150[_0x1175('0x6d')]]=_0x2004d1;}}_0x2004d1[_0x1175('0x98')]=this['variables'][_0x38f150['uniqueid']];}}}}catch(_0x26041b){logger[_0x1175('0x44')](_0x1175('0x99'),util[_0x1175('0x4a')](_0x26041b,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x1175('0xd')][_0x1175('0x94')]=function(_0x39d242,_0x1e4fcb,_0x21156f){var _0x29cd19=[_0x1175('0x9a'),_0x1175('0x9b'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x1175('0x9c'),_0x1175('0x9d'),_0x1175('0x9e'),_0x1175('0x9f'),_0x1175('0xa0'),_0x1175('0xa1'),_0x1175('0xa2'),_0x1175('0xa3'),_0x1175('0xa4'),_0x1175('0xa5'),_0x1175('0xa6'),_0x1175('0xa7'),_0x1175('0x86'),_0x1175('0xa8'),_0x1175('0xa9')];if(!_[_0x1175('0x3e')](_0x1e4fcb)&&!_[_0x1175('0xaa')](_0x29cd19,_0x1e4fcb)){if(_[_0x1175('0x62')](this[_0x1175('0x98')][_0x39d242])){this[_0x1175('0x98')][_0x39d242]={};}this['variables'][_0x39d242][_0x1e4fcb]=_0x21156f;}};VoiceQueueReport[_0x1175('0xd')]['syncHangup']=function(_0x52d877){try{if(this[_0x1175('0x61')](_0x52d877)){if(this[_0x1175('0x11')][_0x52d877[_0x1175('0x6d')]]){for(var _0x2c769b=0x0,_0x5d753d={};_0x2c769b=0x0?moment(_0x15884e[_0x5bd5('0x17')])[_0x5bd5('0x18')](_0x15884e[_0x5bd5('0x16')],_0x5bd5('0x19')):null,'data1':_0x5bd5('0x1a'),'data2':_0x15884e[_0x5bd5('0x11')],'data3':_0x15884e[_0x5bd5('0x1b')],'data4':_0x15884e['dialstring']||null,'role':_0x5bd5('0x10'),'internal':_0x15884e[_0x5bd5('0x11')]?_[_0x5bd5('0x1c')](_0x15884e[_0x5bd5('0x11')]):undefined,'uniqueid':_0x15884e[_0x5bd5('0x12')]},'log':_0x5bd5('0x7')});}; \ No newline at end of file +var _0x82f6=['TALKING','queuecallerleaveAt','seconds','inbound','calleridnum','exten','accountcode','uniqueid','voiceDialReport','voice','membername','starttime','endtime','diff','outbound','dialstring','agent','toNumber','moment','lodash','util','../client','queuecallercompleteAt','queuecallerexitAt','Request','CreateMemberReport','lastAssignedTo','format','SIP/%s','interface'];(function(_0x315857,_0x1b7d8b){var _0xc87bed=function(_0x49e56c){while(--_0x49e56c){_0x315857['push'](_0x315857['shift']());}};_0xc87bed(++_0x1b7d8b);}(_0x82f6,0x1d4));var _0x682f=function(_0x39e6cd,_0x1336d3){_0x39e6cd=_0x39e6cd-0x0;var _0x95a708=_0x82f6[_0x39e6cd];return _0x95a708;};'use strict';var moment=require(_0x682f('0x0'));var _=require(_0x682f('0x1'));var util=require(_0x682f('0x2'));var client=require(_0x682f('0x3'));exports['voiceQueueReport']=function(_0x1abf2b){var _0x500da5=_0x1abf2b[_0x682f('0x4')]||_0x1abf2b[_0x682f('0x5')];return client[_0x682f('0x6')](_0x682f('0x7'),{'body':{'channel':'voice','membername':_0x1abf2b[_0x682f('0x8')],'interface':_['isNil'](_0x1abf2b['interface'])?util[_0x682f('0x9')](_0x682f('0xa'),_0x1abf2b[_0x682f('0x8')]):_0x1abf2b[_0x682f('0xb')],'type':_0x682f('0xc'),'enterAt':_0x1abf2b[_0x682f('0xd')],'exitAt':_0x500da5,'duration':moment(_0x500da5)['diff'](_0x1abf2b[_0x682f('0xd')],_0x682f('0xe')),'data1':_0x682f('0xf'),'data2':_0x1abf2b[_0x682f('0x10')],'data3':_0x1abf2b[_0x682f('0x11')],'data4':null,'data5':_0x1abf2b['queue'],'role':'agent','internal':_0x1abf2b[_0x682f('0x12')]?_['toNumber'](_0x1abf2b['accountcode']):undefined,'uniqueid':_0x1abf2b[_0x682f('0x13')]},'log':'CreateMemberReport'});};exports[_0x682f('0x14')]=function(_0x2fc50e){return client['Request'](_0x682f('0x7'),{'body':{'channel':_0x682f('0x15'),'membername':_0x2fc50e[_0x682f('0x16')],'interface':_0x2fc50e[_0x682f('0xb')],'type':_0x682f('0xc'),'enterAt':_0x2fc50e[_0x682f('0x17')],'exitAt':_0x2fc50e['endtime'],'duration':moment(_0x2fc50e[_0x682f('0x18')])[_0x682f('0x19')](_0x2fc50e['starttime'],_0x682f('0xe'))>=0x0?moment(_0x2fc50e[_0x682f('0x18')])[_0x682f('0x19')](_0x2fc50e['starttime'],_0x682f('0xe')):null,'data1':_0x682f('0x1a'),'data2':_0x2fc50e['accountcode'],'data3':_0x2fc50e[_0x682f('0x11')],'data4':_0x2fc50e[_0x682f('0x1b')]||null,'role':_0x682f('0x1c'),'internal':_0x2fc50e[_0x682f('0x12')]?_[_0x682f('0x1d')](_0x2fc50e[_0x682f('0x12')]):undefined,'uniqueid':_0x2fc50e[_0x682f('0x13')]},'log':_0x682f('0x7')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 0f87c43..f9c79ad 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 _0x0490=['name','html','GetTemplate','getTemplates'];(function(_0x779496,_0x9b0b0b){var _0x472493=function(_0x18db79){while(--_0x18db79){_0x779496['push'](_0x779496['shift']());}};_0x472493(++_0x9b0b0b);}(_0x0490,0x147));var _0x0049=function(_0x16da9d,_0x51d04a){_0x16da9d=_0x16da9d-0x0;var _0x45417b=_0x0490[_0x16da9d];return _0x45417b;};'use strict';var client=require('../client');exports[_0x0049('0x0')]=function(_0x5f5313){return function(_0x555b7c){return client['Request']('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x0049('0x1'),_0x0049('0x2')]},'log':_0x0049('0x3')});};}; \ No newline at end of file +var _0xf290=['name','html','getTemplates','GetTemplate'];(function(_0x24441e,_0x5bdfa9){var _0x35f5af=function(_0x5589b0){while(--_0x5589b0){_0x24441e['push'](_0x24441e['shift']());}};_0x35f5af(++_0x5bdfa9);}(_0xf290,0xde));var _0x0f29=function(_0x5d07ff,_0x1f976f){_0x5d07ff=_0x5d07ff-0x0;var _0x5226ad=_0xf290[_0x5d07ff];return _0x5226ad;};'use strict';var client=require('../client');exports[_0x0f29('0x0')]=function(_0x550692){return function(_0x1d35f0){return client['Request'](_0x0f29('0x1'),{'options':{'raw':!![],'attributes':['id',_0x0f29('0x2'),_0x0f29('0x3')]},'log':_0x0f29('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index a98f892..72f2055 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 _0x366f=['status','Condition','AllConditions','operator','value','AnyConditions','field','Action','Actions','action','data1','data2','data3','data4','data5','data6','../client','Request','name','channel'];(function(_0xacba71,_0x432428){var _0x4258a2=function(_0x1f141a){while(--_0x1f141a){_0xacba71['push'](_0xacba71['shift']());}};_0x4258a2(++_0x432428);}(_0x366f,0xec));var _0xf366=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0x366f[_0xf71120];return _0xbe2fd3;};'use strict';var client=require(_0xf366('0x0'));exports['getTriggers']=function(_0x10b72c){return function(_0x492f18){return client[_0xf366('0x1')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0xf366('0x2'),_0xf366('0x3'),_0xf366('0x4')],'include':[{'model':_0xf366('0x5'),'as':_0xf366('0x6'),'attributes':['id','field',_0xf366('0x7'),_0xf366('0x8')]},{'model':_0xf366('0x5'),'as':_0xf366('0x9'),'attributes':['id',_0xf366('0xa'),_0xf366('0x7'),_0xf366('0x8')]},{'model':_0xf366('0xb'),'as':_0xf366('0xc'),'attributes':['id',_0xf366('0xd'),_0xf366('0xe'),_0xf366('0xf'),_0xf366('0x10'),_0xf366('0x11'),_0xf366('0x12'),_0xf366('0x13'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xfa43=['name','channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data3','data4','data5','data7','GetTrigger','../client'];(function(_0x528575,_0x2e067d){var _0x3063b7=function(_0x1ee183){while(--_0x1ee183){_0x528575['push'](_0x528575['shift']());}};_0x3063b7(++_0x2e067d);}(_0xfa43,0xd7));var _0x3fa4=function(_0x18d682,_0x7aa64f){_0x18d682=_0x18d682-0x0;var _0xd0b528=_0xfa43[_0x18d682];return _0xd0b528;};'use strict';var client=require(_0x3fa4('0x0'));exports['getTriggers']=function(_0x57d3cc){return function(_0x346b22){return client['Request']('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x3fa4('0x1'),_0x3fa4('0x2'),_0x3fa4('0x3')],'include':[{'model':_0x3fa4('0x4'),'as':_0x3fa4('0x5'),'attributes':['id',_0x3fa4('0x6'),_0x3fa4('0x7'),_0x3fa4('0x8')]},{'model':_0x3fa4('0x4'),'as':_0x3fa4('0x9'),'attributes':['id',_0x3fa4('0x6'),_0x3fa4('0x7'),'value']},{'model':_0x3fa4('0xa'),'as':_0x3fa4('0xb'),'attributes':['id',_0x3fa4('0xc'),'data1','data2',_0x3fa4('0xd'),_0x3fa4('0xe'),_0x3fa4('0xf'),'data6',_0x3fa4('0x10')]}]},'log':_0x3fa4('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 564eb08..3884735 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 _0x2536=['Request','name','registry','GetTrunk','../client','getTrunks'];(function(_0x4c3fd8,_0x21df13){var _0x5dde64=function(_0x1f9a7d){while(--_0x1f9a7d){_0x4c3fd8['push'](_0x4c3fd8['shift']());}};_0x5dde64(++_0x21df13);}(_0x2536,0x19c));var _0x6253=function(_0x4c1430,_0x2f0c67){_0x4c1430=_0x4c1430-0x0;var _0x5ae13e=_0x2536[_0x4c1430];return _0x5ae13e;};'use strict';var client=require(_0x6253('0x0'));exports[_0x6253('0x1')]=function(_0x24b91a){return function(_0x5053fc){return client[_0x6253('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x6253('0x3'),_0x6253('0x4')]},'log':_0x6253('0x5')});};}; \ No newline at end of file +var _0x2b7d=['GetTrunk','name','registry','../client','getTrunks','Request'];(function(_0x7cb83a,_0x235685){var _0x13917e=function(_0x53610b){while(--_0x53610b){_0x7cb83a['push'](_0x7cb83a['shift']());}};_0x13917e(++_0x235685);}(_0x2b7d,0x189));var _0xd2b7=function(_0x260b34,_0x225d94){_0x260b34=_0x260b34-0x0;var _0x1ceaca=_0x2b7d[_0x260b34];return _0x1ceaca;};'use strict';var client=require(_0xd2b7('0x0'));exports[_0xd2b7('0x1')]=function(_0xe76be0){return function(_0x341a38){return client[_0xd2b7('0x2')](_0xd2b7('0x3'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xd2b7('0x4'),_0xd2b7('0x5')]},'log':'GetTrunk'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 26a2da1..5f04125 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 _0xf380=['online','lastLoginAt','pauseType','lastPauseAt','voicePause','getAgents','telephone','accountcode','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','agent','interface','../client','Request','GetUser','name','email','fullname'];(function(_0x2fc5bd,_0x1b6687){var _0x2b275b=function(_0x24b935){while(--_0x24b935){_0x2fc5bd['push'](_0x2fc5bd['shift']());}};_0x2b275b(++_0x1b6687);}(_0xf380,0x12e));var _0x0f38=function(_0x24d6dc,_0x5691ea){_0x24d6dc=_0x24d6dc-0x0;var _0x14b2c5=_0xf380[_0x24d6dc];return _0x14b2c5;};'use strict';var client=require(_0x0f38('0x0'));exports['getAgents']=function(){return function(){return client[_0x0f38('0x1')](_0x0f38('0x2'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x0f38('0x3'),_0x0f38('0x4'),'accountcode',_0x0f38('0x5'),_0x0f38('0x6'),_0x0f38('0x7'),_0x0f38('0x8'),_0x0f38('0x9'),_0x0f38('0xa'),'phone','mobile','interface']},'log':_0x0f38('0xb')});};};exports['getTelephones']=function(){return function(){return client[_0x0f38('0x1')]('GetUser',{'options':{'raw':!![],'where':{'role':_0x0f38('0xc')},'attributes':['id','name',_0x0f38('0xd'),_0x0f38('0xe')]},'log':'getTelephones'});};};exports[_0x0f38('0xf')]=function(_0x1e2aaa,_0x58e8e6,_0x243521){return client[_0x0f38('0x1')](_0x0f38('0x10'),{'body':{'type':_0x58e8e6,'uniqueid':_0x243521},'options':{'where':{'id':_0x1e2aaa['id']}},'log':_0x0f38('0xf')});};exports[_0x0f38('0x11')]=function(_0x24c6c6){return client[_0x0f38('0x1')](_0x0f38('0x12'),{'body':{},'options':{'where':{'id':_0x24c6c6['id']}},'log':'savePause'});};exports[_0x0f38('0x13')]=function(_0x1462a6){return client[_0x0f38('0x1')]('ShowUser',{'options':{'raw':![],'where':{'role':_0x0f38('0x14'),'id':_0x1462a6},'attributes':['id',_0x0f38('0x3'),_0x0f38('0x4'),_0x0f38('0xd'),'fullname',_0x0f38('0x6'),_0x0f38('0x7'),_0x0f38('0x8'),_0x0f38('0x9'),_0x0f38('0xa'),_0x0f38('0x15')]},'log':_0x0f38('0x13')});}; \ No newline at end of file +var _0x1360=['Request','accountcode','fullname','online','pauseType','lastPauseAt','voicePause','phone','mobile','interface','getTelephones','telephone','name','internal','savePause','saveUnpause','UnpauseUser','ShowUser','agent','email','lastLoginAt','getAgent','../client','getAgents'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1360,0x1c6));var _0x0136=function(_0x4dc8c6,_0x3fba52){_0x4dc8c6=_0x4dc8c6-0x0;var _0x69ce1d=_0x1360[_0x4dc8c6];return _0x69ce1d;};'use strict';var client=require(_0x0136('0x0'));exports[_0x0136('0x1')]=function(){return function(){return client[_0x0136('0x2')]('GetUser',{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id','name','email',_0x0136('0x3'),_0x0136('0x4'),_0x0136('0x5'),'lastLoginAt',_0x0136('0x6'),_0x0136('0x7'),_0x0136('0x8'),_0x0136('0x9'),_0x0136('0xa'),_0x0136('0xb')]},'log':_0x0136('0x1')});};};exports[_0x0136('0xc')]=function(){return function(){return client['Request']('GetUser',{'options':{'raw':!![],'where':{'role':_0x0136('0xd')},'attributes':['id',_0x0136('0xe'),_0x0136('0x3'),_0x0136('0xf')]},'log':_0x0136('0xc')});};};exports[_0x0136('0x10')]=function(_0x3646c2,_0x1a58a1,_0x43ced1){return client[_0x0136('0x2')]('PauseUser',{'body':{'type':_0x1a58a1,'uniqueid':_0x43ced1},'options':{'where':{'id':_0x3646c2['id']}},'log':_0x0136('0x10')});};exports[_0x0136('0x11')]=function(_0x293c76){return client[_0x0136('0x2')](_0x0136('0x12'),{'body':{},'options':{'where':{'id':_0x293c76['id']}},'log':_0x0136('0x10')});};exports['getAgent']=function(_0x2f31e6){return client['Request'](_0x0136('0x13'),{'options':{'raw':![],'where':{'role':_0x0136('0x14'),'id':_0x2f31e6},'attributes':['id',_0x0136('0xe'),_0x0136('0x15'),'accountcode',_0x0136('0x4'),_0x0136('0x5'),_0x0136('0x16'),_0x0136('0x6'),_0x0136('0x7'),'voicePause',_0x0136('0xb')]},'log':_0x0136('0x17')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 5d79cc7..911491c 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 _0xc247=['update','UpdateVoiceAgentReport','create','Request','CreateVoiceAgentReport'];(function(_0x49a5d1,_0x363287){var _0x1982d3=function(_0x15b4a6){while(--_0x15b4a6){_0x49a5d1['push'](_0x49a5d1['shift']());}};_0x1982d3(++_0x363287);}(_0xc247,0x1b5));var _0x7c24=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0xc247[_0x303c30];return _0x43161b;};'use strict';var client=require('../client');exports[_0x7c24('0x0')]=function(_0x499398){return client[_0x7c24('0x1')](_0x7c24('0x2'),{'body':_0x499398,'log':_0x7c24('0x2')});};exports[_0x7c24('0x3')]=function(_0x297d36,_0x35bd5b,_0x41c2e7){return client[_0x7c24('0x1')](_0x7c24('0x4'),{'body':_0x297d36,'options':{'where':{'uniqueid':_0x35bd5b,'interface':_0x41c2e7}},'log':_0x7c24('0x4')});}; \ No newline at end of file +var _0xf2b5=['Request','CreateVoiceAgentReport','update','UpdateVoiceAgentReport','../client','create'];(function(_0x3e37b1,_0x241ff1){var _0x7db532=function(_0x3f0d32){while(--_0x3f0d32){_0x3e37b1['push'](_0x3e37b1['shift']());}};_0x7db532(++_0x241ff1);}(_0xf2b5,0x8e));var _0x5f2b=function(_0x32f6b9,_0x2d4aa9){_0x32f6b9=_0x32f6b9-0x0;var _0x267d52=_0xf2b5[_0x32f6b9];return _0x267d52;};'use strict';var client=require(_0x5f2b('0x0'));exports[_0x5f2b('0x1')]=function(_0x53446d){return client[_0x5f2b('0x2')](_0x5f2b('0x3'),{'body':_0x53446d,'log':_0x5f2b('0x3')});};exports[_0x5f2b('0x4')]=function(_0x41ff03,_0x2bba1b,_0x38d651){return client[_0x5f2b('0x2')](_0x5f2b('0x5'),{'body':_0x41ff03,'options':{'where':{'uniqueid':_0x2bba1b,'interface':_0x38d651}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 2be4731..69b29f1 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 _0x96d3=['endOf','YYYY-MM-DD\x20HH:mm:ss','type','GetVoiceCallReports','lodash','../client','create','merge','calleridnum','callerid','DOCUMENTATION','CreateVoiceCallReport','getVoiceCallReports','Request','GetVoiceCallReport','outbound','day','format'];(function(_0x3bf499,_0x37fd44){var _0x580633=function(_0x3ce1ed){while(--_0x3ce1ed){_0x3bf499['push'](_0x3bf499['shift']());}};_0x580633(++_0x37fd44);}(_0x96d3,0x1d8));var _0x396d=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x96d3[_0x3ab51d];return _0x29a04e;};'use strict';var moment=require('moment');var util=require('util');var _=require(_0x396d('0x0'));var client=require(_0x396d('0x1'));exports[_0x396d('0x2')]=function(_0x507642){return client['Request']('CreateVoiceCallReport',{'body':_[_0x396d('0x3')](_0x507642,{'source':_0x507642[_0x396d('0x4')],'destinationcontext':_0x507642['context'],'callerid':_0x507642[_0x396d('0x5')],'amaflags':_0x396d('0x6')}),'log':_0x396d('0x7')});};exports[_0x396d('0x8')]=function(){return function(){return client[_0x396d('0x9')](_0x396d('0xa'),{'options':{'where':{'type':[_0x396d('0xb')],'createdAt':{'$between':[moment()['startOf'](_0x396d('0xc'))[_0x396d('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x396d('0xe')](_0x396d('0xc'))[_0x396d('0xd')](_0x396d('0xf'))]}},'attributes':[_0x396d('0x10'),'disposition','duration','billableseconds']},'log':_0x396d('0x11')});};}; \ No newline at end of file +var _0x8fb4=['getVoiceCallReports','GetVoiceCallReport','outbound','startOf','format','YYYY-MM-DD\x20HH:mm:ss','type','duration','billableseconds','GetVoiceCallReports','moment','util','lodash','create','Request','CreateVoiceCallReport','context','callerid','DOCUMENTATION'];(function(_0x51ce18,_0x9f8388){var _0x58596e=function(_0x245e9a){while(--_0x245e9a){_0x51ce18['push'](_0x51ce18['shift']());}};_0x58596e(++_0x9f8388);}(_0x8fb4,0xee));var _0x48fb=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x8fb4[_0x14add3];return _0x4a174f;};'use strict';var moment=require(_0x48fb('0x0'));var util=require(_0x48fb('0x1'));var _=require(_0x48fb('0x2'));var client=require('../client');exports[_0x48fb('0x3')]=function(_0x468e2d){return client[_0x48fb('0x4')](_0x48fb('0x5'),{'body':_['merge'](_0x468e2d,{'source':_0x468e2d['calleridnum'],'destinationcontext':_0x468e2d[_0x48fb('0x6')],'callerid':_0x468e2d[_0x48fb('0x7')],'amaflags':_0x48fb('0x8')}),'log':_0x48fb('0x5')});};exports[_0x48fb('0x9')]=function(){return function(){return client[_0x48fb('0x4')](_0x48fb('0xa'),{'options':{'where':{'type':[_0x48fb('0xb')],'createdAt':{'$between':[moment()[_0x48fb('0xc')]('day')['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()['endOf']('day')[_0x48fb('0xd')](_0x48fb('0xe'))]}},'attributes':[_0x48fb('0xf'),'disposition',_0x48fb('0x10'),_0x48fb('0x11')]},'log':_0x48fb('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 2f7ead0..76ea98f 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 _0x85fa=['Request','CreateVoiceDialReport','create'];(function(_0x2d2c16,_0x4e88b6){var _0x53f2fb=function(_0x6b6dac){while(--_0x6b6dac){_0x2d2c16['push'](_0x2d2c16['shift']());}};_0x53f2fb(++_0x4e88b6);}(_0x85fa,0x182));var _0xa85f=function(_0x590b5b,_0x21ca44){_0x590b5b=_0x590b5b-0x0;var _0x3877bd=_0x85fa[_0x590b5b];return _0x3877bd;};'use strict';var client=require('../client');exports[_0xa85f('0x0')]=function(_0x20584d){return client[_0xa85f('0x1')]('CreateVoiceDialReport',{'body':_0x20584d,'log':_0xa85f('0x2')});}; \ No newline at end of file +var _0xea75=['Request','../client','create'];(function(_0x5e56d2,_0x69a9d9){var _0x382751=function(_0x44c5ef){while(--_0x44c5ef){_0x5e56d2['push'](_0x5e56d2['shift']());}};_0x382751(++_0x69a9d9);}(_0xea75,0x1d8));var _0x5ea7=function(_0x4f75d8,_0x183302){_0x4f75d8=_0x4f75d8-0x0;var _0x445cee=_0xea75[_0x4f75d8];return _0x445cee;};'use strict';var client=require(_0x5ea7('0x0'));exports[_0x5ea7('0x1')]=function(_0x1d8885){return client[_0x5ea7('0x2')]('CreateVoiceDialReport',{'body':_0x1d8885,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index a1ee71d..30d8b4f 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 _0x6584=['Request','GetVoiceExtension','recordingFormat','../client','getVoiceExtensions'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x6584,0x175));var _0x4658=function(_0x26da89,_0x264785){_0x26da89=_0x26da89-0x0;var _0xc95b7b=_0x6584[_0x26da89];return _0xc95b7b;};'use strict';var client=require(_0x4658('0x0'));exports[_0x4658('0x1')]=function(){return function(){return client[_0x4658('0x2')](_0x4658('0x3'),{'options':{'raw':!![],'attributes':['id','exten',_0x4658('0x4')],'where':{'VoiceExtensionId':null}},'log':_0x4658('0x1')});};}; \ No newline at end of file +var _0xac4a=['recordingFormat','../client','getVoiceExtensions','Request','GetVoiceExtension','exten'];(function(_0x5f4a16,_0x13532d){var _0x382ba3=function(_0x1aa97a){while(--_0x1aa97a){_0x5f4a16['push'](_0x5f4a16['shift']());}};_0x382ba3(++_0x13532d);}(_0xac4a,0x13f));var _0xaac4=function(_0x8b881d,_0x1aa2d3){_0x8b881d=_0x8b881d-0x0;var _0x308838=_0xac4a[_0x8b881d];return _0x308838;};'use strict';var client=require(_0xaac4('0x0'));exports[_0xaac4('0x1')]=function(){return function(){return client[_0xaac4('0x2')](_0xaac4('0x3'),{'options':{'raw':!![],'attributes':['id',_0xaac4('0x4'),_0xaac4('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index fbbcf87..c4bd86f 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 _0x4b10=['dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialPrefix','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialQueueProject2','strategy','dialRandomLastDigitCallerIdNumber','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','Interval','Intervals','interval','../client','getVoiceQueues','Request','GetVoiceQueue','name','acw','autopause','monitor_format','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency'];(function(_0xa362ff,_0x425feb){var _0x4fd591=function(_0xfa823a){while(--_0xfa823a){_0xa362ff['push'](_0xa362ff['shift']());}};_0x4fd591(++_0x425feb);}(_0x4b10,0x15d));var _0x04b1=function(_0x1c9a26,_0x29bb76){_0x1c9a26=_0x1c9a26-0x0;var _0x4555d7=_0x4b10[_0x1c9a26];return _0x4555d7;};'use strict';var client=require(_0x04b1('0x0'));exports[_0x04b1('0x1')]=function(){return function(){return client[_0x04b1('0x2')](_0x04b1('0x3'),{'options':{'raw':![],'attributes':['id',_0x04b1('0x4'),_0x04b1('0x5'),'acwTimeout',_0x04b1('0x6'),_0x04b1('0x7'),'type',_0x04b1('0x8'),_0x04b1('0x9'),_0x04b1('0xa'),_0x04b1('0xb'),_0x04b1('0xc'),_0x04b1('0xd'),_0x04b1('0xe'),_0x04b1('0xf'),'dialOriginateCallerIdName',_0x04b1('0x10'),_0x04b1('0x11'),'dialQueueOptions',_0x04b1('0x12'),_0x04b1('0x13'),_0x04b1('0x14'),_0x04b1('0x15'),_0x04b1('0x16'),_0x04b1('0x17'),_0x04b1('0x18'),_0x04b1('0x19'),_0x04b1('0x1a'),_0x04b1('0x1b'),'dialGlobalInterval',_0x04b1('0x1c'),'dialCheckDuplicateType','dialAMDActive',_0x04b1('0x1d'),_0x04b1('0x1e'),_0x04b1('0x1f'),'dialAMDTotalAnalysisTime',_0x04b1('0x20'),_0x04b1('0x21'),_0x04b1('0x22'),_0x04b1('0x23'),_0x04b1('0x24'),_0x04b1('0x25'),_0x04b1('0x26'),_0x04b1('0x27'),'dialOrderByScheduledAt','dialAgiAfterHangupAgent',_0x04b1('0x28'),_0x04b1('0x29'),_0x04b1('0x7'),_0x04b1('0x2a'),_0x04b1('0x2b'),'dialCutDigit','mandatoryDisposition',_0x04b1('0x2c'),_0x04b1('0x2d')],'include':[{'model':_0x04b1('0x2e'),'as':_0x04b1('0x2e'),'attributes':['id','name',_0x04b1('0x2f'),_0x04b1('0x30')]},{'model':_0x04b1('0x31'),'as':'mandatoryDispositionPause','attributes':['id',_0x04b1('0x4')]},{'model':'Trunk','as':'TrunkBackup','attributes':['id',_0x04b1('0x4'),_0x04b1('0x2f'),_0x04b1('0x30')]},{'model':_0x04b1('0x32'),'as':'Interval','attributes':['id',_0x04b1('0x4')],'include':[{'model':_0x04b1('0x32'),'as':_0x04b1('0x33'),'attributes':['id',_0x04b1('0x4'),_0x04b1('0x34')]}]}]},'log':'getVoiceQueues'});};}; \ No newline at end of file +var _0x085c=['dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialCutDigit','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialCheckDuplicateType','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold'];(function(_0x30b45f,_0x5703f1){var _0x383efd=function(_0x27e829){while(--_0x27e829){_0x30b45f['push'](_0x30b45f['shift']());}};_0x383efd(++_0x5703f1);}(_0x085c,0x81));var _0xc085=function(_0x412686,_0x3fde24){_0x412686=_0x412686-0x0;var _0x18619e=_0x085c[_0x412686];return _0x18619e;};'use strict';var client=require('../client');exports['getVoiceQueues']=function(){return function(){return client[_0xc085('0x0')](_0xc085('0x1'),{'options':{'raw':![],'attributes':['id',_0xc085('0x2'),_0xc085('0x3'),_0xc085('0x4'),_0xc085('0x5'),_0xc085('0x6'),_0xc085('0x7'),_0xc085('0x8'),_0xc085('0x9'),_0xc085('0xa'),'dialLimitQueue',_0xc085('0xb'),_0xc085('0xc'),_0xc085('0xd'),_0xc085('0xe'),_0xc085('0xf'),_0xc085('0x10'),_0xc085('0x11'),_0xc085('0x12'),_0xc085('0x13'),'dialQueueProject',_0xc085('0x14'),_0xc085('0x15'),_0xc085('0x16'),_0xc085('0x17'),_0xc085('0x18'),_0xc085('0x19'),_0xc085('0x1a'),_0xc085('0x1b'),'dialGlobalInterval','dialPrefix',_0xc085('0x1c'),'dialAMDActive',_0xc085('0x1d'),'dialAMDGreeting',_0xc085('0x1e'),_0xc085('0x1f'),_0xc085('0x20'),_0xc085('0x21'),_0xc085('0x22'),_0xc085('0x23'),_0xc085('0x24'),_0xc085('0x25'),_0xc085('0x26'),'dialRecallInQueue',_0xc085('0x27'),_0xc085('0x28'),_0xc085('0x29'),'dialQueueProject2',_0xc085('0x6'),_0xc085('0x2a'),'dialRandomLastDigitCallerIdNumber',_0xc085('0x2b'),'mandatoryDisposition',_0xc085('0x2c'),_0xc085('0x2d')],'include':[{'model':_0xc085('0x2e'),'as':_0xc085('0x2e'),'attributes':['id','name',_0xc085('0x2f'),'active']},{'model':_0xc085('0x30'),'as':'mandatoryDispositionPause','attributes':['id',_0xc085('0x2')]},{'model':'Trunk','as':_0xc085('0x31'),'attributes':['id','name',_0xc085('0x2f'),_0xc085('0x32')]},{'model':_0xc085('0x33'),'as':_0xc085('0x33'),'attributes':['id','name'],'include':[{'model':_0xc085('0x33'),'as':_0xc085('0x34'),'attributes':['id','name',_0xc085('0x35')]}]}]},'log':_0xc085('0x36')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index d9dba06..1b7bcc7 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 _0x73b3=['CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','day','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','moment','lodash','../client','create','Request'];(function(_0x5b2d53,_0x4016b1){var _0x4c5cd4=function(_0x9b2db0){while(--_0x9b2db0){_0x5b2d53['push'](_0x5b2d53['shift']());}};_0x4c5cd4(++_0x4016b1);}(_0x73b3,0x1ab));var _0x373b=function(_0x292f93,_0x2c6e8e){_0x292f93=_0x292f93-0x0;var _0x5a94b1=_0x73b3[_0x292f93];return _0x5a94b1;};'use strict';var moment=require(_0x373b('0x0'));var _=require(_0x373b('0x1'));var client=require(_0x373b('0x2'));exports[_0x373b('0x3')]=function(_0x11071a){return client[_0x373b('0x4')](_0x373b('0x5'),{'body':_0x11071a,'log':_0x373b('0x5')});};exports[_0x373b('0x6')]=function(){return function(){return client[_0x373b('0x4')](_0x373b('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()['startOf'](_0x373b('0x8'))['format'](_0x373b('0x9')),moment()['endOf']('day')['format'](_0x373b('0x9'))]}},'attributes':[_0x373b('0xa'),_0x373b('0xb'),_0x373b('0xc'),_0x373b('0xd'),_0x373b('0xe'),_0x373b('0xf'),_0x373b('0x10'),_0x373b('0x11'),'queuecallerabandon','queuecallerabandonAt']},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xcb63=['format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerexit','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','lodash','../client','create','CreateVoiceQueueReport','getVoiceQueueReports','Request','GetVoiceQueueReport','startOf','day'];(function(_0x199418,_0x5e4206){var _0x2e1204=function(_0x1163f4){while(--_0x1163f4){_0x199418['push'](_0x199418['shift']());}};_0x2e1204(++_0x5e4206);}(_0xcb63,0x96));var _0x3cb6=function(_0x58d31b,_0xbbe2da){_0x58d31b=_0x58d31b-0x0;var _0x1a95da=_0xcb63[_0x58d31b];return _0x1a95da;};'use strict';var moment=require(_0x3cb6('0x0'));var _=require(_0x3cb6('0x1'));var client=require(_0x3cb6('0x2'));exports[_0x3cb6('0x3')]=function(_0x28fd3b){return client['Request'](_0x3cb6('0x4'),{'body':_0x28fd3b,'log':'CreateVoiceQueueReport'});};exports[_0x3cb6('0x5')]=function(){return function(){return client[_0x3cb6('0x6')](_0x3cb6('0x7'),{'options':{'where':{'createdAt':{'$between':[moment()[_0x3cb6('0x8')](_0x3cb6('0x9'))[_0x3cb6('0xa')](_0x3cb6('0xb')),moment()[_0x3cb6('0xc')]('day')[_0x3cb6('0xa')](_0x3cb6('0xb'))]}},'attributes':[_0x3cb6('0xd'),_0x3cb6('0xe'),_0x3cb6('0xf'),'queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt',_0x3cb6('0x10'),'queuecallerexitAt',_0x3cb6('0x11'),_0x3cb6('0x12')]},'log':_0x3cb6('0x13')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 0700f07..ffc755f 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 _0x3b19=['../client','Request','getVoiceQueueRtPauses'];(function(_0x414ca7,_0x5e8792){var _0xac6a0b=function(_0x76525){while(--_0x76525){_0x414ca7['push'](_0x414ca7['shift']());}};_0xac6a0b(++_0x5e8792);}(_0x3b19,0x102));var _0x93b1=function(_0x589b93,_0x4767f5){_0x589b93=_0x589b93-0x0;var _0x5b0b83=_0x3b19[_0x589b93];return _0x5b0b83;};'use strict';var client=require(_0x93b1('0x0'));exports['getVoiceQueueRtPauses']=function(_0x439923){return function(){return client[_0x93b1('0x1')]('GetVoiceQueueRtPauses',{'options':{'where':{'VoiceQueueId':_0x439923,'paused':!![]},'raw':!![]},'log':_0x93b1('0x2')});};}; \ No newline at end of file +var _0xd17e=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0x434dbd,_0x375462){var _0x5ea31f=function(_0x83ff02){while(--_0x83ff02){_0x434dbd['push'](_0x434dbd['shift']());}};_0x5ea31f(++_0x375462);}(_0xd17e,0xa5));var _0xed17=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd17e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xed17('0x0'));exports[_0xed17('0x1')]=function(_0x3a221f){return function(){return client['Request'](_0xed17('0x2'),{'options':{'where':{'VoiceQueueId':_0x3a221f,'paused':!![]},'raw':!![]},'log':_0xed17('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index fcf6875..6c9398a 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 _0xbd1d=['lodash','../client','create','CreateVoiceRecording','monitorFilename'];(function(_0x304a2d,_0x33ac64){var _0x422f78=function(_0xc21e5a){while(--_0xc21e5a){_0x304a2d['push'](_0x304a2d['shift']());}};_0x422f78(++_0x33ac64);}(_0xbd1d,0x140));var _0xdbd1=function(_0x5d51d2,_0x286a78){_0x5d51d2=_0x5d51d2-0x0;var _0x2c63f1=_0xbd1d[_0x5d51d2];return _0x2c63f1;};'use strict';var _=require(_0xdbd1('0x0'));var client=require(_0xdbd1('0x1'));exports[_0xdbd1('0x2')]=function(_0xf629cd){return client['Request'](_0xdbd1('0x3'),{'body':_['merge'](_0xf629cd,{'value':_0xf629cd[_0xdbd1('0x4')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x2e2c=['create','Request','merge','CreateVoiceRecording','lodash','../client'];(function(_0x21d36e,_0x5dc096){var _0x4cc307=function(_0x4ae995){while(--_0x4ae995){_0x21d36e['push'](_0x21d36e['shift']());}};_0x4cc307(++_0x5dc096);}(_0x2e2c,0x76));var _0xc2e2=function(_0x4ba380,_0x259bee){_0x4ba380=_0x4ba380-0x0;var _0x4b111b=_0x2e2c[_0x4ba380];return _0x4b111b;};'use strict';var _=require(_0xc2e2('0x0'));var client=require(_0xc2e2('0x1'));exports[_0xc2e2('0x2')]=function(_0x380c3f){return client[_0xc2e2('0x3')]('CreateVoiceRecording',{'body':_[_0xc2e2('0x4')](_0x380c3f,{'value':_0x380c3f['monitorFilename']}),'log':_0xc2e2('0x5')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 2a50891..8996ded 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 _0x422c=['secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','../client','blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereeexten','isexternal','context','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname'];(function(_0x43116e,_0x32cc41){var _0x95a606=function(_0x552e6a){while(--_0x552e6a){_0x43116e['push'](_0x43116e['shift']());}};_0x95a606(++_0x32cc41);}(_0x422c,0xcb));var _0xc422=function(_0x5e19a6,_0x24b07e){_0x5e19a6=_0x5e19a6-0x0;var _0x9aeb95=_0x422c[_0x5e19a6];return _0x9aeb95;};'use strict';var client=require(_0xc422('0x0'));exports[_0xc422('0x1')]=function(_0x56b0e9){return client[_0xc422('0x2')](_0xc422('0x3'),{'body':{'result':_0x56b0e9['result'],'transfererchannel':_0x56b0e9[_0xc422('0x4')],'transferercalleridnum':_0x56b0e9[_0xc422('0x5')],'transferercalleridname':_0x56b0e9[_0xc422('0x6')],'transfererconnectedlinenum':_0x56b0e9['transfererconnectedlinenum'],'transfererconnectedlinename':_0x56b0e9['transfererconnectedlinename'],'transfereraccountcode':_0x56b0e9['transfereraccountcode'],'transferercontext':_0x56b0e9[_0xc422('0x7')],'transfererexten':_0x56b0e9[_0xc422('0x8')],'transfererlinkedid':_0x56b0e9[_0xc422('0x9')],'transfereechannel':_0x56b0e9[_0xc422('0xa')],'transfereecalleridnum':_0x56b0e9[_0xc422('0xb')],'transfereecalleridname':_0x56b0e9['transfereecalleridname'],'transfereeconnectedlinenum':_0x56b0e9[_0xc422('0xc')],'transfereeconnectedlinename':_0x56b0e9[_0xc422('0xd')],'transfereeaccountcode':_0x56b0e9[_0xc422('0xe')],'transfereecontext':_0x56b0e9['transfereecontext'],'transfereeexten':_0x56b0e9[_0xc422('0xf')],'transfereelinkedid':_0x56b0e9['transfereelinkedid'],'isexternal':_0x56b0e9[_0xc422('0x10')],'context':_0x56b0e9[_0xc422('0x11')],'extension':_0x56b0e9[_0xc422('0x12')],'type':_0xc422('0x13')},'log':'CreateVoiceTransferReport'});};exports[_0xc422('0x14')]=function(_0x52c75f){return client[_0xc422('0x2')](_0xc422('0x3'),{'body':{'result':_0x52c75f[_0xc422('0x15')],'transfererchannel':_0x52c75f[_0xc422('0x16')],'transferercalleridnum':_0x52c75f[_0xc422('0x17')],'transferercalleridname':_0x52c75f[_0xc422('0x18')],'transfererconnectedlinenum':_0x52c75f['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x52c75f[_0xc422('0x19')],'transfereraccountcode':_0x52c75f['origtransfereraccountcode'],'transferercontext':_0x52c75f[_0xc422('0x1a')],'transfererexten':_0x52c75f[_0xc422('0x1b')],'transfererlinkedid':_0x52c75f[_0xc422('0x1c')],'transfereechannel':_0x52c75f[_0xc422('0x1d')],'transfereecalleridnum':_0x52c75f[_0xc422('0x1e')],'transfereecalleridname':_0x52c75f['transfertargetcalleridname'],'transfereeconnectedlinenum':_0x52c75f[_0xc422('0x1f')],'transfereeconnectedlinename':_0x52c75f[_0xc422('0x20')],'transfereeaccountcode':_0x52c75f['transfertargetaccountcode'],'transfereecontext':_0x52c75f[_0xc422('0x21')],'transfereeexten':_0x52c75f[_0xc422('0x22')],'transfereelinkedid':_0x52c75f[_0xc422('0x23')],'isexternal':_0x52c75f[_0xc422('0x10')],'context':_0x52c75f[_0xc422('0x24')],'extension':_0x52c75f['origtransfererexten'],'type':_0xc422('0x25')},'log':_0xc422('0x3')});}; \ No newline at end of file +var _0x67c5=['transfereecontext','transfereeexten','transfereelinkedid','isexternal','context','extension','blind','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','secondtransfererexten','transfertargetchannel','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended','blindTransfer','Request','CreateVoiceTransferReport','result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfererconnectedlinename','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereeaccountcode'];(function(_0x1082ab,_0x133d5b){var _0x2de4cf=function(_0x551eb1){while(--_0x551eb1){_0x1082ab['push'](_0x1082ab['shift']());}};_0x2de4cf(++_0x133d5b);}(_0x67c5,0x145));var _0x567c=function(_0x11edea,_0x25c182){_0x11edea=_0x11edea-0x0;var _0x44c12b=_0x67c5[_0x11edea];return _0x44c12b;};'use strict';var client=require('../client');exports[_0x567c('0x0')]=function(_0x41f7d4){return client[_0x567c('0x1')](_0x567c('0x2'),{'body':{'result':_0x41f7d4[_0x567c('0x3')],'transfererchannel':_0x41f7d4['transfererchannel'],'transferercalleridnum':_0x41f7d4[_0x567c('0x4')],'transferercalleridname':_0x41f7d4[_0x567c('0x5')],'transfererconnectedlinenum':_0x41f7d4[_0x567c('0x6')],'transfererconnectedlinename':_0x41f7d4[_0x567c('0x7')],'transfereraccountcode':_0x41f7d4[_0x567c('0x8')],'transferercontext':_0x41f7d4[_0x567c('0x9')],'transfererexten':_0x41f7d4[_0x567c('0xa')],'transfererlinkedid':_0x41f7d4[_0x567c('0xb')],'transfereechannel':_0x41f7d4[_0x567c('0xc')],'transfereecalleridnum':_0x41f7d4[_0x567c('0xd')],'transfereecalleridname':_0x41f7d4[_0x567c('0xe')],'transfereeconnectedlinenum':_0x41f7d4['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x41f7d4[_0x567c('0xf')],'transfereeaccountcode':_0x41f7d4[_0x567c('0x10')],'transfereecontext':_0x41f7d4[_0x567c('0x11')],'transfereeexten':_0x41f7d4[_0x567c('0x12')],'transfereelinkedid':_0x41f7d4[_0x567c('0x13')],'isexternal':_0x41f7d4[_0x567c('0x14')],'context':_0x41f7d4[_0x567c('0x15')],'extension':_0x41f7d4[_0x567c('0x16')],'type':_0x567c('0x17')},'log':_0x567c('0x2')});};exports['attendedTransfer']=function(_0xb02d5c){return client[_0x567c('0x1')](_0x567c('0x2'),{'body':{'result':_0xb02d5c[_0x567c('0x3')],'transfererchannel':_0xb02d5c['origtransfererchannel'],'transferercalleridnum':_0xb02d5c[_0x567c('0x18')],'transferercalleridname':_0xb02d5c[_0x567c('0x19')],'transfererconnectedlinenum':_0xb02d5c[_0x567c('0x1a')],'transfererconnectedlinename':_0xb02d5c[_0x567c('0x1b')],'transfereraccountcode':_0xb02d5c['origtransfereraccountcode'],'transferercontext':_0xb02d5c[_0x567c('0x1c')],'transfererexten':_0xb02d5c[_0x567c('0x1d')],'transfererlinkedid':_0xb02d5c['origtransfererlinkedid'],'transfereechannel':_0xb02d5c[_0x567c('0x1e')],'transfereecalleridnum':_0xb02d5c['transfertargetcalleridnum'],'transfereecalleridname':_0xb02d5c[_0x567c('0x1f')],'transfereeconnectedlinenum':_0xb02d5c[_0x567c('0x20')],'transfereeconnectedlinename':_0xb02d5c['transfertargetconnectedlinename'],'transfereeaccountcode':_0xb02d5c['transfertargetaccountcode'],'transfereecontext':_0xb02d5c[_0x567c('0x21')],'transfereeexten':_0xb02d5c[_0x567c('0x22')],'transfereelinkedid':_0xb02d5c[_0x567c('0x23')],'isexternal':_0xb02d5c['isexternal'],'context':_0xb02d5c[_0x567c('0x24')],'extension':_0xb02d5c['origtransfererexten'],'type':_0x567c('0x25')},'log':_0x567c('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index d6b975b..6ee515a 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 _0xabfb=['outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','Trunk','active','Interval','push','channels','voicechannel','length','uniqueid','format','%s.%s','filename','wav','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','map','resolve','StopMixMonitor','find','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','values','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','voicequeuechannelredirect','Redirect','exten','telephones','trunks','outboundChannels','run','event','Event\x20name\x20mandatory','custom:','faxAccounts','send','server','http','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','listen','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','module','Reload','Action','then','message','error','command','action','Command','content','catch','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','sumBillable','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay'];(function(_0x140a03,_0x5cf435){var _0x4aa378=function(_0x885aa3){while(--_0x885aa3){_0x140a03['push'](_0x140a03['shift']());}};_0x4aa378(++_0x5cf435);}(_0xabfb,0xdc));var _0xbabf=function(_0x53b594,_0x559767){_0x53b594=_0x53b594-0x0;var _0x1e616f=_0xabfb[_0x53b594];return _0x1e616f;};'use strict';var _=require(_0xbabf('0x0'));var util=require(_0xbabf('0x1'));var jayson=require(_0xbabf('0x2'));var schema=require(_0xbabf('0x3'));var BPromise=require(_0xbabf('0x4'));var moment=require(_0xbabf('0x5'));var config=require(_0xbabf('0x6'));var properties=require(_0xbabf('0x7'));var ami=require(_0xbabf('0x8'));exports[_0xbabf('0x9')]=function(_0x5003eb,_0x5baaa0,_0x39a0e7){return new BPromise(function(_0x34ee1c,_0x52dd2a){var _0x5f2d4f={'QueuePause':function(_0x146e97){return new Promise(function(_0x345f59,_0x1ad451){var _0x1b7f6d=util['format'](_0xbabf('0xa'),_0xbabf('0xb'),_0x146e97[_0xbabf('0xc')]);if(_0x5003eb['timers']&&_0x5003eb['timers'][_0x1b7f6d]&&_0x5003eb[_0xbabf('0xd')][_0x1b7f6d][_0xbabf('0xe')]){_0x5003eb[_0xbabf('0xd')][_0x1b7f6d][_0xbabf('0xf')]();}if(_0x5003eb[_0xbabf('0x10')][_0x1b7f6d]){_0x5003eb[_0xbabf('0x10')][_0x1b7f6d][_0xbabf('0x11')]({'statePause':_0x146e97[_0xbabf('0x12')]?!![]:![]});}_0x345f59({'code':0xc8,'message':_0xbabf('0x13')});});},'Reload':function(_0x8b69a){var _0x70afcc=this;return new Promise(function(_0x6f6f6b,_0x3c05f0){if(ami[_0xbabf('0x14')]()==![]){return _0x3c05f0(_0x70afcc['error'](0x1f4,[config['asterisk']['ip'],config[_0xbabf('0x15')][_0xbabf('0x16')],_0xbabf('0x17')][_0xbabf('0x18')]('\x20')));}_0x8b69a=_['pick'](_0x8b69a,_['keys'](properties[_0xbabf('0x19')]));_0x8b69a['action']=_0xbabf('0x1a');return ami[_0xbabf('0x1b')](_0x8b69a)[_0xbabf('0x1c')](function(_0x358e1c){_0x6f6f6b({'code':0xc8,'message':_0x358e1c[_0xbabf('0x1d')]});})['catch'](function(_0x1dfeda){_0x3c05f0(_0x70afcc['error'](0x1f5,_0x1dfeda[_0xbabf('0x1d')]));});});},'Command':function(_0x35d677){var _0x54a1ed=this;return new Promise(function(_0x46028b,_0x936ca1){if(ami[_0xbabf('0x14')]()==![]){return _0x936ca1(_0x54a1ed[_0xbabf('0x1e')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0xbabf('0x17')]['join']('\x20')));}_0x35d677=_['pick'](_0x35d677,_0xbabf('0x1f'));_0x35d677[_0xbabf('0x20')]=_0xbabf('0x21');return ami[_0xbabf('0x1b')](_0x35d677)[_0xbabf('0x1c')](function(_0x548ae8){_0x46028b({'code':0xc8,'message':_0x548ae8[_0xbabf('0x22')]});})[_0xbabf('0x23')](function(_0x2629ff){_0x936ca1(_0x54a1ed[_0xbabf('0x1e')](0x1f5,_0x2629ff[_0xbabf('0x1d')]));});});},'VoiceQueues':function(_0x3517a3){return new Promise(function(_0x439338,_0x527a81){var _0x14bd7b=[];for(var _0x2023ea in _0x5003eb[_0xbabf('0x24')]){if(_0x5003eb[_0xbabf('0x24')][_0xbabf('0x25')](_0x2023ea)){var _0x575947=_0x5003eb['voiceQueues'][_0x2023ea];var _0x4af367={'id':_0x575947['id'],'name':_0x575947['name'],'strategy':_0x575947[_0xbabf('0x26')],'answered':_0x575947[_0xbabf('0x27')],'available':_0x575947[_0xbabf('0x28')],'loggedIn':_0x575947[_0xbabf('0x29')],'pTalking':_0x575947['pTalking'],'sumBillable':_0x575947[_0xbabf('0x2a')],'sumDuration':_0x575947[_0xbabf('0x2b')],'sumHoldTime':_0x575947[_0xbabf('0x2c')]||0x0,'talking':_0x575947[_0xbabf('0x2d')],'total':_0x575947[_0xbabf('0x2e')],'type':_0x575947[_0xbabf('0x2f')],'unmanaged':_0x575947['unmanaged'],'abandoned':_0x575947[_0xbabf('0x30')],'waiting':_0x575947[_0xbabf('0x31')],'loggedInDb':_0x575947['loggedInDb']};if(_0x575947[_0xbabf('0x2f')]===_0xbabf('0x32')){_0x4af367[_0xbabf('0x33')]=_0x575947['dialActive'];_0x4af367[_0xbabf('0x34')]=_0x575947[_0xbabf('0x34')];_0x4af367[_0xbabf('0x35')]=_0x575947['dialOriginateCallerIdName'];_0x4af367[_0xbabf('0x36')]=_0x575947[_0xbabf('0x36')];_0x4af367[_0xbabf('0x37')]=_0x575947[_0xbabf('0x37')];_0x4af367[_0xbabf('0x38')]=_0x575947[_0xbabf('0x38')];_0x4af367[_0xbabf('0x39')]=_0x575947[_0xbabf('0x39')];_0x4af367[_0xbabf('0x3a')]=_0x575947[_0xbabf('0x3a')];_0x4af367['outboundBlacklistCallsDay']=_0x575947[_0xbabf('0x3b')];_0x4af367['outboundBusyCallsDay']=_0x575947[_0xbabf('0x3c')];_0x4af367[_0xbabf('0x3d')]=_0x575947[_0xbabf('0x3d')];_0x4af367['outboundDropCallsDayACS']=_0x575947[_0xbabf('0x3e')];_0x4af367[_0xbabf('0x3f')]=_0x575947[_0xbabf('0x3f')];_0x4af367[_0xbabf('0x40')]=_0x575947[_0xbabf('0x40')];_0x4af367[_0xbabf('0x41')]=_0x575947[_0xbabf('0x41')];_0x4af367[_0xbabf('0x42')]=_0x575947['outboundNoSuchCallsDay'];_0x4af367[_0xbabf('0x43')]=_0x575947[_0xbabf('0x43')];_0x4af367[_0xbabf('0x44')]=_0x575947[_0xbabf('0x44')];_0x4af367[_0xbabf('0x45')]=_0x575947['outboundRejectCallsDay'];_0x4af367[_0xbabf('0x46')]=_0x575947[_0xbabf('0x46')];_0x4af367[_0xbabf('0x47')]=_0x575947[_0xbabf('0x47')];_0x4af367[_0xbabf('0x48')]=_0x575947[_0xbabf('0x48')];_0x4af367[_0xbabf('0x49')]=_0x575947['predictiveIntervalAvgTalktime'];_0x4af367[_0xbabf('0x4a')]=_0x575947[_0xbabf('0x4a')];_0x4af367[_0xbabf('0x4b')]=_0x575947['predictiveIntervalDroppedCallsTimeout'];_0x4af367[_0xbabf('0x4c')]=_0x575947[_0xbabf('0x4c')];_0x4af367['predictiveIntervalErlangCallsDroppedCalls']=_0x575947[_0xbabf('0x4d')];_0x4af367[_0xbabf('0x4e')]=_0x575947[_0xbabf('0x4e')];_0x4af367[_0xbabf('0x4f')]=_0x575947['predictiveIntervalMultiplicativeFactor'];_0x4af367['predictiveIntervalPauses']=_0x575947['predictiveIntervalPauses'];_0x4af367[_0xbabf('0x50')]=_0x575947[_0xbabf('0x50')];_0x4af367[_0xbabf('0x51')]=_0x575947[_0xbabf('0x51')];_0x4af367[_0xbabf('0x1d')]=_0x575947['message'];_0x4af367[_0xbabf('0x52')]=_0x575947['originated'];_0x4af367[_0xbabf('0x53')]=_0x575947[_0xbabf('0x53')];_0x4af367[_0xbabf('0x54')]=_0x575947[_0xbabf('0x54')];_0x4af367['erlangAbandonmentRate']=_0x575947[_0xbabf('0x55')];_0x4af367[_0xbabf('0x56')]=_0x575947['erlangBusyFactor'];_0x4af367[_0xbabf('0x57')]=_0x575947[_0xbabf('0x57')];_0x4af367['startProgressive']=_0x575947['startProgressive'];}if(_0x575947[_0xbabf('0x58')]){_0x4af367['Trunk']={'id':_0x575947['Trunk']['id'],'name':_0x575947['Trunk'][_0xbabf('0xc')],'active':_0x575947[_0xbabf('0x58')][_0xbabf('0x59')],'callerid':_0x575947[_0xbabf('0x58')]['callerid']};}if(_0x575947[_0xbabf('0x5a')]){_0x4af367[_0xbabf('0x5a')]={'id':_0x575947[_0xbabf('0x5a')]['id'],'name':_0x575947[_0xbabf('0x5a')][_0xbabf('0xc')]};}_0x14bd7b[_0xbabf('0x5b')](_0x4af367);}}_0x439338({'count':_0x14bd7b['length'],'rows':_0x14bd7b});});},'VoiceChannels':function(_0x18d247){return new Promise(function(_0x2c35b7,_0x5aaee9){var _0x59f5a4=_['values'](_0x5003eb[_0xbabf('0x5c')]);_0x2c35b7({'count':_0x59f5a4['length'],'rows':_0x59f5a4});});},'VoiceChannelMixMonitor':function(_0x225a2f){var _0x4b6826=this;return new Promise(function(_0x2c8d3d,_0x116a60){if(ami[_0xbabf('0x14')]()==![]){return _0x116a60(_0x4b6826[_0xbabf('0x1e')](0x1f4,[config[_0xbabf('0x15')]['ip'],config['asterisk'][_0xbabf('0x16')],_0xbabf('0x17')]['join']('\x20')));}var _0x335272=schema(properties[_0xbabf('0x5d')])[_0xbabf('0x3')](_0x225a2f);if(_0x335272[_0xbabf('0x5e')]>0x0){return _0x116a60(_0x4b6826[_0xbabf('0x1e')](0x1f4,_['map'](_0x335272,_0xbabf('0x1d'))[_0xbabf('0x18')](',\x20')));}var _0xf0038=_['find'](_0x5003eb[_0xbabf('0x5c')],{'uniqueid':_0x225a2f[_0xbabf('0x5f')]});if(_0xf0038&&_0xf0038['channel']){var _0x5705b9=util[_0xbabf('0x60')](_0xbabf('0x61'),_0x225a2f[_0xbabf('0x62')]||_0x225a2f['uniqueid'],_0x225a2f['format']||_0xbabf('0x63'));return ami['Action']({'action':'MixMonitor','channel':_0xf0038[_0xbabf('0x64')],'file':_0x5705b9,'options':_0xbabf('0x65')})['then'](function(_0x23015b){var _0x1b0805=_['find'](_0xf0038[_0xbabf('0x66')],{'filename':_0xbabf('0x67')+_0x5705b9[_0xbabf('0x68')]()});if(_[_0xbabf('0x69')](_0x1b0805)){_0xf0038[_0xbabf('0x66')][_0xbabf('0x5b')]({'filename':_0xbabf('0x67')+_0x5705b9[_0xbabf('0x68')](),'createdAt':moment()[_0xbabf('0x60')](_0xbabf('0x6a')),'mixmonitorid':_0x23015b[_0xbabf('0x6b')],'status':'rec'});}else{_0x1b0805[_0xbabf('0x6b')]=_0x23015b[_0xbabf('0x6b')];_0x1b0805[_0xbabf('0x6c')]=_0xbabf('0x6d');}_0x2c8d3d({'code':0xc8,'message':[_0x225a2f[_0xbabf('0x5f')],_0xbabf('0x6e'),_0x23015b[_0xbabf('0x6b')]]['join']('\x20'),'mixmonitorid':_0x23015b[_0xbabf('0x6b')]});})['catch'](function(_0xde7cbd){_0x116a60(_0x4b6826['error'](0x1f5,[_0x225a2f[_0xbabf('0x5f')],_0xde7cbd[_0xbabf('0x1d')][_0xbabf('0x68')]()][_0xbabf('0x18')]('\x20')));});}else{return _0x116a60(_0x4b6826['error'](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x204f36){var _0x148381=this;return new Promise(function(_0xd06fbf,_0x4c44a5){if(ami[_0xbabf('0x14')]()==![]){return _0x4c44a5(_0x148381[_0xbabf('0x1e')](0x1f4,[config[_0xbabf('0x15')]['ip'],config[_0xbabf('0x15')][_0xbabf('0x16')],_0xbabf('0x17')][_0xbabf('0x18')]('\x20')));}var _0x281388=schema(properties[_0xbabf('0x5d')])[_0xbabf('0x3')](_0x204f36);if(_0x281388[_0xbabf('0x5e')]>0x0){return _0x4c44a5(_0x148381[_0xbabf('0x1e')](0x1f4,_[_0xbabf('0x6f')](_0x281388,_0xbabf('0x1d'))[_0xbabf('0x18')](',\x20')));}var _0x20490e=_['find'](_0x5003eb[_0xbabf('0x5c')],{'uniqueid':_0x204f36[_0xbabf('0x5f')]});if(_0x20490e){return BPromise[_0xbabf('0x70')]()['then'](function(){if(_0x20490e['channel']){return ami[_0xbabf('0x1b')]({'action':_0xbabf('0x71'),'channel':_0x20490e[_0xbabf('0x64')],'mixmonitorid':_0x204f36[_0xbabf('0x6b')]})[_0xbabf('0x23')](function(_0x10c98c){});}})[_0xbabf('0x1c')](function(){if(_0x20490e['destinationchannel']){return ami[_0xbabf('0x1b')]({'action':_0xbabf('0x71'),'channel':_0x20490e['destinationchannel'],'mixmonitorid':_0x204f36[_0xbabf('0x6b')]})['catch'](function(_0x1b077c){});}})[_0xbabf('0x1c')](function(_0x327b8d){var _0x3c76da=_[_0xbabf('0x72')](_0x20490e[_0xbabf('0x66')],{'mixmonitorid':_0x204f36['mixmonitorid']});if(_0x3c76da){_0x3c76da['status']='stop';}})[_0xbabf('0x1c')](function(){var _0x54c9fa=util['format'](_0xbabf('0x61'),_0x204f36[_0xbabf('0x62')]||_0x204f36[_0xbabf('0x5f')],_0x204f36[_0xbabf('0x60')]||_0xbabf('0x63'));var _0x51c8f4=_['find'](_0x20490e[_0xbabf('0x66')],{'filename':'/var/spool/asterisk/monitor/'+_0x54c9fa[_0xbabf('0x68')]()});if(_0x51c8f4){_0x51c8f4[_0xbabf('0x6c')]=_0xbabf('0x73');}})[_0xbabf('0x1c')](function(){_0xd06fbf({'code':0xc8,'message':[_0x204f36[_0xbabf('0x5f')],_0xbabf('0x74')][_0xbabf('0x18')]('\x20')});})[_0xbabf('0x23')](function(_0x3fb054){_0x4c44a5(_0x148381[_0xbabf('0x1e')](0x1f5,[_0x204f36['uniqueid'],_0x3fb054[_0xbabf('0x1d')][_0xbabf('0x68')]()][_0xbabf('0x18')]('\x20')));});}else{return _0x4c44a5(_0x148381[_0xbabf('0x1e')](0x1f5,_0xbabf('0x75')));}});},'VoiceQueuesChannels':function(_0x4b39d1){return new Promise(function(_0x3a6290,_0x1f0352){var _0xd3d7c8=_[_0xbabf('0x76')](_0x5003eb[_0xbabf('0x77')]);_0x3a6290({'count':_0xd3d7c8['length'],'rows':_0xd3d7c8});});},'VoiceQueuesChannel':function(_0xab0742){var _0x3d5735=this;return new Promise(function(_0x59f070,_0x18c2a7){var _0x19ffed=schema(properties[_0xbabf('0x78')])[_0xbabf('0x3')](_0xab0742);if(_0x19ffed[_0xbabf('0x5e')]>0x0){return _0x18c2a7(_0x3d5735[_0xbabf('0x1e')](0x1f4,_[_0xbabf('0x6f')](_0x19ffed,'message')[_0xbabf('0x18')](',\x20')));}var _0x5c06d0=_[_0xbabf('0x72')](_0x5003eb[_0xbabf('0x77')],{'uniqueid':_0xab0742[_0xbabf('0x5f')]});if(_0x5c06d0){_0x59f070(_0x5c06d0);}else{return _0x18c2a7(_0x3d5735[_0xbabf('0x1e')](0x1f5,_0xbabf('0x75')));}});},'VoiceQueuesChannelHangup':function(_0x5836ef){var _0x3a3bda=this;return new Promise(function(_0x44afee,_0x23a739){if(ami['isConnected']()==![]){return _0x23a739(_0x3a3bda['error'](0x1f4,[config[_0xbabf('0x15')]['ip'],config[_0xbabf('0x15')][_0xbabf('0x16')],'ami\x20disconnected'][_0xbabf('0x18')]('\x20')));}var _0x33e2d0=schema(properties[_0xbabf('0x79')])[_0xbabf('0x3')](_0x5836ef);if(_0x33e2d0['length']>0x0){return _0x23a739(_0x3a3bda[_0xbabf('0x1e')](0x1f4,_[_0xbabf('0x6f')](_0x33e2d0,_0xbabf('0x1d'))[_0xbabf('0x18')](',\x20')));}var _0x484331=_[_0xbabf('0x72')](_0x5003eb['queueChannels'],{'uniqueid':_0x5836ef[_0xbabf('0x5f')]});if(_0x484331&&_0x484331[_0xbabf('0x64')]){return ami[_0xbabf('0x1b')]({'action':_0xbabf('0x7a'),'channel':_0x484331[_0xbabf('0x64')]})[_0xbabf('0x1c')](function(_0x390d61){_0x44afee({'code':0xc8,'message':[_0x5836ef[_0xbabf('0x5f')],_0x390d61['message'][_0xbabf('0x68')]()][_0xbabf('0x18')]('\x20')});})[_0xbabf('0x23')](function(_0x1abf58){_0x23a739(_0x3a3bda[_0xbabf('0x1e')](0x1f5,[_0x5836ef[_0xbabf('0x5f')],_0x1abf58[_0xbabf('0x1d')][_0xbabf('0x68')]()]['join']('\x20')));});}else{return _0x23a739(_0x3a3bda['error'](0x1f5,_0xbabf('0x75')));}});},'VoiceQueuesChannelRedirect':function(_0x101fd6){var _0x24c426=this;return new Promise(function(_0x39e1f9,_0x17ea70){if(ami[_0xbabf('0x14')]()==![]){return _0x17ea70(_0x24c426[_0xbabf('0x1e')](0x1f4,[config['asterisk']['ip'],config[_0xbabf('0x15')][_0xbabf('0x16')],_0xbabf('0x17')][_0xbabf('0x18')]('\x20')));}var _0x138d14=schema(properties[_0xbabf('0x7b')])['validate'](_0x101fd6);if(_0x138d14['length']>0x0){return _0x17ea70(_0x24c426[_0xbabf('0x1e')](0x1f4,_['map'](_0x138d14,_0xbabf('0x1d'))[_0xbabf('0x18')](',\x20')));}var _0x360007=_[_0xbabf('0x72')](_0x5003eb[_0xbabf('0x77')],{'uniqueid':_0x101fd6['uniqueid']});if(_0x360007&&_0x360007['channel']){return ami[_0xbabf('0x1b')]({'action':_0xbabf('0x7c'),'channel':_0x360007[_0xbabf('0x64')],'exten':_0x101fd6[_0xbabf('0x7d')],'context':_0x101fd6['context']||_0x360007['context'],'priority':0x1})[_0xbabf('0x1c')](function(_0x32e357){_0x39e1f9({'code':0xc8,'message':[_0x101fd6[_0xbabf('0x5f')],_0x32e357['message'][_0xbabf('0x68')]()]['join']('\x20')});})[_0xbabf('0x23')](function(_0x837d69){_0x17ea70(_0x24c426[_0xbabf('0x1e')](0x1f5,[_0x101fd6[_0xbabf('0x5f')],_0x837d69[_0xbabf('0x1d')][_0xbabf('0x68')]()][_0xbabf('0x18')]('\x20')));});}else{return _0x17ea70(_0x24c426[_0xbabf('0x1e')](0x1f5,_0xbabf('0x75')));}});},'Agents':function(_0x4177f2){return new Promise(function(_0x7e42f8,_0xf2b6e5){var _0x4fa53a=_[_0xbabf('0x76')](_0x5003eb[_0xbabf('0x10')]);_0x7e42f8({'count':_0x4fa53a[_0xbabf('0x5e')],'rows':_0x4fa53a});});},'Telephones':function(_0x1d11e9){return new Promise(function(_0x27732a,_0x346c5b){var _0x109245=_[_0xbabf('0x76')](_0x5003eb[_0xbabf('0x7e')]);_0x27732a({'count':_0x109245[_0xbabf('0x5e')],'rows':_0x109245});});},'Trunks':function(_0x1909ae){return new Promise(function(_0x32fa7d,_0x529fbc){var _0x138463=_[_0xbabf('0x76')](_0x5003eb[_0xbabf('0x7f')]);_0x32fa7d({'count':_0x138463[_0xbabf('0x5e')],'rows':_0x138463});});},'OutboundChannels':function(_0x523bae){return new Promise(function(_0x4995b5,_0xbc93d){var _0x3f30f3=_[_0xbabf('0x76')](_0x5003eb[_0xbabf('0x80')]);_0x4995b5({'count':_0x3f30f3[_0xbabf('0x5e')],'rows':_0x3f30f3});});},'Outbound':function(_0x2920d4){return new Promise(function(_0x553a94,_0x310b81){_0x553a94(_0x5003eb[_0xbabf('0x32')]);});},'Campaigns':function(_0x29824b){return new Promise(function(_0x5bcd66,_0x2c5372){var _0x237b53=_['values'](_0x5003eb['campaigns']);_0x5bcd66({'count':_0x237b53[_0xbabf('0x5e')],'rows':_0x237b53});});},'VoiceQueuesPreview':function(_0x3b4cfb){var _0x36005e=this;return new Promise(function(_0x541488,_0x1dcbcf){_0x5baaa0[_0xbabf('0x81')](_0x3b4cfb['id'])['then'](function(_0x32c43){_0x541488({'code':0xc8,'message':_0x32c43[_0xbabf('0x1d')]});})[_0xbabf('0x23')](function(_0x448930){_0x1dcbcf(_0x36005e[_0xbabf('0x1e')](0x1f4,_0x448930[_0xbabf('0x1d')]));});});},'EventManager':function(_0x10b9ee){var _0x88ff38=this;return new Promise(function(_0x4cbcfa,_0x5f425e){if(!_0x10b9ee[_0xbabf('0x82')]){return _0x5f425e(_0x88ff38[_0xbabf('0x1e')](0x1f4,_0xbabf('0x83')));}ami['emit'](_0xbabf('0x84')+_0x10b9ee[_0xbabf('0x82')],_0x10b9ee[_0xbabf('0x1d')]);_0x4cbcfa({'code':0xc8,'message':_0x10b9ee});});},'FaxAccounts':function(_0x2693d7){return new Promise(function(_0xdc249,_0x2feefa){var _0x561901=_[_0xbabf('0x76')](_0x5003eb[_0xbabf('0x85')]);_0xdc249({'count':_0x561901[_0xbabf('0x5e')],'rows':_0x561901});});},'SendFax':function(_0x109514){var _0x2d6f58=this;return new Promise(function(_0x58755e,_0x53ef4b){_0x39a0e7[_0xbabf('0x86')](_0x109514)[_0xbabf('0x1c')](function(_0x1aa94e){_0x58755e({'code':0xc8,'message':_0x1aa94e[_0xbabf('0x1d')]});})[_0xbabf('0x23')](function(_0x2b498d){_0x53ef4b(_0x2d6f58[_0xbabf('0x1e')](0x1f4,_0x2b498d[_0xbabf('0x1d')]));});});},'CheckAfterSend':function(_0x43bdb4){var _0x3c6792=this;return new Promise(function(_0xd551c8,_0x507087){_0x39a0e7['checkAfterSend'](_0x43bdb4)['then'](function(_0x594874){_0xd551c8({'code':0xc8,'message':_0x594874[_0xbabf('0x1d')]});})['catch'](function(_0x56f0d6){_0x507087(_0x3c6792[_0xbabf('0x1e')](0x1f4,_0x56f0d6[_0xbabf('0x1d')]));});});}};var _0x22701f=jayson[_0xbabf('0x87')](_0x5f2d4f)[_0xbabf('0x88')]();_0x22701f['on'](_0xbabf('0x1e'),function(_0x98ff57){return _0x52dd2a(_0x98ff57);});_0x22701f[_0xbabf('0x9')](0x232a,'127.0.0.1',function(){console[_0xbabf('0x89')](_0xbabf('0x8a'),0x232a);return _0x34ee1c(_0xbabf('0x8b')+0x232a);});});}; \ No newline at end of file +var _0x58c6=['outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','values','channels','username','map','find','channel','%s.%s','filename','uniqueid','wav','ai(mixmonitorid)','monitors','toLowerCase','isNil','/var/spool/asterisk/monitor/','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','rec','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','voicechannel','StopMixMonitor','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannelhangup','Hangup','Redirect','exten','context','telephones','trunks','outbound','campaigns','run','event','emit','custom:','faxAccounts','send','server','http','listen','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../properties','../ami','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','asterisk','join','pick','module','Reload','Action','then','message','catch','ami\x20disconnected','command','content','voiceQueues','hasOwnProperty','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','type','unmanaged','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay'];(function(_0x1320b0,_0x477275){var _0x5b8a46=function(_0x11d376){while(--_0x11d376){_0x1320b0['push'](_0x1320b0['shift']());}};_0x5b8a46(++_0x477275);}(_0x58c6,0x165));var _0x658c=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x58c6[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0x658c('0x0'));var util=require(_0x658c('0x1'));var jayson=require(_0x658c('0x2'));var schema=require(_0x658c('0x3'));var BPromise=require(_0x658c('0x4'));var moment=require(_0x658c('0x5'));var config=require(_0x658c('0x6'));var properties=require(_0x658c('0x7'));var ami=require(_0x658c('0x8'));exports['listen']=function(_0x714fe8,_0x46323c,_0x13329a){return new BPromise(function(_0x5ada86,_0x2e37f0){var _0x39cb66={'QueuePause':function(_0x3a04a7){return new Promise(function(_0x31e045,_0x12679c){var _0x551c89=util[_0x658c('0x9')](_0x658c('0xa'),_0x658c('0xb'),_0x3a04a7[_0x658c('0xc')]);if(_0x714fe8[_0x658c('0xd')]&&_0x714fe8[_0x658c('0xd')][_0x551c89]&&_0x714fe8['timers'][_0x551c89][_0x658c('0xe')]){_0x714fe8[_0x658c('0xd')][_0x551c89][_0x658c('0xf')]();}if(_0x714fe8[_0x658c('0x10')][_0x551c89]){_0x714fe8['agents'][_0x551c89]['updateStatusRealtime']({'statePause':_0x3a04a7[_0x658c('0x11')]?!![]:![]});}_0x31e045({'code':0xc8,'message':_0x658c('0x12')});});},'Reload':function(_0x50a483){var _0x420607=this;return new Promise(function(_0x179f97,_0x1c0dc0){if(ami[_0x658c('0x13')]()==![]){return _0x1c0dc0(_0x420607[_0x658c('0x14')](0x1f4,[config[_0x658c('0x15')]['ip'],config[_0x658c('0x15')]['username'],'ami\x20disconnected'][_0x658c('0x16')]('\x20')));}_0x50a483=_[_0x658c('0x17')](_0x50a483,_['keys'](properties[_0x658c('0x18')]));_0x50a483['action']=_0x658c('0x19');return ami[_0x658c('0x1a')](_0x50a483)[_0x658c('0x1b')](function(_0x4f3ee9){_0x179f97({'code':0xc8,'message':_0x4f3ee9[_0x658c('0x1c')]});})[_0x658c('0x1d')](function(_0x1f442d){_0x1c0dc0(_0x420607[_0x658c('0x14')](0x1f5,_0x1f442d[_0x658c('0x1c')]));});});},'Command':function(_0x5a6474){var _0x6cb896=this;return new Promise(function(_0x173d6d,_0x44df4b){if(ami['isConnected']()==![]){return _0x44df4b(_0x6cb896['error'](0x1f4,[config[_0x658c('0x15')]['ip'],config[_0x658c('0x15')]['username'],_0x658c('0x1e')][_0x658c('0x16')]('\x20')));}_0x5a6474=_[_0x658c('0x17')](_0x5a6474,_0x658c('0x1f'));_0x5a6474['action']='Command';return ami['Action'](_0x5a6474)['then'](function(_0x545351){_0x173d6d({'code':0xc8,'message':_0x545351[_0x658c('0x20')]});})[_0x658c('0x1d')](function(_0x7e7962){_0x44df4b(_0x6cb896[_0x658c('0x14')](0x1f5,_0x7e7962['message']));});});},'VoiceQueues':function(_0x75daa5){return new Promise(function(_0x54b1d1,_0x382ba1){var _0x2377fd=[];for(var _0x5e589c in _0x714fe8[_0x658c('0x21')]){if(_0x714fe8['voiceQueues'][_0x658c('0x22')](_0x5e589c)){var _0x463ceb=_0x714fe8['voiceQueues'][_0x5e589c];var _0x168f26={'id':_0x463ceb['id'],'name':_0x463ceb['name'],'strategy':_0x463ceb[_0x658c('0x23')],'answered':_0x463ceb[_0x658c('0x24')],'available':_0x463ceb[_0x658c('0x25')],'loggedIn':_0x463ceb[_0x658c('0x26')],'pTalking':_0x463ceb[_0x658c('0x27')],'sumBillable':_0x463ceb['sumBillable'],'sumDuration':_0x463ceb['sumDuration'],'sumHoldTime':_0x463ceb[_0x658c('0x28')]||0x0,'talking':_0x463ceb[_0x658c('0x29')],'total':_0x463ceb['total'],'type':_0x463ceb[_0x658c('0x2a')],'unmanaged':_0x463ceb[_0x658c('0x2b')],'abandoned':_0x463ceb[_0x658c('0x2c')],'waiting':_0x463ceb[_0x658c('0x2d')],'loggedInDb':_0x463ceb[_0x658c('0x2e')]};if(_0x463ceb[_0x658c('0x2a')]==='outbound'){_0x168f26['dialActive']=_0x463ceb[_0x658c('0x2f')];_0x168f26[_0x658c('0x30')]=_0x463ceb[_0x658c('0x30')];_0x168f26[_0x658c('0x31')]=_0x463ceb[_0x658c('0x31')];_0x168f26[_0x658c('0x32')]=_0x463ceb[_0x658c('0x32')];_0x168f26[_0x658c('0x33')]=_0x463ceb[_0x658c('0x33')];_0x168f26['dialPrefix']=_0x463ceb[_0x658c('0x34')];_0x168f26[_0x658c('0x35')]=_0x463ceb[_0x658c('0x35')];_0x168f26[_0x658c('0x36')]=_0x463ceb[_0x658c('0x36')];_0x168f26[_0x658c('0x37')]=_0x463ceb[_0x658c('0x37')];_0x168f26[_0x658c('0x38')]=_0x463ceb[_0x658c('0x38')];_0x168f26[_0x658c('0x39')]=_0x463ceb['outboundCongestionCallsDay'];_0x168f26[_0x658c('0x3a')]=_0x463ceb[_0x658c('0x3a')];_0x168f26[_0x658c('0x3b')]=_0x463ceb[_0x658c('0x3b')];_0x168f26[_0x658c('0x3c')]=_0x463ceb[_0x658c('0x3c')];_0x168f26[_0x658c('0x3d')]=_0x463ceb['outboundNoAnswerCallsDay'];_0x168f26[_0x658c('0x3e')]=_0x463ceb[_0x658c('0x3e')];_0x168f26['outboundOriginateFailureCallsDay']=_0x463ceb['outboundOriginateFailureCallsDay'];_0x168f26[_0x658c('0x3f')]=_0x463ceb[_0x658c('0x3f')];_0x168f26[_0x658c('0x40')]=_0x463ceb[_0x658c('0x40')];_0x168f26[_0x658c('0x41')]=_0x463ceb[_0x658c('0x41')];_0x168f26['predictiveIntervalAnsweredCalls']=_0x463ceb[_0x658c('0x42')];_0x168f26[_0x658c('0x43')]=_0x463ceb[_0x658c('0x43')];_0x168f26['predictiveIntervalAvgTalktime']=_0x463ceb[_0x658c('0x44')];_0x168f26[_0x658c('0x45')]=_0x463ceb[_0x658c('0x45')];_0x168f26[_0x658c('0x46')]=_0x463ceb['predictiveIntervalDroppedCallsTimeout'];_0x168f26[_0x658c('0x47')]=_0x463ceb[_0x658c('0x47')];_0x168f26[_0x658c('0x48')]=_0x463ceb[_0x658c('0x48')];_0x168f26['predictiveIntervalHitRate']=_0x463ceb[_0x658c('0x49')];_0x168f26[_0x658c('0x4a')]=_0x463ceb['predictiveIntervalMultiplicativeFactor'];_0x168f26[_0x658c('0x4b')]=_0x463ceb['predictiveIntervalPauses'];_0x168f26['predictiveIntervalAvailable']=_0x463ceb['predictiveIntervalAvailable'];_0x168f26[_0x658c('0x4c')]=_0x463ceb['predictiveIntervalTotalCalls'];_0x168f26[_0x658c('0x1c')]=_0x463ceb[_0x658c('0x1c')];_0x168f26[_0x658c('0x4d')]=_0x463ceb[_0x658c('0x4d')];_0x168f26[_0x658c('0x4e')]=_0x463ceb[_0x658c('0x4e')];_0x168f26[_0x658c('0x4f')]=_0x463ceb['erlangCallToSecond'];_0x168f26[_0x658c('0x50')]=_0x463ceb[_0x658c('0x50')];_0x168f26[_0x658c('0x51')]=_0x463ceb[_0x658c('0x51')];_0x168f26[_0x658c('0x52')]=_0x463ceb[_0x658c('0x52')];_0x168f26[_0x658c('0x53')]=_0x463ceb[_0x658c('0x53')];}if(_0x463ceb[_0x658c('0x54')]){_0x168f26[_0x658c('0x54')]={'id':_0x463ceb[_0x658c('0x54')]['id'],'name':_0x463ceb[_0x658c('0x54')]['name'],'active':_0x463ceb[_0x658c('0x54')][_0x658c('0x55')],'callerid':_0x463ceb[_0x658c('0x54')][_0x658c('0x56')]};}if(_0x463ceb[_0x658c('0x57')]){_0x168f26[_0x658c('0x57')]={'id':_0x463ceb[_0x658c('0x57')]['id'],'name':_0x463ceb['Interval']['name']};}_0x2377fd[_0x658c('0x58')](_0x168f26);}}_0x54b1d1({'count':_0x2377fd[_0x658c('0x59')],'rows':_0x2377fd});});},'VoiceChannels':function(_0x5c8813){return new Promise(function(_0x2e4788,_0x2c94bb){var _0x591fda=_[_0x658c('0x5a')](_0x714fe8[_0x658c('0x5b')]);_0x2e4788({'count':_0x591fda['length'],'rows':_0x591fda});});},'VoiceChannelMixMonitor':function(_0x565306){var _0x1d12c2=this;return new Promise(function(_0x3797d3,_0x40cfbe){if(ami[_0x658c('0x13')]()==![]){return _0x40cfbe(_0x1d12c2[_0x658c('0x14')](0x1f4,[config[_0x658c('0x15')]['ip'],config[_0x658c('0x15')][_0x658c('0x5c')],'ami\x20disconnected'][_0x658c('0x16')]('\x20')));}var _0x2db3c0=schema(properties['voicechannel'])[_0x658c('0x3')](_0x565306);if(_0x2db3c0[_0x658c('0x59')]>0x0){return _0x40cfbe(_0x1d12c2[_0x658c('0x14')](0x1f4,_[_0x658c('0x5d')](_0x2db3c0,_0x658c('0x1c'))[_0x658c('0x16')](',\x20')));}var _0x343a0b=_[_0x658c('0x5e')](_0x714fe8[_0x658c('0x5b')],{'uniqueid':_0x565306['uniqueid']});if(_0x343a0b&&_0x343a0b[_0x658c('0x5f')]){var _0x5c0fd9=util[_0x658c('0x9')](_0x658c('0x60'),_0x565306[_0x658c('0x61')]||_0x565306[_0x658c('0x62')],_0x565306['format']||_0x658c('0x63'));return ami['Action']({'action':'MixMonitor','channel':_0x343a0b[_0x658c('0x5f')],'file':_0x5c0fd9,'options':_0x658c('0x64')})[_0x658c('0x1b')](function(_0x20987c){var _0x30dbe8=_[_0x658c('0x5e')](_0x343a0b[_0x658c('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x5c0fd9[_0x658c('0x66')]()});if(_[_0x658c('0x67')](_0x30dbe8)){_0x343a0b[_0x658c('0x65')]['push']({'filename':_0x658c('0x68')+_0x5c0fd9[_0x658c('0x66')](),'createdAt':moment()[_0x658c('0x9')](_0x658c('0x69')),'mixmonitorid':_0x20987c['mixmonitorid'],'status':'rec'});}else{_0x30dbe8[_0x658c('0x6a')]=_0x20987c[_0x658c('0x6a')];_0x30dbe8[_0x658c('0x6b')]=_0x658c('0x6c');}_0x3797d3({'code':0xc8,'message':[_0x565306['uniqueid'],_0x658c('0x6d'),_0x20987c['mixmonitorid']][_0x658c('0x16')]('\x20'),'mixmonitorid':_0x20987c[_0x658c('0x6a')]});})[_0x658c('0x1d')](function(_0x4adb36){_0x40cfbe(_0x1d12c2[_0x658c('0x14')](0x1f5,[_0x565306[_0x658c('0x62')],_0x4adb36['message'][_0x658c('0x66')]()]['join']('\x20')));});}else{return _0x40cfbe(_0x1d12c2[_0x658c('0x14')](0x1f5,_0x658c('0x6e')));}});},'VoiceChannelStopMixMonitor':function(_0xbfae54){var _0x88e3b0=this;return new Promise(function(_0x26dd7d,_0x4cabe2){if(ami[_0x658c('0x13')]()==![]){return _0x4cabe2(_0x88e3b0[_0x658c('0x14')](0x1f4,[config[_0x658c('0x15')]['ip'],config[_0x658c('0x15')][_0x658c('0x5c')],_0x658c('0x1e')][_0x658c('0x16')]('\x20')));}var _0x2434d6=schema(properties[_0x658c('0x6f')])[_0x658c('0x3')](_0xbfae54);if(_0x2434d6['length']>0x0){return _0x4cabe2(_0x88e3b0[_0x658c('0x14')](0x1f4,_[_0x658c('0x5d')](_0x2434d6,_0x658c('0x1c'))[_0x658c('0x16')](',\x20')));}var _0x34792c=_[_0x658c('0x5e')](_0x714fe8[_0x658c('0x5b')],{'uniqueid':_0xbfae54['uniqueid']});if(_0x34792c){return BPromise['resolve']()[_0x658c('0x1b')](function(){if(_0x34792c[_0x658c('0x5f')]){return ami[_0x658c('0x1a')]({'action':'StopMixMonitor','channel':_0x34792c[_0x658c('0x5f')],'mixmonitorid':_0xbfae54['mixmonitorid']})['catch'](function(_0x2c3a83){});}})['then'](function(){if(_0x34792c['destinationchannel']){return ami[_0x658c('0x1a')]({'action':_0x658c('0x70'),'channel':_0x34792c['destinationchannel'],'mixmonitorid':_0xbfae54['mixmonitorid']})[_0x658c('0x1d')](function(_0x4f2b5c){});}})[_0x658c('0x1b')](function(_0x1a4d23){var _0x31e610=_[_0x658c('0x5e')](_0x34792c['monitors'],{'mixmonitorid':_0xbfae54[_0x658c('0x6a')]});if(_0x31e610){_0x31e610[_0x658c('0x6b')]=_0x658c('0x71');}})['then'](function(){var _0x31b176=util['format'](_0x658c('0x60'),_0xbfae54['filename']||_0xbfae54[_0x658c('0x62')],_0xbfae54[_0x658c('0x9')]||_0x658c('0x63'));var _0x3497a1=_[_0x658c('0x5e')](_0x34792c[_0x658c('0x65')],{'filename':'/var/spool/asterisk/monitor/'+_0x31b176['toLowerCase']()});if(_0x3497a1){_0x3497a1[_0x658c('0x6b')]=_0x658c('0x71');}})['then'](function(){_0x26dd7d({'code':0xc8,'message':[_0xbfae54[_0x658c('0x62')],_0x658c('0x72')][_0x658c('0x16')]('\x20')});})[_0x658c('0x1d')](function(_0xdd8a00){_0x4cabe2(_0x88e3b0[_0x658c('0x14')](0x1f5,[_0xbfae54[_0x658c('0x62')],_0xdd8a00[_0x658c('0x1c')][_0x658c('0x66')]()][_0x658c('0x16')]('\x20')));});}else{return _0x4cabe2(_0x88e3b0[_0x658c('0x14')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannels':function(_0x316a10){return new Promise(function(_0xd8091,_0x5a8011){var _0x4b5972=_['values'](_0x714fe8[_0x658c('0x73')]);_0xd8091({'count':_0x4b5972[_0x658c('0x59')],'rows':_0x4b5972});});},'VoiceQueuesChannel':function(_0x1a7f8d){var _0x39a1dd=this;return new Promise(function(_0x5afa9b,_0xabf7a9){var _0x4278d6=schema(properties['voicequeuechannel'])[_0x658c('0x3')](_0x1a7f8d);if(_0x4278d6['length']>0x0){return _0xabf7a9(_0x39a1dd[_0x658c('0x14')](0x1f4,_[_0x658c('0x5d')](_0x4278d6,_0x658c('0x1c'))[_0x658c('0x16')](',\x20')));}var _0x3581b0=_['find'](_0x714fe8[_0x658c('0x73')],{'uniqueid':_0x1a7f8d['uniqueid']});if(_0x3581b0){_0x5afa9b(_0x3581b0);}else{return _0xabf7a9(_0x39a1dd['error'](0x1f5,_0x658c('0x6e')));}});},'VoiceQueuesChannelHangup':function(_0x434b24){var _0x446512=this;return new Promise(function(_0x8c7349,_0x150615){if(ami['isConnected']()==![]){return _0x150615(_0x446512['error'](0x1f4,[config[_0x658c('0x15')]['ip'],config[_0x658c('0x15')][_0x658c('0x5c')],_0x658c('0x1e')][_0x658c('0x16')]('\x20')));}var _0x2ad648=schema(properties[_0x658c('0x74')])['validate'](_0x434b24);if(_0x2ad648[_0x658c('0x59')]>0x0){return _0x150615(_0x446512[_0x658c('0x14')](0x1f4,_[_0x658c('0x5d')](_0x2ad648,'message')[_0x658c('0x16')](',\x20')));}var _0x2f8458=_[_0x658c('0x5e')](_0x714fe8[_0x658c('0x73')],{'uniqueid':_0x434b24[_0x658c('0x62')]});if(_0x2f8458&&_0x2f8458[_0x658c('0x5f')]){return ami[_0x658c('0x1a')]({'action':_0x658c('0x75'),'channel':_0x2f8458[_0x658c('0x5f')]})[_0x658c('0x1b')](function(_0x422bd7){_0x8c7349({'code':0xc8,'message':[_0x434b24[_0x658c('0x62')],_0x422bd7[_0x658c('0x1c')]['toLowerCase']()][_0x658c('0x16')]('\x20')});})[_0x658c('0x1d')](function(_0x5c619d){_0x150615(_0x446512[_0x658c('0x14')](0x1f5,[_0x434b24[_0x658c('0x62')],_0x5c619d[_0x658c('0x1c')][_0x658c('0x66')]()]['join']('\x20')));});}else{return _0x150615(_0x446512[_0x658c('0x14')](0x1f5,_0x658c('0x6e')));}});},'VoiceQueuesChannelRedirect':function(_0x48de74){var _0x559d79=this;return new Promise(function(_0x35c700,_0xd1c512){if(ami[_0x658c('0x13')]()==![]){return _0xd1c512(_0x559d79['error'](0x1f4,[config[_0x658c('0x15')]['ip'],config[_0x658c('0x15')][_0x658c('0x5c')],_0x658c('0x1e')][_0x658c('0x16')]('\x20')));}var _0x1ae523=schema(properties['voicequeuechannelredirect'])['validate'](_0x48de74);if(_0x1ae523[_0x658c('0x59')]>0x0){return _0xd1c512(_0x559d79['error'](0x1f4,_['map'](_0x1ae523,_0x658c('0x1c'))[_0x658c('0x16')](',\x20')));}var _0x2833d3=_['find'](_0x714fe8[_0x658c('0x73')],{'uniqueid':_0x48de74[_0x658c('0x62')]});if(_0x2833d3&&_0x2833d3[_0x658c('0x5f')]){return ami[_0x658c('0x1a')]({'action':_0x658c('0x76'),'channel':_0x2833d3[_0x658c('0x5f')],'exten':_0x48de74[_0x658c('0x77')],'context':_0x48de74['context']||_0x2833d3[_0x658c('0x78')],'priority':0x1})[_0x658c('0x1b')](function(_0x17d117){_0x35c700({'code':0xc8,'message':[_0x48de74[_0x658c('0x62')],_0x17d117[_0x658c('0x1c')][_0x658c('0x66')]()]['join']('\x20')});})[_0x658c('0x1d')](function(_0x7dc5ec){_0xd1c512(_0x559d79['error'](0x1f5,[_0x48de74[_0x658c('0x62')],_0x7dc5ec[_0x658c('0x1c')][_0x658c('0x66')]()][_0x658c('0x16')]('\x20')));});}else{return _0xd1c512(_0x559d79['error'](0x1f5,_0x658c('0x6e')));}});},'Agents':function(_0x85802e){return new Promise(function(_0x2a4221,_0x539eac){var _0x2324a9=_[_0x658c('0x5a')](_0x714fe8[_0x658c('0x10')]);_0x2a4221({'count':_0x2324a9[_0x658c('0x59')],'rows':_0x2324a9});});},'Telephones':function(_0x1cae1d){return new Promise(function(_0x5a06fb,_0x3a7a5c){var _0x5021a3=_['values'](_0x714fe8[_0x658c('0x79')]);_0x5a06fb({'count':_0x5021a3[_0x658c('0x59')],'rows':_0x5021a3});});},'Trunks':function(_0x3a4ce0){return new Promise(function(_0x48f520,_0x4b94ae){var _0x894298=_[_0x658c('0x5a')](_0x714fe8[_0x658c('0x7a')]);_0x48f520({'count':_0x894298[_0x658c('0x59')],'rows':_0x894298});});},'OutboundChannels':function(_0x3a08da){return new Promise(function(_0x3d7657,_0x341475){var _0x545735=_[_0x658c('0x5a')](_0x714fe8['outboundChannels']);_0x3d7657({'count':_0x545735[_0x658c('0x59')],'rows':_0x545735});});},'Outbound':function(_0x1f2744){return new Promise(function(_0x57c03d,_0x2bd1e1){_0x57c03d(_0x714fe8[_0x658c('0x7b')]);});},'Campaigns':function(_0x4c746f){return new Promise(function(_0x183bdc,_0x25bb49){var _0xc98cb0=_[_0x658c('0x5a')](_0x714fe8[_0x658c('0x7c')]);_0x183bdc({'count':_0xc98cb0[_0x658c('0x59')],'rows':_0xc98cb0});});},'VoiceQueuesPreview':function(_0x3457b0){var _0xcd7e27=this;return new Promise(function(_0x421774,_0x538be9){_0x46323c[_0x658c('0x7d')](_0x3457b0['id'])['then'](function(_0x17cb57){_0x421774({'code':0xc8,'message':_0x17cb57['message']});})[_0x658c('0x1d')](function(_0x6aad5){_0x538be9(_0xcd7e27[_0x658c('0x14')](0x1f4,_0x6aad5[_0x658c('0x1c')]));});});},'EventManager':function(_0x11fc94){var _0x187b49=this;return new Promise(function(_0x26c730,_0x4bb9ce){if(!_0x11fc94[_0x658c('0x7e')]){return _0x4bb9ce(_0x187b49[_0x658c('0x14')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0x658c('0x7f')](_0x658c('0x80')+_0x11fc94['event'],_0x11fc94[_0x658c('0x1c')]);_0x26c730({'code':0xc8,'message':_0x11fc94});});},'FaxAccounts':function(_0x5a57c4){return new Promise(function(_0x27e49e,_0x2532c5){var _0x2cfd56=_['values'](_0x714fe8[_0x658c('0x81')]);_0x27e49e({'count':_0x2cfd56['length'],'rows':_0x2cfd56});});},'SendFax':function(_0xd2c2c0){var _0x69c0cb=this;return new Promise(function(_0x5645df,_0x2b79f5){_0x13329a[_0x658c('0x82')](_0xd2c2c0)[_0x658c('0x1b')](function(_0x56316){_0x5645df({'code':0xc8,'message':_0x56316[_0x658c('0x1c')]});})[_0x658c('0x1d')](function(_0x1a90d3){_0x2b79f5(_0x69c0cb[_0x658c('0x14')](0x1f4,_0x1a90d3[_0x658c('0x1c')]));});});},'CheckAfterSend':function(_0x405484){var _0x4994f8=this;return new Promise(function(_0x4c40db,_0x256ded){_0x13329a['checkAfterSend'](_0x405484)[_0x658c('0x1b')](function(_0x557470){_0x4c40db({'code':0xc8,'message':_0x557470[_0x658c('0x1c')]});})['catch'](function(_0x3fb03f){_0x256ded(_0x4994f8[_0x658c('0x14')](0x1f4,_0x3fb03f[_0x658c('0x1c')]));});});}};var _0x209d07=jayson[_0x658c('0x83')](_0x39cb66)[_0x658c('0x84')]();_0x209d07['on'](_0x658c('0x14'),function(_0x4fcad8){return _0x2e37f0(_0x4fcad8);});_0x209d07[_0x658c('0x85')](0x232a,_0x658c('0x86'),function(){console[_0x658c('0x87')](_0x658c('0x88'),0x232a);return _0x5ada86(_0x658c('0x89')+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index 9f684ef..04ba768 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 _0xd98a=['localhost','socket.io-emitter','info','stringify','exec','data2','data1','calleridnum','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','showContact','omit','then','xmd-contactid2','format','user:%s','trigger:%s','toLowerCase','merge','createContact','name','action','error','Error\x20creating\x20contact','bluebird','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis'];(function(_0x462f72,_0x549f9f){var _0x575074=function(_0x2b343d){while(--_0x2b343d){_0x462f72['push'](_0x462f72['shift']());}};_0x575074(++_0x549f9f);}(_0xd98a,0xfc));var _0xad98=function(_0x5b6130,_0x286080){_0x5b6130=_0x5b6130-0x0;var _0x3f65ca=_0xd98a[_0x5b6130];return _0x3f65ca;};'use strict';var BPromise=require(_0xad98('0x0'));var util=require('util');var _=require('lodash');var Redis=require(_0xad98('0x1'));var config=require(_0xad98('0x2'));var logger=require(_0xad98('0x3'))(_0xad98('0x4'));var cmContactRpc=require(_0xad98('0x5'));config[_0xad98('0x6')]=_['defaults'](config['redis'],{'host':_0xad98('0x7'),'port':0x18eb});var io=require(_0xad98('0x8'))(new Redis(config[_0xad98('0x6')]));function emit(_0x2cd316,_0x2bf76c,_0x480c93){logger[_0xad98('0x9')](_0x2cd316,_0x2bf76c,JSON[_0xad98('0xa')](_0x480c93));io['to'](_0x2cd316)['emit'](_0x2bf76c,_0x480c93);}exports[_0xad98('0xb')]=function(_0x5016b4,_0x145cbe,_0x525e32){_0x525e32['autoCreate']=0x0;if(_0x145cbe['data2']&&parseInt(_0x145cbe[_0xad98('0xc')],0xa)){var _0x544f93={'ListId':parseInt(_0x145cbe[_0xad98('0xd')],0xa),'phone':_0x525e32[_0xad98('0xe')]};if(_['isNil'](_0x525e32['routeId'])){_0x544f93[_0xad98('0xf')]=_0x525e32[_0xad98('0x10')]&&_0x525e32[_0xad98('0x10')]!==_0xad98('0x11')?_0x525e32[_0xad98('0x10')]:_0x525e32[_0xad98('0xe')]||_0x525e32[_0xad98('0x12')];}else{_0x544f93[_0xad98('0xf')]=_0x525e32[_0xad98('0x13')]&&_0x525e32['destcalleridname']!==_0xad98('0x11')?_0x525e32[_0xad98('0x13')]:_0x525e32[_0xad98('0x14')]||_0x525e32[_0xad98('0x12')];_0x544f93[_0xad98('0x15')]=_0x525e32[_0xad98('0x13')]&&_0x525e32[_0xad98('0x13')]!==_0xad98('0x11')?_0x525e32[_0xad98('0x13')]:_0x525e32['destcalleridnum']||_0x525e32['uniqueid'];}BPromise[_0xad98('0x16')]()['then'](cmContactRpc[_0xad98('0x17')]({'where':_[_0xad98('0x18')](_0x544f93,[_0xad98('0xf')])}))[_0xad98('0x19')](function(_0x32954a){if(_0x32954a){_0x525e32[_0xad98('0x1a')]=_0x32954a['id'];emit(util[_0xad98('0x1b')](_0xad98('0x1c'),_0x5016b4['name']),util['format'](_0xad98('0x1d'),_0x145cbe['action'][_0xad98('0x1e')]()),_[_0xad98('0x1f')](_0x525e32,{'ListId':parseInt(_0x145cbe[_0xad98('0xd')],0xa)}));return;}else{return BPromise[_0xad98('0x16')]()[_0xad98('0x19')](cmContactRpc[_0xad98('0x20')](_0x544f93));}})[_0xad98('0x19')](function(_0x167236){if(_0x167236){_0x525e32[_0xad98('0x1a')]=_0x167236['id'];emit(util[_0xad98('0x1b')](_0xad98('0x1c'),_0x5016b4[_0xad98('0x21')]),util[_0xad98('0x1b')]('trigger:%s',_0x145cbe[_0xad98('0x22')][_0xad98('0x1e')]()),_[_0xad98('0x1f')](_0x525e32,{'ListId':parseInt(_0x145cbe[_0xad98('0xd')],0xa)}));}})['catch'](function(_0x590b77){logger[_0xad98('0x23')](_0xad98('0x24'),JSON[_0xad98('0xa')](_0x590b77));});}else{if(_0x5016b4){emit(util[_0xad98('0x1b')](_0xad98('0x1c'),_0x5016b4[_0xad98('0x21')]),util[_0xad98('0x1b')]('trigger:%s',_0x145cbe[_0xad98('0x22')][_0xad98('0x1e')]()),_[_0xad98('0x1f')]({'ListId':parseInt(_0x145cbe[_0xad98('0xd')],0xa)},_0x525e32));}}}; \ No newline at end of file +var _0x15b8=['../../rpc/cmContact','redis','defaults','localhost','socket.io-emitter','info','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','routeId','calleridname','','firstName','destcalleridname','destcalleridnum','uniqueid','resolve','then','showContact','omit','format','user:%s','name','trigger:%s','toLowerCase','merge','createContact','xmd-contactid2','action','catch','error','Error\x20creating\x20contact','util','lodash','ioredis','../../../../config/environment','../../../../config/logger'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x15b8,0xcd));var _0x815b=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0x15b8[_0x50a0c2];return _0x5ebadd;};'use strict';var BPromise=require('bluebird');var util=require(_0x815b('0x0'));var _=require(_0x815b('0x1'));var Redis=require(_0x815b('0x2'));var config=require(_0x815b('0x3'));var logger=require(_0x815b('0x4'))('trigger');var cmContactRpc=require(_0x815b('0x5'));config[_0x815b('0x6')]=_[_0x815b('0x7')](config[_0x815b('0x6')],{'host':_0x815b('0x8'),'port':0x18eb});var io=require(_0x815b('0x9'))(new Redis(config['redis']));function emit(_0x1e9fc0,_0xdfdf6,_0x26119a){logger[_0x815b('0xa')](_0x1e9fc0,_0xdfdf6,JSON[_0x815b('0xb')](_0x26119a));io['to'](_0x1e9fc0)[_0x815b('0xc')](_0xdfdf6,_0x26119a);}exports[_0x815b('0xd')]=function(_0x221ce4,_0x128f27,_0x291da6){_0x291da6[_0x815b('0xe')]=0x0;if(_0x128f27[_0x815b('0xf')]&&parseInt(_0x128f27[_0x815b('0xf')],0xa)){var _0x2340c5={'ListId':parseInt(_0x128f27[_0x815b('0x10')],0xa),'phone':_0x291da6[_0x815b('0x11')]};if(_[_0x815b('0x12')](_0x291da6[_0x815b('0x13')])){_0x2340c5['firstName']=_0x291da6['calleridname']&&_0x291da6[_0x815b('0x14')]!==_0x815b('0x15')?_0x291da6['calleridname']:_0x291da6['calleridnum']||_0x291da6['uniqueid'];}else{_0x2340c5[_0x815b('0x16')]=_0x291da6['destcalleridname']&&_0x291da6['destcalleridname']!==_0x815b('0x15')?_0x291da6[_0x815b('0x17')]:_0x291da6[_0x815b('0x18')]||_0x291da6['uniqueid'];_0x2340c5['phone']=_0x291da6[_0x815b('0x17')]&&_0x291da6[_0x815b('0x17')]!==_0x815b('0x15')?_0x291da6[_0x815b('0x17')]:_0x291da6[_0x815b('0x18')]||_0x291da6[_0x815b('0x19')];}BPromise[_0x815b('0x1a')]()[_0x815b('0x1b')](cmContactRpc[_0x815b('0x1c')]({'where':_[_0x815b('0x1d')](_0x2340c5,[_0x815b('0x16')])}))[_0x815b('0x1b')](function(_0x3daa0d){if(_0x3daa0d){_0x291da6['xmd-contactid2']=_0x3daa0d['id'];emit(util[_0x815b('0x1e')](_0x815b('0x1f'),_0x221ce4[_0x815b('0x20')]),util[_0x815b('0x1e')](_0x815b('0x21'),_0x128f27['action'][_0x815b('0x22')]()),_[_0x815b('0x23')](_0x291da6,{'ListId':parseInt(_0x128f27[_0x815b('0x10')],0xa)}));return;}else{return BPromise['resolve']()['then'](cmContactRpc[_0x815b('0x24')](_0x2340c5));}})[_0x815b('0x1b')](function(_0x30208e){if(_0x30208e){_0x291da6[_0x815b('0x25')]=_0x30208e['id'];emit(util[_0x815b('0x1e')](_0x815b('0x1f'),_0x221ce4[_0x815b('0x20')]),util['format']('trigger:%s',_0x128f27[_0x815b('0x26')][_0x815b('0x22')]()),_[_0x815b('0x23')](_0x291da6,{'ListId':parseInt(_0x128f27[_0x815b('0x10')],0xa)}));}})[_0x815b('0x27')](function(_0x3115c7){logger[_0x815b('0x28')](_0x815b('0x29'),JSON['stringify'](_0x3115c7));});}else{if(_0x221ce4){emit(util[_0x815b('0x1e')](_0x815b('0x1f'),_0x221ce4[_0x815b('0x20')]),util['format'](_0x815b('0x21'),_0x128f27[_0x815b('0x26')]['toLowerCase']()),_[_0x815b('0x23')]({'ListId':parseInt(_0x128f27[_0x815b('0x10')],0xa)},_0x291da6));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index dffb56f..742c1b5 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 _0x4692=['custom:rejectmessage','prototype','emit','info','stringify','clone','checkTriggers','interface','triggers','hasOwnProperty','status','merge','variables','Actions','length','toLowerCase','contactmanager','motionbar','browser','data1','TemplateId','data2','template\x20not\x20found','uri','buildUri','data3','isNil','data4','uriLocation','windowWidth','data5','800','data6','600','render','format','user:%s','action','jscripty','name','trigger:%s','exec','integration','queue','routeId','urlforward','script','parse','query','replace','checkTrigger','AllConditions','checkConditions','channel','AnyConditions','chat','value','upperFirst','operator','AccountId','interaction','message','event','membername','lastevent','exports','util','url','mustache','ioredis','./urlforward','./integration','./cmContact','../rpc/cmContact','../../../config/environment','../../../config/logger','trigger','../ami','redis','defaults','popup','winapp','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','accounts','servicenowAccounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','syncAgentDial','custom:dialconnect','custom:dialend','custom:incomingmessage','custom:outgoingmessage','custom:acceptmessage'];(function(_0x209941,_0x5c9988){var _0x1e8729=function(_0x51a9b8){while(--_0x51a9b8){_0x209941['push'](_0x209941['shift']());}};_0x1e8729(++_0x5c9988);}(_0x4692,0x1ea));var _0x2469=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0x4692[_0x5bd426];return _0x23a7eb;};'use strict';var util=require(_0x2469('0x0'));var _=require('lodash');var url=require(_0x2469('0x1'));var Mustache=require(_0x2469('0x2'));var Redis=require(_0x2469('0x3'));var urlforward=require(_0x2469('0x4'));var integration=require(_0x2469('0x5'));var cmContact=require(_0x2469('0x6'));var script=require('./script');var cmContactRpc=require(_0x2469('0x7'));var config=require(_0x2469('0x8'));var logger=require(_0x2469('0x9'))(_0x2469('0xa'));var ami=require(_0x2469('0xb'));config[_0x2469('0xc')]=_[_0x2469('0xd')](config[_0x2469('0xc')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var operators={'equals':function(_0x2c2cb8,_0x23d241){return _0x2c2cb8==_0x23d241;},'not_equals':function(_0x2eafec,_0x9b10d8){return _0x2eafec!=_0x9b10d8;}};var barAndWebActions=[_0x2469('0xe'),_0x2469('0x1'),_0x2469('0xf')];function Trigger(_0x5abea7){this['triggers']=_0x5abea7['triggers'];this['agents']=_0x5abea7[_0x2469('0x10')];this[_0x2469('0x11')]=_0x5abea7[_0x2469('0x11')];this[_0x2469('0x12')]=_0x5abea7['templates'];this[_0x2469('0x13')]=_0x5abea7[_0x2469('0x13')];this[_0x2469('0x14')]=_0x5abea7[_0x2469('0x14')];this[_0x2469('0x15')]=_0x5abea7['freshdeskAccounts'];this['salesforceAccounts']=_0x5abea7[_0x2469('0x16')];this[_0x2469('0x17')]=_0x5abea7['sugarcrmAccounts'];this[_0x2469('0x18')]=_0x5abea7['zohoAccounts'];this[_0x2469('0x19')]=_0x5abea7[_0x2469('0x19')];this[_0x2469('0x1a')]=_0x5abea7['vtigerAccounts'];this['servicenowAccounts']=_0x5abea7['servicenowAccounts'];this[_0x2469('0x1b')]=_0x5abea7[_0x2469('0x1b')];this[_0x2469('0x1c')]={'zendesk':this[_0x2469('0x14')],'salesforce':this[_0x2469('0x16')],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x2469('0x17')],'zoho':this[_0x2469('0x18')],'desk':this[_0x2469('0x19')],'vtiger':this[_0x2469('0x1a')],'servicenow':this[_0x2469('0x1d')],'dynamics365':this[_0x2469('0x1b')]};ami['on'](_0x2469('0x1e'),this[_0x2469('0x1f')][_0x2469('0x20')](this));ami['on'](_0x2469('0x21'),this[_0x2469('0x1f')][_0x2469('0x20')](this));ami['on']('custom:agentringnoanswer',this[_0x2469('0x1f')]['bind'](this));ami['on']('custom:agentcomplete',this[_0x2469('0x1f')][_0x2469('0x20')](this));ami['on']('custom:queuecallerabandon',this[_0x2469('0x1f')][_0x2469('0x20')](this));ami['on']('custom:dialbegin',this[_0x2469('0x22')]['bind'](this));ami['on'](_0x2469('0x23'),this[_0x2469('0x22')][_0x2469('0x20')](this));ami['on'](_0x2469('0x24'),this['syncAgentDial'][_0x2469('0x20')](this));ami['on']('custom:newinteraction',this['syncCustomEvent'][_0x2469('0x20')](this));ami['on']('custom:closedinteraction',this[_0x2469('0x1f')][_0x2469('0x20')](this));ami['on'](_0x2469('0x25'),this['syncCustomEvent']['bind'](this));ami['on'](_0x2469('0x26'),this[_0x2469('0x1f')][_0x2469('0x20')](this));ami['on'](_0x2469('0x27'),this[_0x2469('0x1f')]['bind'](this));ami['on'](_0x2469('0x28'),this[_0x2469('0x1f')][_0x2469('0x20')](this));}Trigger[_0x2469('0x29')][_0x2469('0x2a')]=function(_0x161598,_0x39e5d4,_0x48def7){logger[_0x2469('0x2b')](_0x161598,_0x39e5d4,JSON[_0x2469('0x2c')](_0x48def7));io['to'](_0x161598)[_0x2469('0x2a')](_0x39e5d4,_0x48def7);};Trigger[_0x2469('0x29')][_0x2469('0x1f')]=function(_0x10351a){var _0x2f9c46=_[_0x2469('0x2d')](_0x10351a);this[_0x2469('0x2e')](_0x2f9c46);};Trigger[_0x2469('0x29')][_0x2469('0x22')]=function(_0x186c3d){if(this[_0x2469('0x10')][_0x186c3d[_0x2469('0x2f')]]){this[_0x2469('0x1f')](_0x186c3d);}};Trigger['prototype'][_0x2469('0x2e')]=function(_0x515e49){var _0x3000b6;for(var _0x398668 in this[_0x2469('0x30')]){if(this[_0x2469('0x30')][_0x2469('0x31')](_0x398668)){if(this[_0x2469('0x30')][_0x398668][_0x2469('0x32')]){_0x3000b6=this['checkTrigger'](this[_0x2469('0x30')][_0x398668],_0x515e49);if(_0x3000b6){_[_0x2469('0x33')](_0x515e49,_0x515e49[_0x2469('0x34')]);for(var _0x569a5e=0x0,_0x60bf11,_0x1b8843,_0x26fc6f;_0x569a5e0x0){_0x358445=_[_0x8934('0x2a')](_0x3db790,_0x249031);}return _0x358445;}function getCustomFields(_0x20d448,_0x3f328a){var _0x457634=[];var _0x9c6a71={'custom_fields':{}};if(_0x20d448[_0x8934('0x29')]>0x0){_['forEach'](_0x20d448,function(_0x1d068c){if(_0x1d068c[_0x8934('0x2b')]==='string'&&_0x1d068c[_0x8934('0x2c')]&&!_0x1d068c[_0x8934('0x2d')]){_0x9c6a71[_0x1d068c[_0x8934('0x2c')][_0x8934('0x2e')]()]=_0x1d068c['content'][_0x8934('0x23')]();}else if(_0x1d068c[_0x8934('0x2b')]===_0x8934('0x2f')&&_0x1d068c[_0x8934('0x30')]&&_0x1d068c[_0x8934('0x2d')]){_0x9c6a71['custom_fields'][_0x1d068c[_0x8934('0x30')]]=_0x1d068c['content']['toString']();}else if(_0x1d068c[_0x8934('0x2b')]===_0x8934('0x31')&&_0x1d068c[_0x8934('0x32')]&&_0x1d068c[_0x8934('0x30')]&&_0x1d068c['customField']){_0x3f328a[_0x1d068c[_0x8934('0x32')]]&&(_0x9c6a71[_0x8934('0x33')][_0x1d068c[_0x8934('0x30')]]=_0x3f328a[_0x1d068c[_0x8934('0x32')]][_0x8934('0x23')]());}else if(_0x1d068c['type']===_0x8934('0x34')&&_0x1d068c[_0x8934('0x35')]&&_0x1d068c['Variable']['name']&&_0x1d068c[_0x8934('0x30')]&&_0x1d068c[_0x8934('0x2d')]){_0x3f328a[_0x1d068c['Variable']['name'][_0x8934('0x2e')]()]&&(_0x9c6a71[_0x8934('0x33')][_0x1d068c[_0x8934('0x30')]]=_0x3f328a[_0x1d068c[_0x8934('0x35')][_0x8934('0x36')][_0x8934('0x2e')]()][_0x8934('0x23')]());}});}if(_0x9c6a71[_0x8934('0x37')]){_0x9c6a71[_0x8934('0x37')]=Number(_0x9c6a71[_0x8934('0x37')]);}return _0x9c6a71;}function getTicket(_0x46611c,_0x50b477,_0x31c805,_0x180236,_0x524139){logger[_0x8934('0x15')](_0x8934('0x38'));var _0x414091=_[_0x8934('0x39')]({'subject':intUtil[_0x8934('0x3a')](_0x180236['Subjects'],_0x524139,'\x20'),'type':'phone','status':'new','labels':[_0x8934('0x3b'),_0x8934('0x3c'),_0x8934('0x3d')]['concat'](getTags(_0x180236[_0x8934('0x3e')],'name')),'description':intUtil['getString'](_0x180236[_0x8934('0x3f')],_0x524139,'\x0a'),'_links':{'assigned_user':{'href':util[_0x8934('0xe')]('/api/v2/users/%d',_0x50b477['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0x8934('0x3a')](_0x180236[_0x8934('0x3f')],_0x524139,'\x0a')}},getCustomFields(_0x180236[_0x8934('0x40')],_0x524139));return request({'uri':util['format'](_0x8934('0x41'),_0x46611c['remoteUri'],_0x31c805['id']),'method':_0x8934('0x28'),'body':_0x414091});}exports['queue']=function(_0x3cd028,_0x476ed9,_0x83be9e,_0x566d67,_0xefdfab,_0x350d04){var _0x2d291e,_0x1e339a;_0x350d04['remoteUri']=intUtil[_0x8934('0x42')](_0x350d04[_0x8934('0x10')]);_0x350d04[_0x8934('0x43')]=intUtil[_0x8934('0x42')](_0x350d04[_0x8934('0x43')]);if(_0xefdfab&&_0xefdfab[_0x8934('0x44')]){logger[_0x8934('0x15')](_0x8934('0x45'),'Recording\x20is\x20enabled!');_0x476ed9['recordingURL']=util['format'](_0x8934('0x46'),_0x350d04[_0x8934('0x43')],_0x476ed9['uniqueid'],md5(_0x476ed9[_0x8934('0x47')]));}else{_0x476ed9['recordingURL']='';}headers[_0x8934('0x48')]=getAuth(_0x350d04);return getUser(_0x350d04,_0x566d67[_0x8934('0x49')])['then'](function(_0x3561da){_0x2d291e=_0x3561da;logger[_0x8934('0x15')](_0x8934('0x4a'),_0x2d291e['id']);return getEndUser(_0x350d04,_0x476ed9[_0x8934('0x4b')],_0x476ed9['calleridnum']);})[_0x8934('0x11')](function(_0xa35ac9){_0x1e339a=_0xa35ac9;logger['info'](_0x8934('0x4c'),_0x1e339a['id']);return getTicket(_0x350d04,_0x2d291e,_0x1e339a,_0x83be9e,_0x476ed9);})[_0x8934('0x11')](function(_0x27a98c){if(_0x27a98c){logger[_0x8934('0x15')](_0x8934('0x4d'));logger[_0x8934('0x15')](_0x8934('0x4e'),_0x27a98c['id']);switch(_0x350d04[_0x8934('0x2b')]){case _0x8934('0x4f'):logger[_0x8934('0x15')](_0x8934('0x45'),_0x8934('0x50'));emit(util[_0x8934('0xe')](_0x8934('0x51'),_0x566d67[_0x8934('0x36')]),_0x8934('0x52'),{'recordId':_0x27a98c['id']});break;case _0x8934('0x53'):logger[_0x8934('0x15')]('[QUEUE]',_0x8934('0x54'));emit(util[_0x8934('0xe')]('user:%s',_0x566d67['name']),'trigger:browser:url',{'uri':util['format'](_0x8934('0x55'),_0x27a98c['id'])});break;default:logger[_0x8934('0x56')](_0x8934('0x45'),'Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x16eb4d){console['error'](_0x16eb4d);logger['error'](_0x8934('0x45'),JSON[_0x8934('0x1b')](_0x16eb4d));});};exports[_0x8934('0x57')]=function(_0x334f27,_0x21ca17,_0x1b66d8,_0x3902fb,_0x575bd7,_0x390306,_0x5d2ff7){var _0x18e08b,_0x3f2ee0;_0x390306[_0x8934('0x10')]=intUtil[_0x8934('0x42')](_0x390306[_0x8934('0x10')]);_0x390306[_0x8934('0x43')]=intUtil[_0x8934('0x42')](_0x390306[_0x8934('0x43')]);if(_0x5d2ff7&&_0x5d2ff7['recordingFormat']&&_0x5d2ff7[_0x8934('0x58')]!==_0x8934('0x59')){logger[_0x8934('0x15')](_0x8934('0x5a'),_0x8934('0x5b'));_0x21ca17['recordingURL']=util[_0x8934('0xe')](_0x8934('0x46'),_0x390306[_0x8934('0x43')],_0x21ca17['uniqueid'],md5(_0x21ca17[_0x8934('0x47')]));}headers[_0x8934('0x48')]=getAuth(_0x390306);return getUser(_0x390306,_0x3902fb[_0x8934('0x49')])['then'](function(_0x564b65){_0x18e08b=_0x564b65;logger['info'](_0x8934('0x4a'),_0x18e08b['id']);return getEndUser(_0x390306,_0x21ca17[_0x8934('0x5c')],_0x21ca17[_0x8934('0x5d')]);})['then'](function(_0x280809){_0x3f2ee0=_0x280809;logger[_0x8934('0x15')]('The\x20Enduser\x20ID\x20is:',_0x3f2ee0['id']);return getTicket(_0x390306,_0x18e08b,_0x3f2ee0,_0x1b66d8,_0x21ca17);})['then'](function(_0xf993d2){if(_0xf993d2){logger[_0x8934('0x15')](_0x8934('0x4d'));logger[_0x8934('0x15')]('The\x20Ticket\x20ID\x20is:',_0xf993d2['id']);switch(_0x390306['type']){case'integrationTab':logger['info'](_0x8934('0x45'),_0x8934('0x50'));emit(util[_0x8934('0xe')](_0x8934('0x51'),_0x3902fb[_0x8934('0x36')]),_0x8934('0x52'),{'recordId':_0xf993d2['id']});break;case'newTab':logger[_0x8934('0x15')](_0x8934('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x8934('0xe')]('user:%s',_0x3902fb[_0x8934('0x36')]),'trigger:browser:url',{'uri':util[_0x8934('0xe')](_0x8934('0x5e'),_0x390306[_0x8934('0x10')],_0xf993d2['id'])});break;default:logger[_0x8934('0x56')](_0x8934('0x5a'),_0x8934('0x5f'));}}})[_0x8934('0x60')](function(_0x53bdfc){logger['error'](_0x8934('0x5a'),JSON[_0x8934('0x1b')](_0x53bdfc));});};exports[_0x8934('0x61')]=function(_0x458aaf,_0x511ac6,_0x18850a,_0x35c437,_0x112957,_0x515b0b){var _0x2b1888,_0x27ca38;_0x515b0b[_0x8934('0x10')]=intUtil[_0x8934('0x42')](_0x515b0b[_0x8934('0x10')]);_0x515b0b['serverUrl']=intUtil['stripTrailingSlash'](_0x515b0b[_0x8934('0x43')]);if(_0x112957&&_0x112957[_0x8934('0x44')]){logger[_0x8934('0x15')](_0x8934('0x62'),_0x8934('0x5b'));_0x511ac6[_0x8934('0x63')]=util[_0x8934('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x515b0b[_0x8934('0x43')],_0x511ac6[_0x8934('0x47')],md5(_0x511ac6['uniqueid']));}else{_0x511ac6[_0x8934('0x63')]='';}headers['Authorization']=getAuth(_0x515b0b);return getUser(_0x515b0b)[_0x8934('0x11')](function(_0x301967){_0x2b1888=_0x301967;logger[_0x8934('0x15')]('The\x20User\x20ID\x20is:',_0x2b1888['id']);return getEndUser(_0x515b0b,_0x511ac6[_0x8934('0x4b')],_0x511ac6[_0x8934('0x64')]);})['then'](function(_0x2ffbf0){_0x27ca38=_0x2ffbf0;logger['info'](_0x8934('0x4c'),_0x27ca38['id']);return getTicket(_0x515b0b,_0x2b1888,_0x27ca38,_0x18850a,_0x511ac6);})['then'](function(_0x2a68b3){if(_0x2a68b3){logger[_0x8934('0x15')](_0x8934('0x4d'));logger['info'](_0x8934('0x4e'),_0x2a68b3['id']);}})[_0x8934('0x60')](function(_0x349c88){logger[_0x8934('0x56')]('[ABANDONED]',JSON[_0x8934('0x1b')](_0x349c88));});}; \ No newline at end of file +var _0xab40=['Desk\x20account\x20type\x20not\x20recognized','catch','abandoned','[ABANDONED]','calleridnum','lodash','request-promise','./util','../../../../config/environment','../../../../config/logger','desk','redis','localhost','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','total_entries','_embedded','entries','then','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','GET','basic','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','work','map','type','string','nameField','customField','custom_fields','content','variable','variableName','idField','customVariable','Variable','name','toLowerCase','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','xCALLY','Motion','CTI','concat','Descriptions','user','Fields','%s/customers/%d/cases','POST','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','stringify','outbound','recordingFormat','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','trigger:browser:url','%s/agent/tickets/%s'];(function(_0x26ee0f,_0x35fa8b){var _0x45440e=function(_0x8b61d0){while(--_0x8b61d0){_0x26ee0f['push'](_0x26ee0f['shift']());}};_0x45440e(++_0x35fa8b);}(_0xab40,0xcd));var _0x0ab4=function(_0x41b558,_0xb59d4e){_0x41b558=_0x41b558-0x0;var _0xbae8b5=_0xab40[_0x41b558];return _0xbae8b5;};'use strict';var _=require(_0x0ab4('0x0'));var rp=require(_0x0ab4('0x1'));var md5=require('md5');var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x0ab4('0x2'));var config=require(_0x0ab4('0x3'));var logger=require(_0x0ab4('0x4'))(_0x0ab4('0x5'));config[_0x0ab4('0x6')]=_['defaults'](config['redis'],{'host':_0x0ab4('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x0ab4('0x6')]));function emit(_0x46d16a,_0x11e99f,_0x6d135d){io['to'](_0x46d16a)['emit'](_0x11e99f,_0x6d135d);}var headers={'Content-Type':'application/json','Accept':'application/json'};function getUser(_0x24271e,_0x30e726){if(intUtil[_0x0ab4('0x8')](_0x30e726)===!![]){logger[_0x0ab4('0x9')](_0x0ab4('0xa'),_0x30e726);return request({'uri':util[_0x0ab4('0xb')](_0x0ab4('0xc'),_0x24271e[_0x0ab4('0xd')])})['then'](function(_0x580dc8){if(_0x580dc8[_0x0ab4('0xe')]){return _['find'](_0x580dc8[_0x0ab4('0xf')][_0x0ab4('0x10')],{'email':_0x30e726});}})[_0x0ab4('0x11')](function(_0x1e2b56){if(_0x1e2b56){logger[_0x0ab4('0x9')](_0x0ab4('0x12'));return _0x1e2b56;}else{logger[_0x0ab4('0x9')](_0x0ab4('0x13'));return request({'uri':util[_0x0ab4('0xb')](_0x0ab4('0x14'),_0x24271e[_0x0ab4('0xd')])});}});}else{logger[_0x0ab4('0x9')](_0x0ab4('0x15'));return request({'uri':util[_0x0ab4('0xb')](_0x0ab4('0x14'),_0x24271e[_0x0ab4('0xd')])});}}function request(_0x283b15){logger[_0x0ab4('0x16')]('[HTTP]',JSON['stringify'](_0x283b15));return rp(_['defaults'](_0x283b15,{'method':_0x0ab4('0x17'),'headers':headers,'json':!![]}));}function getAuth(_0x30d5df){var _0x2f50d2;if(_0x30d5df['authType']===_0x0ab4('0x18')){_0x2f50d2=util[_0x0ab4('0xb')](_0x0ab4('0x19'),_0x30d5df[_0x0ab4('0x1a')],_0x30d5df['password']);}else if(_0x30d5df['authType']===_0x0ab4('0x1b')){_0x2f50d2=util['format'](_0x0ab4('0x1c'),_0x30d5df[_0x0ab4('0x1a')],_0x30d5df['token']);}return util[_0x0ab4('0xb')](_0x0ab4('0x1d'),new Buffer(_0x2f50d2)[_0x0ab4('0x1e')](_0x0ab4('0x1f')));}function getEndUser(_0x12d06d,_0x52d7d3,_0x58d9ce){logger[_0x0ab4('0x9')](_0x0ab4('0x20'),_0x58d9ce);return request({'uri':util[_0x0ab4('0xb')](_0x0ab4('0x21'),_0x12d06d['remoteUri']),'qs':{'phone':_0x58d9ce}})[_0x0ab4('0x11')](function(_0x3caa9d){if(_0x3caa9d[_0x0ab4('0xe')]){logger['info']('Enduser\x20found!');return _0x3caa9d[_0x0ab4('0xf')][_0x0ab4('0x10')][0x0];}else{logger[_0x0ab4('0x9')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format']('%s/customers',_0x12d06d[_0x0ab4('0xd')]),'method':'POST','body':{'first_name':_0x52d7d3,'title':_0x52d7d3,'phone_numbers':[{'type':_0x0ab4('0x22'),'value':_0x58d9ce}]}});}});}function getTags(_0x3b4621,_0x4f1aeb){var _0x4bd747=[];if(_0x3b4621&&_0x3b4621['length']>0x0){_0x4bd747=_[_0x0ab4('0x23')](_0x3b4621,_0x4f1aeb);}return _0x4bd747;}function getCustomFields(_0x183bac,_0x1cfdad){var _0x3f61cb=[];var _0x25385e={'custom_fields':{}};if(_0x183bac['length']>0x0){_['forEach'](_0x183bac,function(_0x580d56){if(_0x580d56[_0x0ab4('0x24')]===_0x0ab4('0x25')&&_0x580d56[_0x0ab4('0x26')]&&!_0x580d56[_0x0ab4('0x27')]){_0x25385e[_0x580d56[_0x0ab4('0x26')]['toLowerCase']()]=_0x580d56['content'][_0x0ab4('0x1e')]();}else if(_0x580d56[_0x0ab4('0x24')]===_0x0ab4('0x25')&&_0x580d56['idField']&&_0x580d56['customField']){_0x25385e[_0x0ab4('0x28')][_0x580d56['idField']]=_0x580d56[_0x0ab4('0x29')][_0x0ab4('0x1e')]();}else if(_0x580d56[_0x0ab4('0x24')]===_0x0ab4('0x2a')&&_0x580d56[_0x0ab4('0x2b')]&&_0x580d56[_0x0ab4('0x2c')]&&_0x580d56['customField']){_0x1cfdad[_0x580d56[_0x0ab4('0x2b')]]&&(_0x25385e[_0x0ab4('0x28')][_0x580d56[_0x0ab4('0x2c')]]=_0x1cfdad[_0x580d56[_0x0ab4('0x2b')]]['toString']());}else if(_0x580d56['type']===_0x0ab4('0x2d')&&_0x580d56[_0x0ab4('0x2e')]&&_0x580d56[_0x0ab4('0x2e')]['name']&&_0x580d56['idField']&&_0x580d56['customField']){_0x1cfdad[_0x580d56[_0x0ab4('0x2e')][_0x0ab4('0x2f')][_0x0ab4('0x30')]()]&&(_0x25385e['custom_fields'][_0x580d56['idField']]=_0x1cfdad[_0x580d56['Variable'][_0x0ab4('0x2f')][_0x0ab4('0x30')]()][_0x0ab4('0x1e')]());}});}if(_0x25385e[_0x0ab4('0x31')]){_0x25385e[_0x0ab4('0x31')]=Number(_0x25385e[_0x0ab4('0x31')]);}return _0x25385e;}function getTicket(_0x52d9bf,_0xfb7f92,_0x3ef580,_0x24de6e,_0x4f3853){logger[_0x0ab4('0x9')](_0x0ab4('0x32'));var _0xb6bc6a=_[_0x0ab4('0x33')]({'subject':intUtil[_0x0ab4('0x34')](_0x24de6e[_0x0ab4('0x35')],_0x4f3853,'\x20'),'type':_0x0ab4('0x36'),'status':_0x0ab4('0x37'),'labels':[_0x0ab4('0x38'),_0x0ab4('0x39'),_0x0ab4('0x3a')][_0x0ab4('0x3b')](getTags(_0x24de6e['Tags'],_0x0ab4('0x2f'))),'description':intUtil[_0x0ab4('0x34')](_0x24de6e[_0x0ab4('0x3c')],_0x4f3853,'\x0a'),'_links':{'assigned_user':{'href':util[_0x0ab4('0xb')]('/api/v2/users/%d',_0xfb7f92['id']),'class':_0x0ab4('0x3d')}},'message':{'direction':'in','body':intUtil['getString'](_0x24de6e[_0x0ab4('0x3c')],_0x4f3853,'\x0a')}},getCustomFields(_0x24de6e[_0x0ab4('0x3e')],_0x4f3853));return request({'uri':util[_0x0ab4('0xb')](_0x0ab4('0x3f'),_0x52d9bf[_0x0ab4('0xd')],_0x3ef580['id']),'method':_0x0ab4('0x40'),'body':_0xb6bc6a});}exports['queue']=function(_0x13fa3c,_0x3cc364,_0xe3df73,_0x48029f,_0x395e0b,_0xeac8ad){var _0x1e04ee,_0xd26530;_0xeac8ad[_0x0ab4('0xd')]=intUtil['stripTrailingSlash'](_0xeac8ad['remoteUri']);_0xeac8ad['serverUrl']=intUtil[_0x0ab4('0x41')](_0xeac8ad[_0x0ab4('0x42')]);if(_0x395e0b&&_0x395e0b['monitor_format']){logger[_0x0ab4('0x9')]('[QUEUE]',_0x0ab4('0x43'));_0x3cc364['recordingURL']=util[_0x0ab4('0xb')](_0x0ab4('0x44'),_0xeac8ad[_0x0ab4('0x42')],_0x3cc364[_0x0ab4('0x45')],md5(_0x3cc364[_0x0ab4('0x45')]));}else{_0x3cc364[_0x0ab4('0x46')]='';}headers['Authorization']=getAuth(_0xeac8ad);return getUser(_0xeac8ad,_0x48029f[_0x0ab4('0x47')])[_0x0ab4('0x11')](function(_0x44fd3e){_0x1e04ee=_0x44fd3e;logger[_0x0ab4('0x9')](_0x0ab4('0x48'),_0x1e04ee['id']);return getEndUser(_0xeac8ad,_0x3cc364[_0x0ab4('0x49')],_0x3cc364['calleridnum']);})[_0x0ab4('0x11')](function(_0x4f07d1){_0xd26530=_0x4f07d1;logger[_0x0ab4('0x9')](_0x0ab4('0x4a'),_0xd26530['id']);return getTicket(_0xeac8ad,_0x1e04ee,_0xd26530,_0xe3df73,_0x3cc364);})[_0x0ab4('0x11')](function(_0x518762){if(_0x518762){logger[_0x0ab4('0x9')](_0x0ab4('0x4b'));logger[_0x0ab4('0x9')](_0x0ab4('0x4c'),_0x518762['id']);switch(_0xeac8ad[_0x0ab4('0x24')]){case _0x0ab4('0x4d'):logger['info'](_0x0ab4('0x4e'),_0x0ab4('0x4f'));emit(util[_0x0ab4('0xb')](_0x0ab4('0x50'),_0x48029f[_0x0ab4('0x2f')]),_0x0ab4('0x51'),{'recordId':_0x518762['id']});break;case _0x0ab4('0x52'):logger[_0x0ab4('0x9')](_0x0ab4('0x4e'),_0x0ab4('0x53'));emit(util[_0x0ab4('0xb')](_0x0ab4('0x50'),_0x48029f[_0x0ab4('0x2f')]),'trigger:browser:url',{'uri':util[_0x0ab4('0xb')](_0x0ab4('0x54'),_0x518762['id'])});break;default:logger['error'](_0x0ab4('0x4e'),'Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x447f0d){console[_0x0ab4('0x55')](_0x447f0d);logger[_0x0ab4('0x55')]('[QUEUE]',JSON[_0x0ab4('0x56')](_0x447f0d));});};exports[_0x0ab4('0x57')]=function(_0xeddaa1,_0xaed2d,_0x30ba95,_0x3f20de,_0x1eea3b,_0x52d0c5,_0x20fd66){var _0x59d3f1,_0x31bc52;_0x52d0c5['remoteUri']=intUtil[_0x0ab4('0x41')](_0x52d0c5['remoteUri']);_0x52d0c5['serverUrl']=intUtil[_0x0ab4('0x41')](_0x52d0c5[_0x0ab4('0x42')]);if(_0x20fd66&&_0x20fd66[_0x0ab4('0x58')]&&_0x20fd66[_0x0ab4('0x58')]!=='none'){logger[_0x0ab4('0x9')](_0x0ab4('0x59'),_0x0ab4('0x43'));_0xaed2d[_0x0ab4('0x46')]=util[_0x0ab4('0xb')](_0x0ab4('0x44'),_0x52d0c5[_0x0ab4('0x42')],_0xaed2d[_0x0ab4('0x45')],md5(_0xaed2d[_0x0ab4('0x45')]));}headers[_0x0ab4('0x5a')]=getAuth(_0x52d0c5);return getUser(_0x52d0c5,_0x3f20de[_0x0ab4('0x47')])[_0x0ab4('0x11')](function(_0x370183){_0x59d3f1=_0x370183;logger[_0x0ab4('0x9')](_0x0ab4('0x48'),_0x59d3f1['id']);return getEndUser(_0x52d0c5,_0xaed2d[_0x0ab4('0x5b')],_0xaed2d[_0x0ab4('0x5c')]);})[_0x0ab4('0x11')](function(_0x41f85b){_0x31bc52=_0x41f85b;logger['info'](_0x0ab4('0x4a'),_0x31bc52['id']);return getTicket(_0x52d0c5,_0x59d3f1,_0x31bc52,_0x30ba95,_0xaed2d);})[_0x0ab4('0x11')](function(_0x3eba1e){if(_0x3eba1e){logger[_0x0ab4('0x9')](_0x0ab4('0x4b'));logger[_0x0ab4('0x9')](_0x0ab4('0x4c'),_0x3eba1e['id']);switch(_0x52d0c5[_0x0ab4('0x24')]){case'integrationTab':logger[_0x0ab4('0x9')](_0x0ab4('0x4e'),'Displaying\x20ticket\x20to\x20agent...');emit(util['format'](_0x0ab4('0x50'),_0x3f20de[_0x0ab4('0x2f')]),'trigger:desk:display',{'recordId':_0x3eba1e['id']});break;case'newTab':logger[_0x0ab4('0x9')]('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x0ab4('0xb')](_0x0ab4('0x50'),_0x3f20de[_0x0ab4('0x2f')]),_0x0ab4('0x5d'),{'uri':util[_0x0ab4('0xb')](_0x0ab4('0x5e'),_0x52d0c5[_0x0ab4('0xd')],_0x3eba1e['id'])});break;default:logger['error'](_0x0ab4('0x59'),_0x0ab4('0x5f'));}}})[_0x0ab4('0x60')](function(_0x406df2){logger[_0x0ab4('0x55')](_0x0ab4('0x59'),JSON['stringify'](_0x406df2));});};exports[_0x0ab4('0x61')]=function(_0x1b7925,_0x4ee561,_0x66364c,_0x5b41af,_0x410198,_0x4e7fc9){var _0x268b23,_0x4edebd;_0x4e7fc9[_0x0ab4('0xd')]=intUtil[_0x0ab4('0x41')](_0x4e7fc9['remoteUri']);_0x4e7fc9['serverUrl']=intUtil[_0x0ab4('0x41')](_0x4e7fc9[_0x0ab4('0x42')]);if(_0x410198&&_0x410198['monitor_format']){logger[_0x0ab4('0x9')](_0x0ab4('0x62'),_0x0ab4('0x43'));_0x4ee561['recordingURL']=util[_0x0ab4('0xb')](_0x0ab4('0x44'),_0x4e7fc9[_0x0ab4('0x42')],_0x4ee561[_0x0ab4('0x45')],md5(_0x4ee561[_0x0ab4('0x45')]));}else{_0x4ee561[_0x0ab4('0x46')]='';}headers[_0x0ab4('0x5a')]=getAuth(_0x4e7fc9);return getUser(_0x4e7fc9)[_0x0ab4('0x11')](function(_0x4f043b){_0x268b23=_0x4f043b;logger['info'](_0x0ab4('0x48'),_0x268b23['id']);return getEndUser(_0x4e7fc9,_0x4ee561[_0x0ab4('0x49')],_0x4ee561[_0x0ab4('0x63')]);})[_0x0ab4('0x11')](function(_0x58c611){_0x4edebd=_0x58c611;logger[_0x0ab4('0x9')]('The\x20Enduser\x20ID\x20is:',_0x4edebd['id']);return getTicket(_0x4e7fc9,_0x268b23,_0x4edebd,_0x66364c,_0x4ee561);})[_0x0ab4('0x11')](function(_0x3ae586){if(_0x3ae586){logger[_0x0ab4('0x9')](_0x0ab4('0x4b'));logger[_0x0ab4('0x9')](_0x0ab4('0x4c'),_0x3ae586['id']);}})[_0x0ab4('0x60')](function(_0xf42b98){logger[_0x0ab4('0x55')]('[ABANDONED]',JSON[_0x0ab4('0x56')](_0xf42b98));});}; \ 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 6d08e12..c354611 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 _0x7fa3=['ticketType','incidents','assign','Subjects','getString','/contacts(','phonecall','phonecalls','Descriptions','callDirection','queue','Fields','odata-entityid','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','emit','trigger:browser:url','stripTrailingSlash','serverUrl','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20Call\x20direction:\x20%s','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','request-promise','util','./util','md5','ioredis','../../../../config/logger','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','POST','clientId','remoteUri','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId','userEmail','length','outbound','destcalleridnum','calleridnum','/systemusers(','4.0','substring','lastIndexOf','enduserId','toLowerCase','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField','idField','indexOf','content'];(function(_0x4dab14,_0x164ea0){var _0xf41aa=function(_0x305d50){while(--_0x305d50){_0x4dab14['push'](_0x4dab14['shift']());}};_0xf41aa(++_0x164ea0);}(_0x7fa3,0x19d));var _0x37fa=function(_0x4dd321,_0x2171a5){_0x4dd321=_0x4dd321-0x0;var _0x38f1c4=_0x7fa3[_0x4dd321];return _0x38f1c4;};'use strict';var _=require(_0x37fa('0x0'));var BPromise=require(_0x37fa('0x1'));var rp=require(_0x37fa('0x2'));var util=require(_0x37fa('0x3'));var intUtil=require(_0x37fa('0x4'));var md5=require(_0x37fa('0x5'));var Redis=require(_0x37fa('0x6'));var logger=require(_0x37fa('0x7'))('dynamics365');var config=require(_0x37fa('0x8'));config[_0x37fa('0x9')]=_[_0x37fa('0xa')](config[_0x37fa('0x9')],{'host':_0x37fa('0xb'),'port':0x18eb});var io=require(_0x37fa('0xc'))(new Redis(config[_0x37fa('0x9')]));function getAuthToken(_0x2a23f4,_0x1ad6f0,_0x16fd16){var _0x588dfc={'method':_0x37fa('0xd'),'uri':_0x1ad6f0,'form':{'client_id':_0x2a23f4[_0x37fa('0xe')],'resource':_0x2a23f4[_0x37fa('0xf')],'username':_0x2a23f4['username'],'password':_0x2a23f4['password'],'grant_type':'password','client_secret':_0x2a23f4['clientSecret']},'json':!![]};return rp(_0x588dfc)[_0x37fa('0x10')](function(_0x5334bb){return _0x5334bb[_0x37fa('0x11')];})[_0x37fa('0x12')](function(_0x41d5d4){logger[_0x37fa('0x13')]('['+[_0x16fd16[_0x37fa('0x14')]()]+_0x37fa('0x15'));return _0x41d5d4[_0x37fa('0x16')];});}function getUser(_0xd00de5,_0x3fd173,_0x4defee,_0x3aae46,_0x28a1cc,_0x76077d){return new BPromise(function(_0xe9b03c,_0x73992f){return getAuthToken(_0x3fd173,_0x3aae46,_0x76077d)['then'](function(_0x58ade0){var _0x3cc1fd={'method':_0x37fa('0x17'),'uri':_0x28a1cc+_0x37fa('0x18'),'headers':{'Authorization':_0x37fa('0x19')+_0x58ade0,'OData-Version':'4.0'},'json':!![]};return rp(_0x3cc1fd);})[_0x37fa('0x10')](function(_0x24e151){var _0x37ff49=_0x24e151[_0x37fa('0x1a')];var _0x311603=![];var _0x6f9b03=null;if(!_[_0x37fa('0x1b')](_0x4defee)){if(intUtil['validateEmail'](_0x4defee[_0x37fa('0x1c')])){_0xd00de5['userEmail']=_0x4defee['email'];for(_0x6f9b03=0x0;_0x6f9b03<_0x37ff49['length'];_0x6f9b03++){if(_0x37ff49[_0x6f9b03][_0x37fa('0x1d')]===_0x4defee[_0x37fa('0x1c')]&&!_0x37ff49[_0x6f9b03][_0x37fa('0x1e')]){_0x311603=!![];logger[_0x37fa('0x1f')]('['+[_0x76077d[_0x37fa('0x14')]()]+_0x37fa('0x20')+_0x37ff49[_0x6f9b03][_0x37fa('0x21')]+'!');_0xd00de5[_0x37fa('0x22')]=_0x37ff49[_0x6f9b03]['systemuserid'];}}}}if(!_0x311603){logger[_0x37fa('0x1f')]('['+[_0x76077d[_0x37fa('0x14')]()]+']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');_0xd00de5[_0x37fa('0x23')]=_0x3fd173['username'];for(_0x6f9b03=0x0;_0x6f9b03<_0x37ff49[_0x37fa('0x24')];_0x6f9b03++){if(_0x37ff49[_0x6f9b03][_0x37fa('0x1d')]===_0x3fd173['username']){_0xd00de5[_0x37fa('0x22')]=_0x37ff49[_0x6f9b03]['systemuserid'];}}}_0xe9b03c(_0xd00de5);})[_0x37fa('0x12')](function(_0x2d8fc5){_0x73992f(_0x2d8fc5['message']);});});}function createEndUser(_0x531687,_0x9a34a,_0x18b7eb,_0x247d7d,_0xfc28ab,_0xf3775a){return new BPromise(function(_0x476ba7,_0x3b78f6){return getAuthToken(_0x9a34a,_0x18b7eb,_0xf3775a)[_0x37fa('0x10')](function(_0x4363ee){var _0x3499d5=_0xf3775a['toLowerCase']()===_0x37fa('0x25')?_0xfc28ab[_0x37fa('0x26')]:_0xfc28ab[_0x37fa('0x27')];var _0x28215e={'method':_0x37fa('0xd'),'uri':_0x247d7d+'contacts','body':{'telephone1':_0x3499d5,'fullname':_0x3499d5,'firstname':_0x3499d5,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x37fa('0x28')+_0x531687[_0x37fa('0x22')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x4363ee,'OData-Version':_0x37fa('0x29')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x28215e);})[_0x37fa('0x10')](function(_0x381acb){var _0x4b6853=_0x381acb['headers']['odata-entityid'];var _0x25a601=_0x4b6853[_0x37fa('0x2a')](_0x4b6853[_0x37fa('0x2b')]('(')+0x1,_0x4b6853[_0x37fa('0x2b')](')'));_0x531687[_0x37fa('0x2c')]=_0x25a601;_0x476ba7(_0x531687);})[_0x37fa('0x12')](function(_0x13d119){_0x3b78f6(_0x13d119[_0x37fa('0x16')]);});});}function getEndUser(_0x19e5e0,_0x5c3ccc,_0x3a10f0,_0x2a645c,_0x12f947,_0x1b1a07){return new BPromise(function(_0x1429cc,_0x4bbfd7){return getAuthToken(_0x5c3ccc,_0x3a10f0,_0x1b1a07)['then'](function(_0x1b971b){var _0x45caf6={'method':'GET','uri':_0x2a645c+'contacts?$select=telephone1','headers':{'Authorization':_0x37fa('0x19')+_0x1b971b,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x45caf6);})[_0x37fa('0x10')](function(_0x29d322){var _0x52ebc0=null;if(_0x29d322){var _0x23b23d=_0x29d322[_0x37fa('0x1a')];var _0x556a20=![];for(_0x52ebc0=0x0;_0x52ebc0<_0x23b23d[_0x37fa('0x24')];_0x52ebc0++){var _0x370eb9=_0x1b1a07[_0x37fa('0x2d')]()===_0x37fa('0x25')?_0x12f947[_0x37fa('0x26')]:_0x12f947[_0x37fa('0x27')];if(_0x23b23d[_0x52ebc0]['telephone1']===_0x370eb9){_0x556a20=!![];_0x19e5e0[_0x37fa('0x2c')]=_0x23b23d[_0x52ebc0][_0x37fa('0x2e')];}}if(_0x556a20){_0x1429cc(_0x19e5e0);}else{return createEndUser(_0x19e5e0,_0x5c3ccc,_0x3a10f0,_0x2a645c,_0x12f947,_0x1b1a07)[_0x37fa('0x10')](function(_0x43fb66){logger[_0x37fa('0x1f')]('['+[_0x1b1a07[_0x37fa('0x14')]()]+_0x37fa('0x2f'),_0x43fb66[_0x37fa('0x2c')]);_0x1429cc(_0x43fb66);});}}else{return createEndUser(_0x19e5e0,_0x5c3ccc,_0x3a10f0,_0x2a645c,_0x12f947,_0x1b1a07)[_0x37fa('0x10')](function(_0x388987){logger['info']('['+[_0x1b1a07[_0x37fa('0x14')]()]+_0x37fa('0x30'),_0x388987['enduserId']);_0x1429cc(_0x388987);});}});});}function getCustomFields(_0x6c9e0,_0x3e0a58,_0x454a1c){var _0x1724e0={};if(_0x6c9e0[_0x37fa('0x24')]>0x0){_[_0x37fa('0x31')](_0x6c9e0,function(_0x16f64d){if(_0x16f64d[_0x37fa('0x32')]===_0x37fa('0x33')&&_0x16f64d[_0x37fa('0x34')]&&!_0x16f64d[_0x37fa('0x35')]){var _0x532575=_0x16f64d[_0x37fa('0x36')][_0x37fa('0x2d')]();var _0x233d74=_0x532575[_0x37fa('0x2a')](0x0,_0x532575[_0x37fa('0x37')]('_'));var _0x2c17d6=_0x532575[_0x37fa('0x2a')](_0x532575[_0x37fa('0x37')]('_')+0x1);if(_0x233d74===_0x454a1c){_0x1724e0[_0x2c17d6]=_0x16f64d[_0x37fa('0x38')];}}});}return _0x1724e0;}function getTicket(_0x1b182c,_0x44c83c,_0x53b6e1,_0x1bee30,_0x533f10,_0x4e32e7,_0x54a8c1){return new BPromise(function(_0x233202,_0x5d3186){var _0x5637f6;return getAuthToken(_0x44c83c,_0x53b6e1,_0x54a8c1)[_0x37fa('0x10')](function(_0x44e195){if(_0x4e32e7[_0x37fa('0x39')]==='incident'){_0x5637f6={'method':_0x37fa('0xd'),'uri':_0x1bee30+_0x37fa('0x3a'),'body':Object[_0x37fa('0x3b')]({},{'title':intUtil['getString'](_0x4e32e7[_0x37fa('0x3c')],_0x533f10,'\x20'),'description':intUtil[_0x37fa('0x3d')](_0x4e32e7['Descriptions'],_0x533f10,'\x0a'),'customerid_contact@odata.bind':_0x37fa('0x3e')+_0x1b182c['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x1b182c[_0x37fa('0x22')]+')','caseorigincode':'1'},getCustomFields(_0x4e32e7['Fields'],_0x533f10,_0x4e32e7['ticketType'])),'headers':{'Authorization':_0x37fa('0x19')+_0x44e195,'OData-Version':_0x37fa('0x29')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x4e32e7[_0x37fa('0x39')]===_0x37fa('0x3f')){_0x5637f6={'method':_0x37fa('0xd'),'uri':_0x1bee30+_0x37fa('0x40'),'body':Object['assign']({},{'subject':intUtil[_0x37fa('0x3d')](_0x4e32e7[_0x37fa('0x3c')],_0x533f10,'\x20'),'phonenumber':String(_0x533f10[_0x37fa('0x27')]),'description':intUtil['getString'](_0x4e32e7[_0x37fa('0x41')],_0x533f10,'\x0a'),'regardingobjectid_contact@odata.bind':_0x37fa('0x3e')+_0x1b182c['enduserId']+')','ownerid@odata.bind':'/systemusers('+_0x1b182c[_0x37fa('0x22')]+')','directioncode':_0x1b182c[_0x37fa('0x42')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':'/systemusers('+_0x1b182c[_0x37fa('0x22')]+')','participationtypemask':_0x1b182c[_0x37fa('0x42')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':'/contacts('+_0x1b182c[_0x37fa('0x2c')]+')','participationtypemask':_0x1b182c[_0x37fa('0x42')]===_0x37fa('0x43')?0x1:0x2}]},getCustomFields(_0x4e32e7[_0x37fa('0x44')],_0x533f10,_0x4e32e7[_0x37fa('0x39')])),'headers':{'Authorization':_0x37fa('0x19')+_0x44e195,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x5637f6);})[_0x37fa('0x10')](function(_0x43e56a){var _0x5409b1=_0x43e56a['headers'][_0x37fa('0x45')];var _0x1f5f78=_0x5409b1[_0x37fa('0x2a')](_0x5409b1[_0x37fa('0x2b')]('(')+0x1,_0x5409b1['lastIndexOf'](')'));_0x1b182c[_0x37fa('0x46')]=_0x1f5f78;_0x233202(_0x1b182c);})[_0x37fa('0x12')](function(_0x142ce4){_0x5d3186(_0x142ce4['message']);});});}function emit(_0x1e3934,_0x352f4b,_0x2cba2b,_0x2018be){var _0x120296={'uri':util[_0x37fa('0x47')](_0x37fa('0x48'),_0x1e3934,_0x2cba2b,_0x2018be)};io['to'](util[_0x37fa('0x47')]('user:%s',_0x352f4b))[_0x37fa('0x49')](_0x37fa('0x4a'),_0x120296);}exports['cs']=function(_0x1b751a,_0x3f3290,_0x58259f,_0x39ac5c,_0x563857,_0x3a831d,_0x5ecef7,_0x199e40){var _0x2c8b80={};_0x3a831d[_0x37fa('0xf')]=intUtil[_0x37fa('0x4b')](_0x3a831d[_0x37fa('0xf')]);_0x3a831d[_0x37fa('0x4c')]=intUtil[_0x37fa('0x4b')](_0x3a831d[_0x37fa('0x4c')]);_0x2c8b80[_0x37fa('0x42')]=_0x199e40===_0x37fa('0x43')||_0x199e40===_0x37fa('0x4d')?_0x37fa('0x43'):_0x37fa('0x25');var _0x12ba55=util[_0x37fa('0x47')](_0x37fa('0x4e'),_0x3a831d['remoteUri']);var _0x446ece=util[_0x37fa('0x47')](_0x37fa('0x4f'),_0x3a831d[_0x37fa('0x50')]);var _0x2d411d=util['format'](_0x37fa('0x51'),_0x3a831d['serverUrl'],_0x3f3290[_0x37fa('0x52')],md5(_0x3f3290[_0x37fa('0x52')]));if(_0x563857&&_0x563857['monitor_format']){logger[_0x37fa('0x1f')](_0x37fa('0x53'),_0x37fa('0x54'));_0x3f3290[_0x37fa('0x55')]=_0x2d411d;}else if(_0x5ecef7&&_0x5ecef7[_0x37fa('0x56')]&&_0x5ecef7['recordingFormat']!=='none'){logger['info']('[OUTBOUND]',_0x37fa('0x54'));_0x3f3290[_0x37fa('0x55')]=_0x2d411d;}else{_0x3f3290[_0x37fa('0x55')]='';}return getUser(_0x2c8b80,_0x3a831d,_0x39ac5c,_0x446ece,_0x12ba55,_0x199e40)[_0x37fa('0x10')](function(_0x4207c4){logger[_0x37fa('0x1f')]('['+_0x199e40[_0x37fa('0x14')]()+_0x37fa('0x57'),_0x4207c4[_0x37fa('0x22')]);logger[_0x37fa('0x1f')]('['+_0x199e40[_0x37fa('0x14')]()+_0x37fa('0x58'),_0x4207c4[_0x37fa('0x23')]);return getEndUser(_0x4207c4,_0x3a831d,_0x446ece,_0x12ba55,_0x3f3290,_0x199e40);})['then'](function(_0x3dff70){logger['info']('['+_0x199e40[_0x37fa('0x14')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3dff70[_0x37fa('0x2c')]);logger[_0x37fa('0x1f')]('['+_0x199e40['toUpperCase']()+_0x37fa('0x59'),_0x3f3290[_0x37fa('0x27')]);return getTicket(_0x3dff70,_0x3a831d,_0x446ece,_0x12ba55,_0x3f3290,_0x58259f,_0x199e40);})[_0x37fa('0x10')](function(_0x585d6c){logger[_0x37fa('0x1f')](util[_0x37fa('0x47')]('['+_0x199e40[_0x37fa('0x14')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x58259f[_0x37fa('0x39')],_0x585d6c[_0x37fa('0x46')]));logger[_0x37fa('0x1f')](util[_0x37fa('0x47')]('['+_0x199e40[_0x37fa('0x14')]()+_0x37fa('0x5a'),_0x199e40));if(_0x199e40!=='abandoned'){logger[_0x37fa('0x1f')]('['+_0x199e40[_0x37fa('0x14')]()+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x3a831d[_0x37fa('0xf')],_0x39ac5c[_0x37fa('0x5b')],_0x58259f[_0x37fa('0x39')],_0x585d6c[_0x37fa('0x46')]);}})['catch'](function(_0x19eca9){logger[_0x37fa('0x13')]('['+_0x199e40[_0x37fa('0x14')]()+_0x37fa('0x5c'),util[_0x37fa('0x5d')](_0x19eca9,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xc296=['util','./util','md5','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','remoteUri','password','clientSecret','then','access_token','catch','error','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','userEmail','length','internalemailaddress','isdisabled','info','toUpperCase',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','userId','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','/systemusers(','odata-entityid','lastIndexOf','enduserId','contacts?$select=telephone1','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','indexOf','substring','ticketType','incident','assign','getString','Subjects','Descriptions','/contacts(','phonecalls','callDirection','queue','Fields','headers','ticketId','format','user:%s','emit','trigger:browser:url','serverUrl','abandoned','https://login.microsoftonline.com/%s/oauth2/token','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0xc296,0x11a));var _0x6c29=function(_0x126b45,_0x2493bd){_0x126b45=_0x126b45-0x0;var _0x57e9ba=_0xc296[_0x126b45];return _0x57e9ba;};'use strict';var _=require(_0x6c29('0x0'));var BPromise=require(_0x6c29('0x1'));var rp=require(_0x6c29('0x2'));var util=require(_0x6c29('0x3'));var intUtil=require(_0x6c29('0x4'));var md5=require(_0x6c29('0x5'));var Redis=require(_0x6c29('0x6'));var logger=require(_0x6c29('0x7'))(_0x6c29('0x8'));var config=require('../../../../config/environment');config[_0x6c29('0x9')]=_[_0x6c29('0xa')](config[_0x6c29('0x9')],{'host':_0x6c29('0xb'),'port':0x18eb});var io=require(_0x6c29('0xc'))(new Redis(config[_0x6c29('0x9')]));function getAuthToken(_0x1d6dbf,_0xeb24a2,_0x3921e0){var _0x222fb3={'method':_0x6c29('0xd'),'uri':_0xeb24a2,'form':{'client_id':_0x1d6dbf['clientId'],'resource':_0x1d6dbf[_0x6c29('0xe')],'username':_0x1d6dbf['username'],'password':_0x1d6dbf[_0x6c29('0xf')],'grant_type':_0x6c29('0xf'),'client_secret':_0x1d6dbf[_0x6c29('0x10')]},'json':!![]};return rp(_0x222fb3)[_0x6c29('0x11')](function(_0x355b58){return _0x355b58[_0x6c29('0x12')];})[_0x6c29('0x13')](function(_0x32b8e3){logger[_0x6c29('0x14')]('['+[_0x3921e0['toUpperCase']()]+']\x20Wrong\x20credentials!');return _0x32b8e3[_0x6c29('0x15')];});}function getUser(_0x2f97bc,_0x44de81,_0x1dff6d,_0x33f15a,_0x1abc29,_0x2ba30f){return new BPromise(function(_0x2b73aa,_0x2f4aae){return getAuthToken(_0x44de81,_0x33f15a,_0x2ba30f)['then'](function(_0xd8f6b8){var _0x14603c={'method':_0x6c29('0x16'),'uri':_0x1abc29+_0x6c29('0x17'),'headers':{'Authorization':_0x6c29('0x18')+_0xd8f6b8,'OData-Version':_0x6c29('0x19')},'json':!![]};return rp(_0x14603c);})[_0x6c29('0x11')](function(_0xc2a4c9){var _0x10faf9=_0xc2a4c9['value'];var _0x5eb147=![];var _0x533272=null;if(!_[_0x6c29('0x1a')](_0x1dff6d)){if(intUtil[_0x6c29('0x1b')](_0x1dff6d[_0x6c29('0x1c')])){_0x2f97bc[_0x6c29('0x1d')]=_0x1dff6d[_0x6c29('0x1c')];for(_0x533272=0x0;_0x533272<_0x10faf9[_0x6c29('0x1e')];_0x533272++){if(_0x10faf9[_0x533272][_0x6c29('0x1f')]===_0x1dff6d[_0x6c29('0x1c')]&&!_0x10faf9[_0x533272][_0x6c29('0x20')]){_0x5eb147=!![];logger[_0x6c29('0x21')]('['+[_0x2ba30f[_0x6c29('0x22')]()]+_0x6c29('0x23')+_0x10faf9[_0x533272][_0x6c29('0x24')]+'!');_0x2f97bc['userId']=_0x10faf9[_0x533272]['systemuserid'];}}}}if(!_0x5eb147){logger[_0x6c29('0x21')]('['+[_0x2ba30f[_0x6c29('0x22')]()]+_0x6c29('0x25'));_0x2f97bc[_0x6c29('0x1d')]=_0x44de81[_0x6c29('0x26')];for(_0x533272=0x0;_0x533272<_0x10faf9[_0x6c29('0x1e')];_0x533272++){if(_0x10faf9[_0x533272][_0x6c29('0x1f')]===_0x44de81['username']){_0x2f97bc[_0x6c29('0x27')]=_0x10faf9[_0x533272][_0x6c29('0x24')];}}}_0x2b73aa(_0x2f97bc);})[_0x6c29('0x13')](function(_0x3417b9){_0x2f4aae(_0x3417b9['message']);});});}function createEndUser(_0x522457,_0x251ded,_0x32e4be,_0x4b02a7,_0x3ac7ae,_0x28fb42){return new BPromise(function(_0x4fcb99,_0x35906d){return getAuthToken(_0x251ded,_0x32e4be,_0x28fb42)[_0x6c29('0x11')](function(_0x108212){var _0x48776f=_0x28fb42[_0x6c29('0x28')]()===_0x6c29('0x29')?_0x3ac7ae[_0x6c29('0x2a')]:_0x3ac7ae[_0x6c29('0x2b')];var _0x270951={'method':_0x6c29('0xd'),'uri':_0x4b02a7+_0x6c29('0x2c'),'body':{'telephone1':_0x48776f,'fullname':_0x48776f,'firstname':_0x48776f,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x6c29('0x2d')+_0x522457['userId']+')'},'headers':{'Authorization':_0x6c29('0x18')+_0x108212,'OData-Version':_0x6c29('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x270951);})[_0x6c29('0x11')](function(_0x5778e1){var _0x464125=_0x5778e1['headers'][_0x6c29('0x2e')];var _0x1d19d3=_0x464125['substring'](_0x464125['lastIndexOf']('(')+0x1,_0x464125[_0x6c29('0x2f')](')'));_0x522457[_0x6c29('0x30')]=_0x1d19d3;_0x4fcb99(_0x522457);})[_0x6c29('0x13')](function(_0xace2c1){_0x35906d(_0xace2c1[_0x6c29('0x15')]);});});}function getEndUser(_0x3abca8,_0x4beabd,_0x53925f,_0xc32858,_0x138793,_0x342676){return new BPromise(function(_0xe28bb8,_0x5471f4){return getAuthToken(_0x4beabd,_0x53925f,_0x342676)[_0x6c29('0x11')](function(_0xb9d356){var _0x32dab0={'method':_0x6c29('0x16'),'uri':_0xc32858+_0x6c29('0x31'),'headers':{'Authorization':_0x6c29('0x18')+_0xb9d356,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x32dab0);})[_0x6c29('0x11')](function(_0x3b6635){var _0x4bdb53=null;if(_0x3b6635){var _0x43f7a9=_0x3b6635['value'];var _0x379795=![];for(_0x4bdb53=0x0;_0x4bdb53<_0x43f7a9[_0x6c29('0x1e')];_0x4bdb53++){var _0x280f7a=_0x342676[_0x6c29('0x28')]()==='outbound'?_0x138793['destcalleridnum']:_0x138793[_0x6c29('0x2b')];if(_0x43f7a9[_0x4bdb53][_0x6c29('0x32')]===_0x280f7a){_0x379795=!![];_0x3abca8['enduserId']=_0x43f7a9[_0x4bdb53][_0x6c29('0x33')];}}if(_0x379795){_0xe28bb8(_0x3abca8);}else{return createEndUser(_0x3abca8,_0x4beabd,_0x53925f,_0xc32858,_0x138793,_0x342676)['then'](function(_0x13edd8){logger['info']('['+[_0x342676['toUpperCase']()]+_0x6c29('0x34'),_0x13edd8['enduserId']);_0xe28bb8(_0x13edd8);});}}else{return createEndUser(_0x3abca8,_0x4beabd,_0x53925f,_0xc32858,_0x138793,_0x342676)[_0x6c29('0x11')](function(_0x12e800){logger[_0x6c29('0x21')]('['+[_0x342676[_0x6c29('0x22')]()]+_0x6c29('0x35'),_0x12e800[_0x6c29('0x30')]);_0xe28bb8(_0x12e800);});}});});}function getCustomFields(_0x537395,_0x19e558,_0x3bc28c){var _0x404409={};if(_0x537395[_0x6c29('0x1e')]>0x0){_[_0x6c29('0x36')](_0x537395,function(_0x1f014b){if(_0x1f014b[_0x6c29('0x37')]===_0x6c29('0x38')&&_0x1f014b[_0x6c29('0x39')]&&!_0x1f014b['customField']){var _0x3ef505=_0x1f014b['idField'][_0x6c29('0x28')]();var _0x29e66d=_0x3ef505['substring'](0x0,_0x3ef505[_0x6c29('0x3a')]('_'));var _0x3ffbce=_0x3ef505[_0x6c29('0x3b')](_0x3ef505[_0x6c29('0x3a')]('_')+0x1);if(_0x29e66d===_0x3bc28c){_0x404409[_0x3ffbce]=_0x1f014b['content'];}}});}return _0x404409;}function getTicket(_0x4a254f,_0xbc5425,_0x1e9fdb,_0x117ead,_0x2dd6c7,_0x93ee62,_0x362b20){return new BPromise(function(_0x3ae56b,_0x2dfb2c){var _0x4db9a3;return getAuthToken(_0xbc5425,_0x1e9fdb,_0x362b20)['then'](function(_0x18f8bc){if(_0x93ee62[_0x6c29('0x3c')]===_0x6c29('0x3d')){_0x4db9a3={'method':'POST','uri':_0x117ead+'incidents','body':Object[_0x6c29('0x3e')]({},{'title':intUtil[_0x6c29('0x3f')](_0x93ee62[_0x6c29('0x40')],_0x2dd6c7,'\x20'),'description':intUtil[_0x6c29('0x3f')](_0x93ee62[_0x6c29('0x41')],_0x2dd6c7,'\x0a'),'customerid_contact@odata.bind':_0x6c29('0x42')+_0x4a254f[_0x6c29('0x30')]+')','ownerid@odata.bind':_0x6c29('0x2d')+_0x4a254f[_0x6c29('0x27')]+')','caseorigincode':'1'},getCustomFields(_0x93ee62['Fields'],_0x2dd6c7,_0x93ee62[_0x6c29('0x3c')])),'headers':{'Authorization':'Bearer\x20'+_0x18f8bc,'OData-Version':_0x6c29('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x93ee62['ticketType']==='phonecall'){_0x4db9a3={'method':_0x6c29('0xd'),'uri':_0x117ead+_0x6c29('0x43'),'body':Object[_0x6c29('0x3e')]({},{'subject':intUtil[_0x6c29('0x3f')](_0x93ee62[_0x6c29('0x40')],_0x2dd6c7,'\x20'),'phonenumber':String(_0x2dd6c7[_0x6c29('0x2b')]),'description':intUtil[_0x6c29('0x3f')](_0x93ee62[_0x6c29('0x41')],_0x2dd6c7,'\x0a'),'regardingobjectid_contact@odata.bind':_0x6c29('0x42')+_0x4a254f[_0x6c29('0x30')]+')','ownerid@odata.bind':'/systemusers('+_0x4a254f[_0x6c29('0x27')]+')','directioncode':_0x4a254f['callDirection']==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x6c29('0x2d')+_0x4a254f[_0x6c29('0x27')]+')','participationtypemask':_0x4a254f[_0x6c29('0x44')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x6c29('0x42')+_0x4a254f[_0x6c29('0x30')]+')','participationtypemask':_0x4a254f[_0x6c29('0x44')]===_0x6c29('0x45')?0x1:0x2}]},getCustomFields(_0x93ee62[_0x6c29('0x46')],_0x2dd6c7,_0x93ee62[_0x6c29('0x3c')])),'headers':{'Authorization':_0x6c29('0x18')+_0x18f8bc,'OData-Version':_0x6c29('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4db9a3);})[_0x6c29('0x11')](function(_0x2f1be6){var _0x2bbfd0=_0x2f1be6[_0x6c29('0x47')][_0x6c29('0x2e')];var _0x5c1d6c=_0x2bbfd0['substring'](_0x2bbfd0['lastIndexOf']('(')+0x1,_0x2bbfd0['lastIndexOf'](')'));_0x4a254f[_0x6c29('0x48')]=_0x5c1d6c;_0x3ae56b(_0x4a254f);})[_0x6c29('0x13')](function(_0x4dcce6){_0x2dfb2c(_0x4dcce6[_0x6c29('0x15')]);});});}function emit(_0x2d3a90,_0x30da1e,_0x208fc3,_0x8dbe2c){var _0x2f1ccd={'uri':util[_0x6c29('0x49')]('%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s',_0x2d3a90,_0x208fc3,_0x8dbe2c)};io['to'](util[_0x6c29('0x49')](_0x6c29('0x4a'),_0x30da1e))[_0x6c29('0x4b')](_0x6c29('0x4c'),_0x2f1ccd);}exports['cs']=function(_0x50063a,_0x46b4e9,_0x39cb86,_0x402908,_0xe781c4,_0x313f17,_0x442fc8,_0x27684f){var _0x829b7b={};_0x313f17[_0x6c29('0xe')]=intUtil['stripTrailingSlash'](_0x313f17[_0x6c29('0xe')]);_0x313f17[_0x6c29('0x4d')]=intUtil['stripTrailingSlash'](_0x313f17['serverUrl']);_0x829b7b[_0x6c29('0x44')]=_0x27684f===_0x6c29('0x45')||_0x27684f===_0x6c29('0x4e')?_0x6c29('0x45'):_0x6c29('0x29');var _0x33d8cb=util[_0x6c29('0x49')]('%s/api/data/v9.0/',_0x313f17[_0x6c29('0xe')]);var _0x4299e4=util[_0x6c29('0x49')](_0x6c29('0x4f'),_0x313f17[_0x6c29('0x50')]);var _0x1b4d80=util[_0x6c29('0x49')](_0x6c29('0x51'),_0x313f17[_0x6c29('0x4d')],_0x46b4e9['uniqueid'],md5(_0x46b4e9[_0x6c29('0x52')]));if(_0xe781c4&&_0xe781c4['monitor_format']){logger[_0x6c29('0x21')](_0x6c29('0x53'),'Recording\x20is\x20enabled!');_0x46b4e9['recordingURL']=_0x1b4d80;}else if(_0x442fc8&&_0x442fc8[_0x6c29('0x54')]&&_0x442fc8['recordingFormat']!==_0x6c29('0x55')){logger['info'](_0x6c29('0x56'),'Recording\x20is\x20enabled!');_0x46b4e9['recordingURL']=_0x1b4d80;}else{_0x46b4e9['recordingURL']='';}return getUser(_0x829b7b,_0x313f17,_0x402908,_0x4299e4,_0x33d8cb,_0x27684f)[_0x6c29('0x11')](function(_0x561ea0){logger['info']('['+_0x27684f[_0x6c29('0x22')]()+']\x20The\x20User\x20ID\x20is:',_0x561ea0[_0x6c29('0x27')]);logger[_0x6c29('0x21')]('['+_0x27684f[_0x6c29('0x22')]()+_0x6c29('0x57'),_0x561ea0[_0x6c29('0x1d')]);return getEndUser(_0x561ea0,_0x313f17,_0x4299e4,_0x33d8cb,_0x46b4e9,_0x27684f);})[_0x6c29('0x11')](function(_0x482009){logger[_0x6c29('0x21')]('['+_0x27684f[_0x6c29('0x22')]()+_0x6c29('0x58'),_0x482009[_0x6c29('0x30')]);logger[_0x6c29('0x21')]('['+_0x27684f[_0x6c29('0x22')]()+_0x6c29('0x59'),_0x46b4e9['calleridnum']);return getTicket(_0x482009,_0x313f17,_0x4299e4,_0x33d8cb,_0x46b4e9,_0x39cb86,_0x27684f);})[_0x6c29('0x11')](function(_0x5e45f8){logger[_0x6c29('0x21')](util[_0x6c29('0x49')]('['+_0x27684f['toUpperCase']()+_0x6c29('0x5a'),_0x39cb86[_0x6c29('0x3c')],_0x5e45f8[_0x6c29('0x48')]));logger[_0x6c29('0x21')](util['format']('['+_0x27684f['toUpperCase']()+_0x6c29('0x5b'),_0x27684f));if(_0x27684f!==_0x6c29('0x4e')){logger[_0x6c29('0x21')]('['+_0x27684f[_0x6c29('0x22')]()+']',_0x6c29('0x5c'));emit(_0x313f17['remoteUri'],_0x402908[_0x6c29('0x5d')],_0x39cb86[_0x6c29('0x3c')],_0x5e45f8[_0x6c29('0x48')]);}})[_0x6c29('0x13')](function(_0x256683){logger[_0x6c29('0x14')]('['+_0x27684f[_0x6c29('0x22')]()+_0x6c29('0x5e'),util['inspect'](_0x256683,{'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 415a90f..ab5a741 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 _0x9a22=['Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','apiKey','toString','base64','[HTTP]','stringify','GET','forEach','type','string','nameField','toLowerCase','content','customField','push','variable','variableName','idField','customVariable','Variable','name','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','outbound','recordingFormat','[OUTBOUND]','recordingURL','Authorization','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','error','abandoned','[ABANDONED]','lodash','md5','util','ioredis','../../../../config/environment','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Caller\x20-\x20%s','calleridname','getString','Subjects','Descriptions','Tags','Fields','custom_fields','mapValues','keyBy','value','format','%s/api/v2/tickets','remoteUri','POST','then','Ticket\x20created!','%s/api/v2/agents','Agent\x20found!','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','find'];(function(_0x311fd4,_0x2fc056){var _0x2a7835=function(_0x4945e7){while(--_0x4945e7){_0x311fd4['push'](_0x311fd4['shift']());}};_0x2a7835(++_0x2fc056);}(_0x9a22,0xe9));var _0x29a2=function(_0x13ea00,_0x12f610){_0x13ea00=_0x13ea00-0x0;var _0x1f7347=_0x9a22[_0x13ea00];return _0x1f7347;};'use strict';var _=require(_0x29a2('0x0'));var rp=require('request-promise');var md5=require(_0x29a2('0x1'));var util=require(_0x29a2('0x2'));var Redis=require(_0x29a2('0x3'));var intUtil=require('./util');var config=require(_0x29a2('0x4'));var logger=require('../../../../config/logger')(_0x29a2('0x5'));config[_0x29a2('0x6')]=_[_0x29a2('0x7')](config[_0x29a2('0x6')],{'host':_0x29a2('0x8'),'port':0x18eb});var io=require(_0x29a2('0x9'))(new Redis(config['redis']));var headers={'Content-Type':_0x29a2('0xa'),'Accept':_0x29a2('0xa')};function emit(_0x4daf15,_0xaa5a91,_0x2652dc){io['to'](_0x4daf15)[_0x29a2('0xb')](_0xaa5a91,_0x2652dc);}function getTicket(_0x5af343,_0x51a28a,_0x366f28,_0x34f16f,_0x598419){logger[_0x29a2('0xc')]('Creating\x20new\x20ticket...');var _0x2ee24d=_['merge']({'responder_id':_0x51a28a['id'],'requester_id':_0x366f28['id'],'name':util['format'](_0x29a2('0xd'),_0x598419[_0x29a2('0xe')]),'phone':_0x598419['calleridnum'],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x29a2('0xf')](_0x34f16f[_0x29a2('0x10')],_0x598419,'\x20'),'description':intUtil[_0x29a2('0xf')](_0x34f16f[_0x29a2('0x11')],_0x598419,'
'),'tags':getTags(_0x34f16f[_0x29a2('0x12')],'name')},getCustomFields(_0x34f16f[_0x29a2('0x13')],_0x598419));_0x2ee24d[_0x29a2('0x14')]=_[_0x29a2('0x15')](_[_0x29a2('0x16')](_0x2ee24d[_0x29a2('0x14')],'id'),_0x29a2('0x17'));return request({'uri':util[_0x29a2('0x18')](_0x29a2('0x19'),_0x5af343[_0x29a2('0x1a')]),'method':_0x29a2('0x1b'),'body':_0x2ee24d})[_0x29a2('0x1c')](function(_0x4e0251){logger[_0x29a2('0xc')](_0x29a2('0x1d'));return _0x4e0251;});}function getUser(_0x4e7aca,_0xe324cf){if(intUtil['validateEmail'](_0xe324cf)){return request({'uri':util[_0x29a2('0x18')](_0x29a2('0x1e'),_0x4e7aca['remoteUri']),'qs':{'email':_0xe324cf}})[_0x29a2('0x1c')](function(_0x5ea1aa){if(_0x5ea1aa['length']){logger[_0x29a2('0xc')](_0x29a2('0x1f'));return _['find'](_0x5ea1aa,function(_0x261077){return _0x261077[_0x29a2('0x20')][_0x29a2('0x21')]===_0xe324cf;});}else{logger[_0x29a2('0xc')](_0x29a2('0x22'));return request({'uri':util[_0x29a2('0x18')](_0x29a2('0x23'),_0x4e7aca[_0x29a2('0x1a')])})[_0x29a2('0x1c')](function(_0x3e5826){logger[_0x29a2('0xc')](_0x29a2('0x24'));return _0x3e5826;});}});}else{logger['info'](_0x29a2('0x25'));return request({'uri':util[_0x29a2('0x18')](_0x29a2('0x23'),_0x4e7aca[_0x29a2('0x1a')])})['then'](function(_0x50a00d){logger[_0x29a2('0xc')](_0x29a2('0x24'));return _0x50a00d;});}}function getEndUser(_0x41cc56,_0x1fd935,_0x1b8695){logger[_0x29a2('0xc')](_0x29a2('0x26'),_0x1b8695);return request({'uri':util[_0x29a2('0x18')](_0x29a2('0x27'),_0x41cc56[_0x29a2('0x1a')]),'qs':{'phone':_0x1b8695}})[_0x29a2('0x1c')](function(_0xa89919){if(_0xa89919[_0x29a2('0x28')]){logger[_0x29a2('0xc')](_0x29a2('0x29'));return _[_0x29a2('0x2a')](_0xa89919,{'phone':_0x1b8695});}else{logger[_0x29a2('0xc')](_0x29a2('0x2b'));return request({'uri':util[_0x29a2('0x18')](_0x29a2('0x27'),_0x41cc56[_0x29a2('0x1a')]),'method':'POST','body':{'name':_0x1fd935,'phone':_0x1b8695}})[_0x29a2('0x1c')](function(_0x4fa6ea){logger[_0x29a2('0xc')](_0x29a2('0x2c'));return _0x4fa6ea;});}});}function getAuth(_0x5a9946){return util[_0x29a2('0x18')]('Basic\x20%s',new Buffer(_0x5a9946[_0x29a2('0x2d')]+':X')[_0x29a2('0x2e')](_0x29a2('0x2f')));}function request(_0x16dc5d){logger['debug'](_0x29a2('0x30'),JSON[_0x29a2('0x31')](_0x16dc5d));return rp(_['defaults'](_0x16dc5d,{'method':_0x29a2('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x435cbe,_0x1414bd){var _0x24585c=[];if(_0x435cbe&&_0x435cbe[_0x29a2('0x28')]>0x0){_0x24585c=_['map'](_0x435cbe,_0x1414bd);}return _0x24585c;}function getCustomFields(_0x24ed14,_0x310402){var _0x115f9e=[];var _0x32fcbb={'custom_fields':[]};if(_0x24ed14[_0x29a2('0x28')]>0x0){_[_0x29a2('0x33')](_0x24ed14,function(_0x86cebf){if(_0x86cebf[_0x29a2('0x34')]===_0x29a2('0x35')&&_0x86cebf['nameField']&&!_0x86cebf['customField']){_0x32fcbb[_0x86cebf[_0x29a2('0x36')][_0x29a2('0x37')]()]=_0x86cebf[_0x29a2('0x38')][_0x29a2('0x2e')]();}else if(_0x86cebf[_0x29a2('0x34')]===_0x29a2('0x35')&&_0x86cebf['idField']&&_0x86cebf[_0x29a2('0x39')]){_0x32fcbb[_0x29a2('0x14')][_0x29a2('0x3a')]({'id':_0x86cebf['idField'],'value':_0x86cebf[_0x29a2('0x38')]['toString']()});}else if(_0x86cebf[_0x29a2('0x34')]===_0x29a2('0x3b')&&_0x86cebf[_0x29a2('0x3c')]&&_0x86cebf['idField']&&_0x86cebf[_0x29a2('0x39')]){_0x310402[_0x86cebf[_0x29a2('0x3c')]]&&_0x32fcbb[_0x29a2('0x14')]['push']({'id':_0x86cebf[_0x29a2('0x3d')],'value':_0x310402[_0x86cebf[_0x29a2('0x3c')]]['toString']()});}else if(_0x86cebf[_0x29a2('0x34')]===_0x29a2('0x3e')&&_0x86cebf[_0x29a2('0x3f')]&&_0x86cebf[_0x29a2('0x3f')]['name']&&_0x86cebf[_0x29a2('0x3d')]&&_0x86cebf[_0x29a2('0x39')]){_0x310402[_0x86cebf[_0x29a2('0x3f')][_0x29a2('0x40')][_0x29a2('0x37')]()]&&_0x32fcbb[_0x29a2('0x14')][_0x29a2('0x3a')]({'id':_0x86cebf['idField'],'value':_0x310402[_0x86cebf[_0x29a2('0x3f')]['name'][_0x29a2('0x37')]()][_0x29a2('0x2e')]()});}});}return _0x32fcbb;}exports[_0x29a2('0x41')]=function(_0x386017,_0x445d0b,_0x465082,_0x49f464,_0x5b4b94,_0x414d73){var _0x3b0cd3,_0x12c138;_0x414d73['remoteUri']=intUtil[_0x29a2('0x42')](_0x414d73['remoteUri']);_0x414d73[_0x29a2('0x43')]=intUtil[_0x29a2('0x42')](_0x414d73[_0x29a2('0x43')]);if(_0x5b4b94&&_0x5b4b94[_0x29a2('0x44')]){logger[_0x29a2('0xc')](_0x29a2('0x45'),_0x29a2('0x46'));_0x445d0b['recordingURL']=util[_0x29a2('0x18')](_0x29a2('0x47'),_0x414d73[_0x29a2('0x43')],_0x445d0b[_0x29a2('0x48')],md5(_0x445d0b[_0x29a2('0x48')]));}else{_0x445d0b['recordingURL']='';}headers['Authorization']=getAuth(_0x414d73);return getUser(_0x414d73,_0x49f464[_0x29a2('0x21')])[_0x29a2('0x1c')](function(_0x105ac9){_0x3b0cd3=_0x105ac9;logger[_0x29a2('0xc')]('The\x20User\x20ID\x20is:',_0x3b0cd3['id']);return getEndUser(_0x414d73,_0x445d0b[_0x29a2('0xe')],_0x445d0b[_0x29a2('0x49')]);})[_0x29a2('0x1c')](function(_0x3de07a){_0x12c138=_0x3de07a;logger['info'](_0x29a2('0x4a'),_0x12c138['id']);return getTicket(_0x414d73,_0x3b0cd3,_0x12c138,_0x465082,_0x445d0b);})[_0x29a2('0x1c')](function(_0x1e4222){if(_0x1e4222&&_0x1e4222['id']){logger[_0x29a2('0xc')]('Ticket\x20created!');logger[_0x29a2('0xc')](_0x29a2('0x4b'),_0x1e4222['id']);logger[_0x29a2('0xc')](_0x29a2('0x45'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x29a2('0x18')](_0x29a2('0x4c'),_0x49f464[_0x29a2('0x40')]),_0x29a2('0x4d'),{'uri':util[_0x29a2('0x18')](_0x29a2('0x4e'),_0x414d73[_0x29a2('0x1a')],_0x1e4222['id'])});}})[_0x29a2('0x4f')](function(_0xdbcea2){logger['error'](_0x29a2('0x45'),JSON[_0x29a2('0x31')](_0xdbcea2));});};exports[_0x29a2('0x50')]=function(_0x23d7da,_0x34cdcf,_0x1864db,_0xace787,_0xb138e1,_0x43727c,_0x2e98b9){var _0x1a75ab,_0x4329fd;_0x43727c[_0x29a2('0x1a')]=intUtil[_0x29a2('0x42')](_0x43727c['remoteUri']);_0x43727c['serverUrl']=intUtil[_0x29a2('0x42')](_0x43727c[_0x29a2('0x43')]);if(_0x2e98b9&&_0x2e98b9['recordingFormat']&&_0x2e98b9[_0x29a2('0x51')]!=='none'){logger[_0x29a2('0xc')](_0x29a2('0x52'),_0x29a2('0x46'));_0x34cdcf[_0x29a2('0x53')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x43727c['serverUrl'],_0x34cdcf['uniqueid'],md5(_0x34cdcf[_0x29a2('0x48')]));}headers[_0x29a2('0x54')]=getAuth(_0x43727c);return getUser(_0x43727c,_0xace787[_0x29a2('0x21')])['then'](function(_0x3bfa0b){_0x1a75ab=_0x3bfa0b;logger[_0x29a2('0xc')](_0x29a2('0x55'),_0x1a75ab['id']);return getEndUser(_0x43727c,_0x34cdcf[_0x29a2('0x56')],_0x34cdcf[_0x29a2('0x57')]);})[_0x29a2('0x1c')](function(_0x34d8d1){_0x4329fd=_0x34d8d1;logger['info'](_0x29a2('0x4a'),_0x4329fd['id']);return getTicket(_0x43727c,_0x1a75ab,_0x4329fd,_0x1864db,_0x34cdcf);})[_0x29a2('0x1c')](function(_0xd080ef){if(_0xd080ef&&_0xd080ef['id']){logger[_0x29a2('0xc')]('Ticket\x20created!');logger[_0x29a2('0xc')](_0x29a2('0x4b'),_0xd080ef['id']);logger[_0x29a2('0xc')](_0x29a2('0x52'),_0x29a2('0x58'));emit(util[_0x29a2('0x18')](_0x29a2('0x4c'),_0xace787['name']),_0x29a2('0x4d'),{'uri':util['format']('%s/helpdesk/tickets/%d',_0x43727c[_0x29a2('0x1a')],_0xd080ef['id'])});}})[_0x29a2('0x4f')](function(_0x5b18d4){logger[_0x29a2('0x59')](_0x29a2('0x52'),JSON[_0x29a2('0x31')](_0x5b18d4));});};exports[_0x29a2('0x5a')]=function(_0x1e12d5,_0x2daf67,_0xce8bd9,_0x1213df,_0x42fd43,_0x19e167){var _0x3eda4e,_0x34daf8;_0x19e167[_0x29a2('0x1a')]=intUtil['stripTrailingSlash'](_0x19e167[_0x29a2('0x1a')]);_0x19e167[_0x29a2('0x43')]=intUtil[_0x29a2('0x42')](_0x19e167[_0x29a2('0x43')]);if(_0x42fd43&&_0x42fd43[_0x29a2('0x44')]){logger[_0x29a2('0xc')](_0x29a2('0x5b'),_0x29a2('0x46'));_0x2daf67[_0x29a2('0x53')]=util[_0x29a2('0x18')](_0x29a2('0x47'),_0x19e167[_0x29a2('0x43')],_0x2daf67[_0x29a2('0x48')],md5(_0x2daf67[_0x29a2('0x48')]));}else{_0x2daf67[_0x29a2('0x53')]='';}headers[_0x29a2('0x54')]=getAuth(_0x19e167);return getUser(_0x19e167,'')[_0x29a2('0x1c')](function(_0x2e5d76){_0x3eda4e=_0x2e5d76;logger[_0x29a2('0xc')](_0x29a2('0x55'),_0x3eda4e['id']);return getEndUser(_0x19e167,_0x2daf67['calleridname'],_0x2daf67[_0x29a2('0x49')]);})[_0x29a2('0x1c')](function(_0x3a3411){_0x34daf8=_0x3a3411;logger['info'](_0x29a2('0x4a'),_0x34daf8['id']);return getTicket(_0x19e167,_0x3eda4e,_0x34daf8,_0xce8bd9,_0x2daf67);})[_0x29a2('0x1c')](function(_0x32afb7){if(_0x32afb7){logger[_0x29a2('0xc')](_0x29a2('0x1d'));logger[_0x29a2('0xc')](_0x29a2('0x4b'),_0x32afb7['id']);}})[_0x29a2('0x4f')](function(_0x4ac5c4){logger[_0x29a2('0x59')]('[ABANDONED]',JSON[_0x29a2('0x31')](_0x4ac5c4));});}; \ No newline at end of file +var _0x74cf=['customField','toLowerCase','content','string','custom_fields','push','variable','variableName','idField','customVariable','Variable','stripTrailingSlash','serverUrl','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','error','[QUEUE]','recordingFormat','none','[OUTBOUND]','destcalleridname','user:%s','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','catch','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','socket.io-emitter','application/json','emit','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Descriptions','
','Tags','name','Fields','mapValues','keyBy','value','%s/api/v2/tickets','then','Ticket\x20created!','%s/api/v2/agents','remoteUri','length','info','find','email','%s/api/v2/agents/me','Admin\x20account\x20selected.','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','Enduser\x20created.','Basic\x20%s','apiKey','toString','base64','debug','stringify','forEach','type','nameField'];(function(_0xef2d36,_0x13cfcc){var _0x1571d8=function(_0x58ba10){while(--_0x58ba10){_0xef2d36['push'](_0xef2d36['shift']());}};_0x1571d8(++_0x13cfcc);}(_0x74cf,0x186));var _0xf74c=function(_0x1ad0b4,_0x3638f4){_0x1ad0b4=_0x1ad0b4-0x0;var _0x42f563=_0x74cf[_0x1ad0b4];return _0x42f563;};'use strict';var _=require(_0xf74c('0x0'));var rp=require(_0xf74c('0x1'));var md5=require(_0xf74c('0x2'));var util=require(_0xf74c('0x3'));var Redis=require(_0xf74c('0x4'));var intUtil=require(_0xf74c('0x5'));var config=require(_0xf74c('0x6'));var logger=require(_0xf74c('0x7'))('freshdesk');config[_0xf74c('0x8')]=_[_0xf74c('0x9')](config[_0xf74c('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xf74c('0xa'))(new Redis(config[_0xf74c('0x8')]));var headers={'Content-Type':'application/json','Accept':_0xf74c('0xb')};function emit(_0x250e45,_0x298d3c,_0x10ee40){io['to'](_0x250e45)[_0xf74c('0xc')](_0x298d3c,_0x10ee40);}function getTicket(_0x856fd7,_0x3159b2,_0x4a9346,_0x44a05a,_0x128287){logger['info']('Creating\x20new\x20ticket...');var _0x2b398d=_[_0xf74c('0xd')]({'responder_id':_0x3159b2['id'],'requester_id':_0x4a9346['id'],'name':util[_0xf74c('0xe')](_0xf74c('0xf'),_0x128287[_0xf74c('0x10')]),'phone':_0x128287[_0xf74c('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xf74c('0x12')](_0x44a05a[_0xf74c('0x13')],_0x128287,'\x20'),'description':intUtil['getString'](_0x44a05a[_0xf74c('0x14')],_0x128287,_0xf74c('0x15')),'tags':getTags(_0x44a05a[_0xf74c('0x16')],_0xf74c('0x17'))},getCustomFields(_0x44a05a[_0xf74c('0x18')],_0x128287));_0x2b398d['custom_fields']=_[_0xf74c('0x19')](_[_0xf74c('0x1a')](_0x2b398d['custom_fields'],'id'),_0xf74c('0x1b'));return request({'uri':util['format'](_0xf74c('0x1c'),_0x856fd7['remoteUri']),'method':'POST','body':_0x2b398d})[_0xf74c('0x1d')](function(_0x5c3a84){logger['info'](_0xf74c('0x1e'));return _0x5c3a84;});}function getUser(_0x2de0cc,_0x45f987){if(intUtil['validateEmail'](_0x45f987)){return request({'uri':util[_0xf74c('0xe')](_0xf74c('0x1f'),_0x2de0cc[_0xf74c('0x20')]),'qs':{'email':_0x45f987}})[_0xf74c('0x1d')](function(_0x3e9ed5){if(_0x3e9ed5[_0xf74c('0x21')]){logger[_0xf74c('0x22')]('Agent\x20found!');return _[_0xf74c('0x23')](_0x3e9ed5,function(_0x4daa49){return _0x4daa49['contact'][_0xf74c('0x24')]===_0x45f987;});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xf74c('0xe')](_0xf74c('0x25'),_0x2de0cc[_0xf74c('0x20')])})[_0xf74c('0x1d')](function(_0x2015a4){logger[_0xf74c('0x22')](_0xf74c('0x26'));return _0x2015a4;});}});}else{logger[_0xf74c('0x22')](_0xf74c('0x27'));return request({'uri':util['format']('%s/api/v2/agents/me',_0x2de0cc[_0xf74c('0x20')])})[_0xf74c('0x1d')](function(_0x131792){logger[_0xf74c('0x22')]('Admin\x20account\x20selected.');return _0x131792;});}}function getEndUser(_0x27f456,_0x32d11c,_0x57c985){logger[_0xf74c('0x22')](_0xf74c('0x28'),_0x57c985);return request({'uri':util[_0xf74c('0xe')](_0xf74c('0x29'),_0x27f456[_0xf74c('0x20')]),'qs':{'phone':_0x57c985}})[_0xf74c('0x1d')](function(_0x305d5c){if(_0x305d5c[_0xf74c('0x21')]){logger['info'](_0xf74c('0x2a'));return _[_0xf74c('0x23')](_0x305d5c,{'phone':_0x57c985});}else{logger[_0xf74c('0x22')](_0xf74c('0x2b'));return request({'uri':util[_0xf74c('0xe')]('%s/api/v2/contacts',_0x27f456['remoteUri']),'method':_0xf74c('0x2c'),'body':{'name':_0x32d11c,'phone':_0x57c985}})[_0xf74c('0x1d')](function(_0x1176ae){logger['info'](_0xf74c('0x2d'));return _0x1176ae;});}});}function getAuth(_0x1435b1){return util[_0xf74c('0xe')](_0xf74c('0x2e'),new Buffer(_0x1435b1[_0xf74c('0x2f')]+':X')[_0xf74c('0x30')](_0xf74c('0x31')));}function request(_0x29ab28){logger[_0xf74c('0x32')]('[HTTP]',JSON[_0xf74c('0x33')](_0x29ab28));return rp(_[_0xf74c('0x9')](_0x29ab28,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x499a8a,_0x5e4ea5){var _0xd219b6=[];if(_0x499a8a&&_0x499a8a[_0xf74c('0x21')]>0x0){_0xd219b6=_['map'](_0x499a8a,_0x5e4ea5);}return _0xd219b6;}function getCustomFields(_0x569a11,_0x546faa){var _0x4287c2=[];var _0x1730a5={'custom_fields':[]};if(_0x569a11[_0xf74c('0x21')]>0x0){_[_0xf74c('0x34')](_0x569a11,function(_0x38a5a7){if(_0x38a5a7[_0xf74c('0x35')]==='string'&&_0x38a5a7[_0xf74c('0x36')]&&!_0x38a5a7[_0xf74c('0x37')]){_0x1730a5[_0x38a5a7[_0xf74c('0x36')][_0xf74c('0x38')]()]=_0x38a5a7[_0xf74c('0x39')][_0xf74c('0x30')]();}else if(_0x38a5a7[_0xf74c('0x35')]===_0xf74c('0x3a')&&_0x38a5a7['idField']&&_0x38a5a7[_0xf74c('0x37')]){_0x1730a5[_0xf74c('0x3b')][_0xf74c('0x3c')]({'id':_0x38a5a7['idField'],'value':_0x38a5a7[_0xf74c('0x39')][_0xf74c('0x30')]()});}else if(_0x38a5a7['type']===_0xf74c('0x3d')&&_0x38a5a7[_0xf74c('0x3e')]&&_0x38a5a7[_0xf74c('0x3f')]&&_0x38a5a7[_0xf74c('0x37')]){_0x546faa[_0x38a5a7['variableName']]&&_0x1730a5['custom_fields']['push']({'id':_0x38a5a7['idField'],'value':_0x546faa[_0x38a5a7[_0xf74c('0x3e')]]['toString']()});}else if(_0x38a5a7[_0xf74c('0x35')]===_0xf74c('0x40')&&_0x38a5a7['Variable']&&_0x38a5a7[_0xf74c('0x41')][_0xf74c('0x17')]&&_0x38a5a7[_0xf74c('0x3f')]&&_0x38a5a7['customField']){_0x546faa[_0x38a5a7['Variable'][_0xf74c('0x17')][_0xf74c('0x38')]()]&&_0x1730a5[_0xf74c('0x3b')][_0xf74c('0x3c')]({'id':_0x38a5a7['idField'],'value':_0x546faa[_0x38a5a7[_0xf74c('0x41')][_0xf74c('0x17')][_0xf74c('0x38')]()][_0xf74c('0x30')]()});}});}return _0x1730a5;}exports['queue']=function(_0x58c2e4,_0x5dda77,_0x15474c,_0x3f962a,_0x293c7e,_0x82061b){var _0x491c6b,_0x2b181e;_0x82061b[_0xf74c('0x20')]=intUtil[_0xf74c('0x42')](_0x82061b[_0xf74c('0x20')]);_0x82061b[_0xf74c('0x43')]=intUtil[_0xf74c('0x42')](_0x82061b['serverUrl']);if(_0x293c7e&&_0x293c7e['monitor_format']){logger[_0xf74c('0x22')]('[QUEUE]',_0xf74c('0x44'));_0x5dda77[_0xf74c('0x45')]=util[_0xf74c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x82061b[_0xf74c('0x43')],_0x5dda77['uniqueid'],md5(_0x5dda77[_0xf74c('0x46')]));}else{_0x5dda77[_0xf74c('0x45')]='';}headers[_0xf74c('0x47')]=getAuth(_0x82061b);return getUser(_0x82061b,_0x3f962a[_0xf74c('0x24')])[_0xf74c('0x1d')](function(_0x4422dd){_0x491c6b=_0x4422dd;logger[_0xf74c('0x22')](_0xf74c('0x48'),_0x491c6b['id']);return getEndUser(_0x82061b,_0x5dda77[_0xf74c('0x10')],_0x5dda77[_0xf74c('0x11')]);})[_0xf74c('0x1d')](function(_0x227144){_0x2b181e=_0x227144;logger['info'](_0xf74c('0x49'),_0x2b181e['id']);return getTicket(_0x82061b,_0x491c6b,_0x2b181e,_0x15474c,_0x5dda77);})['then'](function(_0x972358){if(_0x972358&&_0x972358['id']){logger[_0xf74c('0x22')](_0xf74c('0x1e'));logger[_0xf74c('0x22')](_0xf74c('0x4a'),_0x972358['id']);logger[_0xf74c('0x22')]('[QUEUE]',_0xf74c('0x4b'));emit(util['format']('user:%s',_0x3f962a[_0xf74c('0x17')]),_0xf74c('0x4c'),{'uri':util[_0xf74c('0xe')](_0xf74c('0x4d'),_0x82061b[_0xf74c('0x20')],_0x972358['id'])});}})['catch'](function(_0x380631){logger[_0xf74c('0x4e')](_0xf74c('0x4f'),JSON[_0xf74c('0x33')](_0x380631));});};exports['outbound']=function(_0x117db1,_0x4aff5e,_0xd8e92,_0x593065,_0x3036b8,_0x3433f5,_0x16ba7b){var _0x4fcc7d,_0x344360;_0x3433f5[_0xf74c('0x20')]=intUtil[_0xf74c('0x42')](_0x3433f5[_0xf74c('0x20')]);_0x3433f5[_0xf74c('0x43')]=intUtil[_0xf74c('0x42')](_0x3433f5[_0xf74c('0x43')]);if(_0x16ba7b&&_0x16ba7b[_0xf74c('0x50')]&&_0x16ba7b[_0xf74c('0x50')]!==_0xf74c('0x51')){logger[_0xf74c('0x22')](_0xf74c('0x52'),'Recording\x20is\x20enabled!');_0x4aff5e['recordingURL']=util[_0xf74c('0xe')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3433f5[_0xf74c('0x43')],_0x4aff5e[_0xf74c('0x46')],md5(_0x4aff5e[_0xf74c('0x46')]));}headers[_0xf74c('0x47')]=getAuth(_0x3433f5);return getUser(_0x3433f5,_0x593065['email'])[_0xf74c('0x1d')](function(_0x2399dc){_0x4fcc7d=_0x2399dc;logger['info'](_0xf74c('0x48'),_0x4fcc7d['id']);return getEndUser(_0x3433f5,_0x4aff5e[_0xf74c('0x53')],_0x4aff5e['destcalleridnum']);})[_0xf74c('0x1d')](function(_0x16be2e){_0x344360=_0x16be2e;logger[_0xf74c('0x22')](_0xf74c('0x49'),_0x344360['id']);return getTicket(_0x3433f5,_0x4fcc7d,_0x344360,_0xd8e92,_0x4aff5e);})[_0xf74c('0x1d')](function(_0x4bfded){if(_0x4bfded&&_0x4bfded['id']){logger['info']('Ticket\x20created!');logger[_0xf74c('0x22')](_0xf74c('0x4a'),_0x4bfded['id']);logger[_0xf74c('0x22')](_0xf74c('0x52'),_0xf74c('0x4b'));emit(util[_0xf74c('0xe')](_0xf74c('0x54'),_0x593065[_0xf74c('0x17')]),_0xf74c('0x4c'),{'uri':util[_0xf74c('0xe')](_0xf74c('0x4d'),_0x3433f5[_0xf74c('0x20')],_0x4bfded['id'])});}})['catch'](function(_0x49ddc3){logger[_0xf74c('0x4e')](_0xf74c('0x52'),JSON['stringify'](_0x49ddc3));});};exports[_0xf74c('0x55')]=function(_0x30b38c,_0x52b1db,_0x20e7f1,_0x1125e0,_0x21ee14,_0xe4984b){var _0x3217fd,_0x193e01;_0xe4984b[_0xf74c('0x20')]=intUtil[_0xf74c('0x42')](_0xe4984b[_0xf74c('0x20')]);_0xe4984b[_0xf74c('0x43')]=intUtil['stripTrailingSlash'](_0xe4984b[_0xf74c('0x43')]);if(_0x21ee14&&_0x21ee14['monitor_format']){logger['info']('[ABANDONED]',_0xf74c('0x44'));_0x52b1db[_0xf74c('0x45')]=util[_0xf74c('0xe')](_0xf74c('0x56'),_0xe4984b[_0xf74c('0x43')],_0x52b1db['uniqueid'],md5(_0x52b1db[_0xf74c('0x46')]));}else{_0x52b1db[_0xf74c('0x45')]='';}headers[_0xf74c('0x47')]=getAuth(_0xe4984b);return getUser(_0xe4984b,'')[_0xf74c('0x1d')](function(_0x4a7cbd){_0x3217fd=_0x4a7cbd;logger['info'](_0xf74c('0x48'),_0x3217fd['id']);return getEndUser(_0xe4984b,_0x52b1db['calleridname'],_0x52b1db[_0xf74c('0x11')]);})['then'](function(_0x166ca4){_0x193e01=_0x166ca4;logger[_0xf74c('0x22')](_0xf74c('0x49'),_0x193e01['id']);return getTicket(_0xe4984b,_0x3217fd,_0x193e01,_0x20e7f1,_0x52b1db);})['then'](function(_0x248d2d){if(_0x248d2d){logger[_0xf74c('0x22')]('Ticket\x20created!');logger[_0xf74c('0x22')]('The\x20Ticket\x20ID\x20is:',_0x248d2d['id']);}})[_0xf74c('0x57')](function(_0xc6588c){logger[_0xf74c('0x4e')](_0xf74c('0x58'),JSON['stringify'](_0xc6588c));});}; \ 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 acb998e..caf61f5 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 _0x37b9=['find','Configurations','data3','queue','routeId','EVENT\x20UNKNOWN','abandoned','freshdesk','servicenow','log','error','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','util','./zendesk','./sugarcrm','./freshdesk','./desk','./vtiger','./servicenow','./dynamics365','zendesk','salesforce','zoho','desk','vtiger','dynamics365','exec','data1','toLowerCase','data2'];(function(_0x57834a,_0x15b46f){var _0xc5ff85=function(_0x50a0e2){while(--_0x50a0e2){_0x57834a['push'](_0x57834a['shift']());}};_0xc5ff85(++_0x15b46f);}(_0x37b9,0xae));var _0x937b=function(_0x5eb22e,_0x27cbac){_0x5eb22e=_0x5eb22e-0x0;var _0x27fed5=_0x37b9[_0x5eb22e];return _0x27fed5;};'use strict';var _=require('lodash');var util=require(_0x937b('0x0'));var zendesk=require(_0x937b('0x1'));var salesforce=require('./salesforce');var sugarcrm=require(_0x937b('0x2'));var freshdesk=require(_0x937b('0x3'));var zoho=require('./zoho');var desk=require(_0x937b('0x4'));var vtiger=require(_0x937b('0x5'));var servicenow=require(_0x937b('0x6'));var dynamics365=require(_0x937b('0x7'));var integrations=[_0x937b('0x8'),_0x937b('0x9'),'sugarcrm','freshdesk',_0x937b('0xa'),_0x937b('0xb'),_0x937b('0xc'),'servicenow',_0x937b('0xd')];exports[_0x937b('0xe')]=function(_0x3e021c,_0x1f1280,_0x31153a,_0x12ba70,_0x239ce8,_0x56d046){if(_0x31153a){if(_['includes'](integrations,_0x3e021c[_0x937b('0xf')][_0x937b('0x10')]())){try{var _0x4f034d=null;var _0x57e7db='';var _0x38c9fd=_0x31153a[_0x3e021c[_0x937b('0xf')]['toLowerCase']()];if(_0x38c9fd){var _0x4c0d97=_0x38c9fd[_0x3e021c[_0x937b('0x11')]];if(_0x4c0d97){var _0x29fd62=_[_0x937b('0x12')](_0x4c0d97[_0x937b('0x13')],{'id':parseInt(_0x3e021c[_0x937b('0x14')],0xa)});if(_0x29fd62){if(_0x12ba70){if(_0x239ce8&&_0x1f1280['queue']){_0x57e7db=_0x937b('0x15');}else if(_0x1f1280[_0x937b('0x16')]){_0x57e7db='outbound';}else{console['log'](_0x937b('0x17'),_0x1f1280);}}else{_0x57e7db=_0x937b('0x18');}switch(_0x3e021c[_0x937b('0xf')][_0x937b('0x10')]()){case _0x937b('0x8'):zendesk[_0x57e7db](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046);break;case _0x937b('0x9'):salesforce[_0x57e7db](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046);break;case'sugarcrm':sugarcrm[_0x57e7db](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046);break;case _0x937b('0x19'):freshdesk[_0x57e7db](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046);break;case'zoho':zoho[_0x57e7db](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046);break;case _0x937b('0xb'):desk[_0x57e7db](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046);break;case _0x937b('0xc'):vtiger[_0x57e7db](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046);break;case _0x937b('0x1a'):servicenow['cs'](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046,_0x57e7db);break;case'dynamics365':dynamics365['cs'](_0x3e021c,_0x1f1280,_0x29fd62,_0x12ba70,_0x239ce8,_0x4c0d97,_0x56d046,_0x57e7db);break;default:console[_0x937b('0x1b')]('unknown\x20integration');}}else{_0x4f034d=require('../../../../config/logger')(_0x3e021c[_0x937b('0xf')][_0x937b('0x10')]());_0x4f034d[_0x937b('0x1c')](_0x937b('0x1d'),util[_0x937b('0x1e')](_0x937b('0x1f'),_0x3e021c[_0x937b('0xf')][_0x937b('0x10')](),_0x3e021c[_0x937b('0x14')]));}}else{_0x4f034d=require('../../../../config/logger')(_0x3e021c[_0x937b('0xf')]['toLowerCase']());_0x4f034d[_0x937b('0x1c')](_0x937b('0x1d'),util[_0x937b('0x1e')]('%s\x20account\x20#%s\x20not\x20found',_0x3e021c[_0x937b('0xf')]['toLowerCase'](),_0x3e021c['data2']));}}else{}}catch(_0x228353){console[_0x937b('0x1c')](_0x228353);}}}}; \ No newline at end of file +var _0x0b3e=['./zoho','./desk','./vtiger','./dynamics365','salesforce','sugarcrm','freshdesk','desk','vtiger','dynamics365','exec','includes','toLowerCase','data2','find','queue','routeId','log','EVENT\x20UNKNOWN','abandoned','data1','zoho','servicenow','unknown\x20integration','../../../../config/logger','[EXEC]','format','%s\x20configuration\x20#%s\x20not\x20found','data3','error','lodash','util','./zendesk','./salesforce','./sugarcrm','./freshdesk'];(function(_0x4ca0f1,_0x58386c){var _0x62b788=function(_0x5735e1){while(--_0x5735e1){_0x4ca0f1['push'](_0x4ca0f1['shift']());}};_0x62b788(++_0x58386c);}(_0x0b3e,0x66));var _0xe0b3=function(_0x3e7734,_0x1878c1){_0x3e7734=_0x3e7734-0x0;var _0x634473=_0x0b3e[_0x3e7734];return _0x634473;};'use strict';var _=require(_0xe0b3('0x0'));var util=require(_0xe0b3('0x1'));var zendesk=require(_0xe0b3('0x2'));var salesforce=require(_0xe0b3('0x3'));var sugarcrm=require(_0xe0b3('0x4'));var freshdesk=require(_0xe0b3('0x5'));var zoho=require(_0xe0b3('0x6'));var desk=require(_0xe0b3('0x7'));var vtiger=require(_0xe0b3('0x8'));var servicenow=require('./servicenow');var dynamics365=require(_0xe0b3('0x9'));var integrations=['zendesk',_0xe0b3('0xa'),_0xe0b3('0xb'),_0xe0b3('0xc'),'zoho',_0xe0b3('0xd'),_0xe0b3('0xe'),'servicenow',_0xe0b3('0xf')];exports[_0xe0b3('0x10')]=function(_0x2b5059,_0x53b8a2,_0xad3543,_0x57cb9f,_0x39e9fd,_0x226d90){if(_0xad3543){if(_[_0xe0b3('0x11')](integrations,_0x2b5059['data1'][_0xe0b3('0x12')]())){try{var _0x36de6b=null;var _0x5a67ff='';var _0x4a9edc=_0xad3543[_0x2b5059['data1'][_0xe0b3('0x12')]()];if(_0x4a9edc){var _0x573fb1=_0x4a9edc[_0x2b5059[_0xe0b3('0x13')]];if(_0x573fb1){var _0xade87=_[_0xe0b3('0x14')](_0x573fb1['Configurations'],{'id':parseInt(_0x2b5059['data3'],0xa)});if(_0xade87){if(_0x57cb9f){if(_0x39e9fd&&_0x53b8a2['queue']){_0x5a67ff=_0xe0b3('0x15');}else if(_0x53b8a2[_0xe0b3('0x16')]){_0x5a67ff='outbound';}else{console[_0xe0b3('0x17')](_0xe0b3('0x18'),_0x53b8a2);}}else{_0x5a67ff=_0xe0b3('0x19');}switch(_0x2b5059[_0xe0b3('0x1a')]['toLowerCase']()){case'zendesk':zendesk[_0x5a67ff](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90);break;case _0xe0b3('0xa'):salesforce[_0x5a67ff](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90);break;case _0xe0b3('0xb'):sugarcrm[_0x5a67ff](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90);break;case _0xe0b3('0xc'):freshdesk[_0x5a67ff](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90);break;case _0xe0b3('0x1b'):zoho[_0x5a67ff](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90);break;case _0xe0b3('0xd'):desk[_0x5a67ff](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90);break;case _0xe0b3('0xe'):vtiger[_0x5a67ff](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90);break;case _0xe0b3('0x1c'):servicenow['cs'](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90,_0x5a67ff);break;case _0xe0b3('0xf'):dynamics365['cs'](_0x2b5059,_0x53b8a2,_0xade87,_0x57cb9f,_0x39e9fd,_0x573fb1,_0x226d90,_0x5a67ff);break;default:console[_0xe0b3('0x17')](_0xe0b3('0x1d'));}}else{_0x36de6b=require(_0xe0b3('0x1e'))(_0x2b5059[_0xe0b3('0x1a')][_0xe0b3('0x12')]());_0x36de6b['error'](_0xe0b3('0x1f'),util[_0xe0b3('0x20')](_0xe0b3('0x21'),_0x2b5059['data1'][_0xe0b3('0x12')](),_0x2b5059[_0xe0b3('0x22')]));}}else{_0x36de6b=require(_0xe0b3('0x1e'))(_0x2b5059[_0xe0b3('0x1a')][_0xe0b3('0x12')]());_0x36de6b[_0xe0b3('0x23')](_0xe0b3('0x1f'),util[_0xe0b3('0x20')]('%s\x20account\x20#%s\x20not\x20found',_0x2b5059[_0xe0b3('0x1a')]['toLowerCase'](),_0x2b5059['data2']));}}else{}}catch(_0x293c3e){console['error'](_0x293c3e);}}}}; \ 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 f6e1292..5445c5b 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 _0xb329=['%s/%s/e','instanceUrl','error','catch','stringify','outbound','recordingFormat','none','destcalleridname','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','[OUTBOUND]','abandoned','calleridname','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','[ABANDONED]','bluebird','md5','util','ioredis','../../../../config/logger','salesforce','redis','defaults','socket.io-emitter','emit','Task','getString','Subjects','WhoId','assign','Descriptions','ContactId','create','isNil','sobject','User','find','execute','then','Email','resolve','Name','info','identity','user_id','display_name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','ticketType','moduleSearch','Contact','length','Lead','contact','lead','Case','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Phone','','format','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','concat','securityToken','Connection','clientId','clientSecret','login','serverUrl','stripTrailingSlash','remoteUri','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb329,0x142));var _0x9b32=function(_0x1b8b95,_0x3ea343){_0x1b8b95=_0x1b8b95-0x0;var _0x3657ae=_0xb329[_0x1b8b95];return _0x3657ae;};'use strict';var _=require('lodash');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x9b32('0x0'));var md5=require(_0x9b32('0x1'));var jsforce=require('jsforce');var util=require(_0x9b32('0x2'));var Redis=require(_0x9b32('0x3'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require(_0x9b32('0x4'))(_0x9b32('0x5'));config[_0x9b32('0x6')]=_[_0x9b32('0x7')](config[_0x9b32('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0x9b32('0x8'))(new Redis(config[_0x9b32('0x6')]));function emit(_0x5cca7e,_0x14b344,_0x77ef3b){io['to'](_0x5cca7e)[_0x9b32('0x9')](_0x14b344,_0x77ef3b);}function getTicket(_0x930d10,_0x3b6c07,_0x314b5f,_0x5b2940,_0x1c92ad,_0x22add5,_0x510044,_0x4c4ce0){var _0xb798b3={};if(_0x5b2940['ticketType']===_0x9b32('0xa')){_0xb798b3=Object['assign']({},{'OwnerId':_0x3b6c07['id'],'ActivityDate':moment['utc'](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x9b32('0xb')](_0x5b2940[_0x9b32('0xc')],_0x1c92ad,'\x20'),'Description':intUtil[_0x9b32('0xb')](_0x5b2940['Descriptions'],_0x1c92ad,'\x0a')},getCustomFields(_0x22add5,_0x1c92ad));if(_0x314b5f){_0xb798b3[_0x9b32('0xd')]=_0x314b5f['id'];}}else if(_0x5b2940['ticketType']==='Case'){_0xb798b3=Object[_0x9b32('0xe')]({},{'OwnerId':_0x3b6c07['id'],'Subject':intUtil[_0x9b32('0xb')](_0x5b2940[_0x9b32('0xc')],_0x1c92ad,'\x20'),'Description':intUtil['getString'](_0x5b2940[_0x9b32('0xf')],_0x1c92ad,'\x0a')},getCustomFields(_0x22add5,_0x1c92ad));if(_0x314b5f){_0xb798b3[_0x9b32('0x10')]=_0x314b5f['id'];}}return _0x510044['sobject'](_0x5b2940['ticketType'])[_0x9b32('0x11')](_0xb798b3);}function getUser(_0x192852,_0x3d2893,_0x50c14e){if(!_[_0x9b32('0x12')](_0x3d2893)&&intUtil['validateEmail'](_0x3d2893)){var _0x3fe518={'Email':_0x3d2893};var _0x306135={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x50c14e[_0x9b32('0x13')](_0x9b32('0x14'))[_0x9b32('0x15')](_0x3fe518,_0x306135)[_0x9b32('0x16')]()[_0x9b32('0x17')](function(_0x165c9e){if(_0x165c9e['length']){var _0x5b09b9=_[_0x9b32('0x15')](_0x165c9e,function(_0x3dfa03){return _0x3dfa03[_0x9b32('0x18')]===_0x3d2893;});if(_0x5b09b9){logger['info']('Agent\x20%s\x20found.',_0x3d2893);return BPromise[_0x9b32('0x19')]({'id':_0x5b09b9['Id'],'name':_0x5b09b9[_0x9b32('0x1a')]});}}else{logger[_0x9b32('0x1b')]('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x3d2893);return _0x50c14e[_0x9b32('0x1c')]()[_0x9b32('0x17')](function(_0x568e96){return BPromise['resolve']({'id':_0x568e96[_0x9b32('0x1d')],'name':_0x568e96[_0x9b32('0x1e')]});});}});}else{logger[_0x9b32('0x1b')](_0x9b32('0x1f'),_0x3d2893);return _0x50c14e[_0x9b32('0x1c')]()['then'](function(_0x219632){return BPromise[_0x9b32('0x19')]({'id':_0x219632[_0x9b32('0x1d')],'name':_0x219632[_0x9b32('0x1e')]});});}}function getEndUser(_0x40eb66,_0x30dbfb,_0x19c76c,_0x38cea4,_0x3333ee){var _0x25bff3={'Phone':_0x38cea4};var _0x473dfa={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x9b32('0x19')]()[_0x9b32('0x17')](function(){if(_0x30dbfb[_0x9b32('0x20')]===_0x9b32('0xa')){logger[_0x9b32('0x1b')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x38cea4,_0x30dbfb[_0x9b32('0x21')]);switch(_0x30dbfb[_0x9b32('0x21')]){case'contact_lead':return _0x3333ee[_0x9b32('0x13')](_0x9b32('0x22'))[_0x9b32('0x15')](_0x25bff3,_0x473dfa)[_0x9b32('0x16')]()['then'](function(_0x31b63f){if(_0x31b63f&&_0x31b63f[_0x9b32('0x23')]){return _0x31b63f;}else{return _0x3333ee['sobject'](_0x9b32('0x24'))[_0x9b32('0x15')](_0x25bff3,_0x473dfa);}});case _0x9b32('0x25'):return _0x3333ee[_0x9b32('0x13')](_0x9b32('0x22'))[_0x9b32('0x15')](_0x25bff3,_0x473dfa)[_0x9b32('0x16')]();case _0x9b32('0x26'):return _0x3333ee[_0x9b32('0x13')]('Lead')[_0x9b32('0x15')](_0x25bff3,_0x473dfa);default:return null;}}else if(_0x30dbfb[_0x9b32('0x20')]===_0x9b32('0x27')){logger[_0x9b32('0x1b')](_0x9b32('0x28'),_0x38cea4,_0x9b32('0x25'));return _0x3333ee[_0x9b32('0x13')](_0x9b32('0x22'))['find'](_0x25bff3,_0x473dfa)[_0x9b32('0x16')]();}})[_0x9b32('0x17')](function(_0x10b4c3){if(_0x10b4c3&&_0x10b4c3[_0x9b32('0x23')]){var _0x518f07=_[_0x9b32('0x15')](_0x10b4c3,function(_0x369402){return _0x369402[_0x9b32('0x29')]===_0x38cea4;});if(_0x518f07){return BPromise[_0x9b32('0x19')]({'id':_0x518f07['Id'],'name':_0x518f07[_0x9b32('0x1a')],'phone':_0x518f07['Phone']});}}})[_0x9b32('0x17')](function(_0x553109){if(_0x553109){logger[_0x9b32('0x1b')]('Enduser\x20with\x20phone\x20%s\x20found.',_0x38cea4);return BPromise[_0x9b32('0x19')](_0x553109);}else{logger['info']('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x38cea4);var _0x1a439d={'LastName':_0x19c76c!==_0x9b32('0x2a')?_0x19c76c:util[_0x9b32('0x2b')](_0x9b32('0x2c'),_0x38cea4),'Phone':_0x38cea4};if(_0x30dbfb['moduleCreate']){if(_0x30dbfb[_0x9b32('0x2d')]===_0x9b32('0x25')){logger[_0x9b32('0x1b')](_0x9b32('0x2e'),_0x38cea4,_0x30dbfb['moduleCreate']);}else if(_0x30dbfb[_0x9b32('0x2d')]===_0x9b32('0x26')&&_0x30dbfb['ticketType']===_0x9b32('0xa')){logger[_0x9b32('0x1b')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x38cea4,_0x30dbfb['moduleCreate']);_0x1a439d[_0x9b32('0x2f')]=_0x9b32('0x30');}else{return null;}}return _0x3333ee[_0x9b32('0x13')](_[_0x9b32('0x31')](_0x30dbfb[_0x9b32('0x2d')]))[_0x9b32('0x11')](_0x1a439d);}});}function getCustomFields(_0x57c5b8,_0x14ea25){var _0x312765={};if(_0x57c5b8[_0x9b32('0x23')]>0x0){_[_0x9b32('0x32')](_0x57c5b8,function(_0x16de07){if(_0x16de07[_0x9b32('0x33')]===_0x9b32('0x34')&&_0x16de07[_0x9b32('0x35')]){_0x312765[_0x16de07[_0x9b32('0x35')]]=_0x16de07['content'][_0x9b32('0x36')]();}else if(_0x16de07[_0x9b32('0x33')]===_0x9b32('0x37')&&_0x16de07['variableName']&&_0x16de07[_0x9b32('0x35')]){_0x14ea25[_0x16de07[_0x9b32('0x38')]]&&(_0x312765[_0x16de07[_0x9b32('0x35')]]=_0x14ea25[_0x16de07['variableName']][_0x9b32('0x36')]());}else if(_0x16de07['type']===_0x9b32('0x39')&&_0x16de07[_0x9b32('0x3a')]&&_0x16de07[_0x9b32('0x3a')][_0x9b32('0x3b')]&&_0x16de07['idField']){_0x14ea25[_0x16de07['Variable'][_0x9b32('0x3b')][_0x9b32('0x3c')]()]&&(_0x312765[_0x16de07['idField']]=_0x14ea25[_0x16de07[_0x9b32('0x3a')][_0x9b32('0x3b')][_0x9b32('0x3c')]()][_0x9b32('0x36')]());}});}return _0x312765;}function getConnection(_0x1e6aab){var _0x5553aa=_0x1e6aab['password'][_0x9b32('0x3d')](_0x1e6aab[_0x9b32('0x3e')]);var _0x168c6b=new jsforce[(_0x9b32('0x3f'))]({'oauth2':{'loginUrl':_0x1e6aab['remoteUri']||'https://login.salesforce.com','clientId':_0x1e6aab[_0x9b32('0x40')],'clientSecret':_0x1e6aab[_0x9b32('0x41')]}});return _0x168c6b[_0x9b32('0x42')](_0x1e6aab['username'],_0x5553aa)[_0x9b32('0x17')](function(){logger['info']('Connection\x20established.');return _0x168c6b;});}exports['queue']=function(_0x58d6e7,_0x5eb33b,_0x1ce388,_0x391e38,_0x5f1584,_0x2be984){var _0x3d50db,_0x4e2db3,_0x5dd2dd,_0xccb831;_0x2be984[_0x9b32('0x43')]=intUtil[_0x9b32('0x44')](_0x2be984[_0x9b32('0x43')]);_0x2be984[_0x9b32('0x45')]=intUtil[_0x9b32('0x44')](_0x2be984['remoteUri']);if(_0x5f1584&&_0x5f1584[_0x9b32('0x46')]){logger[_0x9b32('0x1b')]('[QUEUE]',_0x9b32('0x47'));_0x5eb33b[_0x9b32('0x48')]=util['format'](_0x9b32('0x49'),_0x2be984[_0x9b32('0x43')],_0x5eb33b[_0x9b32('0x4a')],md5(_0x5eb33b['uniqueid']));}else{_0x5eb33b[_0x9b32('0x48')]='';}return getConnection(_0x2be984)['then'](function(_0x57d331){_0xccb831=_0x57d331;return getUser(_0x2be984,_0x391e38[_0x9b32('0x4b')],_0xccb831);})[_0x9b32('0x17')](function(_0x4366b9){_0x3d50db=_0x4366b9;return getEndUser(_0x2be984,_0x1ce388,_0x5eb33b['calleridname'],_0x5eb33b[_0x9b32('0x4c')],_0xccb831);})[_0x9b32('0x17')](function(_0x4c0605){_0x4e2db3=_0x4c0605;return getTicket(_0x2be984,_0x3d50db,_0x4e2db3,_0x1ce388,_0x5eb33b,_0x1ce388[_0x9b32('0x4d')],_0xccb831,_0x9b32('0x4e'));})[_0x9b32('0x17')](function(_0x30aa0e){_0x5dd2dd=_0x30aa0e;logger[_0x9b32('0x1b')](_0x9b32('0x4f'),_0x5dd2dd['id']);logger['info'](_0x9b32('0x50'),_0x5dd2dd['id'],_0x391e38[_0x9b32('0x3b')],_0x2be984[_0x9b32('0x33')]);switch(_0x2be984[_0x9b32('0x33')]){case _0x9b32('0x51'):emit(util[_0x9b32('0x2b')](_0x9b32('0x52'),_0x391e38[_0x9b32('0x3b')]),_0x9b32('0x53'),{'recordId':_0x5dd2dd['id']});break;case _0x9b32('0x54'):emit(util[_0x9b32('0x2b')](_0x9b32('0x52'),_0x391e38[_0x9b32('0x3b')]),_0x9b32('0x55'),{'uri':util[_0x9b32('0x2b')](_0x9b32('0x56'),_0xccb831[_0x9b32('0x57')],_0x5dd2dd['id'])});break;default:logger[_0x9b32('0x58')]('[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.');}})[_0x9b32('0x59')](function(_0x181dcd){logger[_0x9b32('0x58')]('[QUEUE]',JSON[_0x9b32('0x5a')](_0x181dcd));});};exports[_0x9b32('0x5b')]=function(_0x3050fd,_0x5cc61f,_0x471265,_0x1273db,_0x4edb64,_0x4eda09,_0x358cbd){var _0x418608,_0x4b2bc9,_0x5e4a71,_0x2d72a5;_0x4eda09[_0x9b32('0x43')]=intUtil[_0x9b32('0x44')](_0x4eda09[_0x9b32('0x43')]);_0x4eda09[_0x9b32('0x45')]=intUtil[_0x9b32('0x44')](_0x4eda09['remoteUri']);if(_0x358cbd&&_0x358cbd[_0x9b32('0x5c')]&&_0x358cbd[_0x9b32('0x5c')]!==_0x9b32('0x5d')){logger[_0x9b32('0x1b')]('[OUTBOUND]',_0x9b32('0x47'));_0x5cc61f['recordingURL']=util['format'](_0x9b32('0x49'),_0x4eda09['serverUrl'],_0x5cc61f[_0x9b32('0x4a')],md5(_0x5cc61f['uniqueid']));}return getConnection(_0x4eda09)[_0x9b32('0x17')](function(_0x2c705f){_0x2d72a5=_0x2c705f;return getUser(_0x4eda09,_0x1273db[_0x9b32('0x4b')],_0x2d72a5);})['then'](function(_0x5911f5){_0x418608=_0x5911f5;return getEndUser(_0x4eda09,_0x471265,_0x5cc61f[_0x9b32('0x5e')],_0x5cc61f['destcalleridnum'],_0x2d72a5);})[_0x9b32('0x17')](function(_0x4ee0fc){_0x4b2bc9=_0x4ee0fc;return getTicket(_0x4eda09,_0x418608,_0x4b2bc9,_0x471265,_0x5cc61f,_0x471265[_0x9b32('0x4d')],_0x2d72a5,_0x9b32('0x5b'));})[_0x9b32('0x17')](function(_0x106657){_0x5e4a71=_0x106657;logger['info'](_0x9b32('0x5f'),_0x5e4a71['id']);logger[_0x9b32('0x1b')](_0x9b32('0x60'),_0x5e4a71['id'],_0x1273db[_0x9b32('0x3b')],_0x4eda09[_0x9b32('0x33')]);switch(_0x4eda09[_0x9b32('0x33')]){case _0x9b32('0x51'):emit(util[_0x9b32('0x2b')](_0x9b32('0x52'),_0x1273db[_0x9b32('0x3b')]),_0x9b32('0x53'),{'recordId':_0x5e4a71['id']});break;case _0x9b32('0x54'):emit(util[_0x9b32('0x2b')](_0x9b32('0x52'),_0x1273db[_0x9b32('0x3b')]),_0x9b32('0x55'),{'uri':util[_0x9b32('0x2b')](_0x9b32('0x56'),_0x2d72a5[_0x9b32('0x57')],_0x5e4a71['id'])});break;default:logger[_0x9b32('0x58')](_0x9b32('0x61'),'Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x2c2bc5){logger[_0x9b32('0x58')]('[OUTBOUND]',JSON['stringify'](_0x2c2bc5));});};exports[_0x9b32('0x62')]=function(_0x1d0aca,_0x412305,_0x233df1,_0x145b85,_0x3b298f,_0x1fe3b1){var _0x44fd9b,_0x5f692d,_0x17e058,_0x14712c;_0x1fe3b1['serverUrl']=intUtil[_0x9b32('0x44')](_0x1fe3b1[_0x9b32('0x43')]);_0x1fe3b1[_0x9b32('0x45')]=intUtil[_0x9b32('0x44')](_0x1fe3b1[_0x9b32('0x45')]);if(_0x3b298f&&_0x3b298f[_0x9b32('0x46')]){logger['info']('[ABANDONED]',_0x9b32('0x47'));_0x412305[_0x9b32('0x48')]=util['format'](_0x9b32('0x49'),_0x1fe3b1[_0x9b32('0x43')],_0x412305['uniqueid'],md5(_0x412305[_0x9b32('0x4a')]));}else{_0x412305[_0x9b32('0x48')]='';}return getConnection(_0x1fe3b1)[_0x9b32('0x17')](function(_0x8a957c){_0x14712c=_0x8a957c;if(!_[_0x9b32('0x12')](_0x145b85)){return getUser(_0x1fe3b1,_0x145b85[_0x9b32('0x3b')],_0x14712c);}else{return getUser(_0x1fe3b1,null,_0x14712c);}})[_0x9b32('0x17')](function(_0x444a43){_0x44fd9b=_0x444a43;return getEndUser(_0x1fe3b1,_0x233df1,_0x412305[_0x9b32('0x63')],_0x412305[_0x9b32('0x4c')],_0x14712c);})[_0x9b32('0x17')](function(_0x25b78b){_0x5f692d=_0x25b78b;return getTicket(_0x1fe3b1,_0x44fd9b,_0x5f692d,_0x233df1,_0x412305,_0x233df1[_0x9b32('0x4d')],_0x14712c);})['then'](function(_0x27e2a2){_0x17e058=_0x27e2a2;logger[_0x9b32('0x1b')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x17e058['id']);logger[_0x9b32('0x1b')](_0x9b32('0x64'),_0x1fe3b1[_0x9b32('0x33')]);})[_0x9b32('0x59')](function(_0x18dfea){logger[_0x9b32('0x58')](_0x9b32('0x65'),JSON['stringify'](_0x18dfea));});}; \ No newline at end of file +var _0xc813=['password','concat','securityToken','Connection','remoteUri','https://login.salesforce.com','clientId','clientSecret','login','Connection\x20established.','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','newTab','user:%s','trigger:browser:url','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','recordingFormat','none','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]','[ABANDONED]','lodash','request-promise','moment','jsforce','util','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','WhoId','Case','Subjects','Descriptions','ContactId','create','isNil','User','find','then','length','Email','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','user_id','moduleSearch','contact_lead','sobject','Contact','execute','Lead','contact','lead','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','forEach','type','string','idField','content','toString','variableName','customVariable','Variable','name','toLowerCase'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc813,0x94));var _0x3c81=function(_0x225737,_0x28110b){_0x225737=_0x225737-0x0;var _0x4c5156=_0xc813[_0x225737];return _0x4c5156;};'use strict';var _=require(_0x3c81('0x0'));var rp=require(_0x3c81('0x1'));var moment=require(_0x3c81('0x2'));var BPromise=require('bluebird');var md5=require('md5');var jsforce=require(_0x3c81('0x3'));var util=require(_0x3c81('0x4'));var Redis=require('ioredis');var intUtil=require(_0x3c81('0x5'));var config=require('../../../../config/environment');var logger=require(_0x3c81('0x6'))(_0x3c81('0x7'));config[_0x3c81('0x8')]=_[_0x3c81('0x9')](config[_0x3c81('0x8')],{'host':_0x3c81('0xa'),'port':0x18eb});var io=require(_0x3c81('0xb'))(new Redis(config[_0x3c81('0x8')]));function emit(_0x16040e,_0x3924d0,_0x2bfa97){io['to'](_0x16040e)[_0x3c81('0xc')](_0x3924d0,_0x2bfa97);}function getTicket(_0x309bc6,_0x13285c,_0x145507,_0xc4c5b9,_0x3f72d4,_0x276664,_0x4c1b5a,_0xa47661){var _0x49b216={};if(_0xc4c5b9[_0x3c81('0xd')]===_0x3c81('0xe')){_0x49b216=Object[_0x3c81('0xf')]({},{'OwnerId':_0x13285c['id'],'ActivityDate':moment[_0x3c81('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0xc4c5b9['Subjects'],_0x3f72d4,'\x20'),'Description':intUtil[_0x3c81('0x11')](_0xc4c5b9['Descriptions'],_0x3f72d4,'\x0a')},getCustomFields(_0x276664,_0x3f72d4));if(_0x145507){_0x49b216[_0x3c81('0x12')]=_0x145507['id'];}}else if(_0xc4c5b9[_0x3c81('0xd')]===_0x3c81('0x13')){_0x49b216=Object[_0x3c81('0xf')]({},{'OwnerId':_0x13285c['id'],'Subject':intUtil[_0x3c81('0x11')](_0xc4c5b9[_0x3c81('0x14')],_0x3f72d4,'\x20'),'Description':intUtil['getString'](_0xc4c5b9[_0x3c81('0x15')],_0x3f72d4,'\x0a')},getCustomFields(_0x276664,_0x3f72d4));if(_0x145507){_0x49b216[_0x3c81('0x16')]=_0x145507['id'];}}return _0x4c1b5a['sobject'](_0xc4c5b9[_0x3c81('0xd')])[_0x3c81('0x17')](_0x49b216);}function getUser(_0x51ebb3,_0x2b9c5c,_0x4de097){if(!_[_0x3c81('0x18')](_0x2b9c5c)&&intUtil['validateEmail'](_0x2b9c5c)){var _0x4168fc={'Email':_0x2b9c5c};var _0x3a2220={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x4de097['sobject'](_0x3c81('0x19'))[_0x3c81('0x1a')](_0x4168fc,_0x3a2220)['execute']()[_0x3c81('0x1b')](function(_0x4463c9){if(_0x4463c9[_0x3c81('0x1c')]){var _0x3dbb3b=_['find'](_0x4463c9,function(_0xe9aa51){return _0xe9aa51[_0x3c81('0x1d')]===_0x2b9c5c;});if(_0x3dbb3b){logger[_0x3c81('0x1e')](_0x3c81('0x1f'),_0x2b9c5c);return BPromise[_0x3c81('0x20')]({'id':_0x3dbb3b['Id'],'name':_0x3dbb3b[_0x3c81('0x21')]});}}else{logger['info'](_0x3c81('0x22'),_0x2b9c5c);return _0x4de097[_0x3c81('0x23')]()[_0x3c81('0x1b')](function(_0xd4483d){return BPromise[_0x3c81('0x20')]({'id':_0xd4483d['user_id'],'name':_0xd4483d[_0x3c81('0x24')]});});}});}else{logger[_0x3c81('0x1e')](_0x3c81('0x22'),_0x2b9c5c);return _0x4de097[_0x3c81('0x23')]()['then'](function(_0x41e27e){return BPromise[_0x3c81('0x20')]({'id':_0x41e27e[_0x3c81('0x25')],'name':_0x41e27e[_0x3c81('0x24')]});});}}function getEndUser(_0x584d9c,_0x281110,_0x1dddbe,_0x3c35df,_0x2c8093){var _0x34ad76={'Phone':_0x3c35df};var _0x4aaddb={'Id':!![],'Name':!![],'Phone':!![]};return BPromise['resolve']()['then'](function(){if(_0x281110[_0x3c81('0xd')]===_0x3c81('0xe')){logger[_0x3c81('0x1e')]('Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.',_0x3c35df,_0x281110[_0x3c81('0x26')]);switch(_0x281110[_0x3c81('0x26')]){case _0x3c81('0x27'):return _0x2c8093[_0x3c81('0x28')](_0x3c81('0x29'))[_0x3c81('0x1a')](_0x34ad76,_0x4aaddb)[_0x3c81('0x2a')]()['then'](function(_0x22f56b){if(_0x22f56b&&_0x22f56b['length']){return _0x22f56b;}else{return _0x2c8093[_0x3c81('0x28')](_0x3c81('0x2b'))[_0x3c81('0x1a')](_0x34ad76,_0x4aaddb);}});case _0x3c81('0x2c'):return _0x2c8093['sobject'](_0x3c81('0x29'))[_0x3c81('0x1a')](_0x34ad76,_0x4aaddb)['execute']();case _0x3c81('0x2d'):return _0x2c8093[_0x3c81('0x28')]('Lead')['find'](_0x34ad76,_0x4aaddb);default:return null;}}else if(_0x281110[_0x3c81('0xd')]===_0x3c81('0x13')){logger['info'](_0x3c81('0x2e'),_0x3c35df,_0x3c81('0x2c'));return _0x2c8093['sobject']('Contact')[_0x3c81('0x1a')](_0x34ad76,_0x4aaddb)['execute']();}})[_0x3c81('0x1b')](function(_0xce2a34){if(_0xce2a34&&_0xce2a34[_0x3c81('0x1c')]){var _0x2560bc=_[_0x3c81('0x1a')](_0xce2a34,function(_0x2d409b){return _0x2d409b[_0x3c81('0x2f')]===_0x3c35df;});if(_0x2560bc){return BPromise[_0x3c81('0x20')]({'id':_0x2560bc['Id'],'name':_0x2560bc['Name'],'phone':_0x2560bc['Phone']});}}})[_0x3c81('0x1b')](function(_0x244a4c){if(_0x244a4c){logger[_0x3c81('0x1e')](_0x3c81('0x30'),_0x3c35df);return BPromise[_0x3c81('0x20')](_0x244a4c);}else{logger[_0x3c81('0x1e')](_0x3c81('0x31'),_0x3c35df);var _0x48582d={'LastName':_0x1dddbe!==_0x3c81('0x32')?_0x1dddbe:util['format'](_0x3c81('0x33'),_0x3c35df),'Phone':_0x3c35df};if(_0x281110[_0x3c81('0x34')]){if(_0x281110[_0x3c81('0x34')]===_0x3c81('0x2c')){logger[_0x3c81('0x1e')](_0x3c81('0x35'),_0x3c35df,_0x281110['moduleCreate']);}else if(_0x281110[_0x3c81('0x34')]===_0x3c81('0x2d')&&_0x281110[_0x3c81('0xd')]==='Task'){logger[_0x3c81('0x1e')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x3c35df,_0x281110['moduleCreate']);_0x48582d[_0x3c81('0x36')]=_0x3c81('0x37');}else{return null;}}return _0x2c8093[_0x3c81('0x28')](_[_0x3c81('0x38')](_0x281110[_0x3c81('0x34')]))[_0x3c81('0x17')](_0x48582d);}});}function getCustomFields(_0x584a8b,_0x1f5404){var _0x490f91={};if(_0x584a8b['length']>0x0){_[_0x3c81('0x39')](_0x584a8b,function(_0x82ddc5){if(_0x82ddc5[_0x3c81('0x3a')]===_0x3c81('0x3b')&&_0x82ddc5['idField']){_0x490f91[_0x82ddc5[_0x3c81('0x3c')]]=_0x82ddc5[_0x3c81('0x3d')][_0x3c81('0x3e')]();}else if(_0x82ddc5[_0x3c81('0x3a')]==='variable'&&_0x82ddc5[_0x3c81('0x3f')]&&_0x82ddc5[_0x3c81('0x3c')]){_0x1f5404[_0x82ddc5['variableName']]&&(_0x490f91[_0x82ddc5[_0x3c81('0x3c')]]=_0x1f5404[_0x82ddc5[_0x3c81('0x3f')]]['toString']());}else if(_0x82ddc5[_0x3c81('0x3a')]===_0x3c81('0x40')&&_0x82ddc5['Variable']&&_0x82ddc5[_0x3c81('0x41')]['name']&&_0x82ddc5[_0x3c81('0x3c')]){_0x1f5404[_0x82ddc5[_0x3c81('0x41')][_0x3c81('0x42')][_0x3c81('0x43')]()]&&(_0x490f91[_0x82ddc5['idField']]=_0x1f5404[_0x82ddc5['Variable'][_0x3c81('0x42')]['toLowerCase']()][_0x3c81('0x3e')]());}});}return _0x490f91;}function getConnection(_0x1c52ef){var _0x17aa3e=_0x1c52ef[_0x3c81('0x44')][_0x3c81('0x45')](_0x1c52ef[_0x3c81('0x46')]);var _0x4950f2=new jsforce[(_0x3c81('0x47'))]({'oauth2':{'loginUrl':_0x1c52ef[_0x3c81('0x48')]||_0x3c81('0x49'),'clientId':_0x1c52ef[_0x3c81('0x4a')],'clientSecret':_0x1c52ef[_0x3c81('0x4b')]}});return _0x4950f2[_0x3c81('0x4c')](_0x1c52ef['username'],_0x17aa3e)['then'](function(){logger[_0x3c81('0x1e')](_0x3c81('0x4d'));return _0x4950f2;});}exports[_0x3c81('0x4e')]=function(_0x33dca8,_0x3241f1,_0x8a42a6,_0x4ffe89,_0x10649a,_0x2beeb4){var _0x4d251f,_0x4d3d30,_0x42b3e,_0x32269b;_0x2beeb4[_0x3c81('0x4f')]=intUtil[_0x3c81('0x50')](_0x2beeb4[_0x3c81('0x4f')]);_0x2beeb4['remoteUri']=intUtil[_0x3c81('0x50')](_0x2beeb4[_0x3c81('0x48')]);if(_0x10649a&&_0x10649a['monitor_format']){logger[_0x3c81('0x1e')](_0x3c81('0x51'),_0x3c81('0x52'));_0x3241f1[_0x3c81('0x53')]=util[_0x3c81('0x54')](_0x3c81('0x55'),_0x2beeb4[_0x3c81('0x4f')],_0x3241f1[_0x3c81('0x56')],md5(_0x3241f1['uniqueid']));}else{_0x3241f1[_0x3c81('0x53')]='';}return getConnection(_0x2beeb4)['then'](function(_0x161a01){_0x32269b=_0x161a01;return getUser(_0x2beeb4,_0x4ffe89[_0x3c81('0x57')],_0x32269b);})[_0x3c81('0x1b')](function(_0x3c45a2){_0x4d251f=_0x3c45a2;return getEndUser(_0x2beeb4,_0x8a42a6,_0x3241f1['calleridname'],_0x3241f1[_0x3c81('0x58')],_0x32269b);})[_0x3c81('0x1b')](function(_0x4fcafe){_0x4d3d30=_0x4fcafe;return getTicket(_0x2beeb4,_0x4d251f,_0x4d3d30,_0x8a42a6,_0x3241f1,_0x8a42a6[_0x3c81('0x59')],_0x32269b,'queue');})[_0x3c81('0x1b')](function(_0xa2d02e){_0x42b3e=_0xa2d02e;logger[_0x3c81('0x1e')](_0x3c81('0x5a'),_0x42b3e['id']);logger[_0x3c81('0x1e')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x42b3e['id'],_0x4ffe89[_0x3c81('0x42')],_0x2beeb4['type']);switch(_0x2beeb4[_0x3c81('0x3a')]){case _0x3c81('0x5b'):emit(util[_0x3c81('0x54')]('user:%s',_0x4ffe89[_0x3c81('0x42')]),'trigger:salesforce:display',{'recordId':_0x42b3e['id']});break;case _0x3c81('0x5c'):emit(util[_0x3c81('0x54')](_0x3c81('0x5d'),_0x4ffe89[_0x3c81('0x42')]),_0x3c81('0x5e'),{'uri':util['format']('%s/%s/e',_0x32269b[_0x3c81('0x5f')],_0x42b3e['id'])});break;default:logger[_0x3c81('0x60')](_0x3c81('0x61'));}})[_0x3c81('0x62')](function(_0x429962){logger[_0x3c81('0x60')](_0x3c81('0x51'),JSON[_0x3c81('0x63')](_0x429962));});};exports['outbound']=function(_0x2cd113,_0x5f3cf9,_0x398ee8,_0xdb17b6,_0x50cad6,_0x119671,_0x4fa037){var _0xf696b7,_0x49cb3a,_0x2d5173,_0x5a5f9a;_0x119671[_0x3c81('0x4f')]=intUtil[_0x3c81('0x50')](_0x119671[_0x3c81('0x4f')]);_0x119671[_0x3c81('0x48')]=intUtil['stripTrailingSlash'](_0x119671['remoteUri']);if(_0x4fa037&&_0x4fa037[_0x3c81('0x64')]&&_0x4fa037[_0x3c81('0x64')]!==_0x3c81('0x65')){logger[_0x3c81('0x1e')]('[OUTBOUND]','Recording\x20is\x20enabled!');_0x5f3cf9[_0x3c81('0x53')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x119671[_0x3c81('0x4f')],_0x5f3cf9[_0x3c81('0x56')],md5(_0x5f3cf9['uniqueid']));}return getConnection(_0x119671)[_0x3c81('0x1b')](function(_0x3fbaa1){_0x5a5f9a=_0x3fbaa1;return getUser(_0x119671,_0xdb17b6[_0x3c81('0x57')],_0x5a5f9a);})[_0x3c81('0x1b')](function(_0x2177d4){_0xf696b7=_0x2177d4;return getEndUser(_0x119671,_0x398ee8,_0x5f3cf9[_0x3c81('0x66')],_0x5f3cf9[_0x3c81('0x67')],_0x5a5f9a);})[_0x3c81('0x1b')](function(_0x49052a){_0x49cb3a=_0x49052a;return getTicket(_0x119671,_0xf696b7,_0x49cb3a,_0x398ee8,_0x5f3cf9,_0x398ee8[_0x3c81('0x59')],_0x5a5f9a,_0x3c81('0x68'));})['then'](function(_0x588cdc){_0x2d5173=_0x588cdc;logger[_0x3c81('0x1e')](_0x3c81('0x69'),_0x2d5173['id']);logger[_0x3c81('0x1e')]('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x2d5173['id'],_0xdb17b6[_0x3c81('0x42')],_0x119671[_0x3c81('0x3a')]);switch(_0x119671[_0x3c81('0x3a')]){case'integrationTab':emit(util[_0x3c81('0x54')](_0x3c81('0x5d'),_0xdb17b6[_0x3c81('0x42')]),'trigger:salesforce:display',{'recordId':_0x2d5173['id']});break;case'newTab':emit(util['format'](_0x3c81('0x5d'),_0xdb17b6[_0x3c81('0x42')]),_0x3c81('0x5e'),{'uri':util[_0x3c81('0x54')]('%s/%s/e',_0x5a5f9a[_0x3c81('0x5f')],_0x2d5173['id'])});break;default:logger[_0x3c81('0x60')]('[OUTBOUND]','Salesforce\x20account\x20type\x20not\x20recognized');}})['catch'](function(_0x2f63c6){logger[_0x3c81('0x60')](_0x3c81('0x6a'),JSON['stringify'](_0x2f63c6));});};exports['abandoned']=function(_0x83264b,_0x32f616,_0x5d3e8a,_0x940c7d,_0x52e9b0,_0x38a2fb){var _0x10ca99,_0x524a83,_0x4e15ca,_0x274d1a;_0x38a2fb[_0x3c81('0x4f')]=intUtil[_0x3c81('0x50')](_0x38a2fb[_0x3c81('0x4f')]);_0x38a2fb[_0x3c81('0x48')]=intUtil[_0x3c81('0x50')](_0x38a2fb['remoteUri']);if(_0x52e9b0&&_0x52e9b0['monitor_format']){logger[_0x3c81('0x1e')](_0x3c81('0x6b'),'Recording\x20is\x20enabled!');_0x32f616['recordingURL']=util['format'](_0x3c81('0x55'),_0x38a2fb[_0x3c81('0x4f')],_0x32f616[_0x3c81('0x56')],md5(_0x32f616[_0x3c81('0x56')]));}else{_0x32f616[_0x3c81('0x53')]='';}return getConnection(_0x38a2fb)[_0x3c81('0x1b')](function(_0x593c19){_0x274d1a=_0x593c19;if(!_[_0x3c81('0x18')](_0x940c7d)){return getUser(_0x38a2fb,_0x940c7d[_0x3c81('0x42')],_0x274d1a);}else{return getUser(_0x38a2fb,null,_0x274d1a);}})['then'](function(_0x61eee1){_0x10ca99=_0x61eee1;return getEndUser(_0x38a2fb,_0x5d3e8a,_0x32f616['calleridname'],_0x32f616[_0x3c81('0x58')],_0x274d1a);})[_0x3c81('0x1b')](function(_0x2a6083){_0x524a83=_0x2a6083;return getTicket(_0x38a2fb,_0x10ca99,_0x524a83,_0x5d3e8a,_0x32f616,_0x5d3e8a[_0x3c81('0x59')],_0x274d1a);})[_0x3c81('0x1b')](function(_0x4cbfe7){_0x4e15ca=_0x4cbfe7;logger[_0x3c81('0x1e')]('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x4e15ca['id']);logger[_0x3c81('0x1e')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x38a2fb[_0x3c81('0x3a')]);})['catch'](function(_0x35ed55){logger[_0x3c81('0x60')](_0x3c81('0x6b'),JSON['stringify'](_0x35ed55));});}; \ 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 a2a4bc3..55e2c8b 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(_0x2763f2,_0x416af8){var _0x3ef471=function(_0x288aa2){while(--_0x288aa2){_0x2763f2['push'](_0x2763f2['shift']());}};_0x3ef471(++_0x416af8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'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(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'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 4d3dd17..d40baac 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 _0xbf59=['version','trigger:browser:url','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Inbound','lodash','bluebird','util','ioredis','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','created_by','Descriptions','slice','duration_minutes','parent_type','Contacts','parent_name','direction','length','variableName','set_entry','JSON','stringify','Calls','apiKey','toString','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','entry_list','find','value','Agent\x20found!','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','resolve','contacts.phone_home\x20=\x20\x22%s\x22','then','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Enduser\x20created.','first_name','debug','merge','map','forEach','type','string','nameField','customField','toLowerCase','content','custom_fields','push','idField','variable','Variable','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','catch','error','outbound','recordingFormat','[OUTBOUND]','The\x20Enduser\x20ID\x20is:','Fields','Outbound'];(function(_0xffa198,_0x5a8940){var _0x1e4b50=function(_0x1f1c43){while(--_0x1f1c43){_0xffa198['push'](_0xffa198['shift']());}};_0x1e4b50(++_0x5a8940);}(_0xbf59,0x1d8));var _0x9bf5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbf59[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x9bf5('0x0'));var rp=require('request-promise');var BPromise=require(_0x9bf5('0x1'));var md5=require('md5');var util=require(_0x9bf5('0x2'));var Redis=require(_0x9bf5('0x3'));var intUtil=require(_0x9bf5('0x4'));var config=require(_0x9bf5('0x5'));var logger=require(_0x9bf5('0x6'))(_0x9bf5('0x7'));config[_0x9bf5('0x8')]=_[_0x9bf5('0x9')](config[_0x9bf5('0x8')],{'host':_0x9bf5('0xa'),'port':0x18eb});var io=require(_0x9bf5('0xb'))(new Redis(config[_0x9bf5('0x8')]));var def={'method':_0x9bf5('0xc'),'json':!![]};function emit(_0x467008,_0x4a80b3,_0x592a1e){io['to'](_0x467008)[_0x9bf5('0xd')](_0x4a80b3,_0x592a1e);}function getTicket(_0x449b8a,_0x46f262,_0x472d94,_0x3182f8,_0x725877,_0x2436ad,_0x56916d,_0x1d8415){logger[_0x9bf5('0xe')](_0x9bf5('0xf'));var _0x67aa77=new Date();var _0x3a38ec=[{'name':_0x9bf5('0x10'),'value':intUtil[_0x9bf5('0x11')](_0x3182f8[_0x9bf5('0x12')],_0x725877,'\x20')},{'name':'assigned_user_id','value':_0x46f262['id']},{'name':_0x9bf5('0x13'),'value':_0x46f262['id']},{'name':'description','value':intUtil[_0x9bf5('0x11')](_0x3182f8[_0x9bf5('0x14')],_0x725877,'\x0a')},{'name':'date_start','value':_0x67aa77['toISOString']()[_0x9bf5('0x15')](0x0,0x13)['replace']('T','\x20')},{'name':'duration_hours','value':'0'},{'name':_0x9bf5('0x16'),'value':'15'},{'name':'parent_id','value':_0x472d94['id']},{'name':_0x9bf5('0x17'),'value':_0x9bf5('0x18')},{'name':_0x9bf5('0x19'),'value':_0x472d94[_0x9bf5('0x10')]},{'name':_0x9bf5('0x1a'),'value':_0x1d8415}];if(_0x2436ad[_0x9bf5('0x1b')]){_['forEach'](_0x2436ad,function(_0x266aff){if(_0x725877[_0x266aff[_0x9bf5('0x1c')]]){_0x3a38ec['push']({'name':_0x266aff['idField'],'value':_0x725877[_0x266aff[_0x9bf5('0x1c')]]});}});}return request({'form':{'method':_0x9bf5('0x1d'),'input_type':_0x9bf5('0x1e'),'response_type':'JSON','rest_data':JSON[_0x9bf5('0x1f')]({'session':_0x56916d['id'],'module_name':_0x9bf5('0x20'),'name_value_list':_0x3a38ec})}});}function getAuth(_0x90b932){return util['format']('Basic\x20%s',new Buffer(_0x90b932[_0x9bf5('0x21')]+':X')[_0x9bf5('0x22')](_0x9bf5('0x23')));}function getServerInfo(_0xfe097c){return request({'form':{'method':_0x9bf5('0x24'),'input_type':'JSON','response_type':_0x9bf5('0x1e'),'rest_data':JSON['stringify']({'session':_0xfe097c['id']})}});}function getUser(_0x1aa00f,_0x67815d,_0x507835){if(!_[_0x9bf5('0x25')](_0x67815d)){logger['info'](_0x9bf5('0x26'),_0x67815d);return request({'form':{'method':_0x9bf5('0x27'),'input_type':_0x9bf5('0x1e'),'response_type':_0x9bf5('0x1e'),'rest_data':JSON[_0x9bf5('0x1f')]({'session':_0x507835['id'],'module_name':_0x9bf5('0x28'),'query':util[_0x9bf5('0x29')](_0x9bf5('0x2a'),_0x67815d),'order_by':'','offset':'0','select_fields':['id','name',_0x9bf5('0x2b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x862fc6){if(_0x862fc6[_0x9bf5('0x2c')][_0x9bf5('0x1b')]){var _0x15d8c9=_[_0x9bf5('0x2d')](_0x862fc6[_0x9bf5('0x2c')],function(_0x5c3f23){return _0x5c3f23['name_value_list'][_0x9bf5('0x2b')][_0x9bf5('0x2e')]===_0x67815d;});if(_0x15d8c9){logger[_0x9bf5('0xe')](_0x9bf5('0x2f'));return BPromise['resolve']({'id':_0x15d8c9[_0x9bf5('0x30')]['id']['value'],'name':_0x15d8c9[_0x9bf5('0x30')][_0x9bf5('0x10')][_0x9bf5('0x2e')]});}}logger['info'](_0x9bf5('0x31'));return BPromise['resolve']({'id':_0x507835[_0x9bf5('0x30')][_0x9bf5('0x32')][_0x9bf5('0x2e')],'name':_0x507835['name_value_list'][_0x9bf5('0x2b')]['value']});});}else{logger[_0x9bf5('0xe')](_0x9bf5('0x33'));return BPromise[_0x9bf5('0x34')]({'id':_0x507835[_0x9bf5('0x30')][_0x9bf5('0x32')][_0x9bf5('0x2e')],'name':_0x507835[_0x9bf5('0x30')][_0x9bf5('0x2b')][_0x9bf5('0x2e')]});}}function getEndUser(_0x2e506a,_0x297f89,_0x163814,_0x5c81c2){logger[_0x9bf5('0xe')]('Searching\x20enduser\x20with\x20phone',_0x163814);return request({'form':{'method':'get_entry_list','input_type':_0x9bf5('0x1e'),'response_type':'JSON','rest_data':JSON[_0x9bf5('0x1f')]({'session':_0x5c81c2['id'],'module_name':'Contacts','query':util['format'](_0x9bf5('0x35'),_0x163814),'order_by':'','offset':'0','select_fields':['id','name','phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9bf5('0x36')](function(_0x4554c1){if(_0x4554c1[_0x9bf5('0x2c')][_0x9bf5('0x1b')]){var _0x3bc065=_[_0x9bf5('0x2d')](_0x4554c1[_0x9bf5('0x2c')],function(_0x209d88){return _0x209d88[_0x9bf5('0x30')]['phone_home'][_0x9bf5('0x2e')]===_0x163814;});if(_0x3bc065){logger['info'](_0x9bf5('0x37'));return BPromise['resolve']({'id':_0x3bc065[_0x9bf5('0x30')]['id'][_0x9bf5('0x2e')],'name':_0x3bc065['name_value_list'][_0x9bf5('0x10')][_0x9bf5('0x2e')],'phone':_0x3bc065[_0x9bf5('0x30')][_0x9bf5('0x38')][_0x9bf5('0x2e')]});}}else{logger[_0x9bf5('0xe')](_0x9bf5('0x39'));return request({'form':{'method':_0x9bf5('0x1d'),'input_type':_0x9bf5('0x1e'),'response_type':_0x9bf5('0x1e'),'rest_data':JSON[_0x9bf5('0x1f')]({'session':_0x5c81c2['id'],'module_name':_0x9bf5('0x18'),'name_value_list':[{'name':'first_name','value':_0x297f89!==''?_0x297f89:util[_0x9bf5('0x29')]('Caller\x20-\x20%s',_0x163814)},{'name':'phone_home','value':_0x163814}]})}})['then'](function(_0x301569){logger[_0x9bf5('0xe')](_0x9bf5('0x3a'));return BPromise[_0x9bf5('0x34')]({'id':_0x301569['id'],'name':_0x301569['entry_list'][_0x9bf5('0x3b')][_0x9bf5('0x2e')],'phone':_0x301569[_0x9bf5('0x2c')][_0x9bf5('0x38')][_0x9bf5('0x2e')]});});}});}function request(_0x204c97){logger[_0x9bf5('0x3c')]('[HTTP]',JSON[_0x9bf5('0x1f')](_0x204c97));return rp(_[_0x9bf5('0x3d')](def,_0x204c97));}function getTags(_0x48f58f,_0x177940){var _0x3417e4=[];if(_0x48f58f&&_0x48f58f[_0x9bf5('0x1b')]>0x0){_0x3417e4=_[_0x9bf5('0x3e')](_0x48f58f,_0x177940);}return _0x3417e4;}function getCustomFields(_0x323e3c,_0x1c9d7e){var _0x2d5f47=[];var _0x31a39a={'custom_fields':[]};if(_0x323e3c[_0x9bf5('0x1b')]>0x0){_[_0x9bf5('0x3f')](_0x323e3c,function(_0x35d4d1){if(_0x35d4d1[_0x9bf5('0x40')]===_0x9bf5('0x41')&&_0x35d4d1[_0x9bf5('0x42')]&&!_0x35d4d1[_0x9bf5('0x43')]){_0x31a39a[_0x35d4d1[_0x9bf5('0x42')][_0x9bf5('0x44')]()]=_0x35d4d1[_0x9bf5('0x45')][_0x9bf5('0x22')]();}else if(_0x35d4d1[_0x9bf5('0x40')]===_0x9bf5('0x41')&&_0x35d4d1['idField']&&_0x35d4d1[_0x9bf5('0x43')]){_0x31a39a[_0x9bf5('0x46')][_0x9bf5('0x47')]({'id':_0x35d4d1[_0x9bf5('0x48')],'value':_0x35d4d1[_0x9bf5('0x45')][_0x9bf5('0x22')]()});}else if(_0x35d4d1['type']===_0x9bf5('0x49')&&_0x35d4d1[_0x9bf5('0x1c')]&&_0x35d4d1['idField']&&_0x35d4d1['customField']){_0x1c9d7e[_0x35d4d1[_0x9bf5('0x1c')]]&&_0x31a39a[_0x9bf5('0x46')][_0x9bf5('0x47')]({'id':_0x35d4d1[_0x9bf5('0x48')],'value':_0x1c9d7e[_0x35d4d1['variableName']][_0x9bf5('0x22')]()});}else if(_0x35d4d1['type']==='customVariable'&&_0x35d4d1[_0x9bf5('0x4a')]&&_0x35d4d1[_0x9bf5('0x4a')][_0x9bf5('0x10')]&&_0x35d4d1[_0x9bf5('0x48')]&&_0x35d4d1[_0x9bf5('0x43')]){_0x1c9d7e[_0x35d4d1[_0x9bf5('0x4a')][_0x9bf5('0x10')][_0x9bf5('0x44')]()]&&_0x31a39a['custom_fields'][_0x9bf5('0x47')]({'id':_0x35d4d1[_0x9bf5('0x48')],'value':_0x1c9d7e[_0x35d4d1[_0x9bf5('0x4a')][_0x9bf5('0x10')][_0x9bf5('0x44')]()][_0x9bf5('0x22')]()});}});}return _0x31a39a;}function getConnection(_0x3c37c0){return request({'method':'POST','form':{'method':_0x9bf5('0x4b'),'input_type':_0x9bf5('0x1e'),'response_type':_0x9bf5('0x1e'),'rest_data':JSON[_0x9bf5('0x1f')]({'user_auth':{'user_name':_0x3c37c0[_0x9bf5('0x4c')],'password':_0x3c37c0[_0x9bf5('0x4d')],'encryption':_0x9bf5('0x4e')},'application':_0x9bf5('0x4f')})}})[_0x9bf5('0x36')](function(_0x5aa7a5){var _0x602e79=_0x5aa7a5;if(_0x602e79['id']){def[_0x9bf5('0x50')]=_0x602e79['id'];return BPromise[_0x9bf5('0x34')](_0x602e79);}else{throw new Error(util['format'](_0x9bf5('0x51'),_0x3c37c0['id']));}});}function setRelationship(_0x210f70,_0x5026b3,_0x69f47c,_0x9ea5b5){return request({'form':{'method':'set_relationship','input_type':_0x9bf5('0x1e'),'response_type':_0x9bf5('0x1e'),'rest_data':JSON[_0x9bf5('0x1f')]({'session':_0x210f70['id'],'module_name':'Calls','module_id':_0x69f47c['id'],'link_field_name':_0x9ea5b5,'related_ids':[_0x5026b3['id']]})}});}exports[_0x9bf5('0x52')]=function(_0x2b3da1,_0x3b9955,_0x260b8b,_0x367713,_0x5f41de,_0x1d77be){var _0x451daa,_0x572360,_0x488fba,_0x58b686;_0x1d77be[_0x9bf5('0x53')]=intUtil['stripTrailingSlash'](_0x1d77be[_0x9bf5('0x53')]);_0x1d77be[_0x9bf5('0x54')]=intUtil[_0x9bf5('0x55')](_0x1d77be[_0x9bf5('0x54')]);def[_0x9bf5('0x56')]=util[_0x9bf5('0x29')](_0x9bf5('0x57'),_0x1d77be[_0x9bf5('0x53')]);if(_0x5f41de&&_0x5f41de[_0x9bf5('0x58')]){logger[_0x9bf5('0xe')](_0x9bf5('0x59'),_0x9bf5('0x5a'));_0x3b9955[_0x9bf5('0x5b')]=util[_0x9bf5('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1d77be[_0x9bf5('0x54')],_0x3b9955[_0x9bf5('0x5c')],md5(_0x3b9955[_0x9bf5('0x5c')]));}else{_0x3b9955['recordingURL']='';}return getConnection(_0x1d77be)[_0x9bf5('0x36')](function(_0x56840e){_0x58b686=_0x56840e;return getUser(_0x1d77be,_0x367713['name'],_0x58b686);})['then'](function(_0x1aeb9e){_0x451daa=_0x1aeb9e;logger['info'](_0x9bf5('0x5d'),_0x451daa['id']);return getEndUser(_0x1d77be,_0x3b9955[_0x9bf5('0x5e')],_0x3b9955[_0x9bf5('0x5f')],_0x58b686);})['then'](function(_0x53dd60){_0x572360=_0x53dd60;logger[_0x9bf5('0xe')]('The\x20Enduser\x20ID\x20is:',_0x572360['id']);return getTicket(_0x1d77be,_0x451daa,_0x572360,_0x260b8b,_0x3b9955,_0x260b8b['Fields'],_0x58b686,'Inbound');})[_0x9bf5('0x36')](function(_0x134154){_0x488fba=_0x134154;logger[_0x9bf5('0xe')](_0x9bf5('0x60'));logger['info'](_0x9bf5('0x61'),_0x488fba['id']);return setRelationship(_0x58b686,_0x451daa,_0x488fba,_0x9bf5('0x62'));})[_0x9bf5('0x36')](function(){return setRelationship(_0x58b686,_0x572360,_0x488fba,_0x9bf5('0x63'));})[_0x9bf5('0x36')](function(){return getServerInfo(_0x58b686);})['then'](function(_0xa96ea2){var _0x625677=parseInt(_0xa96ea2['version'][_0x9bf5('0x64')](0x0));var _0x288465=util['format'](_0x9bf5('0x65'),_0x1d77be[_0x9bf5('0x53')],_0x488fba['id']);if(_0x625677>0x6){_0x288465=util[_0x9bf5('0x29')](_0x9bf5('0x66'),_0x1d77be['remoteUri'],_0x488fba['id']);}logger[_0x9bf5('0xe')](_0x9bf5('0x59'),_0x9bf5('0x67'));emit(util[_0x9bf5('0x29')](_0x9bf5('0x68'),_0x367713[_0x9bf5('0x10')]),'trigger:browser:url',{'uri':_0x288465});})[_0x9bf5('0x69')](function(_0x34e677){logger[_0x9bf5('0x6a')](_0x9bf5('0x59'),JSON[_0x9bf5('0x1f')](_0x34e677));});};exports[_0x9bf5('0x6b')]=function(_0x10c9fd,_0x347103,_0x1ec661,_0x31d0d0,_0x3af60a,_0x544ef5,_0x48bf08){var _0x19950c,_0x4fc145,_0x395787,_0x4da28e;_0x544ef5[_0x9bf5('0x53')]=intUtil[_0x9bf5('0x55')](_0x544ef5[_0x9bf5('0x53')]);_0x544ef5[_0x9bf5('0x54')]=intUtil[_0x9bf5('0x55')](_0x544ef5[_0x9bf5('0x54')]);def['uri']=util[_0x9bf5('0x29')](_0x9bf5('0x57'),_0x544ef5[_0x9bf5('0x53')]);if(_0x48bf08&&_0x48bf08[_0x9bf5('0x6c')]&&_0x48bf08[_0x9bf5('0x6c')]!=='none'){logger['info'](_0x9bf5('0x6d'),_0x9bf5('0x5a'));_0x347103[_0x9bf5('0x5b')]=util[_0x9bf5('0x29')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x544ef5[_0x9bf5('0x54')],_0x347103[_0x9bf5('0x5c')],md5(_0x347103['uniqueid']));}return getConnection(_0x544ef5)[_0x9bf5('0x36')](function(_0x81222){_0x4da28e=_0x81222;return getUser(_0x544ef5,_0x31d0d0[_0x9bf5('0x10')],_0x4da28e);})[_0x9bf5('0x36')](function(_0x3353dd){_0x19950c=_0x3353dd;logger['info'](_0x9bf5('0x5d'),_0x19950c['id']);return getEndUser(_0x544ef5,_0x347103['destcalleridname'],_0x347103['destcalleridnum'],_0x4da28e);})['then'](function(_0x5b6e40){_0x4fc145=_0x5b6e40;logger['info'](_0x9bf5('0x6e'),_0x4fc145['id']);return getTicket(_0x544ef5,_0x19950c,_0x4fc145,_0x1ec661,_0x347103,_0x1ec661[_0x9bf5('0x6f')],_0x4da28e,_0x9bf5('0x70'));})['then'](function(_0x3db5f4){_0x395787=_0x3db5f4;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x395787['id']);return setRelationship(_0x4da28e,_0x19950c,_0x395787,'users');})[_0x9bf5('0x36')](function(){return setRelationship(_0x4da28e,_0x4fc145,_0x395787,_0x9bf5('0x63'));})['then'](function(){return getServerInfo(_0x4da28e);})['then'](function(_0x2cb02c){var _0x2dadab=parseInt(_0x2cb02c[_0x9bf5('0x71')]['charAt'](0x0));var _0x5bdab0=util[_0x9bf5('0x29')]('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x544ef5[_0x9bf5('0x53')],_0x395787['id']);if(_0x2dadab>0x6){_0x5bdab0=util[_0x9bf5('0x29')](_0x9bf5('0x66'),_0x544ef5[_0x9bf5('0x53')],_0x395787['id']);}logger[_0x9bf5('0xe')](_0x9bf5('0x6d'),_0x9bf5('0x67'));emit(util[_0x9bf5('0x29')](_0x9bf5('0x68'),_0x31d0d0[_0x9bf5('0x10')]),_0x9bf5('0x72'),{'uri':_0x5bdab0});})['catch'](function(_0x10ec09){logger['error'](_0x9bf5('0x6d'),JSON[_0x9bf5('0x1f')](_0x10ec09));});};exports['abandoned']=function(_0x23a53b,_0x225b4b,_0x257134,_0x4986b4,_0x4923e0,_0x43d738){var _0x1d6c7,_0xf2a174,_0x3060c1,_0x4f5a0c;_0x43d738['remoteUri']=intUtil[_0x9bf5('0x55')](_0x43d738[_0x9bf5('0x53')]);_0x43d738['serverUrl']=intUtil['stripTrailingSlash'](_0x43d738[_0x9bf5('0x54')]);def[_0x9bf5('0x56')]=util[_0x9bf5('0x29')]('%s/service/v4_1/rest.php',_0x43d738[_0x9bf5('0x53')]);if(_0x4923e0&&_0x4923e0[_0x9bf5('0x58')]){logger['info']('[ABANDONED]',_0x9bf5('0x5a'));_0x225b4b[_0x9bf5('0x5b')]=util[_0x9bf5('0x29')](_0x9bf5('0x73'),_0x43d738[_0x9bf5('0x54')],_0x225b4b[_0x9bf5('0x5c')],md5(_0x225b4b[_0x9bf5('0x5c')]));}else{_0x225b4b['recordingURL']='';}return getConnection(_0x43d738)['then'](function(_0xe82f4a){_0x4f5a0c=_0xe82f4a;if(!_[_0x9bf5('0x25')](_0x4986b4)){return getUser(_0x43d738,_0x4986b4['name'],_0x4f5a0c);}else{return getUser(_0x43d738,null,_0x4f5a0c);}})['then'](function(_0x298677){_0x1d6c7=_0x298677;logger[_0x9bf5('0xe')](_0x9bf5('0x5d'),_0x1d6c7['id']);return getEndUser(_0x43d738,_0x225b4b['calleridname'],_0x225b4b[_0x9bf5('0x5f')],_0x4f5a0c);})['then'](function(_0x349db8){_0xf2a174=_0x349db8;logger[_0x9bf5('0xe')]('The\x20Enduser\x20ID\x20is:',_0xf2a174['id']);return getTicket(_0x43d738,_0x1d6c7,_0xf2a174,_0x257134,_0x225b4b,_0x257134[_0x9bf5('0x6f')],_0x4f5a0c,_0x9bf5('0x74'));})[_0x9bf5('0x36')](function(_0x5a86ec){_0x3060c1=_0x5a86ec;logger[_0x9bf5('0xe')](_0x9bf5('0x60'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x3060c1['id']);return setRelationship(_0x4f5a0c,_0x1d6c7,_0x3060c1,_0x9bf5('0x62'));})[_0x9bf5('0x36')](function(){return setRelationship(_0x4f5a0c,_0xf2a174,_0x3060c1,_0x9bf5('0x63'));})[_0x9bf5('0x36')](function(){return getServerInfo(_0x4f5a0c);})[_0x9bf5('0x69')](function(_0x1ca21a){logger[_0x9bf5('0x6a')]('[ABANDONED]',JSON['stringify'](_0x1ca21a));});}; \ No newline at end of file +var _0xd492=['Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes','parent_id','parent_type','Contacts','name','direction','length','forEach','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','name_value_list','value','Agent\x20found!','resolve','user_id','user_name','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','Caller\x20-\x20%s','Enduser\x20created.','debug','merge','type','string','customField','nameField','toLowerCase','content','custom_fields','toString','customVariable','Variable','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','catch','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','Outbound','Ticket\x20created!','version','error','abandoned','[ABANDONED]','request-promise','bluebird','md5','ioredis','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','Subjects','assigned_user_id','created_by','description'];(function(_0x2b51a9,_0x5b9092){var _0x2de139=function(_0x5076b3){while(--_0x5076b3){_0x2b51a9['push'](_0x2b51a9['shift']());}};_0x2de139(++_0x5b9092);}(_0xd492,0xdd));var _0x2d49=function(_0x5ad4c8,_0x1272aa){_0x5ad4c8=_0x5ad4c8-0x0;var _0x2938ea=_0xd492[_0x5ad4c8];return _0x2938ea;};'use strict';var _=require('lodash');var rp=require(_0x2d49('0x0'));var BPromise=require(_0x2d49('0x1'));var md5=require(_0x2d49('0x2'));var util=require('util');var Redis=require(_0x2d49('0x3'));var intUtil=require('./util');var config=require(_0x2d49('0x4'));var logger=require(_0x2d49('0x5'))(_0x2d49('0x6'));config[_0x2d49('0x7')]=_[_0x2d49('0x8')](config[_0x2d49('0x7')],{'host':_0x2d49('0x9'),'port':0x18eb});var io=require(_0x2d49('0xa'))(new Redis(config[_0x2d49('0x7')]));var def={'method':_0x2d49('0xb'),'json':!![]};function emit(_0x3366cf,_0x489606,_0x2fd0d6){io['to'](_0x3366cf)[_0x2d49('0xc')](_0x489606,_0x2fd0d6);}function getTicket(_0x27d8b2,_0x3d02e1,_0xdf8aab,_0x2b0ae3,_0x3f6e98,_0x103de4,_0x13060d,_0x14640e){logger[_0x2d49('0xd')](_0x2d49('0xe'));var _0x555adc=new Date();var _0xba450d=[{'name':'name','value':intUtil['getString'](_0x2b0ae3[_0x2d49('0xf')],_0x3f6e98,'\x20')},{'name':_0x2d49('0x10'),'value':_0x3d02e1['id']},{'name':_0x2d49('0x11'),'value':_0x3d02e1['id']},{'name':_0x2d49('0x12'),'value':intUtil['getString'](_0x2b0ae3[_0x2d49('0x13')],_0x3f6e98,'\x0a')},{'name':_0x2d49('0x14'),'value':_0x555adc[_0x2d49('0x15')]()['slice'](0x0,0x13)[_0x2d49('0x16')]('T','\x20')},{'name':_0x2d49('0x17'),'value':'0'},{'name':_0x2d49('0x18'),'value':'15'},{'name':_0x2d49('0x19'),'value':_0xdf8aab['id']},{'name':_0x2d49('0x1a'),'value':_0x2d49('0x1b')},{'name':'parent_name','value':_0xdf8aab[_0x2d49('0x1c')]},{'name':_0x2d49('0x1d'),'value':_0x14640e}];if(_0x103de4[_0x2d49('0x1e')]){_[_0x2d49('0x1f')](_0x103de4,function(_0x4cf1f3){if(_0x3f6e98[_0x4cf1f3[_0x2d49('0x20')]]){_0xba450d[_0x2d49('0x21')]({'name':_0x4cf1f3[_0x2d49('0x22')],'value':_0x3f6e98[_0x4cf1f3['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':_0x2d49('0x23'),'response_type':_0x2d49('0x23'),'rest_data':JSON[_0x2d49('0x24')]({'session':_0x13060d['id'],'module_name':_0x2d49('0x25'),'name_value_list':_0xba450d})}});}function getAuth(_0x24c256){return util[_0x2d49('0x26')](_0x2d49('0x27'),new Buffer(_0x24c256[_0x2d49('0x28')]+':X')['toString'](_0x2d49('0x29')));}function getServerInfo(_0x21163f){return request({'form':{'method':_0x2d49('0x2a'),'input_type':_0x2d49('0x23'),'response_type':_0x2d49('0x23'),'rest_data':JSON[_0x2d49('0x24')]({'session':_0x21163f['id']})}});}function getUser(_0x3eea92,_0x4411ae,_0x39498b){if(!_[_0x2d49('0x2b')](_0x4411ae)){logger[_0x2d49('0xd')](_0x2d49('0x2c'),_0x4411ae);return request({'form':{'method':_0x2d49('0x2d'),'input_type':_0x2d49('0x23'),'response_type':'JSON','rest_data':JSON['stringify']({'session':_0x39498b['id'],'module_name':_0x2d49('0x2e'),'query':util[_0x2d49('0x26')](_0x2d49('0x2f'),_0x4411ae),'order_by':'','offset':'0','select_fields':['id','name','user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2d49('0x30')](function(_0x437f89){if(_0x437f89[_0x2d49('0x31')]['length']){var _0x1ae5c9=_['find'](_0x437f89[_0x2d49('0x31')],function(_0x48f2fc){return _0x48f2fc[_0x2d49('0x32')]['user_name'][_0x2d49('0x33')]===_0x4411ae;});if(_0x1ae5c9){logger[_0x2d49('0xd')](_0x2d49('0x34'));return BPromise[_0x2d49('0x35')]({'id':_0x1ae5c9[_0x2d49('0x32')]['id'][_0x2d49('0x33')],'name':_0x1ae5c9[_0x2d49('0x32')]['name']['value']});}}logger[_0x2d49('0xd')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x2d49('0x35')]({'id':_0x39498b[_0x2d49('0x32')][_0x2d49('0x36')][_0x2d49('0x33')],'name':_0x39498b[_0x2d49('0x32')]['user_name'][_0x2d49('0x33')]});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise['resolve']({'id':_0x39498b[_0x2d49('0x32')][_0x2d49('0x36')]['value'],'name':_0x39498b[_0x2d49('0x32')][_0x2d49('0x37')]['value']});}}function getEndUser(_0x5225f2,_0x18ab3d,_0x1ff49c,_0x5613a7){logger[_0x2d49('0xd')]('Searching\x20enduser\x20with\x20phone',_0x1ff49c);return request({'form':{'method':_0x2d49('0x2d'),'input_type':_0x2d49('0x23'),'response_type':_0x2d49('0x23'),'rest_data':JSON[_0x2d49('0x24')]({'session':_0x5613a7['id'],'module_name':_0x2d49('0x1b'),'query':util[_0x2d49('0x26')](_0x2d49('0x38'),_0x1ff49c),'order_by':'','offset':'0','select_fields':['id','name',_0x2d49('0x39')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x2d49('0x30')](function(_0x5505f4){if(_0x5505f4[_0x2d49('0x31')][_0x2d49('0x1e')]){var _0x248d96=_[_0x2d49('0x3a')](_0x5505f4[_0x2d49('0x31')],function(_0x5112ce){return _0x5112ce[_0x2d49('0x32')]['phone_home']['value']===_0x1ff49c;});if(_0x248d96){logger[_0x2d49('0xd')]('Enduser\x20found!');return BPromise[_0x2d49('0x35')]({'id':_0x248d96['name_value_list']['id']['value'],'name':_0x248d96['name_value_list'][_0x2d49('0x1c')][_0x2d49('0x33')],'phone':_0x248d96[_0x2d49('0x32')][_0x2d49('0x39')][_0x2d49('0x33')]});}}else{logger['info'](_0x2d49('0x3b'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x2d49('0x23'),'rest_data':JSON['stringify']({'session':_0x5613a7['id'],'module_name':_0x2d49('0x1b'),'name_value_list':[{'name':_0x2d49('0x3c'),'value':_0x18ab3d!==''?_0x18ab3d:util[_0x2d49('0x26')](_0x2d49('0x3d'),_0x1ff49c)},{'name':'phone_home','value':_0x1ff49c}]})}})[_0x2d49('0x30')](function(_0x20f6b7){logger[_0x2d49('0xd')](_0x2d49('0x3e'));return BPromise['resolve']({'id':_0x20f6b7['id'],'name':_0x20f6b7['entry_list']['first_name'][_0x2d49('0x33')],'phone':_0x20f6b7[_0x2d49('0x31')][_0x2d49('0x39')][_0x2d49('0x33')]});});}});}function request(_0x5d36f9){logger[_0x2d49('0x3f')]('[HTTP]',JSON[_0x2d49('0x24')](_0x5d36f9));return rp(_[_0x2d49('0x40')](def,_0x5d36f9));}function getTags(_0x34c836,_0x17f8a6){var _0x59acad=[];if(_0x34c836&&_0x34c836[_0x2d49('0x1e')]>0x0){_0x59acad=_['map'](_0x34c836,_0x17f8a6);}return _0x59acad;}function getCustomFields(_0xf49810,_0x3aa202){var _0x329085=[];var _0x194ef4={'custom_fields':[]};if(_0xf49810['length']>0x0){_[_0x2d49('0x1f')](_0xf49810,function(_0x508525){if(_0x508525[_0x2d49('0x41')]===_0x2d49('0x42')&&_0x508525['nameField']&&!_0x508525[_0x2d49('0x43')]){_0x194ef4[_0x508525[_0x2d49('0x44')][_0x2d49('0x45')]()]=_0x508525[_0x2d49('0x46')]['toString']();}else if(_0x508525[_0x2d49('0x41')]===_0x2d49('0x42')&&_0x508525['idField']&&_0x508525[_0x2d49('0x43')]){_0x194ef4[_0x2d49('0x47')]['push']({'id':_0x508525[_0x2d49('0x22')],'value':_0x508525[_0x2d49('0x46')][_0x2d49('0x48')]()});}else if(_0x508525[_0x2d49('0x41')]==='variable'&&_0x508525[_0x2d49('0x20')]&&_0x508525['idField']&&_0x508525['customField']){_0x3aa202[_0x508525[_0x2d49('0x20')]]&&_0x194ef4['custom_fields'][_0x2d49('0x21')]({'id':_0x508525['idField'],'value':_0x3aa202[_0x508525[_0x2d49('0x20')]][_0x2d49('0x48')]()});}else if(_0x508525['type']===_0x2d49('0x49')&&_0x508525[_0x2d49('0x4a')]&&_0x508525[_0x2d49('0x4a')][_0x2d49('0x1c')]&&_0x508525['idField']&&_0x508525[_0x2d49('0x43')]){_0x3aa202[_0x508525['Variable'][_0x2d49('0x1c')][_0x2d49('0x45')]()]&&_0x194ef4[_0x2d49('0x47')]['push']({'id':_0x508525[_0x2d49('0x22')],'value':_0x3aa202[_0x508525[_0x2d49('0x4a')][_0x2d49('0x1c')][_0x2d49('0x45')]()][_0x2d49('0x48')]()});}});}return _0x194ef4;}function getConnection(_0x21a90c){return request({'method':_0x2d49('0xb'),'form':{'method':'login','input_type':_0x2d49('0x23'),'response_type':_0x2d49('0x23'),'rest_data':JSON[_0x2d49('0x24')]({'user_auth':{'user_name':_0x21a90c[_0x2d49('0x4b')],'password':_0x21a90c[_0x2d49('0x4c')],'encryption':_0x2d49('0x4d')},'application':_0x2d49('0x4e')})}})['then'](function(_0xd73244){var _0x34ea64=_0xd73244;if(_0x34ea64['id']){def[_0x2d49('0x4f')]=_0x34ea64['id'];return BPromise[_0x2d49('0x35')](_0x34ea64);}else{throw new Error(util[_0x2d49('0x26')](_0x2d49('0x50'),_0x21a90c['id']));}});}function setRelationship(_0x496886,_0x3b0ea2,_0x9d95fd,_0x1b0dac){return request({'form':{'method':_0x2d49('0x51'),'input_type':_0x2d49('0x23'),'response_type':_0x2d49('0x23'),'rest_data':JSON[_0x2d49('0x24')]({'session':_0x496886['id'],'module_name':'Calls','module_id':_0x9d95fd['id'],'link_field_name':_0x1b0dac,'related_ids':[_0x3b0ea2['id']]})}});}exports['queue']=function(_0x4d7125,_0x320968,_0x1debd3,_0xa41613,_0x4735b3,_0x49d7a1){var _0x4cb652,_0x3bb124,_0x49633f,_0x326616;_0x49d7a1[_0x2d49('0x52')]=intUtil[_0x2d49('0x53')](_0x49d7a1['remoteUri']);_0x49d7a1[_0x2d49('0x54')]=intUtil[_0x2d49('0x53')](_0x49d7a1[_0x2d49('0x54')]);def[_0x2d49('0x55')]=util[_0x2d49('0x26')](_0x2d49('0x56'),_0x49d7a1[_0x2d49('0x52')]);if(_0x4735b3&&_0x4735b3[_0x2d49('0x57')]){logger[_0x2d49('0xd')](_0x2d49('0x58'),_0x2d49('0x59'));_0x320968[_0x2d49('0x5a')]=util[_0x2d49('0x26')](_0x2d49('0x5b'),_0x49d7a1['serverUrl'],_0x320968[_0x2d49('0x5c')],md5(_0x320968['uniqueid']));}else{_0x320968[_0x2d49('0x5a')]='';}return getConnection(_0x49d7a1)[_0x2d49('0x30')](function(_0x26dc7a){_0x326616=_0x26dc7a;return getUser(_0x49d7a1,_0xa41613[_0x2d49('0x1c')],_0x326616);})[_0x2d49('0x30')](function(_0x3b458e){_0x4cb652=_0x3b458e;logger[_0x2d49('0xd')](_0x2d49('0x5d'),_0x4cb652['id']);return getEndUser(_0x49d7a1,_0x320968[_0x2d49('0x5e')],_0x320968[_0x2d49('0x5f')],_0x326616);})['then'](function(_0xb0120f){_0x3bb124=_0xb0120f;logger[_0x2d49('0xd')](_0x2d49('0x60'),_0x3bb124['id']);return getTicket(_0x49d7a1,_0x4cb652,_0x3bb124,_0x1debd3,_0x320968,_0x1debd3[_0x2d49('0x61')],_0x326616,_0x2d49('0x62'));})['then'](function(_0x25eac2){_0x49633f=_0x25eac2;logger[_0x2d49('0xd')]('Ticket\x20created!');logger[_0x2d49('0xd')](_0x2d49('0x63'),_0x49633f['id']);return setRelationship(_0x326616,_0x4cb652,_0x49633f,_0x2d49('0x64'));})['then'](function(){return setRelationship(_0x326616,_0x3bb124,_0x49633f,_0x2d49('0x65'));})['then'](function(){return getServerInfo(_0x326616);})[_0x2d49('0x30')](function(_0x439948){var _0x30ce73=parseInt(_0x439948['version'][_0x2d49('0x66')](0x0));var _0x567981=util['format'](_0x2d49('0x67'),_0x49d7a1['remoteUri'],_0x49633f['id']);if(_0x30ce73>0x6){_0x567981=util[_0x2d49('0x26')](_0x2d49('0x68'),_0x49d7a1[_0x2d49('0x52')],_0x49633f['id']);}logger[_0x2d49('0xd')](_0x2d49('0x58'),_0x2d49('0x69'));emit(util[_0x2d49('0x26')](_0x2d49('0x6a'),_0xa41613[_0x2d49('0x1c')]),_0x2d49('0x6b'),{'uri':_0x567981});})[_0x2d49('0x6c')](function(_0x15cff5){logger['error'](_0x2d49('0x58'),JSON['stringify'](_0x15cff5));});};exports[_0x2d49('0x6d')]=function(_0x296918,_0x1c2203,_0x233485,_0x7e7b11,_0x20773f,_0x2cf3b4,_0x30c623){var _0x249efd,_0x40449d,_0x2008c9,_0x4bd4ad;_0x2cf3b4[_0x2d49('0x52')]=intUtil[_0x2d49('0x53')](_0x2cf3b4[_0x2d49('0x52')]);_0x2cf3b4['serverUrl']=intUtil[_0x2d49('0x53')](_0x2cf3b4[_0x2d49('0x54')]);def[_0x2d49('0x55')]=util[_0x2d49('0x26')]('%s/service/v4_1/rest.php',_0x2cf3b4[_0x2d49('0x52')]);if(_0x30c623&&_0x30c623[_0x2d49('0x6e')]&&_0x30c623[_0x2d49('0x6e')]!==_0x2d49('0x6f')){logger['info'](_0x2d49('0x70'),_0x2d49('0x59'));_0x1c2203[_0x2d49('0x5a')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2cf3b4[_0x2d49('0x54')],_0x1c2203[_0x2d49('0x5c')],md5(_0x1c2203[_0x2d49('0x5c')]));}return getConnection(_0x2cf3b4)[_0x2d49('0x30')](function(_0x34e5ff){_0x4bd4ad=_0x34e5ff;return getUser(_0x2cf3b4,_0x7e7b11['name'],_0x4bd4ad);})[_0x2d49('0x30')](function(_0x164969){_0x249efd=_0x164969;logger['info'](_0x2d49('0x5d'),_0x249efd['id']);return getEndUser(_0x2cf3b4,_0x1c2203[_0x2d49('0x71')],_0x1c2203['destcalleridnum'],_0x4bd4ad);})[_0x2d49('0x30')](function(_0x160490){_0x40449d=_0x160490;logger[_0x2d49('0xd')](_0x2d49('0x60'),_0x40449d['id']);return getTicket(_0x2cf3b4,_0x249efd,_0x40449d,_0x233485,_0x1c2203,_0x233485[_0x2d49('0x61')],_0x4bd4ad,_0x2d49('0x72'));})['then'](function(_0x7a8294){_0x2008c9=_0x7a8294;logger[_0x2d49('0xd')](_0x2d49('0x73'));logger[_0x2d49('0xd')]('The\x20Ticket\x20ID\x20is:',_0x2008c9['id']);return setRelationship(_0x4bd4ad,_0x249efd,_0x2008c9,_0x2d49('0x64'));})[_0x2d49('0x30')](function(){return setRelationship(_0x4bd4ad,_0x40449d,_0x2008c9,'contacts');})[_0x2d49('0x30')](function(){return getServerInfo(_0x4bd4ad);})[_0x2d49('0x30')](function(_0x1d46b1){var _0x1e3d68=parseInt(_0x1d46b1[_0x2d49('0x74')]['charAt'](0x0));var _0x53ec97=util[_0x2d49('0x26')](_0x2d49('0x67'),_0x2cf3b4[_0x2d49('0x52')],_0x2008c9['id']);if(_0x1e3d68>0x6){_0x53ec97=util[_0x2d49('0x26')](_0x2d49('0x68'),_0x2cf3b4['remoteUri'],_0x2008c9['id']);}logger[_0x2d49('0xd')](_0x2d49('0x70'),_0x2d49('0x69'));emit(util[_0x2d49('0x26')]('user:%s',_0x7e7b11['name']),'trigger:browser:url',{'uri':_0x53ec97});})[_0x2d49('0x6c')](function(_0x2c77e9){logger[_0x2d49('0x75')](_0x2d49('0x70'),JSON[_0x2d49('0x24')](_0x2c77e9));});};exports[_0x2d49('0x76')]=function(_0x2e3673,_0x248e8e,_0x423ed0,_0x395070,_0x4446e9,_0xd41c31){var _0x26ae86,_0x4c96d9,_0x331824,_0x32c157;_0xd41c31[_0x2d49('0x52')]=intUtil[_0x2d49('0x53')](_0xd41c31['remoteUri']);_0xd41c31['serverUrl']=intUtil[_0x2d49('0x53')](_0xd41c31['serverUrl']);def[_0x2d49('0x55')]=util[_0x2d49('0x26')](_0x2d49('0x56'),_0xd41c31['remoteUri']);if(_0x4446e9&&_0x4446e9[_0x2d49('0x57')]){logger[_0x2d49('0xd')](_0x2d49('0x77'),'Recording\x20is\x20enabled!');_0x248e8e[_0x2d49('0x5a')]=util['format'](_0x2d49('0x5b'),_0xd41c31['serverUrl'],_0x248e8e['uniqueid'],md5(_0x248e8e[_0x2d49('0x5c')]));}else{_0x248e8e[_0x2d49('0x5a')]='';}return getConnection(_0xd41c31)[_0x2d49('0x30')](function(_0x446393){_0x32c157=_0x446393;if(!_[_0x2d49('0x2b')](_0x395070)){return getUser(_0xd41c31,_0x395070[_0x2d49('0x1c')],_0x32c157);}else{return getUser(_0xd41c31,null,_0x32c157);}})[_0x2d49('0x30')](function(_0x52eb64){_0x26ae86=_0x52eb64;logger[_0x2d49('0xd')](_0x2d49('0x5d'),_0x26ae86['id']);return getEndUser(_0xd41c31,_0x248e8e[_0x2d49('0x5e')],_0x248e8e['calleridnum'],_0x32c157);})['then'](function(_0x19dd7d){_0x4c96d9=_0x19dd7d;logger['info'](_0x2d49('0x60'),_0x4c96d9['id']);return getTicket(_0xd41c31,_0x26ae86,_0x4c96d9,_0x423ed0,_0x248e8e,_0x423ed0['Fields'],_0x32c157,_0x2d49('0x62'));})['then'](function(_0x45f36b){_0x331824=_0x45f36b;logger[_0x2d49('0xd')](_0x2d49('0x73'));logger[_0x2d49('0xd')](_0x2d49('0x63'),_0x331824['id']);return setRelationship(_0x32c157,_0x26ae86,_0x331824,_0x2d49('0x64'));})[_0x2d49('0x30')](function(){return setRelationship(_0x32c157,_0x4c96d9,_0x331824,_0x2d49('0x65'));})['then'](function(){return getServerInfo(_0x32c157);})[_0x2d49('0x6c')](function(_0x85b908){logger['error'](_0x2d49('0x77'),JSON[_0x2d49('0x24')](_0x85b908));});}; \ 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 6be952d..46b709c 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 _0x436e=['type','variable','variableName','customVariable','name','Variable','toLowerCase','toString','keyValue','keyType','key','format','%s:\x20%s','keyContent','stripTrailingSlash','lastIndexOf','validateEmail','test','lodash','util','getString','sortBy','string','push'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x436e,0x11a));var _0xe436=function(_0x4ce240,_0x13ffcd){_0x4ce240=_0x4ce240-0x0;var _0x42b578=_0x436e[_0x4ce240];return _0x42b578;};'use strict';var _=require(_0xe436('0x0'));var util=require(_0xe436('0x1'));exports[_0xe436('0x2')]=function(_0x4b06f2,_0x3c4151,_0x4a3055){var _0x4ba0e4=[];if(_0x4b06f2['length']>0x0){var _0x3f97c9=_[_0xe436('0x3')](_0x4b06f2,['id']);for(var _0x1392ee=0x0;_0x1392ee<_0x3f97c9['length'];_0x1392ee++){var _0x3fddaf=_0x3f97c9[_0x1392ee];if(_0x3fddaf['type']===_0xe436('0x4')){_0x4ba0e4[_0xe436('0x5')](_0x3fddaf['content']);}else if(_0x3fddaf[_0xe436('0x6')]===_0xe436('0x7')&&_0x3fddaf['variableName']){_0x3c4151[_0x3fddaf[_0xe436('0x8')]]&&_0x4ba0e4[_0xe436('0x5')](_0x3c4151[_0x3fddaf[_0xe436('0x8')]]['toString']());}else if(_0x3fddaf[_0xe436('0x6')]===_0xe436('0x9')&&_0x3fddaf['Variable']&&_0x3fddaf['Variable'][_0xe436('0xa')]){_0x3c4151[_0x3fddaf[_0xe436('0xb')]['name'][_0xe436('0xc')]()]&&_0x4ba0e4['push'](_0x3c4151[_0x3fddaf[_0xe436('0xb')][_0xe436('0xa')]['toLowerCase']()][_0xe436('0xd')]());}else if(_0x3fddaf['type']===_0xe436('0xe')){if(_0x3fddaf[_0xe436('0xf')]==='string'&&_0x3fddaf[_0xe436('0x10')]){_0x4ba0e4[_0xe436('0x5')](util[_0xe436('0x11')](_0xe436('0x12'),_0x3fddaf[_0xe436('0x10')],_0x3fddaf[_0xe436('0x13')]));}else if(_0x3fddaf[_0xe436('0xf')]==='variable'&&_0x3fddaf['variableName']&&_0x3fddaf[_0xe436('0x10')]){_0x3c4151[_0x3fddaf[_0xe436('0x8')]]&&_0x4ba0e4['push'](util['format'](_0xe436('0x12'),_0x3fddaf[_0xe436('0x10')],_0x3c4151[_0x3fddaf[_0xe436('0x8')]]));}else if(_0x3fddaf[_0xe436('0xf')]===_0xe436('0x9')&&_0x3fddaf['Variable']&&_0x3fddaf[_0xe436('0xb')][_0xe436('0xa')]&&_0x3fddaf[_0xe436('0x10')]){_0x3c4151[_0x3fddaf['Variable']['name'][_0xe436('0xc')]()]&&_0x4ba0e4[_0xe436('0x5')](util[_0xe436('0x11')](_0xe436('0x12'),_0x3fddaf['key'],_0x3c4151[_0x3fddaf[_0xe436('0xb')][_0xe436('0xa')][_0xe436('0xc')]()]));}}}}return _0x4ba0e4['join'](_0x4a3055);};exports[_0xe436('0x14')]=function(_0x5cd4e9){var _0x271336=_0x5cd4e9['slice'](-0x1);if(_0x271336==='/'){_0x5cd4e9=_0x5cd4e9['substring'](0x0,_0x5cd4e9[_0xe436('0x15')](_0x271336));}return _0x5cd4e9;};exports[_0xe436('0x16')]=function(_0x285753){if(!_['isNil'](_0x285753)&&_0x285753!==''){var _0x1547b1=/^(([^<>()\[\]\\.,;:\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 _0x1547b1[_0xe436('0x17')](String(_0x285753)[_0xe436('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xd09f=['string','content','variable','variableName','customVariable','Variable','name','toLowerCase','push','toString','keyValue','keyType','key','format','%s:\x20%s','join','stripTrailingSlash','slice','validateEmail','util','getString','length','sortBy','type'];(function(_0x1b4d59,_0x52610a){var _0x5e3006=function(_0x1e2b21){while(--_0x1e2b21){_0x1b4d59['push'](_0x1b4d59['shift']());}};_0x5e3006(++_0x52610a);}(_0xd09f,0x193));var _0xfd09=function(_0x4a6156,_0x2b8ce6){_0x4a6156=_0x4a6156-0x0;var _0x12c1f6=_0xd09f[_0x4a6156];return _0x12c1f6;};'use strict';var _=require('lodash');var util=require(_0xfd09('0x0'));exports[_0xfd09('0x1')]=function(_0x39ccf9,_0x468d5f,_0x1b00d0){var _0x7f3a75=[];if(_0x39ccf9[_0xfd09('0x2')]>0x0){var _0x181569=_[_0xfd09('0x3')](_0x39ccf9,['id']);for(var _0x386c5c=0x0;_0x386c5c<_0x181569[_0xfd09('0x2')];_0x386c5c++){var _0x48dffb=_0x181569[_0x386c5c];if(_0x48dffb[_0xfd09('0x4')]===_0xfd09('0x5')){_0x7f3a75['push'](_0x48dffb[_0xfd09('0x6')]);}else if(_0x48dffb[_0xfd09('0x4')]===_0xfd09('0x7')&&_0x48dffb[_0xfd09('0x8')]){_0x468d5f[_0x48dffb[_0xfd09('0x8')]]&&_0x7f3a75['push'](_0x468d5f[_0x48dffb[_0xfd09('0x8')]]['toString']());}else if(_0x48dffb[_0xfd09('0x4')]===_0xfd09('0x9')&&_0x48dffb[_0xfd09('0xa')]&&_0x48dffb[_0xfd09('0xa')][_0xfd09('0xb')]){_0x468d5f[_0x48dffb[_0xfd09('0xa')]['name'][_0xfd09('0xc')]()]&&_0x7f3a75[_0xfd09('0xd')](_0x468d5f[_0x48dffb['Variable']['name'][_0xfd09('0xc')]()][_0xfd09('0xe')]());}else if(_0x48dffb['type']===_0xfd09('0xf')){if(_0x48dffb[_0xfd09('0x10')]==='string'&&_0x48dffb[_0xfd09('0x11')]){_0x7f3a75[_0xfd09('0xd')](util[_0xfd09('0x12')]('%s:\x20%s',_0x48dffb[_0xfd09('0x11')],_0x48dffb['keyContent']));}else if(_0x48dffb['keyType']===_0xfd09('0x7')&&_0x48dffb['variableName']&&_0x48dffb[_0xfd09('0x11')]){_0x468d5f[_0x48dffb['variableName']]&&_0x7f3a75['push'](util[_0xfd09('0x12')](_0xfd09('0x13'),_0x48dffb[_0xfd09('0x11')],_0x468d5f[_0x48dffb[_0xfd09('0x8')]]));}else if(_0x48dffb[_0xfd09('0x10')]===_0xfd09('0x9')&&_0x48dffb[_0xfd09('0xa')]&&_0x48dffb[_0xfd09('0xa')]['name']&&_0x48dffb[_0xfd09('0x11')]){_0x468d5f[_0x48dffb[_0xfd09('0xa')][_0xfd09('0xb')][_0xfd09('0xc')]()]&&_0x7f3a75[_0xfd09('0xd')](util[_0xfd09('0x12')](_0xfd09('0x13'),_0x48dffb[_0xfd09('0x11')],_0x468d5f[_0x48dffb['Variable'][_0xfd09('0xb')][_0xfd09('0xc')]()]));}}}}return _0x7f3a75[_0xfd09('0x14')](_0x1b00d0);};exports[_0xfd09('0x15')]=function(_0x862679){var _0x11e10a=_0x862679[_0xfd09('0x16')](-0x1);if(_0x11e10a==='/'){_0x862679=_0x862679['substring'](0x0,_0x862679['lastIndexOf'](_0x11e10a));}return _0x862679;};exports[_0xfd09('0x17')]=function(_0x4fa401){if(!_['isNil'](_0x4fa401)&&_0x4fa401!==''){var _0x2bd7d2=/^(([^<>()\[\]\\.,;:\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 _0x2bd7d2['test'](String(_0x4fa401)['toLowerCase']());}else{return![];}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/vtiger.js b/server/services/ami/trigger/integration/vtiger.js index 8e74d42..3102141 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 _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(_0x487ca6,_0x1bc69c){var _0x31e872=function(_0x22860a){while(--_0x22860a){_0x487ca6['push'](_0x487ca6['shift']());}};_0x31e872(++_0x1bc69c);}(_0x7217,0x19e));var _0x7721=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x7217[_0x36dfbd];return _0x4ecad9;};'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 +var _0xedd9=['success','resolve','result','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','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!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','getEndUser','accessKey','login','token','getConnection','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','abandoned','calleridname','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','getString','Subjects','POST','format','remoteUri','create','username','sessionName','HelpDesk','then'];(function(_0x54c8a7,_0x3c3764){var _0x5127f8=function(_0x3530bf){while(--_0x3530bf){_0x54c8a7['push'](_0x54c8a7['shift']());}};_0x5127f8(++_0x3c3764);}(_0xedd9,0xfc));var _0x9edd=function(_0x4a9b0d,_0x3126a6){_0x4a9b0d=_0x4a9b0d-0x0;var _0x128aa4=_0xedd9[_0x4a9b0d];return _0x128aa4;};'use strict';var _=require('lodash');var rp=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var Redis=require(_0x9edd('0x4'));var intUtil=require(_0x9edd('0x5'));var config=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('vTiger');config[_0x9edd('0x8')]=_[_0x9edd('0x9')](config[_0x9edd('0x8')],{'host':_0x9edd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0x8')]));function emit(_0x571af9,_0x172522,_0x190185){io['to'](_0x571af9)[_0x9edd('0xb')](_0x172522,_0x190185);}function getCustomFields(_0x3280fd,_0x49d5e3){var _0x494a24={};if(_0x3280fd['length']>0x0){_[_0x9edd('0xc')](_0x3280fd,function(_0x138767){if(_0x138767['type']===_0x9edd('0xd')&&_0x138767[_0x9edd('0xe')]){_0x494a24[_0x138767['idField']]=_0x138767[_0x9edd('0xf')][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x12')&&_0x138767[_0x9edd('0x13')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x13')]]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767['variableName']][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x14')&&_0x138767[_0x9edd('0x15')]&&_0x138767[_0x9edd('0x15')][_0x9edd('0x16')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()][_0x9edd('0x10')]();}});}return _0x494a24;}function createTicket(_0x40ba32,_0x4d8f33,_0x43dc70,_0x5d879c,_0x2cdcef,_0x1083e4,_0x4bdb88){logger['info'](_0x9edd('0x18'));var _0x50338f=_[_0x9edd('0x19')]({'parent_id':'','assigned_user_id':_0x4d8f33['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x9edd('0x1a')](_0x5d879c[_0x9edd('0x1b')],_0x2cdcef,'\x20'),'description':intUtil['getString'](_0x5d879c['Descriptions'],_0x2cdcef,'\x0a'),'contact_id':_0x43dc70['id']},getCustomFields(_0x1083e4,_0x2cdcef));var _0x341d67={'method':_0x9edd('0x1c'),'uri':util[_0x9edd('0x1d')]('%s/webservice.php',_0x40ba32[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'username':_0x40ba32[_0x9edd('0x20')],'sessionName':_0x4bdb88[_0x9edd('0x21')],'elementType':_0x9edd('0x22'),'element':JSON['stringify'](_0x50338f)},'json':!![]};return request(_0x341d67)[_0x9edd('0x23')](function(_0xeaf55a){if(_0xeaf55a[_0x9edd('0x24')]){return BPromise[_0x9edd('0x25')]({'id':_0xeaf55a[_0x9edd('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x9edd('0x27')](_0xeaf55a[_0x9edd('0x28')])));}})[_0x9edd('0x29')](function(_0x25e135){var _0x3c2227=_0x25e135['statusCode']||0x1f4;logger['error'](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x3c2227,JSON[_0x9edd('0x27')](_0x25e135));});}function getUser(_0x52746a,_0x238b22,_0x28cfae){if(intUtil[_0x9edd('0x2c')](_0x238b22)){logger[_0x9edd('0x2d')]('Getting\x20agent\x20with\x20email',_0x238b22);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x52746a[_0x9edd('0x1e')]),'qs':{'operation':_0x9edd('0x30'),'username':_0x52746a[_0x9edd('0x20')],'sessionName':_0x28cfae[_0x9edd('0x21')],'query':util[_0x9edd('0x1d')](_0x9edd('0x31'),_0x238b22)},'json':!![]})[_0x9edd('0x23')](function(_0x4fd03f){if(_0x4fd03f[_0x9edd('0x24')]&&_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x32')]){logger[_0x9edd('0x2d')]('Agent\x20found!');return BPromise[_0x9edd('0x25')]({'id':_0x4fd03f[_0x9edd('0x26')][0x0]['id'],'email':_0x4fd03f[_0x9edd('0x26')][0x0]['email1'],'name':_0x4fd03f[_0x9edd('0x26')][0x0][_0x9edd('0x33')]+'\x20'+_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x34')]});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a[_0x9edd('0x20')],'name':_0x9edd('0x37')});}})[_0x9edd('0x29')](function(_0x42c1d9){var _0x27eb7e=_0x42c1d9[_0x9edd('0x38')]||0x1f4;logger['error'](_0x9edd('0x2a'),'getUser',_0x27eb7e,JSON[_0x9edd('0x27')](_0x42c1d9));});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a['username'],'name':_0x9edd('0x37')})[_0x9edd('0x29')](function(_0x2b3469){var _0x38e9be=_0x2b3469[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x39'),_0x38e9be,JSON[_0x9edd('0x27')](_0x2b3469));});}}function getEndUser(_0x35c16f,_0x51a54a,_0x231604,_0x56a228){logger[_0x9edd('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0x231604);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x35c16f['remoteUri']),'qs':{'operation':_0x9edd('0x30'),'username':_0x35c16f[_0x9edd('0x20')],'sessionName':_0x56a228[_0x9edd('0x21')],'query':util['format'](_0x9edd('0x3a'),_0x231604,_0x231604,_0x231604,_0x231604,_0x231604)},'json':!![]})['then'](function(_0x1fc4fb){if(_0x1fc4fb[_0x9edd('0x24')]&&_0x1fc4fb['result'][_0x9edd('0x32')]){logger[_0x9edd('0x2d')](_0x9edd('0x3b'));return BPromise[_0x9edd('0x25')]({'id':_0x1fc4fb['result'][0x0]['id'],'name':_0x1fc4fb[_0x9edd('0x26')][0x0]['firstname']+'\x20'+_0x1fc4fb[_0x9edd('0x26')][0x0][_0x9edd('0x3c')],'phone':_0x231604});}else{logger['info'](_0x9edd('0x3d'));return request({'method':'POST','uri':util['format'](_0x9edd('0x2f'),_0x35c16f[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'sessionName':_0x56a228[_0x9edd('0x21')],'elementType':_0x9edd('0x3e'),'element':JSON[_0x9edd('0x27')]({'lastname':_0x51a54a,'phone':_0x231604,'assigned_user_id':'\x20'})},'json':!![]})[_0x9edd('0x23')](function(_0x75efbe){logger[_0x9edd('0x2d')](_0x9edd('0x3f'));return BPromise[_0x9edd('0x25')]({'id':_0x75efbe[_0x9edd('0x26')]['id'],'name':_0x75efbe[_0x9edd('0x26')][_0x9edd('0x3c')],'phone':_0x75efbe[_0x9edd('0x26')]['phone']});})[_0x9edd('0x29')](function(_0x2570e3){var _0x2231c1=_0x2570e3[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x40'),_0x2231c1,JSON['stringify'](_0x2570e3));});}});}function getConnection(_0x4a4656){var _0x4bc7a1=_0x4a4656[_0x9edd('0x20')];var _0x58a1dd=_0x4a4656[_0x9edd('0x41')];return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'qs':{'operation':'getchallenge','username':_0x4bc7a1},'json':!![]})[_0x9edd('0x23')](function(_0x35e63c){if(_0x35e63c[_0x9edd('0x24')]){return request({'method':'POST','uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x42'),'username':_0x4bc7a1,'accessKey':md5(_0x35e63c[_0x9edd('0x26')][_0x9edd('0x43')]+_0x58a1dd)},'json':!![]});}})['then'](function(_0x441e4a){if(_0x441e4a[_0x9edd('0x24')]){return BPromise['resolve'](_0x441e4a[_0x9edd('0x26')]);}else{throw new Error(util[_0x9edd('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x4a4656['id']));}})[_0x9edd('0x29')](function(_0x8134cd){var _0x468239=_0x8134cd['statusCode']||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x44'),_0x468239,JSON[_0x9edd('0x27')](_0x8134cd));});}function request(_0x53f6e3){logger[_0x9edd('0x2d')](_0x9edd('0x45'),JSON[_0x9edd('0x27')](_0x53f6e3));return rp(_0x53f6e3);}exports['queue']=function(_0x16951a,_0x21f6ce,_0x57db43,_0x8e59bd,_0x4e2aaf,_0x336494){var _0xe6b20c,_0x24245f,_0x3fcdf5,_0x1e3c19;_0x336494[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x336494[_0x9edd('0x1e')]);if(_0x4e2aaf&&_0x4e2aaf[_0x9edd('0x47')]){logger[_0x9edd('0x2d')](_0x9edd('0x48'),'Recording\x20is\x20enabled!');_0x21f6ce[_0x9edd('0x49')]=util[_0x9edd('0x1d')](_0x9edd('0x4a'),_0x336494['serverUrl'],_0x21f6ce[_0x9edd('0x4b')],md5(_0x21f6ce['uniqueid']));}else{_0x21f6ce['recordingURL']='';}return getConnection(_0x336494)['then'](function(_0x1348a7){_0x1e3c19=_0x1348a7;return getUser(_0x336494,_0x8e59bd[_0x9edd('0x4c')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x35ddb3){_0xe6b20c=_0x35ddb3;logger['info']('The\x20User\x20ID\x20is:',_0xe6b20c['id']);return getEndUser(_0x336494,_0x21f6ce['calleridname'],_0x21f6ce[_0x9edd('0x4d')],_0x1e3c19);})[_0x9edd('0x23')](function(_0xd5090a){_0x24245f=_0xd5090a;logger[_0x9edd('0x2d')](_0x9edd('0x4e'),_0x24245f['id']);return createTicket(_0x336494,_0xe6b20c,_0x24245f,_0x57db43,_0x21f6ce,_0x57db43[_0x9edd('0x4f')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x1e3087){_0x3fcdf5=_0x1e3087;logger['info'](_0x9edd('0x50'));logger['info'](_0x9edd('0x51'),_0x3fcdf5['id']);var _0x6a1cfc=util['format'](_0x9edd('0x52'),_0x336494[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x3fcdf5['id'],'x')[0x1]);logger['info'](_0x9edd('0x48'),_0x9edd('0x54'));emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x8e59bd[_0x9edd('0x16')]),_0x9edd('0x56'),{'uri':_0x6a1cfc});})['catch'](function(_0x4aa337){logger[_0x9edd('0x28')]('[QUEUE]',JSON[_0x9edd('0x27')](_0x4aa337));});};exports[_0x9edd('0x57')]=function(_0x439083,_0x17d2f2,_0x5df1d7,_0x21ead2,_0x507cce,_0x3e5dca,_0x344692){var _0xc6bde6,_0x5ca123,_0x2651a2,_0x57da5b;_0x3e5dca[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x3e5dca['remoteUri']);_0x3e5dca[_0x9edd('0x58')]=intUtil['stripTrailingSlash'](_0x3e5dca[_0x9edd('0x58')]);if(_0x344692&&_0x344692[_0x9edd('0x59')]&&_0x344692[_0x9edd('0x59')]!=='none'){logger[_0x9edd('0x2d')](_0x9edd('0x5a'),_0x9edd('0x5b'));_0x17d2f2[_0x9edd('0x49')]=util[_0x9edd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5dca['serverUrl'],_0x17d2f2[_0x9edd('0x4b')],md5(_0x17d2f2[_0x9edd('0x4b')]));}return getConnection(_0x3e5dca)['then'](function(_0x5496e9){_0x57da5b=_0x5496e9;return getUser(_0x3e5dca,_0x21ead2['email'],_0x57da5b);})[_0x9edd('0x23')](function(_0x4e003a){_0xc6bde6=_0x4e003a;logger['info'](_0x9edd('0x5c'),_0xc6bde6['id']);return getEndUser(_0x3e5dca,_0x17d2f2[_0x9edd('0x5d')],_0x17d2f2['destcalleridnum'],_0x57da5b);})[_0x9edd('0x23')](function(_0x11e082){_0x5ca123=_0x11e082;logger[_0x9edd('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x5ca123['id']);return createTicket(_0x3e5dca,_0xc6bde6,_0x5ca123,_0x5df1d7,_0x17d2f2,_0x5df1d7[_0x9edd('0x4f')],_0x57da5b);})['then'](function(_0x37b018){_0x2651a2=_0x37b018;logger[_0x9edd('0x2d')]('Ticket\x20created!');logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x2651a2['id']);var _0x5c1746=util[_0x9edd('0x1d')](_0x9edd('0x52'),_0x3e5dca[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x2651a2['id'],'x')[0x1]);logger['info'](_0x9edd('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x21ead2[_0x9edd('0x16')]),'trigger:browser:url',{'uri':_0x5c1746});})[_0x9edd('0x29')](function(_0x286593){logger[_0x9edd('0x28')](_0x9edd('0x5a'),JSON[_0x9edd('0x27')](_0x286593));});};exports[_0x9edd('0x5e')]=function(_0x3fa4a9,_0x512d3a,_0x5e29d0,_0x322165,_0x3c7874,_0x13254e){var _0x171403,_0x1e2126,_0x52f6f3,_0x2e40c8;_0x13254e[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x13254e['remoteUri']);_0x13254e[_0x9edd('0x58')]=intUtil[_0x9edd('0x46')](_0x13254e['serverUrl']);if(_0x3c7874&&_0x3c7874[_0x9edd('0x47')]){logger[_0x9edd('0x2d')]('[ABANDONED]',_0x9edd('0x5b'));_0x512d3a[_0x9edd('0x49')]=util['format'](_0x9edd('0x4a'),_0x13254e['serverUrl'],_0x512d3a['uniqueid'],md5(_0x512d3a[_0x9edd('0x4b')]));}else{_0x512d3a[_0x9edd('0x49')]='';}return getConnection(_0x13254e)[_0x9edd('0x23')](function(_0x5b56c7){_0x2e40c8=_0x5b56c7;return getUser(_0x13254e,'',_0x2e40c8);})[_0x9edd('0x23')](function(_0x286e47){_0x171403=_0x286e47;logger['info'](_0x9edd('0x5c'),_0x171403['id']);return getEndUser(_0x13254e,_0x512d3a[_0x9edd('0x5f')],_0x512d3a[_0x9edd('0x4d')],_0x2e40c8);})[_0x9edd('0x23')](function(_0x54ac71){_0x1e2126=_0x54ac71;logger['info'](_0x9edd('0x4e'),_0x1e2126['id']);return createTicket(_0x13254e,_0x171403,_0x1e2126,_0x5e29d0,_0x512d3a,_0x5e29d0['Fields'],_0x2e40c8);})[_0x9edd('0x23')](function(_0x2c71ce){_0x52f6f3=_0x2c71ce;logger[_0x9edd('0x2d')](_0x9edd('0x50'));logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x52f6f3['id']);})[_0x9edd('0x29')](function(_0x5a4d4b){logger[_0x9edd('0x28')]('[ABANDONED]',JSON[_0x9edd('0x27')](_0x5a4d4b));});}; \ 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 2b4f28e..ad9da73 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 _0x0faf=['Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','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','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','authType','password','%s:%s','username','token','%s/token:%s','Basic\x20%s','toString','base64','stringify','GET','forEach','type','string','nameField','customField','idField','custom_fields','variable','variableName','push','customVariable','Variable','name','toLowerCase','serverUrl','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','inspect','recordingFormat','none','Authorization','destcalleridname','destcalleridnum','[OUTBOUND]','newTab','abandoned','calleridname','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','Tags','getString'];(function(_0x12d8d1,_0x42d7f3){var _0x59a3e3=function(_0x4f25d9){while(--_0x4f25d9){_0x12d8d1['push'](_0x12d8d1['shift']());}};_0x59a3e3(++_0x42d7f3);}(_0x0faf,0x132));var _0xf0fa=function(_0x40197b,_0x4e763f){_0x40197b=_0x40197b-0x0;var _0x3b9c2f=_0x0faf[_0x40197b];return _0x3b9c2f;};'use strict';var _=require(_0xf0fa('0x0'));var rp=require('request-promise');var md5=require(_0xf0fa('0x1'));var util=require(_0xf0fa('0x2'));var Redis=require(_0xf0fa('0x3'));var intUtil=require(_0xf0fa('0x4'));var config=require(_0xf0fa('0x5'));var logger=require(_0xf0fa('0x6'))(_0xf0fa('0x7'));config[_0xf0fa('0x8')]=_[_0xf0fa('0x9')](config['redis'],{'host':_0xf0fa('0xa'),'port':0x18eb});var io=require(_0xf0fa('0xb'))(new Redis(config[_0xf0fa('0x8')]));function emit(_0x3a703b,_0x2db1d9,_0x587865){io['to'](_0x3a703b)[_0xf0fa('0xc')](_0x2db1d9,_0x587865);}var headers={'Content-Type':_0xf0fa('0xd'),'Accept':'application/json'};function getTicket(_0x4df4d1,_0x3bda51,_0x1e8cc0,_0x25dfec,_0x1f3bb7){logger[_0xf0fa('0xe')](_0xf0fa('0xf'));return request({'uri':util[_0xf0fa('0x10')](_0xf0fa('0x11'),_0x4df4d1['remoteUri']),'method':_0xf0fa('0x12'),'body':{'ticket':_['merge']({'requester_id':_0x1e8cc0['id'],'submitter_id':_0x3bda51?_0x3bda51['id']:undefined,'assignee_id':_0x3bda51?_0x3bda51['id']:undefined,'tags':getTags(_0x25dfec[_0xf0fa('0x13')],'name'),'subject':intUtil[_0xf0fa('0x14')](_0x25dfec[_0xf0fa('0x15')],_0x1f3bb7,'\x20'),'description':intUtil[_0xf0fa('0x14')](_0x25dfec['Descriptions'],_0x1f3bb7,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x25dfec[_0xf0fa('0x16')],_0x1f3bb7,'\x0a')}},getCustomFields(_0x25dfec['Fields'],_0x1f3bb7))}})[_0xf0fa('0x17')](function(_0x81fc49){logger[_0xf0fa('0xe')](_0xf0fa('0x18'));return _0x81fc49[_0xf0fa('0x19')];});}function getUser(_0x33df80,_0x28bab8){if(intUtil[_0xf0fa('0x1a')](_0x28bab8)){logger['info'](_0xf0fa('0x1b'),_0x28bab8);return request({'uri':util[_0xf0fa('0x10')](_0xf0fa('0x1c'),_0x33df80[_0xf0fa('0x1d')]),'qs':{'query':util[_0xf0fa('0x10')](_0xf0fa('0x1e'),_0x28bab8)}})['then'](function(_0x56ef81){if(_0x56ef81[_0xf0fa('0x1f')]){logger[_0xf0fa('0xe')](_0xf0fa('0x20'));return _[_0xf0fa('0x21')](_0x56ef81[_0xf0fa('0x22')],{'email':_0x28bab8,'role':_0xf0fa('0x23')});}else{logger[_0xf0fa('0xe')](_0xf0fa('0x24'));return request({'uri':util[_0xf0fa('0x10')](_0xf0fa('0x25'),_0x33df80[_0xf0fa('0x1d')])})['then'](function(_0x10c93e){logger[_0xf0fa('0xe')](_0xf0fa('0x26'));return _0x10c93e[_0xf0fa('0x27')];});}});}else{logger[_0xf0fa('0xe')](_0xf0fa('0x24'));return request({'uri':util[_0xf0fa('0x10')](_0xf0fa('0x25'),_0x33df80[_0xf0fa('0x1d')])})['then'](function(_0xeb86a9){logger[_0xf0fa('0xe')]('Admin\x20account\x20selected.');return _0xeb86a9[_0xf0fa('0x27')];});}}function getEndUser(_0x3703b5,_0x2efe88,_0x59e007){logger[_0xf0fa('0xe')](_0xf0fa('0x28'),_0x59e007);return request({'uri':util[_0xf0fa('0x10')](_0xf0fa('0x1c'),_0x3703b5['remoteUri']),'qs':{'query':util['format'](_0xf0fa('0x29'),_0x59e007)}})[_0xf0fa('0x17')](function(_0x1679cf){var _0x11085f;if(_0x1679cf['results'][_0xf0fa('0x2a')]){_0x1679cf[_0xf0fa('0x22')]=_[_0xf0fa('0x2b')](_0x1679cf['results'],{'suspended':![],'role':_0xf0fa('0x2c')});if(_0x1679cf['results'][_0xf0fa('0x2a')]){_0x11085f=_[_0xf0fa('0x2d')](_0x1679cf[_0xf0fa('0x22')]);}}if(_0x11085f){logger['info'](_0xf0fa('0x2e'));return _0x11085f;}else{logger[_0xf0fa('0xe')](_0xf0fa('0x2f'));return request({'uri':util[_0xf0fa('0x10')](_0xf0fa('0x30'),_0x3703b5[_0xf0fa('0x1d')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0xf0fa('0x10')](_0xf0fa('0x31'),_0x2efe88||_0x59e007),'phone':_0x59e007}}})['then'](function(_0x38cf8c){logger['info']('Enduser\x20created.');return _0x38cf8c['user'];});}});}function getAuth(_0x39bce0){var _0x5c82d7;if(_0x39bce0[_0xf0fa('0x32')]===_0xf0fa('0x33')){_0x5c82d7=util[_0xf0fa('0x10')](_0xf0fa('0x34'),_0x39bce0[_0xf0fa('0x35')],_0x39bce0[_0xf0fa('0x33')]);}else if(_0x39bce0[_0xf0fa('0x32')]===_0xf0fa('0x36')){_0x5c82d7=util['format'](_0xf0fa('0x37'),_0x39bce0[_0xf0fa('0x35')],_0x39bce0[_0xf0fa('0x36')]);}return util['format'](_0xf0fa('0x38'),new Buffer(_0x5c82d7)[_0xf0fa('0x39')](_0xf0fa('0x3a')));}function request(_0xb29ae5){logger['debug']('[HTTP]',JSON[_0xf0fa('0x3b')](_0xb29ae5));return rp(_[_0xf0fa('0x9')](_0xb29ae5,{'method':_0xf0fa('0x3c'),'headers':headers,'json':!![]}));}function getTags(_0x47486f,_0x3a238d){var _0x5cd669=[];if(_0x47486f&&_0x47486f['length']>0x0){_0x5cd669=_['map'](_0x47486f,_0x3a238d);}return _0x5cd669;}function getCustomFields(_0x596c2a,_0x3cdc0e){var _0x778121=[];var _0x5ef93e={'custom_fields':[]};if(_0x596c2a['length']>0x0){_[_0xf0fa('0x3d')](_0x596c2a,function(_0x1b8fb8){if(_0x1b8fb8[_0xf0fa('0x3e')]===_0xf0fa('0x3f')&&_0x1b8fb8[_0xf0fa('0x40')]&&!_0x1b8fb8[_0xf0fa('0x41')]){_0x5ef93e[_0x1b8fb8[_0xf0fa('0x40')]['toLowerCase']()]=_0x1b8fb8['content'][_0xf0fa('0x39')]();}else if(_0x1b8fb8[_0xf0fa('0x3e')]===_0xf0fa('0x3f')&&_0x1b8fb8[_0xf0fa('0x42')]&&_0x1b8fb8[_0xf0fa('0x41')]){_0x5ef93e[_0xf0fa('0x43')]['push']({'id':_0x1b8fb8[_0xf0fa('0x42')],'value':_0x1b8fb8['content'][_0xf0fa('0x39')]()});}else if(_0x1b8fb8[_0xf0fa('0x3e')]===_0xf0fa('0x44')&&_0x1b8fb8[_0xf0fa('0x45')]&&_0x1b8fb8[_0xf0fa('0x42')]&&_0x1b8fb8[_0xf0fa('0x41')]){_0x3cdc0e[_0x1b8fb8[_0xf0fa('0x45')]]&&_0x5ef93e[_0xf0fa('0x43')][_0xf0fa('0x46')]({'id':_0x1b8fb8['idField'],'value':_0x3cdc0e[_0x1b8fb8['variableName']]['toString']()});}else if(_0x1b8fb8[_0xf0fa('0x3e')]===_0xf0fa('0x47')&&_0x1b8fb8['Variable']&&_0x1b8fb8[_0xf0fa('0x48')][_0xf0fa('0x49')]&&_0x1b8fb8[_0xf0fa('0x42')]&&_0x1b8fb8[_0xf0fa('0x41')]){_0x3cdc0e[_0x1b8fb8['Variable'][_0xf0fa('0x49')][_0xf0fa('0x4a')]()]&&_0x5ef93e[_0xf0fa('0x43')][_0xf0fa('0x46')]({'id':_0x1b8fb8[_0xf0fa('0x42')],'value':_0x3cdc0e[_0x1b8fb8[_0xf0fa('0x48')][_0xf0fa('0x49')][_0xf0fa('0x4a')]()][_0xf0fa('0x39')]()});}});}return _0x5ef93e;}exports['queue']=function(_0x45c0e8,_0x3b5bfa,_0x896adf,_0x24ae12,_0x856c2e,_0x2f8c74){var _0x53b2a6,_0xd86643;_0x2f8c74[_0xf0fa('0x1d')]=intUtil['stripTrailingSlash'](_0x2f8c74[_0xf0fa('0x1d')]);_0x2f8c74[_0xf0fa('0x4b')]=intUtil[_0xf0fa('0x4c')](_0x2f8c74[_0xf0fa('0x4b')]);if(_0x856c2e&&_0x856c2e[_0xf0fa('0x4d')]){logger[_0xf0fa('0xe')](_0xf0fa('0x4e'),_0xf0fa('0x4f'));_0x3b5bfa[_0xf0fa('0x50')]=util['format'](_0xf0fa('0x51'),_0x2f8c74['serverUrl'],_0x3b5bfa[_0xf0fa('0x52')],md5(_0x3b5bfa[_0xf0fa('0x52')]));}else{_0x3b5bfa[_0xf0fa('0x50')]='';}headers['Authorization']=getAuth(_0x2f8c74);return getUser(_0x2f8c74,_0x24ae12[_0xf0fa('0x53')])[_0xf0fa('0x17')](function(_0x354f03){_0x53b2a6=_0x354f03;logger[_0xf0fa('0xe')](_0xf0fa('0x54'),_0x53b2a6['id']);return getEndUser(_0x2f8c74,_0x3b5bfa['calleridname'],_0x3b5bfa[_0xf0fa('0x55')]);})['then'](function(_0x19c22f){_0xd86643=_0x19c22f;logger[_0xf0fa('0xe')](_0xf0fa('0x56'),_0xd86643['id']);return getTicket(_0x2f8c74,_0x53b2a6,_0xd86643,_0x896adf,_0x3b5bfa);})[_0xf0fa('0x17')](function(_0x8090a7){if(_0x8090a7){logger['info'](_0xf0fa('0x57'),_0x8090a7['id']);switch(_0x2f8c74[_0xf0fa('0x3e')]){case _0xf0fa('0x58'):logger[_0xf0fa('0xe')](_0xf0fa('0x4e'),_0xf0fa('0x59'));return request({'uri':util['format'](_0xf0fa('0x5a'),_0x2f8c74['remoteUri'],_0x53b2a6['id'],_0x8090a7['id']),'method':'POST'});case'newTab':logger[_0xf0fa('0xe')](_0xf0fa('0x4e'),_0xf0fa('0x5b'));emit(util[_0xf0fa('0x10')](_0xf0fa('0x5c'),_0x24ae12[_0xf0fa('0x49')]),_0xf0fa('0x5d'),{'uri':util[_0xf0fa('0x10')](_0xf0fa('0x5e'),_0x2f8c74['remoteUri'],_0x8090a7['id'])});break;default:logger[_0xf0fa('0x5f')]('[QUEUE]',_0xf0fa('0x60'));}}})[_0xf0fa('0x61')](function(_0x1f95dc){logger[_0xf0fa('0x5f')]('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util[_0xf0fa('0x62')](_0x1f95dc,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x2f0e8e,_0x398ea0,_0x10b45c,_0x1d6a27,_0xa55804,_0x1fad44,_0x4fa721){var _0x203205,_0x119816;_0x1fad44['remoteUri']=intUtil[_0xf0fa('0x4c')](_0x1fad44[_0xf0fa('0x1d')]);_0x1fad44['serverUrl']=intUtil[_0xf0fa('0x4c')](_0x1fad44[_0xf0fa('0x4b')]);if(_0x4fa721&&_0x4fa721['recordingFormat']&&_0x4fa721[_0xf0fa('0x63')]!==_0xf0fa('0x64')){logger[_0xf0fa('0xe')]('[OUTBOUND]',_0xf0fa('0x4f'));_0x398ea0[_0xf0fa('0x50')]=util['format'](_0xf0fa('0x51'),_0x1fad44[_0xf0fa('0x4b')],_0x398ea0[_0xf0fa('0x52')],md5(_0x398ea0['uniqueid']));}headers[_0xf0fa('0x65')]=getAuth(_0x1fad44);return getUser(_0x1fad44,_0x1d6a27[_0xf0fa('0x53')])['then'](function(_0x31535f){_0x203205=_0x31535f;logger[_0xf0fa('0xe')](_0xf0fa('0x54'),_0x203205['id']);return getEndUser(_0x1fad44,_0x398ea0[_0xf0fa('0x66')],_0x398ea0[_0xf0fa('0x67')]);})[_0xf0fa('0x17')](function(_0x1e4e4d){_0x119816=_0x1e4e4d;logger[_0xf0fa('0xe')](_0xf0fa('0x56'),_0x119816['id']);return getTicket(_0x1fad44,_0x203205,_0x119816,_0x10b45c,_0x398ea0);})[_0xf0fa('0x17')](function(_0x53f45c){if(_0x53f45c){logger[_0xf0fa('0xe')](_0xf0fa('0x57'),_0x53f45c['id']);switch(_0x1fad44[_0xf0fa('0x3e')]){case _0xf0fa('0x58'):logger[_0xf0fa('0xe')](_0xf0fa('0x68'),_0xf0fa('0x59'));return request({'uri':util['format'](_0xf0fa('0x5a'),_0x1fad44[_0xf0fa('0x1d')],_0x203205['id'],_0x53f45c['id']),'method':_0xf0fa('0x12')});case _0xf0fa('0x69'):logger[_0xf0fa('0xe')](_0xf0fa('0x68'),_0xf0fa('0x5b'));emit(util['format'](_0xf0fa('0x5c'),_0x1d6a27[_0xf0fa('0x49')]),_0xf0fa('0x5d'),{'uri':util[_0xf0fa('0x10')](_0xf0fa('0x5e'),_0x1fad44['remoteUri'],_0x53f45c['id'])});break;default:logger['error']('[OUTBOUND]',_0xf0fa('0x60'));}}})[_0xf0fa('0x61')](function(_0x405012){logger[_0xf0fa('0x5f')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x405012,{'showHidden':!![],'depth':null}));});};exports[_0xf0fa('0x6a')]=function(_0x5f4921,_0x1cd327,_0xd766da,_0x31c943,_0x23b368,_0x1b4c03){var _0x57ea2c,_0x130e56;_0x1b4c03[_0xf0fa('0x1d')]=intUtil[_0xf0fa('0x4c')](_0x1b4c03[_0xf0fa('0x1d')]);_0x1b4c03[_0xf0fa('0x4b')]=intUtil[_0xf0fa('0x4c')](_0x1b4c03[_0xf0fa('0x4b')]);if(_0x23b368&&_0x23b368[_0xf0fa('0x4d')]){logger[_0xf0fa('0xe')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x1cd327[_0xf0fa('0x50')]=util['format'](_0xf0fa('0x51'),_0x1b4c03['serverUrl'],_0x1cd327['uniqueid'],md5(_0x1cd327['uniqueid']));}else{_0x1cd327[_0xf0fa('0x50')]='';}headers[_0xf0fa('0x65')]=getAuth(_0x1b4c03);return getUser(_0x1b4c03)[_0xf0fa('0x17')](function(_0xb31dcf){_0x57ea2c=_0xb31dcf;logger[_0xf0fa('0xe')](_0xf0fa('0x54'),_0x57ea2c['id']);return getEndUser(_0x1b4c03,_0x1cd327[_0xf0fa('0x6b')],_0x1cd327[_0xf0fa('0x55')]);})[_0xf0fa('0x17')](function(_0x1cd67c){_0x130e56=_0x1cd67c;logger['info'](_0xf0fa('0x56'),_0x130e56['id']);return getTicket(_0x1b4c03,_0x57ea2c,_0x130e56,_0xd766da,_0x1cd327);})['then'](function(_0x448851){if(_0x448851){logger['info'](_0xf0fa('0x57'),_0x448851['id']);}})['catch'](function(_0xfc616e){logger['error'](_0xf0fa('0x6c'),util[_0xf0fa('0x62')](_0xfc616e,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x2356=['serverUrl','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','recordingURL','Authorization','email','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','integrationTab','[QUEUE]','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','Zendesk\x20account\x20type\x20not\x20recognized','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','outbound','recordingFormat','[OUTBOUND]','uniqueid','destcalleridname','The\x20Ticket\x20ID\x20is:','catch','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','abandoned','[ABANDONED]','calleridname','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','request-promise','md5','./util','../../../../config/environment','redis','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','%s/tickets.json','POST','merge','Tags','name','Subjects','getString','Fields','then','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','Agent\x20found!','agent','%s/users/me.json','Admin\x20account\x20selected.','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user','type:user\x20role:end-user\x20phone:%s','results','length','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','end-user','Caller\x20-\x20%s','password','username','authType','%s/token:%s','toString','base64','debug','[HTTP]','defaults','map','forEach','type','string','nameField','customField','idField','custom_fields','variable','variableName','customVariable','Variable','toLowerCase','queue','stripTrailingSlash'];(function(_0x38537f,_0x252124){var _0x141e23=function(_0x2809b5){while(--_0x2809b5){_0x38537f['push'](_0x38537f['shift']());}};_0x141e23(++_0x252124);}(_0x2356,0x14f));var _0x6235=function(_0x17c4df,_0x5ea730){_0x17c4df=_0x17c4df-0x0;var _0x38409f=_0x2356[_0x17c4df];return _0x38409f;};'use strict';var _=require('lodash');var rp=require(_0x6235('0x0'));var md5=require(_0x6235('0x1'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x6235('0x2'));var config=require(_0x6235('0x3'));var logger=require('../../../../config/logger')('zendesk');config[_0x6235('0x4')]=_['defaults'](config['redis'],{'host':_0x6235('0x5'),'port':0x18eb});var io=require(_0x6235('0x6'))(new Redis(config[_0x6235('0x4')]));function emit(_0x47f3a5,_0x4c15c6,_0x547159){io['to'](_0x47f3a5)[_0x6235('0x7')](_0x4c15c6,_0x547159);}var headers={'Content-Type':'application/json','Accept':_0x6235('0x8')};function getTicket(_0x11d1f9,_0x3e0f96,_0x31fc6e,_0x5de19a,_0x46fecf){logger[_0x6235('0x9')](_0x6235('0xa'));return request({'uri':util[_0x6235('0xb')](_0x6235('0xc'),_0x11d1f9['remoteUri']),'method':_0x6235('0xd'),'body':{'ticket':_[_0x6235('0xe')]({'requester_id':_0x31fc6e['id'],'submitter_id':_0x3e0f96?_0x3e0f96['id']:undefined,'assignee_id':_0x3e0f96?_0x3e0f96['id']:undefined,'tags':getTags(_0x5de19a[_0x6235('0xf')],_0x6235('0x10')),'subject':intUtil['getString'](_0x5de19a[_0x6235('0x11')],_0x46fecf,'\x20'),'description':intUtil[_0x6235('0x12')](_0x5de19a['Descriptions'],_0x46fecf,'\x0a'),'comment':{'public':![],'body':intUtil[_0x6235('0x12')](_0x5de19a['Descriptions'],_0x46fecf,'\x0a')}},getCustomFields(_0x5de19a[_0x6235('0x13')],_0x46fecf))}})[_0x6235('0x14')](function(_0x51c990){logger[_0x6235('0x9')](_0x6235('0x15'));return _0x51c990[_0x6235('0x16')];});}function getUser(_0x3f32af,_0x5d1ab7){if(intUtil[_0x6235('0x17')](_0x5d1ab7)){logger[_0x6235('0x9')](_0x6235('0x18'),_0x5d1ab7);return request({'uri':util[_0x6235('0xb')](_0x6235('0x19'),_0x3f32af[_0x6235('0x1a')]),'qs':{'query':util[_0x6235('0xb')](_0x6235('0x1b'),_0x5d1ab7)}})[_0x6235('0x14')](function(_0x1f8cd3){if(_0x1f8cd3['count']){logger[_0x6235('0x9')](_0x6235('0x1c'));return _['find'](_0x1f8cd3['results'],{'email':_0x5d1ab7,'role':_0x6235('0x1d')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util['format'](_0x6235('0x1e'),_0x3f32af[_0x6235('0x1a')])})[_0x6235('0x14')](function(_0x1c60c7){logger[_0x6235('0x9')](_0x6235('0x1f'));return _0x1c60c7['user'];});}});}else{logger['info'](_0x6235('0x20'));return request({'uri':util['format'](_0x6235('0x1e'),_0x3f32af[_0x6235('0x1a')])})[_0x6235('0x14')](function(_0x339d58){logger[_0x6235('0x9')]('Admin\x20account\x20selected.');return _0x339d58[_0x6235('0x21')];});}}function getEndUser(_0x1da380,_0x168b01,_0x46f73a){logger[_0x6235('0x9')]('Searching\x20enduser\x20with\x20phone',_0x46f73a);return request({'uri':util['format']('%s/search.json',_0x1da380['remoteUri']),'qs':{'query':util[_0x6235('0xb')](_0x6235('0x22'),_0x46f73a)}})[_0x6235('0x14')](function(_0x20c633){var _0x3e7cc8;if(_0x20c633[_0x6235('0x23')]['length']){_0x20c633['results']=_['filter'](_0x20c633[_0x6235('0x23')],{'suspended':![],'role':'end-user'});if(_0x20c633[_0x6235('0x23')][_0x6235('0x24')]){_0x3e7cc8=_['first'](_0x20c633[_0x6235('0x23')]);}}if(_0x3e7cc8){logger[_0x6235('0x9')]('Enduser\x20found!');return _0x3e7cc8;}else{logger[_0x6235('0x9')](_0x6235('0x25'));return request({'uri':util[_0x6235('0xb')](_0x6235('0x26'),_0x1da380[_0x6235('0x1a')]),'method':_0x6235('0xd'),'body':{'user':{'role':_0x6235('0x27'),'name':util[_0x6235('0xb')](_0x6235('0x28'),_0x168b01||_0x46f73a),'phone':_0x46f73a}}})[_0x6235('0x14')](function(_0x4eb225){logger[_0x6235('0x9')]('Enduser\x20created.');return _0x4eb225['user'];});}});}function getAuth(_0x463e8e){var _0x54a6ea;if(_0x463e8e['authType']===_0x6235('0x29')){_0x54a6ea=util['format']('%s:%s',_0x463e8e[_0x6235('0x2a')],_0x463e8e[_0x6235('0x29')]);}else if(_0x463e8e[_0x6235('0x2b')]==='token'){_0x54a6ea=util[_0x6235('0xb')](_0x6235('0x2c'),_0x463e8e[_0x6235('0x2a')],_0x463e8e['token']);}return util[_0x6235('0xb')]('Basic\x20%s',new Buffer(_0x54a6ea)[_0x6235('0x2d')](_0x6235('0x2e')));}function request(_0x2092d5){logger[_0x6235('0x2f')](_0x6235('0x30'),JSON['stringify'](_0x2092d5));return rp(_[_0x6235('0x31')](_0x2092d5,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0xc0f5d2,_0x706301){var _0xbb36e4=[];if(_0xc0f5d2&&_0xc0f5d2[_0x6235('0x24')]>0x0){_0xbb36e4=_[_0x6235('0x32')](_0xc0f5d2,_0x706301);}return _0xbb36e4;}function getCustomFields(_0x4f0461,_0x4b476a){var _0x3626ee=[];var _0x3ed704={'custom_fields':[]};if(_0x4f0461[_0x6235('0x24')]>0x0){_[_0x6235('0x33')](_0x4f0461,function(_0xfb07a8){if(_0xfb07a8[_0x6235('0x34')]===_0x6235('0x35')&&_0xfb07a8[_0x6235('0x36')]&&!_0xfb07a8[_0x6235('0x37')]){_0x3ed704[_0xfb07a8[_0x6235('0x36')]['toLowerCase']()]=_0xfb07a8['content'][_0x6235('0x2d')]();}else if(_0xfb07a8['type']==='string'&&_0xfb07a8[_0x6235('0x38')]&&_0xfb07a8[_0x6235('0x37')]){_0x3ed704[_0x6235('0x39')]['push']({'id':_0xfb07a8[_0x6235('0x38')],'value':_0xfb07a8['content'][_0x6235('0x2d')]()});}else if(_0xfb07a8[_0x6235('0x34')]===_0x6235('0x3a')&&_0xfb07a8[_0x6235('0x3b')]&&_0xfb07a8[_0x6235('0x38')]&&_0xfb07a8[_0x6235('0x37')]){_0x4b476a[_0xfb07a8[_0x6235('0x3b')]]&&_0x3ed704[_0x6235('0x39')]['push']({'id':_0xfb07a8['idField'],'value':_0x4b476a[_0xfb07a8[_0x6235('0x3b')]]['toString']()});}else if(_0xfb07a8[_0x6235('0x34')]===_0x6235('0x3c')&&_0xfb07a8[_0x6235('0x3d')]&&_0xfb07a8[_0x6235('0x3d')][_0x6235('0x10')]&&_0xfb07a8[_0x6235('0x38')]&&_0xfb07a8[_0x6235('0x37')]){_0x4b476a[_0xfb07a8['Variable'][_0x6235('0x10')][_0x6235('0x3e')]()]&&_0x3ed704[_0x6235('0x39')]['push']({'id':_0xfb07a8[_0x6235('0x38')],'value':_0x4b476a[_0xfb07a8[_0x6235('0x3d')][_0x6235('0x10')][_0x6235('0x3e')]()][_0x6235('0x2d')]()});}});}return _0x3ed704;}exports[_0x6235('0x3f')]=function(_0x308e80,_0x45f06a,_0x596f24,_0x36cd02,_0x8e6891,_0x14f71b){var _0x47e360,_0x341680;_0x14f71b[_0x6235('0x1a')]=intUtil[_0x6235('0x40')](_0x14f71b[_0x6235('0x1a')]);_0x14f71b[_0x6235('0x41')]=intUtil[_0x6235('0x40')](_0x14f71b[_0x6235('0x41')]);if(_0x8e6891&&_0x8e6891[_0x6235('0x42')]){logger[_0x6235('0x9')]('[QUEUE]',_0x6235('0x43'));_0x45f06a['recordingURL']=util[_0x6235('0xb')](_0x6235('0x44'),_0x14f71b[_0x6235('0x41')],_0x45f06a['uniqueid'],md5(_0x45f06a['uniqueid']));}else{_0x45f06a[_0x6235('0x45')]='';}headers[_0x6235('0x46')]=getAuth(_0x14f71b);return getUser(_0x14f71b,_0x36cd02[_0x6235('0x47')])[_0x6235('0x14')](function(_0x527a60){_0x47e360=_0x527a60;logger[_0x6235('0x9')](_0x6235('0x48'),_0x47e360['id']);return getEndUser(_0x14f71b,_0x45f06a['calleridname'],_0x45f06a[_0x6235('0x49')]);})['then'](function(_0x1977e8){_0x341680=_0x1977e8;logger[_0x6235('0x9')](_0x6235('0x4a'),_0x341680['id']);return getTicket(_0x14f71b,_0x47e360,_0x341680,_0x596f24,_0x45f06a);})['then'](function(_0x2aa5f9){if(_0x2aa5f9){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2aa5f9['id']);switch(_0x14f71b['type']){case _0x6235('0x4b'):logger[_0x6235('0x9')](_0x6235('0x4c'),_0x6235('0x4d'));return request({'uri':util[_0x6235('0xb')](_0x6235('0x4e'),_0x14f71b[_0x6235('0x1a')],_0x47e360['id'],_0x2aa5f9['id']),'method':'POST'});case _0x6235('0x4f'):logger[_0x6235('0x9')](_0x6235('0x4c'),_0x6235('0x50'));emit(util['format'](_0x6235('0x51'),_0x36cd02[_0x6235('0x10')]),_0x6235('0x52'),{'uri':util['format'](_0x6235('0x53'),_0x14f71b['remoteUri'],_0x2aa5f9['id'])});break;default:logger['error']('[QUEUE]',_0x6235('0x54'));}}})['catch'](function(_0x44b544){logger[_0x6235('0x55')](_0x6235('0x56'),util['inspect'](_0x44b544,{'showHidden':!![],'depth':null}));});};exports[_0x6235('0x57')]=function(_0x5257cf,_0x1c5945,_0x2cabce,_0x3bc3ce,_0x457af6,_0x76bd9e,_0x3ca1ea){var _0x12b6d0,_0x119642;_0x76bd9e['remoteUri']=intUtil[_0x6235('0x40')](_0x76bd9e[_0x6235('0x1a')]);_0x76bd9e['serverUrl']=intUtil[_0x6235('0x40')](_0x76bd9e['serverUrl']);if(_0x3ca1ea&&_0x3ca1ea['recordingFormat']&&_0x3ca1ea[_0x6235('0x58')]!=='none'){logger[_0x6235('0x9')](_0x6235('0x59'),_0x6235('0x43'));_0x1c5945[_0x6235('0x45')]=util[_0x6235('0xb')](_0x6235('0x44'),_0x76bd9e[_0x6235('0x41')],_0x1c5945[_0x6235('0x5a')],md5(_0x1c5945[_0x6235('0x5a')]));}headers[_0x6235('0x46')]=getAuth(_0x76bd9e);return getUser(_0x76bd9e,_0x3bc3ce[_0x6235('0x47')])[_0x6235('0x14')](function(_0x305917){_0x12b6d0=_0x305917;logger[_0x6235('0x9')](_0x6235('0x48'),_0x12b6d0['id']);return getEndUser(_0x76bd9e,_0x1c5945[_0x6235('0x5b')],_0x1c5945['destcalleridnum']);})[_0x6235('0x14')](function(_0x35ce3f){_0x119642=_0x35ce3f;logger['info'](_0x6235('0x4a'),_0x119642['id']);return getTicket(_0x76bd9e,_0x12b6d0,_0x119642,_0x2cabce,_0x1c5945);})[_0x6235('0x14')](function(_0x48edad){if(_0x48edad){logger[_0x6235('0x9')](_0x6235('0x5c'),_0x48edad['id']);switch(_0x76bd9e['type']){case _0x6235('0x4b'):logger[_0x6235('0x9')](_0x6235('0x59'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0x6235('0xb')](_0x6235('0x4e'),_0x76bd9e['remoteUri'],_0x12b6d0['id'],_0x48edad['id']),'method':'POST'});case _0x6235('0x4f'):logger[_0x6235('0x9')](_0x6235('0x59'),_0x6235('0x50'));emit(util[_0x6235('0xb')](_0x6235('0x51'),_0x3bc3ce[_0x6235('0x10')]),_0x6235('0x52'),{'uri':util[_0x6235('0xb')](_0x6235('0x53'),_0x76bd9e[_0x6235('0x1a')],_0x48edad['id'])});break;default:logger[_0x6235('0x55')](_0x6235('0x59'),_0x6235('0x54'));}}})[_0x6235('0x5d')](function(_0x1f47b6){logger[_0x6235('0x55')](_0x6235('0x5e'),util[_0x6235('0x5f')](_0x1f47b6,{'showHidden':!![],'depth':null}));});};exports[_0x6235('0x60')]=function(_0x5b6dd3,_0x4ac76b,_0x3f4604,_0xdd43df,_0x3c0b20,_0x3897cc){var _0x17e33d,_0x520102;_0x3897cc[_0x6235('0x1a')]=intUtil['stripTrailingSlash'](_0x3897cc[_0x6235('0x1a')]);_0x3897cc['serverUrl']=intUtil['stripTrailingSlash'](_0x3897cc[_0x6235('0x41')]);if(_0x3c0b20&&_0x3c0b20[_0x6235('0x42')]){logger[_0x6235('0x9')](_0x6235('0x61'),_0x6235('0x43'));_0x4ac76b[_0x6235('0x45')]=util[_0x6235('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3897cc[_0x6235('0x41')],_0x4ac76b[_0x6235('0x5a')],md5(_0x4ac76b['uniqueid']));}else{_0x4ac76b[_0x6235('0x45')]='';}headers[_0x6235('0x46')]=getAuth(_0x3897cc);return getUser(_0x3897cc)['then'](function(_0x8e87b0){_0x17e33d=_0x8e87b0;logger[_0x6235('0x9')](_0x6235('0x48'),_0x17e33d['id']);return getEndUser(_0x3897cc,_0x4ac76b[_0x6235('0x62')],_0x4ac76b[_0x6235('0x49')]);})['then'](function(_0x46ceee){_0x520102=_0x46ceee;logger[_0x6235('0x9')](_0x6235('0x4a'),_0x520102['id']);return getTicket(_0x3897cc,_0x17e33d,_0x520102,_0x3f4604,_0x4ac76b);})[_0x6235('0x14')](function(_0x15048d){if(_0x15048d){logger[_0x6235('0x9')]('The\x20Ticket\x20ID\x20is:',_0x15048d['id']);}})['catch'](function(_0x404114){logger[_0x6235('0x55')](_0x6235('0x63'),util['inspect'](_0x404114,{'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 a068793..ba0dcca 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 _0x556a=['err','log','queue','host','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','recordingURL','zoho.eu','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','recordingFormat','[OUTBOUND]','com','destcalleridname','destcalleridnum','Outbound','https://crm.','abandoned','monitor_format','Inbound','[ABANDONED]','lodash','request-promise','md5','util','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','socket.io-emitter','emit','debug','[HTTP]','stringify','length','forEach','type','idField','toString','variable','variableName','Variable','name','toLowerCase','split','isNil','isBefore','expires_in','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','then','add','access_token','catch','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','Administrator','profile','user','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','error','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','data','Contacts','End\x20user\x20found\x20(Contact)','Leads','End\x20user\x20found\x20(Lead)','/crm/v2/','moduleCreate','role','last_name','code','details','enduserType','Owner','first_name','Subject','getString','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','What_Id','talktime','Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','called','Called','complete','connect','Call_Result','rejected','Rejected','Call_Start_Time','agentcalledAt','Call_Type','merge','Fields','/crm/v2/Calls'];(function(_0x538e88,_0x2d9ce6){var _0x56be92=function(_0x337fc1){while(--_0x337fc1){_0x538e88['push'](_0x538e88['shift']());}};_0x56be92(++_0x2d9ce6);}(_0x556a,0x1dd));var _0xa556=function(_0x51fc84,_0x4bdddd){_0x51fc84=_0x51fc84-0x0;var _0x1f76fe=_0x556a[_0x51fc84];return _0x1f76fe;};'use strict';var _=require(_0xa556('0x0'));var rp=require(_0xa556('0x1'));var md5=require(_0xa556('0x2'));var util=require(_0xa556('0x3'));var intUtil=require(_0xa556('0x4'));var moment=require(_0xa556('0x5'));var Redis=require(_0xa556('0x6'));var config=require(_0xa556('0x7'));var logger=require(_0xa556('0x8'))('zoho');config[_0xa556('0x9')]=_[_0xa556('0xa')](config[_0xa556('0x9')],{'host':_0xa556('0xb'),'port':0x18eb});var io=require(_0xa556('0xc'))(new Redis(config['redis']));function emit(_0x2c9a0c,_0x644538,_0x17c2c2){io['to'](_0x2c9a0c)[_0xa556('0xd')](_0x644538,_0x17c2c2);}function request(_0x5d586d){logger[_0xa556('0xe')](_0xa556('0xf'),JSON[_0xa556('0x10')](_0x5d586d));return rp(_0x5d586d);}function getCustomFields(_0x309515,_0x3beb12){var _0x3a4428={};if(_0x309515[_0xa556('0x11')]>0x0){_[_0xa556('0x12')](_0x309515,function(_0x5771ec){if(_0x5771ec[_0xa556('0x13')]==='string'&&_0x5771ec[_0xa556('0x14')]){_0x3a4428[_0x5771ec['idField']]=_0x5771ec['content'][_0xa556('0x15')]();}else if(_0x5771ec[_0xa556('0x13')]===_0xa556('0x16')&&_0x5771ec[_0xa556('0x17')]&&_0x5771ec['idField']&&_0x3beb12[_0x5771ec[_0xa556('0x17')]]){_0x3a4428[_0x5771ec[_0xa556('0x14')]]=_0x3beb12[_0x5771ec[_0xa556('0x17')]][_0xa556('0x15')]();}else if(_0x5771ec[_0xa556('0x13')]==='customVariable'&&_0x5771ec['Variable']&&_0x5771ec[_0xa556('0x18')][_0xa556('0x19')]&&_0x5771ec['idField']&&_0x3beb12[_0x5771ec[_0xa556('0x18')]['name']['toLowerCase']()]){_0x3a4428[_0x5771ec[_0xa556('0x14')]]=_0x3beb12[_0x5771ec[_0xa556('0x18')][_0xa556('0x19')][_0xa556('0x1a')]()][_0xa556('0x15')]();}});}return _0x3a4428;}function getName(_0x341e52){if(_0x341e52['indexOf']('\x20')>0x0){var _0x452e6f=_0x341e52[_0xa556('0x1b')](/ (.+)/);if(_0x452e6f[0x1]){return _0x452e6f;}}return[_0x341e52,_0x341e52];}var accountsTokens={};function getAccessToken(_0x1f3e9c){return new Promise(function(_0x4f0491,_0x1a64ef){if(!_[_0xa556('0x1c')](accountsTokens[_0x1f3e9c['id']])&&!_['isNil'](accountsTokens[_0x1f3e9c['id']]['access_token'])){if(moment()[_0xa556('0x1d')](accountsTokens[_0x1f3e9c['id']][_0xa556('0x1e')])){_0x4f0491(accountsTokens[_0x1f3e9c['id']]['access_token']);}}var _0x22e9d0;switch(_0x1f3e9c['zone']){case'US':_0x22e9d0=_0xa556('0x1f');break;case'AU':_0x22e9d0=_0xa556('0x20');break;case'EU':_0x22e9d0=_0xa556('0x21');break;case'IN':_0x22e9d0=_0xa556('0x22');break;case'CN':_0x22e9d0=_0xa556('0x23');break;default:_0x22e9d0=_0xa556('0x21');break;}var _0x1bcecb={'method':_0xa556('0x24'),'uri':_0x22e9d0+_0xa556('0x25'),'qs':{'refresh_token':_0x1f3e9c[_0xa556('0x26')],'client_id':_0x1f3e9c[_0xa556('0x27')],'client_secret':_0x1f3e9c[_0xa556('0x28')],'grant_type':'refresh_token'},'json':!![]};return rp(_0x1bcecb)[_0xa556('0x29')](function(_0x1193a3){accountsTokens[_0x1f3e9c['id']]={'access_token':_0x1193a3['access_token'],'expires_in':moment()[_0xa556('0x2a')](_0x1193a3[_0xa556('0x1e')],'seconds')};_0x4f0491(_0x1193a3[_0xa556('0x2b')]);})[_0xa556('0x2c')](function(_0x157ac5){logger['error'](_0xa556('0x2d'),_0x157ac5[_0xa556('0x2e')]);_0x1a64ef(_0x157ac5);});});}function getUser(_0x19f1b8,_0x57da1a,_0x25dab6,_0x1f5ce4){logger[_0xa556('0x2f')](_0xa556('0x30'));return request({'method':_0xa556('0x31'),'uri':util[_0xa556('0x32')](_0xa556('0x33'),_0x57da1a),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xa556('0x34')+_0x19f1b8},'json':!![]})['then'](function(_0x34f2cf){if(_0x34f2cf[_0xa556('0x35')]){var _0xadb2ec=-0x1;if(_[_0xa556('0x36')](_0x34f2cf[_0xa556('0x35')])){if(!_[_0xa556('0x1c')](_0x1f5ce4)){_0xadb2ec=_[_0xa556('0x37')](_0x34f2cf['users'],function(_0x34689e){return _0x34689e[_0xa556('0x38')]===_0x1f5ce4;});}if(_0xadb2ec>=0x0){logger[_0xa556('0x2f')](_0xa556('0x39'));}else{logger[_0xa556('0x2f')](_0xa556('0x3a'));_0xadb2ec=_[_0xa556('0x37')](_0x34f2cf[_0xa556('0x35')],function(_0x164030){return _0x164030['profile'][_0xa556('0x19')]===_0xa556('0x3b');});}return _0x34f2cf[_0xa556('0x35')][_0xadb2ec];}else{if(_0x34f2cf['user'][_0xa556('0x3c')][_0xa556('0x19')]===_0xa556('0x3b')){logger[_0xa556('0x2f')]('Using\x20the\x20admin\x20account!');user=_0x34f2cf[_0xa556('0x3d')];return user;}else{logger['error'](_0xa556('0x3e'),JSON['stringify'](_0x34f2cf));throw new Error(_0xa556('0x3f')+JSON[_0xa556('0x10')](_0x34f2cf));}}}else{logger[_0xa556('0x40')](_0xa556('0x3e'),JSON[_0xa556('0x10')](_0x34f2cf));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x34f2cf));}})[_0xa556('0x2c')](function(_0x2efa25){console[_0xa556('0x40')](_0x2efa25);});}function getEndUser(_0x2e91d5,_0x3c557d,_0xba1263,_0x81a48d,_0x4654cf,_0x443ade,_0xb97e0c){logger[_0xa556('0x2f')](_0xa556('0x41'));return request({'method':_0xa556('0x31'),'uri':_0xa556('0x42')+_0x3c557d+_0xa556('0x43')+_0x4654cf+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x2e91d5},'json':!![]})[_0xa556('0x29')](function(_0x470498){if(_0x470498){var _0x3325ae=_0x470498[_0xa556('0x44')][0x0];_0x3325ae['enduserType']=_0xa556('0x45');logger[_0xa556('0x2f')](_0xa556('0x46'));return _0x3325ae;}else{return request({'method':_0xa556('0x31'),'uri':_0xa556('0x42')+_0x3c557d+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4654cf+'))','headers':{'Authorization':_0xa556('0x34')+_0x2e91d5},'json':!![]})[_0xa556('0x29')](function(_0x4f6fce){if(_0x4f6fce){var _0x4ef87b=_0x4f6fce[_0xa556('0x44')][0x0];_0x4ef87b['enduserType']=_0xa556('0x47');logger['info'](_0xa556('0x48'));return _0x4ef87b;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x81a48d=getName(_0x81a48d);return request({'method':'POST','uri':'https://www.zohoapis.'+_0x3c557d+_0xa556('0x49')+_0xb97e0c[_0xa556('0x4a')],'body':{'data':[{'Last_Name':_0x81a48d[0x1],'First_Name':_0x81a48d[0x0],'Phone':_0x4654cf,'Owner':{'name':!_['isNil'](_0x443ade[_0xa556('0x4b')][_0xa556('0x19')])?_0x443ade['role']['name']:!_[_0xa556('0x1c')](_0x443ade['first_name'])?_0x443ade['first_name']+'\x20'+_0x443ade['last_name']:_0x443ade[_0xa556('0x4c')],'id':_0x443ade['id']}}]},'headers':{'Authorization':_0xa556('0x34')+_0x2e91d5},'json':!![]})['then'](function(_0x3c87d3){if(_0x3c87d3&&_0x3c87d3[_0xa556('0x44')][0x0][_0xa556('0x4d')]==='SUCCESS'){var _0x4e001b=_0x3c87d3[_0xa556('0x44')][0x0][_0xa556('0x4e')];_0x4e001b[_0xa556('0x4f')]=_0xb97e0c[_0xa556('0x4a')];return _0x4e001b;}logger[_0xa556('0x40')](_0xa556('0x3e'),JSON['stringify'](_0x3c87d3));throw new Error('Error\x20on\x20Lead\x20retrieve:\x20'+JSON['stringify'](_0x3c87d3));});}});}});}function getCall(_0x3feb22,_0x6114b0,_0x529f2b,_0x21bb80,_0x558ad8,_0x1a3d67,_0x6b51fe,_0x213c4d){logger[_0xa556('0x2f')]('Creating\x20new\x20call...');var _0xb5f34d={};_0xb5f34d[_0xa556('0x50')]={'name':!_[_0xa556('0x1c')](_0x21bb80[_0xa556('0x4b')][_0xa556('0x19')])&&!_[_0xa556('0x1c')](_0x21bb80[_0xa556('0x3c')]['name'])&&_0x21bb80[_0xa556('0x3c')][_0xa556('0x19')]==='administrator'?_0x21bb80[_0xa556('0x4b')][_0xa556('0x19')]:!_[_0xa556('0x1c')](_0x21bb80['first_name'])?_0x21bb80[_0xa556('0x51')]+'\x20'+_0x21bb80[_0xa556('0x4c')]:_0x21bb80[_0xa556('0x4c')],'id':_0x21bb80['id']};_0xb5f34d[_0xa556('0x52')]=intUtil[_0xa556('0x53')](_0x1a3d67[_0xa556('0x54')],_0x6b51fe,'\x20');_0xb5f34d[_0xa556('0x55')]=intUtil[_0xa556('0x53')](_0x1a3d67[_0xa556('0x56')],_0x6b51fe,'\x0a');if(_0x558ad8[_0xa556('0x4f')]==='Contacts'){_0xb5f34d[_0xa556('0x57')]={'name':!_[_0xa556('0x1c')](_0x558ad8[_0xa556('0x58')])?_0x558ad8[_0xa556('0x58')]:!_['isNil'](_0x558ad8[_0xa556('0x59')])?_0x558ad8['First_Name']+'\x20'+_0x558ad8[_0xa556('0x5a')]:_0x558ad8[_0xa556('0x5a')],'id':_0x558ad8['id']};}if(_0x558ad8[_0xa556('0x4f')]==='Leads'){_0xb5f34d[_0xa556('0x5b')]={'name':!_[_0xa556('0x1c')](_0x558ad8[_0xa556('0x58')])?_0x558ad8[_0xa556('0x58')]:!_['isNil'](_0x558ad8[_0xa556('0x59')])?_0x558ad8['First_Name']+'\x20'+_0x558ad8[_0xa556('0x5a')]:_0x558ad8['Last_Name'],'id':_0x558ad8['id']};_0xb5f34d['$se_module']=_0x558ad8[_0xa556('0x4f')];}if(_0x6b51fe[_0xa556('0x5c')]){_0xb5f34d[_0xa556('0x5d')]=moment[_0xa556('0x5e')](parseInt(_0x6b51fe['talktime'])*0x3e8)[_0xa556('0x32')](_0xa556('0x5f'));}else if(_0x6b51fe[_0xa556('0x60')]&&_0x6b51fe[_0xa556('0x61')]){_0xb5f34d[_0xa556('0x5d')]=moment['utc'](moment(_0x6b51fe[_0xa556('0x61')],_0xa556('0x62'))[_0xa556('0x63')](moment(_0x6b51fe[_0xa556('0x64')],_0xa556('0x62'))))[_0xa556('0x32')](_0xa556('0x5f'));}switch(_0x6b51fe[_0xa556('0x65')]){case _0xa556('0x66'):_0xb5f34d['Call_Result']=_0xa556('0x67');break;case _0xa556('0x68'):case _0xa556('0x69'):_0xb5f34d[_0xa556('0x6a')]='Answered';break;case _0xa556('0x6b'):_0xb5f34d[_0xa556('0x6a')]=_0xa556('0x6c');break;case'abandoned':_0xb5f34d[_0xa556('0x6a')]='Abandoned';break;default:}_0xb5f34d[_0xa556('0x6d')]=(_0x213c4d==='outbound'?moment(_0x6b51fe[_0xa556('0x64')])[_0xa556('0x32')](_0xa556('0x62')):moment(_0x6b51fe[_0xa556('0x6e')])[_0xa556('0x32')](_0xa556('0x62')))||moment()[_0xa556('0x32')](_0xa556('0x62'));_0xb5f34d[_0xa556('0x6f')]=_0x213c4d||'Inbound';_0xb5f34d=_[_0xa556('0x70')](_0xb5f34d,getCustomFields(_0x1a3d67[_0xa556('0x71')],_0x6b51fe));return request({'method':'POST','uri':_0xa556('0x42')+_0x6114b0+_0xa556('0x72'),'headers':{'Authorization':_0xa556('0x34')+_0x3feb22},'body':{'data':[_0xb5f34d]},'json':!![]})[_0xa556('0x29')](function(_0x5ad917){if(_0x5ad917&&_0x5ad917[_0xa556('0x44')][0x0][_0xa556('0x4d')]==='SUCCESS'){logger['info']('Call\x20created!');return{'id':_0x5ad917['data'][0x0][_0xa556('0x4e')]['id']};}})[_0xa556('0x2c')](function(_0x569239){logger[_0xa556('0x2f')](_0xa556('0x73'),_0x569239[_0xa556('0x2e')]);console[_0xa556('0x74')](_0xa556('0x73'),_0x569239);});}exports[_0xa556('0x75')]=function(_0x11aafd,_0x1f099d,_0x39d774,_0x345403,_0x124c6c,_0x435d48){var _0x51824a,_0x23e16a,_0x375526;_0x435d48[_0xa556('0x76')]=intUtil['stripTrailingSlash'](_0x435d48[_0xa556('0x76')]);_0x435d48[_0xa556('0x77')]=intUtil[_0xa556('0x78')](_0x435d48[_0xa556('0x77')]);if(_0x124c6c&&_0x124c6c['monitor_format']){logger[_0xa556('0x2f')](_0xa556('0x79'),_0xa556('0x7a'));_0x1f099d['recordingURL']=_0x435d48[_0xa556('0x77')]+_0xa556('0x7b')+_0x1f099d[_0xa556('0x7c')]+_0xa556('0x7d')+md5(_0x1f099d[_0xa556('0x7c')]);}else{_0x1f099d[_0xa556('0x7e')]='';}var _0x44b387=_0x435d48['host']===_0xa556('0x7f')?'eu':'com';return getAccessToken(_0x435d48)['then'](function(_0x570c9b){_0x375526=_0x570c9b;return getUser(_0x375526,_0x44b387,_0x435d48,_0x345403[_0xa556('0x38')]);})[_0xa556('0x29')](function(_0xdc8038){_0x51824a=_0xdc8038;logger['info'](_0xa556('0x80'),_0x51824a['id']);return getEndUser(_0x375526,_0x44b387,_0x435d48,_0x1f099d[_0xa556('0x81')],_0x1f099d[_0xa556('0x82')],_0x51824a,_0x39d774);})[_0xa556('0x29')](function(_0x1c7157){_0x23e16a=_0x1c7157;logger[_0xa556('0x2f')](_0xa556('0x83'),_0x23e16a['id']);return getCall(_0x375526,_0x44b387,_0x435d48,_0x51824a,_0x23e16a,_0x39d774,_0x1f099d,'Inbound');})[_0xa556('0x29')](function(_0x7b0455){if(_0x7b0455){logger[_0xa556('0x2f')](_0xa556('0x84'),_0x7b0455['id']);logger[_0xa556('0x2f')]('[QUEUE]',_0xa556('0x85'));emit(util[_0xa556('0x32')](_0xa556('0x86'),_0x345403[_0xa556('0x19')]),_0xa556('0x87'),{'uri':'https://crm.'+_0x435d48['host']+'/crm/EntityInfo.do?module=Calls&id='+_0x7b0455['id']});}})['catch'](function(_0x4de961){logger[_0xa556('0x40')](_0xa556('0x79'),JSON[_0xa556('0x10')](_0x4de961));});};exports[_0xa556('0x88')]=function(_0x5b6646,_0x11de5d,_0x58e88c,_0x8881a0,_0x2e76dc,_0xe245aa,_0x5670fd){var _0x4de026,_0x18b4d2,_0x1e71fe;_0xe245aa[_0xa556('0x76')]=intUtil['stripTrailingSlash'](_0xe245aa[_0xa556('0x76')]);_0xe245aa['serverUrl']=intUtil['stripTrailingSlash'](_0xe245aa[_0xa556('0x77')]);if(_0x5670fd&&_0x5670fd[_0xa556('0x89')]&&_0x5670fd[_0xa556('0x89')]!=='none'){logger[_0xa556('0x2f')](_0xa556('0x8a'),_0xa556('0x7a'));_0x11de5d[_0xa556('0x7e')]=_0xe245aa['serverUrl']+_0xa556('0x7b')+_0x11de5d['uniqueid']+_0xa556('0x7d')+md5(_0x11de5d['uniqueid']);}var _0x196841=_0xe245aa[_0xa556('0x76')]==='zoho.eu'?'eu':_0xa556('0x8b');return getAccessToken(_0xe245aa)[_0xa556('0x29')](function(_0x248dfa){_0x1e71fe=_0x248dfa;return getUser(_0x1e71fe,_0x196841,_0xe245aa,_0x8881a0['email']);})[_0xa556('0x29')](function(_0x1a1a66){_0x4de026=_0x1a1a66;logger['info'](_0xa556('0x80'),_0x4de026['id']);return getEndUser(_0x1e71fe,_0x196841,_0xe245aa,_0x11de5d[_0xa556('0x8c')],_0x11de5d[_0xa556('0x8d')],_0x4de026,_0x58e88c);})[_0xa556('0x29')](function(_0x1d3811){_0x18b4d2=_0x1d3811;logger[_0xa556('0x2f')](_0xa556('0x83'),_0x18b4d2['id']);return getCall(_0x1e71fe,_0x196841,_0xe245aa,_0x4de026,_0x18b4d2,_0x58e88c,_0x11de5d,_0xa556('0x8e'));})[_0xa556('0x29')](function(_0x3692e7){if(_0x3692e7){logger[_0xa556('0x2f')](_0xa556('0x84'),_0x3692e7['id']);logger[_0xa556('0x2f')](_0xa556('0x8a'),_0xa556('0x85'));emit(util['format'](_0xa556('0x86'),_0x8881a0['name']),_0xa556('0x87'),{'uri':_0xa556('0x8f')+_0xe245aa[_0xa556('0x76')]+'/crm/EntityInfo.do?module=Calls&id='+_0x3692e7['id']});}})[_0xa556('0x2c')](function(_0x4416cf){logger[_0xa556('0x40')](_0xa556('0x8a'),JSON[_0xa556('0x10')](_0x4416cf));});};exports[_0xa556('0x90')]=function(_0xf3ab62,_0x1b4d3b,_0x40d697,_0x340a32,_0x2b2cad,_0x1e65bd){var _0x156db0,_0x2a95c9,_0x48145d;_0x1e65bd[_0xa556('0x76')]=intUtil['stripTrailingSlash'](_0x1e65bd['host']);_0x1e65bd[_0xa556('0x77')]=intUtil['stripTrailingSlash'](_0x1e65bd['serverUrl']);if(_0x2b2cad&&_0x2b2cad[_0xa556('0x91')]){logger[_0xa556('0x2f')]('[ABANDONED]','Recording\x20is\x20enabled!');_0x1b4d3b[_0xa556('0x7e')]=_0x1e65bd[_0xa556('0x77')]+_0xa556('0x7b')+_0x1b4d3b[_0xa556('0x7c')]+_0xa556('0x7d')+md5(_0x1b4d3b['uniqueid']);}else{_0x1b4d3b[_0xa556('0x7e')]='';}var _0x4b2851=_0x1e65bd[_0xa556('0x76')]===_0xa556('0x7f')?'eu':_0xa556('0x8b');return getAccessToken(_0x1e65bd)[_0xa556('0x29')](function(_0x1ff948){_0x48145d=_0x1ff948;return getUser(_0x48145d,_0x4b2851,_0x1e65bd);})[_0xa556('0x29')](function(_0x3108d9){_0x156db0=_0x3108d9;logger[_0xa556('0x2f')](_0xa556('0x80'),_0x156db0['id']);return getEndUser(_0x48145d,_0x4b2851,_0x1e65bd,_0x1b4d3b['calleridname'],_0x1b4d3b['calleridnum'],_0x156db0,_0x40d697);})[_0xa556('0x29')](function(_0x4ae131){_0x2a95c9=_0x4ae131;logger[_0xa556('0x2f')]('The\x20Enduser\x20ID\x20is:',_0x2a95c9['id']);return getCall(_0x48145d,_0x4b2851,_0x1e65bd,_0x156db0,_0x2a95c9,_0x40d697,_0x1b4d3b,_0xa556('0x92'));})[_0xa556('0x29')](function(_0x52bd66){if(_0x52bd66){logger['info']('The\x20Call\x20ID\x20is:',_0x52bd66['id']);}})[_0xa556('0x2c')](function(_0x27601b){logger[_0xa556('0x40')](_0xa556('0x93'),JSON[_0xa556('0x10')](_0x27601b));});}; \ No newline at end of file +var _0x160f=['Full_Name','First_Name','Last_Name','What_Id','$se_module','talktime','utc','format','mm:ss','answertime','endtime','Call_Duration','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','Called','complete','Answered','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','Call_Type','merge','/crm/v2/Calls','Call\x20created!','err','stack','log','host','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Call\x20ID\x20is:','[QUEUE]','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','/api/voice/recordings/','zoho.eu','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','[ABANDONED]','lodash','request-promise','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','redis','localhost','debug','[HTTP]','stringify','length','forEach','type','string','idField','content','variableName','toString','customVariable','Variable','name','toLowerCase','indexOf','split','isNil','access_token','expires_in','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','POST','refreshToken','clientId','then','seconds','catch','error','info','Search\x20user','https://www.zohoapis.%s/crm/v2/users','isArrayLikeObject','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','users','user','Administrator','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','Search\x20end\x20user','GET','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Zoho-oauthtoken\x20','data','enduserType','Contacts','End\x20user\x20found\x20(Contact)','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','moduleCreate','role','first_name','last_name','code','SUCCESS','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','administrator','Subject','getString','Description','Descriptions'];(function(_0x20aadb,_0x5a607a){var _0x520018=function(_0x1d258a){while(--_0x1d258a){_0x20aadb['push'](_0x20aadb['shift']());}};_0x520018(++_0x5a607a);}(_0x160f,0x1ef));var _0xf160=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x160f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf160('0x0'));var rp=require(_0xf160('0x1'));var md5=require(_0xf160('0x2'));var util=require(_0xf160('0x3'));var intUtil=require('./util');var moment=require(_0xf160('0x4'));var Redis=require(_0xf160('0x5'));var config=require(_0xf160('0x6'));var logger=require(_0xf160('0x7'))(_0xf160('0x8'));config[_0xf160('0x9')]=_['defaults'](config[_0xf160('0x9')],{'host':_0xf160('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x41e909,_0x5b76c8,_0x4bf890){io['to'](_0x41e909)['emit'](_0x5b76c8,_0x4bf890);}function request(_0x383de0){logger[_0xf160('0xb')](_0xf160('0xc'),JSON[_0xf160('0xd')](_0x383de0));return rp(_0x383de0);}function getCustomFields(_0x5e09c6,_0x4a0639){var _0xf8ec3d={};if(_0x5e09c6[_0xf160('0xe')]>0x0){_[_0xf160('0xf')](_0x5e09c6,function(_0x56072f){if(_0x56072f[_0xf160('0x10')]===_0xf160('0x11')&&_0x56072f[_0xf160('0x12')]){_0xf8ec3d[_0x56072f[_0xf160('0x12')]]=_0x56072f[_0xf160('0x13')]['toString']();}else if(_0x56072f[_0xf160('0x10')]==='variable'&&_0x56072f[_0xf160('0x14')]&&_0x56072f[_0xf160('0x12')]&&_0x4a0639[_0x56072f[_0xf160('0x14')]]){_0xf8ec3d[_0x56072f[_0xf160('0x12')]]=_0x4a0639[_0x56072f[_0xf160('0x14')]][_0xf160('0x15')]();}else if(_0x56072f[_0xf160('0x10')]===_0xf160('0x16')&&_0x56072f[_0xf160('0x17')]&&_0x56072f['Variable'][_0xf160('0x18')]&&_0x56072f[_0xf160('0x12')]&&_0x4a0639[_0x56072f[_0xf160('0x17')][_0xf160('0x18')]['toLowerCase']()]){_0xf8ec3d[_0x56072f[_0xf160('0x12')]]=_0x4a0639[_0x56072f['Variable'][_0xf160('0x18')][_0xf160('0x19')]()][_0xf160('0x15')]();}});}return _0xf8ec3d;}function getName(_0x1e09f3){if(_0x1e09f3[_0xf160('0x1a')]('\x20')>0x0){var _0x205afa=_0x1e09f3[_0xf160('0x1b')](/ (.+)/);if(_0x205afa[0x1]){return _0x205afa;}}return[_0x1e09f3,_0x1e09f3];}var accountsTokens={};function getAccessToken(_0x2a8cb4){return new Promise(function(_0x1fdb38,_0x4a58d9){if(!_[_0xf160('0x1c')](accountsTokens[_0x2a8cb4['id']])&&!_[_0xf160('0x1c')](accountsTokens[_0x2a8cb4['id']][_0xf160('0x1d')])){if(moment()['isBefore'](accountsTokens[_0x2a8cb4['id']][_0xf160('0x1e')])){_0x1fdb38(accountsTokens[_0x2a8cb4['id']][_0xf160('0x1d')]);}}var _0x454e63;switch(_0x2a8cb4[_0xf160('0x1f')]){case'US':_0x454e63=_0xf160('0x20');break;case'AU':_0x454e63=_0xf160('0x21');break;case'EU':_0x454e63=_0xf160('0x22');break;case'IN':_0x454e63='https://accounts.zoho.in';break;case'CN':_0x454e63=_0xf160('0x23');break;default:_0x454e63=_0xf160('0x22');break;}var _0x305f6a={'method':_0xf160('0x24'),'uri':_0x454e63+'/oauth/v2/token','qs':{'refresh_token':_0x2a8cb4[_0xf160('0x25')],'client_id':_0x2a8cb4[_0xf160('0x26')],'client_secret':_0x2a8cb4['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0x305f6a)[_0xf160('0x27')](function(_0x1cc04c){accountsTokens[_0x2a8cb4['id']]={'access_token':_0x1cc04c[_0xf160('0x1d')],'expires_in':moment()['add'](_0x1cc04c[_0xf160('0x1e')],_0xf160('0x28'))};_0x1fdb38(_0x1cc04c[_0xf160('0x1d')]);})[_0xf160('0x29')](function(_0x135e0f){logger[_0xf160('0x2a')]('Failing\x20creating\x20the\x20access_token',_0x135e0f['stack']);_0x4a58d9(_0x135e0f);});});}function getUser(_0x48145e,_0x26e7b9,_0x16a5fa,_0xcaab39){logger[_0xf160('0x2b')](_0xf160('0x2c'));return request({'method':'GET','uri':util['format'](_0xf160('0x2d'),_0x26e7b9),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x48145e},'json':!![]})[_0xf160('0x27')](function(_0x3a35b3){if(_0x3a35b3['users']){var _0x29be4a=-0x1;if(_[_0xf160('0x2e')](_0x3a35b3['users'])){if(!_['isNil'](_0xcaab39)){_0x29be4a=_['findIndex'](_0x3a35b3['users'],function(_0x3e7720){return _0x3e7720[_0xf160('0x2f')]===_0xcaab39;});}if(_0x29be4a>=0x0){logger[_0xf160('0x2b')](_0xf160('0x30'));}else{logger[_0xf160('0x2b')](_0xf160('0x31'));_0x29be4a=_['findIndex'](_0x3a35b3['users'],function(_0x52178d){return _0x52178d[_0xf160('0x32')]['name']==='Administrator';});}return _0x3a35b3[_0xf160('0x33')][_0x29be4a];}else{if(_0x3a35b3[_0xf160('0x34')]['profile'][_0xf160('0x18')]===_0xf160('0x35')){logger[_0xf160('0x2b')](_0xf160('0x31'));user=_0x3a35b3[_0xf160('0x34')];return user;}else{logger['error'](_0xf160('0x36'),JSON[_0xf160('0xd')](_0x3a35b3));throw new Error(_0xf160('0x37')+JSON['stringify'](_0x3a35b3));}}}else{logger[_0xf160('0x2a')](_0xf160('0x36'),JSON[_0xf160('0xd')](_0x3a35b3));throw new Error(_0xf160('0x37')+JSON[_0xf160('0xd')](_0x3a35b3));}})[_0xf160('0x29')](function(_0x53795c){console['error'](_0x53795c);});}function getEndUser(_0x36d21b,_0x21c248,_0x18f010,_0x1ca3bd,_0x75fb8c,_0x24d668,_0xf373d6){logger[_0xf160('0x2b')](_0xf160('0x38'));return request({'method':_0xf160('0x39'),'uri':_0xf160('0x3a')+_0x21c248+_0xf160('0x3b')+_0x75fb8c+'))','headers':{'Authorization':_0xf160('0x3c')+_0x36d21b},'json':!![]})[_0xf160('0x27')](function(_0x2e7a32){if(_0x2e7a32){var _0x256ce7=_0x2e7a32[_0xf160('0x3d')][0x0];_0x256ce7[_0xf160('0x3e')]=_0xf160('0x3f');logger[_0xf160('0x2b')](_0xf160('0x40'));return _0x256ce7;}else{return request({'method':_0xf160('0x39'),'uri':_0xf160('0x3a')+_0x21c248+_0xf160('0x41')+_0x75fb8c+'))','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x36d21b},'json':!![]})[_0xf160('0x27')](function(_0x476c31){if(_0x476c31){var _0x2cfec0=_0x476c31[_0xf160('0x3d')][0x0];_0x2cfec0[_0xf160('0x3e')]=_0xf160('0x42');logger[_0xf160('0x2b')]('End\x20user\x20found\x20(Lead)');return _0x2cfec0;}else{logger[_0xf160('0x2b')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x1ca3bd=getName(_0x1ca3bd);return request({'method':_0xf160('0x24'),'uri':_0xf160('0x3a')+_0x21c248+'/crm/v2/'+_0xf373d6[_0xf160('0x43')],'body':{'data':[{'Last_Name':_0x1ca3bd[0x1],'First_Name':_0x1ca3bd[0x0],'Phone':_0x75fb8c,'Owner':{'name':!_[_0xf160('0x1c')](_0x24d668[_0xf160('0x44')][_0xf160('0x18')])?_0x24d668[_0xf160('0x44')][_0xf160('0x18')]:!_[_0xf160('0x1c')](_0x24d668['first_name'])?_0x24d668[_0xf160('0x45')]+'\x20'+_0x24d668[_0xf160('0x46')]:_0x24d668[_0xf160('0x46')],'id':_0x24d668['id']}}]},'headers':{'Authorization':_0xf160('0x3c')+_0x36d21b},'json':!![]})[_0xf160('0x27')](function(_0x2caefa){if(_0x2caefa&&_0x2caefa[_0xf160('0x3d')][0x0][_0xf160('0x47')]===_0xf160('0x48')){var _0x1cb75e=_0x2caefa[_0xf160('0x3d')][0x0]['details'];_0x1cb75e['enduserType']=_0xf373d6[_0xf160('0x43')];return _0x1cb75e;}logger[_0xf160('0x2a')](_0xf160('0x36'),JSON[_0xf160('0xd')](_0x2caefa));throw new Error(_0xf160('0x49')+JSON[_0xf160('0xd')](_0x2caefa));});}});}});}function getCall(_0x4a542f,_0xb3bc25,_0x5abc6a,_0x55ab52,_0x44fd52,_0xe98687,_0x51b7af,_0x5ea49d){logger[_0xf160('0x2b')](_0xf160('0x4a'));var _0x3e2cdb={};_0x3e2cdb[_0xf160('0x4b')]={'name':!_['isNil'](_0x55ab52['role']['name'])&&!_['isNil'](_0x55ab52[_0xf160('0x32')]['name'])&&_0x55ab52[_0xf160('0x32')][_0xf160('0x18')]===_0xf160('0x4c')?_0x55ab52[_0xf160('0x44')]['name']:!_[_0xf160('0x1c')](_0x55ab52[_0xf160('0x45')])?_0x55ab52[_0xf160('0x45')]+'\x20'+_0x55ab52['last_name']:_0x55ab52[_0xf160('0x46')],'id':_0x55ab52['id']};_0x3e2cdb[_0xf160('0x4d')]=intUtil[_0xf160('0x4e')](_0xe98687['Subjects'],_0x51b7af,'\x20');_0x3e2cdb[_0xf160('0x4f')]=intUtil[_0xf160('0x4e')](_0xe98687[_0xf160('0x50')],_0x51b7af,'\x0a');if(_0x44fd52[_0xf160('0x3e')]===_0xf160('0x3f')){_0x3e2cdb['Who_Id']={'name':!_['isNil'](_0x44fd52[_0xf160('0x51')])?_0x44fd52['Full_Name']:!_[_0xf160('0x1c')](_0x44fd52[_0xf160('0x52')])?_0x44fd52['First_Name']+'\x20'+_0x44fd52['Last_Name']:_0x44fd52[_0xf160('0x53')],'id':_0x44fd52['id']};}if(_0x44fd52[_0xf160('0x3e')]==='Leads'){_0x3e2cdb[_0xf160('0x54')]={'name':!_[_0xf160('0x1c')](_0x44fd52[_0xf160('0x51')])?_0x44fd52[_0xf160('0x51')]:!_['isNil'](_0x44fd52[_0xf160('0x52')])?_0x44fd52['First_Name']+'\x20'+_0x44fd52[_0xf160('0x53')]:_0x44fd52[_0xf160('0x53')],'id':_0x44fd52['id']};_0x3e2cdb[_0xf160('0x55')]=_0x44fd52[_0xf160('0x3e')];}if(_0x51b7af[_0xf160('0x56')]){_0x3e2cdb['Call_Duration']=moment[_0xf160('0x57')](parseInt(_0x51b7af['talktime'])*0x3e8)[_0xf160('0x58')](_0xf160('0x59'));}else if(_0x51b7af[_0xf160('0x5a')]&&_0x51b7af[_0xf160('0x5b')]){_0x3e2cdb[_0xf160('0x5c')]=moment[_0xf160('0x57')](moment(_0x51b7af[_0xf160('0x5b')],_0xf160('0x5d'))[_0xf160('0x5e')](moment(_0x51b7af[_0xf160('0x5f')],'YYYY-MM-DDTHH:mm:ss')))['format'](_0xf160('0x59'));}switch(_0x51b7af[_0xf160('0x60')]){case'called':_0x3e2cdb[_0xf160('0x61')]=_0xf160('0x62');break;case _0xf160('0x63'):case'connect':_0x3e2cdb['Call_Result']=_0xf160('0x64');break;case _0xf160('0x65'):_0x3e2cdb['Call_Result']=_0xf160('0x66');break;case _0xf160('0x67'):_0x3e2cdb['Call_Result']=_0xf160('0x68');break;default:}_0x3e2cdb[_0xf160('0x69')]=(_0x5ea49d===_0xf160('0x6a')?moment(_0x51b7af[_0xf160('0x5f')])[_0xf160('0x58')](_0xf160('0x5d')):moment(_0x51b7af['agentcalledAt'])[_0xf160('0x58')](_0xf160('0x5d')))||moment()[_0xf160('0x58')](_0xf160('0x5d'));_0x3e2cdb[_0xf160('0x6b')]=_0x5ea49d||'Inbound';_0x3e2cdb=_[_0xf160('0x6c')](_0x3e2cdb,getCustomFields(_0xe98687['Fields'],_0x51b7af));return request({'method':_0xf160('0x24'),'uri':_0xf160('0x3a')+_0xb3bc25+_0xf160('0x6d'),'headers':{'Authorization':_0xf160('0x3c')+_0x4a542f},'body':{'data':[_0x3e2cdb]},'json':!![]})[_0xf160('0x27')](function(_0x41553d){if(_0x41553d&&_0x41553d['data'][0x0][_0xf160('0x47')]===_0xf160('0x48')){logger[_0xf160('0x2b')](_0xf160('0x6e'));return{'id':_0x41553d[_0xf160('0x3d')][0x0]['details']['id']};}})['catch'](function(_0x3b4ec7){logger[_0xf160('0x2b')](_0xf160('0x6f'),_0x3b4ec7[_0xf160('0x70')]);console[_0xf160('0x71')](_0xf160('0x6f'),_0x3b4ec7);});}exports['queue']=function(_0x25f79e,_0x27332f,_0x351fa9,_0x352063,_0x18313b,_0x22499a){var _0x2ad82e,_0x3fe3e0,_0x53b347;_0x22499a[_0xf160('0x72')]=intUtil['stripTrailingSlash'](_0x22499a[_0xf160('0x72')]);_0x22499a[_0xf160('0x73')]=intUtil[_0xf160('0x74')](_0x22499a[_0xf160('0x73')]);if(_0x18313b&&_0x18313b[_0xf160('0x75')]){logger[_0xf160('0x2b')]('[QUEUE]',_0xf160('0x76'));_0x27332f[_0xf160('0x77')]=_0x22499a[_0xf160('0x73')]+'/api/voice/recordings/'+_0x27332f[_0xf160('0x78')]+_0xf160('0x79')+md5(_0x27332f['uniqueid']);}else{_0x27332f[_0xf160('0x77')]='';}var _0x36f876=_0x22499a[_0xf160('0x72')]==='zoho.eu'?'eu':_0xf160('0x7a');return getAccessToken(_0x22499a)[_0xf160('0x27')](function(_0x4265e1){_0x53b347=_0x4265e1;return getUser(_0x53b347,_0x36f876,_0x22499a,_0x352063['email']);})[_0xf160('0x27')](function(_0x136919){_0x2ad82e=_0x136919;logger[_0xf160('0x2b')](_0xf160('0x7b'),_0x2ad82e['id']);return getEndUser(_0x53b347,_0x36f876,_0x22499a,_0x27332f[_0xf160('0x7c')],_0x27332f[_0xf160('0x7d')],_0x2ad82e,_0x351fa9);})[_0xf160('0x27')](function(_0x58843d){_0x3fe3e0=_0x58843d;logger[_0xf160('0x2b')](_0xf160('0x7e'),_0x3fe3e0['id']);return getCall(_0x53b347,_0x36f876,_0x22499a,_0x2ad82e,_0x3fe3e0,_0x351fa9,_0x27332f,_0xf160('0x7f'));})['then'](function(_0x411ae4){if(_0x411ae4){logger[_0xf160('0x2b')](_0xf160('0x80'),_0x411ae4['id']);logger[_0xf160('0x2b')](_0xf160('0x81'),_0xf160('0x82'));emit(util[_0xf160('0x58')](_0xf160('0x83'),_0x352063['name']),_0xf160('0x84'),{'uri':_0xf160('0x85')+_0x22499a[_0xf160('0x72')]+_0xf160('0x86')+_0x411ae4['id']});}})[_0xf160('0x29')](function(_0x722f3a){logger[_0xf160('0x2a')]('[QUEUE]',JSON[_0xf160('0xd')](_0x722f3a));});};exports[_0xf160('0x6a')]=function(_0x54e3fd,_0x5a16dc,_0x42481f,_0x14d69d,_0x489a71,_0x288f04,_0x77c2ab){var _0x5ed4de,_0x377038,_0x570187;_0x288f04[_0xf160('0x72')]=intUtil[_0xf160('0x74')](_0x288f04[_0xf160('0x72')]);_0x288f04[_0xf160('0x73')]=intUtil['stripTrailingSlash'](_0x288f04[_0xf160('0x73')]);if(_0x77c2ab&&_0x77c2ab[_0xf160('0x87')]&&_0x77c2ab[_0xf160('0x87')]!==_0xf160('0x88')){logger[_0xf160('0x2b')]('[OUTBOUND]',_0xf160('0x76'));_0x5a16dc[_0xf160('0x77')]=_0x288f04[_0xf160('0x73')]+_0xf160('0x89')+_0x5a16dc[_0xf160('0x78')]+_0xf160('0x79')+md5(_0x5a16dc[_0xf160('0x78')]);}var _0x15cf3d=_0x288f04[_0xf160('0x72')]===_0xf160('0x8a')?'eu':_0xf160('0x7a');return getAccessToken(_0x288f04)['then'](function(_0x2463c8){_0x570187=_0x2463c8;return getUser(_0x570187,_0x15cf3d,_0x288f04,_0x14d69d[_0xf160('0x2f')]);})[_0xf160('0x27')](function(_0x138dd2){_0x5ed4de=_0x138dd2;logger[_0xf160('0x2b')]('The\x20User\x20ID\x20is:',_0x5ed4de['id']);return getEndUser(_0x570187,_0x15cf3d,_0x288f04,_0x5a16dc[_0xf160('0x8b')],_0x5a16dc[_0xf160('0x8c')],_0x5ed4de,_0x42481f);})[_0xf160('0x27')](function(_0x2fa858){_0x377038=_0x2fa858;logger[_0xf160('0x2b')](_0xf160('0x7e'),_0x377038['id']);return getCall(_0x570187,_0x15cf3d,_0x288f04,_0x5ed4de,_0x377038,_0x42481f,_0x5a16dc,_0xf160('0x8d'));})[_0xf160('0x27')](function(_0x1e32cc){if(_0x1e32cc){logger[_0xf160('0x2b')](_0xf160('0x80'),_0x1e32cc['id']);logger['info'](_0xf160('0x8e'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xf160('0x58')](_0xf160('0x83'),_0x14d69d[_0xf160('0x18')]),_0xf160('0x84'),{'uri':_0xf160('0x85')+_0x288f04['host']+_0xf160('0x86')+_0x1e32cc['id']});}})[_0xf160('0x29')](function(_0x2a992a){logger[_0xf160('0x2a')]('[OUTBOUND]',JSON['stringify'](_0x2a992a));});};exports[_0xf160('0x67')]=function(_0x4cd533,_0x2559c8,_0x5baa3a,_0x21b93a,_0x4fea4f,_0x4f68bd){var _0x29fc60,_0x110a31,_0x118bc3;_0x4f68bd[_0xf160('0x72')]=intUtil[_0xf160('0x74')](_0x4f68bd[_0xf160('0x72')]);_0x4f68bd[_0xf160('0x73')]=intUtil[_0xf160('0x74')](_0x4f68bd[_0xf160('0x73')]);if(_0x4fea4f&&_0x4fea4f['monitor_format']){logger['info'](_0xf160('0x8f'),_0xf160('0x76'));_0x2559c8[_0xf160('0x77')]=_0x4f68bd[_0xf160('0x73')]+_0xf160('0x89')+_0x2559c8['uniqueid']+_0xf160('0x79')+md5(_0x2559c8[_0xf160('0x78')]);}else{_0x2559c8[_0xf160('0x77')]='';}var _0x2d708d=_0x4f68bd['host']==='zoho.eu'?'eu':'com';return getAccessToken(_0x4f68bd)[_0xf160('0x27')](function(_0x4ca91a){_0x118bc3=_0x4ca91a;return getUser(_0x118bc3,_0x2d708d,_0x4f68bd);})[_0xf160('0x27')](function(_0x5a0bb3){_0x29fc60=_0x5a0bb3;logger[_0xf160('0x2b')](_0xf160('0x7b'),_0x29fc60['id']);return getEndUser(_0x118bc3,_0x2d708d,_0x4f68bd,_0x2559c8['calleridname'],_0x2559c8[_0xf160('0x7d')],_0x29fc60,_0x5baa3a);})[_0xf160('0x27')](function(_0x4435b8){_0x110a31=_0x4435b8;logger[_0xf160('0x2b')](_0xf160('0x7e'),_0x110a31['id']);return getCall(_0x118bc3,_0x2d708d,_0x4f68bd,_0x29fc60,_0x110a31,_0x5baa3a,_0x2559c8,_0xf160('0x7f'));})[_0xf160('0x27')](function(_0x50ef71){if(_0x50ef71){logger['info'](_0xf160('0x80'),_0x50ef71['id']);}})[_0xf160('0x29')](function(_0x33163d){logger['error']('[ABANDONED]',JSON[_0xf160('0xd')](_0x33163d));});}; \ 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 656f350..e409c91 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(_0x53240c,_0x2a5d4b){var _0x128178=function(_0x47dba0){while(--_0x47dba0){_0x53240c['push'](_0x53240c['shift']());}};_0x128178(++_0x2a5d4b);}(_0x7a54,0x106));var _0x47a5=function(_0x390330,_0xf8a43c){_0x390330=_0x390330-0x0;var _0x5cc4c8=_0x7a54[_0x390330];return _0x5cc4c8;};'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(_0x519428,_0x3d1ce0){var _0x1dbb5a=function(_0x3cab1e){while(--_0x3cab1e){_0x519428['push'](_0x519428['shift']());}};_0x1dbb5a(++_0x3d1ce0);}(_0x7a54,0x106));var _0x47a5=function(_0x119c1a,_0x48f57d){_0x119c1a=_0x119c1a-0x0;var _0x484825=_0x7a54[_0x119c1a];return _0x484825;};'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 918fdbf..5a931e7 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 _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x15660d,_0x22f8a6){var _0x456b1f=function(_0x33dec9){while(--_0x33dec9){_0x15660d['push'](_0x15660d['shift']());}};_0x456b1f(++_0x22f8a6);}(_0x5f2f,0x73));var _0xf5f2=function(_0x57c421,_0x8a8332){_0x57c421=_0x57c421-0x0;var _0x4ccee1=_0x5f2f[_0x57c421];return _0x4ccee1;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file +var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x24968f,_0x208973){var _0x25e757=function(_0x4cc044){while(--_0x4cc044){_0x24968f['push'](_0x24968f['shift']());}};_0x25e757(++_0x208973);}(_0x5f2f,0x73));var _0xf5f2=function(_0x15ef45,_0x389ce5){_0x15ef45=_0x15ef45-0x0;var _0xe06315=_0x5f2f[_0x15ef45];return _0xe06315;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index db6bf7a..0dd003f 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 _0xef8b=['../../config/logger','routing','client','http','Request','request','debug','rpc','error','message','result','catch','bluebird'];(function(_0x5e69c3,_0x5ddb8b){var _0x3131e3=function(_0x270077){while(--_0x270077){_0x5e69c3['push'](_0x5e69c3['shift']());}};_0x3131e3(++_0x5ddb8b);}(_0xef8b,0x192));var _0xbef8=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xef8b[_0x397e5f];return _0x5302b8;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xbef8('0x0'));var logger=require(_0xbef8('0x1'))(_0xbef8('0x2'));var client=jayson[_0xbef8('0x3')][_0xbef8('0x4')]({'port':0x2329});client[_0xbef8('0x5')]=function(_0x336519,_0x224dd2){return new BPromise(function(_0x201996,_0x110835){return client[_0xbef8('0x6')](_0x336519,_0x224dd2)['then'](function(_0x1dd4a3){logger[_0xbef8('0x7')](_0xbef8('0x8'),'routing',_0x336519,_0x224dd2,_0x1dd4a3);if(_0x1dd4a3[_0xbef8('0x9')]){logger[_0xbef8('0x9')]('rpc','routing',_0x336519,_0x1dd4a3['error'][_0xbef8('0xa')],_0x224dd2);return _0x110835(_0x1dd4a3[_0xbef8('0x9')][_0xbef8('0xa')]);}else{return _0x201996(_0x1dd4a3[_0xbef8('0xb')]);}})[_0xbef8('0xc')](function(_0xec0016){logger[_0xbef8('0x9')](_0xbef8('0x8'),_0xbef8('0x2'),_0x336519,_0xec0016,_0x224dd2);return _0x110835(_0xec0016);});});};module['exports']=client; \ No newline at end of file +var _0x383a=['../../config/logger','http','then','debug','rpc','message','error','result','catch','bluebird'];(function(_0x2aeb88,_0x1945f3){var _0x56be25=function(_0x36ba69){while(--_0x36ba69){_0x2aeb88['push'](_0x2aeb88['shift']());}};_0x56be25(++_0x1945f3);}(_0x383a,0x1ad));var _0xa383=function(_0x3d7f0e,_0x104d69){_0x3d7f0e=_0x3d7f0e-0x0;var _0x3e45dd=_0x383a[_0x3d7f0e];return _0x3e45dd;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xa383('0x0'));var logger=require(_0xa383('0x1'))('routing');var client=jayson['client'][_0xa383('0x2')]({'port':0x2329});client['Request']=function(_0x15f485,_0x2d5b89){return new BPromise(function(_0x86d0d9,_0x576c27){return client['request'](_0x15f485,_0x2d5b89)[_0xa383('0x3')](function(_0x160e4f){logger[_0xa383('0x4')]('rpc','routing',_0x15f485,_0x2d5b89,_0x160e4f);if(_0x160e4f['error']){logger['error'](_0xa383('0x5'),'routing',_0x15f485,_0x160e4f['error'][_0xa383('0x6')],_0x2d5b89);return _0x576c27(_0x160e4f[_0xa383('0x7')]['message']);}else{return _0x86d0d9(_0x160e4f[_0xa383('0x8')]);}})[_0xa383('0x9')](function(_0x4628c1){logger['error'](_0xa383('0x5'),'routing',_0x15f485,_0x4628c1,_0x2d5b89);return _0x576c27(_0x4628c1);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index b38a8ee..648a940 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 _0xbf07=['listen','Setting','findOne','loginMailFrequency','then','catch','log','bluebird','./server','./realtime','./lib/email','../../mysqldb','resolve','initMailAccounts'];(function(_0x14f6c7,_0x26b5da){var _0x3a8162=function(_0x56f44b){while(--_0x56f44b){_0x14f6c7['push'](_0x14f6c7['shift']());}};_0x3a8162(++_0x26b5da);}(_0xbf07,0x77));var _0x7bf0=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xbf07[_0x1d70db];return _0x3060c6;};'use strict';var BPromise=require(_0x7bf0('0x0'));var server=require(_0x7bf0('0x1'));var Realtime=require(_0x7bf0('0x2'));var EmailChannel=require(_0x7bf0('0x3'));var mailAccount=require('./rpc/mailAccount');var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x7bf0('0x4'))['db'];function initRealtime(){return BPromise[_0x7bf0('0x5')]()['then'](mailAccount['getMailAccounts']())['then'](realtime[_0x7bf0('0x6')]())['then'](function(){email['refresh'](realtime['mailAccounts']);return realtime;});}function main(){return server[_0x7bf0('0x7')](realtime,email)['then'](function(_0x263964){return initRealtime();})['then'](function(_0x415291){return db[_0x7bf0('0x8')][_0x7bf0('0x9')]({'attributes':['id',_0x7bf0('0xa')],'raw':!![]});})[_0x7bf0('0xb')](function(_0x38fb34){return setInterval(initRealtime,_0x38fb34['loginMailFrequency']*0x3e8);})[_0x7bf0('0xc')](function(_0x4d0a69){console[_0x7bf0('0xd')](_0x4d0a69);});}main(); \ No newline at end of file +var _0xc9b9=['loginMailFrequency','catch','log','./realtime','./lib/email','./rpc/mailAccount','then','mailAccounts','listen','Setting','findOne'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0xc9b9,0x18f));var _0x9c9b=function(_0x4099ee,_0x38495a){_0x4099ee=_0x4099ee-0x0;var _0x1b7bfc=_0xc9b9[_0x4099ee];return _0x1b7bfc;};'use strict';var BPromise=require('bluebird');var server=require('./server');var Realtime=require(_0x9c9b('0x0'));var EmailChannel=require(_0x9c9b('0x1'));var mailAccount=require(_0x9c9b('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise['resolve']()['then'](mailAccount['getMailAccounts']())[_0x9c9b('0x3')](realtime['initMailAccounts']())['then'](function(){email['refresh'](realtime[_0x9c9b('0x4')]);return realtime;});}function main(){return server[_0x9c9b('0x5')](realtime,email)[_0x9c9b('0x3')](function(_0x193305){return initRealtime();})[_0x9c9b('0x3')](function(_0x5e0081){return db[_0x9c9b('0x6')][_0x9c9b('0x7')]({'attributes':['id',_0x9c9b('0x8')],'raw':!![]});})[_0x9c9b('0x3')](function(_0x555067){return setInterval(initRealtime,_0x555067[_0x9c9b('0x8')]*0x3e8);})[_0x9c9b('0x9')](function(_0x55cb53){console[_0x9c9b('0xa')](_0x55cb53);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index a9da3ef..2ef4a5e 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 _0x97ba=['error','disabled','handleImapBox','connected','messages','info','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','Mail\x20accepted\x20from\x20routing','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','stringify','send','Smtp','lastSync','verify','then','verified','lodash','moment','ioredis','../../../config/environment','../../../config/logger','defaults','redis','localhost','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','status','messageStatus','total','isNil','md5','mailAccount:update','refresh','hasOwnProperty','box','bind','email','handleImapEmail','end','handleImapEnd'];(function(_0x3e8a23,_0x2b8f7d){var _0x5c179c=function(_0x6bffae){while(--_0x6bffae){_0x3e8a23['push'](_0x3e8a23['shift']());}};_0x5c179c(++_0x2b8f7d);}(_0x97ba,0x1a4));var _0xa97b=function(_0x3a58c3,_0x4c0a35){_0x3a58c3=_0x3a58c3-0x0;var _0x350c96=_0x97ba[_0x3a58c3];return _0x350c96;};'use strict';var _=require(_0xa97b('0x0'));var moment=require(_0xa97b('0x1'));var BPromise=require('bluebird');var md5=require('md5');var Redis=require(_0xa97b('0x2'));var config=require(_0xa97b('0x3'));var logger=require(_0xa97b('0x4'))('email');config['redis']=_[_0xa97b('0x5')](config[_0xa97b('0x6')],{'host':_0xa97b('0x7'),'port':0x18eb});var io=require(_0xa97b('0x8'))(new Redis(config[_0xa97b('0x6')]));var EmailImap=require(_0xa97b('0x9'));var EmailSmtp=require(_0xa97b('0xa'));var mailAccount=require(_0xa97b('0xb'));var md5Accounts={};function EmailChannel(_0x5c8ca2){logger['info'](_0xa97b('0xc'));this[_0xa97b('0xd')]=_0x5c8ca2[_0xa97b('0xd')];this[_0xa97b('0xe')]={};this[_0xa97b('0xf')]=new EmailSmtp();}EmailChannel[_0xa97b('0x10')][_0xa97b('0x11')]=function(_0x1a1b83){var _0x2b70e0=this['mailAccounts'][_0x1a1b83];var _0x2198f7={'id':_0x2b70e0['id'],'name':_0x2b70e0[_0xa97b('0x12')],'key':_0x2b70e0[_0xa97b('0x13')],'active':_0x2b70e0[_0xa97b('0x14')],'Imap':{'status':_0x2b70e0[_0xa97b('0x15')][_0xa97b('0x16')],'messageStatus':_0x2b70e0[_0xa97b('0x15')][_0xa97b('0x17')],'total':_0x2b70e0[_0xa97b('0x15')][_0xa97b('0x18')]}};if(_[_0xa97b('0x19')](md5Accounts[_0x1a1b83])){md5Accounts[_0x1a1b83]={};}var _0x402793=md5(JSON['stringify'](_0x2198f7));if(md5Accounts[_0x1a1b83][_0xa97b('0x1a')]!==_0x402793){md5Accounts[_0x1a1b83][_0xa97b('0x1a')]=_0x402793;io[_0xa97b('0x11')](_0xa97b('0x1b'),_0x2198f7);}};EmailChannel[_0xa97b('0x10')][_0xa97b('0x1c')]=function(_0x1c90c0){for(var _0x3a3d9b in _0x1c90c0){if(_0x1c90c0['hasOwnProperty'](_0x3a3d9b)){if(_0x1c90c0[_0x3a3d9b][_0xa97b('0x15')]&&_0x1c90c0[_0x3a3d9b][_0xa97b('0x14')]){var _0xc5e39e=_0x1c90c0[_0x3a3d9b]['Imap'];if(!this[_0xa97b('0xe')][_0xa97b('0x1d')](_0xc5e39e['id'])){this[_0xa97b('0xe')][_0xc5e39e['id']]=new EmailImap(_0xc5e39e,_0x1c90c0[_0x3a3d9b]['email']);this[_0xa97b('0xe')][_0xc5e39e['id']]['on'](_0xa97b('0x1e'),this['handleImapBox'][_0xa97b('0x1f')](this,_0x3a3d9b));this[_0xa97b('0xe')][_0xc5e39e['id']]['on'](_0xa97b('0x20'),this[_0xa97b('0x21')][_0xa97b('0x1f')](this,_0x3a3d9b));this[_0xa97b('0xe')][_0xc5e39e['id']]['on'](_0xa97b('0x22'),this[_0xa97b('0x23')][_0xa97b('0x1f')](this,_0x3a3d9b));this['imapAccounts'][_0xc5e39e['id']]['on'](_0xa97b('0x24'),this['handleImapError'][_0xa97b('0x1f')](this,_0x3a3d9b));}}else{if(_[_0xa97b('0x19')](this[_0xa97b('0xd')][_0x3a3d9b][_0xa97b('0x15')])){this[_0xa97b('0xd')][_0x3a3d9b][_0xa97b('0x15')]={};}this[_0xa97b('0xd')][_0x3a3d9b]['Imap'][_0xa97b('0x16')]=_0xa97b('0x25');this[_0xa97b('0xd')][_0x3a3d9b]['Imap'][_0xa97b('0x17')]='';this[_0xa97b('0x11')](_0x3a3d9b);}}}};EmailChannel['prototype'][_0xa97b('0x26')]=function(_0x1346be,_0x413788){if(this[_0xa97b('0xd')][_0x1346be]){this['mailAccounts'][_0x1346be][_0xa97b('0x15')][_0xa97b('0x16')]=_0xa97b('0x27');this[_0xa97b('0xd')][_0x1346be][_0xa97b('0x15')][_0xa97b('0x17')]=_0x413788['name'];if(_0x413788['messages']){this[_0xa97b('0xd')][_0x1346be]['Imap'][_0xa97b('0x18')]=_0x413788[_0xa97b('0x28')][_0xa97b('0x18')];}return this[_0xa97b('0x11')](_0x1346be);}};EmailChannel[_0xa97b('0x10')][_0xa97b('0x21')]=function(_0xee2a7,_0x34ce42){logger[_0xa97b('0x29')](_0xa97b('0x2a'),_0x34ce42[_0xa97b('0x2b')],_0x34ce42[_0xa97b('0x2c')],_0x34ce42[_0xa97b('0x2d')],_0xee2a7);if(this[_0xa97b('0xd')][_0xee2a7]){return mailAccount[_0xa97b('0x2e')](_0xee2a7,_0x34ce42)['then'](function(_0x480b7b){if(_0x480b7b){logger[_0xa97b('0x29')](_0xa97b('0x2f'));}})[_0xa97b('0x30')](function(_0x22d7f6){logger[_0xa97b('0x24')](_0xa97b('0x31'),JSON[_0xa97b('0x32')](_0x22d7f6));});}};EmailChannel[_0xa97b('0x10')][_0xa97b('0x23')]=function(_0x20f50f){if(this[_0xa97b('0xd')][_0x20f50f]&&this[_0xa97b('0xd')][_0x20f50f][_0xa97b('0x15')]){if(this[_0xa97b('0xe')][this[_0xa97b('0xd')][_0x20f50f][_0xa97b('0x15')]['id']]){delete this[_0xa97b('0xe')][this[_0xa97b('0xd')][_0x20f50f]['Imap']['id']];}this[_0xa97b('0xd')][_0x20f50f][_0xa97b('0x15')]['lastSync']=moment();this[_0xa97b('0x11')](_0x20f50f);}};EmailChannel[_0xa97b('0x10')]['handleImapError']=function(_0x2da06f,_0x38b66f){if(this[_0xa97b('0xd')][_0x2da06f]){this[_0xa97b('0xd')][_0x2da06f]['Imap'][_0xa97b('0x16')]='error';this['mailAccounts'][_0x2da06f][_0xa97b('0x15')]['messageStatus']=_0x38b66f;return this[_0xa97b('0x11')](_0x2da06f);}};EmailChannel['prototype']['sendMail']=function(_0x3d645f,_0x3aa65f){return this[_0xa97b('0xf')][_0xa97b('0x33')](_0x3d645f,_0x3aa65f);};EmailChannel[_0xa97b('0x10')]['verifySmtp']=function(_0x2cefe7){var _0x5b1b96=this;if(this[_0xa97b('0xd')][_0x2cefe7['id']]){if(_[_0xa97b('0x19')](this[_0xa97b('0xd')][_0x2cefe7['id']][_0xa97b('0x34')])){this[_0xa97b('0xd')][_0x2cefe7['id']]['Smtp']={};}this['mailAccounts'][_0x2cefe7['id']][_0xa97b('0x34')][_0xa97b('0x35')]=moment();return new BPromise(function(_0x278c2d,_0x2fc8ae){return _0x5b1b96[_0xa97b('0xf')][_0xa97b('0x36')](_0x2cefe7)[_0xa97b('0x37')](function(_0x359539){_0x5b1b96[_0xa97b('0xd')][_0x2cefe7['id']][_0xa97b('0x34')]['status']=_0xa97b('0x38');_0x5b1b96['mailAccounts'][_0x2cefe7['id']][_0xa97b('0x34')][_0xa97b('0x17')]='';_0x5b1b96[_0xa97b('0x11')](_0x2cefe7['id']);_0x278c2d(_0x359539);})[_0xa97b('0x30')](function(_0x21f6b1){_0x5b1b96['mailAccounts'][_0x2cefe7['id']][_0xa97b('0x34')][_0xa97b('0x16')]=_0xa97b('0x24');_0x5b1b96['mailAccounts'][_0x2cefe7['id']][_0xa97b('0x34')][_0xa97b('0x17')]=_0x21f6b1;_0x5b1b96[_0xa97b('0x11')](_0x2cefe7['id']);_0x2fc8ae(_0x21f6b1);});});}return this[_0xa97b('0xf')]['verify'](_0x2cefe7);};module['exports']=EmailChannel; \ No newline at end of file +var _0xe6c5=['handleImapBox','handleImapEmail','end','handleImapEnd','bind','isNil','disabled','connected','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','from','then','Mail\x20accepted\x20from\x20routing','catch','error','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','handleImapError','send','verifySmtp','Smtp','verify','verified','lodash','moment','bluebird','ioredis','../../../config/environment','../../../config/logger','redis','defaults','./imap','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','smtp','prototype','name','key','active','Imap','status','messageStatus','total','stringify','md5','emit','mailAccount:update','refresh','hasOwnProperty','imapAccounts','email'];(function(_0x5463dc,_0xaf0ea9){var _0x9b3032=function(_0x2641c5){while(--_0x2641c5){_0x5463dc['push'](_0x5463dc['shift']());}};_0x9b3032(++_0xaf0ea9);}(_0xe6c5,0x14e));var _0x5e6c=function(_0x94dde3,_0x363d12){_0x94dde3=_0x94dde3-0x0;var _0x292f3f=_0xe6c5[_0x94dde3];return _0x292f3f;};'use strict';var _=require(_0x5e6c('0x0'));var moment=require(_0x5e6c('0x1'));var BPromise=require(_0x5e6c('0x2'));var md5=require('md5');var Redis=require(_0x5e6c('0x3'));var config=require(_0x5e6c('0x4'));var logger=require(_0x5e6c('0x5'))('email');config[_0x5e6c('0x6')]=_[_0x5e6c('0x7')](config[_0x5e6c('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x5e6c('0x6')]));var EmailImap=require(_0x5e6c('0x8'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x5e6c('0x9'));var md5Accounts={};function EmailChannel(_0x50cb48){logger[_0x5e6c('0xa')](_0x5e6c('0xb'));this[_0x5e6c('0xc')]=_0x50cb48[_0x5e6c('0xc')];this['imapAccounts']={};this[_0x5e6c('0xd')]=new EmailSmtp();}EmailChannel[_0x5e6c('0xe')]['emit']=function(_0x372bb0){var _0x21e49a=this['mailAccounts'][_0x372bb0];var _0x32e483={'id':_0x21e49a['id'],'name':_0x21e49a[_0x5e6c('0xf')],'key':_0x21e49a[_0x5e6c('0x10')],'active':_0x21e49a[_0x5e6c('0x11')],'Imap':{'status':_0x21e49a[_0x5e6c('0x12')][_0x5e6c('0x13')],'messageStatus':_0x21e49a['Imap'][_0x5e6c('0x14')],'total':_0x21e49a[_0x5e6c('0x12')][_0x5e6c('0x15')]}};if(_['isNil'](md5Accounts[_0x372bb0])){md5Accounts[_0x372bb0]={};}var _0x17dc56=md5(JSON[_0x5e6c('0x16')](_0x32e483));if(md5Accounts[_0x372bb0][_0x5e6c('0x17')]!==_0x17dc56){md5Accounts[_0x372bb0][_0x5e6c('0x17')]=_0x17dc56;io[_0x5e6c('0x18')](_0x5e6c('0x19'),_0x32e483);}};EmailChannel[_0x5e6c('0xe')][_0x5e6c('0x1a')]=function(_0x33baa9){for(var _0x177a37 in _0x33baa9){if(_0x33baa9[_0x5e6c('0x1b')](_0x177a37)){if(_0x33baa9[_0x177a37][_0x5e6c('0x12')]&&_0x33baa9[_0x177a37]['active']){var _0x325cd6=_0x33baa9[_0x177a37][_0x5e6c('0x12')];if(!this[_0x5e6c('0x1c')]['hasOwnProperty'](_0x325cd6['id'])){this[_0x5e6c('0x1c')][_0x325cd6['id']]=new EmailImap(_0x325cd6,_0x33baa9[_0x177a37][_0x5e6c('0x1d')]);this[_0x5e6c('0x1c')][_0x325cd6['id']]['on']('box',this[_0x5e6c('0x1e')]['bind'](this,_0x177a37));this[_0x5e6c('0x1c')][_0x325cd6['id']]['on'](_0x5e6c('0x1d'),this[_0x5e6c('0x1f')]['bind'](this,_0x177a37));this[_0x5e6c('0x1c')][_0x325cd6['id']]['on'](_0x5e6c('0x20'),this[_0x5e6c('0x21')]['bind'](this,_0x177a37));this[_0x5e6c('0x1c')][_0x325cd6['id']]['on']('error',this['handleImapError'][_0x5e6c('0x22')](this,_0x177a37));}}else{if(_[_0x5e6c('0x23')](this['mailAccounts'][_0x177a37][_0x5e6c('0x12')])){this['mailAccounts'][_0x177a37][_0x5e6c('0x12')]={};}this[_0x5e6c('0xc')][_0x177a37][_0x5e6c('0x12')]['status']=_0x5e6c('0x24');this[_0x5e6c('0xc')][_0x177a37][_0x5e6c('0x12')][_0x5e6c('0x14')]='';this[_0x5e6c('0x18')](_0x177a37);}}}};EmailChannel[_0x5e6c('0xe')]['handleImapBox']=function(_0x1ebff4,_0x598f25){if(this[_0x5e6c('0xc')][_0x1ebff4]){this[_0x5e6c('0xc')][_0x1ebff4][_0x5e6c('0x12')][_0x5e6c('0x13')]=_0x5e6c('0x25');this[_0x5e6c('0xc')][_0x1ebff4][_0x5e6c('0x12')]['messageStatus']=_0x598f25[_0x5e6c('0xf')];if(_0x598f25['messages']){this[_0x5e6c('0xc')][_0x1ebff4][_0x5e6c('0x12')][_0x5e6c('0x15')]=_0x598f25['messages'][_0x5e6c('0x15')];}return this[_0x5e6c('0x18')](_0x1ebff4);}};EmailChannel[_0x5e6c('0xe')][_0x5e6c('0x1f')]=function(_0x1d67d1,_0x2f9ba5){logger[_0x5e6c('0xa')](_0x5e6c('0x26'),_0x2f9ba5['firstName'],_0x2f9ba5['lastName'],_0x2f9ba5[_0x5e6c('0x27')],_0x1d67d1);if(this[_0x5e6c('0xc')][_0x1d67d1]){return mailAccount['notify'](_0x1d67d1,_0x2f9ba5)[_0x5e6c('0x28')](function(_0x3bb032){if(_0x3bb032){logger[_0x5e6c('0xa')](_0x5e6c('0x29'));}})[_0x5e6c('0x2a')](function(_0x3b30ba){logger[_0x5e6c('0x2b')](_0x5e6c('0x2c'),JSON[_0x5e6c('0x16')](_0x3b30ba));});}};EmailChannel[_0x5e6c('0xe')][_0x5e6c('0x21')]=function(_0x152771){if(this['mailAccounts'][_0x152771]&&this[_0x5e6c('0xc')][_0x152771]['Imap']){if(this[_0x5e6c('0x1c')][this[_0x5e6c('0xc')][_0x152771][_0x5e6c('0x12')]['id']]){delete this[_0x5e6c('0x1c')][this['mailAccounts'][_0x152771][_0x5e6c('0x12')]['id']];}this[_0x5e6c('0xc')][_0x152771]['Imap'][_0x5e6c('0x2d')]=moment();this[_0x5e6c('0x18')](_0x152771);}};EmailChannel['prototype'][_0x5e6c('0x2e')]=function(_0x443bc3,_0x165430){if(this[_0x5e6c('0xc')][_0x443bc3]){this[_0x5e6c('0xc')][_0x443bc3][_0x5e6c('0x12')][_0x5e6c('0x13')]=_0x5e6c('0x2b');this[_0x5e6c('0xc')][_0x443bc3][_0x5e6c('0x12')][_0x5e6c('0x14')]=_0x165430;return this[_0x5e6c('0x18')](_0x443bc3);}};EmailChannel[_0x5e6c('0xe')]['sendMail']=function(_0x505a0a,_0x5c0529){return this[_0x5e6c('0xd')][_0x5e6c('0x2f')](_0x505a0a,_0x5c0529);};EmailChannel[_0x5e6c('0xe')][_0x5e6c('0x30')]=function(_0x569598){var _0x250034=this;if(this[_0x5e6c('0xc')][_0x569598['id']]){if(_['isNil'](this[_0x5e6c('0xc')][_0x569598['id']]['Smtp'])){this[_0x5e6c('0xc')][_0x569598['id']][_0x5e6c('0x31')]={};}this[_0x5e6c('0xc')][_0x569598['id']][_0x5e6c('0x31')]['lastSync']=moment();return new BPromise(function(_0x390e23,_0x433960){return _0x250034[_0x5e6c('0xd')][_0x5e6c('0x32')](_0x569598)[_0x5e6c('0x28')](function(_0x43e409){_0x250034[_0x5e6c('0xc')][_0x569598['id']][_0x5e6c('0x31')][_0x5e6c('0x13')]=_0x5e6c('0x33');_0x250034[_0x5e6c('0xc')][_0x569598['id']]['Smtp'][_0x5e6c('0x14')]='';_0x250034[_0x5e6c('0x18')](_0x569598['id']);_0x390e23(_0x43e409);})[_0x5e6c('0x2a')](function(_0x209b2b){_0x250034[_0x5e6c('0xc')][_0x569598['id']][_0x5e6c('0x31')][_0x5e6c('0x13')]=_0x5e6c('0x2b');_0x250034[_0x5e6c('0xc')][_0x569598['id']][_0x5e6c('0x31')][_0x5e6c('0x14')]=_0x209b2b;_0x250034[_0x5e6c('0x18')](_0x569598['id']);_0x433960(_0x209b2b);});});}return this[_0x5e6c('0xd')]['verify'](_0x569598);};module['exports']=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index 7a6fd94..1878309 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 _0x155b=['path','util','imap','lodash','mailparser','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','account','getAccount','ready','handleReady','bind','once','end','handleEnd','error','handleError','prototype','connTimeout','authTimeout','service','authentication','host','port','tls','user','password','getHost','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','handleMessageBody','handleMessageEnd','handleSimpleParser','handleMessageAttributes','parser','emit','textCode','hasOwnProperty','upperFirst','exports'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0x155b,0xec));var _0xb155=function(_0x22cd0c,_0x4040b6){_0x22cd0c=_0x22cd0c-0x0;var _0x439eba=_0x155b[_0x22cd0c];return _0x439eba;};'use strict';var fs=require('fs');var path=require(_0xb155('0x0'));var util=require(_0xb155('0x1'));var Imap=require(_0xb155('0x2'));var _=require(_0xb155('0x3'));var rs=require('randomstring');var simpleParser=require(_0xb155('0x4'))[_0xb155('0x5')];var Iconv=require(_0xb155('0x6'))[_0xb155('0x7')];var EventEmitter=require('events')[_0xb155('0x8')];var utils=require(_0xb155('0x9'));var logger=require(_0xb155('0xa'))(_0xb155('0xb'));function EmailImap(_0x1644f7,_0x36394c){this[_0xb155('0xc')]='INBOX';this[_0xb155('0xd')]=this[_0xb155('0xe')](_0x1644f7,_0x36394c);this[_0xb155('0x2')]=new Imap(this[_0xb155('0xd')]);this[_0xb155('0x2')]['once'](_0xb155('0xf'),this[_0xb155('0x10')][_0xb155('0x11')](this));this['imap'][_0xb155('0x12')](_0xb155('0x13'),this[_0xb155('0x14')][_0xb155('0x11')](this));this[_0xb155('0x2')]['on'](_0xb155('0x15'),this[_0xb155('0x16')]['bind'](this));this[_0xb155('0x2')]['connect']();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0xb155('0x17')][_0xb155('0xe')]=function(_0x592604,_0x212fb4){var _0x12d40a={'connTimeout':_0x592604[_0xb155('0x18')]?_0x592604[_0xb155('0x18')]*0x3e8:0x2710,'authTimeout':_0x592604[_0xb155('0x19')]?_0x592604[_0xb155('0x19')]*0x3e8:0x1388};if(_['isNil'](_0x592604[_0xb155('0x1a')])){if(_0x592604[_0xb155('0x1b')]){_0x12d40a['user']=_0x592604['user'];_0x12d40a['password']=_0x592604['password'];}_0x12d40a[_0xb155('0x1c')]=_0x592604[_0xb155('0x1c')];_0x12d40a['port']=_0x592604[_0xb155('0x1d')]||0x3e1;if(_0x592604[_0xb155('0x1e')]){_0x12d40a['tls']=!![];}else{_0x12d40a[_0xb155('0x1e')]=![];_0x12d40a['autotls']='required';}}else{_0x12d40a[_0xb155('0x1f')]=_0x592604[_0xb155('0x1f')];_0x12d40a[_0xb155('0x20')]=_0x592604[_0xb155('0x20')];_0x12d40a[_0xb155('0x1c')]=utils[_0xb155('0x21')](_0x592604['service']);_0x12d40a[_0xb155('0x1d')]=0x3e1;_0x12d40a[_0xb155('0x1e')]=!![];}_0x12d40a['email']=_0x212fb4||_0x592604[_0xb155('0x1f')]||'anonymous@xcally.com';return _0x12d40a;};EmailImap[_0xb155('0x17')][_0xb155('0x10')]=function(){this[_0xb155('0x2')][_0xb155('0x22')](this[_0xb155('0xc')],![],this['handleOpenBox'][_0xb155('0x11')](this));};EmailImap['prototype'][_0xb155('0x23')]=function(_0x3e6e9b,_0x32cffd){if(_0x3e6e9b){this[_0xb155('0x16')](_0x3e6e9b,!![]);}else{this['emit'](_0xb155('0x24'),_0x32cffd);this[_0xb155('0x25')]();}};EmailImap['prototype'][_0xb155('0x26')]=function(_0x322208){if(_0x322208){this[_0xb155('0x16')](_0x322208,!![]);}else{this[_0xb155('0x2')]['end']();}};EmailImap[_0xb155('0x17')][_0xb155('0x25')]=function(){this['imap'][_0xb155('0x27')]([_0xb155('0x28')],this[_0xb155('0x29')]['bind'](this));};EmailImap['prototype'][_0xb155('0x29')]=function(_0x540a08,_0x27388e){if(_0x540a08){this['handleError'](_0x540a08,!![]);}else{if(_0x27388e['length']){try{var _0x162e65=this[_0xb155('0x2')][_0xb155('0x2a')](_0x27388e,{'bodies':'','markSeen':!![]});_0x162e65['on'](_0xb155('0x2b'),this['handleFetchMessage']['bind'](this));_0x162e65['once'](_0xb155('0x15'),this[_0xb155('0x2c')][_0xb155('0x11')](this));_0x162e65[_0xb155('0x12')](_0xb155('0x13'),this[_0xb155('0x2d')][_0xb155('0x11')](this));}catch(_0xc8b984){logger[_0xb155('0x15')](_0xc8b984);}}else{this[_0xb155('0x2')][_0xb155('0x2e')](!![],this[_0xb155('0x26')][_0xb155('0x11')](this));}}};EmailImap[_0xb155('0x17')][_0xb155('0x2f')]=function(_0x4cecaa,_0x473f1f){_0x4cecaa['on'](_0xb155('0x30'),this[_0xb155('0x31')][_0xb155('0x11')](this));_0x4cecaa['once']('attributes',this['handleMessageAttributes'][_0xb155('0x11')](this));_0x4cecaa[_0xb155('0x12')](_0xb155('0x13'),this[_0xb155('0x32')][_0xb155('0x11')](this));};EmailImap[_0xb155('0x17')][_0xb155('0x31')]=function(_0x43c46e,_0x1ef33f){simpleParser(_0x43c46e,{'Iconv':Iconv},this[_0xb155('0x33')][_0xb155('0x11')](this));};EmailImap[_0xb155('0x17')][_0xb155('0x34')]=function(_0x3ea3d1){};EmailImap[_0xb155('0x17')][_0xb155('0x32')]=function(){};EmailImap['prototype']['handleSimpleParser']=function(_0x53937f,_0x3dac3a){if(_0x53937f){logger[_0xb155('0x15')](_0x53937f);}else{var _0x109f28=this;utils[_0xb155('0x35')](this['account'],_0x3dac3a,function(_0xe0d7e4){_0x109f28[_0xb155('0x36')](_0xb155('0xb'),_0xe0d7e4);});}};EmailImap[_0xb155('0x17')][_0xb155('0x2d')]=function(){this[_0xb155('0x2')][_0xb155('0x2e')](!![],this['handleCloseBox'][_0xb155('0x11')](this));};EmailImap['prototype'][_0xb155('0x2c')]=function(_0x7102f5){this[_0xb155('0x16')](_0x7102f5);this[_0xb155('0x2')]['closeBox'](!![],this[_0xb155('0x26')][_0xb155('0x11')](this));};EmailImap[_0xb155('0x17')][_0xb155('0x14')]=function(){this[_0xb155('0x36')](_0xb155('0x13'));};EmailImap['prototype'][_0xb155('0x16')]=function(_0x303f34,_0x36cd69){logger[_0xb155('0x15')](_0xb155('0x16'),this[_0xb155('0xd')][_0xb155('0xb')],JSON['stringify'](_0x303f34));var _0x535ba8='';if(_0x303f34){if(_0x303f34[_0xb155('0x37')]){_0x535ba8=_0x303f34[_0xb155('0x37')];}else{for(var _0x28537d in _0x303f34){if(_0x303f34[_0xb155('0x38')](_0x28537d)){_0x535ba8+=_[_0xb155('0x39')](_0x28537d)+':\x20'+_0x303f34[_0x28537d]+'\x0a';}}}}if(_0x36cd69){this[_0xb155('0x2')][_0xb155('0x13')]();}else{this[_0xb155('0x36')](_0xb155('0x15'),_0x535ba8);this['emit'](_0xb155('0x13'));}};module[_0xb155('0x3a')]=EmailImap; \ No newline at end of file +var _0x4684=['util','randomstring','mailparser','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','getAccount','imap','account','once','ready','handleReady','end','handleEnd','bind','error','handleError','connect','prototype','connTimeout','authTimeout','isNil','service','user','password','host','port','tls','autotls','required','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','fetch','message','handleFetchError','handleFetchEnd','closeBox','handleFetchMessage','body','attributes','handleMessageEnd','handleMessageBody','handleSimpleParser','parser','stringify','textCode','hasOwnProperty','upperFirst','exports','path'];(function(_0x1a29df,_0x310f66){var _0x4ebf65=function(_0x548d5f){while(--_0x548d5f){_0x1a29df['push'](_0x1a29df['shift']());}};_0x4ebf65(++_0x310f66);}(_0x4684,0xb9));var _0x4468=function(_0x2bd8fe,_0x4aeef7){_0x2bd8fe=_0x2bd8fe-0x0;var _0x2979e6=_0x4684[_0x2bd8fe];return _0x2979e6;};'use strict';var fs=require('fs');var path=require(_0x4468('0x0'));var util=require(_0x4468('0x1'));var Imap=require('imap');var _=require('lodash');var rs=require(_0x4468('0x2'));var simpleParser=require(_0x4468('0x3'))['simpleParser'];var Iconv=require('iconv')[_0x4468('0x4')];var EventEmitter=require(_0x4468('0x5'))[_0x4468('0x6')];var utils=require(_0x4468('0x7'));var logger=require(_0x4468('0x8'))(_0x4468('0x9'));function EmailImap(_0x7b93a9,_0x5b5815){this[_0x4468('0xa')]=_0x4468('0xb');this['account']=this[_0x4468('0xc')](_0x7b93a9,_0x5b5815);this[_0x4468('0xd')]=new Imap(this[_0x4468('0xe')]);this[_0x4468('0xd')][_0x4468('0xf')](_0x4468('0x10'),this[_0x4468('0x11')]['bind'](this));this['imap'][_0x4468('0xf')](_0x4468('0x12'),this[_0x4468('0x13')][_0x4468('0x14')](this));this[_0x4468('0xd')]['on'](_0x4468('0x15'),this[_0x4468('0x16')][_0x4468('0x14')](this));this[_0x4468('0xd')][_0x4468('0x17')]();}util['inherits'](EmailImap,EventEmitter);EmailImap[_0x4468('0x18')][_0x4468('0xc')]=function(_0x1fdea2,_0x3a6675){var _0x4c6bad={'connTimeout':_0x1fdea2[_0x4468('0x19')]?_0x1fdea2[_0x4468('0x19')]*0x3e8:0x2710,'authTimeout':_0x1fdea2['authTimeout']?_0x1fdea2[_0x4468('0x1a')]*0x3e8:0x1388};if(_[_0x4468('0x1b')](_0x1fdea2[_0x4468('0x1c')])){if(_0x1fdea2['authentication']){_0x4c6bad[_0x4468('0x1d')]=_0x1fdea2[_0x4468('0x1d')];_0x4c6bad[_0x4468('0x1e')]=_0x1fdea2['password'];}_0x4c6bad['host']=_0x1fdea2[_0x4468('0x1f')];_0x4c6bad[_0x4468('0x20')]=_0x1fdea2['port']||0x3e1;if(_0x1fdea2[_0x4468('0x21')]){_0x4c6bad['tls']=!![];}else{_0x4c6bad['tls']=![];_0x4c6bad[_0x4468('0x22')]=_0x4468('0x23');}}else{_0x4c6bad['user']=_0x1fdea2['user'];_0x4c6bad['password']=_0x1fdea2['password'];_0x4c6bad[_0x4468('0x1f')]=utils['getHost'](_0x1fdea2[_0x4468('0x1c')]);_0x4c6bad[_0x4468('0x20')]=0x3e1;_0x4c6bad[_0x4468('0x21')]=!![];}_0x4c6bad[_0x4468('0x9')]=_0x3a6675||_0x1fdea2['user']||_0x4468('0x24');return _0x4c6bad;};EmailImap['prototype']['handleReady']=function(){this[_0x4468('0xd')][_0x4468('0x25')](this[_0x4468('0xa')],![],this['handleOpenBox'][_0x4468('0x14')](this));};EmailImap[_0x4468('0x18')][_0x4468('0x26')]=function(_0x5d7daf,_0x3d5b12){if(_0x5d7daf){this[_0x4468('0x16')](_0x5d7daf,!![]);}else{this[_0x4468('0x27')](_0x4468('0x28'),_0x3d5b12);this[_0x4468('0x29')]();}};EmailImap['prototype'][_0x4468('0x2a')]=function(_0x572622){if(_0x572622){this[_0x4468('0x16')](_0x572622,!![]);}else{this[_0x4468('0xd')][_0x4468('0x12')]();}};EmailImap[_0x4468('0x18')][_0x4468('0x29')]=function(){this[_0x4468('0xd')][_0x4468('0x2b')](['UNSEEN'],this[_0x4468('0x2c')][_0x4468('0x14')](this));};EmailImap[_0x4468('0x18')][_0x4468('0x2c')]=function(_0x33bdcd,_0x14320d){if(_0x33bdcd){this[_0x4468('0x16')](_0x33bdcd,!![]);}else{if(_0x14320d['length']){try{var _0x15b2cf=this['imap'][_0x4468('0x2d')](_0x14320d,{'bodies':'','markSeen':!![]});_0x15b2cf['on'](_0x4468('0x2e'),this['handleFetchMessage'][_0x4468('0x14')](this));_0x15b2cf[_0x4468('0xf')]('error',this[_0x4468('0x2f')][_0x4468('0x14')](this));_0x15b2cf['once'](_0x4468('0x12'),this[_0x4468('0x30')]['bind'](this));}catch(_0x476270){logger['error'](_0x476270);}}else{this[_0x4468('0xd')][_0x4468('0x31')](!![],this[_0x4468('0x2a')][_0x4468('0x14')](this));}}};EmailImap[_0x4468('0x18')][_0x4468('0x32')]=function(_0x274dca,_0xc0e20){_0x274dca['on'](_0x4468('0x33'),this['handleMessageBody']['bind'](this));_0x274dca[_0x4468('0xf')](_0x4468('0x34'),this['handleMessageAttributes']['bind'](this));_0x274dca['once']('end',this[_0x4468('0x35')][_0x4468('0x14')](this));};EmailImap[_0x4468('0x18')][_0x4468('0x36')]=function(_0x39ad47,_0x50ecff){simpleParser(_0x39ad47,{'Iconv':Iconv},this[_0x4468('0x37')]['bind'](this));};EmailImap[_0x4468('0x18')]['handleMessageAttributes']=function(_0x25d754){};EmailImap[_0x4468('0x18')][_0x4468('0x35')]=function(){};EmailImap[_0x4468('0x18')]['handleSimpleParser']=function(_0x17cd80,_0x28c906){if(_0x17cd80){logger['error'](_0x17cd80);}else{var _0x4c4bdb=this;utils[_0x4468('0x38')](this['account'],_0x28c906,function(_0x3037d7){_0x4c4bdb[_0x4468('0x27')](_0x4468('0x9'),_0x3037d7);});}};EmailImap[_0x4468('0x18')][_0x4468('0x30')]=function(){this[_0x4468('0xd')][_0x4468('0x31')](!![],this[_0x4468('0x2a')]['bind'](this));};EmailImap['prototype'][_0x4468('0x2f')]=function(_0x2e922b){this[_0x4468('0x16')](_0x2e922b);this[_0x4468('0xd')]['closeBox'](!![],this[_0x4468('0x2a')][_0x4468('0x14')](this));};EmailImap['prototype'][_0x4468('0x13')]=function(){this[_0x4468('0x27')](_0x4468('0x12'));};EmailImap[_0x4468('0x18')][_0x4468('0x16')]=function(_0x42fac3,_0x14084e){logger[_0x4468('0x15')]('handleError',this[_0x4468('0xe')][_0x4468('0x9')],JSON[_0x4468('0x39')](_0x42fac3));var _0x552ab0='';if(_0x42fac3){if(_0x42fac3[_0x4468('0x3a')]){_0x552ab0=_0x42fac3[_0x4468('0x3a')];}else{for(var _0x1c565f in _0x42fac3){if(_0x42fac3[_0x4468('0x3b')](_0x1c565f)){_0x552ab0+=_[_0x4468('0x3c')](_0x1c565f)+':\x20'+_0x42fac3[_0x1c565f]+'\x0a';}}}}if(_0x14084e){this['imap'][_0x4468('0x12')]();}else{this[_0x4468('0x27')](_0x4468('0x15'),_0x552ab0);this[_0x4468('0x27')](_0x4468('0x12'));}};module[_0x4468('0x3d')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index 97ce41b..2e97759 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 _0x6863=['createTransport','verify','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','use','sendMail','toString'];(function(_0x456a4b,_0x51df8){var _0x42957c=function(_0x431de8){while(--_0x431de8){_0x456a4b['push'](_0x456a4b['shift']());}};_0x42957c(++_0x51df8);}(_0x6863,0xdf));var _0x3686=function(_0x505154,_0x5605c6){_0x505154=_0x505154-0x0;var _0x866130=_0x6863[_0x505154];return _0x866130;};'use strict';var nodemailer=require(_0x3686('0x0'));var BPromise=require(_0x3686('0x1'));var inlineBase64=require(_0x3686('0x2'));function EmailSmtp(){}EmailSmtp[_0x3686('0x3')]['send']=function(_0x30b513,_0x1615bf){return new BPromise(function(_0xb0313,_0x9882fe){var _0x2f8c5c=nodemailer['createTransport'](_0x30b513);_0x2f8c5c[_0x3686('0x4')]('compile',inlineBase64());_0x2f8c5c[_0x3686('0x5')](_0x1615bf,function(_0x29fb0b,_0x475673){if(_0x29fb0b){_0x9882fe(_0x29fb0b[_0x3686('0x6')]());}else{_0xb0313(_0x475673);}});});};EmailSmtp[_0x3686('0x3')]['verify']=function(_0x23a7de){return new BPromise(function(_0x5337bd,_0x5bead9){var _0xcfbae0=nodemailer[_0x3686('0x7')](_0x23a7de);_0xcfbae0[_0x3686('0x8')](function(_0x58454a,_0x15dc68){if(_0x58454a){_0x5bead9(_0x58454a[_0x3686('0x6')]());}else{if(_0x15dc68){_0x5337bd(_0x15dc68);}else{_0x5bead9('Not\x20verifired');}}});});};module[_0x3686('0x9')]=EmailSmtp; \ No newline at end of file +var _0x6972=['sendMail','toString','verify','Not\x20verifired','exports','nodemailer','bluebird','nodemailer-plugin-inline-base64','prototype','send','createTransport','use','compile'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6972,0x123));var _0x2697=function(_0x18e593,_0x3753d3){_0x18e593=_0x18e593-0x0;var _0x57fc92=_0x6972[_0x18e593];return _0x57fc92;};'use strict';var nodemailer=require(_0x2697('0x0'));var BPromise=require(_0x2697('0x1'));var inlineBase64=require(_0x2697('0x2'));function EmailSmtp(){}EmailSmtp[_0x2697('0x3')][_0x2697('0x4')]=function(_0x611028,_0x34a826){return new BPromise(function(_0x7173f,_0x55af44){var _0x47bf47=nodemailer[_0x2697('0x5')](_0x611028);_0x47bf47[_0x2697('0x6')](_0x2697('0x7'),inlineBase64());_0x47bf47[_0x2697('0x8')](_0x34a826,function(_0x445582,_0x370629){if(_0x445582){_0x55af44(_0x445582[_0x2697('0x9')]());}else{_0x7173f(_0x370629);}});});};EmailSmtp[_0x2697('0x3')][_0x2697('0xa')]=function(_0x56b2a0){return new BPromise(function(_0x5364e9,_0x370067){var _0x481f60=nodemailer[_0x2697('0x5')](_0x56b2a0);_0x481f60[_0x2697('0xa')](function(_0x41d22f,_0x4d143c){if(_0x41d22f){_0x370067(_0x41d22f[_0x2697('0x9')]());}else{if(_0x4d143c){_0x5364e9(_0x4d143c);}else{_0x370067(_0x2697('0xb'));}}});});};module[_0x2697('0xc')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 09b5967..9e4c3b1 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 _0xc039=['date','YYYY-MM-DD\x20HH:mm:ss','filter','application/ms-tnef','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','messageId','parseBuffer','first','BodyHTML','Attachments','Data','

Empty\x20message

','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','127.0.0.1','lodash','moment','randomstring','path','util','node-tnef','email','head','value','address','anonymous','@xcally.com','name','split','length','join','Anonymous','pop','isEmpty','generate','html','replace','body','textAsHtml','0x1?_0x456f6a[_0x9c03('0x11')]():'';}return'';}function getMails(_0x2492a1,_0x12723){var _0x225a41='';for(var _0xe8e92e=0x0;_0xe8e92e<_0x12723['value']['length'];_0xe8e92e+=0x1){if(_0x12723[_0x9c03('0x8')][_0xe8e92e][_0x9c03('0x9')]!==_0x2492a1){if(!_[_0x9c03('0x12')](_0x225a41)){_0x225a41+=',';}_0x225a41+=_0x12723[_0x9c03('0x8')][_0xe8e92e]['name']||_0x12723[_0x9c03('0x8')][_0xe8e92e][_0x9c03('0x9')]||'';_0x225a41+='\x20<';_0x225a41+=_0x12723[_0x9c03('0x8')][_0xe8e92e][_0x9c03('0x9')]?_0x12723['value'][_0xe8e92e][_0x9c03('0x9')]:_0x9c03('0xa')+random[_0x9c03('0x13')](0x6)+_0x9c03('0xb');_0x225a41+='>';}}return _0x225a41;}function parseEmail(_0x566911,_0x4bae71,_0x4b5f61){if(_0x4bae71[_0x9c03('0x14')]){var _0x4152d0=/)<[^<]*)*<\/script>/gi;while(_0x4152d0['test'](_0x4bae71[_0x9c03('0x14')])){_0x4bae71[_0x9c03('0x14')]=_0x4bae71[_0x9c03('0x14')][_0x9c03('0x15')](_0x4152d0,'');}_0x4b5f61['body']=_0x4bae71[_0x9c03('0x14')];}else{_0x4b5f61[_0x9c03('0x16')]=_0x4bae71[_0x9c03('0x17')];}if(_0x4b5f61[_0x9c03('0x16')]){_0x4b5f61[_0x9c03('0x16')]=_0x4b5f61['body']['replace'](/Empty\x20message

';if(_0x901858['Attachments']){for(var _0x103b18=0x0;_0x103b18<_0x901858[_0x9c03('0x36')][_0x9c03('0xe')];_0x103b18++){var _0x1fc196=_0x901858[_0x9c03('0x36')][_0x103b18];_0x2ee14f[_0x9c03('0x19')][_0x9c03('0x1e')]['push']({'filename':_0x1fc196['Title'],'content':new Buffer(_0x1fc196[_0x9c03('0x37')])});}}}_0x16e68c(parseEmail(_0x47cd1b,_0x26e4bf,_0x2ee14f));});}else{_0x26e4bf['html']=_0x9c03('0x38');_0x16e68c(parseEmail(_0x47cd1b,_0x26e4bf,_0x2ee14f));}}else{_0x16e68c(parseEmail(_0x47cd1b,_0x26e4bf,_0x2ee14f));}};exports[_0x9c03('0x39')]=function(_0x53019b){switch(_0x53019b){case _0x9c03('0x3a'):return _0x9c03('0x3b');case'yahoo':return _0x9c03('0x3c');case _0x9c03('0x3d'):return _0x9c03('0x3e');case'outlook365':return'outlook.office365.com';}return _0x9c03('0x3f');}; \ No newline at end of file +var _0xd697=['messageId','format','filter','info','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','BodyHTML','

Empty\x20message

','Attachments','push','Title','getHost','gmail','imap.gmail.com','yahoo','hotmail','imap-mail.outlook.com','outlook365','outlook.office365.com','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','generate','@xcally.com','name','length','Anonymous','split','pop','anonymous','html','test','replace','body','textAsHtml','originTo','isEmpty','message','includes','originCc','bcc','attachments','type','attachment','filename','attachment-','%s-%s','join','content','contentType','parser','from','subject'];(function(_0x377e1c,_0x42158b){var _0x601fc7=function(_0x3845d6){while(--_0x3845d6){_0x377e1c['push'](_0x377e1c['shift']());}};_0x601fc7(++_0x42158b);}(_0xd697,0x1f2));var _0x7d69=function(_0x2d014a,_0x872fd9){_0x2d014a=_0x2d014a-0x0;var _0xe9859f=_0xd697[_0x2d014a];return _0xe9859f;};'use strict';var _=require(_0x7d69('0x0'));var moment=require(_0x7d69('0x1'));var random=require(_0x7d69('0x2'));var fs=require('fs');var path=require(_0x7d69('0x3'));var util=require('util');var tnef=require(_0x7d69('0x4'));var logger=require(_0x7d69('0x5'))(_0x7d69('0x6'));var config=require(_0x7d69('0x7'));function getAddress(_0x16e0dc){var _0x55474f=_[_0x7d69('0x8')](_0x16e0dc[_0x7d69('0x9')]);return _0x55474f&&_0x55474f[_0x7d69('0xa')]?_0x55474f[_0x7d69('0xa')]:'anonymous'+random[_0x7d69('0xb')](0x6)+_0x7d69('0xc');}function getFirstName(_0x2cc32f){var _0x58ab0a=_['head'](_0x2cc32f[_0x7d69('0x9')]);if(_0x58ab0a&&_0x58ab0a[_0x7d69('0xd')]){var _0x523831=_0x58ab0a[_0x7d69('0xd')]['split'](/\s+/);return _0x523831[_0x7d69('0xe')]?_0x523831['slice'](0x0,-0x1)['join']('\x20'):_0x58ab0a[_0x7d69('0xd')];}return _0x7d69('0xf');}function getLastName(_0x45294a){var _0x401773=_[_0x7d69('0x8')](_0x45294a[_0x7d69('0x9')]);if(_0x401773&&_0x401773[_0x7d69('0xd')]){var _0x48033d=_0x401773['name'][_0x7d69('0x10')](/\s+/);return _0x48033d['length']>0x1?_0x48033d[_0x7d69('0x11')]():'';}return'';}function getMails(_0x14ee12,_0x283e22){var _0x3f1dd3='';for(var _0x17e5b6=0x0;_0x17e5b6<_0x283e22[_0x7d69('0x9')][_0x7d69('0xe')];_0x17e5b6+=0x1){if(_0x283e22[_0x7d69('0x9')][_0x17e5b6][_0x7d69('0xa')]!==_0x14ee12){if(!_['isEmpty'](_0x3f1dd3)){_0x3f1dd3+=',';}_0x3f1dd3+=_0x283e22[_0x7d69('0x9')][_0x17e5b6][_0x7d69('0xd')]||_0x283e22[_0x7d69('0x9')][_0x17e5b6][_0x7d69('0xa')]||'';_0x3f1dd3+='\x20<';_0x3f1dd3+=_0x283e22[_0x7d69('0x9')][_0x17e5b6]['address']?_0x283e22[_0x7d69('0x9')][_0x17e5b6][_0x7d69('0xa')]:_0x7d69('0x12')+random['generate'](0x6)+_0x7d69('0xc');_0x3f1dd3+='>';}}return _0x3f1dd3;}function parseEmail(_0x1a56b8,_0x453885,_0x24c242){if(_0x453885[_0x7d69('0x13')]){var _0x32dde1=/)<[^<]*)*<\/script>/gi;while(_0x32dde1[_0x7d69('0x14')](_0x453885[_0x7d69('0x13')])){_0x453885[_0x7d69('0x13')]=_0x453885[_0x7d69('0x13')][_0x7d69('0x15')](_0x32dde1,'');}_0x24c242[_0x7d69('0x16')]=_0x453885[_0x7d69('0x13')];}else{_0x24c242[_0x7d69('0x16')]=_0x453885[_0x7d69('0x17')];}if(_0x24c242[_0x7d69('0x16')]){_0x24c242[_0x7d69('0x16')]=_0x24c242[_0x7d69('0x16')]['replace'](/0x0){if(this[_0x41f75e+_0x0314('0x25')]>0x0&&this[_0x41f75e+_0x0314('0x24')]>=this[_0x41f75e+_0x0314('0x25')]){return'maxcapacity';}else{return'working';}}else{return _0x0314('0x26');}};Agent[_0x0314('0x27')][_0x0314('0x22')]=function(){var _0x174119=[_0x0314('0x28'),_0x0314('0x29'),'openchannel',_0x0314('0x2a'),_0x0314('0x2b')];for(var _0x590e94=0x0;_0x590e94<_0x174119[_0x0314('0x2c')];_0x590e94+=0x1){var _0xfc4893=this[_0x0314('0x23')](_0x174119[_0x590e94]);if(this[_0x174119[_0x590e94]+_0x0314('0x2d')]!==_0xfc4893){this[_0x174119[_0x590e94]+_0x0314('0x2e')]=_[_0x0314('0x2f')](moment()['format']('x'));}this[_0x174119[_0x590e94]+_0x0314('0x2d')]=_0xfc4893;}var _0x2e0c77={'id':this['id'],'name':this[_0x0314('0x8')],'online':this['online'],'voicePause':this[_0x0314('0xa')],'chatPause':this[_0x0314('0xb')],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this[_0x0314('0xc')],'openchannelPause':this[_0x0314('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x0314('0x30')],'chatCapacity':this[_0x0314('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0x0314('0x14')],'mailCapacity':this[_0x0314('0x15')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x0314('0x17')],'faxStatusTime':this[_0x0314('0x18')],'faxCapacity':this[_0x0314('0x19')],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this[_0x0314('0x1b')],'smsStatusTime':this[_0x0314('0x1c')],'smsCapacity':this[_0x0314('0x1d')],'smsCurrentCapacity':this[_0x0314('0x31')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x0314('0x32')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this['openchannelCurrentCapacity'],'busy':this[_0x0314('0x20')],'busyQueue':this[_0x0314('0x21')]};var _0x346c84=md5(JSON['stringify'](_0x2e0c77));if(this[_0x0314('0x2')]!==_0x346c84){this['md5']=_0x346c84;io[_0x0314('0x33')]('user:save',_0x2e0c77);}};module['exports']=Agent; \ No newline at end of file +var _0xbf6e=['ioredis','../../../config/environment','redis','defaults','localhost','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','chatStatus','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxCapacity','smsStatus','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatus','openchannelStatusTime','openchannelCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','length','Status','StatusTime','faxStatus','faxStatusTime','faxCurrentCapacity','openchannelCurrentCapacity','stringify','emit','exports','md5'];(function(_0x5e39cf,_0x5b749f){var _0x553f07=function(_0x36a8f2){while(--_0x36a8f2){_0x5e39cf['push'](_0x5e39cf['shift']());}};_0x553f07(++_0x5b749f);}(_0xbf6e,0x149));var _0xebf6=function(_0x2849d3,_0x558165){_0x2849d3=_0x2849d3-0x0;var _0x39ace3=_0xbf6e[_0x2849d3];return _0x39ace3;};'use strict';var _=require('lodash');var moment=require('moment');var md5=require(_0xebf6('0x0'));var Redis=require(_0xebf6('0x1'));var config=require(_0xebf6('0x2'));config[_0xebf6('0x3')]=_[_0xebf6('0x4')](config[_0xebf6('0x3')],{'host':_0xebf6('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xebf6('0x3')]));function Agent(_0x6ff2a3){this['id']=_0x6ff2a3['id']||0x0;this[_0xebf6('0x6')]=_0x6ff2a3[_0xebf6('0x6')]||'';this[_0xebf6('0x7')]=_0x6ff2a3[_0xebf6('0x7')]||!![];this[_0xebf6('0x8')]=_0x6ff2a3['voicePause']||![];this[_0xebf6('0x9')]=_0x6ff2a3[_0xebf6('0x9')]||![];this[_0xebf6('0xa')]=_0x6ff2a3['mailPause']||![];this[_0xebf6('0xb')]=_0x6ff2a3[_0xebf6('0xb')]||![];this['smsPause']=_0x6ff2a3[_0xebf6('0xc')]||![];this[_0xebf6('0xd')]=_0x6ff2a3[_0xebf6('0xd')]||![];this[_0xebf6('0xe')]=_0xebf6('0xf');this[_0xebf6('0x10')]=0x0;this['chatCapacity']=_0x6ff2a3[_0xebf6('0x11')]||0x0;this[_0xebf6('0x12')]=0x0;this['mailStatus']=_0xebf6('0xf');this[_0xebf6('0x13')]=0x0;this[_0xebf6('0x14')]=_0x6ff2a3[_0xebf6('0x14')]||0x0;this[_0xebf6('0x15')]=0x0;this['faxStatus']='unknown';this['faxStatusTime']=0x0;this[_0xebf6('0x16')]=_0x6ff2a3[_0xebf6('0x16')]||0x0;this['faxCurrentCapacity']=0x0;this[_0xebf6('0x17')]=_0xebf6('0xf');this[_0xebf6('0x18')]=0x0;this[_0xebf6('0x19')]=_0x6ff2a3[_0xebf6('0x19')]||0x0;this[_0xebf6('0x1a')]=0x0;this[_0xebf6('0x1b')]=_0xebf6('0xf');this[_0xebf6('0x1c')]=0x0;this[_0xebf6('0x1d')]=_0x6ff2a3['openchannelCapacity']||0x0;this['openchannelCurrentCapacity']=0x0;this[_0xebf6('0x1e')]=![];this[_0xebf6('0x1f')]=undefined;this[_0xebf6('0x0')]='';this[_0xebf6('0x20')]();}Agent[_0xebf6('0x21')][_0xebf6('0x22')]=function(_0x35f739){if(this[_0x35f739+_0xebf6('0x23')]>0x0){if(this[_0x35f739+'Capacity']>0x0&&this[_0x35f739+_0xebf6('0x23')]>=this[_0x35f739+_0xebf6('0x24')]){return _0xebf6('0x25');}else{return _0xebf6('0x26');}}else{return _0xebf6('0x27');}};Agent[_0xebf6('0x21')][_0xebf6('0x20')]=function(){var _0xfce30a=[_0xebf6('0x28'),_0xebf6('0x29'),_0xebf6('0x2a'),_0xebf6('0x2b'),_0xebf6('0x2c')];for(var _0x3b8bc1=0x0;_0x3b8bc1<_0xfce30a[_0xebf6('0x2d')];_0x3b8bc1+=0x1){var _0x1d0078=this[_0xebf6('0x22')](_0xfce30a[_0x3b8bc1]);if(this[_0xfce30a[_0x3b8bc1]+_0xebf6('0x2e')]!==_0x1d0078){this[_0xfce30a[_0x3b8bc1]+_0xebf6('0x2f')]=_['toNumber'](moment()['format']('x'));}this[_0xfce30a[_0x3b8bc1]+_0xebf6('0x2e')]=_0x1d0078;}var _0x4dc5be={'id':this['id'],'name':this[_0xebf6('0x6')],'online':this[_0xebf6('0x7')],'voicePause':this['voicePause'],'chatPause':this['chatPause'],'mailPause':this[_0xebf6('0xa')],'smsPause':this[_0xebf6('0xc')],'faxPause':this[_0xebf6('0xb')],'openchannelPause':this[_0xebf6('0xd')],'chatStatus':this[_0xebf6('0xe')],'chatStatusTime':this[_0xebf6('0x10')],'chatCapacity':this[_0xebf6('0x11')],'chatCurrentCapacity':this[_0xebf6('0x12')],'mailStatus':this['mailStatus'],'mailStatusTime':this[_0xebf6('0x13')],'mailCapacity':this[_0xebf6('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xebf6('0x30')],'faxStatusTime':this[_0xebf6('0x31')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xebf6('0x32')],'smsStatus':this[_0xebf6('0x17')],'smsStatusTime':this[_0xebf6('0x18')],'smsCapacity':this[_0xebf6('0x19')],'smsCurrentCapacity':this[_0xebf6('0x1a')],'openchannelStatus':this[_0xebf6('0x1b')],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this[_0xebf6('0x1d')],'openchannelCurrentCapacity':this[_0xebf6('0x33')],'busy':this['busy'],'busyQueue':this['busyQueue']};var _0x2ab7a0=md5(JSON[_0xebf6('0x34')](_0x4dc5be));if(this['md5']!==_0x2ab7a0){this[_0xebf6('0x0')]=_0x2ab7a0;io[_0xebf6('0x35')]('user:save',_0x4dc5be);}};module[_0xebf6('0x36')]=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index e16f8f7..2570304 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 _0x998a=['mapAgentsId','updateRouting','prototype','_rr','updateRealtime','paused','length','online','loggedIn','chatPause','available','waiting','stringify','format','chat:queue:%s','emit','chat_queue:save','exports','lodash','md5','util','ioredis','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','Agents'];(function(_0x17deca,_0x3969b0){var _0x5c300e=function(_0x820383){while(--_0x820383){_0x17deca['push'](_0x17deca['shift']());}};_0x5c300e(++_0x3969b0);}(_0x998a,0xe4));var _0xa998=function(_0x1c505c,_0x264e01){_0x1c505c=_0x1c505c-0x0;var _0x5c8774=_0x998a[_0x1c505c];return _0x5c8774;};'use strict';var _=require(_0xa998('0x0'));var md5=require(_0xa998('0x1'));var util=require(_0xa998('0x2'));var Redis=require(_0xa998('0x3'));var config=require('../../../config/environment');config['redis']=_[_0xa998('0x4')](config['redis'],{'host':_0xa998('0x5'),'port':0x18eb});var io=require(_0xa998('0x6'))(new Redis(config[_0xa998('0x7')]));function ChatQueue(_0x43accb){this['id']=_0x43accb['id']||0x0;this[_0xa998('0x8')]=_0x43accb[_0xa998('0x8')]||'';this[_0xa998('0x9')]=_0x43accb[_0xa998('0x9')]||0xa;this[_0xa998('0xa')]=_0x43accb[_0xa998('0xa')]||'beepall';this[_0xa998('0xb')]=_0x43accb['Agents'];this[_0xa998('0xc')]={};this['waiting']=0x0;this[_0xa998('0x1')]='';this[_0xa998('0xd')]();this['updateRealtime']();}ChatQueue[_0xa998('0xe')][_0xa998('0xd')]=function(){var _0x276e86=this[_0xa998('0xc')][_0xa998('0xf')];this[_0xa998('0xc')]=_['map'](this[_0xa998('0xb')],'id');this['mapAgentsId'][_0xa998('0xf')]=_0x276e86;};ChatQueue[_0xa998('0xe')][_0xa998('0x10')]=function(){this['loggedIn']=0x0;this[_0xa998('0x11')]=0x0;for(var _0x575f82=0x0;_0x575f82=0x0?this[_0xa998('0x16')]:0x0;var _0x4fc1a5={'id':this['id'],'available':this[_0xa998('0x16')],'loggedIn':this['loggedIn'],'name':this[_0xa998('0x8')],'paused':this[_0xa998('0x11')],'waiting':this[_0xa998('0x17')]};var _0x1f97ec=md5(JSON[_0xa998('0x18')](_0x4fc1a5));if(this[_0xa998('0x1')]!==_0x1f97ec){this[_0xa998('0x1')]=_0x1f97ec;io['to'](util[_0xa998('0x19')](_0xa998('0x1a'),_0x4fc1a5[_0xa998('0x8')]))[_0xa998('0x1b')](_0xa998('0x1c'),_0x4fc1a5);}};module[_0xa998('0x1d')]=ChatQueue; \ No newline at end of file +var _0x0b4e=['loggedIn','paused','online','chatPause','available','waiting','chat:queue:%s','emit','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','_rr','map'];(function(_0x1e201a,_0x5691c3){var _0x2f2516=function(_0x3a1fe2){while(--_0x3a1fe2){_0x1e201a['push'](_0x1e201a['shift']());}};_0x2f2516(++_0x5691c3);}(_0x0b4e,0xa4));var _0xe0b4=function(_0x2ec76e,_0x43ee40){_0x2ec76e=_0x2ec76e-0x0;var _0xc21314=_0x0b4e[_0x2ec76e];return _0xc21314;};'use strict';var _=require('lodash');var md5=require(_0xe0b4('0x0'));var util=require('util');var Redis=require(_0xe0b4('0x1'));var config=require(_0xe0b4('0x2'));config[_0xe0b4('0x3')]=_[_0xe0b4('0x4')](config[_0xe0b4('0x3')],{'host':_0xe0b4('0x5'),'port':0x18eb});var io=require(_0xe0b4('0x6'))(new Redis(config['redis']));function ChatQueue(_0x21fa6d){this['id']=_0x21fa6d['id']||0x0;this[_0xe0b4('0x7')]=_0x21fa6d[_0xe0b4('0x7')]||'';this[_0xe0b4('0x8')]=_0x21fa6d[_0xe0b4('0x8')]||0xa;this['strategy']=_0x21fa6d[_0xe0b4('0x9')]||_0xe0b4('0xa');this[_0xe0b4('0xb')]=_0x21fa6d[_0xe0b4('0xb')];this[_0xe0b4('0xc')]={};this['waiting']=0x0;this[_0xe0b4('0x0')]='';this[_0xe0b4('0xd')]();this[_0xe0b4('0xe')]();}ChatQueue[_0xe0b4('0xf')][_0xe0b4('0xd')]=function(){var _0x599d81=this[_0xe0b4('0xc')][_0xe0b4('0x10')];this[_0xe0b4('0xc')]=_[_0xe0b4('0x11')](this[_0xe0b4('0xb')],'id');this[_0xe0b4('0xc')]['_rr']=_0x599d81;};ChatQueue[_0xe0b4('0xf')][_0xe0b4('0xe')]=function(){this[_0xe0b4('0x12')]=0x0;this[_0xe0b4('0x13')]=0x0;for(var _0x3a1108=0x0;_0x3a1108=0x0?this[_0xe0b4('0x16')]:0x0;var _0x4af273={'id':this['id'],'available':this[_0xe0b4('0x16')],'loggedIn':this[_0xe0b4('0x12')],'name':this[_0xe0b4('0x7')],'paused':this[_0xe0b4('0x13')],'waiting':this[_0xe0b4('0x17')]};var _0x5bf38b=md5(JSON['stringify'](_0x4af273));if(this['md5']!==_0x5bf38b){this[_0xe0b4('0x0')]=_0x5bf38b;io['to'](util['format'](_0xe0b4('0x18'),_0x4af273[_0xe0b4('0x7')]))[_0xe0b4('0x19')]('chat_queue:save',_0x4af273);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 57742f2..6b2e4e9 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(_0x423331,_0x4a71b3){var _0x33e684=function(_0x3c8f3b){while(--_0x3c8f3b){_0x423331['push'](_0x423331['shift']());}};_0x33e684(++_0x4a71b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'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(_0x251a62,_0x338fb3){var _0x4bf4b2=function(_0x168e1c){while(--_0x168e1c){_0x251a62['push'](_0x251a62['shift']());}};_0x4bf4b2(++_0x338fb3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'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 92e2ea2..18e15ef 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 _0x5e4d=['Intervals','exports','name'];(function(_0xf71120,_0x25b7f9){var _0xbe2fd3=function(_0x1acbdd){while(--_0x1acbdd){_0xf71120['push'](_0xf71120['shift']());}};_0xbe2fd3(++_0x25b7f9);}(_0x5e4d,0x137));var _0xd5e4=function(_0x4f16f6,_0x3f9050){_0x4f16f6=_0x4f16f6-0x0;var _0x3c8af3=_0x5e4d[_0x4f16f6];return _0x3c8af3;};'use strict';function Interval(_0x3178b6){this['id']=_0x3178b6['id']||0x0;this[_0xd5e4('0x0')]=_0x3178b6[_0xd5e4('0x0')]||'';this['Intervals']=_0x3178b6[_0xd5e4('0x1')]||{};}module[_0xd5e4('0x2')]=Interval; \ No newline at end of file +var _0xb29e=['name','Intervals','exports'];(function(_0x31ae2d,_0x249180){var _0x34c4c7=function(_0x2e8579){while(--_0x2e8579){_0x31ae2d['push'](_0x31ae2d['shift']());}};_0x34c4c7(++_0x249180);}(_0xb29e,0xba));var _0xeb29=function(_0x13f616,_0x516e0c){_0x13f616=_0x13f616-0x0;var _0x2be722=_0xb29e[_0x13f616];return _0x2be722;};'use strict';function Interval(_0x2816ef){this['id']=_0x2816ef['id']||0x0;this[_0xeb29('0x0')]=_0x2816ef[_0xeb29('0x0')]||'';this[_0xeb29('0x1')]=_0x2816ef[_0xeb29('0x1')]||{};}module[_0xeb29('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 24fda20..b20db07 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 _0x4cdc=['mapAgentsId','updateRouting','updateRealtime','prototype','map','loggedIn','paused','online','mailPause','available','waiting','emit','mail_queue:save','exports','lodash','md5','../../../config/environment','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents'];(function(_0x45cf3c,_0x3f1089){var _0x250318=function(_0x358a55){while(--_0x358a55){_0x45cf3c['push'](_0x45cf3c['shift']());}};_0x250318(++_0x3f1089);}(_0x4cdc,0x13a));var _0xc4cd=function(_0xba557f,_0x137880){_0xba557f=_0xba557f-0x0;var _0x120308=_0x4cdc[_0xba557f];return _0x120308;};'use strict';var _=require(_0xc4cd('0x0'));var md5=require(_0xc4cd('0x1'));var util=require('util');var Redis=require('ioredis');var config=require(_0xc4cd('0x2'));config[_0xc4cd('0x3')]=_['defaults'](config[_0xc4cd('0x3')],{'host':_0xc4cd('0x4'),'port':0x18eb});var io=require(_0xc4cd('0x5'))(new Redis(config[_0xc4cd('0x3')]));function MailQueue(_0xa1c2fa){this['id']=_0xa1c2fa['id']||0x0;this[_0xc4cd('0x6')]=_0xa1c2fa[_0xc4cd('0x6')]||'';this[_0xc4cd('0x7')]=_0xa1c2fa[_0xc4cd('0x7')]||0xa;this['strategy']=_0xa1c2fa[_0xc4cd('0x8')]||_0xc4cd('0x9');this['Agents']=_0xa1c2fa[_0xc4cd('0xa')];this[_0xc4cd('0xb')]={};this['waiting']=0x0;this[_0xc4cd('0x1')]='';this[_0xc4cd('0xc')]();this[_0xc4cd('0xd')]();}MailQueue[_0xc4cd('0xe')]['updateRouting']=function(){var _0x23ca14=this[_0xc4cd('0xb')]['_rr'];this[_0xc4cd('0xb')]=_[_0xc4cd('0xf')](this[_0xc4cd('0xa')],'id');this[_0xc4cd('0xb')]['_rr']=_0x23ca14;};MailQueue[_0xc4cd('0xe')][_0xc4cd('0xd')]=function(){this[_0xc4cd('0x10')]=0x0;this[_0xc4cd('0x11')]=0x0;for(var _0x1cc04b=0x0;_0x1cc04b=0x0?this[_0xc4cd('0x14')]:0x0;var _0xe20e3d={'id':this['id'],'available':this[_0xc4cd('0x14')],'loggedIn':this['loggedIn'],'name':this[_0xc4cd('0x6')],'paused':this['paused'],'waiting':this[_0xc4cd('0x15')]};var _0x4e2d08=md5(JSON['stringify'](_0xe20e3d));if(this[_0xc4cd('0x1')]!==_0x4e2d08){this[_0xc4cd('0x1')]=_0x4e2d08;io['to'](util['format']('mail:queue:%s',_0xe20e3d[_0xc4cd('0x6')]))[_0xc4cd('0x16')](_0xc4cd('0x17'),_0xe20e3d);}};module[_0xc4cd('0x18')]=MailQueue; \ No newline at end of file +var _0xb5a8=['stringify','format','mail:queue:%s','emit','exports','lodash','md5','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','loggedIn','paused','length','online','mailPause','available'];(function(_0x2def7d,_0xdb10a5){var _0x385f9f=function(_0x2518dc){while(--_0x2518dc){_0x2def7d['push'](_0x2def7d['shift']());}};_0x385f9f(++_0xdb10a5);}(_0xb5a8,0x81));var _0x8b5a=function(_0x138f59,_0x1b53fb){_0x138f59=_0x138f59-0x0;var _0x3d114d=_0xb5a8[_0x138f59];return _0x3d114d;};'use strict';var _=require(_0x8b5a('0x0'));var md5=require(_0x8b5a('0x1'));var util=require(_0x8b5a('0x2'));var Redis=require(_0x8b5a('0x3'));var config=require(_0x8b5a('0x4'));config['redis']=_[_0x8b5a('0x5')](config[_0x8b5a('0x6')],{'host':_0x8b5a('0x7'),'port':0x18eb});var io=require(_0x8b5a('0x8'))(new Redis(config[_0x8b5a('0x6')]));function MailQueue(_0x27b70b){this['id']=_0x27b70b['id']||0x0;this['name']=_0x27b70b[_0x8b5a('0x9')]||'';this[_0x8b5a('0xa')]=_0x27b70b['timeout']||0xa;this[_0x8b5a('0xb')]=_0x27b70b[_0x8b5a('0xb')]||_0x8b5a('0xc');this[_0x8b5a('0xd')]=_0x27b70b['Agents'];this[_0x8b5a('0xe')]={};this[_0x8b5a('0xf')]=0x0;this[_0x8b5a('0x1')]='';this[_0x8b5a('0x10')]();this[_0x8b5a('0x11')]();}MailQueue[_0x8b5a('0x12')][_0x8b5a('0x10')]=function(){var _0x483385=this[_0x8b5a('0xe')]['_rr'];this[_0x8b5a('0xe')]=_[_0x8b5a('0x13')](this[_0x8b5a('0xd')],'id');this[_0x8b5a('0xe')]['_rr']=_0x483385;};MailQueue['prototype'][_0x8b5a('0x11')]=function(){this[_0x8b5a('0x14')]=0x0;this[_0x8b5a('0x15')]=0x0;for(var _0x4155c2=0x0;_0x4155c2=0x0?this[_0x8b5a('0x19')]:0x0;var _0x47426e={'id':this['id'],'available':this[_0x8b5a('0x19')],'loggedIn':this[_0x8b5a('0x14')],'name':this['name'],'paused':this[_0x8b5a('0x15')],'waiting':this[_0x8b5a('0xf')]};var _0x7eaab5=md5(JSON[_0x8b5a('0x1a')](_0x47426e));if(this[_0x8b5a('0x1')]!==_0x7eaab5){this[_0x8b5a('0x1')]=_0x7eaab5;io['to'](util[_0x8b5a('0x1b')](_0x8b5a('0x1c'),_0x47426e['name']))[_0x8b5a('0x1d')]('mail_queue:save',_0x47426e);}};module[_0x8b5a('0x1e')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 0288d44..50fe10a 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 _0x06f6=['../../../config/environment','redis','name','timeout','strategy','Agents','mapAgentsId','waiting','updateRouting','map','prototype','updateRealtime','loggedIn','paused','length','online','available','stringify','format','openchannel:queue:%s','emit','openchannel_queue:save','exports','lodash','md5','util','ioredis'];(function(_0x35452a,_0x2bf767){var _0x35c53a=function(_0x399ad4){while(--_0x399ad4){_0x35452a['push'](_0x35452a['shift']());}};_0x35c53a(++_0x2bf767);}(_0x06f6,0x83));var _0x606f=function(_0x2fa4bf,_0x33119e){_0x2fa4bf=_0x2fa4bf-0x0;var _0x27d904=_0x06f6[_0x2fa4bf];return _0x27d904;};'use strict';var _=require(_0x606f('0x0'));var md5=require(_0x606f('0x1'));var util=require(_0x606f('0x2'));var Redis=require(_0x606f('0x3'));var config=require(_0x606f('0x4'));config[_0x606f('0x5')]=_['defaults'](config[_0x606f('0x5')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x606f('0x5')]));function OpenchannelQueue(_0x549806){this['id']=_0x549806['id']||0x0;this[_0x606f('0x6')]=_0x549806[_0x606f('0x6')]||'';this[_0x606f('0x7')]=_0x549806[_0x606f('0x7')]||0xa;this[_0x606f('0x8')]=_0x549806[_0x606f('0x8')]||'beepall';this['Agents']=_0x549806[_0x606f('0x9')];this[_0x606f('0xa')]={};this[_0x606f('0xb')]=0x0;this[_0x606f('0x1')]='';this[_0x606f('0xc')]();this['updateRealtime']();}OpenchannelQueue['prototype'][_0x606f('0xc')]=function(){var _0x289cd9=this[_0x606f('0xa')]['_rr'];this[_0x606f('0xa')]=_[_0x606f('0xd')](this[_0x606f('0x9')],'id');this[_0x606f('0xa')]['_rr']=_0x289cd9;};OpenchannelQueue[_0x606f('0xe')][_0x606f('0xf')]=function(){this[_0x606f('0x10')]=0x0;this[_0x606f('0x11')]=0x0;for(var _0x25c0d7=0x0;_0x25c0d7=0x0?this[_0x606f('0x14')]:0x0;var _0x5ebff6={'id':this['id'],'available':this['available'],'loggedIn':this[_0x606f('0x10')],'name':this[_0x606f('0x6')],'paused':this[_0x606f('0x11')],'waiting':this[_0x606f('0xb')]};var _0x4587c3=md5(JSON[_0x606f('0x15')](_0x5ebff6));if(this[_0x606f('0x1')]!==_0x4587c3){this['md5']=_0x4587c3;io['to'](util[_0x606f('0x16')](_0x606f('0x17'),_0x5ebff6['name']))[_0x606f('0x18')](_0x606f('0x19'),_0x5ebff6);}};module[_0x606f('0x1a')]=OpenchannelQueue; \ No newline at end of file +var _0x154d=['paused','openchannelPause','available','stringify','openchannel:queue:%s','emit','openchannel_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','loggedIn'];(function(_0x425969,_0x5efd79){var _0x56b57f=function(_0x19cb61){while(--_0x19cb61){_0x425969['push'](_0x425969['shift']());}};_0x56b57f(++_0x5efd79);}(_0x154d,0x15a));var _0xd154=function(_0x26438a,_0x3e0a2c){_0x26438a=_0x26438a-0x0;var _0x2e95df=_0x154d[_0x26438a];return _0x2e95df;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0xd154('0x0'));var Redis=require(_0xd154('0x1'));var config=require(_0xd154('0x2'));config[_0xd154('0x3')]=_[_0xd154('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xd154('0x5'))(new Redis(config['redis']));function OpenchannelQueue(_0x265a6b){this['id']=_0x265a6b['id']||0x0;this['name']=_0x265a6b[_0xd154('0x6')]||'';this['timeout']=_0x265a6b['timeout']||0xa;this[_0xd154('0x7')]=_0x265a6b['strategy']||_0xd154('0x8');this[_0xd154('0x9')]=_0x265a6b['Agents'];this[_0xd154('0xa')]={};this[_0xd154('0xb')]=0x0;this[_0xd154('0xc')]='';this['updateRouting']();this[_0xd154('0xd')]();}OpenchannelQueue[_0xd154('0xe')][_0xd154('0xf')]=function(){var _0x4175c9=this[_0xd154('0xa')]['_rr'];this[_0xd154('0xa')]=_['map'](this[_0xd154('0x9')],'id');this['mapAgentsId'][_0xd154('0x10')]=_0x4175c9;};OpenchannelQueue['prototype']['updateRealtime']=function(){this[_0xd154('0x11')]=0x0;this[_0xd154('0x12')]=0x0;for(var _0x3c151f=0x0;_0x3c151f=0x0?this[_0xd154('0x14')]:0x0;var _0x520971={'id':this['id'],'available':this[_0xd154('0x14')],'loggedIn':this[_0xd154('0x11')],'name':this['name'],'paused':this[_0xd154('0x12')],'waiting':this[_0xd154('0xb')]};var _0xd4f72c=md5(JSON[_0xd154('0x15')](_0x520971));if(this[_0xd154('0xc')]!==_0xd4f72c){this[_0xd154('0xc')]=_0xd4f72c;io['to'](util['format'](_0xd154('0x16'),_0x520971['name']))[_0xd154('0x17')](_0xd154('0x18'),_0x520971);}};module[_0xd154('0x19')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 923a53a..8bed425 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 _0x0713=['smsPause','paused','available','stringify','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online'];(function(_0x7b8b30,_0x4b1733){var _0x290315=function(_0x1d2185){while(--_0x1d2185){_0x7b8b30['push'](_0x7b8b30['shift']());}};_0x290315(++_0x4b1733);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x3071('0x0'));var Redis=require(_0x3071('0x1'));var config=require(_0x3071('0x2'));config[_0x3071('0x3')]=_[_0x3071('0x4')](config['redis'],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x3')]));function SmsQueue(_0x3137c8){this['id']=_0x3137c8['id']||0x0;this[_0x3071('0x7')]=_0x3137c8[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x3137c8[_0x3071('0x8')]||0xa;this[_0x3071('0x9')]=_0x3137c8[_0x3071('0x9')]||_0x3071('0xa');this[_0x3071('0xb')]=_0x3137c8[_0x3071('0xb')];this['mapAgentsId']={};this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]='';this[_0x3071('0xe')]();this[_0x3071('0xf')]();}SmsQueue[_0x3071('0x10')]['updateRouting']=function(){var _0x2ace21=this[_0x3071('0x11')][_0x3071('0x12')];this[_0x3071('0x11')]=_[_0x3071('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x3071('0x12')]=_0x2ace21;};SmsQueue['prototype'][_0x3071('0xf')]=function(){this[_0x3071('0x14')]=0x0;this['paused']=0x0;for(var _0x104e73=0x0;_0x104e73=0x0?this[_0x3071('0x19')]:0x0;var _0x1068d9={'id':this['id'],'available':this[_0x3071('0x19')],'loggedIn':this[_0x3071('0x14')],'name':this[_0x3071('0x7')],'paused':this[_0x3071('0x18')],'waiting':this[_0x3071('0xc')]};var _0x502a16=md5(JSON[_0x3071('0x1a')](_0x1068d9));if(this[_0x3071('0xd')]!==_0x502a16){this[_0x3071('0xd')]=_0x502a16;io['to'](util['format'](_0x3071('0x1b'),_0x1068d9['name']))[_0x3071('0x1c')](_0x3071('0x1d'),_0x1068d9);}};module[_0x3071('0x1e')]=SmsQueue; \ No newline at end of file +var _0xb7e7=['util','../../../config/environment','defaults','localhost','socket.io-emitter','redis','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','updateRealtime','prototype','updateRouting','_rr','map','loggedIn','length','online','paused','available','stringify','sms:queue:%s','emit','exports','lodash'];(function(_0x481812,_0x34f7a5){var _0xfcbc4b=function(_0xaab71b){while(--_0xaab71b){_0x481812['push'](_0x481812['shift']());}};_0xfcbc4b(++_0x34f7a5);}(_0xb7e7,0x121));var _0x7b7e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xb7e7[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x7b7e('0x0'));var md5=require('md5');var util=require(_0x7b7e('0x1'));var Redis=require('ioredis');var config=require(_0x7b7e('0x2'));config['redis']=_[_0x7b7e('0x3')](config['redis'],{'host':_0x7b7e('0x4'),'port':0x18eb});var io=require(_0x7b7e('0x5'))(new Redis(config[_0x7b7e('0x6')]));function SmsQueue(_0x52047f){this['id']=_0x52047f['id']||0x0;this['name']=_0x52047f[_0x7b7e('0x7')]||'';this[_0x7b7e('0x8')]=_0x52047f[_0x7b7e('0x8')]||0xa;this['strategy']=_0x52047f[_0x7b7e('0x9')]||_0x7b7e('0xa');this[_0x7b7e('0xb')]=_0x52047f[_0x7b7e('0xb')];this[_0x7b7e('0xc')]={};this[_0x7b7e('0xd')]=0x0;this[_0x7b7e('0xe')]='';this['updateRouting']();this[_0x7b7e('0xf')]();}SmsQueue[_0x7b7e('0x10')][_0x7b7e('0x11')]=function(){var _0x29b622=this[_0x7b7e('0xc')][_0x7b7e('0x12')];this[_0x7b7e('0xc')]=_[_0x7b7e('0x13')](this[_0x7b7e('0xb')],'id');this['mapAgentsId'][_0x7b7e('0x12')]=_0x29b622;};SmsQueue[_0x7b7e('0x10')]['updateRealtime']=function(){this[_0x7b7e('0x14')]=0x0;this['paused']=0x0;for(var _0x4c6011=0x0;_0x4c6011=0x0?this[_0x7b7e('0x18')]:0x0;var _0x200ef7={'id':this['id'],'available':this[_0x7b7e('0x18')],'loggedIn':this[_0x7b7e('0x14')],'name':this[_0x7b7e('0x7')],'paused':this[_0x7b7e('0x17')],'waiting':this[_0x7b7e('0xd')]};var _0x3bec7d=md5(JSON[_0x7b7e('0x19')](_0x200ef7));if(this[_0x7b7e('0xe')]!==_0x3bec7d){this[_0x7b7e('0xe')]=_0x3bec7d;io['to'](util['format'](_0x7b7e('0x1a'),_0x200ef7[_0x7b7e('0x7')]))[_0x7b7e('0x1b')]('sms_queue:save',_0x200ef7);}};module[_0x7b7e('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index 80378f3..39bd30b 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 _0xbefd=['intervals','openchannelQueues','chatQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','hasOwnProperty','prototype','initAgents','length','isUndefined','initIntervals','mergeFromDatabase','updateRouting','initChatQueues','updateRealtime','initSmsQueues','smsQueues','initMailQueues','initFaxQueues','bluebird','util','lodash','moment','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/mailQueue','agents'];(function(_0x21c1f2,_0x1c307c){var _0x54d10e=function(_0x3b5560){while(--_0x3b5560){_0x21c1f2['push'](_0x21c1f2['shift']());}};_0x54d10e(++_0x1c307c);}(_0xbefd,0x117));var _0xdbef=function(_0x5bb9a8,_0xce86ee){_0x5bb9a8=_0x5bb9a8-0x0;var _0x4bf7f3=_0xbefd[_0x5bb9a8];return _0x4bf7f3;};'use strict';var BPromise=require(_0xdbef('0x0'));var util=require(_0xdbef('0x1'));var _=require(_0xdbef('0x2'));var moment=require(_0xdbef('0x3'));var Agent=require('../model/agent');var Interval=require(_0xdbef('0x4'));var OpenchannelQueue=require(_0xdbef('0x5'));var ChatQueue=require(_0xdbef('0x6'));var SmsQueue=require('../model/smsQueue');var MailQueue=require(_0xdbef('0x7'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0xdbef('0x8')]={};this[_0xdbef('0x9')]={};this[_0xdbef('0xa')]={};this[_0xdbef('0xb')]={};this['smsQueues']={};this[_0xdbef('0xc')]={};this[_0xdbef('0xd')]={};this[_0xdbef('0xe')]={};this['mailQueuesWaitingInteractions']={};this[_0xdbef('0xf')]={};this['smsQueuesWaitingInteractions']={};this[_0xdbef('0x10')]={};};function freeIsNotKey(_0x158242,_0x16b563,_0x1a9760){var _0x33af93=_[_0xdbef('0x11')](_0x158242,function(_0xf6848f,_0x7c5d0){return _0xf6848f[_0x1a9760];});for(var _0xc5f348 in _0x16b563){if(_0x16b563[_0xdbef('0x12')](_0xc5f348)){if(!_0x33af93[_0xc5f348]){delete _0x16b563[_0xc5f348];}}}}Realtime[_0xdbef('0x13')]['mergeFromDatabase']=function(_0x55967e,_0x283070){for(var _0x3d97a4 in _0x283070){if(_0x55967e['hasOwnProperty'](_0x3d97a4)){_0x55967e[_0x3d97a4]=_0x283070[_0x3d97a4];}}};Realtime[_0xdbef('0x13')][_0xdbef('0x14')]=function(){var _0x3cf25c=this;return function(_0x4aca72){if(_0x4aca72){freeIsNotKey(_0x4aca72,_0x3cf25c[_0xdbef('0x8')],'id');for(var _0x9f9d2a=0x0,_0x108db1={},_0x53aeab={};_0x9f9d2a<_0x4aca72[_0xdbef('0x15')];_0x9f9d2a+=0x1){_0x108db1=_0x4aca72[_0x9f9d2a];if(_[_0xdbef('0x16')](_0x3cf25c[_0xdbef('0x8')][_0x108db1['id']])){_0x3cf25c[_0xdbef('0x8')][_0x108db1['id']]=new Agent(_0x108db1);}else{_0x3cf25c['mergeFromDatabase'](_0x3cf25c[_0xdbef('0x8')][_0x108db1['id']],_0x108db1);}}}return _0x3cf25c[_0xdbef('0x8')];};};Realtime[_0xdbef('0x13')][_0xdbef('0x17')]=function(){var _0x2b64ed=this;return function(_0x17f265){if(_0x17f265){freeIsNotKey(_0x17f265,_0x2b64ed[_0xdbef('0x9')],'id');for(var _0x35ba3c=0x0,_0x5e0b2d={},_0xbdb210={};_0x35ba3c<_0x17f265[_0xdbef('0x15')];_0x35ba3c+=0x1){_0x5e0b2d=_0x17f265[_0x35ba3c];if(_[_0xdbef('0x16')](_0x2b64ed[_0xdbef('0x9')][_0x5e0b2d['id']])){_0x2b64ed[_0xdbef('0x9')][_0x5e0b2d['id']]=new Interval(_0x5e0b2d);}else{_0x2b64ed['mergeFromDatabase'](_0x2b64ed[_0xdbef('0x9')][_0x5e0b2d['id']],_0x5e0b2d);}}}return _0x2b64ed[_0xdbef('0x9')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x2b6adb=this;return function(_0x2d7ae9){if(_0x2d7ae9){freeIsNotKey(_0x2d7ae9,_0x2b6adb[_0xdbef('0xa')],'id');for(var _0x529cb6=0x0,_0xd6d53e={},_0x1cbe58={};_0x529cb6<_0x2d7ae9['length'];_0x529cb6+=0x1){_0xd6d53e=_0x2d7ae9[_0x529cb6];if(_[_0xdbef('0x16')](_0x2b6adb[_0xdbef('0xa')][_0xd6d53e['id']])){_0x2b6adb[_0xdbef('0xa')][_0xd6d53e['id']]=new OpenchannelQueue(_0xd6d53e);}else{_0x2b6adb[_0xdbef('0x18')](_0x2b6adb[_0xdbef('0xa')][_0xd6d53e['id']],_0xd6d53e);}_0x2b6adb[_0xdbef('0xa')][_0xd6d53e['id']][_0xdbef('0x19')]();_0x2b6adb[_0xdbef('0xa')][_0xd6d53e['id']]['updateRealtime']();}}return _0x2b6adb[_0xdbef('0xa')];};};Realtime[_0xdbef('0x13')][_0xdbef('0x1a')]=function(){var _0x51802f=this;return function(_0x591b47){if(_0x591b47){freeIsNotKey(_0x591b47,_0x51802f[_0xdbef('0xb')],'id');for(var _0x40001f=0x0,_0x42a2fe={},_0x121815={};_0x40001f<_0x591b47[_0xdbef('0x15')];_0x40001f+=0x1){_0x42a2fe=_0x591b47[_0x40001f];if(_[_0xdbef('0x16')](_0x51802f[_0xdbef('0xb')][_0x42a2fe['id']])){_0x51802f[_0xdbef('0xb')][_0x42a2fe['id']]=new ChatQueue(_0x42a2fe);}else{_0x51802f['mergeFromDatabase'](_0x51802f['chatQueues'][_0x42a2fe['id']],_0x42a2fe);}_0x51802f['chatQueues'][_0x42a2fe['id']]['updateRouting']();_0x51802f['chatQueues'][_0x42a2fe['id']][_0xdbef('0x1b')]();}}return _0x51802f[_0xdbef('0xb')];};};Realtime[_0xdbef('0x13')][_0xdbef('0x1c')]=function(){var _0x17f6d0=this;return function(_0x12bf63){if(_0x12bf63){freeIsNotKey(_0x12bf63,_0x17f6d0[_0xdbef('0x1d')],'id');for(var _0x11b98a=0x0,_0x5830e4={},_0x411aed={};_0x11b98a<_0x12bf63[_0xdbef('0x15')];_0x11b98a+=0x1){_0x5830e4=_0x12bf63[_0x11b98a];if(_[_0xdbef('0x16')](_0x17f6d0['smsQueues'][_0x5830e4['id']])){_0x17f6d0[_0xdbef('0x1d')][_0x5830e4['id']]=new SmsQueue(_0x5830e4);}else{_0x17f6d0[_0xdbef('0x18')](_0x17f6d0[_0xdbef('0x1d')][_0x5830e4['id']],_0x5830e4);}_0x17f6d0[_0xdbef('0x1d')][_0x5830e4['id']][_0xdbef('0x19')]();_0x17f6d0[_0xdbef('0x1d')][_0x5830e4['id']][_0xdbef('0x1b')]();}}return _0x17f6d0[_0xdbef('0x1d')];};};Realtime[_0xdbef('0x13')][_0xdbef('0x1e')]=function(){var _0x1f903c=this;return function(_0x4113e3){if(_0x4113e3){freeIsNotKey(_0x4113e3,_0x1f903c[_0xdbef('0xc')],'id');for(var _0x322e0b=0x0,_0x137b9e={},_0x1a3d5b={};_0x322e0b<_0x4113e3[_0xdbef('0x15')];_0x322e0b+=0x1){_0x137b9e=_0x4113e3[_0x322e0b];if(_[_0xdbef('0x16')](_0x1f903c[_0xdbef('0xc')][_0x137b9e['id']])){_0x1f903c[_0xdbef('0xc')][_0x137b9e['id']]=new MailQueue(_0x137b9e);}else{_0x1f903c['mergeFromDatabase'](_0x1f903c['mailQueues'][_0x137b9e['id']],_0x137b9e);}_0x1f903c[_0xdbef('0xc')][_0x137b9e['id']][_0xdbef('0x19')]();_0x1f903c['mailQueues'][_0x137b9e['id']][_0xdbef('0x1b')]();}}return _0x1f903c[_0xdbef('0xc')];};};Realtime[_0xdbef('0x13')][_0xdbef('0x1f')]=function(){var _0xce7513=this;return function(_0x7d5df2){if(_0x7d5df2){freeIsNotKey(_0x7d5df2,_0xce7513[_0xdbef('0xd')],'id');for(var _0x20a731=0x0,_0x3626c1={},_0x59e94d={};_0x20a731<_0x7d5df2['length'];_0x20a731+=0x1){_0x3626c1=_0x7d5df2[_0x20a731];if(_[_0xdbef('0x16')](_0xce7513[_0xdbef('0xd')][_0x3626c1['id']])){_0xce7513[_0xdbef('0xd')][_0x3626c1['id']]=new FaxQueue(_0x3626c1);}else{_0xce7513[_0xdbef('0x18')](_0xce7513[_0xdbef('0xd')][_0x3626c1['id']],_0x3626c1);}_0xce7513[_0xdbef('0xd')][_0x3626c1['id']][_0xdbef('0x19')]();_0xce7513[_0xdbef('0xd')][_0x3626c1['id']][_0xdbef('0x1b')]();}}return _0xce7513[_0xdbef('0xd')];};};module['exports']=Realtime; \ No newline at end of file +var _0x1647=['mergeFromDatabase','initAgents','length','agents','initIntervals','intervals','isUndefined','initChatQueues','updateRealtime','initSmsQueues','smsQueues','updateRouting','initMailQueues','exports','bluebird','util','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','openchannelQueues','chatQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','prototype'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x1647,0x179));var _0x7164=function(_0x22c190,_0x1a8400){_0x22c190=_0x22c190-0x0;var _0x24f80f=_0x1647[_0x22c190];return _0x24f80f;};'use strict';var BPromise=require(_0x7164('0x0'));var util=require(_0x7164('0x1'));var _=require('lodash');var moment=require(_0x7164('0x2'));var Agent=require(_0x7164('0x3'));var Interval=require(_0x7164('0x4'));var OpenchannelQueue=require(_0x7164('0x5'));var ChatQueue=require(_0x7164('0x6'));var SmsQueue=require(_0x7164('0x7'));var MailQueue=require(_0x7164('0x8'));var FaxQueue=require(_0x7164('0x9'));var Realtime=function(){this['agents']={};this['intervals']={};this[_0x7164('0xa')]={};this[_0x7164('0xb')]={};this['smsQueues']={};this[_0x7164('0xc')]={};this[_0x7164('0xd')]={};this[_0x7164('0xe')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0x7164('0xf')]={};this[_0x7164('0x10')]={};};function freeIsNotKey(_0x22bf11,_0x38de64,_0x446426){var _0x2b1c70=_['mapKeys'](_0x22bf11,function(_0x4ff03e,_0x1bf520){return _0x4ff03e[_0x446426];});for(var _0x283d3e in _0x38de64){if(_0x38de64[_0x7164('0x11')](_0x283d3e)){if(!_0x2b1c70[_0x283d3e]){delete _0x38de64[_0x283d3e];}}}}Realtime[_0x7164('0x12')][_0x7164('0x13')]=function(_0x744527,_0x31351e){for(var _0x25f60c in _0x31351e){if(_0x744527[_0x7164('0x11')](_0x25f60c)){_0x744527[_0x25f60c]=_0x31351e[_0x25f60c];}}};Realtime[_0x7164('0x12')][_0x7164('0x14')]=function(){var _0x415b73=this;return function(_0x1bc01b){if(_0x1bc01b){freeIsNotKey(_0x1bc01b,_0x415b73['agents'],'id');for(var _0x4099cf=0x0,_0x1b29e4={},_0x2a211b={};_0x4099cf<_0x1bc01b[_0x7164('0x15')];_0x4099cf+=0x1){_0x1b29e4=_0x1bc01b[_0x4099cf];if(_['isUndefined'](_0x415b73[_0x7164('0x16')][_0x1b29e4['id']])){_0x415b73['agents'][_0x1b29e4['id']]=new Agent(_0x1b29e4);}else{_0x415b73['mergeFromDatabase'](_0x415b73[_0x7164('0x16')][_0x1b29e4['id']],_0x1b29e4);}}}return _0x415b73[_0x7164('0x16')];};};Realtime[_0x7164('0x12')][_0x7164('0x17')]=function(){var _0x176f52=this;return function(_0x2576ab){if(_0x2576ab){freeIsNotKey(_0x2576ab,_0x176f52[_0x7164('0x18')],'id');for(var _0x146a94=0x0,_0x164045={},_0x375ba6={};_0x146a94<_0x2576ab[_0x7164('0x15')];_0x146a94+=0x1){_0x164045=_0x2576ab[_0x146a94];if(_[_0x7164('0x19')](_0x176f52[_0x7164('0x18')][_0x164045['id']])){_0x176f52[_0x7164('0x18')][_0x164045['id']]=new Interval(_0x164045);}else{_0x176f52[_0x7164('0x13')](_0x176f52[_0x7164('0x18')][_0x164045['id']],_0x164045);}}}return _0x176f52[_0x7164('0x18')];};};Realtime[_0x7164('0x12')]['initOpenchannelQueues']=function(){var _0x3a382b=this;return function(_0x19f6c9){if(_0x19f6c9){freeIsNotKey(_0x19f6c9,_0x3a382b[_0x7164('0xa')],'id');for(var _0x1c4ae7=0x0,_0x47b715={},_0x212882={};_0x1c4ae7<_0x19f6c9[_0x7164('0x15')];_0x1c4ae7+=0x1){_0x47b715=_0x19f6c9[_0x1c4ae7];if(_[_0x7164('0x19')](_0x3a382b[_0x7164('0xa')][_0x47b715['id']])){_0x3a382b[_0x7164('0xa')][_0x47b715['id']]=new OpenchannelQueue(_0x47b715);}else{_0x3a382b[_0x7164('0x13')](_0x3a382b['openchannelQueues'][_0x47b715['id']],_0x47b715);}_0x3a382b['openchannelQueues'][_0x47b715['id']]['updateRouting']();_0x3a382b[_0x7164('0xa')][_0x47b715['id']]['updateRealtime']();}}return _0x3a382b['openchannelQueues'];};};Realtime[_0x7164('0x12')][_0x7164('0x1a')]=function(){var _0x376af3=this;return function(_0x18e703){if(_0x18e703){freeIsNotKey(_0x18e703,_0x376af3[_0x7164('0xb')],'id');for(var _0x5bf63e=0x0,_0x15e49c={},_0x8e9609={};_0x5bf63e<_0x18e703['length'];_0x5bf63e+=0x1){_0x15e49c=_0x18e703[_0x5bf63e];if(_[_0x7164('0x19')](_0x376af3[_0x7164('0xb')][_0x15e49c['id']])){_0x376af3[_0x7164('0xb')][_0x15e49c['id']]=new ChatQueue(_0x15e49c);}else{_0x376af3[_0x7164('0x13')](_0x376af3['chatQueues'][_0x15e49c['id']],_0x15e49c);}_0x376af3[_0x7164('0xb')][_0x15e49c['id']]['updateRouting']();_0x376af3[_0x7164('0xb')][_0x15e49c['id']][_0x7164('0x1b')]();}}return _0x376af3[_0x7164('0xb')];};};Realtime[_0x7164('0x12')][_0x7164('0x1c')]=function(){var _0x2e08dc=this;return function(_0x77464e){if(_0x77464e){freeIsNotKey(_0x77464e,_0x2e08dc[_0x7164('0x1d')],'id');for(var _0x5c3c91=0x0,_0x25af2e={},_0x39278e={};_0x5c3c91<_0x77464e['length'];_0x5c3c91+=0x1){_0x25af2e=_0x77464e[_0x5c3c91];if(_[_0x7164('0x19')](_0x2e08dc['smsQueues'][_0x25af2e['id']])){_0x2e08dc[_0x7164('0x1d')][_0x25af2e['id']]=new SmsQueue(_0x25af2e);}else{_0x2e08dc[_0x7164('0x13')](_0x2e08dc[_0x7164('0x1d')][_0x25af2e['id']],_0x25af2e);}_0x2e08dc[_0x7164('0x1d')][_0x25af2e['id']][_0x7164('0x1e')]();_0x2e08dc[_0x7164('0x1d')][_0x25af2e['id']]['updateRealtime']();}}return _0x2e08dc[_0x7164('0x1d')];};};Realtime[_0x7164('0x12')][_0x7164('0x1f')]=function(){var _0xf34b07=this;return function(_0x70ee04){if(_0x70ee04){freeIsNotKey(_0x70ee04,_0xf34b07[_0x7164('0xc')],'id');for(var _0x24394f=0x0,_0x16f5e={},_0x46bf98={};_0x24394f<_0x70ee04[_0x7164('0x15')];_0x24394f+=0x1){_0x16f5e=_0x70ee04[_0x24394f];if(_['isUndefined'](_0xf34b07[_0x7164('0xc')][_0x16f5e['id']])){_0xf34b07[_0x7164('0xc')][_0x16f5e['id']]=new MailQueue(_0x16f5e);}else{_0xf34b07['mergeFromDatabase'](_0xf34b07[_0x7164('0xc')][_0x16f5e['id']],_0x16f5e);}_0xf34b07[_0x7164('0xc')][_0x16f5e['id']][_0x7164('0x1e')]();_0xf34b07[_0x7164('0xc')][_0x16f5e['id']][_0x7164('0x1b')]();}}return _0xf34b07[_0x7164('0xc')];};};Realtime['prototype']['initFaxQueues']=function(){var _0x3497d5=this;return function(_0xe78ba3){if(_0xe78ba3){freeIsNotKey(_0xe78ba3,_0x3497d5[_0x7164('0xd')],'id');for(var _0x331c35=0x0,_0x55e4fe={},_0x463450={};_0x331c35<_0xe78ba3[_0x7164('0x15')];_0x331c35+=0x1){_0x55e4fe=_0xe78ba3[_0x331c35];if(_[_0x7164('0x19')](_0x3497d5['faxQueues'][_0x55e4fe['id']])){_0x3497d5['faxQueues'][_0x55e4fe['id']]=new FaxQueue(_0x55e4fe);}else{_0x3497d5[_0x7164('0x13')](_0x3497d5[_0x7164('0xd')][_0x55e4fe['id']],_0x55e4fe);}_0x3497d5[_0x7164('0xd')][_0x55e4fe['id']][_0x7164('0x1e')]();_0x3497d5[_0x7164('0xd')][_0x55e4fe['id']]['updateRealtime']();}}return _0x3497d5[_0x7164('0xd')];};};module[_0x7164('0x20')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 427794f..4be35cf 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 _0x6802=['update','Request','UpdateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction'];(function(_0x5a0095,_0x215325){var _0x208109=function(_0x753673){while(--_0x753673){_0x5a0095['push'](_0x5a0095['shift']());}};_0x208109(++_0x215325);}(_0x6802,0x132));var _0x2680=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0x6802[_0x24061a];return _0x82054e;};'use strict';var client=require('../client');exports[_0x2680('0x0')]=function(_0x16cbb,_0x3316e0){return client[_0x2680('0x1')](_0x2680('0x2'),{'body':_0x3316e0,'options':{'where':{'id':_0x16cbb}},'log':'updateChatInteraction'});};exports[_0x2680('0x3')]=function(_0x2bde33,_0x1a5b15){return client[_0x2680('0x1')](_0x2680('0x4'),{'body':_0x1a5b15,'options':{'where':{'id':_0x2bde33}},'log':_0x2680('0x5')});}; \ No newline at end of file +var _0x0fdd=['AddTagsToChatInteraction','addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x0fdd,0x128));var _0xd0fd=function(_0x245f12,_0xb5fc22){_0x245f12=_0x245f12-0x0;var _0x5bab00=_0x0fdd[_0x245f12];return _0x5bab00;};'use strict';var client=require('../client');exports[_0xd0fd('0x0')]=function(_0x43c2c8,_0x122e4f){return client[_0xd0fd('0x1')](_0xd0fd('0x2'),{'body':_0x122e4f,'options':{'where':{'id':_0x43c2c8}},'log':_0xd0fd('0x3')});};exports['addTags']=function(_0x12b728,_0x2f64c5){return client['Request'](_0xd0fd('0x4'),{'body':_0x2f64c5,'options':{'where':{'id':_0x12b728}},'log':_0xd0fd('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 9b767b6..a11ccca 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 _0x024c=['Request','createChatMessage','../client','create'];(function(_0x34721a,_0x113a2c){var _0x2d959f=function(_0x2e0983){while(--_0x2e0983){_0x34721a['push'](_0x34721a['shift']());}};_0x2d959f(++_0x113a2c);}(_0x024c,0x136));var _0xc024=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x024c[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xc024('0x0'));exports[_0xc024('0x1')]=function(_0x3b623b){return client[_0xc024('0x2')]('CreateChatMessage',{'body':_0x3b623b,'log':_0xc024('0x3')});}; \ No newline at end of file +var _0x1443=['../client','CreateChatMessage','createChatMessage'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x1443,0x192));var _0x3144=function(_0xc4e87d,_0x513ce2){_0xc4e87d=_0xc4e87d-0x0;var _0xd8029e=_0x1443[_0xc4e87d];return _0xd8029e;};'use strict';var client=require(_0x3144('0x0'));exports['create']=function(_0x4a0d41){return client['Request'](_0x3144('0x1'),{'body':_0x4a0d41,'log':_0x3144('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 1308f1d..86c1e8c 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 _0x283e=['online','chatPause','../client','name','timeout','strategy'];(function(_0x1dad91,_0x36018c){var _0x2afb41=function(_0x19657e){while(--_0x19657e){_0x1dad91['push'](_0x1dad91['shift']());}};_0x2afb41(++_0x36018c);}(_0x283e,0x104));var _0xe283=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x283e[_0x14add3];return _0x4a174f;};'use strict';var client=require(_0xe283('0x0'));exports['getChatQueues']=function(){return function(){return client['Request']('GetChatQueue',{'options':{'raw':![],'attributes':['id',_0xe283('0x1'),_0xe283('0x2'),_0xe283('0x3')],'include':[{'model':'User','as':'Agents','attributes':['id',_0xe283('0x1'),_0xe283('0x4'),_0xe283('0x5')]}]},'log':'getChatQueues'});};}; \ No newline at end of file +var _0x195d=['name','strategy','User','chatPause','../client','getChatQueues','Request','GetChatQueue'];(function(_0xe61c85,_0x41e829){var _0x3fc3dd=function(_0x1f2d23){while(--_0x1f2d23){_0xe61c85['push'](_0xe61c85['shift']());}};_0x3fc3dd(++_0x41e829);}(_0x195d,0x1c4));var _0xd195=function(_0x3b7a0c,_0xf1a4c2){_0x3b7a0c=_0x3b7a0c-0x0;var _0x3bb70f=_0x195d[_0x3b7a0c];return _0x3bb70f;};'use strict';var client=require(_0xd195('0x0'));exports[_0xd195('0x1')]=function(){return function(){return client[_0xd195('0x2')](_0xd195('0x3'),{'options':{'raw':![],'attributes':['id',_0xd195('0x4'),'timeout',_0xd195('0x5')],'include':[{'model':_0xd195('0x6'),'as':'Agents','attributes':['id','name','online',_0xd195('0x7')]}]},'log':_0xd195('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index def3356..33ed32f 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 _0x684c=['DESC','../client','create','Request','CreateChatQueueReport','update','UpdateChatQueueReport'];(function(_0x2f3570,_0x4d7940){var _0x5bbab8=function(_0xf7e8e1){while(--_0xf7e8e1){_0x2f3570['push'](_0x2f3570['shift']());}};_0x5bbab8(++_0x4d7940);}(_0x684c,0x1b3));var _0xc684=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x684c[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xc684('0x0'));exports[_0xc684('0x1')]=function(_0x5a7a5a){return client[_0xc684('0x2')](_0xc684('0x3'),{'body':_0x5a7a5a,'log':_0xc684('0x3')});};exports[_0xc684('0x4')]=function(_0x2c50cf,_0x4a3536){return client[_0xc684('0x2')](_0xc684('0x5'),{'body':_0x4a3536,'options':{'where':{'uniqueid':_0x2c50cf},'order':[['id',_0xc684('0x6')]],'limit':0x1},'log':_0xc684('0x5')});}; \ No newline at end of file +var _0xae79=['Request','CreateChatQueueReport','update','UpdateChatQueueReport','DESC','../client','create'];(function(_0x512fa9,_0x368a57){var _0x506d9f=function(_0x2bf375){while(--_0x2bf375){_0x512fa9['push'](_0x512fa9['shift']());}};_0x506d9f(++_0x368a57);}(_0xae79,0x1d3));var _0x9ae7=function(_0x53d8f2,_0x213fa7){_0x53d8f2=_0x53d8f2-0x0;var _0x26a953=_0xae79[_0x53d8f2];return _0x26a953;};'use strict';var client=require(_0x9ae7('0x0'));exports[_0x9ae7('0x1')]=function(_0x799af5){return client[_0x9ae7('0x2')](_0x9ae7('0x3'),{'body':_0x799af5,'log':_0x9ae7('0x3')});};exports[_0x9ae7('0x4')]=function(_0x43f4d9,_0x988f5e){return client[_0x9ae7('0x2')](_0x9ae7('0x5'),{'body':_0x988f5e,'options':{'where':{'uniqueid':_0x43f4d9},'order':[['id',_0x9ae7('0x6')]],'limit':0x1},'log':_0x9ae7('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 3243d61..c2443e5 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 _0x727d=['Request','UpdateFaxInteraction','updateFaxInteraction','addTags','AddTagsToFaxInteraction','addTagsToFaxInteraction','update'];(function(_0x25d386,_0x108d0d){var _0x857f4a=function(_0x3eb98d){while(--_0x3eb98d){_0x25d386['push'](_0x25d386['shift']());}};_0x857f4a(++_0x108d0d);}(_0x727d,0xbc));var _0xd727=function(_0x44460,_0x3726a2){_0x44460=_0x44460-0x0;var _0x3d52dc=_0x727d[_0x44460];return _0x3d52dc;};'use strict';var client=require('../client');exports[_0xd727('0x0')]=function(_0x21b971,_0x25c927){return client[_0xd727('0x1')](_0xd727('0x2'),{'body':_0x25c927,'options':{'where':{'id':_0x21b971}},'log':_0xd727('0x3')});};exports[_0xd727('0x4')]=function(_0x94ce47,_0x3b5da4){return client[_0xd727('0x1')](_0xd727('0x5'),{'body':_0x3b5da4,'options':{'where':{'id':_0x94ce47}},'log':_0xd727('0x6')});}; \ No newline at end of file +var _0xc5e2=['../client','update','Request','UpdateFaxInteraction','addTags','AddTagsToFaxInteraction'];(function(_0x4f8d3e,_0x4d3732){var _0x388eae=function(_0x25736a){while(--_0x25736a){_0x4f8d3e['push'](_0x4f8d3e['shift']());}};_0x388eae(++_0x4d3732);}(_0xc5e2,0x17a));var _0x2c5e=function(_0x5360fa,_0x26530e){_0x5360fa=_0x5360fa-0x0;var _0x5a5200=_0xc5e2[_0x5360fa];return _0x5a5200;};'use strict';var client=require(_0x2c5e('0x0'));exports[_0x2c5e('0x1')]=function(_0x47de8f,_0x8695eb){return client[_0x2c5e('0x2')](_0x2c5e('0x3'),{'body':_0x8695eb,'options':{'where':{'id':_0x47de8f}},'log':'updateFaxInteraction'});};exports[_0x2c5e('0x4')]=function(_0x4f81fe,_0x27bdab){return client[_0x2c5e('0x2')](_0x2c5e('0x5'),{'body':_0x27bdab,'options':{'where':{'id':_0x4f81fe}},'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 5a33c2f..b2decec 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 _0x9433=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x546a88,_0x48d512){var _0x60ec43=function(_0x39d2e8){while(--_0x39d2e8){_0x546a88['push'](_0x546a88['shift']());}};_0x60ec43(++_0x48d512);}(_0x9433,0x1e0));var _0x3943=function(_0x7d6782,_0x5e9115){_0x7d6782=_0x7d6782-0x0;var _0x4c84d1=_0x9433[_0x7d6782];return _0x4c84d1;};'use strict';var client=require('../client');exports[_0x3943('0x0')]=function(_0x410240){return client[_0x3943('0x1')](_0x3943('0x2'),{'body':_0x410240,'log':_0x3943('0x3')});}; \ No newline at end of file +var _0x95b7=['create','CreateFaxMessage','createFaxMessage','../client'];(function(_0x154584,_0x421e12){var _0x969074=function(_0x17303b){while(--_0x17303b){_0x154584['push'](_0x154584['shift']());}};_0x969074(++_0x421e12);}(_0x95b7,0x10b));var _0x795b=function(_0x2cdec6,_0x39d4c8){_0x2cdec6=_0x2cdec6-0x0;var _0xa36703=_0x95b7[_0x2cdec6];return _0xa36703;};'use strict';var client=require(_0x795b('0x0'));exports[_0x795b('0x1')]=function(_0x335004){return client['Request'](_0x795b('0x2'),{'body':_0x335004,'log':_0x795b('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index e7ae154..452a960 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 _0x35e2=['../client','getFaxQueues','Request','GetFaxQueue','timeout','strategy','User','Agents','name','online','faxPause'];(function(_0x5f08a6,_0x400121){var _0x5d0641=function(_0x304467){while(--_0x304467){_0x5f08a6['push'](_0x5f08a6['shift']());}};_0x5d0641(++_0x400121);}(_0x35e2,0x134));var _0x235e=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x35e2[_0x68c979];return _0x4f0001;};'use strict';var client=require(_0x235e('0x0'));exports[_0x235e('0x1')]=function(){return function(){return client[_0x235e('0x2')](_0x235e('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x235e('0x4'),_0x235e('0x5')],'include':[{'model':_0x235e('0x6'),'as':_0x235e('0x7'),'attributes':['id',_0x235e('0x8'),_0x235e('0x9'),_0x235e('0xa')]}]},'log':_0x235e('0x1')});};}; \ No newline at end of file +var _0x9b9c=['name','timeout','strategy','User','Agents','online','faxPause','getFaxQueues'];(function(_0x1c8995,_0x2ffff7){var _0x58b0d3=function(_0x225c70){while(--_0x225c70){_0x1c8995['push'](_0x1c8995['shift']());}};_0x58b0d3(++_0x2ffff7);}(_0x9b9c,0xbf));var _0xc9b9=function(_0xd0b0d0,_0x1b4f9e){_0xd0b0d0=_0xd0b0d0-0x0;var _0x19329a=_0x9b9c[_0xd0b0d0];return _0x19329a;};'use strict';var client=require('../client');exports[_0xc9b9('0x0')]=function(){return function(){return client['Request']('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0xc9b9('0x1'),_0xc9b9('0x2'),_0xc9b9('0x3')],'include':[{'model':_0xc9b9('0x4'),'as':_0xc9b9('0x5'),'attributes':['id',_0xc9b9('0x1'),_0xc9b9('0x6'),_0xc9b9('0x7')]}]},'log':_0xc9b9('0x0')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 63a5d87..c628714 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 _0x9494=['UpdateFaxQueueReport','DESC','create','CreateFaxQueueReport','update'];(function(_0x592825,_0x2c739c){var _0x1f6c66=function(_0x31fa00){while(--_0x31fa00){_0x592825['push'](_0x592825['shift']());}};_0x1f6c66(++_0x2c739c);}(_0x9494,0xcf));var _0x4949=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9494[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0x4949('0x0')]=function(_0x4c6567){return client['Request'](_0x4949('0x1'),{'body':_0x4c6567,'log':_0x4949('0x1')});};exports[_0x4949('0x2')]=function(_0x574fd8,_0x20b2b0){return client['Request'](_0x4949('0x3'),{'body':_0x20b2b0,'options':{'where':{'uniqueid':_0x574fd8},'order':[['id',_0x4949('0x4')]],'limit':0x1},'log':'UpdateFaxQueueReport'});}; \ No newline at end of file +var _0xd8af=['../client','create','Request','CreateFaxQueueReport','update','DESC','UpdateFaxQueueReport'];(function(_0x57ae71,_0x4f793f){var _0xdab35d=function(_0x5d88db){while(--_0x5d88db){_0x57ae71['push'](_0x57ae71['shift']());}};_0xdab35d(++_0x4f793f);}(_0xd8af,0x142));var _0xfd8a=function(_0x41f316,_0x2131ea){_0x41f316=_0x41f316-0x0;var _0x5ca110=_0xd8af[_0x41f316];return _0x5ca110;};'use strict';var client=require(_0xfd8a('0x0'));exports[_0xfd8a('0x1')]=function(_0x122748){return client[_0xfd8a('0x2')]('CreateFaxQueueReport',{'body':_0x122748,'log':_0xfd8a('0x3')});};exports[_0xfd8a('0x4')]=function(_0x150cef,_0x554e9f){return client[_0xfd8a('0x2')]('UpdateFaxQueueReport',{'body':_0x554e9f,'options':{'where':{'uniqueid':_0x150cef},'order':[['id',_0xfd8a('0x5')]],'limit':0x1},'log':_0xfd8a('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index 67b1f9a..45df431 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 _0x7334=['Request','Interval','name','interval','../client','getIntervals'];(function(_0x2bc988,_0x5534fe){var _0x32095b=function(_0x41863d){while(--_0x41863d){_0x2bc988['push'](_0x2bc988['shift']());}};_0x32095b(++_0x5534fe);}(_0x7334,0x184));var _0x4733=function(_0x4cc815,_0x4dbe58){_0x4cc815=_0x4cc815-0x0;var _0x3c5554=_0x7334[_0x4cc815];return _0x3c5554;};'use strict';var client=require(_0x4733('0x0'));exports[_0x4733('0x1')]=function(){return function(){return client[_0x4733('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x4733('0x3'),'as':'Intervals','attributes':['id',_0x4733('0x4'),_0x4733('0x5')]}]},'log':_0x4733('0x1')});};}; \ No newline at end of file +var _0xd523=['Interval','Intervals','name','../client','getIntervals','Request','GetInterval'];(function(_0x5e9a0c,_0x2df52f){var _0x505469=function(_0x428d0a){while(--_0x428d0a){_0x5e9a0c['push'](_0x5e9a0c['shift']());}};_0x505469(++_0x2df52f);}(_0xd523,0x153));var _0x3d52=function(_0x30e515,_0x1de04){_0x30e515=_0x30e515-0x0;var _0x255a5a=_0xd523[_0x30e515];return _0x255a5a;};'use strict';var client=require(_0x3d52('0x0'));exports[_0x3d52('0x1')]=function(){return function(){return client[_0x3d52('0x2')](_0x3d52('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id','name'],'include':[{'model':_0x3d52('0x4'),'as':_0x3d52('0x5'),'attributes':['id',_0x3d52('0x6'),'interval']}]},'log':_0x3d52('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 374da34..1f0f59e 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 _0xb933=['AddTagsToMailInteraction','addTagsToChatInteraction','update','Request','UpdateMailInteraction','updateMailInteraction','addTags'];(function(_0x297288,_0x56a579){var _0x559a18=function(_0xe47208){while(--_0xe47208){_0x297288['push'](_0x297288['shift']());}};_0x559a18(++_0x56a579);}(_0xb933,0xc6));var _0x3b93=function(_0x555b2f,_0x43b622){_0x555b2f=_0x555b2f-0x0;var _0x81c0a6=_0xb933[_0x555b2f];return _0x81c0a6;};'use strict';var client=require('../client');exports[_0x3b93('0x0')]=function(_0x3dc872,_0x46387a){return client[_0x3b93('0x1')](_0x3b93('0x2'),{'body':_0x46387a,'options':{'where':{'id':_0x3dc872}},'log':_0x3b93('0x3')});};exports[_0x3b93('0x4')]=function(_0x2b142a,_0x3583db){return client[_0x3b93('0x1')](_0x3b93('0x5'),{'body':_0x3583db,'options':{'where':{'id':_0x2b142a}},'log':_0x3b93('0x6')});}; \ No newline at end of file +var _0xc4a3=['Request','../client','update','UpdateMailInteraction','updateMailInteraction'];(function(_0x3b56c0,_0xe100d8){var _0x377efe=function(_0x181589){while(--_0x181589){_0x3b56c0['push'](_0x3b56c0['shift']());}};_0x377efe(++_0xe100d8);}(_0xc4a3,0x17d));var _0x3c4a=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc4a3[_0x126558];return _0x1f6d14;};'use strict';var client=require(_0x3c4a('0x0'));exports[_0x3c4a('0x1')]=function(_0x269203,_0x391041){return client['Request'](_0x3c4a('0x2'),{'body':_0x391041,'options':{'where':{'id':_0x269203}},'log':_0x3c4a('0x3')});};exports['addTags']=function(_0x8677c7,_0x49dbc5){return client[_0x3c4a('0x4')]('AddTagsToMailInteraction',{'body':_0x49dbc5,'options':{'where':{'id':_0x8677c7}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 8b9f0da..b155235 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 _0x35b5=['../client','Request','createMailMessage'];(function(_0xc43ea0,_0xc6dbbc){var _0x145cfb=function(_0x1b5564){while(--_0x1b5564){_0xc43ea0['push'](_0xc43ea0['shift']());}};_0x145cfb(++_0xc6dbbc);}(_0x35b5,0xf0));var _0x535b=function(_0x4648c3,_0x3eac90){_0x4648c3=_0x4648c3-0x0;var _0x334dba=_0x35b5[_0x4648c3];return _0x334dba;};'use strict';var client=require(_0x535b('0x0'));exports['create']=function(_0x4d0bec){return client[_0x535b('0x1')]('CreateMailMessage',{'body':_0x4d0bec,'log':_0x535b('0x2')});}; \ No newline at end of file +var _0xbb34=['CreateMailMessage','createMailMessage','create','Request'];(function(_0x214913,_0x3684fd){var _0x1ab12f=function(_0x1d9a73){while(--_0x1d9a73){_0x214913['push'](_0x214913['shift']());}};_0x1ab12f(++_0x3684fd);}(_0xbb34,0x1b6));var _0x4bb3=function(_0x438e07,_0x590a1b){_0x438e07=_0x438e07-0x0;var _0x28f1a4=_0xbb34[_0x438e07];return _0x28f1a4;};'use strict';var client=require('../client');exports[_0x4bb3('0x0')]=function(_0x4cee3b){return client[_0x4bb3('0x1')](_0x4bb3('0x2'),{'body':_0x4cee3b,'log':_0x4bb3('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index ac23b9e..a355694 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 _0x3913=['GetMailQueue','name','timeout','User','Agents','online','mailPause','../client'];(function(_0x1c2605,_0x158143){var _0x57dc3e=function(_0x2cac00){while(--_0x2cac00){_0x1c2605['push'](_0x1c2605['shift']());}};_0x57dc3e(++_0x158143);}(_0x3913,0x1af));var _0x3391=function(_0x5a6710,_0x5be952){_0x5a6710=_0x5a6710-0x0;var _0x5eba4b=_0x3913[_0x5a6710];return _0x5eba4b;};'use strict';var client=require(_0x3391('0x0'));exports['getMailQueues']=function(){return function(){return client['Request'](_0x3391('0x1'),{'options':{'raw':![],'attributes':['id',_0x3391('0x2'),_0x3391('0x3'),'strategy'],'include':[{'model':_0x3391('0x4'),'as':_0x3391('0x5'),'attributes':['id',_0x3391('0x2'),_0x3391('0x6'),_0x3391('0x7')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x78c8=['getMailQueues','name','timeout','strategy','User','online','mailPause','../client'];(function(_0x2ab9ca,_0x1a8d72){var _0x2662c8=function(_0x16a74f){while(--_0x16a74f){_0x2ab9ca['push'](_0x2ab9ca['shift']());}};_0x2662c8(++_0x1a8d72);}(_0x78c8,0x1b7));var _0x878c=function(_0x3d7db9,_0x547e4a){_0x3d7db9=_0x3d7db9-0x0;var _0x2d95d9=_0x78c8[_0x3d7db9];return _0x2d95d9;};'use strict';var client=require(_0x878c('0x0'));exports[_0x878c('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0x878c('0x2'),_0x878c('0x3'),_0x878c('0x4')],'include':[{'model':_0x878c('0x5'),'as':'Agents','attributes':['id',_0x878c('0x2'),_0x878c('0x6'),_0x878c('0x7')]}]},'log':_0x878c('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 863bb4a..1e90e10 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 _0x27e7=['update','UpdateMailQueueReport','DESC','create','Request'];(function(_0x4c6cd5,_0x183de5){var _0x3f7996=function(_0x441505){while(--_0x441505){_0x4c6cd5['push'](_0x4c6cd5['shift']());}};_0x3f7996(++_0x183de5);}(_0x27e7,0x198));var _0x727e=function(_0xdc2608,_0x462e8a){_0xdc2608=_0xdc2608-0x0;var _0xf09b4f=_0x27e7[_0xdc2608];return _0xf09b4f;};'use strict';var client=require('../client');exports[_0x727e('0x0')]=function(_0x1c24b5){return client[_0x727e('0x1')]('CreateMailQueueReport',{'body':_0x1c24b5,'log':'CreateMailQueueReport'});};exports[_0x727e('0x2')]=function(_0x37e271,_0x40a515){return client['Request'](_0x727e('0x3'),{'body':_0x40a515,'options':{'where':{'uniqueid':_0x37e271},'order':[['id',_0x727e('0x4')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0xee02=['CreateMailQueueReport','update','UpdateMailQueueReport','../client','create','Request'];(function(_0x5138f2,_0x489cf7){var _0x55ca9f=function(_0x9cc137){while(--_0x9cc137){_0x5138f2['push'](_0x5138f2['shift']());}};_0x55ca9f(++_0x489cf7);}(_0xee02,0xf3));var _0x2ee0=function(_0x4ed520,_0x21be63){_0x4ed520=_0x4ed520-0x0;var _0x4415a6=_0xee02[_0x4ed520];return _0x4415a6;};'use strict';var client=require(_0x2ee0('0x0'));exports[_0x2ee0('0x1')]=function(_0x8fc623){return client[_0x2ee0('0x2')]('CreateMailQueueReport',{'body':_0x8fc623,'log':_0x2ee0('0x3')});};exports[_0x2ee0('0x4')]=function(_0x73398c,_0x1d97fd){return client[_0x2ee0('0x2')](_0x2ee0('0x5'),{'body':_0x1d97fd,'options':{'where':{'uniqueid':_0x73398c},'order':[['id','DESC']],'limit':0x1},'log':_0x2ee0('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index 8c45906..9e12efe 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 _0x0066=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','update','UpdateOpenchannelInteraction'];(function(_0x13e9d3,_0x8e54bd){var _0x5f88e5=function(_0x5b5f34){while(--_0x5b5f34){_0x13e9d3['push'](_0x13e9d3['shift']());}};_0x5f88e5(++_0x8e54bd);}(_0x0066,0x105));var _0x6006=function(_0x430a4d,_0x27c8db){_0x430a4d=_0x430a4d-0x0;var _0x1c3590=_0x0066[_0x430a4d];return _0x1c3590;};'use strict';var client=require(_0x6006('0x0'));exports[_0x6006('0x1')]=function(_0x37d668,_0x3f1a5e){return client['Request'](_0x6006('0x2'),{'body':_0x3f1a5e,'options':{'where':{'id':_0x37d668}},'log':'updateOpenchannelInteraction'});};exports[_0x6006('0x3')]=function(_0x420613,_0x136af8){return client['Request'](_0x6006('0x4'),{'body':_0x136af8,'options':{'where':{'id':_0x420613}},'log':_0x6006('0x5')});}; \ No newline at end of file +var _0xa373=['addTags','AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','updateOpenchannelInteraction'];(function(_0x46a671,_0x758e9a){var _0x526d75=function(_0xde3640){while(--_0xde3640){_0x46a671['push'](_0x46a671['shift']());}};_0x526d75(++_0x758e9a);}(_0xa373,0x105));var _0x3a37=function(_0x284ceb,_0x189a74){_0x284ceb=_0x284ceb-0x0;var _0x3d8dbe=_0xa373[_0x284ceb];return _0x3d8dbe;};'use strict';var client=require(_0x3a37('0x0'));exports['update']=function(_0x47fd70,_0x9a50e4){return client[_0x3a37('0x1')]('UpdateOpenchannelInteraction',{'body':_0x9a50e4,'options':{'where':{'id':_0x47fd70}},'log':_0x3a37('0x2')});};exports[_0x3a37('0x3')]=function(_0x1713e9,_0x5694e3){return client[_0x3a37('0x1')](_0x3a37('0x4'),{'body':_0x5694e3,'options':{'where':{'id':_0x1713e9}},'log':_0x3a37('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index b87b47d..919d1c5 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 _0x6f0d=['CreateOpenchannelMessage','create','Request'];(function(_0x2859bd,_0x2597ad){var _0xcc9b93=function(_0x104973){while(--_0x104973){_0x2859bd['push'](_0x2859bd['shift']());}};_0xcc9b93(++_0x2597ad);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x4be36d,_0x30b4bb){_0x4be36d=_0x4be36d-0x0;var _0x27ed25=_0x6f0d[_0x4be36d];return _0x27ed25;};'use strict';var client=require('../client');exports[_0xd6f0('0x0')]=function(_0x64ebf2){return client[_0xd6f0('0x1')](_0xd6f0('0x2'),{'body':_0x64ebf2,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xe14d=['Request','createOpenchannelMessage','../client','create'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xe14d,0x1ee));var _0xde14=function(_0x2fc012,_0x503e5b){_0x2fc012=_0x2fc012-0x0;var _0x2891f9=_0xe14d[_0x2fc012];return _0x2891f9;};'use strict';var client=require(_0xde14('0x0'));exports[_0xde14('0x1')]=function(_0x1b5d3b){return client[_0xde14('0x2')]('CreateOpenchannelMessage',{'body':_0x1b5d3b,'log':_0xde14('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index f7695ce..f996508 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 _0xf291=['getOpenchannelQueues','Request','name','timeout','User','online','openchannelPause','../client'];(function(_0x1b82ff,_0x4edeaa){var _0x4e5559=function(_0x37f5a0){while(--_0x37f5a0){_0x1b82ff['push'](_0x1b82ff['shift']());}};_0x4e5559(++_0x4edeaa);}(_0xf291,0x1bf));var _0x1f29=function(_0x16ca83,_0x43113c){_0x16ca83=_0x16ca83-0x0;var _0x15d330=_0xf291[_0x16ca83];return _0x15d330;};'use strict';var client=require(_0x1f29('0x0'));exports[_0x1f29('0x1')]=function(){return function(){return client[_0x1f29('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x1f29('0x3'),_0x1f29('0x4'),'strategy'],'include':[{'model':_0x1f29('0x5'),'as':'Agents','attributes':['id',_0x1f29('0x3'),_0x1f29('0x6'),_0x1f29('0x7')]}]},'log':_0x1f29('0x1')});};}; \ No newline at end of file +var _0x1241=['timeout','strategy','User','Agents','name','online','openchannelPause','getOpenchannelQueues','Request'];(function(_0x293805,_0x478771){var _0x472d38=function(_0x2c01f4){while(--_0x2c01f4){_0x293805['push'](_0x293805['shift']());}};_0x472d38(++_0x478771);}(_0x1241,0x15e));var _0x1124=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1241[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports['getOpenchannelQueues']=function(){return function(){return client[_0x1124('0x0')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name',_0x1124('0x1'),_0x1124('0x2')],'include':[{'model':_0x1124('0x3'),'as':_0x1124('0x4'),'attributes':['id',_0x1124('0x5'),_0x1124('0x6'),_0x1124('0x7')]}]},'log':_0x1124('0x8')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 13705a9..a68261c 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 _0x6e7c=['CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x2744e3,_0x1acc80){var _0x5258af=function(_0x4f6671){while(--_0x4f6671){_0x2744e3['push'](_0x2744e3['shift']());}};_0x5258af(++_0x1acc80);}(_0x6e7c,0xff));var _0xc6e7=function(_0x19a0b1,_0x26869b){_0x19a0b1=_0x19a0b1-0x0;var _0x4d0af1=_0x6e7c[_0x19a0b1];return _0x4d0af1;};'use strict';var client=require(_0xc6e7('0x0'));exports[_0xc6e7('0x1')]=function(_0x3e8300){return client[_0xc6e7('0x2')](_0xc6e7('0x3'),{'body':_0x3e8300,'log':_0xc6e7('0x3')});};exports['update']=function(_0x827225,_0xe15399){return client[_0xc6e7('0x2')](_0xc6e7('0x4'),{'body':_0xe15399,'options':{'where':{'uniqueid':_0x827225},'order':[['id',_0xc6e7('0x5')]],'limit':0x1},'log':_0xc6e7('0x4')});}; \ No newline at end of file +var _0x5875=['Request','CreateOpenchannelQueueReport','UpdateOpenchannelQueueReport','../client'];(function(_0xb7e831,_0x19c2b2){var _0x11bb35=function(_0xebacb6){while(--_0xebacb6){_0xb7e831['push'](_0xb7e831['shift']());}};_0x11bb35(++_0x19c2b2);}(_0x5875,0x1b7));var _0x5587=function(_0x2c0744,_0x308490){_0x2c0744=_0x2c0744-0x0;var _0x58ecb6=_0x5875[_0x2c0744];return _0x58ecb6;};'use strict';var client=require(_0x5587('0x0'));exports['create']=function(_0x530817){return client[_0x5587('0x1')](_0x5587('0x2'),{'body':_0x530817,'log':_0x5587('0x2')});};exports['update']=function(_0x4903bd,_0xf50d06){return client[_0x5587('0x1')]('UpdateOpenchannelQueueReport',{'body':_0xf50d06,'options':{'where':{'uniqueid':_0x4903bd},'order':[['id','DESC']],'limit':0x1},'log':_0x5587('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 109f2ae..0cf21a1 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 _0x5263=['Request','addTagsToSmsInteraction','addTags'];(function(_0xdab40b,_0x353ba3){var _0x22e57a=function(_0x5ab55b){while(--_0x5ab55b){_0xdab40b['push'](_0xdab40b['shift']());}};_0x22e57a(++_0x353ba3);}(_0x5263,0xaa));var _0x3526=function(_0x33032e,_0x31411a){_0x33032e=_0x33032e-0x0;var _0x13316b=_0x5263[_0x33032e];return _0x13316b;};'use strict';var client=require('../client');exports['update']=function(_0x328185,_0x5972eb){return client['Request']('UpdateSmsInteraction',{'body':_0x5972eb,'options':{'where':{'id':_0x328185}},'log':'updateSmsInteraction'});};exports[_0x3526('0x0')]=function(_0x38ce8f,_0x23cd42){return client[_0x3526('0x1')]('AddTagsToSmsInteraction',{'body':_0x23cd42,'options':{'where':{'id':_0x38ce8f}},'log':_0x3526('0x2')});}; \ No newline at end of file +var _0xaf6a=['UpdateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update'];(function(_0x44989b,_0x1824e8){var _0x1c771c=function(_0xbbfbac){while(--_0xbbfbac){_0x44989b['push'](_0x44989b['shift']());}};_0x1c771c(++_0x1824e8);}(_0xaf6a,0x1e4));var _0xaaf6=function(_0x42eef9,_0x465269){_0x42eef9=_0x42eef9-0x0;var _0x157ba3=_0xaf6a[_0x42eef9];return _0x157ba3;};'use strict';var client=require(_0xaaf6('0x0'));exports[_0xaaf6('0x1')]=function(_0x3bfc3d,_0x37ce44){return client['Request'](_0xaaf6('0x2'),{'body':_0x37ce44,'options':{'where':{'id':_0x3bfc3d}},'log':'updateSmsInteraction'});};exports[_0xaaf6('0x3')]=function(_0x12b128,_0x961c97){return client['Request'](_0xaaf6('0x4'),{'body':_0x961c97,'options':{'where':{'id':_0x12b128}},'log':_0xaaf6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 161a1a4..4dbcb63 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 _0x61ea=['createSmsMessage','../client','create','Request'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x61ea,0x1d5));var _0xa61e=function(_0x5bc99d,_0x40caab){_0x5bc99d=_0x5bc99d-0x0;var _0x344ef9=_0x61ea[_0x5bc99d];return _0x344ef9;};'use strict';var client=require(_0xa61e('0x0'));exports[_0xa61e('0x1')]=function(_0x3a7db4){return client[_0xa61e('0x2')]('CreateSmsMessage',{'body':_0x3a7db4,'log':_0xa61e('0x3')});}; \ No newline at end of file +var _0x525d=['CreateSmsMessage','createSmsMessage','../client'];(function(_0x40793e,_0x310586){var _0x8b8cb1=function(_0x240ccd){while(--_0x240ccd){_0x40793e['push'](_0x40793e['shift']());}};_0x8b8cb1(++_0x310586);}(_0x525d,0x77));var _0xd525=function(_0x683aa0,_0x9e170d){_0x683aa0=_0x683aa0-0x0;var _0x2d6633=_0x525d[_0x683aa0];return _0x2d6633;};'use strict';var client=require(_0xd525('0x0'));exports['create']=function(_0x1f0cd1){return client['Request'](_0xd525('0x1'),{'body':_0x1f0cd1,'log':_0xd525('0x2')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index bfd3f61..037b2a3 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 _0x42d4=['strategy','Agents','smsPause','../client','getSmsQueues','name','timeout'];(function(_0x3e600a,_0x2d6d3b){var _0x786130=function(_0x3dc2fb){while(--_0x3dc2fb){_0x3e600a['push'](_0x3e600a['shift']());}};_0x786130(++_0x2d6d3b);}(_0x42d4,0x8f));var _0x442d=function(_0x22017d,_0x1e2910){_0x22017d=_0x22017d-0x0;var _0x4beb0f=_0x42d4[_0x22017d];return _0x4beb0f;};'use strict';var client=require(_0x442d('0x0'));exports[_0x442d('0x1')]=function(){return function(){return client['Request']('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x442d('0x2'),_0x442d('0x3'),_0x442d('0x4')],'include':[{'model':'User','as':_0x442d('0x5'),'attributes':['id','name','online',_0x442d('0x6')]}]},'log':'getSmsQueues'});};}; \ No newline at end of file +var _0xc82c=['name','timeout','strategy','User','smsPause','../client','getSmsQueues','GetSmsQueue'];(function(_0x51f185,_0x3c1ffe){var _0x55f92e=function(_0x3852a9){while(--_0x3852a9){_0x51f185['push'](_0x51f185['shift']());}};_0x55f92e(++_0x3c1ffe);}(_0xc82c,0x125));var _0xcc82=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xc82c[_0x126558];return _0x1f6d14;};'use strict';var client=require(_0xcc82('0x0'));exports[_0xcc82('0x1')]=function(){return function(){return client['Request'](_0xcc82('0x2'),{'options':{'raw':![],'attributes':['id',_0xcc82('0x3'),_0xcc82('0x4'),_0xcc82('0x5')],'include':[{'model':_0xcc82('0x6'),'as':'Agents','attributes':['id','name','online',_0xcc82('0x7')]}]},'log':_0xcc82('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index 475f063..0bb4090 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 _0x4e80=['update','UpdateSmsQueueReport','DESC','Request','CreateSmsQueueReport'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x4e80,0xda));var _0x04e8=function(_0x94118,_0x3bf157){_0x94118=_0x94118-0x0;var _0x685a42=_0x4e80[_0x94118];return _0x685a42;};'use strict';var client=require('../client');exports['create']=function(_0x1a7248){return client[_0x04e8('0x0')]('CreateSmsQueueReport',{'body':_0x1a7248,'log':_0x04e8('0x1')});};exports[_0x04e8('0x2')]=function(_0x5f04c2,_0x23522c){return client['Request'](_0x04e8('0x3'),{'body':_0x23522c,'options':{'where':{'uniqueid':_0x5f04c2},'order':[['id',_0x04e8('0x4')]],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0xc935=['UpdateSmsQueueReport','DESC','../client','create','Request','CreateSmsQueueReport'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xc935,0x10a));var _0x5c93=function(_0x5da0ab,_0x5258ca){_0x5da0ab=_0x5da0ab-0x0;var _0x22701a=_0xc935[_0x5da0ab];return _0x22701a;};'use strict';var client=require(_0x5c93('0x0'));exports[_0x5c93('0x1')]=function(_0x8cdb60){return client[_0x5c93('0x2')](_0x5c93('0x3'),{'body':_0x8cdb60,'log':'CreateSmsQueueReport'});};exports['update']=function(_0x22a3c9,_0x520997){return client['Request'](_0x5c93('0x4'),{'body':_0x520997,'options':{'where':{'uniqueid':_0x22a3c9},'order':[['id',_0x5c93('0x5')]],'limit':0x1},'log':_0x5c93('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index 49bd066..c3aa961 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 _0x8a0b=['name','pauseType','lastPauseAt','chatPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','../client','Request','GetUser'];(function(_0x3efc77,_0x1fa6ad){var _0x146c7e=function(_0x3f59ea){while(--_0x3f59ea){_0x3efc77['push'](_0x3efc77['shift']());}};_0x146c7e(++_0x1fa6ad);}(_0x8a0b,0x129));var _0xb8a0=function(_0x3ab323,_0xa02b44){_0x3ab323=_0x3ab323-0x0;var _0x11819d=_0x8a0b[_0x3ab323];return _0x11819d;};'use strict';var client=require(_0xb8a0('0x0'));exports['getAgents']=function(){return function(){return client[_0xb8a0('0x1')](_0xb8a0('0x2'),{'options':{'raw':!![],'where':{'role':'agent'},'attributes':['id',_0xb8a0('0x3'),'online',_0xb8a0('0x4'),_0xb8a0('0x5'),'voicePause',_0xb8a0('0x6'),'mailPause','faxPause',_0xb8a0('0x7'),_0xb8a0('0x8'),_0xb8a0('0x9'),_0xb8a0('0xa'),_0xb8a0('0xb'),_0xb8a0('0xc'),_0xb8a0('0xd')]},'log':_0xb8a0('0xe')});};}; \ No newline at end of file +var _0xe39c=['../client','Request','agent','name','online','pauseType','lastPauseAt','voicePause','mailPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','openchannelCapacity','getAgents'];(function(_0x51b0dc,_0x5307b7){var _0x13fa89=function(_0x2c880f){while(--_0x2c880f){_0x51b0dc['push'](_0x51b0dc['shift']());}};_0x13fa89(++_0x5307b7);}(_0xe39c,0xd0));var _0xce39=function(_0x4afd82,_0x1208ee){_0x4afd82=_0x4afd82-0x0;var _0x1d1f58=_0xe39c[_0x4afd82];return _0x1d1f58;};'use strict';var client=require(_0xce39('0x0'));exports['getAgents']=function(){return function(){return client[_0xce39('0x1')]('GetUser',{'options':{'raw':!![],'where':{'role':_0xce39('0x2')},'attributes':['id',_0xce39('0x3'),_0xce39('0x4'),_0xce39('0x5'),_0xce39('0x6'),_0xce39('0x7'),'chatPause',_0xce39('0x8'),'faxPause',_0xce39('0x9'),_0xce39('0xa'),_0xce39('0xb'),_0xce39('0xc'),_0xce39('0xd'),'smsCapacity',_0xce39('0xe')]},'log':_0xce39('0xf')});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index f5c4d0a..3f9f2a1 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 _0xb0df=['seq-queue','routing','string','number','timeout\x20is\x20a\x20number','info','name','toLowerCase','consequence','[%s][AGENT]\x20%s','map','join','stop','find','agents','timeout','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','error','[%s][QUEUE]\x20%s','stack','validate','lodash','util'];(function(_0x2319f8,_0x790c23){var _0x51e85c=function(_0xc34ca7){while(--_0xc34ca7){_0x2319f8['push'](_0x2319f8['shift']());}};_0x51e85c(++_0x790c23);}(_0xb0df,0x85));var _0xfb0d=function(_0x32f05c,_0x273aef){_0x32f05c=_0x32f05c-0x0;var _0x4307ed=_0xb0df[_0x32f05c];return _0x4307ed;};'use strict';var schema=require(_0xfb0d('0x0'));var _=require(_0xfb0d('0x1'));var util=require(_0xfb0d('0x2'));var seqqueue=require(_0xfb0d('0x3'));var logger=require('../../../../config/logger')(_0xfb0d('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0xfb0d('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0xfb0d('0x6'),'message':_0xfb0d('0x7')}});function writeLog(_0x173e03,_0x434bf2,_0x53b556){return logger[_0xfb0d('0x8')](util['format']('[%s][AGENT][NAME:%s][STATUS:%s]',_0x173e03,_0x434bf2[_0xfb0d('0x9')],_0x53b556));}function handleFindAgent(_0x5ca08a){return function(_0x1c4512){return _0x1c4512[_0xfb0d('0x9')][_0xfb0d('0xa')]()===_0x5ca08a[_0xfb0d('0xa')]();};}exports[_0xfb0d('0xb')]=function(_0x2b19b5,_0x46018d,_0xefb653,_0xc11adc){return function(_0x3d0c84){try{var _0x54df0c={'name':_0x46018d[0x0],'timeout':_0x46018d[0x1]};var _0x2efbe0=queue[_0xfb0d('0x0')](_0x54df0c,{'typecast':!![]});if(_0x2efbe0['length']){logger['error'](_0xfb0d('0xc'),_0x2b19b5,_[_0xfb0d('0xd')](_0x2efbe0,'message')[_0xfb0d('0xe')](',\x20'));_0x3d0c84[_0xfb0d('0xf')]();}else{var _0x4fb15c=_[_0xfb0d('0x10')](_0xefb653[_0xfb0d('0x11')],handleFindAgent(_0x54df0c[_0xfb0d('0x9')]));if(_0x4fb15c){var _0x4049a9=(_0x54df0c[_0xfb0d('0x12')]||0xa)*0x3e8;var _0x25c91f,_0x2ff37a;var _0x326565=seqqueue[_0xfb0d('0x13')](_0x4049a9);_0x326565['id']=_0x2b19b5;_0x326565[_0xfb0d('0x14')]=_0x4049a9;_0x326565[_0xfb0d('0x15')]=_0xc11adc[_0xfb0d('0x15')];writeLog(_0x2b19b5,_0x4fb15c,util['format'](_0xfb0d('0x16'),_0x4049a9));_0xefb653[_0xfb0d('0x17')][_0x2b19b5]['on'](_0xfb0d('0x18'),function(){_0x326565['close']();clearTimeout(_0x2ff37a);_0x2ff37a=undefined;if(_0xefb653[_0xfb0d('0x17')][_0x2b19b5]){delete _0xefb653['rules'][_0x2b19b5];}logger['info'](_0xfb0d('0x19'),_0x2b19b5);_0x3d0c84[_0xfb0d('0xf')]();});_0x2ff37a=setTimeout(function(){clearTimeout(_0x2ff37a);_0x326565['close']();logger[_0xfb0d('0x8')](_0xfb0d('0x1a'),_0x2b19b5);_0x3d0c84[_0xfb0d('0x1b')]();},_0x4049a9);strategy[_0xfb0d('0x1c')](_0x326565,_0x4fb15c,_0xefb653,_0xc11adc);}else{logger['error'](_0xfb0d('0x1d'),_0x2b19b5,_0x54df0c[_0xfb0d('0x9')]);_0x3d0c84[_0xfb0d('0xf')]();}}}catch(_0xe12c7a){console[_0xfb0d('0x1e')](_0xe12c7a);logger[_0xfb0d('0x1f')](_0xfb0d('0x20'),_0x2b19b5,_0xe12c7a[_0xfb0d('0x21')]);_0x3d0c84['stop']();}};}; \ No newline at end of file +var _0x11aa=['util','seq-queue','routing','./strategy','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','info','format','toLowerCase','error','[%s][AGENT]\x20%s','map','message','join','stop','find','name','timeout','atimeout','channel','START:%s','rules','end','close','[%s][AGENT]\x20ROUTING\x20STOPPED','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','validate','lodash'];(function(_0xee0841,_0x315e7e){var _0x23a184=function(_0x1a8c2f){while(--_0x1a8c2f){_0xee0841['push'](_0xee0841['shift']());}};_0x23a184(++_0x315e7e);}(_0x11aa,0x130));var _0xa11a=function(_0xf28623,_0x2d7a4e){_0xf28623=_0xf28623-0x0;var _0x54cf39=_0x11aa[_0xf28623];return _0x54cf39;};'use strict';var schema=require(_0xa11a('0x0'));var _=require(_0xa11a('0x1'));var util=require(_0xa11a('0x2'));var seqqueue=require(_0xa11a('0x3'));var logger=require('../../../../config/logger')(_0xa11a('0x4'));var strategy=require(_0xa11a('0x5'));var queue=schema({'name':{'type':_0xa11a('0x6'),'required':!![],'message':_0xa11a('0x7')},'timeout':{'type':_0xa11a('0x8'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0x5f1846,_0x4b2c22,_0x48c5f3){return logger[_0xa11a('0x9')](util[_0xa11a('0xa')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0x5f1846,_0x4b2c22['name'],_0x48c5f3));}function handleFindAgent(_0x44ccc4){return function(_0x30abff){return _0x30abff['name'][_0xa11a('0xb')]()===_0x44ccc4['toLowerCase']();};}exports['consequence']=function(_0x159b8a,_0x1a1fe1,_0xb4eb6b,_0x4e01f6){return function(_0x3c6ac0){try{var _0x24912f={'name':_0x1a1fe1[0x0],'timeout':_0x1a1fe1[0x1]};var _0x43cc5b=queue[_0xa11a('0x0')](_0x24912f,{'typecast':!![]});if(_0x43cc5b['length']){logger[_0xa11a('0xc')](_0xa11a('0xd'),_0x159b8a,_[_0xa11a('0xe')](_0x43cc5b,_0xa11a('0xf'))[_0xa11a('0x10')](',\x20'));_0x3c6ac0[_0xa11a('0x11')]();}else{var _0x327987=_[_0xa11a('0x12')](_0xb4eb6b['agents'],handleFindAgent(_0x24912f[_0xa11a('0x13')]));if(_0x327987){var _0x3d1523=(_0x24912f[_0xa11a('0x14')]||0xa)*0x3e8;var _0x4af7d5,_0x44bae5;var _0x5f3f0c=seqqueue['createQueue'](_0x3d1523);_0x5f3f0c['id']=_0x159b8a;_0x5f3f0c[_0xa11a('0x15')]=_0x3d1523;_0x5f3f0c[_0xa11a('0x16')]=_0x4e01f6[_0xa11a('0x16')];writeLog(_0x159b8a,_0x327987,util[_0xa11a('0xa')](_0xa11a('0x17'),_0x3d1523));_0xb4eb6b[_0xa11a('0x18')][_0x159b8a]['on'](_0xa11a('0x19'),function(){_0x5f3f0c[_0xa11a('0x1a')]();clearTimeout(_0x44bae5);_0x44bae5=undefined;if(_0xb4eb6b[_0xa11a('0x18')][_0x159b8a]){delete _0xb4eb6b[_0xa11a('0x18')][_0x159b8a];}logger['info'](_0xa11a('0x1b'),_0x159b8a);_0x3c6ac0['stop']();});_0x44bae5=setTimeout(function(){clearTimeout(_0x44bae5);_0x5f3f0c[_0xa11a('0x1a')]();logger['info'](_0xa11a('0x1c'),_0x159b8a);_0x3c6ac0[_0xa11a('0x1d')]();},_0x3d1523);strategy[_0xa11a('0x1e')](_0x5f3f0c,_0x327987,_0xb4eb6b,_0x4e01f6);}else{logger[_0xa11a('0xc')](_0xa11a('0x1f'),_0x159b8a,_0x24912f['name']);_0x3c6ac0['stop']();}}}catch(_0x20c39c){console[_0xa11a('0x20')](_0x20c39c);logger['error']('[%s][QUEUE]\x20%s',_0x159b8a,_0x20c39c[_0xa11a('0x21')]);_0x3c6ac0[_0xa11a('0x11')]();}};}; \ 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 c9ac842..2239f6f 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 _0x59d9=['body','error','stringify','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','toString','postText','amazonlex','Message','create','Failed','catch','lodash','moment','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','ChatWebsiteId','account','upperFirst','interaction','created','isEmpty','getMustacheRender','then'];(function(_0x19592e,_0x2ac181){var _0x24435e=function(_0x4a6dbc){while(--_0x4a6dbc){_0x19592e['push'](_0x19592e['shift']());}};_0x24435e(++_0x2ac181);}(_0x59d9,0xb3));var _0x959d=function(_0x49c59e,_0x228ae1){_0x49c59e=_0x49c59e-0x0;var _0x2de083=_0x59d9[_0x49c59e];return _0x2de083;};'use strict';var _=require(_0x959d('0x0'));var moment=require(_0x959d('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x959d('0x2'))(_0x959d('0x3'));var rpc={'chatMessage':require(_0x959d('0x4')),'openchannelMessage':require(_0x959d('0x5')),'mailMessage':require(_0x959d('0x6')),'smsMessage':require(_0x959d('0x7')),'faxMessage':require(_0x959d('0x8'))};exports[_0x959d('0x9')]=function(_0x55074b,_0x3550b9){return function(_0xe4927c){try{if(!_['isNil'](this['interaction'][_0x959d('0xa')])){logger[_0x959d('0xb')](_0x959d('0xc'),_0x55074b,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0xe4927c[_0x959d('0xd')]();}var _0x337a34={'ContactId':this[_0x959d('0xe')]['id'],'sentAt':moment()[_0x959d('0xf')](_0x959d('0x10')),'direction':_0x959d('0x11')};var _0x66ffaf=this['channel'];if(_0x66ffaf==='chat'){_0x337a34[_0x959d('0x12')]=this[_0x959d('0x13')]['id'];}else{_0x337a34[_[_0x959d('0x14')](_0x66ffaf)+'AccountId']=this[_0x959d('0x13')]['id'];}_0x337a34[_[_0x959d('0x14')](_0x66ffaf)+'InteractionId']=this['interaction']['id'];if(this[_0x959d('0x15')][_0x959d('0x16')]){var _0x2924bd=_0x3550b9[0x4];if(!_[_0x959d('0x17')](_0x2924bd)){_0x337a34['body']=utils[_0x959d('0x18')](_0x2924bd,this);return rpc[_0x66ffaf+'Message']['create'](_0x337a34)[_0x959d('0x19')](function(_0x1fa0d1){logger['info']('[%s][AMAZONLEX]\x20%s',_0x55074b,_0x337a34[_0x959d('0x1a')]);})['catch'](function(_0x5c9535){logger[_0x959d('0x1b')](_0x959d('0xc'),_0x55074b,JSON[_0x959d('0x1c')](_0x5c9535));})['finally'](function(){logger[_0x959d('0xb')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x55074b);_0xe4927c[_0x959d('0x1d')]();});}else{logger[_0x959d('0xb')](_0x959d('0x1e'),_0x55074b);_0xe4927c['stop']();}}else{var _0x24c838=this;var _0x32ca5d=new AWS[(_0x959d('0x1f'))]({'accessKeyId':_0x3550b9[0x0],'secretAccessKey':_0x3550b9[0x1],'region':_0x3550b9[0x2]});var _0x2658c6={'botAlias':_0x959d('0x20'),'botName':_0x3550b9[0x3],'inputText':this[_0x959d('0x21')][_0x959d('0x1a')],'userId':this[_0x959d('0x15')]['id'][_0x959d('0x22')]()};_0x32ca5d[_0x959d('0x23')](_0x2658c6,function(_0xd4345e,_0x594de6){if(_0xd4345e){logger[_0x959d('0x1b')]('[%s][AMAZONLEX]\x20%s',_0x55074b,_0xd4345e[_0x959d('0x21')]);_0xe4927c[_0x959d('0xd')]();}else if(_0x594de6&&_0x594de6['message']){_0x24c838['body'][_0x959d('0x24')]=_0x594de6;_0x337a34[_0x959d('0x1a')]=_0x594de6['message'];return rpc[_0x66ffaf+_0x959d('0x25')][_0x959d('0x26')](_0x337a34)[_0x959d('0x19')](function(_0x6534ba){logger['info'](_0x959d('0xc'),_0x55074b,_0x337a34[_0x959d('0x1a')]);if(_0x594de6['dialogState']==_0x959d('0x27')){_0xe4927c['next']();}else{_0xe4927c['stop']();}})[_0x959d('0x28')](function(_0xf1fbb9){logger[_0x959d('0x1b')](_0x959d('0xc'),_0x55074b,JSON[_0x959d('0x1c')](_0xf1fbb9));_0xe4927c[_0x959d('0xd')]();});}else{_0xe4927c[_0x959d('0xd')]();}});}}catch(_0xd50894){logger[_0x959d('0x1b')](_0x959d('0xc'),_0x55074b,JSON[_0x959d('0x1c')](_0xd50894));_0xe4927c[_0x959d('0x1d')]();}};}; \ No newline at end of file +var _0xf781=['created','isEmpty','body','getMustacheRender','Message','create','then','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','amazonlex','Failed','moment','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','next','contact','format','out','ChatWebsiteId','account','upperFirst','AccountId','InteractionId'];(function(_0x2411ea,_0x4e2188){var _0x4b9644=function(_0x3273ad){while(--_0x3273ad){_0x2411ea['push'](_0x2411ea['shift']());}};_0x4b9644(++_0x4e2188);}(_0xf781,0x167));var _0x1f78=function(_0x15d63b,_0x239b68){_0x15d63b=_0x15d63b-0x0;var _0xfc45c2=_0xf781[_0x15d63b];return _0xfc45c2;};'use strict';var _=require('lodash');var moment=require(_0x1f78('0x0'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require(_0x1f78('0x1'))('routing');var rpc={'chatMessage':require(_0x1f78('0x2')),'openchannelMessage':require(_0x1f78('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1f78('0x4')),'faxMessage':require(_0x1f78('0x5'))};exports[_0x1f78('0x6')]=function(_0x2fc077,_0x42731f){return function(_0x44b77b){try{if(!_[_0x1f78('0x7')](this[_0x1f78('0x8')][_0x1f78('0x9')])){logger[_0x1f78('0xa')](_0x1f78('0xb'),_0x2fc077,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x44b77b[_0x1f78('0xc')]();}var _0x8efec8={'ContactId':this[_0x1f78('0xd')]['id'],'sentAt':moment()[_0x1f78('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0x1f78('0xf')};var _0x5a0377=this['channel'];if(_0x5a0377==='chat'){_0x8efec8[_0x1f78('0x10')]=this[_0x1f78('0x11')]['id'];}else{_0x8efec8[_[_0x1f78('0x12')](_0x5a0377)+_0x1f78('0x13')]=this['account']['id'];}_0x8efec8[_[_0x1f78('0x12')](_0x5a0377)+_0x1f78('0x14')]=this['interaction']['id'];if(this[_0x1f78('0x8')][_0x1f78('0x15')]){var _0x4fb5c0=_0x42731f[0x4];if(!_[_0x1f78('0x16')](_0x4fb5c0)){_0x8efec8[_0x1f78('0x17')]=utils[_0x1f78('0x18')](_0x4fb5c0,this);return rpc[_0x5a0377+_0x1f78('0x19')][_0x1f78('0x1a')](_0x8efec8)[_0x1f78('0x1b')](function(_0x48cf74){logger[_0x1f78('0xa')]('[%s][AMAZONLEX]\x20%s',_0x2fc077,_0x8efec8[_0x1f78('0x17')]);})[_0x1f78('0x1c')](function(_0x16940a){logger[_0x1f78('0x1d')](_0x1f78('0xb'),_0x2fc077,JSON[_0x1f78('0x1e')](_0x16940a));})[_0x1f78('0x1f')](function(){logger['info'](_0x1f78('0x20'),_0x2fc077);_0x44b77b[_0x1f78('0x21')]();});}else{logger[_0x1f78('0xa')](_0x1f78('0x22'),_0x2fc077);_0x44b77b[_0x1f78('0x21')]();}}else{var _0x4d7a36=this;var _0x5770e6=new AWS['LexRuntime']({'accessKeyId':_0x42731f[0x0],'secretAccessKey':_0x42731f[0x1],'region':_0x42731f[0x2]});var _0x4c4ee1={'botAlias':'$LATEST','botName':_0x42731f[0x3],'inputText':this[_0x1f78('0x23')]['body'],'userId':this['interaction']['id']['toString']()};_0x5770e6['postText'](_0x4c4ee1,function(_0x320702,_0x3dfcad){if(_0x320702){logger['error'](_0x1f78('0xb'),_0x2fc077,_0x320702['message']);_0x44b77b['next']();}else if(_0x3dfcad&&_0x3dfcad[_0x1f78('0x23')]){_0x4d7a36['body'][_0x1f78('0x24')]=_0x3dfcad;_0x8efec8[_0x1f78('0x17')]=_0x3dfcad[_0x1f78('0x23')];return rpc[_0x5a0377+_0x1f78('0x19')][_0x1f78('0x1a')](_0x8efec8)[_0x1f78('0x1b')](function(_0x698b4d){logger[_0x1f78('0xa')](_0x1f78('0xb'),_0x2fc077,_0x8efec8['body']);if(_0x3dfcad['dialogState']==_0x1f78('0x25')){_0x44b77b[_0x1f78('0xc')]();}else{_0x44b77b[_0x1f78('0x21')]();}})[_0x1f78('0x1c')](function(_0x1192eb){logger['error'](_0x1f78('0xb'),_0x2fc077,JSON['stringify'](_0x1192eb));_0x44b77b[_0x1f78('0xc')]();});}else{_0x44b77b[_0x1f78('0xc')]();}});}}catch(_0xd9b15){logger['error'](_0x1f78('0xb'),_0x2fc077,JSON['stringify'](_0xd9b15));_0x44b77b['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 ad8fdd0..62b9ea8 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 _0x70e0=['from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','html','','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','error','finally','next','create','body','catch','stringify','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message'];(function(_0x5e6e25,_0x1bc67a){var _0x13c2ca=function(_0x24971b){while(--_0x24971b){_0x5e6e25['push'](_0x5e6e25['shift']());}};_0x13c2ca(++_0x1bc67a);}(_0x70e0,0x17b));var _0x070e=function(_0x535289,_0x5b6cf9){_0x535289=_0x535289-0x0;var _0x32c08b=_0x70e0[_0x535289];return _0x32c08b;};'use strict';var _=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var utils=require(_0x070e('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x070e('0x3')),'openchannelMessage':require(_0x070e('0x4')),'mailMessage':require(_0x070e('0x5')),'smsMessage':require(_0x070e('0x6')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x070e('0x7'));exports['consequence']=function(_0x46fe68,_0x4b041d){return function(_0x56e420){try{if(_0x4b041d[0x0]==='1'&&(_['isNil'](this[_0x070e('0x8')][_0x070e('0x9')])||!this[_0x070e('0x8')][_0x070e('0x9')])){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x070e('0xc'));return _0x56e420['next']();}var _0x49b2fb=this[_0x070e('0xd')];var _0x2e3e5e={'body':utils[_0x070e('0xe')](_0x4b041d[0x1],this),'ContactId':this[_0x070e('0xf')]['id'],'sentAt':moment()[_0x070e('0x10')](_0x070e('0x11')),'direction':_0x070e('0x12')};if(this[_0x070e('0x13')]){_0x2e3e5e['to']=this[_0x070e('0x13')][_0x070e('0x14')]||'';_0x2e3e5e['cc']=this[_0x070e('0x13')]['cc']||'';_0x2e3e5e['from']=this['message']['to']||'';_0x2e3e5e[_0x070e('0x15')]=this['message']['phone']||'';_0x2e3e5e['read']=!![];if(this[_0x070e('0x13')][_0x070e('0x16')]){_0x2e3e5e['subject']='';_0x2e3e5e['subject']+=_[_0x070e('0x17')](this[_0x070e('0x13')][_0x070e('0x16')],_0x070e('0x18'))?'':'Re:\x20';_0x2e3e5e['subject']+=this[_0x070e('0x13')][_0x070e('0x16')];}}if(this[_0x070e('0xd')]===_0x070e('0x19')){_0x2e3e5e[_0x070e('0x1a')]=this['account']['id'];}else{_0x2e3e5e[_[_0x070e('0x1b')](this[_0x070e('0xd')])+_0x070e('0x1c')]=this[_0x070e('0x1d')]['id'];}_0x2e3e5e[_[_0x070e('0x1b')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x070e('0xd')]+_0x070e('0x1e')]){if(this[_0x070e('0xd')]==='mail'){var _0x5b184={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x070e('0x1f')][_0x070e('0x20')]){_0x5b184[_0x070e('0x20')]=this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x20')];}else{_0x5b184[_0x070e('0x21')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x21')];_0x5b184[_0x070e('0x22')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x22')];_0x5b184['secure']=this['account'][_0x070e('0x1f')][_0x070e('0x23')];}if(this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x24')]){_0x5b184['auth']={'user':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x25')],'pass':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x26')]};}_0x2e3e5e[_0x070e('0x27')]=this[_0x070e('0x13')]['messageId'];_0x2e3e5e[_0x070e('0x28')]=_0x070e('0x29')+_[_0x070e('0x2a')](_0x2e3e5e['body'],'','replace','body','','sendMailMessage','then','[%s][AUTOREPLY]\x20SMTP\x20SENT','stringify'];(function(_0x2c6c15,_0x1f646f){var _0x87bb3f=function(_0x56f243){while(--_0x56f243){_0x2c6c15['push'](_0x2c6c15['shift']());}};_0x87bb3f(++_0x1f646f);}(_0xedd9,0xfc));var _0x9edd=function(_0x2e37ee,_0x553305){_0x2e37ee=_0x2e37ee-0x0;var _0x644988=_0xedd9[_0x2e37ee];return _0x644988;};'use strict';var _=require('lodash');var moment=require(_0x9edd('0x0'));var utils=require(_0x9edd('0x1'));var logger=require(_0x9edd('0x2'))(_0x9edd('0x3'));var rpc={'chatMessage':require(_0x9edd('0x4')),'openchannelMessage':require(_0x9edd('0x5')),'mailMessage':require(_0x9edd('0x6')),'smsMessage':require(_0x9edd('0x7')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x9edd('0x8'));exports[_0x9edd('0x9')]=function(_0x268f9e,_0x34c1a7){return function(_0x5319f7){try{if(_0x34c1a7[0x0]==='1'&&(_[_0x9edd('0xa')](this['interaction'][_0x9edd('0xb')])||!this[_0x9edd('0xc')][_0x9edd('0xb')])){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x9edd('0xe'));return _0x5319f7['next']();}var _0x2076fc=this[_0x9edd('0xf')];var _0x523026={'body':utils[_0x9edd('0x10')](_0x34c1a7[0x1],this),'ContactId':this[_0x9edd('0x11')]['id'],'sentAt':moment()['format'](_0x9edd('0x12')),'direction':_0x9edd('0x13')};if(this[_0x9edd('0x14')]){_0x523026['to']=this[_0x9edd('0x14')][_0x9edd('0x15')]||'';_0x523026['cc']=this[_0x9edd('0x14')]['cc']||'';_0x523026[_0x9edd('0x15')]=this[_0x9edd('0x14')]['to']||'';_0x523026['phone']=this[_0x9edd('0x14')][_0x9edd('0x16')]||'';_0x523026[_0x9edd('0x17')]=!![];if(this[_0x9edd('0x14')][_0x9edd('0x18')]){_0x523026[_0x9edd('0x18')]='';_0x523026[_0x9edd('0x18')]+=_[_0x9edd('0x19')](this['message'][_0x9edd('0x18')],_0x9edd('0x1a'))?'':_0x9edd('0x1b');_0x523026['subject']+=this[_0x9edd('0x14')][_0x9edd('0x18')];}}if(this[_0x9edd('0xf')]==='chat'){_0x523026[_0x9edd('0x1c')]=this['account']['id'];}else{_0x523026[_[_0x9edd('0x1d')](this[_0x9edd('0xf')])+'AccountId']=this['account']['id'];}_0x523026[_[_0x9edd('0x1d')](this['channel'])+_0x9edd('0x1e')]=this['interaction']['id'];if(rpc[this['channel']+_0x9edd('0x1f')]){if(this[_0x9edd('0xf')]==='mail'){var _0x5823bc={'tls':{'rejectUnauthorized':![]}};if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')]){_0x5823bc['service']=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x22')];}else{_0x5823bc[_0x9edd('0x23')]=this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x23')];_0x5823bc[_0x9edd('0x24')]=this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x24')];_0x5823bc['secure']=this['account'][_0x9edd('0x21')][_0x9edd('0x25')];}if(this[_0x9edd('0x20')][_0x9edd('0x21')][_0x9edd('0x26')]){_0x5823bc['auth']={'user':this['account'][_0x9edd('0x21')][_0x9edd('0x27')],'pass':this[_0x9edd('0x20')]['Smtp'][_0x9edd('0x28')]};}_0x523026[_0x9edd('0x29')]=this[_0x9edd('0x14')][_0x9edd('0x2a')];_0x523026['html']=_0x9edd('0x2b')+_[_0x9edd('0x2c')](_0x523026[_0x9edd('0x2d')],_0x9edd('0x2e'),_0x9edd('0x2f'))+_0x9edd('0x30');return mailRpc[_0x9edd('0x31')](_0x5823bc,_0x523026)[_0x9edd('0x32')](function(_0x19b6c1){logger[_0x9edd('0xd')](_0x9edd('0x33'),_0x268f9e);_0x523026[_0x9edd('0x2a')]=_0x19b6c1[_0x9edd('0x14')][_0x9edd('0x2a')];return rpc[_0x2076fc+_0x9edd('0x1f')]['create'](_0x523026);})[_0x9edd('0x32')](function(_0x259259){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,JSON[_0x9edd('0x34')](_0x259259));})[_0x9edd('0x35')](function(_0xde9b13){logger[_0x9edd('0x36')](_0x9edd('0x37'),_0x268f9e,JSON[_0x9edd('0x34')](_0xde9b13));})[_0x9edd('0x38')](function(){_0x5319f7[_0x9edd('0x39')]();});}else{return rpc[this[_0x9edd('0xf')]+_0x9edd('0x1f')][_0x9edd('0x3a')](_0x523026)[_0x9edd('0x32')](function(_0x27eb7e){logger[_0x9edd('0xd')]('[%s][AUTOREPLY]\x20%s',_0x268f9e,_0x523026[_0x9edd('0x2d')]);})['catch'](function(_0x968303){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x968303));})[_0x9edd('0x38')](function(){_0x5319f7['next']();});}}}catch(_0x6de835){logger[_0x9edd('0x36')](_0x9edd('0x3b'),_0x268f9e,JSON[_0x9edd('0x34')](_0x6de835));_0x5319f7[_0x9edd('0x3c')]();}};}; \ 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 48284df..24c3463 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 _0x9147=['../../rpc/smsInteraction','../../rpc/mailInteraction','consequence','info','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','interaction','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','../../rpc/chatInteraction'];(function(_0x38ffe2,_0x3c7a06){var _0x60c2d4=function(_0x555ae9){while(--_0x555ae9){_0x38ffe2['push'](_0x38ffe2['shift']());}};_0x60c2d4(++_0x3c7a06);}(_0x9147,0x7b));var _0x7914=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x9147[_0x5b561d];return _0x431060;};'use strict';var moment=require(_0x7914('0x0'));var logger=require(_0x7914('0x1'))('routing');var rpc={'chatInteraction':require(_0x7914('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x7914('0x3')),'mailInteraction':require(_0x7914('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};exports[_0x7914('0x5')]=function(_0x42d5ac,_0x28f320,_0x5da333,_0x34c372){return function(_0x4dd321){try{logger[_0x7914('0x6')]('[%s][CLOSE]\x20reason\x20%s',_0x42d5ac,_0x28f320[0x0]);var _0xdac92f={'closed':0x1,'closedAt':moment()[_0x7914('0x7')](_0x7914('0x8')),'closeReason':_0x7914('0x9'),'disposition':_0x28f320[0x0]};if(rpc[_0x34c372[_0x7914('0xa')]+_0x7914('0xb')]){rpc[_0x34c372[_0x7914('0xa')]+_0x7914('0xb')][_0x7914('0xc')](_0x34c372[_0x7914('0xd')]['id'],_0xdac92f)[_0x7914('0xe')](function(_0x1b03b6){logger[_0x7914('0x6')](_0x7914('0xf'),_0x42d5ac,_0x34c372[_0x7914('0xd')]['id']);})['catch'](function(_0x290117){logger[_0x7914('0x10')](_0x7914('0x11'),_0x42d5ac,JSON[_0x7914('0x12')](_0x290117));})[_0x7914('0x13')](function(){_0x4dd321['stop']();});}}catch(_0x1eaf65){logger[_0x7914('0x10')](_0x7914('0x11'),_0x42d5ac,JSON['stringify'](_0x1eaf65));_0x4dd321[_0x7914('0x14')]();}};}; \ No newline at end of file +var _0x3670=['../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','Interaction','update','then','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','interaction','catch','error','[%s][CLOSE]\x20%s','stringify','stop','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction'];(function(_0x110dba,_0x36ae51){var _0x1203d3=function(_0x2c29be){while(--_0x2c29be){_0x110dba['push'](_0x110dba['shift']());}};_0x1203d3(++_0x36ae51);}(_0x3670,0x16c));var _0x0367=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3670[_0x14add3];return _0x4a174f;};'use strict';var moment=require('moment');var logger=require(_0x0367('0x0'))(_0x0367('0x1'));var rpc={'chatInteraction':require(_0x0367('0x2')),'openchannelInteraction':require(_0x0367('0x3')),'smsInteraction':require(_0x0367('0x4')),'mailInteraction':require(_0x0367('0x5')),'faxInteraction':require(_0x0367('0x6'))};exports['consequence']=function(_0x468a08,_0x241aac,_0x1edfd8,_0x1e2fc5){return function(_0x81110e){try{logger[_0x0367('0x7')](_0x0367('0x8'),_0x468a08,_0x241aac[0x0]);var _0x55f08e={'closed':0x1,'closedAt':moment()[_0x0367('0x9')](_0x0367('0xa')),'closeReason':_0x0367('0xb'),'disposition':_0x241aac[0x0]};if(rpc[_0x1e2fc5[_0x0367('0xc')]+_0x0367('0xd')]){rpc[_0x1e2fc5[_0x0367('0xc')]+_0x0367('0xd')][_0x0367('0xe')](_0x1e2fc5['interaction']['id'],_0x55f08e)[_0x0367('0xf')](function(_0x50e13b){logger[_0x0367('0x7')](_0x0367('0x10'),_0x468a08,_0x1e2fc5[_0x0367('0x11')]['id']);})[_0x0367('0x12')](function(_0xbbcf61){logger[_0x0367('0x13')](_0x0367('0x14'),_0x468a08,JSON[_0x0367('0x15')](_0xbbcf61));})['finally'](function(){_0x81110e[_0x0367('0x16')]();});}}catch(_0x287b86){logger['error'](_0x0367('0x14'),_0x468a08,JSON[_0x0367('0x15')](_0x287b86));_0x81110e[_0x0367('0x16')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 6c34bba..a4834e8 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 _0x8061=['endConversation','error','catch','message','lodash','moment','apiai-promise','md5','./utils','../../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','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','AccountId','created','isEmpty','body','getMustacheRender','Message','create','then','stringify','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech'];(function(_0x3160f4,_0x568d89){var _0x2d1eef=function(_0x4b5e2e){while(--_0x4b5e2e){_0x3160f4['push'](_0x3160f4['shift']());}};_0x2d1eef(++_0x568d89);}(_0x8061,0xe5));var _0x1806=function(_0x196cc9,_0x214f92){_0x196cc9=_0x196cc9-0x0;var _0x1a2238=_0x8061[_0x196cc9];return _0x1a2238;};'use strict';var _=require(_0x1806('0x0'));var moment=require(_0x1806('0x1'));var apiai=require(_0x1806('0x2'));var md5=require(_0x1806('0x3'));var utils=require(_0x1806('0x4'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x1806('0x5')),'mailMessage':require(_0x1806('0x6')),'smsMessage':require(_0x1806('0x7')),'faxMessage':require(_0x1806('0x8'))};exports[_0x1806('0x9')]=function(_0x44b703,_0x563584){return function(_0x30a429){try{if(!_[_0x1806('0xa')](this[_0x1806('0xb')][_0x1806('0xc')])){logger[_0x1806('0xd')](_0x1806('0xe'),_0x44b703,_0x1806('0xf'));return _0x30a429[_0x1806('0x10')]();}var _0x3edd62={'ContactId':this[_0x1806('0x11')]['id'],'sentAt':moment()['format'](_0x1806('0x12')),'direction':_0x1806('0x13')};var _0x533961=this[_0x1806('0x14')];if(_0x533961===_0x1806('0x15')){_0x3edd62[_0x1806('0x16')]=this[_0x1806('0x17')]['id'];}else{_0x3edd62[_['upperFirst'](_0x533961)+_0x1806('0x18')]=this[_0x1806('0x17')]['id'];}_0x3edd62[_['upperFirst'](_0x533961)+'InteractionId']=this[_0x1806('0xb')]['id'];if(this[_0x1806('0xb')][_0x1806('0x19')]){var _0x52a2eb=_0x563584[0x2];if(!_[_0x1806('0x1a')](_0x52a2eb)){_0x3edd62[_0x1806('0x1b')]=utils[_0x1806('0x1c')](_0x52a2eb,this);return rpc[_0x533961+_0x1806('0x1d')][_0x1806('0x1e')](_0x3edd62)[_0x1806('0x1f')](function(_0x2fafd9){logger[_0x1806('0xd')]('[%s][DIALOGFLOW]\x20%s',_0x44b703,_0x3edd62[_0x1806('0x1b')]);})['catch'](function(_0x2d7b97){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x44b703,JSON[_0x1806('0x20')](_0x2d7b97));})['finally'](function(){logger['info'](_0x1806('0x21'),_0x44b703);_0x30a429[_0x1806('0x22')]();});}else{logger[_0x1806('0xd')](_0x1806('0x23'),_0x44b703);_0x30a429['stop']();}}else{var _0x469cd3=this;var _0x535b89=apiai(_0x563584[0x0],{'language':_0x563584[0x1]||'en'});return _0x535b89[_0x1806('0x24')](this['message'][_0x1806('0x1b')],{'sessionId':md5(this[_0x1806('0xb')]['id'])})[_0x1806('0x1f')](function(_0x3a1922){_0x469cd3[_0x1806('0x1b')][_0x1806('0x25')]=_0x3a1922;_0x3edd62[_0x1806('0x1b')]=_0x3a1922[_0x1806('0x26')][_0x1806('0x27')][_0x1806('0x28')];return rpc[_0x533961+_0x1806('0x1d')][_0x1806('0x1e')](_0x3edd62)['then'](function(_0xaac96a){logger['info'](_0x1806('0xe'),_0x44b703,_0x3edd62[_0x1806('0x1b')]);if(_0x3a1922[_0x1806('0x26')]['metadata'][_0x1806('0x29')]){_0x30a429[_0x1806('0x10')]();}else{_0x30a429[_0x1806('0x22')]();}})['catch'](function(_0x10fcfd){logger[_0x1806('0x2a')](_0x1806('0xe'),_0x44b703,JSON['stringify'](_0x10fcfd));_0x30a429[_0x1806('0x10')]();});})[_0x1806('0x2b')](function(_0x4b8a85){logger[_0x1806('0x2a')](_0x1806('0xe'),_0x44b703,_0x4b8a85[_0x1806('0x2c')]);_0x30a429[_0x1806('0x10')]();});}}catch(_0x767423){logger[_0x1806('0x2a')]('[%s][DIALOGFLOW]\x20%s',_0x44b703,JSON[_0x1806('0x20')](_0x767423));_0x30a429['stop']();}};}; \ No newline at end of file +var _0xe9cc=['format','out','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','Message','create','then','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','metadata','endConversation','catch','error','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xe9cc,0x9a));var _0xce9c=function(_0x308c20,_0x2abe53){_0x308c20=_0x308c20-0x0;var _0x2ecd38=_0xe9cc[_0x308c20];return _0x2ecd38;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require('apiai-promise');var md5=require('md5');var utils=require(_0xce9c('0x0'));var logger=require('../../../../config/logger')(_0xce9c('0x1'));var rpc={'chatMessage':require(_0xce9c('0x2')),'openchannelMessage':require(_0xce9c('0x3')),'mailMessage':require(_0xce9c('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0xce9c('0x5'))};exports['consequence']=function(_0x4e2898,_0x449d92){return function(_0x2227c3){try{if(!_[_0xce9c('0x6')](this[_0xce9c('0x7')][_0xce9c('0x8')])){logger[_0xce9c('0x9')](_0xce9c('0xa'),_0x4e2898,_0xce9c('0xb'));return _0x2227c3[_0xce9c('0xc')]();}var _0x5bd977={'ContactId':this[_0xce9c('0xd')]['id'],'sentAt':moment()[_0xce9c('0xe')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xce9c('0xf')};var _0x169a4b=this['channel'];if(_0x169a4b===_0xce9c('0x10')){_0x5bd977[_0xce9c('0x11')]=this[_0xce9c('0x12')]['id'];}else{_0x5bd977[_[_0xce9c('0x13')](_0x169a4b)+_0xce9c('0x14')]=this['account']['id'];}_0x5bd977[_[_0xce9c('0x13')](_0x169a4b)+_0xce9c('0x15')]=this[_0xce9c('0x7')]['id'];if(this[_0xce9c('0x7')][_0xce9c('0x16')]){var _0x446bb7=_0x449d92[0x2];if(!_[_0xce9c('0x17')](_0x446bb7)){_0x5bd977[_0xce9c('0x18')]=utils[_0xce9c('0x19')](_0x446bb7,this);return rpc[_0x169a4b+_0xce9c('0x1a')][_0xce9c('0x1b')](_0x5bd977)[_0xce9c('0x1c')](function(_0x191fdf){logger[_0xce9c('0x9')](_0xce9c('0xa'),_0x4e2898,_0x5bd977['body']);})['catch'](function(_0x362f01){logger['error'](_0xce9c('0xa'),_0x4e2898,JSON[_0xce9c('0x1d')](_0x362f01));})[_0xce9c('0x1e')](function(){logger[_0xce9c('0x9')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x4e2898);_0x2227c3[_0xce9c('0x1f')]();});}else{logger[_0xce9c('0x9')](_0xce9c('0x20'),_0x4e2898);_0x2227c3[_0xce9c('0x1f')]();}}else{var _0x58d5b7=this;var _0x30e4f0=apiai(_0x449d92[0x0],{'language':_0x449d92[0x1]||'en'});return _0x30e4f0[_0xce9c('0x21')](this[_0xce9c('0x22')][_0xce9c('0x18')],{'sessionId':md5(this[_0xce9c('0x7')]['id'])})[_0xce9c('0x1c')](function(_0x30a04d){_0x58d5b7[_0xce9c('0x18')][_0xce9c('0x23')]=_0x30a04d;_0x5bd977['body']=_0x30a04d[_0xce9c('0x24')][_0xce9c('0x25')]['speech'];return rpc[_0x169a4b+_0xce9c('0x1a')]['create'](_0x5bd977)[_0xce9c('0x1c')](function(_0x509c98){logger['info'](_0xce9c('0xa'),_0x4e2898,_0x5bd977[_0xce9c('0x18')]);if(_0x30a04d[_0xce9c('0x24')][_0xce9c('0x26')][_0xce9c('0x27')]){_0x2227c3['next']();}else{_0x2227c3[_0xce9c('0x1f')]();}})['catch'](function(_0x2e5519){logger['error'](_0xce9c('0xa'),_0x4e2898,JSON[_0xce9c('0x1d')](_0x2e5519));_0x2227c3[_0xce9c('0xc')]();});})[_0xce9c('0x28')](function(_0x55c7e7){logger[_0xce9c('0x29')](_0xce9c('0xa'),_0x4e2898,_0x55c7e7[_0xce9c('0x22')]);_0x2227c3[_0xce9c('0xc')]();});}}catch(_0x5d46a7){logger[_0xce9c('0x29')](_0xce9c('0xa'),_0x4e2898,JSON[_0xce9c('0x1d')](_0x5d46a7));_0x2227c3['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index 201b835..1ec5bf6 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 _0x94ae=['rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20true\x20is\x20a\x20number','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s'];(function(_0x1b6edf,_0x1ca352){var _0x55bf4e=function(_0x30f714){while(--_0x30f714){_0x1b6edf['push'](_0x1b6edf['shift']());}};_0x55bf4e(++_0x1ca352);}(_0x94ae,0x19a));var _0xe94a=function(_0x2dad33,_0x314bb4){_0x2dad33=_0x2dad33-0x0;var _0x2dc233=_0x94ae[_0x2dad33];return _0x2dc233;};'use strict';var schema=require(_0xe94a('0x0'));var _=require('lodash');var htmlToText=require(_0xe94a('0x1'));var utils=require(_0xe94a('0x2'));var logger=require(_0xe94a('0x3'))(_0xe94a('0x4'));var gotoif=schema({'condition':{'type':_0xe94a('0x5'),'required':!![],'message':_0xe94a('0x6')},'priorityTrue':{'type':'number','message':_0xe94a('0x7')},'priorityFalse':{'type':_0xe94a('0x8'),'message':_0xe94a('0x9')}});exports[_0xe94a('0xa')]=function(_0x7ea183,_0x52345f){return function(_0x1af827){try{var _0x45c9de={'condition':htmlToText[_0xe94a('0xb')](utils[_0xe94a('0xc')](_0x52345f[0x0],this),{'wordwrap':![]})[_0xe94a('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x52345f[0x1],'priorityFalse':_0x52345f[0x2]};var _0x5da58=gotoif[_0xe94a('0x0')](_0x45c9de,{'typecast':!![]});if(_0x5da58[_0xe94a('0xe')]){logger[_0xe94a('0xf')](_0xe94a('0x10'),_0x7ea183,_['map'](_0x5da58,_0xe94a('0x11'))[_0xe94a('0x12')](',\x20'));_0x1af827[_0xe94a('0x13')]();}else{try{var _0xe013bc=eval('('+_0x45c9de[_0xe94a('0x14')]+')');var _0x1bd742=_0xe013bc?_0x45c9de[_0xe94a('0x15')]:_0x45c9de[_0xe94a('0x16')];logger[_0xe94a('0x17')](_0xe94a('0x18'),_0x7ea183,_0x45c9de[_0xe94a('0x14')],_0xe013bc,_0x1bd742||'next');if(_0x1bd742){var _0x266007=_['findIndex'](_0x1af827[_0xe94a('0x19')](),{'p':_0x1bd742});if(_0x266007>=0x0){logger[_0xe94a('0x17')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x7ea183,_0x1bd742||_0xe94a('0x1a'),_0x266007);_0x1af827['next'](_0x266007);}else{logger[_0xe94a('0x17')](_0xe94a('0x1b'),_0x7ea183,_0x1bd742||_0xe94a('0x1a'));_0x1af827[_0xe94a('0x13')]();}}else{_0x1af827['next']();}}catch(_0x47a518){logger[_0xe94a('0xf')]('[%s][GOTOIF]\x20eval\x20error:\x20%s',_0x7ea183,_0x47a518[_0xe94a('0x11')]);_0x1af827[_0xe94a('0x13')]();}}}catch(_0x5434b5){logger[_0xe94a('0xf')](_0xe94a('0x10'),_0x7ea183,JSON[_0xe94a('0x1c')](_0x5434b5));_0x1af827[_0xe94a('0x13')]();}};}; \ No newline at end of file +var _0xfaad=['validate','html-to-text','./utils','../../../../config/logger','string','number','priority\x20true\x20is\x20a\x20number','priority\x20false\x20is\x20a\x20number','consequence','error','[%s][GOTOIF]\x20%s','map','message','join','stop','condition','priorityTrue','priorityFalse','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','info','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify'];(function(_0x243b59,_0x3f9495){var _0x3e1676=function(_0x354052){while(--_0x354052){_0x243b59['push'](_0x243b59['shift']());}};_0x3e1676(++_0x3f9495);}(_0xfaad,0x1ba));var _0xdfaa=function(_0x40d3c2,_0x426797){_0x40d3c2=_0x40d3c2-0x0;var _0x36a5ae=_0xfaad[_0x40d3c2];return _0x36a5ae;};'use strict';var schema=require(_0xdfaa('0x0'));var _=require('lodash');var htmlToText=require(_0xdfaa('0x1'));var utils=require(_0xdfaa('0x2'));var logger=require(_0xdfaa('0x3'))('routing');var gotoif=schema({'condition':{'type':_0xdfaa('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0xdfaa('0x5'),'message':_0xdfaa('0x6')},'priorityFalse':{'type':_0xdfaa('0x5'),'message':_0xdfaa('0x7')}});exports[_0xdfaa('0x8')]=function(_0x413316,_0x2d516b){return function(_0x7c4744){try{var _0x5e88dd={'condition':htmlToText['fromString'](utils['getMustacheRender'](_0x2d516b[0x0],this),{'wordwrap':![]})['replace'](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2d516b[0x1],'priorityFalse':_0x2d516b[0x2]};var _0x319438=gotoif['validate'](_0x5e88dd,{'typecast':!![]});if(_0x319438['length']){logger[_0xdfaa('0x9')](_0xdfaa('0xa'),_0x413316,_[_0xdfaa('0xb')](_0x319438,_0xdfaa('0xc'))[_0xdfaa('0xd')](',\x20'));_0x7c4744[_0xdfaa('0xe')]();}else{try{var _0x3c8395=eval('('+_0x5e88dd[_0xdfaa('0xf')]+')');var _0x42d1cb=_0x3c8395?_0x5e88dd[_0xdfaa('0x10')]:_0x5e88dd[_0xdfaa('0x11')];logger['info'](_0xdfaa('0x12'),_0x413316,_0x5e88dd['condition'],_0x3c8395,_0x42d1cb||_0xdfaa('0x13'));if(_0x42d1cb){var _0xc6fd6d=_['findIndex'](_0x7c4744[_0xdfaa('0x14')](),{'p':_0x42d1cb});if(_0xc6fd6d>=0x0){logger[_0xdfaa('0x15')](_0xdfaa('0x16'),_0x413316,_0x42d1cb||_0xdfaa('0x13'),_0xc6fd6d);_0x7c4744[_0xdfaa('0x13')](_0xc6fd6d);}else{logger[_0xdfaa('0x15')](_0xdfaa('0x17'),_0x413316,_0x42d1cb||'next');_0x7c4744[_0xdfaa('0xe')]();}}else{_0x7c4744['next']();}}catch(_0x5051cb){logger[_0xdfaa('0x9')](_0xdfaa('0x18'),_0x413316,_0x5051cb[_0xdfaa('0xc')]);_0x7c4744[_0xdfaa('0xe')]();}}}catch(_0x3d7825){logger[_0xdfaa('0x9')](_0xdfaa('0xa'),_0x413316,JSON[_0xdfaa('0x19')](_0x3d7825));_0x7c4744[_0xdfaa('0xe')]();}};}; \ 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 d3d6d84..1209752 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 _0xa1cd=['stringify','validate','../../../../config/logger','routing','number','consequence','error','[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found'];(function(_0x15b380,_0x1a3c5f){var _0x232c5c=function(_0x12f8e0){while(--_0x12f8e0){_0x15b380['push'](_0x15b380['shift']());}};_0x232c5c(++_0x1a3c5f);}(_0xa1cd,0xb5));var _0xda1c=function(_0x3e17b8,_0x48aed8){_0x3e17b8=_0x3e17b8-0x0;var _0x591410=_0xa1cd[_0x3e17b8];return _0x591410;};'use strict';var schema=require(_0xda1c('0x0'));var _=require('lodash');var logger=require(_0xda1c('0x1'))(_0xda1c('0x2'));var gotop=schema({'priority':{'type':_0xda1c('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xda1c('0x4')]=function(_0x25fd63,_0x1593b8){return function(_0x5ca4cf){try{var _0xa308df={'priority':_0x1593b8[0x0]};var _0xf33ce8=gotop[_0xda1c('0x0')](_0xa308df,{'typecast':!![]});if(_0xf33ce8['length']){logger[_0xda1c('0x5')](_0xda1c('0x6'),_0x25fd63,_[_0xda1c('0x7')](_0xf33ce8,_0xda1c('0x8'))[_0xda1c('0x9')](',\x20'));_0x5ca4cf[_0xda1c('0xa')]();}else{logger[_0xda1c('0xb')](_0xda1c('0xc'),_0x25fd63,_0xa308df[_0xda1c('0xd')]);if(_0xa308df[_0xda1c('0xd')]){var _0x1ed9a6=_['findIndex'](_0x5ca4cf['rules'](),{'p':_0xa308df['priority']});if(_0x1ed9a6>=0x0){logger[_0xda1c('0xb')](_0xda1c('0xe'),_0x25fd63,_0xa308df[_0xda1c('0xd')]||'next',_0x1ed9a6);_0x5ca4cf[_0xda1c('0xf')](_0x1ed9a6);}else{logger[_0xda1c('0xb')](_0xda1c('0x10'),_0x25fd63,_0xa308df[_0xda1c('0xd')]||_0xda1c('0xf'));_0x5ca4cf[_0xda1c('0xa')]();}}else{_0x5ca4cf[_0xda1c('0xf')]();}}}catch(_0x353d90){logger[_0xda1c('0x5')]('[%s][GOTOP]\x20%s',_0x25fd63,JSON[_0xda1c('0x11')](_0x353d90));_0x5ca4cf['stop']();}};}; \ No newline at end of file +var _0x81fb=['map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','stringify','validate','lodash','routing','number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','[%s][GOTOP]\x20%s'];(function(_0x1911ed,_0x4e8c73){var _0x11edaa=function(_0x216008){while(--_0x216008){_0x1911ed['push'](_0x1911ed['shift']());}};_0x11edaa(++_0x4e8c73);}(_0x81fb,0x128));var _0xb81f=function(_0x2f6056,_0x2bb258){_0x2f6056=_0x2f6056-0x0;var _0x1983d8=_0x81fb[_0x2f6056];return _0x1983d8;};'use strict';var schema=require(_0xb81f('0x0'));var _=require(_0xb81f('0x1'));var logger=require('../../../../config/logger')(_0xb81f('0x2'));var gotop=schema({'priority':{'type':_0xb81f('0x3'),'required':!![],'message':_0xb81f('0x4')}});exports['consequence']=function(_0x435bd4,_0x27abc7){return function(_0x32eb8c){try{var _0x13084={'priority':_0x27abc7[0x0]};var _0x2e61f3=gotop[_0xb81f('0x0')](_0x13084,{'typecast':!![]});if(_0x2e61f3[_0xb81f('0x5')]){logger[_0xb81f('0x6')](_0xb81f('0x7'),_0x435bd4,_[_0xb81f('0x8')](_0x2e61f3,_0xb81f('0x9'))['join'](',\x20'));_0x32eb8c[_0xb81f('0xa')]();}else{logger[_0xb81f('0xb')](_0xb81f('0xc'),_0x435bd4,_0x13084[_0xb81f('0xd')]);if(_0x13084[_0xb81f('0xd')]){var _0x14add2=_[_0xb81f('0xe')](_0x32eb8c[_0xb81f('0xf')](),{'p':_0x13084['priority']});if(_0x14add2>=0x0){logger[_0xb81f('0xb')](_0xb81f('0x10'),_0x435bd4,_0x13084['priority']||'next',_0x14add2);_0x32eb8c[_0xb81f('0x11')](_0x14add2);}else{logger['info']('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x435bd4,_0x13084[_0xb81f('0xd')]||_0xb81f('0x11'));_0x32eb8c[_0xb81f('0xa')]();}}else{_0x32eb8c['next']();}}}catch(_0x47b5b4){logger[_0xb81f('0x6')](_0xb81f('0x7'),_0x435bd4,JSON[_0xb81f('0x12')](_0x47b5b4));_0x32eb8c[_0xb81f('0xa')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/message.js b/server/services/routing/server/applications/message.js index 37e673a..5bafda1 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 _0xddb2=['InteractionId','Message','[%s][MESSAGE]\x20%s','body','catch','error','stringify','stop','lodash','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','contact','channel','chat','ChatWebsiteId','AccountId','account'];(function(_0x5b74ba,_0x2621f0){var _0x478220=function(_0x241e11){while(--_0x241e11){_0x5b74ba['push'](_0x5b74ba['shift']());}};_0x478220(++_0x2621f0);}(_0xddb2,0xa2));var _0x2ddb=function(_0x14b3b2,_0x465560){_0x14b3b2=_0x14b3b2-0x0;var _0x41049e=_0xddb2[_0x14b3b2];return _0x41049e;};'use strict';var _=require(_0x2ddb('0x0'));var utils=require(_0x2ddb('0x1'));var logger=require(_0x2ddb('0x2'))(_0x2ddb('0x3'));var rpc={'chatMessage':require(_0x2ddb('0x4')),'openchannelMessage':require(_0x2ddb('0x5')),'mailMessage':require(_0x2ddb('0x6')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x2ddb('0x7'))};exports['consequence']=function(_0x1d58c7,_0x520a53){return function(_0x351f45){try{var _0x511dd9={'body':utils['getMustacheRender'](_0x520a53[0x0],this),'ContactId':this[_0x2ddb('0x8')]['id']};if(this[_0x2ddb('0x9')]===_0x2ddb('0xa')){_0x511dd9[_0x2ddb('0xb')]=this['account']['id'];}else{_0x511dd9[_['upperFirst'](this[_0x2ddb('0x9')])+_0x2ddb('0xc')]=this[_0x2ddb('0xd')]['id'];}_0x511dd9[_['upperFirst'](this[_0x2ddb('0x9')])+_0x2ddb('0xe')]=this['interaction']['id'];if(rpc[this[_0x2ddb('0x9')]+'Message']){return rpc[this['channel']+_0x2ddb('0xf')]['create'](_0x511dd9)['then'](function(_0xd9741a){logger['info'](_0x2ddb('0x10'),_0x1d58c7,_0x511dd9[_0x2ddb('0x11')]);_0x351f45['next']();})[_0x2ddb('0x12')](function(_0x496c89){logger[_0x2ddb('0x13')](_0x2ddb('0x10'),_0x1d58c7,JSON['stringify'](_0x496c89));_0x351f45['stop']();});}}catch(_0x51698f){logger[_0x2ddb('0x13')](_0x2ddb('0x10'),_0x1d58c7,JSON[_0x2ddb('0x14')](_0x51698f));_0x351f45[_0x2ddb('0x15')]();}};}; \ No newline at end of file +var _0x53fe=['../../../../config/logger','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','chat','account','upperFirst','channel','interaction','Message','create','then','info','body','error','[%s][MESSAGE]\x20%s','stringify','stop','./utils'];(function(_0x494fa2,_0x84b5d8){var _0xf013c7=function(_0x348859){while(--_0x348859){_0x494fa2['push'](_0x494fa2['shift']());}};_0xf013c7(++_0x84b5d8);}(_0x53fe,0x83));var _0xe53f=function(_0x33a47b,_0x5751fc){_0x33a47b=_0x33a47b-0x0;var _0x5b5751=_0x53fe[_0x33a47b];return _0x5b5751;};'use strict';var _=require('lodash');var utils=require(_0xe53f('0x0'));var logger=require(_0xe53f('0x1'))(_0xe53f('0x2'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xe53f('0x3')),'mailMessage':require(_0xe53f('0x4')),'smsMessage':require(_0xe53f('0x5')),'faxMessage':require(_0xe53f('0x6'))};exports[_0xe53f('0x7')]=function(_0x3bbb37,_0x13d368){return function(_0x38fdc8){try{var _0x71fcca={'body':utils['getMustacheRender'](_0x13d368[0x0],this),'ContactId':this['contact']['id']};if(this['channel']===_0xe53f('0x8')){_0x71fcca['ChatWebsiteId']=this[_0xe53f('0x9')]['id'];}else{_0x71fcca[_[_0xe53f('0xa')](this['channel'])+'AccountId']=this['account']['id'];}_0x71fcca[_[_0xe53f('0xa')](this[_0xe53f('0xb')])+'InteractionId']=this[_0xe53f('0xc')]['id'];if(rpc[this[_0xe53f('0xb')]+'Message']){return rpc[this[_0xe53f('0xb')]+_0xe53f('0xd')][_0xe53f('0xe')](_0x71fcca)[_0xe53f('0xf')](function(_0x4dcfc8){logger[_0xe53f('0x10')]('[%s][MESSAGE]\x20%s',_0x3bbb37,_0x71fcca[_0xe53f('0x11')]);_0x38fdc8['next']();})['catch'](function(_0x4abc98){logger[_0xe53f('0x12')](_0xe53f('0x13'),_0x3bbb37,JSON[_0xe53f('0x14')](_0x4abc98));_0x38fdc8[_0xe53f('0x15')]();});}}catch(_0x402d7a){logger[_0xe53f('0x12')](_0xe53f('0x13'),_0x3bbb37,JSON[_0xe53f('0x14')](_0x402d7a));_0x38fdc8[_0xe53f('0x15')]();}};}; \ 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 6ee6753..09629af 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 _0xd1f2=['./utils','../../../../config/logger','routing','consequence','info','[%s][NOOP]\x20%s','getMustacheRender','stringify'];(function(_0x10ddc4,_0x29acf9){var _0x1fdb84=function(_0x57c7e4){while(--_0x57c7e4){_0x10ddc4['push'](_0x10ddc4['shift']());}};_0x1fdb84(++_0x29acf9);}(_0xd1f2,0x130));var _0x2d1f=function(_0x49550,_0xcc8486){_0x49550=_0x49550-0x0;var _0x52f4b1=_0xd1f2[_0x49550];return _0x52f4b1;};'use strict';var utils=require(_0x2d1f('0x0'));var logger=require(_0x2d1f('0x1'))(_0x2d1f('0x2'));exports[_0x2d1f('0x3')]=function(_0x56a856,_0x22a880){return function(_0x5289c8){try{logger[_0x2d1f('0x4')](_0x2d1f('0x5'),_0x56a856,utils[_0x2d1f('0x6')](_0x22a880[0x0],this));_0x5289c8['next']();}catch(_0x525bb0){logger['error'](_0x2d1f('0x5'),_0x56a856,JSON[_0x2d1f('0x7')](_0x525bb0));_0x5289c8['stop']();}};}; \ No newline at end of file +var _0x9e66=['error','stringify','stop','./utils','routing','info','[%s][NOOP]\x20%s','getMustacheRender','next'];(function(_0x3ab37e,_0x4c77ec){var _0x31d0b8=function(_0xeb195d){while(--_0xeb195d){_0x3ab37e['push'](_0x3ab37e['shift']());}};_0x31d0b8(++_0x4c77ec);}(_0x9e66,0x6f));var _0x69e6=function(_0x2cf5bf,_0x10ffb3){_0x2cf5bf=_0x2cf5bf-0x0;var _0x4bfa07=_0x9e66[_0x2cf5bf];return _0x4bfa07;};'use strict';var utils=require(_0x69e6('0x0'));var logger=require('../../../../config/logger')(_0x69e6('0x1'));exports['consequence']=function(_0x396ea9,_0x2b9b4b){return function(_0x1636d7){try{logger[_0x69e6('0x2')](_0x69e6('0x3'),_0x396ea9,utils[_0x69e6('0x4')](_0x2b9b4b[0x0],this));_0x1636d7[_0x69e6('0x5')]();}catch(_0x1d2f15){logger[_0x69e6('0x6')]('[%s][NOOP]\x20%s',_0x396ea9,JSON[_0x69e6('0x7')](_0x1d2f15));_0x1636d7[_0x69e6('0x8')]();}};}; \ 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 ea3edd4..5d08ec7 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 _0x8fa3=['queue','from','queue_id','format','pick','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId','InteractionId','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','error','create\x20queue\x20report','waiting','accepted','update','catch','update\x20queue\x20report','timeout','consequence','length','[%s][QUEUE]\x20%s','map','join','stop','createQueue','atimeout','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','next','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','validate','util','seq-queue','moment','routing','./strategy','redis','defaults','localhost','account'];(function(_0xa73576,_0x4b8d9c){var _0x4f9c9d=function(_0x40b72e){while(--_0x40b72e){_0xa73576['push'](_0xa73576['shift']());}};_0x4f9c9d(++_0x4b8d9c);}(_0x8fa3,0x7c));var _0x38fa=function(_0x5bda2c,_0x1cf31d){_0x5bda2c=_0x5bda2c-0x0;var _0x16b2bb=_0x8fa3[_0x5bda2c];return _0x16b2bb;};'use strict';var schema=require(_0x38fa('0x0'));var _=require('lodash');var util=require(_0x38fa('0x1'));var seqqueue=require(_0x38fa('0x2'));var moment=require(_0x38fa('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x38fa('0x4'));var strategy=require(_0x38fa('0x5'));config[_0x38fa('0x6')]=_[_0x38fa('0x7')](config['redis'],{'host':_0x38fa('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x38fa('0x6')]));var attributes=['id','queue_id',_0x38fa('0x9'),_0x38fa('0xa'),_0x38fa('0xb'),'joinAt'];function emit(_0x5aa7e3,_0x4e441a,_0x5d8ad3){io['to'](_0x5aa7e3)['emit'](_0x4e441a,_0x5d8ad3);}function emitChannelQueueInteraction(_0x10845b,_0x2d6afe,_0xd5c5e0,_0x339626,_0x598968,_0xa39e93,_0x483366,_0x36acba){_0xd5c5e0[_0x38fa('0xc')]=_0x36acba;_0xd5c5e0[_0x38fa('0xa')]=_0x2d6afe;_0xd5c5e0[_0x38fa('0x9')]=_0x339626;_0xd5c5e0['id']=_0x598968;if(_0xa39e93){_0x483366[util[_0x38fa('0xd')]('%sQueuesWaitingInteractions',_0x10845b)][_0x598968]=_[_0x38fa('0xe')](_0xd5c5e0,attributes);}else{delete _0x483366[util['format']('%sQueuesWaitingInteractions',_0x10845b)][_0x598968];}emit(util[_0x38fa('0xd')]('%s:queue:%s',_0x10845b,_0x2d6afe),util[_0x38fa('0xd')](_0x38fa('0xf'),_0x10845b,_0xa39e93?_0x38fa('0x10'):_0x38fa('0x11')),_[_0x38fa('0xe')](_0xd5c5e0,attributes));}var rpc={'openchannelQueueReport':require(_0x38fa('0x12')),'mailQueueReport':require(_0x38fa('0x13')),'chatQueueReport':require(_0x38fa('0x14')),'smsQueueReport':require(_0x38fa('0x15')),'faxQueueReport':require(_0x38fa('0x16'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x38fa('0x17')},'timeout':{'type':_0x38fa('0x18'),'message':_0x38fa('0x19')}});function startRouting(_0x3d4ce1,_0x2fd4a8,_0x41158a,_0x316b76){if(_0x3d4ce1&&_0x2fd4a8&&_0x41158a){_0x2fd4a8['waiting']+=0x1;var _0x13bc1f={'uniqueid':_0x3d4ce1,'from':_0x41158a['body']?_0x41158a[_0x38fa('0x1a')][_0x38fa('0xb')]:'','joinAt':moment()[_0x38fa('0xd')](_0x38fa('0x1b')),'ContactId':_0x41158a[_0x38fa('0x1c')]?_0x41158a[_0x38fa('0x1c')]['id']:null,'ListId':_0x41158a[_0x38fa('0x1d')]?_0x41158a[_0x38fa('0x1d')]['id']:null};_0x13bc1f[_[_0x38fa('0x1e')](_0x41158a[_0x38fa('0x1f')])+_0x38fa('0x20')]=_0x2fd4a8['id']||null;_0x13bc1f[_[_0x38fa('0x1e')](_0x41158a[_0x38fa('0x1f')])+_0x38fa('0x21')]=_0x41158a['interaction']?_0x41158a['interaction']['id']:null;_0x13bc1f[_['upperFirst'](_0x41158a[_0x38fa('0x1f')])+_0x38fa('0x22')]=_0x41158a[_0x38fa('0x23')]?_0x41158a[_0x38fa('0x23')]['id']:null;_0x13bc1f[_[_0x38fa('0x1e')](_0x41158a[_0x38fa('0x1f')])+(_0x41158a[_0x38fa('0x1f')]!==_0x38fa('0x24')?_0x38fa('0x25'):'WebsiteId')]=_0x41158a['account']?_0x41158a['account']['id']:null;logger[_0x38fa('0x26')](util[_0x38fa('0xd')](_0x38fa('0x27'),_0x3d4ce1,_0x2fd4a8[_0x38fa('0x28')]));emitChannelQueueInteraction(_0x41158a[_0x38fa('0x1f')],_0x2fd4a8['name'],_0x13bc1f,_0x41158a[_0x38fa('0x9')]['name'],_0x41158a[_0x38fa('0x23')]['id'],!![],_0x316b76,_0x2fd4a8['id']);if(rpc[_0x41158a[_0x38fa('0x1f')]+_0x38fa('0x29')]){return rpc[_0x41158a['channel']+_0x38fa('0x29')][_0x38fa('0x2a')](_0x13bc1f)['catch'](function(_0x1326f4){logger[_0x38fa('0x2b')](_0x38fa('0x2c'));});}}}function stopRouting(_0x4fe863,_0x596950,_0x4a3954,_0x5c69d9){if(_0x4fe863&&_0x596950){_0x596950[_0x38fa('0x2d')]-=0x1;var _0x58c8f8={'leaveAt':moment()[_0x38fa('0xd')](_0x38fa('0x1b')),'acceptAt':moment()[_0x38fa('0xd')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x38fa('0x2e')};logger[_0x38fa('0x26')](util[_0x38fa('0xd')]('[%s][STOP:QUEUE][NAME:%s]',_0x4fe863,_0x596950[_0x38fa('0x28')]));emitChannelQueueInteraction(_0x4a3954[_0x38fa('0x1f')],_0x596950[_0x38fa('0x28')],_0x4a3954[_0x38fa('0x1a')],_0x4a3954['account'][_0x38fa('0x28')],_0x4a3954[_0x38fa('0x23')]['id'],![],_0x5c69d9,_0x596950['id']);if(rpc[_0x4a3954[_0x38fa('0x1f')]+_0x38fa('0x29')]){return rpc[_0x4a3954[_0x38fa('0x1f')]+_0x38fa('0x29')][_0x38fa('0x2f')](_0x4fe863,_0x58c8f8)[_0x38fa('0x30')](function(_0xd2bc03){logger[_0x38fa('0x2b')](_0x38fa('0x31'));});}}}function endRouting(_0xe1a959,_0x5e6bf6,_0x4132a1,_0x1ff89f){if(_0xe1a959&&_0x5e6bf6){_0x5e6bf6['waiting']-=0x1;var _0x110a49={'leaveAt':moment()[_0x38fa('0xd')](_0x38fa('0x1b')),'exitAt':moment()['format'](_0x38fa('0x1b')),'reason':_0x38fa('0x32')};logger[_0x38fa('0x26')](util['format']('[%s][END:QUEUE][NAME:%s]',_0xe1a959,_0x5e6bf6[_0x38fa('0x28')]));emitChannelQueueInteraction(_0x4132a1['channel'],_0x5e6bf6[_0x38fa('0x28')],_0x4132a1[_0x38fa('0x1a')],_0x4132a1[_0x38fa('0x9')][_0x38fa('0x28')],_0x4132a1['message']['id'],![],_0x1ff89f);if(rpc[_0x4132a1[_0x38fa('0x1f')]+_0x38fa('0x29')]){return rpc[_0x4132a1[_0x38fa('0x1f')]+_0x38fa('0x29')]['update'](_0xe1a959,_0x110a49)[_0x38fa('0x30')](function(_0x26755b){logger[_0x38fa('0x2b')](_0x38fa('0x31'));});}}}function handleFindQueue(_0x773b43){return function(_0x4f8f6f){return _0x4f8f6f[_0x38fa('0x28')]['toLowerCase']()===_0x773b43['toLowerCase']();};}exports[_0x38fa('0x33')]=function(_0x38f7e2,_0x3746e4,_0x392975,_0x58cf8d){return function(_0x515b33){try{var _0x4f60c7={'name':_0x3746e4[0x0],'timeout':_0x3746e4[0x1]};var _0x2e6644=queue[_0x38fa('0x0')](_0x4f60c7,{'typecast':!![]});if(_0x2e6644[_0x38fa('0x34')]){logger[_0x38fa('0x2b')](_0x38fa('0x35'),_0x38f7e2,_[_0x38fa('0x36')](_0x2e6644,'message')[_0x38fa('0x37')](',\x20'));_0x515b33[_0x38fa('0x38')]();}else{var _0x50b6e4=_['find'](_0x392975[_0x58cf8d[_0x38fa('0x1f')]+'Queues'],handleFindQueue(_0x4f60c7[_0x38fa('0x28')]));if(_0x50b6e4){startRouting(_0x38f7e2,_0x50b6e4,_0x58cf8d,_0x392975);var _0x2c39e5=(_0x50b6e4['timeout']||0xa)*0x3e8;var _0x5efa64=(_0x4f60c7[_0x38fa('0x32')]||0x14)*0x3e8;var _0x5f3de7,_0x19ccc3;if(_0x2c39e5>_0x5efa64){_0x5efa64=_0x2c39e5;}var _0x1e7fe0=seqqueue[_0x38fa('0x39')](_0x2c39e5);_0x1e7fe0['id']=_0x38f7e2;_0x1e7fe0[_0x38fa('0x3a')]=_0x2c39e5;_0x1e7fe0[_0x38fa('0x3b')]=_0x5efa64;_0x1e7fe0['channel']=_0x58cf8d['channel'];_0x392975['rules'][_0x38f7e2]['on']('end',function(){stopRouting(_0x38f7e2,_0x50b6e4,_0x58cf8d,_0x392975);_0x1e7fe0['close'](!![]);clearTimeout(_0x5f3de7);_0x5f3de7=undefined;if(_0x392975['rules'][_0x38f7e2]){delete _0x392975[_0x38fa('0x3c')][_0x38f7e2];}logger[_0x38fa('0x26')](_0x38fa('0x3d'),_0x38f7e2);_0x515b33[_0x38fa('0x38')]();});_0x5f3de7=setTimeout(function(){endRouting(_0x38f7e2,_0x50b6e4,_0x58cf8d,_0x392975);clearTimeout(_0x5f3de7);_0x1e7fe0['close'](!![]);logger[_0x38fa('0x26')]('[%s][QUEUE]\x20ROUTING\x20END',_0x38f7e2);_0x515b33[_0x38fa('0x3e')]();},_0x5efa64);switch(_0x50b6e4['strategy']){case'rrmemory':strategy[_0x38fa('0x3f')](_0x1e7fe0,_0x50b6e4,_0x392975,_0x58cf8d);break;default:strategy[_0x38fa('0x40')](_0x1e7fe0,_0x50b6e4,_0x392975,_0x58cf8d);}}else{logger[_0x38fa('0x2b')](_0x38fa('0x41'),_0x38f7e2,_0x4f60c7[_0x38fa('0x28')]);_0x515b33['stop']();}}}catch(_0x5ba06b){console['log'](_0x5ba06b);logger[_0x38fa('0x2b')](_0x38fa('0x35'),_0x38f7e2,_0x5ba06b[_0x38fa('0x42')]);_0x515b33['stop']();}};}; \ No newline at end of file +var _0xba41=['AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','error','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','[%s][QUEUE]\x20%s','map','join','find','Queues','timeout','createQueue','atimeout','qtimeout','rules','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','stop','[%s][QUEUE]\x20ROUTING\x20END','next','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','validate','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','emit','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','remove','pick','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','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','QueueId','InteractionId','interaction','MessageId','message','chat'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xba41,0x165));var _0x1ba4=function(_0x31a371,_0x50828e){_0x31a371=_0x31a371-0x0;var _0x2a5bd6=_0xba41[_0x31a371];return _0x2a5bd6;};'use strict';var schema=require(_0x1ba4('0x0'));var _=require(_0x1ba4('0x1'));var util=require(_0x1ba4('0x2'));var seqqueue=require(_0x1ba4('0x3'));var moment=require(_0x1ba4('0x4'));var Redis=require(_0x1ba4('0x5'));var config=require(_0x1ba4('0x6'));var logger=require(_0x1ba4('0x7'))(_0x1ba4('0x8'));var strategy=require(_0x1ba4('0x9'));config[_0x1ba4('0xa')]=_[_0x1ba4('0xb')](config[_0x1ba4('0xa')],{'host':_0x1ba4('0xc'),'port':0x18eb});var io=require(_0x1ba4('0xd'))(new Redis(config[_0x1ba4('0xa')]));var attributes=['id',_0x1ba4('0xe'),_0x1ba4('0xf'),_0x1ba4('0x10'),_0x1ba4('0x11'),'joinAt'];function emit(_0x543aa2,_0x586b9b,_0x36494e){io['to'](_0x543aa2)[_0x1ba4('0x12')](_0x586b9b,_0x36494e);}function emitChannelQueueInteraction(_0xdf27f9,_0x43568c,_0x1a7980,_0x243e7d,_0x58b7ee,_0x3dfa8a,_0x44b180,_0x500354){_0x1a7980[_0x1ba4('0xe')]=_0x500354;_0x1a7980[_0x1ba4('0x10')]=_0x43568c;_0x1a7980['account']=_0x243e7d;_0x1a7980['id']=_0x58b7ee;if(_0x3dfa8a){_0x44b180[util[_0x1ba4('0x13')](_0x1ba4('0x14'),_0xdf27f9)][_0x58b7ee]=_['pick'](_0x1a7980,attributes);}else{delete _0x44b180[util['format'](_0x1ba4('0x14'),_0xdf27f9)][_0x58b7ee];}emit(util[_0x1ba4('0x13')](_0x1ba4('0x15'),_0xdf27f9,_0x43568c),util[_0x1ba4('0x13')](_0x1ba4('0x16'),_0xdf27f9,_0x3dfa8a?'save':_0x1ba4('0x17')),_[_0x1ba4('0x18')](_0x1a7980,attributes));}var rpc={'openchannelQueueReport':require(_0x1ba4('0x19')),'mailQueueReport':require(_0x1ba4('0x1a')),'chatQueueReport':require('../../rpc/chatQueueReport'),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0x1ba4('0x1b'),'required':!![],'message':_0x1ba4('0x1c')},'timeout':{'type':_0x1ba4('0x1d'),'message':_0x1ba4('0x1e')}});function startRouting(_0x5e4aef,_0x12fec5,_0x440358,_0x4f7082){if(_0x5e4aef&&_0x12fec5&&_0x440358){_0x12fec5['waiting']+=0x1;var _0x290164={'uniqueid':_0x5e4aef,'from':_0x440358['body']?_0x440358[_0x1ba4('0x1f')][_0x1ba4('0x11')]:'','joinAt':moment()[_0x1ba4('0x13')](_0x1ba4('0x20')),'ContactId':_0x440358[_0x1ba4('0x21')]?_0x440358['contact']['id']:null,'ListId':_0x440358['list']?_0x440358[_0x1ba4('0x22')]['id']:null};_0x290164[_[_0x1ba4('0x23')](_0x440358[_0x1ba4('0x24')])+_0x1ba4('0x25')]=_0x12fec5['id']||null;_0x290164[_[_0x1ba4('0x23')](_0x440358[_0x1ba4('0x24')])+_0x1ba4('0x26')]=_0x440358[_0x1ba4('0x27')]?_0x440358[_0x1ba4('0x27')]['id']:null;_0x290164[_['upperFirst'](_0x440358[_0x1ba4('0x24')])+_0x1ba4('0x28')]=_0x440358[_0x1ba4('0x29')]?_0x440358['message']['id']:null;_0x290164[_['upperFirst'](_0x440358['channel'])+(_0x440358[_0x1ba4('0x24')]!==_0x1ba4('0x2a')?_0x1ba4('0x2b'):'WebsiteId')]=_0x440358[_0x1ba4('0xf')]?_0x440358[_0x1ba4('0xf')]['id']:null;logger[_0x1ba4('0x2c')](util[_0x1ba4('0x13')](_0x1ba4('0x2d'),_0x5e4aef,_0x12fec5[_0x1ba4('0x2e')]));emitChannelQueueInteraction(_0x440358[_0x1ba4('0x24')],_0x12fec5[_0x1ba4('0x2e')],_0x290164,_0x440358[_0x1ba4('0xf')][_0x1ba4('0x2e')],_0x440358[_0x1ba4('0x29')]['id'],!![],_0x4f7082,_0x12fec5['id']);if(rpc[_0x440358['channel']+_0x1ba4('0x2f')]){return rpc[_0x440358[_0x1ba4('0x24')]+_0x1ba4('0x2f')][_0x1ba4('0x30')](_0x290164)[_0x1ba4('0x31')](function(_0xec8196){logger[_0x1ba4('0x32')]('create\x20queue\x20report');});}}}function stopRouting(_0x599af3,_0x20653b,_0x4f2b0c,_0x48d8fb){if(_0x599af3&&_0x20653b){_0x20653b[_0x1ba4('0x33')]-=0x1;var _0x5cd5bc={'leaveAt':moment()[_0x1ba4('0x13')](_0x1ba4('0x20')),'acceptAt':moment()[_0x1ba4('0x13')](_0x1ba4('0x20')),'reason':_0x1ba4('0x34')};logger[_0x1ba4('0x2c')](util[_0x1ba4('0x13')](_0x1ba4('0x35'),_0x599af3,_0x20653b['name']));emitChannelQueueInteraction(_0x4f2b0c[_0x1ba4('0x24')],_0x20653b[_0x1ba4('0x2e')],_0x4f2b0c['body'],_0x4f2b0c[_0x1ba4('0xf')][_0x1ba4('0x2e')],_0x4f2b0c['message']['id'],![],_0x48d8fb,_0x20653b['id']);if(rpc[_0x4f2b0c[_0x1ba4('0x24')]+_0x1ba4('0x2f')]){return rpc[_0x4f2b0c['channel']+_0x1ba4('0x2f')][_0x1ba4('0x36')](_0x599af3,_0x5cd5bc)['catch'](function(_0x1909ae){logger[_0x1ba4('0x32')](_0x1ba4('0x37'));});}}}function endRouting(_0x1a98c7,_0x4c0935,_0x116168,_0x24305c){if(_0x1a98c7&&_0x4c0935){_0x4c0935[_0x1ba4('0x33')]-=0x1;var _0x55b7a9={'leaveAt':moment()[_0x1ba4('0x13')](_0x1ba4('0x20')),'exitAt':moment()['format'](_0x1ba4('0x20')),'reason':'timeout'};logger[_0x1ba4('0x2c')](util[_0x1ba4('0x13')](_0x1ba4('0x38'),_0x1a98c7,_0x4c0935[_0x1ba4('0x2e')]));emitChannelQueueInteraction(_0x116168[_0x1ba4('0x24')],_0x4c0935[_0x1ba4('0x2e')],_0x116168[_0x1ba4('0x1f')],_0x116168[_0x1ba4('0xf')][_0x1ba4('0x2e')],_0x116168['message']['id'],![],_0x24305c);if(rpc[_0x116168[_0x1ba4('0x24')]+_0x1ba4('0x2f')]){return rpc[_0x116168[_0x1ba4('0x24')]+_0x1ba4('0x2f')][_0x1ba4('0x36')](_0x1a98c7,_0x55b7a9)[_0x1ba4('0x31')](function(_0x3467e4){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x53bf0f){return function(_0x2443c7){return _0x2443c7[_0x1ba4('0x2e')][_0x1ba4('0x39')]()===_0x53bf0f['toLowerCase']();};}exports[_0x1ba4('0x3a')]=function(_0x126f39,_0x4e37ab,_0x2a7b25,_0x3cecf0){return function(_0x28d56f){try{var _0x4407f7={'name':_0x4e37ab[0x0],'timeout':_0x4e37ab[0x1]};var _0x59bae3=queue[_0x1ba4('0x0')](_0x4407f7,{'typecast':!![]});if(_0x59bae3[_0x1ba4('0x3b')]){logger[_0x1ba4('0x32')](_0x1ba4('0x3c'),_0x126f39,_[_0x1ba4('0x3d')](_0x59bae3,_0x1ba4('0x29'))[_0x1ba4('0x3e')](',\x20'));_0x28d56f['stop']();}else{var _0x3205e1=_[_0x1ba4('0x3f')](_0x2a7b25[_0x3cecf0[_0x1ba4('0x24')]+_0x1ba4('0x40')],handleFindQueue(_0x4407f7[_0x1ba4('0x2e')]));if(_0x3205e1){startRouting(_0x126f39,_0x3205e1,_0x3cecf0,_0x2a7b25);var _0xc5dd7d=(_0x3205e1[_0x1ba4('0x41')]||0xa)*0x3e8;var _0x394a2a=(_0x4407f7[_0x1ba4('0x41')]||0x14)*0x3e8;var _0x39a45c,_0x32c005;if(_0xc5dd7d>_0x394a2a){_0x394a2a=_0xc5dd7d;}var _0x35428f=seqqueue[_0x1ba4('0x42')](_0xc5dd7d);_0x35428f['id']=_0x126f39;_0x35428f[_0x1ba4('0x43')]=_0xc5dd7d;_0x35428f[_0x1ba4('0x44')]=_0x394a2a;_0x35428f['channel']=_0x3cecf0[_0x1ba4('0x24')];_0x2a7b25[_0x1ba4('0x45')][_0x126f39]['on']('end',function(){stopRouting(_0x126f39,_0x3205e1,_0x3cecf0,_0x2a7b25);_0x35428f[_0x1ba4('0x46')](!![]);clearTimeout(_0x39a45c);_0x39a45c=undefined;if(_0x2a7b25[_0x1ba4('0x45')][_0x126f39]){delete _0x2a7b25[_0x1ba4('0x45')][_0x126f39];}logger[_0x1ba4('0x2c')](_0x1ba4('0x47'),_0x126f39);_0x28d56f[_0x1ba4('0x48')]();});_0x39a45c=setTimeout(function(){endRouting(_0x126f39,_0x3205e1,_0x3cecf0,_0x2a7b25);clearTimeout(_0x39a45c);_0x35428f[_0x1ba4('0x46')](!![]);logger[_0x1ba4('0x2c')](_0x1ba4('0x49'),_0x126f39);_0x28d56f[_0x1ba4('0x4a')]();},_0x394a2a);switch(_0x3205e1[_0x1ba4('0x4b')]){case'rrmemory':strategy[_0x1ba4('0x4c')](_0x35428f,_0x3205e1,_0x2a7b25,_0x3cecf0);break;default:strategy['beepall'](_0x35428f,_0x3205e1,_0x2a7b25,_0x3cecf0);}}else{logger[_0x1ba4('0x32')](_0x1ba4('0x4d'),_0x126f39,_0x4407f7['name']);_0x28d56f[_0x1ba4('0x48')]();}}}catch(_0xd9ff6e){console[_0x1ba4('0x4e')](_0xd9ff6e);logger[_0x1ba4('0x32')]('[%s][QUEUE]\x20%s',_0x126f39,_0xd9ff6e[_0x1ba4('0x4f')]);_0x28d56f['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/agent.js b/server/services/routing/server/applications/strategy/agent.js index eca476a..9895ba3 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 _0xe822=['lodash','uuid','./util','../../../../../config/logger','routing','notificationId','agent','squeue','push','handleRun','handleTimeout','timeout','bind','drained','handleDrained','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','realtime','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP'];(function(_0x27d769,_0xc1d2e4){var _0x1f1f41=function(_0x38ebeb){while(--_0x38ebeb){_0x27d769['push'](_0x27d769['shift']());}};_0x1f1f41(++_0xc1d2e4);}(_0xe822,0x1ce));var _0x2e82=function(_0x2ff205,_0x413c68){_0x2ff205=_0x2ff205-0x0;var _0x591903=_0xe822[_0x2ff205];return _0x591903;};'use strict';var _=require(_0x2e82('0x0'));var uuid=require(_0x2e82('0x1'));var util=require(_0x2e82('0x2'));var logger=require(_0x2e82('0x3'))(_0x2e82('0x4'));var Agent=function(_0x126519,_0x3b9abc,_0x9d3fa8,_0x3b08d5){this[_0x2e82('0x5')]=uuid['v4']();this['squeue']=_0x126519;this[_0x2e82('0x6')]=_0x3b9abc;this['realtime']=_0x9d3fa8;this[_0x2e82('0x4')]=_0x3b08d5;this[_0x2e82('0x7')][_0x2e82('0x8')](this[_0x2e82('0x9')]['bind'](this),this[_0x2e82('0xa')]['bind'](this));this[_0x2e82('0x7')]['on'](_0x2e82('0xb'),this['handleTimeout'][_0x2e82('0xc')](this));this[_0x2e82('0x7')]['on'](_0x2e82('0xd'),this[_0x2e82('0xe')][_0x2e82('0xc')](this));};Agent[_0x2e82('0xf')]['push']=function(){this[_0x2e82('0x7')][_0x2e82('0x8')](this[_0x2e82('0x9')][_0x2e82('0xc')](this),this['handleTimeout'][_0x2e82('0xc')](this));};Agent['prototype'][_0x2e82('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0x2e82('0xf')][_0x2e82('0x9')]=function(_0x11b077){logger['info'](_0x2e82('0x10'),this[_0x2e82('0x7')]['id'],this['agent']['id']);if(_[_0x2e82('0x11')](this[_0x2e82('0x12')][_0x2e82('0x13')][this['agent']['id']])){logger[_0x2e82('0x14')](_0x2e82('0x15'),this['squeue']['id'],this[_0x2e82('0x6')]['id']);setTimeout(this[_0x2e82('0x8')]['bind'](this),0x3e8);}else{if(this[_0x2e82('0x4')][_0x2e82('0x16')]||util['isAgentAvailable'](this[_0x2e82('0x7')]['id'],this[_0x2e82('0x12')]['agents'][this[_0x2e82('0x6')]['id']],this['squeue'][_0x2e82('0x17')],![])){this['realtime'][_0x2e82('0x13')][this[_0x2e82('0x6')]['id']]['busy']=!![];this['realtime'][_0x2e82('0x13')][this[_0x2e82('0x6')]['id']][_0x2e82('0x18')]=undefined;util[_0x2e82('0x19')](this['notificationId'],this['squeue']['id'],this[_0x2e82('0x12')][_0x2e82('0x13')][this[_0x2e82('0x6')]['id']],null,this[_0x2e82('0x4')]);util[_0x2e82('0x1a')](this['squeue']['id'],this[_0x2e82('0x12')][_0x2e82('0x13')][this[_0x2e82('0x6')]['id']],_0x2e82('0x1b')+(this[_0x2e82('0x4')]['forcedOwnership']?_0x2e82('0x1c'):''));}else{logger[_0x2e82('0x14')](_0x2e82('0x1d'),this[_0x2e82('0x7')]['id'],this[_0x2e82('0x6')]['id']);setTimeout(this[_0x2e82('0x8')][_0x2e82('0xc')](this),0x3e8);}}};Agent['prototype']['handleTimeout']=function(_0x29fb68){if(_[_0x2e82('0x11')](this[_0x2e82('0x12')]['agents'][this[_0x2e82('0x6')]['id']])){return logger[_0x2e82('0x14')](_0x2e82('0x15'),this[_0x2e82('0x7')]['id'],this['agent']['id']);}else{logger[_0x2e82('0x14')](_0x2e82('0x1e'),this[_0x2e82('0x7')]['id'],this[_0x2e82('0x6')]['id']);util[_0x2e82('0x1f')](this[_0x2e82('0x5')],this[_0x2e82('0x7')]['id'],this[_0x2e82('0x12')][_0x2e82('0x13')][this['agent']['id']],null,this[_0x2e82('0x4')]);this[_0x2e82('0x12')][_0x2e82('0x13')][this['agent']['id']]['busy']=![];this[_0x2e82('0x12')][_0x2e82('0x13')][this['agent']['id']][_0x2e82('0x18')]=undefined;util[_0x2e82('0x1a')](this[_0x2e82('0x7')]['id'],this[_0x2e82('0x12')][_0x2e82('0x13')][this['agent']['id']],_0x29fb68?_0x2e82('0x20'):'TIMEOUT');}if(!_0x29fb68){setTimeout(this[_0x2e82('0x8')][_0x2e82('0xc')](this),0x3e8);}};function agent(_0x43d61d,_0x17d65e,_0x296e9f,_0x11faf0){return new Agent(_0x43d61d,_0x17d65e,_0x296e9f,_0x11faf0);}module['exports']=agent; \ No newline at end of file +var _0x16c2=['timeout','handleDrained','push','prototype','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','info','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','channel','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','exports','uuid','./util','notificationId','squeue','agent','realtime','routing','handleRun','bind','handleTimeout'];(function(_0x451edf,_0x4f7b8b){var _0x630e0e=function(_0x1bdba2){while(--_0x1bdba2){_0x451edf['push'](_0x451edf['shift']());}};_0x630e0e(++_0x4f7b8b);}(_0x16c2,0x176));var _0x216c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16c2[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var uuid=require(_0x216c('0x0'));var util=require(_0x216c('0x1'));var logger=require('../../../../../config/logger')('routing');var Agent=function(_0x466a00,_0x3aba61,_0x260ee8,_0x1796ab){this[_0x216c('0x2')]=uuid['v4']();this[_0x216c('0x3')]=_0x466a00;this[_0x216c('0x4')]=_0x3aba61;this[_0x216c('0x5')]=_0x260ee8;this[_0x216c('0x6')]=_0x1796ab;this[_0x216c('0x3')]['push'](this[_0x216c('0x7')][_0x216c('0x8')](this),this[_0x216c('0x9')][_0x216c('0x8')](this));this[_0x216c('0x3')]['on'](_0x216c('0xa'),this[_0x216c('0x9')][_0x216c('0x8')](this));this[_0x216c('0x3')]['on']('drained',this[_0x216c('0xb')][_0x216c('0x8')](this));};Agent['prototype'][_0x216c('0xc')]=function(){this[_0x216c('0x3')][_0x216c('0xc')](this[_0x216c('0x7')][_0x216c('0x8')](this),this['handleTimeout'][_0x216c('0x8')](this));};Agent[_0x216c('0xd')][_0x216c('0xb')]=function(){this[_0x216c('0x9')](!![]);};Agent[_0x216c('0xd')][_0x216c('0x7')]=function(_0x152cc3){logger['info'](_0x216c('0xe'),this[_0x216c('0x3')]['id'],this[_0x216c('0x4')]['id']);if(_[_0x216c('0xf')](this['realtime'][_0x216c('0x10')][this[_0x216c('0x4')]['id']])){logger[_0x216c('0x11')](_0x216c('0x12'),this[_0x216c('0x3')]['id'],this[_0x216c('0x4')]['id']);setTimeout(this[_0x216c('0xc')][_0x216c('0x8')](this),0x3e8);}else{if(this['routing'][_0x216c('0x13')]||util['isAgentAvailable'](this[_0x216c('0x3')]['id'],this['realtime'][_0x216c('0x10')][this[_0x216c('0x4')]['id']],this[_0x216c('0x3')][_0x216c('0x14')],![])){this[_0x216c('0x5')][_0x216c('0x10')][this[_0x216c('0x4')]['id']][_0x216c('0x15')]=!![];this[_0x216c('0x5')][_0x216c('0x10')][this[_0x216c('0x4')]['id']][_0x216c('0x16')]=undefined;util[_0x216c('0x17')](this['notificationId'],this['squeue']['id'],this[_0x216c('0x5')][_0x216c('0x10')][this['agent']['id']],null,this['routing']);util[_0x216c('0x18')](this[_0x216c('0x3')]['id'],this[_0x216c('0x5')][_0x216c('0x10')][this[_0x216c('0x4')]['id']],_0x216c('0x19')+(this[_0x216c('0x6')]['forcedOwnership']?':FORCED':''));}else{logger[_0x216c('0x11')](_0x216c('0x1a'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x216c('0xc')]['bind'](this),0x3e8);}}};Agent[_0x216c('0xd')]['handleTimeout']=function(_0x4156dd){if(_[_0x216c('0xf')](this['realtime']['agents'][this[_0x216c('0x4')]['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this[_0x216c('0x3')]['id'],this[_0x216c('0x4')]['id']);}else{logger['info'](_0x216c('0x1b'),this[_0x216c('0x3')]['id'],this[_0x216c('0x4')]['id']);util[_0x216c('0x1c')](this[_0x216c('0x2')],this[_0x216c('0x3')]['id'],this[_0x216c('0x5')][_0x216c('0x10')][this['agent']['id']],null,this[_0x216c('0x6')]);this[_0x216c('0x5')][_0x216c('0x10')][this['agent']['id']][_0x216c('0x15')]=![];this['realtime'][_0x216c('0x10')][this[_0x216c('0x4')]['id']]['busyQueue']=undefined;util[_0x216c('0x18')](this['squeue']['id'],this[_0x216c('0x5')][_0x216c('0x10')][this[_0x216c('0x4')]['id']],_0x4156dd?_0x216c('0x1d'):_0x216c('0x1e'));}if(!_0x4156dd){setTimeout(this[_0x216c('0xc')][_0x216c('0x8')](this),0x3e8);}};function agent(_0x1f929e,_0x51ff9f,_0x54bbb0,_0x3590de){return new Agent(_0x1f929e,_0x51ff9f,_0x54bbb0,_0x3590de);}module[_0x216c('0x1f')]=agent; \ No newline at end of file diff --git a/server/services/routing/server/applications/strategy/beepall.js b/server/services/routing/server/applications/strategy/beepall.js index 892d289..4d2b429 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 _0x5c8a=['prototype','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','RINGING','busy','busyQueue','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','writeLog','TIMEOUT','lodash','uuid','./util','notificationId','squeue','queue','realtime','routing','push','handleRun','handleTimeout','bind','drained','handleDrained'];(function(_0x3713e2,_0x381fd6){var _0x4e81d8=function(_0x4835e5){while(--_0x4835e5){_0x3713e2['push'](_0x3713e2['shift']());}};_0x4e81d8(++_0x381fd6);}(_0x5c8a,0xc4));var _0xa5c8=function(_0x533584,_0x2dcfce){_0x533584=_0x533584-0x0;var _0xb013ae=_0x5c8a[_0x533584];return _0xb013ae;};'use strict';var _=require(_0xa5c8('0x0'));var uuid=require(_0xa5c8('0x1'));var util=require(_0xa5c8('0x2'));var logger=require('../../../../../config/logger')('routing');var Beepall=function(_0xb1b422,_0x16c4ce,_0x273ab8,_0x22e4e1){this[_0xa5c8('0x3')]=uuid['v4']();this[_0xa5c8('0x4')]=_0xb1b422;this[_0xa5c8('0x5')]=_0x16c4ce;this[_0xa5c8('0x6')]=_0x273ab8;this[_0xa5c8('0x7')]=_0x22e4e1;this[_0xa5c8('0x4')][_0xa5c8('0x8')](this[_0xa5c8('0x9')]['bind'](this),this[_0xa5c8('0xa')][_0xa5c8('0xb')](this));this[_0xa5c8('0x4')]['on']('timeout',this['handleTimeout'][_0xa5c8('0xb')](this));this[_0xa5c8('0x4')]['on'](_0xa5c8('0xc'),this[_0xa5c8('0xd')]['bind'](this));};Beepall['prototype'][_0xa5c8('0x8')]=function(){this[_0xa5c8('0x4')][_0xa5c8('0x8')](this[_0xa5c8('0x9')][_0xa5c8('0xb')](this),this['handleTimeout'][_0xa5c8('0xb')](this));};Beepall[_0xa5c8('0xe')][_0xa5c8('0xd')]=function(_0xf57b47){this['handleTimeout'](!![]);};Beepall[_0xa5c8('0xe')][_0xa5c8('0x9')]=function(_0x4409eb){var _0x1050e6=!![];if(!_[_0xa5c8('0xf')](this['queue'])&&!_[_0xa5c8('0xf')](this[_0xa5c8('0x5')][_0xa5c8('0x10')])&&this[_0xa5c8('0x5')]['Agents'][_0xa5c8('0x11')]>0x0){for(var _0xdf2184=0x0,_0x55c8ab;_0xdf21840x0){for(var _0x4ff311=0x0,_0x462363;_0x4ff3110x0&&_0x5f598c[_0x371ac4+_0x2f3b('0x23')]>=_0x5f598c[_0x371ac4+_0x2f3b('0x22')]){writeLog(_0x11942f,_0x5f598c,_0x371ac4[_0x2f3b('0x24')]()+'\x20MAXCAPACITY');return![];}}return!![];};exports[_0x2f3b('0x25')]=function(_0x4e61be,_0x54a81e,_0x4d9e5f,_0x454890,_0x5142ae){return sendNotification(!![],_0x4e61be,_0x54a81e,_0x4d9e5f,_0x454890,_0x5142ae);};exports[_0x2f3b('0x26')]=function(_0x18f421,_0x552ff4,_0x34b0b5,_0x26525b,_0x32e60d){return sendNotification(![],_0x18f421,_0x552ff4,_0x34b0b5,_0x26525b,_0x32e60d);};exports[_0x2f3b('0x27')]=writeLog; \ No newline at end of file +var _0x5eb1=['writeLog','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','redis','defaults','localhost','emit','format','user:%s','name','user:save','account','notificationSound','body','queue','msg','notificationTemplate','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','info','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable','busy','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','CurrentCapacity','Capacity','toUpperCase','\x20MAXCAPACITY'];(function(_0x13524d,_0x505b49){var _0x9918b4=function(_0xef1f0a){while(--_0xef1f0a){_0x13524d['push'](_0x13524d['shift']());}};_0x9918b4(++_0x505b49);}(_0x5eb1,0x7c));var _0x15eb=function(_0x16af15,_0x55bc76){_0x16af15=_0x16af15-0x0;var _0xfeda8a=_0x5eb1[_0x16af15];return _0xfeda8a;};'use strict';var _=require('lodash');var util=require(_0x15eb('0x0'));var utils=require(_0x15eb('0x1'));var Mustache=require(_0x15eb('0x2'));var Redis=require(_0x15eb('0x3'));var config=require(_0x15eb('0x4'));var logger=require(_0x15eb('0x5'))('routing');config[_0x15eb('0x6')]=_[_0x15eb('0x7')](config[_0x15eb('0x6')],{'host':_0x15eb('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x15eb('0x6')]));function emit(_0x212692,_0x594f54,_0xe4d8ce){io['to'](_0x212692)[_0x15eb('0x9')](_0x594f54,_0xe4d8ce);}function sendNotification(_0x730b12,_0x400f7d,_0x2c144a,_0x2ad2c1,_0x412db6,_0x1481ae){io['to'](util[_0x15eb('0xa')](_0x15eb('0xb'),_0x2ad2c1[_0x15eb('0xc')]))[_0x15eb('0x9')](_0x15eb('0xd'),_0x2ad2c1);var _0x56c25c=_0x1481ae||{};var _0x296012=_0x2c144a['split']('.');var _0x5e678a={'uniqueid':_0x400f7d,'channel':_0x296012[0x0],'id':_0x296012[0x1],'title':_0x296012[0x0]+'\x20interaction','interactionId':_0x296012[0x2],'queue':_0x412db6?_0x412db6[_0x15eb('0xc')]:null,'sound':_0x56c25c[_0x15eb('0xe')][_0x15eb('0xf')],'shake':_0x56c25c[_0x15eb('0xe')]['notificationShake']};try{if(!_0x56c25c[_0x15eb('0x10')]){_0x56c25c[_0x15eb('0x10')]={};}if(_0x412db6){_0x56c25c[_0x15eb('0x10')][_0x15eb('0x11')]=_0x412db6;}else if(_0x56c25c['body']['queue']){delete _0x56c25c['body']['queue'];}_0x5e678a[_0x15eb('0x12')]=utils['getMustacheRender'](_0x56c25c['account'][_0x15eb('0x13')],_0x56c25c);}catch(_0x5b9a6b){_0x5e678a[_0x15eb('0x12')]='I\x20can\x27t\x20render\x20your\x20template';logger[_0x15eb('0x14')](util['format'](_0x15eb('0x15'),_0x400f7d,_0x5b9a6b[_0x15eb('0x16')]));}io['to'](util['format'](_0x15eb('0xb'),_0x2ad2c1[_0x15eb('0xc')]))['emit'](util[_0x15eb('0xa')](_0x15eb('0x17'),_0x730b12?_0x15eb('0x18'):_0x15eb('0x19')),_0x5e678a);}function writeLog(_0xb66333,_0x148b93,_0x56f51d){return logger[_0x15eb('0x1a')](util['format'](_0x15eb('0x1b'),_0xb66333,_0x148b93['name'],_0x56f51d));}exports[_0x15eb('0x1c')]=function(_0x496d03,_0x27449b,_0x158674,_0xa0cefc){if(_0x27449b[_0x15eb('0x1d')]){writeLog(_0x496d03,_0x27449b,_0x15eb('0x1e'));return![];}if(!_0x27449b[_0x15eb('0x1f')]){writeLog(_0x496d03,_0x27449b,_0x15eb('0x20'));return![];}if(_0x27449b[_0x158674+_0x15eb('0x21')]){writeLog(_0x496d03,_0x27449b,_0x15eb('0x22'));return![];}if(_0xa0cefc&&_0x27449b[_0x15eb('0x23')](_0x158674+'Capacity')&&_0x27449b[_0x15eb('0x23')](_0x158674+_0x15eb('0x24'))){if(_0x27449b[_0x158674+_0x15eb('0x25')]>0x0&&_0x27449b[_0x158674+_0x15eb('0x24')]>=_0x27449b[_0x158674+_0x15eb('0x25')]){writeLog(_0x496d03,_0x27449b,_0x158674[_0x15eb('0x26')]()+_0x15eb('0x27'));return![];}}return!![];};exports['showNotification']=function(_0x4da36d,_0x1706ed,_0x1def52,_0x62c8ff,_0xa1ea61){return sendNotification(!![],_0x4da36d,_0x1706ed,_0x1def52,_0x62c8ff,_0xa1ea61);};exports['hideNotification']=function(_0x222764,_0x5f2df5,_0x302bf7,_0x47b056,_0xd895b6){return sendNotification(![],_0x222764,_0x5f2df5,_0x302bf7,_0x47b056,_0xd895b6);};exports[_0x15eb('0x28')]=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 2104d54..673858b 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 _0xebf5=['length','error','[%s][SYSTEM]\x20%s','message','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','info','[%s][SYSTEM]\x20commnad:\x20%s','exec','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','isNil','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify','shelljs','./utils','../../../../config/logger','routing','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence'];(function(_0x376801,_0x3fddb7){var _0x19f3ec=function(_0x4bda42){while(--_0x4bda42){_0x376801['push'](_0x376801['shift']());}};_0x19f3ec(++_0x3fddb7);}(_0xebf5,0xd2));var _0x5ebf=function(_0x407ef0,_0x3d3015){_0x407ef0=_0x407ef0-0x0;var _0x305105=_0xebf5[_0x407ef0];return _0x305105;};'use strict';var schema=require('validate');var sh=require(_0x5ebf('0x0'));var _=require('lodash');var utils=require(_0x5ebf('0x1'));var logger=require(_0x5ebf('0x2'))(_0x5ebf('0x3'));var system=schema({'command':{'type':'string','required':!![],'message':_0x5ebf('0x4')}});exports[_0x5ebf('0x5')]=function(_0xed148a,_0x4e8f69){return function(_0x4d33b9){try{var _0x5df4cd={'command':_0x4e8f69[0x0]};var _0x45b5aa=system['validate'](_0x5df4cd,{'typecast':!![]});if(_0x45b5aa[_0x5ebf('0x6')]){logger[_0x5ebf('0x7')](_0x5ebf('0x8'),_0xed148a,_['map'](_0x45b5aa,_0x5ebf('0x9'))['join'](',\x20'));logger['info'](_0x5ebf('0xa'),_0xed148a);_0x4d33b9[_0x5ebf('0xb')]();}else{var _0x4ae4a=this;var _0x352300=utils['getMustacheRender'](_0x4e8f69[0x0],this);logger[_0x5ebf('0xc')](_0x5ebf('0xd'),_0xed148a,_0x352300);sh[_0x5ebf('0xe')](_['trim'](_0x352300),function(_0x8c5dc6,_0x459584){logger[_0x5ebf('0xc')](_0x5ebf('0xf'),_0xed148a,_0x8c5dc6);if(_0x8c5dc6==0x0){var _0x2b938b=_0x459584[_0x5ebf('0x10')](/(\r\n|\n|\r)/gm,'');if(_[_0x5ebf('0x11')](_0x4e8f69[0x1])||_[_0x5ebf('0x12')](_0x4e8f69[0x1])){logger[_0x5ebf('0xc')](_0x5ebf('0x13'),_0xed148a);_0x4ae4a[_0x5ebf('0x14')][_0x4e8f69[0x1]]=_0x2b938b;}else{logger[_0x5ebf('0xc')](_0x5ebf('0x15'),_0xed148a,_0x4e8f69[0x1],_0x2b938b);_0x4ae4a[_0x5ebf('0x14')][_0x4e8f69[0x1]]=_0x2b938b;}}_0x4d33b9[_0x5ebf('0xb')]();});}}catch(_0x12f545){logger[_0x5ebf('0x7')](_0x5ebf('0x8'),_0xed148a,_[_0x5ebf('0x16')](_0x12f545)?JSON[_0x5ebf('0x17')](_0x12f545):_0x12f545);logger[_0x5ebf('0xc')](_0x5ebf('0xa'),_0xed148a);_0x4d33b9['next']();}};}; \ No newline at end of file +var _0x31da=['[%s][SYSTEM]\x20%s','map','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','info','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs','lodash','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x6e6247,_0x29bf59){var _0xa5b198=function(_0x46f60f){while(--_0x46f60f){_0x6e6247['push'](_0x6e6247['shift']());}};_0xa5b198(++_0x29bf59);}(_0x31da,0x165));var _0xa31d=function(_0x5b376e,_0x487977){_0x5b376e=_0x5b376e-0x0;var _0x500e3e=_0x31da[_0x5b376e];return _0x500e3e;};'use strict';var schema=require(_0xa31d('0x0'));var sh=require(_0xa31d('0x1'));var _=require(_0xa31d('0x2'));var utils=require(_0xa31d('0x3'));var logger=require(_0xa31d('0x4'))(_0xa31d('0x5'));var system=schema({'command':{'type':_0xa31d('0x6'),'required':!![],'message':_0xa31d('0x7')}});exports[_0xa31d('0x8')]=function(_0x4b5084,_0x26290b){return function(_0x361e06){try{var _0x1c322d={'command':_0x26290b[0x0]};var _0x277071=system['validate'](_0x1c322d,{'typecast':!![]});if(_0x277071[_0xa31d('0x9')]){logger[_0xa31d('0xa')](_0xa31d('0xb'),_0x4b5084,_[_0xa31d('0xc')](_0x277071,'message')[_0xa31d('0xd')](',\x20'));logger['info'](_0xa31d('0xe'),_0x4b5084);_0x361e06[_0xa31d('0xf')]();}else{var _0x1fed90=this;var _0xda1507=utils[_0xa31d('0x10')](_0x26290b[0x0],this);logger['info']('[%s][SYSTEM]\x20commnad:\x20%s',_0x4b5084,_0xda1507);sh['exec'](_['trim'](_0xda1507),function(_0x46f309,_0x1816e2){logger[_0xa31d('0x11')](_0xa31d('0x12'),_0x4b5084,_0x46f309);if(_0x46f309==0x0){var _0x50cb9e=_0x1816e2[_0xa31d('0x13')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x26290b[0x1])||_['isEmpty'](_0x26290b[0x1])){logger[_0xa31d('0x11')]('[%s][SYSTEM]\x20no\x20variable',_0x4b5084);_0x1fed90[_0xa31d('0x14')][_0x26290b[0x1]]=_0x50cb9e;}else{logger[_0xa31d('0x11')](_0xa31d('0x15'),_0x4b5084,_0x26290b[0x1],_0x50cb9e);_0x1fed90['body'][_0x26290b[0x1]]=_0x50cb9e;}}_0x361e06['next']();});}}catch(_0x439988){logger[_0xa31d('0xa')](_0xa31d('0xb'),_0x4b5084,_['isObject'](_0x439988)?JSON[_0xa31d('0x16')](_0x439988):_0x439988);logger[_0xa31d('0x11')](_0xa31d('0xe'),_0x4b5084);_0x361e06['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/tag.js b/server/services/routing/server/applications/tag.js index db19b2d..db11f0f 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(_0x57ad4f,_0x436500){var _0x5ecc06=function(_0x55f4ca){while(--_0x55f4ca){_0x57ad4f['push'](_0x57ad4f['shift']());}};_0x5ecc06(++_0x436500);}(_0x7a54,0x106));var _0x47a5=function(_0xcc7c72,_0x5b007c){_0xcc7c72=_0xcc7c72-0x0;var _0x54ca4c=_0x7a54[_0xcc7c72];return _0x54ca4c;};'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(_0x4fd386,_0x5e1070){var _0x40f9a3=function(_0x542d7d){while(--_0x542d7d){_0x4fd386['push'](_0x4fd386['shift']());}};_0x40f9a3(++_0x5e1070);}(_0x7a54,0x106));var _0x47a5=function(_0xcd09fe,_0x2fdcc4){_0xcd09fe=_0xcd09fe-0x0;var _0x5a2694=_0x7a54[_0xcd09fe];return _0x5a2694;};'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 d5cdf1d..69afb11 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 _0xfc1e=['message','account','render','merge','body'];(function(_0x255227,_0x2063b0){var _0x43a3e4=function(_0x2352ec){while(--_0x2352ec){_0x255227['push'](_0x255227['shift']());}};_0x43a3e4(++_0x2063b0);}(_0xfc1e,0x1c9));var _0xefc1=function(_0x485b5a,_0x2b289b){_0x485b5a=_0x485b5a-0x0;var _0xd2b34d=_0xfc1e[_0x485b5a];return _0xd2b34d;};'use strict';var Mustache=require('mustache');var _=require('lodash');module['exports']={'getMustacheRender':function(_0xeeb808,_0x22ce4b){return Mustache[_0xefc1('0x0')](_0xeeb808,_[_0xefc1('0x1')](_0x22ce4b[_0xefc1('0x2')],{'contact':_0x22ce4b['contact'],'message':_0x22ce4b[_0xefc1('0x3')],'account':_0x22ce4b[_0xefc1('0x4')],'interaction':_0x22ce4b['interaction'],'list':_0x22ce4b['list']}))||'';}}; \ No newline at end of file +var _0x33a1=['contact','account','interaction','list','mustache','lodash','merge','body'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x33a1,0x7c));var _0x133a=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x33a1[_0x2c91e9];return _0x13f0ff;};'use strict';var Mustache=require(_0x133a('0x0'));var _=require(_0x133a('0x1'));module['exports']={'getMustacheRender':function(_0x598a1b,_0x5dc419){return Mustache['render'](_0x598a1b,_[_0x133a('0x2')](_0x5dc419[_0x133a('0x3')],{'contact':_0x5dc419[_0x133a('0x4')],'message':_0x5dc419['message'],'account':_0x5dc419[_0x133a('0x5')],'interaction':_0x5dc419[_0x133a('0x6')],'list':_0x5dc419[_0x133a('0x7')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index fba3ed8..9f14734 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 _0xf702=['catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','mailQueues','paused','waiting','openchannelQueues','faxQueues','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../lib/rule-engine','isNil','IntervalId','map','Intervals','interval','listen','rules','message','interaction','isArray','applications','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','dialogflow','slice','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','execute','Applications\x20executed','stringify','matchPath','end','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','channel','emit','QueueReport','update'];(function(_0x9fd887,_0x47f76c){var _0x1a54ab=function(_0xb65c08){while(--_0xb65c08){_0x9fd887['push'](_0x9fd887['shift']());}};_0x1a54ab(++_0x47f76c);}(_0xf702,0xdd));var _0x2f70=function(_0x6017e9,_0x111e92){_0x6017e9=_0x6017e9-0x0;var _0x281a8f=_0xf702[_0x6017e9];return _0x281a8f;};'use strict';var _=require(_0x2f70('0x0'));var util=require(_0x2f70('0x1'));var path=require(_0x2f70('0x2'));var fs=require('fs');var jayson=require(_0x2f70('0x3'));var BPromise=require(_0x2f70('0x4'));var uuid=require(_0x2f70('0x5'));var config=require(_0x2f70('0x6'));var logger=require(_0x2f70('0x7'))(_0x2f70('0x8'));var rpc={'openchannelQueueReport':require('../rpc/openchannelQueueReport')};var rpc={'openchannelQueueReport':require(_0x2f70('0x9')),'mailQueueReport':require(_0x2f70('0xa')),'chatQueueReport':require(_0x2f70('0xb')),'smsQueueReport':require(_0x2f70('0xc')),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0x2f70('0xd'));function getId(_0x6a47d0,_0x251c18,_0x5383e8){return util['format']('%s.%s.%s',_0x6a47d0,_0x251c18||0x0,_0x5383e8||0x0);}function getIntervals(_0x18e4e9,_0xbd86cc){var _0x1ab948=[];if(!_[_0x2f70('0xe')](_0xbd86cc[_0x2f70('0xf')])&&!_[_0x2f70('0xe')](_0x18e4e9[_0xbd86cc[_0x2f70('0xf')]])&&!_[_0x2f70('0xe')](_0x18e4e9[_0xbd86cc[_0x2f70('0xf')]]['Intervals'])){_0x1ab948=_[_0x2f70('0x10')](_0x18e4e9[_0xbd86cc['IntervalId']][_0x2f70('0x11')],'interval');}else if(!_['isNil'](_0xbd86cc[_0x2f70('0x12')])){_0x1ab948=[_0xbd86cc[_0x2f70('0x12')]];}return _0x1ab948;}exports[_0x2f70('0x13')]=function(_0x11db2f){_0x11db2f[_0x2f70('0x14')]={};return new BPromise(function(_0x23aaa0,_0x595b6c){var _0x5e4aca={'Start':function(_0x5d165d){var _0x2c0d7f=this;return new Promise(function(_0x28016c,_0x25f00f){if(_0x5d165d){try{var _0x579f48=[];var _0x47fc4c=getId(_0x5d165d['channel'],_0x5d165d[_0x2f70('0x15')]?_0x5d165d['message']['id']:0x0,_0x5d165d[_0x2f70('0x16')]?_0x5d165d[_0x2f70('0x16')]['id']:0x0);if(_0x5d165d['applications']&&_[_0x2f70('0x17')](_0x5d165d[_0x2f70('0x18')])&&_0x5d165d[_0x2f70('0x18')][_0x2f70('0x19')]){for(var _0x4da6a1=0x0;_0x4da6a1<_0x5d165d[_0x2f70('0x18')][_0x2f70('0x19')];_0x4da6a1+=0x1){var _0x5e8f87=_0x5d165d[_0x2f70('0x18')][_0x4da6a1];if(fs[_0x2f70('0x1a')](path[_0x2f70('0x1b')](__dirname,'applications',_0x5e8f87[_0x2f70('0x1c')]+_0x2f70('0x1d')))){var _0x2b550d=[];switch(_0x5e8f87[_0x2f70('0x1c')][_0x2f70('0x1e')]()){case _0x2f70('0x1f'):var _0x5dda64=_0x5e8f87[_0x2f70('0x20')][_0x2f70('0x21')](',');_0x2b550d[_0x2f70('0x22')](_0x5dda64[0x0]);_0x2b550d['push'](_0x5dda64['slice'](0x1,_0x5dda64['length'])[_0x2f70('0x1b')](','));break;case _0x2f70('0x23'):var _0x5dda64=_0x5e8f87[_0x2f70('0x20')][_0x2f70('0x21')](',');_0x2b550d[_0x2f70('0x22')](_0x5dda64[0x0]);_0x2b550d[_0x2f70('0x22')](_0x5dda64[0x1]);_0x2b550d['push'](_0x5dda64[_0x2f70('0x24')](0x2,_0x5dda64[_0x2f70('0x19')])['join'](','));break;case _0x2f70('0x25'):var _0x5dda64=_0x5e8f87[_0x2f70('0x20')][_0x2f70('0x21')](',');_0x2b550d[_0x2f70('0x22')](_0x5dda64[0x0]);_0x2b550d[_0x2f70('0x22')](_0x5dda64[0x1]);_0x2b550d[_0x2f70('0x22')](_0x5dda64[0x2]);_0x2b550d[_0x2f70('0x22')](_0x5dda64[0x3]);_0x2b550d[_0x2f70('0x22')](_0x5dda64[_0x2f70('0x24')](0x4,_0x5dda64['length'])[_0x2f70('0x1b')](','));break;case _0x2f70('0x15'):_0x2b550d[_0x2f70('0x22')](_0x5e8f87[_0x2f70('0x20')]);break;case _0x2f70('0x26'):_0x2b550d[_0x2f70('0x22')](_0x5e8f87[_0x2f70('0x27')]);_0x2b550d[_0x2f70('0x22')](_0x5e8f87[_0x2f70('0x20')]);break;default:_0x2b550d=_[_0x2f70('0xe')](_0x5e8f87[_0x2f70('0x20')])?[]:_0x5e8f87[_0x2f70('0x20')]['split'](',');}var _0x1de031={'id':util['format'](_0x2f70('0x28'),_0x47fc4c,_0x5e8f87['id'],_0x5e8f87[_0x2f70('0x1c')]),'condition':require(_0x2f70('0x29'))[_0x2f70('0x2a')](_0x47fc4c,getIntervals(_0x11db2f[_0x2f70('0x2b')],_0x5e8f87),_0x11db2f),'consequence':require(_0x2f70('0x2c')+_0x5e8f87[_0x2f70('0x1c')])[_0x2f70('0x2d')](_0x47fc4c,_0x2b550d,_0x11db2f,_0x5d165d),'p':_0x5e8f87['priority']||0x0};logger[_0x2f70('0x2e')](_0x2f70('0x2f'),_0x1de031['id'],_0x2f70('0x30'),getIntervals(_0x11db2f[_0x2f70('0x2b')],_0x5e8f87)[_0x2f70('0x1b')](_0x2f70('0x31')));_0x579f48[_0x2f70('0x22')](_0x1de031);}else{logger[_0x2f70('0x32')](_0x2f70('0x33'),path[_0x2f70('0x1b')](__dirname,_0x2f70('0x18'),_0x5e8f87[_0x2f70('0x1c')]+_0x2f70('0x1d')));}}_0x11db2f[_0x2f70('0x14')][_0x47fc4c]=new RuleEngine(_0x579f48);_0x11db2f[_0x2f70('0x14')][_0x47fc4c][_0x2f70('0x34')](_0x5d165d,function(_0x2b336b){logger['info'](_0x2f70('0x35'),JSON[_0x2f70('0x36')](_0x2b336b[_0x2f70('0x37')]));if(_0x11db2f[_0x2f70('0x14')][_0x47fc4c]){_0x11db2f['rules'][_0x47fc4c]['emit'](_0x2f70('0x38'));}});return _0x28016c({'code':0xc8,'message':_0x5d165d});}else{logger[_0x2f70('0x2e')](_0x2f70('0x39'));return _0x28016c({'code':0xc8,'message':_0x5d165d});}}catch(_0x3643db){logger[_0x2f70('0x32')](_0x3643db[_0x2f70('0x3a')]);return _0x25f00f(_0x2c0d7f[_0x2f70('0x32')](0x1f4,_0x3643db));}}return _0x25f00f(_0x2f70('0x3b'));});},'AcceptMessage':function(_0x1db00b){var _0x5a719b=this;return new Promise(function(_0x465716,_0x58b33a){if(_0x1db00b[_0x2f70('0x15')]&&_0x1db00b['message']['id']){try{var _0x19a045=getId(_0x1db00b[_0x2f70('0x3c')],_0x1db00b[_0x2f70('0x15')]?_0x1db00b[_0x2f70('0x15')]['id']:0x0,_0x1db00b[_0x2f70('0x16')]?_0x1db00b[_0x2f70('0x16')]['id']:0x0);if(_0x11db2f[_0x2f70('0x14')][_0x19a045]){_0x11db2f[_0x2f70('0x14')][_0x19a045][_0x2f70('0x3d')](_0x2f70('0x38'));if(rpc[_0x1db00b[_0x2f70('0x3c')]+_0x2f70('0x3e')]){rpc[_0x1db00b[_0x2f70('0x3c')]+_0x2f70('0x3e')][_0x2f70('0x3f')](_0x19a045,{'UserId':_0x1db00b['message']['UserId']})[_0x2f70('0x40')](function(_0x486720){logger[_0x2f70('0x32')](_0x2f70('0x41'));});}}return _0x465716({'code':0xc8,'message':_0x1db00b});}catch(_0x5c8f15){logger[_0x2f70('0x32')](_0x5c8f15[_0x2f70('0x3a')]);return _0x58b33a(_0x5a719b['error'](0x1f4,_0x5c8f15));}}logger[_0x2f70('0x32')]('message\x20is\x20empty');return _0x58b33a(_0x5a719b[_0x2f70('0x32')](0x1f4,_0x2f70('0x42')));});},'RejectMessage':function(_0x1d56f7){var _0x2989a6=this;return new Promise(function(_0x523050,_0x34b062){if(_0x1d56f7[_0x2f70('0x43')]&&_0x1d56f7[_0x2f70('0x43')]['id']){try{if(_0x11db2f[_0x2f70('0x44')][_0x1d56f7[_0x2f70('0x43')]['id']]){_0x11db2f[_0x2f70('0x44')][_0x1d56f7[_0x2f70('0x43')]['id']][_0x2f70('0x45')]=![];_0x11db2f[_0x2f70('0x44')][_0x1d56f7[_0x2f70('0x43')]['id']][_0x2f70('0x46')]=undefined;}return _0x523050({'code':0xc8,'message':_0x1d56f7});}catch(_0x272194){logger[_0x2f70('0x32')](_0x272194[_0x2f70('0x3a')]);return _0x34b062(_0x2989a6['error'](0x1f4,_0x272194));}}logger['error'](_0x2f70('0x42'));return _0x34b062(_0x2989a6[_0x2f70('0x32')](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x12fdd4){var _0x2fc4f3=this;return new Promise(function(_0x13ea79,_0x195d88){if(_0x12fdd4[_0x2f70('0x3c')]&&_0x12fdd4[_0x2f70('0x16')]&&_0x12fdd4[_0x2f70('0x16')]['id']){try{var _0x41c28d=getId(_0x12fdd4[_0x2f70('0x3c')],_0x12fdd4[_0x2f70('0x15')]?_0x12fdd4[_0x2f70('0x15')]['id']:0x0,_0x12fdd4[_0x2f70('0x16')]?_0x12fdd4[_0x2f70('0x16')]['id']:0x0);if(_0x11db2f[_0x2f70('0x14')][_0x41c28d]){_0x11db2f[_0x2f70('0x14')][_0x41c28d][_0x2f70('0x3d')]('end');}return _0x13ea79({'code':0xc8,'message':_0x12fdd4});}catch(_0x427b56){logger[_0x2f70('0x32')](_0x427b56[_0x2f70('0x3a')]);return _0x195d88(_0x2fc4f3['error'](0x1f4,_0x427b56));}}logger[_0x2f70('0x32')](_0x2f70('0x42'));return _0x195d88(_0x2fc4f3[_0x2f70('0x32')](0x1f4,_0x2f70('0x42')));});},'AgentCapacity':function(_0x42734c){var _0x57c120=this;return new Promise(function(_0xf6ba12,_0x4712bf){if(_0x11db2f['agents'][_0x2f70('0x47')](_0x42734c['id'])){for(var _0x3cb630 in _0x42734c[_0x2f70('0x48')]){if(_0x42734c['capacity'][_0x2f70('0x47')](_0x3cb630)){if(_0x11db2f['agents'][_0x42734c['id']][_0x2f70('0x47')](_0x3cb630+_0x2f70('0x49'))){_0x11db2f[_0x2f70('0x44')][_0x42734c['id']][_0x3cb630+'CurrentCapacity']=parseInt(_0x42734c['capacity'][_0x3cb630],0xa);}}}_0x11db2f['agents'][_0x42734c['id']][_0x2f70('0x4a')]();return _0xf6ba12({'code':0xc8,'message':_0x11db2f[_0x2f70('0x44')][_0x42734c['id']]});}else{return _0x4712bf(_0x57c120[_0x2f70('0x32')](0x1f4,_0x2f70('0x4b')));}});},'Agents':function(_0x4b4537){return new Promise(function(_0x508b3d,_0x44a53a){var _0x1666d2=_['values'](_0x11db2f[_0x2f70('0x44')]);_0x508b3d({'count':_0x1666d2['length'],'rows':_0x1666d2});});},'ChatQueues':function(_0x103b0f){return new Promise(function(_0x2a10e8,_0x7c2759){var _0x53b5ee=[];for(var _0x240ecd in _0x11db2f[_0x2f70('0x4c')]){if(_0x11db2f[_0x2f70('0x4c')][_0x2f70('0x47')](_0x240ecd)){var _0x200f1d=_0x11db2f[_0x2f70('0x4c')][_0x240ecd];var _0x5a06d2={'id':_0x200f1d['id'],'available':_0x200f1d[_0x2f70('0x4d')],'loggedIn':_0x200f1d[_0x2f70('0x4e')],'name':_0x200f1d[_0x2f70('0x4f')],'paused':_0x200f1d['paused'],'waiting':_0x200f1d['waiting']};_0x53b5ee[_0x2f70('0x22')](_0x5a06d2);}}_0x2a10e8({'count':_0x53b5ee[_0x2f70('0x19')],'rows':_0x53b5ee});});},'MailQueues':function(_0x5926ae){return new Promise(function(_0x47c851,_0x58732f){var _0x42647b=[];for(var _0x585452 in _0x11db2f[_0x2f70('0x50')]){if(_0x11db2f['mailQueues'][_0x2f70('0x47')](_0x585452)){var _0x533698=_0x11db2f[_0x2f70('0x50')][_0x585452];var _0x4c13dd={'id':_0x533698['id'],'available':_0x533698[_0x2f70('0x4d')],'loggedIn':_0x533698[_0x2f70('0x4e')],'name':_0x533698['name'],'paused':_0x533698[_0x2f70('0x51')],'waiting':_0x533698[_0x2f70('0x52')]};_0x42647b[_0x2f70('0x22')](_0x4c13dd);}}_0x47c851({'count':_0x42647b['length'],'rows':_0x42647b});});},'OpenchannelQueues':function(_0x2452aa){return new Promise(function(_0x11bc2f,_0x5891f2){var _0x51c060=[];for(var _0x3ae064 in _0x11db2f[_0x2f70('0x53')]){if(_0x11db2f[_0x2f70('0x53')]['hasOwnProperty'](_0x3ae064)){var _0x35dfc=_0x11db2f[_0x2f70('0x53')][_0x3ae064];var _0x258398={'id':_0x35dfc['id'],'available':_0x35dfc[_0x2f70('0x4d')],'loggedIn':_0x35dfc[_0x2f70('0x4e')],'name':_0x35dfc[_0x2f70('0x4f')],'paused':_0x35dfc[_0x2f70('0x51')],'waiting':_0x35dfc[_0x2f70('0x52')]};_0x51c060[_0x2f70('0x22')](_0x258398);}}_0x11bc2f({'count':_0x51c060[_0x2f70('0x19')],'rows':_0x51c060});});},'SmsQueues':function(_0x14b647){return new Promise(function(_0xef4f12,_0x2f0043){var _0x1d79f8=[];for(var _0xf8db69 in _0x11db2f['smsQueues']){if(_0x11db2f['smsQueues'][_0x2f70('0x47')](_0xf8db69)){var _0x24ba15=_0x11db2f['smsQueues'][_0xf8db69];var _0x730973={'id':_0x24ba15['id'],'available':_0x24ba15[_0x2f70('0x4d')],'loggedIn':_0x24ba15['loggedIn'],'name':_0x24ba15['name'],'paused':_0x24ba15['paused'],'waiting':_0x24ba15[_0x2f70('0x52')]};_0x1d79f8[_0x2f70('0x22')](_0x730973);}}_0xef4f12({'count':_0x1d79f8[_0x2f70('0x19')],'rows':_0x1d79f8});});},'FaxQueues':function(_0x319fb0){return new Promise(function(_0x5d744d,_0x5abb58){var _0x41b375=[];for(var _0x4c3f57 in _0x11db2f[_0x2f70('0x54')]){if(_0x11db2f['faxQueues'][_0x2f70('0x47')](_0x4c3f57)){var _0x457185=_0x11db2f[_0x2f70('0x54')][_0x4c3f57];var _0x225bd6={'id':_0x457185['id'],'available':_0x457185['available'],'loggedIn':_0x457185[_0x2f70('0x4e')],'name':_0x457185['name'],'paused':_0x457185[_0x2f70('0x51')],'waiting':_0x457185[_0x2f70('0x52')]};_0x41b375[_0x2f70('0x22')](_0x225bd6);}}_0x5d744d({'count':_0x41b375[_0x2f70('0x19')],'rows':_0x41b375});});},'ChatQueuesWaitingInteractions':function(_0x4fbeb0){return new Promise(function(_0x3beea6,_0x2ba25b){var _0x19368a=_[_0x2f70('0x55')](_0x11db2f['chatQueuesWaitingInteractions']);_0x3beea6({'count':_0x19368a[_0x2f70('0x19')],'rows':_0x19368a});});},'MailQueuesWaitingInteractions':function(_0x23231f){return new Promise(function(_0x54701e,_0x1e25ca){var _0x529c62=_[_0x2f70('0x55')](_0x11db2f[_0x2f70('0x56')]);_0x54701e({'count':_0x529c62['length'],'rows':_0x529c62});});},'OpenchannelQueuesWaitingInteractions':function(_0x5b76e8){return new Promise(function(_0x5ca5f8,_0x13fe9f){var _0x183e8d=_[_0x2f70('0x55')](_0x11db2f[_0x2f70('0x57')]);_0x5ca5f8({'count':_0x183e8d['length'],'rows':_0x183e8d});});},'SmsQueuesWaitingInteractions':function(_0x298108){return new Promise(function(_0x1fbbca,_0x2eac87){var _0x2396dd=_[_0x2f70('0x55')](_0x11db2f[_0x2f70('0x58')]);_0x1fbbca({'count':_0x2396dd['length'],'rows':_0x2396dd});});},'FaxQueuesWaitingInteractions':function(_0x29fbf6){return new Promise(function(_0x14b0c1,_0x4bef47){var _0x553874=_[_0x2f70('0x55')](_0x11db2f[_0x2f70('0x59')]);_0x14b0c1({'count':_0x553874[_0x2f70('0x19')],'rows':_0x553874});});}};var _0xace714=jayson[_0x2f70('0x5a')](_0x5e4aca)[_0x2f70('0x5b')]();_0xace714['on'](_0x2f70('0x32'),function(_0x7a9f28){logger[_0x2f70('0x32')](JSON[_0x2f70('0x36')](_0x7a9f28));return _0x595b6c(_0x7a9f28);});_0xace714[_0x2f70('0x13')](0x232c,'127.0.0.1',function(){console[_0x2f70('0x5c')](_0x2f70('0x5d'),0x232c);return _0x23aaa0(_0x2f70('0x5e')+0x232c);});});}; \ No newline at end of file +var _0x9ff5=['../../../config/environment','../../../config/logger','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','isNil','IntervalId','map','Intervals','interval','listen','rules','channel','message','interaction','applications','isArray','length','app','toLowerCase','autoreply','appdata','split','push','slice','tag','TagId','format','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','Push\x20new\x20rule','on\x20interval','join','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','execute','Applications\x20executed','stringify','emit','end','No\x20applications\x20to\x20execute','QueueReport','update','UserId','message\x20is\x20empty','agent','agents','busy','busyQueue','stack','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','paused','mailQueues','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid'];(function(_0x19843b,_0x5e386a){var _0x5e682a=function(_0x53b20b){while(--_0x53b20b){_0x19843b['push'](_0x19843b['shift']());}};_0x5e682a(++_0x5e386a);}(_0x9ff5,0x1ad));var _0x59ff=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9ff5[_0x40a045];return _0x1a687c;};'use strict';var _=require(_0x59ff('0x0'));var util=require(_0x59ff('0x1'));var path=require(_0x59ff('0x2'));var fs=require('fs');var jayson=require(_0x59ff('0x3'));var BPromise=require(_0x59ff('0x4'));var uuid=require(_0x59ff('0x5'));var config=require(_0x59ff('0x6'));var logger=require(_0x59ff('0x7'))(_0x59ff('0x8'));var rpc={'openchannelQueueReport':require(_0x59ff('0x9'))};var rpc={'openchannelQueueReport':require(_0x59ff('0x9')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x59ff('0xa')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0x59ff('0xb'))};var RuleEngine=require(_0x59ff('0xc'));function getId(_0x366f4b,_0x23113c,_0x2997bd){return util['format']('%s.%s.%s',_0x366f4b,_0x23113c||0x0,_0x2997bd||0x0);}function getIntervals(_0x3483ec,_0x3b001a){var _0x4d6353=[];if(!_[_0x59ff('0xd')](_0x3b001a[_0x59ff('0xe')])&&!_[_0x59ff('0xd')](_0x3483ec[_0x3b001a[_0x59ff('0xe')]])&&!_[_0x59ff('0xd')](_0x3483ec[_0x3b001a[_0x59ff('0xe')]]['Intervals'])){_0x4d6353=_[_0x59ff('0xf')](_0x3483ec[_0x3b001a['IntervalId']][_0x59ff('0x10')],'interval');}else if(!_[_0x59ff('0xd')](_0x3b001a[_0x59ff('0x11')])){_0x4d6353=[_0x3b001a[_0x59ff('0x11')]];}return _0x4d6353;}exports[_0x59ff('0x12')]=function(_0xb91046){_0xb91046[_0x59ff('0x13')]={};return new BPromise(function(_0xb276c8,_0x28177d){var _0x244fd2={'Start':function(_0x20dbec){var _0x526b2f=this;return new Promise(function(_0x937c6,_0x1eb329){if(_0x20dbec){try{var _0x3dbfb5=[];var _0x10710c=getId(_0x20dbec[_0x59ff('0x14')],_0x20dbec[_0x59ff('0x15')]?_0x20dbec[_0x59ff('0x15')]['id']:0x0,_0x20dbec[_0x59ff('0x16')]?_0x20dbec['interaction']['id']:0x0);if(_0x20dbec[_0x59ff('0x17')]&&_[_0x59ff('0x18')](_0x20dbec[_0x59ff('0x17')])&&_0x20dbec[_0x59ff('0x17')][_0x59ff('0x19')]){for(var _0x2edf14=0x0;_0x2edf14<_0x20dbec[_0x59ff('0x17')][_0x59ff('0x19')];_0x2edf14+=0x1){var _0xda06d8=_0x20dbec[_0x59ff('0x17')][_0x2edf14];if(fs['existsSync'](path['join'](__dirname,_0x59ff('0x17'),_0xda06d8[_0x59ff('0x1a')]+'.js'))){var _0x56771b=[];switch(_0xda06d8['app'][_0x59ff('0x1b')]()){case _0x59ff('0x1c'):var _0x2e4be1=_0xda06d8[_0x59ff('0x1d')][_0x59ff('0x1e')](',');_0x56771b[_0x59ff('0x1f')](_0x2e4be1[0x0]);_0x56771b['push'](_0x2e4be1[_0x59ff('0x20')](0x1,_0x2e4be1[_0x59ff('0x19')])['join'](','));break;case'dialogflow':var _0x2e4be1=_0xda06d8[_0x59ff('0x1d')]['split'](',');_0x56771b[_0x59ff('0x1f')](_0x2e4be1[0x0]);_0x56771b['push'](_0x2e4be1[0x1]);_0x56771b[_0x59ff('0x1f')](_0x2e4be1[_0x59ff('0x20')](0x2,_0x2e4be1['length'])['join'](','));break;case'amazonlex':var _0x2e4be1=_0xda06d8[_0x59ff('0x1d')][_0x59ff('0x1e')](',');_0x56771b[_0x59ff('0x1f')](_0x2e4be1[0x0]);_0x56771b[_0x59ff('0x1f')](_0x2e4be1[0x1]);_0x56771b[_0x59ff('0x1f')](_0x2e4be1[0x2]);_0x56771b[_0x59ff('0x1f')](_0x2e4be1[0x3]);_0x56771b[_0x59ff('0x1f')](_0x2e4be1['slice'](0x4,_0x2e4be1[_0x59ff('0x19')])['join'](','));break;case _0x59ff('0x15'):_0x56771b[_0x59ff('0x1f')](_0xda06d8[_0x59ff('0x1d')]);break;case _0x59ff('0x21'):_0x56771b[_0x59ff('0x1f')](_0xda06d8[_0x59ff('0x22')]);_0x56771b[_0x59ff('0x1f')](_0xda06d8['appdata']);break;default:_0x56771b=_[_0x59ff('0xd')](_0xda06d8[_0x59ff('0x1d')])?[]:_0xda06d8[_0x59ff('0x1d')][_0x59ff('0x1e')](',');}var _0x3b9054={'id':util[_0x59ff('0x23')](_0x59ff('0x24'),_0x10710c,_0xda06d8['id'],_0xda06d8[_0x59ff('0x1a')]),'condition':require(_0x59ff('0x25'))[_0x59ff('0x26')](_0x10710c,getIntervals(_0xb91046[_0x59ff('0x27')],_0xda06d8),_0xb91046),'consequence':require('./applications/'+_0xda06d8[_0x59ff('0x1a')])[_0x59ff('0x28')](_0x10710c,_0x56771b,_0xb91046,_0x20dbec),'p':_0xda06d8[_0x59ff('0x29')]||0x0};logger[_0x59ff('0x2a')](_0x59ff('0x2b'),_0x3b9054['id'],_0x59ff('0x2c'),getIntervals(_0xb91046[_0x59ff('0x27')],_0xda06d8)[_0x59ff('0x2d')](_0x59ff('0x2e')));_0x3dbfb5[_0x59ff('0x1f')](_0x3b9054);}else{logger[_0x59ff('0x2f')](_0x59ff('0x30'),path['join'](__dirname,'applications',_0xda06d8[_0x59ff('0x1a')]+_0x59ff('0x31')));}}_0xb91046[_0x59ff('0x13')][_0x10710c]=new RuleEngine(_0x3dbfb5);_0xb91046[_0x59ff('0x13')][_0x10710c][_0x59ff('0x32')](_0x20dbec,function(_0x3ec595){logger[_0x59ff('0x2a')](_0x59ff('0x33'),JSON[_0x59ff('0x34')](_0x3ec595['matchPath']));if(_0xb91046['rules'][_0x10710c]){_0xb91046[_0x59ff('0x13')][_0x10710c][_0x59ff('0x35')](_0x59ff('0x36'));}});return _0x937c6({'code':0xc8,'message':_0x20dbec});}else{logger['info'](_0x59ff('0x37'));return _0x937c6({'code':0xc8,'message':_0x20dbec});}}catch(_0x3c6915){logger[_0x59ff('0x2f')](_0x3c6915['stack']);return _0x1eb329(_0x526b2f[_0x59ff('0x2f')](0x1f4,_0x3c6915));}}return _0x1eb329('routing\x20is\x20empty');});},'AcceptMessage':function(_0x2ad689){var _0x502f68=this;return new Promise(function(_0x433ef5,_0x58bca0){if(_0x2ad689[_0x59ff('0x15')]&&_0x2ad689[_0x59ff('0x15')]['id']){try{var _0x34d4f8=getId(_0x2ad689[_0x59ff('0x14')],_0x2ad689[_0x59ff('0x15')]?_0x2ad689[_0x59ff('0x15')]['id']:0x0,_0x2ad689[_0x59ff('0x16')]?_0x2ad689[_0x59ff('0x16')]['id']:0x0);if(_0xb91046[_0x59ff('0x13')][_0x34d4f8]){_0xb91046['rules'][_0x34d4f8]['emit'](_0x59ff('0x36'));if(rpc[_0x2ad689[_0x59ff('0x14')]+'QueueReport']){rpc[_0x2ad689['channel']+_0x59ff('0x38')][_0x59ff('0x39')](_0x34d4f8,{'UserId':_0x2ad689[_0x59ff('0x15')][_0x59ff('0x3a')]})['catch'](function(_0x44ada2){logger[_0x59ff('0x2f')]('error\x20update\x20queue\x20report');});}}return _0x433ef5({'code':0xc8,'message':_0x2ad689});}catch(_0x3e6bff){logger['error'](_0x3e6bff['stack']);return _0x58bca0(_0x502f68[_0x59ff('0x2f')](0x1f4,_0x3e6bff));}}logger[_0x59ff('0x2f')](_0x59ff('0x3b'));return _0x58bca0(_0x502f68[_0x59ff('0x2f')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x29410d){var _0x11ed42=this;return new Promise(function(_0x2cbbfc,_0x3b2cdf){if(_0x29410d[_0x59ff('0x3c')]&&_0x29410d['agent']['id']){try{if(_0xb91046[_0x59ff('0x3d')][_0x29410d['agent']['id']]){_0xb91046[_0x59ff('0x3d')][_0x29410d[_0x59ff('0x3c')]['id']][_0x59ff('0x3e')]=![];_0xb91046[_0x59ff('0x3d')][_0x29410d['agent']['id']][_0x59ff('0x3f')]=undefined;}return _0x2cbbfc({'code':0xc8,'message':_0x29410d});}catch(_0x52c3be){logger[_0x59ff('0x2f')](_0x52c3be[_0x59ff('0x40')]);return _0x3b2cdf(_0x11ed42[_0x59ff('0x2f')](0x1f4,_0x52c3be));}}logger[_0x59ff('0x2f')](_0x59ff('0x3b'));return _0x3b2cdf(_0x11ed42[_0x59ff('0x2f')](0x1f4,_0x59ff('0x3b')));});},'AbandonInteraction':function(_0x116fb5){var _0x4e201c=this;return new Promise(function(_0x37ae73,_0x1a7a1e){if(_0x116fb5[_0x59ff('0x14')]&&_0x116fb5[_0x59ff('0x16')]&&_0x116fb5[_0x59ff('0x16')]['id']){try{var _0x3cb61e=getId(_0x116fb5[_0x59ff('0x14')],_0x116fb5[_0x59ff('0x15')]?_0x116fb5[_0x59ff('0x15')]['id']:0x0,_0x116fb5[_0x59ff('0x16')]?_0x116fb5[_0x59ff('0x16')]['id']:0x0);if(_0xb91046[_0x59ff('0x13')][_0x3cb61e]){_0xb91046[_0x59ff('0x13')][_0x3cb61e][_0x59ff('0x35')]('end');}return _0x37ae73({'code':0xc8,'message':_0x116fb5});}catch(_0x476170){logger[_0x59ff('0x2f')](_0x476170[_0x59ff('0x40')]);return _0x1a7a1e(_0x4e201c[_0x59ff('0x2f')](0x1f4,_0x476170));}}logger[_0x59ff('0x2f')](_0x59ff('0x3b'));return _0x1a7a1e(_0x4e201c[_0x59ff('0x2f')](0x1f4,_0x59ff('0x3b')));});},'AgentCapacity':function(_0x682322){var _0x46a54f=this;return new Promise(function(_0x39344a,_0x5dbde2){if(_0xb91046[_0x59ff('0x3d')][_0x59ff('0x41')](_0x682322['id'])){for(var _0x107a70 in _0x682322[_0x59ff('0x42')]){if(_0x682322[_0x59ff('0x42')][_0x59ff('0x41')](_0x107a70)){if(_0xb91046[_0x59ff('0x3d')][_0x682322['id']][_0x59ff('0x41')](_0x107a70+'CurrentCapacity')){_0xb91046[_0x59ff('0x3d')][_0x682322['id']][_0x107a70+_0x59ff('0x43')]=parseInt(_0x682322['capacity'][_0x107a70],0xa);}}}_0xb91046[_0x59ff('0x3d')][_0x682322['id']][_0x59ff('0x44')]();return _0x39344a({'code':0xc8,'message':_0xb91046['agents'][_0x682322['id']]});}else{return _0x5dbde2(_0x46a54f[_0x59ff('0x2f')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x4ebdd5){return new Promise(function(_0x459c30,_0x25ef79){var _0x50176e=_[_0x59ff('0x45')](_0xb91046[_0x59ff('0x3d')]);_0x459c30({'count':_0x50176e[_0x59ff('0x19')],'rows':_0x50176e});});},'ChatQueues':function(_0x2216a8){return new Promise(function(_0x31dcb5,_0xe5d2f){var _0x2c722d=[];for(var _0x7cdcc5 in _0xb91046['chatQueues']){if(_0xb91046[_0x59ff('0x46')][_0x59ff('0x41')](_0x7cdcc5)){var _0x215c33=_0xb91046[_0x59ff('0x46')][_0x7cdcc5];var _0xbbb4d3={'id':_0x215c33['id'],'available':_0x215c33[_0x59ff('0x47')],'loggedIn':_0x215c33[_0x59ff('0x48')],'name':_0x215c33[_0x59ff('0x49')],'paused':_0x215c33[_0x59ff('0x4a')],'waiting':_0x215c33['waiting']};_0x2c722d[_0x59ff('0x1f')](_0xbbb4d3);}}_0x31dcb5({'count':_0x2c722d[_0x59ff('0x19')],'rows':_0x2c722d});});},'MailQueues':function(_0x42529f){return new Promise(function(_0x587631,_0x1b47d5){var _0x1b4e84=[];for(var _0x24858c in _0xb91046[_0x59ff('0x4b')]){if(_0xb91046[_0x59ff('0x4b')][_0x59ff('0x41')](_0x24858c)){var _0x42be1a=_0xb91046[_0x59ff('0x4b')][_0x24858c];var _0x2bd9b3={'id':_0x42be1a['id'],'available':_0x42be1a[_0x59ff('0x47')],'loggedIn':_0x42be1a['loggedIn'],'name':_0x42be1a['name'],'paused':_0x42be1a[_0x59ff('0x4a')],'waiting':_0x42be1a[_0x59ff('0x4c')]};_0x1b4e84[_0x59ff('0x1f')](_0x2bd9b3);}}_0x587631({'count':_0x1b4e84[_0x59ff('0x19')],'rows':_0x1b4e84});});},'OpenchannelQueues':function(_0x204b63){return new Promise(function(_0x18243c,_0x536b61){var _0x6b9043=[];for(var _0xa9d71e in _0xb91046[_0x59ff('0x4d')]){if(_0xb91046['openchannelQueues'][_0x59ff('0x41')](_0xa9d71e)){var _0x2fb594=_0xb91046[_0x59ff('0x4d')][_0xa9d71e];var _0x172f1c={'id':_0x2fb594['id'],'available':_0x2fb594[_0x59ff('0x47')],'loggedIn':_0x2fb594['loggedIn'],'name':_0x2fb594[_0x59ff('0x49')],'paused':_0x2fb594[_0x59ff('0x4a')],'waiting':_0x2fb594[_0x59ff('0x4c')]};_0x6b9043[_0x59ff('0x1f')](_0x172f1c);}}_0x18243c({'count':_0x6b9043[_0x59ff('0x19')],'rows':_0x6b9043});});},'SmsQueues':function(_0x3b41a5){return new Promise(function(_0xac0128,_0x54346f){var _0x430dc1=[];for(var _0x18c585 in _0xb91046[_0x59ff('0x4e')]){if(_0xb91046['smsQueues'][_0x59ff('0x41')](_0x18c585)){var _0x4b6191=_0xb91046[_0x59ff('0x4e')][_0x18c585];var _0x37a892={'id':_0x4b6191['id'],'available':_0x4b6191[_0x59ff('0x47')],'loggedIn':_0x4b6191['loggedIn'],'name':_0x4b6191[_0x59ff('0x49')],'paused':_0x4b6191[_0x59ff('0x4a')],'waiting':_0x4b6191[_0x59ff('0x4c')]};_0x430dc1[_0x59ff('0x1f')](_0x37a892);}}_0xac0128({'count':_0x430dc1['length'],'rows':_0x430dc1});});},'FaxQueues':function(_0x5d4ccb){return new Promise(function(_0x1e6c65,_0x309c23){var _0x1ab11c=[];for(var _0xca2e1a in _0xb91046[_0x59ff('0x4f')]){if(_0xb91046[_0x59ff('0x4f')][_0x59ff('0x41')](_0xca2e1a)){var _0x35b77f=_0xb91046[_0x59ff('0x4f')][_0xca2e1a];var _0xb5c946={'id':_0x35b77f['id'],'available':_0x35b77f[_0x59ff('0x47')],'loggedIn':_0x35b77f['loggedIn'],'name':_0x35b77f[_0x59ff('0x49')],'paused':_0x35b77f[_0x59ff('0x4a')],'waiting':_0x35b77f[_0x59ff('0x4c')]};_0x1ab11c[_0x59ff('0x1f')](_0xb5c946);}}_0x1e6c65({'count':_0x1ab11c[_0x59ff('0x19')],'rows':_0x1ab11c});});},'ChatQueuesWaitingInteractions':function(_0x225f76){return new Promise(function(_0x5680df,_0x404bbd){var _0x2a9f18=_[_0x59ff('0x45')](_0xb91046[_0x59ff('0x50')]);_0x5680df({'count':_0x2a9f18[_0x59ff('0x19')],'rows':_0x2a9f18});});},'MailQueuesWaitingInteractions':function(_0x50aec7){return new Promise(function(_0x24c315,_0x287a1e){var _0xdc8fd9=_['values'](_0xb91046['mailQueuesWaitingInteractions']);_0x24c315({'count':_0xdc8fd9['length'],'rows':_0xdc8fd9});});},'OpenchannelQueuesWaitingInteractions':function(_0x542916){return new Promise(function(_0x1e229e,_0x35611b){var _0xae7ead=_[_0x59ff('0x45')](_0xb91046['openchannelQueuesWaitingInteractions']);_0x1e229e({'count':_0xae7ead[_0x59ff('0x19')],'rows':_0xae7ead});});},'SmsQueuesWaitingInteractions':function(_0x56049e){return new Promise(function(_0x504740,_0x629072){var _0x532bb5=_['values'](_0xb91046[_0x59ff('0x51')]);_0x504740({'count':_0x532bb5['length'],'rows':_0x532bb5});});},'FaxQueuesWaitingInteractions':function(_0x5a268c){return new Promise(function(_0x13ce70,_0x31afc2){var _0x2f3f51=_['values'](_0xb91046['faxQueuesWaitingInteractions']);_0x13ce70({'count':_0x2f3f51[_0x59ff('0x19')],'rows':_0x2f3f51});});}};var _0x576d10=jayson[_0x59ff('0x52')](_0x244fd2)[_0x59ff('0x53')]();_0x576d10['on'](_0x59ff('0x2f'),function(_0x1627ab){logger['error'](JSON[_0x59ff('0x34')](_0x1627ab));return _0x28177d(_0x1627ab);});_0x576d10[_0x59ff('0x12')](0x232c,'127.0.0.1',function(){console[_0x59ff('0x54')](_0x59ff('0x55'),0x232c);return _0xb276c8(_0x59ff('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 7dc7039..9f91898 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 _0xbc5d=['bluebird','jayson/promise','../../../config/logger','client','request','then','error','message','result','condition','rules','stop','length','push','format','iftime\x20%s','indexOf','true','catch','some','info','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','join','stack','util'];(function(_0x188a1d,_0x2249fc){var _0x43d0db=function(_0x50bacc){while(--_0x50bacc){_0x188a1d['push'](_0x188a1d['shift']());}};_0x43d0db(++_0x2249fc);}(_0xbc5d,0x128));var _0xdbc5=function(_0x3c028f,_0x4b0123){_0x3c028f=_0x3c028f-0x0;var _0x4ce2dd=_0xbc5d[_0x3c028f];return _0x4ce2dd;};'use strict';var util=require(_0xdbc5('0x0'));var BPromise=require(_0xdbc5('0x1'));var jayson=require(_0xdbc5('0x2'));var _=require('lodash');var logger=require(_0xdbc5('0x3'))('routing');var client=jayson[_0xdbc5('0x4')]['http']({'port':0x232a});function request(_0x45602e,_0xe99f3d){return new BPromise(function(_0x37b9e5,_0x3ce2ee){return client[_0xdbc5('0x5')](_0x45602e,_0xe99f3d)[_0xdbc5('0x6')](function(_0x570ea6){if(_0x570ea6[_0xdbc5('0x7')]){return _0x3ce2ee(_0x570ea6['error'][_0xdbc5('0x8')]);}else{return _0x37b9e5(_0x570ea6[_0xdbc5('0x9')]);}})['catch'](function(_0x4f767b){return _0x3ce2ee(_0x4f767b);});});}exports[_0xdbc5('0xa')]=function(_0x2a33f0,_0x5b3840,_0x2f93e2){return function(_0x1a60b1){if(_0x2f93e2[_0xdbc5('0xb')]&&!_0x2f93e2['rules'][_0x2a33f0]){logger['info']('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x2a33f0);return _0x1a60b1[_0xdbc5('0xc')]();}var _0x1bf9f3=[];for(var _0x435365=0x0;_0x435365<_0x5b3840[_0xdbc5('0xd')];_0x435365+=0x1){_0x1bf9f3[_0xdbc5('0xe')](request('Command',{'command':util[_0xdbc5('0xf')](_0xdbc5('0x10'),_0x5b3840[_0x435365])})[_0xdbc5('0x6')](function(_0x26f7d4){return _0x26f7d4&&_0x26f7d4[_0xdbc5('0x8')]&&_0x26f7d4[_0xdbc5('0x8')][_0xdbc5('0x11')](_0xdbc5('0x12'))>=0x0?!![]:![];})[_0xdbc5('0x13')](function(_0x112fb3){logger[_0xdbc5('0x7')]('[%s][INTERVAL]\x20%s',_0x2a33f0,_0x5b3840[_0x435365]);}));}BPromise['all'](_0x1bf9f3)['then'](function(_0x732cd9){var _0x285012=_[_0xdbc5('0x14')](_0x732cd9);logger[_0xdbc5('0x15')](_0xdbc5('0x16'),_0x2a33f0,_0x5b3840['join'](_0xdbc5('0x17')),_0x285012);_0x1a60b1[_0xdbc5('0x18')](_0x285012);})[_0xdbc5('0x13')](function(_0x1bdae8){console['log'](_0x1bdae8);logger[_0xdbc5('0x7')](_0xdbc5('0x16'),_0x2a33f0,_0x5b3840[_0xdbc5('0x19')]('\x20|\x20'),_0x1bdae8[_0xdbc5('0x1a')]);_0x1a60b1['stop']();});};}; \ No newline at end of file +var _0x5ab5=['client','request','then','error','message','result','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','when','log','join','bluebird','jayson/promise','../../../config/logger','routing'];(function(_0x387777,_0x356171){var _0x3f84c0=function(_0x4d4423){while(--_0x4d4423){_0x387777['push'](_0x387777['shift']());}};_0x3f84c0(++_0x356171);}(_0x5ab5,0x1af));var _0x55ab=function(_0x1126d9,_0x129919){_0x1126d9=_0x1126d9-0x0;var _0x4b5542=_0x5ab5[_0x1126d9];return _0x4b5542;};'use strict';var util=require('util');var BPromise=require(_0x55ab('0x0'));var jayson=require(_0x55ab('0x1'));var _=require('lodash');var logger=require(_0x55ab('0x2'))(_0x55ab('0x3'));var client=jayson[_0x55ab('0x4')]['http']({'port':0x232a});function request(_0x924d4f,_0x2d385f){return new BPromise(function(_0x29ce65,_0x5bdf98){return client[_0x55ab('0x5')](_0x924d4f,_0x2d385f)[_0x55ab('0x6')](function(_0x2e5a76){if(_0x2e5a76[_0x55ab('0x7')]){return _0x5bdf98(_0x2e5a76[_0x55ab('0x7')][_0x55ab('0x8')]);}else{return _0x29ce65(_0x2e5a76[_0x55ab('0x9')]);}})['catch'](function(_0x20e1ec){return _0x5bdf98(_0x20e1ec);});});}exports['condition']=function(_0x17b9ff,_0x2ed19f,_0x205f7b){return function(_0x4ed1af){if(_0x205f7b[_0x55ab('0xa')]&&!_0x205f7b[_0x55ab('0xa')][_0x17b9ff]){logger[_0x55ab('0xb')](_0x55ab('0xc'),_0x17b9ff);return _0x4ed1af[_0x55ab('0xd')]();}var _0xc4f716=[];for(var _0x3e3edc=0x0;_0x3e3edc<_0x2ed19f[_0x55ab('0xe')];_0x3e3edc+=0x1){_0xc4f716[_0x55ab('0xf')](request('Command',{'command':util[_0x55ab('0x10')](_0x55ab('0x11'),_0x2ed19f[_0x3e3edc])})['then'](function(_0x58fbda){return _0x58fbda&&_0x58fbda[_0x55ab('0x8')]&&_0x58fbda[_0x55ab('0x8')][_0x55ab('0x12')](_0x55ab('0x13'))>=0x0?!![]:![];})[_0x55ab('0x14')](function(_0x3cdf27){logger[_0x55ab('0x7')](_0x55ab('0x15'),_0x17b9ff,_0x2ed19f[_0x3e3edc]);}));}BPromise[_0x55ab('0x16')](_0xc4f716)[_0x55ab('0x6')](function(_0x345022){var _0x291cba=_[_0x55ab('0x17')](_0x345022);logger[_0x55ab('0xb')](_0x55ab('0x18'),_0x17b9ff,_0x2ed19f['join'](_0x55ab('0x19')),_0x291cba);_0x4ed1af[_0x55ab('0x1a')](_0x291cba);})[_0x55ab('0x14')](function(_0x5e4c31){console[_0x55ab('0x1b')](_0x5e4c31);logger[_0x55ab('0x7')](_0x55ab('0x18'),_0x17b9ff,_0x2ed19f[_0x55ab('0x1c')](_0x55ab('0x19')),_0x5e4c31['stack']);_0x4ed1af[_0x55ab('0xd')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index dec6ce3..3d46b8c 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 _0xeb40=['answeredelsewheredestinationuniqueid','answeredelsewheremembername','membername','agentcompleteAt','blindtransfer','transfereruniqueid','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','transfereeuniqueid','clone','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','agententerreason','hangup','diffTime','agent','complete','lodash','./utils','info','format','channel','queue','interface','calleridnum','connectedlinenum','getVoiceQueueByName','then','type','agentacw','agentcomplete','acwtime','request','CreateVoiceAgentReport','uniqueid','destuniqueid','agentcalledAt','lastevent','called','connectedlinename','error','agentringnoanswer','isNil','agentringnoanswerAt','now','reason','holdtime','ringtime','stack','queuecallerabandon','forIn','abandoned','talktime','agentconnect','agentconnectAt','connect','answered_elsewhere'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xeb40,0x176));var _0x0eb4=function(_0x1c8c28,_0x3ee093){_0x1c8c28=_0x1c8c28-0x0;var _0x1f59b4=_0xeb40[_0x1c8c28];return _0x1f59b4;};'use strict';var _=require(_0x0eb4('0x0'));var util=require('util');var utils=require(_0x0eb4('0x1'));var agents={};var transfers={};function writeDB(_0x115ba8,_0x61c8ae){utils[_0x0eb4('0x2')](util[_0x0eb4('0x3')]('AGENT|%s|%s|%s|%s|%s|%s|%s|%s',_0x115ba8['uniqueid'],_0x115ba8[_0x0eb4('0x4')],_0x115ba8[_0x0eb4('0x5')],_0x115ba8['membername'],_0x115ba8[_0x0eb4('0x6')],_0x115ba8[_0x0eb4('0x7')],_0x115ba8[_0x0eb4('0x8')],_0x115ba8['lastevent']));if(_0x115ba8[_0x0eb4('0x5')]){utils[_0x0eb4('0x9')](_0x115ba8[_0x0eb4('0x5')])[_0x0eb4('0xa')](function(_0x2e16ee){if(_0x2e16ee){_0x115ba8['type']=_0x2e16ee[_0x0eb4('0xb')];_0x115ba8[_0x0eb4('0xc')]=_0x115ba8[_0x0eb4('0xd')]?_0x2e16ee['acw']:![];_0x115ba8[_0x0eb4('0xe')]=_0x115ba8[_0x0eb4('0xc')]?_0x2e16ee['acwTimeout']:0x0;}utils['request']('CreateVoiceAgentReport',_0x115ba8);});}else{utils[_0x0eb4('0xf')](_0x0eb4('0x10'),_0x115ba8);}if(_0x61c8ae){delete transfers[_0x115ba8[_0x0eb4('0x11')]];}else{delete agents[_0x115ba8[_0x0eb4('0x12')]];}}exports['agentcalled']=function(_0x5b8895){try{agents[_0x5b8895['destuniqueid']]=_0x5b8895;agents[_0x5b8895['destuniqueid']][_0x0eb4('0x13')]=utils['now']();agents[_0x5b8895[_0x0eb4('0x12')]][_0x0eb4('0x14')]=_0x0eb4('0x15');agents[_0x5b8895[_0x0eb4('0x12')]][_0x0eb4('0x8')]=null;agents[_0x5b8895[_0x0eb4('0x12')]][_0x0eb4('0x16')]=null;}catch(_0x3bfdb7){utils[_0x0eb4('0x17')](_0x3bfdb7['stack']);}};exports[_0x0eb4('0x18')]=function(_0x2d879d){try{if(!_[_0x0eb4('0x19')](agents[_0x2d879d[_0x0eb4('0x12')]])){agents[_0x2d879d[_0x0eb4('0x12')]][_0x0eb4('0x18')]=!![];agents[_0x2d879d['destuniqueid']][_0x0eb4('0x1a')]=utils[_0x0eb4('0x1b')]();agents[_0x2d879d[_0x0eb4('0x12')]]['lastevent']='rejected';agents[_0x2d879d[_0x0eb4('0x12')]][_0x0eb4('0x1c')]='rejected';agents[_0x2d879d[_0x0eb4('0x12')]][_0x0eb4('0x1d')]=_0x2d879d[_0x0eb4('0x1e')]?parseInt(_0x2d879d['ringtime'])/0x3e8:0x0;agents[_0x2d879d[_0x0eb4('0x12')]]['talktime']=0x0;writeDB(agents[_0x2d879d[_0x0eb4('0x12')]]);}}catch(_0x50ce44){utils[_0x0eb4('0x17')](_0x50ce44[_0x0eb4('0x1f')]);}};exports[_0x0eb4('0x20')]=function(_0x5c67f3){try{_[_0x0eb4('0x21')](agents,function(_0x102b3b,_0x11f699){if(_0x102b3b[_0x0eb4('0x11')]==_0x5c67f3[_0x0eb4('0x11')]){_0x102b3b[_0x0eb4('0x18')]=!![];_0x102b3b[_0x0eb4('0x1a')]=utils[_0x0eb4('0x1b')]();_0x102b3b[_0x0eb4('0x14')]='abandoned';_0x102b3b['reason']=_0x0eb4('0x22');_0x102b3b[_0x0eb4('0x1d')]=_0x5c67f3[_0x0eb4('0x1d')];_0x102b3b[_0x0eb4('0x23')]=0x0;writeDB(_0x102b3b);}});}catch(_0x2f1bf2){utils[_0x0eb4('0x17')](_0x2f1bf2['stack']);}};exports[_0x0eb4('0x24')]=function(_0x4480f2){try{if(agents[_0x4480f2['destuniqueid']]){agents[_0x4480f2['destuniqueid']][_0x0eb4('0x25')]=utils[_0x0eb4('0x1b')]();agents[_0x4480f2[_0x0eb4('0x12')]][_0x0eb4('0x8')]=_0x4480f2[_0x0eb4('0x8')];agents[_0x4480f2['destuniqueid']]['connectedlinename']=_0x4480f2[_0x0eb4('0x16')];agents[_0x4480f2[_0x0eb4('0x12')]][_0x0eb4('0x1d')]=_0x4480f2[_0x0eb4('0x1e')];agents[_0x4480f2['destuniqueid']][_0x0eb4('0x14')]=_0x0eb4('0x26');_[_0x0eb4('0x21')](agents,function(_0x44cad8,_0x47f624){if(_0x44cad8[_0x0eb4('0x12')]!=_0x4480f2['destuniqueid']&&_0x44cad8[_0x0eb4('0x11')]==_0x4480f2[_0x0eb4('0x11')]){_0x44cad8[_0x0eb4('0x23')]=0x0;_0x44cad8[_0x0eb4('0x1d')]=_0x4480f2[_0x0eb4('0x1e')];_0x44cad8[_0x0eb4('0x18')]=!![];_0x44cad8[_0x0eb4('0x1a')]=utils[_0x0eb4('0x1b')]();_0x44cad8[_0x0eb4('0x14')]='answered_elsewhere';_0x44cad8[_0x0eb4('0x1c')]=_0x0eb4('0x27');_0x44cad8[_0x0eb4('0x28')]=_0x4480f2[_0x0eb4('0x12')];_0x44cad8[_0x0eb4('0x29')]=_0x4480f2[_0x0eb4('0x2a')];writeDB(_0x44cad8);}});}}catch(_0x2009d4){utils['error'](_0x2009d4['stack']);}};exports[_0x0eb4('0xd')]=function(_0x3a0cba){try{if(!_[_0x0eb4('0x19')](agents[_0x3a0cba[_0x0eb4('0x12')]])){agents[_0x3a0cba['destuniqueid']][_0x0eb4('0xd')]=!![];agents[_0x3a0cba['destuniqueid']][_0x0eb4('0x2b')]=utils[_0x0eb4('0x1b')]();agents[_0x3a0cba[_0x0eb4('0x12')]][_0x0eb4('0x23')]=utils['diffTime'](agents[_0x3a0cba[_0x0eb4('0x12')]][_0x0eb4('0x2b')],agents[_0x3a0cba[_0x0eb4('0x12')]][_0x0eb4('0x25')]);agents[_0x3a0cba[_0x0eb4('0x12')]][_0x0eb4('0x1c')]=_0x3a0cba[_0x0eb4('0x1c')];agents[_0x3a0cba[_0x0eb4('0x12')]]['lastevent']='complete';writeDB(agents[_0x3a0cba['destuniqueid']]);}}catch(_0x12e981){utils[_0x0eb4('0x17')](_0x12e981[_0x0eb4('0x1f')]);}};exports[_0x0eb4('0x2c')]=function(_0x43e08b){try{if(!_['isNil'](agents[_0x43e08b[_0x0eb4('0x2d')]])){agents[_0x43e08b['transfereruniqueid']]['transfer']=!![];agents[_0x43e08b[_0x0eb4('0x2d')]][_0x0eb4('0x2e')]=_0x0eb4('0x2f');agents[_0x43e08b[_0x0eb4('0x2d')]][_0x0eb4('0x30')]=_0x43e08b[_0x0eb4('0x31')];agents[_0x43e08b[_0x0eb4('0x2d')]][_0x0eb4('0x32')]=agents[_0x43e08b[_0x0eb4('0x2d')]][_0x0eb4('0x11')];}}catch(_0xf79071){utils[_0x0eb4('0x17')](_0xf79071[_0x0eb4('0x1f')]);}};exports[_0x0eb4('0x33')]=function(_0x1e1066){try{if(_0x1e1066[_0x0eb4('0x34')]==_0x1e1066[_0x0eb4('0x35')]){if(!_[_0x0eb4('0x19')](agents[_0x1e1066[_0x0eb4('0x36')]])){agents[_0x1e1066[_0x0eb4('0x36')]][_0x0eb4('0x37')]=!![];agents[_0x1e1066[_0x0eb4('0x36')]]['transfertype']=_0x0eb4('0x38');agents[_0x1e1066['secondtransfereruniqueid']][_0x0eb4('0x30')]=_0x1e1066[_0x0eb4('0x39')];agents[_0x1e1066['secondtransfereruniqueid']]['transferuniqueid']=_0x1e1066[_0x0eb4('0x34')];}if(_0x1e1066[_0x0eb4('0x3a')]&&agents[_0x1e1066[_0x0eb4('0x3a')]]){agents[_0x1e1066['transfereeuniqueid']]['agententerreason']=0x1;transfers[_0x1e1066[_0x0eb4('0x3a')]]=_[_0x0eb4('0x3b')](agents[_0x1e1066[_0x0eb4('0x3a')]]);transfers[_0x1e1066['transfereeuniqueid']][_0x0eb4('0x7')]=agents[_0x1e1066[_0x0eb4('0x36')]][_0x0eb4('0x7')];transfers[_0x1e1066[_0x0eb4('0x3a')]][_0x0eb4('0x3c')]=agents[_0x1e1066['secondtransfereruniqueid']]['calleridname'];transfers[_0x1e1066[_0x0eb4('0x3a')]]['agentcalledAt']=utils[_0x0eb4('0x1b')]();transfers[_0x1e1066['transfereeuniqueid']][_0x0eb4('0x25')]=utils[_0x0eb4('0x1b')]();transfers[_0x1e1066[_0x0eb4('0x3a')]][_0x0eb4('0x1d')]=0x0;transfers[_0x1e1066[_0x0eb4('0x3a')]]['agententerreason']=0x2;}}else if(_0x1e1066[_0x0eb4('0x36')]==_0x1e1066[_0x0eb4('0x3d')]){if(!_[_0x0eb4('0x19')](agents[_0x1e1066[_0x0eb4('0x34')]])){agents[_0x1e1066[_0x0eb4('0x34')]][_0x0eb4('0x37')]=!![];agents[_0x1e1066[_0x0eb4('0x34')]][_0x0eb4('0x2e')]=_0x0eb4('0x38');agents[_0x1e1066[_0x0eb4('0x34')]][_0x0eb4('0x30')]=_0x1e1066[_0x0eb4('0x3e')];agents[_0x1e1066[_0x0eb4('0x34')]][_0x0eb4('0x32')]=_0x1e1066['secondtransfereruniqueid'];}if(_0x1e1066[_0x0eb4('0x3f')]&&agents[_0x1e1066[_0x0eb4('0x3f')]]){agents[_0x1e1066[_0x0eb4('0x3f')]][_0x0eb4('0x40')]=0x1;transfers[_0x1e1066[_0x0eb4('0x3f')]]=_[_0x0eb4('0x3b')](agents[_0x1e1066[_0x0eb4('0x3f')]]);transfers[_0x1e1066[_0x0eb4('0x3f')]][_0x0eb4('0x7')]=agents[_0x1e1066[_0x0eb4('0x34')]][_0x0eb4('0x7')];transfers[_0x1e1066[_0x0eb4('0x3f')]]['calleridname']=agents[_0x1e1066[_0x0eb4('0x34')]][_0x0eb4('0x3c')];transfers[_0x1e1066[_0x0eb4('0x3f')]]['agentcalledAt']=utils[_0x0eb4('0x1b')]();transfers[_0x1e1066[_0x0eb4('0x3f')]][_0x0eb4('0x25')]=utils[_0x0eb4('0x1b')]();transfers[_0x1e1066['transfertargetuniqueid']][_0x0eb4('0x1d')]=0x0;transfers[_0x1e1066[_0x0eb4('0x3f')]][_0x0eb4('0x40')]=0x2;}}}catch(_0x17fc59){utils[_0x0eb4('0x17')](_0x17fc59[_0x0eb4('0x1f')]);}};exports[_0x0eb4('0x41')]=function(_0x371992){try{if(transfers[_0x371992[_0x0eb4('0x11')]]){transfers[_0x371992[_0x0eb4('0x11')]][_0x0eb4('0xd')]=!![];transfers[_0x371992[_0x0eb4('0x11')]][_0x0eb4('0x2b')]=utils[_0x0eb4('0x1b')]();transfers[_0x371992['uniqueid']][_0x0eb4('0x23')]=utils[_0x0eb4('0x42')](transfers[_0x371992[_0x0eb4('0x11')]][_0x0eb4('0x2b')],transfers[_0x371992[_0x0eb4('0x11')]][_0x0eb4('0x25')]);transfers[_0x371992[_0x0eb4('0x11')]][_0x0eb4('0x1c')]=_0x0eb4('0x43');transfers[_0x371992['uniqueid']][_0x0eb4('0x14')]=_0x0eb4('0x44');writeDB(transfers[_0x371992[_0x0eb4('0x11')]],!![]);}if(agents[_0x371992[_0x0eb4('0x11')]]&&agents[_0x371992[_0x0eb4('0x11')]][_0x0eb4('0x25')]){agents[_0x371992[_0x0eb4('0x11')]][_0x0eb4('0xd')]=!![];agents[_0x371992[_0x0eb4('0x11')]]['agentcompleteAt']=utils[_0x0eb4('0x1b')]();agents[_0x371992['uniqueid']]['talktime']=utils[_0x0eb4('0x42')](agents[_0x371992['uniqueid']][_0x0eb4('0x2b')],agents[_0x371992[_0x0eb4('0x11')]]['agentconnectAt']);agents[_0x371992[_0x0eb4('0x11')]]['reason']=agents[_0x371992['uniqueid']][_0x0eb4('0x37')]?'transfer':_0x0eb4('0x43');agents[_0x371992['uniqueid']][_0x0eb4('0x14')]='complete';writeDB(agents[_0x371992[_0x0eb4('0x11')]]);}}catch(_0x434468){utils[_0x0eb4('0x17')](_0x434468['stack']);}}; \ No newline at end of file +var _0xa5a2=['agentconnect','agentconnectAt','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','membername','agentcompleteAt','diffTime','complete','transfereruniqueid','transfer','transfertype','blind','transferexten','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererlinkedid','ATTENDED','transfertargetuniqueid','agent','lodash','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','interface','calleridnum','connectedlinenum','lastevent','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','acwTimeout','CreateVoiceAgentReport','request','destuniqueid','agentcalledAt','now','called','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','rejected','reason','ringtime','talktime','forIn','abandoned','holdtime'];(function(_0x1ef915,_0x55c5e2){var _0x2247fb=function(_0x32063e){while(--_0x32063e){_0x1ef915['push'](_0x1ef915['shift']());}};_0x2247fb(++_0x55c5e2);}(_0xa5a2,0x12d));var _0x2a5a=function(_0x2f3f6b,_0x516149){_0x2f3f6b=_0x2f3f6b-0x0;var _0x1a8b13=_0xa5a2[_0x2f3f6b];return _0x1a8b13;};'use strict';var _=require(_0x2a5a('0x0'));var util=require('util');var utils=require(_0x2a5a('0x1'));var agents={};var transfers={};function writeDB(_0x55a9bb,_0x4e75df){utils[_0x2a5a('0x2')](util[_0x2a5a('0x3')](_0x2a5a('0x4'),_0x55a9bb[_0x2a5a('0x5')],_0x55a9bb[_0x2a5a('0x6')],_0x55a9bb[_0x2a5a('0x7')],_0x55a9bb['membername'],_0x55a9bb[_0x2a5a('0x8')],_0x55a9bb[_0x2a5a('0x9')],_0x55a9bb[_0x2a5a('0xa')],_0x55a9bb[_0x2a5a('0xb')]));if(_0x55a9bb[_0x2a5a('0x7')]){utils[_0x2a5a('0xc')](_0x55a9bb[_0x2a5a('0x7')])[_0x2a5a('0xd')](function(_0xe71d68){if(_0xe71d68){_0x55a9bb[_0x2a5a('0xe')]=_0xe71d68[_0x2a5a('0xe')];_0x55a9bb[_0x2a5a('0xf')]=_0x55a9bb[_0x2a5a('0x10')]?_0xe71d68[_0x2a5a('0x11')]:![];_0x55a9bb[_0x2a5a('0x12')]=_0x55a9bb[_0x2a5a('0xf')]?_0xe71d68[_0x2a5a('0x13')]:0x0;}utils['request'](_0x2a5a('0x14'),_0x55a9bb);});}else{utils[_0x2a5a('0x15')]('CreateVoiceAgentReport',_0x55a9bb);}if(_0x4e75df){delete transfers[_0x55a9bb[_0x2a5a('0x5')]];}else{delete agents[_0x55a9bb[_0x2a5a('0x16')]];}}exports['agentcalled']=function(_0x210039){try{agents[_0x210039[_0x2a5a('0x16')]]=_0x210039;agents[_0x210039[_0x2a5a('0x16')]][_0x2a5a('0x17')]=utils[_0x2a5a('0x18')]();agents[_0x210039['destuniqueid']][_0x2a5a('0xb')]=_0x2a5a('0x19');agents[_0x210039[_0x2a5a('0x16')]][_0x2a5a('0xa')]=null;agents[_0x210039['destuniqueid']][_0x2a5a('0x1a')]=null;}catch(_0x16fffc){utils[_0x2a5a('0x1b')](_0x16fffc[_0x2a5a('0x1c')]);}};exports[_0x2a5a('0x1d')]=function(_0x36c93c){try{if(!_[_0x2a5a('0x1e')](agents[_0x36c93c[_0x2a5a('0x16')]])){agents[_0x36c93c[_0x2a5a('0x16')]][_0x2a5a('0x1d')]=!![];agents[_0x36c93c['destuniqueid']][_0x2a5a('0x1f')]=utils[_0x2a5a('0x18')]();agents[_0x36c93c[_0x2a5a('0x16')]][_0x2a5a('0xb')]=_0x2a5a('0x20');agents[_0x36c93c[_0x2a5a('0x16')]][_0x2a5a('0x21')]=_0x2a5a('0x20');agents[_0x36c93c[_0x2a5a('0x16')]]['holdtime']=_0x36c93c[_0x2a5a('0x22')]?parseInt(_0x36c93c[_0x2a5a('0x22')])/0x3e8:0x0;agents[_0x36c93c['destuniqueid']][_0x2a5a('0x23')]=0x0;writeDB(agents[_0x36c93c['destuniqueid']]);}}catch(_0x3c5d44){utils[_0x2a5a('0x1b')](_0x3c5d44[_0x2a5a('0x1c')]);}};exports['queuecallerabandon']=function(_0x31cf1b){try{_[_0x2a5a('0x24')](agents,function(_0x301985,_0x3c7170){if(_0x301985[_0x2a5a('0x5')]==_0x31cf1b[_0x2a5a('0x5')]){_0x301985[_0x2a5a('0x1d')]=!![];_0x301985[_0x2a5a('0x1f')]=utils[_0x2a5a('0x18')]();_0x301985[_0x2a5a('0xb')]=_0x2a5a('0x25');_0x301985[_0x2a5a('0x21')]='abandoned';_0x301985[_0x2a5a('0x26')]=_0x31cf1b[_0x2a5a('0x26')];_0x301985[_0x2a5a('0x23')]=0x0;writeDB(_0x301985);}});}catch(_0x25b001){utils[_0x2a5a('0x1b')](_0x25b001[_0x2a5a('0x1c')]);}};exports[_0x2a5a('0x27')]=function(_0x29b474){try{if(agents[_0x29b474[_0x2a5a('0x16')]]){agents[_0x29b474['destuniqueid']][_0x2a5a('0x28')]=utils[_0x2a5a('0x18')]();agents[_0x29b474[_0x2a5a('0x16')]][_0x2a5a('0xa')]=_0x29b474[_0x2a5a('0xa')];agents[_0x29b474[_0x2a5a('0x16')]][_0x2a5a('0x1a')]=_0x29b474[_0x2a5a('0x1a')];agents[_0x29b474[_0x2a5a('0x16')]][_0x2a5a('0x26')]=_0x29b474[_0x2a5a('0x22')];agents[_0x29b474[_0x2a5a('0x16')]]['lastevent']=_0x2a5a('0x29');_['forIn'](agents,function(_0x5972a3,_0x5c54cd){if(_0x5972a3[_0x2a5a('0x16')]!=_0x29b474['destuniqueid']&&_0x5972a3[_0x2a5a('0x5')]==_0x29b474['uniqueid']){_0x5972a3['talktime']=0x0;_0x5972a3[_0x2a5a('0x26')]=_0x29b474[_0x2a5a('0x22')];_0x5972a3[_0x2a5a('0x1d')]=!![];_0x5972a3['agentringnoanswerAt']=utils[_0x2a5a('0x18')]();_0x5972a3[_0x2a5a('0xb')]=_0x2a5a('0x2a');_0x5972a3[_0x2a5a('0x21')]=_0x2a5a('0x2a');_0x5972a3[_0x2a5a('0x2b')]=_0x29b474[_0x2a5a('0x16')];_0x5972a3[_0x2a5a('0x2c')]=_0x29b474[_0x2a5a('0x2d')];writeDB(_0x5972a3);}});}}catch(_0x417be8){utils['error'](_0x417be8['stack']);}};exports['agentcomplete']=function(_0x3b49b5){try{if(!_['isNil'](agents[_0x3b49b5[_0x2a5a('0x16')]])){agents[_0x3b49b5[_0x2a5a('0x16')]][_0x2a5a('0x10')]=!![];agents[_0x3b49b5[_0x2a5a('0x16')]][_0x2a5a('0x2e')]=utils[_0x2a5a('0x18')]();agents[_0x3b49b5[_0x2a5a('0x16')]][_0x2a5a('0x23')]=utils[_0x2a5a('0x2f')](agents[_0x3b49b5[_0x2a5a('0x16')]]['agentcompleteAt'],agents[_0x3b49b5[_0x2a5a('0x16')]]['agentconnectAt']);agents[_0x3b49b5[_0x2a5a('0x16')]][_0x2a5a('0x21')]=_0x3b49b5[_0x2a5a('0x21')];agents[_0x3b49b5[_0x2a5a('0x16')]][_0x2a5a('0xb')]=_0x2a5a('0x30');writeDB(agents[_0x3b49b5[_0x2a5a('0x16')]]);}}catch(_0x4ba58a){utils[_0x2a5a('0x1b')](_0x4ba58a[_0x2a5a('0x1c')]);}};exports['blindtransfer']=function(_0x33b6e1){try{if(!_[_0x2a5a('0x1e')](agents[_0x33b6e1[_0x2a5a('0x31')]])){agents[_0x33b6e1[_0x2a5a('0x31')]][_0x2a5a('0x32')]=!![];agents[_0x33b6e1[_0x2a5a('0x31')]][_0x2a5a('0x33')]=_0x2a5a('0x34');agents[_0x33b6e1[_0x2a5a('0x31')]][_0x2a5a('0x35')]=_0x33b6e1['extension'];agents[_0x33b6e1[_0x2a5a('0x31')]][_0x2a5a('0x36')]=agents[_0x33b6e1[_0x2a5a('0x31')]][_0x2a5a('0x5')];}}catch(_0xc71eb6){utils['error'](_0xc71eb6[_0x2a5a('0x1c')]);}};exports[_0x2a5a('0x37')]=function(_0x30aa4a){try{if(_0x30aa4a[_0x2a5a('0x38')]==_0x30aa4a[_0x2a5a('0x39')]){if(!_[_0x2a5a('0x1e')](agents[_0x30aa4a[_0x2a5a('0x3a')]])){agents[_0x30aa4a[_0x2a5a('0x3a')]][_0x2a5a('0x32')]=!![];agents[_0x30aa4a[_0x2a5a('0x3a')]][_0x2a5a('0x33')]='ATTENDED';agents[_0x30aa4a[_0x2a5a('0x3a')]]['transferexten']=_0x30aa4a[_0x2a5a('0x3b')];agents[_0x30aa4a[_0x2a5a('0x3a')]]['transferuniqueid']=_0x30aa4a[_0x2a5a('0x38')];}if(_0x30aa4a[_0x2a5a('0x3c')]&&agents[_0x30aa4a[_0x2a5a('0x3c')]]){agents[_0x30aa4a[_0x2a5a('0x3c')]][_0x2a5a('0x3d')]=0x1;transfers[_0x30aa4a[_0x2a5a('0x3c')]]=_[_0x2a5a('0x3e')](agents[_0x30aa4a['transfereeuniqueid']]);transfers[_0x30aa4a[_0x2a5a('0x3c')]][_0x2a5a('0x9')]=agents[_0x30aa4a[_0x2a5a('0x3a')]][_0x2a5a('0x9')];transfers[_0x30aa4a[_0x2a5a('0x3c')]][_0x2a5a('0x3f')]=agents[_0x30aa4a['secondtransfereruniqueid']][_0x2a5a('0x3f')];transfers[_0x30aa4a['transfereeuniqueid']][_0x2a5a('0x17')]=utils[_0x2a5a('0x18')]();transfers[_0x30aa4a['transfereeuniqueid']]['agentconnectAt']=utils[_0x2a5a('0x18')]();transfers[_0x30aa4a[_0x2a5a('0x3c')]][_0x2a5a('0x26')]=0x0;transfers[_0x30aa4a[_0x2a5a('0x3c')]][_0x2a5a('0x3d')]=0x2;}}else if(_0x30aa4a[_0x2a5a('0x3a')]==_0x30aa4a[_0x2a5a('0x40')]){if(!_[_0x2a5a('0x1e')](agents[_0x30aa4a['origtransfereruniqueid']])){agents[_0x30aa4a[_0x2a5a('0x38')]][_0x2a5a('0x32')]=!![];agents[_0x30aa4a[_0x2a5a('0x38')]][_0x2a5a('0x33')]=_0x2a5a('0x41');agents[_0x30aa4a[_0x2a5a('0x38')]][_0x2a5a('0x35')]=_0x30aa4a['secondtransfererexten'];agents[_0x30aa4a[_0x2a5a('0x38')]]['transferuniqueid']=_0x30aa4a[_0x2a5a('0x3a')];}if(_0x30aa4a['transfertargetuniqueid']&&agents[_0x30aa4a[_0x2a5a('0x42')]]){agents[_0x30aa4a[_0x2a5a('0x42')]][_0x2a5a('0x3d')]=0x1;transfers[_0x30aa4a[_0x2a5a('0x42')]]=_[_0x2a5a('0x3e')](agents[_0x30aa4a[_0x2a5a('0x42')]]);transfers[_0x30aa4a[_0x2a5a('0x42')]][_0x2a5a('0x9')]=agents[_0x30aa4a['origtransfereruniqueid']][_0x2a5a('0x9')];transfers[_0x30aa4a[_0x2a5a('0x42')]][_0x2a5a('0x3f')]=agents[_0x30aa4a['origtransfereruniqueid']][_0x2a5a('0x3f')];transfers[_0x30aa4a[_0x2a5a('0x42')]][_0x2a5a('0x17')]=utils[_0x2a5a('0x18')]();transfers[_0x30aa4a[_0x2a5a('0x42')]][_0x2a5a('0x28')]=utils['now']();transfers[_0x30aa4a[_0x2a5a('0x42')]][_0x2a5a('0x26')]=0x0;transfers[_0x30aa4a[_0x2a5a('0x42')]][_0x2a5a('0x3d')]=0x2;}}}catch(_0xdc5297){utils[_0x2a5a('0x1b')](_0xdc5297['stack']);}};exports['hangup']=function(_0x104208){try{if(transfers[_0x104208[_0x2a5a('0x5')]]){transfers[_0x104208[_0x2a5a('0x5')]][_0x2a5a('0x10')]=!![];transfers[_0x104208[_0x2a5a('0x5')]][_0x2a5a('0x2e')]=utils[_0x2a5a('0x18')]();transfers[_0x104208[_0x2a5a('0x5')]]['talktime']=utils[_0x2a5a('0x2f')](transfers[_0x104208[_0x2a5a('0x5')]][_0x2a5a('0x2e')],transfers[_0x104208['uniqueid']]['agentconnectAt']);transfers[_0x104208[_0x2a5a('0x5')]]['reason']=_0x2a5a('0x43');transfers[_0x104208[_0x2a5a('0x5')]][_0x2a5a('0xb')]='complete';writeDB(transfers[_0x104208[_0x2a5a('0x5')]],!![]);}if(agents[_0x104208[_0x2a5a('0x5')]]&&agents[_0x104208[_0x2a5a('0x5')]]['agentconnectAt']){agents[_0x104208[_0x2a5a('0x5')]][_0x2a5a('0x10')]=!![];agents[_0x104208['uniqueid']]['agentcompleteAt']=utils['now']();agents[_0x104208[_0x2a5a('0x5')]][_0x2a5a('0x23')]=utils['diffTime'](agents[_0x104208['uniqueid']][_0x2a5a('0x2e')],agents[_0x104208['uniqueid']][_0x2a5a('0x28')]);agents[_0x104208[_0x2a5a('0x5')]][_0x2a5a('0x21')]=agents[_0x104208[_0x2a5a('0x5')]]['transfer']?'transfer':'agent';agents[_0x104208[_0x2a5a('0x5')]][_0x2a5a('0xb')]=_0x2a5a('0x30');writeDB(agents[_0x104208[_0x2a5a('0x5')]]);}}catch(_0x39570f){utils[_0x2a5a('0x1b')](_0x39570f[_0x2a5a('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 63f5b29..70853ad 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 _0x8dbb=['userfield','_attended','transfertargetchannel','origtransfererchannel','stack','musiconholdstartAt','mohtime','varset','variable','value','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','ContactId','xmd-cdrtype','type','outboundrouteid','routeid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','gotoif','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','destination','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','DOCUMENTATION','error','channelstate','isNil','systemanswertime','now','transfer','answertime','hangup','calleridname','endtime','duration','diffTime','billableseconds','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel'];(function(_0x3ccbd0,_0x67ac5){var _0x499b63=function(_0x3f7e25){while(--_0x3f7e25){_0x3ccbd0['push'](_0x3ccbd0['shift']());}};_0x499b63(++_0x67ac5);}(_0x8dbb,0x164));var _0xb8db=function(_0xd7999f,_0x5a250c){_0xd7999f=_0xd7999f-0x0;var _0x22d24d=_0x8dbb[_0xd7999f];return _0x22d24d;};'use strict';var _=require('lodash');var util=require(_0xb8db('0x0'));var utils=require(_0xb8db('0x1'));var dispositions=[_0xb8db('0x2'),_0xb8db('0x3'),_0xb8db('0x3'),_0xb8db('0x2'),_0xb8db('0x2'),_0xb8db('0x2'),_0xb8db('0x4'),'BUSY',_0xb8db('0x3'),'FAILED','FAILED'];var channels={};function writeDB(_0x2e1a5a){utils[_0xb8db('0x5')](util[_0xb8db('0x6')](_0xb8db('0x7'),_0x2e1a5a[_0xb8db('0x8')],_0x2e1a5a[_0xb8db('0x9')],_0x2e1a5a['type'],_0x2e1a5a[_0xb8db('0xa')],_0x2e1a5a[_0xb8db('0xb')],_0x2e1a5a[_0xb8db('0xc')],_0x2e1a5a[_0xb8db('0xd')],_0x2e1a5a[_0xb8db('0xe')]));if(_0x2e1a5a[_0xb8db('0xa')]){utils[_0xb8db('0xf')](_0x2e1a5a[_0xb8db('0xa')])[_0xb8db('0x10')](function(_0x5ef1fb){if(_0x5ef1fb){_0x2e1a5a[_0xb8db('0x11')]=_0x5ef1fb['id'];}utils[_0xb8db('0x12')](_0xb8db('0x13'),_0x2e1a5a);});}else{utils['request'](_0xb8db('0x13'),_0x2e1a5a);}if(channels[_0x2e1a5a[_0xb8db('0x8')]]){delete channels[_0x2e1a5a[_0xb8db('0x8')]];}}exports[_0xb8db('0x14')]=function(_0x35e16c){try{if(_0x35e16c[_0xb8db('0x8')]==_0x35e16c[_0xb8db('0x15')]&&_0x35e16c['channel']!=_0xb8db('0x16')){channels[_0x35e16c['uniqueid']]={'uniqueid':_0x35e16c[_0xb8db('0x8')],'accountcode':_0x35e16c['accountcode'],'source':_0x35e16c[_0xb8db('0x17')],'destination':_0x35e16c[_0xb8db('0x18')],'destinationcontext':_0x35e16c[_0xb8db('0x19')],'channel':_0x35e16c[_0xb8db('0x9')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0xb8db('0x2'),'amaflags':_0xb8db('0x1a')};}}catch(_0x330ac3){utils[_0xb8db('0x1b')](_0x330ac3['stack']);}};exports['newstate']=function(_0x377dfa){try{if(!_['isNil'](channels[_0x377dfa[_0xb8db('0x8')]])&&_0x377dfa[_0xb8db('0x1c')]==0x6){if(_[_0xb8db('0x1d')](channels[_0x377dfa[_0xb8db('0x8')]]['systemanswertime'])){channels[_0x377dfa[_0xb8db('0x8')]][_0xb8db('0x1e')]=utils[_0xb8db('0x1f')]();}}else if(!_[_0xb8db('0x1d')](channels[_0x377dfa[_0xb8db('0x15')]])&&_0x377dfa[_0xb8db('0x1c')]==0x6&&_0x377dfa[_0xb8db('0x19')]!=_0xb8db('0x20')){channels[_0x377dfa[_0xb8db('0x15')]][_0xb8db('0xa')]=_0x377dfa[_0xb8db('0xa')];channels[_0x377dfa[_0xb8db('0x15')]]['destinationchannel']=_0x377dfa[_0xb8db('0x9')];if(_['isNil'](channels[_0x377dfa[_0xb8db('0x15')]][_0xb8db('0x21')])){channels[_0x377dfa[_0xb8db('0x15')]][_0xb8db('0x21')]=utils[_0xb8db('0x1f')]();}channels[_0x377dfa[_0xb8db('0x15')]][_0xb8db('0xe')]=dispositions[_['toNumber'](_0x377dfa[_0xb8db('0x1c')])]||'ANSWERED';}}catch(_0x41ecc1){utils[_0xb8db('0x1b')](_0x41ecc1['stack']);}};exports[_0xb8db('0x22')]=function(_0x45b419){try{if(!_['isNil'](channels[_0x45b419[_0xb8db('0x8')]])){if(_[_0xb8db('0x1d')](channels[_0x45b419['uniqueid']]['callerid'])){channels[_0x45b419[_0xb8db('0x8')]]['callerid']=_0x45b419[_0xb8db('0x23')]+'\x20<'+_0x45b419[_0xb8db('0x17')]+'>';}channels[_0x45b419[_0xb8db('0x8')]][_0xb8db('0x24')]=utils['now']();channels[_0x45b419['uniqueid']][_0xb8db('0x25')]=utils[_0xb8db('0x26')](channels[_0x45b419[_0xb8db('0x8')]][_0xb8db('0x24')],channels[_0x45b419[_0xb8db('0x8')]]['starttime']);channels[_0x45b419[_0xb8db('0x8')]][_0xb8db('0x27')]=channels[_0x45b419['uniqueid']]['answertime']?utils[_0xb8db('0x26')](channels[_0x45b419[_0xb8db('0x8')]][_0xb8db('0x24')],channels[_0x45b419[_0xb8db('0x8')]][_0xb8db('0x21')]):0x0;writeDB(channels[_0x45b419['uniqueid']]);}}catch(_0x4f11c5){utils[_0xb8db('0x1b')](_0x4f11c5['stack']);}};exports['attendedtransfer']=function(_0x33d3b3){try{if(!_[_0xb8db('0x1d')](channels[_0x33d3b3[_0xb8db('0x28')]])){if(channels[_0x33d3b3[_0xb8db('0x28')]][_0xb8db('0x9')]==_0x33d3b3[_0xb8db('0x29')]){channels[_0x33d3b3[_0xb8db('0x28')]][_0xb8db('0x2a')]=_0x33d3b3[_0xb8db('0x2b')];channels[_0x33d3b3[_0xb8db('0x28')]][_0xb8db('0x2c')]=_0xb8db('0x2d');}else if(channels[_0x33d3b3['localtwolinkedid']][_0xb8db('0x9')]=_0x33d3b3[_0xb8db('0x2e')]){channels[_0x33d3b3[_0xb8db('0x28')]][_0xb8db('0x2a')]=_0x33d3b3[_0xb8db('0x2f')];channels[_0x33d3b3[_0xb8db('0x28')]][_0xb8db('0x2c')]=_0xb8db('0x2d');}}}catch(_0x1c7845){utils['error'](_0x1c7845[_0xb8db('0x30')]);}};exports['musiconholdstart']=function(_0x5701d3){try{if(!_[_0xb8db('0x1d')](channels[_0x5701d3[_0xb8db('0x8')]])){channels[_0x5701d3['uniqueid']][_0xb8db('0x31')]=utils[_0xb8db('0x1f')]();}}catch(_0x3de345){utils['error'](_0x3de345[_0xb8db('0x30')]);}};exports['musiconholdstop']=function(_0x23934c){try{if(!_['isNil'](channels[_0x23934c[_0xb8db('0x8')]])){if(!_[_0xb8db('0x1d')](channels[_0x23934c[_0xb8db('0x8')]][_0xb8db('0x31')])){channels[_0x23934c[_0xb8db('0x8')]][_0xb8db('0x32')]+=utils[_0xb8db('0x26')](utils[_0xb8db('0x1f')](),channels[_0x23934c[_0xb8db('0x8')]][_0xb8db('0x31')]);delete channels[_0x23934c['uniqueid']][_0xb8db('0x31')];}}}catch(_0x4b391b){utils[_0xb8db('0x1b')](_0x4b391b['stack']);}};exports[_0xb8db('0x33')]=function(_0xa958be){try{if(!_[_0xb8db('0x1d')](channels[_0xa958be[_0xb8db('0x8')]])){if(!_[_0xb8db('0x1d')](_0xa958be[_0xb8db('0x34')]['xmd-originatecalleridnum'])){channels[_0xa958be[_0xb8db('0x8')]][_0xb8db('0xb')]=_0xa958be['value'];}if(!_[_0xb8db('0x1d')](_0xa958be['variable']['xmd-phone'])){channels[_0xa958be['uniqueid']][_0xb8db('0xc')]=_0xa958be[_0xb8db('0x35')];channels[_0xa958be['uniqueid']]['callerid']='\x22'+_0xa958be[_0xb8db('0x35')]+_0xb8db('0x36')+_0xa958be[_0xb8db('0x35')]+'>';}if(!_[_0xb8db('0x1d')](_0xa958be['variable'][_0xb8db('0x37')])||!_[_0xb8db('0x1d')](_0xa958be[_0xb8db('0x34')][_0xb8db('0x38')])){channels[_0xa958be[_0xb8db('0x8')]][_0xb8db('0xd')]=_0xa958be['value'];}if(!_['isNil'](_0xa958be[_0xb8db('0x34')][_0xb8db('0x39')])||!_[_0xb8db('0x1d')](_0xa958be['variable'][_0xb8db('0x3a')])){channels[_0xa958be[_0xb8db('0x8')]][_0xb8db('0x3b')]=_0xb8db('0x3c');channels[_0xa958be[_0xb8db('0x8')]][_0xb8db('0x3d')]=_0xa958be[_0xb8db('0x35')];channels[_0xa958be[_0xb8db('0x8')]][_0xb8db('0x3e')]=!![];}if(!_['isNil'](_0xa958be[_0xb8db('0x34')][_0xb8db('0x3f')])){channels[_0xa958be['uniqueid']][_0xb8db('0x40')]=_0xa958be[_0xb8db('0x35')];}if(!_[_0xb8db('0x1d')](_0xa958be[_0xb8db('0x34')][_0xb8db('0x41')])){channels[_0xa958be['uniqueid']][_0xb8db('0x42')]=_0xa958be['value'];}if(!_['isNil'](_0xa958be[_0xb8db('0x34')][_0xb8db('0x43')])){channels[_0xa958be['uniqueid']][_0xb8db('0x44')]=_0xa958be['value'];}if(!_[_0xb8db('0x1d')](_0xa958be[_0xb8db('0x34')]['sipcallid'])){channels[_0xa958be[_0xb8db('0x8')]]['sipcallid']=_0xa958be[_0xb8db('0x35')];}}}catch(_0x2cf98f){utils[_0xb8db('0x1b')](_0x2cf98f[_0xb8db('0x30')]);}};exports[_0xb8db('0x45')]=function(_0x155d38){try{if(!_['isNil'](channels[_0x155d38[_0xb8db('0x8')]])){if(_0x155d38[_0xb8db('0x46')][_0xb8db('0x47')]()==_0xb8db('0x48')&&_[_0xb8db('0x49')](_0x155d38[_0xb8db('0x4a')][_0xb8db('0x47')](),_0xb8db('0x4b'))){var _0x5e07fc=_0x155d38[_0xb8db('0x4a')][_0xb8db('0x4c')]('=');var _0x46775f=_0x5e07fc[0x0][_0xb8db('0x4d')](_0x5e07fc[0x0]['lastIndexOf']('(')+0x1,_0x5e07fc[0x0][_0xb8db('0x4e')](')'));var _0x19c5da=_0x5e07fc[0x1];channels[_0x155d38[_0xb8db('0x8')]][_0x46775f]=_0x19c5da;}if(!_['includes']([_0xb8db('0x22'),'noop','execif','set',_0xb8db('0x4f')],_0x155d38[_0xb8db('0x46')][_0xb8db('0x47')]())){channels[_0x155d38[_0xb8db('0x8')]][_0xb8db('0x3b')]=_0x155d38['application'];channels[_0x155d38[_0xb8db('0x8')]][_0xb8db('0x3d')]=_0x155d38[_0xb8db('0x4a')];}}}catch(_0x4a6808){utils['error'](_0x4a6808[_0xb8db('0x30')]);}}; \ No newline at end of file +var _0x5de6=['CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','type','accountcode','destination','callerid','then','UserId','request','CreateVoiceCallReport','newchannel','linkedid','calleridnum','exten','channel','now','DOCUMENTATION','error','newstate','isNil','channelstate','systemanswertime','context','transfer','destinationchannel','answertime','disposition','toNumber','stack','calleridname','duration','diffTime','endtime','attendedtransfer','transfereechannel','localtwolinkedid','secondtransfererchannel','userfield','transfertargetchannel','_attended','musiconholdstart','musiconholdstartAt','mohtime','variable','xmd-originatecalleridnum','source','xmd-phone','value','\x22\x20<','xmd-queue','lastapplication','Queue','lastdata','queue','xmd-contactid','outboundrouteid','routeid','sipcallid','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','toLowerCase','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format'];(function(_0x11ba46,_0x1d6752){var _0x1c8c6f=function(_0x4cf96f){while(--_0x4cf96f){_0x11ba46['push'](_0x11ba46['shift']());}};_0x1c8c6f(++_0x1d6752);}(_0x5de6,0xed));var _0x65de=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x5de6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x65de('0x0'));var util=require(_0x65de('0x1'));var utils=require(_0x65de('0x2'));var dispositions=[_0x65de('0x3'),'FAILED',_0x65de('0x4'),_0x65de('0x3'),'NO\x20ANSWER',_0x65de('0x3'),_0x65de('0x5'),_0x65de('0x6'),'FAILED',_0x65de('0x4'),'FAILED'];var channels={};function writeDB(_0x4fce87){utils[_0x65de('0x7')](util[_0x65de('0x8')](_0x65de('0x9'),_0x4fce87[_0x65de('0xa')],_0x4fce87['channel'],_0x4fce87[_0x65de('0xb')],_0x4fce87[_0x65de('0xc')],_0x4fce87['source'],_0x4fce87[_0x65de('0xd')],_0x4fce87[_0x65de('0xe')],_0x4fce87['disposition']));if(_0x4fce87[_0x65de('0xc')]){utils['getUserByInternal'](_0x4fce87[_0x65de('0xc')])[_0x65de('0xf')](function(_0x47d7a3){if(_0x47d7a3){_0x4fce87[_0x65de('0x10')]=_0x47d7a3['id'];}utils[_0x65de('0x11')]('CreateVoiceCallReport',_0x4fce87);});}else{utils[_0x65de('0x11')](_0x65de('0x12'),_0x4fce87);}if(channels[_0x4fce87[_0x65de('0xa')]]){delete channels[_0x4fce87[_0x65de('0xa')]];}}exports[_0x65de('0x13')]=function(_0x1c84de){try{if(_0x1c84de[_0x65de('0xa')]==_0x1c84de[_0x65de('0x14')]&&_0x1c84de['channel']!='OutgoingSpoolFailed'){channels[_0x1c84de[_0x65de('0xa')]]={'uniqueid':_0x1c84de['uniqueid'],'accountcode':_0x1c84de[_0x65de('0xc')],'source':_0x1c84de[_0x65de('0x15')],'destination':_0x1c84de[_0x65de('0x16')],'destinationcontext':_0x1c84de['context'],'channel':_0x1c84de[_0x65de('0x17')],'starttime':utils[_0x65de('0x18')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x65de('0x3'),'amaflags':_0x65de('0x19')};}}catch(_0x26ba3c){utils[_0x65de('0x1a')](_0x26ba3c['stack']);}};exports[_0x65de('0x1b')]=function(_0x2f6594){try{if(!_[_0x65de('0x1c')](channels[_0x2f6594[_0x65de('0xa')]])&&_0x2f6594[_0x65de('0x1d')]==0x6){if(_[_0x65de('0x1c')](channels[_0x2f6594['uniqueid']]['systemanswertime'])){channels[_0x2f6594['uniqueid']][_0x65de('0x1e')]=utils[_0x65de('0x18')]();}}else if(!_[_0x65de('0x1c')](channels[_0x2f6594[_0x65de('0x14')]])&&_0x2f6594[_0x65de('0x1d')]==0x6&&_0x2f6594[_0x65de('0x1f')]!=_0x65de('0x20')){channels[_0x2f6594[_0x65de('0x14')]][_0x65de('0xc')]=_0x2f6594[_0x65de('0xc')];channels[_0x2f6594[_0x65de('0x14')]][_0x65de('0x21')]=_0x2f6594['channel'];if(_[_0x65de('0x1c')](channels[_0x2f6594[_0x65de('0x14')]]['answertime'])){channels[_0x2f6594[_0x65de('0x14')]][_0x65de('0x22')]=utils['now']();}channels[_0x2f6594['linkedid']][_0x65de('0x23')]=dispositions[_[_0x65de('0x24')](_0x2f6594[_0x65de('0x1d')])]||'ANSWERED';}}catch(_0x5914cf){utils[_0x65de('0x1a')](_0x5914cf[_0x65de('0x25')]);}};exports['hangup']=function(_0x1dc9a7){try{if(!_[_0x65de('0x1c')](channels[_0x1dc9a7['uniqueid']])){if(_[_0x65de('0x1c')](channels[_0x1dc9a7[_0x65de('0xa')]]['callerid'])){channels[_0x1dc9a7[_0x65de('0xa')]][_0x65de('0xe')]=_0x1dc9a7[_0x65de('0x26')]+'\x20<'+_0x1dc9a7[_0x65de('0x15')]+'>';}channels[_0x1dc9a7[_0x65de('0xa')]]['endtime']=utils[_0x65de('0x18')]();channels[_0x1dc9a7['uniqueid']][_0x65de('0x27')]=utils[_0x65de('0x28')](channels[_0x1dc9a7[_0x65de('0xa')]][_0x65de('0x29')],channels[_0x1dc9a7[_0x65de('0xa')]]['starttime']);channels[_0x1dc9a7['uniqueid']]['billableseconds']=channels[_0x1dc9a7['uniqueid']][_0x65de('0x22')]?utils[_0x65de('0x28')](channels[_0x1dc9a7[_0x65de('0xa')]][_0x65de('0x29')],channels[_0x1dc9a7[_0x65de('0xa')]][_0x65de('0x22')]):0x0;writeDB(channels[_0x1dc9a7[_0x65de('0xa')]]);}}catch(_0x5a9846){utils[_0x65de('0x1a')](_0x5a9846[_0x65de('0x25')]);}};exports[_0x65de('0x2a')]=function(_0x225efa){try{if(!_[_0x65de('0x1c')](channels[_0x225efa['localtwolinkedid']])){if(channels[_0x225efa['localtwolinkedid']][_0x65de('0x17')]==_0x225efa[_0x65de('0x2b')]){channels[_0x225efa[_0x65de('0x2c')]]['destinationchannel']=_0x225efa[_0x65de('0x2d')];channels[_0x225efa[_0x65de('0x2c')]][_0x65de('0x2e')]='_attended';}else if(channels[_0x225efa['localtwolinkedid']][_0x65de('0x17')]=_0x225efa[_0x65de('0x2f')]){channels[_0x225efa[_0x65de('0x2c')]][_0x65de('0x21')]=_0x225efa['origtransfererchannel'];channels[_0x225efa[_0x65de('0x2c')]]['userfield']=_0x65de('0x30');}}}catch(_0x12a38b){utils['error'](_0x12a38b['stack']);}};exports[_0x65de('0x31')]=function(_0x3e4e35){try{if(!_[_0x65de('0x1c')](channels[_0x3e4e35[_0x65de('0xa')]])){channels[_0x3e4e35[_0x65de('0xa')]][_0x65de('0x32')]=utils[_0x65de('0x18')]();}}catch(_0xfae48c){utils['error'](_0xfae48c[_0x65de('0x25')]);}};exports['musiconholdstop']=function(_0x34a097){try{if(!_[_0x65de('0x1c')](channels[_0x34a097[_0x65de('0xa')]])){if(!_[_0x65de('0x1c')](channels[_0x34a097[_0x65de('0xa')]][_0x65de('0x32')])){channels[_0x34a097[_0x65de('0xa')]][_0x65de('0x33')]+=utils[_0x65de('0x28')](utils['now'](),channels[_0x34a097[_0x65de('0xa')]][_0x65de('0x32')]);delete channels[_0x34a097['uniqueid']][_0x65de('0x32')];}}}catch(_0x59ec9e){utils['error'](_0x59ec9e[_0x65de('0x25')]);}};exports['varset']=function(_0x3a2eb3){try{if(!_[_0x65de('0x1c')](channels[_0x3a2eb3[_0x65de('0xa')]])){if(!_[_0x65de('0x1c')](_0x3a2eb3[_0x65de('0x34')][_0x65de('0x35')])){channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0x36')]=_0x3a2eb3['value'];}if(!_['isNil'](_0x3a2eb3[_0x65de('0x34')][_0x65de('0x37')])){channels[_0x3a2eb3[_0x65de('0xa')]]['destination']=_0x3a2eb3[_0x65de('0x38')];channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0xe')]='\x22'+_0x3a2eb3['value']+_0x65de('0x39')+_0x3a2eb3[_0x65de('0x38')]+'>';}if(!_['isNil'](_0x3a2eb3[_0x65de('0x34')]['xmd-callerid-preview'])||!_[_0x65de('0x1c')](_0x3a2eb3[_0x65de('0x34')]['xmd-callerid'])){channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0xe')]=_0x3a2eb3[_0x65de('0x38')];}if(!_['isNil'](_0x3a2eb3[_0x65de('0x34')][_0x65de('0x3a')])||!_[_0x65de('0x1c')](_0x3a2eb3[_0x65de('0x34')]['xmcs-queue'])){channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0x3b')]=_0x65de('0x3c');channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0x3d')]=_0x3a2eb3['value'];channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0x3e')]=!![];}if(!_[_0x65de('0x1c')](_0x3a2eb3[_0x65de('0x34')][_0x65de('0x3f')])){channels[_0x3a2eb3[_0x65de('0xa')]]['ContactId']=_0x3a2eb3[_0x65de('0x38')];}if(!_[_0x65de('0x1c')](_0x3a2eb3[_0x65de('0x34')]['xmd-cdrtype'])){channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0xb')]=_0x3a2eb3['value'];}if(!_['isNil'](_0x3a2eb3[_0x65de('0x34')][_0x65de('0x40')])){channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0x41')]=_0x3a2eb3[_0x65de('0x38')];}if(!_['isNil'](_0x3a2eb3[_0x65de('0x34')][_0x65de('0x42')])){channels[_0x3a2eb3[_0x65de('0xa')]][_0x65de('0x42')]=_0x3a2eb3[_0x65de('0x38')];}}}catch(_0x2d499b){utils[_0x65de('0x1a')](_0x2d499b[_0x65de('0x25')]);}};exports[_0x65de('0x43')]=function(_0x152179){try{if(!_[_0x65de('0x1c')](channels[_0x152179['uniqueid']])){if(_0x152179[_0x65de('0x44')]['toLowerCase']()==_0x65de('0x45')&&_[_0x65de('0x46')](_0x152179[_0x65de('0x47')]['toLowerCase'](),_0x65de('0x48'))){var _0x10796a=_0x152179['appdata'][_0x65de('0x49')]('=');var _0x46ebf5=_0x10796a[0x0][_0x65de('0x4a')](_0x10796a[0x0][_0x65de('0x4b')]('(')+0x1,_0x10796a[0x0][_0x65de('0x4b')](')'));var _0x27b9d7=_0x10796a[0x1];channels[_0x152179[_0x65de('0xa')]][_0x46ebf5]=_0x27b9d7;}if(!_[_0x65de('0x4c')]([_0x65de('0x4d'),_0x65de('0x4e'),_0x65de('0x4f'),_0x65de('0x45'),_0x65de('0x50')],_0x152179['application'][_0x65de('0x51')]())){channels[_0x152179[_0x65de('0xa')]][_0x65de('0x3b')]=_0x152179[_0x65de('0x44')];channels[_0x152179[_0x65de('0xa')]]['lastdata']=_0x152179['appdata'];}}}catch(_0x753025){utils[_0x65de('0x1a')](_0x753025[_0x65de('0x25')]);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 8f8f15d..13818e8 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 _0x5162=['info','SHUTDOWN','fullybooted','FULLYBOOTED','error','CLOSE','managerevent','./utils','shutdown'];(function(_0xcfeff4,_0x3f2e19){var _0xb2fadc=function(_0x4cd013){while(--_0x4cd013){_0xcfeff4['push'](_0xcfeff4['shift']());}};_0xb2fadc(++_0x3f2e19);}(_0x5162,0x103));var _0x2516=function(_0x38051b,_0x46cf1e){_0x38051b=_0x38051b-0x0;var _0x349422=_0x5162[_0x38051b];return _0x349422;};'use strict';var utils=require(_0x2516('0x0'));var _=require('lodash');exports['connect']=function(){utils['info']('CONNECTED');};exports[_0x2516('0x1')]=function(){utils[_0x2516('0x2')](_0x2516('0x3'));};exports[_0x2516('0x4')]=function(){utils[_0x2516('0x2')](_0x2516('0x5'));};exports[_0x2516('0x6')]=function(_0x5b71b5){utils['error'](_0x5b71b5);};exports['close']=function(){utils[_0x2516('0x2')](_0x2516('0x7'));};exports[_0x2516('0x8')]=function(_0x3a8834){}; \ No newline at end of file +var _0x25fa=['FULLYBOOTED','error','close','CLOSE','managerevent','./utils','connect','info','shutdown','SHUTDOWN'];(function(_0x4287eb,_0x404cc4){var _0x3703cf=function(_0x5660c4){while(--_0x5660c4){_0x4287eb['push'](_0x4287eb['shift']());}};_0x3703cf(++_0x404cc4);}(_0x25fa,0x109));var _0xa25f=function(_0x35f49c,_0x152f34){_0x35f49c=_0x35f49c-0x0;var _0x284c21=_0x25fa[_0x35f49c];return _0x284c21;};'use strict';var utils=require(_0xa25f('0x0'));var _=require('lodash');exports[_0xa25f('0x1')]=function(){utils[_0xa25f('0x2')]('CONNECTED');};exports[_0xa25f('0x3')]=function(){utils[_0xa25f('0x2')](_0xa25f('0x4'));};exports['fullybooted']=function(){utils['info'](_0xa25f('0x5'));};exports['error']=function(_0x2ea9ea){utils[_0xa25f('0x6')](_0x2ea9ea);};exports[_0xa25f('0x7')]=function(){utils[_0xa25f('0x2')](_0xa25f('0x8'));};exports[_0xa25f('0x9')]=function(_0x64bbbf){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 84d8097..c67c409 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 _0x75d0=['CreateVoiceDialReport','application','toLowerCase','set','startsWith','cdr(routeid)','appdata','split','stack','varset','isNil','outboundrouteid','value','error','dialbegin','assign','now','lastevent','dialend','ANSWER','answertime','connect','hangup','complete','diffTime','endtime','starttime','lodash','util','./utils','format','uniqueid','channel','dialstring','calleridnum','connectedlinenum','dialstatus','request'];(function(_0x37eb0f,_0x5092d1){var _0xc893a2=function(_0x5e01b9){while(--_0x5e01b9){_0x37eb0f['push'](_0x37eb0f['shift']());}};_0xc893a2(++_0x5092d1);}(_0x75d0,0x1bd));var _0x075d=function(_0x3eb4a9,_0x359d73){_0x3eb4a9=_0x3eb4a9-0x0;var _0x48dbad=_0x75d0[_0x3eb4a9];return _0x48dbad;};'use strict';var _=require(_0x075d('0x0'));var util=require(_0x075d('0x1'));var utils=require(_0x075d('0x2'));var dials={};function writeDB(_0x12316b){utils['info'](util[_0x075d('0x3')]('DIAL|%s|%s|%s|%s|%s|%s',_0x12316b[_0x075d('0x4')],_0x12316b[_0x075d('0x5')],_0x12316b[_0x075d('0x6')],_0x12316b[_0x075d('0x7')],_0x12316b[_0x075d('0x8')],_0x12316b[_0x075d('0x9')]));utils[_0x075d('0xa')](_0x075d('0xb'),_0x12316b);delete dials[_0x12316b[_0x075d('0x4')]];}exports['newexten']=function(_0x555567){try{if(_0x555567[_0x075d('0xc')][_0x075d('0xd')]()==_0x075d('0xe')&&_[_0x075d('0xf')](_0x555567['appdata'][_0x075d('0xd')](),_0x075d('0x10'))){var _0x3ab3de=_0x555567[_0x075d('0x11')][_0x075d('0x12')]('=');dials[_0x555567[_0x075d('0x4')]]={'routeId':_0x3ab3de[0x1]};}}catch(_0x377f36){utils['error'](_0x377f36[_0x075d('0x13')]);}};exports[_0x075d('0x14')]=function(_0x42eca6){try{if(!_[_0x075d('0x15')](_0x42eca6['variable'][_0x075d('0x16')])){dials[_0x42eca6[_0x075d('0x4')]]={'routeId':_0x42eca6[_0x075d('0x17')]};}}catch(_0xf43ee){utils[_0x075d('0x18')](_0xf43ee[_0x075d('0x13')]);}};exports[_0x075d('0x19')]=function(_0x35735f){try{if(!_[_0x075d('0x15')](dials[_0x35735f[_0x075d('0x4')]])){dials[_0x35735f[_0x075d('0x4')]]=_[_0x075d('0x1a')](dials[_0x35735f[_0x075d('0x4')]],_0x35735f);dials[_0x35735f[_0x075d('0x4')]]['starttime']=utils[_0x075d('0x1b')]();dials[_0x35735f[_0x075d('0x4')]][_0x075d('0x1c')]='called';}}catch(_0x411256){utils[_0x075d('0x18')](_0x411256[_0x075d('0x13')]);}};exports[_0x075d('0x1d')]=function(_0x20ae8c){try{if(!_[_0x075d('0x15')](dials[_0x20ae8c[_0x075d('0x4')]])){dials[_0x20ae8c[_0x075d('0x4')]]['dialstatus']=_0x20ae8c[_0x075d('0x9')];if(_0x20ae8c[_0x075d('0x9')]==_0x075d('0x1e')){dials[_0x20ae8c[_0x075d('0x4')]]=_[_0x075d('0x1a')](dials[_0x20ae8c[_0x075d('0x4')]],_0x20ae8c);dials[_0x20ae8c[_0x075d('0x4')]][_0x075d('0x1f')]=utils[_0x075d('0x1b')]();dials[_0x20ae8c[_0x075d('0x4')]][_0x075d('0x1c')]=_0x075d('0x20');}}}catch(_0x1ba45c){utils[_0x075d('0x18')](_0x1ba45c[_0x075d('0x13')]);}};exports[_0x075d('0x21')]=function(_0xbbaeb4){try{if(!_[_0x075d('0x15')](dials[_0xbbaeb4['uniqueid']])){dials[_0xbbaeb4['uniqueid']]=_[_0x075d('0x1a')](dials[_0xbbaeb4['uniqueid']],{'endtime':utils[_0x075d('0x1b')](),'lastevent':_0x075d('0x22')});dials[_0xbbaeb4[_0x075d('0x4')]]['duration']=utils[_0x075d('0x23')](dials[_0xbbaeb4[_0x075d('0x4')]]['endtime'],dials[_0xbbaeb4[_0x075d('0x4')]]['starttime']);dials[_0xbbaeb4[_0x075d('0x4')]]['holdtime']=utils[_0x075d('0x23')](dials[_0xbbaeb4['uniqueid']][_0x075d('0x1f')]||dials[_0xbbaeb4[_0x075d('0x4')]][_0x075d('0x24')],dials[_0xbbaeb4[_0x075d('0x4')]][_0x075d('0x25')]);dials[_0xbbaeb4['uniqueid']]['billableseconds']=dials[_0xbbaeb4[_0x075d('0x4')]]['answertime']?utils[_0x075d('0x23')](dials[_0xbbaeb4[_0x075d('0x4')]][_0x075d('0x24')],dials[_0xbbaeb4[_0x075d('0x4')]][_0x075d('0x1f')]):0x0;writeDB(dials[_0xbbaeb4[_0x075d('0x4')]]);}}catch(_0x2679d2){utils['error'](_0x2679d2[_0x075d('0x13')]);}}; \ No newline at end of file +var _0x9703=['diffTime','endtime','starttime','./utils','info','DIAL|%s|%s|%s|%s|%s|%s','channel','calleridnum','connectedlinenum','CreateVoiceDialReport','uniqueid','newexten','application','toLowerCase','set','startsWith','cdr(routeid)','split','error','stack','varset','variable','outboundrouteid','value','dialbegin','isNil','assign','lastevent','dialend','dialstatus','ANSWER','answertime','now','connect','hangup','duration'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9703,0xdb));var _0x3970=function(_0x293fc0,_0x2f6520){_0x293fc0=_0x293fc0-0x0;var _0xbc9d8c=_0x9703[_0x293fc0];return _0xbc9d8c;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x3970('0x0'));var dials={};function writeDB(_0x357536){utils[_0x3970('0x1')](util['format'](_0x3970('0x2'),_0x357536['uniqueid'],_0x357536[_0x3970('0x3')],_0x357536['dialstring'],_0x357536[_0x3970('0x4')],_0x357536[_0x3970('0x5')],_0x357536['dialstatus']));utils['request'](_0x3970('0x6'),_0x357536);delete dials[_0x357536[_0x3970('0x7')]];}exports[_0x3970('0x8')]=function(_0x41d4d1){try{if(_0x41d4d1[_0x3970('0x9')][_0x3970('0xa')]()==_0x3970('0xb')&&_[_0x3970('0xc')](_0x41d4d1['appdata'][_0x3970('0xa')](),_0x3970('0xd'))){var _0xba62bb=_0x41d4d1['appdata'][_0x3970('0xe')]('=');dials[_0x41d4d1[_0x3970('0x7')]]={'routeId':_0xba62bb[0x1]};}}catch(_0x5e4bc5){utils[_0x3970('0xf')](_0x5e4bc5[_0x3970('0x10')]);}};exports[_0x3970('0x11')]=function(_0x261275){try{if(!_['isNil'](_0x261275[_0x3970('0x12')][_0x3970('0x13')])){dials[_0x261275[_0x3970('0x7')]]={'routeId':_0x261275[_0x3970('0x14')]};}}catch(_0x1cd5d9){utils[_0x3970('0xf')](_0x1cd5d9[_0x3970('0x10')]);}};exports[_0x3970('0x15')]=function(_0x5527aa){try{if(!_[_0x3970('0x16')](dials[_0x5527aa[_0x3970('0x7')]])){dials[_0x5527aa['uniqueid']]=_[_0x3970('0x17')](dials[_0x5527aa[_0x3970('0x7')]],_0x5527aa);dials[_0x5527aa['uniqueid']]['starttime']=utils['now']();dials[_0x5527aa[_0x3970('0x7')]][_0x3970('0x18')]='called';}}catch(_0x4db273){utils[_0x3970('0xf')](_0x4db273[_0x3970('0x10')]);}};exports[_0x3970('0x19')]=function(_0x49e95c){try{if(!_['isNil'](dials[_0x49e95c[_0x3970('0x7')]])){dials[_0x49e95c[_0x3970('0x7')]][_0x3970('0x1a')]=_0x49e95c[_0x3970('0x1a')];if(_0x49e95c[_0x3970('0x1a')]==_0x3970('0x1b')){dials[_0x49e95c['uniqueid']]=_[_0x3970('0x17')](dials[_0x49e95c[_0x3970('0x7')]],_0x49e95c);dials[_0x49e95c[_0x3970('0x7')]][_0x3970('0x1c')]=utils[_0x3970('0x1d')]();dials[_0x49e95c[_0x3970('0x7')]]['lastevent']=_0x3970('0x1e');}}}catch(_0x48f9a5){utils[_0x3970('0xf')](_0x48f9a5['stack']);}};exports[_0x3970('0x1f')]=function(_0x4fe9e8){try{if(!_[_0x3970('0x16')](dials[_0x4fe9e8[_0x3970('0x7')]])){dials[_0x4fe9e8[_0x3970('0x7')]]=_[_0x3970('0x17')](dials[_0x4fe9e8[_0x3970('0x7')]],{'endtime':utils[_0x3970('0x1d')](),'lastevent':'complete'});dials[_0x4fe9e8[_0x3970('0x7')]][_0x3970('0x20')]=utils[_0x3970('0x21')](dials[_0x4fe9e8['uniqueid']][_0x3970('0x22')],dials[_0x4fe9e8[_0x3970('0x7')]]['starttime']);dials[_0x4fe9e8[_0x3970('0x7')]]['holdtime']=utils['diffTime'](dials[_0x4fe9e8['uniqueid']][_0x3970('0x1c')]||dials[_0x4fe9e8[_0x3970('0x7')]][_0x3970('0x22')],dials[_0x4fe9e8[_0x3970('0x7')]][_0x3970('0x23')]);dials[_0x4fe9e8[_0x3970('0x7')]]['billableseconds']=dials[_0x4fe9e8['uniqueid']][_0x3970('0x1c')]?utils[_0x3970('0x21')](dials[_0x4fe9e8['uniqueid']][_0x3970('0x22')],dials[_0x4fe9e8[_0x3970('0x7')]][_0x3970('0x1c')]):0x0;writeDB(dials[_0x4fe9e8['uniqueid']]);}}catch(_0x49876a){utils['error'](_0x49876a[_0x3970('0x10')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index 1c8e4dd..0d0969e 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 _0x1b6a=['close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','asterisk','port','username','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','connect','shutdown','fullybooted','error'];(function(_0x4c509c,_0x496f6b){var _0x120016=function(_0x7650a8){while(--_0x7650a8){_0x4c509c['push'](_0x4c509c['shift']());}};_0x120016(++_0x496f6b);}(_0x1b6a,0x13c));var _0xa1b6=function(_0x153863,_0x41363d){_0x153863=_0x153863-0x0;var _0x3bfc32=_0x1b6a[_0x153863];return _0x3bfc32;};var AsteriskManager=require('asterisk-manager');var config=require(_0xa1b6('0x0'));var utils=require('./utils');var ami=new AsteriskManager(config[_0xa1b6('0x1')][_0xa1b6('0x2')],config[_0xa1b6('0x1')]['ip'],config[_0xa1b6('0x1')][_0xa1b6('0x3')],config[_0xa1b6('0x1')]['password'],!![]);ami[_0xa1b6('0x4')]();if(config[_0xa1b6('0x5')]&&config[_0xa1b6('0x5')][_0xa1b6('0x6')]){utils[_0xa1b6('0x7')](_0xa1b6('0x8'));}else{var agents=require(_0xa1b6('0x9'));var calls=require(_0xa1b6('0xa'));var queues=require(_0xa1b6('0xb'));var recordings=require(_0xa1b6('0xc'));var members=require(_0xa1b6('0xd'));var dials=require(_0xa1b6('0xe'));var transfers=require(_0xa1b6('0xf'));var core=require('./core.controller');ami['on'](_0xa1b6('0x10'),core[_0xa1b6('0x10')]);ami['on']('shutdown',core[_0xa1b6('0x11')]);ami['on'](_0xa1b6('0x12'),core[_0xa1b6('0x12')]);ami['on'](_0xa1b6('0x13'),core[_0xa1b6('0x13')]);ami['on'](_0xa1b6('0x14'),core['close']);ami['on'](_0xa1b6('0x15'),core[_0xa1b6('0x15')]);ami['on'](_0xa1b6('0x16'),function(_0x4c99db){try{members['devicestatechange'](_0x4c99db);}catch(_0x5f0021){utils[_0xa1b6('0x13')](_0x5f0021);}});ami['on'](_0xa1b6('0x17'),function(_0x40abcc){try{agents[_0xa1b6('0x17')](_0x40abcc);}catch(_0x4013d7){utils[_0xa1b6('0x13')](_0x4013d7);}});ami['on'](_0xa1b6('0x18'),function(_0x520fb2){try{agents['agentringnoanswer'](_0x520fb2);}catch(_0x4484b2){utils[_0xa1b6('0x13')](_0x4484b2);}});ami['on']('agentconnect',function(_0xfb3de9){try{agents[_0xa1b6('0x19')](_0xfb3de9);queues['agentconnect'](_0xfb3de9);}catch(_0x185984){utils[_0xa1b6('0x13')](_0x185984);}});ami['on'](_0xa1b6('0x1a'),function(_0x3fec5b){try{agents[_0xa1b6('0x1a')](_0x3fec5b);queues['agentcomplete'](_0x3fec5b);members['agentcomplete'](_0x3fec5b);}catch(_0x4ae666){utils[_0xa1b6('0x13')](_0x4ae666);}});ami['on'](_0xa1b6('0x1b'),function(_0x21e10c){try{agents[_0xa1b6('0x1b')](_0x21e10c);queues[_0xa1b6('0x1b')](_0x21e10c);}catch(_0x566836){utils[_0xa1b6('0x13')](_0x566836);}});ami['on']('queuecallerjoin',function(_0x31297a){try{queues[_0xa1b6('0x1c')](_0x31297a);recordings[_0xa1b6('0x1c')](_0x31297a);}catch(_0x246c0c){utils[_0xa1b6('0x13')](_0x246c0c);}});ami['on'](_0xa1b6('0x1d'),function(_0x3ef88f){try{queues['queuecallerleave'](_0x3ef88f);}catch(_0x20fc9c){utils['error'](_0x20fc9c);}});ami['on'](_0xa1b6('0x1e'),function(_0x1413a4){try{queues[_0xa1b6('0x1e')](_0x1413a4);calls['musiconholdstart'](_0x1413a4);}catch(_0x238495){utils[_0xa1b6('0x13')](_0x238495);}});ami['on']('musiconholdstop',function(_0x549a54){try{queues['musiconholdstop'](_0x549a54);calls[_0xa1b6('0x1f')](_0x549a54);}catch(_0x286c28){utils[_0xa1b6('0x13')](_0x286c28);}});ami['on'](_0xa1b6('0x20'),function(_0x12ba2d){try{calls[_0xa1b6('0x20')](_0x12ba2d);recordings[_0xa1b6('0x20')](_0x12ba2d);}catch(_0x1e846c){utils['error'](_0x1e846c);}});ami['on'](_0xa1b6('0x21'),function(_0x5b6a58){try{calls[_0xa1b6('0x21')](_0x5b6a58);recordings[_0xa1b6('0x21')](_0x5b6a58);dials[_0xa1b6('0x21')](_0x5b6a58);agents[_0xa1b6('0x21')](_0x5b6a58);queues[_0xa1b6('0x21')](_0x5b6a58);}catch(_0xff2e71){utils[_0xa1b6('0x13')](_0xff2e71);}});ami['on'](_0xa1b6('0x22'),function(_0x28e5a4){try{members['cdr'](_0x28e5a4);}catch(_0x2c1293){utils['error'](_0x2c1293);}});ami['on']('blindtransfer',function(_0x3352fd){try{queues[_0xa1b6('0x23')](_0x3352fd);agents['blindtransfer'](_0x3352fd);transfers[_0xa1b6('0x23')](_0x3352fd);}catch(_0xad5271){utils[_0xa1b6('0x13')](_0xad5271);}});ami['on'](_0xa1b6('0x24'),function(_0x1908a5){try{queues[_0xa1b6('0x24')](_0x1908a5);transfers[_0xa1b6('0x24')](_0x1908a5);agents[_0xa1b6('0x24')](_0x1908a5);calls[_0xa1b6('0x24')](_0x1908a5);}catch(_0x6c94a4){utils[_0xa1b6('0x13')](_0x6c94a4);}});ami['on'](_0xa1b6('0x25'),function(_0x59101d){try{queues[_0xa1b6('0x25')](_0x59101d);recordings[_0xa1b6('0x25')](_0x59101d);calls['varset'](_0x59101d);dials[_0xa1b6('0x25')](_0x59101d);}catch(_0xcf1168){utils[_0xa1b6('0x13')](_0xcf1168);}});ami['on']('newexten',function(_0x424d5d){try{calls[_0xa1b6('0x26')](_0x424d5d);recordings[_0xa1b6('0x26')](_0x424d5d);dials[_0xa1b6('0x26')](_0x424d5d);}catch(_0x47a4e5){utils[_0xa1b6('0x13')](_0x47a4e5);}});ami['on'](_0xa1b6('0x27'),function(_0x16f620){try{calls[_0xa1b6('0x27')](_0x16f620);recordings[_0xa1b6('0x27')](_0x16f620);}catch(_0x43656b){utils[_0xa1b6('0x13')](_0x43656b);}});ami['on'](_0xa1b6('0x28'),function(_0xe6832b){try{dials[_0xa1b6('0x28')](_0xe6832b);}catch(_0x3cb09e){utils[_0xa1b6('0x13')](_0x3cb09e);}});ami['on']('dialend',function(_0x3b836b){try{dials[_0xa1b6('0x29')](_0x3b836b);}catch(_0x42ca28){utils[_0xa1b6('0x13')](_0x42ca28);}});} \ No newline at end of file +var _0x9dc4=['varset','newexten','newchannel','dialbegin','asterisk-manager','../../config/environment','./utils','asterisk','port','username','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./calls.controller','./recordings.controller','./members.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer'];(function(_0x3c4b28,_0x3299d9){var _0x162752=function(_0x348465){while(--_0x348465){_0x3c4b28['push'](_0x3c4b28['shift']());}};_0x162752(++_0x3299d9);}(_0x9dc4,0xa0));var _0x49dc=function(_0x59a1db,_0x438453){_0x59a1db=_0x59a1db-0x0;var _0x49a800=_0x9dc4[_0x59a1db];return _0x49a800;};var AsteriskManager=require(_0x49dc('0x0'));var config=require(_0x49dc('0x1'));var utils=require(_0x49dc('0x2'));var ami=new AsteriskManager(config[_0x49dc('0x3')][_0x49dc('0x4')],config['asterisk']['ip'],config[_0x49dc('0x3')][_0x49dc('0x5')],config[_0x49dc('0x3')]['password'],!![]);ami[_0x49dc('0x6')]();if(config[_0x49dc('0x7')]&&config['xdr'][_0x49dc('0x8')]){utils[_0x49dc('0x9')](_0x49dc('0xa'));}else{var agents=require('./agents.controller');var calls=require(_0x49dc('0xb'));var queues=require('./queues.controller');var recordings=require(_0x49dc('0xc'));var members=require(_0x49dc('0xd'));var dials=require('./dials.controller');var transfers=require('./transfers.controller');var core=require('./core.controller');ami['on'](_0x49dc('0xe'),core[_0x49dc('0xe')]);ami['on']('shutdown',core[_0x49dc('0xf')]);ami['on'](_0x49dc('0x10'),core[_0x49dc('0x10')]);ami['on'](_0x49dc('0x11'),core[_0x49dc('0x11')]);ami['on'](_0x49dc('0x12'),core[_0x49dc('0x12')]);ami['on'](_0x49dc('0x13'),core['managerevent']);ami['on'](_0x49dc('0x14'),function(_0x2f3e76){try{members[_0x49dc('0x14')](_0x2f3e76);}catch(_0x38d480){utils[_0x49dc('0x11')](_0x38d480);}});ami['on'](_0x49dc('0x15'),function(_0x58df80){try{agents[_0x49dc('0x15')](_0x58df80);}catch(_0x4d37f3){utils[_0x49dc('0x11')](_0x4d37f3);}});ami['on'](_0x49dc('0x16'),function(_0x2dfee9){try{agents['agentringnoanswer'](_0x2dfee9);}catch(_0x2c314e){utils['error'](_0x2c314e);}});ami['on'](_0x49dc('0x17'),function(_0xfcb7d4){try{agents[_0x49dc('0x17')](_0xfcb7d4);queues[_0x49dc('0x17')](_0xfcb7d4);}catch(_0x535ca6){utils['error'](_0x535ca6);}});ami['on'](_0x49dc('0x18'),function(_0x351591){try{agents[_0x49dc('0x18')](_0x351591);queues[_0x49dc('0x18')](_0x351591);members[_0x49dc('0x18')](_0x351591);}catch(_0x52d972){utils[_0x49dc('0x11')](_0x52d972);}});ami['on'](_0x49dc('0x19'),function(_0x14f9ff){try{agents['queuecallerabandon'](_0x14f9ff);queues['queuecallerabandon'](_0x14f9ff);}catch(_0x4556c9){utils['error'](_0x4556c9);}});ami['on'](_0x49dc('0x1a'),function(_0x4ce4da){try{queues[_0x49dc('0x1a')](_0x4ce4da);recordings[_0x49dc('0x1a')](_0x4ce4da);}catch(_0x2bd73c){utils[_0x49dc('0x11')](_0x2bd73c);}});ami['on'](_0x49dc('0x1b'),function(_0x5e305b){try{queues[_0x49dc('0x1b')](_0x5e305b);}catch(_0x5b4031){utils['error'](_0x5b4031);}});ami['on'](_0x49dc('0x1c'),function(_0x311e1d){try{queues[_0x49dc('0x1c')](_0x311e1d);calls['musiconholdstart'](_0x311e1d);}catch(_0x433d30){utils[_0x49dc('0x11')](_0x433d30);}});ami['on']('musiconholdstop',function(_0x131a84){try{queues[_0x49dc('0x1d')](_0x131a84);calls[_0x49dc('0x1d')](_0x131a84);}catch(_0x293537){utils[_0x49dc('0x11')](_0x293537);}});ami['on']('newstate',function(_0x3068a9){try{calls[_0x49dc('0x1e')](_0x3068a9);recordings[_0x49dc('0x1e')](_0x3068a9);}catch(_0xeacfeb){utils[_0x49dc('0x11')](_0xeacfeb);}});ami['on'](_0x49dc('0x1f'),function(_0x572f50){try{calls[_0x49dc('0x1f')](_0x572f50);recordings[_0x49dc('0x1f')](_0x572f50);dials[_0x49dc('0x1f')](_0x572f50);agents[_0x49dc('0x1f')](_0x572f50);queues['hangup'](_0x572f50);}catch(_0xee939f){utils[_0x49dc('0x11')](_0xee939f);}});ami['on'](_0x49dc('0x20'),function(_0x26ea74){try{members[_0x49dc('0x20')](_0x26ea74);}catch(_0x59d99d){utils[_0x49dc('0x11')](_0x59d99d);}});ami['on']('blindtransfer',function(_0x452b64){try{queues[_0x49dc('0x21')](_0x452b64);agents['blindtransfer'](_0x452b64);transfers[_0x49dc('0x21')](_0x452b64);}catch(_0x4365de){utils[_0x49dc('0x11')](_0x4365de);}});ami['on'](_0x49dc('0x22'),function(_0x2054d5){try{queues['attendedtransfer'](_0x2054d5);transfers['attendedtransfer'](_0x2054d5);agents[_0x49dc('0x22')](_0x2054d5);calls[_0x49dc('0x22')](_0x2054d5);}catch(_0x1ad404){utils[_0x49dc('0x11')](_0x1ad404);}});ami['on'](_0x49dc('0x23'),function(_0x279499){try{queues['varset'](_0x279499);recordings['varset'](_0x279499);calls[_0x49dc('0x23')](_0x279499);dials[_0x49dc('0x23')](_0x279499);}catch(_0x535a81){utils['error'](_0x535a81);}});ami['on'](_0x49dc('0x24'),function(_0x2b5517){try{calls[_0x49dc('0x24')](_0x2b5517);recordings['newexten'](_0x2b5517);dials[_0x49dc('0x24')](_0x2b5517);}catch(_0x549187){utils[_0x49dc('0x11')](_0x549187);}});ami['on'](_0x49dc('0x25'),function(_0x4466c7){try{calls['newchannel'](_0x4466c7);recordings[_0x49dc('0x25')](_0x4466c7);}catch(_0x4db743){utils[_0x49dc('0x11')](_0x4db743);}});ami['on'](_0x49dc('0x26'),function(_0x62c19a){try{dials['dialbegin'](_0x62c19a);}catch(_0x4d7813){utils[_0x49dc('0x11')](_0x4d7813);}});ami['on']('dialend',function(_0x233d13){try{dials['dialend'](_0x233d13);}catch(_0xd94adc){utils[_0x49dc('0x11')](_0xd94adc);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 68cea81..ded5105 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 _0xdb47=['getUserByInterface','then','name','internal','request','CreateMemberReport','getUserByName','catch','error','some','devicestatechange','state','INUSE','BUSY','device','voice','TALKING','now','exitAt','duration','diffTime','enterAt','agentcomplete','isNil','assign','queue','cdr','split','source','destination','destinationchannel','data1','data3','lodash','util','./utils','Local/_attended@transfer','Queue:','info','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','data2','membername','type'];(function(_0x490479,_0x5e4bd6){var _0x38a440=function(_0x1fe274){while(--_0x1fe274){_0x490479['push'](_0x490479['shift']());}};_0x38a440(++_0x5e4bd6);}(_0xdb47,0xd9));var _0x7db4=function(_0x787d44,_0x36fea9){_0x787d44=_0x787d44-0x0;var _0x1c1430=_0xdb47[_0x787d44];return _0x1c1430;};'use strict';var _=require(_0x7db4('0x0'));var util=require(_0x7db4('0x1'));var utils=require(_0x7db4('0x2'));var members={};var exclude=[_0x7db4('0x3'),_0x7db4('0x4')];function writeDB(_0x19ef90){utils[_0x7db4('0x5')](util['format'](_0x7db4('0x6'),_0x19ef90[_0x7db4('0x7')],_0x19ef90[_0x7db4('0x8')],_0x19ef90[_0x7db4('0x9')],_0x19ef90[_0x7db4('0xa')],_0x19ef90[_0x7db4('0xb')],_0x19ef90[_0x7db4('0xc')]));if(_0x19ef90[_0x7db4('0x8')]){utils[_0x7db4('0xd')](_0x19ef90['interface'])[_0x7db4('0xe')](function(_0xf43404){if(_0xf43404){_0x19ef90['membername']=_0xf43404[_0x7db4('0xf')];_0x19ef90[_0x7db4('0x10')]=_0xf43404[_0x7db4('0x10')];utils[_0x7db4('0x11')](_0x7db4('0x12'),_0x19ef90);}else{utils[_0x7db4('0x13')](_0x19ef90[_0x7db4('0x8')]['split']('/')[0x1])[_0x7db4('0xe')](function(_0x4eff5e){if(_0x4eff5e){_0x19ef90[_0x7db4('0xb')]=_0x4eff5e[_0x7db4('0xf')];_0x19ef90['internal']=_0x4eff5e[_0x7db4('0x10')];utils[_0x7db4('0x11')](_0x7db4('0x12'),_0x19ef90);}});}})[_0x7db4('0x14')](function(_0xcab4e0){utils[_0x7db4('0x15')](_0xcab4e0);});}delete members[_0x19ef90[_0x7db4('0x8')]];}function startsWith(_0x233b82,_0x4679bb){return _[_0x7db4('0x16')](_0x233b82,function(_0x3ab952){return _['startsWith'](_0x4679bb,_0x3ab952);});}exports[_0x7db4('0x17')]=function(_0x482233){switch(_0x482233[_0x7db4('0x18')]){case _0x7db4('0x19'):case _0x7db4('0x1a'):if(!startsWith(exclude,_0x482233[_0x7db4('0x1b')])){members[_0x482233[_0x7db4('0x1b')]]={'channel':_0x7db4('0x1c'),'interface':_0x482233['device'],'type':_0x7db4('0x1d'),'enterAt':utils[_0x7db4('0x1e')](),'role':'agent'};}break;case'NOT_INUSE':if(!_['isNil'](members[_0x482233[_0x7db4('0x1b')]])){members[_0x482233[_0x7db4('0x1b')]][_0x7db4('0x1f')]=utils[_0x7db4('0x1e')]();members[_0x482233[_0x7db4('0x1b')]][_0x7db4('0x20')]=utils[_0x7db4('0x21')](members[_0x482233[_0x7db4('0x1b')]][_0x7db4('0x1f')],members[_0x482233[_0x7db4('0x1b')]][_0x7db4('0x22')]);if(members[_0x482233[_0x7db4('0x1b')]]['uniqueid']){writeDB(members[_0x482233[_0x7db4('0x1b')]]);}}default:break;}};exports[_0x7db4('0x23')]=function(_0x24c2fc){if(!_[_0x7db4('0x24')](members[_0x24c2fc[_0x7db4('0x8')]])){members[_0x24c2fc[_0x7db4('0x8')]]=_[_0x7db4('0x25')](members[_0x24c2fc[_0x7db4('0x8')]],{'data4':_0x24c2fc[_0x7db4('0x26')],'uniqueid':_0x24c2fc[_0x7db4('0x7')]});}};exports[_0x7db4('0x27')]=function(_0x58b912){if(_0x58b912[_0x7db4('0x9')]){var _0x56531d=_0x58b912[_0x7db4('0x9')][_0x7db4('0x28')]('-')[0x0];if(!_['isNil'](members[_0x56531d])){members[_0x56531d]=_[_0x7db4('0x25')](members[_0x56531d],{'data1':members[_0x56531d]['data1']||_0x58b912['type'],'data2':members[_0x56531d][_0x7db4('0xa')]||_0x58b912[_0x7db4('0x29')],'data3':members[_0x56531d]['data3']||_0x58b912[_0x7db4('0x2a')],'uniqueid':members[_0x56531d][_0x7db4('0x7')]||_0x58b912[_0x7db4('0x7')]});if(members[_0x56531d]['exitAt']){writeDB(members[_0x56531d]);}}}if(_0x58b912[_0x7db4('0x2b')]){var _0x4efdea=_0x58b912[_0x7db4('0x2b')]['split']('-')[0x0];if(!_[_0x7db4('0x24')](members[_0x4efdea])){members[_0x4efdea]=_['assign'](members[_0x4efdea],{'data1':members[_0x4efdea][_0x7db4('0x2c')]||_0x58b912[_0x7db4('0xc')],'data2':members[_0x4efdea][_0x7db4('0xa')]||_0x58b912[_0x7db4('0x29')],'data3':members[_0x4efdea][_0x7db4('0x2d')]||_0x58b912['destination'],'uniqueid':members[_0x4efdea][_0x7db4('0x7')]||_0x58b912[_0x7db4('0x7')]});if(members[_0x4efdea]['exitAt']){writeDB(members[_0x4efdea]);}}}}; \ No newline at end of file +var _0x59f5=['destination','exitAt','destinationchannel','source','lodash','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','channel','data2','membername','type','interface','then','name','internal','request','CreateMemberReport','split','catch','some','startsWith','devicestatechange','state','BUSY','device','voice','TALKING','now','agent','NOT_INUSE','isNil','diffTime','enterAt','uniqueid','assign','queue','cdr','data1','data3'];(function(_0x24327c,_0x3f1b1f){var _0x40f5cb=function(_0x2041a0){while(--_0x2041a0){_0x24327c['push'](_0x24327c['shift']());}};_0x40f5cb(++_0x3f1b1f);}(_0x59f5,0x1bc));var _0x559f=function(_0x41017e,_0xcd1644){_0x41017e=_0x41017e-0x0;var _0x3a1a48=_0x59f5[_0x41017e];return _0x3a1a48;};'use strict';var _=require(_0x559f('0x0'));var util=require(_0x559f('0x1'));var utils=require(_0x559f('0x2'));var members={};var exclude=[_0x559f('0x3'),_0x559f('0x4')];function writeDB(_0x444106){utils[_0x559f('0x5')](util[_0x559f('0x6')](_0x559f('0x7'),_0x444106['uniqueid'],_0x444106['interface'],_0x444106[_0x559f('0x8')],_0x444106[_0x559f('0x9')],_0x444106[_0x559f('0xa')],_0x444106[_0x559f('0xb')]));if(_0x444106[_0x559f('0xc')]){utils['getUserByInterface'](_0x444106[_0x559f('0xc')])[_0x559f('0xd')](function(_0x5ca1f5){if(_0x5ca1f5){_0x444106['membername']=_0x5ca1f5[_0x559f('0xe')];_0x444106[_0x559f('0xf')]=_0x5ca1f5[_0x559f('0xf')];utils[_0x559f('0x10')](_0x559f('0x11'),_0x444106);}else{utils['getUserByName'](_0x444106[_0x559f('0xc')][_0x559f('0x12')]('/')[0x1])['then'](function(_0x1f358f){if(_0x1f358f){_0x444106[_0x559f('0xa')]=_0x1f358f[_0x559f('0xe')];_0x444106[_0x559f('0xf')]=_0x1f358f['internal'];utils[_0x559f('0x10')](_0x559f('0x11'),_0x444106);}});}})[_0x559f('0x13')](function(_0x22c0c9){utils['error'](_0x22c0c9);});}delete members[_0x444106['interface']];}function startsWith(_0x314821,_0x1f805e){return _[_0x559f('0x14')](_0x314821,function(_0x3ecaf0){return _[_0x559f('0x15')](_0x1f805e,_0x3ecaf0);});}exports[_0x559f('0x16')]=function(_0x5d926f){switch(_0x5d926f[_0x559f('0x17')]){case'INUSE':case _0x559f('0x18'):if(!startsWith(exclude,_0x5d926f[_0x559f('0x19')])){members[_0x5d926f['device']]={'channel':_0x559f('0x1a'),'interface':_0x5d926f[_0x559f('0x19')],'type':_0x559f('0x1b'),'enterAt':utils[_0x559f('0x1c')](),'role':_0x559f('0x1d')};}break;case _0x559f('0x1e'):if(!_[_0x559f('0x1f')](members[_0x5d926f[_0x559f('0x19')]])){members[_0x5d926f[_0x559f('0x19')]]['exitAt']=utils[_0x559f('0x1c')]();members[_0x5d926f['device']]['duration']=utils[_0x559f('0x20')](members[_0x5d926f[_0x559f('0x19')]]['exitAt'],members[_0x5d926f[_0x559f('0x19')]][_0x559f('0x21')]);if(members[_0x5d926f['device']][_0x559f('0x22')]){writeDB(members[_0x5d926f[_0x559f('0x19')]]);}}default:break;}};exports['agentcomplete']=function(_0x6f1267){if(!_[_0x559f('0x1f')](members[_0x6f1267[_0x559f('0xc')]])){members[_0x6f1267[_0x559f('0xc')]]=_[_0x559f('0x23')](members[_0x6f1267[_0x559f('0xc')]],{'data4':_0x6f1267[_0x559f('0x24')],'uniqueid':_0x6f1267[_0x559f('0x22')]});}};exports[_0x559f('0x25')]=function(_0x15137d){if(_0x15137d[_0x559f('0x8')]){var _0x8c7e86=_0x15137d[_0x559f('0x8')][_0x559f('0x12')]('-')[0x0];if(!_['isNil'](members[_0x8c7e86])){members[_0x8c7e86]=_['assign'](members[_0x8c7e86],{'data1':members[_0x8c7e86][_0x559f('0x26')]||_0x15137d[_0x559f('0xb')],'data2':members[_0x8c7e86][_0x559f('0x9')]||_0x15137d['source'],'data3':members[_0x8c7e86][_0x559f('0x27')]||_0x15137d[_0x559f('0x28')],'uniqueid':members[_0x8c7e86][_0x559f('0x22')]||_0x15137d[_0x559f('0x22')]});if(members[_0x8c7e86][_0x559f('0x29')]){writeDB(members[_0x8c7e86]);}}}if(_0x15137d[_0x559f('0x2a')]){var _0x2cb35b=_0x15137d[_0x559f('0x2a')][_0x559f('0x12')]('-')[0x0];if(!_[_0x559f('0x1f')](members[_0x2cb35b])){members[_0x2cb35b]=_['assign'](members[_0x2cb35b],{'data1':members[_0x2cb35b][_0x559f('0x26')]||_0x15137d['type'],'data2':members[_0x2cb35b][_0x559f('0x9')]||_0x15137d[_0x559f('0x2b')],'data3':members[_0x2cb35b][_0x559f('0x27')]||_0x15137d['destination'],'uniqueid':members[_0x2cb35b][_0x559f('0x22')]||_0x15137d[_0x559f('0x22')]});if(members[_0x2cb35b][_0x559f('0x29')]){writeDB(members[_0x2cb35b]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index bb39440..dcb63ed 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 _0xeca7=['queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuestatus','queuecallerabandonAt','queuecallerexit','queuecallerexitAt','value','queueposition','EXITWITHKEY','ABANDONED','queuecallerleave','diffTime','queuecallerjoinAt','connectedlinenum','assigned','reason','transfer','TRANSFER','toUpperCase','blindtransfer','transfereeuniqueid','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','transfertype','ATTENDED','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','transfertargetlinkedid','clone','holdtime','error','musiconholdstart','musiconholdstartAt','lodash','util','./utils','info','format','uniqueid','channel','lastAssignedTo','calleridnum','accountcode','queue','getVoiceQueueByName','request','transfereduniqueid','queuecallerjoin','position','now','isNil','queuecallerleaveAt','queuecallerabandon','queuecallercomplete'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xeca7,0xba));var _0x7eca=function(_0x4d8f6f,_0x559720){_0x4d8f6f=_0x4d8f6f-0x0;var _0x441c71=_0xeca7[_0x4d8f6f];return _0x441c71;};'use strict';var _=require(_0x7eca('0x0'));var util=require(_0x7eca('0x1'));var utils=require(_0x7eca('0x2'));var queues={};function writeDB(_0x573da5){utils[_0x7eca('0x3')](util[_0x7eca('0x4')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x573da5[_0x7eca('0x5')],_0x573da5[_0x7eca('0x6')],_0x573da5['queue'],_0x573da5[_0x7eca('0x7')],_0x573da5[_0x7eca('0x8')],_0x573da5[_0x7eca('0x9')],_0x573da5['queuecallerexitreason']));if(_0x573da5[_0x7eca('0xa')]){utils[_0x7eca('0xb')](_0x573da5[_0x7eca('0xa')])['then'](function(_0x3d794a){if(_0x3d794a){_0x573da5['type']=_0x3d794a['type'];}utils[_0x7eca('0xc')]('CreateVoiceQueueReport',_0x573da5);});}else{utils[_0x7eca('0xc')]('CreateVoiceQueueReport',_0x573da5);}if(_0x573da5[_0x7eca('0xd')]){delete queues[_0x573da5['transfereduniqueid']];}else{delete queues[_0x573da5['uniqueid']];}}exports[_0x7eca('0xe')]=function(_0xaefeab){queues[_0xaefeab[_0x7eca('0x5')]]=_['assign'](_0xaefeab,{'originalposition':_0xaefeab[_0x7eca('0xf')],'queuecallerjoinAt':utils[_0x7eca('0x10')](),'mohtime':0x0});};exports['hangup']=function(_0x50376c){if(!_[_0x7eca('0x11')](queues[_0x50376c[_0x7eca('0x5')]])){if(queues[_0x50376c[_0x7eca('0x5')]][_0x7eca('0x12')]){if(!queues[_0x50376c[_0x7eca('0x5')]][_0x7eca('0x13')]&&!queues[_0x50376c[_0x7eca('0x5')]]['queuecallerexit']){queues[_0x50376c[_0x7eca('0x5')]][_0x7eca('0x14')]=!![];queues[_0x50376c[_0x7eca('0x5')]][_0x7eca('0x15')]=utils[_0x7eca('0x10')]();queues[_0x50376c[_0x7eca('0x5')]][_0x7eca('0x16')]=_0x7eca('0x17');}writeDB(queues[_0x50376c['uniqueid']]);}else{if(queues[_0x50376c['uniqueid']][_0x7eca('0xd')]){queues[queues[_0x50376c[_0x7eca('0x5')]]['transfereduniqueid']]=queues[_0x50376c['uniqueid']];queues[queues[_0x50376c[_0x7eca('0x5')]][_0x7eca('0xd')]][_0x7eca('0x18')]=0x2;delete queues[_0x50376c['uniqueid']];}}}};exports[_0x7eca('0x19')]=function(_0x3d3b34){if(!_['isNil'](_0x3d3b34[_0x7eca('0x1a')][_0x7eca('0x1b')])){if(!_['isNil'](queues[_0x3d3b34[_0x7eca('0x5')]])){queues[_0x3d3b34[_0x7eca('0x5')]][_0x7eca('0x13')]=![];queues[_0x3d3b34[_0x7eca('0x5')]][_0x7eca('0x1c')]=null;queues[_0x3d3b34['uniqueid']][_0x7eca('0x1d')]=!![];queues[_0x3d3b34[_0x7eca('0x5')]][_0x7eca('0x1e')]=utils['now']();queues[_0x3d3b34[_0x7eca('0x5')]][_0x7eca('0x16')]=_0x3d3b34[_0x7eca('0x1f')]['toUpperCase']();writeDB(queues[_0x3d3b34[_0x7eca('0x5')]]);}}else if(!_['isNil'](_0x3d3b34['variable'][_0x7eca('0x20')])){if(!_[_0x7eca('0x11')](queues[_0x3d3b34[_0x7eca('0x5')]])&&!queues[_0x3d3b34[_0x7eca('0x5')]]['queuecallerabandon']){queues[_0x3d3b34['uniqueid']][_0x7eca('0x13')]=![];queues[_0x3d3b34[_0x7eca('0x5')]]['queuecallerabandonAt']=null;queues[_0x3d3b34[_0x7eca('0x5')]]['queuecallerexit']=!![];queues[_0x3d3b34[_0x7eca('0x5')]]['queuecallerexitAt']=utils[_0x7eca('0x10')]();queues[_0x3d3b34[_0x7eca('0x5')]][_0x7eca('0x16')]=_0x7eca('0x21');}}};exports[_0x7eca('0x13')]=function(_0x349e0c){if(!_[_0x7eca('0x11')](queues[_0x349e0c[_0x7eca('0x5')]])){queues[_0x349e0c['uniqueid']][_0x7eca('0x1d')]=![];queues[_0x349e0c[_0x7eca('0x5')]][_0x7eca('0x1e')]=null;queues[_0x349e0c[_0x7eca('0x5')]][_0x7eca('0x13')]=!![];queues[_0x349e0c[_0x7eca('0x5')]][_0x7eca('0x1c')]=utils[_0x7eca('0x10')]();queues[_0x349e0c[_0x7eca('0x5')]][_0x7eca('0x16')]=_0x7eca('0x22');}};exports[_0x7eca('0x23')]=function(_0x107377){if(!_[_0x7eca('0x11')](queues[_0x107377[_0x7eca('0x5')]])){queues[_0x107377['uniqueid']]['queuecallerleave']=!![];queues[_0x107377[_0x7eca('0x5')]][_0x7eca('0x12')]=utils[_0x7eca('0x10')]();queues[_0x107377['uniqueid']]['holdtime']=utils[_0x7eca('0x24')](queues[_0x107377[_0x7eca('0x5')]][_0x7eca('0x12')],queues[_0x107377[_0x7eca('0x5')]][_0x7eca('0x25')]);queues[_0x107377[_0x7eca('0x5')]][_0x7eca('0xf')]=_0x107377[_0x7eca('0xf')];queues[_0x107377['uniqueid']]['count']=_0x107377['count'];queues[_0x107377[_0x7eca('0x5')]][_0x7eca('0x26')]=_0x107377[_0x7eca('0x26')];queues[_0x107377[_0x7eca('0x5')]]['connectedlinename']=_0x107377['connectedlinename'];}};exports['agentconnect']=function(_0x55a79c){if(!_['isNil'](queues[_0x55a79c[_0x7eca('0x5')]])){queues[_0x55a79c[_0x7eca('0x5')]][_0x7eca('0x13')]=![];queues[_0x55a79c[_0x7eca('0x5')]][_0x7eca('0x13')]=![];queues[_0x55a79c['uniqueid']]['queuecallerabandonAt']=null;queues[_0x55a79c[_0x7eca('0x5')]]['queuecallerexit']=![];queues[_0x55a79c[_0x7eca('0x5')]][_0x7eca('0x1e')]=null;queues[_0x55a79c[_0x7eca('0x5')]][_0x7eca('0x27')]=!![];queues[_0x55a79c[_0x7eca('0x5')]][_0x7eca('0x9')]=_0x55a79c['destaccountcode'];queues[_0x55a79c[_0x7eca('0x5')]][_0x7eca('0x7')]=_0x55a79c['membername'];}};exports['agentcomplete']=function(_0x44b7c2){if(!_[_0x7eca('0x11')](queues[_0x44b7c2[_0x7eca('0x5')]])){if(queues[_0x44b7c2['uniqueid']]['queuecallerleaveAt']){queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x13')]=![];queues[_0x44b7c2['uniqueid']]['queuecallerabandon']=![];queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x1c')]=null;queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x1d')]=![];queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x1e')]=null;queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x27')]=!![];queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x7')]=_0x44b7c2['membername'];queues[_0x44b7c2['uniqueid']]['queuecallercomplete']=!![];queues[_0x44b7c2['uniqueid']][_0x7eca('0x15')]=utils[_0x7eca('0x10')]();if(_0x44b7c2[_0x7eca('0x28')]==_0x7eca('0x29')){if(!queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x29')]){queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x16')]=_0x7eca('0x2a');}}else{queues[_0x44b7c2[_0x7eca('0x5')]][_0x7eca('0x16')]='COMPLETEDBY'+_0x44b7c2[_0x7eca('0x28')][_0x7eca('0x2b')]();}writeDB(queues[_0x44b7c2['uniqueid']]);}}};exports[_0x7eca('0x2c')]=function(_0xab52bf){if(!_[_0x7eca('0x11')](queues[_0xab52bf[_0x7eca('0x2d')]])){queues[_0xab52bf['transfereeuniqueid']]['transfer']=!![];queues[_0xab52bf[_0x7eca('0x2d')]]['transfertype']='BLIND';queues[_0xab52bf[_0x7eca('0x2d')]][_0x7eca('0x2e')]=_0xab52bf[_0x7eca('0x2f')];queues[_0xab52bf[_0x7eca('0x2d')]][_0x7eca('0x30')]=_0xab52bf[_0x7eca('0x2d')];queues[_0xab52bf[_0x7eca('0x2d')]][_0x7eca('0x16')]=_0x7eca('0x31');}};exports[_0x7eca('0x32')]=function(_0x3010fb){try{if(_0x3010fb['origtransfereruniqueid']==_0x3010fb[_0x7eca('0x33')]){if(!_['isNil'](queues[_0x3010fb[_0x7eca('0x34')]])){queues[_0x3010fb[_0x7eca('0x34')]]['transfer']=!![];queues[_0x3010fb[_0x7eca('0x34')]][_0x7eca('0x35')]=_0x7eca('0x36');queues[_0x3010fb[_0x7eca('0x34')]][_0x7eca('0x2e')]=_0x3010fb[_0x7eca('0x37')];queues[_0x3010fb[_0x7eca('0x34')]]['transferuniqueid']=_0x3010fb[_0x7eca('0x38')];queues[_0x3010fb[_0x7eca('0x34')]]['queuecallerexitreason']=_0x7eca('0x39');}if(!_['isNil'](queues[_0x3010fb['origtransfererlinkedid']])){if(_0x3010fb[_0x7eca('0x3a')]&&queues[_0x3010fb[_0x7eca('0x3a')]]){queues[_0x3010fb['transfereelinkedid']]['queuecallerenterreason']=0x1;queues[_0x3010fb['transfereeuniqueid']]=_['clone'](queues[_0x3010fb[_0x7eca('0x3a')]]);queues[_0x3010fb[_0x7eca('0x2d')]][_0x7eca('0xd')]=_0x3010fb[_0x7eca('0x3b')];queues[_0x3010fb[_0x7eca('0x2d')]][_0x7eca('0x18')]=0x2;queues[_0x3010fb[_0x7eca('0x2d')]][_0x7eca('0x8')]=queues[_0x3010fb['secondtransfererlinkedid']][_0x7eca('0x8')];queues[_0x3010fb[_0x7eca('0x2d')]][_0x7eca('0x3c')]=queues[_0x3010fb[_0x7eca('0x34')]][_0x7eca('0x3c')];queues[_0x3010fb[_0x7eca('0x2d')]]['queuecallerjoinAt']=utils[_0x7eca('0x10')]();queues[_0x3010fb[_0x7eca('0x2d')]]['queuecallerleaveAt']=utils[_0x7eca('0x10')]();queues[_0x3010fb[_0x7eca('0x2d')]]['holdtime']=0x0;queues[_0x3010fb[_0x7eca('0x2d')]][_0x7eca('0x3d')]=0x0;}else{queues[_0x3010fb[_0x7eca('0x33')]][_0x7eca('0xd')]=_0x3010fb[_0x7eca('0x34')];}}}else if(_0x3010fb[_0x7eca('0x3e')]==_0x3010fb[_0x7eca('0x34')]){if(!_['isNil'](queues[_0x3010fb[_0x7eca('0x33')]])){queues[_0x3010fb['origtransfererlinkedid']][_0x7eca('0x29')]=!![];queues[_0x3010fb[_0x7eca('0x33')]][_0x7eca('0x35')]=_0x7eca('0x36');queues[_0x3010fb[_0x7eca('0x33')]][_0x7eca('0x2e')]=_0x3010fb['secondtransfererexten'];queues[_0x3010fb[_0x7eca('0x33')]][_0x7eca('0x30')]=_0x3010fb[_0x7eca('0x3e')];queues[_0x3010fb[_0x7eca('0x33')]][_0x7eca('0x16')]='ATTENDEDTRANSFER';}if(!_[_0x7eca('0x11')](queues[_0x3010fb[_0x7eca('0x34')]])){if(_0x3010fb[_0x7eca('0x3f')]&&queues[_0x3010fb[_0x7eca('0x3f')]]){queues[_0x3010fb[_0x7eca('0x3f')]][_0x7eca('0x18')]=0x1;queues[_0x3010fb[_0x7eca('0x3b')]]=_[_0x7eca('0x40')](queues[_0x3010fb[_0x7eca('0x3f')]]);queues[_0x3010fb[_0x7eca('0x3b')]]['transfereduniqueid']=_0x3010fb['transfertargetuniqueid'];queues[_0x3010fb[_0x7eca('0x3b')]][_0x7eca('0x18')]=0x2;queues[_0x3010fb[_0x7eca('0x3b')]][_0x7eca('0x8')]=queues[_0x3010fb['origtransfererlinkedid']][_0x7eca('0x8')];queues[_0x3010fb['transfertargetuniqueid']][_0x7eca('0x3c')]=queues[_0x3010fb['origtransfererlinkedid']][_0x7eca('0x3c')];queues[_0x3010fb[_0x7eca('0x3b')]][_0x7eca('0x25')]=utils['now']();queues[_0x3010fb[_0x7eca('0x3b')]]['queuecallerleaveAt']=utils[_0x7eca('0x10')]();queues[_0x3010fb[_0x7eca('0x3b')]][_0x7eca('0x41')]=0x0;queues[_0x3010fb[_0x7eca('0x3b')]][_0x7eca('0x3d')]=0x0;}else{queues[_0x3010fb[_0x7eca('0x34')]][_0x7eca('0xd')]=_0x3010fb['origtransfererlinkedid'];}}}}catch(_0x35e6d7){utils[_0x7eca('0x42')](_0x35e6d7['stack']);}};exports[_0x7eca('0x43')]=function(_0x4830f6){if(!_[_0x7eca('0x11')](queues[_0x4830f6['uniqueid']])){queues[_0x4830f6[_0x7eca('0x5')]][_0x7eca('0x44')]=utils[_0x7eca('0x10')]();}};exports['musiconholdstop']=function(_0x1eaea1){if(!_['isNil'](queues[_0x1eaea1[_0x7eca('0x5')]])){if(!_[_0x7eca('0x11')](queues[_0x1eaea1[_0x7eca('0x5')]]['musiconholdstartAt'])){queues[_0x1eaea1[_0x7eca('0x5')]]['mohtime']+=utils[_0x7eca('0x24')](utils[_0x7eca('0x10')](),queues[_0x1eaea1[_0x7eca('0x5')]][_0x7eca('0x44')]);delete queues[_0x1eaea1[_0x7eca('0x5')]][_0x7eca('0x44')];}}}; \ No newline at end of file +var _0xb49a=['origtransfererlinkedid','secondtransfererlinkedid','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','mohtime','secondtransfereruniqueid','ATTENDED','secondtransfererexten','transfertargetlinkedid','error','stack','musiconholdstartAt','musiconholdstop','lodash','util','./utils','info','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','lastAssignedTo','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','assign','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','queuestatus','queuecallerabandonAt','queuecallerexitAt','value','queueposition','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','membername','agentcomplete','reason','transfer','TRANSFER','COMPLETEDBY','toUpperCase','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfereruniqueid'];(function(_0x284ef5,_0x299b56){var _0x48f8c4=function(_0x4902a4){while(--_0x4902a4){_0x284ef5['push'](_0x284ef5['shift']());}};_0x48f8c4(++_0x299b56);}(_0xb49a,0xfb));var _0xab49=function(_0x2226c1,_0x2bed75){_0x2226c1=_0x2226c1-0x0;var _0x178716=_0xb49a[_0x2226c1];return _0x178716;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var utils=require(_0xab49('0x2'));var queues={};function writeDB(_0x1d512a){utils[_0xab49('0x3')](util['format'](_0xab49('0x4'),_0x1d512a[_0xab49('0x5')],_0x1d512a['channel'],_0x1d512a['queue'],_0x1d512a[_0xab49('0x6')],_0x1d512a[_0xab49('0x7')],_0x1d512a[_0xab49('0x8')],_0x1d512a[_0xab49('0x9')]));if(_0x1d512a[_0xab49('0xa')]){utils[_0xab49('0xb')](_0x1d512a[_0xab49('0xa')])['then'](function(_0x15f259){if(_0x15f259){_0x1d512a[_0xab49('0xc')]=_0x15f259[_0xab49('0xc')];}utils[_0xab49('0xd')](_0xab49('0xe'),_0x1d512a);});}else{utils['request']('CreateVoiceQueueReport',_0x1d512a);}if(_0x1d512a[_0xab49('0xf')]){delete queues[_0x1d512a[_0xab49('0xf')]];}else{delete queues[_0x1d512a[_0xab49('0x5')]];}}exports[_0xab49('0x10')]=function(_0x25fc7d){queues[_0x25fc7d['uniqueid']]=_[_0xab49('0x11')](_0x25fc7d,{'originalposition':_0x25fc7d[_0xab49('0x12')],'queuecallerjoinAt':utils[_0xab49('0x13')](),'mohtime':0x0});};exports[_0xab49('0x14')]=function(_0x394c1e){if(!_[_0xab49('0x15')](queues[_0x394c1e[_0xab49('0x5')]])){if(queues[_0x394c1e[_0xab49('0x5')]][_0xab49('0x16')]){if(!queues[_0x394c1e[_0xab49('0x5')]][_0xab49('0x17')]&&!queues[_0x394c1e['uniqueid']][_0xab49('0x18')]){queues[_0x394c1e[_0xab49('0x5')]][_0xab49('0x19')]=!![];queues[_0x394c1e[_0xab49('0x5')]][_0xab49('0x1a')]=utils['now']();queues[_0x394c1e[_0xab49('0x5')]][_0xab49('0x9')]=_0xab49('0x1b');}writeDB(queues[_0x394c1e[_0xab49('0x5')]]);}else{if(queues[_0x394c1e[_0xab49('0x5')]]['transfereduniqueid']){queues[queues[_0x394c1e[_0xab49('0x5')]][_0xab49('0xf')]]=queues[_0x394c1e[_0xab49('0x5')]];queues[queues[_0x394c1e['uniqueid']]['transfereduniqueid']][_0xab49('0x1c')]=0x2;delete queues[_0x394c1e[_0xab49('0x5')]];}}}};exports['varset']=function(_0x2806b){if(!_[_0xab49('0x15')](_0x2806b['variable'][_0xab49('0x1d')])){if(!_['isNil'](queues[_0x2806b[_0xab49('0x5')]])){queues[_0x2806b[_0xab49('0x5')]]['queuecallerabandon']=![];queues[_0x2806b['uniqueid']][_0xab49('0x1e')]=null;queues[_0x2806b['uniqueid']][_0xab49('0x18')]=!![];queues[_0x2806b['uniqueid']][_0xab49('0x1f')]=utils[_0xab49('0x13')]();queues[_0x2806b[_0xab49('0x5')]]['queuecallerexitreason']=_0x2806b[_0xab49('0x20')]['toUpperCase']();writeDB(queues[_0x2806b[_0xab49('0x5')]]);}}else if(!_[_0xab49('0x15')](_0x2806b['variable'][_0xab49('0x21')])){if(!_[_0xab49('0x15')](queues[_0x2806b['uniqueid']])&&!queues[_0x2806b['uniqueid']][_0xab49('0x17')]){queues[_0x2806b[_0xab49('0x5')]][_0xab49('0x17')]=![];queues[_0x2806b['uniqueid']][_0xab49('0x1e')]=null;queues[_0x2806b[_0xab49('0x5')]]['queuecallerexit']=!![];queues[_0x2806b[_0xab49('0x5')]][_0xab49('0x1f')]=utils[_0xab49('0x13')]();queues[_0x2806b['uniqueid']][_0xab49('0x9')]='EXITWITHKEY';}}};exports[_0xab49('0x17')]=function(_0x53ec05){if(!_[_0xab49('0x15')](queues[_0x53ec05['uniqueid']])){queues[_0x53ec05[_0xab49('0x5')]][_0xab49('0x18')]=![];queues[_0x53ec05[_0xab49('0x5')]][_0xab49('0x1f')]=null;queues[_0x53ec05['uniqueid']][_0xab49('0x17')]=!![];queues[_0x53ec05[_0xab49('0x5')]][_0xab49('0x1e')]=utils['now']();queues[_0x53ec05[_0xab49('0x5')]]['queuecallerexitreason']=_0xab49('0x22');}};exports['queuecallerleave']=function(_0x4dcb39){if(!_['isNil'](queues[_0x4dcb39[_0xab49('0x5')]])){queues[_0x4dcb39['uniqueid']][_0xab49('0x23')]=!![];queues[_0x4dcb39[_0xab49('0x5')]][_0xab49('0x16')]=utils['now']();queues[_0x4dcb39[_0xab49('0x5')]][_0xab49('0x24')]=utils[_0xab49('0x25')](queues[_0x4dcb39[_0xab49('0x5')]][_0xab49('0x16')],queues[_0x4dcb39['uniqueid']][_0xab49('0x26')]);queues[_0x4dcb39[_0xab49('0x5')]]['position']=_0x4dcb39['position'];queues[_0x4dcb39[_0xab49('0x5')]][_0xab49('0x27')]=_0x4dcb39[_0xab49('0x27')];queues[_0x4dcb39[_0xab49('0x5')]][_0xab49('0x28')]=_0x4dcb39[_0xab49('0x28')];queues[_0x4dcb39[_0xab49('0x5')]][_0xab49('0x29')]=_0x4dcb39[_0xab49('0x29')];}};exports[_0xab49('0x2a')]=function(_0x2b3ea5){if(!_[_0xab49('0x15')](queues[_0x2b3ea5[_0xab49('0x5')]])){queues[_0x2b3ea5['uniqueid']][_0xab49('0x17')]=![];queues[_0x2b3ea5[_0xab49('0x5')]][_0xab49('0x17')]=![];queues[_0x2b3ea5[_0xab49('0x5')]][_0xab49('0x1e')]=null;queues[_0x2b3ea5['uniqueid']][_0xab49('0x18')]=![];queues[_0x2b3ea5['uniqueid']]['queuecallerexitAt']=null;queues[_0x2b3ea5[_0xab49('0x5')]][_0xab49('0x2b')]=!![];queues[_0x2b3ea5[_0xab49('0x5')]][_0xab49('0x8')]=_0x2b3ea5[_0xab49('0x2c')];queues[_0x2b3ea5['uniqueid']][_0xab49('0x6')]=_0x2b3ea5[_0xab49('0x2d')];}};exports[_0xab49('0x2e')]=function(_0x46e02f){if(!_[_0xab49('0x15')](queues[_0x46e02f['uniqueid']])){if(queues[_0x46e02f['uniqueid']][_0xab49('0x16')]){queues[_0x46e02f[_0xab49('0x5')]][_0xab49('0x17')]=![];queues[_0x46e02f['uniqueid']][_0xab49('0x17')]=![];queues[_0x46e02f['uniqueid']]['queuecallerabandonAt']=null;queues[_0x46e02f['uniqueid']]['queuecallerexit']=![];queues[_0x46e02f[_0xab49('0x5')]][_0xab49('0x1f')]=null;queues[_0x46e02f[_0xab49('0x5')]][_0xab49('0x2b')]=!![];queues[_0x46e02f[_0xab49('0x5')]][_0xab49('0x6')]=_0x46e02f[_0xab49('0x2d')];queues[_0x46e02f[_0xab49('0x5')]][_0xab49('0x19')]=!![];queues[_0x46e02f[_0xab49('0x5')]]['queuecallercompleteAt']=utils[_0xab49('0x13')]();if(_0x46e02f[_0xab49('0x2f')]=='transfer'){if(!queues[_0x46e02f[_0xab49('0x5')]][_0xab49('0x30')]){queues[_0x46e02f[_0xab49('0x5')]][_0xab49('0x9')]=_0xab49('0x31');}}else{queues[_0x46e02f[_0xab49('0x5')]][_0xab49('0x9')]=_0xab49('0x32')+_0x46e02f['reason'][_0xab49('0x33')]();}writeDB(queues[_0x46e02f[_0xab49('0x5')]]);}}};exports[_0xab49('0x34')]=function(_0x5c206e){if(!_[_0xab49('0x15')](queues[_0x5c206e[_0xab49('0x35')]])){queues[_0x5c206e[_0xab49('0x35')]][_0xab49('0x30')]=!![];queues[_0x5c206e[_0xab49('0x35')]][_0xab49('0x36')]='BLIND';queues[_0x5c206e[_0xab49('0x35')]][_0xab49('0x37')]=_0x5c206e[_0xab49('0x38')];queues[_0x5c206e[_0xab49('0x35')]][_0xab49('0x39')]=_0x5c206e[_0xab49('0x35')];queues[_0x5c206e['transfereeuniqueid']][_0xab49('0x9')]=_0xab49('0x3a');}};exports[_0xab49('0x3b')]=function(_0xca56ce){try{if(_0xca56ce[_0xab49('0x3c')]==_0xca56ce[_0xab49('0x3d')]){if(!_[_0xab49('0x15')](queues[_0xca56ce[_0xab49('0x3e')]])){queues[_0xca56ce[_0xab49('0x3e')]][_0xab49('0x30')]=!![];queues[_0xca56ce[_0xab49('0x3e')]][_0xab49('0x36')]='ATTENDED';queues[_0xca56ce[_0xab49('0x3e')]][_0xab49('0x37')]=_0xca56ce[_0xab49('0x3f')];queues[_0xca56ce[_0xab49('0x3e')]][_0xab49('0x39')]=_0xca56ce[_0xab49('0x3c')];queues[_0xca56ce[_0xab49('0x3e')]]['queuecallerexitreason']=_0xab49('0x40');}if(!_['isNil'](queues[_0xca56ce[_0xab49('0x3d')]])){if(_0xca56ce['transfereelinkedid']&&queues[_0xca56ce[_0xab49('0x41')]]){queues[_0xca56ce[_0xab49('0x41')]]['queuecallerenterreason']=0x1;queues[_0xca56ce[_0xab49('0x35')]]=_[_0xab49('0x42')](queues[_0xca56ce[_0xab49('0x41')]]);queues[_0xca56ce[_0xab49('0x35')]][_0xab49('0xf')]=_0xca56ce[_0xab49('0x43')];queues[_0xca56ce[_0xab49('0x35')]][_0xab49('0x1c')]=0x2;queues[_0xca56ce[_0xab49('0x35')]][_0xab49('0x7')]=queues[_0xca56ce[_0xab49('0x3e')]][_0xab49('0x7')];queues[_0xca56ce[_0xab49('0x35')]][_0xab49('0x44')]=queues[_0xca56ce[_0xab49('0x3e')]][_0xab49('0x44')];queues[_0xca56ce[_0xab49('0x35')]]['queuecallerjoinAt']=utils[_0xab49('0x13')]();queues[_0xca56ce[_0xab49('0x35')]][_0xab49('0x16')]=utils[_0xab49('0x13')]();queues[_0xca56ce[_0xab49('0x35')]]['holdtime']=0x0;queues[_0xca56ce[_0xab49('0x35')]][_0xab49('0x45')]=0x0;}else{queues[_0xca56ce[_0xab49('0x3d')]][_0xab49('0xf')]=_0xca56ce[_0xab49('0x3e')];}}}else if(_0xca56ce[_0xab49('0x46')]==_0xca56ce['secondtransfererlinkedid']){if(!_[_0xab49('0x15')](queues[_0xca56ce[_0xab49('0x3d')]])){queues[_0xca56ce[_0xab49('0x3d')]][_0xab49('0x30')]=!![];queues[_0xca56ce['origtransfererlinkedid']]['transfertype']=_0xab49('0x47');queues[_0xca56ce['origtransfererlinkedid']][_0xab49('0x37')]=_0xca56ce[_0xab49('0x48')];queues[_0xca56ce[_0xab49('0x3d')]][_0xab49('0x39')]=_0xca56ce[_0xab49('0x46')];queues[_0xca56ce[_0xab49('0x3d')]][_0xab49('0x9')]=_0xab49('0x40');}if(!_['isNil'](queues[_0xca56ce[_0xab49('0x3e')]])){if(_0xca56ce[_0xab49('0x49')]&&queues[_0xca56ce[_0xab49('0x49')]]){queues[_0xca56ce[_0xab49('0x49')]][_0xab49('0x1c')]=0x1;queues[_0xca56ce['transfertargetuniqueid']]=_[_0xab49('0x42')](queues[_0xca56ce[_0xab49('0x49')]]);queues[_0xca56ce[_0xab49('0x43')]][_0xab49('0xf')]=_0xca56ce[_0xab49('0x43')];queues[_0xca56ce[_0xab49('0x43')]][_0xab49('0x1c')]=0x2;queues[_0xca56ce[_0xab49('0x43')]][_0xab49('0x7')]=queues[_0xca56ce[_0xab49('0x3d')]][_0xab49('0x7')];queues[_0xca56ce[_0xab49('0x43')]][_0xab49('0x44')]=queues[_0xca56ce['origtransfererlinkedid']][_0xab49('0x44')];queues[_0xca56ce[_0xab49('0x43')]][_0xab49('0x26')]=utils[_0xab49('0x13')]();queues[_0xca56ce[_0xab49('0x43')]][_0xab49('0x16')]=utils[_0xab49('0x13')]();queues[_0xca56ce[_0xab49('0x43')]][_0xab49('0x24')]=0x0;queues[_0xca56ce[_0xab49('0x43')]]['mohtime']=0x0;}else{queues[_0xca56ce[_0xab49('0x3e')]][_0xab49('0xf')]=_0xca56ce['origtransfererlinkedid'];}}}}catch(_0x2998f8){utils[_0xab49('0x4a')](_0x2998f8[_0xab49('0x4b')]);}};exports['musiconholdstart']=function(_0x20faaa){if(!_[_0xab49('0x15')](queues[_0x20faaa['uniqueid']])){queues[_0x20faaa['uniqueid']][_0xab49('0x4c')]=utils[_0xab49('0x13')]();}};exports[_0xab49('0x4d')]=function(_0x48fb06){if(!_['isNil'](queues[_0x48fb06[_0xab49('0x5')]])){if(!_[_0xab49('0x15')](queues[_0x48fb06[_0xab49('0x5')]][_0xab49('0x4c')])){queues[_0x48fb06[_0xab49('0x5')]][_0xab49('0x45')]+=utils[_0xab49('0x25')](utils[_0xab49('0x13')](),queues[_0x48fb06['uniqueid']]['musiconholdstartAt']);delete queues[_0x48fb06[_0xab49('0x5')]][_0xab49('0x4c')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index 4f7b80d..30ec055 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 _0x34e8=['membername','name','UserId','CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','stack','newstate','isNil','channelstate','transfer','variable','mixmonitor_filename','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','getUserByInternal','accountcode','then'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0x34e8,0x12c));var _0x834e=function(_0x3304b5,_0x30ab04){_0x3304b5=_0x3304b5-0x0;var _0x2fd83d=_0x34e8[_0x3304b5];return _0x2fd83d;};'use strict';var _=require(_0x834e('0x0'));var utils=require(_0x834e('0x1'));var recordings={};function writeDB(_0x8b339){utils[_0x834e('0x2')](_0x8b339);if(_0x8b339['accountcode']){utils[_0x834e('0x3')](_0x8b339[_0x834e('0x4')])[_0x834e('0x5')](function(_0x31bf20){if(_0x31bf20){_0x8b339[_0x834e('0x6')]=_0x31bf20[_0x834e('0x7')];_0x8b339[_0x834e('0x8')]=_0x31bf20['id'];}utils['request'](_0x834e('0x9'),_0x8b339);});}else{utils['request'](_0x834e('0x9'),_0x8b339);}}exports[_0x834e('0xa')]=function(_0x3a3ef6){try{if(_0x3a3ef6[_0x834e('0xb')]==_0x3a3ef6[_0x834e('0xc')]){recordings[_0x3a3ef6[_0x834e('0xb')]]={'uniqueid':_0x3a3ef6[_0x834e('0xb')],'accountcode':_0x3a3ef6[_0x834e('0x4')],'exten':_0x3a3ef6[_0x834e('0xd')],'context':_0x3a3ef6[_0x834e('0xe')],'channel':_0x3a3ef6[_0x834e('0xf')],'monitors':[]};}}catch(_0x36e124){utils[_0x834e('0x10')](_0x36e124[_0x834e('0x11')]);}};exports[_0x834e('0x12')]=function(_0x1e00de){try{if(!_[_0x834e('0x13')](recordings[_0x1e00de['uniqueid']])&&_0x1e00de[_0x834e('0x14')]==0x6){}else if(!_[_0x834e('0x13')](recordings[_0x1e00de['linkedid']])&&_0x1e00de[_0x834e('0x14')]==0x6&&_0x1e00de[_0x834e('0xe')]!=_0x834e('0x15')){recordings[_0x1e00de[_0x834e('0xc')]]['accountcode']=_0x1e00de[_0x834e('0x4')];}}catch(_0x302cbd){utils['error'](_0x302cbd[_0x834e('0x11')]);}};exports['varset']=function(_0x38a8cd){try{if(!_[_0x834e('0x13')](_0x38a8cd['variable'])&&!_[_0x834e('0x13')](_0x38a8cd[_0x834e('0x16')][_0x834e('0x17')])){if(_['endsWith'](_0x38a8cd[_0x834e('0x18')],_0x834e('0x19'))){_0x38a8cd[_0x834e('0x18')]=_0x38a8cd[_0x834e('0x18')][_0x834e('0x1a')](_0x834e('0x19'),_0x834e('0x1b'));}if(recordings[_0x38a8cd['linkedid']]){var _0x2545b4=_[_0x834e('0x1c')](recordings[_0x38a8cd[_0x834e('0xc')]][_0x834e('0x1d')],{'value':_0x38a8cd['value']});if(_[_0x834e('0x13')](_0x2545b4)){recordings[_0x38a8cd[_0x834e('0xc')]]['monitors'][_0x834e('0x1e')]({'value':_0x38a8cd[_0x834e('0x18')]});}}}}catch(_0x8d406e){utils['error'](_0x8d406e['stack']);}};exports[_0x834e('0x1f')]=function(_0x34563b){try{if(!_['isNil'](recordings[_0x34563b[_0x834e('0xb')]])){recordings[_0x34563b[_0x834e('0xb')]]['calleridnum']=_0x34563b[_0x834e('0x20')];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x21')]=_0x34563b['calleridname'];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x22')]=_0x34563b['connectedlinenum'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]=_0x34563b['connectedlinename'];if(recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x24')]==_0x834e('0x25')&&recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x4')]){recordings[_0x34563b[_0x834e('0xb')]]['connectedlinenum']=recordings[_0x34563b['uniqueid']]['accountcode'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]='';}recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x1d')]['forEach'](_0xb5bc06=>{var _0x11f1ce=_[_0x834e('0x26')](recordings[_0x34563b[_0x834e('0xb')]]);_0x11f1ce[_0x834e('0x18')]=_0xb5bc06[_0x834e('0x18')];writeDB(_0x11f1ce);});delete recordings[_0x34563b[_0x834e('0xb')]];}}catch(_0xfaf716){utils[_0x834e('0x10')](_0xfaf716['stack']);}};exports[_0x834e('0x27')]=function(_0x5cad11){try{if(!_[_0x834e('0x13')](recordings[_0x5cad11[_0x834e('0xb')]])){if(_0x5cad11[_0x834e('0x28')][_0x834e('0x29')]()==_0x834e('0x2a')&&_[_0x834e('0x2b')](_0x5cad11[_0x834e('0x2c')][_0x834e('0x29')](),_0x834e('0x2d'))){var _0x12b2bc=_0x5cad11['appdata'][_0x834e('0x2e')]('=');var _0x2f408a=_0x12b2bc[0x0][_0x834e('0x2f')](_0x12b2bc[0x0][_0x834e('0x30')]('(')+0x1,_0x12b2bc[0x0]['lastIndexOf'](')'));var _0x3f88ad=_0x12b2bc[0x1];recordings[_0x5cad11[_0x834e('0xb')]][_0x2f408a]=_0x3f88ad;}}}catch(_0x4b12f5){utils['error'](_0x4b12f5['stack']);}};exports[_0x834e('0x31')]=function(_0x41bf4d){try{if(!_[_0x834e('0x13')](recordings[_0x41bf4d[_0x834e('0xb')]])){recordings[_0x41bf4d[_0x834e('0xb')]][_0x834e('0x32')]=_0x41bf4d['queue'];}}catch(_0x2c2d94){utils['error'](_0x2c2d94[_0x834e('0x11')]);}}; \ No newline at end of file +var _0xa9e0=['application','set','appdata','toLowerCase','cdr','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','getUserByInternal','then','membername','name','UserId','CreateVoiceRecording','request','uniqueid','accountcode','exten','context','channel','isNil','channelstate','linkedid','transfer','error','varset','variable','endsWith','.wav49','value','replace','.WAV','find','monitors','stack','hangup','calleridnum','calleridname','connectedlinename','outbound','connectedlinenum','forEach','clone','newexten'];(function(_0x158f01,_0x12af3e){var _0x5ef74e=function(_0x5e7adc){while(--_0x5e7adc){_0x158f01['push'](_0x158f01['shift']());}};_0x5ef74e(++_0x12af3e);}(_0xa9e0,0x123));var _0x0a9e=function(_0xea8947,_0x1b573d){_0xea8947=_0xea8947-0x0;var _0x2455e9=_0xa9e0[_0xea8947];return _0x2455e9;};'use strict';var _=require(_0x0a9e('0x0'));var utils=require(_0x0a9e('0x1'));var recordings={};function writeDB(_0x29929c){utils['debug'](_0x29929c);if(_0x29929c['accountcode']){utils[_0x0a9e('0x2')](_0x29929c['accountcode'])[_0x0a9e('0x3')](function(_0x432180){if(_0x432180){_0x29929c[_0x0a9e('0x4')]=_0x432180[_0x0a9e('0x5')];_0x29929c[_0x0a9e('0x6')]=_0x432180['id'];}utils['request'](_0x0a9e('0x7'),_0x29929c);});}else{utils[_0x0a9e('0x8')](_0x0a9e('0x7'),_0x29929c);}}exports['newchannel']=function(_0x503809){try{if(_0x503809[_0x0a9e('0x9')]==_0x503809['linkedid']){recordings[_0x503809['uniqueid']]={'uniqueid':_0x503809[_0x0a9e('0x9')],'accountcode':_0x503809[_0x0a9e('0xa')],'exten':_0x503809[_0x0a9e('0xb')],'context':_0x503809[_0x0a9e('0xc')],'channel':_0x503809[_0x0a9e('0xd')],'monitors':[]};}}catch(_0xbd1168){utils['error'](_0xbd1168['stack']);}};exports['newstate']=function(_0x4cfe67){try{if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x9')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6){}else if(!_[_0x0a9e('0xe')](recordings[_0x4cfe67[_0x0a9e('0x10')]])&&_0x4cfe67[_0x0a9e('0xf')]==0x6&&_0x4cfe67['context']!=_0x0a9e('0x11')){recordings[_0x4cfe67[_0x0a9e('0x10')]][_0x0a9e('0xa')]=_0x4cfe67[_0x0a9e('0xa')];}}catch(_0x44dcfd){utils[_0x0a9e('0x12')](_0x44dcfd['stack']);}};exports[_0x0a9e('0x13')]=function(_0x5d0880){try{if(!_[_0x0a9e('0xe')](_0x5d0880['variable'])&&!_[_0x0a9e('0xe')](_0x5d0880[_0x0a9e('0x14')]['mixmonitor_filename'])){if(_[_0x0a9e('0x15')](_0x5d0880['value'],_0x0a9e('0x16'))){_0x5d0880[_0x0a9e('0x17')]=_0x5d0880[_0x0a9e('0x17')][_0x0a9e('0x18')](_0x0a9e('0x16'),_0x0a9e('0x19'));}if(recordings[_0x5d0880[_0x0a9e('0x10')]]){var _0x20559e=_[_0x0a9e('0x1a')](recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')],{'value':_0x5d0880[_0x0a9e('0x17')]});if(_['isNil'](_0x20559e)){recordings[_0x5d0880[_0x0a9e('0x10')]][_0x0a9e('0x1b')]['push']({'value':_0x5d0880[_0x0a9e('0x17')]});}}}}catch(_0x5a09ef){utils['error'](_0x5a09ef[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x1d')]=function(_0x38e7c4){try{if(!_[_0x0a9e('0xe')](recordings[_0x38e7c4['uniqueid']])){recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1e')]=_0x38e7c4[_0x0a9e('0x1e')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1f')]=_0x38e7c4[_0x0a9e('0x1f')];recordings[_0x38e7c4[_0x0a9e('0x9')]]['connectedlinenum']=_0x38e7c4['connectedlinenum'];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]=_0x38e7c4[_0x0a9e('0x20')];if(recordings[_0x38e7c4[_0x0a9e('0x9')]]['type']==_0x0a9e('0x21')&&recordings[_0x38e7c4['uniqueid']][_0x0a9e('0xa')]){recordings[_0x38e7c4['uniqueid']][_0x0a9e('0x22')]=recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0xa')];recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x20')]='';}recordings[_0x38e7c4[_0x0a9e('0x9')]][_0x0a9e('0x1b')][_0x0a9e('0x23')](_0x5a101a=>{var _0x3652a7=_[_0x0a9e('0x24')](recordings[_0x38e7c4[_0x0a9e('0x9')]]);_0x3652a7[_0x0a9e('0x17')]=_0x5a101a['value'];writeDB(_0x3652a7);});delete recordings[_0x38e7c4[_0x0a9e('0x9')]];}}catch(_0x40e7a3){utils[_0x0a9e('0x12')](_0x40e7a3[_0x0a9e('0x1c')]);}};exports[_0x0a9e('0x25')]=function(_0x563b45){try{if(!_[_0x0a9e('0xe')](recordings[_0x563b45[_0x0a9e('0x9')]])){if(_0x563b45[_0x0a9e('0x26')]['toLowerCase']()==_0x0a9e('0x27')&&_['startsWith'](_0x563b45[_0x0a9e('0x28')][_0x0a9e('0x29')](),_0x0a9e('0x2a'))){var _0x33bdb7=_0x563b45[_0x0a9e('0x28')]['split']('=');var _0x66c1d2=_0x33bdb7[0x0][_0x0a9e('0x2b')](_0x33bdb7[0x0][_0x0a9e('0x2c')]('(')+0x1,_0x33bdb7[0x0][_0x0a9e('0x2c')](')'));var _0x2b45ea=_0x33bdb7[0x1];recordings[_0x563b45[_0x0a9e('0x9')]][_0x66c1d2]=_0x2b45ea;}}}catch(_0x332d35){utils[_0x0a9e('0x12')](_0x332d35['stack']);}};exports[_0x0a9e('0x2d')]=function(_0x5e7238){try{if(!_[_0x0a9e('0xe')](recordings[_0x5e7238[_0x0a9e('0x9')]])){recordings[_0x5e7238[_0x0a9e('0x9')]][_0x0a9e('0x2e')]=_0x5e7238['queue'];}}catch(_0x191e91){utils[_0x0a9e('0x12')](_0x191e91[_0x0a9e('0x1c')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 5b7c442..597a4c8 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 _0xb26e=['transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','info','format','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransferercalleridnum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransferercontext','origtransfererexten','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridname'];(function(_0x260e3f,_0x3ba643){var _0x32fddb=function(_0x3549d8){while(--_0x3549d8){_0x260e3f['push'](_0x260e3f['shift']());}};_0x32fddb(++_0x3ba643);}(_0xb26e,0x11d));var _0xeb26=function(_0x3e3da5,_0x4de4eb){_0x3e3da5=_0x3e3da5-0x0;var _0x363860=_0xb26e[_0x3e3da5];return _0x363860;};'use strict';var _=require(_0xeb26('0x0'));var util=require('util');var utils=require('./utils');function writeDB(_0x522afd){utils[_0xeb26('0x1')](util[_0xeb26('0x2')]('TRANSFER|%s',_0x522afd[_0xeb26('0x3')]));utils[_0xeb26('0x4')](_0xeb26('0x5'),_0x522afd);}exports[_0xeb26('0x6')]=function(_0x2a5680){try{_0x2a5680[_0xeb26('0x3')]=_0xeb26('0x7');writeDB(_0x2a5680);}catch(_0xc0d644){utils[_0xeb26('0x8')](_0xc0d644[_0xeb26('0x9')]);}};exports[_0xeb26('0xa')]=function(_0x476193){try{_0x476193=_[_0xeb26('0xb')](_0x476193,{'transfererchannel':_0x476193['origtransfererchannel'],'transferercalleridnum':_0x476193[_0xeb26('0xc')],'transferercalleridname':_0x476193['origtransferercalleridname'],'transfererconnectedlinenum':_0x476193['secondtransfererconnectedlinenum'],'transfererconnectedlinename':_0x476193[_0xeb26('0xd')],'transfereraccountcode':_0x476193[_0xeb26('0xe')],'transferercontext':_0x476193['secondtransferercontext'],'transfererexten':_0x476193[_0xeb26('0xf')],'transfererlinkedid':_0x476193['origtransfererlinkedid'],'context':_0x476193[_0xeb26('0x10')],'extension':_0x476193[_0xeb26('0x11')],'type':_0xeb26('0x12')});if(_[_0xeb26('0x13')](_0x476193[_0xeb26('0x14')])){_0x476193=_[_0xeb26('0xb')](_0x476193,{'transfereechannel':_0x476193[_0xeb26('0x15')],'transfereecalleridnum':_0x476193['transfertargetcalleridnum'],'transfereecalleridname':_0x476193[_0xeb26('0x16')],'transfereeconnectedlinenum':_0x476193[_0xeb26('0x17')],'transfereeconnectedlinename':_0x476193['transfertargetconnectedlinename'],'transfereeaccountcode':_0x476193[_0xeb26('0x18')],'transfereecontext':_0x476193[_0xeb26('0x19')],'transfereeexten':_0x476193[_0xeb26('0x1a')],'transfereelinkedid':_0x476193[_0xeb26('0x1b')]});}writeDB(_0x476193);}catch(_0x54740f){utils[_0xeb26('0x8')](_0x54740f[_0xeb26('0x9')]);}}; \ No newline at end of file +var _0xfd3a=['blindtransfer','type','blind','error','attendedtransfer','assign','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransfererexten','origtransfererlinkedid','origtransferercontext','attended','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinename','stack','./utils','format','TRANSFER|%s','request','CreateVoiceTransferReport'];(function(_0x3ebaf7,_0xb468e1){var _0x20323a=function(_0x21cb1f){while(--_0x21cb1f){_0x3ebaf7['push'](_0x3ebaf7['shift']());}};_0x20323a(++_0xb468e1);}(_0xfd3a,0xb1));var _0xafd3=function(_0x4b7867,_0x40e074){_0x4b7867=_0x4b7867-0x0;var _0x44daf8=_0xfd3a[_0x4b7867];return _0x44daf8;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xafd3('0x0'));function writeDB(_0x5c46f7){utils['info'](util[_0xafd3('0x1')](_0xafd3('0x2'),_0x5c46f7['type']));utils[_0xafd3('0x3')](_0xafd3('0x4'),_0x5c46f7);}exports[_0xafd3('0x5')]=function(_0x561839){try{_0x561839[_0xafd3('0x6')]=_0xafd3('0x7');writeDB(_0x561839);}catch(_0x2d6d7d){utils[_0xafd3('0x8')](_0x2d6d7d['stack']);}};exports[_0xafd3('0x9')]=function(_0x18f2e8){try{_0x18f2e8=_[_0xafd3('0xa')](_0x18f2e8,{'transfererchannel':_0x18f2e8['origtransfererchannel'],'transferercalleridnum':_0x18f2e8[_0xafd3('0xb')],'transferercalleridname':_0x18f2e8[_0xafd3('0xc')],'transfererconnectedlinenum':_0x18f2e8[_0xafd3('0xd')],'transfererconnectedlinename':_0x18f2e8[_0xafd3('0xe')],'transfereraccountcode':_0x18f2e8[_0xafd3('0xf')],'transferercontext':_0x18f2e8['secondtransferercontext'],'transfererexten':_0x18f2e8[_0xafd3('0x10')],'transfererlinkedid':_0x18f2e8[_0xafd3('0x11')],'context':_0x18f2e8[_0xafd3('0x12')],'extension':_0x18f2e8['origtransfererexten'],'type':_0xafd3('0x13')});if(_['isNil'](_0x18f2e8[_0xafd3('0x14')])){_0x18f2e8=_[_0xafd3('0xa')](_0x18f2e8,{'transfereechannel':_0x18f2e8[_0xafd3('0x15')],'transfereecalleridnum':_0x18f2e8[_0xafd3('0x16')],'transfereecalleridname':_0x18f2e8[_0xafd3('0x17')],'transfereeconnectedlinenum':_0x18f2e8['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x18f2e8[_0xafd3('0x18')],'transfereeaccountcode':_0x18f2e8['transfertargetaccountcode'],'transfereecontext':_0x18f2e8['transfertargetcontext'],'transfereeexten':_0x18f2e8['transfertargetexten'],'transfereelinkedid':_0x18f2e8['transfertargetlinkedid']});}writeDB(_0x18f2e8);}catch(_0x70cdd0){utils[_0xafd3('0x8')](_0x70cdd0[_0xafd3('0x19')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 700a5be..17d7703 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 _0x9651=['length','NOTFOUND','result','getUserByInternal','getUserByInterface','getVoiceQueueByName','GETVOICEQUEUEBYNAME|','addTime','seconds','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','format','now','isAfter','isBefore','jayson/promise','../../config/logger','info','debug','stringify','error','stack','request','then','catch','name','interface','GETUSER|'];(function(_0x5df9d0,_0x8bdf1e){var _0x5826e8=function(_0x21f1e6){while(--_0x21f1e6){_0x5df9d0['push'](_0x5df9d0['shift']());}};_0x5826e8(++_0x8bdf1e);}(_0x9651,0x189));var _0x1965=function(_0x283ddb,_0x3d14f1){_0x283ddb=_0x283ddb-0x0;var _0x1e5cf4=_0x9651[_0x283ddb];return _0x1e5cf4;};'use strict';var jayson=require(_0x1965('0x0'));var moment=require('moment');var BPromise=require('bluebird');var client=jayson['client']['http']({'port':0x2329});var logger=require(_0x1965('0x1'))('xdr');exports[_0x1965('0x2')]=function(_0x585ca9){logger[_0x1965('0x2')](_0x585ca9);};exports['debug']=function(_0x9884c6){logger[_0x1965('0x3')](JSON[_0x1965('0x4')](_0x9884c6));};exports[_0x1965('0x5')]=function(_0x114b96){logger[_0x1965('0x5')](_0x114b96[_0x1965('0x6')]);};exports[_0x1965('0x7')]=function(_0x43dbd1,_0x4ea73e){return client[_0x1965('0x7')](_0x43dbd1,{'body':_0x4ea73e})[_0x1965('0x8')](function(_0x44202c){logger['debug'](JSON[_0x1965('0x4')](_0x44202c));})[_0x1965('0x9')](function(_0x214baf){logger[_0x1965('0x5')](_0x214baf[_0x1965('0x6')]);});};function getUser(_0x2642d8){return client[_0x1965('0x7')]('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x1965('0xa'),_0x1965('0xb')],'where':_0x2642d8,'limit':0x1}})['then'](function(_0x2814d2){logger['info'](_0x1965('0xc')+JSON[_0x1965('0x4')](_0x2642d8)+'|'+(_0x2814d2['result'][_0x1965('0xd')]?'FOUND':_0x1965('0xe')));return _0x2814d2['result'][_0x1965('0xd')]?_0x2814d2[_0x1965('0xf')][0x0]:null;});}exports[_0x1965('0x10')]=function(_0x3ba003){return new BPromise(function(_0x4c7072,_0xce3581){if(_0x3ba003){return getUser({'internal':_0x3ba003})[_0x1965('0x8')](function(_0x5ba31a){return _0x4c7072(_0x5ba31a);})[_0x1965('0x9')](function(_0x2efc09){logger[_0x1965('0x5')](_0x2efc09[_0x1965('0x6')]);return _0x4c7072(null);});}else{return _0x4c7072(null);}});};exports[_0x1965('0x11')]=function(_0x3567f4){return new BPromise(function(_0x4776f9,_0x14f7b3){if(_0x3567f4){return getUser({'interface':_0x3567f4})['then'](function(_0x2a7913){return _0x4776f9(_0x2a7913);})['catch'](function(_0x1973d9){logger[_0x1965('0x5')](_0x1973d9[_0x1965('0x6')]);return _0x4776f9(null);});}else{return _0x4776f9(null);}});};exports['getUserByName']=function(_0x2a6abd){return new BPromise(function(_0x16c766,_0x158de3){if(_0x2a6abd){return getUser({'name':_0x2a6abd})[_0x1965('0x8')](function(_0x19edc3){return _0x16c766(_0x19edc3);})['catch'](function(_0x1b1dec){logger[_0x1965('0x5')](_0x1b1dec[_0x1965('0x6')]);return _0x16c766(null);});}else{return _0x16c766(null);}});};exports[_0x1965('0x12')]=function(_0x931426){return new BPromise(function(_0x876cf2,_0x281f6e){if(_0x931426){return client['request']('GetVoiceQueue',{'options':{'raw':!![],'attributes':['id','name','type','acw','acwTimeout'],'where':{'name':_0x931426},'limit':0x1}})['then'](function(_0x518ad3){logger['info'](_0x1965('0x13')+_0x931426+'|'+(_0x518ad3[_0x1965('0xf')][_0x1965('0xd')]?'FOUND':'NOTFOUND'));return _0x876cf2(_0x518ad3[_0x1965('0xf')][_0x1965('0xd')]?_0x518ad3[_0x1965('0xf')][0x0]:null);})[_0x1965('0x9')](function(_0x4cd393){logger[_0x1965('0x5')](_0x4cd393[_0x1965('0x6')]);return _0x876cf2(null);});}else{return _0x876cf2(null);}});};exports[_0x1965('0x14')]=function(_0x42294a,_0x5eb68d){return moment(_0x42294a)['add'](_0x5eb68d,_0x1965('0x15'))['format'](_0x1965('0x16'));};exports[_0x1965('0x17')]=function(_0x9143ef,_0x472589){return moment(_0x9143ef)[_0x1965('0x18')](_0x472589,_0x1965('0x15'))[_0x1965('0x19')](_0x1965('0x16'));};exports['diffTime']=function(_0x4ed870,_0x1d4e11){return moment(_0x4ed870)['diff'](moment(_0x1d4e11),'seconds');};exports['sumTime']=function(_0x77f88d,_0x4c630f){return parseInt(_0x77f88d,0xa)+parseInt(_0x4c630f,0xa);};exports[_0x1965('0x1a')]=function(){return moment()[_0x1965('0x19')](_0x1965('0x16'));};exports[_0x1965('0x1b')]=function(_0x4b2f49,_0x17e1c4){if(_0x17e1c4){return moment(_0x4b2f49)[_0x1965('0x1b')](_0x17e1c4);}else{return!![];}};exports[_0x1965('0x1c')]=function(_0x3460fe,_0xf40dac){if(_0xf40dac){return moment(_0x3460fe)['isBefore'](_0xf40dac);}else if(_0x3460fe){return!![];}else{return![];}}; \ No newline at end of file +var _0xd640=['isAfter','isBefore','jayson/promise','moment','bluebird','http','../../config/logger','xdr','debug','error','stack','request','then','stringify','GetUser','internal','name','interface','info','GETUSER|','FOUND','NOTFOUND','result','length','getUserByInternal','getUserByInterface','catch','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','seconds','format','subtract','YYYY-MM-DD\x20HH:mm:ss','diffTime','diff'];(function(_0x1a555e,_0x3f9a08){var _0xbc254c=function(_0xd1dc24){while(--_0xd1dc24){_0x1a555e['push'](_0x1a555e['shift']());}};_0xbc254c(++_0x3f9a08);}(_0xd640,0xca));var _0x0d64=function(_0x4dfcdc,_0x32f3de){_0x4dfcdc=_0x4dfcdc-0x0;var _0x31bbaa=_0xd640[_0x4dfcdc];return _0x31bbaa;};'use strict';var jayson=require(_0x0d64('0x0'));var moment=require(_0x0d64('0x1'));var BPromise=require(_0x0d64('0x2'));var client=jayson['client'][_0x0d64('0x3')]({'port':0x2329});var logger=require(_0x0d64('0x4'))(_0x0d64('0x5'));exports['info']=function(_0x649ce){logger['info'](_0x649ce);};exports[_0x0d64('0x6')]=function(_0x573a5a){logger[_0x0d64('0x6')](JSON['stringify'](_0x573a5a));};exports[_0x0d64('0x7')]=function(_0x185d02){logger[_0x0d64('0x7')](_0x185d02[_0x0d64('0x8')]);};exports[_0x0d64('0x9')]=function(_0x18646d,_0x3e0a95){return client['request'](_0x18646d,{'body':_0x3e0a95})[_0x0d64('0xa')](function(_0x23ce33){logger['debug'](JSON[_0x0d64('0xb')](_0x23ce33));})['catch'](function(_0x5696d3){logger[_0x0d64('0x7')](_0x5696d3[_0x0d64('0x8')]);});};function getUser(_0xb66f59){return client[_0x0d64('0x9')](_0x0d64('0xc'),{'options':{'raw':!![],'attributes':['id',_0x0d64('0xd'),_0x0d64('0xe'),_0x0d64('0xf')],'where':_0xb66f59,'limit':0x1}})['then'](function(_0x1fde33){logger[_0x0d64('0x10')](_0x0d64('0x11')+JSON[_0x0d64('0xb')](_0xb66f59)+'|'+(_0x1fde33['result']['length']?_0x0d64('0x12'):_0x0d64('0x13')));return _0x1fde33[_0x0d64('0x14')][_0x0d64('0x15')]?_0x1fde33[_0x0d64('0x14')][0x0]:null;});}exports[_0x0d64('0x16')]=function(_0x1d4d77){return new BPromise(function(_0x3bf955,_0x70fb12){if(_0x1d4d77){return getUser({'internal':_0x1d4d77})[_0x0d64('0xa')](function(_0x1dfd1b){return _0x3bf955(_0x1dfd1b);})['catch'](function(_0x36c07c){logger[_0x0d64('0x7')](_0x36c07c[_0x0d64('0x8')]);return _0x3bf955(null);});}else{return _0x3bf955(null);}});};exports[_0x0d64('0x17')]=function(_0x130e7d){return new BPromise(function(_0x1cea5b,_0x13db27){if(_0x130e7d){return getUser({'interface':_0x130e7d})[_0x0d64('0xa')](function(_0x2e553e){return _0x1cea5b(_0x2e553e);})[_0x0d64('0x18')](function(_0x824617){logger[_0x0d64('0x7')](_0x824617[_0x0d64('0x8')]);return _0x1cea5b(null);});}else{return _0x1cea5b(null);}});};exports[_0x0d64('0x19')]=function(_0x58c331){return new BPromise(function(_0x3bbeca,_0x4da727){if(_0x58c331){return getUser({'name':_0x58c331})[_0x0d64('0xa')](function(_0x1ca521){return _0x3bbeca(_0x1ca521);})['catch'](function(_0x3203ae){logger[_0x0d64('0x7')](_0x3203ae['stack']);return _0x3bbeca(null);});}else{return _0x3bbeca(null);}});};exports[_0x0d64('0x1a')]=function(_0x330fd9){return new BPromise(function(_0x288721,_0x1cdcb3){if(_0x330fd9){return client[_0x0d64('0x9')](_0x0d64('0x1b'),{'options':{'raw':!![],'attributes':['id','name',_0x0d64('0x1c'),_0x0d64('0x1d'),_0x0d64('0x1e')],'where':{'name':_0x330fd9},'limit':0x1}})[_0x0d64('0xa')](function(_0x485923){logger[_0x0d64('0x10')](_0x0d64('0x1f')+_0x330fd9+'|'+(_0x485923[_0x0d64('0x14')][_0x0d64('0x15')]?'FOUND':_0x0d64('0x13')));return _0x288721(_0x485923[_0x0d64('0x14')]['length']?_0x485923[_0x0d64('0x14')][0x0]:null);})[_0x0d64('0x18')](function(_0x39d4eb){logger[_0x0d64('0x7')](_0x39d4eb[_0x0d64('0x8')]);return _0x288721(null);});}else{return _0x288721(null);}});};exports['addTime']=function(_0x524ee0,_0x2b1225){return moment(_0x524ee0)['add'](_0x2b1225,_0x0d64('0x20'))[_0x0d64('0x21')]('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x59b50d,_0x3049a8){return moment(_0x59b50d)[_0x0d64('0x22')](_0x3049a8,_0x0d64('0x20'))[_0x0d64('0x21')](_0x0d64('0x23'));};exports[_0x0d64('0x24')]=function(_0x584fe1,_0x12de14){return moment(_0x584fe1)[_0x0d64('0x25')](moment(_0x12de14),'seconds');};exports['sumTime']=function(_0x296dda,_0x10ae91){return parseInt(_0x296dda,0xa)+parseInt(_0x10ae91,0xa);};exports['now']=function(){return moment()[_0x0d64('0x21')](_0x0d64('0x23'));};exports[_0x0d64('0x26')]=function(_0x17f736,_0x758e90){if(_0x758e90){return moment(_0x17f736)[_0x0d64('0x26')](_0x758e90);}else{return!![];}};exports['isBefore']=function(_0xebdd5b,_0x2181bb){if(_0x2181bb){return moment(_0xebdd5b)[_0x0d64('0x27')](_0x2181bb);}else if(_0xebdd5b){return!![];}else{return![];}}; \ No newline at end of file